From 32f65a1ec79a9c360515821dfeb59b91eaefa4cf Mon Sep 17 00:00:00 2001 From: support Date: Wed, 26 Oct 2022 13:35:20 +0000 Subject: [PATCH] Built motion from commit 92278a62.|2.6.19 --- apidoc/api_project.js | 4 ++-- apidoc/api_project.json | 4 ++-- npm-shrinkwrap.json | 2 +- package.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/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 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/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 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.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/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/components/realtime/queues.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.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/events.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/project.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/index.js | 2 +- server/services/ami/dialer/models/action.js | 2 +- server/services/ami/dialer/models/agentComplete.js | 2 +- server/services/ami/dialer/models/final.js | 2 +- server/services/ami/dialer/models/hangup.js | 2 +- server/services/ami/dialer/models/history.js | 2 +- .../ami/dialer/models/queueCallerAbandon.js | 2 +- server/services/ami/dialer/utils/hopper.js | 2 +- server/services/ami/dialer/utils/index.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/voiceQueueSummary.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/realtime/utils.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/cmHopperAdditionalPhone.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/interval.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/iftime.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- server/utils/update-app-config.js | 2 +- snippet/3.5.0/index.html | 2 +- 1206 files changed, 1208 insertions(+), 1208 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 72584d1..1a9ff3f 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1,6 +1,6 @@ define({ "name": "xCALLY Motion API", - "version": "2.6.20", + "version": "2.6.19", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-10-26T12:04:32.698Z", + "time": "2022-10-26T13:25:58.962Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index b881c6a..cb526c2 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1,6 +1,6 @@ { "name": "xCALLY Motion API", - "version": "2.6.20", + "version": "2.6.19", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-10-26T12:04:32.698Z", + "time": "2022-10-26T13:25:58.962Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 1ceedbc..0549b25 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.20", + "version": "2.6.19", "dependencies": { "@babel/code-frame": { "version": "7.18.6", diff --git a/package.json b/package.json index 79e37a8..f66562f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.20", + "version": "2.6.19", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index d868ee3..1931fa6 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 _0x7a95=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','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)]'];(function(_0x5e84ee,_0x4e49af){var _0x14a436=function(_0x5ba5eb){while(--_0x5ba5eb){_0x5e84ee['push'](_0x5e84ee['shift']());}};_0x14a436(++_0x4e49af);}(_0x7a95,0xa5));var _0x57a9=function(_0x28259f,_0x4f7913){_0x28259f=_0x28259f-0x0;var _0x3d4d2b=_0x7a95[_0x28259f];return _0x3d4d2b;};'use strict';var Sequelize=require('sequelize');module[_0x57a9('0x0')]={'name':{'type':Sequelize[_0x57a9('0x1')],'get':function(_0x4620d1){return this[_0x57a9('0x2')](_0x57a9('0x3'));}},'action':{'type':Sequelize[_0x57a9('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x57a9('0x5'),_0x57a9('0x6'),_0x57a9('0x7'),_0x57a9('0x8'),_0x57a9('0x9'),_0x57a9('0xa'),_0x57a9('0xb'),_0x57a9('0xc')]],'msg':_0x57a9('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x57a9('0xe')},'data2':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comment':_0x57a9('0xf')},'data3':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comment':_0x57a9('0x10')},'data4':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comments':_0x57a9('0x11')},'data6':{'type':Sequelize[_0x57a9('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x57a9('0x12')],'comments':_0x57a9('0x13')}}; \ No newline at end of file +var _0xaa65=['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[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar'];(function(_0x4cdcba,_0x34b28e){var _0x285181=function(_0x462f53){while(--_0x462f53){_0x4cdcba['push'](_0x4cdcba['shift']());}};_0x285181(++_0x34b28e);}(_0xaa65,0x90));var _0x5aa6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa65[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x5aa6('0x0'));module[_0x5aa6('0x1')]={'name':{'type':Sequelize[_0x5aa6('0x2')],'get':function(_0xcc6470){return this['getDataValue'](_0x5aa6('0x3'));}},'action':{'type':Sequelize[_0x5aa6('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5aa6('0x5'),_0x5aa6('0x6'),_0x5aa6('0x7'),'jscripty','urlForward',_0x5aa6('0x8'),_0x5aa6('0x9'),_0x5aa6('0xa')]],'msg':_0x5aa6('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comment':_0x5aa6('0xc')},'data2':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comment':_0x5aa6('0xd')},'data3':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comment':_0x5aa6('0xe')},'data4':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comments':_0x5aa6('0xf')},'data5':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comments':_0x5aa6('0x10')},'data6':{'type':Sequelize[_0x5aa6('0x4')],'comments':_0x5aa6('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0x5aa6('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 2b3c200..42fe1e6 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 _0xc5a0=['stack','name','send','update','body','Action','params','catch','eml-format','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error'];(function(_0x5adb00,_0x329c2a){var _0xc32601=function(_0x4bdff8){while(--_0x4bdff8){_0x5adb00['push'](_0x5adb00['shift']());}};_0xc32601(++_0x329c2a);}(_0xc5a0,0xbc));var _0x0c5a=function(_0x504f5d,_0xefefa7){_0x504f5d=_0x504f5d-0x0;var _0x3f794d=_0xc5a0[_0x504f5d];return _0x3f794d;};'use strict';var emlformat=require(_0x0c5a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0c5a('0x1'));var rp=require('request-promise');var moment=require(_0x0c5a('0x2'));var BPromise=require(_0x0c5a('0x3'));var Mustache=require(_0x0c5a('0x4'));var util=require(_0x0c5a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0c5a('0x6'));var ejs=require(_0x0c5a('0x7'));var fs=require('fs');var fs_extra=require(_0x0c5a('0x8'));var _=require(_0x0c5a('0x9'));var squel=require(_0x0c5a('0xa'));var crypto=require(_0x0c5a('0xb'));var jsforce=require(_0x0c5a('0xc'));var deskjs=require(_0x0c5a('0xd'));var toCsv=require(_0x0c5a('0x6'));var querystring=require(_0x0c5a('0xe'));var Papa=require('papaparse');var Redis=require(_0x0c5a('0xf'));var authService=require(_0x0c5a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c5a('0x11'));var logger=require(_0x0c5a('0x12'))('api');var utils=require(_0x0c5a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0c5a('0x14'));var db=require(_0x0c5a('0x15'))['db'];function respondWithStatusCode(_0x14cd6b,_0x324ae9){_0x324ae9=_0x324ae9||0xcc;return function(_0x289a0c){if(_0x289a0c){return _0x14cd6b['sendStatus'](_0x324ae9);}return _0x14cd6b['status'](_0x324ae9)[_0x0c5a('0x16')]();};}function respondWithResult(_0x56c3b1,_0x7c71a8){_0x7c71a8=_0x7c71a8||0xc8;return function(_0x138720){if(_0x138720){return _0x56c3b1[_0x0c5a('0x17')](_0x7c71a8)[_0x0c5a('0x18')](_0x138720);}};}function respondWithFilteredResult(_0x396bf2,_0x5e50b9){return function(_0x443258){if(_0x443258){var _0x73520f=typeof _0x5e50b9[_0x0c5a('0x19')]===_0x0c5a('0x1a')&&typeof _0x5e50b9['limit']===_0x0c5a('0x1a');var _0x3bf1db=_0x443258[_0x0c5a('0x1b')];var _0x425ac7=_0x73520f?0x0:_0x5e50b9[_0x0c5a('0x19')];var _0x43cc7b=_0x73520f?_0x443258[_0x0c5a('0x1b')]:_0x5e50b9[_0x0c5a('0x19')]+_0x5e50b9[_0x0c5a('0x1c')];var _0x4475f5;if(_0x43cc7b>=_0x3bf1db){_0x43cc7b=_0x3bf1db;_0x4475f5=0xc8;}else{_0x4475f5=0xce;}_0x396bf2[_0x0c5a('0x17')](_0x4475f5);return _0x396bf2[_0x0c5a('0x1d')](_0x0c5a('0x1e'),_0x425ac7+'-'+_0x43cc7b+'/'+_0x3bf1db)[_0x0c5a('0x18')](_0x443258);}return null;};}function patchUpdates(_0x1a933a){return function(_0x1f05f0){try{jsonpatch[_0x0c5a('0x1f')](_0x1f05f0,_0x1a933a,!![]);}catch(_0x332993){return BPromise[_0x0c5a('0x20')](_0x332993);}return _0x1f05f0[_0x0c5a('0x21')]();};}function saveUpdates(_0x2b9586,_0x2dabcb){return function(_0x3f599c){if(_0x3f599c){return _0x3f599c['update'](_0x2b9586)[_0x0c5a('0x22')](function(_0x4d00d4){return _0x4d00d4;});}return null;};}function removeEntity(_0x575f5e,_0x457d63){return function(_0x26de60){if(_0x26de60){return _0x26de60[_0x0c5a('0x23')]()['then'](function(){_0x575f5e[_0x0c5a('0x17')](0xcc)[_0x0c5a('0x16')]();});}};}function handleEntityNotFound(_0x91c3ed,_0x29a79f){return function(_0x1d5ee9){if(!_0x1d5ee9){_0x91c3ed['sendStatus'](0x194);}return _0x1d5ee9;};}function handleError(_0x44b87c,_0x1ff181){_0x1ff181=_0x1ff181||0x1f4;return function(_0x3ceee3){logger[_0x0c5a('0x24')](_0x3ceee3[_0x0c5a('0x25')]);if(_0x3ceee3[_0x0c5a('0x26')]){delete _0x3ceee3[_0x0c5a('0x26')];}_0x44b87c[_0x0c5a('0x17')](_0x1ff181)[_0x0c5a('0x27')](_0x3ceee3);};}exports[_0x0c5a('0x28')]=function(_0x2949c1,_0x332bcf){if(_0x2949c1['body']['id']){delete _0x2949c1[_0x0c5a('0x29')]['id'];}return db[_0x0c5a('0x2a')]['find']({'where':{'id':_0x2949c1[_0x0c5a('0x2b')]['id']}})[_0x0c5a('0x22')](handleEntityNotFound(_0x332bcf,null))[_0x0c5a('0x22')](saveUpdates(_0x2949c1['body'],null))[_0x0c5a('0x22')](respondWithResult(_0x332bcf,null))['catch'](handleError(_0x332bcf,null));};exports[_0x0c5a('0x23')]=function(_0x5e7bc2,_0x2e60c9){return db[_0x0c5a('0x2a')]['find']({'where':{'id':_0x5e7bc2[_0x0c5a('0x2b')]['id']}})[_0x0c5a('0x22')](handleEntityNotFound(_0x2e60c9,null))[_0x0c5a('0x22')](removeEntity(_0x2e60c9,null))[_0x0c5a('0x2c')](handleError(_0x2e60c9,null));}; \ No newline at end of file +var _0x91e8=['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','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','name','send','body','Action','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x3564d6,_0x37d1cb){var _0x1f2267=function(_0xbf7dfb){while(--_0xbf7dfb){_0x3564d6['push'](_0x3564d6['shift']());}};_0x1f2267(++_0x37d1cb);}(_0x91e8,0x122));var _0x891e=function(_0x140261,_0x2b2d9b){_0x140261=_0x140261-0x0;var _0x12e4f0=_0x91e8[_0x140261];return _0x12e4f0;};'use strict';var emlformat=require(_0x891e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x891e('0x1'));var jsonpatch=require(_0x891e('0x2'));var rp=require(_0x891e('0x3'));var moment=require(_0x891e('0x4'));var BPromise=require(_0x891e('0x5'));var Mustache=require(_0x891e('0x6'));var util=require(_0x891e('0x7'));var path=require(_0x891e('0x8'));var sox=require('sox');var csv=require(_0x891e('0x9'));var ejs=require(_0x891e('0xa'));var fs=require('fs');var fs_extra=require(_0x891e('0xb'));var _=require(_0x891e('0xc'));var squel=require(_0x891e('0xd'));var crypto=require(_0x891e('0xe'));var jsforce=require(_0x891e('0xf'));var deskjs=require(_0x891e('0x10'));var toCsv=require(_0x891e('0x9'));var querystring=require(_0x891e('0x11'));var Papa=require(_0x891e('0x12'));var Redis=require(_0x891e('0x13'));var authService=require(_0x891e('0x14'));var qs=require(_0x891e('0x15'));var as=require(_0x891e('0x16'));var hardwareService=require(_0x891e('0x17'));var logger=require(_0x891e('0x18'))(_0x891e('0x19'));var utils=require(_0x891e('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x891e('0x1b'))['db'];function respondWithStatusCode(_0x1f7e47,_0x347a93){_0x347a93=_0x347a93||0xcc;return function(_0x1a2599){if(_0x1a2599){return _0x1f7e47[_0x891e('0x1c')](_0x347a93);}return _0x1f7e47[_0x891e('0x1d')](_0x347a93)[_0x891e('0x1e')]();};}function respondWithResult(_0x157ad4,_0x34d633){_0x34d633=_0x34d633||0xc8;return function(_0x31ae7a){if(_0x31ae7a){return _0x157ad4[_0x891e('0x1d')](_0x34d633)['json'](_0x31ae7a);}};}function respondWithFilteredResult(_0x5b3233,_0x482a92){return function(_0x3ca096){if(_0x3ca096){var _0x45ee65=typeof _0x482a92[_0x891e('0x1f')]===_0x891e('0x20')&&typeof _0x482a92[_0x891e('0x21')]===_0x891e('0x20');var _0x9d5627=_0x3ca096[_0x891e('0x22')];var _0x19bc2a=_0x45ee65?0x0:_0x482a92[_0x891e('0x1f')];var _0x5060bf=_0x45ee65?_0x3ca096[_0x891e('0x22')]:_0x482a92[_0x891e('0x1f')]+_0x482a92[_0x891e('0x21')];var _0xd8f555;if(_0x5060bf>=_0x9d5627){_0x5060bf=_0x9d5627;_0xd8f555=0xc8;}else{_0xd8f555=0xce;}_0x5b3233[_0x891e('0x1d')](_0xd8f555);return _0x5b3233[_0x891e('0x23')]('Content-Range',_0x19bc2a+'-'+_0x5060bf+'/'+_0x9d5627)[_0x891e('0x24')](_0x3ca096);}return null;};}function patchUpdates(_0x460370){return function(_0x7eff7a){try{jsonpatch[_0x891e('0x25')](_0x7eff7a,_0x460370,!![]);}catch(_0x2c44d7){return BPromise[_0x891e('0x26')](_0x2c44d7);}return _0x7eff7a[_0x891e('0x27')]();};}function saveUpdates(_0x1f0b66,_0x414be8){return function(_0x31d01c){if(_0x31d01c){return _0x31d01c[_0x891e('0x28')](_0x1f0b66)[_0x891e('0x29')](function(_0x1c3986){return _0x1c3986;});}return null;};}function removeEntity(_0x3d36d7,_0xacd550){return function(_0xe02029){if(_0xe02029){return _0xe02029[_0x891e('0x2a')]()['then'](function(){_0x3d36d7[_0x891e('0x1d')](0xcc)[_0x891e('0x1e')]();});}};}function handleEntityNotFound(_0x3d7178,_0x5cacc5){return function(_0x380cdb){if(!_0x380cdb){_0x3d7178[_0x891e('0x1c')](0x194);}return _0x380cdb;};}function handleError(_0x5ba7eb,_0xb2ea0){_0xb2ea0=_0xb2ea0||0x1f4;return function(_0x12e3bf){logger[_0x891e('0x2b')](_0x12e3bf['stack']);if(_0x12e3bf[_0x891e('0x2c')]){delete _0x12e3bf[_0x891e('0x2c')];}_0x5ba7eb[_0x891e('0x1d')](_0xb2ea0)[_0x891e('0x2d')](_0x12e3bf);};}exports[_0x891e('0x28')]=function(_0x338f1e,_0x45ddf5){if(_0x338f1e[_0x891e('0x2e')]['id']){delete _0x338f1e[_0x891e('0x2e')]['id'];}return db[_0x891e('0x2f')][_0x891e('0x30')]({'where':{'id':_0x338f1e[_0x891e('0x31')]['id']}})[_0x891e('0x29')](handleEntityNotFound(_0x45ddf5,null))[_0x891e('0x29')](saveUpdates(_0x338f1e[_0x891e('0x2e')],null))[_0x891e('0x29')](respondWithResult(_0x45ddf5,null))['catch'](handleError(_0x45ddf5,null));};exports[_0x891e('0x2a')]=function(_0x481a08,_0x5b168a){return db[_0x891e('0x2f')][_0x891e('0x30')]({'where':{'id':_0x481a08[_0x891e('0x31')]['id']}})[_0x891e('0x29')](handleEntityNotFound(_0x5b168a,null))['then'](removeEntity(_0x5b168a,null))['catch'](handleError(_0x5b168a,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 23dea0d..3ebab0f 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 _0xff3c=['tools_actions','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x361e2c,_0x5f584f){var _0x859c70=function(_0x1f0ab5){while(--_0x1f0ab5){_0x361e2c['push'](_0x361e2c['shift']());}};_0x859c70(++_0x5f584f);}(_0xff3c,0x1a3));var _0xcff3=function(_0x3c4322,_0x2e87f9){_0x3c4322=_0x3c4322-0x0;var _0x4ea1b5=_0xff3c[_0x3c4322];return _0x4ea1b5;};'use strict';var _=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var logger=require(_0xcff3('0x2'))('api');var moment=require(_0xcff3('0x3'));var BPromise=require(_0xcff3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcff3('0x5'));var rimraf=require(_0xcff3('0x6'));var config=require(_0xcff3('0x7'));var attributes=require(_0xcff3('0x8'));module['exports']=function(_0x205a14,_0x48a6b2){return _0x205a14[_0xcff3('0x9')]('Action',attributes,{'tableName':_0xcff3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f88=['exports','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./action.attributes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4f88,0x173));var _0x84f8=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0x4f88[_0x38c652];return _0x218a37;};'use strict';var _=require(_0x84f8('0x0'));var util=require(_0x84f8('0x1'));var logger=require(_0x84f8('0x2'))(_0x84f8('0x3'));var moment=require('moment');var BPromise=require(_0x84f8('0x4'));var rp=require(_0x84f8('0x5'));var fs=require('fs');var path=require(_0x84f8('0x6'));var rimraf=require(_0x84f8('0x7'));var config=require('../../config/environment');var attributes=require(_0x84f8('0x8'));module[_0x84f8('0x9')]=function(_0x38d913,_0x5cf8bd){return _0x38d913['define']('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 bd6da6e..a534b11 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0xf96866,_0x547647){var _0x336c0d=function(_0x4d03be){while(--_0x4d03be){_0xf96866['push'](_0xf96866['shift']());}};_0x336c0d(++_0x547647);}(_0xe14b,0x93));var _0xbe14=function(_0x38dd04,_0xabfd0b){_0x38dd04=_0x38dd04-0x0;var _0x429407=_0xe14b[_0x38dd04];return _0x429407;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2891d1,_0x2ddd3e){var _0x486948=function(_0x13fa0f){while(--_0x13fa0f){_0x2891d1['push'](_0x2891d1['shift']());}};_0x486948(++_0x2ddd3e);}(_0xf494,0x1c6));var _0x4f49=function(_0x33ee6a,_0x456591){_0x33ee6a=_0x33ee6a-0x0;var _0x1311df=_0xf494[_0x33ee6a];return _0x1311df;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index cb48595..9628995 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 _0x6859=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','multer'];(function(_0x5a66d8,_0x988719){var _0x488c3b=function(_0x53023f){while(--_0x53023f){_0x5a66d8['push'](_0x5a66d8['shift']());}};_0x488c3b(++_0x988719);}(_0x6859,0xc3));var _0x9685=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x6859[_0x4ed520];return _0x4415a6;};'use strict';var multer=require(_0x9685('0x0'));var util=require('util');var path=require(_0x9685('0x1'));var timeout=require(_0x9685('0x2'));var express=require(_0x9685('0x3'));var router=express[_0x9685('0x4')]();var fs_extra=require(_0x9685('0x5'));var auth=require(_0x9685('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9685('0x7'));var controller=require(_0x9685('0x8'));router['put'](_0x9685('0x9'),auth[_0x9685('0xa')](),controller[_0x9685('0xb')]);router[_0x9685('0xc')](_0x9685('0x9'),auth['isAuthenticated'](),controller[_0x9685('0xd')]);module['exports']=router; \ No newline at end of file +var _0xc2d5=['/:id','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','put'];(function(_0x236ca4,_0x92402a){var _0x4e8a9a=function(_0x523b03){while(--_0x523b03){_0x236ca4['push'](_0x236ca4['shift']());}};_0x4e8a9a(++_0x92402a);}(_0xc2d5,0xa2));var _0x5c2d=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0xc2d5[_0x128bef];return _0x1ba862;};'use strict';var multer=require(_0x5c2d('0x0'));var util=require('util');var path=require(_0x5c2d('0x1'));var timeout=require(_0x5c2d('0x2'));var express=require(_0x5c2d('0x3'));var router=express[_0x5c2d('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('./action.controller');router[_0x5c2d('0x5')](_0x5c2d('0x6'),auth[_0x5c2d('0x7')](),controller[_0x5c2d('0x8')]);router[_0x5c2d('0x9')]('/:id',auth[_0x5c2d('0x7')](),controller[_0x5c2d('0xa')]);module[_0x5c2d('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 8cc0b0f..069d07f 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 _0x687b=['STRING','TEXT','sequelize','exports'];(function(_0x3b9e53,_0x2f9366){var _0x51af53=function(_0x56bbe8){while(--_0x56bbe8){_0x3b9e53['push'](_0x3b9e53['shift']());}};_0x51af53(++_0x2f9366);}(_0x687b,0x14a));var _0xb687=function(_0x29b886,_0x3ec7c2){_0x29b886=_0x29b886-0x0;var _0x263ef9=_0x687b[_0x29b886];return _0x263ef9;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb687('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xb687('0x3')]},'joins':{'type':Sequelize[_0xb687('0x3')]}}; \ No newline at end of file +var _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x1bca21,_0x16484c){var _0x585671=function(_0x131f5b){while(--_0x131f5b){_0x1bca21['push'](_0x1bca21['shift']());}};_0x585671(++_0x16484c);}(_0xe14b,0x93));var _0xbe14=function(_0x152759,_0x451cca){_0x152759=_0x152759-0x0;var _0x379a1d=_0xe14b[_0x152759];return _0x379a1d;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index e9aff69..9c6d9e0 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 _0xaf2f=['then','get','CustomReports','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','filter','options','findAll','rows','params','includeAll','include','find','catch','create','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','toString','SELECT','cross_join','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','getFields','AnalyticMetric','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','left_join','groupBy','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy'];(function(_0x5ad1ee,_0x49bdd2){var _0x2fcb07=function(_0x108aea){while(--_0x108aea){_0x5ad1ee['push'](_0x5ad1ee['shift']());}};_0x2fcb07(++_0x49bdd2);}(_0xaf2f,0x126));var _0xfaf2=function(_0x4b72b3,_0xb05c18){_0x4b72b3=_0x4b72b3-0x0;var _0x4bed2f=_0xaf2f[_0x4b72b3];return _0x4bed2f;};'use strict';var emlformat=require(_0xfaf2('0x0'));var rimraf=require(_0xfaf2('0x1'));var zipdir=require(_0xfaf2('0x2'));var jsonpatch=require(_0xfaf2('0x3'));var rp=require(_0xfaf2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfaf2('0x5'));var util=require('util');var path=require(_0xfaf2('0x6'));var sox=require(_0xfaf2('0x7'));var csv=require('to-csv');var ejs=require(_0xfaf2('0x8'));var fs=require('fs');var fs_extra=require(_0xfaf2('0x9'));var _=require(_0xfaf2('0xa'));var squel=require(_0xfaf2('0xb'));var crypto=require(_0xfaf2('0xc'));var jsforce=require(_0xfaf2('0xd'));var deskjs=require(_0xfaf2('0xe'));var toCsv=require(_0xfaf2('0xf'));var querystring=require(_0xfaf2('0x10'));var Papa=require(_0xfaf2('0x11'));var Redis=require(_0xfaf2('0x12'));var authService=require(_0xfaf2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfaf2('0x14'));var hardwareService=require(_0xfaf2('0x15'));var logger=require('../../config/logger')(_0xfaf2('0x16'));var utils=require(_0xfaf2('0x17'));var config=require(_0xfaf2('0x18'));var licenseUtil=require(_0xfaf2('0x19'));var db=require(_0xfaf2('0x1a'))['db'];var dbH=require(_0xfaf2('0x1a'))[_0xfaf2('0x1b')];function respondWithStatusCode(_0x4cb9ef,_0x1a6acf){_0x1a6acf=_0x1a6acf||0xcc;return function(_0x532e74){if(_0x532e74){return _0x4cb9ef[_0xfaf2('0x1c')](_0x1a6acf);}return _0x4cb9ef['status'](_0x1a6acf)[_0xfaf2('0x1d')]();};}function respondWithResult(_0x5cddfc,_0x46f038){_0x46f038=_0x46f038||0xc8;return function(_0x36f083){if(_0x36f083){return _0x5cddfc[_0xfaf2('0x1e')](_0x46f038)['json'](_0x36f083);}};}function respondWithFilteredResult(_0x187a61,_0x126bfb){return function(_0x7aa8b2){if(_0x7aa8b2){var _0x32bbd8=typeof _0x126bfb[_0xfaf2('0x1f')]===_0xfaf2('0x20')&&typeof _0x126bfb[_0xfaf2('0x21')]===_0xfaf2('0x20');var _0x3b7f5e=_0x7aa8b2[_0xfaf2('0x22')];var _0x5991e9=_0x32bbd8?0x0:_0x126bfb[_0xfaf2('0x1f')];var _0x3564a0=_0x32bbd8?_0x7aa8b2['count']:_0x126bfb[_0xfaf2('0x1f')]+_0x126bfb[_0xfaf2('0x21')];var _0xda4911;if(_0x3564a0>=_0x3b7f5e){_0x3564a0=_0x3b7f5e;_0xda4911=0xc8;}else{_0xda4911=0xce;}_0x187a61[_0xfaf2('0x1e')](_0xda4911);return _0x187a61[_0xfaf2('0x23')](_0xfaf2('0x24'),_0x5991e9+'-'+_0x3564a0+'/'+_0x3b7f5e)[_0xfaf2('0x25')](_0x7aa8b2);}return null;};}function patchUpdates(_0x1f9480){return function(_0x5d4467){try{jsonpatch[_0xfaf2('0x26')](_0x5d4467,_0x1f9480,!![]);}catch(_0x14ff68){return BPromise[_0xfaf2('0x27')](_0x14ff68);}return _0x5d4467['save']();};}function saveUpdates(_0x30553c,_0x155bc1){return function(_0x3560a0){if(_0x3560a0){return _0x3560a0[_0xfaf2('0x28')](_0x30553c)['then'](function(_0x2eadcf){return _0x2eadcf;});}return null;};}function removeEntity(_0x19e933,_0x2c2370){return function(_0x1c7f27){if(_0x1c7f27){return _0x1c7f27[_0xfaf2('0x29')]()[_0xfaf2('0x2a')](function(){var _0x364b4f=_0x1c7f27[_0xfaf2('0x2b')]({'plain':!![]});var _0xbb1c0b=_0xfaf2('0x2c');return db[_0xfaf2('0x2d')][_0xfaf2('0x29')]({'where':{'type':_0xbb1c0b,'resourceId':_0x364b4f['id']}})['then'](function(){return _0x1c7f27;});})['then'](function(){_0x19e933[_0xfaf2('0x1e')](0xcc)[_0xfaf2('0x1d')]();});}};}function handleEntityNotFound(_0x548511,_0x15b711){return function(_0x5c0f08){if(!_0x5c0f08){_0x548511[_0xfaf2('0x1c')](0x194);}return _0x5c0f08;};}function handleError(_0xe3c01a,_0x26cafe){_0x26cafe=_0x26cafe||0x1f4;return function(_0x34e232){logger[_0xfaf2('0x2e')](_0x34e232[_0xfaf2('0x2f')]);if(_0x34e232[_0xfaf2('0x30')]){delete _0x34e232[_0xfaf2('0x30')];}_0xe3c01a[_0xfaf2('0x1e')](_0x26cafe)['send'](_0x34e232);};}exports[_0xfaf2('0x31')]=function(_0x1df04d,_0x2e726c){var _0x280219={},_0x4d35b5={},_0x5817b1={'count':0x0,'rows':[]};var _0x262d77=_[_0xfaf2('0x32')](db[_0xfaf2('0x33')][_0xfaf2('0x34')],function(_0x4d4553){return{'name':_0x4d4553[_0xfaf2('0x35')],'type':_0x4d4553[_0xfaf2('0x36')][_0xfaf2('0x37')]};});_0x4d35b5[_0xfaf2('0x38')]=_['map'](_0x262d77,_0xfaf2('0x30'));_0x4d35b5[_0xfaf2('0x39')]=_[_0xfaf2('0x3a')](_0x1df04d[_0xfaf2('0x39')]);_0x4d35b5['filters']=_[_0xfaf2('0x3b')](_0x4d35b5[_0xfaf2('0x38')],_0x4d35b5['query']);_0x280219[_0xfaf2('0x3c')]=_[_0xfaf2('0x3b')](_0x4d35b5['model'],qs[_0xfaf2('0x3d')](_0x1df04d[_0xfaf2('0x39')]['fields']));_0x280219[_0xfaf2('0x3c')]=_0x280219[_0xfaf2('0x3c')][_0xfaf2('0x3e')]?_0x280219[_0xfaf2('0x3c')]:_0x4d35b5['model'];if(!_0x1df04d[_0xfaf2('0x39')][_0xfaf2('0x3f')]('nolimit')){_0x280219[_0xfaf2('0x21')]=qs[_0xfaf2('0x21')](_0x1df04d['query'][_0xfaf2('0x21')]);_0x280219[_0xfaf2('0x1f')]=qs[_0xfaf2('0x1f')](_0x1df04d[_0xfaf2('0x39')]['offset']);}_0x280219[_0xfaf2('0x40')]=qs[_0xfaf2('0x41')](_0x1df04d[_0xfaf2('0x39')]['sort']);_0x280219['where']=qs[_0xfaf2('0x42')](_[_0xfaf2('0x43')](_0x1df04d[_0xfaf2('0x39')],_0x4d35b5[_0xfaf2('0x42')]),_0x262d77);if(_0x1df04d[_0xfaf2('0x39')]['filter']){_0x280219[_0xfaf2('0x44')]=_[_0xfaf2('0x45')](_0x280219[_0xfaf2('0x44')],{'$or':_[_0xfaf2('0x32')](_0x262d77,function(_0x4a860c){if(_0x4a860c['type']!=='VIRTUAL'){var _0x2b8d99={};_0x2b8d99[_0x4a860c['name']]={'$like':'%'+_0x1df04d[_0xfaf2('0x39')][_0xfaf2('0x46')]+'%'};return _0x2b8d99;}})});}_0x280219=_[_0xfaf2('0x45')]({},_0x280219,_0x1df04d[_0xfaf2('0x47')]);var _0x2af6b6={'where':_0x280219[_0xfaf2('0x44')]};return db[_0xfaf2('0x33')]['count'](_0x2af6b6)[_0xfaf2('0x2a')](function(_0x2ecf3d){_0x5817b1[_0xfaf2('0x22')]=_0x2ecf3d;if(_0x1df04d[_0xfaf2('0x39')]['includeAll']){_0x280219['include']=[{'all':!![]}];}return db[_0xfaf2('0x33')][_0xfaf2('0x48')](_0x280219);})['then'](function(_0x22284e){_0x5817b1[_0xfaf2('0x49')]=_0x22284e;return _0x5817b1;})['then'](respondWithFilteredResult(_0x2e726c,_0x280219))['catch'](handleError(_0x2e726c,null));};exports['show']=function(_0xe45a70,_0x539c3d){var _0x381bc0={'raw':![],'where':{'id':_0xe45a70[_0xfaf2('0x4a')]['id']}},_0x3d079f={};_0x3d079f[_0xfaf2('0x38')]=_[_0xfaf2('0x3a')](db[_0xfaf2('0x33')][_0xfaf2('0x34')]);_0x3d079f[_0xfaf2('0x39')]=_['keys'](_0xe45a70[_0xfaf2('0x39')]);_0x3d079f['filters']=_['intersection'](_0x3d079f[_0xfaf2('0x38')],_0x3d079f['query']);_0x381bc0[_0xfaf2('0x3c')]=_[_0xfaf2('0x3b')](_0x3d079f[_0xfaf2('0x38')],qs[_0xfaf2('0x3d')](_0xe45a70[_0xfaf2('0x39')]['fields']));_0x381bc0[_0xfaf2('0x3c')]=_0x381bc0['attributes'][_0xfaf2('0x3e')]?_0x381bc0[_0xfaf2('0x3c')]:_0x3d079f['model'];if(_0xe45a70[_0xfaf2('0x39')][_0xfaf2('0x4b')]){_0x381bc0[_0xfaf2('0x4c')]=[{'all':!![]}];}_0x381bc0=_[_0xfaf2('0x45')]({},_0x381bc0,_0xe45a70['options']);return db[_0xfaf2('0x33')][_0xfaf2('0x4d')](_0x381bc0)[_0xfaf2('0x2a')](handleEntityNotFound(_0x539c3d,null))[_0xfaf2('0x2a')](respondWithResult(_0x539c3d,null))[_0xfaf2('0x4e')](handleError(_0x539c3d,null));};exports[_0xfaf2('0x4f')]=function(_0x3b1a95,_0x448afe){return db[_0xfaf2('0x33')][_0xfaf2('0x4f')](_0x3b1a95['body'],{})['then'](function(_0x4de5aa){var _0x559044=_0x3b1a95[_0xfaf2('0x50')]['get']({'plain':!![]});if(!_0x559044)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x559044[_0xfaf2('0x51')]===_0xfaf2('0x50')){var _0x4e2581=_0x4de5aa[_0xfaf2('0x2b')]({'plain':!![]});var _0x5a8ab4=_0xfaf2('0x52');return db[_0xfaf2('0x53')][_0xfaf2('0x4d')]({'where':{'name':_0x5a8ab4,'userProfileId':_0x559044[_0xfaf2('0x54')]},'raw':!![]})[_0xfaf2('0x2a')](function(_0x198c72){if(_0x198c72&&_0x198c72[_0xfaf2('0x55')]===0x0){return db[_0xfaf2('0x2d')][_0xfaf2('0x4f')]({'name':_0x4e2581[_0xfaf2('0x30')],'resourceId':_0x4e2581['id'],'type':'CustomReports','sectionId':_0x198c72['id']},{})['then'](function(){return _0x4de5aa;});}else{return _0x4de5aa;}})[_0xfaf2('0x4e')](function(_0x1d4d44){logger[_0xfaf2('0x2e')](_0xfaf2('0x56'),_0x1d4d44);throw _0x1d4d44;});}return _0x4de5aa;})['then'](respondWithResult(_0x448afe,0xc9))['catch'](handleError(_0x448afe,null));};exports[_0xfaf2('0x28')]=function(_0x28cf1f,_0x234e9f){if(_0x28cf1f['body']['id']){delete _0x28cf1f[_0xfaf2('0x57')]['id'];}return db[_0xfaf2('0x33')][_0xfaf2('0x4d')]({'where':{'id':_0x28cf1f['params']['id']}})[_0xfaf2('0x2a')](handleEntityNotFound(_0x234e9f,null))[_0xfaf2('0x2a')](saveUpdates(_0x28cf1f[_0xfaf2('0x57')],null))[_0xfaf2('0x2a')](respondWithResult(_0x234e9f,null))[_0xfaf2('0x4e')](handleError(_0x234e9f,null));};exports['destroy']=function(_0x27aaf6,_0x17a331){return db[_0xfaf2('0x33')][_0xfaf2('0x4d')]({'where':{'id':_0x27aaf6['params']['id']}})[_0xfaf2('0x2a')](handleEntityNotFound(_0x17a331,null))['then'](removeEntity(_0x17a331,null))[_0xfaf2('0x4e')](handleError(_0x17a331,null));};exports[_0xfaf2('0x58')]=function(_0x4b89d7,_0x1c2810){var _0x7e8f3f=0xa;var _0x47c0d7=[_0xfaf2('0x59'),'left_join',_0xfaf2('0x5a'),'cross_join'];var _0x30988f={'SUM':_0xfaf2('0x5b'),'COUNT':_0xfaf2('0x5c'),'COUNT DISTINCT':_0xfaf2('0x5d'),'MAX':_0xfaf2('0x5e'),'MIN':_0xfaf2('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfaf2('0x60'),'GROUP_CONCAT DESC':_0xfaf2('0x61')};var _0x3d3677={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfaf2('0x62'),'HOUR':_0xfaf2('0x63'),'ROUND':_0xfaf2('0x64'),'UNIX_TIMESTAMP':_0xfaf2('0x65')};var _0x15dec1=function(_0x43c0b9){return!_[_0xfaf2('0x66')]([_0xfaf2('0x67'),_0xfaf2('0x68'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x43c0b9);};var _0x4a6b65=function(_0x298f86){if(!_0x298f86||!_0x298f86['rules'][_0xfaf2('0x3e')]){return'';}for(var _0x1ee1ae='(',_0x334ccb=0x0;_0x334ccb<_0x298f86[_0xfaf2('0x69')]['length'];_0x334ccb+=0x1){_0x334ccb>0x0&&(_0x1ee1ae+='\x20'+_0x298f86[_0xfaf2('0x6a')]+'\x20');_0x1ee1ae+=_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6b')]?_0x4a6b65(_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6b')]):_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6c')]+'\x20'+_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6d')]+(_0x15dec1(_0x298f86[_0xfaf2('0x69')][_0x334ccb]['condition'])?'\x20'+_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6e')]:'');}return _0x1ee1ae+')';};var _0x179c7c={'where':{'id':_0x4b89d7[_0xfaf2('0x4a')]['id']}},_0x418852,_0x53ec76,_0x55f417,_0x4781ad,_0x5c7673;_0x179c7c=_[_0xfaf2('0x45')]({},_0x179c7c,_0x4b89d7['options']);return db[_0xfaf2('0x33')]['find'](_0x179c7c)[_0xfaf2('0x2a')](function(_0x3b8e56){if(_0x3b8e56){_0x418852=_0x3b8e56;return _0x3b8e56['getFields']();}return null;})[_0xfaf2('0x2a')](function(_0x52b7c3){if(_0x52b7c3){if(!_0x52b7c3[_0xfaf2('0x3e')]){throw new db[(_0xfaf2('0x6f'))][(_0xfaf2('0x70'))](_0xfaf2('0x71'),0x193);}_0x53ec76=_0x52b7c3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xfaf2('0x2a')](function(_0x333305){if(_0x333305){_0x55f417=_[_0xfaf2('0x72')](_0x333305,'id');var _0x2c6013;var _0x4aec5a=squel[_0xfaf2('0x73')]();_0x4aec5a[_0xfaf2('0x74')](_0x418852[_0xfaf2('0x75')]);for(var _0x143a1f=0x0;_0x143a1f<_0x53ec76[_0xfaf2('0x3e')];_0x143a1f+=0x1){_0x2c6013=_0x53ec76[_0x143a1f][_0xfaf2('0x76')]?_0x55f417[_0x53ec76[_0x143a1f][_0xfaf2('0x76')]][_0xfaf2('0x77')]:_0x53ec76[_0x143a1f][_0xfaf2('0x6c')];_0x2c6013=_0x53ec76[_0x143a1f][_0xfaf2('0x78')]?_[_0xfaf2('0x79')](_0x30988f[_0x53ec76[_0x143a1f]['function']],'%s',_0x2c6013):_0x2c6013;_0x2c6013=_0x53ec76[_0x143a1f][_0xfaf2('0x7a')]?_['replace'](_0x3d3677[_0x53ec76[_0x143a1f][_0xfaf2('0x7a')]],'%s',_0x2c6013):_0x2c6013;if(_0x53ec76[_0x143a1f]['groupBy']){_0x4aec5a[_0xfaf2('0x6b')](_0x2c6013);}_0x53ec76[_0x143a1f][_0xfaf2('0x7b')]&&_0x4aec5a[_0xfaf2('0x40')](_0x2c6013,_0x53ec76[_0x143a1f]['orderBy']===_0xfaf2('0x7c')?![]:!![]);_0x4aec5a[_0xfaf2('0x6c')](_0x2c6013,_0x53ec76[_0x143a1f][_0xfaf2('0x7d')]||_0x2c6013);}if(_0x418852[_0xfaf2('0x7e')]){_0x418852[_0xfaf2('0x7e')]=JSON[_0xfaf2('0x7f')](_0x418852['joins']);for(var _0x2e0cec=0x0;_0x2e0cec<_0x418852[_0xfaf2('0x7e')][_0xfaf2('0x3e')];_0x2e0cec+=0x1){if(_0x418852[_0xfaf2('0x7e')][_0x2e0cec]['type']&&_[_0xfaf2('0x66')](_0x47c0d7,_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x36')])&&_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x80')]&&_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x81')]&&_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x82')]){_0x4aec5a[_0x418852['joins'][_0x2e0cec][_0xfaf2('0x36')]](_0x418852[_0xfaf2('0x7e')][_0x2e0cec]['foreignTable'],null,util[_0xfaf2('0x7a')]('%s.%s\x20=\x20%s.%s',_0x418852[_0xfaf2('0x75')],_0x418852['joins'][_0x2e0cec][_0xfaf2('0x80')],_0x418852['joins'][_0x2e0cec][_0xfaf2('0x81')],_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x82')]));}}}if(_0x418852[_0xfaf2('0x83')]){_0x418852[_0xfaf2('0x83')]=JSON['parse'](_0x418852[_0xfaf2('0x83')]);_0x4aec5a[_0xfaf2('0x44')](_0x4a6b65(_0x418852['conditions'][_0xfaf2('0x6b')]));}_0x5c7673=_0x4aec5a[_0xfaf2('0x84')]();_0x4aec5a[_0xfaf2('0x21')](_0x7e8f3f);_0x4aec5a[_0xfaf2('0x1f')](0x0);logger['debug']('Limited\x20Query:',_0x4aec5a[_0xfaf2('0x85')]());return dbH['sequelize']['query'](_0x4aec5a['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xfaf2('0x86')]});}})['then'](respondWithResult(_0x1c2810,null))[_0xfaf2('0x4e')](handleError(_0x1c2810,null));};function runReport(_0x40f693,_0x5c1dac,_0x52c1d9){var _0x370184=_0x5c1dac[_0xfaf2('0x30')];var _0x3bda03=0xa;var _0x8e5ccb=['join','left_join',_0xfaf2('0x5a'),_0xfaf2('0x87')];var _0x237198={'SUM':_0xfaf2('0x5b'),'COUNT':_0xfaf2('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfaf2('0x5e'),'MIN':'MIN(%s)','AVG':_0xfaf2('0x88'),'GROUP_CONCAT':_0xfaf2('0x89'),'GROUP_CONCAT ASC':_0xfaf2('0x60'),'GROUP_CONCAT DESC':_0xfaf2('0x61')};var _0x1b0f63={'SEC_TO_TIME':_0xfaf2('0x8a'),'DATE':_0xfaf2('0x62'),'HOUR':_0xfaf2('0x63'),'ROUND':_0xfaf2('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x24e83c=function(_0x3c6d41){return!_[_0xfaf2('0x66')](['IS\x20NULL',_0xfaf2('0x68'),_0xfaf2('0x8b'),_0xfaf2('0x8c')],_0x3c6d41);};var _0x443005=function(_0x8fb83c){if(!_0x8fb83c||!_0x8fb83c[_0xfaf2('0x69')][_0xfaf2('0x3e')]){return'';}for(var _0x305b54='(',_0x51dbed=0x0;_0x51dbed<_0x8fb83c[_0xfaf2('0x69')][_0xfaf2('0x3e')];_0x51dbed+=0x1){_0x51dbed>0x0&&(_0x305b54+='\x20'+_0x8fb83c[_0xfaf2('0x6a')]+'\x20');_0x305b54+=_0x8fb83c[_0xfaf2('0x69')][_0x51dbed][_0xfaf2('0x6b')]?_0x443005(_0x8fb83c[_0xfaf2('0x69')][_0x51dbed]['group']):_0x8fb83c[_0xfaf2('0x69')][_0x51dbed][_0xfaf2('0x6c')]+'\x20'+_0x8fb83c[_0xfaf2('0x69')][_0x51dbed][_0xfaf2('0x6d')]+(_0x24e83c(_0x8fb83c['rules'][_0x51dbed][_0xfaf2('0x6d')])?'\x20'+_0x8fb83c[_0xfaf2('0x69')][_0x51dbed]['value']:'');}return _0x305b54+')';};var _0x16c846={'where':{'id':_0x40f693['id']}},_0x4ba198,_0x659b1b,_0x3724a9,_0x274f5c,_0x4558c2;_0x16c846=_[_0xfaf2('0x45')]({},_0x16c846,_0x52c1d9);return db[_0xfaf2('0x33')][_0xfaf2('0x4d')](_0x16c846)[_0xfaf2('0x2a')](function(_0x5f0c35){if(_0x5f0c35){_0x4ba198=_0x5f0c35;return _0x5f0c35[_0xfaf2('0x8d')]();}return null;})[_0xfaf2('0x2a')](function(_0xa21aee){if(_0xa21aee){if(!_0xa21aee[_0xfaf2('0x3e')]){throw new db[(_0xfaf2('0x6f'))][(_0xfaf2('0x70'))](_0xfaf2('0x71'),0x193);}_0x659b1b=_0xa21aee;return db[_0xfaf2('0x8e')][_0xfaf2('0x48')]({'raw':!![]});}return null;})[_0xfaf2('0x2a')](function(_0x4bbc0e){if(_0x4bbc0e){_0x3724a9=_[_0xfaf2('0x72')](_0x4bbc0e,'id');var _0x5a59af;var _0x50a4c0=squel['select']();_0x50a4c0[_0xfaf2('0x74')](_0x4ba198[_0xfaf2('0x75')]);for(var _0x2b64c3=0x0;_0x2b64c3<_0x659b1b[_0xfaf2('0x3e')];_0x2b64c3+=0x1){_0x5a59af=_0x659b1b[_0x2b64c3][_0xfaf2('0x76')]?_0x3724a9[_0x659b1b[_0x2b64c3][_0xfaf2('0x76')]]['metric']:_0x659b1b[_0x2b64c3]['field'];_0x5a59af=_0x659b1b[_0x2b64c3]['function']?_[_0xfaf2('0x79')](_0x237198[_0x659b1b[_0x2b64c3][_0xfaf2('0x78')]],'%s',_0x5a59af):_0x5a59af;_0x5a59af=_0x659b1b[_0x2b64c3][_0xfaf2('0x7a')]?_[_0xfaf2('0x79')](_0x1b0f63[_0x659b1b[_0x2b64c3][_0xfaf2('0x7a')]],'%s',_0x5a59af):_0x5a59af;if(_0x659b1b[_0x2b64c3]['groupBy']){_0x50a4c0[_0xfaf2('0x6b')](_0x5a59af);}_0x659b1b[_0x2b64c3][_0xfaf2('0x7b')]&&_0x50a4c0[_0xfaf2('0x40')](_0x5a59af,_0x659b1b[_0x2b64c3][_0xfaf2('0x7b')]===_0xfaf2('0x7c')?![]:!![]);_0x50a4c0[_0xfaf2('0x6c')](_0x5a59af,_0x659b1b[_0x2b64c3][_0xfaf2('0x7d')]||_0x5a59af);}if(_0x4ba198[_0xfaf2('0x7e')]){_0x4ba198[_0xfaf2('0x7e')]=JSON[_0xfaf2('0x7f')](_0x4ba198[_0xfaf2('0x7e')]);for(var _0x243692=0x0;_0x243692<_0x4ba198[_0xfaf2('0x7e')][_0xfaf2('0x3e')];_0x243692+=0x1){if(_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x36')]&&_[_0xfaf2('0x66')](_0x8e5ccb,_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x36')])&&_0x4ba198['joins'][_0x243692]['parentKey']&&_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x81')]&&_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x82')]){_0x50a4c0[_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x36')]](_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x81')],null,util[_0xfaf2('0x7a')](_0xfaf2('0x8f'),_0x4ba198['table'],_0x4ba198['joins'][_0x243692][_0xfaf2('0x80')],_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x81')],_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x82')]));}}}if(_0x4ba198[_0xfaf2('0x83')]){_0x4ba198[_0xfaf2('0x83')]=JSON['parse'](_0x4ba198[_0xfaf2('0x83')]);_0x50a4c0[_0xfaf2('0x44')](_0x443005(_0x4ba198[_0xfaf2('0x83')][_0xfaf2('0x6b')]));}_0x4558c2=_0x50a4c0[_0xfaf2('0x84')]();_0x50a4c0['limit'](_0x3bda03);_0x50a4c0[_0xfaf2('0x1f')](0x0);return;}})[_0xfaf2('0x2a')](function(){if(_0x5c1dac[_0xfaf2('0x90')]===_0xfaf2('0x91')){return null;}var _0x9c3608=_[_0xfaf2('0x45')](_0x5c1dac,{'name':_0x5c1dac[_0xfaf2('0x92')]||_0x5c1dac[_0xfaf2('0x30')]||_0x4ba198[_0xfaf2('0x30')],'basename':_0x370184,'savename':util['format'](_0xfaf2('0x93'),_0x5c1dac['name']||_0x4ba198['name'],require(_0xfaf2('0x94'))[_0xfaf2('0x95')](0x4),_0x5c1dac[_0xfaf2('0x90')]||'csv'),'reportId':_0x4ba198['id'],'reportType':_0xfaf2('0x96')});return db[_0xfaf2('0x97')][_0xfaf2('0x4f')](_0x9c3608,{'raw':!![]});})['then'](function(_0x10b0ef){if(_0x4ba198[_0xfaf2('0x75')]==='cdr'){_0x4558c2[_0xfaf2('0x44')](_0x4ba198[_0xfaf2('0x75')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5c1dac[_0xfaf2('0x98')],_0x5c1dac[_0xfaf2('0x99')]);}else{_0x4558c2[_0xfaf2('0x44')](_0x4ba198['table']+_0xfaf2('0x9a'),_0x5c1dac['startDate'],_0x5c1dac['endDate']);}if(_0x10b0ef){logger[_0xfaf2('0x9b')]('Run\x20Query:',_0x4558c2['toString']());require(_0xfaf2('0x9c'))[_0xfaf2('0x9d')](path[_0xfaf2('0x59')](__dirname,'../../components/export/',_0x10b0ef[_0xfaf2('0x90')]),[_0x10b0ef['id'],_0x4558c2[_0xfaf2('0x85')](),path[_0xfaf2('0x59')](__dirname,_0xfaf2('0x9e'),_0x10b0ef['savename']),_0x370184]);return _0x10b0ef;}else{var _0x3fe47c=squel[_0xfaf2('0x73')]();_0x3fe47c[_0xfaf2('0x74')]('('+_0x4558c2[_0xfaf2('0x85')]()+')',_0xfaf2('0x9f'));_0x3fe47c[_0xfaf2('0x6c')](_0xfaf2('0xa0'),'count');_0x4558c2[_0xfaf2('0x21')](_0x5c1dac['limit']||_0x3bda03);_0x4558c2['offset'](_0x5c1dac[_0xfaf2('0x1f')]||0x0);return dbH[_0xfaf2('0xa1')]['query'](_0x3fe47c[_0xfaf2('0x85')](),{'type':dbH['sequelize'][_0xfaf2('0xa2')][_0xfaf2('0x86')]})[_0xfaf2('0x2a')](function(_0x29031a){if(!_0x29031a[_0xfaf2('0x3e')]){_0x274f5c=0x0;}else{_0x274f5c=_0x29031a[0x0][_0xfaf2('0x22')]||0x0;}return dbH['sequelize'][_0xfaf2('0x39')](_0x4558c2[_0xfaf2('0x85')](),{'type':dbH[_0xfaf2('0xa1')][_0xfaf2('0xa2')][_0xfaf2('0x86')]});})[_0xfaf2('0x2a')](function(_0x453ab7){return{'rows':_0x453ab7||[],'count':_0x274f5c};});}});}exports[_0xfaf2('0xa3')]=function(_0x1d067a,_0x2a66e4){return runReport(_0x1d067a[_0xfaf2('0x4a')],_0x1d067a[_0xfaf2('0x39')],_0x1d067a[_0xfaf2('0x47')])[_0xfaf2('0x2a')](respondWithResult(_0x2a66e4,null))['catch'](handleError(_0x2a66e4,null));};exports[_0xfaf2('0xa4')]=runReport;exports[_0xfaf2('0x39')]=function(_0x44f585,_0x53b8b0){var _0x57cf1a=0xa;var _0x2a25a9=['join',_0xfaf2('0xa5'),_0xfaf2('0x5a'),'cross_join'];var _0x299f69={'SUM':'SUM(%s)','COUNT':_0xfaf2('0x5c'),'COUNT DISTINCT':_0xfaf2('0x5d'),'MAX':_0xfaf2('0x5e'),'MIN':_0xfaf2('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfaf2('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfaf2('0x61')};var _0x164c28={'SEC_TO_TIME':_0xfaf2('0x8a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xfaf2('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x512563=function(_0x31bd06){return!_[_0xfaf2('0x66')]([_0xfaf2('0x67'),'IS\x20NOT\x20NULL',_0xfaf2('0x8b'),'IS\x20NOT\x20EMPTY'],_0x31bd06);};var _0x59484d=function(_0x52e7c8){if(!_0x52e7c8||!_0x52e7c8[_0xfaf2('0x69')][_0xfaf2('0x3e')]){return'';}for(var _0x405098='(',_0x3050d1=0x0;_0x3050d1<_0x52e7c8[_0xfaf2('0x69')][_0xfaf2('0x3e')];_0x3050d1+=0x1){_0x3050d1>0x0&&(_0x405098+='\x20'+_0x52e7c8[_0xfaf2('0x6a')]+'\x20');_0x405098+=_0x52e7c8[_0xfaf2('0x69')][_0x3050d1]['group']?_0x59484d(_0x52e7c8['rules'][_0x3050d1][_0xfaf2('0x6b')]):_0x52e7c8[_0xfaf2('0x69')][_0x3050d1][_0xfaf2('0x6c')]+'\x20'+_0x52e7c8['rules'][_0x3050d1][_0xfaf2('0x6d')]+(_0x512563(_0x52e7c8['rules'][_0x3050d1]['condition'])?'\x20'+_0x52e7c8[_0xfaf2('0x69')][_0x3050d1][_0xfaf2('0x6e')]:'');}return _0x405098+')';};var _0x2eda44={'where':{'id':_0x44f585[_0xfaf2('0x4a')]['id']}},_0x37a04c,_0x4868a7,_0x3bbb6a,_0x35bd7b,_0x7fbe67;_0x2eda44=_[_0xfaf2('0x45')]({},_0x2eda44,_0x44f585[_0xfaf2('0x47')]);return db[_0xfaf2('0x33')][_0xfaf2('0x4d')](_0x2eda44)[_0xfaf2('0x2a')](function(_0x3ae28e){if(_0x3ae28e){_0x37a04c=_0x3ae28e;return _0x3ae28e[_0xfaf2('0x8d')]();}return null;})[_0xfaf2('0x2a')](function(_0x5e54ef){if(_0x5e54ef){if(!_0x5e54ef[_0xfaf2('0x3e')]){throw new db[(_0xfaf2('0x6f'))]['ValidationErrorItem'](_0xfaf2('0x71'),0x193);}_0x4868a7=_0x5e54ef;return db[_0xfaf2('0x8e')]['findAll']({'raw':!![]});}return null;})[_0xfaf2('0x2a')](function(_0x173782){if(_0x173782){_0x3bbb6a=_['keyBy'](_0x173782,'id');var _0x53bba4;var _0x48397c=squel[_0xfaf2('0x73')]();_0x48397c[_0xfaf2('0x74')](_0x37a04c['table']);for(var _0x3086bc=0x0;_0x3086bc<_0x4868a7['length'];_0x3086bc+=0x1){_0x53bba4=_0x4868a7[_0x3086bc][_0xfaf2('0x76')]?_0x3bbb6a[_0x4868a7[_0x3086bc][_0xfaf2('0x76')]][_0xfaf2('0x77')]:_0x4868a7[_0x3086bc][_0xfaf2('0x6c')];_0x53bba4=_0x4868a7[_0x3086bc][_0xfaf2('0x78')]?_['replace'](_0x299f69[_0x4868a7[_0x3086bc][_0xfaf2('0x78')]],'%s',_0x53bba4):_0x53bba4;_0x53bba4=_0x4868a7[_0x3086bc][_0xfaf2('0x7a')]?_[_0xfaf2('0x79')](_0x164c28[_0x4868a7[_0x3086bc][_0xfaf2('0x7a')]],'%s',_0x53bba4):_0x53bba4;if(_0x4868a7[_0x3086bc][_0xfaf2('0xa6')]){_0x48397c[_0xfaf2('0x6b')](_0x53bba4);}_0x4868a7[_0x3086bc]['orderBy']&&_0x48397c[_0xfaf2('0x40')](_0x53bba4,_0x4868a7[_0x3086bc]['orderBy']===_0xfaf2('0x7c')?![]:!![]);_0x48397c[_0xfaf2('0x6c')](_0x53bba4,_0x4868a7[_0x3086bc][_0xfaf2('0x7d')]||_0x53bba4);}if(_0x37a04c[_0xfaf2('0x7e')]){_0x37a04c[_0xfaf2('0x7e')]=JSON[_0xfaf2('0x7f')](_0x37a04c[_0xfaf2('0x7e')]);for(var _0x32779b=0x0;_0x32779b<_0x37a04c[_0xfaf2('0x7e')][_0xfaf2('0x3e')];_0x32779b+=0x1){if(_0x37a04c['joins'][_0x32779b][_0xfaf2('0x36')]&&_['includes'](_0x2a25a9,_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x36')])&&_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x80')]&&_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x81')]&&_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x82')]){_0x48397c[_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x36')]](_0x37a04c[_0xfaf2('0x7e')][_0x32779b]['foreignTable'],null,util[_0xfaf2('0x7a')](_0xfaf2('0x8f'),_0x37a04c[_0xfaf2('0x75')],_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x80')],_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x81')],_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x82')]));}}}if(_0x37a04c[_0xfaf2('0x83')]){_0x37a04c[_0xfaf2('0x83')]=JSON[_0xfaf2('0x7f')](_0x37a04c[_0xfaf2('0x83')]);_0x48397c[_0xfaf2('0x44')](_0x59484d(_0x37a04c[_0xfaf2('0x83')][_0xfaf2('0x6b')]));}_0x7fbe67=_0x48397c[_0xfaf2('0x84')]();_0x48397c['limit'](_0x57cf1a);_0x48397c['offset'](0x0);logger[_0xfaf2('0xa7')]('Limited\x20Query:',_0x48397c[_0xfaf2('0x85')]());return dbH[_0xfaf2('0xa1')][_0xfaf2('0x39')](_0x48397c[_0xfaf2('0x85')](),{'type':dbH[_0xfaf2('0xa1')][_0xfaf2('0xa2')]['SELECT']});}})['then'](function(){return{'sql':_0x7fbe67[_0xfaf2('0x85')]()};})[_0xfaf2('0x2a')](respondWithResult(_0x53b8b0,null))[_0xfaf2('0x4e')](handleError(_0x53b8b0,null));}; \ No newline at end of file +var _0xeb5e=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','offset','undefined','limit','set','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','count','includeAll','AnalyticCustomReport','findAll','catch','show','params','length','include','options','create','body','role','user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','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)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','table','foreignTable','conditions','clone','toString','sequelize','SELECT','left_join','right_join','DATE(%s)','IS\x20NULL','value','keyBy','output','web','fullPath','randomstring','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','../../files/reports','savename','COUNT(*)','QueryTypes','run','Please\x20insert\x20at\x20least\x20one\x20field','debug','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x393f01,_0x2dba17){var _0x2adc57=function(_0x52c9b6){while(--_0x52c9b6){_0x393f01['push'](_0x393f01['shift']());}};_0x2adc57(++_0x2dba17);}(_0xeb5e,0x134));var _0xeeb5=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xeb5e[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeeb5('0x0'));var zipdir=require(_0xeeb5('0x1'));var jsonpatch=require(_0xeeb5('0x2'));var rp=require(_0xeeb5('0x3'));var moment=require(_0xeeb5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeeb5('0x5'));var util=require(_0xeeb5('0x6'));var path=require('path');var sox=require(_0xeeb5('0x7'));var csv=require(_0xeeb5('0x8'));var ejs=require(_0xeeb5('0x9'));var fs=require('fs');var fs_extra=require(_0xeeb5('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xeeb5('0xb'));var jsforce=require(_0xeeb5('0xc'));var deskjs=require(_0xeeb5('0xd'));var toCsv=require(_0xeeb5('0x8'));var querystring=require(_0xeeb5('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xeeb5('0xf'));var qs=require(_0xeeb5('0x10'));var as=require(_0xeeb5('0x11'));var hardwareService=require(_0xeeb5('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xeeb5('0x13'));var config=require(_0xeeb5('0x14'));var licenseUtil=require(_0xeeb5('0x15'));var db=require(_0xeeb5('0x16'))['db'];var dbH=require(_0xeeb5('0x16'))[_0xeeb5('0x17')];function respondWithStatusCode(_0xc681fc,_0x539677){_0x539677=_0x539677||0xcc;return function(_0x14d7f7){if(_0x14d7f7){return _0xc681fc['sendStatus'](_0x539677);}return _0xc681fc[_0xeeb5('0x18')](_0x539677)['end']();};}function respondWithResult(_0x4a4b47,_0x3a6205){_0x3a6205=_0x3a6205||0xc8;return function(_0x24daa5){if(_0x24daa5){return _0x4a4b47[_0xeeb5('0x18')](_0x3a6205)[_0xeeb5('0x19')](_0x24daa5);}};}function respondWithFilteredResult(_0xd3ac3d,_0x145ae8){return function(_0x482ed7){if(_0x482ed7){var _0x201020=typeof _0x145ae8[_0xeeb5('0x1a')]===_0xeeb5('0x1b')&&typeof _0x145ae8[_0xeeb5('0x1c')]===_0xeeb5('0x1b');var _0x5db57a=_0x482ed7['count'];var _0xd8433b=_0x201020?0x0:_0x145ae8['offset'];var _0x97bb78=_0x201020?_0x482ed7['count']:_0x145ae8[_0xeeb5('0x1a')]+_0x145ae8[_0xeeb5('0x1c')];var _0xc639ce;if(_0x97bb78>=_0x5db57a){_0x97bb78=_0x5db57a;_0xc639ce=0xc8;}else{_0xc639ce=0xce;}_0xd3ac3d[_0xeeb5('0x18')](_0xc639ce);return _0xd3ac3d[_0xeeb5('0x1d')]('Content-Range',_0xd8433b+'-'+_0x97bb78+'/'+_0x5db57a)[_0xeeb5('0x19')](_0x482ed7);}return null;};}function patchUpdates(_0x115bed){return function(_0x1c507b){try{jsonpatch[_0xeeb5('0x1e')](_0x1c507b,_0x115bed,!![]);}catch(_0x1fb3a8){return BPromise[_0xeeb5('0x1f')](_0x1fb3a8);}return _0x1c507b[_0xeeb5('0x20')]();};}function saveUpdates(_0x144173,_0x54049a){return function(_0x36b1ea){if(_0x36b1ea){return _0x36b1ea[_0xeeb5('0x21')](_0x144173)['then'](function(_0x9bfb84){return _0x9bfb84;});}return null;};}function removeEntity(_0x4482ab,_0x4c2cc6){return function(_0x5206d9){if(_0x5206d9){return _0x5206d9[_0xeeb5('0x22')]()[_0xeeb5('0x23')](function(){var _0x1bb6d9=_0x5206d9[_0xeeb5('0x24')]({'plain':!![]});var _0x57e16b=_0xeeb5('0x25');return db[_0xeeb5('0x26')][_0xeeb5('0x22')]({'where':{'type':_0x57e16b,'resourceId':_0x1bb6d9['id']}})['then'](function(){return _0x5206d9;});})[_0xeeb5('0x23')](function(){_0x4482ab[_0xeeb5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b7ca2,_0x4270ab){return function(_0x51d3dc){if(!_0x51d3dc){_0x3b7ca2[_0xeeb5('0x27')](0x194);}return _0x51d3dc;};}function handleError(_0x175301,_0x158adf){_0x158adf=_0x158adf||0x1f4;return function(_0x1bfeb6){logger[_0xeeb5('0x28')](_0x1bfeb6[_0xeeb5('0x29')]);if(_0x1bfeb6[_0xeeb5('0x2a')]){delete _0x1bfeb6['name'];}_0x175301[_0xeeb5('0x18')](_0x158adf)[_0xeeb5('0x2b')](_0x1bfeb6);};}exports[_0xeeb5('0x2c')]=function(_0x5b2174,_0x142d64){var _0x46de1c={},_0x1518a7={},_0x1fcc37={'count':0x0,'rows':[]};var _0x3eaa2f=_['map'](db['AnalyticCustomReport'][_0xeeb5('0x2d')],function(_0x77064a){return{'name':_0x77064a[_0xeeb5('0x2e')],'type':_0x77064a['type']['key']};});_0x1518a7['model']=_['map'](_0x3eaa2f,_0xeeb5('0x2a'));_0x1518a7[_0xeeb5('0x2f')]=_[_0xeeb5('0x30')](_0x5b2174[_0xeeb5('0x2f')]);_0x1518a7[_0xeeb5('0x31')]=_['intersection'](_0x1518a7[_0xeeb5('0x32')],_0x1518a7[_0xeeb5('0x2f')]);_0x46de1c[_0xeeb5('0x33')]=_[_0xeeb5('0x34')](_0x1518a7[_0xeeb5('0x32')],qs['fields'](_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x35')]));_0x46de1c[_0xeeb5('0x33')]=_0x46de1c[_0xeeb5('0x33')]['length']?_0x46de1c[_0xeeb5('0x33')]:_0x1518a7[_0xeeb5('0x32')];if(!_0x5b2174['query'][_0xeeb5('0x36')](_0xeeb5('0x37'))){_0x46de1c[_0xeeb5('0x1c')]=qs[_0xeeb5('0x1c')](_0x5b2174[_0xeeb5('0x2f')]['limit']);_0x46de1c[_0xeeb5('0x1a')]=qs[_0xeeb5('0x1a')](_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x1a')]);}_0x46de1c[_0xeeb5('0x38')]=qs[_0xeeb5('0x39')](_0x5b2174[_0xeeb5('0x2f')]['sort']);_0x46de1c[_0xeeb5('0x3a')]=qs[_0xeeb5('0x31')](_[_0xeeb5('0x3b')](_0x5b2174[_0xeeb5('0x2f')],_0x1518a7['filters']),_0x3eaa2f);if(_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x3c')]){_0x46de1c[_0xeeb5('0x3a')]=_['merge'](_0x46de1c[_0xeeb5('0x3a')],{'$or':_[_0xeeb5('0x3d')](_0x3eaa2f,function(_0x4f9021){if(_0x4f9021[_0xeeb5('0x3e')]!==_0xeeb5('0x3f')){var _0xa92a9f={};_0xa92a9f[_0x4f9021[_0xeeb5('0x2a')]]={'$like':'%'+_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x3c')]+'%'};return _0xa92a9f;}})});}_0x46de1c=_[_0xeeb5('0x40')]({},_0x46de1c,_0x5b2174['options']);var _0x57a0cf={'where':_0x46de1c[_0xeeb5('0x3a')]};return db['AnalyticCustomReport'][_0xeeb5('0x41')](_0x57a0cf)[_0xeeb5('0x23')](function(_0x5a157c){_0x1fcc37[_0xeeb5('0x41')]=_0x5a157c;if(_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x42')]){_0x46de1c['include']=[{'all':!![]}];}return db[_0xeeb5('0x43')][_0xeeb5('0x44')](_0x46de1c);})[_0xeeb5('0x23')](function(_0xadb3a4){_0x1fcc37['rows']=_0xadb3a4;return _0x1fcc37;})[_0xeeb5('0x23')](respondWithFilteredResult(_0x142d64,_0x46de1c))[_0xeeb5('0x45')](handleError(_0x142d64,null));};exports[_0xeeb5('0x46')]=function(_0x527651,_0x3021c0){var _0x4bd15f={'raw':![],'where':{'id':_0x527651[_0xeeb5('0x47')]['id']}},_0x1b177b={};_0x1b177b['model']=_[_0xeeb5('0x30')](db[_0xeeb5('0x43')][_0xeeb5('0x2d')]);_0x1b177b['query']=_[_0xeeb5('0x30')](_0x527651[_0xeeb5('0x2f')]);_0x1b177b[_0xeeb5('0x31')]=_[_0xeeb5('0x34')](_0x1b177b[_0xeeb5('0x32')],_0x1b177b['query']);_0x4bd15f['attributes']=_[_0xeeb5('0x34')](_0x1b177b[_0xeeb5('0x32')],qs['fields'](_0x527651[_0xeeb5('0x2f')][_0xeeb5('0x35')]));_0x4bd15f[_0xeeb5('0x33')]=_0x4bd15f[_0xeeb5('0x33')][_0xeeb5('0x48')]?_0x4bd15f[_0xeeb5('0x33')]:_0x1b177b[_0xeeb5('0x32')];if(_0x527651[_0xeeb5('0x2f')][_0xeeb5('0x42')]){_0x4bd15f[_0xeeb5('0x49')]=[{'all':!![]}];}_0x4bd15f=_['merge']({},_0x4bd15f,_0x527651[_0xeeb5('0x4a')]);return db[_0xeeb5('0x43')]['find'](_0x4bd15f)[_0xeeb5('0x23')](handleEntityNotFound(_0x3021c0,null))['then'](respondWithResult(_0x3021c0,null))[_0xeeb5('0x45')](handleError(_0x3021c0,null));};exports['create']=function(_0x5199f1,_0x1da7b0){return db[_0xeeb5('0x43')][_0xeeb5('0x4b')](_0x5199f1[_0xeeb5('0x4c')],{})[_0xeeb5('0x23')](function(_0x5c3c0f){var _0xe3aa24=_0x5199f1['user'][_0xeeb5('0x24')]({'plain':!![]});if(!_0xe3aa24)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe3aa24[_0xeeb5('0x4d')]===_0xeeb5('0x4e')){var _0x37cc77=_0x5c3c0f[_0xeeb5('0x24')]({'plain':!![]});var _0x291245=_0xeeb5('0x4f');return db[_0xeeb5('0x50')][_0xeeb5('0x51')]({'where':{'name':_0x291245,'userProfileId':_0xe3aa24[_0xeeb5('0x52')]},'raw':!![]})[_0xeeb5('0x23')](function(_0x43470a){if(_0x43470a&&_0x43470a[_0xeeb5('0x53')]===0x0){return db[_0xeeb5('0x26')][_0xeeb5('0x4b')]({'name':_0x37cc77[_0xeeb5('0x2a')],'resourceId':_0x37cc77['id'],'type':'CustomReports','sectionId':_0x43470a['id']},{})[_0xeeb5('0x23')](function(){return _0x5c3c0f;});}else{return _0x5c3c0f;}})[_0xeeb5('0x45')](function(_0x149724){logger['error'](_0xeeb5('0x54'),_0x149724);throw _0x149724;});}return _0x5c3c0f;})['then'](respondWithResult(_0x1da7b0,0xc9))[_0xeeb5('0x45')](handleError(_0x1da7b0,null));};exports[_0xeeb5('0x21')]=function(_0x2277cc,_0x355eff){if(_0x2277cc[_0xeeb5('0x4c')]['id']){delete _0x2277cc['body']['id'];}return db[_0xeeb5('0x43')]['find']({'where':{'id':_0x2277cc[_0xeeb5('0x47')]['id']}})[_0xeeb5('0x23')](handleEntityNotFound(_0x355eff,null))['then'](saveUpdates(_0x2277cc[_0xeeb5('0x4c')],null))[_0xeeb5('0x23')](respondWithResult(_0x355eff,null))[_0xeeb5('0x45')](handleError(_0x355eff,null));};exports[_0xeeb5('0x22')]=function(_0x83dcd4,_0x4b3568){return db[_0xeeb5('0x43')]['find']({'where':{'id':_0x83dcd4['params']['id']}})[_0xeeb5('0x23')](handleEntityNotFound(_0x4b3568,null))['then'](removeEntity(_0x4b3568,null))[_0xeeb5('0x45')](handleError(_0x4b3568,null));};exports[_0xeeb5('0x55')]=function(_0x226056,_0x1725b8){var _0xe8f999=0xa;var _0x348209=[_0xeeb5('0x56'),'left_join','right_join',_0xeeb5('0x57')];var _0x25aee1={'SUM':_0xeeb5('0x58'),'COUNT':_0xeeb5('0x59'),'COUNT DISTINCT':_0xeeb5('0x5a'),'MAX':_0xeeb5('0x5b'),'MIN':_0xeeb5('0x5c'),'AVG':_0xeeb5('0x5d'),'GROUP_CONCAT':_0xeeb5('0x5e'),'GROUP_CONCAT ASC':_0xeeb5('0x5f'),'GROUP_CONCAT DESC':_0xeeb5('0x60')};var _0x3b4846={'SEC_TO_TIME':_0xeeb5('0x61'),'DATE':'DATE(%s)','HOUR':_0xeeb5('0x62'),'ROUND':_0xeeb5('0x63'),'UNIX_TIMESTAMP':_0xeeb5('0x64')};var _0x539a8a=function(_0x1e624e){return!_[_0xeeb5('0x65')](['IS\x20NULL',_0xeeb5('0x66'),_0xeeb5('0x67'),_0xeeb5('0x68')],_0x1e624e);};var _0x47ec23=function(_0x17a858){if(!_0x17a858||!_0x17a858[_0xeeb5('0x69')][_0xeeb5('0x48')]){return'';}for(var _0x334f6f='(',_0x153485=0x0;_0x153485<_0x17a858[_0xeeb5('0x69')][_0xeeb5('0x48')];_0x153485+=0x1){_0x153485>0x0&&(_0x334f6f+='\x20'+_0x17a858[_0xeeb5('0x6a')]+'\x20');_0x334f6f+=_0x17a858[_0xeeb5('0x69')][_0x153485][_0xeeb5('0x6b')]?_0x47ec23(_0x17a858[_0xeeb5('0x69')][_0x153485]['group']):_0x17a858[_0xeeb5('0x69')][_0x153485][_0xeeb5('0x6c')]+'\x20'+_0x17a858[_0xeeb5('0x69')][_0x153485][_0xeeb5('0x6d')]+(_0x539a8a(_0x17a858[_0xeeb5('0x69')][_0x153485][_0xeeb5('0x6d')])?'\x20'+_0x17a858[_0xeeb5('0x69')][_0x153485]['value']:'');}return _0x334f6f+')';};var _0x68d3a7={'where':{'id':_0x226056[_0xeeb5('0x47')]['id']}},_0x4414e5,_0x34edeb,_0x5edf4f,_0x3fcd6e,_0x17a6b4;_0x68d3a7=_['merge']({},_0x68d3a7,_0x226056[_0xeeb5('0x4a')]);return db[_0xeeb5('0x43')][_0xeeb5('0x51')](_0x68d3a7)[_0xeeb5('0x23')](function(_0x52c262){if(_0x52c262){_0x4414e5=_0x52c262;return _0x52c262[_0xeeb5('0x6e')]();}return null;})[_0xeeb5('0x23')](function(_0x5d3e32){if(_0x5d3e32){if(!_0x5d3e32[_0xeeb5('0x48')]){throw new db[(_0xeeb5('0x6f'))][(_0xeeb5('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x34edeb=_0x5d3e32;return db[_0xeeb5('0x71')]['findAll']({'raw':!![]});}return null;})[_0xeeb5('0x23')](function(_0x166577){if(_0x166577){_0x5edf4f=_['keyBy'](_0x166577,'id');var _0x40e58b;var _0x18bdb7=squel[_0xeeb5('0x72')]();_0x18bdb7[_0xeeb5('0x73')](_0x4414e5['table']);for(var _0x10f8fd=0x0;_0x10f8fd<_0x34edeb['length'];_0x10f8fd+=0x1){_0x40e58b=_0x34edeb[_0x10f8fd]['MetricId']?_0x5edf4f[_0x34edeb[_0x10f8fd][_0xeeb5('0x74')]][_0xeeb5('0x75')]:_0x34edeb[_0x10f8fd][_0xeeb5('0x6c')];_0x40e58b=_0x34edeb[_0x10f8fd][_0xeeb5('0x76')]?_[_0xeeb5('0x77')](_0x25aee1[_0x34edeb[_0x10f8fd][_0xeeb5('0x76')]],'%s',_0x40e58b):_0x40e58b;_0x40e58b=_0x34edeb[_0x10f8fd][_0xeeb5('0x78')]?_[_0xeeb5('0x77')](_0x3b4846[_0x34edeb[_0x10f8fd]['format']],'%s',_0x40e58b):_0x40e58b;if(_0x34edeb[_0x10f8fd][_0xeeb5('0x79')]){_0x18bdb7['group'](_0x40e58b);}_0x34edeb[_0x10f8fd]['orderBy']&&_0x18bdb7['order'](_0x40e58b,_0x34edeb[_0x10f8fd][_0xeeb5('0x7a')]===_0xeeb5('0x7b')?![]:!![]);_0x18bdb7[_0xeeb5('0x6c')](_0x40e58b,_0x34edeb[_0x10f8fd][_0xeeb5('0x7c')]||_0x40e58b);}if(_0x4414e5[_0xeeb5('0x7d')]){_0x4414e5[_0xeeb5('0x7d')]=JSON[_0xeeb5('0x7e')](_0x4414e5[_0xeeb5('0x7d')]);for(var _0x3c5892=0x0;_0x3c5892<_0x4414e5[_0xeeb5('0x7d')][_0xeeb5('0x48')];_0x3c5892+=0x1){if(_0x4414e5[_0xeeb5('0x7d')][_0x3c5892][_0xeeb5('0x3e')]&&_[_0xeeb5('0x65')](_0x348209,_0x4414e5[_0xeeb5('0x7d')][_0x3c5892]['type'])&&_0x4414e5[_0xeeb5('0x7d')][_0x3c5892][_0xeeb5('0x7f')]&&_0x4414e5[_0xeeb5('0x7d')][_0x3c5892]['foreignTable']&&_0x4414e5[_0xeeb5('0x7d')][_0x3c5892][_0xeeb5('0x80')]){_0x18bdb7[_0x4414e5['joins'][_0x3c5892][_0xeeb5('0x3e')]](_0x4414e5[_0xeeb5('0x7d')][_0x3c5892]['foreignTable'],null,util[_0xeeb5('0x78')](_0xeeb5('0x81'),_0x4414e5[_0xeeb5('0x82')],_0x4414e5[_0xeeb5('0x7d')][_0x3c5892]['parentKey'],_0x4414e5['joins'][_0x3c5892][_0xeeb5('0x83')],_0x4414e5[_0xeeb5('0x7d')][_0x3c5892][_0xeeb5('0x80')]));}}}if(_0x4414e5['conditions']){_0x4414e5[_0xeeb5('0x84')]=JSON[_0xeeb5('0x7e')](_0x4414e5['conditions']);_0x18bdb7[_0xeeb5('0x3a')](_0x47ec23(_0x4414e5[_0xeeb5('0x84')][_0xeeb5('0x6b')]));}_0x17a6b4=_0x18bdb7[_0xeeb5('0x85')]();_0x18bdb7['limit'](_0xe8f999);_0x18bdb7[_0xeeb5('0x1a')](0x0);logger['debug']('Limited\x20Query:',_0x18bdb7[_0xeeb5('0x86')]());return dbH[_0xeeb5('0x87')][_0xeeb5('0x2f')](_0x18bdb7[_0xeeb5('0x86')](),{'type':dbH[_0xeeb5('0x87')]['QueryTypes'][_0xeeb5('0x88')]});}})[_0xeeb5('0x23')](respondWithResult(_0x1725b8,null))[_0xeeb5('0x45')](handleError(_0x1725b8,null));};function runReport(_0x539bcf,_0x1ad28a,_0x3396ec){var _0x17ba20=_0x1ad28a[_0xeeb5('0x2a')];var _0x1df7ca=0xa;var _0x159ef3=[_0xeeb5('0x56'),_0xeeb5('0x89'),_0xeeb5('0x8a'),_0xeeb5('0x57')];var _0x2491bf={'SUM':_0xeeb5('0x58'),'COUNT':_0xeeb5('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xeeb5('0x5b'),'MIN':_0xeeb5('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xeeb5('0x5e'),'GROUP_CONCAT ASC':_0xeeb5('0x5f'),'GROUP_CONCAT DESC':_0xeeb5('0x60')};var _0x3ed4c5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeeb5('0x8b'),'HOUR':'HOUR(%s)','ROUND':_0xeeb5('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x13070a=function(_0x37a844){return!_['includes']([_0xeeb5('0x8c'),_0xeeb5('0x66'),_0xeeb5('0x67'),_0xeeb5('0x68')],_0x37a844);};var _0x3c43a3=function(_0x376a51){if(!_0x376a51||!_0x376a51['rules'][_0xeeb5('0x48')]){return'';}for(var _0x5989f4='(',_0xf85c70=0x0;_0xf85c70<_0x376a51[_0xeeb5('0x69')]['length'];_0xf85c70+=0x1){_0xf85c70>0x0&&(_0x5989f4+='\x20'+_0x376a51[_0xeeb5('0x6a')]+'\x20');_0x5989f4+=_0x376a51['rules'][_0xf85c70]['group']?_0x3c43a3(_0x376a51[_0xeeb5('0x69')][_0xf85c70][_0xeeb5('0x6b')]):_0x376a51['rules'][_0xf85c70][_0xeeb5('0x6c')]+'\x20'+_0x376a51[_0xeeb5('0x69')][_0xf85c70][_0xeeb5('0x6d')]+(_0x13070a(_0x376a51['rules'][_0xf85c70][_0xeeb5('0x6d')])?'\x20'+_0x376a51[_0xeeb5('0x69')][_0xf85c70][_0xeeb5('0x8d')]:'');}return _0x5989f4+')';};var _0x72926a={'where':{'id':_0x539bcf['id']}},_0x45a35c,_0x55629a,_0x4f1e70,_0x1830d0,_0x5db4aa;_0x72926a=_[_0xeeb5('0x40')]({},_0x72926a,_0x3396ec);return db[_0xeeb5('0x43')][_0xeeb5('0x51')](_0x72926a)[_0xeeb5('0x23')](function(_0xd013ed){if(_0xd013ed){_0x45a35c=_0xd013ed;return _0xd013ed[_0xeeb5('0x6e')]();}return null;})[_0xeeb5('0x23')](function(_0x56c10f){if(_0x56c10f){if(!_0x56c10f[_0xeeb5('0x48')]){throw new db['Sequelize'][(_0xeeb5('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x55629a=_0x56c10f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x5aa3b6){if(_0x5aa3b6){_0x4f1e70=_[_0xeeb5('0x8e')](_0x5aa3b6,'id');var _0xf27fe0;var _0x1e1e19=squel[_0xeeb5('0x72')]();_0x1e1e19[_0xeeb5('0x73')](_0x45a35c[_0xeeb5('0x82')]);for(var _0x1a9d69=0x0;_0x1a9d69<_0x55629a[_0xeeb5('0x48')];_0x1a9d69+=0x1){_0xf27fe0=_0x55629a[_0x1a9d69][_0xeeb5('0x74')]?_0x4f1e70[_0x55629a[_0x1a9d69][_0xeeb5('0x74')]]['metric']:_0x55629a[_0x1a9d69][_0xeeb5('0x6c')];_0xf27fe0=_0x55629a[_0x1a9d69][_0xeeb5('0x76')]?_[_0xeeb5('0x77')](_0x2491bf[_0x55629a[_0x1a9d69]['function']],'%s',_0xf27fe0):_0xf27fe0;_0xf27fe0=_0x55629a[_0x1a9d69][_0xeeb5('0x78')]?_[_0xeeb5('0x77')](_0x3ed4c5[_0x55629a[_0x1a9d69]['format']],'%s',_0xf27fe0):_0xf27fe0;if(_0x55629a[_0x1a9d69]['groupBy']){_0x1e1e19[_0xeeb5('0x6b')](_0xf27fe0);}_0x55629a[_0x1a9d69][_0xeeb5('0x7a')]&&_0x1e1e19['order'](_0xf27fe0,_0x55629a[_0x1a9d69][_0xeeb5('0x7a')]===_0xeeb5('0x7b')?![]:!![]);_0x1e1e19[_0xeeb5('0x6c')](_0xf27fe0,_0x55629a[_0x1a9d69]['alias']||_0xf27fe0);}if(_0x45a35c[_0xeeb5('0x7d')]){_0x45a35c[_0xeeb5('0x7d')]=JSON['parse'](_0x45a35c[_0xeeb5('0x7d')]);for(var _0x394710=0x0;_0x394710<_0x45a35c[_0xeeb5('0x7d')][_0xeeb5('0x48')];_0x394710+=0x1){if(_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x3e')]&&_[_0xeeb5('0x65')](_0x159ef3,_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x3e')])&&_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x7f')]&&_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x83')]&&_0x45a35c[_0xeeb5('0x7d')][_0x394710]['foreignKey']){_0x1e1e19[_0x45a35c['joins'][_0x394710][_0xeeb5('0x3e')]](_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x83')],null,util[_0xeeb5('0x78')](_0xeeb5('0x81'),_0x45a35c[_0xeeb5('0x82')],_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x7f')],_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x83')],_0x45a35c[_0xeeb5('0x7d')][_0x394710]['foreignKey']));}}}if(_0x45a35c[_0xeeb5('0x84')]){_0x45a35c['conditions']=JSON['parse'](_0x45a35c[_0xeeb5('0x84')]);_0x1e1e19[_0xeeb5('0x3a')](_0x3c43a3(_0x45a35c['conditions'][_0xeeb5('0x6b')]));}_0x5db4aa=_0x1e1e19[_0xeeb5('0x85')]();_0x1e1e19[_0xeeb5('0x1c')](_0x1df7ca);_0x1e1e19[_0xeeb5('0x1a')](0x0);return;}})[_0xeeb5('0x23')](function(){if(_0x1ad28a[_0xeeb5('0x8f')]===_0xeeb5('0x90')){return null;}var _0x43ad2d=_[_0xeeb5('0x40')](_0x1ad28a,{'name':_0x1ad28a[_0xeeb5('0x91')]||_0x1ad28a[_0xeeb5('0x2a')]||_0x45a35c[_0xeeb5('0x2a')],'basename':_0x17ba20,'savename':util[_0xeeb5('0x78')]('%s-%s.%s',_0x1ad28a['name']||_0x45a35c[_0xeeb5('0x2a')],require(_0xeeb5('0x92'))['generate'](0x4),_0x1ad28a[_0xeeb5('0x8f')]||_0xeeb5('0x93')),'reportId':_0x45a35c['id'],'reportType':'custom'});return db[_0xeeb5('0x94')][_0xeeb5('0x4b')](_0x43ad2d,{'raw':!![]});})[_0xeeb5('0x23')](function(_0x466c54){if(_0x45a35c[_0xeeb5('0x82')]==='cdr'){_0x5db4aa[_0xeeb5('0x3a')](_0x45a35c[_0xeeb5('0x82')]+_0xeeb5('0x95'),_0x1ad28a[_0xeeb5('0x96')],_0x1ad28a[_0xeeb5('0x97')]);}else{_0x5db4aa[_0xeeb5('0x3a')](_0x45a35c['table']+_0xeeb5('0x98'),_0x1ad28a[_0xeeb5('0x96')],_0x1ad28a[_0xeeb5('0x97')]);}if(_0x466c54){logger[_0xeeb5('0x99')](_0xeeb5('0x9a'),_0x5db4aa[_0xeeb5('0x86')]());require('child_process')['fork'](path[_0xeeb5('0x56')](__dirname,_0xeeb5('0x9b'),_0x466c54[_0xeeb5('0x8f')]),[_0x466c54['id'],_0x5db4aa[_0xeeb5('0x86')](),path[_0xeeb5('0x56')](__dirname,_0xeeb5('0x9c'),_0x466c54[_0xeeb5('0x9d')]),_0x17ba20]);return _0x466c54;}else{var _0x1d5286=squel['select']();_0x1d5286[_0xeeb5('0x73')]('('+_0x5db4aa[_0xeeb5('0x86')]()+')','countTable');_0x1d5286[_0xeeb5('0x6c')](_0xeeb5('0x9e'),'count');_0x5db4aa['limit'](_0x1ad28a[_0xeeb5('0x1c')]||_0x1df7ca);_0x5db4aa[_0xeeb5('0x1a')](_0x1ad28a[_0xeeb5('0x1a')]||0x0);return dbH['sequelize'][_0xeeb5('0x2f')](_0x1d5286['toString'](),{'type':dbH['sequelize'][_0xeeb5('0x9f')][_0xeeb5('0x88')]})['then'](function(_0x2c7984){if(!_0x2c7984['length']){_0x1830d0=0x0;}else{_0x1830d0=_0x2c7984[0x0][_0xeeb5('0x41')]||0x0;}return dbH[_0xeeb5('0x87')][_0xeeb5('0x2f')](_0x5db4aa['toString'](),{'type':dbH[_0xeeb5('0x87')][_0xeeb5('0x9f')][_0xeeb5('0x88')]});})[_0xeeb5('0x23')](function(_0x3ee131){return{'rows':_0x3ee131||[],'count':_0x1830d0};});}});}exports[_0xeeb5('0xa0')]=function(_0x104bd6,_0x2c78a5){return runReport(_0x104bd6[_0xeeb5('0x47')],_0x104bd6['query'],_0x104bd6[_0xeeb5('0x4a')])['then'](respondWithResult(_0x2c78a5,null))[_0xeeb5('0x45')](handleError(_0x2c78a5,null));};exports['runReport']=runReport;exports[_0xeeb5('0x2f')]=function(_0x1c75e1,_0x324aeb){var _0x1dad46=0xa;var _0x2351d6=[_0xeeb5('0x56'),_0xeeb5('0x89'),'right_join',_0xeeb5('0x57')];var _0x1e93c7={'SUM':_0xeeb5('0x58'),'COUNT':_0xeeb5('0x59'),'COUNT DISTINCT':_0xeeb5('0x5a'),'MAX':_0xeeb5('0x5b'),'MIN':_0xeeb5('0x5c'),'AVG':_0xeeb5('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xeeb5('0x5f'),'GROUP_CONCAT DESC':_0xeeb5('0x60')};var _0x19eea7={'SEC_TO_TIME':_0xeeb5('0x61'),'DATE':_0xeeb5('0x8b'),'HOUR':_0xeeb5('0x62'),'ROUND':_0xeeb5('0x63'),'UNIX_TIMESTAMP':_0xeeb5('0x64')};var _0x21d96b=function(_0x21840d){return!_[_0xeeb5('0x65')](['IS\x20NULL',_0xeeb5('0x66'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x21840d);};var _0x279fc8=function(_0x310bf0){if(!_0x310bf0||!_0x310bf0[_0xeeb5('0x69')][_0xeeb5('0x48')]){return'';}for(var _0x5c8ada='(',_0xad747f=0x0;_0xad747f<_0x310bf0[_0xeeb5('0x69')]['length'];_0xad747f+=0x1){_0xad747f>0x0&&(_0x5c8ada+='\x20'+_0x310bf0[_0xeeb5('0x6a')]+'\x20');_0x5c8ada+=_0x310bf0[_0xeeb5('0x69')][_0xad747f][_0xeeb5('0x6b')]?_0x279fc8(_0x310bf0[_0xeeb5('0x69')][_0xad747f][_0xeeb5('0x6b')]):_0x310bf0[_0xeeb5('0x69')][_0xad747f]['field']+'\x20'+_0x310bf0[_0xeeb5('0x69')][_0xad747f]['condition']+(_0x21d96b(_0x310bf0[_0xeeb5('0x69')][_0xad747f][_0xeeb5('0x6d')])?'\x20'+_0x310bf0[_0xeeb5('0x69')][_0xad747f][_0xeeb5('0x8d')]:'');}return _0x5c8ada+')';};var _0x3bce78={'where':{'id':_0x1c75e1[_0xeeb5('0x47')]['id']}},_0x65d25e,_0x108fb2,_0x114d96,_0x2d7a31,_0x2e6f5a;_0x3bce78=_[_0xeeb5('0x40')]({},_0x3bce78,_0x1c75e1['options']);return db[_0xeeb5('0x43')][_0xeeb5('0x51')](_0x3bce78)['then'](function(_0x1836c8){if(_0x1836c8){_0x65d25e=_0x1836c8;return _0x1836c8[_0xeeb5('0x6e')]();}return null;})[_0xeeb5('0x23')](function(_0x5450fd){if(_0x5450fd){if(!_0x5450fd[_0xeeb5('0x48')]){throw new db[(_0xeeb5('0x6f'))][(_0xeeb5('0x70'))](_0xeeb5('0xa1'),0x193);}_0x108fb2=_0x5450fd;return db['AnalyticMetric'][_0xeeb5('0x44')]({'raw':!![]});}return null;})[_0xeeb5('0x23')](function(_0x46da19){if(_0x46da19){_0x114d96=_['keyBy'](_0x46da19,'id');var _0x4c0333;var _0x715be7=squel[_0xeeb5('0x72')]();_0x715be7[_0xeeb5('0x73')](_0x65d25e[_0xeeb5('0x82')]);for(var _0x3783ed=0x0;_0x3783ed<_0x108fb2[_0xeeb5('0x48')];_0x3783ed+=0x1){_0x4c0333=_0x108fb2[_0x3783ed]['MetricId']?_0x114d96[_0x108fb2[_0x3783ed][_0xeeb5('0x74')]][_0xeeb5('0x75')]:_0x108fb2[_0x3783ed][_0xeeb5('0x6c')];_0x4c0333=_0x108fb2[_0x3783ed][_0xeeb5('0x76')]?_[_0xeeb5('0x77')](_0x1e93c7[_0x108fb2[_0x3783ed][_0xeeb5('0x76')]],'%s',_0x4c0333):_0x4c0333;_0x4c0333=_0x108fb2[_0x3783ed]['format']?_[_0xeeb5('0x77')](_0x19eea7[_0x108fb2[_0x3783ed][_0xeeb5('0x78')]],'%s',_0x4c0333):_0x4c0333;if(_0x108fb2[_0x3783ed][_0xeeb5('0x79')]){_0x715be7[_0xeeb5('0x6b')](_0x4c0333);}_0x108fb2[_0x3783ed][_0xeeb5('0x7a')]&&_0x715be7[_0xeeb5('0x38')](_0x4c0333,_0x108fb2[_0x3783ed][_0xeeb5('0x7a')]===_0xeeb5('0x7b')?![]:!![]);_0x715be7[_0xeeb5('0x6c')](_0x4c0333,_0x108fb2[_0x3783ed][_0xeeb5('0x7c')]||_0x4c0333);}if(_0x65d25e[_0xeeb5('0x7d')]){_0x65d25e['joins']=JSON[_0xeeb5('0x7e')](_0x65d25e[_0xeeb5('0x7d')]);for(var _0x1dee23=0x0;_0x1dee23<_0x65d25e[_0xeeb5('0x7d')][_0xeeb5('0x48')];_0x1dee23+=0x1){if(_0x65d25e[_0xeeb5('0x7d')][_0x1dee23]['type']&&_[_0xeeb5('0x65')](_0x2351d6,_0x65d25e[_0xeeb5('0x7d')][_0x1dee23][_0xeeb5('0x3e')])&&_0x65d25e[_0xeeb5('0x7d')][_0x1dee23]['parentKey']&&_0x65d25e['joins'][_0x1dee23][_0xeeb5('0x83')]&&_0x65d25e[_0xeeb5('0x7d')][_0x1dee23][_0xeeb5('0x80')]){_0x715be7[_0x65d25e['joins'][_0x1dee23][_0xeeb5('0x3e')]](_0x65d25e[_0xeeb5('0x7d')][_0x1dee23]['foreignTable'],null,util[_0xeeb5('0x78')]('%s.%s\x20=\x20%s.%s',_0x65d25e[_0xeeb5('0x82')],_0x65d25e[_0xeeb5('0x7d')][_0x1dee23]['parentKey'],_0x65d25e[_0xeeb5('0x7d')][_0x1dee23][_0xeeb5('0x83')],_0x65d25e[_0xeeb5('0x7d')][_0x1dee23][_0xeeb5('0x80')]));}}}if(_0x65d25e[_0xeeb5('0x84')]){_0x65d25e[_0xeeb5('0x84')]=JSON[_0xeeb5('0x7e')](_0x65d25e[_0xeeb5('0x84')]);_0x715be7['where'](_0x279fc8(_0x65d25e[_0xeeb5('0x84')][_0xeeb5('0x6b')]));}_0x2e6f5a=_0x715be7[_0xeeb5('0x85')]();_0x715be7[_0xeeb5('0x1c')](_0x1dad46);_0x715be7[_0xeeb5('0x1a')](0x0);logger[_0xeeb5('0xa2')]('Limited\x20Query:',_0x715be7[_0xeeb5('0x86')]());return dbH[_0xeeb5('0x87')]['query'](_0x715be7['toString'](),{'type':dbH[_0xeeb5('0x87')][_0xeeb5('0x9f')][_0xeeb5('0x88')]});}})[_0xeeb5('0x23')](function(){return{'sql':_0x2e6f5a[_0xeeb5('0x86')]()};})[_0xeeb5('0x23')](respondWithResult(_0x324aeb,null))[_0xeeb5('0x45')](handleError(_0x324aeb,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index f0296b3..01f838d 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 _0xebd8=['path','../../config/environment','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','bluebird'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xebd8,0x164));var _0x8ebd=function(_0x566aff,_0x37fa7a){_0x566aff=_0x566aff-0x0;var _0x28ff10=_0xebd8[_0x566aff];return _0x28ff10;};'use strict';var _=require('lodash');var util=require(_0x8ebd('0x0'));var logger=require(_0x8ebd('0x1'))(_0x8ebd('0x2'));var moment=require('moment');var BPromise=require(_0x8ebd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ebd('0x4'));var rimraf=require('rimraf');var config=require(_0x8ebd('0x5'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x21f2f6,_0x41f227){return _0x21f2f6['define'](_0x8ebd('0x6'),attributes,{'tableName':_0x8ebd('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2089=['api','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x2089,0x107));var _0x9208=function(_0x231ef3,_0x75aa1c){_0x231ef3=_0x231ef3-0x0;var _0x3a9965=_0x2089[_0x231ef3];return _0x3a9965;};'use strict';var _=require(_0x9208('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9208('0x1'));var moment=require(_0x9208('0x2'));var BPromise=require(_0x9208('0x3'));var rp=require(_0x9208('0x4'));var fs=require('fs');var path=require(_0x9208('0x5'));var rimraf=require('rimraf');var config=require(_0x9208('0x6'));var attributes=require(_0x9208('0x7'));module[_0x9208('0x8')]=function(_0x4cd1fc,_0x45bc6b){return _0x4cd1fc[_0x9208('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x9208('0xa'),'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 a5f2b1e..81c0fa2 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 _0x6776=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x7a7e22,_0x5c8f17){var _0x57c703=function(_0x4268fb){while(--_0x4268fb){_0x7a7e22['push'](_0x7a7e22['shift']());}};_0x57c703(++_0x5c8f17);}(_0x6776,0xcc));var _0x6677=function(_0x5f49bc,_0x548555){_0x5f49bc=_0x5f49bc-0x0;var _0x44bbb9=_0x6776[_0x5f49bc];return _0x44bbb9;};'use strict';var _=require(_0x6677('0x0'));var util=require(_0x6677('0x1'));var moment=require(_0x6677('0x2'));var BPromise=require(_0x6677('0x3'));var rs=require(_0x6677('0x4'));var fs=require('fs');var Redis=require(_0x6677('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6677('0x6'));var logger=require(_0x6677('0x7'))(_0x6677('0x8'));var config=require('../../config/environment');var jayson=require(_0x6677('0x9'));var client=jayson[_0x6677('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20048f,_0xce23d6,_0x3d6ade){return new BPromise(function(_0x22ace7,_0x40766a){return client[_0x6677('0xb')](_0x20048f,_0x3d6ade)[_0x6677('0xc')](function(_0x3898a3){logger[_0x6677('0xd')](_0x6677('0xe'),_0xce23d6,_0x6677('0xf'));logger[_0x6677('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xce23d6,_0x6677('0xf'),JSON[_0x6677('0x11')](_0x3898a3));if(_0x3898a3[_0x6677('0x12')]){if(_0x3898a3[_0x6677('0x12')][_0x6677('0x13')]===0x1f4){logger[_0x6677('0x12')](_0x6677('0xe'),_0xce23d6,_0x3898a3[_0x6677('0x12')][_0x6677('0x14')]);return _0x40766a(_0x3898a3[_0x6677('0x12')][_0x6677('0x14')]);}logger[_0x6677('0x12')](_0x6677('0xe'),_0xce23d6,_0x3898a3[_0x6677('0x12')][_0x6677('0x14')]);return _0x22ace7(_0x3898a3['error'][_0x6677('0x14')]);}else{logger[_0x6677('0xd')](_0x6677('0xe'),_0xce23d6,_0x6677('0xf'));_0x22ace7(_0x3898a3[_0x6677('0x15')][_0x6677('0x14')]);}})[_0x6677('0x16')](function(_0x3c1a80){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xce23d6,_0x3c1a80);_0x40766a(_0x3c1a80);});});} \ No newline at end of file +var _0x48ee=['AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info'];(function(_0xea0cf2,_0x1502d9){var _0x3652df=function(_0x39db2a){while(--_0x39db2a){_0xea0cf2['push'](_0xea0cf2['shift']());}};_0x3652df(++_0x1502d9);}(_0x48ee,0x138));var _0xe48e=function(_0x1ba229,_0x46fef5){_0x1ba229=_0x1ba229-0x0;var _0x44692f=_0x48ee[_0x1ba229];return _0x44692f;};'use strict';var _=require('lodash');var util=require(_0xe48e('0x0'));var moment=require(_0xe48e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe48e('0x2'));var db=require(_0xe48e('0x3'))['db'];var utils=require(_0xe48e('0x4'));var logger=require('../../config/logger')(_0xe48e('0x5'));var config=require('../../config/environment');var jayson=require(_0xe48e('0x6'));var client=jayson[_0xe48e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a1ac2,_0x34f626,_0xdd9c26){return new BPromise(function(_0x54cde1,_0x5b7e13){return client[_0xe48e('0x8')](_0x3a1ac2,_0xdd9c26)[_0xe48e('0x9')](function(_0x4bde1f){logger[_0xe48e('0xa')](_0xe48e('0xb'),_0x34f626,'request\x20sent');logger['debug'](_0xe48e('0xc'),_0x34f626,_0xe48e('0xd'),JSON[_0xe48e('0xe')](_0x4bde1f));if(_0x4bde1f['error']){if(_0x4bde1f[_0xe48e('0xf')]['code']===0x1f4){logger[_0xe48e('0xf')](_0xe48e('0xb'),_0x34f626,_0x4bde1f['error'][_0xe48e('0x10')]);return _0x5b7e13(_0x4bde1f[_0xe48e('0xf')][_0xe48e('0x10')]);}logger[_0xe48e('0xf')](_0xe48e('0xb'),_0x34f626,_0x4bde1f[_0xe48e('0xf')][_0xe48e('0x10')]);return _0x54cde1(_0x4bde1f[_0xe48e('0xf')][_0xe48e('0x10')]);}else{logger[_0xe48e('0xa')](_0xe48e('0xb'),_0x34f626,_0xe48e('0xd'));_0x54cde1(_0x4bde1f[_0xe48e('0x11')]['message']);}})[_0xe48e('0x12')](function(_0x2ae9a3){logger['error'](_0xe48e('0xb'),_0x34f626,_0x2ae9a3);_0x5b7e13(_0x2ae9a3);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 483552e..8598295 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 _0x5086=['create','/:id','update','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','show','preview','run','query'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x5086,0x16d));var _0x6508=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x5086[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x6508('0x0'));var util=require('util');var path=require(_0x6508('0x1'));var timeout=require(_0x6508('0x2'));var express=require(_0x6508('0x3'));var router=express[_0x6508('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6508('0x5'));var interaction=require(_0x6508('0x6'));var config=require(_0x6508('0x7'));var controller=require(_0x6508('0x8'));router['get']('/',auth[_0x6508('0x9')](),controller['index']);router[_0x6508('0xa')]('/:id',auth[_0x6508('0x9')](),controller[_0x6508('0xb')]);router[_0x6508('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0x6508('0xc')]);router[_0x6508('0xa')]('/:id/run',auth['isAuthenticated'](),controller[_0x6508('0xd')]);router[_0x6508('0xa')]('/:id/query',auth[_0x6508('0x9')](),controller[_0x6508('0xe')]);router['post']('/',auth[_0x6508('0x9')](),controller[_0x6508('0xf')]);router['put'](_0x6508('0x10'),auth[_0x6508('0x9')](),controller[_0x6508('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6508('0x12')]);module['exports']=router; \ No newline at end of file +var _0x29c7=['index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','create','put','update','destroy','exports','multer','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x29c7,0x84));var _0x729c=function(_0x179f38,_0x4a5eca){_0x179f38=_0x179f38-0x0;var _0x385a77=_0x29c7[_0x179f38];return _0x385a77;};'use strict';var multer=require(_0x729c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x729c('0x1'));var auth=require(_0x729c('0x2'));var interaction=require(_0x729c('0x3'));var config=require(_0x729c('0x4'));var controller=require(_0x729c('0x5'));router[_0x729c('0x6')]('/',auth[_0x729c('0x7')](),controller[_0x729c('0x8')]);router[_0x729c('0x6')](_0x729c('0x9'),auth[_0x729c('0x7')](),controller['show']);router[_0x729c('0x6')](_0x729c('0xa'),auth['isAuthenticated'](),controller[_0x729c('0xb')]);router[_0x729c('0x6')](_0x729c('0xc'),auth[_0x729c('0x7')](),controller[_0x729c('0xd')]);router[_0x729c('0x6')](_0x729c('0xe'),auth[_0x729c('0x7')](),controller['query']);router['post']('/',auth[_0x729c('0x7')](),controller[_0x729c('0xf')]);router[_0x729c('0x10')](_0x729c('0x9'),auth[_0x729c('0x7')](),controller[_0x729c('0x11')]);router['delete']('/:id',auth[_0x729c('0x7')](),controller[_0x729c('0x12')]);module[_0x729c('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index dd784ab..e35c33f 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 _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2ff4a7,_0xe37347){_0x2ff4a7=_0x2ff4a7-0x0;var _0xc01c3f=_0x8ef6[_0x2ff4a7];return _0xc01c3f;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x4650bf,_0x44b2bd){var _0x29ec71=function(_0xb8caad){while(--_0xb8caad){_0x4650bf['push'](_0x4650bf['shift']());}};_0x29ec71(++_0x44b2bd);}(_0x5fc3,0xa8));var _0x35fc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5fc3[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 4aadc35..62d599d 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 _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','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)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x49ed67,_0x290989){var _0x1523d5=function(_0x34a179){while(--_0x34a179){_0x49ed67['push'](_0x49ed67['shift']());}};_0x1523d5(++_0x290989);}(_0x4819,0xcd));var _0x9481=function(_0x30505b,_0x3b6c06){_0x30505b=_0x30505b-0x0;var _0x4f7466=_0x4819[_0x30505b];return _0x4f7466;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));}; \ No newline at end of file +var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x58f1b0,_0x3a2be3){var _0x551656=function(_0x5152c1){while(--_0x5152c1){_0x58f1b0['push'](_0x58f1b0['shift']());}};_0x551656(++_0x3a2be3);}(_0x814b,0x1a2));var _0xb814=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x814b[_0x349148];return _0x2f2b0f;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index ba272ec..e45c9cd 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 _0x1d1d=['request-promise','rimraf','../../config/environment','define','analytics_default_reports','util','../../config/logger','moment','bluebird'];(function(_0x174c4d,_0x3771df){var _0x5a23c7=function(_0x5034c7){while(--_0x5034c7){_0x174c4d['push'](_0x174c4d['shift']());}};_0x5a23c7(++_0x3771df);}(_0x1d1d,0xcb));var _0xd1d1=function(_0x178015,_0x4bcd41){_0x178015=_0x178015-0x0;var _0x5ef3c5=_0x1d1d[_0x178015];return _0x5ef3c5;};'use strict';var _=require('lodash');var util=require(_0xd1d1('0x0'));var logger=require(_0xd1d1('0x1'))('api');var moment=require(_0xd1d1('0x2'));var BPromise=require(_0xd1d1('0x3'));var rp=require(_0xd1d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1d1('0x5'));var config=require(_0xd1d1('0x6'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x1d1294,_0x1f256f){return _0x1d1294[_0xd1d1('0x7')]('AnalyticDefaultReport',attributes,{'tableName':_0xd1d1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b8e=['../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x3e9e78,_0x1e92c9){var _0x4fc5ac=function(_0x44cbd1){while(--_0x44cbd1){_0x3e9e78['push'](_0x3e9e78['shift']());}};_0x4fc5ac(++_0x1e92c9);}(_0x2b8e,0x14f));var _0xe2b8=function(_0x1e73ab,_0x3a9040){_0x1e73ab=_0x1e73ab-0x0;var _0x40d8c0=_0x2b8e[_0x1e73ab];return _0x40d8c0;};'use strict';var _=require(_0xe2b8('0x0'));var util=require(_0xe2b8('0x1'));var logger=require(_0xe2b8('0x2'))('api');var moment=require(_0xe2b8('0x3'));var BPromise=require(_0xe2b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2b8('0x5'));var rimraf=require('rimraf');var config=require(_0xe2b8('0x6'));var attributes=require(_0xe2b8('0x7'));module['exports']=function(_0x156628,_0x5536dc){return _0x156628[_0xe2b8('0x8')](_0xe2b8('0x9'),attributes,{'tableName':_0xe2b8('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 7dad965..57eebb9 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 _0xa797=['info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2ff733,_0x5f2825){var _0x156deb=function(_0x1f684d){while(--_0x1f684d){_0x2ff733['push'](_0x2ff733['shift']());}};_0x156deb(++_0x5f2825);}(_0xa797,0x127));var _0x7a79=function(_0x3b36af,_0x3556e8){_0x3b36af=_0x3b36af-0x0;var _0x578b1c=_0xa797[_0x3b36af];return _0x578b1c;};'use strict';var _=require(_0x7a79('0x0'));var util=require(_0x7a79('0x1'));var moment=require(_0x7a79('0x2'));var BPromise=require(_0x7a79('0x3'));var rs=require(_0x7a79('0x4'));var fs=require('fs');var Redis=require(_0x7a79('0x5'));var db=require(_0x7a79('0x6'))['db'];var utils=require(_0x7a79('0x7'));var logger=require('../../config/logger')(_0x7a79('0x8'));var config=require(_0x7a79('0x9'));var jayson=require(_0x7a79('0xa'));var client=jayson['client'][_0x7a79('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48e17a,_0x4d7f0e,_0x5cf034){return new BPromise(function(_0x3429ba,_0x25875b){return client[_0x7a79('0xc')](_0x48e17a,_0x5cf034)['then'](function(_0xcc9a99){logger[_0x7a79('0xd')](_0x7a79('0xe'),_0x4d7f0e,_0x7a79('0xf'));logger[_0x7a79('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4d7f0e,'request\x20sent',JSON['stringify'](_0xcc9a99));if(_0xcc9a99[_0x7a79('0x11')]){if(_0xcc9a99[_0x7a79('0x11')][_0x7a79('0x12')]===0x1f4){logger[_0x7a79('0x11')](_0x7a79('0xe'),_0x4d7f0e,_0xcc9a99['error']['message']);return _0x25875b(_0xcc9a99[_0x7a79('0x11')]['message']);}logger[_0x7a79('0x11')](_0x7a79('0xe'),_0x4d7f0e,_0xcc9a99[_0x7a79('0x11')][_0x7a79('0x13')]);return _0x3429ba(_0xcc9a99[_0x7a79('0x11')][_0x7a79('0x13')]);}else{logger['info'](_0x7a79('0xe'),_0x4d7f0e,_0x7a79('0xf'));_0x3429ba(_0xcc9a99[_0x7a79('0x14')][_0x7a79('0x13')]);}})[_0x7a79('0x15')](function(_0xd22eb3){logger[_0x7a79('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4d7f0e,_0xd22eb3);_0x25875b(_0xd22eb3);});});} \ No newline at end of file +var _0x6c71=['jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2c4e42,_0x7104de){var _0x380da6=function(_0x56f273){while(--_0x56f273){_0x2c4e42['push'](_0x2c4e42['shift']());}};_0x380da6(++_0x7104de);}(_0x6c71,0x1ad));var _0x16c7=function(_0x456fc1,_0x191e3d){_0x456fc1=_0x456fc1-0x0;var _0x84fab3=_0x6c71[_0x456fc1];return _0x84fab3;};'use strict';var _=require(_0x16c7('0x0'));var util=require(_0x16c7('0x1'));var moment=require(_0x16c7('0x2'));var BPromise=require(_0x16c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x16c7('0x5'));var logger=require(_0x16c7('0x6'))('rpc');var config=require(_0x16c7('0x7'));var jayson=require(_0x16c7('0x8'));var client=jayson[_0x16c7('0x9')][_0x16c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x448d24,_0x359aea,_0x1f95e8){return new BPromise(function(_0x2eac9f,_0x116cda){return client['request'](_0x448d24,_0x1f95e8)[_0x16c7('0xb')](function(_0x21c7b2){logger[_0x16c7('0xc')](_0x16c7('0xd'),_0x359aea,_0x16c7('0xe'));logger[_0x16c7('0xf')](_0x16c7('0x10'),_0x359aea,_0x16c7('0xe'),JSON[_0x16c7('0x11')](_0x21c7b2));if(_0x21c7b2['error']){if(_0x21c7b2[_0x16c7('0x12')][_0x16c7('0x13')]===0x1f4){logger[_0x16c7('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x359aea,_0x21c7b2[_0x16c7('0x12')][_0x16c7('0x14')]);return _0x116cda(_0x21c7b2[_0x16c7('0x12')][_0x16c7('0x14')]);}logger[_0x16c7('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x359aea,_0x21c7b2['error']['message']);return _0x2eac9f(_0x21c7b2['error'][_0x16c7('0x14')]);}else{logger[_0x16c7('0xc')](_0x16c7('0xd'),_0x359aea,_0x16c7('0xe'));_0x2eac9f(_0x21c7b2[_0x16c7('0x15')]['message']);}})[_0x16c7('0x16')](function(_0x4c8c42){logger['error'](_0x16c7('0xd'),_0x359aea,_0x4c8c42);_0x116cda(_0x4c8c42);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 7572d30..7885f1d 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 _0xfb5b=['destroy','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','create','put'];(function(_0x1bfd2d,_0x18fca5){var _0x7b1809=function(_0x59561f){while(--_0x59561f){_0x1bfd2d['push'](_0x1bfd2d['shift']());}};_0x7b1809(++_0x18fca5);}(_0xfb5b,0x89));var _0xbfb5=function(_0x4c6c3f,_0x54c1ee){_0x4c6c3f=_0x4c6c3f-0x0;var _0x3f0d7c=_0xfb5b[_0x4c6c3f];return _0x3f0d7c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbfb5('0x0'));var timeout=require(_0xbfb5('0x1'));var express=require('express');var router=express[_0xbfb5('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbfb5('0x3'));var config=require(_0xbfb5('0x4'));var controller=require('./analyticDefaultReport.controller');router[_0xbfb5('0x5')]('/',auth[_0xbfb5('0x6')](),controller[_0xbfb5('0x7')]);router[_0xbfb5('0x5')](_0xbfb5('0x8'),auth[_0xbfb5('0x6')](),controller[_0xbfb5('0x9')]);router[_0xbfb5('0x5')](_0xbfb5('0xa'),auth[_0xbfb5('0x6')](),controller[_0xbfb5('0xb')]);router['get'](_0xbfb5('0xc'),auth[_0xbfb5('0x6')](),controller['run']);router[_0xbfb5('0x5')](_0xbfb5('0xd'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0xbfb5('0x6')](),controller[_0xbfb5('0xe')]);router[_0xbfb5('0xf')](_0xbfb5('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbfb5('0x8'),auth[_0xbfb5('0x6')](),controller[_0xbfb5('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2c40=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','put','update','delete','destroy','exports'];(function(_0x59c683,_0x209444){var _0x47251b=function(_0x4db046){while(--_0x4db046){_0x59c683['push'](_0x59c683['shift']());}};_0x47251b(++_0x209444);}(_0x2c40,0xfd));var _0x02c4=function(_0x575d6b,_0x3f86c1){_0x575d6b=_0x575d6b-0x0;var _0x2c9819=_0x2c40[_0x575d6b];return _0x2c9819;};'use strict';var multer=require('multer');var util=require(_0x02c4('0x0'));var path=require(_0x02c4('0x1'));var timeout=require(_0x02c4('0x2'));var express=require(_0x02c4('0x3'));var router=express[_0x02c4('0x4')]();var fs_extra=require(_0x02c4('0x5'));var auth=require(_0x02c4('0x6'));var interaction=require(_0x02c4('0x7'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x02c4('0x8')]('/',auth[_0x02c4('0x9')](),controller['index']);router[_0x02c4('0x8')](_0x02c4('0xa'),auth[_0x02c4('0x9')](),controller[_0x02c4('0xb')]);router['get'](_0x02c4('0xc'),auth['isAuthenticated'](),controller[_0x02c4('0xd')]);router['get'](_0x02c4('0xe'),auth[_0x02c4('0x9')](),controller[_0x02c4('0xf')]);router[_0x02c4('0x8')](_0x02c4('0x10'),auth['isAuthenticated'](),controller[_0x02c4('0x11')]);router['post']('/',auth[_0x02c4('0x9')](),controller['create']);router[_0x02c4('0x12')](_0x02c4('0xa'),auth[_0x02c4('0x9')](),controller[_0x02c4('0x13')]);router[_0x02c4('0x14')](_0x02c4('0xa'),auth['isAuthenticated'](),controller[_0x02c4('0x15')]);module[_0x02c4('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 948df9b..d93dbc5 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 _0x80c6=['STRING','ENUM','xlsx','DATE','Loading','scheduled','manual','sequelize','moment','exports'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x80c6,0x151));var _0x680c=function(_0x32453a,_0x3ed27d){_0x32453a=_0x32453a-0x0;var _0x2182bb=_0x80c6[_0x32453a];return _0x2182bb;};'use strict';var Sequelize=require(_0x680c('0x0'));var moment=require(_0x680c('0x1'));module[_0x680c('0x2')]={'name':{'type':Sequelize[_0x680c('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x680c('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x680c('0x4')]('csv','pdf',_0x680c('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x680c('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x680c('0x6')]},'endDate':{'type':Sequelize[_0x680c('0x6')]},'status':{'type':Sequelize[_0x680c('0x3')],'defaultValue':_0x680c('0x7')},'type':{'type':Sequelize['ENUM']('manual',_0x680c('0x8')),'allowNull':![],'defaultValue':_0x680c('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x680c('0x3')]}}; \ No newline at end of file +var _0x409a=['xlsx','DATE','Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','csv','pdf'];(function(_0xd46227,_0x18477f){var _0x2a980d=function(_0x34e452){while(--_0x34e452){_0xd46227['push'](_0xd46227['shift']());}};_0x2a980d(++_0x18477f);}(_0x409a,0x181));var _0xa409=function(_0x931503,_0x296d97){_0x931503=_0x931503-0x0;var _0x2c838f=_0x409a[_0x931503];return _0x2c838f;};'use strict';var Sequelize=require(_0xa409('0x0'));var moment=require(_0xa409('0x1'));module['exports']={'name':{'type':Sequelize[_0xa409('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xa409('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xa409('0x3'),_0xa409('0x4'),_0xa409('0x5')),'allowNull':![],'defaultValue':_0xa409('0x3')},'savename':{'type':Sequelize[_0xa409('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa409('0x6')]},'endDate':{'type':Sequelize[_0xa409('0x6')]},'status':{'type':Sequelize[_0xa409('0x2')],'defaultValue':_0xa409('0x7')},'type':{'type':Sequelize[_0xa409('0x8')](_0xa409('0x9'),_0xa409('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xa409('0xb')](0xb)[_0xa409('0xc')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index d36722a..e44b41c 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 _0xaee4=['save','get','ExtractedReports','UserProfileResource','destroy','then','name','index','map','AnalyticExtractedReport','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject'];(function(_0x308ca1,_0xf8eb57){var _0x1c589e=function(_0x1489b7){while(--_0x1489b7){_0x308ca1['push'](_0x308ca1['shift']());}};_0x1c589e(++_0xf8eb57);}(_0xaee4,0xf9));var _0x4aee=function(_0x4f869b,_0x457e62){_0x4f869b=_0x4f869b-0x0;var _0x456ff7=_0xaee4[_0x4f869b];return _0x456ff7;};'use strict';var emlformat=require(_0x4aee('0x0'));var rimraf=require(_0x4aee('0x1'));var zipdir=require(_0x4aee('0x2'));var jsonpatch=require(_0x4aee('0x3'));var rp=require(_0x4aee('0x4'));var moment=require(_0x4aee('0x5'));var BPromise=require(_0x4aee('0x6'));var Mustache=require('mustache');var util=require(_0x4aee('0x7'));var path=require(_0x4aee('0x8'));var sox=require(_0x4aee('0x9'));var csv=require(_0x4aee('0xa'));var ejs=require(_0x4aee('0xb'));var fs=require('fs');var fs_extra=require(_0x4aee('0xc'));var _=require('lodash');var squel=require(_0x4aee('0xd'));var crypto=require(_0x4aee('0xe'));var jsforce=require(_0x4aee('0xf'));var deskjs=require(_0x4aee('0x10'));var toCsv=require(_0x4aee('0xa'));var querystring=require('querystring');var Papa=require(_0x4aee('0x11'));var Redis=require(_0x4aee('0x12'));var authService=require(_0x4aee('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4aee('0x14'));var logger=require(_0x4aee('0x15'))(_0x4aee('0x16'));var utils=require(_0x4aee('0x17'));var config=require(_0x4aee('0x18'));var licenseUtil=require(_0x4aee('0x19'));var db=require(_0x4aee('0x1a'))['db'];function respondWithStatusCode(_0x3b1c17,_0x291c95){_0x291c95=_0x291c95||0xcc;return function(_0x3585bd){if(_0x3585bd){return _0x3b1c17[_0x4aee('0x1b')](_0x291c95);}return _0x3b1c17[_0x4aee('0x1c')](_0x291c95)['end']();};}function respondWithResult(_0x3b9193,_0x20f621){_0x20f621=_0x20f621||0xc8;return function(_0x54cddf){if(_0x54cddf){return _0x3b9193[_0x4aee('0x1c')](_0x20f621)[_0x4aee('0x1d')](_0x54cddf);}};}function respondWithFilteredResult(_0x45b3cf,_0xfc48ed){return function(_0x5a45df){if(_0x5a45df){var _0x47c357=typeof _0xfc48ed[_0x4aee('0x1e')]==='undefined'&&typeof _0xfc48ed[_0x4aee('0x1f')]==='undefined';var _0x3d4028=_0x5a45df[_0x4aee('0x20')];var _0x44daf5=_0x47c357?0x0:_0xfc48ed[_0x4aee('0x1e')];var _0x1c35df=_0x47c357?_0x5a45df[_0x4aee('0x20')]:_0xfc48ed[_0x4aee('0x1e')]+_0xfc48ed[_0x4aee('0x1f')];var _0x3474d0;if(_0x1c35df>=_0x3d4028){_0x1c35df=_0x3d4028;_0x3474d0=0xc8;}else{_0x3474d0=0xce;}_0x45b3cf[_0x4aee('0x1c')](_0x3474d0);return _0x45b3cf['set'](_0x4aee('0x21'),_0x44daf5+'-'+_0x1c35df+'/'+_0x3d4028)[_0x4aee('0x1d')](_0x5a45df);}return null;};}function patchUpdates(_0xdeb0ba){return function(_0x54bb91){try{jsonpatch[_0x4aee('0x22')](_0x54bb91,_0xdeb0ba,!![]);}catch(_0x92666d){return BPromise[_0x4aee('0x23')](_0x92666d);}return _0x54bb91[_0x4aee('0x24')]();};}function saveUpdates(_0x200ea0,_0x39a659){return function(_0x1697d3){if(_0x1697d3){return _0x1697d3['update'](_0x200ea0)['then'](function(_0x247a72){return _0x247a72;});}return null;};}function removeEntity(_0x4f14af,_0xd2efc0){return function(_0x1fa8f9){if(_0x1fa8f9){return _0x1fa8f9['destroy']()['then'](function(){var _0x4f3c9b=_0x1fa8f9[_0x4aee('0x25')]({'plain':!![]});var _0xc7c083=_0x4aee('0x26');return db[_0x4aee('0x27')][_0x4aee('0x28')]({'where':{'type':_0xc7c083,'resourceId':_0x4f3c9b['id']}})['then'](function(){return _0x1fa8f9;});})[_0x4aee('0x29')](function(){_0x4f14af['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dca55,_0x4fd286){return function(_0x19182f){if(!_0x19182f){_0x2dca55[_0x4aee('0x1b')](0x194);}return _0x19182f;};}function handleError(_0x47deab,_0xab9eb4){_0xab9eb4=_0xab9eb4||0x1f4;return function(_0x322bfa){logger['error'](_0x322bfa['stack']);if(_0x322bfa[_0x4aee('0x2a')]){delete _0x322bfa['name'];}_0x47deab[_0x4aee('0x1c')](_0xab9eb4)['send'](_0x322bfa);};}exports[_0x4aee('0x2b')]=function(_0x204b7e,_0x219a46){var _0x61efd1={},_0x263d98={},_0x562c0f={'count':0x0,'rows':[]};var _0x756ea8=_[_0x4aee('0x2c')](db[_0x4aee('0x2d')][_0x4aee('0x2e')],function(_0x348640){return{'name':_0x348640['fieldName'],'type':_0x348640['type'][_0x4aee('0x2f')]};});_0x263d98[_0x4aee('0x30')]=_[_0x4aee('0x2c')](_0x756ea8,_0x4aee('0x2a'));_0x263d98[_0x4aee('0x31')]=_[_0x4aee('0x32')](_0x204b7e[_0x4aee('0x31')]);_0x263d98['filters']=_['intersection'](_0x263d98[_0x4aee('0x30')],_0x263d98[_0x4aee('0x31')]);_0x61efd1[_0x4aee('0x33')]=_[_0x4aee('0x34')](_0x263d98[_0x4aee('0x30')],qs[_0x4aee('0x35')](_0x204b7e[_0x4aee('0x31')]['fields']));_0x61efd1[_0x4aee('0x33')]=_0x61efd1['attributes'][_0x4aee('0x36')]?_0x61efd1['attributes']:_0x263d98[_0x4aee('0x30')];if(!_0x204b7e['query'][_0x4aee('0x37')]('nolimit')){_0x61efd1[_0x4aee('0x1f')]=qs[_0x4aee('0x1f')](_0x204b7e['query'][_0x4aee('0x1f')]);_0x61efd1[_0x4aee('0x1e')]=qs[_0x4aee('0x1e')](_0x204b7e[_0x4aee('0x31')][_0x4aee('0x1e')]);}_0x61efd1[_0x4aee('0x38')]=qs['sort'](_0x204b7e['query']['sort']);_0x61efd1[_0x4aee('0x39')]=qs[_0x4aee('0x3a')](_[_0x4aee('0x3b')](_0x204b7e['query'],_0x263d98[_0x4aee('0x3a')]),_0x756ea8);if(_0x204b7e[_0x4aee('0x31')][_0x4aee('0x3c')]){_0x61efd1['where']=_[_0x4aee('0x3d')](_0x61efd1[_0x4aee('0x39')],{'$or':_['map'](_0x756ea8,function(_0x45e6ce){if(_0x45e6ce[_0x4aee('0x3e')]!==_0x4aee('0x3f')){var _0xdaf027={};_0xdaf027[_0x45e6ce[_0x4aee('0x2a')]]={'$like':'%'+_0x204b7e[_0x4aee('0x31')][_0x4aee('0x3c')]+'%'};return _0xdaf027;}})});}_0x61efd1=_['merge']({},_0x61efd1,_0x204b7e[_0x4aee('0x40')]);var _0x3823ba={'where':_0x61efd1[_0x4aee('0x39')]};return db['AnalyticExtractedReport'][_0x4aee('0x20')](_0x3823ba)['then'](function(_0x342888){_0x562c0f[_0x4aee('0x20')]=_0x342888;if(_0x204b7e['query']['includeAll']){_0x61efd1[_0x4aee('0x41')]=[{'all':!![]}];}return db[_0x4aee('0x2d')][_0x4aee('0x42')](_0x61efd1);})[_0x4aee('0x29')](function(_0x66ac7f){_0x562c0f[_0x4aee('0x43')]=_0x66ac7f;return _0x562c0f;})[_0x4aee('0x29')](respondWithFilteredResult(_0x219a46,_0x61efd1))[_0x4aee('0x44')](handleError(_0x219a46,null));};exports[_0x4aee('0x45')]=function(_0x30de25,_0x125507){var _0x352f3a={'raw':!![],'where':{'id':_0x30de25[_0x4aee('0x46')]['id']}},_0x5013c4={};_0x5013c4[_0x4aee('0x30')]=_[_0x4aee('0x32')](db['AnalyticExtractedReport'][_0x4aee('0x2e')]);_0x5013c4[_0x4aee('0x31')]=_[_0x4aee('0x32')](_0x30de25[_0x4aee('0x31')]);_0x5013c4[_0x4aee('0x3a')]=_['intersection'](_0x5013c4[_0x4aee('0x30')],_0x5013c4[_0x4aee('0x31')]);_0x352f3a[_0x4aee('0x33')]=_[_0x4aee('0x34')](_0x5013c4[_0x4aee('0x30')],qs[_0x4aee('0x35')](_0x30de25[_0x4aee('0x31')][_0x4aee('0x35')]));_0x352f3a[_0x4aee('0x33')]=_0x352f3a[_0x4aee('0x33')]['length']?_0x352f3a[_0x4aee('0x33')]:_0x5013c4[_0x4aee('0x30')];if(_0x30de25[_0x4aee('0x31')][_0x4aee('0x47')]){_0x352f3a[_0x4aee('0x41')]=[{'all':!![]}];}_0x352f3a=_[_0x4aee('0x3d')]({},_0x352f3a,_0x30de25[_0x4aee('0x40')]);return db[_0x4aee('0x2d')][_0x4aee('0x48')](_0x352f3a)[_0x4aee('0x29')](handleEntityNotFound(_0x125507,null))[_0x4aee('0x29')](respondWithResult(_0x125507,null))[_0x4aee('0x44')](handleError(_0x125507,null));};exports[_0x4aee('0x49')]=function(_0x4a0e1a,_0x441c33){return db[_0x4aee('0x2d')][_0x4aee('0x49')](_0x4a0e1a['body'],{})[_0x4aee('0x29')](function(_0x2df7bd){var _0x514e33=_0x4a0e1a[_0x4aee('0x4a')][_0x4aee('0x25')]({'plain':!![]});if(!_0x514e33)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x514e33['role']===_0x4aee('0x4a')){var _0x4cd316=_0x2df7bd[_0x4aee('0x25')]({'plain':!![]});var _0x25069c='ExtractedReports';return db[_0x4aee('0x4b')][_0x4aee('0x48')]({'where':{'name':_0x25069c,'userProfileId':_0x514e33[_0x4aee('0x4c')]},'raw':!![]})[_0x4aee('0x29')](function(_0x231607){if(_0x231607&&_0x231607[_0x4aee('0x4d')]===0x0){return db[_0x4aee('0x27')][_0x4aee('0x49')]({'name':_0x4cd316['name'],'resourceId':_0x4cd316['id'],'type':_0x231607['name'],'sectionId':_0x231607['id']},{})[_0x4aee('0x29')](function(){return _0x2df7bd;});}else{return _0x2df7bd;}})[_0x4aee('0x44')](function(_0x423fac){logger[_0x4aee('0x4e')](_0x4aee('0x4f'),_0x423fac);throw _0x423fac;});}return _0x2df7bd;})[_0x4aee('0x29')](respondWithResult(_0x441c33,0xc9))[_0x4aee('0x44')](handleError(_0x441c33,null));};exports['update']=function(_0xf67ba6,_0x1d8bf7){if(_0xf67ba6['body']['id']){delete _0xf67ba6[_0x4aee('0x50')]['id'];}return db['AnalyticExtractedReport'][_0x4aee('0x48')]({'where':{'id':_0xf67ba6['params']['id']}})[_0x4aee('0x29')](handleEntityNotFound(_0x1d8bf7,null))['then'](saveUpdates(_0xf67ba6[_0x4aee('0x50')],null))[_0x4aee('0x29')](respondWithResult(_0x1d8bf7,null))[_0x4aee('0x44')](handleError(_0x1d8bf7,null));};exports[_0x4aee('0x28')]=function(_0x5178db,_0x2aece8){return db[_0x4aee('0x2d')][_0x4aee('0x48')]({'where':{'id':_0x5178db[_0x4aee('0x46')]['id']}})[_0x4aee('0x29')](handleEntityNotFound(_0x2aece8,null))['then'](removeEntity(_0x2aece8,null))[_0x4aee('0x44')](handleError(_0x2aece8,null));};exports[_0x4aee('0x51')]=function(_0x4ab417,_0x1537bf,_0x679440){return db[_0x4aee('0x2d')][_0x4aee('0x48')]({'where':{'id':_0x4ab417[_0x4aee('0x46')]['id']},'attributes':[_0x4aee('0x2a'),_0x4aee('0x52'),_0x4aee('0x53'),_0x4aee('0x54')],'raw':!![]})[_0x4aee('0x29')](handleEntityNotFound(_0x1537bf,null))[_0x4aee('0x29')](function(_0x7954b9){if(_0x7954b9){if(!fs[_0x4aee('0x55')](path[_0x4aee('0x56')](config[_0x4aee('0x57')],_0x4aee('0x58'),_0x7954b9[_0x4aee('0x53')]))){throw new db['Sequelize'][(_0x4aee('0x59'))](_0x4aee('0x5a'));}if(_0x4ab417[_0x4aee('0x31')][_0x4aee('0x5b')]){return _0x1537bf[_0x4aee('0x1b')](0xc8);}return _0x1537bf[_0x4aee('0x51')](path[_0x4aee('0x56')](config[_0x4aee('0x57')],_0x4aee('0x58'),_0x7954b9[_0x4aee('0x53')]),util[_0x4aee('0x5c')](_0x4aee('0x5d'),_0x7954b9[_0x4aee('0x52')]||_0x7954b9[_0x4aee('0x2a')],_0x7954b9[_0x4aee('0x54')][_0x4aee('0x5e')]()));}})[_0x4aee('0x44')](handleError(_0x1537bf,null));}; \ No newline at end of file +var _0x388a=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','root','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x706e7e,_0x31bb07){var _0x1dfb2e=function(_0x47cbb8){while(--_0x47cbb8){_0x706e7e['push'](_0x706e7e['shift']());}};_0x1dfb2e(++_0x31bb07);}(_0x388a,0x17e));var _0xa388=function(_0x80c112,_0xae37fc){_0x80c112=_0x80c112-0x0;var _0x23232c=_0x388a[_0x80c112];return _0x23232c;};'use strict';var emlformat=require(_0xa388('0x0'));var rimraf=require(_0xa388('0x1'));var zipdir=require(_0xa388('0x2'));var jsonpatch=require(_0xa388('0x3'));var rp=require(_0xa388('0x4'));var moment=require(_0xa388('0x5'));var BPromise=require(_0xa388('0x6'));var Mustache=require(_0xa388('0x7'));var util=require('util');var path=require(_0xa388('0x8'));var sox=require(_0xa388('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa388('0xa'));var squel=require(_0xa388('0xb'));var crypto=require(_0xa388('0xc'));var jsforce=require(_0xa388('0xd'));var deskjs=require(_0xa388('0xe'));var toCsv=require(_0xa388('0xf'));var querystring=require(_0xa388('0x10'));var Papa=require('papaparse');var Redis=require(_0xa388('0x11'));var authService=require(_0xa388('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa388('0x13'));var hardwareService=require(_0xa388('0x14'));var logger=require(_0xa388('0x15'))('api');var utils=require(_0xa388('0x16'));var config=require(_0xa388('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa388('0x18'))['db'];function respondWithStatusCode(_0x17d47e,_0x2087da){_0x2087da=_0x2087da||0xcc;return function(_0x5f4637){if(_0x5f4637){return _0x17d47e['sendStatus'](_0x2087da);}return _0x17d47e['status'](_0x2087da)[_0xa388('0x19')]();};}function respondWithResult(_0x4c816b,_0x289744){_0x289744=_0x289744||0xc8;return function(_0x388e29){if(_0x388e29){return _0x4c816b[_0xa388('0x1a')](_0x289744)[_0xa388('0x1b')](_0x388e29);}};}function respondWithFilteredResult(_0x1d01ef,_0x3b8699){return function(_0x2ae86f){if(_0x2ae86f){var _0x581364=typeof _0x3b8699['offset']===_0xa388('0x1c')&&typeof _0x3b8699[_0xa388('0x1d')]===_0xa388('0x1c');var _0x2378f0=_0x2ae86f[_0xa388('0x1e')];var _0x215e27=_0x581364?0x0:_0x3b8699[_0xa388('0x1f')];var _0x537a6d=_0x581364?_0x2ae86f[_0xa388('0x1e')]:_0x3b8699[_0xa388('0x1f')]+_0x3b8699[_0xa388('0x1d')];var _0x9be630;if(_0x537a6d>=_0x2378f0){_0x537a6d=_0x2378f0;_0x9be630=0xc8;}else{_0x9be630=0xce;}_0x1d01ef[_0xa388('0x1a')](_0x9be630);return _0x1d01ef['set'](_0xa388('0x20'),_0x215e27+'-'+_0x537a6d+'/'+_0x2378f0)[_0xa388('0x1b')](_0x2ae86f);}return null;};}function patchUpdates(_0x3d4656){return function(_0x3392ec){try{jsonpatch[_0xa388('0x21')](_0x3392ec,_0x3d4656,!![]);}catch(_0x138dc2){return BPromise[_0xa388('0x22')](_0x138dc2);}return _0x3392ec[_0xa388('0x23')]();};}function saveUpdates(_0x2b479f,_0x2c8efb){return function(_0x19552c){if(_0x19552c){return _0x19552c[_0xa388('0x24')](_0x2b479f)[_0xa388('0x25')](function(_0x15ed3e){return _0x15ed3e;});}return null;};}function removeEntity(_0x3ecff2,_0x2ffc35){return function(_0x1e56d4){if(_0x1e56d4){return _0x1e56d4['destroy']()[_0xa388('0x25')](function(){var _0x37d0e6=_0x1e56d4['get']({'plain':!![]});var _0x243ce9=_0xa388('0x26');return db[_0xa388('0x27')][_0xa388('0x28')]({'where':{'type':_0x243ce9,'resourceId':_0x37d0e6['id']}})[_0xa388('0x25')](function(){return _0x1e56d4;});})['then'](function(){_0x3ecff2[_0xa388('0x1a')](0xcc)[_0xa388('0x19')]();});}};}function handleEntityNotFound(_0x220246,_0x1e44da){return function(_0xe9e5e2){if(!_0xe9e5e2){_0x220246['sendStatus'](0x194);}return _0xe9e5e2;};}function handleError(_0xa719d6,_0x5eeccd){_0x5eeccd=_0x5eeccd||0x1f4;return function(_0xe8b4b2){logger[_0xa388('0x29')](_0xe8b4b2[_0xa388('0x2a')]);if(_0xe8b4b2[_0xa388('0x2b')]){delete _0xe8b4b2['name'];}_0xa719d6['status'](_0x5eeccd)[_0xa388('0x2c')](_0xe8b4b2);};}exports[_0xa388('0x2d')]=function(_0x17ff06,_0x129879){var _0x431a59={},_0x168508={},_0x5dc0c6={'count':0x0,'rows':[]};var _0x383b11=_[_0xa388('0x2e')](db[_0xa388('0x2f')][_0xa388('0x30')],function(_0x2f4a9e){return{'name':_0x2f4a9e[_0xa388('0x31')],'type':_0x2f4a9e[_0xa388('0x32')]['key']};});_0x168508[_0xa388('0x33')]=_['map'](_0x383b11,'name');_0x168508[_0xa388('0x34')]=_[_0xa388('0x35')](_0x17ff06[_0xa388('0x34')]);_0x168508[_0xa388('0x36')]=_['intersection'](_0x168508[_0xa388('0x33')],_0x168508['query']);_0x431a59[_0xa388('0x37')]=_[_0xa388('0x38')](_0x168508[_0xa388('0x33')],qs[_0xa388('0x39')](_0x17ff06[_0xa388('0x34')][_0xa388('0x39')]));_0x431a59[_0xa388('0x37')]=_0x431a59[_0xa388('0x37')]['length']?_0x431a59['attributes']:_0x168508[_0xa388('0x33')];if(!_0x17ff06[_0xa388('0x34')][_0xa388('0x3a')](_0xa388('0x3b'))){_0x431a59[_0xa388('0x1d')]=qs[_0xa388('0x1d')](_0x17ff06[_0xa388('0x34')][_0xa388('0x1d')]);_0x431a59[_0xa388('0x1f')]=qs[_0xa388('0x1f')](_0x17ff06[_0xa388('0x34')][_0xa388('0x1f')]);}_0x431a59['order']=qs[_0xa388('0x3c')](_0x17ff06[_0xa388('0x34')][_0xa388('0x3c')]);_0x431a59['where']=qs['filters'](_['pick'](_0x17ff06[_0xa388('0x34')],_0x168508[_0xa388('0x36')]),_0x383b11);if(_0x17ff06[_0xa388('0x34')][_0xa388('0x3d')]){_0x431a59['where']=_[_0xa388('0x3e')](_0x431a59[_0xa388('0x3f')],{'$or':_['map'](_0x383b11,function(_0x19b46d){if(_0x19b46d[_0xa388('0x32')]!==_0xa388('0x40')){var _0x529b7d={};_0x529b7d[_0x19b46d[_0xa388('0x2b')]]={'$like':'%'+_0x17ff06[_0xa388('0x34')][_0xa388('0x3d')]+'%'};return _0x529b7d;}})});}_0x431a59=_[_0xa388('0x3e')]({},_0x431a59,_0x17ff06[_0xa388('0x41')]);var _0x446095={'where':_0x431a59[_0xa388('0x3f')]};return db[_0xa388('0x2f')]['count'](_0x446095)[_0xa388('0x25')](function(_0x1f7b25){_0x5dc0c6['count']=_0x1f7b25;if(_0x17ff06['query'][_0xa388('0x42')]){_0x431a59[_0xa388('0x43')]=[{'all':!![]}];}return db[_0xa388('0x2f')][_0xa388('0x44')](_0x431a59);})['then'](function(_0x34e7df){_0x5dc0c6[_0xa388('0x45')]=_0x34e7df;return _0x5dc0c6;})[_0xa388('0x25')](respondWithFilteredResult(_0x129879,_0x431a59))['catch'](handleError(_0x129879,null));};exports[_0xa388('0x46')]=function(_0x58da0d,_0x2458db){var _0x31484b={'raw':!![],'where':{'id':_0x58da0d[_0xa388('0x47')]['id']}},_0x420442={};_0x420442[_0xa388('0x33')]=_['keys'](db[_0xa388('0x2f')][_0xa388('0x30')]);_0x420442['query']=_[_0xa388('0x35')](_0x58da0d[_0xa388('0x34')]);_0x420442[_0xa388('0x36')]=_[_0xa388('0x38')](_0x420442[_0xa388('0x33')],_0x420442[_0xa388('0x34')]);_0x31484b['attributes']=_['intersection'](_0x420442[_0xa388('0x33')],qs[_0xa388('0x39')](_0x58da0d[_0xa388('0x34')][_0xa388('0x39')]));_0x31484b[_0xa388('0x37')]=_0x31484b[_0xa388('0x37')][_0xa388('0x48')]?_0x31484b[_0xa388('0x37')]:_0x420442[_0xa388('0x33')];if(_0x58da0d[_0xa388('0x34')][_0xa388('0x42')]){_0x31484b['include']=[{'all':!![]}];}_0x31484b=_[_0xa388('0x3e')]({},_0x31484b,_0x58da0d['options']);return db[_0xa388('0x2f')]['find'](_0x31484b)[_0xa388('0x25')](handleEntityNotFound(_0x2458db,null))[_0xa388('0x25')](respondWithResult(_0x2458db,null))[_0xa388('0x49')](handleError(_0x2458db,null));};exports[_0xa388('0x4a')]=function(_0x20e99c,_0x4e7896){return db[_0xa388('0x2f')][_0xa388('0x4a')](_0x20e99c[_0xa388('0x4b')],{})[_0xa388('0x25')](function(_0x51ab75){var _0x5dcaa8=_0x20e99c[_0xa388('0x4c')]['get']({'plain':!![]});if(!_0x5dcaa8)throw new Error(_0xa388('0x4d'));if(_0x5dcaa8[_0xa388('0x4e')]===_0xa388('0x4c')){var _0x3b8abc=_0x51ab75[_0xa388('0x4f')]({'plain':!![]});var _0x1ce8c3=_0xa388('0x26');return db[_0xa388('0x50')][_0xa388('0x51')]({'where':{'name':_0x1ce8c3,'userProfileId':_0x5dcaa8[_0xa388('0x52')]},'raw':!![]})[_0xa388('0x25')](function(_0x1a28fd){if(_0x1a28fd&&_0x1a28fd[_0xa388('0x53')]===0x0){return db[_0xa388('0x27')][_0xa388('0x4a')]({'name':_0x3b8abc[_0xa388('0x2b')],'resourceId':_0x3b8abc['id'],'type':_0x1a28fd['name'],'sectionId':_0x1a28fd['id']},{})[_0xa388('0x25')](function(){return _0x51ab75;});}else{return _0x51ab75;}})['catch'](function(_0x2b0709){logger[_0xa388('0x29')](_0xa388('0x54'),_0x2b0709);throw _0x2b0709;});}return _0x51ab75;})[_0xa388('0x25')](respondWithResult(_0x4e7896,0xc9))[_0xa388('0x49')](handleError(_0x4e7896,null));};exports[_0xa388('0x24')]=function(_0x5491ca,_0xde0faf){if(_0x5491ca[_0xa388('0x4b')]['id']){delete _0x5491ca[_0xa388('0x4b')]['id'];}return db[_0xa388('0x2f')][_0xa388('0x51')]({'where':{'id':_0x5491ca['params']['id']}})[_0xa388('0x25')](handleEntityNotFound(_0xde0faf,null))['then'](saveUpdates(_0x5491ca[_0xa388('0x4b')],null))['then'](respondWithResult(_0xde0faf,null))[_0xa388('0x49')](handleError(_0xde0faf,null));};exports[_0xa388('0x28')]=function(_0x4eb570,_0x3cfcb7){return db[_0xa388('0x2f')][_0xa388('0x51')]({'where':{'id':_0x4eb570[_0xa388('0x47')]['id']}})[_0xa388('0x25')](handleEntityNotFound(_0x3cfcb7,null))['then'](removeEntity(_0x3cfcb7,null))[_0xa388('0x49')](handleError(_0x3cfcb7,null));};exports[_0xa388('0x55')]=function(_0x4f81e9,_0x1e7068,_0x35c437){return db[_0xa388('0x2f')]['find']({'where':{'id':_0x4f81e9[_0xa388('0x47')]['id']},'attributes':['name',_0xa388('0x56'),'savename',_0xa388('0x57')],'raw':!![]})[_0xa388('0x25')](handleEntityNotFound(_0x1e7068,null))[_0xa388('0x25')](function(_0x399790){if(_0x399790){if(!fs[_0xa388('0x58')](path['join'](config[_0xa388('0x59')],'server/files/reports',_0x399790[_0xa388('0x5a')]))){throw new db[(_0xa388('0x5b'))][(_0xa388('0x5c'))](_0xa388('0x5d'));}if(_0x4f81e9[_0xa388('0x34')][_0xa388('0x5e')]){return _0x1e7068['sendStatus'](0xc8);}return _0x1e7068[_0xa388('0x55')](path['join'](config[_0xa388('0x59')],_0xa388('0x5f'),_0x399790[_0xa388('0x5a')]),util[_0xa388('0x60')](_0xa388('0x61'),_0x399790[_0xa388('0x56')]||_0x399790[_0xa388('0x2b')],_0x399790[_0xa388('0x57')]['toLowerCase']()));}})[_0xa388('0x49')](handleError(_0x1e7068,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 2fe92b3..ff01000 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 _0xcd5a=['path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x18fc2d,_0x3d356a){var _0x409fc8=function(_0x432710){while(--_0x432710){_0x18fc2d['push'](_0x18fc2d['shift']());}};_0x409fc8(++_0x3d356a);}(_0xcd5a,0xa1));var _0xacd5=function(_0x16834b,_0x4c2cda){_0x16834b=_0x16834b-0x0;var _0x4c7aee=_0xcd5a[_0x16834b];return _0x4c7aee;};'use strict';var _=require(_0xacd5('0x0'));var util=require(_0xacd5('0x1'));var logger=require(_0xacd5('0x2'))(_0xacd5('0x3'));var moment=require(_0xacd5('0x4'));var BPromise=require(_0xacd5('0x5'));var rp=require(_0xacd5('0x6'));var fs=require('fs');var path=require(_0xacd5('0x7'));var rimraf=require(_0xacd5('0x8'));var config=require(_0xacd5('0x9'));var attributes=require('./analyticExtractedReport.attributes');module[_0xacd5('0xa')]=function(_0x106087,_0x313668){return _0x106087[_0xacd5('0xb')](_0xacd5('0xc'),attributes,{'tableName':_0xacd5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacde=['../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x34eccb,_0x3a9083){var _0x15f1f6=function(_0x454bf0){while(--_0x454bf0){_0x34eccb['push'](_0x34eccb['shift']());}};_0x15f1f6(++_0x3a9083);}(_0xacde,0xc5));var _0xeacd=function(_0x4be687,_0xe630cc){_0x4be687=_0x4be687-0x0;var _0x42156f=_0xacde[_0x4be687];return _0x42156f;};'use strict';var _=require(_0xeacd('0x0'));var util=require(_0xeacd('0x1'));var logger=require(_0xeacd('0x2'))(_0xeacd('0x3'));var moment=require(_0xeacd('0x4'));var BPromise=require(_0xeacd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeacd('0x6'));var rimraf=require('rimraf');var config=require(_0xeacd('0x7'));var attributes=require(_0xeacd('0x8'));module['exports']=function(_0x42cc59,_0x1727ba){return _0x42cc59[_0xeacd('0x9')](_0xeacd('0xa'),attributes,{'tableName':_0xeacd('0xb'),'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 5383348..04a97c1 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 _0x6f75=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x49f67f,_0x4113a4){var _0x4779a1=function(_0x5064b0){while(--_0x5064b0){_0x49f67f['push'](_0x49f67f['shift']());}};_0x4779a1(++_0x4113a4);}(_0x6f75,0x71));var _0x56f7=function(_0x3a4998,_0x5b8203){_0x3a4998=_0x3a4998-0x0;var _0x18e7df=_0x6f75[_0x3a4998];return _0x18e7df;};'use strict';var _=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var moment=require(_0x56f7('0x2'));var BPromise=require(_0x56f7('0x3'));var rs=require(_0x56f7('0x4'));var fs=require('fs');var Redis=require(_0x56f7('0x5'));var db=require(_0x56f7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x56f7('0x7'))(_0x56f7('0x8'));var config=require(_0x56f7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x137d14,_0xcc51b1,_0x4b5dcc){return new BPromise(function(_0x184bf7,_0x5155ff){return client['request'](_0x137d14,_0x4b5dcc)[_0x56f7('0xa')](function(_0x1e607c){logger[_0x56f7('0xb')](_0x56f7('0xc'),_0xcc51b1,_0x56f7('0xd'));logger[_0x56f7('0xe')](_0x56f7('0xf'),_0xcc51b1,_0x56f7('0xd'),JSON[_0x56f7('0x10')](_0x1e607c));if(_0x1e607c[_0x56f7('0x11')]){if(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x12')]===0x1f4){logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c['error'][_0x56f7('0x13')]);return _0x5155ff(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);return _0x184bf7(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0xcc51b1,_0x56f7('0xd'));_0x184bf7(_0x1e607c[_0x56f7('0x14')][_0x56f7('0x13')]);}})[_0x56f7('0x15')](function(_0x40fb77){logger[_0x56f7('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xcc51b1,_0x40fb77);_0x5155ff(_0x40fb77);});});} \ No newline at end of file +var _0x6fa8=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x364048,_0x34dea3){var _0x591678=function(_0x239c0a){while(--_0x239c0a){_0x364048['push'](_0x364048['shift']());}};_0x591678(++_0x34dea3);}(_0x6fa8,0x79));var _0x86fa=function(_0x1ef48d,_0x203c73){_0x1ef48d=_0x1ef48d-0x0;var _0x450096=_0x6fa8[_0x1ef48d];return _0x450096;};'use strict';var _=require('lodash');var util=require(_0x86fa('0x0'));var moment=require(_0x86fa('0x1'));var BPromise=require(_0x86fa('0x2'));var rs=require(_0x86fa('0x3'));var fs=require('fs');var Redis=require(_0x86fa('0x4'));var db=require(_0x86fa('0x5'))['db'];var utils=require(_0x86fa('0x6'));var logger=require(_0x86fa('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x86fa('0x8'));var client=jayson[_0x86fa('0x9')][_0x86fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x509e45,_0x1f0e92,_0x34b993){return new BPromise(function(_0x20eec3,_0x2de438){return client[_0x86fa('0xb')](_0x509e45,_0x34b993)['then'](function(_0x2bd4bc){logger[_0x86fa('0xc')](_0x86fa('0xd'),_0x1f0e92,_0x86fa('0xe'));logger['debug'](_0x86fa('0xf'),_0x1f0e92,_0x86fa('0xe'),JSON['stringify'](_0x2bd4bc));if(_0x2bd4bc[_0x86fa('0x10')]){if(_0x2bd4bc[_0x86fa('0x10')][_0x86fa('0x11')]===0x1f4){logger[_0x86fa('0x10')](_0x86fa('0xd'),_0x1f0e92,_0x2bd4bc[_0x86fa('0x10')][_0x86fa('0x12')]);return _0x2de438(_0x2bd4bc['error'][_0x86fa('0x12')]);}logger[_0x86fa('0x10')](_0x86fa('0xd'),_0x1f0e92,_0x2bd4bc['error'][_0x86fa('0x12')]);return _0x20eec3(_0x2bd4bc[_0x86fa('0x10')][_0x86fa('0x12')]);}else{logger[_0x86fa('0xc')](_0x86fa('0xd'),_0x1f0e92,_0x86fa('0xe'));_0x20eec3(_0x2bd4bc[_0x86fa('0x13')]['message']);}})[_0x86fa('0x14')](function(_0x4ae13c){logger[_0x86fa('0x10')](_0x86fa('0xd'),_0x1f0e92,_0x4ae13c);_0x2de438(_0x4ae13c);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index e6ce910..9153d6c 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 _0x4606=['/:id/download','download','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show'];(function(_0x2bf755,_0x4b156b){var _0x2e1810=function(_0x77fbae){while(--_0x77fbae){_0x2bf755['push'](_0x2bf755['shift']());}};_0x2e1810(++_0x4b156b);}(_0x4606,0x1e4));var _0x6460=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4606[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6460('0x0'));var util=require('util');var path=require(_0x6460('0x1'));var timeout=require(_0x6460('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6460('0x3'));var config=require(_0x6460('0x4'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x6460('0x5')](),controller[_0x6460('0x6')]);router[_0x6460('0x7')]('/:id',auth[_0x6460('0x5')](),controller[_0x6460('0x8')]);router[_0x6460('0x7')](_0x6460('0x9'),auth[_0x6460('0x5')](),controller[_0x6460('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6460('0xb')]);router[_0x6460('0xc')](_0x6460('0xd'),auth[_0x6460('0x5')](),controller[_0x6460('0xe')]);router['delete'](_0x6460('0xd'),auth[_0x6460('0x5')](),controller[_0x6460('0xf')]);module[_0x6460('0x10')]=router; \ No newline at end of file +var _0xe641=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','download','post','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x56d1ed,_0x237e84){var _0x1b282b=function(_0x56648c){while(--_0x56648c){_0x56d1ed['push'](_0x56d1ed['shift']());}};_0x1b282b(++_0x237e84);}(_0xe641,0xea));var _0x1e64=function(_0x30f583,_0x42b6a8){_0x30f583=_0x30f583-0x0;var _0xf24311=_0xe641[_0x30f583];return _0xf24311;};'use strict';var multer=require(_0x1e64('0x0'));var util=require(_0x1e64('0x1'));var path=require(_0x1e64('0x2'));var timeout=require(_0x1e64('0x3'));var express=require(_0x1e64('0x4'));var router=express[_0x1e64('0x5')]();var fs_extra=require(_0x1e64('0x6'));var auth=require(_0x1e64('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1e64('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x1e64('0x9')]('/',auth[_0x1e64('0xa')](),controller[_0x1e64('0xb')]);router[_0x1e64('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1e64('0xc')]);router[_0x1e64('0x9')](_0x1e64('0xd'),auth[_0x1e64('0xa')](),controller[_0x1e64('0xe')]);router[_0x1e64('0xf')]('/',auth[_0x1e64('0xa')](),controller['create']);router[_0x1e64('0x10')](_0x1e64('0x11'),auth[_0x1e64('0xa')](),controller[_0x1e64('0x12')]);router[_0x1e64('0x13')](_0x1e64('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 5760a9f..c7ed436 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 _0x4280=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x4280,0x136));var _0x0428=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4280[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0428('0x0'));module['exports']={'field':{'type':Sequelize[_0x0428('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x0428('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x0428('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0428('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xd03f=['STRING','BOOLEAN','sequelize','exports'];(function(_0x334599,_0x4b1cfa){var _0x4cdff2=function(_0x297be7){while(--_0x297be7){_0x334599['push'](_0x334599['shift']());}};_0x4cdff2(++_0x4b1cfa);}(_0xd03f,0x16e));var _0xfd03=function(_0xe391aa,_0x255528){_0xe391aa=_0xe391aa-0x0;var _0x793c4d=_0xd03f[_0xe391aa];return _0x793c4d;};'use strict';var Sequelize=require(_0xfd03('0x0'));module[_0xfd03('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xfd03('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xfd03('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xfd03('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index bd98ded..bd2664d 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 _0x50ea=['VIRTUAL','merge','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','count','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','AnalyticFieldReport','rawAttributes','fieldName','type','key','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','where'];(function(_0x1d2e01,_0x30e8aa){var _0x36bc23=function(_0x59613c){while(--_0x59613c){_0x1d2e01['push'](_0x1d2e01['shift']());}};_0x36bc23(++_0x30e8aa);}(_0x50ea,0x1ca));var _0xa50e=function(_0xff7bd7,_0x1eef65){_0xff7bd7=_0xff7bd7-0x0;var _0x2b9786=_0x50ea[_0xff7bd7];return _0x2b9786;};'use strict';var emlformat=require(_0xa50e('0x0'));var rimraf=require(_0xa50e('0x1'));var zipdir=require(_0xa50e('0x2'));var jsonpatch=require(_0xa50e('0x3'));var rp=require(_0xa50e('0x4'));var moment=require(_0xa50e('0x5'));var BPromise=require(_0xa50e('0x6'));var Mustache=require(_0xa50e('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa50e('0x8'));var csv=require(_0xa50e('0x9'));var ejs=require(_0xa50e('0xa'));var fs=require('fs');var fs_extra=require(_0xa50e('0xb'));var _=require(_0xa50e('0xc'));var squel=require(_0xa50e('0xd'));var crypto=require(_0xa50e('0xe'));var jsforce=require(_0xa50e('0xf'));var deskjs=require(_0xa50e('0x10'));var toCsv=require(_0xa50e('0x9'));var querystring=require(_0xa50e('0x11'));var Papa=require(_0xa50e('0x12'));var Redis=require(_0xa50e('0x13'));var authService=require(_0xa50e('0x14'));var qs=require(_0xa50e('0x15'));var as=require(_0xa50e('0x16'));var hardwareService=require(_0xa50e('0x17'));var logger=require(_0xa50e('0x18'))(_0xa50e('0x19'));var utils=require(_0xa50e('0x1a'));var config=require(_0xa50e('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xa50e('0x1c'))['db'];function respondWithStatusCode(_0x29c414,_0xc2d654){_0xc2d654=_0xc2d654||0xcc;return function(_0xf3d641){if(_0xf3d641){return _0x29c414[_0xa50e('0x1d')](_0xc2d654);}return _0x29c414[_0xa50e('0x1e')](_0xc2d654)['end']();};}function respondWithResult(_0x289b5b,_0x5650fb){_0x5650fb=_0x5650fb||0xc8;return function(_0x11e8d){if(_0x11e8d){return _0x289b5b['status'](_0x5650fb)[_0xa50e('0x1f')](_0x11e8d);}};}function respondWithFilteredResult(_0xcac5f0,_0x4f6d9b){return function(_0x2c9945){if(_0x2c9945){var _0x3627cc=typeof _0x4f6d9b[_0xa50e('0x20')]==='undefined'&&typeof _0x4f6d9b['limit']==='undefined';var _0x35edc4=_0x2c9945[_0xa50e('0x21')];var _0x48a610=_0x3627cc?0x0:_0x4f6d9b['offset'];var _0x2c25c3=_0x3627cc?_0x2c9945[_0xa50e('0x21')]:_0x4f6d9b[_0xa50e('0x20')]+_0x4f6d9b['limit'];var _0x343174;if(_0x2c25c3>=_0x35edc4){_0x2c25c3=_0x35edc4;_0x343174=0xc8;}else{_0x343174=0xce;}_0xcac5f0['status'](_0x343174);return _0xcac5f0['set'](_0xa50e('0x22'),_0x48a610+'-'+_0x2c25c3+'/'+_0x35edc4)[_0xa50e('0x1f')](_0x2c9945);}return null;};}function patchUpdates(_0x80ff38){return function(_0x481f36){try{jsonpatch[_0xa50e('0x23')](_0x481f36,_0x80ff38,!![]);}catch(_0x5b4d66){return BPromise[_0xa50e('0x24')](_0x5b4d66);}return _0x481f36[_0xa50e('0x25')]();};}function saveUpdates(_0x222115,_0x1753ae){return function(_0x3ecfa7){if(_0x3ecfa7){return _0x3ecfa7['update'](_0x222115)[_0xa50e('0x26')](function(_0xff0918){return _0xff0918;});}return null;};}function removeEntity(_0x37724f,_0x1369bc){return function(_0xbb3cc3){if(_0xbb3cc3){return _0xbb3cc3[_0xa50e('0x27')]()['then'](function(){_0x37724f['status'](0xcc)[_0xa50e('0x28')]();});}};}function handleEntityNotFound(_0x2cc0ac,_0xbb3463){return function(_0xbde460){if(!_0xbde460){_0x2cc0ac['sendStatus'](0x194);}return _0xbde460;};}function handleError(_0x22902c,_0x5adacc){_0x5adacc=_0x5adacc||0x1f4;return function(_0x1b10a2){logger['error'](_0x1b10a2[_0xa50e('0x29')]);if(_0x1b10a2[_0xa50e('0x2a')]){delete _0x1b10a2[_0xa50e('0x2a')];}_0x22902c['status'](_0x5adacc)[_0xa50e('0x2b')](_0x1b10a2);};}exports['index']=function(_0x79e5ab,_0x2c2299){var _0x48a530={},_0x419253={},_0x121682={'count':0x0,'rows':[]};var _0x5c4d4f=_['map'](db[_0xa50e('0x2c')][_0xa50e('0x2d')],function(_0x320ff8){return{'name':_0x320ff8[_0xa50e('0x2e')],'type':_0x320ff8[_0xa50e('0x2f')][_0xa50e('0x30')]};});_0x419253['model']=_[_0xa50e('0x31')](_0x5c4d4f,'name');_0x419253['query']=_[_0xa50e('0x32')](_0x79e5ab[_0xa50e('0x33')]);_0x419253['filters']=_[_0xa50e('0x34')](_0x419253[_0xa50e('0x35')],_0x419253[_0xa50e('0x33')]);_0x48a530[_0xa50e('0x36')]=_[_0xa50e('0x34')](_0x419253['model'],qs['fields'](_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x37')]));_0x48a530['attributes']=_0x48a530['attributes'][_0xa50e('0x38')]?_0x48a530[_0xa50e('0x36')]:_0x419253[_0xa50e('0x35')];if(!_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x39')](_0xa50e('0x3a'))){_0x48a530[_0xa50e('0x3b')]=qs[_0xa50e('0x3b')](_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x3b')]);_0x48a530[_0xa50e('0x20')]=qs[_0xa50e('0x20')](_0x79e5ab[_0xa50e('0x33')]['offset']);}_0x48a530['order']=qs[_0xa50e('0x3c')](_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x3c')]);_0x48a530['where']=qs[_0xa50e('0x3d')](_[_0xa50e('0x3e')](_0x79e5ab['query'],_0x419253[_0xa50e('0x3d')]),_0x5c4d4f);if(_0x79e5ab['query']['filter']){_0x48a530[_0xa50e('0x3f')]=_['merge'](_0x48a530[_0xa50e('0x3f')],{'$or':_[_0xa50e('0x31')](_0x5c4d4f,function(_0xab6230){if(_0xab6230[_0xa50e('0x2f')]!==_0xa50e('0x40')){var _0x54e236={};_0x54e236[_0xab6230[_0xa50e('0x2a')]]={'$like':'%'+_0x79e5ab[_0xa50e('0x33')]['filter']+'%'};return _0x54e236;}})});}_0x48a530=_[_0xa50e('0x41')]({},_0x48a530,_0x79e5ab[_0xa50e('0x42')]);var _0x1894f6={'where':_0x48a530['where']};return db[_0xa50e('0x2c')][_0xa50e('0x21')](_0x1894f6)[_0xa50e('0x26')](function(_0x4dcd23){_0x121682['count']=_0x4dcd23;if(_0x79e5ab[_0xa50e('0x33')]['includeAll']){_0x48a530['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa50e('0x43')](_0x48a530);})[_0xa50e('0x26')](function(_0x46d0dd){_0x121682[_0xa50e('0x44')]=_0x46d0dd;return _0x121682;})[_0xa50e('0x26')](respondWithFilteredResult(_0x2c2299,_0x48a530))['catch'](handleError(_0x2c2299,null));};exports[_0xa50e('0x45')]=function(_0x293d26,_0x876dc3){var _0x3a7acc={'raw':![],'where':{'id':_0x293d26[_0xa50e('0x46')]['id']}},_0x69713a={};_0x69713a['model']=_[_0xa50e('0x32')](db['AnalyticFieldReport'][_0xa50e('0x2d')]);_0x69713a[_0xa50e('0x33')]=_['keys'](_0x293d26[_0xa50e('0x33')]);_0x69713a[_0xa50e('0x3d')]=_[_0xa50e('0x34')](_0x69713a[_0xa50e('0x35')],_0x69713a['query']);_0x3a7acc[_0xa50e('0x36')]=_[_0xa50e('0x34')](_0x69713a[_0xa50e('0x35')],qs[_0xa50e('0x37')](_0x293d26[_0xa50e('0x33')]['fields']));_0x3a7acc[_0xa50e('0x36')]=_0x3a7acc[_0xa50e('0x36')][_0xa50e('0x38')]?_0x3a7acc[_0xa50e('0x36')]:_0x69713a[_0xa50e('0x35')];if(_0x293d26[_0xa50e('0x33')][_0xa50e('0x47')]){_0x3a7acc[_0xa50e('0x48')]=[{'all':!![]}];}_0x3a7acc=_['merge']({},_0x3a7acc,_0x293d26[_0xa50e('0x42')]);return db[_0xa50e('0x2c')][_0xa50e('0x49')](_0x3a7acc)[_0xa50e('0x26')](handleEntityNotFound(_0x876dc3,null))[_0xa50e('0x26')](respondWithResult(_0x876dc3,null))[_0xa50e('0x4a')](handleError(_0x876dc3,null));};exports[_0xa50e('0x4b')]=function(_0x3b9e63,_0x2a8054){return db[_0xa50e('0x2c')][_0xa50e('0x4b')](_0x3b9e63[_0xa50e('0x4c')],{})[_0xa50e('0x26')](respondWithResult(_0x2a8054,0xc9))[_0xa50e('0x4a')](handleError(_0x2a8054,null));};exports[_0xa50e('0x4d')]=function(_0x5a35f6,_0x2cf481){return db[_0xa50e('0x2c')][_0xa50e('0x4d')](_0x5a35f6[_0xa50e('0x4c')],{'raw':![],'individualHooks':!![]})[_0xa50e('0x26')](respondWithResult(_0x2cf481,0xc9))[_0xa50e('0x4a')](handleError(_0x2cf481,null));};exports[_0xa50e('0x4e')]=function(_0x189b54,_0x556438){if(_0x189b54[_0xa50e('0x4c')]['id']){delete _0x189b54[_0xa50e('0x4c')]['id'];}return db[_0xa50e('0x2c')][_0xa50e('0x49')]({'where':{'id':_0x189b54[_0xa50e('0x46')]['id']}})[_0xa50e('0x26')](handleEntityNotFound(_0x556438,null))[_0xa50e('0x26')](saveUpdates(_0x189b54[_0xa50e('0x4c')],null))[_0xa50e('0x26')](respondWithResult(_0x556438,null))['catch'](handleError(_0x556438,null));};exports[_0xa50e('0x27')]=function(_0x29192a,_0x32c7bc){return db[_0xa50e('0x2c')]['find']({'where':{'id':_0x29192a[_0xa50e('0x46')]['id']}})[_0xa50e('0x26')](handleEntityNotFound(_0x32c7bc,null))[_0xa50e('0x26')](removeEntity(_0x32c7bc,null))['catch'](handleError(_0x32c7bc,null));};exports[_0xa50e('0x4f')]=function(_0x14d619,_0x3f51cd){return db[_0xa50e('0x2c')]['destroy']({'where':{'id':_0x14d619['query'][_0xa50e('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0xa50e('0x26')](respondWithResult(_0x3f51cd,0xcc))[_0xa50e('0x4a')](handleError(_0x3f51cd,null));};exports[_0xa50e('0x51')]=function(_0x15c874,_0x490c58,_0x6f533c){return db[_0xa50e('0x52')][_0xa50e('0x53')]({'where':{'id':_0x15c874[_0xa50e('0x46')]['id']}})[_0xa50e('0x26')](handleEntityNotFound(_0x490c58,null))[_0xa50e('0x26')](function(_0x243539){if(_0x243539){return db[_0xa50e('0x54')][_0xa50e('0x55')](function(_0x311c3e){return db[_0xa50e('0x2c')][_0xa50e('0x27')]({'where':{'CustomReportId':_0x15c874[_0xa50e('0x46')]['id']},'transaction':_0x311c3e})['then'](function(_0x35e11f){var _0x218760=_[_0xa50e('0x31')](_0x15c874[_0xa50e('0x4c')],function(_0x392682){delete _0x392682['id'];_0x392682[_0xa50e('0x56')]=_0x15c874['params']['id'];return _0x392682;});return db[_0xa50e('0x2c')][_0xa50e('0x4d')](_0x218760,{'transaction':_0x311c3e});});})[_0xa50e('0x26')](function(){return db[_0xa50e('0x2c')]['findAll']({'where':{'CustomReportId':_0x15c874[_0xa50e('0x46')]['id']}});});}})['then'](respondWithResult(_0x490c58,null))['catch'](handleError(_0x490c58,null));}; \ No newline at end of file +var _0x5a49=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','AnalyticFieldReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x5a49,0x1e7));var _0x95a4=function(_0x329a91,_0x2b1d8f){_0x329a91=_0x329a91-0x0;var _0x3294a8=_0x5a49[_0x329a91];return _0x3294a8;};'use strict';var emlformat=require(_0x95a4('0x0'));var rimraf=require(_0x95a4('0x1'));var zipdir=require(_0x95a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95a4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x95a4('0x4'));var util=require(_0x95a4('0x5'));var path=require(_0x95a4('0x6'));var sox=require(_0x95a4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x95a4('0x8'));var _=require(_0x95a4('0x9'));var squel=require('squel');var crypto=require(_0x95a4('0xa'));var jsforce=require(_0x95a4('0xb'));var deskjs=require(_0x95a4('0xc'));var toCsv=require(_0x95a4('0xd'));var querystring=require(_0x95a4('0xe'));var Papa=require(_0x95a4('0xf'));var Redis=require(_0x95a4('0x10'));var authService=require(_0x95a4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x95a4('0x12'));var hardwareService=require(_0x95a4('0x13'));var logger=require('../../config/logger')(_0x95a4('0x14'));var utils=require(_0x95a4('0x15'));var config=require(_0x95a4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x95a4('0x17'))['db'];function respondWithStatusCode(_0x44073d,_0x2ee8b1){_0x2ee8b1=_0x2ee8b1||0xcc;return function(_0x2095d9){if(_0x2095d9){return _0x44073d[_0x95a4('0x18')](_0x2ee8b1);}return _0x44073d[_0x95a4('0x19')](_0x2ee8b1)['end']();};}function respondWithResult(_0x25b9a1,_0x496c7b){_0x496c7b=_0x496c7b||0xc8;return function(_0x4656cf){if(_0x4656cf){return _0x25b9a1[_0x95a4('0x19')](_0x496c7b)[_0x95a4('0x1a')](_0x4656cf);}};}function respondWithFilteredResult(_0x34f7ce,_0x11ca6c){return function(_0x31749e){if(_0x31749e){var _0x4fae15=typeof _0x11ca6c[_0x95a4('0x1b')]===_0x95a4('0x1c')&&typeof _0x11ca6c[_0x95a4('0x1d')]===_0x95a4('0x1c');var _0x2a38d0=_0x31749e[_0x95a4('0x1e')];var _0x2dad27=_0x4fae15?0x0:_0x11ca6c[_0x95a4('0x1b')];var _0x2ae7d6=_0x4fae15?_0x31749e['count']:_0x11ca6c[_0x95a4('0x1b')]+_0x11ca6c[_0x95a4('0x1d')];var _0x425807;if(_0x2ae7d6>=_0x2a38d0){_0x2ae7d6=_0x2a38d0;_0x425807=0xc8;}else{_0x425807=0xce;}_0x34f7ce[_0x95a4('0x19')](_0x425807);return _0x34f7ce[_0x95a4('0x1f')](_0x95a4('0x20'),_0x2dad27+'-'+_0x2ae7d6+'/'+_0x2a38d0)['json'](_0x31749e);}return null;};}function patchUpdates(_0x46a4dc){return function(_0x20b932){try{jsonpatch[_0x95a4('0x21')](_0x20b932,_0x46a4dc,!![]);}catch(_0x2c4127){return BPromise[_0x95a4('0x22')](_0x2c4127);}return _0x20b932[_0x95a4('0x23')]();};}function saveUpdates(_0x586db8,_0x3ab2ad){return function(_0x68f88){if(_0x68f88){return _0x68f88[_0x95a4('0x24')](_0x586db8)[_0x95a4('0x25')](function(_0x441d72){return _0x441d72;});}return null;};}function removeEntity(_0x589d73,_0x504478){return function(_0x16575b){if(_0x16575b){return _0x16575b[_0x95a4('0x26')]()[_0x95a4('0x25')](function(){_0x589d73[_0x95a4('0x19')](0xcc)[_0x95a4('0x27')]();});}};}function handleEntityNotFound(_0x57ad12,_0x48ba44){return function(_0x1dc2b9){if(!_0x1dc2b9){_0x57ad12[_0x95a4('0x18')](0x194);}return _0x1dc2b9;};}function handleError(_0x3a5ed3,_0x31524b){_0x31524b=_0x31524b||0x1f4;return function(_0x2cd049){logger[_0x95a4('0x28')](_0x2cd049['stack']);if(_0x2cd049[_0x95a4('0x29')]){delete _0x2cd049['name'];}_0x3a5ed3[_0x95a4('0x19')](_0x31524b)[_0x95a4('0x2a')](_0x2cd049);};}exports[_0x95a4('0x2b')]=function(_0x42fbab,_0xbd0056){var _0x5a591d={},_0x16123b={},_0x57526a={'count':0x0,'rows':[]};var _0x34f0ef=_[_0x95a4('0x2c')](db[_0x95a4('0x2d')]['rawAttributes'],function(_0x3e5f8b){return{'name':_0x3e5f8b[_0x95a4('0x2e')],'type':_0x3e5f8b[_0x95a4('0x2f')][_0x95a4('0x30')]};});_0x16123b['model']=_[_0x95a4('0x2c')](_0x34f0ef,_0x95a4('0x29'));_0x16123b[_0x95a4('0x31')]=_[_0x95a4('0x32')](_0x42fbab[_0x95a4('0x31')]);_0x16123b[_0x95a4('0x33')]=_[_0x95a4('0x34')](_0x16123b[_0x95a4('0x35')],_0x16123b[_0x95a4('0x31')]);_0x5a591d[_0x95a4('0x36')]=_['intersection'](_0x16123b[_0x95a4('0x35')],qs[_0x95a4('0x37')](_0x42fbab[_0x95a4('0x31')][_0x95a4('0x37')]));_0x5a591d[_0x95a4('0x36')]=_0x5a591d[_0x95a4('0x36')][_0x95a4('0x38')]?_0x5a591d[_0x95a4('0x36')]:_0x16123b['model'];if(!_0x42fbab[_0x95a4('0x31')][_0x95a4('0x39')](_0x95a4('0x3a'))){_0x5a591d[_0x95a4('0x1d')]=qs['limit'](_0x42fbab[_0x95a4('0x31')]['limit']);_0x5a591d[_0x95a4('0x1b')]=qs[_0x95a4('0x1b')](_0x42fbab['query'][_0x95a4('0x1b')]);}_0x5a591d[_0x95a4('0x3b')]=qs['sort'](_0x42fbab[_0x95a4('0x31')][_0x95a4('0x3c')]);_0x5a591d['where']=qs[_0x95a4('0x33')](_[_0x95a4('0x3d')](_0x42fbab[_0x95a4('0x31')],_0x16123b[_0x95a4('0x33')]),_0x34f0ef);if(_0x42fbab['query']['filter']){_0x5a591d['where']=_[_0x95a4('0x3e')](_0x5a591d[_0x95a4('0x3f')],{'$or':_['map'](_0x34f0ef,function(_0x4d1108){if(_0x4d1108[_0x95a4('0x2f')]!==_0x95a4('0x40')){var _0x36404a={};_0x36404a[_0x4d1108['name']]={'$like':'%'+_0x42fbab[_0x95a4('0x31')][_0x95a4('0x41')]+'%'};return _0x36404a;}})});}_0x5a591d=_['merge']({},_0x5a591d,_0x42fbab[_0x95a4('0x42')]);var _0x96cbbc={'where':_0x5a591d[_0x95a4('0x3f')]};return db[_0x95a4('0x2d')][_0x95a4('0x1e')](_0x96cbbc)[_0x95a4('0x25')](function(_0x45f8e2){_0x57526a['count']=_0x45f8e2;if(_0x42fbab[_0x95a4('0x31')][_0x95a4('0x43')]){_0x5a591d[_0x95a4('0x44')]=[{'all':!![]}];}return db[_0x95a4('0x2d')][_0x95a4('0x45')](_0x5a591d);})[_0x95a4('0x25')](function(_0x3a1970){_0x57526a['rows']=_0x3a1970;return _0x57526a;})[_0x95a4('0x25')](respondWithFilteredResult(_0xbd0056,_0x5a591d))['catch'](handleError(_0xbd0056,null));};exports[_0x95a4('0x46')]=function(_0x544db5,_0x18d98f){var _0x40b7cb={'raw':![],'where':{'id':_0x544db5[_0x95a4('0x47')]['id']}},_0xd40964={};_0xd40964[_0x95a4('0x35')]=_['keys'](db[_0x95a4('0x2d')][_0x95a4('0x48')]);_0xd40964[_0x95a4('0x31')]=_[_0x95a4('0x32')](_0x544db5['query']);_0xd40964[_0x95a4('0x33')]=_[_0x95a4('0x34')](_0xd40964[_0x95a4('0x35')],_0xd40964[_0x95a4('0x31')]);_0x40b7cb[_0x95a4('0x36')]=_['intersection'](_0xd40964[_0x95a4('0x35')],qs[_0x95a4('0x37')](_0x544db5[_0x95a4('0x31')][_0x95a4('0x37')]));_0x40b7cb[_0x95a4('0x36')]=_0x40b7cb['attributes'][_0x95a4('0x38')]?_0x40b7cb[_0x95a4('0x36')]:_0xd40964[_0x95a4('0x35')];if(_0x544db5[_0x95a4('0x31')][_0x95a4('0x43')]){_0x40b7cb['include']=[{'all':!![]}];}_0x40b7cb=_[_0x95a4('0x3e')]({},_0x40b7cb,_0x544db5[_0x95a4('0x42')]);return db[_0x95a4('0x2d')][_0x95a4('0x49')](_0x40b7cb)['then'](handleEntityNotFound(_0x18d98f,null))[_0x95a4('0x25')](respondWithResult(_0x18d98f,null))[_0x95a4('0x4a')](handleError(_0x18d98f,null));};exports[_0x95a4('0x4b')]=function(_0x113693,_0x5b64fd){return db[_0x95a4('0x2d')]['create'](_0x113693[_0x95a4('0x4c')],{})[_0x95a4('0x25')](respondWithResult(_0x5b64fd,0xc9))[_0x95a4('0x4a')](handleError(_0x5b64fd,null));};exports['bulkCreate']=function(_0x1cf314,_0x229ca2){return db[_0x95a4('0x2d')][_0x95a4('0x4d')](_0x1cf314['body'],{'raw':![],'individualHooks':!![]})[_0x95a4('0x25')](respondWithResult(_0x229ca2,0xc9))[_0x95a4('0x4a')](handleError(_0x229ca2,null));};exports['update']=function(_0x561515,_0x511e00){if(_0x561515['body']['id']){delete _0x561515[_0x95a4('0x4c')]['id'];}return db['AnalyticFieldReport'][_0x95a4('0x49')]({'where':{'id':_0x561515[_0x95a4('0x47')]['id']}})[_0x95a4('0x25')](handleEntityNotFound(_0x511e00,null))['then'](saveUpdates(_0x561515[_0x95a4('0x4c')],null))['then'](respondWithResult(_0x511e00,null))[_0x95a4('0x4a')](handleError(_0x511e00,null));};exports[_0x95a4('0x26')]=function(_0x46ce47,_0xdd0b2e){return db[_0x95a4('0x2d')][_0x95a4('0x49')]({'where':{'id':_0x46ce47[_0x95a4('0x47')]['id']}})[_0x95a4('0x25')](handleEntityNotFound(_0xdd0b2e,null))[_0x95a4('0x25')](removeEntity(_0xdd0b2e,null))['catch'](handleError(_0xdd0b2e,null));};exports[_0x95a4('0x4e')]=function(_0x3049fb,_0xf8f4fb){return db['AnalyticFieldReport'][_0x95a4('0x26')]({'where':{'id':_0x3049fb[_0x95a4('0x31')][_0x95a4('0x4f')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xf8f4fb,0xcc))[_0x95a4('0x4a')](handleError(_0xf8f4fb,null));};exports[_0x95a4('0x50')]=function(_0x54b07f,_0x5a04eb,_0x2ed4e4){return db[_0x95a4('0x51')]['findOne']({'where':{'id':_0x54b07f['params']['id']}})[_0x95a4('0x25')](handleEntityNotFound(_0x5a04eb,null))['then'](function(_0x24cd65){if(_0x24cd65){return db[_0x95a4('0x52')][_0x95a4('0x53')](function(_0x179930){return db[_0x95a4('0x2d')][_0x95a4('0x26')]({'where':{'CustomReportId':_0x54b07f[_0x95a4('0x47')]['id']},'transaction':_0x179930})[_0x95a4('0x25')](function(_0x5b9d27){var _0x8029d6=_[_0x95a4('0x2c')](_0x54b07f[_0x95a4('0x4c')],function(_0x104b08){delete _0x104b08['id'];_0x104b08['CustomReportId']=_0x54b07f[_0x95a4('0x47')]['id'];return _0x104b08;});return db[_0x95a4('0x2d')]['bulkCreate'](_0x8029d6,{'transaction':_0x179930});});})[_0x95a4('0x25')](function(){return db[_0x95a4('0x2d')][_0x95a4('0x45')]({'where':{'CustomReportId':_0x54b07f['params']['id']}});});}})[_0x95a4('0x25')](respondWithResult(_0x5a04eb,null))[_0x95a4('0x4a')](handleError(_0x5a04eb,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index bf4019f..5d7d6d1 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 _0x5a1f=['analytics_report_fields','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x3f20d6,_0x3dd14c){var _0x3c8528=function(_0x3eb3f2){while(--_0x3eb3f2){_0x3f20d6['push'](_0x3f20d6['shift']());}};_0x3c8528(++_0x3dd14c);}(_0x5a1f,0x1e5));var _0xf5a1=function(_0x1a37e9,_0x506022){_0x1a37e9=_0x1a37e9-0x0;var _0x2dd1ad=_0x5a1f[_0x1a37e9];return _0x2dd1ad;};'use strict';var _=require(_0xf5a1('0x0'));var util=require(_0xf5a1('0x1'));var logger=require('../../config/logger')(_0xf5a1('0x2'));var moment=require(_0xf5a1('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5a1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5a1('0x5'));var config=require(_0xf5a1('0x6'));var attributes=require(_0xf5a1('0x7'));module[_0xf5a1('0x8')]=function(_0x45c7c0,_0x1a63bf){return _0x45c7c0[_0xf5a1('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xf5a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88da=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','moment'];(function(_0xcf4690,_0x1888f6){var _0x1a5ebe=function(_0x1c428c){while(--_0x1c428c){_0xcf4690['push'](_0xcf4690['shift']());}};_0x1a5ebe(++_0x1888f6);}(_0x88da,0xa5));var _0xa88d=function(_0x5cb25e,_0x120a7f){_0x5cb25e=_0x5cb25e-0x0;var _0xe7d756=_0x88da[_0x5cb25e];return _0xe7d756;};'use strict';var _=require(_0xa88d('0x0'));var util=require(_0xa88d('0x1'));var logger=require(_0xa88d('0x2'))('api');var moment=require(_0xa88d('0x3'));var BPromise=require(_0xa88d('0x4'));var rp=require(_0xa88d('0x5'));var fs=require('fs');var path=require(_0xa88d('0x6'));var rimraf=require(_0xa88d('0x7'));var config=require(_0xa88d('0x8'));var attributes=require(_0xa88d('0x9'));module[_0xa88d('0xa')]=function(_0xa8a29e,_0x37a735){return _0xa8a29e[_0xa88d('0xb')](_0xa88d('0xc'),attributes,{'tableName':'analytics_report_fields','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 3dadc4a..eb6904b 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 _0x8bba=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x2738d5,_0x2a6f42){var _0x5c92db=function(_0x4a50fe){while(--_0x4a50fe){_0x2738d5['push'](_0x2738d5['shift']());}};_0x5c92db(++_0x2a6f42);}(_0x8bba,0x18e));var _0xa8bb=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x8bba[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xa8bb('0x0'));var util=require(_0xa8bb('0x1'));var moment=require(_0xa8bb('0x2'));var BPromise=require(_0xa8bb('0x3'));var rs=require(_0xa8bb('0x4'));var fs=require('fs');var Redis=require(_0xa8bb('0x5'));var db=require(_0xa8bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa8bb('0x7'));var config=require(_0xa8bb('0x8'));var jayson=require(_0xa8bb('0x9'));var client=jayson['client'][_0xa8bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9fe735,_0x2bdae2,_0x3afeb4){return new BPromise(function(_0x3d3196,_0x520669){return client[_0xa8bb('0xb')](_0x9fe735,_0x3afeb4)['then'](function(_0x78ff08){logger[_0xa8bb('0xc')](_0xa8bb('0xd'),_0x2bdae2,_0xa8bb('0xe'));logger[_0xa8bb('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2bdae2,_0xa8bb('0xe'),JSON[_0xa8bb('0x10')](_0x78ff08));if(_0x78ff08['error']){if(_0x78ff08['error'][_0xa8bb('0x11')]===0x1f4){logger[_0xa8bb('0x12')](_0xa8bb('0xd'),_0x2bdae2,_0x78ff08['error']['message']);return _0x520669(_0x78ff08['error']['message']);}logger[_0xa8bb('0x12')](_0xa8bb('0xd'),_0x2bdae2,_0x78ff08['error']['message']);return _0x3d3196(_0x78ff08['error'][_0xa8bb('0x13')]);}else{logger[_0xa8bb('0xc')](_0xa8bb('0xd'),_0x2bdae2,_0xa8bb('0xe'));_0x3d3196(_0x78ff08[_0xa8bb('0x14')]['message']);}})[_0xa8bb('0x15')](function(_0x5ba952){logger[_0xa8bb('0x12')](_0xa8bb('0xd'),_0x2bdae2,_0x5ba952);_0x520669(_0x5ba952);});});} \ No newline at end of file +var _0xbefc=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4a7b7e,_0x1d1bf4){var _0xffd584=function(_0x6cb30c){while(--_0x6cb30c){_0x4a7b7e['push'](_0x4a7b7e['shift']());}};_0xffd584(++_0x1d1bf4);}(_0xbefc,0x80));var _0xcbef=function(_0x42af56,_0x4eaefe){_0x42af56=_0x42af56-0x0;var _0x2e5696=_0xbefc[_0x42af56];return _0x2e5696;};'use strict';var _=require(_0xcbef('0x0'));var util=require(_0xcbef('0x1'));var moment=require(_0xcbef('0x2'));var BPromise=require(_0xcbef('0x3'));var rs=require(_0xcbef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbef('0x5'))['db'];var utils=require(_0xcbef('0x6'));var logger=require(_0xcbef('0x7'))('rpc');var config=require(_0xcbef('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcbef('0x9')][_0xcbef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x528bdc,_0x235ad4,_0x2d4702){return new BPromise(function(_0x51c81d,_0x5c7eb6){return client['request'](_0x528bdc,_0x2d4702)['then'](function(_0x212734){logger[_0xcbef('0xb')](_0xcbef('0xc'),_0x235ad4,_0xcbef('0xd'));logger[_0xcbef('0xe')](_0xcbef('0xf'),_0x235ad4,'request\x20sent',JSON[_0xcbef('0x10')](_0x212734));if(_0x212734[_0xcbef('0x11')]){if(_0x212734[_0xcbef('0x11')][_0xcbef('0x12')]===0x1f4){logger[_0xcbef('0x11')](_0xcbef('0xc'),_0x235ad4,_0x212734[_0xcbef('0x11')][_0xcbef('0x13')]);return _0x5c7eb6(_0x212734[_0xcbef('0x11')][_0xcbef('0x13')]);}logger[_0xcbef('0x11')](_0xcbef('0xc'),_0x235ad4,_0x212734[_0xcbef('0x11')][_0xcbef('0x13')]);return _0x51c81d(_0x212734['error']['message']);}else{logger['info'](_0xcbef('0xc'),_0x235ad4,_0xcbef('0xd'));_0x51c81d(_0x212734[_0xcbef('0x14')][_0xcbef('0x13')]);}})[_0xcbef('0x15')](function(_0x109163){logger[_0xcbef('0x11')](_0xcbef('0xc'),_0x235ad4,_0x109163);_0x5c7eb6(_0x109163);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index fb22be2..c5f0115 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(_0x139a94,_0x7a7ac2){var _0x4f259e=function(_0xdf86fe){while(--_0xdf86fe){_0x139a94['push'](_0x139a94['shift']());}};_0x4f259e(++_0x7a7ac2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x2e195d,_0x229650){var _0x15cf2a=function(_0x1603eb){while(--_0x1603eb){_0x2e195d['push'](_0x2e195d['shift']());}};_0x15cf2a(++_0x229650);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 7b0b355..05b952e 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 _0xa062=['TEXT','sequelize','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa062,0x101));var _0x2a06=function(_0x3f75d7,_0x22bab8){_0x3f75d7=_0x3f75d7-0x0;var _0x26fb16=_0xa062[_0x3f75d7];return _0x26fb16;};'use strict';var Sequelize=require(_0x2a06('0x0'));module[_0x2a06('0x1')]={'name':{'type':Sequelize[_0x2a06('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x2a06('0x2')]},'metric':{'type':Sequelize[_0x2a06('0x3')]},'description':{'type':Sequelize[_0x2a06('0x2')]}}; \ No newline at end of file +var _0x9e5e=['STRING','TEXT','sequelize','exports','name'];(function(_0x2ab276,_0x2fc401){var _0x46dfb1=function(_0x44f9fc){while(--_0x44f9fc){_0x2ab276['push'](_0x2ab276['shift']());}};_0x46dfb1(++_0x2fc401);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x9e5e[_0x525c7b];return _0x27b33e;};'use strict';var Sequelize=require(_0xe9e5('0x0'));module[_0xe9e5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe9e5('0x2')},'table':{'type':Sequelize[_0xe9e5('0x3')]},'metric':{'type':Sequelize[_0xe9e5('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 0ff2bab..9e6fbd7 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 _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0x6aa7,0x178));var _0x76aa=function(_0x2d3f23,_0x2bf9f7){_0x2d3f23=_0x2d3f23-0x0;var _0x244ced=_0x6aa7[_0x2d3f23];return _0x244ced;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));}; \ No newline at end of file +var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x1e514e,_0x4c2113){var _0x54f8ae=function(_0xa83626){while(--_0xa83626){_0x1e514e['push'](_0x1e514e['shift']());}};_0x54f8ae(++_0x4c2113);}(_0x9a19,0x114));var _0x99a1=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x9a19[_0x3430aa];return _0x2ac5c;};'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(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 39590e9..38d414a 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 _0x28b1=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','./analyticMetric.attributes','AnalyticMetric','analytics_metrics'];(function(_0x1a4bc0,_0x31747f){var _0x3c11e6=function(_0x4e5af6){while(--_0x4e5af6){_0x1a4bc0['push'](_0x1a4bc0['shift']());}};_0x3c11e6(++_0x31747f);}(_0x28b1,0x1d6));var _0x128b=function(_0x49f42f,_0x4f3ce7){_0x49f42f=_0x49f42f-0x0;var _0x40368b=_0x28b1[_0x49f42f];return _0x40368b;};'use strict';var _=require(_0x128b('0x0'));var util=require(_0x128b('0x1'));var logger=require(_0x128b('0x2'))('api');var moment=require(_0x128b('0x3'));var BPromise=require(_0x128b('0x4'));var rp=require(_0x128b('0x5'));var fs=require('fs');var path=require(_0x128b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x128b('0x7'));module['exports']=function(_0x5c3ceb,_0x3699d5){return _0x5c3ceb['define'](_0x128b('0x8'),attributes,{'tableName':_0x128b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe2a=['rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1bb321,_0x16ce37){var _0x4b2937=function(_0x36a9b6){while(--_0x36a9b6){_0x1bb321['push'](_0x1bb321['shift']());}};_0x4b2937(++_0x16ce37);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x47dd4a,_0x8ecd84){_0x47dd4a=_0x47dd4a-0x0;var _0xf70f7c=_0xbe2a[_0x47dd4a];return _0xf70f7c;};'use strict';var _=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var logger=require(_0xabe2('0x2'))(_0xabe2('0x3'));var moment=require(_0xabe2('0x4'));var BPromise=require(_0xabe2('0x5'));var rp=require(_0xabe2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabe2('0x7'));var config=require('../../config/environment');var attributes=require(_0xabe2('0x8'));module[_0xabe2('0x9')]=function(_0x2ddf42,_0x475007){return _0x2ddf42[_0xabe2('0xa')](_0xabe2('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 4f53eb6..96152e2 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 _0x0c2c=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x52d39a,_0x242577){var _0x8344a=function(_0x1d197a){while(--_0x1d197a){_0x52d39a['push'](_0x52d39a['shift']());}};_0x8344a(++_0x242577);}(_0x0c2c,0x1bd));var _0xc0c2=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x0c2c[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xc0c2('0x0'));var util=require('util');var moment=require(_0xc0c2('0x1'));var BPromise=require('bluebird');var rs=require(_0xc0c2('0x2'));var fs=require('fs');var Redis=require(_0xc0c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0c2('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc0c2('0x5'));var jayson=require(_0xc0c2('0x6'));var client=jayson[_0xc0c2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x497bc3,_0x558aeb,_0x19998b){return new BPromise(function(_0x5a4ab6,_0x4b59d5){return client[_0xc0c2('0x8')](_0x497bc3,_0x19998b)[_0xc0c2('0x9')](function(_0x26ed3f){logger[_0xc0c2('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x558aeb,_0xc0c2('0xb'));logger[_0xc0c2('0xc')](_0xc0c2('0xd'),_0x558aeb,_0xc0c2('0xb'),JSON[_0xc0c2('0xe')](_0x26ed3f));if(_0x26ed3f['error']){if(_0x26ed3f[_0xc0c2('0xf')]['code']===0x1f4){logger[_0xc0c2('0xf')](_0xc0c2('0x10'),_0x558aeb,_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);return _0x4b59d5(_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);}logger[_0xc0c2('0xf')](_0xc0c2('0x10'),_0x558aeb,_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);return _0x5a4ab6(_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);}else{logger[_0xc0c2('0xa')](_0xc0c2('0x10'),_0x558aeb,'request\x20sent');_0x5a4ab6(_0x26ed3f['result']['message']);}})[_0xc0c2('0x12')](function(_0x188e6c){logger[_0xc0c2('0xf')](_0xc0c2('0x10'),_0x558aeb,_0x188e6c);_0x4b59d5(_0x188e6c);});});} \ No newline at end of file +var _0x3bfc=['then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0xe41a46,_0x144159){var _0x3d970c=function(_0x97c741){while(--_0x97c741){_0xe41a46['push'](_0xe41a46['shift']());}};_0x3d970c(++_0x144159);}(_0x3bfc,0x154));var _0xc3bf=function(_0x2cea58,_0x153c15){_0x2cea58=_0x2cea58-0x0;var _0x192933=_0x3bfc[_0x2cea58];return _0x192933;};'use strict';var _=require(_0xc3bf('0x0'));var util=require(_0xc3bf('0x1'));var moment=require(_0xc3bf('0x2'));var BPromise=require(_0xc3bf('0x3'));var rs=require(_0xc3bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3bf('0x5'))['db'];var utils=require(_0xc3bf('0x6'));var logger=require(_0xc3bf('0x7'))('rpc');var config=require(_0xc3bf('0x8'));var jayson=require(_0xc3bf('0x9'));var client=jayson['client'][_0xc3bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22877f,_0x425b45,_0x24601c){return new BPromise(function(_0x1cebaf,_0x42813e){return client[_0xc3bf('0xb')](_0x22877f,_0x24601c)[_0xc3bf('0xc')](function(_0x38c2ef){logger[_0xc3bf('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x425b45,_0xc3bf('0xe'));logger[_0xc3bf('0xf')](_0xc3bf('0x10'),_0x425b45,_0xc3bf('0xe'),JSON[_0xc3bf('0x11')](_0x38c2ef));if(_0x38c2ef[_0xc3bf('0x12')]){if(_0x38c2ef['error']['code']===0x1f4){logger['error'](_0xc3bf('0x13'),_0x425b45,_0x38c2ef[_0xc3bf('0x12')]['message']);return _0x42813e(_0x38c2ef['error'][_0xc3bf('0x14')]);}logger[_0xc3bf('0x12')](_0xc3bf('0x13'),_0x425b45,_0x38c2ef[_0xc3bf('0x12')][_0xc3bf('0x14')]);return _0x1cebaf(_0x38c2ef['error'][_0xc3bf('0x14')]);}else{logger[_0xc3bf('0xd')](_0xc3bf('0x13'),_0x425b45,_0xc3bf('0xe'));_0x1cebaf(_0x38c2ef['result'][_0xc3bf('0x14')]);}})[_0xc3bf('0x15')](function(_0xb14e0c){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x425b45,_0xb14e0c);_0x42813e(_0xb14e0c);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 0176ba5..7e40cf9 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 _0xec46=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller'];(function(_0x6d7446,_0x179e0e){var _0x6bf1a=function(_0x1b8eb9){while(--_0x1b8eb9){_0x6d7446['push'](_0x6d7446['shift']());}};_0x6bf1a(++_0x179e0e);}(_0xec46,0x19c));var _0x6ec4=function(_0x267d66,_0xe313d1){_0x267d66=_0x267d66-0x0;var _0x1742be=_0xec46[_0x267d66];return _0x1742be;};'use strict';var multer=require(_0x6ec4('0x0'));var util=require(_0x6ec4('0x1'));var path=require(_0x6ec4('0x2'));var timeout=require(_0x6ec4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6ec4('0x4'));var auth=require(_0x6ec4('0x5'));var interaction=require(_0x6ec4('0x6'));var config=require('../../config/environment');var controller=require(_0x6ec4('0x7'));router[_0x6ec4('0x8')]('/',auth['isAuthenticated'](),controller[_0x6ec4('0x9')]);router['get'](_0x6ec4('0xa'),auth[_0x6ec4('0xb')](),controller[_0x6ec4('0xc')]);router[_0x6ec4('0xd')]('/',auth[_0x6ec4('0xb')](),controller[_0x6ec4('0xe')]);router[_0x6ec4('0xf')](_0x6ec4('0xa'),auth[_0x6ec4('0xb')](),controller[_0x6ec4('0x10')]);router[_0x6ec4('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6ec4('0x12')]);module[_0x6ec4('0x13')]=router; \ No newline at end of file +var _0x27a8=['/:id','show','post','create','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x5e3212,_0x2b36de){var _0x62f793=function(_0x371267){while(--_0x371267){_0x5e3212['push'](_0x5e3212['shift']());}};_0x62f793(++_0x2b36de);}(_0x27a8,0x170));var _0x827a=function(_0x2f3fe7,_0x4048ba){_0x2f3fe7=_0x2f3fe7-0x0;var _0xbc9d29=_0x27a8[_0x2f3fe7];return _0xbc9d29;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x827a('0x0'));var timeout=require(_0x827a('0x1'));var express=require(_0x827a('0x2'));var router=express[_0x827a('0x3')]();var fs_extra=require(_0x827a('0x4'));var auth=require(_0x827a('0x5'));var interaction=require(_0x827a('0x6'));var config=require(_0x827a('0x7'));var controller=require(_0x827a('0x8'));router[_0x827a('0x9')]('/',auth[_0x827a('0xa')](),controller[_0x827a('0xb')]);router[_0x827a('0x9')](_0x827a('0xc'),auth[_0x827a('0xa')](),controller[_0x827a('0xd')]);router[_0x827a('0xe')]('/',auth[_0x827a('0xa')](),controller[_0x827a('0xf')]);router[_0x827a('0x10')](_0x827a('0xc'),auth[_0x827a('0xa')](),controller[_0x827a('0x11')]);router['delete']('/:id',auth[_0x827a('0xa')](),controller[_0x827a('0x12')]);module[_0x827a('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index a47d0ea..ca4c962 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 _0x1e69=['TEXT','exports'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x1e69,0x85));var _0x91e6=function(_0x2c6991,_0x4b5775){_0x2c6991=_0x2c6991-0x0;var _0x4de9fa=_0x1e69[_0x2c6991];return _0x4de9fa;};'use strict';var Sequelize=require('sequelize');module[_0x91e6('0x0')]={'tree':{'type':Sequelize[_0x91e6('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x2664=['TEXT','sequelize','exports'];(function(_0x4c8833,_0x14e755){var _0x30df54=function(_0x197811){while(--_0x197811){_0x4c8833['push'](_0x4c8833['shift']());}};_0x30df54(++_0x14e755);}(_0x2664,0x127));var _0x4266=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2664[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x4266('0x0'));module[_0x4266('0x1')]={'tree':{'type':Sequelize[_0x4266('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 29e583a..cd9072d 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 _0x11da=['api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','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','AnalyticTreeReport','includeAll','include','findAll','catch','show','params','find','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger'];(function(_0x31d3b4,_0x138abc){var _0x43b94b=function(_0x50d9f3){while(--_0x50d9f3){_0x31d3b4['push'](_0x31d3b4['shift']());}};_0x43b94b(++_0x138abc);}(_0x11da,0x7f));var _0xa11d=function(_0x4f184d,_0x124bbe){_0x4f184d=_0x4f184d-0x0;var _0x5a1c06=_0x11da[_0x4f184d];return _0x5a1c06;};'use strict';var emlformat=require(_0xa11d('0x0'));var rimraf=require(_0xa11d('0x1'));var zipdir=require(_0xa11d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa11d('0x3'));var moment=require(_0xa11d('0x4'));var BPromise=require(_0xa11d('0x5'));var Mustache=require(_0xa11d('0x6'));var util=require(_0xa11d('0x7'));var path=require(_0xa11d('0x8'));var sox=require(_0xa11d('0x9'));var csv=require('to-csv');var ejs=require(_0xa11d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa11d('0xb'));var squel=require(_0xa11d('0xc'));var crypto=require(_0xa11d('0xd'));var jsforce=require(_0xa11d('0xe'));var deskjs=require(_0xa11d('0xf'));var toCsv=require(_0xa11d('0x10'));var querystring=require(_0xa11d('0x11'));var Papa=require(_0xa11d('0x12'));var Redis=require(_0xa11d('0x13'));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(_0xa11d('0x14'))(_0xa11d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa11d('0x16'))['db'];function respondWithStatusCode(_0x285b6e,_0x4a2402){_0x4a2402=_0x4a2402||0xcc;return function(_0x16a908){if(_0x16a908){return _0x285b6e[_0xa11d('0x17')](_0x4a2402);}return _0x285b6e[_0xa11d('0x18')](_0x4a2402)[_0xa11d('0x19')]();};}function respondWithResult(_0x252844,_0x21543e){_0x21543e=_0x21543e||0xc8;return function(_0x602c0){if(_0x602c0){return _0x252844[_0xa11d('0x18')](_0x21543e)[_0xa11d('0x1a')](_0x602c0);}};}function respondWithFilteredResult(_0x578ba8,_0x4b342e){return function(_0x534641){if(_0x534641){var _0x5ea49e=typeof _0x4b342e[_0xa11d('0x1b')]===_0xa11d('0x1c')&&typeof _0x4b342e[_0xa11d('0x1d')]===_0xa11d('0x1c');var _0x13839c=_0x534641[_0xa11d('0x1e')];var _0x411533=_0x5ea49e?0x0:_0x4b342e[_0xa11d('0x1b')];var _0x1af580=_0x5ea49e?_0x534641[_0xa11d('0x1e')]:_0x4b342e['offset']+_0x4b342e[_0xa11d('0x1d')];var _0x251009;if(_0x1af580>=_0x13839c){_0x1af580=_0x13839c;_0x251009=0xc8;}else{_0x251009=0xce;}_0x578ba8[_0xa11d('0x18')](_0x251009);return _0x578ba8[_0xa11d('0x1f')](_0xa11d('0x20'),_0x411533+'-'+_0x1af580+'/'+_0x13839c)[_0xa11d('0x1a')](_0x534641);}return null;};}function patchUpdates(_0x4144aa){return function(_0x467b66){try{jsonpatch[_0xa11d('0x21')](_0x467b66,_0x4144aa,!![]);}catch(_0x3a09cd){return BPromise['reject'](_0x3a09cd);}return _0x467b66[_0xa11d('0x22')]();};}function saveUpdates(_0x18cba7,_0xd5cd7f){return function(_0x4798da){if(_0x4798da){return _0x4798da[_0xa11d('0x23')](_0x18cba7)[_0xa11d('0x24')](function(_0x34104e){return _0x34104e;});}return null;};}function removeEntity(_0x416271,_0x738dc8){return function(_0x4f44b2){if(_0x4f44b2){return _0x4f44b2[_0xa11d('0x25')]()[_0xa11d('0x24')](function(){_0x416271['status'](0xcc)[_0xa11d('0x19')]();});}};}function handleEntityNotFound(_0x3a8957,_0x54a883){return function(_0x22df71){if(!_0x22df71){_0x3a8957['sendStatus'](0x194);}return _0x22df71;};}function handleError(_0x2046b9,_0x255d11){_0x255d11=_0x255d11||0x1f4;return function(_0x1ff8c0){logger[_0xa11d('0x26')](_0x1ff8c0[_0xa11d('0x27')]);if(_0x1ff8c0['name']){delete _0x1ff8c0[_0xa11d('0x28')];}_0x2046b9[_0xa11d('0x18')](_0x255d11)[_0xa11d('0x29')](_0x1ff8c0);};}exports[_0xa11d('0x2a')]=function(_0x23ddd7,_0x438610){var _0x2e2735={},_0x30c712={},_0x38964a={'count':0x0,'rows':[]};var _0x2ea647=_[_0xa11d('0x2b')](db['AnalyticTreeReport'][_0xa11d('0x2c')],function(_0x44c43b){return{'name':_0x44c43b['fieldName'],'type':_0x44c43b[_0xa11d('0x2d')][_0xa11d('0x2e')]};});_0x30c712[_0xa11d('0x2f')]=_['map'](_0x2ea647,_0xa11d('0x28'));_0x30c712[_0xa11d('0x30')]=_[_0xa11d('0x31')](_0x23ddd7[_0xa11d('0x30')]);_0x30c712[_0xa11d('0x32')]=_[_0xa11d('0x33')](_0x30c712[_0xa11d('0x2f')],_0x30c712[_0xa11d('0x30')]);_0x2e2735[_0xa11d('0x34')]=_[_0xa11d('0x33')](_0x30c712[_0xa11d('0x2f')],qs[_0xa11d('0x35')](_0x23ddd7['query'][_0xa11d('0x35')]));_0x2e2735[_0xa11d('0x34')]=_0x2e2735[_0xa11d('0x34')][_0xa11d('0x36')]?_0x2e2735[_0xa11d('0x34')]:_0x30c712['model'];if(!_0x23ddd7['query'][_0xa11d('0x37')](_0xa11d('0x38'))){_0x2e2735[_0xa11d('0x1d')]=qs[_0xa11d('0x1d')](_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x1d')]);_0x2e2735[_0xa11d('0x1b')]=qs[_0xa11d('0x1b')](_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x1b')]);}_0x2e2735[_0xa11d('0x39')]=qs[_0xa11d('0x3a')](_0x23ddd7['query'][_0xa11d('0x3a')]);_0x2e2735[_0xa11d('0x3b')]=qs['filters'](_[_0xa11d('0x3c')](_0x23ddd7[_0xa11d('0x30')],_0x30c712[_0xa11d('0x32')]),_0x2ea647);if(_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x3d')]){_0x2e2735['where']=_[_0xa11d('0x3e')](_0x2e2735[_0xa11d('0x3b')],{'$or':_[_0xa11d('0x2b')](_0x2ea647,function(_0x38b769){if(_0x38b769[_0xa11d('0x2d')]!==_0xa11d('0x3f')){var _0x1f6f92={};_0x1f6f92[_0x38b769[_0xa11d('0x28')]]={'$like':'%'+_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x3d')]+'%'};return _0x1f6f92;}})});}_0x2e2735=_['merge']({},_0x2e2735,_0x23ddd7[_0xa11d('0x40')]);var _0xb118c2={'where':_0x2e2735[_0xa11d('0x3b')]};return db[_0xa11d('0x41')][_0xa11d('0x1e')](_0xb118c2)[_0xa11d('0x24')](function(_0x39a95b){_0x38964a[_0xa11d('0x1e')]=_0x39a95b;if(_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x42')]){_0x2e2735[_0xa11d('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xa11d('0x44')](_0x2e2735);})[_0xa11d('0x24')](function(_0x50b96d){_0x38964a['rows']=_0x50b96d;return _0x38964a;})[_0xa11d('0x24')](respondWithFilteredResult(_0x438610,_0x2e2735))[_0xa11d('0x45')](handleError(_0x438610,null));};exports[_0xa11d('0x46')]=function(_0x3dbe5f,_0x15fbd5){var _0x518435={'raw':!![],'where':{'id':_0x3dbe5f[_0xa11d('0x47')]['id']}},_0x440d7e={};_0x440d7e[_0xa11d('0x2f')]=_[_0xa11d('0x31')](db[_0xa11d('0x41')]['rawAttributes']);_0x440d7e[_0xa11d('0x30')]=_[_0xa11d('0x31')](_0x3dbe5f[_0xa11d('0x30')]);_0x440d7e[_0xa11d('0x32')]=_['intersection'](_0x440d7e[_0xa11d('0x2f')],_0x440d7e[_0xa11d('0x30')]);_0x518435[_0xa11d('0x34')]=_['intersection'](_0x440d7e[_0xa11d('0x2f')],qs[_0xa11d('0x35')](_0x3dbe5f[_0xa11d('0x30')]['fields']));_0x518435['attributes']=_0x518435[_0xa11d('0x34')][_0xa11d('0x36')]?_0x518435['attributes']:_0x440d7e[_0xa11d('0x2f')];if(_0x3dbe5f[_0xa11d('0x30')][_0xa11d('0x42')]){_0x518435[_0xa11d('0x43')]=[{'all':!![]}];}_0x518435=_[_0xa11d('0x3e')]({},_0x518435,_0x3dbe5f[_0xa11d('0x40')]);return db[_0xa11d('0x41')][_0xa11d('0x48')](_0x518435)[_0xa11d('0x24')](handleEntityNotFound(_0x15fbd5,null))[_0xa11d('0x24')](respondWithResult(_0x15fbd5,null))[_0xa11d('0x45')](handleError(_0x15fbd5,null));};exports['create']=function(_0x1b759a,_0x33e4bd){return db[_0xa11d('0x41')]['create'](_0x1b759a[_0xa11d('0x49')],{})[_0xa11d('0x24')](respondWithResult(_0x33e4bd,0xc9))['catch'](handleError(_0x33e4bd,null));};exports[_0xa11d('0x23')]=function(_0x25b097,_0x33288c){if(_0x25b097[_0xa11d('0x49')]['id']){delete _0x25b097[_0xa11d('0x49')]['id'];}return db[_0xa11d('0x41')][_0xa11d('0x48')]({'where':{'id':_0x25b097[_0xa11d('0x47')]['id']}})[_0xa11d('0x24')](handleEntityNotFound(_0x33288c,null))[_0xa11d('0x24')](saveUpdates(_0x25b097[_0xa11d('0x49')],null))['then'](respondWithResult(_0x33288c,null))[_0xa11d('0x45')](handleError(_0x33288c,null));};exports[_0xa11d('0x25')]=function(_0x4137ff,_0x3eefac){return db[_0xa11d('0x41')][_0xa11d('0x48')]({'where':{'id':_0x4137ff[_0xa11d('0x47')]['id']}})[_0xa11d('0x24')](handleEntityNotFound(_0x3eefac,null))[_0xa11d('0x24')](removeEntity(_0x3eefac,null))[_0xa11d('0x45')](handleError(_0x3eefac,null));}; \ No newline at end of file +var _0x9788=['catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','type','VIRTUAL','filter','merge','options','includeAll','include','AnalyticTreeReport','findAll','rows','show','params','rawAttributes','intersection','find','create','body'];(function(_0x3f3b97,_0x395d93){var _0xb6ab0c=function(_0x330c5a){while(--_0x330c5a){_0x3f3b97['push'](_0x3f3b97['shift']());}};_0xb6ab0c(++_0x395d93);}(_0x9788,0x1db));var _0x8978=function(_0x30a616,_0x16f281){_0x30a616=_0x30a616-0x0;var _0x29d79d=_0x9788[_0x30a616];return _0x29d79d;};'use strict';var emlformat=require(_0x8978('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8978('0x1'));var jsonpatch=require(_0x8978('0x2'));var rp=require(_0x8978('0x3'));var moment=require(_0x8978('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8978('0x5'));var util=require(_0x8978('0x6'));var path=require(_0x8978('0x7'));var sox=require(_0x8978('0x8'));var csv=require('to-csv');var ejs=require(_0x8978('0x9'));var fs=require('fs');var fs_extra=require(_0x8978('0xa'));var _=require(_0x8978('0xb'));var squel=require('squel');var crypto=require(_0x8978('0xc'));var jsforce=require(_0x8978('0xd'));var deskjs=require(_0x8978('0xe'));var toCsv=require(_0x8978('0xf'));var querystring=require('querystring');var Papa=require(_0x8978('0x10'));var Redis=require(_0x8978('0x11'));var authService=require(_0x8978('0x12'));var qs=require(_0x8978('0x13'));var as=require(_0x8978('0x14'));var hardwareService=require(_0x8978('0x15'));var logger=require(_0x8978('0x16'))(_0x8978('0x17'));var utils=require(_0x8978('0x18'));var config=require(_0x8978('0x19'));var licenseUtil=require(_0x8978('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x106aa2,_0x39e1d2){_0x39e1d2=_0x39e1d2||0xcc;return function(_0x9d3140){if(_0x9d3140){return _0x106aa2['sendStatus'](_0x39e1d2);}return _0x106aa2[_0x8978('0x1b')](_0x39e1d2)[_0x8978('0x1c')]();};}function respondWithResult(_0x43deef,_0x4e7d48){_0x4e7d48=_0x4e7d48||0xc8;return function(_0x8ce215){if(_0x8ce215){return _0x43deef[_0x8978('0x1b')](_0x4e7d48)['json'](_0x8ce215);}};}function respondWithFilteredResult(_0x2eff35,_0x2fb17d){return function(_0x3e1e9c){if(_0x3e1e9c){var _0x244f57=typeof _0x2fb17d[_0x8978('0x1d')]===_0x8978('0x1e')&&typeof _0x2fb17d[_0x8978('0x1f')]===_0x8978('0x1e');var _0x479a60=_0x3e1e9c[_0x8978('0x20')];var _0x5b65c7=_0x244f57?0x0:_0x2fb17d[_0x8978('0x1d')];var _0x52cd18=_0x244f57?_0x3e1e9c[_0x8978('0x20')]:_0x2fb17d[_0x8978('0x1d')]+_0x2fb17d[_0x8978('0x1f')];var _0x5ec7ec;if(_0x52cd18>=_0x479a60){_0x52cd18=_0x479a60;_0x5ec7ec=0xc8;}else{_0x5ec7ec=0xce;}_0x2eff35['status'](_0x5ec7ec);return _0x2eff35[_0x8978('0x21')](_0x8978('0x22'),_0x5b65c7+'-'+_0x52cd18+'/'+_0x479a60)['json'](_0x3e1e9c);}return null;};}function patchUpdates(_0x2a7666){return function(_0x165f58){try{jsonpatch[_0x8978('0x23')](_0x165f58,_0x2a7666,!![]);}catch(_0x2c13b3){return BPromise['reject'](_0x2c13b3);}return _0x165f58[_0x8978('0x24')]();};}function saveUpdates(_0x5c9998,_0x33a5d7){return function(_0xa98e86){if(_0xa98e86){return _0xa98e86[_0x8978('0x25')](_0x5c9998)[_0x8978('0x26')](function(_0x2569e2){return _0x2569e2;});}return null;};}function removeEntity(_0x2a430c,_0x145bb7){return function(_0x1b7758){if(_0x1b7758){return _0x1b7758[_0x8978('0x27')]()[_0x8978('0x26')](function(){_0x2a430c[_0x8978('0x1b')](0xcc)[_0x8978('0x1c')]();});}};}function handleEntityNotFound(_0x4c49fe,_0x46785b){return function(_0xda73b4){if(!_0xda73b4){_0x4c49fe[_0x8978('0x28')](0x194);}return _0xda73b4;};}function handleError(_0x226715,_0x1fb755){_0x1fb755=_0x1fb755||0x1f4;return function(_0x71a77b){logger[_0x8978('0x29')](_0x71a77b[_0x8978('0x2a')]);if(_0x71a77b['name']){delete _0x71a77b[_0x8978('0x2b')];}_0x226715[_0x8978('0x1b')](_0x1fb755)[_0x8978('0x2c')](_0x71a77b);};}exports[_0x8978('0x2d')]=function(_0x1f212c,_0x4e4250){var _0x350b15={},_0x231501={},_0x4c74c7={'count':0x0,'rows':[]};var _0x57b8a4=_[_0x8978('0x2e')](db['AnalyticTreeReport']['rawAttributes'],function(_0x2dc634){return{'name':_0x2dc634[_0x8978('0x2f')],'type':_0x2dc634['type'][_0x8978('0x30')]};});_0x231501[_0x8978('0x31')]=_[_0x8978('0x2e')](_0x57b8a4,_0x8978('0x2b'));_0x231501[_0x8978('0x32')]=_[_0x8978('0x33')](_0x1f212c[_0x8978('0x32')]);_0x231501[_0x8978('0x34')]=_['intersection'](_0x231501[_0x8978('0x31')],_0x231501[_0x8978('0x32')]);_0x350b15[_0x8978('0x35')]=_['intersection'](_0x231501['model'],qs[_0x8978('0x36')](_0x1f212c['query'][_0x8978('0x36')]));_0x350b15[_0x8978('0x35')]=_0x350b15['attributes'][_0x8978('0x37')]?_0x350b15[_0x8978('0x35')]:_0x231501[_0x8978('0x31')];if(!_0x1f212c['query'][_0x8978('0x38')](_0x8978('0x39'))){_0x350b15[_0x8978('0x1f')]=qs[_0x8978('0x1f')](_0x1f212c[_0x8978('0x32')][_0x8978('0x1f')]);_0x350b15[_0x8978('0x1d')]=qs[_0x8978('0x1d')](_0x1f212c[_0x8978('0x32')][_0x8978('0x1d')]);}_0x350b15['order']=qs[_0x8978('0x3a')](_0x1f212c[_0x8978('0x32')]['sort']);_0x350b15['where']=qs[_0x8978('0x34')](_[_0x8978('0x3b')](_0x1f212c[_0x8978('0x32')],_0x231501[_0x8978('0x34')]),_0x57b8a4);if(_0x1f212c['query']['filter']){_0x350b15[_0x8978('0x3c')]=_['merge'](_0x350b15['where'],{'$or':_['map'](_0x57b8a4,function(_0xd4d885){if(_0xd4d885[_0x8978('0x3d')]!==_0x8978('0x3e')){var _0xf03683={};_0xf03683[_0xd4d885[_0x8978('0x2b')]]={'$like':'%'+_0x1f212c[_0x8978('0x32')][_0x8978('0x3f')]+'%'};return _0xf03683;}})});}_0x350b15=_[_0x8978('0x40')]({},_0x350b15,_0x1f212c[_0x8978('0x41')]);var _0x22ef6c={'where':_0x350b15['where']};return db['AnalyticTreeReport'][_0x8978('0x20')](_0x22ef6c)[_0x8978('0x26')](function(_0x131b0e){_0x4c74c7['count']=_0x131b0e;if(_0x1f212c[_0x8978('0x32')][_0x8978('0x42')]){_0x350b15[_0x8978('0x43')]=[{'all':!![]}];}return db[_0x8978('0x44')][_0x8978('0x45')](_0x350b15);})[_0x8978('0x26')](function(_0x3301f7){_0x4c74c7[_0x8978('0x46')]=_0x3301f7;return _0x4c74c7;})['then'](respondWithFilteredResult(_0x4e4250,_0x350b15))['catch'](handleError(_0x4e4250,null));};exports[_0x8978('0x47')]=function(_0x4d4d3e,_0x4d7ccf){var _0x53fcfe={'raw':!![],'where':{'id':_0x4d4d3e[_0x8978('0x48')]['id']}},_0x4972c1={};_0x4972c1[_0x8978('0x31')]=_[_0x8978('0x33')](db[_0x8978('0x44')][_0x8978('0x49')]);_0x4972c1[_0x8978('0x32')]=_[_0x8978('0x33')](_0x4d4d3e[_0x8978('0x32')]);_0x4972c1[_0x8978('0x34')]=_['intersection'](_0x4972c1[_0x8978('0x31')],_0x4972c1['query']);_0x53fcfe[_0x8978('0x35')]=_[_0x8978('0x4a')](_0x4972c1[_0x8978('0x31')],qs[_0x8978('0x36')](_0x4d4d3e[_0x8978('0x32')]['fields']));_0x53fcfe[_0x8978('0x35')]=_0x53fcfe[_0x8978('0x35')][_0x8978('0x37')]?_0x53fcfe[_0x8978('0x35')]:_0x4972c1[_0x8978('0x31')];if(_0x4d4d3e[_0x8978('0x32')][_0x8978('0x42')]){_0x53fcfe[_0x8978('0x43')]=[{'all':!![]}];}_0x53fcfe=_['merge']({},_0x53fcfe,_0x4d4d3e[_0x8978('0x41')]);return db[_0x8978('0x44')][_0x8978('0x4b')](_0x53fcfe)['then'](handleEntityNotFound(_0x4d7ccf,null))['then'](respondWithResult(_0x4d7ccf,null))['catch'](handleError(_0x4d7ccf,null));};exports[_0x8978('0x4c')]=function(_0x193827,_0x236eca){return db['AnalyticTreeReport'][_0x8978('0x4c')](_0x193827[_0x8978('0x4d')],{})[_0x8978('0x26')](respondWithResult(_0x236eca,0xc9))['catch'](handleError(_0x236eca,null));};exports[_0x8978('0x25')]=function(_0x3933be,_0x7a070b){if(_0x3933be['body']['id']){delete _0x3933be[_0x8978('0x4d')]['id'];}return db['AnalyticTreeReport'][_0x8978('0x4b')]({'where':{'id':_0x3933be['params']['id']}})[_0x8978('0x26')](handleEntityNotFound(_0x7a070b,null))[_0x8978('0x26')](saveUpdates(_0x3933be['body'],null))['then'](respondWithResult(_0x7a070b,null))[_0x8978('0x4e')](handleError(_0x7a070b,null));};exports[_0x8978('0x27')]=function(_0x587579,_0x3fda7e){return db[_0x8978('0x44')][_0x8978('0x4b')]({'where':{'id':_0x587579[_0x8978('0x48')]['id']}})[_0x8978('0x26')](handleEntityNotFound(_0x3fda7e,null))[_0x8978('0x26')](removeEntity(_0x3fda7e,null))['catch'](handleError(_0x3fda7e,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 818426c..8391aef 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 _0x0617=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x1b1948,_0x49f451){var _0x3cbd38=function(_0x2ca4f2){while(--_0x2ca4f2){_0x1b1948['push'](_0x1b1948['shift']());}};_0x3cbd38(++_0x49f451);}(_0x0617,0xcb));var _0x7061=function(_0x365d9a,_0x6b8d5f){_0x365d9a=_0x365d9a-0x0;var _0x54161d=_0x0617[_0x365d9a];return _0x54161d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7061('0x0'))(_0x7061('0x1'));var moment=require(_0x7061('0x2'));var BPromise=require(_0x7061('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7061('0x4'));var rimraf=require('rimraf');var config=require(_0x7061('0x5'));var attributes=require(_0x7061('0x6'));module[_0x7061('0x7')]=function(_0x55fe55,_0xe7c0de){return _0x55fe55[_0x7061('0x8')](_0x7061('0x9'),attributes,{'tableName':_0x7061('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad91=['analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x10acb2,_0x3ca870){var _0x186379=function(_0x294bbd){while(--_0x294bbd){_0x10acb2['push'](_0x10acb2['shift']());}};_0x186379(++_0x3ca870);}(_0xad91,0x105));var _0x1ad9=function(_0x1c46c5,_0x41bc70){_0x1c46c5=_0x1c46c5-0x0;var _0x4e403c=_0xad91[_0x1c46c5];return _0x4e403c;};'use strict';var _=require(_0x1ad9('0x0'));var util=require(_0x1ad9('0x1'));var logger=require(_0x1ad9('0x2'))(_0x1ad9('0x3'));var moment=require('moment');var BPromise=require(_0x1ad9('0x4'));var rp=require(_0x1ad9('0x5'));var fs=require('fs');var path=require(_0x1ad9('0x6'));var rimraf=require(_0x1ad9('0x7'));var config=require('../../config/environment');var attributes=require(_0x1ad9('0x8'));module[_0x1ad9('0x9')]=function(_0x22f6a6,_0x96d8fb){return _0x22f6a6[_0x1ad9('0xa')](_0x1ad9('0xb'),attributes,{'tableName':_0x1ad9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index d3c9ea4..f5c38c4 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x49b30e,_0x30f431){var _0x4af321=function(_0x6c4fd9){while(--_0x6c4fd9){_0x49b30e['push'](_0x49b30e['shift']());}};_0x4af321(++_0x30f431);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x5096e5,_0x4d0c54){var _0x23dd95=function(_0x26b0cf){while(--_0x26b0cf){_0x5096e5['push'](_0x5096e5['shift']());}};_0x23dd95(++_0x4d0c54);}(_0xdb28,0x106));var _0x8db2=function(_0x19abee,_0x54372e){_0x19abee=_0x19abee-0x0;var _0x23c7bd=_0xdb28[_0x19abee];return _0x23c7bd;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 480e2b4..88fb65b 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 _0xdb59=['get','isAuthenticated','/:id','post','put','update','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xdb59,0xda));var _0x9db5=function(_0x44d3d7,_0x1c6356){_0x44d3d7=_0x44d3d7-0x0;var _0x1886c0=_0xdb59[_0x44d3d7];return _0x1886c0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9db5('0x0'));var express=require(_0x9db5('0x1'));var router=express['Router']();var fs_extra=require(_0x9db5('0x2'));var auth=require(_0x9db5('0x3'));var interaction=require(_0x9db5('0x4'));var config=require(_0x9db5('0x5'));var controller=require(_0x9db5('0x6'));router[_0x9db5('0x7')]('/',auth[_0x9db5('0x8')](),controller['index']);router[_0x9db5('0x7')](_0x9db5('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9db5('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9db5('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x9db5('0xc')]);router['delete'](_0x9db5('0x9'),auth[_0x9db5('0x8')](),controller[_0x9db5('0xd')]);module[_0x9db5('0xe')]=router; \ No newline at end of file +var _0x2dc7=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2dc7,0x96));var _0x72dc=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x2dc7[_0x43a37c];return _0x5d1d40;};'use strict';var multer=require(_0x72dc('0x0'));var util=require(_0x72dc('0x1'));var path=require(_0x72dc('0x2'));var timeout=require(_0x72dc('0x3'));var express=require(_0x72dc('0x4'));var router=express[_0x72dc('0x5')]();var fs_extra=require(_0x72dc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x72dc('0x7'));var config=require(_0x72dc('0x8'));var controller=require(_0x72dc('0x9'));router['get']('/',auth[_0x72dc('0xa')](),controller[_0x72dc('0xb')]);router['get'](_0x72dc('0xc'),auth[_0x72dc('0xa')](),controller['show']);router[_0x72dc('0xd')]('/',auth[_0x72dc('0xa')](),controller['create']);router[_0x72dc('0xe')](_0x72dc('0xc'),auth[_0x72dc('0xa')](),controller[_0x72dc('0xf')]);router[_0x72dc('0x10')](_0x72dc('0xc'),auth[_0x72dc('0xa')](),controller[_0x72dc('0x11')]);module[_0x72dc('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index bfea402..841a945 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 _0xff98=['exports','STRING'];(function(_0x386f0a,_0x3b084a){var _0x32ffa0=function(_0x4cdefd){while(--_0x4cdefd){_0x386f0a['push'](_0x386f0a['shift']());}};_0x32ffa0(++_0x3b084a);}(_0xff98,0x9c));var _0x8ff9=function(_0xdb5d5a,_0x5c857e){_0xdb5d5a=_0xdb5d5a-0x0;var _0x426c3b=_0xff98[_0xdb5d5a];return _0x426c3b;};'use strict';var Sequelize=require('sequelize');module[_0x8ff9('0x0')]={'name':{'type':Sequelize[_0x8ff9('0x1')]},'basename':{'type':Sequelize[_0x8ff9('0x1')]},'type':{'type':Sequelize[_0x8ff9('0x1')]}}; \ No newline at end of file +var _0xea70=['STRING','sequelize','exports'];(function(_0x5d6806,_0x54f344){var _0x21adb5=function(_0x4448f5){while(--_0x4448f5){_0x5d6806['push'](_0x5d6806['shift']());}};_0x21adb5(++_0x54f344);}(_0xea70,0x175));var _0x0ea7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xea70[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x0ea7('0x0'));module[_0x0ea7('0x1')]={'name':{'type':Sequelize[_0x0ea7('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0ea7('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index acbceeb..69edd05 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 _0x280b=['nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','clone','params','get','omit','body','createdAt','create','find','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','update','then','destroy','sendStatus','name','send','index','Attachment','type','key','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x3a428d,_0x4f6232){var _0x1fb723=function(_0x554a39){while(--_0x554a39){_0x3a428d['push'](_0x3a428d['shift']());}};_0x1fb723(++_0x4f6232);}(_0x280b,0x180));var _0xb280=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x280b[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0xb280('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb280('0x1'));var jsonpatch=require(_0xb280('0x2'));var rp=require(_0xb280('0x3'));var moment=require(_0xb280('0x4'));var BPromise=require(_0xb280('0x5'));var Mustache=require('mustache');var util=require(_0xb280('0x6'));var path=require(_0xb280('0x7'));var sox=require(_0xb280('0x8'));var csv=require(_0xb280('0x9'));var ejs=require(_0xb280('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb280('0xb'));var squel=require(_0xb280('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb280('0x9'));var querystring=require(_0xb280('0xd'));var Papa=require('papaparse');var Redis=require(_0xb280('0xe'));var authService=require(_0xb280('0xf'));var qs=require(_0xb280('0x10'));var as=require(_0xb280('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb280('0x12'))('api');var utils=require(_0xb280('0x13'));var config=require(_0xb280('0x14'));var licenseUtil=require(_0xb280('0x15'));var db=require(_0xb280('0x16'))['db'];function respondWithStatusCode(_0x28c187,_0x1f8e42){_0x1f8e42=_0x1f8e42||0xcc;return function(_0x275188){if(_0x275188){return _0x28c187['sendStatus'](_0x1f8e42);}return _0x28c187[_0xb280('0x17')](_0x1f8e42)[_0xb280('0x18')]();};}function respondWithResult(_0x348798,_0x30134a){_0x30134a=_0x30134a||0xc8;return function(_0x5597ad){if(_0x5597ad){return _0x348798[_0xb280('0x17')](_0x30134a)['json'](_0x5597ad);}};}function respondWithFilteredResult(_0x195575,_0x5e097c){return function(_0x29f14e){if(_0x29f14e){var _0x30f276=typeof _0x5e097c[_0xb280('0x19')]===_0xb280('0x1a')&&typeof _0x5e097c['limit']===_0xb280('0x1a');var _0x414adf=_0x29f14e[_0xb280('0x1b')];var _0x1aef67=_0x30f276?0x0:_0x5e097c[_0xb280('0x19')];var _0x253b5e=_0x30f276?_0x29f14e[_0xb280('0x1b')]:_0x5e097c[_0xb280('0x19')]+_0x5e097c[_0xb280('0x1c')];var _0xc9b5a1;if(_0x253b5e>=_0x414adf){_0x253b5e=_0x414adf;_0xc9b5a1=0xc8;}else{_0xc9b5a1=0xce;}_0x195575[_0xb280('0x17')](_0xc9b5a1);return _0x195575[_0xb280('0x1d')]('Content-Range',_0x1aef67+'-'+_0x253b5e+'/'+_0x414adf)[_0xb280('0x1e')](_0x29f14e);}return null;};}function patchUpdates(_0x38e20e){return function(_0x37e5c2){try{jsonpatch[_0xb280('0x1f')](_0x37e5c2,_0x38e20e,!![]);}catch(_0x10a24d){return BPromise[_0xb280('0x20')](_0x10a24d);}return _0x37e5c2['save']();};}function saveUpdates(_0x559a80,_0x3eabd9){return function(_0x47734c){if(_0x47734c){return _0x47734c[_0xb280('0x21')](_0x559a80)[_0xb280('0x22')](function(_0x25a56d){return _0x25a56d;});}return null;};}function removeEntity(_0x2eb5fe,_0x5e9eae){return function(_0x57b37c){if(_0x57b37c){return _0x57b37c[_0xb280('0x23')]()[_0xb280('0x22')](function(){_0x2eb5fe[_0xb280('0x17')](0xcc)[_0xb280('0x18')]();});}};}function handleEntityNotFound(_0x12ae73,_0x440f4b){return function(_0x44d03c){if(!_0x44d03c){_0x12ae73[_0xb280('0x24')](0x194);}return _0x44d03c;};}function handleError(_0x548676,_0x449bc9){_0x449bc9=_0x449bc9||0x1f4;return function(_0x45f937){logger['error'](_0x45f937['stack']);if(_0x45f937[_0xb280('0x25')]){delete _0x45f937[_0xb280('0x25')];}_0x548676[_0xb280('0x17')](_0x449bc9)[_0xb280('0x26')](_0x45f937);};}exports[_0xb280('0x27')]=function(_0x2ca5ef,_0xcb9ce8){var _0x27a475={},_0xb94030={},_0x440cf1={'count':0x0,'rows':[]};var _0x58b5c8=_['map'](db[_0xb280('0x28')]['rawAttributes'],function(_0x27274b){return{'name':_0x27274b['fieldName'],'type':_0x27274b[_0xb280('0x29')][_0xb280('0x2a')]};});_0xb94030['model']=_['map'](_0x58b5c8,_0xb280('0x25'));_0xb94030[_0xb280('0x2b')]=_[_0xb280('0x2c')](_0x2ca5ef[_0xb280('0x2b')]);_0xb94030[_0xb280('0x2d')]=_[_0xb280('0x2e')](_0xb94030[_0xb280('0x2f')],_0xb94030[_0xb280('0x2b')]);_0x27a475[_0xb280('0x30')]=_['intersection'](_0xb94030['model'],qs[_0xb280('0x31')](_0x2ca5ef[_0xb280('0x2b')][_0xb280('0x31')]));_0x27a475[_0xb280('0x30')]=_0x27a475[_0xb280('0x30')][_0xb280('0x32')]?_0x27a475[_0xb280('0x30')]:_0xb94030[_0xb280('0x2f')];if(!_0x2ca5ef['query']['hasOwnProperty'](_0xb280('0x33'))){_0x27a475[_0xb280('0x1c')]=qs['limit'](_0x2ca5ef[_0xb280('0x2b')][_0xb280('0x1c')]);_0x27a475['offset']=qs['offset'](_0x2ca5ef['query'][_0xb280('0x19')]);}_0x27a475[_0xb280('0x34')]=qs[_0xb280('0x35')](_0x2ca5ef[_0xb280('0x2b')][_0xb280('0x35')]);_0x27a475[_0xb280('0x36')]=qs['filters'](_[_0xb280('0x37')](_0x2ca5ef['query'],_0xb94030[_0xb280('0x2d')]),_0x58b5c8);if(_0x2ca5ef['query'][_0xb280('0x38')]){_0x27a475[_0xb280('0x36')]=_[_0xb280('0x39')](_0x27a475[_0xb280('0x36')],{'$or':_[_0xb280('0x3a')](_0x58b5c8,function(_0x2787f8){if(_0x2787f8[_0xb280('0x29')]!==_0xb280('0x3b')){var _0xe6a22e={};_0xe6a22e[_0x2787f8[_0xb280('0x25')]]={'$like':'%'+_0x2ca5ef[_0xb280('0x2b')]['filter']+'%'};return _0xe6a22e;}})});}_0x27a475=_[_0xb280('0x39')]({},_0x27a475,_0x2ca5ef[_0xb280('0x3c')]);var _0x5cd98c={'where':_0x27a475[_0xb280('0x36')]};return db[_0xb280('0x28')][_0xb280('0x1b')](_0x5cd98c)[_0xb280('0x22')](function(_0x5bf59a){_0x440cf1[_0xb280('0x1b')]=_0x5bf59a;if(_0x2ca5ef['query'][_0xb280('0x3d')]){_0x27a475[_0xb280('0x3e')]=[{'all':!![]}];}return db[_0xb280('0x28')][_0xb280('0x3f')](_0x27a475);})[_0xb280('0x22')](function(_0x430921){_0x440cf1[_0xb280('0x40')]=_0x430921;return _0x440cf1;})[_0xb280('0x22')](respondWithFilteredResult(_0xcb9ce8,_0x27a475))[_0xb280('0x41')](handleError(_0xcb9ce8,null));};exports['show']=function(_0x5dd0cc,_0x2c7831){var _0x11d412={'raw':!![],'where':{'id':_0x5dd0cc['params']['id']}},_0x5b7501={};_0x5b7501[_0xb280('0x2f')]=_['keys'](db[_0xb280('0x28')][_0xb280('0x42')]);_0x5b7501[_0xb280('0x2b')]=_[_0xb280('0x2c')](_0x5dd0cc[_0xb280('0x2b')]);_0x5b7501[_0xb280('0x2d')]=_[_0xb280('0x2e')](_0x5b7501[_0xb280('0x2f')],_0x5b7501['query']);_0x11d412[_0xb280('0x30')]=_[_0xb280('0x2e')](_0x5b7501['model'],qs[_0xb280('0x31')](_0x5dd0cc['query'][_0xb280('0x31')]));_0x11d412[_0xb280('0x30')]=_0x11d412['attributes'][_0xb280('0x32')]?_0x11d412[_0xb280('0x30')]:_0x5b7501[_0xb280('0x2f')];if(_0x5dd0cc['query'][_0xb280('0x3d')]){_0x11d412[_0xb280('0x3e')]=[{'all':!![]}];}_0x11d412=_['merge']({},_0x11d412,_0x5dd0cc['options']);return db['Attachment']['find'](_0x11d412)[_0xb280('0x22')](handleEntityNotFound(_0x2c7831,null))[_0xb280('0x22')](respondWithResult(_0x2c7831,null))['catch'](handleError(_0x2c7831,null));};exports[_0xb280('0x43')]=function(_0xe4ff86,_0x25a7cc){var _0x5bd341={'where':{'id':_0xe4ff86[_0xb280('0x44')]['id']}},_0x80f81e={};_0x80f81e[_0xb280('0x2f')]=_[_0xb280('0x2c')](db[_0xb280('0x28')][_0xb280('0x42')]);_0x5bd341['attributes']=_[_0xb280('0x2e')](_0x80f81e[_0xb280('0x2f')],qs[_0xb280('0x31')](_0xe4ff86[_0xb280('0x2b')][_0xb280('0x31')]));_0x5bd341[_0xb280('0x30')]=_0x5bd341[_0xb280('0x30')][_0xb280('0x32')]?_0x5bd341[_0xb280('0x30')]:_0x80f81e['model'];if(_0xe4ff86[_0xb280('0x2b')][_0xb280('0x3d')]){_0x5bd341[_0xb280('0x3e')]=[{'all':!![]}];}_0x5bd341=_[_0xb280('0x39')]({},_0x5bd341,_0xe4ff86['options']);return db[_0xb280('0x28')]['find'](_0x5bd341)[_0xb280('0x22')](handleEntityNotFound(_0x25a7cc,null))[_0xb280('0x22')](function(_0x845a9b){if(_0x845a9b){var _0x1085b6=_0x845a9b[_0xb280('0x45')]({'plain':!![]});_0x1085b6=qs[_0xb280('0x46')](_0x1085b6,['id','createdAt','updatedAt']);_0xe4ff86[_0xb280('0x47')]=_[_0xb280('0x46')](_0xe4ff86['body'],['id',_0xb280('0x48'),'updatedAt']);return db['Attachment'][_0xb280('0x49')](_[_0xb280('0x39')](_0x1085b6,_0xe4ff86[_0xb280('0x47')]),{'include':_0xe4ff86[_0xb280('0x2b')][_0xb280('0x3d')]?[{'all':!![]}]:undefined});}})[_0xb280('0x22')](respondWithResult(_0x25a7cc,0xc9))[_0xb280('0x41')](handleError(_0x25a7cc,null));};exports['update']=function(_0x7fdb22,_0x32468a){if(_0x7fdb22[_0xb280('0x47')]['id']){delete _0x7fdb22[_0xb280('0x47')]['id'];}return db[_0xb280('0x28')][_0xb280('0x4a')]({'where':{'id':_0x7fdb22[_0xb280('0x44')]['id']}})[_0xb280('0x22')](handleEntityNotFound(_0x32468a,null))[_0xb280('0x22')](saveUpdates(_0x7fdb22['body'],null))[_0xb280('0x22')](respondWithResult(_0x32468a,null))['catch'](handleError(_0x32468a,null));};exports['destroy']=function(_0x3b1339,_0x55df54){return db[_0xb280('0x28')][_0xb280('0x4a')]({'where':{'id':_0x3b1339[_0xb280('0x44')]['id']}})[_0xb280('0x22')](handleEntityNotFound(_0x55df54,null))['then'](removeEntity(_0x55df54,null))[_0xb280('0x41')](handleError(_0x55df54,null));};exports[_0xb280('0x49')]=function(_0x5d0dfd,_0x1485c0,_0x7baf2a){_0x5d0dfd[_0xb280('0x47')][_0xb280('0x25')]=_0x5d0dfd['file'][_0xb280('0x4b')];_0x5d0dfd[_0xb280('0x47')][_0xb280('0x4c')]=_0x5d0dfd[_0xb280('0x4d')][_0xb280('0x4e')];_0x5d0dfd[_0xb280('0x47')]['type']=_0x5d0dfd[_0xb280('0x4d')][_0xb280('0x4f')];return db[_0xb280('0x28')][_0xb280('0x49')](_0x5d0dfd[_0xb280('0x47')])[_0xb280('0x22')](respondWithResult(_0x1485c0,0xc9))[_0xb280('0x41')](handleError(_0x1485c0,null));};exports[_0xb280('0x50')]=function(_0x863481,_0x435675,_0x28f28c){return db[_0xb280('0x28')][_0xb280('0x51')]({'where':{'id':_0x863481[_0xb280('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x435675,null))[_0xb280('0x22')](function(_0x54f53b){if(_0x54f53b){var _0x9f5e75=_0x54f53b[_0xb280('0x52')]!==null;var _0x5b35de=path[_0xb280('0x53')](config[_0xb280('0x54')],_0xb280('0x55'));if(_0x9f5e75){_0x5b35de=path[_0xb280('0x53')](_0x5b35de,_0xb280('0x56'));}var _0xca1404=path[_0xb280('0x53')](_0x5b35de,_0x54f53b[_0xb280('0x4c')]);return _0x435675[_0xb280('0x50')](_0xca1404);}})[_0xb280('0x41')](handleError(_0x435675,null));}; \ No newline at end of file +var _0x72e9=['show','params','find','clone','merge','get','updatedAt','body','createdAt','create','file','basename','filename','mimetype','ChatOfflineMessageId','join','root','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','apply','reject','update','then','destroy','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','where','pick','filters','filter','includeAll','include','findAll','rows','catch'];(function(_0x3d50a7,_0x1f6705){var _0x4017ef=function(_0x20b7d6){while(--_0x20b7d6){_0x3d50a7['push'](_0x3d50a7['shift']());}};_0x4017ef(++_0x1f6705);}(_0x72e9,0xbb));var _0x972e=function(_0x3e197b,_0x36ba95){_0x3e197b=_0x3e197b-0x0;var _0x3ba301=_0x72e9[_0x3e197b];return _0x3ba301;};'use strict';var emlformat=require(_0x972e('0x0'));var rimraf=require(_0x972e('0x1'));var zipdir=require(_0x972e('0x2'));var jsonpatch=require(_0x972e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x972e('0x4'));var Mustache=require(_0x972e('0x5'));var util=require(_0x972e('0x6'));var path=require(_0x972e('0x7'));var sox=require(_0x972e('0x8'));var csv=require(_0x972e('0x9'));var ejs=require(_0x972e('0xa'));var fs=require('fs');var fs_extra=require(_0x972e('0xb'));var _=require(_0x972e('0xc'));var squel=require(_0x972e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x972e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x972e('0xf'));var Papa=require(_0x972e('0x10'));var Redis=require('ioredis');var authService=require(_0x972e('0x11'));var qs=require(_0x972e('0x12'));var as=require(_0x972e('0x13'));var hardwareService=require(_0x972e('0x14'));var logger=require(_0x972e('0x15'))(_0x972e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x972e('0x17'))['db'];function respondWithStatusCode(_0x30f33e,_0x3d87c9){_0x3d87c9=_0x3d87c9||0xcc;return function(_0x5c5f11){if(_0x5c5f11){return _0x30f33e[_0x972e('0x18')](_0x3d87c9);}return _0x30f33e['status'](_0x3d87c9)[_0x972e('0x19')]();};}function respondWithResult(_0x3c1378,_0x403fb2){_0x403fb2=_0x403fb2||0xc8;return function(_0x479353){if(_0x479353){return _0x3c1378[_0x972e('0x1a')](_0x403fb2)[_0x972e('0x1b')](_0x479353);}};}function respondWithFilteredResult(_0x3557f8,_0x238908){return function(_0x1f595d){if(_0x1f595d){var _0x2e7440=typeof _0x238908['offset']===_0x972e('0x1c')&&typeof _0x238908[_0x972e('0x1d')]===_0x972e('0x1c');var _0x5e0d9e=_0x1f595d['count'];var _0x4f7575=_0x2e7440?0x0:_0x238908[_0x972e('0x1e')];var _0xa91f61=_0x2e7440?_0x1f595d[_0x972e('0x1f')]:_0x238908[_0x972e('0x1e')]+_0x238908[_0x972e('0x1d')];var _0x3fcc75;if(_0xa91f61>=_0x5e0d9e){_0xa91f61=_0x5e0d9e;_0x3fcc75=0xc8;}else{_0x3fcc75=0xce;}_0x3557f8[_0x972e('0x1a')](_0x3fcc75);return _0x3557f8['set']('Content-Range',_0x4f7575+'-'+_0xa91f61+'/'+_0x5e0d9e)[_0x972e('0x1b')](_0x1f595d);}return null;};}function patchUpdates(_0x231254){return function(_0x54cd66){try{jsonpatch[_0x972e('0x20')](_0x54cd66,_0x231254,!![]);}catch(_0x46388c){return BPromise[_0x972e('0x21')](_0x46388c);}return _0x54cd66['save']();};}function saveUpdates(_0x2753b2,_0xcd8afa){return function(_0x52876c){if(_0x52876c){return _0x52876c[_0x972e('0x22')](_0x2753b2)[_0x972e('0x23')](function(_0x23e4e6){return _0x23e4e6;});}return null;};}function removeEntity(_0x178c2c,_0x1b2194){return function(_0x8f32cd){if(_0x8f32cd){return _0x8f32cd[_0x972e('0x24')]()[_0x972e('0x23')](function(){_0x178c2c[_0x972e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fbed0,_0x46ca0b){return function(_0x456a6c){if(!_0x456a6c){_0x1fbed0[_0x972e('0x18')](0x194);}return _0x456a6c;};}function handleError(_0x190fc4,_0x258961){_0x258961=_0x258961||0x1f4;return function(_0x4a4164){logger[_0x972e('0x25')](_0x4a4164[_0x972e('0x26')]);if(_0x4a4164[_0x972e('0x27')]){delete _0x4a4164[_0x972e('0x27')];}_0x190fc4['status'](_0x258961)[_0x972e('0x28')](_0x4a4164);};}exports[_0x972e('0x29')]=function(_0x229894,_0x3d62df){var _0x203466={},_0x41bc44={},_0x319917={'count':0x0,'rows':[]};var _0x519d25=_['map'](db[_0x972e('0x2a')][_0x972e('0x2b')],function(_0x2098a3){return{'name':_0x2098a3[_0x972e('0x2c')],'type':_0x2098a3[_0x972e('0x2d')]['key']};});_0x41bc44[_0x972e('0x2e')]=_[_0x972e('0x2f')](_0x519d25,_0x972e('0x27'));_0x41bc44[_0x972e('0x30')]=_[_0x972e('0x31')](_0x229894['query']);_0x41bc44['filters']=_[_0x972e('0x32')](_0x41bc44[_0x972e('0x2e')],_0x41bc44['query']);_0x203466[_0x972e('0x33')]=_[_0x972e('0x32')](_0x41bc44['model'],qs[_0x972e('0x34')](_0x229894[_0x972e('0x30')]['fields']));_0x203466[_0x972e('0x33')]=_0x203466[_0x972e('0x33')][_0x972e('0x35')]?_0x203466['attributes']:_0x41bc44['model'];if(!_0x229894['query']['hasOwnProperty'](_0x972e('0x36'))){_0x203466[_0x972e('0x1d')]=qs[_0x972e('0x1d')](_0x229894[_0x972e('0x30')][_0x972e('0x1d')]);_0x203466[_0x972e('0x1e')]=qs[_0x972e('0x1e')](_0x229894[_0x972e('0x30')][_0x972e('0x1e')]);}_0x203466[_0x972e('0x37')]=qs['sort'](_0x229894['query']['sort']);_0x203466[_0x972e('0x38')]=qs['filters'](_[_0x972e('0x39')](_0x229894[_0x972e('0x30')],_0x41bc44[_0x972e('0x3a')]),_0x519d25);if(_0x229894[_0x972e('0x30')][_0x972e('0x3b')]){_0x203466[_0x972e('0x38')]=_['merge'](_0x203466[_0x972e('0x38')],{'$or':_[_0x972e('0x2f')](_0x519d25,function(_0x1051d7){if(_0x1051d7[_0x972e('0x2d')]!=='VIRTUAL'){var _0x123783={};_0x123783[_0x1051d7[_0x972e('0x27')]]={'$like':'%'+_0x229894[_0x972e('0x30')][_0x972e('0x3b')]+'%'};return _0x123783;}})});}_0x203466=_['merge']({},_0x203466,_0x229894['options']);var _0x256509={'where':_0x203466['where']};return db['Attachment'][_0x972e('0x1f')](_0x256509)[_0x972e('0x23')](function(_0x2ee097){_0x319917[_0x972e('0x1f')]=_0x2ee097;if(_0x229894['query'][_0x972e('0x3c')]){_0x203466[_0x972e('0x3d')]=[{'all':!![]}];}return db[_0x972e('0x2a')][_0x972e('0x3e')](_0x203466);})[_0x972e('0x23')](function(_0xdf5eb7){_0x319917[_0x972e('0x3f')]=_0xdf5eb7;return _0x319917;})[_0x972e('0x23')](respondWithFilteredResult(_0x3d62df,_0x203466))[_0x972e('0x40')](handleError(_0x3d62df,null));};exports[_0x972e('0x41')]=function(_0x445fa1,_0x1c6b89){var _0x2a6160={'raw':!![],'where':{'id':_0x445fa1[_0x972e('0x42')]['id']}},_0x2ed4ef={};_0x2ed4ef['model']=_[_0x972e('0x31')](db[_0x972e('0x2a')][_0x972e('0x2b')]);_0x2ed4ef[_0x972e('0x30')]=_[_0x972e('0x31')](_0x445fa1['query']);_0x2ed4ef['filters']=_['intersection'](_0x2ed4ef['model'],_0x2ed4ef[_0x972e('0x30')]);_0x2a6160[_0x972e('0x33')]=_[_0x972e('0x32')](_0x2ed4ef['model'],qs[_0x972e('0x34')](_0x445fa1[_0x972e('0x30')][_0x972e('0x34')]));_0x2a6160['attributes']=_0x2a6160['attributes'][_0x972e('0x35')]?_0x2a6160[_0x972e('0x33')]:_0x2ed4ef['model'];if(_0x445fa1[_0x972e('0x30')][_0x972e('0x3c')]){_0x2a6160[_0x972e('0x3d')]=[{'all':!![]}];}_0x2a6160=_['merge']({},_0x2a6160,_0x445fa1['options']);return db[_0x972e('0x2a')][_0x972e('0x43')](_0x2a6160)[_0x972e('0x23')](handleEntityNotFound(_0x1c6b89,null))['then'](respondWithResult(_0x1c6b89,null))[_0x972e('0x40')](handleError(_0x1c6b89,null));};exports[_0x972e('0x44')]=function(_0x3445ec,_0x475f25){var _0xa6b13f={'where':{'id':_0x3445ec[_0x972e('0x42')]['id']}},_0x21bdf9={};_0x21bdf9[_0x972e('0x2e')]=_[_0x972e('0x31')](db[_0x972e('0x2a')]['rawAttributes']);_0xa6b13f[_0x972e('0x33')]=_[_0x972e('0x32')](_0x21bdf9[_0x972e('0x2e')],qs[_0x972e('0x34')](_0x3445ec[_0x972e('0x30')]['fields']));_0xa6b13f[_0x972e('0x33')]=_0xa6b13f['attributes'][_0x972e('0x35')]?_0xa6b13f[_0x972e('0x33')]:_0x21bdf9['model'];if(_0x3445ec[_0x972e('0x30')][_0x972e('0x3c')]){_0xa6b13f['include']=[{'all':!![]}];}_0xa6b13f=_[_0x972e('0x45')]({},_0xa6b13f,_0x3445ec['options']);return db['Attachment'][_0x972e('0x43')](_0xa6b13f)[_0x972e('0x23')](handleEntityNotFound(_0x475f25,null))[_0x972e('0x23')](function(_0x5e3e3c){if(_0x5e3e3c){var _0x4a860d=_0x5e3e3c[_0x972e('0x46')]({'plain':!![]});_0x4a860d=qs['omit'](_0x4a860d,['id','createdAt',_0x972e('0x47')]);_0x3445ec['body']=_['omit'](_0x3445ec[_0x972e('0x48')],['id',_0x972e('0x49'),'updatedAt']);return db['Attachment'][_0x972e('0x4a')](_[_0x972e('0x45')](_0x4a860d,_0x3445ec[_0x972e('0x48')]),{'include':_0x3445ec[_0x972e('0x30')][_0x972e('0x3c')]?[{'all':!![]}]:undefined});}})[_0x972e('0x23')](respondWithResult(_0x475f25,0xc9))['catch'](handleError(_0x475f25,null));};exports[_0x972e('0x22')]=function(_0x3bd1ad,_0x144ec8){if(_0x3bd1ad[_0x972e('0x48')]['id']){delete _0x3bd1ad[_0x972e('0x48')]['id'];}return db[_0x972e('0x2a')][_0x972e('0x43')]({'where':{'id':_0x3bd1ad[_0x972e('0x42')]['id']}})[_0x972e('0x23')](handleEntityNotFound(_0x144ec8,null))[_0x972e('0x23')](saveUpdates(_0x3bd1ad[_0x972e('0x48')],null))['then'](respondWithResult(_0x144ec8,null))[_0x972e('0x40')](handleError(_0x144ec8,null));};exports[_0x972e('0x24')]=function(_0xd6084,_0x3bedc8){return db['Attachment'][_0x972e('0x43')]({'where':{'id':_0xd6084[_0x972e('0x42')]['id']}})[_0x972e('0x23')](handleEntityNotFound(_0x3bedc8,null))[_0x972e('0x23')](removeEntity(_0x3bedc8,null))[_0x972e('0x40')](handleError(_0x3bedc8,null));};exports[_0x972e('0x4a')]=function(_0x270339,_0x250dc4,_0x1b22fb){_0x270339['body'][_0x972e('0x27')]=_0x270339[_0x972e('0x4b')]['originalname'];_0x270339['body'][_0x972e('0x4c')]=_0x270339[_0x972e('0x4b')][_0x972e('0x4d')];_0x270339['body'][_0x972e('0x2d')]=_0x270339[_0x972e('0x4b')][_0x972e('0x4e')];return db['Attachment'][_0x972e('0x4a')](_0x270339[_0x972e('0x48')])[_0x972e('0x23')](respondWithResult(_0x250dc4,0xc9))['catch'](handleError(_0x250dc4,null));};exports['download']=function(_0x3919d8,_0x2fb3f7,_0x4e8e75){return db[_0x972e('0x2a')]['findOne']({'where':{'id':_0x3919d8[_0x972e('0x42')]['id']},'raw':!![]})[_0x972e('0x23')](handleEntityNotFound(_0x2fb3f7,null))['then'](function(_0x375323){if(_0x375323){var _0x4e6843=_0x375323[_0x972e('0x4f')]!==null;var _0x5a5ac0=path[_0x972e('0x50')](config[_0x972e('0x51')],'server/files/attachments/');if(_0x4e6843){_0x5a5ac0=path[_0x972e('0x50')](_0x5a5ac0,_0x972e('0x52'));}var _0x284c6d=path['join'](_0x5a5ac0,_0x375323[_0x972e('0x4c')]);return _0x2fb3f7[_0x972e('0x53')](_0x284c6d);}})[_0x972e('0x40')](handleError(_0x2fb3f7,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 9ae68aa..1281382 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 _0x7611=['rimraf','./attachment.attributes','exports','define','attachments','lodash','util','../../config/logger','api','moment'];(function(_0x3eb2f4,_0x51516a){var _0x59fb19=function(_0x1ed9d9){while(--_0x1ed9d9){_0x3eb2f4['push'](_0x3eb2f4['shift']());}};_0x59fb19(++_0x51516a);}(_0x7611,0xaf));var _0x1761=function(_0x925658,_0x35e35d){_0x925658=_0x925658-0x0;var _0x2b9837=_0x7611[_0x925658];return _0x2b9837;};'use strict';var _=require(_0x1761('0x0'));var util=require(_0x1761('0x1'));var logger=require(_0x1761('0x2'))(_0x1761('0x3'));var moment=require(_0x1761('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1761('0x5'));var config=require('../../config/environment');var attributes=require(_0x1761('0x6'));module[_0x1761('0x7')]=function(_0x95a1ed,_0x39d234){return _0x95a1ed[_0x1761('0x8')]('Attachment',attributes,{'tableName':_0x1761('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a11=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','lodash','util','../../config/logger'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x1a11,0x99));var _0x11a1=function(_0x5d9ab8,_0x18d257){_0x5d9ab8=_0x5d9ab8-0x0;var _0x533d5c=_0x1a11[_0x5d9ab8];return _0x533d5c;};'use strict';var _=require(_0x11a1('0x0'));var util=require(_0x11a1('0x1'));var logger=require(_0x11a1('0x2'))(_0x11a1('0x3'));var moment=require(_0x11a1('0x4'));var BPromise=require(_0x11a1('0x5'));var rp=require(_0x11a1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x11a1('0x7'));var config=require(_0x11a1('0x8'));var attributes=require(_0x11a1('0x9'));module[_0x11a1('0xa')]=function(_0x5e4906,_0x224847){return _0x5e4906[_0x11a1('0xb')](_0x11a1('0xc'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 13bf39c..514c35a 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 _0x04d0=['../../mysqldb','rpc','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','moment','bluebird','randomstring','ioredis'];(function(_0x2f965f,_0x100aca){var _0x73f2b9=function(_0x25705d){while(--_0x25705d){_0x2f965f['push'](_0x2f965f['shift']());}};_0x73f2b9(++_0x100aca);}(_0x04d0,0x10a));var _0x004d=function(_0x27d1a1,_0x252378){_0x27d1a1=_0x27d1a1-0x0;var _0x1225ad=_0x04d0[_0x27d1a1];return _0x1225ad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x004d('0x0'));var BPromise=require(_0x004d('0x1'));var rs=require(_0x004d('0x2'));var fs=require('fs');var Redis=require(_0x004d('0x3'));var db=require(_0x004d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x004d('0x5'));var config=require('../../config/environment');var jayson=require(_0x004d('0x6'));var client=jayson[_0x004d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36e8bd,_0x2da158,_0x4d0ae4){return new BPromise(function(_0x1f0efd,_0x58d4f5){return client[_0x004d('0x8')](_0x36e8bd,_0x4d0ae4)[_0x004d('0x9')](function(_0x2d9da5){logger['info'](_0x004d('0xa'),_0x2da158,_0x004d('0xb'));logger['debug'](_0x004d('0xc'),_0x2da158,'request\x20sent',JSON[_0x004d('0xd')](_0x2d9da5));if(_0x2d9da5[_0x004d('0xe')]){if(_0x2d9da5['error'][_0x004d('0xf')]===0x1f4){logger['error'](_0x004d('0xa'),_0x2da158,_0x2d9da5[_0x004d('0xe')][_0x004d('0x10')]);return _0x58d4f5(_0x2d9da5[_0x004d('0xe')][_0x004d('0x10')]);}logger[_0x004d('0xe')](_0x004d('0xa'),_0x2da158,_0x2d9da5[_0x004d('0xe')]['message']);return _0x1f0efd(_0x2d9da5[_0x004d('0xe')][_0x004d('0x10')]);}else{logger[_0x004d('0x11')](_0x004d('0xa'),_0x2da158,_0x004d('0xb'));_0x1f0efd(_0x2d9da5[_0x004d('0x12')][_0x004d('0x10')]);}})[_0x004d('0x13')](function(_0x5b4f40){logger[_0x004d('0xe')](_0x004d('0xa'),_0x2da158,_0x5b4f40);_0x58d4f5(_0x5b4f40);});});}exports[_0x004d('0x14')]=function(_0x4b3912){var _0x1adf2a=this;return new Promise(function(_0x583196,_0x40de7e){return db[_0x004d('0x15')][_0x004d('0x16')](_0x4b3912[_0x004d('0x17')],{'raw':_0x4b3912['options']?_0x4b3912[_0x004d('0x18')][_0x004d('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x31ac5c){logger[_0x004d('0x11')](_0x004d('0x14'),_0x4b3912);logger[_0x004d('0x1a')]('CreateAttachment',_0x4b3912,JSON[_0x004d('0xd')](_0x31ac5c));_0x583196(_0x31ac5c);})[_0x004d('0x13')](function(_0x2da052){logger[_0x004d('0xe')](_0x004d('0x14'),_0x2da052[_0x004d('0x10')],_0x4b3912);_0x40de7e(_0x1adf2a[_0x004d('0xe')](0x1f4,_0x2da052[_0x004d('0x10')]));});});}; \ No newline at end of file +var _0xb43b=['raw','then','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Attachment,\x20%s,\x20%s','catch','CreateAttachment','Attachment','create','options'];(function(_0xac8c71,_0x26de55){var _0x2fbac1=function(_0x59e466){while(--_0x59e466){_0xac8c71['push'](_0xac8c71['shift']());}};_0x2fbac1(++_0x26de55);}(_0xb43b,0x1b2));var _0xbb43=function(_0x49b487,_0x27137c){_0x49b487=_0x49b487-0x0;var _0x1e04f1=_0xb43b[_0x49b487];return _0x1e04f1;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('Attachment,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('Attachment,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('Attachment,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}exports[_0xbb43('0x15')]=function(_0x2e3b43){var _0x55dd73=this;return new Promise(function(_0x1c16d7,_0x4f28b8){return db[_0xbb43('0x16')][_0xbb43('0x17')](_0x2e3b43['body'],{'raw':_0x2e3b43['options']?_0x2e3b43[_0xbb43('0x18')][_0xbb43('0x19')]===undefined?!![]:![]:!![]})[_0xbb43('0x1a')](function(_0x2bf2d4){logger['info'](_0xbb43('0x15'),_0x2e3b43);logger['debug'](_0xbb43('0x15'),_0x2e3b43,JSON['stringify'](_0x2bf2d4));_0x1c16d7(_0x2bf2d4);})[_0xbb43('0x14')](function(_0x565256){logger[_0xbb43('0x10')](_0xbb43('0x15'),_0x565256['message'],_0x2e3b43);_0x4f28b8(_0x55dd73[_0xbb43('0x10')](0x1f4,_0x565256['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 2b44543..fb30a56 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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x15ccd9,_0x51a714){var _0x1bd6f3=function(_0x17cc0d){while(--_0x17cc0d){_0x15ccd9['push'](_0x15ccd9['shift']());}};_0x1bd6f3(++_0x51a714);}(_0x757a,0xde));var _0xa757=function(_0xd6c5fa,_0x39d0e3){_0xd6c5fa=_0xd6c5fa-0x0;var _0x35d2a1=_0x757a[_0xd6c5fa];return _0x35d2a1;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x14ca6e,_0x3cc76a){var _0x3fa76a=function(_0x3bde0b){while(--_0x3bde0b){_0x14ca6e['push'](_0x14ca6e['shift']());}};_0x3fa76a(++_0x3cc76a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3b1082,_0x223695){_0x3b1082=_0x3b1082-0x0;var _0x296714=_0x5f2f[_0x3b1082];return _0x296714;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 63a3aec..ffe3dd2 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa994=['../../config/logger','api','activedirectory','undefined','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','salt','role','disabled','blocked','online','admin','user','domain','blockedAt','add','minutes','clearBlockUser','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','password','passport-local','moment','activedirectory2','bluebird','../../components/auth/service','../../config/utils','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa994,0x150));var _0x4a99=function(_0x2d4963,_0x430e5f){_0x2d4963=_0x2d4963-0x0;var _0x3caa5f=_0xa994[_0x2d4963];return _0x3caa5f;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x4a99('0x0'))['Strategy'];var moment=require(_0x4a99('0x1'));var ActiveDirectory=require(_0x4a99('0x2'));var BPromise=require(_0x4a99('0x3'));var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0x4a99('0x4'));var utils=require(_0x4a99('0x5'));var config=require(_0x4a99('0x6'));var logger=require(_0x4a99('0x7'))(_0x4a99('0x8'));function isActiveDirectoryConfigured(_0x4a0718){var _0x1d03b0=![];if(typeof _0x4a0718[_0x4a99('0x9')]!==_0x4a99('0xa')){_0x1d03b0=_0x4a0718[_0x4a99('0x9')][_0x4a99('0xb')]&&_0x4a0718['activedirectory'][_0x4a99('0xc')]&&_0x4a0718[_0x4a99('0x9')]['domain'];}return _0x1d03b0;}function adAuthenticate(_0xb9ae0b,_0x42b04d,_0x38b46e){return new BPromise(function(_0x2c9291,_0x37ce9b){try{var _0xb6082f=new ActiveDirectory(_0xb9ae0b);_0xb6082f[_0x4a99('0xd')](_0x42b04d,_0x38b46e,function(_0x317ab6,_0xf737c8){if(_0x317ab6){logger[_0x4a99('0xe')](_0x4a99('0xf'),_0x42b04d,util[_0x4a99('0x10')](_0x317ab6,{'showHidden':![],'depth':null}));_0x37ce9b(_0x4a99('0x11'));}else if(!_0xf737c8){logger[_0x4a99('0xe')](_0x4a99('0x12'),_0x42b04d);_0x37ce9b(_0x4a99('0x11'));}else{_0x2c9291(_0xf737c8);}});}catch(_0x450525){_0x37ce9b(_0x450525);}});}function ActiveDirectoryAuthenticate(_0x83eed8,_0x3712bd,_0x4668db,_0x225f5a){var _0x6c53da,_0x1d7861;if(!isActiveDirectoryConfigured(config)){logger[_0x4a99('0xe')](_0x4a99('0x13'),_0x3712bd);return _0x225f5a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x4a99('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0x4a99('0x15'),_0x4a99('0x16')],'raw':!![]})[_0x4a99('0x17')](function(_0x3e8f8c){_0x6c53da=_0x3e8f8c;if(!_0x6c53da[_0x4a99('0x15')]){logger[_0x4a99('0xe')](_0x4a99('0x18'),_0x3712bd);throw new Error(_0x4a99('0x11'));}return _0x83eed8[_0x4a99('0x19')]({'attributes':['id',_0x4a99('0x1a'),'password',_0x4a99('0x1b'),_0x4a99('0x1c'),_0x4a99('0x1d'),_0x4a99('0x1e'),'blockedAt',_0x4a99('0x1f')],'where':{'name':_0x3712bd,'role':{'$or':[_0x4a99('0x20'),_0x4a99('0x21'),'agent']},'adSsoEnabled':!![]}});})[_0x4a99('0x17')](function(_0x4ef9bc){if(!_0x4ef9bc||_0x4ef9bc&&_0x4ef9bc[_0x4a99('0x1a')]!==_0x3712bd){throw new Error(_0x4a99('0x11'));}_0x1d7861=_0x4ef9bc;var _0x337f64=_0x1d7861[_0x4a99('0x1a')]+'@'+config['activedirectory'][_0x4a99('0x22')];return adAuthenticate(config[_0x4a99('0x9')],_0x337f64,_0x4668db);})[_0x4a99('0x17')](function(_0x16bb62){if(_0x1d7861[_0x4a99('0x1d')]){throw new Error(_0x4a99('0x11'));}if(_0x6c53da['blockDuration']>0x0){if(_0x1d7861[_0x4a99('0x1e')]){if(moment(_0x1d7861[_0x4a99('0x23')])[_0x4a99('0x24')](_0x6c53da[_0x4a99('0x16')],_0x4a99('0x25'))>moment()){throw new Error(_0x4a99('0x11'));}return utils[_0x4a99('0x26')](_0x1d7861,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1d7861);})['then'](function(){return _0x225f5a(null,_0x1d7861);});}else{return utils[_0x4a99('0x27')](_0x1d7861)[_0x4a99('0x17')](function(){return _0x225f5a(null,_0x1d7861);});}}else{return utils[_0x4a99('0x27')](_0x1d7861)[_0x4a99('0x17')](function(){return _0x225f5a(null,_0x1d7861);});}})[_0x4a99('0x28')](function(_0x35a67e){return _0x225f5a(null,![],_0x35a67e);});}function handleError(_0x63d9f7,_0x429529,_0x41a01c){return _0x63d9f7['status'](_0x429529||0x1f4)[_0x4a99('0x29')]({'message':_0x41a01c?_0x41a01c[_0x4a99('0x2a')]||_0x41a01c:''});}exports[_0x4a99('0x2b')]=function(_0x45e34f,_0x552851,_0x1e0b64){passport['authenticate'](_0x4a99('0x2c'),function(_0x16f7e8,_0x1e85bc,_0x21b4a3){var _0x4e3670=_0x16f7e8||_0x21b4a3;if(_0x4e3670){return handleError(_0x552851,0x191,_0x4e3670);}if(!_0x1e85bc){return handleError(_0x552851,0x194,{'message':_0x4a99('0x2d')});}else{var _0x325608={'payload':{'id':_0x1e85bc['id'],'role':_0x1e85bc['role']},'options':{'expiresIn':0x15180}};return authService[_0x4a99('0x2e')](_0x325608)[_0x4a99('0x17')](function(_0x423696){_0x552851['json']({'id':_0x1e85bc['id'],'token':_0x423696,'statusCall':'','isAlreadyLogged':_0x1e85bc[_0x4a99('0x1f')]});});}})(_0x45e34f,_0x552851,_0x1e0b64);};passport[_0x4a99('0x2f')](_0x4a99('0x2c'),new LocalStrategy({'usernameField':_0x4a99('0x1a'),'passwordField':_0x4a99('0x30')},function(_0x1ba1a1,_0x30b58a,_0x53cb41){return ActiveDirectoryAuthenticate(db['User'],_0x1ba1a1,_0x30b58a,_0x53cb41);})); \ No newline at end of file +var _0x7f52=['online','admin','user','agent','add','minutes','clearBlockUser','then','getLicense','catch','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','User','passport','passport-local','Strategy','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blocked','blockedAt'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x7f52,0x1cc));var _0x27f5=function(_0x51486a,_0x250856){_0x51486a=_0x51486a-0x0;var _0x7756d9=_0x7f52[_0x51486a];return _0x7756d9;};'use strict';var passport=require(_0x27f5('0x0'));var LocalStrategy=require(_0x27f5('0x1'))[_0x27f5('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x27f5('0x3'));var util=require(_0x27f5('0x4'));var db=require(_0x27f5('0x5'))['db'];var authService=require(_0x27f5('0x6'));var utils=require(_0x27f5('0x7'));var config=require(_0x27f5('0x8'));var logger=require('../../config/logger')(_0x27f5('0x9'));function isActiveDirectoryConfigured(_0xe0e8c3){var _0x57aca7=![];if(typeof _0xe0e8c3[_0x27f5('0xa')]!==_0x27f5('0xb')){_0x57aca7=_0xe0e8c3['activedirectory'][_0x27f5('0xc')]&&_0xe0e8c3[_0x27f5('0xa')][_0x27f5('0xd')]&&_0xe0e8c3[_0x27f5('0xa')][_0x27f5('0xe')];}return _0x57aca7;}function adAuthenticate(_0x19d7b5,_0x681fbc,_0xf7fe12){return new BPromise(function(_0x105ae5,_0x3f2d23){try{var _0x103fdb=new ActiveDirectory(_0x19d7b5);_0x103fdb[_0x27f5('0xf')](_0x681fbc,_0xf7fe12,function(_0x5cdbf2,_0x5cd642){if(_0x5cdbf2){logger[_0x27f5('0x10')](_0x27f5('0x11'),_0x681fbc,util[_0x27f5('0x12')](_0x5cdbf2,{'showHidden':![],'depth':null}));_0x3f2d23(_0x27f5('0x13'));}else if(!_0x5cd642){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x681fbc);_0x3f2d23(_0x27f5('0x13'));}else{_0x105ae5(_0x5cd642);}});}catch(_0x4b3a95){_0x3f2d23(_0x4b3a95);}});}function ActiveDirectoryAuthenticate(_0x338020,_0x52027a,_0x4dabd2,_0xf7830e){var _0xcc2e59,_0x486ffa;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x52027a);return _0xf7830e(null,![],{'message':_0x27f5('0x13')});}return db['Setting'][_0x27f5('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x27f5('0x15')],'raw':!![]})['then'](function(_0x492a34){_0xcc2e59=_0x492a34;if(!_0xcc2e59[_0x27f5('0x16')]){logger[_0x27f5('0x10')](_0x27f5('0x17'),_0x52027a);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x338020[_0x27f5('0x14')]({'attributes':['id',_0x27f5('0x18'),_0x27f5('0x19'),_0x27f5('0x1a'),'role',_0x27f5('0x1b'),_0x27f5('0x1c'),_0x27f5('0x1d'),_0x27f5('0x1e')],'where':{'name':_0x52027a,'role':{'$or':[_0x27f5('0x1f'),_0x27f5('0x20'),_0x27f5('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x307fcc){if(!_0x307fcc||_0x307fcc&&_0x307fcc[_0x27f5('0x18')]!==_0x52027a){throw new Error(_0x27f5('0x13'));}_0x486ffa=_0x307fcc;var _0x284433=_0x486ffa[_0x27f5('0x18')]+'@'+config['activedirectory'][_0x27f5('0xe')];return adAuthenticate(config['activedirectory'],_0x284433,_0x4dabd2);})['then'](function(_0x2c9960){if(_0x486ffa['disabled']){throw new Error(_0x27f5('0x13'));}if(_0xcc2e59[_0x27f5('0x15')]>0x0){if(_0x486ffa[_0x27f5('0x1c')]){if(moment(_0x486ffa[_0x27f5('0x1d')])[_0x27f5('0x22')](_0xcc2e59[_0x27f5('0x15')],_0x27f5('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x27f5('0x24')](_0x486ffa,0x0,![],null)[_0x27f5('0x25')](function(){return utils[_0x27f5('0x26')](_0x486ffa);})[_0x27f5('0x25')](function(){return _0xf7830e(null,_0x486ffa);});}else{return utils[_0x27f5('0x26')](_0x486ffa)['then'](function(){return _0xf7830e(null,_0x486ffa);});}}else{return utils[_0x27f5('0x26')](_0x486ffa)[_0x27f5('0x25')](function(){return _0xf7830e(null,_0x486ffa);});}})[_0x27f5('0x27')](function(_0x5c9eb7){return _0xf7830e(null,![],_0x5c9eb7);});}function handleError(_0x54c352,_0x1c5781,_0x8b041c){return _0x54c352['status'](_0x1c5781||0x1f4)[_0x27f5('0x28')]({'message':_0x8b041c?_0x8b041c[_0x27f5('0x29')]||_0x8b041c:''});}exports[_0x27f5('0x2a')]=function(_0x572edf,_0x400fb5,_0x27ef78){passport['authenticate']('ad-login',function(_0x7bd30a,_0x443f15,_0x265067){var _0x264374=_0x7bd30a||_0x265067;if(_0x264374){return handleError(_0x400fb5,0x191,_0x264374);}if(!_0x443f15){return handleError(_0x400fb5,0x194,{'message':_0x27f5('0x2b')});}else{var _0x16dd14={'payload':{'id':_0x443f15['id'],'role':_0x443f15[_0x27f5('0x2c')]},'options':{'expiresIn':0x15180}};return authService[_0x27f5('0x2d')](_0x16dd14)['then'](function(_0x394048){_0x400fb5[_0x27f5('0x2e')]({'id':_0x443f15['id'],'token':_0x394048,'statusCall':'','isAlreadyLogged':_0x443f15[_0x27f5('0x1e')]});});}})(_0x572edf,_0x400fb5,_0x27ef78);};passport[_0x27f5('0x2f')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0x27f5('0x19')},function(_0x509400,_0xcb9087,_0x748660){return ActiveDirectoryAuthenticate(db[_0x27f5('0x30')],_0x509400,_0xcb9087,_0x748660);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 172ef51..cb9720e 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41fc=['./authActiveDirectory.controller','login','exports'];(function(_0x38c27e,_0x469e85){var _0x370bc6=function(_0x2f92f2){while(--_0x2f92f2){_0x38c27e['push'](_0x38c27e['shift']());}};_0x370bc6(++_0x469e85);}(_0x41fc,0x126));var _0xc41f=function(_0x6fbc58,_0x5a2cf1){_0x6fbc58=_0x6fbc58-0x0;var _0x266f48=_0x41fc[_0x6fbc58];return _0x266f48;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xc41f('0x0'));router['post']('/',controller[_0xc41f('0x1')]);module[_0xc41f('0x2')]=router; \ No newline at end of file +var _0x84c2=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x4e1ba7,_0x5311f2){var _0x145c84=function(_0x1b4788){while(--_0x1b4788){_0x4e1ba7['push'](_0x4e1ba7['shift']());}};_0x145c84(++_0x5311f2);}(_0x84c2,0x1a7));var _0x284c=function(_0x396552,_0x532a80){_0x396552=_0x396552-0x0;var _0xb63575=_0x84c2[_0x396552];return _0xb63575;};'use strict';var express=require(_0x284c('0x0'));var router=express[_0x284c('0x1')]();var controller=require(_0x284c('0x2'));router[_0x284c('0x3')]('/',controller[_0x284c('0x4')]);module[_0x284c('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 453381a..ce73e5b 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x7a54,0x106));var _0x47a5=function(_0x1c1193,_0x17c294){_0x1c1193=_0x1c1193-0x0;var _0x80047b=_0x7a54[_0x1c1193];return _0x80047b;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x213f91,_0x8f3782){var _0x5cf677=function(_0x469754){while(--_0x469754){_0x213f91['push'](_0x213f91['shift']());}};_0x5cf677(++_0x8f3782);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 095e9e5..8a15539 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 _0x43a1=['express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43a1,0x138));var _0x143a=function(_0x21aafd,_0x1f0fa6){_0x21aafd=_0x21aafd-0x0;var _0x9f2800=_0x43a1[_0x21aafd];return _0x9f2800;};'use strict';var express=require(_0x143a('0x0'));var passport=require('passport');var router=express[_0x143a('0x1')]();var controller=require(_0x143a('0x2'));var userController=require(_0x143a('0x3'));var authService=require(_0x143a('0x4'));router[_0x143a('0x5')]('/',controller[_0x143a('0x6')]);router[_0x143a('0x5')](_0x143a('0x7'),controller[_0x143a('0x8')],authService[_0x143a('0x9')],userController[_0x143a('0x6')],authService[_0x143a('0xa')]);module[_0x143a('0xb')]=router; \ No newline at end of file +var _0x596c=['get','login','isMiddleware','setTokenCookie','exports','../user/user.controller.js'];(function(_0x5df033,_0x29458b){var _0x445829=function(_0x2c795b){while(--_0x2c795b){_0x5df033['push'](_0x5df033['shift']());}};_0x445829(++_0x29458b);}(_0x596c,0x1cd));var _0xc596=function(_0x55a177,_0x3fed1b){_0x55a177=_0x55a177-0x0;var _0x4196eb=_0x596c[_0x55a177];return _0x4196eb;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xc596('0x0'));var authService=require('../../components/auth/service');router[_0xc596('0x1')]('/',controller[_0xc596('0x2')]);router['get']('/callback',controller['callback'],authService[_0xc596('0x3')],userController['login'],authService[_0xc596('0x4')]);module[_0xc596('0x5')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index f178a99..37c0c8d 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 _0xb7a0=['stringify','status','login','local-login','signToken','json','online','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','blockedAt','resetPasswordExpires','save','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://','send','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','findOne','name','password','role','disabled','blocked','loginAttempts','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xb7a0,0x10c));var _0x0b7a=function(_0x330106,_0x4e50d9){_0x330106=_0x330106-0x0;var _0x492d1c=_0xb7a0[_0x330106];return _0x492d1c;};'use strict';var util=require(_0x0b7a('0x0'));var passport=require(_0x0b7a('0x1'));var LocalStrategy=require(_0x0b7a('0x2'))['Strategy'];var jayson=require(_0x0b7a('0x3'));var _=require(_0x0b7a('0x4'));var rs=require(_0x0b7a('0x5'));var moment=require(_0x0b7a('0x6'));var db=require(_0x0b7a('0x7'))['db'];var authService=require(_0x0b7a('0x8'));var utils=require(_0x0b7a('0x9'));var client=jayson[_0x0b7a('0xa')][_0x0b7a('0xb')]({'port':0x232b});function localAuthenticate(_0x6aa89b,_0x2b2f42,_0x1c32ec,_0x49b1a9){var _0x56b29a,_0x596961;return db[_0x0b7a('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x0b7a('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x10e314){_0x56b29a=_0x10e314;return _0x6aa89b[_0x0b7a('0xe')]({'attributes':['id',_0x0b7a('0xf'),_0x0b7a('0x10'),'salt',_0x0b7a('0x11'),_0x0b7a('0x12'),_0x0b7a('0x13'),'blockedAt',_0x0b7a('0x14')],'where':{'name':_0x2b2f42,'role':{'$or':['admin',_0x0b7a('0x15'),_0x0b7a('0x16')]}}});})[_0x0b7a('0x17')](function(_0x29dcee){if(!_0x29dcee||_0x29dcee&&_0x29dcee['name']!==_0x2b2f42){throw new Error(_0x0b7a('0x18'));}else{_0x596961=_0x29dcee;return _0x596961;}})[_0x0b7a('0x17')](function(){_0x596961[_0x0b7a('0x19')](_0x1c32ec,function(_0xdb3481,_0x5cc395){var _0x38e9b0=_0x596961[_0x0b7a('0x14')]+0x1;if(_0xdb3481){return _0x49b1a9(_0xdb3481);}else if(!_0x5cc395){if(_0x596961[_0x0b7a('0x12')]){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else if(_0x56b29a[_0x0b7a('0xd')]>0x0){if(_0x596961[_0x0b7a('0x13')]){if(_0x56b29a[_0x0b7a('0x1a')]>0x0){if(moment(_0x596961['blockedAt'])[_0x0b7a('0x1b')](_0x56b29a[_0x0b7a('0x1a')],'minutes')>moment()){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else{return utils[_0x0b7a('0x1c')](_0x596961,_0x38e9b0,![],null)['then'](function(){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});});}}else{return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}}else{if(_0x38e9b0>=_0x56b29a[_0x0b7a('0xd')]){return utils[_0x0b7a('0x1c')](_0x596961,0x0,!![],moment())['then'](function(){return _0x49b1a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x0b7a('0x1c')](_0x596961,_0x38e9b0,![],null)[_0x0b7a('0x17')](function(){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});});}}}else{return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}}else{if(_0x596961[_0x0b7a('0x12')]){return _0x49b1a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x56b29a[_0x0b7a('0xd')]>0x0){if(_0x596961[_0x0b7a('0x13')]){if(_0x56b29a[_0x0b7a('0x1a')]>0x0){if(moment(_0x596961['blockedAt'])['add'](_0x56b29a[_0x0b7a('0x1a')],_0x0b7a('0x1d'))>moment()){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else{return utils[_0x0b7a('0x1c')](_0x596961,0x0,![],null)[_0x0b7a('0x17')](function(){return utils[_0x0b7a('0x1e')](_0x596961);})[_0x0b7a('0x17')](function(){return _0x49b1a9(null,_0x596961);});}}else{return _0x49b1a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x0b7a('0x1c')](_0x596961,0x0,![],null)['then'](function(){return utils['getLicense'](_0x596961);})[_0x0b7a('0x17')](function(){return _0x49b1a9(null,_0x596961);})['catch'](function(_0x3221e8){return _0x49b1a9(null,![],_0x3221e8);});}}else{if(_0x596961[_0x0b7a('0x13')]){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else{return utils[_0x0b7a('0x1e')](_0x596961)[_0x0b7a('0x17')](function(){return _0x49b1a9(null,_0x596961);});}}}});})[_0x0b7a('0x1f')](function(_0x24f52f){return _0x49b1a9(null,![],_0x24f52f);});}function sendServiceMail(_0x3664a2){return db[_0x0b7a('0x20')][_0x0b7a('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0x0b7a('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x0b7a('0x23'),'include':[{'model':db[_0x0b7a('0x24')],'as':_0x0b7a('0x24')}]}]})[_0x0b7a('0x17')](function(_0x39a742){if(!_0x39a742){throw new Error(_0x0b7a('0x25'));}var _0x1f4e08=_0x39a742['getSmtpOptions']();var _0x55c0ee={'account':_0x1f4e08,'message':_['merge']({'from':util[_0x0b7a('0x26')](_0x0b7a('0x27'),_0x39a742[_0x0b7a('0xf')],_0x39a742['email']||_0x39a742[_0x0b7a('0x23')]['user'])},_0x3664a2)};return client['request'](_0x0b7a('0x28'),_0x55c0ee);})[_0x0b7a('0x17')](function(_0x2d127d){if(_0x2d127d[_0x0b7a('0x29')]){throw new Error(util[_0x0b7a('0x26')](_0x0b7a('0x2a'),_0x2d127d['error'][_0x0b7a('0x2b')]||JSON[_0x0b7a('0x2c')](_0x2d127d[_0x0b7a('0x29')])));}return!![];});}function handleError(_0x101b2c,_0x4605a1,_0x107f6c){return _0x101b2c[_0x0b7a('0x2d')](_0x4605a1||0x1f4)['send']({'message':_0x107f6c?_0x107f6c[_0x0b7a('0x2b')]||_0x107f6c:''});}exports[_0x0b7a('0x2e')]=function(_0x37f9ba,_0x12cd22,_0x4e37d9){passport[_0x0b7a('0x19')](_0x0b7a('0x2f'),function(_0x574d28,_0x14167c,_0x2c9388){var _0x11282d=_0x574d28||_0x2c9388;if(_0x11282d){return handleError(_0x12cd22,0x191,_0x11282d);}if(!_0x14167c){return handleError(_0x12cd22,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x116fa0={'payload':{'id':_0x14167c['id'],'role':_0x14167c[_0x0b7a('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x0b7a('0x30')](_0x116fa0)[_0x0b7a('0x17')](function(_0x147c2a){_0x12cd22[_0x0b7a('0x31')]({'id':_0x14167c['id'],'token':_0x147c2a,'statusCall':'','isAlreadyLogged':_0x14167c[_0x0b7a('0x32')]});});}})(_0x37f9ba,_0x12cd22,_0x4e37d9);};exports['forgot']=function(_0x4eb8f1,_0x219779){if(!_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')]){return handleError(_0x219779,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xff414a=rs[_0x0b7a('0x34')]();_0x4eb8f1[_0x0b7a('0x33')]['email']=_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')][_0x0b7a('0x35')]()['toLowerCase']();var _0x44f3a5;return db[_0x0b7a('0xc')][_0x0b7a('0xe')]({'where':{'id':0x1},'attributes':[_0x0b7a('0xd'),_0x0b7a('0x1a')],'raw':!![]})['then'](function(_0x37d0a1){_0x44f3a5=_0x37d0a1;return db[_0x0b7a('0x36')]['find']({'where':{'email':_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')]}});})['then'](function(_0x24d53e){if(!_0x24d53e){throw new Error(_0x0b7a('0x37'));}if(_0x24d53e['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x24d53e[_0x0b7a('0x13')]){if(moment(_0x24d53e['blockedAt'])[_0x0b7a('0x1b')](_0x44f3a5['blockDuration'],_0x0b7a('0x1d'))>moment()){throw new Error(_0x0b7a('0x38'));}else{_0x24d53e[_0x0b7a('0x13')]=![];_0x24d53e[_0x0b7a('0x39')]=null;}}_0x24d53e['resetPasswordToken']=_0xff414a;_0x24d53e[_0x0b7a('0x3a')]=Date['now']()+0x36ee80;return _0x24d53e[_0x0b7a('0x3b')]();})[_0x0b7a('0x17')](function(){return sendServiceMail({'to':_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x0b7a('0x3c')+_0x0b7a('0x3d')+_0x0b7a('0x3e')+_0x4eb8f1['headers']['host']+'/reset/'+_0xff414a+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x0b7a('0x17')](function(){_0x219779[_0x0b7a('0x2d')](0xc8)[_0x0b7a('0x3f')]({'message':'Reset\x20Email\x20sent!'});})[_0x0b7a('0x1f')](function(_0xf3d61d){return handleError(_0x219779,0x1f4,_0xf3d61d);});};exports[_0x0b7a('0x40')]=function(_0x32db6b,_0x5e99c2){return db[_0x0b7a('0x36')][_0x0b7a('0x21')]({'where':{'resetPasswordToken':_0x32db6b[_0x0b7a('0x41')][_0x0b7a('0x42')],'resetPasswordExpires':{'$gt':Date[_0x0b7a('0x43')]()}}})[_0x0b7a('0x17')](function(_0x13c8f0){if(!_0x13c8f0){throw new Error(_0x0b7a('0x44'));}return db[_0x0b7a('0xc')][_0x0b7a('0xe')]({'attributes':['id',_0x0b7a('0x45'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x0b7a('0x17')](function(_0x59ad57){if(_0x59ad57[_0x0b7a('0x45')])authService[_0x0b7a('0x46')](_0x32db6b[_0x0b7a('0x33')]['password']);if(!_0x59ad57[_0x0b7a('0x47')]||!_0x13c8f0[_0x0b7a('0x48')])return _0x13c8f0;authService[_0x0b7a('0x49')](_0x32db6b['body'][_0x0b7a('0x10')],_0x13c8f0[_0x0b7a('0x48')],_0x59ad57[_0x0b7a('0x4a')]);return _0x13c8f0;})[_0x0b7a('0x17')](function(){_0x13c8f0[_0x0b7a('0x10')]=_0x32db6b['body'][_0x0b7a('0x10')];_0x13c8f0[_0x0b7a('0x4b')]=null;_0x13c8f0[_0x0b7a('0x3a')]=null;return _0x13c8f0['save']();});})['then'](function(){_0x5e99c2[_0x0b7a('0x2d')](0xc8)[_0x0b7a('0x3f')]({'message':_0x0b7a('0x4c')});})['catch'](function(_0x2c1b85){return handleError(_0x5e99c2,0x1f4,_0x2c1b85);});};passport[_0x0b7a('0x4d')](_0x0b7a('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x561a3c,_0x4cfcde,_0x2ceddb){return localAuthenticate(db['User'],_0x561a3c,_0x4cfcde,_0x2ceddb);})); \ No newline at end of file +var _0x9d46=['format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','message','stringify','status','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','blockedAt','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','/reset/','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','loginAttempts','admin','user','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge'];(function(_0x34e29e,_0x3d6df5){var _0x4d0088=function(_0x317af6){while(--_0x317af6){_0x34e29e['push'](_0x34e29e['shift']());}};_0x4d0088(++_0x3d6df5);}(_0x9d46,0xe1));var _0x69d4=function(_0x17c92d,_0x571d35){_0x17c92d=_0x17c92d-0x0;var _0x2f26ba=_0x9d46[_0x17c92d];return _0x2f26ba;};'use strict';var util=require(_0x69d4('0x0'));var passport=require(_0x69d4('0x1'));var LocalStrategy=require(_0x69d4('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x69d4('0x3'));var rs=require(_0x69d4('0x4'));var moment=require('moment');var db=require(_0x69d4('0x5'))['db'];var authService=require(_0x69d4('0x6'));var utils=require(_0x69d4('0x7'));var client=jayson[_0x69d4('0x8')][_0x69d4('0x9')]({'port':0x232b});function localAuthenticate(_0x19db4c,_0x4bf4ab,_0x521088,_0x2205f8){var _0x2626ef,_0x47edc5;return db['Setting'][_0x69d4('0xa')]({'where':{'id':0x1},'attributes':[_0x69d4('0xb'),_0x69d4('0xc')],'raw':!![]})['then'](function(_0x13ec19){_0x2626ef=_0x13ec19;return _0x19db4c[_0x69d4('0xa')]({'attributes':['id','name',_0x69d4('0xd'),_0x69d4('0xe'),_0x69d4('0xf'),_0x69d4('0x10'),'blocked','blockedAt',_0x69d4('0x11')],'where':{'name':_0x4bf4ab,'role':{'$or':[_0x69d4('0x12'),_0x69d4('0x13'),_0x69d4('0x14')]}}});})[_0x69d4('0x15')](function(_0x206021){if(!_0x206021||_0x206021&&_0x206021[_0x69d4('0x16')]!==_0x4bf4ab){throw new Error(_0x69d4('0x17'));}else{_0x47edc5=_0x206021;return _0x47edc5;}})[_0x69d4('0x15')](function(){_0x47edc5['authenticate'](_0x521088,function(_0x325da1,_0x512639){var _0x3c1243=_0x47edc5['loginAttempts']+0x1;if(_0x325da1){return _0x2205f8(_0x325da1);}else if(!_0x512639){if(_0x47edc5[_0x69d4('0x10')]){return _0x2205f8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2626ef[_0x69d4('0xb')]>0x0){if(_0x47edc5[_0x69d4('0x18')]){if(_0x2626ef['blockDuration']>0x0){if(moment(_0x47edc5['blockedAt'])['add'](_0x2626ef[_0x69d4('0xc')],_0x69d4('0x19'))>moment()){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}else{return utils[_0x69d4('0x1a')](_0x47edc5,_0x3c1243,![],null)[_0x69d4('0x15')](function(){return _0x2205f8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}}else{if(_0x3c1243>=_0x2626ef[_0x69d4('0xb')]){return utils[_0x69d4('0x1a')](_0x47edc5,0x0,!![],moment())[_0x69d4('0x15')](function(){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});});}else{return utils[_0x69d4('0x1a')](_0x47edc5,_0x3c1243,![],null)[_0x69d4('0x15')](function(){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});});}}}else{return _0x2205f8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x47edc5[_0x69d4('0x10')]){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}else if(_0x2626ef[_0x69d4('0xb')]>0x0){if(_0x47edc5[_0x69d4('0x18')]){if(_0x2626ef[_0x69d4('0xc')]>0x0){if(moment(_0x47edc5['blockedAt'])['add'](_0x2626ef[_0x69d4('0xc')],_0x69d4('0x19'))>moment()){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}else{return utils['clearBlockUser'](_0x47edc5,0x0,![],null)[_0x69d4('0x15')](function(){return utils[_0x69d4('0x1b')](_0x47edc5);})['then'](function(){return _0x2205f8(null,_0x47edc5);});}}else{return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}}else{return utils['clearBlockUser'](_0x47edc5,0x0,![],null)['then'](function(){return utils[_0x69d4('0x1b')](_0x47edc5);})[_0x69d4('0x15')](function(){return _0x2205f8(null,_0x47edc5);})[_0x69d4('0x1c')](function(_0x2fb2e2){return _0x2205f8(null,![],_0x2fb2e2);});}}else{if(_0x47edc5[_0x69d4('0x18')]){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}else{return utils[_0x69d4('0x1b')](_0x47edc5)['then'](function(){return _0x2205f8(null,_0x47edc5);});}}}});})[_0x69d4('0x1c')](function(_0x108c49){return _0x2205f8(null,![],_0x108c49);});}function sendServiceMail(_0x3040bd){return db['MailAccount'][_0x69d4('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0x69d4('0x1e')],'include':[{'model':db[_0x69d4('0x1f')],'as':'Smtp','include':[{'model':db[_0x69d4('0x20')],'as':_0x69d4('0x20')}]}]})[_0x69d4('0x15')](function(_0x3d4e4a){if(!_0x3d4e4a){throw new Error(_0x69d4('0x21'));}var _0x4ebb7c=_0x3d4e4a[_0x69d4('0x22')]();var _0xe118d0={'account':_0x4ebb7c,'message':_[_0x69d4('0x23')]({'from':util[_0x69d4('0x24')](_0x69d4('0x25'),_0x3d4e4a[_0x69d4('0x16')],_0x3d4e4a[_0x69d4('0x1e')]||_0x3d4e4a[_0x69d4('0x26')]['user'])},_0x3040bd)};return client[_0x69d4('0x27')](_0x69d4('0x28'),_0xe118d0);})['then'](function(_0x192bd8){if(_0x192bd8[_0x69d4('0x29')]){throw new Error(util[_0x69d4('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x192bd8['error'][_0x69d4('0x2a')]||JSON[_0x69d4('0x2b')](_0x192bd8[_0x69d4('0x29')])));}return!![];});}function handleError(_0x4145f8,_0x508c63,_0x4e34b7){return _0x4145f8[_0x69d4('0x2c')](_0x508c63||0x1f4)['send']({'message':_0x4e34b7?_0x4e34b7[_0x69d4('0x2a')]||_0x4e34b7:''});}exports[_0x69d4('0x2d')]=function(_0x19dd84,_0x13adbb,_0x54b74e){passport[_0x69d4('0x2e')](_0x69d4('0x2f'),function(_0x323a9c,_0x1604f6,_0x411495){var _0x3f0f7d=_0x323a9c||_0x411495;if(_0x3f0f7d){return handleError(_0x13adbb,0x191,_0x3f0f7d);}if(!_0x1604f6){return handleError(_0x13adbb,0x194,{'message':_0x69d4('0x30')});}else{var _0x23859a={'payload':{'id':_0x1604f6['id'],'role':_0x1604f6[_0x69d4('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x69d4('0x31')](_0x23859a)[_0x69d4('0x15')](function(_0x4ef0a1){_0x13adbb[_0x69d4('0x32')]({'id':_0x1604f6['id'],'token':_0x4ef0a1,'statusCall':'','isAlreadyLogged':_0x1604f6[_0x69d4('0x33')]});});}})(_0x19dd84,_0x13adbb,_0x54b74e);};exports[_0x69d4('0x34')]=function(_0x18077e,_0x809a53){if(!_0x18077e[_0x69d4('0x35')][_0x69d4('0x1e')]){return handleError(_0x809a53,0x1f4,{'message':_0x69d4('0x36')});}var _0x5117b3=rs[_0x69d4('0x37')]();_0x18077e['body'][_0x69d4('0x1e')]=_0x18077e[_0x69d4('0x35')][_0x69d4('0x1e')][_0x69d4('0x38')]()[_0x69d4('0x39')]();var _0x2773b0;return db[_0x69d4('0x3a')][_0x69d4('0xa')]({'where':{'id':0x1},'attributes':[_0x69d4('0xb'),'blockDuration'],'raw':!![]})[_0x69d4('0x15')](function(_0x1e8b6f){_0x2773b0=_0x1e8b6f;return db[_0x69d4('0x3b')][_0x69d4('0x1d')]({'where':{'email':_0x18077e[_0x69d4('0x35')][_0x69d4('0x1e')]}});})[_0x69d4('0x15')](function(_0x1bba89){if(!_0x1bba89){throw new Error(_0x69d4('0x3c'));}if(_0x1bba89[_0x69d4('0x10')]){throw new Error(_0x69d4('0x3d'));}if(_0x1bba89['blocked']){if(moment(_0x1bba89[_0x69d4('0x3e')])[_0x69d4('0x3f')](_0x2773b0[_0x69d4('0xc')],_0x69d4('0x19'))>moment()){throw new Error(_0x69d4('0x40'));}else{_0x1bba89[_0x69d4('0x18')]=![];_0x1bba89[_0x69d4('0x3e')]=null;}}_0x1bba89[_0x69d4('0x41')]=_0x5117b3;_0x1bba89[_0x69d4('0x42')]=Date[_0x69d4('0x43')]()+0x36ee80;return _0x1bba89[_0x69d4('0x44')]();})[_0x69d4('0x15')](function(){return sendServiceMail({'to':_0x18077e[_0x69d4('0x35')][_0x69d4('0x1e')],'subject':_0x69d4('0x45'),'text':_0x69d4('0x46')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x18077e[_0x69d4('0x47')]['host']+_0x69d4('0x48')+_0x5117b3+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x69d4('0x15')](function(){_0x809a53[_0x69d4('0x2c')](0xc8)[_0x69d4('0x49')]({'message':_0x69d4('0x4a')});})['catch'](function(_0x3bd64b){return handleError(_0x809a53,0x1f4,_0x3bd64b);});};exports[_0x69d4('0x4b')]=function(_0x585e0d,_0x170f32){return db[_0x69d4('0x3b')][_0x69d4('0x1d')]({'where':{'resetPasswordToken':_0x585e0d[_0x69d4('0x4c')][_0x69d4('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x69d4('0x43')]()}}})[_0x69d4('0x15')](function(_0x3fa2d7){if(!_0x3fa2d7){throw new Error(_0x69d4('0x4e'));}return db['Setting'][_0x69d4('0xa')]({'attributes':['id',_0x69d4('0x4f'),'enforcePasswordHistory',_0x69d4('0x50')]})[_0x69d4('0x15')](function(_0x4237e0){if(_0x4237e0[_0x69d4('0x4f')])authService[_0x69d4('0x51')](_0x585e0d[_0x69d4('0x35')]['password']);if(!_0x4237e0[_0x69d4('0x52')]||!_0x3fa2d7['previousPasswords'])return _0x3fa2d7;authService[_0x69d4('0x53')](_0x585e0d[_0x69d4('0x35')][_0x69d4('0xd')],_0x3fa2d7[_0x69d4('0x54')],_0x4237e0[_0x69d4('0x50')]);return _0x3fa2d7;})['then'](function(){_0x3fa2d7[_0x69d4('0xd')]=_0x585e0d[_0x69d4('0x35')][_0x69d4('0xd')];_0x3fa2d7[_0x69d4('0x41')]=null;_0x3fa2d7[_0x69d4('0x42')]=null;return _0x3fa2d7['save']();});})[_0x69d4('0x15')](function(){_0x170f32[_0x69d4('0x2c')](0xc8)[_0x69d4('0x49')]({'message':_0x69d4('0x55')});})[_0x69d4('0x1c')](function(_0x4eebb9){return handleError(_0x170f32,0x1f4,_0x4eebb9);});};passport[_0x69d4('0x56')](_0x69d4('0x2f'),new LocalStrategy({'usernameField':_0x69d4('0x16'),'passwordField':_0x69d4('0xd')},function(_0x433b19,_0x2a007a,_0x883f2f){return localAuthenticate(db[_0x69d4('0x3b')],_0x433b19,_0x2a007a,_0x883f2f);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 21d45e5..66d9d6c 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 _0x2724=['Router','post','/forgot','forgot','reset','express'];(function(_0x36e492,_0x1d8453){var _0x4c8f23=function(_0x22978f){while(--_0x22978f){_0x36e492['push'](_0x36e492['shift']());}};_0x4c8f23(++_0x1d8453);}(_0x2724,0xe9));var _0x4272=function(_0xd42c57,_0x295663){_0xd42c57=_0xd42c57-0x0;var _0x43e989=_0x2724[_0xd42c57];return _0x43e989;};'use strict';var express=require(_0x4272('0x0'));var router=express[_0x4272('0x1')]();var controller=require('./authLocal.controller');router[_0x4272('0x2')]('/',controller['login']);router[_0x4272('0x2')](_0x4272('0x3'),controller[_0x4272('0x4')]);router[_0x4272('0x2')]('/reset/:token',controller[_0x4272('0x5')]);module['exports']=router; \ No newline at end of file +var _0x593a=['login','/forgot','forgot','reset','./authLocal.controller','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x593a,0x6a));var _0xa593=function(_0xf6842c,_0x5aaeb8){_0xf6842c=_0xf6842c-0x0;var _0x446268=_0x593a[_0xf6842c];return _0x446268;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xa593('0x0'));router[_0xa593('0x1')]('/',controller[_0xa593('0x2')]);router[_0xa593('0x1')](_0xa593('0x3'),controller[_0xa593('0x4')]);router[_0xa593('0x1')]('/reset/:token',controller[_0xa593('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 9c1e68b..556335f 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 _0x92b5=['STRING','INTEGER','exports'];(function(_0x41225c,_0x2c4c94){var _0xb75a5f=function(_0x5c34a0){while(--_0x5c34a0){_0x41225c['push'](_0x41225c['shift']());}};_0xb75a5f(++_0x2c4c94);}(_0x92b5,0x6b));var _0x592b=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x92b5[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require('sequelize');module[_0x592b('0x0')]={'name':{'type':Sequelize[_0x592b('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x592b('0x1')]},'description':{'type':Sequelize[_0x592b('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x592b('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xc02d=['sequelize','exports','STRING','INTEGER'];(function(_0x3c49b5,_0x2fce8e){var _0x146bc9=function(_0x5e4010){while(--_0x5e4010){_0x3c49b5['push'](_0x3c49b5['shift']());}};_0x146bc9(++_0x2fce8e);}(_0xc02d,0x1b0));var _0xdc02=function(_0x552516,_0x33e040){_0x552516=_0x552516-0x0;var _0x533b0a=_0xc02d[_0x552516];return _0x533b0a;};'use strict';var Sequelize=require(_0xdc02('0x0'));module[_0xdc02('0x1')]={'name':{'type':Sequelize[_0xdc02('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xdc02('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xdc02('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index b49400d..e5d7c6c 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 _0x687f=['index','Automation','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','find','addConditions','ids','omit','getConditions','findOne','pick','addActions','Action','getActions','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','save','update','then','destroy','stack','name','send'];(function(_0x2a3506,_0x4c72c2){var _0x268978=function(_0x365b64){while(--_0x365b64){_0x2a3506['push'](_0x2a3506['shift']());}};_0x268978(++_0x4c72c2);}(_0x687f,0x167));var _0xf687=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0x687f[_0x3ba422];return _0x20b5dd;};'use strict';var emlformat=require(_0xf687('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf687('0x1'));var rp=require(_0xf687('0x2'));var moment=require(_0xf687('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf687('0x4'));var util=require(_0xf687('0x5'));var path=require(_0xf687('0x6'));var sox=require(_0xf687('0x7'));var csv=require(_0xf687('0x8'));var ejs=require(_0xf687('0x9'));var fs=require('fs');var fs_extra=require(_0xf687('0xa'));var _=require(_0xf687('0xb'));var squel=require(_0xf687('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf687('0x8'));var querystring=require(_0xf687('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf687('0xe'));var qs=require(_0xf687('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf687('0x10'))('api');var utils=require(_0xf687('0x11'));var config=require(_0xf687('0x12'));var licenseUtil=require(_0xf687('0x13'));var db=require(_0xf687('0x14'))['db'];function respondWithStatusCode(_0x3cbcfc,_0x20ed3b){_0x20ed3b=_0x20ed3b||0xcc;return function(_0x435085){if(_0x435085){return _0x3cbcfc[_0xf687('0x15')](_0x20ed3b);}return _0x3cbcfc['status'](_0x20ed3b)['end']();};}function respondWithResult(_0x2c3e63,_0x52ecce){_0x52ecce=_0x52ecce||0xc8;return function(_0x2c33c8){if(_0x2c33c8){return _0x2c3e63[_0xf687('0x16')](_0x52ecce)[_0xf687('0x17')](_0x2c33c8);}};}function respondWithFilteredResult(_0x199411,_0x3612d8){return function(_0x11428a){if(_0x11428a){var _0x2208f9=typeof _0x3612d8[_0xf687('0x18')]===_0xf687('0x19')&&typeof _0x3612d8['limit']===_0xf687('0x19');var _0x5baf08=_0x11428a[_0xf687('0x1a')];var _0x1ebc99=_0x2208f9?0x0:_0x3612d8['offset'];var _0x289f08=_0x2208f9?_0x11428a[_0xf687('0x1a')]:_0x3612d8[_0xf687('0x18')]+_0x3612d8['limit'];var _0x7fd230;if(_0x289f08>=_0x5baf08){_0x289f08=_0x5baf08;_0x7fd230=0xc8;}else{_0x7fd230=0xce;}_0x199411['status'](_0x7fd230);return _0x199411[_0xf687('0x1b')]('Content-Range',_0x1ebc99+'-'+_0x289f08+'/'+_0x5baf08)[_0xf687('0x17')](_0x11428a);}return null;};}function patchUpdates(_0x208a9a){return function(_0x334449){try{jsonpatch[_0xf687('0x1c')](_0x334449,_0x208a9a,!![]);}catch(_0x4bf07f){return BPromise['reject'](_0x4bf07f);}return _0x334449[_0xf687('0x1d')]();};}function saveUpdates(_0x23c0c0,_0x378ca5){return function(_0x493030){if(_0x493030){return _0x493030[_0xf687('0x1e')](_0x23c0c0)[_0xf687('0x1f')](function(_0x2d326c){return _0x2d326c;});}return null;};}function removeEntity(_0x1b2c4e,_0xa2054a){return function(_0x5dd8c2){if(_0x5dd8c2){return _0x5dd8c2[_0xf687('0x20')]()['then'](function(){_0x1b2c4e[_0xf687('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dfb30,_0x2a0ac8){return function(_0x2ce8d7){if(!_0x2ce8d7){_0x1dfb30[_0xf687('0x15')](0x194);}return _0x2ce8d7;};}function handleError(_0x3efcb4,_0x57b2e0){_0x57b2e0=_0x57b2e0||0x1f4;return function(_0x107bf5){logger['error'](_0x107bf5[_0xf687('0x21')]);if(_0x107bf5[_0xf687('0x22')]){delete _0x107bf5[_0xf687('0x22')];}_0x3efcb4[_0xf687('0x16')](_0x57b2e0)[_0xf687('0x23')](_0x107bf5);};}exports[_0xf687('0x24')]=function(_0x194969,_0x4c8b85){var _0x5ae822={},_0xa7796={},_0x115aac={'count':0x0,'rows':[]};var _0x4c27d3=_['map'](db[_0xf687('0x25')][_0xf687('0x26')],function(_0x1a570f){return{'name':_0x1a570f[_0xf687('0x27')],'type':_0x1a570f['type'][_0xf687('0x28')]};});_0xa7796[_0xf687('0x29')]=_[_0xf687('0x2a')](_0x4c27d3,_0xf687('0x22'));_0xa7796[_0xf687('0x2b')]=_[_0xf687('0x2c')](_0x194969[_0xf687('0x2b')]);_0xa7796['filters']=_[_0xf687('0x2d')](_0xa7796[_0xf687('0x29')],_0xa7796[_0xf687('0x2b')]);_0x5ae822[_0xf687('0x2e')]=_[_0xf687('0x2d')](_0xa7796[_0xf687('0x29')],qs[_0xf687('0x2f')](_0x194969[_0xf687('0x2b')]['fields']));_0x5ae822[_0xf687('0x2e')]=_0x5ae822[_0xf687('0x2e')][_0xf687('0x30')]?_0x5ae822[_0xf687('0x2e')]:_0xa7796[_0xf687('0x29')];if(!_0x194969[_0xf687('0x2b')][_0xf687('0x31')](_0xf687('0x32'))){_0x5ae822['limit']=qs[_0xf687('0x33')](_0x194969[_0xf687('0x2b')][_0xf687('0x33')]);_0x5ae822[_0xf687('0x18')]=qs[_0xf687('0x18')](_0x194969[_0xf687('0x2b')][_0xf687('0x18')]);}_0x5ae822[_0xf687('0x34')]=qs[_0xf687('0x35')](_0x194969['query'][_0xf687('0x35')]);_0x5ae822['where']=qs[_0xf687('0x36')](_['pick'](_0x194969[_0xf687('0x2b')],_0xa7796['filters']),_0x4c27d3);if(_0x194969[_0xf687('0x2b')][_0xf687('0x37')]){_0x5ae822[_0xf687('0x38')]=_[_0xf687('0x39')](_0x5ae822[_0xf687('0x38')],{'$or':_[_0xf687('0x2a')](_0x4c27d3,function(_0x87d5ef){if(_0x87d5ef[_0xf687('0x3a')]!==_0xf687('0x3b')){var _0x14c6e6={};_0x14c6e6[_0x87d5ef[_0xf687('0x22')]]={'$like':'%'+_0x194969['query'][_0xf687('0x37')]+'%'};return _0x14c6e6;}})});}_0x5ae822=_[_0xf687('0x39')]({},_0x5ae822,_0x194969[_0xf687('0x3c')]);var _0x2ed544={'where':_0x5ae822[_0xf687('0x38')]};return db[_0xf687('0x25')][_0xf687('0x1a')](_0x2ed544)[_0xf687('0x1f')](function(_0x3c6769){_0x115aac['count']=_0x3c6769;if(_0x194969['query'][_0xf687('0x3d')]){_0x5ae822[_0xf687('0x3e')]=[{'all':!![]}];}return db[_0xf687('0x25')][_0xf687('0x3f')](_0x5ae822);})[_0xf687('0x1f')](function(_0x39f98c){_0x115aac['rows']=_0x39f98c;return _0x115aac;})['then'](respondWithFilteredResult(_0x4c8b85,_0x5ae822))['catch'](handleError(_0x4c8b85,null));};exports[_0xf687('0x40')]=function(_0x197489,_0xbfd120){var _0x481639={'raw':![],'where':{'id':_0x197489[_0xf687('0x41')]['id']}},_0x9a13ba={};_0x9a13ba['model']=_[_0xf687('0x2c')](db['Automation'][_0xf687('0x26')]);_0x9a13ba['query']=_[_0xf687('0x2c')](_0x197489['query']);_0x9a13ba[_0xf687('0x36')]=_[_0xf687('0x2d')](_0x9a13ba[_0xf687('0x29')],_0x9a13ba[_0xf687('0x2b')]);_0x481639['attributes']=_[_0xf687('0x2d')](_0x9a13ba['model'],qs[_0xf687('0x2f')](_0x197489[_0xf687('0x2b')][_0xf687('0x2f')]));_0x481639['attributes']=_0x481639[_0xf687('0x2e')][_0xf687('0x30')]?_0x481639[_0xf687('0x2e')]:_0x9a13ba['model'];if(_0x197489[_0xf687('0x2b')]['includeAll']){_0x481639[_0xf687('0x3e')]=[{'all':!![]}];}_0x481639=_[_0xf687('0x39')]({},_0x481639,_0x197489[_0xf687('0x3c')]);return db[_0xf687('0x25')]['find'](_0x481639)['then'](handleEntityNotFound(_0xbfd120,null))[_0xf687('0x1f')](respondWithResult(_0xbfd120,null))[_0xf687('0x42')](handleError(_0xbfd120,null));};exports['create']=function(_0x3fcd53,_0x51c72e){return db['Automation'][_0xf687('0x43')](_0x3fcd53[_0xf687('0x44')],{})['then'](respondWithResult(_0x51c72e,0xc9))['catch'](handleError(_0x51c72e,null));};exports['update']=function(_0xe74dbb,_0x23beb9){if(_0xe74dbb[_0xf687('0x44')]['id']){delete _0xe74dbb[_0xf687('0x44')]['id'];}return db[_0xf687('0x25')][_0xf687('0x45')]({'where':{'id':_0xe74dbb[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x23beb9,null))[_0xf687('0x1f')](saveUpdates(_0xe74dbb[_0xf687('0x44')],null))[_0xf687('0x1f')](respondWithResult(_0x23beb9,null))[_0xf687('0x42')](handleError(_0x23beb9,null));};exports[_0xf687('0x20')]=function(_0x334ce5,_0x5c9020){return db[_0xf687('0x25')][_0xf687('0x45')]({'where':{'id':_0x334ce5[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x5c9020,null))[_0xf687('0x1f')](removeEntity(_0x5c9020,null))[_0xf687('0x42')](handleError(_0x5c9020,null));};exports[_0xf687('0x46')]=function(_0x195eca,_0x495825,_0xe5ea9b){return db['Condition'][_0xf687('0x45')]({'where':{'id':_0x195eca[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x495825,null))[_0xf687('0x1f')](function(_0x488a89){if(_0x488a89){return _0x488a89[_0xf687('0x46')](_0x195eca[_0xf687('0x44')][_0xf687('0x47')],_[_0xf687('0x48')](_0x195eca[_0xf687('0x44')],['ids','id'])||{});}})[_0xf687('0x1f')](respondWithResult(_0x495825,null))[_0xf687('0x42')](handleError(_0x495825,null));};exports[_0xf687('0x49')]=function(_0x384fce,_0x1f9c87,_0x37b234){var _0x3dab11={};var _0x5151ed={};var _0xa04736;var _0x49d8bc;return db[_0xf687('0x25')][_0xf687('0x4a')]({'where':{'id':_0x384fce['params']['id']}})['then'](handleEntityNotFound(_0x1f9c87,null))[_0xf687('0x1f')](function(_0x5ed6e2){if(_0x5ed6e2){_0xa04736=_0x5ed6e2;_0x5151ed[_0xf687('0x29')]=_[_0xf687('0x2c')](db['Condition'][_0xf687('0x26')]);_0x5151ed[_0xf687('0x2b')]=_['keys'](_0x384fce[_0xf687('0x2b')]);_0x5151ed['filters']=_[_0xf687('0x2d')](_0x5151ed[_0xf687('0x29')],_0x5151ed[_0xf687('0x2b')]);_0x3dab11[_0xf687('0x2e')]=_[_0xf687('0x2d')](_0x5151ed['model'],qs[_0xf687('0x2f')](_0x384fce[_0xf687('0x2b')][_0xf687('0x2f')]));_0x3dab11[_0xf687('0x2e')]=_0x3dab11[_0xf687('0x2e')][_0xf687('0x30')]?_0x3dab11[_0xf687('0x2e')]:_0x5151ed['model'];_0x3dab11[_0xf687('0x34')]=qs['sort'](_0x384fce[_0xf687('0x2b')][_0xf687('0x35')]);_0x3dab11[_0xf687('0x38')]=qs[_0xf687('0x36')](_[_0xf687('0x4b')](_0x384fce['query'],_0x5151ed['filters']));if(_0x384fce[_0xf687('0x2b')][_0xf687('0x37')]){_0x3dab11[_0xf687('0x38')]=_[_0xf687('0x39')](_0x3dab11[_0xf687('0x38')],{'$or':_[_0xf687('0x2a')](_0x3dab11[_0xf687('0x2e')],function(_0x44491b){var _0x204728={};_0x204728[_0x44491b]={'$like':'%'+_0x384fce[_0xf687('0x2b')]['filter']+'%'};return _0x204728;})});}_0x3dab11=_['merge']({},_0x3dab11,_0x384fce[_0xf687('0x3c')]);return _0xa04736[_0xf687('0x49')](_0x3dab11);}})[_0xf687('0x1f')](function(_0x20b53b){if(_0x20b53b){_0x49d8bc=_0x20b53b[_0xf687('0x30')];if(!_0x384fce['query'][_0xf687('0x31')](_0xf687('0x32'))){_0x3dab11[_0xf687('0x33')]=qs['limit'](_0x384fce[_0xf687('0x2b')][_0xf687('0x33')]);_0x3dab11[_0xf687('0x18')]=qs[_0xf687('0x18')](_0x384fce['query']['offset']);}return _0xa04736[_0xf687('0x49')](_0x3dab11);}})['then'](function(_0x27080f){if(_0x27080f){return _0x27080f?{'count':_0x49d8bc,'rows':_0x27080f}:null;}})['then'](respondWithResult(_0x1f9c87,null))[_0xf687('0x42')](handleError(_0x1f9c87,null));};exports['addActions']=function(_0x5ba658,_0x310e79,_0x410be7){return db['Action'][_0xf687('0x45')]({'where':{'id':_0x5ba658[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x310e79,null))[_0xf687('0x1f')](function(_0x4ad68e){if(_0x4ad68e){return _0x4ad68e[_0xf687('0x4c')](_0x5ba658[_0xf687('0x44')][_0xf687('0x47')],_[_0xf687('0x48')](_0x5ba658[_0xf687('0x44')],[_0xf687('0x47'),'id'])||{});}})[_0xf687('0x1f')](respondWithResult(_0x310e79,null))[_0xf687('0x42')](handleError(_0x310e79,null));};exports['getActions']=function(_0xae8767,_0x5aac27,_0x2013c6){var _0x7d75f={};var _0x226f40={};var _0xee152b;var _0x3102fa;return db[_0xf687('0x25')]['findOne']({'where':{'id':_0xae8767[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x5aac27,null))[_0xf687('0x1f')](function(_0x5cf5d0){if(_0x5cf5d0){_0xee152b=_0x5cf5d0;_0x226f40['model']=_[_0xf687('0x2c')](db[_0xf687('0x4d')][_0xf687('0x26')]);_0x226f40[_0xf687('0x2b')]=_['keys'](_0xae8767['query']);_0x226f40[_0xf687('0x36')]=_[_0xf687('0x2d')](_0x226f40[_0xf687('0x29')],_0x226f40['query']);_0x7d75f[_0xf687('0x2e')]=_[_0xf687('0x2d')](_0x226f40[_0xf687('0x29')],qs[_0xf687('0x2f')](_0xae8767[_0xf687('0x2b')][_0xf687('0x2f')]));_0x7d75f['attributes']=_0x7d75f[_0xf687('0x2e')][_0xf687('0x30')]?_0x7d75f['attributes']:_0x226f40['model'];_0x7d75f[_0xf687('0x34')]=qs['sort'](_0xae8767['query']['sort']);_0x7d75f[_0xf687('0x38')]=qs[_0xf687('0x36')](_[_0xf687('0x4b')](_0xae8767[_0xf687('0x2b')],_0x226f40['filters']));if(_0xae8767[_0xf687('0x2b')]['filter']){_0x7d75f[_0xf687('0x38')]=_[_0xf687('0x39')](_0x7d75f[_0xf687('0x38')],{'$or':_['map'](_0x7d75f[_0xf687('0x2e')],function(_0x13f12c){var _0x1e5083={};_0x1e5083[_0x13f12c]={'$like':'%'+_0xae8767[_0xf687('0x2b')][_0xf687('0x37')]+'%'};return _0x1e5083;})});}_0x7d75f=_['merge']({},_0x7d75f,_0xae8767[_0xf687('0x3c')]);return _0xee152b[_0xf687('0x4e')](_0x7d75f);}})['then'](function(_0x5ba918){if(_0x5ba918){_0x3102fa=_0x5ba918[_0xf687('0x30')];if(!_0xae8767[_0xf687('0x2b')][_0xf687('0x31')](_0xf687('0x32'))){_0x7d75f['limit']=qs['limit'](_0xae8767[_0xf687('0x2b')][_0xf687('0x33')]);_0x7d75f[_0xf687('0x18')]=qs[_0xf687('0x18')](_0xae8767['query'][_0xf687('0x18')]);}return _0xee152b['getActions'](_0x7d75f);}})[_0xf687('0x1f')](function(_0x46e88a){if(_0x46e88a){return _0x46e88a?{'count':_0x3102fa,'rows':_0x46e88a}:null;}})[_0xf687('0x1f')](respondWithResult(_0x5aac27,null))[_0xf687('0x42')](handleError(_0x5aac27,null));}; \ No newline at end of file +var _0x336c=['nolimit','order','sort','where','filter','type','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','intersection','includeAll','find','create','body','addConditions','Condition','getConditions','findOne','pick','options','addActions','Action','ids','getActions','hasOwnProperty','eml-format','rimraf','request-promise','moment','util','path','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','Automation','rawAttributes','fieldName','model','query','filters','attributes','fields','length'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x336c,0x15f));var _0xc336=function(_0x49ae59,_0x52bdd0){_0x49ae59=_0x49ae59-0x0;var _0x3888b8=_0x336c[_0x49ae59];return _0x3888b8;};'use strict';var emlformat=require(_0xc336('0x0'));var rimraf=require(_0xc336('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc336('0x2'));var moment=require(_0xc336('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc336('0x4'));var path=require(_0xc336('0x5'));var sox=require('sox');var csv=require(_0xc336('0x6'));var ejs=require(_0xc336('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc336('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc336('0x9'));var toCsv=require('to-csv');var querystring=require(_0xc336('0xa'));var Papa=require(_0xc336('0xb'));var Redis=require(_0xc336('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc336('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc336('0xe'));var utils=require(_0xc336('0xf'));var config=require(_0xc336('0x10'));var licenseUtil=require(_0xc336('0x11'));var db=require(_0xc336('0x12'))['db'];function respondWithStatusCode(_0x5c891e,_0x351229){_0x351229=_0x351229||0xcc;return function(_0x45302b){if(_0x45302b){return _0x5c891e['sendStatus'](_0x351229);}return _0x5c891e[_0xc336('0x13')](_0x351229)['end']();};}function respondWithResult(_0x97bba0,_0x1b74d5){_0x1b74d5=_0x1b74d5||0xc8;return function(_0x10b59b){if(_0x10b59b){return _0x97bba0[_0xc336('0x13')](_0x1b74d5)[_0xc336('0x14')](_0x10b59b);}};}function respondWithFilteredResult(_0x7b4b08,_0x90b322){return function(_0x552a60){if(_0x552a60){var _0x51c035=typeof _0x90b322[_0xc336('0x15')]===_0xc336('0x16')&&typeof _0x90b322[_0xc336('0x17')]==='undefined';var _0x125592=_0x552a60[_0xc336('0x18')];var _0x330b4c=_0x51c035?0x0:_0x90b322[_0xc336('0x15')];var _0xfff80d=_0x51c035?_0x552a60['count']:_0x90b322['offset']+_0x90b322[_0xc336('0x17')];var _0x1e121f;if(_0xfff80d>=_0x125592){_0xfff80d=_0x125592;_0x1e121f=0xc8;}else{_0x1e121f=0xce;}_0x7b4b08['status'](_0x1e121f);return _0x7b4b08[_0xc336('0x19')](_0xc336('0x1a'),_0x330b4c+'-'+_0xfff80d+'/'+_0x125592)[_0xc336('0x14')](_0x552a60);}return null;};}function patchUpdates(_0x3fcb11){return function(_0x374561){try{jsonpatch[_0xc336('0x1b')](_0x374561,_0x3fcb11,!![]);}catch(_0x1c598e){return BPromise[_0xc336('0x1c')](_0x1c598e);}return _0x374561[_0xc336('0x1d')]();};}function saveUpdates(_0x23129c,_0x5aa78b){return function(_0x43dfc2){if(_0x43dfc2){return _0x43dfc2[_0xc336('0x1e')](_0x23129c)[_0xc336('0x1f')](function(_0x70757c){return _0x70757c;});}return null;};}function removeEntity(_0x21ed12,_0x1b984a){return function(_0x308dd3){if(_0x308dd3){return _0x308dd3[_0xc336('0x20')]()['then'](function(){_0x21ed12[_0xc336('0x13')](0xcc)[_0xc336('0x21')]();});}};}function handleEntityNotFound(_0xad8b07,_0x192ec8){return function(_0x2220ac){if(!_0x2220ac){_0xad8b07[_0xc336('0x22')](0x194);}return _0x2220ac;};}function handleError(_0x50fb52,_0x4e3f96){_0x4e3f96=_0x4e3f96||0x1f4;return function(_0x133baa){logger[_0xc336('0x23')](_0x133baa['stack']);if(_0x133baa[_0xc336('0x24')]){delete _0x133baa['name'];}_0x50fb52['status'](_0x4e3f96)[_0xc336('0x25')](_0x133baa);};}exports[_0xc336('0x26')]=function(_0x3bf1d6,_0x510b09){var _0x296381={},_0x32f0eb={},_0x21b221={'count':0x0,'rows':[]};var _0x1519c6=_[_0xc336('0x27')](db[_0xc336('0x28')][_0xc336('0x29')],function(_0x11dc31){return{'name':_0x11dc31[_0xc336('0x2a')],'type':_0x11dc31['type']['key']};});_0x32f0eb[_0xc336('0x2b')]=_[_0xc336('0x27')](_0x1519c6,_0xc336('0x24'));_0x32f0eb[_0xc336('0x2c')]=_['keys'](_0x3bf1d6['query']);_0x32f0eb[_0xc336('0x2d')]=_['intersection'](_0x32f0eb['model'],_0x32f0eb[_0xc336('0x2c')]);_0x296381[_0xc336('0x2e')]=_['intersection'](_0x32f0eb[_0xc336('0x2b')],qs[_0xc336('0x2f')](_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x2f')]));_0x296381[_0xc336('0x2e')]=_0x296381[_0xc336('0x2e')][_0xc336('0x30')]?_0x296381[_0xc336('0x2e')]:_0x32f0eb[_0xc336('0x2b')];if(!_0x3bf1d6[_0xc336('0x2c')]['hasOwnProperty'](_0xc336('0x31'))){_0x296381['limit']=qs[_0xc336('0x17')](_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x17')]);_0x296381[_0xc336('0x15')]=qs['offset'](_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x15')]);}_0x296381[_0xc336('0x32')]=qs[_0xc336('0x33')](_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x33')]);_0x296381[_0xc336('0x34')]=qs[_0xc336('0x2d')](_['pick'](_0x3bf1d6[_0xc336('0x2c')],_0x32f0eb[_0xc336('0x2d')]),_0x1519c6);if(_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x35')]){_0x296381[_0xc336('0x34')]=_['merge'](_0x296381['where'],{'$or':_['map'](_0x1519c6,function(_0x5126b8){if(_0x5126b8[_0xc336('0x36')]!==_0xc336('0x37')){var _0x22f8f8={};_0x22f8f8[_0x5126b8['name']]={'$like':'%'+_0x3bf1d6[_0xc336('0x2c')]['filter']+'%'};return _0x22f8f8;}})});}_0x296381=_[_0xc336('0x38')]({},_0x296381,_0x3bf1d6['options']);var _0x50e964={'where':_0x296381[_0xc336('0x34')]};return db[_0xc336('0x28')][_0xc336('0x18')](_0x50e964)[_0xc336('0x1f')](function(_0x22df8c){_0x21b221[_0xc336('0x18')]=_0x22df8c;if(_0x3bf1d6[_0xc336('0x2c')]['includeAll']){_0x296381[_0xc336('0x39')]=[{'all':!![]}];}return db['Automation'][_0xc336('0x3a')](_0x296381);})[_0xc336('0x1f')](function(_0x21438f){_0x21b221[_0xc336('0x3b')]=_0x21438f;return _0x21b221;})[_0xc336('0x1f')](respondWithFilteredResult(_0x510b09,_0x296381))[_0xc336('0x3c')](handleError(_0x510b09,null));};exports[_0xc336('0x3d')]=function(_0x1fcb3d,_0xca1ff3){var _0x1fef80={'raw':![],'where':{'id':_0x1fcb3d[_0xc336('0x3e')]['id']}},_0xc6903e={};_0xc6903e['model']=_['keys'](db[_0xc336('0x28')][_0xc336('0x29')]);_0xc6903e[_0xc336('0x2c')]=_[_0xc336('0x3f')](_0x1fcb3d['query']);_0xc6903e[_0xc336('0x2d')]=_[_0xc336('0x40')](_0xc6903e[_0xc336('0x2b')],_0xc6903e['query']);_0x1fef80[_0xc336('0x2e')]=_[_0xc336('0x40')](_0xc6903e[_0xc336('0x2b')],qs[_0xc336('0x2f')](_0x1fcb3d[_0xc336('0x2c')][_0xc336('0x2f')]));_0x1fef80[_0xc336('0x2e')]=_0x1fef80['attributes']['length']?_0x1fef80['attributes']:_0xc6903e[_0xc336('0x2b')];if(_0x1fcb3d[_0xc336('0x2c')][_0xc336('0x41')]){_0x1fef80[_0xc336('0x39')]=[{'all':!![]}];}_0x1fef80=_[_0xc336('0x38')]({},_0x1fef80,_0x1fcb3d['options']);return db['Automation'][_0xc336('0x42')](_0x1fef80)[_0xc336('0x1f')](handleEntityNotFound(_0xca1ff3,null))[_0xc336('0x1f')](respondWithResult(_0xca1ff3,null))[_0xc336('0x3c')](handleError(_0xca1ff3,null));};exports[_0xc336('0x43')]=function(_0x516433,_0x1a41b4){return db[_0xc336('0x28')][_0xc336('0x43')](_0x516433[_0xc336('0x44')],{})[_0xc336('0x1f')](respondWithResult(_0x1a41b4,0xc9))[_0xc336('0x3c')](handleError(_0x1a41b4,null));};exports[_0xc336('0x1e')]=function(_0x4a5ee2,_0x5f3123){if(_0x4a5ee2[_0xc336('0x44')]['id']){delete _0x4a5ee2[_0xc336('0x44')]['id'];}return db['Automation'][_0xc336('0x42')]({'where':{'id':_0x4a5ee2['params']['id']}})[_0xc336('0x1f')](handleEntityNotFound(_0x5f3123,null))[_0xc336('0x1f')](saveUpdates(_0x4a5ee2[_0xc336('0x44')],null))['then'](respondWithResult(_0x5f3123,null))[_0xc336('0x3c')](handleError(_0x5f3123,null));};exports['destroy']=function(_0x1cc79d,_0x27630d){return db['Automation'][_0xc336('0x42')]({'where':{'id':_0x1cc79d[_0xc336('0x3e')]['id']}})[_0xc336('0x1f')](handleEntityNotFound(_0x27630d,null))['then'](removeEntity(_0x27630d,null))[_0xc336('0x3c')](handleError(_0x27630d,null));};exports[_0xc336('0x45')]=function(_0xf3b2fa,_0x4c67dd,_0x116b24){return db[_0xc336('0x46')]['find']({'where':{'id':_0xf3b2fa[_0xc336('0x3e')]['id']}})[_0xc336('0x1f')](handleEntityNotFound(_0x4c67dd,null))[_0xc336('0x1f')](function(_0x4b5b95){if(_0x4b5b95){return _0x4b5b95[_0xc336('0x45')](_0xf3b2fa[_0xc336('0x44')]['ids'],_['omit'](_0xf3b2fa['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4c67dd,null))[_0xc336('0x3c')](handleError(_0x4c67dd,null));};exports[_0xc336('0x47')]=function(_0x438285,_0x1cd7b8,_0x5df97a){var _0x2286a1={};var _0x2c1362={};var _0x258dda;var _0x179799;return db['Automation'][_0xc336('0x48')]({'where':{'id':_0x438285[_0xc336('0x3e')]['id']}})[_0xc336('0x1f')](handleEntityNotFound(_0x1cd7b8,null))['then'](function(_0x237b52){if(_0x237b52){_0x258dda=_0x237b52;_0x2c1362[_0xc336('0x2b')]=_[_0xc336('0x3f')](db[_0xc336('0x46')]['rawAttributes']);_0x2c1362[_0xc336('0x2c')]=_[_0xc336('0x3f')](_0x438285['query']);_0x2c1362['filters']=_['intersection'](_0x2c1362[_0xc336('0x2b')],_0x2c1362[_0xc336('0x2c')]);_0x2286a1[_0xc336('0x2e')]=_['intersection'](_0x2c1362[_0xc336('0x2b')],qs[_0xc336('0x2f')](_0x438285[_0xc336('0x2c')][_0xc336('0x2f')]));_0x2286a1['attributes']=_0x2286a1['attributes'][_0xc336('0x30')]?_0x2286a1['attributes']:_0x2c1362['model'];_0x2286a1['order']=qs[_0xc336('0x33')](_0x438285['query'][_0xc336('0x33')]);_0x2286a1['where']=qs[_0xc336('0x2d')](_[_0xc336('0x49')](_0x438285[_0xc336('0x2c')],_0x2c1362[_0xc336('0x2d')]));if(_0x438285[_0xc336('0x2c')][_0xc336('0x35')]){_0x2286a1[_0xc336('0x34')]=_[_0xc336('0x38')](_0x2286a1[_0xc336('0x34')],{'$or':_[_0xc336('0x27')](_0x2286a1[_0xc336('0x2e')],function(_0x3f95ae){var _0x5cc4f3={};_0x5cc4f3[_0x3f95ae]={'$like':'%'+_0x438285[_0xc336('0x2c')][_0xc336('0x35')]+'%'};return _0x5cc4f3;})});}_0x2286a1=_[_0xc336('0x38')]({},_0x2286a1,_0x438285[_0xc336('0x4a')]);return _0x258dda['getConditions'](_0x2286a1);}})[_0xc336('0x1f')](function(_0x2edcd2){if(_0x2edcd2){_0x179799=_0x2edcd2[_0xc336('0x30')];if(!_0x438285[_0xc336('0x2c')]['hasOwnProperty']('nolimit')){_0x2286a1[_0xc336('0x17')]=qs[_0xc336('0x17')](_0x438285[_0xc336('0x2c')]['limit']);_0x2286a1['offset']=qs['offset'](_0x438285['query'][_0xc336('0x15')]);}return _0x258dda['getConditions'](_0x2286a1);}})[_0xc336('0x1f')](function(_0x53667b){if(_0x53667b){return _0x53667b?{'count':_0x179799,'rows':_0x53667b}:null;}})['then'](respondWithResult(_0x1cd7b8,null))[_0xc336('0x3c')](handleError(_0x1cd7b8,null));};exports[_0xc336('0x4b')]=function(_0x55e666,_0x86974c,_0x13f3d4){return db[_0xc336('0x4c')][_0xc336('0x42')]({'where':{'id':_0x55e666[_0xc336('0x3e')]['id']}})['then'](handleEntityNotFound(_0x86974c,null))[_0xc336('0x1f')](function(_0x4ca3f4){if(_0x4ca3f4){return _0x4ca3f4[_0xc336('0x4b')](_0x55e666[_0xc336('0x44')][_0xc336('0x4d')],_['omit'](_0x55e666['body'],[_0xc336('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x86974c,null))['catch'](handleError(_0x86974c,null));};exports[_0xc336('0x4e')]=function(_0x4df59b,_0x3ed4b1,_0xf3b328){var _0x52a238={};var _0x38455d={};var _0x521591;var _0x38b473;return db[_0xc336('0x28')][_0xc336('0x48')]({'where':{'id':_0x4df59b[_0xc336('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3ed4b1,null))['then'](function(_0x217596){if(_0x217596){_0x521591=_0x217596;_0x38455d['model']=_[_0xc336('0x3f')](db['Action'][_0xc336('0x29')]);_0x38455d[_0xc336('0x2c')]=_['keys'](_0x4df59b[_0xc336('0x2c')]);_0x38455d[_0xc336('0x2d')]=_[_0xc336('0x40')](_0x38455d[_0xc336('0x2b')],_0x38455d[_0xc336('0x2c')]);_0x52a238[_0xc336('0x2e')]=_[_0xc336('0x40')](_0x38455d[_0xc336('0x2b')],qs['fields'](_0x4df59b[_0xc336('0x2c')][_0xc336('0x2f')]));_0x52a238[_0xc336('0x2e')]=_0x52a238[_0xc336('0x2e')][_0xc336('0x30')]?_0x52a238[_0xc336('0x2e')]:_0x38455d['model'];_0x52a238[_0xc336('0x32')]=qs[_0xc336('0x33')](_0x4df59b['query'][_0xc336('0x33')]);_0x52a238['where']=qs[_0xc336('0x2d')](_[_0xc336('0x49')](_0x4df59b[_0xc336('0x2c')],_0x38455d[_0xc336('0x2d')]));if(_0x4df59b[_0xc336('0x2c')][_0xc336('0x35')]){_0x52a238['where']=_[_0xc336('0x38')](_0x52a238[_0xc336('0x34')],{'$or':_[_0xc336('0x27')](_0x52a238[_0xc336('0x2e')],function(_0x40d323){var _0x5b8f5f={};_0x5b8f5f[_0x40d323]={'$like':'%'+_0x4df59b[_0xc336('0x2c')][_0xc336('0x35')]+'%'};return _0x5b8f5f;})});}_0x52a238=_[_0xc336('0x38')]({},_0x52a238,_0x4df59b[_0xc336('0x4a')]);return _0x521591[_0xc336('0x4e')](_0x52a238);}})[_0xc336('0x1f')](function(_0x390358){if(_0x390358){_0x38b473=_0x390358[_0xc336('0x30')];if(!_0x4df59b['query'][_0xc336('0x4f')](_0xc336('0x31'))){_0x52a238[_0xc336('0x17')]=qs[_0xc336('0x17')](_0x4df59b['query'][_0xc336('0x17')]);_0x52a238['offset']=qs[_0xc336('0x15')](_0x4df59b[_0xc336('0x2c')][_0xc336('0x15')]);}return _0x521591['getActions'](_0x52a238);}})[_0xc336('0x1f')](function(_0x36a225){if(_0x36a225){return _0x36a225?{'count':_0x38b473,'rows':_0x36a225}:null;}})['then'](respondWithResult(_0x3ed4b1,null))['catch'](handleError(_0x3ed4b1,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 3913064..5e4cc75 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 _0xdc38=['Automation','tools_automations','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','define'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0xdc38,0x92));var _0x8dc3=function(_0x35a097,_0x42c39f){_0x35a097=_0x35a097-0x0;var _0x5ebefc=_0xdc38[_0x35a097];return _0x5ebefc;};'use strict';var _=require('lodash');var util=require(_0x8dc3('0x0'));var logger=require(_0x8dc3('0x1'))(_0x8dc3('0x2'));var moment=require(_0x8dc3('0x3'));var BPromise=require(_0x8dc3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dc3('0x5'));var rimraf=require(_0x8dc3('0x6'));var config=require(_0x8dc3('0x7'));var attributes=require(_0x8dc3('0x8'));module['exports']=function(_0xaf7ad9,_0x3e832f){return _0xaf7ad9[_0x8dc3('0x9')](_0x8dc3('0xa'),attributes,{'tableName':_0x8dc3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2e2=['define','Automation','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes'];(function(_0x5ad18c,_0x4ee0d3){var _0x470c74=function(_0x3b5850){while(--_0x3b5850){_0x5ad18c['push'](_0x5ad18c['shift']());}};_0x470c74(++_0x4ee0d3);}(_0xf2e2,0x1db));var _0x2f2e=function(_0x3d3904,_0x5dfdb){_0x3d3904=_0x3d3904-0x0;var _0x20cdfc=_0xf2e2[_0x3d3904];return _0x20cdfc;};'use strict';var _=require(_0x2f2e('0x0'));var util=require(_0x2f2e('0x1'));var logger=require(_0x2f2e('0x2'))('api');var moment=require(_0x2f2e('0x3'));var BPromise=require(_0x2f2e('0x4'));var rp=require(_0x2f2e('0x5'));var fs=require('fs');var path=require(_0x2f2e('0x6'));var rimraf=require('rimraf');var config=require(_0x2f2e('0x7'));var attributes=require(_0x2f2e('0x8'));module['exports']=function(_0x33420c,_0x109a3f){return _0x33420c[_0x2f2e('0x9')](_0x2f2e('0xa'),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 7e05180..746a4ec 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 _0x5ba3=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','Automation,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ba3,0x140));var _0x35ba=function(_0x73c797,_0x2817e6){_0x73c797=_0x73c797-0x0;var _0x28bd51=_0x5ba3[_0x73c797];return _0x28bd51;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var moment=require(_0x35ba('0x1'));var BPromise=require(_0x35ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ba('0x3'));var db=require(_0x35ba('0x4'))['db'];var utils=require(_0x35ba('0x5'));var logger=require('../../config/logger')(_0x35ba('0x6'));var config=require(_0x35ba('0x7'));var jayson=require(_0x35ba('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cd5f,_0x3264d3,_0x380ffb){return new BPromise(function(_0x4c55f3,_0x22bed8){return client['request'](_0x20cd5f,_0x380ffb)[_0x35ba('0x9')](function(_0x366ddc){logger[_0x35ba('0xa')](_0x35ba('0xb'),_0x3264d3,'request\x20sent');logger[_0x35ba('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x3264d3,'request\x20sent',JSON['stringify'](_0x366ddc));if(_0x366ddc[_0x35ba('0xd')]){if(_0x366ddc[_0x35ba('0xd')][_0x35ba('0xe')]===0x1f4){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x22bed8(_0x366ddc[_0x35ba('0xd')]['message']);}logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x4c55f3(_0x366ddc['error'][_0x35ba('0xf')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x3264d3,_0x35ba('0x10'));_0x4c55f3(_0x366ddc[_0x35ba('0x11')]['message']);}})[_0x35ba('0x12')](function(_0x2b6b71){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x2b6b71);_0x22bed8(_0x2b6b71);});});} \ No newline at end of file +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(_0x487af7,_0x3afa30){var _0x15be2e=function(_0xd48c1b){while(--_0xd48c1b){_0x487af7['push'](_0x487af7['shift']());}};_0x15be2e(++_0x3afa30);}(_0x3014,0x1d7));var _0x4301=function(_0x4f7fa8,_0x268486){_0x4f7fa8=_0x4f7fa8-0x0;var _0x50c25a=_0x3014[_0x4f7fa8];return _0x50c25a;};'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 diff --git a/server/api/automation/index.js b/server/api/automation/index.js index e32df0c..d39165f 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 _0x21d1=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','put','delete','destroy','exports','multer','util','path'];(function(_0x4b5456,_0x42dfc1){var _0x2c103d=function(_0x143563){while(--_0x143563){_0x4b5456['push'](_0x4b5456['shift']());}};_0x2c103d(++_0x42dfc1);}(_0x21d1,0x1c9));var _0x121d=function(_0x41058e,_0xf056ef){_0x41058e=_0x41058e-0x0;var _0xebf413=_0x21d1[_0x41058e];return _0xebf413;};'use strict';var multer=require(_0x121d('0x0'));var util=require(_0x121d('0x1'));var path=require(_0x121d('0x2'));var timeout=require(_0x121d('0x3'));var express=require(_0x121d('0x4'));var router=express[_0x121d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x121d('0x6'));var config=require(_0x121d('0x7'));var controller=require(_0x121d('0x8'));router[_0x121d('0x9')]('/',auth[_0x121d('0xa')](),controller['index']);router[_0x121d('0x9')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller[_0x121d('0xc')]);router[_0x121d('0x9')](_0x121d('0xd'),auth[_0x121d('0xa')](),controller[_0x121d('0xe')]);router[_0x121d('0x9')](_0x121d('0xf'),auth['isAuthenticated'](),controller[_0x121d('0x10')]);router[_0x121d('0x11')]('/',auth[_0x121d('0xa')](),controller['create']);router['post'](_0x121d('0xd'),auth[_0x121d('0xa')](),controller[_0x121d('0x12')]);router['post']('/:id/actions',auth[_0x121d('0xa')](),controller['addActions']);router[_0x121d('0x13')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller['update']);router[_0x121d('0x14')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller[_0x121d('0x15')]);module[_0x121d('0x16')]=router; \ No newline at end of file +var _0x2e3d=['addActions','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','create','post','addConditions','/:id/actions'];(function(_0x527a6c,_0x15b18d){var _0x4c780d=function(_0xebc03){while(--_0xebc03){_0x527a6c['push'](_0x527a6c['shift']());}};_0x4c780d(++_0x15b18d);}(_0x2e3d,0x8c));var _0xd2e3=function(_0x19c3fd,_0x5a83bf){_0x19c3fd=_0x19c3fd-0x0;var _0x321198=_0x2e3d[_0x19c3fd];return _0x321198;};'use strict';var multer=require(_0xd2e3('0x0'));var util=require(_0xd2e3('0x1'));var path=require(_0xd2e3('0x2'));var timeout=require(_0xd2e3('0x3'));var express=require(_0xd2e3('0x4'));var router=express[_0xd2e3('0x5')]();var fs_extra=require(_0xd2e3('0x6'));var auth=require(_0xd2e3('0x7'));var interaction=require(_0xd2e3('0x8'));var config=require('../../config/environment');var controller=require(_0xd2e3('0x9'));router[_0xd2e3('0xa')]('/',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0xc')]);router['get'](_0xd2e3('0xd'),auth['isAuthenticated'](),controller[_0xd2e3('0xe')]);router['get'](_0xd2e3('0xf'),auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x10')]);router[_0xd2e3('0xa')]('/:id/actions',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x11')]);router['post']('/',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x12')]);router[_0xd2e3('0x13')]('/:id/conditions',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x14')]);router[_0xd2e3('0x13')](_0xd2e3('0x15'),auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x16')]);router[_0xd2e3('0x17')](_0xd2e3('0xd'),auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x18')]);router[_0xd2e3('0x19')](_0xd2e3('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xd2e3('0x1a')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index f216426..286c834 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 _0xb111=['#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence'];(function(_0x47d32d,_0x4ad6e4){var _0xfe59b5=function(_0x448cd5){while(--_0x448cd5){_0x47d32d['push'](_0x47d32d['shift']());}};_0xfe59b5(++_0x4ad6e4);}(_0xb111,0x149));var _0x1b11=function(_0x30a0c7,_0x2e8020){_0x30a0c7=_0x30a0c7-0x0;var _0x14a010=_0xb111[_0x30a0c7];return _0x14a010;};'use strict';var Sequelize=require('sequelize');module[_0x1b11('0x0')]={'name':{'type':Sequelize[_0x1b11('0x1')],'unique':_0x1b11('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1b11('0x3')](_0x1b11('0x4')),'allowNull':![],'defaultValue':_0x1b11('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1b11('0x5')],'defaultValue':0x0,'comment':_0x1b11('0x6')},'limitCalls':{'type':Sequelize[_0x1b11('0x7')](0x4)[_0x1b11('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1b11('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1b11('0x7')](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1b11('0x7')](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1b11('0x10')},'dialTimezone':{'type':Sequelize[_0x1b11('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1b11('0x1')],'defaultValue':_0x1b11('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x1b11('0x3')](_0x1b11('0x12'),_0x1b11('0x13'),_0x1b11('0x14')),'defaultValue':_0x1b11('0x12')},'dialAMDActive':{'type':Sequelize[_0x1b11('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1b11('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1b11('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1b11('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1b11('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1b11('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1b11('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1b11('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1b11('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1b11('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1b11('0x3')](_0x1b11('0x1d'),'ASC'),'defaultValue':_0x1b11('0x1d')},'dialPrefix':{'type':Sequelize[_0x1b11('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1b11('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1b11('0x7')](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0xb954=['#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x38ceff,_0x3c88bd){var _0x44c5f6=function(_0x3288f9){while(--_0x3288f9){_0x38ceff['push'](_0x38ceff['shift']());}};_0x44c5f6(++_0x3c88bd);}(_0xb954,0x115));var _0x4b95=function(_0x1a124d,_0x3e04b0){_0x1a124d=_0x1a124d-0x0;var _0x5f0830=_0xb954[_0x1a124d];return _0x5f0830;};'use strict';var Sequelize=require(_0x4b95('0x0'));module[_0x4b95('0x1')]={'name':{'type':Sequelize[_0x4b95('0x2')],'unique':_0x4b95('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x4b95('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x4b95('0x5')],'defaultValue':0x0,'comment':_0x4b95('0x6')},'limitCalls':{'type':Sequelize[_0x4b95('0x7')](0x4)[_0x4b95('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x4b95('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4b95('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4b95('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'comment':_0x4b95('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4b95('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'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[_0x4b95('0x2')],'defaultValue':_0x4b95('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x4b95('0x11')](_0x4b95('0x12'),_0x4b95('0x13'),'onlyIfOpen'),'defaultValue':_0x4b95('0x12')},'dialAMDActive':{'type':Sequelize[_0x4b95('0x5')],'defaultValue':0x0,'comment':_0x4b95('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4b95('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x4b95('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4b95('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4b95('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4b95('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4b95('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4b95('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4b95('0x7')](0x5)[_0x4b95('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4b95('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4b95('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4b95('0x11')]('DESC',_0x4b95('0x1d')),'defaultValue':_0x4b95('0x1e')},'dialPrefix':{'type':Sequelize[_0x4b95('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x4b95('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4b95('0x1f')},'dialCutDigit':{'type':Sequelize[_0x4b95('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4b95('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0x21')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)[_0x4b95('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0x27')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x28')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)[_0x4b95('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index ac709b6..4a30029 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 _0xe773=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','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','clone','omit','createdAt','updatedAt','getHoppers','CmHopper','CampaignId','findAll','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','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)','CampaignId\x20=\x20?','NOW()','cm_contacts','ci.item','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json'];(function(_0x2d5341,_0x590e15){var _0x3c87a5=function(_0x5ecdd5){while(--_0x5ecdd5){_0x2d5341['push'](_0x2d5341['shift']());}};_0x3c87a5(++_0x590e15);}(_0xe773,0x19a));var _0x3e77=function(_0x5b51dc,_0x4a4b33){_0x5b51dc=_0x5b51dc-0x0;var _0x315a48=_0xe773[_0x5b51dc];return _0x315a48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e77('0x0'));var zipdir=require(_0x3e77('0x1'));var jsonpatch=require(_0x3e77('0x2'));var rp=require('request-promise');var moment=require(_0x3e77('0x3'));var BPromise=require(_0x3e77('0x4'));var Mustache=require(_0x3e77('0x5'));var util=require(_0x3e77('0x6'));var path=require(_0x3e77('0x7'));var sox=require('sox');var csv=require(_0x3e77('0x8'));var ejs=require(_0x3e77('0x9'));var fs=require('fs');var fs_extra=require(_0x3e77('0xa'));var _=require(_0x3e77('0xb'));var squel=require(_0x3e77('0xc'));var crypto=require(_0x3e77('0xd'));var jsforce=require(_0x3e77('0xe'));var deskjs=require(_0x3e77('0xf'));var toCsv=require(_0x3e77('0x8'));var querystring=require(_0x3e77('0x10'));var Papa=require(_0x3e77('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e77('0x12'));var as=require(_0x3e77('0x13'));var hardwareService=require(_0x3e77('0x14'));var logger=require(_0x3e77('0x15'))(_0x3e77('0x16'));var utils=require('../../config/utils');var config=require(_0x3e77('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aa8a5,_0x4a1d09){_0x4a1d09=_0x4a1d09||0xcc;return function(_0x5b0f11){if(_0x5b0f11){return _0x1aa8a5[_0x3e77('0x18')](_0x4a1d09);}return _0x1aa8a5[_0x3e77('0x19')](_0x4a1d09)[_0x3e77('0x1a')]();};}function respondWithResult(_0x53188b,_0xb9208c){_0xb9208c=_0xb9208c||0xc8;return function(_0x55610c){if(_0x55610c){return _0x53188b[_0x3e77('0x19')](_0xb9208c)[_0x3e77('0x1b')](_0x55610c);}};}function respondWithFilteredResult(_0x4a48c8,_0x3fc41f){return function(_0x11d14b){if(_0x11d14b){var _0x39ec03=typeof _0x3fc41f[_0x3e77('0x1c')]===_0x3e77('0x1d')&&typeof _0x3fc41f[_0x3e77('0x1e')]==='undefined';var _0x1c2260=_0x11d14b[_0x3e77('0x1f')];var _0x35d890=_0x39ec03?0x0:_0x3fc41f[_0x3e77('0x1c')];var _0x58b8ee=_0x39ec03?_0x11d14b['count']:_0x3fc41f[_0x3e77('0x1c')]+_0x3fc41f['limit'];var _0x1eb346;if(_0x58b8ee>=_0x1c2260){_0x58b8ee=_0x1c2260;_0x1eb346=0xc8;}else{_0x1eb346=0xce;}_0x4a48c8[_0x3e77('0x19')](_0x1eb346);return _0x4a48c8[_0x3e77('0x20')](_0x3e77('0x21'),_0x35d890+'-'+_0x58b8ee+'/'+_0x1c2260)[_0x3e77('0x1b')](_0x11d14b);}return null;};}function patchUpdates(_0x19c4e1){return function(_0x4b2101){try{jsonpatch[_0x3e77('0x22')](_0x4b2101,_0x19c4e1,!![]);}catch(_0x96b07){return BPromise[_0x3e77('0x23')](_0x96b07);}return _0x4b2101[_0x3e77('0x24')]();};}function saveUpdates(_0x2a384a,_0x289c3d){return function(_0x2e027a){if(_0x2e027a){return _0x2e027a[_0x3e77('0x25')](_0x2a384a)['then'](function(_0x45762f){return _0x45762f;});}return null;};}function removeEntity(_0x317f32,_0x3ef7cf){return function(_0x1b2ce6){if(_0x1b2ce6){return _0x1b2ce6['destroy']()[_0x3e77('0x26')](function(){var _0x320144=_0x1b2ce6[_0x3e77('0x27')]({'plain':!![]});var _0x1efc1a=_0x3e77('0x28');return db[_0x3e77('0x29')][_0x3e77('0x2a')]({'where':{'type':_0x1efc1a,'resourceId':_0x320144['id']}})[_0x3e77('0x26')](function(){return _0x1b2ce6;});})[_0x3e77('0x26')](function(){_0x317f32[_0x3e77('0x19')](0xcc)[_0x3e77('0x1a')]();});}};}function handleEntityNotFound(_0x472a9e,_0x5cfc73){return function(_0x30e81f){if(!_0x30e81f){_0x472a9e[_0x3e77('0x18')](0x194);}return _0x30e81f;};}function handleError(_0x4fc072,_0x581719){_0x581719=_0x581719||0x1f4;return function(_0x3c4f6a){logger[_0x3e77('0x2b')](_0x3c4f6a[_0x3e77('0x2c')]);if(_0x3c4f6a[_0x3e77('0x2d')]){delete _0x3c4f6a['name'];}_0x4fc072[_0x3e77('0x19')](_0x581719)['send'](_0x3c4f6a);};}exports[_0x3e77('0x2e')]=function(_0x3333f1,_0x27cce5){var _0x577599={},_0x513d5c={},_0x2e42a1={'count':0x0,'rows':[]};var _0x2276f4=_[_0x3e77('0x2f')](db[_0x3e77('0x30')][_0x3e77('0x31')],function(_0x7c3a3c){return{'name':_0x7c3a3c[_0x3e77('0x32')],'type':_0x7c3a3c['type'][_0x3e77('0x33')]};});_0x513d5c[_0x3e77('0x34')]=_['map'](_0x2276f4,_0x3e77('0x2d'));_0x513d5c[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x3333f1['query']);_0x513d5c[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x513d5c[_0x3e77('0x34')],_0x513d5c[_0x3e77('0x35')]);_0x577599[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x513d5c[_0x3e77('0x34')],qs['fields'](_0x3333f1[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x577599[_0x3e77('0x39')]=_0x577599[_0x3e77('0x39')]['length']?_0x577599[_0x3e77('0x39')]:_0x513d5c[_0x3e77('0x34')];if(!_0x3333f1[_0x3e77('0x35')][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x577599['limit']=qs[_0x3e77('0x1e')](_0x3333f1[_0x3e77('0x35')]['limit']);_0x577599[_0x3e77('0x1c')]=qs[_0x3e77('0x1c')](_0x3333f1[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0x577599[_0x3e77('0x3d')]=qs[_0x3e77('0x3e')](_0x3333f1[_0x3e77('0x35')][_0x3e77('0x3e')]);_0x577599[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x3333f1['query'],_0x513d5c[_0x3e77('0x37')]),_0x2276f4);if(_0x3333f1[_0x3e77('0x35')][_0x3e77('0x41')]){_0x577599['where']=_[_0x3e77('0x42')](_0x577599[_0x3e77('0x3f')],{'$or':_[_0x3e77('0x2f')](_0x2276f4,function(_0x18a3f5){if(_0x18a3f5[_0x3e77('0x43')]!==_0x3e77('0x44')){var _0x39894b={};_0x39894b[_0x18a3f5['name']]={'$like':'%'+_0x3333f1[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x39894b;}})});}_0x577599=_[_0x3e77('0x42')]({},_0x577599,_0x3333f1[_0x3e77('0x45')]);var _0x288df3={'where':_0x577599[_0x3e77('0x3f')]};return db[_0x3e77('0x30')]['count'](_0x288df3)[_0x3e77('0x26')](function(_0x48396b){_0x2e42a1[_0x3e77('0x1f')]=_0x48396b;if(_0x3333f1[_0x3e77('0x35')][_0x3e77('0x46')]){_0x577599[_0x3e77('0x47')]=[{'all':!![]}];}return db[_0x3e77('0x30')]['findAll'](_0x577599);})[_0x3e77('0x26')](function(_0x58cfe4){_0x2e42a1[_0x3e77('0x48')]=_0x58cfe4;return _0x2e42a1;})[_0x3e77('0x26')](respondWithFilteredResult(_0x27cce5,_0x577599))[_0x3e77('0x49')](handleError(_0x27cce5,null));};exports[_0x3e77('0x4a')]=function(_0x155210,_0x3c59ae){var _0x4d6a9d={'raw':![],'where':{'id':_0x155210[_0x3e77('0x4b')]['id']}},_0x4d51cd={};_0x4d51cd[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x30')][_0x3e77('0x31')]);_0x4d51cd[_0x3e77('0x35')]=_['keys'](_0x155210['query']);_0x4d51cd[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x4d51cd[_0x3e77('0x34')],_0x4d51cd[_0x3e77('0x35')]);_0x4d6a9d[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x4d51cd[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x155210[_0x3e77('0x35')]['fields']));_0x4d6a9d[_0x3e77('0x39')]=_0x4d6a9d[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x4d6a9d[_0x3e77('0x39')]:_0x4d51cd[_0x3e77('0x34')];if(_0x155210['query'][_0x3e77('0x46')]){_0x4d6a9d[_0x3e77('0x47')]=[{'all':!![]}];}_0x4d6a9d=_[_0x3e77('0x42')]({},_0x4d6a9d,_0x155210[_0x3e77('0x45')]);return db[_0x3e77('0x30')][_0x3e77('0x4d')](_0x4d6a9d)[_0x3e77('0x26')](handleEntityNotFound(_0x3c59ae,null))[_0x3e77('0x26')](respondWithResult(_0x3c59ae,null))[_0x3e77('0x49')](handleError(_0x3c59ae,null));};exports[_0x3e77('0x4e')]=function(_0x598971,_0x2e28f7){return db[_0x3e77('0x30')][_0x3e77('0x4e')](_0x598971[_0x3e77('0x4f')],{})['then'](function(_0x3022f6){var _0x36ba43=_0x598971[_0x3e77('0x50')]['get']({'plain':!![]});if(!_0x36ba43)throw new Error(_0x3e77('0x51'));if(_0x36ba43[_0x3e77('0x52')]===_0x3e77('0x50')){var _0x1b6046=_0x3022f6[_0x3e77('0x27')]({'plain':!![]});var _0x5ae2cd=_0x3e77('0x28');return db[_0x3e77('0x53')][_0x3e77('0x4d')]({'where':{'name':_0x5ae2cd,'userProfileId':_0x36ba43[_0x3e77('0x54')]},'raw':!![]})[_0x3e77('0x26')](function(_0x30c4ea){if(_0x30c4ea&&_0x30c4ea[_0x3e77('0x55')]===0x0){return db['UserProfileResource'][_0x3e77('0x4e')]({'name':_0x1b6046['name'],'resourceId':_0x1b6046['id'],'type':_0x30c4ea[_0x3e77('0x2d')],'sectionId':_0x30c4ea['id']},{})[_0x3e77('0x26')](function(){return _0x3022f6;});}else{return _0x3022f6;}})[_0x3e77('0x49')](function(_0x1e3c3a){logger[_0x3e77('0x2b')](_0x3e77('0x56'),_0x1e3c3a);throw _0x1e3c3a;});}return _0x3022f6;})[_0x3e77('0x26')](respondWithResult(_0x2e28f7,0xc9))[_0x3e77('0x49')](handleError(_0x2e28f7,null));};exports[_0x3e77('0x57')]=function(_0x595879,_0x24346a){var _0x126d4c={'where':{'id':_0x595879[_0x3e77('0x4b')]['id']}},_0xe54e0={};_0xe54e0[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x30')][_0x3e77('0x31')]);_0x126d4c[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0xe54e0[_0x3e77('0x34')],qs['fields'](_0x595879[_0x3e77('0x35')]['fields']));_0x126d4c[_0x3e77('0x39')]=_0x126d4c['attributes'][_0x3e77('0x4c')]?_0x126d4c[_0x3e77('0x39')]:_0xe54e0[_0x3e77('0x34')];if(_0x595879[_0x3e77('0x35')][_0x3e77('0x46')]){_0x126d4c[_0x3e77('0x47')]=[{'all':!![]}];}_0x126d4c=_[_0x3e77('0x42')]({},_0x126d4c,_0x595879['options']);return db['Campaign'][_0x3e77('0x4d')](_0x126d4c)['then'](handleEntityNotFound(_0x24346a,null))[_0x3e77('0x26')](function(_0x3e61bf){if(_0x3e61bf){var _0x512fda=_0x3e61bf[_0x3e77('0x27')]({'plain':!![]});_0x512fda=qs[_0x3e77('0x58')](_0x512fda,['id',_0x3e77('0x59'),_0x3e77('0x5a')]);_0x595879[_0x3e77('0x4f')]=_[_0x3e77('0x58')](_0x595879[_0x3e77('0x4f')],['id','createdAt',_0x3e77('0x5a')]);return db[_0x3e77('0x30')][_0x3e77('0x4e')](_[_0x3e77('0x42')](_0x512fda,_0x595879[_0x3e77('0x4f')]),{'include':_0x595879[_0x3e77('0x35')][_0x3e77('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x4de4c4){var _0x1ebdc6=_0x595879[_0x3e77('0x50')][_0x3e77('0x27')]({'plain':!![]});if(!_0x1ebdc6)throw new Error(_0x3e77('0x51'));if(_0x1ebdc6[_0x3e77('0x52')]===_0x3e77('0x50')){var _0x1890b5=_0x4de4c4['get']({'plain':!![]});var _0x26bd0c=_0x3e77('0x28');return db[_0x3e77('0x53')]['find']({'where':{'name':_0x26bd0c,'userProfileId':_0x1ebdc6['userProfileId']},'raw':!![]})[_0x3e77('0x26')](function(_0x532df3){if(_0x532df3&&_0x532df3['autoAssociation']===0x0){return db[_0x3e77('0x29')]['create']({'name':_0x1890b5[_0x3e77('0x2d')],'resourceId':_0x1890b5['id'],'type':_0x532df3[_0x3e77('0x2d')],'sectionId':_0x532df3['id']},{})[_0x3e77('0x26')](function(){return _0x4de4c4;});}else{return _0x4de4c4;}})[_0x3e77('0x49')](function(_0x58623b){logger[_0x3e77('0x2b')](_0x3e77('0x56'),_0x58623b);throw _0x58623b;});}return _0x4de4c4;});}})[_0x3e77('0x26')](respondWithResult(_0x24346a,0xc9))['catch'](handleError(_0x24346a,null));};exports['update']=function(_0x293c2e,_0x2c4bc2){if(_0x293c2e[_0x3e77('0x4f')]['id']){delete _0x293c2e[_0x3e77('0x4f')]['id'];}return db[_0x3e77('0x30')]['find']({'where':{'id':_0x293c2e[_0x3e77('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2c4bc2,null))['then'](saveUpdates(_0x293c2e[_0x3e77('0x4f')],null))['then'](respondWithResult(_0x2c4bc2,null))['catch'](handleError(_0x2c4bc2,null));};exports['destroy']=function(_0x207da1,_0x18cedd){return db[_0x3e77('0x30')]['find']({'where':{'id':_0x207da1[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x18cedd,null))['then'](removeEntity(_0x18cedd,null))[_0x3e77('0x49')](handleError(_0x18cedd,null));};exports[_0x3e77('0x5b')]=function(_0x3c174a,_0x248266,_0x3d4973){var _0x117abc={'raw':!![],'where':{}};var _0x1647f5={};var _0xf4a464={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3c174a[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x248266,null))[_0x3e77('0x26')](function(_0x110d3f){if(_0x110d3f){_0x1647f5[_0x3e77('0x34')]=_['keys'](db[_0x3e77('0x5c')][_0x3e77('0x31')]);_0x1647f5[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x3c174a[_0x3e77('0x35')]);_0x1647f5[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x1647f5[_0x3e77('0x34')],_0x1647f5[_0x3e77('0x35')]);_0x117abc[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x1647f5[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x3c174a[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x117abc['attributes']=_0x117abc[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x117abc[_0x3e77('0x39')]:_0x1647f5[_0x3e77('0x34')];if(!_0x3c174a['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x117abc[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x3c174a[_0x3e77('0x35')]['limit']);_0x117abc['offset']=qs[_0x3e77('0x1c')](_0x3c174a[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0x117abc[_0x3e77('0x3d')]=qs['sort'](_0x3c174a[_0x3e77('0x35')]['sort']);_0x117abc[_0x3e77('0x3f')]=qs['filters'](_[_0x3e77('0x40')](_0x3c174a[_0x3e77('0x35')],_0x1647f5['filters']));_0x117abc[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x110d3f['id'];if(_0x3c174a['query'][_0x3e77('0x41')]){_0x117abc['where']=_['merge'](_0x117abc[_0x3e77('0x3f')],{'$or':_['map'](_0x117abc[_0x3e77('0x39')],function(_0x5e1400){var _0x5b6150={};_0x5b6150[_0x5e1400]={'$like':'%'+_0x3c174a[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x5b6150;})});}_0x117abc=_[_0x3e77('0x42')]({},_0x117abc,_0x3c174a[_0x3e77('0x45')]);return db[_0x3e77('0x5c')][_0x3e77('0x1f')]({'where':_0x117abc[_0x3e77('0x3f')]})[_0x3e77('0x26')](function(_0x10c9ef){_0xf4a464[_0x3e77('0x1f')]=_0x10c9ef;if(_0x3c174a[_0x3e77('0x35')][_0x3e77('0x46')]){_0x117abc[_0x3e77('0x47')]=[{'all':!![]}];}return db[_0x3e77('0x5c')][_0x3e77('0x5e')](_0x117abc);})[_0x3e77('0x26')](function(_0x24566a){_0xf4a464[_0x3e77('0x48')]=_0x24566a;return _0xf4a464;});}})['then'](respondWithFilteredResult(_0x248266,_0x117abc))[_0x3e77('0x49')](handleError(_0x248266,null));};exports[_0x3e77('0x5f')]=function(_0x74c95f,_0xa03927,_0x4206d0){var _0x5269f5={'raw':!![],'where':{}};var _0x26eb34={};var _0x15e0c5={'count':0x0,'rows':[]};return db[_0x3e77('0x30')][_0x3e77('0x60')]({'where':{'id':_0x74c95f[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0xa03927,null))[_0x3e77('0x26')](function(_0x41d433){if(_0x41d433){_0x26eb34[_0x3e77('0x34')]=_[_0x3e77('0x36')](db['CmHopperHistory']['rawAttributes']);_0x26eb34[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x74c95f['query']);_0x26eb34[_0x3e77('0x37')]=_['intersection'](_0x26eb34[_0x3e77('0x34')],_0x26eb34['query']);_0x5269f5[_0x3e77('0x39')]=_['intersection'](_0x26eb34[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x74c95f[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x5269f5[_0x3e77('0x39')]=_0x5269f5[_0x3e77('0x39')]['length']?_0x5269f5[_0x3e77('0x39')]:_0x26eb34['model'];if(!_0x74c95f[_0x3e77('0x35')][_0x3e77('0x3b')]('nolimit')){_0x5269f5[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x74c95f[_0x3e77('0x35')][_0x3e77('0x1e')]);_0x5269f5[_0x3e77('0x1c')]=qs[_0x3e77('0x1c')](_0x74c95f[_0x3e77('0x35')]['offset']);}_0x5269f5[_0x3e77('0x3d')]=qs[_0x3e77('0x3e')](_0x74c95f[_0x3e77('0x35')]['sort']);_0x5269f5[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x74c95f[_0x3e77('0x35')],_0x26eb34[_0x3e77('0x37')]));_0x5269f5[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x41d433['id'];if(_0x74c95f[_0x3e77('0x35')][_0x3e77('0x41')]){_0x5269f5[_0x3e77('0x3f')]=_[_0x3e77('0x42')](_0x5269f5['where'],{'$or':_[_0x3e77('0x2f')](_0x5269f5['attributes'],function(_0x510cf6){var _0x1c1965={};_0x1c1965[_0x510cf6]={'$like':'%'+_0x74c95f['query'][_0x3e77('0x41')]+'%'};return _0x1c1965;})});}_0x5269f5=_['merge']({},_0x5269f5,_0x74c95f[_0x3e77('0x45')]);return db[_0x3e77('0x61')][_0x3e77('0x1f')]({'where':_0x5269f5[_0x3e77('0x3f')]})[_0x3e77('0x26')](function(_0x1b0f7c){_0x15e0c5[_0x3e77('0x1f')]=_0x1b0f7c;if(_0x74c95f[_0x3e77('0x35')][_0x3e77('0x46')]){_0x5269f5['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x3e77('0x5e')](_0x5269f5);})['then'](function(_0x14a786){_0x15e0c5[_0x3e77('0x48')]=_0x14a786;return _0x15e0c5;});}})['then'](respondWithFilteredResult(_0xa03927,_0x5269f5))['catch'](handleError(_0xa03927,null));};exports[_0x3e77('0x62')]=function(_0x3fbea2,_0x578e79,_0x25aa11){var _0xfb07c5={'raw':!![],'where':{}};var _0x173c5d={};var _0x4ed6ed={'count':0x0,'rows':[]};return db[_0x3e77('0x30')]['findOne']({'where':{'id':_0x3fbea2['params']['id']}})['then'](handleEntityNotFound(_0x578e79,null))[_0x3e77('0x26')](function(_0x284b55){if(_0x284b55){_0x173c5d[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x63')][_0x3e77('0x31')]);_0x173c5d[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x3fbea2['query']);_0x173c5d[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x173c5d[_0x3e77('0x34')],_0x173c5d[_0x3e77('0x35')]);_0xfb07c5[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x173c5d[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x3fbea2['query'][_0x3e77('0x3a')]));_0xfb07c5[_0x3e77('0x39')]=_0xfb07c5[_0x3e77('0x39')][_0x3e77('0x4c')]?_0xfb07c5[_0x3e77('0x39')]:_0x173c5d[_0x3e77('0x34')];if(!_0x3fbea2['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0xfb07c5[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x1e')]);_0xfb07c5[_0x3e77('0x1c')]=qs['offset'](_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0xfb07c5['order']=qs['sort'](_0x3fbea2['query']['sort']);_0xfb07c5[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x3fbea2[_0x3e77('0x35')],_0x173c5d['filters']));_0xfb07c5[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x284b55['id'];if(_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x41')]){_0xfb07c5['where']=_[_0x3e77('0x42')](_0xfb07c5[_0x3e77('0x3f')],{'$or':_[_0x3e77('0x2f')](_0xfb07c5[_0x3e77('0x39')],function(_0x4443e7){var _0x2db50a={};_0x2db50a[_0x4443e7]={'$like':'%'+_0x3fbea2[_0x3e77('0x35')]['filter']+'%'};return _0x2db50a;})});}_0xfb07c5=_[_0x3e77('0x42')]({},_0xfb07c5,_0x3fbea2[_0x3e77('0x45')]);return db[_0x3e77('0x63')]['count']({'where':_0xfb07c5['where']})[_0x3e77('0x26')](function(_0x461587){_0x4ed6ed[_0x3e77('0x1f')]=_0x461587;if(_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x46')]){_0xfb07c5[_0x3e77('0x47')]=[{'all':!![]}];}return db[_0x3e77('0x63')]['findAll'](_0xfb07c5);})[_0x3e77('0x26')](function(_0x2d842f){_0x4ed6ed[_0x3e77('0x48')]=_0x2d842f;return _0x4ed6ed;});}})[_0x3e77('0x26')](respondWithFilteredResult(_0x578e79,_0xfb07c5))[_0x3e77('0x49')](handleError(_0x578e79,null));};exports[_0x3e77('0x64')]=function(_0x4f1814,_0x10e034,_0x149463){var _0x44b60f={'raw':!![],'where':{}};var _0x423886={};var _0x38d154={'count':0x0,'rows':[]};return db[_0x3e77('0x30')]['findOne']({'where':{'id':_0x4f1814[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x10e034,null))[_0x3e77('0x26')](function(_0x50e433){if(_0x50e433){_0x423886[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x65')]['rawAttributes']);_0x423886[_0x3e77('0x35')]=_['keys'](_0x4f1814[_0x3e77('0x35')]);_0x423886[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x423886[_0x3e77('0x34')],_0x423886[_0x3e77('0x35')]);_0x44b60f[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x423886[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x4f1814['query'][_0x3e77('0x3a')]));_0x44b60f['attributes']=_0x44b60f[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x44b60f[_0x3e77('0x39')]:_0x423886[_0x3e77('0x34')];if(!_0x4f1814['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x44b60f[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x4f1814['query'][_0x3e77('0x1e')]);_0x44b60f[_0x3e77('0x1c')]=qs['offset'](_0x4f1814[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0x44b60f['order']=qs[_0x3e77('0x3e')](_0x4f1814['query']['sort']);_0x44b60f['where']=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x4f1814[_0x3e77('0x35')],_0x423886[_0x3e77('0x37')]));_0x44b60f[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x50e433['id'];if(_0x4f1814['query'][_0x3e77('0x41')]){_0x44b60f['where']=_[_0x3e77('0x42')](_0x44b60f['where'],{'$or':_[_0x3e77('0x2f')](_0x44b60f[_0x3e77('0x39')],function(_0x1baf86){var _0x3564fd={};_0x3564fd[_0x1baf86]={'$like':'%'+_0x4f1814[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x3564fd;})});}_0x44b60f=_['merge']({},_0x44b60f,_0x4f1814['options']);return db[_0x3e77('0x65')][_0x3e77('0x1f')]({'where':_0x44b60f['where']})[_0x3e77('0x26')](function(_0x15ee01){_0x38d154[_0x3e77('0x1f')]=_0x15ee01;if(_0x4f1814[_0x3e77('0x35')]['includeAll']){_0x44b60f['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x3e77('0x5e')](_0x44b60f);})[_0x3e77('0x26')](function(_0x1c58fd){_0x38d154['rows']=_0x1c58fd;return _0x38d154;});}})[_0x3e77('0x26')](respondWithFilteredResult(_0x10e034,_0x44b60f))[_0x3e77('0x49')](handleError(_0x10e034,null));};exports[_0x3e77('0x66')]=function(_0x97a639,_0x2fdbc9,_0xa91b28){var _0x2def37={};var _0xd2cce2={};var _0x3ca480;var _0xad1adb;return db['Campaign'][_0x3e77('0x60')]({'where':{'id':_0x97a639[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x2fdbc9,null))[_0x3e77('0x26')](function(_0x159cc1){if(_0x159cc1){_0x3ca480=_0x159cc1;_0xd2cce2[_0x3e77('0x34')]=_[_0x3e77('0x36')](db['CmList'][_0x3e77('0x31')]);_0xd2cce2[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x97a639[_0x3e77('0x35')]);_0xd2cce2[_0x3e77('0x37')]=_['intersection'](_0xd2cce2[_0x3e77('0x34')],_0xd2cce2[_0x3e77('0x35')]);_0x2def37[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0xd2cce2['model'],qs[_0x3e77('0x3a')](_0x97a639[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x2def37[_0x3e77('0x39')]=_0x2def37['attributes'][_0x3e77('0x4c')]?_0x2def37[_0x3e77('0x39')]:_0xd2cce2[_0x3e77('0x34')];_0x2def37['order']=qs[_0x3e77('0x3e')](_0x97a639['query']['sort']);_0x2def37[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x97a639[_0x3e77('0x35')],_0xd2cce2[_0x3e77('0x37')]));if(_0x97a639[_0x3e77('0x35')][_0x3e77('0x41')]){_0x2def37[_0x3e77('0x3f')]=_[_0x3e77('0x42')](_0x2def37[_0x3e77('0x3f')],{'$or':_['map'](_0x2def37[_0x3e77('0x39')],function(_0x554c5f){var _0x9a8dd3={};_0x9a8dd3[_0x554c5f]={'$like':'%'+_0x97a639[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x9a8dd3;})});}_0x2def37=_[_0x3e77('0x42')]({},_0x2def37,_0x97a639[_0x3e77('0x45')]);return _0x3ca480[_0x3e77('0x66')](_0x2def37);}})[_0x3e77('0x26')](function(_0x58b9c0){if(_0x58b9c0){_0xad1adb=_0x58b9c0[_0x3e77('0x4c')];if(!_0x97a639[_0x3e77('0x35')][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x2def37[_0x3e77('0x1e')]=qs['limit'](_0x97a639['query'][_0x3e77('0x1e')]);_0x2def37[_0x3e77('0x1c')]=qs[_0x3e77('0x1c')](_0x97a639[_0x3e77('0x35')][_0x3e77('0x1c')]);}return _0x3ca480[_0x3e77('0x66')](_0x2def37);}})[_0x3e77('0x26')](function(_0x154844){if(_0x154844){return _0x154844?{'count':_0xad1adb,'rows':_0x154844}:null;}})[_0x3e77('0x26')](respondWithResult(_0x2fdbc9,null))[_0x3e77('0x49')](handleError(_0x2fdbc9,null));};exports[_0x3e77('0x67')]=function(_0x36d358,_0x10fd5b,_0x354ede){var _0x3a104e,_0x5a224c;var _0x25b353=[];var _0x40394f=moment()['format'](_0x3e77('0x68'));return db[_0x3e77('0x30')][_0x3e77('0x4d')]({'where':{'id':_0x36d358[_0x3e77('0x4b')]['id']}})['then'](handleEntityNotFound(_0x10fd5b,null))[_0x3e77('0x26')](function(_0x1aa56b){if(_0x1aa56b){_0x5a224c=_0x1aa56b;return _0x1aa56b[_0x3e77('0x67')](_0x36d358['body'][_0x3e77('0x69')],_['omit'](_0x36d358[_0x3e77('0x4f')],[_0x3e77('0x69'),'id'])||{});}return null;})[_0x3e77('0x6a')](function(_0x2a621f){var _0x4cab54;var _0xd69c2d;_0x3a104e=_0x2a621f||[];var _0xbf12ac=[];if(_0x2a621f){for(var _0x80aa0e=0x0;_0x80aa0e<_0x2a621f['length'];_0x80aa0e+=0x1){var _0x3b18e9=_0x2a621f[_0x80aa0e][_0x3e77('0x27')]({'plain':!![]});_0x5a224c[_0x3e77('0x6b')]=_0x36d358['body'][_0x3e77('0x6b')]?_0x36d358[_0x3e77('0x4f')]['dialCheckDuplicateType']:_0x5a224c[_0x3e77('0x6b')];switch(_0x5a224c['dialCheckDuplicateType']){case'always':_0x4cab54=squel[_0x3e77('0x6c')]()[_0x3e77('0x6d')](_0x3e77('0x6e'))[_0x3e77('0x6f')]([_0x3e77('0x70'),_0x3e77('0x71'),_0x3e77('0x72'),_0x3e77('0x73'),_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel[_0x3e77('0x74')]()['field'](_0x3e77('0x70'),_0x3e77('0x70'))[_0x3e77('0x75')]('NOW()',_0x3e77('0x71'))['field']('id',_0x3e77('0x72'))[_0x3e77('0x75')](_0x3b18e9[_0x3e77('0x76')][_0x3e77('0x77')](),'ListId')[_0x3e77('0x75')](_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')](),_0x3e77('0x5d'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27','createdAt')[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))[_0x3e77('0x78')]('cm_contacts')['where'](_0x3e77('0x79'))[_0x3e77('0x3f')](_0x3e77('0x7a'),_0x3b18e9[_0x3e77('0x76')][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x7b'))[_0x3e77('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3e77('0x74')]()[_0x3e77('0x75')](_0x3e77('0x7c'))[_0x3e77('0x78')](_0x3e77('0x7d'))['where']('CampaignId\x20=\x20?',_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')]()))[_0x3e77('0x3f')](_0x3e77('0x7e'),squel[_0x3e77('0x74')]()[_0x3e77('0x75')](_0x3e77('0x7f'))[_0x3e77('0x78')](_0x3e77('0x6e'))[_0x3e77('0x3f')](_0x3e77('0x80'),_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')]())))[_0x3e77('0x77')]();break;case'onlyIfOpen':_0x4cab54=squel[_0x3e77('0x6c')]()[_0x3e77('0x6d')](_0x3e77('0x6e'))['fromQuery']([_0x3e77('0x70'),_0x3e77('0x71'),_0x3e77('0x72'),'ListId',_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel['select']()[_0x3e77('0x75')](_0x3e77('0x70'),_0x3e77('0x70'))[_0x3e77('0x75')](_0x3e77('0x81'),_0x3e77('0x71'))['field']('id',_0x3e77('0x72'))[_0x3e77('0x75')](_0x3b18e9[_0x3e77('0x76')]['toString'](),_0x3e77('0x73'))[_0x3e77('0x75')](_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')](),_0x3e77('0x5d'))['field']('\x27'+_0x40394f+'\x27',_0x3e77('0x59'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))['from'](_0x3e77('0x82'))[_0x3e77('0x3f')]('deletedAt\x20IS\x20NULL')[_0x3e77('0x3f')](_0x3e77('0x7a'),_0x3b18e9[_0x3e77('0x76')][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x7b'))[_0x3e77('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3e77('0x75')](_0x3e77('0x7f'))[_0x3e77('0x78')]('cm_hopper')[_0x3e77('0x3f')](_0x3e77('0x80'),_0x36d358[_0x3e77('0x4b')]['id']['toString']())))[_0x3e77('0x77')]();break;default:_0x4cab54=squel[_0x3e77('0x6c')]()['into'](_0x3e77('0x6e'))[_0x3e77('0x6f')]([_0x3e77('0x70'),_0x3e77('0x71'),_0x3e77('0x72'),_0x3e77('0x73'),_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel[_0x3e77('0x74')]()['field']('phone',_0x3e77('0x70'))[_0x3e77('0x75')]('NOW()','scheduledAt')[_0x3e77('0x75')]('id','ContactId')[_0x3e77('0x75')](_0x3b18e9[_0x3e77('0x76')]['toString'](),'ListId')[_0x3e77('0x75')](_0x36d358[_0x3e77('0x4b')]['id']['toString'](),_0x3e77('0x5d'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x59'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))[_0x3e77('0x78')](_0x3e77('0x82'))[_0x3e77('0x3f')]('deletedAt\x20IS\x20NULL')[_0x3e77('0x3f')](_0x3e77('0x7a'),_0x3b18e9[_0x3e77('0x76')]['toString']())[_0x3e77('0x3f')](_0x3e77('0x7b')))[_0x3e77('0x77')]();}_0xd69c2d=squel[_0x3e77('0x6c')]()[_0x3e77('0x6d')]('cm_hopper_additional_phones')[_0x3e77('0x6f')](['cmHopperId',_0x3e77('0x71'),_0x3e77('0x70'),'OrderBy',_0x3e77('0x59'),_0x3e77('0x5a')],squel['select']()['field']('h.id','id')[_0x3e77('0x75')](_0x3e77('0x81'),_0x3e77('0x71'))[_0x3e77('0x75')](_0x3e77('0x83'),_0x3e77('0x70'))[_0x3e77('0x75')]('ci.OrderBY','OrderBy')['field']('\x27'+_0x40394f+'\x27',_0x3e77('0x59'))['field']('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))['from'](_0x3e77('0x84'),'ci')[_0x3e77('0x85')](_0x3e77('0x6e'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x3e77('0x86'),_0x3b18e9['CmListId'][_0x3e77('0x77')]())['where'](_0x3e77('0x87'),_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x88'),_0x40394f))[_0x3e77('0x77')]();_0xbf12ac[_0x3e77('0x89')](db[_0x3e77('0x8a')][_0x3e77('0x35')](_0x4cab54));_0x25b353[_0x3e77('0x89')](db[_0x3e77('0x8a')][_0x3e77('0x35')](_0xd69c2d));}return BPromise[_0x3e77('0x8b')](_0xbf12ac);}})[_0x3e77('0x26')](function(){return BPromise['all'](_0x25b353);})[_0x3e77('0x26')](function(){return _0x3a104e;})['then'](respondWithResult(_0x10fd5b,null))[_0x3e77('0x49')](handleError(_0x10fd5b,null));};exports[_0x3e77('0x8c')]=function(_0x22c41a,_0xfbe6a0,_0x57dd35){return db[_0x3e77('0x30')][_0x3e77('0x4d')]({'where':{'id':_0x22c41a[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0xfbe6a0,null))['then'](function(_0xc34e57){if(_0xc34e57){return _0xc34e57[_0x3e77('0x8c')](_0x22c41a['query'][_0x3e77('0x69')]);}})[_0x3e77('0x26')](function(_0x5dd70c){if(_0x5dd70c){return db[_0x3e77('0x5c')][_0x3e77('0x2a')]({'where':{'ListId':_0x22c41a[_0x3e77('0x35')][_0x3e77('0x69')],'CampaignId':_0x22c41a[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](function(){return _0x5dd70c;});}})[_0x3e77('0x26')](respondWithStatusCode(_0xfbe6a0,null))[_0x3e77('0x49')](handleError(_0xfbe6a0,null));};exports[_0x3e77('0x8d')]=function(_0x33a8ac,_0x18a735,_0x4cdce9){var _0x44ab7f={};var _0x12e4ed={};var _0x4260bf;var _0x2f72a0;return db[_0x3e77('0x30')][_0x3e77('0x60')]({'where':{'id':_0x33a8ac[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x18a735,null))[_0x3e77('0x26')](function(_0xef7ec9){if(_0xef7ec9){_0x4260bf=_0xef7ec9;_0x12e4ed[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x8e')][_0x3e77('0x31')]);_0x12e4ed['query']=_['keys'](_0x33a8ac[_0x3e77('0x35')]);_0x12e4ed[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x12e4ed[_0x3e77('0x34')],_0x12e4ed[_0x3e77('0x35')]);_0x44ab7f['attributes']=_[_0x3e77('0x38')](_0x12e4ed[_0x3e77('0x34')],qs['fields'](_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x44ab7f['attributes']=_0x44ab7f[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x44ab7f['attributes']:_0x12e4ed[_0x3e77('0x34')];_0x44ab7f[_0x3e77('0x3d')]=qs['sort'](_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x3e')]);_0x44ab7f[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x33a8ac[_0x3e77('0x35')],_0x12e4ed[_0x3e77('0x37')]));if(_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x41')]){_0x44ab7f['where']=_[_0x3e77('0x42')](_0x44ab7f[_0x3e77('0x3f')],{'$or':_[_0x3e77('0x2f')](_0x44ab7f[_0x3e77('0x39')],function(_0x59b408){var _0x506a73={};_0x506a73[_0x59b408]={'$like':'%'+_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x506a73;})});}_0x44ab7f=_['merge']({},_0x44ab7f,_0x33a8ac[_0x3e77('0x45')]);return _0x4260bf[_0x3e77('0x8d')](_0x44ab7f);}})['then'](function(_0x4a56ea){if(_0x4a56ea){_0x2f72a0=_0x4a56ea[_0x3e77('0x4c')];if(!_0x33a8ac['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x44ab7f[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x33a8ac['query']['limit']);_0x44ab7f['offset']=qs[_0x3e77('0x1c')](_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x1c')]);}return _0x4260bf[_0x3e77('0x8d')](_0x44ab7f);}})[_0x3e77('0x26')](function(_0x3c88ec){if(_0x3c88ec){return _0x3c88ec?{'count':_0x2f72a0,'rows':_0x3c88ec}:null;}})['then'](respondWithResult(_0x18a735,null))[_0x3e77('0x49')](handleError(_0x18a735,null));};exports[_0x3e77('0x8f')]=function(_0x475079,_0x50c60e,_0x252d72){var _0x27b586,_0x4855cd;var _0x5ad1d7=[];var _0x4a6f7e=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3e77('0x30')]['find']({'where':{'id':_0x475079[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x50c60e,null))[_0x3e77('0x26')](function(_0x524d1c){if(_0x524d1c){_0x4855cd=_0x524d1c;return _0x524d1c[_0x3e77('0x8f')](_0x475079[_0x3e77('0x4f')][_0x3e77('0x69')],_[_0x3e77('0x58')](_0x475079[_0x3e77('0x4f')],[_0x3e77('0x69'),'id'])||{});}return null;})[_0x3e77('0x6a')](function(_0x5b1585){var _0x121e28;var _0x129c74;_0x27b586=_0x5b1585||[];var _0x7f34af=[];if(_0x5b1585){for(var _0x458b59=0x0;_0x458b59<_0x5b1585[_0x3e77('0x4c')];_0x458b59+=0x1){var _0x2f5f44=_0x5b1585[_0x458b59][_0x3e77('0x27')]({'plain':!![]});_0x121e28=squel['insert']()[_0x3e77('0x6d')](_0x3e77('0x90'))[_0x3e77('0x6f')]([_0x3e77('0x70'),_0x3e77('0x72'),_0x3e77('0x73'),_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel[_0x3e77('0x74')]()[_0x3e77('0x75')]('phone',_0x3e77('0x70'))['field']('id',_0x3e77('0x72'))[_0x3e77('0x75')](_0x2f5f44[_0x3e77('0x76')][_0x3e77('0x77')](),_0x3e77('0x73'))['field'](_0x475079['params']['id']['toString'](),_0x3e77('0x5d'))[_0x3e77('0x75')](_0x3e77('0x81'),_0x3e77('0x59'))['field'](_0x3e77('0x81'),'updatedAt')['from'](_0x3e77('0x82'))[_0x3e77('0x3f')](_0x3e77('0x79'))['where'](_0x3e77('0x7a'),_0x2f5f44['CmListId'][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x7b')))[_0x3e77('0x77')]();_0x7f34af['push'](db[_0x3e77('0x8a')][_0x3e77('0x35')](_0x121e28));}return BPromise['all'](_0x7f34af);}})[_0x3e77('0x26')](function(){return _0x27b586;})['then'](respondWithResult(_0x50c60e,null))['catch'](handleError(_0x50c60e,null));};exports[_0x3e77('0x91')]=function(_0x5f4d01,_0x5237f2,_0x56e17f){return db[_0x3e77('0x30')]['find']({'where':{'id':_0x5f4d01[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x5237f2,null))[_0x3e77('0x26')](function(_0x3980db){if(_0x3980db){return _0x3980db[_0x3e77('0x91')](_0x5f4d01['query'][_0x3e77('0x69')]);}})['then'](function(_0x434ebb){if(_0x434ebb){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x5f4d01[_0x3e77('0x35')][_0x3e77('0x69')],'CampaignId':_0x5f4d01[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](function(){return _0x434ebb;});}})[_0x3e77('0x26')](respondWithStatusCode(_0x5237f2,null))[_0x3e77('0x49')](handleError(_0x5237f2,null));}; \ No newline at end of file +var _0x97c1=['where','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','find','autoAssociation','getHoppers','findOne','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','omit','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','insert','into','cmHopperId','OrderBy','h.id','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','format','addBlackLists','removeBlackLists','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','IvrCampaigns','sendStatus','error','stack','name','Campaign','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x26d034,_0x2c22db){var _0x3015aa=function(_0x282e96){while(--_0x282e96){_0x26d034['push'](_0x26d034['shift']());}};_0x3015aa(++_0x2c22db);}(_0x97c1,0xdf));var _0x197c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x97c1[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x197c('0x0'));var rimraf=require(_0x197c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x197c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x197c('0x3'));var Mustache=require(_0x197c('0x4'));var util=require(_0x197c('0x5'));var path=require(_0x197c('0x6'));var sox=require(_0x197c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x197c('0x8'));var _=require(_0x197c('0x9'));var squel=require(_0x197c('0xa'));var crypto=require(_0x197c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x197c('0xc'));var querystring=require('querystring');var Papa=require(_0x197c('0xd'));var Redis=require(_0x197c('0xe'));var authService=require(_0x197c('0xf'));var qs=require(_0x197c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x197c('0x11'));var logger=require(_0x197c('0x12'))(_0x197c('0x13'));var utils=require(_0x197c('0x14'));var config=require(_0x197c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x197c('0x16'))['db'];function respondWithStatusCode(_0x668f8,_0x27e46f){_0x27e46f=_0x27e46f||0xcc;return function(_0x1adcfa){if(_0x1adcfa){return _0x668f8['sendStatus'](_0x27e46f);}return _0x668f8[_0x197c('0x17')](_0x27e46f)[_0x197c('0x18')]();};}function respondWithResult(_0x5a7e1c,_0xf735ce){_0xf735ce=_0xf735ce||0xc8;return function(_0x188ff2){if(_0x188ff2){return _0x5a7e1c[_0x197c('0x17')](_0xf735ce)['json'](_0x188ff2);}};}function respondWithFilteredResult(_0x5194c3,_0x422dfa){return function(_0x2bc612){if(_0x2bc612){var _0x2083d4=typeof _0x422dfa[_0x197c('0x19')]===_0x197c('0x1a')&&typeof _0x422dfa[_0x197c('0x1b')]===_0x197c('0x1a');var _0x75beba=_0x2bc612['count'];var _0x372311=_0x2083d4?0x0:_0x422dfa['offset'];var _0x50ac52=_0x2083d4?_0x2bc612[_0x197c('0x1c')]:_0x422dfa[_0x197c('0x19')]+_0x422dfa[_0x197c('0x1b')];var _0x2ce10d;if(_0x50ac52>=_0x75beba){_0x50ac52=_0x75beba;_0x2ce10d=0xc8;}else{_0x2ce10d=0xce;}_0x5194c3['status'](_0x2ce10d);return _0x5194c3[_0x197c('0x1d')](_0x197c('0x1e'),_0x372311+'-'+_0x50ac52+'/'+_0x75beba)[_0x197c('0x1f')](_0x2bc612);}return null;};}function patchUpdates(_0x5c278a){return function(_0x1adb43){try{jsonpatch[_0x197c('0x20')](_0x1adb43,_0x5c278a,!![]);}catch(_0x3b5c4c){return BPromise[_0x197c('0x21')](_0x3b5c4c);}return _0x1adb43[_0x197c('0x22')]();};}function saveUpdates(_0x3c2151,_0x362bbf){return function(_0x2092a0){if(_0x2092a0){return _0x2092a0[_0x197c('0x23')](_0x3c2151)[_0x197c('0x24')](function(_0x29b266){return _0x29b266;});}return null;};}function removeEntity(_0x177bc9,_0x174942){return function(_0x2a1310){if(_0x2a1310){return _0x2a1310[_0x197c('0x25')]()[_0x197c('0x24')](function(){var _0x5f4a02=_0x2a1310[_0x197c('0x26')]({'plain':!![]});var _0x2911dd=_0x197c('0x27');return db['UserProfileResource'][_0x197c('0x25')]({'where':{'type':_0x2911dd,'resourceId':_0x5f4a02['id']}})[_0x197c('0x24')](function(){return _0x2a1310;});})['then'](function(){_0x177bc9['status'](0xcc)[_0x197c('0x18')]();});}};}function handleEntityNotFound(_0x48f759,_0xfbca7a){return function(_0x14b0aa){if(!_0x14b0aa){_0x48f759[_0x197c('0x28')](0x194);}return _0x14b0aa;};}function handleError(_0x16e026,_0x2f031c){_0x2f031c=_0x2f031c||0x1f4;return function(_0x3cdcd8){logger[_0x197c('0x29')](_0x3cdcd8[_0x197c('0x2a')]);if(_0x3cdcd8[_0x197c('0x2b')]){delete _0x3cdcd8['name'];}_0x16e026['status'](_0x2f031c)['send'](_0x3cdcd8);};}exports['index']=function(_0x5f7425,_0x4c9256){var _0x252cde={},_0x35dbf3={},_0x58bc60={'count':0x0,'rows':[]};var _0x422ac6=_['map'](db[_0x197c('0x2c')][_0x197c('0x2d')],function(_0x2ace33){return{'name':_0x2ace33[_0x197c('0x2e')],'type':_0x2ace33[_0x197c('0x2f')][_0x197c('0x30')]};});_0x35dbf3[_0x197c('0x31')]=_[_0x197c('0x32')](_0x422ac6,_0x197c('0x2b'));_0x35dbf3['query']=_['keys'](_0x5f7425[_0x197c('0x33')]);_0x35dbf3[_0x197c('0x34')]=_[_0x197c('0x35')](_0x35dbf3[_0x197c('0x31')],_0x35dbf3[_0x197c('0x33')]);_0x252cde[_0x197c('0x36')]=_[_0x197c('0x35')](_0x35dbf3['model'],qs['fields'](_0x5f7425[_0x197c('0x33')][_0x197c('0x37')]));_0x252cde['attributes']=_0x252cde['attributes'][_0x197c('0x38')]?_0x252cde[_0x197c('0x36')]:_0x35dbf3[_0x197c('0x31')];if(!_0x5f7425[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x252cde[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x5f7425[_0x197c('0x33')]['limit']);_0x252cde[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x5f7425[_0x197c('0x33')][_0x197c('0x19')]);}_0x252cde[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x5f7425['query'][_0x197c('0x3c')]);_0x252cde[_0x197c('0x3d')]=qs[_0x197c('0x34')](_['pick'](_0x5f7425[_0x197c('0x33')],_0x35dbf3[_0x197c('0x34')]),_0x422ac6);if(_0x5f7425[_0x197c('0x33')][_0x197c('0x3e')]){_0x252cde[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x252cde[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x422ac6,function(_0x323a14){if(_0x323a14[_0x197c('0x2f')]!=='VIRTUAL'){var _0x2705f5={};_0x2705f5[_0x323a14[_0x197c('0x2b')]]={'$like':'%'+_0x5f7425['query']['filter']+'%'};return _0x2705f5;}})});}_0x252cde=_[_0x197c('0x3f')]({},_0x252cde,_0x5f7425[_0x197c('0x40')]);var _0x3517a6={'where':_0x252cde[_0x197c('0x3d')]};return db[_0x197c('0x2c')]['count'](_0x3517a6)[_0x197c('0x24')](function(_0x3efae){_0x58bc60[_0x197c('0x1c')]=_0x3efae;if(_0x5f7425[_0x197c('0x33')][_0x197c('0x41')]){_0x252cde['include']=[{'all':!![]}];}return db[_0x197c('0x2c')][_0x197c('0x42')](_0x252cde);})[_0x197c('0x24')](function(_0x197b27){_0x58bc60[_0x197c('0x43')]=_0x197b27;return _0x58bc60;})['then'](respondWithFilteredResult(_0x4c9256,_0x252cde))[_0x197c('0x44')](handleError(_0x4c9256,null));};exports[_0x197c('0x45')]=function(_0x3b7fc1,_0x35f36d){var _0x3e6d6e={'raw':![],'where':{'id':_0x3b7fc1[_0x197c('0x46')]['id']}},_0x41eb51={};_0x41eb51[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x2c')][_0x197c('0x2d')]);_0x41eb51['query']=_['keys'](_0x3b7fc1['query']);_0x41eb51['filters']=_[_0x197c('0x35')](_0x41eb51[_0x197c('0x31')],_0x41eb51['query']);_0x3e6d6e[_0x197c('0x36')]=_[_0x197c('0x35')](_0x41eb51['model'],qs[_0x197c('0x37')](_0x3b7fc1[_0x197c('0x33')]['fields']));_0x3e6d6e[_0x197c('0x36')]=_0x3e6d6e[_0x197c('0x36')]['length']?_0x3e6d6e[_0x197c('0x36')]:_0x41eb51[_0x197c('0x31')];if(_0x3b7fc1[_0x197c('0x33')]['includeAll']){_0x3e6d6e[_0x197c('0x48')]=[{'all':!![]}];}_0x3e6d6e=_[_0x197c('0x3f')]({},_0x3e6d6e,_0x3b7fc1[_0x197c('0x40')]);return db[_0x197c('0x2c')]['find'](_0x3e6d6e)[_0x197c('0x24')](handleEntityNotFound(_0x35f36d,null))[_0x197c('0x24')](respondWithResult(_0x35f36d,null))[_0x197c('0x44')](handleError(_0x35f36d,null));};exports['create']=function(_0x5994bf,_0x3a5089){return db[_0x197c('0x2c')][_0x197c('0x49')](_0x5994bf[_0x197c('0x4a')],{})[_0x197c('0x24')](function(_0x28fac4){var _0x4c82d5=_0x5994bf[_0x197c('0x4b')]['get']({'plain':!![]});if(!_0x4c82d5)throw new Error(_0x197c('0x4c'));if(_0x4c82d5[_0x197c('0x4d')]===_0x197c('0x4b')){var _0x9e8c6a=_0x28fac4[_0x197c('0x26')]({'plain':!![]});var _0x2ab21f=_0x197c('0x27');return db[_0x197c('0x4e')]['find']({'where':{'name':_0x2ab21f,'userProfileId':_0x4c82d5[_0x197c('0x4f')]},'raw':!![]})[_0x197c('0x24')](function(_0x43e9b7){if(_0x43e9b7&&_0x43e9b7['autoAssociation']===0x0){return db[_0x197c('0x50')]['create']({'name':_0x9e8c6a[_0x197c('0x2b')],'resourceId':_0x9e8c6a['id'],'type':_0x43e9b7[_0x197c('0x2b')],'sectionId':_0x43e9b7['id']},{})[_0x197c('0x24')](function(){return _0x28fac4;});}else{return _0x28fac4;}})[_0x197c('0x44')](function(_0x1d7cdd){logger[_0x197c('0x29')](_0x197c('0x51'),_0x1d7cdd);throw _0x1d7cdd;});}return _0x28fac4;})[_0x197c('0x24')](respondWithResult(_0x3a5089,0xc9))['catch'](handleError(_0x3a5089,null));};exports[_0x197c('0x52')]=function(_0x3a9261,_0x275294){var _0x5f3301={'where':{'id':_0x3a9261[_0x197c('0x46')]['id']}},_0x244faa={};_0x244faa[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x2c')]['rawAttributes']);_0x5f3301['attributes']=_[_0x197c('0x35')](_0x244faa[_0x197c('0x31')],qs[_0x197c('0x37')](_0x3a9261[_0x197c('0x33')][_0x197c('0x37')]));_0x5f3301['attributes']=_0x5f3301['attributes'][_0x197c('0x38')]?_0x5f3301[_0x197c('0x36')]:_0x244faa['model'];if(_0x3a9261[_0x197c('0x33')][_0x197c('0x41')]){_0x5f3301[_0x197c('0x48')]=[{'all':!![]}];}_0x5f3301=_[_0x197c('0x3f')]({},_0x5f3301,_0x3a9261[_0x197c('0x40')]);return db[_0x197c('0x2c')]['find'](_0x5f3301)[_0x197c('0x24')](handleEntityNotFound(_0x275294,null))[_0x197c('0x24')](function(_0x57c8c8){if(_0x57c8c8){var _0x480cab=_0x57c8c8[_0x197c('0x26')]({'plain':!![]});_0x480cab=qs['omit'](_0x480cab,['id',_0x197c('0x53'),_0x197c('0x54')]);_0x3a9261[_0x197c('0x4a')]=_['omit'](_0x3a9261[_0x197c('0x4a')],['id',_0x197c('0x53'),'updatedAt']);return db[_0x197c('0x2c')][_0x197c('0x49')](_[_0x197c('0x3f')](_0x480cab,_0x3a9261['body']),{'include':_0x3a9261[_0x197c('0x33')][_0x197c('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0x570d76){var _0x381191=_0x3a9261[_0x197c('0x4b')][_0x197c('0x26')]({'plain':!![]});if(!_0x381191)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x381191[_0x197c('0x4d')]===_0x197c('0x4b')){var _0x32e8ba=_0x570d76['get']({'plain':!![]});var _0xe84f3b=_0x197c('0x27');return db[_0x197c('0x4e')][_0x197c('0x55')]({'where':{'name':_0xe84f3b,'userProfileId':_0x381191[_0x197c('0x4f')]},'raw':!![]})[_0x197c('0x24')](function(_0x8d1f3f){if(_0x8d1f3f&&_0x8d1f3f[_0x197c('0x56')]===0x0){return db[_0x197c('0x50')][_0x197c('0x49')]({'name':_0x32e8ba['name'],'resourceId':_0x32e8ba['id'],'type':_0x8d1f3f[_0x197c('0x2b')],'sectionId':_0x8d1f3f['id']},{})['then'](function(){return _0x570d76;});}else{return _0x570d76;}})['catch'](function(_0x4a8e13){logger['error'](_0x197c('0x51'),_0x4a8e13);throw _0x4a8e13;});}return _0x570d76;});}})[_0x197c('0x24')](respondWithResult(_0x275294,0xc9))[_0x197c('0x44')](handleError(_0x275294,null));};exports[_0x197c('0x23')]=function(_0x55b744,_0x32d739){if(_0x55b744['body']['id']){delete _0x55b744[_0x197c('0x4a')]['id'];}return db['Campaign'][_0x197c('0x55')]({'where':{'id':_0x55b744['params']['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x32d739,null))[_0x197c('0x24')](saveUpdates(_0x55b744[_0x197c('0x4a')],null))[_0x197c('0x24')](respondWithResult(_0x32d739,null))['catch'](handleError(_0x32d739,null));};exports[_0x197c('0x25')]=function(_0x304cb7,_0x33ae9c){return db['Campaign'][_0x197c('0x55')]({'where':{'id':_0x304cb7[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x33ae9c,null))[_0x197c('0x24')](removeEntity(_0x33ae9c,null))[_0x197c('0x44')](handleError(_0x33ae9c,null));};exports[_0x197c('0x57')]=function(_0x1e6371,_0x436a53,_0x2c7e66){var _0x1947bd={'raw':!![],'where':{}};var _0x342efa={};var _0x25d3c1={'count':0x0,'rows':[]};return db[_0x197c('0x2c')][_0x197c('0x58')]({'where':{'id':_0x1e6371[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x436a53,null))[_0x197c('0x24')](function(_0x2a03e3){if(_0x2a03e3){_0x342efa['model']=_['keys'](db['CmHopper'][_0x197c('0x2d')]);_0x342efa['query']=_[_0x197c('0x47')](_0x1e6371['query']);_0x342efa['filters']=_[_0x197c('0x35')](_0x342efa[_0x197c('0x31')],_0x342efa[_0x197c('0x33')]);_0x1947bd['attributes']=_[_0x197c('0x35')](_0x342efa[_0x197c('0x31')],qs['fields'](_0x1e6371[_0x197c('0x33')][_0x197c('0x37')]));_0x1947bd[_0x197c('0x36')]=_0x1947bd[_0x197c('0x36')]['length']?_0x1947bd[_0x197c('0x36')]:_0x342efa['model'];if(!_0x1e6371[_0x197c('0x33')]['hasOwnProperty'](_0x197c('0x3a'))){_0x1947bd[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x1e6371['query'][_0x197c('0x1b')]);_0x1947bd[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x1e6371['query'][_0x197c('0x19')]);}_0x1947bd[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x1e6371[_0x197c('0x33')][_0x197c('0x3c')]);_0x1947bd[_0x197c('0x3d')]=qs['filters'](_[_0x197c('0x59')](_0x1e6371['query'],_0x342efa['filters']));_0x1947bd[_0x197c('0x3d')][_0x197c('0x5a')]=_0x2a03e3['id'];if(_0x1e6371['query'][_0x197c('0x3e')]){_0x1947bd[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x1947bd[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x1947bd['attributes'],function(_0x5da64e){var _0x4ca9b9={};_0x4ca9b9[_0x5da64e]={'$like':'%'+_0x1e6371['query'][_0x197c('0x3e')]+'%'};return _0x4ca9b9;})});}_0x1947bd=_[_0x197c('0x3f')]({},_0x1947bd,_0x1e6371['options']);return db['CmHopper'][_0x197c('0x1c')]({'where':_0x1947bd['where']})['then'](function(_0x2d4b26){_0x25d3c1[_0x197c('0x1c')]=_0x2d4b26;if(_0x1e6371[_0x197c('0x33')][_0x197c('0x41')]){_0x1947bd[_0x197c('0x48')]=[{'all':!![]}];}return db[_0x197c('0x5b')]['findAll'](_0x1947bd);})[_0x197c('0x24')](function(_0x2321e1){_0x25d3c1[_0x197c('0x43')]=_0x2321e1;return _0x25d3c1;});}})[_0x197c('0x24')](respondWithFilteredResult(_0x436a53,_0x1947bd))[_0x197c('0x44')](handleError(_0x436a53,null));};exports[_0x197c('0x5c')]=function(_0x4cfcc6,_0x4b332f,_0x15d047){var _0x6c3afd={'raw':!![],'where':{}};var _0x49283d={};var _0x2519a1={'count':0x0,'rows':[]};return db[_0x197c('0x2c')][_0x197c('0x58')]({'where':{'id':_0x4cfcc6['params']['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x4b332f,null))[_0x197c('0x24')](function(_0x530d41){if(_0x530d41){_0x49283d[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x5d')][_0x197c('0x2d')]);_0x49283d[_0x197c('0x33')]=_['keys'](_0x4cfcc6['query']);_0x49283d['filters']=_[_0x197c('0x35')](_0x49283d['model'],_0x49283d['query']);_0x6c3afd[_0x197c('0x36')]=_[_0x197c('0x35')](_0x49283d[_0x197c('0x31')],qs[_0x197c('0x37')](_0x4cfcc6[_0x197c('0x33')]['fields']));_0x6c3afd['attributes']=_0x6c3afd[_0x197c('0x36')][_0x197c('0x38')]?_0x6c3afd['attributes']:_0x49283d[_0x197c('0x31')];if(!_0x4cfcc6[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x6c3afd[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x4cfcc6['query'][_0x197c('0x1b')]);_0x6c3afd[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x4cfcc6[_0x197c('0x33')][_0x197c('0x19')]);}_0x6c3afd['order']=qs['sort'](_0x4cfcc6[_0x197c('0x33')]['sort']);_0x6c3afd[_0x197c('0x3d')]=qs[_0x197c('0x34')](_[_0x197c('0x59')](_0x4cfcc6[_0x197c('0x33')],_0x49283d[_0x197c('0x34')]));_0x6c3afd['where'][_0x197c('0x5a')]=_0x530d41['id'];if(_0x4cfcc6[_0x197c('0x33')][_0x197c('0x3e')]){_0x6c3afd[_0x197c('0x3d')]=_['merge'](_0x6c3afd['where'],{'$or':_[_0x197c('0x32')](_0x6c3afd['attributes'],function(_0x5505e2){var _0x34b3d6={};_0x34b3d6[_0x5505e2]={'$like':'%'+_0x4cfcc6[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x34b3d6;})});}_0x6c3afd=_['merge']({},_0x6c3afd,_0x4cfcc6['options']);return db[_0x197c('0x5d')][_0x197c('0x1c')]({'where':_0x6c3afd['where']})[_0x197c('0x24')](function(_0x235fce){_0x2519a1['count']=_0x235fce;if(_0x4cfcc6[_0x197c('0x33')][_0x197c('0x41')]){_0x6c3afd['include']=[{'all':!![]}];}return db[_0x197c('0x5d')]['findAll'](_0x6c3afd);})[_0x197c('0x24')](function(_0x18c722){_0x2519a1[_0x197c('0x43')]=_0x18c722;return _0x2519a1;});}})[_0x197c('0x24')](respondWithFilteredResult(_0x4b332f,_0x6c3afd))[_0x197c('0x44')](handleError(_0x4b332f,null));};exports['getHopperFinals']=function(_0x2d1b23,_0x41b34c,_0x35269e){var _0x1a684e={'raw':!![],'where':{}};var _0x2bbe66={};var _0x33c765={'count':0x0,'rows':[]};return db[_0x197c('0x2c')]['findOne']({'where':{'id':_0x2d1b23[_0x197c('0x46')]['id']}})['then'](handleEntityNotFound(_0x41b34c,null))[_0x197c('0x24')](function(_0x3c3f7a){if(_0x3c3f7a){_0x2bbe66[_0x197c('0x31')]=_[_0x197c('0x47')](db['CmHopperFinal'][_0x197c('0x2d')]);_0x2bbe66[_0x197c('0x33')]=_[_0x197c('0x47')](_0x2d1b23['query']);_0x2bbe66[_0x197c('0x34')]=_[_0x197c('0x35')](_0x2bbe66[_0x197c('0x31')],_0x2bbe66[_0x197c('0x33')]);_0x1a684e[_0x197c('0x36')]=_[_0x197c('0x35')](_0x2bbe66[_0x197c('0x31')],qs['fields'](_0x2d1b23[_0x197c('0x33')]['fields']));_0x1a684e[_0x197c('0x36')]=_0x1a684e[_0x197c('0x36')][_0x197c('0x38')]?_0x1a684e[_0x197c('0x36')]:_0x2bbe66[_0x197c('0x31')];if(!_0x2d1b23['query'][_0x197c('0x39')](_0x197c('0x3a'))){_0x1a684e[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x2d1b23[_0x197c('0x33')]['limit']);_0x1a684e['offset']=qs[_0x197c('0x19')](_0x2d1b23[_0x197c('0x33')][_0x197c('0x19')]);}_0x1a684e[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x2d1b23[_0x197c('0x33')][_0x197c('0x3c')]);_0x1a684e[_0x197c('0x3d')]=qs['filters'](_[_0x197c('0x59')](_0x2d1b23[_0x197c('0x33')],_0x2bbe66['filters']));_0x1a684e[_0x197c('0x3d')][_0x197c('0x5a')]=_0x3c3f7a['id'];if(_0x2d1b23['query'][_0x197c('0x3e')]){_0x1a684e[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x1a684e[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x1a684e['attributes'],function(_0x5563ff){var _0x31fe6a={};_0x31fe6a[_0x5563ff]={'$like':'%'+_0x2d1b23[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x31fe6a;})});}_0x1a684e=_[_0x197c('0x3f')]({},_0x1a684e,_0x2d1b23[_0x197c('0x40')]);return db[_0x197c('0x5e')][_0x197c('0x1c')]({'where':_0x1a684e[_0x197c('0x3d')]})['then'](function(_0xd324a0){_0x33c765[_0x197c('0x1c')]=_0xd324a0;if(_0x2d1b23[_0x197c('0x33')][_0x197c('0x41')]){_0x1a684e[_0x197c('0x48')]=[{'all':!![]}];}return db[_0x197c('0x5e')]['findAll'](_0x1a684e);})[_0x197c('0x24')](function(_0x16c3be){_0x33c765[_0x197c('0x43')]=_0x16c3be;return _0x33c765;});}})['then'](respondWithFilteredResult(_0x41b34c,_0x1a684e))[_0x197c('0x44')](handleError(_0x41b34c,null));};exports['getHopperBlacks']=function(_0x3207ed,_0x24a61d,_0x165b03){var _0x6174a5={'raw':!![],'where':{}};var _0x14040f={};var _0x2141b1={'count':0x0,'rows':[]};return db[_0x197c('0x2c')]['findOne']({'where':{'id':_0x3207ed[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x24a61d,null))[_0x197c('0x24')](function(_0x307edb){if(_0x307edb){_0x14040f['model']=_[_0x197c('0x47')](db['CmHopperBlack'][_0x197c('0x2d')]);_0x14040f[_0x197c('0x33')]=_[_0x197c('0x47')](_0x3207ed[_0x197c('0x33')]);_0x14040f['filters']=_[_0x197c('0x35')](_0x14040f[_0x197c('0x31')],_0x14040f[_0x197c('0x33')]);_0x6174a5[_0x197c('0x36')]=_[_0x197c('0x35')](_0x14040f['model'],qs[_0x197c('0x37')](_0x3207ed[_0x197c('0x33')][_0x197c('0x37')]));_0x6174a5[_0x197c('0x36')]=_0x6174a5[_0x197c('0x36')]['length']?_0x6174a5['attributes']:_0x14040f[_0x197c('0x31')];if(!_0x3207ed[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x6174a5[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x3207ed['query'][_0x197c('0x1b')]);_0x6174a5['offset']=qs['offset'](_0x3207ed[_0x197c('0x33')][_0x197c('0x19')]);}_0x6174a5[_0x197c('0x3b')]=qs['sort'](_0x3207ed[_0x197c('0x33')][_0x197c('0x3c')]);_0x6174a5[_0x197c('0x3d')]=qs[_0x197c('0x34')](_[_0x197c('0x59')](_0x3207ed[_0x197c('0x33')],_0x14040f['filters']));_0x6174a5[_0x197c('0x3d')]['CampaignId']=_0x307edb['id'];if(_0x3207ed[_0x197c('0x33')]['filter']){_0x6174a5[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x6174a5['where'],{'$or':_[_0x197c('0x32')](_0x6174a5[_0x197c('0x36')],function(_0x25ed2c){var _0x24d25a={};_0x24d25a[_0x25ed2c]={'$like':'%'+_0x3207ed[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x24d25a;})});}_0x6174a5=_[_0x197c('0x3f')]({},_0x6174a5,_0x3207ed[_0x197c('0x40')]);return db[_0x197c('0x5f')][_0x197c('0x1c')]({'where':_0x6174a5[_0x197c('0x3d')]})[_0x197c('0x24')](function(_0x4a27ac){_0x2141b1['count']=_0x4a27ac;if(_0x3207ed[_0x197c('0x33')][_0x197c('0x41')]){_0x6174a5[_0x197c('0x48')]=[{'all':!![]}];}return db[_0x197c('0x5f')][_0x197c('0x42')](_0x6174a5);})['then'](function(_0x31d653){_0x2141b1[_0x197c('0x43')]=_0x31d653;return _0x2141b1;});}})[_0x197c('0x24')](respondWithFilteredResult(_0x24a61d,_0x6174a5))[_0x197c('0x44')](handleError(_0x24a61d,null));};exports[_0x197c('0x60')]=function(_0x32370a,_0x18e177,_0x2ce52a){var _0x211abe={};var _0x1e3364={};var _0xc8ecb4;var _0x2b5d20;return db['Campaign']['findOne']({'where':{'id':_0x32370a[_0x197c('0x46')]['id']}})['then'](handleEntityNotFound(_0x18e177,null))[_0x197c('0x24')](function(_0x74def6){if(_0x74def6){_0xc8ecb4=_0x74def6;_0x1e3364[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x61')][_0x197c('0x2d')]);_0x1e3364[_0x197c('0x33')]=_['keys'](_0x32370a[_0x197c('0x33')]);_0x1e3364['filters']=_[_0x197c('0x35')](_0x1e3364[_0x197c('0x31')],_0x1e3364[_0x197c('0x33')]);_0x211abe[_0x197c('0x36')]=_[_0x197c('0x35')](_0x1e3364[_0x197c('0x31')],qs['fields'](_0x32370a[_0x197c('0x33')][_0x197c('0x37')]));_0x211abe[_0x197c('0x36')]=_0x211abe[_0x197c('0x36')][_0x197c('0x38')]?_0x211abe[_0x197c('0x36')]:_0x1e3364[_0x197c('0x31')];_0x211abe[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x32370a[_0x197c('0x33')]['sort']);_0x211abe[_0x197c('0x3d')]=qs[_0x197c('0x34')](_[_0x197c('0x59')](_0x32370a[_0x197c('0x33')],_0x1e3364[_0x197c('0x34')]));if(_0x32370a[_0x197c('0x33')][_0x197c('0x3e')]){_0x211abe[_0x197c('0x3d')]=_['merge'](_0x211abe[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x211abe[_0x197c('0x36')],function(_0x4f92e2){var _0x1eee91={};_0x1eee91[_0x4f92e2]={'$like':'%'+_0x32370a[_0x197c('0x33')]['filter']+'%'};return _0x1eee91;})});}_0x211abe=_[_0x197c('0x3f')]({},_0x211abe,_0x32370a[_0x197c('0x40')]);return _0xc8ecb4['getLists'](_0x211abe);}})[_0x197c('0x24')](function(_0x2dcb84){if(_0x2dcb84){_0x2b5d20=_0x2dcb84[_0x197c('0x38')];if(!_0x32370a[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x211abe[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x32370a['query']['limit']);_0x211abe[_0x197c('0x19')]=qs['offset'](_0x32370a[_0x197c('0x33')][_0x197c('0x19')]);}return _0xc8ecb4[_0x197c('0x60')](_0x211abe);}})['then'](function(_0x2fb26b){if(_0x2fb26b){return _0x2fb26b?{'count':_0x2b5d20,'rows':_0x2fb26b}:null;}})[_0x197c('0x24')](respondWithResult(_0x18e177,null))[_0x197c('0x44')](handleError(_0x18e177,null));};exports[_0x197c('0x62')]=function(_0x29e6ee,_0x57d9a4,_0x499624){var _0x29c93c,_0x27285d;var _0x478431=[];var _0x1db087=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x197c('0x55')]({'where':{'id':_0x29e6ee[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x57d9a4,null))[_0x197c('0x24')](function(_0x277247){if(_0x277247){_0x27285d=_0x277247;return _0x277247[_0x197c('0x62')](_0x29e6ee[_0x197c('0x4a')][_0x197c('0x63')],_[_0x197c('0x64')](_0x29e6ee['body'],[_0x197c('0x63'),'id'])||{});}return null;})[_0x197c('0x65')](function(_0x4675d3){var _0x1355e6;var _0x53cd6e;_0x29c93c=_0x4675d3||[];var _0x201ed7=[];if(_0x4675d3){for(var _0x283fa4=0x0;_0x283fa4<_0x4675d3[_0x197c('0x38')];_0x283fa4+=0x1){var _0x48ca1a=_0x4675d3[_0x283fa4][_0x197c('0x26')]({'plain':!![]});_0x27285d['dialCheckDuplicateType']=_0x29e6ee[_0x197c('0x4a')][_0x197c('0x66')]?_0x29e6ee[_0x197c('0x4a')][_0x197c('0x66')]:_0x27285d['dialCheckDuplicateType'];switch(_0x27285d['dialCheckDuplicateType']){case _0x197c('0x67'):_0x1355e6=squel['insert']()['into'](_0x197c('0x68'))[_0x197c('0x69')](['phone',_0x197c('0x6a'),_0x197c('0x6b'),_0x197c('0x6c'),_0x197c('0x5a'),_0x197c('0x53'),_0x197c('0x54')],squel['select']()[_0x197c('0x6d')](_0x197c('0x6e'),_0x197c('0x6e'))[_0x197c('0x6d')](_0x197c('0x6f'),'scheduledAt')[_0x197c('0x6d')]('id',_0x197c('0x6b'))[_0x197c('0x6d')](_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')](),_0x197c('0x6c'))[_0x197c('0x6d')](_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')](),_0x197c('0x5a'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x53'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x54'))[_0x197c('0x72')](_0x197c('0x73'))[_0x197c('0x3d')](_0x197c('0x74'))[_0x197c('0x3d')](_0x197c('0x75'),_0x48ca1a[_0x197c('0x70')]['toString']())[_0x197c('0x3d')](_0x197c('0x76'))['where'](_0x197c('0x77'),squel['select']()[_0x197c('0x6d')](_0x197c('0x78'))[_0x197c('0x72')](_0x197c('0x79'))[_0x197c('0x3d')](_0x197c('0x7a'),_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x197c('0x7b')]()[_0x197c('0x6d')](_0x197c('0x7c'))[_0x197c('0x72')](_0x197c('0x68'))[_0x197c('0x3d')](_0x197c('0x7a'),_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')]())))[_0x197c('0x71')]();break;case'onlyIfOpen':_0x1355e6=squel[_0x197c('0x7d')]()[_0x197c('0x7e')](_0x197c('0x68'))[_0x197c('0x69')]([_0x197c('0x6e'),_0x197c('0x6a'),'ContactId',_0x197c('0x6c'),_0x197c('0x5a'),_0x197c('0x53'),_0x197c('0x54')],squel[_0x197c('0x7b')]()[_0x197c('0x6d')]('phone',_0x197c('0x6e'))[_0x197c('0x6d')]('NOW()',_0x197c('0x6a'))[_0x197c('0x6d')]('id',_0x197c('0x6b'))[_0x197c('0x6d')](_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')](),_0x197c('0x6c'))['field'](_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')](),_0x197c('0x5a'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x53'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x54'))[_0x197c('0x72')]('cm_contacts')['where'](_0x197c('0x74'))['where'](_0x197c('0x75'),_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')]())[_0x197c('0x3d')](_0x197c('0x76'))[_0x197c('0x3d')](_0x197c('0x77'),squel['select']()[_0x197c('0x6d')]('COALESCE(phone,\x27\x27)')['from'](_0x197c('0x68'))[_0x197c('0x3d')]('CampaignId\x20=\x20?',_0x29e6ee['params']['id'][_0x197c('0x71')]())))[_0x197c('0x71')]();break;default:_0x1355e6=squel['insert']()[_0x197c('0x7e')](_0x197c('0x68'))[_0x197c('0x69')]([_0x197c('0x6e'),'scheduledAt',_0x197c('0x6b'),'ListId','CampaignId',_0x197c('0x53'),_0x197c('0x54')],squel[_0x197c('0x7b')]()[_0x197c('0x6d')](_0x197c('0x6e'),'phone')[_0x197c('0x6d')]('NOW()','scheduledAt')[_0x197c('0x6d')]('id',_0x197c('0x6b'))[_0x197c('0x6d')](_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')](),_0x197c('0x6c'))[_0x197c('0x6d')](_0x29e6ee['params']['id'][_0x197c('0x71')](),'CampaignId')[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x53'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27','updatedAt')['from'](_0x197c('0x73'))[_0x197c('0x3d')](_0x197c('0x74'))[_0x197c('0x3d')](_0x197c('0x75'),_0x48ca1a['CmListId'][_0x197c('0x71')]())['where'](_0x197c('0x76')))[_0x197c('0x71')]();}_0x53cd6e=squel[_0x197c('0x7d')]()[_0x197c('0x7e')]('cm_hopper_additional_phones')[_0x197c('0x69')]([_0x197c('0x7f'),_0x197c('0x6a'),_0x197c('0x6e'),_0x197c('0x80'),_0x197c('0x53'),'updatedAt'],squel[_0x197c('0x7b')]()[_0x197c('0x6d')](_0x197c('0x81'),'id')[_0x197c('0x6d')](_0x197c('0x6f'),'scheduledAt')[_0x197c('0x6d')]('ci.item','phone')[_0x197c('0x6d')]('ci.OrderBY',_0x197c('0x80'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x53'))['field']('\x27'+_0x1db087+'\x27',_0x197c('0x54'))[_0x197c('0x72')](_0x197c('0x82'),'ci')[_0x197c('0x83')](_0x197c('0x68'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x197c('0x3d')](_0x197c('0x84'),_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')]())['where'](_0x197c('0x85'),_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')]())['where']('h.createdAt\x20=\x20?',_0x1db087))[_0x197c('0x71')]();_0x201ed7[_0x197c('0x86')](db[_0x197c('0x87')]['query'](_0x1355e6));_0x478431[_0x197c('0x86')](db['sequelize'][_0x197c('0x33')](_0x53cd6e));}return BPromise[_0x197c('0x88')](_0x201ed7);}})[_0x197c('0x24')](function(){return BPromise[_0x197c('0x88')](_0x478431);})[_0x197c('0x24')](function(){return _0x29c93c;})[_0x197c('0x24')](respondWithResult(_0x57d9a4,null))[_0x197c('0x44')](handleError(_0x57d9a4,null));};exports[_0x197c('0x89')]=function(_0x5e326f,_0x160a1,_0x62c16c){return db[_0x197c('0x2c')][_0x197c('0x55')]({'where':{'id':_0x5e326f[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x160a1,null))[_0x197c('0x24')](function(_0x55476f){if(_0x55476f){return _0x55476f[_0x197c('0x89')](_0x5e326f[_0x197c('0x33')][_0x197c('0x63')]);}})[_0x197c('0x24')](function(_0x1daa31){if(_0x1daa31){return db[_0x197c('0x5b')]['destroy']({'where':{'ListId':_0x5e326f[_0x197c('0x33')][_0x197c('0x63')],'CampaignId':_0x5e326f[_0x197c('0x46')]['id']}})[_0x197c('0x24')](function(){return _0x1daa31;});}})[_0x197c('0x24')](respondWithStatusCode(_0x160a1,null))[_0x197c('0x44')](handleError(_0x160a1,null));};exports[_0x197c('0x8a')]=function(_0x36ae6c,_0x3d4d3b,_0x522cbb){var _0x4b599e={};var _0x4bc033={};var _0x2bfbb0;var _0x44f647;return db[_0x197c('0x2c')]['findOne']({'where':{'id':_0x36ae6c['params']['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x3d4d3b,null))[_0x197c('0x24')](function(_0x1568c2){if(_0x1568c2){_0x2bfbb0=_0x1568c2;_0x4bc033[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x61')]['rawAttributes']);_0x4bc033[_0x197c('0x33')]=_['keys'](_0x36ae6c[_0x197c('0x33')]);_0x4bc033['filters']=_[_0x197c('0x35')](_0x4bc033[_0x197c('0x31')],_0x4bc033[_0x197c('0x33')]);_0x4b599e[_0x197c('0x36')]=_[_0x197c('0x35')](_0x4bc033[_0x197c('0x31')],qs[_0x197c('0x37')](_0x36ae6c[_0x197c('0x33')][_0x197c('0x37')]));_0x4b599e['attributes']=_0x4b599e[_0x197c('0x36')][_0x197c('0x38')]?_0x4b599e[_0x197c('0x36')]:_0x4bc033[_0x197c('0x31')];_0x4b599e[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x36ae6c[_0x197c('0x33')][_0x197c('0x3c')]);_0x4b599e[_0x197c('0x3d')]=qs[_0x197c('0x34')](_[_0x197c('0x59')](_0x36ae6c[_0x197c('0x33')],_0x4bc033[_0x197c('0x34')]));if(_0x36ae6c[_0x197c('0x33')][_0x197c('0x3e')]){_0x4b599e[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x4b599e[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x4b599e['attributes'],function(_0x2d9880){var _0x12f785={};_0x12f785[_0x2d9880]={'$like':'%'+_0x36ae6c[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x12f785;})});}_0x4b599e=_[_0x197c('0x3f')]({},_0x4b599e,_0x36ae6c[_0x197c('0x40')]);return _0x2bfbb0[_0x197c('0x8a')](_0x4b599e);}})[_0x197c('0x24')](function(_0x5b578b){if(_0x5b578b){_0x44f647=_0x5b578b['length'];if(!_0x36ae6c['query'][_0x197c('0x39')](_0x197c('0x3a'))){_0x4b599e['limit']=qs[_0x197c('0x1b')](_0x36ae6c[_0x197c('0x33')]['limit']);_0x4b599e[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x36ae6c['query'][_0x197c('0x19')]);}return _0x2bfbb0[_0x197c('0x8a')](_0x4b599e);}})['then'](function(_0x366bf0){if(_0x366bf0){return _0x366bf0?{'count':_0x44f647,'rows':_0x366bf0}:null;}})[_0x197c('0x24')](respondWithResult(_0x3d4d3b,null))[_0x197c('0x44')](handleError(_0x3d4d3b,null));};exports['addBlackLists']=function(_0x45bdad,_0x21071b,_0x8f048){var _0x10f469,_0x48e103;var _0xbfdf5a=[];var _0x4f2c75=moment()[_0x197c('0x8b')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x197c('0x2c')][_0x197c('0x55')]({'where':{'id':_0x45bdad['params']['id']}})['then'](handleEntityNotFound(_0x21071b,null))[_0x197c('0x24')](function(_0x1c608c){if(_0x1c608c){_0x48e103=_0x1c608c;return _0x1c608c[_0x197c('0x8c')](_0x45bdad[_0x197c('0x4a')][_0x197c('0x63')],_[_0x197c('0x64')](_0x45bdad[_0x197c('0x4a')],[_0x197c('0x63'),'id'])||{});}return null;})[_0x197c('0x65')](function(_0x43b746){var _0xd42353;var _0x4ccaff;_0x10f469=_0x43b746||[];var _0x109daf=[];if(_0x43b746){for(var _0x3658c9=0x0;_0x3658c9<_0x43b746[_0x197c('0x38')];_0x3658c9+=0x1){var _0x264af2=_0x43b746[_0x3658c9]['get']({'plain':!![]});_0xd42353=squel[_0x197c('0x7d')]()[_0x197c('0x7e')]('cm_hopper_black')[_0x197c('0x69')]([_0x197c('0x6e'),_0x197c('0x6b'),'ListId',_0x197c('0x5a'),_0x197c('0x53'),_0x197c('0x54')],squel[_0x197c('0x7b')]()[_0x197c('0x6d')]('phone',_0x197c('0x6e'))[_0x197c('0x6d')]('id',_0x197c('0x6b'))[_0x197c('0x6d')](_0x264af2[_0x197c('0x70')][_0x197c('0x71')](),_0x197c('0x6c'))[_0x197c('0x6d')](_0x45bdad[_0x197c('0x46')]['id'][_0x197c('0x71')](),'CampaignId')[_0x197c('0x6d')](_0x197c('0x6f'),_0x197c('0x53'))[_0x197c('0x6d')](_0x197c('0x6f'),'updatedAt')['from'](_0x197c('0x73'))['where'](_0x197c('0x74'))[_0x197c('0x3d')](_0x197c('0x75'),_0x264af2[_0x197c('0x70')][_0x197c('0x71')]())[_0x197c('0x3d')](_0x197c('0x76')))['toString']();_0x109daf[_0x197c('0x86')](db[_0x197c('0x87')]['query'](_0xd42353));}return BPromise[_0x197c('0x88')](_0x109daf);}})[_0x197c('0x24')](function(){return _0x10f469;})[_0x197c('0x24')](respondWithResult(_0x21071b,null))['catch'](handleError(_0x21071b,null));};exports[_0x197c('0x8d')]=function(_0x2eebbb,_0x43ca15,_0x22a786){return db[_0x197c('0x2c')][_0x197c('0x55')]({'where':{'id':_0x2eebbb[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x43ca15,null))['then'](function(_0x12fb25){if(_0x12fb25){return _0x12fb25[_0x197c('0x8d')](_0x2eebbb[_0x197c('0x33')][_0x197c('0x63')]);}})[_0x197c('0x24')](function(_0x498cd6){if(_0x498cd6){return db['CmHopperBlack'][_0x197c('0x25')]({'where':{'ListId':_0x2eebbb[_0x197c('0x33')]['ids'],'CampaignId':_0x2eebbb[_0x197c('0x46')]['id']}})['then'](function(){return _0x498cd6;});}})[_0x197c('0x24')](respondWithStatusCode(_0x43ca15,null))['catch'](handleError(_0x43ca15,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 7770169..adc08af 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x7a54,0x106));var _0x47a5=function(_0x1148c4,_0x490d09){_0x1148c4=_0x1148c4-0x0;var _0x4abd1d=_0x7a54[_0x1148c4];return _0x4abd1d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 9036268..dc7268c 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 _0x4ef1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','model','map','lodash','util','bluebird'];(function(_0x170f4c,_0x4a4c80){var _0x52eedd=function(_0x473905){while(--_0x473905){_0x170f4c['push'](_0x170f4c['shift']());}};_0x52eedd(++_0x4a4c80);}(_0x4ef1,0xeb));var _0x14ef=function(_0x5a6dc5,_0x4a7a46){_0x5a6dc5=_0x5a6dc5-0x0;var _0x2b6dcd=_0x4ef1[_0x5a6dc5];return _0x2b6dcd;};'use strict';var _=require(_0x14ef('0x0'));var util=require(_0x14ef('0x1'));var moment=require('moment');var BPromise=require(_0x14ef('0x2'));var rs=require(_0x14ef('0x3'));var fs=require('fs');var Redis=require(_0x14ef('0x4'));var db=require(_0x14ef('0x5'))['db'];var utils=require(_0x14ef('0x6'));var logger=require(_0x14ef('0x7'))(_0x14ef('0x8'));var config=require(_0x14ef('0x9'));var jayson=require(_0x14ef('0xa'));var client=jayson[_0x14ef('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x261fa2,_0x2dc335,_0x5b75ad){return new BPromise(function(_0x4175e7,_0x2ab217){return client[_0x14ef('0xc')](_0x261fa2,_0x5b75ad)[_0x14ef('0xd')](function(_0x17acc1){logger['info'](_0x14ef('0xe'),_0x2dc335,'request\x20sent');logger[_0x14ef('0xf')](_0x14ef('0x10'),_0x2dc335,_0x14ef('0x11'),JSON[_0x14ef('0x12')](_0x17acc1));if(_0x17acc1['error']){if(_0x17acc1['error'][_0x14ef('0x13')]===0x1f4){logger[_0x14ef('0x14')]('Campaign,\x20%s,\x20%s',_0x2dc335,_0x17acc1[_0x14ef('0x14')][_0x14ef('0x15')]);return _0x2ab217(_0x17acc1[_0x14ef('0x14')]['message']);}logger[_0x14ef('0x14')](_0x14ef('0xe'),_0x2dc335,_0x17acc1[_0x14ef('0x14')][_0x14ef('0x15')]);return _0x4175e7(_0x17acc1['error'][_0x14ef('0x15')]);}else{logger[_0x14ef('0x16')](_0x14ef('0xe'),_0x2dc335,_0x14ef('0x11'));_0x4175e7(_0x17acc1['result'][_0x14ef('0x15')]);}})[_0x14ef('0x17')](function(_0x24556b){logger[_0x14ef('0x14')](_0x14ef('0xe'),_0x2dc335,_0x24556b);_0x2ab217(_0x24556b);});});}exports[_0x14ef('0x18')]=function(_0x17f63a){var _0x1acc0a=this;return new Promise(function(_0x19b2cb,_0x3b5b23){return db[_0x14ef('0x19')][_0x14ef('0x1a')]({'raw':_0x17f63a[_0x14ef('0x1b')]?_0x17f63a[_0x14ef('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x17f63a['options']?_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1c')]||null:null,'attributes':_0x17f63a[_0x14ef('0x1b')]?_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1d')]||null:null,'limit':_0x17f63a[_0x14ef('0x1b')]?_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1e')]||null:null,'include':_0x17f63a['options']?_0x17f63a[_0x14ef('0x1b')]['include']?_['map'](_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1f')],function(_0x37bb6f){return{'model':db[_0x37bb6f[_0x14ef('0x20')]],'as':_0x37bb6f['as'],'attributes':_0x37bb6f[_0x14ef('0x1d')],'include':_0x37bb6f[_0x14ef('0x1f')]?_[_0x14ef('0x21')](_0x37bb6f[_0x14ef('0x1f')],function(_0x45105f){return{'model':db[_0x45105f[_0x14ef('0x20')]],'as':_0x45105f['as'],'attributes':_0x45105f['attributes'],'include':_0x45105f[_0x14ef('0x1f')]?_[_0x14ef('0x21')](_0x45105f[_0x14ef('0x1f')],function(_0x21a176){return{'model':db[_0x21a176[_0x14ef('0x20')]],'as':_0x21a176['as'],'attributes':_0x21a176[_0x14ef('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa0178d){logger['info']('GetCampaign',_0x17f63a);logger[_0x14ef('0xf')](_0x14ef('0x18'),_0x17f63a,JSON[_0x14ef('0x12')](_0xa0178d));_0x19b2cb(_0xa0178d);})[_0x14ef('0x17')](function(_0x38f5e9){logger[_0x14ef('0x14')](_0x14ef('0x18'),_0x38f5e9[_0x14ef('0x15')],_0x17f63a);_0x3b5b23(_0x1acc0a['error'](0x1f4,_0x38f5e9[_0x14ef('0x15')]));});});}; \ No newline at end of file +var _0xde64=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','map','include','model','attributes','debug','lodash','util','moment','bluebird'];(function(_0x4330fb,_0x25240c){var _0xbd081a=function(_0x42bf28){while(--_0x42bf28){_0x4330fb['push'](_0x4330fb['shift']());}};_0xbd081a(++_0x25240c);}(_0xde64,0x17c));var _0x4de6=function(_0x2499c0,_0xd1f953){_0x2499c0=_0x2499c0-0x0;var _0x291404=_0xde64[_0x2499c0];return _0x291404;};'use strict';var _=require(_0x4de6('0x0'));var util=require(_0x4de6('0x1'));var moment=require(_0x4de6('0x2'));var BPromise=require(_0x4de6('0x3'));var rs=require(_0x4de6('0x4'));var fs=require('fs');var Redis=require(_0x4de6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4de6('0x6'));var logger=require(_0x4de6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4de6('0x8'));var client=jayson[_0x4de6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568496,_0x24edef,_0x35ae72){return new BPromise(function(_0x475fb9,_0x248e39){return client[_0x4de6('0xa')](_0x568496,_0x35ae72)[_0x4de6('0xb')](function(_0x48a974){logger[_0x4de6('0xc')](_0x4de6('0xd'),_0x24edef,_0x4de6('0xe'));logger['debug'](_0x4de6('0xf'),_0x24edef,_0x4de6('0xe'),JSON[_0x4de6('0x10')](_0x48a974));if(_0x48a974[_0x4de6('0x11')]){if(_0x48a974[_0x4de6('0x11')]['code']===0x1f4){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974[_0x4de6('0x11')]['message']);return _0x248e39(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974['error'][_0x4de6('0x12')]);return _0x475fb9(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}else{logger['info'](_0x4de6('0xd'),_0x24edef,'request\x20sent');_0x475fb9(_0x48a974['result'][_0x4de6('0x12')]);}})[_0x4de6('0x13')](function(_0x6dbcf3){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x6dbcf3);_0x248e39(_0x6dbcf3);});});}exports[_0x4de6('0x14')]=function(_0x324202){var _0x5aacb4=this;return new Promise(function(_0x420f7c,_0xea1610){return db[_0x4de6('0x15')][_0x4de6('0x16')]({'raw':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x18')]===undefined?!![]:![]:!![],'where':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x19')]||null:null,'attributes':_0x324202['options']?_0x324202[_0x4de6('0x17')]['attributes']||null:null,'limit':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x1a')]||null:null,'include':_0x324202['options']?_0x324202[_0x4de6('0x17')]['include']?_[_0x4de6('0x1b')](_0x324202[_0x4de6('0x17')][_0x4de6('0x1c')],function(_0x5ddbab){return{'model':db[_0x5ddbab[_0x4de6('0x1d')]],'as':_0x5ddbab['as'],'attributes':_0x5ddbab[_0x4de6('0x1e')],'include':_0x5ddbab[_0x4de6('0x1c')]?_[_0x4de6('0x1b')](_0x5ddbab[_0x4de6('0x1c')],function(_0x25a76b){return{'model':db[_0x25a76b[_0x4de6('0x1d')]],'as':_0x25a76b['as'],'attributes':_0x25a76b['attributes'],'include':_0x25a76b[_0x4de6('0x1c')]?_[_0x4de6('0x1b')](_0x25a76b[_0x4de6('0x1c')],function(_0x327215){return{'model':db[_0x327215[_0x4de6('0x1d')]],'as':_0x327215['as'],'attributes':_0x327215[_0x4de6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4de6('0xb')](function(_0x7bc61e){logger[_0x4de6('0xc')]('GetCampaign',_0x324202);logger[_0x4de6('0x1f')](_0x4de6('0x14'),_0x324202,JSON[_0x4de6('0x10')](_0x7bc61e));_0x420f7c(_0x7bc61e);})[_0x4de6('0x13')](function(_0x24a0a7){logger['error'](_0x4de6('0x14'),_0x24a0a7['message'],_0x324202);_0xea1610(_0x5aacb4[_0x4de6('0x11')](0x1f4,_0x24a0a7[_0x4de6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 7dd31ea..2a5ab09 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 _0xfeff=['path','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util'];(function(_0x2c47d7,_0x42b567){var _0x41ca0b=function(_0x45e9ba){while(--_0x45e9ba){_0x2c47d7['push'](_0x2c47d7['shift']());}};_0x41ca0b(++_0x42b567);}(_0xfeff,0xe5));var _0xffef=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xfeff[_0x11ce46];return _0x368a1e;};'use strict';var multer=require(_0xffef('0x0'));var util=require(_0xffef('0x1'));var path=require(_0xffef('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xffef('0x3'));var interaction=require(_0xffef('0x4'));var config=require(_0xffef('0x5'));var controller=require(_0xffef('0x6'));router[_0xffef('0x7')]('/',auth[_0xffef('0x8')](),controller[_0xffef('0x9')]);router['get'](_0xffef('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xffef('0x7')](_0xffef('0xb'),auth['isAuthenticated'](),controller[_0xffef('0xc')]);router[_0xffef('0x7')](_0xffef('0xd'),auth['isAuthenticated'](),controller[_0xffef('0xe')]);router[_0xffef('0x7')](_0xffef('0xf'),auth[_0xffef('0x8')](),controller['getHopperFinals']);router['get'](_0xffef('0x10'),auth[_0xffef('0x8')](),controller[_0xffef('0x11')]);router['get'](_0xffef('0x12'),auth[_0xffef('0x8')](),controller[_0xffef('0x13')]);router['get'](_0xffef('0x14'),auth[_0xffef('0x8')](),controller[_0xffef('0x15')]);router[_0xffef('0x16')]('/',auth[_0xffef('0x8')](),controller[_0xffef('0x17')]);router[_0xffef('0x16')](_0xffef('0x18'),auth[_0xffef('0x8')](),controller['clone']);router[_0xffef('0x16')](_0xffef('0x12'),auth[_0xffef('0x8')](),controller[_0xffef('0x19')]);router['post'](_0xffef('0x14'),auth[_0xffef('0x8')](),controller[_0xffef('0x1a')]);router['put']('/:id',auth[_0xffef('0x8')](),controller[_0xffef('0x1b')]);router[_0xffef('0x1c')](_0xffef('0xa'),auth[_0xffef('0x8')](),controller[_0xffef('0x1d')]);router[_0xffef('0x1c')](_0xffef('0x12'),auth[_0xffef('0x8')](),controller[_0xffef('0x1e')]);router[_0xffef('0x1c')](_0xffef('0x14'),auth[_0xffef('0x8')](),controller[_0xffef('0x1f')]);module[_0xffef('0x20')]=router; \ No newline at end of file +var _0xbaae=['index','get','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','update','delete','removeBlackLists','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0xbaae,0x182));var _0xebaa=function(_0x1c0f97,_0x83214b){_0x1c0f97=_0x1c0f97-0x0;var _0x1ea59d=_0xbaae[_0x1c0f97];return _0x1ea59d;};'use strict';var multer=require(_0xebaa('0x0'));var util=require(_0xebaa('0x1'));var path=require(_0xebaa('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xebaa('0x3')]();var fs_extra=require(_0xebaa('0x4'));var auth=require(_0xebaa('0x5'));var interaction=require(_0xebaa('0x6'));var config=require(_0xebaa('0x7'));var controller=require(_0xebaa('0x8'));router['get']('/',auth[_0xebaa('0x9')](),controller[_0xebaa('0xa')]);router[_0xebaa('0xb')](_0xebaa('0xc'),auth[_0xebaa('0x9')](),controller[_0xebaa('0xd')]);router[_0xebaa('0xb')](_0xebaa('0xe'),auth[_0xebaa('0x9')](),controller['getHoppers']);router[_0xebaa('0xb')](_0xebaa('0xf'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x10')]);router['get'](_0xebaa('0x11'),auth[_0xebaa('0x9')](),controller['getHopperFinals']);router[_0xebaa('0xb')](_0xebaa('0x12'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xebaa('0xb')]('/:id/lists',auth[_0xebaa('0x9')](),controller[_0xebaa('0x13')]);router[_0xebaa('0xb')](_0xebaa('0x14'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xebaa('0x16')]);router[_0xebaa('0x17')](_0xebaa('0x18'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x19')]);router[_0xebaa('0x17')](_0xebaa('0x1a'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x1b')]);router[_0xebaa('0x17')](_0xebaa('0x14'),auth['isAuthenticated'](),controller[_0xebaa('0x1c')]);router['put'](_0xebaa('0xc'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x1d')]);router[_0xebaa('0x1e')](_0xebaa('0xc'),auth[_0xebaa('0x9')](),controller['destroy']);router[_0xebaa('0x1e')](_0xebaa('0x1a'),auth[_0xebaa('0x9')](),controller['removeLists']);router['delete']('/:id/blacklists',auth[_0xebaa('0x9')](),controller[_0xebaa('0x1f')]);module[_0xebaa('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 0f12e20..c87ba0b 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 _0x9470=['exports','STRING','TEXT','getDataValue','key'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x9470,0x118));var _0x0947=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x9470[_0x3cb6dc];return _0x47ec89;};'use strict';var Sequelize=require('sequelize');module[_0x0947('0x0')]={'key':{'type':Sequelize[_0x0947('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x0947('0x2')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x0947('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0947('0x3')](_0x0947('0x4'));}}}; \ No newline at end of file +var _0x5457=['medium','STRING','VIRTUAL','key','sequelize','TEXT'];(function(_0x33a645,_0x341973){var _0x40761d=function(_0x41a222){while(--_0x41a222){_0x33a645['push'](_0x33a645['shift']());}};_0x40761d(++_0x341973);}(_0x5457,0x70));var _0x7545=function(_0x5611af,_0x4f0e4d){_0x5611af=_0x5611af-0x0;var _0x11723d=_0x5457[_0x5611af];return _0x11723d;};'use strict';var Sequelize=require(_0x7545('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x7545('0x1')],'length':_0x7545('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x7545('0x3')]},'name':{'type':Sequelize[_0x7545('0x4')],'get':function(){return this['getDataValue'](_0x7545('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 04020a0..6781a3c 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 _0xca06=['key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','CannedAnswers','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','end','name','send','index','fieldName','type'];(function(_0x22a2b2,_0xa9f5b3){var _0x1ee264=function(_0x1ccc7f){while(--_0x1ccc7f){_0x22a2b2['push'](_0x22a2b2['shift']());}};_0x1ee264(++_0xa9f5b3);}(_0xca06,0x1d7));var _0x6ca0=function(_0xa0b91b,_0x2e2a5d){_0xa0b91b=_0xa0b91b-0x0;var _0x23196b=_0xca06[_0xa0b91b];return _0x23196b;};'use strict';var emlformat=require(_0x6ca0('0x0'));var rimraf=require(_0x6ca0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ca0('0x2'));var moment=require('moment');var BPromise=require(_0x6ca0('0x3'));var Mustache=require(_0x6ca0('0x4'));var util=require(_0x6ca0('0x5'));var path=require('path');var sox=require(_0x6ca0('0x6'));var csv=require('to-csv');var ejs=require(_0x6ca0('0x7'));var fs=require('fs');var fs_extra=require(_0x6ca0('0x8'));var _=require(_0x6ca0('0x9'));var squel=require(_0x6ca0('0xa'));var crypto=require(_0x6ca0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6ca0('0xc'));var toCsv=require(_0x6ca0('0xd'));var querystring=require(_0x6ca0('0xe'));var Papa=require(_0x6ca0('0xf'));var Redis=require(_0x6ca0('0x10'));var authService=require(_0x6ca0('0x11'));var qs=require(_0x6ca0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ca0('0x13'));var logger=require(_0x6ca0('0x14'))('api');var utils=require(_0x6ca0('0x15'));var config=require(_0x6ca0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ca0('0x17'))['db'];function respondWithStatusCode(_0xc52007,_0x19b662){_0x19b662=_0x19b662||0xcc;return function(_0x1d4ff4){if(_0x1d4ff4){return _0xc52007[_0x6ca0('0x18')](_0x19b662);}return _0xc52007[_0x6ca0('0x19')](_0x19b662)['end']();};}function respondWithResult(_0x3a008f,_0x1a27eb){_0x1a27eb=_0x1a27eb||0xc8;return function(_0x59e607){if(_0x59e607){return _0x3a008f[_0x6ca0('0x19')](_0x1a27eb)[_0x6ca0('0x1a')](_0x59e607);}};}function respondWithFilteredResult(_0x57aa6a,_0xfb12cd){return function(_0x3b7926){if(_0x3b7926){var _0x450696=typeof _0xfb12cd['offset']===_0x6ca0('0x1b')&&typeof _0xfb12cd[_0x6ca0('0x1c')]==='undefined';var _0xd26cec=_0x3b7926['count'];var _0x1a1ded=_0x450696?0x0:_0xfb12cd[_0x6ca0('0x1d')];var _0x47a189=_0x450696?_0x3b7926[_0x6ca0('0x1e')]:_0xfb12cd[_0x6ca0('0x1d')]+_0xfb12cd['limit'];var _0x1c0d22;if(_0x47a189>=_0xd26cec){_0x47a189=_0xd26cec;_0x1c0d22=0xc8;}else{_0x1c0d22=0xce;}_0x57aa6a[_0x6ca0('0x19')](_0x1c0d22);return _0x57aa6a[_0x6ca0('0x1f')](_0x6ca0('0x20'),_0x1a1ded+'-'+_0x47a189+'/'+_0xd26cec)[_0x6ca0('0x1a')](_0x3b7926);}return null;};}function patchUpdates(_0x5e9d62){return function(_0x116a2c){try{jsonpatch['apply'](_0x116a2c,_0x5e9d62,!![]);}catch(_0x554c25){return BPromise[_0x6ca0('0x21')](_0x554c25);}return _0x116a2c['save']();};}function saveUpdates(_0x33126d,_0x5ebff6){return function(_0x5ba278){if(_0x5ba278){return _0x5ba278[_0x6ca0('0x22')](_0x33126d)[_0x6ca0('0x23')](function(_0x3601e3){return _0x3601e3;});}return null;};}function removeEntity(_0x128bc8,_0x357394){return function(_0x5098fd){if(_0x5098fd){return _0x5098fd[_0x6ca0('0x24')]()[_0x6ca0('0x23')](function(){var _0x26f0be=_0x5098fd[_0x6ca0('0x25')]({'plain':!![]});var _0x32e64b='CannedAnswers';return db[_0x6ca0('0x26')][_0x6ca0('0x24')]({'where':{'type':_0x32e64b,'resourceId':_0x26f0be['id']}})[_0x6ca0('0x23')](function(){return _0x5098fd;});})[_0x6ca0('0x23')](function(){_0x128bc8[_0x6ca0('0x19')](0xcc)[_0x6ca0('0x27')]();});}};}function handleEntityNotFound(_0xa198d8,_0x1d2258){return function(_0x2da691){if(!_0x2da691){_0xa198d8[_0x6ca0('0x18')](0x194);}return _0x2da691;};}function handleError(_0x1b54cd,_0x4e745f){_0x4e745f=_0x4e745f||0x1f4;return function(_0x2eae5e){logger['error'](_0x2eae5e['stack']);if(_0x2eae5e[_0x6ca0('0x28')]){delete _0x2eae5e['name'];}_0x1b54cd[_0x6ca0('0x19')](_0x4e745f)[_0x6ca0('0x29')](_0x2eae5e);};}exports[_0x6ca0('0x2a')]=function(_0x163369,_0x10c112){var _0x1bf32d={},_0x3dd149={},_0xd1db2={'count':0x0,'rows':[]};var _0x358047=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x14ae83){return{'name':_0x14ae83[_0x6ca0('0x2b')],'type':_0x14ae83[_0x6ca0('0x2c')][_0x6ca0('0x2d')]};});_0x3dd149[_0x6ca0('0x2e')]=_['map'](_0x358047,'name');_0x3dd149['query']=_[_0x6ca0('0x2f')](_0x163369['query']);_0x3dd149['filters']=_[_0x6ca0('0x30')](_0x3dd149[_0x6ca0('0x2e')],_0x3dd149[_0x6ca0('0x31')]);_0x1bf32d[_0x6ca0('0x32')]=_[_0x6ca0('0x30')](_0x3dd149['model'],qs['fields'](_0x163369['query'][_0x6ca0('0x33')]));_0x1bf32d[_0x6ca0('0x32')]=_0x1bf32d[_0x6ca0('0x32')][_0x6ca0('0x34')]?_0x1bf32d[_0x6ca0('0x32')]:_0x3dd149[_0x6ca0('0x2e')];if(!_0x163369['query'][_0x6ca0('0x35')](_0x6ca0('0x36'))){_0x1bf32d['limit']=qs[_0x6ca0('0x1c')](_0x163369[_0x6ca0('0x31')][_0x6ca0('0x1c')]);_0x1bf32d[_0x6ca0('0x1d')]=qs[_0x6ca0('0x1d')](_0x163369['query'][_0x6ca0('0x1d')]);}_0x1bf32d[_0x6ca0('0x37')]=qs[_0x6ca0('0x38')](_0x163369[_0x6ca0('0x31')][_0x6ca0('0x38')]);_0x1bf32d[_0x6ca0('0x39')]=qs[_0x6ca0('0x3a')](_[_0x6ca0('0x3b')](_0x163369[_0x6ca0('0x31')],_0x3dd149[_0x6ca0('0x3a')]),_0x358047);if(_0x163369[_0x6ca0('0x31')][_0x6ca0('0x3c')]){_0x1bf32d['where']=_[_0x6ca0('0x3d')](_0x1bf32d[_0x6ca0('0x39')],{'$or':[{'key':{'$like':'%'+_0x163369[_0x6ca0('0x31')][_0x6ca0('0x3c')]+'%'}},{'value':{'$like':'%'+_0x163369['query'][_0x6ca0('0x3c')]+'%'}}]});}_0x1bf32d=_[_0x6ca0('0x3d')]({},_0x1bf32d,_0x163369[_0x6ca0('0x3e')]);var _0x4dbeeb={'where':_0x1bf32d[_0x6ca0('0x39')]};return db[_0x6ca0('0x3f')]['count'](_0x4dbeeb)[_0x6ca0('0x23')](function(_0x405e79){_0xd1db2['count']=_0x405e79;if(_0x163369['query'][_0x6ca0('0x40')]){_0x1bf32d['include']=[{'all':!![]}];}return db[_0x6ca0('0x3f')][_0x6ca0('0x41')](_0x1bf32d);})['then'](function(_0xcc9c93){_0xd1db2[_0x6ca0('0x42')]=_0xcc9c93;return _0xd1db2;})[_0x6ca0('0x23')](respondWithFilteredResult(_0x10c112,_0x1bf32d))[_0x6ca0('0x43')](handleError(_0x10c112,null));};exports[_0x6ca0('0x44')]=function(_0x497f06,_0x5a59e4){var _0x48be61={'raw':!![],'where':{'id':_0x497f06[_0x6ca0('0x45')]['id']}},_0x1c02be={};_0x1c02be[_0x6ca0('0x2e')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x1c02be['query']=_[_0x6ca0('0x2f')](_0x497f06[_0x6ca0('0x31')]);_0x1c02be['filters']=_['intersection'](_0x1c02be[_0x6ca0('0x2e')],_0x1c02be[_0x6ca0('0x31')]);_0x48be61[_0x6ca0('0x32')]=_[_0x6ca0('0x30')](_0x1c02be[_0x6ca0('0x2e')],qs[_0x6ca0('0x33')](_0x497f06[_0x6ca0('0x31')]['fields']));_0x48be61[_0x6ca0('0x32')]=_0x48be61[_0x6ca0('0x32')]['length']?_0x48be61['attributes']:_0x1c02be[_0x6ca0('0x2e')];if(_0x497f06['query']['includeAll']){_0x48be61[_0x6ca0('0x46')]=[{'all':!![]}];}_0x48be61=_[_0x6ca0('0x3d')]({},_0x48be61,_0x497f06['options']);return db[_0x6ca0('0x3f')][_0x6ca0('0x47')](_0x48be61)[_0x6ca0('0x23')](handleEntityNotFound(_0x5a59e4,null))[_0x6ca0('0x23')](respondWithResult(_0x5a59e4,null))[_0x6ca0('0x43')](handleError(_0x5a59e4,null));};exports[_0x6ca0('0x22')]=function(_0x9387d9,_0x50c096){if(_0x9387d9[_0x6ca0('0x48')]['id']){delete _0x9387d9[_0x6ca0('0x48')]['id'];}return db[_0x6ca0('0x3f')][_0x6ca0('0x47')]({'where':{'id':_0x9387d9[_0x6ca0('0x45')]['id']}})[_0x6ca0('0x23')](handleEntityNotFound(_0x50c096,null))['then'](saveUpdates(_0x9387d9[_0x6ca0('0x48')],null))[_0x6ca0('0x23')](respondWithResult(_0x50c096,null))[_0x6ca0('0x43')](handleError(_0x50c096,null));};exports[_0x6ca0('0x24')]=function(_0xe30141,_0x19264e){return db[_0x6ca0('0x3f')][_0x6ca0('0x47')]({'where':{'id':_0xe30141[_0x6ca0('0x45')]['id']}})[_0x6ca0('0x23')](handleEntityNotFound(_0x19264e,null))[_0x6ca0('0x23')](removeEntity(_0x19264e,null))['catch'](handleError(_0x19264e,null));};exports[_0x6ca0('0x49')]=function(_0x556224,_0x32e632){var _0x1577bf={'key':_0x556224['body']['key']};if(_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4a')]){_0x1577bf[_0x6ca0('0x4a')]=_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4a')];}else if(_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4b')]){_0x1577bf[_0x6ca0('0x4b')]=_0x556224[_0x6ca0('0x48')]['SmsAccountId'];}else if(_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4c')]){_0x1577bf[_0x6ca0('0x4c')]=_0x556224['body'][_0x6ca0('0x4c')];}else if(_0x556224['body'][_0x6ca0('0x4d')]){_0x1577bf['ChatWebsiteId']=_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4d')];}return db['CannedAnswer'][_0x6ca0('0x47')]({'where':_0x1577bf})['then'](function(_0x2f7d2a){if(_0x2f7d2a){throw new db['Sequelize'][(_0x6ca0('0x4e'))](_0x6ca0('0x4f'));}return db[_0x6ca0('0x3f')][_0x6ca0('0x49')](_0x556224[_0x6ca0('0x48')]);})[_0x6ca0('0x23')](function(_0x254a26){var _0x5eaeac=_0x556224['user'][_0x6ca0('0x25')]({'plain':!![]});if(!_0x5eaeac)throw new Error(_0x6ca0('0x50'));if(_0x5eaeac[_0x6ca0('0x51')]===_0x6ca0('0x52')){var _0x247bbf=_0x254a26[_0x6ca0('0x25')]({'plain':!![]});return db[_0x6ca0('0x53')][_0x6ca0('0x47')]({'where':{'name':_0x6ca0('0x54'),'userProfileId':_0x5eaeac['userProfileId']},'raw':!![]})[_0x6ca0('0x23')](function(_0x43d2aa){if(_0x43d2aa&&_0x43d2aa['autoAssociation']===0x0){return db[_0x6ca0('0x26')][_0x6ca0('0x49')]({'name':_0x247bbf[_0x6ca0('0x28')],'resourceId':_0x247bbf['id'],'type':_0x43d2aa[_0x6ca0('0x28')],'sectionId':_0x43d2aa['id']},{})[_0x6ca0('0x23')](function(){return _0x254a26;});}else{return _0x254a26;}})['catch'](function(_0x4bfd60){logger['error'](_0x6ca0('0x55'),_0x4bfd60);throw _0x4bfd60;});}return _0x254a26;})[_0x6ca0('0x23')](respondWithResult(_0x32e632,0xc9))[_0x6ca0('0x43')](handleError(_0x32e632,null));}; \ No newline at end of file +var _0x10c5=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','fieldName','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','findAll','catch','show','keys','rawAttributes','includeAll','find','params','create','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2b6bb1,_0x6ca1d7){var _0x3218b6=function(_0x5ce75c){while(--_0x5ce75c){_0x2b6bb1['push'](_0x2b6bb1['shift']());}};_0x3218b6(++_0x6ca1d7);}(_0x10c5,0x1ae));var _0x510c=function(_0x445199,_0x50daf7){_0x445199=_0x445199-0x0;var _0x1cc1a4=_0x10c5[_0x445199];return _0x1cc1a4;};'use strict';var emlformat=require(_0x510c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x510c('0x1'));var rp=require(_0x510c('0x2'));var moment=require(_0x510c('0x3'));var BPromise=require(_0x510c('0x4'));var Mustache=require(_0x510c('0x5'));var util=require(_0x510c('0x6'));var path=require('path');var sox=require(_0x510c('0x7'));var csv=require(_0x510c('0x8'));var ejs=require(_0x510c('0x9'));var fs=require('fs');var fs_extra=require(_0x510c('0xa'));var _=require(_0x510c('0xb'));var squel=require(_0x510c('0xc'));var crypto=require(_0x510c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x510c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x510c('0xf'));var Redis=require(_0x510c('0x10'));var authService=require(_0x510c('0x11'));var qs=require(_0x510c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x510c('0x13'));var logger=require(_0x510c('0x14'))(_0x510c('0x15'));var utils=require(_0x510c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x510c('0x17'));var db=require(_0x510c('0x18'))['db'];function respondWithStatusCode(_0x2b1c4c,_0xc05a86){_0xc05a86=_0xc05a86||0xcc;return function(_0x14f459){if(_0x14f459){return _0x2b1c4c[_0x510c('0x19')](_0xc05a86);}return _0x2b1c4c[_0x510c('0x1a')](_0xc05a86)[_0x510c('0x1b')]();};}function respondWithResult(_0x2ab106,_0x4a4a08){_0x4a4a08=_0x4a4a08||0xc8;return function(_0x593982){if(_0x593982){return _0x2ab106['status'](_0x4a4a08)[_0x510c('0x1c')](_0x593982);}};}function respondWithFilteredResult(_0x19c721,_0x429dc3){return function(_0x36c12c){if(_0x36c12c){var _0x16fe9b=typeof _0x429dc3[_0x510c('0x1d')]===_0x510c('0x1e')&&typeof _0x429dc3[_0x510c('0x1f')]===_0x510c('0x1e');var _0x39cbcc=_0x36c12c['count'];var _0x40ef25=_0x16fe9b?0x0:_0x429dc3['offset'];var _0x166dd8=_0x16fe9b?_0x36c12c['count']:_0x429dc3[_0x510c('0x1d')]+_0x429dc3[_0x510c('0x1f')];var _0x318b88;if(_0x166dd8>=_0x39cbcc){_0x166dd8=_0x39cbcc;_0x318b88=0xc8;}else{_0x318b88=0xce;}_0x19c721[_0x510c('0x1a')](_0x318b88);return _0x19c721['set'](_0x510c('0x20'),_0x40ef25+'-'+_0x166dd8+'/'+_0x39cbcc)[_0x510c('0x1c')](_0x36c12c);}return null;};}function patchUpdates(_0xa36377){return function(_0x4860f3){try{jsonpatch[_0x510c('0x21')](_0x4860f3,_0xa36377,!![]);}catch(_0x216d88){return BPromise[_0x510c('0x22')](_0x216d88);}return _0x4860f3['save']();};}function saveUpdates(_0x17f83b,_0x2e88eb){return function(_0x145c3f){if(_0x145c3f){return _0x145c3f[_0x510c('0x23')](_0x17f83b)['then'](function(_0x38a00e){return _0x38a00e;});}return null;};}function removeEntity(_0x57f055,_0x2acd6c){return function(_0x133555){if(_0x133555){return _0x133555[_0x510c('0x24')]()[_0x510c('0x25')](function(){var _0x2119c8=_0x133555[_0x510c('0x26')]({'plain':!![]});var _0x46f9fd=_0x510c('0x27');return db[_0x510c('0x28')][_0x510c('0x24')]({'where':{'type':_0x46f9fd,'resourceId':_0x2119c8['id']}})[_0x510c('0x25')](function(){return _0x133555;});})[_0x510c('0x25')](function(){_0x57f055[_0x510c('0x1a')](0xcc)[_0x510c('0x1b')]();});}};}function handleEntityNotFound(_0x1fc2cf,_0x550229){return function(_0x7c5f67){if(!_0x7c5f67){_0x1fc2cf[_0x510c('0x19')](0x194);}return _0x7c5f67;};}function handleError(_0x497bc2,_0x50dc65){_0x50dc65=_0x50dc65||0x1f4;return function(_0x165e1a){logger[_0x510c('0x29')](_0x165e1a[_0x510c('0x2a')]);if(_0x165e1a[_0x510c('0x2b')]){delete _0x165e1a[_0x510c('0x2b')];}_0x497bc2[_0x510c('0x1a')](_0x50dc65)[_0x510c('0x2c')](_0x165e1a);};}exports[_0x510c('0x2d')]=function(_0x85fa77,_0x9809ee){var _0x4ce854={},_0x3bec43={},_0x598977={'count':0x0,'rows':[]};var _0x3eb399=_[_0x510c('0x2e')](db[_0x510c('0x2f')]['rawAttributes'],function(_0x159cee){return{'name':_0x159cee[_0x510c('0x30')],'type':_0x159cee[_0x510c('0x31')]['key']};});_0x3bec43[_0x510c('0x32')]=_[_0x510c('0x2e')](_0x3eb399,_0x510c('0x2b'));_0x3bec43['query']=_['keys'](_0x85fa77['query']);_0x3bec43[_0x510c('0x33')]=_[_0x510c('0x34')](_0x3bec43[_0x510c('0x32')],_0x3bec43[_0x510c('0x35')]);_0x4ce854[_0x510c('0x36')]=_[_0x510c('0x34')](_0x3bec43['model'],qs[_0x510c('0x37')](_0x85fa77[_0x510c('0x35')][_0x510c('0x37')]));_0x4ce854[_0x510c('0x36')]=_0x4ce854[_0x510c('0x36')][_0x510c('0x38')]?_0x4ce854['attributes']:_0x3bec43[_0x510c('0x32')];if(!_0x85fa77[_0x510c('0x35')][_0x510c('0x39')](_0x510c('0x3a'))){_0x4ce854[_0x510c('0x1f')]=qs[_0x510c('0x1f')](_0x85fa77[_0x510c('0x35')][_0x510c('0x1f')]);_0x4ce854[_0x510c('0x1d')]=qs[_0x510c('0x1d')](_0x85fa77[_0x510c('0x35')][_0x510c('0x1d')]);}_0x4ce854[_0x510c('0x3b')]=qs['sort'](_0x85fa77[_0x510c('0x35')]['sort']);_0x4ce854[_0x510c('0x3c')]=qs[_0x510c('0x33')](_['pick'](_0x85fa77['query'],_0x3bec43['filters']),_0x3eb399);if(_0x85fa77[_0x510c('0x35')][_0x510c('0x3d')]){_0x4ce854[_0x510c('0x3c')]=_[_0x510c('0x3e')](_0x4ce854[_0x510c('0x3c')],{'$or':[{'key':{'$like':'%'+_0x85fa77[_0x510c('0x35')][_0x510c('0x3d')]+'%'}},{'value':{'$like':'%'+_0x85fa77['query'][_0x510c('0x3d')]+'%'}}]});}_0x4ce854=_[_0x510c('0x3e')]({},_0x4ce854,_0x85fa77['options']);var _0x1eec58={'where':_0x4ce854[_0x510c('0x3c')]};return db[_0x510c('0x2f')]['count'](_0x1eec58)[_0x510c('0x25')](function(_0x47c89f){_0x598977['count']=_0x47c89f;if(_0x85fa77[_0x510c('0x35')]['includeAll']){_0x4ce854['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x510c('0x3f')](_0x4ce854);})[_0x510c('0x25')](function(_0x1a2a02){_0x598977['rows']=_0x1a2a02;return _0x598977;})[_0x510c('0x25')](respondWithFilteredResult(_0x9809ee,_0x4ce854))[_0x510c('0x40')](handleError(_0x9809ee,null));};exports[_0x510c('0x41')]=function(_0x3fe8ba,_0x3b67f6){var _0xa75747={'raw':!![],'where':{'id':_0x3fe8ba['params']['id']}},_0x1b01c7={};_0x1b01c7['model']=_[_0x510c('0x42')](db[_0x510c('0x2f')][_0x510c('0x43')]);_0x1b01c7['query']=_[_0x510c('0x42')](_0x3fe8ba[_0x510c('0x35')]);_0x1b01c7[_0x510c('0x33')]=_['intersection'](_0x1b01c7[_0x510c('0x32')],_0x1b01c7[_0x510c('0x35')]);_0xa75747['attributes']=_[_0x510c('0x34')](_0x1b01c7[_0x510c('0x32')],qs[_0x510c('0x37')](_0x3fe8ba[_0x510c('0x35')][_0x510c('0x37')]));_0xa75747[_0x510c('0x36')]=_0xa75747['attributes'][_0x510c('0x38')]?_0xa75747[_0x510c('0x36')]:_0x1b01c7[_0x510c('0x32')];if(_0x3fe8ba[_0x510c('0x35')][_0x510c('0x44')]){_0xa75747['include']=[{'all':!![]}];}_0xa75747=_['merge']({},_0xa75747,_0x3fe8ba['options']);return db[_0x510c('0x2f')][_0x510c('0x45')](_0xa75747)[_0x510c('0x25')](handleEntityNotFound(_0x3b67f6,null))['then'](respondWithResult(_0x3b67f6,null))[_0x510c('0x40')](handleError(_0x3b67f6,null));};exports[_0x510c('0x23')]=function(_0xce72b4,_0xcf3283){if(_0xce72b4['body']['id']){delete _0xce72b4['body']['id'];}return db[_0x510c('0x2f')][_0x510c('0x45')]({'where':{'id':_0xce72b4[_0x510c('0x46')]['id']}})['then'](handleEntityNotFound(_0xcf3283,null))[_0x510c('0x25')](saveUpdates(_0xce72b4['body'],null))[_0x510c('0x25')](respondWithResult(_0xcf3283,null))[_0x510c('0x40')](handleError(_0xcf3283,null));};exports[_0x510c('0x24')]=function(_0x20f5f5,_0x5bf146){return db['CannedAnswer']['find']({'where':{'id':_0x20f5f5[_0x510c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5bf146,null))[_0x510c('0x25')](removeEntity(_0x5bf146,null))[_0x510c('0x40')](handleError(_0x5bf146,null));};exports[_0x510c('0x47')]=function(_0x38fb20,_0x2cd45a){var _0x1ec7de={'key':_0x38fb20['body']['key']};if(_0x38fb20[_0x510c('0x48')][_0x510c('0x49')]){_0x1ec7de['MailAccountId']=_0x38fb20['body']['MailAccountId'];}else if(_0x38fb20[_0x510c('0x48')]['SmsAccountId']){_0x1ec7de[_0x510c('0x4a')]=_0x38fb20[_0x510c('0x48')]['SmsAccountId'];}else if(_0x38fb20[_0x510c('0x48')][_0x510c('0x4b')]){_0x1ec7de['OpenchannelAccountId']=_0x38fb20[_0x510c('0x48')]['OpenchannelAccountId'];}else if(_0x38fb20[_0x510c('0x48')]['ChatWebsiteId']){_0x1ec7de['ChatWebsiteId']=_0x38fb20[_0x510c('0x48')][_0x510c('0x4c')];}return db[_0x510c('0x2f')][_0x510c('0x45')]({'where':_0x1ec7de})['then'](function(_0x5442c1){if(_0x5442c1){throw new db[(_0x510c('0x4d'))][(_0x510c('0x4e'))](_0x510c('0x4f'));}return db[_0x510c('0x2f')][_0x510c('0x47')](_0x38fb20['body']);})['then'](function(_0x252e66){var _0x41238b=_0x38fb20[_0x510c('0x50')][_0x510c('0x26')]({'plain':!![]});if(!_0x41238b)throw new Error(_0x510c('0x51'));if(_0x41238b[_0x510c('0x52')]==='user'){var _0x386db3=_0x252e66[_0x510c('0x26')]({'plain':!![]});return db[_0x510c('0x53')][_0x510c('0x45')]({'where':{'name':_0x510c('0x27'),'userProfileId':_0x41238b[_0x510c('0x54')]},'raw':!![]})[_0x510c('0x25')](function(_0xd3e810){if(_0xd3e810&&_0xd3e810[_0x510c('0x55')]===0x0){return db[_0x510c('0x28')][_0x510c('0x47')]({'name':_0x386db3['name'],'resourceId':_0x386db3['id'],'type':_0xd3e810[_0x510c('0x2b')],'sectionId':_0xd3e810['id']},{})[_0x510c('0x25')](function(){return _0x252e66;});}else{return _0x252e66;}})[_0x510c('0x40')](function(_0x1ec79b){logger[_0x510c('0x29')](_0x510c('0x56'),_0x1ec79b);throw _0x1ec79b;});}return _0x252e66;})['then'](respondWithResult(_0x2cd45a,0xc9))[_0x510c('0x40')](handleError(_0x2cd45a,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 65da8d3..a090a3a 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 _0x81df=['api','moment','bluebird','request-promise','path','rimraf','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3554de,_0x1c1680){var _0x469d4b=function(_0x402f44){while(--_0x402f44){_0x3554de['push'](_0x3554de['shift']());}};_0x469d4b(++_0x1c1680);}(_0x81df,0xb3));var _0xf81d=function(_0x112e86,_0x2cc9b0){_0x112e86=_0x112e86-0x0;var _0xf6b5d9=_0x81df[_0x112e86];return _0xf6b5d9;};'use strict';var _=require(_0xf81d('0x0'));var util=require(_0xf81d('0x1'));var logger=require(_0xf81d('0x2'))(_0xf81d('0x3'));var moment=require(_0xf81d('0x4'));var BPromise=require(_0xf81d('0x5'));var rp=require(_0xf81d('0x6'));var fs=require('fs');var path=require(_0xf81d('0x7'));var rimraf=require(_0xf81d('0x8'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0xf81d('0x9')]=function(_0x4678d9,_0x18a5a1){return _0x4678d9['define'](_0xf81d('0xa'),attributes,{'tableName':_0xf81d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf81d('0xc')});}; \ No newline at end of file +var _0xe82b=['tools_canned_answers','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x41130b,_0x2654b1){var _0x1ff258=function(_0x284984){while(--_0x284984){_0x41130b['push'](_0x41130b['shift']());}};_0x1ff258(++_0x2654b1);}(_0xe82b,0x11a));var _0xbe82=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xe82b[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xbe82('0x0'));var util=require(_0xbe82('0x1'));var logger=require('../../config/logger')(_0xbe82('0x2'));var moment=require(_0xbe82('0x3'));var BPromise=require(_0xbe82('0x4'));var rp=require(_0xbe82('0x5'));var fs=require('fs');var path=require(_0xbe82('0x6'));var rimraf=require(_0xbe82('0x7'));var config=require('../../config/environment');var attributes=require(_0xbe82('0x8'));module[_0xbe82('0x9')]=function(_0x5e33b2,_0x1f02d7){return _0x5e33b2[_0xbe82('0xa')](_0xbe82('0xb'),attributes,{'tableName':_0xbe82('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbe82('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 9e717d7..037be3e 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(_0x1bb67e,_0x4b021d){var _0x83a82e=function(_0x1e4bab){while(--_0x1e4bab){_0x1bb67e['push'](_0x1bb67e['shift']());}};_0x83a82e(++_0x4b021d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x27e671,_0x4dee15){var _0x4b0b6d=function(_0x2bd1da){while(--_0x2bd1da){_0x27e671['push'](_0x27e671['shift']());}};_0x4b0b6d(++_0x4dee15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 b030f78..2de9dd7 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 _0x7531=['/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3ab928,_0x2b990b){var _0xf47692=function(_0x311b8e){while(--_0x311b8e){_0x3ab928['push'](_0x3ab928['shift']());}};_0xf47692(++_0x2b990b);}(_0x7531,0x67));var _0x1753=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7531[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x1753('0x0'));var util=require('util');var path=require(_0x1753('0x1'));var timeout=require(_0x1753('0x2'));var express=require(_0x1753('0x3'));var router=express[_0x1753('0x4')]();var fs_extra=require(_0x1753('0x5'));var auth=require(_0x1753('0x6'));var interaction=require(_0x1753('0x7'));var config=require(_0x1753('0x8'));var controller=require('./cannedAnswer.controller');router[_0x1753('0x9')]('/',auth[_0x1753('0xa')](),controller['index']);router[_0x1753('0x9')](_0x1753('0xb'),auth[_0x1753('0xa')](),controller[_0x1753('0xc')]);router[_0x1753('0xd')]('/',auth['isAuthenticated'](),controller[_0x1753('0xe')]);router[_0x1753('0xf')]('/:id',auth[_0x1753('0xa')](),controller[_0x1753('0x10')]);router[_0x1753('0x11')](_0x1753('0xb'),auth[_0x1753('0xa')](),controller[_0x1753('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7663=['../../config/environment','./cannedAnswer.controller','index','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2ce0a2,_0x1529ae){var _0x201721=function(_0x145f8d){while(--_0x145f8d){_0x2ce0a2['push'](_0x2ce0a2['shift']());}};_0x201721(++_0x1529ae);}(_0x7663,0x142));var _0x3766=function(_0x3073d5,_0xd1fdf5){_0x3073d5=_0x3073d5-0x0;var _0x56ee5a=_0x7663[_0x3073d5];return _0x56ee5a;};'use strict';var multer=require(_0x3766('0x0'));var util=require(_0x3766('0x1'));var path=require(_0x3766('0x2'));var timeout=require(_0x3766('0x3'));var express=require(_0x3766('0x4'));var router=express['Router']();var fs_extra=require(_0x3766('0x5'));var auth=require(_0x3766('0x6'));var interaction=require(_0x3766('0x7'));var config=require(_0x3766('0x8'));var controller=require(_0x3766('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3766('0xa')]);router[_0x3766('0xb')]('/:id',auth[_0x3766('0xc')](),controller[_0x3766('0xd')]);router[_0x3766('0xe')]('/',auth[_0x3766('0xc')](),controller[_0x3766('0xf')]);router[_0x3766('0x10')](_0x3766('0x11'),auth['isAuthenticated'](),controller[_0x3766('0x12')]);router[_0x3766('0x13')](_0x3766('0x11'),auth[_0x3766('0xc')](),controller[_0x3766('0x14')]);module[_0x3766('0x15')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 52dede7..71339cc 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 _0x34e5=['STRING','INTEGER','exports','1970-01-01\x2000:00:01'];(function(_0x3fd6fd,_0x2ac441){var _0x3849f3=function(_0x19d13a){while(--_0x19d13a){_0x3fd6fd['push'](_0x3fd6fd['shift']());}};_0x3849f3(++_0x2ac441);}(_0x34e5,0x172));var _0x534e=function(_0x51d50a,_0x501b7e){_0x51d50a=_0x51d50a-0x0;var _0x46295a=_0x34e5[_0x51d50a];return _0x46295a;};'use strict';var Sequelize=require('sequelize');module[_0x534e('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x534e('0x1')},'clid':{'type':Sequelize[_0x534e('0x2')]},'src':{'type':Sequelize[_0x534e('0x2')]},'dst':{'type':Sequelize[_0x534e('0x2')]},'dcontext':{'type':Sequelize[_0x534e('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x534e('0x2')]},'lastapp':{'type':Sequelize[_0x534e('0x2')]},'lastdata':{'type':Sequelize[_0x534e('0x2')]},'duration':{'type':Sequelize[_0x534e('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x534e('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x534e('0x2')]},'amaflags':{'type':Sequelize[_0x534e('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x534e('0x2')]},'uniqueid':{'type':Sequelize[_0x534e('0x2')]},'linkedid':{'type':Sequelize[_0x534e('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x534e('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf45e=['INTEGER','sequelize','DATE','STRING'];(function(_0x10b099,_0x847335){var _0xace9f7=function(_0x3e5ccb){while(--_0x3e5ccb){_0x10b099['push'](_0x10b099['shift']());}};_0xace9f7(++_0x847335);}(_0xf45e,0x115));var _0xef45=function(_0x4b531b,_0x299078){_0x4b531b=_0x4b531b-0x0;var _0x1bc994=_0xf45e[_0x4b531b];return _0x1bc994;};'use strict';var Sequelize=require(_0xef45('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xef45('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xef45('0x2')]},'src':{'type':Sequelize[_0xef45('0x2')]},'dst':{'type':Sequelize[_0xef45('0x2')]},'dcontext':{'type':Sequelize[_0xef45('0x2')]},'channel':{'type':Sequelize[_0xef45('0x2')]},'dstchannel':{'type':Sequelize[_0xef45('0x2')]},'lastapp':{'type':Sequelize[_0xef45('0x2')]},'lastdata':{'type':Sequelize[_0xef45('0x2')]},'duration':{'type':Sequelize[_0xef45('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xef45('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xef45('0x2')]},'amaflags':{'type':Sequelize[_0xef45('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xef45('0x2')]},'userfield':{'type':Sequelize[_0xef45('0x2')]},'uniqueid':{'type':Sequelize[_0xef45('0x2')]},'linkedid':{'type':Sequelize[_0xef45('0x2')]},'sequence':{'type':Sequelize[_0xef45('0x2')]},'peeraccount':{'type':Sequelize[_0xef45('0x2')]},'type':{'type':Sequelize[_0xef45('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 169b49f..bcb1507 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 _0x4ab0=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','sendStatus','error','stack','name','send','Cdr','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs'];(function(_0x58bb02,_0x1558dc){var _0xd6a0ad=function(_0x139f4a){while(--_0x139f4a){_0x58bb02['push'](_0x58bb02['shift']());}};_0xd6a0ad(++_0x1558dc);}(_0x4ab0,0xd5));var _0x04ab=function(_0x558eed,_0x4cd4f3){_0x558eed=_0x558eed-0x0;var _0xf8fb7=_0x4ab0[_0x558eed];return _0xf8fb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04ab('0x0'));var zipdir=require(_0x04ab('0x1'));var jsonpatch=require(_0x04ab('0x2'));var rp=require(_0x04ab('0x3'));var moment=require(_0x04ab('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x04ab('0x5'));var path=require(_0x04ab('0x6'));var sox=require('sox');var csv=require(_0x04ab('0x7'));var ejs=require(_0x04ab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04ab('0x9'));var squel=require(_0x04ab('0xa'));var crypto=require(_0x04ab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04ab('0xc'));var toCsv=require(_0x04ab('0x7'));var querystring=require(_0x04ab('0xd'));var Papa=require(_0x04ab('0xe'));var Redis=require('ioredis');var authService=require(_0x04ab('0xf'));var qs=require(_0x04ab('0x10'));var as=require(_0x04ab('0x11'));var hardwareService=require(_0x04ab('0x12'));var logger=require('../../config/logger')(_0x04ab('0x13'));var utils=require(_0x04ab('0x14'));var config=require(_0x04ab('0x15'));var licenseUtil=require(_0x04ab('0x16'));var db=require(_0x04ab('0x17'))['db'];function respondWithStatusCode(_0x386d0a,_0x4a6b39){_0x4a6b39=_0x4a6b39||0xcc;return function(_0x710503){if(_0x710503){return _0x386d0a['sendStatus'](_0x4a6b39);}return _0x386d0a[_0x04ab('0x18')](_0x4a6b39)[_0x04ab('0x19')]();};}function respondWithResult(_0x2abdf8,_0x428798){_0x428798=_0x428798||0xc8;return function(_0x4f0da1){if(_0x4f0da1){return _0x2abdf8['status'](_0x428798)['json'](_0x4f0da1);}};}function respondWithFilteredResult(_0x103ca8,_0x3cee44){return function(_0x149fd2){if(_0x149fd2){var _0x2b10b0=typeof _0x3cee44[_0x04ab('0x1a')]===_0x04ab('0x1b')&&typeof _0x3cee44[_0x04ab('0x1c')]===_0x04ab('0x1b');var _0x1f3251=_0x149fd2[_0x04ab('0x1d')];var _0x5ce43c=_0x2b10b0?0x0:_0x3cee44[_0x04ab('0x1a')];var _0x83ab27=_0x2b10b0?_0x149fd2[_0x04ab('0x1d')]:_0x3cee44[_0x04ab('0x1a')]+_0x3cee44[_0x04ab('0x1c')];var _0x10669a;if(_0x83ab27>=_0x1f3251){_0x83ab27=_0x1f3251;_0x10669a=0xc8;}else{_0x10669a=0xce;}_0x103ca8[_0x04ab('0x18')](_0x10669a);return _0x103ca8[_0x04ab('0x1e')](_0x04ab('0x1f'),_0x5ce43c+'-'+_0x83ab27+'/'+_0x1f3251)['json'](_0x149fd2);}return null;};}function patchUpdates(_0x75a04e){return function(_0x4a6679){try{jsonpatch[_0x04ab('0x20')](_0x4a6679,_0x75a04e,!![]);}catch(_0x1d04c2){return BPromise[_0x04ab('0x21')](_0x1d04c2);}return _0x4a6679['save']();};}function saveUpdates(_0x15a36b,_0x1c08f4){return function(_0xf6275e){if(_0xf6275e){return _0xf6275e['update'](_0x15a36b)['then'](function(_0xc8358e){return _0xc8358e;});}return null;};}function removeEntity(_0x2f614a,_0x5885bd){return function(_0x551583){if(_0x551583){return _0x551583[_0x04ab('0x22')]()[_0x04ab('0x23')](function(){_0x2f614a[_0x04ab('0x18')](0xcc)[_0x04ab('0x19')]();});}};}function handleEntityNotFound(_0x26bb81,_0xa3838a){return function(_0x21d9b7){if(!_0x21d9b7){_0x26bb81[_0x04ab('0x24')](0x194);}return _0x21d9b7;};}function handleError(_0x222557,_0x5cf1e5){_0x5cf1e5=_0x5cf1e5||0x1f4;return function(_0x86bf80){logger[_0x04ab('0x25')](_0x86bf80[_0x04ab('0x26')]);if(_0x86bf80[_0x04ab('0x27')]){delete _0x86bf80['name'];}_0x222557['status'](_0x5cf1e5)[_0x04ab('0x28')](_0x86bf80);};}exports['index']=function(_0x404eae,_0x30db64){var _0x2e069d={},_0x3c25fb={},_0x12385b={'count':0x0,'rows':[]};var _0x5596fc=_['map'](db[_0x04ab('0x29')][_0x04ab('0x2a')],function(_0x28e77b){return{'name':_0x28e77b[_0x04ab('0x2b')],'type':_0x28e77b[_0x04ab('0x2c')][_0x04ab('0x2d')]};});_0x3c25fb[_0x04ab('0x2e')]=_[_0x04ab('0x2f')](_0x5596fc,_0x04ab('0x27'));_0x3c25fb[_0x04ab('0x30')]=_[_0x04ab('0x31')](_0x404eae[_0x04ab('0x30')]);_0x3c25fb[_0x04ab('0x32')]=_['intersection'](_0x3c25fb[_0x04ab('0x2e')],_0x3c25fb[_0x04ab('0x30')]);_0x2e069d['attributes']=_[_0x04ab('0x33')](_0x3c25fb[_0x04ab('0x2e')],qs['fields'](_0x404eae[_0x04ab('0x30')][_0x04ab('0x34')]));_0x2e069d['attributes']=_0x2e069d[_0x04ab('0x35')][_0x04ab('0x36')]?_0x2e069d[_0x04ab('0x35')]:_0x3c25fb[_0x04ab('0x2e')];if(!_0x404eae[_0x04ab('0x30')][_0x04ab('0x37')]('nolimit')){_0x2e069d[_0x04ab('0x1c')]=qs[_0x04ab('0x1c')](_0x404eae[_0x04ab('0x30')]['limit']);_0x2e069d[_0x04ab('0x1a')]=qs['offset'](_0x404eae['query'][_0x04ab('0x1a')]);}_0x2e069d[_0x04ab('0x38')]=qs['sort'](_0x404eae[_0x04ab('0x30')]['sort']);_0x2e069d[_0x04ab('0x39')]=qs[_0x04ab('0x32')](_[_0x04ab('0x3a')](_0x404eae[_0x04ab('0x30')],_0x3c25fb[_0x04ab('0x32')]),_0x5596fc);if(_0x404eae[_0x04ab('0x30')][_0x04ab('0x3b')]){_0x2e069d[_0x04ab('0x39')]=_[_0x04ab('0x3c')](_0x2e069d[_0x04ab('0x39')],{'$or':_[_0x04ab('0x2f')](_0x5596fc,function(_0x3f145){if(_0x3f145['type']!==_0x04ab('0x3d')){var _0x14756a={};_0x14756a[_0x3f145['name']]={'$like':'%'+_0x404eae['query'][_0x04ab('0x3b')]+'%'};return _0x14756a;}})});}_0x2e069d=_[_0x04ab('0x3c')]({},_0x2e069d,_0x404eae[_0x04ab('0x3e')]);var _0x4327b9={'where':_0x2e069d['where']};return db[_0x04ab('0x29')][_0x04ab('0x1d')](_0x4327b9)[_0x04ab('0x23')](function(_0x244acf){_0x12385b['count']=_0x244acf;if(_0x404eae[_0x04ab('0x30')][_0x04ab('0x3f')]){_0x2e069d[_0x04ab('0x40')]=[{'all':!![]}];}return db[_0x04ab('0x29')][_0x04ab('0x41')](_0x2e069d);})[_0x04ab('0x23')](function(_0x20b8cc){_0x12385b[_0x04ab('0x42')]=_0x20b8cc;return _0x12385b;})['then'](respondWithFilteredResult(_0x30db64,_0x2e069d))['catch'](handleError(_0x30db64,null));};exports[_0x04ab('0x43')]=function(_0x4c8cb0,_0x8a93c2){var _0x46a7c5={'raw':!![],'where':{'id':_0x4c8cb0['params']['id']}},_0x3c27ee={};_0x3c27ee[_0x04ab('0x2e')]=_[_0x04ab('0x31')](db[_0x04ab('0x29')]['rawAttributes']);_0x3c27ee[_0x04ab('0x30')]=_[_0x04ab('0x31')](_0x4c8cb0[_0x04ab('0x30')]);_0x3c27ee[_0x04ab('0x32')]=_[_0x04ab('0x33')](_0x3c27ee[_0x04ab('0x2e')],_0x3c27ee[_0x04ab('0x30')]);_0x46a7c5[_0x04ab('0x35')]=_[_0x04ab('0x33')](_0x3c27ee[_0x04ab('0x2e')],qs['fields'](_0x4c8cb0[_0x04ab('0x30')][_0x04ab('0x34')]));_0x46a7c5[_0x04ab('0x35')]=_0x46a7c5[_0x04ab('0x35')][_0x04ab('0x36')]?_0x46a7c5[_0x04ab('0x35')]:_0x3c27ee['model'];if(_0x4c8cb0[_0x04ab('0x30')][_0x04ab('0x3f')]){_0x46a7c5[_0x04ab('0x40')]=[{'all':!![]}];}_0x46a7c5=_[_0x04ab('0x3c')]({},_0x46a7c5,_0x4c8cb0['options']);return db[_0x04ab('0x29')][_0x04ab('0x44')](_0x46a7c5)[_0x04ab('0x23')](handleEntityNotFound(_0x8a93c2,null))[_0x04ab('0x23')](respondWithResult(_0x8a93c2,null))[_0x04ab('0x45')](handleError(_0x8a93c2,null));};exports['create']=function(_0x326621,_0x15b995){return db['Cdr']['create'](_0x326621[_0x04ab('0x46')],{})[_0x04ab('0x23')](respondWithResult(_0x15b995,0xc9))[_0x04ab('0x45')](handleError(_0x15b995,null));};exports[_0x04ab('0x47')]=function(_0x1c4aa2,_0x3a9056){if(_0x1c4aa2[_0x04ab('0x46')]['id']){delete _0x1c4aa2['body']['id'];}return db[_0x04ab('0x29')][_0x04ab('0x44')]({'where':{'id':_0x1c4aa2[_0x04ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a9056,null))[_0x04ab('0x23')](saveUpdates(_0x1c4aa2[_0x04ab('0x46')],null))['then'](respondWithResult(_0x3a9056,null))[_0x04ab('0x45')](handleError(_0x3a9056,null));};exports['destroy']=function(_0xc9db25,_0x4bc4f6){return db[_0x04ab('0x29')]['find']({'where':{'id':_0xc9db25['params']['id']}})[_0x04ab('0x23')](handleEntityNotFound(_0x4bc4f6,null))[_0x04ab('0x23')](removeEntity(_0x4bc4f6,null))[_0x04ab('0x45')](handleError(_0x4bc4f6,null));};exports['describe']=function(_0x53f63a,_0x5ed30e){return db[_0x04ab('0x29')][_0x04ab('0x49')]()['then'](respondWithResult(_0x5ed30e,null))[_0x04ab('0x45')](handleError(_0x5ed30e,null));}; \ No newline at end of file +var _0x826a=['key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','Cdr','fieldName','type'];(function(_0x5ab238,_0x4ddda9){var _0x236db6=function(_0x5f1f3f){while(--_0x5f1f3f){_0x5ab238['push'](_0x5ab238['shift']());}};_0x236db6(++_0x4ddda9);}(_0x826a,0x1aa));var _0xa826=function(_0x7f4ea5,_0x1655e0){_0x7f4ea5=_0x7f4ea5-0x0;var _0x26f5b7=_0x826a[_0x7f4ea5];return _0x26f5b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa826('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa826('0x1'));var rp=require('request-promise');var moment=require(_0xa826('0x2'));var BPromise=require(_0xa826('0x3'));var Mustache=require(_0xa826('0x4'));var util=require(_0xa826('0x5'));var path=require('path');var sox=require(_0xa826('0x6'));var csv=require(_0xa826('0x7'));var ejs=require(_0xa826('0x8'));var fs=require('fs');var fs_extra=require(_0xa826('0x9'));var _=require(_0xa826('0xa'));var squel=require(_0xa826('0xb'));var crypto=require(_0xa826('0xc'));var jsforce=require(_0xa826('0xd'));var deskjs=require(_0xa826('0xe'));var toCsv=require(_0xa826('0x7'));var querystring=require(_0xa826('0xf'));var Papa=require(_0xa826('0x10'));var Redis=require(_0xa826('0x11'));var authService=require(_0xa826('0x12'));var qs=require(_0xa826('0x13'));var as=require(_0xa826('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa826('0x15'))('api');var utils=require(_0xa826('0x16'));var config=require(_0xa826('0x17'));var licenseUtil=require(_0xa826('0x18'));var db=require(_0xa826('0x19'))['db'];function respondWithStatusCode(_0x212fac,_0x40838f){_0x40838f=_0x40838f||0xcc;return function(_0x2f1d39){if(_0x2f1d39){return _0x212fac['sendStatus'](_0x40838f);}return _0x212fac[_0xa826('0x1a')](_0x40838f)['end']();};}function respondWithResult(_0x3e99b0,_0x41c0c2){_0x41c0c2=_0x41c0c2||0xc8;return function(_0x5dc0c7){if(_0x5dc0c7){return _0x3e99b0['status'](_0x41c0c2)['json'](_0x5dc0c7);}};}function respondWithFilteredResult(_0x1b6d16,_0x4f25bd){return function(_0x4c546b){if(_0x4c546b){var _0x9a3788=typeof _0x4f25bd[_0xa826('0x1b')]===_0xa826('0x1c')&&typeof _0x4f25bd['limit']===_0xa826('0x1c');var _0x312e14=_0x4c546b[_0xa826('0x1d')];var _0x453c5d=_0x9a3788?0x0:_0x4f25bd[_0xa826('0x1b')];var _0x48930f=_0x9a3788?_0x4c546b[_0xa826('0x1d')]:_0x4f25bd[_0xa826('0x1b')]+_0x4f25bd[_0xa826('0x1e')];var _0x57e96e;if(_0x48930f>=_0x312e14){_0x48930f=_0x312e14;_0x57e96e=0xc8;}else{_0x57e96e=0xce;}_0x1b6d16['status'](_0x57e96e);return _0x1b6d16[_0xa826('0x1f')](_0xa826('0x20'),_0x453c5d+'-'+_0x48930f+'/'+_0x312e14)[_0xa826('0x21')](_0x4c546b);}return null;};}function patchUpdates(_0x8d1650){return function(_0x124564){try{jsonpatch['apply'](_0x124564,_0x8d1650,!![]);}catch(_0x3171ff){return BPromise[_0xa826('0x22')](_0x3171ff);}return _0x124564[_0xa826('0x23')]();};}function saveUpdates(_0x5d410f,_0x5ddeef){return function(_0x361ca5){if(_0x361ca5){return _0x361ca5[_0xa826('0x24')](_0x5d410f)[_0xa826('0x25')](function(_0x4eb4f3){return _0x4eb4f3;});}return null;};}function removeEntity(_0x1d7adf,_0x26ef25){return function(_0x1d4ade){if(_0x1d4ade){return _0x1d4ade[_0xa826('0x26')]()[_0xa826('0x25')](function(){_0x1d7adf['status'](0xcc)[_0xa826('0x27')]();});}};}function handleEntityNotFound(_0x4fa5db,_0x17ef2d){return function(_0x174f16){if(!_0x174f16){_0x4fa5db['sendStatus'](0x194);}return _0x174f16;};}function handleError(_0xfc0448,_0xfa4d94){_0xfa4d94=_0xfa4d94||0x1f4;return function(_0x38c919){logger[_0xa826('0x28')](_0x38c919[_0xa826('0x29')]);if(_0x38c919[_0xa826('0x2a')]){delete _0x38c919[_0xa826('0x2a')];}_0xfc0448[_0xa826('0x1a')](_0xfa4d94)[_0xa826('0x2b')](_0x38c919);};}exports[_0xa826('0x2c')]=function(_0x1e35de,_0x473d8d){var _0x1f2749={},_0x2cb586={},_0x2253c7={'count':0x0,'rows':[]};var _0x27f8f9=_['map'](db[_0xa826('0x2d')]['rawAttributes'],function(_0x2dd810){return{'name':_0x2dd810[_0xa826('0x2e')],'type':_0x2dd810[_0xa826('0x2f')][_0xa826('0x30')]};});_0x2cb586[_0xa826('0x31')]=_['map'](_0x27f8f9,'name');_0x2cb586[_0xa826('0x32')]=_[_0xa826('0x33')](_0x1e35de[_0xa826('0x32')]);_0x2cb586[_0xa826('0x34')]=_['intersection'](_0x2cb586[_0xa826('0x31')],_0x2cb586[_0xa826('0x32')]);_0x1f2749['attributes']=_[_0xa826('0x35')](_0x2cb586['model'],qs[_0xa826('0x36')](_0x1e35de[_0xa826('0x32')][_0xa826('0x36')]));_0x1f2749[_0xa826('0x37')]=_0x1f2749[_0xa826('0x37')]['length']?_0x1f2749[_0xa826('0x37')]:_0x2cb586[_0xa826('0x31')];if(!_0x1e35de[_0xa826('0x32')][_0xa826('0x38')](_0xa826('0x39'))){_0x1f2749[_0xa826('0x1e')]=qs[_0xa826('0x1e')](_0x1e35de[_0xa826('0x32')][_0xa826('0x1e')]);_0x1f2749[_0xa826('0x1b')]=qs[_0xa826('0x1b')](_0x1e35de['query'][_0xa826('0x1b')]);}_0x1f2749['order']=qs[_0xa826('0x3a')](_0x1e35de['query'][_0xa826('0x3a')]);_0x1f2749[_0xa826('0x3b')]=qs[_0xa826('0x34')](_[_0xa826('0x3c')](_0x1e35de[_0xa826('0x32')],_0x2cb586[_0xa826('0x34')]),_0x27f8f9);if(_0x1e35de[_0xa826('0x32')][_0xa826('0x3d')]){_0x1f2749[_0xa826('0x3b')]=_[_0xa826('0x3e')](_0x1f2749[_0xa826('0x3b')],{'$or':_[_0xa826('0x3f')](_0x27f8f9,function(_0x5911d3){if(_0x5911d3[_0xa826('0x2f')]!==_0xa826('0x40')){var _0x251208={};_0x251208[_0x5911d3['name']]={'$like':'%'+_0x1e35de[_0xa826('0x32')][_0xa826('0x3d')]+'%'};return _0x251208;}})});}_0x1f2749=_['merge']({},_0x1f2749,_0x1e35de[_0xa826('0x41')]);var _0x47d9f1={'where':_0x1f2749['where']};return db[_0xa826('0x2d')][_0xa826('0x1d')](_0x47d9f1)[_0xa826('0x25')](function(_0x308d4){_0x2253c7[_0xa826('0x1d')]=_0x308d4;if(_0x1e35de[_0xa826('0x32')]['includeAll']){_0x1f2749[_0xa826('0x42')]=[{'all':!![]}];}return db[_0xa826('0x2d')][_0xa826('0x43')](_0x1f2749);})[_0xa826('0x25')](function(_0x244fd3){_0x2253c7[_0xa826('0x44')]=_0x244fd3;return _0x2253c7;})['then'](respondWithFilteredResult(_0x473d8d,_0x1f2749))[_0xa826('0x45')](handleError(_0x473d8d,null));};exports[_0xa826('0x46')]=function(_0x405ee1,_0x162be1){var _0x258e57={'raw':!![],'where':{'id':_0x405ee1[_0xa826('0x47')]['id']}},_0x53b70e={};_0x53b70e[_0xa826('0x31')]=_[_0xa826('0x33')](db[_0xa826('0x2d')][_0xa826('0x48')]);_0x53b70e[_0xa826('0x32')]=_[_0xa826('0x33')](_0x405ee1[_0xa826('0x32')]);_0x53b70e[_0xa826('0x34')]=_[_0xa826('0x35')](_0x53b70e[_0xa826('0x31')],_0x53b70e[_0xa826('0x32')]);_0x258e57['attributes']=_[_0xa826('0x35')](_0x53b70e[_0xa826('0x31')],qs[_0xa826('0x36')](_0x405ee1['query'][_0xa826('0x36')]));_0x258e57[_0xa826('0x37')]=_0x258e57[_0xa826('0x37')][_0xa826('0x49')]?_0x258e57[_0xa826('0x37')]:_0x53b70e['model'];if(_0x405ee1[_0xa826('0x32')][_0xa826('0x4a')]){_0x258e57[_0xa826('0x42')]=[{'all':!![]}];}_0x258e57=_[_0xa826('0x3e')]({},_0x258e57,_0x405ee1[_0xa826('0x41')]);return db[_0xa826('0x2d')][_0xa826('0x4b')](_0x258e57)['then'](handleEntityNotFound(_0x162be1,null))[_0xa826('0x25')](respondWithResult(_0x162be1,null))['catch'](handleError(_0x162be1,null));};exports['create']=function(_0x4b4352,_0x26a858){return db[_0xa826('0x2d')][_0xa826('0x4c')](_0x4b4352[_0xa826('0x4d')],{})['then'](respondWithResult(_0x26a858,0xc9))[_0xa826('0x45')](handleError(_0x26a858,null));};exports['update']=function(_0x5e0947,_0xedcbc2){if(_0x5e0947[_0xa826('0x4d')]['id']){delete _0x5e0947['body']['id'];}return db[_0xa826('0x2d')][_0xa826('0x4b')]({'where':{'id':_0x5e0947['params']['id']}})['then'](handleEntityNotFound(_0xedcbc2,null))['then'](saveUpdates(_0x5e0947['body'],null))['then'](respondWithResult(_0xedcbc2,null))['catch'](handleError(_0xedcbc2,null));};exports['destroy']=function(_0xb3fae0,_0x5d5269){return db[_0xa826('0x2d')]['find']({'where':{'id':_0xb3fae0[_0xa826('0x47')]['id']}})[_0xa826('0x25')](handleEntityNotFound(_0x5d5269,null))[_0xa826('0x25')](removeEntity(_0x5d5269,null))[_0xa826('0x45')](handleError(_0x5d5269,null));};exports[_0xa826('0x4e')]=function(_0x52cf5e,_0x209704){return db['Cdr']['describe']()[_0xa826('0x25')](respondWithResult(_0x209704,null))[_0xa826('0x45')](handleError(_0x209704,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index e2b0612..6b5c418 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(_0x49856d,_0x1c47bc){var _0x19976d=function(_0x351f98){while(--_0x351f98){_0x49856d['push'](_0x49856d['shift']());}};_0x19976d(++_0x1c47bc);}(_0x7a54,0x106));var _0x47a5=function(_0x3ff227,_0x3a8351){_0x3ff227=_0x3ff227-0x0;var _0x3fae84=_0x7a54[_0x3ff227];return _0x3fae84;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x400a3b,_0x5a5189){var _0x53426b=function(_0x113d6d){while(--_0x113d6d){_0x400a3b['push'](_0x400a3b['shift']());}};_0x53426b(++_0x5a5189);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index a41d34e..9f86bcb 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 _0x1d5e=['request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x5f3466,_0x15e4d3){var _0x21b9a6=function(_0x15a04b){while(--_0x15a04b){_0x5f3466['push'](_0x5f3466['shift']());}};_0x21b9a6(++_0x15e4d3);}(_0x1d5e,0x11b));var _0xe1d5=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1d5e[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0xe1d5('0x0'));var moment=require('moment');var BPromise=require(_0xe1d5('0x1'));var rs=require(_0xe1d5('0x2'));var fs=require('fs');var Redis=require(_0xe1d5('0x3'));var db=require(_0xe1d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe1d5('0x5'));var jayson=require(_0xe1d5('0x6'));var client=jayson[_0xe1d5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x464db5,_0xe682c4,_0x436702){return new BPromise(function(_0x4bbf8f,_0xe8872b){return client[_0xe1d5('0x8')](_0x464db5,_0x436702)[_0xe1d5('0x9')](function(_0x1219c8){logger[_0xe1d5('0xa')]('Cdr,\x20%s,\x20%s',_0xe682c4,_0xe1d5('0xb'));logger[_0xe1d5('0xc')](_0xe1d5('0xd'),_0xe682c4,_0xe1d5('0xb'),JSON[_0xe1d5('0xe')](_0x1219c8));if(_0x1219c8[_0xe1d5('0xf')]){if(_0x1219c8[_0xe1d5('0xf')][_0xe1d5('0x10')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0xe682c4,_0x1219c8[_0xe1d5('0xf')]['message']);return _0xe8872b(_0x1219c8[_0xe1d5('0xf')][_0xe1d5('0x11')]);}logger['error'](_0xe1d5('0x12'),_0xe682c4,_0x1219c8[_0xe1d5('0xf')][_0xe1d5('0x11')]);return _0x4bbf8f(_0x1219c8['error'][_0xe1d5('0x11')]);}else{logger[_0xe1d5('0xa')](_0xe1d5('0x12'),_0xe682c4,'request\x20sent');_0x4bbf8f(_0x1219c8[_0xe1d5('0x13')][_0xe1d5('0x11')]);}})[_0xe1d5('0x14')](function(_0x354e4e){logger[_0xe1d5('0xf')](_0xe1d5('0x12'),_0xe682c4,_0x354e4e);_0xe8872b(_0x354e4e);});});} \ No newline at end of file +var _0xd892=['request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s'];(function(_0x2f77d6,_0x815a1d){var _0x5bf9eb=function(_0xb05bb5){while(--_0xb05bb5){_0x2f77d6['push'](_0x2f77d6['shift']());}};_0x5bf9eb(++_0x815a1d);}(_0xd892,0x18f));var _0x2d89=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xd892[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x2d89('0x0'));var util=require(_0x2d89('0x1'));var moment=require(_0x2d89('0x2'));var BPromise=require(_0x2d89('0x3'));var rs=require(_0x2d89('0x4'));var fs=require('fs');var Redis=require(_0x2d89('0x5'));var db=require(_0x2d89('0x6'))['db'];var utils=require(_0x2d89('0x7'));var logger=require(_0x2d89('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2d89('0x9'));var client=jayson[_0x2d89('0xa')][_0x2d89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x363cb9,_0x370d2a,_0xa3365d){return new BPromise(function(_0x14332c,_0xd82516){return client[_0x2d89('0xc')](_0x363cb9,_0xa3365d)[_0x2d89('0xd')](function(_0x470a45){logger['info'](_0x2d89('0xe'),_0x370d2a,_0x2d89('0xf'));logger[_0x2d89('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x370d2a,'request\x20sent',JSON[_0x2d89('0x11')](_0x470a45));if(_0x470a45[_0x2d89('0x12')]){if(_0x470a45[_0x2d89('0x12')][_0x2d89('0x13')]===0x1f4){logger[_0x2d89('0x12')](_0x2d89('0xe'),_0x370d2a,_0x470a45[_0x2d89('0x12')][_0x2d89('0x14')]);return _0xd82516(_0x470a45[_0x2d89('0x12')]['message']);}logger[_0x2d89('0x12')](_0x2d89('0xe'),_0x370d2a,_0x470a45[_0x2d89('0x12')][_0x2d89('0x14')]);return _0x14332c(_0x470a45[_0x2d89('0x12')][_0x2d89('0x14')]);}else{logger[_0x2d89('0x15')](_0x2d89('0xe'),_0x370d2a,_0x2d89('0xf'));_0x14332c(_0x470a45['result'][_0x2d89('0x14')]);}})[_0x2d89('0x16')](function(_0x2f62e4){logger[_0x2d89('0x12')](_0x2d89('0xe'),_0x370d2a,_0x2f62e4);_0xd82516(_0x2f62e4);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 0d650bf..3dd46ec 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index d423ba9..16ece3c 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 _0x987f=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x127cfa,_0x1f028c){var _0x2a6dcb=function(_0x49af9c){while(--_0x49af9c){_0x127cfa['push'](_0x127cfa['shift']());}};_0x2a6dcb(++_0x1f028c);}(_0x987f,0xf9));var _0xf987=function(_0x2c1101,_0x1909d9){_0x2c1101=_0x2c1101-0x0;var _0x56f52f=_0x987f[_0x2c1101];return _0x56f52f;};'use strict';var Sequelize=require(_0xf987('0x0'));module[_0xf987('0x1')]={'priority':{'type':Sequelize[_0xf987('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf987('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf987('0x4')]()},'description':{'type':Sequelize[_0xf987('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf987('0x5')}}; \ No newline at end of file +var _0x9c76=['exports','noop','STRING','*,*,*,*','sequelize'];(function(_0x983327,_0x54bbf9){var _0x30e0c2=function(_0x22cedc){while(--_0x22cedc){_0x983327['push'](_0x983327['shift']());}};_0x30e0c2(++_0x54bbf9);}(_0x9c76,0x199));var _0x69c7=function(_0x1c73e8,_0x5349ec){_0x1c73e8=_0x1c73e8-0x0;var _0x5f2c5b=_0x9c76[_0x1c73e8];return _0x5f2c5b;};'use strict';var Sequelize=require(_0x69c7('0x0'));module[_0x69c7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x69c7('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x69c7('0x3')]},'interval':{'type':Sequelize[_0x69c7('0x3')],'defaultValue':_0x69c7('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 883b244..8b682b7 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 _0x639a=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','offset','undefined','count','set','Content-Range','apply','then','sendStatus','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','include','merge','options','find','catch','update','body','ChatApplication'];(function(_0x15fcee,_0x5ca682){var _0x42c080=function(_0x4d1332){while(--_0x4d1332){_0x15fcee['push'](_0x15fcee['shift']());}};_0x42c080(++_0x5ca682);}(_0x639a,0xec));var _0xa639=function(_0x33ec4b,_0x30cdd9){_0x33ec4b=_0x33ec4b-0x0;var _0x48027a=_0x639a[_0x33ec4b];return _0x48027a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa639('0x0'));var zipdir=require(_0xa639('0x1'));var jsonpatch=require(_0xa639('0x2'));var rp=require(_0xa639('0x3'));var moment=require(_0xa639('0x4'));var BPromise=require(_0xa639('0x5'));var Mustache=require('mustache');var util=require(_0xa639('0x6'));var path=require(_0xa639('0x7'));var sox=require(_0xa639('0x8'));var csv=require('to-csv');var ejs=require(_0xa639('0x9'));var fs=require('fs');var fs_extra=require(_0xa639('0xa'));var _=require(_0xa639('0xb'));var squel=require(_0xa639('0xc'));var crypto=require('crypto');var jsforce=require(_0xa639('0xd'));var deskjs=require(_0xa639('0xe'));var toCsv=require(_0xa639('0xf'));var querystring=require(_0xa639('0x10'));var Papa=require(_0xa639('0x11'));var Redis=require(_0xa639('0x12'));var authService=require(_0xa639('0x13'));var qs=require(_0xa639('0x14'));var as=require(_0xa639('0x15'));var hardwareService=require(_0xa639('0x16'));var logger=require(_0xa639('0x17'))(_0xa639('0x18'));var utils=require(_0xa639('0x19'));var config=require(_0xa639('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ba862,_0x2bf30f){_0x2bf30f=_0x2bf30f||0xcc;return function(_0xbd7aec){if(_0xbd7aec){return _0x5ba862['sendStatus'](_0x2bf30f);}return _0x5ba862['status'](_0x2bf30f)[_0xa639('0x1b')]();};}function respondWithResult(_0x1bdc46,_0x4d4b66){_0x4d4b66=_0x4d4b66||0xc8;return function(_0x1df5dd){if(_0x1df5dd){return _0x1bdc46[_0xa639('0x1c')](_0x4d4b66)[_0xa639('0x1d')](_0x1df5dd);}};}function respondWithFilteredResult(_0x49e770,_0xb15138){return function(_0x24f1a9){if(_0x24f1a9){var _0x96a92f=typeof _0xb15138[_0xa639('0x1e')]===_0xa639('0x1f')&&typeof _0xb15138['limit']===_0xa639('0x1f');var _0x4c6311=_0x24f1a9[_0xa639('0x20')];var _0x2e23a9=_0x96a92f?0x0:_0xb15138[_0xa639('0x1e')];var _0x229545=_0x96a92f?_0x24f1a9[_0xa639('0x20')]:_0xb15138['offset']+_0xb15138['limit'];var _0x2a36df;if(_0x229545>=_0x4c6311){_0x229545=_0x4c6311;_0x2a36df=0xc8;}else{_0x2a36df=0xce;}_0x49e770[_0xa639('0x1c')](_0x2a36df);return _0x49e770[_0xa639('0x21')](_0xa639('0x22'),_0x2e23a9+'-'+_0x229545+'/'+_0x4c6311)[_0xa639('0x1d')](_0x24f1a9);}return null;};}function patchUpdates(_0x52500b){return function(_0x5a939f){try{jsonpatch[_0xa639('0x23')](_0x5a939f,_0x52500b,!![]);}catch(_0x5d732c){return BPromise['reject'](_0x5d732c);}return _0x5a939f['save']();};}function saveUpdates(_0x43f85f,_0x28a11c){return function(_0x13592d){if(_0x13592d){return _0x13592d['update'](_0x43f85f)[_0xa639('0x24')](function(_0x562d03){return _0x562d03;});}return null;};}function removeEntity(_0xe89eb9,_0x351a33){return function(_0x55189d){if(_0x55189d){return _0x55189d['destroy']()['then'](function(){_0xe89eb9[_0xa639('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42b5d8,_0x3d6e0c){return function(_0x237da8){if(!_0x237da8){_0x42b5d8[_0xa639('0x25')](0x194);}return _0x237da8;};}function handleError(_0x5ded72,_0x314e07){_0x314e07=_0x314e07||0x1f4;return function(_0x1a0d4e){logger[_0xa639('0x26')](_0x1a0d4e[_0xa639('0x27')]);if(_0x1a0d4e[_0xa639('0x28')]){delete _0x1a0d4e[_0xa639('0x28')];}_0x5ded72[_0xa639('0x1c')](_0x314e07)[_0xa639('0x29')](_0x1a0d4e);};}exports[_0xa639('0x2a')]=function(_0x3cda24,_0x4b7f2c){var _0x2d315f={'raw':!![],'where':{'id':_0x3cda24[_0xa639('0x2b')]['id']}},_0x38ff11={};_0x38ff11[_0xa639('0x2c')]=_[_0xa639('0x2d')](db['ChatApplication'][_0xa639('0x2e')]);_0x38ff11[_0xa639('0x2f')]=_['keys'](_0x3cda24[_0xa639('0x2f')]);_0x38ff11[_0xa639('0x30')]=_[_0xa639('0x31')](_0x38ff11[_0xa639('0x2c')],_0x38ff11[_0xa639('0x2f')]);_0x2d315f[_0xa639('0x32')]=_[_0xa639('0x31')](_0x38ff11[_0xa639('0x2c')],qs['fields'](_0x3cda24[_0xa639('0x2f')]['fields']));_0x2d315f[_0xa639('0x32')]=_0x2d315f[_0xa639('0x32')]['length']?_0x2d315f[_0xa639('0x32')]:_0x38ff11['model'];if(_0x3cda24[_0xa639('0x2f')]['includeAll']){_0x2d315f[_0xa639('0x33')]=[{'all':!![]}];}_0x2d315f=_[_0xa639('0x34')]({},_0x2d315f,_0x3cda24[_0xa639('0x35')]);return db['ChatApplication'][_0xa639('0x36')](_0x2d315f)[_0xa639('0x24')](handleEntityNotFound(_0x4b7f2c,null))[_0xa639('0x24')](respondWithResult(_0x4b7f2c,null))[_0xa639('0x37')](handleError(_0x4b7f2c,null));};exports[_0xa639('0x38')]=function(_0x2c69fa,_0xa34d5c){if(_0x2c69fa[_0xa639('0x39')]['id']){delete _0x2c69fa['body']['id'];}return db[_0xa639('0x3a')]['find']({'where':{'id':_0x2c69fa[_0xa639('0x2b')]['id']}})[_0xa639('0x24')](handleEntityNotFound(_0xa34d5c,null))['then'](saveUpdates(_0x2c69fa[_0xa639('0x39')],null))[_0xa639('0x24')](respondWithResult(_0xa34d5c,null))[_0xa639('0x37')](handleError(_0xa34d5c,null));};exports['destroy']=function(_0x4ce86c,_0x16d74d){return db[_0xa639('0x3a')]['find']({'where':{'id':_0x4ce86c['params']['id']}})[_0xa639('0x24')](handleEntityNotFound(_0x16d74d,null))[_0xa639('0x24')](removeEntity(_0x16d74d,null))['catch'](handleError(_0x16d74d,null));}; \ No newline at end of file +var _0xb077=['intersection','fields','length','include','merge','catch','body','find','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','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','sendStatus','end','json','undefined','count','offset','limit','apply','reject','save','update','destroy','then','status','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','attributes'];(function(_0x23e797,_0x1dc763){var _0xa5e856=function(_0x4578af){while(--_0x4578af){_0x23e797['push'](_0x23e797['shift']());}};_0xa5e856(++_0x1dc763);}(_0xb077,0x7a));var _0x7b07=function(_0x52551d,_0x9d47ba){_0x52551d=_0x52551d-0x0;var _0x5df61d=_0xb077[_0x52551d];return _0x5df61d;};'use strict';var emlformat=require(_0x7b07('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7b07('0x1'));var rp=require('request-promise');var moment=require(_0x7b07('0x2'));var BPromise=require(_0x7b07('0x3'));var Mustache=require(_0x7b07('0x4'));var util=require(_0x7b07('0x5'));var path=require(_0x7b07('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b07('0x7'));var fs=require('fs');var fs_extra=require(_0x7b07('0x8'));var _=require(_0x7b07('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7b07('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7b07('0xb'));var querystring=require(_0x7b07('0xc'));var Papa=require(_0x7b07('0xd'));var Redis=require(_0x7b07('0xe'));var authService=require(_0x7b07('0xf'));var qs=require(_0x7b07('0x10'));var as=require(_0x7b07('0x11'));var hardwareService=require(_0x7b07('0x12'));var logger=require(_0x7b07('0x13'))('api');var utils=require(_0x7b07('0x14'));var config=require(_0x7b07('0x15'));var licenseUtil=require(_0x7b07('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe825c4,_0x3d73c6){_0x3d73c6=_0x3d73c6||0xcc;return function(_0x9f3404){if(_0x9f3404){return _0xe825c4[_0x7b07('0x17')](_0x3d73c6);}return _0xe825c4['status'](_0x3d73c6)[_0x7b07('0x18')]();};}function respondWithResult(_0x10fc29,_0x44cf4c){_0x44cf4c=_0x44cf4c||0xc8;return function(_0x5ded26){if(_0x5ded26){return _0x10fc29['status'](_0x44cf4c)[_0x7b07('0x19')](_0x5ded26);}};}function respondWithFilteredResult(_0x389f3c,_0x2acc2f){return function(_0x2f6e33){if(_0x2f6e33){var _0x4b7d85=typeof _0x2acc2f['offset']==='undefined'&&typeof _0x2acc2f['limit']===_0x7b07('0x1a');var _0x18311b=_0x2f6e33[_0x7b07('0x1b')];var _0x3aab02=_0x4b7d85?0x0:_0x2acc2f[_0x7b07('0x1c')];var _0x282b2f=_0x4b7d85?_0x2f6e33[_0x7b07('0x1b')]:_0x2acc2f[_0x7b07('0x1c')]+_0x2acc2f[_0x7b07('0x1d')];var _0x2d9278;if(_0x282b2f>=_0x18311b){_0x282b2f=_0x18311b;_0x2d9278=0xc8;}else{_0x2d9278=0xce;}_0x389f3c['status'](_0x2d9278);return _0x389f3c['set']('Content-Range',_0x3aab02+'-'+_0x282b2f+'/'+_0x18311b)[_0x7b07('0x19')](_0x2f6e33);}return null;};}function patchUpdates(_0x3d0f65){return function(_0x2e5e24){try{jsonpatch[_0x7b07('0x1e')](_0x2e5e24,_0x3d0f65,!![]);}catch(_0x2f97ab){return BPromise[_0x7b07('0x1f')](_0x2f97ab);}return _0x2e5e24[_0x7b07('0x20')]();};}function saveUpdates(_0x481812,_0xe41126){return function(_0x44e774){if(_0x44e774){return _0x44e774[_0x7b07('0x21')](_0x481812)['then'](function(_0xf43662){return _0xf43662;});}return null;};}function removeEntity(_0x5ed88d,_0x2b81cf){return function(_0x5e858d){if(_0x5e858d){return _0x5e858d[_0x7b07('0x22')]()[_0x7b07('0x23')](function(){_0x5ed88d[_0x7b07('0x24')](0xcc)[_0x7b07('0x18')]();});}};}function handleEntityNotFound(_0x572e32,_0x3a960c){return function(_0x54943d){if(!_0x54943d){_0x572e32[_0x7b07('0x17')](0x194);}return _0x54943d;};}function handleError(_0x343e21,_0x4ded23){_0x4ded23=_0x4ded23||0x1f4;return function(_0x447119){logger[_0x7b07('0x25')](_0x447119[_0x7b07('0x26')]);if(_0x447119[_0x7b07('0x27')]){delete _0x447119[_0x7b07('0x27')];}_0x343e21[_0x7b07('0x24')](_0x4ded23)[_0x7b07('0x28')](_0x447119);};}exports[_0x7b07('0x29')]=function(_0x4777cc,_0x232f70){var _0xcaeb2a={'raw':!![],'where':{'id':_0x4777cc[_0x7b07('0x2a')]['id']}},_0xa78d19={};_0xa78d19[_0x7b07('0x2b')]=_[_0x7b07('0x2c')](db[_0x7b07('0x2d')]['rawAttributes']);_0xa78d19['query']=_[_0x7b07('0x2c')](_0x4777cc[_0x7b07('0x2e')]);_0xa78d19[_0x7b07('0x2f')]=_['intersection'](_0xa78d19[_0x7b07('0x2b')],_0xa78d19[_0x7b07('0x2e')]);_0xcaeb2a[_0x7b07('0x30')]=_[_0x7b07('0x31')](_0xa78d19['model'],qs[_0x7b07('0x32')](_0x4777cc['query'][_0x7b07('0x32')]));_0xcaeb2a['attributes']=_0xcaeb2a[_0x7b07('0x30')][_0x7b07('0x33')]?_0xcaeb2a['attributes']:_0xa78d19['model'];if(_0x4777cc[_0x7b07('0x2e')]['includeAll']){_0xcaeb2a[_0x7b07('0x34')]=[{'all':!![]}];}_0xcaeb2a=_[_0x7b07('0x35')]({},_0xcaeb2a,_0x4777cc['options']);return db[_0x7b07('0x2d')]['find'](_0xcaeb2a)[_0x7b07('0x23')](handleEntityNotFound(_0x232f70,null))[_0x7b07('0x23')](respondWithResult(_0x232f70,null))[_0x7b07('0x36')](handleError(_0x232f70,null));};exports[_0x7b07('0x21')]=function(_0xcfc128,_0x19c41f){if(_0xcfc128[_0x7b07('0x37')]['id']){delete _0xcfc128[_0x7b07('0x37')]['id'];}return db[_0x7b07('0x2d')][_0x7b07('0x38')]({'where':{'id':_0xcfc128[_0x7b07('0x2a')]['id']}})[_0x7b07('0x23')](handleEntityNotFound(_0x19c41f,null))[_0x7b07('0x23')](saveUpdates(_0xcfc128[_0x7b07('0x37')],null))[_0x7b07('0x23')](respondWithResult(_0x19c41f,null))[_0x7b07('0x36')](handleError(_0x19c41f,null));};exports[_0x7b07('0x22')]=function(_0x409f8d,_0x46f5bd){return db[_0x7b07('0x2d')]['find']({'where':{'id':_0x409f8d[_0x7b07('0x2a')]['id']}})[_0x7b07('0x23')](handleEntityNotFound(_0x46f5bd,null))[_0x7b07('0x23')](removeEntity(_0x46f5bd,null))[_0x7b07('0x36')](handleError(_0x46f5bd,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index ff4fd32..791e586 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 _0xf0cc=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','lodash','api','request-promise','path'];(function(_0xb1f8d9,_0x595b62){var _0x1c72da=function(_0x511a0c){while(--_0x511a0c){_0xb1f8d9['push'](_0xb1f8d9['shift']());}};_0x1c72da(++_0x595b62);}(_0xf0cc,0xa7));var _0xcf0c=function(_0xe4bba1,_0x4cae3a){_0xe4bba1=_0xe4bba1-0x0;var _0x4a7fcf=_0xf0cc[_0xe4bba1];return _0x4a7fcf;};'use strict';var _=require(_0xcf0c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcf0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcf0c('0x2'));var fs=require('fs');var path=require(_0xcf0c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf0c('0x4'));module[_0xcf0c('0x5')]=function(_0x1a6003,_0x497363){return _0x1a6003[_0xcf0c('0x6')](_0xcf0c('0x7'),attributes,{'tableName':_0xcf0c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xaffb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x57169f,_0x2695f6){var _0xb9279=function(_0x4a4e32){while(--_0x4a4e32){_0x57169f['push'](_0x57169f['shift']());}};_0xb9279(++_0x2695f6);}(_0xaffb,0x85));var _0xbaff=function(_0x5401ae,_0x5e58ac){_0x5401ae=_0x5401ae-0x0;var _0x286068=_0xaffb[_0x5401ae];return _0x286068;};'use strict';var _=require(_0xbaff('0x0'));var util=require(_0xbaff('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbaff('0x2'));var BPromise=require(_0xbaff('0x3'));var rp=require(_0xbaff('0x4'));var fs=require('fs');var path=require(_0xbaff('0x5'));var rimraf=require(_0xbaff('0x6'));var config=require(_0xbaff('0x7'));var attributes=require(_0xbaff('0x8'));module[_0xbaff('0x9')]=function(_0x2e7034,_0xd86e22){return _0x2e7034[_0xbaff('0xa')](_0xbaff('0xb'),attributes,{'tableName':_0xbaff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbaff('0xd'),'collate':_0xbaff('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 4691932..9b7cf35 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 _0x0541=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x1f2314,_0x38e139){var _0x515db4=function(_0x41f99d){while(--_0x41f99d){_0x1f2314['push'](_0x1f2314['shift']());}};_0x515db4(++_0x38e139);}(_0x0541,0x155));var _0x1054=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x0541[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0x1054('0x0'));var util=require(_0x1054('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1054('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1054('0x3'))['db'];var utils=require(_0x1054('0x4'));var logger=require(_0x1054('0x5'))(_0x1054('0x6'));var config=require(_0x1054('0x7'));var jayson=require(_0x1054('0x8'));var client=jayson[_0x1054('0x9')][_0x1054('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x189527,_0x4dbedb,_0x4e478e){return new BPromise(function(_0x466374,_0x39217b){return client[_0x1054('0xb')](_0x189527,_0x4e478e)[_0x1054('0xc')](function(_0x26d170){logger[_0x1054('0xd')](_0x1054('0xe'),_0x4dbedb,_0x1054('0xf'));logger[_0x1054('0x10')](_0x1054('0x11'),_0x4dbedb,_0x1054('0xf'),JSON['stringify'](_0x26d170));if(_0x26d170['error']){if(_0x26d170[_0x1054('0x12')]['code']===0x1f4){logger[_0x1054('0x12')](_0x1054('0xe'),_0x4dbedb,_0x26d170['error'][_0x1054('0x13')]);return _0x39217b(_0x26d170[_0x1054('0x12')]['message']);}logger[_0x1054('0x12')](_0x1054('0xe'),_0x4dbedb,_0x26d170[_0x1054('0x12')][_0x1054('0x13')]);return _0x466374(_0x26d170[_0x1054('0x12')][_0x1054('0x13')]);}else{logger[_0x1054('0xd')](_0x1054('0xe'),_0x4dbedb,_0x1054('0xf'));_0x466374(_0x26d170['result'][_0x1054('0x13')]);}})[_0x1054('0x14')](function(_0x30dbe6){logger[_0x1054('0x12')](_0x1054('0xe'),_0x4dbedb,_0x30dbe6);_0x39217b(_0x30dbe6);});});} \ No newline at end of file +var _0x3864=['error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x13d153,_0x3edda1){var _0x508a08=function(_0x465db7){while(--_0x465db7){_0x13d153['push'](_0x13d153['shift']());}};_0x508a08(++_0x3edda1);}(_0x3864,0x124));var _0x4386=function(_0x3515e4,_0x1b3681){_0x3515e4=_0x3515e4-0x0;var _0x5ce445=_0x3864[_0x3515e4];return _0x5ce445;};'use strict';var _=require(_0x4386('0x0'));var util=require(_0x4386('0x1'));var moment=require(_0x4386('0x2'));var BPromise=require('bluebird');var rs=require(_0x4386('0x3'));var fs=require('fs');var Redis=require(_0x4386('0x4'));var db=require(_0x4386('0x5'))['db'];var utils=require(_0x4386('0x6'));var logger=require('../../config/logger')(_0x4386('0x7'));var config=require(_0x4386('0x8'));var jayson=require(_0x4386('0x9'));var client=jayson['client'][_0x4386('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x749358,_0x4ee23b,_0x4cd0db){return new BPromise(function(_0x115fde,_0x33b78f){return client[_0x4386('0xb')](_0x749358,_0x4cd0db)[_0x4386('0xc')](function(_0x1b6c79){logger[_0x4386('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4ee23b,_0x4386('0xe'));logger[_0x4386('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4ee23b,'request\x20sent',JSON['stringify'](_0x1b6c79));if(_0x1b6c79['error']){if(_0x1b6c79[_0x4386('0x10')][_0x4386('0x11')]===0x1f4){logger[_0x4386('0x10')](_0x4386('0x12'),_0x4ee23b,_0x1b6c79[_0x4386('0x10')][_0x4386('0x13')]);return _0x33b78f(_0x1b6c79[_0x4386('0x10')][_0x4386('0x13')]);}logger[_0x4386('0x10')](_0x4386('0x12'),_0x4ee23b,_0x1b6c79[_0x4386('0x10')]['message']);return _0x115fde(_0x1b6c79[_0x4386('0x10')]['message']);}else{logger[_0x4386('0xd')](_0x4386('0x12'),_0x4ee23b,'request\x20sent');_0x115fde(_0x1b6c79[_0x4386('0x14')]['message']);}})[_0x4386('0x15')](function(_0x5c5ff7){logger['error'](_0x4386('0x12'),_0x4ee23b,_0x5c5ff7);_0x33b78f(_0x5c5ff7);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 3d9d525..0673885 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 _0xfdf2=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x29887d,_0x36d8e9){var _0xe5a96a=function(_0x845060){while(--_0x845060){_0x29887d['push'](_0x29887d['shift']());}};_0xe5a96a(++_0x36d8e9);}(_0xfdf2,0x1aa));var _0x2fdf=function(_0x3b194f,_0x4b5a3e){_0x3b194f=_0x3b194f-0x0;var _0x1dce17=_0xfdf2[_0x3b194f];return _0x1dce17;};'use strict';var multer=require('multer');var util=require(_0x2fdf('0x0'));var path=require(_0x2fdf('0x1'));var timeout=require(_0x2fdf('0x2'));var express=require(_0x2fdf('0x3'));var router=express[_0x2fdf('0x4')]();var fs_extra=require(_0x2fdf('0x5'));var auth=require(_0x2fdf('0x6'));var interaction=require(_0x2fdf('0x7'));var config=require(_0x2fdf('0x8'));var controller=require('./chatApplication.controller');router[_0x2fdf('0x9')]('/:id',auth[_0x2fdf('0xa')](),controller[_0x2fdf('0xb')]);router[_0x2fdf('0xc')]('/:id',auth[_0x2fdf('0xa')](),controller[_0x2fdf('0xd')]);router[_0x2fdf('0xe')](_0x2fdf('0xf'),auth[_0x2fdf('0xa')](),controller[_0x2fdf('0x10')]);module[_0x2fdf('0x11')]=router; \ No newline at end of file +var _0x3acd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0xaf2f45,_0x23d92a){var _0xa228b8=function(_0x390d4f){while(--_0x390d4f){_0xaf2f45['push'](_0xaf2f45['shift']());}};_0xa228b8(++_0x23d92a);}(_0x3acd,0x14e));var _0xd3ac=function(_0x255a7f,_0x107d6e){_0x255a7f=_0x255a7f-0x0;var _0x57e195=_0x3acd[_0x255a7f];return _0x57e195;};'use strict';var multer=require(_0xd3ac('0x0'));var util=require(_0xd3ac('0x1'));var path=require(_0xd3ac('0x2'));var timeout=require(_0xd3ac('0x3'));var express=require(_0xd3ac('0x4'));var router=express['Router']();var fs_extra=require(_0xd3ac('0x5'));var auth=require(_0xd3ac('0x6'));var interaction=require(_0xd3ac('0x7'));var config=require(_0xd3ac('0x8'));var controller=require(_0xd3ac('0x9'));router[_0xd3ac('0xa')](_0xd3ac('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd3ac('0xc')]('/:id',auth[_0xd3ac('0xd')](),controller[_0xd3ac('0xe')]);router[_0xd3ac('0xf')](_0xd3ac('0xb'),auth[_0xd3ac('0xd')](),controller['destroy']);module[_0xd3ac('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 7a49579..69664c1 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 _0xafec=['STRING','BOOLEAN','exports'];(function(_0x1c5042,_0x1ff338){var _0x20aa36=function(_0x4f97e8){while(--_0x4f97e8){_0x1c5042['push'](_0x1c5042['shift']());}};_0x20aa36(++_0x1ff338);}(_0xafec,0x161));var _0xcafe=function(_0xf0abc0,_0x3d3cdc){_0xf0abc0=_0xf0abc0-0x0;var _0x29fd55=_0xafec[_0xf0abc0];return _0x29fd55;};'use strict';var Sequelize=require('sequelize');module[_0xcafe('0x0')]={'name':{'type':Sequelize[_0xcafe('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xcafe('0x1')]},'write':{'type':Sequelize[_0xcafe('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1dbb=['BOOLEAN','sequelize','exports','STRING'];(function(_0x43dbd8,_0x4f70e6){var _0x4dac4d=function(_0x213056){while(--_0x213056){_0x43dbd8['push'](_0x43dbd8['shift']());}};_0x4dac4d(++_0x4f70e6);}(_0x1dbb,0xed));var _0xb1db=function(_0x317554,_0x53e29f){_0x317554=_0x317554-0x0;var _0x4db3d6=_0x1dbb[_0x317554];return _0x4db3d6;};'use strict';var Sequelize=require(_0xb1db('0x0'));module[_0xb1db('0x1')]={'name':{'type':Sequelize[_0xb1db('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xb1db('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 35f7caa..e714363 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 _0x793f=['jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','save','update','then','error','stack','name','send','ChatGroup','rawAttributes','fieldName','type','key','map','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','model','length','include','find','catch','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','rimraf','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','squel','crypto'];(function(_0x590861,_0x42c7f3){var _0x1d0a80=function(_0x42d3de){while(--_0x42d3de){_0x590861['push'](_0x590861['shift']());}};_0x1d0a80(++_0x42c7f3);}(_0x793f,0x15a));var _0xf793=function(_0x257c53,_0x2cddf8){_0x257c53=_0x257c53-0x0;var _0x6f5365=_0x793f[_0x257c53];return _0x6f5365;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf793('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf793('0x1'));var rp=require(_0xf793('0x2'));var moment=require('moment');var BPromise=require(_0xf793('0x3'));var Mustache=require('mustache');var util=require(_0xf793('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xf793('0x5'));var ejs=require(_0xf793('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf793('0x7'));var squel=require(_0xf793('0x8'));var crypto=require(_0xf793('0x9'));var jsforce=require(_0xf793('0xa'));var deskjs=require(_0xf793('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf793('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf793('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf793('0xe'));var logger=require('../../config/logger')(_0xf793('0xf'));var utils=require('../../config/utils');var config=require(_0xf793('0x10'));var licenseUtil=require(_0xf793('0x11'));var db=require(_0xf793('0x12'))['db'];config['redis']=_['defaults'](config[_0xf793('0x13')],{'host':_0xf793('0x14'),'port':0x18eb});var socket=require(_0xf793('0x15'))(new Redis(config[_0xf793('0x13')]));require('./chatGroup.socket')[_0xf793('0x16')](socket);function respondWithStatusCode(_0x43859c,_0x24c62f){_0x24c62f=_0x24c62f||0xcc;return function(_0x23ba38){if(_0x23ba38){return _0x43859c[_0xf793('0x17')](_0x24c62f);}return _0x43859c['status'](_0x24c62f)[_0xf793('0x18')]();};}function respondWithResult(_0x583148,_0x114925){_0x114925=_0x114925||0xc8;return function(_0x4b8f58){if(_0x4b8f58){return _0x583148['status'](_0x114925)['json'](_0x4b8f58);}};}function respondWithFilteredResult(_0x19bc06,_0x54188a){return function(_0x22335a){if(_0x22335a){var _0x31d5e1=typeof _0x54188a[_0xf793('0x19')]===_0xf793('0x1a')&&typeof _0x54188a[_0xf793('0x1b')]==='undefined';var _0x3bc25b=_0x22335a[_0xf793('0x1c')];var _0x1ed3a2=_0x31d5e1?0x0:_0x54188a['offset'];var _0x536eda=_0x31d5e1?_0x22335a[_0xf793('0x1c')]:_0x54188a[_0xf793('0x19')]+_0x54188a[_0xf793('0x1b')];var _0x552fbb;if(_0x536eda>=_0x3bc25b){_0x536eda=_0x3bc25b;_0x552fbb=0xc8;}else{_0x552fbb=0xce;}_0x19bc06[_0xf793('0x1d')](_0x552fbb);return _0x19bc06['set'](_0xf793('0x1e'),_0x1ed3a2+'-'+_0x536eda+'/'+_0x3bc25b)[_0xf793('0x1f')](_0x22335a);}return null;};}function patchUpdates(_0x41cfc7){return function(_0x59cd26){try{jsonpatch['apply'](_0x59cd26,_0x41cfc7,!![]);}catch(_0x571c46){return BPromise['reject'](_0x571c46);}return _0x59cd26[_0xf793('0x20')]();};}function saveUpdates(_0x450e39,_0x4be66b){return function(_0x20210d){if(_0x20210d){return _0x20210d[_0xf793('0x21')](_0x450e39)['then'](function(_0x53dbd6){return _0x53dbd6;});}return null;};}function removeEntity(_0x682f1b,_0x2806f9){return function(_0x4d7193){if(_0x4d7193){return _0x4d7193['destroy']()[_0xf793('0x22')](function(){_0x682f1b[_0xf793('0x1d')](0xcc)[_0xf793('0x18')]();});}};}function handleEntityNotFound(_0x2658d6,_0x30808a){return function(_0x5a332b){if(!_0x5a332b){_0x2658d6[_0xf793('0x17')](0x194);}return _0x5a332b;};}function handleError(_0x2135f2,_0x23d344){_0x23d344=_0x23d344||0x1f4;return function(_0x221e3a){logger[_0xf793('0x23')](_0x221e3a[_0xf793('0x24')]);if(_0x221e3a['name']){delete _0x221e3a[_0xf793('0x25')];}_0x2135f2[_0xf793('0x1d')](_0x23d344)[_0xf793('0x26')](_0x221e3a);};}exports['index']=function(_0x1b0fec,_0x1f038f){var _0x5c5180={},_0x3dbc29={},_0xa5fd34={'count':0x0,'rows':[]};var _0x9698a0=_['map'](db[_0xf793('0x27')][_0xf793('0x28')],function(_0x4423cc){return{'name':_0x4423cc[_0xf793('0x29')],'type':_0x4423cc[_0xf793('0x2a')][_0xf793('0x2b')]};});_0x3dbc29['model']=_[_0xf793('0x2c')](_0x9698a0,_0xf793('0x25'));_0x3dbc29[_0xf793('0x2d')]=_[_0xf793('0x2e')](_0x1b0fec[_0xf793('0x2d')]);_0x3dbc29[_0xf793('0x2f')]=_['intersection'](_0x3dbc29['model'],_0x3dbc29[_0xf793('0x2d')]);_0x5c5180[_0xf793('0x30')]=_[_0xf793('0x31')](_0x3dbc29['model'],qs['fields'](_0x1b0fec[_0xf793('0x2d')][_0xf793('0x32')]));_0x5c5180[_0xf793('0x30')]=_0x5c5180[_0xf793('0x30')]['length']?_0x5c5180['attributes']:_0x3dbc29['model'];if(!_0x1b0fec[_0xf793('0x2d')]['hasOwnProperty'](_0xf793('0x33'))){_0x5c5180[_0xf793('0x1b')]=qs[_0xf793('0x1b')](_0x1b0fec['query'][_0xf793('0x1b')]);_0x5c5180[_0xf793('0x19')]=qs['offset'](_0x1b0fec[_0xf793('0x2d')][_0xf793('0x19')]);}_0x5c5180['order']=qs[_0xf793('0x34')](_0x1b0fec['query'][_0xf793('0x34')]);_0x5c5180[_0xf793('0x35')]=qs['filters'](_[_0xf793('0x36')](_0x1b0fec[_0xf793('0x2d')],_0x3dbc29[_0xf793('0x2f')]),_0x9698a0);if(_0x1b0fec['query'][_0xf793('0x37')]){_0x5c5180[_0xf793('0x35')]=_[_0xf793('0x38')](_0x5c5180[_0xf793('0x35')],{'$or':_[_0xf793('0x2c')](_0x9698a0,function(_0x2ac7e6){if(_0x2ac7e6['type']!==_0xf793('0x39')){var _0x2c558e={};_0x2c558e[_0x2ac7e6[_0xf793('0x25')]]={'$like':'%'+_0x1b0fec[_0xf793('0x2d')][_0xf793('0x37')]+'%'};return _0x2c558e;}})});}_0x5c5180=_[_0xf793('0x38')]({},_0x5c5180,_0x1b0fec[_0xf793('0x3a')]);var _0x44daf7={'where':_0x5c5180['where']};return db[_0xf793('0x27')][_0xf793('0x1c')](_0x44daf7)[_0xf793('0x22')](function(_0x4ae4b6){_0xa5fd34[_0xf793('0x1c')]=_0x4ae4b6;if(_0x1b0fec[_0xf793('0x2d')][_0xf793('0x3b')]){_0x5c5180['include']=[{'all':!![]}];}return db[_0xf793('0x27')]['findAll'](_0x5c5180);})[_0xf793('0x22')](function(_0x4ee1af){_0xa5fd34[_0xf793('0x3c')]=_0x4ee1af;return _0xa5fd34;})[_0xf793('0x22')](respondWithFilteredResult(_0x1f038f,_0x5c5180))['catch'](handleError(_0x1f038f,null));};exports[_0xf793('0x3d')]=function(_0x4a6f50,_0x29c5d5){var _0x5680de={'raw':!![],'where':{'id':_0x4a6f50[_0xf793('0x3e')]['id']}},_0x13a4e6={};_0x13a4e6[_0xf793('0x3f')]=_[_0xf793('0x2e')](db[_0xf793('0x27')][_0xf793('0x28')]);_0x13a4e6[_0xf793('0x2d')]=_['keys'](_0x4a6f50['query']);_0x13a4e6['filters']=_[_0xf793('0x31')](_0x13a4e6[_0xf793('0x3f')],_0x13a4e6['query']);_0x5680de[_0xf793('0x30')]=_[_0xf793('0x31')](_0x13a4e6[_0xf793('0x3f')],qs[_0xf793('0x32')](_0x4a6f50['query']['fields']));_0x5680de['attributes']=_0x5680de[_0xf793('0x30')][_0xf793('0x40')]?_0x5680de[_0xf793('0x30')]:_0x13a4e6[_0xf793('0x3f')];if(_0x4a6f50[_0xf793('0x2d')]['includeAll']){_0x5680de[_0xf793('0x41')]=[{'all':!![]}];}_0x5680de=_[_0xf793('0x38')]({},_0x5680de,_0x4a6f50[_0xf793('0x3a')]);return db[_0xf793('0x27')][_0xf793('0x42')](_0x5680de)['then'](handleEntityNotFound(_0x29c5d5,null))[_0xf793('0x22')](respondWithResult(_0x29c5d5,null))[_0xf793('0x43')](handleError(_0x29c5d5,null));};exports['create']=function(_0x57fe6d,_0x22ae8e){return db[_0xf793('0x27')][_0xf793('0x44')](_0x57fe6d[_0xf793('0x45')],{})[_0xf793('0x22')](respondWithResult(_0x22ae8e,0xc9))[_0xf793('0x43')](handleError(_0x22ae8e,null));};exports[_0xf793('0x21')]=function(_0x11be05,_0x279d9d){if(_0x11be05['body']['id']){delete _0x11be05[_0xf793('0x45')]['id'];}return db[_0xf793('0x27')][_0xf793('0x42')]({'where':{'id':_0x11be05[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x279d9d,null))[_0xf793('0x22')](saveUpdates(_0x11be05['body'],null))[_0xf793('0x22')](respondWithResult(_0x279d9d,null))[_0xf793('0x43')](handleError(_0x279d9d,null));};exports[_0xf793('0x46')]=function(_0x515caf,_0x2c408e){return db['ChatGroup'][_0xf793('0x42')]({'where':{'id':_0x515caf[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x2c408e,null))[_0xf793('0x22')](removeEntity(_0x2c408e,null))[_0xf793('0x43')](handleError(_0x2c408e,null));};exports[_0xf793('0x47')]=function(_0x316f20,_0x35e024){return db[_0xf793('0x27')]['describe']()[_0xf793('0x22')](respondWithResult(_0x35e024,null))[_0xf793('0x43')](handleError(_0x35e024,null));};exports[_0xf793('0x48')]=function(_0x5d9a42,_0x31aecf,_0x495379){return db[_0xf793('0x49')]['count']({'where':{'ChatGroupId':_0x5d9a42[_0xf793('0x3e')]['id'],'ToId':_0x5d9a42[_0xf793('0x4a')]['id'],'read':![]}})[_0xf793('0x22')](function(_0x5eb283){return{'id':_[_0xf793('0x4b')](_0x5d9a42[_0xf793('0x3e')]['id']),'count':_0x5eb283};})[_0xf793('0x22')](respondWithResult(_0x31aecf,null))[_0xf793('0x43')](handleError(_0x31aecf,null));};exports[_0xf793('0x4c')]=function(_0x101876,_0x333e54,_0x63b614){return db[_0xf793('0x27')]['find']({'where':{'id':_0x101876[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x333e54,null))[_0xf793('0x22')](function(_0x3d0e06){if(_0x3d0e06){return _0x3d0e06['addMembers'](_0x101876['body']['ids'],_[_0xf793('0x4d')](_0x101876['body'],[_0xf793('0x4e'),'id'])||{});}})[_0xf793('0x22')](respondWithResult(_0x333e54,null))[_0xf793('0x43')](handleError(_0x333e54,null));};exports[_0xf793('0x4f')]=function(_0x36a031,_0x4c5734,_0x43e446){var _0xeeacd9={};var _0x458774={};var _0x54de26;var _0x2c42f8;return db[_0xf793('0x27')][_0xf793('0x50')]({'where':{'id':_0x36a031[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x4c5734,null))[_0xf793('0x22')](function(_0x4585dd){if(_0x4585dd){_0x54de26=_0x4585dd;_0x458774[_0xf793('0x3f')]=_[_0xf793('0x2e')](db[_0xf793('0x51')][_0xf793('0x28')]);_0x458774[_0xf793('0x2d')]=_['keys'](_0x36a031[_0xf793('0x2d')]);_0x458774[_0xf793('0x2f')]=_['intersection'](_0x458774['model'],_0x458774[_0xf793('0x2d')]);_0xeeacd9[_0xf793('0x30')]=_['intersection'](_0x458774[_0xf793('0x3f')],qs[_0xf793('0x32')](_0x36a031[_0xf793('0x2d')]['fields']));_0xeeacd9['attributes']=_0xeeacd9[_0xf793('0x30')][_0xf793('0x40')]?_0xeeacd9[_0xf793('0x30')]:_0x458774[_0xf793('0x3f')];_0xeeacd9['order']=qs[_0xf793('0x34')](_0x36a031['query'][_0xf793('0x34')]);_0xeeacd9[_0xf793('0x35')]=qs[_0xf793('0x2f')](_[_0xf793('0x36')](_0x36a031[_0xf793('0x2d')],_0x458774['filters']));if(_0x36a031[_0xf793('0x2d')]['filter']){_0xeeacd9['where']=_['merge'](_0xeeacd9[_0xf793('0x35')],{'$or':_[_0xf793('0x2c')](_0xeeacd9[_0xf793('0x30')],function(_0x1c7f76){var _0x50772c={};_0x50772c[_0x1c7f76]={'$like':'%'+_0x36a031[_0xf793('0x2d')][_0xf793('0x37')]+'%'};return _0x50772c;})});}_0xeeacd9=_[_0xf793('0x38')]({},_0xeeacd9,_0x36a031[_0xf793('0x3a')]);return _0x54de26[_0xf793('0x4f')](_0xeeacd9);}})[_0xf793('0x22')](function(_0x1266ed){if(_0x1266ed){_0x2c42f8=_0x1266ed[_0xf793('0x40')];if(!_0x36a031['query']['hasOwnProperty'](_0xf793('0x33'))){_0xeeacd9[_0xf793('0x1b')]=qs['limit'](_0x36a031[_0xf793('0x2d')][_0xf793('0x1b')]);_0xeeacd9[_0xf793('0x19')]=qs[_0xf793('0x19')](_0x36a031[_0xf793('0x2d')][_0xf793('0x19')]);}return _0x54de26[_0xf793('0x4f')](_0xeeacd9);}})['then'](function(_0x1bc456){if(_0x1bc456){return _0x1bc456?{'count':_0x2c42f8,'rows':_0x1bc456}:null;}})[_0xf793('0x22')](respondWithResult(_0x4c5734,null))[_0xf793('0x43')](handleError(_0x4c5734,null));};exports[_0xf793('0x52')]=function(_0x2e9eb0,_0x2ccc6c,_0x28487b){return db[_0xf793('0x27')][_0xf793('0x42')]({'where':{'id':_0x2e9eb0[_0xf793('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2ccc6c,null))['then'](function(_0x54def8){if(_0x54def8){return _0x54def8[_0xf793('0x52')](_0x2e9eb0['query']['ids']);}})[_0xf793('0x22')](respondWithStatusCode(_0x2ccc6c,null))[_0xf793('0x43')](handleError(_0x2ccc6c,null));};exports[_0xf793('0x53')]=function(_0x2adce5,_0x30bcc1,_0x342eae){if(_0x2adce5['body']['id']){delete _0x2adce5[_0xf793('0x45')]['id'];}return db[_0xf793('0x27')][_0xf793('0x42')]({'where':{'id':_0x2adce5[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x30bcc1,null))[_0xf793('0x22')](function(_0x2ce0b5){if(_0x2ce0b5){_0x2adce5[_0xf793('0x45')][_0xf793('0x54')]=_0x2ce0b5['id'];return db[_0xf793('0x49')][_0xf793('0x44')](_0x2adce5[_0xf793('0x45')]);}})['then'](respondWithResult(_0x30bcc1,null))[_0xf793('0x43')](handleError(_0x30bcc1,null));};exports[_0xf793('0x55')]=function(_0x43f3ad,_0x522715,_0x55e392){var _0x52fb76={};var _0x1ff0bf={};var _0x3022b1;var _0x3ba91e;return db['ChatGroup'][_0xf793('0x50')]({'where':{'id':_0x43f3ad[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x522715,null))['then'](function(_0xe40850){if(_0xe40850){_0x3022b1=_0xe40850;_0x1ff0bf[_0xf793('0x3f')]=_['keys'](db[_0xf793('0x49')][_0xf793('0x28')]);_0x1ff0bf['query']=_[_0xf793('0x2e')](_0x43f3ad[_0xf793('0x2d')]);_0x1ff0bf['filters']=_[_0xf793('0x31')](_0x1ff0bf[_0xf793('0x3f')],_0x1ff0bf[_0xf793('0x2d')]);_0x52fb76['attributes']=_[_0xf793('0x31')](_0x1ff0bf[_0xf793('0x3f')],qs[_0xf793('0x32')](_0x43f3ad[_0xf793('0x2d')][_0xf793('0x32')]));_0x52fb76[_0xf793('0x30')]=_0x52fb76['attributes'][_0xf793('0x40')]?_0x52fb76[_0xf793('0x30')]:_0x1ff0bf[_0xf793('0x3f')];_0x52fb76['order']=qs[_0xf793('0x34')](_0x43f3ad[_0xf793('0x2d')]['sort']);_0x52fb76[_0xf793('0x35')]=qs[_0xf793('0x2f')](_[_0xf793('0x36')](_0x43f3ad[_0xf793('0x2d')],_0x1ff0bf[_0xf793('0x2f')]));if(_0x43f3ad[_0xf793('0x2d')][_0xf793('0x37')]){_0x52fb76['where']=_[_0xf793('0x38')](_0x52fb76['where'],{'$or':_[_0xf793('0x2c')](_0x52fb76[_0xf793('0x30')],function(_0x111f8a){var _0x1b9193={};_0x1b9193[_0x111f8a]={'$like':'%'+_0x43f3ad[_0xf793('0x2d')]['filter']+'%'};return _0x1b9193;})});}if(_0x43f3ad[_0xf793('0x2d')][_0xf793('0x56')]){var _0x3d1608=_0x43f3ad[_0xf793('0x2d')][_0xf793('0x56')][_0xf793('0x57')](',');var _0x37a9da={};_0x37a9da[_0x3d1608[0x0]]={'$gte':moment(_0x3d1608[0x1])[_0xf793('0x58')]('YYYY-MM-DD\x20HH:mm:ss')};_0x52fb76[_0xf793('0x35')]=_[_0xf793('0x38')](_0x52fb76[_0xf793('0x35')],_0x37a9da);}_0x52fb76=_['merge']({},_0x52fb76,_0x43f3ad[_0xf793('0x3a')]);return _0x3022b1['getMessages'](_0x52fb76);}})[_0xf793('0x22')](function(_0x1cbc07){if(_0x1cbc07){_0x3ba91e=_0x1cbc07[_0xf793('0x40')];if(!_0x43f3ad[_0xf793('0x2d')]['hasOwnProperty']('nolimit')){_0x52fb76[_0xf793('0x1b')]=qs['limit'](_0x43f3ad[_0xf793('0x2d')][_0xf793('0x1b')]);_0x52fb76[_0xf793('0x19')]=qs[_0xf793('0x19')](_0x43f3ad[_0xf793('0x2d')][_0xf793('0x19')]);}return _0x3022b1[_0xf793('0x55')](_0x52fb76);}})[_0xf793('0x22')](function(_0x506d0b){if(_0x506d0b){return _0x506d0b?{'count':_0x3ba91e,'rows':_0x506d0b}:null;}})[_0xf793('0x22')](respondWithResult(_0x522715,null))['catch'](handleError(_0x522715,null));}; \ No newline at end of file +var _0x0ca0=['include','findAll','show','params','rawAttributes','options','find','create','body','destroy','describe','catch','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','ChatGroup','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ca0,0x142));var _0x00ca=function(_0x2c48f3,_0x58ec6c){_0x2c48f3=_0x2c48f3-0x0;var _0x234a62=_0x0ca0[_0x2c48f3];return _0x234a62;};'use strict';var emlformat=require(_0x00ca('0x0'));var rimraf=require(_0x00ca('0x1'));var zipdir=require(_0x00ca('0x2'));var jsonpatch=require(_0x00ca('0x3'));var rp=require(_0x00ca('0x4'));var moment=require(_0x00ca('0x5'));var BPromise=require(_0x00ca('0x6'));var Mustache=require('mustache');var util=require(_0x00ca('0x7'));var path=require(_0x00ca('0x8'));var sox=require(_0x00ca('0x9'));var csv=require(_0x00ca('0xa'));var ejs=require(_0x00ca('0xb'));var fs=require('fs');var fs_extra=require(_0x00ca('0xc'));var _=require(_0x00ca('0xd'));var squel=require('squel');var crypto=require(_0x00ca('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x00ca('0xf'));var toCsv=require(_0x00ca('0xa'));var querystring=require('querystring');var Papa=require(_0x00ca('0x10'));var Redis=require(_0x00ca('0x11'));var authService=require(_0x00ca('0x12'));var qs=require(_0x00ca('0x13'));var as=require(_0x00ca('0x14'));var hardwareService=require(_0x00ca('0x15'));var logger=require(_0x00ca('0x16'))(_0x00ca('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x00ca('0x18'));var db=require('../../mysqldb')['db'];config[_0x00ca('0x19')]=_[_0x00ca('0x1a')](config[_0x00ca('0x19')],{'host':_0x00ca('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x00ca('0x19')]));require(_0x00ca('0x1c'))[_0x00ca('0x1d')](socket);function respondWithStatusCode(_0x599f36,_0x2c2841){_0x2c2841=_0x2c2841||0xcc;return function(_0x498762){if(_0x498762){return _0x599f36[_0x00ca('0x1e')](_0x2c2841);}return _0x599f36[_0x00ca('0x1f')](_0x2c2841)[_0x00ca('0x20')]();};}function respondWithResult(_0x568e98,_0x314898){_0x314898=_0x314898||0xc8;return function(_0x4916d2){if(_0x4916d2){return _0x568e98[_0x00ca('0x1f')](_0x314898)[_0x00ca('0x21')](_0x4916d2);}};}function respondWithFilteredResult(_0x55c9cf,_0x7752c8){return function(_0x3849e5){if(_0x3849e5){var _0x1b61ae=typeof _0x7752c8[_0x00ca('0x22')]===_0x00ca('0x23')&&typeof _0x7752c8['limit']===_0x00ca('0x23');var _0x4cc0a9=_0x3849e5[_0x00ca('0x24')];var _0x44ce38=_0x1b61ae?0x0:_0x7752c8[_0x00ca('0x22')];var _0x52c013=_0x1b61ae?_0x3849e5[_0x00ca('0x24')]:_0x7752c8['offset']+_0x7752c8[_0x00ca('0x25')];var _0x10619b;if(_0x52c013>=_0x4cc0a9){_0x52c013=_0x4cc0a9;_0x10619b=0xc8;}else{_0x10619b=0xce;}_0x55c9cf[_0x00ca('0x1f')](_0x10619b);return _0x55c9cf['set'](_0x00ca('0x26'),_0x44ce38+'-'+_0x52c013+'/'+_0x4cc0a9)['json'](_0x3849e5);}return null;};}function patchUpdates(_0x4ae11f){return function(_0x197713){try{jsonpatch[_0x00ca('0x27')](_0x197713,_0x4ae11f,!![]);}catch(_0x1a6d08){return BPromise[_0x00ca('0x28')](_0x1a6d08);}return _0x197713['save']();};}function saveUpdates(_0x1111b5,_0x245176){return function(_0x33cea2){if(_0x33cea2){return _0x33cea2[_0x00ca('0x29')](_0x1111b5)['then'](function(_0x1c1188){return _0x1c1188;});}return null;};}function removeEntity(_0x51ec44,_0x32c023){return function(_0xd1939b){if(_0xd1939b){return _0xd1939b['destroy']()[_0x00ca('0x2a')](function(){_0x51ec44['status'](0xcc)[_0x00ca('0x20')]();});}};}function handleEntityNotFound(_0x20be1f,_0x3d89c1){return function(_0x4bb609){if(!_0x4bb609){_0x20be1f['sendStatus'](0x194);}return _0x4bb609;};}function handleError(_0x1d66d4,_0xe45610){_0xe45610=_0xe45610||0x1f4;return function(_0x187c61){logger[_0x00ca('0x2b')](_0x187c61[_0x00ca('0x2c')]);if(_0x187c61['name']){delete _0x187c61[_0x00ca('0x2d')];}_0x1d66d4['status'](_0xe45610)[_0x00ca('0x2e')](_0x187c61);};}exports[_0x00ca('0x2f')]=function(_0x4decf3,_0x518f0c){var _0x5391b1={},_0xf31194={},_0x33c461={'count':0x0,'rows':[]};var _0x102dec=_['map'](db['ChatGroup']['rawAttributes'],function(_0x226bac){return{'name':_0x226bac[_0x00ca('0x30')],'type':_0x226bac[_0x00ca('0x31')]['key']};});_0xf31194[_0x00ca('0x32')]=_[_0x00ca('0x33')](_0x102dec,_0x00ca('0x2d'));_0xf31194['query']=_[_0x00ca('0x34')](_0x4decf3[_0x00ca('0x35')]);_0xf31194[_0x00ca('0x36')]=_[_0x00ca('0x37')](_0xf31194[_0x00ca('0x32')],_0xf31194[_0x00ca('0x35')]);_0x5391b1['attributes']=_[_0x00ca('0x37')](_0xf31194[_0x00ca('0x32')],qs[_0x00ca('0x38')](_0x4decf3[_0x00ca('0x35')][_0x00ca('0x38')]));_0x5391b1[_0x00ca('0x39')]=_0x5391b1[_0x00ca('0x39')][_0x00ca('0x3a')]?_0x5391b1[_0x00ca('0x39')]:_0xf31194[_0x00ca('0x32')];if(!_0x4decf3[_0x00ca('0x35')][_0x00ca('0x3b')](_0x00ca('0x3c'))){_0x5391b1['limit']=qs[_0x00ca('0x25')](_0x4decf3[_0x00ca('0x35')][_0x00ca('0x25')]);_0x5391b1[_0x00ca('0x22')]=qs[_0x00ca('0x22')](_0x4decf3[_0x00ca('0x35')][_0x00ca('0x22')]);}_0x5391b1[_0x00ca('0x3d')]=qs[_0x00ca('0x3e')](_0x4decf3['query'][_0x00ca('0x3e')]);_0x5391b1[_0x00ca('0x3f')]=qs[_0x00ca('0x36')](_[_0x00ca('0x40')](_0x4decf3['query'],_0xf31194[_0x00ca('0x36')]),_0x102dec);if(_0x4decf3[_0x00ca('0x35')][_0x00ca('0x41')]){_0x5391b1[_0x00ca('0x3f')]=_['merge'](_0x5391b1['where'],{'$or':_['map'](_0x102dec,function(_0x45ff7e){if(_0x45ff7e[_0x00ca('0x31')]!==_0x00ca('0x42')){var _0xd7b2e2={};_0xd7b2e2[_0x45ff7e[_0x00ca('0x2d')]]={'$like':'%'+_0x4decf3[_0x00ca('0x35')][_0x00ca('0x41')]+'%'};return _0xd7b2e2;}})});}_0x5391b1=_[_0x00ca('0x43')]({},_0x5391b1,_0x4decf3['options']);var _0x5c090a={'where':_0x5391b1[_0x00ca('0x3f')]};return db[_0x00ca('0x44')][_0x00ca('0x24')](_0x5c090a)[_0x00ca('0x2a')](function(_0x7c901){_0x33c461[_0x00ca('0x24')]=_0x7c901;if(_0x4decf3[_0x00ca('0x35')][_0x00ca('0x45')]){_0x5391b1[_0x00ca('0x46')]=[{'all':!![]}];}return db[_0x00ca('0x44')][_0x00ca('0x47')](_0x5391b1);})[_0x00ca('0x2a')](function(_0x1193b4){_0x33c461['rows']=_0x1193b4;return _0x33c461;})[_0x00ca('0x2a')](respondWithFilteredResult(_0x518f0c,_0x5391b1))['catch'](handleError(_0x518f0c,null));};exports[_0x00ca('0x48')]=function(_0x360315,_0x5d58b5){var _0x37a040={'raw':!![],'where':{'id':_0x360315[_0x00ca('0x49')]['id']}},_0x47ca7c={};_0x47ca7c[_0x00ca('0x32')]=_[_0x00ca('0x34')](db['ChatGroup'][_0x00ca('0x4a')]);_0x47ca7c[_0x00ca('0x35')]=_[_0x00ca('0x34')](_0x360315[_0x00ca('0x35')]);_0x47ca7c[_0x00ca('0x36')]=_[_0x00ca('0x37')](_0x47ca7c['model'],_0x47ca7c[_0x00ca('0x35')]);_0x37a040['attributes']=_['intersection'](_0x47ca7c[_0x00ca('0x32')],qs[_0x00ca('0x38')](_0x360315[_0x00ca('0x35')][_0x00ca('0x38')]));_0x37a040[_0x00ca('0x39')]=_0x37a040[_0x00ca('0x39')][_0x00ca('0x3a')]?_0x37a040[_0x00ca('0x39')]:_0x47ca7c[_0x00ca('0x32')];if(_0x360315[_0x00ca('0x35')]['includeAll']){_0x37a040['include']=[{'all':!![]}];}_0x37a040=_[_0x00ca('0x43')]({},_0x37a040,_0x360315[_0x00ca('0x4b')]);return db['ChatGroup'][_0x00ca('0x4c')](_0x37a040)[_0x00ca('0x2a')](handleEntityNotFound(_0x5d58b5,null))[_0x00ca('0x2a')](respondWithResult(_0x5d58b5,null))['catch'](handleError(_0x5d58b5,null));};exports[_0x00ca('0x4d')]=function(_0xabe623,_0x1d5af1){return db[_0x00ca('0x44')][_0x00ca('0x4d')](_0xabe623[_0x00ca('0x4e')],{})[_0x00ca('0x2a')](respondWithResult(_0x1d5af1,0xc9))['catch'](handleError(_0x1d5af1,null));};exports[_0x00ca('0x29')]=function(_0x327423,_0x276d98){if(_0x327423[_0x00ca('0x4e')]['id']){delete _0x327423['body']['id'];}return db[_0x00ca('0x44')]['find']({'where':{'id':_0x327423[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x276d98,null))[_0x00ca('0x2a')](saveUpdates(_0x327423['body'],null))[_0x00ca('0x2a')](respondWithResult(_0x276d98,null))['catch'](handleError(_0x276d98,null));};exports[_0x00ca('0x4f')]=function(_0x2f221a,_0x144949){return db[_0x00ca('0x44')][_0x00ca('0x4c')]({'where':{'id':_0x2f221a[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x144949,null))[_0x00ca('0x2a')](removeEntity(_0x144949,null))['catch'](handleError(_0x144949,null));};exports[_0x00ca('0x50')]=function(_0x5252e5,_0x3f82c3){return db[_0x00ca('0x44')][_0x00ca('0x50')]()[_0x00ca('0x2a')](respondWithResult(_0x3f82c3,null))[_0x00ca('0x51')](handleError(_0x3f82c3,null));};exports[_0x00ca('0x52')]=function(_0x3ebb0c,_0x362b8c,_0x3c15d3){return db[_0x00ca('0x53')][_0x00ca('0x24')]({'where':{'ChatGroupId':_0x3ebb0c[_0x00ca('0x49')]['id'],'ToId':_0x3ebb0c[_0x00ca('0x54')]['id'],'read':![]}})['then'](function(_0x2c0095){return{'id':_[_0x00ca('0x55')](_0x3ebb0c[_0x00ca('0x49')]['id']),'count':_0x2c0095};})[_0x00ca('0x2a')](respondWithResult(_0x362b8c,null))[_0x00ca('0x51')](handleError(_0x362b8c,null));};exports[_0x00ca('0x56')]=function(_0x54f5fe,_0x6071dc,_0x34ab37){return db[_0x00ca('0x44')][_0x00ca('0x4c')]({'where':{'id':_0x54f5fe['params']['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x6071dc,null))[_0x00ca('0x2a')](function(_0x19aa69){if(_0x19aa69){return _0x19aa69['addMembers'](_0x54f5fe['body'][_0x00ca('0x57')],_[_0x00ca('0x58')](_0x54f5fe[_0x00ca('0x4e')],[_0x00ca('0x57'),'id'])||{});}})[_0x00ca('0x2a')](respondWithResult(_0x6071dc,null))[_0x00ca('0x51')](handleError(_0x6071dc,null));};exports[_0x00ca('0x59')]=function(_0x4e190f,_0x2bb36a,_0x585e0a){var _0x36302d={};var _0x643c24={};var _0x4f58c1;var _0x24e054;return db[_0x00ca('0x44')]['findOne']({'where':{'id':_0x4e190f[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x2bb36a,null))[_0x00ca('0x2a')](function(_0x238038){if(_0x238038){_0x4f58c1=_0x238038;_0x643c24[_0x00ca('0x32')]=_['keys'](db['User'][_0x00ca('0x4a')]);_0x643c24[_0x00ca('0x35')]=_['keys'](_0x4e190f[_0x00ca('0x35')]);_0x643c24[_0x00ca('0x36')]=_['intersection'](_0x643c24[_0x00ca('0x32')],_0x643c24[_0x00ca('0x35')]);_0x36302d[_0x00ca('0x39')]=_['intersection'](_0x643c24[_0x00ca('0x32')],qs[_0x00ca('0x38')](_0x4e190f[_0x00ca('0x35')][_0x00ca('0x38')]));_0x36302d[_0x00ca('0x39')]=_0x36302d['attributes']['length']?_0x36302d[_0x00ca('0x39')]:_0x643c24[_0x00ca('0x32')];_0x36302d[_0x00ca('0x3d')]=qs[_0x00ca('0x3e')](_0x4e190f[_0x00ca('0x35')][_0x00ca('0x3e')]);_0x36302d[_0x00ca('0x3f')]=qs[_0x00ca('0x36')](_[_0x00ca('0x40')](_0x4e190f[_0x00ca('0x35')],_0x643c24[_0x00ca('0x36')]));if(_0x4e190f[_0x00ca('0x35')][_0x00ca('0x41')]){_0x36302d['where']=_[_0x00ca('0x43')](_0x36302d[_0x00ca('0x3f')],{'$or':_['map'](_0x36302d[_0x00ca('0x39')],function(_0x305d7b){var _0x306ce8={};_0x306ce8[_0x305d7b]={'$like':'%'+_0x4e190f[_0x00ca('0x35')][_0x00ca('0x41')]+'%'};return _0x306ce8;})});}_0x36302d=_[_0x00ca('0x43')]({},_0x36302d,_0x4e190f[_0x00ca('0x4b')]);return _0x4f58c1[_0x00ca('0x59')](_0x36302d);}})['then'](function(_0x413e3f){if(_0x413e3f){_0x24e054=_0x413e3f['length'];if(!_0x4e190f[_0x00ca('0x35')][_0x00ca('0x3b')](_0x00ca('0x3c'))){_0x36302d['limit']=qs[_0x00ca('0x25')](_0x4e190f[_0x00ca('0x35')][_0x00ca('0x25')]);_0x36302d[_0x00ca('0x22')]=qs[_0x00ca('0x22')](_0x4e190f[_0x00ca('0x35')][_0x00ca('0x22')]);}return _0x4f58c1['getMembers'](_0x36302d);}})[_0x00ca('0x2a')](function(_0x1008f2){if(_0x1008f2){return _0x1008f2?{'count':_0x24e054,'rows':_0x1008f2}:null;}})[_0x00ca('0x2a')](respondWithResult(_0x2bb36a,null))[_0x00ca('0x51')](handleError(_0x2bb36a,null));};exports['removeMembers']=function(_0x297d5e,_0x114e38,_0x41b315){return db[_0x00ca('0x44')]['find']({'where':{'id':_0x297d5e[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x114e38,null))['then'](function(_0x22b3b3){if(_0x22b3b3){return _0x22b3b3[_0x00ca('0x5a')](_0x297d5e[_0x00ca('0x35')][_0x00ca('0x57')]);}})['then'](respondWithStatusCode(_0x114e38,null))[_0x00ca('0x51')](handleError(_0x114e38,null));};exports[_0x00ca('0x5b')]=function(_0x356544,_0x353a66,_0x41441a){if(_0x356544[_0x00ca('0x4e')]['id']){delete _0x356544['body']['id'];}return db[_0x00ca('0x44')]['find']({'where':{'id':_0x356544[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x353a66,null))['then'](function(_0x43e895){if(_0x43e895){_0x356544['body'][_0x00ca('0x5c')]=_0x43e895['id'];return db[_0x00ca('0x53')]['create'](_0x356544['body']);}})[_0x00ca('0x2a')](respondWithResult(_0x353a66,null))[_0x00ca('0x51')](handleError(_0x353a66,null));};exports[_0x00ca('0x5d')]=function(_0x4e3018,_0x47c260,_0x168648){var _0xe3b893={};var _0x37340a={};var _0x4c4397;var _0x4c4a94;return db[_0x00ca('0x44')][_0x00ca('0x5e')]({'where':{'id':_0x4e3018[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x47c260,null))[_0x00ca('0x2a')](function(_0x3ce5d7){if(_0x3ce5d7){_0x4c4397=_0x3ce5d7;_0x37340a[_0x00ca('0x32')]=_['keys'](db['ChatInternalMessage'][_0x00ca('0x4a')]);_0x37340a['query']=_[_0x00ca('0x34')](_0x4e3018['query']);_0x37340a['filters']=_[_0x00ca('0x37')](_0x37340a[_0x00ca('0x32')],_0x37340a[_0x00ca('0x35')]);_0xe3b893[_0x00ca('0x39')]=_['intersection'](_0x37340a['model'],qs[_0x00ca('0x38')](_0x4e3018[_0x00ca('0x35')][_0x00ca('0x38')]));_0xe3b893[_0x00ca('0x39')]=_0xe3b893[_0x00ca('0x39')][_0x00ca('0x3a')]?_0xe3b893[_0x00ca('0x39')]:_0x37340a[_0x00ca('0x32')];_0xe3b893[_0x00ca('0x3d')]=qs['sort'](_0x4e3018[_0x00ca('0x35')][_0x00ca('0x3e')]);_0xe3b893[_0x00ca('0x3f')]=qs[_0x00ca('0x36')](_[_0x00ca('0x40')](_0x4e3018[_0x00ca('0x35')],_0x37340a[_0x00ca('0x36')]));if(_0x4e3018[_0x00ca('0x35')]['filter']){_0xe3b893[_0x00ca('0x3f')]=_['merge'](_0xe3b893[_0x00ca('0x3f')],{'$or':_[_0x00ca('0x33')](_0xe3b893[_0x00ca('0x39')],function(_0x44c401){var _0x191fe3={};_0x191fe3[_0x44c401]={'$like':'%'+_0x4e3018['query']['filter']+'%'};return _0x191fe3;})});}if(_0x4e3018['query'][_0x00ca('0x5f')]){var _0xa169f6=_0x4e3018[_0x00ca('0x35')][_0x00ca('0x5f')]['split'](',');var _0x534df9={};_0x534df9[_0xa169f6[0x0]]={'$gte':moment(_0xa169f6[0x1])[_0x00ca('0x60')](_0x00ca('0x61'))};_0xe3b893[_0x00ca('0x3f')]=_[_0x00ca('0x43')](_0xe3b893[_0x00ca('0x3f')],_0x534df9);}_0xe3b893=_[_0x00ca('0x43')]({},_0xe3b893,_0x4e3018[_0x00ca('0x4b')]);return _0x4c4397[_0x00ca('0x5d')](_0xe3b893);}})[_0x00ca('0x2a')](function(_0xcebd8){if(_0xcebd8){_0x4c4a94=_0xcebd8[_0x00ca('0x3a')];if(!_0x4e3018[_0x00ca('0x35')][_0x00ca('0x3b')](_0x00ca('0x3c'))){_0xe3b893[_0x00ca('0x25')]=qs[_0x00ca('0x25')](_0x4e3018['query']['limit']);_0xe3b893[_0x00ca('0x22')]=qs['offset'](_0x4e3018[_0x00ca('0x35')][_0x00ca('0x22')]);}return _0x4c4397[_0x00ca('0x5d')](_0xe3b893);}})[_0x00ca('0x2a')](function(_0x175caf){if(_0x175caf){return _0x175caf?{'count':_0x4c4a94,'rows':_0x175caf}:null;}})['then'](respondWithResult(_0x47c260,null))['catch'](handleError(_0x47c260,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 5f8204e..803190b 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 _0x6e12=['ChatGroup','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x2d3c60,_0x4df458){var _0x560041=function(_0x5568af){while(--_0x5568af){_0x2d3c60['push'](_0x2d3c60['shift']());}};_0x560041(++_0x4df458);}(_0x6e12,0x1d4));var _0x26e1=function(_0x13a14b,_0x52d0e0){_0x13a14b=_0x13a14b-0x0;var _0x6c505b=_0x6e12[_0x13a14b];return _0x6c505b;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x26e1('0x0'))['db'][_0x26e1('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x26e1('0x2'),'afterUpdate':_0x26e1('0x3'),'afterDestroy':_0x26e1('0x4')};function emitEvent(_0x2d8a27){return function(_0x2dba5a,_0x4aca8e,_0x5c985b){ChatGroupEvents[_0x26e1('0x5')](_0x2d8a27+':'+_0x2dba5a['id'],_0x2dba5a);ChatGroupEvents[_0x26e1('0x5')](_0x2d8a27,_0x2dba5a);_0x5c985b(null);};}for(var e in events){if(events[_0x26e1('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x7750=['hook','events','ChatGroup','setMaxListeners','emit'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x7750,0x182));var _0x0775=function(_0x248ab0,_0x5a7934){_0x248ab0=_0x248ab0-0x0;var _0x54f4ee=_0x7750[_0x248ab0];return _0x54f4ee;};'use strict';var EventEmitter=require(_0x0775('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x0775('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0775('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x255bdc){return function(_0x26b370,_0x114bbd,_0x3a2f34){ChatGroupEvents[_0x0775('0x3')](_0x255bdc+':'+_0x26b370['id'],_0x26b370);ChatGroupEvents[_0x0775('0x3')](_0x255bdc,_0x26b370);_0x3a2f34(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x0775('0x4')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 3b6fb55..b53b939 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 _0xb684=['api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','../../config/logger'];(function(_0x35588f,_0x43053e){var _0x5656e7=function(_0x473e4c){while(--_0x473e4c){_0x35588f['push'](_0x35588f['shift']());}};_0x5656e7(++_0x43053e);}(_0xb684,0x83));var _0x4b68=function(_0x553378,_0x1c2756){_0x553378=_0x553378-0x0;var _0x44caca=_0xb684[_0x553378];return _0x44caca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4b68('0x0'))(_0x4b68('0x1'));var moment=require(_0x4b68('0x2'));var BPromise=require(_0x4b68('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b68('0x4'));var rimraf=require(_0x4b68('0x5'));var config=require(_0x4b68('0x6'));var attributes=require(_0x4b68('0x7'));module[_0x4b68('0x8')]=function(_0x4d58b9,_0x1261d6){return _0x4d58b9['define'](_0x4b68('0x9'),attributes,{'tableName':_0x4b68('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d22=['bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','util','../../config/logger','api','moment'];(function(_0x216e58,_0x497adc){var _0x5adcad=function(_0x22197f){while(--_0x22197f){_0x216e58['push'](_0x216e58['shift']());}};_0x5adcad(++_0x497adc);}(_0x0d22,0xe6));var _0x20d2=function(_0x38aeea,_0x57522a){_0x38aeea=_0x38aeea-0x0;var _0x5e8d2c=_0x0d22[_0x38aeea];return _0x5e8d2c;};'use strict';var _=require('lodash');var util=require(_0x20d2('0x0'));var logger=require(_0x20d2('0x1'))(_0x20d2('0x2'));var moment=require(_0x20d2('0x3'));var BPromise=require(_0x20d2('0x4'));var rp=require(_0x20d2('0x5'));var fs=require('fs');var path=require(_0x20d2('0x6'));var rimraf=require(_0x20d2('0x7'));var config=require(_0x20d2('0x8'));var attributes=require(_0x20d2('0x9'));module[_0x20d2('0xa')]=function(_0x4ea7d3,_0x431c77){return _0x4ea7d3[_0x20d2('0xb')](_0x20d2('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 52f4a07..14998c5 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 _0xb56f=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xd76732,_0x5f4e32){var _0x342534=function(_0x10c3cb){while(--_0x10c3cb){_0xd76732['push'](_0xd76732['shift']());}};_0x342534(++_0x5f4e32);}(_0xb56f,0x113));var _0xfb56=function(_0x4aec74,_0xbecf13){_0x4aec74=_0x4aec74-0x0;var _0x19cf6d=_0xb56f[_0x4aec74];return _0x19cf6d;};'use strict';var _=require(_0xfb56('0x0'));var util=require(_0xfb56('0x1'));var moment=require(_0xfb56('0x2'));var BPromise=require('bluebird');var rs=require(_0xfb56('0x3'));var fs=require('fs');var Redis=require(_0xfb56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb56('0x5'));var logger=require(_0xfb56('0x6'))('rpc');var config=require(_0xfb56('0x7'));var jayson=require(_0xfb56('0x8'));var client=jayson[_0xfb56('0x9')][_0xfb56('0xa')]({'port':0x232a});config[_0xfb56('0xb')]=_[_0xfb56('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfb56('0xd'))(new Redis(config[_0xfb56('0xb')]));require(_0xfb56('0xe'))[_0xfb56('0xf')](socket);function respondWithRpcPromise(_0x311b0e,_0x3a168f,_0x134442){return new BPromise(function(_0x5e49b3,_0x5db511){return client['request'](_0x311b0e,_0x134442)[_0xfb56('0x10')](function(_0x537d40){logger[_0xfb56('0x11')](_0xfb56('0x12'),_0x3a168f,_0xfb56('0x13'));logger[_0xfb56('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3a168f,_0xfb56('0x13'),JSON[_0xfb56('0x15')](_0x537d40));if(_0x537d40[_0xfb56('0x16')]){if(_0x537d40['error'][_0xfb56('0x17')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x3a168f,_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);return _0x5db511(_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);}logger[_0xfb56('0x16')](_0xfb56('0x12'),_0x3a168f,_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);return _0x5e49b3(_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);}else{logger[_0xfb56('0x11')](_0xfb56('0x12'),_0x3a168f,_0xfb56('0x13'));_0x5e49b3(_0x537d40[_0xfb56('0x19')][_0xfb56('0x18')]);}})[_0xfb56('0x1a')](function(_0x586436){logger['error'](_0xfb56('0x12'),_0x3a168f,_0x586436);_0x5db511(_0x586436);});});} \ No newline at end of file +var _0x4784=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5e7bbc,_0x413a95){var _0x3d6abc=function(_0x10d177){while(--_0x10d177){_0x5e7bbc['push'](_0x5e7bbc['shift']());}};_0x3d6abc(++_0x413a95);}(_0x4784,0xe4));var _0x4478=function(_0x2c072b,_0x6c4449){_0x2c072b=_0x2c072b-0x0;var _0x167ee3=_0x4784[_0x2c072b];return _0x167ee3;};'use strict';var _=require(_0x4478('0x0'));var util=require(_0x4478('0x1'));var moment=require(_0x4478('0x2'));var BPromise=require(_0x4478('0x3'));var rs=require(_0x4478('0x4'));var fs=require('fs');var Redis=require(_0x4478('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4478('0x6'));var logger=require(_0x4478('0x7'))(_0x4478('0x8'));var config=require('../../config/environment');var jayson=require(_0x4478('0x9'));var client=jayson['client'][_0x4478('0xa')]({'port':0x232a});config['redis']=_[_0x4478('0xb')](config[_0x4478('0xc')],{'host':_0x4478('0xd'),'port':0x18eb});var socket=require(_0x4478('0xe'))(new Redis(config[_0x4478('0xc')]));require('./chatGroup.socket')[_0x4478('0xf')](socket);function respondWithRpcPromise(_0x2747ad,_0x2bca2c,_0x3cf977){return new BPromise(function(_0xcc937d,_0x2d95ef){return client[_0x4478('0x10')](_0x2747ad,_0x3cf977)['then'](function(_0x21e831){logger[_0x4478('0x11')](_0x4478('0x12'),_0x2bca2c,_0x4478('0x13'));logger[_0x4478('0x14')](_0x4478('0x15'),_0x2bca2c,'request\x20sent',JSON[_0x4478('0x16')](_0x21e831));if(_0x21e831[_0x4478('0x17')]){if(_0x21e831[_0x4478('0x17')][_0x4478('0x18')]===0x1f4){logger[_0x4478('0x17')]('ChatGroup,\x20%s,\x20%s',_0x2bca2c,_0x21e831['error'][_0x4478('0x19')]);return _0x2d95ef(_0x21e831[_0x4478('0x17')][_0x4478('0x19')]);}logger[_0x4478('0x17')](_0x4478('0x12'),_0x2bca2c,_0x21e831[_0x4478('0x17')][_0x4478('0x19')]);return _0xcc937d(_0x21e831['error'][_0x4478('0x19')]);}else{logger[_0x4478('0x11')](_0x4478('0x12'),_0x2bca2c,_0x4478('0x13'));_0xcc937d(_0x21e831[_0x4478('0x1a')]['message']);}})[_0x4478('0x1b')](function(_0x12b731){logger['error'](_0x4478('0x12'),_0x2bca2c,_0x12b731);_0x2d95ef(_0x12b731);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 56bf1ac..c914cb2 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 _0x9f74=['register','length','chatGroup:','./chatGroup.events','save','remove','emit','removeListener'];(function(_0x5e34a4,_0x2e63ed){var _0x8d41d7=function(_0x45c61b){while(--_0x45c61b){_0x5e34a4['push'](_0x5e34a4['shift']());}};_0x8d41d7(++_0x2e63ed);}(_0x9f74,0x163));var _0x49f7=function(_0xa3ec8e,_0x35f872){_0xa3ec8e=_0xa3ec8e-0x0;var _0x388a9c=_0x9f74[_0xa3ec8e];return _0x388a9c;};'use strict';var ChatGroupEvents=require(_0x49f7('0x0'));var events=[_0x49f7('0x1'),_0x49f7('0x2'),'update'];function createListener(_0x3baaa0,_0x4f94d0){return function(_0x947981){_0x4f94d0[_0x49f7('0x3')](_0x3baaa0,_0x947981);};}function removeListener(_0x4f3a07,_0xb6f3d0){return function(){ChatGroupEvents[_0x49f7('0x4')](_0x4f3a07,_0xb6f3d0);};}exports[_0x49f7('0x5')]=function(_0x2b9c50){for(var _0x2f59de=0x0,_0xb97a18=events[_0x49f7('0x6')];_0x2f59de<_0xb97a18;_0x2f59de++){var _0x2e627d=events[_0x2f59de];var _0x592dbd=createListener(_0x49f7('0x7')+_0x2e627d,_0x2b9c50);ChatGroupEvents['on'](_0x2e627d,_0x592dbd);}}; \ No newline at end of file +var _0xd578=['register','./chatGroup.events','remove','update'];(function(_0x2e8cbd,_0x3015b6){var _0x18107c=function(_0x51150c){while(--_0x51150c){_0x2e8cbd['push'](_0x2e8cbd['shift']());}};_0x18107c(++_0x3015b6);}(_0xd578,0x18d));var _0x8d57=function(_0x56fae,_0x2d1fe0){_0x56fae=_0x56fae-0x0;var _0x1eeed7=_0xd578[_0x56fae];return _0x1eeed7;};'use strict';var ChatGroupEvents=require(_0x8d57('0x0'));var events=['save',_0x8d57('0x1'),_0x8d57('0x2')];function createListener(_0xa581c1,_0x4850c0){return function(_0x5173e2){_0x4850c0['emit'](_0xa581c1,_0x5173e2);};}function removeListener(_0x54c6e6,_0x21f998){return function(){ChatGroupEvents['removeListener'](_0x54c6e6,_0x21f998);};}exports[_0x8d57('0x3')]=function(_0x5e5fc0){for(var _0x2d781c=0x0,_0x1443ee=events['length'];_0x2d781c<_0x1443ee;_0x2d781c++){var _0x24a4c4=events[_0x2d781c];var _0x1c068a=createListener('chatGroup:'+_0x24a4c4,_0x5e5fc0);ChatGroupEvents['on'](_0x24a4c4,_0x1c068a);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 96f4f7a..c28c62b 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 _0xe02a=['get','isAuthenticated','index','/describe','describe','show','/:id/unread','/:id/members','getMembers','getMessages','create','addMembers','post','addMessage','put','/:id','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0x308351,_0x184653){var _0x2def07=function(_0x2a30a4){while(--_0x2a30a4){_0x308351['push'](_0x308351['shift']());}};_0x2def07(++_0x184653);}(_0xe02a,0x1dd));var _0xae02=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe02a[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xae02('0x0'));var util=require(_0xae02('0x1'));var path=require(_0xae02('0x2'));var timeout=require('connect-timeout');var express=require(_0xae02('0x3'));var router=express[_0xae02('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xae02('0x5'));var interaction=require(_0xae02('0x6'));var config=require(_0xae02('0x7'));var controller=require(_0xae02('0x8'));router[_0xae02('0x9')]('/',auth[_0xae02('0xa')](),controller[_0xae02('0xb')]);router[_0xae02('0x9')](_0xae02('0xc'),auth['isAuthenticated'](),controller[_0xae02('0xd')]);router[_0xae02('0x9')]('/:id',auth[_0xae02('0xa')](),controller[_0xae02('0xe')]);router[_0xae02('0x9')](_0xae02('0xf'),auth['isAuthenticated'](),controller['getUnread']);router[_0xae02('0x9')](_0xae02('0x10'),auth[_0xae02('0xa')](),controller[_0xae02('0x11')]);router[_0xae02('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0xae02('0x12')]);router['post']('/',auth[_0xae02('0xa')](),controller[_0xae02('0x13')]);router['post'](_0xae02('0x10'),auth['isAuthenticated'](),controller[_0xae02('0x14')]);router[_0xae02('0x15')]('/:id/messages',auth[_0xae02('0xa')](),controller[_0xae02('0x16')]);router[_0xae02('0x17')](_0xae02('0x18'),auth[_0xae02('0xa')](),controller['update']);router[_0xae02('0x19')](_0xae02('0x18'),auth[_0xae02('0xa')](),controller[_0xae02('0x1a')]);router[_0xae02('0x19')](_0xae02('0x10'),auth[_0xae02('0xa')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file +var _0xb059=['destroy','removeMembers','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe','/:id','isAuthenticated','show','getUnread','getMembers','/:id/messages','getMessages','create','post','/:id/members','addMembers','delete'];(function(_0xa34bda,_0x34f584){var _0x37c970=function(_0xa3eca2){while(--_0xa3eca2){_0xa34bda['push'](_0xa34bda['shift']());}};_0x37c970(++_0x34f584);}(_0xb059,0x12b));var _0x9b05=function(_0x16152d,_0x5a5b49){_0x16152d=_0x16152d-0x0;var _0x1768d8=_0xb059[_0x16152d];return _0x1768d8;};'use strict';var multer=require(_0x9b05('0x0'));var util=require(_0x9b05('0x1'));var path=require(_0x9b05('0x2'));var timeout=require(_0x9b05('0x3'));var express=require(_0x9b05('0x4'));var router=express[_0x9b05('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9b05('0x6'));var interaction=require(_0x9b05('0x7'));var config=require(_0x9b05('0x8'));var controller=require(_0x9b05('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x9b05('0xa')]);router[_0x9b05('0xb')](_0x9b05('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x9b05('0xd'),auth[_0x9b05('0xe')](),controller[_0x9b05('0xf')]);router['get']('/:id/unread',auth['isAuthenticated'](),controller[_0x9b05('0x10')]);router[_0x9b05('0xb')]('/:id/members',auth[_0x9b05('0xe')](),controller[_0x9b05('0x11')]);router[_0x9b05('0xb')](_0x9b05('0x12'),auth['isAuthenticated'](),controller[_0x9b05('0x13')]);router['post']('/',auth[_0x9b05('0xe')](),controller[_0x9b05('0x14')]);router[_0x9b05('0x15')](_0x9b05('0x16'),auth[_0x9b05('0xe')](),controller[_0x9b05('0x17')]);router[_0x9b05('0x15')](_0x9b05('0x12'),auth[_0x9b05('0xe')](),controller['addMessage']);router['put'](_0x9b05('0xd'),auth[_0x9b05('0xe')](),controller['update']);router[_0x9b05('0x18')](_0x9b05('0xd'),auth[_0x9b05('0xe')](),controller[_0x9b05('0x19')]);router[_0x9b05('0x18')](_0x9b05('0x16'),auth[_0x9b05('0xe')](),controller[_0x9b05('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 4d8e48f..08a1f24 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 _0x80f6=['TEXT','DATE','STRING','long','out','BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x80f6,0x66));var _0x680f=function(_0x1f1a8e,_0x5f09d0){_0x1f1a8e=_0x1f1a8e-0x0;var _0x5b28a0=_0x80f6[_0x1f1a8e];return _0x5b28a0;};'use strict';var Sequelize=require(_0x680f('0x0'));module[_0x680f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x680f('0x2')]},'ratingType':{'type':Sequelize[_0x680f('0x3')](_0x680f('0x4'),_0x680f('0x5')),'defaultValue':_0x680f('0x4')},'ratingMessage':{'type':Sequelize[_0x680f('0x6')]},'pathTranscript':{'type':Sequelize[_0x680f('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x680f('0x7')]},'disposition':{'type':Sequelize[_0x680f('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x680f('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x680f('0x8')]},'browserVersion':{'type':Sequelize[_0x680f('0x8')]},'osName':{'type':Sequelize[_0x680f('0x8')]},'osVersion':{'type':Sequelize[_0x680f('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x680f('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x680f('0x6')]},'customerIp':{'type':Sequelize[_0x680f('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x680f('0x9'))},'read1stAt':{'type':Sequelize[_0x680f('0x7')]},'lastMsgAt':{'type':Sequelize[_0x680f('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x680f('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x680f('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x680f('0xb')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x680f('0x2')]}}; \ No newline at end of file +var _0x3613=['DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','long'];(function(_0x495291,_0x3ba520){var _0x13a724=function(_0x7dcdd1){while(--_0x7dcdd1){_0x495291['push'](_0x495291['shift']());}};_0x13a724(++_0x3ba520);}(_0x3613,0x6e));var _0x3361=function(_0x9ddaa0,_0x1d3878){_0x9ddaa0=_0x9ddaa0-0x0;var _0x14dce9=_0x3613[_0x9ddaa0];return _0x14dce9;};'use strict';var Sequelize=require(_0x3361('0x0'));module[_0x3361('0x1')]={'closed':{'type':Sequelize[_0x3361('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3361('0x3')]},'ratingType':{'type':Sequelize[_0x3361('0x4')](_0x3361('0x5'),_0x3361('0x6')),'defaultValue':_0x3361('0x5')},'ratingMessage':{'type':Sequelize[_0x3361('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x3361('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3361('0x8')]},'secondDisposition':{'type':Sequelize[_0x3361('0x8')]},'thirdDisposition':{'type':Sequelize[_0x3361('0x8')]},'note':{'type':Sequelize[_0x3361('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x3361('0x8')]},'osName':{'type':Sequelize[_0x3361('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x3361('0x7')]},'customerIp':{'type':Sequelize[_0x3361('0x8')]},'formData':{'type':Sequelize[_0x3361('0x7')](_0x3361('0x9'))},'read1stAt':{'type':Sequelize[_0x3361('0xa')]},'lastMsgAt':{'type':Sequelize[_0x3361('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x3361('0x4')]('in',_0x3361('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3361('0x8')]},'customerPort':{'type':Sequelize[_0x3361('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x3361('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x3361('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index b8cc09c..0a248d5 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 _0x1fc4=['sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','nolimit','order','sort','filters','pick','ChatInteractionId','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','getMyMessages','hasOwnProperty','includeAgent','push','rows','addTags','setTags','omit','spread','Tag','color','chatInteractionTags:save','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','lastName','attachments','direction','read','Account','Owner','get','mkdirSync','Chat','N.A.','toString','closedAt','referer','customerIp','customerPort','tail','createReadStream','pipe','out','firstName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','mustache','util','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','name','send','render','merge','body','contact','agent','account','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','params','model','keys','ChatInteraction','intersection','attributes','fields','length','includeAll','options','find','create','update','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','CmContact','ContactId','agentAlias','customer','Visitor','agentIdentifier','website_alias','%s%d','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail'];(function(_0x19d828,_0x2439ce){var _0x25b133=function(_0x5214a8){while(--_0x5214a8){_0x19d828['push'](_0x19d828['shift']());}};_0x25b133(++_0x2439ce);}(_0x1fc4,0x1ed));var _0x41fc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1fc4[_0x501510];return _0x1e6ee5;};'use strict';var rimraf=require(_0x41fc('0x0'));var zipdir=require('zip-dir');var rp=require(_0x41fc('0x1'));var moment=require(_0x41fc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x41fc('0x3'));var util=require(_0x41fc('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x41fc('0x5'));var qs=require(_0x41fc('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x41fc('0x7'))(_0x41fc('0x8'));var config=require(_0x41fc('0x9'));var db=require(_0x41fc('0xa'))['db'];config[_0x41fc('0xb')]=_[_0x41fc('0xc')](config['redis'],{'host':_0x41fc('0xd'),'port':0x18eb});var socket=require(_0x41fc('0xe'))(new Redis(config[_0x41fc('0xb')]));require('./chatInteraction.socket')[_0x41fc('0xf')](socket);var jayson=require(_0x41fc('0x10'));var client=jayson[_0x41fc('0x11')]['http']({'port':0x232b});var client9004=jayson[_0x41fc('0x11')][_0x41fc('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x57572a,_0x40774b,_0x55c2b7,_0x11773c){return new BPromise(function(_0x247247,_0x50bfbd){var _0x32385f=_0x11773c||client;return _0x32385f[_0x41fc('0x13')](_0x57572a,_0x55c2b7)[_0x41fc('0x14')](function(_0x24b132){logger['info'](_0x41fc('0x15'),_0x40774b,_0x41fc('0x16'));logger['debug'](_0x41fc('0x17'),_0x40774b,'request\x20sent',JSON['stringify'](_0x24b132));if(_0x24b132['error']){if(_0x24b132[_0x41fc('0x18')][_0x41fc('0x19')]===0x1f4){logger['error'](_0x41fc('0x15'),_0x40774b,_0x24b132[_0x41fc('0x18')][_0x41fc('0x1a')]);return _0x50bfbd(_0x24b132[_0x41fc('0x18')]['message']);}logger[_0x41fc('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x40774b,_0x24b132[_0x41fc('0x18')][_0x41fc('0x1a')]);return _0x247247(_0x24b132['error'][_0x41fc('0x1a')]);}else{logger['info'](_0x41fc('0x15'),_0x40774b,_0x41fc('0x16'));_0x247247(_0x24b132[_0x41fc('0x1b')][_0x41fc('0x1a')]);}})[_0x41fc('0x1c')](function(_0x1112c2){logger['error'](_0x41fc('0x15'),_0x40774b,_0x1112c2);_0x50bfbd(_0x1112c2);});});}function respondWithStatusCode(_0x4559ef,_0x2ea987){_0x2ea987=_0x2ea987||0xcc;return function(_0x4539d4){if(_0x4539d4){return _0x4559ef[_0x41fc('0x1d')](_0x2ea987);}return _0x4559ef[_0x41fc('0x1e')](_0x2ea987)[_0x41fc('0x1f')]();};}function respondWithResult(_0x119a13,_0x13c8d4){_0x13c8d4=_0x13c8d4||0xc8;return function(_0x27e716){if(_0x27e716){return _0x119a13[_0x41fc('0x1e')](_0x13c8d4)[_0x41fc('0x20')](_0x27e716);}};}function respondWithFilteredResult(_0x5e1811,_0x541d32){return function(_0x5dc5e6){if(_0x5dc5e6){var _0x13f10c=typeof _0x541d32[_0x41fc('0x21')]===_0x41fc('0x22')&&typeof _0x541d32[_0x41fc('0x23')]===_0x41fc('0x22');var _0x4a5bea=_0x5dc5e6[_0x41fc('0x24')];var _0x2bb7cd=_0x13f10c?0x0:_0x541d32['offset'];var _0x63be2=_0x13f10c?_0x5dc5e6[_0x41fc('0x24')]:_0x541d32[_0x41fc('0x21')]+_0x541d32[_0x41fc('0x23')];var _0x7e7e81;if(_0x63be2>=_0x4a5bea){_0x63be2=_0x4a5bea;_0x7e7e81=0xc8;}else{_0x7e7e81=0xce;}_0x5e1811['status'](_0x7e7e81);return _0x5e1811[_0x41fc('0x25')]('Content-Range',_0x2bb7cd+'-'+_0x63be2+'/'+_0x4a5bea)[_0x41fc('0x20')](_0x5dc5e6);}return null;};}function saveUpdates(_0x4256ea){return function(_0x4f6f88){if(_0x4f6f88){return _0x4f6f88['update'](_0x4256ea)[_0x41fc('0x14')](function(_0x127c62){return _0x127c62;});}return null;};}function removeEntity(_0x119145){return function(_0x599f36){if(_0x599f36){return _0x599f36[_0x41fc('0x26')]()[_0x41fc('0x14')](function(){_0x119145['status'](0xcc)[_0x41fc('0x1f')]();});}};}function handleEntityNotFound(_0x5d4660){return function(_0x3eccd9){if(!_0x3eccd9){_0x5d4660[_0x41fc('0x1d')](0x194);}return _0x3eccd9;};}function handleError(_0x5429f6,_0x17979c){_0x17979c=_0x17979c||0x1f4;return function(_0x39c588){logger['error'](_0x39c588['stack']);if(_0x39c588[_0x41fc('0x27')]){delete _0x39c588[_0x41fc('0x27')];}_0x5429f6[_0x41fc('0x1e')](_0x17979c)[_0x41fc('0x28')](_0x39c588);};}function getMustacheRender(_0x10e80a,_0x293f59){return Mustache[_0x41fc('0x29')](_0x10e80a,_[_0x41fc('0x2a')](_0x293f59[_0x41fc('0x2b')],{'contact':_0x293f59[_0x41fc('0x2c')],'message':_0x293f59['message'],'agent':_0x293f59[_0x41fc('0x2d')],'interaction':_0x293f59['interaction'],'account':_0x293f59[_0x41fc('0x2e')]}))||'';}exports[_0x41fc('0x2f')]=function(_0x3eca15,_0x138023){var _0x329a74={};var _0x3180fb=_[_0x41fc('0x30')](db['ChatInteraction'][_0x41fc('0x31')],function(_0x3c1a20){return{'name':_0x3c1a20[_0x41fc('0x32')],'type':_0x3c1a20[_0x41fc('0x33')][_0x41fc('0x34')]};});_0x329a74=qs[_0x41fc('0x35')](_0x3180fb,_0x3eca15);return interaction[_0x41fc('0x36')](_0x41fc('0x37'),_0x3eca15[_0x41fc('0x38')],_0x3eca15[_0x41fc('0x39')],_0x329a74,_0x3180fb)[_0x41fc('0x14')](respondWithFilteredResult(_0x138023,_0x329a74))[_0x41fc('0x1c')](handleError(_0x138023,null));};exports[_0x41fc('0x3a')]=function(_0x3c6d89,_0x46c5d0){var _0xd5e05b={'raw':![],'where':{'id':_0x3c6d89[_0x41fc('0x3b')]['id']}},_0x24e2b5={};_0x24e2b5[_0x41fc('0x3c')]=_[_0x41fc('0x3d')](db[_0x41fc('0x3e')][_0x41fc('0x31')]);_0x24e2b5[_0x41fc('0x38')]=_['keys'](_0x3c6d89[_0x41fc('0x38')]);_0x24e2b5['filters']=_[_0x41fc('0x3f')](_0x24e2b5[_0x41fc('0x3c')],_0x24e2b5[_0x41fc('0x38')]);_0xd5e05b[_0x41fc('0x40')]=_[_0x41fc('0x3f')](_0x24e2b5[_0x41fc('0x3c')],qs[_0x41fc('0x41')](_0x3c6d89[_0x41fc('0x38')][_0x41fc('0x41')]));_0xd5e05b[_0x41fc('0x40')]=_0xd5e05b[_0x41fc('0x40')][_0x41fc('0x42')]?_0xd5e05b[_0x41fc('0x40')]:_0x24e2b5[_0x41fc('0x3c')];if(_0x3c6d89[_0x41fc('0x38')][_0x41fc('0x43')]){_0xd5e05b['include']=[{'all':!![]}];}_0xd5e05b=_[_0x41fc('0x2a')]({},_0xd5e05b,_0x3c6d89[_0x41fc('0x44')]);return db['ChatInteraction'][_0x41fc('0x45')](_0xd5e05b)[_0x41fc('0x14')](handleEntityNotFound(_0x46c5d0,null))[_0x41fc('0x14')](respondWithResult(_0x46c5d0,null))[_0x41fc('0x1c')](handleError(_0x46c5d0,null));};exports[_0x41fc('0x46')]=function(_0x5d5251,_0x26c961){return db['ChatInteraction'][_0x41fc('0x46')](_0x5d5251[_0x41fc('0x2b')],{})['then'](respondWithResult(_0x26c961,0xc9))[_0x41fc('0x1c')](handleError(_0x26c961,null));};exports[_0x41fc('0x47')]=function(_0x267cae,_0x396158){if(_0x267cae[_0x41fc('0x2b')]['id']){delete _0x267cae[_0x41fc('0x2b')]['id'];}return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x267cae[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x396158,null))[_0x41fc('0x14')](saveUpdates(_0x267cae['body'],null))[_0x41fc('0x14')](respondWithResult(_0x396158,null))[_0x41fc('0x1c')](handleError(_0x396158,null));};exports['destroy']=function(_0xacd39f,_0x52509b){return db['ChatInteraction'][_0x41fc('0x45')]({'where':{'id':_0xacd39f[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x52509b,null))[_0x41fc('0x14')](removeEntity(_0x52509b,null))['catch'](handleError(_0x52509b,null));};exports[_0x41fc('0x48')]=function(_0x200068,_0x338acb){return db[_0x41fc('0x3e')][_0x41fc('0x48')]()[_0x41fc('0x14')](respondWithResult(_0x338acb,null))[_0x41fc('0x1c')](handleError(_0x338acb,null));};exports[_0x41fc('0x49')]=function(_0x2f6d7d,_0x5e3dcd){var _0x13294c=_0x2f6d7d['params']['id'];var _0x4a5810;var _0x1d78c6;var _0x505c60;return db[_0x41fc('0x3e')][_0x41fc('0x4a')]({'where':{'id':_0x13294c}})['then'](function(_0x3743d2){_0x4a5810=_0x3743d2;return db[_0x41fc('0x4b')][_0x41fc('0x4a')]({'where':{'id':_0x3743d2[_0x41fc('0x4c')]},'attributes':['id',_0x41fc('0x4d'),_0x41fc('0x4e'),_0x41fc('0x4f'),_0x41fc('0x50'),_0x41fc('0x51')],'raw':!![]});})[_0x41fc('0x14')](function(_0x37ce77){if(_0x37ce77&&_0x37ce77['vidaooApiKey']&&_0x37ce77[_0x41fc('0x4e')]){_0x1d78c6=_0x37ce77;var _0xf64fa8={'interaction':{'id':_0x13294c},'agent':{'id':_0x2f6d7d[_0x41fc('0x39')]['id'],'name':_0x2f6d7d['user']['name'],'fullname':_0x2f6d7d[_0x41fc('0x39')][_0x41fc('0x52')],'email':_0x2f6d7d[_0x41fc('0x39')]['email']},'contact':_0x2f6d7d['body'][_0x41fc('0x2c')],'account':_0x2f6d7d[_0x41fc('0x2b')][_0x41fc('0x2e')]};var _0x35abac={'rejectUnauthorized':![],'method':_0x41fc('0x53'),'url':_0x41fc('0x54'),'headers':{'X-APIKEY':_0x37ce77[_0x41fc('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2f6d7d[_0x41fc('0x39')]['email']],'buttons':null,'topic':_0x1d78c6[_0x41fc('0x4f')],'note':_[_0x41fc('0x55')](_0x1d78c6[_0x41fc('0x50')])?null:getMustacheRender(_0x1d78c6[_0x41fc('0x50')],_0xf64fa8),'metadata':null},'redirect':_0x41fc('0x56'),'json':!![]};try{if(!_[_0x41fc('0x55')](_0x1d78c6[_0x41fc('0x51')])){var _0x54adbb=getMustacheRender(_0x1d78c6[_0x41fc('0x51')],_0xf64fa8);var _0x250ab2=JSON[_0x41fc('0x57')](_0x54adbb);_0x35abac[_0x41fc('0x2b')][_0x41fc('0x58')]=_0x250ab2;}}catch(_0x2dc50b){throw new db[(_0x41fc('0x59'))][(_0x41fc('0x5a'))](_0x41fc('0x5b'));}return rp(_0x35abac);}else{throw new db[(_0x41fc('0x59'))][(_0x41fc('0x5a'))](_0x41fc('0x5c'));}})[_0x41fc('0x14')](function(_0x4046b9){_0x505c60=_0x4046b9;if(_0x505c60['id']){var _0x5c1f31={'body':_0x505c60[_0x41fc('0x5d')],'ChatWebsiteId':_0x1d78c6['id'],'ChatInteractionId':_0x4a5810['id'],'direction':'out','UserId':_0x2f6d7d['user']['id']};return db['ChatMessage']['create'](_0x5c1f31,{});}else{throw new db[(_0x41fc('0x59'))][(_0x41fc('0x5a'))](_0x41fc('0x5e'));}})['then'](function(){return _0x4a5810['updateAttributes']({'vidaooSessionId':_0x505c60['id']});})['then'](respondWithResult(_0x5e3dcd,null))[_0x41fc('0x1c')](handleError(_0x5e3dcd,null));};exports[_0x41fc('0x5f')]=function(_0x582077,_0x2e889d){if(_0x582077[_0x41fc('0x2b')]['id']){delete _0x582077['body']['id'];}return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x582077['params']['id']},'include':[{'model':db['CmContact'],'as':_0x41fc('0x60')}]})[_0x41fc('0x14')](handleEntityNotFound(_0x2e889d,null))[_0x41fc('0x14')](saveUpdates(_0x582077[_0x41fc('0x2b')],null))[_0x41fc('0x14')](respondWithResult(_0x2e889d,null))['catch'](handleError(_0x2e889d,null));};exports[_0x41fc('0x61')]=function(_0x430220,_0x5bd368){if(_0x430220[_0x41fc('0x2b')]['id']){delete _0x430220[_0x41fc('0x2b')]['id'];}return db[_0x41fc('0x3e')]['find']({'where':{'id':_0x430220[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](function(_0x501a48){if(!_0x501a48){logger[_0x41fc('0x18')](_0x41fc('0x62'),_0x41fc('0x61'),0x194,_0x41fc('0x63'));_0x5bd368[_0x41fc('0x1d')](0x194);}else{if(_0x501a48[_0x41fc('0x64')]){throw new db['Sequelize']['ValidationError'](_0x41fc('0x65'));}}return _0x501a48;})[_0x41fc('0x14')](function(_0xa9454){if(_0xa9454){return _0xa9454['update']({'closed':_0x430220[_0x41fc('0x2b')]['closed'],'disposition':_0x430220[_0x41fc('0x2b')][_0x41fc('0x66')]})[_0x41fc('0x14')](function(_0x18e7d9){return _0x18e7d9;});}})['then'](function(){return respondWithRpcPromise(_0x41fc('0x67'),_0x41fc('0x61'),_0x430220[_0x41fc('0x2b')],client9004);})[_0x41fc('0x14')](respondWithResult(_0x5bd368,null))[_0x41fc('0x1c')](handleError(_0x5bd368,null));};exports[_0x41fc('0x68')]=function(_0x2f3b84,_0xc3ed0){_0x2f3b84[_0x41fc('0x2b')][_0x41fc('0x27')]=_0x2f3b84[_0x41fc('0x69')][_0x41fc('0x6a')];_0x2f3b84[_0x41fc('0x2b')][_0x41fc('0x6b')]=_0x2f3b84[_0x41fc('0x69')]['filename'];_0x2f3b84[_0x41fc('0x2b')]['type']=_0x2f3b84['file'][_0x41fc('0x6c')];return db[_0x41fc('0x6d')][_0x41fc('0x46')](_0x2f3b84[_0x41fc('0x2b')])['then'](respondWithResult(_0xc3ed0,0xc9))['catch'](handleError(_0xc3ed0,null));};exports[_0x41fc('0x6e')]=function(_0x43f567,_0x2ca377){return db[_0x41fc('0x3e')][_0x41fc('0x4a')]({'where':{'id':_0x43f567[_0x41fc('0x3b')]['id']},'raw':!![]})[_0x41fc('0x14')](handleEntityNotFound(_0x2ca377,null))[_0x41fc('0x14')](function(_0x21ed99){if(_0x21ed99){if(_0x21ed99[_0x41fc('0x6f')]){return _0x2ca377['status'](0x193)[_0x41fc('0x20')]({'status':0x193,'message':_0x41fc('0x70')});}return db[_0x41fc('0x6d')][_0x41fc('0x4a')]({'where':{'id':_0x43f567['query']['attachId']},'raw':!![]})[_0x41fc('0x14')](handleEntityNotFound(_0x2ca377,null));}})[_0x41fc('0x14')](function(_0x5d8d59){if(_0x5d8d59){var _0x4f4cb3=_0x5d8d59[_0x41fc('0x71')]!==null;var _0x3f3b7e=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0x74'));if(_0x4f4cb3){_0x3f3b7e=path[_0x41fc('0x72')](_0x3f3b7e,_0x41fc('0x75'));}var _0xb5c435=path[_0x41fc('0x72')](_0x3f3b7e,_0x5d8d59[_0x41fc('0x6b')]);return _0x2ca377[_0x41fc('0x76')](_0xb5c435);}})[_0x41fc('0x1c')](handleError(_0x2ca377,null));};exports['close']=function(_0x280911,_0x2a8278){var _0x153f21=null;var _0x45cd04=null;var _0x3eb16f=null;if(_0x280911[_0x41fc('0x2b')]['id']){delete _0x280911[_0x41fc('0x2b')]['id'];}if(_0x280911[_0x41fc('0x2b')][_0x41fc('0x77')]){_0x3eb16f=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0x78'),util[_0x41fc('0x79')](_0x41fc('0x7a'),Date[_0x41fc('0x7b')]()));_0x280911[_0x41fc('0x2b')][_0x41fc('0x7c')]=_0x3eb16f;}return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x280911[_0x41fc('0x3b')]['id']},'include':[{'model':db[_0x41fc('0x7d')],'as':_0x41fc('0x7e'),'include':[{'model':db[_0x41fc('0x7f')],'as':_0x41fc('0x7f')}]}]})[_0x41fc('0x14')](handleEntityNotFound(_0x2a8278,null))[_0x41fc('0x14')](saveUpdates(_0x280911[_0x41fc('0x2b')],null))[_0x41fc('0x14')](function(_0x5239d5){if(_0x5239d5){_0x153f21=_0x5239d5;return db['ChatWebsite'][_0x41fc('0x45')]({'where':{'id':_0x153f21['ChatWebsiteId']}});}})[_0x41fc('0x14')](function(_0x244ecb){if(_0x244ecb){_0x45cd04=_0x244ecb;return db[_0x41fc('0x80')][_0x41fc('0x45')]({'where':{'id':_0x153f21[_0x41fc('0x81')]}});}})[_0x41fc('0x14')](function(_0x5acbc7){if(_0x5acbc7){if(_0x3eb16f){var _0x317625=null;for(var _0xd99007=0x1;_0xd99007<_0x153f21['Messages'][_0x41fc('0x42')];++_0xd99007){_0x317625=_0x153f21[_0x41fc('0x7e')][_0xd99007];var _0x1d9947=_0x317625[_0x41fc('0x64')]?util[_0x41fc('0x79')]('%s%d',_0x45cd04[_0x41fc('0x82')],_0x317625[_0x41fc('0x64')]):'System';var _0xf58b49=_0x280911[_0x41fc('0x2b')][_0x41fc('0x83')]||util['format']('%s%d',_0x41fc('0x84'),_0x317625['ContactId']);switch(_0x45cd04[_0x41fc('0x85')]){case _0x41fc('0x86'):_0x1d9947=_0x317625[_0x41fc('0x64')]?util['format'](_0x41fc('0x87'),_0x45cd04['agentAlias'],_0x317625[_0x41fc('0x64')]):_0x41fc('0x88');break;case'agent_alias':_0x1d9947=_0x317625[_0x41fc('0x64')]?_0x317625[_0x41fc('0x7f')][_0x41fc('0x89')]||_0x317625['User'][_0x41fc('0x52')]:'System';break;case _0x41fc('0x8a'):_0x1d9947=_0x317625['UserId']?_0x317625['User']['fullname']:_0x41fc('0x88');break;default:_0x1d9947=_0x317625[_0x41fc('0x64')]?util[_0x41fc('0x79')](_0x41fc('0x87'),_0x45cd04[_0x41fc('0x82')],_0x317625[_0x41fc('0x64')]):_0x41fc('0x88');}var _0x4b5c37=util[_0x41fc('0x79')](_0x41fc('0x8b'),moment(_0x317625[_0x41fc('0x8c')])[_0x41fc('0x79')](_0x41fc('0x8d')),_0x317625['direction']==='in'?_0xf58b49:_0x1d9947,_0x317625[_0x41fc('0x2b')]);if(!_0x317625[_0x41fc('0x8e')]){fs[_0x41fc('0x8f')](_0x3eb16f,_0x4b5c37);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x41fc('0x90')],'as':_0x41fc('0x91'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x41fc('0x92'),'raw':!![]}]}]});}}})[_0x41fc('0x14')](function(_0x2f09ce){if(!_0x2f09ce||!_0x2f09ce['Smtp']||!_0x280911[_0x41fc('0x2b')])return _0x153f21;var _0x3058dc=_0x2f09ce[_0x41fc('0x93')]();return respondWithRpcPromise(_0x41fc('0x94'),_0x41fc('0x95'),{'account':_0x3058dc,'message':{'from':util[_0x41fc('0x79')](_0x41fc('0x96'),_0x2f09ce[_0x41fc('0x27')],_0x2f09ce[_0x41fc('0x97')]||_0x2f09ce['Smtp'][_0x41fc('0x39')]),'to':_0x280911[_0x41fc('0x2b')][_0x41fc('0x77')],'subject':_0x41fc('0x98'),'text':util['format'](_0x41fc('0x99'),_0x280911['body'][_0x41fc('0x77')]),'attachments':[{'path':_0x3eb16f}]}})['then'](function(){return _0x153f21;})[_0x41fc('0x1c')](function(_0xe43fb9){logger[_0x41fc('0x18')](_0xe43fb9);});})[_0x41fc('0x14')](respondWithStatusCode(_0x2a8278,0xc8))[_0x41fc('0x1c')](handleError(_0x2a8278,null));};exports['addMessage']=function(_0x4a501d,_0x2a8b6b){return db[_0x41fc('0x7d')][_0x41fc('0x45')]({'where':{'id':_0x4a501d[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x2a8b6b,null))[_0x41fc('0x14')](function(_0x368769){if(_0x368769){return _0x368769[_0x41fc('0x9a')](_0x4a501d[_0x41fc('0x2b')][_0x41fc('0x9b')],_['omit'](_0x4a501d[_0x41fc('0x2b')],[_0x41fc('0x9b'),'id'])||{});}})[_0x41fc('0x14')](respondWithResult(_0x2a8b6b,null))[_0x41fc('0x1c')](handleError(_0x2a8b6b,null));};exports['getMessages']=function(_0x28d988,_0x2306b1){var _0x499387={'raw':![],'where':{}};var _0x5c2fcc={};var _0x48c3ec={'count':0x0,'rows':[]};return db[_0x41fc('0x3e')]['findOne']({'where':{'id':_0x28d988[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x2306b1,null))[_0x41fc('0x14')](function(_0x1d0462){if(_0x1d0462){_0x5c2fcc[_0x41fc('0x3c')]=_[_0x41fc('0x3d')](db[_0x41fc('0x7d')][_0x41fc('0x31')]);_0x5c2fcc[_0x41fc('0x38')]=_[_0x41fc('0x3d')](_0x28d988['query']);_0x5c2fcc['filters']=_[_0x41fc('0x3f')](_0x5c2fcc['model'],_0x5c2fcc['query']);_0x499387['attributes']=_[_0x41fc('0x3f')](_0x5c2fcc[_0x41fc('0x3c')],qs['fields'](_0x28d988[_0x41fc('0x38')][_0x41fc('0x41')]));_0x499387[_0x41fc('0x40')]=_0x499387[_0x41fc('0x40')]['length']?_0x499387[_0x41fc('0x40')]:_0x5c2fcc[_0x41fc('0x3c')];if(!_0x28d988['query']['hasOwnProperty'](_0x41fc('0x9c'))){_0x499387[_0x41fc('0x23')]=qs[_0x41fc('0x23')](_0x28d988[_0x41fc('0x38')]['limit']);_0x499387[_0x41fc('0x21')]=qs['offset'](_0x28d988['query'][_0x41fc('0x21')]);}_0x499387[_0x41fc('0x9d')]=qs[_0x41fc('0x9e')](_0x28d988['query'][_0x41fc('0x9e')]);_0x499387['where']=qs[_0x41fc('0x9f')](_[_0x41fc('0xa0')](_0x28d988[_0x41fc('0x38')],_0x5c2fcc[_0x41fc('0x9f')]));_0x499387['where'][_0x41fc('0xa1')]=_0x1d0462['id'];if(_0x28d988['query']['filter']){_0x499387[_0x41fc('0xa2')]=_[_0x41fc('0x2a')](_0x499387[_0x41fc('0xa2')],{'$or':_[_0x41fc('0x30')](_0x499387[_0x41fc('0x40')],function(_0x5d153a){var _0x3766ea={};_0x3766ea[_0x5d153a]={'$like':'%'+_0x28d988[_0x41fc('0x38')][_0x41fc('0xa3')]+'%'};return _0x3766ea;})});}if(_0x28d988[_0x41fc('0x38')][_0x41fc('0xa4')]){var _0x12d710=_0x28d988[_0x41fc('0x38')][_0x41fc('0xa4')][_0x41fc('0xa5')](',');var _0x5784e5={};_0x5784e5[_0x12d710[0x0]]={'$gte':moment(_0x12d710[0x1])[_0x41fc('0x79')](_0x41fc('0xa6'))};_0x499387[_0x41fc('0xa2')]=_[_0x41fc('0x2a')](_0x499387[_0x41fc('0xa2')],_0x5784e5);}_0x499387=_[_0x41fc('0x2a')]({},_0x499387,_0x28d988[_0x41fc('0x44')]);return db['ChatMessage'][_0x41fc('0x24')]({'where':_0x499387[_0x41fc('0xa2')]})[_0x41fc('0x14')](function(_0x3508a5){_0x48c3ec['count']=_0x3508a5;if(_0x28d988[_0x41fc('0x38')][_0x41fc('0x43')]){_0x499387[_0x41fc('0xa7')]=[{'all':!![]}];}return db['ChatMessage'][_0x41fc('0x36')](_0x499387);})['then'](function(_0x24a09a){_0x48c3ec['rows']=_0x24a09a;return _0x48c3ec;});}})[_0x41fc('0x14')](respondWithFilteredResult(_0x2306b1,_0x499387))[_0x41fc('0x1c')](handleError(_0x2306b1,null));};exports[_0x41fc('0xa8')]=function(_0x43fd16,_0x2999d4){var _0x12bb76={'where':{}},_0x53ddc0={},_0xfe031b={'count':0x0,'rows':[]};return db[_0x41fc('0x3e')][_0x41fc('0x4a')]({'where':{'id':_0x43fd16[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x2999d4,null))['then'](function(_0x52658f){if(_0x52658f){_0x53ddc0[_0x41fc('0x3c')]=_[_0x41fc('0x3d')](db[_0x41fc('0x7d')][_0x41fc('0x31')]);_0x53ddc0[_0x41fc('0x38')]=_[_0x41fc('0x3d')](_0x43fd16[_0x41fc('0x38')]);_0x53ddc0['filters']=_[_0x41fc('0x3f')](_0x53ddc0[_0x41fc('0x3c')],_0x53ddc0[_0x41fc('0x38')]);_0x12bb76[_0x41fc('0x40')]=_[_0x41fc('0x3f')](_0x53ddc0[_0x41fc('0x3c')],qs[_0x41fc('0x41')](_0x43fd16[_0x41fc('0x38')][_0x41fc('0x41')]));_0x12bb76[_0x41fc('0x40')]=_0x12bb76[_0x41fc('0x40')][_0x41fc('0x42')]?_0x12bb76[_0x41fc('0x40')]:_0x53ddc0[_0x41fc('0x3c')];if(!_0x43fd16[_0x41fc('0x38')][_0x41fc('0xa9')]('nolimit')){_0x12bb76['limit']=qs[_0x41fc('0x23')](_0x43fd16[_0x41fc('0x38')][_0x41fc('0x23')]);_0x12bb76[_0x41fc('0x21')]=qs[_0x41fc('0x21')](_0x43fd16['query'][_0x41fc('0x21')]);}_0x12bb76['order']=qs[_0x41fc('0x9e')](_0x43fd16[_0x41fc('0x38')][_0x41fc('0x9e')]);_0x12bb76[_0x41fc('0xa2')]=qs['filters'](_['pick'](_0x43fd16[_0x41fc('0x38')],_0x53ddc0[_0x41fc('0x9f')]));_0x12bb76[_0x41fc('0xa2')][_0x41fc('0xa1')]=_0x52658f['id'];if(_0x43fd16[_0x41fc('0x38')][_0x41fc('0xa3')]){_0x12bb76[_0x41fc('0xa2')]=_[_0x41fc('0x2a')](_0x12bb76[_0x41fc('0xa2')],{'$or':_[_0x41fc('0x30')](_0x12bb76['attributes'],function(_0x2db164){var _0x9c8f40={};_0x9c8f40[_0x2db164]={'$like':'%'+_0x43fd16[_0x41fc('0x38')]['filter']+'%'};return _0x9c8f40;})});}_0x12bb76[_0x41fc('0xa2')]['secret']=![];if(_0x43fd16[_0x41fc('0x38')]['id']){_0x12bb76[_0x41fc('0xa2')]['id']={'$gt':_0x43fd16[_0x41fc('0x38')]['id']};}_0x12bb76=_['merge']({},_0x12bb76,_0x43fd16[_0x41fc('0x44')]);return db['ChatMessage'][_0x41fc('0x24')]({'where':_0x12bb76[_0x41fc('0xa2')]})[_0x41fc('0x14')](function(_0x1edbc8){_0xfe031b[_0x41fc('0x24')]=_0x1edbc8;_0x12bb76['include']=[];if(_0x43fd16[_0x41fc('0x38')][_0x41fc('0xaa')]){_0x12bb76[_0x41fc('0xa7')][_0x41fc('0xab')]({'model':db['User'],'as':_0x41fc('0x7f'),'attributes':['id',_0x41fc('0x52'),_0x41fc('0x89')]});}if(_0x43fd16[_0x41fc('0x38')][_0x41fc('0x43')]){_0x12bb76[_0x41fc('0xa7')]=[{'all':!![]}];}return db[_0x41fc('0x7d')][_0x41fc('0x36')](_0x12bb76);})[_0x41fc('0x14')](function(_0x4870e8){_0xfe031b[_0x41fc('0xac')]=_0x4870e8;return _0xfe031b;});}})[_0x41fc('0x14')](respondWithFilteredResult(_0x2999d4,_0x12bb76))[_0x41fc('0x1c')](handleError(_0x2999d4,null));};exports[_0x41fc('0xad')]=function(_0x18b8a4,_0xb4a7a3){return db['ChatInteraction'][_0x41fc('0x45')]({'where':{'id':_0x18b8a4['params']['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0xb4a7a3,null))['then'](function(_0x400ab6){if(_0x400ab6){return _0x400ab6[_0x41fc('0xae')](_0x18b8a4[_0x41fc('0x2b')][_0x41fc('0x9b')],_[_0x41fc('0xaf')](_0x18b8a4['body'],[_0x41fc('0x9b'),'id'])||{})[_0x41fc('0xb0')](function(){return db[_0x41fc('0xb1')]['findAll']({'attributes':['id',_0x41fc('0x27'),_0x41fc('0xb2')],'where':{'id':_0x18b8a4[_0x41fc('0x2b')]['ids']}});})[_0x41fc('0x14')](function(_0xf0330a){socket['emit'](_0x41fc('0xb3'),{'id':Number(_0x18b8a4[_0x41fc('0x3b')]['id']),'tags':_0xf0330a||[]});return{'id':Number(_0x18b8a4[_0x41fc('0x3b')]['id']),'tags':_0xf0330a||[]};});}})[_0x41fc('0x14')](respondWithResult(_0xb4a7a3,null))[_0x41fc('0x1c')](handleError(_0xb4a7a3,null));};exports[_0x41fc('0xb4')]=function(_0x1bdb9b,_0x12bf27){return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x1bdb9b[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x12bf27,null))['then'](function(_0x10df5b){if(_0x10df5b){return _0x10df5b[_0x41fc('0xb4')](_0x1bdb9b[_0x41fc('0x38')]['ids']);}})[_0x41fc('0x14')](respondWithStatusCode(_0x12bf27,null))[_0x41fc('0x1c')](handleError(_0x12bf27,null));};exports[_0x41fc('0x76')]=function(_0x5574e7,_0x5489d6){var _0x5d0428=moment()[_0x41fc('0xb5')]()['toString']();var _0x1a89fb=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0xb6'),_0x41fc('0xb7'),_0x41fc('0xb8'));var _0x7e95ef=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0xb6'),_0x41fc('0xb7'),'attachments');var _0x288038=path[_0x41fc('0x72')](_0x1a89fb,_0x5d0428);var _0x3a0ccb=util[_0x41fc('0x79')](_0x41fc('0xb9'),_0x5574e7['params']['id'],_0x5d0428);var _0x511650=path['join'](_0x1a89fb,_0x3a0ccb);var _0x3231ef=[];_0x3231ef[_0x41fc('0xab')]({'model':db['User'],'as':_0x41fc('0x7f'),'attributes':['id','fullname'],'raw':!![]});_0x3231ef[_0x41fc('0xab')]({'model':db[_0x41fc('0x80')],'as':_0x41fc('0x60'),'attributes':['id','firstName',_0x41fc('0xba')],'raw':!![]});if(_0x5574e7[_0x41fc('0x38')][_0x41fc('0xbb')]){_0x3231ef[_0x41fc('0xab')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x271260=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id','body','createdAt',_0x41fc('0xbc'),_0x41fc('0x8e'),_0x41fc('0xbd')],'include':_0x3231ef}];_0x271260[_0x41fc('0xab')]({'model':db[_0x41fc('0x4b')],'as':_0x41fc('0xbe'),'attributes':['id',_0x41fc('0x27')]});_0x271260[_0x41fc('0xab')]({'model':db[_0x41fc('0x7f')],'as':_0x41fc('0xbf'),'attributes':['id',_0x41fc('0x52')]});return db['ChatInteraction']['find']({'where':{'id':_0x5574e7[_0x41fc('0x3b')]['id']},'include':_0x271260})[_0x41fc('0x14')](handleEntityNotFound(_0x5489d6,null))[_0x41fc('0x14')](function(_0x4fc3d3){if(_0x4fc3d3){var _0x106fa2=_0x4fc3d3[_0x41fc('0xc0')]({'plain':!![]});fs[_0x41fc('0xc1')](_0x288038);var _0x61dfdb={'channel':_0x41fc('0xc2'),'account':_0x106fa2[_0x41fc('0xbe')][_0x41fc('0x27')],'agent':_0x106fa2[_0x41fc('0xbf')]?_0x106fa2[_0x41fc('0xbf')]['fullname']:_0x41fc('0xc3'),'createdAt':moment(_0x106fa2[_0x41fc('0x8c')])[_0x41fc('0x79')](_0x41fc('0xa6'))[_0x41fc('0xc4')](),'closedAt':_0x106fa2[_0x41fc('0x6f')]?moment(_0x106fa2[_0x41fc('0xc5')])[_0x41fc('0x79')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x106fa2[_0x41fc('0x66')],'chatInfo':{'browser':_0x106fa2['browserName'],'os':_0x106fa2['osName'],'referer':_0x106fa2[_0x41fc('0xc6')],'customerIp':_0x106fa2[_0x41fc('0xc7')],'customerPort':_0x106fa2[_0x41fc('0xc8')]?_0x106fa2[_0x41fc('0xc8')]:'N.A.'},'messages':_(_0x106fa2[_0x41fc('0x7e')])[_0x41fc('0xc9')]()[_0x41fc('0xa3')]({'secret':![]})[_0x41fc('0x30')](function(_0x374c93){if(_0x374c93[_0x41fc('0x6d')]){var _0x5cf940=path[_0x41fc('0x72')](_0x7e95ef,_0x374c93[_0x41fc('0x6d')][_0x41fc('0x6b')]);if(fs['existsSync'](_0x5cf940)){fs[_0x41fc('0xca')](_0x5cf940)[_0x41fc('0xcb')](fs['createWriteStream'](path[_0x41fc('0x72')](_0x288038,_0x374c93[_0x41fc('0x6d')][_0x41fc('0x6b')])));}}return{'date':moment(_0x374c93[_0x41fc('0x8c')])['format'](_0x41fc('0xa6'))[_0x41fc('0xc4')](),'sender':_0x374c93['direction']===_0x41fc('0xcc')?_0x374c93['User']?_0x374c93[_0x41fc('0x7f')][_0x41fc('0x52')]:'System':_0x374c93[_0x41fc('0x60')][_0x41fc('0xcd')]+(_0x374c93['Contact']['lastName']?'\x20'+_0x374c93[_0x41fc('0x60')][_0x41fc('0xba')]:''),'body':_0x374c93[_0x41fc('0x6d')]?_0x374c93[_0x41fc('0x6d')][_0x41fc('0x6b')]:_0x374c93[_0x41fc('0x2b')],'direction':_0x374c93[_0x41fc('0xbc')]===_0x41fc('0xcc')?'A':'C','secret':_0x374c93[_0x41fc('0x8e')],'read':_0x374c93[_0x41fc('0xbd')],'attachment':_0x374c93[_0x41fc('0x6d')]};})[_0x41fc('0xce')]()};return ejs['renderFile'](path[_0x41fc('0x72')](config['root'],'server',_0x41fc('0xcf'),_0x41fc('0xd0')),{'interaction':_0x61dfdb})[_0x41fc('0x14')](function(_0x152607){var _0x6c976c=path['join'](_0x288038,_0x41fc('0xd1')+_0x106fa2['id']+'-'+_0x5d0428+_0x41fc('0xd2'));var _0x1debfc={'path':_0x6c976c,'channel':_0x41fc('0xc2'),'interactionId':_0x106fa2['id']};return pdf[_0x41fc('0xd3')](_0x152607,_0x1debfc);})['then'](function(){return new Promise(function(_0x335804,_0x46183a){zipdir(_0x288038,{'saveTo':_0x511650},function(_0x2497d3,_0x4f4538){if(_0x2497d3)return _0x46183a(_0x2497d3);return _0x335804(_0x4f4538);});})['then'](function(){return new BPromise(function(_0x1246de,_0xfaec57){rimraf(_0x288038,function(_0x5d7888){if(_0x5d7888)_0xfaec57(_0x5d7888);return _0x1246de();});});})['then'](function(){return _0x5489d6[_0x41fc('0x76')](_0x511650,_0x3a0ccb,function(_0x26a894){if(_0x26a894){logger[_0x41fc('0x18')](_0x41fc('0xd4'),_0x26a894);}else{fs[_0x41fc('0xd5')](_0x511650);}});});});}else{return _0x5489d6[_0x41fc('0x1d')](0xc8);}})[_0x41fc('0x1c')](handleError(_0x5489d6,null));}; \ No newline at end of file +var _0x70e1=['User','ChatWebsiteId','ContactId','format','agentAlias','customer','%s%d','Visitor','agentIdentifier','website_alias','System','agent_alias','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','getMessages','hasOwnProperty','nolimit','order','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','sort','secret','includeAgent','push','addTags','setTags','ids','spread','Tag','color','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','ChatWebsite','Owner','get','mkdirSync','Chat','Account','toString','closedAt','browserName','osName','referer','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','read','value','renderFile','views','transcript-','.pdf','err','unlinkSync','zip-dir','request-promise','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','redis','localhost','./chatInteraction.socket','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','update','destroy','end','sendStatus','stack','name','send','merge','body','contact','agent','interaction','account','index','map','rawAttributes','fieldName','type','getOptions','findAll','chat','query','show','params','model','keys','ChatInteraction','filters','intersection','attributes','fields','length','includeAll','include','options','create','find','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','basename','filename','mimetype','Unauthorized','Attachment','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages'];(function(_0x2196f3,_0x25609c){var _0x3b865f=function(_0x344ba9){while(--_0x344ba9){_0x2196f3['push'](_0x2196f3['shift']());}};_0x3b865f(++_0x25609c);}(_0x70e1,0x124));var _0x170e=function(_0x78e522,_0x37c539){_0x78e522=_0x78e522-0x0;var _0x4a170d=_0x70e1[_0x78e522];return _0x4a170d;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x170e('0x0'));var rp=require(_0x170e('0x1'));var moment=require(_0x170e('0x2'));var BPromise=require(_0x170e('0x3'));var Mustache=require('mustache');var util=require(_0x170e('0x4'));var path=require(_0x170e('0x5'));var ejs=require(_0x170e('0x6'));var fs=require('fs');var _=require(_0x170e('0x7'));var Redis=require(_0x170e('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0x170e('0x9'));var pdf=require(_0x170e('0xa'));var logger=require('../../config/logger')(_0x170e('0xb'));var config=require('../../config/environment');var db=require(_0x170e('0xc'))['db'];config[_0x170e('0xd')]=_['defaults'](config[_0x170e('0xd')],{'host':_0x170e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x170e('0xd')]));require(_0x170e('0xf'))['register'](socket);var jayson=require(_0x170e('0x10'));var client=jayson[_0x170e('0x11')][_0x170e('0x12')]({'port':0x232b});var client9004=jayson[_0x170e('0x11')][_0x170e('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x14ba22,_0x4e8ab7,_0x459732,_0x303eaa){return new BPromise(function(_0xa4b7a3,_0x5ea7b7){var _0x321eff=_0x303eaa||client;return _0x321eff[_0x170e('0x13')](_0x14ba22,_0x459732)[_0x170e('0x14')](function(_0x13e27e){logger['info'](_0x170e('0x15'),_0x4e8ab7,_0x170e('0x16'));logger[_0x170e('0x17')](_0x170e('0x18'),_0x4e8ab7,'request\x20sent',JSON[_0x170e('0x19')](_0x13e27e));if(_0x13e27e[_0x170e('0x1a')]){if(_0x13e27e['error'][_0x170e('0x1b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4e8ab7,_0x13e27e[_0x170e('0x1a')][_0x170e('0x1c')]);return _0x5ea7b7(_0x13e27e[_0x170e('0x1a')]['message']);}logger[_0x170e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x4e8ab7,_0x13e27e[_0x170e('0x1a')][_0x170e('0x1c')]);return _0xa4b7a3(_0x13e27e['error']['message']);}else{logger['info'](_0x170e('0x15'),_0x4e8ab7,_0x170e('0x16'));_0xa4b7a3(_0x13e27e[_0x170e('0x1d')]['message']);}})[_0x170e('0x1e')](function(_0x1d66ad){logger[_0x170e('0x1a')](_0x170e('0x15'),_0x4e8ab7,_0x1d66ad);_0x5ea7b7(_0x1d66ad);});});}function respondWithStatusCode(_0x2cf0ae,_0x10b52a){_0x10b52a=_0x10b52a||0xcc;return function(_0x2a5aa9){if(_0x2a5aa9){return _0x2cf0ae['sendStatus'](_0x10b52a);}return _0x2cf0ae['status'](_0x10b52a)['end']();};}function respondWithResult(_0x568dfd,_0x4743df){_0x4743df=_0x4743df||0xc8;return function(_0x54b9a1){if(_0x54b9a1){return _0x568dfd[_0x170e('0x1f')](_0x4743df)['json'](_0x54b9a1);}};}function respondWithFilteredResult(_0x334b50,_0xd7789f){return function(_0x380577){if(_0x380577){var _0x4456c0=typeof _0xd7789f[_0x170e('0x20')]===_0x170e('0x21')&&typeof _0xd7789f[_0x170e('0x22')]==='undefined';var _0x1e642d=_0x380577['count'];var _0x50f318=_0x4456c0?0x0:_0xd7789f[_0x170e('0x20')];var _0xa739fd=_0x4456c0?_0x380577[_0x170e('0x23')]:_0xd7789f[_0x170e('0x20')]+_0xd7789f[_0x170e('0x22')];var _0x87e16e;if(_0xa739fd>=_0x1e642d){_0xa739fd=_0x1e642d;_0x87e16e=0xc8;}else{_0x87e16e=0xce;}_0x334b50[_0x170e('0x1f')](_0x87e16e);return _0x334b50['set']('Content-Range',_0x50f318+'-'+_0xa739fd+'/'+_0x1e642d)['json'](_0x380577);}return null;};}function saveUpdates(_0x2d6761){return function(_0x43a999){if(_0x43a999){return _0x43a999[_0x170e('0x24')](_0x2d6761)[_0x170e('0x14')](function(_0x3ddd26){return _0x3ddd26;});}return null;};}function removeEntity(_0x391874){return function(_0x5954a0){if(_0x5954a0){return _0x5954a0[_0x170e('0x25')]()[_0x170e('0x14')](function(){_0x391874[_0x170e('0x1f')](0xcc)[_0x170e('0x26')]();});}};}function handleEntityNotFound(_0x39855e){return function(_0x2016be){if(!_0x2016be){_0x39855e[_0x170e('0x27')](0x194);}return _0x2016be;};}function handleError(_0x5e05a4,_0x1ce8ea){_0x1ce8ea=_0x1ce8ea||0x1f4;return function(_0x3790ae){logger['error'](_0x3790ae[_0x170e('0x28')]);if(_0x3790ae['name']){delete _0x3790ae[_0x170e('0x29')];}_0x5e05a4[_0x170e('0x1f')](_0x1ce8ea)[_0x170e('0x2a')](_0x3790ae);};}function getMustacheRender(_0x47110c,_0x1e86a5){return Mustache['render'](_0x47110c,_[_0x170e('0x2b')](_0x1e86a5[_0x170e('0x2c')],{'contact':_0x1e86a5[_0x170e('0x2d')],'message':_0x1e86a5['message'],'agent':_0x1e86a5[_0x170e('0x2e')],'interaction':_0x1e86a5[_0x170e('0x2f')],'account':_0x1e86a5[_0x170e('0x30')]}))||'';}exports[_0x170e('0x31')]=function(_0x5986d4,_0x113959){var _0x259245={};var _0x13b321=_[_0x170e('0x32')](db['ChatInteraction'][_0x170e('0x33')],function(_0x16a305){return{'name':_0x16a305[_0x170e('0x34')],'type':_0x16a305[_0x170e('0x35')]['key']};});_0x259245=qs[_0x170e('0x36')](_0x13b321,_0x5986d4);return interaction[_0x170e('0x37')](_0x170e('0x38'),_0x5986d4[_0x170e('0x39')],_0x5986d4['user'],_0x259245,_0x13b321)[_0x170e('0x14')](respondWithFilteredResult(_0x113959,_0x259245))['catch'](handleError(_0x113959,null));};exports[_0x170e('0x3a')]=function(_0x2f4638,_0x496793){var _0x461766={'raw':![],'where':{'id':_0x2f4638[_0x170e('0x3b')]['id']}},_0x1b8d40={};_0x1b8d40[_0x170e('0x3c')]=_[_0x170e('0x3d')](db[_0x170e('0x3e')][_0x170e('0x33')]);_0x1b8d40[_0x170e('0x39')]=_[_0x170e('0x3d')](_0x2f4638[_0x170e('0x39')]);_0x1b8d40[_0x170e('0x3f')]=_[_0x170e('0x40')](_0x1b8d40[_0x170e('0x3c')],_0x1b8d40[_0x170e('0x39')]);_0x461766[_0x170e('0x41')]=_['intersection'](_0x1b8d40[_0x170e('0x3c')],qs[_0x170e('0x42')](_0x2f4638['query'][_0x170e('0x42')]));_0x461766[_0x170e('0x41')]=_0x461766[_0x170e('0x41')][_0x170e('0x43')]?_0x461766[_0x170e('0x41')]:_0x1b8d40[_0x170e('0x3c')];if(_0x2f4638[_0x170e('0x39')][_0x170e('0x44')]){_0x461766[_0x170e('0x45')]=[{'all':!![]}];}_0x461766=_[_0x170e('0x2b')]({},_0x461766,_0x2f4638[_0x170e('0x46')]);return db[_0x170e('0x3e')]['find'](_0x461766)['then'](handleEntityNotFound(_0x496793,null))['then'](respondWithResult(_0x496793,null))[_0x170e('0x1e')](handleError(_0x496793,null));};exports[_0x170e('0x47')]=function(_0x11fc40,_0x447441){return db[_0x170e('0x3e')][_0x170e('0x47')](_0x11fc40[_0x170e('0x2c')],{})[_0x170e('0x14')](respondWithResult(_0x447441,0xc9))[_0x170e('0x1e')](handleError(_0x447441,null));};exports[_0x170e('0x24')]=function(_0x3b224b,_0x589a0a){if(_0x3b224b[_0x170e('0x2c')]['id']){delete _0x3b224b['body']['id'];}return db['ChatInteraction'][_0x170e('0x48')]({'where':{'id':_0x3b224b[_0x170e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x589a0a,null))[_0x170e('0x14')](saveUpdates(_0x3b224b[_0x170e('0x2c')],null))[_0x170e('0x14')](respondWithResult(_0x589a0a,null))[_0x170e('0x1e')](handleError(_0x589a0a,null));};exports[_0x170e('0x25')]=function(_0x3749d0,_0x129e16){return db['ChatInteraction']['find']({'where':{'id':_0x3749d0[_0x170e('0x3b')]['id']}})[_0x170e('0x14')](handleEntityNotFound(_0x129e16,null))[_0x170e('0x14')](removeEntity(_0x129e16,null))[_0x170e('0x1e')](handleError(_0x129e16,null));};exports['describe']=function(_0x281f50,_0x3a0fee){return db['ChatInteraction'][_0x170e('0x49')]()[_0x170e('0x14')](respondWithResult(_0x3a0fee,null))[_0x170e('0x1e')](handleError(_0x3a0fee,null));};exports[_0x170e('0x4a')]=function(_0x2986e3,_0xf992a7){var _0x4f1b41=_0x2986e3['params']['id'];var _0x5bc945;var _0x486e1e;var _0xa8061;return db[_0x170e('0x3e')][_0x170e('0x4b')]({'where':{'id':_0x4f1b41}})['then'](function(_0x1654cc){_0x5bc945=_0x1654cc;return db['ChatWebsite'][_0x170e('0x4b')]({'where':{'id':_0x1654cc['ChatWebsiteId']},'attributes':['id',_0x170e('0x4c'),_0x170e('0x4d'),_0x170e('0x4e'),_0x170e('0x4f'),_0x170e('0x50')],'raw':!![]});})[_0x170e('0x14')](function(_0x169cc2){if(_0x169cc2&&_0x169cc2[_0x170e('0x4c')]&&_0x169cc2['vidaooEscalation']){_0x486e1e=_0x169cc2;var _0x5a50c3={'interaction':{'id':_0x4f1b41},'agent':{'id':_0x2986e3['user']['id'],'name':_0x2986e3[_0x170e('0x51')]['name'],'fullname':_0x2986e3[_0x170e('0x51')][_0x170e('0x52')],'email':_0x2986e3[_0x170e('0x51')][_0x170e('0x53')]},'contact':_0x2986e3[_0x170e('0x2c')][_0x170e('0x2d')],'account':_0x2986e3[_0x170e('0x2c')][_0x170e('0x30')]};var _0x21860c={'rejectUnauthorized':![],'method':_0x170e('0x54'),'url':_0x170e('0x55'),'headers':{'X-APIKEY':_0x169cc2[_0x170e('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2986e3[_0x170e('0x51')][_0x170e('0x53')]],'buttons':null,'topic':_0x486e1e[_0x170e('0x4e')],'note':_['isNull'](_0x486e1e['vidaooNote'])?null:getMustacheRender(_0x486e1e[_0x170e('0x4f')],_0x5a50c3),'metadata':null},'redirect':_0x170e('0x56'),'json':!![]};try{if(!_['isNull'](_0x486e1e[_0x170e('0x50')])){var _0x5c1f5f=getMustacheRender(_0x486e1e[_0x170e('0x50')],_0x5a50c3);var _0x1ebc34=JSON[_0x170e('0x57')](_0x5c1f5f);_0x21860c[_0x170e('0x2c')][_0x170e('0x58')]=_0x1ebc34;}}catch(_0x27be7e){throw new db[(_0x170e('0x59'))][(_0x170e('0x5a'))](_0x170e('0x5b'));}return rp(_0x21860c);}else{throw new db[(_0x170e('0x59'))][(_0x170e('0x5a'))](_0x170e('0x5c'));}})[_0x170e('0x14')](function(_0x27e4cf){_0xa8061=_0x27e4cf;if(_0xa8061['id']){var _0x1c0d0b={'body':_0xa8061[_0x170e('0x5d')],'ChatWebsiteId':_0x486e1e['id'],'ChatInteractionId':_0x5bc945['id'],'direction':_0x170e('0x5e'),'UserId':_0x2986e3[_0x170e('0x51')]['id']};return db[_0x170e('0x5f')][_0x170e('0x47')](_0x1c0d0b,{});}else{throw new db['Sequelize'][(_0x170e('0x5a'))](_0x170e('0x60'));}})[_0x170e('0x14')](function(){return _0x5bc945[_0x170e('0x61')]({'vidaooSessionId':_0xa8061['id']});})['then'](respondWithResult(_0xf992a7,null))['catch'](handleError(_0xf992a7,null));};exports[_0x170e('0x62')]=function(_0x33711c,_0xfdee2d){if(_0x33711c[_0x170e('0x2c')]['id']){delete _0x33711c['body']['id'];}return db[_0x170e('0x3e')]['find']({'where':{'id':_0x33711c[_0x170e('0x3b')]['id']},'include':[{'model':db['CmContact'],'as':_0x170e('0x63')}]})[_0x170e('0x14')](handleEntityNotFound(_0xfdee2d,null))[_0x170e('0x14')](saveUpdates(_0x33711c['body'],null))[_0x170e('0x14')](respondWithResult(_0xfdee2d,null))[_0x170e('0x1e')](handleError(_0xfdee2d,null));};exports['abandon']=function(_0x270259,_0x2aab5e){if(_0x270259[_0x170e('0x2c')]['id']){delete _0x270259[_0x170e('0x2c')]['id'];}return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0x270259[_0x170e('0x3b')]['id']}})['then'](function(_0x258b07){if(!_0x258b07){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x170e('0x64'),0x194,_0x170e('0x65'));_0x2aab5e[_0x170e('0x27')](0x194);}else{if(_0x258b07[_0x170e('0x66')]){throw new db[(_0x170e('0x59'))][(_0x170e('0x5a'))](_0x170e('0x67'));}}return _0x258b07;})[_0x170e('0x14')](function(_0x309d03){if(_0x309d03){return _0x309d03[_0x170e('0x24')]({'closed':_0x270259[_0x170e('0x2c')][_0x170e('0x68')],'disposition':_0x270259[_0x170e('0x2c')][_0x170e('0x69')]})[_0x170e('0x14')](function(_0x852d8){return _0x852d8;});}})[_0x170e('0x14')](function(){return respondWithRpcPromise('AbandonInteraction',_0x170e('0x64'),_0x270259[_0x170e('0x2c')],client9004);})[_0x170e('0x14')](respondWithResult(_0x2aab5e,null))[_0x170e('0x1e')](handleError(_0x2aab5e,null));};exports[_0x170e('0x6a')]=function(_0x7b1011,_0xf6a202){_0x7b1011[_0x170e('0x2c')]['name']=_0x7b1011[_0x170e('0x6b')]['originalname'];_0x7b1011['body'][_0x170e('0x6c')]=_0x7b1011['file'][_0x170e('0x6d')];_0x7b1011[_0x170e('0x2c')]['type']=_0x7b1011[_0x170e('0x6b')][_0x170e('0x6e')];return db['Attachment'][_0x170e('0x47')](_0x7b1011[_0x170e('0x2c')])[_0x170e('0x14')](respondWithResult(_0xf6a202,0xc9))['catch'](handleError(_0xf6a202,null));};exports['attachmentDownload']=function(_0x58a11b,_0x26e291){return db[_0x170e('0x3e')][_0x170e('0x4b')]({'where':{'id':_0x58a11b[_0x170e('0x3b')]['id']},'raw':!![]})[_0x170e('0x14')](handleEntityNotFound(_0x26e291,null))[_0x170e('0x14')](function(_0x15aeab){if(_0x15aeab){if(_0x15aeab[_0x170e('0x68')]){return _0x26e291[_0x170e('0x1f')](0x193)['json']({'status':0x193,'message':_0x170e('0x6f')});}return db[_0x170e('0x70')][_0x170e('0x4b')]({'where':{'id':_0x58a11b[_0x170e('0x39')][_0x170e('0x71')]},'raw':!![]})['then'](handleEntityNotFound(_0x26e291,null));}})[_0x170e('0x14')](function(_0x1cf558){if(_0x1cf558){var _0x3538b5=_0x1cf558[_0x170e('0x72')]!==null;var _0xefd4c3=path['join'](config[_0x170e('0x73')],_0x170e('0x74'));if(_0x3538b5){_0xefd4c3=path[_0x170e('0x75')](_0xefd4c3,_0x170e('0x76'));}var _0x27c0f3=path[_0x170e('0x75')](_0xefd4c3,_0x1cf558['basename']);return _0x26e291[_0x170e('0x77')](_0x27c0f3);}})[_0x170e('0x1e')](handleError(_0x26e291,null));};exports[_0x170e('0x78')]=function(_0x4a5f73,_0x3a1aa6){var _0x4747d4=null;var _0x1e1c6e=null;var _0x1ee0f3=null;if(_0x4a5f73[_0x170e('0x2c')]['id']){delete _0x4a5f73[_0x170e('0x2c')]['id'];}if(_0x4a5f73[_0x170e('0x2c')][_0x170e('0x79')]){_0x1ee0f3=path[_0x170e('0x75')](config[_0x170e('0x73')],_0x170e('0x7a'),util['format'](_0x170e('0x7b'),Date['now']()));_0x4a5f73[_0x170e('0x2c')][_0x170e('0x7c')]=_0x1ee0f3;}return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0x4a5f73[_0x170e('0x3b')]['id']},'include':[{'model':db[_0x170e('0x5f')],'as':_0x170e('0x7d'),'include':[{'model':db[_0x170e('0x7e')],'as':_0x170e('0x7e')}]}]})[_0x170e('0x14')](handleEntityNotFound(_0x3a1aa6,null))[_0x170e('0x14')](saveUpdates(_0x4a5f73[_0x170e('0x2c')],null))[_0x170e('0x14')](function(_0x2333ae){if(_0x2333ae){_0x4747d4=_0x2333ae;return db['ChatWebsite'][_0x170e('0x48')]({'where':{'id':_0x4747d4[_0x170e('0x7f')]}});}})[_0x170e('0x14')](function(_0x44d68f){if(_0x44d68f){_0x1e1c6e=_0x44d68f;return db['CmContact'][_0x170e('0x48')]({'where':{'id':_0x4747d4[_0x170e('0x80')]}});}})[_0x170e('0x14')](function(_0x288c72){if(_0x288c72){if(_0x1ee0f3){var _0x4481e6=null;for(var _0xa2abaa=0x1;_0xa2abaa<_0x4747d4[_0x170e('0x7d')][_0x170e('0x43')];++_0xa2abaa){_0x4481e6=_0x4747d4[_0x170e('0x7d')][_0xa2abaa];var _0x389e1c=_0x4481e6['UserId']?util[_0x170e('0x81')]('%s%d',_0x1e1c6e[_0x170e('0x82')],_0x4481e6[_0x170e('0x66')]):'System';var _0x68e882=_0x4a5f73[_0x170e('0x2c')][_0x170e('0x83')]||util[_0x170e('0x81')](_0x170e('0x84'),_0x170e('0x85'),_0x4481e6[_0x170e('0x80')]);switch(_0x1e1c6e[_0x170e('0x86')]){case _0x170e('0x87'):_0x389e1c=_0x4481e6[_0x170e('0x66')]?util[_0x170e('0x81')](_0x170e('0x84'),_0x1e1c6e[_0x170e('0x82')],_0x4481e6['UserId']):_0x170e('0x88');break;case _0x170e('0x89'):_0x389e1c=_0x4481e6[_0x170e('0x66')]?_0x4481e6[_0x170e('0x7e')]['alias']||_0x4481e6['User'][_0x170e('0x52')]:_0x170e('0x88');break;case'agent_fullname':_0x389e1c=_0x4481e6['UserId']?_0x4481e6[_0x170e('0x7e')][_0x170e('0x52')]:_0x170e('0x88');break;default:_0x389e1c=_0x4481e6[_0x170e('0x66')]?util[_0x170e('0x81')](_0x170e('0x84'),_0x1e1c6e[_0x170e('0x82')],_0x4481e6[_0x170e('0x66')]):_0x170e('0x88');}var _0x1172bb=util[_0x170e('0x81')](_0x170e('0x8a'),moment(_0x4481e6[_0x170e('0x8b')])[_0x170e('0x81')]('MM/DD/YYYY\x20HH:mm:ss'),_0x4481e6[_0x170e('0x8c')]==='in'?_0x68e882:_0x389e1c,_0x4481e6['body']);if(!_0x4481e6['secret']){fs[_0x170e('0x8d')](_0x1ee0f3,_0x1172bb);}}return db[_0x170e('0x8e')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x170e('0x8f')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x170e('0x90'),'raw':!![]}]}]});}}})['then'](function(_0x5e37ff){if(!_0x5e37ff||!_0x5e37ff[_0x170e('0x91')]||!_0x4a5f73[_0x170e('0x2c')])return _0x4747d4;var _0xf150e7=_0x5e37ff[_0x170e('0x92')]();return respondWithRpcPromise(_0x170e('0x93'),'sendMail',{'account':_0xf150e7,'message':{'from':util[_0x170e('0x81')](_0x170e('0x94'),_0x5e37ff[_0x170e('0x29')],_0x5e37ff[_0x170e('0x53')]||_0x5e37ff['Smtp'][_0x170e('0x51')]),'to':_0x4a5f73[_0x170e('0x2c')][_0x170e('0x79')],'subject':_0x170e('0x95'),'text':util[_0x170e('0x81')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x4a5f73[_0x170e('0x2c')][_0x170e('0x79')]),'attachments':[{'path':_0x1ee0f3}]}})['then'](function(){return _0x4747d4;})['catch'](function(_0x3c36cf){logger['error'](_0x3c36cf);});})['then'](respondWithStatusCode(_0x3a1aa6,0xc8))['catch'](handleError(_0x3a1aa6,null));};exports[_0x170e('0x96')]=function(_0x56e189,_0x44c952){return db['ChatMessage'][_0x170e('0x48')]({'where':{'id':_0x56e189[_0x170e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x44c952,null))[_0x170e('0x14')](function(_0x4e6e14){if(_0x4e6e14){return _0x4e6e14[_0x170e('0x96')](_0x56e189['body']['ids'],_[_0x170e('0x97')](_0x56e189['body'],['ids','id'])||{});}})[_0x170e('0x14')](respondWithResult(_0x44c952,null))[_0x170e('0x1e')](handleError(_0x44c952,null));};exports[_0x170e('0x98')]=function(_0x3fc59c,_0x5b1925){var _0x2df274={'raw':![],'where':{}};var _0x44acfb={};var _0x1a1acb={'count':0x0,'rows':[]};return db[_0x170e('0x3e')][_0x170e('0x4b')]({'where':{'id':_0x3fc59c['params']['id']}})['then'](handleEntityNotFound(_0x5b1925,null))[_0x170e('0x14')](function(_0x1395f3){if(_0x1395f3){_0x44acfb[_0x170e('0x3c')]=_[_0x170e('0x3d')](db[_0x170e('0x5f')][_0x170e('0x33')]);_0x44acfb[_0x170e('0x39')]=_[_0x170e('0x3d')](_0x3fc59c[_0x170e('0x39')]);_0x44acfb[_0x170e('0x3f')]=_[_0x170e('0x40')](_0x44acfb[_0x170e('0x3c')],_0x44acfb['query']);_0x2df274[_0x170e('0x41')]=_['intersection'](_0x44acfb[_0x170e('0x3c')],qs[_0x170e('0x42')](_0x3fc59c[_0x170e('0x39')][_0x170e('0x42')]));_0x2df274[_0x170e('0x41')]=_0x2df274['attributes']['length']?_0x2df274[_0x170e('0x41')]:_0x44acfb[_0x170e('0x3c')];if(!_0x3fc59c[_0x170e('0x39')][_0x170e('0x99')](_0x170e('0x9a'))){_0x2df274[_0x170e('0x22')]=qs[_0x170e('0x22')](_0x3fc59c[_0x170e('0x39')][_0x170e('0x22')]);_0x2df274[_0x170e('0x20')]=qs[_0x170e('0x20')](_0x3fc59c['query']['offset']);}_0x2df274[_0x170e('0x9b')]=qs['sort'](_0x3fc59c[_0x170e('0x39')]['sort']);_0x2df274[_0x170e('0x9c')]=qs[_0x170e('0x3f')](_[_0x170e('0x9d')](_0x3fc59c[_0x170e('0x39')],_0x44acfb[_0x170e('0x3f')]));_0x2df274[_0x170e('0x9c')][_0x170e('0x9e')]=_0x1395f3['id'];if(_0x3fc59c['query'][_0x170e('0x9f')]){_0x2df274[_0x170e('0x9c')]=_['merge'](_0x2df274[_0x170e('0x9c')],{'$or':_['map'](_0x2df274[_0x170e('0x41')],function(_0x826f57){var _0x40ce4e={};_0x40ce4e[_0x826f57]={'$like':'%'+_0x3fc59c[_0x170e('0x39')][_0x170e('0x9f')]+'%'};return _0x40ce4e;})});}if(_0x3fc59c[_0x170e('0x39')][_0x170e('0xa0')]){var _0x5a4c25=_0x3fc59c[_0x170e('0x39')][_0x170e('0xa0')]['split'](',');var _0x421626={};_0x421626[_0x5a4c25[0x0]]={'$gte':moment(_0x5a4c25[0x1])[_0x170e('0x81')](_0x170e('0xa1'))};_0x2df274[_0x170e('0x9c')]=_[_0x170e('0x2b')](_0x2df274[_0x170e('0x9c')],_0x421626);}_0x2df274=_[_0x170e('0x2b')]({},_0x2df274,_0x3fc59c[_0x170e('0x46')]);return db[_0x170e('0x5f')][_0x170e('0x23')]({'where':_0x2df274[_0x170e('0x9c')]})['then'](function(_0x411b6e){_0x1a1acb[_0x170e('0x23')]=_0x411b6e;if(_0x3fc59c[_0x170e('0x39')]['includeAll']){_0x2df274[_0x170e('0x45')]=[{'all':!![]}];}return db['ChatMessage'][_0x170e('0x37')](_0x2df274);})[_0x170e('0x14')](function(_0x373ab8){_0x1a1acb[_0x170e('0xa2')]=_0x373ab8;return _0x1a1acb;});}})[_0x170e('0x14')](respondWithFilteredResult(_0x5b1925,_0x2df274))[_0x170e('0x1e')](handleError(_0x5b1925,null));};exports['getMyMessages']=function(_0x3729ec,_0x32d3c7){var _0x582b7a={'where':{}},_0x3a1f0c={},_0x1350a6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x170e('0x4b')]({'where':{'id':_0x3729ec[_0x170e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x32d3c7,null))[_0x170e('0x14')](function(_0x1f0933){if(_0x1f0933){_0x3a1f0c[_0x170e('0x3c')]=_['keys'](db[_0x170e('0x5f')][_0x170e('0x33')]);_0x3a1f0c[_0x170e('0x39')]=_['keys'](_0x3729ec['query']);_0x3a1f0c['filters']=_['intersection'](_0x3a1f0c[_0x170e('0x3c')],_0x3a1f0c['query']);_0x582b7a[_0x170e('0x41')]=_[_0x170e('0x40')](_0x3a1f0c[_0x170e('0x3c')],qs['fields'](_0x3729ec[_0x170e('0x39')][_0x170e('0x42')]));_0x582b7a['attributes']=_0x582b7a['attributes'][_0x170e('0x43')]?_0x582b7a[_0x170e('0x41')]:_0x3a1f0c['model'];if(!_0x3729ec['query']['hasOwnProperty'](_0x170e('0x9a'))){_0x582b7a[_0x170e('0x22')]=qs['limit'](_0x3729ec[_0x170e('0x39')][_0x170e('0x22')]);_0x582b7a[_0x170e('0x20')]=qs[_0x170e('0x20')](_0x3729ec[_0x170e('0x39')]['offset']);}_0x582b7a[_0x170e('0x9b')]=qs[_0x170e('0xa3')](_0x3729ec[_0x170e('0x39')][_0x170e('0xa3')]);_0x582b7a[_0x170e('0x9c')]=qs[_0x170e('0x3f')](_[_0x170e('0x9d')](_0x3729ec[_0x170e('0x39')],_0x3a1f0c[_0x170e('0x3f')]));_0x582b7a[_0x170e('0x9c')][_0x170e('0x9e')]=_0x1f0933['id'];if(_0x3729ec[_0x170e('0x39')][_0x170e('0x9f')]){_0x582b7a[_0x170e('0x9c')]=_['merge'](_0x582b7a[_0x170e('0x9c')],{'$or':_[_0x170e('0x32')](_0x582b7a[_0x170e('0x41')],function(_0x529e38){var _0x523532={};_0x523532[_0x529e38]={'$like':'%'+_0x3729ec[_0x170e('0x39')][_0x170e('0x9f')]+'%'};return _0x523532;})});}_0x582b7a['where'][_0x170e('0xa4')]=![];if(_0x3729ec[_0x170e('0x39')]['id']){_0x582b7a[_0x170e('0x9c')]['id']={'$gt':_0x3729ec['query']['id']};}_0x582b7a=_['merge']({},_0x582b7a,_0x3729ec[_0x170e('0x46')]);return db['ChatMessage'][_0x170e('0x23')]({'where':_0x582b7a['where']})[_0x170e('0x14')](function(_0x100d0c){_0x1350a6[_0x170e('0x23')]=_0x100d0c;_0x582b7a[_0x170e('0x45')]=[];if(_0x3729ec['query'][_0x170e('0xa5')]){_0x582b7a[_0x170e('0x45')][_0x170e('0xa6')]({'model':db[_0x170e('0x7e')],'as':'User','attributes':['id','fullname','alias']});}if(_0x3729ec[_0x170e('0x39')][_0x170e('0x44')]){_0x582b7a[_0x170e('0x45')]=[{'all':!![]}];}return db[_0x170e('0x5f')][_0x170e('0x37')](_0x582b7a);})[_0x170e('0x14')](function(_0x1e0496){_0x1350a6['rows']=_0x1e0496;return _0x1350a6;});}})[_0x170e('0x14')](respondWithFilteredResult(_0x32d3c7,_0x582b7a))[_0x170e('0x1e')](handleError(_0x32d3c7,null));};exports[_0x170e('0xa7')]=function(_0x5dee75,_0x13fd57){return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0x5dee75[_0x170e('0x3b')]['id']}})[_0x170e('0x14')](handleEntityNotFound(_0x13fd57,null))[_0x170e('0x14')](function(_0x2b86cd){if(_0x2b86cd){return _0x2b86cd[_0x170e('0xa8')](_0x5dee75[_0x170e('0x2c')][_0x170e('0xa9')],_[_0x170e('0x97')](_0x5dee75[_0x170e('0x2c')],[_0x170e('0xa9'),'id'])||{})[_0x170e('0xaa')](function(){return db[_0x170e('0xab')][_0x170e('0x37')]({'attributes':['id',_0x170e('0x29'),_0x170e('0xac')],'where':{'id':_0x5dee75['body'][_0x170e('0xa9')]}});})[_0x170e('0x14')](function(_0xbf958c){socket['emit'](_0x170e('0xad'),{'id':Number(_0x5dee75[_0x170e('0x3b')]['id']),'tags':_0xbf958c||[]});return{'id':Number(_0x5dee75[_0x170e('0x3b')]['id']),'tags':_0xbf958c||[]};});}})[_0x170e('0x14')](respondWithResult(_0x13fd57,null))[_0x170e('0x1e')](handleError(_0x13fd57,null));};exports[_0x170e('0xae')]=function(_0x2f614b,_0x1f1c8c){return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0x2f614b[_0x170e('0x3b')]['id']}})[_0x170e('0x14')](handleEntityNotFound(_0x1f1c8c,null))[_0x170e('0x14')](function(_0x210b81){if(_0x210b81){return _0x210b81[_0x170e('0xae')](_0x2f614b[_0x170e('0x39')]['ids']);}})[_0x170e('0x14')](respondWithStatusCode(_0x1f1c8c,null))[_0x170e('0x1e')](handleError(_0x1f1c8c,null));};exports[_0x170e('0x77')]=function(_0xa7daad,_0x28d0e7){var _0x510ea7=moment()['unix']()['toString']();var _0xcbb72b=path[_0x170e('0x75')](config[_0x170e('0x73')],_0x170e('0xaf'),_0x170e('0xb0'),_0x170e('0xb1'));var _0x528260=path[_0x170e('0x75')](config[_0x170e('0x73')],_0x170e('0xaf'),_0x170e('0xb0'),_0x170e('0xb2'));var _0x2e3a23=path[_0x170e('0x75')](_0xcbb72b,_0x510ea7);var _0x5c7e7c=util[_0x170e('0x81')](_0x170e('0xb3'),_0xa7daad[_0x170e('0x3b')]['id'],_0x510ea7);var _0x15becc=path['join'](_0xcbb72b,_0x5c7e7c);var _0x48254b=[];_0x48254b[_0x170e('0xa6')]({'model':db[_0x170e('0x7e')],'as':'User','attributes':['id',_0x170e('0x52')],'raw':!![]});_0x48254b['push']({'model':db[_0x170e('0xb4')],'as':'Contact','attributes':['id',_0x170e('0xb5'),_0x170e('0xb6')],'raw':!![]});if(_0xa7daad[_0x170e('0x39')]['attachments']){_0x48254b[_0x170e('0xa6')]({'model':db[_0x170e('0x70')],'as':_0x170e('0x70'),'raw':!![]});}var _0x556a05=[{'model':db[_0x170e('0x5f')],'as':'Messages','attributes':['id',_0x170e('0x2c'),_0x170e('0x8b'),_0x170e('0x8c'),'secret','read'],'include':_0x48254b}];_0x556a05[_0x170e('0xa6')]({'model':db[_0x170e('0xb7')],'as':'Account','attributes':['id',_0x170e('0x29')]});_0x556a05[_0x170e('0xa6')]({'model':db['User'],'as':_0x170e('0xb8'),'attributes':['id',_0x170e('0x52')]});return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0xa7daad[_0x170e('0x3b')]['id']},'include':_0x556a05})[_0x170e('0x14')](handleEntityNotFound(_0x28d0e7,null))[_0x170e('0x14')](function(_0x204445){if(_0x204445){var _0x536061=_0x204445[_0x170e('0xb9')]({'plain':!![]});fs[_0x170e('0xba')](_0x2e3a23);var _0x23bc71={'channel':_0x170e('0xbb'),'account':_0x536061[_0x170e('0xbc')][_0x170e('0x29')],'agent':_0x536061[_0x170e('0xb8')]?_0x536061[_0x170e('0xb8')]['fullname']:'N.A.','createdAt':moment(_0x536061[_0x170e('0x8b')])[_0x170e('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0x170e('0xbd')](),'closedAt':_0x536061[_0x170e('0x68')]?moment(_0x536061[_0x170e('0xbe')])[_0x170e('0x81')](_0x170e('0xa1'))[_0x170e('0xbd')]():'','disposition':_0x536061['disposition'],'chatInfo':{'browser':_0x536061[_0x170e('0xbf')],'os':_0x536061[_0x170e('0xc0')],'referer':_0x536061[_0x170e('0xc1')],'customerIp':_0x536061['customerIp'],'customerPort':_0x536061[_0x170e('0xc2')]?_0x536061[_0x170e('0xc2')]:_0x170e('0xc3')},'messages':_(_0x536061[_0x170e('0x7d')])[_0x170e('0xc4')]()[_0x170e('0x9f')]({'secret':![]})[_0x170e('0x32')](function(_0x324c33){if(_0x324c33[_0x170e('0x70')]){var _0x7aca0=path[_0x170e('0x75')](_0x528260,_0x324c33[_0x170e('0x70')]['basename']);if(fs[_0x170e('0xc5')](_0x7aca0)){fs[_0x170e('0xc6')](_0x7aca0)[_0x170e('0xc7')](fs[_0x170e('0xc8')](path[_0x170e('0x75')](_0x2e3a23,_0x324c33[_0x170e('0x70')]['basename'])));}}return{'date':moment(_0x324c33[_0x170e('0x8b')])[_0x170e('0x81')](_0x170e('0xa1'))['toString'](),'sender':_0x324c33[_0x170e('0x8c')]===_0x170e('0x5e')?_0x324c33[_0x170e('0x7e')]?_0x324c33[_0x170e('0x7e')]['fullname']:_0x170e('0x88'):_0x324c33[_0x170e('0x63')]['firstName']+(_0x324c33['Contact'][_0x170e('0xb6')]?'\x20'+_0x324c33[_0x170e('0x63')][_0x170e('0xb6')]:''),'body':_0x324c33['Attachment']?_0x324c33[_0x170e('0x70')][_0x170e('0x6c')]:_0x324c33[_0x170e('0x2c')],'direction':_0x324c33[_0x170e('0x8c')]===_0x170e('0x5e')?'A':'C','secret':_0x324c33[_0x170e('0xa4')],'read':_0x324c33[_0x170e('0xc9')],'attachment':_0x324c33[_0x170e('0x70')]};})[_0x170e('0xca')]()};return ejs[_0x170e('0xcb')](path[_0x170e('0x75')](config['root'],_0x170e('0xaf'),_0x170e('0xcc'),'downloadInteraction.ejs'),{'interaction':_0x23bc71})['then'](function(_0x4eb17f){var _0x3f6497=path[_0x170e('0x75')](_0x2e3a23,_0x170e('0xcd')+_0x536061['id']+'-'+_0x510ea7+_0x170e('0xce'));var _0x1be69d={'path':_0x3f6497,'channel':'Chat','interactionId':_0x536061['id']};return pdf['createPdfFromHTML'](_0x4eb17f,_0x1be69d);})['then'](function(){return new Promise(function(_0x445359,_0x51ec03){zipdir(_0x2e3a23,{'saveTo':_0x15becc},function(_0x315b9f,_0x2b17ce){if(_0x315b9f)return _0x51ec03(_0x315b9f);return _0x445359(_0x2b17ce);});})[_0x170e('0x14')](function(){return new BPromise(function(_0x535edb,_0x36a053){rimraf(_0x2e3a23,function(_0x5bc016){if(_0x5bc016)_0x36a053(_0x5bc016);return _0x535edb();});});})[_0x170e('0x14')](function(){return _0x28d0e7[_0x170e('0x77')](_0x15becc,_0x5c7e7c,function(_0x1933f3){if(_0x1933f3){logger['error'](_0x170e('0xcf'),_0x1933f3);}else{fs[_0x170e('0xd0')](_0x15becc);}});});});}else{return _0x28d0e7['sendStatus'](0xc8);}})[_0x170e('0x1e')](handleError(_0x28d0e7,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 77d7837..5833d48 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 _0xe714=['getUsers','setDataValue','Users','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove'];(function(_0x313112,_0x4af4a4){var _0x422beb=function(_0x545c94){while(--_0x545c94){_0x313112['push'](_0x313112['shift']());}};_0x422beb(++_0x4af4a4);}(_0xe714,0xad));var _0x4e71=function(_0x1f9426,_0x4d0b55){_0x1f9426=_0x1f9426-0x0;var _0xd40e25=_0xe714[_0x1f9426];return _0xd40e25;};'use strict';var EventEmitter=require(_0x4e71('0x0'));var ChatInteraction=require(_0x4e71('0x1'))['db'][_0x4e71('0x2')];var ChatMessage=require(_0x4e71('0x1'))['db'][_0x4e71('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4e71('0x4')](0x0);var events={'afterCreate':_0x4e71('0x5'),'afterUpdate':'update','afterDestroy':_0x4e71('0x6')};function emitEvent(_0x4f297f){return function(_0x47d817,_0x3b0084,_0x232a3e){_0x47d817[_0x4e71('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x37bf78){_0x47d817[_0x4e71('0x8')](_0x4e71('0x9'),_0x37bf78['map'](function(_0x734cc){return{'id':_0x734cc['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x47d817['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4e71('0xa')](function(_0x5c2c9a){_0x47d817['setDataValue'](_0x4e71('0xb'),_0x5c2c9a[_0x4e71('0xc')]);ChatInteractionEvents[_0x4e71('0xd')](_0x4f297f+':'+_0x47d817['id'],_0x47d817);ChatInteractionEvents[_0x4e71('0xd')](_0x4f297f,_0x47d817);_0x232a3e(null);})[_0x4e71('0xe')](_0x232a3e(null));};}for(var e in events){if(events[_0x4e71('0xf')](e)){var event=events[e];ChatInteraction[_0x4e71('0x10')](e,emitEvent(event));}}module[_0x4e71('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0xb67d=['findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','then','setDataValue','map'];(function(_0x2f10e3,_0x5018fe){var _0x37264=function(_0x6e2ce1){while(--_0x6e2ce1){_0x2f10e3['push'](_0x2f10e3['shift']());}};_0x37264(++_0x5018fe);}(_0xb67d,0x116));var _0xdb67=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb67d[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0xdb67('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xdb67('0x1')];var ChatMessage=require(_0xdb67('0x2'))['db'][_0xdb67('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdb67('0x4')](0x0);var events={'afterCreate':_0xdb67('0x5'),'afterUpdate':_0xdb67('0x6'),'afterDestroy':'remove'};function emitEvent(_0x293dcb){return function(_0x990fca,_0x1f085d,_0x292cca){_0x990fca['getUsers']({'attributes':['id'],'raw':!![]})[_0xdb67('0x7')](function(_0x10fb08){_0x990fca[_0xdb67('0x8')]('Users',_0x10fb08[_0xdb67('0x9')](function(_0x7b2620){return{'id':_0x7b2620['id']};}));return ChatMessage[_0xdb67('0xa')]({'where':{'ChatInteractionId':_0x990fca['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdb67('0x7')](function(_0x2ab672){_0x990fca['setDataValue'](_0xdb67('0xb'),_0x2ab672[_0xdb67('0xc')]);ChatInteractionEvents['emit'](_0x293dcb+':'+_0x990fca['id'],_0x990fca);ChatInteractionEvents[_0xdb67('0xd')](_0x293dcb,_0x990fca);_0x292cca(null);})['catch'](_0x292cca(null));};}for(var e in events){if(events[_0xdb67('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xdb67('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index d71efb7..e6b26a7 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 _0x3e2c=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird'];(function(_0x19c967,_0x4d538e){var _0x386e76=function(_0x5678e8){while(--_0x5678e8){_0x19c967['push'](_0x19c967['shift']());}};_0x386e76(++_0x4d538e);}(_0x3e2c,0x1b6));var _0xc3e2=function(_0x23b7e4,_0x1c9417){_0x23b7e4=_0x23b7e4-0x0;var _0x40d91b=_0x3e2c[_0x23b7e4];return _0x40d91b;};'use strict';var _=require(_0xc3e2('0x0'));var util=require(_0xc3e2('0x1'));var logger=require(_0xc3e2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc3e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3e2('0x4'));var rimraf=require(_0xc3e2('0x5'));var config=require(_0xc3e2('0x6'));var attributes=require(_0xc3e2('0x7'));module[_0xc3e2('0x8')]=function(_0xfffadc,_0x3e4644){return _0xfffadc['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a095a,_0x37bff2,_0x4f87bc){if(_0x1a095a['changed'](_0xc3e2('0x9'))){_0x1a095a[_0xc3e2('0xa')]=moment()[_0xc3e2('0xb')](_0xc3e2('0xc'));}_0x4f87bc(null,_0x1a095a);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xaefa=['closedAt','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed'];(function(_0x51c343,_0xf63b5){var _0x4d3855=function(_0x55721a){while(--_0x55721a){_0x51c343['push'](_0x51c343['shift']());}};_0x4d3855(++_0xf63b5);}(_0xaefa,0x64));var _0xaaef=function(_0x386c03,_0x32b041){_0x386c03=_0x386c03-0x0;var _0x4806fa=_0xaefa[_0x386c03];return _0x4806fa;};'use strict';var _=require('lodash');var util=require(_0xaaef('0x0'));var logger=require(_0xaaef('0x1'))('api');var moment=require(_0xaaef('0x2'));var BPromise=require(_0xaaef('0x3'));var rp=require(_0xaaef('0x4'));var fs=require('fs');var path=require(_0xaaef('0x5'));var rimraf=require('rimraf');var config=require(_0xaaef('0x6'));var attributes=require(_0xaaef('0x7'));module[_0xaaef('0x8')]=function(_0x54b113,_0x260933){return _0x54b113[_0xaaef('0x9')](_0xaaef('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x800f18,_0x1f0b5a,_0x29659){if(_0x800f18[_0xaaef('0xb')]('closed')){_0x800f18[_0xaaef('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x29659(null,_0x800f18);}},'charset':'utf8mb4','collate':_0xaaef('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 72fd8d1..040937b 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 _0x9f0e=['defaults','localhost','socket.io-emitter','./chatInteraction.socket','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','then','debug','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis'];(function(_0x38709e,_0x674239){var _0x5b4fa3=function(_0x132443){while(--_0x132443){_0x38709e['push'](_0x38709e['shift']());}};_0x5b4fa3(++_0x674239);}(_0x9f0e,0x115));var _0xe9f0=function(_0x2fce43,_0x1d9626){_0x2fce43=_0x2fce43-0x0;var _0x537102=_0x9f0e[_0x2fce43];return _0x537102;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe9f0('0x0'));var BPromise=require(_0xe9f0('0x1'));var rs=require(_0xe9f0('0x2'));var fs=require('fs');var Redis=require(_0xe9f0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x4'));var logger=require('../../config/logger')(_0xe9f0('0x5'));var config=require('../../config/environment');var jayson=require(_0xe9f0('0x6'));var client=jayson[_0xe9f0('0x7')][_0xe9f0('0x8')]({'port':0x232a});config[_0xe9f0('0x9')]=_[_0xe9f0('0xa')](config[_0xe9f0('0x9')],{'host':_0xe9f0('0xb'),'port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config['redis']));require(_0xe9f0('0xd'))['register'](socket);function respondWithRpcPromise(_0x242147,_0x5ce997,_0x2c688d){return new BPromise(function(_0x25533b,_0x2cbd7d){return client['request'](_0x242147,_0x2c688d)['then'](function(_0x2f9d7b){logger[_0xe9f0('0xe')](_0xe9f0('0xf'),_0x5ce997,_0xe9f0('0x10'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5ce997,'request\x20sent',JSON['stringify'](_0x2f9d7b));if(_0x2f9d7b[_0xe9f0('0x11')]){if(_0x2f9d7b[_0xe9f0('0x11')][_0xe9f0('0x12')]===0x1f4){logger['error'](_0xe9f0('0xf'),_0x5ce997,_0x2f9d7b['error'][_0xe9f0('0x13')]);return _0x2cbd7d(_0x2f9d7b[_0xe9f0('0x11')]['message']);}logger['error'](_0xe9f0('0xf'),_0x5ce997,_0x2f9d7b['error'][_0xe9f0('0x13')]);return _0x25533b(_0x2f9d7b[_0xe9f0('0x11')][_0xe9f0('0x13')]);}else{logger[_0xe9f0('0xe')](_0xe9f0('0xf'),_0x5ce997,'request\x20sent');_0x25533b(_0x2f9d7b[_0xe9f0('0x14')][_0xe9f0('0x13')]);}})[_0xe9f0('0x15')](function(_0x43e3a8){logger[_0xe9f0('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x5ce997,_0x43e3a8);_0x2cbd7d(_0x43e3a8);});});}exports[_0xe9f0('0x16')]=function(_0xd7ecd0){var _0x4708d8=this;return new Promise(function(_0xa1df12,_0x347b0a){return db[_0xe9f0('0x17')][_0xe9f0('0x18')](_0xd7ecd0[_0xe9f0('0x19')],{'raw':_0xd7ecd0[_0xe9f0('0x1a')]?_0xd7ecd0[_0xe9f0('0x1a')][_0xe9f0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd7ecd0[_0xe9f0('0x1a')]?_0xd7ecd0[_0xe9f0('0x1a')][_0xe9f0('0x1c')]||null:null,'attributes':_0xd7ecd0[_0xe9f0('0x1a')]?_0xd7ecd0['options'][_0xe9f0('0x1d')]||null:null,'limit':_0xd7ecd0['options']?_0xd7ecd0['options'][_0xe9f0('0x1e')]||null:null})[_0xe9f0('0x1f')](function(_0x369677){logger[_0xe9f0('0xe')](_0xe9f0('0x16'),_0xd7ecd0);logger[_0xe9f0('0x20')]('UpdateChatInteraction',_0xd7ecd0,JSON[_0xe9f0('0x21')](_0x369677));_0xa1df12(_0x369677);})[_0xe9f0('0x15')](function(_0x26e661){logger[_0xe9f0('0x11')](_0xe9f0('0x16'),_0x26e661['message'],_0xd7ecd0);_0x347b0a(_0x4708d8['error'](0x1f4,_0x26e661[_0xe9f0('0x13')]));});});};exports[_0xe9f0('0x22')]=function(_0x17f797){return new Promise(function(_0x8ac026,_0x505f93){return db[_0xe9f0('0x17')][_0xe9f0('0x23')]({'where':_0x17f797[_0xe9f0('0x1a')]?_0x17f797[_0xe9f0('0x1a')][_0xe9f0('0x1c')]||null:null})[_0xe9f0('0x1f')](function(_0x3014fa){if(_0x3014fa){return _0x3014fa[_0xe9f0('0x24')](_0x17f797[_0xe9f0('0x19')][_0xe9f0('0x25')],_[_0xe9f0('0x26')](_0x17f797[_0xe9f0('0x19')],[_0xe9f0('0x25'),'id'])||{});}})[_0xe9f0('0x27')](function(_0x5c9772){logger[_0xe9f0('0xe')](_0xe9f0('0x28'),_0x17f797);logger[_0xe9f0('0x20')](_0xe9f0('0x28'),_0x17f797,JSON['stringify'](_0x5c9772));_0x8ac026(_0x5c9772);})[_0xe9f0('0x15')](function(_0x582148){logger[_0xe9f0('0x11')](_0xe9f0('0x28'),_0x582148[_0xe9f0('0x13')],_0x17f797);_0x505f93(_this[_0xe9f0('0x11')](0x1f4,_0x582148['message']));});});}; \ No newline at end of file +var _0x2000=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','ChatInteraction','update','raw','options','attributes','limit','info','UpdateChatInteraction','stringify','catch','AddTagsToChatInteraction','where','addTags','body','ids','omit','AddTags','lodash'];(function(_0x53e4ab,_0x22e0cb){var _0x21bb4f=function(_0x107787){while(--_0x107787){_0x53e4ab['push'](_0x53e4ab['shift']());}};_0x21bb4f(++_0x22e0cb);}(_0x2000,0x13f));var _0x0200=function(_0x1d3791,_0x51c613){_0x1d3791=_0x1d3791-0x0;var _0x40fbf5=_0x2000[_0x1d3791];return _0x40fbf5;};'use strict';var _=require(_0x0200('0x0'));var util=require(_0x0200('0x1'));var moment=require('moment');var BPromise=require(_0x0200('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0200('0x3'));var db=require(_0x0200('0x4'))['db'];var utils=require(_0x0200('0x5'));var logger=require(_0x0200('0x6'))(_0x0200('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0200('0x8')][_0x0200('0x9')]({'port':0x232a});config[_0x0200('0xa')]=_['defaults'](config[_0x0200('0xa')],{'host':_0x0200('0xb'),'port':0x18eb});var socket=require(_0x0200('0xc'))(new Redis(config[_0x0200('0xa')]));require('./chatInteraction.socket')[_0x0200('0xd')](socket);function respondWithRpcPromise(_0x22b43a,_0x4071df,_0x10a728){return new BPromise(function(_0x264556,_0x42c5e0){return client[_0x0200('0xe')](_0x22b43a,_0x10a728)[_0x0200('0xf')](function(_0x37b067){logger['info'](_0x0200('0x10'),_0x4071df,'request\x20sent');logger[_0x0200('0x11')](_0x0200('0x12'),_0x4071df,_0x0200('0x13'),JSON['stringify'](_0x37b067));if(_0x37b067[_0x0200('0x14')]){if(_0x37b067[_0x0200('0x14')]['code']===0x1f4){logger[_0x0200('0x14')](_0x0200('0x10'),_0x4071df,_0x37b067[_0x0200('0x14')]['message']);return _0x42c5e0(_0x37b067[_0x0200('0x14')]['message']);}logger[_0x0200('0x14')](_0x0200('0x10'),_0x4071df,_0x37b067[_0x0200('0x14')]['message']);return _0x264556(_0x37b067[_0x0200('0x14')][_0x0200('0x15')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x4071df,_0x0200('0x13'));_0x264556(_0x37b067[_0x0200('0x16')][_0x0200('0x15')]);}})['catch'](function(_0x5d2850){logger[_0x0200('0x14')](_0x0200('0x10'),_0x4071df,_0x5d2850);_0x42c5e0(_0x5d2850);});});}exports['UpdateChatInteraction']=function(_0x21c8ed){var _0x1aadd4=this;return new Promise(function(_0x302c4f,_0x149929){return db[_0x0200('0x17')][_0x0200('0x18')](_0x21c8ed['body'],{'raw':_0x21c8ed['options']?_0x21c8ed['options'][_0x0200('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21c8ed[_0x0200('0x1a')]?_0x21c8ed['options']['where']||null:null,'attributes':_0x21c8ed[_0x0200('0x1a')]?_0x21c8ed[_0x0200('0x1a')][_0x0200('0x1b')]||null:null,'limit':_0x21c8ed[_0x0200('0x1a')]?_0x21c8ed['options'][_0x0200('0x1c')]||null:null})[_0x0200('0xf')](function(_0x5df627){logger[_0x0200('0x1d')]('UpdateChatInteraction',_0x21c8ed);logger[_0x0200('0x11')](_0x0200('0x1e'),_0x21c8ed,JSON[_0x0200('0x1f')](_0x5df627));_0x302c4f(_0x5df627);})[_0x0200('0x20')](function(_0x2ea1d4){logger[_0x0200('0x14')](_0x0200('0x1e'),_0x2ea1d4[_0x0200('0x15')],_0x21c8ed);_0x149929(_0x1aadd4[_0x0200('0x14')](0x1f4,_0x2ea1d4[_0x0200('0x15')]));});});};exports[_0x0200('0x21')]=function(_0x52d7c5){return new Promise(function(_0x1bbc61,_0x40cbbc){return db['ChatInteraction']['find']({'where':_0x52d7c5[_0x0200('0x1a')]?_0x52d7c5[_0x0200('0x1a')][_0x0200('0x22')]||null:null})[_0x0200('0xf')](function(_0x1b676f){if(_0x1b676f){return _0x1b676f[_0x0200('0x23')](_0x52d7c5[_0x0200('0x24')][_0x0200('0x25')],_[_0x0200('0x26')](_0x52d7c5[_0x0200('0x24')],[_0x0200('0x25'),'id'])||{});}})['spread'](function(_0x219c0e){logger['info'](_0x0200('0x27'),_0x52d7c5);logger[_0x0200('0x11')](_0x0200('0x27'),_0x52d7c5,JSON[_0x0200('0x1f')](_0x219c0e));_0x1bbc61(_0x219c0e);})[_0x0200('0x20')](function(_0x1318b8){logger[_0x0200('0x14')](_0x0200('0x27'),_0x1318b8[_0x0200('0x15')],_0x52d7c5);_0x40cbbc(_this[_0x0200('0x14')](0x1f4,_0x1318b8[_0x0200('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 2711d69..63d2b79 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 _0x6332=['remove','emit','removeListener','register','length','chatInteraction:','save'];(function(_0x184ae4,_0x511d97){var _0x5bb118=function(_0x2af1c3){while(--_0x2af1c3){_0x184ae4['push'](_0x184ae4['shift']());}};_0x5bb118(++_0x511d97);}(_0x6332,0x133));var _0x2633=function(_0x88d014,_0x3daebb){_0x88d014=_0x88d014-0x0;var _0x373690=_0x6332[_0x88d014];return _0x373690;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x2633('0x0'),_0x2633('0x1'),'update'];function createListener(_0x1e1e15,_0x5b3fca){return function(_0x34a09c){_0x5b3fca[_0x2633('0x2')](_0x1e1e15,_0x34a09c);};}function removeListener(_0x1fe5c2,_0x5174b7){return function(){ChatInteractionEvents[_0x2633('0x3')](_0x1fe5c2,_0x5174b7);};}exports[_0x2633('0x4')]=function(_0x45a63a){for(var _0x58f938=0x0,_0x25f01f=events[_0x2633('0x5')];_0x58f938<_0x25f01f;_0x58f938++){var _0x59d641=events[_0x58f938];var _0x522213=createListener(_0x2633('0x6')+_0x59d641,_0x45a63a);ChatInteractionEvents['on'](_0x59d641,_0x522213);}}; \ No newline at end of file +var _0x28bc=['emit','removeListener','register','length','chatInteraction:','remove'];(function(_0x6bd2c1,_0x1ff03d){var _0x4f7c03=function(_0x3238d4){while(--_0x3238d4){_0x6bd2c1['push'](_0x6bd2c1['shift']());}};_0x4f7c03(++_0x1ff03d);}(_0x28bc,0xf5));var _0xc28b=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0x28bc[_0x35a274];return _0x40d905;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xc28b('0x0'),'update'];function createListener(_0x2bf447,_0x39a141){return function(_0x57b981){_0x39a141[_0xc28b('0x1')](_0x2bf447,_0x57b981);};}function removeListener(_0x38b1eb,_0x491178){return function(){ChatInteractionEvents[_0xc28b('0x2')](_0x38b1eb,_0x491178);};}exports[_0xc28b('0x3')]=function(_0x1e2848){for(var _0x5c1be7=0x0,_0x4cdf9c=events[_0xc28b('0x4')];_0x5c1be7<_0x4cdf9c;_0x5c1be7++){var _0x2266d2=events[_0x5c1be7];var _0x20b169=createListener(_0xc28b('0x5')+_0x2266d2,_0x1e2848);ChatInteractionEvents['on'](_0x2266d2,_0x20b169);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 8152993..226bf0a 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 _0x8ce6=['/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','tracked','destroy','removeTags','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/describe','describe','get','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ce6,0xa0));var _0x68ce=function(_0x51bebf,_0x22aa21){_0x51bebf=_0x51bebf-0x0;var _0x95197d=_0x8ce6[_0x51bebf];return _0x95197d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x68ce('0x0'));var timeout=require(_0x68ce('0x1'));var express=require('express');var router=express[_0x68ce('0x2')]();var fs_extra=require(_0x68ce('0x3'));var auth=require(_0x68ce('0x4'));var interaction=require(_0x68ce('0x5'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x68ce('0x6')](),controller['index']);router['get'](_0x68ce('0x7'),auth[_0x68ce('0x6')](),controller[_0x68ce('0x8')]);router[_0x68ce('0x9')](_0x68ce('0xa'),auth[_0x68ce('0xb')](),controller['show']);router['get'](_0x68ce('0xc'),auth[_0x68ce('0xb')](),controller[_0x68ce('0xd')]);router['get'](_0x68ce('0xe'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x68ce('0xf'),auth[_0x68ce('0xb')](),controller['getMyMessages']);router[_0x68ce('0x9')](_0x68ce('0x10'),auth[_0x68ce('0x6')](),controller['download']);router[_0x68ce('0x11')]('/',auth[_0x68ce('0x6')](),controller['create']);router[_0x68ce('0x11')](_0x68ce('0x12'),auth['isAuthenticated'](),controller[_0x68ce('0x13')]);var upload=multer({'storage':multer[_0x68ce('0x14')]({'destination':function(_0x44f36f,_0x4564f5,_0x38b1cf){_0x38b1cf(null,path[_0x68ce('0x15')](config[_0x68ce('0x16')],_0x68ce('0x17')));},'filename':function(_0x3852a9,_0x19b9e5,_0x3c589e){_0x3c589e(null,util[_0x68ce('0x18')](_0x68ce('0x19'),Date[_0x68ce('0x1a')](),_0x19b9e5[_0x68ce('0x1b')][_0x68ce('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x68ce('0x11')]('/:id/attachment_upload',upload[_0x68ce('0x1d')](_0x68ce('0x1e')),controller[_0x68ce('0x1f')]);router[_0x68ce('0x11')]('/:id/messages',auth[_0x68ce('0xb')](),controller[_0x68ce('0x20')]);router[_0x68ce('0x11')](_0x68ce('0x21'),auth[_0x68ce('0x6')](),interaction['tracked'](_0x68ce('0x22'),_0x68ce('0x23')),controller[_0x68ce('0x24')]);router[_0x68ce('0x25')](_0x68ce('0xa'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x68ce('0x26')),controller[_0x68ce('0x27')]);router['put'](_0x68ce('0x28'),controller[_0x68ce('0x29')]);router['put'](_0x68ce('0x2a'),auth[_0x68ce('0xb')](),controller[_0x68ce('0x2b')]);router[_0x68ce('0x25')](_0x68ce('0x2c'),controller['close']);router[_0x68ce('0x2d')](_0x68ce('0xa'),auth[_0x68ce('0x6')](),interaction[_0x68ce('0x2e')](_0x68ce('0x22'),'chatinteraction:destroy'),controller[_0x68ce('0x2f')]);router[_0x68ce('0x2d')](_0x68ce('0x21'),auth[_0x68ce('0x6')](),controller[_0x68ce('0x30')]);module[_0x68ce('0x31')]=router; \ No newline at end of file +var _0x15b4=['/:id/attachment_upload','file','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','/:id/download','download','post','create','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace'];(function(_0x4d9acc,_0x5c8738){var _0x5e0d3a=function(_0x5ce4c1){while(--_0x5ce4c1){_0x4d9acc['push'](_0x4d9acc['shift']());}};_0x5e0d3a(++_0x5c8738);}(_0x15b4,0x74));var _0x415b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x15b4[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x415b('0x0'));var util=require(_0x415b('0x1'));var path=require(_0x415b('0x2'));var timeout=require(_0x415b('0x3'));var express=require(_0x415b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x415b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x415b('0x6'));router[_0x415b('0x7')]('/',auth[_0x415b('0x8')](),controller[_0x415b('0x9')]);router[_0x415b('0x7')](_0x415b('0xa'),auth[_0x415b('0x8')](),controller[_0x415b('0xb')]);router['get'](_0x415b('0xc'),auth[_0x415b('0xd')](),controller[_0x415b('0xe')]);router[_0x415b('0x7')](_0x415b('0xf'),auth[_0x415b('0xd')](),controller[_0x415b('0x10')]);router['get']('/:id/messages',auth[_0x415b('0x8')](),controller[_0x415b('0x11')]);router[_0x415b('0x7')](_0x415b('0x12'),auth[_0x415b('0xd')](),controller['getMyMessages']);router['get'](_0x415b('0x13'),auth[_0x415b('0x8')](),controller[_0x415b('0x14')]);router[_0x415b('0x15')]('/',auth['isAuthenticated'](),controller[_0x415b('0x16')]);router[_0x415b('0x15')]('/:id/vidaoo',auth[_0x415b('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x235b51,_0x19bb43,_0xcda6b3){_0xcda6b3(null,path[_0x415b('0x17')](config[_0x415b('0x18')],_0x415b('0x19')));},'filename':function(_0x5776aa,_0x585e9e,_0x34a243){_0x34a243(null,util[_0x415b('0x1a')](_0x415b('0x1b'),Date[_0x415b('0x1c')](),_0x585e9e[_0x415b('0x1d')][_0x415b('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x415b('0x15')](_0x415b('0x1f'),upload['single'](_0x415b('0x20')),controller['attachmentUpload']);router[_0x415b('0x15')]('/:id/messages',auth[_0x415b('0xd')](),controller['addMessage']);router[_0x415b('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x415b('0x21')](_0x415b('0x22'),'chatinteraction:addtags'),controller[_0x415b('0x23')]);router[_0x415b('0x24')](_0x415b('0xc'),auth[_0x415b('0x8')](),interaction[_0x415b('0x21')]('chat',_0x415b('0x25')),controller[_0x415b('0x26')]);router[_0x415b('0x24')](_0x415b('0x27'),controller[_0x415b('0x28')]);router['put'](_0x415b('0x29'),auth[_0x415b('0xd')](),controller[_0x415b('0x2a')]);router[_0x415b('0x24')](_0x415b('0x2b'),controller['close']);router[_0x415b('0x2c')](_0x415b('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x415b('0x22'),_0x415b('0x2d')),controller[_0x415b('0x2e')]);router[_0x415b('0x2c')](_0x415b('0x2f'),auth['isAuthenticated'](),controller['removeTags']);module[_0x415b('0x30')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 56f33ec..878c200 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 _0x07a2=['INTEGER','exports','TEXT','BOOLEAN'];(function(_0x19d24c,_0x62bc50){var _0x2fae8d=function(_0x419856){while(--_0x419856){_0x19d24c['push'](_0x19d24c['shift']());}};_0x2fae8d(++_0x62bc50);}(_0x07a2,0x13d));var _0x207a=function(_0x1e7ead,_0x7f6227){_0x1e7ead=_0x1e7ead-0x0;var _0x3912b2=_0x07a2[_0x1e7ead];return _0x3912b2;};'use strict';var Sequelize=require('sequelize');module[_0x207a('0x0')]={'body':{'type':Sequelize[_0x207a('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x207a('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x207a('0x3')]}}; \ No newline at end of file +var _0x9ac5=['INTEGER','sequelize','exports','BOOLEAN'];(function(_0x8a0aed,_0x9370b5){var _0x3723fa=function(_0x25a50f){while(--_0x25a50f){_0x8a0aed['push'](_0x8a0aed['shift']());}};_0x3723fa(++_0x9370b5);}(_0x9ac5,0x141));var _0x59ac=function(_0x27eea1,_0x144cea){_0x27eea1=_0x27eea1-0x0;var _0x3e4f5b=_0x9ac5[_0x27eea1];return _0x3e4f5b;};'use strict';var Sequelize=require(_0x59ac('0x0'));module[_0x59ac('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x59ac('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x59ac('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 3b78a9e..c89704c 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 _0x1f50=['intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','keys','options','find','create','body','params','describe','createdAt','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','findAll','admin','user','fullname','role','userpic','internal','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','messages','FromId','ToId','read','all','eml-format','zip-dir','fast-json-patch','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','attributes'];(function(_0x254974,_0x2c8a95){var _0x3e95f9=function(_0x128bef){while(--_0x128bef){_0x254974['push'](_0x254974['shift']());}};_0x3e95f9(++_0x2c8a95);}(_0x1f50,0x104));var _0x01f5=function(_0x5695a0,_0x3963d2){_0x5695a0=_0x5695a0-0x0;var _0x83dbf7=_0x1f50[_0x5695a0];return _0x83dbf7;};'use strict';var emlformat=require(_0x01f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x01f5('0x1'));var jsonpatch=require(_0x01f5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x01f5('0x3'));var path=require(_0x01f5('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x01f5('0x5'));var fs=require('fs');var fs_extra=require(_0x01f5('0x6'));var _=require(_0x01f5('0x7'));var squel=require(_0x01f5('0x8'));var crypto=require(_0x01f5('0x9'));var jsforce=require(_0x01f5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x01f5('0xb'));var querystring=require(_0x01f5('0xc'));var Papa=require(_0x01f5('0xd'));var Redis=require(_0x01f5('0xe'));var authService=require(_0x01f5('0xf'));var qs=require(_0x01f5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x01f5('0x11'))(_0x01f5('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x01f5('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x01f5('0x14')](config['redis'],{'host':_0x01f5('0x15'),'port':0x18eb});var socket=require(_0x01f5('0x16'))(new Redis(config[_0x01f5('0x17')]));require('./chatInternalMessage.socket')[_0x01f5('0x18')](socket);function respondWithStatusCode(_0x1e3f1c,_0x4ecfff){_0x4ecfff=_0x4ecfff||0xcc;return function(_0x3ea4bd){if(_0x3ea4bd){return _0x1e3f1c[_0x01f5('0x19')](_0x4ecfff);}return _0x1e3f1c[_0x01f5('0x1a')](_0x4ecfff)[_0x01f5('0x1b')]();};}function respondWithResult(_0x38d41d,_0x190fda){_0x190fda=_0x190fda||0xc8;return function(_0x902895){if(_0x902895){return _0x38d41d[_0x01f5('0x1a')](_0x190fda)[_0x01f5('0x1c')](_0x902895);}};}function respondWithFilteredResult(_0x2a0be0,_0xa2abf9){return function(_0x125851){if(_0x125851){var _0x38c1b9=typeof _0xa2abf9[_0x01f5('0x1d')]===_0x01f5('0x1e')&&typeof _0xa2abf9[_0x01f5('0x1f')]===_0x01f5('0x1e');var _0x198eca=_0x125851[_0x01f5('0x20')];var _0x4de33e=_0x38c1b9?0x0:_0xa2abf9[_0x01f5('0x1d')];var _0x4dd194=_0x38c1b9?_0x125851[_0x01f5('0x20')]:_0xa2abf9['offset']+_0xa2abf9[_0x01f5('0x1f')];var _0x1eb156;if(_0x4dd194>=_0x198eca){_0x4dd194=_0x198eca;_0x1eb156=0xc8;}else{_0x1eb156=0xce;}_0x2a0be0[_0x01f5('0x1a')](_0x1eb156);return _0x2a0be0['set']('Content-Range',_0x4de33e+'-'+_0x4dd194+'/'+_0x198eca)[_0x01f5('0x1c')](_0x125851);}return null;};}function patchUpdates(_0x380a4c){return function(_0x10a040){try{jsonpatch['apply'](_0x10a040,_0x380a4c,!![]);}catch(_0x6f446b){return BPromise[_0x01f5('0x21')](_0x6f446b);}return _0x10a040[_0x01f5('0x22')]();};}function saveUpdates(_0x31478d,_0x5386c1){return function(_0x47e82b){if(_0x47e82b){return _0x47e82b[_0x01f5('0x23')](_0x31478d)[_0x01f5('0x24')](function(_0x3e904a){return _0x3e904a;});}return null;};}function removeEntity(_0x5ad70a,_0x45d595){return function(_0x22176e){if(_0x22176e){return _0x22176e[_0x01f5('0x25')]()[_0x01f5('0x24')](function(){_0x5ad70a[_0x01f5('0x1a')](0xcc)[_0x01f5('0x1b')]();});}};}function handleEntityNotFound(_0x323763,_0x3336bf){return function(_0x5b7f47){if(!_0x5b7f47){_0x323763[_0x01f5('0x19')](0x194);}return _0x5b7f47;};}function handleError(_0xd0d190,_0x5df797){_0x5df797=_0x5df797||0x1f4;return function(_0x2d3a87){logger[_0x01f5('0x26')](_0x2d3a87[_0x01f5('0x27')]);if(_0x2d3a87[_0x01f5('0x28')]){delete _0x2d3a87['name'];}_0xd0d190[_0x01f5('0x1a')](_0x5df797)['send'](_0x2d3a87);};}exports[_0x01f5('0x29')]=function(_0x54fbc3,_0x284f93){var _0x1970e9={},_0x4ff97b={},_0x204c6f={'count':0x0,'rows':[]};var _0x3fd842=_[_0x01f5('0x2a')](db[_0x01f5('0x2b')][_0x01f5('0x2c')],function(_0x1916bf){return{'name':_0x1916bf[_0x01f5('0x2d')],'type':_0x1916bf[_0x01f5('0x2e')][_0x01f5('0x2f')]};});_0x4ff97b[_0x01f5('0x30')]=_['map'](_0x3fd842,_0x01f5('0x28'));_0x4ff97b['query']=_['keys'](_0x54fbc3[_0x01f5('0x31')]);_0x4ff97b[_0x01f5('0x32')]=_['intersection'](_0x4ff97b[_0x01f5('0x30')],_0x4ff97b['query']);_0x1970e9[_0x01f5('0x33')]=_[_0x01f5('0x34')](_0x4ff97b[_0x01f5('0x30')],qs[_0x01f5('0x35')](_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x35')]));_0x1970e9[_0x01f5('0x33')]=_0x1970e9['attributes'][_0x01f5('0x36')]?_0x1970e9[_0x01f5('0x33')]:_0x4ff97b[_0x01f5('0x30')];if(!_0x54fbc3['query'][_0x01f5('0x37')]('nolimit')){_0x1970e9[_0x01f5('0x1f')]=qs[_0x01f5('0x1f')](_0x54fbc3[_0x01f5('0x31')]['limit']);_0x1970e9['offset']=qs[_0x01f5('0x1d')](_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x1d')]);}_0x1970e9[_0x01f5('0x38')]=qs[_0x01f5('0x39')](_0x54fbc3['query'][_0x01f5('0x39')]);_0x1970e9['where']=qs[_0x01f5('0x32')](_[_0x01f5('0x3a')](_0x54fbc3[_0x01f5('0x31')],_0x4ff97b[_0x01f5('0x32')]),_0x3fd842);if(_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x3b')]){_0x1970e9['where']=_[_0x01f5('0x3c')](_0x1970e9[_0x01f5('0x3d')],{'$or':_[_0x01f5('0x2a')](_0x3fd842,function(_0x323e94){if(_0x323e94[_0x01f5('0x2e')]!==_0x01f5('0x3e')){var _0x51405c={};_0x51405c[_0x323e94[_0x01f5('0x28')]]={'$like':'%'+_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x3b')]+'%'};return _0x51405c;}})});}_0x1970e9=_[_0x01f5('0x3c')]({},_0x1970e9,_0x54fbc3['options']);var _0x30f79={'where':_0x1970e9[_0x01f5('0x3d')]};return db[_0x01f5('0x2b')]['count'](_0x30f79)[_0x01f5('0x24')](function(_0xb04d96){_0x204c6f['count']=_0xb04d96;if(_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x3f')]){_0x1970e9[_0x01f5('0x40')]=[{'all':!![]}];}return db[_0x01f5('0x2b')]['findAll'](_0x1970e9);})['then'](function(_0x482850){_0x204c6f[_0x01f5('0x41')]=_0x482850;return _0x204c6f;})[_0x01f5('0x24')](respondWithFilteredResult(_0x284f93,_0x1970e9))[_0x01f5('0x42')](handleError(_0x284f93,null));};exports[_0x01f5('0x43')]=function(_0xc986f1,_0x3de016){var _0x3182d0={'raw':!![],'where':{'id':_0xc986f1['params']['id']}},_0x23109f={};_0x23109f[_0x01f5('0x30')]=_[_0x01f5('0x44')](db[_0x01f5('0x2b')][_0x01f5('0x2c')]);_0x23109f[_0x01f5('0x31')]=_[_0x01f5('0x44')](_0xc986f1['query']);_0x23109f['filters']=_[_0x01f5('0x34')](_0x23109f[_0x01f5('0x30')],_0x23109f['query']);_0x3182d0[_0x01f5('0x33')]=_[_0x01f5('0x34')](_0x23109f['model'],qs[_0x01f5('0x35')](_0xc986f1[_0x01f5('0x31')][_0x01f5('0x35')]));_0x3182d0['attributes']=_0x3182d0[_0x01f5('0x33')]['length']?_0x3182d0[_0x01f5('0x33')]:_0x23109f['model'];if(_0xc986f1[_0x01f5('0x31')][_0x01f5('0x3f')]){_0x3182d0['include']=[{'all':!![]}];}_0x3182d0=_[_0x01f5('0x3c')]({},_0x3182d0,_0xc986f1[_0x01f5('0x45')]);return db[_0x01f5('0x2b')][_0x01f5('0x46')](_0x3182d0)['then'](handleEntityNotFound(_0x3de016,null))[_0x01f5('0x24')](respondWithResult(_0x3de016,null))[_0x01f5('0x42')](handleError(_0x3de016,null));};exports[_0x01f5('0x47')]=function(_0x11f81a,_0xc63c91){return db[_0x01f5('0x2b')][_0x01f5('0x47')](_0x11f81a[_0x01f5('0x48')],{})[_0x01f5('0x24')](respondWithResult(_0xc63c91,0xc9))[_0x01f5('0x42')](handleError(_0xc63c91,null));};exports['update']=function(_0xa90d74,_0x303cf1){if(_0xa90d74['body']['id']){delete _0xa90d74[_0x01f5('0x48')]['id'];}return db[_0x01f5('0x2b')][_0x01f5('0x46')]({'where':{'id':_0xa90d74[_0x01f5('0x49')]['id']}})['then'](handleEntityNotFound(_0x303cf1,null))[_0x01f5('0x24')](saveUpdates(_0xa90d74[_0x01f5('0x48')],null))['then'](respondWithResult(_0x303cf1,null))[_0x01f5('0x42')](handleError(_0x303cf1,null));};exports[_0x01f5('0x25')]=function(_0x20509a,_0x4c38af){return db[_0x01f5('0x2b')]['find']({'where':{'id':_0x20509a['params']['id']}})['then'](handleEntityNotFound(_0x4c38af,null))[_0x01f5('0x24')](removeEntity(_0x4c38af,null))[_0x01f5('0x42')](handleError(_0x4c38af,null));};exports['describe']=function(_0x29fd7d,_0x4f2a7f){return db[_0x01f5('0x2b')][_0x01f5('0x4a')]()[_0x01f5('0x24')](respondWithResult(_0x4f2a7f,null))[_0x01f5('0x42')](handleError(_0x4f2a7f,null));};function wrapUser(_0x2b288a){return function(_0x10261f){var _0x56dd0d=_0x2b288a['get']({'plain':!![]});_0x56dd0d['messages']=[];if(_0x10261f){_0x56dd0d['lastMessageAt']=_0x10261f[_0x01f5('0x4b')];_0x56dd0d['lastMessage']=_0x10261f;}else{_0x56dd0d[_0x01f5('0x4c')]=moment(0x0)['format'](_0x01f5('0x4d'));_0x56dd0d['lastMessage']={};}return _0x56dd0d;};}exports[_0x01f5('0x4e')]=function(_0x228537,_0x2e5dbb,_0xe964da){var _0xfc4e96=[];return db['User'][_0x01f5('0x4f')]({'where':{'role':['agent',_0x01f5('0x50'),_0x01f5('0x51')]},'attributes':['id',_0x01f5('0x52'),_0x01f5('0x28'),_0x01f5('0x53'),_0x01f5('0x54'),_0x01f5('0x55'),'online',_0x01f5('0x56'),'allowmessenger',_0x01f5('0x57')],'order':qs[_0x01f5('0x39')](_0x01f5('0x58')),'include':[{'model':db[_0x01f5('0x59')],'as':_0x01f5('0x5a'),'attributes':['id',_0x01f5('0x28'),'type'],'through':{'attributes':[]}}]})[_0x01f5('0x24')](function(_0x1e0940){if(_0x1e0940){var _0x1df495=_0x228537[_0x01f5('0x51')]['get']({'plain':!![]});if(!_0x1df495)throw new Error(_0x01f5('0x5b'));if(_0x1df495[_0x01f5('0x53')]===_0x01f5('0x51')){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x1df495[_0x01f5('0x5c')]},'raw':!![]})[_0x01f5('0x24')](function(_0x5909ab){if(_0x5909ab){if(_0x5909ab[_0x01f5('0x5d')]===0x0){return db[_0x01f5('0x5e')]['findAll']({'where':{'sectionId':_0x5909ab['id']},'raw':!![]})[_0x01f5('0x24')](function(_0x38db76){var _0x1ccb05=[];if(_[_0x01f5('0x5f')](_0x38db76)){_0x1ccb05=_[_0x01f5('0x3b')](_0x1e0940,function(_0x34bed0){if(_0x34bed0[_0x01f5('0x53')]!==_0x01f5('0x60')){return _0x34bed0;}});return _0x1ccb05;}else{for(var _0x445ae7=0x0;_0x445ae7<_0x1e0940[_0x01f5('0x36')];_0x445ae7++){var _0x1eabaa=_0x1e0940[_0x445ae7];if(_0x1eabaa['role']===_0x01f5('0x60')){var _0x4b8610=_[_0x01f5('0x46')](_0x38db76,function(_0x509d65){return _0x509d65[_0x01f5('0x61')]===_0x1eabaa['id'];});if(_0x4b8610)_0x1ccb05[_0x01f5('0x62')](_0x1eabaa);}else{_0x1ccb05[_0x01f5('0x62')](_0x1eabaa);}}return _0x1ccb05;}});}else{return _0x1e0940;}}else{var _0x45cfe6=_[_0x01f5('0x3b')](_0x1e0940,function(_0x1073cc){if(_0x1073cc[_0x01f5('0x53')]!==_0x01f5('0x60')){return _0x1073cc;}});return _0x45cfe6;}});}else{return _0x1e0940;}}})[_0x01f5('0x24')](function(_0x268101){var _0x38473d=[];if(_0x268101){_0xfc4e96=_0x268101;for(var _0x2417af=0x0;_0x2417af<_0x268101[_0x01f5('0x36')];_0x2417af+=0x1){_0xfc4e96[_0x2417af][_0x01f5('0x63')]=[];_0x38473d[_0x01f5('0x62')](db[_0x01f5('0x2b')][_0x01f5('0x46')]({'where':{'FromId':[_0x228537[_0x01f5('0x51')]['id'],_0x268101[_0x2417af]['id']],'ToId':[_0x228537['user']['id'],_0x268101[_0x2417af]['id']],'ChatGroupId':null},'attributes':['id',_0x01f5('0x4b'),_0x01f5('0x64'),_0x01f5('0x65'),_0x01f5('0x66'),_0x01f5('0x48')],'order':qs[_0x01f5('0x39')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x268101[_0x2417af])));}return BPromise[_0x01f5('0x67')](_0x38473d);}return[];})['then'](function(_0xd4e087){return{'rows':_0xd4e087,'count':_0xd4e087['length']};})[_0x01f5('0x24')](respondWithResult(_0x2e5dbb,null))[_0x01f5('0x42')](handleError(_0x2e5dbb,null));}; \ No newline at end of file +var _0x8dd0=['attributes','fields','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','rawAttributes','length','include','create','body','find','params','describe','get','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','ToId','read','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatInternalMessage.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','ChatInternalMessage','fieldName','type','key','model','map','query','keys','intersection'];(function(_0x2aa9da,_0x33c82d){var _0x5d2c88=function(_0x127a78){while(--_0x127a78){_0x2aa9da['push'](_0x2aa9da['shift']());}};_0x5d2c88(++_0x33c82d);}(_0x8dd0,0x112));var _0x08dd=function(_0x4ca280,_0x1a1c4b){_0x4ca280=_0x4ca280-0x0;var _0x4bff7a=_0x8dd0[_0x4ca280];return _0x4bff7a;};'use strict';var emlformat=require(_0x08dd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x08dd('0x1'));var jsonpatch=require(_0x08dd('0x2'));var rp=require(_0x08dd('0x3'));var moment=require(_0x08dd('0x4'));var BPromise=require(_0x08dd('0x5'));var Mustache=require(_0x08dd('0x6'));var util=require(_0x08dd('0x7'));var path=require(_0x08dd('0x8'));var sox=require(_0x08dd('0x9'));var csv=require(_0x08dd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x08dd('0xb'));var _=require(_0x08dd('0xc'));var squel=require(_0x08dd('0xd'));var crypto=require(_0x08dd('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x08dd('0xa'));var querystring=require(_0x08dd('0xf'));var Papa=require(_0x08dd('0x10'));var Redis=require(_0x08dd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x08dd('0x12'));var as=require(_0x08dd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x08dd('0x14'));var utils=require(_0x08dd('0x15'));var config=require(_0x08dd('0x16'));var licenseUtil=require(_0x08dd('0x17'));var db=require(_0x08dd('0x18'))['db'];config[_0x08dd('0x19')]=_['defaults'](config[_0x08dd('0x19')],{'host':_0x08dd('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x08dd('0x19')]));require(_0x08dd('0x1b'))['register'](socket);function respondWithStatusCode(_0x4fd31a,_0x2d1c8a){_0x2d1c8a=_0x2d1c8a||0xcc;return function(_0x17045b){if(_0x17045b){return _0x4fd31a[_0x08dd('0x1c')](_0x2d1c8a);}return _0x4fd31a[_0x08dd('0x1d')](_0x2d1c8a)[_0x08dd('0x1e')]();};}function respondWithResult(_0x2ab3c6,_0x492528){_0x492528=_0x492528||0xc8;return function(_0x7e227b){if(_0x7e227b){return _0x2ab3c6['status'](_0x492528)[_0x08dd('0x1f')](_0x7e227b);}};}function respondWithFilteredResult(_0x314356,_0x4ff1c2){return function(_0x87ad4){if(_0x87ad4){var _0x178fae=typeof _0x4ff1c2['offset']===_0x08dd('0x20')&&typeof _0x4ff1c2[_0x08dd('0x21')]===_0x08dd('0x20');var _0x109d03=_0x87ad4[_0x08dd('0x22')];var _0xf4d44a=_0x178fae?0x0:_0x4ff1c2[_0x08dd('0x23')];var _0x2454aa=_0x178fae?_0x87ad4[_0x08dd('0x22')]:_0x4ff1c2[_0x08dd('0x23')]+_0x4ff1c2[_0x08dd('0x21')];var _0x37d398;if(_0x2454aa>=_0x109d03){_0x2454aa=_0x109d03;_0x37d398=0xc8;}else{_0x37d398=0xce;}_0x314356[_0x08dd('0x1d')](_0x37d398);return _0x314356['set'](_0x08dd('0x24'),_0xf4d44a+'-'+_0x2454aa+'/'+_0x109d03)[_0x08dd('0x1f')](_0x87ad4);}return null;};}function patchUpdates(_0xa566de){return function(_0x2da508){try{jsonpatch[_0x08dd('0x25')](_0x2da508,_0xa566de,!![]);}catch(_0x46beaa){return BPromise[_0x08dd('0x26')](_0x46beaa);}return _0x2da508['save']();};}function saveUpdates(_0x31947a,_0x14008b){return function(_0x1155c7){if(_0x1155c7){return _0x1155c7[_0x08dd('0x27')](_0x31947a)['then'](function(_0xb3c9d5){return _0xb3c9d5;});}return null;};}function removeEntity(_0x268a03,_0xc0eb9d){return function(_0x46fe8f){if(_0x46fe8f){return _0x46fe8f[_0x08dd('0x28')]()[_0x08dd('0x29')](function(){_0x268a03['status'](0xcc)[_0x08dd('0x1e')]();});}};}function handleEntityNotFound(_0x3e4042,_0x2c047f){return function(_0x388a24){if(!_0x388a24){_0x3e4042[_0x08dd('0x1c')](0x194);}return _0x388a24;};}function handleError(_0x47b19a,_0x3ecac3){_0x3ecac3=_0x3ecac3||0x1f4;return function(_0x4ba6ad){logger[_0x08dd('0x2a')](_0x4ba6ad[_0x08dd('0x2b')]);if(_0x4ba6ad[_0x08dd('0x2c')]){delete _0x4ba6ad[_0x08dd('0x2c')];}_0x47b19a['status'](_0x3ecac3)[_0x08dd('0x2d')](_0x4ba6ad);};}exports[_0x08dd('0x2e')]=function(_0x4b4efd,_0x204fc7){var _0x50e8b3={},_0x380bbc={},_0x28ecbc={'count':0x0,'rows':[]};var _0x4e736f=_['map'](db[_0x08dd('0x2f')]['rawAttributes'],function(_0xfbbfe2){return{'name':_0xfbbfe2[_0x08dd('0x30')],'type':_0xfbbfe2[_0x08dd('0x31')][_0x08dd('0x32')]};});_0x380bbc[_0x08dd('0x33')]=_[_0x08dd('0x34')](_0x4e736f,_0x08dd('0x2c'));_0x380bbc[_0x08dd('0x35')]=_[_0x08dd('0x36')](_0x4b4efd[_0x08dd('0x35')]);_0x380bbc['filters']=_[_0x08dd('0x37')](_0x380bbc[_0x08dd('0x33')],_0x380bbc['query']);_0x50e8b3[_0x08dd('0x38')]=_['intersection'](_0x380bbc[_0x08dd('0x33')],qs[_0x08dd('0x39')](_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x39')]));_0x50e8b3[_0x08dd('0x38')]=_0x50e8b3[_0x08dd('0x38')]['length']?_0x50e8b3[_0x08dd('0x38')]:_0x380bbc['model'];if(!_0x4b4efd['query']['hasOwnProperty'](_0x08dd('0x3a'))){_0x50e8b3[_0x08dd('0x21')]=qs[_0x08dd('0x21')](_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x21')]);_0x50e8b3['offset']=qs['offset'](_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x23')]);}_0x50e8b3[_0x08dd('0x3b')]=qs['sort'](_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x3c')]);_0x50e8b3[_0x08dd('0x3d')]=qs[_0x08dd('0x3e')](_[_0x08dd('0x3f')](_0x4b4efd['query'],_0x380bbc[_0x08dd('0x3e')]),_0x4e736f);if(_0x4b4efd['query']['filter']){_0x50e8b3[_0x08dd('0x3d')]=_['merge'](_0x50e8b3[_0x08dd('0x3d')],{'$or':_['map'](_0x4e736f,function(_0x38e071){if(_0x38e071['type']!==_0x08dd('0x40')){var _0x567fa8={};_0x567fa8[_0x38e071[_0x08dd('0x2c')]]={'$like':'%'+_0x4b4efd['query'][_0x08dd('0x41')]+'%'};return _0x567fa8;}})});}_0x50e8b3=_[_0x08dd('0x42')]({},_0x50e8b3,_0x4b4efd[_0x08dd('0x43')]);var _0x1693c9={'where':_0x50e8b3[_0x08dd('0x3d')]};return db[_0x08dd('0x2f')]['count'](_0x1693c9)['then'](function(_0x3adc1a){_0x28ecbc['count']=_0x3adc1a;if(_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x44')]){_0x50e8b3['include']=[{'all':!![]}];}return db[_0x08dd('0x2f')][_0x08dd('0x45')](_0x50e8b3);})[_0x08dd('0x29')](function(_0x4c88a0){_0x28ecbc['rows']=_0x4c88a0;return _0x28ecbc;})[_0x08dd('0x29')](respondWithFilteredResult(_0x204fc7,_0x50e8b3))[_0x08dd('0x46')](handleError(_0x204fc7,null));};exports[_0x08dd('0x47')]=function(_0x15e0f6,_0xb17f88){var _0x193fc0={'raw':!![],'where':{'id':_0x15e0f6['params']['id']}},_0x9aea12={};_0x9aea12[_0x08dd('0x33')]=_[_0x08dd('0x36')](db[_0x08dd('0x2f')][_0x08dd('0x48')]);_0x9aea12['query']=_[_0x08dd('0x36')](_0x15e0f6[_0x08dd('0x35')]);_0x9aea12[_0x08dd('0x3e')]=_['intersection'](_0x9aea12['model'],_0x9aea12[_0x08dd('0x35')]);_0x193fc0['attributes']=_[_0x08dd('0x37')](_0x9aea12[_0x08dd('0x33')],qs['fields'](_0x15e0f6[_0x08dd('0x35')][_0x08dd('0x39')]));_0x193fc0[_0x08dd('0x38')]=_0x193fc0[_0x08dd('0x38')][_0x08dd('0x49')]?_0x193fc0[_0x08dd('0x38')]:_0x9aea12[_0x08dd('0x33')];if(_0x15e0f6['query'][_0x08dd('0x44')]){_0x193fc0[_0x08dd('0x4a')]=[{'all':!![]}];}_0x193fc0=_['merge']({},_0x193fc0,_0x15e0f6[_0x08dd('0x43')]);return db['ChatInternalMessage']['find'](_0x193fc0)['then'](handleEntityNotFound(_0xb17f88,null))[_0x08dd('0x29')](respondWithResult(_0xb17f88,null))[_0x08dd('0x46')](handleError(_0xb17f88,null));};exports[_0x08dd('0x4b')]=function(_0x31a4d9,_0x4b803b){return db[_0x08dd('0x2f')][_0x08dd('0x4b')](_0x31a4d9[_0x08dd('0x4c')],{})[_0x08dd('0x29')](respondWithResult(_0x4b803b,0xc9))[_0x08dd('0x46')](handleError(_0x4b803b,null));};exports['update']=function(_0x164810,_0x26352f){if(_0x164810[_0x08dd('0x4c')]['id']){delete _0x164810[_0x08dd('0x4c')]['id'];}return db[_0x08dd('0x2f')][_0x08dd('0x4d')]({'where':{'id':_0x164810[_0x08dd('0x4e')]['id']}})[_0x08dd('0x29')](handleEntityNotFound(_0x26352f,null))['then'](saveUpdates(_0x164810[_0x08dd('0x4c')],null))['then'](respondWithResult(_0x26352f,null))[_0x08dd('0x46')](handleError(_0x26352f,null));};exports['destroy']=function(_0x10b14d,_0x5803a6){return db[_0x08dd('0x2f')][_0x08dd('0x4d')]({'where':{'id':_0x10b14d[_0x08dd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5803a6,null))['then'](removeEntity(_0x5803a6,null))[_0x08dd('0x46')](handleError(_0x5803a6,null));};exports[_0x08dd('0x4f')]=function(_0x5753d6,_0x192ccf){return db['ChatInternalMessage'][_0x08dd('0x4f')]()[_0x08dd('0x29')](respondWithResult(_0x192ccf,null))[_0x08dd('0x46')](handleError(_0x192ccf,null));};function wrapUser(_0x54f692){return function(_0x209e86){var _0x35e6fe=_0x54f692[_0x08dd('0x50')]({'plain':!![]});_0x35e6fe['messages']=[];if(_0x209e86){_0x35e6fe[_0x08dd('0x51')]=_0x209e86['createdAt'];_0x35e6fe['lastMessage']=_0x209e86;}else{_0x35e6fe[_0x08dd('0x51')]=moment(0x0)[_0x08dd('0x52')](_0x08dd('0x53'));_0x35e6fe[_0x08dd('0x54')]={};}return _0x35e6fe;};}exports['getUsers']=function(_0x2037b9,_0x5438e7,_0x58a357){var _0x546fa9=[];return db[_0x08dd('0x55')][_0x08dd('0x45')]({'where':{'role':[_0x08dd('0x56'),_0x08dd('0x57'),'user']},'attributes':['id',_0x08dd('0x58'),'name',_0x08dd('0x59'),_0x08dd('0x5a'),'internal',_0x08dd('0x5b'),_0x08dd('0x5c'),_0x08dd('0x5d'),_0x08dd('0x5e')],'order':qs[_0x08dd('0x3c')](_0x08dd('0x5f')),'include':[{'model':db[_0x08dd('0x60')],'as':_0x08dd('0x61'),'attributes':['id','name',_0x08dd('0x31')],'through':{'attributes':[]}}]})[_0x08dd('0x29')](function(_0x572dcc){if(_0x572dcc){var _0x52cfe2=_0x2037b9[_0x08dd('0x62')][_0x08dd('0x50')]({'plain':!![]});if(!_0x52cfe2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52cfe2['role']===_0x08dd('0x62')){return db[_0x08dd('0x63')][_0x08dd('0x4d')]({'where':{'name':_0x08dd('0x64'),'userProfileId':_0x52cfe2[_0x08dd('0x65')]},'raw':!![]})['then'](function(_0x344730){if(_0x344730){if(_0x344730[_0x08dd('0x66')]===0x0){return db[_0x08dd('0x67')]['findAll']({'where':{'sectionId':_0x344730['id']},'raw':!![]})['then'](function(_0x2fac51){var _0x15e042=[];if(_['isEmpty'](_0x2fac51)){_0x15e042=_[_0x08dd('0x41')](_0x572dcc,function(_0x36733a){if(_0x36733a[_0x08dd('0x59')]!==_0x08dd('0x56')){return _0x36733a;}});return _0x15e042;}else{for(var _0x143115=0x0;_0x143115<_0x572dcc[_0x08dd('0x49')];_0x143115++){var _0xc1b5e1=_0x572dcc[_0x143115];if(_0xc1b5e1[_0x08dd('0x59')]===_0x08dd('0x56')){var _0x5cd9d1=_[_0x08dd('0x4d')](_0x2fac51,function(_0x445d25){return _0x445d25[_0x08dd('0x68')]===_0xc1b5e1['id'];});if(_0x5cd9d1)_0x15e042[_0x08dd('0x69')](_0xc1b5e1);}else{_0x15e042[_0x08dd('0x69')](_0xc1b5e1);}}return _0x15e042;}});}else{return _0x572dcc;}}else{var _0x127992=_[_0x08dd('0x41')](_0x572dcc,function(_0x238455){if(_0x238455['role']!=='agent'){return _0x238455;}});return _0x127992;}});}else{return _0x572dcc;}}})[_0x08dd('0x29')](function(_0x594cf6){var _0x358641=[];if(_0x594cf6){_0x546fa9=_0x594cf6;for(var _0x1bfe6a=0x0;_0x1bfe6a<_0x594cf6[_0x08dd('0x49')];_0x1bfe6a+=0x1){_0x546fa9[_0x1bfe6a][_0x08dd('0x6a')]=[];_0x358641['push'](db[_0x08dd('0x2f')][_0x08dd('0x4d')]({'where':{'FromId':[_0x2037b9[_0x08dd('0x62')]['id'],_0x594cf6[_0x1bfe6a]['id']],'ToId':[_0x2037b9[_0x08dd('0x62')]['id'],_0x594cf6[_0x1bfe6a]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x08dd('0x6b'),_0x08dd('0x6c'),'body'],'order':qs[_0x08dd('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x08dd('0x29')](wrapUser(_0x594cf6[_0x1bfe6a])));}return BPromise[_0x08dd('0x6d')](_0x358641);}return[];})['then'](function(_0x266fd3){return{'rows':_0x266fd3,'count':_0x266fd3[_0x08dd('0x49')]};})[_0x08dd('0x29')](respondWithResult(_0x5438e7,null))['catch'](handleError(_0x5438e7,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index fe38dd5..a2d3002 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 _0xb435=['emit','hasOwnProperty','exports','events','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x5c6f36,_0xbd2a45){var _0x19569f=function(_0xa98b75){while(--_0xa98b75){_0x5c6f36['push'](_0x5c6f36['shift']());}};_0x19569f(++_0xbd2a45);}(_0xb435,0x13e));var _0x5b43=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb435[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x5b43('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x5b43('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5b43('0x2')](0x0);var events={'afterCreate':_0x5b43('0x3'),'afterUpdate':_0x5b43('0x4'),'afterDestroy':_0x5b43('0x5')};function emitEvent(_0x224c11){return function(_0x41afcd,_0x328b1d,_0x55c9b2){ChatInternalMessageEvents[_0x5b43('0x6')](_0x224c11+':'+_0x41afcd['id'],_0x41afcd);ChatInternalMessageEvents[_0x5b43('0x6')](_0x224c11,_0x41afcd);_0x55c9b2(null);};}for(var e in events){if(events[_0x5b43('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x5b43('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x32e3=['update','remove','emit','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x32e3,0x1d8));var _0x332e=function(_0x5cd3d5,_0x326da8){_0x5cd3d5=_0x5cd3d5-0x0;var _0x3d1993=_0x32e3[_0x5cd3d5];return _0x3d1993;};'use strict';var EventEmitter=require(_0x332e('0x0'));var ChatInternalMessage=require(_0x332e('0x1'))['db'][_0x332e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x332e('0x3')](0x0);var events={'afterCreate':_0x332e('0x4'),'afterUpdate':_0x332e('0x5'),'afterDestroy':_0x332e('0x6')};function emitEvent(_0x4512b3){return function(_0x5c866b,_0x1017db,_0x1a5500){ChatInternalMessageEvents[_0x332e('0x7')](_0x4512b3+':'+_0x5c866b['id'],_0x5c866b);ChatInternalMessageEvents[_0x332e('0x7')](_0x4512b3,_0x5c866b);_0x1a5500(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x332e('0x8')](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 cc62a9d..33cd22c 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 _0x555b=['api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x555b,0xe1));var _0xb555=function(_0xbd499f,_0x315793){_0xbd499f=_0xbd499f-0x0;var _0x2d2d12=_0x555b[_0xbd499f];return _0x2d2d12;};'use strict';var _=require(_0xb555('0x0'));var util=require(_0xb555('0x1'));var logger=require(_0xb555('0x2'))(_0xb555('0x3'));var moment=require(_0xb555('0x4'));var BPromise=require(_0xb555('0x5'));var rp=require(_0xb555('0x6'));var fs=require('fs');var path=require(_0xb555('0x7'));var rimraf=require(_0xb555('0x8'));var config=require('../../config/environment');var attributes=require(_0xb555('0x9'));module[_0xb555('0xa')]=function(_0x4638b8,_0x131e43){return _0x4638b8[_0xb555('0xb')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5f39=['request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x5f39,0x1cb));var _0x95f3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5f39[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x95f3('0x0'));var util=require(_0x95f3('0x1'));var logger=require(_0x95f3('0x2'))(_0x95f3('0x3'));var moment=require(_0x95f3('0x4'));var BPromise=require(_0x95f3('0x5'));var rp=require(_0x95f3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95f3('0x7'));var config=require(_0x95f3('0x8'));var attributes=require(_0x95f3('0x9'));module[_0x95f3('0xa')]=function(_0x4b0f91,_0xf57150){return _0x4b0f91[_0x95f3('0xb')]('ChatInternalMessage',attributes,{'tableName':_0x95f3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x95f3('0xd'),'collate':_0x95f3('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 15d2274..da3f461 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 _0x7721=['client','http','localhost','redis','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xebb209,_0x5b286c){var _0x5f3a20=function(_0x49e974){while(--_0x49e974){_0xebb209['push'](_0xebb209['shift']());}};_0x5f3a20(++_0x5b286c);}(_0x7721,0x115));var _0x1772=function(_0x57c27c,_0x4496ac){_0x57c27c=_0x57c27c-0x0;var _0x2f356e=_0x7721[_0x57c27c];return _0x2f356e;};'use strict';var _=require(_0x1772('0x0'));var util=require(_0x1772('0x1'));var moment=require(_0x1772('0x2'));var BPromise=require(_0x1772('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1772('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1772('0x5'))(_0x1772('0x6'));var config=require(_0x1772('0x7'));var jayson=require(_0x1772('0x8'));var client=jayson[_0x1772('0x9')][_0x1772('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x1772('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1772('0xc')]));require(_0x1772('0xd'))[_0x1772('0xe')](socket);function respondWithRpcPromise(_0xd6e82a,_0xd65598,_0x2b6e89){return new BPromise(function(_0x4630cc,_0x3ffa84){return client[_0x1772('0xf')](_0xd6e82a,_0x2b6e89)[_0x1772('0x10')](function(_0xfb07a8){logger[_0x1772('0x11')](_0x1772('0x12'),_0xd65598,'request\x20sent');logger[_0x1772('0x13')](_0x1772('0x14'),_0xd65598,_0x1772('0x15'),JSON['stringify'](_0xfb07a8));if(_0xfb07a8[_0x1772('0x16')]){if(_0xfb07a8['error']['code']===0x1f4){logger[_0x1772('0x16')](_0x1772('0x12'),_0xd65598,_0xfb07a8[_0x1772('0x16')]['message']);return _0x3ffa84(_0xfb07a8[_0x1772('0x16')]['message']);}logger[_0x1772('0x16')](_0x1772('0x12'),_0xd65598,_0xfb07a8[_0x1772('0x16')]['message']);return _0x4630cc(_0xfb07a8['error'][_0x1772('0x17')]);}else{logger[_0x1772('0x11')](_0x1772('0x12'),_0xd65598,_0x1772('0x15'));_0x4630cc(_0xfb07a8[_0x1772('0x18')]['message']);}})[_0x1772('0x19')](function(_0xd2fdd5){logger['error'](_0x1772('0x12'),_0xd65598,_0xd2fdd5);_0x3ffa84(_0xd2fdd5);});});} \ No newline at end of file +var _0x8881=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0xb37185,_0x3ec508){var _0x575b45=function(_0x2d9b5a){while(--_0x2d9b5a){_0xb37185['push'](_0xb37185['shift']());}};_0x575b45(++_0x3ec508);}(_0x8881,0xd0));var _0x1888=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x8881[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0x1888('0x0'));var util=require(_0x1888('0x1'));var moment=require(_0x1888('0x2'));var BPromise=require(_0x1888('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1888('0x4'))['db'];var utils=require(_0x1888('0x5'));var logger=require('../../config/logger')(_0x1888('0x6'));var config=require('../../config/environment');var jayson=require(_0x1888('0x7'));var client=jayson['client'][_0x1888('0x8')]({'port':0x232a});config[_0x1888('0x9')]=_[_0x1888('0xa')](config[_0x1888('0x9')],{'host':_0x1888('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1888('0x9')]));require(_0x1888('0xc'))[_0x1888('0xd')](socket);function respondWithRpcPromise(_0x276def,_0x37837b,_0x2b9bf9){return new BPromise(function(_0x22ff6b,_0x1da670){return client[_0x1888('0xe')](_0x276def,_0x2b9bf9)[_0x1888('0xf')](function(_0x5eb1a2){logger[_0x1888('0x10')](_0x1888('0x11'),_0x37837b,_0x1888('0x12'));logger[_0x1888('0x13')](_0x1888('0x14'),_0x37837b,_0x1888('0x12'),JSON[_0x1888('0x15')](_0x5eb1a2));if(_0x5eb1a2[_0x1888('0x16')]){if(_0x5eb1a2['error']['code']===0x1f4){logger[_0x1888('0x16')](_0x1888('0x11'),_0x37837b,_0x5eb1a2['error'][_0x1888('0x17')]);return _0x1da670(_0x5eb1a2[_0x1888('0x16')][_0x1888('0x17')]);}logger[_0x1888('0x16')](_0x1888('0x11'),_0x37837b,_0x5eb1a2[_0x1888('0x16')]['message']);return _0x22ff6b(_0x5eb1a2[_0x1888('0x16')]['message']);}else{logger[_0x1888('0x10')](_0x1888('0x11'),_0x37837b,_0x1888('0x12'));_0x22ff6b(_0x5eb1a2[_0x1888('0x18')][_0x1888('0x17')]);}})[_0x1888('0x19')](function(_0x3b3f3e){logger[_0x1888('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x37837b,_0x3b3f3e);_0x1da670(_0x3b3f3e);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 86b4808..84464ff 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 _0x2a91=['./chatInternalMessage.events','remove','update','removeListener'];(function(_0x5ee5ef,_0x2267eb){var _0x1e608d=function(_0x34cf1e){while(--_0x34cf1e){_0x5ee5ef['push'](_0x5ee5ef['shift']());}};_0x1e608d(++_0x2267eb);}(_0x2a91,0x1cc));var _0x12a9=function(_0x3a55a6,_0x4a8738){_0x3a55a6=_0x3a55a6-0x0;var _0xc40765=_0x2a91[_0x3a55a6];return _0xc40765;};'use strict';var ChatInternalMessageEvents=require(_0x12a9('0x0'));var events=['save',_0x12a9('0x1'),_0x12a9('0x2')];function createListener(_0x4c6841,_0x758e24){return function(_0xd4eb28){_0x758e24['emit'](_0x4c6841,_0xd4eb28);};}function removeListener(_0x334c06,_0xe010e){return function(){ChatInternalMessageEvents[_0x12a9('0x3')](_0x334c06,_0xe010e);};}exports['register']=function(_0x548905){for(var _0x3acb73=0x0,_0x4aa20e=events['length'];_0x3acb73<_0x4aa20e;_0x3acb73++){var _0xcb25=events[_0x3acb73];var _0x477274=createListener('chatInternalMessage:'+_0xcb25,_0x548905);ChatInternalMessageEvents['on'](_0xcb25,_0x477274);}}; \ No newline at end of file +var _0x73ce=['save','remove','update','emit','register','length','./chatInternalMessage.events'];(function(_0x91964a,_0x2dc2f6){var _0x4490b1=function(_0x3ed329){while(--_0x3ed329){_0x91964a['push'](_0x91964a['shift']());}};_0x4490b1(++_0x2dc2f6);}(_0x73ce,0x172));var _0xe73c=function(_0x535fef,_0x416c17){_0x535fef=_0x535fef-0x0;var _0x545e9b=_0x73ce[_0x535fef];return _0x545e9b;};'use strict';var ChatInternalMessageEvents=require(_0xe73c('0x0'));var events=[_0xe73c('0x1'),_0xe73c('0x2'),_0xe73c('0x3')];function createListener(_0x17d472,_0x193b81){return function(_0x5522ca){_0x193b81[_0xe73c('0x4')](_0x17d472,_0x5522ca);};}function removeListener(_0x4edb32,_0x3fec1d){return function(){ChatInternalMessageEvents['removeListener'](_0x4edb32,_0x3fec1d);};}exports[_0xe73c('0x5')]=function(_0x1b131c){for(var _0x1cd963=0x0,_0x5ed683=events[_0xe73c('0x6')];_0x1cd963<_0x5ed683;_0x1cd963++){var _0x53cde7=events[_0x1cd963];var _0x33ffd7=createListener('chatInternalMessage:'+_0x53cde7,_0x1b131c);ChatInternalMessageEvents['on'](_0x53cde7,_0x33ffd7);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 1fbcaf9..f93c5ce 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 _0xbe58=['index','describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x33c090,_0x184b69){var _0x4081df=function(_0x109a20){while(--_0x109a20){_0x33c090['push'](_0x33c090['shift']());}};_0x4081df(++_0x184b69);}(_0xbe58,0x90));var _0x8be5=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xbe58[_0x36eaaa];return _0x461349;};'use strict';var multer=require(_0x8be5('0x0'));var util=require(_0x8be5('0x1'));var path=require(_0x8be5('0x2'));var timeout=require('connect-timeout');var express=require(_0x8be5('0x3'));var router=express[_0x8be5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8be5('0x5'));var interaction=require(_0x8be5('0x6'));var config=require('../../config/environment');var controller=require(_0x8be5('0x7'));router[_0x8be5('0x8')]('/',auth[_0x8be5('0x9')](),controller[_0x8be5('0xa')]);router['get']('/describe',auth[_0x8be5('0x9')](),controller[_0x8be5('0xb')]);router[_0x8be5('0x8')](_0x8be5('0xc'),auth['isAuthenticated'](),controller[_0x8be5('0xd')]);router[_0x8be5('0x8')](_0x8be5('0xe'),auth[_0x8be5('0x9')](),controller[_0x8be5('0xf')]);router[_0x8be5('0x10')]('/',auth[_0x8be5('0x9')](),controller[_0x8be5('0x11')]);router[_0x8be5('0x12')](_0x8be5('0xe'),controller[_0x8be5('0x13')]);router[_0x8be5('0x14')](_0x8be5('0xe'),auth[_0x8be5('0x9')](),controller[_0x8be5('0x15')]);module['exports']=router; \ No newline at end of file +var _0x418c=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x340a1a,_0x47003a){var _0x1f13e5=function(_0x28ef88){while(--_0x28ef88){_0x340a1a['push'](_0x340a1a['shift']());}};_0x1f13e5(++_0x47003a);}(_0x418c,0x13f));var _0xc418=function(_0x1f7524,_0x56f235){_0x1f7524=_0x1f7524-0x0;var _0x210671=_0x418c[_0x1f7524];return _0x210671;};'use strict';var multer=require('multer');var util=require(_0xc418('0x0'));var path=require(_0xc418('0x1'));var timeout=require(_0xc418('0x2'));var express=require(_0xc418('0x3'));var router=express['Router']();var fs_extra=require(_0xc418('0x4'));var auth=require(_0xc418('0x5'));var interaction=require(_0xc418('0x6'));var config=require(_0xc418('0x7'));var controller=require(_0xc418('0x8'));router[_0xc418('0x9')]('/',auth[_0xc418('0xa')](),controller['index']);router[_0xc418('0x9')](_0xc418('0xb'),auth[_0xc418('0xa')](),controller[_0xc418('0xc')]);router[_0xc418('0x9')](_0xc418('0xd'),auth[_0xc418('0xa')](),controller[_0xc418('0xe')]);router[_0xc418('0x9')](_0xc418('0xf'),auth['isAuthenticated'](),controller[_0xc418('0x10')]);router[_0xc418('0x11')]('/',auth[_0xc418('0xa')](),controller['create']);router[_0xc418('0x12')](_0xc418('0xf'),controller[_0xc418('0x13')]);router[_0xc418('0x14')](_0xc418('0xf'),auth['isAuthenticated'](),controller[_0xc418('0x15')]);module[_0xc418('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index b83517c..da54004 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 _0xfd6f=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x3a9b70,_0x3b362a){var _0x11d6b5=function(_0x87a9db){while(--_0x87a9db){_0x3a9b70['push'](_0x3a9b70['shift']());}};_0x11d6b5(++_0x3b362a);}(_0xfd6f,0x19d));var _0xffd6=function(_0x225d7e,_0x1e8eed){_0x225d7e=_0x225d7e-0x0;var _0x3924d4=_0xfd6f[_0x225d7e];return _0x3924d4;};'use strict';var Sequelize=require(_0xffd6('0x0'));module[_0xffd6('0x1')]={'body':{'type':Sequelize[_0xffd6('0x2')](_0xffd6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xffd6('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xffd6('0x5')]('in',_0xffd6('0x6')),'defaultValue':_0xffd6('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xffd6('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xffd6('0x2')]}}; \ No newline at end of file +var _0x5c00=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x12d0bb,_0x56430a){var _0x44e5af=function(_0x1c0db0){while(--_0x1c0db0){_0x12d0bb['push'](_0x12d0bb['shift']());}};_0x44e5af(++_0x56430a);}(_0x5c00,0x17e));var _0x05c0=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x5c00[_0x1ebce2];return _0x4a330c;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'body':{'type':Sequelize[_0x05c0('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x05c0('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x05c0('0x4')]('in',_0x05c0('0x5')),'defaultValue':_0x05c0('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x05c0('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x05c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 531e169..4e08110 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 _0x0bb7=['order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','params','ChatMessage','find','create','body','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','isNil','format','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','email','interface','SIP/%s','channel','event','EventManager','acceptmessage','formData','reject','get','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','QueryTypes','fullname','internal','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','stack','send','index','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x409afc,_0x1f3328){var _0x12f0ff=function(_0x2c7882){while(--_0x2c7882){_0x409afc['push'](_0x409afc['shift']());}};_0x12f0ff(++_0x1f3328);}(_0x0bb7,0x14c));var _0x70bb=function(_0x34cf01,_0x4b9987){_0x34cf01=_0x34cf01-0x0;var _0x24b81a=_0x0bb7[_0x34cf01];return _0x24b81a;};'use strict';var emlformat=require(_0x70bb('0x0'));var rimraf=require(_0x70bb('0x1'));var zipdir=require(_0x70bb('0x2'));var jsonpatch=require(_0x70bb('0x3'));var rp=require(_0x70bb('0x4'));var moment=require('moment');var BPromise=require(_0x70bb('0x5'));var Mustache=require('mustache');var util=require(_0x70bb('0x6'));var path=require(_0x70bb('0x7'));var sox=require('sox');var csv=require(_0x70bb('0x8'));var ejs=require(_0x70bb('0x9'));var fs=require('fs');var fs_extra=require(_0x70bb('0xa'));var _=require(_0x70bb('0xb'));var squel=require(_0x70bb('0xc'));var crypto=require(_0x70bb('0xd'));var jsforce=require(_0x70bb('0xe'));var deskjs=require(_0x70bb('0xf'));var toCsv=require(_0x70bb('0x8'));var querystring=require(_0x70bb('0x10'));var Papa=require(_0x70bb('0x11'));var Redis=require(_0x70bb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x70bb('0x13'));var as=require(_0x70bb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70bb('0x15'))('api');var utils=require(_0x70bb('0x16'));var config=require(_0x70bb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x70bb('0x18'))['db'];config[_0x70bb('0x19')]=_[_0x70bb('0x1a')](config['redis'],{'host':_0x70bb('0x1b'),'port':0x18eb});var socket=require(_0x70bb('0x1c'))(new Redis(config[_0x70bb('0x19')]));require(_0x70bb('0x1d'))[_0x70bb('0x1e')](socket);var jayson=require(_0x70bb('0x1f'));var client=jayson[_0x70bb('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x70bb('0x20')][_0x70bb('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1e1c0c,_0x16fe3a,_0x5f044e,_0x1e319a){return new BPromise(function(_0x3d26f3,_0x3c6ad6){var _0x454cea=_0x1e319a||client;return _0x454cea[_0x70bb('0x22')](_0x1e1c0c,_0x5f044e)['then'](function(_0x281ca7){logger['info'](_0x70bb('0x23'),_0x16fe3a,'request\x20sent');logger[_0x70bb('0x24')](_0x70bb('0x25'),_0x16fe3a,_0x70bb('0x26'),JSON[_0x70bb('0x27')](_0x281ca7));if(_0x281ca7[_0x70bb('0x28')]){if(_0x281ca7[_0x70bb('0x28')][_0x70bb('0x29')]===0x1f4){logger[_0x70bb('0x28')](_0x70bb('0x23'),_0x16fe3a,_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);return _0x3c6ad6(_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);}logger[_0x70bb('0x28')](_0x70bb('0x23'),_0x16fe3a,_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);return _0x3d26f3(_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);}else{logger[_0x70bb('0x2b')](_0x70bb('0x23'),_0x16fe3a,'request\x20sent');_0x3d26f3(_0x281ca7[_0x70bb('0x2c')][_0x70bb('0x2a')]);}})[_0x70bb('0x2d')](function(_0x5d2cb4){logger[_0x70bb('0x28')](_0x70bb('0x23'),_0x16fe3a,_0x5d2cb4);_0x3c6ad6(_0x5d2cb4);});});}function respondWithStatusCode(_0x27a511,_0x225518){_0x225518=_0x225518||0xcc;return function(_0x167d5a){if(_0x167d5a){return _0x27a511[_0x70bb('0x2e')](_0x225518);}return _0x27a511['status'](_0x225518)[_0x70bb('0x2f')]();};}function respondWithResult(_0x43745f,_0x2cc13c){_0x2cc13c=_0x2cc13c||0xc8;return function(_0x40c0f7){if(_0x40c0f7){return _0x43745f[_0x70bb('0x30')](_0x2cc13c)['json'](_0x40c0f7);}};}function respondWithFilteredResult(_0x4c50bd,_0x415f10){return function(_0x3079e0){if(_0x3079e0){var _0x36c4c8=typeof _0x415f10[_0x70bb('0x31')]===_0x70bb('0x32')&&typeof _0x415f10[_0x70bb('0x33')]===_0x70bb('0x32');var _0x9600c8=_0x3079e0[_0x70bb('0x34')];var _0x2d87c1=_0x36c4c8?0x0:_0x415f10[_0x70bb('0x31')];var _0x1e4769=_0x36c4c8?_0x3079e0[_0x70bb('0x34')]:_0x415f10['offset']+_0x415f10[_0x70bb('0x33')];var _0x58532b;if(_0x1e4769>=_0x9600c8){_0x1e4769=_0x9600c8;_0x58532b=0xc8;}else{_0x58532b=0xce;}_0x4c50bd[_0x70bb('0x30')](_0x58532b);return _0x4c50bd[_0x70bb('0x35')](_0x70bb('0x36'),_0x2d87c1+'-'+_0x1e4769+'/'+_0x9600c8)[_0x70bb('0x37')](_0x3079e0);}return null;};}function patchUpdates(_0x43102d){return function(_0x3e990c){try{jsonpatch[_0x70bb('0x38')](_0x3e990c,_0x43102d,!![]);}catch(_0x501d56){return BPromise['reject'](_0x501d56);}return _0x3e990c[_0x70bb('0x39')]();};}function saveUpdates(_0x16669c,_0x29ca30){return function(_0x1554c8){if(_0x1554c8){return _0x1554c8[_0x70bb('0x3a')](_0x16669c)[_0x70bb('0x3b')](function(_0xb5dc32){return _0xb5dc32;});}return null;};}function removeEntity(_0x1e27e4,_0x39753e){return function(_0x165427){if(_0x165427){return _0x165427[_0x70bb('0x3c')]()['then'](function(){_0x1e27e4['status'](0xcc)[_0x70bb('0x2f')]();});}};}function handleEntityNotFound(_0x3299a6,_0x33d85e){return function(_0x41d561){if(!_0x41d561){_0x3299a6[_0x70bb('0x2e')](0x194);}return _0x41d561;};}function handleError(_0x358b05,_0x704ce5){_0x704ce5=_0x704ce5||0x1f4;return function(_0x58d741){logger['error'](_0x58d741[_0x70bb('0x3d')]);if(_0x58d741['name']){delete _0x58d741['name'];}_0x358b05['status'](_0x704ce5)[_0x70bb('0x3e')](_0x58d741);};}exports[_0x70bb('0x3f')]=function(_0x291be7,_0x4f2ad6){var _0x282162={},_0x4bd656={},_0x1ec123={'count':0x0,'rows':[]};var _0x7f445d=_['map'](db['ChatMessage'][_0x70bb('0x40')],function(_0x32c509){return{'name':_0x32c509['fieldName'],'type':_0x32c509[_0x70bb('0x41')][_0x70bb('0x42')]};});_0x4bd656[_0x70bb('0x43')]=_[_0x70bb('0x44')](_0x7f445d,_0x70bb('0x45'));_0x4bd656[_0x70bb('0x46')]=_[_0x70bb('0x47')](_0x291be7[_0x70bb('0x46')]);_0x4bd656[_0x70bb('0x48')]=_[_0x70bb('0x49')](_0x4bd656[_0x70bb('0x43')],_0x4bd656['query']);_0x282162['attributes']=_[_0x70bb('0x49')](_0x4bd656[_0x70bb('0x43')],qs[_0x70bb('0x4a')](_0x291be7['query'][_0x70bb('0x4a')]));_0x282162[_0x70bb('0x4b')]=_0x282162[_0x70bb('0x4b')][_0x70bb('0x4c')]?_0x282162['attributes']:_0x4bd656['model'];if(!_0x291be7[_0x70bb('0x46')][_0x70bb('0x4d')](_0x70bb('0x4e'))){_0x282162[_0x70bb('0x33')]=qs[_0x70bb('0x33')](_0x291be7[_0x70bb('0x46')][_0x70bb('0x33')]);_0x282162['offset']=qs[_0x70bb('0x31')](_0x291be7['query'][_0x70bb('0x31')]);}_0x282162[_0x70bb('0x4f')]=qs[_0x70bb('0x50')](_0x291be7[_0x70bb('0x46')][_0x70bb('0x50')]);_0x282162[_0x70bb('0x51')]=qs[_0x70bb('0x48')](_[_0x70bb('0x52')](_0x291be7['query'],_0x4bd656[_0x70bb('0x48')]),_0x7f445d);if(_0x291be7[_0x70bb('0x46')]['filter']){_0x282162[_0x70bb('0x51')]=_[_0x70bb('0x53')](_0x282162['where'],{'$or':_[_0x70bb('0x44')](_0x7f445d,function(_0x365fb4){if(_0x365fb4[_0x70bb('0x41')]!==_0x70bb('0x54')){var _0x559a3a={};_0x559a3a[_0x365fb4['name']]={'$like':'%'+_0x291be7[_0x70bb('0x46')][_0x70bb('0x55')]+'%'};return _0x559a3a;}})});}_0x282162=_['merge']({},_0x282162,_0x291be7[_0x70bb('0x56')]);var _0x37d2ab={'where':_0x282162[_0x70bb('0x51')]};return db['ChatMessage']['count'](_0x37d2ab)[_0x70bb('0x3b')](function(_0xe06b59){_0x1ec123[_0x70bb('0x34')]=_0xe06b59;if(_0x291be7['query']['includeAll']){_0x282162[_0x70bb('0x57')]=[{'all':!![]}];}return db['ChatMessage'][_0x70bb('0x58')](_0x282162);})[_0x70bb('0x3b')](function(_0x3540bd){_0x1ec123['rows']=_0x3540bd;return _0x1ec123;})[_0x70bb('0x3b')](respondWithFilteredResult(_0x4f2ad6,_0x282162))[_0x70bb('0x2d')](handleError(_0x4f2ad6,null));};exports['show']=function(_0x26f2f2,_0x3f4929){var _0x59d619={'raw':!![],'where':{'id':_0x26f2f2[_0x70bb('0x59')]['id']}},_0x11d815={};_0x11d815[_0x70bb('0x43')]=_[_0x70bb('0x47')](db[_0x70bb('0x5a')][_0x70bb('0x40')]);_0x11d815[_0x70bb('0x46')]=_[_0x70bb('0x47')](_0x26f2f2['query']);_0x11d815[_0x70bb('0x48')]=_[_0x70bb('0x49')](_0x11d815[_0x70bb('0x43')],_0x11d815[_0x70bb('0x46')]);_0x59d619[_0x70bb('0x4b')]=_['intersection'](_0x11d815[_0x70bb('0x43')],qs[_0x70bb('0x4a')](_0x26f2f2[_0x70bb('0x46')]['fields']));_0x59d619['attributes']=_0x59d619[_0x70bb('0x4b')][_0x70bb('0x4c')]?_0x59d619[_0x70bb('0x4b')]:_0x11d815[_0x70bb('0x43')];if(_0x26f2f2[_0x70bb('0x46')]['includeAll']){_0x59d619[_0x70bb('0x57')]=[{'all':!![]}];}_0x59d619=_[_0x70bb('0x53')]({},_0x59d619,_0x26f2f2[_0x70bb('0x56')]);return db[_0x70bb('0x5a')][_0x70bb('0x5b')](_0x59d619)[_0x70bb('0x3b')](handleEntityNotFound(_0x3f4929,null))[_0x70bb('0x3b')](respondWithResult(_0x3f4929,null))['catch'](handleError(_0x3f4929,null));};exports['create']=function(_0x31f3c3,_0x30ee14){return db[_0x70bb('0x5a')][_0x70bb('0x5c')](_0x31f3c3[_0x70bb('0x5d')],{})[_0x70bb('0x3b')](respondWithResult(_0x30ee14,0xc9))[_0x70bb('0x2d')](handleError(_0x30ee14,null));};exports[_0x70bb('0x3a')]=function(_0x3f1b6c,_0x170e1a){if(_0x3f1b6c[_0x70bb('0x5d')]['id']){delete _0x3f1b6c[_0x70bb('0x5d')]['id'];}return db[_0x70bb('0x5a')][_0x70bb('0x5b')]({'where':{'id':_0x3f1b6c[_0x70bb('0x59')]['id']}})[_0x70bb('0x3b')](handleEntityNotFound(_0x170e1a,null))['then'](saveUpdates(_0x3f1b6c[_0x70bb('0x5d')],null))[_0x70bb('0x3b')](respondWithResult(_0x170e1a,null))[_0x70bb('0x2d')](handleError(_0x170e1a,null));};exports['destroy']=function(_0x30d89d,_0x37a9f2){return db[_0x70bb('0x5a')]['find']({'where':{'id':_0x30d89d[_0x70bb('0x59')]['id']}})['then'](handleEntityNotFound(_0x37a9f2,null))[_0x70bb('0x3b')](removeEntity(_0x37a9f2,null))[_0x70bb('0x2d')](handleError(_0x37a9f2,null));};exports['describe']=function(_0x21f2cd,_0x31a43f){return db[_0x70bb('0x5a')][_0x70bb('0x5e')]()[_0x70bb('0x3b')](respondWithResult(_0x31a43f,null))[_0x70bb('0x2d')](handleError(_0x31a43f,null));};var interaction_log=require('../../config/logger')(_0x70bb('0x5f'));exports[_0x70bb('0x60')]=function(_0x522c58,_0x7d50ce,_0x55891c){var _0x10594a={'agent':{},'channel':_0x70bb('0x61')};if(_0x522c58[_0x70bb('0x5d')]['id']){delete _0x522c58[_0x70bb('0x5d')]['id'];}_0x522c58['body'][_0x70bb('0x62')]=!![];_0x522c58[_0x70bb('0x5d')][_0x70bb('0x63')]=moment()['format'](_0x70bb('0x64'));_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')]=_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')]||_0x522c58[_0x70bb('0x66')]['id'];_0x10594a[_0x70bb('0x67')]['id']=_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')];return db[_0x70bb('0x5a')][_0x70bb('0x5b')]({'where':{'id':_0x522c58[_0x70bb('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x7d50ce,null))[_0x70bb('0x3b')](saveUpdates(_0x522c58[_0x70bb('0x5d')],null))['then'](function(_0x12e70d){if(_0x12e70d){_0x10594a[_0x70bb('0x2a')]=_0x12e70d['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x12e70d['ChatInteractionId']}});}return null;})[_0x70bb('0x3b')](handleEntityNotFound(_0x7d50ce,null))['then'](function(_0x221aaa){if(_0x221aaa){return _0x221aaa[_0x70bb('0x3a')]({'UserId':_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')],'read1stAt':_[_0x70bb('0x68')](_0x221aaa['read1stAt'])?moment()[_0x70bb('0x69')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1c616c){if(_0x1c616c){_0x10594a[_0x70bb('0x6a')]=_0x1c616c['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x522c58[_0x70bb('0x66')]['id'],_0x522c58[_0x70bb('0x66')]['name'],_0x522c58[_0x70bb('0x66')][_0x70bb('0x6b')],_0x10594a[_0x70bb('0x6a')]['id'],_0x522c58['body']?JSON[_0x70bb('0x27')](_0x522c58['body']):_0x70bb('0x6c'));return respondWithRpcPromise(_0x70bb('0x6d'),_0x70bb('0x6e'),_0x10594a);}return null;})[_0x70bb('0x3b')](function(_0x5bf286){var _0x20c56a=_0x70bb('0x6f')+_0x5bf286[_0x70bb('0x2a')][_0x70bb('0x70')];return db[_0x70bb('0x71')][_0x70bb('0x46')](_0x20c56a,{'type':db['Sequelize']['QueryTypes'][_0x70bb('0x72')],'raw':!![]})[_0x70bb('0x3b')](function(_0x4fbba7){return _0x4fbba7;});})['then'](function(_0x318e30){if(_0x318e30){_0x10594a[_0x70bb('0x2a')][_0x70bb('0x73')]=_0x318e30[0x0];if(!_0x522c58[_0x70bb('0x5d')]['UserId'])return;return db[_0x70bb('0x74')][_0x70bb('0x5b')]({'where':{'id':_0x522c58[_0x70bb('0x5d')]['UserId'],'role':_0x70bb('0x67')},'attributes':['id',_0x70bb('0x45'),'fullname',_0x70bb('0x75'),'internal'],'raw':!![]});}return null;})[_0x70bb('0x3b')](function(_0x42bb8a){if(!_0x42bb8a)return null;_0x10594a['message']['agent']=_0x42bb8a;return _0x10594a;})[_0x70bb('0x3b')](function(_0x57029e){if(_0x57029e){if(_0x522c58['body']['manual']){_0x10594a['message'][_0x70bb('0x76')]=util[_0x70bb('0x69')](_0x70bb('0x77'),_0x522c58[_0x70bb('0x66')][_0x70bb('0x45')]);_0x10594a['message']['channel']=_0x10594a[_0x70bb('0x78')];_0x10594a[_0x70bb('0x2a')]['motionChannel']=_0x10594a['channel'];_0x10594a[_0x70bb('0x2a')][_0x70bb('0x79')]='accept';return respondWithRpcPromise(_0x70bb('0x7a'),_0x70bb('0x7a'),{'event':_0x70bb('0x7b'),'message':_[_0x70bb('0x53')](_0x10594a[_0x70bb('0x2a')],JSON['parse'](_0x10594a[_0x70bb('0x6a')][_0x70bb('0x7c')]))},client9002)['then'](function(){return _0x10594a;});}return _0x10594a;}return null;})[_0x70bb('0x3b')](respondWithResult(_0x7d50ce,null))[_0x70bb('0x2d')](handleError(_0x7d50ce,null));};var interaction_log=require(_0x70bb('0x15'))(_0x70bb('0x5f'));exports[_0x70bb('0x7d')]=function(_0x5777a0,_0x58f136,_0x352986){var _0x52916d={'agent':{},'channel':_0x70bb('0x61')};if(_0x5777a0[_0x70bb('0x5d')]['id']){delete _0x5777a0['body']['id'];}_0x5777a0[_0x70bb('0x5d')][_0x70bb('0x65')]=_0x5777a0[_0x70bb('0x5d')][_0x70bb('0x65')]||_0x5777a0['user']['id'];_0x52916d[_0x70bb('0x67')]['id']=_0x5777a0['body']['UserId'];return db[_0x70bb('0x5a')][_0x70bb('0x5b')]({'where':{'id':_0x5777a0[_0x70bb('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x58f136,null))[_0x70bb('0x3b')](function(_0x3c67fd){if(_0x3c67fd){_0x52916d[_0x70bb('0x2a')]=_0x3c67fd[_0x70bb('0x7e')]({'plain':!![]});return db['ChatInteraction'][_0x70bb('0x5b')]({'where':{'id':_0x3c67fd[_0x70bb('0x7f')]}});}return null;})[_0x70bb('0x3b')](handleEntityNotFound(_0x58f136,null))[_0x70bb('0x3b')](function(_0x1aa14f){if(_0x1aa14f){_0x52916d['interaction']=_0x1aa14f[_0x70bb('0x7e')]({'plain':!![]});interaction_log[_0x70bb('0x2b')](_0x70bb('0x80'),_0x5777a0['user']['id'],_0x5777a0[_0x70bb('0x66')][_0x70bb('0x45')],_0x5777a0[_0x70bb('0x66')]['role'],_0x52916d[_0x70bb('0x6a')]['id'],_0x5777a0[_0x70bb('0x5d')]?JSON[_0x70bb('0x27')](_0x5777a0[_0x70bb('0x5d')]):'null');return respondWithRpcPromise(_0x70bb('0x81'),_0x70bb('0x82'),_0x52916d);}return null;})[_0x70bb('0x3b')](function(_0x3334a8){var _0x449c9c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3334a8[_0x70bb('0x2a')]['ContactId'];return db[_0x70bb('0x71')][_0x70bb('0x46')](_0x449c9c,{'type':db[_0x70bb('0x83')][_0x70bb('0x84')][_0x70bb('0x72')],'raw':!![]})[_0x70bb('0x3b')](function(_0x3a161c){return _0x3a161c;});})[_0x70bb('0x3b')](function(_0x182186){if(_0x182186){_0x52916d[_0x70bb('0x2a')][_0x70bb('0x73')]=_0x182186[0x0];if(!_0x5777a0['body'][_0x70bb('0x65')])return;return db[_0x70bb('0x74')]['find']({'where':{'id':_0x5777a0[_0x70bb('0x5d')]['UserId'],'role':_0x70bb('0x67')},'attributes':['id',_0x70bb('0x45'),_0x70bb('0x85'),_0x70bb('0x75'),_0x70bb('0x86')],'raw':!![]});}return null;})[_0x70bb('0x3b')](function(_0x110b42){if(!_0x110b42)return null;_0x52916d[_0x70bb('0x2a')][_0x70bb('0x67')]=_0x110b42;return _0x52916d;})[_0x70bb('0x3b')](function(_0x537598){if(_0x537598){_0x537598[_0x70bb('0x2a')][_0x70bb('0x76')]=util['format'](_0x70bb('0x77'),_0x5777a0[_0x70bb('0x66')][_0x70bb('0x45')]);_0x537598[_0x70bb('0x2a')][_0x70bb('0x78')]=_0x52916d[_0x70bb('0x78')];_0x537598[_0x70bb('0x2a')][_0x70bb('0x87')]=_0x52916d[_0x70bb('0x78')];_0x537598[_0x70bb('0x2a')][_0x70bb('0x79')]=_0x70bb('0x7d');respondWithRpcPromise(_0x70bb('0x7a'),_0x70bb('0x7a'),{'event':_0x70bb('0x88'),'message':_[_0x70bb('0x53')](_0x52916d[_0x70bb('0x2a')],JSON['parse'](_0x52916d[_0x70bb('0x6a')]['formData']))},client9002);return _0x52916d;}return null;})[_0x70bb('0x3b')](respondWithResult(_0x58f136,null))[_0x70bb('0x2d')](handleError(_0x58f136,null));}; \ No newline at end of file +var _0x8aed=['interface','channel','event','EventManager','acceptmessage','parse','../../config/logger','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','User','fullname','internal','SIP/%s','rejectmessage','formData','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','show','params','keys','fields','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','manual'];(function(_0x27968c,_0x5f4dbd){var _0x3cfb3a=function(_0x296d49){while(--_0x296d49){_0x27968c['push'](_0x27968c['shift']());}};_0x3cfb3a(++_0x5f4dbd);}(_0x8aed,0x96));var _0xd8ae=function(_0x4e8799,_0x2854ba){_0x4e8799=_0x4e8799-0x0;var _0x366238=_0x8aed[_0x4e8799];return _0x366238;};'use strict';var emlformat=require(_0xd8ae('0x0'));var rimraf=require(_0xd8ae('0x1'));var zipdir=require(_0xd8ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8ae('0x3'));var moment=require(_0xd8ae('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd8ae('0x5'));var util=require(_0xd8ae('0x6'));var path=require('path');var sox=require(_0xd8ae('0x7'));var csv=require(_0xd8ae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8ae('0x9'));var _=require(_0xd8ae('0xa'));var squel=require(_0xd8ae('0xb'));var crypto=require(_0xd8ae('0xc'));var jsforce=require(_0xd8ae('0xd'));var deskjs=require(_0xd8ae('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd8ae('0xf'));var Papa=require(_0xd8ae('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd8ae('0x11'));var as=require(_0xd8ae('0x12'));var hardwareService=require(_0xd8ae('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd8ae('0x14'));var config=require(_0xd8ae('0x15'));var licenseUtil=require(_0xd8ae('0x16'));var db=require(_0xd8ae('0x17'))['db'];config[_0xd8ae('0x18')]=_[_0xd8ae('0x19')](config[_0xd8ae('0x18')],{'host':_0xd8ae('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd8ae('0x18')]));require(_0xd8ae('0x1b'))[_0xd8ae('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd8ae('0x1d')][_0xd8ae('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xd8ae('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5ea127,_0x506bf0,_0x48d56d,_0x312a79){return new BPromise(function(_0x192ea5,_0x27e189){var _0x2b84f8=_0x312a79||client;return _0x2b84f8[_0xd8ae('0x1f')](_0x5ea127,_0x48d56d)[_0xd8ae('0x20')](function(_0x3b8bca){logger[_0xd8ae('0x21')](_0xd8ae('0x22'),_0x506bf0,_0xd8ae('0x23'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x506bf0,_0xd8ae('0x23'),JSON[_0xd8ae('0x24')](_0x3b8bca));if(_0x3b8bca['error']){if(_0x3b8bca[_0xd8ae('0x25')][_0xd8ae('0x26')]===0x1f4){logger[_0xd8ae('0x25')]('ChatMessage,\x20%s,\x20%s',_0x506bf0,_0x3b8bca[_0xd8ae('0x25')]['message']);return _0x27e189(_0x3b8bca['error'][_0xd8ae('0x27')]);}logger[_0xd8ae('0x25')](_0xd8ae('0x22'),_0x506bf0,_0x3b8bca['error'][_0xd8ae('0x27')]);return _0x192ea5(_0x3b8bca[_0xd8ae('0x25')][_0xd8ae('0x27')]);}else{logger[_0xd8ae('0x21')](_0xd8ae('0x22'),_0x506bf0,'request\x20sent');_0x192ea5(_0x3b8bca[_0xd8ae('0x28')][_0xd8ae('0x27')]);}})[_0xd8ae('0x29')](function(_0x4fb645){logger[_0xd8ae('0x25')](_0xd8ae('0x22'),_0x506bf0,_0x4fb645);_0x27e189(_0x4fb645);});});}function respondWithStatusCode(_0x4cf479,_0x55f57e){_0x55f57e=_0x55f57e||0xcc;return function(_0xcffeb3){if(_0xcffeb3){return _0x4cf479[_0xd8ae('0x2a')](_0x55f57e);}return _0x4cf479['status'](_0x55f57e)['end']();};}function respondWithResult(_0x503e60,_0x537a93){_0x537a93=_0x537a93||0xc8;return function(_0x42e64b){if(_0x42e64b){return _0x503e60[_0xd8ae('0x2b')](_0x537a93)[_0xd8ae('0x2c')](_0x42e64b);}};}function respondWithFilteredResult(_0x50f82c,_0x3e25e2){return function(_0x424e71){if(_0x424e71){var _0x1c6a44=typeof _0x3e25e2[_0xd8ae('0x2d')]===_0xd8ae('0x2e')&&typeof _0x3e25e2[_0xd8ae('0x2f')]===_0xd8ae('0x2e');var _0x4ae93f=_0x424e71['count'];var _0x17bbf2=_0x1c6a44?0x0:_0x3e25e2['offset'];var _0x198117=_0x1c6a44?_0x424e71['count']:_0x3e25e2[_0xd8ae('0x2d')]+_0x3e25e2[_0xd8ae('0x2f')];var _0x14e0a5;if(_0x198117>=_0x4ae93f){_0x198117=_0x4ae93f;_0x14e0a5=0xc8;}else{_0x14e0a5=0xce;}_0x50f82c[_0xd8ae('0x2b')](_0x14e0a5);return _0x50f82c['set'](_0xd8ae('0x30'),_0x17bbf2+'-'+_0x198117+'/'+_0x4ae93f)[_0xd8ae('0x2c')](_0x424e71);}return null;};}function patchUpdates(_0x32b0da){return function(_0x3e0e92){try{jsonpatch[_0xd8ae('0x31')](_0x3e0e92,_0x32b0da,!![]);}catch(_0x512f46){return BPromise[_0xd8ae('0x32')](_0x512f46);}return _0x3e0e92[_0xd8ae('0x33')]();};}function saveUpdates(_0x27c7bf,_0x594bfb){return function(_0x557c4b){if(_0x557c4b){return _0x557c4b[_0xd8ae('0x34')](_0x27c7bf)[_0xd8ae('0x20')](function(_0x15404b){return _0x15404b;});}return null;};}function removeEntity(_0x1741c0,_0x5c7f26){return function(_0x5765a0){if(_0x5765a0){return _0x5765a0[_0xd8ae('0x35')]()[_0xd8ae('0x20')](function(){_0x1741c0['status'](0xcc)[_0xd8ae('0x36')]();});}};}function handleEntityNotFound(_0x1f239c,_0x2f00f4){return function(_0x386343){if(!_0x386343){_0x1f239c[_0xd8ae('0x2a')](0x194);}return _0x386343;};}function handleError(_0x5c21ca,_0x58f6d8){_0x58f6d8=_0x58f6d8||0x1f4;return function(_0x330f73){logger[_0xd8ae('0x25')](_0x330f73[_0xd8ae('0x37')]);if(_0x330f73['name']){delete _0x330f73[_0xd8ae('0x38')];}_0x5c21ca['status'](_0x58f6d8)[_0xd8ae('0x39')](_0x330f73);};}exports[_0xd8ae('0x3a')]=function(_0x21c63c,_0x575fae){var _0x2b4133={},_0x4cea34={},_0x2d7b47={'count':0x0,'rows':[]};var _0x473dd2=_[_0xd8ae('0x3b')](db[_0xd8ae('0x3c')][_0xd8ae('0x3d')],function(_0x1e6cac){return{'name':_0x1e6cac[_0xd8ae('0x3e')],'type':_0x1e6cac['type'][_0xd8ae('0x3f')]};});_0x4cea34[_0xd8ae('0x40')]=_[_0xd8ae('0x3b')](_0x473dd2,_0xd8ae('0x38'));_0x4cea34['query']=_['keys'](_0x21c63c[_0xd8ae('0x41')]);_0x4cea34[_0xd8ae('0x42')]=_[_0xd8ae('0x43')](_0x4cea34[_0xd8ae('0x40')],_0x4cea34[_0xd8ae('0x41')]);_0x2b4133['attributes']=_[_0xd8ae('0x43')](_0x4cea34[_0xd8ae('0x40')],qs['fields'](_0x21c63c[_0xd8ae('0x41')]['fields']));_0x2b4133[_0xd8ae('0x44')]=_0x2b4133[_0xd8ae('0x44')][_0xd8ae('0x45')]?_0x2b4133[_0xd8ae('0x44')]:_0x4cea34[_0xd8ae('0x40')];if(!_0x21c63c[_0xd8ae('0x41')][_0xd8ae('0x46')]('nolimit')){_0x2b4133[_0xd8ae('0x2f')]=qs['limit'](_0x21c63c['query']['limit']);_0x2b4133[_0xd8ae('0x2d')]=qs[_0xd8ae('0x2d')](_0x21c63c[_0xd8ae('0x41')][_0xd8ae('0x2d')]);}_0x2b4133[_0xd8ae('0x47')]=qs[_0xd8ae('0x48')](_0x21c63c['query'][_0xd8ae('0x48')]);_0x2b4133[_0xd8ae('0x49')]=qs[_0xd8ae('0x42')](_[_0xd8ae('0x4a')](_0x21c63c['query'],_0x4cea34['filters']),_0x473dd2);if(_0x21c63c[_0xd8ae('0x41')][_0xd8ae('0x4b')]){_0x2b4133[_0xd8ae('0x49')]=_[_0xd8ae('0x4c')](_0x2b4133[_0xd8ae('0x49')],{'$or':_['map'](_0x473dd2,function(_0x278aff){if(_0x278aff[_0xd8ae('0x4d')]!==_0xd8ae('0x4e')){var _0x346b13={};_0x346b13[_0x278aff[_0xd8ae('0x38')]]={'$like':'%'+_0x21c63c[_0xd8ae('0x41')]['filter']+'%'};return _0x346b13;}})});}_0x2b4133=_[_0xd8ae('0x4c')]({},_0x2b4133,_0x21c63c['options']);var _0xb5ec06={'where':_0x2b4133[_0xd8ae('0x49')]};return db[_0xd8ae('0x3c')][_0xd8ae('0x4f')](_0xb5ec06)[_0xd8ae('0x20')](function(_0x11db47){_0x2d7b47[_0xd8ae('0x4f')]=_0x11db47;if(_0x21c63c[_0xd8ae('0x41')][_0xd8ae('0x50')]){_0x2b4133[_0xd8ae('0x51')]=[{'all':!![]}];}return db[_0xd8ae('0x3c')][_0xd8ae('0x52')](_0x2b4133);})[_0xd8ae('0x20')](function(_0x1beb34){_0x2d7b47[_0xd8ae('0x53')]=_0x1beb34;return _0x2d7b47;})[_0xd8ae('0x20')](respondWithFilteredResult(_0x575fae,_0x2b4133))[_0xd8ae('0x29')](handleError(_0x575fae,null));};exports[_0xd8ae('0x54')]=function(_0x2bb36a,_0xc0c80f){var _0x33bae8={'raw':!![],'where':{'id':_0x2bb36a[_0xd8ae('0x55')]['id']}},_0x2fa1a5={};_0x2fa1a5[_0xd8ae('0x40')]=_['keys'](db[_0xd8ae('0x3c')]['rawAttributes']);_0x2fa1a5[_0xd8ae('0x41')]=_[_0xd8ae('0x56')](_0x2bb36a[_0xd8ae('0x41')]);_0x2fa1a5['filters']=_['intersection'](_0x2fa1a5[_0xd8ae('0x40')],_0x2fa1a5[_0xd8ae('0x41')]);_0x33bae8['attributes']=_[_0xd8ae('0x43')](_0x2fa1a5[_0xd8ae('0x40')],qs[_0xd8ae('0x57')](_0x2bb36a[_0xd8ae('0x41')][_0xd8ae('0x57')]));_0x33bae8['attributes']=_0x33bae8[_0xd8ae('0x44')]['length']?_0x33bae8[_0xd8ae('0x44')]:_0x2fa1a5['model'];if(_0x2bb36a[_0xd8ae('0x41')][_0xd8ae('0x50')]){_0x33bae8[_0xd8ae('0x51')]=[{'all':!![]}];}_0x33bae8=_[_0xd8ae('0x4c')]({},_0x33bae8,_0x2bb36a['options']);return db[_0xd8ae('0x3c')][_0xd8ae('0x58')](_0x33bae8)[_0xd8ae('0x20')](handleEntityNotFound(_0xc0c80f,null))[_0xd8ae('0x20')](respondWithResult(_0xc0c80f,null))[_0xd8ae('0x29')](handleError(_0xc0c80f,null));};exports[_0xd8ae('0x59')]=function(_0x48f6bc,_0x80935e){return db[_0xd8ae('0x3c')][_0xd8ae('0x59')](_0x48f6bc[_0xd8ae('0x5a')],{})['then'](respondWithResult(_0x80935e,0xc9))['catch'](handleError(_0x80935e,null));};exports[_0xd8ae('0x34')]=function(_0x497e36,_0x5f965e){if(_0x497e36['body']['id']){delete _0x497e36[_0xd8ae('0x5a')]['id'];}return db[_0xd8ae('0x3c')][_0xd8ae('0x58')]({'where':{'id':_0x497e36[_0xd8ae('0x55')]['id']}})[_0xd8ae('0x20')](handleEntityNotFound(_0x5f965e,null))[_0xd8ae('0x20')](saveUpdates(_0x497e36[_0xd8ae('0x5a')],null))[_0xd8ae('0x20')](respondWithResult(_0x5f965e,null))[_0xd8ae('0x29')](handleError(_0x5f965e,null));};exports[_0xd8ae('0x35')]=function(_0x326dc9,_0x575b43){return db['ChatMessage'][_0xd8ae('0x58')]({'where':{'id':_0x326dc9[_0xd8ae('0x55')]['id']}})['then'](handleEntityNotFound(_0x575b43,null))[_0xd8ae('0x20')](removeEntity(_0x575b43,null))['catch'](handleError(_0x575b43,null));};exports[_0xd8ae('0x5b')]=function(_0x464bb6,_0x25c18d){return db['ChatMessage'][_0xd8ae('0x5b')]()[_0xd8ae('0x20')](respondWithResult(_0x25c18d,null))[_0xd8ae('0x29')](handleError(_0x25c18d,null));};var interaction_log=require('../../config/logger')(_0xd8ae('0x5c'));exports[_0xd8ae('0x5d')]=function(_0xc297fb,_0x421ff0,_0x1a7845){var _0x2f0bdf={'agent':{},'channel':_0xd8ae('0x5e')};if(_0xc297fb['body']['id']){delete _0xc297fb[_0xd8ae('0x5a')]['id'];}_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x5f')]=!![];_0xc297fb[_0xd8ae('0x5a')]['readAt']=moment()[_0xd8ae('0x60')](_0xd8ae('0x61'));_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x62')]=_0xc297fb['body']['UserId']||_0xc297fb[_0xd8ae('0x63')]['id'];_0x2f0bdf[_0xd8ae('0x64')]['id']=_0xc297fb[_0xd8ae('0x5a')]['UserId'];return db[_0xd8ae('0x3c')]['find']({'where':{'id':_0xc297fb[_0xd8ae('0x55')]['id'],'UserId':null}})[_0xd8ae('0x20')](handleEntityNotFound(_0x421ff0,null))[_0xd8ae('0x20')](saveUpdates(_0xc297fb[_0xd8ae('0x5a')],null))[_0xd8ae('0x20')](function(_0x132dcd){if(_0x132dcd){_0x2f0bdf['message']=_0x132dcd[_0xd8ae('0x65')]({'plain':!![]});return db[_0xd8ae('0x66')]['find']({'where':{'id':_0x132dcd[_0xd8ae('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x421ff0,null))[_0xd8ae('0x20')](function(_0x442004){if(_0x442004){return _0x442004[_0xd8ae('0x34')]({'UserId':_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x62')],'read1stAt':_[_0xd8ae('0x68')](_0x442004[_0xd8ae('0x69')])?moment()['format'](_0xd8ae('0x61')):undefined});}return null;})[_0xd8ae('0x20')](function(_0x40c219){if(_0x40c219){_0x2f0bdf['interaction']=_0x40c219['get']({'plain':!![]});interaction_log[_0xd8ae('0x21')](_0xd8ae('0x6a'),_0xc297fb[_0xd8ae('0x63')]['id'],_0xc297fb['user'][_0xd8ae('0x38')],_0xc297fb[_0xd8ae('0x63')]['role'],_0x2f0bdf[_0xd8ae('0x6b')]['id'],_0xc297fb[_0xd8ae('0x5a')]?JSON[_0xd8ae('0x24')](_0xc297fb['body']):_0xd8ae('0x6c'));return respondWithRpcPromise(_0xd8ae('0x6d'),_0xd8ae('0x6e'),_0x2f0bdf);}return null;})[_0xd8ae('0x20')](function(_0x1b0308){var _0xb25d82=_0xd8ae('0x6f')+_0x1b0308['message'][_0xd8ae('0x70')];return db[_0xd8ae('0x71')]['query'](_0xb25d82,{'type':db[_0xd8ae('0x72')][_0xd8ae('0x73')][_0xd8ae('0x74')],'raw':!![]})[_0xd8ae('0x20')](function(_0x316218){return _0x316218;});})[_0xd8ae('0x20')](function(_0x518a67){if(_0x518a67){_0x2f0bdf[_0xd8ae('0x27')][_0xd8ae('0x75')]=_0x518a67[0x0];if(!_0xc297fb[_0xd8ae('0x5a')]['UserId'])return;return db['User'][_0xd8ae('0x58')]({'where':{'id':_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x62')],'role':'agent'},'attributes':['id','name','fullname',_0xd8ae('0x76'),'internal'],'raw':!![]});}return null;})[_0xd8ae('0x20')](function(_0x5703eb){if(!_0x5703eb)return null;_0x2f0bdf[_0xd8ae('0x27')][_0xd8ae('0x64')]=_0x5703eb;return _0x2f0bdf;})[_0xd8ae('0x20')](function(_0x24a5db){if(_0x24a5db){if(_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x77')]){_0x2f0bdf[_0xd8ae('0x27')][_0xd8ae('0x78')]=util[_0xd8ae('0x60')]('SIP/%s',_0xc297fb[_0xd8ae('0x63')][_0xd8ae('0x38')]);_0x2f0bdf[_0xd8ae('0x27')]['channel']=_0x2f0bdf[_0xd8ae('0x79')];_0x2f0bdf[_0xd8ae('0x27')]['motionChannel']=_0x2f0bdf[_0xd8ae('0x79')];_0x2f0bdf[_0xd8ae('0x27')][_0xd8ae('0x7a')]=_0xd8ae('0x5d');return respondWithRpcPromise(_0xd8ae('0x7b'),'EventManager',{'event':_0xd8ae('0x7c'),'message':_[_0xd8ae('0x4c')](_0x2f0bdf['message'],JSON[_0xd8ae('0x7d')](_0x2f0bdf[_0xd8ae('0x6b')]['formData']))},client9002)[_0xd8ae('0x20')](function(){return _0x2f0bdf;});}return _0x2f0bdf;}return null;})['then'](respondWithResult(_0x421ff0,null))['catch'](handleError(_0x421ff0,null));};var interaction_log=require(_0xd8ae('0x7e'))(_0xd8ae('0x5c'));exports[_0xd8ae('0x32')]=function(_0x2cb653,_0x44b6b2,_0x45a4d4){var _0x583028={'agent':{},'channel':_0xd8ae('0x5e')};if(_0x2cb653[_0xd8ae('0x5a')]['id']){delete _0x2cb653[_0xd8ae('0x5a')]['id'];}_0x2cb653['body'][_0xd8ae('0x62')]=_0x2cb653[_0xd8ae('0x5a')]['UserId']||_0x2cb653[_0xd8ae('0x63')]['id'];_0x583028[_0xd8ae('0x64')]['id']=_0x2cb653[_0xd8ae('0x5a')][_0xd8ae('0x62')];return db['ChatMessage'][_0xd8ae('0x58')]({'where':{'id':_0x2cb653['params']['id'],'UserId':null}})[_0xd8ae('0x20')](handleEntityNotFound(_0x44b6b2,null))[_0xd8ae('0x20')](function(_0x1971dc){if(_0x1971dc){_0x583028[_0xd8ae('0x27')]=_0x1971dc[_0xd8ae('0x65')]({'plain':!![]});return db['ChatInteraction'][_0xd8ae('0x58')]({'where':{'id':_0x1971dc[_0xd8ae('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x44b6b2,null))[_0xd8ae('0x20')](function(_0xe914c2){if(_0xe914c2){_0x583028[_0xd8ae('0x6b')]=_0xe914c2[_0xd8ae('0x65')]({'plain':!![]});interaction_log[_0xd8ae('0x21')](_0xd8ae('0x7f'),_0x2cb653[_0xd8ae('0x63')]['id'],_0x2cb653['user'][_0xd8ae('0x38')],_0x2cb653[_0xd8ae('0x63')][_0xd8ae('0x80')],_0x583028[_0xd8ae('0x6b')]['id'],_0x2cb653[_0xd8ae('0x5a')]?JSON[_0xd8ae('0x24')](_0x2cb653['body']):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x583028);}return null;})[_0xd8ae('0x20')](function(_0x53eba7){var _0x21d421=_0xd8ae('0x6f')+_0x53eba7['message'][_0xd8ae('0x70')];return db[_0xd8ae('0x71')][_0xd8ae('0x41')](_0x21d421,{'type':db[_0xd8ae('0x72')]['QueryTypes'][_0xd8ae('0x74')],'raw':!![]})['then'](function(_0x1799c6){return _0x1799c6;});})['then'](function(_0x4c421f){if(_0x4c421f){_0x583028['message'][_0xd8ae('0x75')]=_0x4c421f[0x0];if(!_0x2cb653[_0xd8ae('0x5a')][_0xd8ae('0x62')])return;return db[_0xd8ae('0x81')][_0xd8ae('0x58')]({'where':{'id':_0x2cb653[_0xd8ae('0x5a')][_0xd8ae('0x62')],'role':'agent'},'attributes':['id',_0xd8ae('0x38'),_0xd8ae('0x82'),_0xd8ae('0x76'),_0xd8ae('0x83')],'raw':!![]});}return null;})['then'](function(_0x14a12b){if(!_0x14a12b)return null;_0x583028[_0xd8ae('0x27')][_0xd8ae('0x64')]=_0x14a12b;return _0x583028;})['then'](function(_0x44f3d8){if(_0x44f3d8){_0x44f3d8[_0xd8ae('0x27')][_0xd8ae('0x78')]=util[_0xd8ae('0x60')](_0xd8ae('0x84'),_0x2cb653[_0xd8ae('0x63')][_0xd8ae('0x38')]);_0x44f3d8[_0xd8ae('0x27')][_0xd8ae('0x79')]=_0x583028[_0xd8ae('0x79')];_0x44f3d8[_0xd8ae('0x27')]['motionChannel']=_0x583028['channel'];_0x44f3d8['message']['event']=_0xd8ae('0x32');respondWithRpcPromise(_0xd8ae('0x7b'),_0xd8ae('0x7b'),{'event':_0xd8ae('0x85'),'message':_[_0xd8ae('0x4c')](_0x583028['message'],JSON[_0xd8ae('0x7d')](_0x583028[_0xd8ae('0x6b')][_0xd8ae('0x86')]))},client9002);return _0x583028;}return null;})[_0xd8ae('0x20')](respondWithResult(_0x44b6b2,null))['catch'](handleError(_0x44b6b2,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 5021504..ca913b6 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 _0x73e6=['../../mysqldb','ChatMessage','remove','emit','hasOwnProperty'];(function(_0x5440ba,_0xf350cc){var _0x54e377=function(_0x26c67a){while(--_0x26c67a){_0x5440ba['push'](_0x5440ba['shift']());}};_0x54e377(++_0xf350cc);}(_0x73e6,0x11d));var _0x673e=function(_0x5dcce1,_0x5c8a64){_0x5dcce1=_0x5dcce1-0x0;var _0x554d28=_0x73e6[_0x5dcce1];return _0x554d28;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x673e('0x0'))['db'][_0x673e('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x673e('0x2')};function emitEvent(_0x2d503b){return function(_0x1f992f,_0x4749fc,_0x2e2bd1){ChatMessageEvents[_0x673e('0x3')](_0x2d503b+':'+_0x1f992f['id'],_0x1f992f);ChatMessageEvents[_0x673e('0x3')](_0x2d503b,_0x1f992f);_0x2e2bd1(null);};}for(var e in events){if(events[_0x673e('0x4')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x3432=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x193653,_0x422a45){var _0x1ed7b8=function(_0xdc78ca){while(--_0xdc78ca){_0x193653['push'](_0x193653['shift']());}};_0x1ed7b8(++_0x422a45);}(_0x3432,0x163));var _0x2343=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3432[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x2343('0x0'));var ChatMessage=require(_0x2343('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2343('0x2')](0x0);var events={'afterCreate':_0x2343('0x3'),'afterUpdate':_0x2343('0x4'),'afterDestroy':_0x2343('0x5')};function emitEvent(_0x28ae09){return function(_0x49c984,_0x3a5a89,_0x217adc){ChatMessageEvents[_0x2343('0x6')](_0x28ae09+':'+_0x49c984['id'],_0x49c984);ChatMessageEvents[_0x2343('0x6')](_0x28ae09,_0x49c984);_0x217adc(null);};}for(var e in events){if(events[_0x2343('0x7')](e)){var event=events[e];ChatMessage[_0x2343('0x8')](e,emitEvent(event));}}module[_0x2343('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 d9a6e26..a584c4b 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 _0xe697=['error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','define','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','findOne','ChatInteractionId','update','createdAt','catch'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xe697,0x1cf));var _0x7e69=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0xe697[_0x5447aa];return _0xb21e53;};'use strict';var _=require('lodash');var util=require(_0x7e69('0x0'));var logger=require(_0x7e69('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7e69('0x2'));var rp=require(_0x7e69('0x3'));var fs=require('fs');var path=require(_0x7e69('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x56dca7,_0x5c893a){return _0x56dca7[_0x7e69('0x5')]('ChatMessage',attributes,{'tableName':_0x7e69('0x6'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x7e69('0x7')],'type':_0x7e69('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x210b71,_0x564857,_0xf9f2fa){var _0x13f5ea=_0x56dca7[_0x7e69('0x9')];var _0x288df0=_0x210b71[_0x7e69('0xa')]({'plain':!![]});if(_0x288df0[_0x7e69('0xb')][_0x7e69('0xc')]()==='in'||_0x288df0[_0x7e69('0xb')][_0x7e69('0xc')]()==='out'&&!_0x288df0[_0x7e69('0xd')]&&!_[_0x7e69('0xe')](_0x288df0['UserId'])){_0x13f5ea['ChatInteraction'][_0x7e69('0xf')]({'where':{'id':_0x288df0[_0x7e69('0x10')]}})['then'](function(_0x4be24c){if(_0x4be24c){_0x4be24c[_0x7e69('0x11')]({'lastMsgAt':_0x288df0[_0x7e69('0x12')],'lastMsgDirection':_0x288df0[_0x7e69('0xb')][_0x7e69('0xc')]()});}})[_0x7e69('0x13')](function(_0x40ef2a){console[_0x7e69('0x14')](_0x40ef2a);});}_0xf9f2fa();}},'charset':_0x7e69('0x15'),'collate':_0x7e69('0x16')});}; \ No newline at end of file +var _0xea49=['request-promise','path','rimraf','./chatMessage.attributes','exports','define','fti_chat_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','ChatInteraction','findOne','then','createdAt','toLowerCase','catch','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x161587,_0x5c4528){var _0x293546=function(_0x40406e){while(--_0x40406e){_0x161587['push'](_0x161587['shift']());}};_0x293546(++_0x5c4528);}(_0xea49,0x14b));var _0x9ea4=function(_0x213ed5,_0x26712a){_0x213ed5=_0x213ed5-0x0;var _0x191514=_0xea49[_0x213ed5];return _0x191514;};'use strict';var _=require(_0x9ea4('0x0'));var util=require(_0x9ea4('0x1'));var logger=require('../../config/logger')(_0x9ea4('0x2'));var moment=require(_0x9ea4('0x3'));var BPromise=require(_0x9ea4('0x4'));var rp=require(_0x9ea4('0x5'));var fs=require('fs');var path=require(_0x9ea4('0x6'));var rimraf=require(_0x9ea4('0x7'));var config=require('../../config/environment');var attributes=require(_0x9ea4('0x8'));module[_0x9ea4('0x9')]=function(_0x28aa83,_0x1cd230){return _0x28aa83[_0x9ea4('0xa')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x9ea4('0xb'),'fields':[_0x9ea4('0xc')],'type':_0x9ea4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x231ec0,_0x433d5a,_0x3e81b8){var _0x4fbdf0=_0x28aa83[_0x9ea4('0xe')];var _0x2f8309=_0x231ec0[_0x9ea4('0xf')]({'plain':!![]});if(_0x2f8309[_0x9ea4('0x10')]['toLowerCase']()==='in'||_0x2f8309[_0x9ea4('0x10')]['toLowerCase']()===_0x9ea4('0x11')&&!_0x2f8309[_0x9ea4('0x12')]&&!_[_0x9ea4('0x13')](_0x2f8309[_0x9ea4('0x14')])){_0x4fbdf0[_0x9ea4('0x15')][_0x9ea4('0x16')]({'where':{'id':_0x2f8309['ChatInteractionId']}})[_0x9ea4('0x17')](function(_0x54f930){if(_0x54f930){_0x54f930['update']({'lastMsgAt':_0x2f8309[_0x9ea4('0x18')],'lastMsgDirection':_0x2f8309[_0x9ea4('0x10')][_0x9ea4('0x19')]()});}})[_0x9ea4('0x1a')](function(_0x3bf7a5){console['error'](_0x3bf7a5);});}_0x3e81b8();}},'charset':'utf8mb4','collate':_0x9ea4('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index ed9c315..5df5ca8 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 _0xb4c9=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','stringify','util'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xb4c9,0xbf));var _0x9b4c=function(_0x43a88c,_0x452929){_0x43a88c=_0x43a88c-0x0;var _0x5f267f=_0xb4c9[_0x43a88c];return _0x5f267f;};'use strict';var _=require('lodash');var util=require(_0x9b4c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9b4c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9b4c('0x2'));var logger=require(_0x9b4c('0x3'))(_0x9b4c('0x4'));var config=require(_0x9b4c('0x5'));var jayson=require(_0x9b4c('0x6'));var client=jayson[_0x9b4c('0x7')][_0x9b4c('0x8')]({'port':0x232a});config[_0x9b4c('0x9')]=_[_0x9b4c('0xa')](config[_0x9b4c('0x9')],{'host':_0x9b4c('0xb'),'port':0x18eb});var socket=require(_0x9b4c('0xc'))(new Redis(config[_0x9b4c('0x9')]));require('./chatMessage.socket')[_0x9b4c('0xd')](socket);function respondWithRpcPromise(_0x300a7a,_0x23210b,_0x315437){return new BPromise(function(_0x46e6f5,_0xe7b36d){return client[_0x9b4c('0xe')](_0x300a7a,_0x315437)[_0x9b4c('0xf')](function(_0xb27041){logger[_0x9b4c('0x10')]('ChatMessage,\x20%s,\x20%s',_0x23210b,_0x9b4c('0x11'));logger[_0x9b4c('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x23210b,_0x9b4c('0x11'),JSON['stringify'](_0xb27041));if(_0xb27041[_0x9b4c('0x13')]){if(_0xb27041['error'][_0x9b4c('0x14')]===0x1f4){logger[_0x9b4c('0x13')](_0x9b4c('0x15'),_0x23210b,_0xb27041[_0x9b4c('0x13')][_0x9b4c('0x16')]);return _0xe7b36d(_0xb27041[_0x9b4c('0x13')]['message']);}logger['error'](_0x9b4c('0x15'),_0x23210b,_0xb27041[_0x9b4c('0x13')]['message']);return _0x46e6f5(_0xb27041['error'][_0x9b4c('0x16')]);}else{logger['info'](_0x9b4c('0x15'),_0x23210b,_0x9b4c('0x11'));_0x46e6f5(_0xb27041[_0x9b4c('0x17')][_0x9b4c('0x16')]);}})[_0x9b4c('0x18')](function(_0x3c797d){logger[_0x9b4c('0x13')]('ChatMessage,\x20%s,\x20%s',_0x23210b,_0x3c797d);_0xe7b36d(_0x3c797d);});});}exports['CreateChatMessage']=function(_0xd03081){var _0x27ee27=this;return new Promise(function(_0x2916c9,_0x1cbf69){return db[_0x9b4c('0x19')][_0x9b4c('0x1a')](_0xd03081[_0x9b4c('0x1b')],{'raw':_0xd03081['options']?_0xd03081[_0x9b4c('0x1c')][_0x9b4c('0x1d')]===undefined?!![]:![]:!![]})[_0x9b4c('0xf')](function(_0x34f82c){logger[_0x9b4c('0x10')](_0x9b4c('0x1e'),_0xd03081);logger[_0x9b4c('0x12')]('CreateChatMessage',_0xd03081,JSON[_0x9b4c('0x1f')](_0x34f82c));_0x2916c9(_0x34f82c);})[_0x9b4c('0x18')](function(_0x53c6a3){logger[_0x9b4c('0x13')](_0x9b4c('0x1e'),_0x53c6a3[_0x9b4c('0x16')],_0xd03081);_0x1cbf69(_0x27ee27['error'](0x1f4,_0x53c6a3[_0x9b4c('0x16')]));});});}; \ No newline at end of file +var _0xa673=['ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateChatMessage','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','socket.io-emitter','./chatMessage.socket','request','then'];(function(_0x3238ea,_0x91809d){var _0x4aaac2=function(_0xc5b102){while(--_0xc5b102){_0x3238ea['push'](_0x3238ea['shift']());}};_0x4aaac2(++_0x91809d);}(_0xa673,0x17b));var _0x3a67=function(_0x35005f,_0x4dad9f){_0x35005f=_0x35005f-0x0;var _0x1f0270=_0xa673[_0x35005f];return _0x1f0270;};'use strict';var _=require(_0x3a67('0x0'));var util=require(_0x3a67('0x1'));var moment=require(_0x3a67('0x2'));var BPromise=require(_0x3a67('0x3'));var rs=require(_0x3a67('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a67('0x5'))['db'];var utils=require(_0x3a67('0x6'));var logger=require(_0x3a67('0x7'))('rpc');var config=require(_0x3a67('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3a67('0x9')][_0x3a67('0xa')]({'port':0x232a});config['redis']=_[_0x3a67('0xb')](config[_0x3a67('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3a67('0xd'))(new Redis(config[_0x3a67('0xc')]));require(_0x3a67('0xe'))['register'](socket);function respondWithRpcPromise(_0x5195d2,_0x3b3ed2,_0x27f828){return new BPromise(function(_0x1884e2,_0x1774f4){return client[_0x3a67('0xf')](_0x5195d2,_0x27f828)[_0x3a67('0x10')](function(_0x4ff92f){logger['info'](_0x3a67('0x11'),_0x3b3ed2,'request\x20sent');logger['debug'](_0x3a67('0x12'),_0x3b3ed2,_0x3a67('0x13'),JSON['stringify'](_0x4ff92f));if(_0x4ff92f[_0x3a67('0x14')]){if(_0x4ff92f['error'][_0x3a67('0x15')]===0x1f4){logger[_0x3a67('0x14')](_0x3a67('0x11'),_0x3b3ed2,_0x4ff92f['error'][_0x3a67('0x16')]);return _0x1774f4(_0x4ff92f[_0x3a67('0x14')][_0x3a67('0x16')]);}logger[_0x3a67('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3b3ed2,_0x4ff92f['error'][_0x3a67('0x16')]);return _0x1884e2(_0x4ff92f[_0x3a67('0x14')][_0x3a67('0x16')]);}else{logger[_0x3a67('0x17')](_0x3a67('0x11'),_0x3b3ed2,_0x3a67('0x13'));_0x1884e2(_0x4ff92f[_0x3a67('0x18')][_0x3a67('0x16')]);}})[_0x3a67('0x19')](function(_0x1c4b43){logger[_0x3a67('0x14')](_0x3a67('0x11'),_0x3b3ed2,_0x1c4b43);_0x1774f4(_0x1c4b43);});});}exports[_0x3a67('0x1a')]=function(_0x2b9813){var _0x2115dd=this;return new Promise(function(_0x372778,_0xc08b88){return db['ChatMessage'][_0x3a67('0x1b')](_0x2b9813[_0x3a67('0x1c')],{'raw':_0x2b9813[_0x3a67('0x1d')]?_0x2b9813[_0x3a67('0x1d')][_0x3a67('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0xb199d){logger['info'](_0x3a67('0x1a'),_0x2b9813);logger[_0x3a67('0x1f')](_0x3a67('0x1a'),_0x2b9813,JSON[_0x3a67('0x20')](_0xb199d));_0x372778(_0xb199d);})[_0x3a67('0x19')](function(_0x225481){logger[_0x3a67('0x14')]('CreateChatMessage',_0x225481[_0x3a67('0x16')],_0x2b9813);_0xc08b88(_0x2115dd[_0x3a67('0x14')](0x1f4,_0x225481['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 69faa2d..c706f62 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 _0x7c09=['save','remove','emit','removeListener','length','chatMessage:'];(function(_0x39ec63,_0x346199){var _0x5802e1=function(_0x286585){while(--_0x286585){_0x39ec63['push'](_0x39ec63['shift']());}};_0x5802e1(++_0x346199);}(_0x7c09,0x102));var _0x97c0=function(_0x4f39ad,_0x1cd3be){_0x4f39ad=_0x4f39ad-0x0;var _0x6da4ff=_0x7c09[_0x4f39ad];return _0x6da4ff;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x97c0('0x0'),_0x97c0('0x1'),'update'];function createListener(_0xfbf689,_0x7d8f6f){return function(_0x2d04b9){_0x7d8f6f[_0x97c0('0x2')](_0xfbf689,_0x2d04b9);};}function removeListener(_0x12eb6d,_0x99bf54){return function(){ChatMessageEvents[_0x97c0('0x3')](_0x12eb6d,_0x99bf54);};}exports['register']=function(_0x4b2f81){for(var _0x590368=0x0,_0x46fdd9=events[_0x97c0('0x4')];_0x590368<_0x46fdd9;_0x590368++){var _0x2c19fa=events[_0x590368];var _0x109bc8=createListener(_0x97c0('0x5')+_0x2c19fa,_0x4b2f81);ChatMessageEvents['on'](_0x2c19fa,_0x109bc8);}}; \ No newline at end of file +var _0x47c7=['./chatMessage.events','remove','update','removeListener','register','length','chatMessage:'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x47c7,0x1ab));var _0x747c=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x47c7[_0x12a554];return _0x244ba0;};'use strict';var ChatMessageEvents=require(_0x747c('0x0'));var events=['save',_0x747c('0x1'),_0x747c('0x2')];function createListener(_0x4a6fc3,_0xbe1d88){return function(_0x2af847){_0xbe1d88['emit'](_0x4a6fc3,_0x2af847);};}function removeListener(_0x3313cd,_0x3c0c0){return function(){ChatMessageEvents[_0x747c('0x3')](_0x3313cd,_0x3c0c0);};}exports[_0x747c('0x4')]=function(_0x5e991e){for(var _0xa1148a=0x0,_0x4eb6bc=events[_0x747c('0x5')];_0xa1148a<_0x4eb6bc;_0xa1148a++){var _0x24206f=events[_0xa1148a];var _0x10b9f0=createListener(_0x747c('0x6')+_0x24206f,_0x5e991e);ChatMessageEvents['on'](_0x24206f,_0x10b9f0);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 1c2c249..b00560b 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 _0xecd9=['./chatMessage.controller','get','isAuthenticated','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/reject','reject','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x154b29,_0x4aab17){var _0x48b5c6=function(_0x3ac71a){while(--_0x3ac71a){_0x154b29['push'](_0x154b29['shift']());}};_0x48b5c6(++_0x4aab17);}(_0xecd9,0x162));var _0x9ecd=function(_0x24143b,_0x536f6d){_0x24143b=_0x24143b-0x0;var _0x324c9a=_0xecd9[_0x24143b];return _0x324c9a;};'use strict';var multer=require(_0x9ecd('0x0'));var util=require(_0x9ecd('0x1'));var path=require(_0x9ecd('0x2'));var timeout=require(_0x9ecd('0x3'));var express=require(_0x9ecd('0x4'));var router=express[_0x9ecd('0x5')]();var fs_extra=require(_0x9ecd('0x6'));var auth=require(_0x9ecd('0x7'));var interaction=require(_0x9ecd('0x8'));var config=require(_0x9ecd('0x9'));var controller=require(_0x9ecd('0xa'));router[_0x9ecd('0xb')]('/',auth[_0x9ecd('0xc')](),controller['index']);router['get'](_0x9ecd('0xd'),auth[_0x9ecd('0xc')](),controller[_0x9ecd('0xe')]);router[_0x9ecd('0xb')]('/:id',auth[_0x9ecd('0xc')](),controller[_0x9ecd('0xf')]);router[_0x9ecd('0x10')]('/',auth[_0x9ecd('0xc')](),interaction[_0x9ecd('0x11')](_0x9ecd('0x12'),_0x9ecd('0x13')),controller[_0x9ecd('0x14')]);router[_0x9ecd('0x15')]('/:id',controller[_0x9ecd('0x16')]);router['put']('/:id/accept',auth[_0x9ecd('0xc')](),controller['accept']);router[_0x9ecd('0x15')](_0x9ecd('0x17'),auth['isAuthenticated'](),controller[_0x9ecd('0x18')]);router['delete'](_0x9ecd('0x19'),auth[_0x9ecd('0xc')](),controller[_0x9ecd('0x1a')]);module[_0x9ecd('0x1b')]=router; \ No newline at end of file +var _0x10d5=['chat','chatmessage:create','create','put','/:id','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','connect-timeout','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked'];(function(_0x52f975,_0x4e4e7d){var _0x1103e7=function(_0x5d82fc){while(--_0x5d82fc){_0x52f975['push'](_0x52f975['shift']());}};_0x1103e7(++_0x4e4e7d);}(_0x10d5,0xab));var _0x510d=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0x10d5[_0x4409e7];return _0x24c751;};'use strict';var multer=require(_0x510d('0x0'));var util=require(_0x510d('0x1'));var path=require('path');var timeout=require(_0x510d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x510d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x510d('0x4'));router[_0x510d('0x5')]('/',auth[_0x510d('0x6')](),controller[_0x510d('0x7')]);router[_0x510d('0x5')](_0x510d('0x8'),auth[_0x510d('0x6')](),controller[_0x510d('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x510d('0xa')]);router[_0x510d('0xb')]('/',auth[_0x510d('0x6')](),interaction[_0x510d('0xc')](_0x510d('0xd'),_0x510d('0xe')),controller[_0x510d('0xf')]);router[_0x510d('0x10')](_0x510d('0x11'),controller['update']);router[_0x510d('0x10')](_0x510d('0x12'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x510d('0x13'),auth['isAuthenticated'](),controller[_0x510d('0x14')]);router['delete']('/:id',auth[_0x510d('0x6')](),controller[_0x510d('0x15')]);module[_0x510d('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index da45158..192ce44 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x596cc0,_0x4e1a74){var _0x37dc4f=function(_0x47a0dd){while(--_0x47a0dd){_0x596cc0['push'](_0x596cc0['shift']());}};_0x37dc4f(++_0x4e1a74);}(_0xb10b,0x12a));var _0xbb10=function(_0x11d684,_0x4d4123){_0x11d684=_0x11d684-0x0;var _0x78a301=_0xb10b[_0x11d684];return _0x78a301;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x0b0e[_0x65c50e];return _0x4573e7;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 1fbe08e..b07432d 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(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x7a54,0x106));var _0x47a5=function(_0x4cf785,_0x3158dc){_0x4cf785=_0x4cf785-0x0;var _0x2c8d9c=_0x7a54[_0x4cf785];return _0x2c8d9c;};'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 _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(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x7a54,0x106));var _0x47a5=function(_0x562c00,_0x185000){_0x562c00=_0x562c00-0x0;var _0x1a0c79=_0x7a54[_0x562c00];return _0x1a0c79;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index f24f1c6..193c9c8 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf02c=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x2bfe2d,_0x694d7f){var _0x489188=function(_0x56b625){while(--_0x56b625){_0x2bfe2d['push'](_0x2bfe2d['shift']());}};_0x489188(++_0x694d7f);}(_0xf02c,0x92));var _0xcf02=function(_0xb48270,_0x536ef3){_0xb48270=_0xb48270-0x0;var _0x457510=_0xf02c[_0xb48270];return _0x457510;};'use strict';var EventEmitter=require(_0xcf02('0x0'));var ChatOfflineMessage=require(_0xcf02('0x1'))['db'][_0xcf02('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xcf02('0x3')](0x0);var events={'afterCreate':_0xcf02('0x4'),'afterUpdate':_0xcf02('0x5'),'afterDestroy':_0xcf02('0x6')};function emitEvent(_0x378e8b){return function(_0x3abde3,_0x354198,_0x3e8829){ChatOfflineMessageEvents[_0xcf02('0x7')](_0x378e8b+':'+_0x3abde3['id'],_0x3abde3);ChatOfflineMessageEvents[_0xcf02('0x7')](_0x378e8b,_0x3abde3);_0x3e8829(null);};}for(var e in events){if(events[_0xcf02('0x8')](e)){var event=events[e];ChatOfflineMessage[_0xcf02('0x9')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x7449=['emit','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x7449,0x14b));var _0x9744=function(_0x27e1fe,_0x194c88){_0x27e1fe=_0x27e1fe-0x0;var _0x37d1b7=_0x7449[_0x27e1fe];return _0x37d1b7;};'use strict';var EventEmitter=require(_0x9744('0x0'));var ChatOfflineMessage=require(_0x9744('0x1'))['db'][_0x9744('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9744('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9744('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1243a4){return function(_0x5df42f,_0x31aad8,_0x149ff6){ChatOfflineMessageEvents[_0x9744('0x5')](_0x1243a4+':'+_0x5df42f['id'],_0x5df42f);ChatOfflineMessageEvents[_0x9744('0x5')](_0x1243a4,_0x5df42f);_0x149ff6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x9744('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index cd6f30c..f3a917f 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 _0x7506=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x37044b,_0x1351f1){var _0x7c82f2=function(_0x4d6504){while(--_0x4d6504){_0x37044b['push'](_0x37044b['shift']());}};_0x7c82f2(++_0x1351f1);}(_0x7506,0x184));var _0x6750=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x7506[_0x341e0f];return _0x59555a;};'use strict';var attributes=require(_0x6750('0x0'));module[_0x6750('0x1')]=function(_0x25f152){return _0x25f152[_0x6750('0x2')](_0x6750('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6750('0x4'),'collate':_0x6750('0x5')});}; \ No newline at end of file +var _0xc1fb=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x4cb9aa,_0x58b44f){var _0x2eff51=function(_0x18a09c){while(--_0x18a09c){_0x4cb9aa['push'](_0x4cb9aa['shift']());}};_0x2eff51(++_0x58b44f);}(_0xc1fb,0xd8));var _0xbc1f=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xc1fb[_0x5f5cce];return _0x705ecf;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xbc1f('0x0')]=function(_0x4f7d3a){return _0x4f7d3a['define'](_0xbc1f('0x1'),attributes,{'tableName':_0xbc1f('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbc1f('0x3'),'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 1566149..0706eb0 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 _0x2809=['../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x36ded5,_0x4351bd){var _0x582ca6=function(_0x538838){while(--_0x538838){_0x36ded5['push'](_0x36ded5['shift']());}};_0x582ca6(++_0x4351bd);}(_0x2809,0x190));var _0x9280=function(_0x9aad68,_0x45377){_0x9aad68=_0x9aad68-0x0;var _0x281340=_0x2809[_0x9aad68];return _0x281340;};'use strict';var _=require(_0x9280('0x0'));var util=require(_0x9280('0x1'));var moment=require(_0x9280('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9280('0x3'));var db=require(_0x9280('0x4'))['db'];var utils=require(_0x9280('0x5'));var logger=require(_0x9280('0x6'))(_0x9280('0x7'));var config=require(_0x9280('0x8'));var jayson=require(_0x9280('0x9'));var client=jayson[_0x9280('0xa')][_0x9280('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x188f08,_0x22c1ac,_0x2d2345){return new BPromise(function(_0x5af08e,_0x86f0bc){return client[_0x9280('0xc')](_0x188f08,_0x2d2345)[_0x9280('0xd')](function(_0x45dd4e){logger[_0x9280('0xe')](_0x9280('0xf'),_0x22c1ac,_0x9280('0x10'));logger[_0x9280('0x11')](_0x9280('0x12'),_0x22c1ac,_0x9280('0x10'),JSON[_0x9280('0x13')](_0x45dd4e));if(_0x45dd4e[_0x9280('0x14')]){if(_0x45dd4e[_0x9280('0x14')]['code']===0x1f4){logger[_0x9280('0x14')](_0x9280('0xf'),_0x22c1ac,_0x45dd4e['error'][_0x9280('0x15')]);return _0x86f0bc(_0x45dd4e[_0x9280('0x14')]['message']);}logger[_0x9280('0x14')](_0x9280('0xf'),_0x22c1ac,_0x45dd4e['error'][_0x9280('0x15')]);return _0x5af08e(_0x45dd4e[_0x9280('0x14')][_0x9280('0x15')]);}else{logger['info'](_0x9280('0xf'),_0x22c1ac,_0x9280('0x10'));_0x5af08e(_0x45dd4e[_0x9280('0x16')][_0x9280('0x15')]);}})[_0x9280('0x17')](function(_0x1cb4cd){logger['error'](_0x9280('0xf'),_0x22c1ac,_0x1cb4cd);_0x86f0bc(_0x1cb4cd);});});} \ No newline at end of file +var _0xa6e7=['stringify','error','code','message','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5270b4,_0x5ad6c0){var _0x40dff8=function(_0x4d0b5f){while(--_0x4d0b5f){_0x5270b4['push'](_0x5270b4['shift']());}};_0x40dff8(++_0x5ad6c0);}(_0xa6e7,0xb0));var _0x7a6e=function(_0xfbb8c3,_0xdc7b86){_0xfbb8c3=_0xfbb8c3-0x0;var _0x134bc2=_0xa6e7[_0xfbb8c3];return _0x134bc2;};'use strict';var _=require(_0x7a6e('0x0'));var util=require('util');var moment=require(_0x7a6e('0x1'));var BPromise=require(_0x7a6e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7a6e('0x3'));var logger=require(_0x7a6e('0x4'))(_0x7a6e('0x5'));var config=require(_0x7a6e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7a6e('0x7')][_0x7a6e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e3ec1,_0x48f81e,_0x56984a){return new BPromise(function(_0x50d511,_0x415f8d){return client[_0x7a6e('0x9')](_0x2e3ec1,_0x56984a)['then'](function(_0x4adb65){logger[_0x7a6e('0xa')](_0x7a6e('0xb'),_0x48f81e,_0x7a6e('0xc'));logger[_0x7a6e('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x48f81e,_0x7a6e('0xc'),JSON[_0x7a6e('0xe')](_0x4adb65));if(_0x4adb65['error']){if(_0x4adb65[_0x7a6e('0xf')][_0x7a6e('0x10')]===0x1f4){logger[_0x7a6e('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48f81e,_0x4adb65[_0x7a6e('0xf')]['message']);return _0x415f8d(_0x4adb65[_0x7a6e('0xf')]['message']);}logger[_0x7a6e('0xf')](_0x7a6e('0xb'),_0x48f81e,_0x4adb65[_0x7a6e('0xf')]['message']);return _0x50d511(_0x4adb65['error'][_0x7a6e('0x11')]);}else{logger[_0x7a6e('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48f81e,_0x7a6e('0xc'));_0x50d511(_0x4adb65['result'][_0x7a6e('0x11')]);}})[_0x7a6e('0x12')](function(_0x68974d){logger['error'](_0x7a6e('0xb'),_0x48f81e,_0x68974d);_0x415f8d(_0x68974d);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index b64e104..676cdd7 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 _0x14c4=['isAuthenticated','index','/describe','describe','/:id','post','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get'];(function(_0x207aa7,_0x191d10){var _0x2617b4=function(_0x4e70e7){while(--_0x4e70e7){_0x207aa7['push'](_0x207aa7['shift']());}};_0x2617b4(++_0x191d10);}(_0x14c4,0x9d));var _0x414c=function(_0x1c0e91,_0xd8625e){_0x1c0e91=_0x1c0e91-0x0;var _0x34322c=_0x14c4[_0x1c0e91];return _0x34322c;};'use strict';var multer=require(_0x414c('0x0'));var util=require(_0x414c('0x1'));var path=require(_0x414c('0x2'));var timeout=require('connect-timeout');var express=require(_0x414c('0x3'));var router=express[_0x414c('0x4')]();var fs_extra=require(_0x414c('0x5'));var auth=require(_0x414c('0x6'));var interaction=require(_0x414c('0x7'));var config=require(_0x414c('0x8'));var controller=require(_0x414c('0x9'));router[_0x414c('0xa')]('/',auth[_0x414c('0xb')](),controller[_0x414c('0xc')]);router[_0x414c('0xa')](_0x414c('0xd'),auth[_0x414c('0xb')](),controller[_0x414c('0xe')]);router[_0x414c('0xa')](_0x414c('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x414c('0x10')]('/',auth[_0x414c('0xb')](),controller['create']);router[_0x414c('0x11')](_0x414c('0xf'),auth[_0x414c('0xb')](),controller['update']);router[_0x414c('0x12')](_0x414c('0xf'),auth['isAuthenticated'](),controller[_0x414c('0x13')]);module[_0x414c('0x14')]=router; \ No newline at end of file +var _0x5068=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x3a430b,_0x3b491a){var _0x470839=function(_0x120be2){while(--_0x120be2){_0x3a430b['push'](_0x3a430b['shift']());}};_0x470839(++_0x3b491a);}(_0x5068,0xe3));var _0x8506=function(_0x5c4c20,_0x59b68b){_0x5c4c20=_0x5c4c20-0x0;var _0x1defb5=_0x5068[_0x5c4c20];return _0x1defb5;};'use strict';var multer=require(_0x8506('0x0'));var util=require(_0x8506('0x1'));var path=require(_0x8506('0x2'));var timeout=require(_0x8506('0x3'));var express=require(_0x8506('0x4'));var router=express[_0x8506('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8506('0x6'));var interaction=require(_0x8506('0x7'));var config=require(_0x8506('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x8506('0x9')]('/',auth[_0x8506('0xa')](),controller[_0x8506('0xb')]);router[_0x8506('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x8506('0xc')]);router[_0x8506('0x9')](_0x8506('0xd'),auth[_0x8506('0xa')](),controller[_0x8506('0xe')]);router[_0x8506('0xf')]('/',auth[_0x8506('0xa')](),controller[_0x8506('0x10')]);router[_0x8506('0x11')](_0x8506('0xd'),auth[_0x8506('0xa')](),controller[_0x8506('0x12')]);router[_0x8506('0x13')]('/:id',auth[_0x8506('0xa')](),controller[_0x8506('0x14')]);module[_0x8506('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 dc3e059..7e25f26 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 _0x870e=['sequelize','exports','STRING','mouseOver','timeout','INTEGER'];(function(_0x3f6cc0,_0x432b00){var _0xfc7086=function(_0x34f4af){while(--_0x34f4af){_0x3f6cc0['push'](_0x3f6cc0['shift']());}};_0xfc7086(++_0x432b00);}(_0x870e,0x17a));var _0xe870=function(_0x5d3f47,_0x1bce6f){_0x5d3f47=_0x5d3f47-0x0;var _0x3628e7=_0x870e[_0x5d3f47];return _0x3628e7;};'use strict';var Sequelize=require(_0xe870('0x0'));module[_0xe870('0x1')]={'name':{'type':Sequelize[_0xe870('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe870('0x3'),_0xe870('0x4')),'defaultValue':_0xe870('0x3')},'selector':{'type':Sequelize[_0xe870('0x2')]},'timeout':{'type':Sequelize[_0xe870('0x5')]}}; \ No newline at end of file +var _0x3b93=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x5b5199,_0x58a8e5){var _0x2f5736=function(_0x1f35ce){while(--_0x1f35ce){_0x5b5199['push'](_0x5b5199['shift']());}};_0x2f5736(++_0x58a8e5);}(_0x3b93,0xe0));var _0x33b9=function(_0x2a8e31,_0x5c4853){_0x2a8e31=_0x2a8e31-0x0;var _0x11cc23=_0x3b93[_0x2a8e31];return _0x11cc23;};'use strict';var Sequelize=require(_0x33b9('0x0'));module[_0x33b9('0x1')]={'name':{'type':Sequelize[_0x33b9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x33b9('0x3')](_0x33b9('0x4'),_0x33b9('0x5')),'defaultValue':_0x33b9('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x33b9('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index faa1079..9a36499 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 _0x1c88=['filters','model','attributes','intersection','fields','include','merge','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1c88,0x1a9));var _0x81c8=function(_0x52e68e,_0x309912){_0x52e68e=_0x52e68e-0x0;var _0x3211a4=_0x1c88[_0x52e68e];return _0x3211a4;};'use strict';var emlformat=require(_0x81c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x81c8('0x1'));var jsonpatch=require(_0x81c8('0x2'));var rp=require(_0x81c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x81c8('0x4'));var util=require(_0x81c8('0x5'));var path=require(_0x81c8('0x6'));var sox=require(_0x81c8('0x7'));var csv=require(_0x81c8('0x8'));var ejs=require(_0x81c8('0x9'));var fs=require('fs');var fs_extra=require(_0x81c8('0xa'));var _=require(_0x81c8('0xb'));var squel=require(_0x81c8('0xc'));var crypto=require(_0x81c8('0xd'));var jsforce=require(_0x81c8('0xe'));var deskjs=require(_0x81c8('0xf'));var toCsv=require(_0x81c8('0x8'));var querystring=require('querystring');var Papa=require(_0x81c8('0x10'));var Redis=require(_0x81c8('0x11'));var authService=require(_0x81c8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81c8('0x13'));var logger=require(_0x81c8('0x14'))(_0x81c8('0x15'));var utils=require('../../config/utils');var config=require(_0x81c8('0x16'));var licenseUtil=require(_0x81c8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40061f,_0x1d0a15){_0x1d0a15=_0x1d0a15||0xcc;return function(_0x1d71f3){if(_0x1d71f3){return _0x40061f[_0x81c8('0x18')](_0x1d0a15);}return _0x40061f['status'](_0x1d0a15)[_0x81c8('0x19')]();};}function respondWithResult(_0x28b41f,_0x147d9e){_0x147d9e=_0x147d9e||0xc8;return function(_0x5e9a80){if(_0x5e9a80){return _0x28b41f[_0x81c8('0x1a')](_0x147d9e)[_0x81c8('0x1b')](_0x5e9a80);}};}function respondWithFilteredResult(_0x136cde,_0x55d438){return function(_0x10732c){if(_0x10732c){var _0x43a548=typeof _0x55d438[_0x81c8('0x1c')]===_0x81c8('0x1d')&&typeof _0x55d438[_0x81c8('0x1e')]==='undefined';var _0x3f7bf3=_0x10732c[_0x81c8('0x1f')];var _0x573a83=_0x43a548?0x0:_0x55d438[_0x81c8('0x1c')];var _0x1b74d1=_0x43a548?_0x10732c[_0x81c8('0x1f')]:_0x55d438[_0x81c8('0x1c')]+_0x55d438[_0x81c8('0x1e')];var _0x330ef2;if(_0x1b74d1>=_0x3f7bf3){_0x1b74d1=_0x3f7bf3;_0x330ef2=0xc8;}else{_0x330ef2=0xce;}_0x136cde[_0x81c8('0x1a')](_0x330ef2);return _0x136cde[_0x81c8('0x20')](_0x81c8('0x21'),_0x573a83+'-'+_0x1b74d1+'/'+_0x3f7bf3)['json'](_0x10732c);}return null;};}function patchUpdates(_0x2af7b6){return function(_0x5662c7){try{jsonpatch['apply'](_0x5662c7,_0x2af7b6,!![]);}catch(_0x5821d4){return BPromise['reject'](_0x5821d4);}return _0x5662c7[_0x81c8('0x22')]();};}function saveUpdates(_0x513d85,_0x147382){return function(_0x42fb26){if(_0x42fb26){return _0x42fb26[_0x81c8('0x23')](_0x513d85)[_0x81c8('0x24')](function(_0xcccbc){return _0xcccbc;});}return null;};}function removeEntity(_0x32c98a,_0x43d9f2){return function(_0x24674b){if(_0x24674b){return _0x24674b[_0x81c8('0x25')]()[_0x81c8('0x24')](function(){_0x32c98a[_0x81c8('0x1a')](0xcc)[_0x81c8('0x19')]();});}};}function handleEntityNotFound(_0x490d58,_0x52ff11){return function(_0xb71afc){if(!_0xb71afc){_0x490d58[_0x81c8('0x18')](0x194);}return _0xb71afc;};}function handleError(_0x3f06e7,_0x2174f2){_0x2174f2=_0x2174f2||0x1f4;return function(_0x5ac31d){logger[_0x81c8('0x26')](_0x5ac31d['stack']);if(_0x5ac31d[_0x81c8('0x27')]){delete _0x5ac31d[_0x81c8('0x27')];}_0x3f06e7[_0x81c8('0x1a')](_0x2174f2)[_0x81c8('0x28')](_0x5ac31d);};}exports[_0x81c8('0x29')]=function(_0x3ac0e4,_0xbe3e16){var _0xd4514={'raw':!![],'where':{'id':_0x3ac0e4[_0x81c8('0x2a')]['id']}},_0x5a2929={};_0x5a2929['model']=_[_0x81c8('0x2b')](db[_0x81c8('0x2c')][_0x81c8('0x2d')]);_0x5a2929[_0x81c8('0x2e')]=_[_0x81c8('0x2b')](_0x3ac0e4[_0x81c8('0x2e')]);_0x5a2929[_0x81c8('0x2f')]=_['intersection'](_0x5a2929[_0x81c8('0x30')],_0x5a2929['query']);_0xd4514[_0x81c8('0x31')]=_[_0x81c8('0x32')](_0x5a2929[_0x81c8('0x30')],qs['fields'](_0x3ac0e4[_0x81c8('0x2e')][_0x81c8('0x33')]));_0xd4514['attributes']=_0xd4514[_0x81c8('0x31')]['length']?_0xd4514[_0x81c8('0x31')]:_0x5a2929['model'];if(_0x3ac0e4[_0x81c8('0x2e')]['includeAll']){_0xd4514[_0x81c8('0x34')]=[{'all':!![]}];}_0xd4514=_[_0x81c8('0x35')]({},_0xd4514,_0x3ac0e4[_0x81c8('0x36')]);return db[_0x81c8('0x2c')][_0x81c8('0x37')](_0xd4514)[_0x81c8('0x24')](handleEntityNotFound(_0xbe3e16,null))[_0x81c8('0x24')](respondWithResult(_0xbe3e16,null))[_0x81c8('0x38')](handleError(_0xbe3e16,null));};exports['create']=function(_0x21584b,_0x599751){return db[_0x81c8('0x2c')][_0x81c8('0x39')](_0x21584b[_0x81c8('0x3a')],{})[_0x81c8('0x24')](respondWithResult(_0x599751,0xc9))[_0x81c8('0x38')](handleError(_0x599751,null));};exports['update']=function(_0x3b6eda,_0x5f5c42){if(_0x3b6eda[_0x81c8('0x3a')]['id']){delete _0x3b6eda[_0x81c8('0x3a')]['id'];}return db[_0x81c8('0x2c')][_0x81c8('0x37')]({'where':{'id':_0x3b6eda[_0x81c8('0x2a')]['id']}})[_0x81c8('0x24')](handleEntityNotFound(_0x5f5c42,null))['then'](saveUpdates(_0x3b6eda[_0x81c8('0x3a')],null))[_0x81c8('0x24')](respondWithResult(_0x5f5c42,null))[_0x81c8('0x38')](handleError(_0x5f5c42,null));};exports[_0x81c8('0x25')]=function(_0x2e27ad,_0x1cd895){return db[_0x81c8('0x2c')][_0x81c8('0x37')]({'where':{'id':_0x2e27ad[_0x81c8('0x2a')]['id']}})[_0x81c8('0x24')](handleEntityNotFound(_0x1cd895,null))['then'](removeEntity(_0x1cd895,null))[_0x81c8('0x38')](handleError(_0x1cd895,null));}; \ No newline at end of file +var _0xabe8=['send','model','keys','filters','intersection','query','attributes','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','create','update','body','catch','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name'];(function(_0xf28958,_0x53f0ed){var _0x4a4ce4=function(_0x5275fb){while(--_0x5275fb){_0xf28958['push'](_0xf28958['shift']());}};_0x4a4ce4(++_0x53f0ed);}(_0xabe8,0x8c));var _0x8abe=function(_0x56338a,_0x1d112e){_0x56338a=_0x56338a-0x0;var _0x404efd=_0xabe8[_0x56338a];return _0x404efd;};'use strict';var emlformat=require(_0x8abe('0x0'));var rimraf=require(_0x8abe('0x1'));var zipdir=require(_0x8abe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8abe('0x3'));var moment=require(_0x8abe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8abe('0x5'));var util=require('util');var path=require(_0x8abe('0x6'));var sox=require(_0x8abe('0x7'));var csv=require(_0x8abe('0x8'));var ejs=require(_0x8abe('0x9'));var fs=require('fs');var fs_extra=require(_0x8abe('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8abe('0xb'));var jsforce=require(_0x8abe('0xc'));var deskjs=require(_0x8abe('0xd'));var toCsv=require(_0x8abe('0x8'));var querystring=require(_0x8abe('0xe'));var Papa=require(_0x8abe('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8abe('0x10'));var hardwareService=require(_0x8abe('0x11'));var logger=require(_0x8abe('0x12'))(_0x8abe('0x13'));var utils=require(_0x8abe('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8abe('0x15'))['db'];function respondWithStatusCode(_0x8d4179,_0x1970b2){_0x1970b2=_0x1970b2||0xcc;return function(_0x3890f8){if(_0x3890f8){return _0x8d4179['sendStatus'](_0x1970b2);}return _0x8d4179['status'](_0x1970b2)['end']();};}function respondWithResult(_0xb75397,_0x5e7c8b){_0x5e7c8b=_0x5e7c8b||0xc8;return function(_0x1c407d){if(_0x1c407d){return _0xb75397['status'](_0x5e7c8b)[_0x8abe('0x16')](_0x1c407d);}};}function respondWithFilteredResult(_0x168f96,_0x5d24ad){return function(_0x1bcd6d){if(_0x1bcd6d){var _0x5bc34a=typeof _0x5d24ad[_0x8abe('0x17')]===_0x8abe('0x18')&&typeof _0x5d24ad[_0x8abe('0x19')]===_0x8abe('0x18');var _0x3f5d9b=_0x1bcd6d[_0x8abe('0x1a')];var _0x1cd7c9=_0x5bc34a?0x0:_0x5d24ad[_0x8abe('0x17')];var _0x45905e=_0x5bc34a?_0x1bcd6d[_0x8abe('0x1a')]:_0x5d24ad[_0x8abe('0x17')]+_0x5d24ad['limit'];var _0x190e2e;if(_0x45905e>=_0x3f5d9b){_0x45905e=_0x3f5d9b;_0x190e2e=0xc8;}else{_0x190e2e=0xce;}_0x168f96[_0x8abe('0x1b')](_0x190e2e);return _0x168f96[_0x8abe('0x1c')](_0x8abe('0x1d'),_0x1cd7c9+'-'+_0x45905e+'/'+_0x3f5d9b)[_0x8abe('0x16')](_0x1bcd6d);}return null;};}function patchUpdates(_0x49f03d){return function(_0x4f6c1c){try{jsonpatch[_0x8abe('0x1e')](_0x4f6c1c,_0x49f03d,!![]);}catch(_0xfa8e74){return BPromise[_0x8abe('0x1f')](_0xfa8e74);}return _0x4f6c1c[_0x8abe('0x20')]();};}function saveUpdates(_0x346153,_0x2f7e3c){return function(_0x113ab2){if(_0x113ab2){return _0x113ab2['update'](_0x346153)[_0x8abe('0x21')](function(_0x1eaf31){return _0x1eaf31;});}return null;};}function removeEntity(_0x383ca7,_0x1873d5){return function(_0x1f9bde){if(_0x1f9bde){return _0x1f9bde[_0x8abe('0x22')]()[_0x8abe('0x21')](function(){_0x383ca7[_0x8abe('0x1b')](0xcc)[_0x8abe('0x23')]();});}};}function handleEntityNotFound(_0x3d1785,_0x40f33a){return function(_0x301d4a){if(!_0x301d4a){_0x3d1785[_0x8abe('0x24')](0x194);}return _0x301d4a;};}function handleError(_0x189440,_0x14c9db){_0x14c9db=_0x14c9db||0x1f4;return function(_0x261c62){logger[_0x8abe('0x25')](_0x261c62[_0x8abe('0x26')]);if(_0x261c62['name']){delete _0x261c62[_0x8abe('0x27')];}_0x189440[_0x8abe('0x1b')](_0x14c9db)[_0x8abe('0x28')](_0x261c62);};}exports['show']=function(_0xca4d,_0x4a899c){var _0x1e9316={'raw':!![],'where':{'id':_0xca4d['params']['id']}},_0x3f30bf={};_0x3f30bf[_0x8abe('0x29')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x3f30bf['query']=_[_0x8abe('0x2a')](_0xca4d['query']);_0x3f30bf[_0x8abe('0x2b')]=_[_0x8abe('0x2c')](_0x3f30bf[_0x8abe('0x29')],_0x3f30bf[_0x8abe('0x2d')]);_0x1e9316[_0x8abe('0x2e')]=_[_0x8abe('0x2c')](_0x3f30bf[_0x8abe('0x29')],qs['fields'](_0xca4d[_0x8abe('0x2d')][_0x8abe('0x2f')]));_0x1e9316[_0x8abe('0x2e')]=_0x1e9316[_0x8abe('0x2e')][_0x8abe('0x30')]?_0x1e9316[_0x8abe('0x2e')]:_0x3f30bf['model'];if(_0xca4d[_0x8abe('0x2d')][_0x8abe('0x31')]){_0x1e9316[_0x8abe('0x32')]=[{'all':!![]}];}_0x1e9316=_[_0x8abe('0x33')]({},_0x1e9316,_0xca4d[_0x8abe('0x34')]);return db[_0x8abe('0x35')][_0x8abe('0x36')](_0x1e9316)[_0x8abe('0x21')](handleEntityNotFound(_0x4a899c,null))[_0x8abe('0x21')](respondWithResult(_0x4a899c,null))['catch'](handleError(_0x4a899c,null));};exports[_0x8abe('0x37')]=function(_0x47d627,_0x1a0364){return db[_0x8abe('0x35')]['create'](_0x47d627['body'],{})[_0x8abe('0x21')](respondWithResult(_0x1a0364,0xc9))['catch'](handleError(_0x1a0364,null));};exports[_0x8abe('0x38')]=function(_0xbf1d9,_0x3599de){if(_0xbf1d9[_0x8abe('0x39')]['id']){delete _0xbf1d9[_0x8abe('0x39')]['id'];}return db['ChatProactiveAction'][_0x8abe('0x36')]({'where':{'id':_0xbf1d9['params']['id']}})['then'](handleEntityNotFound(_0x3599de,null))[_0x8abe('0x21')](saveUpdates(_0xbf1d9[_0x8abe('0x39')],null))[_0x8abe('0x21')](respondWithResult(_0x3599de,null))[_0x8abe('0x3a')](handleError(_0x3599de,null));};exports['destroy']=function(_0xf736e6,_0x30af7c){return db['ChatProactiveAction'][_0x8abe('0x36')]({'where':{'id':_0xf736e6[_0x8abe('0x3b')]['id']}})['then'](handleEntityNotFound(_0x30af7c,null))[_0x8abe('0x21')](removeEntity(_0x30af7c,null))['catch'](handleError(_0x30af7c,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index b3aa3f1..27e82ce 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 _0xe8b6=['bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','../../config/logger','api','moment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xe8b6,0x98));var _0x6e8b=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xe8b6[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x6e8b('0x0'));var util=require('util');var logger=require(_0x6e8b('0x1'))(_0x6e8b('0x2'));var moment=require(_0x6e8b('0x3'));var BPromise=require(_0x6e8b('0x4'));var rp=require(_0x6e8b('0x5'));var fs=require('fs');var path=require(_0x6e8b('0x6'));var rimraf=require(_0x6e8b('0x7'));var config=require(_0x6e8b('0x8'));var attributes=require(_0x6e8b('0x9'));module[_0x6e8b('0xa')]=function(_0x59ec43,_0x2bce18){return _0x59ec43[_0x6e8b('0xb')]('ChatProactiveAction',attributes,{'tableName':_0x6e8b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x496b=['path','./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0x496b,0x12d));var _0xb496=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0x496b[_0x277af0];return _0x43bd7c;};'use strict';var _=require(_0xb496('0x0'));var util=require(_0xb496('0x1'));var logger=require(_0xb496('0x2'))(_0xb496('0x3'));var moment=require(_0xb496('0x4'));var BPromise=require(_0xb496('0x5'));var rp=require(_0xb496('0x6'));var fs=require('fs');var path=require(_0xb496('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb496('0x8'));module[_0xb496('0x9')]=function(_0x28843c,_0x387eee){return _0x28843c['define'](_0xb496('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index a2147bf..e533246 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 _0xc3d1=['moment','bluebird','randomstring','ioredis','rpc','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash'];(function(_0x329e45,_0x2a09db){var _0x25c632=function(_0x257b65){while(--_0x257b65){_0x329e45['push'](_0x329e45['shift']());}};_0x25c632(++_0x2a09db);}(_0xc3d1,0xbd));var _0x1c3d=function(_0x57746e,_0x45093f){_0x57746e=_0x57746e-0x0;var _0x5caeaa=_0xc3d1[_0x57746e];return _0x5caeaa;};'use strict';var _=require(_0x1c3d('0x0'));var util=require('util');var moment=require(_0x1c3d('0x1'));var BPromise=require(_0x1c3d('0x2'));var rs=require(_0x1c3d('0x3'));var fs=require('fs');var Redis=require(_0x1c3d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c3d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1c3d('0x6')][_0x1c3d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c0d41,_0x4fbabd,_0x19440e){return new BPromise(function(_0x598dd1,_0x31041f){return client[_0x1c3d('0x8')](_0x3c0d41,_0x19440e)[_0x1c3d('0x9')](function(_0x498c38){logger['info'](_0x1c3d('0xa'),_0x4fbabd,'request\x20sent');logger[_0x1c3d('0xb')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4fbabd,'request\x20sent',JSON[_0x1c3d('0xc')](_0x498c38));if(_0x498c38[_0x1c3d('0xd')]){if(_0x498c38[_0x1c3d('0xd')][_0x1c3d('0xe')]===0x1f4){logger[_0x1c3d('0xd')](_0x1c3d('0xa'),_0x4fbabd,_0x498c38[_0x1c3d('0xd')]['message']);return _0x31041f(_0x498c38[_0x1c3d('0xd')][_0x1c3d('0xf')]);}logger['error'](_0x1c3d('0xa'),_0x4fbabd,_0x498c38[_0x1c3d('0xd')]['message']);return _0x598dd1(_0x498c38['error'][_0x1c3d('0xf')]);}else{logger['info'](_0x1c3d('0xa'),_0x4fbabd,_0x1c3d('0x10'));_0x598dd1(_0x498c38[_0x1c3d('0x11')][_0x1c3d('0xf')]);}})[_0x1c3d('0x12')](function(_0x3ce38e){logger[_0x1c3d('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x4fbabd,_0x3ce38e);_0x31041f(_0x3ce38e);});});} \ No newline at end of file +var _0x8792=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x8792,0xc1));var _0x2879=function(_0x584354,_0x3b4a6f){_0x584354=_0x584354-0x0;var _0x285f14=_0x8792[_0x584354];return _0x285f14;};'use strict';var _=require(_0x2879('0x0'));var util=require(_0x2879('0x1'));var moment=require(_0x2879('0x2'));var BPromise=require(_0x2879('0x3'));var rs=require(_0x2879('0x4'));var fs=require('fs');var Redis=require(_0x2879('0x5'));var db=require(_0x2879('0x6'))['db'];var utils=require(_0x2879('0x7'));var logger=require(_0x2879('0x8'))(_0x2879('0x9'));var config=require(_0x2879('0xa'));var jayson=require(_0x2879('0xb'));var client=jayson[_0x2879('0xc')][_0x2879('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x487821,_0x55a6c6,_0x5dbc71){return new BPromise(function(_0x2c8690,_0x585d05){return client[_0x2879('0xe')](_0x487821,_0x5dbc71)[_0x2879('0xf')](function(_0x26ec16){logger[_0x2879('0x10')](_0x2879('0x11'),_0x55a6c6,_0x2879('0x12'));logger[_0x2879('0x13')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x55a6c6,_0x2879('0x12'),JSON['stringify'](_0x26ec16));if(_0x26ec16[_0x2879('0x14')]){if(_0x26ec16[_0x2879('0x14')][_0x2879('0x15')]===0x1f4){logger[_0x2879('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x55a6c6,_0x26ec16[_0x2879('0x14')]['message']);return _0x585d05(_0x26ec16[_0x2879('0x14')][_0x2879('0x16')]);}logger[_0x2879('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x55a6c6,_0x26ec16['error'][_0x2879('0x16')]);return _0x2c8690(_0x26ec16['error'][_0x2879('0x16')]);}else{logger[_0x2879('0x10')](_0x2879('0x11'),_0x55a6c6,_0x2879('0x12'));_0x2c8690(_0x26ec16[_0x2879('0x17')][_0x2879('0x16')]);}})[_0x2879('0x18')](function(_0x5d9575){logger[_0x2879('0x14')](_0x2879('0x11'),_0x55a6c6,_0x5d9575);_0x585d05(_0x5d9575);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 76e830b..661e53e 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 _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x1b8f36,_0x5ce399){var _0x4ff650=function(_0xc87da0){while(--_0xc87da0){_0x1b8f36['push'](_0x1b8f36['shift']());}};_0x4ff650(++_0x5ce399);}(_0x33c5,0xe6));var _0x533c=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0x33c5[_0x12ddb2];return _0x10b6dd;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x2d5346,_0xb13ba4){var _0x5348eb=function(_0x694baa){while(--_0x694baa){_0x2d5346['push'](_0x2d5346['shift']());}};_0x5348eb(++_0xb13ba4);}(_0x33c5,0xe6));var _0x533c=function(_0x2d1cf4,_0x2ea9ee){_0x2d1cf4=_0x2d1cf4-0x0;var _0x554a7c=_0x33c5[_0x2d1cf4];return _0x554a7c;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);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 ff388d2..9ebad90 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 _0xb970=['STRING','name','INTEGER','ENUM','beepall','roundrobin','exports'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0xb970,0x99));var _0x0b97=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xb970[_0x454018];return _0x24697d;};'use strict';var Sequelize=require('sequelize');module[_0x0b97('0x0')]={'name':{'type':Sequelize[_0x0b97('0x1')],'unique':_0x0b97('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0b97('0x1')]},'timeout':{'type':Sequelize[_0x0b97('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b97('0x4')]('rrmemory',_0x0b97('0x5'),_0x0b97('0x6'))}}; \ No newline at end of file +var _0xc34c=['roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x28958c,_0x4cf771){var _0x31c1a7=function(_0x2a542c){while(--_0x2a542c){_0x28958c['push'](_0x28958c['shift']());}};_0x31c1a7(++_0x4cf771);}(_0xc34c,0x169));var _0xcc34=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc34c[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xcc34('0x0'));module[_0xcc34('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xcc34('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcc34('0x3')]},'timeout':{'type':Sequelize[_0xcc34('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcc34('0x5')](_0xcc34('0x6'),_0xcc34('0x7'),_0xcc34('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index dabeb90..f06c039 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 _0xa02d=['value','removeTeams','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','isArray','getAgents','order','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','end','status','json','offset','undefined','count','limit','set','update','then','get','ChatQueues','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','ChatQueue','key','getOptions','where','query','findAll','rows','catch','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','merge','options','UserChatQueue','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','sequelize','transaction','findOrCreate','forEach','userChatQueue:save','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId'];(function(_0x273cb0,_0xc7b288){var _0x50241a=function(_0x49b206){while(--_0x49b206){_0x273cb0['push'](_0x273cb0['shift']());}};_0x50241a(++_0xc7b288);}(_0xa02d,0x161));var _0xda02=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0xa02d[_0x3f993e];return _0x39c135;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xda02('0x0'));var squel=require(_0xda02('0x1'));var Redis=require(_0xda02('0x2'));var qs=require(_0xda02('0x3'));var logger=require(_0xda02('0x4'))(_0xda02('0x5'));var config=require(_0xda02('0x6'));var db=require('../../mysqldb')['db'];config[_0xda02('0x7')]=_[_0xda02('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xda02('0x9'))(new Redis(config[_0xda02('0x7')]));require('./chatQueue.socket')[_0xda02('0xa')](socket);function respondWithStatusCode(_0x458752,_0x49de04){_0x49de04=_0x49de04||0xcc;return function(_0x3119d9){if(_0x3119d9){return _0x458752['sendStatus'](_0x49de04);}return _0x458752['status'](_0x49de04)[_0xda02('0xb')]();};}function respondWithResult(_0x4618a9,_0x353b43){_0x353b43=_0x353b43||0xc8;return function(_0x1ea9e0){if(_0x1ea9e0){return _0x4618a9[_0xda02('0xc')](_0x353b43)[_0xda02('0xd')](_0x1ea9e0);}};}function respondWithFilteredResult(_0x371a6e,_0x3c8b07){return function(_0x48c3d0){if(_0x48c3d0){var _0x40a1aa=typeof _0x3c8b07[_0xda02('0xe')]===_0xda02('0xf')&&typeof _0x3c8b07['limit']===_0xda02('0xf');var _0x2510ef=_0x48c3d0['count'];var _0x3eb5a9=_0x40a1aa?0x0:_0x3c8b07['offset'];var _0x1b01de=_0x40a1aa?_0x48c3d0[_0xda02('0x10')]:_0x3c8b07['offset']+_0x3c8b07[_0xda02('0x11')];var _0x29a5a9;if(_0x1b01de>=_0x2510ef){_0x1b01de=_0x2510ef;_0x29a5a9=0xc8;}else{_0x29a5a9=0xce;}_0x371a6e[_0xda02('0xc')](_0x29a5a9);return _0x371a6e[_0xda02('0x12')]('Content-Range',_0x3eb5a9+'-'+_0x1b01de+'/'+_0x2510ef)[_0xda02('0xd')](_0x48c3d0);}return null;};}function saveUpdates(_0x5ef94e){return function(_0x14ab6a){if(_0x14ab6a){return _0x14ab6a[_0xda02('0x13')](_0x5ef94e)[_0xda02('0x14')](function(_0x478720){return _0x478720;});}return null;};}function removeEntity(_0x2bc895){return function(_0x530c7d){if(_0x530c7d){return _0x530c7d['destroy']()['then'](function(){var _0x3b2553=_0x530c7d[_0xda02('0x15')]({'plain':!![]});var _0x527973=_0xda02('0x16');return db[_0xda02('0x17')][_0xda02('0x18')]({'where':{'type':_0x527973,'resourceId':_0x3b2553['id']}})['then'](function(){return _0x530c7d;});})[_0xda02('0x14')](function(){_0x2bc895[_0xda02('0xc')](0xcc)[_0xda02('0xb')]();});}};}function handleEntityNotFound(_0x48604d){return function(_0x5f19c2){if(!_0x5f19c2){_0x48604d[_0xda02('0x19')](0x194);}return _0x5f19c2;};}function handleError(_0xd3b7ce,_0x511a6f){_0x511a6f=_0x511a6f||0x1f4;return function(_0x1df5e4){logger[_0xda02('0x1a')](_0x1df5e4[_0xda02('0x1b')]);if(_0x1df5e4['name']){delete _0x1df5e4[_0xda02('0x1c')];}_0xd3b7ce['status'](_0x511a6f)['send'](_0x1df5e4);};}exports[_0xda02('0x1d')]=function(_0x10998b,_0x67aa73){var _0x13057d={};var _0x21c71d={'count':0x0,'rows':[]};var _0x526df5=_[_0xda02('0x1e')](db[_0xda02('0x1f')]['rawAttributes'],function(_0x4ecae6){return{'name':_0x4ecae6['fieldName'],'type':_0x4ecae6['type'][_0xda02('0x20')]};});_0x13057d=qs[_0xda02('0x21')](_0x526df5,_0x10998b);var _0xec0f63={'where':_0x13057d[_0xda02('0x22')]};return db[_0xda02('0x1f')][_0xda02('0x10')](_0xec0f63)[_0xda02('0x14')](function(_0x39d496){_0x21c71d[_0xda02('0x10')]=_0x39d496;_0x13057d['include']=qs['include'](_0x10998b[_0xda02('0x23')]);return db[_0xda02('0x1f')][_0xda02('0x24')](_0x13057d);})[_0xda02('0x14')](function(_0x2b1115){_0x21c71d[_0xda02('0x25')]=_0x2b1115;return _0x21c71d;})[_0xda02('0x14')](respondWithFilteredResult(_0x67aa73,_0x13057d))[_0xda02('0x26')](handleError(_0x67aa73,null));};exports[_0xda02('0x27')]=function(_0x2b45a5,_0x1cb4a2){var _0x1d79a8={'raw':!![],'where':{'id':_0x2b45a5['params']['id']}},_0x278cc9={};_0x278cc9[_0xda02('0x28')]=_[_0xda02('0x29')](db[_0xda02('0x1f')][_0xda02('0x2a')]);_0x278cc9[_0xda02('0x23')]=_[_0xda02('0x29')](_0x2b45a5[_0xda02('0x23')]);_0x278cc9[_0xda02('0x2b')]=_[_0xda02('0x2c')](_0x278cc9[_0xda02('0x28')],_0x278cc9['query']);_0x1d79a8[_0xda02('0x2d')]=_[_0xda02('0x2c')](_0x278cc9[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x2b45a5[_0xda02('0x23')][_0xda02('0x2e')]));_0x1d79a8[_0xda02('0x2d')]=_0x1d79a8['attributes'][_0xda02('0x2f')]?_0x1d79a8[_0xda02('0x2d')]:_0x278cc9[_0xda02('0x28')];if(_0x2b45a5[_0xda02('0x23')]['includeAll']){_0x1d79a8[_0xda02('0x30')]=[{'all':!![]}];}_0x1d79a8=_['merge']({},_0x1d79a8,_0x2b45a5['options']);return db['ChatQueue'][_0xda02('0x31')](_0x1d79a8)[_0xda02('0x14')](handleEntityNotFound(_0x1cb4a2,null))[_0xda02('0x14')](respondWithResult(_0x1cb4a2,null))[_0xda02('0x26')](handleError(_0x1cb4a2,null));};exports[_0xda02('0x32')]=function(_0x3fbc98,_0x14023c){return db[_0xda02('0x1f')][_0xda02('0x32')](_0x3fbc98[_0xda02('0x33')],{})[_0xda02('0x14')](function(_0x1ab94c){var _0x4e5a8e=_0x3fbc98[_0xda02('0x34')][_0xda02('0x15')]({'plain':!![]});if(!_0x4e5a8e)throw new Error(_0xda02('0x35'));if(_0x4e5a8e[_0xda02('0x36')]===_0xda02('0x34')){var _0x30c9c4=_0x1ab94c[_0xda02('0x15')]({'plain':!![]});var _0x34a1bb='ChatQueues';return db[_0xda02('0x37')][_0xda02('0x31')]({'where':{'name':_0x34a1bb,'userProfileId':_0x4e5a8e['userProfileId']},'raw':!![]})[_0xda02('0x14')](function(_0xdf9b1a){if(_0xdf9b1a&&_0xdf9b1a[_0xda02('0x38')]===0x0){return db[_0xda02('0x17')][_0xda02('0x32')]({'name':_0x30c9c4[_0xda02('0x1c')],'resourceId':_0x30c9c4['id'],'type':_0xdf9b1a['name'],'sectionId':_0xdf9b1a['id']},{})[_0xda02('0x14')](function(){return _0x1ab94c;});}else{return _0x1ab94c;}})[_0xda02('0x26')](function(_0x1aab09){logger[_0xda02('0x1a')](_0xda02('0x39'),_0x1aab09);throw _0x1aab09;});}return _0x1ab94c;})[_0xda02('0x14')](respondWithResult(_0x14023c,0xc9))[_0xda02('0x26')](handleError(_0x14023c,null));};exports[_0xda02('0x13')]=function(_0x434293,_0x35456c){if(_0x434293[_0xda02('0x33')]['id']){delete _0x434293[_0xda02('0x33')]['id'];}return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x434293[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x35456c,null))[_0xda02('0x14')](saveUpdates(_0x434293['body'],null))[_0xda02('0x14')](respondWithResult(_0x35456c,null))[_0xda02('0x26')](handleError(_0x35456c,null));};exports['destroy']=function(_0x3b7935,_0x2ae886){return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x3b7935[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x2ae886,null))[_0xda02('0x14')](removeEntity(_0x2ae886,null))[_0xda02('0x26')](handleError(_0x2ae886,null));};exports[_0xda02('0x3b')]=function(_0x53810e,_0x39faac){return db[_0xda02('0x1f')][_0xda02('0x3b')]()['then'](respondWithResult(_0x39faac,null))[_0xda02('0x26')](handleError(_0x39faac,null));};exports['getMembers']=function(_0x5ddd0f,_0x3a449a){var _0x231136={'raw':!![],'where':{}},_0x40b4e1={},_0x5ea3c8;return db['ChatQueue'][_0xda02('0x3c')]({'where':{'id':_0x5ddd0f[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x3a449a,null))[_0xda02('0x14')](function(_0x58fd37){if(_0x58fd37){_0x5ea3c8=_0x58fd37[_0xda02('0x15')]({'plain':!![]});_0x40b4e1[_0xda02('0x28')]=_['keys'](db['UserChatQueue'][_0xda02('0x2a')]);_0x40b4e1[_0xda02('0x23')]=_[_0xda02('0x29')](_0x5ddd0f[_0xda02('0x23')]);_0x40b4e1[_0xda02('0x2b')]=_['intersection'](_0x40b4e1[_0xda02('0x28')],_0x40b4e1[_0xda02('0x23')]);_0x231136[_0xda02('0x2d')]=_['intersection'](_0x40b4e1[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x5ddd0f[_0xda02('0x23')]['fields']));_0x231136[_0xda02('0x2d')]=_0x231136['attributes'][_0xda02('0x2f')]?_0x231136['attributes']:_0x40b4e1[_0xda02('0x28')];if(!_0x5ddd0f[_0xda02('0x23')][_0xda02('0x3d')](_0xda02('0x3e'))){_0x231136['limit']=qs['limit'](_0x5ddd0f[_0xda02('0x23')][_0xda02('0x11')]);_0x231136[_0xda02('0xe')]=qs[_0xda02('0xe')](_0x5ddd0f[_0xda02('0x23')][_0xda02('0xe')]);}_0x231136['order']=qs[_0xda02('0x3f')](_0x5ddd0f[_0xda02('0x23')]['sort']);_0x231136[_0xda02('0x22')]=qs['filters'](_[_0xda02('0x40')](_0x5ddd0f[_0xda02('0x23')],_0x40b4e1[_0xda02('0x2b')]));_0x231136[_0xda02('0x22')][_0xda02('0x41')]=_0x58fd37['id'];if(_0x5ddd0f[_0xda02('0x23')][_0xda02('0x42')]){_0x231136['where']=_[_0xda02('0x43')](_0x231136[_0xda02('0x22')],{'$or':_[_0xda02('0x1e')](_0x231136[_0xda02('0x2d')],function(_0x268e65){var _0x18f866={};_0x18f866[_0x268e65]={'$like':'%'+_0x5ddd0f[_0xda02('0x23')]['filter']+'%'};return _0x18f866;})});}_0x231136=_['merge']({},_0x231136,_0x5ddd0f[_0xda02('0x44')]);return db[_0xda02('0x45')][_0xda02('0x24')](_0x231136);}})[_0xda02('0x14')](function(_0x24f08f){if(_0x24f08f){return db[_0xda02('0x46')][_0xda02('0x47')]({'where':{'id':_[_0xda02('0x1e')](_0x24f08f,'UserId'),'role':_0xda02('0x48')},'attributes':['id',_0xda02('0x1c'),_0xda02('0x49'),_0xda02('0x4a'),_0xda02('0x4b')]});}})[_0xda02('0x14')](function(_0x2efd5e){if(_0x2efd5e){return{'count':_0x2efd5e['count'],'rows':_[_0xda02('0x1e')](_0x2efd5e[_0xda02('0x25')],function(_0x849382){return{'membername':_0x849382[_0xda02('0x1c')],'UserId':_0x849382['id'],'queue_name':_0x5ea3c8[_0xda02('0x1c')],'ChatQueueId':_0x5ea3c8['id'],'interface':util[_0xda02('0x4c')](_0xda02('0x4d'),_0xda02('0x4e'),_0x849382[_0xda02('0x1c')]),'penalty':0x0,'paused':_0x849382['chatPause'],'createdAt':_0x849382[_0xda02('0x4b')],'updatedAt':_0x849382[_0xda02('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3a449a,_0x231136))['catch'](handleError(_0x3a449a,null));};exports[_0xda02('0x4f')]=function(_0x214b23,_0x106487){var _0x286018={};var _0x5100dc={};var _0x4462f5;var _0x11adda;return db[_0xda02('0x1f')][_0xda02('0x3c')]({'where':{'id':_0x214b23[_0xda02('0x3a')]['id']}})['then'](handleEntityNotFound(_0x106487,null))[_0xda02('0x14')](function(_0x16f917){if(_0x16f917){_0x4462f5=_0x16f917;_0x5100dc[_0xda02('0x28')]=_['keys'](db['Team'][_0xda02('0x2a')]);_0x5100dc['query']=_[_0xda02('0x29')](_0x214b23['query']);_0x5100dc['filters']=_[_0xda02('0x2c')](_0x5100dc[_0xda02('0x28')],_0x5100dc[_0xda02('0x23')]);_0x286018[_0xda02('0x2d')]=_[_0xda02('0x2c')](_0x5100dc[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x214b23[_0xda02('0x23')]['fields']));_0x286018[_0xda02('0x2d')]=_0x286018[_0xda02('0x2d')][_0xda02('0x2f')]?_0x286018['attributes']:_0x5100dc[_0xda02('0x28')];_0x286018['order']=qs['sort'](_0x214b23['query'][_0xda02('0x3f')]);_0x286018[_0xda02('0x22')]=qs[_0xda02('0x2b')](_['pick'](_0x214b23[_0xda02('0x23')],_0x5100dc[_0xda02('0x2b')]));if(_0x214b23['query'][_0xda02('0x42')]){_0x286018[_0xda02('0x22')]=_[_0xda02('0x43')](_0x286018[_0xda02('0x22')],{'$or':_[_0xda02('0x1e')](_0x286018[_0xda02('0x2d')],function(_0x22bc78){var _0x5b3c85={};_0x5b3c85[_0x22bc78]={'$like':'%'+_0x214b23[_0xda02('0x23')][_0xda02('0x42')]+'%'};return _0x5b3c85;})});}_0x286018=_[_0xda02('0x43')]({},_0x286018,_0x214b23[_0xda02('0x44')]);return _0x4462f5[_0xda02('0x4f')](_0x286018);}})[_0xda02('0x14')](function(_0x14e7e4){if(_0x14e7e4){_0x11adda=_0x14e7e4[_0xda02('0x2f')];if(!_0x214b23[_0xda02('0x23')][_0xda02('0x3d')]('nolimit')){_0x286018[_0xda02('0x11')]=qs[_0xda02('0x11')](_0x214b23[_0xda02('0x23')][_0xda02('0x11')]);_0x286018[_0xda02('0xe')]=qs[_0xda02('0xe')](_0x214b23['query']['offset']);}return _0x4462f5[_0xda02('0x4f')](_0x286018);}})[_0xda02('0x14')](function(_0x1c255e){if(_0x1c255e){return _0x1c255e?{'count':_0x11adda,'rows':_0x1c255e}:null;}})['then'](respondWithResult(_0x106487,null))['catch'](handleError(_0x106487,null));};exports[_0xda02('0x50')]=function(_0x5be91c,_0x135144){var _0x15ec45=_0x5be91c['body'][_0xda02('0x51')];return db[_0xda02('0x52')][_0xda02('0x24')]({'where':{'id':_0x15ec45},'attributes':['id'],'include':[{'model':db[_0xda02('0x46')],'as':_0xda02('0x53'),'attributes':['id','name',_0xda02('0x54'),'voicePause','interface'],'raw':!![]}]})[_0xda02('0x14')](function(_0x3c91a8){if(_0x3c91a8){var _0x390836=_['flatMap'](_0x3c91a8,function(_0x555d24){var _0x321fa7=_0x555d24[_0xda02('0x15')]({'plain':!![]});return _0x321fa7[_0xda02('0x53')];});return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x5be91c[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](function(_0x331ed5){return db[_0xda02('0x55')][_0xda02('0x56')](function(_0x428d1b){return _0x331ed5['addTeams'](_0x15ec45,{'transaction':_0x428d1b})[_0xda02('0x14')](function(){return BPromise['each'](_0x390836,function(_0x4755de){return db['UserChatQueue'][_0xda02('0x57')]({'where':{'UserId':_0x4755de['id'],'ChatQueueId':_0x5be91c['params']['id']},'transaction':_0x428d1b});});})[_0xda02('0x14')](function(){_0x390836[_0xda02('0x58')](function(_0x1ab5b5){socket['emit'](_0xda02('0x59'),{'UserId':_0x1ab5b5['id'],'ChatQueueId':_0x331ed5['id']});});});});});}})['then'](respondWithStatusCode(_0x135144,null))[_0xda02('0x26')](handleError(_0x135144,null));};exports['removeTeams']=function(_0x57a443,_0x7e8e70){return db[_0xda02('0x52')][_0xda02('0x24')]({'where':{'id':_0x57a443[_0xda02('0x23')]['ids']},'attributes':['id'],'include':[{'model':db[_0xda02('0x46')],'as':_0xda02('0x53'),'attributes':['id'],'raw':!![]}]})[_0xda02('0x14')](handleEntityNotFound(_0x7e8e70,null))[_0xda02('0x14')](function(_0x5e75a2){var _0x4f887a=_[_0xda02('0x1e')](_0x5e75a2,'id');var _0x731a2e=[];var _0x3dd3ed=[];var _0x2f0661=squel[_0xda02('0x5a')]();_0x2f0661['field'](_0xda02('0x5b'))['from'](_0xda02('0x5c'),'tq')[_0xda02('0x5d')](_0xda02('0x5e'),'ut',_0xda02('0x5f'))[_0xda02('0x22')](_0xda02('0x60'),_0x57a443[_0xda02('0x3a')]['id']);for(var _0x33f177=0x0;_0x33f177<_0x5e75a2['length'];_0x33f177+=0x1){let _0x54535d=_0x5e75a2[_0x33f177];for(var _0xfe746c=0x0;_0xfe746c<_0x54535d[_0xda02('0x53')][_0xda02('0x2f')];_0xfe746c+=0x1){let _0x38f2bc=_0x54535d['Agents'][_0xfe746c];var _0x61022d=_0x2f0661[_0xda02('0x61')]();_0x61022d[_0xda02('0x22')](_0xda02('0x62'),_0x38f2bc['id']);_0x3dd3ed[_0xda02('0x63')](db[_0xda02('0x55')][_0xda02('0x23')](_0x61022d['toString'](),{'type':db[_0xda02('0x55')][_0xda02('0x64')]['SELECT']})[_0xda02('0x14')](function(_0x113249){if(_0x113249[_0xda02('0x2f')]===0x1){return _0x38f2bc['id'];}else{var _0x3adaa6=_[_0xda02('0x65')](_[_0xda02('0x1e')](_0x113249,_0xda02('0x66')),function(_0x209fb9){return _['includes'](_0x4f887a,_0x209fb9);});if(_0x3adaa6){return _0x38f2bc['id'];}}}));}}return BPromise['all'](_0x3dd3ed)[_0xda02('0x14')](function(_0x22af9d){_0x731a2e=_(_0x731a2e)['union'](_0x22af9d)['compact']()[_0xda02('0x67')]();return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x57a443[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](function(_0x216ffb){return db['sequelize']['transaction'](function(_0x433699){return _0x216ffb[_0xda02('0x68')](_0x57a443[_0xda02('0x23')]['ids'],{'transaction':_0x433699})[_0xda02('0x14')](function(){if(!_[_0xda02('0x69')](_0x731a2e)){return _0x216ffb[_0xda02('0x6a')](_0x731a2e,{'transaction':_0x433699});}})[_0xda02('0x14')](function(){_0x731a2e[_0xda02('0x58')](function(_0x37ddd7){socket[_0xda02('0x6b')](_0xda02('0x6c'),{'UserId':_0x37ddd7,'ChatQueueId':_0x216ffb['id']});});});});});});})['then'](respondWithStatusCode(_0x7e8e70,null))[_0xda02('0x26')](handleError(_0x7e8e70,null));};exports['addAgents']=function(_0x4cdedd,_0x1ac8d1){return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x4cdedd[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x1ac8d1,null))['then'](function(_0x2c5b2f){if(_0x2c5b2f){return _0x2c5b2f[_0xda02('0x6d')](_0x4cdedd[_0xda02('0x33')]['ids'],_[_0xda02('0x6e')](_0x4cdedd['body'],['ids','id'])||{})['spread'](function(_0x3e428e){for(var _0x104703=0x0;_0x104703<_0x4cdedd['body'][_0xda02('0x51')][_0xda02('0x2f')];_0x104703+=0x1){socket[_0xda02('0x6b')](_0xda02('0x59'),{'UserId':Number(_0x4cdedd[_0xda02('0x33')]['ids'][_0x104703]),'ChatQueueId':Number(_0x4cdedd[_0xda02('0x3a')]['id'])});}return _0x3e428e;});}})[_0xda02('0x14')](respondWithResult(_0x1ac8d1,null))[_0xda02('0x26')](handleError(_0x1ac8d1,null));};exports['removeAgents']=function(_0x46a107,_0x512b0e){return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x46a107[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x512b0e,null))[_0xda02('0x14')](function(_0x420b41){if(_0x420b41){return _0x420b41[_0xda02('0x6a')](_0x46a107[_0xda02('0x23')][_0xda02('0x51')])[_0xda02('0x14')](function(){if(_[_0xda02('0x6f')](_0x46a107['query'][_0xda02('0x51')])){for(var _0x30495f=0x0;_0x30495f<_0x46a107[_0xda02('0x23')][_0xda02('0x51')][_0xda02('0x2f')];_0x30495f+=0x1){socket[_0xda02('0x6b')]('userChatQueue:remove',{'UserId':Number(_0x46a107['query'][_0xda02('0x51')][_0x30495f]),'ChatQueueId':Number(_0x46a107[_0xda02('0x3a')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x46a107[_0xda02('0x23')]['ids']),'ChatQueueId':Number(_0x46a107[_0xda02('0x3a')]['id'])});}});}})[_0xda02('0x14')](respondWithStatusCode(_0x512b0e,null))['catch'](handleError(_0x512b0e,null));};exports[_0xda02('0x70')]=function(_0x3b9efb,_0x4d08b0){var _0x59fedc={};var _0x472670={};var _0x48da1b;var _0x2a8650;return db[_0xda02('0x1f')][_0xda02('0x3c')]({'where':{'id':_0x3b9efb[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x4d08b0,null))[_0xda02('0x14')](function(_0x531949){if(_0x531949){_0x48da1b=_0x531949;_0x472670[_0xda02('0x28')]=_[_0xda02('0x29')](db['User'][_0xda02('0x2a')]);_0x472670[_0xda02('0x23')]=_[_0xda02('0x29')](_0x3b9efb[_0xda02('0x23')]);_0x472670['filters']=_['intersection'](_0x472670[_0xda02('0x28')],_0x472670[_0xda02('0x23')]);_0x59fedc[_0xda02('0x2d')]=_[_0xda02('0x2c')](_0x472670[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x3b9efb[_0xda02('0x23')]['fields']));_0x59fedc[_0xda02('0x2d')]=_0x59fedc[_0xda02('0x2d')][_0xda02('0x2f')]?_0x59fedc[_0xda02('0x2d')]:_0x472670[_0xda02('0x28')];_0x59fedc[_0xda02('0x71')]=qs[_0xda02('0x3f')](_0x3b9efb[_0xda02('0x23')]['sort']);_0x59fedc[_0xda02('0x22')]=qs[_0xda02('0x2b')](_[_0xda02('0x40')](_0x3b9efb['query'],_0x472670[_0xda02('0x2b')]));if(_0x3b9efb[_0xda02('0x23')]['filter']){_0x59fedc['where']=_[_0xda02('0x43')](_0x59fedc[_0xda02('0x22')],{'$or':_[_0xda02('0x1e')](_0x59fedc['attributes'],function(_0x280276){var _0xd2c136={};_0xd2c136[_0x280276]={'$like':'%'+_0x3b9efb[_0xda02('0x23')]['filter']+'%'};return _0xd2c136;})});}_0x59fedc=_['merge']({},_0x59fedc,_0x3b9efb['options']);return _0x48da1b[_0xda02('0x70')](_0x59fedc);}})[_0xda02('0x14')](function(_0x2ed8ea){if(_0x2ed8ea){_0x2a8650=_0x2ed8ea[_0xda02('0x2f')];if(!_0x3b9efb[_0xda02('0x23')][_0xda02('0x3d')](_0xda02('0x3e'))){_0x59fedc[_0xda02('0x11')]=qs[_0xda02('0x11')](_0x3b9efb[_0xda02('0x23')][_0xda02('0x11')]);_0x59fedc[_0xda02('0xe')]=qs[_0xda02('0xe')](_0x3b9efb[_0xda02('0x23')][_0xda02('0xe')]);}return _0x48da1b[_0xda02('0x70')](_0x59fedc);}})[_0xda02('0x14')](function(_0x2f0ce4){if(_0x2f0ce4){return _0x2f0ce4?{'count':_0x2a8650,'rows':_0x2f0ce4}:null;}})['then'](respondWithResult(_0x4d08b0,null))[_0xda02('0x26')](handleError(_0x4d08b0,null));}; \ No newline at end of file +var _0x98ec=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','sort','ChatQueueId','filter','User','findAndCountAll','UserId','chatPause','updatedAt','%s/%s','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','pick','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','create'];(function(_0x6b6190,_0x3131ac){var _0x1c1982=function(_0x3535b3){while(--_0x3535b3){_0x6b6190['push'](_0x6b6190['shift']());}};_0x1c1982(++_0x3131ac);}(_0x98ec,0x145));var _0xc98e=function(_0x57e14f,_0x17f93c){_0x57e14f=_0x57e14f-0x0;var _0x39fce2=_0x98ec[_0x57e14f];return _0x39fce2;};'use strict';var BPromise=require(_0xc98e('0x0'));var util=require(_0xc98e('0x1'));var _=require(_0xc98e('0x2'));var squel=require(_0xc98e('0x3'));var Redis=require(_0xc98e('0x4'));var qs=require(_0xc98e('0x5'));var logger=require(_0xc98e('0x6'))(_0xc98e('0x7'));var config=require('../../config/environment');var db=require(_0xc98e('0x8'))['db'];config[_0xc98e('0x9')]=_[_0xc98e('0xa')](config['redis'],{'host':_0xc98e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc98e('0x9')]));require(_0xc98e('0xc'))['register'](socket);function respondWithStatusCode(_0x294242,_0x250d84){_0x250d84=_0x250d84||0xcc;return function(_0x156c85){if(_0x156c85){return _0x294242[_0xc98e('0xd')](_0x250d84);}return _0x294242['status'](_0x250d84)[_0xc98e('0xe')]();};}function respondWithResult(_0x242fef,_0x3c2ac1){_0x3c2ac1=_0x3c2ac1||0xc8;return function(_0x2ac12e){if(_0x2ac12e){return _0x242fef['status'](_0x3c2ac1)[_0xc98e('0xf')](_0x2ac12e);}};}function respondWithFilteredResult(_0x3e5f96,_0x55be17){return function(_0x23bc17){if(_0x23bc17){var _0x3a9518=typeof _0x55be17[_0xc98e('0x10')]===_0xc98e('0x11')&&typeof _0x55be17[_0xc98e('0x12')]===_0xc98e('0x11');var _0x3fd228=_0x23bc17[_0xc98e('0x13')];var _0x5ecbf2=_0x3a9518?0x0:_0x55be17[_0xc98e('0x10')];var _0x1915c1=_0x3a9518?_0x23bc17[_0xc98e('0x13')]:_0x55be17[_0xc98e('0x10')]+_0x55be17[_0xc98e('0x12')];var _0x50a8f6;if(_0x1915c1>=_0x3fd228){_0x1915c1=_0x3fd228;_0x50a8f6=0xc8;}else{_0x50a8f6=0xce;}_0x3e5f96[_0xc98e('0x14')](_0x50a8f6);return _0x3e5f96['set'](_0xc98e('0x15'),_0x5ecbf2+'-'+_0x1915c1+'/'+_0x3fd228)['json'](_0x23bc17);}return null;};}function saveUpdates(_0x431ed1){return function(_0x3bd548){if(_0x3bd548){return _0x3bd548[_0xc98e('0x16')](_0x431ed1)[_0xc98e('0x17')](function(_0x5653d5){return _0x5653d5;});}return null;};}function removeEntity(_0x46a940){return function(_0x252ef9){if(_0x252ef9){return _0x252ef9[_0xc98e('0x18')]()['then'](function(){var _0x16781b=_0x252ef9[_0xc98e('0x19')]({'plain':!![]});var _0x78513d=_0xc98e('0x1a');return db[_0xc98e('0x1b')][_0xc98e('0x18')]({'where':{'type':_0x78513d,'resourceId':_0x16781b['id']}})[_0xc98e('0x17')](function(){return _0x252ef9;});})[_0xc98e('0x17')](function(){_0x46a940[_0xc98e('0x14')](0xcc)[_0xc98e('0xe')]();});}};}function handleEntityNotFound(_0xd3a04){return function(_0x2c4f1f){if(!_0x2c4f1f){_0xd3a04[_0xc98e('0xd')](0x194);}return _0x2c4f1f;};}function handleError(_0x5dd65d,_0x49b3f7){_0x49b3f7=_0x49b3f7||0x1f4;return function(_0x1ed13b){logger[_0xc98e('0x1c')](_0x1ed13b[_0xc98e('0x1d')]);if(_0x1ed13b['name']){delete _0x1ed13b[_0xc98e('0x1e')];}_0x5dd65d['status'](_0x49b3f7)[_0xc98e('0x1f')](_0x1ed13b);};}exports[_0xc98e('0x20')]=function(_0x523168,_0x508a1f){var _0x4d977e={};var _0x2cb23a={'count':0x0,'rows':[]};var _0x417636=_[_0xc98e('0x21')](db[_0xc98e('0x22')][_0xc98e('0x23')],function(_0x38e53e){return{'name':_0x38e53e[_0xc98e('0x24')],'type':_0x38e53e[_0xc98e('0x25')][_0xc98e('0x26')]};});_0x4d977e=qs[_0xc98e('0x27')](_0x417636,_0x523168);var _0xee3a0b={'where':_0x4d977e[_0xc98e('0x28')]};return db[_0xc98e('0x22')]['count'](_0xee3a0b)[_0xc98e('0x17')](function(_0x50895b){_0x2cb23a[_0xc98e('0x13')]=_0x50895b;_0x4d977e[_0xc98e('0x29')]=qs[_0xc98e('0x29')](_0x523168[_0xc98e('0x2a')]);return db[_0xc98e('0x22')][_0xc98e('0x2b')](_0x4d977e);})[_0xc98e('0x17')](function(_0x494609){_0x2cb23a[_0xc98e('0x2c')]=_0x494609;return _0x2cb23a;})[_0xc98e('0x17')](respondWithFilteredResult(_0x508a1f,_0x4d977e))['catch'](handleError(_0x508a1f,null));};exports[_0xc98e('0x2d')]=function(_0x3288ab,_0x32e585){var _0x5f5187={'raw':!![],'where':{'id':_0x3288ab[_0xc98e('0x2e')]['id']}},_0x504d1a={};_0x504d1a[_0xc98e('0x2f')]=_['keys'](db[_0xc98e('0x22')]['rawAttributes']);_0x504d1a[_0xc98e('0x2a')]=_[_0xc98e('0x30')](_0x3288ab[_0xc98e('0x2a')]);_0x504d1a[_0xc98e('0x31')]=_[_0xc98e('0x32')](_0x504d1a[_0xc98e('0x2f')],_0x504d1a[_0xc98e('0x2a')]);_0x5f5187[_0xc98e('0x33')]=_[_0xc98e('0x32')](_0x504d1a[_0xc98e('0x2f')],qs['fields'](_0x3288ab['query'][_0xc98e('0x34')]));_0x5f5187['attributes']=_0x5f5187[_0xc98e('0x33')][_0xc98e('0x35')]?_0x5f5187[_0xc98e('0x33')]:_0x504d1a[_0xc98e('0x2f')];if(_0x3288ab[_0xc98e('0x2a')][_0xc98e('0x36')]){_0x5f5187[_0xc98e('0x29')]=[{'all':!![]}];}_0x5f5187=_[_0xc98e('0x37')]({},_0x5f5187,_0x3288ab[_0xc98e('0x38')]);return db[_0xc98e('0x22')]['find'](_0x5f5187)[_0xc98e('0x17')](handleEntityNotFound(_0x32e585,null))['then'](respondWithResult(_0x32e585,null))[_0xc98e('0x39')](handleError(_0x32e585,null));};exports[_0xc98e('0x3a')]=function(_0x37f685,_0x302453){return db[_0xc98e('0x22')][_0xc98e('0x3a')](_0x37f685[_0xc98e('0x3b')],{})[_0xc98e('0x17')](function(_0x572643){var _0x2857d9=_0x37f685[_0xc98e('0x3c')]['get']({'plain':!![]});if(!_0x2857d9)throw new Error(_0xc98e('0x3d'));if(_0x2857d9[_0xc98e('0x3e')]===_0xc98e('0x3c')){var _0x2e953b=_0x572643[_0xc98e('0x19')]({'plain':!![]});var _0x3df0af='ChatQueues';return db[_0xc98e('0x3f')][_0xc98e('0x40')]({'where':{'name':_0x3df0af,'userProfileId':_0x2857d9[_0xc98e('0x41')]},'raw':!![]})['then'](function(_0x43347e){if(_0x43347e&&_0x43347e[_0xc98e('0x42')]===0x0){return db[_0xc98e('0x1b')][_0xc98e('0x3a')]({'name':_0x2e953b[_0xc98e('0x1e')],'resourceId':_0x2e953b['id'],'type':_0x43347e[_0xc98e('0x1e')],'sectionId':_0x43347e['id']},{})[_0xc98e('0x17')](function(){return _0x572643;});}else{return _0x572643;}})['catch'](function(_0x2cabfe){logger[_0xc98e('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cabfe);throw _0x2cabfe;});}return _0x572643;})[_0xc98e('0x17')](respondWithResult(_0x302453,0xc9))[_0xc98e('0x39')](handleError(_0x302453,null));};exports[_0xc98e('0x16')]=function(_0x59c78b,_0x5f59f8){if(_0x59c78b[_0xc98e('0x3b')]['id']){delete _0x59c78b[_0xc98e('0x3b')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x59c78b[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x5f59f8,null))['then'](saveUpdates(_0x59c78b['body'],null))['then'](respondWithResult(_0x5f59f8,null))[_0xc98e('0x39')](handleError(_0x5f59f8,null));};exports[_0xc98e('0x18')]=function(_0x79b489,_0x2a7a90){return db[_0xc98e('0x22')][_0xc98e('0x40')]({'where':{'id':_0x79b489['params']['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x2a7a90,null))[_0xc98e('0x17')](removeEntity(_0x2a7a90,null))[_0xc98e('0x39')](handleError(_0x2a7a90,null));};exports[_0xc98e('0x43')]=function(_0xa57843,_0x1b8e5e){return db[_0xc98e('0x22')][_0xc98e('0x43')]()[_0xc98e('0x17')](respondWithResult(_0x1b8e5e,null))[_0xc98e('0x39')](handleError(_0x1b8e5e,null));};exports[_0xc98e('0x44')]=function(_0x54b6fd,_0x25aae7){var _0x4a496c={'raw':!![],'where':{}},_0x1043f1={},_0x10e370;return db[_0xc98e('0x22')][_0xc98e('0x45')]({'where':{'id':_0x54b6fd[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x25aae7,null))['then'](function(_0x72d614){if(_0x72d614){_0x10e370=_0x72d614[_0xc98e('0x19')]({'plain':!![]});_0x1043f1[_0xc98e('0x2f')]=_[_0xc98e('0x30')](db[_0xc98e('0x46')][_0xc98e('0x23')]);_0x1043f1['query']=_[_0xc98e('0x30')](_0x54b6fd['query']);_0x1043f1[_0xc98e('0x31')]=_[_0xc98e('0x32')](_0x1043f1[_0xc98e('0x2f')],_0x1043f1[_0xc98e('0x2a')]);_0x4a496c['attributes']=_['intersection'](_0x1043f1[_0xc98e('0x2f')],qs['fields'](_0x54b6fd['query']['fields']));_0x4a496c[_0xc98e('0x33')]=_0x4a496c[_0xc98e('0x33')][_0xc98e('0x35')]?_0x4a496c[_0xc98e('0x33')]:_0x1043f1[_0xc98e('0x2f')];if(!_0x54b6fd['query'][_0xc98e('0x47')](_0xc98e('0x48'))){_0x4a496c[_0xc98e('0x12')]=qs[_0xc98e('0x12')](_0x54b6fd[_0xc98e('0x2a')][_0xc98e('0x12')]);_0x4a496c[_0xc98e('0x10')]=qs[_0xc98e('0x10')](_0x54b6fd[_0xc98e('0x2a')][_0xc98e('0x10')]);}_0x4a496c[_0xc98e('0x49')]=qs[_0xc98e('0x4a')](_0x54b6fd[_0xc98e('0x2a')]['sort']);_0x4a496c['where']=qs[_0xc98e('0x31')](_['pick'](_0x54b6fd[_0xc98e('0x2a')],_0x1043f1[_0xc98e('0x31')]));_0x4a496c[_0xc98e('0x28')][_0xc98e('0x4b')]=_0x72d614['id'];if(_0x54b6fd[_0xc98e('0x2a')][_0xc98e('0x4c')]){_0x4a496c['where']=_[_0xc98e('0x37')](_0x4a496c['where'],{'$or':_[_0xc98e('0x21')](_0x4a496c[_0xc98e('0x33')],function(_0x4f4bb3){var _0x514204={};_0x514204[_0x4f4bb3]={'$like':'%'+_0x54b6fd['query'][_0xc98e('0x4c')]+'%'};return _0x514204;})});}_0x4a496c=_[_0xc98e('0x37')]({},_0x4a496c,_0x54b6fd[_0xc98e('0x38')]);return db[_0xc98e('0x46')][_0xc98e('0x2b')](_0x4a496c);}})['then'](function(_0x20fe9a){if(_0x20fe9a){return db[_0xc98e('0x4d')][_0xc98e('0x4e')]({'where':{'id':_['map'](_0x20fe9a,_0xc98e('0x4f')),'role':'agent'},'attributes':['id',_0xc98e('0x1e'),_0xc98e('0x50'),_0xc98e('0x51'),'createdAt']});}})[_0xc98e('0x17')](function(_0x388b1e){if(_0x388b1e){return{'count':_0x388b1e[_0xc98e('0x13')],'rows':_[_0xc98e('0x21')](_0x388b1e[_0xc98e('0x2c')],function(_0x433790){return{'membername':_0x433790[_0xc98e('0x1e')],'UserId':_0x433790['id'],'queue_name':_0x10e370[_0xc98e('0x1e')],'ChatQueueId':_0x10e370['id'],'interface':util['format'](_0xc98e('0x52'),'SIP',_0x433790[_0xc98e('0x1e')]),'penalty':0x0,'paused':_0x433790['chatPause'],'createdAt':_0x433790[_0xc98e('0x53')],'updatedAt':_0x433790[_0xc98e('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x25aae7,_0x4a496c))[_0xc98e('0x39')](handleError(_0x25aae7,null));};exports[_0xc98e('0x54')]=function(_0xdfe919,_0xa90964){var _0x130b80={};var _0x275ebd={};var _0x3634eb;var _0x1270d3;return db[_0xc98e('0x22')][_0xc98e('0x45')]({'where':{'id':_0xdfe919[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0xa90964,null))[_0xc98e('0x17')](function(_0x196b0d){if(_0x196b0d){_0x3634eb=_0x196b0d;_0x275ebd['model']=_[_0xc98e('0x30')](db[_0xc98e('0x55')][_0xc98e('0x23')]);_0x275ebd['query']=_[_0xc98e('0x30')](_0xdfe919[_0xc98e('0x2a')]);_0x275ebd[_0xc98e('0x31')]=_[_0xc98e('0x32')](_0x275ebd[_0xc98e('0x2f')],_0x275ebd[_0xc98e('0x2a')]);_0x130b80[_0xc98e('0x33')]=_['intersection'](_0x275ebd['model'],qs[_0xc98e('0x34')](_0xdfe919['query']['fields']));_0x130b80['attributes']=_0x130b80['attributes']['length']?_0x130b80[_0xc98e('0x33')]:_0x275ebd[_0xc98e('0x2f')];_0x130b80[_0xc98e('0x49')]=qs[_0xc98e('0x4a')](_0xdfe919[_0xc98e('0x2a')][_0xc98e('0x4a')]);_0x130b80[_0xc98e('0x28')]=qs[_0xc98e('0x31')](_['pick'](_0xdfe919[_0xc98e('0x2a')],_0x275ebd[_0xc98e('0x31')]));if(_0xdfe919[_0xc98e('0x2a')][_0xc98e('0x4c')]){_0x130b80['where']=_[_0xc98e('0x37')](_0x130b80[_0xc98e('0x28')],{'$or':_[_0xc98e('0x21')](_0x130b80['attributes'],function(_0x3ad195){var _0x588d73={};_0x588d73[_0x3ad195]={'$like':'%'+_0xdfe919[_0xc98e('0x2a')]['filter']+'%'};return _0x588d73;})});}_0x130b80=_[_0xc98e('0x37')]({},_0x130b80,_0xdfe919[_0xc98e('0x38')]);return _0x3634eb['getTeams'](_0x130b80);}})[_0xc98e('0x17')](function(_0xf1fad7){if(_0xf1fad7){_0x1270d3=_0xf1fad7[_0xc98e('0x35')];if(!_0xdfe919[_0xc98e('0x2a')]['hasOwnProperty'](_0xc98e('0x48'))){_0x130b80['limit']=qs[_0xc98e('0x12')](_0xdfe919[_0xc98e('0x2a')]['limit']);_0x130b80['offset']=qs['offset'](_0xdfe919[_0xc98e('0x2a')][_0xc98e('0x10')]);}return _0x3634eb[_0xc98e('0x54')](_0x130b80);}})['then'](function(_0x46c88d){if(_0x46c88d){return _0x46c88d?{'count':_0x1270d3,'rows':_0x46c88d}:null;}})['then'](respondWithResult(_0xa90964,null))[_0xc98e('0x39')](handleError(_0xa90964,null));};exports[_0xc98e('0x56')]=function(_0x32bc4,_0x4e4789){var _0x57d29f=_0x32bc4[_0xc98e('0x3b')][_0xc98e('0x57')];return db[_0xc98e('0x55')][_0xc98e('0x2b')]({'where':{'id':_0x57d29f},'attributes':['id'],'include':[{'model':db[_0xc98e('0x4d')],'as':_0xc98e('0x58'),'attributes':['id',_0xc98e('0x1e'),_0xc98e('0x59'),_0xc98e('0x5a'),_0xc98e('0x5b')],'raw':!![]}]})[_0xc98e('0x17')](function(_0x41a905){if(_0x41a905){var _0x8a6eb=_[_0xc98e('0x5c')](_0x41a905,function(_0x5c24bd){var _0x5cad24=_0x5c24bd[_0xc98e('0x19')]({'plain':!![]});return _0x5cad24[_0xc98e('0x58')];});return db['ChatQueue'][_0xc98e('0x40')]({'where':{'id':_0x32bc4[_0xc98e('0x2e')]['id']}})['then'](function(_0x170867){return db[_0xc98e('0x5d')][_0xc98e('0x5e')](function(_0x1cc1f9){return _0x170867['addTeams'](_0x57d29f,{'transaction':_0x1cc1f9})[_0xc98e('0x17')](function(){return BPromise[_0xc98e('0x5f')](_0x8a6eb,function(_0x555e2b){return db[_0xc98e('0x46')]['findOrCreate']({'where':{'UserId':_0x555e2b['id'],'ChatQueueId':_0x32bc4[_0xc98e('0x2e')]['id']},'transaction':_0x1cc1f9});});})[_0xc98e('0x17')](function(){_0x8a6eb[_0xc98e('0x60')](function(_0x6c4efd){socket[_0xc98e('0x61')](_0xc98e('0x62'),{'UserId':_0x6c4efd['id'],'ChatQueueId':_0x170867['id']});});});});});}})[_0xc98e('0x17')](respondWithStatusCode(_0x4e4789,null))[_0xc98e('0x39')](handleError(_0x4e4789,null));};exports[_0xc98e('0x63')]=function(_0x1b980c,_0x2c0ae5){return db[_0xc98e('0x55')]['findAll']({'where':{'id':_0x1b980c[_0xc98e('0x2a')][_0xc98e('0x57')]},'attributes':['id'],'include':[{'model':db[_0xc98e('0x4d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc98e('0x17')](handleEntityNotFound(_0x2c0ae5,null))[_0xc98e('0x17')](function(_0xa8a0ab){var _0x3f8a77=_['map'](_0xa8a0ab,'id');var _0xb56fac=[];var _0x252b2e=[];var _0x595ff2=squel[_0xc98e('0x64')]();_0x595ff2[_0xc98e('0x65')](_0xc98e('0x66'))[_0xc98e('0x67')](_0xc98e('0x68'),'tq')[_0xc98e('0x69')]('user_has_teams','ut',_0xc98e('0x6a'))[_0xc98e('0x28')](_0xc98e('0x6b'),_0x1b980c[_0xc98e('0x2e')]['id']);for(var _0x2b8835=0x0;_0x2b8835<_0xa8a0ab[_0xc98e('0x35')];_0x2b8835+=0x1){let _0x47c734=_0xa8a0ab[_0x2b8835];for(var _0x32a362=0x0;_0x32a362<_0x47c734[_0xc98e('0x58')]['length'];_0x32a362+=0x1){let _0x306a27=_0x47c734[_0xc98e('0x58')][_0x32a362];var _0x571d75=_0x595ff2[_0xc98e('0x6c')]();_0x571d75[_0xc98e('0x28')]('ut.UserId\x20=\x20?',_0x306a27['id']);_0x252b2e[_0xc98e('0x6d')](db[_0xc98e('0x5d')][_0xc98e('0x2a')](_0x571d75[_0xc98e('0x6e')](),{'type':db['sequelize'][_0xc98e('0x6f')][_0xc98e('0x70')]})[_0xc98e('0x17')](function(_0x2fe92c){if(_0x2fe92c[_0xc98e('0x35')]===0x1){return _0x306a27['id'];}else{var _0x53cf6a=_[_0xc98e('0x71')](_[_0xc98e('0x21')](_0x2fe92c,_0xc98e('0x72')),function(_0x17fa44){return _[_0xc98e('0x73')](_0x3f8a77,_0x17fa44);});if(_0x53cf6a){return _0x306a27['id'];}}}));}}return BPromise[_0xc98e('0x74')](_0x252b2e)['then'](function(_0x28f7a6){_0xb56fac=_(_0xb56fac)[_0xc98e('0x75')](_0x28f7a6)['compact']()[_0xc98e('0x76')]();return db[_0xc98e('0x22')]['find']({'where':{'id':_0x1b980c['params']['id']}})[_0xc98e('0x17')](function(_0x314a94){return db[_0xc98e('0x5d')][_0xc98e('0x5e')](function(_0x5e05f6){return _0x314a94['removeTeams'](_0x1b980c[_0xc98e('0x2a')][_0xc98e('0x57')],{'transaction':_0x5e05f6})[_0xc98e('0x17')](function(){if(!_[_0xc98e('0x77')](_0xb56fac)){return _0x314a94[_0xc98e('0x78')](_0xb56fac,{'transaction':_0x5e05f6});}})[_0xc98e('0x17')](function(){_0xb56fac['forEach'](function(_0x42809f){socket[_0xc98e('0x61')](_0xc98e('0x79'),{'UserId':_0x42809f,'ChatQueueId':_0x314a94['id']});});});});});});})[_0xc98e('0x17')](respondWithStatusCode(_0x2c0ae5,null))[_0xc98e('0x39')](handleError(_0x2c0ae5,null));};exports[_0xc98e('0x7a')]=function(_0x1be9a9,_0x317c2b){return db[_0xc98e('0x22')][_0xc98e('0x40')]({'where':{'id':_0x1be9a9[_0xc98e('0x2e')]['id']}})['then'](handleEntityNotFound(_0x317c2b,null))[_0xc98e('0x17')](function(_0x2a93ee){if(_0x2a93ee){return _0x2a93ee[_0xc98e('0x7a')](_0x1be9a9['body'][_0xc98e('0x57')],_[_0xc98e('0x7b')](_0x1be9a9[_0xc98e('0x3b')],['ids','id'])||{})[_0xc98e('0x7c')](function(_0x468e3f){for(var _0x525c64=0x0;_0x525c64<_0x1be9a9['body'][_0xc98e('0x57')]['length'];_0x525c64+=0x1){socket[_0xc98e('0x61')]('userChatQueue:save',{'UserId':Number(_0x1be9a9[_0xc98e('0x3b')][_0xc98e('0x57')][_0x525c64]),'ChatQueueId':Number(_0x1be9a9[_0xc98e('0x2e')]['id'])});}return _0x468e3f;});}})[_0xc98e('0x17')](respondWithResult(_0x317c2b,null))[_0xc98e('0x39')](handleError(_0x317c2b,null));};exports[_0xc98e('0x78')]=function(_0x3ab47e,_0x452948){return db[_0xc98e('0x22')][_0xc98e('0x40')]({'where':{'id':_0x3ab47e[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x452948,null))[_0xc98e('0x17')](function(_0x1987bc){if(_0x1987bc){return _0x1987bc[_0xc98e('0x78')](_0x3ab47e[_0xc98e('0x2a')][_0xc98e('0x57')])[_0xc98e('0x17')](function(){if(_[_0xc98e('0x7d')](_0x3ab47e['query'][_0xc98e('0x57')])){for(var _0x5c0b3d=0x0;_0x5c0b3d<_0x3ab47e['query'][_0xc98e('0x57')][_0xc98e('0x35')];_0x5c0b3d+=0x1){socket[_0xc98e('0x61')]('userChatQueue:remove',{'UserId':Number(_0x3ab47e[_0xc98e('0x2a')][_0xc98e('0x57')][_0x5c0b3d]),'ChatQueueId':Number(_0x3ab47e[_0xc98e('0x2e')]['id'])});}}else{socket[_0xc98e('0x61')](_0xc98e('0x79'),{'UserId':Number(_0x3ab47e[_0xc98e('0x2a')]['ids']),'ChatQueueId':Number(_0x3ab47e[_0xc98e('0x2e')]['id'])});}});}})[_0xc98e('0x17')](respondWithStatusCode(_0x452948,null))[_0xc98e('0x39')](handleError(_0x452948,null));};exports[_0xc98e('0x7e')]=function(_0x5df54e,_0x1d7d93){var _0x5032af={};var _0x2484ce={};var _0x4fde54;var _0xa52fbe;return db[_0xc98e('0x22')][_0xc98e('0x45')]({'where':{'id':_0x5df54e[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x1d7d93,null))[_0xc98e('0x17')](function(_0x612f1d){if(_0x612f1d){_0x4fde54=_0x612f1d;_0x2484ce[_0xc98e('0x2f')]=_['keys'](db[_0xc98e('0x4d')][_0xc98e('0x23')]);_0x2484ce['query']=_[_0xc98e('0x30')](_0x5df54e[_0xc98e('0x2a')]);_0x2484ce[_0xc98e('0x31')]=_['intersection'](_0x2484ce[_0xc98e('0x2f')],_0x2484ce[_0xc98e('0x2a')]);_0x5032af['attributes']=_[_0xc98e('0x32')](_0x2484ce[_0xc98e('0x2f')],qs[_0xc98e('0x34')](_0x5df54e['query'][_0xc98e('0x34')]));_0x5032af[_0xc98e('0x33')]=_0x5032af[_0xc98e('0x33')]['length']?_0x5032af[_0xc98e('0x33')]:_0x2484ce[_0xc98e('0x2f')];_0x5032af[_0xc98e('0x49')]=qs[_0xc98e('0x4a')](_0x5df54e[_0xc98e('0x2a')][_0xc98e('0x4a')]);_0x5032af[_0xc98e('0x28')]=qs['filters'](_[_0xc98e('0x7f')](_0x5df54e[_0xc98e('0x2a')],_0x2484ce[_0xc98e('0x31')]));if(_0x5df54e['query'][_0xc98e('0x4c')]){_0x5032af['where']=_['merge'](_0x5032af[_0xc98e('0x28')],{'$or':_['map'](_0x5032af[_0xc98e('0x33')],function(_0x24de70){var _0x2197db={};_0x2197db[_0x24de70]={'$like':'%'+_0x5df54e['query']['filter']+'%'};return _0x2197db;})});}_0x5032af=_[_0xc98e('0x37')]({},_0x5032af,_0x5df54e[_0xc98e('0x38')]);return _0x4fde54['getAgents'](_0x5032af);}})[_0xc98e('0x17')](function(_0x43af75){if(_0x43af75){_0xa52fbe=_0x43af75[_0xc98e('0x35')];if(!_0x5df54e['query'][_0xc98e('0x47')](_0xc98e('0x48'))){_0x5032af['limit']=qs[_0xc98e('0x12')](_0x5df54e[_0xc98e('0x2a')]['limit']);_0x5032af[_0xc98e('0x10')]=qs[_0xc98e('0x10')](_0x5df54e[_0xc98e('0x2a')]['offset']);}return _0x4fde54['getAgents'](_0x5032af);}})[_0xc98e('0x17')](function(_0x17db52){if(_0x17db52){return _0x17db52?{'count':_0xa52fbe,'rows':_0x17db52}:null;}})[_0xc98e('0x17')](respondWithResult(_0x1d7d93,null))[_0xc98e('0x39')](handleError(_0x1d7d93,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index dcac9d3..df51624 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 _0x8bad=['hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit'];(function(_0x4e66b2,_0x1d0c56){var _0x265d82=function(_0x17cdcb){while(--_0x17cdcb){_0x4e66b2['push'](_0x4e66b2['shift']());}};_0x265d82(++_0x1d0c56);}(_0x8bad,0x124));var _0xd8ba=function(_0x53400c,_0x25337d){_0x53400c=_0x53400c-0x0;var _0x259fe5=_0x8bad[_0x53400c];return _0x259fe5;};'use strict';var EventEmitter=require(_0xd8ba('0x0'));var ChatQueue=require(_0xd8ba('0x1'))['db'][_0xd8ba('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd8ba('0x3')](0x0);var events={'afterCreate':_0xd8ba('0x4'),'afterUpdate':_0xd8ba('0x5'),'afterDestroy':_0xd8ba('0x6')};function emitEvent(_0x385e50){return function(_0x42969b,_0x55d8d5,_0x224bb6){ChatQueueEvents[_0xd8ba('0x7')](_0x385e50+':'+_0x42969b['id'],_0x42969b);ChatQueueEvents[_0xd8ba('0x7')](_0x385e50,_0x42969b);_0x224bb6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xd8ba('0x8')](e,emitEvent(event));}}module[_0xd8ba('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0x7e8e=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x3356f0,_0x230069){var _0x33de59=function(_0x19b8da){while(--_0x19b8da){_0x3356f0['push'](_0x3356f0['shift']());}};_0x33de59(++_0x230069);}(_0x7e8e,0x91));var _0xe7e8=function(_0x3849ff,_0x4ae25e){_0x3849ff=_0x3849ff-0x0;var _0x3ab676=_0x7e8e[_0x3849ff];return _0x3ab676;};'use strict';var EventEmitter=require(_0xe7e8('0x0'));var ChatQueue=require(_0xe7e8('0x1'))['db'][_0xe7e8('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe7e8('0x3')](0x0);var events={'afterCreate':_0xe7e8('0x4'),'afterUpdate':_0xe7e8('0x5'),'afterDestroy':_0xe7e8('0x6')};function emitEvent(_0xd0a13b){return function(_0x3c3670,_0x143dc7,_0x533317){ChatQueueEvents['emit'](_0xd0a13b+':'+_0x3c3670['id'],_0x3c3670);ChatQueueEvents[_0xe7e8('0x7')](_0xd0a13b,_0x3c3670);_0x533317(null);};}for(var e in events){if(events[_0xe7e8('0x8')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xe7e8('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 6889fc2..aa7cf3e 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 _0x1f86=['moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x8ffa8e,_0x56f5c6){var _0x9d972a=function(_0x2cdced){while(--_0x2cdced){_0x8ffa8e['push'](_0x8ffa8e['shift']());}};_0x9d972a(++_0x56f5c6);}(_0x1f86,0xbc));var _0x61f8=function(_0x19cfe5,_0x4d1bcf){_0x19cfe5=_0x19cfe5-0x0;var _0x15b837=_0x1f86[_0x19cfe5];return _0x15b837;};'use strict';var _=require(_0x61f8('0x0'));var util=require(_0x61f8('0x1'));var logger=require(_0x61f8('0x2'))(_0x61f8('0x3'));var moment=require(_0x61f8('0x4'));var BPromise=require(_0x61f8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61f8('0x6'));var rimraf=require(_0x61f8('0x7'));var config=require(_0x61f8('0x8'));var attributes=require(_0x61f8('0x9'));module[_0x61f8('0xa')]=function(_0x36e52f,_0x2df5b2){return _0x36e52f[_0x61f8('0xb')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x724c=['rimraf','./chatQueue.attributes','define','ChatQueue','util','moment','bluebird','request-promise','path'];(function(_0xf1a50a,_0xf21556){var _0x19c1d3=function(_0x163be7){while(--_0x163be7){_0xf1a50a['push'](_0xf1a50a['shift']());}};_0x19c1d3(++_0xf21556);}(_0x724c,0xd3));var _0xc724=function(_0x4e1d60,_0x4e93ef){_0x4e1d60=_0x4e1d60-0x0;var _0x39cd7a=_0x724c[_0x4e1d60];return _0x39cd7a;};'use strict';var _=require('lodash');var util=require(_0xc724('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc724('0x1'));var BPromise=require(_0xc724('0x2'));var rp=require(_0xc724('0x3'));var fs=require('fs');var path=require(_0xc724('0x4'));var rimraf=require(_0xc724('0x5'));var config=require('../../config/environment');var attributes=require(_0xc724('0x6'));module['exports']=function(_0x5a70fe,_0x214ff2){return _0x5a70fe[_0xc724('0x7')](_0xc724('0x8'),attributes,{'tableName':'chat_queues','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 795e1fb..a965163 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 _0x7035=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetChatQueue','catch','ShowChatQueue','lodash'];(function(_0x5f4ab1,_0x1cbb88){var _0x5e553d=function(_0x35ff48){while(--_0x35ff48){_0x5f4ab1['push'](_0x5f4ab1['shift']());}};_0x5e553d(++_0x1cbb88);}(_0x7035,0x15e));var _0x5703=function(_0x3aa92c,_0x3a10a0){_0x3aa92c=_0x3aa92c-0x0;var _0x2b1300=_0x7035[_0x3aa92c];return _0x2b1300;};'use strict';var _=require(_0x5703('0x0'));var util=require('util');var moment=require(_0x5703('0x1'));var BPromise=require(_0x5703('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5703('0x3'));var db=require(_0x5703('0x4'))['db'];var utils=require(_0x5703('0x5'));var logger=require(_0x5703('0x6'))(_0x5703('0x7'));var config=require('../../config/environment');var jayson=require(_0x5703('0x8'));var client=jayson[_0x5703('0x9')]['http']({'port':0x232a});config[_0x5703('0xa')]=_[_0x5703('0xb')](config[_0x5703('0xa')],{'host':_0x5703('0xc'),'port':0x18eb});var socket=require(_0x5703('0xd'))(new Redis(config[_0x5703('0xa')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x169e83,_0x5775d8,_0x4f1db7){return new BPromise(function(_0x5c36a5,_0x522449){return client[_0x5703('0xe')](_0x169e83,_0x4f1db7)[_0x5703('0xf')](function(_0xfcbc9e){logger['info'](_0x5703('0x10'),_0x5775d8,'request\x20sent');logger[_0x5703('0x11')](_0x5703('0x12'),_0x5775d8,_0x5703('0x13'),JSON[_0x5703('0x14')](_0xfcbc9e));if(_0xfcbc9e[_0x5703('0x15')]){if(_0xfcbc9e[_0x5703('0x15')][_0x5703('0x16')]===0x1f4){logger[_0x5703('0x15')](_0x5703('0x10'),_0x5775d8,_0xfcbc9e[_0x5703('0x15')][_0x5703('0x17')]);return _0x522449(_0xfcbc9e['error'][_0x5703('0x17')]);}logger[_0x5703('0x15')](_0x5703('0x10'),_0x5775d8,_0xfcbc9e[_0x5703('0x15')][_0x5703('0x17')]);return _0x5c36a5(_0xfcbc9e[_0x5703('0x15')][_0x5703('0x17')]);}else{logger[_0x5703('0x18')](_0x5703('0x10'),_0x5775d8,'request\x20sent');_0x5c36a5(_0xfcbc9e[_0x5703('0x19')][_0x5703('0x17')]);}})['catch'](function(_0x579097){logger[_0x5703('0x15')](_0x5703('0x10'),_0x5775d8,_0x579097);_0x522449(_0x579097);});});}exports['GetChatQueue']=function(_0x240cb8){var _0x59e065=this;return new Promise(function(_0x43cdbf,_0x33d30a){return db[_0x5703('0x1a')][_0x5703('0x1b')]({'raw':_0x240cb8[_0x5703('0x1c')]?_0x240cb8[_0x5703('0x1c')][_0x5703('0x1d')]===undefined?!![]:![]:!![],'where':_0x240cb8['options']?_0x240cb8['options'][_0x5703('0x1e')]||null:null,'attributes':_0x240cb8[_0x5703('0x1c')]?_0x240cb8['options'][_0x5703('0x1f')]||null:null,'limit':_0x240cb8[_0x5703('0x1c')]?_0x240cb8['options'][_0x5703('0x20')]||null:null,'include':_0x240cb8[_0x5703('0x1c')]?_0x240cb8[_0x5703('0x1c')]['include']?_['map'](_0x240cb8['options'][_0x5703('0x21')],function(_0x495db2){return{'model':db[_0x495db2[_0x5703('0x22')]],'as':_0x495db2['as'],'attributes':_0x495db2[_0x5703('0x1f')],'include':_0x495db2[_0x5703('0x21')]?_[_0x5703('0x23')](_0x495db2[_0x5703('0x21')],function(_0x57964d){return{'model':db[_0x57964d[_0x5703('0x22')]],'as':_0x57964d['as'],'attributes':_0x57964d['attributes'],'include':_0x57964d[_0x5703('0x21')]?_[_0x5703('0x23')](_0x57964d[_0x5703('0x21')],function(_0x4b23ed){return{'model':db[_0x4b23ed[_0x5703('0x22')]],'as':_0x4b23ed['as'],'attributes':_0x4b23ed[_0x5703('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bd1f7){logger[_0x5703('0x18')](_0x5703('0x24'),_0x240cb8);logger[_0x5703('0x11')]('GetChatQueue',_0x240cb8,JSON['stringify'](_0x3bd1f7));_0x43cdbf(_0x3bd1f7);})[_0x5703('0x25')](function(_0x28a460){logger[_0x5703('0x15')](_0x5703('0x24'),_0x28a460[_0x5703('0x17')],_0x240cb8);_0x33d30a(_0x59e065[_0x5703('0x15')](0x1f4,_0x28a460[_0x5703('0x17')]));});});};exports[_0x5703('0x26')]=function(_0x3508e8){var _0x2fb0c0=this;return new Promise(function(_0x2af3c3,_0x3fadcc){return db[_0x5703('0x1a')]['find']({'raw':_0x3508e8['options']?_0x3508e8['options'][_0x5703('0x1d')]===undefined?!![]:![]:!![],'where':_0x3508e8[_0x5703('0x1c')]?_0x3508e8[_0x5703('0x1c')][_0x5703('0x1e')]||null:null,'attributes':_0x3508e8[_0x5703('0x1c')]?_0x3508e8['options'][_0x5703('0x1f')]||null:null,'include':_0x3508e8[_0x5703('0x1c')]?_0x3508e8[_0x5703('0x1c')]['include']?_[_0x5703('0x23')](_0x3508e8[_0x5703('0x1c')][_0x5703('0x21')],function(_0x2eab10){return{'model':db[_0x2eab10['model']],'as':_0x2eab10['as'],'attributes':_0x2eab10[_0x5703('0x1f')],'include':_0x2eab10[_0x5703('0x21')]?_['map'](_0x2eab10[_0x5703('0x21')],function(_0x1f08ba){return{'model':db[_0x1f08ba[_0x5703('0x22')]],'as':_0x1f08ba['as'],'attributes':_0x1f08ba['attributes'],'include':_0x1f08ba[_0x5703('0x21')]?_['map'](_0x1f08ba[_0x5703('0x21')],function(_0x319aa6){return{'model':db[_0x319aa6[_0x5703('0x22')]],'as':_0x319aa6['as'],'attributes':_0x319aa6[_0x5703('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x495a7c){logger[_0x5703('0x18')](_0x5703('0x26'),_0x3508e8);logger[_0x5703('0x11')](_0x5703('0x26'),_0x3508e8,JSON[_0x5703('0x14')](_0x495a7c));_0x2af3c3(_0x495a7c);})['catch'](function(_0x5c0ae3){logger[_0x5703('0x15')](_0x5703('0x26'),_0x5c0ae3[_0x5703('0x17')],_0x3508e8);_0x3fadcc(_0x2fb0c0[_0x5703('0x15')](0x1f4,_0x5c0ae3[_0x5703('0x17')]));});});}; \ No newline at end of file +var _0x77f1=['then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','register','request'];(function(_0x48af02,_0xa58dcf){var _0xa8280a=function(_0x46c7f9){while(--_0x46c7f9){_0x48af02['push'](_0x48af02['shift']());}};_0xa8280a(++_0xa58dcf);}(_0x77f1,0x1dd));var _0x177f=function(_0x1c7fe7,_0x13f754){_0x1c7fe7=_0x1c7fe7-0x0;var _0x366cff=_0x77f1[_0x1c7fe7];return _0x366cff;};'use strict';var _=require('lodash');var util=require(_0x177f('0x0'));var moment=require(_0x177f('0x1'));var BPromise=require(_0x177f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x177f('0x3'));var logger=require(_0x177f('0x4'))('rpc');var config=require(_0x177f('0x5'));var jayson=require(_0x177f('0x6'));var client=jayson[_0x177f('0x7')][_0x177f('0x8')]({'port':0x232a});config[_0x177f('0x9')]=_['defaults'](config[_0x177f('0x9')],{'host':_0x177f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x177f('0x9')]));require('./chatQueue.socket')[_0x177f('0xb')](socket);function respondWithRpcPromise(_0x4e1bab,_0x2050c2,_0x38989d){return new BPromise(function(_0x47ccab,_0x42d6d2){return client[_0x177f('0xc')](_0x4e1bab,_0x38989d)[_0x177f('0xd')](function(_0xf5086c){logger[_0x177f('0xe')](_0x177f('0xf'),_0x2050c2,_0x177f('0x10'));logger[_0x177f('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2050c2,_0x177f('0x10'),JSON[_0x177f('0x12')](_0xf5086c));if(_0xf5086c[_0x177f('0x13')]){if(_0xf5086c[_0x177f('0x13')]['code']===0x1f4){logger[_0x177f('0x13')](_0x177f('0xf'),_0x2050c2,_0xf5086c[_0x177f('0x13')]['message']);return _0x42d6d2(_0xf5086c['error'][_0x177f('0x14')]);}logger[_0x177f('0x13')](_0x177f('0xf'),_0x2050c2,_0xf5086c[_0x177f('0x13')][_0x177f('0x14')]);return _0x47ccab(_0xf5086c[_0x177f('0x13')][_0x177f('0x14')]);}else{logger[_0x177f('0xe')](_0x177f('0xf'),_0x2050c2,_0x177f('0x10'));_0x47ccab(_0xf5086c['result'][_0x177f('0x14')]);}})[_0x177f('0x15')](function(_0x4d1c1e){logger[_0x177f('0x13')](_0x177f('0xf'),_0x2050c2,_0x4d1c1e);_0x42d6d2(_0x4d1c1e);});});}exports[_0x177f('0x16')]=function(_0x3cccbf){var _0x3ff483=this;return new Promise(function(_0x4649f0,_0x40f6ed){return db[_0x177f('0x17')][_0x177f('0x18')]({'raw':_0x3cccbf[_0x177f('0x19')]?_0x3cccbf['options'][_0x177f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3cccbf[_0x177f('0x19')]?_0x3cccbf[_0x177f('0x19')][_0x177f('0x1b')]||null:null,'attributes':_0x3cccbf[_0x177f('0x19')]?_0x3cccbf[_0x177f('0x19')][_0x177f('0x1c')]||null:null,'limit':_0x3cccbf['options']?_0x3cccbf['options'][_0x177f('0x1d')]||null:null,'include':_0x3cccbf[_0x177f('0x19')]?_0x3cccbf[_0x177f('0x19')][_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x3cccbf[_0x177f('0x19')]['include'],function(_0x248e4c){return{'model':db[_0x248e4c[_0x177f('0x20')]],'as':_0x248e4c['as'],'attributes':_0x248e4c[_0x177f('0x1c')],'include':_0x248e4c[_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x248e4c[_0x177f('0x1e')],function(_0x1a8e92){return{'model':db[_0x1a8e92[_0x177f('0x20')]],'as':_0x1a8e92['as'],'attributes':_0x1a8e92[_0x177f('0x1c')],'include':_0x1a8e92[_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x1a8e92[_0x177f('0x1e')],function(_0x25d876){return{'model':db[_0x25d876[_0x177f('0x20')]],'as':_0x25d876['as'],'attributes':_0x25d876[_0x177f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfa8ad0){logger[_0x177f('0xe')]('GetChatQueue',_0x3cccbf);logger[_0x177f('0x11')](_0x177f('0x16'),_0x3cccbf,JSON['stringify'](_0xfa8ad0));_0x4649f0(_0xfa8ad0);})[_0x177f('0x15')](function(_0x27cfb3){logger['error']('GetChatQueue',_0x27cfb3['message'],_0x3cccbf);_0x40f6ed(_0x3ff483['error'](0x1f4,_0x27cfb3[_0x177f('0x14')]));});});};exports[_0x177f('0x21')]=function(_0x6cc694){var _0x15681b=this;return new Promise(function(_0xcf2134,_0x99a037){return db[_0x177f('0x17')][_0x177f('0x22')]({'raw':_0x6cc694[_0x177f('0x19')]?_0x6cc694[_0x177f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x6cc694[_0x177f('0x19')]?_0x6cc694[_0x177f('0x19')]['where']||null:null,'attributes':_0x6cc694[_0x177f('0x19')]?_0x6cc694[_0x177f('0x19')]['attributes']||null:null,'include':_0x6cc694['options']?_0x6cc694[_0x177f('0x19')][_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x6cc694[_0x177f('0x19')]['include'],function(_0x5c0033){return{'model':db[_0x5c0033[_0x177f('0x20')]],'as':_0x5c0033['as'],'attributes':_0x5c0033[_0x177f('0x1c')],'include':_0x5c0033[_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x5c0033[_0x177f('0x1e')],function(_0x25659d){return{'model':db[_0x25659d[_0x177f('0x20')]],'as':_0x25659d['as'],'attributes':_0x25659d['attributes'],'include':_0x25659d[_0x177f('0x1e')]?_['map'](_0x25659d[_0x177f('0x1e')],function(_0x23b8c9){return{'model':db[_0x23b8c9['model']],'as':_0x23b8c9['as'],'attributes':_0x23b8c9[_0x177f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x177f('0xd')](function(_0x408154){logger[_0x177f('0xe')]('ShowChatQueue',_0x6cc694);logger['debug']('ShowChatQueue',_0x6cc694,JSON[_0x177f('0x12')](_0x408154));_0xcf2134(_0x408154);})[_0x177f('0x15')](function(_0x47532c){logger[_0x177f('0x13')](_0x177f('0x21'),_0x47532c[_0x177f('0x14')],_0x6cc694);_0x99a037(_0x15681b[_0x177f('0x13')](0x1f4,_0x47532c[_0x177f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index ad7e3ab..fe51aff 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 _0xb458=['length','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x5e6c25,_0x29046e){var _0x8d0c63=function(_0x509bff){while(--_0x509bff){_0x5e6c25['push'](_0x5e6c25['shift']());}};_0x8d0c63(++_0x29046e);}(_0xb458,0x103));var _0x8b45=function(_0x1024ca,_0x2562fe){_0x1024ca=_0x1024ca-0x0;var _0x390f5c=_0xb458[_0x1024ca];return _0x390f5c;};'use strict';var ChatQueueEvents=require(_0x8b45('0x0'));var events=[_0x8b45('0x1'),_0x8b45('0x2'),'update'];function createListener(_0x58a508,_0xdf89d4){return function(_0x93d9cd){_0xdf89d4[_0x8b45('0x3')](_0x58a508,_0x93d9cd);};}function removeListener(_0x13a8c6,_0x5d51e4){return function(){ChatQueueEvents[_0x8b45('0x4')](_0x13a8c6,_0x5d51e4);};}exports['register']=function(_0x5cc2d5){for(var _0xe8d774=0x0,_0x12bd05=events[_0x8b45('0x5')];_0xe8d774<_0x12bd05;_0xe8d774++){var _0x3a8ccb=events[_0xe8d774];var _0x32342f=createListener('chatQueue:'+_0x3a8ccb,_0x5cc2d5);ChatQueueEvents['on'](_0x3a8ccb,_0x32342f);}}; \ No newline at end of file +var _0x303a=['removeListener','register','length','./chatQueue.events','remove','update','emit'];(function(_0x3445fc,_0xe740b8){var _0x4534c2=function(_0x1fe7dc){while(--_0x1fe7dc){_0x3445fc['push'](_0x3445fc['shift']());}};_0x4534c2(++_0xe740b8);}(_0x303a,0x1a0));var _0xa303=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x303a[_0x20845e];return _0x28cf2b;};'use strict';var ChatQueueEvents=require(_0xa303('0x0'));var events=['save',_0xa303('0x1'),_0xa303('0x2')];function createListener(_0x36e548,_0x19d27a){return function(_0x594b49){_0x19d27a[_0xa303('0x3')](_0x36e548,_0x594b49);};}function removeListener(_0x26b47c,_0x38a354){return function(){ChatQueueEvents[_0xa303('0x4')](_0x26b47c,_0x38a354);};}exports[_0xa303('0x5')]=function(_0x1c7ee9){for(var _0x2bc3d7=0x0,_0x3f61f1=events[_0xa303('0x6')];_0x2bc3d7<_0x3f61f1;_0x2bc3d7++){var _0x5d95fd=events[_0x2bc3d7];var _0x51e1ee=createListener('chatQueue:'+_0x5d95fd,_0x1c7ee9);ChatQueueEvents['on'](_0x5d95fd,_0x51e1ee);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index dd6c5ec..698ad40 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x455a9c,_0x4235c6){var _0x112350=function(_0x5a044d){while(--_0x5a044d){_0x455a9c['push'](_0x455a9c['shift']());}};_0x112350(++_0x4235c6);}(_0x814b,0x1a2));var _0xb814=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0x814b[_0x263f9d];return _0x4c4efa;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x532d14,_0x285b6b){var _0x2e636f=function(_0x594503){while(--_0x594503){_0x532d14['push'](_0x532d14['shift']());}};_0x2e636f(++_0x285b6b);}(_0x008c,0x188));var _0xc008=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0x008c[_0x320b8e];return _0x55a10a;};'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')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 2aeefab..777e422 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 _0x20da=['exports','STRING','DATE','moment','sequelize'];(function(_0x2add1c,_0x50f7c7){var _0x304af0=function(_0x324103){while(--_0x324103){_0x2add1c['push'](_0x2add1c['shift']());}};_0x304af0(++_0x50f7c7);}(_0x20da,0xcb));var _0xa20d=function(_0x58deaf,_0x4d4bde){_0x58deaf=_0x58deaf-0x0;var _0x23ee59=_0x20da[_0x58deaf];return _0x23ee59;};'use strict';var moment=require(_0xa20d('0x0'));var Sequelize=require(_0xa20d('0x1'));module[_0xa20d('0x2')]={'uniqueid':{'type':Sequelize[_0xa20d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa20d('0x4')]},'leaveAt':{'type':Sequelize[_0xa20d('0x4')]},'acceptAt':{'type':Sequelize[_0xa20d('0x4')]},'exitAt':{'type':Sequelize[_0xa20d('0x4')]},'reason':{'type':Sequelize[_0xa20d('0x3')]}}; \ No newline at end of file +var _0x9fe1=['moment','exports','STRING','DATE'];(function(_0x3a5b58,_0x1a206f){var _0x230d94=function(_0xcb4681){while(--_0xcb4681){_0x3a5b58['push'](_0x3a5b58['shift']());}};_0x230d94(++_0x1a206f);}(_0x9fe1,0x18c));var _0x19fe=function(_0x266d00,_0x3cd3b8){_0x266d00=_0x266d00-0x0;var _0x3a5690=_0x9fe1[_0x266d00];return _0x3a5690;};'use strict';var moment=require(_0x19fe('0x0'));var Sequelize=require('sequelize');module[_0x19fe('0x1')]={'uniqueid':{'type':Sequelize[_0x19fe('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x19fe('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x19fe('0x3')]},'exitAt':{'type':Sequelize[_0x19fe('0x3')]},'reason':{'type':Sequelize[_0x19fe('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 2947fad..a6b60d7 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 _0xbccd=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','sort','filters','pick','filter','where','merge','options','includeAll','include','ChatQueueReport','findAll','params','keys','length','find','create','catch','body','describe'];(function(_0x444af1,_0x117b28){var _0x3f137f=function(_0x4a8d06){while(--_0x4a8d06){_0x444af1['push'](_0x444af1['shift']());}};_0x3f137f(++_0x117b28);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xbccd[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xdbcc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdbcc('0x1'));var rp=require(_0xdbcc('0x2'));var moment=require(_0xdbcc('0x3'));var BPromise=require(_0xdbcc('0x4'));var Mustache=require(_0xdbcc('0x5'));var util=require(_0xdbcc('0x6'));var path=require('path');var sox=require(_0xdbcc('0x7'));var csv=require(_0xdbcc('0x8'));var ejs=require(_0xdbcc('0x9'));var fs=require('fs');var fs_extra=require(_0xdbcc('0xa'));var _=require(_0xdbcc('0xb'));var squel=require(_0xdbcc('0xc'));var crypto=require(_0xdbcc('0xd'));var jsforce=require(_0xdbcc('0xe'));var deskjs=require(_0xdbcc('0xf'));var toCsv=require(_0xdbcc('0x8'));var querystring=require(_0xdbcc('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbcc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdbcc('0x12'));var hardwareService=require(_0xdbcc('0x13'));var logger=require(_0xdbcc('0x14'))(_0xdbcc('0x15'));var utils=require(_0xdbcc('0x16'));var config=require(_0xdbcc('0x17'));var licenseUtil=require(_0xdbcc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fbd02,_0x4c8384){_0x4c8384=_0x4c8384||0xcc;return function(_0x52b3bf){if(_0x52b3bf){return _0x2fbd02['sendStatus'](_0x4c8384);}return _0x2fbd02[_0xdbcc('0x19')](_0x4c8384)[_0xdbcc('0x1a')]();};}function respondWithResult(_0x290b93,_0xa799eb){_0xa799eb=_0xa799eb||0xc8;return function(_0x381f22){if(_0x381f22){return _0x290b93[_0xdbcc('0x19')](_0xa799eb)[_0xdbcc('0x1b')](_0x381f22);}};}function respondWithFilteredResult(_0x4649d2,_0x5c53a1){return function(_0x5688ce){if(_0x5688ce){var _0x2b189a=typeof _0x5c53a1[_0xdbcc('0x1c')]===_0xdbcc('0x1d')&&typeof _0x5c53a1[_0xdbcc('0x1e')]===_0xdbcc('0x1d');var _0x2df00c=_0x5688ce[_0xdbcc('0x1f')];var _0x3bfeb0=_0x2b189a?0x0:_0x5c53a1[_0xdbcc('0x1c')];var _0x3d9bda=_0x2b189a?_0x5688ce[_0xdbcc('0x1f')]:_0x5c53a1[_0xdbcc('0x1c')]+_0x5c53a1[_0xdbcc('0x1e')];var _0x4dd404;if(_0x3d9bda>=_0x2df00c){_0x3d9bda=_0x2df00c;_0x4dd404=0xc8;}else{_0x4dd404=0xce;}_0x4649d2['status'](_0x4dd404);return _0x4649d2[_0xdbcc('0x20')](_0xdbcc('0x21'),_0x3bfeb0+'-'+_0x3d9bda+'/'+_0x2df00c)['json'](_0x5688ce);}return null;};}function patchUpdates(_0x447f70){return function(_0x47990b){try{jsonpatch[_0xdbcc('0x22')](_0x47990b,_0x447f70,!![]);}catch(_0x500ec4){return BPromise['reject'](_0x500ec4);}return _0x47990b[_0xdbcc('0x23')]();};}function saveUpdates(_0x3c321f,_0x40d7d0){return function(_0x6eee38){if(_0x6eee38){return _0x6eee38[_0xdbcc('0x24')](_0x3c321f)[_0xdbcc('0x25')](function(_0x2d797a){return _0x2d797a;});}return null;};}function removeEntity(_0x18d47f,_0x591962){return function(_0x343523){if(_0x343523){return _0x343523['destroy']()[_0xdbcc('0x25')](function(){_0x18d47f[_0xdbcc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18d76d,_0xb2a8b4){return function(_0x2df594){if(!_0x2df594){_0x18d76d['sendStatus'](0x194);}return _0x2df594;};}function handleError(_0x50e23c,_0xbe9ba3){_0xbe9ba3=_0xbe9ba3||0x1f4;return function(_0x17e223){logger[_0xdbcc('0x26')](_0x17e223['stack']);if(_0x17e223[_0xdbcc('0x27')]){delete _0x17e223[_0xdbcc('0x27')];}_0x50e23c['status'](_0xbe9ba3)[_0xdbcc('0x28')](_0x17e223);};}exports[_0xdbcc('0x29')]=function(_0x26cf3a,_0x59b175){var _0x31412c={},_0x548047={},_0x1b4425={'count':0x0,'rows':[]};var _0x57d722=_[_0xdbcc('0x2a')](db['ChatQueueReport'][_0xdbcc('0x2b')],function(_0x38b9ac){return{'name':_0x38b9ac[_0xdbcc('0x2c')],'type':_0x38b9ac[_0xdbcc('0x2d')][_0xdbcc('0x2e')]};});_0x548047[_0xdbcc('0x2f')]=_[_0xdbcc('0x2a')](_0x57d722,'name');_0x548047[_0xdbcc('0x30')]=_['keys'](_0x26cf3a[_0xdbcc('0x30')]);_0x548047['filters']=_['intersection'](_0x548047[_0xdbcc('0x2f')],_0x548047[_0xdbcc('0x30')]);_0x31412c['attributes']=_[_0xdbcc('0x31')](_0x548047['model'],qs[_0xdbcc('0x32')](_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x32')]));_0x31412c[_0xdbcc('0x33')]=_0x31412c[_0xdbcc('0x33')]['length']?_0x31412c[_0xdbcc('0x33')]:_0x548047[_0xdbcc('0x2f')];if(!_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x34')]('nolimit')){_0x31412c['limit']=qs[_0xdbcc('0x1e')](_0x26cf3a['query']['limit']);_0x31412c[_0xdbcc('0x1c')]=qs[_0xdbcc('0x1c')](_0x26cf3a[_0xdbcc('0x30')]['offset']);}_0x31412c['order']=qs[_0xdbcc('0x35')](_0x26cf3a[_0xdbcc('0x30')]['sort']);_0x31412c['where']=qs[_0xdbcc('0x36')](_[_0xdbcc('0x37')](_0x26cf3a[_0xdbcc('0x30')],_0x548047[_0xdbcc('0x36')]),_0x57d722);if(_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x38')]){_0x31412c[_0xdbcc('0x39')]=_['merge'](_0x31412c[_0xdbcc('0x39')],{'$or':_['map'](_0x57d722,function(_0x2826d5){if(_0x2826d5[_0xdbcc('0x2d')]!=='VIRTUAL'){var _0xfc5684={};_0xfc5684[_0x2826d5[_0xdbcc('0x27')]]={'$like':'%'+_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x38')]+'%'};return _0xfc5684;}})});}_0x31412c=_[_0xdbcc('0x3a')]({},_0x31412c,_0x26cf3a[_0xdbcc('0x3b')]);var _0x193651={'where':_0x31412c[_0xdbcc('0x39')]};return db['ChatQueueReport'][_0xdbcc('0x1f')](_0x193651)[_0xdbcc('0x25')](function(_0x298e63){_0x1b4425[_0xdbcc('0x1f')]=_0x298e63;if(_0x26cf3a['query'][_0xdbcc('0x3c')]){_0x31412c[_0xdbcc('0x3d')]=[{'all':!![]}];}return db[_0xdbcc('0x3e')][_0xdbcc('0x3f')](_0x31412c);})[_0xdbcc('0x25')](function(_0x24b4d5){_0x1b4425['rows']=_0x24b4d5;return _0x1b4425;})[_0xdbcc('0x25')](respondWithFilteredResult(_0x59b175,_0x31412c))['catch'](handleError(_0x59b175,null));};exports['show']=function(_0x3d4371,_0x3de65f){var _0x1c1ea8={'raw':!![],'where':{'id':_0x3d4371[_0xdbcc('0x40')]['id']}},_0x5c32db={};_0x5c32db['model']=_[_0xdbcc('0x41')](db[_0xdbcc('0x3e')][_0xdbcc('0x2b')]);_0x5c32db['query']=_[_0xdbcc('0x41')](_0x3d4371[_0xdbcc('0x30')]);_0x5c32db[_0xdbcc('0x36')]=_['intersection'](_0x5c32db[_0xdbcc('0x2f')],_0x5c32db[_0xdbcc('0x30')]);_0x1c1ea8['attributes']=_[_0xdbcc('0x31')](_0x5c32db[_0xdbcc('0x2f')],qs[_0xdbcc('0x32')](_0x3d4371['query'][_0xdbcc('0x32')]));_0x1c1ea8[_0xdbcc('0x33')]=_0x1c1ea8[_0xdbcc('0x33')][_0xdbcc('0x42')]?_0x1c1ea8['attributes']:_0x5c32db[_0xdbcc('0x2f')];if(_0x3d4371[_0xdbcc('0x30')]['includeAll']){_0x1c1ea8[_0xdbcc('0x3d')]=[{'all':!![]}];}_0x1c1ea8=_[_0xdbcc('0x3a')]({},_0x1c1ea8,_0x3d4371[_0xdbcc('0x3b')]);return db['ChatQueueReport'][_0xdbcc('0x43')](_0x1c1ea8)[_0xdbcc('0x25')](handleEntityNotFound(_0x3de65f,null))[_0xdbcc('0x25')](respondWithResult(_0x3de65f,null))['catch'](handleError(_0x3de65f,null));};exports[_0xdbcc('0x44')]=function(_0x301f00,_0x2b2172){return db[_0xdbcc('0x3e')]['create'](_0x301f00['body'],{})[_0xdbcc('0x25')](respondWithResult(_0x2b2172,0xc9))[_0xdbcc('0x45')](handleError(_0x2b2172,null));};exports[_0xdbcc('0x24')]=function(_0x5da133,_0x16f783){if(_0x5da133[_0xdbcc('0x46')]['id']){delete _0x5da133[_0xdbcc('0x46')]['id'];}return db[_0xdbcc('0x3e')]['find']({'where':{'id':_0x5da133[_0xdbcc('0x40')]['id']}})[_0xdbcc('0x25')](handleEntityNotFound(_0x16f783,null))[_0xdbcc('0x25')](saveUpdates(_0x5da133[_0xdbcc('0x46')],null))[_0xdbcc('0x25')](respondWithResult(_0x16f783,null))[_0xdbcc('0x45')](handleError(_0x16f783,null));};exports['destroy']=function(_0x534063,_0x1470e9){return db['ChatQueueReport'][_0xdbcc('0x43')]({'where':{'id':_0x534063['params']['id']}})['then'](handleEntityNotFound(_0x1470e9,null))[_0xdbcc('0x25')](removeEntity(_0x1470e9,null))['catch'](handleError(_0x1470e9,null));};exports[_0xdbcc('0x47')]=function(_0xe005aa,_0x5e2656){return db[_0xdbcc('0x3e')][_0xdbcc('0x47')]()['then'](respondWithResult(_0x5e2656,null))[_0xdbcc('0x45')](handleError(_0x5e2656,null));}; \ No newline at end of file +var _0xc4aa=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','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(_0x17d76b,_0x54345b){var _0x16f3ac=function(_0x315442){while(--_0x315442){_0x17d76b['push'](_0x17d76b['shift']());}};_0x16f3ac(++_0x54345b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'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['ChatQueueReport']['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['ChatQueueReport'][_0xac4a('0x4c')]()[_0xac4a('0x24')](respondWithResult(_0x3ac36e,null))[_0xac4a('0x44')](handleError(_0x3ac36e,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 2977911..349b94e 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x31f5b0,_0x3ceb60){var _0x25dfd3=function(_0x4f81da){while(--_0x4f81da){_0x31f5b0['push'](_0x31f5b0['shift']());}};_0x25dfd3(++_0x3ceb60);}(_0xe706,0xa3));var _0x6e70=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0xe706[_0x4b4638];return _0x59e92b;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index db24446..84fd5dd 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 _0xdc91=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','options','raw','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x581feb,_0x475a85){var _0x29fe1a=function(_0x34b44d){while(--_0x34b44d){_0x581feb['push'](_0x581feb['shift']());}};_0x29fe1a(++_0x475a85);}(_0xdc91,0x10c));var _0x1dc9=function(_0x2da629,_0x1b1f12){_0x2da629=_0x2da629-0x0;var _0x34b6f7=_0xdc91[_0x2da629];return _0x34b6f7;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require(_0x1dc9('0x2'));var BPromise=require(_0x1dc9('0x3'));var rs=require(_0x1dc9('0x4'));var fs=require('fs');var Redis=require(_0x1dc9('0x5'));var db=require(_0x1dc9('0x6'))['db'];var utils=require(_0x1dc9('0x7'));var logger=require(_0x1dc9('0x8'))(_0x1dc9('0x9'));var config=require(_0x1dc9('0xa'));var jayson=require(_0x1dc9('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x358946,_0x3323f,_0x598916){return new BPromise(function(_0x549f73,_0xf6e540){return client[_0x1dc9('0xc')](_0x358946,_0x598916)[_0x1dc9('0xd')](function(_0x3c074b){logger[_0x1dc9('0xe')](_0x1dc9('0xf'),_0x3323f,_0x1dc9('0x10'));logger[_0x1dc9('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3323f,_0x1dc9('0x10'),JSON[_0x1dc9('0x12')](_0x3c074b));if(_0x3c074b[_0x1dc9('0x13')]){if(_0x3c074b['error'][_0x1dc9('0x14')]===0x1f4){logger[_0x1dc9('0x13')](_0x1dc9('0xf'),_0x3323f,_0x3c074b[_0x1dc9('0x13')][_0x1dc9('0x15')]);return _0xf6e540(_0x3c074b['error'][_0x1dc9('0x15')]);}logger[_0x1dc9('0x13')](_0x1dc9('0xf'),_0x3323f,_0x3c074b[_0x1dc9('0x13')]['message']);return _0x549f73(_0x3c074b['error'][_0x1dc9('0x15')]);}else{logger[_0x1dc9('0xe')](_0x1dc9('0xf'),_0x3323f,_0x1dc9('0x10'));_0x549f73(_0x3c074b[_0x1dc9('0x16')][_0x1dc9('0x15')]);}})[_0x1dc9('0x17')](function(_0x30f908){logger[_0x1dc9('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x3323f,_0x30f908);_0xf6e540(_0x30f908);});});}exports[_0x1dc9('0x18')]=function(_0x460bae){var _0x4b7123=this;return new Promise(function(_0x230148,_0x5553d6){return db[_0x1dc9('0x19')]['create'](_0x460bae['body'],{'raw':_0x460bae[_0x1dc9('0x1a')]?_0x460bae['options'][_0x1dc9('0x1b')]===undefined?!![]:![]:!![]})[_0x1dc9('0xd')](function(_0x197e1c){logger[_0x1dc9('0xe')](_0x1dc9('0x18'),_0x460bae);logger[_0x1dc9('0x11')]('CreateChatQueueReport',_0x460bae,JSON['stringify'](_0x197e1c));_0x230148(_0x197e1c);})[_0x1dc9('0x17')](function(_0x586886){logger[_0x1dc9('0x13')](_0x1dc9('0x18'),_0x586886[_0x1dc9('0x15')],_0x460bae);_0x5553d6(_0x4b7123[_0x1dc9('0x13')](0x1f4,_0x586886[_0x1dc9('0x15')]));});});};exports[_0x1dc9('0x1c')]=function(_0x27011a){var _0x1a2dd4=this;return new Promise(function(_0x5babc9,_0x2159c7){return db[_0x1dc9('0x19')][_0x1dc9('0x1d')](_0x27011a[_0x1dc9('0x1e')],{'raw':_0x27011a[_0x1dc9('0x1a')]?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27011a[_0x1dc9('0x1a')]?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x1f')]||null:null,'attributes':_0x27011a['options']?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x20')]||null:null,'limit':_0x27011a[_0x1dc9('0x1a')]?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x21')]||null:null})['then'](function(_0x2a6893){logger[_0x1dc9('0xe')]('UpdateChatQueueReport',_0x27011a);logger[_0x1dc9('0x11')](_0x1dc9('0x1c'),_0x27011a,JSON['stringify'](_0x2a6893));_0x5babc9(_0x2a6893);})[_0x1dc9('0x17')](function(_0x3d4a94){logger[_0x1dc9('0x13')](_0x1dc9('0x1c'),_0x3d4a94[_0x1dc9('0x15')],_0x27011a);_0x2159c7(_0x1a2dd4['error'](0x1f4,_0x3d4a94[_0x1dc9('0x15')]));});});}; \ No newline at end of file +var _0xeb79=['error','ChatQueueReport,\x20%s,\x20%s','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','debug','update','attributes','UpdateChatQueueReport','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x76baa8,_0xbc5f21){var _0xc6ca5f=function(_0x46a42c){while(--_0x46a42c){_0x76baa8['push'](_0x76baa8['shift']());}};_0xc6ca5f(++_0xbc5f21);}(_0xeb79,0x143));var _0x9eb7=function(_0x55732c,_0x4da144){_0x55732c=_0x55732c-0x0;var _0x24887a=_0xeb79[_0x55732c];return _0x24887a;};'use strict';var _=require(_0x9eb7('0x0'));var util=require(_0x9eb7('0x1'));var moment=require(_0x9eb7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9eb7('0x3'))['db'];var utils=require(_0x9eb7('0x4'));var logger=require(_0x9eb7('0x5'))('rpc');var config=require(_0x9eb7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9eb7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x276ee1,_0x4ed9a3,_0x43074d){return new BPromise(function(_0x39b77a,_0x7acd19){return client[_0x9eb7('0x8')](_0x276ee1,_0x43074d)['then'](function(_0xbd2855){logger[_0x9eb7('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x4ed9a3,_0x9eb7('0xa'));logger['debug'](_0x9eb7('0xb'),_0x4ed9a3,_0x9eb7('0xa'),JSON[_0x9eb7('0xc')](_0xbd2855));if(_0xbd2855['error']){if(_0xbd2855[_0x9eb7('0xd')]['code']===0x1f4){logger[_0x9eb7('0xd')](_0x9eb7('0xe'),_0x4ed9a3,_0xbd2855[_0x9eb7('0xd')][_0x9eb7('0xf')]);return _0x7acd19(_0xbd2855[_0x9eb7('0xd')][_0x9eb7('0xf')]);}logger[_0x9eb7('0xd')](_0x9eb7('0xe'),_0x4ed9a3,_0xbd2855[_0x9eb7('0xd')]['message']);return _0x39b77a(_0xbd2855[_0x9eb7('0xd')][_0x9eb7('0xf')]);}else{logger[_0x9eb7('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x4ed9a3,'request\x20sent');_0x39b77a(_0xbd2855['result']['message']);}})[_0x9eb7('0x10')](function(_0x172aa6){logger[_0x9eb7('0xd')](_0x9eb7('0xe'),_0x4ed9a3,_0x172aa6);_0x7acd19(_0x172aa6);});});}exports[_0x9eb7('0x11')]=function(_0x1bb1ae){var _0x57a19b=this;return new Promise(function(_0x4c1398,_0x304f44){return db[_0x9eb7('0x12')][_0x9eb7('0x13')](_0x1bb1ae[_0x9eb7('0x14')],{'raw':_0x1bb1ae[_0x9eb7('0x15')]?_0x1bb1ae[_0x9eb7('0x15')][_0x9eb7('0x16')]===undefined?!![]:![]:!![]})[_0x9eb7('0x17')](function(_0x4a13c1){logger[_0x9eb7('0x9')]('CreateChatQueueReport',_0x1bb1ae);logger[_0x9eb7('0x18')](_0x9eb7('0x11'),_0x1bb1ae,JSON[_0x9eb7('0xc')](_0x4a13c1));_0x4c1398(_0x4a13c1);})['catch'](function(_0xb940ca){logger[_0x9eb7('0xd')](_0x9eb7('0x11'),_0xb940ca[_0x9eb7('0xf')],_0x1bb1ae);_0x304f44(_0x57a19b['error'](0x1f4,_0xb940ca[_0x9eb7('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x3624f2){var _0x460cd1=this;return new Promise(function(_0x2e924e,_0x4aea1f){return db['ChatQueueReport'][_0x9eb7('0x19')](_0x3624f2[_0x9eb7('0x14')],{'raw':_0x3624f2['options']?_0x3624f2[_0x9eb7('0x15')][_0x9eb7('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3624f2[_0x9eb7('0x15')]?_0x3624f2[_0x9eb7('0x15')]['where']||null:null,'attributes':_0x3624f2['options']?_0x3624f2[_0x9eb7('0x15')][_0x9eb7('0x1a')]||null:null,'limit':_0x3624f2[_0x9eb7('0x15')]?_0x3624f2[_0x9eb7('0x15')]['limit']||null:null})['then'](function(_0x3275ba){logger[_0x9eb7('0x9')](_0x9eb7('0x1b'),_0x3624f2);logger[_0x9eb7('0x18')](_0x9eb7('0x1b'),_0x3624f2,JSON[_0x9eb7('0xc')](_0x3275ba));_0x2e924e(_0x3275ba);})[_0x9eb7('0x10')](function(_0x27a553){logger[_0x9eb7('0xd')](_0x9eb7('0x1b'),_0x27a553['message'],_0x3624f2);_0x4aea1f(_0x460cd1[_0x9eb7('0xd')](0x1f4,_0x27a553[_0x9eb7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index ac145e3..addb32f 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 _0x56da=['delete','util','connect-timeout','express','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x562bc8,_0x1b1c19){var _0x2a37d3=function(_0x180ba9){while(--_0x180ba9){_0x562bc8['push'](_0x562bc8['shift']());}};_0x2a37d3(++_0x1b1c19);}(_0x56da,0x1e1));var _0xa56d=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x56da[_0xe66cf2];return _0x2d84e7;};'use strict';var multer=require('multer');var util=require(_0xa56d('0x0'));var path=require('path');var timeout=require(_0xa56d('0x1'));var express=require(_0xa56d('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa56d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa56d('0x4'));var controller=require(_0xa56d('0x5'));router[_0xa56d('0x6')]('/',auth[_0xa56d('0x7')](),controller[_0xa56d('0x8')]);router[_0xa56d('0x6')]('/describe',auth[_0xa56d('0x7')](),controller['describe']);router[_0xa56d('0x6')]('/:id',auth[_0xa56d('0x7')](),controller[_0xa56d('0x9')]);router[_0xa56d('0xa')]('/',auth[_0xa56d('0x7')](),controller[_0xa56d('0xb')]);router[_0xa56d('0xc')](_0xa56d('0xd'),auth[_0xa56d('0x7')](),controller[_0xa56d('0xe')]);router[_0xa56d('0xf')](_0xa56d('0xd'),auth[_0xa56d('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8516=['destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/:id','post','put'];(function(_0x316904,_0x1e8b77){var _0xfa9a21=function(_0x2b75ae){while(--_0x2b75ae){_0x316904['push'](_0x316904['shift']());}};_0xfa9a21(++_0x1e8b77);}(_0x8516,0x131));var _0x6851=function(_0x21f843,_0x6e15b3){_0x21f843=_0x21f843-0x0;var _0x1ee7da=_0x8516[_0x21f843];return _0x1ee7da;};'use strict';var multer=require(_0x6851('0x0'));var util=require(_0x6851('0x1'));var path=require('path');var timeout=require(_0x6851('0x2'));var express=require('express');var router=express[_0x6851('0x3')]();var fs_extra=require(_0x6851('0x4'));var auth=require(_0x6851('0x5'));var interaction=require(_0x6851('0x6'));var config=require(_0x6851('0x7'));var controller=require(_0x6851('0x8'));router[_0x6851('0x9')]('/',auth[_0x6851('0xa')](),controller[_0x6851('0xb')]);router[_0x6851('0x9')]('/describe',auth[_0x6851('0xa')](),controller['describe']);router[_0x6851('0x9')](_0x6851('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x6851('0xd')]('/',auth[_0x6851('0xa')](),controller['create']);router[_0x6851('0xe')]('/:id',auth[_0x6851('0xa')](),controller['update']);router['delete'](_0x6851('0xc'),auth[_0x6851('0xa')](),controller[_0x6851('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 0fcd93d..769881a 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x4918c6,_0x5cc45a){var _0x585f66=function(_0xfacd7f){while(--_0xfacd7f){_0x4918c6['push'](_0x4918c6['shift']());}};_0x585f66(++_0x5cc45a);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0xf3cd[_0x434783];return _0x13efcf;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4d73b1,_0x91ab71){var _0xe394f9=function(_0x47dd5d){while(--_0x47dd5d){_0x4d73b1['push'](_0x4d73b1['shift']());}};_0xe394f9(++_0x91ab71);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 608bf99..169a816 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 _0x0a3b=['util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','apply','reject','update','then','destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','includeAll','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3ae3fe,_0x2f1ea3){var _0xf25a7f=function(_0x51c3cc){while(--_0x51c3cc){_0x3ae3fe['push'](_0x3ae3fe['shift']());}};_0xf25a7f(++_0x2f1ea3);}(_0x0a3b,0xdc));var _0xb0a3=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0x0a3b[_0x43b06b];return _0x2c555b;};'use strict';var emlformat=require(_0xb0a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0a3('0x1'));var jsonpatch=require(_0xb0a3('0x2'));var rp=require(_0xb0a3('0x3'));var moment=require(_0xb0a3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb0a3('0x5'));var path=require('path');var sox=require(_0xb0a3('0x6'));var csv=require(_0xb0a3('0x7'));var ejs=require(_0xb0a3('0x8'));var fs=require('fs');var fs_extra=require(_0xb0a3('0x9'));var _=require(_0xb0a3('0xa'));var squel=require('squel');var crypto=require(_0xb0a3('0xb'));var jsforce=require(_0xb0a3('0xc'));var deskjs=require(_0xb0a3('0xd'));var toCsv=require(_0xb0a3('0x7'));var querystring=require(_0xb0a3('0xe'));var Papa=require(_0xb0a3('0xf'));var Redis=require(_0xb0a3('0x10'));var authService=require(_0xb0a3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb0a3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0a3('0x13'))(_0xb0a3('0x14'));var utils=require(_0xb0a3('0x15'));var config=require(_0xb0a3('0x16'));var licenseUtil=require(_0xb0a3('0x17'));var db=require(_0xb0a3('0x18'))['db'];function respondWithStatusCode(_0xd7d198,_0x35cbde){_0x35cbde=_0x35cbde||0xcc;return function(_0x537270){if(_0x537270){return _0xd7d198[_0xb0a3('0x19')](_0x35cbde);}return _0xd7d198['status'](_0x35cbde)[_0xb0a3('0x1a')]();};}function respondWithResult(_0x30b411,_0x1afb35){_0x1afb35=_0x1afb35||0xc8;return function(_0x5857df){if(_0x5857df){return _0x30b411[_0xb0a3('0x1b')](_0x1afb35)[_0xb0a3('0x1c')](_0x5857df);}};}function respondWithFilteredResult(_0x4280b9,_0x393752){return function(_0x3eb554){if(_0x3eb554){var _0x17f04f=typeof _0x393752[_0xb0a3('0x1d')]===_0xb0a3('0x1e')&&typeof _0x393752['limit']===_0xb0a3('0x1e');var _0x10d5de=_0x3eb554['count'];var _0x5d76ca=_0x17f04f?0x0:_0x393752['offset'];var _0x59d0ad=_0x17f04f?_0x3eb554[_0xb0a3('0x1f')]:_0x393752[_0xb0a3('0x1d')]+_0x393752['limit'];var _0x211c1d;if(_0x59d0ad>=_0x10d5de){_0x59d0ad=_0x10d5de;_0x211c1d=0xc8;}else{_0x211c1d=0xce;}_0x4280b9[_0xb0a3('0x1b')](_0x211c1d);return _0x4280b9[_0xb0a3('0x20')]('Content-Range',_0x5d76ca+'-'+_0x59d0ad+'/'+_0x10d5de)['json'](_0x3eb554);}return null;};}function patchUpdates(_0x5b1d72){return function(_0x3db119){try{jsonpatch[_0xb0a3('0x21')](_0x3db119,_0x5b1d72,!![]);}catch(_0x76acfc){return BPromise[_0xb0a3('0x22')](_0x76acfc);}return _0x3db119['save']();};}function saveUpdates(_0x399d33,_0x3403c4){return function(_0x40ca0f){if(_0x40ca0f){return _0x40ca0f[_0xb0a3('0x23')](_0x399d33)[_0xb0a3('0x24')](function(_0x522d49){return _0x522d49;});}return null;};}function removeEntity(_0x8c48d5,_0x26fbdf){return function(_0x56a1ba){if(_0x56a1ba){return _0x56a1ba[_0xb0a3('0x25')]()[_0xb0a3('0x24')](function(){_0x8c48d5['status'](0xcc)[_0xb0a3('0x1a')]();});}};}function handleEntityNotFound(_0xdd5a77,_0x5f47f6){return function(_0x209034){if(!_0x209034){_0xdd5a77[_0xb0a3('0x19')](0x194);}return _0x209034;};}function handleError(_0x1791cc,_0x4b08ab){_0x4b08ab=_0x4b08ab||0x1f4;return function(_0x2507aa){logger[_0xb0a3('0x26')](_0x2507aa['stack']);if(_0x2507aa[_0xb0a3('0x27')]){delete _0x2507aa[_0xb0a3('0x27')];}_0x1791cc['status'](_0x4b08ab)[_0xb0a3('0x28')](_0x2507aa);};}exports[_0xb0a3('0x29')]=function(_0x49a7d8,_0x3d2321){var _0x41fb72={},_0xc29a1b={},_0x4f17b1={'count':0x0,'rows':[]};var _0x967090=_[_0xb0a3('0x2a')](db[_0xb0a3('0x2b')][_0xb0a3('0x2c')],function(_0xd79238){return{'name':_0xd79238[_0xb0a3('0x2d')],'type':_0xd79238[_0xb0a3('0x2e')][_0xb0a3('0x2f')]};});_0xc29a1b[_0xb0a3('0x30')]=_[_0xb0a3('0x2a')](_0x967090,_0xb0a3('0x27'));_0xc29a1b['query']=_[_0xb0a3('0x31')](_0x49a7d8['query']);_0xc29a1b[_0xb0a3('0x32')]=_[_0xb0a3('0x33')](_0xc29a1b[_0xb0a3('0x30')],_0xc29a1b[_0xb0a3('0x34')]);_0x41fb72['attributes']=_['intersection'](_0xc29a1b[_0xb0a3('0x30')],qs[_0xb0a3('0x35')](_0x49a7d8[_0xb0a3('0x34')]['fields']));_0x41fb72[_0xb0a3('0x36')]=_0x41fb72['attributes'][_0xb0a3('0x37')]?_0x41fb72['attributes']:_0xc29a1b['model'];if(!_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x38')](_0xb0a3('0x39'))){_0x41fb72[_0xb0a3('0x3a')]=qs[_0xb0a3('0x3a')](_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x3a')]);_0x41fb72['offset']=qs[_0xb0a3('0x1d')](_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x1d')]);}_0x41fb72[_0xb0a3('0x3b')]=qs[_0xb0a3('0x3c')](_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x3c')]);_0x41fb72[_0xb0a3('0x3d')]=qs['filters'](_['pick'](_0x49a7d8[_0xb0a3('0x34')],_0xc29a1b[_0xb0a3('0x32')]),_0x967090);if(_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x3e')]){_0x41fb72[_0xb0a3('0x3d')]=_[_0xb0a3('0x3f')](_0x41fb72[_0xb0a3('0x3d')],{'$or':_[_0xb0a3('0x2a')](_0x967090,function(_0xaf9027){if(_0xaf9027[_0xb0a3('0x2e')]!==_0xb0a3('0x40')){var _0x36ecf9={};_0x36ecf9[_0xaf9027['name']]={'$like':'%'+_0x49a7d8[_0xb0a3('0x34')]['filter']+'%'};return _0x36ecf9;}})});}_0x41fb72=_['merge']({},_0x41fb72,_0x49a7d8['options']);var _0xc092c9={'where':_0x41fb72['where']};return db['ChatTransferReport'][_0xb0a3('0x1f')](_0xc092c9)[_0xb0a3('0x24')](function(_0x4aca30){_0x4f17b1[_0xb0a3('0x1f')]=_0x4aca30;if(_0x49a7d8['query']['includeAll']){_0x41fb72[_0xb0a3('0x41')]=[{'all':!![]}];}return db[_0xb0a3('0x2b')][_0xb0a3('0x42')](_0x41fb72);})[_0xb0a3('0x24')](function(_0xf98837){_0x4f17b1[_0xb0a3('0x43')]=_0xf98837;return _0x4f17b1;})[_0xb0a3('0x24')](respondWithFilteredResult(_0x3d2321,_0x41fb72))[_0xb0a3('0x44')](handleError(_0x3d2321,null));};exports['show']=function(_0x32e9d9,_0x88ae47){var _0xc5cd32={'raw':!![],'where':{'id':_0x32e9d9['params']['id']}},_0x5a1ed2={};_0x5a1ed2[_0xb0a3('0x30')]=_[_0xb0a3('0x31')](db[_0xb0a3('0x2b')]['rawAttributes']);_0x5a1ed2['query']=_[_0xb0a3('0x31')](_0x32e9d9[_0xb0a3('0x34')]);_0x5a1ed2[_0xb0a3('0x32')]=_[_0xb0a3('0x33')](_0x5a1ed2[_0xb0a3('0x30')],_0x5a1ed2[_0xb0a3('0x34')]);_0xc5cd32[_0xb0a3('0x36')]=_[_0xb0a3('0x33')](_0x5a1ed2['model'],qs[_0xb0a3('0x35')](_0x32e9d9[_0xb0a3('0x34')][_0xb0a3('0x35')]));_0xc5cd32[_0xb0a3('0x36')]=_0xc5cd32['attributes'][_0xb0a3('0x37')]?_0xc5cd32[_0xb0a3('0x36')]:_0x5a1ed2[_0xb0a3('0x30')];if(_0x32e9d9['query'][_0xb0a3('0x45')]){_0xc5cd32[_0xb0a3('0x41')]=[{'all':!![]}];}_0xc5cd32=_[_0xb0a3('0x3f')]({},_0xc5cd32,_0x32e9d9['options']);return db['ChatTransferReport'][_0xb0a3('0x46')](_0xc5cd32)['then'](handleEntityNotFound(_0x88ae47,null))['then'](respondWithResult(_0x88ae47,null))[_0xb0a3('0x44')](handleError(_0x88ae47,null));};exports[_0xb0a3('0x47')]=function(_0x47117e,_0x59d274){return db[_0xb0a3('0x2b')][_0xb0a3('0x47')](_0x47117e['body'],{})[_0xb0a3('0x24')](respondWithResult(_0x59d274,0xc9))[_0xb0a3('0x44')](handleError(_0x59d274,null));};exports[_0xb0a3('0x23')]=function(_0x260c7b,_0x57c294){if(_0x260c7b[_0xb0a3('0x48')]['id']){delete _0x260c7b['body']['id'];}return db[_0xb0a3('0x2b')][_0xb0a3('0x46')]({'where':{'id':_0x260c7b[_0xb0a3('0x49')]['id']}})[_0xb0a3('0x24')](handleEntityNotFound(_0x57c294,null))[_0xb0a3('0x24')](saveUpdates(_0x260c7b[_0xb0a3('0x48')],null))[_0xb0a3('0x24')](respondWithResult(_0x57c294,null))[_0xb0a3('0x44')](handleError(_0x57c294,null));};exports[_0xb0a3('0x25')]=function(_0x3e3b85,_0x252da1){return db[_0xb0a3('0x2b')]['find']({'where':{'id':_0x3e3b85[_0xb0a3('0x49')]['id']}})[_0xb0a3('0x24')](handleEntityNotFound(_0x252da1,null))['then'](removeEntity(_0x252da1,null))['catch'](handleError(_0x252da1,null));};exports[_0xb0a3('0x4a')]=function(_0xa14bcb,_0x1037f6){return db[_0xb0a3('0x2b')][_0xb0a3('0x4a')]()[_0xb0a3('0x24')](respondWithResult(_0x1037f6,null))['catch'](handleError(_0x1037f6,null));}; \ No newline at end of file +var _0x6fc9=['length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','update','then','destroy','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields'];(function(_0xbb3ab4,_0x14a77d){var _0x3853f1=function(_0xbab961){while(--_0xbab961){_0xbb3ab4['push'](_0xbb3ab4['shift']());}};_0x3853f1(++_0x14a77d);}(_0x6fc9,0xf6));var _0x96fc=function(_0x422fac,_0x2e9a25){_0x422fac=_0x422fac-0x0;var _0x3fdf64=_0x6fc9[_0x422fac];return _0x3fdf64;};'use strict';var emlformat=require(_0x96fc('0x0'));var rimraf=require(_0x96fc('0x1'));var zipdir=require(_0x96fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96fc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x96fc('0x4'));var util=require(_0x96fc('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x96fc('0x6'));var ejs=require(_0x96fc('0x7'));var fs=require('fs');var fs_extra=require(_0x96fc('0x8'));var _=require('lodash');var squel=require(_0x96fc('0x9'));var crypto=require(_0x96fc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x96fc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x96fc('0xc'));var Papa=require(_0x96fc('0xd'));var Redis=require('ioredis');var authService=require(_0x96fc('0xe'));var qs=require(_0x96fc('0xf'));var as=require(_0x96fc('0x10'));var hardwareService=require(_0x96fc('0x11'));var logger=require(_0x96fc('0x12'))('api');var utils=require(_0x96fc('0x13'));var config=require(_0x96fc('0x14'));var licenseUtil=require(_0x96fc('0x15'));var db=require(_0x96fc('0x16'))['db'];function respondWithStatusCode(_0x9d6a3c,_0x3164d5){_0x3164d5=_0x3164d5||0xcc;return function(_0x1ffa86){if(_0x1ffa86){return _0x9d6a3c[_0x96fc('0x17')](_0x3164d5);}return _0x9d6a3c[_0x96fc('0x18')](_0x3164d5)[_0x96fc('0x19')]();};}function respondWithResult(_0x39319e,_0x16b1ac){_0x16b1ac=_0x16b1ac||0xc8;return function(_0xeff20d){if(_0xeff20d){return _0x39319e['status'](_0x16b1ac)['json'](_0xeff20d);}};}function respondWithFilteredResult(_0x645fa0,_0x5edb47){return function(_0xbd38d5){if(_0xbd38d5){var _0x54ce40=typeof _0x5edb47['offset']===_0x96fc('0x1a')&&typeof _0x5edb47[_0x96fc('0x1b')]===_0x96fc('0x1a');var _0x3fba66=_0xbd38d5[_0x96fc('0x1c')];var _0x212273=_0x54ce40?0x0:_0x5edb47[_0x96fc('0x1d')];var _0x1e733f=_0x54ce40?_0xbd38d5[_0x96fc('0x1c')]:_0x5edb47[_0x96fc('0x1d')]+_0x5edb47[_0x96fc('0x1b')];var _0x2f78ac;if(_0x1e733f>=_0x3fba66){_0x1e733f=_0x3fba66;_0x2f78ac=0xc8;}else{_0x2f78ac=0xce;}_0x645fa0[_0x96fc('0x18')](_0x2f78ac);return _0x645fa0[_0x96fc('0x1e')]('Content-Range',_0x212273+'-'+_0x1e733f+'/'+_0x3fba66)[_0x96fc('0x1f')](_0xbd38d5);}return null;};}function patchUpdates(_0x5a25cf){return function(_0x47bcaa){try{jsonpatch[_0x96fc('0x20')](_0x47bcaa,_0x5a25cf,!![]);}catch(_0x22b9da){return BPromise[_0x96fc('0x21')](_0x22b9da);}return _0x47bcaa['save']();};}function saveUpdates(_0x196fbb,_0x5a56f7){return function(_0x170fc1){if(_0x170fc1){return _0x170fc1[_0x96fc('0x22')](_0x196fbb)[_0x96fc('0x23')](function(_0x40bac6){return _0x40bac6;});}return null;};}function removeEntity(_0x202537,_0x362b93){return function(_0x14e382){if(_0x14e382){return _0x14e382[_0x96fc('0x24')]()[_0x96fc('0x23')](function(){_0x202537[_0x96fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x168a2a,_0x4265e3){return function(_0x1ff151){if(!_0x1ff151){_0x168a2a[_0x96fc('0x17')](0x194);}return _0x1ff151;};}function handleError(_0x363e9f,_0x45feed){_0x45feed=_0x45feed||0x1f4;return function(_0x4b37cb){logger['error'](_0x4b37cb['stack']);if(_0x4b37cb['name']){delete _0x4b37cb[_0x96fc('0x25')];}_0x363e9f[_0x96fc('0x18')](_0x45feed)[_0x96fc('0x26')](_0x4b37cb);};}exports['index']=function(_0x12c89f,_0x367fb3){var _0x42ef34={},_0x1ab3e1={},_0x2c8f83={'count':0x0,'rows':[]};var _0x3969f8=_[_0x96fc('0x27')](db[_0x96fc('0x28')][_0x96fc('0x29')],function(_0x5edc66){return{'name':_0x5edc66[_0x96fc('0x2a')],'type':_0x5edc66['type'][_0x96fc('0x2b')]};});_0x1ab3e1[_0x96fc('0x2c')]=_[_0x96fc('0x27')](_0x3969f8,_0x96fc('0x25'));_0x1ab3e1[_0x96fc('0x2d')]=_[_0x96fc('0x2e')](_0x12c89f['query']);_0x1ab3e1[_0x96fc('0x2f')]=_[_0x96fc('0x30')](_0x1ab3e1[_0x96fc('0x2c')],_0x1ab3e1[_0x96fc('0x2d')]);_0x42ef34['attributes']=_['intersection'](_0x1ab3e1[_0x96fc('0x2c')],qs[_0x96fc('0x31')](_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x31')]));_0x42ef34['attributes']=_0x42ef34['attributes'][_0x96fc('0x32')]?_0x42ef34[_0x96fc('0x33')]:_0x1ab3e1[_0x96fc('0x2c')];if(!_0x12c89f['query'][_0x96fc('0x34')](_0x96fc('0x35'))){_0x42ef34[_0x96fc('0x1b')]=qs[_0x96fc('0x1b')](_0x12c89f['query'][_0x96fc('0x1b')]);_0x42ef34[_0x96fc('0x1d')]=qs['offset'](_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x1d')]);}_0x42ef34[_0x96fc('0x36')]=qs[_0x96fc('0x37')](_0x12c89f[_0x96fc('0x2d')]['sort']);_0x42ef34[_0x96fc('0x38')]=qs[_0x96fc('0x2f')](_[_0x96fc('0x39')](_0x12c89f[_0x96fc('0x2d')],_0x1ab3e1[_0x96fc('0x2f')]),_0x3969f8);if(_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x3a')]){_0x42ef34[_0x96fc('0x38')]=_[_0x96fc('0x3b')](_0x42ef34[_0x96fc('0x38')],{'$or':_[_0x96fc('0x27')](_0x3969f8,function(_0x510425){if(_0x510425[_0x96fc('0x3c')]!==_0x96fc('0x3d')){var _0x2520c5={};_0x2520c5[_0x510425[_0x96fc('0x25')]]={'$like':'%'+_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x3a')]+'%'};return _0x2520c5;}})});}_0x42ef34=_['merge']({},_0x42ef34,_0x12c89f['options']);var _0x5be071={'where':_0x42ef34['where']};return db[_0x96fc('0x28')]['count'](_0x5be071)[_0x96fc('0x23')](function(_0x273dc3){_0x2c8f83[_0x96fc('0x1c')]=_0x273dc3;if(_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x3e')]){_0x42ef34[_0x96fc('0x3f')]=[{'all':!![]}];}return db[_0x96fc('0x28')][_0x96fc('0x40')](_0x42ef34);})['then'](function(_0x33caaa){_0x2c8f83[_0x96fc('0x41')]=_0x33caaa;return _0x2c8f83;})[_0x96fc('0x23')](respondWithFilteredResult(_0x367fb3,_0x42ef34))[_0x96fc('0x42')](handleError(_0x367fb3,null));};exports[_0x96fc('0x43')]=function(_0x179418,_0x5826de){var _0x54a324={'raw':!![],'where':{'id':_0x179418[_0x96fc('0x44')]['id']}},_0x243101={};_0x243101[_0x96fc('0x2c')]=_[_0x96fc('0x2e')](db[_0x96fc('0x28')]['rawAttributes']);_0x243101['query']=_['keys'](_0x179418[_0x96fc('0x2d')]);_0x243101[_0x96fc('0x2f')]=_[_0x96fc('0x30')](_0x243101[_0x96fc('0x2c')],_0x243101[_0x96fc('0x2d')]);_0x54a324[_0x96fc('0x33')]=_[_0x96fc('0x30')](_0x243101[_0x96fc('0x2c')],qs['fields'](_0x179418['query'][_0x96fc('0x31')]));_0x54a324['attributes']=_0x54a324[_0x96fc('0x33')][_0x96fc('0x32')]?_0x54a324[_0x96fc('0x33')]:_0x243101[_0x96fc('0x2c')];if(_0x179418[_0x96fc('0x2d')][_0x96fc('0x3e')]){_0x54a324[_0x96fc('0x3f')]=[{'all':!![]}];}_0x54a324=_['merge']({},_0x54a324,_0x179418[_0x96fc('0x45')]);return db[_0x96fc('0x28')][_0x96fc('0x46')](_0x54a324)[_0x96fc('0x23')](handleEntityNotFound(_0x5826de,null))['then'](respondWithResult(_0x5826de,null))[_0x96fc('0x42')](handleError(_0x5826de,null));};exports[_0x96fc('0x47')]=function(_0x345bd3,_0x1d95c8){return db[_0x96fc('0x28')][_0x96fc('0x47')](_0x345bd3[_0x96fc('0x48')],{})[_0x96fc('0x23')](respondWithResult(_0x1d95c8,0xc9))[_0x96fc('0x42')](handleError(_0x1d95c8,null));};exports[_0x96fc('0x22')]=function(_0x42e41e,_0x19a921){if(_0x42e41e['body']['id']){delete _0x42e41e[_0x96fc('0x48')]['id'];}return db[_0x96fc('0x28')][_0x96fc('0x46')]({'where':{'id':_0x42e41e['params']['id']}})['then'](handleEntityNotFound(_0x19a921,null))['then'](saveUpdates(_0x42e41e[_0x96fc('0x48')],null))[_0x96fc('0x23')](respondWithResult(_0x19a921,null))[_0x96fc('0x42')](handleError(_0x19a921,null));};exports['destroy']=function(_0x4f8730,_0x34bb95){return db['ChatTransferReport'][_0x96fc('0x46')]({'where':{'id':_0x4f8730[_0x96fc('0x44')]['id']}})[_0x96fc('0x23')](handleEntityNotFound(_0x34bb95,null))[_0x96fc('0x23')](removeEntity(_0x34bb95,null))['catch'](handleError(_0x34bb95,null));};exports[_0x96fc('0x49')]=function(_0xe58152,_0xe803ae){return db[_0x96fc('0x28')][_0x96fc('0x49')]()[_0x96fc('0x23')](respondWithResult(_0xe803ae,null))['catch'](handleError(_0xe803ae,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index fbf3360..761ab56 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 _0x0a6a=['report_chat_transfer','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0xf7b425,_0x4e8416){var _0x2a16ba=function(_0x3a600b){while(--_0x3a600b){_0xf7b425['push'](_0xf7b425['shift']());}};_0x2a16ba(++_0x4e8416);}(_0x0a6a,0x6f));var _0xa0a6=function(_0x4ba105,_0xf97073){_0x4ba105=_0x4ba105-0x0;var _0x5eee7b=_0x0a6a[_0x4ba105];return _0x5eee7b;};'use strict';var _=require(_0xa0a6('0x0'));var util=require('util');var logger=require(_0xa0a6('0x1'))('api');var moment=require(_0xa0a6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0a6('0x3'));var rimraf=require(_0xa0a6('0x4'));var config=require(_0xa0a6('0x5'));var attributes=require(_0xa0a6('0x6'));module[_0xa0a6('0x7')]=function(_0x5dfde9,_0x57e1d0){return _0x5dfde9[_0xa0a6('0x8')](_0xa0a6('0x9'),attributes,{'tableName':_0xa0a6('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa538=['moment','bluebird','path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','../../config/logger','api'];(function(_0x3509b9,_0x38bb75){var _0x11704f=function(_0x37a435){while(--_0x37a435){_0x3509b9['push'](_0x3509b9['shift']());}};_0x11704f(++_0x38bb75);}(_0xa538,0xb2));var _0x8a53=function(_0x31c1d9,_0xf3b483){_0x31c1d9=_0x31c1d9-0x0;var _0x2ccc8d=_0xa538[_0x31c1d9];return _0x2ccc8d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8a53('0x0'))(_0x8a53('0x1'));var moment=require(_0x8a53('0x2'));var BPromise=require(_0x8a53('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a53('0x4'));var rimraf=require('rimraf');var config=require(_0x8a53('0x5'));var attributes=require(_0x8a53('0x6'));module[_0x8a53('0x7')]=function(_0x20a7f3,_0x2db190){return _0x20a7f3[_0x8a53('0x8')](_0x8a53('0x9'),attributes,{'tableName':_0x8a53('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8a53('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 2527155..0751149 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 _0x2afd=['then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2afd,0xbc));var _0xd2af=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2afd[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xd2af('0x0'));var moment=require(_0xd2af('0x1'));var BPromise=require(_0xd2af('0x2'));var rs=require(_0xd2af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd2af('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2af('0x5'))(_0xd2af('0x6'));var config=require(_0xd2af('0x7'));var jayson=require(_0xd2af('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a2dd3,_0x4102e6,_0x3cae3b){return new BPromise(function(_0x5295a2,_0x17fe9e){return client[_0xd2af('0x9')](_0x4a2dd3,_0x3cae3b)[_0xd2af('0xa')](function(_0x54dbad){logger[_0xd2af('0xb')](_0xd2af('0xc'),_0x4102e6,'request\x20sent');logger[_0xd2af('0xd')](_0xd2af('0xe'),_0x4102e6,_0xd2af('0xf'),JSON[_0xd2af('0x10')](_0x54dbad));if(_0x54dbad[_0xd2af('0x11')]){if(_0x54dbad[_0xd2af('0x11')][_0xd2af('0x12')]===0x1f4){logger[_0xd2af('0x11')](_0xd2af('0xc'),_0x4102e6,_0x54dbad[_0xd2af('0x11')][_0xd2af('0x13')]);return _0x17fe9e(_0x54dbad[_0xd2af('0x11')][_0xd2af('0x13')]);}logger[_0xd2af('0x11')](_0xd2af('0xc'),_0x4102e6,_0x54dbad[_0xd2af('0x11')][_0xd2af('0x13')]);return _0x5295a2(_0x54dbad['error'][_0xd2af('0x13')]);}else{logger[_0xd2af('0xb')](_0xd2af('0xc'),_0x4102e6,_0xd2af('0xf'));_0x5295a2(_0x54dbad[_0xd2af('0x14')][_0xd2af('0x13')]);}})[_0xd2af('0x15')](function(_0x1024c9){logger[_0xd2af('0x11')](_0xd2af('0xc'),_0x4102e6,_0x1024c9);_0x17fe9e(_0x1024c9);});});} \ No newline at end of file +var _0x9c44=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9c44,0xf1));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x49c4('0x0'));var util=require(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rs=require(_0x49c4('0x4'));var fs=require('fs');var Redis=require(_0x49c4('0x5'));var db=require(_0x49c4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x49c4('0x7'))('rpc');var config=require(_0x49c4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x9')][_0x49c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bbcb7,_0x2ca38b,_0x4a48dd){return new BPromise(function(_0x26dba2,_0x2b5f93){return client[_0x49c4('0xb')](_0x1bbcb7,_0x4a48dd)[_0x49c4('0xc')](function(_0x227492){logger[_0x49c4('0xd')](_0x49c4('0xe'),_0x2ca38b,_0x49c4('0xf'));logger[_0x49c4('0x10')](_0x49c4('0x11'),_0x2ca38b,'request\x20sent',JSON['stringify'](_0x227492));if(_0x227492[_0x49c4('0x12')]){if(_0x227492[_0x49c4('0x12')][_0x49c4('0x13')]===0x1f4){logger['error'](_0x49c4('0xe'),_0x2ca38b,_0x227492[_0x49c4('0x12')][_0x49c4('0x14')]);return _0x2b5f93(_0x227492[_0x49c4('0x12')]['message']);}logger[_0x49c4('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x2ca38b,_0x227492['error'][_0x49c4('0x14')]);return _0x26dba2(_0x227492[_0x49c4('0x12')]['message']);}else{logger[_0x49c4('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x2ca38b,_0x49c4('0xf'));_0x26dba2(_0x227492[_0x49c4('0x15')][_0x49c4('0x14')]);}})['catch'](function(_0x3dac25){logger[_0x49c4('0x12')](_0x49c4('0xe'),_0x2ca38b,_0x3dac25);_0x2b5f93(_0x3dac25);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 12ab079..ea1851e 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 _0x3987=['index','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','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x3840a0,_0x1c2617){var _0x441d3f=function(_0x5ec5d3){while(--_0x5ec5d3){_0x3840a0['push'](_0x3840a0['shift']());}};_0x441d3f(++_0x1c2617);}(_0x3987,0xb3));var _0x7398=function(_0x486a06,_0x46d2dd){_0x486a06=_0x486a06-0x0;var _0x88198c=_0x3987[_0x486a06];return _0x88198c;};'use strict';var multer=require(_0x7398('0x0'));var util=require(_0x7398('0x1'));var path=require(_0x7398('0x2'));var timeout=require(_0x7398('0x3'));var express=require(_0x7398('0x4'));var router=express[_0x7398('0x5')]();var fs_extra=require(_0x7398('0x6'));var auth=require(_0x7398('0x7'));var interaction=require(_0x7398('0x8'));var config=require(_0x7398('0x9'));var controller=require(_0x7398('0xa'));router[_0x7398('0xb')]('/',auth[_0x7398('0xc')](),controller[_0x7398('0xd')]);router[_0x7398('0xb')]('/describe',auth[_0x7398('0xc')](),controller[_0x7398('0xe')]);router[_0x7398('0xb')](_0x7398('0xf'),auth[_0x7398('0xc')](),controller[_0x7398('0x10')]);router[_0x7398('0x11')]('/',auth[_0x7398('0xc')](),controller[_0x7398('0x12')]);router[_0x7398('0x13')](_0x7398('0xf'),auth['isAuthenticated'](),controller[_0x7398('0x14')]);router[_0x7398('0x15')](_0x7398('0xf'),auth[_0x7398('0xc')](),controller[_0x7398('0x16')]);module[_0x7398('0x17')]=router; \ No newline at end of file +var _0xbd7b=['/describe','/:id','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index'];(function(_0x142733,_0x19bf15){var _0xd17009=function(_0x1db652){while(--_0x1db652){_0x142733['push'](_0x142733['shift']());}};_0xd17009(++_0x19bf15);}(_0xbd7b,0x10c));var _0xbbd7=function(_0x5303a2,_0x49716b){_0x5303a2=_0x5303a2-0x0;var _0x448ac5=_0xbd7b[_0x5303a2];return _0x448ac5;};'use strict';var multer=require(_0xbbd7('0x0'));var util=require('util');var path=require(_0xbbd7('0x1'));var timeout=require(_0xbbd7('0x2'));var express=require(_0xbbd7('0x3'));var router=express[_0xbbd7('0x4')]();var fs_extra=require(_0xbbd7('0x5'));var auth=require(_0xbbd7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbbd7('0x7'));var controller=require(_0xbbd7('0x8'));router[_0xbbd7('0x9')]('/',auth[_0xbbd7('0xa')](),controller[_0xbbd7('0xb')]);router[_0xbbd7('0x9')](_0xbbd7('0xc'),auth[_0xbbd7('0xa')](),controller['describe']);router[_0xbbd7('0x9')](_0xbbd7('0xd'),auth[_0xbbd7('0xa')](),controller['show']);router[_0xbbd7('0xe')]('/',auth[_0xbbd7('0xa')](),controller[_0xbbd7('0xf')]);router[_0xbbd7('0x10')](_0xbbd7('0xd'),auth[_0xbbd7('0xa')](),controller['update']);router[_0xbbd7('0x11')](_0xbbd7('0xd'),auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x12')]);module[_0xbbd7('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index dea571f..97fc5e1 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 _0xa8d3=['squared','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Thanks\x20you\x20for\x20your\x20time!','star','thumb','stringify','input','name','text','getDataValue','parse','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Skip','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xa8d3,0x15b));var _0x3a8d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xa8d3[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x3a8d('0x0'));var rs=require(_0x3a8d('0x1'));module[_0x3a8d('0x2')]={'name':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'unique':_0x3a8d('0x4')},'description':{'type':Sequelize[_0x3a8d('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x5')},'mapKeyOffline':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x5')},'key':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3a8d('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3a8d('0x3')]},'animation':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3a8d('0xb')](_0x3a8d('0xc'),_0x3a8d('0xd')),'defaultValue':_0x3a8d('0xc')},'header_online':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0xe')},'download_transcript':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3a8d('0x10')]},'closingQuestion':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x13')},'closingMessageButton':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x3a8d('0xb')](_0x3a8d('0x14'),_0x3a8d('0x15')),'defaultValue':_0x3a8d('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3a8d('0x16')]({'items':[{'type':_0x3a8d('0x17'),'variable':null,'config':{'placeholder':_0x3a8d('0x18'),'type':_0x3a8d('0x19'),'required':!![]},'props':{'title':_0x3a8d('0x18'),'helpText':''}},{'type':_0x3a8d('0x17'),'props':{'title':_0x3a8d('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3a8d('0x5'),'type':_0x3a8d('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3a8d('0x1a')]('onlineForm')?JSON[_0x3a8d('0x1b')](this['getDataValue'](_0x3a8d('0x1c'))):{};},'set':function(_0xaf5085){return this[_0x3a8d('0x1d')](_0x3a8d('0x1c'),JSON[_0x3a8d('0x16')](_0xaf5085));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3a8d('0x16')]({'items':[{'type':_0x3a8d('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x3a8d('0x5'),'type':_0x3a8d('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x3a8d('0x1e')},'props':{'title':_0x3a8d('0x1e'),'helpText':_0x3a8d('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x3a8d('0x1a')](_0x3a8d('0x20'))?JSON['parse'](this[_0x3a8d('0x1a')](_0x3a8d('0x20'))):{};},'set':function(_0x474cbe){return this['setDataValue']('offlineForm',JSON['stringify'](_0x474cbe));}},'token':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3a8d('0x3')]},'waitingTitle':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x21')},'waitingMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x22')},'offlineMessageBody':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x23')},'sendUnmanaged':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x24')},'enableCustomerAttachment':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3a8d('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3a8d('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3a8d('0x10')],'defaultValue':function(){return _0x3a8d('0x25');}},'notificationSound':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3a8d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x26')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x27')},'defaultTitle':{'type':Sequelize[_0x3a8d('0x3')]},'customerAvatar':{'type':Sequelize[_0x3a8d('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3a8d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x29')},'systemAvatar':{'type':Sequelize[_0x3a8d('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3a8d('0x9')],'comment':_0x3a8d('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![],'comment':_0x3a8d('0x2b'),'set':function(_0xd6615d){if(!_0xd6615d)this[_0x3a8d('0x1d')](_0x3a8d('0x2c'),null);this[_0x3a8d('0x1d')]('mandatoryDisposition',_0xd6615d);}},'vidaooEscalation':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3a8d('0x3')]},'vidaooTopic':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x3a8d('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3a8d('0x10')]}}; \ No newline at end of file +var _0x5542=['All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Type\x20a\x20message','Skip','star','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate'];(function(_0x417955,_0x4ed8c8){var _0x3a94ef=function(_0xa3a38d){while(--_0xa3a38d){_0x417955['push'](_0x417955['shift']());}};_0x3a94ef(++_0x4ed8c8);}(_0x5542,0xcf));var _0x2554=function(_0x2a557a,_0x585b4a){_0x2a557a=_0x2a557a-0x0;var _0x439f83=_0x5542[_0x2a557a];return _0x439f83;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x2554('0x0'));module[_0x2554('0x1')]={'name':{'type':Sequelize[_0x2554('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'unique':_0x2554('0x3')},'description':{'type':Sequelize[_0x2554('0x2')]},'mapKey':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x4')},'mapKeyOffline':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x4')},'key':{'type':Sequelize[_0x2554('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2554('0x5')},'customerAlias':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2554('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':_0x2554('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':_0x2554('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2554('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2554('0x2')]},'animation':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2554('0xa')](_0x2554('0xb'),_0x2554('0xc')),'defaultValue':_0x2554('0xb')},'header_online':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0xd')},'offline_chat_button':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0xe')},'header_offline':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2554('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x2554('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2554('0x10')]},'closingQuestion':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x11')},'noteTitle':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x13')},'conditionAgreement':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x2554('0xa')](_0x2554('0x14'),'thumb'),'defaultValue':_0x2554('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x2554('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2554('0x10')],'defaultValue':function(){return JSON[_0x2554('0x15')]({'items':[{'type':_0x2554('0x16'),'variable':null,'config':{'placeholder':_0x2554('0x17'),'type':'text','required':!![]},'props':{'title':_0x2554('0x17'),'helpText':''}},{'type':'input','props':{'title':_0x2554('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x2554('0x4'),'type':_0x2554('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2554('0x18')](_0x2554('0x19'))?JSON[_0x2554('0x1a')](this[_0x2554('0x18')](_0x2554('0x19'))):{};},'set':function(_0x4d650b){return this[_0x2554('0x1b')](_0x2554('0x19'),JSON['stringify'](_0x4d650b));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x2554('0x15')]({'items':[{'type':_0x2554('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x2554('0x4'),'type':_0x2554('0x4')},'variable':null},{'type':_0x2554('0x1c'),'config':{'placeholder':_0x2554('0x1d')},'props':{'title':'Comments','helpText':_0x2554('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x2554('0x18')](_0x2554('0x1f'))?JSON[_0x2554('0x1a')](this[_0x2554('0x18')]('offlineForm')):{};},'set':function(_0xa98fb1){return this[_0x2554('0x1b')](_0x2554('0x1f'),JSON[_0x2554('0x15')](_0xa98fb1));}},'token':{'type':Sequelize[_0x2554('0x2')],'defaultValue':function(){return rs[_0x2554('0x20')]();}},'autoclose':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2554('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2554('0x2')]},'waitingTitle':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x21')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2554('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x23')},'offlineMessageBody':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x25')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2554('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2554('0x10')],'defaultValue':function(){return _0x2554('0x26');}},'notificationSound':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2554('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x27')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x28')},'messagesAlignment':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x29')},'defaultTitle':{'type':Sequelize[_0x2554('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2554('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':_0x2554('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2554('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x2b')},'systemAvatar':{'type':Sequelize[_0x2554('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2554('0x8')],'comment':_0x2554('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2554('0x2d'),'set':function(_0x181292){if(!_0x181292)this[_0x2554('0x1b')]('mandatoryDispositionPauseId',null);this[_0x2554('0x1b')]('mandatoryDisposition',_0x181292);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2554('0x2')]},'vidaooTopic':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':_0x2554('0x2e')},'vidaooNote':{'type':Sequelize[_0x2554('0x2')],'defaultValue':function(){return _0x2554('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x2554('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2554('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index c450796..d66a8a1 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 _0x9944=['notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','getProactiveActions','License','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.5.0','x-real-ip','connection','virtual','replace','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','stack','finally','getApplications','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','mustache','path','ejs','lodash','querystring','html-to-text','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','handleError','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','name','Command','getSnippet','timezone','format','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','No\x20timezone','inspect','map','Interval','all','some','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','fieldName','key','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','ChatWebsite','includeAll','include','findAll','rows','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','pick','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','headers','threadId','ChatInteraction','externalUrl','interaction','contact','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','files','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount'];(function(_0x32b9c5,_0x1c165d){var _0x589f31=function(_0x2e2ddf){while(--_0x2e2ddf){_0x32b9c5['push'](_0x32b9c5['shift']());}};_0x589f31(++_0x1c165d);}(_0x9944,0x16e));var _0x4994=function(_0xae32a4,_0x4d8d00){_0xae32a4=_0xae32a4-0x0;var _0x43d4f7=_0x9944[_0xae32a4];return _0x43d4f7;};'use strict';var Mustache=require(_0x4994('0x0'));var util=require('util');var path=require(_0x4994('0x1'));var ejs=require(_0x4994('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4994('0x3'));var querystring=require(_0x4994('0x4'));var htmlToText=require(_0x4994('0x5'));var Redis=require('ioredis');var jayson=require(_0x4994('0x6'));var url=require(_0x4994('0x7'));var qs=require(_0x4994('0x8'));var logger=require(_0x4994('0x9'))(_0x4994('0xa'));var config=require(_0x4994('0xb'));var APIOutOfIntervalError=require('../../errors/api')['APIOutOfIntervalError'];var APINotFoundError=require(_0x4994('0xc'))['APINotFoundError'];var APIHandleError=require('../../errors/api')[_0x4994('0xd')];var db=require(_0x4994('0xe'))['db'];config[_0x4994('0xf')]=_[_0x4994('0x10')](config[_0x4994('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x4994('0x11'))(new Redis(config[_0x4994('0xf')]));require(_0x4994('0x12'))[_0x4994('0x13')](socket);var client=jayson[_0x4994('0x14')][_0x4994('0x15')]({'port':0x232c});var client9002=jayson[_0x4994('0x14')][_0x4994('0x15')]({'port':0x232a});var client9003=jayson[_0x4994('0x14')][_0x4994('0x15')]({'port':0x232b});var client9001=jayson[_0x4994('0x14')]['http']({'port':0x2329});function respondWithRpcPromise(_0x26b9fe,_0x5ea1ec,_0x4ad064,_0x1436e1){return new Promise(function(_0x4ae812,_0x36724e){var _0x16e75b=_0x1436e1||client;return _0x16e75b[_0x4994('0x16')](_0x26b9fe,_0x4ad064)[_0x4994('0x17')](function(_0x211cb0){logger[_0x4994('0x18')](_0x4994('0x19'),_0x5ea1ec,_0x4994('0x1a'));logger[_0x4994('0x1b')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5ea1ec,_0x4994('0x1a'),JSON[_0x4994('0x1c')](_0x211cb0));if(_0x211cb0[_0x4994('0x1d')]){if(_0x211cb0['error']['code']===0x1f4){logger['error'](_0x4994('0x19'),_0x5ea1ec,_0x211cb0['error'][_0x4994('0x1e')]);return _0x36724e(_0x211cb0[_0x4994('0x1d')][_0x4994('0x1e')]);}logger[_0x4994('0x1d')](_0x4994('0x19'),_0x5ea1ec,_0x211cb0[_0x4994('0x1d')][_0x4994('0x1e')]);return _0x4ae812(_0x211cb0[_0x4994('0x1d')][_0x4994('0x1e')]);}else{logger[_0x4994('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x5ea1ec,_0x4994('0x1a'));_0x4ae812(_0x211cb0[_0x4994('0x1f')][_0x4994('0x1e')]);}})[_0x4994('0x20')](function(_0x6f2734){logger[_0x4994('0x1d')](_0x4994('0x19'),_0x5ea1ec,_0x6f2734);_0x36724e(_0x6f2734);});});}function respondWithStatusCode(_0x5d872c,_0x336b14){_0x336b14=_0x336b14||0xcc;return function(_0x31d249){if(_0x31d249){return _0x5d872c[_0x4994('0x21')](_0x336b14);}return _0x5d872c[_0x4994('0x22')](_0x336b14)[_0x4994('0x23')]();};}function respondWithResult(_0x521c10,_0xf0890){_0xf0890=_0xf0890||0xc8;return function(_0x250472){if(_0x250472){return _0x521c10[_0x4994('0x22')](_0xf0890)['json'](_0x250472);}};}function respondWithFilteredResult(_0x158fe8,_0x2ae073){return function(_0x1cd7c3){if(_0x1cd7c3){var _0x1b3826=typeof _0x2ae073[_0x4994('0x24')]===_0x4994('0x25')&&typeof _0x2ae073[_0x4994('0x26')]===_0x4994('0x25');var _0x279aab=_0x1cd7c3[_0x4994('0x27')];var _0x5d0492=_0x1b3826?0x0:_0x2ae073[_0x4994('0x24')];var _0x22b525=_0x1b3826?_0x1cd7c3[_0x4994('0x27')]:_0x2ae073[_0x4994('0x24')]+_0x2ae073[_0x4994('0x26')];var _0x5c8195;if(_0x22b525>=_0x279aab){_0x22b525=_0x279aab;_0x5c8195=0xc8;}else{_0x5c8195=0xce;}_0x158fe8['status'](_0x5c8195);return _0x158fe8[_0x4994('0x28')](_0x4994('0x29'),_0x5d0492+'-'+_0x22b525+'/'+_0x279aab)[_0x4994('0x2a')](_0x1cd7c3);}return null;};}function saveUpdates(_0x408a03){return function(_0x252ac8){if(_0x252ac8){return _0x252ac8[_0x4994('0x2b')](_0x408a03)['then'](function(_0x5d4f80){return _0x5d4f80;});}return null;};}function removeEntity(_0x1ec75a){return function(_0x30a7eb){if(_0x30a7eb){return _0x30a7eb[_0x4994('0x2c')]()[_0x4994('0x17')](function(){var _0x1ac13a=_0x30a7eb[_0x4994('0x2d')]({'plain':!![]});var _0x1e90ea=_0x4994('0x2e');return db[_0x4994('0x2f')]['destroy']({'where':{'type':_0x1e90ea,'resourceId':_0x1ac13a['id']}})[_0x4994('0x17')](function(){return _0x30a7eb;});})[_0x4994('0x17')](function(){_0x1ec75a[_0x4994('0x22')](0xcc)[_0x4994('0x23')]();});}};}function handleEntityNotFound(_0x513cd3){return function(_0x2b40a6){if(!_0x2b40a6){_0x513cd3['sendStatus'](0x194);}return _0x2b40a6;};}function handleError(_0x3431d2,_0x918041){_0x918041=_0x918041||0x1f4;return function(_0x357543){logger[_0x4994('0x1d')](_0x357543['stack']);if(_0x357543[_0x4994('0x30')]){delete _0x357543[_0x4994('0x30')];}_0x3431d2[_0x4994('0x22')](_0x918041)['send'](_0x357543);};}function iftimePromise(_0x59f43d,_0x478e6b){return respondWithRpcPromise(_0x4994('0x31'),_0x4994('0x32'),{'command':_0x478e6b[_0x4994('0x33')]?util[_0x4994('0x34')]('iftime\x20%s,%s',_0x59f43d['interval'],_0x478e6b[_0x4994('0x33')]):util[_0x4994('0x34')](_0x4994('0x35'),_0x59f43d['interval'])},client9002)[_0x4994('0x17')](function(_0x507f7b){var _0x198b64=_0x507f7b&&_0x507f7b[_0x4994('0x36')]('true')>=0x0?!![]:![];logger[_0x4994('0x18')](_0x4994('0x37'),_0x478e6b['id'],_0x59f43d['id'],_0x59f43d[_0x4994('0x38')],_0x198b64?_0x4994('0x39'):_0x4994('0x3a'),_0x478e6b[_0x4994('0x33')]?_0x478e6b[_0x4994('0x33')]:_0x4994('0x3b'));return _0x198b64;})[_0x4994('0x20')](function(_0x1ccad7){logger['error'](_0x4994('0x37'),_0x478e6b['id'],_0x59f43d['id'],_0x59f43d[_0x4994('0x38')],util[_0x4994('0x3c')](_0x1ccad7,{'showHidden':![],'depth':null}),_0x478e6b['timezone']?_0x478e6b['timezone']:_0x4994('0x3b'));return![];});}function checkWebsiteIntervals(_0x5182b0){var _0x52f334=_[_0x4994('0x3d')](_0x5182b0[_0x4994('0x3e')]['Intervals'],function(_0x1e8a2d){var _0x1bb36a=_0x1e8a2d[_0x4994('0x2d')]({'plain':!![]});return iftimePromise(_0x1bb36a,_0x5182b0);});return Promise[_0x4994('0x3f')](_0x52f334)[_0x4994('0x17')](function(_0x222d61){return _[_0x4994('0x40')](_0x222d61);});}function createInteractionObject(_0x11766c,_0x342876,_0x40ac64,_0x154a53){var _0x215dff=require(_0x4994('0x41'));var _0x1ae37d=new _0x215dff();var _0x298932=_0x1ae37d[_0x4994('0x42')](_0x40ac64['user-agent'])[_0x4994('0x43')]();var _0x24e263=_0x342876[_0x4994('0x44')];if(_0x40ac64[_0x4994('0x45')]){_0x24e263=_0x40ac64[_0x4994('0x45')];}else if(_0x40ac64[_0x4994('0x46')]){_0x24e263=_[_0x4994('0x47')](_0x40ac64[_0x4994('0x46')][_0x4994('0x48')](','));}return{'ContactId':_0x154a53['id'],'ChatWebsiteId':_0x11766c,'from':(_0x154a53[_0x4994('0x49')]||'')+'\x20'+(_0x154a53['lastName']||''),'customerIp':_0x24e263,'customerPort':_0x40ac64[_0x4994('0x4a')]?_0x40ac64['x-real-port']:null,'referer':_0x342876[_0x4994('0x4b')],'browserName':_0x298932['browser'][_0x4994('0x30')]&&_0x298932[_0x4994('0x4c')][_0x4994('0x4d')]?util['format'](_0x4994('0x4e'),_0x298932['browser']['name'],_0x298932['browser'][_0x4994('0x4d')]):_0x4994('0x4f'),'browserVersion':_0x298932['browser']['version']||_0x4994('0x4f'),'osName':util[_0x4994('0x34')](_0x4994('0x4e'),_0x298932['os'][_0x4994('0x30')],_0x298932['os']['version']),'osVersion':_0x298932['os'][_0x4994('0x4d')],'deviceModel':_0x298932[_0x4994('0x50')][_0x4994('0x51')]&&_0x298932['device'][_0x4994('0x52')]?util[_0x4994('0x34')](_0x4994('0x53'),_0x298932['device'][_0x4994('0x51')],_0x298932[_0x4994('0x50')][_0x4994('0x52')],_0x298932[_0x4994('0x50')][_0x4994('0x54')]):null,'deviceVendor':_0x298932[_0x4994('0x50')][_0x4994('0x52')],'deviceType':_0x298932['device'][_0x4994('0x54')],'formData':JSON[_0x4994('0x1c')](_0x342876)};}exports[_0x4994('0x55')]=function(_0x3da4f4,_0x7cd695){var _0x23d2f0={'include':[{'model':db[_0x4994('0x56')],'as':_0x4994('0x57')}]},_0x39193d={},_0x2db1b2={'count':0x0,'rows':[]};var _0x115d7d=_[_0x4994('0x3d')](db['ChatWebsite']['rawAttributes'],function(_0x54cfe3){return{'name':_0x54cfe3[_0x4994('0x58')],'type':_0x54cfe3['type'][_0x4994('0x59')]};});_0x39193d[_0x4994('0x51')]=_['map'](_0x115d7d,'name');_0x39193d[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x3da4f4['query']);_0x39193d[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x39193d[_0x4994('0x51')],_0x39193d['query']);_0x23d2f0['attributes']=_['intersection'](_0x39193d['model'],qs[_0x4994('0x5e')](_0x3da4f4['query'][_0x4994('0x5e')]));_0x23d2f0[_0x4994('0x5f')]=_0x23d2f0[_0x4994('0x5f')][_0x4994('0x60')]?_0x23d2f0[_0x4994('0x5f')]:_0x39193d['model'];if(!_0x3da4f4[_0x4994('0x5a')]['hasOwnProperty']('nolimit')){_0x23d2f0[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x3da4f4['query'][_0x4994('0x26')]);_0x23d2f0[_0x4994('0x24')]=qs[_0x4994('0x24')](_0x3da4f4[_0x4994('0x5a')][_0x4994('0x24')]);}_0x23d2f0[_0x4994('0x61')]=qs['sort'](_0x3da4f4['query'][_0x4994('0x62')]);_0x23d2f0[_0x4994('0x63')]=qs['filters'](_['pick'](_0x3da4f4['query'],_0x39193d[_0x4994('0x5c')]),_0x115d7d);if(_0x3da4f4['query'][_0x4994('0x64')]){_0x23d2f0[_0x4994('0x63')]=_[_0x4994('0x65')](_0x23d2f0['where'],{'$or':_[_0x4994('0x3d')](_0x115d7d,function(_0x3d18e1){if(_0x3d18e1['type']!=='VIRTUAL'){var _0xb5845d={};_0xb5845d[_0x3d18e1[_0x4994('0x30')]]={'$like':'%'+_0x3da4f4[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0xb5845d;}})});}_0x23d2f0=_[_0x4994('0x65')]({},_0x23d2f0,_0x3da4f4['options']);var _0x4ebba7={'where':_0x23d2f0['where']};return db[_0x4994('0x66')][_0x4994('0x27')](_0x4ebba7)[_0x4994('0x17')](function(_0x20e102){_0x2db1b2[_0x4994('0x27')]=_0x20e102;if(_0x3da4f4['query'][_0x4994('0x67')]){_0x23d2f0[_0x4994('0x68')]=[{'all':!![]}];}return db['ChatWebsite'][_0x4994('0x69')](_0x23d2f0);})['then'](function(_0x191699){_0x2db1b2[_0x4994('0x6a')]=_0x191699;return _0x2db1b2;})[_0x4994('0x17')](respondWithFilteredResult(_0x7cd695,_0x23d2f0))['catch'](handleError(_0x7cd695,null));};exports['show']=function(_0x52d8e4,_0x3105db){var _0x59c7a4={'raw':![],'where':{'id':_0x52d8e4[_0x4994('0x6b')]['id']},'include':[{'model':db[_0x4994('0x56')],'as':_0x4994('0x57')}]},_0x2361e5={};_0x2361e5[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0x66')][_0x4994('0x6c')]);_0x2361e5[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x52d8e4[_0x4994('0x5a')]);_0x2361e5[_0x4994('0x5c')]=_['intersection'](_0x2361e5['model'],_0x2361e5[_0x4994('0x5a')]);_0x59c7a4[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x2361e5[_0x4994('0x51')],qs['fields'](_0x52d8e4[_0x4994('0x5a')][_0x4994('0x5e')]));_0x59c7a4[_0x4994('0x5f')]=_0x59c7a4[_0x4994('0x5f')][_0x4994('0x60')]?_0x59c7a4[_0x4994('0x5f')]:_0x2361e5[_0x4994('0x51')];if(_0x52d8e4['query'][_0x4994('0x67')]){_0x59c7a4['include']=[{'all':!![]}];}_0x59c7a4=_[_0x4994('0x65')]({},_0x59c7a4,_0x52d8e4['options']);return db['ChatWebsite']['find'](_0x59c7a4)[_0x4994('0x17')](handleEntityNotFound(_0x3105db,null))[_0x4994('0x17')](respondWithResult(_0x3105db,null))[_0x4994('0x20')](handleError(_0x3105db,null));};exports[_0x4994('0x6d')]=function(_0x473d68,_0x2279f6){return db[_0x4994('0x66')][_0x4994('0x6d')](_0x473d68[_0x4994('0x6e')],{})[_0x4994('0x17')](function(_0x4b9095){var _0x24eaff=_0x473d68[_0x4994('0x6f')][_0x4994('0x2d')]({'plain':!![]});if(!_0x24eaff)throw new Error(_0x4994('0x70'));if(_0x24eaff[_0x4994('0x71')]===_0x4994('0x6f')){var _0x55b8c4=_0x4b9095[_0x4994('0x2d')]({'plain':!![]});var _0x21b622=_0x4994('0x2e');return db[_0x4994('0x72')]['find']({'where':{'name':_0x21b622,'userProfileId':_0x24eaff['userProfileId']},'raw':!![]})[_0x4994('0x17')](function(_0x3362c7){if(_0x3362c7&&_0x3362c7[_0x4994('0x73')]===0x0){return db[_0x4994('0x2f')][_0x4994('0x6d')]({'name':_0x55b8c4[_0x4994('0x30')],'resourceId':_0x55b8c4['id'],'type':_0x3362c7['name'],'sectionId':_0x3362c7['id']},{})[_0x4994('0x17')](function(){return _0x4b9095;});}else{return _0x4b9095;}})[_0x4994('0x20')](function(_0xd8762f){logger[_0x4994('0x1d')](_0x4994('0x74'),_0xd8762f);throw _0xd8762f;});}return _0x4b9095;})[_0x4994('0x17')](respondWithResult(_0x2279f6,0xc9))[_0x4994('0x20')](handleError(_0x2279f6,null));};exports['update']=function(_0x40b194,_0xad7d04){if(_0x40b194[_0x4994('0x6e')]['id']){delete _0x40b194[_0x4994('0x6e')]['id'];}return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x40b194['params']['id']},'include':[{'model':db[_0x4994('0x56')],'as':_0x4994('0x57')}]})[_0x4994('0x17')](handleEntityNotFound(_0xad7d04,null))[_0x4994('0x17')](saveUpdates(_0x40b194[_0x4994('0x6e')],null))['then'](respondWithResult(_0xad7d04,null))[_0x4994('0x20')](handleError(_0xad7d04,null));};exports[_0x4994('0x2c')]=function(_0x471a01,_0x401046){return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x471a01[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x401046,null))[_0x4994('0x17')](removeEntity(_0x401046,null))[_0x4994('0x20')](handleError(_0x401046,null));};exports[_0x4994('0x76')]=function(_0xd66338,_0x308030){return db['ChatWebsite'][_0x4994('0x76')]()[_0x4994('0x17')](respondWithResult(_0x308030,null))[_0x4994('0x20')](handleError(_0x308030,null));};exports['addDisposition']=function(_0x4399a9,_0x5d4e70){if(_0x4399a9[_0x4994('0x6e')]['id']){delete _0x4399a9[_0x4994('0x6e')]['id'];}return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x4399a9[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x5d4e70,null))[_0x4994('0x17')](function(_0x3a8261){if(_0x3a8261){_0x4399a9['body'][_0x4994('0x77')]=_0x3a8261['id'];return db[_0x4994('0x78')][_0x4994('0x6d')](_0x4399a9[_0x4994('0x6e')]);}})['then'](respondWithResult(_0x5d4e70,null))[_0x4994('0x20')](handleError(_0x5d4e70,null));};exports[_0x4994('0x79')]=function(_0x3761c0,_0x22aa0f){var _0x2c9884={'raw':![],'where':{}};var _0x5ef0c0={};var _0x1363b7={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x3761c0['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x22aa0f,null))[_0x4994('0x17')](function(_0x414f94){if(_0x414f94){_0x5ef0c0[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0x78')][_0x4994('0x6c')]);_0x5ef0c0[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x3761c0['query']);_0x5ef0c0[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x5ef0c0['model'],_0x5ef0c0[_0x4994('0x5a')]);_0x2c9884[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x5ef0c0[_0x4994('0x51')],qs[_0x4994('0x5e')](_0x3761c0[_0x4994('0x5a')]['fields']));_0x2c9884[_0x4994('0x5f')]=_0x2c9884['attributes'][_0x4994('0x60')]?_0x2c9884[_0x4994('0x5f')]:_0x5ef0c0[_0x4994('0x51')];if(!_0x3761c0[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x2c9884[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x3761c0[_0x4994('0x5a')][_0x4994('0x26')]);_0x2c9884[_0x4994('0x24')]=qs['offset'](_0x3761c0[_0x4994('0x5a')][_0x4994('0x24')]);}_0x2c9884[_0x4994('0x61')]=qs['sort'](_0x3761c0[_0x4994('0x5a')][_0x4994('0x62')]);_0x2c9884[_0x4994('0x63')]=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0x3761c0['query'],_0x5ef0c0[_0x4994('0x5c')]));_0x2c9884['where'][_0x4994('0x77')]=_0x414f94['id'];if(_0x3761c0[_0x4994('0x5a')][_0x4994('0x64')]){_0x2c9884[_0x4994('0x63')]=_['merge'](_0x2c9884[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x2c9884[_0x4994('0x5f')],function(_0x588162){var _0x277f76={};_0x277f76[_0x588162]={'$like':'%'+_0x3761c0[_0x4994('0x5a')]['filter']+'%'};return _0x277f76;})});}_0x2c9884=_[_0x4994('0x65')]({},_0x2c9884,_0x3761c0[_0x4994('0x7e')]);return db[_0x4994('0x78')][_0x4994('0x27')]({'where':_0x2c9884[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x42095c){_0x1363b7['count']=_0x42095c;if(_0x3761c0[_0x4994('0x5a')][_0x4994('0x67')]){_0x2c9884[_0x4994('0x68')]=[{'all':!![]}];}return db['Disposition'][_0x4994('0x69')](_0x2c9884);})[_0x4994('0x17')](function(_0x43551b){_0x1363b7['rows']=_0x43551b;return _0x1363b7;});}})[_0x4994('0x17')](respondWithFilteredResult(_0x22aa0f,_0x2c9884))[_0x4994('0x20')](handleError(_0x22aa0f,null));};exports[_0x4994('0x7f')]=function(_0x36108f,_0x327513){return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x36108f[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x327513,null))[_0x4994('0x17')](function(_0x1c22f4){if(_0x1c22f4){return _0x1c22f4[_0x4994('0x7f')](_0x36108f[_0x4994('0x5a')][_0x4994('0x80')]);}})[_0x4994('0x17')](respondWithStatusCode(_0x327513,null))[_0x4994('0x20')](handleError(_0x327513,null));};exports[_0x4994('0x81')]=function(_0x171a61,_0x3f69f0){if(_0x171a61[_0x4994('0x6e')]['id']){delete _0x171a61[_0x4994('0x6e')]['id'];}return db[_0x4994('0x66')]['find']({'where':{'id':_0x171a61[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x3f69f0,null))[_0x4994('0x17')](function(_0x1eb162){if(_0x1eb162){_0x171a61[_0x4994('0x6e')][_0x4994('0x77')]=_0x1eb162['id'];return db[_0x4994('0x82')][_0x4994('0x6d')](_0x171a61[_0x4994('0x6e')]);}})[_0x4994('0x17')](respondWithResult(_0x3f69f0,null))['catch'](handleError(_0x3f69f0,null));};exports[_0x4994('0x83')]=function(_0x42cdd6,_0x4fb9ef){var _0x10cffe={'raw':![],'where':{}};var _0x2cd432={};var _0x5e3285={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x42cdd6[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x4fb9ef,null))[_0x4994('0x17')](function(_0x1366e3){if(_0x1366e3){_0x2cd432[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0x82')][_0x4994('0x6c')]);_0x2cd432['query']=_[_0x4994('0x5b')](_0x42cdd6[_0x4994('0x5a')]);_0x2cd432['filters']=_['intersection'](_0x2cd432[_0x4994('0x51')],_0x2cd432['query']);_0x10cffe[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x2cd432['model'],qs[_0x4994('0x5e')](_0x42cdd6[_0x4994('0x5a')]['fields']));_0x10cffe['attributes']=_0x10cffe['attributes'][_0x4994('0x60')]?_0x10cffe['attributes']:_0x2cd432[_0x4994('0x51')];if(!_0x42cdd6[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x10cffe[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x42cdd6[_0x4994('0x5a')][_0x4994('0x26')]);_0x10cffe['offset']=qs[_0x4994('0x24')](_0x42cdd6[_0x4994('0x5a')][_0x4994('0x24')]);}_0x10cffe[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x42cdd6[_0x4994('0x5a')][_0x4994('0x62')]);_0x10cffe[_0x4994('0x63')]=qs[_0x4994('0x5c')](_['pick'](_0x42cdd6['query'],_0x2cd432['filters']));_0x10cffe[_0x4994('0x63')][_0x4994('0x77')]=_0x1366e3['id'];if(_0x42cdd6[_0x4994('0x5a')]['filter']){_0x10cffe['where']=_[_0x4994('0x65')](_0x10cffe[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x10cffe['attributes'],function(_0x3a9a79){var _0x3deb9d={};_0x3deb9d[_0x3a9a79]={'$like':'%'+_0x42cdd6[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x3deb9d;})});}_0x10cffe=_['merge']({},_0x10cffe,_0x42cdd6[_0x4994('0x7e')]);return db[_0x4994('0x82')][_0x4994('0x27')]({'where':_0x10cffe[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x9329b7){_0x5e3285[_0x4994('0x27')]=_0x9329b7;if(_0x42cdd6[_0x4994('0x5a')][_0x4994('0x67')]){_0x10cffe[_0x4994('0x68')]=[{'all':!![]}];}return db[_0x4994('0x82')][_0x4994('0x69')](_0x10cffe);})[_0x4994('0x17')](function(_0x5cea1b){_0x5e3285[_0x4994('0x6a')]=_0x5cea1b;return _0x5e3285;});}})[_0x4994('0x17')](respondWithFilteredResult(_0x4fb9ef,_0x10cffe))[_0x4994('0x20')](handleError(_0x4fb9ef,null));};exports[_0x4994('0x84')]=function(_0xd9865,_0x7269f9){return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0xd9865[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x7269f9,null))[_0x4994('0x17')](function(_0x5ef3b7){if(_0x5ef3b7){return _0x5ef3b7['removeAnswers'](_0xd9865['query']['ids']);}})[_0x4994('0x17')](respondWithStatusCode(_0x7269f9,null))[_0x4994('0x20')](handleError(_0x7269f9,null));};exports[_0x4994('0x85')]=function(_0x73a51c,_0xef88f4){_0x73a51c[_0x4994('0x6e')][_0x4994('0x86')]=_0x73a51c[_0x4994('0x87')][_0x4994('0x88')];return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x73a51c[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0xef88f4,null))[_0x4994('0x17')](saveUpdates(_0x73a51c[_0x4994('0x6e')],null))[_0x4994('0x17')](respondWithResult(_0xef88f4,null))['catch'](handleError(_0xef88f4,null));};exports[_0x4994('0x89')]=function(_0x2c672d,_0x49a131){_0x2c672d[_0x4994('0x6e')]['agentAvatar']=_0x2c672d[_0x4994('0x87')][_0x4994('0x88')];return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x2c672d['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x49a131,null))['then'](saveUpdates(_0x2c672d['body'],null))[_0x4994('0x17')](respondWithResult(_0x49a131,null))[_0x4994('0x20')](handleError(_0x49a131,null));};exports['addCustomerAvatar']=function(_0xb62458,_0x3ae9f5){_0xb62458['body'][_0x4994('0x8a')]=_0xb62458[_0x4994('0x87')][_0x4994('0x88')];return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0xb62458['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x3ae9f5,null))[_0x4994('0x17')](saveUpdates(_0xb62458[_0x4994('0x6e')],null))['then'](respondWithResult(_0x3ae9f5,null))['catch'](handleError(_0x3ae9f5,null));};exports[_0x4994('0x8b')]=function(_0x4efb77,_0x561e7d){_0x4efb77[_0x4994('0x6e')][_0x4994('0x8c')]=_0x4efb77[_0x4994('0x87')][_0x4994('0x88')];return db[_0x4994('0x66')]['find']({'where':{'id':_0x4efb77[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x561e7d,null))['then'](saveUpdates(_0x4efb77['body'],null))['then'](respondWithResult(_0x561e7d,null))[_0x4994('0x20')](handleError(_0x561e7d,null));};exports[_0x4994('0x8d')]=function(_0x454649,_0x102206){var _0x32792f=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x90'));var _0xd61309={'where':{'id':_0x454649[_0x4994('0x6b')]['id']},'attributes':['id',_0x4994('0x86')],'raw':!![]};var _0xa0eb0=![];return require(_0x4994('0x91'))[_0x4994('0x92')]()[_0x4994('0x17')](function(_0x5460b9){if(_0x5460b9){_0xa0eb0=_0x5460b9[_0x4994('0x93')];}})[_0x4994('0x17')](function(){return db[_0x4994('0x66')]['find'](_0xd61309);})['then'](handleEntityNotFound(_0x102206,null))[_0x4994('0x17')](function(_0x52233b){if(_0x52233b){if(!_[_0x4994('0x94')](_0x52233b['sitepic'])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x96'),_0x52233b['sitepic']))&&_0xa0eb0){_0x32792f=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x96'),_0x52233b[_0x4994('0x86')]);}}return _0x102206[_0x4994('0x97')](_0x32792f);}})[_0x4994('0x20')](handleError(_0x102206,null));};exports['getAvatar']=function(_0x1669d0,_0x158bb8){var _0x3d7f3b=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x98'));var _0x33974e={'where':{'id':_0x1669d0[_0x4994('0x6b')]['id']},'attributes':['id',_0x4994('0x99')],'raw':!![]};return db[_0x4994('0x66')][_0x4994('0x75')](_0x33974e)[_0x4994('0x17')](handleEntityNotFound(_0x158bb8,null))['then'](function(_0x40c2b5){if(_0x40c2b5){if(!_[_0x4994('0x94')](_0x40c2b5[_0x4994('0x99')])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config['root'],_0x4994('0x9a'),_0x40c2b5[_0x4994('0x99')]))){_0x3d7f3b=path['join'](config['root'],_0x4994('0x9a'),_0x40c2b5[_0x4994('0x99')]);}}return _0x158bb8['download'](_0x3d7f3b);}})['catch'](handleError(_0x158bb8,null));};exports['getCustomerAvatar']=function(_0x2a7dfa,_0x13d3ba){var _0x819237=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x9b'));var _0x45f61a={'where':{'id':_0x2a7dfa[_0x4994('0x6b')]['id']},'attributes':['id','customerAvatar',_0x4994('0x9c')],'raw':!![]};return db['ChatWebsite'][_0x4994('0x75')](_0x45f61a)[_0x4994('0x17')](handleEntityNotFound(_0x13d3ba,null))['then'](function(_0x24b6b8){if(_0x24b6b8){if(!_[_0x4994('0x94')](_0x24b6b8['customerAvatar'])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x9a'),_0x24b6b8[_0x4994('0x8a')]))&&_0x24b6b8[_0x4994('0x9c')]){_0x819237=path[_0x4994('0x8e')](config['root'],_0x4994('0x9a'),_0x24b6b8[_0x4994('0x8a')]);}}return _0x13d3ba['download'](_0x819237);}})[_0x4994('0x20')](handleError(_0x13d3ba,null));};exports[_0x4994('0x9d')]=function(_0x4eeb52,_0x232253){var _0x216999=path[_0x4994('0x8e')](config['root'],_0x4994('0x9e'));var _0x1af2fc={'where':{'id':_0x4eeb52['params']['id']},'attributes':['id',_0x4994('0x8c')],'raw':!![]};return db[_0x4994('0x66')]['find'](_0x1af2fc)['then'](handleEntityNotFound(_0x232253,null))[_0x4994('0x17')](function(_0x22c959){if(_0x22c959){if(!_[_0x4994('0x94')](_0x22c959[_0x4994('0x8c')])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x9a'),_0x22c959[_0x4994('0x8c')]))){_0x216999=path[_0x4994('0x8e')](config['root'],_0x4994('0x9a'),_0x22c959[_0x4994('0x8c')]);}}return _0x232253[_0x4994('0x97')](_0x216999);}})['catch'](handleError(_0x232253,null));};exports[_0x4994('0x9f')]=function(_0x152624,_0x24c7fd){var _0x234026={'body':_0x152624[_0x4994('0x6e')],'channel':_0x4994('0xa0')};var _0x4a50f9=[];var _0x406d9e=[];var _0x11cb69={};var _0x57de26=![];return db['CmContact'][_0x4994('0x76')]()[_0x4994('0x17')](function(_0x3a21cb){if(!_0x3a21cb){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xa3'));}_0x4a50f9=_['difference'](_[_0x4994('0x5b')](_0x3a21cb),[_0x4994('0xa4'),_0x4994('0xa5')]);_0x406d9e=_[_0x4994('0xa6')](_[_0x4994('0x5b')](_0x3a21cb),[_0x4994('0xa4'),_0x4994('0xa5'),_0x4994('0xa7'),_0x4994('0xa8')]);if(_0x152624[_0x4994('0x6e')]['id']){delete _0x152624['body']['id'];}if(_[_0x4994('0x94')](_0x152624[_0x4994('0x6e')]['from'])){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('from\x20is\x20mandatory');}if(_[_0x4994('0x94')](_0x152624['body'][_0x4994('0x6e')])||_0x152624[_0x4994('0x6e')][_0x4994('0x6e')]===''){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4994('0x94')](_0x152624[_0x4994('0x6e')]['mapKey'])){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xa9')+_0x406d9e);}if(!_[_0x4994('0xaa')](_0x406d9e,_0x152624[_0x4994('0x6e')][_0x4994('0xab')])){throw new db[(_0x4994('0xa1'))]['ValidationError'](_0x4994('0xac')+_0x406d9e);}_0x11cb69[_0x152624[_0x4994('0x6e')][_0x4994('0xab')]]=_0x152624[_0x4994('0x6e')][_0x4994('0xad')];})[_0x4994('0x17')](function(){return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x152624[_0x4994('0x6b')]['id']},'include':[{'model':db[_0x4994('0xae')],'as':_0x4994('0xaf'),'include':[{'model':db[_0x4994('0xb0')],'as':_0x4994('0xb1'),'where':_0x11cb69,'limit':0x1,'order':[[_0x4994('0xa5'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x4994('0xb2')},{'model':db[_0x4994('0x3e')],'as':'Interval','include':[{'model':db[_0x4994('0x3e')],'as':_0x4994('0xb3'),'attributes':['id',_0x4994('0x38')],'raw':!![]}]}]});})[_0x4994('0x17')](function(_0x582557){if(!_0x582557)throw new APINotFoundError(util['format'](_0x4994('0xb4'),_0x152624[_0x4994('0x6b')]['id']));if(!_0x582557[_0x4994('0x3e')]||!_0x582557[_0x4994('0x3e')][_0x4994('0xb3')])return[_0x582557,!![]];return[_0x582557,checkWebsiteIntervals(_0x582557)];})[_0x4994('0xb5')](function(_0x30217c,_0x46a59e){if(!_0x46a59e)throw new APIOutOfIntervalError();if(!_0x30217c[_0x4994('0xaf')])return;_0x234026[_0x4994('0xb6')]=_0x30217c;_0x234026[_0x4994('0xb7')]=_0x30217c[_0x4994('0xaf')];_0x234026[_0x4994('0xb8')]=_[_0x4994('0xb9')](_0x30217c[_0x4994('0xb2')],[_0x4994('0xba')],[_0x4994('0xbb')]);if(_0x234026[_0x4994('0xb6')]['Applications']){delete _0x234026['account'][_0x4994('0xb2')];}if(_0x234026[_0x4994('0xb6')][_0x4994('0xaf')]&&_0x234026['account'][_0x4994('0xaf')][_0x4994('0xb1')][_0x4994('0x60')]){return _0x234026[_0x4994('0xb6')][_0x4994('0xaf')][_0x4994('0xb1')][0x0];}var _0x5ac49=_[_0x4994('0x10')](_0x152624[_0x4994('0x6e')],{'firstName':_0x152624[_0x4994('0x6e')][_0x4994('0xad')],'ListId':_0x30217c[_0x4994('0xa8')]});_0x5ac49[_0x152624[_0x4994('0x6e')][_0x4994('0xab')]]=_0x152624['body'][_0x4994('0xad')];return db[_0x4994('0xb0')]['create'](_0x5ac49,{'fields':_0x4a50f9,'raw':!![]});})['then'](function(_0x4b6843){_0x234026['contact']=_0x4b6843;var _0x33e30b=createInteractionObject(_0x152624[_0x4994('0x6b')]['id'],_0x152624[_0x4994('0x6e')],_0x152624[_0x4994('0xbc')],_0x4b6843);var _0x18ea85={'ChatWebsiteId':_0x152624[_0x4994('0x6b')]['id'],'closed':![]};if(_0x152624[_0x4994('0x6e')][_0x4994('0xbd')]){_0x18ea85['threadId']=_0x152624[_0x4994('0x6e')][_0x4994('0xbd')];return db[_0x4994('0xbe')]['find']({'where':_0x18ea85})[_0x4994('0x17')](function(_0x3b8d03){if(_0x3b8d03){_0x57de26=!![];return _0x3b8d03;}_0x33e30b[_0x4994('0xbd')]=_0x152624['body']['threadId'];_0x33e30b[_0x4994('0xbf')]=_0x152624[_0x4994('0x6e')][_0x4994('0xbf')];return db[_0x4994('0xbe')]['create'](_0x33e30b);});}_0x18ea85['ContactId']=_0x4b6843['id'];if(_0x152624[_0x4994('0x6e')][_0x4994('0xc0')]&&_0x152624[_0x4994('0x6e')][_0x4994('0xc0')]['id']){_0x18ea85['id']=_0x152624['body'][_0x4994('0xc0')]['id'];return db[_0x4994('0xbe')][_0x4994('0x75')]({'where':_0x18ea85})['then'](function(_0x29c20e){if(_0x29c20e){_0x57de26=!![];return _0x29c20e;}return db[_0x4994('0xbe')][_0x4994('0x6d')](_0x33e30b);});}return db[_0x4994('0xbe')][_0x4994('0x6d')](_0x33e30b);})['then'](function(_0x9c5e94){if(!_0x57de26)return _0x9c5e94;var _0x9905a={'from':(_0x234026[_0x4994('0xc1')][_0x4994('0x49')]||'')+'\x20'+(_0x234026[_0x4994('0xc1')][_0x4994('0xc2')]||'')};if(_0x152624['body']['threadId']&&_0x152624[_0x4994('0x6e')][_0x4994('0xc3')]&&_0x152624[_0x4994('0x6e')][_0x4994('0xbd')]!=_0x152624[_0x4994('0x6e')]['messageId']){_0x9905a[_0x4994('0xbd')]=_0x152624['body'][_0x4994('0xc3')];}return _0x9c5e94[_0x4994('0x2b')](_0x9905a);})['then'](function(_0x580168){_0x234026[_0x4994('0xc0')]=_0x580168['get']({'plain':!![]});_0x234026[_0x4994('0xc0')][_0x4994('0xc4')]=!_0x57de26;if(_0x234026[_0x4994('0xc0')]['created']){if(_0x234026[_0x4994('0xb6')][_0x4994('0xc5')]){_0x234026[_0x4994('0xb8')]['push']({'id':0x0,'priority':_0x234026[_0x4994('0xb8')][_0x4994('0x60')]+0x1,'app':_0x4994('0xc6'),'appdata':_0x4994('0xc7'),'interval':_0x4994('0xc8')});}}return db[_0x4994('0xc9')][_0x4994('0x6d')]({'body':_0x152624[_0x4994('0x6e')][_0x4994('0x6e')],'ChatWebsiteId':_0x152624['params']['id'],'ChatInteractionId':_0x580168['id'],'direction':'in','ContactId':_0x234026[_0x4994('0xc1')]['id'],'AttachmentId':_0x152624[_0x4994('0x6e')]['AttachmentId']});})[_0x4994('0x17')](function(_0x4314fd){_0x234026[_0x4994('0x1e')]=_0x4314fd;if(!_0x234026[_0x4994('0xc0')]['UserId']){return;}return db['User'][_0x4994('0x75')]({'attributes':['id',_0x4994('0x30')],'where':{'id':_0x234026[_0x4994('0xc0')][_0x4994('0xca')]}});})[_0x4994('0x17')](function(_0x242040){if(_0x242040){_0x234026[_0x4994('0xb8')][_0x4994('0xcb')]({'id':0x0,'priority':0x0,'app':_0x4994('0xcc'),'appdata':_0x242040['name']+','+(_0x234026['account'][_0x4994('0xcd')]||0xa),'interval':_0x4994('0xc8')});_0x234026[_0x4994('0xce')]=!![];}if(!_0x234026[_0x4994('0xc0')][_0x4994('0xcf')]){return;}return db[_0x4994('0xd0')][_0x4994('0x75')]({'attributes':['id',_0x4994('0x30')],'where':{'id':_0x234026['interaction']['queueId']}});})['then'](function(_0x464283){if(_0x464283){_0x234026[_0x4994('0xb8')][_0x4994('0xcb')]({'id':0x0,'priority':0x1,'app':_0x4994('0xd1'),'appdata':_0x464283[_0x4994('0x30')]+','+(_0x234026[_0x4994('0xb6')][_0x4994('0xd2')]||0x12c),'interval':_0x4994('0xc8')});}return respondWithRpcPromise(_0x4994('0xd3'),'startRouting',_0x234026);})['then'](function(_0x363cfc){respondWithRpcPromise(_0x4994('0xd4'),_0x4994('0xd4'),{'event':_0x4994('0x9f'),'message':_0x363cfc},client9002);return _0x363cfc;})['then'](respondWithResult(_0x24c7fd,null))[_0x4994('0x20')](APIHandleError(_0x24c7fd));};exports['offline']=function(_0x1bcdc6,_0x4010a8){var _0x46f75a,_0x1070a8,_0xf51fc6;var _0x7b727e=[];var _0x21bf56={};var _0x456615=_0x1bcdc6[_0x4994('0xd5')]||[];var _0x54de8c=[];var _0x4b9438;return db[_0x4994('0xb0')][_0x4994('0x76')]()[_0x4994('0x17')](function(_0x4ac490){if(!_0x4ac490){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xa3'));}_0x7b727e=_[_0x4994('0xa6')](_[_0x4994('0x5b')](_0x4ac490),[_0x4994('0xa4'),_0x4994('0xa5'),'CompanyId',_0x4994('0xa8')]);if(_0x1bcdc6[_0x4994('0x6e')]['id']){delete _0x1bcdc6[_0x4994('0x6e')]['id'];}if(_[_0x4994('0x94')](_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xad')])){throw _0x4010a8[_0x4994('0x22')](0x1f4)['send'](new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('from\x20is\x20mandatory'));}if(_[_0x4994('0x94')](_0x1bcdc6[_0x4994('0x6e')][_0x4994('0x6e')])||_0x1bcdc6[_0x4994('0x6e')][_0x4994('0x6e')]===''){throw _0x4010a8['status'](0x1f4)[_0x4994('0xd6')](new db['Sequelize'][(_0x4994('0xa2'))](_0x4994('0xd7')));}if(_[_0x4994('0x94')](_0x1bcdc6['body']['mapKeyOffline'])){throw _0x4010a8['status'](0x1f4)[_0x4994('0xd6')](new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xd8')+_0x7b727e));}if(!_[_0x4994('0xaa')](_0x7b727e,_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xd9')])){throw _0x4010a8[_0x4994('0x22')](0x1f4)['send'](new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x7b727e));}_0x21bf56[_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xd9')]]=_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xad')];})[_0x4994('0x17')](function(){return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x1bcdc6[_0x4994('0x6b')]['id']},'include':[{'model':db['CmList'],'as':_0x4994('0xaf')},{'model':db[_0x4994('0xda')],'as':_0x4994('0xda')}]});})[_0x4994('0x17')](handleEntityNotFound(_0x4010a8,null))[_0x4994('0x17')](function(_0x51ec8f){if(_0x51ec8f&&_0x51ec8f[_0x4994('0xaf')]){_0x1070a8=_0x51ec8f;var _0x56d3b3=_[_0x4994('0x10')](_0x1bcdc6[_0x4994('0x6e')],{'firstName':_0x1bcdc6[_0x4994('0x6e')]['from'],'phone':_0x1bcdc6[_0x4994('0x6e')]['from'],'ListId':_0x51ec8f['ListId']});_0x56d3b3[_0x1bcdc6['body'][_0x4994('0xd9')]]=_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xad')];return db['CmContact']['findOrCreate']({'where':_0x21bf56,'defaults':_0x56d3b3});}})[_0x4994('0xb5')](function(_0x514f4e){if(_0x514f4e){_0xf51fc6=_0x514f4e;var _0x227f82=fs['readFileSync'](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0xdb')),_0x4994('0xdc'));var _0x313165=ejs['render'](_0x227f82,{'body':_[_0x4994('0xdd')](_0x1bcdc6[_0x4994('0x6e')][_0x4994('0x6e')]),'bodyTitle':_0x1070a8[_0x4994('0xde')]});return db[_0x4994('0xdf')][_0x4994('0x6d')]({'body':_0x313165,'plainBody':htmlToText[_0x4994('0xe0')](_0x313165),'ContactId':_0x514f4e['id'],'ChatWebsiteId':_0x1070a8['id']});}})[_0x4994('0x17')](function(_0x59826d){_0x4b9438=_0x59826d;if(_0x456615[_0x4994('0x60')]){var _0x67fd48=_0x456615[_0x4994('0x3d')](function(_0x56e915){return{'name':_0x56e915[_0x4994('0xe1')],'basename':_0x56e915[_0x4994('0x88')],'type':_0x56e915[_0x4994('0xe2')],'ChatOfflineMessageId':_0x59826d['id']};});_0x54de8c=_0x67fd48[_0x4994('0x3d')](_0x346308=>{var _0x271606={'filename':_0x346308[_0x4994('0x30')],'path':path['join'](config[_0x4994('0x8f')],_0x4994('0xe3'),_0x4994('0xd5'),_0x4994('0xe4'),_0x4994('0xe5'),_0x346308[_0x4994('0xe6')])};return _0x271606;});if(!_0x1070a8[_0x4994('0xe7')]){return db['sequelize'][_0x4994('0xe8')](function(_0x1bcef1){return db[_0x4994('0xe9')][_0x4994('0xea')](_0x67fd48,{'transaction':_0x1bcef1});});}}})[_0x4994('0x17')](function(){if(_0x4b9438){_0x46f75a=_0x4b9438;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4994('0xeb'),'raw':!![],'include':[{'model':db[_0x4994('0xec')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x293707){if(_0x293707&&_0x293707['Smtp']&&_0x1070a8[_0x4994('0xed')]&&_0x1070a8[_0x4994('0xee')]){var _0xd6cd54=_0x293707['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x4994('0xef'),{'account':_0xd6cd54,'message':{'from':util[_0x4994('0x34')](_0x4994('0xf0'),_0x293707[_0x4994('0x30')],_0x293707[_0x4994('0xf1')]||_0x293707[_0x4994('0xeb')]['user']),'to':_0x1070a8[_0x4994('0xee')],'subject':_0x1070a8['offlineMessageSubject'],'html':_0x46f75a['body'],'attachments':_0x54de8c}},client9003)[_0x4994('0x17')](function(){return _0x46f75a;})[_0x4994('0x20')](function(_0xae376c){logger[_0x4994('0x1d')](_0xae376c);});}})[_0x4994('0x17')](function(){if(_0x1070a8&&_0x1070a8[_0x4994('0xe7')]&&_0x1070a8[_0x4994('0xf2')]){var _0x480db3=[];if(_0x456615[_0x4994('0x60')]){_0x480db3=_0x456615[_0x4994('0x3d')](function(_0x208970){return{'name':_0x208970[_0x4994('0xe1')],'basename':_0x208970[_0x4994('0x88')],'type':_0x208970[_0x4994('0xe2')],'ChatOfflineMessageId':_0x4b9438['id']};});}var _0x5b12a4;if(!_['isNil'](_0x1070a8[_0x4994('0xf3')])){var _0x39c3ce=_['map'](_0x1bcdc6['body'],function(_0x51d051){return _0x51d051;});var _0x20535e=_[_0x4994('0xf4')](_0x39c3ce)[0x0];var _0x49be37=_['mapValues'](_0x20535e,function(_0x1b2ba6){return _0x1b2ba6;});_0x5b12a4=_0x49be37[0x1][_0x1070a8['subjectOffline']];}var _0x5489a0={'from':_0xf51fc6[_0x4994('0xf1')],'firstName':_0xf51fc6[_0x4994('0x49')],'lastName':_0xf51fc6['lastName'],'mapKey':_0x4994('0xf1'),'message':{'from':_0xf51fc6[_0x4994('0xf1')],'to':_0x1070a8[_0x4994('0xda')][_0x4994('0xf1')],'cc':'','subject':_['isNil'](_0x5b12a4)?_0x1070a8[_0x4994('0xf5')]:_0x5b12a4,'messageId':'','sentAt':new Date(),'attach':_0x480db3[_0x4994('0x60')],'attachments':_0x480db3,'originChannel':_0x4994('0xf6'),'ChatWebsiteId':_0x1070a8['id'],'ChatOfflineMessageId':_0x46f75a['id'],'originTo':_0x1070a8['MailAccount'][_0x4994('0xf1')]},'body':_0x46f75a[_0x4994('0x6e')]};var _0x45b368={'account':{'id':_0x1070a8['MailAccountId']},'body':_0x5489a0,'log':_0x4994('0xf7')};return respondWithRpcPromise('NotifyMailAccount',_0x4994('0xf8'),_0x45b368,client9001)[_0x4994('0x17')](function(){return _0x46f75a;})[_0x4994('0x20')](function(_0x49ebac){logger[_0x4994('0x1d')](_0x49ebac);});}return;})[_0x4994('0x17')](function(){if(_0x46f75a){return _0x46f75a;}})[_0x4994('0x17')](respondWithResult(_0x4010a8,null))['catch'](function(){for(var _0x1aa86e of _0x456615){var _0x1889af=path[_0x4994('0x8e')](config[_0x4994('0x8f')],'server','files',_0x4994('0xe4'),_0x4994('0xe5'),_0x1aa86e[_0x4994('0x88')]);fs_extra[_0x4994('0xf9')](_0x1889af)[_0x4994('0x20')](function(_0x265381){logger['error'](_0x4994('0xfa'),_0x1889af,_0x265381);});}});};exports['addInteraction']=function(_0x53d026,_0x247e6e){return db[_0x4994('0xbe')][_0x4994('0x75')]({'where':{'id':_0x53d026[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x247e6e,null))[_0x4994('0x17')](function(_0x3cf36b){if(_0x3cf36b){return _0x3cf36b[_0x4994('0xfb')](_0x53d026[_0x4994('0x6e')][_0x4994('0x80')],_[_0x4994('0xfc')](_0x53d026[_0x4994('0x6e')],['ids','id'])||{});}})[_0x4994('0x17')](respondWithResult(_0x247e6e,null))['catch'](handleError(_0x247e6e,null));};exports[_0x4994('0xfd')]=function(_0x3cdc05,_0x331858){var _0x90f17a={'raw':![],'where':{}};var _0x15c927={};var _0x2b4216={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x3cdc05[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x331858,null))[_0x4994('0x17')](function(_0x4a0d24){if(_0x4a0d24){_0x15c927[_0x4994('0x51')]=_['keys'](db[_0x4994('0xbe')]['rawAttributes']);_0x15c927[_0x4994('0x5a')]=_['keys'](_0x3cdc05[_0x4994('0x5a')]);_0x15c927[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x15c927[_0x4994('0x51')],_0x15c927[_0x4994('0x5a')]);_0x90f17a['attributes']=_['intersection'](_0x15c927['model'],qs[_0x4994('0x5e')](_0x3cdc05[_0x4994('0x5a')]['fields']));_0x90f17a['attributes']=_0x90f17a[_0x4994('0x5f')][_0x4994('0x60')]?_0x90f17a['attributes']:_0x15c927[_0x4994('0x51')];if(!_0x3cdc05[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x90f17a['limit']=qs[_0x4994('0x26')](_0x3cdc05[_0x4994('0x5a')][_0x4994('0x26')]);_0x90f17a[_0x4994('0x24')]=qs[_0x4994('0x24')](_0x3cdc05[_0x4994('0x5a')][_0x4994('0x24')]);}_0x90f17a[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x3cdc05['query']['sort']);_0x90f17a['where']=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0x3cdc05[_0x4994('0x5a')],_0x15c927[_0x4994('0x5c')]));_0x90f17a[_0x4994('0x63')][_0x4994('0x77')]=_0x4a0d24['id'];if(_0x3cdc05[_0x4994('0x5a')][_0x4994('0x64')]){_0x90f17a[_0x4994('0x63')]=_[_0x4994('0x65')](_0x90f17a['where'],{'$or':_[_0x4994('0x3d')](_0x90f17a['attributes'],function(_0x322f25){var _0x299331={};_0x299331[_0x322f25]={'$like':'%'+_0x3cdc05[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x299331;})});}_0x90f17a=_[_0x4994('0x65')]({},_0x90f17a,_0x3cdc05['options']);return db[_0x4994('0xbe')][_0x4994('0x27')]({'where':_0x90f17a[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x45b3f0){_0x2b4216['count']=_0x45b3f0;if(_0x3cdc05['query'][_0x4994('0x67')]){_0x90f17a[_0x4994('0x68')]=[{'model':db[_0x4994('0xb0')],'as':_0x4994('0xfe'),'required':![]},{'model':db[_0x4994('0xff')],'as':_0x4994('0x100'),'attributes':[_0x4994('0x30'),_0x4994('0x101'),_0x4994('0x102')],'required':![]},{'model':db[_0x4994('0x103')],'as':_0x4994('0x104'),'attributes':['id','name',_0x4994('0x105')],'where':_0x3cdc05[_0x4994('0x5a')][_0x4994('0x106')]?{'id':_0x3cdc05['query'][_0x4994('0x106')]}:undefined,'required':_0x3cdc05[_0x4994('0x5a')]['tag']?!![]:![]}];}return db[_0x4994('0xbe')][_0x4994('0x69')](_0x90f17a);})['then'](function(_0x1ee117){_0x2b4216[_0x4994('0x6a')]=_0x1ee117;return _0x2b4216;});}})[_0x4994('0x17')](respondWithFilteredResult(_0x331858,_0x90f17a))[_0x4994('0x20')](handleError(_0x331858,null));};exports[_0x4994('0x32')]=function(_0x17ef96,_0x245b89){var _0xba8540=0x0;var _0x311f1b=0x0;var _0x3eda07=![];var _0xeb5422;var _0x4b379a;return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x17ef96['params']['id']},'include':[{'model':db[_0x4994('0x3e')],'as':'Interval','include':[{'model':db[_0x4994('0x3e')],'as':_0x4994('0xb3'),'attributes':['id','interval']}]}]})['then'](handleEntityNotFound(_0x245b89,null))['then'](function(_0x1a3fe7){if(_0x1a3fe7){_0xeb5422=_0x1a3fe7;return _0x1a3fe7[_0x4994('0x107')]({'raw':!![]});}})[_0x4994('0x17')](function(_0x28de10){if(_0xeb5422){if(_0x28de10){_0x4b379a=_0x28de10;}}return require('../../config/license/util')['getLicense']();})[_0x4994('0x17')](function(_0x368a6e){if(_0x368a6e){_0x311f1b=_0x368a6e['virtual'];_0x3eda07=_0x368a6e[_0x4994('0x93')];}})[_0x4994('0x17')](function(){return db[_0x4994('0xbe')][_0x4994('0x27')]({'where':{'closed':![]}});})[_0x4994('0x17')](function(_0x43043e){_0xba8540=_0x43043e;if(_0x311f1b&&_0x43043e>_0x311f1b){return db[_0x4994('0x108')]['findOne']({'where':{'id':0x1}})[_0x4994('0x17')](function(_0x241a6e){if(_0x241a6e){_0x241a6e[_0x4994('0x109')](_0x4994('0x10a'));}});}})[_0x4994('0x17')](function(){if(!_0xeb5422['Interval']||!_0xeb5422['Interval'][_0x4994('0xb3')])return!![];return checkWebsiteIntervals(_0xeb5422);})[_0x4994('0x17')](function(_0x1fe81a){var _0x41bd91=fs[_0x4994('0x10b')](path[_0x4994('0x8e')](config['root'],_0x4994('0x10c')),'utf8');var _0x249ffb=new url[(_0x4994('0x10d'))](_0xeb5422[_0x4994('0x10e')])[_0x4994('0x10f')];var _0x40a50f=_0x4994('0x110');var _0x3bd881=![];var _0x374109={'chatVersion':_0x40a50f,'chatWebsiteAddressOrigin':_0x249ffb,'remote':_0xeb5422['remote'],'query':querystring[_0x4994('0x1c')](_[_0x4994('0x65')](_0xeb5422['get']({'plain':!![]}),{'customerIp':_0x17ef96['headers'][_0x4994('0x46')]||_0x17ef96[_0x4994('0xbc')][_0x4994('0x111')]||_0x17ef96[_0x4994('0x112')]['remoteAddress']||_0x17ef96['ip'],'referer':_0x17ef96['headers'][_0x4994('0x4b')],'openedInteractions':_0xba8540,'maxInteractions':_0x311f1b,'virtual':_0x3eda07[_0x4994('0x113')],'online':_0x1fe81a,'custom':_0x3eda07}))[_0x4994('0x114')](/'/g,'\x5c\x27')};_0x245b89[_0x4994('0xd6')](ejs[_0x4994('0x115')](Mustache[_0x4994('0x115')](_0x41bd91,_0x374109),{'proactiveActions':_0x4b379a,'alignment':_0xeb5422[_0x4994('0x116')],'verticalAlignment':_0xeb5422[_0x4994('0x117')],'div_color':_0xeb5422[_0x4994('0x105')],'labelText':_0xeb5422[_0x4994('0x118')],'text_color':_0xeb5422[_0x4994('0x119')],'text_button_color':_0xeb5422[_0x4994('0x11a')],'button_color':_0xeb5422['color_button'],'background_color':_0xeb5422[_0x4994('0x11b')],'hideWhenOffline':_0xeb5422[_0x4994('0x11c')],'intervalId':_0xeb5422[_0x4994('0x11d')],'isDevelopment':_0x3bd881,'chatVersion':_0x40a50f}));})[_0x4994('0x20')](handleError(_0x245b89,null));};exports[_0x4994('0x11e')]=function(_0x2c2b5d,_0x247cd7){var _0x1a6855=_0x2c2b5d[_0x4994('0x6b')]['id'];var _0x4c5e74=_0x2c2b5d['body'];var _0x2dfe8d=0xc8;var _0x51e398=null;return db['sequelize'][_0x4994('0xe8')]({'isolationLevel':db['sequelize'][_0x4994('0x11f')][_0x4994('0x120')][_0x4994('0x121')]},function(_0x183239){return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x1a6855},'transaction':_0x183239})['then'](function(_0x49473b){if(_0x49473b){return db[_0x4994('0x122')][_0x4994('0x2c')]({'where':{'ChatWebsiteId':_0x1a6855},'transaction':_0x183239})[_0x4994('0x17')](function(){var _0x5e3bfe=_[_0x4994('0x3d')](_0x4c5e74,function(_0x298a08){_0x298a08['ChatWebsiteId']=_0x1a6855;return _0x298a08;});return db[_0x4994('0x122')]['bulkCreate'](_0x5e3bfe,{'transaction':_0x183239});});}else{_0x2dfe8d=0x194;_0x51e398=[];}});})[_0x4994('0x17')](function(){if(_0x2dfe8d!==0x194){return db[_0x4994('0x122')][_0x4994('0x123')]({'where':{'ChatWebsiteId':_0x1a6855},'order':_0x4994('0xba')})[_0x4994('0x17')](function(_0xade7c6){_0x51e398=_0xade7c6;});}})[_0x4994('0x20')](function(_0x346138){_0x2dfe8d=0x1f4;logger[_0x4994('0x1d')](_0x346138[_0x4994('0x124')]);if(_0x346138['name']){delete _0x346138[_0x4994('0x30')];}_0x51e398=_0x346138;})[_0x4994('0x125')](function(){if(_0x51e398===null){_0x247cd7[_0x4994('0x21')](_0x2dfe8d);}else{if(_0x2dfe8d===0x1f4){_0x247cd7['status'](_0x2dfe8d)[_0x4994('0xd6')](_0x51e398);}else{_0x247cd7[_0x4994('0x22')](_0x2dfe8d)['json'](_0x51e398);}}});};exports[_0x4994('0x126')]=function(_0xd6fdbe,_0x1b47d1){var _0x166666={};var _0x40beb2={};var _0x1fd62d;var _0x219cf3;return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0xd6fdbe['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x1b47d1,null))[_0x4994('0x17')](function(_0x48ea62){if(_0x48ea62){_0x1fd62d=_0x48ea62;_0x40beb2[_0x4994('0x51')]=_[_0x4994('0x5b')](db['ChatApplication']['rawAttributes']);_0x40beb2['query']=_[_0x4994('0x5b')](_0xd6fdbe[_0x4994('0x5a')]);_0x40beb2[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x40beb2['model'],_0x40beb2[_0x4994('0x5a')]);_0x166666[_0x4994('0x5f')]=_['intersection'](_0x40beb2[_0x4994('0x51')],qs[_0x4994('0x5e')](_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x5e')]));_0x166666['attributes']=_0x166666[_0x4994('0x5f')][_0x4994('0x60')]?_0x166666[_0x4994('0x5f')]:_0x40beb2[_0x4994('0x51')];_0x166666['order']=qs[_0x4994('0x62')](_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x62')]);_0x166666['where']=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0xd6fdbe[_0x4994('0x5a')],_0x40beb2[_0x4994('0x5c')]));if(_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x64')]){_0x166666[_0x4994('0x63')]=_['merge'](_0x166666[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x166666['attributes'],function(_0x32d8b2){var _0x12b6ce={};_0x12b6ce[_0x32d8b2]={'$like':'%'+_0xd6fdbe['query'][_0x4994('0x64')]+'%'};return _0x12b6ce;})});}_0x166666=_['merge']({},_0x166666,_0xd6fdbe['options']);return _0x1fd62d['getApplications'](_0x166666);}})['then'](function(_0x4529e7){if(_0x4529e7){_0x219cf3=_0x4529e7[_0x4994('0x60')];if(!_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x166666['limit']=qs['limit'](_0xd6fdbe[_0x4994('0x5a')]['limit']);_0x166666[_0x4994('0x24')]=qs[_0x4994('0x24')](_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x24')]);}return _0x1fd62d[_0x4994('0x126')](_0x166666);}})[_0x4994('0x17')](function(_0x157d34){if(_0x157d34){return _0x157d34?{'count':_0x219cf3,'rows':_0x157d34}:null;}})[_0x4994('0x17')](respondWithResult(_0x1b47d1,null))[_0x4994('0x20')](handleError(_0x1b47d1,null));};exports['addProactiveActions']=function(_0x491582,_0x2063ab){return db['chatProactiveAction'][_0x4994('0x75')]({'where':{'id':_0x491582[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x2063ab,null))[_0x4994('0x17')](function(_0x359ac6){if(_0x359ac6){return _0x359ac6['addProactiveActions'](_0x491582[_0x4994('0x6e')]['ids'],_[_0x4994('0xfc')](_0x491582[_0x4994('0x6e')],['ids','id'])||{});}})[_0x4994('0x17')](respondWithResult(_0x2063ab,null))[_0x4994('0x20')](handleError(_0x2063ab,null));};exports['getProactiveActions']=function(_0x141d27,_0x2e76fd){var _0x30ba11={};var _0x5e6293={};var _0x9124fa;var _0x3dfee3;return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x141d27[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x2e76fd,null))[_0x4994('0x17')](function(_0x5ba198){if(_0x5ba198){_0x9124fa=_0x5ba198;_0x5e6293[_0x4994('0x51')]=_['keys'](db[_0x4994('0x127')][_0x4994('0x6c')]);_0x5e6293[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x141d27[_0x4994('0x5a')]);_0x5e6293[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x5e6293[_0x4994('0x51')],_0x5e6293[_0x4994('0x5a')]);_0x30ba11[_0x4994('0x5f')]=_['intersection'](_0x5e6293[_0x4994('0x51')],qs[_0x4994('0x5e')](_0x141d27[_0x4994('0x5a')][_0x4994('0x5e')]));_0x30ba11[_0x4994('0x5f')]=_0x30ba11[_0x4994('0x5f')][_0x4994('0x60')]?_0x30ba11['attributes']:_0x5e6293[_0x4994('0x51')];_0x30ba11['order']=qs[_0x4994('0x62')](_0x141d27['query'][_0x4994('0x62')]);_0x30ba11['where']=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0x141d27[_0x4994('0x5a')],_0x5e6293['filters']));if(_0x141d27[_0x4994('0x5a')]['filter']){_0x30ba11[_0x4994('0x63')]=_[_0x4994('0x65')](_0x30ba11[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x30ba11[_0x4994('0x5f')],function(_0x3be37f){var _0x1c1a31={};_0x1c1a31[_0x3be37f]={'$like':'%'+_0x141d27[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x1c1a31;})});}_0x30ba11=_[_0x4994('0x65')]({},_0x30ba11,_0x141d27[_0x4994('0x7e')]);return _0x9124fa[_0x4994('0x107')](_0x30ba11);}})[_0x4994('0x17')](function(_0x5999a2){if(_0x5999a2){_0x3dfee3=_0x5999a2[_0x4994('0x60')];if(!_0x141d27[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x30ba11[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x141d27[_0x4994('0x5a')]['limit']);_0x30ba11['offset']=qs[_0x4994('0x24')](_0x141d27[_0x4994('0x5a')][_0x4994('0x24')]);}return _0x9124fa[_0x4994('0x107')](_0x30ba11);}})[_0x4994('0x17')](function(_0x4cb8fe){if(_0x4cb8fe){return _0x4cb8fe?{'count':_0x3dfee3,'rows':_0x4cb8fe}:null;}})[_0x4994('0x17')](respondWithResult(_0x2e76fd,null))[_0x4994('0x20')](handleError(_0x2e76fd,null));};exports[_0x4994('0x128')]=function(_0x51cc49,_0x30e418){var _0x50031b=_0x51cc49[_0x4994('0x5a')]['online']==='false'?_0x4994('0x129'):_0x4994('0x12a');return db['ChatWebsite'][_0x4994('0x75')]({'attributes':['id',_0x50031b],'where':{'id':_0x51cc49[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x30e418,null))[_0x4994('0x17')](function(_0x5214f5){if(_0x5214f5){var _0x57a913=_0x5214f5[_0x50031b];var _0x4fefe2=_0x57a913&&_0x57a913[_0x4994('0x12b')]?_0x57a913[_0x4994('0x12b')]:[];_0x30e418[_0x4994('0xd6')]({'fromKey':_[_0x4994('0x94')](_0x57a913[_0x4994('0x12c')])?undefined:_0x57a913['fromKey'],'count':_0x4fefe2[_0x4994('0x60')],'rows':_0x4fefe2});}})[_0x4994('0x20')](handleError(_0x30e418,null));};exports[_0x4994('0x12d')]=function(_0x50d7e8,_0x1cabb2){var _0x58de8d={'raw':![],'where':{}};var _0x20bb8c={};var _0x966f40={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x50d7e8[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x1cabb2,null))[_0x4994('0x17')](function(_0x12c190){if(_0x12c190){_0x20bb8c[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0xdf')]['rawAttributes']);_0x20bb8c[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x50d7e8[_0x4994('0x5a')]);_0x20bb8c['filters']=_['intersection'](_0x20bb8c[_0x4994('0x51')],_0x20bb8c[_0x4994('0x5a')]);_0x58de8d[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x20bb8c[_0x4994('0x51')],qs[_0x4994('0x5e')](_0x50d7e8[_0x4994('0x5a')][_0x4994('0x5e')]));_0x58de8d['attributes']=_0x58de8d[_0x4994('0x5f')]['length']?_0x58de8d[_0x4994('0x5f')]:_0x20bb8c['model'];if(!_0x50d7e8[_0x4994('0x5a')][_0x4994('0x7b')]('nolimit')){_0x58de8d['limit']=qs['limit'](_0x50d7e8[_0x4994('0x5a')][_0x4994('0x26')]);_0x58de8d[_0x4994('0x24')]=qs[_0x4994('0x24')](_0x50d7e8['query'][_0x4994('0x24')]);}_0x58de8d[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x50d7e8[_0x4994('0x5a')][_0x4994('0x62')]);_0x58de8d[_0x4994('0x63')]=qs['filters'](_['pick'](_0x50d7e8[_0x4994('0x5a')],_0x20bb8c[_0x4994('0x5c')]));_0x58de8d['where'][_0x4994('0x77')]=_0x12c190['id'];if(_0x50d7e8[_0x4994('0x5a')][_0x4994('0x64')]){_0x58de8d['where']=_[_0x4994('0x65')](_0x58de8d[_0x4994('0x63')],{'$or':_['map'](_0x58de8d[_0x4994('0x5f')],function(_0x5e6af8){var _0x4779c9={};_0x4779c9[_0x5e6af8]={'$like':'%'+_0x50d7e8[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x4779c9;})});}_0x58de8d=_[_0x4994('0x65')]({},_0x58de8d,_0x50d7e8[_0x4994('0x7e')]);return db['ChatOfflineMessage'][_0x4994('0x27')]({'where':_0x58de8d[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x2598d6){_0x966f40['count']=_0x2598d6;if(_0x50d7e8['query'][_0x4994('0x67')]){_0x58de8d['include']=[{'all':!![]}];}else{_0x58de8d[_0x4994('0x68')]=[{'model':db['CmContact'],'as':_0x4994('0xfe'),'required':![]},{'model':db[_0x4994('0xe9')],'as':'Attachments','required':![]}];}return db[_0x4994('0xdf')]['findAll'](_0x58de8d);})['then'](function(_0x14236c){_0x966f40[_0x4994('0x6a')]=_0x14236c;return _0x966f40;});}})['then'](respondWithFilteredResult(_0x1cabb2,_0x58de8d))[_0x4994('0x20')](handleError(_0x1cabb2,null));};exports['addAgents']=function(_0x4a5bd5,_0x30b6ac){return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x4a5bd5['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x30b6ac,null))[_0x4994('0x17')](function(_0x20fa8c){if(_0x20fa8c){return _0x20fa8c['addAgents'](_0x4a5bd5['body'][_0x4994('0x80')],_[_0x4994('0xfc')](_0x4a5bd5[_0x4994('0x6e')],[_0x4994('0x80'),'id'])||{})[_0x4994('0xb5')](function(_0x16b323){for(var _0x29fce8=0x0;_0x29fce8<_0x4a5bd5[_0x4994('0x6e')]['ids'][_0x4994('0x60')];_0x29fce8+=0x1){socket['emit'](_0x4994('0x12e'),{'UserId':Number(_0x4a5bd5[_0x4994('0x6e')]['ids'][_0x29fce8]),'ChatWebsiteId':Number(_0x4a5bd5[_0x4994('0x6b')]['id'])});}return _0x16b323;});}})[_0x4994('0x17')](respondWithResult(_0x30b6ac,null))[_0x4994('0x20')](handleError(_0x30b6ac,null));};exports[_0x4994('0x12f')]=function(_0x383552,_0xa392e3){return db['ChatWebsite']['find']({'where':{'id':_0x383552['params']['id']}})['then'](handleEntityNotFound(_0xa392e3,null))['then'](function(_0x4cf294){if(_0x4cf294){return _0x4cf294[_0x4994('0x12f')](_0x383552[_0x4994('0x5a')][_0x4994('0x80')])[_0x4994('0x17')](function(){if(_['isArray'](_0x383552['query'][_0x4994('0x80')])){for(var _0x5586e2=0x0;_0x5586e2<_0x383552['query']['ids'][_0x4994('0x60')];_0x5586e2+=0x1){socket[_0x4994('0x130')](_0x4994('0x131'),{'UserId':Number(_0x383552[_0x4994('0x5a')]['ids'][_0x5586e2]),'ChatWebsiteId':Number(_0x383552[_0x4994('0x6b')]['id'])});}}else{socket[_0x4994('0x130')](_0x4994('0x131'),{'UserId':Number(_0x383552[_0x4994('0x5a')][_0x4994('0x80')]),'ChatWebsiteId':Number(_0x383552['params']['id'])});}});}})[_0x4994('0x17')](respondWithStatusCode(_0xa392e3,null))[_0x4994('0x20')](handleError(_0xa392e3,null));};exports[_0x4994('0x132')]=function(_0x1f2c6d,_0x4f5787){var _0x406daa={};var _0x1b3be3={};var _0x3a7177;var _0x430009;return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x1f2c6d[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x4f5787,null))[_0x4994('0x17')](function(_0x4a8bd6){if(_0x4a8bd6){_0x3a7177=_0x4a8bd6;_0x1b3be3['model']=_['keys'](db[_0x4994('0xff')][_0x4994('0x6c')]);_0x1b3be3[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x1f2c6d[_0x4994('0x5a')]);_0x1b3be3[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x1b3be3[_0x4994('0x51')],_0x1b3be3[_0x4994('0x5a')]);_0x406daa[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x1b3be3[_0x4994('0x51')],qs['fields'](_0x1f2c6d[_0x4994('0x5a')][_0x4994('0x5e')]));_0x406daa['attributes']=_0x406daa[_0x4994('0x5f')][_0x4994('0x60')]?_0x406daa[_0x4994('0x5f')]:_0x1b3be3['model'];_0x406daa[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x1f2c6d[_0x4994('0x5a')]['sort']);_0x406daa[_0x4994('0x63')]=qs['filters'](_['pick'](_0x1f2c6d[_0x4994('0x5a')],_0x1b3be3[_0x4994('0x5c')]));if(_0x1f2c6d['query'][_0x4994('0x64')]){_0x406daa[_0x4994('0x63')]=_[_0x4994('0x65')](_0x406daa[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x406daa[_0x4994('0x5f')],function(_0xa448){var _0x4dc10b={};_0x4dc10b[_0xa448]={'$like':'%'+_0x1f2c6d[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x4dc10b;})});}_0x406daa=_[_0x4994('0x65')]({},_0x406daa,_0x1f2c6d[_0x4994('0x7e')]);return _0x3a7177['getAgents'](_0x406daa);}})['then'](function(_0x1d48fc){if(_0x1d48fc){_0x430009=_0x1d48fc[_0x4994('0x60')];if(!_0x1f2c6d['query'][_0x4994('0x7b')](_0x4994('0x7c'))){_0x406daa[_0x4994('0x26')]=qs['limit'](_0x1f2c6d[_0x4994('0x5a')]['limit']);_0x406daa['offset']=qs['offset'](_0x1f2c6d['query'][_0x4994('0x24')]);}return _0x3a7177[_0x4994('0x132')](_0x406daa);}})[_0x4994('0x17')](function(_0x582c7a){if(_0x582c7a){return _0x582c7a?{'count':_0x430009,'rows':_0x582c7a}:null;}})[_0x4994('0x17')](respondWithResult(_0x4f5787,null))[_0x4994('0x20')](handleError(_0x4f5787,null));}; \ No newline at end of file +var _0xe37a=['firstName','lastName','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','NotifyMailAccount','notifyMail','server','addInteraction','omit','Contact','Owner','fullname','Tag','Tags','color','tag','getSnippet','getProactiveActions','getLicense','License','readFileSync','utf8','URL','address','origin','remote','headers','x-real-ip','connection','remoteAddress','virtual','alignment','labelText','textColor','hideWhenOffline','IntervalId','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','items','getOfflineMessages','Attachment','Attachments','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','fs-extra','lodash','querystring','html-to-text','jayson/promise','url','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIOutOfIntervalError','handleError','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','get','UserProfileResource','name','send','Command','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','map','Interval','Intervals','all','some','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','referer','browser','version','%s\x20%s','unknown','device','model','vendor','type','index','Pause','ChatWebsite','fieldName','key','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','intersection','length','include','create','user','role','ChatWebsites','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','sort','filter','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','asc','contact','threadId','externalUrl','ChatInteraction','interaction'];(function(_0xe5f973,_0x1edce7){var _0x34d054=function(_0x2dba4d){while(--_0x2dba4d){_0xe5f973['push'](_0xe5f973['shift']());}};_0x34d054(++_0x1edce7);}(_0xe37a,0x69));var _0xae37=function(_0x43b045,_0x8ae9ce){_0x43b045=_0x43b045-0x0;var _0x48e7ee=_0xe37a[_0x43b045];return _0x48e7ee;};'use strict';var Mustache=require(_0xae37('0x0'));var util=require(_0xae37('0x1'));var path=require(_0xae37('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae37('0x3'));var _=require(_0xae37('0x4'));var querystring=require(_0xae37('0x5'));var htmlToText=require(_0xae37('0x6'));var Redis=require('ioredis');var jayson=require(_0xae37('0x7'));var url=require(_0xae37('0x8'));var qs=require(_0xae37('0x9'));var logger=require(_0xae37('0xa'))('api');var config=require(_0xae37('0xb'));var APIOutOfIntervalError=require(_0xae37('0xc'))[_0xae37('0xd')];var APINotFoundError=require(_0xae37('0xc'))['APINotFoundError'];var APIHandleError=require(_0xae37('0xc'))[_0xae37('0xe')];var db=require('../../mysqldb')['db'];config['redis']=_[_0xae37('0xf')](config[_0xae37('0x10')],{'host':_0xae37('0x11'),'port':0x18eb});var socket=require(_0xae37('0x12'))(new Redis(config['redis']));require(_0xae37('0x13'))[_0xae37('0x14')](socket);var client=jayson[_0xae37('0x15')]['http']({'port':0x232c});var client9002=jayson[_0xae37('0x15')][_0xae37('0x16')]({'port':0x232a});var client9003=jayson['client'][_0xae37('0x16')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x4a977a,_0x2928d4,_0x1f4c3b,_0x38e1fe){return new Promise(function(_0x4b8612,_0x5e998f){var _0x42a88e=_0x38e1fe||client;return _0x42a88e['request'](_0x4a977a,_0x1f4c3b)[_0xae37('0x17')](function(_0x2257c2){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2928d4,'request\x20sent');logger['debug'](_0xae37('0x18'),_0x2928d4,_0xae37('0x19'),JSON[_0xae37('0x1a')](_0x2257c2));if(_0x2257c2[_0xae37('0x1b')]){if(_0x2257c2[_0xae37('0x1b')][_0xae37('0x1c')]===0x1f4){logger[_0xae37('0x1b')](_0xae37('0x1d'),_0x2928d4,_0x2257c2['error']['message']);return _0x5e998f(_0x2257c2[_0xae37('0x1b')][_0xae37('0x1e')]);}logger['error'](_0xae37('0x1d'),_0x2928d4,_0x2257c2[_0xae37('0x1b')][_0xae37('0x1e')]);return _0x4b8612(_0x2257c2[_0xae37('0x1b')][_0xae37('0x1e')]);}else{logger[_0xae37('0x1f')](_0xae37('0x1d'),_0x2928d4,_0xae37('0x19'));_0x4b8612(_0x2257c2[_0xae37('0x20')][_0xae37('0x1e')]);}})[_0xae37('0x21')](function(_0x213b6c){logger[_0xae37('0x1b')](_0xae37('0x1d'),_0x2928d4,_0x213b6c);_0x5e998f(_0x213b6c);});});}function respondWithStatusCode(_0x845390,_0x37e922){_0x37e922=_0x37e922||0xcc;return function(_0x337179){if(_0x337179){return _0x845390[_0xae37('0x22')](_0x37e922);}return _0x845390[_0xae37('0x23')](_0x37e922)[_0xae37('0x24')]();};}function respondWithResult(_0x18d125,_0x542149){_0x542149=_0x542149||0xc8;return function(_0x5cfe59){if(_0x5cfe59){return _0x18d125['status'](_0x542149)[_0xae37('0x25')](_0x5cfe59);}};}function respondWithFilteredResult(_0x4bfba0,_0x1c5571){return function(_0x2b9699){if(_0x2b9699){var _0x54e95a=typeof _0x1c5571[_0xae37('0x26')]===_0xae37('0x27')&&typeof _0x1c5571[_0xae37('0x28')]==='undefined';var _0x3492f3=_0x2b9699['count'];var _0x1aed00=_0x54e95a?0x0:_0x1c5571[_0xae37('0x26')];var _0x31ac5f=_0x54e95a?_0x2b9699[_0xae37('0x29')]:_0x1c5571[_0xae37('0x26')]+_0x1c5571[_0xae37('0x28')];var _0x90a55c;if(_0x31ac5f>=_0x3492f3){_0x31ac5f=_0x3492f3;_0x90a55c=0xc8;}else{_0x90a55c=0xce;}_0x4bfba0[_0xae37('0x23')](_0x90a55c);return _0x4bfba0[_0xae37('0x2a')]('Content-Range',_0x1aed00+'-'+_0x31ac5f+'/'+_0x3492f3)['json'](_0x2b9699);}return null;};}function saveUpdates(_0x935ef7){return function(_0x24413c){if(_0x24413c){return _0x24413c[_0xae37('0x2b')](_0x935ef7)[_0xae37('0x17')](function(_0x34362b){return _0x34362b;});}return null;};}function removeEntity(_0x2b87f0){return function(_0x55d379){if(_0x55d379){return _0x55d379[_0xae37('0x2c')]()[_0xae37('0x17')](function(){var _0x37ff2e=_0x55d379[_0xae37('0x2d')]({'plain':!![]});var _0x56f9f1='ChatWebsites';return db[_0xae37('0x2e')][_0xae37('0x2c')]({'where':{'type':_0x56f9f1,'resourceId':_0x37ff2e['id']}})[_0xae37('0x17')](function(){return _0x55d379;});})[_0xae37('0x17')](function(){_0x2b87f0[_0xae37('0x23')](0xcc)[_0xae37('0x24')]();});}};}function handleEntityNotFound(_0x35afd0){return function(_0x59288e){if(!_0x59288e){_0x35afd0['sendStatus'](0x194);}return _0x59288e;};}function handleError(_0x3c9df4,_0x5bed43){_0x5bed43=_0x5bed43||0x1f4;return function(_0x5359b4){logger[_0xae37('0x1b')](_0x5359b4['stack']);if(_0x5359b4['name']){delete _0x5359b4[_0xae37('0x2f')];}_0x3c9df4['status'](_0x5bed43)[_0xae37('0x30')](_0x5359b4);};}function iftimePromise(_0x52b168,_0x524e64){return respondWithRpcPromise(_0xae37('0x31'),'getSnippet',{'command':_0x524e64[_0xae37('0x32')]?util[_0xae37('0x33')](_0xae37('0x34'),_0x52b168[_0xae37('0x35')],_0x524e64[_0xae37('0x32')]):util[_0xae37('0x33')](_0xae37('0x36'),_0x52b168[_0xae37('0x35')])},client9002)[_0xae37('0x17')](function(_0x295a29){var _0x1e02c8=_0x295a29&&_0x295a29['indexOf']('true')>=0x0?!![]:![];logger[_0xae37('0x1f')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x524e64['id'],_0x52b168['id'],_0x52b168[_0xae37('0x35')],_0x1e02c8?_0xae37('0x37'):'OFFLINE',_0x524e64[_0xae37('0x32')]?_0x524e64[_0xae37('0x32')]:_0xae37('0x38'));return _0x1e02c8;})[_0xae37('0x21')](function(_0x5929f6){logger['error'](_0xae37('0x39'),_0x524e64['id'],_0x52b168['id'],_0x52b168[_0xae37('0x35')],util[_0xae37('0x3a')](_0x5929f6,{'showHidden':![],'depth':null}),_0x524e64['timezone']?_0x524e64['timezone']:_0xae37('0x38'));return![];});}function checkWebsiteIntervals(_0x4a1510){var _0x23e553=_[_0xae37('0x3b')](_0x4a1510[_0xae37('0x3c')][_0xae37('0x3d')],function(_0x53264d){var _0x5777ea=_0x53264d[_0xae37('0x2d')]({'plain':!![]});return iftimePromise(_0x5777ea,_0x4a1510);});return Promise[_0xae37('0x3e')](_0x23e553)[_0xae37('0x17')](function(_0x38666a){return _[_0xae37('0x3f')](_0x38666a);});}function createInteractionObject(_0x41cd85,_0x1bdadc,_0x2350f5,_0x207429){var _0x2489a5=require(_0xae37('0x40'));var _0x4d6942=new _0x2489a5();var _0x3c5c28=_0x4d6942['setUA'](_0x2350f5[_0xae37('0x41')])[_0xae37('0x42')]();var _0x3d62e5=_0x1bdadc[_0xae37('0x43')];if(_0x2350f5[_0xae37('0x44')]){_0x3d62e5=_0x2350f5[_0xae37('0x44')];}else if(_0x2350f5[_0xae37('0x45')]){_0x3d62e5=_[_0xae37('0x46')](_0x2350f5[_0xae37('0x45')][_0xae37('0x47')](','));}return{'ContactId':_0x207429['id'],'ChatWebsiteId':_0x41cd85,'from':(_0x207429['firstName']||'')+'\x20'+(_0x207429['lastName']||''),'customerIp':_0x3d62e5,'customerPort':_0x2350f5[_0xae37('0x48')]?_0x2350f5[_0xae37('0x48')]:null,'referer':_0x1bdadc[_0xae37('0x49')],'browserName':_0x3c5c28[_0xae37('0x4a')][_0xae37('0x2f')]&&_0x3c5c28[_0xae37('0x4a')][_0xae37('0x4b')]?util['format'](_0xae37('0x4c'),_0x3c5c28[_0xae37('0x4a')][_0xae37('0x2f')],_0x3c5c28[_0xae37('0x4a')]['version']):'unknown','browserVersion':_0x3c5c28[_0xae37('0x4a')][_0xae37('0x4b')]||_0xae37('0x4d'),'osName':util[_0xae37('0x33')](_0xae37('0x4c'),_0x3c5c28['os']['name'],_0x3c5c28['os'][_0xae37('0x4b')]),'osVersion':_0x3c5c28['os']['version'],'deviceModel':_0x3c5c28[_0xae37('0x4e')][_0xae37('0x4f')]&&_0x3c5c28[_0xae37('0x4e')][_0xae37('0x50')]?util[_0xae37('0x33')]('%s\x20%s\x20%s',_0x3c5c28[_0xae37('0x4e')][_0xae37('0x4f')],_0x3c5c28[_0xae37('0x4e')][_0xae37('0x50')],_0x3c5c28['device'][_0xae37('0x51')]):null,'deviceVendor':_0x3c5c28[_0xae37('0x4e')]['vendor'],'deviceType':_0x3c5c28[_0xae37('0x4e')][_0xae37('0x51')],'formData':JSON[_0xae37('0x1a')](_0x1bdadc)};}exports[_0xae37('0x52')]=function(_0x738bd1,_0x3cef96){var _0x4aa6d5={'include':[{'model':db[_0xae37('0x53')],'as':'mandatoryDispositionPause'}]},_0x11dc3f={},_0x3c24ce={'count':0x0,'rows':[]};var _0x464f8d=_[_0xae37('0x3b')](db[_0xae37('0x54')]['rawAttributes'],function(_0x24ad3a){return{'name':_0x24ad3a[_0xae37('0x55')],'type':_0x24ad3a[_0xae37('0x51')][_0xae37('0x56')]};});_0x11dc3f[_0xae37('0x4f')]=_[_0xae37('0x3b')](_0x464f8d,_0xae37('0x2f'));_0x11dc3f[_0xae37('0x57')]=_[_0xae37('0x58')](_0x738bd1['query']);_0x11dc3f[_0xae37('0x59')]=_['intersection'](_0x11dc3f[_0xae37('0x4f')],_0x11dc3f[_0xae37('0x57')]);_0x4aa6d5[_0xae37('0x5a')]=_['intersection'](_0x11dc3f[_0xae37('0x4f')],qs[_0xae37('0x5b')](_0x738bd1[_0xae37('0x57')][_0xae37('0x5b')]));_0x4aa6d5[_0xae37('0x5a')]=_0x4aa6d5[_0xae37('0x5a')]['length']?_0x4aa6d5[_0xae37('0x5a')]:_0x11dc3f[_0xae37('0x4f')];if(!_0x738bd1['query'][_0xae37('0x5c')](_0xae37('0x5d'))){_0x4aa6d5[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x738bd1[_0xae37('0x57')]['limit']);_0x4aa6d5[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x738bd1[_0xae37('0x57')][_0xae37('0x26')]);}_0x4aa6d5[_0xae37('0x5e')]=qs['sort'](_0x738bd1['query']['sort']);_0x4aa6d5[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x738bd1['query'],_0x11dc3f['filters']),_0x464f8d);if(_0x738bd1[_0xae37('0x57')]['filter']){_0x4aa6d5['where']=_[_0xae37('0x61')](_0x4aa6d5[_0xae37('0x5f')],{'$or':_['map'](_0x464f8d,function(_0x3451ac){if(_0x3451ac[_0xae37('0x51')]!==_0xae37('0x62')){var _0x342805={};_0x342805[_0x3451ac['name']]={'$like':'%'+_0x738bd1['query']['filter']+'%'};return _0x342805;}})});}_0x4aa6d5=_['merge']({},_0x4aa6d5,_0x738bd1[_0xae37('0x63')]);var _0x3e4022={'where':_0x4aa6d5[_0xae37('0x5f')]};return db[_0xae37('0x54')][_0xae37('0x29')](_0x3e4022)[_0xae37('0x17')](function(_0x13b058){_0x3c24ce['count']=_0x13b058;if(_0x738bd1[_0xae37('0x57')][_0xae37('0x64')]){_0x4aa6d5['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xae37('0x65')](_0x4aa6d5);})[_0xae37('0x17')](function(_0x497809){_0x3c24ce[_0xae37('0x66')]=_0x497809;return _0x3c24ce;})[_0xae37('0x17')](respondWithFilteredResult(_0x3cef96,_0x4aa6d5))['catch'](handleError(_0x3cef96,null));};exports[_0xae37('0x67')]=function(_0x2078b5,_0x3a38f3){var _0x232090={'raw':![],'where':{'id':_0x2078b5[_0xae37('0x68')]['id']},'include':[{'model':db[_0xae37('0x53')],'as':_0xae37('0x69')}]},_0x4226ab={};_0x4226ab[_0xae37('0x4f')]=_[_0xae37('0x58')](db['ChatWebsite'][_0xae37('0x6a')]);_0x4226ab[_0xae37('0x57')]=_[_0xae37('0x58')](_0x2078b5[_0xae37('0x57')]);_0x4226ab[_0xae37('0x59')]=_[_0xae37('0x6b')](_0x4226ab[_0xae37('0x4f')],_0x4226ab[_0xae37('0x57')]);_0x232090['attributes']=_[_0xae37('0x6b')](_0x4226ab['model'],qs[_0xae37('0x5b')](_0x2078b5[_0xae37('0x57')][_0xae37('0x5b')]));_0x232090[_0xae37('0x5a')]=_0x232090['attributes'][_0xae37('0x6c')]?_0x232090['attributes']:_0x4226ab[_0xae37('0x4f')];if(_0x2078b5[_0xae37('0x57')][_0xae37('0x64')]){_0x232090[_0xae37('0x6d')]=[{'all':!![]}];}_0x232090=_['merge']({},_0x232090,_0x2078b5[_0xae37('0x63')]);return db['ChatWebsite']['find'](_0x232090)[_0xae37('0x17')](handleEntityNotFound(_0x3a38f3,null))[_0xae37('0x17')](respondWithResult(_0x3a38f3,null))['catch'](handleError(_0x3a38f3,null));};exports[_0xae37('0x6e')]=function(_0x2462ae,_0x2ea4fe){return db[_0xae37('0x54')][_0xae37('0x6e')](_0x2462ae['body'],{})[_0xae37('0x17')](function(_0x3b32ea){var _0x25af62=_0x2462ae[_0xae37('0x6f')][_0xae37('0x2d')]({'plain':!![]});if(!_0x25af62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25af62[_0xae37('0x70')]==='user'){var _0x571e26=_0x3b32ea[_0xae37('0x2d')]({'plain':!![]});var _0x49fc2d=_0xae37('0x71');return db[_0xae37('0x72')][_0xae37('0x73')]({'where':{'name':_0x49fc2d,'userProfileId':_0x25af62['userProfileId']},'raw':!![]})['then'](function(_0x158d79){if(_0x158d79&&_0x158d79[_0xae37('0x74')]===0x0){return db[_0xae37('0x2e')][_0xae37('0x6e')]({'name':_0x571e26[_0xae37('0x2f')],'resourceId':_0x571e26['id'],'type':_0x158d79['name'],'sectionId':_0x158d79['id']},{})[_0xae37('0x17')](function(){return _0x3b32ea;});}else{return _0x3b32ea;}})['catch'](function(_0x26d95a){logger[_0xae37('0x1b')](_0xae37('0x75'),_0x26d95a);throw _0x26d95a;});}return _0x3b32ea;})[_0xae37('0x17')](respondWithResult(_0x2ea4fe,0xc9))[_0xae37('0x21')](handleError(_0x2ea4fe,null));};exports[_0xae37('0x2b')]=function(_0x40a8d4,_0xbba271){if(_0x40a8d4[_0xae37('0x76')]['id']){delete _0x40a8d4[_0xae37('0x76')]['id'];}return db[_0xae37('0x54')]['find']({'where':{'id':_0x40a8d4[_0xae37('0x68')]['id']},'include':[{'model':db['Pause'],'as':_0xae37('0x69')}]})[_0xae37('0x17')](handleEntityNotFound(_0xbba271,null))[_0xae37('0x17')](saveUpdates(_0x40a8d4[_0xae37('0x76')],null))['then'](respondWithResult(_0xbba271,null))[_0xae37('0x21')](handleError(_0xbba271,null));};exports[_0xae37('0x2c')]=function(_0x3404b6,_0x49e86d){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x3404b6[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x49e86d,null))[_0xae37('0x17')](removeEntity(_0x49e86d,null))[_0xae37('0x21')](handleError(_0x49e86d,null));};exports['describe']=function(_0xa6f321,_0x1c8b71){return db[_0xae37('0x54')][_0xae37('0x77')]()['then'](respondWithResult(_0x1c8b71,null))[_0xae37('0x21')](handleError(_0x1c8b71,null));};exports[_0xae37('0x78')]=function(_0x45fe97,_0x1e4a60){if(_0x45fe97[_0xae37('0x76')]['id']){delete _0x45fe97[_0xae37('0x76')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x45fe97[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x1e4a60,null))[_0xae37('0x17')](function(_0x2a4955){if(_0x2a4955){_0x45fe97[_0xae37('0x76')][_0xae37('0x79')]=_0x2a4955['id'];return db[_0xae37('0x7a')]['create'](_0x45fe97[_0xae37('0x76')]);}})[_0xae37('0x17')](respondWithResult(_0x1e4a60,null))['catch'](handleError(_0x1e4a60,null));};exports[_0xae37('0x7b')]=function(_0x1e8b2a,_0x82c671){var _0x564247={'raw':![],'where':{}};var _0x492582={};var _0x5734e7={'count':0x0,'rows':[]};return db[_0xae37('0x54')][_0xae37('0x7c')]({'where':{'id':_0x1e8b2a[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x82c671,null))[_0xae37('0x17')](function(_0x21c0a9){if(_0x21c0a9){_0x492582[_0xae37('0x4f')]=_['keys'](db[_0xae37('0x7a')][_0xae37('0x6a')]);_0x492582['query']=_['keys'](_0x1e8b2a[_0xae37('0x57')]);_0x492582[_0xae37('0x59')]=_[_0xae37('0x6b')](_0x492582[_0xae37('0x4f')],_0x492582['query']);_0x564247[_0xae37('0x5a')]=_[_0xae37('0x6b')](_0x492582[_0xae37('0x4f')],qs[_0xae37('0x5b')](_0x1e8b2a[_0xae37('0x57')][_0xae37('0x5b')]));_0x564247[_0xae37('0x5a')]=_0x564247['attributes'][_0xae37('0x6c')]?_0x564247[_0xae37('0x5a')]:_0x492582[_0xae37('0x4f')];if(!_0x1e8b2a['query'][_0xae37('0x5c')](_0xae37('0x5d'))){_0x564247[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x1e8b2a[_0xae37('0x57')][_0xae37('0x28')]);_0x564247[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x1e8b2a['query'][_0xae37('0x26')]);}_0x564247[_0xae37('0x5e')]=qs[_0xae37('0x7d')](_0x1e8b2a[_0xae37('0x57')][_0xae37('0x7d')]);_0x564247['where']=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x1e8b2a[_0xae37('0x57')],_0x492582[_0xae37('0x59')]));_0x564247[_0xae37('0x5f')][_0xae37('0x79')]=_0x21c0a9['id'];if(_0x1e8b2a[_0xae37('0x57')][_0xae37('0x7e')]){_0x564247[_0xae37('0x5f')]=_[_0xae37('0x61')](_0x564247[_0xae37('0x5f')],{'$or':_['map'](_0x564247[_0xae37('0x5a')],function(_0x1a3a7e){var _0xdb921={};_0xdb921[_0x1a3a7e]={'$like':'%'+_0x1e8b2a[_0xae37('0x57')][_0xae37('0x7e')]+'%'};return _0xdb921;})});}_0x564247=_['merge']({},_0x564247,_0x1e8b2a[_0xae37('0x63')]);return db[_0xae37('0x7a')][_0xae37('0x29')]({'where':_0x564247[_0xae37('0x5f')]})['then'](function(_0x4b4cc1){_0x5734e7[_0xae37('0x29')]=_0x4b4cc1;if(_0x1e8b2a[_0xae37('0x57')][_0xae37('0x64')]){_0x564247[_0xae37('0x6d')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x564247);})[_0xae37('0x17')](function(_0x3f6481){_0x5734e7[_0xae37('0x66')]=_0x3f6481;return _0x5734e7;});}})[_0xae37('0x17')](respondWithFilteredResult(_0x82c671,_0x564247))[_0xae37('0x21')](handleError(_0x82c671,null));};exports[_0xae37('0x7f')]=function(_0x5554a8,_0x35a382){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x5554a8[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x35a382,null))[_0xae37('0x17')](function(_0x2abceb){if(_0x2abceb){return _0x2abceb['removeDispositions'](_0x5554a8['query'][_0xae37('0x80')]);}})[_0xae37('0x17')](respondWithStatusCode(_0x35a382,null))[_0xae37('0x21')](handleError(_0x35a382,null));};exports[_0xae37('0x81')]=function(_0x44efa7,_0x458791){if(_0x44efa7['body']['id']){delete _0x44efa7[_0xae37('0x76')]['id'];}return db[_0xae37('0x54')]['find']({'where':{'id':_0x44efa7[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x458791,null))[_0xae37('0x17')](function(_0x88cedf){if(_0x88cedf){_0x44efa7[_0xae37('0x76')][_0xae37('0x79')]=_0x88cedf['id'];return db[_0xae37('0x82')][_0xae37('0x6e')](_0x44efa7[_0xae37('0x76')]);}})[_0xae37('0x17')](respondWithResult(_0x458791,null))['catch'](handleError(_0x458791,null));};exports['getAnswers']=function(_0x53b47e,_0x35a830){var _0x156dbc={'raw':![],'where':{}};var _0x1c8152={};var _0x4dc8de={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x53b47e[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x35a830,null))['then'](function(_0x10b32c){if(_0x10b32c){_0x1c8152['model']=_[_0xae37('0x58')](db['CannedAnswer'][_0xae37('0x6a')]);_0x1c8152['query']=_[_0xae37('0x58')](_0x53b47e[_0xae37('0x57')]);_0x1c8152[_0xae37('0x59')]=_['intersection'](_0x1c8152[_0xae37('0x4f')],_0x1c8152[_0xae37('0x57')]);_0x156dbc['attributes']=_['intersection'](_0x1c8152['model'],qs[_0xae37('0x5b')](_0x53b47e['query'][_0xae37('0x5b')]));_0x156dbc[_0xae37('0x5a')]=_0x156dbc[_0xae37('0x5a')][_0xae37('0x6c')]?_0x156dbc['attributes']:_0x1c8152[_0xae37('0x4f')];if(!_0x53b47e['query']['hasOwnProperty'](_0xae37('0x5d'))){_0x156dbc[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x53b47e['query'][_0xae37('0x28')]);_0x156dbc[_0xae37('0x26')]=qs['offset'](_0x53b47e[_0xae37('0x57')]['offset']);}_0x156dbc['order']=qs[_0xae37('0x7d')](_0x53b47e['query'][_0xae37('0x7d')]);_0x156dbc[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x53b47e[_0xae37('0x57')],_0x1c8152[_0xae37('0x59')]));_0x156dbc['where'][_0xae37('0x79')]=_0x10b32c['id'];if(_0x53b47e['query'][_0xae37('0x7e')]){_0x156dbc[_0xae37('0x5f')]=_['merge'](_0x156dbc[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x156dbc[_0xae37('0x5a')],function(_0x857872){var _0xdcda3={};_0xdcda3[_0x857872]={'$like':'%'+_0x53b47e[_0xae37('0x57')]['filter']+'%'};return _0xdcda3;})});}_0x156dbc=_[_0xae37('0x61')]({},_0x156dbc,_0x53b47e[_0xae37('0x63')]);return db[_0xae37('0x82')][_0xae37('0x29')]({'where':_0x156dbc['where']})[_0xae37('0x17')](function(_0x516aaf){_0x4dc8de['count']=_0x516aaf;if(_0x53b47e[_0xae37('0x57')][_0xae37('0x64')]){_0x156dbc[_0xae37('0x6d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xae37('0x65')](_0x156dbc);})['then'](function(_0x583403){_0x4dc8de[_0xae37('0x66')]=_0x583403;return _0x4dc8de;});}})[_0xae37('0x17')](respondWithFilteredResult(_0x35a830,_0x156dbc))['catch'](handleError(_0x35a830,null));};exports[_0xae37('0x83')]=function(_0x2fcceb,_0x279765){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x2fcceb[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x279765,null))[_0xae37('0x17')](function(_0x16d92d){if(_0x16d92d){return _0x16d92d['removeAnswers'](_0x2fcceb[_0xae37('0x57')]['ids']);}})[_0xae37('0x17')](respondWithStatusCode(_0x279765,null))[_0xae37('0x21')](handleError(_0x279765,null));};exports[_0xae37('0x84')]=function(_0x26056d,_0x5a11e1){_0x26056d[_0xae37('0x76')][_0xae37('0x85')]=_0x26056d[_0xae37('0x86')][_0xae37('0x87')];return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x26056d['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x5a11e1,null))['then'](saveUpdates(_0x26056d['body'],null))['then'](respondWithResult(_0x5a11e1,null))[_0xae37('0x21')](handleError(_0x5a11e1,null));};exports[_0xae37('0x88')]=function(_0x3fb3e8,_0x27acce){_0x3fb3e8[_0xae37('0x76')][_0xae37('0x89')]=_0x3fb3e8['file']['filename'];return db['ChatWebsite'][_0xae37('0x73')]({'where':{'id':_0x3fb3e8[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x27acce,null))['then'](saveUpdates(_0x3fb3e8[_0xae37('0x76')],null))[_0xae37('0x17')](respondWithResult(_0x27acce,null))[_0xae37('0x21')](handleError(_0x27acce,null));};exports[_0xae37('0x8a')]=function(_0x1c730b,_0x4a3c68){_0x1c730b[_0xae37('0x76')][_0xae37('0x8b')]=_0x1c730b['file']['filename'];return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x1c730b[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x4a3c68,null))[_0xae37('0x17')](saveUpdates(_0x1c730b[_0xae37('0x76')],null))[_0xae37('0x17')](respondWithResult(_0x4a3c68,null))[_0xae37('0x21')](handleError(_0x4a3c68,null));};exports['addSystemAvatar']=function(_0x1f4905,_0x45ec35){_0x1f4905[_0xae37('0x76')][_0xae37('0x8c')]=_0x1f4905[_0xae37('0x86')]['filename'];return db[_0xae37('0x54')]['find']({'where':{'id':_0x1f4905[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x45ec35,null))[_0xae37('0x17')](saveUpdates(_0x1f4905['body'],null))[_0xae37('0x17')](respondWithResult(_0x45ec35,null))['catch'](handleError(_0x45ec35,null));};exports[_0xae37('0x8d')]=function(_0x1e6633,_0x53ccdb){var _0x193f38=path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x90'));var _0x5aabca={'where':{'id':_0x1e6633[_0xae37('0x68')]['id']},'attributes':['id',_0xae37('0x85')],'raw':!![]};var _0x59bfcb=![];return require(_0xae37('0x91'))['getLicense']()['then'](function(_0x27d052){if(_0x27d052){_0x59bfcb=_0x27d052[_0xae37('0x92')];}})['then'](function(){return db['ChatWebsite'][_0xae37('0x73')](_0x5aabca);})[_0xae37('0x17')](handleEntityNotFound(_0x53ccdb,null))[_0xae37('0x17')](function(_0x13a185){if(_0x13a185){if(!_[_0xae37('0x93')](_0x13a185[_0xae37('0x85')])){if(fs[_0xae37('0x94')](path[_0xae37('0x8e')](config[_0xae37('0x8f')],'server/files/images/logos/',_0x13a185['sitepic']))&&_0x59bfcb){_0x193f38=path['join'](config['root'],'server/files/images/logos/',_0x13a185[_0xae37('0x85')]);}}return _0x53ccdb['download'](_0x193f38);}})['catch'](handleError(_0x53ccdb,null));};exports[_0xae37('0x95')]=function(_0x1552fa,_0x5d77a1){var _0x1e0d4e=path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x96'));var _0x1000ef={'where':{'id':_0x1552fa[_0xae37('0x68')]['id']},'attributes':['id',_0xae37('0x89')],'raw':!![]};return db[_0xae37('0x54')]['find'](_0x1000ef)['then'](handleEntityNotFound(_0x5d77a1,null))['then'](function(_0x1eec26){if(_0x1eec26){if(!_[_0xae37('0x93')](_0x1eec26[_0xae37('0x89')])){if(fs[_0xae37('0x94')](path['join'](config[_0xae37('0x8f')],_0xae37('0x97'),_0x1eec26[_0xae37('0x89')]))){_0x1e0d4e=path[_0xae37('0x8e')](config[_0xae37('0x8f')],'server/files/images/avatars/',_0x1eec26[_0xae37('0x89')]);}}return _0x5d77a1[_0xae37('0x98')](_0x1e0d4e);}})[_0xae37('0x21')](handleError(_0x5d77a1,null));};exports[_0xae37('0x99')]=function(_0xaa76c6,_0x1b38c1){var _0x3259e6=path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x9a'));var _0x204431={'where':{'id':_0xaa76c6[_0xae37('0x68')]['id']},'attributes':['id','customerAvatar',_0xae37('0x9b')],'raw':!![]};return db['ChatWebsite'][_0xae37('0x73')](_0x204431)['then'](handleEntityNotFound(_0x1b38c1,null))['then'](function(_0x367542){if(_0x367542){if(!_[_0xae37('0x93')](_0x367542[_0xae37('0x8b')])){if(fs[_0xae37('0x94')](path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x97'),_0x367542[_0xae37('0x8b')]))&&_0x367542[_0xae37('0x9b')]){_0x3259e6=path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x97'),_0x367542[_0xae37('0x8b')]);}}return _0x1b38c1[_0xae37('0x98')](_0x3259e6);}})[_0xae37('0x21')](handleError(_0x1b38c1,null));};exports[_0xae37('0x9c')]=function(_0x4244a2,_0x3fe905){var _0x239732=path['join'](config[_0xae37('0x8f')],'server/files/images/avatars/system_avatar.png');var _0x10b6e1={'where':{'id':_0x4244a2[_0xae37('0x68')]['id']},'attributes':['id',_0xae37('0x8c')],'raw':!![]};return db[_0xae37('0x54')][_0xae37('0x73')](_0x10b6e1)[_0xae37('0x17')](handleEntityNotFound(_0x3fe905,null))[_0xae37('0x17')](function(_0x21a6d0){if(_0x21a6d0){if(!_[_0xae37('0x93')](_0x21a6d0[_0xae37('0x8c')])){if(fs[_0xae37('0x94')](path['join'](config['root'],'server/files/images/avatars/',_0x21a6d0[_0xae37('0x8c')]))){_0x239732=path[_0xae37('0x8e')](config['root'],'server/files/images/avatars/',_0x21a6d0[_0xae37('0x8c')]);}}return _0x3fe905[_0xae37('0x98')](_0x239732);}})[_0xae37('0x21')](handleError(_0x3fe905,null));};exports[_0xae37('0x9d')]=function(_0x176cd5,_0x357a54){var _0x4f4fc5={'body':_0x176cd5['body'],'channel':'chat'};var _0x45b447=[];var _0x560bba=[];var _0x22b11f={};var _0xb15878=![];return db['CmContact'][_0xae37('0x77')]()[_0xae37('0x17')](function(_0x9be747){if(!_0x9be747){throw new db['Sequelize'][(_0xae37('0x9e'))]('no\x20available\x20attributes');}_0x45b447=_[_0xae37('0x9f')](_['keys'](_0x9be747),[_0xae37('0xa0'),_0xae37('0xa1')]);_0x560bba=_[_0xae37('0x9f')](_['keys'](_0x9be747),[_0xae37('0xa0'),_0xae37('0xa1'),_0xae37('0xa2'),_0xae37('0xa3')]);if(_0x176cd5['body']['id']){delete _0x176cd5[_0xae37('0x76')]['id'];}if(_[_0xae37('0x93')](_0x176cd5[_0xae37('0x76')][_0xae37('0xa4')])){throw new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))](_0xae37('0xa6'));}if(_[_0xae37('0x93')](_0x176cd5['body'][_0xae37('0x76')])||_0x176cd5[_0xae37('0x76')][_0xae37('0x76')]===''){throw new db[(_0xae37('0xa5'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xae37('0x93')](_0x176cd5[_0xae37('0x76')][_0xae37('0xa7')])){throw new db['Sequelize'][(_0xae37('0x9e'))](_0xae37('0xa8')+_0x560bba);}if(!_[_0xae37('0xa9')](_0x560bba,_0x176cd5['body'][_0xae37('0xa7')])){throw new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))](_0xae37('0xaa')+_0x560bba);}_0x22b11f[_0x176cd5['body'][_0xae37('0xa7')]]=_0x176cd5[_0xae37('0x76')][_0xae37('0xa4')];})[_0xae37('0x17')](function(){return db[_0xae37('0x54')]['find']({'where':{'id':_0x176cd5['params']['id']},'include':[{'model':db[_0xae37('0xab')],'as':_0xae37('0xac'),'include':[{'model':db[_0xae37('0xad')],'as':_0xae37('0xae'),'where':_0x22b11f,'limit':0x1,'order':[[_0xae37('0xa1'),_0xae37('0xaf')]]}]},{'model':db[_0xae37('0xb0')],'as':_0xae37('0xb1')},{'model':db[_0xae37('0x3c')],'as':'Interval','include':[{'model':db[_0xae37('0x3c')],'as':_0xae37('0x3d'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0xae37('0x17')](function(_0x5af5c7){if(!_0x5af5c7)throw new APINotFoundError(util[_0xae37('0x33')](_0xae37('0xb2'),_0x176cd5[_0xae37('0x68')]['id']));if(!_0x5af5c7[_0xae37('0x3c')]||!_0x5af5c7[_0xae37('0x3c')][_0xae37('0x3d')])return[_0x5af5c7,!![]];return[_0x5af5c7,checkWebsiteIntervals(_0x5af5c7)];})[_0xae37('0xb3')](function(_0x41ec26,_0x4c49c5){if(!_0x4c49c5)throw new APIOutOfIntervalError();if(!_0x41ec26[_0xae37('0xac')])return;_0x4f4fc5[_0xae37('0xb4')]=_0x41ec26;_0x4f4fc5[_0xae37('0xb5')]=_0x41ec26[_0xae37('0xac')];_0x4f4fc5[_0xae37('0xb6')]=_[_0xae37('0xb7')](_0x41ec26[_0xae37('0xb1')],['priority'],[_0xae37('0xb8')]);if(_0x4f4fc5[_0xae37('0xb4')][_0xae37('0xb1')]){delete _0x4f4fc5[_0xae37('0xb4')]['Applications'];}if(_0x4f4fc5['account'][_0xae37('0xac')]&&_0x4f4fc5[_0xae37('0xb4')][_0xae37('0xac')][_0xae37('0xae')][_0xae37('0x6c')]){return _0x4f4fc5[_0xae37('0xb4')][_0xae37('0xac')][_0xae37('0xae')][0x0];}var _0x5255b7=_['defaults'](_0x176cd5[_0xae37('0x76')],{'firstName':_0x176cd5[_0xae37('0x76')]['from'],'ListId':_0x41ec26[_0xae37('0xa3')]});_0x5255b7[_0x176cd5[_0xae37('0x76')][_0xae37('0xa7')]]=_0x176cd5[_0xae37('0x76')][_0xae37('0xa4')];return db[_0xae37('0xad')][_0xae37('0x6e')](_0x5255b7,{'fields':_0x45b447,'raw':!![]});})[_0xae37('0x17')](function(_0x1d0a6d){_0x4f4fc5[_0xae37('0xb9')]=_0x1d0a6d;var _0x23a11a=createInteractionObject(_0x176cd5[_0xae37('0x68')]['id'],_0x176cd5[_0xae37('0x76')],_0x176cd5['headers'],_0x1d0a6d);var _0x48a4a9={'ChatWebsiteId':_0x176cd5[_0xae37('0x68')]['id'],'closed':![]};if(_0x176cd5[_0xae37('0x76')][_0xae37('0xba')]){_0x48a4a9[_0xae37('0xba')]=_0x176cd5[_0xae37('0x76')]['threadId'];return db['ChatInteraction'][_0xae37('0x73')]({'where':_0x48a4a9})[_0xae37('0x17')](function(_0x4c97c6){if(_0x4c97c6){_0xb15878=!![];return _0x4c97c6;}_0x23a11a[_0xae37('0xba')]=_0x176cd5['body'][_0xae37('0xba')];_0x23a11a[_0xae37('0xbb')]=_0x176cd5[_0xae37('0x76')][_0xae37('0xbb')];return db[_0xae37('0xbc')]['create'](_0x23a11a);});}_0x48a4a9['ContactId']=_0x1d0a6d['id'];if(_0x176cd5[_0xae37('0x76')][_0xae37('0xbd')]&&_0x176cd5[_0xae37('0x76')][_0xae37('0xbd')]['id']){_0x48a4a9['id']=_0x176cd5[_0xae37('0x76')][_0xae37('0xbd')]['id'];return db[_0xae37('0xbc')][_0xae37('0x73')]({'where':_0x48a4a9})[_0xae37('0x17')](function(_0x430ab5){if(_0x430ab5){_0xb15878=!![];return _0x430ab5;}return db['ChatInteraction'][_0xae37('0x6e')](_0x23a11a);});}return db[_0xae37('0xbc')]['create'](_0x23a11a);})['then'](function(_0xbc07e){if(!_0xb15878)return _0xbc07e;var _0x48d7a6={'from':(_0x4f4fc5[_0xae37('0xb9')][_0xae37('0xbe')]||'')+'\x20'+(_0x4f4fc5[_0xae37('0xb9')][_0xae37('0xbf')]||'')};if(_0x176cd5[_0xae37('0x76')]['threadId']&&_0x176cd5['body'][_0xae37('0xc0')]&&_0x176cd5[_0xae37('0x76')][_0xae37('0xba')]!=_0x176cd5[_0xae37('0x76')][_0xae37('0xc0')]){_0x48d7a6[_0xae37('0xba')]=_0x176cd5[_0xae37('0x76')][_0xae37('0xc0')];}return _0xbc07e['update'](_0x48d7a6);})[_0xae37('0x17')](function(_0x247f97){_0x4f4fc5[_0xae37('0xbd')]=_0x247f97[_0xae37('0x2d')]({'plain':!![]});_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xc1')]=!_0xb15878;if(_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xc1')]){if(_0x4f4fc5[_0xae37('0xb4')]['autoclose']){_0x4f4fc5['applications'][_0xae37('0xc2')]({'id':0x0,'priority':_0x4f4fc5[_0xae37('0xb6')]['length']+0x1,'app':_0xae37('0xc3'),'appdata':_0xae37('0xc4'),'interval':_0xae37('0xc5')});}}return db[_0xae37('0xc6')][_0xae37('0x6e')]({'body':_0x176cd5[_0xae37('0x76')][_0xae37('0x76')],'ChatWebsiteId':_0x176cd5[_0xae37('0x68')]['id'],'ChatInteractionId':_0x247f97['id'],'direction':'in','ContactId':_0x4f4fc5['contact']['id'],'AttachmentId':_0x176cd5[_0xae37('0x76')][_0xae37('0xc7')]});})[_0xae37('0x17')](function(_0x11bc00){_0x4f4fc5['message']=_0x11bc00;if(!_0x4f4fc5[_0xae37('0xbd')]['UserId']){return;}return db[_0xae37('0xc8')]['find']({'attributes':['id',_0xae37('0x2f')],'where':{'id':_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xc9')]}});})[_0xae37('0x17')](function(_0x28b90d){if(_0x28b90d){_0x4f4fc5[_0xae37('0xb6')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x28b90d['name']+','+(_0x4f4fc5['account'][_0xae37('0xca')]||0xa),'interval':_0xae37('0xc5')});_0x4f4fc5[_0xae37('0xcb')]=!![];}if(!_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xcc')]){return;}return db[_0xae37('0xcd')][_0xae37('0x73')]({'attributes':['id',_0xae37('0x2f')],'where':{'id':_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xcc')]}});})[_0xae37('0x17')](function(_0x158620){if(_0x158620){_0x4f4fc5[_0xae37('0xb6')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x158620['name']+','+(_0x4f4fc5[_0xae37('0xb4')][_0xae37('0xce')]||0x12c),'interval':_0xae37('0xc5')});}return respondWithRpcPromise(_0xae37('0xcf'),_0xae37('0xd0'),_0x4f4fc5);})[_0xae37('0x17')](function(_0x47941c){respondWithRpcPromise(_0xae37('0xd1'),_0xae37('0xd1'),{'event':'notify','message':_0x47941c},client9002);return _0x47941c;})['then'](respondWithResult(_0x357a54,null))[_0xae37('0x21')](APIHandleError(_0x357a54));};exports[_0xae37('0xd2')]=function(_0xf15b4f,_0x11908a){var _0x48b229,_0x378f3f,_0x2234f1;var _0x55bf3c=[];var _0x20fc4e={};var _0xcd61e6=_0xf15b4f[_0xae37('0xd3')]||[];var _0x1a692c=[];var _0x3b1111;return db[_0xae37('0xad')][_0xae37('0x77')]()['then'](function(_0x19615f){if(!_0x19615f){throw new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))]('no\x20available\x20attributes');}_0x55bf3c=_[_0xae37('0x9f')](_['keys'](_0x19615f),['createdAt',_0xae37('0xa1'),'CompanyId',_0xae37('0xa3')]);if(_0xf15b4f['body']['id']){delete _0xf15b4f['body']['id'];}if(_[_0xae37('0x93')](_0xf15b4f[_0xae37('0x76')]['from'])){throw _0x11908a[_0xae37('0x23')](0x1f4)[_0xae37('0x30')](new db[(_0xae37('0xa5'))]['ValidationError'](_0xae37('0xa6')));}if(_[_0xae37('0x93')](_0xf15b4f['body'][_0xae37('0x76')])||_0xf15b4f['body']['body']===''){throw _0x11908a[_0xae37('0x23')](0x1f4)[_0xae37('0x30')](new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))](_0xae37('0xd4')));}if(_[_0xae37('0x93')](_0xf15b4f['body'][_0xae37('0xd5')])){throw _0x11908a[_0xae37('0x23')](0x1f4)['send'](new db[(_0xae37('0xa5'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x55bf3c));}if(!_[_0xae37('0xa9')](_0x55bf3c,_0xf15b4f['body'][_0xae37('0xd5')])){throw _0x11908a['status'](0x1f4)[_0xae37('0x30')](new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))](_0xae37('0xd6')+_0x55bf3c));}_0x20fc4e[_0xf15b4f[_0xae37('0x76')][_0xae37('0xd5')]]=_0xf15b4f[_0xae37('0x76')][_0xae37('0xa4')];})['then'](function(){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0xf15b4f[_0xae37('0x68')]['id']},'include':[{'model':db[_0xae37('0xab')],'as':_0xae37('0xac')},{'model':db[_0xae37('0xd7')],'as':_0xae37('0xd7')}]});})[_0xae37('0x17')](handleEntityNotFound(_0x11908a,null))[_0xae37('0x17')](function(_0x256cae){if(_0x256cae&&_0x256cae[_0xae37('0xac')]){_0x378f3f=_0x256cae;var _0x68731a=_[_0xae37('0xf')](_0xf15b4f['body'],{'firstName':_0xf15b4f[_0xae37('0x76')][_0xae37('0xa4')],'phone':_0xf15b4f[_0xae37('0x76')][_0xae37('0xa4')],'ListId':_0x256cae['ListId']});_0x68731a[_0xf15b4f[_0xae37('0x76')][_0xae37('0xd5')]]=_0xf15b4f['body'][_0xae37('0xa4')];return db[_0xae37('0xad')][_0xae37('0xd8')]({'where':_0x20fc4e,'defaults':_0x68731a});}})[_0xae37('0xb3')](function(_0x426e25){if(_0x426e25){_0x2234f1=_0x426e25;var _0x33e481=fs['readFileSync'](path[_0xae37('0x8e')](config['root'],_0xae37('0xd9')),'utf8');var _0x5115a4=ejs[_0xae37('0xda')](_0x33e481,{'body':_['toPairs'](_0xf15b4f['body'][_0xae37('0x76')]),'bodyTitle':_0x378f3f[_0xae37('0xdb')]});return db[_0xae37('0xdc')][_0xae37('0x6e')]({'body':_0x5115a4,'plainBody':htmlToText[_0xae37('0xdd')](_0x5115a4),'ContactId':_0x426e25['id'],'ChatWebsiteId':_0x378f3f['id']});}})[_0xae37('0x17')](function(_0x58056c){_0x3b1111=_0x58056c;if(_0xcd61e6[_0xae37('0x6c')]){var _0x563928=_0xcd61e6['map'](function(_0x5e08e1){return{'name':_0x5e08e1[_0xae37('0xde')],'basename':_0x5e08e1['filename'],'type':_0x5e08e1[_0xae37('0xdf')],'ChatOfflineMessageId':_0x58056c['id']};});_0x1a692c=_0x563928[_0xae37('0x3b')](_0x3c87b9=>{var _0x2bf0f4={'filename':_0x3c87b9[_0xae37('0x2f')],'path':path[_0xae37('0x8e')](config[_0xae37('0x8f')],'server','files','attachments',_0xae37('0xe0'),_0x3c87b9[_0xae37('0xe1')])};return _0x2bf0f4;});if(!_0x378f3f[_0xae37('0xe2')]){return db[_0xae37('0xe3')][_0xae37('0xe4')](function(_0x332370){return db['Attachment'][_0xae37('0xe5')](_0x563928,{'transaction':_0x332370});});}}})['then'](function(){if(_0x3b1111){_0x48b229=_0x3b1111;return db[_0xae37('0xd7')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xae37('0xe6')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xae37('0xe7')],'as':_0xae37('0xe7'),'raw':!![]}]}]});}})[_0xae37('0x17')](function(_0x1a02a8){if(_0x1a02a8&&_0x1a02a8['Smtp']&&_0x378f3f[_0xae37('0xe8')]&&_0x378f3f[_0xae37('0xe9')]){var _0x4184b4=_0x1a02a8[_0xae37('0xea')]();return respondWithRpcPromise(_0xae37('0xeb'),'sendMail',{'account':_0x4184b4,'message':{'from':util['format'](_0xae37('0xec'),_0x1a02a8[_0xae37('0x2f')],_0x1a02a8[_0xae37('0xed')]||_0x1a02a8['Smtp'][_0xae37('0x6f')]),'to':_0x378f3f[_0xae37('0xe9')],'subject':_0x378f3f[_0xae37('0xee')],'html':_0x48b229[_0xae37('0x76')],'attachments':_0x1a692c}},client9003)[_0xae37('0x17')](function(){return _0x48b229;})[_0xae37('0x21')](function(_0x25a3f8){logger[_0xae37('0x1b')](_0x25a3f8);});}})[_0xae37('0x17')](function(){if(_0x378f3f&&_0x378f3f[_0xae37('0xe2')]&&_0x378f3f[_0xae37('0xef')]){var _0x21d848=[];if(_0xcd61e6[_0xae37('0x6c')]){_0x21d848=_0xcd61e6[_0xae37('0x3b')](function(_0x181e36){return{'name':_0x181e36['originalname'],'basename':_0x181e36[_0xae37('0x87')],'type':_0x181e36['mimetype'],'ChatOfflineMessageId':_0x3b1111['id']};});}var _0x15698a;if(!_[_0xae37('0x93')](_0x378f3f['subjectOffline'])){var _0x15373e=_[_0xae37('0x3b')](_0xf15b4f['body'],function(_0x1a2467){return _0x1a2467;});var _0x662677=_[_0xae37('0xf0')](_0x15373e)[0x0];var _0x2bb2ec=_[_0xae37('0xf1')](_0x662677,function(_0x5603ad){return _0x5603ad;});_0x15698a=_0x2bb2ec[0x1][_0x378f3f[_0xae37('0xf2')]];}var _0x212e5f={'from':_0x2234f1['email'],'firstName':_0x2234f1[_0xae37('0xbe')],'lastName':_0x2234f1[_0xae37('0xbf')],'mapKey':_0xae37('0xed'),'message':{'from':_0x2234f1[_0xae37('0xed')],'to':_0x378f3f[_0xae37('0xd7')]['email'],'cc':'','subject':_['isNil'](_0x15698a)?_0x378f3f[_0xae37('0xee')]:_0x15698a,'messageId':'','sentAt':new Date(),'attach':_0x21d848[_0xae37('0x6c')],'attachments':_0x21d848,'originChannel':'Chat','ChatWebsiteId':_0x378f3f['id'],'ChatOfflineMessageId':_0x48b229['id'],'originTo':_0x378f3f['MailAccount'][_0xae37('0xed')]},'body':_0x48b229[_0xae37('0x76')]};var _0x2d04b6={'account':{'id':_0x378f3f[_0xae37('0xef')]},'body':_0x212e5f,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xae37('0xf3'),_0xae37('0xf4'),_0x2d04b6,client9001)[_0xae37('0x17')](function(){return _0x48b229;})[_0xae37('0x21')](function(_0x45b49f){logger[_0xae37('0x1b')](_0x45b49f);});}return;})[_0xae37('0x17')](function(){if(_0x48b229){return _0x48b229;}})[_0xae37('0x17')](respondWithResult(_0x11908a,null))[_0xae37('0x21')](function(){for(var _0x10b636 of _0xcd61e6){var _0xbdf25d=path['join'](config[_0xae37('0x8f')],_0xae37('0xf5'),'files','attachments',_0xae37('0xe0'),_0x10b636['filename']);fs_extra['remove'](_0xbdf25d)[_0xae37('0x21')](function(_0x3ff06a){logger[_0xae37('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0xbdf25d,_0x3ff06a);});}});};exports[_0xae37('0xf6')]=function(_0x3d3dae,_0x35288e){return db[_0xae37('0xbc')][_0xae37('0x73')]({'where':{'id':_0x3d3dae['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x35288e,null))[_0xae37('0x17')](function(_0x19c6d4){if(_0x19c6d4){return _0x19c6d4[_0xae37('0xf6')](_0x3d3dae['body'][_0xae37('0x80')],_[_0xae37('0xf7')](_0x3d3dae[_0xae37('0x76')],['ids','id'])||{});}})['then'](respondWithResult(_0x35288e,null))[_0xae37('0x21')](handleError(_0x35288e,null));};exports['getInteractions']=function(_0x5997dc,_0x3903db){var _0x504800={'raw':![],'where':{}};var _0x3cdc8e={};var _0x1f0139={'count':0x0,'rows':[]};return db[_0xae37('0x54')]['findOne']({'where':{'id':_0x5997dc[_0xae37('0x68')]['id']}})['then'](handleEntityNotFound(_0x3903db,null))[_0xae37('0x17')](function(_0x30ce42){if(_0x30ce42){_0x3cdc8e[_0xae37('0x4f')]=_['keys'](db[_0xae37('0xbc')][_0xae37('0x6a')]);_0x3cdc8e['query']=_[_0xae37('0x58')](_0x5997dc[_0xae37('0x57')]);_0x3cdc8e[_0xae37('0x59')]=_['intersection'](_0x3cdc8e[_0xae37('0x4f')],_0x3cdc8e[_0xae37('0x57')]);_0x504800[_0xae37('0x5a')]=_[_0xae37('0x6b')](_0x3cdc8e[_0xae37('0x4f')],qs[_0xae37('0x5b')](_0x5997dc['query'][_0xae37('0x5b')]));_0x504800[_0xae37('0x5a')]=_0x504800[_0xae37('0x5a')][_0xae37('0x6c')]?_0x504800['attributes']:_0x3cdc8e['model'];if(!_0x5997dc[_0xae37('0x57')][_0xae37('0x5c')](_0xae37('0x5d'))){_0x504800[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x5997dc[_0xae37('0x57')][_0xae37('0x28')]);_0x504800[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x5997dc[_0xae37('0x57')][_0xae37('0x26')]);}_0x504800[_0xae37('0x5e')]=qs['sort'](_0x5997dc[_0xae37('0x57')][_0xae37('0x7d')]);_0x504800[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x5997dc['query'],_0x3cdc8e['filters']));_0x504800[_0xae37('0x5f')][_0xae37('0x79')]=_0x30ce42['id'];if(_0x5997dc[_0xae37('0x57')][_0xae37('0x7e')]){_0x504800['where']=_[_0xae37('0x61')](_0x504800['where'],{'$or':_[_0xae37('0x3b')](_0x504800[_0xae37('0x5a')],function(_0x24bd9d){var _0x1b76f4={};_0x1b76f4[_0x24bd9d]={'$like':'%'+_0x5997dc['query']['filter']+'%'};return _0x1b76f4;})});}_0x504800=_[_0xae37('0x61')]({},_0x504800,_0x5997dc['options']);return db['ChatInteraction'][_0xae37('0x29')]({'where':_0x504800[_0xae37('0x5f')]})['then'](function(_0x48a36f){_0x1f0139[_0xae37('0x29')]=_0x48a36f;if(_0x5997dc[_0xae37('0x57')]['includeAll']){_0x504800[_0xae37('0x6d')]=[{'model':db[_0xae37('0xad')],'as':_0xae37('0xf8'),'required':![]},{'model':db[_0xae37('0xc8')],'as':_0xae37('0xf9'),'attributes':['name',_0xae37('0xfa'),'internal'],'required':![]},{'model':db[_0xae37('0xfb')],'as':_0xae37('0xfc'),'attributes':['id',_0xae37('0x2f'),_0xae37('0xfd')],'where':_0x5997dc['query'][_0xae37('0xfe')]?{'id':_0x5997dc[_0xae37('0x57')][_0xae37('0xfe')]}:undefined,'required':_0x5997dc[_0xae37('0x57')][_0xae37('0xfe')]?!![]:![]}];}return db[_0xae37('0xbc')]['findAll'](_0x504800);})[_0xae37('0x17')](function(_0xd42d1d){_0x1f0139[_0xae37('0x66')]=_0xd42d1d;return _0x1f0139;});}})[_0xae37('0x17')](respondWithFilteredResult(_0x3903db,_0x504800))[_0xae37('0x21')](handleError(_0x3903db,null));};exports[_0xae37('0xff')]=function(_0x4bc63b,_0x303460){var _0xa71229=0x0;var _0x4fcf33=0x0;var _0x12c314=![];var _0x1dd219;var _0x238b4d;return db['ChatWebsite']['find']({'where':{'id':_0x4bc63b['params']['id']},'include':[{'model':db['Interval'],'as':_0xae37('0x3c'),'include':[{'model':db[_0xae37('0x3c')],'as':_0xae37('0x3d'),'attributes':['id','interval']}]}]})[_0xae37('0x17')](handleEntityNotFound(_0x303460,null))[_0xae37('0x17')](function(_0x1ce492){if(_0x1ce492){_0x1dd219=_0x1ce492;return _0x1ce492[_0xae37('0x100')]({'raw':!![]});}})[_0xae37('0x17')](function(_0x509a46){if(_0x1dd219){if(_0x509a46){_0x238b4d=_0x509a46;}}return require(_0xae37('0x91'))[_0xae37('0x101')]();})[_0xae37('0x17')](function(_0x463c86){if(_0x463c86){_0x4fcf33=_0x463c86['virtual'];_0x12c314=_0x463c86[_0xae37('0x92')];}})[_0xae37('0x17')](function(){return db[_0xae37('0xbc')][_0xae37('0x29')]({'where':{'closed':![]}});})[_0xae37('0x17')](function(_0x7c85bc){_0xa71229=_0x7c85bc;if(_0x4fcf33&&_0x7c85bc>_0x4fcf33){return db[_0xae37('0x102')][_0xae37('0x7c')]({'where':{'id':0x1}})[_0xae37('0x17')](function(_0x325662){if(_0x325662){_0x325662['increment']('chatLicenseExceeded');}});}})[_0xae37('0x17')](function(){if(!_0x1dd219['Interval']||!_0x1dd219[_0xae37('0x3c')][_0xae37('0x3d')])return!![];return checkWebsiteIntervals(_0x1dd219);})['then'](function(_0x49a366){var _0x591c06=fs[_0xae37('0x103')](path[_0xae37('0x8e')](config[_0xae37('0x8f')],'server/files/chat/iframe.ejs'),_0xae37('0x104'));var _0x46c840=new url[(_0xae37('0x105'))](_0x1dd219[_0xae37('0x106')])[_0xae37('0x107')];var _0x4e48ac='3.5.0';var _0x2ed891=![];var _0x32ea88={'chatVersion':_0x4e48ac,'chatWebsiteAddressOrigin':_0x46c840,'remote':_0x1dd219[_0xae37('0x108')],'query':querystring[_0xae37('0x1a')](_[_0xae37('0x61')](_0x1dd219[_0xae37('0x2d')]({'plain':!![]}),{'customerIp':_0x4bc63b[_0xae37('0x109')][_0xae37('0x45')]||_0x4bc63b[_0xae37('0x109')][_0xae37('0x10a')]||_0x4bc63b[_0xae37('0x10b')][_0xae37('0x10c')]||_0x4bc63b['ip'],'referer':_0x4bc63b[_0xae37('0x109')][_0xae37('0x49')],'openedInteractions':_0xa71229,'maxInteractions':_0x4fcf33,'virtual':_0x12c314[_0xae37('0x10d')],'online':_0x49a366,'custom':_0x12c314}))['replace'](/'/g,'\x5c\x27')};_0x303460[_0xae37('0x30')](ejs[_0xae37('0xda')](Mustache['render'](_0x591c06,_0x32ea88),{'proactiveActions':_0x238b4d,'alignment':_0x1dd219[_0xae37('0x10e')],'verticalAlignment':_0x1dd219['verticalAlignment'],'div_color':_0x1dd219['color'],'labelText':_0x1dd219[_0xae37('0x10f')],'text_color':_0x1dd219[_0xae37('0x110')],'text_button_color':_0x1dd219['textButtonColor'],'button_color':_0x1dd219['color_button'],'background_color':_0x1dd219['backgroundColor'],'hideWhenOffline':_0x1dd219[_0xae37('0x111')],'intervalId':_0x1dd219[_0xae37('0x112')],'isDevelopment':_0x2ed891,'chatVersion':_0x4e48ac}));})[_0xae37('0x21')](handleError(_0x303460,null));};exports['addApplications']=function(_0x2607a0,_0x7377f9){var _0x35fe4d=_0x2607a0['params']['id'];var _0x4fbe06=_0x2607a0[_0xae37('0x76')];var _0x407501=0xc8;var _0x95edaf=null;return db[_0xae37('0xe3')][_0xae37('0xe4')]({'isolationLevel':db[_0xae37('0xe3')]['Transaction'][_0xae37('0x113')][_0xae37('0x114')]},function(_0xc9569d){return db[_0xae37('0x54')]['findOne']({'where':{'id':_0x35fe4d},'transaction':_0xc9569d})[_0xae37('0x17')](function(_0x3c536a){if(_0x3c536a){return db[_0xae37('0xb0')][_0xae37('0x2c')]({'where':{'ChatWebsiteId':_0x35fe4d},'transaction':_0xc9569d})[_0xae37('0x17')](function(){var _0x3bae48=_[_0xae37('0x3b')](_0x4fbe06,function(_0x56a951){_0x56a951['ChatWebsiteId']=_0x35fe4d;return _0x56a951;});return db['ChatApplication'][_0xae37('0xe5')](_0x3bae48,{'transaction':_0xc9569d});});}else{_0x407501=0x194;_0x95edaf=[];}});})[_0xae37('0x17')](function(){if(_0x407501!==0x194){return db['ChatApplication'][_0xae37('0x115')]({'where':{'ChatWebsiteId':_0x35fe4d},'order':_0xae37('0x116')})['then'](function(_0x23000b){_0x95edaf=_0x23000b;});}})[_0xae37('0x21')](function(_0x5ca98d){_0x407501=0x1f4;logger['error'](_0x5ca98d['stack']);if(_0x5ca98d[_0xae37('0x2f')]){delete _0x5ca98d[_0xae37('0x2f')];}_0x95edaf=_0x5ca98d;})[_0xae37('0x117')](function(){if(_0x95edaf===null){_0x7377f9['sendStatus'](_0x407501);}else{if(_0x407501===0x1f4){_0x7377f9[_0xae37('0x23')](_0x407501)[_0xae37('0x30')](_0x95edaf);}else{_0x7377f9[_0xae37('0x23')](_0x407501)['json'](_0x95edaf);}}});};exports[_0xae37('0x118')]=function(_0x4afffc,_0x2ad93b){var _0x359b49={};var _0x14129f={};var _0x5e76bf;var _0x1718b5;return db[_0xae37('0x54')][_0xae37('0x7c')]({'where':{'id':_0x4afffc[_0xae37('0x68')]['id']}})['then'](handleEntityNotFound(_0x2ad93b,null))[_0xae37('0x17')](function(_0xcc1ab1){if(_0xcc1ab1){_0x5e76bf=_0xcc1ab1;_0x14129f[_0xae37('0x4f')]=_['keys'](db[_0xae37('0xb0')][_0xae37('0x6a')]);_0x14129f[_0xae37('0x57')]=_[_0xae37('0x58')](_0x4afffc['query']);_0x14129f['filters']=_['intersection'](_0x14129f['model'],_0x14129f[_0xae37('0x57')]);_0x359b49['attributes']=_[_0xae37('0x6b')](_0x14129f['model'],qs[_0xae37('0x5b')](_0x4afffc[_0xae37('0x57')][_0xae37('0x5b')]));_0x359b49[_0xae37('0x5a')]=_0x359b49[_0xae37('0x5a')]['length']?_0x359b49[_0xae37('0x5a')]:_0x14129f[_0xae37('0x4f')];_0x359b49[_0xae37('0x5e')]=qs[_0xae37('0x7d')](_0x4afffc[_0xae37('0x57')][_0xae37('0x7d')]);_0x359b49[_0xae37('0x5f')]=qs['filters'](_[_0xae37('0x60')](_0x4afffc['query'],_0x14129f[_0xae37('0x59')]));if(_0x4afffc['query']['filter']){_0x359b49[_0xae37('0x5f')]=_['merge'](_0x359b49[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x359b49[_0xae37('0x5a')],function(_0x46e098){var _0x49ab72={};_0x49ab72[_0x46e098]={'$like':'%'+_0x4afffc[_0xae37('0x57')]['filter']+'%'};return _0x49ab72;})});}_0x359b49=_[_0xae37('0x61')]({},_0x359b49,_0x4afffc[_0xae37('0x63')]);return _0x5e76bf[_0xae37('0x118')](_0x359b49);}})[_0xae37('0x17')](function(_0x2f22ac){if(_0x2f22ac){_0x1718b5=_0x2f22ac[_0xae37('0x6c')];if(!_0x4afffc[_0xae37('0x57')][_0xae37('0x5c')](_0xae37('0x5d'))){_0x359b49[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x4afffc[_0xae37('0x57')][_0xae37('0x28')]);_0x359b49[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x4afffc[_0xae37('0x57')][_0xae37('0x26')]);}return _0x5e76bf[_0xae37('0x118')](_0x359b49);}})[_0xae37('0x17')](function(_0x322025){if(_0x322025){return _0x322025?{'count':_0x1718b5,'rows':_0x322025}:null;}})[_0xae37('0x17')](respondWithResult(_0x2ad93b,null))[_0xae37('0x21')](handleError(_0x2ad93b,null));};exports['addProactiveActions']=function(_0x3191a6,_0x131758){return db[_0xae37('0x119')][_0xae37('0x73')]({'where':{'id':_0x3191a6[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x131758,null))[_0xae37('0x17')](function(_0x4bfad5){if(_0x4bfad5){return _0x4bfad5['addProactiveActions'](_0x3191a6[_0xae37('0x76')][_0xae37('0x80')],_['omit'](_0x3191a6[_0xae37('0x76')],[_0xae37('0x80'),'id'])||{});}})[_0xae37('0x17')](respondWithResult(_0x131758,null))[_0xae37('0x21')](handleError(_0x131758,null));};exports[_0xae37('0x100')]=function(_0xa7d796,_0x135061){var _0x4d8640={};var _0x33de9f={};var _0x1c985a;var _0x2a5464;return db[_0xae37('0x54')]['findOne']({'where':{'id':_0xa7d796['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x135061,null))[_0xae37('0x17')](function(_0x34f96d){if(_0x34f96d){_0x1c985a=_0x34f96d;_0x33de9f[_0xae37('0x4f')]=_[_0xae37('0x58')](db[_0xae37('0x11a')][_0xae37('0x6a')]);_0x33de9f[_0xae37('0x57')]=_[_0xae37('0x58')](_0xa7d796[_0xae37('0x57')]);_0x33de9f[_0xae37('0x59')]=_[_0xae37('0x6b')](_0x33de9f[_0xae37('0x4f')],_0x33de9f[_0xae37('0x57')]);_0x4d8640[_0xae37('0x5a')]=_['intersection'](_0x33de9f['model'],qs[_0xae37('0x5b')](_0xa7d796[_0xae37('0x57')]['fields']));_0x4d8640['attributes']=_0x4d8640[_0xae37('0x5a')][_0xae37('0x6c')]?_0x4d8640['attributes']:_0x33de9f['model'];_0x4d8640['order']=qs[_0xae37('0x7d')](_0xa7d796[_0xae37('0x57')][_0xae37('0x7d')]);_0x4d8640[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0xa7d796[_0xae37('0x57')],_0x33de9f[_0xae37('0x59')]));if(_0xa7d796[_0xae37('0x57')]['filter']){_0x4d8640['where']=_[_0xae37('0x61')](_0x4d8640[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x4d8640[_0xae37('0x5a')],function(_0x3299ec){var _0xb2faf3={};_0xb2faf3[_0x3299ec]={'$like':'%'+_0xa7d796['query'][_0xae37('0x7e')]+'%'};return _0xb2faf3;})});}_0x4d8640=_[_0xae37('0x61')]({},_0x4d8640,_0xa7d796['options']);return _0x1c985a[_0xae37('0x100')](_0x4d8640);}})['then'](function(_0x5b7900){if(_0x5b7900){_0x2a5464=_0x5b7900['length'];if(!_0xa7d796[_0xae37('0x57')][_0xae37('0x5c')](_0xae37('0x5d'))){_0x4d8640[_0xae37('0x28')]=qs[_0xae37('0x28')](_0xa7d796['query'][_0xae37('0x28')]);_0x4d8640[_0xae37('0x26')]=qs['offset'](_0xa7d796[_0xae37('0x57')][_0xae37('0x26')]);}return _0x1c985a[_0xae37('0x100')](_0x4d8640);}})[_0xae37('0x17')](function(_0xa68616){if(_0xa68616){return _0xa68616?{'count':_0x2a5464,'rows':_0xa68616}:null;}})['then'](respondWithResult(_0x135061,null))['catch'](handleError(_0x135061,null));};exports[_0xae37('0x11b')]=function(_0x3512ad,_0x3e0a74){var _0x25955f=_0x3512ad[_0xae37('0x57')][_0xae37('0x11c')]==='false'?_0xae37('0x11d'):'onlineForm';return db[_0xae37('0x54')][_0xae37('0x73')]({'attributes':['id',_0x25955f],'where':{'id':_0x3512ad['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x3e0a74,null))[_0xae37('0x17')](function(_0x5ad4f1){if(_0x5ad4f1){var _0x14728c=_0x5ad4f1[_0x25955f];var _0x36ff36=_0x14728c&&_0x14728c[_0xae37('0x11e')]?_0x14728c[_0xae37('0x11e')]:[];_0x3e0a74[_0xae37('0x30')]({'fromKey':_['isNil'](_0x14728c['fromKey'])?undefined:_0x14728c['fromKey'],'count':_0x36ff36['length'],'rows':_0x36ff36});}})[_0xae37('0x21')](handleError(_0x3e0a74,null));};exports[_0xae37('0x11f')]=function(_0x5e536a,_0xa8362d){var _0x44eaa4={'raw':![],'where':{}};var _0x33212d={};var _0x471d52={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xae37('0x7c')]({'where':{'id':_0x5e536a[_0xae37('0x68')]['id']}})['then'](handleEntityNotFound(_0xa8362d,null))[_0xae37('0x17')](function(_0x3606f9){if(_0x3606f9){_0x33212d[_0xae37('0x4f')]=_[_0xae37('0x58')](db[_0xae37('0xdc')]['rawAttributes']);_0x33212d['query']=_['keys'](_0x5e536a[_0xae37('0x57')]);_0x33212d[_0xae37('0x59')]=_[_0xae37('0x6b')](_0x33212d[_0xae37('0x4f')],_0x33212d[_0xae37('0x57')]);_0x44eaa4[_0xae37('0x5a')]=_[_0xae37('0x6b')](_0x33212d['model'],qs[_0xae37('0x5b')](_0x5e536a[_0xae37('0x57')][_0xae37('0x5b')]));_0x44eaa4[_0xae37('0x5a')]=_0x44eaa4[_0xae37('0x5a')][_0xae37('0x6c')]?_0x44eaa4[_0xae37('0x5a')]:_0x33212d[_0xae37('0x4f')];if(!_0x5e536a[_0xae37('0x57')][_0xae37('0x5c')](_0xae37('0x5d'))){_0x44eaa4[_0xae37('0x28')]=qs['limit'](_0x5e536a['query'][_0xae37('0x28')]);_0x44eaa4[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x5e536a[_0xae37('0x57')][_0xae37('0x26')]);}_0x44eaa4[_0xae37('0x5e')]=qs['sort'](_0x5e536a[_0xae37('0x57')][_0xae37('0x7d')]);_0x44eaa4[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x5e536a[_0xae37('0x57')],_0x33212d[_0xae37('0x59')]));_0x44eaa4['where'][_0xae37('0x79')]=_0x3606f9['id'];if(_0x5e536a['query']['filter']){_0x44eaa4[_0xae37('0x5f')]=_['merge'](_0x44eaa4[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x44eaa4[_0xae37('0x5a')],function(_0x50b6ed){var _0x2f7d6c={};_0x2f7d6c[_0x50b6ed]={'$like':'%'+_0x5e536a[_0xae37('0x57')]['filter']+'%'};return _0x2f7d6c;})});}_0x44eaa4=_[_0xae37('0x61')]({},_0x44eaa4,_0x5e536a[_0xae37('0x63')]);return db[_0xae37('0xdc')][_0xae37('0x29')]({'where':_0x44eaa4['where']})[_0xae37('0x17')](function(_0x4edf14){_0x471d52['count']=_0x4edf14;if(_0x5e536a[_0xae37('0x57')][_0xae37('0x64')]){_0x44eaa4['include']=[{'all':!![]}];}else{_0x44eaa4[_0xae37('0x6d')]=[{'model':db[_0xae37('0xad')],'as':_0xae37('0xf8'),'required':![]},{'model':db[_0xae37('0x120')],'as':_0xae37('0x121'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x44eaa4);})['then'](function(_0x33bcf1){_0x471d52[_0xae37('0x66')]=_0x33bcf1;return _0x471d52;});}})[_0xae37('0x17')](respondWithFilteredResult(_0xa8362d,_0x44eaa4))[_0xae37('0x21')](handleError(_0xa8362d,null));};exports['addAgents']=function(_0x43071e,_0xaea7af){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x43071e[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0xaea7af,null))['then'](function(_0x4334ee){if(_0x4334ee){return _0x4334ee['addAgents'](_0x43071e[_0xae37('0x76')]['ids'],_[_0xae37('0xf7')](_0x43071e[_0xae37('0x76')],['ids','id'])||{})['spread'](function(_0x4a1996){for(var _0x43f3f9=0x0;_0x43f3f9<_0x43071e[_0xae37('0x76')][_0xae37('0x80')][_0xae37('0x6c')];_0x43f3f9+=0x1){socket[_0xae37('0x122')](_0xae37('0x123'),{'UserId':Number(_0x43071e['body']['ids'][_0x43f3f9]),'ChatWebsiteId':Number(_0x43071e[_0xae37('0x68')]['id'])});}return _0x4a1996;});}})['then'](respondWithResult(_0xaea7af,null))[_0xae37('0x21')](handleError(_0xaea7af,null));};exports[_0xae37('0x124')]=function(_0x4afae3,_0x4a4a4c){return db['ChatWebsite']['find']({'where':{'id':_0x4afae3[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x4a4a4c,null))[_0xae37('0x17')](function(_0x7c615e){if(_0x7c615e){return _0x7c615e[_0xae37('0x124')](_0x4afae3[_0xae37('0x57')][_0xae37('0x80')])[_0xae37('0x17')](function(){if(_['isArray'](_0x4afae3[_0xae37('0x57')][_0xae37('0x80')])){for(var _0xb70b6f=0x0;_0xb70b6f<_0x4afae3['query'][_0xae37('0x80')][_0xae37('0x6c')];_0xb70b6f+=0x1){socket[_0xae37('0x122')](_0xae37('0x125'),{'UserId':Number(_0x4afae3[_0xae37('0x57')][_0xae37('0x80')][_0xb70b6f]),'ChatWebsiteId':Number(_0x4afae3[_0xae37('0x68')]['id'])});}}else{socket['emit'](_0xae37('0x125'),{'UserId':Number(_0x4afae3[_0xae37('0x57')][_0xae37('0x80')]),'ChatWebsiteId':Number(_0x4afae3[_0xae37('0x68')]['id'])});}});}})[_0xae37('0x17')](respondWithStatusCode(_0x4a4a4c,null))['catch'](handleError(_0x4a4a4c,null));};exports['getAgents']=function(_0x56278a,_0x2f1471){var _0x2a4938={};var _0x184469={};var _0x3b1b62;var _0x265fef;return db[_0xae37('0x54')][_0xae37('0x7c')]({'where':{'id':_0x56278a['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x2f1471,null))[_0xae37('0x17')](function(_0x2c1432){if(_0x2c1432){_0x3b1b62=_0x2c1432;_0x184469[_0xae37('0x4f')]=_[_0xae37('0x58')](db[_0xae37('0xc8')]['rawAttributes']);_0x184469[_0xae37('0x57')]=_[_0xae37('0x58')](_0x56278a['query']);_0x184469['filters']=_[_0xae37('0x6b')](_0x184469[_0xae37('0x4f')],_0x184469[_0xae37('0x57')]);_0x2a4938[_0xae37('0x5a')]=_[_0xae37('0x6b')](_0x184469[_0xae37('0x4f')],qs[_0xae37('0x5b')](_0x56278a['query']['fields']));_0x2a4938[_0xae37('0x5a')]=_0x2a4938[_0xae37('0x5a')][_0xae37('0x6c')]?_0x2a4938[_0xae37('0x5a')]:_0x184469['model'];_0x2a4938[_0xae37('0x5e')]=qs[_0xae37('0x7d')](_0x56278a[_0xae37('0x57')][_0xae37('0x7d')]);_0x2a4938['where']=qs['filters'](_[_0xae37('0x60')](_0x56278a[_0xae37('0x57')],_0x184469['filters']));if(_0x56278a['query'][_0xae37('0x7e')]){_0x2a4938[_0xae37('0x5f')]=_[_0xae37('0x61')](_0x2a4938[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x2a4938[_0xae37('0x5a')],function(_0xda617c){var _0x1e83d7={};_0x1e83d7[_0xda617c]={'$like':'%'+_0x56278a[_0xae37('0x57')][_0xae37('0x7e')]+'%'};return _0x1e83d7;})});}_0x2a4938=_['merge']({},_0x2a4938,_0x56278a[_0xae37('0x63')]);return _0x3b1b62[_0xae37('0x126')](_0x2a4938);}})[_0xae37('0x17')](function(_0x3e62cf){if(_0x3e62cf){_0x265fef=_0x3e62cf['length'];if(!_0x56278a[_0xae37('0x57')]['hasOwnProperty']('nolimit')){_0x2a4938[_0xae37('0x28')]=qs['limit'](_0x56278a[_0xae37('0x57')][_0xae37('0x28')]);_0x2a4938[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x56278a[_0xae37('0x57')][_0xae37('0x26')]);}return _0x3b1b62[_0xae37('0x126')](_0x2a4938);}})[_0xae37('0x17')](function(_0x535649){if(_0x535649){return _0x535649?{'count':_0x265fef,'rows':_0x535649}:null;}})[_0xae37('0x17')](respondWithResult(_0x2f1471,null))['catch'](handleError(_0x2f1471,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index b82d80f..a648404 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 _0xd246=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0xd0d541,_0x4cf939){var _0x488821=function(_0x5e01e3){while(--_0x5e01e3){_0xd0d541['push'](_0xd0d541['shift']());}};_0x488821(++_0x4cf939);}(_0xd246,0xf5));var _0x6d24=function(_0x4eeca4,_0x5901c9){_0x4eeca4=_0x4eeca4-0x0;var _0x430031=_0xd246[_0x4eeca4];return _0x430031;};'use strict';var EventEmitter=require(_0x6d24('0x0'));var ChatWebsite=require(_0x6d24('0x1'))['db'][_0x6d24('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6d24('0x3')](0x0);var events={'afterCreate':_0x6d24('0x4'),'afterUpdate':_0x6d24('0x5'),'afterDestroy':_0x6d24('0x6')};function emitEvent(_0x51c18f){return function(_0x4e76e1,_0xfa68f3,_0x58e7fc){ChatWebsiteEvents[_0x6d24('0x7')](_0x51c18f+':'+_0x4e76e1['id'],_0x4e76e1);ChatWebsiteEvents['emit'](_0x51c18f,_0x4e76e1);_0x58e7fc(null);};}for(var e in events){if(events[_0x6d24('0x8')](e)){var event=events[e];ChatWebsite[_0x6d24('0x9')](e,emitEvent(event));}}module[_0x6d24('0xa')]=ChatWebsiteEvents; \ No newline at end of file +var _0x2a9a=['hasOwnProperty','hook','events','ChatWebsite','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a9a,0x64));var _0xa2a9=function(_0xfba519,_0x7b249b){_0xfba519=_0xfba519-0x0;var _0x15a578=_0x2a9a[_0xfba519];return _0x15a578;};'use strict';var EventEmitter=require(_0xa2a9('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xa2a9('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa2a9('0x2'),'afterDestroy':_0xa2a9('0x3')};function emitEvent(_0x39eca6){return function(_0x1a817a,_0x593d5c,_0x55dc29){ChatWebsiteEvents[_0xa2a9('0x4')](_0x39eca6+':'+_0x1a817a['id'],_0x1a817a);ChatWebsiteEvents[_0xa2a9('0x4')](_0x39eca6,_0x1a817a);_0x55dc29(null);};}for(var e in events){if(events[_0xa2a9('0x5')](e)){var event=events[e];ChatWebsite[_0xa2a9('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index fbdd643..85899d1 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 _0xa2d1=['rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5747b7,_0x365173){var _0x5219a1=function(_0x26325a){while(--_0x26325a){_0x5747b7['push'](_0x5747b7['shift']());}};_0x5219a1(++_0x365173);}(_0xa2d1,0x6f));var _0x1a2d=function(_0x55eb57,_0x1011e2){_0x55eb57=_0x55eb57-0x0;var _0x55ca29=_0xa2d1[_0x55eb57];return _0x55ca29;};'use strict';var _=require(_0x1a2d('0x0'));var util=require(_0x1a2d('0x1'));var logger=require(_0x1a2d('0x2'))(_0x1a2d('0x3'));var moment=require(_0x1a2d('0x4'));var BPromise=require(_0x1a2d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1a2d('0x6'));var config=require(_0x1a2d('0x7'));var attributes=require(_0x1a2d('0x8'));module[_0x1a2d('0x9')]=function(_0x45f868,_0x449eb6){return _0x45f868[_0x1a2d('0xa')](_0x1a2d('0xb'),attributes,{'tableName':_0x1a2d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6170=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','chat_websites','util','../../config/logger','api','bluebird'];(function(_0x50a171,_0x46a5a7){var _0x51999c=function(_0x3c3dab){while(--_0x3c3dab){_0x50a171['push'](_0x50a171['shift']());}};_0x51999c(++_0x46a5a7);}(_0x6170,0x164));var _0x0617=function(_0x1c048a,_0x138c9f){_0x1c048a=_0x1c048a-0x0;var _0x828391=_0x6170[_0x1c048a];return _0x828391;};'use strict';var _=require('lodash');var util=require(_0x0617('0x0'));var logger=require(_0x0617('0x1'))(_0x0617('0x2'));var moment=require('moment');var BPromise=require(_0x0617('0x3'));var rp=require(_0x0617('0x4'));var fs=require('fs');var path=require(_0x0617('0x5'));var rimraf=require(_0x0617('0x6'));var config=require(_0x0617('0x7'));var attributes=require(_0x0617('0x8'));module['exports']=function(_0x39af8f,_0x5eda8a){return _0x39af8f['define']('ChatWebsite',attributes,{'tableName':_0x0617('0x9'),'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 7cc5690..5e299c3 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 _0xf381=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result'];(function(_0x608efe,_0x4516e6){var _0x18f678=function(_0x4b3c7c){while(--_0x4b3c7c){_0x608efe['push'](_0x608efe['shift']());}};_0x18f678(++_0x4516e6);}(_0xf381,0x160));var _0x1f38=function(_0x5078d7,_0x1ff80a){_0x5078d7=_0x5078d7-0x0;var _0x143fee=_0xf381[_0x5078d7];return _0x143fee;};'use strict';var _=require(_0x1f38('0x0'));var util=require(_0x1f38('0x1'));var moment=require(_0x1f38('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f38('0x3'));var fs=require('fs');var Redis=require(_0x1f38('0x4'));var db=require(_0x1f38('0x5'))['db'];var utils=require(_0x1f38('0x6'));var logger=require('../../config/logger')(_0x1f38('0x7'));var config=require(_0x1f38('0x8'));var jayson=require(_0x1f38('0x9'));var client=jayson[_0x1f38('0xa')][_0x1f38('0xb')]({'port':0x232a});config[_0x1f38('0xc')]=_[_0x1f38('0xd')](config[_0x1f38('0xc')],{'host':_0x1f38('0xe'),'port':0x18eb});var socket=require(_0x1f38('0xf'))(new Redis(config[_0x1f38('0xc')]));require(_0x1f38('0x10'))['register'](socket);function respondWithRpcPromise(_0x27995c,_0x374302,_0x5e94da){return new BPromise(function(_0x44364c,_0x18b8f0){return client[_0x1f38('0x11')](_0x27995c,_0x5e94da)[_0x1f38('0x12')](function(_0x3e1cf8){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x374302,_0x1f38('0x13'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x374302,_0x1f38('0x13'),JSON['stringify'](_0x3e1cf8));if(_0x3e1cf8[_0x1f38('0x14')]){if(_0x3e1cf8['error'][_0x1f38('0x15')]===0x1f4){logger[_0x1f38('0x14')](_0x1f38('0x16'),_0x374302,_0x3e1cf8[_0x1f38('0x14')]['message']);return _0x18b8f0(_0x3e1cf8[_0x1f38('0x14')][_0x1f38('0x17')]);}logger[_0x1f38('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x374302,_0x3e1cf8[_0x1f38('0x14')][_0x1f38('0x17')]);return _0x44364c(_0x3e1cf8[_0x1f38('0x14')][_0x1f38('0x17')]);}else{logger[_0x1f38('0x18')](_0x1f38('0x16'),_0x374302,'request\x20sent');_0x44364c(_0x3e1cf8[_0x1f38('0x19')]['message']);}})[_0x1f38('0x1a')](function(_0x13babe){logger[_0x1f38('0x14')](_0x1f38('0x16'),_0x374302,_0x13babe);_0x18b8f0(_0x13babe);});});} \ No newline at end of file +var _0x9e1f=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x123414,_0x4f85f6){var _0x50e83a=function(_0x585a1e){while(--_0x585a1e){_0x123414['push'](_0x123414['shift']());}};_0x50e83a(++_0x4f85f6);}(_0x9e1f,0xfd));var _0xf9e1=function(_0x50e425,_0x3ca8d7){_0x50e425=_0x50e425-0x0;var _0x4b985d=_0x9e1f[_0x50e425];return _0x4b985d;};'use strict';var _=require(_0xf9e1('0x0'));var util=require(_0xf9e1('0x1'));var moment=require(_0xf9e1('0x2'));var BPromise=require(_0xf9e1('0x3'));var rs=require(_0xf9e1('0x4'));var fs=require('fs');var Redis=require(_0xf9e1('0x5'));var db=require(_0xf9e1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9e1('0x7'))(_0xf9e1('0x8'));var config=require('../../config/environment');var jayson=require(_0xf9e1('0x9'));var client=jayson['client'][_0xf9e1('0xa')]({'port':0x232a});config[_0xf9e1('0xb')]=_['defaults'](config[_0xf9e1('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf9e1('0xb')]));require(_0xf9e1('0xc'))[_0xf9e1('0xd')](socket);function respondWithRpcPromise(_0x18492c,_0x3c8260,_0x321a85){return new BPromise(function(_0x27ca46,_0x28f165){return client[_0xf9e1('0xe')](_0x18492c,_0x321a85)['then'](function(_0x1bf640){logger[_0xf9e1('0xf')](_0xf9e1('0x10'),_0x3c8260,_0xf9e1('0x11'));logger[_0xf9e1('0x12')](_0xf9e1('0x13'),_0x3c8260,_0xf9e1('0x11'),JSON[_0xf9e1('0x14')](_0x1bf640));if(_0x1bf640[_0xf9e1('0x15')]){if(_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x16')]===0x1f4){logger['error'](_0xf9e1('0x10'),_0x3c8260,_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x17')]);return _0x28f165(_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x17')]);}logger[_0xf9e1('0x15')](_0xf9e1('0x10'),_0x3c8260,_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x17')]);return _0x27ca46(_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x17')]);}else{logger[_0xf9e1('0xf')](_0xf9e1('0x10'),_0x3c8260,'request\x20sent');_0x27ca46(_0x1bf640['result']['message']);}})[_0xf9e1('0x18')](function(_0x4851a9){logger['error'](_0xf9e1('0x10'),_0x3c8260,_0x4851a9);_0x28f165(_0x4851a9);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index d49fded..646ee4f 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 _0x5839=['length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register'];(function(_0x2b9d5c,_0x173518){var _0x37bb93=function(_0x5515cd){while(--_0x5515cd){_0x2b9d5c['push'](_0x2b9d5c['shift']());}};_0x37bb93(++_0x173518);}(_0x5839,0x158));var _0x9583=function(_0x480957,_0x2632b7){_0x480957=_0x480957-0x0;var _0x5101d3=_0x5839[_0x480957];return _0x5101d3;};'use strict';var ChatWebsiteEvents=require(_0x9583('0x0'));var events=[_0x9583('0x1'),_0x9583('0x2'),_0x9583('0x3')];function createListener(_0x1973a3,_0x2dcfb9){return function(_0x3652ee){_0x2dcfb9[_0x9583('0x4')](_0x1973a3,_0x3652ee);};}function removeListener(_0x2a8679,_0xf89270){return function(){ChatWebsiteEvents[_0x9583('0x5')](_0x2a8679,_0xf89270);};}exports[_0x9583('0x6')]=function(_0x32bed7){for(var _0xf16798=0x0,_0x2d2d76=events[_0x9583('0x7')];_0xf16798<_0x2d2d76;_0xf16798++){var _0x1e2720=events[_0xf16798];var _0x57e550=createListener(_0x9583('0x8')+_0x1e2720,_0x32bed7);ChatWebsiteEvents['on'](_0x1e2720,_0x57e550);}}; \ No newline at end of file +var _0x79fd=['register','length','chatWebsite:','save','remove','emit','removeListener'];(function(_0x60fa35,_0x12abc6){var _0x2d9933=function(_0x310304){while(--_0x310304){_0x60fa35['push'](_0x60fa35['shift']());}};_0x2d9933(++_0x12abc6);}(_0x79fd,0x114));var _0xd79f=function(_0xb48c0,_0x35e2c1){_0xb48c0=_0xb48c0-0x0;var _0x196404=_0x79fd[_0xb48c0];return _0x196404;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xd79f('0x0'),_0xd79f('0x1'),'update'];function createListener(_0x1450d7,_0x494ce3){return function(_0x1e3d77){_0x494ce3[_0xd79f('0x2')](_0x1450d7,_0x1e3d77);};}function removeListener(_0x281ab9,_0x509f19){return function(){ChatWebsiteEvents[_0xd79f('0x3')](_0x281ab9,_0x509f19);};}exports[_0xd79f('0x4')]=function(_0x56737e){for(var _0x2d5c2d=0x0,_0x4dcfb1=events[_0xd79f('0x5')];_0x2d5c2d<_0x4dcfb1;_0x2d5c2d++){var _0x9ba835=events[_0x2d5c2d];var _0x7b155d=createListener(_0xd79f('0x6')+_0x9ba835,_0x56737e);ChatWebsiteEvents['on'](_0x9ba835,_0x7b155d);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 538c2a7..21ce322 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 _0xb1f8=['originalname','/:id/logo','single','file','addLogo','root','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now'];(function(_0x5c0dd9,_0x543e97){var _0x51b27e=function(_0x188c6d){while(--_0x188c6d){_0x5c0dd9['push'](_0x5c0dd9['shift']());}};_0x51b27e(++_0x543e97);}(_0xb1f8,0xb2));var _0x8b1f=function(_0x33fa50,_0x281caa){_0x33fa50=_0x33fa50-0x0;var _0x52d1c3=_0xb1f8[_0x33fa50];return _0x52d1c3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8b1f('0x0'));var timeout=require(_0x8b1f('0x1'));var express=require(_0x8b1f('0x2'));var router=express[_0x8b1f('0x3')]();var fs_extra=require(_0x8b1f('0x4'));var auth=require(_0x8b1f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b1f('0x6'));var controller=require('./chatWebsite.controller');router[_0x8b1f('0x7')]('/',auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x9')]);router[_0x8b1f('0x7')](_0x8b1f('0xa'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0xb')]);router['get']('/:id',auth[_0x8b1f('0x8')](),controller[_0x8b1f('0xc')]);router['get'](_0x8b1f('0xd'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0xe')]);router[_0x8b1f('0x7')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8b1f('0xf')]);router[_0x8b1f('0x7')]('/:id/logo',controller[_0x8b1f('0x10')]);router[_0x8b1f('0x7')](_0x8b1f('0x11'),controller[_0x8b1f('0x12')]);router[_0x8b1f('0x7')](_0x8b1f('0x13'),controller[_0x8b1f('0x14')]);router[_0x8b1f('0x7')]('/:id/system_avatar',controller[_0x8b1f('0x15')]);router[_0x8b1f('0x7')](_0x8b1f('0x16'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x17')]);router[_0x8b1f('0x7')](_0x8b1f('0x18'),controller['getSnippet']);router[_0x8b1f('0x7')](_0x8b1f('0x19'),auth[_0x8b1f('0x8')](),controller['getApplications']);router[_0x8b1f('0x7')](_0x8b1f('0x1a'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x1b')]);router[_0x8b1f('0x7')](_0x8b1f('0x1c'),controller[_0x8b1f('0x1d')]);router[_0x8b1f('0x7')](_0x8b1f('0x1e'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x1f')]);router[_0x8b1f('0x7')](_0x8b1f('0x20'),auth['isAuthenticated'](),controller[_0x8b1f('0x21')]);router[_0x8b1f('0x22')]('/',auth[_0x8b1f('0x8')](),controller['create']);router['post'](_0x8b1f('0xd'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x23')]);router[_0x8b1f('0x22')](_0x8b1f('0x24'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x25')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x5955cc,_0x44625f,_0x18336d){_0x18336d(null,path[_0x8b1f('0x27')](config['root'],_0x8b1f('0x28')));},'filename':function(_0x5f233a,_0x252929,_0x2d1c9e){_0x2d1c9e(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date[_0x8b1f('0x2b')](),_0x252929[_0x8b1f('0x2c')]));}})});router['post'](_0x8b1f('0x2d'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x30')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x27fca4,_0x485bba,_0x5cd42c){_0x5cd42c(null,path[_0x8b1f('0x27')](config[_0x8b1f('0x31')],_0x8b1f('0x32')));},'filename':function(_0x18f0d2,_0x1e6262,_0x2850f1){_0x2850f1(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date[_0x8b1f('0x2b')](),_0x1e6262[_0x8b1f('0x2c')]));}})});router['post'](_0x8b1f('0x11'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x33')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0xf73504,_0x6713d,_0x308cbc){_0x308cbc(null,path[_0x8b1f('0x27')](config['root'],_0x8b1f('0x32')));},'filename':function(_0x6afd48,_0x26525b,_0x1f2ff5){_0x1f2ff5(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date['now'](),_0x26525b[_0x8b1f('0x2c')]));}})});router['post'](_0x8b1f('0x13'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x34')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x5062ca,_0x35a282,_0x5e99e2){_0x5e99e2(null,path['join'](config[_0x8b1f('0x31')],_0x8b1f('0x32')));},'filename':function(_0x22eb34,_0x52b4bb,_0x4be9e9){_0x4be9e9(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date[_0x8b1f('0x2b')](),_0x52b4bb[_0x8b1f('0x2c')]));}})});router[_0x8b1f('0x22')](_0x8b1f('0x35'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x36')]);router['post'](_0x8b1f('0x37'),controller[_0x8b1f('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x183942,_0x13cc19,_0x10f4e1){const _0x5ab45c=path[_0x8b1f('0x27')](config['root'],'server/files','attachments',_0x8b1f('0x39'));fs_extra[_0x8b1f('0x3a')](_0x5ab45c,function(){_0x10f4e1(null,_0x5ab45c);});},'filename':function(_0x2eda1c,_0x52f758,_0x84b58b){const _0x4a2fe4=_0x52f758[_0x8b1f('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5bfdb2=path['extname'](_0x4a2fe4);const _0xcfd715=Date[_0x8b1f('0x2b')]()+'-'+_0x4a2fe4[_0x8b1f('0x3b')](_0x5bfdb2,'')+_0x5bfdb2;_0x84b58b(null,_0xcfd715);}})});router[_0x8b1f('0x22')](_0x8b1f('0x3c'),offlineUploadMulter[_0x8b1f('0x3d')](),controller[_0x8b1f('0x3e')]);router[_0x8b1f('0x22')](_0x8b1f('0x16'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x3f')]);router[_0x8b1f('0x22')]('/:id/applications',auth[_0x8b1f('0x8')](),controller['addApplications']);router['post']('/:id/proactive_actions',auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x40')]);router[_0x8b1f('0x22')](_0x8b1f('0x20'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x41')]);router[_0x8b1f('0x42')](_0x8b1f('0x43'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x44')]);router[_0x8b1f('0x45')](_0x8b1f('0x43'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x46')]);router[_0x8b1f('0x45')](_0x8b1f('0xd'),auth['isAuthenticated'](),controller[_0x8b1f('0x47')]);router[_0x8b1f('0x45')](_0x8b1f('0x24'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x8b1f('0x45')](_0x8b1f('0x20'),auth['isAuthenticated'](),controller[_0x8b1f('0x48')]);module[_0x8b1f('0x49')]=router; \ No newline at end of file +var _0xe22e=['post','/:id/dispositions','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','single','addLogo','diskStorage','server/files/images/avatars/','originalname','/:id/avatar','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline-chat','ensureDir','extname','replace','offline','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','/:id/users','getAgents'];(function(_0x18295a,_0x381298){var _0x2a22a1=function(_0x57151d){while(--_0x57151d){_0x18295a['push'](_0x18295a['shift']());}};_0x2a22a1(++_0x381298);}(_0xe22e,0xfa));var _0xee22=function(_0x14790f,_0x432b5f){_0x14790f=_0x14790f-0x0;var _0x5acc1f=_0xe22e[_0x14790f];return _0x5acc1f;};'use strict';var multer=require(_0xee22('0x0'));var util=require(_0xee22('0x1'));var path=require(_0xee22('0x2'));var timeout=require(_0xee22('0x3'));var express=require(_0xee22('0x4'));var router=express['Router']();var fs_extra=require(_0xee22('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xee22('0x6'));var config=require(_0xee22('0x7'));var controller=require(_0xee22('0x8'));router[_0xee22('0x9')]('/',auth[_0xee22('0xa')](),controller[_0xee22('0xb')]);router[_0xee22('0x9')](_0xee22('0xc'),auth[_0xee22('0xa')](),controller[_0xee22('0xd')]);router[_0xee22('0x9')](_0xee22('0xe'),auth[_0xee22('0xa')](),controller[_0xee22('0xf')]);router[_0xee22('0x9')]('/:id/dispositions',auth[_0xee22('0xa')](),controller[_0xee22('0x10')]);router[_0xee22('0x9')](_0xee22('0x11'),auth[_0xee22('0xa')](),controller[_0xee22('0x12')]);router[_0xee22('0x9')](_0xee22('0x13'),controller['getLogo']);router[_0xee22('0x9')]('/:id/avatar',controller[_0xee22('0x14')]);router[_0xee22('0x9')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xee22('0x9')](_0xee22('0x15'),controller[_0xee22('0x16')]);router[_0xee22('0x9')](_0xee22('0x17'),auth[_0xee22('0xa')](),controller[_0xee22('0x18')]);router[_0xee22('0x9')](_0xee22('0x19'),controller[_0xee22('0x1a')]);router[_0xee22('0x9')](_0xee22('0x1b'),auth['isAuthenticated'](),controller[_0xee22('0x1c')]);router['get']('/:id/proactive_actions',auth[_0xee22('0xa')](),controller[_0xee22('0x1d')]);router['get']('/:id/fields',controller[_0xee22('0x1e')]);router[_0xee22('0x9')](_0xee22('0x1f'),auth[_0xee22('0xa')](),controller['getOfflineMessages']);router[_0xee22('0x9')](_0xee22('0x20'),auth[_0xee22('0xa')](),controller[_0xee22('0x21')]);router[_0xee22('0x22')]('/',auth[_0xee22('0xa')](),controller['create']);router['post'](_0xee22('0x23'),auth[_0xee22('0xa')](),controller[_0xee22('0x24')]);router[_0xee22('0x22')](_0xee22('0x11'),auth[_0xee22('0xa')](),controller[_0xee22('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22d46f,_0x209e7e,_0x386d64){_0x386d64(null,path[_0xee22('0x26')](config[_0xee22('0x27')],_0xee22('0x28')));},'filename':function(_0x16c919,_0x2bdc08,_0x594f2b){_0x594f2b(null,util[_0xee22('0x29')](_0xee22('0x2a'),Date[_0xee22('0x2b')](),_0x2bdc08['originalname']));}})});router['post'](_0xee22('0x13'),upload[_0xee22('0x2c')]('file'),controller[_0xee22('0x2d')]);var upload=multer({'storage':multer[_0xee22('0x2e')]({'destination':function(_0x163da5,_0x23cac2,_0x5792a1){_0x5792a1(null,path[_0xee22('0x26')](config[_0xee22('0x27')],_0xee22('0x2f')));},'filename':function(_0x1aac97,_0x5468ef,_0x5496e4){_0x5496e4(null,util[_0xee22('0x29')](_0xee22('0x2a'),Date[_0xee22('0x2b')](),_0x5468ef[_0xee22('0x30')]));}})});router[_0xee22('0x22')](_0xee22('0x31'),upload[_0xee22('0x2c')]('file'),controller[_0xee22('0x32')]);var upload=multer({'storage':multer[_0xee22('0x2e')]({'destination':function(_0x4e194d,_0x376545,_0x59852f){_0x59852f(null,path[_0xee22('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0xdceca5,_0x38c1f0,_0x4c7713){_0x4c7713(null,util['format']('%s-%s',Date[_0xee22('0x2b')](),_0x38c1f0['originalname']));}})});router[_0xee22('0x22')](_0xee22('0x33'),upload['single']('file'),controller[_0xee22('0x34')]);var upload=multer({'storage':multer[_0xee22('0x2e')]({'destination':function(_0x5230e2,_0x7f8b47,_0x465bbd){_0x465bbd(null,path[_0xee22('0x26')](config['root'],_0xee22('0x2f')));},'filename':function(_0x4b0a2c,_0x4575d9,_0xefe1ad){_0xefe1ad(null,util[_0xee22('0x29')]('%s-%s',Date[_0xee22('0x2b')](),_0x4575d9[_0xee22('0x30')]));}})});router[_0xee22('0x22')](_0xee22('0x15'),upload['single']('file'),controller[_0xee22('0x35')]);router[_0xee22('0x22')](_0xee22('0x36'),controller[_0xee22('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x14a2df,_0x2e5e96,_0x362db0){const _0x4b0862=path[_0xee22('0x26')](config[_0xee22('0x27')],'server/files','attachments',_0xee22('0x38'));fs_extra[_0xee22('0x39')](_0x4b0862,function(){_0x362db0(null,_0x4b0862);});},'filename':function(_0x4e617f,_0x5c7669,_0x21f886){const _0x54e0f7=_0x5c7669[_0xee22('0x30')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x47f378=path[_0xee22('0x3a')](_0x54e0f7);const _0xb6128c=Date[_0xee22('0x2b')]()+'-'+_0x54e0f7[_0xee22('0x3b')](_0x47f378,'')+_0x47f378;_0x21f886(null,_0xb6128c);}})});router['post']('/:id/offline',offlineUploadMulter['any'](),controller[_0xee22('0x3c')]);router[_0xee22('0x22')]('/:id/interactions',auth[_0xee22('0xa')](),controller['addInteraction']);router['post'](_0xee22('0x1b'),auth[_0xee22('0xa')](),controller[_0xee22('0x3d')]);router[_0xee22('0x22')]('/:id/proactive_actions',auth[_0xee22('0xa')](),controller[_0xee22('0x3e')]);router[_0xee22('0x22')](_0xee22('0x20'),auth[_0xee22('0xa')](),controller[_0xee22('0x3f')]);router[_0xee22('0x40')]('/:id',auth[_0xee22('0xa')](),controller[_0xee22('0x41')]);router[_0xee22('0x42')]('/:id',auth[_0xee22('0xa')](),controller[_0xee22('0x43')]);router[_0xee22('0x42')](_0xee22('0x23'),auth[_0xee22('0xa')](),controller[_0xee22('0x44')]);router[_0xee22('0x42')](_0xee22('0x11'),auth[_0xee22('0xa')](),controller[_0xee22('0x45')]);router[_0xee22('0x42')]('/:id/users',auth[_0xee22('0xa')](),controller['removeAgents']);module[_0xee22('0x46')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index edd1cb5..98f0c59 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57b3=['env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','../components/auth/service','Router'];(function(_0x125da9,_0x559df9){var _0x1426b4=function(_0x5492b8){while(--_0x5492b8){_0x125da9['push'](_0x125da9['shift']());}};_0x1426b4(++_0x559df9);}(_0x57b3,0x72));var _0x357b=function(_0x5e9b88,_0x320778){_0x5e9b88=_0x5e9b88-0x0;var _0x471af0=_0x57b3[_0x5e9b88];return _0x471af0;};var beaverLogger=require(_0x357b('0x0'));var express=require('express');var auth=require(_0x357b('0x1'));var config=require('../config/environment');var router=express[_0x357b('0x2')]();var isProduction=config[_0x357b('0x3')]===_0x357b('0x4')||![];function clientSideLogs(_0x39a277,_0x10dccf,_0x5aed32){var _0x5d69bd=_0x39a277[_0x357b('0x5')][_0x357b('0x6')](_0x357b('0x7'));if(!_0x5d69bd){throw new Error(_0x357b('0x8'));}return beaverLogger[_0x357b('0x9')]({'uri':_0x357b('0xa'),'logger':_0x5d69bd,'enableCors':!isProduction})(_0x39a277,_0x10dccf,_0x5aed32);}router[_0x357b('0xb')](auth[_0x357b('0xc')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x1740=['express','../components/auth/service','../config/environment','Router','production','app','get','client-side-logger','expressEndpoint','/client-logs','exports','beaver-logger/server'];(function(_0x26c559,_0x3421ec){var _0x262123=function(_0x194378){while(--_0x194378){_0x26c559['push'](_0x26c559['shift']());}};_0x262123(++_0x3421ec);}(_0x1740,0x143));var _0x0174=function(_0x19efa0,_0x245b7b){_0x19efa0=_0x19efa0-0x0;var _0x374b08=_0x1740[_0x19efa0];return _0x374b08;};var beaverLogger=require(_0x0174('0x0'));var express=require(_0x0174('0x1'));var auth=require(_0x0174('0x2'));var config=require(_0x0174('0x3'));var router=express[_0x0174('0x4')]();var isProduction=config['env']===_0x0174('0x5')||![];function clientSideLogs(_0x5a2059,_0xca4224,_0x4c3726){var _0x1a3f9e=_0x5a2059[_0x0174('0x6')][_0x0174('0x7')](_0x0174('0x8'));if(!_0x1a3f9e){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x0174('0x9')]({'uri':_0x0174('0xa'),'logger':_0x1a3f9e,'enableCors':!isProduction})(_0x5a2059,_0xca4224,_0x4c3726);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x0174('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 09c2b25..c54c1c9 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 _0xe6ca=['Google','Outlook365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x5a04ac,_0x2b8b74){var _0x2406d9=function(_0x3e4237){while(--_0x3e4237){_0x5a04ac['push'](_0x5a04ac['shift']());}};_0x2406d9(++_0x2b8b74);}(_0xe6ca,0xd8));var _0xae6c=function(_0xe69ec7,_0x44d820){_0xe69ec7=_0xe69ec7-0x0;var _0x164d47=_0xe6ca[_0xe69ec7];return _0x164d47;};'use strict';var Sequelize=require(_0xae6c('0x0'));module[_0xae6c('0x1')]={'name':{'type':Sequelize[_0xae6c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xae6c('0x3')](_0xae6c('0x4'),_0xae6c('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xae6c('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0xae6c('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xae6c('0x2')],'comment':_0xae6c('0x7')},'data3':{'type':Sequelize[_0xae6c('0x2')],'comment':_0xae6c('0x8')},'data4':{'type':Sequelize[_0xae6c('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xae6c('0x9')],'comment':_0xae6c('0xa')},'data6':{'type':Sequelize[_0xae6c('0x9')],'comment':_0xae6c('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0xae6c('0xc')}}; \ No newline at end of file +var _0x62d7=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','Google','MicrosoftAzure','ENUM','Outlook365','Dynamics365'];(function(_0x52969b,_0x35eb2e){var _0x157c5b=function(_0x26ffef){while(--_0x26ffef){_0x52969b['push'](_0x52969b['shift']());}};_0x157c5b(++_0x35eb2e);}(_0x62d7,0x168));var _0x762d=function(_0x29c54e,_0xd415a2){_0x29c54e=_0x29c54e-0x0;var _0x142be0=_0x62d7[_0x29c54e];return _0x142be0;};'use strict';var Sequelize=require(_0x762d('0x0'));module[_0x762d('0x1')]={'name':{'type':Sequelize[_0x762d('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x762d('0x3'),_0x762d('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x762d('0x5')](_0x762d('0x6'),_0x762d('0x7'))},'data1':{'type':Sequelize[_0x762d('0x2')],'comment':_0x762d('0x8')},'data2':{'type':Sequelize[_0x762d('0x2')],'comment':_0x762d('0x9')},'data3':{'type':Sequelize[_0x762d('0x2')],'comment':_0x762d('0xa')},'data4':{'type':Sequelize[_0x762d('0x2')],'comment':_0x762d('0xb')},'data5':{'type':Sequelize[_0x762d('0xc')],'comment':_0x762d('0xd')},'data6':{'type':Sequelize[_0x762d('0xc')],'comment':_0x762d('0xe')},'data7':{'type':Sequelize[_0x762d('0xc')],'comment':_0x762d('0xf')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index e472413..8951d76 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 _0xdc27=['json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','error','name','send','slice','index','map','CloudProvider','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','nolimit','where','filter','merge','VIRTUAL','options','includeAll','rows','MicrosoftAzure','data3','show','include','service','catch','create','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','params','findOne','generateMicrosoftAuthorizationUrl','get','Invalid\x20state\x20parameter','from','state','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','status','end'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xdc27,0x1b4));var _0x7dc2=function(_0x363d9c,_0x40fd02){_0x363d9c=_0x363d9c-0x0;var _0x1d1c0c=_0xdc27[_0x363d9c];return _0x1d1c0c;};'use strict';var _=require(_0x7dc2('0x0'));var Redis=require(_0x7dc2('0x1'));var qs=require(_0x7dc2('0x2'));var encryptor=require(_0x7dc2('0x3'));var config=require(_0x7dc2('0x4'));var logger=require(_0x7dc2('0x5'))(_0x7dc2('0x6'));var db=require(_0x7dc2('0x7'))['db'];var oauth=require(_0x7dc2('0x8'));config[_0x7dc2('0x9')]=_[_0x7dc2('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7dc2('0xb'))(new Redis(config[_0x7dc2('0x9')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x5b059b,_0xcb6be8){_0xcb6be8=_0xcb6be8||0xcc;return function(_0x1de6ae){if(_0x1de6ae){return _0x5b059b['sendStatus'](_0xcb6be8);}return _0x5b059b[_0x7dc2('0xc')](_0xcb6be8)[_0x7dc2('0xd')]();};}function respondWithResult(_0x1d83fb,_0x52c651){_0x52c651=_0x52c651||0xc8;return function(_0x2d7ed7){if(_0x2d7ed7){return _0x1d83fb[_0x7dc2('0xc')](_0x52c651)[_0x7dc2('0xe')](_0x2d7ed7);}};}function respondWithFilteredResult(_0x3c3017,_0xc7df69){return function(_0x4072c9){if(_0x4072c9){var _0x48da8f=typeof _0xc7df69[_0x7dc2('0xf')]===_0x7dc2('0x10')&&typeof _0xc7df69[_0x7dc2('0x11')]===_0x7dc2('0x10');var _0xc9d90f=_0x4072c9[_0x7dc2('0x12')];var _0x46d2b6=_0x48da8f?0x0:_0xc7df69[_0x7dc2('0xf')];var _0x55e544=_0x48da8f?_0x4072c9[_0x7dc2('0x12')]:_0xc7df69[_0x7dc2('0xf')]+_0xc7df69[_0x7dc2('0x11')];var _0x1f8580;if(_0x55e544>=_0xc9d90f){_0x55e544=_0xc9d90f;_0x1f8580=0xc8;}else{_0x1f8580=0xce;}_0x3c3017['status'](_0x1f8580);return _0x3c3017[_0x7dc2('0x13')](_0x7dc2('0x14'),_0x46d2b6+'-'+_0x55e544+'/'+_0xc9d90f)[_0x7dc2('0xe')](_0x4072c9);}return null;};}function saveUpdates(_0x2ccbc3){return function(_0x2f1731){if(_0x2f1731){return _0x2f1731[_0x7dc2('0x15')](_0x2ccbc3)[_0x7dc2('0x16')](function(_0x189f03){return _0x189f03;});}return null;};}function removeEntity(_0x591839){return function(_0x5075fe){if(_0x5075fe){return _0x5075fe[_0x7dc2('0x17')]()[_0x7dc2('0x16')](function(){_0x591839[_0x7dc2('0xc')](0xcc)[_0x7dc2('0xd')]();});}};}function handleEntityNotFound(_0x5a0478){return function(_0x51c448){if(!_0x51c448){_0x5a0478[_0x7dc2('0x18')](0x194);}return _0x51c448;};}function handleError(_0x2ceed4,_0x43a113){_0x43a113=_0x43a113||0x1f4;return function(_0x4ef7c9){logger[_0x7dc2('0x19')](_0x4ef7c9['stack']);if(_0x4ef7c9[_0x7dc2('0x1a')]){delete _0x4ef7c9[_0x7dc2('0x1a')];}_0x2ceed4[_0x7dc2('0xc')](_0x43a113)[_0x7dc2('0x1b')](_0x4ef7c9);};}function maskClientSecret(_0x357de6){return _['padEnd'](_0x357de6[_0x7dc2('0x1c')](0x0,0x3),0x14,'*');}exports[_0x7dc2('0x1d')]=function(_0x4bdf77,_0x4809e8){var _0x2c3294={},_0x27703d={},_0x2d7b90={'count':0x0,'rows':[]};var _0x35c6a9=_[_0x7dc2('0x1e')](db[_0x7dc2('0x1f')][_0x7dc2('0x20')],function(_0x37d774){return{'name':_0x37d774['fieldName'],'type':_0x37d774[_0x7dc2('0x21')][_0x7dc2('0x22')]};});_0x27703d['model']=_[_0x7dc2('0x1e')](_0x35c6a9,_0x7dc2('0x1a'));_0x27703d[_0x7dc2('0x23')]=_[_0x7dc2('0x24')](_0x4bdf77['query']);_0x27703d[_0x7dc2('0x25')]=_['intersection'](_0x27703d[_0x7dc2('0x26')],_0x27703d[_0x7dc2('0x23')]);_0x2c3294[_0x7dc2('0x27')]=_[_0x7dc2('0x28')](_0x27703d[_0x7dc2('0x26')],qs[_0x7dc2('0x29')](_0x4bdf77[_0x7dc2('0x23')]['fields']));_0x2c3294[_0x7dc2('0x27')]=_0x2c3294[_0x7dc2('0x27')]['length']?_0x2c3294['attributes']:_0x27703d['model'];if(!_0x4bdf77[_0x7dc2('0x23')]['hasOwnProperty'](_0x7dc2('0x2a'))){_0x2c3294['limit']=qs[_0x7dc2('0x11')](_0x4bdf77[_0x7dc2('0x23')]['limit']);_0x2c3294[_0x7dc2('0xf')]=qs[_0x7dc2('0xf')](_0x4bdf77[_0x7dc2('0x23')][_0x7dc2('0xf')]);}_0x2c3294['order']=qs['sort'](_0x4bdf77['query']['sort']);_0x2c3294[_0x7dc2('0x2b')]=qs[_0x7dc2('0x25')](_['pick'](_0x4bdf77[_0x7dc2('0x23')],_0x27703d['filters']),_0x35c6a9);if(_0x4bdf77['query'][_0x7dc2('0x2c')]){_0x2c3294['where']=_[_0x7dc2('0x2d')](_0x2c3294[_0x7dc2('0x2b')],{'$or':_[_0x7dc2('0x1e')](_0x35c6a9,function(_0x5cf428){if(_0x5cf428[_0x7dc2('0x21')]!==_0x7dc2('0x2e')){var _0x533177={};_0x533177[_0x5cf428[_0x7dc2('0x1a')]]={'$like':'%'+_0x4bdf77[_0x7dc2('0x23')][_0x7dc2('0x2c')]+'%'};return _0x533177;}})});}_0x2c3294=_['merge']({},_0x2c3294,_0x4bdf77[_0x7dc2('0x2f')]);var _0x411125={'where':_0x2c3294[_0x7dc2('0x2b')]};return db[_0x7dc2('0x1f')][_0x7dc2('0x12')](_0x411125)[_0x7dc2('0x16')](function(_0x49d9b9){_0x2d7b90[_0x7dc2('0x12')]=_0x49d9b9;if(_0x4bdf77[_0x7dc2('0x23')][_0x7dc2('0x30')]){_0x2c3294['include']=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x2c3294);})[_0x7dc2('0x16')](function(_0x1498f6){_0x2d7b90[_0x7dc2('0x31')]=_[_0x7dc2('0x1e')](_0x1498f6,function(_0xda1e8e){if(_0xda1e8e['service']===_0x7dc2('0x32')){var _0xcb1ee1=encryptor['decryptString'](_0xda1e8e['data3']);_0xda1e8e[_0x7dc2('0x33')]=maskClientSecret(_0xcb1ee1);}return _0xda1e8e;});return _0x2d7b90;})[_0x7dc2('0x16')](respondWithFilteredResult(_0x4809e8,_0x2c3294))['catch'](handleError(_0x4809e8,null));};exports[_0x7dc2('0x34')]=function(_0x5ebdb4,_0x3628c7){var _0x4d0ed3={'raw':!![],'where':{'id':_0x5ebdb4['params']['id']}},_0x1f8b88={};_0x1f8b88['model']=_[_0x7dc2('0x24')](db['CloudProvider']['rawAttributes']);_0x1f8b88[_0x7dc2('0x23')]=_['keys'](_0x5ebdb4[_0x7dc2('0x23')]);_0x1f8b88['filters']=_[_0x7dc2('0x28')](_0x1f8b88[_0x7dc2('0x26')],_0x1f8b88[_0x7dc2('0x23')]);_0x4d0ed3[_0x7dc2('0x27')]=_['intersection'](_0x1f8b88[_0x7dc2('0x26')],qs[_0x7dc2('0x29')](_0x5ebdb4[_0x7dc2('0x23')][_0x7dc2('0x29')]));_0x4d0ed3['attributes']=_0x4d0ed3[_0x7dc2('0x27')]['length']?_0x4d0ed3[_0x7dc2('0x27')]:_0x1f8b88['model'];if(_0x5ebdb4['query'][_0x7dc2('0x30')]){_0x4d0ed3[_0x7dc2('0x35')]=[{'all':!![]}];}_0x4d0ed3=_[_0x7dc2('0x2d')]({},_0x4d0ed3,_0x5ebdb4[_0x7dc2('0x2f')]);return db[_0x7dc2('0x1f')]['find'](_0x4d0ed3)[_0x7dc2('0x16')](handleEntityNotFound(_0x3628c7,null))['then'](function(_0x4e1a00){if(_0x4e1a00[_0x7dc2('0x36')]===_0x7dc2('0x32')){var _0x59b8ab=encryptor['decryptString'](_0x4e1a00[_0x7dc2('0x33')]);_0x4e1a00[_0x7dc2('0x33')]=maskClientSecret(_0x59b8ab);}return _0x4e1a00;})[_0x7dc2('0x16')](respondWithResult(_0x3628c7,null))[_0x7dc2('0x37')](handleError(_0x3628c7,null));};exports[_0x7dc2('0x38')]=function(_0x1a49e5,_0x49bcfc){if(!_0x1a49e5['body'][_0x7dc2('0x1a')])throw new Error(_0x7dc2('0x39'));if(!_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x5903e4=db[_0x7dc2('0x1f')][_0x7dc2('0x20')][_0x7dc2('0x36')][_0x7dc2('0x3b')];if(!_0x5903e4[_0x7dc2('0x3c')](_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x36')]))throw new Error(_0x7dc2('0x3d')+_0x5903e4[_0x7dc2('0x3e')](',\x20'));if(_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x36')]===_0x7dc2('0x32')&&_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x33')]){_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x33')]=encryptor[_0x7dc2('0x3f')](_0x1a49e5[_0x7dc2('0x3a')]['data3']);}return db[_0x7dc2('0x1f')][_0x7dc2('0x38')](_0x1a49e5[_0x7dc2('0x3a')],{})['then'](respondWithResult(_0x49bcfc,0xc9))['catch'](handleError(_0x49bcfc,null));};exports['update']=function(_0x1f2159,_0x505282){if(_0x1f2159['body']['id']){delete _0x1f2159[_0x7dc2('0x3a')]['id'];}return db['CloudProvider'][_0x7dc2('0x40')]({'where':{'id':_0x1f2159[_0x7dc2('0x41')]['id']}})['then'](handleEntityNotFound(_0x505282,null))[_0x7dc2('0x16')](function(_0x22e619){if(_0x22e619[_0x7dc2('0x36')]==='MicrosoftAzure'&&_0x1f2159[_0x7dc2('0x3a')][_0x7dc2('0x33')]){_0x1f2159[_0x7dc2('0x3a')][_0x7dc2('0x33')]=encryptor[_0x7dc2('0x3f')](_0x1f2159[_0x7dc2('0x3a')]['data3']);}return _0x22e619;})[_0x7dc2('0x16')](saveUpdates(_0x1f2159[_0x7dc2('0x3a')],null))['then'](respondWithResult(_0x505282,null))['catch'](handleError(_0x505282,null));};exports[_0x7dc2('0x17')]=function(_0x181e7d,_0x415913){return db['CloudProvider'][_0x7dc2('0x40')]({'where':{'id':_0x181e7d[_0x7dc2('0x41')]['id']}})['then'](handleEntityNotFound(_0x415913,null))['then'](removeEntity(_0x415913,null))[_0x7dc2('0x37')](handleError(_0x415913,null));};exports['oauth2MicrosoftAuthorize']=function(_0x2e360e,_0x3ff018){return db[_0x7dc2('0x1f')][_0x7dc2('0x42')]({'where':{'id':_0x2e360e[_0x7dc2('0x41')]['id']},'raw':!![]})[_0x7dc2('0x16')](function(_0x32a48a){if(!_0x32a48a)return _0x3ff018['sendStatus'](0x194);return{'url':oauth[_0x7dc2('0x43')](_0x32a48a,_0x2e360e['user']['id'])};})['then'](respondWithResult(_0x3ff018,null))[_0x7dc2('0x37')](handleError(_0x3ff018,null));};exports['oauth2MicrosoftCallback']=function(_0x3c8fa8,_0x4998b4){var _0x389826=_0x3c8fa8[_0x7dc2('0x3a')];var _0x2311db;var _0x5ba59b;if(_0x389826[_0x7dc2('0x19')])throw _0x389826;redis[_0x7dc2('0x44')](_0x389826['state'])[_0x7dc2('0x16')](function(_0x1a060e){if(!_0x1a060e)throw new Error(_0x7dc2('0x45'));_0x2311db=JSON['parse'](_0x1a060e);var _0x932c35=Buffer[_0x7dc2('0x46')](_0x389826[_0x7dc2('0x47')],_0x7dc2('0x48'))[_0x7dc2('0x49')]('ascii');_0x5ba59b=JSON[_0x7dc2('0x4a')](_0x932c35);if(!oauth[_0x7dc2('0x4b')](_0x389826[_0x7dc2('0x4c')],_0x2311db[_0x7dc2('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x389826['state']);return oauth[_0x7dc2('0x4e')](_0x389826[_0x7dc2('0x4f')],_0x2311db);})['then'](function(_0x329803){_0x2311db[_0x7dc2('0x50')]=_0x329803[_0x7dc2('0x51')];_0x2311db[_0x7dc2('0x52')]=_0x329803[_0x7dc2('0x53')];return db[_0x7dc2('0x1f')][_0x7dc2('0x15')]({'data5':_0x2311db[_0x7dc2('0x50')],'data6':_0x2311db[_0x7dc2('0x52')]},{'where':{'id':_0x2311db['id']}});})[_0x7dc2('0x16')](function(){oauth[_0x7dc2('0x54')](_0x2311db);socket[_0x7dc2('0x55')](_0x7dc2('0x56'),{'id':_0x5ba59b['id']});return;})[_0x7dc2('0x16')](respondWithStatusCode(_0x4998b4,null))[_0x7dc2('0x37')](function(_0x57d050){if(_0x5ba59b){socket[_0x7dc2('0x55')](_0x7dc2('0x57'),{'id':_0x5ba59b['id']});}if(!_0x2311db){logger[_0x7dc2('0x19')](_0x7dc2('0x58'),_0x57d050);return _0x4998b4['status'](0x1f4)[_0x7dc2('0x1b')](_0x57d050['message']);}logger[_0x7dc2('0x19')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x2311db['id'],JSON[_0x7dc2('0x59')](_0x57d050));});}; \ No newline at end of file +var _0x2baf=['status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','show','params','options','find','decryptString','create','Name\x20parameter\x20not\x20specified','values','includes','body','join','encryptString','catch','oauth2MicrosoftAuthorize','user','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','access_token','refresh_token','update','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','end'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0x2baf,0x1cd));var _0xf2ba=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x2baf[_0x2afbb0];return _0x411ff2;};'use strict';var _=require(_0xf2ba('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0xf2ba('0x1'));var logger=require('../../config/logger')(_0xf2ba('0x2'));var db=require(_0xf2ba('0x3'))['db'];var oauth=require(_0xf2ba('0x4'));config[_0xf2ba('0x5')]=_[_0xf2ba('0x6')](config[_0xf2ba('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2ba('0x7'))(new Redis(config[_0xf2ba('0x5')]));var redis=new Redis(config[_0xf2ba('0x5')]);function respondWithStatusCode(_0x22f241,_0x3cda5e){_0x3cda5e=_0x3cda5e||0xcc;return function(_0x404681){if(_0x404681){return _0x22f241['sendStatus'](_0x3cda5e);}return _0x22f241['status'](_0x3cda5e)[_0xf2ba('0x8')]();};}function respondWithResult(_0x8b9c94,_0x2b84bf){_0x2b84bf=_0x2b84bf||0xc8;return function(_0x21ae11){if(_0x21ae11){return _0x8b9c94[_0xf2ba('0x9')](_0x2b84bf)[_0xf2ba('0xa')](_0x21ae11);}};}function respondWithFilteredResult(_0x1c1c9d,_0x4a55c9){return function(_0x15d5c6){if(_0x15d5c6){var _0x4616a2=typeof _0x4a55c9[_0xf2ba('0xb')]===_0xf2ba('0xc')&&typeof _0x4a55c9[_0xf2ba('0xd')]===_0xf2ba('0xc');var _0x266448=_0x15d5c6[_0xf2ba('0xe')];var _0x2e06d1=_0x4616a2?0x0:_0x4a55c9[_0xf2ba('0xb')];var _0x1ebec7=_0x4616a2?_0x15d5c6[_0xf2ba('0xe')]:_0x4a55c9['offset']+_0x4a55c9[_0xf2ba('0xd')];var _0x1a02ac;if(_0x1ebec7>=_0x266448){_0x1ebec7=_0x266448;_0x1a02ac=0xc8;}else{_0x1a02ac=0xce;}_0x1c1c9d[_0xf2ba('0x9')](_0x1a02ac);return _0x1c1c9d[_0xf2ba('0xf')](_0xf2ba('0x10'),_0x2e06d1+'-'+_0x1ebec7+'/'+_0x266448)[_0xf2ba('0xa')](_0x15d5c6);}return null;};}function saveUpdates(_0x3f47ea){return function(_0xdaceab){if(_0xdaceab){return _0xdaceab['update'](_0x3f47ea)['then'](function(_0x140fbe){return _0x140fbe;});}return null;};}function removeEntity(_0x1097cf){return function(_0xed32a8){if(_0xed32a8){return _0xed32a8[_0xf2ba('0x11')]()[_0xf2ba('0x12')](function(){_0x1097cf[_0xf2ba('0x9')](0xcc)[_0xf2ba('0x8')]();});}};}function handleEntityNotFound(_0x5d5b82){return function(_0x22d884){if(!_0x22d884){_0x5d5b82[_0xf2ba('0x13')](0x194);}return _0x22d884;};}function handleError(_0xbe698f,_0x52c8ef){_0x52c8ef=_0x52c8ef||0x1f4;return function(_0xa0436a){logger[_0xf2ba('0x14')](_0xa0436a[_0xf2ba('0x15')]);if(_0xa0436a[_0xf2ba('0x16')]){delete _0xa0436a[_0xf2ba('0x16')];}_0xbe698f[_0xf2ba('0x9')](_0x52c8ef)[_0xf2ba('0x17')](_0xa0436a);};}function maskClientSecret(_0x314c5b){return _[_0xf2ba('0x18')](_0x314c5b[_0xf2ba('0x19')](0x0,0x3),0x14,'*');}exports[_0xf2ba('0x1a')]=function(_0x248ff9,_0x61c2fc){var _0x5f3d62={},_0x4146bc={},_0x49894a={'count':0x0,'rows':[]};var _0x384a6f=_[_0xf2ba('0x1b')](db[_0xf2ba('0x1c')][_0xf2ba('0x1d')],function(_0x3ef2b8){return{'name':_0x3ef2b8[_0xf2ba('0x1e')],'type':_0x3ef2b8[_0xf2ba('0x1f')][_0xf2ba('0x20')]};});_0x4146bc['model']=_['map'](_0x384a6f,_0xf2ba('0x16'));_0x4146bc[_0xf2ba('0x21')]=_[_0xf2ba('0x22')](_0x248ff9[_0xf2ba('0x21')]);_0x4146bc['filters']=_[_0xf2ba('0x23')](_0x4146bc[_0xf2ba('0x24')],_0x4146bc[_0xf2ba('0x21')]);_0x5f3d62[_0xf2ba('0x25')]=_['intersection'](_0x4146bc[_0xf2ba('0x24')],qs[_0xf2ba('0x26')](_0x248ff9['query'][_0xf2ba('0x26')]));_0x5f3d62['attributes']=_0x5f3d62[_0xf2ba('0x25')][_0xf2ba('0x27')]?_0x5f3d62[_0xf2ba('0x25')]:_0x4146bc[_0xf2ba('0x24')];if(!_0x248ff9['query'][_0xf2ba('0x28')](_0xf2ba('0x29'))){_0x5f3d62[_0xf2ba('0xd')]=qs['limit'](_0x248ff9[_0xf2ba('0x21')][_0xf2ba('0xd')]);_0x5f3d62[_0xf2ba('0xb')]=qs[_0xf2ba('0xb')](_0x248ff9['query'][_0xf2ba('0xb')]);}_0x5f3d62[_0xf2ba('0x2a')]=qs[_0xf2ba('0x2b')](_0x248ff9[_0xf2ba('0x21')][_0xf2ba('0x2b')]);_0x5f3d62[_0xf2ba('0x2c')]=qs[_0xf2ba('0x2d')](_['pick'](_0x248ff9['query'],_0x4146bc[_0xf2ba('0x2d')]),_0x384a6f);if(_0x248ff9[_0xf2ba('0x21')][_0xf2ba('0x2e')]){_0x5f3d62[_0xf2ba('0x2c')]=_['merge'](_0x5f3d62[_0xf2ba('0x2c')],{'$or':_[_0xf2ba('0x1b')](_0x384a6f,function(_0x532063){if(_0x532063[_0xf2ba('0x1f')]!=='VIRTUAL'){var _0x1e375e={};_0x1e375e[_0x532063[_0xf2ba('0x16')]]={'$like':'%'+_0x248ff9[_0xf2ba('0x21')][_0xf2ba('0x2e')]+'%'};return _0x1e375e;}})});}_0x5f3d62=_[_0xf2ba('0x2f')]({},_0x5f3d62,_0x248ff9['options']);var _0x2cd520={'where':_0x5f3d62[_0xf2ba('0x2c')]};return db[_0xf2ba('0x1c')][_0xf2ba('0xe')](_0x2cd520)[_0xf2ba('0x12')](function(_0x3da1cd){_0x49894a['count']=_0x3da1cd;if(_0x248ff9['query'][_0xf2ba('0x30')]){_0x5f3d62[_0xf2ba('0x31')]=[{'all':!![]}];}return db[_0xf2ba('0x1c')][_0xf2ba('0x32')](_0x5f3d62);})[_0xf2ba('0x12')](function(_0x314b9f){_0x49894a[_0xf2ba('0x33')]=_[_0xf2ba('0x1b')](_0x314b9f,function(_0x4362a0){if(_0x4362a0[_0xf2ba('0x34')]===_0xf2ba('0x35')){var _0x50a991=encryptor['decryptString'](_0x4362a0[_0xf2ba('0x36')]);_0x4362a0[_0xf2ba('0x36')]=maskClientSecret(_0x50a991);}return _0x4362a0;});return _0x49894a;})[_0xf2ba('0x12')](respondWithFilteredResult(_0x61c2fc,_0x5f3d62))['catch'](handleError(_0x61c2fc,null));};exports[_0xf2ba('0x37')]=function(_0x1a65bb,_0x520abc){var _0x4c435d={'raw':!![],'where':{'id':_0x1a65bb[_0xf2ba('0x38')]['id']}},_0x174a83={};_0x174a83[_0xf2ba('0x24')]=_['keys'](db['CloudProvider'][_0xf2ba('0x1d')]);_0x174a83[_0xf2ba('0x21')]=_[_0xf2ba('0x22')](_0x1a65bb[_0xf2ba('0x21')]);_0x174a83[_0xf2ba('0x2d')]=_['intersection'](_0x174a83[_0xf2ba('0x24')],_0x174a83[_0xf2ba('0x21')]);_0x4c435d[_0xf2ba('0x25')]=_[_0xf2ba('0x23')](_0x174a83[_0xf2ba('0x24')],qs[_0xf2ba('0x26')](_0x1a65bb[_0xf2ba('0x21')]['fields']));_0x4c435d[_0xf2ba('0x25')]=_0x4c435d[_0xf2ba('0x25')][_0xf2ba('0x27')]?_0x4c435d[_0xf2ba('0x25')]:_0x174a83[_0xf2ba('0x24')];if(_0x1a65bb[_0xf2ba('0x21')]['includeAll']){_0x4c435d[_0xf2ba('0x31')]=[{'all':!![]}];}_0x4c435d=_[_0xf2ba('0x2f')]({},_0x4c435d,_0x1a65bb[_0xf2ba('0x39')]);return db[_0xf2ba('0x1c')][_0xf2ba('0x3a')](_0x4c435d)[_0xf2ba('0x12')](handleEntityNotFound(_0x520abc,null))[_0xf2ba('0x12')](function(_0x23a300){if(_0x23a300[_0xf2ba('0x34')]===_0xf2ba('0x35')){var _0x57bf3c=encryptor[_0xf2ba('0x3b')](_0x23a300['data3']);_0x23a300['data3']=maskClientSecret(_0x57bf3c);}return _0x23a300;})[_0xf2ba('0x12')](respondWithResult(_0x520abc,null))['catch'](handleError(_0x520abc,null));};exports[_0xf2ba('0x3c')]=function(_0x56816f,_0x420925){if(!_0x56816f['body'][_0xf2ba('0x16')])throw new Error(_0xf2ba('0x3d'));if(!_0x56816f['body']['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x229f62=db[_0xf2ba('0x1c')][_0xf2ba('0x1d')]['service'][_0xf2ba('0x3e')];if(!_0x229f62[_0xf2ba('0x3f')](_0x56816f[_0xf2ba('0x40')][_0xf2ba('0x34')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x229f62[_0xf2ba('0x41')](',\x20'));if(_0x56816f[_0xf2ba('0x40')]['service']===_0xf2ba('0x35')&&_0x56816f[_0xf2ba('0x40')][_0xf2ba('0x36')]){_0x56816f[_0xf2ba('0x40')][_0xf2ba('0x36')]=encryptor[_0xf2ba('0x42')](_0x56816f[_0xf2ba('0x40')]['data3']);}return db['CloudProvider'][_0xf2ba('0x3c')](_0x56816f['body'],{})[_0xf2ba('0x12')](respondWithResult(_0x420925,0xc9))['catch'](handleError(_0x420925,null));};exports['update']=function(_0x3f17c5,_0x4552c5){if(_0x3f17c5[_0xf2ba('0x40')]['id']){delete _0x3f17c5[_0xf2ba('0x40')]['id'];}return db[_0xf2ba('0x1c')][_0xf2ba('0x3a')]({'where':{'id':_0x3f17c5[_0xf2ba('0x38')]['id']}})[_0xf2ba('0x12')](handleEntityNotFound(_0x4552c5,null))['then'](function(_0x12f45c){if(_0x12f45c[_0xf2ba('0x34')]===_0xf2ba('0x35')&&_0x3f17c5[_0xf2ba('0x40')][_0xf2ba('0x36')]){_0x3f17c5['body'][_0xf2ba('0x36')]=encryptor['encryptString'](_0x3f17c5[_0xf2ba('0x40')][_0xf2ba('0x36')]);}return _0x12f45c;})[_0xf2ba('0x12')](saveUpdates(_0x3f17c5[_0xf2ba('0x40')],null))[_0xf2ba('0x12')](respondWithResult(_0x4552c5,null))['catch'](handleError(_0x4552c5,null));};exports[_0xf2ba('0x11')]=function(_0x496e50,_0x2afe6d){return db[_0xf2ba('0x1c')][_0xf2ba('0x3a')]({'where':{'id':_0x496e50['params']['id']}})[_0xf2ba('0x12')](handleEntityNotFound(_0x2afe6d,null))[_0xf2ba('0x12')](removeEntity(_0x2afe6d,null))[_0xf2ba('0x43')](handleError(_0x2afe6d,null));};exports[_0xf2ba('0x44')]=function(_0x239142,_0x570282){return db[_0xf2ba('0x1c')]['findOne']({'where':{'id':_0x239142[_0xf2ba('0x38')]['id']},'raw':!![]})['then'](function(_0x36f413){if(!_0x36f413)return _0x570282['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x36f413,_0x239142[_0xf2ba('0x45')]['id'])};})[_0xf2ba('0x12')](respondWithResult(_0x570282,null))[_0xf2ba('0x43')](handleError(_0x570282,null));};exports['oauth2MicrosoftCallback']=function(_0x135851,_0x553759){var _0x384453=_0x135851[_0xf2ba('0x40')];var _0x529656;var _0x1d9aac;if(_0x384453[_0xf2ba('0x14')])throw _0x384453;redis[_0xf2ba('0x46')](_0x384453[_0xf2ba('0x47')])['then'](function(_0x2ab535){if(!_0x2ab535)throw new Error(_0xf2ba('0x48'));_0x529656=JSON[_0xf2ba('0x49')](_0x2ab535);var _0x50230b=Buffer[_0xf2ba('0x4a')](_0x384453['state'],_0xf2ba('0x4b'))[_0xf2ba('0x4c')](_0xf2ba('0x4d'));_0x1d9aac=JSON[_0xf2ba('0x49')](_0x50230b);if(!oauth[_0xf2ba('0x4e')](_0x384453[_0xf2ba('0x4f')],_0x529656[_0xf2ba('0x50')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xf2ba('0x51')](_0x384453['state']);return oauth[_0xf2ba('0x52')](_0x384453[_0xf2ba('0x53')],_0x529656);})['then'](function(_0x92bb48){_0x529656['data5']=_0x92bb48[_0xf2ba('0x54')];_0x529656['data6']=_0x92bb48[_0xf2ba('0x55')];return db[_0xf2ba('0x1c')][_0xf2ba('0x56')]({'data5':_0x529656['data5'],'data6':_0x529656['data6']},{'where':{'id':_0x529656['id']}});})[_0xf2ba('0x12')](function(){oauth[_0xf2ba('0x57')](_0x529656);socket[_0xf2ba('0x58')]('microsoftAuthorization:success',{'id':_0x1d9aac['id']});return;})[_0xf2ba('0x12')](respondWithStatusCode(_0x553759,null))[_0xf2ba('0x43')](function(_0x30496c){if(_0x1d9aac){socket[_0xf2ba('0x58')](_0xf2ba('0x59'),{'id':_0x1d9aac['id']});}if(!_0x529656){logger[_0xf2ba('0x14')](_0xf2ba('0x5a'),_0x30496c);return _0x553759[_0xf2ba('0x9')](0x1f4)[_0xf2ba('0x17')](_0x30496c[_0xf2ba('0x5b')]);}logger[_0xf2ba('0x14')](_0xf2ba('0x5c'),_0x529656['id'],JSON[_0xf2ba('0x5d')](_0x30496c));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index a6d5e7e..e3b5ead 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 _0xa061=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','util','../../config/logger','api','moment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa061,0x194));var _0x1a06=function(_0x1e8f35,_0x3db390){_0x1e8f35=_0x1e8f35-0x0;var _0x446c13=_0xa061[_0x1e8f35];return _0x446c13;};'use strict';var _=require('lodash');var util=require(_0x1a06('0x0'));var logger=require(_0x1a06('0x1'))(_0x1a06('0x2'));var moment=require(_0x1a06('0x3'));var BPromise=require(_0x1a06('0x4'));var rp=require(_0x1a06('0x5'));var fs=require('fs');var path=require(_0x1a06('0x6'));var rimraf=require(_0x1a06('0x7'));var config=require(_0x1a06('0x8'));var attributes=require(_0x1a06('0x9'));module['exports']=function(_0x6cd83c,_0xe07b0){return _0x6cd83c[_0x1a06('0xa')](_0x1a06('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3af5=['CloudProvider','cloud_providers','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x3af5,0x1db));var _0x53af=function(_0x4277b0,_0x2b2cf6){_0x4277b0=_0x4277b0-0x0;var _0x57c93f=_0x3af5[_0x4277b0];return _0x57c93f;};'use strict';var _=require(_0x53af('0x0'));var util=require(_0x53af('0x1'));var logger=require(_0x53af('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x53af('0x3'));var fs=require('fs');var path=require(_0x53af('0x4'));var rimraf=require(_0x53af('0x5'));var config=require(_0x53af('0x6'));var attributes=require(_0x53af('0x7'));module['exports']=function(_0x41c533,_0xcb68dc){return _0x41c533[_0x53af('0x8')](_0x53af('0x9'),attributes,{'tableName':_0x53af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 75de99b..f4551a1 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf65b=['https://outlook.office365.com/IMAP.AccessAsUser.All','replace','data2','code','id_token','from','toString','base64','randomBytes','hex','response_type','data4','form_post','scope','state','nonce','login','oauth2Claims','oauth2/','data1','set','stringify','payload','issuer','aud','audience','unix','exp','then','data3','CloudProvider','findOne','refresh_token','data6','POST','{TENANT_ID}','data5','access_token','update','error','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join'];(function(_0x3d3c35,_0x4957eb){var _0x1ae732=function(_0x487c49){while(--_0x487c49){_0x3d3c35['push'](_0x3d3c35['shift']());}};_0x1ae732(++_0x4957eb);}(_0xf65b,0x78));var _0xbf65=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf65b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbf65('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xbf65('0x1'));var Redis=require(_0xbf65('0x2'));var rp=require(_0xbf65('0x3'));var util=require('util');var encryptor=require(_0xbf65('0x4'));var config=require(_0xbf65('0x5'));var logger=require(_0xbf65('0x6'))('api');var schedule=require(_0xbf65('0x7'));var db=require(_0xbf65('0x8'))['db'];config[_0xbf65('0x9')]=_['defaults'](config[_0xbf65('0x9')],{'host':_0xbf65('0xa'),'port':0x18eb});var redis=new Redis(config[_0xbf65('0x9')]);var MICROSOFT_AUTH_URL=_0xbf65('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xbf65('0xc'),_0xbf65('0xd'),_0xbf65('0xe'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0xbf65('0xf'),_0xbf65('0x10')],'Dynamics365':[_0xbf65('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xbf65('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xbf65('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3938bc){var _0x2ddf0d=_[_0xbf65('0x13')](AZURE_AUTH_SCOPES[_0x3938bc[_0xbf65('0x14')]]);if(_0x3938bc[_0xbf65('0x14')]===_0xbf65('0x15'))_0x2ddf0d[_0xbf65('0x16')](_0x3938bc[_0xbf65('0x17')]+_0xbf65('0x18'));return _0x2ddf0d[_0xbf65('0x19')]('\x20');}function getAccessTokenScope(_0x62780d){if(_0x62780d['type']==='Outlook365')return _0xbf65('0x1a');if(_0x62780d[_0xbf65('0x14')]==='Dynamics365')return _0x62780d[_0xbf65('0x17')]+_0xbf65('0x18');}function generateMicrosoftAuthorizationUrl(_0x4eeb47,_0xa03291){var _0x5c3441=MICROSOFT_AUTH_URL[_0xbf65('0x1b')]('{TENANT_ID}',_0x4eeb47[_0xbf65('0x1c')]);var _0x4b3a87=[_0xbf65('0x1d'),_0xbf65('0x1e')];var _0x3146e7=Buffer[_0xbf65('0x1f')](JSON['stringify']({'id':_0xa03291}))[_0xbf65('0x20')](_0xbf65('0x21'));var _0x40f866=crypto[_0xbf65('0x22')](0x10)[_0xbf65('0x20')](_0xbf65('0x23'));var _0x3f8cc7=getAuthorizationScopes(_0x4eeb47);var _0x32382f=[{'key':'client_id','value':_0x4eeb47['data1']},{'key':_0xbf65('0x24'),'value':encodeURIComponent(_0x4b3a87[_0xbf65('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x4eeb47[_0xbf65('0x25')]},{'key':'response_mode','value':_0xbf65('0x26')},{'key':_0xbf65('0x27'),'value':encodeURIComponent(_0x3f8cc7)},{'key':_0xbf65('0x28'),'value':_0x3146e7},{'key':_0xbf65('0x29'),'value':_0x40f866},{'key':'prompt','value':_0xbf65('0x2a')}];var _0x247cca=_0x5c3441+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xbf65('0x13')](_0x32382f,function(_0x15e705){return _0x15e705['key']+'='+_0x15e705['value'];})['join']('&');_0x4eeb47[_0xbf65('0x2b')]={'issuer':_0x5c3441[_0xbf65('0x1b')](_0xbf65('0x2c'),''),'audience':_0x4eeb47[_0xbf65('0x2d')],'state':_0x3146e7,'nonce':_0x40f866};redis[_0xbf65('0x2e')](_0x3146e7,JSON[_0xbf65('0x2f')](_0x4eeb47));return _0x247cca;}function isValidIdToken(_0x48177c,_0x5da0d5){try{var _0x5e05b9=jwt['decode'](_0x48177c,{'complete':!![]});var _0x3847bf=_0x5e05b9[_0xbf65('0x30')];if(_0x3847bf['iss']!==_0x5da0d5[_0xbf65('0x31')])return![];if(_0x3847bf[_0xbf65('0x32')]!==_0x5da0d5[_0xbf65('0x33')])return![];if(_0x3847bf[_0xbf65('0x29')]!==_0x5da0d5['nonce'])return![];if(moment()['isAfter'](moment[_0xbf65('0x34')](_0x3847bf[_0xbf65('0x35')])))return![];return!![];}catch(_0x1d2aed){throw _0x1d2aed;}}function refreshOauth2MicrosoftAccessToken(_0x52a09c){return Promise['resolve']()[_0xbf65('0x36')](function(){if(_0x52a09c[_0xbf65('0x37')])return _0x52a09c;return db[_0xbf65('0x38')][_0xbf65('0x39')]({'where':{'id':_0x52a09c['id']},'raw':!![]});})['then'](function(_0x35ab4d){var _0x1f958a={'grant_type':_0xbf65('0x3a'),'refresh_token':_0x35ab4d[_0xbf65('0x3b')],'scope':getAccessTokenScope(_0x35ab4d),'redirect_uri':_0x35ab4d[_0xbf65('0x25')],'client_id':_0x35ab4d[_0xbf65('0x2d')],'client_secret':encryptor['decryptString'](_0x35ab4d[_0xbf65('0x37')])};var _0x46d0d6={'method':_0xbf65('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xbf65('0x1b')](_0xbf65('0x3d'),_0x35ab4d['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1f958a,'json':!![]};return rp(_0x46d0d6);})['then'](function(_0xef712a){_0x52a09c[_0xbf65('0x3e')]=_0xef712a[_0xbf65('0x3f')];_0x52a09c[_0xbf65('0x3b')]=_0xef712a[_0xbf65('0x3a')];return db[_0xbf65('0x38')][_0xbf65('0x40')]({'data5':_0x52a09c[_0xbf65('0x3e')],'data6':_0x52a09c['data6']},{'where':{'id':_0x52a09c['id']}});})['then'](function(){return _0x52a09c;})['catch'](function(_0x2ecd4e){logger[_0xbf65('0x41')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x52a09c['id'],_0x2ecd4e);});}function getOauth2MicrosoftAccessToken(_0x99bc59,_0x4abf68){var _0x4d712d={'grant_type':'authorization_code','code':_0x99bc59,'scope':getAccessTokenScope(_0x4abf68),'redirect_uri':_0x4abf68[_0xbf65('0x25')],'client_id':_0x4abf68[_0xbf65('0x2d')],'client_secret':encryptor['decryptString'](_0x4abf68['data3'])};var _0x577871={'method':_0xbf65('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xbf65('0x1b')](_0xbf65('0x3d'),_0x4abf68[_0xbf65('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4d712d,'json':!![]};return rp(_0x577871);}function startRefreshInterval(_0x2941be){var _0x3f01eb=schedule[_0xbf65('0x42')];if(_0x3f01eb[_0x2941be['id']])clearInterval(_0x3f01eb[_0x2941be['id']]);_0x3f01eb[_0x2941be['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xbf65('0x43')](this,{'id':_0x2941be['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3f01eb;}function startAllRefreshIntervals(){return db[_0xbf65('0x38')][_0xbf65('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0xae8d45){var _0x4ffaf0=_0xae8d45['map'](function(_0x4351a8){return refreshOauth2MicrosoftAccessToken(_0x4351a8)[_0xbf65('0x36')](function(_0x1f3126){startRefreshInterval(_0x1f3126);});});return Promise[_0xbf65('0x45')](_0x4ffaf0);})['catch'](function(_0x22625b){var _0x47a76f=_0x22625b?util[_0xbf65('0x46')](_0x22625b,{'showHidden':![],'depth':null}):'';logger[_0xbf65('0x41')](_0xbf65('0x47'),_0x47a76f);});}module[_0xbf65('0x48')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xdbb3=['bind','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','data7','/.default','join','replace','data2','code','from','stringify','toString','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','refresh_token','data6','decryptString','{TENANT_ID}','data5','access_token','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data4','POST','intervals'];(function(_0x8d5e52,_0x40df7b){var _0x563f85=function(_0xcd4da7){while(--_0xcd4da7){_0x8d5e52['push'](_0x8d5e52['shift']());}};_0x563f85(++_0x40df7b);}(_0xdbb3,0x1ea));var _0x3dbb=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xdbb3[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x3dbb('0x0'));var crypto=require(_0x3dbb('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x3dbb('0x2'));var Redis=require(_0x3dbb('0x3'));var rp=require(_0x3dbb('0x4'));var util=require(_0x3dbb('0x5'));var encryptor=require(_0x3dbb('0x6'));var config=require(_0x3dbb('0x7'));var logger=require(_0x3dbb('0x8'))(_0x3dbb('0x9'));var schedule=require(_0x3dbb('0xa'));var db=require(_0x3dbb('0xb'))['db'];config[_0x3dbb('0xc')]=_[_0x3dbb('0xd')](config[_0x3dbb('0xc')],{'host':_0x3dbb('0xe'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x3dbb('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x3dbb('0x10'),_0x3dbb('0x11'),_0x3dbb('0x12'),_0x3dbb('0x13'),_0x3dbb('0x14'),_0x3dbb('0x15'),_0x3dbb('0x16')],'Dynamics365':['openid',_0x3dbb('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0x3dbb('0x17');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x334860){var _0x3a3dc0=_[_0x3dbb('0x18')](AZURE_AUTH_SCOPES[_0x334860[_0x3dbb('0x19')]]);if(_0x334860[_0x3dbb('0x19')]===_0x3dbb('0x1a'))_0x3a3dc0['push'](_0x334860[_0x3dbb('0x1b')]+_0x3dbb('0x1c'));return _0x3a3dc0[_0x3dbb('0x1d')]('\x20');}function getAccessTokenScope(_0x5b7f2d){if(_0x5b7f2d[_0x3dbb('0x19')]==='Outlook365')return _0x3dbb('0x14');if(_0x5b7f2d[_0x3dbb('0x19')]===_0x3dbb('0x1a'))return _0x5b7f2d[_0x3dbb('0x1b')]+_0x3dbb('0x1c');}function generateMicrosoftAuthorizationUrl(_0x141ba0,_0x39293b){var _0x2eb46c=MICROSOFT_AUTH_URL[_0x3dbb('0x1e')]('{TENANT_ID}',_0x141ba0[_0x3dbb('0x1f')]);var _0x5ce3a7=[_0x3dbb('0x20'),'id_token'];var _0x504686=Buffer[_0x3dbb('0x21')](JSON[_0x3dbb('0x22')]({'id':_0x39293b}))[_0x3dbb('0x23')]('base64');var _0x33aea8=crypto[_0x3dbb('0x24')](0x10)['toString'](_0x3dbb('0x25'));var _0x25330e=getAuthorizationScopes(_0x141ba0);var _0x341ae3=[{'key':_0x3dbb('0x26'),'value':_0x141ba0[_0x3dbb('0x27')]},{'key':_0x3dbb('0x28'),'value':encodeURIComponent(_0x5ce3a7['join']('\x20'))},{'key':_0x3dbb('0x29'),'value':_0x141ba0['data4']},{'key':_0x3dbb('0x2a'),'value':_0x3dbb('0x2b')},{'key':_0x3dbb('0x2c'),'value':encodeURIComponent(_0x25330e)},{'key':_0x3dbb('0x2d'),'value':_0x504686},{'key':_0x3dbb('0x2e'),'value':_0x33aea8},{'key':_0x3dbb('0x2f'),'value':'login'}];var _0x560c6d=_0x2eb46c+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x341ae3,function(_0x3b15cc){return _0x3b15cc['key']+'='+_0x3b15cc[_0x3dbb('0x30')];})[_0x3dbb('0x1d')]('&');_0x141ba0[_0x3dbb('0x31')]={'issuer':_0x2eb46c[_0x3dbb('0x1e')](_0x3dbb('0x32'),''),'audience':_0x141ba0[_0x3dbb('0x27')],'state':_0x504686,'nonce':_0x33aea8};redis[_0x3dbb('0x33')](_0x504686,JSON[_0x3dbb('0x22')](_0x141ba0));return _0x560c6d;}function isValidIdToken(_0x1813ee,_0x423641){try{var _0x18ccd=jwt[_0x3dbb('0x34')](_0x1813ee,{'complete':!![]});var _0xe30df1=_0x18ccd[_0x3dbb('0x35')];if(_0xe30df1[_0x3dbb('0x36')]!==_0x423641[_0x3dbb('0x37')])return![];if(_0xe30df1[_0x3dbb('0x38')]!==_0x423641[_0x3dbb('0x39')])return![];if(_0xe30df1[_0x3dbb('0x2e')]!==_0x423641[_0x3dbb('0x2e')])return![];if(moment()[_0x3dbb('0x3a')](moment[_0x3dbb('0x3b')](_0xe30df1[_0x3dbb('0x3c')])))return![];return!![];}catch(_0x5e5ec4){throw _0x5e5ec4;}}function refreshOauth2MicrosoftAccessToken(_0x41a73a){return Promise[_0x3dbb('0x3d')]()[_0x3dbb('0x3e')](function(){if(_0x41a73a[_0x3dbb('0x3f')])return _0x41a73a;return db[_0x3dbb('0x40')]['findOne']({'where':{'id':_0x41a73a['id']},'raw':!![]});})[_0x3dbb('0x3e')](function(_0x18b66f){var _0x4453dd={'grant_type':_0x3dbb('0x41'),'refresh_token':_0x18b66f[_0x3dbb('0x42')],'scope':getAccessTokenScope(_0x18b66f),'redirect_uri':_0x18b66f['data4'],'client_id':_0x18b66f[_0x3dbb('0x27')],'client_secret':encryptor[_0x3dbb('0x43')](_0x18b66f[_0x3dbb('0x3f')])};var _0x42006e={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x3dbb('0x44'),_0x18b66f[_0x3dbb('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4453dd,'json':!![]};return rp(_0x42006e);})['then'](function(_0x339a6a){_0x41a73a[_0x3dbb('0x45')]=_0x339a6a[_0x3dbb('0x46')];_0x41a73a['data6']=_0x339a6a[_0x3dbb('0x41')];return db[_0x3dbb('0x40')]['update']({'data5':_0x41a73a[_0x3dbb('0x45')],'data6':_0x41a73a['data6']},{'where':{'id':_0x41a73a['id']}});})[_0x3dbb('0x3e')](function(){return _0x41a73a;})['catch'](function(_0x118c69){logger[_0x3dbb('0x47')](_0x3dbb('0x48'),_0x41a73a['id'],_0x118c69);});}function getOauth2MicrosoftAccessToken(_0x2f9fc4,_0x15a44e){var _0x57ac89={'grant_type':_0x3dbb('0x49'),'code':_0x2f9fc4,'scope':getAccessTokenScope(_0x15a44e),'redirect_uri':_0x15a44e[_0x3dbb('0x4a')],'client_id':_0x15a44e[_0x3dbb('0x27')],'client_secret':encryptor['decryptString'](_0x15a44e[_0x3dbb('0x3f')])};var _0x239cc7={'method':_0x3dbb('0x4b'),'uri':MICROSOFT_AUTH_URL['replace'](_0x3dbb('0x44'),_0x15a44e[_0x3dbb('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x57ac89,'json':!![]};return rp(_0x239cc7);}function startRefreshInterval(_0x275144){var _0x2249b9=schedule[_0x3dbb('0x4c')];if(_0x2249b9[_0x275144['id']])clearInterval(_0x2249b9[_0x275144['id']]);_0x2249b9[_0x275144['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x3dbb('0x4d')](this,{'id':_0x275144['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3dbb('0x4c')]=_0x2249b9;}function startAllRefreshIntervals(){return db[_0x3dbb('0x40')][_0x3dbb('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x17999d){var _0x2b983e=_0x17999d['map'](function(_0x132867){return refreshOauth2MicrosoftAccessToken(_0x132867)[_0x3dbb('0x3e')](function(_0xa89f1e){startRefreshInterval(_0xa89f1e);});});return Promise[_0x3dbb('0x4f')](_0x2b983e);})['catch'](function(_0x249ce6){var _0x33d9cf=_0x249ce6?util['inspect'](_0x249ce6,{'showHidden':![],'depth':null}):'';logger[_0x3dbb('0x47')](_0x3dbb('0x50'),_0x33d9cf);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 1c5966d..894586b 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 _0xd05a=['info','result','catch','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd05a,0x143));var _0xad05=function(_0x4433f9,_0xa9dd70){_0x4433f9=_0x4433f9-0x0;var _0x1bc092=_0xd05a[_0x4433f9];return _0x1bc092;};'use strict';var _=require('lodash');var util=require(_0xad05('0x0'));var moment=require(_0xad05('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad05('0x2'));var logger=require(_0xad05('0x3'))(_0xad05('0x4'));var config=require(_0xad05('0x5'));var jayson=require(_0xad05('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39ddaf,_0x45303c,_0xd12d76){return new BPromise(function(_0x565f85,_0x17ec26){return client[_0xad05('0x7')](_0x39ddaf,_0xd12d76)[_0xad05('0x8')](function(_0x573acb){logger['info'](_0xad05('0x9'),_0x45303c,'request\x20sent');logger[_0xad05('0xa')](_0xad05('0xb'),_0x45303c,_0xad05('0xc'),JSON[_0xad05('0xd')](_0x573acb));if(_0x573acb[_0xad05('0xe')]){if(_0x573acb[_0xad05('0xe')][_0xad05('0xf')]===0x1f4){logger[_0xad05('0xe')](_0xad05('0x9'),_0x45303c,_0x573acb[_0xad05('0xe')]['message']);return _0x17ec26(_0x573acb[_0xad05('0xe')]['message']);}logger[_0xad05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0x573acb[_0xad05('0xe')][_0xad05('0x10')]);return _0x565f85(_0x573acb[_0xad05('0xe')]['message']);}else{logger[_0xad05('0x11')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0xad05('0xc'));_0x565f85(_0x573acb[_0xad05('0x12')][_0xad05('0x10')]);}})[_0xad05('0x13')](function(_0x43ab03){logger[_0xad05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0x43ab03);_0x17ec26(_0x43ab03);});});} \ No newline at end of file +var _0x7d06=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7d06,0x158));var _0x67d0=function(_0x204a77,_0x40ae18){_0x204a77=_0x204a77-0x0;var _0x348407=_0x7d06[_0x204a77];return _0x348407;};'use strict';var _=require(_0x67d0('0x0'));var util=require(_0x67d0('0x1'));var moment=require(_0x67d0('0x2'));var BPromise=require(_0x67d0('0x3'));var rs=require(_0x67d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67d0('0x5'))['db'];var utils=require(_0x67d0('0x6'));var logger=require(_0x67d0('0x7'))('rpc');var config=require(_0x67d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x67d0('0x9')][_0x67d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x367f1d,_0xe4789b,_0x3c9976){return new BPromise(function(_0x481a08,_0x358986){return client['request'](_0x367f1d,_0x3c9976)[_0x67d0('0xb')](function(_0x5916d0){logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));logger[_0x67d0('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0xe4789b,_0x67d0('0xe'),JSON['stringify'](_0x5916d0));if(_0x5916d0['error']){if(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x11')]===0x1f4){logger['error'](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')]['message']);return _0x358986(_0x5916d0[_0x67d0('0x10')]['message']);}logger[_0x67d0('0x10')](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);return _0x481a08(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);}else{logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));_0x481a08(_0x5916d0[_0x67d0('0x13')]['message']);}})[_0x67d0('0x14')](function(_0xa1b889){logger['error'](_0x67d0('0xd'),_0xe4789b,_0xa1b889);_0x358986(_0xa1b889);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 3885a40..52d0047 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7a54,0x106));var _0x47a5=function(_0x3c03e6,_0x2a7f15){_0x3c03e6=_0x3c03e6-0x0;var _0xf6c0e7=_0x7a54[_0x3c03e6];return _0xf6c0e7;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file +var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x39bf17,_0x319d5e){var _0x1ccf1d=function(_0x1244ec){while(--_0x1244ec){_0x39bf17['push'](_0x39bf17['shift']());}};_0x1ccf1d(++_0x319d5e);}(_0x2ef3,0xba));var _0x32ef=function(_0x28cffc,_0x59e0c3){_0x28cffc=_0x28cffc-0x0;var _0x4253d4=_0x2ef3[_0x28cffc];return _0x4253d4;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 9ae73f9..faa2c47 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 _0x47b4=['STRING','name','sequelize'];(function(_0x47c88e,_0x404a49){var _0x301c8c=function(_0x4abf34){while(--_0x4abf34){_0x47c88e['push'](_0x47c88e['shift']());}};_0x301c8c(++_0x404a49);}(_0x47b4,0x1e2));var _0x447b=function(_0x22f215,_0x1e877c){_0x22f215=_0x22f215-0x0;var _0x3971a5=_0x47b4[_0x22f215];return _0x3971a5;};'use strict';var Sequelize=require(_0x447b('0x0'));module['exports']={'name':{'type':Sequelize[_0x447b('0x1')],'unique':_0x447b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x447b('0x1')]},'website':{'type':Sequelize[_0x447b('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x447b('0x1')]},'type':{'type':Sequelize[_0x447b('0x1')]},'street':{'type':Sequelize[_0x447b('0x1')]},'postalCode':{'type':Sequelize[_0x447b('0x1')]},'city':{'type':Sequelize[_0x447b('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x447b('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x447b('0x1')]},'sCity':{'type':Sequelize[_0x447b('0x1')]},'sCountry':{'type':Sequelize[_0x447b('0x1')]},'description':{'type':Sequelize[_0x447b('0x1')]}}; \ No newline at end of file +var _0x6824=['exports','STRING','sequelize'];(function(_0xbb0ce8,_0xb63549){var _0x1a1b17=function(_0x171af3){while(--_0x171af3){_0xbb0ce8['push'](_0xbb0ce8['shift']());}};_0x1a1b17(++_0xb63549);}(_0x6824,0x80));var _0x4682=function(_0x248d93,_0xf9322c){_0x248d93=_0x248d93-0x0;var _0x1abac3=_0x6824[_0x248d93];return _0x1abac3;};'use strict';var Sequelize=require(_0x4682('0x0'));module[_0x4682('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4682('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x4682('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x4682('0x2')]},'type':{'type':Sequelize[_0x4682('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4682('0x2')]},'country':{'type':Sequelize[_0x4682('0x2')]},'email':{'type':Sequelize[_0x4682('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x4682('0x2')]},'sPostalCode':{'type':Sequelize[_0x4682('0x2')]},'sCity':{'type':Sequelize[_0x4682('0x2')]},'sCountry':{'type':Sequelize[_0x4682('0x2')]},'description':{'type':Sequelize[_0x4682('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 2ba454f..b41ee60 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 _0xb835=['query','intersection','attributes','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','options','includeAll','include','rows','catch','show','params','rawAttributes','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Companies','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','CmCompany','model','keys'];(function(_0xabfe60,_0x2c61fe){var _0x3aa022=function(_0xcb4e81){while(--_0xcb4e81){_0xabfe60['push'](_0xabfe60['shift']());}};_0x3aa022(++_0x2c61fe);}(_0xb835,0xd3));var _0x5b83=function(_0x5bb1f2,_0x18a496){_0x5bb1f2=_0x5bb1f2-0x0;var _0xc894b5=_0xb835[_0x5bb1f2];return _0xc894b5;};'use strict';var emlformat=require(_0x5b83('0x0'));var rimraf=require(_0x5b83('0x1'));var zipdir=require(_0x5b83('0x2'));var jsonpatch=require(_0x5b83('0x3'));var rp=require('request-promise');var moment=require(_0x5b83('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5b83('0x5'));var util=require(_0x5b83('0x6'));var path=require(_0x5b83('0x7'));var sox=require('sox');var csv=require(_0x5b83('0x8'));var ejs=require(_0x5b83('0x9'));var fs=require('fs');var fs_extra=require(_0x5b83('0xa'));var _=require(_0x5b83('0xb'));var squel=require(_0x5b83('0xc'));var crypto=require(_0x5b83('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5b83('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5b83('0xf'));var Papa=require(_0x5b83('0x10'));var Redis=require(_0x5b83('0x11'));var authService=require(_0x5b83('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5b83('0x13'));var hardwareService=require(_0x5b83('0x14'));var logger=require('../../config/logger')(_0x5b83('0x15'));var utils=require(_0x5b83('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5b83('0x17'));var db=require(_0x5b83('0x18'))['db'];function respondWithStatusCode(_0x3fdbcc,_0x1405d0){_0x1405d0=_0x1405d0||0xcc;return function(_0x2832d9){if(_0x2832d9){return _0x3fdbcc['sendStatus'](_0x1405d0);}return _0x3fdbcc[_0x5b83('0x19')](_0x1405d0)['end']();};}function respondWithResult(_0x3a457e,_0x3ef26e){_0x3ef26e=_0x3ef26e||0xc8;return function(_0x15009c){if(_0x15009c){return _0x3a457e[_0x5b83('0x19')](_0x3ef26e)[_0x5b83('0x1a')](_0x15009c);}};}function respondWithFilteredResult(_0x425721,_0x16690f){return function(_0x5d3905){if(_0x5d3905){var _0x3bc03b=typeof _0x16690f[_0x5b83('0x1b')]==='undefined'&&typeof _0x16690f[_0x5b83('0x1c')]===_0x5b83('0x1d');var _0x4f71c5=_0x5d3905[_0x5b83('0x1e')];var _0x1fc455=_0x3bc03b?0x0:_0x16690f[_0x5b83('0x1b')];var _0x38d642=_0x3bc03b?_0x5d3905[_0x5b83('0x1e')]:_0x16690f[_0x5b83('0x1b')]+_0x16690f['limit'];var _0x2ffbe2;if(_0x38d642>=_0x4f71c5){_0x38d642=_0x4f71c5;_0x2ffbe2=0xc8;}else{_0x2ffbe2=0xce;}_0x425721['status'](_0x2ffbe2);return _0x425721[_0x5b83('0x1f')](_0x5b83('0x20'),_0x1fc455+'-'+_0x38d642+'/'+_0x4f71c5)['json'](_0x5d3905);}return null;};}function patchUpdates(_0x419ea9){return function(_0x404190){try{jsonpatch[_0x5b83('0x21')](_0x404190,_0x419ea9,!![]);}catch(_0x544920){return BPromise[_0x5b83('0x22')](_0x544920);}return _0x404190[_0x5b83('0x23')]();};}function saveUpdates(_0x208da5,_0x5b3214){return function(_0x20c599){if(_0x20c599){return _0x20c599[_0x5b83('0x24')](_0x208da5)[_0x5b83('0x25')](function(_0x2517e0){return _0x2517e0;});}return null;};}function removeEntity(_0x106c8d,_0x18fa83){return function(_0x5425f2){if(_0x5425f2){return _0x5425f2[_0x5b83('0x26')]()['then'](function(){var _0x247b01=_0x5425f2['get']({'plain':!![]});var _0x5c1f70='Companies';return db[_0x5b83('0x27')]['destroy']({'where':{'type':_0x5c1f70,'resourceId':_0x247b01['id']}})[_0x5b83('0x25')](function(){return _0x5425f2;});})[_0x5b83('0x25')](function(){_0x106c8d[_0x5b83('0x19')](0xcc)[_0x5b83('0x28')]();});}};}function handleEntityNotFound(_0x2123d2,_0x1049e2){return function(_0x366b91){if(!_0x366b91){_0x2123d2[_0x5b83('0x29')](0x194);}return _0x366b91;};}function handleError(_0x5c4ed0,_0x50d8bf){_0x50d8bf=_0x50d8bf||0x1f4;return function(_0xfb5327){logger[_0x5b83('0x2a')](_0xfb5327[_0x5b83('0x2b')]);if(_0xfb5327[_0x5b83('0x2c')]){delete _0xfb5327[_0x5b83('0x2c')];}_0x5c4ed0['status'](_0x50d8bf)[_0x5b83('0x2d')](_0xfb5327);};}exports[_0x5b83('0x2e')]=function(_0xadf965,_0x30beba){var _0x31ce6f={},_0x4d6c34={},_0x12623b={'count':0x0,'rows':[]};return db[_0x5b83('0x2f')]['describe']()[_0x5b83('0x25')](function(_0x22c5be){_0x4d6c34[_0x5b83('0x30')]=_[_0x5b83('0x31')](_0x22c5be);_0x4d6c34[_0x5b83('0x32')]=_[_0x5b83('0x31')](_0xadf965[_0x5b83('0x32')]);_0x4d6c34['filters']=_[_0x5b83('0x33')](_0x4d6c34[_0x5b83('0x30')],_0x4d6c34[_0x5b83('0x32')]);_0x31ce6f[_0x5b83('0x34')]=_[_0x5b83('0x33')](_0x4d6c34['model'],qs['fields'](_0xadf965[_0x5b83('0x32')]['fields']));_0x31ce6f[_0x5b83('0x34')]=_0x31ce6f[_0x5b83('0x34')]['length']?_0x31ce6f['attributes']:_0x4d6c34['model'];if(!_0xadf965[_0x5b83('0x32')][_0x5b83('0x35')](_0x5b83('0x36'))){_0x31ce6f[_0x5b83('0x1c')]=qs[_0x5b83('0x1c')](_0xadf965[_0x5b83('0x32')][_0x5b83('0x1c')]);_0x31ce6f['offset']=qs[_0x5b83('0x1b')](_0xadf965[_0x5b83('0x32')][_0x5b83('0x1b')]);}_0x31ce6f['order']=qs[_0x5b83('0x37')](_0xadf965[_0x5b83('0x32')][_0x5b83('0x37')]);_0x31ce6f['where']=qs[_0x5b83('0x38')](_[_0x5b83('0x39')](_0xadf965[_0x5b83('0x32')],_0x4d6c34[_0x5b83('0x38')]),_0x22c5be);if(_0xadf965[_0x5b83('0x32')][_0x5b83('0x3a')]){_0x31ce6f[_0x5b83('0x3b')]=_[_0x5b83('0x3c')](_0x31ce6f['where'],{'$or':_[_0x5b83('0x3d')](_0x31ce6f[_0x5b83('0x34')],function(_0x308ce6){var _0x1dd83d={};_0x1dd83d[_0x308ce6]={'$like':'%'+_0xadf965['query']['filter']+'%'};return _0x1dd83d;})});}_0x31ce6f=_[_0x5b83('0x3c')]({},_0x31ce6f,_0xadf965[_0x5b83('0x3e')]);var _0x592931={'where':_0x31ce6f['where']};return db[_0x5b83('0x2f')][_0x5b83('0x1e')](_0x592931)[_0x5b83('0x25')](function(_0x96b606){_0x12623b['count']=_0x96b606;if(_0xadf965['query'][_0x5b83('0x3f')]){_0x31ce6f[_0x5b83('0x40')]=[{'all':!![]}];}return db[_0x5b83('0x2f')]['findAll'](_0x31ce6f);})[_0x5b83('0x25')](function(_0x3d3591){_0x12623b[_0x5b83('0x41')]=_0x3d3591;return _0x12623b;})[_0x5b83('0x25')](respondWithFilteredResult(_0x30beba,_0x31ce6f))[_0x5b83('0x42')](handleError(_0x30beba,null));})[_0x5b83('0x42')](handleError(_0x30beba,null));};exports[_0x5b83('0x43')]=function(_0xec61fe,_0x5260bc){var _0x300311={'raw':![],'where':{'id':_0xec61fe[_0x5b83('0x44')]['id']}},_0x196ad1={};_0x196ad1[_0x5b83('0x30')]=_[_0x5b83('0x31')](db[_0x5b83('0x2f')][_0x5b83('0x45')]);_0x196ad1['query']=_[_0x5b83('0x31')](_0xec61fe[_0x5b83('0x32')]);_0x196ad1[_0x5b83('0x38')]=_[_0x5b83('0x33')](_0x196ad1[_0x5b83('0x30')],_0x196ad1[_0x5b83('0x32')]);_0x300311['attributes']=_[_0x5b83('0x33')](_0x196ad1[_0x5b83('0x30')],qs['fields'](_0xec61fe['query'][_0x5b83('0x46')]));_0x300311[_0x5b83('0x34')]=_0x300311[_0x5b83('0x34')][_0x5b83('0x47')]?_0x300311[_0x5b83('0x34')]:_0x196ad1[_0x5b83('0x30')];if(_0xec61fe[_0x5b83('0x32')][_0x5b83('0x3f')]){_0x300311['include']=[{'all':!![]}];}_0x300311=_[_0x5b83('0x3c')]({},_0x300311,_0xec61fe[_0x5b83('0x3e')]);return db[_0x5b83('0x2f')][_0x5b83('0x48')](_0x300311)['then'](handleEntityNotFound(_0x5260bc,null))[_0x5b83('0x25')](respondWithResult(_0x5260bc,null))[_0x5b83('0x42')](handleError(_0x5260bc,null));};exports['create']=function(_0x277042,_0x465cf1){return db[_0x5b83('0x2f')][_0x5b83('0x49')](_0x277042[_0x5b83('0x4a')],{})[_0x5b83('0x25')](function(_0x72fdfc){var _0x41b23e=_0x277042[_0x5b83('0x4b')]['get']({'plain':!![]});if(!_0x41b23e)throw new Error(_0x5b83('0x4c'));if(_0x41b23e['role']===_0x5b83('0x4b')){var _0x1819e6=_0x72fdfc[_0x5b83('0x4d')]({'plain':!![]});var _0x2239c5=_0x5b83('0x4e');return db[_0x5b83('0x4f')]['find']({'where':{'name':_0x2239c5,'userProfileId':_0x41b23e['userProfileId']},'raw':!![]})[_0x5b83('0x25')](function(_0x53b65f){if(_0x53b65f&&_0x53b65f['autoAssociation']===0x0){return db[_0x5b83('0x27')][_0x5b83('0x49')]({'name':_0x1819e6[_0x5b83('0x2c')],'resourceId':_0x1819e6['id'],'type':_0x53b65f[_0x5b83('0x2c')],'sectionId':_0x53b65f['id']},{})[_0x5b83('0x25')](function(){return _0x72fdfc;});}else{return _0x72fdfc;}})[_0x5b83('0x42')](function(_0x20c6cb){logger['error'](_0x5b83('0x50'),_0x20c6cb);throw _0x20c6cb;});}return _0x72fdfc;})[_0x5b83('0x25')](respondWithResult(_0x465cf1,0xc9))['catch'](handleError(_0x465cf1,null));};exports['update']=function(_0x551269,_0x50a3ad){if(_0x551269[_0x5b83('0x4a')]['id']){delete _0x551269[_0x5b83('0x4a')]['id'];}return db[_0x5b83('0x2f')]['find']({'where':{'id':_0x551269[_0x5b83('0x44')]['id']}})[_0x5b83('0x25')](handleEntityNotFound(_0x50a3ad,null))['then'](saveUpdates(_0x551269['body'],null))[_0x5b83('0x25')](respondWithResult(_0x50a3ad,null))[_0x5b83('0x42')](handleError(_0x50a3ad,null));};exports['destroy']=function(_0x4c49b5,_0x5d26d6){return db['CmCompany'][_0x5b83('0x48')]({'where':{'id':_0x4c49b5[_0x5b83('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d26d6,null))[_0x5b83('0x25')](removeEntity(_0x5d26d6,null))[_0x5b83('0x42')](handleError(_0x5d26d6,null));};exports['describe']=function(_0x138b3c,_0x3d9be8){return db[_0x5b83('0x2f')][_0x5b83('0x51')]()[_0x5b83('0x25')](respondWithResult(_0x3d9be8,null))[_0x5b83('0x42')](handleError(_0x3d9be8,null));};exports[_0x5b83('0x52')]=function(_0x49851f,_0x3aaa97,_0x5e307f){return db[_0x5b83('0x53')][_0x5b83('0x48')]({'where':{'id':_0x49851f[_0x5b83('0x44')]['id']}})['then'](handleEntityNotFound(_0x3aaa97,null))[_0x5b83('0x25')](function(_0x42a687){if(_0x42a687){return _0x42a687[_0x5b83('0x52')](_0x49851f['body'][_0x5b83('0x54')],_['omit'](_0x49851f[_0x5b83('0x4a')],[_0x5b83('0x54'),'id'])||{});}})[_0x5b83('0x25')](respondWithResult(_0x3aaa97,null))['catch'](handleError(_0x3aaa97,null));};exports[_0x5b83('0x55')]=function(_0x509753,_0x4d6736,_0x5afaab){var _0x10ee37={};var _0x5437f2={};var _0x5a2873;var _0x47d28c;return db['CmCompany'][_0x5b83('0x56')]({'where':{'id':_0x509753[_0x5b83('0x44')]['id']}})[_0x5b83('0x25')](handleEntityNotFound(_0x4d6736,null))[_0x5b83('0x25')](function(_0x55e5b7){if(_0x55e5b7){_0x5a2873=_0x55e5b7;_0x5437f2[_0x5b83('0x30')]=_[_0x5b83('0x31')](db[_0x5b83('0x53')]['rawAttributes']);_0x5437f2[_0x5b83('0x32')]=_['keys'](_0x509753[_0x5b83('0x32')]);_0x5437f2[_0x5b83('0x38')]=_[_0x5b83('0x33')](_0x5437f2[_0x5b83('0x30')],_0x5437f2['query']);_0x10ee37['attributes']=_[_0x5b83('0x33')](_0x5437f2[_0x5b83('0x30')],qs['fields'](_0x509753[_0x5b83('0x32')]['fields']));_0x10ee37['attributes']=_0x10ee37[_0x5b83('0x34')][_0x5b83('0x47')]?_0x10ee37['attributes']:_0x5437f2[_0x5b83('0x30')];_0x10ee37['order']=qs[_0x5b83('0x37')](_0x509753[_0x5b83('0x32')][_0x5b83('0x37')]);_0x10ee37['where']=qs[_0x5b83('0x38')](_[_0x5b83('0x39')](_0x509753[_0x5b83('0x32')],_0x5437f2[_0x5b83('0x38')]));if(_0x509753['query'][_0x5b83('0x3a')]){_0x10ee37['where']=_[_0x5b83('0x3c')](_0x10ee37[_0x5b83('0x3b')],{'$or':_[_0x5b83('0x3d')](_0x10ee37['attributes'],function(_0x75c334){var _0x54381f={};_0x54381f[_0x75c334]={'$like':'%'+_0x509753[_0x5b83('0x32')][_0x5b83('0x3a')]+'%'};return _0x54381f;})});}_0x10ee37=_[_0x5b83('0x3c')]({},_0x10ee37,_0x509753['options']);return _0x5a2873[_0x5b83('0x55')](_0x10ee37);}})[_0x5b83('0x25')](function(_0x33d296){if(_0x33d296){_0x47d28c=_0x33d296[_0x5b83('0x47')];if(!_0x509753[_0x5b83('0x32')][_0x5b83('0x35')]('nolimit')){_0x10ee37[_0x5b83('0x1c')]=qs[_0x5b83('0x1c')](_0x509753['query'][_0x5b83('0x1c')]);_0x10ee37[_0x5b83('0x1b')]=qs[_0x5b83('0x1b')](_0x509753['query'][_0x5b83('0x1b')]);}return _0x5a2873['getContacts'](_0x10ee37);}})[_0x5b83('0x25')](function(_0x258dda){if(_0x258dda){return _0x258dda?{'count':_0x47d28c,'rows':_0x258dda}:null;}})[_0x5b83('0x25')](respondWithResult(_0x4d6736,null))[_0x5b83('0x42')](handleError(_0x4d6736,null));}; \ No newline at end of file +var _0x56cc=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','save','update','then','destroy','get','UserProfileResource','error','name','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','count','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection'];(function(_0x1f0f46,_0x3873ff){var _0x5d12f8=function(_0x455bf7){while(--_0x455bf7){_0x1f0f46['push'](_0x1f0f46['shift']());}};_0x5d12f8(++_0x3873ff);}(_0x56cc,0x1db));var _0xc56c=function(_0x20dbe5,_0x15a188){_0x20dbe5=_0x20dbe5-0x0;var _0x5ae2d7=_0x56cc[_0x20dbe5];return _0x5ae2d7;};'use strict';var emlformat=require(_0xc56c('0x0'));var rimraf=require(_0xc56c('0x1'));var zipdir=require(_0xc56c('0x2'));var jsonpatch=require(_0xc56c('0x3'));var rp=require(_0xc56c('0x4'));var moment=require(_0xc56c('0x5'));var BPromise=require(_0xc56c('0x6'));var Mustache=require(_0xc56c('0x7'));var util=require('util');var path=require(_0xc56c('0x8'));var sox=require(_0xc56c('0x9'));var csv=require(_0xc56c('0xa'));var ejs=require(_0xc56c('0xb'));var fs=require('fs');var fs_extra=require(_0xc56c('0xc'));var _=require(_0xc56c('0xd'));var squel=require(_0xc56c('0xe'));var crypto=require(_0xc56c('0xf'));var jsforce=require(_0xc56c('0x10'));var deskjs=require(_0xc56c('0x11'));var toCsv=require(_0xc56c('0xa'));var querystring=require(_0xc56c('0x12'));var Papa=require(_0xc56c('0x13'));var Redis=require(_0xc56c('0x14'));var authService=require(_0xc56c('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xc56c('0x16'));var hardwareService=require(_0xc56c('0x17'));var logger=require(_0xc56c('0x18'))(_0xc56c('0x19'));var utils=require(_0xc56c('0x1a'));var config=require(_0xc56c('0x1b'));var licenseUtil=require(_0xc56c('0x1c'));var db=require(_0xc56c('0x1d'))['db'];function respondWithStatusCode(_0x371f6a,_0x5040c1){_0x5040c1=_0x5040c1||0xcc;return function(_0x590443){if(_0x590443){return _0x371f6a[_0xc56c('0x1e')](_0x5040c1);}return _0x371f6a[_0xc56c('0x1f')](_0x5040c1)[_0xc56c('0x20')]();};}function respondWithResult(_0x1c2880,_0x26390c){_0x26390c=_0x26390c||0xc8;return function(_0x49f315){if(_0x49f315){return _0x1c2880['status'](_0x26390c)[_0xc56c('0x21')](_0x49f315);}};}function respondWithFilteredResult(_0x14f18b,_0x24417b){return function(_0xc9cad5){if(_0xc9cad5){var _0x543e=typeof _0x24417b['offset']===_0xc56c('0x22')&&typeof _0x24417b[_0xc56c('0x23')]===_0xc56c('0x22');var _0xda752a=_0xc9cad5['count'];var _0x4fa547=_0x543e?0x0:_0x24417b[_0xc56c('0x24')];var _0x3de48e=_0x543e?_0xc9cad5['count']:_0x24417b['offset']+_0x24417b[_0xc56c('0x23')];var _0x5bd0fb;if(_0x3de48e>=_0xda752a){_0x3de48e=_0xda752a;_0x5bd0fb=0xc8;}else{_0x5bd0fb=0xce;}_0x14f18b[_0xc56c('0x1f')](_0x5bd0fb);return _0x14f18b[_0xc56c('0x25')](_0xc56c('0x26'),_0x4fa547+'-'+_0x3de48e+'/'+_0xda752a)[_0xc56c('0x21')](_0xc9cad5);}return null;};}function patchUpdates(_0x1fa096){return function(_0x3d856c){try{jsonpatch['apply'](_0x3d856c,_0x1fa096,!![]);}catch(_0xe02930){return BPromise['reject'](_0xe02930);}return _0x3d856c[_0xc56c('0x27')]();};}function saveUpdates(_0x2a7fca,_0x1f2210){return function(_0x4d8269){if(_0x4d8269){return _0x4d8269[_0xc56c('0x28')](_0x2a7fca)[_0xc56c('0x29')](function(_0x37ab2a){return _0x37ab2a;});}return null;};}function removeEntity(_0x422e9e,_0x50e355){return function(_0x54c637){if(_0x54c637){return _0x54c637[_0xc56c('0x2a')]()[_0xc56c('0x29')](function(){var _0x48d1b3=_0x54c637[_0xc56c('0x2b')]({'plain':!![]});var _0xd9fcec='Companies';return db[_0xc56c('0x2c')][_0xc56c('0x2a')]({'where':{'type':_0xd9fcec,'resourceId':_0x48d1b3['id']}})[_0xc56c('0x29')](function(){return _0x54c637;});})[_0xc56c('0x29')](function(){_0x422e9e[_0xc56c('0x1f')](0xcc)[_0xc56c('0x20')]();});}};}function handleEntityNotFound(_0x47e738,_0xc0b9c){return function(_0x51ffcd){if(!_0x51ffcd){_0x47e738[_0xc56c('0x1e')](0x194);}return _0x51ffcd;};}function handleError(_0x430315,_0x1c53d3){_0x1c53d3=_0x1c53d3||0x1f4;return function(_0x42a70a){logger[_0xc56c('0x2d')](_0x42a70a['stack']);if(_0x42a70a[_0xc56c('0x2e')]){delete _0x42a70a[_0xc56c('0x2e')];}_0x430315['status'](_0x1c53d3)['send'](_0x42a70a);};}exports['index']=function(_0x3ca308,_0xceccfe){var _0x4b98db={},_0x505b7f={},_0x5aa2f7={'count':0x0,'rows':[]};return db[_0xc56c('0x2f')][_0xc56c('0x30')]()[_0xc56c('0x29')](function(_0x1efcb4){_0x505b7f[_0xc56c('0x31')]=_[_0xc56c('0x32')](_0x1efcb4);_0x505b7f[_0xc56c('0x33')]=_[_0xc56c('0x32')](_0x3ca308[_0xc56c('0x33')]);_0x505b7f[_0xc56c('0x34')]=_[_0xc56c('0x35')](_0x505b7f[_0xc56c('0x31')],_0x505b7f[_0xc56c('0x33')]);_0x4b98db[_0xc56c('0x36')]=_[_0xc56c('0x35')](_0x505b7f[_0xc56c('0x31')],qs[_0xc56c('0x37')](_0x3ca308[_0xc56c('0x33')][_0xc56c('0x37')]));_0x4b98db[_0xc56c('0x36')]=_0x4b98db['attributes'][_0xc56c('0x38')]?_0x4b98db[_0xc56c('0x36')]:_0x505b7f[_0xc56c('0x31')];if(!_0x3ca308[_0xc56c('0x33')][_0xc56c('0x39')](_0xc56c('0x3a'))){_0x4b98db[_0xc56c('0x23')]=qs['limit'](_0x3ca308[_0xc56c('0x33')][_0xc56c('0x23')]);_0x4b98db['offset']=qs[_0xc56c('0x24')](_0x3ca308[_0xc56c('0x33')][_0xc56c('0x24')]);}_0x4b98db[_0xc56c('0x3b')]=qs[_0xc56c('0x3c')](_0x3ca308[_0xc56c('0x33')][_0xc56c('0x3c')]);_0x4b98db[_0xc56c('0x3d')]=qs[_0xc56c('0x34')](_[_0xc56c('0x3e')](_0x3ca308['query'],_0x505b7f[_0xc56c('0x34')]),_0x1efcb4);if(_0x3ca308[_0xc56c('0x33')]['filter']){_0x4b98db[_0xc56c('0x3d')]=_[_0xc56c('0x3f')](_0x4b98db[_0xc56c('0x3d')],{'$or':_[_0xc56c('0x40')](_0x4b98db['attributes'],function(_0x27c9db){var _0xe21ebc={};_0xe21ebc[_0x27c9db]={'$like':'%'+_0x3ca308['query'][_0xc56c('0x41')]+'%'};return _0xe21ebc;})});}_0x4b98db=_[_0xc56c('0x3f')]({},_0x4b98db,_0x3ca308[_0xc56c('0x42')]);var _0x36c7e1={'where':_0x4b98db[_0xc56c('0x3d')]};return db[_0xc56c('0x2f')][_0xc56c('0x43')](_0x36c7e1)[_0xc56c('0x29')](function(_0x450703){_0x5aa2f7[_0xc56c('0x43')]=_0x450703;if(_0x3ca308[_0xc56c('0x33')]['includeAll']){_0x4b98db[_0xc56c('0x44')]=[{'all':!![]}];}return db[_0xc56c('0x2f')][_0xc56c('0x45')](_0x4b98db);})['then'](function(_0x1e54af){_0x5aa2f7[_0xc56c('0x46')]=_0x1e54af;return _0x5aa2f7;})[_0xc56c('0x29')](respondWithFilteredResult(_0xceccfe,_0x4b98db))[_0xc56c('0x47')](handleError(_0xceccfe,null));})['catch'](handleError(_0xceccfe,null));};exports[_0xc56c('0x48')]=function(_0x322e06,_0x2cfe65){var _0x43ca28={'raw':![],'where':{'id':_0x322e06['params']['id']}},_0xbdbd63={};_0xbdbd63[_0xc56c('0x31')]=_[_0xc56c('0x32')](db[_0xc56c('0x2f')][_0xc56c('0x49')]);_0xbdbd63[_0xc56c('0x33')]=_[_0xc56c('0x32')](_0x322e06['query']);_0xbdbd63[_0xc56c('0x34')]=_[_0xc56c('0x35')](_0xbdbd63[_0xc56c('0x31')],_0xbdbd63[_0xc56c('0x33')]);_0x43ca28['attributes']=_[_0xc56c('0x35')](_0xbdbd63['model'],qs[_0xc56c('0x37')](_0x322e06['query'][_0xc56c('0x37')]));_0x43ca28['attributes']=_0x43ca28[_0xc56c('0x36')][_0xc56c('0x38')]?_0x43ca28[_0xc56c('0x36')]:_0xbdbd63[_0xc56c('0x31')];if(_0x322e06[_0xc56c('0x33')][_0xc56c('0x4a')]){_0x43ca28[_0xc56c('0x44')]=[{'all':!![]}];}_0x43ca28=_[_0xc56c('0x3f')]({},_0x43ca28,_0x322e06[_0xc56c('0x42')]);return db[_0xc56c('0x2f')][_0xc56c('0x4b')](_0x43ca28)[_0xc56c('0x29')](handleEntityNotFound(_0x2cfe65,null))[_0xc56c('0x29')](respondWithResult(_0x2cfe65,null))['catch'](handleError(_0x2cfe65,null));};exports[_0xc56c('0x4c')]=function(_0x51f2db,_0x4a6402){return db[_0xc56c('0x2f')][_0xc56c('0x4c')](_0x51f2db[_0xc56c('0x4d')],{})['then'](function(_0x2f38e0){var _0xb9582c=_0x51f2db[_0xc56c('0x4e')][_0xc56c('0x2b')]({'plain':!![]});if(!_0xb9582c)throw new Error(_0xc56c('0x4f'));if(_0xb9582c[_0xc56c('0x50')]===_0xc56c('0x4e')){var _0x3ffb44=_0x2f38e0['get']({'plain':!![]});var _0x1063c5=_0xc56c('0x51');return db[_0xc56c('0x52')][_0xc56c('0x4b')]({'where':{'name':_0x1063c5,'userProfileId':_0xb9582c[_0xc56c('0x53')]},'raw':!![]})[_0xc56c('0x29')](function(_0x2f66ca){if(_0x2f66ca&&_0x2f66ca[_0xc56c('0x54')]===0x0){return db[_0xc56c('0x2c')]['create']({'name':_0x3ffb44['name'],'resourceId':_0x3ffb44['id'],'type':_0x2f66ca[_0xc56c('0x2e')],'sectionId':_0x2f66ca['id']},{})[_0xc56c('0x29')](function(){return _0x2f38e0;});}else{return _0x2f38e0;}})['catch'](function(_0x2fc7c0){logger[_0xc56c('0x2d')](_0xc56c('0x55'),_0x2fc7c0);throw _0x2fc7c0;});}return _0x2f38e0;})['then'](respondWithResult(_0x4a6402,0xc9))['catch'](handleError(_0x4a6402,null));};exports[_0xc56c('0x28')]=function(_0x3ab92c,_0x27b1b1){if(_0x3ab92c[_0xc56c('0x4d')]['id']){delete _0x3ab92c[_0xc56c('0x4d')]['id'];}return db[_0xc56c('0x2f')][_0xc56c('0x4b')]({'where':{'id':_0x3ab92c[_0xc56c('0x56')]['id']}})[_0xc56c('0x29')](handleEntityNotFound(_0x27b1b1,null))['then'](saveUpdates(_0x3ab92c[_0xc56c('0x4d')],null))['then'](respondWithResult(_0x27b1b1,null))[_0xc56c('0x47')](handleError(_0x27b1b1,null));};exports[_0xc56c('0x2a')]=function(_0x2341aa,_0x2e00bf){return db['CmCompany']['find']({'where':{'id':_0x2341aa[_0xc56c('0x56')]['id']}})[_0xc56c('0x29')](handleEntityNotFound(_0x2e00bf,null))[_0xc56c('0x29')](removeEntity(_0x2e00bf,null))[_0xc56c('0x47')](handleError(_0x2e00bf,null));};exports[_0xc56c('0x30')]=function(_0x382fd9,_0x53fe46){return db[_0xc56c('0x2f')][_0xc56c('0x30')]()[_0xc56c('0x29')](respondWithResult(_0x53fe46,null))['catch'](handleError(_0x53fe46,null));};exports[_0xc56c('0x57')]=function(_0x47240e,_0xea4dd0,_0x45a6e6){return db[_0xc56c('0x58')]['find']({'where':{'id':_0x47240e[_0xc56c('0x56')]['id']}})[_0xc56c('0x29')](handleEntityNotFound(_0xea4dd0,null))['then'](function(_0x397a52){if(_0x397a52){return _0x397a52[_0xc56c('0x57')](_0x47240e[_0xc56c('0x4d')][_0xc56c('0x59')],_[_0xc56c('0x5a')](_0x47240e[_0xc56c('0x4d')],[_0xc56c('0x59'),'id'])||{});}})[_0xc56c('0x29')](respondWithResult(_0xea4dd0,null))[_0xc56c('0x47')](handleError(_0xea4dd0,null));};exports[_0xc56c('0x5b')]=function(_0x38de47,_0x1da6e8,_0x4bb16b){var _0x200ced={};var _0x422c97={};var _0x191fde;var _0x41af65;return db[_0xc56c('0x2f')][_0xc56c('0x5c')]({'where':{'id':_0x38de47[_0xc56c('0x56')]['id']}})[_0xc56c('0x29')](handleEntityNotFound(_0x1da6e8,null))['then'](function(_0x536108){if(_0x536108){_0x191fde=_0x536108;_0x422c97[_0xc56c('0x31')]=_[_0xc56c('0x32')](db[_0xc56c('0x58')][_0xc56c('0x49')]);_0x422c97[_0xc56c('0x33')]=_['keys'](_0x38de47['query']);_0x422c97[_0xc56c('0x34')]=_[_0xc56c('0x35')](_0x422c97[_0xc56c('0x31')],_0x422c97['query']);_0x200ced[_0xc56c('0x36')]=_[_0xc56c('0x35')](_0x422c97[_0xc56c('0x31')],qs['fields'](_0x38de47[_0xc56c('0x33')][_0xc56c('0x37')]));_0x200ced['attributes']=_0x200ced[_0xc56c('0x36')][_0xc56c('0x38')]?_0x200ced['attributes']:_0x422c97[_0xc56c('0x31')];_0x200ced[_0xc56c('0x3b')]=qs['sort'](_0x38de47[_0xc56c('0x33')][_0xc56c('0x3c')]);_0x200ced[_0xc56c('0x3d')]=qs[_0xc56c('0x34')](_[_0xc56c('0x3e')](_0x38de47[_0xc56c('0x33')],_0x422c97[_0xc56c('0x34')]));if(_0x38de47[_0xc56c('0x33')][_0xc56c('0x41')]){_0x200ced[_0xc56c('0x3d')]=_[_0xc56c('0x3f')](_0x200ced[_0xc56c('0x3d')],{'$or':_[_0xc56c('0x40')](_0x200ced[_0xc56c('0x36')],function(_0x2d7d5f){var _0x3ac751={};_0x3ac751[_0x2d7d5f]={'$like':'%'+_0x38de47[_0xc56c('0x33')][_0xc56c('0x41')]+'%'};return _0x3ac751;})});}_0x200ced=_['merge']({},_0x200ced,_0x38de47[_0xc56c('0x42')]);return _0x191fde[_0xc56c('0x5b')](_0x200ced);}})[_0xc56c('0x29')](function(_0x4e2ece){if(_0x4e2ece){_0x41af65=_0x4e2ece['length'];if(!_0x38de47['query'][_0xc56c('0x39')](_0xc56c('0x3a'))){_0x200ced[_0xc56c('0x23')]=qs[_0xc56c('0x23')](_0x38de47[_0xc56c('0x33')][_0xc56c('0x23')]);_0x200ced[_0xc56c('0x24')]=qs['offset'](_0x38de47[_0xc56c('0x33')][_0xc56c('0x24')]);}return _0x191fde[_0xc56c('0x5b')](_0x200ced);}})[_0xc56c('0x29')](function(_0x1922ad){if(_0x1922ad){return _0x1922ad?{'count':_0x41af65,'rows':_0x1922ad}:null;}})['then'](respondWithResult(_0x1da6e8,null))['catch'](handleError(_0x1da6e8,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 64f3016..a18db96 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 _0xb6c6=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash'];(function(_0xd94707,_0x3cacec){var _0x273bf8=function(_0x2b36d8){while(--_0x2b36d8){_0xd94707['push'](_0xd94707['shift']());}};_0x273bf8(++_0x3cacec);}(_0xb6c6,0x81));var _0x6b6c=function(_0x1d6688,_0x20fce6){_0x1d6688=_0x1d6688-0x0;var _0x253f94=_0xb6c6[_0x1d6688];return _0x253f94;};'use strict';var _=require(_0x6b6c('0x0'));var util=require(_0x6b6c('0x1'));var logger=require(_0x6b6c('0x2'))(_0x6b6c('0x3'));var moment=require('moment');var BPromise=require(_0x6b6c('0x4'));var rp=require(_0x6b6c('0x5'));var fs=require('fs');var path=require(_0x6b6c('0x6'));var rimraf=require(_0x6b6c('0x7'));var config=require(_0x6b6c('0x8'));var attributes=require(_0x6b6c('0x9'));module['exports']=function(_0x78d39f,_0x40daea){return _0x78d39f[_0x6b6c('0xa')](_0x6b6c('0xb'),attributes,{'tableName':_0x6b6c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed0a=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api'];(function(_0x4336bc,_0x1a0da6){var _0x231421=function(_0x3d31a8){while(--_0x3d31a8){_0x4336bc['push'](_0x4336bc['shift']());}};_0x231421(++_0x1a0da6);}(_0xed0a,0x19d));var _0xaed0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xed0a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaed0('0x0'));var util=require('util');var logger=require(_0xaed0('0x1'))(_0xaed0('0x2'));var moment=require(_0xaed0('0x3'));var BPromise=require(_0xaed0('0x4'));var rp=require(_0xaed0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaed0('0x6'));var config=require(_0xaed0('0x7'));var attributes=require(_0xaed0('0x8'));module[_0xaed0('0x9')]=function(_0x5650b0,_0x4a30be){return _0x5650b0[_0xaed0('0xa')](_0xaed0('0xb'),attributes,{'tableName':_0xaed0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 901c343..c9f9c98 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 _0xe18f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xe18f,0x149));var _0xfe18=function(_0x379d87,_0x50962c){_0x379d87=_0x379d87-0x0;var _0x4c7593=_0xe18f[_0x379d87];return _0x4c7593;};'use strict';var _=require(_0xfe18('0x0'));var util=require(_0xfe18('0x1'));var moment=require(_0xfe18('0x2'));var BPromise=require(_0xfe18('0x3'));var rs=require(_0xfe18('0x4'));var fs=require('fs');var Redis=require(_0xfe18('0x5'));var db=require(_0xfe18('0x6'))['db'];var utils=require(_0xfe18('0x7'));var logger=require(_0xfe18('0x8'))(_0xfe18('0x9'));var config=require('../../config/environment');var jayson=require(_0xfe18('0xa'));var client=jayson[_0xfe18('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a74fd,_0x5f3dc8,_0x2e4103){return new BPromise(function(_0x271b17,_0x4e806c){return client[_0xfe18('0xc')](_0x3a74fd,_0x2e4103)[_0xfe18('0xd')](function(_0x1f258f){logger[_0xfe18('0xe')](_0xfe18('0xf'),_0x5f3dc8,_0xfe18('0x10'));logger[_0xfe18('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x5f3dc8,_0xfe18('0x10'),JSON[_0xfe18('0x12')](_0x1f258f));if(_0x1f258f['error']){if(_0x1f258f[_0xfe18('0x13')][_0xfe18('0x14')]===0x1f4){logger[_0xfe18('0x13')](_0xfe18('0xf'),_0x5f3dc8,_0x1f258f[_0xfe18('0x13')][_0xfe18('0x15')]);return _0x4e806c(_0x1f258f[_0xfe18('0x13')][_0xfe18('0x15')]);}logger[_0xfe18('0x13')](_0xfe18('0xf'),_0x5f3dc8,_0x1f258f[_0xfe18('0x13')][_0xfe18('0x15')]);return _0x271b17(_0x1f258f[_0xfe18('0x13')]['message']);}else{logger['info'](_0xfe18('0xf'),_0x5f3dc8,_0xfe18('0x10'));_0x271b17(_0x1f258f['result'][_0xfe18('0x15')]);}})['catch'](function(_0x32f5eb){logger[_0xfe18('0x13')]('CmCompany,\x20%s,\x20%s',_0x5f3dc8,_0x32f5eb);_0x4e806c(_0x32f5eb);});});} \ No newline at end of file +var _0x17ce=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','lodash','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x17ce,0x1a0));var _0xe17c=function(_0x4188e6,_0x403e0a){_0x4188e6=_0x4188e6-0x0;var _0x3e3c9a=_0x17ce[_0x4188e6];return _0x3e3c9a;};'use strict';var _=require(_0xe17c('0x0'));var util=require(_0xe17c('0x1'));var moment=require(_0xe17c('0x2'));var BPromise=require(_0xe17c('0x3'));var rs=require(_0xe17c('0x4'));var fs=require('fs');var Redis=require(_0xe17c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe17c('0x6'));var logger=require(_0xe17c('0x7'))(_0xe17c('0x8'));var config=require(_0xe17c('0x9'));var jayson=require(_0xe17c('0xa'));var client=jayson[_0xe17c('0xb')][_0xe17c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a0cfc,_0x372069,_0x49d828){return new BPromise(function(_0x4a5e73,_0x1354a5){return client['request'](_0x5a0cfc,_0x49d828)[_0xe17c('0xd')](function(_0x40e19b){logger[_0xe17c('0xe')]('CmCompany,\x20%s,\x20%s',_0x372069,_0xe17c('0xf'));logger[_0xe17c('0x10')](_0xe17c('0x11'),_0x372069,_0xe17c('0xf'),JSON[_0xe17c('0x12')](_0x40e19b));if(_0x40e19b[_0xe17c('0x13')]){if(_0x40e19b[_0xe17c('0x13')]['code']===0x1f4){logger[_0xe17c('0x13')](_0xe17c('0x14'),_0x372069,_0x40e19b[_0xe17c('0x13')][_0xe17c('0x15')]);return _0x1354a5(_0x40e19b[_0xe17c('0x13')][_0xe17c('0x15')]);}logger[_0xe17c('0x13')](_0xe17c('0x14'),_0x372069,_0x40e19b[_0xe17c('0x13')][_0xe17c('0x15')]);return _0x4a5e73(_0x40e19b['error']['message']);}else{logger[_0xe17c('0xe')](_0xe17c('0x14'),_0x372069,_0xe17c('0xf'));_0x4a5e73(_0x40e19b['result'][_0xe17c('0x15')]);}})['catch'](function(_0x1a1326){logger[_0xe17c('0x13')](_0xe17c('0x14'),_0x372069,_0x1a1326);_0x1354a5(_0x1a1326);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 1d68e2e..abc3c15 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 _0x3cb7=['index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','create','post','addContacts','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get'];(function(_0x1d7165,_0x89c7a5){var _0x52cdee=function(_0x17df8a){while(--_0x17df8a){_0x1d7165['push'](_0x1d7165['shift']());}};_0x52cdee(++_0x89c7a5);}(_0x3cb7,0xcf));var _0x73cb=function(_0x4b15a4,_0x4241fe){_0x4b15a4=_0x4b15a4-0x0;var _0x40a783=_0x3cb7[_0x4b15a4];return _0x40a783;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x73cb('0x0'));var timeout=require('connect-timeout');var express=require(_0x73cb('0x1'));var router=express[_0x73cb('0x2')]();var fs_extra=require(_0x73cb('0x3'));var auth=require(_0x73cb('0x4'));var interaction=require(_0x73cb('0x5'));var config=require(_0x73cb('0x6'));var controller=require(_0x73cb('0x7'));router[_0x73cb('0x8')]('/',auth['isAuthenticated'](),controller[_0x73cb('0x9')]);router[_0x73cb('0x8')](_0x73cb('0xa'),auth[_0x73cb('0xb')](),controller[_0x73cb('0xc')]);router['get'](_0x73cb('0xd'),auth[_0x73cb('0xb')](),controller[_0x73cb('0xe')]);router[_0x73cb('0x8')](_0x73cb('0xf'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x10')]);router['post']('/',auth[_0x73cb('0xb')](),controller[_0x73cb('0x11')]);router[_0x73cb('0x12')](_0x73cb('0xf'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x13')]);router['put'](_0x73cb('0xd'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x14')]);router[_0x73cb('0x15')](_0x73cb('0xd'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x16')]);module[_0x73cb('0x17')]=router; \ No newline at end of file +var _0xc165=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/contacts','post','addContacts','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x33b627,_0xcd64e0){var _0x531df0=function(_0x46db94){while(--_0x46db94){_0x33b627['push'](_0x33b627['shift']());}};_0x531df0(++_0xcd64e0);}(_0xc165,0x199));var _0x5c16=function(_0x50ac27,_0x1306e3){_0x50ac27=_0x50ac27-0x0;var _0x45f86a=_0xc165[_0x50ac27];return _0x45f86a;};'use strict';var multer=require(_0x5c16('0x0'));var util=require(_0x5c16('0x1'));var path=require(_0x5c16('0x2'));var timeout=require(_0x5c16('0x3'));var express=require(_0x5c16('0x4'));var router=express[_0x5c16('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5c16('0x6'));var interaction=require(_0x5c16('0x7'));var config=require(_0x5c16('0x8'));var controller=require('./cmCompany.controller');router[_0x5c16('0x9')]('/',auth[_0x5c16('0xa')](),controller['index']);router[_0x5c16('0x9')](_0x5c16('0xb'),auth[_0x5c16('0xa')](),controller[_0x5c16('0xc')]);router[_0x5c16('0x9')]('/:id',auth[_0x5c16('0xa')](),controller[_0x5c16('0xd')]);router[_0x5c16('0x9')](_0x5c16('0xe'),auth[_0x5c16('0xa')](),controller['getContacts']);router[_0x5c16('0xf')]('/',auth[_0x5c16('0xa')](),controller['create']);router[_0x5c16('0xf')](_0x5c16('0xe'),auth['isAuthenticated'](),controller[_0x5c16('0x10')]);router[_0x5c16('0x11')]('/:id',auth[_0x5c16('0xa')](),controller[_0x5c16('0x12')]);router[_0x5c16('0x13')](_0x5c16('0x14'),auth['isAuthenticated'](),controller[_0x5c16('0x15')]);module[_0x5c16('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 71bcf53..c6e32a1 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 _0xf879=['TEXT','INTEGER','NOW','lodash','sequelize','exports','STRING'];(function(_0x3eb950,_0x291f67){var _0x5bc4f4=function(_0x172dc5){while(--_0x172dc5){_0x3eb950['push'](_0x3eb950['shift']());}};_0x5bc4f4(++_0x291f67);}(_0xf879,0x145));var _0x9f87=function(_0x5b74c2,_0xd523bd){_0x5b74c2=_0x5b74c2-0x0;var _0x446678=_0xf879[_0x5b74c2];return _0x446678;};'use strict';var _=require(_0x9f87('0x0'));var Sequelize=require(_0x9f87('0x1'));module[_0x9f87('0x2')]={'firstName':{'type':Sequelize[_0x9f87('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9f87('0x3')]},'street':{'type':Sequelize[_0x9f87('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x9f87('0x3')]},'country':{'type':Sequelize[_0x9f87('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9f87('0x4')]},'phone':{'type':Sequelize[_0x9f87('0x3')]},'mobile':{'type':Sequelize[_0x9f87('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9f87('0x3')]},'url':{'type':Sequelize[_0x9f87('0x3')]},'facebook':{'type':Sequelize[_0x9f87('0x3')]},'fb_data':{'type':Sequelize[_0x9f87('0x3')]},'twitter':{'type':Sequelize[_0x9f87('0x3')]},'skype':{'type':Sequelize[_0x9f87('0x3')]},'teams':{'type':Sequelize[_0x9f87('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x9f87('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x9f87('0x3')]},'UserId':{'type':Sequelize[_0x9f87('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9f87('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x9f87('0x6')]},'dialTimezone':{'type':Sequelize[_0x9f87('0x3')]},'utcOffset':{'type':Sequelize[_0x9f87('0x5')]}}; \ No newline at end of file +var _0x0f0a=['UNSIGNED','lodash','sequelize','STRING','TEXT','INTEGER'];(function(_0x5c4f31,_0x4bcb71){var _0x1340e8=function(_0x5940ba){while(--_0x5940ba){_0x5c4f31['push'](_0x5c4f31['shift']());}};_0x1340e8(++_0x4bcb71);}(_0x0f0a,0x133));var _0xa0f0=function(_0x2067ae,_0x2297d9){_0x2067ae=_0x2067ae-0x0;var _0x15d9e7=_0x0f0a[_0x2067ae];return _0x15d9e7;};'use strict';var _=require(_0xa0f0('0x0'));var Sequelize=require(_0xa0f0('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xa0f0('0x2')]},'street':{'type':Sequelize[_0xa0f0('0x2')]},'postalCode':{'type':Sequelize[_0xa0f0('0x2')]},'city':{'type':Sequelize[_0xa0f0('0x2')]},'country':{'type':Sequelize[_0xa0f0('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa0f0('0x2')]},'description':{'type':Sequelize[_0xa0f0('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xa0f0('0x2')]},'fax':{'type':Sequelize[_0xa0f0('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xa0f0('0x2')]},'fb_data':{'type':Sequelize[_0xa0f0('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xa0f0('0x2')]},'teams':{'type':Sequelize[_0xa0f0('0x2')]},'viber':{'type':Sequelize[_0xa0f0('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xa0f0('0x2')]},'UserId':{'type':Sequelize[_0xa0f0('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xa0f0('0x2')]},'priority':{'type':Sequelize[_0xa0f0('0x4')](0x2)[_0xa0f0('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xa0f0('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index a2f0b5e..46ed02c 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 _0xfae9=['../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','update','sendStatus','name','index','describe','getOptions','query','then','catch','destroy','CmContact','find','params','tags','keys','startsWith','cf_','columnName','displayName','analytics','CmCustomField','findAll','length','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','each','duplicates','$or','push','where','ListId','spread','hasOwnProperty','contact','all','show','Tag','Tags','tag','ContactItemType','sequelize','literal','Phones.OrderBy','$and','map','format','cf_%d','omit','pickBy','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','text','phone','getTags','findOne','model','rawAttributes','filters','intersection','attributes','fields','sort','pick','filter','options','nolimit','setTags','ids','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','ItemType','`ItemType`.OrderBy','CmHopperId','item','ItemType.OrderBy','bulkCreate','getAdditionalPhones','PHONE','duplicateAdditionalPhones','fromContactId','toContactId','hopperId','getHoppers','order','ContactId','includeAll','include','rows','getHopperFinals','CmHopperFinal','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','filename','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','file','meta','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','getJourney','chat','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','type','source','destination','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','key','Owner','browserName','deviceModel','ratingMessage','ratingType','mail','substatus','Interaction','flatten','sortBy','slice','moment','bluebird','util','path','lodash','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment'];(function(_0x281633,_0xa6166a){var _0x4de759=function(_0x400a42){while(--_0x400a42){_0x281633['push'](_0x281633['shift']());}};_0x4de759(++_0xa6166a);}(_0xfae9,0xeb));var _0x9fae=function(_0x395155,_0x192ffd){_0x395155=_0x395155-0x0;var _0x179767=_0xfae9[_0x395155];return _0x179767;};'use strict';var moment=require(_0x9fae('0x0'));var BPromise=require(_0x9fae('0x1'));var util=require(_0x9fae('0x2'));var path=require(_0x9fae('0x3'));var fs=require('fs');var _=require(_0x9fae('0x4'));var squel=require(_0x9fae('0x5'));var Papa=require('papaparse');var Redis=require(_0x9fae('0x6'));var contacts=require(_0x9fae('0x7'));var qs=require(_0x9fae('0x8'));var logger=require(_0x9fae('0x9'))(_0x9fae('0xa'));var config=require(_0x9fae('0xb'));var shared=require(_0x9fae('0xc'));var db=require(_0x9fae('0xd'))['db'];config[_0x9fae('0xe')]=_[_0x9fae('0xf')](config[_0x9fae('0xe')],{'host':_0x9fae('0x10'),'port':0x18eb});var socket=require(_0x9fae('0x11'))(new Redis(config['redis']));require(_0x9fae('0x12'))[_0x9fae('0x13')](socket);function respondWithResult(_0x22947b,_0x2c337a){_0x2c337a=_0x2c337a||0xc8;return function(_0x2b8882){if(_0x2b8882){return _0x22947b[_0x9fae('0x14')](_0x2c337a)[_0x9fae('0x15')](_0x2b8882);}};}function respondWithFilteredResult(_0x31cfb1,_0x3b2fa3){return function(_0x50552d){if(_0x50552d){var _0x28c31d=typeof _0x3b2fa3[_0x9fae('0x16')]==='undefined'&&typeof _0x3b2fa3[_0x9fae('0x17')]===_0x9fae('0x18');var _0x23b245=_0x50552d[_0x9fae('0x19')];var _0x3618cf=_0x28c31d?0x0:_0x3b2fa3[_0x9fae('0x16')];var _0x3e81a3=_0x28c31d?_0x50552d[_0x9fae('0x19')]:_0x3b2fa3[_0x9fae('0x16')]+_0x3b2fa3[_0x9fae('0x17')];var _0x3e674a;if(_0x3e81a3>=_0x23b245){_0x3e81a3=_0x23b245;_0x3e674a=0xc8;}else{_0x3e674a=0xce;}_0x31cfb1[_0x9fae('0x14')](_0x3e674a);return _0x31cfb1[_0x9fae('0x1a')](_0x9fae('0x1b'),_0x3618cf+'-'+_0x3e81a3+'/'+_0x23b245)[_0x9fae('0x15')](_0x50552d);}return null;};}function saveUpdates(_0x3fb876){return function(_0x1619b9){if(_0x1619b9){return _0x1619b9[_0x9fae('0x1c')](_0x3fb876)['then'](function(_0x3ff865){return _0x3ff865;});}return null;};}function removeEntity(_0x4ccd7d){return function(_0x34c609){if(_0x34c609){return _0x34c609['destroy']()['then'](function(){_0x4ccd7d[_0x9fae('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x311f9a){return function(_0x5ab55a){if(!_0x5ab55a){_0x311f9a[_0x9fae('0x1d')](0x194);}return _0x5ab55a;};}function handleError(_0x12e57f,_0x5b52d4){_0x5b52d4=_0x5b52d4||0x1f4;return function(_0x5160ba){logger['error'](_0x5160ba['stack']);if(_0x5160ba[_0x9fae('0x1e')]){delete _0x5160ba['name'];}_0x12e57f[_0x9fae('0x14')](_0x5b52d4)['send'](_0x5160ba);};}exports[_0x9fae('0x1f')]=function(_0x33166a,_0x1a88ea){var _0x202c81={};return contacts[_0x9fae('0x20')]()['then'](function(_0xf4959c){_0x202c81=qs[_0x9fae('0x21')](_0xf4959c,_0x33166a);return contacts['findAll'](_0x33166a[_0x9fae('0x22')],_0x33166a['user'],_0x202c81,_0xf4959c);})[_0x9fae('0x23')](respondWithFilteredResult(_0x1a88ea,_0x202c81))[_0x9fae('0x24')](handleError(_0x1a88ea,null));};exports[_0x9fae('0x25')]=function(_0x24ff75,_0x2c7e89){return db[_0x9fae('0x26')][_0x9fae('0x27')]({'where':{'id':_0x24ff75[_0x9fae('0x28')]['id']}})['then'](handleEntityNotFound(_0x2c7e89,null))[_0x9fae('0x23')](removeEntity(_0x2c7e89,null))[_0x9fae('0x24')](handleError(_0x2c7e89,null));};exports[_0x9fae('0x20')]=function(_0x973157,_0x3278ab){return db[_0x9fae('0x26')][_0x9fae('0x20')]()[_0x9fae('0x23')](function(_0x426716){delete _0x426716[_0x9fae('0x29')];for(var _0x11bcd7=0x0;_0x11bcd70x0){return new Promise(function(_0x1e9e41){var _0x2cd158=[];for(var _0x58cb9a=0x0;_0x58cb9a<_0x1f9e24[_0x9fae('0x32')];_0x58cb9a++){_0x2cd158[_0x9fae('0x60')](insertAdditionalPhones(_0x1f9e24[_0x58cb9a][_0x9fae('0x65')],_0x1f9e24[_0x58cb9a]['additionalPhones']));}Promise[_0x9fae('0x66')](_0x2cd158)[_0x9fae('0x23')](function(){_0x1e9e41(0x1);});})[_0x9fae('0x23')](function(){return{'success':_0x268612,'failure':_0x5797f9,'duplicates':_0x4013fe};});}else{return{'success':_0x268612,'failure':_0x5797f9,'duplicates':_0x4013fe};}}})['then'](respondWithResult(_0x37a7d9,0xc9))[_0x9fae('0x24')](handleError(_0x37a7d9,null));};exports[_0x9fae('0x67')]=function(_0x164041,_0x14c699){var _0x1b2601;return db[_0x9fae('0x26')]['describe']()[_0x9fae('0x23')](function(_0x261ef4){return db['CmContact'][_0x9fae('0x27')]({'where':{'id':_0x164041[_0x9fae('0x28')]['id']},'include':[{'model':db[_0x9fae('0x68')],'as':_0x9fae('0x69'),'attributes':['id','name','color'],'required':_0x164041[_0x9fae('0x22')][_0x9fae('0x6a')]?!![]:![]},{'model':db['CmContactHasItem'],'as':'Phones','where':{'CmContactId':_0x164041[_0x9fae('0x28')]['id']},'required':![],'include':[{'model':db[_0x9fae('0x6b')],'as':'ItemType'}]}],'order':[db[_0x9fae('0x6c')][_0x9fae('0x6d')](_0x9fae('0x6e'))],'attributes':_[_0x9fae('0x2a')](_0x261ef4)});})['then'](function(_0x2487e1){if(!_[_0x9fae('0x58')](_0x2487e1)){_0x1b2601=_0x2487e1[_0x9fae('0x3b')]({'plain':!![]});var _0x36ac89={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2487e1&&_0x2487e1[_0x9fae('0x62')]){if(_0x2487e1[_0x9fae('0x62')]){_0x36ac89[_0x9fae('0x61')][_0x9fae('0x6f')][_0x9fae('0x60')]({'ListId':{'$ne':_0x2487e1[_0x9fae('0x62')]}});}}return db['CmCustomField'][_0x9fae('0x31')](_0x36ac89);}})[_0x9fae('0x23')](function(_0x57caab){if(!_['isNil'](_0x57caab)){return _['omit'](_0x1b2601,_[_0x9fae('0x70')](_0x57caab,function(_0x592ed2){return util[_0x9fae('0x71')](_0x9fae('0x72'),_0x592ed2['id']);}));}})[_0x9fae('0x23')](handleEntityNotFound(_0x14c699,null))[_0x9fae('0x23')](respondWithResult(_0x14c699,null))['catch'](handleError(_0x14c699,null));};exports[_0x9fae('0x1c')]=function(_0x1a3982,_0x38cbb9){var _0x2300f9;if(_0x1a3982[_0x9fae('0x39')]['id']){delete _0x1a3982['body']['id'];}if(!_['isNil'](_0x1a3982[_0x9fae('0x39')][_0x9fae('0x59')])){var _0x2a63cb=_0x1a3982[_0x9fae('0x39')][_0x9fae('0x59')];if(!_[_0x9fae('0x58')](shared['timezones'][_0x2a63cb]))_0x1a3982[_0x9fae('0x39')]['utcOffset']=shared[_0x9fae('0x5a')][_0x2a63cb][_0x9fae('0x5b')];}return db['CmContact'][_0x9fae('0x27')]({'where':{'id':_0x1a3982[_0x9fae('0x28')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x38cbb9,null))[_0x9fae('0x23')](saveUpdates(_0x1a3982[_0x9fae('0x39')],null))[_0x9fae('0x23')](function(_0x37623e){_0x2300f9=_0x37623e;var _0xda02d1={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x37623e&&_0x37623e[_0x9fae('0x62')]){if(_0x37623e[_0x9fae('0x62')]){_0xda02d1[_0x9fae('0x61')]['$and'][_0x9fae('0x60')]({'ListId':{'$ne':_0x37623e[_0x9fae('0x62')]}});}}return db[_0x9fae('0x30')][_0x9fae('0x31')](_0xda02d1);})[_0x9fae('0x23')](function(_0x147883){if(_0x147883){return _[_0x9fae('0x73')](_[_0x9fae('0x74')](_0x1a3982['body'],function(_0x4a5918,_0x2ee4a6){return _[_0x9fae('0x2b')](_0x2ee4a6,_0x9fae('0x2c'));}),_[_0x9fae('0x70')](_0x147883,function(_0x297511){return util[_0x9fae('0x71')]('cf_%d',_0x297511['id']);}));}})['then'](function(_0x44db75){if(_0x44db75&&!_[_0x9fae('0x75')](_0x44db75)){var _0x191a83=squel[_0x9fae('0x1c')]()[_0x9fae('0x76')](_0x9fae('0x77'))[_0x9fae('0x78')](_0x44db75)[_0x9fae('0x61')](_0x9fae('0x79'),_0x1a3982[_0x9fae('0x28')]['id'])['toParam']();return db[_0x9fae('0x6c')]['query'](_0x191a83[_0x9fae('0x7a')],{'replacements':_0x191a83[_0x9fae('0x34')]});}})[_0x9fae('0x23')](function(){if(_0x1a3982['body']['phone']&&_0x2300f9){return db[_0x9fae('0x3f')][_0x9fae('0x1c')]({'phone':_0x1a3982['body'][_0x9fae('0x7b')],'OrderBy':0x0},{'where':{'ContactId':_0x2300f9['id']}});}})[_0x9fae('0x23')](function(){return _0x2300f9;})[_0x9fae('0x23')](respondWithResult(_0x38cbb9,null))[_0x9fae('0x24')](handleError(_0x38cbb9,null));};exports[_0x9fae('0x7c')]=function(_0x5f4ff6,_0x33c474){var _0x164ca1={};var _0xe18bde={};var _0x118621;var _0x10db4f;return db['CmContact'][_0x9fae('0x7d')]({'where':{'id':_0x5f4ff6[_0x9fae('0x28')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x33c474,null))['then'](function(_0x5d9a6c){if(_0x5d9a6c){_0x118621=_0x5d9a6c;_0xe18bde[_0x9fae('0x7e')]=_[_0x9fae('0x2a')](db['Tag'][_0x9fae('0x7f')]);_0xe18bde['query']=_[_0x9fae('0x2a')](_0x5f4ff6[_0x9fae('0x22')]);_0xe18bde[_0x9fae('0x80')]=_[_0x9fae('0x81')](_0xe18bde[_0x9fae('0x7e')],_0xe18bde[_0x9fae('0x22')]);_0x164ca1[_0x9fae('0x82')]=_[_0x9fae('0x81')](_0xe18bde[_0x9fae('0x7e')],qs['fields'](_0x5f4ff6['query'][_0x9fae('0x83')]));_0x164ca1[_0x9fae('0x82')]=_0x164ca1[_0x9fae('0x82')][_0x9fae('0x32')]?_0x164ca1[_0x9fae('0x82')]:_0xe18bde[_0x9fae('0x7e')];_0x164ca1['order']=qs[_0x9fae('0x84')](_0x5f4ff6[_0x9fae('0x22')][_0x9fae('0x84')]);_0x164ca1[_0x9fae('0x61')]=qs[_0x9fae('0x80')](_[_0x9fae('0x85')](_0x5f4ff6[_0x9fae('0x22')],_0xe18bde['filters']));if(_0x5f4ff6[_0x9fae('0x22')][_0x9fae('0x86')]){_0x164ca1['where']=_['merge'](_0x164ca1['where'],{'$or':_[_0x9fae('0x70')](_0x164ca1[_0x9fae('0x82')],function(_0xfce9c3){var _0x1d6a05={};_0x1d6a05[_0xfce9c3]={'$like':'%'+_0x5f4ff6[_0x9fae('0x22')][_0x9fae('0x86')]+'%'};return _0x1d6a05;})});}_0x164ca1=_[_0x9fae('0x38')]({},_0x164ca1,_0x5f4ff6[_0x9fae('0x87')]);return _0x118621[_0x9fae('0x7c')](_0x164ca1);}})[_0x9fae('0x23')](function(_0x2cf629){if(_0x2cf629){_0x10db4f=_0x2cf629[_0x9fae('0x32')];if(!_0x5f4ff6[_0x9fae('0x22')][_0x9fae('0x64')](_0x9fae('0x88'))){_0x164ca1[_0x9fae('0x17')]=qs[_0x9fae('0x17')](_0x5f4ff6[_0x9fae('0x22')]['limit']);_0x164ca1['offset']=qs[_0x9fae('0x16')](_0x5f4ff6[_0x9fae('0x22')][_0x9fae('0x16')]);}return _0x118621[_0x9fae('0x7c')](_0x164ca1);}})[_0x9fae('0x23')](function(_0x4bc414){if(_0x4bc414){return _0x4bc414?{'count':_0x10db4f,'rows':_0x4bc414}:null;}})[_0x9fae('0x23')](respondWithResult(_0x33c474,null))[_0x9fae('0x24')](handleError(_0x33c474,null));};exports[_0x9fae('0x89')]=function(_0x4a65a3,_0x305765){if(_0x4a65a3[_0x9fae('0x39')]['id']){delete _0x4a65a3[_0x9fae('0x39')]['id'];}return db[_0x9fae('0x26')][_0x9fae('0x7d')]({'where':{'id':_0x4a65a3[_0x9fae('0x28')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x305765,null))[_0x9fae('0x23')](function(_0x5c66da){if(_0x5c66da){return _0x5c66da[_0x9fae('0x89')](_0x4a65a3[_0x9fae('0x39')][_0x9fae('0x8a')]||[]);}return null;})[_0x9fae('0x23')](respondWithResult(_0x305765,null))['catch'](handleError(_0x305765,null));};exports['setAdditionalPhones']=function(_0x4fdc85,_0x3ffbc0){var _0x3b1eb0=[];_0x3b1eb0[_0x9fae('0x60')](addAdditionalPhones(_0x4fdc85[_0x9fae('0x39')]));Promise[_0x9fae('0x66')](_0x3b1eb0)[_0x9fae('0x23')](function(){_0x3b1eb0=[];_0x3b1eb0[_0x9fae('0x60')](deleteCmHopperPhones(_0x4fdc85[_0x9fae('0x39')]['id']));_0x3b1eb0[_0x9fae('0x60')](addCmHopperPhones(_0x4fdc85[_0x9fae('0x39')]['id']));Promise[_0x9fae('0x66')](_0x3b1eb0)['then'](function(){return[0x1];})[_0x9fae('0x23')](respondWithResult(_0x3ffbc0,null));});};function addAdditionalPhones(_0x227b0d){var _0x7ae82e;return new Promise(function(_0x588de4){return db[_0x9fae('0x4c')][_0x9fae('0x25')]({'where':{'CmContactId':_0x227b0d['id']}})[_0x9fae('0x23')](function(){db[_0x9fae('0x6b')][_0x9fae('0x31')]({'raw':!![],'attributes':['id',_0x9fae('0x8b')]})['then'](function(_0x2cc3df){var _0x2b1181=[];for(var _0x4046bd=0x0;_0x4046bd<_0x227b0d[_0x9fae('0x8c')]['length'];_0x4046bd++){var _0x4c29b6=_0x227b0d[_0x9fae('0x8d')]?_[_0x9fae('0x58')](_0x227b0d[_0x9fae('0x8d')][_0x4046bd])?'':_0x227b0d['item_types'][_0x4046bd]:_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x8e')]?_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x8e')]:'';var _0x7eb5c3=_[_0x9fae('0x58')](_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x8f')])?'':_0x227b0d['items'][_0x4046bd][_0x9fae('0x8f')];var _0x5b0024=_0x4c29b6+':'+_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x7b')]+'§'+_0x7eb5c3;if(_[_0x9fae('0x58')](_0x7ae82e))_0x7ae82e=_0x5b0024;else _0x7ae82e+=';'+_0x5b0024;var _0x3ef87d=null;var _0x4eff42=null;if(_0x227b0d[_0x9fae('0x8d')]){if(!_[_0x9fae('0x58')](_0x227b0d[_0x9fae('0x8d')][_0x4046bd])){_0x4eff42=_[_0x9fae('0x27')](_0x2cc3df,function(_0x13984e){return _0x13984e['id']===_0x227b0d[_0x9fae('0x8d')][_0x4046bd];});if(!_['isNil'](_0x4eff42)){_0x3ef87d=_0x4eff42[_0x9fae('0x8b')];}}}else{if(!_['isNil'](_0x227b0d[_0x9fae('0x8c')][_0x4046bd])){_0x4eff42=_[_0x9fae('0x27')](_0x2cc3df,function(_0x34a204){return _0x34a204['id']===_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x8e')];});if(!_[_0x9fae('0x58')](_0x4eff42)){_0x3ef87d=_0x4046bd;}}}if(_[_0x9fae('0x58')](_0x3ef87d)){_0x3ef87d=0x64;}_0x2b1181['push'](addAdditionalPhone(_0x227b0d['id'],_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x7b')],_0x227b0d[_0x9fae('0x8d')]?_[_0x9fae('0x58')](_0x227b0d[_0x9fae('0x8d')][_0x4046bd])?null:_0x227b0d[_0x9fae('0x8d')][_0x4046bd]:_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x8e')]?_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x8e')]:null,_0x3ef87d,_0x7eb5c3));}Promise[_0x9fae('0x66')](_0x2b1181)[_0x9fae('0x23')](function(){db[_0x9fae('0x26')][_0x9fae('0x1c')]({'AdditionalPhones':_0x7ae82e},{'where':{'id':_0x227b0d['id']}})[_0x9fae('0x23')](function(){_0x588de4(0x1);});});});});});}function addAdditionalPhone(_0x52b5c6,_0x4480a7,_0x5ad240,_0x4252b5,_0x2b5073){return db[_0x9fae('0x4c')][_0x9fae('0x27')]({'where':{'CmContactId':_0x52b5c6,'item':_0x4480a7}})[_0x9fae('0x23')](function(_0x559249){if(_0x559249)logger[_0x9fae('0x35')](_0x9fae('0x90'),_0x559249);else{db[_0x9fae('0x4c')][_0x9fae('0x42')]({'CmContactId':_0x52b5c6,'item':_0x4480a7,'ItemTypeId':_0x5ad240,'OrderBy':_0x4252b5,'ItemClass':'PHONE','description':_0x2b5073});}});}function deleteCmHopperPhones(_0x629e0a){return new Promise(function(_0x13c0b4){return db[_0x9fae('0x3f')][_0x9fae('0x31')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x629e0a}})[_0x9fae('0x23')](function(_0x4e7acf){db[_0x9fae('0x91')][_0x9fae('0x25')]({'where':{'CmHopperId':{'$in':_[_0x9fae('0x70')](_0x4e7acf,'id')}}});})['then'](function(){_0x13c0b4(0x1);});});}function addCmHopperPhones(_0x37c9ec){return new Promise(function(_0x4868be){return db['CmHopper'][_0x9fae('0x31')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x37c9ec}})[_0x9fae('0x23')](function(_0x4c0a72){var _0x42a7a8=[];_[_0x9fae('0x70')](_0x4c0a72,function(_0x332c7a){_0x42a7a8['push'](createCmHopperPhone(_0x37c9ec,_0x332c7a['id']));});Promise[_0x9fae('0x66')](_0x42a7a8)[_0x9fae('0x23')](function(){_0x4868be(0x1);});});});}function createCmHopperPhone(_0x42be53,_0x1a86d3){return new Promise(function(_0x499468){db[_0x9fae('0x4c')]['findAll']({'raw':!![],'attributes':['item','OrderBy'],'where':{'CmContactId':_0x42be53,'ItemClass':'PHONE'},'include':[{'model':db[_0x9fae('0x6b')],'attributes':['OrderBy'],'as':_0x9fae('0x92')}],'order':[_0x9fae('0x8b'),db[_0x9fae('0x6c')]['literal'](_0x9fae('0x93'))]})[_0x9fae('0x23')](function(_0x22df3f){var _0xea3284=0x1;var _0x41353a=_[_0x9fae('0x70')](_0x22df3f,function(_0x552d21){_0x552d21[_0x9fae('0x94')]=_0x1a86d3;_0x552d21[_0x9fae('0x7b')]=_0x552d21[_0x9fae('0x95')];_0x552d21[_0x9fae('0x8b')]=_0xea3284;delete _0x552d21[_0x9fae('0x96')];_0xea3284=_0xea3284+0x1;return _0x552d21;});return db[_0x9fae('0x91')][_0x9fae('0x97')](_0x41353a,{});})['then'](function(){_0x499468(0x1);});});}function insertAdditionalPhones(_0x8e70e3,_0x21b7d0){return new Promise(function(_0x557d6a){var _0x3542a9=[];for(var _0x55f7a9=0x0;_0x55f7a9<_0x21b7d0[_0x9fae('0x32')];_0x55f7a9++){var _0x1b86e1=_0x21b7d0[_0x55f7a9];_0x3542a9[_0x9fae('0x60')](parseContactItemType(_0x1b86e1));}Promise[_0x9fae('0x66')](_0x3542a9)[_0x9fae('0x23')](function(){var _0x38e09c={'id':_0x8e70e3['id'],'items':_0x21b7d0};return addAdditionalPhones(_0x38e09c)[_0x9fae('0x23')](function(){return addCmHopperPhones(_0x8e70e3['id']);});})['then'](function(){_0x557d6a(_0x8e70e3);});});}function parseContactItemType(_0x745792){return new Promise(function(_0xc8ebd4){if(_0x745792['hasOwnProperty']('ItemTypeId')){_0xc8ebd4(_0x745792);}else{return db['ContactItemType']['find']({'where':{'name':_0x745792[_0x9fae('0x92')]}})[_0x9fae('0x23')](function(_0x5c31f0){if(_[_0x9fae('0x58')](_0x5c31f0))_0x745792[_0x9fae('0x8e')]=null;else _0x745792[_0x9fae('0x8e')]=_0x5c31f0['id'];_0xc8ebd4(_0x745792);});}});}exports[_0x9fae('0x98')]=function(_0x2e8779,_0x4952e6){return db[_0x9fae('0x4c')][_0x9fae('0x31')]({'raw':!![],'where':{'CmContactId':_0x2e8779[_0x9fae('0x28')]['id'],'ItemClass':_0x9fae('0x99')},'include':[{'model':db[_0x9fae('0x6b')],'as':_0x9fae('0x92')}],'order':[['OrderBy'],[db[_0x9fae('0x6c')][_0x9fae('0x6d')](_0x9fae('0x93'))]]})['then'](function(_0x6fbd23){return _0x6fbd23;})[_0x9fae('0x23')](respondWithResult(_0x4952e6,null))[_0x9fae('0x24')](handleError(_0x4952e6,null));};exports[_0x9fae('0x9a')]=function(_0x4fce3b,_0x401da0){return db[_0x9fae('0x4c')]['findAll']({'raw':!![],'where':{'CmContactId':_0x4fce3b[_0x9fae('0x39')][_0x9fae('0x9b')]}})[_0x9fae('0x23')](function(_0x373cdc){var _0x508f85=_['map'](_0x373cdc,function(_0xbf31c3){_0xbf31c3['CmContactId']=_0x4fce3b[_0x9fae('0x39')][_0x9fae('0x9c')];return _0xbf31c3;});return db[_0x9fae('0x4c')][_0x9fae('0x97')](_0x508f85,{});})['then'](function(){return addCmHopperPhones(_0x4fce3b[_0x9fae('0x39')][_0x9fae('0x9c')]);})[_0x9fae('0x23')](function(){return['ok'];})[_0x9fae('0x23')](respondWithResult(_0x401da0,null))[_0x9fae('0x24')](handleError(_0x401da0,null));};exports['rescheduleAdditionalPhones']=function(_0x536aff,_0x51ffcd){var _0x23545f=[];_0x23545f['push'](createCmHopperPhone(_0x536aff[_0x9fae('0x39')]['id'],_0x536aff[_0x9fae('0x39')][_0x9fae('0x9d')]));Promise['all'](_0x23545f)['then'](function(){return[0x1];})['then'](respondWithResult(_0x51ffcd,null));};exports[_0x9fae('0x9e')]=function(_0x33a431,_0x4f31ea){var _0x493485={'raw':![],'where':{}};var _0x28a126={};var _0x314e07={'count':0x0,'rows':[]};return db[_0x9fae('0x26')][_0x9fae('0x7d')]({'where':{'id':_0x33a431['params']['id']}})['then'](handleEntityNotFound(_0x4f31ea,null))['then'](function(_0x590919){if(_0x590919){_0x28a126[_0x9fae('0x7e')]=_['keys'](db['CmHopper']['rawAttributes']);_0x28a126[_0x9fae('0x22')]=_['keys'](_0x33a431[_0x9fae('0x22')]);_0x28a126[_0x9fae('0x80')]=_[_0x9fae('0x81')](_0x28a126[_0x9fae('0x7e')],_0x28a126[_0x9fae('0x22')]);_0x493485['attributes']=_[_0x9fae('0x81')](_0x28a126['model'],qs[_0x9fae('0x83')](_0x33a431[_0x9fae('0x22')]['fields']));_0x493485[_0x9fae('0x82')]=_0x493485[_0x9fae('0x82')][_0x9fae('0x32')]?_0x493485[_0x9fae('0x82')]:_0x28a126[_0x9fae('0x7e')];if(!_0x33a431[_0x9fae('0x22')][_0x9fae('0x64')](_0x9fae('0x88'))){_0x493485[_0x9fae('0x17')]=qs[_0x9fae('0x17')](_0x33a431[_0x9fae('0x22')][_0x9fae('0x17')]);_0x493485[_0x9fae('0x16')]=qs[_0x9fae('0x16')](_0x33a431[_0x9fae('0x22')][_0x9fae('0x16')]);}_0x493485[_0x9fae('0x9f')]=qs['sort'](_0x33a431[_0x9fae('0x22')][_0x9fae('0x84')]);_0x493485[_0x9fae('0x61')]=qs[_0x9fae('0x80')](_['pick'](_0x33a431[_0x9fae('0x22')],_0x28a126['filters']));_0x493485[_0x9fae('0x61')][_0x9fae('0xa0')]=_0x590919['id'];if(_0x33a431[_0x9fae('0x22')][_0x9fae('0x86')]){_0x493485[_0x9fae('0x61')]=_[_0x9fae('0x38')](_0x493485[_0x9fae('0x61')],{'$or':_[_0x9fae('0x70')](_0x493485['attributes'],function(_0x19512b){var _0xf71d87={};_0xf71d87[_0x19512b]={'$like':'%'+_0x33a431[_0x9fae('0x22')][_0x9fae('0x86')]+'%'};return _0xf71d87;})});}_0x493485=_[_0x9fae('0x38')]({},_0x493485,_0x33a431[_0x9fae('0x87')]);return db[_0x9fae('0x3f')][_0x9fae('0x19')]({'where':_0x493485['where']})[_0x9fae('0x23')](function(_0x5ee212){_0x314e07['count']=_0x5ee212;if(_0x33a431[_0x9fae('0x22')][_0x9fae('0xa1')]){_0x493485[_0x9fae('0xa2')]=[{'all':!![]}];}return db[_0x9fae('0x3f')][_0x9fae('0x31')](_0x493485);})[_0x9fae('0x23')](function(_0x10e87c){_0x314e07[_0x9fae('0xa3')]=_0x10e87c;return _0x314e07;});}})[_0x9fae('0x23')](respondWithFilteredResult(_0x4f31ea,_0x493485))[_0x9fae('0x24')](handleError(_0x4f31ea,null));};exports['getHopperHistories']=function(_0x272f39,_0x6a0b54){var _0x3a6feb={'raw':!![],'where':{}};var _0x3f01e0={};var _0x5e376e={'count':0x0,'rows':[]};return db[_0x9fae('0x26')][_0x9fae('0x7d')]({'where':{'id':_0x272f39[_0x9fae('0x28')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x6a0b54,null))[_0x9fae('0x23')](function(_0x214651){if(_0x214651){_0x3f01e0[_0x9fae('0x7e')]=_[_0x9fae('0x2a')](db[_0x9fae('0x4d')][_0x9fae('0x7f')]);_0x3f01e0[_0x9fae('0x22')]=_[_0x9fae('0x2a')](_0x272f39[_0x9fae('0x22')]);_0x3f01e0[_0x9fae('0x80')]=_[_0x9fae('0x81')](_0x3f01e0[_0x9fae('0x7e')],_0x3f01e0[_0x9fae('0x22')]);_0x3a6feb['attributes']=_[_0x9fae('0x81')](_0x3f01e0[_0x9fae('0x7e')],qs[_0x9fae('0x83')](_0x272f39[_0x9fae('0x22')][_0x9fae('0x83')]));_0x3a6feb[_0x9fae('0x82')]=_0x3a6feb[_0x9fae('0x82')][_0x9fae('0x32')]?_0x3a6feb[_0x9fae('0x82')]:_0x3f01e0[_0x9fae('0x7e')];if(!_0x272f39[_0x9fae('0x22')][_0x9fae('0x64')]('nolimit')){_0x3a6feb[_0x9fae('0x17')]=qs[_0x9fae('0x17')](_0x272f39[_0x9fae('0x22')][_0x9fae('0x17')]);_0x3a6feb[_0x9fae('0x16')]=qs[_0x9fae('0x16')](_0x272f39[_0x9fae('0x22')]['offset']);}_0x3a6feb[_0x9fae('0x9f')]=qs[_0x9fae('0x84')](_0x272f39[_0x9fae('0x22')][_0x9fae('0x84')]);_0x3a6feb[_0x9fae('0x61')]=qs[_0x9fae('0x80')](_['pick'](_0x272f39[_0x9fae('0x22')],_0x3f01e0[_0x9fae('0x80')]));_0x3a6feb['where'][_0x9fae('0xa0')]=_0x214651['id'];if(_0x272f39['query']['filter']){_0x3a6feb[_0x9fae('0x61')]=_[_0x9fae('0x38')](_0x3a6feb['where'],{'$or':_['map'](_0x3a6feb[_0x9fae('0x82')],function(_0x3bd1ee){var _0x2142b2={};_0x2142b2[_0x3bd1ee]={'$like':'%'+_0x272f39['query'][_0x9fae('0x86')]+'%'};return _0x2142b2;})});}_0x3a6feb=_[_0x9fae('0x38')]({},_0x3a6feb,_0x272f39['options']);return db[_0x9fae('0x4d')][_0x9fae('0x19')]({'where':_0x3a6feb['where']})['then'](function(_0x369a1f){_0x5e376e[_0x9fae('0x19')]=_0x369a1f;if(_0x272f39[_0x9fae('0x22')][_0x9fae('0xa1')]){_0x3a6feb[_0x9fae('0xa2')]=[{'all':!![]}];}return db[_0x9fae('0x4d')][_0x9fae('0x31')](_0x3a6feb);})[_0x9fae('0x23')](function(_0x943352){_0x5e376e['rows']=_0x943352;return _0x5e376e;});}})[_0x9fae('0x23')](respondWithFilteredResult(_0x6a0b54,_0x3a6feb))[_0x9fae('0x24')](handleError(_0x6a0b54,null));};exports[_0x9fae('0xa4')]=function(_0x456265,_0x4cd831){var _0x272bbc={'raw':!![],'where':{}};var _0x3f606d={};var _0x199a24={'count':0x0,'rows':[]};return db['CmContact'][_0x9fae('0x7d')]({'where':{'id':_0x456265[_0x9fae('0x28')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x4cd831,null))[_0x9fae('0x23')](function(_0x5be014){if(_0x5be014){_0x3f606d['model']=_[_0x9fae('0x2a')](db['CmHopperFinal'][_0x9fae('0x7f')]);_0x3f606d[_0x9fae('0x22')]=_[_0x9fae('0x2a')](_0x456265[_0x9fae('0x22')]);_0x3f606d[_0x9fae('0x80')]=_[_0x9fae('0x81')](_0x3f606d[_0x9fae('0x7e')],_0x3f606d[_0x9fae('0x22')]);_0x272bbc[_0x9fae('0x82')]=_[_0x9fae('0x81')](_0x3f606d[_0x9fae('0x7e')],qs[_0x9fae('0x83')](_0x456265[_0x9fae('0x22')][_0x9fae('0x83')]));_0x272bbc[_0x9fae('0x82')]=_0x272bbc[_0x9fae('0x82')][_0x9fae('0x32')]?_0x272bbc[_0x9fae('0x82')]:_0x3f606d['model'];if(!_0x456265['query'][_0x9fae('0x64')](_0x9fae('0x88'))){_0x272bbc[_0x9fae('0x17')]=qs['limit'](_0x456265[_0x9fae('0x22')][_0x9fae('0x17')]);_0x272bbc['offset']=qs[_0x9fae('0x16')](_0x456265['query'][_0x9fae('0x16')]);}_0x272bbc[_0x9fae('0x9f')]=qs[_0x9fae('0x84')](_0x456265[_0x9fae('0x22')]['sort']);_0x272bbc['where']=qs['filters'](_[_0x9fae('0x85')](_0x456265['query'],_0x3f606d['filters']));_0x272bbc[_0x9fae('0x61')][_0x9fae('0xa0')]=_0x5be014['id'];if(_0x456265[_0x9fae('0x22')][_0x9fae('0x86')]){_0x272bbc[_0x9fae('0x61')]=_[_0x9fae('0x38')](_0x272bbc['where'],{'$or':_[_0x9fae('0x70')](_0x272bbc[_0x9fae('0x82')],function(_0x537869){var _0x33ba15={};_0x33ba15[_0x537869]={'$like':'%'+_0x456265[_0x9fae('0x22')][_0x9fae('0x86')]+'%'};return _0x33ba15;})});}_0x272bbc=_[_0x9fae('0x38')]({},_0x272bbc,_0x456265[_0x9fae('0x87')]);return db[_0x9fae('0xa5')][_0x9fae('0x19')]({'where':_0x272bbc['where']})[_0x9fae('0x23')](function(_0x5f4c4a){_0x199a24[_0x9fae('0x19')]=_0x5f4c4a;if(_0x456265['query']['includeAll']){_0x272bbc[_0x9fae('0xa2')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x9fae('0x31')](_0x272bbc);})[_0x9fae('0x23')](function(_0x17fa9e){_0x199a24[_0x9fae('0xa3')]=_0x17fa9e;return _0x199a24;});}})[_0x9fae('0x23')](respondWithFilteredResult(_0x4cd831,_0x272bbc))[_0x9fae('0x24')](handleError(_0x4cd831,null));};exports['getJscriptySessions']=function(_0x498597,_0x432b60){var _0x213afc={'raw':!![],'where':{}};var _0x36a200={};var _0x231180={'count':0x0,'rows':[]};return db[_0x9fae('0x26')]['findOne']({'where':{'id':_0x498597[_0x9fae('0x28')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x432b60,null))[_0x9fae('0x23')](function(_0x1fb2bd){if(_0x1fb2bd){_0x36a200[_0x9fae('0x7e')]=_[_0x9fae('0x2a')](db[_0x9fae('0x54')]['rawAttributes']);_0x36a200[_0x9fae('0x22')]=_[_0x9fae('0x2a')](_0x498597[_0x9fae('0x22')]);_0x36a200[_0x9fae('0x80')]=_[_0x9fae('0x81')](_0x36a200[_0x9fae('0x7e')],_0x36a200[_0x9fae('0x22')]);_0x213afc['attributes']=_[_0x9fae('0x81')](_0x36a200[_0x9fae('0x7e')],qs['fields'](_0x498597[_0x9fae('0x22')][_0x9fae('0x83')]));_0x213afc[_0x9fae('0x82')]=_0x213afc['attributes']['length']?_0x213afc['attributes']:_0x36a200['model'];if(!_0x498597[_0x9fae('0x22')][_0x9fae('0x64')](_0x9fae('0x88'))){_0x213afc[_0x9fae('0x17')]=qs['limit'](_0x498597['query']['limit']);_0x213afc['offset']=qs[_0x9fae('0x16')](_0x498597[_0x9fae('0x22')]['offset']);}_0x213afc[_0x9fae('0x9f')]=qs[_0x9fae('0x84')](_0x498597['query'][_0x9fae('0x84')]);_0x213afc[_0x9fae('0x61')]=qs[_0x9fae('0x80')](_[_0x9fae('0x85')](_0x498597[_0x9fae('0x22')],_0x36a200['filters']));_0x213afc[_0x9fae('0x61')][_0x9fae('0xa0')]=_0x1fb2bd['id'];if(_0x498597[_0x9fae('0x22')]['filter']){_0x213afc[_0x9fae('0x61')]=_['merge'](_0x213afc[_0x9fae('0x61')],{'$or':_[_0x9fae('0x70')](_0x213afc[_0x9fae('0x82')],function(_0x20059d){var _0x233e94={};_0x233e94[_0x20059d]={'$like':'%'+_0x498597[_0x9fae('0x22')]['filter']+'%'};return _0x233e94;})});}_0x213afc=_[_0x9fae('0x38')]({},_0x213afc,_0x498597[_0x9fae('0x87')]);return db[_0x9fae('0x54')][_0x9fae('0x19')]({'where':_0x213afc[_0x9fae('0x61')]})[_0x9fae('0x23')](function(_0x182af1){_0x231180[_0x9fae('0x19')]=_0x182af1;if(_0x498597['query']['includeAll']){_0x213afc['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x213afc);})[_0x9fae('0x23')](function(_0x50ae74){_0x231180[_0x9fae('0xa3')]=_0x50ae74;return _0x231180;});}})[_0x9fae('0x23')](respondWithFilteredResult(_0x432b60,_0x213afc))[_0x9fae('0x24')](handleError(_0x432b60,null));};exports['uploadCsv']=function(_0x47bf46,_0xfef74){try{if(!_0x47bf46['body'][_0x9fae('0x62')]){throw new Error(_0x9fae('0xa6'));}if(!_0x47bf46['body'][_0x9fae('0xa7')]){throw new Error(_0x9fae('0xa8'));}if(!_0x47bf46[_0x9fae('0x39')][_0x9fae('0xa9')]){throw new Error(_0x9fae('0xaa'));}if(!_0x47bf46['body'][_0x9fae('0xab')]){throw new Error(_0x9fae('0xac'));}var _0x26eb4d=_0x47bf46[_0x9fae('0x39')][_0x9fae('0xa7')][_0x9fae('0xad')](',');var _0x438356=_0x47bf46[_0x9fae('0x39')][_0x9fae('0xa9')][_0x9fae('0xad')](',');if(!_0x26eb4d['length']||!_0x438356[_0x9fae('0x32')]||_0x26eb4d[_0x9fae('0x32')]!==_0x438356['length']){throw new Error(_0x9fae('0xae'));}_0x47bf46[_0x9fae('0x39')]['fields']=_[_0x9fae('0xaf')](_0x26eb4d,_0x438356);if(!_0x47bf46[_0x9fae('0x39')]['fields'][_0x9fae('0x7b')]){throw new Error(_0x9fae('0xb0'));}if(!_0x47bf46['body'][_0x9fae('0x83')][_0x9fae('0xb1')]){throw new Error(_0x9fae('0xb2'));}var _0xa2dee9=path[_0x9fae('0x3d')](config['root'],'server/files/tmp',_0x47bf46['file'][_0x9fae('0xb3')]);fs['chmodSync'](_0xa2dee9,parseInt(_0x9fae('0xb4'),0x8));var _0x3a3f89=require(_0x9fae('0xb5'))[_0x9fae('0xb6')](path['join'](__dirname,_0x9fae('0xb7')),[_0xa2dee9,_0x47bf46[_0x9fae('0x39')][_0x9fae('0xa7')],_0x47bf46[_0x9fae('0x39')]['binding_values'],_0x47bf46[_0x9fae('0x39')][_0x9fae('0x62')],_0x47bf46['body']['CompanyId'],_0x47bf46[_0x9fae('0x39')][_0x9fae('0x5e')],_0x47bf46[_0x9fae('0x39')]['socket_timestamp']]);return _0xfef74[_0x9fae('0x14')](0xc8)[_0x9fae('0x15')]({'message':_0x9fae('0xb8'),'pid':_0x3a3f89[_0x9fae('0xb9')]});}catch(_0x461245){return _0xfef74[_0x9fae('0x14')](0x1f4)[_0x9fae('0xba')](_0x461245);}};exports[_0x9fae('0xbb')]=function(_0x313449,_0x55eb98){var _0x75d419=fs[_0x9fae('0xbc')](_0x313449['file'][_0x9fae('0x3')]);Papa['parse'](_0x75d419,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4213fe){return _0x55eb98[_0x9fae('0x14')](0xc8)['json']({'file':_0x313449[_0x9fae('0xbd')],'fields':_0x4213fe[_0x9fae('0xbe')][_0x9fae('0x83')]});}});};exports['import']=function(_0x5d57e1,_0xe05edb){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x9fae('0xbf')}})[_0x9fae('0x23')](function(_0x50f351){var _0x428caf=![];if(!_0x5d57e1[_0x9fae('0x39')][_0x9fae('0x62')]){throw new Error(_0x9fae('0xa6'));}if(!_0x5d57e1['body'][_0x9fae('0xc0')][_0x9fae('0x7b')]){throw new Error(_0x9fae('0xb0'));}if(!_0x5d57e1[_0x9fae('0x39')][_0x9fae('0xc0')][_0x9fae('0xb1')]){throw new Error(_0x9fae('0xb2'));}if(!_0x5d57e1[_0x9fae('0x39')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x231e68=require(_0x9fae('0xb5'))['fork'](path[_0x9fae('0x3d')](__dirname,_0x9fae('0xc1')),[_0x5d57e1['params']['id'],JSON[_0x9fae('0xc2')](_0x5d57e1[_0x9fae('0x39')]),JSON[_0x9fae('0xc2')](_0x50f351)]);_0x231e68['on'](_0x9fae('0xc3'),function(){_0x428caf=!![];return _0xe05edb[_0x9fae('0x14')](0xc8)['json']({'message':_0x9fae('0xc4'),'pid':_0x231e68[_0x9fae('0xb9')]});});_0x231e68['on'](_0x9fae('0xc5'),function(_0x4355f3){if(_0x4355f3&&!_0x428caf){return _0xe05edb[_0x9fae('0x14')](0x1f4)[_0x9fae('0x15')]({'message':_0x9fae('0xc6'),'pid':_0x231e68[_0x9fae('0xb9')]});}});})['catch'](handleError(_0xe05edb,null));};exports[_0x9fae('0xc7')]=function(_0x5cae74,_0xd0f0b0){return db[_0x9fae('0xc8')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x9fae('0xbf')}})[_0x9fae('0x23')](function(_0x2552ff){var _0x3f6afa=![];if(!_0x5cae74[_0x9fae('0x39')][_0x9fae('0x62')]){throw new Error(_0x9fae('0xa6'));}if(!_0x5cae74[_0x9fae('0x39')][_0x9fae('0xc0')][_0x9fae('0x7b')]){throw new Error(_0x9fae('0xb0'));}if(!_0x5cae74[_0x9fae('0x39')][_0x9fae('0xc0')][_0x9fae('0xb1')]){throw new Error(_0x9fae('0xb2'));}if(!_0x5cae74[_0x9fae('0x39')][_0x9fae('0xab')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x33c1de=require(_0x9fae('0xb5'))['fork'](path['join'](__dirname,_0x9fae('0xc9')),[_0x5cae74[_0x9fae('0x28')]['id'],JSON[_0x9fae('0xc2')](_0x5cae74[_0x9fae('0x39')]),JSON['stringify'](_0x2552ff)]);_0x33c1de['on'](_0x9fae('0xc3'),function(){_0x3f6afa=!![];return _0xd0f0b0['status'](0xc8)[_0x9fae('0x15')]({'message':_0x9fae('0xc4'),'pid':_0x33c1de['pid']});});_0x33c1de['on'](_0x9fae('0xc5'),function(_0x349556){if(_0x349556&&!_0x3f6afa){return _0xd0f0b0['status'](0x1f4)[_0x9fae('0x15')]({'message':'error\x20child\x20process','pid':_0x33c1de[_0x9fae('0xb9')]});}});})[_0x9fae('0x24')](handleError(_0xd0f0b0,null));};exports[_0x9fae('0xca')]=function(_0x793481,_0x3e7baa){var _0x5457bc=['mail',_0x9fae('0xcb'),'sms',_0x9fae('0xcc'),_0x9fae('0xcd'),_0x9fae('0xce'),_0x9fae('0xcf')];var _0x390b17={'offset':0x0,'order':qs[_0x9fae('0x84')](_0x9fae('0xd0'))},_0x5ec9f6={'count':0x0,'rows':[]};Promise[_0x9fae('0xd1')]()[_0x9fae('0x23')](function(){if(_0x793481['query'][_0x9fae('0xd2')]){if(!_['includes'](_0x5457bc,_0x793481[_0x9fae('0x22')][_0x9fae('0xd2')][_0x9fae('0xd3')]())){throw new Error(_0x9fae('0xd4'));}_0x5457bc=[_0x793481[_0x9fae('0x22')][_0x9fae('0xd2')][_0x9fae('0xd3')]()];}if(_0x793481[_0x9fae('0x22')][_0x9fae('0xd5')]){try{var _0x27d1a1=JSON[_0x9fae('0xd6')](_0x793481['query'][_0x9fae('0xd5')]);if(!moment(_0x27d1a1[_0x9fae('0x3a')])[_0x9fae('0xd7')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x27d1a1['to'])[_0x9fae('0xd7')]()){throw new Error(_0x9fae('0xd8'));}}catch(_0x58d155){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x793481[_0x9fae('0x22')][_0x9fae('0x64')](_0x9fae('0x88'))){_0x390b17[_0x9fae('0x17')]=qs['limit'](_0x793481[_0x9fae('0x22')]['limit']||0xa);_0x390b17[_0x9fae('0x16')]=qs[_0x9fae('0x16')](_0x793481[_0x9fae('0x22')][_0x9fae('0x16')]);}var _0x27276b=_0x5457bc[_0x9fae('0x70')](function(_0xf736fe){if(_0xf736fe===_0x9fae('0xcf')){var _0x5daf0e={'attributes':['id','uniqueid',_0x9fae('0xd9'),_0x9fae('0xda'),_0x9fae('0xdb'),'callerid',_0x9fae('0xdc'),'endtime',_0x9fae('0xdd'),_0x9fae('0xde'),_0x9fae('0xdf'),_0x9fae('0xe0'),_0x9fae('0xe1'),_0x9fae('0xe2'),'UserId'],'where':{'ContactId':_0x793481[_0x9fae('0x28')]['id']},'include':[{'model':db[_0x9fae('0xc8')],'as':_0x9fae('0xc8'),'attributes':['id',_0x9fae('0x1e'),_0x9fae('0xe3'),_0x9fae('0xe4')]}],'order':[[_0x9fae('0xdf'),_0x9fae('0xe5')]]};if(_0x793481[_0x9fae('0x22')]['range']){_0x5daf0e[_0x9fae('0x61')][_0x9fae('0xdf')]={'$gte':_0x27d1a1['from'],'$lte':_0x27d1a1['to']};}return db[_0x9fae('0x4f')][_0x9fae('0xe6')](_0x5daf0e)['then'](function(_0x2e78de){_0x5ec9f6[_0x9fae('0x19')]+=_0x2e78de[_0x9fae('0x19')];return _[_0x9fae('0x70')](_0x2e78de['rows'],function(_0x5314e7){var _0x30a4a7=_0x5314e7[_0x9fae('0x3b')]({'plain':!![]});_0x30a4a7['channel']=_0xf736fe;if(_0x30a4a7['User']){_0x30a4a7[_0x9fae('0xc8')]={'id':_0x30a4a7[_0x9fae('0xc8')]['id'],'name':_0x30a4a7[_0x9fae('0xc8')][_0x9fae('0x1e')],'fullname':_0x30a4a7[_0x9fae('0xc8')]['fullname'],'alias':_0x30a4a7[_0x9fae('0xc8')]['alias']};}return _0x30a4a7;});});}else{var _0x196623=_[_0x9fae('0xe7')](_0xf736fe)+(_0xf736fe===_0x9fae('0xcb')?_0x9fae('0xe8'):_0x9fae('0xe9'));var _0x5400fd={'attributes':['id','closed',_0x9fae('0xea'),_0x9fae('0xdf'),'note','disposition','secondDisposition','thirdDisposition','UserId',_0x196623+'Id'],'where':{'ContactId':_0x793481[_0x9fae('0x28')]['id']},'include':[{'model':db[_0x196623],'as':'Account','attributes':['id',_0x9fae('0x1e'),_0x9fae('0xeb')]},{'model':db[_0x9fae('0xc8')],'as':_0x9fae('0xec'),'attributes':['id',_0x9fae('0x1e'),_0x9fae('0xe3')]},{'model':db[_0x9fae('0x68')],'as':_0x9fae('0x69'),'attributes':['id','name','color'],'through':{'attributes':[]}}],'order':[[_0x9fae('0xdf'),_0x9fae('0xe5')]]};if(_0x793481[_0x9fae('0x22')][_0x9fae('0xd5')]){_0x5400fd[_0x9fae('0x61')][_0x9fae('0xdf')]={'$gte':_0x27d1a1[_0x9fae('0x3a')],'$lte':_0x27d1a1['to']};}switch(_0xf736fe){case _0x9fae('0xcb'):_0x5400fd[_0x9fae('0x82')][_0x9fae('0x60')](_0x9fae('0xed'),'customerIp','customerPort',_0x9fae('0xee'),'osName',_0x9fae('0xef'),_0x9fae('0xf0'),'ratingValue','referer');break;case _0x9fae('0xf1'):_0x5400fd[_0x9fae('0x82')][_0x9fae('0x60')]('subject',_0x9fae('0xf2'));break;case _0x9fae('0xcc'):_0x5400fd[_0x9fae('0x82')][_0x9fae('0x60')]('externalUrl','threadId');break;}return db[_[_0x9fae('0xe7')](_0xf736fe)+_0x9fae('0xf3')]['findAndCountAll'](_0x5400fd)[_0x9fae('0x23')](function(_0x47fae6){_0x5ec9f6[_0x9fae('0x19')]+=_0x47fae6[_0x9fae('0x19')];return _[_0x9fae('0x70')](_0x47fae6[_0x9fae('0xa3')],function(_0x30f5b7){var _0x606257=_0x30f5b7[_0x9fae('0x3b')]({'plain':!![]});_0x606257[_0x9fae('0xd2')]=_0xf736fe;if(_0x606257['Owner']){_0x606257[_0x9fae('0xec')]={'id':_0x606257[_0x9fae('0xec')]['id'],'name':_0x606257[_0x9fae('0xec')]['name'],'fullname':_0x606257[_0x9fae('0xec')]['fullname']};}return _0x606257;});});}});return Promise['all'](_0x27276b);})[_0x9fae('0x23')](function(_0x54ba98){return _(_0x54ba98)[_0x9fae('0xf4')]()[_0x9fae('0xf5')](_0x9fae('0xdf'))['reverse']()['value']();})[_0x9fae('0x23')](function(_0x4b473f){_0x5ec9f6['rows']=_0x390b17[_0x9fae('0x17')]?_0x4b473f[_0x9fae('0xf6')](_0x390b17['offset'],_0x390b17[_0x9fae('0x16')]+_0x390b17[_0x9fae('0x17')]):_0x4b473f;return _0x5ec9f6;})[_0x9fae('0x23')](respondWithFilteredResult(_0x3e7baa,_0x390b17))[_0x9fae('0x24')](handleError(_0x3e7baa,null));}; \ No newline at end of file +var _0x5e53=['includeAll','include','rows','getHopperHistories','rawAttributes','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','root','server/files/tmp','file','filename','chmodSync','child_process','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','binding','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','fork','../../components/import/cm/csv2','stringify','error\x20child\x20process','importUpdates','User','agent','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','exit','chat','sms','openchannel','fax','whatsapp','voice','channel','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','UserId','DESC','VoiceCallReport','fullname','startCase','Website','Account','closed','closedAt','note','secondDisposition','thirdDisposition','Owner','browserName','customerIp','customerPort','deviceModel','ratingMessage','referer','mail','subject','substatus','externalUrl','threadId','Interaction','findAndCountAll','flatten','sortBy','reverse','value','slice','moment','bluebird','util','path','lodash','papaparse','ioredis','../../components/contacts','api','../../config/environment/shared','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','json','undefined','limit','offset','status','set','destroy','then','end','sendStatus','error','stack','name','send','index','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','startsWith','cf_','displayName','analytics','length','columnName','alias','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','keys','forEach','merge','body','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','isNil','dialTimezone','utcOffset','timezones','additionalPhones','bulkCreate','each','duplicates','where','push','ListId','findOrCreate','spread','contact','show','Tag','Tags','tag','Phones','ItemType','sequelize','literal','$and','CmCustomField','omit','format','cf_%d','isEmpty','table','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','model','filters','intersection','attributes','fields','sort','pick','filter','map','hasOwnProperty','nolimit','setTags','ids','setAdditionalPhones','all','CmContactHasItem','ContactItemType','items','item_types','ItemTypeId','description','OrderBy','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','order','ContactId','options','count'];(function(_0x5ae5b5,_0x51d4d5){var _0x23c34f=function(_0x50527d){while(--_0x50527d){_0x5ae5b5['push'](_0x5ae5b5['shift']());}};_0x23c34f(++_0x51d4d5);}(_0x5e53,0x15e));var _0x35e5=function(_0x3a6d7a,_0x1210ea){_0x3a6d7a=_0x3a6d7a-0x0;var _0x1eda3d=_0x5e53[_0x3a6d7a];return _0x1eda3d;};'use strict';var moment=require(_0x35e5('0x0'));var BPromise=require(_0x35e5('0x1'));var util=require(_0x35e5('0x2'));var path=require(_0x35e5('0x3'));var fs=require('fs');var _=require(_0x35e5('0x4'));var squel=require('squel');var Papa=require(_0x35e5('0x5'));var Redis=require(_0x35e5('0x6'));var contacts=require(_0x35e5('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x35e5('0x8'));var config=require('../../config/environment');var shared=require(_0x35e5('0x9'));var db=require(_0x35e5('0xa'))['db'];config['redis']=_[_0x35e5('0xb')](config[_0x35e5('0xc')],{'host':_0x35e5('0xd'),'port':0x18eb});var socket=require(_0x35e5('0xe'))(new Redis(config['redis']));require(_0x35e5('0xf'))[_0x35e5('0x10')](socket);function respondWithResult(_0x563442,_0x298da1){_0x298da1=_0x298da1||0xc8;return function(_0x581551){if(_0x581551){return _0x563442['status'](_0x298da1)[_0x35e5('0x11')](_0x581551);}};}function respondWithFilteredResult(_0x5f201c,_0x3642b3){return function(_0x1e09cb){if(_0x1e09cb){var _0xc69d8b=typeof _0x3642b3['offset']===_0x35e5('0x12')&&typeof _0x3642b3[_0x35e5('0x13')]===_0x35e5('0x12');var _0xb32c4=_0x1e09cb['count'];var _0x5a2f08=_0xc69d8b?0x0:_0x3642b3[_0x35e5('0x14')];var _0x37acd4=_0xc69d8b?_0x1e09cb['count']:_0x3642b3['offset']+_0x3642b3[_0x35e5('0x13')];var _0x2b2877;if(_0x37acd4>=_0xb32c4){_0x37acd4=_0xb32c4;_0x2b2877=0xc8;}else{_0x2b2877=0xce;}_0x5f201c[_0x35e5('0x15')](_0x2b2877);return _0x5f201c[_0x35e5('0x16')]('Content-Range',_0x5a2f08+'-'+_0x37acd4+'/'+_0xb32c4)[_0x35e5('0x11')](_0x1e09cb);}return null;};}function saveUpdates(_0x40ba71){return function(_0x86d20c){if(_0x86d20c){return _0x86d20c['update'](_0x40ba71)['then'](function(_0x10dd5a){return _0x10dd5a;});}return null;};}function removeEntity(_0x1ff33a){return function(_0x42bea1){if(_0x42bea1){return _0x42bea1[_0x35e5('0x17')]()[_0x35e5('0x18')](function(){_0x1ff33a[_0x35e5('0x15')](0xcc)[_0x35e5('0x19')]();});}};}function handleEntityNotFound(_0x1fbe88){return function(_0x51c30d){if(!_0x51c30d){_0x1fbe88[_0x35e5('0x1a')](0x194);}return _0x51c30d;};}function handleError(_0x256947,_0x1351c0){_0x1351c0=_0x1351c0||0x1f4;return function(_0x3a5724){logger[_0x35e5('0x1b')](_0x3a5724[_0x35e5('0x1c')]);if(_0x3a5724[_0x35e5('0x1d')]){delete _0x3a5724[_0x35e5('0x1d')];}_0x256947[_0x35e5('0x15')](_0x1351c0)[_0x35e5('0x1e')](_0x3a5724);};}exports[_0x35e5('0x1f')]=function(_0x4cb4e1,_0x5e9b32){var _0x2206cd={};return contacts[_0x35e5('0x20')]()[_0x35e5('0x18')](function(_0x3ecacb){_0x2206cd=qs[_0x35e5('0x21')](_0x3ecacb,_0x4cb4e1);return contacts[_0x35e5('0x22')](_0x4cb4e1[_0x35e5('0x23')],_0x4cb4e1[_0x35e5('0x24')],_0x2206cd,_0x3ecacb);})[_0x35e5('0x18')](respondWithFilteredResult(_0x5e9b32,_0x2206cd))[_0x35e5('0x25')](handleError(_0x5e9b32,null));};exports[_0x35e5('0x17')]=function(_0xe0205,_0x2d4141){return db[_0x35e5('0x26')][_0x35e5('0x27')]({'where':{'id':_0xe0205[_0x35e5('0x28')]['id']}})['then'](handleEntityNotFound(_0x2d4141,null))[_0x35e5('0x18')](removeEntity(_0x2d4141,null))[_0x35e5('0x25')](handleError(_0x2d4141,null));};exports[_0x35e5('0x20')]=function(_0x5758af,_0x2821fe){return db[_0x35e5('0x26')][_0x35e5('0x20')]()[_0x35e5('0x18')](function(_0xd1f258){delete _0xd1f258[_0x35e5('0x29')];for(var _0x298fad=0x0;_0x298fad0x0){return new Promise(function(_0x15785d){var _0x5dcff5=[];for(var _0x4033a0=0x0;_0x4033a0<_0x5ca928['length'];_0x4033a0++){_0x5dcff5[_0x35e5('0x5f')](insertAdditionalPhones(_0x5ca928[_0x4033a0][_0x35e5('0x63')],_0x5ca928[_0x4033a0][_0x35e5('0x5a')]));}Promise['all'](_0x5dcff5)['then'](function(){_0x15785d(0x1);});})[_0x35e5('0x18')](function(){return{'success':_0x5e177f,'failure':_0x39c788,'duplicates':_0x1404b4};});}else{return{'success':_0x5e177f,'failure':_0x39c788,'duplicates':_0x1404b4};}}})[_0x35e5('0x18')](respondWithResult(_0x3d4cc8,0xc9))['catch'](handleError(_0x3d4cc8,null));};exports[_0x35e5('0x64')]=function(_0x45d5a6,_0x2bb3b3){var _0x4f807e;return db[_0x35e5('0x26')][_0x35e5('0x20')]()[_0x35e5('0x18')](function(_0x2349e8){return db[_0x35e5('0x26')]['find']({'where':{'id':_0x45d5a6[_0x35e5('0x28')]['id']},'include':[{'model':db[_0x35e5('0x65')],'as':_0x35e5('0x66'),'attributes':['id',_0x35e5('0x1d'),'color'],'required':_0x45d5a6['query'][_0x35e5('0x67')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x35e5('0x68'),'where':{'CmContactId':_0x45d5a6[_0x35e5('0x28')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x35e5('0x69')}]}],'order':[db[_0x35e5('0x6a')][_0x35e5('0x6b')]('Phones.OrderBy')],'attributes':_[_0x35e5('0x35')](_0x2349e8)});})[_0x35e5('0x18')](function(_0xdae934){if(!_['isNil'](_0xdae934)){_0x4f807e=_0xdae934[_0x35e5('0x3a')]({'plain':!![]});var _0x44dca6={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xdae934&&_0xdae934['ListId']){if(_0xdae934[_0x35e5('0x60')]){_0x44dca6['where'][_0x35e5('0x6c')][_0x35e5('0x5f')]({'ListId':{'$ne':_0xdae934[_0x35e5('0x60')]}});}}return db[_0x35e5('0x6d')][_0x35e5('0x22')](_0x44dca6);}})[_0x35e5('0x18')](function(_0x14955b){if(!_[_0x35e5('0x56')](_0x14955b)){return _[_0x35e5('0x6e')](_0x4f807e,_['map'](_0x14955b,function(_0x3908ca){return util[_0x35e5('0x6f')](_0x35e5('0x70'),_0x3908ca['id']);}));}})['then'](handleEntityNotFound(_0x2bb3b3,null))[_0x35e5('0x18')](respondWithResult(_0x2bb3b3,null))[_0x35e5('0x25')](handleError(_0x2bb3b3,null));};exports[_0x35e5('0x44')]=function(_0x861daa,_0x4694bf){var _0x1da31e;if(_0x861daa[_0x35e5('0x38')]['id']){delete _0x861daa[_0x35e5('0x38')]['id'];}if(!_['isNil'](_0x861daa[_0x35e5('0x38')]['dialTimezone'])){var _0x48aa25=_0x861daa[_0x35e5('0x38')][_0x35e5('0x57')];if(!_[_0x35e5('0x56')](shared[_0x35e5('0x59')][_0x48aa25]))_0x861daa['body'][_0x35e5('0x58')]=shared['timezones'][_0x48aa25][_0x35e5('0x58')];}return db['CmContact']['find']({'where':{'id':_0x861daa[_0x35e5('0x28')]['id']}})[_0x35e5('0x18')](handleEntityNotFound(_0x4694bf,null))[_0x35e5('0x18')](saveUpdates(_0x861daa[_0x35e5('0x38')],null))[_0x35e5('0x18')](function(_0x2728bc){_0x1da31e=_0x2728bc;var _0xced604={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2728bc&&_0x2728bc['ListId']){if(_0x2728bc[_0x35e5('0x60')]){_0xced604[_0x35e5('0x5e')]['$and'][_0x35e5('0x5f')]({'ListId':{'$ne':_0x2728bc[_0x35e5('0x60')]}});}}return db[_0x35e5('0x6d')][_0x35e5('0x22')](_0xced604);})[_0x35e5('0x18')](function(_0x2b0a5c){if(_0x2b0a5c){return _[_0x35e5('0x6e')](_['pickBy'](_0x861daa['body'],function(_0xac200d,_0x4d61ca){return _[_0x35e5('0x2a')](_0x4d61ca,_0x35e5('0x2b'));}),_['map'](_0x2b0a5c,function(_0x143f78){return util['format'](_0x35e5('0x70'),_0x143f78['id']);}));}})[_0x35e5('0x18')](function(_0x717b9b){if(_0x717b9b&&!_[_0x35e5('0x71')](_0x717b9b)){var _0x5a9085=squel['update']()[_0x35e5('0x72')]('cm_contacts')[_0x35e5('0x73')](_0x717b9b)[_0x35e5('0x5e')](_0x35e5('0x74'),_0x861daa[_0x35e5('0x28')]['id'])[_0x35e5('0x75')]();return db[_0x35e5('0x6a')][_0x35e5('0x23')](_0x5a9085[_0x35e5('0x76')],{'replacements':_0x5a9085['values']});}})[_0x35e5('0x18')](function(){if(_0x861daa[_0x35e5('0x38')][_0x35e5('0x77')]&&_0x1da31e){return db['CmHopper'][_0x35e5('0x44')]({'phone':_0x861daa[_0x35e5('0x38')][_0x35e5('0x77')],'OrderBy':0x0},{'where':{'ContactId':_0x1da31e['id']}});}})[_0x35e5('0x18')](function(){return _0x1da31e;})['then'](respondWithResult(_0x4694bf,null))[_0x35e5('0x25')](handleError(_0x4694bf,null));};exports[_0x35e5('0x78')]=function(_0x230726,_0x3ac659){var _0x269672={};var _0x3bab9a={};var _0x29eaed;var _0x3bd282;return db['CmContact'][_0x35e5('0x79')]({'where':{'id':_0x230726[_0x35e5('0x28')]['id']}})[_0x35e5('0x18')](handleEntityNotFound(_0x3ac659,null))['then'](function(_0x355e44){if(_0x355e44){_0x29eaed=_0x355e44;_0x3bab9a[_0x35e5('0x7a')]=_[_0x35e5('0x35')](db['Tag']['rawAttributes']);_0x3bab9a[_0x35e5('0x23')]=_['keys'](_0x230726[_0x35e5('0x23')]);_0x3bab9a[_0x35e5('0x7b')]=_[_0x35e5('0x7c')](_0x3bab9a[_0x35e5('0x7a')],_0x3bab9a[_0x35e5('0x23')]);_0x269672[_0x35e5('0x7d')]=_[_0x35e5('0x7c')](_0x3bab9a['model'],qs[_0x35e5('0x7e')](_0x230726[_0x35e5('0x23')][_0x35e5('0x7e')]));_0x269672[_0x35e5('0x7d')]=_0x269672[_0x35e5('0x7d')][_0x35e5('0x2e')]?_0x269672[_0x35e5('0x7d')]:_0x3bab9a[_0x35e5('0x7a')];_0x269672['order']=qs['sort'](_0x230726[_0x35e5('0x23')][_0x35e5('0x7f')]);_0x269672['where']=qs[_0x35e5('0x7b')](_[_0x35e5('0x80')](_0x230726[_0x35e5('0x23')],_0x3bab9a[_0x35e5('0x7b')]));if(_0x230726[_0x35e5('0x23')][_0x35e5('0x81')]){_0x269672[_0x35e5('0x5e')]=_['merge'](_0x269672[_0x35e5('0x5e')],{'$or':_[_0x35e5('0x82')](_0x269672['attributes'],function(_0x416551){var _0xce524={};_0xce524[_0x416551]={'$like':'%'+_0x230726['query'][_0x35e5('0x81')]+'%'};return _0xce524;})});}_0x269672=_[_0x35e5('0x37')]({},_0x269672,_0x230726['options']);return _0x29eaed[_0x35e5('0x78')](_0x269672);}})[_0x35e5('0x18')](function(_0x47a7f5){if(_0x47a7f5){_0x3bd282=_0x47a7f5[_0x35e5('0x2e')];if(!_0x230726[_0x35e5('0x23')][_0x35e5('0x83')](_0x35e5('0x84'))){_0x269672[_0x35e5('0x13')]=qs['limit'](_0x230726['query'][_0x35e5('0x13')]);_0x269672[_0x35e5('0x14')]=qs['offset'](_0x230726['query'][_0x35e5('0x14')]);}return _0x29eaed[_0x35e5('0x78')](_0x269672);}})[_0x35e5('0x18')](function(_0xd4cb3b){if(_0xd4cb3b){return _0xd4cb3b?{'count':_0x3bd282,'rows':_0xd4cb3b}:null;}})[_0x35e5('0x18')](respondWithResult(_0x3ac659,null))[_0x35e5('0x25')](handleError(_0x3ac659,null));};exports[_0x35e5('0x85')]=function(_0x5a1f5f,_0xf1e209){if(_0x5a1f5f[_0x35e5('0x38')]['id']){delete _0x5a1f5f[_0x35e5('0x38')]['id'];}return db[_0x35e5('0x26')][_0x35e5('0x79')]({'where':{'id':_0x5a1f5f[_0x35e5('0x28')]['id']}})[_0x35e5('0x18')](handleEntityNotFound(_0xf1e209,null))[_0x35e5('0x18')](function(_0x59a6ef){if(_0x59a6ef){return _0x59a6ef['setTags'](_0x5a1f5f[_0x35e5('0x38')][_0x35e5('0x86')]||[]);}return null;})[_0x35e5('0x18')](respondWithResult(_0xf1e209,null))['catch'](handleError(_0xf1e209,null));};exports[_0x35e5('0x87')]=function(_0x1b53d9,_0x73ec7d){var _0x346860=[];_0x346860[_0x35e5('0x5f')](addAdditionalPhones(_0x1b53d9[_0x35e5('0x38')]));Promise[_0x35e5('0x88')](_0x346860)[_0x35e5('0x18')](function(){_0x346860=[];_0x346860[_0x35e5('0x5f')](deleteCmHopperPhones(_0x1b53d9[_0x35e5('0x38')]['id']));_0x346860[_0x35e5('0x5f')](addCmHopperPhones(_0x1b53d9[_0x35e5('0x38')]['id']));Promise[_0x35e5('0x88')](_0x346860)[_0x35e5('0x18')](function(){return[0x1];})['then'](respondWithResult(_0x73ec7d,null));});};function addAdditionalPhones(_0x513e9a){var _0x282309;return new Promise(function(_0x2c351e){return db[_0x35e5('0x89')]['destroy']({'where':{'CmContactId':_0x513e9a['id']}})[_0x35e5('0x18')](function(){db[_0x35e5('0x8a')][_0x35e5('0x22')]({'raw':!![],'attributes':['id','OrderBy']})['then'](function(_0x183c5e){var _0x2e5827=[];for(var _0x5de7af=0x0;_0x5de7af<_0x513e9a[_0x35e5('0x8b')][_0x35e5('0x2e')];_0x5de7af++){var _0x4660f6=_0x513e9a['item_types']?_[_0x35e5('0x56')](_0x513e9a[_0x35e5('0x8c')][_0x5de7af])?'':_0x513e9a[_0x35e5('0x8c')][_0x5de7af]:_0x513e9a[_0x35e5('0x8b')][_0x5de7af]['ItemTypeId']?_0x513e9a['items'][_0x5de7af][_0x35e5('0x8d')]:'';var _0x2067f3=_[_0x35e5('0x56')](_0x513e9a[_0x35e5('0x8b')][_0x5de7af][_0x35e5('0x8e')])?'':_0x513e9a[_0x35e5('0x8b')][_0x5de7af][_0x35e5('0x8e')];var _0x33a593=_0x4660f6+':'+_0x513e9a[_0x35e5('0x8b')][_0x5de7af][_0x35e5('0x77')]+'§'+_0x2067f3;if(_[_0x35e5('0x56')](_0x282309))_0x282309=_0x33a593;else _0x282309+=';'+_0x33a593;var _0x6b8403=null;var _0x19844e=null;if(_0x513e9a[_0x35e5('0x8c')]){if(!_[_0x35e5('0x56')](_0x513e9a[_0x35e5('0x8c')][_0x5de7af])){_0x19844e=_[_0x35e5('0x27')](_0x183c5e,function(_0xeda858){return _0xeda858['id']===_0x513e9a[_0x35e5('0x8c')][_0x5de7af];});if(!_['isNil'](_0x19844e)){_0x6b8403=_0x19844e[_0x35e5('0x8f')];}}}else{if(!_['isNil'](_0x513e9a[_0x35e5('0x8b')][_0x5de7af])){_0x19844e=_[_0x35e5('0x27')](_0x183c5e,function(_0xd6cde){return _0xd6cde['id']===_0x513e9a['items'][_0x5de7af][_0x35e5('0x8d')];});if(!_[_0x35e5('0x56')](_0x19844e)){_0x6b8403=_0x5de7af;}}}if(_[_0x35e5('0x56')](_0x6b8403)){_0x6b8403=0x64;}_0x2e5827[_0x35e5('0x5f')](addAdditionalPhone(_0x513e9a['id'],_0x513e9a['items'][_0x5de7af]['phone'],_0x513e9a['item_types']?_[_0x35e5('0x56')](_0x513e9a['item_types'][_0x5de7af])?null:_0x513e9a[_0x35e5('0x8c')][_0x5de7af]:_0x513e9a[_0x35e5('0x8b')][_0x5de7af][_0x35e5('0x8d')]?_0x513e9a['items'][_0x5de7af][_0x35e5('0x8d')]:null,_0x6b8403,_0x2067f3));}Promise[_0x35e5('0x88')](_0x2e5827)[_0x35e5('0x18')](function(){db[_0x35e5('0x26')][_0x35e5('0x44')]({'AdditionalPhones':_0x282309},{'where':{'id':_0x513e9a['id']}})['then'](function(){_0x2c351e(0x1);});});});});});}function addAdditionalPhone(_0x335492,_0x5e8554,_0x41ec23,_0x255d02,_0x531146){return db['CmContactHasItem'][_0x35e5('0x27')]({'where':{'CmContactId':_0x335492,'item':_0x5e8554}})[_0x35e5('0x18')](function(_0x1f00d0){if(_0x1f00d0)logger[_0x35e5('0x33')](_0x35e5('0x90'),_0x1f00d0);else{db['CmContactHasItem'][_0x35e5('0x41')]({'CmContactId':_0x335492,'item':_0x5e8554,'ItemTypeId':_0x41ec23,'OrderBy':_0x255d02,'ItemClass':_0x35e5('0x91'),'description':_0x531146});}});}function deleteCmHopperPhones(_0x58f627){return new Promise(function(_0x28984c){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x58f627}})[_0x35e5('0x18')](function(_0x461e9a){db[_0x35e5('0x92')][_0x35e5('0x17')]({'where':{'CmHopperId':{'$in':_[_0x35e5('0x82')](_0x461e9a,'id')}}});})[_0x35e5('0x18')](function(){_0x28984c(0x1);});});}function addCmHopperPhones(_0x5a73c2){return new Promise(function(_0x4d2acc){return db[_0x35e5('0x3e')][_0x35e5('0x22')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5a73c2}})[_0x35e5('0x18')](function(_0x336017){var _0x10c462=[];_[_0x35e5('0x82')](_0x336017,function(_0x39d17d){_0x10c462[_0x35e5('0x5f')](createCmHopperPhone(_0x5a73c2,_0x39d17d['id']));});Promise[_0x35e5('0x88')](_0x10c462)['then'](function(){_0x4d2acc(0x1);});});});}function createCmHopperPhone(_0x42955b,_0x28b8ed){return new Promise(function(_0x530046){db['CmContactHasItem']['findAll']({'raw':!![],'attributes':[_0x35e5('0x93'),_0x35e5('0x8f')],'where':{'CmContactId':_0x42955b,'ItemClass':_0x35e5('0x91')},'include':[{'model':db[_0x35e5('0x8a')],'attributes':['OrderBy'],'as':_0x35e5('0x69')}],'order':[_0x35e5('0x8f'),db[_0x35e5('0x6a')][_0x35e5('0x6b')](_0x35e5('0x94'))]})[_0x35e5('0x18')](function(_0x4801ff){var _0x411ed1=0x1;var _0x32c1af=_[_0x35e5('0x82')](_0x4801ff,function(_0x43e91b){_0x43e91b[_0x35e5('0x95')]=_0x28b8ed;_0x43e91b[_0x35e5('0x77')]=_0x43e91b['item'];_0x43e91b[_0x35e5('0x8f')]=_0x411ed1;delete _0x43e91b['ItemType.OrderBy'];_0x411ed1=_0x411ed1+0x1;return _0x43e91b;});return db[_0x35e5('0x92')][_0x35e5('0x5b')](_0x32c1af,{});})[_0x35e5('0x18')](function(){_0x530046(0x1);});});}function insertAdditionalPhones(_0x5ee84a,_0x2b4b0c){return new Promise(function(_0x2ab83e){var _0x35eff0=[];for(var _0x244da9=0x0;_0x244da9<_0x2b4b0c['length'];_0x244da9++){var _0x480dc7=_0x2b4b0c[_0x244da9];_0x35eff0[_0x35e5('0x5f')](parseContactItemType(_0x480dc7));}Promise[_0x35e5('0x88')](_0x35eff0)[_0x35e5('0x18')](function(){var _0xc26737={'id':_0x5ee84a['id'],'items':_0x2b4b0c};return addAdditionalPhones(_0xc26737)['then'](function(){return addCmHopperPhones(_0x5ee84a['id']);});})[_0x35e5('0x18')](function(){_0x2ab83e(_0x5ee84a);});});}function parseContactItemType(_0x430847){return new Promise(function(_0x39aa04){if(_0x430847[_0x35e5('0x83')](_0x35e5('0x8d'))){_0x39aa04(_0x430847);}else{return db[_0x35e5('0x8a')][_0x35e5('0x27')]({'where':{'name':_0x430847[_0x35e5('0x69')]}})[_0x35e5('0x18')](function(_0x3eb08f){if(_['isNil'](_0x3eb08f))_0x430847[_0x35e5('0x8d')]=null;else _0x430847[_0x35e5('0x8d')]=_0x3eb08f['id'];_0x39aa04(_0x430847);});}});}exports['getAdditionalPhones']=function(_0xa6852f,_0x3e5de0){return db[_0x35e5('0x89')]['findAll']({'raw':!![],'where':{'CmContactId':_0xa6852f[_0x35e5('0x28')]['id'],'ItemClass':_0x35e5('0x91')},'include':[{'model':db[_0x35e5('0x8a')],'as':_0x35e5('0x69')}],'order':[['OrderBy'],[db[_0x35e5('0x6a')][_0x35e5('0x6b')](_0x35e5('0x94'))]]})['then'](function(_0x2f1728){return _0x2f1728;})[_0x35e5('0x18')](respondWithResult(_0x3e5de0,null))[_0x35e5('0x25')](handleError(_0x3e5de0,null));};exports[_0x35e5('0x96')]=function(_0x597500,_0x521e5f){return db[_0x35e5('0x89')][_0x35e5('0x22')]({'raw':!![],'where':{'CmContactId':_0x597500['body'][_0x35e5('0x97')]}})[_0x35e5('0x18')](function(_0x53d5d3){var _0x14dcb1=_[_0x35e5('0x82')](_0x53d5d3,function(_0x2887f6){_0x2887f6[_0x35e5('0x98')]=_0x597500['body'][_0x35e5('0x99')];return _0x2887f6;});return db[_0x35e5('0x89')]['bulkCreate'](_0x14dcb1,{});})[_0x35e5('0x18')](function(){return addCmHopperPhones(_0x597500['body'][_0x35e5('0x99')]);})[_0x35e5('0x18')](function(){return['ok'];})[_0x35e5('0x18')](respondWithResult(_0x521e5f,null))[_0x35e5('0x25')](handleError(_0x521e5f,null));};exports[_0x35e5('0x9a')]=function(_0x46b5df,_0x1f9b90){var _0x3f6935=[];_0x3f6935['push'](createCmHopperPhone(_0x46b5df[_0x35e5('0x38')]['id'],_0x46b5df[_0x35e5('0x38')]['hopperId']));Promise[_0x35e5('0x88')](_0x3f6935)[_0x35e5('0x18')](function(){return[0x1];})[_0x35e5('0x18')](respondWithResult(_0x1f9b90,null));};exports[_0x35e5('0x9b')]=function(_0x145099,_0x10e1e5){var _0x6d2de3={'raw':![],'where':{}};var _0x34760={};var _0x27d55b={'count':0x0,'rows':[]};return db['CmContact'][_0x35e5('0x79')]({'where':{'id':_0x145099[_0x35e5('0x28')]['id']}})[_0x35e5('0x18')](handleEntityNotFound(_0x10e1e5,null))['then'](function(_0x50688f){if(_0x50688f){_0x34760[_0x35e5('0x7a')]=_['keys'](db['CmHopper']['rawAttributes']);_0x34760[_0x35e5('0x23')]=_['keys'](_0x145099[_0x35e5('0x23')]);_0x34760[_0x35e5('0x7b')]=_[_0x35e5('0x7c')](_0x34760[_0x35e5('0x7a')],_0x34760[_0x35e5('0x23')]);_0x6d2de3[_0x35e5('0x7d')]=_[_0x35e5('0x7c')](_0x34760[_0x35e5('0x7a')],qs[_0x35e5('0x7e')](_0x145099['query'][_0x35e5('0x7e')]));_0x6d2de3[_0x35e5('0x7d')]=_0x6d2de3[_0x35e5('0x7d')][_0x35e5('0x2e')]?_0x6d2de3[_0x35e5('0x7d')]:_0x34760[_0x35e5('0x7a')];if(!_0x145099[_0x35e5('0x23')][_0x35e5('0x83')](_0x35e5('0x84'))){_0x6d2de3['limit']=qs['limit'](_0x145099[_0x35e5('0x23')][_0x35e5('0x13')]);_0x6d2de3[_0x35e5('0x14')]=qs['offset'](_0x145099[_0x35e5('0x23')][_0x35e5('0x14')]);}_0x6d2de3[_0x35e5('0x9c')]=qs[_0x35e5('0x7f')](_0x145099[_0x35e5('0x23')][_0x35e5('0x7f')]);_0x6d2de3[_0x35e5('0x5e')]=qs['filters'](_[_0x35e5('0x80')](_0x145099[_0x35e5('0x23')],_0x34760[_0x35e5('0x7b')]));_0x6d2de3[_0x35e5('0x5e')][_0x35e5('0x9d')]=_0x50688f['id'];if(_0x145099[_0x35e5('0x23')][_0x35e5('0x81')]){_0x6d2de3['where']=_[_0x35e5('0x37')](_0x6d2de3[_0x35e5('0x5e')],{'$or':_['map'](_0x6d2de3[_0x35e5('0x7d')],function(_0x26efde){var _0x3d1f8d={};_0x3d1f8d[_0x26efde]={'$like':'%'+_0x145099[_0x35e5('0x23')][_0x35e5('0x81')]+'%'};return _0x3d1f8d;})});}_0x6d2de3=_[_0x35e5('0x37')]({},_0x6d2de3,_0x145099[_0x35e5('0x9e')]);return db[_0x35e5('0x3e')]['count']({'where':_0x6d2de3[_0x35e5('0x5e')]})['then'](function(_0x4505e3){_0x27d55b[_0x35e5('0x9f')]=_0x4505e3;if(_0x145099[_0x35e5('0x23')][_0x35e5('0xa0')]){_0x6d2de3[_0x35e5('0xa1')]=[{'all':!![]}];}return db[_0x35e5('0x3e')][_0x35e5('0x22')](_0x6d2de3);})[_0x35e5('0x18')](function(_0xda9942){_0x27d55b[_0x35e5('0xa2')]=_0xda9942;return _0x27d55b;});}})[_0x35e5('0x18')](respondWithFilteredResult(_0x10e1e5,_0x6d2de3))[_0x35e5('0x25')](handleError(_0x10e1e5,null));};exports[_0x35e5('0xa3')]=function(_0x572a75,_0xcacd93){var _0x5add9f={'raw':!![],'where':{}};var _0x1198c={};var _0x34cdb6={'count':0x0,'rows':[]};return db[_0x35e5('0x26')][_0x35e5('0x79')]({'where':{'id':_0x572a75['params']['id']}})[_0x35e5('0x18')](handleEntityNotFound(_0xcacd93,null))[_0x35e5('0x18')](function(_0x59b712){if(_0x59b712){_0x1198c[_0x35e5('0x7a')]=_['keys'](db[_0x35e5('0x4f')][_0x35e5('0xa4')]);_0x1198c[_0x35e5('0x23')]=_[_0x35e5('0x35')](_0x572a75['query']);_0x1198c[_0x35e5('0x7b')]=_[_0x35e5('0x7c')](_0x1198c[_0x35e5('0x7a')],_0x1198c[_0x35e5('0x23')]);_0x5add9f['attributes']=_['intersection'](_0x1198c[_0x35e5('0x7a')],qs[_0x35e5('0x7e')](_0x572a75[_0x35e5('0x23')]['fields']));_0x5add9f[_0x35e5('0x7d')]=_0x5add9f[_0x35e5('0x7d')][_0x35e5('0x2e')]?_0x5add9f[_0x35e5('0x7d')]:_0x1198c[_0x35e5('0x7a')];if(!_0x572a75[_0x35e5('0x23')][_0x35e5('0x83')](_0x35e5('0x84'))){_0x5add9f['limit']=qs[_0x35e5('0x13')](_0x572a75['query'][_0x35e5('0x13')]);_0x5add9f[_0x35e5('0x14')]=qs['offset'](_0x572a75['query'][_0x35e5('0x14')]);}_0x5add9f[_0x35e5('0x9c')]=qs['sort'](_0x572a75[_0x35e5('0x23')][_0x35e5('0x7f')]);_0x5add9f[_0x35e5('0x5e')]=qs[_0x35e5('0x7b')](_[_0x35e5('0x80')](_0x572a75[_0x35e5('0x23')],_0x1198c[_0x35e5('0x7b')]));_0x5add9f[_0x35e5('0x5e')][_0x35e5('0x9d')]=_0x59b712['id'];if(_0x572a75[_0x35e5('0x23')][_0x35e5('0x81')]){_0x5add9f[_0x35e5('0x5e')]=_[_0x35e5('0x37')](_0x5add9f['where'],{'$or':_[_0x35e5('0x82')](_0x5add9f['attributes'],function(_0x1e9182){var _0x5140f3={};_0x5140f3[_0x1e9182]={'$like':'%'+_0x572a75[_0x35e5('0x23')][_0x35e5('0x81')]+'%'};return _0x5140f3;})});}_0x5add9f=_['merge']({},_0x5add9f,_0x572a75[_0x35e5('0x9e')]);return db['CmHopperHistory'][_0x35e5('0x9f')]({'where':_0x5add9f['where']})[_0x35e5('0x18')](function(_0x4a6e7c){_0x34cdb6[_0x35e5('0x9f')]=_0x4a6e7c;if(_0x572a75[_0x35e5('0x23')][_0x35e5('0xa0')]){_0x5add9f[_0x35e5('0xa1')]=[{'all':!![]}];}return db[_0x35e5('0x4f')][_0x35e5('0x22')](_0x5add9f);})[_0x35e5('0x18')](function(_0x210d59){_0x34cdb6['rows']=_0x210d59;return _0x34cdb6;});}})[_0x35e5('0x18')](respondWithFilteredResult(_0xcacd93,_0x5add9f))[_0x35e5('0x25')](handleError(_0xcacd93,null));};exports[_0x35e5('0xa5')]=function(_0x2ab1ac,_0x5ef4b8){var _0x8b8dbc={'raw':!![],'where':{}};var _0x1cd377={};var _0x43aa88={'count':0x0,'rows':[]};return db[_0x35e5('0x26')][_0x35e5('0x79')]({'where':{'id':_0x2ab1ac[_0x35e5('0x28')]['id']}})[_0x35e5('0x18')](handleEntityNotFound(_0x5ef4b8,null))[_0x35e5('0x18')](function(_0x50d19d){if(_0x50d19d){_0x1cd377['model']=_['keys'](db[_0x35e5('0x4e')][_0x35e5('0xa4')]);_0x1cd377[_0x35e5('0x23')]=_[_0x35e5('0x35')](_0x2ab1ac[_0x35e5('0x23')]);_0x1cd377[_0x35e5('0x7b')]=_[_0x35e5('0x7c')](_0x1cd377['model'],_0x1cd377[_0x35e5('0x23')]);_0x8b8dbc['attributes']=_[_0x35e5('0x7c')](_0x1cd377[_0x35e5('0x7a')],qs[_0x35e5('0x7e')](_0x2ab1ac[_0x35e5('0x23')][_0x35e5('0x7e')]));_0x8b8dbc['attributes']=_0x8b8dbc[_0x35e5('0x7d')][_0x35e5('0x2e')]?_0x8b8dbc[_0x35e5('0x7d')]:_0x1cd377[_0x35e5('0x7a')];if(!_0x2ab1ac[_0x35e5('0x23')]['hasOwnProperty'](_0x35e5('0x84'))){_0x8b8dbc[_0x35e5('0x13')]=qs[_0x35e5('0x13')](_0x2ab1ac[_0x35e5('0x23')][_0x35e5('0x13')]);_0x8b8dbc[_0x35e5('0x14')]=qs[_0x35e5('0x14')](_0x2ab1ac[_0x35e5('0x23')][_0x35e5('0x14')]);}_0x8b8dbc[_0x35e5('0x9c')]=qs[_0x35e5('0x7f')](_0x2ab1ac['query'][_0x35e5('0x7f')]);_0x8b8dbc[_0x35e5('0x5e')]=qs['filters'](_[_0x35e5('0x80')](_0x2ab1ac[_0x35e5('0x23')],_0x1cd377[_0x35e5('0x7b')]));_0x8b8dbc[_0x35e5('0x5e')][_0x35e5('0x9d')]=_0x50d19d['id'];if(_0x2ab1ac[_0x35e5('0x23')]['filter']){_0x8b8dbc['where']=_['merge'](_0x8b8dbc[_0x35e5('0x5e')],{'$or':_[_0x35e5('0x82')](_0x8b8dbc[_0x35e5('0x7d')],function(_0x3f61d2){var _0x44846={};_0x44846[_0x3f61d2]={'$like':'%'+_0x2ab1ac[_0x35e5('0x23')][_0x35e5('0x81')]+'%'};return _0x44846;})});}_0x8b8dbc=_[_0x35e5('0x37')]({},_0x8b8dbc,_0x2ab1ac[_0x35e5('0x9e')]);return db[_0x35e5('0x4e')]['count']({'where':_0x8b8dbc[_0x35e5('0x5e')]})[_0x35e5('0x18')](function(_0x200300){_0x43aa88['count']=_0x200300;if(_0x2ab1ac[_0x35e5('0x23')][_0x35e5('0xa0')]){_0x8b8dbc['include']=[{'all':!![]}];}return db[_0x35e5('0x4e')][_0x35e5('0x22')](_0x8b8dbc);})['then'](function(_0x24c4b5){_0x43aa88[_0x35e5('0xa2')]=_0x24c4b5;return _0x43aa88;});}})[_0x35e5('0x18')](respondWithFilteredResult(_0x5ef4b8,_0x8b8dbc))[_0x35e5('0x25')](handleError(_0x5ef4b8,null));};exports[_0x35e5('0xa6')]=function(_0x1945b2,_0x385184){var _0x69a7c9={'raw':!![],'where':{}};var _0x356cdb={};var _0x2066dd={'count':0x0,'rows':[]};return db[_0x35e5('0x26')][_0x35e5('0x79')]({'where':{'id':_0x1945b2[_0x35e5('0x28')]['id']}})[_0x35e5('0x18')](handleEntityNotFound(_0x385184,null))[_0x35e5('0x18')](function(_0x42b895){if(_0x42b895){_0x356cdb['model']=_[_0x35e5('0x35')](db[_0x35e5('0x53')][_0x35e5('0xa4')]);_0x356cdb['query']=_[_0x35e5('0x35')](_0x1945b2[_0x35e5('0x23')]);_0x356cdb[_0x35e5('0x7b')]=_[_0x35e5('0x7c')](_0x356cdb['model'],_0x356cdb['query']);_0x69a7c9[_0x35e5('0x7d')]=_[_0x35e5('0x7c')](_0x356cdb[_0x35e5('0x7a')],qs[_0x35e5('0x7e')](_0x1945b2['query']['fields']));_0x69a7c9['attributes']=_0x69a7c9[_0x35e5('0x7d')][_0x35e5('0x2e')]?_0x69a7c9[_0x35e5('0x7d')]:_0x356cdb[_0x35e5('0x7a')];if(!_0x1945b2['query'][_0x35e5('0x83')](_0x35e5('0x84'))){_0x69a7c9[_0x35e5('0x13')]=qs[_0x35e5('0x13')](_0x1945b2['query'][_0x35e5('0x13')]);_0x69a7c9[_0x35e5('0x14')]=qs['offset'](_0x1945b2[_0x35e5('0x23')][_0x35e5('0x14')]);}_0x69a7c9[_0x35e5('0x9c')]=qs[_0x35e5('0x7f')](_0x1945b2[_0x35e5('0x23')][_0x35e5('0x7f')]);_0x69a7c9['where']=qs[_0x35e5('0x7b')](_[_0x35e5('0x80')](_0x1945b2[_0x35e5('0x23')],_0x356cdb['filters']));_0x69a7c9[_0x35e5('0x5e')][_0x35e5('0x9d')]=_0x42b895['id'];if(_0x1945b2[_0x35e5('0x23')][_0x35e5('0x81')]){_0x69a7c9[_0x35e5('0x5e')]=_[_0x35e5('0x37')](_0x69a7c9['where'],{'$or':_[_0x35e5('0x82')](_0x69a7c9[_0x35e5('0x7d')],function(_0x553872){var _0x204259={};_0x204259[_0x553872]={'$like':'%'+_0x1945b2[_0x35e5('0x23')][_0x35e5('0x81')]+'%'};return _0x204259;})});}_0x69a7c9=_[_0x35e5('0x37')]({},_0x69a7c9,_0x1945b2['options']);return db[_0x35e5('0x53')]['count']({'where':_0x69a7c9['where']})['then'](function(_0x1b8bbf){_0x2066dd[_0x35e5('0x9f')]=_0x1b8bbf;if(_0x1945b2['query'][_0x35e5('0xa0')]){_0x69a7c9[_0x35e5('0xa1')]=[{'all':!![]}];}return db[_0x35e5('0x53')][_0x35e5('0x22')](_0x69a7c9);})['then'](function(_0x307bd1){_0x2066dd['rows']=_0x307bd1;return _0x2066dd;});}})[_0x35e5('0x18')](respondWithFilteredResult(_0x385184,_0x69a7c9))[_0x35e5('0x25')](handleError(_0x385184,null));};exports['uploadCsv']=function(_0x7ba7c7,_0x12bdcb){try{if(!_0x7ba7c7['body']['ListId']){throw new Error(_0x35e5('0xa7'));}if(!_0x7ba7c7[_0x35e5('0x38')][_0x35e5('0xa8')]){throw new Error(_0x35e5('0xa9'));}if(!_0x7ba7c7['body'][_0x35e5('0xaa')]){throw new Error(_0x35e5('0xab'));}if(!_0x7ba7c7[_0x35e5('0x38')][_0x35e5('0xac')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x35a8a3=_0x7ba7c7[_0x35e5('0x38')][_0x35e5('0xa8')]['split'](',');var _0x4f2bdf=_0x7ba7c7[_0x35e5('0x38')][_0x35e5('0xaa')][_0x35e5('0xad')](',');if(!_0x35a8a3[_0x35e5('0x2e')]||!_0x4f2bdf['length']||_0x35a8a3[_0x35e5('0x2e')]!==_0x4f2bdf[_0x35e5('0x2e')]){throw new Error(_0x35e5('0xae'));}_0x7ba7c7[_0x35e5('0x38')]['fields']=_[_0x35e5('0xaf')](_0x35a8a3,_0x4f2bdf);if(!_0x7ba7c7[_0x35e5('0x38')][_0x35e5('0x7e')][_0x35e5('0x77')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x7ba7c7['body'][_0x35e5('0x7e')][_0x35e5('0xb0')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x3aab3b=path[_0x35e5('0x3c')](config[_0x35e5('0xb1')],_0x35e5('0xb2'),_0x7ba7c7[_0x35e5('0xb3')][_0x35e5('0xb4')]);fs[_0x35e5('0xb5')](_0x3aab3b,parseInt('0777',0x8));var _0x221d6d=require(_0x35e5('0xb6'))['fork'](path[_0x35e5('0x3c')](__dirname,_0x35e5('0xb7')),[_0x3aab3b,_0x7ba7c7[_0x35e5('0x38')][_0x35e5('0xa8')],_0x7ba7c7[_0x35e5('0x38')][_0x35e5('0xaa')],_0x7ba7c7[_0x35e5('0x38')][_0x35e5('0x60')],_0x7ba7c7['body']['CompanyId'],_0x7ba7c7[_0x35e5('0x38')]['duplicates'],_0x7ba7c7[_0x35e5('0x38')][_0x35e5('0xac')]]);return _0x12bdcb[_0x35e5('0x15')](0xc8)['json']({'message':_0x35e5('0xb8'),'pid':_0x221d6d[_0x35e5('0xb9')]});}catch(_0x2a190e){return _0x12bdcb[_0x35e5('0x15')](0x1f4)[_0x35e5('0x1e')](_0x2a190e);}};exports[_0x35e5('0xba')]=function(_0x41a587,_0x48fcba){var _0xb23e37=fs[_0x35e5('0xbb')](_0x41a587[_0x35e5('0xb3')][_0x35e5('0x3')]);Papa[_0x35e5('0xbc')](_0xb23e37,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x2a94ae){return _0x48fcba[_0x35e5('0x15')](0xc8)[_0x35e5('0x11')]({'file':_0x41a587[_0x35e5('0xb3')],'fields':_0x2a94ae['meta']['fields']});}});};exports['import']=function(_0x64cc5d,_0x814f9d){return db['User'][_0x35e5('0x22')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x35e5('0x18')](function(_0x1e981a){var _0x1b180b=![];if(!_0x64cc5d['body'][_0x35e5('0x60')]){throw new Error(_0x35e5('0xa7'));}if(!_0x64cc5d[_0x35e5('0x38')][_0x35e5('0xbd')][_0x35e5('0x77')]){throw new Error(_0x35e5('0xbe'));}if(!_0x64cc5d[_0x35e5('0x38')]['binding'][_0x35e5('0xb0')]){throw new Error(_0x35e5('0xbf'));}if(!_0x64cc5d[_0x35e5('0x38')]['socket_timestamp']){throw new Error(_0x35e5('0xc0'));}var _0x807f7=require(_0x35e5('0xb6'))[_0x35e5('0xc1')](path['join'](__dirname,_0x35e5('0xc2')),[_0x64cc5d['params']['id'],JSON[_0x35e5('0xc3')](_0x64cc5d[_0x35e5('0x38')]),JSON['stringify'](_0x1e981a)]);_0x807f7['on']('message',function(){_0x1b180b=!![];return _0x814f9d[_0x35e5('0x15')](0xc8)[_0x35e5('0x11')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x807f7['pid']});});_0x807f7['on']('exit',function(_0x49a02f){if(_0x49a02f&&!_0x1b180b){return _0x814f9d[_0x35e5('0x15')](0x1f4)[_0x35e5('0x11')]({'message':_0x35e5('0xc4'),'pid':_0x807f7[_0x35e5('0xb9')]});}});})[_0x35e5('0x25')](handleError(_0x814f9d,null));};exports[_0x35e5('0xc5')]=function(_0x1f6daa,_0x35e3a9){return db[_0x35e5('0xc6')][_0x35e5('0x22')]({'raw':!![],'attributes':['id'],'where':{'role':_0x35e5('0xc7')}})[_0x35e5('0x18')](function(_0x3ed564){var _0x1f0678=![];if(!_0x1f6daa[_0x35e5('0x38')][_0x35e5('0x60')]){throw new Error(_0x35e5('0xa7'));}if(!_0x1f6daa['body'][_0x35e5('0xbd')][_0x35e5('0x77')]){throw new Error(_0x35e5('0xbe'));}if(!_0x1f6daa[_0x35e5('0x38')][_0x35e5('0xbd')]['firstName']){throw new Error(_0x35e5('0xbf'));}if(!_0x1f6daa[_0x35e5('0x38')][_0x35e5('0xac')]){throw new Error(_0x35e5('0xc0'));}var _0x36b8da=require(_0x35e5('0xb6'))['fork'](path[_0x35e5('0x3c')](__dirname,_0x35e5('0xc8')),[_0x1f6daa[_0x35e5('0x28')]['id'],JSON[_0x35e5('0xc3')](_0x1f6daa[_0x35e5('0x38')]),JSON[_0x35e5('0xc3')](_0x3ed564)]);_0x36b8da['on']('message',function(){_0x1f0678=!![];return _0x35e3a9[_0x35e5('0x15')](0xc8)['json']({'message':_0x35e5('0xc9'),'pid':_0x36b8da[_0x35e5('0xb9')]});});_0x36b8da['on'](_0x35e5('0xca'),function(_0x3bdeb2){if(_0x3bdeb2&&!_0x1f0678){return _0x35e3a9['status'](0x1f4)['json']({'message':_0x35e5('0xc4'),'pid':_0x36b8da[_0x35e5('0xb9')]});}});})['catch'](handleError(_0x35e3a9,null));};exports['getJourney']=function(_0x21bff1,_0x34a105){var _0x183bf2=['mail',_0x35e5('0xcb'),_0x35e5('0xcc'),_0x35e5('0xcd'),_0x35e5('0xce'),_0x35e5('0xcf'),_0x35e5('0xd0')];var _0x2e9847={'offset':0x0,'order':qs[_0x35e5('0x7f')]('-createdAt')},_0x7630={'count':0x0,'rows':[]};Promise['resolve']()[_0x35e5('0x18')](function(){if(_0x21bff1[_0x35e5('0x23')]['channel']){if(!_['includes'](_0x183bf2,_0x21bff1[_0x35e5('0x23')][_0x35e5('0xd1')][_0x35e5('0xd2')]())){throw new Error(_0x35e5('0xd3'));}_0x183bf2=[_0x21bff1[_0x35e5('0x23')][_0x35e5('0xd1')][_0x35e5('0xd2')]()];}if(_0x21bff1[_0x35e5('0x23')]['range']){try{var _0x336743=JSON['parse'](_0x21bff1[_0x35e5('0x23')][_0x35e5('0xd4')]);if(!moment(_0x336743[_0x35e5('0x39')])['isValid']()){throw new Error(_0x35e5('0xd5'));}if(!moment(_0x336743['to'])['isValid']()){throw new Error(_0x35e5('0xd6'));}}catch(_0x5aebef){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x21bff1[_0x35e5('0x23')][_0x35e5('0x83')](_0x35e5('0x84'))){_0x2e9847[_0x35e5('0x13')]=qs[_0x35e5('0x13')](_0x21bff1[_0x35e5('0x23')]['limit']||0xa);_0x2e9847['offset']=qs['offset'](_0x21bff1['query'][_0x35e5('0x14')]);}var _0x1660b0=_0x183bf2[_0x35e5('0x82')](function(_0x422a9d){if(_0x422a9d==='voice'){var _0x4dc47c={'attributes':['id',_0x35e5('0xd7'),_0x35e5('0x31'),'source',_0x35e5('0xd8'),_0x35e5('0xd9'),_0x35e5('0xda'),_0x35e5('0xdb'),_0x35e5('0xdc'),'note',_0x35e5('0xdd'),_0x35e5('0xde'),_0x35e5('0xdf'),'userThirdDisposition',_0x35e5('0xe0')],'where':{'ContactId':_0x21bff1[_0x35e5('0x28')]['id']},'include':[{'model':db[_0x35e5('0xc6')],'as':'User','attributes':['id',_0x35e5('0x1d'),'fullname',_0x35e5('0x30')]}],'order':[['createdAt',_0x35e5('0xe1')]]};if(_0x21bff1[_0x35e5('0x23')][_0x35e5('0xd4')]){_0x4dc47c[_0x35e5('0x5e')][_0x35e5('0xdd')]={'$gte':_0x336743[_0x35e5('0x39')],'$lte':_0x336743['to']};}return db[_0x35e5('0xe2')]['findAndCountAll'](_0x4dc47c)[_0x35e5('0x18')](function(_0x154e54){_0x7630[_0x35e5('0x9f')]+=_0x154e54[_0x35e5('0x9f')];return _[_0x35e5('0x82')](_0x154e54[_0x35e5('0xa2')],function(_0xbed055){var _0x105c59=_0xbed055['get']({'plain':!![]});_0x105c59[_0x35e5('0xd1')]=_0x422a9d;if(_0x105c59[_0x35e5('0xc6')]){_0x105c59[_0x35e5('0xc6')]={'id':_0x105c59[_0x35e5('0xc6')]['id'],'name':_0x105c59[_0x35e5('0xc6')][_0x35e5('0x1d')],'fullname':_0x105c59[_0x35e5('0xc6')][_0x35e5('0xe3')],'alias':_0x105c59['User'][_0x35e5('0x30')]};}return _0x105c59;});});}else{var _0x2ea3ef=_[_0x35e5('0xe4')](_0x422a9d)+(_0x422a9d==='chat'?_0x35e5('0xe5'):_0x35e5('0xe6'));var _0xc712cb={'attributes':['id',_0x35e5('0xe7'),_0x35e5('0xe8'),_0x35e5('0xdd'),_0x35e5('0xe9'),'disposition',_0x35e5('0xea'),_0x35e5('0xeb'),'UserId',_0x2ea3ef+'Id'],'where':{'ContactId':_0x21bff1[_0x35e5('0x28')]['id']},'include':[{'model':db[_0x2ea3ef],'as':_0x35e5('0xe6'),'attributes':['id','name','key']},{'model':db[_0x35e5('0xc6')],'as':_0x35e5('0xec'),'attributes':['id',_0x35e5('0x1d'),'fullname']},{'model':db[_0x35e5('0x65')],'as':_0x35e5('0x66'),'attributes':['id',_0x35e5('0x1d'),'color'],'through':{'attributes':[]}}],'order':[[_0x35e5('0xdd'),_0x35e5('0xe1')]]};if(_0x21bff1[_0x35e5('0x23')][_0x35e5('0xd4')]){_0xc712cb[_0x35e5('0x5e')][_0x35e5('0xdd')]={'$gte':_0x336743[_0x35e5('0x39')],'$lte':_0x336743['to']};}switch(_0x422a9d){case'chat':_0xc712cb[_0x35e5('0x7d')]['push'](_0x35e5('0xed'),_0x35e5('0xee'),_0x35e5('0xef'),_0x35e5('0xf0'),'osName',_0x35e5('0xf1'),'ratingType','ratingValue',_0x35e5('0xf2'));break;case _0x35e5('0xf3'):_0xc712cb['attributes'][_0x35e5('0x5f')](_0x35e5('0xf4'),_0x35e5('0xf5'));break;case _0x35e5('0xcd'):_0xc712cb[_0x35e5('0x7d')][_0x35e5('0x5f')](_0x35e5('0xf6'),_0x35e5('0xf7'));break;}return db[_[_0x35e5('0xe4')](_0x422a9d)+_0x35e5('0xf8')][_0x35e5('0xf9')](_0xc712cb)[_0x35e5('0x18')](function(_0x8f0cf2){_0x7630[_0x35e5('0x9f')]+=_0x8f0cf2[_0x35e5('0x9f')];return _[_0x35e5('0x82')](_0x8f0cf2[_0x35e5('0xa2')],function(_0x5e5c1b){var _0x695e36=_0x5e5c1b['get']({'plain':!![]});_0x695e36[_0x35e5('0xd1')]=_0x422a9d;if(_0x695e36[_0x35e5('0xec')]){_0x695e36[_0x35e5('0xec')]={'id':_0x695e36[_0x35e5('0xec')]['id'],'name':_0x695e36[_0x35e5('0xec')][_0x35e5('0x1d')],'fullname':_0x695e36[_0x35e5('0xec')][_0x35e5('0xe3')]};}return _0x695e36;});});}});return Promise[_0x35e5('0x88')](_0x1660b0);})['then'](function(_0x226fc7){return _(_0x226fc7)[_0x35e5('0xfa')]()[_0x35e5('0xfb')](_0x35e5('0xdd'))[_0x35e5('0xfc')]()[_0x35e5('0xfd')]();})[_0x35e5('0x18')](function(_0x45600e){_0x7630[_0x35e5('0xa2')]=_0x2e9847['limit']?_0x45600e[_0x35e5('0xfe')](_0x2e9847[_0x35e5('0x14')],_0x2e9847['offset']+_0x2e9847['limit']):_0x45600e;return _0x7630;})['then'](respondWithFilteredResult(_0x34a105,_0x2e9847))['catch'](handleError(_0x34a105,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 1e93be6..ee64cd0 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9236=['events','CmContact','save','update','remove','emit','hasOwnProperty'];(function(_0x114e7b,_0x5de855){var _0x43fc32=function(_0xc4d3b6){while(--_0xc4d3b6){_0x114e7b['push'](_0x114e7b['shift']());}};_0x43fc32(++_0x5de855);}(_0x9236,0x126));var _0x6923=function(_0x8ca2d4,_0x3ed67c){_0x8ca2d4=_0x8ca2d4-0x0;var _0x158585=_0x9236[_0x8ca2d4];return _0x158585;};'use strict';var EventEmitter=require(_0x6923('0x0'));var CmContact=require('../../mysqldb')['db'][_0x6923('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6923('0x2'),'afterUpdate':_0x6923('0x3'),'afterDestroy':_0x6923('0x4')};function emitEvent(_0xdb808d){return function(_0x426f8e,_0x329613,_0x109d63){CmContactEvents[_0x6923('0x5')](_0xdb808d+':'+_0x426f8e['id'],_0x426f8e);CmContactEvents[_0x6923('0x5')](_0xdb808d,_0x426f8e);_0x109d63(null);};}for(var e in events){if(events[_0x6923('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x38b2=['../../mysqldb','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x38b2,0xff));var _0x238b=function(_0x10bdd9,_0x2a13a5){_0x10bdd9=_0x10bdd9-0x0;var _0x5c4829=_0x38b2[_0x10bdd9];return _0x5c4829;};'use strict';var EventEmitter=require(_0x238b('0x0'));var CmContact=require(_0x238b('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x238b('0x2')](0x0);var events={'afterCreate':_0x238b('0x3'),'afterUpdate':_0x238b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x12aff7){return function(_0x4f01f9,_0x622ec9,_0x1982c9){CmContactEvents['emit'](_0x12aff7+':'+_0x4f01f9['id'],_0x4f01f9);CmContactEvents[_0x238b('0x5')](_0x12aff7,_0x4f01f9);_0x1982c9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x238b('0x6')](e,emitEvent(event));}}module[_0x238b('0x7')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 189c393..2ab1d6d 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfce5=['../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','fti_cm_contacts','lastName','phone','email','utf8mb4','utf8mb4_unicode_ci','error','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','findOne','then','isNil','timezones','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','afterCreate','Campaign','utcOffset','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','Lists','length','get','dialCheckDuplicateType','onlyIfOpen','VoiceQueue','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','always','message','List\x20not\x20found','models','destroy','ContactId','VoiceQueueId','all','[CmContact][afterDestroy][Succesfull]','util','moment','path','rimraf'];(function(_0x4dd768,_0xf94a07){var _0x347432=function(_0x2190c7){while(--_0x2190c7){_0x4dd768['push'](_0x4dd768['shift']());}};_0x347432(++_0xf94a07);}(_0xfce5,0x108));var _0x5fce=function(_0x5c3993,_0x5b9b11){_0x5c3993=_0x5c3993-0x0;var _0x5144ab=_0xfce5[_0x5c3993];return _0x5144ab;};'use strict';var _=require('lodash');var util=require(_0x5fce('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5fce('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5fce('0x2'));var rimraf=require(_0x5fce('0x3'));var config=require(_0x5fce('0x4'));var shared=require('../../config/environment/shared');var attributes=require(_0x5fce('0x5'));module[_0x5fce('0x6')]=function(_0x475a74,_0x3dadc5){return _0x475a74[_0x5fce('0x7')](_0x5fce('0x8'),attributes,{'tableName':_0x5fce('0x9'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0x5fce('0xa'),'fields':['firstName',_0x5fce('0xb'),_0x5fce('0xc'),'mobile','fax',_0x5fce('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x5fce('0xe'),'collate':_0x5fce('0xf'),'hooks':{'afterCreate':function(_0x4e2c1c,_0x156ca7,_0x288251){var _0x53e4d5=_0x475a74['models'];var _0x51541a=_0x4e2c1c['get']({'plain':!![]});function _0x3a7034(){return function(_0x356ad6){logger[_0x5fce('0x10')](_0x5fce('0x11'),'afterCreate',util[_0x5fce('0x12')](_0x356ad6,{'showHidden':![],'depth':null}));};}function _0x2ce068(_0x59d292,_0x333a56){var _0x5d9d53=_0x333a56[_0x5fce('0x13')]?_0x333a56[_0x5fce('0x13')]:moment()[_0x5fce('0x14')](_0x5fce('0x15'));return new BPromise(function(_0xa35af8,_0x5d04b9){if(_['isNil'](_0x333a56[_0x5fce('0x16')])){_0xa35af8({'ret':_0x5d9d53});}else{_0x53e4d5['VoiceQueue'][_0x5fce('0x17')]({'where':{'id':_0x59d292['id']}})[_0x5fce('0x18')](function(_0x41df41){if(!_[_0x5fce('0x19')](_0x41df41)){var _0x567e56=_0x41df41[_0x5fce('0x16')];if(!_[_0x5fce('0x19')](_0x567e56)){var _0x2aa605=shared[_0x5fce('0x1a')];var _0xda0ffd=_0x2aa605[_0x567e56];var _0x561247=_0x2aa605[_0x333a56[_0x5fce('0x16')]];if(!_[_0x5fce('0x19')](_0xda0ffd)&&!_[_0x5fce('0x19')](_0x561247)){var _0xb70543=_0xda0ffd['utcOffset']-_0x561247['utcOffset'];_0x5d9d53=_0x333a56[_0x5fce('0x13')]?_0x333a56[_0x5fce('0x13')]:moment();var _0x55074d=moment(_0x5d9d53)[_0x5fce('0x1b')](_0xb70543,_0x5fce('0x1c'));_0xa35af8({'ret':_0x55074d[_0x5fce('0x14')](_0x5fce('0x15'))});}else _0xa35af8({'ret':_0x5d9d53});}else _0xa35af8({'ret':_0x5d9d53});}else{_0xa35af8({'ret':_0x5d9d53});}});}});return 0xa;}var _0x16908a=function(_0x4f1580){return new BPromise(function(_0x37e9d1,_0x4faa9b){_0x2ce068(_0x4f1580,_0x51541a)[_0x5fce('0x18')](function(_0x5e3390){_0x51541a[_0x5fce('0x13')]=_0x5e3390[_0x5fce('0x1d')];_0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x17')]({'where':{'phone':_0x51541a[_0x5fce('0xc')],'VoiceQueueId':_0x4f1580['id']}})['then'](function(_0x2b96cc){if(!_[_0x5fce('0x19')](_0x2b96cc)){throw new Error(_0x5fce('0x1f')+_0x51541a['phone']+_0x5fce('0x20')+_0x4f1580['id']);}return _0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x21')]({'phone':_0x51541a[_0x5fce('0xc')],'ContactId':_0x51541a['id'],'ListId':_0x51541a[_0x5fce('0x22')],'priority':_0x51541a['priority']?_0x51541a[_0x5fce('0x23')]:0x2,'scheduledat':_0x51541a['scheduledat']?_0x51541a[_0x5fce('0x13')]:moment()[_0x5fce('0x14')](_0x5fce('0x15')),'callback':_0x51541a[_0x5fce('0x24')]?!![]:![],'callbackuniqueid':_0x51541a['callbackUniqueid']?_0x51541a[_0x5fce('0x24')]:undefined,'callbackat':_0x51541a['callbackUniqueid']?moment()[_0x5fce('0x14')](_0x5fce('0x15')):undefined,'VoiceQueueId':_0x4f1580['id']});})[_0x5fce('0x25')](function(_0x2790ca){_0x4faa9b(_0x2790ca);});});});};var _0x441454=function(_0x227e80){return new BPromise(function(_0x4a54c3,_0x1700af){_0x2ce068(_0x227e80,_0x51541a)[_0x5fce('0x18')](function(_0xee9469){_0x51541a[_0x5fce('0x13')]=_0xee9469[_0x5fce('0x1d')];_0x53e4d5[_0x5fce('0x1e')]['findOne']({'where':{'phone':_0x51541a['phone'],'VoiceQueueId':_0x227e80['id']}})[_0x5fce('0x18')](function(_0x23b126){if(!_[_0x5fce('0x19')](_0x23b126)){throw new Error(_0x5fce('0x1f')+_0x51541a['phone']+_0x5fce('0x26')+_0x227e80['id']);}return _0x53e4d5['CmHopperFinal'][_0x5fce('0x17')]({'where':{'calleridnum':_0x51541a[_0x5fce('0xc')],'VoiceQueueId':_0x227e80['id']}});})[_0x5fce('0x18')](function(_0x1708fd){if(!_['isNil'](_0x1708fd)){throw new Error(_0x5fce('0x27')+_0x51541a[_0x5fce('0xc')]+_0x5fce('0x28')+_0x227e80['id']);}return _0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x21')]({'phone':_0x51541a['phone'],'ContactId':_0x51541a['id'],'ListId':_0x51541a[_0x5fce('0x22')],'priority':_0x51541a[_0x5fce('0x23')]?_0x51541a[_0x5fce('0x23')]:0x2,'scheduledat':_0x51541a[_0x5fce('0x13')]?_0x51541a[_0x5fce('0x13')]:moment()[_0x5fce('0x14')](_0x5fce('0x15')),'callback':_0x51541a['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x51541a[_0x5fce('0x24')]?_0x51541a['callbackUniqueid']:undefined,'callbackat':_0x51541a[_0x5fce('0x24')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x227e80['id']});})[_0x5fce('0x25')](function(_0x400032){_0x1700af(_0x400032);});});});};function _0x276e9e(){return function(_0x5e8ddb){logger[_0x5fce('0x10')](_0x5fce('0x11'),_0x5fce('0x29'),util[_0x5fce('0x12')](_0x5e8ddb,{'showHidden':![],'depth':null}));};}function _0x20f101(_0x3273a3,_0x18c447){var _0x468a4f=_0x18c447['scheduledat']?_0x18c447['scheduledat']:moment()[_0x5fce('0x14')](_0x5fce('0x15'));return new BPromise(function(_0x1a09d8,_0x40c1d3){if(_['isNil'](_0x18c447[_0x5fce('0x16')])){_0x1a09d8({'ret':_0x468a4f});}else{_0x53e4d5[_0x5fce('0x2a')]['findOne']({'where':{'id':_0x3273a3['id']}})[_0x5fce('0x18')](function(_0x2d898c){if(!_[_0x5fce('0x19')](_0x2d898c)){var _0xc4612f=_0x2d898c[_0x5fce('0x16')];if(!_[_0x5fce('0x19')](_0xc4612f)){var _0x546699=shared[_0x5fce('0x1a')];var _0x5788c9=_0x546699[_0xc4612f];var _0xcd995=_0x546699[_0x18c447[_0x5fce('0x16')]];if(!_['isNil'](_0x5788c9)&&!_['isNil'](_0xcd995)){var _0xfebc16=_0x5788c9[_0x5fce('0x2b')]-_0xcd995[_0x5fce('0x2b')];_0x468a4f=_0x18c447[_0x5fce('0x13')]?_0x18c447[_0x5fce('0x13')]:moment();var _0x112b28=moment(_0x468a4f)['add'](_0xfebc16,'minutes');_0x1a09d8({'ret':_0x112b28[_0x5fce('0x14')](_0x5fce('0x15'))});}else _0x1a09d8({'ret':_0x468a4f});}else _0x1a09d8({'ret':_0x468a4f});}else{_0x1a09d8({'ret':_0x468a4f});}});}});return 0xa;}var _0x552b65=function(_0x5e8200){return new BPromise(function(_0x51e2c5,_0x2322c7){_0x20f101(_0x5e8200,_0x51541a)[_0x5fce('0x18')](function(_0x300b18){_0x51541a['scheduledat']=_0x300b18['ret'];_0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x17')]({'where':{'phone':_0x51541a['phone'],'CampaignId':_0x5e8200['id']}})[_0x5fce('0x18')](function(_0x3fd4ed){if(!_['isNil'](_0x3fd4ed)){throw new Error(_0x5fce('0x1f')+_0x51541a[_0x5fce('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x5e8200['id']);}return _0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x21')]({'phone':_0x51541a[_0x5fce('0xc')],'ContactId':_0x51541a['id'],'ListId':_0x51541a[_0x5fce('0x22')],'priority':_0x51541a[_0x5fce('0x23')]?_0x51541a[_0x5fce('0x23')]:0x2,'scheduledat':_0x51541a[_0x5fce('0x13')]?_0x51541a[_0x5fce('0x13')]:moment()[_0x5fce('0x14')](_0x5fce('0x15')),'callback':_0x51541a['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x51541a[_0x5fce('0x24')]?_0x51541a[_0x5fce('0x24')]:undefined,'callbackat':_0x51541a['callbackUniqueid']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x5e8200['id']});})[_0x5fce('0x25')](function(_0x2189fc){_0x2322c7(_0x2189fc);});});});};var _0x18d59e=function(_0x23afe0){return new BPromise(function(_0x22f7bf,_0x1ec5da){_0x20f101(_0x23afe0,_0x51541a)[_0x5fce('0x18')](function(_0x2ff77f){_0x51541a[_0x5fce('0x13')]=_0x2ff77f['ret'];_0x53e4d5[_0x5fce('0x1e')]['findOne']({'where':{'phone':_0x51541a[_0x5fce('0xc')],'CampaignId':_0x23afe0['id']}})[_0x5fce('0x18')](function(_0x550f0b){if(!_[_0x5fce('0x19')](_0x550f0b)){throw new Error(_0x5fce('0x1f')+_0x51541a[_0x5fce('0xc')]+_0x5fce('0x2c')+_0x23afe0['id']);}return _0x53e4d5['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x51541a[_0x5fce('0xc')],'CampaignId':_0x23afe0['id']}});})[_0x5fce('0x18')](function(_0x3076f6){if(!_['isNil'](_0x3076f6)){throw new Error(_0x5fce('0x27')+_0x51541a[_0x5fce('0xc')]+_0x5fce('0x2d')+_0x23afe0['id']);}return _0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x21')]({'phone':_0x51541a[_0x5fce('0xc')],'ContactId':_0x51541a['id'],'ListId':_0x51541a[_0x5fce('0x22')],'priority':_0x51541a['priority']?_0x51541a['priority']:0x2,'scheduledat':_0x51541a[_0x5fce('0x13')]?_0x51541a[_0x5fce('0x13')]:moment()[_0x5fce('0x14')](_0x5fce('0x15')),'callback':_0x51541a[_0x5fce('0x24')]?!![]:![],'callbackuniqueid':_0x51541a[_0x5fce('0x24')]?_0x51541a['callbackUniqueid']:undefined,'callbackat':_0x51541a[_0x5fce('0x24')]?moment()[_0x5fce('0x14')](_0x5fce('0x15')):undefined,'CampaignId':_0x23afe0['id']});})[_0x5fce('0x25')](function(_0x5b9ef6){_0x1ec5da(_0x5b9ef6);});});});};if(_0x51541a[_0x5fce('0x22')]){_0x53e4d5['VoiceQueue'][_0x5fce('0x2e')]({'where':{'type':_0x5fce('0x2f')},'attributes':['id','dialCheckDuplicateType',_0x5fce('0x16')],'include':[{'model':_0x53e4d5['CmList'],'as':_0x5fce('0x30'),'where':{'id':_0x51541a[_0x5fce('0x22')]}}]})[_0x5fce('0x18')](function(_0x7dc84e){if(_0x7dc84e){var _0x1cd408=[];for(var _0x3f131f=0x0,_0x85a8c4;_0x3f131f<_0x7dc84e[_0x5fce('0x31')];_0x3f131f+=0x1){_0x85a8c4=_0x7dc84e[_0x3f131f][_0x5fce('0x32')]({'plain':!![]});switch(_0x85a8c4[_0x5fce('0x33')]){case'always':_0x441454(_0x85a8c4)[_0x5fce('0x25')](_0x3a7034());break;case _0x5fce('0x34'):_0x16908a(_0x85a8c4)[_0x5fce('0x25')](_0x3a7034());break;default:_0x20f101(_0x85a8c4,_0x51541a)[_0x5fce('0x18')](function(_0x1fc7d8){_0x51541a[_0x5fce('0x13')]=_0x1fc7d8[_0x5fce('0x1d')];_0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x21')]({'phone':_0x51541a[_0x5fce('0xc')],'ContactId':_0x51541a['id'],'ListId':_0x51541a['ListId'],'scheduledat':_0x51541a[_0x5fce('0x13')]?_0x51541a[_0x5fce('0x13')]:moment()['format'](_0x5fce('0x15')),'priority':_0x51541a[_0x5fce('0x23')]?_0x51541a['priority']:0x2,'callback':_0x51541a[_0x5fce('0x24')]?!![]:![],'callbackuniqueid':_0x51541a['callbackUniqueid']?_0x51541a['callbackUniqueid']:undefined,'callbackat':_0x51541a['callbackUniqueid']?moment()[_0x5fce('0x14')](_0x5fce('0x15')):undefined,'VoiceQueueId':_0x85a8c4['id']})[_0x5fce('0x25')](_0x3a7034());});}}}})[_0x5fce('0x18')](function(){return _0x53e4d5[_0x5fce('0x35')][_0x5fce('0x2e')]({'where':{'type':_0x5fce('0x2f')},'attributes':['id'],'include':[{'model':_0x53e4d5[_0x5fce('0x36')],'as':_0x5fce('0x37'),'where':{'id':_0x51541a[_0x5fce('0x22')]}}]})[_0x5fce('0x18')](function(_0x551366){if(_0x551366){var _0x3b3a77=[];for(var _0x5e55e4=0x0,_0x541fd6;_0x5e55e4<_0x551366['length'];_0x5e55e4+=0x1){_0x541fd6=_0x551366[_0x5e55e4][_0x5fce('0x32')]({'plain':!![]});_0x53e4d5[_0x5fce('0x38')][_0x5fce('0x21')]({'phone':_0x51541a[_0x5fce('0xc')],'ContactId':_0x51541a['id'],'ListId':_0x51541a['ListId'],'VoiceQueueId':_0x541fd6['id']})['catch'](function(_0x39d70e){logger[_0x5fce('0x10')](_0x5fce('0x39'),_0x5fce('0x29'),_0x39d70e['message']);});}}});})[_0x5fce('0x18')](function(){return _0x53e4d5['Campaign'][_0x5fce('0x2e')]({'attributes':['id',_0x5fce('0x33'),'dialTimezone'],'include':[{'model':_0x53e4d5[_0x5fce('0x36')],'as':_0x5fce('0x30'),'where':{'id':_0x51541a[_0x5fce('0x22')]}}]})[_0x5fce('0x18')](function(_0x3c0816){if(_0x3c0816){var _0x22f4b8=[];for(var _0xc295c4=0x0,_0x2e0cbb;_0xc295c4<_0x3c0816[_0x5fce('0x31')];_0xc295c4+=0x1){_0x2e0cbb=_0x3c0816[_0xc295c4][_0x5fce('0x32')]({'plain':!![]});switch(_0x2e0cbb[_0x5fce('0x33')]){case _0x5fce('0x3a'):_0x18d59e(_0x2e0cbb)[_0x5fce('0x25')](_0x276e9e());break;case _0x5fce('0x34'):_0x552b65(_0x2e0cbb)['catch'](_0x276e9e());break;default:_0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x21')]({'phone':_0x51541a['phone'],'ContactId':_0x51541a['id'],'ListId':_0x51541a[_0x5fce('0x22')],'scheduledat':_0x51541a[_0x5fce('0x13')]?_0x51541a[_0x5fce('0x13')]:moment()[_0x5fce('0x14')](_0x5fce('0x15')),'priority':_0x51541a[_0x5fce('0x23')]?_0x51541a[_0x5fce('0x23')]:0x2,'callback':_0x51541a[_0x5fce('0x24')]?!![]:![],'callbackuniqueid':_0x51541a[_0x5fce('0x24')]?_0x51541a[_0x5fce('0x24')]:undefined,'callbackat':_0x51541a[_0x5fce('0x24')]?moment()[_0x5fce('0x14')](_0x5fce('0x15')):undefined,'CampaignId':_0x2e0cbb['id']})[_0x5fce('0x25')](_0x276e9e());}}}});})[_0x5fce('0x18')](function(){return _0x53e4d5[_0x5fce('0x2a')][_0x5fce('0x2e')]({'attributes':['id'],'include':[{'model':_0x53e4d5['CmList'],'as':_0x5fce('0x37'),'where':{'id':_0x51541a[_0x5fce('0x22')]}}]})[_0x5fce('0x18')](function(_0x30082c){if(_0x30082c){var _0x506ea2=[];for(var _0xc33420=0x0,_0x21ca2e;_0xc33420<_0x30082c[_0x5fce('0x31')];_0xc33420+=0x1){_0x21ca2e=_0x30082c[_0xc33420][_0x5fce('0x32')]({'plain':!![]});_0x53e4d5['CmHopperBlack'][_0x5fce('0x21')]({'phone':_0x51541a[_0x5fce('0xc')],'ContactId':_0x51541a['id'],'ListId':_0x51541a[_0x5fce('0x22')],'CampaignId':_0x21ca2e['id']})[_0x5fce('0x25')](function(_0x511216){logger[_0x5fce('0x10')](_0x5fce('0x39'),_0x5fce('0x29'),_0x511216[_0x5fce('0x3b')]);});}}});})[_0x5fce('0x18')](function(){_0x288251();})['catch'](function(_0x20c426){logger[_0x5fce('0x10')](_0x5fce('0x39'),_0x5fce('0x29'),_0x20c426[_0x5fce('0x3b')]);_0x288251(_0x20c426);});}else{_0x288251(new Error(_0x5fce('0x3c')));}},'afterDestroy':function(_0x1a0af5,_0x5b4aa0,_0x3e51f8){var _0x48b1a3=_0x475a74[_0x5fce('0x3d')];var _0x5cd9ff=_0x1a0af5[_0x5fce('0x32')]({'plain':!![]});return _0x48b1a3[_0x5fce('0x1e')][_0x5fce('0x2e')]({'raw':!![],'where':{'ListId':_0x5cd9ff[_0x5fce('0x22')],'ContactId':_0x5cd9ff['id']}})[_0x5fce('0x18')](function(_0x1dc1d0){if(!_['isEmpty'](_0x1dc1d0)){var _0x5e1c89=[];for(var _0x55edcf=0x0;_0x55edcf<_0x1dc1d0[_0x5fce('0x31')];_0x55edcf+=0x1){var _0x288e40=_0x48b1a3[_0x5fce('0x1e')][_0x5fce('0x3e')]({'where':{'ListId':_0x1dc1d0[_0x55edcf][_0x5fce('0x22')],'ContactId':_0x1dc1d0[_0x55edcf][_0x5fce('0x3f')],'VoiceQueueId':_0x1dc1d0[_0x55edcf][_0x5fce('0x40')],'CampaignId':_0x1dc1d0[_0x55edcf]['CampaignId']}});_0x5e1c89['push'](_0x288e40);}return BPromise[_0x5fce('0x41')](_0x5e1c89);}})['then'](function(_0x4882dd){logger['info'](_0x5fce('0x42'),util['inspect'](_0x4882dd,{'showHidden':![],'depth':null}));_0x3e51f8();})['catch'](function(_0x4aa445){logger[_0x5fce('0x10')]('[CmContact][afterDestroy][Error]',util[_0x5fce('0x12')](_0x4aa445,{'showHidden':![],'depth':null}));_0x3e51f8(_0x4aa445);});}}});}; \ No newline at end of file +var _0xc83b=['length','get','always','onlyIfOpen','BlackLists','message','Campaign','dialCheckDuplicateType','CmHopperBlack','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment/shared','./cmContact.attributes','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','priority','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','CmList','Lists'];(function(_0x5af22b,_0xc2b30b){var _0x2da6c0=function(_0x34f26c){while(--_0x34f26c){_0x5af22b['push'](_0x5af22b['shift']());}};_0x2da6c0(++_0xc2b30b);}(_0xc83b,0x19a));var _0xbc83=function(_0x3bf302,_0x432e63){_0x3bf302=_0x3bf302-0x0;var _0x5528bd=_0xc83b[_0x3bf302];return _0x5528bd;};'use strict';var _=require(_0xbc83('0x0'));var util=require('util');var logger=require(_0xbc83('0x1'))(_0xbc83('0x2'));var moment=require(_0xbc83('0x3'));var BPromise=require(_0xbc83('0x4'));var rp=require(_0xbc83('0x5'));var fs=require('fs');var path=require(_0xbc83('0x6'));var rimraf=require(_0xbc83('0x7'));var config=require('../../config/environment');var shared=require(_0xbc83('0x8'));var attributes=require(_0xbc83('0x9'));module['exports']=function(_0x13d45d,_0x2a88c8){return _0x13d45d[_0xbc83('0xa')](_0xbc83('0xb'),attributes,{'tableName':_0xbc83('0xc'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0xbc83('0xd')]},{'name':_0xbc83('0xe'),'fields':[_0xbc83('0xf'),_0xbc83('0x10'),'phone',_0xbc83('0x11'),'fax',_0xbc83('0x12')],'type':_0xbc83('0x13')}],'timestamps':!![],'charset':_0xbc83('0x14'),'collate':_0xbc83('0x15'),'hooks':{'afterCreate':function(_0x276b42,_0xed26f2,_0x1cb80e){var _0x4e82f3=_0x13d45d[_0xbc83('0x16')];var _0x56771d=_0x276b42['get']({'plain':!![]});function _0x4df566(){return function(_0x30d5fd){logger[_0xbc83('0x17')](_0xbc83('0x18'),_0xbc83('0x19'),util[_0xbc83('0x1a')](_0x30d5fd,{'showHidden':![],'depth':null}));};}function _0x595f61(_0x25e132,_0x388a51){var _0x23ed12=_0x388a51[_0xbc83('0x1b')]?_0x388a51[_0xbc83('0x1b')]:moment()[_0xbc83('0x1c')](_0xbc83('0x1d'));return new BPromise(function(_0x3d0d60,_0x290b85){if(_[_0xbc83('0x1e')](_0x388a51[_0xbc83('0x1f')])){_0x3d0d60({'ret':_0x23ed12});}else{_0x4e82f3[_0xbc83('0x20')][_0xbc83('0x21')]({'where':{'id':_0x25e132['id']}})[_0xbc83('0x22')](function(_0x449f99){if(!_[_0xbc83('0x1e')](_0x449f99)){var _0x235a01=_0x449f99[_0xbc83('0x1f')];if(!_['isNil'](_0x235a01)){var _0x5df0e9=shared[_0xbc83('0x23')];var _0xe704ee=_0x5df0e9[_0x235a01];var _0x2ba3af=_0x5df0e9[_0x388a51[_0xbc83('0x1f')]];if(!_['isNil'](_0xe704ee)&&!_[_0xbc83('0x1e')](_0x2ba3af)){var _0x472a67=_0xe704ee[_0xbc83('0x24')]-_0x2ba3af[_0xbc83('0x24')];_0x23ed12=_0x388a51['scheduledat']?_0x388a51[_0xbc83('0x1b')]:moment();var _0x3cc2d9=moment(_0x23ed12)[_0xbc83('0x25')](_0x472a67,_0xbc83('0x26'));_0x3d0d60({'ret':_0x3cc2d9['format'](_0xbc83('0x1d'))});}else _0x3d0d60({'ret':_0x23ed12});}else _0x3d0d60({'ret':_0x23ed12});}else{_0x3d0d60({'ret':_0x23ed12});}});}});return 0xa;}var _0x2b3fac=function(_0x55b399){return new BPromise(function(_0x47b51a,_0xc6fd6b){_0x595f61(_0x55b399,_0x56771d)[_0xbc83('0x22')](function(_0x2fac2f){_0x56771d[_0xbc83('0x1b')]=_0x2fac2f[_0xbc83('0x27')];_0x4e82f3[_0xbc83('0x28')][_0xbc83('0x21')]({'where':{'phone':_0x56771d['phone'],'VoiceQueueId':_0x55b399['id']}})[_0xbc83('0x22')](function(_0x9b9aa0){if(!_['isNil'](_0x9b9aa0)){throw new Error(_0xbc83('0x29')+_0x56771d[_0xbc83('0xd')]+_0xbc83('0x2a')+_0x55b399['id']);}return _0x4e82f3[_0xbc83('0x28')][_0xbc83('0x2b')]({'phone':_0x56771d[_0xbc83('0xd')],'ContactId':_0x56771d['id'],'ListId':_0x56771d[_0xbc83('0x2c')],'priority':_0x56771d['priority']?_0x56771d['priority']:0x2,'scheduledat':_0x56771d['scheduledat']?_0x56771d[_0xbc83('0x1b')]:moment()[_0xbc83('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x56771d['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x56771d[_0xbc83('0x2d')]?_0x56771d['callbackUniqueid']:undefined,'callbackat':_0x56771d[_0xbc83('0x2d')]?moment()[_0xbc83('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x55b399['id']});})[_0xbc83('0x2e')](function(_0x572c48){_0xc6fd6b(_0x572c48);});});});};var _0x55690d=function(_0x3b03de){return new BPromise(function(_0x355ef1,_0x21ea6f){_0x595f61(_0x3b03de,_0x56771d)[_0xbc83('0x22')](function(_0x4ae858){_0x56771d[_0xbc83('0x1b')]=_0x4ae858['ret'];_0x4e82f3[_0xbc83('0x28')]['findOne']({'where':{'phone':_0x56771d[_0xbc83('0xd')],'VoiceQueueId':_0x3b03de['id']}})[_0xbc83('0x22')](function(_0x324817){if(!_[_0xbc83('0x1e')](_0x324817)){throw new Error(_0xbc83('0x29')+_0x56771d[_0xbc83('0xd')]+_0xbc83('0x2f')+_0x3b03de['id']);}return _0x4e82f3[_0xbc83('0x30')][_0xbc83('0x21')]({'where':{'calleridnum':_0x56771d[_0xbc83('0xd')],'VoiceQueueId':_0x3b03de['id']}});})[_0xbc83('0x22')](function(_0x38611f){if(!_[_0xbc83('0x1e')](_0x38611f)){throw new Error(_0xbc83('0x31')+_0x56771d['phone']+_0xbc83('0x32')+_0x3b03de['id']);}return _0x4e82f3[_0xbc83('0x28')]['create']({'phone':_0x56771d[_0xbc83('0xd')],'ContactId':_0x56771d['id'],'ListId':_0x56771d[_0xbc83('0x2c')],'priority':_0x56771d[_0xbc83('0x33')]?_0x56771d[_0xbc83('0x33')]:0x2,'scheduledat':_0x56771d[_0xbc83('0x1b')]?_0x56771d[_0xbc83('0x1b')]:moment()[_0xbc83('0x1c')](_0xbc83('0x1d')),'callback':_0x56771d[_0xbc83('0x2d')]?!![]:![],'callbackuniqueid':_0x56771d[_0xbc83('0x2d')]?_0x56771d[_0xbc83('0x2d')]:undefined,'callbackat':_0x56771d[_0xbc83('0x2d')]?moment()[_0xbc83('0x1c')](_0xbc83('0x1d')):undefined,'VoiceQueueId':_0x3b03de['id']});})[_0xbc83('0x2e')](function(_0x5bd1a7){_0x21ea6f(_0x5bd1a7);});});});};function _0x495d1f(){return function(_0x5aff90){logger['error'](_0xbc83('0x18'),_0xbc83('0x19'),util[_0xbc83('0x1a')](_0x5aff90,{'showHidden':![],'depth':null}));};}function _0x2522da(_0x10f4ae,_0xb3212d){var _0x9b6370=_0xb3212d[_0xbc83('0x1b')]?_0xb3212d[_0xbc83('0x1b')]:moment()['format'](_0xbc83('0x1d'));return new BPromise(function(_0x508f8f,_0x486cfa){if(_['isNil'](_0xb3212d['dialTimezone'])){_0x508f8f({'ret':_0x9b6370});}else{_0x4e82f3['Campaign'][_0xbc83('0x21')]({'where':{'id':_0x10f4ae['id']}})[_0xbc83('0x22')](function(_0x52bbc0){if(!_[_0xbc83('0x1e')](_0x52bbc0)){var _0x5a3071=_0x52bbc0['dialTimezone'];if(!_[_0xbc83('0x1e')](_0x5a3071)){var _0x233b6c=shared[_0xbc83('0x23')];var _0xd721bf=_0x233b6c[_0x5a3071];var _0x3d30cb=_0x233b6c[_0xb3212d['dialTimezone']];if(!_[_0xbc83('0x1e')](_0xd721bf)&&!_[_0xbc83('0x1e')](_0x3d30cb)){var _0x89dd76=_0xd721bf[_0xbc83('0x24')]-_0x3d30cb['utcOffset'];_0x9b6370=_0xb3212d[_0xbc83('0x1b')]?_0xb3212d[_0xbc83('0x1b')]:moment();var _0x4f6d2f=moment(_0x9b6370)[_0xbc83('0x25')](_0x89dd76,'minutes');_0x508f8f({'ret':_0x4f6d2f[_0xbc83('0x1c')](_0xbc83('0x1d'))});}else _0x508f8f({'ret':_0x9b6370});}else _0x508f8f({'ret':_0x9b6370});}else{_0x508f8f({'ret':_0x9b6370});}});}});return 0xa;}var _0x1179e1=function(_0x9ff3e7){return new BPromise(function(_0x2a5574,_0x4b5457){_0x2522da(_0x9ff3e7,_0x56771d)[_0xbc83('0x22')](function(_0x4d2093){_0x56771d[_0xbc83('0x1b')]=_0x4d2093[_0xbc83('0x27')];_0x4e82f3['CmHopper'][_0xbc83('0x21')]({'where':{'phone':_0x56771d['phone'],'CampaignId':_0x9ff3e7['id']}})[_0xbc83('0x22')](function(_0x3b2007){if(!_[_0xbc83('0x1e')](_0x3b2007)){throw new Error(_0xbc83('0x29')+_0x56771d['phone']+_0xbc83('0x34')+_0x9ff3e7['id']);}return _0x4e82f3[_0xbc83('0x28')]['create']({'phone':_0x56771d['phone'],'ContactId':_0x56771d['id'],'ListId':_0x56771d['ListId'],'priority':_0x56771d['priority']?_0x56771d[_0xbc83('0x33')]:0x2,'scheduledat':_0x56771d['scheduledat']?_0x56771d['scheduledat']:moment()[_0xbc83('0x1c')](_0xbc83('0x1d')),'callback':_0x56771d['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x56771d[_0xbc83('0x2d')]?_0x56771d['callbackUniqueid']:undefined,'callbackat':_0x56771d['callbackUniqueid']?moment()['format'](_0xbc83('0x1d')):undefined,'CampaignId':_0x9ff3e7['id']});})['catch'](function(_0x2d14c4){_0x4b5457(_0x2d14c4);});});});};var _0x560350=function(_0x2ea2ce){return new BPromise(function(_0x4cb466,_0x19d3ca){_0x2522da(_0x2ea2ce,_0x56771d)[_0xbc83('0x22')](function(_0x2a7876){_0x56771d[_0xbc83('0x1b')]=_0x2a7876[_0xbc83('0x27')];_0x4e82f3[_0xbc83('0x28')][_0xbc83('0x21')]({'where':{'phone':_0x56771d['phone'],'CampaignId':_0x2ea2ce['id']}})[_0xbc83('0x22')](function(_0x1e1aec){if(!_[_0xbc83('0x1e')](_0x1e1aec)){throw new Error('cmContact,\x20afterCreate\x20'+_0x56771d['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x2ea2ce['id']);}return _0x4e82f3[_0xbc83('0x30')][_0xbc83('0x21')]({'where':{'calleridnum':_0x56771d[_0xbc83('0xd')],'CampaignId':_0x2ea2ce['id']}});})[_0xbc83('0x22')](function(_0x1e2605){if(!_[_0xbc83('0x1e')](_0x1e2605)){throw new Error(_0xbc83('0x31')+_0x56771d[_0xbc83('0xd')]+_0xbc83('0x35')+_0x2ea2ce['id']);}return _0x4e82f3[_0xbc83('0x28')]['create']({'phone':_0x56771d[_0xbc83('0xd')],'ContactId':_0x56771d['id'],'ListId':_0x56771d[_0xbc83('0x2c')],'priority':_0x56771d[_0xbc83('0x33')]?_0x56771d[_0xbc83('0x33')]:0x2,'scheduledat':_0x56771d[_0xbc83('0x1b')]?_0x56771d[_0xbc83('0x1b')]:moment()['format'](_0xbc83('0x1d')),'callback':_0x56771d[_0xbc83('0x2d')]?!![]:![],'callbackuniqueid':_0x56771d[_0xbc83('0x2d')]?_0x56771d[_0xbc83('0x2d')]:undefined,'callbackat':_0x56771d[_0xbc83('0x2d')]?moment()['format'](_0xbc83('0x1d')):undefined,'CampaignId':_0x2ea2ce['id']});})[_0xbc83('0x2e')](function(_0x3f23d2){_0x19d3ca(_0x3f23d2);});});});};if(_0x56771d[_0xbc83('0x2c')]){_0x4e82f3[_0xbc83('0x20')][_0xbc83('0x36')]({'where':{'type':_0xbc83('0x37')},'attributes':['id','dialCheckDuplicateType',_0xbc83('0x1f')],'include':[{'model':_0x4e82f3[_0xbc83('0x38')],'as':_0xbc83('0x39'),'where':{'id':_0x56771d[_0xbc83('0x2c')]}}]})[_0xbc83('0x22')](function(_0x3f467d){if(_0x3f467d){var _0x42de22=[];for(var _0x2a0b3d=0x0,_0x3bbe56;_0x2a0b3d<_0x3f467d[_0xbc83('0x3a')];_0x2a0b3d+=0x1){_0x3bbe56=_0x3f467d[_0x2a0b3d][_0xbc83('0x3b')]({'plain':!![]});switch(_0x3bbe56['dialCheckDuplicateType']){case _0xbc83('0x3c'):_0x55690d(_0x3bbe56)[_0xbc83('0x2e')](_0x4df566());break;case _0xbc83('0x3d'):_0x2b3fac(_0x3bbe56)[_0xbc83('0x2e')](_0x4df566());break;default:_0x2522da(_0x3bbe56,_0x56771d)[_0xbc83('0x22')](function(_0x360202){_0x56771d[_0xbc83('0x1b')]=_0x360202['ret'];_0x4e82f3[_0xbc83('0x28')][_0xbc83('0x2b')]({'phone':_0x56771d['phone'],'ContactId':_0x56771d['id'],'ListId':_0x56771d[_0xbc83('0x2c')],'scheduledat':_0x56771d['scheduledat']?_0x56771d['scheduledat']:moment()[_0xbc83('0x1c')](_0xbc83('0x1d')),'priority':_0x56771d['priority']?_0x56771d[_0xbc83('0x33')]:0x2,'callback':_0x56771d[_0xbc83('0x2d')]?!![]:![],'callbackuniqueid':_0x56771d[_0xbc83('0x2d')]?_0x56771d[_0xbc83('0x2d')]:undefined,'callbackat':_0x56771d[_0xbc83('0x2d')]?moment()[_0xbc83('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x3bbe56['id']})[_0xbc83('0x2e')](_0x4df566());});}}}})[_0xbc83('0x22')](function(){return _0x4e82f3[_0xbc83('0x20')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x4e82f3['CmList'],'as':_0xbc83('0x3e'),'where':{'id':_0x56771d['ListId']}}]})['then'](function(_0x1b3e66){if(_0x1b3e66){var _0x1f4739=[];for(var _0x41c801=0x0,_0x4a6ae7;_0x41c801<_0x1b3e66[_0xbc83('0x3a')];_0x41c801+=0x1){_0x4a6ae7=_0x1b3e66[_0x41c801][_0xbc83('0x3b')]({'plain':!![]});_0x4e82f3['CmHopperBlack'][_0xbc83('0x2b')]({'phone':_0x56771d['phone'],'ContactId':_0x56771d['id'],'ListId':_0x56771d[_0xbc83('0x2c')],'VoiceQueueId':_0x4a6ae7['id']})[_0xbc83('0x2e')](function(_0x180f7){logger[_0xbc83('0x17')]('cmContact,\x20%s,\x20%s',_0xbc83('0x19'),_0x180f7[_0xbc83('0x3f')]);});}}});})[_0xbc83('0x22')](function(){return _0x4e82f3[_0xbc83('0x40')][_0xbc83('0x36')]({'attributes':['id','dialCheckDuplicateType',_0xbc83('0x1f')],'include':[{'model':_0x4e82f3['CmList'],'as':'Lists','where':{'id':_0x56771d[_0xbc83('0x2c')]}}]})[_0xbc83('0x22')](function(_0x5000a6){if(_0x5000a6){var _0x24bb1a=[];for(var _0x466715=0x0,_0x11620f;_0x466715<_0x5000a6[_0xbc83('0x3a')];_0x466715+=0x1){_0x11620f=_0x5000a6[_0x466715][_0xbc83('0x3b')]({'plain':!![]});switch(_0x11620f[_0xbc83('0x41')]){case _0xbc83('0x3c'):_0x560350(_0x11620f)['catch'](_0x495d1f());break;case'onlyIfOpen':_0x1179e1(_0x11620f)[_0xbc83('0x2e')](_0x495d1f());break;default:_0x4e82f3[_0xbc83('0x28')]['create']({'phone':_0x56771d[_0xbc83('0xd')],'ContactId':_0x56771d['id'],'ListId':_0x56771d[_0xbc83('0x2c')],'scheduledat':_0x56771d['scheduledat']?_0x56771d[_0xbc83('0x1b')]:moment()['format'](_0xbc83('0x1d')),'priority':_0x56771d[_0xbc83('0x33')]?_0x56771d[_0xbc83('0x33')]:0x2,'callback':_0x56771d[_0xbc83('0x2d')]?!![]:![],'callbackuniqueid':_0x56771d[_0xbc83('0x2d')]?_0x56771d[_0xbc83('0x2d')]:undefined,'callbackat':_0x56771d['callbackUniqueid']?moment()[_0xbc83('0x1c')](_0xbc83('0x1d')):undefined,'CampaignId':_0x11620f['id']})[_0xbc83('0x2e')](_0x495d1f());}}}});})[_0xbc83('0x22')](function(){return _0x4e82f3['Campaign'][_0xbc83('0x36')]({'attributes':['id'],'include':[{'model':_0x4e82f3[_0xbc83('0x38')],'as':_0xbc83('0x3e'),'where':{'id':_0x56771d[_0xbc83('0x2c')]}}]})[_0xbc83('0x22')](function(_0x59588c){if(_0x59588c){var _0x4cebeb=[];for(var _0x15d88b=0x0,_0x16dd2d;_0x15d88b<_0x59588c[_0xbc83('0x3a')];_0x15d88b+=0x1){_0x16dd2d=_0x59588c[_0x15d88b][_0xbc83('0x3b')]({'plain':!![]});_0x4e82f3[_0xbc83('0x42')][_0xbc83('0x2b')]({'phone':_0x56771d[_0xbc83('0xd')],'ContactId':_0x56771d['id'],'ListId':_0x56771d[_0xbc83('0x2c')],'CampaignId':_0x16dd2d['id']})['catch'](function(_0x468db1){logger[_0xbc83('0x17')](_0xbc83('0x43'),_0xbc83('0x19'),_0x468db1[_0xbc83('0x3f')]);});}}});})['then'](function(){_0x1cb80e();})['catch'](function(_0x5b5f28){logger[_0xbc83('0x17')](_0xbc83('0x43'),_0xbc83('0x19'),_0x5b5f28['message']);_0x1cb80e(_0x5b5f28);});}else{_0x1cb80e(new Error(_0xbc83('0x44')));}},'afterDestroy':function(_0x574842,_0x1a1317,_0x5f03a8){var _0x5deed8=_0x13d45d[_0xbc83('0x16')];var _0x25c5c7=_0x574842['get']({'plain':!![]});return _0x5deed8[_0xbc83('0x28')]['findAll']({'raw':!![],'where':{'ListId':_0x25c5c7[_0xbc83('0x2c')],'ContactId':_0x25c5c7['id']}})['then'](function(_0x2314f4){if(!_[_0xbc83('0x45')](_0x2314f4)){var _0x4dc608=[];for(var _0x1bc235=0x0;_0x1bc235<_0x2314f4['length'];_0x1bc235+=0x1){var _0x539b89=_0x5deed8[_0xbc83('0x28')][_0xbc83('0x46')]({'where':{'ListId':_0x2314f4[_0x1bc235][_0xbc83('0x2c')],'ContactId':_0x2314f4[_0x1bc235][_0xbc83('0x47')],'VoiceQueueId':_0x2314f4[_0x1bc235][_0xbc83('0x48')],'CampaignId':_0x2314f4[_0x1bc235][_0xbc83('0x49')]}});_0x4dc608[_0xbc83('0x4a')](_0x539b89);}return BPromise['all'](_0x4dc608);}})[_0xbc83('0x22')](function(_0x723ff){logger[_0xbc83('0x4b')](_0xbc83('0x4c'),util[_0xbc83('0x1a')](_0x723ff,{'showHidden':![],'depth':null}));_0x5f03a8();})['catch'](function(_0x483eee){logger[_0xbc83('0x17')](_0xbc83('0x4d'),util[_0xbc83('0x1a')](_0x483eee,{'showHidden':![],'depth':null}));_0x5f03a8(_0x483eee);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index f3f9310..351d8f2 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x525e77,_0x512e3a){var _0x2aea40=function(_0x2f4c78){while(--_0x2f4c78){_0x525e77['push'](_0x525e77['shift']());}};_0x2aea40(++_0x512e3a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 5b27dd1..fc993c5 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ed2=['sequelize','INTEGER','STRING','PHONE'];(function(_0x5e5ad9,_0x2bd9fe){var _0x236667=function(_0x529468){while(--_0x529468){_0x5e5ad9['push'](_0x5e5ad9['shift']());}};_0x236667(++_0x2bd9fe);}(_0x5ed2,0x114));var _0x25ed=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x5ed2[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x25ed('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x25ed('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x25ed('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x25ed('0x2')],'defaultValue':_0x25ed('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x25ed('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0xbe31=['INTEGER','STRING','PHONE','exports'];(function(_0x500fc6,_0x1540cf){var _0xa478ff=function(_0x1f014a){while(--_0x1f014a){_0x500fc6['push'](_0x500fc6['shift']());}};_0xa478ff(++_0x1540cf);}(_0xbe31,0x83));var _0x1be3=function(_0x1f6193,_0x2de9ff){_0x1f6193=_0x1f6193-0x0;var _0x160297=_0xbe31[_0x1f6193];return _0x160297;};'use strict';var Sequelize=require('sequelize');module[_0x1be3('0x0')]={'CmContactId':{'type':Sequelize[_0x1be3('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x1be3('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x1be3('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x1be3('0x2')],'defaultValue':_0x1be3('0x3')},'OrderBy':{'type':Sequelize[_0x1be3('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0x1be3('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index a502c56..384111e 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d5a=['CmContactHasItem','includeAll','include','findAll','rows','catch','show','params','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','send','map','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filters','where','type','VIRTUAL','name','merge','options'];(function(_0x5034eb,_0x20c592){var _0x243657=function(_0x16b880){while(--_0x16b880){_0x5034eb['push'](_0x5034eb['shift']());}};_0x243657(++_0x20c592);}(_0x8d5a,0x110));var _0xa8d5=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x8d5a[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8d5('0x0'));var zipdir=require(_0xa8d5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8d5('0x2'));var moment=require(_0xa8d5('0x3'));var BPromise=require(_0xa8d5('0x4'));var Mustache=require(_0xa8d5('0x5'));var util=require(_0xa8d5('0x6'));var path=require(_0xa8d5('0x7'));var sox=require(_0xa8d5('0x8'));var csv=require(_0xa8d5('0x9'));var ejs=require(_0xa8d5('0xa'));var fs=require('fs');var fs_extra=require(_0xa8d5('0xb'));var _=require(_0xa8d5('0xc'));var squel=require(_0xa8d5('0xd'));var crypto=require(_0xa8d5('0xe'));var jsforce=require(_0xa8d5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa8d5('0x9'));var querystring=require(_0xa8d5('0x10'));var Papa=require(_0xa8d5('0x11'));var Redis=require(_0xa8d5('0x12'));var authService=require(_0xa8d5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa8d5('0x14'));var hardwareService=require(_0xa8d5('0x15'));var logger=require(_0xa8d5('0x16'))(_0xa8d5('0x17'));var utils=require(_0xa8d5('0x18'));var config=require(_0xa8d5('0x19'));var licenseUtil=require(_0xa8d5('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f70b4,_0x5bcdf5){_0x5bcdf5=_0x5bcdf5||0xcc;return function(_0x5cf264){if(_0x5cf264){return _0x1f70b4[_0xa8d5('0x1b')](_0x5bcdf5);}return _0x1f70b4[_0xa8d5('0x1c')](_0x5bcdf5)[_0xa8d5('0x1d')]();};}function respondWithResult(_0x1f95c8,_0x359611){_0x359611=_0x359611||0xc8;return function(_0x489767){if(_0x489767){return _0x1f95c8[_0xa8d5('0x1c')](_0x359611)['json'](_0x489767);}};}function respondWithFilteredResult(_0x5ae3e0,_0x17064a){return function(_0x539add){if(_0x539add){var _0x5c2f5e=typeof _0x17064a[_0xa8d5('0x1e')]===_0xa8d5('0x1f')&&typeof _0x17064a[_0xa8d5('0x20')]===_0xa8d5('0x1f');var _0x483941=_0x539add[_0xa8d5('0x21')];var _0x122a9a=_0x5c2f5e?0x0:_0x17064a['offset'];var _0x473082=_0x5c2f5e?_0x539add[_0xa8d5('0x21')]:_0x17064a[_0xa8d5('0x1e')]+_0x17064a[_0xa8d5('0x20')];var _0x4b836b;if(_0x473082>=_0x483941){_0x473082=_0x483941;_0x4b836b=0xc8;}else{_0x4b836b=0xce;}_0x5ae3e0[_0xa8d5('0x1c')](_0x4b836b);return _0x5ae3e0[_0xa8d5('0x22')](_0xa8d5('0x23'),_0x122a9a+'-'+_0x473082+'/'+_0x483941)[_0xa8d5('0x24')](_0x539add);}return null;};}function patchUpdates(_0x4dac5c){return function(_0x2017f7){try{jsonpatch['apply'](_0x2017f7,_0x4dac5c,!![]);}catch(_0x347752){return BPromise[_0xa8d5('0x25')](_0x347752);}return _0x2017f7[_0xa8d5('0x26')]();};}function saveUpdates(_0x36f7b6,_0x3e2a9e){return function(_0x586d9a){if(_0x586d9a){return _0x586d9a[_0xa8d5('0x27')](_0x36f7b6)[_0xa8d5('0x28')](function(_0xdf96e8){return _0xdf96e8;});}return null;};}function removeEntity(_0x2cc642,_0x5cd8fb){return function(_0x41b936){if(_0x41b936){return _0x41b936[_0xa8d5('0x29')]()['then'](function(){var _0x2fc182=_0x41b936[_0xa8d5('0x2a')]({'plain':!![]});var _0x5a3cb5=_0xa8d5('0x2b');return db[_0xa8d5('0x2c')][_0xa8d5('0x29')]({'where':{'type':_0x5a3cb5,'resourceId':_0x2fc182['id']}})[_0xa8d5('0x28')](function(){return _0x41b936;});})[_0xa8d5('0x28')](function(){_0x2cc642['status'](0xcc)[_0xa8d5('0x1d')]();});}};}function handleEntityNotFound(_0x455924,_0x3d016a){return function(_0x32bae4){if(!_0x32bae4){_0x455924[_0xa8d5('0x1b')](0x194);}return _0x32bae4;};}function handleError(_0x38a4f8,_0xa8180d){_0xa8180d=_0xa8180d||0x1f4;return function(_0x158370){logger[_0xa8d5('0x2d')](_0x158370[_0xa8d5('0x2e')]);if(_0x158370['name']){delete _0x158370['name'];}_0x38a4f8[_0xa8d5('0x1c')](_0xa8180d)[_0xa8d5('0x2f')](_0x158370);};}exports['index']=function(_0x2ddb0e,_0x22cbdd){var _0x90435e={},_0x2e5af5={},_0x4f6ccf={'count':0x0,'rows':[]};var _0x238a87=_[_0xa8d5('0x30')](db['CmContactHasItem'][_0xa8d5('0x31')],function(_0x2729c8){return{'name':_0x2729c8[_0xa8d5('0x32')],'type':_0x2729c8['type']['key']};});_0x2e5af5[_0xa8d5('0x33')]=_['map'](_0x238a87,'name');_0x2e5af5['query']=_[_0xa8d5('0x34')](_0x2ddb0e[_0xa8d5('0x35')]);_0x2e5af5['filters']=_[_0xa8d5('0x36')](_0x2e5af5['model'],_0x2e5af5[_0xa8d5('0x35')]);_0x90435e[_0xa8d5('0x37')]=_[_0xa8d5('0x36')](_0x2e5af5[_0xa8d5('0x33')],qs[_0xa8d5('0x38')](_0x2ddb0e[_0xa8d5('0x35')][_0xa8d5('0x38')]));_0x90435e['attributes']=_0x90435e[_0xa8d5('0x37')][_0xa8d5('0x39')]?_0x90435e['attributes']:_0x2e5af5[_0xa8d5('0x33')];if(!_0x2ddb0e[_0xa8d5('0x35')]['hasOwnProperty'](_0xa8d5('0x3a'))){_0x90435e['limit']=qs[_0xa8d5('0x20')](_0x2ddb0e[_0xa8d5('0x35')][_0xa8d5('0x20')]);_0x90435e[_0xa8d5('0x1e')]=qs[_0xa8d5('0x1e')](_0x2ddb0e[_0xa8d5('0x35')]['offset']);}_0x90435e[_0xa8d5('0x3b')]=qs[_0xa8d5('0x3c')](_0x2ddb0e['query'][_0xa8d5('0x3c')]);_0x90435e['where']=qs[_0xa8d5('0x3d')](_['pick'](_0x2ddb0e[_0xa8d5('0x35')],_0x2e5af5[_0xa8d5('0x3d')]),_0x238a87);if(_0x2ddb0e[_0xa8d5('0x35')]['filter']){_0x90435e[_0xa8d5('0x3e')]=_['merge'](_0x90435e[_0xa8d5('0x3e')],{'$or':_['map'](_0x238a87,function(_0x3bdd38){if(_0x3bdd38[_0xa8d5('0x3f')]!==_0xa8d5('0x40')){var _0x4b63ae={};_0x4b63ae[_0x3bdd38[_0xa8d5('0x41')]]={'$like':'%'+_0x2ddb0e['query']['filter']+'%'};return _0x4b63ae;}})});}_0x90435e=_[_0xa8d5('0x42')]({},_0x90435e,_0x2ddb0e[_0xa8d5('0x43')]);var _0x2b28ba={'where':_0x90435e[_0xa8d5('0x3e')]};return db[_0xa8d5('0x44')][_0xa8d5('0x21')](_0x2b28ba)[_0xa8d5('0x28')](function(_0x40b0bc){_0x4f6ccf[_0xa8d5('0x21')]=_0x40b0bc;if(_0x2ddb0e[_0xa8d5('0x35')][_0xa8d5('0x45')]){_0x90435e[_0xa8d5('0x46')]=[{'all':!![]}];}return db[_0xa8d5('0x44')][_0xa8d5('0x47')](_0x90435e);})[_0xa8d5('0x28')](function(_0x423deb){_0x4f6ccf[_0xa8d5('0x48')]=_0x423deb;return _0x4f6ccf;})['then'](respondWithFilteredResult(_0x22cbdd,_0x90435e))[_0xa8d5('0x49')](handleError(_0x22cbdd,null));};exports[_0xa8d5('0x4a')]=function(_0x47a366,_0x18e867){var _0x1e4c8a={'raw':!![],'where':{'id':_0x47a366[_0xa8d5('0x4b')]['id']}},_0x4014f9={};_0x4014f9[_0xa8d5('0x33')]=_[_0xa8d5('0x34')](db[_0xa8d5('0x44')][_0xa8d5('0x31')]);_0x4014f9['query']=_[_0xa8d5('0x34')](_0x47a366[_0xa8d5('0x35')]);_0x4014f9[_0xa8d5('0x3d')]=_[_0xa8d5('0x36')](_0x4014f9[_0xa8d5('0x33')],_0x4014f9[_0xa8d5('0x35')]);_0x1e4c8a[_0xa8d5('0x37')]=_[_0xa8d5('0x36')](_0x4014f9['model'],qs[_0xa8d5('0x38')](_0x47a366[_0xa8d5('0x35')][_0xa8d5('0x38')]));_0x1e4c8a['attributes']=_0x1e4c8a[_0xa8d5('0x37')][_0xa8d5('0x39')]?_0x1e4c8a['attributes']:_0x4014f9[_0xa8d5('0x33')];if(_0x47a366[_0xa8d5('0x35')][_0xa8d5('0x45')]){_0x1e4c8a[_0xa8d5('0x46')]=[{'all':!![]}];}_0x1e4c8a=_[_0xa8d5('0x42')]({},_0x1e4c8a,_0x47a366['options']);return db[_0xa8d5('0x44')][_0xa8d5('0x4c')](_0x1e4c8a)[_0xa8d5('0x28')](handleEntityNotFound(_0x18e867,null))['then'](respondWithResult(_0x18e867,null))[_0xa8d5('0x49')](handleError(_0x18e867,null));};exports['create']=function(_0x200c99,_0x2441ac){return db[_0xa8d5('0x44')]['create'](_0x200c99[_0xa8d5('0x4d')],{})[_0xa8d5('0x28')](function(_0x48ae12){var _0x402cd1=_0x200c99['user'][_0xa8d5('0x2a')]({'plain':!![]});if(!_0x402cd1)throw new Error(_0xa8d5('0x4e'));if(_0x402cd1[_0xa8d5('0x4f')]===_0xa8d5('0x50')){var _0xd68209=_0x48ae12['get']({'plain':!![]});var _0x7cebd3='CmContactHasItems';return db[_0xa8d5('0x51')][_0xa8d5('0x4c')]({'where':{'name':_0x7cebd3,'userProfileId':_0x402cd1[_0xa8d5('0x52')]},'raw':!![]})[_0xa8d5('0x28')](function(_0x6538f9){if(_0x6538f9&&_0x6538f9[_0xa8d5('0x53')]===0x0){return db[_0xa8d5('0x2c')]['create']({'name':_0xd68209['name'],'resourceId':_0xd68209['id'],'type':_0x6538f9[_0xa8d5('0x41')],'sectionId':_0x6538f9['id']},{})[_0xa8d5('0x28')](function(){return _0x48ae12;});}else{return _0x48ae12;}})['catch'](function(_0x4b35ef){logger[_0xa8d5('0x2d')](_0xa8d5('0x54'),_0x4b35ef);throw _0x4b35ef;});}return _0x48ae12;})[_0xa8d5('0x28')](respondWithResult(_0x2441ac,0xc9))[_0xa8d5('0x49')](handleError(_0x2441ac,null));};exports['update']=function(_0x438e6f,_0x358947){if(_0x438e6f['body']['id']){delete _0x438e6f[_0xa8d5('0x4d')]['id'];}return db[_0xa8d5('0x44')][_0xa8d5('0x4c')]({'where':{'id':_0x438e6f[_0xa8d5('0x4b')]['id']}})[_0xa8d5('0x28')](handleEntityNotFound(_0x358947,null))['then'](saveUpdates(_0x438e6f[_0xa8d5('0x4d')],null))[_0xa8d5('0x28')](respondWithResult(_0x358947,null))[_0xa8d5('0x49')](handleError(_0x358947,null));};exports[_0xa8d5('0x29')]=function(_0x31e37f,_0x56e464){return db[_0xa8d5('0x44')]['find']({'where':{'id':_0x31e37f[_0xa8d5('0x4b')]['id']}})[_0xa8d5('0x28')](handleEntityNotFound(_0x56e464,null))['then'](removeEntity(_0x56e464,null))[_0xa8d5('0x49')](handleError(_0x56e464,null));}; \ No newline at end of file +var _0x3ff7=['undefined','limit','count','offset','set','Content-Range','json','reject','save','then','get','CmContactHasItems','UserProfileResource','destroy','end','stack','send','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','CmContactHasItem','findAll','rows','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','name','catch','error','body','params','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x44b752,_0x3e6677){var _0x352165=function(_0x4e07a9){while(--_0x4e07a9){_0x44b752['push'](_0x44b752['shift']());}};_0x352165(++_0x3e6677);}(_0x3ff7,0x1c3));var _0x73ff=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0x3ff7[_0x592e40];return _0x5d4288;};'use strict';var emlformat=require(_0x73ff('0x0'));var rimraf=require(_0x73ff('0x1'));var zipdir=require(_0x73ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x73ff('0x3'));var BPromise=require(_0x73ff('0x4'));var Mustache=require('mustache');var util=require(_0x73ff('0x5'));var path=require('path');var sox=require(_0x73ff('0x6'));var csv=require(_0x73ff('0x7'));var ejs=require(_0x73ff('0x8'));var fs=require('fs');var fs_extra=require(_0x73ff('0x9'));var _=require(_0x73ff('0xa'));var squel=require('squel');var crypto=require(_0x73ff('0xb'));var jsforce=require(_0x73ff('0xc'));var deskjs=require(_0x73ff('0xd'));var toCsv=require(_0x73ff('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x73ff('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x73ff('0xf'));var logger=require(_0x73ff('0x10'))('api');var utils=require(_0x73ff('0x11'));var config=require(_0x73ff('0x12'));var licenseUtil=require(_0x73ff('0x13'));var db=require(_0x73ff('0x14'))['db'];function respondWithStatusCode(_0x14bc2b,_0x707e04){_0x707e04=_0x707e04||0xcc;return function(_0x1c9db1){if(_0x1c9db1){return _0x14bc2b[_0x73ff('0x15')](_0x707e04);}return _0x14bc2b['status'](_0x707e04)['end']();};}function respondWithResult(_0x11ee7e,_0x221346){_0x221346=_0x221346||0xc8;return function(_0x508129){if(_0x508129){return _0x11ee7e[_0x73ff('0x16')](_0x221346)['json'](_0x508129);}};}function respondWithFilteredResult(_0x50b64b,_0x2c1628){return function(_0x29db08){if(_0x29db08){var _0x31f170=typeof _0x2c1628['offset']===_0x73ff('0x17')&&typeof _0x2c1628[_0x73ff('0x18')]===_0x73ff('0x17');var _0x378409=_0x29db08[_0x73ff('0x19')];var _0x32df63=_0x31f170?0x0:_0x2c1628[_0x73ff('0x1a')];var _0x440b5a=_0x31f170?_0x29db08['count']:_0x2c1628[_0x73ff('0x1a')]+_0x2c1628[_0x73ff('0x18')];var _0x2146aa;if(_0x440b5a>=_0x378409){_0x440b5a=_0x378409;_0x2146aa=0xc8;}else{_0x2146aa=0xce;}_0x50b64b[_0x73ff('0x16')](_0x2146aa);return _0x50b64b[_0x73ff('0x1b')](_0x73ff('0x1c'),_0x32df63+'-'+_0x440b5a+'/'+_0x378409)[_0x73ff('0x1d')](_0x29db08);}return null;};}function patchUpdates(_0x3b5106){return function(_0x595da7){try{jsonpatch['apply'](_0x595da7,_0x3b5106,!![]);}catch(_0x4cb0be){return BPromise[_0x73ff('0x1e')](_0x4cb0be);}return _0x595da7[_0x73ff('0x1f')]();};}function saveUpdates(_0xcf7108,_0x5249fb){return function(_0x372262){if(_0x372262){return _0x372262['update'](_0xcf7108)[_0x73ff('0x20')](function(_0xf45bee){return _0xf45bee;});}return null;};}function removeEntity(_0x115d49,_0x559e10){return function(_0x4481a4){if(_0x4481a4){return _0x4481a4['destroy']()[_0x73ff('0x20')](function(){var _0x299337=_0x4481a4[_0x73ff('0x21')]({'plain':!![]});var _0x3785f8=_0x73ff('0x22');return db[_0x73ff('0x23')][_0x73ff('0x24')]({'where':{'type':_0x3785f8,'resourceId':_0x299337['id']}})[_0x73ff('0x20')](function(){return _0x4481a4;});})[_0x73ff('0x20')](function(){_0x115d49[_0x73ff('0x16')](0xcc)[_0x73ff('0x25')]();});}};}function handleEntityNotFound(_0x418e20,_0x21a663){return function(_0x1a1650){if(!_0x1a1650){_0x418e20[_0x73ff('0x15')](0x194);}return _0x1a1650;};}function handleError(_0x1ecdcd,_0x20838d){_0x20838d=_0x20838d||0x1f4;return function(_0x3a39d5){logger['error'](_0x3a39d5[_0x73ff('0x26')]);if(_0x3a39d5['name']){delete _0x3a39d5['name'];}_0x1ecdcd[_0x73ff('0x16')](_0x20838d)[_0x73ff('0x27')](_0x3a39d5);};}exports['index']=function(_0x3b8837,_0x13b5ae){var _0x34edc9={},_0x2a752e={},_0x1d4ab5={'count':0x0,'rows':[]};var _0x47d25e=_['map'](db['CmContactHasItem']['rawAttributes'],function(_0x435a83){return{'name':_0x435a83['fieldName'],'type':_0x435a83['type'][_0x73ff('0x28')]};});_0x2a752e[_0x73ff('0x29')]=_[_0x73ff('0x2a')](_0x47d25e,'name');_0x2a752e['query']=_[_0x73ff('0x2b')](_0x3b8837[_0x73ff('0x2c')]);_0x2a752e[_0x73ff('0x2d')]=_[_0x73ff('0x2e')](_0x2a752e['model'],_0x2a752e[_0x73ff('0x2c')]);_0x34edc9['attributes']=_['intersection'](_0x2a752e[_0x73ff('0x29')],qs[_0x73ff('0x2f')](_0x3b8837[_0x73ff('0x2c')][_0x73ff('0x2f')]));_0x34edc9[_0x73ff('0x30')]=_0x34edc9[_0x73ff('0x30')][_0x73ff('0x31')]?_0x34edc9['attributes']:_0x2a752e[_0x73ff('0x29')];if(!_0x3b8837['query'][_0x73ff('0x32')](_0x73ff('0x33'))){_0x34edc9[_0x73ff('0x18')]=qs['limit'](_0x3b8837['query'][_0x73ff('0x18')]);_0x34edc9[_0x73ff('0x1a')]=qs[_0x73ff('0x1a')](_0x3b8837['query']['offset']);}_0x34edc9[_0x73ff('0x34')]=qs[_0x73ff('0x35')](_0x3b8837['query'][_0x73ff('0x35')]);_0x34edc9[_0x73ff('0x36')]=qs['filters'](_[_0x73ff('0x37')](_0x3b8837['query'],_0x2a752e[_0x73ff('0x2d')]),_0x47d25e);if(_0x3b8837[_0x73ff('0x2c')][_0x73ff('0x38')]){_0x34edc9[_0x73ff('0x36')]=_[_0x73ff('0x39')](_0x34edc9[_0x73ff('0x36')],{'$or':_[_0x73ff('0x2a')](_0x47d25e,function(_0x1d725d){if(_0x1d725d[_0x73ff('0x3a')]!==_0x73ff('0x3b')){var _0x3d0562={};_0x3d0562[_0x1d725d['name']]={'$like':'%'+_0x3b8837[_0x73ff('0x2c')][_0x73ff('0x38')]+'%'};return _0x3d0562;}})});}_0x34edc9=_[_0x73ff('0x39')]({},_0x34edc9,_0x3b8837[_0x73ff('0x3c')]);var _0x1d5a89={'where':_0x34edc9['where']};return db['CmContactHasItem']['count'](_0x1d5a89)['then'](function(_0x5809fb){_0x1d4ab5['count']=_0x5809fb;if(_0x3b8837[_0x73ff('0x2c')][_0x73ff('0x3d')]){_0x34edc9[_0x73ff('0x3e')]=[{'all':!![]}];}return db[_0x73ff('0x3f')][_0x73ff('0x40')](_0x34edc9);})['then'](function(_0x58eb85){_0x1d4ab5[_0x73ff('0x41')]=_0x58eb85;return _0x1d4ab5;})[_0x73ff('0x20')](respondWithFilteredResult(_0x13b5ae,_0x34edc9))['catch'](handleError(_0x13b5ae,null));};exports['show']=function(_0x59fdf1,_0x2f071d){var _0x1ff59d={'raw':!![],'where':{'id':_0x59fdf1['params']['id']}},_0x31c2bb={};_0x31c2bb[_0x73ff('0x29')]=_[_0x73ff('0x2b')](db[_0x73ff('0x3f')][_0x73ff('0x42')]);_0x31c2bb[_0x73ff('0x2c')]=_['keys'](_0x59fdf1[_0x73ff('0x2c')]);_0x31c2bb['filters']=_[_0x73ff('0x2e')](_0x31c2bb['model'],_0x31c2bb[_0x73ff('0x2c')]);_0x1ff59d[_0x73ff('0x30')]=_[_0x73ff('0x2e')](_0x31c2bb['model'],qs[_0x73ff('0x2f')](_0x59fdf1['query'][_0x73ff('0x2f')]));_0x1ff59d[_0x73ff('0x30')]=_0x1ff59d['attributes']['length']?_0x1ff59d[_0x73ff('0x30')]:_0x31c2bb[_0x73ff('0x29')];if(_0x59fdf1['query'][_0x73ff('0x3d')]){_0x1ff59d[_0x73ff('0x3e')]=[{'all':!![]}];}_0x1ff59d=_[_0x73ff('0x39')]({},_0x1ff59d,_0x59fdf1[_0x73ff('0x3c')]);return db[_0x73ff('0x3f')][_0x73ff('0x43')](_0x1ff59d)[_0x73ff('0x20')](handleEntityNotFound(_0x2f071d,null))[_0x73ff('0x20')](respondWithResult(_0x2f071d,null))['catch'](handleError(_0x2f071d,null));};exports[_0x73ff('0x44')]=function(_0x15b28c,_0x3dc75e){return db[_0x73ff('0x3f')][_0x73ff('0x44')](_0x15b28c['body'],{})[_0x73ff('0x20')](function(_0x33712b){var _0x5cbda8=_0x15b28c[_0x73ff('0x45')][_0x73ff('0x21')]({'plain':!![]});if(!_0x5cbda8)throw new Error(_0x73ff('0x46'));if(_0x5cbda8['role']==='user'){var _0x3f706b=_0x33712b[_0x73ff('0x21')]({'plain':!![]});var _0x268b5e=_0x73ff('0x22');return db[_0x73ff('0x47')]['find']({'where':{'name':_0x268b5e,'userProfileId':_0x5cbda8[_0x73ff('0x48')]},'raw':!![]})['then'](function(_0x43f23f){if(_0x43f23f&&_0x43f23f[_0x73ff('0x49')]===0x0){return db[_0x73ff('0x23')][_0x73ff('0x44')]({'name':_0x3f706b[_0x73ff('0x4a')],'resourceId':_0x3f706b['id'],'type':_0x43f23f[_0x73ff('0x4a')],'sectionId':_0x43f23f['id']},{})[_0x73ff('0x20')](function(){return _0x33712b;});}else{return _0x33712b;}})[_0x73ff('0x4b')](function(_0x429a8e){logger[_0x73ff('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x429a8e);throw _0x429a8e;});}return _0x33712b;})[_0x73ff('0x20')](respondWithResult(_0x3dc75e,0xc9))['catch'](handleError(_0x3dc75e,null));};exports['update']=function(_0x57824a,_0x37d0c6){if(_0x57824a[_0x73ff('0x4d')]['id']){delete _0x57824a[_0x73ff('0x4d')]['id'];}return db['CmContactHasItem'][_0x73ff('0x43')]({'where':{'id':_0x57824a[_0x73ff('0x4e')]['id']}})[_0x73ff('0x20')](handleEntityNotFound(_0x37d0c6,null))[_0x73ff('0x20')](saveUpdates(_0x57824a[_0x73ff('0x4d')],null))[_0x73ff('0x20')](respondWithResult(_0x37d0c6,null))[_0x73ff('0x4b')](handleError(_0x37d0c6,null));};exports['destroy']=function(_0x3e378d,_0x652fd9){return db[_0x73ff('0x3f')][_0x73ff('0x43')]({'where':{'id':_0x3e378d[_0x73ff('0x4e')]['id']}})[_0x73ff('0x20')](handleEntityNotFound(_0x652fd9,null))[_0x73ff('0x20')](removeEntity(_0x652fd9,null))['catch'](handleError(_0x652fd9,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 811e60f..9443f6c 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21dc=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21dc,0xcb));var _0xc21d=function(_0x38f03a,_0x562c98){_0x38f03a=_0x38f03a-0x0;var _0x371b0e=_0x21dc[_0x38f03a];return _0x371b0e;};'use strict';var _=require('lodash');var util=require(_0xc21d('0x0'));var logger=require(_0xc21d('0x1'))(_0xc21d('0x2'));var moment=require(_0xc21d('0x3'));var BPromise=require(_0xc21d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc21d('0x5'));var rimraf=require(_0xc21d('0x6'));var config=require(_0xc21d('0x7'));var attributes=require(_0xc21d('0x8'));module[_0xc21d('0x9')]=function(_0x18513d,_0x20e4d3){return _0x18513d[_0xc21d('0xa')](_0xc21d('0xb'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4742=['../../config/environment','exports','define','CmContactHasItem','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x24d4c6,_0x246fb0){var _0x1d43e6=function(_0x3b42c1){while(--_0x3b42c1){_0x24d4c6['push'](_0x24d4c6['shift']());}};_0x1d43e6(++_0x246fb0);}(_0x4742,0x10c));var _0x2474=function(_0x44f980,_0x105fc0){_0x44f980=_0x44f980-0x0;var _0x59ae66=_0x4742[_0x44f980];return _0x59ae66;};'use strict';var _=require(_0x2474('0x0'));var util=require('util');var logger=require(_0x2474('0x1'))(_0x2474('0x2'));var moment=require('moment');var BPromise=require(_0x2474('0x3'));var rp=require(_0x2474('0x4'));var fs=require('fs');var path=require(_0x2474('0x5'));var rimraf=require(_0x2474('0x6'));var config=require(_0x2474('0x7'));var attributes=require('./cmContactHasItem.attributes');module[_0x2474('0x8')]=function(_0x416972,_0x501a7a){return _0x416972[_0x2474('0x9')](_0x2474('0xa'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 16e0313..f85ead5 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cfd=['CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xb90648,_0x1068a3){var _0x5e0afa=function(_0x1622c6){while(--_0x1622c6){_0xb90648['push'](_0xb90648['shift']());}};_0x5e0afa(++_0x1068a3);}(_0x4cfd,0x1ac));var _0xd4cf=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x4cfd[_0x390733];return _0x33beb9;};'use strict';var _=require(_0xd4cf('0x0'));var util=require('util');var moment=require(_0xd4cf('0x1'));var BPromise=require('bluebird');var rs=require(_0xd4cf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4cf('0x3'))['db'];var utils=require(_0xd4cf('0x4'));var logger=require('../../config/logger')(_0xd4cf('0x5'));var config=require(_0xd4cf('0x6'));var jayson=require(_0xd4cf('0x7'));var client=jayson[_0xd4cf('0x8')][_0xd4cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c3a86,_0xc7480b,_0x3548f0){return new BPromise(function(_0x35db8c,_0x381388){return client[_0xd4cf('0xa')](_0x2c3a86,_0x3548f0)[_0xd4cf('0xb')](function(_0xd5bf63){logger[_0xd4cf('0xc')](_0xd4cf('0xd'),_0xc7480b,_0xd4cf('0xe'));logger['debug'](_0xd4cf('0xf'),_0xc7480b,_0xd4cf('0xe'),JSON[_0xd4cf('0x10')](_0xd5bf63));if(_0xd5bf63[_0xd4cf('0x11')]){if(_0xd5bf63['error'][_0xd4cf('0x12')]===0x1f4){logger[_0xd4cf('0x11')](_0xd4cf('0xd'),_0xc7480b,_0xd5bf63[_0xd4cf('0x11')][_0xd4cf('0x13')]);return _0x381388(_0xd5bf63[_0xd4cf('0x11')][_0xd4cf('0x13')]);}logger[_0xd4cf('0x11')](_0xd4cf('0xd'),_0xc7480b,_0xd5bf63[_0xd4cf('0x11')][_0xd4cf('0x13')]);return _0x35db8c(_0xd5bf63['error'][_0xd4cf('0x13')]);}else{logger[_0xd4cf('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0xc7480b,_0xd4cf('0xe'));_0x35db8c(_0xd5bf63['result'][_0xd4cf('0x13')]);}})[_0xd4cf('0x14')](function(_0xd3f12b){logger['error'](_0xd4cf('0xd'),_0xc7480b,_0xd3f12b);_0x381388(_0xd3f12b);});});} \ No newline at end of file +var _0x8471=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash'];(function(_0x1b29ee,_0x8fef0a){var _0x26e9b9=function(_0x441742){while(--_0x441742){_0x1b29ee['push'](_0x1b29ee['shift']());}};_0x26e9b9(++_0x8fef0a);}(_0x8471,0xbf));var _0x1847=function(_0x1a129c,_0x513025){_0x1a129c=_0x1a129c-0x0;var _0x256de3=_0x8471[_0x1a129c];return _0x256de3;};'use strict';var _=require(_0x1847('0x0'));var util=require(_0x1847('0x1'));var moment=require(_0x1847('0x2'));var BPromise=require(_0x1847('0x3'));var rs=require(_0x1847('0x4'));var fs=require('fs');var Redis=require(_0x1847('0x5'));var db=require(_0x1847('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1847('0x7'))(_0x1847('0x8'));var config=require(_0x1847('0x9'));var jayson=require(_0x1847('0xa'));var client=jayson[_0x1847('0xb')][_0x1847('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x15e135,_0x5d9f54,_0x464cfe){return new BPromise(function(_0x565cc6,_0x1dcf0b){return client[_0x1847('0xd')](_0x15e135,_0x464cfe)['then'](function(_0x88a915){logger[_0x1847('0xe')](_0x1847('0xf'),_0x5d9f54,'request\x20sent');logger[_0x1847('0x10')](_0x1847('0x11'),_0x5d9f54,'request\x20sent',JSON['stringify'](_0x88a915));if(_0x88a915[_0x1847('0x12')]){if(_0x88a915[_0x1847('0x12')][_0x1847('0x13')]===0x1f4){logger[_0x1847('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x5d9f54,_0x88a915[_0x1847('0x12')][_0x1847('0x14')]);return _0x1dcf0b(_0x88a915[_0x1847('0x12')]['message']);}logger[_0x1847('0x12')](_0x1847('0xf'),_0x5d9f54,_0x88a915[_0x1847('0x12')][_0x1847('0x14')]);return _0x565cc6(_0x88a915[_0x1847('0x12')]['message']);}else{logger['info'](_0x1847('0xf'),_0x5d9f54,_0x1847('0x15'));_0x565cc6(_0x88a915[_0x1847('0x16')][_0x1847('0x14')]);}})[_0x1847('0x17')](function(_0x2ccc88){logger['error'](_0x1847('0xf'),_0x5d9f54,_0x2ccc88);_0x1dcf0b(_0x2ccc88);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 0aafe80..685ad7b 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3ec=['create','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','index','get','/:id','show','post'];(function(_0x2674ee,_0x54afc9){var _0x193c8f=function(_0x1370f0){while(--_0x1370f0){_0x2674ee['push'](_0x2674ee['shift']());}};_0x193c8f(++_0x54afc9);}(_0xe3ec,0x141));var _0xce3e=function(_0x782bfb,_0x4a3a1d){_0x782bfb=_0x782bfb-0x0;var _0x88f503=_0xe3ec[_0x782bfb];return _0x88f503;};'use strict';var multer=require(_0xce3e('0x0'));var util=require(_0xce3e('0x1'));var path=require(_0xce3e('0x2'));var timeout=require(_0xce3e('0x3'));var express=require(_0xce3e('0x4'));var router=express[_0xce3e('0x5')]();var fs_extra=require(_0xce3e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xce3e('0x7'));var config=require(_0xce3e('0x8'));var controller=require(_0xce3e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xce3e('0xa')]);router[_0xce3e('0xb')](_0xce3e('0xc'),auth['isAuthenticated'](),controller[_0xce3e('0xd')]);router[_0xce3e('0xe')]('/',auth['isAuthenticated'](),controller[_0xce3e('0xf')]);router['put'](_0xce3e('0xc'),auth[_0xce3e('0x10')](),controller[_0xce3e('0x11')]);router[_0xce3e('0x12')]('/:id',auth[_0xce3e('0x10')](),controller[_0xce3e('0x13')]);module[_0xce3e('0x14')]=router; \ No newline at end of file +var _0x74a0=['show','post','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','isAuthenticated','/:id'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x74a0,0x1ca));var _0x074a=function(_0x4049f9,_0x2f13a3){_0x4049f9=_0x4049f9-0x0;var _0x1e88f9=_0x74a0[_0x4049f9];return _0x1e88f9;};'use strict';var multer=require(_0x074a('0x0'));var util=require(_0x074a('0x1'));var path=require(_0x074a('0x2'));var timeout=require('connect-timeout');var express=require(_0x074a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x074a('0x4'));var interaction=require(_0x074a('0x5'));var config=require(_0x074a('0x6'));var controller=require(_0x074a('0x7'));router['get']('/',auth[_0x074a('0x8')](),controller['index']);router['get'](_0x074a('0x9'),auth[_0x074a('0x8')](),controller[_0x074a('0xa')]);router[_0x074a('0xb')]('/',auth[_0x074a('0x8')](),controller[_0x074a('0xc')]);router[_0x074a('0xd')](_0x074a('0x9'),auth[_0x074a('0x8')](),controller[_0x074a('0xe')]);router[_0x074a('0xf')]('/:id',auth[_0x074a('0x8')](),controller[_0x074a('0x10')]);module[_0x074a('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index f60a489..6e63ec9 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 _0x2c20=['STRING','name','TEXT','long','type','select','parse','values','isArray','setDataValue','BOOLEAN','ENUM','sequelize','lodash','exports','getDataValue','alias'];(function(_0x3a2822,_0x6c8006){var _0x42aa88=function(_0xa8a6e9){while(--_0xa8a6e9){_0x3a2822['push'](_0x3a2822['shift']());}};_0x42aa88(++_0x6c8006);}(_0x2c20,0xe9));var _0x02c2=function(_0x10190a,_0x28c8b4){_0x10190a=_0x10190a-0x0;var _0x16d230=_0x2c20[_0x10190a];return _0x16d230;};'use strict';var Sequelize=require(_0x02c2('0x0'));var _=require(_0x02c2('0x1'));module[_0x02c2('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5b247a){return this[_0x02c2('0x3')](_0x02c2('0x4'));}},'alias':{'type':Sequelize[_0x02c2('0x5')],'allowNull':![],'set':function(_0x3c3127){this['setDataValue'](_0x02c2('0x4'),_0x3c3127?_0x3c3127:this[_0x02c2('0x3')](_0x02c2('0x6')));}},'type':{'type':Sequelize[_0x02c2('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x02c2('0x7')](_0x02c2('0x8')),'get':function(){if(this[_0x02c2('0x3')](_0x02c2('0x9'))===_0x02c2('0xa')){return JSON[_0x02c2('0xb')](this[_0x02c2('0x3')]('values'));}else{return this['getDataValue'](_0x02c2('0xc'));}},'set':function(_0x9507a1){if(Array[_0x02c2('0xd')](_0x9507a1)){this[_0x02c2('0xe')](_0x02c2('0xc'),JSON['stringify'](_0x9507a1));}else{this['setDataValue']('values',_0x9507a1);}}},'required':{'type':Sequelize[_0x02c2('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x02c2('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x02c2('0x10')]('voice')}}; \ No newline at end of file +var _0x9777=['VIRTUAL','getDataValue','STRING','setDataValue','alias','name','TEXT','long','type','select','parse','values','isArray','BOOLEAN','ENUM','voice','sequelize','lodash','exports'];(function(_0x3753c8,_0x50a0cf){var _0x5b66b7=function(_0x46b6bd){while(--_0x46b6bd){_0x3753c8['push'](_0x3753c8['shift']());}};_0x5b66b7(++_0x50a0cf);}(_0x9777,0xbb));var _0x7977=function(_0x491f8f,_0x537d78){_0x491f8f=_0x491f8f-0x0;var _0x20a108=_0x9777[_0x491f8f];return _0x20a108;};'use strict';var Sequelize=require(_0x7977('0x0'));var _=require(_0x7977('0x1'));module[_0x7977('0x2')]={'name':{'type':Sequelize[_0x7977('0x3')],'get':function(_0x45634d){return this[_0x7977('0x4')]('alias');}},'alias':{'type':Sequelize[_0x7977('0x5')],'allowNull':![],'set':function(_0x5f30de){this[_0x7977('0x6')](_0x7977('0x7'),_0x5f30de?_0x5f30de:this[_0x7977('0x4')](_0x7977('0x8')));}},'type':{'type':Sequelize[_0x7977('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x7977('0x9')](_0x7977('0xa')),'get':function(){if(this[_0x7977('0x4')](_0x7977('0xb'))===_0x7977('0xc')){return JSON[_0x7977('0xd')](this[_0x7977('0x4')]('values'));}else{return this[_0x7977('0x4')](_0x7977('0xe'));}},'set':function(_0x40be23){if(Array[_0x7977('0xf')](_0x40be23)){this[_0x7977('0x6')](_0x7977('0xe'),JSON['stringify'](_0x40be23));}else{this[_0x7977('0x6')](_0x7977('0xe'),_0x40be23);}}},'required':{'type':Sequelize[_0x7977('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7977('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x7977('0x11')](_0x7977('0x12'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 59d98d4..311ac44 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 _0x5d7c=['merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','find','body','create','sequelize','Sequelize','text','TEXT','INTEGER','switch','defaultValue','addColumn','cm_contacts','cf_%d','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where'];(function(_0x86337d,_0x2b57c3){var _0x22b2c6=function(_0x180d16){while(--_0x180d16){_0x86337d['push'](_0x86337d['shift']());}};_0x22b2c6(++_0x2b57c3);}(_0x5d7c,0x165));var _0xc5d7=function(_0x2b31aa,_0x12f196){_0x2b31aa=_0x2b31aa-0x0;var _0x3ca177=_0x5d7c[_0x2b31aa];return _0x3ca177;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc5d7('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc5d7('0x1'));var BPromise=require(_0xc5d7('0x2'));var Mustache=require(_0xc5d7('0x3'));var util=require(_0xc5d7('0x4'));var path=require(_0xc5d7('0x5'));var sox=require('sox');var csv=require(_0xc5d7('0x6'));var ejs=require(_0xc5d7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc5d7('0x8'));var squel=require(_0xc5d7('0x9'));var crypto=require(_0xc5d7('0xa'));var jsforce=require(_0xc5d7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc5d7('0x6'));var querystring=require(_0xc5d7('0xc'));var Papa=require(_0xc5d7('0xd'));var Redis=require(_0xc5d7('0xe'));var authService=require(_0xc5d7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc5d7('0x10'));var hardwareService=require(_0xc5d7('0x11'));var logger=require(_0xc5d7('0x12'))(_0xc5d7('0x13'));var utils=require(_0xc5d7('0x14'));var config=require(_0xc5d7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc5d7('0x16'))['db'];function respondWithStatusCode(_0x342494,_0x395956){_0x395956=_0x395956||0xcc;return function(_0x42c751){if(_0x42c751){return _0x342494[_0xc5d7('0x17')](_0x395956);}return _0x342494['status'](_0x395956)[_0xc5d7('0x18')]();};}function respondWithResult(_0x5e2036,_0x2a2a7a){_0x2a2a7a=_0x2a2a7a||0xc8;return function(_0x1c5168){if(_0x1c5168){return _0x5e2036[_0xc5d7('0x19')](_0x2a2a7a)[_0xc5d7('0x1a')](_0x1c5168);}};}function respondWithFilteredResult(_0x3113a6,_0x16eeb3){return function(_0x1ebff6){if(_0x1ebff6){var _0x804fc7=typeof _0x16eeb3['offset']===_0xc5d7('0x1b')&&typeof _0x16eeb3[_0xc5d7('0x1c')]===_0xc5d7('0x1b');var _0x569463=_0x1ebff6[_0xc5d7('0x1d')];var _0x37c35d=_0x804fc7?0x0:_0x16eeb3[_0xc5d7('0x1e')];var _0x340052=_0x804fc7?_0x1ebff6[_0xc5d7('0x1d')]:_0x16eeb3[_0xc5d7('0x1e')]+_0x16eeb3['limit'];var _0x15a61a;if(_0x340052>=_0x569463){_0x340052=_0x569463;_0x15a61a=0xc8;}else{_0x15a61a=0xce;}_0x3113a6[_0xc5d7('0x19')](_0x15a61a);return _0x3113a6[_0xc5d7('0x1f')](_0xc5d7('0x20'),_0x37c35d+'-'+_0x340052+'/'+_0x569463)[_0xc5d7('0x1a')](_0x1ebff6);}return null;};}function patchUpdates(_0x155a85){return function(_0x57c3af){try{jsonpatch['apply'](_0x57c3af,_0x155a85,!![]);}catch(_0x33e15e){return BPromise[_0xc5d7('0x21')](_0x33e15e);}return _0x57c3af[_0xc5d7('0x22')]();};}function saveUpdates(_0x2ce496,_0x3b248c){return function(_0x524f3c){if(_0x524f3c){return _0x524f3c[_0xc5d7('0x23')](_0x2ce496)[_0xc5d7('0x24')](function(_0x11a2de){return _0x11a2de;});}return null;};}function removeEntity(_0x55aa5c,_0x1f2563){return function(_0x870a8e){if(_0x870a8e){return _0x870a8e[_0xc5d7('0x25')]()['then'](function(){_0x55aa5c[_0xc5d7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37743e,_0x4bd0fb){return function(_0x4410f0){if(!_0x4410f0){_0x37743e[_0xc5d7('0x17')](0x194);}return _0x4410f0;};}function handleError(_0x40a843,_0x39c656){_0x39c656=_0x39c656||0x1f4;return function(_0x13faca){logger[_0xc5d7('0x26')](_0x13faca[_0xc5d7('0x27')]);if(_0x13faca[_0xc5d7('0x28')]){delete _0x13faca[_0xc5d7('0x28')];}_0x40a843[_0xc5d7('0x19')](_0x39c656)[_0xc5d7('0x29')](_0x13faca);};}exports[_0xc5d7('0x2a')]=function(_0x17ec8a,_0x54e1a7){var _0x199949={},_0x489349={},_0x2e70ef={'count':0x0,'rows':[]};var _0x1b237f=_[_0xc5d7('0x2b')](db[_0xc5d7('0x2c')][_0xc5d7('0x2d')],function(_0x4d8c20){return{'name':_0x4d8c20[_0xc5d7('0x2e')],'type':_0x4d8c20[_0xc5d7('0x2f')][_0xc5d7('0x30')]};});_0x489349[_0xc5d7('0x31')]=_[_0xc5d7('0x32')](_[_0xc5d7('0x2b')](_0x1b237f,_0xc5d7('0x28')),['name']);_0x489349[_0xc5d7('0x33')]=_[_0xc5d7('0x34')](_0x17ec8a['query']);_0x489349[_0xc5d7('0x35')]=_[_0xc5d7('0x36')](_0x489349[_0xc5d7('0x31')],_0x489349[_0xc5d7('0x33')]);_0x199949[_0xc5d7('0x37')]=_[_0xc5d7('0x36')](_0x489349['model'],qs[_0xc5d7('0x38')](_0x17ec8a['query']['fields']));_0x199949[_0xc5d7('0x37')]=_0x199949[_0xc5d7('0x37')][_0xc5d7('0x39')]?_0x199949['attributes']:_0x489349[_0xc5d7('0x31')];if(!_0x17ec8a[_0xc5d7('0x33')][_0xc5d7('0x3a')]('nolimit')){_0x199949['limit']=qs[_0xc5d7('0x1c')](_0x17ec8a[_0xc5d7('0x33')][_0xc5d7('0x1c')]);_0x199949[_0xc5d7('0x1e')]=qs[_0xc5d7('0x1e')](_0x17ec8a[_0xc5d7('0x33')][_0xc5d7('0x1e')]);}_0x199949['order']=qs['sort'](_0x17ec8a['query'][_0xc5d7('0x3b')]);_0x199949['where']=qs[_0xc5d7('0x35')](_[_0xc5d7('0x3c')](_0x17ec8a['query'],_0x489349['filters']),_0x1b237f);if(_0x17ec8a[_0xc5d7('0x33')][_0xc5d7('0x3d')]){_0x199949[_0xc5d7('0x3e')]=_[_0xc5d7('0x3f')](_0x199949[_0xc5d7('0x3e')],{'$or':_[_0xc5d7('0x2b')](_0x1b237f,function(_0x1c70f3){if(_0x1c70f3[_0xc5d7('0x2f')]!==_0xc5d7('0x40')){var _0x70a2f4={};_0x70a2f4[_0x1c70f3[_0xc5d7('0x28')]]={'$like':'%'+_0x17ec8a[_0xc5d7('0x33')][_0xc5d7('0x3d')]+'%'};return _0x70a2f4;}})});}_0x199949=_['merge']({},_0x199949,_0x17ec8a['options']);var _0x1d5b2c={'where':_0x199949['where']};return db[_0xc5d7('0x2c')][_0xc5d7('0x1d')](_0x1d5b2c)[_0xc5d7('0x24')](function(_0x348523){_0x2e70ef[_0xc5d7('0x1d')]=_0x348523;if(_0x17ec8a['query'][_0xc5d7('0x41')]){_0x199949['include']=[{'all':!![]}];}return db[_0xc5d7('0x2c')][_0xc5d7('0x42')](_0x199949);})[_0xc5d7('0x24')](function(_0x5c3bc6){_0x2e70ef[_0xc5d7('0x43')]=_0x5c3bc6;return _0x2e70ef;})[_0xc5d7('0x24')](respondWithFilteredResult(_0x54e1a7,_0x199949))[_0xc5d7('0x44')](handleError(_0x54e1a7,null));};exports[_0xc5d7('0x45')]=function(_0x52b11e,_0x4ae0a1){var _0x5271c4={'raw':!![],'where':{'id':_0x52b11e[_0xc5d7('0x46')]['id']}},_0x51f907={};_0x51f907['model']=_[_0xc5d7('0x34')](db[_0xc5d7('0x2c')][_0xc5d7('0x2d')]);_0x51f907['query']=_[_0xc5d7('0x34')](_0x52b11e['query']);_0x51f907[_0xc5d7('0x35')]=_['intersection'](_0x51f907[_0xc5d7('0x31')],_0x51f907[_0xc5d7('0x33')]);_0x5271c4['attributes']=_[_0xc5d7('0x36')](_0x51f907[_0xc5d7('0x31')],qs[_0xc5d7('0x38')](_0x52b11e[_0xc5d7('0x33')][_0xc5d7('0x38')]));_0x5271c4[_0xc5d7('0x37')]=_0x5271c4[_0xc5d7('0x37')][_0xc5d7('0x39')]?_0x5271c4[_0xc5d7('0x37')]:_0x51f907[_0xc5d7('0x31')];if(_0x52b11e[_0xc5d7('0x33')][_0xc5d7('0x41')]){_0x5271c4['include']=[{'all':!![]}];}_0x5271c4=_[_0xc5d7('0x3f')]({},_0x5271c4,_0x52b11e['options']);return db[_0xc5d7('0x2c')][_0xc5d7('0x47')](_0x5271c4)[_0xc5d7('0x24')](handleEntityNotFound(_0x4ae0a1,null))[_0xc5d7('0x24')](respondWithResult(_0x4ae0a1,null))[_0xc5d7('0x44')](handleError(_0x4ae0a1,null));};exports[_0xc5d7('0x23')]=function(_0x4692d8,_0x435c91){if(_0x4692d8['body']['id']){delete _0x4692d8[_0xc5d7('0x48')]['id'];}return db['CmCustomField'][_0xc5d7('0x47')]({'where':{'id':_0x4692d8['params']['id']}})[_0xc5d7('0x24')](handleEntityNotFound(_0x435c91,null))[_0xc5d7('0x24')](saveUpdates(_0x4692d8['body'],null))['then'](respondWithResult(_0x435c91,null))['catch'](handleError(_0x435c91,null));};exports['destroy']=function(_0x15ff35,_0x30e000){return db['CmCustomField']['find']({'where':{'id':_0x15ff35[_0xc5d7('0x46')]['id']}})[_0xc5d7('0x24')](handleEntityNotFound(_0x30e000,null))[_0xc5d7('0x24')](removeEntity(_0x30e000,null))[_0xc5d7('0x44')](handleError(_0x30e000,null));};exports[_0xc5d7('0x49')]=function(_0x2f507a,_0x11727b){var _0x4c1b4d;return db[_0xc5d7('0x4a')]['transaction'](function(_0x5a941b){return db[_0xc5d7('0x2c')]['create'](_0x2f507a['body'],{'transaction':_0x5a941b})[_0xc5d7('0x24')](function(_0x34cf95){_0x4c1b4d=_0x34cf95;var _0x2b06d={'type':db[_0xc5d7('0x4b')]['TEXT'],'transaction':_0x5a941b};switch(_0x2f507a[_0xc5d7('0x48')][_0xc5d7('0x2f')]){case _0xc5d7('0x4c'):_0x2b06d['type']=db[_0xc5d7('0x4b')][_0xc5d7('0x4d')];break;case'number':_0x2b06d[_0xc5d7('0x2f')]=db[_0xc5d7('0x4b')][_0xc5d7('0x4e')];break;case _0xc5d7('0x4f'):_0x2b06d[_0xc5d7('0x2f')]=db[_0xc5d7('0x4b')]['BOOLEAN'];_0x2b06d[_0xc5d7('0x50')]=![];break;default:}return db[_0xc5d7('0x4a')]['queryInterface'][_0xc5d7('0x51')](_0xc5d7('0x52'),util['format'](_0xc5d7('0x53'),_0x4c1b4d['id']),_0x2b06d);})['then'](function(){return _0x4c1b4d;});})[_0xc5d7('0x24')](respondWithResult(_0x11727b,0xc9))[_0xc5d7('0x44')](handleError(_0x11727b,null));}; \ No newline at end of file +var _0xff91=['show','params','CmCustomField','length','catch','body','find','create','sequelize','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows'];(function(_0x6c85f8,_0x46e518){var _0x5d313e=function(_0x38b8eb){while(--_0x38b8eb){_0x6c85f8['push'](_0x6c85f8['shift']());}};_0x5d313e(++_0x46e518);}(_0xff91,0x116));var _0x1ff9=function(_0x451104,_0x5e979e){_0x451104=_0x451104-0x0;var _0xce5d43=_0xff91[_0x451104];return _0xce5d43;};'use strict';var emlformat=require(_0x1ff9('0x0'));var rimraf=require(_0x1ff9('0x1'));var zipdir=require(_0x1ff9('0x2'));var jsonpatch=require(_0x1ff9('0x3'));var rp=require(_0x1ff9('0x4'));var moment=require(_0x1ff9('0x5'));var BPromise=require(_0x1ff9('0x6'));var Mustache=require(_0x1ff9('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1ff9('0x8'));var ejs=require(_0x1ff9('0x9'));var fs=require('fs');var fs_extra=require(_0x1ff9('0xa'));var _=require(_0x1ff9('0xb'));var squel=require('squel');var crypto=require(_0x1ff9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1ff9('0xd'));var toCsv=require(_0x1ff9('0x8'));var querystring=require('querystring');var Papa=require(_0x1ff9('0xe'));var Redis=require(_0x1ff9('0xf'));var authService=require(_0x1ff9('0x10'));var qs=require(_0x1ff9('0x11'));var as=require(_0x1ff9('0x12'));var hardwareService=require(_0x1ff9('0x13'));var logger=require(_0x1ff9('0x14'))(_0x1ff9('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1ff9('0x16'))['db'];function respondWithStatusCode(_0x4cbc3c,_0x2e6c6f){_0x2e6c6f=_0x2e6c6f||0xcc;return function(_0x2c1f40){if(_0x2c1f40){return _0x4cbc3c[_0x1ff9('0x17')](_0x2e6c6f);}return _0x4cbc3c[_0x1ff9('0x18')](_0x2e6c6f)[_0x1ff9('0x19')]();};}function respondWithResult(_0x4e119c,_0x40721d){_0x40721d=_0x40721d||0xc8;return function(_0x504405){if(_0x504405){return _0x4e119c[_0x1ff9('0x18')](_0x40721d)[_0x1ff9('0x1a')](_0x504405);}};}function respondWithFilteredResult(_0x3d2e91,_0x8a9817){return function(_0x400e83){if(_0x400e83){var _0x3ff97a=typeof _0x8a9817[_0x1ff9('0x1b')]==='undefined'&&typeof _0x8a9817['limit']===_0x1ff9('0x1c');var _0xacac60=_0x400e83[_0x1ff9('0x1d')];var _0x1a7822=_0x3ff97a?0x0:_0x8a9817[_0x1ff9('0x1b')];var _0x3ec761=_0x3ff97a?_0x400e83[_0x1ff9('0x1d')]:_0x8a9817[_0x1ff9('0x1b')]+_0x8a9817[_0x1ff9('0x1e')];var _0x347660;if(_0x3ec761>=_0xacac60){_0x3ec761=_0xacac60;_0x347660=0xc8;}else{_0x347660=0xce;}_0x3d2e91['status'](_0x347660);return _0x3d2e91['set'](_0x1ff9('0x1f'),_0x1a7822+'-'+_0x3ec761+'/'+_0xacac60)[_0x1ff9('0x1a')](_0x400e83);}return null;};}function patchUpdates(_0x4224b8){return function(_0xba4379){try{jsonpatch[_0x1ff9('0x20')](_0xba4379,_0x4224b8,!![]);}catch(_0x9dcdac){return BPromise[_0x1ff9('0x21')](_0x9dcdac);}return _0xba4379[_0x1ff9('0x22')]();};}function saveUpdates(_0x556eaf,_0x5b7f37){return function(_0x3bb662){if(_0x3bb662){return _0x3bb662[_0x1ff9('0x23')](_0x556eaf)[_0x1ff9('0x24')](function(_0x35441c){return _0x35441c;});}return null;};}function removeEntity(_0x28c62d,_0x149f8e){return function(_0x5754bf){if(_0x5754bf){return _0x5754bf[_0x1ff9('0x25')]()[_0x1ff9('0x24')](function(){_0x28c62d['status'](0xcc)[_0x1ff9('0x19')]();});}};}function handleEntityNotFound(_0x27a0be,_0x1cc7b6){return function(_0x2ec56a){if(!_0x2ec56a){_0x27a0be[_0x1ff9('0x17')](0x194);}return _0x2ec56a;};}function handleError(_0x1bb77a,_0x1d3bc3){_0x1d3bc3=_0x1d3bc3||0x1f4;return function(_0x291c1c){logger[_0x1ff9('0x26')](_0x291c1c['stack']);if(_0x291c1c[_0x1ff9('0x27')]){delete _0x291c1c['name'];}_0x1bb77a['status'](_0x1d3bc3)['send'](_0x291c1c);};}exports[_0x1ff9('0x28')]=function(_0x8a463e,_0x4bbbe8){var _0x18759a={},_0x1c3049={},_0x3f7b6a={'count':0x0,'rows':[]};var _0x59c758=_[_0x1ff9('0x29')](db['CmCustomField'][_0x1ff9('0x2a')],function(_0x50830b){return{'name':_0x50830b[_0x1ff9('0x2b')],'type':_0x50830b[_0x1ff9('0x2c')][_0x1ff9('0x2d')]};});_0x1c3049[_0x1ff9('0x2e')]=_[_0x1ff9('0x2f')](_[_0x1ff9('0x29')](_0x59c758,'name'),['name']);_0x1c3049[_0x1ff9('0x30')]=_[_0x1ff9('0x31')](_0x8a463e[_0x1ff9('0x30')]);_0x1c3049['filters']=_[_0x1ff9('0x32')](_0x1c3049[_0x1ff9('0x2e')],_0x1c3049[_0x1ff9('0x30')]);_0x18759a[_0x1ff9('0x33')]=_[_0x1ff9('0x32')](_0x1c3049['model'],qs[_0x1ff9('0x34')](_0x8a463e['query'][_0x1ff9('0x34')]));_0x18759a['attributes']=_0x18759a[_0x1ff9('0x33')]['length']?_0x18759a['attributes']:_0x1c3049['model'];if(!_0x8a463e[_0x1ff9('0x30')][_0x1ff9('0x35')](_0x1ff9('0x36'))){_0x18759a[_0x1ff9('0x1e')]=qs[_0x1ff9('0x1e')](_0x8a463e[_0x1ff9('0x30')][_0x1ff9('0x1e')]);_0x18759a[_0x1ff9('0x1b')]=qs[_0x1ff9('0x1b')](_0x8a463e[_0x1ff9('0x30')][_0x1ff9('0x1b')]);}_0x18759a['order']=qs[_0x1ff9('0x37')](_0x8a463e[_0x1ff9('0x30')][_0x1ff9('0x37')]);_0x18759a['where']=qs[_0x1ff9('0x38')](_[_0x1ff9('0x39')](_0x8a463e[_0x1ff9('0x30')],_0x1c3049[_0x1ff9('0x38')]),_0x59c758);if(_0x8a463e['query'][_0x1ff9('0x3a')]){_0x18759a[_0x1ff9('0x3b')]=_[_0x1ff9('0x3c')](_0x18759a[_0x1ff9('0x3b')],{'$or':_['map'](_0x59c758,function(_0x178a0d){if(_0x178a0d[_0x1ff9('0x2c')]!=='VIRTUAL'){var _0x45d37f={};_0x45d37f[_0x178a0d[_0x1ff9('0x27')]]={'$like':'%'+_0x8a463e[_0x1ff9('0x30')]['filter']+'%'};return _0x45d37f;}})});}_0x18759a=_[_0x1ff9('0x3c')]({},_0x18759a,_0x8a463e[_0x1ff9('0x3d')]);var _0x3ddef2={'where':_0x18759a[_0x1ff9('0x3b')]};return db['CmCustomField'][_0x1ff9('0x1d')](_0x3ddef2)[_0x1ff9('0x24')](function(_0x58c026){_0x3f7b6a['count']=_0x58c026;if(_0x8a463e[_0x1ff9('0x30')][_0x1ff9('0x3e')]){_0x18759a[_0x1ff9('0x3f')]=[{'all':!![]}];}return db['CmCustomField'][_0x1ff9('0x40')](_0x18759a);})[_0x1ff9('0x24')](function(_0x50148c){_0x3f7b6a[_0x1ff9('0x41')]=_0x50148c;return _0x3f7b6a;})['then'](respondWithFilteredResult(_0x4bbbe8,_0x18759a))['catch'](handleError(_0x4bbbe8,null));};exports[_0x1ff9('0x42')]=function(_0x18ddea,_0x1105d6){var _0x2b5b77={'raw':!![],'where':{'id':_0x18ddea[_0x1ff9('0x43')]['id']}},_0x221bc1={};_0x221bc1['model']=_[_0x1ff9('0x31')](db[_0x1ff9('0x44')]['rawAttributes']);_0x221bc1[_0x1ff9('0x30')]=_[_0x1ff9('0x31')](_0x18ddea[_0x1ff9('0x30')]);_0x221bc1[_0x1ff9('0x38')]=_[_0x1ff9('0x32')](_0x221bc1[_0x1ff9('0x2e')],_0x221bc1[_0x1ff9('0x30')]);_0x2b5b77[_0x1ff9('0x33')]=_[_0x1ff9('0x32')](_0x221bc1['model'],qs[_0x1ff9('0x34')](_0x18ddea[_0x1ff9('0x30')][_0x1ff9('0x34')]));_0x2b5b77[_0x1ff9('0x33')]=_0x2b5b77[_0x1ff9('0x33')][_0x1ff9('0x45')]?_0x2b5b77[_0x1ff9('0x33')]:_0x221bc1['model'];if(_0x18ddea['query'][_0x1ff9('0x3e')]){_0x2b5b77['include']=[{'all':!![]}];}_0x2b5b77=_[_0x1ff9('0x3c')]({},_0x2b5b77,_0x18ddea[_0x1ff9('0x3d')]);return db['CmCustomField']['find'](_0x2b5b77)[_0x1ff9('0x24')](handleEntityNotFound(_0x1105d6,null))[_0x1ff9('0x24')](respondWithResult(_0x1105d6,null))[_0x1ff9('0x46')](handleError(_0x1105d6,null));};exports[_0x1ff9('0x23')]=function(_0x32d458,_0x3c8925){if(_0x32d458[_0x1ff9('0x47')]['id']){delete _0x32d458['body']['id'];}return db[_0x1ff9('0x44')][_0x1ff9('0x48')]({'where':{'id':_0x32d458[_0x1ff9('0x43')]['id']}})[_0x1ff9('0x24')](handleEntityNotFound(_0x3c8925,null))['then'](saveUpdates(_0x32d458[_0x1ff9('0x47')],null))['then'](respondWithResult(_0x3c8925,null))[_0x1ff9('0x46')](handleError(_0x3c8925,null));};exports[_0x1ff9('0x25')]=function(_0x1d3e6f,_0x3db062){return db[_0x1ff9('0x44')][_0x1ff9('0x48')]({'where':{'id':_0x1d3e6f['params']['id']}})[_0x1ff9('0x24')](handleEntityNotFound(_0x3db062,null))[_0x1ff9('0x24')](removeEntity(_0x3db062,null))[_0x1ff9('0x46')](handleError(_0x3db062,null));};exports[_0x1ff9('0x49')]=function(_0x1148e8,_0x3e9b77){var _0x178649;return db[_0x1ff9('0x4a')]['transaction'](function(_0x3c93f5){return db[_0x1ff9('0x44')][_0x1ff9('0x49')](_0x1148e8[_0x1ff9('0x47')],{'transaction':_0x3c93f5})[_0x1ff9('0x24')](function(_0x1d9e49){_0x178649=_0x1d9e49;var _0xad6a43={'type':db[_0x1ff9('0x4b')]['TEXT'],'transaction':_0x3c93f5};switch(_0x1148e8[_0x1ff9('0x47')][_0x1ff9('0x2c')]){case _0x1ff9('0x4c'):_0xad6a43['type']=db['Sequelize'][_0x1ff9('0x4d')];break;case _0x1ff9('0x4e'):_0xad6a43[_0x1ff9('0x2c')]=db[_0x1ff9('0x4b')][_0x1ff9('0x4f')];break;case _0x1ff9('0x50'):_0xad6a43[_0x1ff9('0x2c')]=db[_0x1ff9('0x4b')][_0x1ff9('0x51')];_0xad6a43[_0x1ff9('0x52')]=![];break;default:}return db['sequelize']['queryInterface'][_0x1ff9('0x53')](_0x1ff9('0x54'),util['format'](_0x1ff9('0x55'),_0x178649['id']),_0xad6a43);})[_0x1ff9('0x24')](function(){return _0x178649;});})['then'](respondWithResult(_0x3e9b77,0xc9))[_0x1ff9('0x46')](handleError(_0x3e9b77,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 14d2370..32fc88c 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 _0x7629=['exports','define','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x59e446,_0x573a49){var _0x3ec609=function(_0x1ce15c){while(--_0x1ce15c){_0x59e446['push'](_0x59e446['shift']());}};_0x3ec609(++_0x573a49);}(_0x7629,0xdb));var _0x9762=function(_0x1cc684,_0x2c42b1){_0x1cc684=_0x1cc684-0x0;var _0xbbdf77=_0x7629[_0x1cc684];return _0xbbdf77;};'use strict';var _=require(_0x9762('0x0'));var util=require(_0x9762('0x1'));var logger=require(_0x9762('0x2'))(_0x9762('0x3'));var moment=require(_0x9762('0x4'));var BPromise=require(_0x9762('0x5'));var rp=require(_0x9762('0x6'));var fs=require('fs');var path=require(_0x9762('0x7'));var rimraf=require('rimraf');var config=require(_0x9762('0x8'));var attributes=require('./cmCustomField.attributes');module[_0x9762('0x9')]=function(_0x1cdf98,_0x16228b){return _0x1cdf98[_0x9762('0xa')]('CmCustomField',attributes,{'tableName':_0x9762('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2130=['exports','lodash','util','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x373893,_0x20f9aa){var _0x345720=function(_0x3d3e80){while(--_0x3d3e80){_0x373893['push'](_0x373893['shift']());}};_0x345720(++_0x20f9aa);}(_0x2130,0x10f));var _0x0213=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x2130[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x0213('0x0'));var util=require(_0x0213('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0213('0x2'));var config=require(_0x0213('0x3'));var attributes=require(_0x0213('0x4'));module[_0x0213('0x5')]=function(_0x49a273,_0x83771){return _0x49a273['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 5ea4290..c1ec58e 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 _0xcfdc=['error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x365038,_0x579866){var _0xbb31e6=function(_0x5a2b13){while(--_0x5a2b13){_0x365038['push'](_0x365038['shift']());}};_0xbb31e6(++_0x579866);}(_0xcfdc,0x86));var _0xccfd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcfdc[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xccfd('0x0'));var util=require(_0xccfd('0x1'));var moment=require(_0xccfd('0x2'));var BPromise=require(_0xccfd('0x3'));var rs=require(_0xccfd('0x4'));var fs=require('fs');var Redis=require(_0xccfd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xccfd('0x6'));var logger=require(_0xccfd('0x7'))(_0xccfd('0x8'));var config=require(_0xccfd('0x9'));var jayson=require(_0xccfd('0xa'));var client=jayson[_0xccfd('0xb')][_0xccfd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5077ca,_0x547c5c,_0x180e4e){return new BPromise(function(_0x3f9b8b,_0x1846a3){return client[_0xccfd('0xd')](_0x5077ca,_0x180e4e)['then'](function(_0x1396ee){logger[_0xccfd('0xe')](_0xccfd('0xf'),_0x547c5c,_0xccfd('0x10'));logger[_0xccfd('0x11')](_0xccfd('0x12'),_0x547c5c,'request\x20sent',JSON[_0xccfd('0x13')](_0x1396ee));if(_0x1396ee[_0xccfd('0x14')]){if(_0x1396ee['error']['code']===0x1f4){logger[_0xccfd('0x14')](_0xccfd('0xf'),_0x547c5c,_0x1396ee[_0xccfd('0x14')]['message']);return _0x1846a3(_0x1396ee[_0xccfd('0x14')][_0xccfd('0x15')]);}logger[_0xccfd('0x14')](_0xccfd('0xf'),_0x547c5c,_0x1396ee[_0xccfd('0x14')][_0xccfd('0x15')]);return _0x3f9b8b(_0x1396ee[_0xccfd('0x14')]['message']);}else{logger[_0xccfd('0xe')](_0xccfd('0xf'),_0x547c5c,_0xccfd('0x10'));_0x3f9b8b(_0x1396ee['result'][_0xccfd('0x15')]);}})['catch'](function(_0x638612){logger['error'](_0xccfd('0xf'),_0x547c5c,_0x638612);_0x1846a3(_0x638612);});});} \ No newline at end of file +var _0x4a64=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','util'];(function(_0x2f7bec,_0x27b9f6){var _0x5d1c2e=function(_0x442b0a){while(--_0x442b0a){_0x2f7bec['push'](_0x2f7bec['shift']());}};_0x5d1c2e(++_0x27b9f6);}(_0x4a64,0x1cd));var _0x44a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4a64[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x44a6('0x0'));var moment=require(_0x44a6('0x1'));var BPromise=require(_0x44a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x44a6('0x3'));var db=require(_0x44a6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x44a6('0x5'))(_0x44a6('0x6'));var config=require(_0x44a6('0x7'));var jayson=require(_0x44a6('0x8'));var client=jayson[_0x44a6('0x9')][_0x44a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58e312,_0x49447c,_0x26f45d){return new BPromise(function(_0x248c43,_0x2fb6db){return client[_0x44a6('0xb')](_0x58e312,_0x26f45d)[_0x44a6('0xc')](function(_0x5a51ec){logger[_0x44a6('0xd')](_0x44a6('0xe'),_0x49447c,_0x44a6('0xf'));logger[_0x44a6('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x49447c,'request\x20sent',JSON[_0x44a6('0x11')](_0x5a51ec));if(_0x5a51ec[_0x44a6('0x12')]){if(_0x5a51ec['error'][_0x44a6('0x13')]===0x1f4){logger[_0x44a6('0x12')](_0x44a6('0xe'),_0x49447c,_0x5a51ec['error']['message']);return _0x2fb6db(_0x5a51ec[_0x44a6('0x12')][_0x44a6('0x14')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x49447c,_0x5a51ec[_0x44a6('0x12')][_0x44a6('0x14')]);return _0x248c43(_0x5a51ec['error']['message']);}else{logger[_0x44a6('0xd')](_0x44a6('0xe'),_0x49447c,_0x44a6('0xf'));_0x248c43(_0x5a51ec['result'][_0x44a6('0x14')]);}})['catch'](function(_0x2b11a7){logger['error'](_0x44a6('0xe'),_0x49447c,_0x2b11a7);_0x2fb6db(_0x2b11a7);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 95fcf6b..0698cdb 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 _0x1115=['post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x432d96,_0x3a7c6f){var _0x34ef66=function(_0x79e63c){while(--_0x79e63c){_0x432d96['push'](_0x432d96['shift']());}};_0x34ef66(++_0x3a7c6f);}(_0x1115,0x1b6));var _0x5111=function(_0x40ba0a,_0x38cd5e){_0x40ba0a=_0x40ba0a-0x0;var _0x17c58e=_0x1115[_0x40ba0a];return _0x17c58e;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var fs_extra=require(_0x5111('0x5'));var auth=require(_0x5111('0x6'));var interaction=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x5111('0x9')](),controller[_0x5111('0xa')]);router['get'](_0x5111('0xb'),auth[_0x5111('0x9')](),controller['show']);router[_0x5111('0xc')]('/',auth['isAuthenticated'](),controller[_0x5111('0xd')]);router[_0x5111('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5111('0xf')]);router['delete'](_0x5111('0xb'),auth['isAuthenticated'](),controller[_0x5111('0x10')]);module[_0x5111('0x11')]=router; \ No newline at end of file +var _0xd6bb=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xd6bb,0x1cc));var _0xbd6b=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0xd6bb[_0x5e6bec];return _0x5dc5cf;};'use strict';var multer=require(_0xbd6b('0x0'));var util=require('util');var path=require(_0xbd6b('0x1'));var timeout=require(_0xbd6b('0x2'));var express=require(_0xbd6b('0x3'));var router=express[_0xbd6b('0x4')]();var fs_extra=require(_0xbd6b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbd6b('0x6'));var config=require(_0xbd6b('0x7'));var controller=require(_0xbd6b('0x8'));router['get']('/',auth[_0xbd6b('0x9')](),controller[_0xbd6b('0xa')]);router[_0xbd6b('0xb')](_0xbd6b('0xc'),auth[_0xbd6b('0x9')](),controller[_0xbd6b('0xd')]);router[_0xbd6b('0xe')]('/',auth[_0xbd6b('0x9')](),controller[_0xbd6b('0xf')]);router[_0xbd6b('0x10')](_0xbd6b('0xc'),auth['isAuthenticated'](),controller[_0xbd6b('0x11')]);router[_0xbd6b('0x12')]('/:id',auth[_0xbd6b('0x9')](),controller[_0xbd6b('0x13')]);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 02d7231..af6ab2c 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 _0x51ab=['exports','STRING','DATE','format','INTEGER','UNSIGNED','BOOLEAN','contactListQueue','sequelize'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x51ab,0xfb));var _0xb51a=function(_0x44825f,_0x1f4ce2){_0x44825f=_0x44825f-0x0;var _0x1c1f10=_0x51ab[_0x44825f];return _0x1c1f10;};'use strict';var moment=require('moment');var Sequelize=require(_0xb51a('0x0'));module[_0xb51a('0x1')]={'phone':{'type':Sequelize[_0xb51a('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb51a('0x3')],'defaultValue':moment()[_0xb51a('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb51a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb51a('0x3')]},'priority':{'type':Sequelize[_0xb51a('0x5')](0x2)[_0xb51a('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb51a('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb51a('0x5')],'unique':_0xb51a('0x8')},'ListId':{'type':Sequelize[_0xb51a('0x5')],'unique':_0xb51a('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xb51a('0x5')],'unique':_0xb51a('0x8')},'CampaignId':{'type':Sequelize[_0xb51a('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xb51a('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb51a('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xb51a('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x2d85=['INTEGER','UNSIGNED','contactListQueue','STRING','exports','BOOLEAN','DATE'];(function(_0x3760fb,_0x459816){var _0x39040e=function(_0x141361){while(--_0x141361){_0x3760fb['push'](_0x3760fb['shift']());}};_0x39040e(++_0x459816);}(_0x2d85,0x10e));var _0x52d8=function(_0x4efb90,_0x493995){_0x4efb90=_0x4efb90-0x0;var _0x524a80=_0x2d85[_0x4efb90];return _0x524a80;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x52d8('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x52d8('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x52d8('0x2')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x52d8('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x52d8('0x3')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x52d8('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x52d8('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x52d8('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x52d8('0x1')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x52d8('0x3')],'unique':_0x52d8('0x5')},'ListId':{'type':Sequelize[_0x52d8('0x3')],'unique':_0x52d8('0x5')},'UserId':{'type':Sequelize[_0x52d8('0x3')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x52d8('0x5')},'CampaignId':{'type':Sequelize[_0x52d8('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x52d8('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x52d8('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x52d8('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x52d8('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x52d8('0x3')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x52d8('0x6')]},'recallmeNotifiedDate':{'type':Sequelize[_0x52d8('0x2')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 6c7102f..b11a2e3 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 _0xcca7=['CmCompany','Company','List','Queue','dialActive','getPreviewRecall','transaction','LOCK','CmList','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','utcOffset','timezones','moment','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','sendStatus','error','send','index','CmHopper','rawAttributes','fieldName','type','key','model','map','query','keys','filters','concat','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$iLike','$notILike','$overlap','$contains','$any','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','name','filter','then','includeAll','include','findAll','rows','show','params','options','catch','create','body','update','find','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','createdAt','updatedAt','campaign','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','value','direction','prev','isEmpty','hopperIds','priority','ASC','dialOrderByScheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','literal','findOne','scheduledat','recallme','UPDATE','Contact'];(function(_0x73e4cf,_0x2a8375){var _0x1e1bf8=function(_0xca0967){while(--_0xca0967){_0x73e4cf['push'](_0x73e4cf['shift']());}};_0x1e1bf8(++_0x2a8375);}(_0xcca7,0x1aa));var _0x7cca=function(_0x472716,_0x478fc7){_0x472716=_0x472716-0x0;var _0x885636=_0xcca7[_0x472716];return _0x885636;};'use strict';var moment=require(_0x7cca('0x0'));var _=require(_0x7cca('0x1'));var qs=require(_0x7cca('0x2'));var logger=require(_0x7cca('0x3'))('api');var shared=require('../../config/environment');var db=require(_0x7cca('0x4'))['db'];function respondWithResult(_0x533b00,_0x3b86a4){_0x3b86a4=_0x3b86a4||0xc8;return function(_0x9523f7){if(_0x9523f7){return _0x533b00[_0x7cca('0x5')](_0x3b86a4)[_0x7cca('0x6')](_0x9523f7);}};}function respondWithFilteredResult(_0x1c6c95,_0xe70805){return function(_0x5aec51){if(_0x5aec51){var _0x508f29=typeof _0xe70805[_0x7cca('0x7')]===_0x7cca('0x8')&&typeof _0xe70805[_0x7cca('0x9')]===_0x7cca('0x8');var _0x18bac4=_0x5aec51[_0x7cca('0xa')];var _0x20ffa9=_0x508f29?0x0:_0xe70805[_0x7cca('0x7')];var _0x27323a=_0x508f29?_0x5aec51[_0x7cca('0xa')]:_0xe70805['offset']+_0xe70805[_0x7cca('0x9')];var _0x464911;if(_0x27323a>=_0x18bac4){_0x27323a=_0x18bac4;_0x464911=0xc8;}else{_0x464911=0xce;}_0x1c6c95[_0x7cca('0x5')](_0x464911);return _0x1c6c95[_0x7cca('0xb')](_0x7cca('0xc'),_0x20ffa9+'-'+_0x27323a+'/'+_0x18bac4)['json'](_0x5aec51);}return null;};}function saveUpdates(_0x2a14cc,_0x41e0a2){return function(_0x2854c7){if(_0x2854c7){return _0x2854c7['update'](_0x2a14cc)['then'](function(_0x8ea157){return _0x8ea157;});}return null;};}function handleEntityNotFound(_0x20c1b2,_0x27d671){return function(_0x847cce){if(!_0x847cce){_0x20c1b2[_0x7cca('0xd')](0x194);}return _0x847cce;};}function handleError(_0x3d3141,_0x45143d){_0x45143d=_0x45143d||0x1f4;return function(_0x5a357d){logger[_0x7cca('0xe')](_0x5a357d['stack']);if(_0x5a357d['name']){delete _0x5a357d['name'];}_0x3d3141[_0x7cca('0x5')](_0x45143d)[_0x7cca('0xf')](_0x5a357d);};}exports[_0x7cca('0x10')]=function(_0x33db6b,_0x44294b){var _0x5e7c42={},_0xb35e1d={},_0x4fba9e={'count':0x0,'rows':[]};var _0x5d47f8=_['map'](db[_0x7cca('0x11')][_0x7cca('0x12')],function(_0x2beb6c){return{'name':_0x2beb6c[_0x7cca('0x13')],'type':_0x2beb6c[_0x7cca('0x14')][_0x7cca('0x15')]};});_0xb35e1d[_0x7cca('0x16')]=_[_0x7cca('0x17')](_0x5d47f8,'name');_0xb35e1d[_0x7cca('0x18')]=_[_0x7cca('0x19')](_0x33db6b[_0x7cca('0x18')]);_0xb35e1d[_0x7cca('0x1a')]=_['intersection'](_0xb35e1d[_0x7cca('0x16')],_0xb35e1d[_0x7cca('0x18')]);_0xb35e1d[_0x7cca('0x1a')]=_[_0x7cca('0x1b')](_0xb35e1d[_0x7cca('0x1a')],[_0x7cca('0x1c'),_0x7cca('0x1d'),_0x7cca('0x1e'),'$gte',_0x7cca('0x1f'),_0x7cca('0x20'),_0x7cca('0x21'),_0x7cca('0x22'),_0x7cca('0x23'),_0x7cca('0x24'),_0x7cca('0x25'),_0x7cca('0x26'),'$notIn',_0x7cca('0x27'),'$notLike',_0x7cca('0x28'),_0x7cca('0x29'),'$like',_0x7cca('0x2a'),_0x7cca('0x2b'),'$contained',_0x7cca('0x2c')]);_0x5e7c42[_0x7cca('0x2d')]=_[_0x7cca('0x2e')](_0xb35e1d['model'],qs['fields'](_0x33db6b[_0x7cca('0x18')][_0x7cca('0x2f')]));_0x5e7c42[_0x7cca('0x2d')]=_0x5e7c42[_0x7cca('0x2d')][_0x7cca('0x30')]?_0x5e7c42[_0x7cca('0x2d')]:_0xb35e1d[_0x7cca('0x16')];if(!_0x33db6b['query']['hasOwnProperty'](_0x7cca('0x31'))){_0x5e7c42[_0x7cca('0x9')]=qs[_0x7cca('0x9')](_0x33db6b['query'][_0x7cca('0x9')]);_0x5e7c42['offset']=qs[_0x7cca('0x7')](_0x33db6b[_0x7cca('0x18')][_0x7cca('0x7')]);}_0x5e7c42[_0x7cca('0x32')]=qs['sort'](_0x33db6b[_0x7cca('0x18')][_0x7cca('0x33')]);_0x5e7c42[_0x7cca('0x34')]=qs['filters'](_['pick'](_0x33db6b['query'],_0xb35e1d[_0x7cca('0x1a')]),_0x5d47f8);if(_0x33db6b[_0x7cca('0x18')]['filter']){_0x5e7c42[_0x7cca('0x34')]=_[_0x7cca('0x35')](_0x5e7c42[_0x7cca('0x34')],{'$or':_[_0x7cca('0x17')](_0x5d47f8,function(_0xc10d78){if(_0xc10d78[_0x7cca('0x14')]!==_0x7cca('0x36')){var _0x56b9e0={};_0x56b9e0[_0xc10d78[_0x7cca('0x37')]]={'$like':'%'+_0x33db6b[_0x7cca('0x18')][_0x7cca('0x38')]+'%'};return _0x56b9e0;}})});}_0x5e7c42=_[_0x7cca('0x35')]({},_0x5e7c42,_0x33db6b['options']);var _0x213e4f={'where':_0x5e7c42[_0x7cca('0x34')]};return db[_0x7cca('0x11')]['count'](_0x213e4f)[_0x7cca('0x39')](function(_0x4bc7a7){_0x4fba9e[_0x7cca('0xa')]=_0x4bc7a7;if(_0x33db6b[_0x7cca('0x18')][_0x7cca('0x3a')]){_0x5e7c42[_0x7cca('0x3b')]=[{'all':!![]}];}return db[_0x7cca('0x11')][_0x7cca('0x3c')](_0x5e7c42);})[_0x7cca('0x39')](function(_0x3b5aa3){_0x4fba9e[_0x7cca('0x3d')]=_0x3b5aa3;return _0x4fba9e;})['then'](respondWithFilteredResult(_0x44294b,_0x5e7c42))['catch'](handleError(_0x44294b,null));};exports[_0x7cca('0x3e')]=function(_0x3365b6,_0x5cb715){var _0x48d87f={'raw':!![],'where':{'id':_0x3365b6[_0x7cca('0x3f')]['id']}},_0x3c6d1d={};_0x3c6d1d[_0x7cca('0x16')]=_[_0x7cca('0x19')](db[_0x7cca('0x11')]['rawAttributes']);_0x3c6d1d[_0x7cca('0x18')]=_['keys'](_0x3365b6['query']);_0x3c6d1d[_0x7cca('0x1a')]=_[_0x7cca('0x2e')](_0x3c6d1d['model'],_0x3c6d1d[_0x7cca('0x18')]);_0x48d87f['attributes']=_[_0x7cca('0x2e')](_0x3c6d1d[_0x7cca('0x16')],qs[_0x7cca('0x2f')](_0x3365b6['query'][_0x7cca('0x2f')]));_0x48d87f[_0x7cca('0x2d')]=_0x48d87f[_0x7cca('0x2d')][_0x7cca('0x30')]?_0x48d87f['attributes']:_0x3c6d1d[_0x7cca('0x16')];if(_0x3365b6[_0x7cca('0x18')][_0x7cca('0x3a')]){_0x48d87f[_0x7cca('0x3b')]=[{'all':!![]}];}_0x48d87f=_[_0x7cca('0x35')]({},_0x48d87f,_0x3365b6[_0x7cca('0x40')]);return db['CmHopper']['find'](_0x48d87f)['then'](handleEntityNotFound(_0x5cb715,null))['then'](respondWithResult(_0x5cb715,null))[_0x7cca('0x41')](handleError(_0x5cb715,null));};exports['create']=function(_0x51e564,_0x272828){return db[_0x7cca('0x11')][_0x7cca('0x42')](_0x51e564[_0x7cca('0x43')],{})[_0x7cca('0x39')](respondWithResult(_0x272828,0xc9))['catch'](handleError(_0x272828,null));};exports[_0x7cca('0x44')]=function(_0x345182,_0xba19aa){if(_0x345182[_0x7cca('0x43')]['id']){delete _0x345182[_0x7cca('0x43')]['id'];}return db[_0x7cca('0x11')][_0x7cca('0x45')]({'where':{'id':_0x345182[_0x7cca('0x3f')]['id']}})[_0x7cca('0x39')](handleEntityNotFound(_0xba19aa,null))[_0x7cca('0x39')](saveUpdates(_0x345182[_0x7cca('0x43')],null))['then'](respondWithResult(_0xba19aa,null))['catch'](handleError(_0xba19aa,null));};exports[_0x7cca('0x46')]=function(_0x5913eb,_0x40eb40){return db[_0x7cca('0x11')][_0x7cca('0x46')]()[_0x7cca('0x39')](respondWithResult(_0x40eb40,null))[_0x7cca('0x41')](handleError(_0x40eb40,null));};exports[_0x7cca('0x47')]=function(_0x184b56,_0xe0059e){var _0x1bb80b;var _0x3eb069=_0x184b56['params']['id'];return db[_0x7cca('0x11')][_0x7cca('0x45')]({'where':{'id':_0x184b56[_0x7cca('0x3f')]['id']}})[_0x7cca('0x39')](handleEntityNotFound(_0xe0059e,null))[_0x7cca('0x39')](function(_0x41b932){if(_0x41b932){return _0x41b932[_0x7cca('0x47')]()[_0x7cca('0x39')](function(_0x218114){return _0x218114;});}})[_0x7cca('0x39')](function(_0x3a0ce8){_0x1bb80b=_0x3a0ce8;if(_0x3a0ce8){if(_0x3a0ce8[_0x7cca('0x48')]||_0x3a0ce8[_0x7cca('0x49')]){return db[_0x3a0ce8[_0x7cca('0x48')]?_0x7cca('0x4a'):_0x7cca('0x4b')][_0x7cca('0x45')]({'where':{'id':_0x3a0ce8[_0x7cca('0x48')]?_0x3a0ce8[_0x7cca('0x48')]:_0x3a0ce8[_0x7cca('0x49')]},'attributes':['id',_0x7cca('0x37')],'raw':!![]});}}})[_0x7cca('0x39')](function(_0xc72da3){var _0x2a6f61={};if(_0xc72da3){_[_0x7cca('0x35')](_0x2a6f61,_[_0x7cca('0x4c')](_0x1bb80b['dataValues'],[_0x7cca('0x4d'),_0x7cca('0x4e'),'id']));_0x2a6f61['state']=0x15;_0x2a6f61['statedesc']='deleted';_0x2a6f61[_0x7cca('0x4f')]=_0xc72da3[_0x7cca('0x37')];_0x2a6f61['membername']=_0x184b56[_0x7cca('0x50')][_0x7cca('0x37')];_0x2a6f61['UserId']=_0x184b56[_0x7cca('0x50')]['id'];_0x2a6f61['deleted']=!![];_0x2a6f61[_0x7cca('0x51')]=moment()[_0x7cca('0x52')](_0x7cca('0x53'));_0x2a6f61[_0x7cca('0x54')]=_0x1bb80b[_0x7cca('0x55')];_0x2a6f61[_0x7cca('0x56')]=_0x1bb80b[_0x7cca('0x48')]?_0x7cca('0x57'):_0x7cca('0x58');return db[_0x7cca('0x59')][_0x7cca('0x45')]({'where':{'id':_0x2a6f61[_0x7cca('0x5a')]},'attributes':[_0x7cca('0x5b'),'lastName']})[_0x7cca('0x39')](function(_0x51e215){if(!_[_0x7cca('0x5c')](_0xe0059e)&&!_['isNil'](_0x51e215[_0x7cca('0x5b')])){_0x2a6f61[_0x7cca('0x5d')]=_0x51e215[_0x7cca('0x5b')];if(!_['isNil'](_0x51e215[_0x7cca('0x5e')])){_0x2a6f61[_0x7cca('0x5d')]+='\x20'+_0x51e215[_0x7cca('0x5e')];}}})[_0x7cca('0x5f')](function(){return db[_0x7cca('0x60')]['create'](_0x2a6f61);});}})['then'](function(_0x341d92){return db[_0x7cca('0x61')][_0x7cca('0x47')]({'where':{'CmHopperId':_0x3eb069}});})[_0x7cca('0x39')](function(){return _0xe0059e[_0x7cca('0x5')](0xcc)[_0x7cca('0x62')]();})[_0x7cca('0x41')](handleError(_0xe0059e,null));};exports[_0x7cca('0x63')]=function(_0x3327b1,_0x35eca7){var _0x2d5853=[];return db[_0x7cca('0x59')][_0x7cca('0x46')]()['then'](function(_0x23cfb5){_0x2d5853=_[_0x7cca('0x19')](_0x23cfb5);return _0x3327b1['user'][_0x7cca('0x64')]({'where':{'type':_0x7cca('0x65'),'dialActive':!![],'dialMethod':_0x7cca('0x66')},'attributes':['id','dialOrderByScheduledAt',_0x7cca('0x67')],'raw':!![]});})[_0x7cca('0x39')](function(_0x14efae){if(_0x14efae&&_0x14efae[_0x7cca('0x30')]){return db[_0x7cca('0x68')]['transaction'](function(_0x24901f){var _0x464484={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7cca('0x52')](_0x7cca('0x53'))},'VoiceQueueId':{'$in':_['map'](_0x14efae,'id')},'$or':[{'UserId':null},{'UserId':_0x3327b1[_0x7cca('0x50')]['id']}]};var _0x46e741={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x14efae)['filter']([_0x7cca('0x67'),0x0])['map']('id')[_0x7cca('0x69')]()},'$or':[{'UserId':null},{'UserId':_0x3327b1['user']['id']}]};var _0x38d055={'$or':[_0x464484,_0x46e741]};var _0x3aa651=[];if(_0x3327b1[_0x7cca('0x43')][_0x7cca('0x6a')]&&_0x3327b1[_0x7cca('0x43')][_0x7cca('0x6a')]===_0x7cca('0x6b')){if(!_[_0x7cca('0x6c')](_0x3327b1[_0x7cca('0x43')][_0x7cca('0x6d')])){_0x38d055['id']={'$in':_0x3327b1[_0x7cca('0x43')][_0x7cca('0x6d')]};}_0x3aa651=[[_0x7cca('0x6e'),_0x7cca('0x6f')],['scheduledAt',_0x14efae[0x0][_0x7cca('0x70')]===_0x7cca('0x6f')?_0x7cca('0x71'):'ASC'],db[_0x7cca('0x68')]['literal'](_0x7cca('0x72')),['id',_0x7cca('0x71')]];}else{if(!_[_0x7cca('0x6c')](_0x3327b1[_0x7cca('0x43')][_0x7cca('0x6d')])){_0x38d055['id']={'$notIn':_0x3327b1[_0x7cca('0x43')][_0x7cca('0x6d')]};}_0x3aa651=[[_0x7cca('0x6e'),_0x7cca('0x71')],[_0x7cca('0x73'),_0x14efae[0x0][_0x7cca('0x70')]],db[_0x7cca('0x68')][_0x7cca('0x74')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x7cca('0x6f')]];}return db['CmHopper'][_0x7cca('0x75')]({'attributes':['id',_0x7cca('0x76'),_0x7cca('0x55'),_0x7cca('0x77')],'where':_0x38d055,'order':_0x3aa651,'transaction':_0x24901f,'lock':_0x24901f['LOCK'][_0x7cca('0x78')],'include':[{'model':db[_0x7cca('0x59')],'as':_0x7cca('0x79'),'attributes':_0x2d5853,'include':[{'model':db[_0x7cca('0x7a')],'as':_0x7cca('0x7b'),'attributes':['id',_0x7cca('0x37')]}]},{'model':db['CmList'],'as':_0x7cca('0x7c'),'attributes':['id',_0x7cca('0x37')]},{'model':db[_0x7cca('0x4a')],'as':_0x7cca('0x7d'),'attributes':['id',_0x7cca('0x37'),_0x7cca('0x7e')]}]})[_0x7cca('0x39')](function(_0x1bd752){if(_0x1bd752){return _0x1bd752[_0x7cca('0x44')]({'UserId':_0x3327b1['user']['id']},{'transaction':_0x24901f});}});});}})[_0x7cca('0x39')](handleEntityNotFound(_0x35eca7,null))[_0x7cca('0x39')](respondWithResult(_0x35eca7,null))['catch'](handleError(_0x35eca7,null));};exports[_0x7cca('0x7f')]=function(_0x5b4ca5,_0x569866,_0x24e643){var _0x313cd1=[];var _0x27e79c=_0x5b4ca5[_0x7cca('0x3f')]['id'];var _0x2af32b=_0x5b4ca5[_0x7cca('0x50')]['id'];return db[_0x7cca('0x59')][_0x7cca('0x46')]()[_0x7cca('0x39')](function(_0x5dd0f3){_0x313cd1=_[_0x7cca('0x19')](_0x5dd0f3);return db[_0x7cca('0x68')][_0x7cca('0x80')](function(_0x294484){const _0x37deae={'id':_0x27e79c};return db[_0x7cca('0x11')][_0x7cca('0x75')]({'attributes':['id',_0x7cca('0x76'),'recallme'],'where':_0x37deae,'transaction':_0x294484,'lock':_0x294484[_0x7cca('0x81')][_0x7cca('0x78')],'include':[{'model':db[_0x7cca('0x59')],'as':'Contact','attributes':_0x313cd1,'include':[{'model':db[_0x7cca('0x7a')],'as':_0x7cca('0x7b'),'attributes':['id',_0x7cca('0x37')]}]},{'model':db[_0x7cca('0x82')],'as':'List','attributes':['id',_0x7cca('0x37')]},{'model':db[_0x7cca('0x4a')],'as':_0x7cca('0x7d'),'attributes':['id',_0x7cca('0x37'),_0x7cca('0x7e')]}]})[_0x7cca('0x39')](function(_0x2f4c3a){if(_0x2f4c3a){return _0x2f4c3a['update']({'UserId':_0x2af32b},{'transaction':_0x294484});}});});})[_0x7cca('0x39')](handleEntityNotFound(_0x569866,null))[_0x7cca('0x39')](respondWithResult(_0x569866,null))[_0x7cca('0x41')](handleError(_0x569866,null));};exports[_0x7cca('0x83')]=function(_0x151a0d,_0x5afecc){return _0x151a0d[_0x7cca('0x50')][_0x7cca('0x64')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7cca('0x66')},'attributes':['id'],'raw':!![]})[_0x7cca('0x39')](function(_0x5d23d5){if(_0x5d23d5&&_0x5d23d5[_0x7cca('0x30')]){return db[_0x7cca('0x11')][_0x7cca('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7cca('0x52')](_0x7cca('0x53'))},'VoiceQueueId':{'$in':_[_0x7cca('0x17')](_0x5d23d5,'id')},'$or':[{'UserId':null},{'UserId':_0x151a0d[_0x7cca('0x50')]['id']}]}});}return 0x0;})[_0x7cca('0x39')](function(_0x961bfa){if(!_[_0x7cca('0x5c')](_0x961bfa)&&_[_0x7cca('0x84')](_0x961bfa)){return _0x5afecc[_0x7cca('0x5')](0xc8)['json']({'contacts':_0x961bfa});}else{logger[_0x7cca('0xe')](_0x7cca('0x85'),_0x7cca('0x83'),0x194,_0x7cca('0x86'));_0x5afecc[_0x7cca('0xd')](0x194);}})[_0x7cca('0x41')](handleError(_0x5afecc,null));};exports['getTimezones']=function(_0x12d6b3,_0x3ea186){var _0x330821=shared['timezones'];var _0x3863ac=[];_[_0x7cca('0x17')](_0x330821,function(_0x1a7f1c){_0x3863ac['push']({'id':_0x1a7f1c[_0x7cca('0x37')],'name':_0x1a7f1c['name'],'utcOffset':_0x1a7f1c[_0x7cca('0x87')]});});return _0x3ea186[_0x7cca('0x5')](0xc8)[_0x7cca('0x6')]({'tz':_0x3863ac});};exports['getTimezone']=function(_0x1502f7,_0x4a1eb7){var _0x519123=shared[_0x7cca('0x88')];var _0x3f696d={};if(!_['isNil'](_0x519123[_0x1502f7[_0x7cca('0x43')]['id']]))_0x3f696d=_0x519123[_0x1502f7[_0x7cca('0x43')]['id']];return _0x4a1eb7[_0x7cca('0x5')](0xc8)['json'](_0x3f696d);}; \ No newline at end of file +var _0x202c=['update','then','error','name','send','index','rawAttributes','fieldName','type','key','keys','query','model','filters','concat','$and','$or','$lt','$lte','$ne','$not','$between','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','CmHopper','includeAll','include','findAll','rows','catch','show','length','find','create','body','describe','destroy','params','CampaignId','VoiceQueueId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','UserId','user','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','map','prev','isEmpty','hopperIds','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','phone','recallme','LOCK','UPDATE','CmCompany','Company','List','Queue','CmContact','VoiceQueue','getOpenContacts','format','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','getTimezones','timezones','push','moment','../../config/logger','api','../../config/environment','status','undefined','limit','count','offset','Content-Range','json'];(function(_0x496ce8,_0x1dc145){var _0x3b93c6=function(_0x594d91){while(--_0x594d91){_0x496ce8['push'](_0x496ce8['shift']());}};_0x3b93c6(++_0x1dc145);}(_0x202c,0x178));var _0xc202=function(_0x4f9621,_0x402691){_0x4f9621=_0x4f9621-0x0;var _0x338c02=_0x202c[_0x4f9621];return _0x338c02;};'use strict';var moment=require(_0xc202('0x0'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0xc202('0x1'))(_0xc202('0x2'));var shared=require(_0xc202('0x3'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x215161,_0x155c3b){_0x155c3b=_0x155c3b||0xc8;return function(_0x1763f5){if(_0x1763f5){return _0x215161[_0xc202('0x4')](_0x155c3b)['json'](_0x1763f5);}};}function respondWithFilteredResult(_0x28e51c,_0x68d363){return function(_0x59563a){if(_0x59563a){var _0xc2b3eb=typeof _0x68d363['offset']===_0xc202('0x5')&&typeof _0x68d363[_0xc202('0x6')]===_0xc202('0x5');var _0x336fc8=_0x59563a[_0xc202('0x7')];var _0x3ea754=_0xc2b3eb?0x0:_0x68d363[_0xc202('0x8')];var _0xdfe8bf=_0xc2b3eb?_0x59563a[_0xc202('0x7')]:_0x68d363[_0xc202('0x8')]+_0x68d363[_0xc202('0x6')];var _0x870346;if(_0xdfe8bf>=_0x336fc8){_0xdfe8bf=_0x336fc8;_0x870346=0xc8;}else{_0x870346=0xce;}_0x28e51c[_0xc202('0x4')](_0x870346);return _0x28e51c['set'](_0xc202('0x9'),_0x3ea754+'-'+_0xdfe8bf+'/'+_0x336fc8)[_0xc202('0xa')](_0x59563a);}return null;};}function saveUpdates(_0x2805af,_0xbf3618){return function(_0x269dc0){if(_0x269dc0){return _0x269dc0[_0xc202('0xb')](_0x2805af)[_0xc202('0xc')](function(_0x53600c){return _0x53600c;});}return null;};}function handleEntityNotFound(_0xbd4353,_0x32b5d9){return function(_0x591cc0){if(!_0x591cc0){_0xbd4353['sendStatus'](0x194);}return _0x591cc0;};}function handleError(_0x5c10dd,_0x2dafa5){_0x2dafa5=_0x2dafa5||0x1f4;return function(_0x4a333c){logger[_0xc202('0xd')](_0x4a333c['stack']);if(_0x4a333c[_0xc202('0xe')]){delete _0x4a333c[_0xc202('0xe')];}_0x5c10dd[_0xc202('0x4')](_0x2dafa5)[_0xc202('0xf')](_0x4a333c);};}exports[_0xc202('0x10')]=function(_0x2419c5,_0x9620a0){var _0x591ecc={},_0x16ec7c={},_0x2c5557={'count':0x0,'rows':[]};var _0x3f322d=_['map'](db['CmHopper'][_0xc202('0x11')],function(_0x1af67a){return{'name':_0x1af67a[_0xc202('0x12')],'type':_0x1af67a[_0xc202('0x13')][_0xc202('0x14')]};});_0x16ec7c['model']=_['map'](_0x3f322d,_0xc202('0xe'));_0x16ec7c['query']=_[_0xc202('0x15')](_0x2419c5[_0xc202('0x16')]);_0x16ec7c['filters']=_['intersection'](_0x16ec7c[_0xc202('0x17')],_0x16ec7c['query']);_0x16ec7c[_0xc202('0x18')]=_[_0xc202('0x19')](_0x16ec7c[_0xc202('0x18')],[_0xc202('0x1a'),_0xc202('0x1b'),'$gt','$gte',_0xc202('0x1c'),_0xc202('0x1d'),_0xc202('0x1e'),'$eq',_0xc202('0x1f'),_0xc202('0x20'),'$notBetween','$in',_0xc202('0x21'),_0xc202('0x22'),_0xc202('0x23'),_0xc202('0x24'),_0xc202('0x25'),'$like',_0xc202('0x26'),_0xc202('0x27'),'$contained','$any']);_0x591ecc[_0xc202('0x28')]=_[_0xc202('0x29')](_0x16ec7c[_0xc202('0x17')],qs[_0xc202('0x2a')](_0x2419c5['query'][_0xc202('0x2a')]));_0x591ecc[_0xc202('0x28')]=_0x591ecc[_0xc202('0x28')]['length']?_0x591ecc[_0xc202('0x28')]:_0x16ec7c[_0xc202('0x17')];if(!_0x2419c5[_0xc202('0x16')][_0xc202('0x2b')](_0xc202('0x2c'))){_0x591ecc[_0xc202('0x6')]=qs[_0xc202('0x6')](_0x2419c5[_0xc202('0x16')][_0xc202('0x6')]);_0x591ecc[_0xc202('0x8')]=qs[_0xc202('0x8')](_0x2419c5[_0xc202('0x16')]['offset']);}_0x591ecc[_0xc202('0x2d')]=qs[_0xc202('0x2e')](_0x2419c5[_0xc202('0x16')]['sort']);_0x591ecc[_0xc202('0x2f')]=qs['filters'](_[_0xc202('0x30')](_0x2419c5[_0xc202('0x16')],_0x16ec7c[_0xc202('0x18')]),_0x3f322d);if(_0x2419c5[_0xc202('0x16')][_0xc202('0x31')]){_0x591ecc[_0xc202('0x2f')]=_['merge'](_0x591ecc[_0xc202('0x2f')],{'$or':_['map'](_0x3f322d,function(_0x3ac7e8){if(_0x3ac7e8['type']!==_0xc202('0x32')){var _0x147272={};_0x147272[_0x3ac7e8[_0xc202('0xe')]]={'$like':'%'+_0x2419c5['query'][_0xc202('0x31')]+'%'};return _0x147272;}})});}_0x591ecc=_[_0xc202('0x33')]({},_0x591ecc,_0x2419c5[_0xc202('0x34')]);var _0x444a8d={'where':_0x591ecc[_0xc202('0x2f')]};return db[_0xc202('0x35')]['count'](_0x444a8d)[_0xc202('0xc')](function(_0x1e57c3){_0x2c5557[_0xc202('0x7')]=_0x1e57c3;if(_0x2419c5['query'][_0xc202('0x36')]){_0x591ecc[_0xc202('0x37')]=[{'all':!![]}];}return db[_0xc202('0x35')][_0xc202('0x38')](_0x591ecc);})['then'](function(_0x57d5a4){_0x2c5557[_0xc202('0x39')]=_0x57d5a4;return _0x2c5557;})['then'](respondWithFilteredResult(_0x9620a0,_0x591ecc))[_0xc202('0x3a')](handleError(_0x9620a0,null));};exports[_0xc202('0x3b')]=function(_0x25fdd8,_0x200c27){var _0x9dbdb={'raw':!![],'where':{'id':_0x25fdd8['params']['id']}},_0x126c62={};_0x126c62[_0xc202('0x17')]=_[_0xc202('0x15')](db[_0xc202('0x35')][_0xc202('0x11')]);_0x126c62[_0xc202('0x16')]=_['keys'](_0x25fdd8[_0xc202('0x16')]);_0x126c62[_0xc202('0x18')]=_[_0xc202('0x29')](_0x126c62[_0xc202('0x17')],_0x126c62[_0xc202('0x16')]);_0x9dbdb['attributes']=_[_0xc202('0x29')](_0x126c62['model'],qs[_0xc202('0x2a')](_0x25fdd8['query'][_0xc202('0x2a')]));_0x9dbdb[_0xc202('0x28')]=_0x9dbdb[_0xc202('0x28')][_0xc202('0x3c')]?_0x9dbdb['attributes']:_0x126c62[_0xc202('0x17')];if(_0x25fdd8[_0xc202('0x16')][_0xc202('0x36')]){_0x9dbdb[_0xc202('0x37')]=[{'all':!![]}];}_0x9dbdb=_[_0xc202('0x33')]({},_0x9dbdb,_0x25fdd8[_0xc202('0x34')]);return db[_0xc202('0x35')][_0xc202('0x3d')](_0x9dbdb)[_0xc202('0xc')](handleEntityNotFound(_0x200c27,null))[_0xc202('0xc')](respondWithResult(_0x200c27,null))[_0xc202('0x3a')](handleError(_0x200c27,null));};exports[_0xc202('0x3e')]=function(_0x157c2e,_0x39607d){return db[_0xc202('0x35')][_0xc202('0x3e')](_0x157c2e[_0xc202('0x3f')],{})[_0xc202('0xc')](respondWithResult(_0x39607d,0xc9))[_0xc202('0x3a')](handleError(_0x39607d,null));};exports[_0xc202('0xb')]=function(_0x484013,_0x39f2c1){if(_0x484013[_0xc202('0x3f')]['id']){delete _0x484013[_0xc202('0x3f')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x484013['params']['id']}})[_0xc202('0xc')](handleEntityNotFound(_0x39f2c1,null))[_0xc202('0xc')](saveUpdates(_0x484013[_0xc202('0x3f')],null))[_0xc202('0xc')](respondWithResult(_0x39f2c1,null))[_0xc202('0x3a')](handleError(_0x39f2c1,null));};exports[_0xc202('0x40')]=function(_0x157d89,_0x466ba4){return db[_0xc202('0x35')][_0xc202('0x40')]()[_0xc202('0xc')](respondWithResult(_0x466ba4,null))[_0xc202('0x3a')](handleError(_0x466ba4,null));};exports[_0xc202('0x41')]=function(_0x5220a2,_0x33e70c){var _0x163023;var _0x57855e=_0x5220a2[_0xc202('0x42')]['id'];return db[_0xc202('0x35')][_0xc202('0x3d')]({'where':{'id':_0x5220a2[_0xc202('0x42')]['id']}})[_0xc202('0xc')](handleEntityNotFound(_0x33e70c,null))['then'](function(_0x2250a6){if(_0x2250a6){return _0x2250a6['destroy']()[_0xc202('0xc')](function(_0x5f1b99){return _0x5f1b99;});}})[_0xc202('0xc')](function(_0x20ffe5){_0x163023=_0x20ffe5;if(_0x20ffe5){if(_0x20ffe5['VoiceQueueId']||_0x20ffe5[_0xc202('0x43')]){return db[_0x20ffe5[_0xc202('0x44')]?'VoiceQueue':'Campaign']['find']({'where':{'id':_0x20ffe5[_0xc202('0x44')]?_0x20ffe5['VoiceQueueId']:_0x20ffe5[_0xc202('0x43')]},'attributes':['id',_0xc202('0xe')],'raw':!![]});}}})[_0xc202('0xc')](function(_0x1f6233){var _0x3858b9={};if(_0x1f6233){_[_0xc202('0x33')](_0x3858b9,_[_0xc202('0x45')](_0x163023[_0xc202('0x46')],[_0xc202('0x47'),_0xc202('0x48'),'id']));_0x3858b9[_0xc202('0x49')]=0x15;_0x3858b9[_0xc202('0x4a')]=_0xc202('0x4b');_0x3858b9['campaign']=_0x1f6233[_0xc202('0xe')];_0x3858b9['membername']=_0x5220a2['user'][_0xc202('0xe')];_0x3858b9[_0xc202('0x4c')]=_0x5220a2[_0xc202('0x4d')]['id'];_0x3858b9['deleted']=!![];_0x3858b9[_0xc202('0x4e')]=moment()['format'](_0xc202('0x4f'));_0x3858b9[_0xc202('0x50')]=_0x163023['phone'];_0x3858b9[_0xc202('0x51')]=_0x163023[_0xc202('0x44')]?'queue':_0xc202('0x52');return db['CmContact'][_0xc202('0x3d')]({'where':{'id':_0x3858b9[_0xc202('0x53')]},'attributes':[_0xc202('0x54'),_0xc202('0x55')]})[_0xc202('0xc')](function(_0x2d475a){if(!_[_0xc202('0x56')](_0x33e70c)&&!_['isNil'](_0x2d475a[_0xc202('0x54')])){_0x3858b9[_0xc202('0x57')]=_0x2d475a['firstName'];if(!_[_0xc202('0x56')](_0x2d475a['lastName'])){_0x3858b9[_0xc202('0x57')]+='\x20'+_0x2d475a['lastName'];}}})[_0xc202('0x58')](function(){return db['CmHopperFinal'][_0xc202('0x3e')](_0x3858b9);});}})['then'](function(_0x5f212b){return db[_0xc202('0x59')][_0xc202('0x41')]({'where':{'CmHopperId':_0x57855e}});})[_0xc202('0xc')](function(){return _0x33e70c[_0xc202('0x4')](0xcc)[_0xc202('0x5a')]();})[_0xc202('0x3a')](handleError(_0x33e70c,null));};exports[_0xc202('0x5b')]=function(_0x2b0865,_0x409845){var _0x135797=[];return db['CmContact'][_0xc202('0x40')]()[_0xc202('0xc')](function(_0x58bc02){_0x135797=_[_0xc202('0x15')](_0x58bc02);return _0x2b0865[_0xc202('0x4d')][_0xc202('0x5c')]({'where':{'type':_0xc202('0x5d'),'dialActive':!![],'dialMethod':_0xc202('0x5e')},'attributes':['id',_0xc202('0x5f'),_0xc202('0x60')],'raw':!![]});})[_0xc202('0xc')](function(_0x502caf){if(_0x502caf&&_0x502caf[_0xc202('0x3c')]){return db[_0xc202('0x61')][_0xc202('0x62')](function(_0x3095d2){var _0x233e0a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xc202('0x4f'))},'VoiceQueueId':{'$in':_[_0xc202('0x63')](_0x502caf,'id')},'$or':[{'UserId':null},{'UserId':_0x2b0865[_0xc202('0x4d')]['id']}]};var _0x5ae21d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x502caf)[_0xc202('0x31')](['dialPreviewAutoRecallMe',0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x2b0865[_0xc202('0x4d')]['id']}]};var _0xd2d160={'$or':[_0x233e0a,_0x5ae21d]};var _0x189884=[];if(_0x2b0865[_0xc202('0x3f')]['direction']&&_0x2b0865[_0xc202('0x3f')]['direction']===_0xc202('0x64')){if(!_[_0xc202('0x65')](_0x2b0865['body'][_0xc202('0x66')])){_0xd2d160['id']={'$in':_0x2b0865[_0xc202('0x3f')][_0xc202('0x66')]};}_0x189884=[['priority','ASC'],['scheduledAt',_0x502caf[0x0][_0xc202('0x5f')]===_0xc202('0x67')?'DESC':_0xc202('0x67')],db[_0xc202('0x61')]['literal'](_0xc202('0x68')),['id','DESC']];}else{if(!_[_0xc202('0x65')](_0x2b0865[_0xc202('0x3f')][_0xc202('0x66')])){_0xd2d160['id']={'$notIn':_0x2b0865[_0xc202('0x3f')][_0xc202('0x66')]};}_0x189884=[['priority','DESC'],[_0xc202('0x69'),_0x502caf[0x0][_0xc202('0x5f')]],db[_0xc202('0x61')][_0xc202('0x6a')](_0xc202('0x6b')),['id','ASC']];}return db['CmHopper'][_0xc202('0x6c')]({'attributes':['id',_0xc202('0x6d'),_0xc202('0x6e'),_0xc202('0x6f')],'where':_0xd2d160,'order':_0x189884,'transaction':_0x3095d2,'lock':_0x3095d2[_0xc202('0x70')][_0xc202('0x71')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x135797,'include':[{'model':db[_0xc202('0x72')],'as':_0xc202('0x73'),'attributes':['id',_0xc202('0xe')]}]},{'model':db['CmList'],'as':_0xc202('0x74'),'attributes':['id',_0xc202('0xe')]},{'model':db['VoiceQueue'],'as':_0xc202('0x75'),'attributes':['id',_0xc202('0xe'),'dialActive']}]})[_0xc202('0xc')](function(_0x382dea){if(_0x382dea){return _0x382dea[_0xc202('0xb')]({'UserId':_0x2b0865[_0xc202('0x4d')]['id']},{'transaction':_0x3095d2});}});});}})[_0xc202('0xc')](handleEntityNotFound(_0x409845,null))['then'](respondWithResult(_0x409845,null))[_0xc202('0x3a')](handleError(_0x409845,null));};exports['getPreviewRecall']=function(_0x3cfbaa,_0x17ff38,_0x585984){var _0x2d149a=[];var _0x5b8a32=_0x3cfbaa[_0xc202('0x42')]['id'];var _0x411043=_0x3cfbaa[_0xc202('0x4d')]['id'];return db[_0xc202('0x76')]['describe']()[_0xc202('0xc')](function(_0x234770){_0x2d149a=_[_0xc202('0x15')](_0x234770);return db[_0xc202('0x61')][_0xc202('0x62')](function(_0x3ba0c4){const _0x5f2b84={'id':_0x5b8a32};return db[_0xc202('0x35')][_0xc202('0x6c')]({'attributes':['id','scheduledat',_0xc202('0x6f')],'where':_0x5f2b84,'transaction':_0x3ba0c4,'lock':_0x3ba0c4[_0xc202('0x70')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x2d149a,'include':[{'model':db[_0xc202('0x72')],'as':_0xc202('0x73'),'attributes':['id',_0xc202('0xe')]}]},{'model':db['CmList'],'as':_0xc202('0x74'),'attributes':['id',_0xc202('0xe')]},{'model':db[_0xc202('0x77')],'as':_0xc202('0x75'),'attributes':['id',_0xc202('0xe'),'dialActive']}]})[_0xc202('0xc')](function(_0x1bf945){if(_0x1bf945){return _0x1bf945[_0xc202('0xb')]({'UserId':_0x411043},{'transaction':_0x3ba0c4});}});});})[_0xc202('0xc')](handleEntityNotFound(_0x17ff38,null))[_0xc202('0xc')](respondWithResult(_0x17ff38,null))[_0xc202('0x3a')](handleError(_0x17ff38,null));};exports[_0xc202('0x78')]=function(_0x27147e,_0x906dc2){return _0x27147e[_0xc202('0x4d')][_0xc202('0x5c')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xc202('0x5e')},'attributes':['id'],'raw':!![]})[_0xc202('0xc')](function(_0x48a098){if(_0x48a098&&_0x48a098[_0xc202('0x3c')]){return db[_0xc202('0x35')][_0xc202('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xc202('0x79')](_0xc202('0x4f'))},'VoiceQueueId':{'$in':_['map'](_0x48a098,'id')},'$or':[{'UserId':null},{'UserId':_0x27147e[_0xc202('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x41908c){if(!_[_0xc202('0x56')](_0x41908c)&&_[_0xc202('0x7a')](_0x41908c)){return _0x906dc2[_0xc202('0x4')](0xc8)['json']({'contacts':_0x41908c});}else{logger[_0xc202('0xd')](_0xc202('0x7b'),_0xc202('0x78'),0x194,_0xc202('0x7c'));_0x906dc2[_0xc202('0x7d')](0x194);}})[_0xc202('0x3a')](handleError(_0x906dc2,null));};exports[_0xc202('0x7e')]=function(_0x414557,_0x80109){var _0x1bf8b8=shared[_0xc202('0x7f')];var _0x48521a=[];_['map'](_0x1bf8b8,function(_0x41ef84){_0x48521a[_0xc202('0x80')]({'id':_0x41ef84[_0xc202('0xe')],'name':_0x41ef84[_0xc202('0xe')],'utcOffset':_0x41ef84['utcOffset']});});return _0x80109[_0xc202('0x4')](0xc8)['json']({'tz':_0x48521a});};exports['getTimezone']=function(_0x30f49c,_0x151976){var _0x53e43a=shared['timezones'];var _0x4f6c06={};if(!_[_0xc202('0x56')](_0x53e43a[_0x30f49c[_0xc202('0x3f')]['id']]))_0x4f6c06=_0x53e43a[_0x30f49c['body']['id']];return _0x151976[_0xc202('0x4')](0xc8)[_0xc202('0xa')](_0x4f6c06);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 94f1fdc..db76633 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(_0x4ba38f,_0x26227b){var _0x390e5a=function(_0x2cd7c2){while(--_0x2cd7c2){_0x4ba38f['push'](_0x4ba38f['shift']());}};_0x390e5a(++_0x26227b);}(_0x2eb2,0x19f));var _0x22eb=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x2eb2[_0x481bf7];return _0x461787;};'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 _0x71ab=['rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x71ab,0x64));var _0xb71a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x71ab[_0x3947c9];return _0x2e7871;};'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'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[{'name':_0xb71a('0xc'),'fields':[_0xb71a('0xc')]},{'name':_0xb71a('0xd'),'fields':[_0xb71a('0xd')]},{'name':_0xb71a('0xe'),'fields':[_0xb71a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index bb7392e..88e8c31 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 _0x1ffb=['all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','transaction','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','limit','Contact','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','NOW()','User','Agent','CmList','List','util','moment','../../mysqldb','../../config/logger','GetCmHopper','CmHopper','options','raw','where','include','map','model','attributes','then','info','debug','stringify','catch','error','message','ShowCmHopper','find','CreateCmHopper','create','UpdateCmHopper','update','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','findAll','order','LOCK','UPDATE','keys','name','length','UserId','includes','push'];(function(_0x28b02a,_0x4bda86){var _0x1212ca=function(_0xe40143){while(--_0xe40143){_0x28b02a['push'](_0x28b02a['shift']());}};_0x1212ca(++_0x4bda86);}(_0x1ffb,0x14a));var _0xb1ff=function(_0x5e051a,_0x404ac5){_0x5e051a=_0x5e051a-0x0;var _0x185390=_0x1ffb[_0x5e051a];return _0x185390;};'use strict';var _=require('lodash');var util=require(_0xb1ff('0x0'));var moment=require(_0xb1ff('0x1'));var BPromise=require('bluebird');var db=require(_0xb1ff('0x2'))['db'];var logger=require(_0xb1ff('0x3'))('rpc');exports[_0xb1ff('0x4')]=function(_0x21a61d){var _0x34b55e=this;return new Promise(function(_0xccac3f,_0x27bab7){return db[_0xb1ff('0x5')]['findAll']({'raw':_0x21a61d[_0xb1ff('0x6')]?_0x21a61d['options'][_0xb1ff('0x7')]===undefined?!![]:![]:!![],'where':_0x21a61d[_0xb1ff('0x6')]?_0x21a61d['options'][_0xb1ff('0x8')]||null:null,'attributes':_0x21a61d['options']?_0x21a61d[_0xb1ff('0x6')]['attributes']||null:null,'limit':_0x21a61d[_0xb1ff('0x6')]?_0x21a61d[_0xb1ff('0x6')]['limit']||null:null,'include':_0x21a61d['options']?_0x21a61d[_0xb1ff('0x6')][_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x21a61d['options']['include'],function(_0x3397e6){return{'model':db[_0x3397e6[_0xb1ff('0xb')]],'as':_0x3397e6['as'],'attributes':_0x3397e6[_0xb1ff('0xc')],'include':_0x3397e6[_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x3397e6[_0xb1ff('0x9')],function(_0x157811){return{'model':db[_0x157811[_0xb1ff('0xb')]],'as':_0x157811['as'],'attributes':_0x157811[_0xb1ff('0xc')],'include':_0x157811[_0xb1ff('0x9')]?_['map'](_0x157811[_0xb1ff('0x9')],function(_0x22d730){return{'model':db[_0x22d730[_0xb1ff('0xb')]],'as':_0x22d730['as'],'attributes':_0x22d730[_0xb1ff('0xc')]};}):[]};}):[]};}):[]:[]})[_0xb1ff('0xd')](function(_0x3ca40f){logger[_0xb1ff('0xe')](_0xb1ff('0x4'),_0x21a61d);logger[_0xb1ff('0xf')](_0xb1ff('0x4'),_0x21a61d,JSON[_0xb1ff('0x10')](_0x3ca40f));_0xccac3f(_0x3ca40f);})[_0xb1ff('0x11')](function(_0x13819e){logger[_0xb1ff('0x12')](_0xb1ff('0x4'),_0x13819e['message'],_0x21a61d);_0x27bab7(_0x34b55e['error'](0x1f4,_0x13819e[_0xb1ff('0x13')]));});});};exports[_0xb1ff('0x14')]=function(_0x594d39){var _0x317360=this;return new Promise(function(_0x3af390,_0x2e2162){return db[_0xb1ff('0x5')][_0xb1ff('0x15')]({'raw':_0x594d39[_0xb1ff('0x6')]?_0x594d39[_0xb1ff('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0x594d39[_0xb1ff('0x6')]?_0x594d39[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'attributes':_0x594d39[_0xb1ff('0x6')]?_0x594d39[_0xb1ff('0x6')][_0xb1ff('0xc')]||null:null,'include':_0x594d39[_0xb1ff('0x6')]?_0x594d39['options'][_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x594d39['options'][_0xb1ff('0x9')],function(_0x3a3238){return{'model':db[_0x3a3238['model']],'as':_0x3a3238['as'],'attributes':_0x3a3238['attributes'],'include':_0x3a3238[_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x3a3238[_0xb1ff('0x9')],function(_0x457276){return{'model':db[_0x457276[_0xb1ff('0xb')]],'as':_0x457276['as'],'attributes':_0x457276[_0xb1ff('0xc')],'include':_0x457276[_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x457276['include'],function(_0x171d2f){return{'model':db[_0x171d2f['model']],'as':_0x171d2f['as'],'attributes':_0x171d2f[_0xb1ff('0xc')]};}):[]};}):[]};}):[]:[]})[_0xb1ff('0xd')](function(_0x159a1d){logger['info'](_0xb1ff('0x14'),_0x594d39);logger[_0xb1ff('0xf')](_0xb1ff('0x14'),_0x594d39,JSON['stringify'](_0x159a1d));_0x3af390(_0x159a1d);})[_0xb1ff('0x11')](function(_0x46bcb1){logger[_0xb1ff('0x12')](_0xb1ff('0x14'),_0x46bcb1[_0xb1ff('0x13')],_0x594d39);_0x2e2162(_0x317360[_0xb1ff('0x12')](0x1f4,_0x46bcb1['message']));});});};exports[_0xb1ff('0x16')]=function(_0x829ace){var _0x9fa1d9=this;return new Promise(function(_0x84a8fe,_0x52daeb){return db[_0xb1ff('0x5')][_0xb1ff('0x17')](_0x829ace['body'],{'raw':_0x829ace[_0xb1ff('0x6')]?_0x829ace[_0xb1ff('0x6')][_0xb1ff('0x7')]===undefined?!![]:![]:!![]})[_0xb1ff('0xd')](function(_0xb95cb3){logger[_0xb1ff('0xe')]('CreateCmHopper',_0x829ace);logger[_0xb1ff('0xf')](_0xb1ff('0x16'),_0x829ace,JSON[_0xb1ff('0x10')](_0xb95cb3));_0x84a8fe(_0xb95cb3);})[_0xb1ff('0x11')](function(_0x38627a){logger[_0xb1ff('0x12')]('CreateCmHopper',_0x38627a[_0xb1ff('0x13')],_0x829ace);_0x52daeb(_0x9fa1d9['error'](0x1f4,_0x38627a[_0xb1ff('0x13')]));});});};exports[_0xb1ff('0x18')]=function(_0x1d88db){var _0x2004f4=this;return new Promise(function(_0x2128e1,_0x452a83){return db[_0xb1ff('0x5')][_0xb1ff('0x19')](_0x1d88db[_0xb1ff('0x1a')],{'raw':_0x1d88db[_0xb1ff('0x6')]?_0x1d88db[_0xb1ff('0x6')][_0xb1ff('0x7')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d88db[_0xb1ff('0x6')]?_0x1d88db[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'attributes':_0x1d88db['options']?_0x1d88db[_0xb1ff('0x6')][_0xb1ff('0xc')]||null:null,'limit':_0x1d88db[_0xb1ff('0x6')]?_0x1d88db[_0xb1ff('0x6')]['limit']||null:null})[_0xb1ff('0xd')](function(_0x3d98ad){logger['info'](_0xb1ff('0x18'),_0x1d88db);logger['info'](_0xb1ff('0x1b'),JSON[_0xb1ff('0x10')](_0x1d88db['options'][_0xb1ff('0x8')]),_0x1d88db[_0xb1ff('0x1a')][_0xb1ff('0x1c')]);logger[_0xb1ff('0xf')](_0xb1ff('0x18'),_0x1d88db,JSON[_0xb1ff('0x10')](_0x3d98ad));_0x2128e1(_0x3d98ad);})[_0xb1ff('0x11')](function(_0x254f08){logger['error'](_0xb1ff('0x18'),_0x254f08['message'],_0x1d88db);_0x452a83(_0x2004f4[_0xb1ff('0x12')](0x1f4,_0x254f08['message']));});});};exports[_0xb1ff('0x1d')]=function(_0x105012){var _0x35cc7e=this;return new Promise(function(_0x55e0e3,_0x5d9283){return db[_0xb1ff('0x5')][_0xb1ff('0x1e')]({'where':_0x105012[_0xb1ff('0x6')]?_0x105012[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null})['then'](function(_0x1cb5b6){logger[_0xb1ff('0xe')]('DestroyCmHopper',_0x105012);logger[_0xb1ff('0xf')](_0xb1ff('0x1d'),_0x105012,JSON[_0xb1ff('0x10')](_0x1cb5b6));_0x55e0e3(_0x1cb5b6);})[_0xb1ff('0x11')](function(_0x969d98){logger[_0xb1ff('0x12')](_0xb1ff('0x1d'),_0x969d98['message'],_0x105012);_0x5d9283(_0x35cc7e[_0xb1ff('0x12')](0x1f4,_0x969d98[_0xb1ff('0x13')]));});});};exports[_0xb1ff('0x1f')]=function(_0x76c286){var _0x12d76c=this;return new Promise(function(_0x548ee4,_0x8ed3cf){return db[_0xb1ff('0x20')][_0xb1ff('0x21')]()[_0xb1ff('0xd')](function(_0x2f8f3a){return db[_0xb1ff('0x22')]['transaction'](function(_0x4f0b31){return db[_0xb1ff('0x5')][_0xb1ff('0x23')]({'where':_0x76c286[_0xb1ff('0x6')]?_0x76c286[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'attributes':_0x76c286[_0xb1ff('0x6')]?_0x76c286['options'][_0xb1ff('0xc')]||null:null,'limit':_0x76c286[_0xb1ff('0x6')]?_0x76c286['options']['limit']||null:null,'order':_0x76c286['options']?_0x76c286[_0xb1ff('0x6')][_0xb1ff('0x24')]||null:null,'transaction':_0x4f0b31,'lock':_0x4f0b31[_0xb1ff('0x25')][_0xb1ff('0x26')],'include':[{'model':db[_0xb1ff('0x20')],'as':'Contact','attributes':_[_0xb1ff('0x27')](_0x2f8f3a)},{'model':db['User'],'as':'Agent','attributes':['id',_0xb1ff('0x28'),'voicePause']}]})[_0xb1ff('0xd')](function(_0x1bf07b){var _0x18e9f5=[];var _0x176cbb=[];for(var _0x4fa4fa=0x0;_0x4fa4fa<_0x1bf07b[_0xb1ff('0x29')];_0x4fa4fa+=0x1){var _0x4f8cba=_0x1bf07b[_0x4fa4fa][_0xb1ff('0x2a')];if(_0x4f8cba===null){_0x18e9f5['push'](_0x1bf07b[_0x4fa4fa][_0xb1ff('0x19')](_0x76c286[_0xb1ff('0x1a')],{'transaction':_0x4f0b31}));}else if(!_0x176cbb[_0xb1ff('0x2b')](_0x4f8cba)){_0x176cbb[_0xb1ff('0x2c')](_0x4f8cba);_0x18e9f5[_0xb1ff('0x2c')](_0x1bf07b[_0x4fa4fa][_0xb1ff('0x19')](_0x76c286[_0xb1ff('0x1a')],{'transaction':_0x4f0b31}));}}return BPromise[_0xb1ff('0x2d')](_0x18e9f5);});})[_0xb1ff('0xd')](function(_0x30f532){logger['info'](_0xb1ff('0x1f'),_0x76c286);if(_0x30f532['length']>0x0){logger[_0xb1ff('0xe')](_0xb1ff('0x2e'),_0x30f532[0x0][_0xb1ff('0x2f')]['id'],_0x30f532[0x0][_0xb1ff('0x2f')]['ContactId'],_0x30f532[0x0][_0xb1ff('0x2f')][_0xb1ff('0x1c')]);}logger[_0xb1ff('0xf')]('GetContactDialer',_0x76c286,JSON[_0xb1ff('0x10')](_0x30f532));_0x548ee4(_0x30f532);})['catch'](function(_0x27b7ae){logger['error'](_0xb1ff('0x1f'),_0x27b7ae['message'],_0x76c286);_0x8ed3cf(_0x12d76c[_0xb1ff('0x12')](0x1f4,_0x27b7ae[_0xb1ff('0x13')]));});});});};exports[_0xb1ff('0x30')]=function(_0x2d4d1f){var _0x2e515c=this;return new Promise(function(_0x3fbe51,_0x407a4a){return db['sequelize'][_0xb1ff('0x31')](function(_0x3d4c3e){return db[_0xb1ff('0x32')][_0xb1ff('0x17')](_0x2d4d1f[_0xb1ff('0x1a')],{'raw':_0x2d4d1f[_0xb1ff('0x6')]?_0x2d4d1f['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x3d4c3e})['then'](function(){logger[_0xb1ff('0xe')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xb1ff('0x10')](_0x2d4d1f[_0xb1ff('0x6')][_0xb1ff('0x8')]),_0x2d4d1f['options'][_0xb1ff('0x8')][_0xb1ff('0x1c')]);return db[_0xb1ff('0x5')][_0xb1ff('0x1e')]({'where':_0x2d4d1f[_0xb1ff('0x6')]?_0x2d4d1f[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'transaction':_0x3d4c3e});});})[_0xb1ff('0xd')](function(_0x343fa8){logger[_0xb1ff('0xe')](_0xb1ff('0x30'),_0x2d4d1f);logger[_0xb1ff('0xf')](_0xb1ff('0x30'),_0x2d4d1f,JSON[_0xb1ff('0x10')](_0x343fa8));_0x3fbe51(_0x343fa8);})['catch'](function(_0x5de4cb){logger['error'](_0xb1ff('0x30'),_0x5de4cb[_0xb1ff('0x13')],_0x2d4d1f);_0x407a4a(_0x2e515c[_0xb1ff('0x12')](0x1f4,_0x5de4cb[_0xb1ff('0x13')]));});});};exports[_0xb1ff('0x33')]=function(_0x3c4356){var _0x4cc127=this;return new Promise(function(_0x456efb,_0x67b432){return db[_0xb1ff('0x5')][_0xb1ff('0x23')]({'raw':_0x3c4356['options']?_0x3c4356['options'][_0xb1ff('0x7')]===undefined?!![]:![]:!![],'where':_0x3c4356[_0xb1ff('0x6')]?_0x3c4356[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'attributes':[[db['sequelize']['fn'](_0xb1ff('0x34'),db[_0xb1ff('0x22')]['fn']('IF',db[_0xb1ff('0x22')][_0xb1ff('0x35')](_0xb1ff('0x36')+util['format']('\x22%s\x22',moment()[_0xb1ff('0x37')](_0xb1ff('0x38')))+_0xb1ff('0x39')))),_0xb1ff('0x3a')]]})[_0xb1ff('0xd')](function(_0x4006e6){logger[_0xb1ff('0xe')](_0xb1ff('0x33'),_0x3c4356);logger[_0xb1ff('0xf')](_0xb1ff('0x33'),_0x3c4356,JSON[_0xb1ff('0x10')](_0x4006e6));_0x456efb(_0x4006e6);})[_0xb1ff('0x11')](function(_0xeef28a){logger[_0xb1ff('0x12')](_0xb1ff('0x33'),_0xeef28a[_0xb1ff('0x13')],_0x3c4356);_0x67b432(_0x4cc127[_0xb1ff('0x12')](0x1f4,_0xeef28a[_0xb1ff('0x13')]));});});};exports[_0xb1ff('0x3b')]=function(_0x1b2cb3){var _0x9ed144=this;return new Promise(function(_0x22cf26,_0x1e7e40){return db[_0xb1ff('0x20')][_0xb1ff('0x21')]()[_0xb1ff('0xd')](function(){return db[_0xb1ff('0x22')]['transaction'](function(_0x177026){return db[_0xb1ff('0x5')][_0xb1ff('0x23')]({'where':_0x1b2cb3[_0xb1ff('0x6')]?_0x1b2cb3[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'attributes':_0x1b2cb3['options']?_0x1b2cb3[_0xb1ff('0x6')][_0xb1ff('0xc')]||null:null,'limit':0x1,'order':_0x1b2cb3[_0xb1ff('0x6')]?_0x1b2cb3['options']['order']||null:null,'group':db['CmHopper'][_0xb1ff('0x2a')],'transaction':_0x177026,'lock':_0x177026['LOCK'][_0xb1ff('0x26')],'include':_0x1b2cb3[_0xb1ff('0x6')]?_0x1b2cb3[_0xb1ff('0x6')][_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x1b2cb3[_0xb1ff('0x6')]['include'],function(_0x49830c){return{'model':db[_0x49830c[_0xb1ff('0xb')]],'as':_0x49830c['as'],'attributes':_0x49830c[_0xb1ff('0xc')],'include':_0x49830c[_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x49830c[_0xb1ff('0x9')],function(_0x542c04){return{'model':db[_0x542c04[_0xb1ff('0xb')]],'as':_0x542c04['as'],'attributes':_0x542c04[_0xb1ff('0xc')],'include':_0x542c04[_0xb1ff('0x9')]?_['map'](_0x542c04[_0xb1ff('0x9')],function(_0x1140cf){return{'model':db[_0x1140cf['model']],'as':_0x1140cf['as'],'attributes':_0x1140cf[_0xb1ff('0xc')]};}):[]};}):[]};}):[]:[]})[_0xb1ff('0xd')](function(_0x416d46){var _0x16c910=[];for(var _0x475661=0x0;_0x475661<_0x416d46[_0xb1ff('0x29')];_0x475661+=0x1){_0x16c910[_0xb1ff('0x2c')](_0x416d46[_0x475661][_0xb1ff('0x19')](_0x1b2cb3[_0xb1ff('0x1a')],{'transaction':_0x177026}));}return BPromise[_0xb1ff('0x2d')](_0x16c910);});})[_0xb1ff('0xd')](function(_0x23c034){logger['info']('GetContactRecallMe',_0x1b2cb3);logger[_0xb1ff('0xf')](_0xb1ff('0x3b'),_0x1b2cb3,JSON['stringify'](_0x23c034));_0x22cf26(_0x23c034);})[_0xb1ff('0x11')](function(_0x6a88f0){logger[_0xb1ff('0x12')]('GetContactRecallMe',_0x6a88f0[_0xb1ff('0x13')],_0x1b2cb3);_0x1e7e40(_0x9ed144[_0xb1ff('0x12')](0x1f4,_0x6a88f0[_0xb1ff('0x13')]));});});});};exports[_0xb1ff('0x3c')]=function(_0x416299){var _0x3800e4=this;return new Promise(function(_0x1b757f,_0xb409cb){db[_0xb1ff('0x20')][_0xb1ff('0x21')]()[_0xb1ff('0xd')](function(_0x2736bb){return db['CmHopper']['findAll']({'raw':_0x416299[_0xb1ff('0x6')]?_0x416299[_0xb1ff('0x6')][_0xb1ff('0x7')]===undefined?!![]:![]:!![],'where':_0x416299[_0xb1ff('0x6')]?_0x416299[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'attributes':_0x416299[_0xb1ff('0x6')]?_0x416299['options'][_0xb1ff('0xc')]||null:null,'limit':_0x416299[_0xb1ff('0x6')]?_0x416299[_0xb1ff('0x6')][_0xb1ff('0x3d')]||null:null,'include':_0x416299[_0xb1ff('0x6')]?_0x416299[_0xb1ff('0x6')][_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x416299['options'][_0xb1ff('0x9')],function(_0x5b6465){return{'model':db[_0x5b6465[_0xb1ff('0xb')]],'as':_0x5b6465['as'],'attributes':_0x5b6465['as']===_0xb1ff('0x3e')?_[_0xb1ff('0x27')](_0x2736bb):_0x5b6465['attributes'],'include':_0x5b6465[_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x5b6465['include'],function(_0x1ff770){return{'model':db[_0x1ff770[_0xb1ff('0xb')]],'as':_0x1ff770['as'],'attributes':_0x1ff770['attributes'],'include':_0x1ff770[_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x1ff770[_0xb1ff('0x9')],function(_0x55660f){return{'model':db[_0x55660f['model']],'as':_0x55660f['as'],'attributes':_0x55660f[_0xb1ff('0xc')]};}):[]};}):[]};}):[]:[]})[_0xb1ff('0xd')](function(_0x362443){logger[_0xb1ff('0xe')](_0xb1ff('0x4'),_0x416299);logger[_0xb1ff('0xf')]('GetCmHopper',_0x416299,JSON[_0xb1ff('0x10')](_0x362443));_0x1b757f(_0x362443);})[_0xb1ff('0x11')](function(_0x9754ec){logger[_0xb1ff('0x12')](_0xb1ff('0x4'),_0x9754ec[_0xb1ff('0x13')],_0x416299);_0xb409cb(_0x3800e4['error'](0x1f4,_0x9754ec[_0xb1ff('0x13')]));});});});};exports['GetContactByPhone']=function(_0x48ad62){var _0x5a9b5d=this;return new Promise(function(_0x1b8fda,_0x5efe0e){return db[_0xb1ff('0x20')]['findOne']({'raw':!![],'where':{'phone':_0x48ad62[_0xb1ff('0x6')][_0xb1ff('0x8')]['phone']},'attributes':['id','dialTimezone'],'order':[['id',_0xb1ff('0x3f')]]})[_0xb1ff('0xd')](function(_0x3415f3){logger[_0xb1ff('0xe')](_0xb1ff('0x40'),_0x48ad62);logger['debug']('getContactByPhone',_0x48ad62,JSON[_0xb1ff('0x10')](_0x3415f3));_0x1b8fda(_0x3415f3);})[_0xb1ff('0x11')](function(_0x539a2c){logger[_0xb1ff('0x12')](_0xb1ff('0x40'),_0x539a2c[_0xb1ff('0x13')],_0x48ad62);_0x5efe0e(_0x5a9b5d['error'](0x1f4,_0x539a2c['message']));});});};exports[_0xb1ff('0x41')]=function(_0x11cb70){var _0x28574a=this;return new Promise(function(_0x5c2d71,_0x12f4ac){return db[_0xb1ff('0x22')][_0xb1ff('0x31')](function(_0x1957d){var _0x5a7fa6=_0x11cb70[_0xb1ff('0x6')]&&_0x11cb70['options'][_0xb1ff('0x8')]?_0x11cb70[_0xb1ff('0x6')][_0xb1ff('0x8')]:{};return db[_0xb1ff('0x5')][_0xb1ff('0x19')](_0x11cb70[_0xb1ff('0x1a')],{'where':_0x5a7fa6,'transaction':_0x1957d})['then'](function(_0x5d2501){logger['info'](_0xb1ff('0x41'),_0x11cb70);logger[_0xb1ff('0xf')](_0xb1ff('0x41'),_0x11cb70,JSON[_0xb1ff('0x10')](_0x5d2501));_0x5c2d71(_0x5d2501);})[_0xb1ff('0x11')](function(_0x4c1fbf){logger['error'](_0xb1ff('0x41'),_0x4c1fbf[_0xb1ff('0x13')],_0x11cb70);_0x12f4ac(_0x28574a[_0xb1ff('0x12')](0x1f4,_0x4c1fbf['message']));});});});};exports[_0xb1ff('0x42')]=function(_0xfd0f0e){var _0x6652da=this;var _0x2d4a3b=_0xfd0f0e['body'][_0xb1ff('0x8')][_0xb1ff('0x43')];var _0x1e4d1c=_0xfd0f0e[_0xb1ff('0x1a')]['where']['interval'];var _0x1daac7=_0xfd0f0e['body'][_0xb1ff('0x8')][_0xb1ff('0x44')];return new Promise(function(_0x197d38,_0x275468){return db[_0xb1ff('0x5')]['findAll']({'where':{'voiceQueueId':{'$in':_0x2d4a3b},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xb1ff('0x22')]['literal'](_0xb1ff('0x45')+_0x1e4d1c+'\x20MINUTE'),'$gt':db[_0xb1ff('0x22')][_0xb1ff('0x35')](_0xb1ff('0x46'))}},'UserId':{'$in':_0x1daac7}},'include':[{'model':db[_0xb1ff('0x20')],'as':_0xb1ff('0x3e')},{'model':db[_0xb1ff('0x47')],'as':_0xb1ff('0x48'),'attributes':['id',_0xb1ff('0x28'),'voicePause']},{'model':db[_0xb1ff('0x49')],'as':_0xb1ff('0x4a')}]})[_0xb1ff('0xd')](function(_0xd0fd70){if(_0xd0fd70['length']>0x0){return db[_0xb1ff('0x22')][_0xb1ff('0x31')](function(_0x5e300f){return db[_0xb1ff('0x5')][_0xb1ff('0x19')]({'recallmeNotifiedDate':db['sequelize'][_0xb1ff('0x35')](_0xb1ff('0x46'))},{'where':{'id':{'$in':_['map'](_0xd0fd70,'id')}},'transaction':_0x5e300f})['then'](function(){_0x197d38(_0xd0fd70);})[_0xb1ff('0x11')](function(_0x43f9e5){logger[_0xb1ff('0x12')](_0xb1ff('0x42'),_0x43f9e5['message'],_0xfd0f0e);_0x275468(_0x6652da[_0xb1ff('0x12')](0x1f4,_0x43f9e5[_0xb1ff('0x13')]));});})[_0xb1ff('0x11')](function(_0x3a0c08){logger[_0xb1ff('0x12')](_0xb1ff('0x42'),_0x3a0c08[_0xb1ff('0x13')],_0xfd0f0e);_0x275468(_0x6652da[_0xb1ff('0x12')](0x1f4,_0x3a0c08[_0xb1ff('0x13')]));});}else{_0x197d38(_0xd0fd70);}});});}; \ No newline at end of file +var _0x009e=['create','debug','UpdateCmHopper','update','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','Contact','keys','User','name','length','UserId','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','UPDATE','GetCmHopperPreview','GetContactByPhone','findOne','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Agent','voicePause','CmList','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','limit','include','map','model','attributes','then','info','stringify','catch','error','message','ShowCmHopper','find','CreateCmHopper'];(function(_0x1108fe,_0x5315f9){var _0x30cd9d=function(_0xae37ea){while(--_0xae37ea){_0x1108fe['push'](_0x1108fe['shift']());}};_0x30cd9d(++_0x5315f9);}(_0x009e,0x1d7));var _0xe009=function(_0x23101c,_0xb416de){_0x23101c=_0x23101c-0x0;var _0x30e9af=_0x009e[_0x23101c];return _0x30e9af;};'use strict';var _=require(_0xe009('0x0'));var util=require(_0xe009('0x1'));var moment=require(_0xe009('0x2'));var BPromise=require(_0xe009('0x3'));var db=require(_0xe009('0x4'))['db'];var logger=require(_0xe009('0x5'))(_0xe009('0x6'));exports[_0xe009('0x7')]=function(_0x11c773){var _0x3a015d=this;return new Promise(function(_0x4b7bab,_0x20a8e0){return db[_0xe009('0x8')][_0xe009('0x9')]({'raw':_0x11c773[_0xe009('0xa')]?_0x11c773['options'][_0xe009('0xb')]===undefined?!![]:![]:!![],'where':_0x11c773[_0xe009('0xa')]?_0x11c773['options'][_0xe009('0xc')]||null:null,'attributes':_0x11c773[_0xe009('0xa')]?_0x11c773['options']['attributes']||null:null,'limit':_0x11c773[_0xe009('0xa')]?_0x11c773['options'][_0xe009('0xd')]||null:null,'include':_0x11c773[_0xe009('0xa')]?_0x11c773[_0xe009('0xa')][_0xe009('0xe')]?_[_0xe009('0xf')](_0x11c773[_0xe009('0xa')][_0xe009('0xe')],function(_0x4a1c80){return{'model':db[_0x4a1c80['model']],'as':_0x4a1c80['as'],'attributes':_0x4a1c80['attributes'],'include':_0x4a1c80[_0xe009('0xe')]?_['map'](_0x4a1c80['include'],function(_0xf6778e){return{'model':db[_0xf6778e[_0xe009('0x10')]],'as':_0xf6778e['as'],'attributes':_0xf6778e[_0xe009('0x11')],'include':_0xf6778e['include']?_[_0xe009('0xf')](_0xf6778e['include'],function(_0x464375){return{'model':db[_0x464375[_0xe009('0x10')]],'as':_0x464375['as'],'attributes':_0x464375[_0xe009('0x11')]};}):[]};}):[]};}):[]:[]})[_0xe009('0x12')](function(_0x3858fe){logger[_0xe009('0x13')](_0xe009('0x7'),_0x11c773);logger['debug'](_0xe009('0x7'),_0x11c773,JSON[_0xe009('0x14')](_0x3858fe));_0x4b7bab(_0x3858fe);})[_0xe009('0x15')](function(_0x4bb402){logger[_0xe009('0x16')]('GetCmHopper',_0x4bb402[_0xe009('0x17')],_0x11c773);_0x20a8e0(_0x3a015d[_0xe009('0x16')](0x1f4,_0x4bb402[_0xe009('0x17')]));});});};exports[_0xe009('0x18')]=function(_0x24796a){var _0xba27fb=this;return new Promise(function(_0x472943,_0x41a053){return db[_0xe009('0x8')][_0xe009('0x19')]({'raw':_0x24796a[_0xe009('0xa')]?_0x24796a[_0xe009('0xa')][_0xe009('0xb')]===undefined?!![]:![]:!![],'where':_0x24796a[_0xe009('0xa')]?_0x24796a[_0xe009('0xa')]['where']||null:null,'attributes':_0x24796a[_0xe009('0xa')]?_0x24796a[_0xe009('0xa')][_0xe009('0x11')]||null:null,'include':_0x24796a['options']?_0x24796a[_0xe009('0xa')][_0xe009('0xe')]?_[_0xe009('0xf')](_0x24796a['options'][_0xe009('0xe')],function(_0x304fea){return{'model':db[_0x304fea[_0xe009('0x10')]],'as':_0x304fea['as'],'attributes':_0x304fea[_0xe009('0x11')],'include':_0x304fea[_0xe009('0xe')]?_[_0xe009('0xf')](_0x304fea[_0xe009('0xe')],function(_0x279180){return{'model':db[_0x279180['model']],'as':_0x279180['as'],'attributes':_0x279180[_0xe009('0x11')],'include':_0x279180['include']?_[_0xe009('0xf')](_0x279180[_0xe009('0xe')],function(_0x4c7008){return{'model':db[_0x4c7008[_0xe009('0x10')]],'as':_0x4c7008['as'],'attributes':_0x4c7008[_0xe009('0x11')]};}):[]};}):[]};}):[]:[]})[_0xe009('0x12')](function(_0x3d7041){logger[_0xe009('0x13')](_0xe009('0x18'),_0x24796a);logger['debug'](_0xe009('0x18'),_0x24796a,JSON[_0xe009('0x14')](_0x3d7041));_0x472943(_0x3d7041);})['catch'](function(_0x2af8d6){logger[_0xe009('0x16')](_0xe009('0x18'),_0x2af8d6[_0xe009('0x17')],_0x24796a);_0x41a053(_0xba27fb[_0xe009('0x16')](0x1f4,_0x2af8d6[_0xe009('0x17')]));});});};exports[_0xe009('0x1a')]=function(_0x5d6eee){var _0x1c2dc8=this;return new Promise(function(_0x28e870,_0x310110){return db['CmHopper'][_0xe009('0x1b')](_0x5d6eee['body'],{'raw':_0x5d6eee[_0xe009('0xa')]?_0x5d6eee[_0xe009('0xa')][_0xe009('0xb')]===undefined?!![]:![]:!![]})['then'](function(_0xe6edae){logger[_0xe009('0x13')]('CreateCmHopper',_0x5d6eee);logger[_0xe009('0x1c')](_0xe009('0x1a'),_0x5d6eee,JSON[_0xe009('0x14')](_0xe6edae));_0x28e870(_0xe6edae);})[_0xe009('0x15')](function(_0x47f6c0){logger[_0xe009('0x16')]('CreateCmHopper',_0x47f6c0[_0xe009('0x17')],_0x5d6eee);_0x310110(_0x1c2dc8['error'](0x1f4,_0x47f6c0['message']));});});};exports[_0xe009('0x1d')]=function(_0xe25c0){var _0x282ad3=this;return new Promise(function(_0x29a638,_0x58aa02){return db[_0xe009('0x8')][_0xe009('0x1e')](_0xe25c0[_0xe009('0x1f')],{'raw':_0xe25c0[_0xe009('0xa')]?_0xe25c0['options'][_0xe009('0xb')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe25c0[_0xe009('0xa')]?_0xe25c0[_0xe009('0xa')][_0xe009('0xc')]||null:null,'attributes':_0xe25c0[_0xe009('0xa')]?_0xe25c0[_0xe009('0xa')][_0xe009('0x11')]||null:null,'limit':_0xe25c0[_0xe009('0xa')]?_0xe25c0[_0xe009('0xa')][_0xe009('0xd')]||null:null})['then'](function(_0x1c3a58){logger['info'](_0xe009('0x1d'),_0xe25c0);logger[_0xe009('0x13')](_0xe009('0x20'),JSON[_0xe009('0x14')](_0xe25c0[_0xe009('0xa')][_0xe009('0xc')]),_0xe25c0[_0xe009('0x1f')][_0xe009('0x21')]);logger[_0xe009('0x1c')](_0xe009('0x1d'),_0xe25c0,JSON[_0xe009('0x14')](_0x1c3a58));_0x29a638(_0x1c3a58);})[_0xe009('0x15')](function(_0x3d8d7a){logger[_0xe009('0x16')](_0xe009('0x1d'),_0x3d8d7a[_0xe009('0x17')],_0xe25c0);_0x58aa02(_0x282ad3[_0xe009('0x16')](0x1f4,_0x3d8d7a[_0xe009('0x17')]));});});};exports[_0xe009('0x22')]=function(_0x4af66f){var _0x2dc0c5=this;return new Promise(function(_0x2f93a2,_0x5686d8){return db[_0xe009('0x8')][_0xe009('0x23')]({'where':_0x4af66f[_0xe009('0xa')]?_0x4af66f['options'][_0xe009('0xc')]||null:null})['then'](function(_0x322fb6){logger[_0xe009('0x13')](_0xe009('0x22'),_0x4af66f);logger[_0xe009('0x1c')](_0xe009('0x22'),_0x4af66f,JSON[_0xe009('0x14')](_0x322fb6));_0x2f93a2(_0x322fb6);})['catch'](function(_0x17310d){logger['error'](_0xe009('0x22'),_0x17310d[_0xe009('0x17')],_0x4af66f);_0x5686d8(_0x2dc0c5[_0xe009('0x16')](0x1f4,_0x17310d[_0xe009('0x17')]));});});};exports[_0xe009('0x24')]=function(_0x56028b){var _0x1b50e0=this;return new Promise(function(_0x52fefb,_0x4318eb){return db[_0xe009('0x25')][_0xe009('0x26')]()[_0xe009('0x12')](function(_0x4152dd){return db[_0xe009('0x27')][_0xe009('0x28')](function(_0x33362){return db[_0xe009('0x8')]['findAll']({'where':_0x56028b[_0xe009('0xa')]?_0x56028b[_0xe009('0xa')][_0xe009('0xc')]||null:null,'attributes':_0x56028b[_0xe009('0xa')]?_0x56028b[_0xe009('0xa')][_0xe009('0x11')]||null:null,'limit':_0x56028b['options']?_0x56028b[_0xe009('0xa')][_0xe009('0xd')]||null:null,'order':_0x56028b['options']?_0x56028b[_0xe009('0xa')][_0xe009('0x29')]||null:null,'transaction':_0x33362,'lock':_0x33362[_0xe009('0x2a')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xe009('0x2b'),'attributes':_[_0xe009('0x2c')](_0x4152dd)},{'model':db[_0xe009('0x2d')],'as':'Agent','attributes':['id',_0xe009('0x2e'),'voicePause']}]})[_0xe009('0x12')](function(_0x24864d){var _0x463dfb=[];var _0x5f377f=[];for(var _0x3cf13c=0x0;_0x3cf13c<_0x24864d[_0xe009('0x2f')];_0x3cf13c+=0x1){var _0x5c27e4=_0x24864d[_0x3cf13c][_0xe009('0x30')];if(_0x5c27e4===null){_0x463dfb['push'](_0x24864d[_0x3cf13c][_0xe009('0x1e')](_0x56028b['body'],{'transaction':_0x33362}));}else if(!_0x5f377f['includes'](_0x5c27e4)){_0x5f377f['push'](_0x5c27e4);_0x463dfb[_0xe009('0x31')](_0x24864d[_0x3cf13c]['update'](_0x56028b[_0xe009('0x1f')],{'transaction':_0x33362}));}}return BPromise[_0xe009('0x32')](_0x463dfb);});})[_0xe009('0x12')](function(_0x2ff27b){logger[_0xe009('0x13')]('GetContactDialer',_0x56028b);if(_0x2ff27b['length']>0x0){logger[_0xe009('0x13')](_0xe009('0x33'),_0x2ff27b[0x0][_0xe009('0x34')]['id'],_0x2ff27b[0x0][_0xe009('0x34')][_0xe009('0x35')],_0x2ff27b[0x0][_0xe009('0x34')][_0xe009('0x21')]);}logger[_0xe009('0x1c')](_0xe009('0x24'),_0x56028b,JSON[_0xe009('0x14')](_0x2ff27b));_0x52fefb(_0x2ff27b);})['catch'](function(_0x4877e9){logger['error'](_0xe009('0x24'),_0x4877e9['message'],_0x56028b);_0x4318eb(_0x1b50e0[_0xe009('0x16')](0x1f4,_0x4877e9[_0xe009('0x17')]));});});});};exports[_0xe009('0x36')]=function(_0x3b7e31){var _0x2cef02=this;return new Promise(function(_0x1a34de,_0x16df49){return db['sequelize'][_0xe009('0x28')](function(_0x433fc3){return db[_0xe009('0x37')][_0xe009('0x1b')](_0x3b7e31[_0xe009('0x1f')],{'raw':_0x3b7e31[_0xe009('0xa')]?_0x3b7e31['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x433fc3})[_0xe009('0x12')](function(){logger[_0xe009('0x13')](_0xe009('0x38'),JSON[_0xe009('0x14')](_0x3b7e31['options']['where']),_0x3b7e31[_0xe009('0xa')][_0xe009('0xc')][_0xe009('0x21')]);return db[_0xe009('0x8')][_0xe009('0x23')]({'where':_0x3b7e31[_0xe009('0xa')]?_0x3b7e31[_0xe009('0xa')][_0xe009('0xc')]||null:null,'transaction':_0x433fc3});});})['then'](function(_0x41813b){logger[_0xe009('0x13')](_0xe009('0x36'),_0x3b7e31);logger[_0xe009('0x1c')](_0xe009('0x36'),_0x3b7e31,JSON[_0xe009('0x14')](_0x41813b));_0x1a34de(_0x41813b);})[_0xe009('0x15')](function(_0x5bec27){logger['error'](_0xe009('0x36'),_0x5bec27['message'],_0x3b7e31);_0x16df49(_0x2cef02['error'](0x1f4,_0x5bec27[_0xe009('0x17')]));});});};exports[_0xe009('0x39')]=function(_0x391e38){var _0x1dab26=this;return new Promise(function(_0x3b3346,_0x57b8f1){return db[_0xe009('0x8')][_0xe009('0x9')]({'raw':_0x391e38[_0xe009('0xa')]?_0x391e38[_0xe009('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x391e38[_0xe009('0xa')]?_0x391e38[_0xe009('0xa')][_0xe009('0xc')]||null:null,'attributes':[[db[_0xe009('0x27')]['fn'](_0xe009('0x3a'),db['sequelize']['fn']('IF',db[_0xe009('0x27')][_0xe009('0x3b')](_0xe009('0x3c')+util[_0xe009('0x3d')](_0xe009('0x3e'),moment()[_0xe009('0x3d')](_0xe009('0x3f')))+'\x20,\x201,\x20null'))),_0xe009('0x40')]]})['then'](function(_0x5d1035){logger[_0xe009('0x13')](_0xe009('0x39'),_0x391e38);logger['debug'](_0xe009('0x39'),_0x391e38,JSON[_0xe009('0x14')](_0x5d1035));_0x3b3346(_0x5d1035);})[_0xe009('0x15')](function(_0xb08f18){logger['error']('CountReScheduled',_0xb08f18[_0xe009('0x17')],_0x391e38);_0x57b8f1(_0x1dab26[_0xe009('0x16')](0x1f4,_0xb08f18[_0xe009('0x17')]));});});};exports[_0xe009('0x41')]=function(_0x33fd1c){var _0x55c458=this;return new Promise(function(_0x45bd73,_0x3e3d96){return db[_0xe009('0x25')][_0xe009('0x26')]()['then'](function(){return db[_0xe009('0x27')][_0xe009('0x28')](function(_0x23c42c){return db[_0xe009('0x8')][_0xe009('0x9')]({'where':_0x33fd1c[_0xe009('0xa')]?_0x33fd1c[_0xe009('0xa')][_0xe009('0xc')]||null:null,'attributes':_0x33fd1c['options']?_0x33fd1c[_0xe009('0xa')][_0xe009('0x11')]||null:null,'limit':0x1,'order':_0x33fd1c['options']?_0x33fd1c['options'][_0xe009('0x29')]||null:null,'group':db['CmHopper'][_0xe009('0x30')],'transaction':_0x23c42c,'lock':_0x23c42c['LOCK'][_0xe009('0x42')],'include':_0x33fd1c[_0xe009('0xa')]?_0x33fd1c[_0xe009('0xa')][_0xe009('0xe')]?_['map'](_0x33fd1c['options'][_0xe009('0xe')],function(_0x55c23b){return{'model':db[_0x55c23b[_0xe009('0x10')]],'as':_0x55c23b['as'],'attributes':_0x55c23b[_0xe009('0x11')],'include':_0x55c23b['include']?_[_0xe009('0xf')](_0x55c23b[_0xe009('0xe')],function(_0x376a69){return{'model':db[_0x376a69[_0xe009('0x10')]],'as':_0x376a69['as'],'attributes':_0x376a69[_0xe009('0x11')],'include':_0x376a69[_0xe009('0xe')]?_[_0xe009('0xf')](_0x376a69['include'],function(_0x2d5081){return{'model':db[_0x2d5081[_0xe009('0x10')]],'as':_0x2d5081['as'],'attributes':_0x2d5081[_0xe009('0x11')]};}):[]};}):[]};}):[]:[]})[_0xe009('0x12')](function(_0xbc0bf3){var _0x1af6a1=[];for(var _0x23f2f7=0x0;_0x23f2f7<_0xbc0bf3[_0xe009('0x2f')];_0x23f2f7+=0x1){_0x1af6a1[_0xe009('0x31')](_0xbc0bf3[_0x23f2f7][_0xe009('0x1e')](_0x33fd1c['body'],{'transaction':_0x23c42c}));}return BPromise[_0xe009('0x32')](_0x1af6a1);});})[_0xe009('0x12')](function(_0xb76d38){logger[_0xe009('0x13')](_0xe009('0x41'),_0x33fd1c);logger[_0xe009('0x1c')](_0xe009('0x41'),_0x33fd1c,JSON[_0xe009('0x14')](_0xb76d38));_0x45bd73(_0xb76d38);})[_0xe009('0x15')](function(_0x372b3f){logger[_0xe009('0x16')](_0xe009('0x41'),_0x372b3f[_0xe009('0x17')],_0x33fd1c);_0x3e3d96(_0x55c458[_0xe009('0x16')](0x1f4,_0x372b3f[_0xe009('0x17')]));});});});};exports[_0xe009('0x43')]=function(_0x1d7b09){var _0x1699dd=this;return new Promise(function(_0x298e41,_0x11805e){db['CmContact'][_0xe009('0x26')]()[_0xe009('0x12')](function(_0x55b197){return db['CmHopper'][_0xe009('0x9')]({'raw':_0x1d7b09[_0xe009('0xa')]?_0x1d7b09[_0xe009('0xa')][_0xe009('0xb')]===undefined?!![]:![]:!![],'where':_0x1d7b09[_0xe009('0xa')]?_0x1d7b09[_0xe009('0xa')][_0xe009('0xc')]||null:null,'attributes':_0x1d7b09[_0xe009('0xa')]?_0x1d7b09['options'][_0xe009('0x11')]||null:null,'limit':_0x1d7b09[_0xe009('0xa')]?_0x1d7b09[_0xe009('0xa')]['limit']||null:null,'include':_0x1d7b09['options']?_0x1d7b09['options'][_0xe009('0xe')]?_[_0xe009('0xf')](_0x1d7b09[_0xe009('0xa')][_0xe009('0xe')],function(_0x42f12b){return{'model':db[_0x42f12b[_0xe009('0x10')]],'as':_0x42f12b['as'],'attributes':_0x42f12b['as']===_0xe009('0x2b')?_['keys'](_0x55b197):_0x42f12b[_0xe009('0x11')],'include':_0x42f12b[_0xe009('0xe')]?_[_0xe009('0xf')](_0x42f12b[_0xe009('0xe')],function(_0x64b56d){return{'model':db[_0x64b56d['model']],'as':_0x64b56d['as'],'attributes':_0x64b56d[_0xe009('0x11')],'include':_0x64b56d[_0xe009('0xe')]?_['map'](_0x64b56d[_0xe009('0xe')],function(_0x500edd){return{'model':db[_0x500edd[_0xe009('0x10')]],'as':_0x500edd['as'],'attributes':_0x500edd[_0xe009('0x11')]};}):[]};}):[]};}):[]:[]})[_0xe009('0x12')](function(_0xd49de7){logger[_0xe009('0x13')]('GetCmHopper',_0x1d7b09);logger[_0xe009('0x1c')]('GetCmHopper',_0x1d7b09,JSON[_0xe009('0x14')](_0xd49de7));_0x298e41(_0xd49de7);})[_0xe009('0x15')](function(_0x15ac2b){logger['error']('GetCmHopper',_0x15ac2b[_0xe009('0x17')],_0x1d7b09);_0x11805e(_0x1699dd[_0xe009('0x16')](0x1f4,_0x15ac2b[_0xe009('0x17')]));});});});};exports[_0xe009('0x44')]=function(_0x45e4d0){var _0x4797f1=this;return new Promise(function(_0x1105e1,_0x5b31c9){return db[_0xe009('0x25')][_0xe009('0x45')]({'raw':!![],'where':{'phone':_0x45e4d0[_0xe009('0xa')][_0xe009('0xc')]['phone']},'attributes':['id','dialTimezone'],'order':[['id',_0xe009('0x46')]]})['then'](function(_0x2841b1){logger['info'](_0xe009('0x47'),_0x45e4d0);logger[_0xe009('0x1c')]('getContactByPhone',_0x45e4d0,JSON[_0xe009('0x14')](_0x2841b1));_0x1105e1(_0x2841b1);})[_0xe009('0x15')](function(_0x4d7b3b){logger[_0xe009('0x16')]('getContactByPhone',_0x4d7b3b[_0xe009('0x17')],_0x45e4d0);_0x5b31c9(_0x4797f1['error'](0x1f4,_0x4d7b3b[_0xe009('0x17')]));});});};exports[_0xe009('0x48')]=function(_0x341efd){var _0x250100=this;return new Promise(function(_0x14992a,_0x185249){return db[_0xe009('0x27')][_0xe009('0x28')](function(_0x1cebde){var _0x1cfd06=_0x341efd[_0xe009('0xa')]&&_0x341efd['options'][_0xe009('0xc')]?_0x341efd[_0xe009('0xa')][_0xe009('0xc')]:{};return db[_0xe009('0x8')]['update'](_0x341efd[_0xe009('0x1f')],{'where':_0x1cfd06,'transaction':_0x1cebde})['then'](function(_0x1a0252){logger['info'](_0xe009('0x48'),_0x341efd);logger['debug']('ResetActiveCalls',_0x341efd,JSON[_0xe009('0x14')](_0x1a0252));_0x14992a(_0x1a0252);})[_0xe009('0x15')](function(_0x562fd6){logger[_0xe009('0x16')](_0xe009('0x48'),_0x562fd6[_0xe009('0x17')],_0x341efd);_0x185249(_0x250100['error'](0x1f4,_0x562fd6[_0xe009('0x17')]));});});});};exports[_0xe009('0x49')]=function(_0x3b19ff){var _0x2f0990=this;var _0x1a6221=_0x3b19ff[_0xe009('0x1f')][_0xe009('0xc')]['voiceQueueIds'];var _0x57bb94=_0x3b19ff['body']['where'][_0xe009('0x4a')];var _0x1e8d73=_0x3b19ff[_0xe009('0x1f')][_0xe009('0xc')][_0xe009('0x4b')];return new Promise(function(_0x24783a,_0x4df52c){return db[_0xe009('0x8')][_0xe009('0x9')]({'where':{'voiceQueueId':{'$in':_0x1a6221},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xe009('0x27')][_0xe009('0x3b')](_0xe009('0x4c')+_0x57bb94+_0xe009('0x4d')),'$gt':db[_0xe009('0x27')][_0xe009('0x3b')](_0xe009('0x4e'))}},'UserId':{'$in':_0x1e8d73}},'include':[{'model':db[_0xe009('0x25')],'as':_0xe009('0x2b')},{'model':db[_0xe009('0x2d')],'as':_0xe009('0x4f'),'attributes':['id',_0xe009('0x2e'),_0xe009('0x50')]},{'model':db[_0xe009('0x51')],'as':_0xe009('0x52')}]})[_0xe009('0x12')](function(_0x52604a){if(_0x52604a['length']>0x0){return db[_0xe009('0x27')]['transaction'](function(_0xf2f51f){return db[_0xe009('0x8')][_0xe009('0x1e')]({'recallmeNotifiedDate':db['sequelize'][_0xe009('0x3b')](_0xe009('0x4e'))},{'where':{'id':{'$in':_[_0xe009('0xf')](_0x52604a,'id')}},'transaction':_0xf2f51f})[_0xe009('0x12')](function(){_0x24783a(_0x52604a);})['catch'](function(_0x2c9816){logger[_0xe009('0x16')](_0xe009('0x49'),_0x2c9816['message'],_0x3b19ff);_0x4df52c(_0x2f0990[_0xe009('0x16')](0x1f4,_0x2c9816[_0xe009('0x17')]));});})[_0xe009('0x15')](function(_0x2d35b1){logger[_0xe009('0x16')]('CmHopperHandlePreviewRecallNotifications',_0x2d35b1['message'],_0x3b19ff);_0x4df52c(_0x2f0990[_0xe009('0x16')](0x1f4,_0x2d35b1[_0xe009('0x17')]));});}else{_0x24783a(_0x52604a);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 70f9f26..5be99ac 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 _0xe7ee=['update','delete','destroy','exports','express','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','getOpenContacts','/timezones','getTimezones','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','put','/:id'];(function(_0x3126b6,_0x450061){var _0x116531=function(_0x4db330){while(--_0x4db330){_0x3126b6['push'](_0x3126b6['shift']());}};_0x116531(++_0x450061);}(_0xe7ee,0x19c));var _0xee7e=function(_0x3ad60e,_0xbc948){_0x3ad60e=_0x3ad60e-0x0;var _0x23dddb=_0xe7ee[_0x3ad60e];return _0x23dddb;};'use strict';var express=require(_0xee7e('0x0'));var router=express['Router']();var auth=require(_0xee7e('0x1'));var controller=require(_0xee7e('0x2'));router['get']('/',auth[_0xee7e('0x3')](),controller[_0xee7e('0x4')]);router[_0xee7e('0x5')](_0xee7e('0x6'),auth['isAuthenticated'](),controller[_0xee7e('0x7')]);router['get']('/opencontacts',auth['isAuthenticated'](),controller[_0xee7e('0x8')]);router[_0xee7e('0x5')](_0xee7e('0x9'),auth[_0xee7e('0x3')](),controller[_0xee7e('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xee7e('0x5')](_0xee7e('0xb'),auth['isAuthenticated'](),controller[_0xee7e('0xc')]);router[_0xee7e('0xd')]('/',auth['isAuthenticated'](),controller[_0xee7e('0xe')]);router[_0xee7e('0xd')](_0xee7e('0xf'),auth[_0xee7e('0x3')](),controller[_0xee7e('0x10')]);router[_0xee7e('0xd')](_0xee7e('0x11'),auth[_0xee7e('0x3')](),controller['getTimezone']);router[_0xee7e('0x12')](_0xee7e('0x13'),auth['isAuthenticated'](),controller[_0xee7e('0x14')]);router[_0xee7e('0x15')]('/:id',auth[_0xee7e('0x3')](),controller[_0xee7e('0x16')]);module[_0xee7e('0x17')]=router; \ No newline at end of file +var _0xaed4=['/:id','show','getPreviewRecall','post','create','/preview','/timezone','getTimezone','update','destroy','Router','./cmHopper.controller','get','isAuthenticated','index','/describe','getOpenContacts','/timezones','getTimezones'];(function(_0x4eb51d,_0xc4ddea){var _0xbf88b9=function(_0xf5b603){while(--_0xf5b603){_0x4eb51d['push'](_0x4eb51d['shift']());}};_0xbf88b9(++_0xc4ddea);}(_0xaed4,0xb5));var _0x4aed=function(_0x63cf23,_0x360999){_0x63cf23=_0x63cf23-0x0;var _0x30960c=_0xaed4[_0x63cf23];return _0x30960c;};'use strict';var express=require('express');var router=express[_0x4aed('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x4aed('0x1'));router[_0x4aed('0x2')]('/',auth[_0x4aed('0x3')](),controller[_0x4aed('0x4')]);router[_0x4aed('0x2')](_0x4aed('0x5'),auth[_0x4aed('0x3')](),controller['describe']);router[_0x4aed('0x2')]('/opencontacts',auth[_0x4aed('0x3')](),controller[_0x4aed('0x6')]);router[_0x4aed('0x2')](_0x4aed('0x7'),auth['isAuthenticated'](),controller[_0x4aed('0x8')]);router[_0x4aed('0x2')](_0x4aed('0x9'),auth[_0x4aed('0x3')](),controller[_0x4aed('0xa')]);router[_0x4aed('0x2')]('/:id/previewrecall',auth['isAuthenticated'](),controller[_0x4aed('0xb')]);router[_0x4aed('0xc')]('/',auth[_0x4aed('0x3')](),controller[_0x4aed('0xd')]);router['post'](_0x4aed('0xe'),auth['isAuthenticated'](),controller['getPreview']);router[_0x4aed('0xc')](_0x4aed('0xf'),auth[_0x4aed('0x3')](),controller[_0x4aed('0x10')]);router['put']('/:id',auth[_0x4aed('0x3')](),controller[_0x4aed('0x11')]);router['delete'](_0x4aed('0x9'),auth['isAuthenticated'](),controller[_0x4aed('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 4d0751e..ffd6e01 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2c1=['INTEGER','STRING','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0xb2c1,0x184));var _0x1b2c=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0xb2c1[_0x44c768];return _0x55daf5;};'use strict';var moment=require(_0x1b2c('0x0'));var Sequelize=require(_0x1b2c('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x1b2c('0x2')]},'phone':{'type':Sequelize[_0x1b2c('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x1b2c('0x4')](_0x1b2c('0x5'))},'countbusyretry':{'type':Sequelize[_0x1b2c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1b2c('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x1b2c('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1b2c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1b2c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1b2c('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9515=['format','moment','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x12b911,_0x283b38){var _0x3e3205=function(_0x3b8343){while(--_0x3b8343){_0x12b911['push'](_0x12b911['shift']());}};_0x3e3205(++_0x283b38);}(_0x9515,0x1eb));var _0x5951=function(_0x56fc41,_0x550632){_0x56fc41=_0x56fc41-0x0;var _0x2de570=_0x9515[_0x56fc41];return _0x2de570;};'use strict';var moment=require(_0x5951('0x0'));var Sequelize=require(_0x5951('0x1'));module[_0x5951('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x5951('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x5951('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x5951('0x5')],'defaultValue':moment()[_0x5951('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x5951('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5951('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5951('0x4')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x5951('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5951('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5951('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 27e47aa..4a46905 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab58=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','reject','save','destroy','then','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','options','where','CmHopperAdditionalPhone','findAll','params','length','includeAll','include','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2b9d4d,_0x54b7c0){var _0x1b04ee=function(_0x408d1f){while(--_0x408d1f){_0x2b9d4d['push'](_0x2b9d4d['shift']());}};_0x1b04ee(++_0x54b7c0);}(_0xab58,0x133));var _0x8ab5=function(_0x318b00,_0xddcc1a){_0x318b00=_0x318b00-0x0;var _0x2deae5=_0xab58[_0x318b00];return _0x2deae5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ab5('0x0'));var zipdir=require(_0x8ab5('0x1'));var jsonpatch=require(_0x8ab5('0x2'));var rp=require('request-promise');var moment=require(_0x8ab5('0x3'));var BPromise=require(_0x8ab5('0x4'));var Mustache=require(_0x8ab5('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8ab5('0x6'));var csv=require(_0x8ab5('0x7'));var ejs=require(_0x8ab5('0x8'));var fs=require('fs');var fs_extra=require(_0x8ab5('0x9'));var _=require(_0x8ab5('0xa'));var squel=require(_0x8ab5('0xb'));var crypto=require(_0x8ab5('0xc'));var jsforce=require(_0x8ab5('0xd'));var deskjs=require(_0x8ab5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8ab5('0xf'));var Redis=require(_0x8ab5('0x10'));var authService=require(_0x8ab5('0x11'));var qs=require(_0x8ab5('0x12'));var as=require(_0x8ab5('0x13'));var hardwareService=require(_0x8ab5('0x14'));var logger=require(_0x8ab5('0x15'))('api');var utils=require(_0x8ab5('0x16'));var config=require(_0x8ab5('0x17'));var licenseUtil=require(_0x8ab5('0x18'));var db=require(_0x8ab5('0x19'))['db'];function respondWithStatusCode(_0x43680b,_0x4c2e9c){_0x4c2e9c=_0x4c2e9c||0xcc;return function(_0x50679a){if(_0x50679a){return _0x43680b[_0x8ab5('0x1a')](_0x4c2e9c);}return _0x43680b['status'](_0x4c2e9c)['end']();};}function respondWithResult(_0x5ac153,_0x3a09a0){_0x3a09a0=_0x3a09a0||0xc8;return function(_0x7fc6f9){if(_0x7fc6f9){return _0x5ac153['status'](_0x3a09a0)[_0x8ab5('0x1b')](_0x7fc6f9);}};}function respondWithFilteredResult(_0x429afc,_0x260068){return function(_0x4770d5){if(_0x4770d5){var _0x4b01e3=typeof _0x260068[_0x8ab5('0x1c')]===_0x8ab5('0x1d')&&typeof _0x260068[_0x8ab5('0x1e')]===_0x8ab5('0x1d');var _0x1c934c=_0x4770d5['count'];var _0x3d3299=_0x4b01e3?0x0:_0x260068['offset'];var _0x471f1b=_0x4b01e3?_0x4770d5[_0x8ab5('0x1f')]:_0x260068[_0x8ab5('0x1c')]+_0x260068[_0x8ab5('0x1e')];var _0x347c72;if(_0x471f1b>=_0x1c934c){_0x471f1b=_0x1c934c;_0x347c72=0xc8;}else{_0x347c72=0xce;}_0x429afc[_0x8ab5('0x20')](_0x347c72);return _0x429afc['set']('Content-Range',_0x3d3299+'-'+_0x471f1b+'/'+_0x1c934c)[_0x8ab5('0x1b')](_0x4770d5);}return null;};}function patchUpdates(_0x3ad500){return function(_0x3e802b){try{jsonpatch['apply'](_0x3e802b,_0x3ad500,!![]);}catch(_0x3e9990){return BPromise[_0x8ab5('0x21')](_0x3e9990);}return _0x3e802b[_0x8ab5('0x22')]();};}function saveUpdates(_0x2671f3,_0x505fcb){return function(_0x554c14){if(_0x554c14){return _0x554c14['update'](_0x2671f3)['then'](function(_0x397c20){return _0x397c20;});}return null;};}function removeEntity(_0x4a547b,_0x307fe4){return function(_0x36f4b9){if(_0x36f4b9){return _0x36f4b9[_0x8ab5('0x23')]()[_0x8ab5('0x24')](function(){var _0x15fbfa=_0x36f4b9[_0x8ab5('0x25')]({'plain':!![]});var _0x16e911=_0x8ab5('0x26');return db[_0x8ab5('0x27')][_0x8ab5('0x23')]({'where':{'type':_0x16e911,'resourceId':_0x15fbfa['id']}})['then'](function(){return _0x36f4b9;});})[_0x8ab5('0x24')](function(){_0x4a547b[_0x8ab5('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d1d11,_0x4c2b0a){return function(_0x2de530){if(!_0x2de530){_0x2d1d11[_0x8ab5('0x1a')](0x194);}return _0x2de530;};}function handleError(_0xb4e09,_0x457b69){_0x457b69=_0x457b69||0x1f4;return function(_0x10034d){logger[_0x8ab5('0x28')](_0x10034d[_0x8ab5('0x29')]);if(_0x10034d['name']){delete _0x10034d[_0x8ab5('0x2a')];}_0xb4e09[_0x8ab5('0x20')](_0x457b69)[_0x8ab5('0x2b')](_0x10034d);};}exports[_0x8ab5('0x2c')]=function(_0x174f16,_0x3c5cf8){var _0x491984={},_0xaaa20e={},_0x3f48e5={'count':0x0,'rows':[]};var _0x1c2b75=_[_0x8ab5('0x2d')](db['CmHopperAdditionalPhone'][_0x8ab5('0x2e')],function(_0x5316d7){return{'name':_0x5316d7[_0x8ab5('0x2f')],'type':_0x5316d7[_0x8ab5('0x30')][_0x8ab5('0x31')]};});_0xaaa20e['model']=_[_0x8ab5('0x2d')](_0x1c2b75,_0x8ab5('0x2a'));_0xaaa20e[_0x8ab5('0x32')]=_[_0x8ab5('0x33')](_0x174f16[_0x8ab5('0x32')]);_0xaaa20e[_0x8ab5('0x34')]=_[_0x8ab5('0x35')](_0xaaa20e[_0x8ab5('0x36')],_0xaaa20e[_0x8ab5('0x32')]);_0x491984['attributes']=_[_0x8ab5('0x35')](_0xaaa20e[_0x8ab5('0x36')],qs[_0x8ab5('0x37')](_0x174f16[_0x8ab5('0x32')][_0x8ab5('0x37')]));_0x491984[_0x8ab5('0x38')]=_0x491984['attributes']['length']?_0x491984[_0x8ab5('0x38')]:_0xaaa20e['model'];if(!_0x174f16[_0x8ab5('0x32')][_0x8ab5('0x39')](_0x8ab5('0x3a'))){_0x491984['limit']=qs[_0x8ab5('0x1e')](_0x174f16[_0x8ab5('0x32')][_0x8ab5('0x1e')]);_0x491984[_0x8ab5('0x1c')]=qs['offset'](_0x174f16['query'][_0x8ab5('0x1c')]);}_0x491984[_0x8ab5('0x3b')]=qs[_0x8ab5('0x3c')](_0x174f16['query'][_0x8ab5('0x3c')]);_0x491984['where']=qs['filters'](_[_0x8ab5('0x3d')](_0x174f16['query'],_0xaaa20e['filters']),_0x1c2b75);if(_0x174f16[_0x8ab5('0x32')][_0x8ab5('0x3e')]){_0x491984['where']=_[_0x8ab5('0x3f')](_0x491984['where'],{'$or':_[_0x8ab5('0x2d')](_0x1c2b75,function(_0x170c98){if(_0x170c98[_0x8ab5('0x30')]!=='VIRTUAL'){var _0x50d235={};_0x50d235[_0x170c98[_0x8ab5('0x2a')]]={'$like':'%'+_0x174f16[_0x8ab5('0x32')][_0x8ab5('0x3e')]+'%'};return _0x50d235;}})});}_0x491984=_[_0x8ab5('0x3f')]({},_0x491984,_0x174f16[_0x8ab5('0x40')]);var _0x2f5d19={'where':_0x491984[_0x8ab5('0x41')]};return db[_0x8ab5('0x42')][_0x8ab5('0x1f')](_0x2f5d19)['then'](function(_0x341162){_0x3f48e5[_0x8ab5('0x1f')]=_0x341162;if(_0x174f16[_0x8ab5('0x32')]['includeAll']){_0x491984['include']=[{'all':!![]}];}return db[_0x8ab5('0x42')][_0x8ab5('0x43')](_0x491984);})['then'](function(_0x2a0e82){_0x3f48e5['rows']=_0x2a0e82;return _0x3f48e5;})[_0x8ab5('0x24')](respondWithFilteredResult(_0x3c5cf8,_0x491984))['catch'](handleError(_0x3c5cf8,null));};exports['show']=function(_0x1cb282,_0x250de5){var _0x3650e7={'raw':!![],'where':{'id':_0x1cb282[_0x8ab5('0x44')]['id']}},_0x5a1fc3={};_0x5a1fc3[_0x8ab5('0x36')]=_[_0x8ab5('0x33')](db[_0x8ab5('0x42')][_0x8ab5('0x2e')]);_0x5a1fc3['query']=_[_0x8ab5('0x33')](_0x1cb282[_0x8ab5('0x32')]);_0x5a1fc3[_0x8ab5('0x34')]=_['intersection'](_0x5a1fc3[_0x8ab5('0x36')],_0x5a1fc3[_0x8ab5('0x32')]);_0x3650e7[_0x8ab5('0x38')]=_[_0x8ab5('0x35')](_0x5a1fc3[_0x8ab5('0x36')],qs[_0x8ab5('0x37')](_0x1cb282[_0x8ab5('0x32')]['fields']));_0x3650e7['attributes']=_0x3650e7[_0x8ab5('0x38')][_0x8ab5('0x45')]?_0x3650e7[_0x8ab5('0x38')]:_0x5a1fc3[_0x8ab5('0x36')];if(_0x1cb282[_0x8ab5('0x32')][_0x8ab5('0x46')]){_0x3650e7[_0x8ab5('0x47')]=[{'all':!![]}];}_0x3650e7=_[_0x8ab5('0x3f')]({},_0x3650e7,_0x1cb282['options']);return db[_0x8ab5('0x42')][_0x8ab5('0x48')](_0x3650e7)[_0x8ab5('0x24')](handleEntityNotFound(_0x250de5,null))['then'](respondWithResult(_0x250de5,null))[_0x8ab5('0x49')](handleError(_0x250de5,null));};exports['create']=function(_0x2b2347,_0x393705){return db[_0x8ab5('0x42')][_0x8ab5('0x4a')](_0x2b2347['body'],{})[_0x8ab5('0x24')](function(_0x253beb){var _0x5f07e0=_0x2b2347['user'][_0x8ab5('0x25')]({'plain':!![]});if(!_0x5f07e0)throw new Error(_0x8ab5('0x4b'));if(_0x5f07e0['role']===_0x8ab5('0x4c')){var _0x2e9bdf=_0x253beb[_0x8ab5('0x25')]({'plain':!![]});var _0x268878=_0x8ab5('0x26');return db['UserProfileSection'][_0x8ab5('0x48')]({'where':{'name':_0x268878,'userProfileId':_0x5f07e0['userProfileId']},'raw':!![]})[_0x8ab5('0x24')](function(_0x2226ae){if(_0x2226ae&&_0x2226ae['autoAssociation']===0x0){return db[_0x8ab5('0x27')][_0x8ab5('0x4a')]({'name':_0x2e9bdf[_0x8ab5('0x2a')],'resourceId':_0x2e9bdf['id'],'type':_0x2226ae[_0x8ab5('0x2a')],'sectionId':_0x2226ae['id']},{})[_0x8ab5('0x24')](function(){return _0x253beb;});}else{return _0x253beb;}})[_0x8ab5('0x49')](function(_0x2b3ac8){logger[_0x8ab5('0x28')](_0x8ab5('0x4d'),_0x2b3ac8);throw _0x2b3ac8;});}return _0x253beb;})[_0x8ab5('0x24')](respondWithResult(_0x393705,0xc9))[_0x8ab5('0x49')](handleError(_0x393705,null));};exports[_0x8ab5('0x4e')]=function(_0x56fabd,_0x5ad6f6){if(_0x56fabd[_0x8ab5('0x4f')]['id']){delete _0x56fabd['body']['id'];}return db[_0x8ab5('0x42')][_0x8ab5('0x48')]({'where':{'id':_0x56fabd['params']['id']}})[_0x8ab5('0x24')](handleEntityNotFound(_0x5ad6f6,null))[_0x8ab5('0x24')](saveUpdates(_0x56fabd['body'],null))[_0x8ab5('0x24')](respondWithResult(_0x5ad6f6,null))['catch'](handleError(_0x5ad6f6,null));};exports[_0x8ab5('0x23')]=function(_0x1d4ea0,_0x33d3ec){return db['CmHopperAdditionalPhone'][_0x8ab5('0x48')]({'where':{'id':_0x1d4ea0[_0x8ab5('0x44')]['id']}})[_0x8ab5('0x24')](handleEntityNotFound(_0x33d3ec,null))[_0x8ab5('0x24')](removeEntity(_0x33d3ec,null))[_0x8ab5('0x49')](handleError(_0x33d3ec,null));}; \ No newline at end of file +var _0xa2d8=['json','apply','reject','save','update','get','CmHopperAdditionalPhones','UserProfileResource','destroy','then','sendStatus','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','limit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','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','catch','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0xa2d8,0xdd));var _0x8a2d=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa2d8[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x8a2d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a2d('0x1'));var jsonpatch=require(_0x8a2d('0x2'));var rp=require(_0x8a2d('0x3'));var moment=require('moment');var BPromise=require(_0x8a2d('0x4'));var Mustache=require(_0x8a2d('0x5'));var util=require(_0x8a2d('0x6'));var path=require('path');var sox=require(_0x8a2d('0x7'));var csv=require(_0x8a2d('0x8'));var ejs=require(_0x8a2d('0x9'));var fs=require('fs');var fs_extra=require(_0x8a2d('0xa'));var _=require(_0x8a2d('0xb'));var squel=require(_0x8a2d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8a2d('0xd'));var toCsv=require(_0x8a2d('0x8'));var querystring=require(_0x8a2d('0xe'));var Papa=require(_0x8a2d('0xf'));var Redis=require(_0x8a2d('0x10'));var authService=require(_0x8a2d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8a2d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a2d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8a2d('0x14'));var licenseUtil=require(_0x8a2d('0x15'));var db=require(_0x8a2d('0x16'))['db'];function respondWithStatusCode(_0x5e314a,_0x4946ac){_0x4946ac=_0x4946ac||0xcc;return function(_0x28ca01){if(_0x28ca01){return _0x5e314a['sendStatus'](_0x4946ac);}return _0x5e314a[_0x8a2d('0x17')](_0x4946ac)[_0x8a2d('0x18')]();};}function respondWithResult(_0x52b976,_0x8a7e10){_0x8a7e10=_0x8a7e10||0xc8;return function(_0x26033e){if(_0x26033e){return _0x52b976['status'](_0x8a7e10)['json'](_0x26033e);}};}function respondWithFilteredResult(_0x5050ad,_0xe8d97f){return function(_0x4a6364){if(_0x4a6364){var _0x398a29=typeof _0xe8d97f[_0x8a2d('0x19')]===_0x8a2d('0x1a')&&typeof _0xe8d97f['limit']===_0x8a2d('0x1a');var _0xb9c98f=_0x4a6364[_0x8a2d('0x1b')];var _0x281998=_0x398a29?0x0:_0xe8d97f[_0x8a2d('0x19')];var _0x33cf07=_0x398a29?_0x4a6364['count']:_0xe8d97f['offset']+_0xe8d97f['limit'];var _0x1e1f40;if(_0x33cf07>=_0xb9c98f){_0x33cf07=_0xb9c98f;_0x1e1f40=0xc8;}else{_0x1e1f40=0xce;}_0x5050ad['status'](_0x1e1f40);return _0x5050ad['set']('Content-Range',_0x281998+'-'+_0x33cf07+'/'+_0xb9c98f)[_0x8a2d('0x1c')](_0x4a6364);}return null;};}function patchUpdates(_0x56a457){return function(_0x20c23c){try{jsonpatch[_0x8a2d('0x1d')](_0x20c23c,_0x56a457,!![]);}catch(_0x15db3d){return BPromise[_0x8a2d('0x1e')](_0x15db3d);}return _0x20c23c[_0x8a2d('0x1f')]();};}function saveUpdates(_0x4a5cda,_0x5bdd85){return function(_0x1ab8ef){if(_0x1ab8ef){return _0x1ab8ef[_0x8a2d('0x20')](_0x4a5cda)['then'](function(_0x58f327){return _0x58f327;});}return null;};}function removeEntity(_0x38287a,_0x3f2b34){return function(_0x572593){if(_0x572593){return _0x572593['destroy']()['then'](function(){var _0x51d1a6=_0x572593[_0x8a2d('0x21')]({'plain':!![]});var _0x3b3799=_0x8a2d('0x22');return db[_0x8a2d('0x23')][_0x8a2d('0x24')]({'where':{'type':_0x3b3799,'resourceId':_0x51d1a6['id']}})[_0x8a2d('0x25')](function(){return _0x572593;});})[_0x8a2d('0x25')](function(){_0x38287a[_0x8a2d('0x17')](0xcc)[_0x8a2d('0x18')]();});}};}function handleEntityNotFound(_0x4c012a,_0xcb0077){return function(_0x592c79){if(!_0x592c79){_0x4c012a[_0x8a2d('0x26')](0x194);}return _0x592c79;};}function handleError(_0x52ca4a,_0x5206d5){_0x5206d5=_0x5206d5||0x1f4;return function(_0x503ced){logger[_0x8a2d('0x27')](_0x503ced[_0x8a2d('0x28')]);if(_0x503ced[_0x8a2d('0x29')]){delete _0x503ced[_0x8a2d('0x29')];}_0x52ca4a[_0x8a2d('0x17')](_0x5206d5)[_0x8a2d('0x2a')](_0x503ced);};}exports[_0x8a2d('0x2b')]=function(_0x512cd8,_0xfaad6c){var _0xd2f4e9={},_0x9f2f72={},_0x5b5161={'count':0x0,'rows':[]};var _0x4f736e=_[_0x8a2d('0x2c')](db[_0x8a2d('0x2d')][_0x8a2d('0x2e')],function(_0xc24813){return{'name':_0xc24813[_0x8a2d('0x2f')],'type':_0xc24813[_0x8a2d('0x30')][_0x8a2d('0x31')]};});_0x9f2f72[_0x8a2d('0x32')]=_['map'](_0x4f736e,_0x8a2d('0x29'));_0x9f2f72['query']=_[_0x8a2d('0x33')](_0x512cd8['query']);_0x9f2f72['filters']=_[_0x8a2d('0x34')](_0x9f2f72['model'],_0x9f2f72[_0x8a2d('0x35')]);_0xd2f4e9['attributes']=_[_0x8a2d('0x34')](_0x9f2f72[_0x8a2d('0x32')],qs['fields'](_0x512cd8[_0x8a2d('0x35')][_0x8a2d('0x36')]));_0xd2f4e9[_0x8a2d('0x37')]=_0xd2f4e9[_0x8a2d('0x37')][_0x8a2d('0x38')]?_0xd2f4e9[_0x8a2d('0x37')]:_0x9f2f72[_0x8a2d('0x32')];if(!_0x512cd8[_0x8a2d('0x35')][_0x8a2d('0x39')]('nolimit')){_0xd2f4e9[_0x8a2d('0x3a')]=qs['limit'](_0x512cd8[_0x8a2d('0x35')][_0x8a2d('0x3a')]);_0xd2f4e9[_0x8a2d('0x19')]=qs[_0x8a2d('0x19')](_0x512cd8[_0x8a2d('0x35')][_0x8a2d('0x19')]);}_0xd2f4e9[_0x8a2d('0x3b')]=qs[_0x8a2d('0x3c')](_0x512cd8[_0x8a2d('0x35')][_0x8a2d('0x3c')]);_0xd2f4e9['where']=qs[_0x8a2d('0x3d')](_[_0x8a2d('0x3e')](_0x512cd8[_0x8a2d('0x35')],_0x9f2f72[_0x8a2d('0x3d')]),_0x4f736e);if(_0x512cd8['query'][_0x8a2d('0x3f')]){_0xd2f4e9[_0x8a2d('0x40')]=_['merge'](_0xd2f4e9[_0x8a2d('0x40')],{'$or':_[_0x8a2d('0x2c')](_0x4f736e,function(_0x58d5e9){if(_0x58d5e9[_0x8a2d('0x30')]!==_0x8a2d('0x41')){var _0xf3a67f={};_0xf3a67f[_0x58d5e9['name']]={'$like':'%'+_0x512cd8[_0x8a2d('0x35')][_0x8a2d('0x3f')]+'%'};return _0xf3a67f;}})});}_0xd2f4e9=_[_0x8a2d('0x42')]({},_0xd2f4e9,_0x512cd8[_0x8a2d('0x43')]);var _0xb90d4a={'where':_0xd2f4e9[_0x8a2d('0x40')]};return db['CmHopperAdditionalPhone']['count'](_0xb90d4a)[_0x8a2d('0x25')](function(_0x4d3bef){_0x5b5161[_0x8a2d('0x1b')]=_0x4d3bef;if(_0x512cd8[_0x8a2d('0x35')][_0x8a2d('0x44')]){_0xd2f4e9[_0x8a2d('0x45')]=[{'all':!![]}];}return db[_0x8a2d('0x2d')]['findAll'](_0xd2f4e9);})[_0x8a2d('0x25')](function(_0x1bfcb4){_0x5b5161[_0x8a2d('0x46')]=_0x1bfcb4;return _0x5b5161;})[_0x8a2d('0x25')](respondWithFilteredResult(_0xfaad6c,_0xd2f4e9))['catch'](handleError(_0xfaad6c,null));};exports['show']=function(_0x27147f,_0x21ae17){var _0x2fb91e={'raw':!![],'where':{'id':_0x27147f['params']['id']}},_0x4c2c84={};_0x4c2c84[_0x8a2d('0x32')]=_[_0x8a2d('0x33')](db[_0x8a2d('0x2d')][_0x8a2d('0x2e')]);_0x4c2c84['query']=_['keys'](_0x27147f[_0x8a2d('0x35')]);_0x4c2c84[_0x8a2d('0x3d')]=_[_0x8a2d('0x34')](_0x4c2c84['model'],_0x4c2c84[_0x8a2d('0x35')]);_0x2fb91e['attributes']=_[_0x8a2d('0x34')](_0x4c2c84[_0x8a2d('0x32')],qs[_0x8a2d('0x36')](_0x27147f[_0x8a2d('0x35')][_0x8a2d('0x36')]));_0x2fb91e['attributes']=_0x2fb91e['attributes'][_0x8a2d('0x38')]?_0x2fb91e['attributes']:_0x4c2c84[_0x8a2d('0x32')];if(_0x27147f[_0x8a2d('0x35')][_0x8a2d('0x44')]){_0x2fb91e[_0x8a2d('0x45')]=[{'all':!![]}];}_0x2fb91e=_['merge']({},_0x2fb91e,_0x27147f[_0x8a2d('0x43')]);return db[_0x8a2d('0x2d')][_0x8a2d('0x47')](_0x2fb91e)[_0x8a2d('0x25')](handleEntityNotFound(_0x21ae17,null))[_0x8a2d('0x25')](respondWithResult(_0x21ae17,null))['catch'](handleError(_0x21ae17,null));};exports[_0x8a2d('0x48')]=function(_0x119b2a,_0x3c9736){return db[_0x8a2d('0x2d')][_0x8a2d('0x48')](_0x119b2a[_0x8a2d('0x49')],{})[_0x8a2d('0x25')](function(_0x26b044){var _0xbe5dd2=_0x119b2a[_0x8a2d('0x4a')][_0x8a2d('0x21')]({'plain':!![]});if(!_0xbe5dd2)throw new Error(_0x8a2d('0x4b'));if(_0xbe5dd2[_0x8a2d('0x4c')]===_0x8a2d('0x4a')){var _0x4e7005=_0x26b044['get']({'plain':!![]});var _0x5a0ccf=_0x8a2d('0x22');return db[_0x8a2d('0x4d')]['find']({'where':{'name':_0x5a0ccf,'userProfileId':_0xbe5dd2[_0x8a2d('0x4e')]},'raw':!![]})['then'](function(_0x213205){if(_0x213205&&_0x213205[_0x8a2d('0x4f')]===0x0){return db[_0x8a2d('0x23')]['create']({'name':_0x4e7005[_0x8a2d('0x29')],'resourceId':_0x4e7005['id'],'type':_0x213205['name'],'sectionId':_0x213205['id']},{})[_0x8a2d('0x25')](function(){return _0x26b044;});}else{return _0x26b044;}})['catch'](function(_0x3289ca){logger[_0x8a2d('0x27')](_0x8a2d('0x50'),_0x3289ca);throw _0x3289ca;});}return _0x26b044;})[_0x8a2d('0x25')](respondWithResult(_0x3c9736,0xc9))[_0x8a2d('0x51')](handleError(_0x3c9736,null));};exports[_0x8a2d('0x20')]=function(_0x214644,_0x2b1811){if(_0x214644[_0x8a2d('0x49')]['id']){delete _0x214644[_0x8a2d('0x49')]['id'];}return db[_0x8a2d('0x2d')][_0x8a2d('0x47')]({'where':{'id':_0x214644[_0x8a2d('0x52')]['id']}})[_0x8a2d('0x25')](handleEntityNotFound(_0x2b1811,null))[_0x8a2d('0x25')](saveUpdates(_0x214644[_0x8a2d('0x49')],null))[_0x8a2d('0x25')](respondWithResult(_0x2b1811,null))[_0x8a2d('0x51')](handleError(_0x2b1811,null));};exports['destroy']=function(_0x25a1f7,_0x43c0fa){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x25a1f7[_0x8a2d('0x52')]['id']}})['then'](handleEntityNotFound(_0x43c0fa,null))['then'](removeEntity(_0x43c0fa,null))[_0x8a2d('0x51')](handleError(_0x43c0fa,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index a3badf2..69b028f 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x159f=['request-promise','path','../../config/environment','./cmHopperAdditionalPhone.attributes','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3f1f66,_0x18227a){var _0x323fd1=function(_0x173bde){while(--_0x173bde){_0x3f1f66['push'](_0x3f1f66['shift']());}};_0x323fd1(++_0x18227a);}(_0x159f,0x10d));var _0xf159=function(_0x250793,_0x1797b2){_0x250793=_0x250793-0x0;var _0x43228d=_0x159f[_0x250793];return _0x43228d;};'use strict';var _=require(_0xf159('0x0'));var util=require(_0xf159('0x1'));var logger=require(_0xf159('0x2'))(_0xf159('0x3'));var moment=require(_0xf159('0x4'));var BPromise=require(_0xf159('0x5'));var rp=require(_0xf159('0x6'));var fs=require('fs');var path=require(_0xf159('0x7'));var rimraf=require('rimraf');var config=require(_0xf159('0x8'));var attributes=require(_0xf159('0x9'));module['exports']=function(_0x36a09a,_0x18ec74){return _0x36a09a['define']('CmHopperAdditionalPhone',attributes,{'tableName':_0xf159('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c05=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','CmHopperAdditionalPhone'];(function(_0xe9066,_0x23a99b){var _0x3fbde1=function(_0x57c75f){while(--_0x57c75f){_0xe9066['push'](_0xe9066['shift']());}};_0x3fbde1(++_0x23a99b);}(_0x8c05,0x1e4));var _0x58c0=function(_0x1274f5,_0x3ddb6b){_0x1274f5=_0x1274f5-0x0;var _0x5542db=_0x8c05[_0x1274f5];return _0x5542db;};'use strict';var _=require(_0x58c0('0x0'));var util=require(_0x58c0('0x1'));var logger=require(_0x58c0('0x2'))(_0x58c0('0x3'));var moment=require(_0x58c0('0x4'));var BPromise=require(_0x58c0('0x5'));var rp=require(_0x58c0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58c0('0x7'));var config=require(_0x58c0('0x8'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x58c0('0x9')]=function(_0x24c584,_0x390e54){return _0x24c584['define'](_0x58c0('0xa'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 1b162b9..13ff65c 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56b5=['request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countnosuchnumberretry','countdropretry','entity','findOne','countcongestionretry','countnoanswerretry','countmachineretry','catch','waitTime','duration','isNil','scheduledat','add','minutes','phone','countbusyretry','countabandonedretry','countagentrejectretry','createdAt','updatedAt','transaction','update','activateAdditionalPhone','field','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xc8b6ff,_0xe4f956){var _0x1b09e4=function(_0x2c3ef7){while(--_0x2c3ef7){_0xc8b6ff['push'](_0xc8b6ff['shift']());}};_0x1b09e4(++_0xe4f956);}(_0x56b5,0x65));var _0x556b=function(_0x2080da,_0x4930df){_0x2080da=_0x2080da-0x0;var _0x2cd2bd=_0x56b5[_0x2080da];return _0x2cd2bd;};'use strict';var _=require(_0x556b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x556b('0x1'));var fs=require('fs');var Redis=require(_0x556b('0x2'));var db=require(_0x556b('0x3'))['db'];var utils=require(_0x556b('0x4'));var logger=require(_0x556b('0x5'))(_0x556b('0x6'));var config=require(_0x556b('0x7'));var jayson=require(_0x556b('0x8'));var client=jayson[_0x556b('0x9')][_0x556b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b80c1,_0x523d2b,_0x44e87c){return new BPromise(function(_0x17e77e,_0x9265d5){return client[_0x556b('0xb')](_0x3b80c1,_0x44e87c)['then'](function(_0x5ba566){logger[_0x556b('0xc')](_0x556b('0xd'),_0x523d2b,'request\x20sent');logger[_0x556b('0xe')](_0x556b('0xf'),_0x523d2b,_0x556b('0x10'),JSON['stringify'](_0x5ba566));if(_0x5ba566[_0x556b('0x11')]){if(_0x5ba566[_0x556b('0x11')][_0x556b('0x12')]===0x1f4){logger[_0x556b('0x11')](_0x556b('0xd'),_0x523d2b,_0x5ba566[_0x556b('0x11')][_0x556b('0x13')]);return _0x9265d5(_0x5ba566[_0x556b('0x11')][_0x556b('0x13')]);}logger[_0x556b('0x11')](_0x556b('0xd'),_0x523d2b,_0x5ba566[_0x556b('0x11')][_0x556b('0x13')]);return _0x17e77e(_0x5ba566['error'][_0x556b('0x13')]);}else{logger[_0x556b('0xc')](_0x556b('0xd'),_0x523d2b,_0x556b('0x10'));_0x17e77e(_0x5ba566[_0x556b('0x14')][_0x556b('0x13')]);}})['catch'](function(_0x5e68b5){logger[_0x556b('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x523d2b,_0x5e68b5);_0x9265d5(_0x5e68b5);});});}exports[_0x556b('0x15')]=function(_0xa5557){var _0x1ef509=this;return new Promise(function(_0x2ad756,_0x5603fa){return db[_0x556b('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0xa5557[_0x556b('0x17')][_0x556b('0x18')],'ListId':_0xa5557[_0x556b('0x17')][_0x556b('0x19')],'VoiceQueueId':_0xa5557[_0x556b('0x17')]['VoiceQueueId']===undefined?null:_0xa5557['body'][_0x556b('0x1a')],'CampaignId':_0xa5557[_0x556b('0x17')][_0x556b('0x1b')]===undefined?null:_0xa5557[_0x556b('0x17')]['CampaignId']}})[_0x556b('0x1c')](function(_0xb9c454){if(_0xb9c454!=null){return db[_0x556b('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xb9c454['id'],'OrderBy':{'$gt':_0xb9c454[_0x556b('0x1e')]}},'order':[[_0x556b('0x1e'),_0x556b('0x1f')]]})[_0x556b('0x1c')](function(_0x29644e){var _0x53843a=0x0;if(_0x29644e){if(_0x29644e['countbusyretry']+_0x29644e['countcongestionretry']+_0x29644e['countnoanswerretry']+_0x29644e[_0x556b('0x20')]+_0x29644e[_0x556b('0x21')]+_0x29644e['countabandonedretry']+_0x29644e['countmachineretry']+_0x29644e['countagentrejectretry']<_0xa5557[_0x556b('0x22')]['dialGlobalMaxRetry'])_0x53843a=0x1;_0x2ad756({'additional':_0x53843a});}else{return db['CmHopperAdditionalPhone'][_0x556b('0x23')]({'raw':!![],'where':{'CmHopperId':_0xb9c454['id']},'order':[[_0x556b('0x1e'),_0x556b('0x1f')]]})[_0x556b('0x1c')](function(_0x1b9138){var _0x2ddbfc=0x0;if(_0x1b9138){if(_0x1b9138['countbusyretry']+_0x1b9138[_0x556b('0x24')]+_0x1b9138[_0x556b('0x25')]+_0x1b9138[_0x556b('0x20')]+_0x1b9138['countdropretry']+_0x1b9138['countabandonedretry']+_0x1b9138[_0x556b('0x26')]+_0x1b9138['countagentrejectretry']<_0xa5557[_0x556b('0x22')]['dialGlobalMaxRetry'])_0x2ddbfc=0x1;_0x2ad756({'additional':_0x2ddbfc});}else{_0x2ad756({'additional':0x0});}})[_0x556b('0x27')](function(_0x5f42db){logger[_0x556b('0x11')](_0x556b('0x15'),_0x5f42db[_0x556b('0x13')]);_0x5603fa(_0x1ef509[_0x556b('0x11')](0x1f4,_0x5f42db['message']));});}})[_0x556b('0x27')](function(_0x54317b){logger['error'](_0x556b('0x15'),_0x54317b[_0x556b('0x13')]);_0x5603fa(_0x1ef509[_0x556b('0x11')](0x1f4,_0x54317b['message']));});}else _0x2ad756({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x5baa13){var _0x37ea46=this;return new Promise(function(_0x340e23,_0x3d34f3){return db[_0x556b('0x16')][_0x556b('0x23')]({'raw':!![],'where':{'ContactId':_0x5baa13['body'][_0x556b('0x18')],'ListId':_0x5baa13[_0x556b('0x17')][_0x556b('0x19')],'VoiceQueueId':_0x5baa13[_0x556b('0x17')][_0x556b('0x1a')]===undefined?null:_0x5baa13['body'][_0x556b('0x1a')],'CampaignId':_0x5baa13[_0x556b('0x17')][_0x556b('0x1b')]===undefined?null:_0x5baa13[_0x556b('0x17')]['CampaignId']}})['then'](function(_0x4e7124){if(_0x4e7124!=null){return db['CmHopperAdditionalPhone'][_0x556b('0x23')]({'raw':!![],'where':{'CmHopperId':_0x4e7124['id'],'OrderBy':{'$gte':_0x4e7124[_0x556b('0x1e')]}},'order':[[_0x556b('0x1e'),_0x556b('0x1f')]]})[_0x556b('0x1c')](function(_0xcd13ba){if(_0xcd13ba)return activateAdditionalPhone(_0x4e7124,_0x5baa13[_0x556b('0x17')],_0xcd13ba,_0x5baa13['duration'],_0x5baa13[_0x556b('0x28')])[_0x556b('0x1c')](function(_0x237d84){_0x340e23(_0x237d84);});else{return db['CmHopperAdditionalPhone'][_0x556b('0x23')]({'raw':!![],'where':{'CmHopperId':_0x4e7124['id']},'order':[[_0x556b('0x1e'),_0x556b('0x1f')]]})[_0x556b('0x1c')](function(_0x422b3d){if(_0x422b3d)return activateAdditionalPhone(_0x4e7124,_0x5baa13[_0x556b('0x17')],_0x422b3d,_0x5baa13[_0x556b('0x29')],_0x5baa13['waitTime'])[_0x556b('0x1c')](function(_0x1a1900){_0x340e23(_0x1a1900);});else{_0x340e23({'id':_0x4e7124['id'],'phone':''});}})[_0x556b('0x27')](function(_0x3a50d1){logger[_0x556b('0x11')]('VerifyAdditionalPhones',_0x3a50d1['message']);_0x3d34f3(_0x37ea46[_0x556b('0x11')](0x1f4,_0x3a50d1[_0x556b('0x13')]));});}})[_0x556b('0x27')](function(_0x1d630b){logger['error']('VerifyAdditionalPhones',_0x1d630b[_0x556b('0x13')]);_0x3d34f3(_0x37ea46[_0x556b('0x11')](0x1f4,_0x1d630b[_0x556b('0x13')]));});}else _0x340e23(0x1);});});};function activateAdditionalPhone(_0x4a4af8,_0x5c6ae5,_0x572237,_0x385cb2,_0x245b22){return new Promise(function(_0x3f073c,_0x56fa1d){var _0x13c86d;if(_[_0x556b('0x2a')](_0x572237[_0x556b('0x2b')])){_0x572237[_0x556b('0x2b')]=moment();}if(moment()>moment(_0x572237['scheduledat'])){_0x13c86d=moment()[_0x556b('0x2c')](_0x245b22||0x3,'minutes');}else{if(_0x572237[_0x556b('0x1e')]==0x0){_0x13c86d=moment(_0x572237[_0x556b('0x2b')]);}else{_0x13c86d=moment()[_0x556b('0x2c')](_0x245b22||0x3,_0x556b('0x2d'));}}if(_[_0x556b('0x2a')](_0x13c86d)){_0x13c86d=moment()[_0x556b('0x2c')](_0x245b22||0x3,_0x556b('0x2d'));}var _0x392d08={'phone':_0x4a4af8[_0x556b('0x2e')],'active':0x0,'OrderBy':_[_0x556b('0x2a')](_0x4a4af8['OrderBy'])?0x0:_0x4a4af8[_0x556b('0x1e')],'scheduledat':moment()[_0x556b('0x2c')](_0x385cb2||0x1,_0x556b('0x2d')),'countbusyretry':_0x5c6ae5[_0x556b('0x2f')],'countcongestionretry':_0x5c6ae5[_0x556b('0x24')],'countnoanswerretry':_0x5c6ae5[_0x556b('0x25')],'countnosuchnumberretry':_0x5c6ae5['countnosuchnumberretry'],'countdropretry':_0x5c6ae5['countdropretry'],'countabandonedretry':_0x5c6ae5[_0x556b('0x30')],'countmachineretry':_0x5c6ae5[_0x556b('0x26')],'countagentrejectretry':_0x5c6ae5[_0x556b('0x31')],'createdAt':_0x5c6ae5[_0x556b('0x32')],'updatedAt':_0x5c6ae5[_0x556b('0x33')]};var _0x587457={'CmHopperId':_0x4a4af8['id'],'phone':_0x572237[_0x556b('0x2e')],'active':0x0,'OrderBy':_[_0x556b('0x2a')](_0x572237[_0x556b('0x1e')])?0x0:_0x572237[_0x556b('0x1e')],'scheduledat':_0x13c86d,'countbusyretry':_0x572237[_0x556b('0x2f')],'countcongestionretry':_0x572237[_0x556b('0x24')],'countnoanswerretry':_0x572237[_0x556b('0x25')],'countnosuchnumberretry':_0x572237['countnosuchnumberretry'],'countdropretry':_0x572237[_0x556b('0x21')],'countabandonedretry':_0x572237[_0x556b('0x30')],'countmachineretry':_0x572237[_0x556b('0x26')],'countagentrejectretry':_0x572237[_0x556b('0x31')],'createdAt':_0x572237[_0x556b('0x32')],'updatedAt':_0x572237[_0x556b('0x33')]};return db['sequelize'][_0x556b('0x34')](function(_0x5c8e1e){return db['CmHopperAdditionalPhone'][_0x556b('0x35')](_0x392d08,{'where':{'id':_0x572237['id']}},{'transaction':_0x5c8e1e})[_0x556b('0x1c')](function(){return db[_0x556b('0x16')][_0x556b('0x35')](_0x587457,{'where':{'id':_0x4a4af8['id']}},{'transaction':_0x5c8e1e});});})[_0x556b('0x1c')](function(_0x2c97c5){_0x3f073c({'id':_0x4a4af8['id'],'phone':_0x572237[_0x556b('0x2e')]});})[_0x556b('0x27')](function(_0x5d8105){logger[_0x556b('0x11')](_0x556b('0x36'),_0x5d8105[_0x556b('0x13')]);_0x56fa1d({'error':_0x5d8105[_0x556b('0x13')]});});});}exports['IncrementPreviewCounters']=function(_0x13e139){var _0x45c64d=this;return new Promise(function(_0x192965,_0x552b1c){return db[_0x556b('0x16')][_0x556b('0x35')](_0x13e139[_0x556b('0x17')][_0x556b('0x37')],{'where':{'id':_0x13e139[_0x556b('0x17')]['id']}})['then'](function(_0x17e920){_0x192965(_0x17e920);})[_0x556b('0x27')](function(_0x56a7bc){logger['error']('IncrementPreviewCounters',_0x56a7bc[_0x556b('0x13')]);_0x552b1c(_0x45c64d['error'](0x1f4,_0x56a7bc[_0x556b('0x13')]));});});}; \ No newline at end of file +var _0xf570=['add','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','field','IncrementPreviewCounters','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countbusyretry','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat'];(function(_0x29fea4,_0x3e6c73){var _0x37bb47=function(_0x25c3c5){while(--_0x25c3c5){_0x29fea4['push'](_0x29fea4['shift']());}};_0x37bb47(++_0x3e6c73);}(_0xf570,0x7a));var _0x0f57=function(_0x5fa560,_0x3d14b2){_0x5fa560=_0x5fa560-0x0;var _0x4758ab=_0xf570[_0x5fa560];return _0x4758ab;};'use strict';var _=require(_0x0f57('0x0'));var util=require(_0x0f57('0x1'));var moment=require(_0x0f57('0x2'));var BPromise=require(_0x0f57('0x3'));var rs=require(_0x0f57('0x4'));var fs=require('fs');var Redis=require(_0x0f57('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f57('0x6'));var logger=require('../../config/logger')(_0x0f57('0x7'));var config=require('../../config/environment');var jayson=require(_0x0f57('0x8'));var client=jayson[_0x0f57('0x9')][_0x0f57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35d1db,_0x560739,_0x4bb57f){return new BPromise(function(_0x4a7b97,_0x17b745){return client['request'](_0x35d1db,_0x4bb57f)[_0x0f57('0xb')](function(_0x43904c){logger[_0x0f57('0xc')](_0x0f57('0xd'),_0x560739,_0x0f57('0xe'));logger['debug'](_0x0f57('0xf'),_0x560739,'request\x20sent',JSON[_0x0f57('0x10')](_0x43904c));if(_0x43904c[_0x0f57('0x11')]){if(_0x43904c['error']['code']===0x1f4){logger[_0x0f57('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x560739,_0x43904c[_0x0f57('0x11')][_0x0f57('0x12')]);return _0x17b745(_0x43904c[_0x0f57('0x11')][_0x0f57('0x12')]);}logger[_0x0f57('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x560739,_0x43904c[_0x0f57('0x11')][_0x0f57('0x12')]);return _0x4a7b97(_0x43904c['error']['message']);}else{logger['info'](_0x0f57('0xd'),_0x560739,_0x0f57('0xe'));_0x4a7b97(_0x43904c[_0x0f57('0x13')][_0x0f57('0x12')]);}})[_0x0f57('0x14')](function(_0x311a31){logger['error'](_0x0f57('0xd'),_0x560739,_0x311a31);_0x17b745(_0x311a31);});});}exports[_0x0f57('0x15')]=function(_0xc45790){var _0x235876=this;return new Promise(function(_0x3721e8,_0x4f4971){return db[_0x0f57('0x16')][_0x0f57('0x17')]({'raw':!![],'where':{'ContactId':_0xc45790[_0x0f57('0x18')][_0x0f57('0x19')],'ListId':_0xc45790[_0x0f57('0x18')]['ListId'],'VoiceQueueId':_0xc45790[_0x0f57('0x18')][_0x0f57('0x1a')]===undefined?null:_0xc45790[_0x0f57('0x18')][_0x0f57('0x1a')],'CampaignId':_0xc45790['body'][_0x0f57('0x1b')]===undefined?null:_0xc45790[_0x0f57('0x18')][_0x0f57('0x1b')]}})[_0x0f57('0xb')](function(_0x38ed45){if(_0x38ed45!=null){return db[_0x0f57('0x1c')][_0x0f57('0x17')]({'raw':!![],'where':{'CmHopperId':_0x38ed45['id'],'OrderBy':{'$gt':_0x38ed45[_0x0f57('0x1d')]}},'order':[[_0x0f57('0x1d'),_0x0f57('0x1e')]]})['then'](function(_0x598fa9){var _0x23d027=0x0;if(_0x598fa9){if(_0x598fa9['countbusyretry']+_0x598fa9[_0x0f57('0x1f')]+_0x598fa9[_0x0f57('0x20')]+_0x598fa9[_0x0f57('0x21')]+_0x598fa9[_0x0f57('0x22')]+_0x598fa9[_0x0f57('0x23')]+_0x598fa9[_0x0f57('0x24')]+_0x598fa9[_0x0f57('0x25')]<_0xc45790[_0x0f57('0x26')][_0x0f57('0x27')])_0x23d027=0x1;_0x3721e8({'additional':_0x23d027});}else{return db[_0x0f57('0x1c')][_0x0f57('0x17')]({'raw':!![],'where':{'CmHopperId':_0x38ed45['id']},'order':[[_0x0f57('0x1d'),_0x0f57('0x1e')]]})[_0x0f57('0xb')](function(_0x2a25f4){var _0x82a88d=0x0;if(_0x2a25f4){if(_0x2a25f4[_0x0f57('0x28')]+_0x2a25f4[_0x0f57('0x1f')]+_0x2a25f4[_0x0f57('0x20')]+_0x2a25f4[_0x0f57('0x21')]+_0x2a25f4[_0x0f57('0x22')]+_0x2a25f4['countabandonedretry']+_0x2a25f4['countmachineretry']+_0x2a25f4[_0x0f57('0x25')]<_0xc45790[_0x0f57('0x26')][_0x0f57('0x27')])_0x82a88d=0x1;_0x3721e8({'additional':_0x82a88d});}else{_0x3721e8({'additional':0x0});}})[_0x0f57('0x14')](function(_0x37fb43){logger[_0x0f57('0x11')](_0x0f57('0x15'),_0x37fb43[_0x0f57('0x12')]);_0x4f4971(_0x235876[_0x0f57('0x11')](0x1f4,_0x37fb43[_0x0f57('0x12')]));});}})['catch'](function(_0x52f58d){logger['error'](_0x0f57('0x15'),_0x52f58d['message']);_0x4f4971(_0x235876[_0x0f57('0x11')](0x1f4,_0x52f58d[_0x0f57('0x12')]));});}else _0x3721e8({'additional':0x0});});});};exports[_0x0f57('0x29')]=function(_0xdaa08){var _0x4e4fd2=this;return new Promise(function(_0x359be4,_0xe0ab24){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0xdaa08[_0x0f57('0x18')]['ContactId'],'ListId':_0xdaa08['body']['ListId'],'VoiceQueueId':_0xdaa08[_0x0f57('0x18')]['VoiceQueueId']===undefined?null:_0xdaa08[_0x0f57('0x18')][_0x0f57('0x1a')],'CampaignId':_0xdaa08[_0x0f57('0x18')][_0x0f57('0x1b')]===undefined?null:_0xdaa08[_0x0f57('0x18')][_0x0f57('0x1b')]}})[_0x0f57('0xb')](function(_0x2d5018){if(_0x2d5018!=null){return db[_0x0f57('0x1c')][_0x0f57('0x17')]({'raw':!![],'where':{'CmHopperId':_0x2d5018['id'],'OrderBy':{'$gte':_0x2d5018['OrderBy']}},'order':[['OrderBy',_0x0f57('0x1e')]]})[_0x0f57('0xb')](function(_0x3f547d){if(_0x3f547d)return activateAdditionalPhone(_0x2d5018,_0xdaa08['body'],_0x3f547d,_0xdaa08[_0x0f57('0x2a')],_0xdaa08[_0x0f57('0x2b')])['then'](function(_0x4c6e1e){_0x359be4(_0x4c6e1e);});else{return db[_0x0f57('0x1c')][_0x0f57('0x17')]({'raw':!![],'where':{'CmHopperId':_0x2d5018['id']},'order':[[_0x0f57('0x1d'),_0x0f57('0x1e')]]})['then'](function(_0x411816){if(_0x411816)return activateAdditionalPhone(_0x2d5018,_0xdaa08[_0x0f57('0x18')],_0x411816,_0xdaa08[_0x0f57('0x2a')],_0xdaa08[_0x0f57('0x2b')])[_0x0f57('0xb')](function(_0x343e8c){_0x359be4(_0x343e8c);});else{_0x359be4({'id':_0x2d5018['id'],'phone':''});}})[_0x0f57('0x14')](function(_0x189639){logger[_0x0f57('0x11')](_0x0f57('0x15'),_0x189639['message']);_0xe0ab24(_0x4e4fd2['error'](0x1f4,_0x189639[_0x0f57('0x12')]));});}})[_0x0f57('0x14')](function(_0x3a7c5d){logger[_0x0f57('0x11')]('VerifyAdditionalPhones',_0x3a7c5d[_0x0f57('0x12')]);_0xe0ab24(_0x4e4fd2[_0x0f57('0x11')](0x1f4,_0x3a7c5d[_0x0f57('0x12')]));});}else _0x359be4(0x1);});});};function activateAdditionalPhone(_0xe5b6f7,_0x109494,_0x3f31e1,_0x1cb425,_0x49b5ce){return new Promise(function(_0x536e70,_0x4e1e58){var _0x10f35e;if(_[_0x0f57('0x2c')](_0x3f31e1[_0x0f57('0x2d')])){_0x3f31e1[_0x0f57('0x2d')]=moment();}if(moment()>moment(_0x3f31e1['scheduledat'])){_0x10f35e=moment()[_0x0f57('0x2e')](_0x49b5ce||0x3,'minutes');}else{if(_0x3f31e1[_0x0f57('0x1d')]==0x0){_0x10f35e=moment(_0x3f31e1[_0x0f57('0x2d')]);}else{_0x10f35e=moment()[_0x0f57('0x2e')](_0x49b5ce||0x3,'minutes');}}if(_[_0x0f57('0x2c')](_0x10f35e)){_0x10f35e=moment()['add'](_0x49b5ce||0x3,'minutes');}var _0x585ff5={'phone':_0xe5b6f7[_0x0f57('0x2f')],'active':0x0,'OrderBy':_[_0x0f57('0x2c')](_0xe5b6f7[_0x0f57('0x1d')])?0x0:_0xe5b6f7[_0x0f57('0x1d')],'scheduledat':moment()[_0x0f57('0x2e')](_0x1cb425||0x1,'minutes'),'countbusyretry':_0x109494[_0x0f57('0x28')],'countcongestionretry':_0x109494[_0x0f57('0x1f')],'countnoanswerretry':_0x109494[_0x0f57('0x20')],'countnosuchnumberretry':_0x109494['countnosuchnumberretry'],'countdropretry':_0x109494[_0x0f57('0x22')],'countabandonedretry':_0x109494['countabandonedretry'],'countmachineretry':_0x109494[_0x0f57('0x24')],'countagentrejectretry':_0x109494[_0x0f57('0x25')],'createdAt':_0x109494[_0x0f57('0x30')],'updatedAt':_0x109494['updatedAt']};var _0x16ac50={'CmHopperId':_0xe5b6f7['id'],'phone':_0x3f31e1[_0x0f57('0x2f')],'active':0x0,'OrderBy':_[_0x0f57('0x2c')](_0x3f31e1[_0x0f57('0x1d')])?0x0:_0x3f31e1[_0x0f57('0x1d')],'scheduledat':_0x10f35e,'countbusyretry':_0x3f31e1['countbusyretry'],'countcongestionretry':_0x3f31e1[_0x0f57('0x1f')],'countnoanswerretry':_0x3f31e1[_0x0f57('0x20')],'countnosuchnumberretry':_0x3f31e1[_0x0f57('0x21')],'countdropretry':_0x3f31e1[_0x0f57('0x22')],'countabandonedretry':_0x3f31e1[_0x0f57('0x23')],'countmachineretry':_0x3f31e1[_0x0f57('0x24')],'countagentrejectretry':_0x3f31e1[_0x0f57('0x25')],'createdAt':_0x3f31e1[_0x0f57('0x30')],'updatedAt':_0x3f31e1[_0x0f57('0x31')]};return db[_0x0f57('0x32')][_0x0f57('0x33')](function(_0x3c0459){return db[_0x0f57('0x1c')][_0x0f57('0x34')](_0x585ff5,{'where':{'id':_0x3f31e1['id']}},{'transaction':_0x3c0459})['then'](function(){return db['CmHopper'][_0x0f57('0x34')](_0x16ac50,{'where':{'id':_0xe5b6f7['id']}},{'transaction':_0x3c0459});});})['then'](function(_0x516528){_0x536e70({'id':_0xe5b6f7['id'],'phone':_0x3f31e1['phone']});})['catch'](function(_0x3711e0){logger[_0x0f57('0x11')](_0x0f57('0x35'),_0x3711e0[_0x0f57('0x12')]);_0x4e1e58({'error':_0x3711e0[_0x0f57('0x12')]});});});}exports['IncrementPreviewCounters']=function(_0x2862ce){var _0x51d00=this;return new Promise(function(_0x45da21,_0xf9e57d){return db[_0x0f57('0x16')][_0x0f57('0x34')](_0x2862ce[_0x0f57('0x18')][_0x0f57('0x36')],{'where':{'id':_0x2862ce[_0x0f57('0x18')]['id']}})[_0x0f57('0xb')](function(_0x50a2ae){_0x45da21(_0x50a2ae);})[_0x0f57('0x14')](function(_0x3e32a7){logger[_0x0f57('0x11')](_0x0f57('0x37'),_0x3e32a7['message']);_0xf9e57d(_0x51d00[_0x0f57('0x11')](0x1f4,_0x3e32a7[_0x0f57('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index d3eb4e4..d13f7ed 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fa9=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','index','get','/:id','isAuthenticated','post','create','put','update','destroy','exports','util','path'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0x9fa9,0xb2));var _0x99fa=function(_0x591cc6,_0x1e5305){_0x591cc6=_0x591cc6-0x0;var _0x41bd60=_0x9fa9[_0x591cc6];return _0x41bd60;};'use strict';var multer=require('multer');var util=require(_0x99fa('0x0'));var path=require(_0x99fa('0x1'));var timeout=require('connect-timeout');var express=require(_0x99fa('0x2'));var router=express['Router']();var fs_extra=require(_0x99fa('0x3'));var auth=require(_0x99fa('0x4'));var interaction=require(_0x99fa('0x5'));var config=require(_0x99fa('0x6'));var controller=require(_0x99fa('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x99fa('0x8')]);router[_0x99fa('0x9')](_0x99fa('0xa'),auth[_0x99fa('0xb')](),controller['show']);router[_0x99fa('0xc')]('/',auth[_0x99fa('0xb')](),controller[_0x99fa('0xd')]);router[_0x99fa('0xe')](_0x99fa('0xa'),auth[_0x99fa('0xb')](),controller[_0x99fa('0xf')]);router['delete'](_0x99fa('0xa'),auth['isAuthenticated'](),controller[_0x99fa('0x10')]);module[_0x99fa('0x11')]=router; \ No newline at end of file +var _0xfb07=['show','create','put','update','exports','multer','express','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','isAuthenticated','index','/:id'];(function(_0x385401,_0x2dff2f){var _0x119c8a=function(_0x2758e4){while(--_0x2758e4){_0x385401['push'](_0x385401['shift']());}};_0x119c8a(++_0x2dff2f);}(_0xfb07,0x94));var _0x7fb0=function(_0x2451ab,_0x37e9d9){_0x2451ab=_0x2451ab-0x0;var _0x1b38de=_0xfb07[_0x2451ab];return _0x1b38de;};'use strict';var multer=require(_0x7fb0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7fb0('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7fb0('0x2'));var interaction=require(_0x7fb0('0x3'));var config=require('../../config/environment');var controller=require(_0x7fb0('0x4'));router['get']('/',auth[_0x7fb0('0x5')](),controller[_0x7fb0('0x6')]);router['get'](_0x7fb0('0x7'),auth[_0x7fb0('0x5')](),controller[_0x7fb0('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7fb0('0x9')]);router[_0x7fb0('0xa')]('/:id',auth[_0x7fb0('0x5')](),controller[_0x7fb0('0xb')]);router['delete']('/:id',auth[_0x7fb0('0x5')](),controller['destroy']);module[_0x7fb0('0xc')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index e5b58c0..18cbf65 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 _0x8251=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x2b03cb,_0x21dcad){var _0x32bb4a=function(_0x46e4f7){while(--_0x46e4f7){_0x2b03cb['push'](_0x2b03cb['shift']());}};_0x32bb4a(++_0x21dcad);}(_0x8251,0x1cf));var _0x1825=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x8251[_0x199572];return _0x13cfa3;};'use strict';var moment=require(_0x1825('0x0'));var Sequelize=require(_0x1825('0x1'));module[_0x1825('0x2')]={'phone':{'type':Sequelize[_0x1825('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x1825('0x4')],'unique':_0x1825('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x1825('0x5')},'VoiceQueueId':{'type':Sequelize[_0x1825('0x4')],'unique':_0x1825('0x5')}}; \ No newline at end of file +var _0x386f=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x386f,0x11a));var _0xf386=function(_0x3b6775,_0x223931){_0x3b6775=_0x3b6775-0x0;var _0xe93b9f=_0x386f[_0x3b6775];return _0xe93b9f;};'use strict';var moment=require(_0xf386('0x0'));var Sequelize=require(_0xf386('0x1'));module[_0xf386('0x2')]={'phone':{'type':Sequelize[_0xf386('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xf386('0x4')],'unique':_0xf386('0x5')},'ListId':{'type':Sequelize[_0xf386('0x4')],'unique':_0xf386('0x5')},'VoiceQueueId':{'type':Sequelize[_0xf386('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index b7d075a..4bbd605 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 _0x1015=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','count','json','reject','save','update','then','destroy','error','stack','name','send','map','CmHopperBlack','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','includeAll','include','findAll','rows','catch','keys','options','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash'];(function(_0x226138,_0x5d1862){var _0x4b669e=function(_0x4c6877){while(--_0x4c6877){_0x226138['push'](_0x226138['shift']());}};_0x4b669e(++_0x5d1862);}(_0x1015,0x85));var _0x5101=function(_0x4a0e3b,_0x56c1d7){_0x4a0e3b=_0x4a0e3b-0x0;var _0x3a6ac2=_0x1015[_0x4a0e3b];return _0x3a6ac2;};'use strict';var emlformat=require(_0x5101('0x0'));var rimraf=require(_0x5101('0x1'));var zipdir=require(_0x5101('0x2'));var jsonpatch=require(_0x5101('0x3'));var rp=require(_0x5101('0x4'));var moment=require(_0x5101('0x5'));var BPromise=require(_0x5101('0x6'));var Mustache=require(_0x5101('0x7'));var util=require(_0x5101('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x5101('0x9'));var ejs=require(_0x5101('0xa'));var fs=require('fs');var fs_extra=require(_0x5101('0xb'));var _=require(_0x5101('0xc'));var squel=require(_0x5101('0xd'));var crypto=require(_0x5101('0xe'));var jsforce=require(_0x5101('0xf'));var deskjs=require(_0x5101('0x10'));var toCsv=require(_0x5101('0x9'));var querystring=require(_0x5101('0x11'));var Papa=require(_0x5101('0x12'));var Redis=require(_0x5101('0x13'));var authService=require(_0x5101('0x14'));var qs=require(_0x5101('0x15'));var as=require(_0x5101('0x16'));var hardwareService=require(_0x5101('0x17'));var logger=require('../../config/logger')(_0x5101('0x18'));var utils=require(_0x5101('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5101('0x1a'))['db'];function respondWithStatusCode(_0x17f530,_0x40b0ab){_0x40b0ab=_0x40b0ab||0xcc;return function(_0x1ad1b1){if(_0x1ad1b1){return _0x17f530[_0x5101('0x1b')](_0x40b0ab);}return _0x17f530[_0x5101('0x1c')](_0x40b0ab)[_0x5101('0x1d')]();};}function respondWithResult(_0x14d26e,_0x3d1e35){_0x3d1e35=_0x3d1e35||0xc8;return function(_0xf514ea){if(_0xf514ea){return _0x14d26e['status'](_0x3d1e35)['json'](_0xf514ea);}};}function respondWithFilteredResult(_0x23681b,_0x599925){return function(_0x262b76){if(_0x262b76){var _0x28cc4f=typeof _0x599925[_0x5101('0x1e')]==='undefined'&&typeof _0x599925[_0x5101('0x1f')]==='undefined';var _0x42ce56=_0x262b76[_0x5101('0x20')];var _0x589b0e=_0x28cc4f?0x0:_0x599925[_0x5101('0x1e')];var _0x12ec12=_0x28cc4f?_0x262b76[_0x5101('0x20')]:_0x599925[_0x5101('0x1e')]+_0x599925[_0x5101('0x1f')];var _0x581432;if(_0x12ec12>=_0x42ce56){_0x12ec12=_0x42ce56;_0x581432=0xc8;}else{_0x581432=0xce;}_0x23681b[_0x5101('0x1c')](_0x581432);return _0x23681b['set']('Content-Range',_0x589b0e+'-'+_0x12ec12+'/'+_0x42ce56)[_0x5101('0x21')](_0x262b76);}return null;};}function patchUpdates(_0x557528){return function(_0x14d12f){try{jsonpatch['apply'](_0x14d12f,_0x557528,!![]);}catch(_0x5be082){return BPromise[_0x5101('0x22')](_0x5be082);}return _0x14d12f[_0x5101('0x23')]();};}function saveUpdates(_0x11579f,_0x15547e){return function(_0x10bd17){if(_0x10bd17){return _0x10bd17[_0x5101('0x24')](_0x11579f)[_0x5101('0x25')](function(_0x9bae2b){return _0x9bae2b;});}return null;};}function removeEntity(_0x3fa8af,_0x1e6ddc){return function(_0xa61c3e){if(_0xa61c3e){return _0xa61c3e[_0x5101('0x26')]()[_0x5101('0x25')](function(){_0x3fa8af['status'](0xcc)[_0x5101('0x1d')]();});}};}function handleEntityNotFound(_0x5131c0,_0xf27f5){return function(_0xbce4dc){if(!_0xbce4dc){_0x5131c0[_0x5101('0x1b')](0x194);}return _0xbce4dc;};}function handleError(_0x13b956,_0x14a5df){_0x14a5df=_0x14a5df||0x1f4;return function(_0x598b89){logger[_0x5101('0x27')](_0x598b89[_0x5101('0x28')]);if(_0x598b89[_0x5101('0x29')]){delete _0x598b89[_0x5101('0x29')];}_0x13b956['status'](_0x14a5df)[_0x5101('0x2a')](_0x598b89);};}exports['index']=function(_0x504769,_0x5649f6){var _0x504591={},_0x3a64fa={},_0x1543ad={'count':0x0,'rows':[]};var _0x43ec47=_[_0x5101('0x2b')](db[_0x5101('0x2c')][_0x5101('0x2d')],function(_0x26595c){return{'name':_0x26595c['fieldName'],'type':_0x26595c[_0x5101('0x2e')][_0x5101('0x2f')]};});_0x3a64fa[_0x5101('0x30')]=_[_0x5101('0x2b')](_0x43ec47,_0x5101('0x29'));_0x3a64fa[_0x5101('0x31')]=_['keys'](_0x504769[_0x5101('0x31')]);_0x3a64fa[_0x5101('0x32')]=_[_0x5101('0x33')](_0x3a64fa['model'],_0x3a64fa['query']);_0x504591[_0x5101('0x34')]=_[_0x5101('0x33')](_0x3a64fa[_0x5101('0x30')],qs[_0x5101('0x35')](_0x504769['query'][_0x5101('0x35')]));_0x504591[_0x5101('0x34')]=_0x504591[_0x5101('0x34')][_0x5101('0x36')]?_0x504591[_0x5101('0x34')]:_0x3a64fa['model'];if(!_0x504769['query'][_0x5101('0x37')](_0x5101('0x38'))){_0x504591[_0x5101('0x1f')]=qs['limit'](_0x504769[_0x5101('0x31')][_0x5101('0x1f')]);_0x504591['offset']=qs['offset'](_0x504769[_0x5101('0x31')]['offset']);}_0x504591[_0x5101('0x39')]=qs[_0x5101('0x3a')](_0x504769[_0x5101('0x31')][_0x5101('0x3a')]);_0x504591['where']=qs[_0x5101('0x32')](_['pick'](_0x504769[_0x5101('0x31')],_0x3a64fa[_0x5101('0x32')]),_0x43ec47);if(_0x504769['query'][_0x5101('0x3b')]){_0x504591['where']=_[_0x5101('0x3c')](_0x504591[_0x5101('0x3d')],{'$or':_[_0x5101('0x2b')](_0x43ec47,function(_0x210d4d){if(_0x210d4d[_0x5101('0x2e')]!=='VIRTUAL'){var _0x38acf4={};_0x38acf4[_0x210d4d[_0x5101('0x29')]]={'$like':'%'+_0x504769[_0x5101('0x31')][_0x5101('0x3b')]+'%'};return _0x38acf4;}})});}_0x504591=_[_0x5101('0x3c')]({},_0x504591,_0x504769['options']);var _0x4ca72c={'where':_0x504591['where']};return db[_0x5101('0x2c')][_0x5101('0x20')](_0x4ca72c)['then'](function(_0x3dd75b){_0x1543ad['count']=_0x3dd75b;if(_0x504769[_0x5101('0x31')][_0x5101('0x3e')]){_0x504591[_0x5101('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x5101('0x40')](_0x504591);})[_0x5101('0x25')](function(_0x1addeb){_0x1543ad[_0x5101('0x41')]=_0x1addeb;return _0x1543ad;})[_0x5101('0x25')](respondWithFilteredResult(_0x5649f6,_0x504591))[_0x5101('0x42')](handleError(_0x5649f6,null));};exports['show']=function(_0x4e5fa3,_0x53a3ad){var _0x4c61d5={'raw':!![],'where':{'id':_0x4e5fa3['params']['id']}},_0x43a105={};_0x43a105['model']=_['keys'](db[_0x5101('0x2c')][_0x5101('0x2d')]);_0x43a105[_0x5101('0x31')]=_[_0x5101('0x43')](_0x4e5fa3['query']);_0x43a105['filters']=_[_0x5101('0x33')](_0x43a105['model'],_0x43a105[_0x5101('0x31')]);_0x4c61d5[_0x5101('0x34')]=_['intersection'](_0x43a105[_0x5101('0x30')],qs[_0x5101('0x35')](_0x4e5fa3[_0x5101('0x31')][_0x5101('0x35')]));_0x4c61d5[_0x5101('0x34')]=_0x4c61d5[_0x5101('0x34')][_0x5101('0x36')]?_0x4c61d5['attributes']:_0x43a105[_0x5101('0x30')];if(_0x4e5fa3['query'][_0x5101('0x3e')]){_0x4c61d5[_0x5101('0x3f')]=[{'all':!![]}];}_0x4c61d5=_[_0x5101('0x3c')]({},_0x4c61d5,_0x4e5fa3[_0x5101('0x44')]);return db[_0x5101('0x2c')][_0x5101('0x45')](_0x4c61d5)[_0x5101('0x25')](handleEntityNotFound(_0x53a3ad,null))[_0x5101('0x25')](respondWithResult(_0x53a3ad,null))[_0x5101('0x42')](handleError(_0x53a3ad,null));};exports[_0x5101('0x24')]=function(_0x3a5067,_0x515de4){if(_0x3a5067[_0x5101('0x46')]['id']){delete _0x3a5067['body']['id'];}return db[_0x5101('0x2c')][_0x5101('0x45')]({'where':{'id':_0x3a5067[_0x5101('0x47')]['id']}})[_0x5101('0x25')](handleEntityNotFound(_0x515de4,null))[_0x5101('0x25')](saveUpdates(_0x3a5067[_0x5101('0x46')],null))[_0x5101('0x25')](respondWithResult(_0x515de4,null))[_0x5101('0x42')](handleError(_0x515de4,null));};exports[_0x5101('0x26')]=function(_0x4a477c,_0x419de9){return db[_0x5101('0x2c')]['find']({'where':{'id':_0x4a477c['params']['id']}})[_0x5101('0x25')](handleEntityNotFound(_0x419de9,null))[_0x5101('0x25')](removeEntity(_0x419de9,null))[_0x5101('0x42')](handleError(_0x419de9,null));};exports[_0x5101('0x48')]=function(_0x31e8a4,_0x2e684d){return db[_0x5101('0x2c')][_0x5101('0x48')]()['then'](respondWithResult(_0x2e684d,null))['catch'](handleError(_0x2e684d,null));}; \ No newline at end of file +var _0xc31d=['rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','includeAll','body','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','CmHopperBlack'];(function(_0x341d31,_0x4786f9){var _0x58095e=function(_0x3c9d7a){while(--_0x3c9d7a){_0x341d31['push'](_0x341d31['shift']());}};_0x58095e(++_0x4786f9);}(_0xc31d,0x18a));var _0xdc31=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xc31d[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require(_0xdc31('0x0'));var rimraf=require(_0xdc31('0x1'));var zipdir=require(_0xdc31('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdc31('0x3'));var BPromise=require(_0xdc31('0x4'));var Mustache=require(_0xdc31('0x5'));var util=require(_0xdc31('0x6'));var path=require('path');var sox=require(_0xdc31('0x7'));var csv=require(_0xdc31('0x8'));var ejs=require(_0xdc31('0x9'));var fs=require('fs');var fs_extra=require(_0xdc31('0xa'));var _=require(_0xdc31('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdc31('0xc'));var deskjs=require(_0xdc31('0xd'));var toCsv=require(_0xdc31('0x8'));var querystring=require(_0xdc31('0xe'));var Papa=require(_0xdc31('0xf'));var Redis=require('ioredis');var authService=require(_0xdc31('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdc31('0x11'));var hardwareService=require(_0xdc31('0x12'));var logger=require(_0xdc31('0x13'))('api');var utils=require(_0xdc31('0x14'));var config=require(_0xdc31('0x15'));var licenseUtil=require(_0xdc31('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x513491,_0x433327){_0x433327=_0x433327||0xcc;return function(_0x748bd8){if(_0x748bd8){return _0x513491[_0xdc31('0x17')](_0x433327);}return _0x513491[_0xdc31('0x18')](_0x433327)['end']();};}function respondWithResult(_0x4ffb9b,_0x4a3e3d){_0x4a3e3d=_0x4a3e3d||0xc8;return function(_0x33c6fd){if(_0x33c6fd){return _0x4ffb9b[_0xdc31('0x18')](_0x4a3e3d)['json'](_0x33c6fd);}};}function respondWithFilteredResult(_0x182712,_0x55ceb7){return function(_0x222715){if(_0x222715){var _0x394a6b=typeof _0x55ceb7[_0xdc31('0x19')]===_0xdc31('0x1a')&&typeof _0x55ceb7[_0xdc31('0x1b')]==='undefined';var _0x154d79=_0x222715[_0xdc31('0x1c')];var _0x20ed41=_0x394a6b?0x0:_0x55ceb7[_0xdc31('0x19')];var _0x411880=_0x394a6b?_0x222715['count']:_0x55ceb7['offset']+_0x55ceb7[_0xdc31('0x1b')];var _0x3e8a17;if(_0x411880>=_0x154d79){_0x411880=_0x154d79;_0x3e8a17=0xc8;}else{_0x3e8a17=0xce;}_0x182712[_0xdc31('0x18')](_0x3e8a17);return _0x182712['set'](_0xdc31('0x1d'),_0x20ed41+'-'+_0x411880+'/'+_0x154d79)[_0xdc31('0x1e')](_0x222715);}return null;};}function patchUpdates(_0x45e3a2){return function(_0x500673){try{jsonpatch[_0xdc31('0x1f')](_0x500673,_0x45e3a2,!![]);}catch(_0x4e5317){return BPromise[_0xdc31('0x20')](_0x4e5317);}return _0x500673[_0xdc31('0x21')]();};}function saveUpdates(_0x31f4d5,_0x1433d1){return function(_0x5cfd28){if(_0x5cfd28){return _0x5cfd28[_0xdc31('0x22')](_0x31f4d5)[_0xdc31('0x23')](function(_0x2589fb){return _0x2589fb;});}return null;};}function removeEntity(_0x65cd59,_0x12ff5d){return function(_0x35ea28){if(_0x35ea28){return _0x35ea28[_0xdc31('0x24')]()[_0xdc31('0x23')](function(){_0x65cd59[_0xdc31('0x18')](0xcc)[_0xdc31('0x25')]();});}};}function handleEntityNotFound(_0x354fb5,_0x5b8486){return function(_0x5beea3){if(!_0x5beea3){_0x354fb5[_0xdc31('0x17')](0x194);}return _0x5beea3;};}function handleError(_0x57880d,_0x51076c){_0x51076c=_0x51076c||0x1f4;return function(_0x50e06e){logger['error'](_0x50e06e[_0xdc31('0x26')]);if(_0x50e06e[_0xdc31('0x27')]){delete _0x50e06e[_0xdc31('0x27')];}_0x57880d[_0xdc31('0x18')](_0x51076c)[_0xdc31('0x28')](_0x50e06e);};}exports[_0xdc31('0x29')]=function(_0x115920,_0x322290){var _0x19516a={},_0x2ac5c2={},_0x4a444e={'count':0x0,'rows':[]};var _0x1a57db=_[_0xdc31('0x2a')](db[_0xdc31('0x2b')][_0xdc31('0x2c')],function(_0x5a2785){return{'name':_0x5a2785[_0xdc31('0x2d')],'type':_0x5a2785[_0xdc31('0x2e')]['key']};});_0x2ac5c2['model']=_[_0xdc31('0x2a')](_0x1a57db,_0xdc31('0x27'));_0x2ac5c2[_0xdc31('0x2f')]=_[_0xdc31('0x30')](_0x115920[_0xdc31('0x2f')]);_0x2ac5c2[_0xdc31('0x31')]=_[_0xdc31('0x32')](_0x2ac5c2[_0xdc31('0x33')],_0x2ac5c2['query']);_0x19516a['attributes']=_['intersection'](_0x2ac5c2[_0xdc31('0x33')],qs[_0xdc31('0x34')](_0x115920['query'][_0xdc31('0x34')]));_0x19516a['attributes']=_0x19516a[_0xdc31('0x35')][_0xdc31('0x36')]?_0x19516a[_0xdc31('0x35')]:_0x2ac5c2['model'];if(!_0x115920['query'][_0xdc31('0x37')](_0xdc31('0x38'))){_0x19516a[_0xdc31('0x1b')]=qs[_0xdc31('0x1b')](_0x115920[_0xdc31('0x2f')][_0xdc31('0x1b')]);_0x19516a[_0xdc31('0x19')]=qs[_0xdc31('0x19')](_0x115920['query'][_0xdc31('0x19')]);}_0x19516a[_0xdc31('0x39')]=qs[_0xdc31('0x3a')](_0x115920[_0xdc31('0x2f')][_0xdc31('0x3a')]);_0x19516a[_0xdc31('0x3b')]=qs['filters'](_[_0xdc31('0x3c')](_0x115920[_0xdc31('0x2f')],_0x2ac5c2[_0xdc31('0x31')]),_0x1a57db);if(_0x115920[_0xdc31('0x2f')][_0xdc31('0x3d')]){_0x19516a['where']=_[_0xdc31('0x3e')](_0x19516a[_0xdc31('0x3b')],{'$or':_['map'](_0x1a57db,function(_0x4c35de){if(_0x4c35de[_0xdc31('0x2e')]!=='VIRTUAL'){var _0x547e53={};_0x547e53[_0x4c35de[_0xdc31('0x27')]]={'$like':'%'+_0x115920[_0xdc31('0x2f')][_0xdc31('0x3d')]+'%'};return _0x547e53;}})});}_0x19516a=_[_0xdc31('0x3e')]({},_0x19516a,_0x115920['options']);var _0x59dda5={'where':_0x19516a[_0xdc31('0x3b')]};return db[_0xdc31('0x2b')]['count'](_0x59dda5)[_0xdc31('0x23')](function(_0x379fdc){_0x4a444e[_0xdc31('0x1c')]=_0x379fdc;if(_0x115920[_0xdc31('0x2f')]['includeAll']){_0x19516a[_0xdc31('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xdc31('0x40')](_0x19516a);})[_0xdc31('0x23')](function(_0x549496){_0x4a444e[_0xdc31('0x41')]=_0x549496;return _0x4a444e;})[_0xdc31('0x23')](respondWithFilteredResult(_0x322290,_0x19516a))[_0xdc31('0x42')](handleError(_0x322290,null));};exports[_0xdc31('0x43')]=function(_0x4bad52,_0x503d86){var _0x340659={'raw':!![],'where':{'id':_0x4bad52[_0xdc31('0x44')]['id']}},_0x13e631={};_0x13e631[_0xdc31('0x33')]=_[_0xdc31('0x30')](db[_0xdc31('0x2b')][_0xdc31('0x2c')]);_0x13e631[_0xdc31('0x2f')]=_[_0xdc31('0x30')](_0x4bad52[_0xdc31('0x2f')]);_0x13e631[_0xdc31('0x31')]=_[_0xdc31('0x32')](_0x13e631[_0xdc31('0x33')],_0x13e631[_0xdc31('0x2f')]);_0x340659[_0xdc31('0x35')]=_[_0xdc31('0x32')](_0x13e631[_0xdc31('0x33')],qs[_0xdc31('0x34')](_0x4bad52[_0xdc31('0x2f')][_0xdc31('0x34')]));_0x340659[_0xdc31('0x35')]=_0x340659[_0xdc31('0x35')]['length']?_0x340659[_0xdc31('0x35')]:_0x13e631['model'];if(_0x4bad52[_0xdc31('0x2f')][_0xdc31('0x45')]){_0x340659[_0xdc31('0x3f')]=[{'all':!![]}];}_0x340659=_[_0xdc31('0x3e')]({},_0x340659,_0x4bad52['options']);return db[_0xdc31('0x2b')]['find'](_0x340659)['then'](handleEntityNotFound(_0x503d86,null))[_0xdc31('0x23')](respondWithResult(_0x503d86,null))[_0xdc31('0x42')](handleError(_0x503d86,null));};exports['update']=function(_0x49c756,_0x2745d5){if(_0x49c756[_0xdc31('0x46')]['id']){delete _0x49c756[_0xdc31('0x46')]['id'];}return db[_0xdc31('0x2b')][_0xdc31('0x47')]({'where':{'id':_0x49c756[_0xdc31('0x44')]['id']}})[_0xdc31('0x23')](handleEntityNotFound(_0x2745d5,null))[_0xdc31('0x23')](saveUpdates(_0x49c756[_0xdc31('0x46')],null))[_0xdc31('0x23')](respondWithResult(_0x2745d5,null))['catch'](handleError(_0x2745d5,null));};exports[_0xdc31('0x24')]=function(_0x432bf7,_0x501f32){return db[_0xdc31('0x2b')][_0xdc31('0x47')]({'where':{'id':_0x432bf7[_0xdc31('0x44')]['id']}})['then'](handleEntityNotFound(_0x501f32,null))['then'](removeEntity(_0x501f32,null))[_0xdc31('0x42')](handleError(_0x501f32,null));};exports['describe']=function(_0x55b439,_0xb38fe1){return db[_0xdc31('0x2b')][_0xdc31('0x48')]()[_0xdc31('0x23')](respondWithResult(_0xb38fe1,null))[_0xdc31('0x42')](handleError(_0xb38fe1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 4ce30dc..e61df05 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 _0x0a12=['CmHopperBlack','cm_hopper_black','lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0a12,0x1ba));var _0x20a1=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x0a12[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x20a1('0x0'));var util=require('util');var logger=require(_0x20a1('0x1'))(_0x20a1('0x2'));var moment=require('moment');var BPromise=require(_0x20a1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x20a1('0x4'));var config=require(_0x20a1('0x5'));var attributes=require(_0x20a1('0x6'));module[_0x20a1('0x7')]=function(_0x55f18b,_0x198733){return _0x55f18b[_0x20a1('0x8')](_0x20a1('0x9'),attributes,{'tableName':_0x20a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x452c=['moment','bluebird','rimraf','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','util','api'];(function(_0x234f19,_0x102456){var _0x34c83e=function(_0x792e2a){while(--_0x792e2a){_0x234f19['push'](_0x234f19['shift']());}};_0x34c83e(++_0x102456);}(_0x452c,0x8a));var _0xc452=function(_0x51494d,_0x375f8e){_0x51494d=_0x51494d-0x0;var _0x203e6a=_0x452c[_0x51494d];return _0x203e6a;};'use strict';var _=require('lodash');var util=require(_0xc452('0x0'));var logger=require('../../config/logger')(_0xc452('0x1'));var moment=require(_0xc452('0x2'));var BPromise=require(_0xc452('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc452('0x4'));var config=require(_0xc452('0x5'));var attributes=require('./cmHopperBlack.attributes');module[_0xc452('0x6')]=function(_0x4a8a68,_0x35fcfc){return _0x4a8a68[_0xc452('0x7')](_0xc452('0x8'),attributes,{'tableName':_0xc452('0x9'),'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 c17ee99..998e3c2 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 _0x3ffa=['request\x20sent','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','limit','include','model','attributes','map','update','UpdateCmHopperBlack','destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s'];(function(_0x51b1a5,_0x285a4f){var _0x15c738=function(_0x5c94d7){while(--_0x5c94d7){_0x51b1a5['push'](_0x51b1a5['shift']());}};_0x15c738(++_0x285a4f);}(_0x3ffa,0x10b));var _0xa3ff=function(_0x2b351f,_0x469470){_0x2b351f=_0x2b351f-0x0;var _0x5e060a=_0x3ffa[_0x2b351f];return _0x5e060a;};'use strict';var _=require(_0xa3ff('0x0'));var util=require(_0xa3ff('0x1'));var moment=require(_0xa3ff('0x2'));var BPromise=require(_0xa3ff('0x3'));var rs=require(_0xa3ff('0x4'));var fs=require('fs');var Redis=require(_0xa3ff('0x5'));var db=require(_0xa3ff('0x6'))['db'];var utils=require(_0xa3ff('0x7'));var logger=require(_0xa3ff('0x8'))(_0xa3ff('0x9'));var config=require(_0xa3ff('0xa'));var jayson=require(_0xa3ff('0xb'));var client=jayson[_0xa3ff('0xc')][_0xa3ff('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x719596,_0x310dde,_0x51cc54){return new BPromise(function(_0x4c4a7a,_0x3200a9){return client[_0xa3ff('0xe')](_0x719596,_0x51cc54)[_0xa3ff('0xf')](function(_0x45e24b){logger[_0xa3ff('0x10')](_0xa3ff('0x11'),_0x310dde,'request\x20sent');logger[_0xa3ff('0x12')](_0xa3ff('0x13'),_0x310dde,_0xa3ff('0x14'),JSON[_0xa3ff('0x15')](_0x45e24b));if(_0x45e24b[_0xa3ff('0x16')]){if(_0x45e24b['error'][_0xa3ff('0x17')]===0x1f4){logger[_0xa3ff('0x16')](_0xa3ff('0x11'),_0x310dde,_0x45e24b[_0xa3ff('0x16')]['message']);return _0x3200a9(_0x45e24b[_0xa3ff('0x16')][_0xa3ff('0x18')]);}logger[_0xa3ff('0x16')](_0xa3ff('0x11'),_0x310dde,_0x45e24b['error'][_0xa3ff('0x18')]);return _0x4c4a7a(_0x45e24b['error']['message']);}else{logger[_0xa3ff('0x10')](_0xa3ff('0x11'),_0x310dde,_0xa3ff('0x14'));_0x4c4a7a(_0x45e24b[_0xa3ff('0x19')][_0xa3ff('0x18')]);}})[_0xa3ff('0x1a')](function(_0xb55733){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x310dde,_0xb55733);_0x3200a9(_0xb55733);});});}exports[_0xa3ff('0x1b')]=function(_0x6df4d5){var _0x3fac37=this;return new Promise(function(_0x780677,_0x249975){return db[_0xa3ff('0x1c')]['findAll']({'raw':_0x6df4d5[_0xa3ff('0x1d')]?_0x6df4d5[_0xa3ff('0x1d')][_0xa3ff('0x1e')]===undefined?!![]:![]:!![],'where':_0x6df4d5['options']?_0x6df4d5[_0xa3ff('0x1d')][_0xa3ff('0x1f')]||null:null,'attributes':_0x6df4d5[_0xa3ff('0x1d')]?_0x6df4d5['options']['attributes']||null:null,'limit':_0x6df4d5[_0xa3ff('0x1d')]?_0x6df4d5[_0xa3ff('0x1d')][_0xa3ff('0x20')]||null:null,'include':_0x6df4d5[_0xa3ff('0x1d')]?_0x6df4d5['options'][_0xa3ff('0x21')]?_['map'](_0x6df4d5[_0xa3ff('0x1d')][_0xa3ff('0x21')],function(_0x4f83a4){return{'model':db[_0x4f83a4[_0xa3ff('0x22')]],'as':_0x4f83a4['as'],'attributes':_0x4f83a4[_0xa3ff('0x23')],'include':_0x4f83a4[_0xa3ff('0x21')]?_[_0xa3ff('0x24')](_0x4f83a4[_0xa3ff('0x21')],function(_0x2aa3b3){return{'model':db[_0x2aa3b3[_0xa3ff('0x22')]],'as':_0x2aa3b3['as'],'attributes':_0x2aa3b3[_0xa3ff('0x23')],'include':_0x2aa3b3[_0xa3ff('0x21')]?_[_0xa3ff('0x24')](_0x2aa3b3['include'],function(_0x4d4875){return{'model':db[_0x4d4875[_0xa3ff('0x22')]],'as':_0x4d4875['as'],'attributes':_0x4d4875[_0xa3ff('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa3ff('0xf')](function(_0x363f53){logger[_0xa3ff('0x10')]('GetCmHopperBlack',_0x6df4d5);logger[_0xa3ff('0x12')](_0xa3ff('0x1b'),_0x6df4d5,JSON[_0xa3ff('0x15')](_0x363f53));_0x780677(_0x363f53);})[_0xa3ff('0x1a')](function(_0x536ae3){logger['error'](_0xa3ff('0x1b'),_0x536ae3[_0xa3ff('0x18')],_0x6df4d5);_0x249975(_0x3fac37[_0xa3ff('0x16')](0x1f4,_0x536ae3[_0xa3ff('0x18')]));});});};exports['UpdateCmHopperBlack']=function(_0x1ad897){var _0x5e480b=this;return new Promise(function(_0x23f79d,_0xc24d25){return db['CmHopperBlack'][_0xa3ff('0x25')](_0x1ad897['body'],{'raw':_0x1ad897[_0xa3ff('0x1d')]?_0x1ad897[_0xa3ff('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ad897[_0xa3ff('0x1d')]?_0x1ad897[_0xa3ff('0x1d')]['where']||null:null,'attributes':_0x1ad897[_0xa3ff('0x1d')]?_0x1ad897[_0xa3ff('0x1d')]['attributes']||null:null,'limit':_0x1ad897[_0xa3ff('0x1d')]?_0x1ad897[_0xa3ff('0x1d')][_0xa3ff('0x20')]||null:null})[_0xa3ff('0xf')](function(_0x1352c1){logger[_0xa3ff('0x10')](_0xa3ff('0x26'),_0x1ad897);logger[_0xa3ff('0x12')]('UpdateCmHopperBlack',_0x1ad897,JSON[_0xa3ff('0x15')](_0x1352c1));_0x23f79d(_0x1352c1);})['catch'](function(_0x157ad5){logger['error'](_0xa3ff('0x26'),_0x157ad5[_0xa3ff('0x18')],_0x1ad897);_0xc24d25(_0x5e480b[_0xa3ff('0x16')](0x1f4,_0x157ad5[_0xa3ff('0x18')]));});});};exports['DestroyCmHopperBlack']=function(_0x988ad8){var _0x5edc93=this;return new Promise(function(_0x452ad8,_0x4547e3){return db[_0xa3ff('0x1c')][_0xa3ff('0x27')]({'where':_0x988ad8[_0xa3ff('0x1d')]?_0x988ad8[_0xa3ff('0x1d')]['where']||null:null})[_0xa3ff('0xf')](function(_0x4dc431){logger[_0xa3ff('0x10')](_0xa3ff('0x28'),_0x988ad8);logger[_0xa3ff('0x12')](_0xa3ff('0x28'),_0x988ad8,JSON['stringify'](_0x4dc431));_0x452ad8(_0x4dc431);})[_0xa3ff('0x1a')](function(_0xf99fa0){logger[_0xa3ff('0x16')]('DestroyCmHopperBlack',_0xf99fa0[_0xa3ff('0x18')],_0x988ad8);_0x4547e3(_0x5edc93[_0xa3ff('0x16')](0x1f4,_0xf99fa0['message']));});});}; \ No newline at end of file +var _0x4aeb=['result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','limit','include','model','map','attributes','UpdateCmHopperBlack','raw','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x4aeb,0x19c));var _0xb4ae=function(_0x132c77,_0x480f44){_0x132c77=_0x132c77-0x0;var _0x1fb83b=_0x4aeb[_0x132c77];return _0x1fb83b;};'use strict';var _=require(_0xb4ae('0x0'));var util=require('util');var moment=require(_0xb4ae('0x1'));var BPromise=require(_0xb4ae('0x2'));var rs=require(_0xb4ae('0x3'));var fs=require('fs');var Redis=require(_0xb4ae('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4ae('0x5'));var logger=require('../../config/logger')(_0xb4ae('0x6'));var config=require(_0xb4ae('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb4ae('0x8')][_0xb4ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ba213,_0xfc06fa,_0x48ed7e){return new BPromise(function(_0x423d9e,_0x83e630){return client['request'](_0x3ba213,_0x48ed7e)[_0xb4ae('0xa')](function(_0x4268e2){logger[_0xb4ae('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0xfc06fa,'request\x20sent');logger[_0xb4ae('0xc')](_0xb4ae('0xd'),_0xfc06fa,_0xb4ae('0xe'),JSON[_0xb4ae('0xf')](_0x4268e2));if(_0x4268e2['error']){if(_0x4268e2[_0xb4ae('0x10')][_0xb4ae('0x11')]===0x1f4){logger['error'](_0xb4ae('0x12'),_0xfc06fa,_0x4268e2[_0xb4ae('0x10')][_0xb4ae('0x13')]);return _0x83e630(_0x4268e2[_0xb4ae('0x10')][_0xb4ae('0x13')]);}logger[_0xb4ae('0x10')](_0xb4ae('0x12'),_0xfc06fa,_0x4268e2[_0xb4ae('0x10')]['message']);return _0x423d9e(_0x4268e2[_0xb4ae('0x10')]['message']);}else{logger[_0xb4ae('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0xfc06fa,_0xb4ae('0xe'));_0x423d9e(_0x4268e2[_0xb4ae('0x14')][_0xb4ae('0x13')]);}})[_0xb4ae('0x15')](function(_0x1bf427){logger['error'](_0xb4ae('0x12'),_0xfc06fa,_0x1bf427);_0x83e630(_0x1bf427);});});}exports[_0xb4ae('0x16')]=function(_0x4bdc9e){var _0x4f69f9=this;return new Promise(function(_0x52b92a,_0xa5f43b){return db[_0xb4ae('0x17')][_0xb4ae('0x18')]({'raw':_0x4bdc9e['options']?_0x4bdc9e[_0xb4ae('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4bdc9e['options']?_0x4bdc9e[_0xb4ae('0x19')][_0xb4ae('0x1a')]||null:null,'attributes':_0x4bdc9e[_0xb4ae('0x19')]?_0x4bdc9e['options']['attributes']||null:null,'limit':_0x4bdc9e[_0xb4ae('0x19')]?_0x4bdc9e['options'][_0xb4ae('0x1b')]||null:null,'include':_0x4bdc9e[_0xb4ae('0x19')]?_0x4bdc9e[_0xb4ae('0x19')]['include']?_['map'](_0x4bdc9e[_0xb4ae('0x19')][_0xb4ae('0x1c')],function(_0x2db02f){return{'model':db[_0x2db02f[_0xb4ae('0x1d')]],'as':_0x2db02f['as'],'attributes':_0x2db02f['attributes'],'include':_0x2db02f['include']?_[_0xb4ae('0x1e')](_0x2db02f[_0xb4ae('0x1c')],function(_0x2e8eb4){return{'model':db[_0x2e8eb4['model']],'as':_0x2e8eb4['as'],'attributes':_0x2e8eb4[_0xb4ae('0x1f')],'include':_0x2e8eb4[_0xb4ae('0x1c')]?_['map'](_0x2e8eb4[_0xb4ae('0x1c')],function(_0x49dfd1){return{'model':db[_0x49dfd1[_0xb4ae('0x1d')]],'as':_0x49dfd1['as'],'attributes':_0x49dfd1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48ccb5){logger[_0xb4ae('0xb')](_0xb4ae('0x16'),_0x4bdc9e);logger['debug'](_0xb4ae('0x16'),_0x4bdc9e,JSON['stringify'](_0x48ccb5));_0x52b92a(_0x48ccb5);})[_0xb4ae('0x15')](function(_0x5d231a){logger[_0xb4ae('0x10')]('GetCmHopperBlack',_0x5d231a[_0xb4ae('0x13')],_0x4bdc9e);_0xa5f43b(_0x4f69f9['error'](0x1f4,_0x5d231a[_0xb4ae('0x13')]));});});};exports[_0xb4ae('0x20')]=function(_0x493e55){var _0x2a450a=this;return new Promise(function(_0x39c7af,_0x45dc6a){return db['CmHopperBlack']['update'](_0x493e55['body'],{'raw':_0x493e55[_0xb4ae('0x19')]?_0x493e55[_0xb4ae('0x19')][_0xb4ae('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x493e55[_0xb4ae('0x19')]?_0x493e55[_0xb4ae('0x19')][_0xb4ae('0x1a')]||null:null,'attributes':_0x493e55[_0xb4ae('0x19')]?_0x493e55['options']['attributes']||null:null,'limit':_0x493e55[_0xb4ae('0x19')]?_0x493e55['options'][_0xb4ae('0x1b')]||null:null})[_0xb4ae('0xa')](function(_0x588291){logger[_0xb4ae('0xb')](_0xb4ae('0x20'),_0x493e55);logger[_0xb4ae('0xc')](_0xb4ae('0x20'),_0x493e55,JSON[_0xb4ae('0xf')](_0x588291));_0x39c7af(_0x588291);})[_0xb4ae('0x15')](function(_0x18c1f2){logger[_0xb4ae('0x10')]('UpdateCmHopperBlack',_0x18c1f2[_0xb4ae('0x13')],_0x493e55);_0x45dc6a(_0x2a450a[_0xb4ae('0x10')](0x1f4,_0x18c1f2[_0xb4ae('0x13')]));});});};exports[_0xb4ae('0x22')]=function(_0x284a3a){var _0x21a837=this;return new Promise(function(_0x544481,_0x33787d){return db[_0xb4ae('0x17')][_0xb4ae('0x23')]({'where':_0x284a3a[_0xb4ae('0x19')]?_0x284a3a[_0xb4ae('0x19')][_0xb4ae('0x1a')]||null:null})['then'](function(_0x8832eb){logger[_0xb4ae('0xb')](_0xb4ae('0x22'),_0x284a3a);logger[_0xb4ae('0xc')](_0xb4ae('0x22'),_0x284a3a,JSON['stringify'](_0x8832eb));_0x544481(_0x8832eb);})[_0xb4ae('0x15')](function(_0x176ff1){logger[_0xb4ae('0x10')](_0xb4ae('0x22'),_0x176ff1[_0xb4ae('0x13')],_0x284a3a);_0x33787d(_0x21a837[_0xb4ae('0x10')](0x1f4,_0x176ff1[_0xb4ae('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 969e764..5300a62 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 _0xc1c6=['../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra'];(function(_0x57aa39,_0x5b7dd9){var _0x1d9f2e=function(_0xda8d8a){while(--_0xda8d8a){_0x57aa39['push'](_0x57aa39['shift']());}};_0x1d9f2e(++_0x5b7dd9);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x224d50,_0x5eb929){_0x224d50=_0x224d50-0x0;var _0x559b7e=_0xc1c6[_0x224d50];return _0x559b7e;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var fs_extra=require(_0x6c1c('0x4'));var auth=require(_0x6c1c('0x5'));var interaction=require(_0x6c1c('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x6c1c('0x7')]('/',auth['isAuthenticated'](),controller[_0x6c1c('0x8')]);router['get'](_0x6c1c('0x9'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xb')]);router[_0x6c1c('0x7')]('/:id',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xc')]);router['put'](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xe')]);router[_0x6c1c('0xf')]('/:id',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x10')]);module[_0x6c1c('0x11')]=router; \ No newline at end of file +var _0xa6b0=['update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','put'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x4aa624,_0x13124c){_0x4aa624=_0x4aa624-0x0;var _0x11e2fb=_0xa6b0[_0x4aa624];return _0x11e2fb;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var fs_extra=require(_0x0a6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var controller=require(_0x0a6b('0x7'));router[_0x0a6b('0x8')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x8')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xc')]);router[_0x0a6b('0x8')](_0x0a6b('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x0a6b('0xe')](_0x0a6b('0xd'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xf')]);router[_0x0a6b('0x10')](_0x0a6b('0xd'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x11')]);module[_0x0a6b('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 21b6d7c..ac30654 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 _0xc4ca=['endtime','followuptime','diff','seconds','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE','getDataValue'];(function(_0x4eca38,_0x4b5c37){var _0x5f0dbb=function(_0x66d8ff){while(--_0x66d8ff){_0x4eca38['push'](_0x4eca38['shift']());}};_0x5f0dbb(++_0x4b5c37);}(_0xc4ca,0x191));var _0xac4c=function(_0x4fb240,_0x476ddc){_0x4fb240=_0x4fb240-0x0;var _0x29177e=_0xc4ca[_0x4fb240];return _0x29177e;};'use strict';var Sequelize=require(_0xac4c('0x0'));var moment=require(_0xac4c('0x1'));module['exports']={'state':{'type':Sequelize[_0xac4c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xac4c('0x3')]},'scheduledat':{'type':Sequelize[_0xac4c('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xac4c('0x3')]},'originatecalleridname':{'type':Sequelize[_0xac4c('0x3')]},'calleridnum':{'type':Sequelize[_0xac4c('0x3')]},'calleridname':{'type':Sequelize[_0xac4c('0x3')]},'starttime':{'type':Sequelize[_0xac4c('0x4')]},'responsetime':{'type':Sequelize[_0xac4c('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xac4c('0x4')]},'endtime':{'type':Sequelize[_0xac4c('0x4')]},'ringtime':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xac4c('0x3')]},'campaigntype':{'type':Sequelize[_0xac4c('0x3')]},'membername':{'type':Sequelize[_0xac4c('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xac4c('0x3')]},'secondDisposition':{'type':Sequelize[_0xac4c('0x3')]},'thirdDisposition':{'type':Sequelize[_0xac4c('0x3')]},'dispositionat':{'type':Sequelize[_0xac4c('0x4')],'set':function(_0x43478a){var _0x58e215=this[_0xac4c('0x5')](_0xac4c('0x6'));if(_0x58e215&&_0x43478a){this['setDataValue'](_0xac4c('0x7'),moment(_0x43478a)[_0xac4c('0x8')](moment(_0x58e215),_0xac4c('0x9')));}}},'amd':{'type':Sequelize[_0xac4c('0xa')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xac4c('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xac4c('0x4')]},'callback':{'type':Sequelize[_0xac4c('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xac4c('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xac4c('0x4')]},'recallme':{'type':Sequelize[_0xac4c('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf298=['seconds','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE','endtime'];(function(_0x554d01,_0x45ceb8){var _0x4794ae=function(_0x276bc1){while(--_0x276bc1){_0x554d01['push'](_0x554d01['shift']());}};_0x4794ae(++_0x45ceb8);}(_0xf298,0x1b2));var _0x8f29=function(_0x3d140d,_0x27f24f){_0x3d140d=_0x3d140d-0x0;var _0x39ec27=_0xf298[_0x3d140d];return _0x39ec27;};'use strict';var Sequelize=require(_0x8f29('0x0'));var moment=require(_0x8f29('0x1'));module['exports']={'state':{'type':Sequelize[_0x8f29('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x8f29('0x3')]},'scheduledat':{'type':Sequelize[_0x8f29('0x4')]},'countbusyretry':{'type':Sequelize[_0x8f29('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8f29('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8f29('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8f29('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x8f29('0x3')]},'calleridnum':{'type':Sequelize[_0x8f29('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x8f29('0x4')]},'answertime':{'type':Sequelize[_0x8f29('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x8f29('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8f29('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8f29('0x3')]},'campaign':{'type':Sequelize[_0x8f29('0x3')]},'campaigntype':{'type':Sequelize[_0x8f29('0x3')]},'membername':{'type':Sequelize[_0x8f29('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x8f29('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8f29('0x3')]},'dispositionat':{'type':Sequelize[_0x8f29('0x4')],'set':function(_0x2a51c5){var _0x966142=this['getDataValue'](_0x8f29('0x5'));if(_0x966142&&_0x2a51c5){this['setDataValue']('followuptime',moment(_0x2a51c5)['diff'](moment(_0x966142),_0x8f29('0x6')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x8f29('0x7')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8f29('0x7')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x8f29('0x7')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x8f29('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8f29('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8f29('0x4')]},'deleted':{'type':Sequelize[_0x8f29('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8f29('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8f29('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x8f29('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 1df8851..2ff12f5 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 _0x326f=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','options','CmHopperFinal','includeAll','include','rows','catch','show','params','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','scheduledAt','ContactId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','updatedAt','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','toString','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','fromQuery','phone','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','calleridnum\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x326f,0xd1));var _0xf326=function(_0x222cbf,_0x24d885){_0x222cbf=_0x222cbf-0x0;var _0x2c5d2b=_0x326f[_0x222cbf];return _0x2c5d2b;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}exports['index']=function(_0x4a9abf,_0x6a8e89){var _0x1ae23a={},_0x2fa28e={},_0x5dbe63={'count':0x0,'rows':[]};var _0xc115d9=_[_0xf326('0x28')](db['CmHopperFinal'][_0xf326('0x29')],function(_0x119ab8){return{'name':_0x119ab8[_0xf326('0x2a')],'type':_0x119ab8[_0xf326('0x2b')][_0xf326('0x2c')]};});_0x2fa28e[_0xf326('0x2d')]=_[_0xf326('0x28')](_0xc115d9,_0xf326('0x26'));_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x4a9abf['query']);_0x2fa28e[_0xf326('0x30')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],_0x2fa28e['query']);_0x1ae23a[_0xf326('0x32')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],qs['fields'](_0x4a9abf['query'][_0xf326('0x33')]));_0x1ae23a[_0xf326('0x32')]=_0x1ae23a[_0xf326('0x32')][_0xf326('0x34')]?_0x1ae23a[_0xf326('0x32')]:_0x2fa28e[_0xf326('0x2d')];if(!_0x4a9abf[_0xf326('0x2e')][_0xf326('0x35')]('nolimit')){_0x1ae23a[_0xf326('0x1c')]=qs[_0xf326('0x1c')](_0x4a9abf['query'][_0xf326('0x1c')]);_0x1ae23a['offset']=qs[_0xf326('0x1a')](_0x4a9abf['query']['offset']);}_0x1ae23a[_0xf326('0x36')]=qs['sort'](_0x4a9abf[_0xf326('0x2e')]['sort']);_0x1ae23a[_0xf326('0x37')]=qs[_0xf326('0x30')](_[_0xf326('0x38')](_0x4a9abf['query'],_0x2fa28e[_0xf326('0x30')]),_0xc115d9);if(_0x4a9abf[_0xf326('0x2e')]['filter']){_0x1ae23a[_0xf326('0x37')]=_[_0xf326('0x39')](_0x1ae23a[_0xf326('0x37')],{'$or':_[_0xf326('0x28')](_0xc115d9,function(_0x51076c){if(_0x51076c[_0xf326('0x2b')]!==_0xf326('0x3a')){var _0x1e69b1={};_0x1e69b1[_0x51076c[_0xf326('0x26')]]={'$like':'%'+_0x4a9abf[_0xf326('0x2e')]['filter']+'%'};return _0x1e69b1;}})});}_0x1ae23a=_[_0xf326('0x39')]({},_0x1ae23a,_0x4a9abf[_0xf326('0x3b')]);var _0x5cfb97={'where':_0x1ae23a['where']};return db[_0xf326('0x3c')]['count'](_0x5cfb97)['then'](function(_0x22d462){_0x5dbe63['count']=_0x22d462;if(_0x4a9abf[_0xf326('0x2e')][_0xf326('0x3d')]){_0x1ae23a[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x3c')]['findAll'](_0x1ae23a);})[_0xf326('0x24')](function(_0x45d344){_0x5dbe63[_0xf326('0x3f')]=_0x45d344;return _0x5dbe63;})[_0xf326('0x24')](respondWithFilteredResult(_0x6a8e89,_0x1ae23a))[_0xf326('0x40')](handleError(_0x6a8e89,null));};exports[_0xf326('0x41')]=function(_0x2ad841,_0x224a32){var _0x31283b={'raw':!![],'where':{'id':_0x2ad841[_0xf326('0x42')]['id']}},_0x1227d3={};_0x1227d3[_0xf326('0x2d')]=_['keys'](db[_0xf326('0x3c')][_0xf326('0x29')]);_0x1227d3[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x2ad841[_0xf326('0x2e')]);_0x1227d3[_0xf326('0x30')]=_['intersection'](_0x1227d3[_0xf326('0x2d')],_0x1227d3[_0xf326('0x2e')]);_0x31283b['attributes']=_[_0xf326('0x31')](_0x1227d3[_0xf326('0x2d')],qs[_0xf326('0x33')](_0x2ad841[_0xf326('0x2e')][_0xf326('0x33')]));_0x31283b['attributes']=_0x31283b['attributes'][_0xf326('0x34')]?_0x31283b[_0xf326('0x32')]:_0x1227d3['model'];if(_0x2ad841['query'][_0xf326('0x3d')]){_0x31283b[_0xf326('0x3e')]=[{'all':!![]}];}_0x31283b=_[_0xf326('0x39')]({},_0x31283b,_0x2ad841['options']);return db[_0xf326('0x3c')][_0xf326('0x43')](_0x31283b)[_0xf326('0x24')](handleEntityNotFound(_0x224a32,null))[_0xf326('0x24')](respondWithResult(_0x224a32,null))[_0xf326('0x40')](handleError(_0x224a32,null));};exports[_0xf326('0x44')]=function(_0x12792c,_0x3b90dc){return db[_0xf326('0x3c')][_0xf326('0x44')]()[_0xf326('0x24')](respondWithResult(_0x3b90dc,null))[_0xf326('0x40')](handleError(_0x3b90dc,null));};exports[_0xf326('0x22')]=function(_0x395b1e,_0xeac1a1){if(_0x395b1e['body'][_0xf326('0x45')]){delete _0x395b1e[_0xf326('0x46')][_0xf326('0x45')];}return db[_0xf326('0x3c')]['find']({'where':{'uniqueid':_0x395b1e[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0xeac1a1,null))[_0xf326('0x24')](saveUpdates(_0x395b1e[_0xf326('0x46')],null))['then'](respondWithResult(_0xeac1a1,null))[_0xf326('0x40')](handleError(_0xeac1a1,null));};exports[_0xf326('0x47')]=function(_0x145a77,_0x451ac7,_0x39ba25){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x145a77[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),'noSuchContacts'],[db['sequelize']['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x4c')))),_0xf326('0x4d')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4f')))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x51')))),'dropContacts'],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x53')))),'reCallContacts'],[db[_0xf326('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x54')))),_0xf326('0x55')]]})[_0xf326('0x24')](handleEntityNotFound(_0x451ac7,null))['then'](respondWithResult(_0x451ac7,null))['catch'](handleError(_0x451ac7,null));};exports[_0xf326('0x56')]=function(_0xa85a42,_0x33b259,_0x5d0177){return db[_0xf326('0x3c')]['findAll']({'raw':![],'where':{'CampaignId':_0xa85a42[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),_0xf326('0x57')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xf326('0x4d')],[db['sequelize']['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x51')))),_0xf326('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x59')))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')](_0xf326('0x53')))),_0xf326('0x5a')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db['sequelize']['literal'](_0xf326('0x54')))),'answeringMachine']]})[_0xf326('0x24')](handleEntityNotFound(_0x33b259,null))[_0xf326('0x24')](respondWithResult(_0x33b259,null))[_0xf326('0x40')](handleError(_0x33b259,null));};exports[_0xf326('0x5b')]=function(_0x17cd36,_0x541491,_0x4a053c){return db['VoiceQueue'][_0xf326('0x43')]({'where':{'id':_0x17cd36[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x541491,null))[_0xf326('0x24')](function(_0xec5857){var _0x5e874b;if(_0xec5857){_0x5e874b=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))['fromQuery'](['phone',_0xf326('0x5f'),_0xf326('0x60'),'ListId','VoiceQueueId',_0xf326('0x61'),'updatedAt'],squel[_0xf326('0x62')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x5f'))['field'](_0xf326('0x65'),_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x68'),_0xf326('0x69'))[_0xf326('0x63')]('NOW()',_0xf326('0x61'))['field'](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')]('cm_hopper_final')[_0xf326('0x37')](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id']['toString']())[_0xf326('0x37')](_0xf326('0x6d'),_0x17cd36[_0xf326('0x46')][_0xf326('0x6e')]['toString']())[_0xf326('0x37')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field']('phone')['from'](_0xf326('0x5e'))['where'](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id'][_0xf326('0x70')]()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field'](_0xf326('0x71'))[_0xf326('0x6b')]('cm_hopper_final')['where'](_0xf326('0x6c'),_0x17cd36['params']['id'][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x72')))[_0xf326('0x73')](_0xf326('0x60')))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x5e874b);}return[];})[_0xf326('0x24')](respondWithResult(_0x541491,null))['catch'](handleError(_0x541491,null));};exports[_0xf326('0x74')]=function(_0x26bbb1,_0x4ac90e,_0x3c82cf){return db['Campaign'][_0xf326('0x43')]({'where':{'id':_0x26bbb1[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x4ac90e,null))['then'](function(_0x2b4414){var _0x1c86c8;if(_0x2b4414){_0x1c86c8=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))[_0xf326('0x75')]([_0xf326('0x76'),_0xf326('0x5f'),_0xf326('0x60'),_0xf326('0x67'),_0xf326('0x77'),_0xf326('0x61'),_0xf326('0x6a')],squel[_0xf326('0x62')]()[_0xf326('0x63')]('ANY_VALUE(calleridnum)',_0xf326('0x76'))[_0xf326('0x63')]('NOW()',_0xf326('0x5f'))[_0xf326('0x63')]('ANY_VALUE(ContactId)',_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x78'),_0xf326('0x77'))['field'](_0xf326('0x64'),_0xf326('0x61'))[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')](_0xf326('0x79'))[_0xf326('0x37')]('CampaignId\x20=\x20?',_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where'](_0xf326('0x6d'),_0x26bbb1['body'][_0xf326('0x6e')][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x7a'))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x76'))[_0xf326('0x6b')](_0xf326('0x5e'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id']['toString']()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x71'))['from'](_0xf326('0x79'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where']('state\x20=\x204'))[_0xf326('0x73')]('ContactId'))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x1c86c8);}return[];})['then'](respondWithResult(_0x4ac90e,null))['catch'](handleError(_0x4ac90e,null));};exports[_0xf326('0x7c')]=function(_0x2d92e4,_0x167ac9,_0x34870c){return db[_0xf326('0x7d')]['findOne']({'where':{'VoiceQueueId':_0x2d92e4[_0xf326('0x46')][_0xf326('0x69')],'CampaignId':_0x2d92e4[_0xf326('0x46')]['CampaignId'],'ContactId':_0x2d92e4['body']['ContactId']}})[_0xf326('0x24')](handleEntityNotFound(_0x167ac9,null))[_0xf326('0x24')](function(_0x2d275d){if(_0x2d275d){return _0x2d275d;}return null;})[_0xf326('0x24')](respondWithResult(_0x167ac9,null))[_0xf326('0x40')](handleError(_0x167ac9,null));}; \ No newline at end of file +var _0x781d=['length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','fromQuery','CampaignId','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','CmHopperFinal','fieldName','type','key','query','keys','intersection','model','attributes','fields'];(function(_0x29fc2c,_0x4ff86a){var _0x1adbc8=function(_0x596f87){while(--_0x596f87){_0x29fc2c['push'](_0x29fc2c['shift']());}};_0x1adbc8(++_0x4ff86a);}(_0x781d,0x14a));var _0xd781=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x781d[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':!![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['describe']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['describe']()[_0xd781('0x26')](respondWithResult(_0x16d16e,null))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x39ecdb,_0x336d30){if(_0x39ecdb[_0xd781('0x44')][_0xd781('0x45')]){delete _0x39ecdb['body'][_0xd781('0x45')];}return db[_0xd781('0x2c')][_0xd781('0x46')]({'where':{'uniqueid':_0x39ecdb['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x336d30,null))[_0xd781('0x26')](saveUpdates(_0x39ecdb['body'],null))[_0xd781('0x26')](respondWithResult(_0x336d30,null))[_0xd781('0x3f')](handleError(_0x336d30,null));};exports[_0xd781('0x47')]=function(_0x207546,_0x42a2f9,_0x599915){return db[_0xd781('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x207546[_0xd781('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xd781('0x4b')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xd781('0x4c')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal'](_0xd781('0x4f')))),_0xd781('0x50')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd781('0x53')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x54')))),_0xd781('0x55')]]})['then'](handleEntityNotFound(_0x42a2f9,null))[_0xd781('0x26')](respondWithResult(_0x42a2f9,null))[_0xd781('0x3f')](handleError(_0x42a2f9,null));};exports[_0xd781('0x56')]=function(_0x2c4874,_0x2e8bab,_0x38bd3e){return db[_0xd781('0x2c')][_0xd781('0x57')]({'raw':![],'where':{'CampaignId':_0x2c4874[_0xd781('0x41')]['id']},'attributes':[[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x58')))),_0xd781('0x59')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5a')))),_0xd781('0x4b')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4f')))),_0xd781('0x50')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5b')))),_0xd781('0x53')],[db['sequelize']['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xd781('0x26')](handleEntityNotFound(_0x2e8bab,null))[_0xd781('0x26')](respondWithResult(_0x2e8bab,null))[_0xd781('0x3f')](handleError(_0x2e8bab,null));};exports[_0xd781('0x5c')]=function(_0x26a0a9,_0x172a05,_0x2e0401){return db[_0xd781('0x5d')][_0xd781('0x46')]({'where':{'id':_0x26a0a9['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x172a05,null))[_0xd781('0x26')](function(_0x4c712f){var _0x24e3f5;if(_0x4c712f){_0x24e3f5=squel['insert']()[_0xd781('0x5e')](_0xd781('0x5f'))['fromQuery'](['phone',_0xd781('0x60'),_0xd781('0x61'),_0xd781('0x62'),_0xd781('0x63'),_0xd781('0x64'),_0xd781('0x65')],squel['select']()[_0xd781('0x66')](_0xd781('0x67'),_0xd781('0x68'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),'ListId')[_0xd781('0x66')]('ANY_VALUE(VoiceQueueId)',_0xd781('0x63'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x65'))[_0xd781('0x6c')](_0xd781('0x6d'))[_0xd781('0x39')]('VoiceQueueId\x20=\x20?',_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]())['where'](_0xd781('0x6f'),_0x26a0a9[_0xd781('0x44')][_0xd781('0x70')]['toString']())['where'](_0xd781('0x71'))['where'](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x68'))[_0xd781('0x6c')]('cm_hopper')[_0xd781('0x39')](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))[_0xd781('0x6c')](_0xd781('0x6d'))['where'](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id']['toString']())[_0xd781('0x39')](_0xd781('0x76')))[_0xd781('0x77')]('ContactId'))[_0xd781('0x6e')]();return db[_0xd781('0x49')]['query'](_0x24e3f5);}return[];})[_0xd781('0x26')](respondWithResult(_0x172a05,null))['catch'](handleError(_0x172a05,null));};exports[_0xd781('0x78')]=function(_0x23dba5,_0x3e0749,_0x192c95){return db[_0xd781('0x79')]['find']({'where':{'id':_0x23dba5[_0xd781('0x41')]['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x3e0749,null))[_0xd781('0x26')](function(_0x3897bf){var _0xaa945b;if(_0x3897bf){_0xaa945b=squel[_0xd781('0x7a')]()['into'](_0xd781('0x5f'))[_0xd781('0x7b')](['phone',_0xd781('0x60'),_0xd781('0x61'),'ListId',_0xd781('0x7c'),_0xd781('0x64'),_0xd781('0x65')],squel[_0xd781('0x73')]()[_0xd781('0x66')]('ANY_VALUE(calleridnum)','phone')['field'](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),_0xd781('0x62'))[_0xd781('0x66')]('ANY_VALUE(CampaignId)',_0xd781('0x7c'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')]('NOW()','updatedAt')['from'](_0xd781('0x6d'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id']['toString']())['where'](_0xd781('0x6f'),_0x23dba5[_0xd781('0x44')][_0xd781('0x70')][_0xd781('0x6e')]())['where'](_0xd781('0x71'))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')]('phone')[_0xd781('0x6c')](_0xd781('0x5f'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))['from']('cm_hopper_final')[_0xd781('0x39')](_0xd781('0x7d'),_0x23dba5['params']['id'][_0xd781('0x6e')]())[_0xd781('0x39')]('state\x20=\x204'))[_0xd781('0x77')](_0xd781('0x61')))['toString']();return db[_0xd781('0x49')]['query'](_0xaa945b);}return[];})[_0xd781('0x26')](respondWithResult(_0x3e0749,null))[_0xd781('0x3f')](handleError(_0x3e0749,null));};exports[_0xd781('0x7e')]=function(_0x52b9c6,_0x5a2252,_0x356c56){return db[_0xd781('0x7f')]['findOne']({'where':{'VoiceQueueId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x63')],'CampaignId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x7c')],'ContactId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x61')]}})[_0xd781('0x26')](handleEntityNotFound(_0x5a2252,null))[_0xd781('0x26')](function(_0x532fd8){if(_0x532fd8){return _0x532fd8;}return null;})[_0xd781('0x26')](respondWithResult(_0x5a2252,null))[_0xd781('0x3f')](handleError(_0x5a2252,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 87b2f51..d0a819f 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 _0xf4cd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api'];(function(_0x7e1ec6,_0x1e70fa){var _0x1c9749=function(_0x1e16e0){while(--_0x1e16e0){_0x7e1ec6['push'](_0x7e1ec6['shift']());}};_0x1c9749(++_0x1e70fa);}(_0xf4cd,0x1a1));var _0xdf4c=function(_0x18a606,_0x39deed){_0x18a606=_0x18a606-0x0;var _0x49f9ac=_0xf4cd[_0x18a606];return _0x49f9ac;};'use strict';var _=require(_0xdf4c('0x0'));var util=require('util');var logger=require(_0xdf4c('0x1'))(_0xdf4c('0x2'));var moment=require(_0xdf4c('0x3'));var BPromise=require(_0xdf4c('0x4'));var rp=require(_0xdf4c('0x5'));var fs=require('fs');var path=require(_0xdf4c('0x6'));var rimraf=require(_0xdf4c('0x7'));var config=require(_0xdf4c('0x8'));var attributes=require(_0xdf4c('0x9'));module['exports']=function(_0x2de759,_0x115519){return _0x2de759['define'](_0xdf4c('0xa'),attributes,{'tableName':_0xdf4c('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xdf4c('0xc')]},{'name':_0xdf4c('0xd'),'fields':[_0xdf4c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x68b8=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x329664,_0x130748){var _0x4e346e=function(_0x172b0d){while(--_0x172b0d){_0x329664['push'](_0x329664['shift']());}};_0x4e346e(++_0x130748);}(_0x68b8,0x161));var _0x868b=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0x68b8[_0x26b622];return _0x58a028;};'use strict';var _=require(_0x868b('0x0'));var util=require(_0x868b('0x1'));var logger=require(_0x868b('0x2'))(_0x868b('0x3'));var moment=require(_0x868b('0x4'));var BPromise=require(_0x868b('0x5'));var rp=require(_0x868b('0x6'));var fs=require('fs');var path=require(_0x868b('0x7'));var rimraf=require(_0x868b('0x8'));var config=require(_0x868b('0x9'));var attributes=require(_0x868b('0xa'));module[_0x868b('0xb')]=function(_0x590f16,_0x579509){return _0x590f16['define'](_0x868b('0xc'),attributes,{'tableName':_0x868b('0xd'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x868b('0xe')]},{'name':_0x868b('0xf'),'fields':[_0x868b('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 610d457..471094c 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(_0x131ea1,_0x3fac12){var _0x3ef31f=function(_0x2dd564){while(--_0x2dd564){_0x131ea1['push'](_0x131ea1['shift']());}};_0x3ef31f(++_0x3fac12);}(_0xb10b,0x12a));var _0xbb10=function(_0x1811e0,_0x487da0){_0x1811e0=_0x1811e0-0x0;var _0x3ce439=_0xb10b[_0x1811e0];return _0x3ce439;};'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(_0x53c702,_0x22a758){var _0x296d83=function(_0x587cc7){while(--_0x587cc7){_0x53c702['push'](_0x53c702['shift']());}};_0x296d83(++_0x22a758);}(_0x7a54,0x106));var _0x47a5=function(_0xa84d1,_0x1121cd){_0xa84d1=_0xa84d1-0x0;var _0x550f24=_0x7a54[_0xa84d1];return _0x550f24;};'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 c39bba2..2bd59d7 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 _0x6817=['/voice/campaign/moveContacts/:id','/checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','post'];(function(_0x33399a,_0x2b1154){var _0x18058e=function(_0x37c10d){while(--_0x37c10d){_0x33399a['push'](_0x33399a['shift']());}};_0x18058e(++_0x2b1154);}(_0x6817,0xf8));var _0x7681=function(_0x5ce887,_0x126d78){_0x5ce887=_0x5ce887-0x0;var _0x58ecb4=_0x6817[_0x5ce887];return _0x58ecb4;};'use strict';var multer=require(_0x7681('0x0'));var util=require(_0x7681('0x1'));var path=require(_0x7681('0x2'));var timeout=require(_0x7681('0x3'));var express=require(_0x7681('0x4'));var router=express[_0x7681('0x5')]();var fs_extra=require(_0x7681('0x6'));var auth=require(_0x7681('0x7'));var interaction=require(_0x7681('0x8'));var config=require(_0x7681('0x9'));var controller=require(_0x7681('0xa'));router[_0x7681('0xb')]('/',auth[_0x7681('0xc')](),controller[_0x7681('0xd')]);router['get'](_0x7681('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x7681('0xb')](_0x7681('0xf'),auth['isAuthenticated'](),controller[_0x7681('0x10')]);router[_0x7681('0xb')]('/voice/queue/countAttributes/:id',auth[_0x7681('0xc')](),controller[_0x7681('0x11')]);router[_0x7681('0xb')](_0x7681('0x12'),auth['isAuthenticated'](),controller[_0x7681('0x13')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x7681('0xc')](),controller[_0x7681('0x14')]);router[_0x7681('0x15')](_0x7681('0x16'),auth[_0x7681('0xc')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x7681('0x15')](_0x7681('0x17'),auth['isAuthenticated'](),controller['checkContactHopper']);router[_0x7681('0x18')](_0x7681('0xf'),auth[_0x7681('0xc')](),controller[_0x7681('0x19')]);module[_0x7681('0x1a')]=router; \ No newline at end of file +var _0x6b9f=['../../components/auth/service','index','get','/describe','isAuthenticated','describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0x6b9f,0x1db));var _0xf6b9=function(_0x52989c,_0x44d622){_0x52989c=_0x52989c-0x0;var _0x16758a=_0x6b9f[_0x52989c];return _0x16758a;};'use strict';var multer=require(_0xf6b9('0x0'));var util=require('util');var path=require(_0xf6b9('0x1'));var timeout=require(_0xf6b9('0x2'));var express=require(_0xf6b9('0x3'));var router=express['Router']();var fs_extra=require(_0xf6b9('0x4'));var auth=require(_0xf6b9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf6b9('0x6')]);router[_0xf6b9('0x7')](_0xf6b9('0x8'),auth[_0xf6b9('0x9')](),controller[_0xf6b9('0xa')]);router[_0xf6b9('0x7')](_0xf6b9('0xb'),auth[_0xf6b9('0x9')](),controller[_0xf6b9('0xc')]);router[_0xf6b9('0x7')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0xf6b9('0xd')]);router[_0xf6b9('0x7')](_0xf6b9('0xe'),auth[_0xf6b9('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xf6b9('0xf')](_0xf6b9('0x10'),auth[_0xf6b9('0x9')](),controller[_0xf6b9('0x11')]);router[_0xf6b9('0xf')]('/voice/campaign/moveContacts/:id',auth[_0xf6b9('0x9')](),controller[_0xf6b9('0x12')]);router['post'](_0xf6b9('0x13'),auth['isAuthenticated'](),controller[_0xf6b9('0x14')]);router[_0xf6b9('0x15')](_0xf6b9('0xb'),auth['isAuthenticated'](),controller[_0xf6b9('0x16')]);module[_0xf6b9('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index fe2c2cc..ab8d739 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 _0x7764=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x1a7a70,_0x915c8a){var _0x3c191b=function(_0x7ca397){while(--_0x7ca397){_0x1a7a70['push'](_0x1a7a70['shift']());}};_0x3c191b(++_0x915c8a);}(_0x7764,0x120));var _0x4776=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0x7764[_0x55ef8b];return _0x359c84;};'use strict';var Sequelize=require(_0x4776('0x0'));module[_0x4776('0x1')]={'state':{'type':Sequelize[_0x4776('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4776('0x3')]},'scheduledat':{'type':Sequelize[_0x4776('0x4')]},'countbusyretry':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4776('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x4776('0x3')]},'originatecalleridname':{'type':Sequelize[_0x4776('0x3')]},'calleridnum':{'type':Sequelize[_0x4776('0x3')]},'calleridname':{'type':Sequelize[_0x4776('0x3')]},'starttime':{'type':Sequelize[_0x4776('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x4776('0x4')]},'droptime':{'type':Sequelize[_0x4776('0x4')]},'endtime':{'type':Sequelize[_0x4776('0x4')]},'ringtime':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x4776('0x3')]},'campaigntype':{'type':Sequelize[_0x4776('0x3')]},'membername':{'type':Sequelize[_0x4776('0x3')]},'reason':{'type':Sequelize[_0x4776('0x3')]},'amd':{'type':Sequelize[_0x4776('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4776('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x4776('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4776('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4776('0x4')]},'recallme':{'type':Sequelize[_0x4776('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x4776('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x4776('0x3')]}}; \ No newline at end of file +var _0x9eac=['STRING','DATE','BOOLEAN','exports','INTEGER'];(function(_0x4d880e,_0x47f225){var _0x5a1326=function(_0x3d656a){while(--_0x3d656a){_0x4d880e['push'](_0x4d880e['shift']());}};_0x5a1326(++_0x47f225);}(_0x9eac,0x14d));var _0xc9ea=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0x9eac[_0x4327fe];return _0x138651;};'use strict';var Sequelize=require('sequelize');module[_0xc9ea('0x0')]={'state':{'type':Sequelize[_0xc9ea('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc9ea('0x2')]},'scheduledat':{'type':Sequelize[_0xc9ea('0x3')]},'countbusyretry':{'type':Sequelize[_0xc9ea('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc9ea('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc9ea('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xc9ea('0x2')]},'originatecalleridname':{'type':Sequelize[_0xc9ea('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc9ea('0x2')]},'starttime':{'type':Sequelize[_0xc9ea('0x3')]},'responsetime':{'type':Sequelize[_0xc9ea('0x3')]},'answertime':{'type':Sequelize[_0xc9ea('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc9ea('0x3')]},'ringtime':{'type':Sequelize[_0xc9ea('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc9ea('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc9ea('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc9ea('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc9ea('0x2')]},'campaign':{'type':Sequelize[_0xc9ea('0x2')]},'campaigntype':{'type':Sequelize[_0xc9ea('0x2')]},'membername':{'type':Sequelize[_0xc9ea('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xc9ea('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xc9ea('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc9ea('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xc9ea('0x3')]},'edited':{'type':Sequelize[_0xc9ea('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xc9ea('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc9ea('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc9ea('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc9ea('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xc9ea('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 6d8ccb2..1e92c42 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 _0x432b=['../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','update','then','end','error','stack','name','send','map','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','CmHopperHistory','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x432b,0x79));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb432('0x0'));var rimraf=require(_0xb432('0x1'));var zipdir=require(_0xb432('0x2'));var jsonpatch=require(_0xb432('0x3'));var rp=require(_0xb432('0x4'));var moment=require('moment');var BPromise=require(_0xb432('0x5'));var Mustache=require(_0xb432('0x6'));var util=require('util');var path=require(_0xb432('0x7'));var sox=require('sox');var csv=require(_0xb432('0x8'));var ejs=require(_0xb432('0x9'));var fs=require('fs');var fs_extra=require(_0xb432('0xa'));var _=require(_0xb432('0xb'));var squel=require(_0xb432('0xc'));var crypto=require('crypto');var jsforce=require(_0xb432('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb432('0x8'));var querystring=require(_0xb432('0xe'));var Papa=require(_0xb432('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb432('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb432('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xb432('0x12'));var config=require(_0xb432('0x13'));var licenseUtil=require(_0xb432('0x14'));var db=require(_0xb432('0x15'))['db'];function respondWithStatusCode(_0x5b9cbe,_0x57968f){_0x57968f=_0x57968f||0xcc;return function(_0x1429f6){if(_0x1429f6){return _0x5b9cbe[_0xb432('0x16')](_0x57968f);}return _0x5b9cbe[_0xb432('0x17')](_0x57968f)['end']();};}function respondWithResult(_0x30c5ee,_0x5d2317){_0x5d2317=_0x5d2317||0xc8;return function(_0x282fc4){if(_0x282fc4){return _0x30c5ee['status'](_0x5d2317)['json'](_0x282fc4);}};}function respondWithFilteredResult(_0x14a79d,_0x26c387){return function(_0x130c14){if(_0x130c14){var _0x161d25=typeof _0x26c387[_0xb432('0x18')]==='undefined'&&typeof _0x26c387[_0xb432('0x19')]==='undefined';var _0x5c3211=_0x130c14[_0xb432('0x1a')];var _0x1a95e5=_0x161d25?0x0:_0x26c387[_0xb432('0x18')];var _0x20e66b=_0x161d25?_0x130c14[_0xb432('0x1a')]:_0x26c387['offset']+_0x26c387[_0xb432('0x19')];var _0x459e7f;if(_0x20e66b>=_0x5c3211){_0x20e66b=_0x5c3211;_0x459e7f=0xc8;}else{_0x459e7f=0xce;}_0x14a79d['status'](_0x459e7f);return _0x14a79d[_0xb432('0x1b')](_0xb432('0x1c'),_0x1a95e5+'-'+_0x20e66b+'/'+_0x5c3211)[_0xb432('0x1d')](_0x130c14);}return null;};}function patchUpdates(_0x246616){return function(_0x48b27a){try{jsonpatch[_0xb432('0x1e')](_0x48b27a,_0x246616,!![]);}catch(_0xe8dec1){return BPromise[_0xb432('0x1f')](_0xe8dec1);}return _0x48b27a['save']();};}function saveUpdates(_0x2d5f98,_0x4bf182){return function(_0x14e890){if(_0x14e890){return _0x14e890[_0xb432('0x20')](_0x2d5f98)[_0xb432('0x21')](function(_0x5b8b7d){return _0x5b8b7d;});}return null;};}function removeEntity(_0x3f5170,_0x4e34c6){return function(_0x5ee0ea){if(_0x5ee0ea){return _0x5ee0ea['destroy']()[_0xb432('0x21')](function(){_0x3f5170[_0xb432('0x17')](0xcc)[_0xb432('0x22')]();});}};}function handleEntityNotFound(_0x229251,_0x33db25){return function(_0x4a8be1){if(!_0x4a8be1){_0x229251[_0xb432('0x16')](0x194);}return _0x4a8be1;};}function handleError(_0xefaf49,_0xf6cc9f){_0xf6cc9f=_0xf6cc9f||0x1f4;return function(_0x4ba06e){logger[_0xb432('0x23')](_0x4ba06e[_0xb432('0x24')]);if(_0x4ba06e[_0xb432('0x25')]){delete _0x4ba06e[_0xb432('0x25')];}_0xefaf49[_0xb432('0x17')](_0xf6cc9f)[_0xb432('0x26')](_0x4ba06e);};}exports['index']=function(_0x4f73a6,_0x2f1b37){var _0xd0a0a5={},_0x15fbae={},_0x319e03={'count':0x0,'rows':[]};var _0x56b1a9=_[_0xb432('0x27')](db['CmHopperHistory'][_0xb432('0x28')],function(_0x4b8a75){return{'name':_0x4b8a75['fieldName'],'type':_0x4b8a75[_0xb432('0x29')]['key']};});_0x15fbae['model']=_['map'](_0x56b1a9,_0xb432('0x25'));_0x15fbae[_0xb432('0x2a')]=_['keys'](_0x4f73a6[_0xb432('0x2a')]);_0x15fbae[_0xb432('0x2b')]=_[_0xb432('0x2c')](_0x15fbae[_0xb432('0x2d')],_0x15fbae[_0xb432('0x2a')]);_0xd0a0a5[_0xb432('0x2e')]=_['intersection'](_0x15fbae[_0xb432('0x2d')],qs['fields'](_0x4f73a6[_0xb432('0x2a')][_0xb432('0x2f')]));_0xd0a0a5[_0xb432('0x2e')]=_0xd0a0a5[_0xb432('0x2e')][_0xb432('0x30')]?_0xd0a0a5[_0xb432('0x2e')]:_0x15fbae[_0xb432('0x2d')];if(!_0x4f73a6[_0xb432('0x2a')][_0xb432('0x31')](_0xb432('0x32'))){_0xd0a0a5['limit']=qs[_0xb432('0x19')](_0x4f73a6['query'][_0xb432('0x19')]);_0xd0a0a5[_0xb432('0x18')]=qs[_0xb432('0x18')](_0x4f73a6[_0xb432('0x2a')][_0xb432('0x18')]);}_0xd0a0a5[_0xb432('0x33')]=qs['sort'](_0x4f73a6['query'][_0xb432('0x34')]);_0xd0a0a5['where']=qs[_0xb432('0x2b')](_['pick'](_0x4f73a6[_0xb432('0x2a')],_0x15fbae[_0xb432('0x2b')]),_0x56b1a9);if(_0x4f73a6[_0xb432('0x2a')][_0xb432('0x35')]){_0xd0a0a5[_0xb432('0x36')]=_[_0xb432('0x37')](_0xd0a0a5[_0xb432('0x36')],{'$or':_[_0xb432('0x27')](_0x56b1a9,function(_0x1f25ff){if(_0x1f25ff[_0xb432('0x29')]!==_0xb432('0x38')){var _0x17164b={};_0x17164b[_0x1f25ff[_0xb432('0x25')]]={'$like':'%'+_0x4f73a6[_0xb432('0x2a')][_0xb432('0x35')]+'%'};return _0x17164b;}})});}_0xd0a0a5=_[_0xb432('0x37')]({},_0xd0a0a5,_0x4f73a6['options']);var _0x269087={'where':_0xd0a0a5['where']};return db[_0xb432('0x39')][_0xb432('0x1a')](_0x269087)['then'](function(_0x549952){_0x319e03[_0xb432('0x1a')]=_0x549952;if(_0x4f73a6[_0xb432('0x2a')][_0xb432('0x3a')]){_0xd0a0a5[_0xb432('0x3b')]=[{'all':!![]}];}return db[_0xb432('0x39')][_0xb432('0x3c')](_0xd0a0a5);})[_0xb432('0x21')](function(_0x2b02f9){_0x319e03[_0xb432('0x3d')]=_0x2b02f9;return _0x319e03;})[_0xb432('0x21')](respondWithFilteredResult(_0x2f1b37,_0xd0a0a5))[_0xb432('0x3e')](handleError(_0x2f1b37,null));};exports[_0xb432('0x3f')]=function(_0x10f810,_0x55748a){var _0x381af8={'raw':!![],'where':{'id':_0x10f810[_0xb432('0x40')]['id']}},_0x53fa49={};_0x53fa49[_0xb432('0x2d')]=_[_0xb432('0x41')](db['CmHopperHistory'][_0xb432('0x28')]);_0x53fa49[_0xb432('0x2a')]=_[_0xb432('0x41')](_0x10f810[_0xb432('0x2a')]);_0x53fa49['filters']=_[_0xb432('0x2c')](_0x53fa49[_0xb432('0x2d')],_0x53fa49[_0xb432('0x2a')]);_0x381af8[_0xb432('0x2e')]=_[_0xb432('0x2c')](_0x53fa49[_0xb432('0x2d')],qs['fields'](_0x10f810[_0xb432('0x2a')][_0xb432('0x2f')]));_0x381af8[_0xb432('0x2e')]=_0x381af8['attributes']['length']?_0x381af8['attributes']:_0x53fa49[_0xb432('0x2d')];if(_0x10f810['query'][_0xb432('0x3a')]){_0x381af8['include']=[{'all':!![]}];}_0x381af8=_[_0xb432('0x37')]({},_0x381af8,_0x10f810['options']);return db[_0xb432('0x39')][_0xb432('0x42')](_0x381af8)[_0xb432('0x21')](handleEntityNotFound(_0x55748a,null))[_0xb432('0x21')](respondWithResult(_0x55748a,null))[_0xb432('0x3e')](handleError(_0x55748a,null));};exports[_0xb432('0x43')]=function(_0x4b4a2d,_0x291672){return db[_0xb432('0x39')][_0xb432('0x43')](_0x4b4a2d[_0xb432('0x44')],{})['then'](respondWithResult(_0x291672,0xc9))[_0xb432('0x3e')](handleError(_0x291672,null));};exports[_0xb432('0x45')]=function(_0xfc8f62,_0x2cd477){return db[_0xb432('0x39')][_0xb432('0x45')]()['then'](respondWithResult(_0x2cd477,null))[_0xb432('0x3e')](handleError(_0x2cd477,null));};exports[_0xb432('0x20')]=function(_0x262315,_0x3281bc){if(_0x262315[_0xb432('0x44')][_0xb432('0x46')]){delete _0x262315[_0xb432('0x44')]['uniqueid'];}return db['CmHopperHistory'][_0xb432('0x42')]({'where':{'uniqueid':_0x262315[_0xb432('0x40')]['id']}})[_0xb432('0x21')](handleEntityNotFound(_0x3281bc,null))[_0xb432('0x21')](saveUpdates(_0x262315[_0xb432('0x44')],null))[_0xb432('0x21')](respondWithResult(_0x3281bc,null))[_0xb432('0x3e')](handleError(_0x3281bc,null));}; \ No newline at end of file +var _0xb8f3=['status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','sort','filters','pick','where','merge','VIRTUAL','filter','options','CmHopperHistory','findAll','rows','catch','show','params','keys','include','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x13052b,_0x565758){var _0x135a7a=function(_0x21ab67){while(--_0x21ab67){_0x13052b['push'](_0x13052b['shift']());}};_0x135a7a(++_0x565758);}(_0xb8f3,0x112));var _0x3b8f=function(_0x508c0a,_0x1bcd5e){_0x508c0a=_0x508c0a-0x0;var _0x1c19b7=_0xb8f3[_0x508c0a];return _0x1c19b7;};'use strict';var emlformat=require(_0x3b8f('0x0'));var rimraf=require(_0x3b8f('0x1'));var zipdir=require(_0x3b8f('0x2'));var jsonpatch=require(_0x3b8f('0x3'));var rp=require(_0x3b8f('0x4'));var moment=require(_0x3b8f('0x5'));var BPromise=require(_0x3b8f('0x6'));var Mustache=require('mustache');var util=require(_0x3b8f('0x7'));var path=require(_0x3b8f('0x8'));var sox=require(_0x3b8f('0x9'));var csv=require(_0x3b8f('0xa'));var ejs=require(_0x3b8f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b8f('0xc'));var squel=require(_0x3b8f('0xd'));var crypto=require(_0x3b8f('0xe'));var jsforce=require(_0x3b8f('0xf'));var deskjs=require(_0x3b8f('0x10'));var toCsv=require(_0x3b8f('0xa'));var querystring=require('querystring');var Papa=require(_0x3b8f('0x11'));var Redis=require(_0x3b8f('0x12'));var authService=require(_0x3b8f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3b8f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b8f('0x15'))(_0x3b8f('0x16'));var utils=require(_0x3b8f('0x17'));var config=require(_0x3b8f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b8f('0x19'))['db'];function respondWithStatusCode(_0x255702,_0x632552){_0x632552=_0x632552||0xcc;return function(_0x134790){if(_0x134790){return _0x255702['sendStatus'](_0x632552);}return _0x255702[_0x3b8f('0x1a')](_0x632552)[_0x3b8f('0x1b')]();};}function respondWithResult(_0x21e7df,_0x1b4f33){_0x1b4f33=_0x1b4f33||0xc8;return function(_0x4388a0){if(_0x4388a0){return _0x21e7df[_0x3b8f('0x1a')](_0x1b4f33)[_0x3b8f('0x1c')](_0x4388a0);}};}function respondWithFilteredResult(_0x574846,_0x32c78a){return function(_0x3d4d5f){if(_0x3d4d5f){var _0xb38476=typeof _0x32c78a[_0x3b8f('0x1d')]===_0x3b8f('0x1e')&&typeof _0x32c78a[_0x3b8f('0x1f')]==='undefined';var _0x3d22e6=_0x3d4d5f[_0x3b8f('0x20')];var _0x2929b1=_0xb38476?0x0:_0x32c78a['offset'];var _0x3968ac=_0xb38476?_0x3d4d5f[_0x3b8f('0x20')]:_0x32c78a[_0x3b8f('0x1d')]+_0x32c78a[_0x3b8f('0x1f')];var _0x5b5021;if(_0x3968ac>=_0x3d22e6){_0x3968ac=_0x3d22e6;_0x5b5021=0xc8;}else{_0x5b5021=0xce;}_0x574846['status'](_0x5b5021);return _0x574846[_0x3b8f('0x21')]('Content-Range',_0x2929b1+'-'+_0x3968ac+'/'+_0x3d22e6)['json'](_0x3d4d5f);}return null;};}function patchUpdates(_0x5b1d5f){return function(_0x47722a){try{jsonpatch[_0x3b8f('0x22')](_0x47722a,_0x5b1d5f,!![]);}catch(_0x82c4b7){return BPromise[_0x3b8f('0x23')](_0x82c4b7);}return _0x47722a[_0x3b8f('0x24')]();};}function saveUpdates(_0x2e1d9e,_0x445f7b){return function(_0x42f636){if(_0x42f636){return _0x42f636[_0x3b8f('0x25')](_0x2e1d9e)[_0x3b8f('0x26')](function(_0x49c3df){return _0x49c3df;});}return null;};}function removeEntity(_0x4850f5,_0xde2c2e){return function(_0xc486ad){if(_0xc486ad){return _0xc486ad['destroy']()[_0x3b8f('0x26')](function(){_0x4850f5[_0x3b8f('0x1a')](0xcc)[_0x3b8f('0x1b')]();});}};}function handleEntityNotFound(_0x3082c6,_0x2fbc25){return function(_0x5ad85d){if(!_0x5ad85d){_0x3082c6['sendStatus'](0x194);}return _0x5ad85d;};}function handleError(_0x14ca1a,_0x235585){_0x235585=_0x235585||0x1f4;return function(_0x3fdbf8){logger[_0x3b8f('0x27')](_0x3fdbf8['stack']);if(_0x3fdbf8[_0x3b8f('0x28')]){delete _0x3fdbf8[_0x3b8f('0x28')];}_0x14ca1a[_0x3b8f('0x1a')](_0x235585)[_0x3b8f('0x29')](_0x3fdbf8);};}exports[_0x3b8f('0x2a')]=function(_0x947dd8,_0x5961e4){var _0x587411={},_0x1d43e2={},_0x59d0c2={'count':0x0,'rows':[]};var _0x12f563=_[_0x3b8f('0x2b')](db['CmHopperHistory'][_0x3b8f('0x2c')],function(_0x1097e0){return{'name':_0x1097e0[_0x3b8f('0x2d')],'type':_0x1097e0[_0x3b8f('0x2e')][_0x3b8f('0x2f')]};});_0x1d43e2[_0x3b8f('0x30')]=_['map'](_0x12f563,_0x3b8f('0x28'));_0x1d43e2[_0x3b8f('0x31')]=_['keys'](_0x947dd8[_0x3b8f('0x31')]);_0x1d43e2['filters']=_[_0x3b8f('0x32')](_0x1d43e2[_0x3b8f('0x30')],_0x1d43e2['query']);_0x587411[_0x3b8f('0x33')]=_[_0x3b8f('0x32')](_0x1d43e2[_0x3b8f('0x30')],qs[_0x3b8f('0x34')](_0x947dd8[_0x3b8f('0x31')]['fields']));_0x587411[_0x3b8f('0x33')]=_0x587411[_0x3b8f('0x33')][_0x3b8f('0x35')]?_0x587411['attributes']:_0x1d43e2['model'];if(!_0x947dd8['query']['hasOwnProperty']('nolimit')){_0x587411[_0x3b8f('0x1f')]=qs[_0x3b8f('0x1f')](_0x947dd8[_0x3b8f('0x31')][_0x3b8f('0x1f')]);_0x587411[_0x3b8f('0x1d')]=qs[_0x3b8f('0x1d')](_0x947dd8[_0x3b8f('0x31')][_0x3b8f('0x1d')]);}_0x587411['order']=qs[_0x3b8f('0x36')](_0x947dd8['query'][_0x3b8f('0x36')]);_0x587411['where']=qs[_0x3b8f('0x37')](_[_0x3b8f('0x38')](_0x947dd8[_0x3b8f('0x31')],_0x1d43e2[_0x3b8f('0x37')]),_0x12f563);if(_0x947dd8[_0x3b8f('0x31')]['filter']){_0x587411[_0x3b8f('0x39')]=_[_0x3b8f('0x3a')](_0x587411['where'],{'$or':_[_0x3b8f('0x2b')](_0x12f563,function(_0x269d46){if(_0x269d46[_0x3b8f('0x2e')]!==_0x3b8f('0x3b')){var _0x87a1a2={};_0x87a1a2[_0x269d46['name']]={'$like':'%'+_0x947dd8[_0x3b8f('0x31')][_0x3b8f('0x3c')]+'%'};return _0x87a1a2;}})});}_0x587411=_[_0x3b8f('0x3a')]({},_0x587411,_0x947dd8[_0x3b8f('0x3d')]);var _0x247f02={'where':_0x587411['where']};return db[_0x3b8f('0x3e')][_0x3b8f('0x20')](_0x247f02)[_0x3b8f('0x26')](function(_0x48dc65){_0x59d0c2[_0x3b8f('0x20')]=_0x48dc65;if(_0x947dd8[_0x3b8f('0x31')]['includeAll']){_0x587411['include']=[{'all':!![]}];}return db[_0x3b8f('0x3e')][_0x3b8f('0x3f')](_0x587411);})['then'](function(_0x29d8a3){_0x59d0c2[_0x3b8f('0x40')]=_0x29d8a3;return _0x59d0c2;})[_0x3b8f('0x26')](respondWithFilteredResult(_0x5961e4,_0x587411))[_0x3b8f('0x41')](handleError(_0x5961e4,null));};exports[_0x3b8f('0x42')]=function(_0x44d657,_0x2c9663){var _0x21bf5d={'raw':!![],'where':{'id':_0x44d657[_0x3b8f('0x43')]['id']}},_0x5ef614={};_0x5ef614['model']=_['keys'](db[_0x3b8f('0x3e')]['rawAttributes']);_0x5ef614[_0x3b8f('0x31')]=_[_0x3b8f('0x44')](_0x44d657['query']);_0x5ef614['filters']=_[_0x3b8f('0x32')](_0x5ef614[_0x3b8f('0x30')],_0x5ef614[_0x3b8f('0x31')]);_0x21bf5d[_0x3b8f('0x33')]=_[_0x3b8f('0x32')](_0x5ef614[_0x3b8f('0x30')],qs['fields'](_0x44d657[_0x3b8f('0x31')][_0x3b8f('0x34')]));_0x21bf5d[_0x3b8f('0x33')]=_0x21bf5d['attributes']['length']?_0x21bf5d['attributes']:_0x5ef614[_0x3b8f('0x30')];if(_0x44d657[_0x3b8f('0x31')]['includeAll']){_0x21bf5d[_0x3b8f('0x45')]=[{'all':!![]}];}_0x21bf5d=_[_0x3b8f('0x3a')]({},_0x21bf5d,_0x44d657[_0x3b8f('0x3d')]);return db['CmHopperHistory'][_0x3b8f('0x46')](_0x21bf5d)[_0x3b8f('0x26')](handleEntityNotFound(_0x2c9663,null))[_0x3b8f('0x26')](respondWithResult(_0x2c9663,null))['catch'](handleError(_0x2c9663,null));};exports['create']=function(_0x260164,_0x56432e){return db[_0x3b8f('0x3e')][_0x3b8f('0x47')](_0x260164[_0x3b8f('0x48')],{})[_0x3b8f('0x26')](respondWithResult(_0x56432e,0xc9))[_0x3b8f('0x41')](handleError(_0x56432e,null));};exports[_0x3b8f('0x49')]=function(_0x368f57,_0x13ea64){return db[_0x3b8f('0x3e')][_0x3b8f('0x49')]()[_0x3b8f('0x26')](respondWithResult(_0x13ea64,null))[_0x3b8f('0x41')](handleError(_0x13ea64,null));};exports['update']=function(_0x2373f8,_0x2f213c){if(_0x2373f8[_0x3b8f('0x48')][_0x3b8f('0x4a')]){delete _0x2373f8[_0x3b8f('0x48')][_0x3b8f('0x4a')];}return db[_0x3b8f('0x3e')][_0x3b8f('0x46')]({'where':{'uniqueid':_0x2373f8[_0x3b8f('0x43')]['id']}})[_0x3b8f('0x26')](handleEntityNotFound(_0x2f213c,null))[_0x3b8f('0x26')](saveUpdates(_0x2373f8[_0x3b8f('0x48')],null))['then'](respondWithResult(_0x2f213c,null))[_0x3b8f('0x41')](handleError(_0x2f213c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 99e04db..5fddcbe 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 _0xd5c8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','CmHopperHistory','cm_hopper_history','endtime','../../config/logger','api'];(function(_0x316f61,_0x1f2c5c){var _0x42acbc=function(_0x21c5b2){while(--_0x21c5b2){_0x316f61['push'](_0x316f61['shift']());}};_0x42acbc(++_0x1f2c5c);}(_0xd5c8,0x166));var _0x8d5c=function(_0x10b434,_0x521745){_0x10b434=_0x10b434-0x0;var _0x31050b=_0xd5c8[_0x10b434];return _0x31050b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8d5c('0x0'))(_0x8d5c('0x1'));var moment=require(_0x8d5c('0x2'));var BPromise=require(_0x8d5c('0x3'));var rp=require(_0x8d5c('0x4'));var fs=require('fs');var path=require(_0x8d5c('0x5'));var rimraf=require(_0x8d5c('0x6'));var config=require(_0x8d5c('0x7'));var attributes=require(_0x8d5c('0x8'));module['exports']=function(_0xd72ba3,_0x5d3fff){return _0xd72ba3['define'](_0x8d5c('0x9'),attributes,{'tableName':_0x8d5c('0xa'),'paranoid':![],'indexes':[{'name':_0x8d5c('0xb'),'fields':[_0x8d5c('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ace=['request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1f4e09,_0x1fc591){var _0x10deec=function(_0x5c1fb9){while(--_0x5c1fb9){_0x1f4e09['push'](_0x1f4e09['shift']());}};_0x10deec(++_0x1fc591);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x8eb3ce,_0x130a49){_0x8eb3ce=_0x8eb3ce-0x0;var _0x44df65=_0x8ace[_0x8eb3ce];return _0x44df65;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var logger=require(_0xe8ac('0x2'))(_0xe8ac('0x3'));var moment=require(_0xe8ac('0x4'));var BPromise=require(_0xe8ac('0x5'));var rp=require(_0xe8ac('0x6'));var fs=require('fs');var path=require(_0xe8ac('0x7'));var rimraf=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var attributes=require(_0xe8ac('0xa'));module[_0xe8ac('0xb')]=function(_0x170e14,_0x2b48ec){return _0x170e14['define'](_0xe8ac('0xc'),attributes,{'tableName':_0xe8ac('0xd'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0xe8ac('0xe'),'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 35630f3..07eea07 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 _0x3c31=['GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','GetCampaignHopperHistory','CmHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','create','body','options','AvgHandleTime','findAll','raw','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime'];(function(_0x5f22cb,_0x4fda24){var _0x17430e=function(_0x351d09){while(--_0x351d09){_0x5f22cb['push'](_0x5f22cb['shift']());}};_0x17430e(++_0x4fda24);}(_0x3c31,0xb1));var _0x13c3=function(_0x89e1e6,_0xb7eaf8){_0x89e1e6=_0x89e1e6-0x0;var _0x3d9e56=_0x3c31[_0x89e1e6];return _0x3d9e56;};'use strict';var _=require(_0x13c3('0x0'));var util=require(_0x13c3('0x1'));var moment=require(_0x13c3('0x2'));var BPromise=require(_0x13c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c3('0x4'));var db=require(_0x13c3('0x5'))['db'];var utils=require(_0x13c3('0x6'));var logger=require(_0x13c3('0x7'))(_0x13c3('0x8'));var config=require(_0x13c3('0x9'));var jayson=require(_0x13c3('0xa'));var client=jayson[_0x13c3('0xb')][_0x13c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c217d,_0x367bba,_0x21a72c){return new BPromise(function(_0x4802e1,_0xaf7a8d){return client[_0x13c3('0xd')](_0x3c217d,_0x21a72c)[_0x13c3('0xe')](function(_0x2a9a20){logger['info'](_0x13c3('0xf'),_0x367bba,'request\x20sent');logger[_0x13c3('0x10')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x367bba,_0x13c3('0x11'),JSON[_0x13c3('0x12')](_0x2a9a20));if(_0x2a9a20[_0x13c3('0x13')]){if(_0x2a9a20[_0x13c3('0x13')][_0x13c3('0x14')]===0x1f4){logger[_0x13c3('0x13')](_0x13c3('0xf'),_0x367bba,_0x2a9a20['error'][_0x13c3('0x15')]);return _0xaf7a8d(_0x2a9a20['error'][_0x13c3('0x15')]);}logger[_0x13c3('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x367bba,_0x2a9a20[_0x13c3('0x13')][_0x13c3('0x15')]);return _0x4802e1(_0x2a9a20[_0x13c3('0x13')]['message']);}else{logger[_0x13c3('0x16')]('CmHopperHistory,\x20%s,\x20%s',_0x367bba,_0x13c3('0x11'));_0x4802e1(_0x2a9a20[_0x13c3('0x17')][_0x13c3('0x15')]);}})[_0x13c3('0x18')](function(_0x5cdcc3){logger['error'](_0x13c3('0xf'),_0x367bba,_0x5cdcc3);_0xaf7a8d(_0x5cdcc3);});});}exports[_0x13c3('0x19')]=function(_0x215fb7){var _0x45abbe=this;return new Promise(function(_0x29ba55,_0xcb7624){return db['CmHopperHistory'][_0x13c3('0x1a')](_0x215fb7[_0x13c3('0x1b')],{'raw':_0x215fb7[_0x13c3('0x1c')]?_0x215fb7[_0x13c3('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5ad708){logger[_0x13c3('0x16')](_0x13c3('0x19'),_0x215fb7);logger[_0x13c3('0x10')](_0x13c3('0x19'),_0x215fb7,JSON[_0x13c3('0x12')](_0x5ad708));_0x29ba55(_0x5ad708);})[_0x13c3('0x18')](function(_0x4a68ec){logger[_0x13c3('0x13')](_0x13c3('0x19'),_0x4a68ec[_0x13c3('0x15')],_0x215fb7);_0xcb7624(_0x45abbe[_0x13c3('0x13')](0x1f4,_0x4a68ec[_0x13c3('0x15')]));});});};exports[_0x13c3('0x1d')]=function(_0x3e8151){var _0xc8a1ca=this;return new Promise(function(_0x4faeaa,_0x5d57e3){return db['CmHopperHistory'][_0x13c3('0x1e')]({'raw':_0x3e8151[_0x13c3('0x1c')]?_0x3e8151[_0x13c3('0x1c')][_0x13c3('0x1f')]===undefined?!![]:![]:!![],'where':_0x3e8151[_0x13c3('0x1c')]?_0x3e8151['options'][_0x13c3('0x20')]||null:null,'attributes':[[db[_0x13c3('0x21')]['fn']('COUNT',db[_0x13c3('0x21')][_0x13c3('0x22')]('id')),_0x13c3('0x23')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db['sequelize'][_0x13c3('0x25')](_0x13c3('0x26')))),_0x13c3('0x27')],[db['sequelize']['fn'](_0x13c3('0x24'),db['sequelize']['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')]('`state`\x20=\x2010,\x201,\x20null'))),_0x13c3('0x28')],[db['sequelize']['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x29')))),_0x13c3('0x2a')],[db[_0x13c3('0x21')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x2b')))),_0x13c3('0x2c')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x2d'),db[_0x13c3('0x21')]['fn']('IF',db['sequelize'][_0x13c3('0x25')](_0x13c3('0x2e')))),_0x13c3('0x2f')]]})['then'](function(_0x26fbe4){logger[_0x13c3('0x16')](_0x13c3('0x1d'),_0x3e8151);logger[_0x13c3('0x10')](_0x13c3('0x1d'),_0x3e8151,JSON[_0x13c3('0x12')](_0x26fbe4));_0x4faeaa(_0x26fbe4);})[_0x13c3('0x18')](function(_0x17c3c3){logger[_0x13c3('0x13')](_0x13c3('0x1d'),_0x17c3c3[_0x13c3('0x15')],_0x3e8151);_0x5d57e3(_0xc8a1ca['error'](0x1f4,_0x17c3c3[_0x13c3('0x15')]));});});};exports[_0x13c3('0x30')]=function(_0x11dc4a){var _0x55f561=this;return new Promise(function(_0x3f7800,_0x344bf8){return db['CmHopperHistory'][_0x13c3('0x1e')]({'raw':_0x11dc4a[_0x13c3('0x1c')]?_0x11dc4a[_0x13c3('0x1c')][_0x13c3('0x1f')]===undefined?!![]:![]:!![],'where':_0x11dc4a[_0x13c3('0x1c')]?_0x11dc4a[_0x13c3('0x1c')]['where']||null:null,'attributes':[[_0x13c3('0x31'),_0x13c3('0x32')],[db[_0x13c3('0x21')]['fn']('COUNT',db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')]['literal'](_0x13c3('0x33')))),_0x13c3('0x34')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')]['literal'](_0x13c3('0x35')))),_0x13c3('0x36')],[db[_0x13c3('0x21')]['fn']('COUNT',db[_0x13c3('0x21')]['fn']('IF',db['sequelize'][_0x13c3('0x25')](_0x13c3('0x26')))),_0x13c3('0x37')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')]['literal'](_0x13c3('0x38')))),_0x13c3('0x39')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db['sequelize']['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x3a')))),_0x13c3('0x3b')],[db['sequelize']['fn'](_0x13c3('0x24'),db['sequelize']['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x3c')))),_0x13c3('0x3d')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db['sequelize']['literal'](_0x13c3('0x3e')))),_0x13c3('0x3f')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),'outboundBlacklistCallsDay'],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')]['literal'](_0x13c3('0x40')))),_0x13c3('0x41')],[db[_0x13c3('0x21')]['fn']('COUNT',db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x42')))),'outboundRejectCallsDay'],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db['sequelize'][_0x13c3('0x25')](_0x13c3('0x43')))),_0x13c3('0x44')],[db[_0x13c3('0x21')]['fn']('COUNT',db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x45')))),_0x13c3('0x46')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db['sequelize']['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':['campaign']})[_0x13c3('0xe')](function(_0x14785e){logger[_0x13c3('0x16')](_0x13c3('0x30'),_0x11dc4a);logger[_0x13c3('0x10')]('GetVoiceQueueHopperHistory',_0x11dc4a,JSON[_0x13c3('0x12')](_0x14785e));_0x3f7800(_0x14785e);})[_0x13c3('0x18')](function(_0x35d24d){logger[_0x13c3('0x13')]('GetVoiceQueueHopperHistory',_0x35d24d['message'],_0x11dc4a);_0x344bf8(_0x55f561[_0x13c3('0x13')](0x1f4,_0x35d24d[_0x13c3('0x15')]));});});};exports[_0x13c3('0x47')]=function(_0x1a9ffa){var _0x2d7ee2=this;return new Promise(function(_0x4eaddf,_0x17453a){return db[_0x13c3('0x48')]['findAll']({'raw':_0x1a9ffa[_0x13c3('0x1c')]?_0x1a9ffa[_0x13c3('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1a9ffa[_0x13c3('0x1c')]?_0x1a9ffa[_0x13c3('0x1c')][_0x13c3('0x20')]||null:null,'attributes':[['campaign','name'],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')][_0x13c3('0x22')]('id')),_0x13c3('0x49')],[db['sequelize']['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x26')))),_0x13c3('0x4a')]],'group':[_0x13c3('0x31')]})['then'](function(_0x10b90a){logger[_0x13c3('0x16')](_0x13c3('0x47'),_0x1a9ffa);logger[_0x13c3('0x10')](_0x13c3('0x47'),_0x1a9ffa,JSON[_0x13c3('0x12')](_0x10b90a));_0x4eaddf(_0x10b90a);})['catch'](function(_0x57d5f3){logger[_0x13c3('0x13')](_0x13c3('0x47'),_0x57d5f3[_0x13c3('0x15')],_0x1a9ffa);_0x17453a(_0x2d7ee2['error'](0x1f4,_0x57d5f3[_0x13c3('0x15')]));});});}; \ No newline at end of file +var _0xea12=['http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateCmHopperHistory','create','body','options','debug','AvgHandleTime','CmHopperHistory','findAll','raw','where','sequelize','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','predictiveIntervalAvgTalktime','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','GetVoiceQueueHopperHistory','stringify','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x18e90b,_0x45630e){var _0x11cd20=function(_0x4edd0d){while(--_0x4edd0d){_0x18e90b['push'](_0x18e90b['shift']());}};_0x11cd20(++_0x45630e);}(_0xea12,0x149));var _0x2ea1=function(_0x15fc09,_0x3bf36c){_0x15fc09=_0x15fc09-0x0;var _0x12c202=_0xea12[_0x15fc09];return _0x12c202;};'use strict';var _=require(_0x2ea1('0x0'));var util=require(_0x2ea1('0x1'));var moment=require(_0x2ea1('0x2'));var BPromise=require(_0x2ea1('0x3'));var rs=require(_0x2ea1('0x4'));var fs=require('fs');var Redis=require(_0x2ea1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ea1('0x6'));var logger=require(_0x2ea1('0x7'))('rpc');var config=require(_0x2ea1('0x8'));var jayson=require(_0x2ea1('0x9'));var client=jayson[_0x2ea1('0xa')][_0x2ea1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e7ab2,_0x3177fd,_0x16b11e){return new BPromise(function(_0x5efe62,_0x19bfe4){return client['request'](_0x4e7ab2,_0x16b11e)[_0x2ea1('0xc')](function(_0x4016f3){logger[_0x2ea1('0xd')](_0x2ea1('0xe'),_0x3177fd,_0x2ea1('0xf'));logger['debug'](_0x2ea1('0x10'),_0x3177fd,_0x2ea1('0xf'),JSON['stringify'](_0x4016f3));if(_0x4016f3['error']){if(_0x4016f3[_0x2ea1('0x11')][_0x2ea1('0x12')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x3177fd,_0x4016f3[_0x2ea1('0x11')][_0x2ea1('0x13')]);return _0x19bfe4(_0x4016f3['error'][_0x2ea1('0x13')]);}logger[_0x2ea1('0x11')](_0x2ea1('0xe'),_0x3177fd,_0x4016f3[_0x2ea1('0x11')][_0x2ea1('0x13')]);return _0x5efe62(_0x4016f3[_0x2ea1('0x11')]['message']);}else{logger[_0x2ea1('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x3177fd,'request\x20sent');_0x5efe62(_0x4016f3[_0x2ea1('0x14')][_0x2ea1('0x13')]);}})[_0x2ea1('0x15')](function(_0x3d5736){logger[_0x2ea1('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x3177fd,_0x3d5736);_0x19bfe4(_0x3d5736);});});}exports[_0x2ea1('0x16')]=function(_0xb0b766){var _0x219f92=this;return new Promise(function(_0x224622,_0xf0eeac){return db['CmHopperHistory'][_0x2ea1('0x17')](_0xb0b766[_0x2ea1('0x18')],{'raw':_0xb0b766['options']?_0xb0b766[_0x2ea1('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x2ea1('0xc')](function(_0x11c3ab){logger[_0x2ea1('0xd')](_0x2ea1('0x16'),_0xb0b766);logger[_0x2ea1('0x1a')](_0x2ea1('0x16'),_0xb0b766,JSON['stringify'](_0x11c3ab));_0x224622(_0x11c3ab);})[_0x2ea1('0x15')](function(_0x1ff647){logger[_0x2ea1('0x11')]('CreateCmHopperHistory',_0x1ff647[_0x2ea1('0x13')],_0xb0b766);_0xf0eeac(_0x219f92[_0x2ea1('0x11')](0x1f4,_0x1ff647[_0x2ea1('0x13')]));});});};exports[_0x2ea1('0x1b')]=function(_0x1ef4fa){var _0x1b8816=this;return new Promise(function(_0xa169e8,_0x1aeaf2){return db[_0x2ea1('0x1c')][_0x2ea1('0x1d')]({'raw':_0x1ef4fa['options']?_0x1ef4fa[_0x2ea1('0x19')][_0x2ea1('0x1e')]===undefined?!![]:![]:!![],'where':_0x1ef4fa[_0x2ea1('0x19')]?_0x1ef4fa[_0x2ea1('0x19')][_0x2ea1('0x1f')]||null:null,'attributes':[[db[_0x2ea1('0x20')]['fn']('COUNT',db[_0x2ea1('0x20')]['col']('id')),_0x2ea1('0x21')],[db[_0x2ea1('0x20')]['fn'](_0x2ea1('0x22'),db['sequelize']['fn']('IF',db[_0x2ea1('0x20')][_0x2ea1('0x23')](_0x2ea1('0x24')))),_0x2ea1('0x25')],[db['sequelize']['fn'](_0x2ea1('0x22'),db[_0x2ea1('0x20')]['fn']('IF',db[_0x2ea1('0x20')][_0x2ea1('0x23')](_0x2ea1('0x26')))),_0x2ea1('0x27')],[db[_0x2ea1('0x20')]['fn'](_0x2ea1('0x22'),db[_0x2ea1('0x20')]['fn']('IF',db[_0x2ea1('0x20')][_0x2ea1('0x23')](_0x2ea1('0x28')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x2ea1('0x20')]['fn']('AVG',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x2ea1('0x29')))),_0x2ea1('0x2a')],[db['sequelize']['fn'](_0x2ea1('0x2b'),db[_0x2ea1('0x20')]['fn']('IF',db[_0x2ea1('0x20')][_0x2ea1('0x23')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x2ea1('0x2c')]]})['then'](function(_0x4a7ede){logger['info'](_0x2ea1('0x1b'),_0x1ef4fa);logger[_0x2ea1('0x1a')](_0x2ea1('0x1b'),_0x1ef4fa,JSON['stringify'](_0x4a7ede));_0xa169e8(_0x4a7ede);})[_0x2ea1('0x15')](function(_0x1ba1de){logger[_0x2ea1('0x11')](_0x2ea1('0x1b'),_0x1ba1de[_0x2ea1('0x13')],_0x1ef4fa);_0x1aeaf2(_0x1b8816['error'](0x1f4,_0x1ba1de[_0x2ea1('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x4532dd){var _0x43750a=this;return new Promise(function(_0x509ead,_0x2b0a71){return db[_0x2ea1('0x1c')]['findAll']({'raw':_0x4532dd['options']?_0x4532dd[_0x2ea1('0x19')][_0x2ea1('0x1e')]===undefined?!![]:![]:!![],'where':_0x4532dd[_0x2ea1('0x19')]?_0x4532dd['options'][_0x2ea1('0x1f')]||null:null,'attributes':[[_0x2ea1('0x2d'),'name'],[db['sequelize']['fn'](_0x2ea1('0x22'),db['sequelize']['fn']('IF',db[_0x2ea1('0x20')]['literal'](_0x2ea1('0x2e')))),'outboundNoSuchCallsDay'],[db[_0x2ea1('0x20')]['fn'](_0x2ea1('0x22'),db[_0x2ea1('0x20')]['fn']('IF',db['sequelize']['literal'](_0x2ea1('0x2f')))),_0x2ea1('0x30')],[db['sequelize']['fn']('COUNT',db[_0x2ea1('0x20')]['fn']('IF',db[_0x2ea1('0x20')]['literal'](_0x2ea1('0x24')))),_0x2ea1('0x31')],[db[_0x2ea1('0x20')]['fn'](_0x2ea1('0x22'),db['sequelize']['fn']('IF',db[_0x2ea1('0x20')][_0x2ea1('0x23')](_0x2ea1('0x32')))),'outboundBusyCallsDay'],[db[_0x2ea1('0x20')]['fn'](_0x2ea1('0x22'),db[_0x2ea1('0x20')]['fn']('IF',db[_0x2ea1('0x20')][_0x2ea1('0x23')](_0x2ea1('0x33')))),_0x2ea1('0x34')],[db[_0x2ea1('0x20')]['fn'](_0x2ea1('0x22'),db[_0x2ea1('0x20')]['fn']('IF',db[_0x2ea1('0x20')][_0x2ea1('0x23')](_0x2ea1('0x35')))),_0x2ea1('0x36')],[db[_0x2ea1('0x20')]['fn']('COUNT',db[_0x2ea1('0x20')]['fn']('IF',db[_0x2ea1('0x20')]['literal'](_0x2ea1('0x37')))),_0x2ea1('0x38')],[db['sequelize']['fn'](_0x2ea1('0x22'),db['sequelize']['fn']('IF',db[_0x2ea1('0x20')][_0x2ea1('0x23')](_0x2ea1('0x39')))),_0x2ea1('0x3a')],[db[_0x2ea1('0x20')]['fn'](_0x2ea1('0x22'),db[_0x2ea1('0x20')]['fn']('IF',db[_0x2ea1('0x20')][_0x2ea1('0x23')](_0x2ea1('0x3b')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0x2ea1('0x22'),db[_0x2ea1('0x20')]['fn']('IF',db[_0x2ea1('0x20')]['literal'](_0x2ea1('0x3c')))),_0x2ea1('0x3d')],[db[_0x2ea1('0x20')]['fn'](_0x2ea1('0x22'),db[_0x2ea1('0x20')]['fn']('IF',db[_0x2ea1('0x20')]['literal'](_0x2ea1('0x3e')))),_0x2ea1('0x3f')],[db[_0x2ea1('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2ea1('0x20')][_0x2ea1('0x23')](_0x2ea1('0x40')))),'outboundAnswerAgiCallsDay'],[db[_0x2ea1('0x20')]['fn'](_0x2ea1('0x22'),db[_0x2ea1('0x20')]['fn']('IF',db[_0x2ea1('0x20')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x2ea1('0x20')]['fn'](_0x2ea1('0x22'),db[_0x2ea1('0x20')]['fn']('IF',db[_0x2ea1('0x20')][_0x2ea1('0x23')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x2ea1('0x2d')]})[_0x2ea1('0xc')](function(_0x597d9b){logger['info'](_0x2ea1('0x41'),_0x4532dd);logger['debug'](_0x2ea1('0x41'),_0x4532dd,JSON[_0x2ea1('0x42')](_0x597d9b));_0x509ead(_0x597d9b);})['catch'](function(_0x1f24ca){logger[_0x2ea1('0x11')](_0x2ea1('0x41'),_0x1f24ca['message'],_0x4532dd);_0x2b0a71(_0x43750a[_0x2ea1('0x11')](0x1f4,_0x1f24ca['message']));});});};exports[_0x2ea1('0x43')]=function(_0xa985f8){var _0x549728=this;return new Promise(function(_0x5d4515,_0x433db2){return db[_0x2ea1('0x1c')][_0x2ea1('0x1d')]({'raw':_0xa985f8[_0x2ea1('0x19')]?_0xa985f8[_0x2ea1('0x19')][_0x2ea1('0x1e')]===undefined?!![]:![]:!![],'where':_0xa985f8['options']?_0xa985f8[_0x2ea1('0x19')][_0x2ea1('0x1f')]||null:null,'attributes':[[_0x2ea1('0x2d'),'name'],[db[_0x2ea1('0x20')]['fn']('COUNT',db[_0x2ea1('0x20')]['col']('id')),'ivrTotalCallsDays'],[db[_0x2ea1('0x20')]['fn'](_0x2ea1('0x22'),db[_0x2ea1('0x20')]['fn']('IF',db['sequelize'][_0x2ea1('0x23')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0x2ea1('0x2d')]})['then'](function(_0x3589b4){logger[_0x2ea1('0xd')](_0x2ea1('0x43'),_0xa985f8);logger[_0x2ea1('0x1a')]('GetCampaignHopperHistory',_0xa985f8,JSON[_0x2ea1('0x42')](_0x3589b4));_0x5d4515(_0x3589b4);})[_0x2ea1('0x15')](function(_0x4c24eb){logger[_0x2ea1('0x11')](_0x2ea1('0x43'),_0x4c24eb[_0x2ea1('0x13')],_0xa985f8);_0x433db2(_0x549728[_0x2ea1('0x11')](0x1f4,_0x4c24eb[_0x2ea1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 2b84649..52a161a 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 _0x494f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','index','isAuthenticated','describe','post','create','put','/:id','update','multer','util'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x494f,0x108));var _0xf494=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x494f[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xf494('0x0'));var util=require(_0xf494('0x1'));var path=require(_0xf494('0x2'));var timeout=require(_0xf494('0x3'));var express=require(_0xf494('0x4'));var router=express[_0xf494('0x5')]();var fs_extra=require(_0xf494('0x6'));var auth=require(_0xf494('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf494('0x8'));var controller=require(_0xf494('0x9'));router[_0xf494('0xa')]('/',auth['isAuthenticated'](),controller[_0xf494('0xb')]);router[_0xf494('0xa')]('/describe',auth[_0xf494('0xc')](),controller[_0xf494('0xd')]);router[_0xf494('0xa')]('/:id',auth[_0xf494('0xc')](),controller['show']);router[_0xf494('0xe')]('/',auth[_0xf494('0xc')](),controller[_0xf494('0xf')]);router[_0xf494('0x10')](_0xf494('0x11'),auth[_0xf494('0xc')](),controller[_0xf494('0x12')]);module['exports']=router; \ No newline at end of file +var _0x96bf=['/describe','isAuthenticated','describe','/:id','show','post','create','put','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x96bf,0x16d));var _0xf96b=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0x96bf[_0xcfd89f];return _0x59acd4;};'use strict';var multer=require('multer');var util=require(_0xf96b('0x0'));var path=require('path');var timeout=require(_0xf96b('0x1'));var express=require(_0xf96b('0x2'));var router=express['Router']();var fs_extra=require(_0xf96b('0x3'));var auth=require(_0xf96b('0x4'));var interaction=require(_0xf96b('0x5'));var config=require(_0xf96b('0x6'));var controller=require('./cmHopperHistory.controller');router[_0xf96b('0x7')]('/',auth['isAuthenticated'](),controller[_0xf96b('0x8')]);router[_0xf96b('0x7')](_0xf96b('0x9'),auth[_0xf96b('0xa')](),controller[_0xf96b('0xb')]);router[_0xf96b('0x7')](_0xf96b('0xc'),auth[_0xf96b('0xa')](),controller[_0xf96b('0xd')]);router[_0xf96b('0xe')]('/',auth[_0xf96b('0xa')](),controller[_0xf96b('0xf')]);router[_0xf96b('0x10')](_0xf96b('0xc'),auth[_0xf96b('0xa')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 6f2e726..6bf8b18 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 _0xa3e6=['sequelize','STRING'];(function(_0x2b7868,_0x44616c){var _0x3e7ce4=function(_0x1eb9ab){while(--_0x1eb9ab){_0x2b7868['push'](_0x2b7868['shift']());}};_0x3e7ce4(++_0x44616c);}(_0xa3e6,0xbe));var _0x6a3e=function(_0xe97677,_0x238e15){_0xe97677=_0xe97677-0x0;var _0x1eca0d=_0xa3e6[_0xe97677];return _0x1eca0d;};'use strict';var Sequelize=require(_0x6a3e('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a3e('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6a3e('0x1')]},'dialPrefix':{'type':Sequelize[_0x6a3e('0x1')]}}; \ No newline at end of file +var _0xca8d=['STRING','name','sequelize','exports'];(function(_0xb3fed2,_0x286a73){var _0x11692d=function(_0x7d4562){while(--_0x7d4562){_0xb3fed2['push'](_0xb3fed2['shift']());}};_0x11692d(++_0x286a73);}(_0xca8d,0x172));var _0xdca8=function(_0x49c1b0,_0x35b033){_0x49c1b0=_0x49c1b0-0x0;var _0x5be831=_0xca8d[_0x49c1b0];return _0x5be831;};'use strict';var Sequelize=require(_0xdca8('0x0'));module[_0xdca8('0x1')]={'name':{'type':Sequelize[_0xdca8('0x2')],'unique':_0xdca8('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdca8('0x2')]},'dialPrefix':{'type':Sequelize[_0xdca8('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 8052ed5..9065af1 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 _0x275d=['omit','ids','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','hasOwnProperty','raw','getContactsCsv','ContactItemType','findAll','OrderBy','alias','select','from','c.deletedAt\x20is\x20null','field','c.cf_','item','CmContactId\x20=\x20c.id','description','cm_contact_has_items','ItemTypeId\x20=\x20?','toString','each','isEmpty','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','User','getAgents','info','fast-json-patch','request-promise','moment','bluebird','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Lists','UserProfileResource','destroy','stack','name','send','index','CmList','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','sort','filter','removeDispositions','addContacts','CmContact','tags','isArray','join','push'];(function(_0x161ab6,_0x51ee5c){var _0x437d12=function(_0x38002d){while(--_0x38002d){_0x161ab6['push'](_0x161ab6['shift']());}};_0x437d12(++_0x51ee5c);}(_0x275d,0x185));var _0xd275=function(_0x57474e,_0x4178b8){_0x57474e=_0x57474e-0x0;var _0xfaae8c=_0x275d[_0x57474e];return _0xfaae8c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd275('0x0'));var rp=require(_0xd275('0x1'));var moment=require(_0xd275('0x2'));var BPromise=require(_0xd275('0x3'));var Mustache=require('mustache');var util=require(_0xd275('0x4'));var path=require(_0xd275('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd275('0x6'));var squel=require(_0xd275('0x7'));var crypto=require(_0xd275('0x8'));var jsforce=require(_0xd275('0x9'));var deskjs=require(_0xd275('0xa'));var toCsv=require(_0xd275('0xb'));var querystring=require(_0xd275('0xc'));var Papa=require('papaparse');var Redis=require(_0xd275('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd275('0xe'));var hardwareService=require(_0xd275('0xf'));var logger=require(_0xd275('0x10'))(_0xd275('0x11'));var utils=require(_0xd275('0x12'));var config=require(_0xd275('0x13'));var licenseUtil=require(_0xd275('0x14'));var db=require(_0xd275('0x15'))['db'];var csv_results;config[_0xd275('0x16')]=_['defaults'](config[_0xd275('0x16')],{'host':_0xd275('0x17'),'port':0x18eb});var socket=require(_0xd275('0x18'))(new Redis(config[_0xd275('0x16')]));require('./cmList.socket')[_0xd275('0x19')](socket);function respondWithStatusCode(_0x13064b,_0x38915a){_0x38915a=_0x38915a||0xcc;return function(_0x47b809){if(_0x47b809){return _0x13064b[_0xd275('0x1a')](_0x38915a);}return _0x13064b['status'](_0x38915a)[_0xd275('0x1b')]();};}function respondWithResult(_0x19e02c,_0x47db15){_0x47db15=_0x47db15||0xc8;return function(_0x87fb25){if(_0x87fb25){return _0x19e02c[_0xd275('0x1c')](_0x47db15)[_0xd275('0x1d')](_0x87fb25);}};}function respondWithFilteredResult(_0x4e33a1,_0x4a385b){return function(_0x21da11){if(_0x21da11){var _0x1bacb8=typeof _0x4a385b[_0xd275('0x1e')]===_0xd275('0x1f')&&typeof _0x4a385b[_0xd275('0x20')]===_0xd275('0x1f');var _0x1ecd6b=_0x21da11[_0xd275('0x21')];var _0x5dc440=_0x1bacb8?0x0:_0x4a385b[_0xd275('0x1e')];var _0x509be3=_0x1bacb8?_0x21da11['count']:_0x4a385b[_0xd275('0x1e')]+_0x4a385b[_0xd275('0x20')];var _0x4cc752;if(_0x509be3>=_0x1ecd6b){_0x509be3=_0x1ecd6b;_0x4cc752=0xc8;}else{_0x4cc752=0xce;}_0x4e33a1[_0xd275('0x1c')](_0x4cc752);return _0x4e33a1[_0xd275('0x22')](_0xd275('0x23'),_0x5dc440+'-'+_0x509be3+'/'+_0x1ecd6b)[_0xd275('0x1d')](_0x21da11);}return null;};}function patchUpdates(_0x5df8a){return function(_0x5c73ed){try{jsonpatch[_0xd275('0x24')](_0x5c73ed,_0x5df8a,!![]);}catch(_0x86aef7){return BPromise[_0xd275('0x25')](_0x86aef7);}return _0x5c73ed[_0xd275('0x26')]();};}function saveUpdates(_0x23bf82,_0x5d1377){return function(_0x35c352){if(_0x35c352){return _0x35c352[_0xd275('0x27')](_0x23bf82)[_0xd275('0x28')](function(_0xca7b3){return _0xca7b3;});}return null;};}function removeEntity(_0x255f62,_0x1b59b4){return function(_0x18567f){if(_0x18567f){return _0x18567f['destroy']()[_0xd275('0x28')](function(){var _0x4c2897=_0x18567f[_0xd275('0x29')]({'plain':!![]});var _0xa00b6d=_0xd275('0x2a');return db[_0xd275('0x2b')][_0xd275('0x2c')]({'where':{'type':_0xa00b6d,'resourceId':_0x4c2897['id']}})['then'](function(){return _0x18567f;});})[_0xd275('0x28')](function(){_0x255f62[_0xd275('0x1c')](0xcc)[_0xd275('0x1b')]();});}};}function handleEntityNotFound(_0x4987c2,_0x5d1eb1){return function(_0x346c06){if(!_0x346c06){_0x4987c2[_0xd275('0x1a')](0x194);}return _0x346c06;};}function handleError(_0x56a8d9,_0x5668f7){_0x5668f7=_0x5668f7||0x1f4;return function(_0x21ed31){logger['error'](_0x21ed31[_0xd275('0x2d')]);if(_0x21ed31[_0xd275('0x2e')]){delete _0x21ed31[_0xd275('0x2e')];}_0x56a8d9[_0xd275('0x1c')](_0x5668f7)[_0xd275('0x2f')](_0x21ed31);};}exports[_0xd275('0x30')]=function(_0x4d6c3c,_0x670d4e){var _0x4e51b1={},_0x3d1362={},_0x289453={'count':0x0,'rows':[]};var _0x308dc0=_['map'](db[_0xd275('0x31')][_0xd275('0x32')],function(_0x8fd940){return{'name':_0x8fd940[_0xd275('0x33')],'type':_0x8fd940['type'][_0xd275('0x34')]};});_0x3d1362[_0xd275('0x35')]=_[_0xd275('0x36')](_0x308dc0,_0xd275('0x2e'));_0x3d1362[_0xd275('0x37')]=_['keys'](_0x4d6c3c[_0xd275('0x37')]);_0x3d1362[_0xd275('0x38')]=_[_0xd275('0x39')](_0x3d1362['model'],_0x3d1362[_0xd275('0x37')]);_0x4e51b1['attributes']=_[_0xd275('0x39')](_0x3d1362[_0xd275('0x35')],qs[_0xd275('0x3a')](_0x4d6c3c['query']['fields']));_0x4e51b1[_0xd275('0x3b')]=_0x4e51b1[_0xd275('0x3b')][_0xd275('0x3c')]?_0x4e51b1['attributes']:_0x3d1362['model'];if(!_0x4d6c3c[_0xd275('0x37')]['hasOwnProperty'](_0xd275('0x3d'))){_0x4e51b1[_0xd275('0x20')]=qs[_0xd275('0x20')](_0x4d6c3c['query'][_0xd275('0x20')]);_0x4e51b1['offset']=qs[_0xd275('0x1e')](_0x4d6c3c[_0xd275('0x37')][_0xd275('0x1e')]);}_0x4e51b1[_0xd275('0x3e')]=qs['sort'](_0x4d6c3c[_0xd275('0x37')]['sort']);_0x4e51b1[_0xd275('0x3f')]=qs['filters'](_[_0xd275('0x40')](_0x4d6c3c['query'],_0x3d1362[_0xd275('0x38')]),_0x308dc0);if(_0x4d6c3c['query']['filter']){_0x4e51b1['where']=_[_0xd275('0x41')](_0x4e51b1[_0xd275('0x3f')],{'$or':_[_0xd275('0x36')](_0x308dc0,function(_0xae99f7){if(_0xae99f7[_0xd275('0x42')]!==_0xd275('0x43')){var _0x45c69c={};_0x45c69c[_0xae99f7['name']]={'$like':'%'+_0x4d6c3c[_0xd275('0x37')]['filter']+'%'};return _0x45c69c;}})});}_0x4e51b1=_[_0xd275('0x41')]({},_0x4e51b1,_0x4d6c3c[_0xd275('0x44')]);var _0x261c41={'where':_0x4e51b1[_0xd275('0x3f')]};return db['CmList'][_0xd275('0x21')](_0x261c41)[_0xd275('0x28')](function(_0x426fee){_0x289453[_0xd275('0x21')]=_0x426fee;if(_0x4d6c3c[_0xd275('0x37')][_0xd275('0x45')]){_0x4e51b1[_0xd275('0x46')]=[{'all':!![]}];}return db[_0xd275('0x31')]['findAll'](_0x4e51b1);})[_0xd275('0x28')](function(_0x460701){_0x289453[_0xd275('0x47')]=_0x460701;return _0x289453;})[_0xd275('0x28')](respondWithFilteredResult(_0x670d4e,_0x4e51b1))[_0xd275('0x48')](handleError(_0x670d4e,null));};exports[_0xd275('0x49')]=function(_0x38bd68,_0x477fd8){var _0x1e70cf={'raw':![],'where':{'id':_0x38bd68[_0xd275('0x4a')]['id']}},_0x4de4be={};_0x4de4be[_0xd275('0x35')]=_[_0xd275('0x4b')](db[_0xd275('0x31')][_0xd275('0x32')]);_0x4de4be[_0xd275('0x37')]=_[_0xd275('0x4b')](_0x38bd68[_0xd275('0x37')]);_0x4de4be[_0xd275('0x38')]=_[_0xd275('0x39')](_0x4de4be[_0xd275('0x35')],_0x4de4be['query']);_0x1e70cf[_0xd275('0x3b')]=_[_0xd275('0x39')](_0x4de4be[_0xd275('0x35')],qs[_0xd275('0x3a')](_0x38bd68[_0xd275('0x37')][_0xd275('0x3a')]));_0x1e70cf[_0xd275('0x3b')]=_0x1e70cf[_0xd275('0x3b')][_0xd275('0x3c')]?_0x1e70cf['attributes']:_0x4de4be[_0xd275('0x35')];if(_0x38bd68['query'][_0xd275('0x45')]){_0x1e70cf['include']=[{'all':!![]}];}_0x1e70cf=_[_0xd275('0x41')]({},_0x1e70cf,_0x38bd68[_0xd275('0x44')]);return db[_0xd275('0x31')][_0xd275('0x4c')](_0x1e70cf)[_0xd275('0x28')](handleEntityNotFound(_0x477fd8,null))[_0xd275('0x28')](respondWithResult(_0x477fd8,null))[_0xd275('0x48')](handleError(_0x477fd8,null));};exports[_0xd275('0x4d')]=function(_0x33d1ee,_0x5f4042){return db[_0xd275('0x31')][_0xd275('0x4d')](_0x33d1ee[_0xd275('0x4e')],{})['then'](function(_0x49d26f){var _0x55085b=_0x33d1ee[_0xd275('0x4f')][_0xd275('0x29')]({'plain':!![]});if(!_0x55085b)throw new Error(_0xd275('0x50'));if(_0x55085b['role']===_0xd275('0x4f')){var _0x3bb6fe=_0x49d26f[_0xd275('0x29')]({'plain':!![]});var _0x118702='Lists';return db['UserProfileSection'][_0xd275('0x4c')]({'where':{'name':_0x118702,'userProfileId':_0x55085b[_0xd275('0x51')]},'raw':!![]})[_0xd275('0x28')](function(_0x9c37bf){if(_0x9c37bf&&_0x9c37bf[_0xd275('0x52')]===0x0){return db[_0xd275('0x2b')][_0xd275('0x4d')]({'name':_0x3bb6fe[_0xd275('0x2e')],'resourceId':_0x3bb6fe['id'],'type':_0x9c37bf[_0xd275('0x2e')],'sectionId':_0x9c37bf['id']},{})[_0xd275('0x28')](function(){return _0x49d26f;});}else{return _0x49d26f;}})[_0xd275('0x48')](function(_0x1c176f){logger[_0xd275('0x53')](_0xd275('0x54'),_0x1c176f);throw _0x1c176f;});}return _0x49d26f;})[_0xd275('0x28')](respondWithResult(_0x5f4042,0xc9))[_0xd275('0x48')](handleError(_0x5f4042,null));};exports[_0xd275('0x27')]=function(_0x43ac5e,_0x3ed22b){if(_0x43ac5e[_0xd275('0x4e')]['id']){delete _0x43ac5e[_0xd275('0x4e')]['id'];}return db[_0xd275('0x31')][_0xd275('0x4c')]({'where':{'id':_0x43ac5e[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x3ed22b,null))[_0xd275('0x28')](saveUpdates(_0x43ac5e[_0xd275('0x4e')],null))['then'](respondWithResult(_0x3ed22b,null))[_0xd275('0x48')](handleError(_0x3ed22b,null));};exports[_0xd275('0x2c')]=function(_0x47cb9f,_0x3d755d){return db['CmList'][_0xd275('0x4c')]({'where':{'id':_0x47cb9f['params']['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x3d755d,null))[_0xd275('0x28')](removeEntity(_0x3d755d,null))['catch'](handleError(_0x3d755d,null));};exports[_0xd275('0x55')]=function(_0x10e19b,_0x4d8d68){return db[_0xd275('0x31')][_0xd275('0x55')]()[_0xd275('0x28')](respondWithResult(_0x4d8d68,null))['catch'](handleError(_0x4d8d68,null));};exports[_0xd275('0x56')]=function(_0x12c9e3,_0x10f4aa,_0x22b216){if(_0x12c9e3[_0xd275('0x4e')]['id']){delete _0x12c9e3[_0xd275('0x4e')]['id'];}return db[_0xd275('0x31')][_0xd275('0x4c')]({'where':{'id':_0x12c9e3[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x10f4aa,null))[_0xd275('0x28')](function(_0x5e5298){if(_0x5e5298){_0x12c9e3[_0xd275('0x4e')][_0xd275('0x57')]=_0x5e5298['id'];return db[_0xd275('0x58')][_0xd275('0x4d')](_0x12c9e3['body']);}})['then'](respondWithResult(_0x10f4aa,null))['catch'](handleError(_0x10f4aa,null));};exports[_0xd275('0x59')]=function(_0x3c0d7b,_0x4c6eda,_0x2026af){var _0x5bd2ff={'raw':![],'where':{}};var _0x999ad7={};var _0x1cf50f={'count':0x0,'rows':[]};return db[_0xd275('0x31')][_0xd275('0x5a')]({'where':{'id':_0x3c0d7b[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x4c6eda,null))['then'](function(_0x98a95a){if(_0x98a95a){_0x999ad7[_0xd275('0x35')]=_[_0xd275('0x4b')](db['Disposition'][_0xd275('0x32')]);_0x999ad7[_0xd275('0x37')]=_['keys'](_0x3c0d7b['query']);_0x999ad7[_0xd275('0x38')]=_[_0xd275('0x39')](_0x999ad7[_0xd275('0x35')],_0x999ad7[_0xd275('0x37')]);_0x5bd2ff['attributes']=_['intersection'](_0x999ad7[_0xd275('0x35')],qs[_0xd275('0x3a')](_0x3c0d7b[_0xd275('0x37')]['fields']));_0x5bd2ff[_0xd275('0x3b')]=_0x5bd2ff[_0xd275('0x3b')][_0xd275('0x3c')]?_0x5bd2ff[_0xd275('0x3b')]:_0x999ad7[_0xd275('0x35')];if(!_0x3c0d7b[_0xd275('0x37')]['hasOwnProperty'](_0xd275('0x3d'))){_0x5bd2ff[_0xd275('0x20')]=qs[_0xd275('0x20')](_0x3c0d7b[_0xd275('0x37')][_0xd275('0x20')]);_0x5bd2ff[_0xd275('0x1e')]=qs[_0xd275('0x1e')](_0x3c0d7b['query']['offset']);}_0x5bd2ff[_0xd275('0x3e')]=qs[_0xd275('0x5b')](_0x3c0d7b[_0xd275('0x37')][_0xd275('0x5b')]);_0x5bd2ff[_0xd275('0x3f')]=qs['filters'](_['pick'](_0x3c0d7b[_0xd275('0x37')],_0x999ad7[_0xd275('0x38')]));_0x5bd2ff[_0xd275('0x3f')][_0xd275('0x57')]=_0x98a95a['id'];if(_0x3c0d7b[_0xd275('0x37')][_0xd275('0x5c')]){_0x5bd2ff['where']=_['merge'](_0x5bd2ff['where'],{'$or':_[_0xd275('0x36')](_0x5bd2ff[_0xd275('0x3b')],function(_0x4c7111){var _0x1da2e3={};_0x1da2e3[_0x4c7111]={'$like':'%'+_0x3c0d7b[_0xd275('0x37')][_0xd275('0x5c')]+'%'};return _0x1da2e3;})});}_0x5bd2ff=_[_0xd275('0x41')]({},_0x5bd2ff,_0x3c0d7b['options']);return db['Disposition'][_0xd275('0x21')]({'where':_0x5bd2ff[_0xd275('0x3f')]})['then'](function(_0x5cf361){_0x1cf50f['count']=_0x5cf361;if(_0x3c0d7b[_0xd275('0x37')][_0xd275('0x45')]){_0x5bd2ff[_0xd275('0x46')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5bd2ff);})['then'](function(_0x2f94d3){_0x1cf50f[_0xd275('0x47')]=_0x2f94d3;return _0x1cf50f;});}})['then'](respondWithFilteredResult(_0x4c6eda,_0x5bd2ff))[_0xd275('0x48')](handleError(_0x4c6eda,null));};exports[_0xd275('0x5d')]=function(_0x1269cd,_0x178978,_0x2f0b55){return db[_0xd275('0x31')]['find']({'where':{'id':_0x1269cd[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x178978,null))[_0xd275('0x28')](function(_0x7d12cd){if(_0x7d12cd){return _0x7d12cd[_0xd275('0x5d')](_0x1269cd[_0xd275('0x37')]['ids']);}})[_0xd275('0x28')](respondWithStatusCode(_0x178978,null))[_0xd275('0x48')](handleError(_0x178978,null));};exports[_0xd275('0x5e')]=function(_0x37aa71,_0xa086ad,_0x47da51){return db['CmList'][_0xd275('0x4c')]({'where':{'id':_0x37aa71['params']['id']}})[_0xd275('0x28')](handleEntityNotFound(_0xa086ad,null))['then'](function(_0x5a20dc){if(_0x5a20dc){var _0x9e6757=[];var _0x4c906c={'success':[],'errors':[]};return db[_0xd275('0x5f')][_0xd275('0x55')]()['then'](function(_0x259d2e){if(_0x37aa71['body'][_0xd275('0x60')]&&_[_0xd275('0x61')](_0x37aa71[_0xd275('0x4e')][_0xd275('0x60')])){if(_0x37aa71[_0xd275('0x4e')][_0xd275('0x60')]['length']){_0x37aa71[_0xd275('0x4e')][_0xd275('0x60')]=_0x37aa71[_0xd275('0x4e')][_0xd275('0x60')][_0xd275('0x62')](';')+';';}else{_0x37aa71['body']['tags']=null;}}else{_0x37aa71[_0xd275('0x4e')][_0xd275('0x60')]=null;}if(_0x37aa71['body']&&_[_0xd275('0x61')](_0x37aa71[_0xd275('0x4e')])){for(var _0xd91259=0x0;_0xd91259<_0x37aa71[_0xd275('0x4e')][_0xd275('0x3c')];_0xd91259+=0x1){_0x37aa71[_0xd275('0x4e')][_0xd91259][_0xd275('0x57')]=_0x37aa71[_0xd275('0x4a')]['id'];_0x9e6757[_0xd275('0x63')](_0x37aa71[_0xd275('0x4e')][_0xd91259]);}return BPromise['each'](_0x9e6757,function(_0x6e6119){return db['CmContact'][_0xd275('0x4d')](_[_0xd275('0x64')](_0x6e6119,[_0xd275('0x65'),'id'])||{},{'fields':_[_0xd275('0x4b')](_0x259d2e),'raw':!![]})[_0xd275('0x28')](function(_0x1455af){_0x4c906c['success']['push'](_0x1455af[_0xd275('0x66')]);})[_0xd275('0x48')](function(_0x16d2f8){_0x4c906c[_0xd275('0x67')][_0xd275('0x63')]({'data':_0x6e6119,'error':_0x16d2f8[_0xd275('0x68')]});});})['then'](function(_0x9092ec){return _0x4c906c;})[_0xd275('0x48')](function(_0x2a9e73){return _0x2a9e73;});}else{_0xa086ad['status'](0x190)[_0xd275('0x1d')]({'message':_0xd275('0x69')});}});}})[_0xd275('0x28')](respondWithResult(_0xa086ad,null))['catch'](handleError(_0xa086ad,null));};exports[_0xd275('0x6a')]=function(_0x1c0937,_0x28adc9,_0x509800){var _0xc5f321;return db[_0xd275('0x31')][_0xd275('0x4c')]({'where':{'id':_0x1c0937[_0xd275('0x4a')]['id']},'include':[{'model':db[_0xd275('0x6b')],'as':_0xd275('0x6c')}]})[_0xd275('0x28')](handleEntityNotFound(_0x28adc9,null))['then'](function(_0x446c7a){if(_0x446c7a){_0xc5f321=_0x446c7a;return db[_0xd275('0x5f')][_0xd275('0x32')];}})['then'](function(_0x2bdf97){if(_0x2bdf97){var _0x10e12f={};var _0x206d92={};_0x206d92[_0xd275('0x35')]=_[_0xd275('0x6d')](_[_0xd275('0x4b')](_0x2bdf97),_[_0xd275('0x36')](_0xc5f321[_0xd275('0x6c')],function(_0x2dd7df){return util[_0xd275('0x6e')](_0xd275('0x6f'),_0x2dd7df['id']);}));_0x206d92['query']=_[_0xd275('0x4b')](_0x1c0937[_0xd275('0x37')]);_0x206d92[_0xd275('0x38')]=_[_0xd275('0x39')](_0x206d92[_0xd275('0x35')],_0x206d92[_0xd275('0x37')]);_0x10e12f[_0xd275('0x3b')]=_[_0xd275('0x39')](_0x206d92[_0xd275('0x35')],qs[_0xd275('0x3a')](_0x1c0937[_0xd275('0x37')][_0xd275('0x3a')]));_0x10e12f[_0xd275('0x3b')]=_0x10e12f[_0xd275('0x3b')]['length']?_0x10e12f['attributes']:_0x206d92[_0xd275('0x35')];if(!_0x1c0937[_0xd275('0x37')][_0xd275('0x70')]('nolimit')){_0x10e12f[_0xd275('0x20')]=qs[_0xd275('0x20')](_0x1c0937['query'][_0xd275('0x20')]);_0x10e12f['offset']=qs[_0xd275('0x1e')](_0x1c0937[_0xd275('0x37')][_0xd275('0x1e')]);}_0x10e12f[_0xd275('0x3e')]=qs['sort'](_0x1c0937['query']['sort']);_0x10e12f['where']=qs['filters'](_[_0xd275('0x40')](_0x1c0937['query'],_0x206d92[_0xd275('0x38')]));_0x10e12f[_0xd275('0x71')]=!![];if(_0x1c0937[_0xd275('0x37')]['filter']){_0x10e12f[_0xd275('0x3f')]=_[_0xd275('0x41')](_0x10e12f[_0xd275('0x3f')],{'$or':_[_0xd275('0x36')](_0x10e12f['attributes'],function(_0x58087e){var _0x14e436={};_0x14e436[_0x58087e]={'$like':'%'+_0x1c0937[_0xd275('0x37')]['filter']+'%'};return _0x14e436;})});}_0x10e12f=_[_0xd275('0x41')]({},_0x10e12f,_0x1c0937[_0xd275('0x44')]);return _0xc5f321[_0xd275('0x6a')](_0x10e12f);}})[_0xd275('0x28')](respondWithResult(_0x28adc9,null))[_0xd275('0x48')](handleError(_0x28adc9,null));};exports[_0xd275('0x72')]=function(_0x5cf7e0,_0x28c85b,_0x454a87){var _0x4b9b0f;var _0x16daf8;var _0x808d29;var _0x510f65=_0x5cf7e0[_0xd275('0x4a')]['id'];csv_results=[];return db[_0xd275('0x73')][_0xd275('0x74')]({'attributes':['id','name'],'raw':!![],'order':[_0xd275('0x75')]})[_0xd275('0x28')](function(_0x533c37){_0x4b9b0f=_0x533c37;var _0x14b46b=_[_0xd275('0x4b')](db[_0xd275('0x5f')][_0xd275('0x32')]);return db['CmCustomField']['findAll']({'raw':!![],'attributes':['id',_0xd275('0x76')]})[_0xd275('0x28')](function(_0x1753b8){_0x16daf8=_0x1753b8;var _0x1f25b4=squel[_0xd275('0x77')]()[_0xd275('0x3a')](_0x14b46b)[_0xd275('0x78')]('cm_contacts','c')[_0xd275('0x3f')]('c.ListId\x20=\x20?',_0x510f65)['where'](_0xd275('0x79'))['distinct']();for(var _0x2f6da4=0x0;_0x2f6da4<_0x16daf8['length'];_0x2f6da4++){_0x1f25b4[_0xd275('0x7a')](_0xd275('0x7b')+_0x16daf8[_0x2f6da4]['id'],'customField_'+_0x16daf8[_0x2f6da4]['alias']);}for(var _0x2f6da4=0x0;_0x2f6da4<_0x4b9b0f[_0xd275('0x3c')];_0x2f6da4++){_0x1f25b4[_0xd275('0x7a')](squel['select']()[_0xd275('0x7a')](_0xd275('0x7c'))[_0xd275('0x78')]('cm_contact_has_items')['where']('ItemTypeId\x20=\x20?',_0x4b9b0f[_0x2f6da4]['id'])[_0xd275('0x3f')](_0xd275('0x7d')),'additionalPhone_'+_0x4b9b0f[_0x2f6da4][_0xd275('0x2e')]);_0x1f25b4[_0xd275('0x7a')](squel['select']()['field'](_0xd275('0x7e'))[_0xd275('0x78')](_0xd275('0x7f'))['where'](_0xd275('0x80'),_0x4b9b0f[_0x2f6da4]['id'])[_0xd275('0x3f')](_0xd275('0x7d')),'description_additionalPhone_'+_0x4b9b0f[_0x2f6da4]['name']);}var _0x27fb77=[];_0x27fb77[_0xd275('0x63')](_0x1f25b4[_0xd275('0x81')]());BPromise[_0xd275('0x82')](_0x27fb77,handleQuery)[_0xd275('0x28')](function(_0x45e3cc){handleQuery(_0x1f25b4[_0xd275('0x81')]());var _0x401271=csv_results[0x0];if(!_[_0xd275('0x83')](_0x401271)){var _0x582b06=toCsv(_0x401271);var _0x317631=Date['now']();fs[_0xd275('0x84')](util['format']('/tmp/list_%d_%s.csv',_0x510f65,_0x317631),_0x582b06);_0x28c85b[_0xd275('0x85')](_0xd275('0x86'),_0xd275('0x87')+util[_0xd275('0x6e')](_0xd275('0x88'),_0x510f65,_0x317631));_0x28c85b['setHeader']('Content-type',_0xd275('0x89'));return _0x28c85b[_0xd275('0x8a')](util[_0xd275('0x6e')](_0xd275('0x8b'),_0x510f65,_0x317631));}else{return _0x28c85b[_0xd275('0x1a')](0xcc);}});});});};exports[_0xd275('0x8c')]=function(_0x41ad12,_0x3513c0,_0x4e6f3b){var _0x5db81e;delete _0x41ad12[_0xd275('0x4e')]['id'];return db[_0xd275('0x31')][_0xd275('0x5a')]({'where':{'id':_0x41ad12['params']['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x3513c0,null))[_0xd275('0x28')](function(_0xfcaf4d){if(_0xfcaf4d){return db[_0xd275('0x8d')]['transaction'](function(_0x34722b){return db[_0xd275('0x6b')][_0xd275('0x4d')](_0x41ad12[_0xd275('0x4e')],{'transaction':_0x34722b})[_0xd275('0x28')](function(_0x40c499){_0x5db81e=_0x40c499;return _0xfcaf4d['addCustomFields'](_0x40c499,{'transaction':_0x34722b});})[_0xd275('0x28')](function(){var _0x2c692e={'type':db[_0xd275('0x8e')][_0xd275('0x8f')],'transaction':_0x34722b};switch(_0x41ad12['body'][_0xd275('0x42')]){case _0xd275('0x90'):_0x2c692e[_0xd275('0x42')]=db[_0xd275('0x8e')]['TEXT'];break;case _0xd275('0x91'):_0x2c692e['type']=db[_0xd275('0x8e')][_0xd275('0x92')];break;case _0xd275('0x93'):_0x2c692e[_0xd275('0x42')]=db[_0xd275('0x8e')][_0xd275('0x94')];_0x2c692e[_0xd275('0x95')]=![];break;default:}return db[_0xd275('0x8d')]['queryInterface'][_0xd275('0x96')](_0xd275('0x97'),util[_0xd275('0x6e')](_0xd275('0x98'),_0x5db81e['id']),_0x2c692e);})[_0xd275('0x28')](function(){return _0x5db81e;});});}})[_0xd275('0x28')](respondWithResult(_0x3513c0,null))[_0xd275('0x48')](handleError(_0x3513c0,null));};exports[_0xd275('0x99')]=function(_0xeb128,_0x467b50,_0x5b3038){var _0x253163={};var _0xf76f97={};var _0x486218;var _0x1f183e;return db[_0xd275('0x31')][_0xd275('0x5a')]({'where':{'id':_0xeb128[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x467b50,null))[_0xd275('0x28')](function(_0x5f32ff){if(_0x5f32ff){_0x486218=_0x5f32ff;_0xf76f97['model']=_[_0xd275('0x4b')](db['CmCustomField'][_0xd275('0x32')]);_0xf76f97[_0xd275('0x37')]=_[_0xd275('0x4b')](_0xeb128[_0xd275('0x37')]);_0xf76f97[_0xd275('0x38')]=_['intersection'](_0xf76f97[_0xd275('0x35')],_0xf76f97[_0xd275('0x37')]);_0x253163['attributes']=_[_0xd275('0x39')](_0xf76f97['model'],qs['fields'](_0xeb128[_0xd275('0x37')][_0xd275('0x3a')]));_0x253163[_0xd275('0x3b')]=_0x253163[_0xd275('0x3b')][_0xd275('0x3c')]?_0x253163['attributes']:_0xf76f97['model'];_0x253163[_0xd275('0x3e')]=qs[_0xd275('0x5b')](_0xeb128[_0xd275('0x37')][_0xd275('0x5b')]);_0x253163[_0xd275('0x3f')]=qs[_0xd275('0x38')](_[_0xd275('0x40')](_0xeb128[_0xd275('0x37')],_0xf76f97[_0xd275('0x38')]));_0x253163['where']=_[_0xd275('0x41')](_0x253163['where'],{'$or':[{'ListId':_0x5f32ff['id']},{'ListId':null}]});if(_0xeb128[_0xd275('0x37')][_0xd275('0x5c')]){_0x253163[_0xd275('0x3f')]=_[_0xd275('0x41')](_0x253163[_0xd275('0x3f')],{'$or':_['map'](_0x253163['attributes'],function(_0x5b514c){var _0x55af74={};_0x55af74[_0x5b514c]={'$like':'%'+_0xeb128[_0xd275('0x37')][_0xd275('0x5c')]+'%'};return _0x55af74;})});}_0x253163=_[_0xd275('0x41')]({},_0x253163,_0xeb128[_0xd275('0x44')]);return db[_0xd275('0x6b')][_0xd275('0x9a')](_0x253163);}})[_0xd275('0x28')](respondWithResult(_0x467b50,null))[_0xd275('0x48')](handleError(_0x467b50,null));};exports['getGlobalCustomFields']=function(_0x27ebab,_0x4c54c2){return db[_0xd275('0x6b')]['findAndCountAll']({'where':{'ListId':null}})[_0xd275('0x28')](handleEntityNotFound(_0x4c54c2,null))[_0xd275('0x28')](function(_0x2b1704){return _0x2b1704;})['then'](respondWithResult(_0x4c54c2,null))['catch'](handleError(_0x4c54c2,null));};exports[_0xd275('0x9b')]=function(_0x3ec558,_0x47f3e0,_0x23dd2b){return db[_0xd275('0x31')][_0xd275('0x4c')]({'where':{'id':_0x3ec558[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x47f3e0,null))['then'](function(_0x200260){if(_0x200260){return _0x200260[_0xd275('0x9b')](_0x3ec558[_0xd275('0x4e')][_0xd275('0x65')],_['omit'](_0x3ec558[_0xd275('0x4e')],[_0xd275('0x65'),'id'])||{})[_0xd275('0x9c')](function(_0x455c4d){for(var _0x254c6c=0x0;_0x254c6c<_0x3ec558['body'][_0xd275('0x65')][_0xd275('0x3c')];_0x254c6c+=0x1){socket[_0xd275('0x9d')]('userCmList:save',{'UserId':Number(_0x3ec558['body'][_0xd275('0x65')][_0x254c6c]),'CmListId':Number(_0x3ec558[_0xd275('0x4a')]['id'])});}return _0x455c4d;});}})['then'](respondWithResult(_0x47f3e0,null))['catch'](handleError(_0x47f3e0,null));};exports[_0xd275('0x9e')]=function(_0x5c5536,_0x167f78,_0x58de2f){return db[_0xd275('0x31')]['find']({'where':{'id':_0x5c5536[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x167f78,null))['then'](function(_0x4ee759){if(_0x4ee759){return _0x4ee759['removeAgents'](_0x5c5536[_0xd275('0x37')][_0xd275('0x65')])['then'](function(){if(_[_0xd275('0x61')](_0x5c5536['query']['ids'])){for(var _0x5f4ea7=0x0;_0x5f4ea7<_0x5c5536[_0xd275('0x37')][_0xd275('0x65')][_0xd275('0x3c')];_0x5f4ea7+=0x1){socket[_0xd275('0x9d')]('userCmList:remove',{'UserId':Number(_0x5c5536['query'][_0xd275('0x65')][_0x5f4ea7]),'CmListId':Number(_0x5c5536[_0xd275('0x4a')]['id'])});}}else{socket[_0xd275('0x9d')](_0xd275('0x9f'),{'UserId':Number(_0x5c5536[_0xd275('0x37')][_0xd275('0x65')]),'CmListId':Number(_0x5c5536[_0xd275('0x4a')]['id'])});}});}})[_0xd275('0x28')](respondWithStatusCode(_0x167f78,null))[_0xd275('0x48')](handleError(_0x167f78,null));};exports['getAgents']=function(_0x47b6df,_0x564bbf,_0x195d75){var _0x5e98b3={};var _0x58650e={};var _0x4aab3b;var _0x3f08eb;return db['CmList']['findOne']({'where':{'id':_0x47b6df[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x564bbf,null))['then'](function(_0x2f68b3){if(_0x2f68b3){_0x4aab3b=_0x2f68b3;_0x58650e[_0xd275('0x35')]=_[_0xd275('0x4b')](db[_0xd275('0xa0')][_0xd275('0x32')]);_0x58650e[_0xd275('0x37')]=_[_0xd275('0x4b')](_0x47b6df['query']);_0x58650e[_0xd275('0x38')]=_[_0xd275('0x39')](_0x58650e[_0xd275('0x35')],_0x58650e['query']);_0x5e98b3['attributes']=_[_0xd275('0x39')](_0x58650e['model'],qs['fields'](_0x47b6df[_0xd275('0x37')][_0xd275('0x3a')]));_0x5e98b3[_0xd275('0x3b')]=_0x5e98b3[_0xd275('0x3b')][_0xd275('0x3c')]?_0x5e98b3['attributes']:_0x58650e['model'];_0x5e98b3[_0xd275('0x3e')]=qs[_0xd275('0x5b')](_0x47b6df[_0xd275('0x37')]['sort']);_0x5e98b3[_0xd275('0x3f')]=qs[_0xd275('0x38')](_[_0xd275('0x40')](_0x47b6df[_0xd275('0x37')],_0x58650e['filters']));if(_0x47b6df[_0xd275('0x37')][_0xd275('0x5c')]){_0x5e98b3['where']=_[_0xd275('0x41')](_0x5e98b3[_0xd275('0x3f')],{'$or':_[_0xd275('0x36')](_0x5e98b3[_0xd275('0x3b')],function(_0x30aec3){var _0xd2a737={};_0xd2a737[_0x30aec3]={'$like':'%'+_0x47b6df['query']['filter']+'%'};return _0xd2a737;})});}_0x5e98b3=_['merge']({},_0x5e98b3,_0x47b6df['options']);return _0x4aab3b[_0xd275('0xa1')](_0x5e98b3);}})[_0xd275('0x28')](function(_0x31583b){if(_0x31583b){_0x3f08eb=_0x31583b[_0xd275('0x3c')];if(!_0x47b6df[_0xd275('0x37')][_0xd275('0x70')]('nolimit')){_0x5e98b3['limit']=qs['limit'](_0x47b6df['query'][_0xd275('0x20')]);_0x5e98b3[_0xd275('0x1e')]=qs[_0xd275('0x1e')](_0x47b6df[_0xd275('0x37')][_0xd275('0x1e')]);}return _0x4aab3b['getAgents'](_0x5e98b3);}})[_0xd275('0x28')](function(_0x107f78){if(_0x107f78){return _0x107f78?{'count':_0x3f08eb,'rows':_0x107f78}:null;}})[_0xd275('0x28')](respondWithResult(_0x564bbf,null))[_0xd275('0x48')](handleError(_0x564bbf,null));};function handleQuery(_0x2042c3){logger[_0xd275('0xa2')](_0x2042c3);return db[_0xd275('0x8d')][_0xd275('0x37')](_0x2042c3)[_0xd275('0x9c')](function(_0xa7933){csv_results[_0xd275('0x63')](_0xa7933);})[_0xd275('0x48')](function(_0x33641d){logger[_0xd275('0x53')](_0x33641d[_0xd275('0x68')]);});} \ No newline at end of file +var _0x0448=['getDispositions','Disposition','length','removeDispositions','ids','addContacts','isArray','tags','join','CmContact','success','push','dataValues','message','json','Malformed\x20request\x20syntax','CmCustomField','format','raw','getContacts','OrderBy','alias','select','from','cm_contacts','c.deletedAt\x20is\x20null','distinct','field','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','each','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','type','text','Sequelize','TEXT','number','INTEGER','switch','queryInterface','addColumn','cf_%s','getCustomFields','findOne','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','info','eml-format','rimraf','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','offset','limit','count','Content-Range','apply','then','Lists','destroy','stack','name','send','index','map','CmList','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','ListId'];(function(_0x2cd31d,_0x4bfbb9){var _0x312155=function(_0x3f9e83){while(--_0x3f9e83){_0x2cd31d['push'](_0x2cd31d['shift']());}};_0x312155(++_0x4bfbb9);}(_0x0448,0xea));var _0x8044=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x0448[_0x44d9ab];return _0x31485e;};'use strict';var emlformat=require(_0x8044('0x0'));var rimraf=require(_0x8044('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8044('0x2'));var rp=require('request-promise');var moment=require(_0x8044('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8044('0x4'));var sox=require(_0x8044('0x5'));var csv=require(_0x8044('0x6'));var ejs=require(_0x8044('0x7'));var fs=require('fs');var fs_extra=require(_0x8044('0x8'));var _=require(_0x8044('0x9'));var squel=require(_0x8044('0xa'));var crypto=require(_0x8044('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8044('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8044('0xd'));var Redis=require(_0x8044('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8044('0xf'));var as=require(_0x8044('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8044('0x11'));var config=require(_0x8044('0x12'));var licenseUtil=require(_0x8044('0x13'));var db=require(_0x8044('0x14'))['db'];var csv_results;config[_0x8044('0x15')]=_[_0x8044('0x16')](config['redis'],{'host':_0x8044('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8044('0x15')]));require('./cmList.socket')[_0x8044('0x18')](socket);function respondWithStatusCode(_0x370515,_0x3e292a){_0x3e292a=_0x3e292a||0xcc;return function(_0x15249c){if(_0x15249c){return _0x370515[_0x8044('0x19')](_0x3e292a);}return _0x370515[_0x8044('0x1a')](_0x3e292a)[_0x8044('0x1b')]();};}function respondWithResult(_0x1fac59,_0x2941bb){_0x2941bb=_0x2941bb||0xc8;return function(_0x650f16){if(_0x650f16){return _0x1fac59['status'](_0x2941bb)['json'](_0x650f16);}};}function respondWithFilteredResult(_0x1b6a60,_0x206e30){return function(_0x48744f){if(_0x48744f){var _0x320dbc=typeof _0x206e30[_0x8044('0x1c')]==='undefined'&&typeof _0x206e30[_0x8044('0x1d')]==='undefined';var _0x5ab85d=_0x48744f[_0x8044('0x1e')];var _0x2d4d52=_0x320dbc?0x0:_0x206e30[_0x8044('0x1c')];var _0x1c4d7b=_0x320dbc?_0x48744f['count']:_0x206e30[_0x8044('0x1c')]+_0x206e30[_0x8044('0x1d')];var _0x13381a;if(_0x1c4d7b>=_0x5ab85d){_0x1c4d7b=_0x5ab85d;_0x13381a=0xc8;}else{_0x13381a=0xce;}_0x1b6a60[_0x8044('0x1a')](_0x13381a);return _0x1b6a60['set'](_0x8044('0x1f'),_0x2d4d52+'-'+_0x1c4d7b+'/'+_0x5ab85d)['json'](_0x48744f);}return null;};}function patchUpdates(_0x3cfb59){return function(_0x36fe75){try{jsonpatch[_0x8044('0x20')](_0x36fe75,_0x3cfb59,!![]);}catch(_0x116579){return BPromise['reject'](_0x116579);}return _0x36fe75['save']();};}function saveUpdates(_0x42bc28,_0x24cfa1){return function(_0x5dd172){if(_0x5dd172){return _0x5dd172['update'](_0x42bc28)[_0x8044('0x21')](function(_0x260bd7){return _0x260bd7;});}return null;};}function removeEntity(_0x56112b,_0x1de41d){return function(_0x53b140){if(_0x53b140){return _0x53b140['destroy']()['then'](function(){var _0x39ff4a=_0x53b140['get']({'plain':!![]});var _0x3d0efb=_0x8044('0x22');return db['UserProfileResource'][_0x8044('0x23')]({'where':{'type':_0x3d0efb,'resourceId':_0x39ff4a['id']}})[_0x8044('0x21')](function(){return _0x53b140;});})[_0x8044('0x21')](function(){_0x56112b[_0x8044('0x1a')](0xcc)[_0x8044('0x1b')]();});}};}function handleEntityNotFound(_0x51ee00,_0x3a9172){return function(_0x50ce1a){if(!_0x50ce1a){_0x51ee00[_0x8044('0x19')](0x194);}return _0x50ce1a;};}function handleError(_0x4ce4a0,_0x21fcf2){_0x21fcf2=_0x21fcf2||0x1f4;return function(_0x3a65be){logger['error'](_0x3a65be[_0x8044('0x24')]);if(_0x3a65be['name']){delete _0x3a65be[_0x8044('0x25')];}_0x4ce4a0[_0x8044('0x1a')](_0x21fcf2)[_0x8044('0x26')](_0x3a65be);};}exports[_0x8044('0x27')]=function(_0xaa30b7,_0x44e550){var _0x3c8056={},_0x1aaf55={},_0x112bf2={'count':0x0,'rows':[]};var _0x370dbf=_[_0x8044('0x28')](db[_0x8044('0x29')][_0x8044('0x2a')],function(_0xfe0189){return{'name':_0xfe0189[_0x8044('0x2b')],'type':_0xfe0189['type'][_0x8044('0x2c')]};});_0x1aaf55[_0x8044('0x2d')]=_[_0x8044('0x28')](_0x370dbf,_0x8044('0x25'));_0x1aaf55[_0x8044('0x2e')]=_[_0x8044('0x2f')](_0xaa30b7[_0x8044('0x2e')]);_0x1aaf55[_0x8044('0x30')]=_[_0x8044('0x31')](_0x1aaf55['model'],_0x1aaf55[_0x8044('0x2e')]);_0x3c8056['attributes']=_[_0x8044('0x31')](_0x1aaf55[_0x8044('0x2d')],qs[_0x8044('0x32')](_0xaa30b7['query']['fields']));_0x3c8056['attributes']=_0x3c8056['attributes']['length']?_0x3c8056[_0x8044('0x33')]:_0x1aaf55[_0x8044('0x2d')];if(!_0xaa30b7['query'][_0x8044('0x34')](_0x8044('0x35'))){_0x3c8056[_0x8044('0x1d')]=qs[_0x8044('0x1d')](_0xaa30b7[_0x8044('0x2e')]['limit']);_0x3c8056[_0x8044('0x1c')]=qs['offset'](_0xaa30b7['query'][_0x8044('0x1c')]);}_0x3c8056[_0x8044('0x36')]=qs[_0x8044('0x37')](_0xaa30b7['query'][_0x8044('0x37')]);_0x3c8056['where']=qs[_0x8044('0x30')](_[_0x8044('0x38')](_0xaa30b7[_0x8044('0x2e')],_0x1aaf55[_0x8044('0x30')]),_0x370dbf);if(_0xaa30b7[_0x8044('0x2e')][_0x8044('0x39')]){_0x3c8056[_0x8044('0x3a')]=_[_0x8044('0x3b')](_0x3c8056[_0x8044('0x3a')],{'$or':_[_0x8044('0x28')](_0x370dbf,function(_0x3b0609){if(_0x3b0609['type']!==_0x8044('0x3c')){var _0xfb2d={};_0xfb2d[_0x3b0609[_0x8044('0x25')]]={'$like':'%'+_0xaa30b7['query'][_0x8044('0x39')]+'%'};return _0xfb2d;}})});}_0x3c8056=_[_0x8044('0x3b')]({},_0x3c8056,_0xaa30b7[_0x8044('0x3d')]);var _0x26d81c={'where':_0x3c8056[_0x8044('0x3a')]};return db['CmList'][_0x8044('0x1e')](_0x26d81c)[_0x8044('0x21')](function(_0x296c24){_0x112bf2[_0x8044('0x1e')]=_0x296c24;if(_0xaa30b7[_0x8044('0x2e')][_0x8044('0x3e')]){_0x3c8056[_0x8044('0x3f')]=[{'all':!![]}];}return db[_0x8044('0x29')][_0x8044('0x40')](_0x3c8056);})['then'](function(_0x1e2d56){_0x112bf2[_0x8044('0x41')]=_0x1e2d56;return _0x112bf2;})[_0x8044('0x21')](respondWithFilteredResult(_0x44e550,_0x3c8056))[_0x8044('0x42')](handleError(_0x44e550,null));};exports['show']=function(_0x31f647,_0x269d8f){var _0x3505c6={'raw':![],'where':{'id':_0x31f647['params']['id']}},_0x29c55e={};_0x29c55e[_0x8044('0x2d')]=_[_0x8044('0x2f')](db[_0x8044('0x29')][_0x8044('0x2a')]);_0x29c55e[_0x8044('0x2e')]=_[_0x8044('0x2f')](_0x31f647[_0x8044('0x2e')]);_0x29c55e[_0x8044('0x30')]=_['intersection'](_0x29c55e[_0x8044('0x2d')],_0x29c55e[_0x8044('0x2e')]);_0x3505c6[_0x8044('0x33')]=_['intersection'](_0x29c55e[_0x8044('0x2d')],qs[_0x8044('0x32')](_0x31f647['query'][_0x8044('0x32')]));_0x3505c6[_0x8044('0x33')]=_0x3505c6[_0x8044('0x33')]['length']?_0x3505c6[_0x8044('0x33')]:_0x29c55e['model'];if(_0x31f647[_0x8044('0x2e')][_0x8044('0x3e')]){_0x3505c6['include']=[{'all':!![]}];}_0x3505c6=_[_0x8044('0x3b')]({},_0x3505c6,_0x31f647[_0x8044('0x3d')]);return db[_0x8044('0x29')]['find'](_0x3505c6)[_0x8044('0x21')](handleEntityNotFound(_0x269d8f,null))['then'](respondWithResult(_0x269d8f,null))['catch'](handleError(_0x269d8f,null));};exports[_0x8044('0x43')]=function(_0x549e0f,_0x43cb56){return db[_0x8044('0x29')]['create'](_0x549e0f[_0x8044('0x44')],{})['then'](function(_0x3ad9dd){var _0x21748a=_0x549e0f[_0x8044('0x45')]['get']({'plain':!![]});if(!_0x21748a)throw new Error(_0x8044('0x46'));if(_0x21748a['role']===_0x8044('0x45')){var _0xfca89=_0x3ad9dd[_0x8044('0x47')]({'plain':!![]});var _0x186b8d='Lists';return db[_0x8044('0x48')][_0x8044('0x49')]({'where':{'name':_0x186b8d,'userProfileId':_0x21748a[_0x8044('0x4a')]},'raw':!![]})[_0x8044('0x21')](function(_0xb61f5d){if(_0xb61f5d&&_0xb61f5d[_0x8044('0x4b')]===0x0){return db[_0x8044('0x4c')][_0x8044('0x43')]({'name':_0xfca89[_0x8044('0x25')],'resourceId':_0xfca89['id'],'type':_0xb61f5d[_0x8044('0x25')],'sectionId':_0xb61f5d['id']},{})['then'](function(){return _0x3ad9dd;});}else{return _0x3ad9dd;}})[_0x8044('0x42')](function(_0x34bc25){logger[_0x8044('0x4d')](_0x8044('0x4e'),_0x34bc25);throw _0x34bc25;});}return _0x3ad9dd;})[_0x8044('0x21')](respondWithResult(_0x43cb56,0xc9))[_0x8044('0x42')](handleError(_0x43cb56,null));};exports[_0x8044('0x4f')]=function(_0x476097,_0x30a846){if(_0x476097[_0x8044('0x44')]['id']){delete _0x476097[_0x8044('0x44')]['id'];}return db[_0x8044('0x29')][_0x8044('0x49')]({'where':{'id':_0x476097[_0x8044('0x50')]['id']}})[_0x8044('0x21')](handleEntityNotFound(_0x30a846,null))[_0x8044('0x21')](saveUpdates(_0x476097[_0x8044('0x44')],null))[_0x8044('0x21')](respondWithResult(_0x30a846,null))['catch'](handleError(_0x30a846,null));};exports[_0x8044('0x23')]=function(_0x1c8a8d,_0x4cd1db){return db['CmList'][_0x8044('0x49')]({'where':{'id':_0x1c8a8d[_0x8044('0x50')]['id']}})[_0x8044('0x21')](handleEntityNotFound(_0x4cd1db,null))['then'](removeEntity(_0x4cd1db,null))[_0x8044('0x42')](handleError(_0x4cd1db,null));};exports[_0x8044('0x51')]=function(_0xbb3e22,_0xd3bc9c){return db[_0x8044('0x29')][_0x8044('0x51')]()[_0x8044('0x21')](respondWithResult(_0xd3bc9c,null))[_0x8044('0x42')](handleError(_0xd3bc9c,null));};exports[_0x8044('0x52')]=function(_0x303f00,_0x33f7b4,_0x22decd){if(_0x303f00[_0x8044('0x44')]['id']){delete _0x303f00[_0x8044('0x44')]['id'];}return db[_0x8044('0x29')][_0x8044('0x49')]({'where':{'id':_0x303f00[_0x8044('0x50')]['id']}})[_0x8044('0x21')](handleEntityNotFound(_0x33f7b4,null))[_0x8044('0x21')](function(_0x8442ce){if(_0x8442ce){_0x303f00['body'][_0x8044('0x53')]=_0x8442ce['id'];return db['Disposition'][_0x8044('0x43')](_0x303f00['body']);}})[_0x8044('0x21')](respondWithResult(_0x33f7b4,null))[_0x8044('0x42')](handleError(_0x33f7b4,null));};exports[_0x8044('0x54')]=function(_0x11a559,_0x202ebc,_0x17cae4){var _0x2c466a={'raw':![],'where':{}};var _0x36535a={};var _0x24b6a4={'count':0x0,'rows':[]};return db[_0x8044('0x29')]['findOne']({'where':{'id':_0x11a559[_0x8044('0x50')]['id']}})[_0x8044('0x21')](handleEntityNotFound(_0x202ebc,null))[_0x8044('0x21')](function(_0x294caa){if(_0x294caa){_0x36535a[_0x8044('0x2d')]=_[_0x8044('0x2f')](db[_0x8044('0x55')][_0x8044('0x2a')]);_0x36535a[_0x8044('0x2e')]=_[_0x8044('0x2f')](_0x11a559['query']);_0x36535a[_0x8044('0x30')]=_['intersection'](_0x36535a[_0x8044('0x2d')],_0x36535a['query']);_0x2c466a[_0x8044('0x33')]=_[_0x8044('0x31')](_0x36535a['model'],qs[_0x8044('0x32')](_0x11a559[_0x8044('0x2e')][_0x8044('0x32')]));_0x2c466a[_0x8044('0x33')]=_0x2c466a['attributes'][_0x8044('0x56')]?_0x2c466a['attributes']:_0x36535a[_0x8044('0x2d')];if(!_0x11a559[_0x8044('0x2e')][_0x8044('0x34')](_0x8044('0x35'))){_0x2c466a['limit']=qs['limit'](_0x11a559[_0x8044('0x2e')]['limit']);_0x2c466a[_0x8044('0x1c')]=qs[_0x8044('0x1c')](_0x11a559[_0x8044('0x2e')][_0x8044('0x1c')]);}_0x2c466a[_0x8044('0x36')]=qs[_0x8044('0x37')](_0x11a559[_0x8044('0x2e')][_0x8044('0x37')]);_0x2c466a['where']=qs[_0x8044('0x30')](_['pick'](_0x11a559['query'],_0x36535a['filters']));_0x2c466a[_0x8044('0x3a')][_0x8044('0x53')]=_0x294caa['id'];if(_0x11a559[_0x8044('0x2e')]['filter']){_0x2c466a[_0x8044('0x3a')]=_[_0x8044('0x3b')](_0x2c466a[_0x8044('0x3a')],{'$or':_['map'](_0x2c466a[_0x8044('0x33')],function(_0x37ee07){var _0x8f8807={};_0x8f8807[_0x37ee07]={'$like':'%'+_0x11a559['query'][_0x8044('0x39')]+'%'};return _0x8f8807;})});}_0x2c466a=_[_0x8044('0x3b')]({},_0x2c466a,_0x11a559[_0x8044('0x3d')]);return db[_0x8044('0x55')][_0x8044('0x1e')]({'where':_0x2c466a[_0x8044('0x3a')]})[_0x8044('0x21')](function(_0x821553){_0x24b6a4[_0x8044('0x1e')]=_0x821553;if(_0x11a559['query'][_0x8044('0x3e')]){_0x2c466a['include']=[{'all':!![]}];}return db['Disposition'][_0x8044('0x40')](_0x2c466a);})['then'](function(_0x4f80ea){_0x24b6a4[_0x8044('0x41')]=_0x4f80ea;return _0x24b6a4;});}})[_0x8044('0x21')](respondWithFilteredResult(_0x202ebc,_0x2c466a))[_0x8044('0x42')](handleError(_0x202ebc,null));};exports[_0x8044('0x57')]=function(_0x2bd2c0,_0x4c1b1b,_0x175d7c){return db[_0x8044('0x29')][_0x8044('0x49')]({'where':{'id':_0x2bd2c0[_0x8044('0x50')]['id']}})['then'](handleEntityNotFound(_0x4c1b1b,null))[_0x8044('0x21')](function(_0x10a513){if(_0x10a513){return _0x10a513[_0x8044('0x57')](_0x2bd2c0['query'][_0x8044('0x58')]);}})[_0x8044('0x21')](respondWithStatusCode(_0x4c1b1b,null))[_0x8044('0x42')](handleError(_0x4c1b1b,null));};exports[_0x8044('0x59')]=function(_0x1e4efa,_0x3e168d,_0x2456a1){return db[_0x8044('0x29')][_0x8044('0x49')]({'where':{'id':_0x1e4efa[_0x8044('0x50')]['id']}})[_0x8044('0x21')](handleEntityNotFound(_0x3e168d,null))[_0x8044('0x21')](function(_0x17d8f4){if(_0x17d8f4){var _0x5cb1cf=[];var _0x177062={'success':[],'errors':[]};return db['CmContact'][_0x8044('0x51')]()[_0x8044('0x21')](function(_0x52ae08){if(_0x1e4efa[_0x8044('0x44')]['tags']&&_[_0x8044('0x5a')](_0x1e4efa['body'][_0x8044('0x5b')])){if(_0x1e4efa[_0x8044('0x44')]['tags']['length']){_0x1e4efa[_0x8044('0x44')][_0x8044('0x5b')]=_0x1e4efa[_0x8044('0x44')][_0x8044('0x5b')][_0x8044('0x5c')](';')+';';}else{_0x1e4efa['body']['tags']=null;}}else{_0x1e4efa[_0x8044('0x44')][_0x8044('0x5b')]=null;}if(_0x1e4efa[_0x8044('0x44')]&&_['isArray'](_0x1e4efa['body'])){for(var _0x8c0b45=0x0;_0x8c0b45<_0x1e4efa[_0x8044('0x44')][_0x8044('0x56')];_0x8c0b45+=0x1){_0x1e4efa['body'][_0x8c0b45][_0x8044('0x53')]=_0x1e4efa[_0x8044('0x50')]['id'];_0x5cb1cf['push'](_0x1e4efa[_0x8044('0x44')][_0x8c0b45]);}return BPromise['each'](_0x5cb1cf,function(_0x187843){return db[_0x8044('0x5d')]['create'](_['omit'](_0x187843,[_0x8044('0x58'),'id'])||{},{'fields':_[_0x8044('0x2f')](_0x52ae08),'raw':!![]})[_0x8044('0x21')](function(_0x56ac42){_0x177062[_0x8044('0x5e')][_0x8044('0x5f')](_0x56ac42[_0x8044('0x60')]);})[_0x8044('0x42')](function(_0x1ff503){_0x177062['errors'][_0x8044('0x5f')]({'data':_0x187843,'error':_0x1ff503[_0x8044('0x61')]});});})['then'](function(_0x2f9974){return _0x177062;})[_0x8044('0x42')](function(_0x49c664){return _0x49c664;});}else{_0x3e168d[_0x8044('0x1a')](0x190)[_0x8044('0x62')]({'message':_0x8044('0x63')});}});}})[_0x8044('0x21')](respondWithResult(_0x3e168d,null))['catch'](handleError(_0x3e168d,null));};exports['getContacts']=function(_0x3ae6c7,_0x45a070,_0xcda78c){var _0x27b176;return db[_0x8044('0x29')][_0x8044('0x49')]({'where':{'id':_0x3ae6c7[_0x8044('0x50')]['id']},'include':[{'model':db[_0x8044('0x64')],'as':'CustomFields'}]})[_0x8044('0x21')](handleEntityNotFound(_0x45a070,null))[_0x8044('0x21')](function(_0x287238){if(_0x287238){_0x27b176=_0x287238;return db[_0x8044('0x5d')][_0x8044('0x2a')];}})[_0x8044('0x21')](function(_0x11da28){if(_0x11da28){var _0x3de286={};var _0x408bbc={};_0x408bbc[_0x8044('0x2d')]=_['concat'](_['keys'](_0x11da28),_[_0x8044('0x28')](_0x27b176['CustomFields'],function(_0x1f8f83){return util[_0x8044('0x65')]('cf_%d',_0x1f8f83['id']);}));_0x408bbc[_0x8044('0x2e')]=_['keys'](_0x3ae6c7['query']);_0x408bbc[_0x8044('0x30')]=_[_0x8044('0x31')](_0x408bbc[_0x8044('0x2d')],_0x408bbc[_0x8044('0x2e')]);_0x3de286[_0x8044('0x33')]=_[_0x8044('0x31')](_0x408bbc[_0x8044('0x2d')],qs[_0x8044('0x32')](_0x3ae6c7[_0x8044('0x2e')][_0x8044('0x32')]));_0x3de286[_0x8044('0x33')]=_0x3de286[_0x8044('0x33')]['length']?_0x3de286[_0x8044('0x33')]:_0x408bbc[_0x8044('0x2d')];if(!_0x3ae6c7[_0x8044('0x2e')][_0x8044('0x34')](_0x8044('0x35'))){_0x3de286['limit']=qs[_0x8044('0x1d')](_0x3ae6c7[_0x8044('0x2e')][_0x8044('0x1d')]);_0x3de286[_0x8044('0x1c')]=qs[_0x8044('0x1c')](_0x3ae6c7['query']['offset']);}_0x3de286[_0x8044('0x36')]=qs[_0x8044('0x37')](_0x3ae6c7['query']['sort']);_0x3de286[_0x8044('0x3a')]=qs['filters'](_['pick'](_0x3ae6c7[_0x8044('0x2e')],_0x408bbc[_0x8044('0x30')]));_0x3de286[_0x8044('0x66')]=!![];if(_0x3ae6c7[_0x8044('0x2e')][_0x8044('0x39')]){_0x3de286[_0x8044('0x3a')]=_[_0x8044('0x3b')](_0x3de286['where'],{'$or':_['map'](_0x3de286[_0x8044('0x33')],function(_0x56d27b){var _0xac09b3={};_0xac09b3[_0x56d27b]={'$like':'%'+_0x3ae6c7[_0x8044('0x2e')][_0x8044('0x39')]+'%'};return _0xac09b3;})});}_0x3de286=_[_0x8044('0x3b')]({},_0x3de286,_0x3ae6c7[_0x8044('0x3d')]);return _0x27b176[_0x8044('0x67')](_0x3de286);}})[_0x8044('0x21')](respondWithResult(_0x45a070,null))[_0x8044('0x42')](handleError(_0x45a070,null));};exports['getContactsCsv']=function(_0x9218f5,_0x4bdb35,_0x521034){var _0x313868;var _0x2c5002;var _0x3d4f74;var _0x174855=_0x9218f5[_0x8044('0x50')]['id'];csv_results=[];return db['ContactItemType'][_0x8044('0x40')]({'attributes':['id',_0x8044('0x25')],'raw':!![],'order':[_0x8044('0x68')]})['then'](function(_0x3685db){_0x313868=_0x3685db;var _0x52bc4e=_[_0x8044('0x2f')](db[_0x8044('0x5d')]['rawAttributes']);return db[_0x8044('0x64')]['findAll']({'raw':!![],'attributes':['id',_0x8044('0x69')]})[_0x8044('0x21')](function(_0x104841){_0x2c5002=_0x104841;var _0x315354=squel[_0x8044('0x6a')]()[_0x8044('0x32')](_0x52bc4e)[_0x8044('0x6b')](_0x8044('0x6c'),'c')[_0x8044('0x3a')]('c.ListId\x20=\x20?',_0x174855)[_0x8044('0x3a')](_0x8044('0x6d'))[_0x8044('0x6e')]();for(var _0xe1e1e5=0x0;_0xe1e1e5<_0x2c5002[_0x8044('0x56')];_0xe1e1e5++){_0x315354[_0x8044('0x6f')]('c.cf_'+_0x2c5002[_0xe1e1e5]['id'],_0x8044('0x70')+_0x2c5002[_0xe1e1e5][_0x8044('0x69')]);}for(var _0xe1e1e5=0x0;_0xe1e1e5<_0x313868['length'];_0xe1e1e5++){_0x315354[_0x8044('0x6f')](squel[_0x8044('0x6a')]()['field'](_0x8044('0x71'))[_0x8044('0x6b')](_0x8044('0x72'))[_0x8044('0x3a')](_0x8044('0x73'),_0x313868[_0xe1e1e5]['id'])[_0x8044('0x3a')](_0x8044('0x74')),_0x8044('0x75')+_0x313868[_0xe1e1e5][_0x8044('0x25')]);_0x315354[_0x8044('0x6f')](squel[_0x8044('0x6a')]()[_0x8044('0x6f')](_0x8044('0x76'))[_0x8044('0x6b')](_0x8044('0x72'))[_0x8044('0x3a')](_0x8044('0x73'),_0x313868[_0xe1e1e5]['id'])[_0x8044('0x3a')](_0x8044('0x74')),_0x8044('0x77')+_0x313868[_0xe1e1e5][_0x8044('0x25')]);}var _0x1ea020=[];_0x1ea020[_0x8044('0x5f')](_0x315354[_0x8044('0x78')]());BPromise[_0x8044('0x79')](_0x1ea020,handleQuery)[_0x8044('0x21')](function(_0x617ac4){handleQuery(_0x315354[_0x8044('0x78')]());var _0x37781e=csv_results[0x0];if(!_[_0x8044('0x7a')](_0x37781e)){var _0x230ebc=toCsv(_0x37781e);var _0xcb7677=Date[_0x8044('0x7b')]();fs[_0x8044('0x7c')](util[_0x8044('0x65')]('/tmp/list_%d_%s.csv',_0x174855,_0xcb7677),_0x230ebc);_0x4bdb35[_0x8044('0x7d')](_0x8044('0x7e'),_0x8044('0x7f')+util[_0x8044('0x65')](_0x8044('0x80'),_0x174855,_0xcb7677));_0x4bdb35[_0x8044('0x7d')](_0x8044('0x81'),_0x8044('0x82'));return _0x4bdb35[_0x8044('0x83')](util[_0x8044('0x65')](_0x8044('0x84'),_0x174855,_0xcb7677));}else{return _0x4bdb35['sendStatus'](0xcc);}});});});};exports[_0x8044('0x85')]=function(_0x478f08,_0x4de55f,_0xf0dffb){var _0x5e5b29;delete _0x478f08['body']['id'];return db[_0x8044('0x29')]['findOne']({'where':{'id':_0x478f08[_0x8044('0x50')]['id']}})[_0x8044('0x21')](handleEntityNotFound(_0x4de55f,null))[_0x8044('0x21')](function(_0xa5a483){if(_0xa5a483){return db[_0x8044('0x86')][_0x8044('0x87')](function(_0x5a2bc9){return db[_0x8044('0x64')][_0x8044('0x43')](_0x478f08[_0x8044('0x44')],{'transaction':_0x5a2bc9})[_0x8044('0x21')](function(_0x4ac0b8){_0x5e5b29=_0x4ac0b8;return _0xa5a483['addCustomFields'](_0x4ac0b8,{'transaction':_0x5a2bc9});})['then'](function(){var _0x2daa75={'type':db['Sequelize']['TEXT'],'transaction':_0x5a2bc9};switch(_0x478f08[_0x8044('0x44')][_0x8044('0x88')]){case _0x8044('0x89'):_0x2daa75[_0x8044('0x88')]=db[_0x8044('0x8a')][_0x8044('0x8b')];break;case _0x8044('0x8c'):_0x2daa75['type']=db[_0x8044('0x8a')][_0x8044('0x8d')];break;case _0x8044('0x8e'):_0x2daa75[_0x8044('0x88')]=db['Sequelize']['BOOLEAN'];_0x2daa75['defaultValue']=![];break;default:}return db[_0x8044('0x86')][_0x8044('0x8f')][_0x8044('0x90')](_0x8044('0x6c'),util[_0x8044('0x65')](_0x8044('0x91'),_0x5e5b29['id']),_0x2daa75);})['then'](function(){return _0x5e5b29;});});}})[_0x8044('0x21')](respondWithResult(_0x4de55f,null))[_0x8044('0x42')](handleError(_0x4de55f,null));};exports[_0x8044('0x92')]=function(_0xbc9528,_0x4d39ad,_0x3741ae){var _0x1ed624={};var _0x997e3e={};var _0xf7babd;var _0x4eb8dd;return db[_0x8044('0x29')][_0x8044('0x93')]({'where':{'id':_0xbc9528[_0x8044('0x50')]['id']}})[_0x8044('0x21')](handleEntityNotFound(_0x4d39ad,null))[_0x8044('0x21')](function(_0x1281e2){if(_0x1281e2){_0xf7babd=_0x1281e2;_0x997e3e['model']=_['keys'](db[_0x8044('0x64')]['rawAttributes']);_0x997e3e['query']=_[_0x8044('0x2f')](_0xbc9528[_0x8044('0x2e')]);_0x997e3e[_0x8044('0x30')]=_[_0x8044('0x31')](_0x997e3e[_0x8044('0x2d')],_0x997e3e[_0x8044('0x2e')]);_0x1ed624[_0x8044('0x33')]=_[_0x8044('0x31')](_0x997e3e[_0x8044('0x2d')],qs['fields'](_0xbc9528['query'][_0x8044('0x32')]));_0x1ed624[_0x8044('0x33')]=_0x1ed624['attributes'][_0x8044('0x56')]?_0x1ed624[_0x8044('0x33')]:_0x997e3e[_0x8044('0x2d')];_0x1ed624[_0x8044('0x36')]=qs[_0x8044('0x37')](_0xbc9528[_0x8044('0x2e')][_0x8044('0x37')]);_0x1ed624['where']=qs[_0x8044('0x30')](_[_0x8044('0x38')](_0xbc9528[_0x8044('0x2e')],_0x997e3e[_0x8044('0x30')]));_0x1ed624['where']=_[_0x8044('0x3b')](_0x1ed624[_0x8044('0x3a')],{'$or':[{'ListId':_0x1281e2['id']},{'ListId':null}]});if(_0xbc9528[_0x8044('0x2e')][_0x8044('0x39')]){_0x1ed624['where']=_[_0x8044('0x3b')](_0x1ed624[_0x8044('0x3a')],{'$or':_[_0x8044('0x28')](_0x1ed624[_0x8044('0x33')],function(_0x9a0e2b){var _0x1d9ecd={};_0x1d9ecd[_0x9a0e2b]={'$like':'%'+_0xbc9528[_0x8044('0x2e')]['filter']+'%'};return _0x1d9ecd;})});}_0x1ed624=_[_0x8044('0x3b')]({},_0x1ed624,_0xbc9528['options']);return db[_0x8044('0x64')][_0x8044('0x94')](_0x1ed624);}})[_0x8044('0x21')](respondWithResult(_0x4d39ad,null))[_0x8044('0x42')](handleError(_0x4d39ad,null));};exports[_0x8044('0x95')]=function(_0x912ef,_0x4dcd93){return db[_0x8044('0x64')][_0x8044('0x94')]({'where':{'ListId':null}})[_0x8044('0x21')](handleEntityNotFound(_0x4dcd93,null))[_0x8044('0x21')](function(_0x50a920){return _0x50a920;})['then'](respondWithResult(_0x4dcd93,null))['catch'](handleError(_0x4dcd93,null));};exports[_0x8044('0x96')]=function(_0x25a351,_0x2a6eb6,_0x468b38){return db['CmList'][_0x8044('0x49')]({'where':{'id':_0x25a351['params']['id']}})[_0x8044('0x21')](handleEntityNotFound(_0x2a6eb6,null))['then'](function(_0x32f76e){if(_0x32f76e){return _0x32f76e['addAgents'](_0x25a351[_0x8044('0x44')][_0x8044('0x58')],_[_0x8044('0x97')](_0x25a351[_0x8044('0x44')],[_0x8044('0x58'),'id'])||{})[_0x8044('0x98')](function(_0xae426b){for(var _0x18293a=0x0;_0x18293a<_0x25a351['body'][_0x8044('0x58')]['length'];_0x18293a+=0x1){socket[_0x8044('0x99')](_0x8044('0x9a'),{'UserId':Number(_0x25a351[_0x8044('0x44')][_0x8044('0x58')][_0x18293a]),'CmListId':Number(_0x25a351[_0x8044('0x50')]['id'])});}return _0xae426b;});}})[_0x8044('0x21')](respondWithResult(_0x2a6eb6,null))['catch'](handleError(_0x2a6eb6,null));};exports['removeAgents']=function(_0x4be123,_0x13e18b,_0x2bd7c2){return db[_0x8044('0x29')]['find']({'where':{'id':_0x4be123[_0x8044('0x50')]['id']}})[_0x8044('0x21')](handleEntityNotFound(_0x13e18b,null))[_0x8044('0x21')](function(_0x4b82bb){if(_0x4b82bb){return _0x4b82bb[_0x8044('0x9b')](_0x4be123[_0x8044('0x2e')][_0x8044('0x58')])[_0x8044('0x21')](function(){if(_['isArray'](_0x4be123['query'][_0x8044('0x58')])){for(var _0x259af6=0x0;_0x259af6<_0x4be123[_0x8044('0x2e')][_0x8044('0x58')][_0x8044('0x56')];_0x259af6+=0x1){socket[_0x8044('0x99')](_0x8044('0x9c'),{'UserId':Number(_0x4be123[_0x8044('0x2e')]['ids'][_0x259af6]),'CmListId':Number(_0x4be123[_0x8044('0x50')]['id'])});}}else{socket[_0x8044('0x99')](_0x8044('0x9c'),{'UserId':Number(_0x4be123['query']['ids']),'CmListId':Number(_0x4be123[_0x8044('0x50')]['id'])});}});}})[_0x8044('0x21')](respondWithStatusCode(_0x13e18b,null))[_0x8044('0x42')](handleError(_0x13e18b,null));};exports['getAgents']=function(_0x5d17d6,_0x127ec3,_0x1ab6e1){var _0x38ff9f={};var _0x18f4df={};var _0x5cc694;var _0x48d9da;return db[_0x8044('0x29')][_0x8044('0x93')]({'where':{'id':_0x5d17d6[_0x8044('0x50')]['id']}})[_0x8044('0x21')](handleEntityNotFound(_0x127ec3,null))[_0x8044('0x21')](function(_0x5c6cfb){if(_0x5c6cfb){_0x5cc694=_0x5c6cfb;_0x18f4df[_0x8044('0x2d')]=_['keys'](db[_0x8044('0x9d')][_0x8044('0x2a')]);_0x18f4df[_0x8044('0x2e')]=_[_0x8044('0x2f')](_0x5d17d6[_0x8044('0x2e')]);_0x18f4df['filters']=_[_0x8044('0x31')](_0x18f4df['model'],_0x18f4df['query']);_0x38ff9f['attributes']=_[_0x8044('0x31')](_0x18f4df[_0x8044('0x2d')],qs['fields'](_0x5d17d6[_0x8044('0x2e')][_0x8044('0x32')]));_0x38ff9f[_0x8044('0x33')]=_0x38ff9f[_0x8044('0x33')][_0x8044('0x56')]?_0x38ff9f[_0x8044('0x33')]:_0x18f4df[_0x8044('0x2d')];_0x38ff9f['order']=qs['sort'](_0x5d17d6[_0x8044('0x2e')][_0x8044('0x37')]);_0x38ff9f[_0x8044('0x3a')]=qs['filters'](_[_0x8044('0x38')](_0x5d17d6[_0x8044('0x2e')],_0x18f4df[_0x8044('0x30')]));if(_0x5d17d6['query'][_0x8044('0x39')]){_0x38ff9f[_0x8044('0x3a')]=_[_0x8044('0x3b')](_0x38ff9f[_0x8044('0x3a')],{'$or':_[_0x8044('0x28')](_0x38ff9f[_0x8044('0x33')],function(_0x47dac1){var _0x24cb71={};_0x24cb71[_0x47dac1]={'$like':'%'+_0x5d17d6[_0x8044('0x2e')][_0x8044('0x39')]+'%'};return _0x24cb71;})});}_0x38ff9f=_['merge']({},_0x38ff9f,_0x5d17d6[_0x8044('0x3d')]);return _0x5cc694['getAgents'](_0x38ff9f);}})[_0x8044('0x21')](function(_0x13b30d){if(_0x13b30d){_0x48d9da=_0x13b30d['length'];if(!_0x5d17d6[_0x8044('0x2e')]['hasOwnProperty'](_0x8044('0x35'))){_0x38ff9f['limit']=qs[_0x8044('0x1d')](_0x5d17d6[_0x8044('0x2e')][_0x8044('0x1d')]);_0x38ff9f[_0x8044('0x1c')]=qs['offset'](_0x5d17d6[_0x8044('0x2e')][_0x8044('0x1c')]);}return _0x5cc694['getAgents'](_0x38ff9f);}})['then'](function(_0x2e2a8c){if(_0x2e2a8c){return _0x2e2a8c?{'count':_0x48d9da,'rows':_0x2e2a8c}:null;}})[_0x8044('0x21')](respondWithResult(_0x127ec3,null))[_0x8044('0x42')](handleError(_0x127ec3,null));};function handleQuery(_0x1dd8ef){logger[_0x8044('0x9e')](_0x1dd8ef);return db[_0x8044('0x86')][_0x8044('0x2e')](_0x1dd8ef)[_0x8044('0x98')](function(_0x3d0051){csv_results[_0x8044('0x5f')](_0x3d0051);})[_0x8044('0x42')](function(_0x4f32f2){logger[_0x8044('0x4d')](_0x4f32f2[_0x8044('0x61')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index bda38b1..963a702 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 _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe14b,0x93));var _0xbe14=function(_0xf3c31f,_0x1b1bd8){_0xf3c31f=_0xf3c31f-0x0;var _0x2ae42a=_0xe14b[_0xf3c31f];return _0x2ae42a;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x58d43a,_0x2e127a){_0x58d43a=_0x58d43a-0x0;var _0x178bb9=_0x3e74[_0x58d43a];return _0x178bb9;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index baa1c1a..3222d1f 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 _0xda55=['util','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','define','CmList','cm_lists','lodash'];(function(_0x13572e,_0x4821a5){var _0x36ad78=function(_0x2860e9){while(--_0x2860e9){_0x13572e['push'](_0x13572e['shift']());}};_0x36ad78(++_0x4821a5);}(_0xda55,0x6d));var _0x5da5=function(_0x5d3e97,_0x17d8dd){_0x5d3e97=_0x5d3e97-0x0;var _0x3a8dbe=_0xda55[_0x5d3e97];return _0x3a8dbe;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var rp=require(_0x5da5('0x4'));var fs=require('fs');var path=require(_0x5da5('0x5'));var rimraf=require(_0x5da5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5da5('0x7'));module['exports']=function(_0x356a37,_0x58e7b3){return _0x356a37[_0x5da5('0x8')](_0x5da5('0x9'),attributes,{'tableName':_0x5da5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','CmList','util'];(function(_0x3aac02,_0x5a9b9c){var _0x428e81=function(_0x3a843a){while(--_0x3a843a){_0x3aac02['push'](_0x3aac02['shift']());}};_0x428e81(++_0x5a9b9c);}(_0xedd9,0xfc));var _0x9edd=function(_0x1b428d,_0x21be12){_0x1b428d=_0x1b428d-0x0;var _0x169cf2=_0xedd9[_0x1b428d];return _0x169cf2;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 00fd25d..c7595cd 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 _0x3dbf=['message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x55c09a,_0x4f2c79){var _0x3fb09b=function(_0x3c6dd7){while(--_0x3c6dd7){_0x55c09a['push'](_0x55c09a['shift']());}};_0x3fb09b(++_0x4f2c79);}(_0x3dbf,0x198));var _0xf3db=function(_0xe3c783,_0xd6615f){_0xe3c783=_0xe3c783-0x0;var _0x7b9de4=_0x3dbf[_0xe3c783];return _0x7b9de4;};'use strict';var _=require(_0xf3db('0x0'));var util=require('util');var moment=require(_0xf3db('0x1'));var BPromise=require(_0xf3db('0x2'));var rs=require(_0xf3db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3db('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf3db('0x5'))('rpc');var config=require(_0xf3db('0x6'));var jayson=require(_0xf3db('0x7'));var client=jayson[_0xf3db('0x8')][_0xf3db('0x9')]({'port':0x232a});config[_0xf3db('0xa')]=_[_0xf3db('0xb')](config[_0xf3db('0xa')],{'host':_0xf3db('0xc'),'port':0x18eb});var socket=require(_0xf3db('0xd'))(new Redis(config[_0xf3db('0xa')]));require(_0xf3db('0xe'))[_0xf3db('0xf')](socket);function respondWithRpcPromise(_0x4ca75c,_0x30da21,_0x2f292d){return new BPromise(function(_0x48d625,_0x1d5b7c){return client['request'](_0x4ca75c,_0x2f292d)[_0xf3db('0x10')](function(_0x285e52){logger['info'](_0xf3db('0x11'),_0x30da21,_0xf3db('0x12'));logger[_0xf3db('0x13')](_0xf3db('0x14'),_0x30da21,'request\x20sent',JSON[_0xf3db('0x15')](_0x285e52));if(_0x285e52['error']){if(_0x285e52[_0xf3db('0x16')][_0xf3db('0x17')]===0x1f4){logger[_0xf3db('0x16')]('CmList,\x20%s,\x20%s',_0x30da21,_0x285e52['error'][_0xf3db('0x18')]);return _0x1d5b7c(_0x285e52[_0xf3db('0x16')]['message']);}logger[_0xf3db('0x16')]('CmList,\x20%s,\x20%s',_0x30da21,_0x285e52['error'][_0xf3db('0x18')]);return _0x48d625(_0x285e52[_0xf3db('0x16')]['message']);}else{logger['info'](_0xf3db('0x11'),_0x30da21,_0xf3db('0x12'));_0x48d625(_0x285e52[_0xf3db('0x19')][_0xf3db('0x18')]);}})[_0xf3db('0x1a')](function(_0x42c742){logger['error'](_0xf3db('0x11'),_0x30da21,_0x42c742);_0x1d5b7c(_0x42c742);});});} \ No newline at end of file +var _0xb81b=['localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x59e108,_0x26ea18){var _0x3c1dc4=function(_0x20a90b){while(--_0x20a90b){_0x59e108['push'](_0x59e108['shift']());}};_0x3c1dc4(++_0x26ea18);}(_0xb81b,0x10d));var _0xbb81=function(_0x429bfe,_0x164784){_0x429bfe=_0x429bfe-0x0;var _0x80ea3a=_0xb81b[_0x429bfe];return _0x80ea3a;};'use strict';var _=require('lodash');var util=require(_0xbb81('0x0'));var moment=require(_0xbb81('0x1'));var BPromise=require('bluebird');var rs=require(_0xbb81('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbb81('0x3'));var logger=require(_0xbb81('0x4'))(_0xbb81('0x5'));var config=require(_0xbb81('0x6'));var jayson=require(_0xbb81('0x7'));var client=jayson['client'][_0xbb81('0x8')]({'port':0x232a});config[_0xbb81('0x9')]=_[_0xbb81('0xa')](config['redis'],{'host':_0xbb81('0xb'),'port':0x18eb});var socket=require(_0xbb81('0xc'))(new Redis(config[_0xbb81('0x9')]));require(_0xbb81('0xd'))[_0xbb81('0xe')](socket);function respondWithRpcPromise(_0x1672e3,_0x2fc204,_0x28ac37){return new BPromise(function(_0x50115c,_0x3a286e){return client[_0xbb81('0xf')](_0x1672e3,_0x28ac37)[_0xbb81('0x10')](function(_0x3fe4fd){logger[_0xbb81('0x11')](_0xbb81('0x12'),_0x2fc204,_0xbb81('0x13'));logger[_0xbb81('0x14')](_0xbb81('0x15'),_0x2fc204,'request\x20sent',JSON[_0xbb81('0x16')](_0x3fe4fd));if(_0x3fe4fd['error']){if(_0x3fe4fd['error'][_0xbb81('0x17')]===0x1f4){logger[_0xbb81('0x18')](_0xbb81('0x12'),_0x2fc204,_0x3fe4fd[_0xbb81('0x18')][_0xbb81('0x19')]);return _0x3a286e(_0x3fe4fd[_0xbb81('0x18')][_0xbb81('0x19')]);}logger[_0xbb81('0x18')](_0xbb81('0x12'),_0x2fc204,_0x3fe4fd['error'][_0xbb81('0x19')]);return _0x50115c(_0x3fe4fd['error'][_0xbb81('0x19')]);}else{logger[_0xbb81('0x11')](_0xbb81('0x12'),_0x2fc204,'request\x20sent');_0x50115c(_0x3fe4fd[_0xbb81('0x1a')][_0xbb81('0x19')]);}})[_0xbb81('0x1b')](function(_0x2c79f4){logger[_0xbb81('0x18')](_0xbb81('0x12'),_0x2fc204,_0x2c79f4);_0x3a286e(_0x2c79f4);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index bf4aeee..4099c5b 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 _0x4283=['removeListener','length','cmList:','save','remove','update'];(function(_0x193394,_0x77e174){var _0x576e1b=function(_0x2f71b5){while(--_0x2f71b5){_0x193394['push'](_0x193394['shift']());}};_0x576e1b(++_0x77e174);}(_0x4283,0x177));var _0x3428=function(_0x49408b,_0x2335a1){_0x49408b=_0x49408b-0x0;var _0xee64ae=_0x4283[_0x49408b];return _0xee64ae;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x3428('0x0'),_0x3428('0x1'),_0x3428('0x2')];function createListener(_0x41df5c,_0x3aa7a1){return function(_0x5364a4){_0x3aa7a1['emit'](_0x41df5c,_0x5364a4);};}function removeListener(_0x1a160b,_0x1ed205){return function(){CmListEvents[_0x3428('0x3')](_0x1a160b,_0x1ed205);};}exports['register']=function(_0x2e7864){for(var _0x169dfc=0x0,_0x14738a=events[_0x3428('0x4')];_0x169dfc<_0x14738a;_0x169dfc++){var _0x2410b0=events[_0x169dfc];var _0xd9de15=createListener(_0x3428('0x5')+_0x2410b0,_0x2e7864);CmListEvents['on'](_0x2410b0,_0xd9de15);}}; \ No newline at end of file +var _0x4a1a=['update','register','cmList:','remove'];(function(_0x2f4c1c,_0x5a3dd4){var _0x25e0f2=function(_0x46ea31){while(--_0x46ea31){_0x2f4c1c['push'](_0x2f4c1c['shift']());}};_0x25e0f2(++_0x5a3dd4);}(_0x4a1a,0x11f));var _0xa4a1=function(_0x413087,_0x96db5a){_0x413087=_0x413087-0x0;var _0x1c773f=_0x4a1a[_0x413087];return _0x1c773f;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0xa4a1('0x0'),_0xa4a1('0x1')];function createListener(_0x48e807,_0x534ec3){return function(_0x480284){_0x534ec3['emit'](_0x48e807,_0x480284);};}function removeListener(_0x350902,_0x4a3e0e){return function(){CmListEvents['removeListener'](_0x350902,_0x4a3e0e);};}exports[_0xa4a1('0x2')]=function(_0x58c7b8){for(var _0x6284e3=0x0,_0x42a54c=events['length'];_0x6284e3<_0x42a54c;_0x6284e3++){var _0x2be135=events[_0x6284e3];var _0x1f6b96=createListener(_0xa4a1('0x3')+_0x2be135,_0x58c7b8);CmListEvents['on'](_0x2be135,_0x1f6b96);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 4e8bf35..99003f0 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 _0x5a8c=['addAgents','update','delete','removeDispositions','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField'];(function(_0x94cd4d,_0x96a926){var _0x49b562=function(_0x27ccc2){while(--_0x27ccc2){_0x94cd4d['push'](_0x94cd4d['shift']());}};_0x49b562(++_0x96a926);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x37708e,_0x385531){_0x37708e=_0x37708e-0x0;var _0x2bdf8c=_0x5a8c[_0x37708e];return _0x2bdf8c;};'use strict';var multer=require(_0xc5a8('0x0'));var util=require(_0xc5a8('0x1'));var path=require('path');var timeout=require(_0xc5a8('0x2'));var express=require(_0xc5a8('0x3'));var router=express[_0xc5a8('0x4')]();var fs_extra=require(_0xc5a8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc5a8('0x6'));var config=require(_0xc5a8('0x7'));var controller=require('./cmList.controller');router[_0xc5a8('0x8')]('/',auth[_0xc5a8('0x9')](),controller[_0xc5a8('0xa')]);router[_0xc5a8('0x8')](_0xc5a8('0xb'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0xc')]);router[_0xc5a8('0x8')](_0xc5a8('0xd'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0xe')]);router['get'](_0xc5a8('0xf'),auth['isAuthenticated'](),controller[_0xc5a8('0x10')]);router[_0xc5a8('0x8')](_0xc5a8('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xc5a8('0x8')](_0xc5a8('0x12'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x13')]);router[_0xc5a8('0x8')]('/:id/contacts/csv',auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x14')]);router[_0xc5a8('0x8')](_0xc5a8('0x15'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x16')]);router[_0xc5a8('0x8')](_0xc5a8('0x17'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x18')]);router[_0xc5a8('0x19')]('/',auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x1a')]);router[_0xc5a8('0x19')](_0xc5a8('0x11'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x1b')]);router[_0xc5a8('0x19')]('/:id/contacts',auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x1c')]);router[_0xc5a8('0x19')](_0xc5a8('0x15'),auth['isAuthenticated'](),controller[_0xc5a8('0x1d')]);router['post'](_0xc5a8('0x17'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x1e')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc5a8('0x1f')]);router[_0xc5a8('0x20')](_0xc5a8('0xf'),auth[_0xc5a8('0x9')](),controller['destroy']);router[_0xc5a8('0x20')](_0xc5a8('0x11'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x21')]);router['delete'](_0xc5a8('0x17'),auth['isAuthenticated'](),controller[_0xc5a8('0x22')]);module[_0xc5a8('0x23')]=router; \ No newline at end of file +var _0xdead=['../../components/interaction/service','./cmList.controller','get','index','/describe','isAuthenticated','describe','/global_fields','getGlobalCustomFields','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getAgents','post','create','addCustomField','/:id/users','addAgents','/:id','update','destroy','delete','removeDispositions','removeAgents','exports','multer','util','path','express'];(function(_0x361152,_0x532e27){var _0x4b30d0=function(_0x333339){while(--_0x333339){_0x361152['push'](_0x361152['shift']());}};_0x4b30d0(++_0x532e27);}(_0xdead,0x172));var _0xddea=function(_0x17983d,_0x30e8c1){_0x17983d=_0x17983d-0x0;var _0x1ca89d=_0xdead[_0x17983d];return _0x1ca89d;};'use strict';var multer=require(_0xddea('0x0'));var util=require(_0xddea('0x1'));var path=require(_0xddea('0x2'));var timeout=require('connect-timeout');var express=require(_0xddea('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xddea('0x4'));var config=require('../../config/environment');var controller=require(_0xddea('0x5'));router[_0xddea('0x6')]('/',auth['isAuthenticated'](),controller[_0xddea('0x7')]);router[_0xddea('0x6')](_0xddea('0x8'),auth[_0xddea('0x9')](),controller[_0xddea('0xa')]);router['get'](_0xddea('0xb'),auth['isAuthenticated'](),controller[_0xddea('0xc')]);router[_0xddea('0x6')]('/:id',auth[_0xddea('0x9')](),controller[_0xddea('0xd')]);router[_0xddea('0x6')](_0xddea('0xe'),auth[_0xddea('0x9')](),controller[_0xddea('0xf')]);router['get'](_0xddea('0x10'),auth[_0xddea('0x9')](),controller[_0xddea('0x11')]);router[_0xddea('0x6')](_0xddea('0x12'),auth[_0xddea('0x9')](),controller[_0xddea('0x13')]);router[_0xddea('0x6')](_0xddea('0x14'),auth[_0xddea('0x9')](),controller['getCustomFields']);router[_0xddea('0x6')]('/:id/users',auth[_0xddea('0x9')](),controller[_0xddea('0x15')]);router[_0xddea('0x16')]('/',auth[_0xddea('0x9')](),controller[_0xddea('0x17')]);router[_0xddea('0x16')]('/:id/dispositions',auth[_0xddea('0x9')](),controller['addDisposition']);router['post'](_0xddea('0x10'),auth['isAuthenticated'](),controller['addContacts']);router[_0xddea('0x16')](_0xddea('0x14'),auth['isAuthenticated'](),controller[_0xddea('0x18')]);router['post'](_0xddea('0x19'),auth[_0xddea('0x9')](),controller[_0xddea('0x1a')]);router['put'](_0xddea('0x1b'),auth[_0xddea('0x9')](),controller[_0xddea('0x1c')]);router['delete'](_0xddea('0x1b'),auth[_0xddea('0x9')](),controller[_0xddea('0x1d')]);router[_0xddea('0x1e')](_0xddea('0xe'),auth[_0xddea('0x9')](),controller[_0xddea('0x1f')]);router[_0xddea('0x1e')]('/:id/users',auth[_0xddea('0x9')](),controller[_0xddea('0x20')]);module[_0xddea('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 05d2d6b..cc8096b 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 _0xd219=['exports','getDataValue','field','sequelize'];(function(_0x452be5,_0x1101ee){var _0x13bda4=function(_0x39c135){while(--_0x39c135){_0x452be5['push'](_0x452be5['shift']());}};_0x13bda4(++_0x1101ee);}(_0xd219,0x167));var _0x9d21=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xd219[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require(_0x9d21('0x0'));module[_0x9d21('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x6b4d56){return this[_0x9d21('0x2')](_0x9d21('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x336b=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x5c7352,_0x26cb3a){var _0x5842eb=function(_0x59f63a){while(--_0x59f63a){_0x5c7352['push'](_0x5c7352['shift']());}};_0x5842eb(++_0x26cb3a);}(_0x336b,0x73));var _0xb336=function(_0x494218,_0x3d4c83){_0x494218=_0x494218-0x0;var _0x18d7da=_0x336b[_0x494218];return _0x18d7da;};'use strict';var Sequelize=require(_0xb336('0x0'));module[_0xb336('0x1')]={'name':{'type':Sequelize[_0xb336('0x2')],'get':function(_0x4f1e58){return this[_0xb336('0x3')](_0xb336('0x4'));}},'field':{'type':Sequelize[_0xb336('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xb336('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 3a62144..681ea88 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(_0x164894,_0x41c7f7){var _0x4c2739=function(_0x35e22b){while(--_0x35e22b){_0x164894['push'](_0x164894['shift']());}};_0x4c2739(++_0x41c7f7);}(_0x7a54,0x106));var _0x47a5=function(_0x33bd0f,_0x2cf197){_0x33bd0f=_0x33bd0f-0x0;var _0x581ffc=_0x7a54[_0x33bd0f];return _0x581ffc;};'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 _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(_0xa153b1,_0x3fe7ed){var _0x60cfb=function(_0x469585){while(--_0x469585){_0xa153b1['push'](_0xa153b1['shift']());}};_0x60cfb(++_0x3fe7ed);}(_0x7a54,0x106));var _0x47a5=function(_0x19b191,_0x58d363){_0x19b191=_0x19b191-0x0;var _0x32a9db=_0x7a54[_0x19b191];return _0x32a9db;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 67235f3..d262780 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 _0x7338=['Condition','tools_conditions','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0x7338,0x115));var _0x8733=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x7338[_0x3740fe];return _0x55492b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8733('0x0'))(_0x8733('0x1'));var moment=require('moment');var BPromise=require(_0x8733('0x2'));var rp=require(_0x8733('0x3'));var fs=require('fs');var path=require(_0x8733('0x4'));var rimraf=require(_0x8733('0x5'));var config=require(_0x8733('0x6'));var attributes=require(_0x8733('0x7'));module[_0x8733('0x8')]=function(_0xada5d7,_0x10c893){return _0xada5d7['define'](_0x8733('0x9'),attributes,{'tableName':_0x8733('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfc2=['bluebird','../../config/environment','./condition.attributes','define','Condition','tools_conditions','util','../../config/logger','api','moment'];(function(_0x17226d,_0x5cdceb){var _0x1a0243=function(_0x45c441){while(--_0x45c441){_0x17226d['push'](_0x17226d['shift']());}};_0x1a0243(++_0x5cdceb);}(_0xdfc2,0x178));var _0x2dfc=function(_0x508a41,_0x391cf0){_0x508a41=_0x508a41-0x0;var _0x4ed9e7=_0xdfc2[_0x508a41];return _0x4ed9e7;};'use strict';var _=require('lodash');var util=require(_0x2dfc('0x0'));var logger=require(_0x2dfc('0x1'))(_0x2dfc('0x2'));var moment=require(_0x2dfc('0x3'));var BPromise=require(_0x2dfc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2dfc('0x5'));var attributes=require(_0x2dfc('0x6'));module['exports']=function(_0xaaa7ef,_0x498299){return _0xaaa7ef[_0x2dfc('0x7')](_0x2dfc('0x8'),attributes,{'tableName':_0x2dfc('0x9'),'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 9300d99..2225e94 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 _0x6a6d=['moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x58f0a2,_0x4a5b7e){var _0x1ed5ee=function(_0x3e4435){while(--_0x3e4435){_0x58f0a2['push'](_0x58f0a2['shift']());}};_0x1ed5ee(++_0x4a5b7e);}(_0x6a6d,0xdb));var _0xd6a6=function(_0x1ae20a,_0x385fb7){_0x1ae20a=_0x1ae20a-0x0;var _0x2f98bc=_0x6a6d[_0x1ae20a];return _0x2f98bc;};'use strict';var _=require(_0xd6a6('0x0'));var util=require('util');var moment=require(_0xd6a6('0x1'));var BPromise=require(_0xd6a6('0x2'));var rs=require(_0xd6a6('0x3'));var fs=require('fs');var Redis=require(_0xd6a6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd6a6('0x5'));var config=require('../../config/environment');var jayson=require(_0xd6a6('0x6'));var client=jayson[_0xd6a6('0x7')][_0xd6a6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xdc95b7,_0x348ee0,_0x248f31){return new BPromise(function(_0x4025df,_0x2f4888){return client[_0xd6a6('0x9')](_0xdc95b7,_0x248f31)[_0xd6a6('0xa')](function(_0x332524){logger[_0xd6a6('0xb')](_0xd6a6('0xc'),_0x348ee0,_0xd6a6('0xd'));logger[_0xd6a6('0xe')](_0xd6a6('0xf'),_0x348ee0,_0xd6a6('0xd'),JSON[_0xd6a6('0x10')](_0x332524));if(_0x332524[_0xd6a6('0x11')]){if(_0x332524['error'][_0xd6a6('0x12')]===0x1f4){logger[_0xd6a6('0x11')]('Condition,\x20%s,\x20%s',_0x348ee0,_0x332524['error'][_0xd6a6('0x13')]);return _0x2f4888(_0x332524[_0xd6a6('0x11')][_0xd6a6('0x13')]);}logger[_0xd6a6('0x11')](_0xd6a6('0xc'),_0x348ee0,_0x332524['error'][_0xd6a6('0x13')]);return _0x4025df(_0x332524[_0xd6a6('0x11')][_0xd6a6('0x13')]);}else{logger[_0xd6a6('0xb')](_0xd6a6('0xc'),_0x348ee0,_0xd6a6('0xd'));_0x4025df(_0x332524['result'][_0xd6a6('0x13')]);}})['catch'](function(_0x2370fe){logger[_0xd6a6('0x11')]('Condition,\x20%s,\x20%s',_0x348ee0,_0x2370fe);_0x2f4888(_0x2370fe);});});} \ No newline at end of file +var _0x6543=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6543,0xdb));var _0x3654=function(_0x37e665,_0xd6a998){_0x37e665=_0x37e665-0x0;var _0x2e9536=_0x6543[_0x37e665];return _0x2e9536;};'use strict';var _=require(_0x3654('0x0'));var util=require('util');var moment=require(_0x3654('0x1'));var BPromise=require(_0x3654('0x2'));var rs=require(_0x3654('0x3'));var fs=require('fs');var Redis=require(_0x3654('0x4'));var db=require(_0x3654('0x5'))['db'];var utils=require(_0x3654('0x6'));var logger=require(_0x3654('0x7'))(_0x3654('0x8'));var config=require('../../config/environment');var jayson=require(_0x3654('0x9'));var client=jayson[_0x3654('0xa')][_0x3654('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f90c4,_0x5d0472,_0x1a8cf4){return new BPromise(function(_0x3d9deb,_0x4f76f7){return client[_0x3654('0xc')](_0x4f90c4,_0x1a8cf4)['then'](function(_0x1e7bf1){logger[_0x3654('0xd')](_0x3654('0xe'),_0x5d0472,_0x3654('0xf'));logger['debug'](_0x3654('0x10'),_0x5d0472,_0x3654('0xf'),JSON[_0x3654('0x11')](_0x1e7bf1));if(_0x1e7bf1['error']){if(_0x1e7bf1[_0x3654('0x12')]['code']===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x5d0472,_0x1e7bf1[_0x3654('0x12')][_0x3654('0x13')]);return _0x4f76f7(_0x1e7bf1[_0x3654('0x12')]['message']);}logger[_0x3654('0x12')]('Condition,\x20%s,\x20%s',_0x5d0472,_0x1e7bf1[_0x3654('0x12')]['message']);return _0x3d9deb(_0x1e7bf1[_0x3654('0x12')]['message']);}else{logger[_0x3654('0xd')]('Condition,\x20%s,\x20%s',_0x5d0472,_0x3654('0xf'));_0x3d9deb(_0x1e7bf1[_0x3654('0x14')][_0x3654('0x13')]);}})[_0x3654('0x15')](function(_0x4376b5){logger[_0x3654('0x12')](_0x3654('0xe'),_0x5d0472,_0x4376b5);_0x4f76f7(_0x4376b5);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index a511619..8dcdc72 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 _0x0bbd=['/:id','update','delete','destroy','multer','util','path','fs-extra','../../config/environment','put'];(function(_0x4dec22,_0x3baa9b){var _0x13f1e6=function(_0x39374d){while(--_0x39374d){_0x4dec22['push'](_0x4dec22['shift']());}};_0x13f1e6(++_0x3baa9b);}(_0x0bbd,0xea));var _0xd0bb=function(_0x3fb7a1,_0x365d08){_0x3fb7a1=_0x3fb7a1-0x0;var _0x117022=_0x0bbd[_0x3fb7a1];return _0x117022;};'use strict';var multer=require(_0xd0bb('0x0'));var util=require(_0xd0bb('0x1'));var path=require(_0xd0bb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd0bb('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd0bb('0x4'));var controller=require('./condition.controller');router[_0xd0bb('0x5')](_0xd0bb('0x6'),auth['isAuthenticated'](),controller[_0xd0bb('0x7')]);router[_0xd0bb('0x8')](_0xd0bb('0x6'),auth['isAuthenticated'](),controller[_0xd0bb('0x9')]);module['exports']=router; \ No newline at end of file +var _0xf55b=['isAuthenticated','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','put','/:id'];(function(_0x2aeb4b,_0x29d79d){var _0x16138d=function(_0xab860f){while(--_0xab860f){_0x2aeb4b['push'](_0x2aeb4b['shift']());}};_0x16138d(++_0x29d79d);}(_0xf55b,0x1c4));var _0xbf55=function(_0x5c17fa,_0x2f8ec0){_0x5c17fa=_0x5c17fa-0x0;var _0x582a13=_0xf55b[_0x5c17fa];return _0x582a13;};'use strict';var multer=require(_0xbf55('0x0'));var util=require(_0xbf55('0x1'));var path=require('path');var timeout=require(_0xbf55('0x2'));var express=require(_0xbf55('0x3'));var router=express[_0xbf55('0x4')]();var fs_extra=require(_0xbf55('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbf55('0x6'));var config=require(_0xbf55('0x7'));var controller=require('./condition.controller');router[_0xbf55('0x8')](_0xbf55('0x9'),auth[_0xbf55('0xa')](),controller[_0xbf55('0xb')]);router[_0xbf55('0xc')](_0xbf55('0x9'),auth[_0xbf55('0xa')](),controller[_0xbf55('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index e36a0e3..798efa1 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb873=['exports','STRING','INTEGER','sequelize'];(function(_0x3b8680,_0x5a3670){var _0x5f5bb5=function(_0x15f1eb){while(--_0x15f1eb){_0x3b8680['push'](_0x3b8680['shift']());}};_0x5f5bb5(++_0x5a3670);}(_0xb873,0x133));var _0x3b87=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xb873[_0x1fc122];return _0xa2cb13;};'use strict';var Sequelize=require(_0x3b87('0x0'));module[_0x3b87('0x1')]={'name':{'type':Sequelize[_0x3b87('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x3b87('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x0547=['INTEGER','sequelize','STRING','name'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0x0547,0x17d));var _0x7054=function(_0x253f8d,_0x1b9e02){_0x253f8d=_0x253f8d-0x0;var _0x464264=_0x0547[_0x253f8d];return _0x464264;};'use strict';var Sequelize=require(_0x7054('0x0'));module['exports']={'name':{'type':Sequelize[_0x7054('0x1')],'allowNull':![],'unique':_0x7054('0x2')},'OrderBy':{'type':Sequelize[_0x7054('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x7054('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index aa2dbc4..733925a 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb016=['findAll','rows','show','keys','length','catch','create','role','user','UserProfileSection','find','userProfileId','autoAssociation','error','update','body','params','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ContactItemTypes','UserProfileResource','end','stack','name','send','index','map','ContactItemType','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0xb016,0x159));var _0x6b01=function(_0x15f1cb,_0x2f9f9f){_0x15f1cb=_0x15f1cb-0x0;var _0xfd8bb4=_0xb016[_0x15f1cb];return _0xfd8bb4;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){var _0x2ae85e=_0x399808[_0x6b01('0x23')]({'plain':!![]});var _0x2456e9=_0x6b01('0x24');return db[_0x6b01('0x25')][_0x6b01('0x22')]({'where':{'type':_0x2456e9,'resourceId':_0x2ae85e['id']}})[_0x6b01('0x21')](function(){return _0x399808;});})[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x26')]();});}};}function handleEntityNotFound(_0x55ca4b,_0x33d95d){return function(_0x220efb){if(!_0x220efb){_0x55ca4b[_0x6b01('0x15')](0x194);}return _0x220efb;};}function handleError(_0x21f165,_0x68491){_0x68491=_0x68491||0x1f4;return function(_0x528cbd){logger['error'](_0x528cbd[_0x6b01('0x27')]);if(_0x528cbd[_0x6b01('0x28')]){delete _0x528cbd[_0x6b01('0x28')];}_0x21f165[_0x6b01('0x16')](_0x68491)[_0x6b01('0x29')](_0x528cbd);};}exports[_0x6b01('0x2a')]=function(_0x542ca0,_0x39f193){var _0x5482a8={},_0x3942d7={},_0x4e7e32={'count':0x0,'rows':[]};var _0x6920cf=_[_0x6b01('0x2b')](db[_0x6b01('0x2c')][_0x6b01('0x2d')],function(_0x3c8009){return{'name':_0x3c8009['fieldName'],'type':_0x3c8009[_0x6b01('0x2e')][_0x6b01('0x2f')]};});_0x3942d7[_0x6b01('0x30')]=_['map'](_0x6920cf,'name');_0x3942d7[_0x6b01('0x31')]=_['keys'](_0x542ca0[_0x6b01('0x31')]);_0x3942d7[_0x6b01('0x32')]=_[_0x6b01('0x33')](_0x3942d7['model'],_0x3942d7[_0x6b01('0x31')]);_0x5482a8[_0x6b01('0x34')]=_[_0x6b01('0x33')](_0x3942d7['model'],qs[_0x6b01('0x35')](_0x542ca0[_0x6b01('0x31')][_0x6b01('0x35')]));_0x5482a8[_0x6b01('0x34')]=_0x5482a8[_0x6b01('0x34')]['length']?_0x5482a8[_0x6b01('0x34')]:_0x3942d7[_0x6b01('0x30')];if(!_0x542ca0[_0x6b01('0x31')][_0x6b01('0x36')](_0x6b01('0x37'))){_0x5482a8[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x542ca0[_0x6b01('0x31')]['limit']);_0x5482a8[_0x6b01('0x18')]=qs['offset'](_0x542ca0[_0x6b01('0x31')][_0x6b01('0x18')]);}_0x5482a8[_0x6b01('0x38')]=qs[_0x6b01('0x39')](_0x542ca0[_0x6b01('0x31')][_0x6b01('0x39')]);_0x5482a8[_0x6b01('0x3a')]=qs['filters'](_[_0x6b01('0x3b')](_0x542ca0[_0x6b01('0x31')],_0x3942d7[_0x6b01('0x32')]),_0x6920cf);if(_0x542ca0[_0x6b01('0x31')][_0x6b01('0x3c')]){_0x5482a8[_0x6b01('0x3a')]=_[_0x6b01('0x3d')](_0x5482a8[_0x6b01('0x3a')],{'$or':_['map'](_0x6920cf,function(_0x2c42c3){if(_0x2c42c3['type']!==_0x6b01('0x3e')){var _0x422c38={};_0x422c38[_0x2c42c3['name']]={'$like':'%'+_0x542ca0[_0x6b01('0x31')][_0x6b01('0x3c')]+'%'};return _0x422c38;}})});}_0x5482a8=_[_0x6b01('0x3d')]({},_0x5482a8,_0x542ca0[_0x6b01('0x3f')]);var _0x2d4125={'where':_0x5482a8[_0x6b01('0x3a')]};return db[_0x6b01('0x2c')][_0x6b01('0x1b')](_0x2d4125)[_0x6b01('0x21')](function(_0x17f335){_0x4e7e32['count']=_0x17f335;if(_0x542ca0[_0x6b01('0x31')][_0x6b01('0x40')]){_0x5482a8['include']=[{'all':!![]}];}return db['ContactItemType'][_0x6b01('0x41')](_0x5482a8);})[_0x6b01('0x21')](function(_0x558ec1){_0x4e7e32[_0x6b01('0x42')]=_0x558ec1;return _0x4e7e32;})[_0x6b01('0x21')](respondWithFilteredResult(_0x39f193,_0x5482a8))['catch'](handleError(_0x39f193,null));};exports[_0x6b01('0x43')]=function(_0x5e6f28,_0x2ab117){var _0x1c6eba={'raw':!![],'where':{'id':_0x5e6f28['params']['id']}},_0xf52992={};_0xf52992[_0x6b01('0x30')]=_[_0x6b01('0x44')](db['ContactItemType']['rawAttributes']);_0xf52992['query']=_[_0x6b01('0x44')](_0x5e6f28[_0x6b01('0x31')]);_0xf52992[_0x6b01('0x32')]=_[_0x6b01('0x33')](_0xf52992[_0x6b01('0x30')],_0xf52992[_0x6b01('0x31')]);_0x1c6eba['attributes']=_[_0x6b01('0x33')](_0xf52992[_0x6b01('0x30')],qs[_0x6b01('0x35')](_0x5e6f28[_0x6b01('0x31')][_0x6b01('0x35')]));_0x1c6eba[_0x6b01('0x34')]=_0x1c6eba['attributes'][_0x6b01('0x45')]?_0x1c6eba['attributes']:_0xf52992['model'];if(_0x5e6f28[_0x6b01('0x31')][_0x6b01('0x40')]){_0x1c6eba['include']=[{'all':!![]}];}_0x1c6eba=_[_0x6b01('0x3d')]({},_0x1c6eba,_0x5e6f28[_0x6b01('0x3f')]);return db[_0x6b01('0x2c')]['find'](_0x1c6eba)['then'](handleEntityNotFound(_0x2ab117,null))['then'](respondWithResult(_0x2ab117,null))[_0x6b01('0x46')](handleError(_0x2ab117,null));};exports[_0x6b01('0x47')]=function(_0x518d94,_0x34cef6){return db['ContactItemType']['create'](_0x518d94['body'],{})[_0x6b01('0x21')](function(_0x45288a){var _0x4baef8=_0x518d94['user'][_0x6b01('0x23')]({'plain':!![]});if(!_0x4baef8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4baef8[_0x6b01('0x48')]===_0x6b01('0x49')){var _0x32d446=_0x45288a[_0x6b01('0x23')]({'plain':!![]});var _0x13f6d7='ContactItemTypes';return db[_0x6b01('0x4a')][_0x6b01('0x4b')]({'where':{'name':_0x13f6d7,'userProfileId':_0x4baef8[_0x6b01('0x4c')]},'raw':!![]})['then'](function(_0x3884e){if(_0x3884e&&_0x3884e[_0x6b01('0x4d')]===0x0){return db['UserProfileResource'][_0x6b01('0x47')]({'name':_0x32d446[_0x6b01('0x28')],'resourceId':_0x32d446['id'],'type':_0x3884e[_0x6b01('0x28')],'sectionId':_0x3884e['id']},{})[_0x6b01('0x21')](function(){return _0x45288a;});}else{return _0x45288a;}})['catch'](function(_0x5d46e7){logger[_0x6b01('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d46e7);throw _0x5d46e7;});}return _0x45288a;})['then'](respondWithResult(_0x34cef6,0xc9))[_0x6b01('0x46')](handleError(_0x34cef6,null));};exports[_0x6b01('0x4f')]=function(_0x5b5c0c,_0x2bf4b5){if(_0x5b5c0c[_0x6b01('0x50')]['id']){delete _0x5b5c0c['body']['id'];}return db[_0x6b01('0x2c')][_0x6b01('0x4b')]({'where':{'id':_0x5b5c0c[_0x6b01('0x51')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x2bf4b5,null))[_0x6b01('0x21')](saveUpdates(_0x5b5c0c['body'],null))[_0x6b01('0x21')](respondWithResult(_0x2bf4b5,null))['catch'](handleError(_0x2bf4b5,null));};exports[_0x6b01('0x22')]=function(_0x331815,_0x415fdd){return db['ContactItemType'][_0x6b01('0x4b')]({'where':{'id':_0x331815[_0x6b01('0x51')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x415fdd,null))[_0x6b01('0x21')](db['CmContactHasItem'][_0x6b01('0x4f')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x331815[_0x6b01('0x51')]['id']}}))[_0x6b01('0x21')](removeEntity(_0x415fdd,null))['catch'](handleError(_0x415fdd,null));}; \ No newline at end of file +var _0xd943=['nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','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','get','ContactItemTypes','UserProfileResource','end','stack','index','ContactItemType','rawAttributes','fieldName','key','map','name','query','filters','intersection','attributes','model','fields','length','hasOwnProperty'];(function(_0x246148,_0x1358ee){var _0x453d94=function(_0x59920e){while(--_0x59920e){_0x246148['push'](_0x246148['shift']());}};_0x453d94(++_0x1358ee);}(_0xd943,0x15d));var _0x3d94=function(_0x599034,_0x347cbd){_0x599034=_0x599034-0x0;var _0x2edd06=_0xd943[_0x599034];return _0x2edd06;};'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(){var _0x18f58c=_0x295493[_0x3d94('0x24')]({'plain':!![]});var _0x192839=_0x3d94('0x25');return db[_0x3d94('0x26')][_0x3d94('0x23')]({'where':{'type':_0x192839,'resourceId':_0x18f58c['id']}})['then'](function(){return _0x295493;});})[_0x3d94('0x22')](function(){_0x395133['status'](0xcc)[_0x3d94('0x27')]();});}};}function handleEntityNotFound(_0x1d0a7a,_0xc2885){return function(_0x439173){if(!_0x439173){_0x1d0a7a[_0x3d94('0x16')](0x194);}return _0x439173;};}function handleError(_0x82b568,_0x401857){_0x401857=_0x401857||0x1f4;return function(_0x47d6ab){logger['error'](_0x47d6ab[_0x3d94('0x28')]);if(_0x47d6ab['name']){delete _0x47d6ab['name'];}_0x82b568[_0x3d94('0x17')](_0x401857)['send'](_0x47d6ab);};}exports[_0x3d94('0x29')]=function(_0xef9644,_0x32403a){var _0x4cef9c={},_0x2a07b4={},_0x4c1237={'count':0x0,'rows':[]};var _0x3d4994=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x29b1ff){return{'name':_0x29b1ff[_0x3d94('0x2c')],'type':_0x29b1ff['type'][_0x3d94('0x2d')]};});_0x2a07b4['model']=_[_0x3d94('0x2e')](_0x3d4994,_0x3d94('0x2f'));_0x2a07b4['query']=_['keys'](_0xef9644[_0x3d94('0x30')]);_0x2a07b4[_0x3d94('0x31')]=_[_0x3d94('0x32')](_0x2a07b4['model'],_0x2a07b4[_0x3d94('0x30')]);_0x4cef9c[_0x3d94('0x33')]=_['intersection'](_0x2a07b4[_0x3d94('0x34')],qs[_0x3d94('0x35')](_0xef9644[_0x3d94('0x30')][_0x3d94('0x35')]));_0x4cef9c[_0x3d94('0x33')]=_0x4cef9c['attributes'][_0x3d94('0x36')]?_0x4cef9c[_0x3d94('0x33')]:_0x2a07b4[_0x3d94('0x34')];if(!_0xef9644[_0x3d94('0x30')][_0x3d94('0x37')](_0x3d94('0x38'))){_0x4cef9c['limit']=qs['limit'](_0xef9644[_0x3d94('0x30')][_0x3d94('0x1b')]);_0x4cef9c[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0xef9644[_0x3d94('0x30')][_0x3d94('0x19')]);}_0x4cef9c[_0x3d94('0x39')]=qs[_0x3d94('0x3a')](_0xef9644[_0x3d94('0x30')][_0x3d94('0x3a')]);_0x4cef9c['where']=qs[_0x3d94('0x31')](_[_0x3d94('0x3b')](_0xef9644[_0x3d94('0x30')],_0x2a07b4[_0x3d94('0x31')]),_0x3d4994);if(_0xef9644['query'][_0x3d94('0x3c')]){_0x4cef9c[_0x3d94('0x3d')]=_[_0x3d94('0x3e')](_0x4cef9c[_0x3d94('0x3d')],{'$or':_[_0x3d94('0x2e')](_0x3d4994,function(_0x4b5a1a){if(_0x4b5a1a[_0x3d94('0x3f')]!==_0x3d94('0x40')){var _0x1d3d41={};_0x1d3d41[_0x4b5a1a['name']]={'$like':'%'+_0xef9644['query']['filter']+'%'};return _0x1d3d41;}})});}_0x4cef9c=_['merge']({},_0x4cef9c,_0xef9644[_0x3d94('0x41')]);var _0x22f52c={'where':_0x4cef9c[_0x3d94('0x3d')]};return db[_0x3d94('0x2a')][_0x3d94('0x1c')](_0x22f52c)[_0x3d94('0x22')](function(_0x3a3898){_0x4c1237['count']=_0x3a3898;if(_0xef9644['query'][_0x3d94('0x42')]){_0x4cef9c[_0x3d94('0x43')]=[{'all':!![]}];}return db['ContactItemType'][_0x3d94('0x44')](_0x4cef9c);})['then'](function(_0x1361fb){_0x4c1237[_0x3d94('0x45')]=_0x1361fb;return _0x4c1237;})[_0x3d94('0x22')](respondWithFilteredResult(_0x32403a,_0x4cef9c))[_0x3d94('0x46')](handleError(_0x32403a,null));};exports[_0x3d94('0x47')]=function(_0x5a9263,_0x3e0da8){var _0x168771={'raw':!![],'where':{'id':_0x5a9263['params']['id']}},_0x18a70c={};_0x18a70c[_0x3d94('0x34')]=_['keys'](db['ContactItemType'][_0x3d94('0x2b')]);_0x18a70c[_0x3d94('0x30')]=_[_0x3d94('0x48')](_0x5a9263[_0x3d94('0x30')]);_0x18a70c['filters']=_[_0x3d94('0x32')](_0x18a70c['model'],_0x18a70c[_0x3d94('0x30')]);_0x168771[_0x3d94('0x33')]=_[_0x3d94('0x32')](_0x18a70c[_0x3d94('0x34')],qs[_0x3d94('0x35')](_0x5a9263[_0x3d94('0x30')][_0x3d94('0x35')]));_0x168771['attributes']=_0x168771[_0x3d94('0x33')][_0x3d94('0x36')]?_0x168771['attributes']:_0x18a70c['model'];if(_0x5a9263[_0x3d94('0x30')][_0x3d94('0x42')]){_0x168771['include']=[{'all':!![]}];}_0x168771=_[_0x3d94('0x3e')]({},_0x168771,_0x5a9263[_0x3d94('0x41')]);return db[_0x3d94('0x2a')][_0x3d94('0x49')](_0x168771)[_0x3d94('0x22')](handleEntityNotFound(_0x3e0da8,null))[_0x3d94('0x22')](respondWithResult(_0x3e0da8,null))[_0x3d94('0x46')](handleError(_0x3e0da8,null));};exports[_0x3d94('0x4a')]=function(_0x60279f,_0x2429bc){return db[_0x3d94('0x2a')][_0x3d94('0x4a')](_0x60279f[_0x3d94('0x4b')],{})[_0x3d94('0x22')](function(_0xbe50d0){var _0x49209b=_0x60279f[_0x3d94('0x4c')][_0x3d94('0x24')]({'plain':!![]});if(!_0x49209b)throw new Error(_0x3d94('0x4d'));if(_0x49209b[_0x3d94('0x4e')]===_0x3d94('0x4c')){var _0x3ce0be=_0xbe50d0[_0x3d94('0x24')]({'plain':!![]});var _0x33db0a=_0x3d94('0x25');return db['UserProfileSection'][_0x3d94('0x49')]({'where':{'name':_0x33db0a,'userProfileId':_0x49209b['userProfileId']},'raw':!![]})[_0x3d94('0x22')](function(_0x3a7eb0){if(_0x3a7eb0&&_0x3a7eb0['autoAssociation']===0x0){return db[_0x3d94('0x26')]['create']({'name':_0x3ce0be['name'],'resourceId':_0x3ce0be['id'],'type':_0x3a7eb0[_0x3d94('0x2f')],'sectionId':_0x3a7eb0['id']},{})['then'](function(){return _0xbe50d0;});}else{return _0xbe50d0;}})[_0x3d94('0x46')](function(_0x132e0b){logger['error'](_0x3d94('0x4f'),_0x132e0b);throw _0x132e0b;});}return _0xbe50d0;})['then'](respondWithResult(_0x2429bc,0xc9))['catch'](handleError(_0x2429bc,null));};exports[_0x3d94('0x21')]=function(_0x1fb53e,_0xa9f159){if(_0x1fb53e[_0x3d94('0x4b')]['id']){delete _0x1fb53e[_0x3d94('0x4b')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x49')]({'where':{'id':_0x1fb53e[_0x3d94('0x50')]['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0xa9f159,null))['then'](saveUpdates(_0x1fb53e[_0x3d94('0x4b')],null))[_0x3d94('0x22')](respondWithResult(_0xa9f159,null))[_0x3d94('0x46')](handleError(_0xa9f159,null));};exports[_0x3d94('0x23')]=function(_0xe7d1dc,_0x3e1992){return db[_0x3d94('0x2a')][_0x3d94('0x49')]({'where':{'id':_0xe7d1dc[_0x3d94('0x50')]['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x3e1992,null))[_0x3d94('0x22')](db['CmContactHasItem'][_0x3d94('0x21')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0xe7d1dc['params']['id']}}))[_0x3d94('0x22')](removeEntity(_0x3e1992,null))[_0x3d94('0x46')](handleError(_0x3e1992,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 410bcad..4c5a68d 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e8b=['exports','define','ContactItemType','tools_contact_item_types','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes'];(function(_0x3f3ad1,_0x30e382){var _0x56e3e7=function(_0x542a53){while(--_0x542a53){_0x3f3ad1['push'](_0x3f3ad1['shift']());}};_0x56e3e7(++_0x30e382);}(_0x0e8b,0x1f2));var _0xb0e8=function(_0x1da84f,_0x2e8fb1){_0x1da84f=_0x1da84f-0x0;var _0x28d11e=_0x0e8b[_0x1da84f];return _0x28d11e;};'use strict';var _=require('lodash');var util=require(_0xb0e8('0x0'));var logger=require(_0xb0e8('0x1'))(_0xb0e8('0x2'));var moment=require('moment');var BPromise=require(_0xb0e8('0x3'));var rp=require(_0xb0e8('0x4'));var fs=require('fs');var path=require(_0xb0e8('0x5'));var rimraf=require(_0xb0e8('0x6'));var config=require(_0xb0e8('0x7'));var attributes=require(_0xb0e8('0x8'));module[_0xb0e8('0x9')]=function(_0x4bea2d,_0x504aa4){return _0x4bea2d[_0xb0e8('0xa')](_0xb0e8('0xb'),attributes,{'tableName':_0xb0e8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x550e=['define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./contactItemType.attributes'];(function(_0x59dca3,_0x5ade34){var _0x1f2aba=function(_0xadaa62){while(--_0xadaa62){_0x59dca3['push'](_0x59dca3['shift']());}};_0x1f2aba(++_0x5ade34);}(_0x550e,0x162));var _0xe550=function(_0x2e1036,_0x2af8e0){_0x2e1036=_0x2e1036-0x0;var _0x47c474=_0x550e[_0x2e1036];return _0x47c474;};'use strict';var _=require(_0xe550('0x0'));var util=require(_0xe550('0x1'));var logger=require(_0xe550('0x2'))(_0xe550('0x3'));var moment=require(_0xe550('0x4'));var BPromise=require(_0xe550('0x5'));var rp=require(_0xe550('0x6'));var fs=require('fs');var path=require(_0xe550('0x7'));var rimraf=require(_0xe550('0x8'));var config=require('../../config/environment');var attributes=require(_0xe550('0x9'));module['exports']=function(_0x520701,_0x17c5fc){return _0x520701[_0xe550('0xa')](_0xe550('0xb'),attributes,{'tableName':_0xe550('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index b3c4ff6..b78cceb 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfaec=['moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ContactItemType,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util'];(function(_0x12fe27,_0x47e1c4){var _0x1749cb=function(_0x4cd481){while(--_0x4cd481){_0x12fe27['push'](_0x12fe27['shift']());}};_0x1749cb(++_0x47e1c4);}(_0xfaec,0x139));var _0xcfae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfaec[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcfae('0x0'));var util=require(_0xcfae('0x1'));var moment=require(_0xcfae('0x2'));var BPromise=require('bluebird');var rs=require(_0xcfae('0x3'));var fs=require('fs');var Redis=require(_0xcfae('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcfae('0x5'))(_0xcfae('0x6'));var config=require(_0xcfae('0x7'));var jayson=require(_0xcfae('0x8'));var client=jayson[_0xcfae('0x9')][_0xcfae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x345e43,_0x32bbb9,_0x333162){return new BPromise(function(_0x56a4c6,_0x2ea7e9){return client[_0xcfae('0xb')](_0x345e43,_0x333162)[_0xcfae('0xc')](function(_0x2eea0e){logger['info'](_0xcfae('0xd'),_0x32bbb9,_0xcfae('0xe'));logger['debug']('ContactItemType,\x20%s,\x20%s,\x20%s',_0x32bbb9,_0xcfae('0xe'),JSON['stringify'](_0x2eea0e));if(_0x2eea0e[_0xcfae('0xf')]){if(_0x2eea0e[_0xcfae('0xf')][_0xcfae('0x10')]===0x1f4){logger[_0xcfae('0xf')]('ContactItemType,\x20%s,\x20%s',_0x32bbb9,_0x2eea0e[_0xcfae('0xf')]['message']);return _0x2ea7e9(_0x2eea0e[_0xcfae('0xf')][_0xcfae('0x11')]);}logger['error'](_0xcfae('0xd'),_0x32bbb9,_0x2eea0e['error'][_0xcfae('0x11')]);return _0x56a4c6(_0x2eea0e[_0xcfae('0xf')][_0xcfae('0x11')]);}else{logger[_0xcfae('0x12')]('ContactItemType,\x20%s,\x20%s',_0x32bbb9,'request\x20sent');_0x56a4c6(_0x2eea0e[_0xcfae('0x13')][_0xcfae('0x11')]);}})[_0xcfae('0x14')](function(_0x463351){logger[_0xcfae('0xf')](_0xcfae('0xd'),_0x32bbb9,_0x463351);_0x2ea7e9(_0x463351);});});} \ No newline at end of file +var _0xce33=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0xffa654,_0x4c734){var _0x5dd847=function(_0x64173a){while(--_0x64173a){_0xffa654['push'](_0xffa654['shift']());}};_0x5dd847(++_0x4c734);}(_0xce33,0x1f3));var _0x3ce3=function(_0x5c92a4,_0x819c46){_0x5c92a4=_0x5c92a4-0x0;var _0x2007e7=_0xce33[_0x5c92a4];return _0x2007e7;};'use strict';var _=require('lodash');var util=require(_0x3ce3('0x0'));var moment=require(_0x3ce3('0x1'));var BPromise=require(_0x3ce3('0x2'));var rs=require(_0x3ce3('0x3'));var fs=require('fs');var Redis=require(_0x3ce3('0x4'));var db=require(_0x3ce3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ce3('0x6'))(_0x3ce3('0x7'));var config=require(_0x3ce3('0x8'));var jayson=require(_0x3ce3('0x9'));var client=jayson[_0x3ce3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x205ba,_0x289739,_0x923bc3){return new BPromise(function(_0x5f32dd,_0x31c9ef){return client['request'](_0x205ba,_0x923bc3)['then'](function(_0x15b20b){logger['info'](_0x3ce3('0xb'),_0x289739,_0x3ce3('0xc'));logger[_0x3ce3('0xd')](_0x3ce3('0xe'),_0x289739,_0x3ce3('0xc'),JSON[_0x3ce3('0xf')](_0x15b20b));if(_0x15b20b[_0x3ce3('0x10')]){if(_0x15b20b[_0x3ce3('0x10')][_0x3ce3('0x11')]===0x1f4){logger[_0x3ce3('0x10')]('ContactItemType,\x20%s,\x20%s',_0x289739,_0x15b20b[_0x3ce3('0x10')][_0x3ce3('0x12')]);return _0x31c9ef(_0x15b20b['error'][_0x3ce3('0x12')]);}logger[_0x3ce3('0x10')]('ContactItemType,\x20%s,\x20%s',_0x289739,_0x15b20b[_0x3ce3('0x10')][_0x3ce3('0x12')]);return _0x5f32dd(_0x15b20b['error'][_0x3ce3('0x12')]);}else{logger[_0x3ce3('0x13')](_0x3ce3('0xb'),_0x289739,_0x3ce3('0xc'));_0x5f32dd(_0x15b20b['result']['message']);}})[_0x3ce3('0x14')](function(_0x56e8b3){logger[_0x3ce3('0x10')](_0x3ce3('0xb'),_0x289739,_0x56e8b3);_0x31c9ef(_0x56e8b3);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index b4fd030..a10f00c 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1550=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x74895e,_0x298c35){var _0x40bc2a=function(_0x558c6d){while(--_0x558c6d){_0x74895e['push'](_0x74895e['shift']());}};_0x40bc2a(++_0x298c35);}(_0x1550,0x1b8));var _0x0155=function(_0x41992f,_0x39f0c6){_0x41992f=_0x41992f-0x0;var _0xc92d25=_0x1550[_0x41992f];return _0xc92d25;};'use strict';var multer=require('multer');var util=require(_0x0155('0x0'));var path=require('path');var timeout=require(_0x0155('0x1'));var express=require(_0x0155('0x2'));var router=express[_0x0155('0x3')]();var fs_extra=require(_0x0155('0x4'));var auth=require(_0x0155('0x5'));var interaction=require(_0x0155('0x6'));var config=require('../../config/environment');var controller=require(_0x0155('0x7'));router[_0x0155('0x8')]('/',auth[_0x0155('0x9')](),controller[_0x0155('0xa')]);router[_0x0155('0x8')](_0x0155('0xb'),auth[_0x0155('0x9')](),controller[_0x0155('0xc')]);router[_0x0155('0xd')]('/',auth[_0x0155('0x9')](),controller['create']);router[_0x0155('0xe')](_0x0155('0xb'),auth['isAuthenticated'](),controller[_0x0155('0xf')]);router[_0x0155('0x10')](_0x0155('0xb'),auth[_0x0155('0x9')](),controller[_0x0155('0x11')]);module[_0x0155('0x12')]=router; \ No newline at end of file +var _0xea35=['delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xea35,0x8e));var _0x5ea3=function(_0x1f01a7,_0x473999){_0x1f01a7=_0x1f01a7-0x0;var _0x220c65=_0xea35[_0x1f01a7];return _0x220c65;};'use strict';var multer=require(_0x5ea3('0x0'));var util=require(_0x5ea3('0x1'));var path=require(_0x5ea3('0x2'));var timeout=require(_0x5ea3('0x3'));var express=require('express');var router=express[_0x5ea3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ea3('0x5'));var interaction=require(_0x5ea3('0x6'));var config=require(_0x5ea3('0x7'));var controller=require(_0x5ea3('0x8'));router[_0x5ea3('0x9')]('/',auth[_0x5ea3('0xa')](),controller[_0x5ea3('0xb')]);router[_0x5ea3('0x9')](_0x5ea3('0xc'),auth['isAuthenticated'](),controller[_0x5ea3('0xd')]);router[_0x5ea3('0xe')]('/',auth['isAuthenticated'](),controller[_0x5ea3('0xf')]);router[_0x5ea3('0x10')]('/:id',auth[_0x5ea3('0xa')](),controller[_0x5ea3('0x11')]);router[_0x5ea3('0x12')](_0x5ea3('0xc'),auth[_0x5ea3('0xa')](),controller['destroy']);module[_0x5ea3('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 4c7830f..a932a10 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 _0xbaf0=['name','exports','STRING'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'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 +var _0xd8b0=['exports','sequelize'];(function(_0x33f4bf,_0x466cd1){var _0x2b51e1=function(_0x5ccca4){while(--_0x5ccca4){_0x33f4bf['push'](_0x33f4bf['shift']());}};_0x2b51e1(++_0x466cd1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index dce952f..8f9ec6b 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 _0x73d3=['filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','find','role','userProfileId','autoAssociation','UserProfileResource','create','omit','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboard.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','get','CustomDashboards','error','stack','name','send','index','map','Dashboard','fieldName','type','key','model','query','keys'];(function(_0x6b05b7,_0x3a4392){var _0x3af625=function(_0x5e5cc3){while(--_0x5e5cc3){_0x6b05b7['push'](_0x6b05b7['shift']());}};_0x3af625(++_0x3a4392);}(_0x73d3,0x145));var _0x373d=function(_0xa62c01,_0x489575){_0xa62c01=_0xa62c01-0x0;var _0x4eb9da=_0x73d3[_0xa62c01];return _0x4eb9da;};'use strict';var emlformat=require(_0x373d('0x0'));var rimraf=require(_0x373d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x373d('0x2'));var moment=require(_0x373d('0x3'));var BPromise=require(_0x373d('0x4'));var Mustache=require(_0x373d('0x5'));var util=require(_0x373d('0x6'));var path=require(_0x373d('0x7'));var sox=require('sox');var csv=require(_0x373d('0x8'));var ejs=require(_0x373d('0x9'));var fs=require('fs');var fs_extra=require(_0x373d('0xa'));var _=require(_0x373d('0xb'));var squel=require(_0x373d('0xc'));var crypto=require('crypto');var jsforce=require(_0x373d('0xd'));var deskjs=require(_0x373d('0xe'));var toCsv=require(_0x373d('0x8'));var querystring=require(_0x373d('0xf'));var Papa=require(_0x373d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x373d('0x11'));var as=require(_0x373d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x373d('0x13'));var utils=require(_0x373d('0x14'));var config=require(_0x373d('0x15'));var licenseUtil=require(_0x373d('0x16'));var db=require(_0x373d('0x17'))['db'];config[_0x373d('0x18')]=_[_0x373d('0x19')](config['redis'],{'host':_0x373d('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x373d('0x18')]));require(_0x373d('0x1b'))['register'](socket);function respondWithStatusCode(_0x26cb2b,_0x436c9b){_0x436c9b=_0x436c9b||0xcc;return function(_0x493990){if(_0x493990){return _0x26cb2b[_0x373d('0x1c')](_0x436c9b);}return _0x26cb2b[_0x373d('0x1d')](_0x436c9b)[_0x373d('0x1e')]();};}function respondWithResult(_0x291f62,_0x1aaf69){_0x1aaf69=_0x1aaf69||0xc8;return function(_0x367345){if(_0x367345){return _0x291f62[_0x373d('0x1d')](_0x1aaf69)[_0x373d('0x1f')](_0x367345);}};}function respondWithFilteredResult(_0x48038b,_0x4b439b){return function(_0x3dbad5){if(_0x3dbad5){var _0x28afc6=typeof _0x4b439b[_0x373d('0x20')]==='undefined'&&typeof _0x4b439b[_0x373d('0x21')]===_0x373d('0x22');var _0x57c129=_0x3dbad5[_0x373d('0x23')];var _0x2a0876=_0x28afc6?0x0:_0x4b439b[_0x373d('0x20')];var _0x125497=_0x28afc6?_0x3dbad5[_0x373d('0x23')]:_0x4b439b['offset']+_0x4b439b[_0x373d('0x21')];var _0x591cbe;if(_0x125497>=_0x57c129){_0x125497=_0x57c129;_0x591cbe=0xc8;}else{_0x591cbe=0xce;}_0x48038b[_0x373d('0x1d')](_0x591cbe);return _0x48038b[_0x373d('0x24')](_0x373d('0x25'),_0x2a0876+'-'+_0x125497+'/'+_0x57c129)[_0x373d('0x1f')](_0x3dbad5);}return null;};}function patchUpdates(_0x85551a){return function(_0xc7bd66){try{jsonpatch[_0x373d('0x26')](_0xc7bd66,_0x85551a,!![]);}catch(_0x1800a7){return BPromise['reject'](_0x1800a7);}return _0xc7bd66[_0x373d('0x27')]();};}function saveUpdates(_0x10ebd6,_0x48324e){return function(_0x55d3f8){if(_0x55d3f8){return _0x55d3f8['update'](_0x10ebd6)[_0x373d('0x28')](function(_0x5413b9){return _0x5413b9;});}return null;};}function removeEntity(_0x326fae,_0x24531f){return function(_0x3f24d7){if(_0x3f24d7){return _0x3f24d7['destroy']()[_0x373d('0x28')](function(){var _0x19f17c=_0x3f24d7[_0x373d('0x29')]({'plain':!![]});var _0x145229=_0x373d('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x145229,'resourceId':_0x19f17c['id']}})[_0x373d('0x28')](function(){return _0x3f24d7;});})[_0x373d('0x28')](function(){_0x326fae['status'](0xcc)[_0x373d('0x1e')]();});}};}function handleEntityNotFound(_0x533d36,_0x6d5939){return function(_0x44e9e1){if(!_0x44e9e1){_0x533d36[_0x373d('0x1c')](0x194);}return _0x44e9e1;};}function handleError(_0x1d0af7,_0x278dc1){_0x278dc1=_0x278dc1||0x1f4;return function(_0x320160){logger[_0x373d('0x2b')](_0x320160[_0x373d('0x2c')]);if(_0x320160['name']){delete _0x320160[_0x373d('0x2d')];}_0x1d0af7['status'](_0x278dc1)[_0x373d('0x2e')](_0x320160);};}exports[_0x373d('0x2f')]=function(_0x93f5a4,_0x48ef5f){var _0x5df5a8={},_0x3592c3={},_0xceb5f={'count':0x0,'rows':[]};var _0x391955=_[_0x373d('0x30')](db[_0x373d('0x31')]['rawAttributes'],function(_0x3746c2){return{'name':_0x3746c2[_0x373d('0x32')],'type':_0x3746c2[_0x373d('0x33')][_0x373d('0x34')]};});_0x3592c3[_0x373d('0x35')]=_[_0x373d('0x30')](_0x391955,_0x373d('0x2d'));_0x3592c3[_0x373d('0x36')]=_[_0x373d('0x37')](_0x93f5a4['query']);_0x3592c3[_0x373d('0x38')]=_['intersection'](_0x3592c3[_0x373d('0x35')],_0x3592c3['query']);_0x5df5a8[_0x373d('0x39')]=_['intersection'](_0x3592c3[_0x373d('0x35')],qs[_0x373d('0x3a')](_0x93f5a4[_0x373d('0x36')]['fields']));_0x5df5a8['attributes']=_0x5df5a8[_0x373d('0x39')][_0x373d('0x3b')]?_0x5df5a8[_0x373d('0x39')]:_0x3592c3[_0x373d('0x35')];if(!_0x93f5a4['query'][_0x373d('0x3c')](_0x373d('0x3d'))){_0x5df5a8['limit']=qs[_0x373d('0x21')](_0x93f5a4[_0x373d('0x36')][_0x373d('0x21')]);_0x5df5a8[_0x373d('0x20')]=qs[_0x373d('0x20')](_0x93f5a4[_0x373d('0x36')]['offset']);}_0x5df5a8[_0x373d('0x3e')]=qs[_0x373d('0x3f')](_0x93f5a4[_0x373d('0x36')][_0x373d('0x3f')]);_0x5df5a8[_0x373d('0x40')]=qs[_0x373d('0x38')](_[_0x373d('0x41')](_0x93f5a4[_0x373d('0x36')],_0x3592c3['filters']),_0x391955);if(_0x93f5a4[_0x373d('0x36')][_0x373d('0x42')]){_0x5df5a8['where']=_[_0x373d('0x43')](_0x5df5a8[_0x373d('0x40')],{'$or':_['map'](_0x391955,function(_0x2ff54b){if(_0x2ff54b[_0x373d('0x33')]!==_0x373d('0x44')){var _0x1ffa3f={};_0x1ffa3f[_0x2ff54b[_0x373d('0x2d')]]={'$like':'%'+_0x93f5a4[_0x373d('0x36')][_0x373d('0x42')]+'%'};return _0x1ffa3f;}})});}_0x5df5a8=_['merge']({},_0x5df5a8,_0x93f5a4[_0x373d('0x45')]);var _0xf79cf7={'where':_0x5df5a8[_0x373d('0x40')]};return db[_0x373d('0x31')][_0x373d('0x23')](_0xf79cf7)[_0x373d('0x28')](function(_0x34ee9d){_0xceb5f[_0x373d('0x23')]=_0x34ee9d;if(_0x93f5a4[_0x373d('0x36')][_0x373d('0x46')]){_0x5df5a8[_0x373d('0x47')]=[{'all':!![]}];}return db['Dashboard'][_0x373d('0x48')](_0x5df5a8);})[_0x373d('0x28')](function(_0x57977d){_0xceb5f[_0x373d('0x49')]=_0x57977d;return _0xceb5f;})['then'](respondWithFilteredResult(_0x48ef5f,_0x5df5a8))[_0x373d('0x4a')](handleError(_0x48ef5f,null));};exports['show']=function(_0x4a3831,_0x271a40){var _0x2ff6c6={'raw':![],'where':{'id':_0x4a3831[_0x373d('0x4b')]['id']}},_0x26a69b={};_0x26a69b[_0x373d('0x35')]=_[_0x373d('0x37')](db[_0x373d('0x31')][_0x373d('0x4c')]);_0x26a69b['query']=_['keys'](_0x4a3831[_0x373d('0x36')]);_0x26a69b['filters']=_[_0x373d('0x4d')](_0x26a69b['model'],_0x26a69b[_0x373d('0x36')]);_0x2ff6c6['attributes']=_[_0x373d('0x4d')](_0x26a69b[_0x373d('0x35')],qs['fields'](_0x4a3831[_0x373d('0x36')]['fields']));_0x2ff6c6[_0x373d('0x39')]=_0x2ff6c6[_0x373d('0x39')][_0x373d('0x3b')]?_0x2ff6c6[_0x373d('0x39')]:_0x26a69b[_0x373d('0x35')];if(_0x4a3831[_0x373d('0x36')][_0x373d('0x46')]){_0x2ff6c6[_0x373d('0x47')]=[{'all':!![]}];}_0x2ff6c6=_['merge']({},_0x2ff6c6,_0x4a3831[_0x373d('0x45')]);return db['Dashboard'][_0x373d('0x4e')](_0x2ff6c6)[_0x373d('0x28')](handleEntityNotFound(_0x271a40,null))[_0x373d('0x28')](respondWithResult(_0x271a40,null))[_0x373d('0x4a')](handleError(_0x271a40,null));};exports['create']=function(_0x55a620,_0x1575b2){return db[_0x373d('0x31')]['create'](_0x55a620['body'],{})[_0x373d('0x28')](function(_0x4f3b6e){var _0x138069=_0x55a620['user'][_0x373d('0x29')]({'plain':!![]});if(!_0x138069)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x138069[_0x373d('0x4f')]==='user'){var _0x3c7f32=_0x4f3b6e[_0x373d('0x29')]({'plain':!![]});var _0x1c569a='CustomDashboards';return db['UserProfileSection'][_0x373d('0x4e')]({'where':{'name':_0x1c569a,'userProfileId':_0x138069[_0x373d('0x50')]},'raw':!![]})[_0x373d('0x28')](function(_0x4c519c){if(_0x4c519c&&_0x4c519c[_0x373d('0x51')]===0x0){return db[_0x373d('0x52')][_0x373d('0x53')]({'name':_0x3c7f32[_0x373d('0x2d')],'resourceId':_0x3c7f32['id'],'type':_0x4c519c['name'],'sectionId':_0x4c519c['id']},{})[_0x373d('0x28')](function(){return _0x4f3b6e;});}else{return _0x4f3b6e;}})[_0x373d('0x4a')](function(_0x1ae97e){logger[_0x373d('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ae97e);throw _0x1ae97e;});}return _0x4f3b6e;})[_0x373d('0x28')](respondWithResult(_0x1575b2,0xc9))[_0x373d('0x4a')](handleError(_0x1575b2,null));};exports['clone']=function(_0x4125fd,_0x38d5c1){var _0x221be8={'where':{'id':_0x4125fd[_0x373d('0x4b')]['id']}},_0x2e7847={};_0x2e7847['model']=_[_0x373d('0x37')](db[_0x373d('0x31')][_0x373d('0x4c')]);_0x221be8[_0x373d('0x39')]=_['intersection'](_0x2e7847[_0x373d('0x35')],qs['fields'](_0x4125fd[_0x373d('0x36')]['fields']));_0x221be8[_0x373d('0x39')]=_0x221be8['attributes'][_0x373d('0x3b')]?_0x221be8[_0x373d('0x39')]:_0x2e7847[_0x373d('0x35')];if(_0x4125fd[_0x373d('0x36')][_0x373d('0x46')]){_0x221be8[_0x373d('0x47')]=[{'all':!![]}];}_0x221be8=_[_0x373d('0x43')]({},_0x221be8,_0x4125fd[_0x373d('0x45')]);return db[_0x373d('0x31')][_0x373d('0x4e')](_0x221be8)[_0x373d('0x28')](handleEntityNotFound(_0x38d5c1,null))[_0x373d('0x28')](function(_0x17f4c0){if(_0x17f4c0){var _0x3738e2=_0x17f4c0[_0x373d('0x29')]({'plain':!![]});_0x3738e2=qs[_0x373d('0x54')](_0x3738e2,['id','createdAt',_0x373d('0x55')]);_0x4125fd[_0x373d('0x56')]=_[_0x373d('0x54')](_0x4125fd['body'],['id',_0x373d('0x57'),_0x373d('0x55')]);return db[_0x373d('0x31')]['create'](_[_0x373d('0x43')](_0x3738e2,_0x4125fd[_0x373d('0x56')]),{'include':_0x4125fd['query'][_0x373d('0x46')]?[{'all':!![]}]:undefined})[_0x373d('0x28')](function(_0x17727a){var _0x20f5b9=_0x4125fd['user'][_0x373d('0x29')]({'plain':!![]});if(!_0x20f5b9)throw new Error(_0x373d('0x58'));if(_0x20f5b9[_0x373d('0x4f')]==='user'){var _0x347655=_0x17727a['get']({'plain':!![]});var _0x3e98b0=_0x373d('0x2a');return db['UserProfileSection'][_0x373d('0x4e')]({'where':{'name':_0x3e98b0,'userProfileId':_0x20f5b9[_0x373d('0x50')]},'raw':!![]})[_0x373d('0x28')](function(_0xbddc12){if(_0xbddc12&&_0xbddc12[_0x373d('0x51')]===0x0){return db[_0x373d('0x52')][_0x373d('0x53')]({'name':_0x347655['name'],'resourceId':_0x347655['id'],'type':_0xbddc12[_0x373d('0x2d')],'sectionId':_0xbddc12['id']},{})[_0x373d('0x28')](function(){return _0x17727a;});}else{return _0x17727a;}})[_0x373d('0x4a')](function(_0x5ae3db){logger[_0x373d('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ae3db);throw _0x5ae3db;});}return _0x17727a;});}})[_0x373d('0x28')](respondWithResult(_0x38d5c1,0xc9))[_0x373d('0x4a')](handleError(_0x38d5c1,null));};exports[_0x373d('0x59')]=function(_0x255912,_0x1e54ba){if(_0x255912[_0x373d('0x56')]['id']){delete _0x255912[_0x373d('0x56')]['id'];}return db[_0x373d('0x31')][_0x373d('0x4e')]({'where':{'id':_0x255912[_0x373d('0x4b')]['id']}})[_0x373d('0x28')](handleEntityNotFound(_0x1e54ba,null))[_0x373d('0x28')](saveUpdates(_0x255912[_0x373d('0x56')],null))[_0x373d('0x28')](respondWithResult(_0x1e54ba,null))[_0x373d('0x4a')](handleError(_0x1e54ba,null));};exports['destroy']=function(_0x3e100b,_0x24208e){return db[_0x373d('0x31')][_0x373d('0x4e')]({'where':{'id':_0x3e100b['params']['id']}})[_0x373d('0x28')](handleEntityNotFound(_0x24208e,null))[_0x373d('0x28')](removeEntity(_0x24208e,null))[_0x373d('0x4a')](handleError(_0x24208e,null));};function widgetAttributes(_0x38c837){try{switch(_0x38c837[_0x373d('0x33')]){case _0x373d('0x5a'):return[{'name':'attrUrl','value':_0x38c837[_0x373d('0x5b')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x0]?_0x38c837['attrs'][0x0][_0x373d('0x5d')]:undefined)||'https://'}];case _0x373d('0x5e'):return[{'name':'attrPath','value':_0x38c837[_0x373d('0x5f')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x0]?_0x38c837['attrs'][0x0][_0x373d('0x5d')]:undefined)||''}];case'clock':return[{'name':_0x373d('0x60'),'value':_0x38c837['attrHourFormat']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x0]?_0x38c837['attrs'][0x0][_0x373d('0x5d')]:undefined)||_0x373d('0x61')},{'name':_0x373d('0x62'),'value':_0x38c837[_0x373d('0x62')]||(_0x38c837['attrs']&&_0x38c837[_0x373d('0x5c')][0x1]?_0x38c837['attrs'][0x1][_0x373d('0x5d')]:undefined)||_0x373d('0x63')},{'name':_0x373d('0x64'),'value':_0x38c837[_0x373d('0x64')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x2]?_0x38c837[_0x373d('0x5c')][0x2][_0x373d('0x5d')]:undefined)||0xc}];case _0x373d('0x65'):return[{'name':_0x373d('0x66'),'value':_0x38c837['attrMetric']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x0]?_0x38c837[_0x373d('0x5c')][0x0][_0x373d('0x5d')]:undefined)||_0x373d('0x67')},{'name':'attrVoiceQueues','value':_0x38c837[_0x373d('0x68')]||(_0x38c837['attrs']&&_0x38c837[_0x373d('0x5c')][0x1]?_0x38c837[_0x373d('0x5c')][0x1][_0x373d('0x5d')]:undefined)||[]},{'name':_0x373d('0x64'),'value':_0x38c837['attrFontSize']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x2]?_0x38c837[_0x373d('0x5c')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x38c837[_0x373d('0x69')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x3]?_0x38c837[_0x373d('0x5c')][0x3][_0x373d('0x5d')]:undefined)||'voice'},{'name':_0x373d('0x6a'),'value':_0x38c837[_0x373d('0x6a')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x4]?_0x38c837['attrs'][0x4]['value']:undefined)||''},{'name':_0x373d('0x6b'),'value':_0x38c837[_0x373d('0x6b')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x5]?_0x38c837[_0x373d('0x5c')][0x5][_0x373d('0x5d')]:undefined)||''},{'name':_0x373d('0x6c'),'value':_0x38c837['attrSmsAccounts']||(_0x38c837['attrs']&&_0x38c837[_0x373d('0x5c')][0x6]?_0x38c837[_0x373d('0x5c')][0x6]['value']:undefined)||''},{'name':_0x373d('0x6d'),'value':_0x38c837[_0x373d('0x6d')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x7]?_0x38c837[_0x373d('0x5c')][0x7]['value']:undefined)||''},{'name':_0x373d('0x6e'),'value':_0x38c837[_0x373d('0x6e')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x8]?_0x38c837[_0x373d('0x5c')][0x8][_0x373d('0x5d')]:undefined)||''},{'name':_0x373d('0x6f'),'value':_0x38c837[_0x373d('0x6f')]||(_0x38c837['attrs']&&_0x38c837['attrs'][0x9]?_0x38c837[_0x373d('0x5c')][0x9][_0x373d('0x5d')]:undefined)||''}];case _0x373d('0x70'):case _0x373d('0x71'):return[{'name':'attrSerie1','value':_0x38c837[_0x373d('0x72')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x0]?_0x38c837['attrs'][0x0][_0x373d('0x5d')]:undefined)||_0x373d('0x67')},{'name':_0x373d('0x73'),'value':_0x38c837[_0x373d('0x73')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x1]?_0x38c837[_0x373d('0x5c')][0x1][_0x373d('0x5d')]:undefined)||null},{'name':_0x373d('0x74'),'value':_0x38c837[_0x373d('0x74')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x2]?_0x38c837[_0x373d('0x5c')][0x2][_0x373d('0x5d')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x38c837['attrVoiceQueues']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x3]?_0x38c837[_0x373d('0x5c')][0x3][_0x373d('0x5d')]:undefined)||[]},{'name':_0x373d('0x69'),'value':_0x38c837['attrChannel']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x4]?_0x38c837[_0x373d('0x5c')][0x4]['value']:undefined)||_0x373d('0x75')},{'name':_0x373d('0x6a'),'value':_0x38c837['attrEmailAccounts']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x5]?_0x38c837[_0x373d('0x5c')][0x5][_0x373d('0x5d')]:undefined)||''},{'name':_0x373d('0x6b'),'value':_0x38c837[_0x373d('0x6b')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x6]?_0x38c837[_0x373d('0x5c')][0x6][_0x373d('0x5d')]:undefined)||''},{'name':_0x373d('0x6c'),'value':_0x38c837['attrSmsAccounts']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x7]?_0x38c837[_0x373d('0x5c')][0x7]['value']:undefined)||''},{'name':_0x373d('0x6d'),'value':_0x38c837[_0x373d('0x6d')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x8]?_0x38c837[_0x373d('0x5c')][0x8]['value']:undefined)||''},{'name':_0x373d('0x6e'),'value':_0x38c837[_0x373d('0x6e')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x9]?_0x38c837[_0x373d('0x5c')][0x9][_0x373d('0x5d')]:undefined)||''},{'name':_0x373d('0x6f'),'value':_0x38c837['attrChatWebsites']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0xa]?_0x38c837[_0x373d('0x5c')][0xa][_0x373d('0x5d')]:undefined)||''}];case _0x373d('0x76'):return[{'name':_0x373d('0x77'),'type':_0x38c837[_0x373d('0x78')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x0]?_0x38c837[_0x373d('0x5c')][0x0][_0x373d('0x33')]:undefined)||null,'value':_0x38c837[_0x373d('0x77')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x0]?_0x38c837[_0x373d('0x5c')][0x0]['value']:undefined)||null},{'name':_0x373d('0x79'),'value':_0x38c837[_0x373d('0x79')]||(_0x38c837['attrs']&&_0x38c837['attrs'][0x1]?_0x38c837['attrs'][0x1][_0x373d('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x1ba5d0){logger[_0x373d('0x2b')](_0x373d('0x7a'),JSON['stringify'](_0x1ba5d0));return[];}}exports['addItem']=function(_0x2f1857,_0x426b7c,_0xa57685){if(_0x2f1857[_0x373d('0x56')]['id']){delete _0x2f1857[_0x373d('0x56')]['id'];}return db[_0x373d('0x31')][_0x373d('0x4e')]({'where':{'id':_0x2f1857[_0x373d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x426b7c,null))[_0x373d('0x28')](function(_0x4e6ecc){if(_0x4e6ecc){_0x2f1857[_0x373d('0x56')][_0x373d('0x7b')]=_0x4e6ecc['id'];_0x2f1857[_0x373d('0x56')][_0x373d('0x5c')]=widgetAttributes(_0x2f1857[_0x373d('0x56')]);return db[_0x373d('0x7c')][_0x373d('0x53')](_0x2f1857[_0x373d('0x56')]);}})[_0x373d('0x28')](respondWithResult(_0x426b7c,null))['catch'](handleError(_0x426b7c,null));};exports[_0x373d('0x7d')]=function(_0x199056,_0x4466b5,_0x382aba){var _0x5e1b24={};var _0x4570d6={};var _0x36045f;var _0x253f45;return db[_0x373d('0x31')][_0x373d('0x7e')]({'where':{'id':_0x199056[_0x373d('0x4b')]['id']}})[_0x373d('0x28')](handleEntityNotFound(_0x4466b5,null))[_0x373d('0x28')](function(_0x13a366){if(_0x13a366){_0x36045f=_0x13a366;_0x4570d6[_0x373d('0x35')]=_[_0x373d('0x37')](db[_0x373d('0x7c')][_0x373d('0x4c')]);_0x4570d6['query']=_[_0x373d('0x37')](_0x199056[_0x373d('0x36')]);_0x4570d6[_0x373d('0x38')]=_[_0x373d('0x4d')](_0x4570d6[_0x373d('0x35')],_0x4570d6[_0x373d('0x36')]);_0x5e1b24['attributes']=_[_0x373d('0x4d')](_0x4570d6['model'],qs[_0x373d('0x3a')](_0x199056[_0x373d('0x36')][_0x373d('0x3a')]));_0x5e1b24[_0x373d('0x39')]=_0x5e1b24['attributes'][_0x373d('0x3b')]?_0x5e1b24['attributes']:_0x4570d6['model'];_0x5e1b24[_0x373d('0x3e')]=qs[_0x373d('0x3f')](_0x199056[_0x373d('0x36')][_0x373d('0x3f')]);_0x5e1b24[_0x373d('0x40')]=qs[_0x373d('0x38')](_['pick'](_0x199056[_0x373d('0x36')],_0x4570d6[_0x373d('0x38')]));if(_0x199056['query'][_0x373d('0x42')]){_0x5e1b24['where']=_[_0x373d('0x43')](_0x5e1b24[_0x373d('0x40')],{'$or':_['map'](_0x5e1b24[_0x373d('0x39')],function(_0xce4e91){var _0x5c8307={};_0x5c8307[_0xce4e91]={'$like':'%'+_0x199056[_0x373d('0x36')][_0x373d('0x42')]+'%'};return _0x5c8307;})});}_0x5e1b24=_['merge']({},_0x5e1b24,_0x199056['options']);return _0x36045f[_0x373d('0x7d')](_0x5e1b24);}})[_0x373d('0x28')](function(_0x13b2e7){if(_0x13b2e7){_0x253f45=_0x13b2e7[_0x373d('0x3b')];if(!_0x199056[_0x373d('0x36')][_0x373d('0x3c')](_0x373d('0x3d'))){_0x5e1b24['limit']=qs[_0x373d('0x21')](_0x199056['query'][_0x373d('0x21')]);_0x5e1b24['offset']=qs[_0x373d('0x20')](_0x199056[_0x373d('0x36')][_0x373d('0x20')]);}return _0x36045f['getItems'](_0x5e1b24);}})[_0x373d('0x28')](function(_0x288282){if(_0x288282){return _0x288282?{'count':_0x253f45,'rows':_0x288282}:null;}})[_0x373d('0x28')](respondWithResult(_0x4466b5,null))[_0x373d('0x4a')](handleError(_0x4466b5,null));}; \ No newline at end of file +var _0x570e=['stack','name','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','include','catch','show','params','keys','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','createdAt','updatedAt','body','update','iframe','attrUrl','attrs','value','https://','custom','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie2','attrSerie3','attrEmailAccounts','attrOpenchannelAccounts','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','order','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','then','destroy','get','CustomDashboards','UserProfileResource','end','error'];(function(_0x1baef6,_0x104b34){var _0x5f34a6=function(_0x4db449){while(--_0x4db449){_0x1baef6['push'](_0x1baef6['shift']());}};_0x5f34a6(++_0x104b34);}(_0x570e,0xd4));var _0xe570=function(_0x1226b3,_0x2e39c1){_0x1226b3=_0x1226b3-0x0;var _0x119703=_0x570e[_0x1226b3];return _0x119703;};'use strict';var emlformat=require(_0xe570('0x0'));var rimraf=require(_0xe570('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe570('0x2'));var rp=require(_0xe570('0x3'));var moment=require(_0xe570('0x4'));var BPromise=require(_0xe570('0x5'));var Mustache=require(_0xe570('0x6'));var util=require(_0xe570('0x7'));var path=require('path');var sox=require(_0xe570('0x8'));var csv=require(_0xe570('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe570('0xa'));var _=require(_0xe570('0xb'));var squel=require(_0xe570('0xc'));var crypto=require(_0xe570('0xd'));var jsforce=require(_0xe570('0xe'));var deskjs=require(_0xe570('0xf'));var toCsv=require(_0xe570('0x9'));var querystring=require(_0xe570('0x10'));var Papa=require(_0xe570('0x11'));var Redis=require(_0xe570('0x12'));var authService=require(_0xe570('0x13'));var qs=require(_0xe570('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe570('0x15'));var logger=require('../../config/logger')(_0xe570('0x16'));var utils=require('../../config/utils');var config=require(_0xe570('0x17'));var licenseUtil=require(_0xe570('0x18'));var db=require(_0xe570('0x19'))['db'];config[_0xe570('0x1a')]=_[_0xe570('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe570('0x1c'))(new Redis(config[_0xe570('0x1a')]));require(_0xe570('0x1d'))[_0xe570('0x1e')](socket);function respondWithStatusCode(_0x1df65f,_0x4d84cd){_0x4d84cd=_0x4d84cd||0xcc;return function(_0x46a7cf){if(_0x46a7cf){return _0x1df65f[_0xe570('0x1f')](_0x4d84cd);}return _0x1df65f[_0xe570('0x20')](_0x4d84cd)['end']();};}function respondWithResult(_0x4538fd,_0x522640){_0x522640=_0x522640||0xc8;return function(_0x37ed09){if(_0x37ed09){return _0x4538fd[_0xe570('0x20')](_0x522640)['json'](_0x37ed09);}};}function respondWithFilteredResult(_0xc9d8bf,_0x23e548){return function(_0x20bfc0){if(_0x20bfc0){var _0x494aaf=typeof _0x23e548[_0xe570('0x21')]==='undefined'&&typeof _0x23e548[_0xe570('0x22')]===_0xe570('0x23');var _0x3c0c06=_0x20bfc0[_0xe570('0x24')];var _0x4d70ee=_0x494aaf?0x0:_0x23e548[_0xe570('0x21')];var _0x2617aa=_0x494aaf?_0x20bfc0['count']:_0x23e548[_0xe570('0x21')]+_0x23e548[_0xe570('0x22')];var _0x45ef75;if(_0x2617aa>=_0x3c0c06){_0x2617aa=_0x3c0c06;_0x45ef75=0xc8;}else{_0x45ef75=0xce;}_0xc9d8bf[_0xe570('0x20')](_0x45ef75);return _0xc9d8bf[_0xe570('0x25')](_0xe570('0x26'),_0x4d70ee+'-'+_0x2617aa+'/'+_0x3c0c06)[_0xe570('0x27')](_0x20bfc0);}return null;};}function patchUpdates(_0x342c3c){return function(_0x1e1a2d){try{jsonpatch['apply'](_0x1e1a2d,_0x342c3c,!![]);}catch(_0x24d50a){return BPromise[_0xe570('0x28')](_0x24d50a);}return _0x1e1a2d['save']();};}function saveUpdates(_0x5591c1,_0x269d3c){return function(_0x35b8c8){if(_0x35b8c8){return _0x35b8c8['update'](_0x5591c1)[_0xe570('0x29')](function(_0x11f801){return _0x11f801;});}return null;};}function removeEntity(_0x399209,_0x3bddb2){return function(_0x36f14d){if(_0x36f14d){return _0x36f14d[_0xe570('0x2a')]()[_0xe570('0x29')](function(){var _0x5bc949=_0x36f14d[_0xe570('0x2b')]({'plain':!![]});var _0x4a1ec8=_0xe570('0x2c');return db[_0xe570('0x2d')]['destroy']({'where':{'type':_0x4a1ec8,'resourceId':_0x5bc949['id']}})[_0xe570('0x29')](function(){return _0x36f14d;});})[_0xe570('0x29')](function(){_0x399209[_0xe570('0x20')](0xcc)[_0xe570('0x2e')]();});}};}function handleEntityNotFound(_0x15004a,_0x4d1811){return function(_0x4409f0){if(!_0x4409f0){_0x15004a[_0xe570('0x1f')](0x194);}return _0x4409f0;};}function handleError(_0x3749af,_0xe4eab7){_0xe4eab7=_0xe4eab7||0x1f4;return function(_0x4183d7){logger[_0xe570('0x2f')](_0x4183d7[_0xe570('0x30')]);if(_0x4183d7[_0xe570('0x31')]){delete _0x4183d7[_0xe570('0x31')];}_0x3749af[_0xe570('0x20')](_0xe4eab7)['send'](_0x4183d7);};}exports[_0xe570('0x32')]=function(_0x44a390,_0x204f2a){var _0x573cd3={},_0x36ca39={},_0x34baf3={'count':0x0,'rows':[]};var _0x41c313=_[_0xe570('0x33')](db[_0xe570('0x34')][_0xe570('0x35')],function(_0x297018){return{'name':_0x297018[_0xe570('0x36')],'type':_0x297018[_0xe570('0x37')][_0xe570('0x38')]};});_0x36ca39[_0xe570('0x39')]=_[_0xe570('0x33')](_0x41c313,_0xe570('0x31'));_0x36ca39[_0xe570('0x3a')]=_['keys'](_0x44a390[_0xe570('0x3a')]);_0x36ca39[_0xe570('0x3b')]=_[_0xe570('0x3c')](_0x36ca39[_0xe570('0x39')],_0x36ca39['query']);_0x573cd3[_0xe570('0x3d')]=_['intersection'](_0x36ca39[_0xe570('0x39')],qs[_0xe570('0x3e')](_0x44a390['query'][_0xe570('0x3e')]));_0x573cd3['attributes']=_0x573cd3['attributes'][_0xe570('0x3f')]?_0x573cd3[_0xe570('0x3d')]:_0x36ca39[_0xe570('0x39')];if(!_0x44a390['query'][_0xe570('0x40')](_0xe570('0x41'))){_0x573cd3[_0xe570('0x22')]=qs[_0xe570('0x22')](_0x44a390[_0xe570('0x3a')][_0xe570('0x22')]);_0x573cd3['offset']=qs[_0xe570('0x21')](_0x44a390[_0xe570('0x3a')][_0xe570('0x21')]);}_0x573cd3['order']=qs[_0xe570('0x42')](_0x44a390[_0xe570('0x3a')][_0xe570('0x42')]);_0x573cd3['where']=qs[_0xe570('0x3b')](_[_0xe570('0x43')](_0x44a390[_0xe570('0x3a')],_0x36ca39[_0xe570('0x3b')]),_0x41c313);if(_0x44a390[_0xe570('0x3a')][_0xe570('0x44')]){_0x573cd3['where']=_[_0xe570('0x45')](_0x573cd3[_0xe570('0x46')],{'$or':_[_0xe570('0x33')](_0x41c313,function(_0x2f704b){if(_0x2f704b[_0xe570('0x37')]!==_0xe570('0x47')){var _0x157c8f={};_0x157c8f[_0x2f704b[_0xe570('0x31')]]={'$like':'%'+_0x44a390['query'][_0xe570('0x44')]+'%'};return _0x157c8f;}})});}_0x573cd3=_[_0xe570('0x45')]({},_0x573cd3,_0x44a390[_0xe570('0x48')]);var _0x469e9a={'where':_0x573cd3['where']};return db[_0xe570('0x34')][_0xe570('0x24')](_0x469e9a)['then'](function(_0x42feb0){_0x34baf3[_0xe570('0x24')]=_0x42feb0;if(_0x44a390[_0xe570('0x3a')]['includeAll']){_0x573cd3[_0xe570('0x49')]=[{'all':!![]}];}return db[_0xe570('0x34')]['findAll'](_0x573cd3);})[_0xe570('0x29')](function(_0x458c9f){_0x34baf3['rows']=_0x458c9f;return _0x34baf3;})[_0xe570('0x29')](respondWithFilteredResult(_0x204f2a,_0x573cd3))[_0xe570('0x4a')](handleError(_0x204f2a,null));};exports[_0xe570('0x4b')]=function(_0x2c8daf,_0x5ead23){var _0x3db2b4={'raw':![],'where':{'id':_0x2c8daf[_0xe570('0x4c')]['id']}},_0x5e6b7a={};_0x5e6b7a[_0xe570('0x39')]=_[_0xe570('0x4d')](db[_0xe570('0x34')][_0xe570('0x35')]);_0x5e6b7a[_0xe570('0x3a')]=_['keys'](_0x2c8daf[_0xe570('0x3a')]);_0x5e6b7a[_0xe570('0x3b')]=_['intersection'](_0x5e6b7a[_0xe570('0x39')],_0x5e6b7a['query']);_0x3db2b4['attributes']=_[_0xe570('0x3c')](_0x5e6b7a[_0xe570('0x39')],qs[_0xe570('0x3e')](_0x2c8daf[_0xe570('0x3a')][_0xe570('0x3e')]));_0x3db2b4[_0xe570('0x3d')]=_0x3db2b4[_0xe570('0x3d')][_0xe570('0x3f')]?_0x3db2b4['attributes']:_0x5e6b7a[_0xe570('0x39')];if(_0x2c8daf['query']['includeAll']){_0x3db2b4[_0xe570('0x49')]=[{'all':!![]}];}_0x3db2b4=_[_0xe570('0x45')]({},_0x3db2b4,_0x2c8daf[_0xe570('0x48')]);return db[_0xe570('0x34')]['find'](_0x3db2b4)[_0xe570('0x29')](handleEntityNotFound(_0x5ead23,null))[_0xe570('0x29')](respondWithResult(_0x5ead23,null))[_0xe570('0x4a')](handleError(_0x5ead23,null));};exports[_0xe570('0x4e')]=function(_0x2eff6d,_0x400937){return db[_0xe570('0x34')][_0xe570('0x4e')](_0x2eff6d['body'],{})[_0xe570('0x29')](function(_0x7a7148){var _0x288b0b=_0x2eff6d[_0xe570('0x4f')][_0xe570('0x2b')]({'plain':!![]});if(!_0x288b0b)throw new Error(_0xe570('0x50'));if(_0x288b0b[_0xe570('0x51')]===_0xe570('0x4f')){var _0x2610aa=_0x7a7148['get']({'plain':!![]});var _0x1a5352=_0xe570('0x2c');return db[_0xe570('0x52')][_0xe570('0x53')]({'where':{'name':_0x1a5352,'userProfileId':_0x288b0b[_0xe570('0x54')]},'raw':!![]})['then'](function(_0x4198c4){if(_0x4198c4&&_0x4198c4[_0xe570('0x55')]===0x0){return db['UserProfileResource'][_0xe570('0x4e')]({'name':_0x2610aa['name'],'resourceId':_0x2610aa['id'],'type':_0x4198c4['name'],'sectionId':_0x4198c4['id']},{})[_0xe570('0x29')](function(){return _0x7a7148;});}else{return _0x7a7148;}})[_0xe570('0x4a')](function(_0x5c8f02){logger[_0xe570('0x2f')](_0xe570('0x56'),_0x5c8f02);throw _0x5c8f02;});}return _0x7a7148;})[_0xe570('0x29')](respondWithResult(_0x400937,0xc9))[_0xe570('0x4a')](handleError(_0x400937,null));};exports[_0xe570('0x57')]=function(_0x163490,_0x2a9167){var _0x4d0b25={'where':{'id':_0x163490['params']['id']}},_0x507df6={};_0x507df6['model']=_[_0xe570('0x4d')](db['Dashboard'][_0xe570('0x35')]);_0x4d0b25[_0xe570('0x3d')]=_['intersection'](_0x507df6[_0xe570('0x39')],qs[_0xe570('0x3e')](_0x163490[_0xe570('0x3a')][_0xe570('0x3e')]));_0x4d0b25['attributes']=_0x4d0b25[_0xe570('0x3d')][_0xe570('0x3f')]?_0x4d0b25[_0xe570('0x3d')]:_0x507df6[_0xe570('0x39')];if(_0x163490[_0xe570('0x3a')][_0xe570('0x58')]){_0x4d0b25[_0xe570('0x49')]=[{'all':!![]}];}_0x4d0b25=_[_0xe570('0x45')]({},_0x4d0b25,_0x163490['options']);return db[_0xe570('0x34')][_0xe570('0x53')](_0x4d0b25)[_0xe570('0x29')](handleEntityNotFound(_0x2a9167,null))[_0xe570('0x29')](function(_0x36d893){if(_0x36d893){var _0x4f8181=_0x36d893[_0xe570('0x2b')]({'plain':!![]});_0x4f8181=qs[_0xe570('0x59')](_0x4f8181,['id',_0xe570('0x5a'),_0xe570('0x5b')]);_0x163490['body']=_[_0xe570('0x59')](_0x163490[_0xe570('0x5c')],['id',_0xe570('0x5a'),_0xe570('0x5b')]);return db[_0xe570('0x34')][_0xe570('0x4e')](_[_0xe570('0x45')](_0x4f8181,_0x163490[_0xe570('0x5c')]),{'include':_0x163490[_0xe570('0x3a')][_0xe570('0x58')]?[{'all':!![]}]:undefined})[_0xe570('0x29')](function(_0x3c913c){var _0x11b283=_0x163490[_0xe570('0x4f')][_0xe570('0x2b')]({'plain':!![]});if(!_0x11b283)throw new Error(_0xe570('0x50'));if(_0x11b283[_0xe570('0x51')]===_0xe570('0x4f')){var _0x4b0e8b=_0x3c913c['get']({'plain':!![]});var _0x1f03d9=_0xe570('0x2c');return db[_0xe570('0x52')][_0xe570('0x53')]({'where':{'name':_0x1f03d9,'userProfileId':_0x11b283[_0xe570('0x54')]},'raw':!![]})[_0xe570('0x29')](function(_0x58e6fe){if(_0x58e6fe&&_0x58e6fe[_0xe570('0x55')]===0x0){return db[_0xe570('0x2d')]['create']({'name':_0x4b0e8b[_0xe570('0x31')],'resourceId':_0x4b0e8b['id'],'type':_0x58e6fe['name'],'sectionId':_0x58e6fe['id']},{})[_0xe570('0x29')](function(){return _0x3c913c;});}else{return _0x3c913c;}})['catch'](function(_0x32a7da){logger[_0xe570('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a7da);throw _0x32a7da;});}return _0x3c913c;});}})[_0xe570('0x29')](respondWithResult(_0x2a9167,0xc9))[_0xe570('0x4a')](handleError(_0x2a9167,null));};exports[_0xe570('0x5d')]=function(_0x5249f4,_0x1da1fd){if(_0x5249f4['body']['id']){delete _0x5249f4[_0xe570('0x5c')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x5249f4[_0xe570('0x4c')]['id']}})[_0xe570('0x29')](handleEntityNotFound(_0x1da1fd,null))['then'](saveUpdates(_0x5249f4['body'],null))[_0xe570('0x29')](respondWithResult(_0x1da1fd,null))[_0xe570('0x4a')](handleError(_0x1da1fd,null));};exports[_0xe570('0x2a')]=function(_0x42f065,_0x4be508){return db[_0xe570('0x34')][_0xe570('0x53')]({'where':{'id':_0x42f065[_0xe570('0x4c')]['id']}})[_0xe570('0x29')](handleEntityNotFound(_0x4be508,null))['then'](removeEntity(_0x4be508,null))[_0xe570('0x4a')](handleError(_0x4be508,null));};function widgetAttributes(_0x34e182){try{switch(_0x34e182[_0xe570('0x37')]){case _0xe570('0x5e'):return[{'name':'attrUrl','value':_0x34e182[_0xe570('0x5f')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x0]?_0x34e182[_0xe570('0x60')][0x0][_0xe570('0x61')]:undefined)||_0xe570('0x62')}];case _0xe570('0x63'):return[{'name':'attrPath','value':_0x34e182['attrPath']||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x0]?_0x34e182[_0xe570('0x60')][0x0][_0xe570('0x61')]:undefined)||''}];case _0xe570('0x64'):return[{'name':_0xe570('0x65'),'value':_0x34e182['attrHourFormat']||(_0x34e182[_0xe570('0x60')]&&_0x34e182['attrs'][0x0]?_0x34e182['attrs'][0x0][_0xe570('0x61')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x34e182[_0xe570('0x66')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x1]?_0x34e182[_0xe570('0x60')][0x1][_0xe570('0x61')]:undefined)||_0xe570('0x67')},{'name':_0xe570('0x68'),'value':_0x34e182[_0xe570('0x68')]||(_0x34e182['attrs']&&_0x34e182['attrs'][0x2]?_0x34e182['attrs'][0x2][_0xe570('0x61')]:undefined)||0xc}];case'counter':return[{'name':_0xe570('0x69'),'value':_0x34e182[_0xe570('0x69')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182['attrs'][0x0]?_0x34e182[_0xe570('0x60')][0x0][_0xe570('0x61')]:undefined)||_0xe570('0x6a')},{'name':_0xe570('0x6b'),'value':_0x34e182[_0xe570('0x6b')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x1]?_0x34e182['attrs'][0x1][_0xe570('0x61')]:undefined)||[]},{'name':_0xe570('0x68'),'value':_0x34e182[_0xe570('0x68')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x2]?_0x34e182[_0xe570('0x60')][0x2][_0xe570('0x61')]:undefined)||0x14},{'name':_0xe570('0x6c'),'value':_0x34e182[_0xe570('0x6c')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182['attrs'][0x3]?_0x34e182['attrs'][0x3][_0xe570('0x61')]:undefined)||_0xe570('0x6d')},{'name':'attrEmailAccounts','value':_0x34e182['attrEmailAccounts']||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x4]?_0x34e182[_0xe570('0x60')][0x4][_0xe570('0x61')]:undefined)||''},{'name':_0xe570('0x6e'),'value':_0x34e182[_0xe570('0x6e')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182['attrs'][0x5]?_0x34e182[_0xe570('0x60')][0x5][_0xe570('0x61')]:undefined)||''},{'name':_0xe570('0x6f'),'value':_0x34e182[_0xe570('0x6f')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x6]?_0x34e182[_0xe570('0x60')][0x6][_0xe570('0x61')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x34e182['attrOpenchannelAccounts']||(_0x34e182['attrs']&&_0x34e182[_0xe570('0x60')][0x7]?_0x34e182[_0xe570('0x60')][0x7][_0xe570('0x61')]:undefined)||''},{'name':_0xe570('0x70'),'value':_0x34e182['attrWhatsappAccounts']||(_0x34e182[_0xe570('0x60')]&&_0x34e182['attrs'][0x8]?_0x34e182[_0xe570('0x60')][0x8]['value']:undefined)||''},{'name':_0xe570('0x71'),'value':_0x34e182['attrChatWebsites']||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x9]?_0x34e182[_0xe570('0x60')][0x9][_0xe570('0x61')]:undefined)||''}];case _0xe570('0x72'):case _0xe570('0x73'):return[{'name':'attrSerie1','value':_0x34e182['attrSerie1']||(_0x34e182['attrs']&&_0x34e182[_0xe570('0x60')][0x0]?_0x34e182['attrs'][0x0][_0xe570('0x61')]:undefined)||_0xe570('0x6a')},{'name':_0xe570('0x74'),'value':_0x34e182[_0xe570('0x74')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182['attrs'][0x1]?_0x34e182['attrs'][0x1][_0xe570('0x61')]:undefined)||null},{'name':'attrSerie3','value':_0x34e182[_0xe570('0x75')]||(_0x34e182['attrs']&&_0x34e182[_0xe570('0x60')][0x2]?_0x34e182[_0xe570('0x60')][0x2][_0xe570('0x61')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x34e182[_0xe570('0x6b')]||(_0x34e182['attrs']&&_0x34e182[_0xe570('0x60')][0x3]?_0x34e182[_0xe570('0x60')][0x3][_0xe570('0x61')]:undefined)||[]},{'name':_0xe570('0x6c'),'value':_0x34e182['attrChannel']||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x4]?_0x34e182[_0xe570('0x60')][0x4][_0xe570('0x61')]:undefined)||_0xe570('0x6d')},{'name':_0xe570('0x76'),'value':_0x34e182[_0xe570('0x76')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182['attrs'][0x5]?_0x34e182[_0xe570('0x60')][0x5][_0xe570('0x61')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x34e182[_0xe570('0x6e')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x6]?_0x34e182[_0xe570('0x60')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x34e182['attrSmsAccounts']||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x7]?_0x34e182['attrs'][0x7]['value']:undefined)||''},{'name':_0xe570('0x77'),'value':_0x34e182[_0xe570('0x77')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x8]?_0x34e182[_0xe570('0x60')][0x8]['value']:undefined)||''},{'name':_0xe570('0x70'),'value':_0x34e182[_0xe570('0x70')]||(_0x34e182['attrs']&&_0x34e182[_0xe570('0x60')][0x9]?_0x34e182[_0xe570('0x60')][0x9][_0xe570('0x61')]:undefined)||''},{'name':'attrChatWebsites','value':_0x34e182[_0xe570('0x71')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182['attrs'][0xa]?_0x34e182[_0xe570('0x60')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0xe570('0x78'),'type':_0x34e182[_0xe570('0x79')]||(_0x34e182['attrs']&&_0x34e182['attrs'][0x0]?_0x34e182[_0xe570('0x60')][0x0]['type']:undefined)||null,'value':_0x34e182[_0xe570('0x78')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x0]?_0x34e182['attrs'][0x0][_0xe570('0x61')]:undefined)||null},{'name':_0xe570('0x7a'),'value':_0x34e182[_0xe570('0x7a')]||(_0x34e182[_0xe570('0x60')]&&_0x34e182[_0xe570('0x60')][0x1]?_0x34e182[_0xe570('0x60')][0x1][_0xe570('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x3ed25c){logger[_0xe570('0x2f')](_0xe570('0x7b'),JSON['stringify'](_0x3ed25c));return[];}}exports[_0xe570('0x7c')]=function(_0x4196b1,_0x5889a5,_0x5f69b8){if(_0x4196b1[_0xe570('0x5c')]['id']){delete _0x4196b1[_0xe570('0x5c')]['id'];}return db[_0xe570('0x34')]['find']({'where':{'id':_0x4196b1[_0xe570('0x4c')]['id']}})[_0xe570('0x29')](handleEntityNotFound(_0x5889a5,null))[_0xe570('0x29')](function(_0xcc5c8f){if(_0xcc5c8f){_0x4196b1[_0xe570('0x5c')][_0xe570('0x7d')]=_0xcc5c8f['id'];_0x4196b1[_0xe570('0x5c')][_0xe570('0x60')]=widgetAttributes(_0x4196b1['body']);return db[_0xe570('0x7e')][_0xe570('0x4e')](_0x4196b1[_0xe570('0x5c')]);}})[_0xe570('0x29')](respondWithResult(_0x5889a5,null))[_0xe570('0x4a')](handleError(_0x5889a5,null));};exports[_0xe570('0x7f')]=function(_0x59f008,_0x40e712,_0x189076){var _0x1390b6={};var _0xb5e498={};var _0x4df9fa;var _0x4fe42c;return db[_0xe570('0x34')][_0xe570('0x80')]({'where':{'id':_0x59f008[_0xe570('0x4c')]['id']}})['then'](handleEntityNotFound(_0x40e712,null))[_0xe570('0x29')](function(_0xeb3645){if(_0xeb3645){_0x4df9fa=_0xeb3645;_0xb5e498['model']=_[_0xe570('0x4d')](db[_0xe570('0x7e')]['rawAttributes']);_0xb5e498[_0xe570('0x3a')]=_['keys'](_0x59f008[_0xe570('0x3a')]);_0xb5e498[_0xe570('0x3b')]=_['intersection'](_0xb5e498[_0xe570('0x39')],_0xb5e498['query']);_0x1390b6[_0xe570('0x3d')]=_[_0xe570('0x3c')](_0xb5e498[_0xe570('0x39')],qs[_0xe570('0x3e')](_0x59f008[_0xe570('0x3a')][_0xe570('0x3e')]));_0x1390b6[_0xe570('0x3d')]=_0x1390b6[_0xe570('0x3d')][_0xe570('0x3f')]?_0x1390b6[_0xe570('0x3d')]:_0xb5e498[_0xe570('0x39')];_0x1390b6[_0xe570('0x81')]=qs['sort'](_0x59f008[_0xe570('0x3a')][_0xe570('0x42')]);_0x1390b6[_0xe570('0x46')]=qs[_0xe570('0x3b')](_[_0xe570('0x43')](_0x59f008[_0xe570('0x3a')],_0xb5e498['filters']));if(_0x59f008['query'][_0xe570('0x44')]){_0x1390b6[_0xe570('0x46')]=_[_0xe570('0x45')](_0x1390b6['where'],{'$or':_[_0xe570('0x33')](_0x1390b6[_0xe570('0x3d')],function(_0x12772c){var _0x252af2={};_0x252af2[_0x12772c]={'$like':'%'+_0x59f008[_0xe570('0x3a')][_0xe570('0x44')]+'%'};return _0x252af2;})});}_0x1390b6=_[_0xe570('0x45')]({},_0x1390b6,_0x59f008['options']);return _0x4df9fa['getItems'](_0x1390b6);}})[_0xe570('0x29')](function(_0x36ccaf){if(_0x36ccaf){_0x4fe42c=_0x36ccaf['length'];if(!_0x59f008['query'][_0xe570('0x40')](_0xe570('0x41'))){_0x1390b6[_0xe570('0x22')]=qs[_0xe570('0x22')](_0x59f008[_0xe570('0x3a')][_0xe570('0x22')]);_0x1390b6[_0xe570('0x21')]=qs[_0xe570('0x21')](_0x59f008['query'][_0xe570('0x21')]);}return _0x4df9fa['getItems'](_0x1390b6);}})[_0xe570('0x29')](function(_0x253393){if(_0x253393){return _0x253393?{'count':_0x4fe42c,'rows':_0x253393}:null;}})[_0xe570('0x29')](respondWithResult(_0x40e712,null))[_0xe570('0x4a')](handleError(_0x40e712,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 4ac7ada..8eec909 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 _0x2a65=['hasOwnProperty','hook','exports','events','Dashboard','setMaxListeners','update','remove','emit'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0x2a65,0x135));var _0x52a6=function(_0x58a0bb,_0x3464b8){_0x58a0bb=_0x58a0bb-0x0;var _0x1f1146=_0x2a65[_0x58a0bb];return _0x1f1146;};'use strict';var EventEmitter=require(_0x52a6('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x52a6('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x52a6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x52a6('0x3'),'afterDestroy':_0x52a6('0x4')};function emitEvent(_0x3abbd7){return function(_0x17f8d7,_0x435e94,_0x35f7fa){DashboardEvents[_0x52a6('0x5')](_0x3abbd7+':'+_0x17f8d7['id'],_0x17f8d7);DashboardEvents['emit'](_0x3abbd7,_0x17f8d7);_0x35f7fa(null);};}for(var e in events){if(events[_0x52a6('0x6')](e)){var event=events[e];Dashboard[_0x52a6('0x7')](e,emitEvent(event));}}module[_0x52a6('0x8')]=DashboardEvents; \ No newline at end of file +var _0x8dd4=['hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit'];(function(_0xeeca45,_0x5ce4af){var _0x366bcb=function(_0x411cd5){while(--_0x411cd5){_0xeeca45['push'](_0xeeca45['shift']());}};_0x366bcb(++_0x5ce4af);}(_0x8dd4,0x142));var _0x48dd=function(_0x3c514,_0x2893b5){_0x3c514=_0x3c514-0x0;var _0x3dcec8=_0x8dd4[_0x3c514];return _0x3dcec8;};'use strict';var EventEmitter=require(_0x48dd('0x0'));var Dashboard=require(_0x48dd('0x1'))['db'][_0x48dd('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x48dd('0x3')](0x0);var events={'afterCreate':_0x48dd('0x4'),'afterUpdate':_0x48dd('0x5'),'afterDestroy':_0x48dd('0x6')};function emitEvent(_0x3f6a02){return function(_0x1d1ee7,_0x333632,_0x3dc538){DashboardEvents[_0x48dd('0x7')](_0x3f6a02+':'+_0x1d1ee7['id'],_0x1d1ee7);DashboardEvents[_0x48dd('0x7')](_0x3f6a02,_0x1d1ee7);_0x3dc538(null);};}for(var e in events){if(events[_0x48dd('0x8')](e)){var event=events[e];Dashboard[_0x48dd('0x9')](e,emitEvent(event));}}module[_0x48dd('0xa')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 026e43a..566662f 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 _0xf06f=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./dashboard.attributes','exports','define','Dashboard','dashboards'];(function(_0x20b85e,_0x50d027){var _0x35ebc6=function(_0x2d7199){while(--_0x2d7199){_0x20b85e['push'](_0x20b85e['shift']());}};_0x35ebc6(++_0x50d027);}(_0xf06f,0x15f));var _0xff06=function(_0x42647b,_0x2b6c5e){_0x42647b=_0x42647b-0x0;var _0x141af4=_0xf06f[_0x42647b];return _0x141af4;};'use strict';var _=require(_0xff06('0x0'));var util=require(_0xff06('0x1'));var logger=require(_0xff06('0x2'))(_0xff06('0x3'));var moment=require(_0xff06('0x4'));var BPromise=require('bluebird');var rp=require(_0xff06('0x5'));var fs=require('fs');var path=require(_0xff06('0x6'));var rimraf=require(_0xff06('0x7'));var config=require('../../config/environment');var attributes=require(_0xff06('0x8'));module[_0xff06('0x9')]=function(_0x5a114c,_0x5d25bb){return _0x5a114c[_0xff06('0xa')](_0xff06('0xb'),attributes,{'tableName':_0xff06('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed26=['dashboards','lodash','api','moment','bluebird','request-promise','path','./dashboard.attributes','Dashboard'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0xed26,0x64));var _0x6ed2=function(_0x57c0ac,_0x6e6be){_0x57c0ac=_0x57c0ac-0x0;var _0x4f4e96=_0xed26[_0x57c0ac];return _0x4f4e96;};'use strict';var _=require(_0x6ed2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ed2('0x1'));var moment=require(_0x6ed2('0x2'));var BPromise=require(_0x6ed2('0x3'));var rp=require(_0x6ed2('0x4'));var fs=require('fs');var path=require(_0x6ed2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6ed2('0x6'));module['exports']=function(_0xde0c81,_0x55189f){return _0xde0c81['define'](_0x6ed2('0x7'),attributes,{'tableName':_0x6ed2('0x8'),'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 5027836..a5f9867 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 _0xede4=['moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2af53e,_0x2222e5){var _0x4ed385=function(_0x4a393c){while(--_0x4a393c){_0x2af53e['push'](_0x2af53e['shift']());}};_0x4ed385(++_0x2222e5);}(_0xede4,0x193));var _0x4ede=function(_0x174b5e,_0x32b4c0){_0x174b5e=_0x174b5e-0x0;var _0x3d511f=_0xede4[_0x174b5e];return _0x3d511f;};'use strict';var _=require(_0x4ede('0x0'));var util=require(_0x4ede('0x1'));var moment=require(_0x4ede('0x2'));var BPromise=require(_0x4ede('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4ede('0x4'));var logger=require(_0x4ede('0x5'))(_0x4ede('0x6'));var config=require(_0x4ede('0x7'));var jayson=require(_0x4ede('0x8'));var client=jayson[_0x4ede('0x9')]['http']({'port':0x232a});config[_0x4ede('0xa')]=_[_0x4ede('0xb')](config[_0x4ede('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ede('0xc'))(new Redis(config[_0x4ede('0xa')]));require(_0x4ede('0xd'))[_0x4ede('0xe')](socket);function respondWithRpcPromise(_0x987e32,_0x212758,_0x427f20){return new BPromise(function(_0x20348a,_0x422e88){return client[_0x4ede('0xf')](_0x987e32,_0x427f20)['then'](function(_0x18688a){logger[_0x4ede('0x10')](_0x4ede('0x11'),_0x212758,_0x4ede('0x12'));logger[_0x4ede('0x13')](_0x4ede('0x14'),_0x212758,_0x4ede('0x12'),JSON[_0x4ede('0x15')](_0x18688a));if(_0x18688a[_0x4ede('0x16')]){if(_0x18688a['error'][_0x4ede('0x17')]===0x1f4){logger[_0x4ede('0x16')](_0x4ede('0x11'),_0x212758,_0x18688a[_0x4ede('0x16')][_0x4ede('0x18')]);return _0x422e88(_0x18688a['error']['message']);}logger[_0x4ede('0x16')]('Dashboard,\x20%s,\x20%s',_0x212758,_0x18688a[_0x4ede('0x16')]['message']);return _0x20348a(_0x18688a[_0x4ede('0x16')]['message']);}else{logger['info'](_0x4ede('0x11'),_0x212758,_0x4ede('0x12'));_0x20348a(_0x18688a[_0x4ede('0x19')]['message']);}})[_0x4ede('0x1a')](function(_0x4e77f2){logger['error'](_0x4ede('0x11'),_0x212758,_0x4e77f2);_0x422e88(_0x4e77f2);});});} \ No newline at end of file +var _0x2e66=['http','redis','localhost','socket.io-emitter','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x9a998b,_0x2fb091){var _0x35c369=function(_0x323583){while(--_0x323583){_0x9a998b['push'](_0x9a998b['shift']());}};_0x35c369(++_0x2fb091);}(_0x2e66,0x155));var _0x62e6=function(_0x45312c,_0x32ad2f){_0x45312c=_0x45312c-0x0;var _0x246131=_0x2e66[_0x45312c];return _0x246131;};'use strict';var _=require(_0x62e6('0x0'));var util=require(_0x62e6('0x1'));var moment=require(_0x62e6('0x2'));var BPromise=require(_0x62e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62e6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x62e6('0x5'));var logger=require(_0x62e6('0x6'))(_0x62e6('0x7'));var config=require(_0x62e6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x62e6('0x9')][_0x62e6('0xa')]({'port':0x232a});config[_0x62e6('0xb')]=_['defaults'](config[_0x62e6('0xb')],{'host':_0x62e6('0xc'),'port':0x18eb});var socket=require(_0x62e6('0xd'))(new Redis(config['redis']));require(_0x62e6('0xe'))['register'](socket);function respondWithRpcPromise(_0x44948f,_0x2c1ca5,_0x272cd7){return new BPromise(function(_0x12cc5c,_0xf71800){return client[_0x62e6('0xf')](_0x44948f,_0x272cd7)[_0x62e6('0x10')](function(_0x50c075){logger[_0x62e6('0x11')](_0x62e6('0x12'),_0x2c1ca5,_0x62e6('0x13'));logger[_0x62e6('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x2c1ca5,_0x62e6('0x13'),JSON[_0x62e6('0x15')](_0x50c075));if(_0x50c075[_0x62e6('0x16')]){if(_0x50c075[_0x62e6('0x16')][_0x62e6('0x17')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x2c1ca5,_0x50c075[_0x62e6('0x16')][_0x62e6('0x18')]);return _0xf71800(_0x50c075[_0x62e6('0x16')]['message']);}logger[_0x62e6('0x16')]('Dashboard,\x20%s,\x20%s',_0x2c1ca5,_0x50c075[_0x62e6('0x16')]['message']);return _0x12cc5c(_0x50c075[_0x62e6('0x16')][_0x62e6('0x18')]);}else{logger['info'](_0x62e6('0x12'),_0x2c1ca5,'request\x20sent');_0x12cc5c(_0x50c075[_0x62e6('0x19')][_0x62e6('0x18')]);}})[_0x62e6('0x1a')](function(_0x2c7bf5){logger[_0x62e6('0x16')](_0x62e6('0x12'),_0x2c1ca5,_0x2c7bf5);_0xf71800(_0x2c7bf5);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index f84c778..b033372 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 _0x5ba5=['./dashboard.events','save','remove','removeListener','register','length','dashboard:'];(function(_0x1ad07b,_0x551d55){var _0x2c447f=function(_0x43340b){while(--_0x43340b){_0x1ad07b['push'](_0x1ad07b['shift']());}};_0x2c447f(++_0x551d55);}(_0x5ba5,0x157));var _0x55ba=function(_0x4bf793,_0x404922){_0x4bf793=_0x4bf793-0x0;var _0x55a44b=_0x5ba5[_0x4bf793];return _0x55a44b;};'use strict';var DashboardEvents=require(_0x55ba('0x0'));var events=[_0x55ba('0x1'),_0x55ba('0x2'),'update'];function createListener(_0x344b42,_0x432a17){return function(_0x15cf48){_0x432a17['emit'](_0x344b42,_0x15cf48);};}function removeListener(_0x54734c,_0x2edc34){return function(){DashboardEvents[_0x55ba('0x3')](_0x54734c,_0x2edc34);};}exports[_0x55ba('0x4')]=function(_0x5a3bf5){for(var _0x40739f=0x0,_0x3367d9=events[_0x55ba('0x5')];_0x40739f<_0x3367d9;_0x40739f++){var _0x171c89=events[_0x40739f];var _0x250b14=createListener(_0x55ba('0x6')+_0x171c89,_0x5a3bf5);DashboardEvents['on'](_0x171c89,_0x250b14);}}; \ No newline at end of file +var _0x5d30=['length','dashboard:','./dashboard.events','save','remove','update','emit','removeListener','register'];(function(_0x394556,_0x1fc39b){var _0x538e88=function(_0xc9eaeb){while(--_0xc9eaeb){_0x394556['push'](_0x394556['shift']());}};_0x538e88(++_0x1fc39b);}(_0x5d30,0x1d6));var _0x05d3=function(_0x364a36,_0x1e2677){_0x364a36=_0x364a36-0x0;var _0x5cd6fa=_0x5d30[_0x364a36];return _0x5cd6fa;};'use strict';var DashboardEvents=require(_0x05d3('0x0'));var events=[_0x05d3('0x1'),_0x05d3('0x2'),_0x05d3('0x3')];function createListener(_0x4126c2,_0x44984a){return function(_0x5532d1){_0x44984a[_0x05d3('0x4')](_0x4126c2,_0x5532d1);};}function removeListener(_0x2bb1cf,_0x48731b){return function(){DashboardEvents[_0x05d3('0x5')](_0x2bb1cf,_0x48731b);};}exports[_0x05d3('0x6')]=function(_0x2e7d50){for(var _0x3aaba5=0x0,_0x56b438=events[_0x05d3('0x7')];_0x3aaba5<_0x56b438;_0x3aaba5++){var _0xde9fd9=events[_0x3aaba5];var _0x5ccaa0=createListener(_0x05d3('0x8')+_0xde9fd9,_0x2e7d50);DashboardEvents['on'](_0xde9fd9,_0x5ccaa0);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index ebf0ce5..672ab0a 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 _0x21dc=['/:id','show','getItems','post','create','/:id/clone','clone','/:id/items','addItem','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','isAuthenticated','index','get'];(function(_0x4b9c4f,_0x45ce1){var _0x39d40c=function(_0x3c9607){while(--_0x3c9607){_0x4b9c4f['push'](_0x4b9c4f['shift']());}};_0x39d40c(++_0x45ce1);}(_0x21dc,0xbd));var _0xc21d=function(_0xe192f0,_0x235766){_0xe192f0=_0xe192f0-0x0;var _0x1a4696=_0x21dc[_0xe192f0];return _0x1a4696;};'use strict';var multer=require('multer');var util=require(_0xc21d('0x0'));var path=require('path');var timeout=require(_0xc21d('0x1'));var express=require(_0xc21d('0x2'));var router=express[_0xc21d('0x3')]();var fs_extra=require(_0xc21d('0x4'));var auth=require(_0xc21d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc21d('0x6'));var controller=require(_0xc21d('0x7'));router['get']('/',auth[_0xc21d('0x8')](),controller[_0xc21d('0x9')]);router[_0xc21d('0xa')](_0xc21d('0xb'),auth[_0xc21d('0x8')](),controller[_0xc21d('0xc')]);router['get']('/:id/items',auth[_0xc21d('0x8')](),controller[_0xc21d('0xd')]);router[_0xc21d('0xe')]('/',auth[_0xc21d('0x8')](),controller[_0xc21d('0xf')]);router[_0xc21d('0xe')](_0xc21d('0x10'),auth[_0xc21d('0x8')](),controller[_0xc21d('0x11')]);router['post'](_0xc21d('0x12'),auth['isAuthenticated'](),controller[_0xc21d('0x13')]);router[_0xc21d('0x14')](_0xc21d('0xb'),auth[_0xc21d('0x8')](),controller[_0xc21d('0x15')]);router[_0xc21d('0x16')](_0xc21d('0xb'),auth[_0xc21d('0x8')](),controller[_0xc21d('0x17')]);module[_0xc21d('0x18')]=router; \ No newline at end of file +var _0x4ecd=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','/:id/items','getItems','post','create','addItem','put','update','destroy'];(function(_0x3bec7c,_0x444b1e){var _0x7084a9=function(_0x1e116f){while(--_0x1e116f){_0x3bec7c['push'](_0x3bec7c['shift']());}};_0x7084a9(++_0x444b1e);}(_0x4ecd,0xd9));var _0xd4ec=function(_0x43c0c7,_0x4739b6){_0x43c0c7=_0x43c0c7-0x0;var _0x3df9c9=_0x4ecd[_0x43c0c7];return _0x3df9c9;};'use strict';var multer=require(_0xd4ec('0x0'));var util=require(_0xd4ec('0x1'));var path=require(_0xd4ec('0x2'));var timeout=require(_0xd4ec('0x3'));var express=require(_0xd4ec('0x4'));var router=express[_0xd4ec('0x5')]();var fs_extra=require(_0xd4ec('0x6'));var auth=require(_0xd4ec('0x7'));var interaction=require(_0xd4ec('0x8'));var config=require(_0xd4ec('0x9'));var controller=require(_0xd4ec('0xa'));router[_0xd4ec('0xb')]('/',auth['isAuthenticated'](),controller[_0xd4ec('0xc')]);router[_0xd4ec('0xb')](_0xd4ec('0xd'),auth[_0xd4ec('0xe')](),controller['show']);router[_0xd4ec('0xb')](_0xd4ec('0xf'),auth['isAuthenticated'](),controller[_0xd4ec('0x10')]);router[_0xd4ec('0x11')]('/',auth[_0xd4ec('0xe')](),controller[_0xd4ec('0x12')]);router[_0xd4ec('0x11')]('/:id/clone',auth[_0xd4ec('0xe')](),controller['clone']);router['post'](_0xd4ec('0xf'),auth[_0xd4ec('0xe')](),controller[_0xd4ec('0x13')]);router[_0xd4ec('0x14')]('/:id',auth[_0xd4ec('0xe')](),controller[_0xd4ec('0x15')]);router['delete']('/:id',auth[_0xd4ec('0xe')](),controller[_0xd4ec('0x16')]);module[_0xd4ec('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 1e431c7..03883fb 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 _0xd8fb=['exports','long','parse','attrs','setDataValue','stringify','INTEGER','#ffffff','STRING','sequelize','squel','lodash'];(function(_0x1adc9f,_0x4f767f){var _0x4a790f=function(_0x2b6524){while(--_0x2b6524){_0x1adc9f['push'](_0x1adc9f['shift']());}};_0x4a790f(++_0x4f767f);}(_0xd8fb,0x99));var _0xbd8f=function(_0xb50ead,_0x23d694){_0xb50ead=_0xb50ead-0x0;var _0x3edac0=_0xd8fb[_0xb50ead];return _0x3edac0;};'use strict';var Sequelize=require(_0xbd8f('0x0'));var squel=require(_0xbd8f('0x1'));var _=require(_0xbd8f('0x2'));module[_0xbd8f('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xbd8f('0x4')),'get':function(){try{return JSON[_0xbd8f('0x5')](this['getDataValue'](_0xbd8f('0x6')));}catch(_0x2343bf){return[];}},'set':function(_0x5543b2){try{this[_0xbd8f('0x7')]('attrs',JSON[_0xbd8f('0x8')](_0x5543b2));}catch(_0x578499){this[_0xbd8f('0x7')](_0xbd8f('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xbd8f('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xbd8f('0x9')]},'col':{'type':Sequelize[_0xbd8f('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbd8f('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xbd8f('0xb')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xbd8f('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0xe3da=['squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize'];(function(_0x3706a5,_0x232c2a){var _0x5188a6=function(_0x4afb04){while(--_0x4afb04){_0x3706a5['push'](_0x3706a5['shift']());}};_0x5188a6(++_0x232c2a);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xae3d('0x0'));var squel=require(_0xae3d('0x1'));var _=require(_0xae3d('0x2'));module[_0xae3d('0x3')]={'title':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xae3d('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xae3d('0x5')](_0xae3d('0x6')),'get':function(){try{return JSON[_0xae3d('0x7')](this[_0xae3d('0x8')](_0xae3d('0x9')));}catch(_0x26282d){return[];}},'set':function(_0xa9a1a){try{this[_0xae3d('0xa')](_0xae3d('0x9'),JSON[_0xae3d('0xb')](_0xa9a1a));}catch(_0x583b98){this[_0xae3d('0xa')](_0xae3d('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xae3d('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xae3d('0xc')]},'col':{'type':Sequelize[_0xae3d('0xc')]},'background':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':_0xae3d('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xae3d('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 0fb669e..9c27d35 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 _0xf8af=['https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','body','create','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','error','stack','send','show','params','model','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','type','attrUrl','attrs'];(function(_0x1f58ff,_0x22a9d1){var _0x14785a=function(_0x487d29){while(--_0x487d29){_0x1f58ff['push'](_0x1f58ff['shift']());}};_0x14785a(++_0x22a9d1);}(_0xf8af,0x8b));var _0xff8a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf8af[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xff8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff8a('0x1'));var jsonpatch=require(_0xff8a('0x2'));var rp=require(_0xff8a('0x3'));var moment=require(_0xff8a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff8a('0x5'));var util=require(_0xff8a('0x6'));var path=require(_0xff8a('0x7'));var sox=require(_0xff8a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff8a('0x9'));var _=require('lodash');var squel=require(_0xff8a('0xa'));var crypto=require(_0xff8a('0xb'));var jsforce=require(_0xff8a('0xc'));var deskjs=require(_0xff8a('0xd'));var toCsv=require(_0xff8a('0xe'));var querystring=require(_0xff8a('0xf'));var Papa=require(_0xff8a('0x10'));var Redis=require(_0xff8a('0x11'));var authService=require(_0xff8a('0x12'));var qs=require(_0xff8a('0x13'));var as=require(_0xff8a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff8a('0x15'))(_0xff8a('0x16'));var utils=require(_0xff8a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff8a('0x18'));var db=require(_0xff8a('0x19'))['db'];config[_0xff8a('0x1a')]=_[_0xff8a('0x1b')](config[_0xff8a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xff8a('0x1c'))(new Redis(config[_0xff8a('0x1a')]));require(_0xff8a('0x1d'))[_0xff8a('0x1e')](socket);function respondWithStatusCode(_0x5d793b,_0x5a17f8){_0x5a17f8=_0x5a17f8||0xcc;return function(_0x559371){if(_0x559371){return _0x5d793b['sendStatus'](_0x5a17f8);}return _0x5d793b[_0xff8a('0x1f')](_0x5a17f8)['end']();};}function respondWithResult(_0x279441,_0x2917a7){_0x2917a7=_0x2917a7||0xc8;return function(_0x4e98b0){if(_0x4e98b0){return _0x279441[_0xff8a('0x1f')](_0x2917a7)['json'](_0x4e98b0);}};}function respondWithFilteredResult(_0x5ed382,_0x392f43){return function(_0x68524a){if(_0x68524a){var _0x124cb9=typeof _0x392f43['offset']===_0xff8a('0x20')&&typeof _0x392f43['limit']===_0xff8a('0x20');var _0x4bb5ec=_0x68524a[_0xff8a('0x21')];var _0x1b4272=_0x124cb9?0x0:_0x392f43[_0xff8a('0x22')];var _0xdb1027=_0x124cb9?_0x68524a[_0xff8a('0x21')]:_0x392f43[_0xff8a('0x22')]+_0x392f43[_0xff8a('0x23')];var _0x1ba1f1;if(_0xdb1027>=_0x4bb5ec){_0xdb1027=_0x4bb5ec;_0x1ba1f1=0xc8;}else{_0x1ba1f1=0xce;}_0x5ed382[_0xff8a('0x1f')](_0x1ba1f1);return _0x5ed382[_0xff8a('0x24')](_0xff8a('0x25'),_0x1b4272+'-'+_0xdb1027+'/'+_0x4bb5ec)[_0xff8a('0x26')](_0x68524a);}return null;};}function patchUpdates(_0x3bb4ac){return function(_0x1d9a9b){try{jsonpatch[_0xff8a('0x27')](_0x1d9a9b,_0x3bb4ac,!![]);}catch(_0x5e7897){return BPromise[_0xff8a('0x28')](_0x5e7897);}return _0x1d9a9b[_0xff8a('0x29')]();};}function saveUpdates(_0x2d6d8f,_0x303050){return function(_0x518d33){if(_0x518d33){return _0x518d33[_0xff8a('0x2a')](_0x2d6d8f)['then'](function(_0x1c9ecc){return _0x1c9ecc;});}return null;};}function removeEntity(_0x3f03ce,_0x2c67c2){return function(_0x3fdce3){if(_0x3fdce3){return _0x3fdce3[_0xff8a('0x2b')]()['then'](function(){_0x3f03ce[_0xff8a('0x1f')](0xcc)[_0xff8a('0x2c')]();});}};}function handleEntityNotFound(_0x3063b1,_0x5153f6){return function(_0x2458a0){if(!_0x2458a0){_0x3063b1[_0xff8a('0x2d')](0x194);}return _0x2458a0;};}function handleError(_0x30c36f,_0x2d69d2){_0x2d69d2=_0x2d69d2||0x1f4;return function(_0x38188f){logger[_0xff8a('0x2e')](_0x38188f[_0xff8a('0x2f')]);if(_0x38188f['name']){delete _0x38188f['name'];}_0x30c36f[_0xff8a('0x1f')](_0x2d69d2)[_0xff8a('0x30')](_0x38188f);};}exports[_0xff8a('0x31')]=function(_0x279347,_0x430cbd){var _0x184254={'raw':![],'where':{'id':_0x279347[_0xff8a('0x32')]['id']}},_0x50cb0f={};_0x50cb0f[_0xff8a('0x33')]=_['keys'](db[_0xff8a('0x34')][_0xff8a('0x35')]);_0x50cb0f[_0xff8a('0x36')]=_['keys'](_0x279347[_0xff8a('0x36')]);_0x50cb0f[_0xff8a('0x37')]=_['intersection'](_0x50cb0f[_0xff8a('0x33')],_0x50cb0f[_0xff8a('0x36')]);_0x184254[_0xff8a('0x38')]=_[_0xff8a('0x39')](_0x50cb0f[_0xff8a('0x33')],qs[_0xff8a('0x3a')](_0x279347[_0xff8a('0x36')][_0xff8a('0x3a')]));_0x184254[_0xff8a('0x38')]=_0x184254['attributes'][_0xff8a('0x3b')]?_0x184254[_0xff8a('0x38')]:_0x50cb0f['model'];if(_0x279347[_0xff8a('0x36')][_0xff8a('0x3c')]){_0x184254[_0xff8a('0x3d')]=[{'all':!![]}];}_0x184254=_[_0xff8a('0x3e')]({},_0x184254,_0x279347[_0xff8a('0x3f')]);return db[_0xff8a('0x34')][_0xff8a('0x40')](_0x184254)[_0xff8a('0x41')](handleEntityNotFound(_0x430cbd,null))[_0xff8a('0x41')](respondWithResult(_0x430cbd,null))['catch'](handleError(_0x430cbd,null));};exports['destroy']=function(_0x15a96b,_0x3f58a4){return db['DashboardItem'][_0xff8a('0x40')]({'where':{'id':_0x15a96b[_0xff8a('0x32')]['id']}})['then'](handleEntityNotFound(_0x3f58a4,null))['then'](removeEntity(_0x3f58a4,null))['catch'](handleError(_0x3f58a4,null));};function widgetAttributes(_0x2fd75f){try{switch(_0x2fd75f[_0xff8a('0x42')]){case'iframe':return[{'name':_0xff8a('0x43'),'value':_0x2fd75f[_0xff8a('0x43')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0]['value']:undefined)||_0xff8a('0x45')}];case _0xff8a('0x46'):return[{'name':'attrPath','value':_0x2fd75f[_0xff8a('0x47')]||(_0x2fd75f['attrs']&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x49'):return[{'name':_0xff8a('0x4a'),'value':_0x2fd75f[_0xff8a('0x4a')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f['attrs'][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x4b')},{'name':_0xff8a('0x4c'),'value':_0x2fd75f[_0xff8a('0x4c')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1]['value']:undefined)||_0xff8a('0x4d')},{'name':_0xff8a('0x4e'),'value':_0x2fd75f[_0xff8a('0x4e')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||0xc}];case _0xff8a('0x4f'):return[{'name':_0xff8a('0x50'),'value':_0x2fd75f['attrMetric']||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x51')},{'name':_0xff8a('0x52'),'value':_0x2fd75f[_0xff8a('0x52')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1][_0xff8a('0x48')]:undefined)||[]},{'name':_0xff8a('0x4e'),'value':_0x2fd75f[_0xff8a('0x4e')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||0x14},{'name':_0xff8a('0x53'),'value':_0x2fd75f[_0xff8a('0x53')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x3]?_0x2fd75f[_0xff8a('0x44')][0x3][_0xff8a('0x48')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x2fd75f[_0xff8a('0x54')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x4]?_0x2fd75f[_0xff8a('0x44')][0x4]['value']:undefined)||''},{'name':_0xff8a('0x55'),'value':_0x2fd75f[_0xff8a('0x55')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x5]?_0x2fd75f[_0xff8a('0x44')][0x5][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x56'),'value':_0x2fd75f[_0xff8a('0x56')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x6]?_0x2fd75f[_0xff8a('0x44')][0x6]['value']:undefined)||''},{'name':_0xff8a('0x57'),'value':_0x2fd75f[_0xff8a('0x57')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x7]?_0x2fd75f[_0xff8a('0x44')][0x7]['value']:undefined)||''},{'name':_0xff8a('0x58'),'value':_0x2fd75f[_0xff8a('0x58')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x8]?_0x2fd75f[_0xff8a('0x44')][0x8][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x59'),'value':_0x2fd75f[_0xff8a('0x59')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x9]?_0x2fd75f[_0xff8a('0x44')][0x9][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x5a'):case _0xff8a('0x5b'):return[{'name':'attrSerie1','value':_0x2fd75f[_0xff8a('0x5c')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f['attrs'][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x51')},{'name':_0xff8a('0x5d'),'value':_0x2fd75f[_0xff8a('0x5d')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x5e'),'value':_0x2fd75f[_0xff8a('0x5e')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x52'),'value':_0x2fd75f[_0xff8a('0x52')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x3]?_0x2fd75f[_0xff8a('0x44')][0x3]['value']:undefined)||[]},{'name':_0xff8a('0x53'),'value':_0x2fd75f[_0xff8a('0x53')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x4]?_0x2fd75f[_0xff8a('0x44')][0x4][_0xff8a('0x48')]:undefined)||_0xff8a('0x5f')},{'name':_0xff8a('0x54'),'value':_0x2fd75f[_0xff8a('0x54')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x5]?_0x2fd75f[_0xff8a('0x44')][0x5]['value']:undefined)||''},{'name':_0xff8a('0x55'),'value':_0x2fd75f[_0xff8a('0x55')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x6]?_0x2fd75f[_0xff8a('0x44')][0x6][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x56'),'value':_0x2fd75f[_0xff8a('0x56')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x7]?_0x2fd75f[_0xff8a('0x44')][0x7]['value']:undefined)||''},{'name':_0xff8a('0x57'),'value':_0x2fd75f['attrOpenchannelAccounts']||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x8]?_0x2fd75f['attrs'][0x8]['value']:undefined)||''},{'name':_0xff8a('0x58'),'value':_0x2fd75f[_0xff8a('0x58')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x9]?_0x2fd75f[_0xff8a('0x44')][0x9]['value']:undefined)||''},{'name':_0xff8a('0x59'),'value':_0x2fd75f[_0xff8a('0x59')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0xa]?_0x2fd75f['attrs'][0xa][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x60'):return[{'name':_0xff8a('0x61'),'type':_0x2fd75f[_0xff8a('0x62')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0]['type']:undefined)||null,'value':_0x2fd75f[_0xff8a('0x61')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x63'),'value':_0x2fd75f[_0xff8a('0x63')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5acf87){logger[_0xff8a('0x2e')](_0xff8a('0x64'),JSON['stringify'](_0x5acf87));return[];}}exports['create']=function(_0x40e4ee,_0x4ddc06){if(_0x40e4ee[_0xff8a('0x65')]){_0x40e4ee[_0xff8a('0x65')][_0xff8a('0x44')]=widgetAttributes(_0x40e4ee[_0xff8a('0x65')]);}return db[_0xff8a('0x34')][_0xff8a('0x66')](_0x40e4ee[_0xff8a('0x65')],{})[_0xff8a('0x41')](respondWithResult(_0x4ddc06,0xc9))[_0xff8a('0x67')](handleError(_0x4ddc06,null));};exports[_0xff8a('0x2a')]=function(_0x182026,_0x48d8e7){if(_0x182026[_0xff8a('0x65')]['id']){delete _0x182026[_0xff8a('0x65')]['id'];}_0x182026[_0xff8a('0x65')]['attrs']=widgetAttributes(_0x182026[_0xff8a('0x65')]);return db[_0xff8a('0x34')]['find']({'where':{'id':_0x182026[_0xff8a('0x32')]['id']}})['then'](handleEntityNotFound(_0x48d8e7,null))[_0xff8a('0x41')](saveUpdates(_0x182026[_0xff8a('0x65')],null))[_0xff8a('0x41')](respondWithResult(_0x48d8e7,null))[_0xff8a('0x67')](handleError(_0x48d8e7,null));}; \ No newline at end of file +var _0x1561=['attrRefresh','widgetAttributes:\x20%s','create','body','DashboardItem','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','show','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','params','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrFaxAccounts','attrReport','reportType'];(function(_0x10a7b2,_0x37587c){var _0x5cf00e=function(_0x69b0b9){while(--_0x69b0b9){_0x10a7b2['push'](_0x10a7b2['shift']());}};_0x5cf00e(++_0x37587c);}(_0x1561,0x1bd));var _0x1156=function(_0x22ad1c,_0x265c13){_0x22ad1c=_0x22ad1c-0x0;var _0x7744b0=_0x1561[_0x22ad1c];return _0x7744b0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1156('0x0'));var jsonpatch=require(_0x1156('0x1'));var rp=require(_0x1156('0x2'));var moment=require(_0x1156('0x3'));var BPromise=require(_0x1156('0x4'));var Mustache=require('mustache');var util=require(_0x1156('0x5'));var path=require(_0x1156('0x6'));var sox=require(_0x1156('0x7'));var csv=require(_0x1156('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1156('0x9'));var _=require('lodash');var squel=require(_0x1156('0xa'));var crypto=require(_0x1156('0xb'));var jsforce=require(_0x1156('0xc'));var deskjs=require(_0x1156('0xd'));var toCsv=require(_0x1156('0x8'));var querystring=require('querystring');var Papa=require(_0x1156('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1156('0xf'));var as=require(_0x1156('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1156('0x11'))('api');var utils=require(_0x1156('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1156('0x13'));var db=require(_0x1156('0x14'))['db'];config['redis']=_['defaults'](config[_0x1156('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x1156('0x16'))(new Redis(config[_0x1156('0x15')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x3a7c28,_0xf521c2){_0xf521c2=_0xf521c2||0xcc;return function(_0x9673ef){if(_0x9673ef){return _0x3a7c28['sendStatus'](_0xf521c2);}return _0x3a7c28['status'](_0xf521c2)[_0x1156('0x17')]();};}function respondWithResult(_0x236d32,_0x3c244d){_0x3c244d=_0x3c244d||0xc8;return function(_0x399417){if(_0x399417){return _0x236d32[_0x1156('0x18')](_0x3c244d)[_0x1156('0x19')](_0x399417);}};}function respondWithFilteredResult(_0x2c1ff5,_0x6dd20){return function(_0x2d820d){if(_0x2d820d){var _0x211e6b=typeof _0x6dd20[_0x1156('0x1a')]==='undefined'&&typeof _0x6dd20[_0x1156('0x1b')]===_0x1156('0x1c');var _0x40eab4=_0x2d820d['count'];var _0x30353b=_0x211e6b?0x0:_0x6dd20[_0x1156('0x1a')];var _0x33f611=_0x211e6b?_0x2d820d[_0x1156('0x1d')]:_0x6dd20[_0x1156('0x1a')]+_0x6dd20[_0x1156('0x1b')];var _0x3633ef;if(_0x33f611>=_0x40eab4){_0x33f611=_0x40eab4;_0x3633ef=0xc8;}else{_0x3633ef=0xce;}_0x2c1ff5[_0x1156('0x18')](_0x3633ef);return _0x2c1ff5['set'](_0x1156('0x1e'),_0x30353b+'-'+_0x33f611+'/'+_0x40eab4)['json'](_0x2d820d);}return null;};}function patchUpdates(_0x40f190){return function(_0x271515){try{jsonpatch[_0x1156('0x1f')](_0x271515,_0x40f190,!![]);}catch(_0x4a1abe){return BPromise[_0x1156('0x20')](_0x4a1abe);}return _0x271515[_0x1156('0x21')]();};}function saveUpdates(_0x28caf5,_0x2946b5){return function(_0xdcc9dd){if(_0xdcc9dd){return _0xdcc9dd[_0x1156('0x22')](_0x28caf5)['then'](function(_0xa5ffd7){return _0xa5ffd7;});}return null;};}function removeEntity(_0x4599c8,_0x204acc){return function(_0x178383){if(_0x178383){return _0x178383[_0x1156('0x23')]()[_0x1156('0x24')](function(){_0x4599c8[_0x1156('0x18')](0xcc)[_0x1156('0x17')]();});}};}function handleEntityNotFound(_0x195aef,_0x2826e9){return function(_0x225502){if(!_0x225502){_0x195aef[_0x1156('0x25')](0x194);}return _0x225502;};}function handleError(_0x1af5b2,_0x17bf39){_0x17bf39=_0x17bf39||0x1f4;return function(_0x4f5c32){logger[_0x1156('0x26')](_0x4f5c32[_0x1156('0x27')]);if(_0x4f5c32['name']){delete _0x4f5c32[_0x1156('0x28')];}_0x1af5b2[_0x1156('0x18')](_0x17bf39)['send'](_0x4f5c32);};}exports[_0x1156('0x29')]=function(_0x3e4cc3,_0x5299d3){var _0x12a68e={'raw':![],'where':{'id':_0x3e4cc3['params']['id']}},_0x265406={};_0x265406[_0x1156('0x2a')]=_[_0x1156('0x2b')](db['DashboardItem'][_0x1156('0x2c')]);_0x265406[_0x1156('0x2d')]=_['keys'](_0x3e4cc3[_0x1156('0x2d')]);_0x265406[_0x1156('0x2e')]=_[_0x1156('0x2f')](_0x265406[_0x1156('0x2a')],_0x265406['query']);_0x12a68e['attributes']=_[_0x1156('0x2f')](_0x265406[_0x1156('0x2a')],qs[_0x1156('0x30')](_0x3e4cc3[_0x1156('0x2d')][_0x1156('0x30')]));_0x12a68e[_0x1156('0x31')]=_0x12a68e[_0x1156('0x31')][_0x1156('0x32')]?_0x12a68e[_0x1156('0x31')]:_0x265406['model'];if(_0x3e4cc3['query'][_0x1156('0x33')]){_0x12a68e['include']=[{'all':!![]}];}_0x12a68e=_[_0x1156('0x34')]({},_0x12a68e,_0x3e4cc3[_0x1156('0x35')]);return db['DashboardItem'][_0x1156('0x36')](_0x12a68e)[_0x1156('0x24')](handleEntityNotFound(_0x5299d3,null))[_0x1156('0x24')](respondWithResult(_0x5299d3,null))[_0x1156('0x37')](handleError(_0x5299d3,null));};exports['destroy']=function(_0x20c243,_0xa68f3d){return db['DashboardItem'][_0x1156('0x36')]({'where':{'id':_0x20c243[_0x1156('0x38')]['id']}})[_0x1156('0x24')](handleEntityNotFound(_0xa68f3d,null))[_0x1156('0x24')](removeEntity(_0xa68f3d,null))['catch'](handleError(_0xa68f3d,null));};function widgetAttributes(_0x44aeaf){try{switch(_0x44aeaf['type']){case'iframe':return[{'name':_0x1156('0x39'),'value':_0x44aeaf['attrUrl']||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf['attrs'][0x0]?_0x44aeaf['attrs'][0x0][_0x1156('0x3b')]:undefined)||_0x1156('0x3c')}];case _0x1156('0x3d'):return[{'name':_0x1156('0x3e'),'value':_0x44aeaf[_0x1156('0x3e')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x0]?_0x44aeaf['attrs'][0x0][_0x1156('0x3b')]:undefined)||''}];case'clock':return[{'name':_0x1156('0x3f'),'value':_0x44aeaf['attrHourFormat']||(_0x44aeaf['attrs']&&_0x44aeaf[_0x1156('0x3a')][0x0]?_0x44aeaf[_0x1156('0x3a')][0x0][_0x1156('0x3b')]:undefined)||_0x1156('0x40')},{'name':_0x1156('0x41'),'value':_0x44aeaf[_0x1156('0x41')]||(_0x44aeaf['attrs']&&_0x44aeaf[_0x1156('0x3a')][0x1]?_0x44aeaf[_0x1156('0x3a')][0x1][_0x1156('0x3b')]:undefined)||_0x1156('0x42')},{'name':_0x1156('0x43'),'value':_0x44aeaf[_0x1156('0x43')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf['attrs'][0x2]?_0x44aeaf['attrs'][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x1156('0x44'),'value':_0x44aeaf[_0x1156('0x44')]||(_0x44aeaf['attrs']&&_0x44aeaf['attrs'][0x0]?_0x44aeaf['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x1156('0x45'),'value':_0x44aeaf[_0x1156('0x45')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf['attrs'][0x1]?_0x44aeaf[_0x1156('0x3a')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x44aeaf[_0x1156('0x43')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x2]?_0x44aeaf[_0x1156('0x3a')][0x2][_0x1156('0x3b')]:undefined)||0x14},{'name':_0x1156('0x46'),'value':_0x44aeaf[_0x1156('0x46')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf['attrs'][0x3]?_0x44aeaf[_0x1156('0x3a')][0x3][_0x1156('0x3b')]:undefined)||'voice'},{'name':_0x1156('0x47'),'value':_0x44aeaf[_0x1156('0x47')]||(_0x44aeaf['attrs']&&_0x44aeaf[_0x1156('0x3a')][0x4]?_0x44aeaf['attrs'][0x4][_0x1156('0x3b')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x44aeaf['attrFaxAccounts']||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x5]?_0x44aeaf[_0x1156('0x3a')][0x5][_0x1156('0x3b')]:undefined)||''},{'name':_0x1156('0x48'),'value':_0x44aeaf[_0x1156('0x48')]||(_0x44aeaf['attrs']&&_0x44aeaf[_0x1156('0x3a')][0x6]?_0x44aeaf['attrs'][0x6][_0x1156('0x3b')]:undefined)||''},{'name':_0x1156('0x49'),'value':_0x44aeaf[_0x1156('0x49')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x7]?_0x44aeaf[_0x1156('0x3a')][0x7][_0x1156('0x3b')]:undefined)||''},{'name':_0x1156('0x4a'),'value':_0x44aeaf[_0x1156('0x4a')]||(_0x44aeaf['attrs']&&_0x44aeaf[_0x1156('0x3a')][0x8]?_0x44aeaf[_0x1156('0x3a')][0x8][_0x1156('0x3b')]:undefined)||''},{'name':_0x1156('0x4b'),'value':_0x44aeaf['attrChatWebsites']||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x9]?_0x44aeaf[_0x1156('0x3a')][0x9]['value']:undefined)||''}];case _0x1156('0x4c'):case _0x1156('0x4d'):return[{'name':_0x1156('0x4e'),'value':_0x44aeaf[_0x1156('0x4e')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x0]?_0x44aeaf['attrs'][0x0][_0x1156('0x3b')]:undefined)||'total'},{'name':'attrSerie2','value':_0x44aeaf[_0x1156('0x4f')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x1]?_0x44aeaf[_0x1156('0x3a')][0x1][_0x1156('0x3b')]:undefined)||null},{'name':'attrSerie3','value':_0x44aeaf['attrSerie3']||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x2]?_0x44aeaf['attrs'][0x2][_0x1156('0x3b')]:undefined)||null},{'name':_0x1156('0x45'),'value':_0x44aeaf[_0x1156('0x45')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x3]?_0x44aeaf[_0x1156('0x3a')][0x3]['value']:undefined)||[]},{'name':_0x1156('0x46'),'value':_0x44aeaf[_0x1156('0x46')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x4]?_0x44aeaf['attrs'][0x4][_0x1156('0x3b')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x44aeaf['attrEmailAccounts']||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x5]?_0x44aeaf[_0x1156('0x3a')][0x5][_0x1156('0x3b')]:undefined)||''},{'name':_0x1156('0x50'),'value':_0x44aeaf[_0x1156('0x50')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf['attrs'][0x6]?_0x44aeaf['attrs'][0x6]['value']:undefined)||''},{'name':_0x1156('0x48'),'value':_0x44aeaf[_0x1156('0x48')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x7]?_0x44aeaf[_0x1156('0x3a')][0x7][_0x1156('0x3b')]:undefined)||''},{'name':_0x1156('0x49'),'value':_0x44aeaf['attrOpenchannelAccounts']||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x8]?_0x44aeaf['attrs'][0x8][_0x1156('0x3b')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x44aeaf[_0x1156('0x4a')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x9]?_0x44aeaf[_0x1156('0x3a')][0x9]['value']:undefined)||''},{'name':_0x1156('0x4b'),'value':_0x44aeaf['attrChatWebsites']||(_0x44aeaf['attrs']&&_0x44aeaf['attrs'][0xa]?_0x44aeaf['attrs'][0xa][_0x1156('0x3b')]:undefined)||''}];case'web-report':return[{'name':_0x1156('0x51'),'type':_0x44aeaf[_0x1156('0x52')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x0]?_0x44aeaf[_0x1156('0x3a')][0x0]['type']:undefined)||null,'value':_0x44aeaf['attrReport']||(_0x44aeaf['attrs']&&_0x44aeaf['attrs'][0x0]?_0x44aeaf[_0x1156('0x3a')][0x0]['value']:undefined)||null},{'name':_0x1156('0x53'),'value':_0x44aeaf[_0x1156('0x53')]||(_0x44aeaf[_0x1156('0x3a')]&&_0x44aeaf[_0x1156('0x3a')][0x1]?_0x44aeaf[_0x1156('0x3a')][0x1][_0x1156('0x3b')]:undefined)||0x0}];default:return[];}}catch(_0x1f9dd9){logger[_0x1156('0x26')](_0x1156('0x54'),JSON['stringify'](_0x1f9dd9));return[];}}exports[_0x1156('0x55')]=function(_0x179e95,_0x18f737){if(_0x179e95[_0x1156('0x56')]){_0x179e95[_0x1156('0x56')][_0x1156('0x3a')]=widgetAttributes(_0x179e95[_0x1156('0x56')]);}return db[_0x1156('0x57')]['create'](_0x179e95['body'],{})[_0x1156('0x24')](respondWithResult(_0x18f737,0xc9))[_0x1156('0x37')](handleError(_0x18f737,null));};exports[_0x1156('0x22')]=function(_0x2d34ce,_0x32c7fd){if(_0x2d34ce[_0x1156('0x56')]['id']){delete _0x2d34ce[_0x1156('0x56')]['id'];}_0x2d34ce[_0x1156('0x56')][_0x1156('0x3a')]=widgetAttributes(_0x2d34ce['body']);return db[_0x1156('0x57')][_0x1156('0x36')]({'where':{'id':_0x2d34ce[_0x1156('0x38')]['id']}})['then'](handleEntityNotFound(_0x32c7fd,null))[_0x1156('0x24')](saveUpdates(_0x2d34ce[_0x1156('0x56')],null))[_0x1156('0x24')](respondWithResult(_0x32c7fd,null))[_0x1156('0x37')](handleError(_0x32c7fd,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 5a71409..3480b07 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 _0x4198=['DashboardItem','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x12e2b6,_0x456d4a){var _0x402ea3=function(_0x3898e1){while(--_0x3898e1){_0x12e2b6['push'](_0x12e2b6['shift']());}};_0x402ea3(++_0x456d4a);}(_0x4198,0x174));var _0x8419=function(_0x4de142,_0x1e77e7){_0x4de142=_0x4de142-0x0;var _0x568b8e=_0x4198[_0x4de142];return _0x568b8e;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0x8419('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x8419('0x1')](0x0);var events={'afterCreate':_0x8419('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3fbf4d){return function(_0xbb8734,_0x41bb91,_0x51d59c){DashboardItemEvents[_0x8419('0x3')](_0x3fbf4d+':'+_0xbb8734['id'],_0xbb8734);DashboardItemEvents[_0x8419('0x3')](_0x3fbf4d,_0xbb8734);_0x51d59c(null);};}for(var e in events){if(events[_0x8419('0x4')](e)){var event=events[e];DashboardItem[_0x8419('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x803d=['update','remove','emit','hasOwnProperty','hook','exports','events','DashboardItem','setMaxListeners','save'];(function(_0x3a9a6a,_0x51afcd){var _0xc860c8=function(_0x4578b6){while(--_0x4578b6){_0x3a9a6a['push'](_0x3a9a6a['shift']());}};_0xc860c8(++_0x51afcd);}(_0x803d,0x15a));var _0xd803=function(_0x49ee48,_0x52b2ff){_0x49ee48=_0x49ee48-0x0;var _0x1a3a64=_0x803d[_0x49ee48];return _0x1a3a64;};'use strict';var EventEmitter=require(_0xd803('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xd803('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd803('0x2')](0x0);var events={'afterCreate':_0xd803('0x3'),'afterUpdate':_0xd803('0x4'),'afterDestroy':_0xd803('0x5')};function emitEvent(_0x11253c){return function(_0x57138a,_0xc67786,_0x55e3d2){DashboardItemEvents[_0xd803('0x6')](_0x11253c+':'+_0x57138a['id'],_0x57138a);DashboardItemEvents[_0xd803('0x6')](_0x11253c,_0x57138a);_0x55e3d2(null);};}for(var e in events){if(events[_0xd803('0x7')](e)){var event=events[e];DashboardItem[_0xd803('0x8')](e,emitEvent(event));}}module[_0xd803('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 3abf95e..2da02f6 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 _0xffcc=['DashboardItem','util','api','moment','rimraf','./dashboardItem.attributes','define'];(function(_0x4a6462,_0x61b1b5){var _0x122407=function(_0x42618b){while(--_0x42618b){_0x4a6462['push'](_0x4a6462['shift']());}};_0x122407(++_0x61b1b5);}(_0xffcc,0x112));var _0xcffc=function(_0x5c87bf,_0x4c8df5){_0x5c87bf=_0x5c87bf-0x0;var _0x19644a=_0xffcc[_0x5c87bf];return _0x19644a;};'use strict';var _=require('lodash');var util=require(_0xcffc('0x0'));var logger=require('../../config/logger')(_0xcffc('0x1'));var moment=require(_0xcffc('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcffc('0x3'));var config=require('../../config/environment');var attributes=require(_0xcffc('0x4'));module['exports']=function(_0x3e3133,_0x4563a2){return _0x3e3133[_0xcffc('0x5')](_0xcffc('0x6'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cd2=['DashboardItem','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x4ad441,_0x28f14f){var _0x3693b6=function(_0x3813a9){while(--_0x3813a9){_0x4ad441['push'](_0x4ad441['shift']());}};_0x3693b6(++_0x28f14f);}(_0x7cd2,0x118));var _0x27cd=function(_0x180861,_0x2acb76){_0x180861=_0x180861-0x0;var _0x514d29=_0x7cd2[_0x180861];return _0x514d29;};'use strict';var _=require('lodash');var util=require(_0x27cd('0x0'));var logger=require(_0x27cd('0x1'))(_0x27cd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x27cd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27cd('0x4'));var config=require(_0x27cd('0x5'));var attributes=require(_0x27cd('0x6'));module[_0x27cd('0x7')]=function(_0x2646a9,_0x38098b){return _0x2646a9['define'](_0x27cd('0x8'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 8bea492..5144775 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 _0x3696=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x24faf8,_0x38f806){var _0x2914cc=function(_0x12bf09){while(--_0x12bf09){_0x24faf8['push'](_0x24faf8['shift']());}};_0x2914cc(++_0x38f806);}(_0x3696,0x191));var _0x6369=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x3696[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x6369('0x0'));var util=require(_0x6369('0x1'));var moment=require(_0x6369('0x2'));var BPromise=require(_0x6369('0x3'));var rs=require(_0x6369('0x4'));var fs=require('fs');var Redis=require(_0x6369('0x5'));var db=require(_0x6369('0x6'))['db'];var utils=require(_0x6369('0x7'));var logger=require('../../config/logger')(_0x6369('0x8'));var config=require(_0x6369('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6369('0xa')]['http']({'port':0x232a});config[_0x6369('0xb')]=_[_0x6369('0xc')](config[_0x6369('0xb')],{'host':_0x6369('0xd'),'port':0x18eb});var socket=require(_0x6369('0xe'))(new Redis(config[_0x6369('0xb')]));require(_0x6369('0xf'))[_0x6369('0x10')](socket);function respondWithRpcPromise(_0x29e22d,_0x314768,_0x1bfb74){return new BPromise(function(_0x1b21df,_0x2cb71e){return client[_0x6369('0x11')](_0x29e22d,_0x1bfb74)[_0x6369('0x12')](function(_0x777749){logger['info'](_0x6369('0x13'),_0x314768,_0x6369('0x14'));logger[_0x6369('0x15')](_0x6369('0x16'),_0x314768,_0x6369('0x14'),JSON[_0x6369('0x17')](_0x777749));if(_0x777749[_0x6369('0x18')]){if(_0x777749[_0x6369('0x18')]['code']===0x1f4){logger[_0x6369('0x18')](_0x6369('0x13'),_0x314768,_0x777749[_0x6369('0x18')]['message']);return _0x2cb71e(_0x777749['error'][_0x6369('0x19')]);}logger['error'](_0x6369('0x13'),_0x314768,_0x777749[_0x6369('0x18')][_0x6369('0x19')]);return _0x1b21df(_0x777749[_0x6369('0x18')][_0x6369('0x19')]);}else{logger[_0x6369('0x1a')](_0x6369('0x13'),_0x314768,'request\x20sent');_0x1b21df(_0x777749[_0x6369('0x1b')][_0x6369('0x19')]);}})[_0x6369('0x1c')](function(_0x52a668){logger[_0x6369('0x18')]('DashboardItem,\x20%s,\x20%s',_0x314768,_0x52a668);_0x2cb71e(_0x52a668);});});} \ No newline at end of file +var _0xd4ca=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','request','info','DashboardItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x5b80a8,_0x571b3c){var _0x227b0a=function(_0x4c3c65){while(--_0x4c3c65){_0x5b80a8['push'](_0x5b80a8['shift']());}};_0x227b0a(++_0x571b3c);}(_0xd4ca,0xb4));var _0xad4c=function(_0x2f2c65,_0x246a0c){_0x2f2c65=_0x2f2c65-0x0;var _0x89664b=_0xd4ca[_0x2f2c65];return _0x89664b;};'use strict';var _=require(_0xad4c('0x0'));var util=require(_0xad4c('0x1'));var moment=require(_0xad4c('0x2'));var BPromise=require(_0xad4c('0x3'));var rs=require(_0xad4c('0x4'));var fs=require('fs');var Redis=require(_0xad4c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xad4c('0x6'))(_0xad4c('0x7'));var config=require(_0xad4c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xad4c('0x9')][_0xad4c('0xa')]({'port':0x232a});config[_0xad4c('0xb')]=_[_0xad4c('0xc')](config[_0xad4c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xad4c('0xd'))(new Redis(config[_0xad4c('0xb')]));require(_0xad4c('0xe'))['register'](socket);function respondWithRpcPromise(_0x46c9a4,_0x130213,_0x1e30a7){return new BPromise(function(_0x35be26,_0x2d2a98){return client[_0xad4c('0xf')](_0x46c9a4,_0x1e30a7)['then'](function(_0x76ebfb){logger[_0xad4c('0x10')](_0xad4c('0x11'),_0x130213,'request\x20sent');logger[_0xad4c('0x12')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x130213,_0xad4c('0x13'),JSON[_0xad4c('0x14')](_0x76ebfb));if(_0x76ebfb[_0xad4c('0x15')]){if(_0x76ebfb['error'][_0xad4c('0x16')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x130213,_0x76ebfb[_0xad4c('0x15')]['message']);return _0x2d2a98(_0x76ebfb['error'][_0xad4c('0x17')]);}logger[_0xad4c('0x15')](_0xad4c('0x11'),_0x130213,_0x76ebfb[_0xad4c('0x15')][_0xad4c('0x17')]);return _0x35be26(_0x76ebfb[_0xad4c('0x15')][_0xad4c('0x17')]);}else{logger[_0xad4c('0x10')](_0xad4c('0x11'),_0x130213,_0xad4c('0x13'));_0x35be26(_0x76ebfb[_0xad4c('0x18')][_0xad4c('0x17')]);}})[_0xad4c('0x19')](function(_0x2e00f0){logger['error'](_0xad4c('0x11'),_0x130213,_0x2e00f0);_0x2d2a98(_0x2e00f0);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 0f9e183..1c24afa 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 _0xf83d=['save','update','emit','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x4efd72,_0xf82337){var _0x17e3eb=function(_0x6f1155){while(--_0x6f1155){_0x4efd72['push'](_0x4efd72['shift']());}};_0x17e3eb(++_0xf82337);}(_0xf83d,0x15d));var _0xdf83=function(_0x257574,_0x572286){_0x257574=_0x257574-0x0;var _0x25623a=_0xf83d[_0x257574];return _0x25623a;};'use strict';var DashboardItemEvents=require(_0xdf83('0x0'));var events=[_0xdf83('0x1'),'remove',_0xdf83('0x2')];function createListener(_0x279f47,_0x22f1b4){return function(_0x41c0ff){_0x22f1b4[_0xdf83('0x3')](_0x279f47,_0x41c0ff);};}function removeListener(_0x41b863,_0xde7aa3){return function(){DashboardItemEvents['removeListener'](_0x41b863,_0xde7aa3);};}exports[_0xdf83('0x4')]=function(_0x39c1bf){for(var _0x3abc30=0x0,_0x3af310=events[_0xdf83('0x5')];_0x3abc30<_0x3af310;_0x3abc30++){var _0x287355=events[_0x3abc30];var _0x57b19e=createListener(_0xdf83('0x6')+_0x287355,_0x39c1bf);DashboardItemEvents['on'](_0x287355,_0x57b19e);}}; \ No newline at end of file +var _0x7b08=['emit','length','remove'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x7b08,0x98));var _0x87b0=function(_0x477d06,_0xb9a044){_0x477d06=_0x477d06-0x0;var _0x36fd67=_0x7b08[_0x477d06];return _0x36fd67;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x87b0('0x0'),'update'];function createListener(_0x20aa16,_0x4a1ec2){return function(_0x2661b5){_0x4a1ec2[_0x87b0('0x1')](_0x20aa16,_0x2661b5);};}function removeListener(_0x21bb7a,_0xe7263){return function(){DashboardItemEvents['removeListener'](_0x21bb7a,_0xe7263);};}exports['register']=function(_0x149df6){for(var _0x384b9a=0x0,_0x3867a6=events[_0x87b0('0x2')];_0x384b9a<_0x3867a6;_0x384b9a++){var _0xacc3bc=events[_0x384b9a];var _0x4b5602=createListener('dashboardItem:'+_0xacc3bc,_0x149df6);DashboardItemEvents['on'](_0xacc3bc,_0x4b5602);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index f1d5f24..78cb4d1 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 _0x496b=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','post','isAuthenticated','create','put','update','destroy','multer','util'];(function(_0x5a2162,_0x5a90a3){var _0x4561a7=function(_0x11849e){while(--_0x11849e){_0x5a2162['push'](_0x5a2162['shift']());}};_0x4561a7(++_0x5a90a3);}(_0x496b,0x16e));var _0xb496=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x496b[_0x2283dc];return _0x16db90;};'use strict';var multer=require(_0xb496('0x0'));var util=require(_0xb496('0x1'));var path=require(_0xb496('0x2'));var timeout=require(_0xb496('0x3'));var express=require(_0xb496('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb496('0x5'));var interaction=require(_0xb496('0x6'));var config=require(_0xb496('0x7'));var controller=require('./dashboardItem.controller');router['get'](_0xb496('0x8'),auth['isAuthenticated'](),controller[_0xb496('0x9')]);router[_0xb496('0xa')]('/',auth[_0xb496('0xb')](),controller[_0xb496('0xc')]);router[_0xb496('0xd')](_0xb496('0x8'),auth['isAuthenticated'](),controller[_0xb496('0xe')]);router['delete'](_0xb496('0x8'),auth[_0xb496('0xb')](),controller[_0xb496('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9e22=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x558a32,_0x186b9e){var _0x7185b4=function(_0x257277){while(--_0x257277){_0x558a32['push'](_0x558a32['shift']());}};_0x7185b4(++_0x186b9e);}(_0x9e22,0x143));var _0x29e2=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0x9e22[_0x53fe97];return _0x5c49a2;};'use strict';var multer=require(_0x29e2('0x0'));var util=require(_0x29e2('0x1'));var path=require('path');var timeout=require(_0x29e2('0x2'));var express=require('express');var router=express[_0x29e2('0x3')]();var fs_extra=require(_0x29e2('0x4'));var auth=require(_0x29e2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x29e2('0x6'));var controller=require('./dashboardItem.controller');router[_0x29e2('0x7')]('/:id',auth[_0x29e2('0x8')](),controller[_0x29e2('0x9')]);router[_0x29e2('0xa')]('/',auth[_0x29e2('0x8')](),controller[_0x29e2('0xb')]);router[_0x29e2('0xc')](_0x29e2('0xd'),auth[_0x29e2('0x8')](),controller[_0x29e2('0xe')]);router[_0x29e2('0xf')]('/:id',auth[_0x29e2('0x8')](),controller[_0x29e2('0x10')]);module[_0x29e2('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 31e5dd6..2464494 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 _0xae67=['STRING','first','sequelize','exports'];(function(_0x2605bd,_0x101e00){var _0x20c9ba=function(_0x24b0c7){while(--_0x24b0c7){_0x2605bd['push'](_0x2605bd['shift']());}};_0x20c9ba(++_0x101e00);}(_0xae67,0x82));var _0x7ae6=function(_0x30e11a,_0x1f5e33){_0x30e11a=_0x30e11a-0x0;var _0x1ccd24=_0xae67[_0x30e11a];return _0x1ccd24;};'use strict';var Sequelize=require(_0x7ae6('0x0'));module[_0x7ae6('0x1')]={'name':{'type':Sequelize[_0x7ae6('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first','second','third'),'allowNull':![],'defaultValue':_0x7ae6('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc3ac=['STRING','ENUM','first','third','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc3ac,0x1f0));var _0xcc3a=function(_0x611333,_0x1121a){_0x611333=_0x611333-0x0;var _0x3726c3=_0xc3ac[_0x611333];return _0x3726c3;};'use strict';var Sequelize=require(_0xcc3a('0x0'));module[_0xcc3a('0x1')]={'name':{'type':Sequelize[_0xcc3a('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xcc3a('0x3')](_0xcc3a('0x4'),'second',_0xcc3a('0x5')),'allowNull':![],'defaultValue':_0xcc3a('0x4')},'description':{'type':Sequelize[_0xcc3a('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 77029ed..d6966c6 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 _0xef27=['stack','name','send','index','map','Disposition','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','get','Dispositions','UserProfileResource','end','error'];(function(_0x814238,_0x3ccddc){var _0x593b88=function(_0x333899){while(--_0x333899){_0x814238['push'](_0x814238['shift']());}};_0x593b88(++_0x3ccddc);}(_0xef27,0x1c2));var _0x7ef2=function(_0x30116d,_0x5664cc){_0x30116d=_0x30116d-0x0;var _0x2ff8ab=_0xef27[_0x30116d];return _0x2ff8ab;};'use strict';var emlformat=require(_0x7ef2('0x0'));var rimraf=require(_0x7ef2('0x1'));var zipdir=require(_0x7ef2('0x2'));var jsonpatch=require(_0x7ef2('0x3'));var rp=require('request-promise');var moment=require(_0x7ef2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7ef2('0x5'));var sox=require(_0x7ef2('0x6'));var csv=require(_0x7ef2('0x7'));var ejs=require(_0x7ef2('0x8'));var fs=require('fs');var fs_extra=require(_0x7ef2('0x9'));var _=require(_0x7ef2('0xa'));var squel=require(_0x7ef2('0xb'));var crypto=require(_0x7ef2('0xc'));var jsforce=require(_0x7ef2('0xd'));var deskjs=require(_0x7ef2('0xe'));var toCsv=require(_0x7ef2('0x7'));var querystring=require(_0x7ef2('0xf'));var Papa=require(_0x7ef2('0x10'));var Redis=require(_0x7ef2('0x11'));var authService=require(_0x7ef2('0x12'));var qs=require(_0x7ef2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ef2('0x14'));var logger=require('../../config/logger')(_0x7ef2('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7ef2('0x16'));var db=require(_0x7ef2('0x17'))['db'];function respondWithStatusCode(_0x57834d,_0x3c54a3){_0x3c54a3=_0x3c54a3||0xcc;return function(_0x1b7cf9){if(_0x1b7cf9){return _0x57834d[_0x7ef2('0x18')](_0x3c54a3);}return _0x57834d[_0x7ef2('0x19')](_0x3c54a3)['end']();};}function respondWithResult(_0x368bc9,_0x466e74){_0x466e74=_0x466e74||0xc8;return function(_0x439040){if(_0x439040){return _0x368bc9['status'](_0x466e74)[_0x7ef2('0x1a')](_0x439040);}};}function respondWithFilteredResult(_0x30b964,_0x164bad){return function(_0x5ddb45){if(_0x5ddb45){var _0x341383=typeof _0x164bad[_0x7ef2('0x1b')]===_0x7ef2('0x1c')&&typeof _0x164bad[_0x7ef2('0x1d')]===_0x7ef2('0x1c');var _0x43aa51=_0x5ddb45[_0x7ef2('0x1e')];var _0x3922b0=_0x341383?0x0:_0x164bad['offset'];var _0xee83dd=_0x341383?_0x5ddb45[_0x7ef2('0x1e')]:_0x164bad[_0x7ef2('0x1b')]+_0x164bad[_0x7ef2('0x1d')];var _0x1cce54;if(_0xee83dd>=_0x43aa51){_0xee83dd=_0x43aa51;_0x1cce54=0xc8;}else{_0x1cce54=0xce;}_0x30b964['status'](_0x1cce54);return _0x30b964[_0x7ef2('0x1f')](_0x7ef2('0x20'),_0x3922b0+'-'+_0xee83dd+'/'+_0x43aa51)[_0x7ef2('0x1a')](_0x5ddb45);}return null;};}function patchUpdates(_0x3a6ebb){return function(_0x3ed622){try{jsonpatch['apply'](_0x3ed622,_0x3a6ebb,!![]);}catch(_0x425349){return BPromise[_0x7ef2('0x21')](_0x425349);}return _0x3ed622['save']();};}function saveUpdates(_0x2ca77c,_0x436eb9){return function(_0x49767c){if(_0x49767c){return _0x49767c[_0x7ef2('0x22')](_0x2ca77c)['then'](function(_0x20b07f){return _0x20b07f;});}return null;};}function removeEntity(_0x3f06d1,_0x1b29d5){return function(_0x9c12d){if(_0x9c12d){return _0x9c12d[_0x7ef2('0x23')]()[_0x7ef2('0x24')](function(){var _0x5c3484=_0x9c12d[_0x7ef2('0x25')]({'plain':!![]});var _0x30c3b0=_0x7ef2('0x26');return db[_0x7ef2('0x27')][_0x7ef2('0x23')]({'where':{'type':_0x30c3b0,'resourceId':_0x5c3484['id']}})[_0x7ef2('0x24')](function(){return _0x9c12d;});})[_0x7ef2('0x24')](function(){_0x3f06d1['status'](0xcc)[_0x7ef2('0x28')]();});}};}function handleEntityNotFound(_0x4fd1a5,_0x4f94fa){return function(_0x5af018){if(!_0x5af018){_0x4fd1a5['sendStatus'](0x194);}return _0x5af018;};}function handleError(_0x3fe75b,_0x12e72a){_0x12e72a=_0x12e72a||0x1f4;return function(_0x3823b7){logger[_0x7ef2('0x29')](_0x3823b7[_0x7ef2('0x2a')]);if(_0x3823b7['name']){delete _0x3823b7[_0x7ef2('0x2b')];}_0x3fe75b['status'](_0x12e72a)[_0x7ef2('0x2c')](_0x3823b7);};}exports[_0x7ef2('0x2d')]=function(_0x35f20e,_0x508504){var _0x49293e={},_0x492845={},_0x3f7c25={'count':0x0,'rows':[]};var _0x5725fb=_[_0x7ef2('0x2e')](db[_0x7ef2('0x2f')]['rawAttributes'],function(_0x2e3327){return{'name':_0x2e3327[_0x7ef2('0x30')],'type':_0x2e3327[_0x7ef2('0x31')]['key']};});_0x492845[_0x7ef2('0x32')]=_[_0x7ef2('0x2e')](_0x5725fb,_0x7ef2('0x2b'));_0x492845[_0x7ef2('0x33')]=_[_0x7ef2('0x34')](_0x35f20e[_0x7ef2('0x33')]);_0x492845['filters']=_['intersection'](_0x492845['model'],_0x492845[_0x7ef2('0x33')]);_0x49293e[_0x7ef2('0x35')]=_[_0x7ef2('0x36')](_0x492845[_0x7ef2('0x32')],qs[_0x7ef2('0x37')](_0x35f20e[_0x7ef2('0x33')]['fields']));_0x49293e[_0x7ef2('0x35')]=_0x49293e[_0x7ef2('0x35')][_0x7ef2('0x38')]?_0x49293e[_0x7ef2('0x35')]:_0x492845['model'];if(!_0x35f20e['query'][_0x7ef2('0x39')](_0x7ef2('0x3a'))){_0x49293e[_0x7ef2('0x1d')]=qs[_0x7ef2('0x1d')](_0x35f20e[_0x7ef2('0x33')][_0x7ef2('0x1d')]);_0x49293e[_0x7ef2('0x1b')]=qs[_0x7ef2('0x1b')](_0x35f20e[_0x7ef2('0x33')][_0x7ef2('0x1b')]);}_0x49293e[_0x7ef2('0x3b')]=qs['sort'](_0x35f20e[_0x7ef2('0x33')][_0x7ef2('0x3c')]);_0x49293e[_0x7ef2('0x3d')]=qs[_0x7ef2('0x3e')](_['pick'](_0x35f20e[_0x7ef2('0x33')],_0x492845['filters']),_0x5725fb);if(_0x35f20e[_0x7ef2('0x33')][_0x7ef2('0x3f')]){_0x49293e[_0x7ef2('0x3d')]=_[_0x7ef2('0x40')](_0x49293e['where'],{'$or':_['map'](_0x5725fb,function(_0x1eb737){if(_0x1eb737[_0x7ef2('0x31')]!==_0x7ef2('0x41')){var _0x108ee4={};_0x108ee4[_0x1eb737[_0x7ef2('0x2b')]]={'$like':'%'+_0x35f20e['query'][_0x7ef2('0x3f')]+'%'};return _0x108ee4;}})});}_0x49293e=_[_0x7ef2('0x40')]({},_0x49293e,_0x35f20e[_0x7ef2('0x42')]);var _0x32607e={'where':_0x49293e['where']};return db['Disposition']['count'](_0x32607e)[_0x7ef2('0x24')](function(_0x181f58){_0x3f7c25[_0x7ef2('0x1e')]=_0x181f58;if(_0x35f20e[_0x7ef2('0x33')][_0x7ef2('0x43')]){_0x49293e[_0x7ef2('0x44')]=[{'all':!![]}];}return db[_0x7ef2('0x2f')][_0x7ef2('0x45')](_0x49293e);})[_0x7ef2('0x24')](function(_0x517259){_0x3f7c25['rows']=_0x517259;return _0x3f7c25;})[_0x7ef2('0x24')](respondWithFilteredResult(_0x508504,_0x49293e))[_0x7ef2('0x46')](handleError(_0x508504,null));};exports['show']=function(_0x2b8e34,_0x1de60f){var _0x3fdfac={'raw':!![],'where':{'id':_0x2b8e34[_0x7ef2('0x47')]['id']}},_0x11803f={};_0x11803f[_0x7ef2('0x32')]=_['keys'](db[_0x7ef2('0x2f')][_0x7ef2('0x48')]);_0x11803f[_0x7ef2('0x33')]=_['keys'](_0x2b8e34['query']);_0x11803f['filters']=_[_0x7ef2('0x36')](_0x11803f[_0x7ef2('0x32')],_0x11803f[_0x7ef2('0x33')]);_0x3fdfac[_0x7ef2('0x35')]=_[_0x7ef2('0x36')](_0x11803f['model'],qs['fields'](_0x2b8e34[_0x7ef2('0x33')][_0x7ef2('0x37')]));_0x3fdfac[_0x7ef2('0x35')]=_0x3fdfac[_0x7ef2('0x35')][_0x7ef2('0x38')]?_0x3fdfac[_0x7ef2('0x35')]:_0x11803f[_0x7ef2('0x32')];if(_0x2b8e34[_0x7ef2('0x33')][_0x7ef2('0x43')]){_0x3fdfac['include']=[{'all':!![]}];}_0x3fdfac=_[_0x7ef2('0x40')]({},_0x3fdfac,_0x2b8e34['options']);return db[_0x7ef2('0x2f')][_0x7ef2('0x49')](_0x3fdfac)['then'](handleEntityNotFound(_0x1de60f,null))['then'](respondWithResult(_0x1de60f,null))[_0x7ef2('0x46')](handleError(_0x1de60f,null));};exports[_0x7ef2('0x4a')]=function(_0x24dd20,_0x368d93){return db['Disposition'][_0x7ef2('0x4a')](_0x24dd20[_0x7ef2('0x4b')],{})[_0x7ef2('0x24')](function(_0xbba2af){var _0x5e5876=_0x24dd20[_0x7ef2('0x4c')][_0x7ef2('0x25')]({'plain':!![]});if(!_0x5e5876)throw new Error(_0x7ef2('0x4d'));if(_0x5e5876[_0x7ef2('0x4e')]===_0x7ef2('0x4c')){var _0x4bd329=_0xbba2af['get']({'plain':!![]});var _0x9cecfd='Dispositions';return db[_0x7ef2('0x4f')][_0x7ef2('0x49')]({'where':{'name':_0x9cecfd,'userProfileId':_0x5e5876[_0x7ef2('0x50')]},'raw':!![]})[_0x7ef2('0x24')](function(_0x38eb7a){if(_0x38eb7a&&_0x38eb7a['autoAssociation']===0x0){return db[_0x7ef2('0x27')][_0x7ef2('0x4a')]({'name':_0x4bd329[_0x7ef2('0x2b')],'resourceId':_0x4bd329['id'],'type':_0x38eb7a[_0x7ef2('0x2b')],'sectionId':_0x38eb7a['id']},{})['then'](function(){return _0xbba2af;});}else{return _0xbba2af;}})['catch'](function(_0x226a5f){logger[_0x7ef2('0x29')](_0x7ef2('0x51'),_0x226a5f);throw _0x226a5f;});}return _0xbba2af;})['then'](respondWithResult(_0x368d93,0xc9))[_0x7ef2('0x46')](handleError(_0x368d93,null));};exports[_0x7ef2('0x22')]=function(_0x46ca7f,_0x4c4844){if(_0x46ca7f['body']['id']){delete _0x46ca7f['body']['id'];}return db[_0x7ef2('0x2f')][_0x7ef2('0x49')]({'where':{'id':_0x46ca7f['params']['id']}})['then'](handleEntityNotFound(_0x4c4844,null))['then'](saveUpdates(_0x46ca7f[_0x7ef2('0x4b')],null))[_0x7ef2('0x24')](respondWithResult(_0x4c4844,null))[_0x7ef2('0x46')](handleError(_0x4c4844,null));};exports[_0x7ef2('0x23')]=function(_0x1d7878,_0x40bd73){return db['Disposition'][_0x7ef2('0x49')]({'where':{'id':_0x1d7878['params']['id']}})[_0x7ef2('0x24')](handleEntityNotFound(_0x40bd73,null))[_0x7ef2('0x24')](removeEntity(_0x40bd73,null))[_0x7ef2('0x46')](handleError(_0x40bd73,null));}; \ No newline at end of file +var _0x2b1b=['get','Dispositions','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','length','includeAll','options','Disposition','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy'];(function(_0x1313a6,_0x322a25){var _0x3bc093=function(_0x484501){while(--_0x484501){_0x1313a6['push'](_0x1313a6['shift']());}};_0x3bc093(++_0x322a25);}(_0x2b1b,0x11f));var _0xb2b1=function(_0x5d7b16,_0x274bc2){_0x5d7b16=_0x5d7b16-0x0;var _0x441f4b=_0x2b1b[_0x5d7b16];return _0x441f4b;};'use strict';var emlformat=require(_0xb2b1('0x0'));var rimraf=require(_0xb2b1('0x1'));var zipdir=require(_0xb2b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb2b1('0x3'));var moment=require(_0xb2b1('0x4'));var BPromise=require(_0xb2b1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb2b1('0x6'));var sox=require(_0xb2b1('0x7'));var csv=require(_0xb2b1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb2b1('0x9'));var squel=require(_0xb2b1('0xa'));var crypto=require(_0xb2b1('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb2b1('0x8'));var querystring=require(_0xb2b1('0xc'));var Papa=require(_0xb2b1('0xd'));var Redis=require(_0xb2b1('0xe'));var authService=require(_0xb2b1('0xf'));var qs=require(_0xb2b1('0x10'));var as=require(_0xb2b1('0x11'));var hardwareService=require(_0xb2b1('0x12'));var logger=require(_0xb2b1('0x13'))('api');var utils=require(_0xb2b1('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb2b1('0x15'));var db=require(_0xb2b1('0x16'))['db'];function respondWithStatusCode(_0x211788,_0x1d14d0){_0x1d14d0=_0x1d14d0||0xcc;return function(_0x15e674){if(_0x15e674){return _0x211788[_0xb2b1('0x17')](_0x1d14d0);}return _0x211788[_0xb2b1('0x18')](_0x1d14d0)[_0xb2b1('0x19')]();};}function respondWithResult(_0x2aab62,_0xed6b41){_0xed6b41=_0xed6b41||0xc8;return function(_0x2eee4f){if(_0x2eee4f){return _0x2aab62['status'](_0xed6b41)[_0xb2b1('0x1a')](_0x2eee4f);}};}function respondWithFilteredResult(_0x5db0f3,_0x600647){return function(_0x1fa19e){if(_0x1fa19e){var _0x79cf05=typeof _0x600647['offset']===_0xb2b1('0x1b')&&typeof _0x600647[_0xb2b1('0x1c')]==='undefined';var _0x5c873f=_0x1fa19e[_0xb2b1('0x1d')];var _0x19561c=_0x79cf05?0x0:_0x600647[_0xb2b1('0x1e')];var _0x598eef=_0x79cf05?_0x1fa19e[_0xb2b1('0x1d')]:_0x600647[_0xb2b1('0x1e')]+_0x600647[_0xb2b1('0x1c')];var _0x5edf0e;if(_0x598eef>=_0x5c873f){_0x598eef=_0x5c873f;_0x5edf0e=0xc8;}else{_0x5edf0e=0xce;}_0x5db0f3[_0xb2b1('0x18')](_0x5edf0e);return _0x5db0f3[_0xb2b1('0x1f')](_0xb2b1('0x20'),_0x19561c+'-'+_0x598eef+'/'+_0x5c873f)[_0xb2b1('0x1a')](_0x1fa19e);}return null;};}function patchUpdates(_0x1698b7){return function(_0x25683b){try{jsonpatch['apply'](_0x25683b,_0x1698b7,!![]);}catch(_0x858550){return BPromise['reject'](_0x858550);}return _0x25683b[_0xb2b1('0x21')]();};}function saveUpdates(_0x37f636,_0x4d0efb){return function(_0x1f18f8){if(_0x1f18f8){return _0x1f18f8[_0xb2b1('0x22')](_0x37f636)[_0xb2b1('0x23')](function(_0x92aa66){return _0x92aa66;});}return null;};}function removeEntity(_0x3dd0fc,_0x4bbd80){return function(_0x4046fb){if(_0x4046fb){return _0x4046fb[_0xb2b1('0x24')]()[_0xb2b1('0x23')](function(){var _0x5912d0=_0x4046fb[_0xb2b1('0x25')]({'plain':!![]});var _0x52c959=_0xb2b1('0x26');return db['UserProfileResource'][_0xb2b1('0x24')]({'where':{'type':_0x52c959,'resourceId':_0x5912d0['id']}})[_0xb2b1('0x23')](function(){return _0x4046fb;});})[_0xb2b1('0x23')](function(){_0x3dd0fc[_0xb2b1('0x18')](0xcc)[_0xb2b1('0x19')]();});}};}function handleEntityNotFound(_0x4e4d9f,_0x540750){return function(_0x5858b4){if(!_0x5858b4){_0x4e4d9f[_0xb2b1('0x17')](0x194);}return _0x5858b4;};}function handleError(_0x26dc47,_0x1c9fea){_0x1c9fea=_0x1c9fea||0x1f4;return function(_0x201d17){logger[_0xb2b1('0x27')](_0x201d17[_0xb2b1('0x28')]);if(_0x201d17[_0xb2b1('0x29')]){delete _0x201d17[_0xb2b1('0x29')];}_0x26dc47[_0xb2b1('0x18')](_0x1c9fea)[_0xb2b1('0x2a')](_0x201d17);};}exports[_0xb2b1('0x2b')]=function(_0x479917,_0x12a567){var _0x3a661f={},_0x27a744={},_0x3756c2={'count':0x0,'rows':[]};var _0xf18e80=_[_0xb2b1('0x2c')](db['Disposition'][_0xb2b1('0x2d')],function(_0x105f75){return{'name':_0x105f75['fieldName'],'type':_0x105f75[_0xb2b1('0x2e')][_0xb2b1('0x2f')]};});_0x27a744[_0xb2b1('0x30')]=_['map'](_0xf18e80,_0xb2b1('0x29'));_0x27a744[_0xb2b1('0x31')]=_[_0xb2b1('0x32')](_0x479917['query']);_0x27a744[_0xb2b1('0x33')]=_['intersection'](_0x27a744[_0xb2b1('0x30')],_0x27a744[_0xb2b1('0x31')]);_0x3a661f[_0xb2b1('0x34')]=_[_0xb2b1('0x35')](_0x27a744[_0xb2b1('0x30')],qs[_0xb2b1('0x36')](_0x479917[_0xb2b1('0x31')]['fields']));_0x3a661f[_0xb2b1('0x34')]=_0x3a661f[_0xb2b1('0x34')]['length']?_0x3a661f[_0xb2b1('0x34')]:_0x27a744[_0xb2b1('0x30')];if(!_0x479917[_0xb2b1('0x31')][_0xb2b1('0x37')](_0xb2b1('0x38'))){_0x3a661f[_0xb2b1('0x1c')]=qs[_0xb2b1('0x1c')](_0x479917['query'][_0xb2b1('0x1c')]);_0x3a661f['offset']=qs[_0xb2b1('0x1e')](_0x479917[_0xb2b1('0x31')][_0xb2b1('0x1e')]);}_0x3a661f['order']=qs['sort'](_0x479917[_0xb2b1('0x31')][_0xb2b1('0x39')]);_0x3a661f[_0xb2b1('0x3a')]=qs[_0xb2b1('0x33')](_[_0xb2b1('0x3b')](_0x479917[_0xb2b1('0x31')],_0x27a744[_0xb2b1('0x33')]),_0xf18e80);if(_0x479917['query'][_0xb2b1('0x3c')]){_0x3a661f[_0xb2b1('0x3a')]=_[_0xb2b1('0x3d')](_0x3a661f['where'],{'$or':_['map'](_0xf18e80,function(_0x1d9484){if(_0x1d9484[_0xb2b1('0x2e')]!==_0xb2b1('0x3e')){var _0x1d9ed2={};_0x1d9ed2[_0x1d9484[_0xb2b1('0x29')]]={'$like':'%'+_0x479917['query'][_0xb2b1('0x3c')]+'%'};return _0x1d9ed2;}})});}_0x3a661f=_[_0xb2b1('0x3d')]({},_0x3a661f,_0x479917['options']);var _0x59b506={'where':_0x3a661f[_0xb2b1('0x3a')]};return db['Disposition'][_0xb2b1('0x1d')](_0x59b506)[_0xb2b1('0x23')](function(_0x3cae57){_0x3756c2[_0xb2b1('0x1d')]=_0x3cae57;if(_0x479917[_0xb2b1('0x31')]['includeAll']){_0x3a661f[_0xb2b1('0x3f')]=[{'all':!![]}];}return db['Disposition'][_0xb2b1('0x40')](_0x3a661f);})[_0xb2b1('0x23')](function(_0xa70bc3){_0x3756c2['rows']=_0xa70bc3;return _0x3756c2;})['then'](respondWithFilteredResult(_0x12a567,_0x3a661f))[_0xb2b1('0x41')](handleError(_0x12a567,null));};exports[_0xb2b1('0x42')]=function(_0x1f353a,_0x1665c5){var _0x31d94d={'raw':!![],'where':{'id':_0x1f353a['params']['id']}},_0x14b11d={};_0x14b11d[_0xb2b1('0x30')]=_[_0xb2b1('0x32')](db['Disposition']['rawAttributes']);_0x14b11d['query']=_['keys'](_0x1f353a[_0xb2b1('0x31')]);_0x14b11d[_0xb2b1('0x33')]=_[_0xb2b1('0x35')](_0x14b11d[_0xb2b1('0x30')],_0x14b11d[_0xb2b1('0x31')]);_0x31d94d['attributes']=_['intersection'](_0x14b11d['model'],qs[_0xb2b1('0x36')](_0x1f353a['query'][_0xb2b1('0x36')]));_0x31d94d[_0xb2b1('0x34')]=_0x31d94d[_0xb2b1('0x34')][_0xb2b1('0x43')]?_0x31d94d[_0xb2b1('0x34')]:_0x14b11d['model'];if(_0x1f353a['query'][_0xb2b1('0x44')]){_0x31d94d[_0xb2b1('0x3f')]=[{'all':!![]}];}_0x31d94d=_['merge']({},_0x31d94d,_0x1f353a[_0xb2b1('0x45')]);return db[_0xb2b1('0x46')][_0xb2b1('0x47')](_0x31d94d)['then'](handleEntityNotFound(_0x1665c5,null))[_0xb2b1('0x23')](respondWithResult(_0x1665c5,null))[_0xb2b1('0x41')](handleError(_0x1665c5,null));};exports[_0xb2b1('0x48')]=function(_0x2f9088,_0x44608b){return db['Disposition']['create'](_0x2f9088[_0xb2b1('0x49')],{})[_0xb2b1('0x23')](function(_0x41d39d){var _0x35c242=_0x2f9088[_0xb2b1('0x4a')][_0xb2b1('0x25')]({'plain':!![]});if(!_0x35c242)throw new Error(_0xb2b1('0x4b'));if(_0x35c242[_0xb2b1('0x4c')]===_0xb2b1('0x4a')){var _0x5a2cbf=_0x41d39d[_0xb2b1('0x25')]({'plain':!![]});var _0x6e0794=_0xb2b1('0x26');return db['UserProfileSection'][_0xb2b1('0x47')]({'where':{'name':_0x6e0794,'userProfileId':_0x35c242[_0xb2b1('0x4d')]},'raw':!![]})[_0xb2b1('0x23')](function(_0x4b1557){if(_0x4b1557&&_0x4b1557['autoAssociation']===0x0){return db[_0xb2b1('0x4e')][_0xb2b1('0x48')]({'name':_0x5a2cbf[_0xb2b1('0x29')],'resourceId':_0x5a2cbf['id'],'type':_0x4b1557[_0xb2b1('0x29')],'sectionId':_0x4b1557['id']},{})[_0xb2b1('0x23')](function(){return _0x41d39d;});}else{return _0x41d39d;}})['catch'](function(_0x36ef4b){logger[_0xb2b1('0x27')](_0xb2b1('0x4f'),_0x36ef4b);throw _0x36ef4b;});}return _0x41d39d;})['then'](respondWithResult(_0x44608b,0xc9))['catch'](handleError(_0x44608b,null));};exports['update']=function(_0x48b56e,_0x1abd1a){if(_0x48b56e[_0xb2b1('0x49')]['id']){delete _0x48b56e[_0xb2b1('0x49')]['id'];}return db[_0xb2b1('0x46')][_0xb2b1('0x47')]({'where':{'id':_0x48b56e['params']['id']}})[_0xb2b1('0x23')](handleEntityNotFound(_0x1abd1a,null))[_0xb2b1('0x23')](saveUpdates(_0x48b56e[_0xb2b1('0x49')],null))['then'](respondWithResult(_0x1abd1a,null))['catch'](handleError(_0x1abd1a,null));};exports[_0xb2b1('0x24')]=function(_0x43b467,_0x1c1563){return db[_0xb2b1('0x46')][_0xb2b1('0x47')]({'where':{'id':_0x43b467[_0xb2b1('0x50')]['id']}})[_0xb2b1('0x23')](handleEntityNotFound(_0x1c1563,null))[_0xb2b1('0x23')](removeEntity(_0x1c1563,null))['catch'](handleError(_0x1c1563,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 2118e08..2db45c9 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 _0xac26=['name_mail','MailAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','ListId','name','ChatWebsiteId'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xac26,0xee));var _0x6ac2=function(_0x3dba9c,_0x21bc46){_0x3dba9c=_0x3dba9c-0x0;var _0x363cec=_0xac26[_0x3dba9c];return _0x363cec;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6ac2('0x0'))(_0x6ac2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6ac2('0x2'));var fs=require('fs');var path=require(_0x6ac2('0x3'));var rimraf=require(_0x6ac2('0x4'));var config=require(_0x6ac2('0x5'));var attributes=require(_0x6ac2('0x6'));module['exports']=function(_0x4d6ccd,_0xc385ca){return _0x4d6ccd[_0x6ac2('0x7')](_0x6ac2('0x8'),attributes,{'tableName':_0x6ac2('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x6ac2('0xa'),'fields':['name',_0x6ac2('0xb')]},{'unique':!![],'name':'name_chat','fields':[_0x6ac2('0xc'),_0x6ac2('0xd')]},{'unique':!![],'name':_0x6ac2('0xe'),'fields':[_0x6ac2('0xc'),_0x6ac2('0xf')]},{'unique':!![],'name':'name_sms','fields':[_0x6ac2('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x6ac2('0x10'),'fields':[_0x6ac2('0xc'),'FaxAccountId']},{'unique':!![],'name':_0x6ac2('0x11'),'fields':[_0x6ac2('0xc'),_0x6ac2('0x12')]},{'unique':!![],'name':_0x6ac2('0x13'),'fields':[_0x6ac2('0xc'),_0x6ac2('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3944=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','name_voice','name_chat','name','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId'];(function(_0x377200,_0x2331de){var _0x2ba92a=function(_0x24f7a8){while(--_0x24f7a8){_0x377200['push'](_0x377200['shift']());}};_0x2ba92a(++_0x2331de);}(_0x3944,0xf0));var _0x4394=function(_0x1c631f,_0x52c12e){_0x1c631f=_0x1c631f-0x0;var _0xe686ca=_0x3944[_0x1c631f];return _0xe686ca;};'use strict';var _=require('lodash');var util=require(_0x4394('0x0'));var logger=require(_0x4394('0x1'))(_0x4394('0x2'));var moment=require(_0x4394('0x3'));var BPromise=require(_0x4394('0x4'));var rp=require(_0x4394('0x5'));var fs=require('fs');var path=require(_0x4394('0x6'));var rimraf=require(_0x4394('0x7'));var config=require(_0x4394('0x8'));var attributes=require(_0x4394('0x9'));module[_0x4394('0xa')]=function(_0x1a7375,_0x4ee2d6){return _0x1a7375['define']('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x4394('0xb'),'fields':['name','ListId']},{'unique':!![],'name':_0x4394('0xc'),'fields':[_0x4394('0xd'),_0x4394('0xe')]},{'unique':!![],'name':_0x4394('0xf'),'fields':['name','MailAccountId']},{'unique':!![],'name':_0x4394('0x10'),'fields':[_0x4394('0xd'),_0x4394('0x11')]},{'unique':!![],'name':_0x4394('0x12'),'fields':[_0x4394('0xd'),_0x4394('0x13')]},{'unique':!![],'name':_0x4394('0x14'),'fields':[_0x4394('0xd'),_0x4394('0x15')]},{'unique':!![],'name':_0x4394('0x16'),'fields':[_0x4394('0xd'),_0x4394('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 3e2099c..19c155c 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(_0x4a9124,_0x47cdaf){var _0x1635fa=function(_0x20a1a7){while(--_0x20a1a7){_0x4a9124['push'](_0x4a9124['shift']());}};_0x1635fa(++_0x47cdaf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x24f5ea,_0x3e19ea){var _0x5d6de5=function(_0x64ebc2){while(--_0x64ebc2){_0x24f5ea['push'](_0x24f5ea['shift']());}};_0x5d6de5(++_0x3e19ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 7321056..013a70a 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 _0xf1cd=['./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x57aac5,_0xc483dc){var _0x5c5f48=function(_0x267f9f){while(--_0x267f9f){_0x57aac5['push'](_0x57aac5['shift']());}};_0x5c5f48(++_0xc483dc);}(_0xf1cd,0x13e));var _0xdf1c=function(_0x33f5b8,_0x597611){_0x33f5b8=_0x33f5b8-0x0;var _0x3f9f5d=_0xf1cd[_0x33f5b8];return _0x3f9f5d;};'use strict';var multer=require('multer');var util=require(_0xdf1c('0x0'));var path=require('path');var timeout=require(_0xdf1c('0x1'));var express=require(_0xdf1c('0x2'));var router=express[_0xdf1c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdf1c('0x4'));var interaction=require(_0xdf1c('0x5'));var config=require('../../config/environment');var controller=require(_0xdf1c('0x6'));router[_0xdf1c('0x7')]('/',auth[_0xdf1c('0x8')](),controller[_0xdf1c('0x9')]);router[_0xdf1c('0x7')](_0xdf1c('0xa'),auth['isAuthenticated'](),controller[_0xdf1c('0xb')]);router[_0xdf1c('0xc')]('/',auth[_0xdf1c('0x8')](),controller[_0xdf1c('0xd')]);router['put']('/:id',auth[_0xdf1c('0x8')](),controller[_0xdf1c('0xe')]);router[_0xdf1c('0xf')](_0xdf1c('0xa'),auth[_0xdf1c('0x8')](),controller[_0xdf1c('0x10')]);module[_0xdf1c('0x11')]=router; \ No newline at end of file +var _0x016c=['/:id','post','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','get'];(function(_0x4cc712,_0x1f12d8){var _0x3401de=function(_0x348ec5){while(--_0x348ec5){_0x4cc712['push'](_0x4cc712['shift']());}};_0x3401de(++_0x1f12d8);}(_0x016c,0x1da));var _0xc016=function(_0x753a38,_0x1aa4c8){_0x753a38=_0x753a38-0x0;var _0xf5f53c=_0x016c[_0x753a38];return _0xf5f53c;};'use strict';var multer=require(_0xc016('0x0'));var util=require(_0xc016('0x1'));var path=require(_0xc016('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc016('0x3')]();var fs_extra=require(_0xc016('0x4'));var auth=require(_0xc016('0x5'));var interaction=require(_0xc016('0x6'));var config=require(_0xc016('0x7'));var controller=require(_0xc016('0x8'));router['get']('/',auth[_0xc016('0x9')](),controller[_0xc016('0xa')]);router[_0xc016('0xb')](_0xc016('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xc016('0xd')]('/',auth[_0xc016('0x9')](),controller['create']);router[_0xc016('0xe')](_0xc016('0xc'),auth[_0xc016('0x9')](),controller[_0xc016('0xf')]);router[_0xc016('0x10')](_0xc016('0xc'),auth[_0xc016('0x9')](),controller['destroy']);module[_0xc016('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index b5bb2e0..9d561fb 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 _0x25fa=['setDataValue','sequelize','STRING','yes','localstationid','2400','4800','7200','9600','12000','14400','ENUM','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x264a62,_0x25f772){var _0x101811=function(_0x1a3031){while(--_0x1a3031){_0x264a62['push'](_0x264a62['shift']());}};_0x101811(++_0x25f772);}(_0x25fa,0x109));var _0xa25f=function(_0x426ef0,_0x56c5a1){_0x426ef0=_0x426ef0-0x0;var _0x2f2bfd=_0x25fa[_0x426ef0];return _0x2f2bfd;};'use strict';var Sequelize=require(_0xa25f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa25f('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa25f('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0xa25f('0x2'),'no'),'defaultValue':_0xa25f('0x2')},'headerinfo':{'type':Sequelize[_0xa25f('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xa25f('0x3')},'minrate':{'type':Sequelize['ENUM'](_0xa25f('0x4'),_0xa25f('0x5'),_0xa25f('0x6'),_0xa25f('0x7'),_0xa25f('0x8'),_0xa25f('0x9')),'defaultValue':_0xa25f('0x5')},'maxrate':{'type':Sequelize[_0xa25f('0xa')](_0xa25f('0x4'),'4800',_0xa25f('0x6'),_0xa25f('0x7'),'12000',_0xa25f('0x9')),'defaultValue':_0xa25f('0x9')},'modem':{'type':Sequelize[_0xa25f('0x1')],'defaultValue':_0xa25f('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xa25f('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xa25f('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xa25f('0xd'),_0xa25f('0xe'),'DADHI',_0xa25f('0xf')),'defaultValue':_0xa25f('0xd')},'key':{'type':Sequelize[_0xa25f('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa25f('0x10')],'defaultValue':function(){return _0xa25f('0x11');}},'notificationSound':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa25f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xa25f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa25f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa25f('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xa25f('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':![],'comment':_0xa25f('0x14'),'set':function(_0x18705c){if(!_0x18705c)this[_0xa25f('0x15')]('mandatoryDispositionPauseId',null);this[_0xa25f('0x15')]('mandatoryDisposition',_0x18705c);}}}; \ No newline at end of file +var _0x2d72=['sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x3a98de,_0x2f2d42){var _0x4a767d=function(_0x2a9341){while(--_0x2a9341){_0x3a98de['push'](_0x3a98de['shift']());}};_0x4a767d(++_0x2f2d42);}(_0x2d72,0xa8));var _0x22d7=function(_0x10a067,_0x321f71){_0x10a067=_0x10a067-0x0;var _0x351064=_0x2d72[_0x10a067];return _0x351064;};'use strict';var Sequelize=require(_0x22d7('0x0'));module[_0x22d7('0x1')]={'name':{'type':Sequelize[_0x22d7('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x22d7('0x2')]},'ecm':{'type':Sequelize[_0x22d7('0x3')](_0x22d7('0x4'),'no'),'defaultValue':_0x22d7('0x4')},'headerinfo':{'type':Sequelize[_0x22d7('0x2')],'defaultValue':_0x22d7('0x5')},'localstationid':{'type':Sequelize[_0x22d7('0x2')],'unique':_0x22d7('0x6')},'minrate':{'type':Sequelize[_0x22d7('0x3')](_0x22d7('0x7'),_0x22d7('0x8'),'7200',_0x22d7('0x9'),_0x22d7('0xa'),'14400'),'defaultValue':_0x22d7('0x8')},'maxrate':{'type':Sequelize[_0x22d7('0x3')](_0x22d7('0x7'),_0x22d7('0x8'),'7200','9600',_0x22d7('0xa'),_0x22d7('0xb')),'defaultValue':_0x22d7('0xb')},'modem':{'type':Sequelize[_0x22d7('0x2')],'defaultValue':_0x22d7('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x22d7('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x22d7('0xe'),_0x22d7('0xf'),'DADHI',_0x22d7('0x10')),'defaultValue':_0x22d7('0xe')},'key':{'type':Sequelize[_0x22d7('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x22d7('0x11')],'defaultValue':function(){return _0x22d7('0x12');}},'notificationSound':{'type':Sequelize[_0x22d7('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x22d7('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x22d7('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x22d7('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x22d7('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x22d7('0x13')],'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[_0x22d7('0x13')],'defaultValue':![],'comment':_0x22d7('0x14'),'set':function(_0xac2233){if(!_0xac2233)this[_0x22d7('0x15')](_0x22d7('0x16'),null);this['setDataValue'](_0x22d7('0x17'),_0xac2233);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 08a80b5..9144d73 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 _0xf018=['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','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','send','getApplications','from-voip-provider','exten','app','system','description','appdata','Answer','CDR(type)=inbound-fax','ecm','localstationid','gateway','maxrate','minrate','modem','t38timeout','FAXOPT(','push','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','http','client','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','includeAll'];(function(_0x5a1d07,_0x5550f2){var _0x5f0be1=function(_0x354b9d){while(--_0x354b9d){_0x5a1d07['push'](_0x5a1d07['shift']());}};_0x5f0be1(++_0x5550f2);}(_0xf018,0x132));var _0x8f01=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf018[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x8f01('0x0'));var rimraf=require(_0x8f01('0x1'));var zipdir=require(_0x8f01('0x2'));var jsonpatch=require(_0x8f01('0x3'));var rp=require(_0x8f01('0x4'));var moment=require(_0x8f01('0x5'));var BPromise=require(_0x8f01('0x6'));var Mustache=require(_0x8f01('0x7'));var util=require(_0x8f01('0x8'));var path=require(_0x8f01('0x9'));var sox=require('sox');var csv=require(_0x8f01('0xa'));var ejs=require(_0x8f01('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8f01('0xc'));var jsforce=require(_0x8f01('0xd'));var deskjs=require(_0x8f01('0xe'));var toCsv=require(_0x8f01('0xa'));var querystring=require('querystring');var Papa=require(_0x8f01('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8f01('0x10'));var as=require(_0x8f01('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8f01('0x12'));var config=require(_0x8f01('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8f01('0x14'))['db'];config[_0x8f01('0x15')]=_['defaults'](config[_0x8f01('0x15')],{'host':_0x8f01('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8f01('0x15')]));require('./faxAccount.socket')[_0x8f01('0x17')](socket);var jayson=require(_0x8f01('0x18'));var client=jayson['client'][_0x8f01('0x19')]({'port':0x232c});var client9002=jayson[_0x8f01('0x1a')][_0x8f01('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x534506,_0x14ae96,_0x224737,_0x290bed){return new BPromise(function(_0x4f111f,_0x22d5e7){var _0x4b3f9f=_0x290bed||client;return _0x4b3f9f[_0x8f01('0x1b')](_0x534506,_0x224737)[_0x8f01('0x1c')](function(_0x568f4d){logger['info'](_0x8f01('0x1d'),_0x14ae96,_0x8f01('0x1e'));logger[_0x8f01('0x1f')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x14ae96,_0x8f01('0x1e'),JSON[_0x8f01('0x20')](_0x568f4d));if(_0x568f4d[_0x8f01('0x21')]){if(_0x568f4d['error'][_0x8f01('0x22')]===0x1f4){logger[_0x8f01('0x21')](_0x8f01('0x1d'),_0x14ae96,_0x568f4d[_0x8f01('0x21')][_0x8f01('0x23')]);return _0x22d5e7(_0x568f4d['error'][_0x8f01('0x23')]);}logger[_0x8f01('0x21')](_0x8f01('0x1d'),_0x14ae96,_0x568f4d[_0x8f01('0x21')][_0x8f01('0x23')]);return _0x4f111f(_0x568f4d[_0x8f01('0x21')][_0x8f01('0x23')]);}else{logger[_0x8f01('0x24')](_0x8f01('0x1d'),_0x14ae96,_0x8f01('0x1e'));_0x4f111f(_0x568f4d['result'][_0x8f01('0x23')]);}})['catch'](function(_0x4d21a){logger[_0x8f01('0x21')](_0x8f01('0x1d'),_0x14ae96,_0x4d21a);_0x22d5e7(_0x4d21a);});});}function respondWithStatusCode(_0x1b4c23,_0x4b4bd1){_0x4b4bd1=_0x4b4bd1||0xcc;return function(_0x5b80a4){if(_0x5b80a4){return _0x1b4c23[_0x8f01('0x25')](_0x4b4bd1);}return _0x1b4c23[_0x8f01('0x26')](_0x4b4bd1)['end']();};}function respondWithResult(_0x6f80db,_0x5a7deb){_0x5a7deb=_0x5a7deb||0xc8;return function(_0x5bc347){if(_0x5bc347){return _0x6f80db[_0x8f01('0x26')](_0x5a7deb)[_0x8f01('0x27')](_0x5bc347);}};}function respondWithFilteredResult(_0x2b2513,_0x350a4c){return function(_0x2e0db6){if(_0x2e0db6){var _0x56b8fe=typeof _0x350a4c[_0x8f01('0x28')]===_0x8f01('0x29')&&typeof _0x350a4c[_0x8f01('0x2a')]==='undefined';var _0x2d2d21=_0x2e0db6[_0x8f01('0x2b')];var _0xecda61=_0x56b8fe?0x0:_0x350a4c[_0x8f01('0x28')];var _0x2e3ded=_0x56b8fe?_0x2e0db6[_0x8f01('0x2b')]:_0x350a4c[_0x8f01('0x28')]+_0x350a4c[_0x8f01('0x2a')];var _0xebfd4e;if(_0x2e3ded>=_0x2d2d21){_0x2e3ded=_0x2d2d21;_0xebfd4e=0xc8;}else{_0xebfd4e=0xce;}_0x2b2513[_0x8f01('0x26')](_0xebfd4e);return _0x2b2513[_0x8f01('0x2c')](_0x8f01('0x2d'),_0xecda61+'-'+_0x2e3ded+'/'+_0x2d2d21)[_0x8f01('0x27')](_0x2e0db6);}return null;};}function patchUpdates(_0x51d82f){return function(_0x3aad41){try{jsonpatch[_0x8f01('0x2e')](_0x3aad41,_0x51d82f,!![]);}catch(_0x37966a){return BPromise[_0x8f01('0x2f')](_0x37966a);}return _0x3aad41[_0x8f01('0x30')]();};}function saveUpdates(_0x4441a8,_0x1d4c13){return function(_0xb7212a){if(_0xb7212a){return _0xb7212a[_0x8f01('0x31')](_0x4441a8)[_0x8f01('0x1c')](function(_0x4aa740){return _0x4aa740;});}return null;};}function removeEntity(_0x4eb297,_0x741154){return function(_0x415017){if(_0x415017){return _0x415017[_0x8f01('0x32')]()['then'](function(){var _0x5c3035=_0x415017[_0x8f01('0x33')]({'plain':!![]});var _0x3c47da=_0x8f01('0x34');return db[_0x8f01('0x35')][_0x8f01('0x32')]({'where':{'type':_0x3c47da,'resourceId':_0x5c3035['id']}})[_0x8f01('0x1c')](function(){return _0x415017;});})['then'](function(){_0x4eb297[_0x8f01('0x26')](0xcc)[_0x8f01('0x36')]();});}};}function handleEntityNotFound(_0x5b31de,_0x5f5108){return function(_0x4e33bf){if(!_0x4e33bf){_0x5b31de[_0x8f01('0x25')](0x194);}return _0x4e33bf;};}function handleError(_0x31f2ff,_0x29601d){_0x29601d=_0x29601d||0x1f4;return function(_0x392081){logger[_0x8f01('0x21')](_0x392081[_0x8f01('0x37')]);if(_0x392081['name']){delete _0x392081[_0x8f01('0x38')];}_0x31f2ff[_0x8f01('0x26')](_0x29601d)['send'](_0x392081);};}exports[_0x8f01('0x39')]=function(_0x4eefeb,_0x16e824){var _0x5790ec={'include':[{'model':db[_0x8f01('0x3a')],'as':_0x8f01('0x3b')}]},_0x593807={},_0xb75395={'count':0x0,'rows':[]};var _0x4190b4=_[_0x8f01('0x3c')](db[_0x8f01('0x3d')][_0x8f01('0x3e')],function(_0x288a32){return{'name':_0x288a32[_0x8f01('0x3f')],'type':_0x288a32[_0x8f01('0x40')][_0x8f01('0x41')]};});_0x593807[_0x8f01('0x42')]=_[_0x8f01('0x3c')](_0x4190b4,_0x8f01('0x38'));_0x593807[_0x8f01('0x43')]=_[_0x8f01('0x44')](_0x4eefeb[_0x8f01('0x43')]);_0x593807[_0x8f01('0x45')]=_[_0x8f01('0x46')](_0x593807[_0x8f01('0x42')],_0x593807[_0x8f01('0x43')]);_0x5790ec[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x593807[_0x8f01('0x42')],qs['fields'](_0x4eefeb['query'][_0x8f01('0x48')]));_0x5790ec[_0x8f01('0x47')]=_0x5790ec[_0x8f01('0x47')][_0x8f01('0x49')]?_0x5790ec['attributes']:_0x593807['model'];if(!_0x4eefeb[_0x8f01('0x43')][_0x8f01('0x4a')](_0x8f01('0x4b'))){_0x5790ec[_0x8f01('0x2a')]=qs[_0x8f01('0x2a')](_0x4eefeb[_0x8f01('0x43')][_0x8f01('0x2a')]);_0x5790ec[_0x8f01('0x28')]=qs['offset'](_0x4eefeb[_0x8f01('0x43')][_0x8f01('0x28')]);}_0x5790ec[_0x8f01('0x4c')]=qs[_0x8f01('0x4d')](_0x4eefeb[_0x8f01('0x43')]['sort']);_0x5790ec[_0x8f01('0x4e')]=qs[_0x8f01('0x45')](_[_0x8f01('0x4f')](_0x4eefeb[_0x8f01('0x43')],_0x593807['filters']),_0x4190b4);if(_0x4eefeb[_0x8f01('0x43')]['filter']){_0x5790ec[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0x5790ec[_0x8f01('0x4e')],{'$or':_[_0x8f01('0x3c')](_0x4190b4,function(_0x518532){if(_0x518532[_0x8f01('0x40')]!==_0x8f01('0x51')){var _0xc7ca82={};_0xc7ca82[_0x518532[_0x8f01('0x38')]]={'$like':'%'+_0x4eefeb[_0x8f01('0x43')][_0x8f01('0x52')]+'%'};return _0xc7ca82;}})});}_0x5790ec=_[_0x8f01('0x50')]({},_0x5790ec,_0x4eefeb[_0x8f01('0x53')]);var _0xdf3309={'where':_0x5790ec[_0x8f01('0x4e')]};return db[_0x8f01('0x3d')][_0x8f01('0x2b')](_0xdf3309)[_0x8f01('0x1c')](function(_0x1440be){_0xb75395['count']=_0x1440be;if(_0x4eefeb[_0x8f01('0x43')]['includeAll']){_0x5790ec[_0x8f01('0x54')]=[{'all':!![]}];}return db['FaxAccount'][_0x8f01('0x55')](_0x5790ec);})['then'](function(_0x2cb3d1){_0xb75395[_0x8f01('0x56')]=_0x2cb3d1;return _0xb75395;})[_0x8f01('0x1c')](respondWithFilteredResult(_0x16e824,_0x5790ec))[_0x8f01('0x57')](handleError(_0x16e824,null));};exports['show']=function(_0x5bfb4d,_0xa923f5){var _0x173f30={'raw':![],'where':{'id':_0x5bfb4d[_0x8f01('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x8f01('0x3b')}]},_0x28d5d3={};_0x28d5d3[_0x8f01('0x42')]=_[_0x8f01('0x44')](db[_0x8f01('0x3d')][_0x8f01('0x3e')]);_0x28d5d3[_0x8f01('0x43')]=_[_0x8f01('0x44')](_0x5bfb4d[_0x8f01('0x43')]);_0x28d5d3[_0x8f01('0x45')]=_[_0x8f01('0x46')](_0x28d5d3['model'],_0x28d5d3[_0x8f01('0x43')]);_0x173f30[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x28d5d3[_0x8f01('0x42')],qs['fields'](_0x5bfb4d[_0x8f01('0x43')][_0x8f01('0x48')]));_0x173f30[_0x8f01('0x47')]=_0x173f30[_0x8f01('0x47')][_0x8f01('0x49')]?_0x173f30[_0x8f01('0x47')]:_0x28d5d3[_0x8f01('0x42')];if(_0x5bfb4d[_0x8f01('0x43')][_0x8f01('0x59')]){_0x173f30[_0x8f01('0x54')]=[{'all':!![]}];}_0x173f30=_[_0x8f01('0x50')]({},_0x173f30,_0x5bfb4d[_0x8f01('0x53')]);return db[_0x8f01('0x3d')][_0x8f01('0x5a')](_0x173f30)[_0x8f01('0x1c')](handleEntityNotFound(_0xa923f5,null))['then'](respondWithResult(_0xa923f5,null))[_0x8f01('0x57')](handleError(_0xa923f5,null));};exports['create']=function(_0x408244,_0x5f1c56){return db['FaxAccount'][_0x8f01('0x5b')](_0x408244['body'],{})[_0x8f01('0x1c')](function(_0x2c3708){var _0x2eaed8=_0x408244[_0x8f01('0x5c')]['get']({'plain':!![]});if(!_0x2eaed8)throw new Error(_0x8f01('0x5d'));if(_0x2eaed8[_0x8f01('0x5e')]===_0x8f01('0x5c')){var _0x3b5840=_0x2c3708['get']({'plain':!![]});var _0x5f280c=_0x8f01('0x34');return db[_0x8f01('0x5f')][_0x8f01('0x5a')]({'where':{'name':_0x5f280c,'userProfileId':_0x2eaed8[_0x8f01('0x60')]},'raw':!![]})[_0x8f01('0x1c')](function(_0xadf6cd){if(_0xadf6cd&&_0xadf6cd[_0x8f01('0x61')]===0x0){return db[_0x8f01('0x35')][_0x8f01('0x5b')]({'name':_0x3b5840[_0x8f01('0x38')],'resourceId':_0x3b5840['id'],'type':_0xadf6cd['name'],'sectionId':_0xadf6cd['id']},{})[_0x8f01('0x1c')](function(){return _0x2c3708;});}else{return _0x2c3708;}})[_0x8f01('0x57')](function(_0x167dd5){logger[_0x8f01('0x21')](_0x8f01('0x62'),_0x167dd5);throw _0x167dd5;});}return _0x2c3708;})['then'](respondWithResult(_0x5f1c56,0xc9))[_0x8f01('0x57')](handleError(_0x5f1c56,null));};exports[_0x8f01('0x31')]=function(_0x90ce3c,_0x45ee71){if(_0x90ce3c[_0x8f01('0x63')]['id']){delete _0x90ce3c[_0x8f01('0x63')]['id'];}return db[_0x8f01('0x3d')]['find']({'where':{'id':_0x90ce3c['params']['id']},'include':[{'model':db[_0x8f01('0x3a')],'as':_0x8f01('0x3b')}]})['then'](handleEntityNotFound(_0x45ee71,null))['then'](saveUpdates(_0x90ce3c['body'],null))[_0x8f01('0x1c')](respondWithResult(_0x45ee71,null))['catch'](handleError(_0x45ee71,null));};exports[_0x8f01('0x32')]=function(_0x103abf,_0xae0753){return db[_0x8f01('0x3d')][_0x8f01('0x5a')]({'where':{'id':_0x103abf[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0xae0753,null))['then'](removeEntity(_0xae0753,null))['catch'](handleError(_0xae0753,null));};exports[_0x8f01('0x64')]=function(_0x2eb3a9,_0x19e25b){return db[_0x8f01('0x3d')][_0x8f01('0x64')]()[_0x8f01('0x1c')](respondWithResult(_0x19e25b,null))[_0x8f01('0x57')](handleError(_0x19e25b,null));};exports[_0x8f01('0x65')]=function(_0x5988bd,_0x2ea3ad,_0x156a46){if(_0x5988bd[_0x8f01('0x63')]['id']){delete _0x5988bd[_0x8f01('0x63')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x5988bd['params']['id']}})['then'](handleEntityNotFound(_0x2ea3ad,null))[_0x8f01('0x1c')](function(_0x8e6a82){if(_0x8e6a82){_0x5988bd[_0x8f01('0x63')][_0x8f01('0x66')]=_0x8e6a82['id'];return db[_0x8f01('0x67')][_0x8f01('0x5b')](_0x5988bd['body']);}})[_0x8f01('0x1c')](respondWithResult(_0x2ea3ad,null))[_0x8f01('0x57')](handleError(_0x2ea3ad,null));};exports[_0x8f01('0x68')]=function(_0x1b2864,_0x43906c,_0x2506b5){var _0x3cb342={'raw':![],'where':{}};var _0x81ce2f={};var _0x1ddc0e={'count':0x0,'rows':[]};return db[_0x8f01('0x3d')][_0x8f01('0x69')]({'where':{'id':_0x1b2864[_0x8f01('0x58')]['id']}})['then'](handleEntityNotFound(_0x43906c,null))['then'](function(_0x450ce0){if(_0x450ce0){_0x81ce2f[_0x8f01('0x42')]=_[_0x8f01('0x44')](db['Disposition'][_0x8f01('0x3e')]);_0x81ce2f['query']=_['keys'](_0x1b2864['query']);_0x81ce2f[_0x8f01('0x45')]=_[_0x8f01('0x46')](_0x81ce2f['model'],_0x81ce2f[_0x8f01('0x43')]);_0x3cb342[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x81ce2f[_0x8f01('0x42')],qs['fields'](_0x1b2864['query'][_0x8f01('0x48')]));_0x3cb342['attributes']=_0x3cb342[_0x8f01('0x47')][_0x8f01('0x49')]?_0x3cb342[_0x8f01('0x47')]:_0x81ce2f[_0x8f01('0x42')];if(!_0x1b2864[_0x8f01('0x43')][_0x8f01('0x4a')]('nolimit')){_0x3cb342[_0x8f01('0x2a')]=qs['limit'](_0x1b2864['query'][_0x8f01('0x2a')]);_0x3cb342[_0x8f01('0x28')]=qs[_0x8f01('0x28')](_0x1b2864[_0x8f01('0x43')][_0x8f01('0x28')]);}_0x3cb342[_0x8f01('0x4c')]=qs[_0x8f01('0x4d')](_0x1b2864[_0x8f01('0x43')]['sort']);_0x3cb342['where']=qs['filters'](_[_0x8f01('0x4f')](_0x1b2864[_0x8f01('0x43')],_0x81ce2f['filters']));_0x3cb342['where'][_0x8f01('0x66')]=_0x450ce0['id'];if(_0x1b2864[_0x8f01('0x43')][_0x8f01('0x52')]){_0x3cb342[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0x3cb342['where'],{'$or':_[_0x8f01('0x3c')](_0x3cb342[_0x8f01('0x47')],function(_0x349cda){var _0x57afbe={};_0x57afbe[_0x349cda]={'$like':'%'+_0x1b2864['query'][_0x8f01('0x52')]+'%'};return _0x57afbe;})});}_0x3cb342=_[_0x8f01('0x50')]({},_0x3cb342,_0x1b2864[_0x8f01('0x53')]);return db[_0x8f01('0x67')][_0x8f01('0x2b')]({'where':_0x3cb342[_0x8f01('0x4e')]})['then'](function(_0x59f2ec){_0x1ddc0e[_0x8f01('0x2b')]=_0x59f2ec;if(_0x1b2864[_0x8f01('0x43')][_0x8f01('0x59')]){_0x3cb342[_0x8f01('0x54')]=[{'all':!![]}];}return db[_0x8f01('0x67')][_0x8f01('0x55')](_0x3cb342);})['then'](function(_0xb340d8){_0x1ddc0e[_0x8f01('0x56')]=_0xb340d8;return _0x1ddc0e;});}})[_0x8f01('0x1c')](respondWithFilteredResult(_0x43906c,_0x3cb342))[_0x8f01('0x57')](handleError(_0x43906c,null));};exports['removeDispositions']=function(_0x5f1f5e,_0x1c4a8b,_0x1d1e5e){return db[_0x8f01('0x3d')][_0x8f01('0x5a')]({'where':{'id':_0x5f1f5e[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x1c4a8b,null))['then'](function(_0x85c7bf){if(_0x85c7bf){return _0x85c7bf[_0x8f01('0x6a')](_0x5f1f5e['query'][_0x8f01('0x6b')]);}})[_0x8f01('0x1c')](respondWithStatusCode(_0x1c4a8b,null))['catch'](handleError(_0x1c4a8b,null));};exports[_0x8f01('0x6c')]=function(_0x4c0523,_0x4aefca,_0x4120f9){if(_0x4c0523[_0x8f01('0x63')]['id']){delete _0x4c0523[_0x8f01('0x63')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x4c0523[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x4aefca,null))[_0x8f01('0x1c')](function(_0x5c17e0){if(_0x5c17e0){_0x4c0523['body'][_0x8f01('0x66')]=_0x5c17e0['id'];return db[_0x8f01('0x6d')]['create'](_0x4c0523[_0x8f01('0x63')]);}})[_0x8f01('0x1c')](respondWithResult(_0x4aefca,null))[_0x8f01('0x57')](handleError(_0x4aefca,null));};exports[_0x8f01('0x6e')]=function(_0x10cdd6,_0x1ebc0c,_0x4dd784){var _0x14001d={'raw':![],'where':{}};var _0x441072={};var _0x5c1224={'count':0x0,'rows':[]};return db[_0x8f01('0x3d')][_0x8f01('0x69')]({'where':{'id':_0x10cdd6[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x1ebc0c,null))[_0x8f01('0x1c')](function(_0x353168){if(_0x353168){_0x441072[_0x8f01('0x42')]=_[_0x8f01('0x44')](db[_0x8f01('0x6d')][_0x8f01('0x3e')]);_0x441072['query']=_[_0x8f01('0x44')](_0x10cdd6[_0x8f01('0x43')]);_0x441072[_0x8f01('0x45')]=_['intersection'](_0x441072[_0x8f01('0x42')],_0x441072[_0x8f01('0x43')]);_0x14001d[_0x8f01('0x47')]=_['intersection'](_0x441072[_0x8f01('0x42')],qs[_0x8f01('0x48')](_0x10cdd6[_0x8f01('0x43')][_0x8f01('0x48')]));_0x14001d[_0x8f01('0x47')]=_0x14001d[_0x8f01('0x47')][_0x8f01('0x49')]?_0x14001d[_0x8f01('0x47')]:_0x441072[_0x8f01('0x42')];if(!_0x10cdd6[_0x8f01('0x43')][_0x8f01('0x4a')](_0x8f01('0x4b'))){_0x14001d[_0x8f01('0x2a')]=qs[_0x8f01('0x2a')](_0x10cdd6[_0x8f01('0x43')]['limit']);_0x14001d['offset']=qs['offset'](_0x10cdd6[_0x8f01('0x43')][_0x8f01('0x28')]);}_0x14001d['order']=qs[_0x8f01('0x4d')](_0x10cdd6['query'][_0x8f01('0x4d')]);_0x14001d[_0x8f01('0x4e')]=qs[_0x8f01('0x45')](_[_0x8f01('0x4f')](_0x10cdd6[_0x8f01('0x43')],_0x441072[_0x8f01('0x45')]));_0x14001d[_0x8f01('0x4e')][_0x8f01('0x66')]=_0x353168['id'];if(_0x10cdd6[_0x8f01('0x43')][_0x8f01('0x52')]){_0x14001d[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0x14001d[_0x8f01('0x4e')],{'$or':_[_0x8f01('0x3c')](_0x14001d[_0x8f01('0x47')],function(_0x4e1e40){var _0x2c3900={};_0x2c3900[_0x4e1e40]={'$like':'%'+_0x10cdd6[_0x8f01('0x43')][_0x8f01('0x52')]+'%'};return _0x2c3900;})});}_0x14001d=_[_0x8f01('0x50')]({},_0x14001d,_0x10cdd6[_0x8f01('0x53')]);return db[_0x8f01('0x6d')][_0x8f01('0x2b')]({'where':_0x14001d[_0x8f01('0x4e')]})[_0x8f01('0x1c')](function(_0x494ee0){_0x5c1224['count']=_0x494ee0;if(_0x10cdd6['query'][_0x8f01('0x59')]){_0x14001d['include']=[{'all':!![]}];}return db[_0x8f01('0x6d')][_0x8f01('0x55')](_0x14001d);})[_0x8f01('0x1c')](function(_0x389958){_0x5c1224[_0x8f01('0x56')]=_0x389958;return _0x5c1224;});}})[_0x8f01('0x1c')](respondWithFilteredResult(_0x1ebc0c,_0x14001d))['catch'](handleError(_0x1ebc0c,null));};exports[_0x8f01('0x6f')]=function(_0x351ad1,_0x27d280,_0x1c8ebb){return db[_0x8f01('0x3d')][_0x8f01('0x5a')]({'where':{'id':_0x351ad1[_0x8f01('0x58')]['id']}})['then'](handleEntityNotFound(_0x27d280,null))[_0x8f01('0x1c')](function(_0x412c94){if(_0x412c94){return _0x412c94['removeAnswers'](_0x351ad1[_0x8f01('0x43')][_0x8f01('0x6b')]);}})[_0x8f01('0x1c')](respondWithStatusCode(_0x27d280,null))['catch'](handleError(_0x27d280,null));};exports[_0x8f01('0x70')]=function(_0x51f65e,_0x3c9632,_0x18e020){return db[_0x8f01('0x71')]['find']({'where':{'id':_0x51f65e[_0x8f01('0x58')]['id']}})['then'](handleEntityNotFound(_0x3c9632,null))[_0x8f01('0x1c')](function(_0x3083bf){if(_0x3083bf){return _0x3083bf[_0x8f01('0x70')](_0x51f65e[_0x8f01('0x63')][_0x8f01('0x6b')],_[_0x8f01('0x72')](_0x51f65e[_0x8f01('0x63')],[_0x8f01('0x6b'),'id'])||{});}})[_0x8f01('0x1c')](respondWithResult(_0x3c9632,null))[_0x8f01('0x57')](handleError(_0x3c9632,null));};exports[_0x8f01('0x73')]=function(_0x5a2f6d,_0x5db13c,_0x135423){var _0x30c297={'raw':![],'where':{}};var _0x240eff={};var _0x4c24f4={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x5a2f6d[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x5db13c,null))[_0x8f01('0x1c')](function(_0x1ca5cb){if(_0x1ca5cb){_0x240eff[_0x8f01('0x42')]=_[_0x8f01('0x44')](db[_0x8f01('0x71')][_0x8f01('0x3e')]);_0x240eff[_0x8f01('0x43')]=_[_0x8f01('0x44')](_0x5a2f6d['query']);_0x240eff[_0x8f01('0x45')]=_[_0x8f01('0x46')](_0x240eff[_0x8f01('0x42')],_0x240eff['query']);_0x30c297[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x240eff[_0x8f01('0x42')],qs['fields'](_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x48')]));_0x30c297['attributes']=_0x30c297['attributes'][_0x8f01('0x49')]?_0x30c297['attributes']:_0x240eff['model'];if(!_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x4a')](_0x8f01('0x4b'))){_0x30c297[_0x8f01('0x2a')]=qs[_0x8f01('0x2a')](_0x5a2f6d['query'][_0x8f01('0x2a')]);_0x30c297[_0x8f01('0x28')]=qs[_0x8f01('0x28')](_0x5a2f6d[_0x8f01('0x43')]['offset']);}_0x30c297['order']=qs[_0x8f01('0x4d')](_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x4d')]);_0x30c297[_0x8f01('0x4e')]=qs[_0x8f01('0x45')](_[_0x8f01('0x4f')](_0x5a2f6d[_0x8f01('0x43')],_0x240eff[_0x8f01('0x45')]));_0x30c297[_0x8f01('0x4e')][_0x8f01('0x66')]=_0x1ca5cb['id'];if(_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x52')]){_0x30c297[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0x30c297[_0x8f01('0x4e')],{'$or':_['map'](_0x30c297['attributes'],function(_0x2ff753){var _0x508bc8={};_0x508bc8[_0x2ff753]={'$like':'%'+_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x52')]+'%'};return _0x508bc8;})});}_0x30c297=_[_0x8f01('0x50')]({},_0x30c297,_0x5a2f6d[_0x8f01('0x53')]);return db[_0x8f01('0x71')]['count']({'where':_0x30c297[_0x8f01('0x4e')]})[_0x8f01('0x1c')](function(_0x369ba6){_0x4c24f4[_0x8f01('0x2b')]=_0x369ba6;if(_0x5a2f6d['query'][_0x8f01('0x59')]){_0x30c297[_0x8f01('0x54')]=[{'model':db[_0x8f01('0x74')],'as':_0x8f01('0x75'),'required':![]},{'model':db[_0x8f01('0x76')],'as':_0x8f01('0x77'),'attributes':[_0x8f01('0x38'),_0x8f01('0x78'),_0x8f01('0x79')],'required':![]},{'model':db[_0x8f01('0x7a')],'as':_0x8f01('0x7b'),'attributes':['id',_0x8f01('0x38'),_0x8f01('0x7c')],'where':_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x7d')]?{'id':_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x7d')]}:undefined,'required':_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x7d')]?!![]:![]}];}return db[_0x8f01('0x71')][_0x8f01('0x55')](_0x30c297);})[_0x8f01('0x1c')](function(_0x7cce0b){_0x4c24f4['rows']=_0x7cce0b;return _0x4c24f4;});}})[_0x8f01('0x1c')](respondWithFilteredResult(_0x5db13c,_0x30c297))[_0x8f01('0x57')](handleError(_0x5db13c,null));};exports['addApplications']=function(_0x43ee59,_0x557c3c){var _0x4c733c=_0x43ee59[_0x8f01('0x58')]['id'];var _0x5b624c=_0x43ee59['body'];var _0x77f7ec=0xc8;var _0x2aa6d4=null;return db[_0x8f01('0x7e')][_0x8f01('0x7f')]({'isolationLevel':db[_0x8f01('0x7e')][_0x8f01('0x80')][_0x8f01('0x81')][_0x8f01('0x82')]},function(_0x208e4b){return db[_0x8f01('0x3d')]['findOne']({'where':{'id':_0x4c733c},'transaction':_0x208e4b})[_0x8f01('0x1c')](function(_0x3708d0){if(_0x3708d0){return db['FaxApplication'][_0x8f01('0x32')]({'where':{'FaxAccountId':_0x4c733c},'transaction':_0x208e4b})['then'](function(){var _0x56b658=_[_0x8f01('0x3c')](_0x5b624c,function(_0x3ffe86){_0x3ffe86[_0x8f01('0x66')]=_0x4c733c;return _0x3ffe86;});return db[_0x8f01('0x83')][_0x8f01('0x84')](_0x56b658,{'transaction':_0x208e4b});});}else{_0x77f7ec=0x194;_0x2aa6d4=[];}});})[_0x8f01('0x1c')](function(){if(_0x77f7ec!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x4c733c},'order':_0x8f01('0x85')})[_0x8f01('0x1c')](function(_0x17b12b){_0x2aa6d4=_0x17b12b;});}})['catch'](function(_0x4aa540){_0x77f7ec=0x1f4;logger[_0x8f01('0x21')](_0x4aa540[_0x8f01('0x37')]);if(_0x4aa540[_0x8f01('0x38')]){delete _0x4aa540['name'];}_0x2aa6d4=_0x4aa540;})['finally'](function(){if(_0x2aa6d4===null){_0x557c3c[_0x8f01('0x25')](_0x77f7ec);}else{if(_0x77f7ec===0x1f4){_0x557c3c[_0x8f01('0x26')](_0x77f7ec)[_0x8f01('0x86')](_0x2aa6d4);}else{_0x557c3c[_0x8f01('0x26')](_0x77f7ec)[_0x8f01('0x27')](_0x2aa6d4);}}});};exports['getApplications']=function(_0xd010c5,_0x55aa83,_0x41b1c0){var _0xd1aaab={};var _0x5124ce={};var _0x15859c;var _0x5f3e9a;return db['FaxAccount'][_0x8f01('0x69')]({'where':{'id':_0xd010c5[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x55aa83,null))[_0x8f01('0x1c')](function(_0xc0ff86){if(_0xc0ff86){_0x15859c=_0xc0ff86;_0x5124ce['model']=_['keys'](db[_0x8f01('0x83')][_0x8f01('0x3e')]);_0x5124ce[_0x8f01('0x43')]=_[_0x8f01('0x44')](_0xd010c5[_0x8f01('0x43')]);_0x5124ce[_0x8f01('0x45')]=_[_0x8f01('0x46')](_0x5124ce['model'],_0x5124ce[_0x8f01('0x43')]);_0xd1aaab[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x5124ce[_0x8f01('0x42')],qs[_0x8f01('0x48')](_0xd010c5['query'][_0x8f01('0x48')]));_0xd1aaab[_0x8f01('0x47')]=_0xd1aaab[_0x8f01('0x47')][_0x8f01('0x49')]?_0xd1aaab[_0x8f01('0x47')]:_0x5124ce['model'];_0xd1aaab['order']=qs[_0x8f01('0x4d')](_0xd010c5[_0x8f01('0x43')][_0x8f01('0x4d')]);_0xd1aaab[_0x8f01('0x4e')]=qs[_0x8f01('0x45')](_[_0x8f01('0x4f')](_0xd010c5[_0x8f01('0x43')],_0x5124ce[_0x8f01('0x45')]));if(_0xd010c5[_0x8f01('0x43')][_0x8f01('0x52')]){_0xd1aaab[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0xd1aaab[_0x8f01('0x4e')],{'$or':_[_0x8f01('0x3c')](_0xd1aaab['attributes'],function(_0x49ab84){var _0x5e2cbb={};_0x5e2cbb[_0x49ab84]={'$like':'%'+_0xd010c5[_0x8f01('0x43')][_0x8f01('0x52')]+'%'};return _0x5e2cbb;})});}_0xd1aaab=_[_0x8f01('0x50')]({},_0xd1aaab,_0xd010c5[_0x8f01('0x53')]);return _0x15859c['getApplications'](_0xd1aaab);}})[_0x8f01('0x1c')](function(_0x2f0cfa){if(_0x2f0cfa){_0x5f3e9a=_0x2f0cfa[_0x8f01('0x49')];if(!_0xd010c5[_0x8f01('0x43')]['hasOwnProperty']('nolimit')){_0xd1aaab['limit']=qs['limit'](_0xd010c5[_0x8f01('0x43')][_0x8f01('0x2a')]);_0xd1aaab['offset']=qs[_0x8f01('0x28')](_0xd010c5[_0x8f01('0x43')][_0x8f01('0x28')]);}return _0x15859c[_0x8f01('0x87')](_0xd1aaab);}})[_0x8f01('0x1c')](function(_0x115356){if(_0x115356){return _0x115356?{'count':_0x5f3e9a,'rows':_0x115356}:null;}})[_0x8f01('0x1c')](respondWithResult(_0x55aa83,null))[_0x8f01('0x57')](handleError(_0x55aa83,null));};function Extension(_0x31cc84,_0x14d863,_0x2e0204,_0x14c453){this['context']=_0x8f01('0x88');this[_0x8f01('0x89')]=_0x31cc84['localstationid'];this[_0x8f01('0x8a')]=_0x14c453;this[_0x8f01('0x40')]=_0x8f01('0x8b');this[_0x8f01('0x8c')]='Fax\x20Extension';this[_0x8f01('0x66')]=_0x31cc84['id'];this[_0x8f01('0x85')]=_0x14d863;this[_0x8f01('0x8d')]=_0x2e0204;}function createExtensionsReciveFax(_0x52e2f5){var _0x5af03d=0x1;var _0x3070bf=[];_0x3070bf['push'](new Extension(_0x52e2f5,_0x5af03d,'',_0x8f01('0x8e')));_0x5af03d+=0x1;_0x3070bf['push'](new Extension(_0x52e2f5,_0x5af03d,_0x8f01('0x8f'),'Set'));_0x5af03d+=0x1;for(var _0x551d91 in _0x52e2f5){if(_0x52e2f5[_0x8f01('0x4a')](_0x551d91)&&(_0x551d91===_0x8f01('0x90')||_0x551d91===_0x8f01('0x91')||_0x551d91===_0x8f01('0x92')||_0x551d91==='faxdetect'||_0x551d91==='headerinfo'||_0x551d91===_0x8f01('0x93')||_0x551d91===_0x8f01('0x94')||_0x551d91===_0x8f01('0x95')||_0x551d91===_0x8f01('0x96'))){_0x3070bf['push'](new Extension(_0x52e2f5,_0x5af03d,_0x8f01('0x97')+_0x551d91+')='+_0x52e2f5[_0x551d91],'Set'));_0x5af03d+=0x1;}}_0x3070bf[_0x8f01('0x98')](new Extension(_0x52e2f5,_0x5af03d,'6',_0x8f01('0x99')));_0x5af03d+=0x1;_0x3070bf['push'](new Extension(_0x52e2f5,_0x5af03d,_0x8f01('0x9a'),_0x8f01('0x9b')));_0x5af03d=0x0;return _0x3070bf;}exports[_0x8f01('0x9c')]=function(_0x5864bb,_0x2f9890,_0x394f42){var _0xf8e211;return db[_0x8f01('0x7e')][_0x8f01('0x7f')](function(_0x41a283){return db[_0x8f01('0x3d')][_0x8f01('0x5b')](_0x5864bb[_0x8f01('0x63')],{'transaction':_0x41a283})[_0x8f01('0x1c')](function(_0x1de2fc){_0xf8e211=_0x1de2fc[_0x8f01('0x33')]({'plain':!![]});return db[_0x8f01('0x9d')][_0x8f01('0x84')](createExtensionsReciveFax(_0xf8e211),{'transaction':_0x41a283});});})[_0x8f01('0x1c')](function(){return _0xf8e211;})[_0x8f01('0x1c')](respondWithResult(_0x2f9890,null))[_0x8f01('0x57')](handleError(_0x2f9890,null));};exports[_0x8f01('0x9e')]=function(_0xddfdd4,_0x36d602,_0x379f49){var _0x4756a0;return db[_0x8f01('0x7e')][_0x8f01('0x7f')](function(_0x51937f){return db[_0x8f01('0x3d')][_0x8f01('0x31')](_0xddfdd4['body'],{'where':{'id':_0xddfdd4['body']['id']},'transaction':_0x51937f})[_0x8f01('0x1c')](function(_0x565cb9){return db['VoiceExtension'][_0x8f01('0x32')]({'where':{'FaxAccountId':_0xddfdd4[_0x8f01('0x63')]['id']},'transaction':_0x51937f})[_0x8f01('0x1c')](function(_0x47496e){return db['VoiceExtension'][_0x8f01('0x84')](createExtensionsReciveFax(_['omit'](_0xddfdd4[_0x8f01('0x63')],[_0x8f01('0x9f'),_0x8f01('0x41'),_0x8f01('0xa0'),_0x8f01('0xa1'),'TrunkId',_0x8f01('0xa2')])),{'transaction':_0x51937f});});});})['then'](function(){return db[_0x8f01('0x3d')]['findById'](_0xddfdd4[_0x8f01('0x63')]['id']);})[_0x8f01('0x1c')](respondWithResult(_0x36d602,null))[_0x8f01('0x57')](handleError(_0x36d602,null));};exports[_0x8f01('0xa3')]=function(_0x492613,_0x33dd4b,_0x4e8dbc){var _0xd99a58={'raw':!![],'where':{}};var _0x587e19={};var _0x4ef8da={'count':0x0,'rows':[]};return db[_0x8f01('0x3d')]['findOne']({'where':{'id':_0x492613[_0x8f01('0x58')]['id']}})['then'](handleEntityNotFound(_0x33dd4b,null))[_0x8f01('0x1c')](function(_0x38b259){if(_0x38b259){_0x587e19[_0x8f01('0x42')]=_[_0x8f01('0x44')](db[_0x8f01('0xa4')]['rawAttributes']);_0x587e19[_0x8f01('0x43')]=_[_0x8f01('0x44')](_0x492613['query']);_0x587e19['filters']=_[_0x8f01('0x46')](_0x587e19[_0x8f01('0x42')],_0x587e19[_0x8f01('0x43')]);_0xd99a58[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x587e19[_0x8f01('0x42')],qs[_0x8f01('0x48')](_0x492613[_0x8f01('0x43')]['fields']));_0xd99a58[_0x8f01('0x47')]=_0xd99a58['attributes']['length']?_0xd99a58[_0x8f01('0x47')]:_0x587e19[_0x8f01('0x42')];if(!_0x492613[_0x8f01('0x43')][_0x8f01('0x4a')](_0x8f01('0x4b'))){_0xd99a58['limit']=qs[_0x8f01('0x2a')](_0x492613[_0x8f01('0x43')][_0x8f01('0x2a')]);_0xd99a58['offset']=qs[_0x8f01('0x28')](_0x492613['query']['offset']);}_0xd99a58['order']=qs['sort'](_0x492613['query'][_0x8f01('0x4d')]);_0xd99a58['where']=qs[_0x8f01('0x45')](_[_0x8f01('0x4f')](_0x492613[_0x8f01('0x43')],_0x587e19['filters']));_0xd99a58[_0x8f01('0x4e')][_0x8f01('0x66')]=_0x38b259['id'];if(_0x492613[_0x8f01('0x43')]['filter']){_0xd99a58[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0xd99a58[_0x8f01('0x4e')],{'$or':_[_0x8f01('0x3c')](_0xd99a58['attributes'],function(_0x12c75f){var _0x76e33f={};_0x76e33f[_0x12c75f]={'$like':'%'+_0x492613['query'][_0x8f01('0x52')]+'%'};return _0x76e33f;})});}if(_0x492613[_0x8f01('0x43')][_0x8f01('0xa5')]){var _0x56d212=_0x492613[_0x8f01('0x43')][_0x8f01('0xa5')][_0x8f01('0xa6')](',');var _0x19f75f={};_0x19f75f[_0x56d212[0x0]]={'$gte':moment(_0x56d212[0x1])[_0x8f01('0xa7')](_0x8f01('0xa8'))};_0xd99a58['where']=_['merge'](_0xd99a58[_0x8f01('0x4e')],_0x19f75f);}_0xd99a58=_[_0x8f01('0x50')]({},_0xd99a58,_0x492613['options']);return db[_0x8f01('0xa4')][_0x8f01('0x2b')]({'where':_0xd99a58[_0x8f01('0x4e')]})[_0x8f01('0x1c')](function(_0x3a260a){_0x4ef8da[_0x8f01('0x2b')]=_0x3a260a;if(_0x492613[_0x8f01('0x43')][_0x8f01('0x59')]){_0xd99a58[_0x8f01('0x54')]=[{'all':!![]}];}return db[_0x8f01('0xa4')]['findAll'](_0xd99a58);})[_0x8f01('0x1c')](function(_0x128e1e){_0x4ef8da[_0x8f01('0x56')]=_0x128e1e;return _0x4ef8da;});}})[_0x8f01('0x1c')](respondWithFilteredResult(_0x33dd4b,_0xd99a58))[_0x8f01('0x57')](handleError(_0x33dd4b,null));};exports['send']=function(_0x3349df,_0x55f59e,_0x38b9dc){var _0x2163c6,_0x31c59b={},_0x298739;if(_0x3349df[_0x8f01('0x63')]['to']){_0x298739=_0x3349df[_0x8f01('0x63')]['to'][0x0];}return db[_0x8f01('0x3d')][_0x8f01('0x5a')]({'where':{'id':_0x3349df[_0x8f01('0x58')]['id']},'include':[{'model':db[_0x8f01('0xa9')],'as':_0x8f01('0xaa'),'include':[{'model':db['CmContact'],'as':_0x8f01('0xab'),'where':{'fax':_0x298739},'limit':0x1,'order':[['updatedAt',_0x8f01('0xac')]]}]}]})['then'](handleEntityNotFound(_0x55f59e,null))[_0x8f01('0x1c')](function(_0x49bf0d){_0x2163c6=_0x49bf0d;if(_0x3349df[_0x8f01('0x63')]['attachments']&&_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')]['length']){for(var _0x380423=0x0;_0x380423<_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][_0x8f01('0x49')];_0x380423+=0x1){_0x3349df[_0x8f01('0x63')]['attachments'][_0x380423]={'filename':_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][_0x380423]['name'],'id':_0x3349df[_0x8f01('0x63')]['attachments'][_0x380423]['id'],'path':path[_0x8f01('0xae')](config['root'],_0x8f01('0xaf'),_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][_0x380423][_0x8f01('0xb0')])};}}return respondWithRpcPromise(_0x8f01('0xb1'),_0x8f01('0xb1'),{'FaxAccountId':_[_0x8f01('0xb2')](_0x3349df['params']['id'])?undefined:_0x3349df[_0x8f01('0x58')]['id'],'path':_[_0x8f01('0xb2')](_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][0x0][_0x8f01('0x9')])?undefined:_0x3349df[_0x8f01('0x63')]['attachments'][0x0]['path'],'fax':_['isNil'](_0x3349df[_0x8f01('0x63')]['to'][0x0])?undefined:_0x3349df[_0x8f01('0x63')]['to'][0x0]},client9002);})[_0x8f01('0x1c')](function(){if(_0x2163c6){if(_['isNil'](_0x3349df['body']['from'])){_0x3349df[_0x8f01('0x63')][_0x8f01('0xb3')]=util[_0x8f01('0xa7')](_0x8f01('0xb4'),_0x2163c6['name'],_0x2163c6[_0x8f01('0xb5')]);}if(_0x2163c6['List']){if(_0x2163c6[_0x8f01('0xaa')][_0x8f01('0xab')]['length']){return _0x2163c6['List'][_0x8f01('0xab')][0x0];}else{return db[_0x8f01('0x74')]['create'](_[_0x8f01('0xb6')](_0x3349df[_0x8f01('0x63')],{'firstName':_0x3349df[_0x8f01('0x63')]['to'][0x0],'phone':_0x3349df['body']['to'][0x0],'fax':_0x3349df[_0x8f01('0x63')]['to'][0x0],'ListId':_0x2163c6[_0x8f01('0xa2')]}));}}else{throw new Error(_0x8f01('0xb7'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x8f01('0x1c')](function(_0x577d2d){if(_0x577d2d){return db['FaxInteraction']['find']({'where':{'ContactId':_0x577d2d['id'],'closed':![],'FaxAccountId':_0x2163c6['id']}})[_0x8f01('0x1c')](function(_0x320784){if(_0x320784){return[_0x320784,![]];}return db[_0x8f01('0x71')][_0x8f01('0x5b')]({'UserId':_0x3349df[_0x8f01('0x5c')]['id'],'ContactId':_0x577d2d['id'],'FaxAccountId':_0x2163c6['id'],'fax':_0x3349df[_0x8f01('0x63')]['to'][0x0],'firstMsgDirection':_0x8f01('0xb8'),'Messages':[_[_0x8f01('0x50')](_0x3349df[_0x8f01('0x63')],{'read':![],'body':_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][0x0][_0x8f01('0xb9')],'FaxAccountId':_0x2163c6['id'],'UserId':_0x3349df[_0x8f01('0x5c')]['id'],'ContactId':_0x577d2d['id'],'AttachmentId':_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x8f01('0xba')}]})['then'](function(_0x5699dd){return[_0x5699dd,!![]];});});}else{throw new Error(_0x8f01('0xbb'));}})[_0x8f01('0xbc')](function(_0x2abdbf,_0x197229){if(_0x197229){return _0x2abdbf;}return db[_0x8f01('0xa4')][_0x8f01('0x5b')]({'direction':_0x8f01('0xb8'),'read':![],'body':_0x3349df['body'][_0x8f01('0xad')][0x0][_0x8f01('0xb9')],'FaxAccountId':_0x2163c6['id'],'FaxInteractionId':_0x2abdbf['id'],'UserId':_0x3349df[_0x8f01('0x5c')]['id'],'ContactId':_0x2abdbf['ContactId'],'AttachmentId':_0x3349df['body'][_0x8f01('0xad')][0x0]['id']})[_0x8f01('0x1c')](function(_0x181f25){_0x2abdbf['dataValues'][_0x8f01('0xba')]=[];_0x2abdbf[_0x8f01('0xbd')][_0x8f01('0xba')][_0x8f01('0x98')](_0x181f25[_0x8f01('0xbd')]);return _0x2abdbf;});})[_0x8f01('0x1c')](function(_0x14215b){respondWithRpcPromise(_0x8f01('0xbe'),'SendFax',{'FaxAccountId':_[_0x8f01('0xb2')](_0x3349df[_0x8f01('0x58')]['id'])?undefined:_0x3349df[_0x8f01('0x58')]['id'],'path':_[_0x8f01('0xb2')](_0x3349df['body'][_0x8f01('0xad')][0x0][_0x8f01('0x9')])?undefined:_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][0x0][_0x8f01('0x9')],'fax':_[_0x8f01('0xb2')](_0x3349df['body']['to'][0x0])?undefined:_0x3349df[_0x8f01('0x63')]['to'][0x0],'AttachmentId':_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][0x0]['id']},client9002)[_0x8f01('0x1c')](function(_0x42a274){logger[_0x8f01('0x24')]('SendFaxRpc,\x20%s',_0x42a274);})[_0x8f01('0x57')](function(_0x5c2cff){logger[_0x8f01('0x24')](_0x8f01('0xbf'),_0x5c2cff);});return _0x14215b;})[_0x8f01('0x1c')](respondWithResult(_0x55f59e,null))[_0x8f01('0x57')](handleError(_0x55f59e,null));};exports[_0x8f01('0xc0')]=function(_0x40c5dc,_0x235d09,_0xece595){return db['FaxAccount'][_0x8f01('0x5a')]({'where':{'id':_0x40c5dc['params']['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x235d09,null))[_0x8f01('0x1c')](function(_0x2c138b){if(_0x2c138b){return _0x2c138b[_0x8f01('0xc0')](_0x40c5dc[_0x8f01('0x63')][_0x8f01('0x6b')],_[_0x8f01('0x72')](_0x40c5dc[_0x8f01('0x63')],[_0x8f01('0x6b'),'id'])||{})[_0x8f01('0xbc')](function(_0x8ae6d3){for(var _0x23aa33=0x0;_0x23aa33<_0x40c5dc[_0x8f01('0x63')]['ids'][_0x8f01('0x49')];_0x23aa33+=0x1){socket[_0x8f01('0xc1')](_0x8f01('0xc2'),{'UserId':Number(_0x40c5dc[_0x8f01('0x63')]['ids'][_0x23aa33]),'FaxAccountId':Number(_0x40c5dc[_0x8f01('0x58')]['id'])});}return _0x8ae6d3;});}})['then'](respondWithResult(_0x235d09,null))[_0x8f01('0x57')](handleError(_0x235d09,null));};exports[_0x8f01('0xc3')]=function(_0x2d3933,_0x39cb7e,_0xc18d14){return db[_0x8f01('0x3d')][_0x8f01('0x5a')]({'where':{'id':_0x2d3933[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x39cb7e,null))[_0x8f01('0x1c')](function(_0x1a1346){if(_0x1a1346){return _0x1a1346[_0x8f01('0xc3')](_0x2d3933[_0x8f01('0x43')][_0x8f01('0x6b')])['then'](function(){if(_['isArray'](_0x2d3933[_0x8f01('0x43')][_0x8f01('0x6b')])){for(var _0x1204e7=0x0;_0x1204e7<_0x2d3933[_0x8f01('0x43')][_0x8f01('0x6b')][_0x8f01('0x49')];_0x1204e7+=0x1){socket[_0x8f01('0xc1')](_0x8f01('0xc4'),{'UserId':Number(_0x2d3933[_0x8f01('0x43')]['ids'][_0x1204e7]),'FaxAccountId':Number(_0x2d3933['params']['id'])});}}else{socket[_0x8f01('0xc1')](_0x8f01('0xc4'),{'UserId':Number(_0x2d3933[_0x8f01('0x43')][_0x8f01('0x6b')]),'FaxAccountId':Number(_0x2d3933['params']['id'])});}});}})[_0x8f01('0x1c')](respondWithStatusCode(_0x39cb7e,null))[_0x8f01('0x57')](handleError(_0x39cb7e,null));};exports['getAgents']=function(_0x849599,_0x58060a,_0x4bf43c){var _0x192b38={};var _0x1eb3e3={};var _0x3be5f7;var _0x378a65;return db[_0x8f01('0x3d')][_0x8f01('0x69')]({'where':{'id':_0x849599[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x58060a,null))[_0x8f01('0x1c')](function(_0x22f0c3){if(_0x22f0c3){_0x3be5f7=_0x22f0c3;_0x1eb3e3[_0x8f01('0x42')]=_[_0x8f01('0x44')](db['User'][_0x8f01('0x3e')]);_0x1eb3e3['query']=_['keys'](_0x849599[_0x8f01('0x43')]);_0x1eb3e3[_0x8f01('0x45')]=_[_0x8f01('0x46')](_0x1eb3e3[_0x8f01('0x42')],_0x1eb3e3[_0x8f01('0x43')]);_0x192b38[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x1eb3e3[_0x8f01('0x42')],qs['fields'](_0x849599[_0x8f01('0x43')][_0x8f01('0x48')]));_0x192b38['attributes']=_0x192b38['attributes'][_0x8f01('0x49')]?_0x192b38['attributes']:_0x1eb3e3[_0x8f01('0x42')];_0x192b38[_0x8f01('0x4c')]=qs[_0x8f01('0x4d')](_0x849599[_0x8f01('0x43')][_0x8f01('0x4d')]);_0x192b38['where']=qs[_0x8f01('0x45')](_[_0x8f01('0x4f')](_0x849599[_0x8f01('0x43')],_0x1eb3e3[_0x8f01('0x45')]));if(_0x849599[_0x8f01('0x43')][_0x8f01('0x52')]){_0x192b38[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0x192b38['where'],{'$or':_[_0x8f01('0x3c')](_0x192b38[_0x8f01('0x47')],function(_0x508de3){var _0x414f80={};_0x414f80[_0x508de3]={'$like':'%'+_0x849599[_0x8f01('0x43')][_0x8f01('0x52')]+'%'};return _0x414f80;})});}_0x192b38=_[_0x8f01('0x50')]({},_0x192b38,_0x849599[_0x8f01('0x53')]);return _0x3be5f7[_0x8f01('0xc5')](_0x192b38);}})[_0x8f01('0x1c')](function(_0x57cce4){if(_0x57cce4){_0x378a65=_0x57cce4[_0x8f01('0x49')];if(!_0x849599[_0x8f01('0x43')][_0x8f01('0x4a')](_0x8f01('0x4b'))){_0x192b38['limit']=qs[_0x8f01('0x2a')](_0x849599['query'][_0x8f01('0x2a')]);_0x192b38['offset']=qs[_0x8f01('0x28')](_0x849599[_0x8f01('0x43')][_0x8f01('0x28')]);}return _0x3be5f7[_0x8f01('0xc5')](_0x192b38);}})[_0x8f01('0x1c')](function(_0x1e26ff){if(_0x1e26ff){return _0x1e26ff?{'count':_0x378a65,'rows':_0x1e26ff}:null;}})[_0x8f01('0x1c')](respondWithResult(_0x58060a,null))[_0x8f01('0x57')](handleError(_0x58060a,null));}; \ No newline at end of file +var _0x8ec3=['Contacts','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','register','jayson/promise','http','client','info','debug','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','save','update','then','destroy','get','FaxAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','find','describe','addDisposition','getDispositions','findOne','Disposition','pick','removeDispositions','addAnswer','CannedAnswer','getAnswers','nolimit','ids','addInteraction','FaxInteraction','omit','getInteractions','FaxAccountId','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','findAll','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','findAndCountAll','finally','send','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','priority','push','Answer','CDR(type)=inbound-fax','Set','faxdetect','headerinfo','maxrate','t38timeout','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','tech','createdAt','updatedAt','ListId','findById','FaxMessage','$gte','split','CmList','List'];(function(_0x518d89,_0x206af3){var _0x502df8=function(_0x4c8999){while(--_0x4c8999){_0x518d89['push'](_0x518d89['shift']());}};_0x502df8(++_0x206af3);}(_0x8ec3,0x19d));var _0x38ec=function(_0x48dce2,_0x170625){_0x48dce2=_0x48dce2-0x0;var _0x2023e2=_0x8ec3[_0x48dce2];return _0x2023e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38ec('0x0'));var zipdir=require(_0x38ec('0x1'));var jsonpatch=require(_0x38ec('0x2'));var rp=require(_0x38ec('0x3'));var moment=require(_0x38ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x38ec('0x5'));var util=require(_0x38ec('0x6'));var path=require(_0x38ec('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x38ec('0x8'));var fs=require('fs');var fs_extra=require(_0x38ec('0x9'));var _=require(_0x38ec('0xa'));var squel=require(_0x38ec('0xb'));var crypto=require('crypto');var jsforce=require(_0x38ec('0xc'));var deskjs=require(_0x38ec('0xd'));var toCsv=require(_0x38ec('0xe'));var querystring=require(_0x38ec('0xf'));var Papa=require(_0x38ec('0x10'));var Redis=require(_0x38ec('0x11'));var authService=require(_0x38ec('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38ec('0x13'));var logger=require(_0x38ec('0x14'))('api');var utils=require(_0x38ec('0x15'));var config=require(_0x38ec('0x16'));var licenseUtil=require(_0x38ec('0x17'));var db=require('../../mysqldb')['db'];config[_0x38ec('0x18')]=_['defaults'](config[_0x38ec('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x38ec('0x18')]));require('./faxAccount.socket')[_0x38ec('0x19')](socket);var jayson=require(_0x38ec('0x1a'));var client=jayson['client'][_0x38ec('0x1b')]({'port':0x232c});var client9002=jayson[_0x38ec('0x1c')][_0x38ec('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x115fa7,_0x2366a4,_0x52093c,_0x28b547){return new BPromise(function(_0x1ea9b9,_0x77c129){var _0x1ede92=_0x28b547||client;return _0x1ede92['request'](_0x115fa7,_0x52093c)['then'](function(_0x828675){logger[_0x38ec('0x1d')]('FaxAccount,\x20%s,\x20%s',_0x2366a4,'request\x20sent');logger[_0x38ec('0x1e')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x2366a4,_0x38ec('0x1f'),JSON[_0x38ec('0x20')](_0x828675));if(_0x828675[_0x38ec('0x21')]){if(_0x828675[_0x38ec('0x21')][_0x38ec('0x22')]===0x1f4){logger[_0x38ec('0x21')](_0x38ec('0x23'),_0x2366a4,_0x828675[_0x38ec('0x21')]['message']);return _0x77c129(_0x828675[_0x38ec('0x21')][_0x38ec('0x24')]);}logger[_0x38ec('0x21')](_0x38ec('0x23'),_0x2366a4,_0x828675[_0x38ec('0x21')][_0x38ec('0x24')]);return _0x1ea9b9(_0x828675[_0x38ec('0x21')][_0x38ec('0x24')]);}else{logger['info'](_0x38ec('0x23'),_0x2366a4,_0x38ec('0x1f'));_0x1ea9b9(_0x828675[_0x38ec('0x25')]['message']);}})[_0x38ec('0x26')](function(_0x2a8bce){logger[_0x38ec('0x21')](_0x38ec('0x23'),_0x2366a4,_0x2a8bce);_0x77c129(_0x2a8bce);});});}function respondWithStatusCode(_0x3a6951,_0x54c6ed){_0x54c6ed=_0x54c6ed||0xcc;return function(_0x149865){if(_0x149865){return _0x3a6951['sendStatus'](_0x54c6ed);}return _0x3a6951[_0x38ec('0x27')](_0x54c6ed)[_0x38ec('0x28')]();};}function respondWithResult(_0x3a796e,_0x7e7b67){_0x7e7b67=_0x7e7b67||0xc8;return function(_0x549600){if(_0x549600){return _0x3a796e[_0x38ec('0x27')](_0x7e7b67)[_0x38ec('0x29')](_0x549600);}};}function respondWithFilteredResult(_0x164bc2,_0x350f9f){return function(_0x176e12){if(_0x176e12){var _0x189cd7=typeof _0x350f9f['offset']===_0x38ec('0x2a')&&typeof _0x350f9f['limit']===_0x38ec('0x2a');var _0x16f640=_0x176e12['count'];var _0x5d97ac=_0x189cd7?0x0:_0x350f9f[_0x38ec('0x2b')];var _0x51b34c=_0x189cd7?_0x176e12[_0x38ec('0x2c')]:_0x350f9f[_0x38ec('0x2b')]+_0x350f9f[_0x38ec('0x2d')];var _0x32850d;if(_0x51b34c>=_0x16f640){_0x51b34c=_0x16f640;_0x32850d=0xc8;}else{_0x32850d=0xce;}_0x164bc2['status'](_0x32850d);return _0x164bc2[_0x38ec('0x2e')](_0x38ec('0x2f'),_0x5d97ac+'-'+_0x51b34c+'/'+_0x16f640)[_0x38ec('0x29')](_0x176e12);}return null;};}function patchUpdates(_0x1c85ad){return function(_0x157eff){try{jsonpatch[_0x38ec('0x30')](_0x157eff,_0x1c85ad,!![]);}catch(_0x2a73d9){return BPromise['reject'](_0x2a73d9);}return _0x157eff[_0x38ec('0x31')]();};}function saveUpdates(_0x45fbc2,_0x37794a){return function(_0x372e5a){if(_0x372e5a){return _0x372e5a[_0x38ec('0x32')](_0x45fbc2)[_0x38ec('0x33')](function(_0x2407c8){return _0x2407c8;});}return null;};}function removeEntity(_0x4af298,_0x391f82){return function(_0x5bfc80){if(_0x5bfc80){return _0x5bfc80[_0x38ec('0x34')]()[_0x38ec('0x33')](function(){var _0x3db432=_0x5bfc80[_0x38ec('0x35')]({'plain':!![]});var _0x2c7c29=_0x38ec('0x36');return db[_0x38ec('0x37')]['destroy']({'where':{'type':_0x2c7c29,'resourceId':_0x3db432['id']}})[_0x38ec('0x33')](function(){return _0x5bfc80;});})[_0x38ec('0x33')](function(){_0x4af298[_0x38ec('0x27')](0xcc)[_0x38ec('0x28')]();});}};}function handleEntityNotFound(_0x14d973,_0x1e9806){return function(_0x550e04){if(!_0x550e04){_0x14d973[_0x38ec('0x38')](0x194);}return _0x550e04;};}function handleError(_0x3d58bd,_0x44cd7d){_0x44cd7d=_0x44cd7d||0x1f4;return function(_0x1f9177){logger[_0x38ec('0x21')](_0x1f9177[_0x38ec('0x39')]);if(_0x1f9177[_0x38ec('0x3a')]){delete _0x1f9177[_0x38ec('0x3a')];}_0x3d58bd[_0x38ec('0x27')](_0x44cd7d)['send'](_0x1f9177);};}exports[_0x38ec('0x3b')]=function(_0x584868,_0x2c6ca3){var _0x3c9adb={'include':[{'model':db[_0x38ec('0x3c')],'as':_0x38ec('0x3d')}]},_0x2f80e8={},_0x453a10={'count':0x0,'rows':[]};var _0x38117c=_[_0x38ec('0x3e')](db[_0x38ec('0x3f')][_0x38ec('0x40')],function(_0x4167ab){return{'name':_0x4167ab[_0x38ec('0x41')],'type':_0x4167ab[_0x38ec('0x42')][_0x38ec('0x43')]};});_0x2f80e8[_0x38ec('0x44')]=_[_0x38ec('0x3e')](_0x38117c,_0x38ec('0x3a'));_0x2f80e8[_0x38ec('0x45')]=_[_0x38ec('0x46')](_0x584868[_0x38ec('0x45')]);_0x2f80e8[_0x38ec('0x47')]=_[_0x38ec('0x48')](_0x2f80e8['model'],_0x2f80e8['query']);_0x3c9adb[_0x38ec('0x49')]=_[_0x38ec('0x48')](_0x2f80e8[_0x38ec('0x44')],qs[_0x38ec('0x4a')](_0x584868[_0x38ec('0x45')][_0x38ec('0x4a')]));_0x3c9adb[_0x38ec('0x49')]=_0x3c9adb[_0x38ec('0x49')][_0x38ec('0x4b')]?_0x3c9adb[_0x38ec('0x49')]:_0x2f80e8[_0x38ec('0x44')];if(!_0x584868[_0x38ec('0x45')][_0x38ec('0x4c')]('nolimit')){_0x3c9adb[_0x38ec('0x2d')]=qs[_0x38ec('0x2d')](_0x584868['query'][_0x38ec('0x2d')]);_0x3c9adb['offset']=qs[_0x38ec('0x2b')](_0x584868[_0x38ec('0x45')][_0x38ec('0x2b')]);}_0x3c9adb[_0x38ec('0x4d')]=qs[_0x38ec('0x4e')](_0x584868[_0x38ec('0x45')]['sort']);_0x3c9adb[_0x38ec('0x4f')]=qs[_0x38ec('0x47')](_['pick'](_0x584868[_0x38ec('0x45')],_0x2f80e8['filters']),_0x38117c);if(_0x584868[_0x38ec('0x45')]['filter']){_0x3c9adb[_0x38ec('0x4f')]=_['merge'](_0x3c9adb['where'],{'$or':_[_0x38ec('0x3e')](_0x38117c,function(_0xf277c8){if(_0xf277c8[_0x38ec('0x42')]!==_0x38ec('0x50')){var _0x458a38={};_0x458a38[_0xf277c8[_0x38ec('0x3a')]]={'$like':'%'+_0x584868[_0x38ec('0x45')][_0x38ec('0x51')]+'%'};return _0x458a38;}})});}_0x3c9adb=_[_0x38ec('0x52')]({},_0x3c9adb,_0x584868[_0x38ec('0x53')]);var _0x36952e={'where':_0x3c9adb[_0x38ec('0x4f')]};return db[_0x38ec('0x3f')][_0x38ec('0x2c')](_0x36952e)[_0x38ec('0x33')](function(_0x7351ce){_0x453a10[_0x38ec('0x2c')]=_0x7351ce;if(_0x584868[_0x38ec('0x45')][_0x38ec('0x54')]){_0x3c9adb[_0x38ec('0x55')]=[{'all':!![]}];}return db[_0x38ec('0x3f')]['findAll'](_0x3c9adb);})[_0x38ec('0x33')](function(_0x4168f0){_0x453a10[_0x38ec('0x56')]=_0x4168f0;return _0x453a10;})[_0x38ec('0x33')](respondWithFilteredResult(_0x2c6ca3,_0x3c9adb))['catch'](handleError(_0x2c6ca3,null));};exports[_0x38ec('0x57')]=function(_0xd0faa2,_0xaa47b0){var _0x3434df={'raw':![],'where':{'id':_0xd0faa2[_0x38ec('0x58')]['id']},'include':[{'model':db[_0x38ec('0x3c')],'as':'mandatoryDispositionPause'}]},_0x1b7ae7={};_0x1b7ae7[_0x38ec('0x44')]=_['keys'](db[_0x38ec('0x3f')][_0x38ec('0x40')]);_0x1b7ae7[_0x38ec('0x45')]=_[_0x38ec('0x46')](_0xd0faa2[_0x38ec('0x45')]);_0x1b7ae7['filters']=_[_0x38ec('0x48')](_0x1b7ae7['model'],_0x1b7ae7['query']);_0x3434df[_0x38ec('0x49')]=_['intersection'](_0x1b7ae7[_0x38ec('0x44')],qs['fields'](_0xd0faa2['query'][_0x38ec('0x4a')]));_0x3434df[_0x38ec('0x49')]=_0x3434df[_0x38ec('0x49')]['length']?_0x3434df[_0x38ec('0x49')]:_0x1b7ae7['model'];if(_0xd0faa2[_0x38ec('0x45')]['includeAll']){_0x3434df[_0x38ec('0x55')]=[{'all':!![]}];}_0x3434df=_[_0x38ec('0x52')]({},_0x3434df,_0xd0faa2[_0x38ec('0x53')]);return db[_0x38ec('0x3f')]['find'](_0x3434df)[_0x38ec('0x33')](handleEntityNotFound(_0xaa47b0,null))[_0x38ec('0x33')](respondWithResult(_0xaa47b0,null))[_0x38ec('0x26')](handleError(_0xaa47b0,null));};exports[_0x38ec('0x59')]=function(_0x3e3ca3,_0x503a8b){return db['FaxAccount'][_0x38ec('0x59')](_0x3e3ca3[_0x38ec('0x5a')],{})[_0x38ec('0x33')](function(_0xb25153){var _0x42f203=_0x3e3ca3[_0x38ec('0x5b')][_0x38ec('0x35')]({'plain':!![]});if(!_0x42f203)throw new Error(_0x38ec('0x5c'));if(_0x42f203[_0x38ec('0x5d')]==='user'){var _0x3267f3=_0xb25153['get']({'plain':!![]});var _0x6d5f2b=_0x38ec('0x36');return db['UserProfileSection']['find']({'where':{'name':_0x6d5f2b,'userProfileId':_0x42f203[_0x38ec('0x5e')]},'raw':!![]})['then'](function(_0x371d5e){if(_0x371d5e&&_0x371d5e[_0x38ec('0x5f')]===0x0){return db[_0x38ec('0x37')][_0x38ec('0x59')]({'name':_0x3267f3[_0x38ec('0x3a')],'resourceId':_0x3267f3['id'],'type':_0x371d5e[_0x38ec('0x3a')],'sectionId':_0x371d5e['id']},{})[_0x38ec('0x33')](function(){return _0xb25153;});}else{return _0xb25153;}})[_0x38ec('0x26')](function(_0x2e782b){logger[_0x38ec('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e782b);throw _0x2e782b;});}return _0xb25153;})[_0x38ec('0x33')](respondWithResult(_0x503a8b,0xc9))[_0x38ec('0x26')](handleError(_0x503a8b,null));};exports['update']=function(_0x5e3700,_0xec5315){if(_0x5e3700[_0x38ec('0x5a')]['id']){delete _0x5e3700['body']['id'];}return db[_0x38ec('0x3f')][_0x38ec('0x60')]({'where':{'id':_0x5e3700[_0x38ec('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x38ec('0x3d')}]})['then'](handleEntityNotFound(_0xec5315,null))[_0x38ec('0x33')](saveUpdates(_0x5e3700[_0x38ec('0x5a')],null))[_0x38ec('0x33')](respondWithResult(_0xec5315,null))[_0x38ec('0x26')](handleError(_0xec5315,null));};exports[_0x38ec('0x34')]=function(_0x5121c4,_0x571589){return db['FaxAccount'][_0x38ec('0x60')]({'where':{'id':_0x5121c4[_0x38ec('0x58')]['id']}})['then'](handleEntityNotFound(_0x571589,null))[_0x38ec('0x33')](removeEntity(_0x571589,null))[_0x38ec('0x26')](handleError(_0x571589,null));};exports[_0x38ec('0x61')]=function(_0x4f0739,_0xc3669a){return db['FaxAccount'][_0x38ec('0x61')]()[_0x38ec('0x33')](respondWithResult(_0xc3669a,null))[_0x38ec('0x26')](handleError(_0xc3669a,null));};exports[_0x38ec('0x62')]=function(_0x21b71b,_0x4dfe4c,_0x17c826){if(_0x21b71b[_0x38ec('0x5a')]['id']){delete _0x21b71b[_0x38ec('0x5a')]['id'];}return db[_0x38ec('0x3f')][_0x38ec('0x60')]({'where':{'id':_0x21b71b[_0x38ec('0x58')]['id']}})[_0x38ec('0x33')](handleEntityNotFound(_0x4dfe4c,null))['then'](function(_0x47a4e2){if(_0x47a4e2){_0x21b71b[_0x38ec('0x5a')]['FaxAccountId']=_0x47a4e2['id'];return db['Disposition']['create'](_0x21b71b[_0x38ec('0x5a')]);}})['then'](respondWithResult(_0x4dfe4c,null))[_0x38ec('0x26')](handleError(_0x4dfe4c,null));};exports[_0x38ec('0x63')]=function(_0x2e0365,_0x1dfc68,_0x12bef8){var _0x26e7a0={'raw':![],'where':{}};var _0xcda73c={};var _0x53220a={'count':0x0,'rows':[]};return db[_0x38ec('0x3f')][_0x38ec('0x64')]({'where':{'id':_0x2e0365[_0x38ec('0x58')]['id']}})[_0x38ec('0x33')](handleEntityNotFound(_0x1dfc68,null))[_0x38ec('0x33')](function(_0x2bfb92){if(_0x2bfb92){_0xcda73c[_0x38ec('0x44')]=_[_0x38ec('0x46')](db[_0x38ec('0x65')][_0x38ec('0x40')]);_0xcda73c[_0x38ec('0x45')]=_[_0x38ec('0x46')](_0x2e0365['query']);_0xcda73c[_0x38ec('0x47')]=_[_0x38ec('0x48')](_0xcda73c['model'],_0xcda73c[_0x38ec('0x45')]);_0x26e7a0[_0x38ec('0x49')]=_[_0x38ec('0x48')](_0xcda73c[_0x38ec('0x44')],qs['fields'](_0x2e0365[_0x38ec('0x45')][_0x38ec('0x4a')]));_0x26e7a0[_0x38ec('0x49')]=_0x26e7a0[_0x38ec('0x49')][_0x38ec('0x4b')]?_0x26e7a0[_0x38ec('0x49')]:_0xcda73c['model'];if(!_0x2e0365[_0x38ec('0x45')][_0x38ec('0x4c')]('nolimit')){_0x26e7a0['limit']=qs[_0x38ec('0x2d')](_0x2e0365[_0x38ec('0x45')][_0x38ec('0x2d')]);_0x26e7a0[_0x38ec('0x2b')]=qs[_0x38ec('0x2b')](_0x2e0365[_0x38ec('0x45')]['offset']);}_0x26e7a0['order']=qs[_0x38ec('0x4e')](_0x2e0365[_0x38ec('0x45')]['sort']);_0x26e7a0[_0x38ec('0x4f')]=qs[_0x38ec('0x47')](_[_0x38ec('0x66')](_0x2e0365[_0x38ec('0x45')],_0xcda73c['filters']));_0x26e7a0['where']['FaxAccountId']=_0x2bfb92['id'];if(_0x2e0365['query']['filter']){_0x26e7a0[_0x38ec('0x4f')]=_[_0x38ec('0x52')](_0x26e7a0[_0x38ec('0x4f')],{'$or':_[_0x38ec('0x3e')](_0x26e7a0['attributes'],function(_0x315376){var _0x299e72={};_0x299e72[_0x315376]={'$like':'%'+_0x2e0365[_0x38ec('0x45')][_0x38ec('0x51')]+'%'};return _0x299e72;})});}_0x26e7a0=_[_0x38ec('0x52')]({},_0x26e7a0,_0x2e0365[_0x38ec('0x53')]);return db['Disposition'][_0x38ec('0x2c')]({'where':_0x26e7a0[_0x38ec('0x4f')]})[_0x38ec('0x33')](function(_0x498af2){_0x53220a[_0x38ec('0x2c')]=_0x498af2;if(_0x2e0365['query']['includeAll']){_0x26e7a0['include']=[{'all':!![]}];}return db[_0x38ec('0x65')]['findAll'](_0x26e7a0);})[_0x38ec('0x33')](function(_0x1c909b){_0x53220a[_0x38ec('0x56')]=_0x1c909b;return _0x53220a;});}})[_0x38ec('0x33')](respondWithFilteredResult(_0x1dfc68,_0x26e7a0))[_0x38ec('0x26')](handleError(_0x1dfc68,null));};exports[_0x38ec('0x67')]=function(_0x3a8ff1,_0x4388e2,_0x28f78d){return db[_0x38ec('0x3f')]['find']({'where':{'id':_0x3a8ff1[_0x38ec('0x58')]['id']}})['then'](handleEntityNotFound(_0x4388e2,null))[_0x38ec('0x33')](function(_0x153150){if(_0x153150){return _0x153150['removeDispositions'](_0x3a8ff1[_0x38ec('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x4388e2,null))[_0x38ec('0x26')](handleError(_0x4388e2,null));};exports[_0x38ec('0x68')]=function(_0x2884fa,_0x5c7827,_0x276f53){if(_0x2884fa[_0x38ec('0x5a')]['id']){delete _0x2884fa[_0x38ec('0x5a')]['id'];}return db[_0x38ec('0x3f')][_0x38ec('0x60')]({'where':{'id':_0x2884fa[_0x38ec('0x58')]['id']}})[_0x38ec('0x33')](handleEntityNotFound(_0x5c7827,null))['then'](function(_0x245664){if(_0x245664){_0x2884fa[_0x38ec('0x5a')]['FaxAccountId']=_0x245664['id'];return db[_0x38ec('0x69')][_0x38ec('0x59')](_0x2884fa[_0x38ec('0x5a')]);}})['then'](respondWithResult(_0x5c7827,null))[_0x38ec('0x26')](handleError(_0x5c7827,null));};exports[_0x38ec('0x6a')]=function(_0x5007b9,_0x384024,_0x4ae63f){var _0x3cce17={'raw':![],'where':{}};var _0x28596c={};var _0x29734f={'count':0x0,'rows':[]};return db['FaxAccount'][_0x38ec('0x64')]({'where':{'id':_0x5007b9[_0x38ec('0x58')]['id']}})[_0x38ec('0x33')](handleEntityNotFound(_0x384024,null))[_0x38ec('0x33')](function(_0x7be8af){if(_0x7be8af){_0x28596c[_0x38ec('0x44')]=_[_0x38ec('0x46')](db['CannedAnswer'][_0x38ec('0x40')]);_0x28596c[_0x38ec('0x45')]=_['keys'](_0x5007b9[_0x38ec('0x45')]);_0x28596c['filters']=_[_0x38ec('0x48')](_0x28596c['model'],_0x28596c[_0x38ec('0x45')]);_0x3cce17[_0x38ec('0x49')]=_[_0x38ec('0x48')](_0x28596c['model'],qs[_0x38ec('0x4a')](_0x5007b9[_0x38ec('0x45')][_0x38ec('0x4a')]));_0x3cce17['attributes']=_0x3cce17[_0x38ec('0x49')][_0x38ec('0x4b')]?_0x3cce17[_0x38ec('0x49')]:_0x28596c[_0x38ec('0x44')];if(!_0x5007b9['query']['hasOwnProperty'](_0x38ec('0x6b'))){_0x3cce17['limit']=qs[_0x38ec('0x2d')](_0x5007b9['query'][_0x38ec('0x2d')]);_0x3cce17[_0x38ec('0x2b')]=qs[_0x38ec('0x2b')](_0x5007b9[_0x38ec('0x45')]['offset']);}_0x3cce17['order']=qs[_0x38ec('0x4e')](_0x5007b9[_0x38ec('0x45')][_0x38ec('0x4e')]);_0x3cce17[_0x38ec('0x4f')]=qs[_0x38ec('0x47')](_[_0x38ec('0x66')](_0x5007b9['query'],_0x28596c[_0x38ec('0x47')]));_0x3cce17[_0x38ec('0x4f')]['FaxAccountId']=_0x7be8af['id'];if(_0x5007b9['query'][_0x38ec('0x51')]){_0x3cce17[_0x38ec('0x4f')]=_[_0x38ec('0x52')](_0x3cce17[_0x38ec('0x4f')],{'$or':_[_0x38ec('0x3e')](_0x3cce17[_0x38ec('0x49')],function(_0x5d8709){var _0x321b1b={};_0x321b1b[_0x5d8709]={'$like':'%'+_0x5007b9['query'][_0x38ec('0x51')]+'%'};return _0x321b1b;})});}_0x3cce17=_[_0x38ec('0x52')]({},_0x3cce17,_0x5007b9[_0x38ec('0x53')]);return db[_0x38ec('0x69')]['count']({'where':_0x3cce17[_0x38ec('0x4f')]})[_0x38ec('0x33')](function(_0x2f72ca){_0x29734f['count']=_0x2f72ca;if(_0x5007b9['query'][_0x38ec('0x54')]){_0x3cce17[_0x38ec('0x55')]=[{'all':!![]}];}return db[_0x38ec('0x69')]['findAll'](_0x3cce17);})[_0x38ec('0x33')](function(_0x3d9061){_0x29734f[_0x38ec('0x56')]=_0x3d9061;return _0x29734f;});}})[_0x38ec('0x33')](respondWithFilteredResult(_0x384024,_0x3cce17))[_0x38ec('0x26')](handleError(_0x384024,null));};exports['removeAnswers']=function(_0xc1550a,_0x44586b,_0x4f1dda){return db['FaxAccount']['find']({'where':{'id':_0xc1550a[_0x38ec('0x58')]['id']}})[_0x38ec('0x33')](handleEntityNotFound(_0x44586b,null))[_0x38ec('0x33')](function(_0x365ad5){if(_0x365ad5){return _0x365ad5['removeAnswers'](_0xc1550a[_0x38ec('0x45')][_0x38ec('0x6c')]);}})[_0x38ec('0x33')](respondWithStatusCode(_0x44586b,null))[_0x38ec('0x26')](handleError(_0x44586b,null));};exports[_0x38ec('0x6d')]=function(_0x10fa0f,_0x496348,_0x2fba22){return db[_0x38ec('0x6e')][_0x38ec('0x60')]({'where':{'id':_0x10fa0f[_0x38ec('0x58')]['id']}})[_0x38ec('0x33')](handleEntityNotFound(_0x496348,null))['then'](function(_0x4a4ce5){if(_0x4a4ce5){return _0x4a4ce5[_0x38ec('0x6d')](_0x10fa0f[_0x38ec('0x5a')]['ids'],_[_0x38ec('0x6f')](_0x10fa0f[_0x38ec('0x5a')],[_0x38ec('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x496348,null))['catch'](handleError(_0x496348,null));};exports[_0x38ec('0x70')]=function(_0x2ef036,_0x21547d,_0x5f0e29){var _0x39626d={'raw':![],'where':{}};var _0x57a9b7={};var _0xc11c70={'count':0x0,'rows':[]};return db[_0x38ec('0x3f')][_0x38ec('0x64')]({'where':{'id':_0x2ef036['params']['id']}})[_0x38ec('0x33')](handleEntityNotFound(_0x21547d,null))['then'](function(_0x3f9d13){if(_0x3f9d13){_0x57a9b7[_0x38ec('0x44')]=_[_0x38ec('0x46')](db[_0x38ec('0x6e')][_0x38ec('0x40')]);_0x57a9b7['query']=_[_0x38ec('0x46')](_0x2ef036[_0x38ec('0x45')]);_0x57a9b7[_0x38ec('0x47')]=_[_0x38ec('0x48')](_0x57a9b7['model'],_0x57a9b7['query']);_0x39626d[_0x38ec('0x49')]=_['intersection'](_0x57a9b7[_0x38ec('0x44')],qs[_0x38ec('0x4a')](_0x2ef036[_0x38ec('0x45')]['fields']));_0x39626d[_0x38ec('0x49')]=_0x39626d[_0x38ec('0x49')][_0x38ec('0x4b')]?_0x39626d[_0x38ec('0x49')]:_0x57a9b7[_0x38ec('0x44')];if(!_0x2ef036[_0x38ec('0x45')][_0x38ec('0x4c')](_0x38ec('0x6b'))){_0x39626d[_0x38ec('0x2d')]=qs[_0x38ec('0x2d')](_0x2ef036[_0x38ec('0x45')]['limit']);_0x39626d[_0x38ec('0x2b')]=qs['offset'](_0x2ef036['query'][_0x38ec('0x2b')]);}_0x39626d[_0x38ec('0x4d')]=qs['sort'](_0x2ef036[_0x38ec('0x45')][_0x38ec('0x4e')]);_0x39626d[_0x38ec('0x4f')]=qs[_0x38ec('0x47')](_['pick'](_0x2ef036[_0x38ec('0x45')],_0x57a9b7['filters']));_0x39626d[_0x38ec('0x4f')][_0x38ec('0x71')]=_0x3f9d13['id'];if(_0x2ef036[_0x38ec('0x45')]['filter']){_0x39626d[_0x38ec('0x4f')]=_[_0x38ec('0x52')](_0x39626d[_0x38ec('0x4f')],{'$or':_[_0x38ec('0x3e')](_0x39626d[_0x38ec('0x49')],function(_0x355435){var _0x412a2a={};_0x412a2a[_0x355435]={'$like':'%'+_0x2ef036[_0x38ec('0x45')]['filter']+'%'};return _0x412a2a;})});}_0x39626d=_[_0x38ec('0x52')]({},_0x39626d,_0x2ef036['options']);return db['FaxInteraction'][_0x38ec('0x2c')]({'where':_0x39626d[_0x38ec('0x4f')]})[_0x38ec('0x33')](function(_0x596ad4){_0xc11c70[_0x38ec('0x2c')]=_0x596ad4;if(_0x2ef036[_0x38ec('0x45')][_0x38ec('0x54')]){_0x39626d[_0x38ec('0x55')]=[{'model':db[_0x38ec('0x72')],'as':_0x38ec('0x73'),'required':![]},{'model':db[_0x38ec('0x74')],'as':_0x38ec('0x75'),'attributes':[_0x38ec('0x3a'),_0x38ec('0x76'),_0x38ec('0x77')],'required':![]},{'model':db[_0x38ec('0x78')],'as':_0x38ec('0x79'),'attributes':['id',_0x38ec('0x3a'),_0x38ec('0x7a')],'where':_0x2ef036[_0x38ec('0x45')]['tag']?{'id':_0x2ef036[_0x38ec('0x45')]['tag']}:undefined,'required':_0x2ef036[_0x38ec('0x45')]['tag']?!![]:![]}];}return db[_0x38ec('0x6e')][_0x38ec('0x7b')](_0x39626d);})[_0x38ec('0x33')](function(_0x139780){_0xc11c70[_0x38ec('0x56')]=_0x139780;return _0xc11c70;});}})[_0x38ec('0x33')](respondWithFilteredResult(_0x21547d,_0x39626d))[_0x38ec('0x26')](handleError(_0x21547d,null));};exports[_0x38ec('0x7c')]=function(_0x15c275,_0x304c44){var _0x2ab584=_0x15c275[_0x38ec('0x58')]['id'];var _0x199ffa=_0x15c275['body'];var _0x264298=0xc8;var _0x113c2f=null;return db['sequelize'][_0x38ec('0x7d')]({'isolationLevel':db[_0x38ec('0x7e')][_0x38ec('0x7f')][_0x38ec('0x80')]['READ_COMMITTED']},function(_0x2432de){return db[_0x38ec('0x3f')][_0x38ec('0x64')]({'where':{'id':_0x2ab584},'transaction':_0x2432de})[_0x38ec('0x33')](function(_0x36821d){if(_0x36821d){return db[_0x38ec('0x81')][_0x38ec('0x34')]({'where':{'FaxAccountId':_0x2ab584},'transaction':_0x2432de})[_0x38ec('0x33')](function(){var _0x2f23de=_['map'](_0x199ffa,function(_0x20c336){_0x20c336[_0x38ec('0x71')]=_0x2ab584;return _0x20c336;});return db[_0x38ec('0x81')]['bulkCreate'](_0x2f23de,{'transaction':_0x2432de});});}else{_0x264298=0x194;_0x113c2f=[];}});})[_0x38ec('0x33')](function(){if(_0x264298!==0x194){return db[_0x38ec('0x81')][_0x38ec('0x82')]({'where':{'FaxAccountId':_0x2ab584},'order':'priority'})[_0x38ec('0x33')](function(_0x53ca6f){_0x113c2f=_0x53ca6f;});}})[_0x38ec('0x26')](function(_0xe0405c){_0x264298=0x1f4;logger[_0x38ec('0x21')](_0xe0405c[_0x38ec('0x39')]);if(_0xe0405c[_0x38ec('0x3a')]){delete _0xe0405c[_0x38ec('0x3a')];}_0x113c2f=_0xe0405c;})[_0x38ec('0x83')](function(){if(_0x113c2f===null){_0x304c44['sendStatus'](_0x264298);}else{if(_0x264298===0x1f4){_0x304c44[_0x38ec('0x27')](_0x264298)[_0x38ec('0x84')](_0x113c2f);}else{_0x304c44[_0x38ec('0x27')](_0x264298)['json'](_0x113c2f);}}});};exports[_0x38ec('0x85')]=function(_0x5d9613,_0xccad92,_0x363d3e){var _0x13b1ba={};var _0x31fb93={};var _0x111b80;var _0x2041fe;return db[_0x38ec('0x3f')]['findOne']({'where':{'id':_0x5d9613[_0x38ec('0x58')]['id']}})[_0x38ec('0x33')](handleEntityNotFound(_0xccad92,null))[_0x38ec('0x33')](function(_0x4621b4){if(_0x4621b4){_0x111b80=_0x4621b4;_0x31fb93[_0x38ec('0x44')]=_[_0x38ec('0x46')](db['FaxApplication'][_0x38ec('0x40')]);_0x31fb93['query']=_[_0x38ec('0x46')](_0x5d9613[_0x38ec('0x45')]);_0x31fb93[_0x38ec('0x47')]=_['intersection'](_0x31fb93['model'],_0x31fb93[_0x38ec('0x45')]);_0x13b1ba[_0x38ec('0x49')]=_[_0x38ec('0x48')](_0x31fb93[_0x38ec('0x44')],qs[_0x38ec('0x4a')](_0x5d9613[_0x38ec('0x45')][_0x38ec('0x4a')]));_0x13b1ba[_0x38ec('0x49')]=_0x13b1ba[_0x38ec('0x49')][_0x38ec('0x4b')]?_0x13b1ba[_0x38ec('0x49')]:_0x31fb93[_0x38ec('0x44')];_0x13b1ba[_0x38ec('0x4d')]=qs[_0x38ec('0x4e')](_0x5d9613[_0x38ec('0x45')][_0x38ec('0x4e')]);_0x13b1ba[_0x38ec('0x4f')]=qs[_0x38ec('0x47')](_[_0x38ec('0x66')](_0x5d9613[_0x38ec('0x45')],_0x31fb93[_0x38ec('0x47')]));if(_0x5d9613[_0x38ec('0x45')]['filter']){_0x13b1ba[_0x38ec('0x4f')]=_['merge'](_0x13b1ba['where'],{'$or':_[_0x38ec('0x3e')](_0x13b1ba[_0x38ec('0x49')],function(_0x20fd75){var _0x4331a7={};_0x4331a7[_0x20fd75]={'$like':'%'+_0x5d9613[_0x38ec('0x45')][_0x38ec('0x51')]+'%'};return _0x4331a7;})});}_0x13b1ba=_[_0x38ec('0x52')]({},_0x13b1ba,_0x5d9613[_0x38ec('0x53')]);return _0x111b80[_0x38ec('0x85')](_0x13b1ba);}})[_0x38ec('0x33')](function(_0x4aa365){if(_0x4aa365){_0x2041fe=_0x4aa365[_0x38ec('0x4b')];if(!_0x5d9613[_0x38ec('0x45')][_0x38ec('0x4c')](_0x38ec('0x6b'))){_0x13b1ba[_0x38ec('0x2d')]=qs[_0x38ec('0x2d')](_0x5d9613[_0x38ec('0x45')][_0x38ec('0x2d')]);_0x13b1ba['offset']=qs[_0x38ec('0x2b')](_0x5d9613['query'][_0x38ec('0x2b')]);}return _0x111b80[_0x38ec('0x85')](_0x13b1ba);}})[_0x38ec('0x33')](function(_0x588196){if(_0x588196){return _0x588196?{'count':_0x2041fe,'rows':_0x588196}:null;}})[_0x38ec('0x33')](respondWithResult(_0xccad92,null))['catch'](handleError(_0xccad92,null));};function Extension(_0x163dac,_0x2de68c,_0x1468df,_0x88c87c){this[_0x38ec('0x86')]=_0x38ec('0x87');this[_0x38ec('0x88')]=_0x163dac[_0x38ec('0x89')];this[_0x38ec('0x8a')]=_0x88c87c;this['type']=_0x38ec('0x8b');this[_0x38ec('0x8c')]=_0x38ec('0x8d');this[_0x38ec('0x71')]=_0x163dac['id'];this[_0x38ec('0x8e')]=_0x2de68c;this['appdata']=_0x1468df;}function createExtensionsReciveFax(_0xa86347){var _0x8634fe=0x1;var _0x302652=[];_0x302652[_0x38ec('0x8f')](new Extension(_0xa86347,_0x8634fe,'',_0x38ec('0x90')));_0x8634fe+=0x1;_0x302652[_0x38ec('0x8f')](new Extension(_0xa86347,_0x8634fe,_0x38ec('0x91'),_0x38ec('0x92')));_0x8634fe+=0x1;for(var _0x19bf32 in _0xa86347){if(_0xa86347['hasOwnProperty'](_0x19bf32)&&(_0x19bf32==='ecm'||_0x19bf32===_0x38ec('0x89')||_0x19bf32==='gateway'||_0x19bf32===_0x38ec('0x93')||_0x19bf32===_0x38ec('0x94')||_0x19bf32===_0x38ec('0x95')||_0x19bf32==='minrate'||_0x19bf32==='modem'||_0x19bf32===_0x38ec('0x96'))){_0x302652[_0x38ec('0x8f')](new Extension(_0xa86347,_0x8634fe,'FAXOPT('+_0x19bf32+')='+_0xa86347[_0x19bf32],_0x38ec('0x92')));_0x8634fe+=0x1;}}_0x302652[_0x38ec('0x8f')](new Extension(_0xa86347,_0x8634fe,'6','Wait'));_0x8634fe+=0x1;_0x302652[_0x38ec('0x8f')](new Extension(_0xa86347,_0x8634fe,_0x38ec('0x97'),_0x38ec('0x98')));_0x8634fe=0x0;return _0x302652;}exports[_0x38ec('0x99')]=function(_0x8017d4,_0x2984ae,_0x4ac814){var _0x12a6f3;return db[_0x38ec('0x7e')][_0x38ec('0x7d')](function(_0x4d02a3){return db[_0x38ec('0x3f')][_0x38ec('0x59')](_0x8017d4[_0x38ec('0x5a')],{'transaction':_0x4d02a3})['then'](function(_0x50954a){_0x12a6f3=_0x50954a['get']({'plain':!![]});return db[_0x38ec('0x9a')]['bulkCreate'](createExtensionsReciveFax(_0x12a6f3),{'transaction':_0x4d02a3});});})[_0x38ec('0x33')](function(){return _0x12a6f3;})[_0x38ec('0x33')](respondWithResult(_0x2984ae,null))[_0x38ec('0x26')](handleError(_0x2984ae,null));};exports['updateAccountApplications']=function(_0x3b32da,_0x1e2cf1,_0x5a4280){var _0xd8b457;return db['sequelize'][_0x38ec('0x7d')](function(_0x439ea9){return db[_0x38ec('0x3f')]['update'](_0x3b32da[_0x38ec('0x5a')],{'where':{'id':_0x3b32da['body']['id']},'transaction':_0x439ea9})[_0x38ec('0x33')](function(_0x2c8757){return db[_0x38ec('0x9a')]['destroy']({'where':{'FaxAccountId':_0x3b32da[_0x38ec('0x5a')]['id']},'transaction':_0x439ea9})[_0x38ec('0x33')](function(_0x343da7){return db[_0x38ec('0x9a')][_0x38ec('0x9b')](createExtensionsReciveFax(_['omit'](_0x3b32da[_0x38ec('0x5a')],[_0x38ec('0x9c'),_0x38ec('0x43'),_0x38ec('0x9d'),_0x38ec('0x9e'),'TrunkId',_0x38ec('0x9f')])),{'transaction':_0x439ea9});});});})[_0x38ec('0x33')](function(){return db['FaxAccount'][_0x38ec('0xa0')](_0x3b32da['body']['id']);})[_0x38ec('0x33')](respondWithResult(_0x1e2cf1,null))[_0x38ec('0x26')](handleError(_0x1e2cf1,null));};exports['getMessages']=function(_0x30c5cd,_0x6b9179,_0x4e9165){var _0x58688f={'raw':!![],'where':{}};var _0x159372={};var _0x562561={'count':0x0,'rows':[]};return db[_0x38ec('0x3f')][_0x38ec('0x64')]({'where':{'id':_0x30c5cd[_0x38ec('0x58')]['id']}})[_0x38ec('0x33')](handleEntityNotFound(_0x6b9179,null))[_0x38ec('0x33')](function(_0xb45460){if(_0xb45460){_0x159372[_0x38ec('0x44')]=_['keys'](db[_0x38ec('0xa1')][_0x38ec('0x40')]);_0x159372[_0x38ec('0x45')]=_['keys'](_0x30c5cd['query']);_0x159372[_0x38ec('0x47')]=_[_0x38ec('0x48')](_0x159372[_0x38ec('0x44')],_0x159372[_0x38ec('0x45')]);_0x58688f['attributes']=_[_0x38ec('0x48')](_0x159372['model'],qs[_0x38ec('0x4a')](_0x30c5cd[_0x38ec('0x45')][_0x38ec('0x4a')]));_0x58688f[_0x38ec('0x49')]=_0x58688f[_0x38ec('0x49')][_0x38ec('0x4b')]?_0x58688f[_0x38ec('0x49')]:_0x159372[_0x38ec('0x44')];if(!_0x30c5cd[_0x38ec('0x45')][_0x38ec('0x4c')]('nolimit')){_0x58688f[_0x38ec('0x2d')]=qs[_0x38ec('0x2d')](_0x30c5cd[_0x38ec('0x45')]['limit']);_0x58688f['offset']=qs[_0x38ec('0x2b')](_0x30c5cd[_0x38ec('0x45')][_0x38ec('0x2b')]);}_0x58688f['order']=qs[_0x38ec('0x4e')](_0x30c5cd[_0x38ec('0x45')][_0x38ec('0x4e')]);_0x58688f[_0x38ec('0x4f')]=qs['filters'](_[_0x38ec('0x66')](_0x30c5cd[_0x38ec('0x45')],_0x159372[_0x38ec('0x47')]));_0x58688f[_0x38ec('0x4f')]['FaxAccountId']=_0xb45460['id'];if(_0x30c5cd[_0x38ec('0x45')][_0x38ec('0x51')]){_0x58688f[_0x38ec('0x4f')]=_[_0x38ec('0x52')](_0x58688f[_0x38ec('0x4f')],{'$or':_[_0x38ec('0x3e')](_0x58688f['attributes'],function(_0x279145){var _0x1c778b={};_0x1c778b[_0x279145]={'$like':'%'+_0x30c5cd[_0x38ec('0x45')][_0x38ec('0x51')]+'%'};return _0x1c778b;})});}if(_0x30c5cd[_0x38ec('0x45')][_0x38ec('0xa2')]){var _0x46417e=_0x30c5cd['query']['$gte'][_0x38ec('0xa3')](',');var _0x19fce7={};_0x19fce7[_0x46417e[0x0]]={'$gte':moment(_0x46417e[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x58688f[_0x38ec('0x4f')]=_[_0x38ec('0x52')](_0x58688f['where'],_0x19fce7);}_0x58688f=_[_0x38ec('0x52')]({},_0x58688f,_0x30c5cd[_0x38ec('0x53')]);return db[_0x38ec('0xa1')]['count']({'where':_0x58688f['where']})['then'](function(_0x147b90){_0x562561['count']=_0x147b90;if(_0x30c5cd[_0x38ec('0x45')][_0x38ec('0x54')]){_0x58688f[_0x38ec('0x55')]=[{'all':!![]}];}return db[_0x38ec('0xa1')][_0x38ec('0x7b')](_0x58688f);})[_0x38ec('0x33')](function(_0x1d0771){_0x562561['rows']=_0x1d0771;return _0x562561;});}})[_0x38ec('0x33')](respondWithFilteredResult(_0x6b9179,_0x58688f))[_0x38ec('0x26')](handleError(_0x6b9179,null));};exports[_0x38ec('0x84')]=function(_0x35d61e,_0x3a78c1,_0x2f7762){var _0x4c2e78,_0x1f9753={},_0x24af8d;if(_0x35d61e[_0x38ec('0x5a')]['to']){_0x24af8d=_0x35d61e[_0x38ec('0x5a')]['to'][0x0];}return db[_0x38ec('0x3f')][_0x38ec('0x60')]({'where':{'id':_0x35d61e[_0x38ec('0x58')]['id']},'include':[{'model':db[_0x38ec('0xa4')],'as':_0x38ec('0xa5'),'include':[{'model':db[_0x38ec('0x72')],'as':_0x38ec('0xa6'),'where':{'fax':_0x24af8d},'limit':0x1,'order':[[_0x38ec('0x9e'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x3a78c1,null))[_0x38ec('0x33')](function(_0x1cec2e){_0x4c2e78=_0x1cec2e;if(_0x35d61e['body'][_0x38ec('0xa7')]&&_0x35d61e[_0x38ec('0x5a')]['attachments'][_0x38ec('0x4b')]){for(var _0xf2fee4=0x0;_0xf2fee4<_0x35d61e[_0x38ec('0x5a')]['attachments'][_0x38ec('0x4b')];_0xf2fee4+=0x1){_0x35d61e[_0x38ec('0x5a')][_0x38ec('0xa7')][_0xf2fee4]={'filename':_0x35d61e['body']['attachments'][_0xf2fee4][_0x38ec('0x3a')],'id':_0x35d61e[_0x38ec('0x5a')][_0x38ec('0xa7')][_0xf2fee4]['id'],'path':path['join'](config['root'],_0x38ec('0xa8'),_0x35d61e['body'][_0x38ec('0xa7')][_0xf2fee4][_0x38ec('0xa9')])};}}return respondWithRpcPromise(_0x38ec('0xaa'),_0x38ec('0xaa'),{'FaxAccountId':_[_0x38ec('0xab')](_0x35d61e['params']['id'])?undefined:_0x35d61e[_0x38ec('0x58')]['id'],'path':_[_0x38ec('0xab')](_0x35d61e['body'][_0x38ec('0xa7')][0x0][_0x38ec('0x7')])?undefined:_0x35d61e[_0x38ec('0x5a')][_0x38ec('0xa7')][0x0]['path'],'fax':_['isNil'](_0x35d61e[_0x38ec('0x5a')]['to'][0x0])?undefined:_0x35d61e[_0x38ec('0x5a')]['to'][0x0]},client9002);})['then'](function(){if(_0x4c2e78){if(_['isNil'](_0x35d61e[_0x38ec('0x5a')][_0x38ec('0xac')])){_0x35d61e[_0x38ec('0x5a')][_0x38ec('0xac')]=util[_0x38ec('0xad')](_0x38ec('0xae'),_0x4c2e78[_0x38ec('0x3a')],_0x4c2e78[_0x38ec('0xaf')]);}if(_0x4c2e78[_0x38ec('0xa5')]){if(_0x4c2e78[_0x38ec('0xa5')][_0x38ec('0xa6')][_0x38ec('0x4b')]){return _0x4c2e78['List']['Contacts'][0x0];}else{return db[_0x38ec('0x72')][_0x38ec('0x59')](_[_0x38ec('0xb0')](_0x35d61e[_0x38ec('0x5a')],{'firstName':_0x35d61e[_0x38ec('0x5a')]['to'][0x0],'phone':_0x35d61e[_0x38ec('0x5a')]['to'][0x0],'fax':_0x35d61e[_0x38ec('0x5a')]['to'][0x0],'ListId':_0x4c2e78[_0x38ec('0x9f')]}));}}else{throw new Error(_0x38ec('0xb1'));}}else{throw new Error(_0x38ec('0xb2'));}})[_0x38ec('0x33')](function(_0x3f36c0){if(_0x3f36c0){return db[_0x38ec('0x6e')][_0x38ec('0x60')]({'where':{'ContactId':_0x3f36c0['id'],'closed':![],'FaxAccountId':_0x4c2e78['id']}})['then'](function(_0x523314){if(_0x523314){return[_0x523314,![]];}return db[_0x38ec('0x6e')][_0x38ec('0x59')]({'UserId':_0x35d61e[_0x38ec('0x5b')]['id'],'ContactId':_0x3f36c0['id'],'FaxAccountId':_0x4c2e78['id'],'fax':_0x35d61e[_0x38ec('0x5a')]['to'][0x0],'firstMsgDirection':_0x38ec('0xb3'),'Messages':[_[_0x38ec('0x52')](_0x35d61e[_0x38ec('0x5a')],{'read':![],'body':_0x35d61e[_0x38ec('0x5a')][_0x38ec('0xa7')][0x0][_0x38ec('0xb4')],'FaxAccountId':_0x4c2e78['id'],'UserId':_0x35d61e[_0x38ec('0x5b')]['id'],'ContactId':_0x3f36c0['id'],'AttachmentId':_0x35d61e[_0x38ec('0x5a')][_0x38ec('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0x38ec('0xa1')],'as':_0x38ec('0xb5')}]})['then'](function(_0x16e971){return[_0x16e971,!![]];});});}else{throw new Error(_0x38ec('0xb6'));}})[_0x38ec('0xb7')](function(_0xa987ff,_0x16a339){if(_0x16a339){return _0xa987ff;}return db[_0x38ec('0xa1')]['create']({'direction':'out','read':![],'body':_0x35d61e[_0x38ec('0x5a')][_0x38ec('0xa7')][0x0][_0x38ec('0xb4')],'FaxAccountId':_0x4c2e78['id'],'FaxInteractionId':_0xa987ff['id'],'UserId':_0x35d61e[_0x38ec('0x5b')]['id'],'ContactId':_0xa987ff['ContactId'],'AttachmentId':_0x35d61e[_0x38ec('0x5a')]['attachments'][0x0]['id']})[_0x38ec('0x33')](function(_0x44ac6a){_0xa987ff[_0x38ec('0xb8')][_0x38ec('0xb5')]=[];_0xa987ff['dataValues'][_0x38ec('0xb5')]['push'](_0x44ac6a[_0x38ec('0xb8')]);return _0xa987ff;});})[_0x38ec('0x33')](function(_0x2a3c8d){respondWithRpcPromise(_0x38ec('0xb9'),_0x38ec('0xb9'),{'FaxAccountId':_['isNil'](_0x35d61e[_0x38ec('0x58')]['id'])?undefined:_0x35d61e[_0x38ec('0x58')]['id'],'path':_[_0x38ec('0xab')](_0x35d61e[_0x38ec('0x5a')][_0x38ec('0xa7')][0x0][_0x38ec('0x7')])?undefined:_0x35d61e[_0x38ec('0x5a')][_0x38ec('0xa7')][0x0][_0x38ec('0x7')],'fax':_['isNil'](_0x35d61e[_0x38ec('0x5a')]['to'][0x0])?undefined:_0x35d61e[_0x38ec('0x5a')]['to'][0x0],'AttachmentId':_0x35d61e['body'][_0x38ec('0xa7')][0x0]['id']},client9002)[_0x38ec('0x33')](function(_0x19b6d7){logger[_0x38ec('0x1d')]('SendFaxRpc,\x20%s',_0x19b6d7);})[_0x38ec('0x26')](function(_0x42795d){logger['info'](_0x38ec('0xba'),_0x42795d);});return _0x2a3c8d;})[_0x38ec('0x33')](respondWithResult(_0x3a78c1,null))[_0x38ec('0x26')](handleError(_0x3a78c1,null));};exports[_0x38ec('0xbb')]=function(_0x5ec4fb,_0x5b24c9,_0x228f0a){return db[_0x38ec('0x3f')][_0x38ec('0x60')]({'where':{'id':_0x5ec4fb['params']['id']}})[_0x38ec('0x33')](handleEntityNotFound(_0x5b24c9,null))[_0x38ec('0x33')](function(_0x5a2fa0){if(_0x5a2fa0){return _0x5a2fa0['addAgents'](_0x5ec4fb[_0x38ec('0x5a')]['ids'],_['omit'](_0x5ec4fb[_0x38ec('0x5a')],[_0x38ec('0x6c'),'id'])||{})['spread'](function(_0x5e98eb){for(var _0x17afb1=0x0;_0x17afb1<_0x5ec4fb['body'][_0x38ec('0x6c')][_0x38ec('0x4b')];_0x17afb1+=0x1){socket[_0x38ec('0xbc')](_0x38ec('0xbd'),{'UserId':Number(_0x5ec4fb['body'][_0x38ec('0x6c')][_0x17afb1]),'FaxAccountId':Number(_0x5ec4fb[_0x38ec('0x58')]['id'])});}return _0x5e98eb;});}})[_0x38ec('0x33')](respondWithResult(_0x5b24c9,null))[_0x38ec('0x26')](handleError(_0x5b24c9,null));};exports[_0x38ec('0xbe')]=function(_0x2832b1,_0x5f3668,_0x3145bb){return db[_0x38ec('0x3f')][_0x38ec('0x60')]({'where':{'id':_0x2832b1[_0x38ec('0x58')]['id']}})[_0x38ec('0x33')](handleEntityNotFound(_0x5f3668,null))[_0x38ec('0x33')](function(_0x48f6a4){if(_0x48f6a4){return _0x48f6a4[_0x38ec('0xbe')](_0x2832b1[_0x38ec('0x45')][_0x38ec('0x6c')])[_0x38ec('0x33')](function(){if(_[_0x38ec('0xbf')](_0x2832b1[_0x38ec('0x45')][_0x38ec('0x6c')])){for(var _0x17354f=0x0;_0x17354f<_0x2832b1[_0x38ec('0x45')][_0x38ec('0x6c')]['length'];_0x17354f+=0x1){socket[_0x38ec('0xbc')]('userFaxAccount:remove',{'UserId':Number(_0x2832b1[_0x38ec('0x45')][_0x38ec('0x6c')][_0x17354f]),'FaxAccountId':Number(_0x2832b1[_0x38ec('0x58')]['id'])});}}else{socket[_0x38ec('0xbc')]('userFaxAccount:remove',{'UserId':Number(_0x2832b1[_0x38ec('0x45')][_0x38ec('0x6c')]),'FaxAccountId':Number(_0x2832b1['params']['id'])});}});}})[_0x38ec('0x33')](respondWithStatusCode(_0x5f3668,null))[_0x38ec('0x26')](handleError(_0x5f3668,null));};exports[_0x38ec('0xc0')]=function(_0x4d3ff8,_0x247308,_0x75ed68){var _0xb45fd4={};var _0xe86d68={};var _0x655330;var _0xaadc78;return db[_0x38ec('0x3f')][_0x38ec('0x64')]({'where':{'id':_0x4d3ff8[_0x38ec('0x58')]['id']}})[_0x38ec('0x33')](handleEntityNotFound(_0x247308,null))[_0x38ec('0x33')](function(_0x153b7e){if(_0x153b7e){_0x655330=_0x153b7e;_0xe86d68[_0x38ec('0x44')]=_[_0x38ec('0x46')](db[_0x38ec('0x74')]['rawAttributes']);_0xe86d68['query']=_['keys'](_0x4d3ff8[_0x38ec('0x45')]);_0xe86d68[_0x38ec('0x47')]=_[_0x38ec('0x48')](_0xe86d68[_0x38ec('0x44')],_0xe86d68[_0x38ec('0x45')]);_0xb45fd4[_0x38ec('0x49')]=_['intersection'](_0xe86d68[_0x38ec('0x44')],qs[_0x38ec('0x4a')](_0x4d3ff8['query'][_0x38ec('0x4a')]));_0xb45fd4[_0x38ec('0x49')]=_0xb45fd4[_0x38ec('0x49')][_0x38ec('0x4b')]?_0xb45fd4[_0x38ec('0x49')]:_0xe86d68[_0x38ec('0x44')];_0xb45fd4[_0x38ec('0x4d')]=qs[_0x38ec('0x4e')](_0x4d3ff8[_0x38ec('0x45')]['sort']);_0xb45fd4[_0x38ec('0x4f')]=qs[_0x38ec('0x47')](_['pick'](_0x4d3ff8['query'],_0xe86d68[_0x38ec('0x47')]));if(_0x4d3ff8[_0x38ec('0x45')][_0x38ec('0x51')]){_0xb45fd4[_0x38ec('0x4f')]=_[_0x38ec('0x52')](_0xb45fd4[_0x38ec('0x4f')],{'$or':_[_0x38ec('0x3e')](_0xb45fd4['attributes'],function(_0x19762a){var _0x161fbe={};_0x161fbe[_0x19762a]={'$like':'%'+_0x4d3ff8[_0x38ec('0x45')][_0x38ec('0x51')]+'%'};return _0x161fbe;})});}_0xb45fd4=_[_0x38ec('0x52')]({},_0xb45fd4,_0x4d3ff8[_0x38ec('0x53')]);return _0x655330['getAgents'](_0xb45fd4);}})['then'](function(_0x5b4aeb){if(_0x5b4aeb){_0xaadc78=_0x5b4aeb['length'];if(!_0x4d3ff8[_0x38ec('0x45')]['hasOwnProperty'](_0x38ec('0x6b'))){_0xb45fd4[_0x38ec('0x2d')]=qs['limit'](_0x4d3ff8[_0x38ec('0x45')]['limit']);_0xb45fd4[_0x38ec('0x2b')]=qs[_0x38ec('0x2b')](_0x4d3ff8[_0x38ec('0x45')]['offset']);}return _0x655330['getAgents'](_0xb45fd4);}})[_0x38ec('0x33')](function(_0x415467){if(_0x415467){return _0x415467?{'count':_0xaadc78,'rows':_0x415467}:null;}})[_0x38ec('0x33')](respondWithResult(_0x247308,null))['catch'](handleError(_0x247308,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 730a86a..46ee22a 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 _0x7dd1=['hook','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x16a344,_0x43dc6c){var _0x24f848=function(_0x23c39a){while(--_0x23c39a){_0x16a344['push'](_0x16a344['shift']());}};_0x24f848(++_0x43dc6c);}(_0x7dd1,0x169));var _0x17dd=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x7dd1[_0x13b8f3];return _0x1a6d06;};'use strict';var EventEmitter=require(_0x17dd('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x17dd('0x1')](0x0);var events={'afterCreate':_0x17dd('0x2'),'afterUpdate':_0x17dd('0x3'),'afterDestroy':_0x17dd('0x4')};function emitEvent(_0x2377db){return function(_0x37b575,_0x575802,_0x553579){FaxAccountEvents[_0x17dd('0x5')](_0x2377db+':'+_0x37b575['id'],_0x37b575);FaxAccountEvents['emit'](_0x2377db,_0x37b575);_0x553579(null);};}for(var e in events){if(events[_0x17dd('0x6')](e)){var event=events[e];FaxAccount[_0x17dd('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x733f=['events','FaxAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x5c1e75,_0x173aaa){var _0x2067d0=function(_0x42c051){while(--_0x42c051){_0x5c1e75['push'](_0x5c1e75['shift']());}};_0x2067d0(++_0x173aaa);}(_0x733f,0x120));var _0xf733=function(_0x58f2f4,_0x1fe95e){_0x58f2f4=_0x58f2f4-0x0;var _0x4d5e94=_0x733f[_0x58f2f4];return _0x4d5e94;};'use strict';var EventEmitter=require(_0xf733('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xf733('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf733('0x2')](0x0);var events={'afterCreate':_0xf733('0x3'),'afterUpdate':'update','afterDestroy':_0xf733('0x4')};function emitEvent(_0x3bacc8){return function(_0x1bde79,_0x28241e,_0xa6f6fe){FaxAccountEvents[_0xf733('0x5')](_0x3bacc8+':'+_0x1bde79['id'],_0x1bde79);FaxAccountEvents[_0xf733('0x5')](_0x3bacc8,_0x1bde79);_0xa6f6fe(null);};}for(var e in events){if(events[_0xf733('0x6')](e)){var event=events[e];FaxAccount[_0xf733('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index d3d0afe..c8bb7b9 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 _0x6073=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','define','FaxAccount','fax_accounts','lodash','util'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x6073,0x1ec));var _0x3607=function(_0x4fd9e6,_0x21a10d){_0x4fd9e6=_0x4fd9e6-0x0;var _0x1937a7=_0x6073[_0x4fd9e6];return _0x1937a7;};'use strict';var _=require(_0x3607('0x0'));var util=require(_0x3607('0x1'));var logger=require(_0x3607('0x2'))(_0x3607('0x3'));var moment=require(_0x3607('0x4'));var BPromise=require(_0x3607('0x5'));var rp=require(_0x3607('0x6'));var fs=require('fs');var path=require(_0x3607('0x7'));var rimraf=require('rimraf');var config=require(_0x3607('0x8'));var attributes=require(_0x3607('0x9'));module['exports']=function(_0x43d22d,_0x46b07b){return _0x43d22d[_0x3607('0xa')](_0x3607('0xb'),attributes,{'tableName':_0x3607('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2f0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x3569b7,_0x1f9423){var _0x3d0e5e=function(_0x379f58){while(--_0x379f58){_0x3569b7['push'](_0x3569b7['shift']());}};_0x3d0e5e(++_0x1f9423);}(_0xc2f0,0x18c));var _0x0c2f=function(_0x4fff08,_0x14255b){_0x4fff08=_0x4fff08-0x0;var _0x3485aa=_0xc2f0[_0x4fff08];return _0x3485aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c2f('0x0'))(_0x0c2f('0x1'));var moment=require(_0x0c2f('0x2'));var BPromise=require(_0x0c2f('0x3'));var rp=require(_0x0c2f('0x4'));var fs=require('fs');var path=require(_0x0c2f('0x5'));var rimraf=require(_0x0c2f('0x6'));var config=require(_0x0c2f('0x7'));var attributes=require(_0x0c2f('0x8'));module[_0x0c2f('0x9')]=function(_0x156356,_0x5e79fd){return _0x156356[_0x0c2f('0xa')](_0x0c2f('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 19309f4..0f22868 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 _0x68d4=['push','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','name','unshift','waitForTheAssignedAgent','queueId','FaxQueue','queue','waitForTheAssignedQueue','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','request\x20sent','error','code','FaxAccount,\x20%s,\x20%s','message','catch','GetFaxAccount','FaxAccount','findAll','options','where','attributes','include','model','debug','stringify','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','find','CmList','List','DESC','FaxApplication','Applications','get','applications','list','priority','asc','account','Contacts','length','create','contact','FaxInteraction','autoclose'];(function(_0x1f2161,_0x485b11){var _0xa9ea62=function(_0x41dad7){while(--_0x41dad7){_0x1f2161['push'](_0x1f2161['shift']());}};_0xa9ea62(++_0x485b11);}(_0x68d4,0x1c9));var _0x468d=function(_0x35e7f5,_0x505458){_0x35e7f5=_0x35e7f5-0x0;var _0x21327e=_0x68d4[_0x35e7f5];return _0x21327e;};'use strict';var _=require(_0x468d('0x0'));var util=require('util');var moment=require(_0x468d('0x1'));var BPromise=require('bluebird');var rs=require(_0x468d('0x2'));var fs=require('fs');var Redis=require(_0x468d('0x3'));var db=require(_0x468d('0x4'))['db'];var utils=require(_0x468d('0x5'));var logger=require(_0x468d('0x6'))('rpc');var config=require(_0x468d('0x7'));var jayson=require(_0x468d('0x8'));var client=jayson[_0x468d('0x9')][_0x468d('0xa')]({'port':0x232c});config['redis']=_[_0x468d('0xb')](config[_0x468d('0xc')],{'host':_0x468d('0xd'),'port':0x18eb});var socket=require(_0x468d('0xe'))(new Redis(config[_0x468d('0xc')]));require(_0x468d('0xf'))[_0x468d('0x10')](socket);function respondWithRpcPromise(_0x3333fa,_0x1e9f63,_0x511d12){return new BPromise(function(_0x2f0154,_0x333cdd){return client[_0x468d('0x11')](_0x3333fa,_0x511d12)[_0x468d('0x12')](function(_0x4eed77){logger[_0x468d('0x13')]('FaxAccount,\x20%s,\x20%s',_0x1e9f63,_0x468d('0x14'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1e9f63,_0x468d('0x14'),JSON['stringify'](_0x4eed77));if(_0x4eed77[_0x468d('0x15')]){if(_0x4eed77['error'][_0x468d('0x16')]===0x1f4){logger[_0x468d('0x15')](_0x468d('0x17'),_0x1e9f63,_0x4eed77[_0x468d('0x15')][_0x468d('0x18')]);return _0x333cdd(_0x4eed77['error']['message']);}logger['error'](_0x468d('0x17'),_0x1e9f63,_0x4eed77[_0x468d('0x15')][_0x468d('0x18')]);return _0x2f0154(_0x4eed77['error'][_0x468d('0x18')]);}else{logger[_0x468d('0x13')](_0x468d('0x17'),_0x1e9f63,_0x468d('0x14'));_0x2f0154(_0x4eed77['result'][_0x468d('0x18')]);}})[_0x468d('0x19')](function(_0x1f30ce){logger[_0x468d('0x15')](_0x468d('0x17'),_0x1e9f63,_0x1f30ce);_0x333cdd(_0x1f30ce);});});}exports[_0x468d('0x1a')]=function(_0x2cdaed){var _0x2f9341=this;return new Promise(function(_0x886ca2,_0x5fd863){return db[_0x468d('0x1b')][_0x468d('0x1c')]({'raw':_0x2cdaed['options']?_0x2cdaed[_0x468d('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2cdaed[_0x468d('0x1d')]?_0x2cdaed['options'][_0x468d('0x1e')]||null:null,'attributes':_0x2cdaed[_0x468d('0x1d')]?_0x2cdaed[_0x468d('0x1d')][_0x468d('0x1f')]||null:null,'limit':_0x2cdaed[_0x468d('0x1d')]?_0x2cdaed['options']['limit']||null:null,'include':_0x2cdaed[_0x468d('0x1d')]?_0x2cdaed['options'][_0x468d('0x20')]?_['map'](_0x2cdaed[_0x468d('0x1d')]['include'],function(_0x3e74e8){return{'model':db[_0x3e74e8[_0x468d('0x21')]],'as':_0x3e74e8['as'],'attributes':_0x3e74e8[_0x468d('0x1f')],'include':_0x3e74e8[_0x468d('0x20')]?_['map'](_0x3e74e8[_0x468d('0x20')],function(_0x40e7ab){return{'model':db[_0x40e7ab['model']],'as':_0x40e7ab['as'],'attributes':_0x40e7ab[_0x468d('0x1f')],'include':_0x40e7ab['include']?_['map'](_0x40e7ab[_0x468d('0x20')],function(_0xab7d86){return{'model':db[_0xab7d86[_0x468d('0x21')]],'as':_0xab7d86['as'],'attributes':_0xab7d86[_0x468d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x468d('0x12')](function(_0x1d137c){logger[_0x468d('0x13')](_0x468d('0x1a'),_0x2cdaed);logger[_0x468d('0x22')](_0x468d('0x1a'),_0x2cdaed,JSON[_0x468d('0x23')](_0x1d137c));_0x886ca2(_0x1d137c);})[_0x468d('0x19')](function(_0x36dffc){logger[_0x468d('0x15')](_0x468d('0x1a'),_0x36dffc[_0x468d('0x18')],_0x2cdaed);_0x5fd863(_0x2f9341[_0x468d('0x15')](0x1f4,_0x36dffc[_0x468d('0x18')]));});});};exports['NotifyFaxAccount']=function(_0xa33333,_0x380be5,_0x53e942){var _0xef3f7=this;return new Promise(function(_0x671b4a,_0x5f2fae){var _0x3ac648={'body':_0xa33333['body'],'channel':_0x468d('0x24')};var _0x167928=[];var _0x19b00e=[];var _0x1e69c5={};return db[_0x468d('0x25')][_0x468d('0x26')]()[_0x468d('0x12')](function(_0x3a161b){if(!_0x3a161b){throw new db[(_0x468d('0x27'))][(_0x468d('0x28'))]('no\x20available\x20attributes');}_0x167928=_[_0x468d('0x29')](_[_0x468d('0x2a')](_0x3a161b),[_0x468d('0x2b'),_0x468d('0x2c')]);_0x19b00e=_[_0x468d('0x29')](_[_0x468d('0x2a')](_0x3a161b),[_0x468d('0x2b'),_0x468d('0x2c'),'CompanyId',_0x468d('0x2d')]);if(_0xa33333[_0x468d('0x2e')]['id']){delete _0xa33333[_0x468d('0x2e')]['id'];}if(_[_0x468d('0x2f')](_0xa33333['body'][_0x468d('0x30')])){throw new db[(_0x468d('0x27'))][(_0x468d('0x28'))](_0x468d('0x31'));}if(_[_0x468d('0x2f')](_0xa33333[_0x468d('0x2e')][_0x468d('0x2e')])||_0xa33333[_0x468d('0x2e')]['body']===''){throw new db[(_0x468d('0x27'))]['ValidationError'](_0x468d('0x32'));}if(_['isNil'](_0xa33333[_0x468d('0x2e')][_0x468d('0x33')])){throw new db['Sequelize'][(_0x468d('0x28'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19b00e);}if(!_[_0x468d('0x34')](_0x19b00e,_0xa33333['body']['mapKey'])){throw new db[(_0x468d('0x27'))][(_0x468d('0x28'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19b00e);}_0x1e69c5[_0xa33333['body'][_0x468d('0x33')]]=_0xa33333['body'][_0x468d('0x30')];})[_0x468d('0x12')](function(){return db[_0x468d('0x1b')][_0x468d('0x35')]({'where':{'id':_0xa33333['account']['id']},'include':[{'model':db[_0x468d('0x36')],'as':_0x468d('0x37'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x1e69c5,'limit':0x1,'order':[[_0x468d('0x2c'),_0x468d('0x38')]]}]},{'model':db[_0x468d('0x39')],'as':_0x468d('0x3a')}]});})[_0x468d('0x12')](function(_0x21a2d4){if(_0x21a2d4&&_0x21a2d4[_0x468d('0x37')]){var _0x46b689=_0x21a2d4[_0x468d('0x3b')]({'plain':!![]});_0x3ac648['account']=_0x46b689;_0x3ac648[_0x468d('0x3c')]=_0x46b689[_0x468d('0x3a')];_0x3ac648[_0x468d('0x3d')]=_0x46b689['List'];_0x3ac648[_0x468d('0x3c')]=_['orderBy'](_0x3ac648['applications'],[_0x468d('0x3e')],[_0x468d('0x3f')]);if(_0x3ac648[_0x468d('0x40')][_0x468d('0x3a')]){delete _0x3ac648[_0x468d('0x40')][_0x468d('0x3a')];}if(_0x3ac648[_0x468d('0x40')][_0x468d('0x37')]&&_0x3ac648['account'][_0x468d('0x37')][_0x468d('0x41')][_0x468d('0x42')]){return _0x3ac648[_0x468d('0x40')]['List'][_0x468d('0x41')][0x0];}var _0x3e9044=_[_0x468d('0xb')](_0xa33333[_0x468d('0x2e')],{'firstName':_0xa33333[_0x468d('0x2e')][_0x468d('0x30')],'ListId':_0x46b689[_0x468d('0x2d')]});_0x3e9044[_0xa33333[_0x468d('0x2e')][_0x468d('0x33')]]=_0xa33333[_0x468d('0x2e')][_0x468d('0x30')];return db['CmContact'][_0x468d('0x43')](_0x3e9044,{'fields':_0x167928,'raw':!![]});}})[_0x468d('0x12')](function(_0x5af039){_0x3ac648[_0x468d('0x44')]=_0x5af039;if(_0x5af039){var _0x130a3a={'ContactId':_0x5af039['id'],'FaxAccountId':_0xa33333[_0x468d('0x40')]['id'],'fax':_0x5af039['fax']};return db['FaxInteraction'][_0x468d('0x35')]({'where':{'ContactId':_0x5af039['id'],'closed':![],'FaxAccountId':_0xa33333[_0x468d('0x40')]['id']}})[_0x468d('0x12')](function(_0x1ff7ad){if(_0x1ff7ad){return[_0x1ff7ad,![]];}return db[_0x468d('0x45')][_0x468d('0x43')](_0x130a3a)[_0x468d('0x12')](function(_0x5ced9a){return[_0x5ced9a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x318ab0,_0x1c7741){var _0x52b39f=_0x318ab0[_0x468d('0x3b')]({'plain':!![]});if(_0x1c7741){if(_0x3ac648['account'][_0x468d('0x46')]){_0x3ac648[_0x468d('0x3c')][_0x468d('0x47')]({'id':0x0,'priority':_0x3ac648[_0x468d('0x3c')][_0x468d('0x42')]+0x1,'app':'close','appdata':_0x468d('0x48'),'interval':_0x468d('0x49')});}_0x52b39f[_0x468d('0x4a')]=!![];}else{_0x52b39f['created']=![];}_0x3ac648[_0x468d('0x4b')]=_0x52b39f;return db[_0x468d('0x4c')]['create']({'body':_0xa33333[_0x468d('0x2e')]['body'],'FaxAccountId':_0xa33333[_0x468d('0x40')]['id'],'FaxInteractionId':_0x318ab0['id'],'direction':'in','ContactId':_0x318ab0['ContactId'],'AttachmentId':_0xa33333['body'][_0x468d('0x4d')]});})[_0x468d('0x12')](function(_0x288b4e){_0x3ac648[_0x468d('0x18')]=_0x288b4e;if(!_0x3ac648[_0x468d('0x4b')][_0x468d('0x4e')])return;return db[_0x468d('0x4f')][_0x468d('0x35')]({'attributes':['id',_0x468d('0x50')],'where':{'id':_0x3ac648[_0x468d('0x4b')][_0x468d('0x4e')]}});})['then'](function(_0x189934){if(_0x189934){_0x3ac648[_0x468d('0x3c')][_0x468d('0x51')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x189934[_0x468d('0x50')]+','+(_0x3ac648[_0x468d('0x40')][_0x468d('0x52')]||0xa),'interval':_0x468d('0x49')});}if(!_0x3ac648[_0x468d('0x4b')][_0x468d('0x53')])return;return db[_0x468d('0x54')][_0x468d('0x35')]({'attributes':['id',_0x468d('0x50')],'where':{'id':_0x3ac648[_0x468d('0x4b')][_0x468d('0x53')]}});})[_0x468d('0x12')](function(_0x388115){if(_0x388115){_0x3ac648['applications'][_0x468d('0x51')]({'id':0x0,'priority':0x1,'app':_0x468d('0x55'),'appdata':_0x388115['name']+','+(_0x3ac648['account'][_0x468d('0x56')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x468d('0x57'),_0x3ac648);})[_0x468d('0x12')](function(_0x365815){_0x671b4a(_0x365815);})[_0x468d('0x19')](function(_0x152029){_0x5f2fae(_0xef3f7[_0x468d('0x15')](0x1f4,_0x152029[_0x468d('0x18')]));});});}; \ No newline at end of file +var _0xb867=['CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','DESC','FaxApplication','get','applications','Applications','list','orderBy','priority','asc','length','from','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','FaxQueue','queueId','waitForTheAssignedQueue','Start','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./faxAccount.socket','register','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','model','then','stringify','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb867,0xe5));var _0x7b86=function(_0x781ea,_0x2c3ce2){_0x781ea=_0x781ea-0x0;var _0x5b16ee=_0xb867[_0x781ea];return _0x5b16ee;};'use strict';var _=require(_0x7b86('0x0'));var util=require('util');var moment=require(_0x7b86('0x1'));var BPromise=require(_0x7b86('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7b86('0x3'));var logger=require(_0x7b86('0x4'))(_0x7b86('0x5'));var config=require(_0x7b86('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7b86('0x7')][_0x7b86('0x8')]({'port':0x232c});config['redis']=_[_0x7b86('0x9')](config[_0x7b86('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7b86('0xb'))(new Redis(config['redis']));require(_0x7b86('0xc'))[_0x7b86('0xd')](socket);function respondWithRpcPromise(_0x29084c,_0x524110,_0x43f7ce){return new BPromise(function(_0x2583b6,_0x36afd8){return client['request'](_0x29084c,_0x43f7ce)['then'](function(_0x5e44a8){logger[_0x7b86('0xe')](_0x7b86('0xf'),_0x524110,_0x7b86('0x10'));logger[_0x7b86('0x11')](_0x7b86('0x12'),_0x524110,_0x7b86('0x10'),JSON['stringify'](_0x5e44a8));if(_0x5e44a8[_0x7b86('0x13')]){if(_0x5e44a8[_0x7b86('0x13')][_0x7b86('0x14')]===0x1f4){logger[_0x7b86('0x13')](_0x7b86('0xf'),_0x524110,_0x5e44a8['error'][_0x7b86('0x15')]);return _0x36afd8(_0x5e44a8[_0x7b86('0x13')][_0x7b86('0x15')]);}logger['error'](_0x7b86('0xf'),_0x524110,_0x5e44a8[_0x7b86('0x13')][_0x7b86('0x15')]);return _0x2583b6(_0x5e44a8['error'][_0x7b86('0x15')]);}else{logger[_0x7b86('0xe')](_0x7b86('0xf'),_0x524110,_0x7b86('0x10'));_0x2583b6(_0x5e44a8['result']['message']);}})['catch'](function(_0x3a0fcc){logger[_0x7b86('0x13')](_0x7b86('0xf'),_0x524110,_0x3a0fcc);_0x36afd8(_0x3a0fcc);});});}exports[_0x7b86('0x16')]=function(_0x2d7f6a){var _0x60cd5c=this;return new Promise(function(_0x1da8bf,_0x4f5e0b){return db[_0x7b86('0x17')]['findAll']({'raw':_0x2d7f6a[_0x7b86('0x18')]?_0x2d7f6a[_0x7b86('0x18')][_0x7b86('0x19')]===undefined?!![]:![]:!![],'where':_0x2d7f6a[_0x7b86('0x18')]?_0x2d7f6a[_0x7b86('0x18')][_0x7b86('0x1a')]||null:null,'attributes':_0x2d7f6a[_0x7b86('0x18')]?_0x2d7f6a[_0x7b86('0x18')][_0x7b86('0x1b')]||null:null,'limit':_0x2d7f6a[_0x7b86('0x18')]?_0x2d7f6a[_0x7b86('0x18')][_0x7b86('0x1c')]||null:null,'include':_0x2d7f6a[_0x7b86('0x18')]?_0x2d7f6a[_0x7b86('0x18')][_0x7b86('0x1d')]?_[_0x7b86('0x1e')](_0x2d7f6a[_0x7b86('0x18')]['include'],function(_0x3367d7){return{'model':db[_0x3367d7['model']],'as':_0x3367d7['as'],'attributes':_0x3367d7['attributes'],'include':_0x3367d7[_0x7b86('0x1d')]?_['map'](_0x3367d7[_0x7b86('0x1d')],function(_0x5deb06){return{'model':db[_0x5deb06[_0x7b86('0x1f')]],'as':_0x5deb06['as'],'attributes':_0x5deb06[_0x7b86('0x1b')],'include':_0x5deb06[_0x7b86('0x1d')]?_['map'](_0x5deb06[_0x7b86('0x1d')],function(_0x5c55d7){return{'model':db[_0x5c55d7['model']],'as':_0x5c55d7['as'],'attributes':_0x5c55d7[_0x7b86('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7b86('0x20')](function(_0x5831ef){logger[_0x7b86('0xe')](_0x7b86('0x16'),_0x2d7f6a);logger[_0x7b86('0x11')](_0x7b86('0x16'),_0x2d7f6a,JSON[_0x7b86('0x21')](_0x5831ef));_0x1da8bf(_0x5831ef);})[_0x7b86('0x22')](function(_0x3af4c6){logger[_0x7b86('0x13')](_0x7b86('0x16'),_0x3af4c6[_0x7b86('0x15')],_0x2d7f6a);_0x4f5e0b(_0x60cd5c[_0x7b86('0x13')](0x1f4,_0x3af4c6[_0x7b86('0x15')]));});});};exports[_0x7b86('0x23')]=function(_0x35b3df,_0x254883,_0x332a5c){var _0x2dfa83=this;return new Promise(function(_0x9090ba,_0x33caaf){var _0x5187c0={'body':_0x35b3df[_0x7b86('0x24')],'channel':_0x7b86('0x25')};var _0x1b4cf9=[];var _0x314064=[];var _0x122a82={};return db[_0x7b86('0x26')][_0x7b86('0x27')]()['then'](function(_0x37229a){if(!_0x37229a){throw new db[(_0x7b86('0x28'))][(_0x7b86('0x29'))](_0x7b86('0x2a'));}_0x1b4cf9=_['difference'](_['keys'](_0x37229a),[_0x7b86('0x2b'),_0x7b86('0x2c')]);_0x314064=_[_0x7b86('0x2d')](_[_0x7b86('0x2e')](_0x37229a),[_0x7b86('0x2b'),'updatedAt',_0x7b86('0x2f'),_0x7b86('0x30')]);if(_0x35b3df['body']['id']){delete _0x35b3df[_0x7b86('0x24')]['id'];}if(_[_0x7b86('0x31')](_0x35b3df[_0x7b86('0x24')]['from'])){throw new db[(_0x7b86('0x28'))][(_0x7b86('0x29'))](_0x7b86('0x32'));}if(_[_0x7b86('0x31')](_0x35b3df['body'][_0x7b86('0x24')])||_0x35b3df[_0x7b86('0x24')]['body']===''){throw new db[(_0x7b86('0x28'))]['ValidationError'](_0x7b86('0x33'));}if(_[_0x7b86('0x31')](_0x35b3df[_0x7b86('0x24')]['mapKey'])){throw new db[(_0x7b86('0x28'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x314064);}if(!_[_0x7b86('0x34')](_0x314064,_0x35b3df[_0x7b86('0x24')][_0x7b86('0x35')])){throw new db[(_0x7b86('0x28'))]['ValidationError'](_0x7b86('0x36')+_0x314064);}_0x122a82[_0x35b3df[_0x7b86('0x24')]['mapKey']]=_0x35b3df[_0x7b86('0x24')]['from'];})[_0x7b86('0x20')](function(){return db[_0x7b86('0x17')][_0x7b86('0x37')]({'where':{'id':_0x35b3df[_0x7b86('0x38')]['id']},'include':[{'model':db['CmList'],'as':_0x7b86('0x39'),'include':[{'model':db[_0x7b86('0x26')],'as':_0x7b86('0x3a'),'where':_0x122a82,'limit':0x1,'order':[[_0x7b86('0x2c'),_0x7b86('0x3b')]]}]},{'model':db[_0x7b86('0x3c')],'as':'Applications'}]});})[_0x7b86('0x20')](function(_0x48d226){if(_0x48d226&&_0x48d226['List']){var _0x51d2db=_0x48d226[_0x7b86('0x3d')]({'plain':!![]});_0x5187c0[_0x7b86('0x38')]=_0x51d2db;_0x5187c0[_0x7b86('0x3e')]=_0x51d2db[_0x7b86('0x3f')];_0x5187c0[_0x7b86('0x40')]=_0x51d2db[_0x7b86('0x39')];_0x5187c0[_0x7b86('0x3e')]=_[_0x7b86('0x41')](_0x5187c0[_0x7b86('0x3e')],[_0x7b86('0x42')],[_0x7b86('0x43')]);if(_0x5187c0['account']['Applications']){delete _0x5187c0[_0x7b86('0x38')]['Applications'];}if(_0x5187c0[_0x7b86('0x38')][_0x7b86('0x39')]&&_0x5187c0[_0x7b86('0x38')][_0x7b86('0x39')][_0x7b86('0x3a')][_0x7b86('0x44')]){return _0x5187c0['account'][_0x7b86('0x39')][_0x7b86('0x3a')][0x0];}var _0x3f15c0=_[_0x7b86('0x9')](_0x35b3df['body'],{'firstName':_0x35b3df[_0x7b86('0x24')][_0x7b86('0x45')],'ListId':_0x51d2db[_0x7b86('0x30')]});_0x3f15c0[_0x35b3df[_0x7b86('0x24')][_0x7b86('0x35')]]=_0x35b3df[_0x7b86('0x24')][_0x7b86('0x45')];return db['CmContact'][_0x7b86('0x46')](_0x3f15c0,{'fields':_0x1b4cf9,'raw':!![]});}})[_0x7b86('0x20')](function(_0x55345c){_0x5187c0[_0x7b86('0x47')]=_0x55345c;if(_0x55345c){var _0x40789f={'ContactId':_0x55345c['id'],'FaxAccountId':_0x35b3df[_0x7b86('0x38')]['id'],'fax':_0x55345c['fax']};return db[_0x7b86('0x48')]['find']({'where':{'ContactId':_0x55345c['id'],'closed':![],'FaxAccountId':_0x35b3df[_0x7b86('0x38')]['id']}})[_0x7b86('0x20')](function(_0x24411f){if(_0x24411f){return[_0x24411f,![]];}return db[_0x7b86('0x48')][_0x7b86('0x46')](_0x40789f)[_0x7b86('0x20')](function(_0xd3cb70){return[_0xd3cb70,!![]];});});}else{throw new Error(_0x7b86('0x49'));}})[_0x7b86('0x4a')](function(_0xd89d51,_0x3966e4){var _0x30564a=_0xd89d51[_0x7b86('0x3d')]({'plain':!![]});if(_0x3966e4){if(_0x5187c0[_0x7b86('0x38')]['autoclose']){_0x5187c0[_0x7b86('0x3e')][_0x7b86('0x4b')]({'id':0x0,'priority':_0x5187c0[_0x7b86('0x3e')][_0x7b86('0x44')]+0x1,'app':_0x7b86('0x4c'),'appdata':_0x7b86('0x4d'),'interval':_0x7b86('0x4e')});}_0x30564a[_0x7b86('0x4f')]=!![];}else{_0x30564a[_0x7b86('0x4f')]=![];}_0x5187c0[_0x7b86('0x50')]=_0x30564a;return db['FaxMessage']['create']({'body':_0x35b3df[_0x7b86('0x24')][_0x7b86('0x24')],'FaxAccountId':_0x35b3df[_0x7b86('0x38')]['id'],'FaxInteractionId':_0xd89d51['id'],'direction':'in','ContactId':_0xd89d51[_0x7b86('0x51')],'AttachmentId':_0x35b3df[_0x7b86('0x24')]['AttachmentId']});})[_0x7b86('0x20')](function(_0x8f0a88){_0x5187c0[_0x7b86('0x15')]=_0x8f0a88;if(!_0x5187c0[_0x7b86('0x50')][_0x7b86('0x52')])return;return db[_0x7b86('0x53')][_0x7b86('0x37')]({'attributes':['id',_0x7b86('0x54')],'where':{'id':_0x5187c0['interaction'][_0x7b86('0x52')]}});})[_0x7b86('0x20')](function(_0x2e1a02){if(_0x2e1a02){_0x5187c0['applications'][_0x7b86('0x55')]({'id':0x0,'priority':0x0,'app':_0x7b86('0x56'),'appdata':_0x2e1a02[_0x7b86('0x54')]+','+(_0x5187c0['account'][_0x7b86('0x57')]||0xa),'interval':_0x7b86('0x4e')});}if(!_0x5187c0[_0x7b86('0x50')]['queueId'])return;return db[_0x7b86('0x58')][_0x7b86('0x37')]({'attributes':['id',_0x7b86('0x54')],'where':{'id':_0x5187c0[_0x7b86('0x50')][_0x7b86('0x59')]}});})['then'](function(_0x147f9c){if(_0x147f9c){_0x5187c0['applications'][_0x7b86('0x55')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x147f9c[_0x7b86('0x54')]+','+(_0x5187c0[_0x7b86('0x38')][_0x7b86('0x5a')]||0x12c),'interval':_0x7b86('0x4e')});}return respondWithRpcPromise(_0x7b86('0x5b'),'startRouting',_0x5187c0);})['then'](function(_0xb77ee1){_0x9090ba(_0xb77ee1);})['catch'](function(_0x51aabf){_0x33caaf(_0x2dfa83[_0x7b86('0x13')](0x1f4,_0x51aabf[_0x7b86('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 6a5d9d0..1b8fff0 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 _0x23b2=['register','length','faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener'];(function(_0x50d1bf,_0x4fab8c){var _0x7d22b7=function(_0x17309d){while(--_0x17309d){_0x50d1bf['push'](_0x50d1bf['shift']());}};_0x7d22b7(++_0x4fab8c);}(_0x23b2,0x159));var _0x223b=function(_0x179142,_0x32596d){_0x179142=_0x179142-0x0;var _0x124a1f=_0x23b2[_0x179142];return _0x124a1f;};'use strict';var FaxAccountEvents=require(_0x223b('0x0'));var events=[_0x223b('0x1'),_0x223b('0x2'),_0x223b('0x3')];function createListener(_0x40633e,_0x443f16){return function(_0x27a38f){_0x443f16[_0x223b('0x4')](_0x40633e,_0x27a38f);};}function removeListener(_0x3c6d7c,_0x540685){return function(){FaxAccountEvents[_0x223b('0x5')](_0x3c6d7c,_0x540685);};}exports[_0x223b('0x6')]=function(_0x45b89c){for(var _0x238215=0x0,_0x2a64eb=events[_0x223b('0x7')];_0x238215<_0x2a64eb;_0x238215++){var _0x3c7afc=events[_0x238215];var _0x4351df=createListener(_0x223b('0x8')+_0x3c7afc,_0x45b89c);FaxAccountEvents['on'](_0x3c7afc,_0x4351df);}}; \ No newline at end of file +var _0x8fbe=['faxAccount:','./faxAccount.events','save','update','emit','removeListener','register','length'];(function(_0x51ae26,_0x18d826){var _0x5e81cb=function(_0x4e7415){while(--_0x4e7415){_0x51ae26['push'](_0x51ae26['shift']());}};_0x5e81cb(++_0x18d826);}(_0x8fbe,0x81));var _0xe8fb=function(_0x4af9e4,_0x1a3458){_0x4af9e4=_0x4af9e4-0x0;var _0x4b8c9b=_0x8fbe[_0x4af9e4];return _0x4b8c9b;};'use strict';var FaxAccountEvents=require(_0xe8fb('0x0'));var events=[_0xe8fb('0x1'),'remove',_0xe8fb('0x2')];function createListener(_0x1880cf,_0x20494c){return function(_0x85d274){_0x20494c[_0xe8fb('0x3')](_0x1880cf,_0x85d274);};}function removeListener(_0x6944c3,_0xbfddb6){return function(){FaxAccountEvents[_0xe8fb('0x4')](_0x6944c3,_0xbfddb6);};}exports[_0xe8fb('0x5')]=function(_0x178f55){for(var _0x34b850=0x0,_0x58a0ff=events[_0xe8fb('0x6')];_0x34b850<_0x58a0ff;_0x34b850++){var _0x5c7a91=events[_0x34b850];var _0x47e002=createListener(_0xe8fb('0x7')+_0x5c7a91,_0x178f55);FaxAccountEvents['on'](_0x5c7a91,_0x47e002);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 904747a..fa15436 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 _0xa46a=['/:id/send','send','/:id/users','addAgents','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','getAgents','post','create','addDisposition','addAnswer','/:id/interactions','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications'];(function(_0x279f8c,_0x5544d2){var _0x34a987=function(_0x35cb9c){while(--_0x35cb9c){_0x279f8c['push'](_0x279f8c['shift']());}};_0x34a987(++_0x5544d2);}(_0xa46a,0x97));var _0xaa46=function(_0x474f02,_0x44c5af){_0x474f02=_0x474f02-0x0;var _0x47321d=_0xa46a[_0x474f02];return _0x47321d;};'use strict';var multer=require(_0xaa46('0x0'));var util=require(_0xaa46('0x1'));var path=require(_0xaa46('0x2'));var timeout=require(_0xaa46('0x3'));var express=require(_0xaa46('0x4'));var router=express[_0xaa46('0x5')]();var fs_extra=require(_0xaa46('0x6'));var auth=require(_0xaa46('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xaa46('0x8'));var controller=require(_0xaa46('0x9'));router[_0xaa46('0xa')]('/',auth[_0xaa46('0xb')](),controller['index']);router[_0xaa46('0xa')](_0xaa46('0xc'),auth['isAuthenticated'](),controller[_0xaa46('0xd')]);router['get'](_0xaa46('0xe'),auth[_0xaa46('0xb')](),controller[_0xaa46('0xf')]);router['get'](_0xaa46('0x10'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x11')]);router['get'](_0xaa46('0x12'),auth['isAuthenticated'](),controller[_0xaa46('0x13')]);router[_0xaa46('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xaa46('0x14')]);router[_0xaa46('0xa')](_0xaa46('0x15'),auth['isAuthenticated'](),controller[_0xaa46('0x16')]);router[_0xaa46('0xa')](_0xaa46('0x17'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x18')]);router[_0xaa46('0xa')]('/:id/users',auth[_0xaa46('0xb')](),controller[_0xaa46('0x19')]);router[_0xaa46('0x1a')]('/',auth['isAuthenticated'](),controller[_0xaa46('0x1b')]);router['post'](_0xaa46('0x10'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x1c')]);router[_0xaa46('0x1a')](_0xaa46('0x12'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x1d')]);router[_0xaa46('0x1a')](_0xaa46('0x1e'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x1f')]);router[_0xaa46('0x1a')]('/:id/applications',auth['isAuthenticated'](),controller[_0xaa46('0x20')]);router['post'](_0xaa46('0x21'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x22')]);router[_0xaa46('0x1a')](_0xaa46('0x23'),auth['isAuthenticated'](),controller[_0xaa46('0x24')]);router['post'](_0xaa46('0x25'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x26')]);router[_0xaa46('0x1a')](_0xaa46('0x27'),auth['isAuthenticated'](),controller[_0xaa46('0x28')]);router['put'](_0xaa46('0xe'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x29')]);router[_0xaa46('0x2a')](_0xaa46('0xe'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x2b')]);router['delete'](_0xaa46('0x10'),auth[_0xaa46('0xb')](),controller['removeDispositions']);router[_0xaa46('0x2a')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xaa46('0x2c')]);router[_0xaa46('0x2a')](_0xaa46('0x27'),auth['isAuthenticated'](),controller[_0xaa46('0x2d')]);module[_0xaa46('0x2e')]=router; \ No newline at end of file +var _0x1b35=['get','isAuthenticated','index','/describe','describe','/:id','show','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','/:id/interactions','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxAccount.controller'];(function(_0x5036f1,_0x555d55){var _0x283263=function(_0x3a7508){while(--_0x3a7508){_0x5036f1['push'](_0x5036f1['shift']());}};_0x283263(++_0x555d55);}(_0x1b35,0x98));var _0x51b3=function(_0x58efb4,_0x2ee648){_0x58efb4=_0x58efb4-0x0;var _0x2d5dfd=_0x1b35[_0x58efb4];return _0x2d5dfd;};'use strict';var multer=require('multer');var util=require(_0x51b3('0x0'));var path=require('path');var timeout=require(_0x51b3('0x1'));var express=require(_0x51b3('0x2'));var router=express[_0x51b3('0x3')]();var fs_extra=require(_0x51b3('0x4'));var auth=require(_0x51b3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x51b3('0x6'));var controller=require(_0x51b3('0x7'));router[_0x51b3('0x8')]('/',auth[_0x51b3('0x9')](),controller[_0x51b3('0xa')]);router[_0x51b3('0x8')](_0x51b3('0xb'),auth[_0x51b3('0x9')](),controller[_0x51b3('0xc')]);router['get'](_0x51b3('0xd'),auth['isAuthenticated'](),controller[_0x51b3('0xe')]);router[_0x51b3('0x8')]('/:id/dispositions',auth[_0x51b3('0x9')](),controller['getDispositions']);router[_0x51b3('0x8')]('/:id/canned_answers',auth[_0x51b3('0x9')](),controller['getAnswers']);router[_0x51b3('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x51b3('0xf')]);router['get'](_0x51b3('0x10'),auth[_0x51b3('0x9')](),controller['getApplications']);router[_0x51b3('0x8')](_0x51b3('0x11'),auth['isAuthenticated'](),controller[_0x51b3('0x12')]);router[_0x51b3('0x8')](_0x51b3('0x13'),auth[_0x51b3('0x9')](),controller[_0x51b3('0x14')]);router[_0x51b3('0x15')]('/',auth[_0x51b3('0x9')](),controller[_0x51b3('0x16')]);router['post'](_0x51b3('0x17'),auth['isAuthenticated'](),controller[_0x51b3('0x18')]);router[_0x51b3('0x15')](_0x51b3('0x19'),auth[_0x51b3('0x9')](),controller['addAnswer']);router['post'](_0x51b3('0x1a'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x51b3('0x15')](_0x51b3('0x10'),auth['isAuthenticated'](),controller[_0x51b3('0x1b')]);router[_0x51b3('0x15')](_0x51b3('0x1c'),auth['isAuthenticated'](),controller[_0x51b3('0x1d')]);router[_0x51b3('0x15')](_0x51b3('0x1e'),auth[_0x51b3('0x9')](),controller[_0x51b3('0x1f')]);router[_0x51b3('0x15')](_0x51b3('0x20'),auth[_0x51b3('0x9')](),controller[_0x51b3('0x21')]);router[_0x51b3('0x15')](_0x51b3('0x13'),auth[_0x51b3('0x9')](),controller['addAgents']);router[_0x51b3('0x22')]('/:id',auth[_0x51b3('0x9')](),controller['update']);router[_0x51b3('0x23')](_0x51b3('0xd'),auth[_0x51b3('0x9')](),controller[_0x51b3('0x24')]);router['delete'](_0x51b3('0x17'),auth[_0x51b3('0x9')](),controller[_0x51b3('0x25')]);router[_0x51b3('0x23')](_0x51b3('0x19'),auth[_0x51b3('0x9')](),controller[_0x51b3('0x26')]);router[_0x51b3('0x23')](_0x51b3('0x13'),auth[_0x51b3('0x9')](),controller[_0x51b3('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index b69e4ee..34f54ba 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 _0x2753=['INTEGER','noop','STRING','*,*,*,*','sequelize','exports'];(function(_0x33d87f,_0x5a16c9){var _0x4900fc=function(_0x26ea35){while(--_0x26ea35){_0x33d87f['push'](_0x33d87f['shift']());}};_0x4900fc(++_0x5a16c9);}(_0x2753,0x1cc));var _0x3275=function(_0x49f37e,_0x4d9211){_0x49f37e=_0x49f37e-0x0;var _0x3c30e6=_0x2753[_0x49f37e];return _0x3c30e6;};'use strict';var Sequelize=require(_0x3275('0x0'));module[_0x3275('0x1')]={'priority':{'type':Sequelize[_0x3275('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3275('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3275('0x4')],'defaultValue':_0x3275('0x5')}}; \ No newline at end of file +var _0x5973=['noop','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5973,0xb9));var _0x3597=function(_0x5d1566,_0x3fed4b){_0x5d1566=_0x5d1566-0x0;var _0x3441a2=_0x5973[_0x5d1566];return _0x3441a2;};'use strict';var Sequelize=require(_0x3597('0x0'));module[_0x3597('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3597('0x2')],'allowNull':![],'defaultValue':_0x3597('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3597('0x2')]},'interval':{'type':Sequelize[_0x3597('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 1c997fe..c553e03 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 _0x4912=['apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','FaxApplication','includeAll','include','findAll','catch','show','params','keys','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range'];(function(_0x9f2672,_0x577c3b){var _0x40ee3e=function(_0x2731a7){while(--_0x2731a7){_0x9f2672['push'](_0x9f2672['shift']());}};_0x40ee3e(++_0x577c3b);}(_0x4912,0x1b0));var _0x2491=function(_0xf4daeb,_0x3b375e){_0xf4daeb=_0xf4daeb-0x0;var _0x44d0ee=_0x4912[_0xf4daeb];return _0x44d0ee;};'use strict';var emlformat=require(_0x2491('0x0'));var rimraf=require(_0x2491('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2491('0x2'));var rp=require(_0x2491('0x3'));var moment=require(_0x2491('0x4'));var BPromise=require(_0x2491('0x5'));var Mustache=require(_0x2491('0x6'));var util=require('util');var path=require(_0x2491('0x7'));var sox=require(_0x2491('0x8'));var csv=require(_0x2491('0x9'));var ejs=require(_0x2491('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2491('0xb'));var squel=require(_0x2491('0xc'));var crypto=require(_0x2491('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2491('0xe'));var toCsv=require(_0x2491('0x9'));var querystring=require(_0x2491('0xf'));var Papa=require(_0x2491('0x10'));var Redis=require(_0x2491('0x11'));var authService=require(_0x2491('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2491('0x13'));var logger=require(_0x2491('0x14'))(_0x2491('0x15'));var utils=require(_0x2491('0x16'));var config=require(_0x2491('0x17'));var licenseUtil=require(_0x2491('0x18'));var db=require(_0x2491('0x19'))['db'];function respondWithStatusCode(_0x51c1d8,_0x1a1bc6){_0x1a1bc6=_0x1a1bc6||0xcc;return function(_0x561380){if(_0x561380){return _0x51c1d8[_0x2491('0x1a')](_0x1a1bc6);}return _0x51c1d8[_0x2491('0x1b')](_0x1a1bc6)[_0x2491('0x1c')]();};}function respondWithResult(_0x413f09,_0x4cc996){_0x4cc996=_0x4cc996||0xc8;return function(_0x5b439f){if(_0x5b439f){return _0x413f09[_0x2491('0x1b')](_0x4cc996)[_0x2491('0x1d')](_0x5b439f);}};}function respondWithFilteredResult(_0x22b121,_0x58db34){return function(_0x3e507d){if(_0x3e507d){var _0x562289=typeof _0x58db34['offset']==='undefined'&&typeof _0x58db34[_0x2491('0x1e')]===_0x2491('0x1f');var _0xda3b49=_0x3e507d[_0x2491('0x20')];var _0x32c661=_0x562289?0x0:_0x58db34['offset'];var _0x1dbc93=_0x562289?_0x3e507d[_0x2491('0x20')]:_0x58db34[_0x2491('0x21')]+_0x58db34['limit'];var _0x433e62;if(_0x1dbc93>=_0xda3b49){_0x1dbc93=_0xda3b49;_0x433e62=0xc8;}else{_0x433e62=0xce;}_0x22b121['status'](_0x433e62);return _0x22b121[_0x2491('0x22')](_0x2491('0x23'),_0x32c661+'-'+_0x1dbc93+'/'+_0xda3b49)[_0x2491('0x1d')](_0x3e507d);}return null;};}function patchUpdates(_0x507121){return function(_0x129c39){try{jsonpatch[_0x2491('0x24')](_0x129c39,_0x507121,!![]);}catch(_0x4a6ede){return BPromise[_0x2491('0x25')](_0x4a6ede);}return _0x129c39[_0x2491('0x26')]();};}function saveUpdates(_0x54b6b2,_0x388785){return function(_0x4d8914){if(_0x4d8914){return _0x4d8914[_0x2491('0x27')](_0x54b6b2)['then'](function(_0x3f20df){return _0x3f20df;});}return null;};}function removeEntity(_0x5523e4,_0x54804d){return function(_0x3cd79e){if(_0x3cd79e){return _0x3cd79e[_0x2491('0x28')]()[_0x2491('0x29')](function(){_0x5523e4[_0x2491('0x1b')](0xcc)[_0x2491('0x1c')]();});}};}function handleEntityNotFound(_0x226429,_0x21b82f){return function(_0x1c405f){if(!_0x1c405f){_0x226429[_0x2491('0x1a')](0x194);}return _0x1c405f;};}function handleError(_0x595495,_0x2fdd3a){_0x2fdd3a=_0x2fdd3a||0x1f4;return function(_0x3f24ea){logger[_0x2491('0x2a')](_0x3f24ea[_0x2491('0x2b')]);if(_0x3f24ea[_0x2491('0x2c')]){delete _0x3f24ea[_0x2491('0x2c')];}_0x595495[_0x2491('0x1b')](_0x2fdd3a)[_0x2491('0x2d')](_0x3f24ea);};}exports['index']=function(_0x206b7e,_0x58d2cd){var _0x1d5356={},_0x36d245={},_0x51b054={'count':0x0,'rows':[]};var _0x889ab6=_[_0x2491('0x2e')](db['FaxApplication'][_0x2491('0x2f')],function(_0x50f51c){return{'name':_0x50f51c[_0x2491('0x30')],'type':_0x50f51c['type'][_0x2491('0x31')]};});_0x36d245[_0x2491('0x32')]=_[_0x2491('0x2e')](_0x889ab6,'name');_0x36d245['query']=_['keys'](_0x206b7e[_0x2491('0x33')]);_0x36d245[_0x2491('0x34')]=_[_0x2491('0x35')](_0x36d245[_0x2491('0x32')],_0x36d245[_0x2491('0x33')]);_0x1d5356['attributes']=_[_0x2491('0x35')](_0x36d245[_0x2491('0x32')],qs[_0x2491('0x36')](_0x206b7e['query'][_0x2491('0x36')]));_0x1d5356['attributes']=_0x1d5356[_0x2491('0x37')][_0x2491('0x38')]?_0x1d5356['attributes']:_0x36d245[_0x2491('0x32')];if(!_0x206b7e[_0x2491('0x33')][_0x2491('0x39')](_0x2491('0x3a'))){_0x1d5356[_0x2491('0x1e')]=qs['limit'](_0x206b7e['query'][_0x2491('0x1e')]);_0x1d5356[_0x2491('0x21')]=qs[_0x2491('0x21')](_0x206b7e[_0x2491('0x33')][_0x2491('0x21')]);}_0x1d5356[_0x2491('0x3b')]=qs['sort'](_0x206b7e[_0x2491('0x33')][_0x2491('0x3c')]);_0x1d5356[_0x2491('0x3d')]=qs[_0x2491('0x34')](_['pick'](_0x206b7e[_0x2491('0x33')],_0x36d245[_0x2491('0x34')]),_0x889ab6);if(_0x206b7e[_0x2491('0x33')][_0x2491('0x3e')]){_0x1d5356['where']=_[_0x2491('0x3f')](_0x1d5356[_0x2491('0x3d')],{'$or':_[_0x2491('0x2e')](_0x889ab6,function(_0x54f517){if(_0x54f517[_0x2491('0x40')]!==_0x2491('0x41')){var _0x581e61={};_0x581e61[_0x54f517[_0x2491('0x2c')]]={'$like':'%'+_0x206b7e['query'][_0x2491('0x3e')]+'%'};return _0x581e61;}})});}_0x1d5356=_[_0x2491('0x3f')]({},_0x1d5356,_0x206b7e[_0x2491('0x42')]);var _0x319f6c={'where':_0x1d5356[_0x2491('0x3d')]};return db[_0x2491('0x43')][_0x2491('0x20')](_0x319f6c)[_0x2491('0x29')](function(_0x40fb48){_0x51b054[_0x2491('0x20')]=_0x40fb48;if(_0x206b7e['query'][_0x2491('0x44')]){_0x1d5356[_0x2491('0x45')]=[{'all':!![]}];}return db[_0x2491('0x43')][_0x2491('0x46')](_0x1d5356);})[_0x2491('0x29')](function(_0x455349){_0x51b054['rows']=_0x455349;return _0x51b054;})[_0x2491('0x29')](respondWithFilteredResult(_0x58d2cd,_0x1d5356))[_0x2491('0x47')](handleError(_0x58d2cd,null));};exports[_0x2491('0x48')]=function(_0x118521,_0x3fddef){var _0x3db251={'raw':!![],'where':{'id':_0x118521[_0x2491('0x49')]['id']}},_0x339b50={};_0x339b50['model']=_['keys'](db[_0x2491('0x43')][_0x2491('0x2f')]);_0x339b50[_0x2491('0x33')]=_[_0x2491('0x4a')](_0x118521[_0x2491('0x33')]);_0x339b50[_0x2491('0x34')]=_['intersection'](_0x339b50[_0x2491('0x32')],_0x339b50[_0x2491('0x33')]);_0x3db251[_0x2491('0x37')]=_['intersection'](_0x339b50['model'],qs[_0x2491('0x36')](_0x118521[_0x2491('0x33')]['fields']));_0x3db251['attributes']=_0x3db251['attributes'][_0x2491('0x38')]?_0x3db251['attributes']:_0x339b50[_0x2491('0x32')];if(_0x118521[_0x2491('0x33')]['includeAll']){_0x3db251[_0x2491('0x45')]=[{'all':!![]}];}_0x3db251=_[_0x2491('0x3f')]({},_0x3db251,_0x118521[_0x2491('0x42')]);return db[_0x2491('0x43')][_0x2491('0x4b')](_0x3db251)[_0x2491('0x29')](handleEntityNotFound(_0x3fddef,null))[_0x2491('0x29')](respondWithResult(_0x3fddef,null))[_0x2491('0x47')](handleError(_0x3fddef,null));};exports[_0x2491('0x4c')]=function(_0x866698,_0x24223a){return db[_0x2491('0x43')][_0x2491('0x4c')](_0x866698['body'],{})[_0x2491('0x29')](respondWithResult(_0x24223a,0xc9))[_0x2491('0x47')](handleError(_0x24223a,null));};exports['update']=function(_0x559158,_0x1fd238){if(_0x559158[_0x2491('0x4d')]['id']){delete _0x559158[_0x2491('0x4d')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x559158[_0x2491('0x49')]['id']}})[_0x2491('0x29')](handleEntityNotFound(_0x1fd238,null))[_0x2491('0x29')](saveUpdates(_0x559158[_0x2491('0x4d')],null))[_0x2491('0x29')](respondWithResult(_0x1fd238,null))[_0x2491('0x47')](handleError(_0x1fd238,null));};exports['destroy']=function(_0x563848,_0xd65a17){return db['FaxApplication'][_0x2491('0x4b')]({'where':{'id':_0x563848['params']['id']}})['then'](handleEntityNotFound(_0xd65a17,null))[_0x2491('0x29')](removeEntity(_0xd65a17,null))[_0x2491('0x47')](handleError(_0xd65a17,null));}; \ No newline at end of file +var _0x254c=['stack','name','index','FaxApplication','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','options','find','create','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x535e2e,_0x5180ed){var _0x357681=function(_0x19fa9f){while(--_0x19fa9f){_0x535e2e['push'](_0x535e2e['shift']());}};_0x357681(++_0x5180ed);}(_0x254c,0x6b));var _0xc254=function(_0x19e71c,_0x19319b){_0x19e71c=_0x19e71c-0x0;var _0x446a00=_0x254c[_0x19e71c];return _0x446a00;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc254('0x0'));var jsonpatch=require(_0xc254('0x1'));var rp=require(_0xc254('0x2'));var moment=require(_0xc254('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc254('0x4'));var util=require(_0xc254('0x5'));var path=require(_0xc254('0x6'));var sox=require('sox');var csv=require(_0xc254('0x7'));var ejs=require(_0xc254('0x8'));var fs=require('fs');var fs_extra=require(_0xc254('0x9'));var _=require(_0xc254('0xa'));var squel=require('squel');var crypto=require(_0xc254('0xb'));var jsforce=require(_0xc254('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc254('0x7'));var querystring=require(_0xc254('0xd'));var Papa=require(_0xc254('0xe'));var Redis=require('ioredis');var authService=require(_0xc254('0xf'));var qs=require(_0xc254('0x10'));var as=require(_0xc254('0x11'));var hardwareService=require(_0xc254('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc254('0x13'));var config=require(_0xc254('0x14'));var licenseUtil=require(_0xc254('0x15'));var db=require(_0xc254('0x16'))['db'];function respondWithStatusCode(_0xfa90f0,_0x2ee2e2){_0x2ee2e2=_0x2ee2e2||0xcc;return function(_0x21a46b){if(_0x21a46b){return _0xfa90f0['sendStatus'](_0x2ee2e2);}return _0xfa90f0[_0xc254('0x17')](_0x2ee2e2)[_0xc254('0x18')]();};}function respondWithResult(_0x4ffd78,_0x3f9e85){_0x3f9e85=_0x3f9e85||0xc8;return function(_0x533299){if(_0x533299){return _0x4ffd78[_0xc254('0x17')](_0x3f9e85)[_0xc254('0x19')](_0x533299);}};}function respondWithFilteredResult(_0x23cbe8,_0x5704d8){return function(_0x4135c3){if(_0x4135c3){var _0x1dd55d=typeof _0x5704d8[_0xc254('0x1a')]===_0xc254('0x1b')&&typeof _0x5704d8['limit']===_0xc254('0x1b');var _0x563bab=_0x4135c3[_0xc254('0x1c')];var _0x24da48=_0x1dd55d?0x0:_0x5704d8[_0xc254('0x1a')];var _0x554d66=_0x1dd55d?_0x4135c3['count']:_0x5704d8[_0xc254('0x1a')]+_0x5704d8[_0xc254('0x1d')];var _0x3dc055;if(_0x554d66>=_0x563bab){_0x554d66=_0x563bab;_0x3dc055=0xc8;}else{_0x3dc055=0xce;}_0x23cbe8[_0xc254('0x17')](_0x3dc055);return _0x23cbe8['set'](_0xc254('0x1e'),_0x24da48+'-'+_0x554d66+'/'+_0x563bab)[_0xc254('0x19')](_0x4135c3);}return null;};}function patchUpdates(_0x926daa){return function(_0x5eef4a){try{jsonpatch[_0xc254('0x1f')](_0x5eef4a,_0x926daa,!![]);}catch(_0x68163a){return BPromise[_0xc254('0x20')](_0x68163a);}return _0x5eef4a[_0xc254('0x21')]();};}function saveUpdates(_0x167c05,_0x17a9ab){return function(_0x1aab22){if(_0x1aab22){return _0x1aab22[_0xc254('0x22')](_0x167c05)[_0xc254('0x23')](function(_0x20261e){return _0x20261e;});}return null;};}function removeEntity(_0x24c754,_0x40465a){return function(_0x236b9b){if(_0x236b9b){return _0x236b9b[_0xc254('0x24')]()[_0xc254('0x23')](function(){_0x24c754[_0xc254('0x17')](0xcc)[_0xc254('0x18')]();});}};}function handleEntityNotFound(_0x44ae59,_0x4361e5){return function(_0xc242c4){if(!_0xc242c4){_0x44ae59[_0xc254('0x25')](0x194);}return _0xc242c4;};}function handleError(_0x7f52ea,_0x469962){_0x469962=_0x469962||0x1f4;return function(_0x25ba9e){logger[_0xc254('0x26')](_0x25ba9e[_0xc254('0x27')]);if(_0x25ba9e['name']){delete _0x25ba9e[_0xc254('0x28')];}_0x7f52ea[_0xc254('0x17')](_0x469962)['send'](_0x25ba9e);};}exports[_0xc254('0x29')]=function(_0x3d9e69,_0x16f990){var _0x5c54ed={},_0x1f5652={},_0x3f2206={'count':0x0,'rows':[]};var _0x7e8437=_['map'](db[_0xc254('0x2a')]['rawAttributes'],function(_0x1037a0){return{'name':_0x1037a0[_0xc254('0x2b')],'type':_0x1037a0[_0xc254('0x2c')][_0xc254('0x2d')]};});_0x1f5652[_0xc254('0x2e')]=_[_0xc254('0x2f')](_0x7e8437,'name');_0x1f5652[_0xc254('0x30')]=_['keys'](_0x3d9e69['query']);_0x1f5652[_0xc254('0x31')]=_[_0xc254('0x32')](_0x1f5652[_0xc254('0x2e')],_0x1f5652[_0xc254('0x30')]);_0x5c54ed[_0xc254('0x33')]=_[_0xc254('0x32')](_0x1f5652[_0xc254('0x2e')],qs[_0xc254('0x34')](_0x3d9e69[_0xc254('0x30')][_0xc254('0x34')]));_0x5c54ed[_0xc254('0x33')]=_0x5c54ed[_0xc254('0x33')]['length']?_0x5c54ed['attributes']:_0x1f5652[_0xc254('0x2e')];if(!_0x3d9e69[_0xc254('0x30')][_0xc254('0x35')](_0xc254('0x36'))){_0x5c54ed[_0xc254('0x1d')]=qs['limit'](_0x3d9e69[_0xc254('0x30')]['limit']);_0x5c54ed[_0xc254('0x1a')]=qs[_0xc254('0x1a')](_0x3d9e69[_0xc254('0x30')]['offset']);}_0x5c54ed[_0xc254('0x37')]=qs[_0xc254('0x38')](_0x3d9e69['query'][_0xc254('0x38')]);_0x5c54ed['where']=qs[_0xc254('0x31')](_['pick'](_0x3d9e69[_0xc254('0x30')],_0x1f5652['filters']),_0x7e8437);if(_0x3d9e69['query']['filter']){_0x5c54ed[_0xc254('0x39')]=_[_0xc254('0x3a')](_0x5c54ed[_0xc254('0x39')],{'$or':_['map'](_0x7e8437,function(_0x4502e1){if(_0x4502e1[_0xc254('0x2c')]!==_0xc254('0x3b')){var _0x251fb5={};_0x251fb5[_0x4502e1['name']]={'$like':'%'+_0x3d9e69[_0xc254('0x30')]['filter']+'%'};return _0x251fb5;}})});}_0x5c54ed=_['merge']({},_0x5c54ed,_0x3d9e69['options']);var _0x5c991e={'where':_0x5c54ed[_0xc254('0x39')]};return db[_0xc254('0x2a')][_0xc254('0x1c')](_0x5c991e)[_0xc254('0x23')](function(_0x36dd1c){_0x3f2206['count']=_0x36dd1c;if(_0x3d9e69[_0xc254('0x30')][_0xc254('0x3c')]){_0x5c54ed[_0xc254('0x3d')]=[{'all':!![]}];}return db['FaxApplication'][_0xc254('0x3e')](_0x5c54ed);})['then'](function(_0x4355b6){_0x3f2206[_0xc254('0x3f')]=_0x4355b6;return _0x3f2206;})[_0xc254('0x23')](respondWithFilteredResult(_0x16f990,_0x5c54ed))[_0xc254('0x40')](handleError(_0x16f990,null));};exports['show']=function(_0xb44bb3,_0x391754){var _0x5843e4={'raw':!![],'where':{'id':_0xb44bb3[_0xc254('0x41')]['id']}},_0x126548={};_0x126548[_0xc254('0x2e')]=_[_0xc254('0x42')](db['FaxApplication'][_0xc254('0x43')]);_0x126548[_0xc254('0x30')]=_[_0xc254('0x42')](_0xb44bb3[_0xc254('0x30')]);_0x126548[_0xc254('0x31')]=_['intersection'](_0x126548[_0xc254('0x2e')],_0x126548['query']);_0x5843e4[_0xc254('0x33')]=_[_0xc254('0x32')](_0x126548['model'],qs[_0xc254('0x34')](_0xb44bb3[_0xc254('0x30')][_0xc254('0x34')]));_0x5843e4['attributes']=_0x5843e4[_0xc254('0x33')][_0xc254('0x44')]?_0x5843e4[_0xc254('0x33')]:_0x126548[_0xc254('0x2e')];if(_0xb44bb3['query']['includeAll']){_0x5843e4[_0xc254('0x3d')]=[{'all':!![]}];}_0x5843e4=_[_0xc254('0x3a')]({},_0x5843e4,_0xb44bb3[_0xc254('0x45')]);return db[_0xc254('0x2a')][_0xc254('0x46')](_0x5843e4)[_0xc254('0x23')](handleEntityNotFound(_0x391754,null))[_0xc254('0x23')](respondWithResult(_0x391754,null))[_0xc254('0x40')](handleError(_0x391754,null));};exports['create']=function(_0x46856d,_0xede370){return db['FaxApplication'][_0xc254('0x47')](_0x46856d['body'],{})[_0xc254('0x23')](respondWithResult(_0xede370,0xc9))['catch'](handleError(_0xede370,null));};exports['update']=function(_0xbbd152,_0x408e60){if(_0xbbd152[_0xc254('0x48')]['id']){delete _0xbbd152[_0xc254('0x48')]['id'];}return db[_0xc254('0x2a')]['find']({'where':{'id':_0xbbd152[_0xc254('0x41')]['id']}})['then'](handleEntityNotFound(_0x408e60,null))[_0xc254('0x23')](saveUpdates(_0xbbd152[_0xc254('0x48')],null))[_0xc254('0x23')](respondWithResult(_0x408e60,null))[_0xc254('0x40')](handleError(_0x408e60,null));};exports[_0xc254('0x24')]=function(_0x3f9517,_0x1ffe41){return db[_0xc254('0x2a')][_0xc254('0x46')]({'where':{'id':_0x3f9517[_0xc254('0x41')]['id']}})[_0xc254('0x23')](handleEntityNotFound(_0x1ffe41,null))[_0xc254('0x23')](removeEntity(_0x1ffe41,null))[_0xc254('0x40')](handleError(_0x1ffe41,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index b1cd3b8..62c4a7d 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 _0x277b=['path','rimraf','../../config/environment','./faxApplication.attributes','define','fax_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x277b,0x14c));var _0xb277=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x277b[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xb277('0x0'));var util=require(_0xb277('0x1'));var logger=require(_0xb277('0x2'))(_0xb277('0x3'));var moment=require(_0xb277('0x4'));var BPromise=require(_0xb277('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb277('0x6'));var rimraf=require(_0xb277('0x7'));var config=require(_0xb277('0x8'));var attributes=require(_0xb277('0x9'));module['exports']=function(_0x1fd702,_0x95ff2e){return _0x1fd702[_0xb277('0xa')]('FaxApplication',attributes,{'tableName':_0xb277('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb277('0xc')});}; \ No newline at end of file +var _0x71fe=['moment','bluebird','path','rimraf','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2e7eb5,_0x234560){var _0x401a31=function(_0x3710fe){while(--_0x3710fe){_0x2e7eb5['push'](_0x2e7eb5['shift']());}};_0x401a31(++_0x234560);}(_0x71fe,0x98));var _0xe71f=function(_0x4a27a9,_0x3e6a4d){_0x4a27a9=_0x4a27a9-0x0;var _0x58dc91=_0x71fe[_0x4a27a9];return _0x58dc91;};'use strict';var _=require(_0xe71f('0x0'));var util=require(_0xe71f('0x1'));var logger=require(_0xe71f('0x2'))(_0xe71f('0x3'));var moment=require(_0xe71f('0x4'));var BPromise=require(_0xe71f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe71f('0x6'));var rimraf=require(_0xe71f('0x7'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0xe71f('0x8')]=function(_0x1d3172,_0x1b8167){return _0x1d3172[_0xe71f('0x9')]('FaxApplication',attributes,{'tableName':_0xe71f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe71f('0xb'),'collate':_0xe71f('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 7c88ef3..35954a9 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 _0xdd01=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','FaxApplication,\x20%s,\x20%s','message','catch','UpdateFaxApplication','update','options','where','limit','util'];(function(_0x10ccb1,_0x5b1272){var _0x584b22=function(_0x220e75){while(--_0x220e75){_0x10ccb1['push'](_0x10ccb1['shift']());}};_0x584b22(++_0x5b1272);}(_0xdd01,0x137));var _0x1dd0=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xdd01[_0x2aec52];return _0x3b8835;};'use strict';var _=require('lodash');var util=require(_0x1dd0('0x0'));var moment=require(_0x1dd0('0x1'));var BPromise=require(_0x1dd0('0x2'));var rs=require(_0x1dd0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dd0('0x4'))['db'];var utils=require(_0x1dd0('0x5'));var logger=require(_0x1dd0('0x6'))(_0x1dd0('0x7'));var config=require(_0x1dd0('0x8'));var jayson=require(_0x1dd0('0x9'));var client=jayson[_0x1dd0('0xa')][_0x1dd0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2563c4,_0x4b3c05,_0x1a966a){return new BPromise(function(_0x39f093,_0x2c5d72){return client[_0x1dd0('0xc')](_0x2563c4,_0x1a966a)[_0x1dd0('0xd')](function(_0x31cf3f){logger[_0x1dd0('0xe')]('FaxApplication,\x20%s,\x20%s',_0x4b3c05,'request\x20sent');logger[_0x1dd0('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x4b3c05,_0x1dd0('0x10'),JSON['stringify'](_0x31cf3f));if(_0x31cf3f[_0x1dd0('0x11')]){if(_0x31cf3f['error']['code']===0x1f4){logger[_0x1dd0('0x11')](_0x1dd0('0x12'),_0x4b3c05,_0x31cf3f[_0x1dd0('0x11')][_0x1dd0('0x13')]);return _0x2c5d72(_0x31cf3f[_0x1dd0('0x11')]['message']);}logger[_0x1dd0('0x11')]('FaxApplication,\x20%s,\x20%s',_0x4b3c05,_0x31cf3f[_0x1dd0('0x11')][_0x1dd0('0x13')]);return _0x39f093(_0x31cf3f['error']['message']);}else{logger[_0x1dd0('0xe')](_0x1dd0('0x12'),_0x4b3c05,'request\x20sent');_0x39f093(_0x31cf3f['result'][_0x1dd0('0x13')]);}})[_0x1dd0('0x14')](function(_0x34effa){logger['error'](_0x1dd0('0x12'),_0x4b3c05,_0x34effa);_0x2c5d72(_0x34effa);});});}exports[_0x1dd0('0x15')]=function(_0x3af115){var _0x56519d=this;return new Promise(function(_0x4cf173,_0x3e9d65){return db['FaxApplication'][_0x1dd0('0x16')](_0x3af115['body'],{'raw':_0x3af115[_0x1dd0('0x17')]?_0x3af115[_0x1dd0('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3af115[_0x1dd0('0x17')]?_0x3af115[_0x1dd0('0x17')][_0x1dd0('0x18')]||null:null,'attributes':_0x3af115[_0x1dd0('0x17')]?_0x3af115[_0x1dd0('0x17')]['attributes']||null:null,'limit':_0x3af115[_0x1dd0('0x17')]?_0x3af115['options'][_0x1dd0('0x19')]||null:null})[_0x1dd0('0xd')](function(_0x1ab76e){logger[_0x1dd0('0xe')]('UpdateFaxApplication',_0x3af115);logger[_0x1dd0('0xf')](_0x1dd0('0x15'),_0x3af115,JSON['stringify'](_0x1ab76e));_0x4cf173(_0x1ab76e);})['catch'](function(_0x381bd0){logger[_0x1dd0('0x11')](_0x1dd0('0x15'),_0x381bd0[_0x1dd0('0x13')],_0x3af115);_0x3e9d65(_0x56519d[_0x1dd0('0x11')](0x1f4,_0x381bd0[_0x1dd0('0x13')]));});});}; \ No newline at end of file +var _0x03f2=['attributes','limit','UpdateFaxApplication','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','stringify','error','code','message','FaxApplication,\x20%s,\x20%s','result','catch','update','body','options'];(function(_0x51ede4,_0x56feb7){var _0x19f452=function(_0x4f56cc){while(--_0x4f56cc){_0x51ede4['push'](_0x51ede4['shift']());}};_0x19f452(++_0x56feb7);}(_0x03f2,0x154));var _0x203f=function(_0x596155,_0x17ade6){_0x596155=_0x596155-0x0;var _0x49feb2=_0x03f2[_0x596155];return _0x49feb2;};'use strict';var _=require('lodash');var util=require(_0x203f('0x0'));var moment=require('moment');var BPromise=require(_0x203f('0x1'));var rs=require(_0x203f('0x2'));var fs=require('fs');var Redis=require(_0x203f('0x3'));var db=require(_0x203f('0x4'))['db'];var utils=require(_0x203f('0x5'));var logger=require(_0x203f('0x6'))(_0x203f('0x7'));var config=require(_0x203f('0x8'));var jayson=require(_0x203f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x55b759,_0x3cc757,_0x8943a5){return new BPromise(function(_0x145fe0,_0x8decf8){return client[_0x203f('0xa')](_0x55b759,_0x8943a5)[_0x203f('0xb')](function(_0x12aed0){logger[_0x203f('0xc')]('FaxApplication,\x20%s,\x20%s',_0x3cc757,_0x203f('0xd'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x3cc757,_0x203f('0xd'),JSON[_0x203f('0xe')](_0x12aed0));if(_0x12aed0[_0x203f('0xf')]){if(_0x12aed0[_0x203f('0xf')][_0x203f('0x10')]===0x1f4){logger[_0x203f('0xf')]('FaxApplication,\x20%s,\x20%s',_0x3cc757,_0x12aed0[_0x203f('0xf')][_0x203f('0x11')]);return _0x8decf8(_0x12aed0[_0x203f('0xf')][_0x203f('0x11')]);}logger[_0x203f('0xf')](_0x203f('0x12'),_0x3cc757,_0x12aed0[_0x203f('0xf')]['message']);return _0x145fe0(_0x12aed0['error']['message']);}else{logger[_0x203f('0xc')](_0x203f('0x12'),_0x3cc757,_0x203f('0xd'));_0x145fe0(_0x12aed0[_0x203f('0x13')][_0x203f('0x11')]);}})[_0x203f('0x14')](function(_0x5e953b){logger[_0x203f('0xf')](_0x203f('0x12'),_0x3cc757,_0x5e953b);_0x8decf8(_0x5e953b);});});}exports['UpdateFaxApplication']=function(_0x17b272){var _0x2ea0f9=this;return new Promise(function(_0x1b20fd,_0x47dd6b){return db['FaxApplication'][_0x203f('0x15')](_0x17b272[_0x203f('0x16')],{'raw':_0x17b272[_0x203f('0x17')]?_0x17b272[_0x203f('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17b272[_0x203f('0x17')]?_0x17b272[_0x203f('0x17')]['where']||null:null,'attributes':_0x17b272[_0x203f('0x17')]?_0x17b272[_0x203f('0x17')][_0x203f('0x18')]||null:null,'limit':_0x17b272[_0x203f('0x17')]?_0x17b272[_0x203f('0x17')][_0x203f('0x19')]||null:null})[_0x203f('0xb')](function(_0x3d68d9){logger['info'](_0x203f('0x1a'),_0x17b272);logger[_0x203f('0x1b')]('UpdateFaxApplication',_0x17b272,JSON[_0x203f('0xe')](_0x3d68d9));_0x1b20fd(_0x3d68d9);})[_0x203f('0x14')](function(_0x2c8bad){logger[_0x203f('0xf')](_0x203f('0x1a'),_0x2c8bad[_0x203f('0x11')],_0x17b272);_0x47dd6b(_0x2ea0f9[_0x203f('0xf')](0x1f4,_0x2c8bad[_0x203f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index e418fdc..223c063 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd4f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','express'];(function(_0x5d6f28,_0x5b1876){var _0xa996ea=function(_0x5580e0){while(--_0x5580e0){_0x5d6f28['push'](_0x5d6f28['shift']());}};_0xa996ea(++_0x5b1876);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x4e3e10,_0x464b3d){_0x4e3e10=_0x4e3e10-0x0;var _0x20f4a1=_0xdd4f[_0x4e3e10];return _0x20f4a1;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdd4('0x1'));var router=express[_0xfdd4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfdd4('0x3'));var interaction=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var controller=require('./faxApplication.controller');router[_0xfdd4('0x6')]('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0x8')]);router[_0xfdd4('0x6')](_0xfdd4('0x9'),auth['isAuthenticated'](),controller[_0xfdd4('0xa')]);router['post']('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xb')]);router[_0xfdd4('0xc')]('/:id',auth[_0xfdd4('0x7')](),controller['update']);router[_0xfdd4('0xd')](_0xfdd4('0x9'),auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xe')]);module[_0xfdd4('0xf')]=router; \ No newline at end of file +var _0xdd4f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','express'];(function(_0x287b9a,_0x2d1557){var _0x296702=function(_0x538a65){while(--_0x538a65){_0x287b9a['push'](_0x287b9a['shift']());}};_0x296702(++_0x2d1557);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x538fd3,_0x5d8f5b){_0x538fd3=_0x538fd3-0x0;var _0x1a0f97=_0xdd4f[_0x538fd3];return _0x1a0f97;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdd4('0x1'));var router=express[_0xfdd4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfdd4('0x3'));var interaction=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var controller=require('./faxApplication.controller');router[_0xfdd4('0x6')]('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0x8')]);router[_0xfdd4('0x6')](_0xfdd4('0x9'),auth['isAuthenticated'](),controller[_0xfdd4('0xa')]);router['post']('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xb')]);router[_0xfdd4('0xc')]('/:id',auth[_0xfdd4('0x7')](),controller['update']);router[_0xfdd4('0xd')](_0xfdd4('0x9'),auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xe')]);module[_0xfdd4('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 683df93..d285a3b 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 _0x1a37=['STRING','out','ENUM','INTEGER','sequelize','exports','BOOLEAN','DATE'];(function(_0x5800f9,_0x63925){var _0x101515=function(_0x5ba8a7){while(--_0x5ba8a7){_0x5800f9['push'](_0x5800f9['shift']());}};_0x101515(++_0x63925);}(_0x1a37,0xb4));var _0x71a3=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x1a37[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'closed':{'type':Sequelize[_0x71a3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x71a3('0x3')]},'disposition':{'type':Sequelize[_0x71a3('0x4')]},'secondDisposition':{'type':Sequelize[_0x71a3('0x4')]},'thirdDisposition':{'type':Sequelize[_0x71a3('0x4')]},'note':{'type':Sequelize[_0x71a3('0x4')]},'read1stAt':{'type':Sequelize[_0x71a3('0x3')]},'fax':{'type':Sequelize[_0x71a3('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x71a3('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x71a3('0x6')]('in',_0x71a3('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x71a3('0x7')]}}; \ No newline at end of file +var _0x8aad=['ENUM','out','sequelize','exports','DATE','STRING'];(function(_0xfdd3f8,_0x3e9680){var _0x190eed=function(_0x227165){while(--_0x227165){_0xfdd3f8['push'](_0xfdd3f8['shift']());}};_0x190eed(++_0x3e9680);}(_0x8aad,0x146));var _0xd8aa=function(_0x1a666b,_0x3290e3){_0x1a666b=_0x1a666b-0x0;var _0x43c6e8=_0x8aad[_0x1a666b];return _0x43c6e8;};'use strict';var Sequelize=require(_0xd8aa('0x0'));module[_0xd8aa('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd8aa('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd8aa('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd8aa('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xd8aa('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd8aa('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xd8aa('0x4')]('in',_0xd8aa('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 192c6a5..b7fe440 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 _0x6faf=['findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','options','findAll','rows','setTags','spread','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','basename','resolve','log','err','rimraf','moment','bluebird','util','path','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','status','end','json','undefined','limit','offset','count','set','Content-Range','update','then','destroy','sendStatus','stack','name','send','index','map','FaxInteraction','rawAttributes','type','key','getOptions','user','catch','show','keys','query','intersection','attributes','model','fields','length','includeAll','include','merge','create','body','find','params','addMessage','FaxMessage','ids','omit','getMessages'];(function(_0x7176cf,_0x2e4612){var _0x24f754=function(_0x33e969){while(--_0x33e969){_0x7176cf['push'](_0x7176cf['shift']());}};_0x24f754(++_0x2e4612);}(_0x6faf,0x7e));var _0xf6fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6faf[_0xa464c9];return _0x3d73c4;};'use strict';var rimraf=require(_0xf6fa('0x0'));var zipdir=require('zip-dir');var moment=require(_0xf6fa('0x1'));var BPromise=require(_0xf6fa('0x2'));var util=require(_0xf6fa('0x3'));var path=require(_0xf6fa('0x4'));var fs=require('fs');var _=require(_0xf6fa('0x5'));var Redis=require(_0xf6fa('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf6fa('0x7'));var config=require(_0xf6fa('0x8'));var db=require(_0xf6fa('0x9'))['db'];config[_0xf6fa('0xa')]=_[_0xf6fa('0xb')](config[_0xf6fa('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf6fa('0xc'))(new Redis(config[_0xf6fa('0xa')]));require(_0xf6fa('0xd'))[_0xf6fa('0xe')](socket);function respondWithStatusCode(_0x2aae41,_0x33beb0){_0x33beb0=_0x33beb0||0xcc;return function(_0x5372bf){if(_0x5372bf){return _0x2aae41['sendStatus'](_0x33beb0);}return _0x2aae41[_0xf6fa('0xf')](_0x33beb0)[_0xf6fa('0x10')]();};}function respondWithResult(_0x43d0f8,_0x37b1a5){_0x37b1a5=_0x37b1a5||0xc8;return function(_0x5a5c20){if(_0x5a5c20){return _0x43d0f8[_0xf6fa('0xf')](_0x37b1a5)[_0xf6fa('0x11')](_0x5a5c20);}};}function respondWithFilteredResult(_0x331b1e,_0x19ba5f){return function(_0x5227e8){if(_0x5227e8){var _0xed0a48=typeof _0x19ba5f['offset']===_0xf6fa('0x12')&&typeof _0x19ba5f[_0xf6fa('0x13')]===_0xf6fa('0x12');var _0x3b22e7=_0x5227e8['count'];var _0x50c152=_0xed0a48?0x0:_0x19ba5f[_0xf6fa('0x14')];var _0x5ae532=_0xed0a48?_0x5227e8[_0xf6fa('0x15')]:_0x19ba5f[_0xf6fa('0x14')]+_0x19ba5f[_0xf6fa('0x13')];var _0x3ff311;if(_0x5ae532>=_0x3b22e7){_0x5ae532=_0x3b22e7;_0x3ff311=0xc8;}else{_0x3ff311=0xce;}_0x331b1e[_0xf6fa('0xf')](_0x3ff311);return _0x331b1e[_0xf6fa('0x16')](_0xf6fa('0x17'),_0x50c152+'-'+_0x5ae532+'/'+_0x3b22e7)[_0xf6fa('0x11')](_0x5227e8);}return null;};}function saveUpdates(_0x302ddb){return function(_0x1a991d){if(_0x1a991d){return _0x1a991d[_0xf6fa('0x18')](_0x302ddb)[_0xf6fa('0x19')](function(_0x18a66e){return _0x18a66e;});}return null;};}function removeEntity(_0x4dfff6){return function(_0x4cd671){if(_0x4cd671){return _0x4cd671[_0xf6fa('0x1a')]()[_0xf6fa('0x19')](function(){_0x4dfff6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd4b709){return function(_0x1a89e3){if(!_0x1a89e3){_0xd4b709[_0xf6fa('0x1b')](0x194);}return _0x1a89e3;};}function handleError(_0x6d467a,_0x526c84){_0x526c84=_0x526c84||0x1f4;return function(_0x1feb42){logger['error'](_0x1feb42[_0xf6fa('0x1c')]);if(_0x1feb42[_0xf6fa('0x1d')]){delete _0x1feb42['name'];}_0x6d467a[_0xf6fa('0xf')](_0x526c84)[_0xf6fa('0x1e')](_0x1feb42);};}exports[_0xf6fa('0x1f')]=function(_0x1f0104,_0x1e9c04){var _0x393f4f={};var _0xb9e259=_[_0xf6fa('0x20')](db[_0xf6fa('0x21')][_0xf6fa('0x22')],function(_0x5b3079){return{'name':_0x5b3079['fieldName'],'type':_0x5b3079[_0xf6fa('0x23')][_0xf6fa('0x24')]};});_0x393f4f=qs[_0xf6fa('0x25')](_0xb9e259,_0x1f0104);return interaction['findAll']('fax',_0x1f0104['query'],_0x1f0104[_0xf6fa('0x26')],_0x393f4f,_0xb9e259)[_0xf6fa('0x19')](respondWithFilteredResult(_0x1e9c04,_0x393f4f))[_0xf6fa('0x27')](handleError(_0x1e9c04,null));};exports[_0xf6fa('0x28')]=function(_0x3ae162,_0x389a1f){var _0x275f70={'raw':![],'where':{'id':_0x3ae162['params']['id']}},_0x182584={};_0x182584['model']=_[_0xf6fa('0x29')](db[_0xf6fa('0x21')][_0xf6fa('0x22')]);_0x182584[_0xf6fa('0x2a')]=_['keys'](_0x3ae162[_0xf6fa('0x2a')]);_0x182584['filters']=_[_0xf6fa('0x2b')](_0x182584['model'],_0x182584[_0xf6fa('0x2a')]);_0x275f70[_0xf6fa('0x2c')]=_[_0xf6fa('0x2b')](_0x182584[_0xf6fa('0x2d')],qs['fields'](_0x3ae162[_0xf6fa('0x2a')][_0xf6fa('0x2e')]));_0x275f70['attributes']=_0x275f70[_0xf6fa('0x2c')][_0xf6fa('0x2f')]?_0x275f70[_0xf6fa('0x2c')]:_0x182584['model'];if(_0x3ae162['query'][_0xf6fa('0x30')]){_0x275f70[_0xf6fa('0x31')]=[{'all':!![]}];}_0x275f70=_[_0xf6fa('0x32')]({},_0x275f70,_0x3ae162['options']);return db[_0xf6fa('0x21')]['find'](_0x275f70)[_0xf6fa('0x19')](handleEntityNotFound(_0x389a1f,null))[_0xf6fa('0x19')](respondWithResult(_0x389a1f,null))['catch'](handleError(_0x389a1f,null));};exports[_0xf6fa('0x33')]=function(_0x373d5b,_0x23898f){return db[_0xf6fa('0x21')][_0xf6fa('0x33')](_0x373d5b[_0xf6fa('0x34')],{})[_0xf6fa('0x19')](respondWithResult(_0x23898f,0xc9))[_0xf6fa('0x27')](handleError(_0x23898f,null));};exports[_0xf6fa('0x18')]=function(_0x29290d,_0x14fa9f){if(_0x29290d[_0xf6fa('0x34')]['id']){delete _0x29290d[_0xf6fa('0x34')]['id'];}return db[_0xf6fa('0x21')][_0xf6fa('0x35')]({'where':{'id':_0x29290d['params']['id']}})['then'](handleEntityNotFound(_0x14fa9f,null))[_0xf6fa('0x19')](saveUpdates(_0x29290d[_0xf6fa('0x34')],null))['then'](respondWithResult(_0x14fa9f,null))[_0xf6fa('0x27')](handleError(_0x14fa9f,null));};exports[_0xf6fa('0x1a')]=function(_0x57c9c2,_0x186214){return db['FaxInteraction'][_0xf6fa('0x35')]({'where':{'id':_0x57c9c2[_0xf6fa('0x36')]['id']}})[_0xf6fa('0x19')](handleEntityNotFound(_0x186214,null))[_0xf6fa('0x19')](removeEntity(_0x186214,null))[_0xf6fa('0x27')](handleError(_0x186214,null));};exports['describe']=function(_0x2a05ee,_0x46ba51){return db[_0xf6fa('0x21')]['describe']()[_0xf6fa('0x19')](respondWithResult(_0x46ba51,null))['catch'](handleError(_0x46ba51,null));};exports[_0xf6fa('0x37')]=function(_0x353370,_0x3357b1){return db[_0xf6fa('0x38')][_0xf6fa('0x35')]({'where':{'id':_0x353370[_0xf6fa('0x36')]['id']}})[_0xf6fa('0x19')](handleEntityNotFound(_0x3357b1,null))[_0xf6fa('0x19')](function(_0x333391){if(_0x333391){return _0x333391[_0xf6fa('0x37')](_0x353370[_0xf6fa('0x34')][_0xf6fa('0x39')],_[_0xf6fa('0x3a')](_0x353370['body'],[_0xf6fa('0x39'),'id'])||{});}})[_0xf6fa('0x19')](respondWithResult(_0x3357b1,null))['catch'](handleError(_0x3357b1,null));};exports[_0xf6fa('0x3b')]=function(_0x5147e5,_0x55c398){var _0x1536a3={'raw':![],'where':{}};var _0x3b832b={};var _0x54efc8={'count':0x0,'rows':[]};return db[_0xf6fa('0x21')][_0xf6fa('0x3c')]({'where':{'id':_0x5147e5[_0xf6fa('0x36')]['id']}})[_0xf6fa('0x19')](handleEntityNotFound(_0x55c398,null))[_0xf6fa('0x19')](function(_0x3537f3){if(_0x3537f3){_0x3b832b[_0xf6fa('0x2d')]=_[_0xf6fa('0x29')](db[_0xf6fa('0x38')]['rawAttributes']);_0x3b832b[_0xf6fa('0x2a')]=_['keys'](_0x5147e5[_0xf6fa('0x2a')]);_0x3b832b[_0xf6fa('0x3d')]=_['intersection'](_0x3b832b[_0xf6fa('0x2d')],_0x3b832b[_0xf6fa('0x2a')]);_0x1536a3['attributes']=_['intersection'](_0x3b832b['model'],qs['fields'](_0x5147e5[_0xf6fa('0x2a')]['fields']));_0x1536a3[_0xf6fa('0x2c')]=_0x1536a3[_0xf6fa('0x2c')][_0xf6fa('0x2f')]?_0x1536a3[_0xf6fa('0x2c')]:_0x3b832b[_0xf6fa('0x2d')];if(!_0x5147e5[_0xf6fa('0x2a')][_0xf6fa('0x3e')](_0xf6fa('0x3f'))){_0x1536a3['limit']=qs[_0xf6fa('0x13')](_0x5147e5[_0xf6fa('0x2a')]['limit']);_0x1536a3[_0xf6fa('0x14')]=qs['offset'](_0x5147e5[_0xf6fa('0x2a')][_0xf6fa('0x14')]);}_0x1536a3[_0xf6fa('0x40')]=qs[_0xf6fa('0x41')](_0x5147e5[_0xf6fa('0x2a')][_0xf6fa('0x41')]);_0x1536a3[_0xf6fa('0x42')]=qs['filters'](_[_0xf6fa('0x43')](_0x5147e5[_0xf6fa('0x2a')],_0x3b832b['filters']));_0x1536a3['where'][_0xf6fa('0x44')]=_0x3537f3['id'];if(_0x5147e5[_0xf6fa('0x2a')][_0xf6fa('0x45')]){_0x1536a3[_0xf6fa('0x42')]=_[_0xf6fa('0x32')](_0x1536a3['where'],{'$or':_[_0xf6fa('0x20')](_0x1536a3[_0xf6fa('0x2c')],function(_0x109af3){var _0x4c743e={};_0x4c743e[_0x109af3]={'$like':'%'+_0x5147e5['query'][_0xf6fa('0x45')]+'%'};return _0x4c743e;})});}if(_0x5147e5[_0xf6fa('0x2a')]['$gte']){var _0x33a643=_0x5147e5[_0xf6fa('0x2a')]['$gte']['split'](',');var _0x320e27={};_0x320e27[_0x33a643[0x0]]={'$gte':moment(_0x33a643[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1536a3[_0xf6fa('0x42')]=_[_0xf6fa('0x32')](_0x1536a3[_0xf6fa('0x42')],_0x320e27);}_0x1536a3=_['merge']({},_0x1536a3,_0x5147e5[_0xf6fa('0x46')]);return db['FaxMessage']['count']({'where':_0x1536a3[_0xf6fa('0x42')]})[_0xf6fa('0x19')](function(_0x4d20bb){_0x54efc8[_0xf6fa('0x15')]=_0x4d20bb;if(_0x5147e5[_0xf6fa('0x2a')][_0xf6fa('0x30')]){_0x1536a3[_0xf6fa('0x31')]=[{'all':!![]}];}return db[_0xf6fa('0x38')][_0xf6fa('0x47')](_0x1536a3);})[_0xf6fa('0x19')](function(_0x10b6b7){_0x54efc8[_0xf6fa('0x48')]=_0x10b6b7;return _0x54efc8;});}})[_0xf6fa('0x19')](respondWithFilteredResult(_0x55c398,_0x1536a3))[_0xf6fa('0x27')](handleError(_0x55c398,null));};exports['addTags']=function(_0x5b7052,_0x370d36){return db[_0xf6fa('0x21')][_0xf6fa('0x35')]({'where':{'id':_0x5b7052[_0xf6fa('0x36')]['id']}})['then'](handleEntityNotFound(_0x370d36,null))[_0xf6fa('0x19')](function(_0x13d34f){if(_0x13d34f){return _0x13d34f[_0xf6fa('0x49')](_0x5b7052[_0xf6fa('0x34')]['ids'],_[_0xf6fa('0x3a')](_0x5b7052[_0xf6fa('0x34')],['ids','id'])||{})[_0xf6fa('0x4a')](function(){return db['Tag']['findAll']({'attributes':['id',_0xf6fa('0x1d'),'color'],'where':{'id':_0x5b7052['body'][_0xf6fa('0x39')]}});})[_0xf6fa('0x19')](function(_0x268cd3){socket['emit']('faxInteractionTags:save',{'id':Number(_0x5b7052['params']['id']),'tags':_0x268cd3||[]});return{'id':Number(_0x5b7052['params']['id']),'tags':_0x268cd3||[]};});}})[_0xf6fa('0x19')](respondWithResult(_0x370d36,null))['catch'](handleError(_0x370d36,null));};exports[_0xf6fa('0x4b')]=function(_0x517737,_0x46da80){return db['FaxInteraction'][_0xf6fa('0x35')]({'where':{'id':_0x517737[_0xf6fa('0x36')]['id']}})['then'](handleEntityNotFound(_0x46da80,null))[_0xf6fa('0x19')](function(_0x5c502b){if(_0x5c502b){return _0x5c502b[_0xf6fa('0x4b')](_0x517737['query'][_0xf6fa('0x39')]);}})[_0xf6fa('0x19')](respondWithStatusCode(_0x46da80,null))[_0xf6fa('0x27')](handleError(_0x46da80,null));};exports[_0xf6fa('0x4c')]=function(_0x5e225b,_0x38dd93){var _0x4357fc=moment()[_0xf6fa('0x4d')]()['toString']();var _0x34147e=path[_0xf6fa('0x4e')](config['root'],_0xf6fa('0x4f'),_0xf6fa('0x50'),_0xf6fa('0x51'));var _0x3e24b2=path[_0xf6fa('0x4e')](config[_0xf6fa('0x52')],'server',_0xf6fa('0x50'),_0xf6fa('0x53'));var _0x1e06c9=path[_0xf6fa('0x4e')](_0x34147e,_0x4357fc);var _0x540280=util['format'](_0xf6fa('0x54'),_0x5e225b[_0xf6fa('0x36')]['id'],_0x4357fc);var _0xa50e66=path[_0xf6fa('0x4e')](_0x34147e,_0x540280);var _0x21ac5f=[];_0x21ac5f[_0xf6fa('0x55')]({'model':db[_0xf6fa('0x56')],'as':_0xf6fa('0x56'),'raw':!![]});var _0x380534=[{'model':db[_0xf6fa('0x38')],'as':_0xf6fa('0x57'),'attributes':['id',_0xf6fa('0x34'),_0xf6fa('0x58')],'include':_0x21ac5f}];return db['FaxInteraction'][_0xf6fa('0x35')]({'where':{'id':_0x5e225b[_0xf6fa('0x36')]['id']},'include':_0x380534})[_0xf6fa('0x19')](handleEntityNotFound(_0x38dd93,null))[_0xf6fa('0x19')](function(_0x128cbe){if(_0x128cbe&&_0x128cbe[_0xf6fa('0x57')]){var _0x51c838=_0x128cbe['get']({'plain':!![]});fs['mkdirSync'](_0x1e06c9);for(var _0x451898=0x0;_0x451898<_0x51c838[_0xf6fa('0x57')]['length'];_0x451898++){var _0x317510=_0x51c838['Messages'][_0x451898][_0xf6fa('0x56')];if(_0x317510){var _0x471347=path[_0xf6fa('0x4e')](_0x3e24b2,_0x317510['basename']);if(fs['existsSync'](_0x471347)){fs['createReadStream'](_0x471347)['pipe'](fs['createWriteStream'](path[_0xf6fa('0x4e')](_0x1e06c9,_0x317510[_0xf6fa('0x59')])));}}}return BPromise[_0xf6fa('0x5a')]()[_0xf6fa('0x19')](function(){return new BPromise(function(_0x377a82,_0x577576){zipdir(_0x1e06c9,{'saveTo':_0xa50e66},function(_0x5e7062,_0x1b908a){if(_0x5e7062)return _0x577576(_0x5e7062);return _0x377a82(_0x1b908a);});})['then'](function(){return new BPromise(function(_0x14b532,_0x3f30c2){rimraf(_0x1e06c9,function(_0x1e2ba6){if(_0x1e2ba6)_0x3f30c2(_0x1e2ba6);return _0x14b532();});});})[_0xf6fa('0x19')](function(){return _0x38dd93['download'](_0xa50e66,_0x540280,function(_0x223bf2){if(_0x223bf2){console[_0xf6fa('0x5b')](_0xf6fa('0x5c'),_0x223bf2);}else{fs['unlinkSync'](_0xa50e66);}});});});}else{return _0x38dd93[_0xf6fa('0x1b')](0xc8);}})[_0xf6fa('0x27')](handleError(_0x38dd93,null));}; \ No newline at end of file +var _0xbed8=['faxInteractionTags:save','removeTags','download','unix','join','root','tmp','files','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','rimraf','moment','bluebird','util','path','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','error','name','send','FaxInteraction','fieldName','type','key','findAll','fax','query','user','catch','show','rawAttributes','keys','filters','intersection','model','fields','attributes','length','include','merge','options','create','body','params','find','describe','FaxMessage','addMessage','ids','findOne','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','includeAll','rows','addTags','setTags','omit','spread','Tag','color','emit'];(function(_0x1622a0,_0x2b55a9){var _0x2a2308=function(_0x38d05b){while(--_0x38d05b){_0x1622a0['push'](_0x1622a0['shift']());}};_0x2a2308(++_0x2b55a9);}(_0xbed8,0xeb));var _0x8bed=function(_0xbe048b,_0x2f8970){_0xbe048b=_0xbe048b-0x0;var _0x1d9099=_0xbed8[_0xbe048b];return _0x1d9099;};'use strict';var rimraf=require(_0x8bed('0x0'));var zipdir=require('zip-dir');var moment=require(_0x8bed('0x1'));var BPromise=require(_0x8bed('0x2'));var util=require(_0x8bed('0x3'));var path=require(_0x8bed('0x4'));var fs=require('fs');var _=require(_0x8bed('0x5'));var Redis=require(_0x8bed('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0x8bed('0x7'))(_0x8bed('0x8'));var config=require(_0x8bed('0x9'));var db=require(_0x8bed('0xa'))['db'];config['redis']=_[_0x8bed('0xb')](config[_0x8bed('0xc')],{'host':_0x8bed('0xd'),'port':0x18eb});var socket=require(_0x8bed('0xe'))(new Redis(config[_0x8bed('0xc')]));require(_0x8bed('0xf'))[_0x8bed('0x10')](socket);function respondWithStatusCode(_0x2cdb68,_0x21759e){_0x21759e=_0x21759e||0xcc;return function(_0x46b15c){if(_0x46b15c){return _0x2cdb68[_0x8bed('0x11')](_0x21759e);}return _0x2cdb68['status'](_0x21759e)[_0x8bed('0x12')]();};}function respondWithResult(_0x7008dd,_0x3d782e){_0x3d782e=_0x3d782e||0xc8;return function(_0x65093c){if(_0x65093c){return _0x7008dd['status'](_0x3d782e)[_0x8bed('0x13')](_0x65093c);}};}function respondWithFilteredResult(_0x5485e5,_0x55f806){return function(_0x27a2cf){if(_0x27a2cf){var _0x30cb61=typeof _0x55f806[_0x8bed('0x14')]===_0x8bed('0x15')&&typeof _0x55f806[_0x8bed('0x16')]===_0x8bed('0x15');var _0x5da27d=_0x27a2cf[_0x8bed('0x17')];var _0x3a40d3=_0x30cb61?0x0:_0x55f806[_0x8bed('0x14')];var _0x18304c=_0x30cb61?_0x27a2cf[_0x8bed('0x17')]:_0x55f806[_0x8bed('0x14')]+_0x55f806[_0x8bed('0x16')];var _0x4d10ef;if(_0x18304c>=_0x5da27d){_0x18304c=_0x5da27d;_0x4d10ef=0xc8;}else{_0x4d10ef=0xce;}_0x5485e5[_0x8bed('0x18')](_0x4d10ef);return _0x5485e5[_0x8bed('0x19')](_0x8bed('0x1a'),_0x3a40d3+'-'+_0x18304c+'/'+_0x5da27d)[_0x8bed('0x13')](_0x27a2cf);}return null;};}function saveUpdates(_0x48f81a){return function(_0x5079d1){if(_0x5079d1){return _0x5079d1[_0x8bed('0x1b')](_0x48f81a)[_0x8bed('0x1c')](function(_0x211e2a){return _0x211e2a;});}return null;};}function removeEntity(_0x466577){return function(_0x1db101){if(_0x1db101){return _0x1db101[_0x8bed('0x1d')]()['then'](function(){_0x466577['status'](0xcc)[_0x8bed('0x12')]();});}};}function handleEntityNotFound(_0x25dcd0){return function(_0x419e15){if(!_0x419e15){_0x25dcd0[_0x8bed('0x11')](0x194);}return _0x419e15;};}function handleError(_0x5da6ea,_0x5065e0){_0x5065e0=_0x5065e0||0x1f4;return function(_0x268f10){logger[_0x8bed('0x1e')](_0x268f10['stack']);if(_0x268f10[_0x8bed('0x1f')]){delete _0x268f10[_0x8bed('0x1f')];}_0x5da6ea['status'](_0x5065e0)[_0x8bed('0x20')](_0x268f10);};}exports['index']=function(_0x1d7ca7,_0xc6c1c5){var _0x289b6c={};var _0x399c30=_['map'](db[_0x8bed('0x21')]['rawAttributes'],function(_0x2da034){return{'name':_0x2da034[_0x8bed('0x22')],'type':_0x2da034[_0x8bed('0x23')][_0x8bed('0x24')]};});_0x289b6c=qs['getOptions'](_0x399c30,_0x1d7ca7);return interaction[_0x8bed('0x25')](_0x8bed('0x26'),_0x1d7ca7[_0x8bed('0x27')],_0x1d7ca7[_0x8bed('0x28')],_0x289b6c,_0x399c30)['then'](respondWithFilteredResult(_0xc6c1c5,_0x289b6c))[_0x8bed('0x29')](handleError(_0xc6c1c5,null));};exports[_0x8bed('0x2a')]=function(_0x5a7799,_0x2c2893){var _0x3c9572={'raw':![],'where':{'id':_0x5a7799['params']['id']}},_0x3df087={};_0x3df087['model']=_['keys'](db[_0x8bed('0x21')][_0x8bed('0x2b')]);_0x3df087[_0x8bed('0x27')]=_[_0x8bed('0x2c')](_0x5a7799[_0x8bed('0x27')]);_0x3df087[_0x8bed('0x2d')]=_[_0x8bed('0x2e')](_0x3df087['model'],_0x3df087[_0x8bed('0x27')]);_0x3c9572['attributes']=_[_0x8bed('0x2e')](_0x3df087[_0x8bed('0x2f')],qs[_0x8bed('0x30')](_0x5a7799[_0x8bed('0x27')]['fields']));_0x3c9572[_0x8bed('0x31')]=_0x3c9572[_0x8bed('0x31')][_0x8bed('0x32')]?_0x3c9572[_0x8bed('0x31')]:_0x3df087[_0x8bed('0x2f')];if(_0x5a7799[_0x8bed('0x27')]['includeAll']){_0x3c9572[_0x8bed('0x33')]=[{'all':!![]}];}_0x3c9572=_[_0x8bed('0x34')]({},_0x3c9572,_0x5a7799[_0x8bed('0x35')]);return db[_0x8bed('0x21')]['find'](_0x3c9572)[_0x8bed('0x1c')](handleEntityNotFound(_0x2c2893,null))[_0x8bed('0x1c')](respondWithResult(_0x2c2893,null))[_0x8bed('0x29')](handleError(_0x2c2893,null));};exports[_0x8bed('0x36')]=function(_0x28d3b5,_0x5df22f){return db[_0x8bed('0x21')][_0x8bed('0x36')](_0x28d3b5[_0x8bed('0x37')],{})['then'](respondWithResult(_0x5df22f,0xc9))[_0x8bed('0x29')](handleError(_0x5df22f,null));};exports[_0x8bed('0x1b')]=function(_0xcad4a8,_0x39a629){if(_0xcad4a8[_0x8bed('0x37')]['id']){delete _0xcad4a8[_0x8bed('0x37')]['id'];}return db[_0x8bed('0x21')]['find']({'where':{'id':_0xcad4a8[_0x8bed('0x38')]['id']}})['then'](handleEntityNotFound(_0x39a629,null))[_0x8bed('0x1c')](saveUpdates(_0xcad4a8[_0x8bed('0x37')],null))[_0x8bed('0x1c')](respondWithResult(_0x39a629,null))[_0x8bed('0x29')](handleError(_0x39a629,null));};exports[_0x8bed('0x1d')]=function(_0x55193a,_0x57e49b){return db[_0x8bed('0x21')][_0x8bed('0x39')]({'where':{'id':_0x55193a[_0x8bed('0x38')]['id']}})[_0x8bed('0x1c')](handleEntityNotFound(_0x57e49b,null))['then'](removeEntity(_0x57e49b,null))['catch'](handleError(_0x57e49b,null));};exports[_0x8bed('0x3a')]=function(_0x57ab90,_0x3d1c96){return db['FaxInteraction'][_0x8bed('0x3a')]()[_0x8bed('0x1c')](respondWithResult(_0x3d1c96,null))[_0x8bed('0x29')](handleError(_0x3d1c96,null));};exports['addMessage']=function(_0x1781f2,_0x4dc25b){return db[_0x8bed('0x3b')][_0x8bed('0x39')]({'where':{'id':_0x1781f2[_0x8bed('0x38')]['id']}})[_0x8bed('0x1c')](handleEntityNotFound(_0x4dc25b,null))['then'](function(_0x265a29){if(_0x265a29){return _0x265a29[_0x8bed('0x3c')](_0x1781f2[_0x8bed('0x37')]['ids'],_['omit'](_0x1781f2[_0x8bed('0x37')],[_0x8bed('0x3d'),'id'])||{});}})[_0x8bed('0x1c')](respondWithResult(_0x4dc25b,null))[_0x8bed('0x29')](handleError(_0x4dc25b,null));};exports['getMessages']=function(_0x5af32a,_0x5869b9){var _0x38dd8f={'raw':![],'where':{}};var _0xb9a3e3={};var _0x404cc8={'count':0x0,'rows':[]};return db[_0x8bed('0x21')][_0x8bed('0x3e')]({'where':{'id':_0x5af32a[_0x8bed('0x38')]['id']}})[_0x8bed('0x1c')](handleEntityNotFound(_0x5869b9,null))[_0x8bed('0x1c')](function(_0x523da4){if(_0x523da4){_0xb9a3e3['model']=_[_0x8bed('0x2c')](db[_0x8bed('0x3b')][_0x8bed('0x2b')]);_0xb9a3e3[_0x8bed('0x27')]=_[_0x8bed('0x2c')](_0x5af32a[_0x8bed('0x27')]);_0xb9a3e3['filters']=_[_0x8bed('0x2e')](_0xb9a3e3[_0x8bed('0x2f')],_0xb9a3e3['query']);_0x38dd8f['attributes']=_[_0x8bed('0x2e')](_0xb9a3e3[_0x8bed('0x2f')],qs[_0x8bed('0x30')](_0x5af32a[_0x8bed('0x27')][_0x8bed('0x30')]));_0x38dd8f[_0x8bed('0x31')]=_0x38dd8f[_0x8bed('0x31')][_0x8bed('0x32')]?_0x38dd8f[_0x8bed('0x31')]:_0xb9a3e3[_0x8bed('0x2f')];if(!_0x5af32a[_0x8bed('0x27')][_0x8bed('0x3f')](_0x8bed('0x40'))){_0x38dd8f[_0x8bed('0x16')]=qs[_0x8bed('0x16')](_0x5af32a[_0x8bed('0x27')][_0x8bed('0x16')]);_0x38dd8f[_0x8bed('0x14')]=qs['offset'](_0x5af32a[_0x8bed('0x27')][_0x8bed('0x14')]);}_0x38dd8f[_0x8bed('0x41')]=qs[_0x8bed('0x42')](_0x5af32a[_0x8bed('0x27')][_0x8bed('0x42')]);_0x38dd8f[_0x8bed('0x43')]=qs[_0x8bed('0x2d')](_[_0x8bed('0x44')](_0x5af32a[_0x8bed('0x27')],_0xb9a3e3[_0x8bed('0x2d')]));_0x38dd8f['where']['FaxInteractionId']=_0x523da4['id'];if(_0x5af32a[_0x8bed('0x27')][_0x8bed('0x45')]){_0x38dd8f[_0x8bed('0x43')]=_[_0x8bed('0x34')](_0x38dd8f['where'],{'$or':_['map'](_0x38dd8f['attributes'],function(_0x263906){var _0x41834={};_0x41834[_0x263906]={'$like':'%'+_0x5af32a[_0x8bed('0x27')][_0x8bed('0x45')]+'%'};return _0x41834;})});}if(_0x5af32a['query'][_0x8bed('0x46')]){var _0x41efe5=_0x5af32a[_0x8bed('0x27')]['$gte']['split'](',');var _0x453781={};_0x453781[_0x41efe5[0x0]]={'$gte':moment(_0x41efe5[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x38dd8f[_0x8bed('0x43')]=_['merge'](_0x38dd8f[_0x8bed('0x43')],_0x453781);}_0x38dd8f=_['merge']({},_0x38dd8f,_0x5af32a[_0x8bed('0x35')]);return db['FaxMessage']['count']({'where':_0x38dd8f[_0x8bed('0x43')]})[_0x8bed('0x1c')](function(_0x2edb37){_0x404cc8['count']=_0x2edb37;if(_0x5af32a[_0x8bed('0x27')][_0x8bed('0x47')]){_0x38dd8f[_0x8bed('0x33')]=[{'all':!![]}];}return db['FaxMessage'][_0x8bed('0x25')](_0x38dd8f);})['then'](function(_0x4072ca){_0x404cc8[_0x8bed('0x48')]=_0x4072ca;return _0x404cc8;});}})[_0x8bed('0x1c')](respondWithFilteredResult(_0x5869b9,_0x38dd8f))[_0x8bed('0x29')](handleError(_0x5869b9,null));};exports[_0x8bed('0x49')]=function(_0x4af697,_0x273958){return db[_0x8bed('0x21')][_0x8bed('0x39')]({'where':{'id':_0x4af697[_0x8bed('0x38')]['id']}})['then'](handleEntityNotFound(_0x273958,null))['then'](function(_0x1bcd41){if(_0x1bcd41){return _0x1bcd41[_0x8bed('0x4a')](_0x4af697[_0x8bed('0x37')][_0x8bed('0x3d')],_[_0x8bed('0x4b')](_0x4af697[_0x8bed('0x37')],['ids','id'])||{})[_0x8bed('0x4c')](function(){return db[_0x8bed('0x4d')][_0x8bed('0x25')]({'attributes':['id',_0x8bed('0x1f'),_0x8bed('0x4e')],'where':{'id':_0x4af697[_0x8bed('0x37')][_0x8bed('0x3d')]}});})[_0x8bed('0x1c')](function(_0x312deb){socket[_0x8bed('0x4f')](_0x8bed('0x50'),{'id':Number(_0x4af697[_0x8bed('0x38')]['id']),'tags':_0x312deb||[]});return{'id':Number(_0x4af697[_0x8bed('0x38')]['id']),'tags':_0x312deb||[]};});}})[_0x8bed('0x1c')](respondWithResult(_0x273958,null))[_0x8bed('0x29')](handleError(_0x273958,null));};exports[_0x8bed('0x51')]=function(_0x213ae2,_0x396d78){return db[_0x8bed('0x21')]['find']({'where':{'id':_0x213ae2['params']['id']}})[_0x8bed('0x1c')](handleEntityNotFound(_0x396d78,null))[_0x8bed('0x1c')](function(_0x3bf733){if(_0x3bf733){return _0x3bf733[_0x8bed('0x51')](_0x213ae2[_0x8bed('0x27')][_0x8bed('0x3d')]);}})['then'](respondWithStatusCode(_0x396d78,null))['catch'](handleError(_0x396d78,null));};exports[_0x8bed('0x52')]=function(_0x41f11d,_0xc1e58e){var _0x536960=moment()[_0x8bed('0x53')]()['toString']();var _0x374a8d=path[_0x8bed('0x54')](config[_0x8bed('0x55')],'server','files',_0x8bed('0x56'));var _0x1b70eb=path[_0x8bed('0x54')](config[_0x8bed('0x55')],'server',_0x8bed('0x57'),_0x8bed('0x58'));var _0x2b08a8=path['join'](_0x374a8d,_0x536960);var _0xf57cdb=util[_0x8bed('0x59')](_0x8bed('0x5a'),_0x41f11d[_0x8bed('0x38')]['id'],_0x536960);var _0x30d9a1=path[_0x8bed('0x54')](_0x374a8d,_0xf57cdb);var _0x52e38b=[];_0x52e38b[_0x8bed('0x5b')]({'model':db[_0x8bed('0x5c')],'as':_0x8bed('0x5c'),'raw':!![]});var _0x375031=[{'model':db[_0x8bed('0x3b')],'as':_0x8bed('0x5d'),'attributes':['id',_0x8bed('0x37'),_0x8bed('0x5e')],'include':_0x52e38b}];return db['FaxInteraction'][_0x8bed('0x39')]({'where':{'id':_0x41f11d[_0x8bed('0x38')]['id']},'include':_0x375031})[_0x8bed('0x1c')](handleEntityNotFound(_0xc1e58e,null))[_0x8bed('0x1c')](function(_0x31a341){if(_0x31a341&&_0x31a341[_0x8bed('0x5d')]){var _0x542070=_0x31a341[_0x8bed('0x5f')]({'plain':!![]});fs['mkdirSync'](_0x2b08a8);for(var _0x1d926f=0x0;_0x1d926f<_0x542070[_0x8bed('0x5d')][_0x8bed('0x32')];_0x1d926f++){var _0x4a6e48=_0x542070['Messages'][_0x1d926f][_0x8bed('0x5c')];if(_0x4a6e48){var _0x350d76=path[_0x8bed('0x54')](_0x1b70eb,_0x4a6e48[_0x8bed('0x60')]);if(fs[_0x8bed('0x61')](_0x350d76)){fs[_0x8bed('0x62')](_0x350d76)[_0x8bed('0x63')](fs[_0x8bed('0x64')](path[_0x8bed('0x54')](_0x2b08a8,_0x4a6e48['basename'])));}}}return BPromise[_0x8bed('0x65')]()['then'](function(){return new BPromise(function(_0x4c4742,_0x30aba1){zipdir(_0x2b08a8,{'saveTo':_0x30d9a1},function(_0x5af1d5,_0x4a3374){if(_0x5af1d5)return _0x30aba1(_0x5af1d5);return _0x4c4742(_0x4a3374);});})['then'](function(){return new BPromise(function(_0x58eeb4,_0x5c8cd7){rimraf(_0x2b08a8,function(_0x55dccc){if(_0x55dccc)_0x5c8cd7(_0x55dccc);return _0x58eeb4();});});})[_0x8bed('0x1c')](function(){return _0xc1e58e[_0x8bed('0x52')](_0x30d9a1,_0xf57cdb,function(_0x54ebaf){if(_0x54ebaf){console[_0x8bed('0x66')](_0x8bed('0x67'),_0x54ebaf);}else{fs[_0x8bed('0x68')](_0x30d9a1);}});});});}else{return _0xc1e58e['sendStatus'](0xc8);}})[_0x8bed('0x29')](handleError(_0xc1e58e,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index acca270..1a614b5 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 _0xaf8d=['hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','update','then','setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty'];(function(_0x4bb7ca,_0x31ce9e){var _0xb3b203=function(_0x524b04){while(--_0x524b04){_0x4bb7ca['push'](_0x4bb7ca['shift']());}};_0xb3b203(++_0x31ce9e);}(_0xaf8d,0x1f1));var _0xdaf8=function(_0xcd363e,_0x33a5f7){_0xcd363e=_0xcd363e-0x0;var _0x4f4f25=_0xaf8d[_0xcd363e];return _0x4f4f25;};'use strict';var EventEmitter=require(_0xdaf8('0x0'));var FaxInteraction=require(_0xdaf8('0x1'))['db'][_0xdaf8('0x2')];var FaxMessage=require(_0xdaf8('0x1'))['db'][_0xdaf8('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xdaf8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x175d26){return function(_0x405672,_0x79a498,_0x1378f4){_0x405672['getUsers']({'attributes':['id'],'raw':!![]})[_0xdaf8('0x5')](function(_0x208d10){_0x405672[_0xdaf8('0x6')](_0xdaf8('0x7'),_0x208d10[_0xdaf8('0x8')](function(_0x5377ae){return{'id':_0x5377ae['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x405672['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x277892){_0x405672[_0xdaf8('0x6')](_0xdaf8('0x9'),_0x277892[_0xdaf8('0xa')]);FaxInteractionEvents[_0xdaf8('0xb')](_0x175d26+':'+_0x405672['id'],_0x405672);FaxInteractionEvents[_0xdaf8('0xb')](_0x175d26,_0x405672);_0x1378f4(null);})['catch'](_0x1378f4(null));};}for(var e in events){if(events[_0xdaf8('0xc')](e)){var event=events[e];FaxInteraction[_0xdaf8('0xd')](e,emitEvent(event));}}module[_0xdaf8('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0x400a=['length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','remove','then','setDataValue','Users','unreadMessages'];(function(_0xb440b2,_0x3e89c2){var _0x33dfe3=function(_0x4fd633){while(--_0x4fd633){_0xb440b2['push'](_0xb440b2['shift']());}};_0x33dfe3(++_0x3e89c2);}(_0x400a,0x122));var _0xa400=function(_0x4b8444,_0x3e420c){_0x4b8444=_0x4b8444-0x0;var _0x360749=_0x400a[_0x4b8444];return _0x360749;};'use strict';var EventEmitter=require(_0xa400('0x0'));var FaxInteraction=require(_0xa400('0x1'))['db'][_0xa400('0x2')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xa400('0x3')](0x0);var events={'afterCreate':_0xa400('0x4'),'afterUpdate':'update','afterDestroy':_0xa400('0x5')};function emitEvent(_0x326137){return function(_0x1b3ed3,_0x5f34bd,_0x2087c6){_0x1b3ed3['getUsers']({'attributes':['id'],'raw':!![]})[_0xa400('0x6')](function(_0x4e32d1){_0x1b3ed3[_0xa400('0x7')](_0xa400('0x8'),_0x4e32d1['map'](function(_0x443005){return{'id':_0x443005['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x1b3ed3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5ea203){_0x1b3ed3['setDataValue'](_0xa400('0x9'),_0x5ea203[_0xa400('0xa')]);FaxInteractionEvents[_0xa400('0xb')](_0x326137+':'+_0x1b3ed3['id'],_0x1b3ed3);FaxInteractionEvents[_0xa400('0xb')](_0x326137,_0x1b3ed3);_0x2087c6(null);})[_0xa400('0xc')](_0x2087c6(null));};}for(var e in events){if(events[_0xa400('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xa400('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 3896c96..f5b5b5c 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 _0xcaf1=['closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed'];(function(_0x3a8db5,_0x31cff7){var _0x2c03cd=function(_0x47dba0){while(--_0x47dba0){_0x3a8db5['push'](_0x3a8db5['shift']());}};_0x2c03cd(++_0x31cff7);}(_0xcaf1,0x82));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1caf('0x0'));var logger=require(_0x1caf('0x1'))(_0x1caf('0x2'));var moment=require(_0x1caf('0x3'));var BPromise=require(_0x1caf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1caf('0x5'));var config=require(_0x1caf('0x6'));var attributes=require(_0x1caf('0x7'));module[_0x1caf('0x8')]=function(_0xc3dbee,_0x1684e1){return _0xc3dbee[_0x1caf('0x9')](_0x1caf('0xa'),attributes,{'tableName':_0x1caf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f7728,_0x1c58f9,_0x59deee){if(_0x4f7728[_0x1caf('0xc')](_0x1caf('0xd'))){_0x4f7728[_0x1caf('0xe')]=moment()['format'](_0x1caf('0xf'));}_0x59deee(null,_0x4f7728);}}});}; \ No newline at end of file +var _0xc00b=['FaxInteraction','fax_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc00b,0x1e5));var _0xbc00=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0xc00b[_0x55d8c5];return _0x225ae5;};'use strict';var _=require(_0xbc00('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbc00('0x1'));var BPromise=require('bluebird');var rp=require(_0xbc00('0x2'));var fs=require('fs');var path=require(_0xbc00('0x3'));var rimraf=require(_0xbc00('0x4'));var config=require(_0xbc00('0x5'));var attributes=require('./faxInteraction.attributes');module[_0xbc00('0x6')]=function(_0x5b47bf,_0x1cc85f){return _0x5b47bf['define'](_0xbc00('0x7'),attributes,{'tableName':_0xbc00('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x284270,_0x221909,_0x337870){if(_0x284270[_0xbc00('0x9')]('closed')){_0x284270[_0xbc00('0xa')]=moment()['format'](_0xbc00('0xb'));}_0x337870(null,_0x284270);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index ce7a97d..129a3c4 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 _0x6913=['stringify','error','code','message','result','UpdateFaxInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToFaxInteraction','FaxInteraction','find','ids','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x2a97fa,_0x1eef81){var _0x5e3dc3=function(_0x1542e6){while(--_0x1542e6){_0x2a97fa['push'](_0x2a97fa['shift']());}};_0x5e3dc3(++_0x1eef81);}(_0x6913,0x115));var _0x3691=function(_0x3851ca,_0x5d276b){_0x3851ca=_0x3851ca-0x0;var _0x381f36=_0x6913[_0x3851ca];return _0x381f36;};'use strict';var _=require(_0x3691('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3691('0x1'));var rs=require(_0x3691('0x2'));var fs=require('fs');var Redis=require(_0x3691('0x3'));var db=require(_0x3691('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3691('0x5'))(_0x3691('0x6'));var config=require(_0x3691('0x7'));var jayson=require(_0x3691('0x8'));var client=jayson[_0x3691('0x9')][_0x3691('0xa')]({'port':0x232a});config['redis']=_[_0x3691('0xb')](config[_0x3691('0xc')],{'host':_0x3691('0xd'),'port':0x18eb});var socket=require(_0x3691('0xe'))(new Redis(config['redis']));require(_0x3691('0xf'))[_0x3691('0x10')](socket);function respondWithRpcPromise(_0x82e06f,_0x4df9a4,_0x422e14){return new BPromise(function(_0x16b610,_0x51301d){return client[_0x3691('0x11')](_0x82e06f,_0x422e14)[_0x3691('0x12')](function(_0x1a588f){logger[_0x3691('0x13')](_0x3691('0x14'),_0x4df9a4,_0x3691('0x15'));logger[_0x3691('0x16')](_0x3691('0x17'),_0x4df9a4,_0x3691('0x15'),JSON[_0x3691('0x18')](_0x1a588f));if(_0x1a588f['error']){if(_0x1a588f[_0x3691('0x19')][_0x3691('0x1a')]===0x1f4){logger[_0x3691('0x19')](_0x3691('0x14'),_0x4df9a4,_0x1a588f[_0x3691('0x19')][_0x3691('0x1b')]);return _0x51301d(_0x1a588f[_0x3691('0x19')][_0x3691('0x1b')]);}logger[_0x3691('0x19')](_0x3691('0x14'),_0x4df9a4,_0x1a588f[_0x3691('0x19')][_0x3691('0x1b')]);return _0x16b610(_0x1a588f['error'][_0x3691('0x1b')]);}else{logger['info'](_0x3691('0x14'),_0x4df9a4,'request\x20sent');_0x16b610(_0x1a588f[_0x3691('0x1c')][_0x3691('0x1b')]);}})['catch'](function(_0x499ed7){logger[_0x3691('0x19')](_0x3691('0x14'),_0x4df9a4,_0x499ed7);_0x51301d(_0x499ed7);});});}exports[_0x3691('0x1d')]=function(_0x42caa7){var _0x521546=this;return new Promise(function(_0x456835,_0x3dacbc){return db['FaxInteraction']['update'](_0x42caa7[_0x3691('0x1e')],{'raw':_0x42caa7[_0x3691('0x1f')]?_0x42caa7[_0x3691('0x1f')][_0x3691('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42caa7[_0x3691('0x1f')]?_0x42caa7[_0x3691('0x1f')][_0x3691('0x21')]||null:null,'attributes':_0x42caa7['options']?_0x42caa7[_0x3691('0x1f')][_0x3691('0x22')]||null:null,'limit':_0x42caa7[_0x3691('0x1f')]?_0x42caa7['options'][_0x3691('0x23')]||null:null})['then'](function(_0x43151f){logger['info'](_0x3691('0x1d'),_0x42caa7);logger[_0x3691('0x16')](_0x3691('0x1d'),_0x42caa7,JSON[_0x3691('0x18')](_0x43151f));_0x456835(_0x43151f);})[_0x3691('0x24')](function(_0x300301){logger[_0x3691('0x19')](_0x3691('0x1d'),_0x300301[_0x3691('0x1b')],_0x42caa7);_0x3dacbc(_0x521546[_0x3691('0x19')](0x1f4,_0x300301[_0x3691('0x1b')]));});});};exports[_0x3691('0x25')]=function(_0x48a633){return new Promise(function(_0x285b87,_0x4bbab8){return db[_0x3691('0x26')][_0x3691('0x27')]({'where':_0x48a633['options']?_0x48a633[_0x3691('0x1f')][_0x3691('0x21')]||null:null})[_0x3691('0x12')](function(_0x5cfae7){if(_0x5cfae7){return _0x5cfae7['addTags'](_0x48a633[_0x3691('0x1e')][_0x3691('0x28')],_['omit'](_0x48a633[_0x3691('0x1e')],[_0x3691('0x28'),'id'])||{});}})[_0x3691('0x29')](function(_0x45f642){logger['info'](_0x3691('0x2a'),_0x48a633);logger[_0x3691('0x16')](_0x3691('0x2a'),_0x48a633,JSON[_0x3691('0x18')](_0x45f642));_0x285b87(_0x45f642);})[_0x3691('0x24')](function(_0x253ad1){logger[_0x3691('0x19')](_0x3691('0x2a'),_0x253ad1[_0x3691('0x1b')],_0x48a633);_0x4bbab8(_this[_0x3691('0x19')](0x1f4,_0x253ad1[_0x3691('0x1b')]));});});}; \ No newline at end of file +var _0xce96=['register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','message','catch','update','body','options','raw','where','attributes','UpdateFaxInteraction','debug','FaxInteraction','addTags','ids','spread','AddTags','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket'];(function(_0x278000,_0x383fca){var _0x198f37=function(_0x54ac41){while(--_0x54ac41){_0x278000['push'](_0x278000['shift']());}};_0x198f37(++_0x383fca);}(_0xce96,0x19d));var _0x6ce9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xce96[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x6ce9('0x0'));var util=require(_0x6ce9('0x1'));var moment=require('moment');var BPromise=require(_0x6ce9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ce9('0x3'));var db=require(_0x6ce9('0x4'))['db'];var utils=require(_0x6ce9('0x5'));var logger=require(_0x6ce9('0x6'))('rpc');var config=require(_0x6ce9('0x7'));var jayson=require(_0x6ce9('0x8'));var client=jayson[_0x6ce9('0x9')][_0x6ce9('0xa')]({'port':0x232a});config['redis']=_[_0x6ce9('0xb')](config[_0x6ce9('0xc')],{'host':_0x6ce9('0xd'),'port':0x18eb});var socket=require(_0x6ce9('0xe'))(new Redis(config[_0x6ce9('0xc')]));require(_0x6ce9('0xf'))[_0x6ce9('0x10')](socket);function respondWithRpcPromise(_0x259993,_0x3d214a,_0x5a11f4){return new BPromise(function(_0x27e00d,_0x1cc8c0){return client['request'](_0x259993,_0x5a11f4)[_0x6ce9('0x11')](function(_0x283384){logger[_0x6ce9('0x12')](_0x6ce9('0x13'),_0x3d214a,_0x6ce9('0x14'));logger['debug'](_0x6ce9('0x15'),_0x3d214a,_0x6ce9('0x14'),JSON['stringify'](_0x283384));if(_0x283384[_0x6ce9('0x16')]){if(_0x283384[_0x6ce9('0x16')]['code']===0x1f4){logger[_0x6ce9('0x16')](_0x6ce9('0x13'),_0x3d214a,_0x283384[_0x6ce9('0x16')]['message']);return _0x1cc8c0(_0x283384['error']['message']);}logger[_0x6ce9('0x16')](_0x6ce9('0x13'),_0x3d214a,_0x283384['error'][_0x6ce9('0x17')]);return _0x27e00d(_0x283384[_0x6ce9('0x16')][_0x6ce9('0x17')]);}else{logger[_0x6ce9('0x12')](_0x6ce9('0x13'),_0x3d214a,_0x6ce9('0x14'));_0x27e00d(_0x283384['result']['message']);}})[_0x6ce9('0x18')](function(_0x24664a){logger[_0x6ce9('0x16')](_0x6ce9('0x13'),_0x3d214a,_0x24664a);_0x1cc8c0(_0x24664a);});});}exports['UpdateFaxInteraction']=function(_0x931704){var _0x5a94d8=this;return new Promise(function(_0x54c943,_0x1d4714){return db['FaxInteraction'][_0x6ce9('0x19')](_0x931704[_0x6ce9('0x1a')],{'raw':_0x931704[_0x6ce9('0x1b')]?_0x931704['options'][_0x6ce9('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x931704['options']?_0x931704['options'][_0x6ce9('0x1d')]||null:null,'attributes':_0x931704[_0x6ce9('0x1b')]?_0x931704[_0x6ce9('0x1b')][_0x6ce9('0x1e')]||null:null,'limit':_0x931704[_0x6ce9('0x1b')]?_0x931704[_0x6ce9('0x1b')]['limit']||null:null})[_0x6ce9('0x11')](function(_0xdb5fd2){logger[_0x6ce9('0x12')](_0x6ce9('0x1f'),_0x931704);logger[_0x6ce9('0x20')](_0x6ce9('0x1f'),_0x931704,JSON['stringify'](_0xdb5fd2));_0x54c943(_0xdb5fd2);})[_0x6ce9('0x18')](function(_0x4ce10e){logger[_0x6ce9('0x16')]('UpdateFaxInteraction',_0x4ce10e[_0x6ce9('0x17')],_0x931704);_0x1d4714(_0x5a94d8[_0x6ce9('0x16')](0x1f4,_0x4ce10e[_0x6ce9('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x59a5da){return new Promise(function(_0x2f2042,_0x525457){return db[_0x6ce9('0x21')]['find']({'where':_0x59a5da[_0x6ce9('0x1b')]?_0x59a5da[_0x6ce9('0x1b')][_0x6ce9('0x1d')]||null:null})[_0x6ce9('0x11')](function(_0x44e3e0){if(_0x44e3e0){return _0x44e3e0[_0x6ce9('0x22')](_0x59a5da[_0x6ce9('0x1a')][_0x6ce9('0x23')],_['omit'](_0x59a5da[_0x6ce9('0x1a')],['ids','id'])||{});}})[_0x6ce9('0x24')](function(_0x2b96d2){logger[_0x6ce9('0x12')](_0x6ce9('0x25'),_0x59a5da);logger[_0x6ce9('0x20')](_0x6ce9('0x25'),_0x59a5da,JSON[_0x6ce9('0x26')](_0x2b96d2));_0x2f2042(_0x2b96d2);})[_0x6ce9('0x18')](function(_0x4ff855){logger[_0x6ce9('0x16')](_0x6ce9('0x25'),_0x4ff855[_0x6ce9('0x17')],_0x59a5da);_0x525457(_this['error'](0x1f4,_0x4ff855[_0x6ce9('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 3317249..d3079ac 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 _0xc653=['length','faxInteraction:','save','remove','update','emit','removeListener','register'];(function(_0xda6d69,_0x541077){var _0x46c35a=function(_0x31e08c){while(--_0x31e08c){_0xda6d69['push'](_0xda6d69['shift']());}};_0x46c35a(++_0x541077);}(_0xc653,0x122));var _0x3c65=function(_0x3b0491,_0x23f524){_0x3b0491=_0x3b0491-0x0;var _0x3ee467=_0xc653[_0x3b0491];return _0x3ee467;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x3c65('0x0'),_0x3c65('0x1'),_0x3c65('0x2')];function createListener(_0x156606,_0x58fb8d){return function(_0x145994){_0x58fb8d[_0x3c65('0x3')](_0x156606,_0x145994);};}function removeListener(_0x89b45b,_0x3f9bac){return function(){FaxInteractionEvents[_0x3c65('0x4')](_0x89b45b,_0x3f9bac);};}exports[_0x3c65('0x5')]=function(_0x2817b2){for(var _0x98850b=0x0,_0x169b6b=events[_0x3c65('0x6')];_0x98850b<_0x169b6b;_0x98850b++){var _0x58c713=events[_0x98850b];var _0x5c586b=createListener(_0x3c65('0x7')+_0x58c713,_0x2817b2);FaxInteractionEvents['on'](_0x58c713,_0x5c586b);}}; \ No newline at end of file +var _0x4a3f=['length','faxInteraction:','./faxInteraction.events','remove','update','removeListener','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4a3f,0x64));var _0xf4a3=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x4a3f[_0x4914e2];return _0x2dcd07;};'use strict';var FaxInteractionEvents=require(_0xf4a3('0x0'));var events=['save',_0xf4a3('0x1'),_0xf4a3('0x2')];function createListener(_0x2b9436,_0x17fac4){return function(_0x332a41){_0x17fac4['emit'](_0x2b9436,_0x332a41);};}function removeListener(_0xccc2ba,_0x262bd5){return function(){FaxInteractionEvents[_0xf4a3('0x3')](_0xccc2ba,_0x262bd5);};}exports[_0xf4a3('0x4')]=function(_0x29439d){for(var _0x4c7070=0x0,_0x550aa3=events[_0xf4a3('0x5')];_0x4c7070<_0x550aa3;_0x4c7070++){var _0x4e2123=events[_0x4c7070];var _0x5790da=createListener(_0xf4a3('0x6')+_0x4e2123,_0x29439d);FaxInteractionEvents['on'](_0x4e2123,_0x5790da);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 265ed76..aa58bd3 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 _0xe497=['create','post','/:id/messages','/:id/tags','tracked','addTags','faxinteraction:update','delete','fax','faxinteraction:destroy','removeTags','exports','path','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/download'];(function(_0x1b56c4,_0xa25322){var _0x75308d=function(_0x72b72a){while(--_0x72b72a){_0x1b56c4['push'](_0x1b56c4['shift']());}};_0x75308d(++_0xa25322);}(_0xe497,0xfe));var _0x7e49=function(_0x5b9424,_0x5a1ac4){_0x5b9424=_0x5b9424-0x0;var _0xee1dd4=_0xe497[_0x5b9424];return _0xee1dd4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7e49('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7e49('0x1'));var interaction=require(_0x7e49('0x2'));var config=require('../../config/environment');var controller=require(_0x7e49('0x3'));router[_0x7e49('0x4')]('/',auth[_0x7e49('0x5')](),controller[_0x7e49('0x6')]);router['get'](_0x7e49('0x7'),auth[_0x7e49('0x5')](),controller['describe']);router[_0x7e49('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x7e49('0x8')]);router['get']('/:id/messages',auth[_0x7e49('0x5')](),controller['getMessages']);router[_0x7e49('0x4')](_0x7e49('0x9'),auth[_0x7e49('0x5')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x7e49('0xa')]);router[_0x7e49('0xb')](_0x7e49('0xc'),auth[_0x7e49('0x5')](),controller['addMessage']);router[_0x7e49('0xb')](_0x7e49('0xd'),auth[_0x7e49('0x5')](),interaction[_0x7e49('0xe')]('fax','faxinteraction:addtags'),controller[_0x7e49('0xf')]);router['put']('/:id',auth[_0x7e49('0x5')](),interaction[_0x7e49('0xe')]('fax',_0x7e49('0x10')),controller['update']);router[_0x7e49('0x11')]('/:id',auth[_0x7e49('0x5')](),interaction[_0x7e49('0xe')](_0x7e49('0x12'),_0x7e49('0x13')),controller['destroy']);router[_0x7e49('0x11')](_0x7e49('0xd'),auth[_0x7e49('0x5')](),controller[_0x7e49('0x14')]);module[_0x7e49('0x15')]=router; \ No newline at end of file +var _0xacf6=['/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','addTags','update','delete','/:id','faxinteraction:destroy','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/messages','getMessages'];(function(_0x4eb3e7,_0x208810){var _0x383384=function(_0x246e52){while(--_0x246e52){_0x4eb3e7['push'](_0x4eb3e7['shift']());}};_0x383384(++_0x208810);}(_0xacf6,0xbc));var _0x6acf=function(_0x45e532,_0x21108f){_0x45e532=_0x45e532-0x0;var _0x45e5d2=_0xacf6[_0x45e532];return _0x45e5d2;};'use strict';var multer=require(_0x6acf('0x0'));var util=require('util');var path=require(_0x6acf('0x1'));var timeout=require(_0x6acf('0x2'));var express=require(_0x6acf('0x3'));var router=express[_0x6acf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6acf('0x5'));var interaction=require(_0x6acf('0x6'));var config=require(_0x6acf('0x7'));var controller=require('./faxInteraction.controller');router[_0x6acf('0x8')]('/',auth[_0x6acf('0x9')](),controller[_0x6acf('0xa')]);router[_0x6acf('0x8')](_0x6acf('0xb'),auth[_0x6acf('0x9')](),controller[_0x6acf('0xc')]);router[_0x6acf('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6acf('0x8')](_0x6acf('0xd'),auth['isAuthenticated'](),controller[_0x6acf('0xe')]);router['get'](_0x6acf('0xf'),auth[_0x6acf('0x9')](),controller[_0x6acf('0x10')]);router[_0x6acf('0x11')]('/',auth['isAuthenticated'](),controller[_0x6acf('0x12')]);router[_0x6acf('0x11')](_0x6acf('0xd'),auth[_0x6acf('0x9')](),controller[_0x6acf('0x13')]);router[_0x6acf('0x11')](_0x6acf('0x14'),auth[_0x6acf('0x9')](),interaction[_0x6acf('0x15')](_0x6acf('0x16'),'faxinteraction:addtags'),controller[_0x6acf('0x17')]);router['put']('/:id',auth[_0x6acf('0x9')](),interaction[_0x6acf('0x15')](_0x6acf('0x16'),'faxinteraction:update'),controller[_0x6acf('0x18')]);router[_0x6acf('0x19')](_0x6acf('0x1a'),auth[_0x6acf('0x9')](),interaction[_0x6acf('0x15')](_0x6acf('0x16'),_0x6acf('0x1b')),controller[_0x6acf('0x1c')]);router[_0x6acf('0x19')](_0x6acf('0x14'),auth[_0x6acf('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index a1c7fa4..d0026bc 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 _0x1782=['ENUM','out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x14b767,_0x577e84){var _0x22267a=function(_0xa87ebc){while(--_0xa87ebc){_0x14b767['push'](_0x14b767['shift']());}};_0x22267a(++_0x577e84);}(_0x1782,0x13e));var _0x2178=function(_0x196013,_0x4dfcbf){_0x196013=_0x196013-0x0;var _0x151db6=_0x1782[_0x196013];return _0x151db6;};'use strict';var Sequelize=require(_0x2178('0x0'));module['exports']={'body':{'type':Sequelize[_0x2178('0x1')](_0x2178('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2178('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2178('0x4')]('in',_0x2178('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x2178('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x2178('0x6')]}}; \ No newline at end of file +var _0x2209=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x4f3c9b,_0x28e078){var _0x84e58a=function(_0x37bf49){while(--_0x37bf49){_0x4f3c9b['push'](_0x4f3c9b['shift']());}};_0x84e58a(++_0x28e078);}(_0x2209,0x95));var _0x9220=function(_0x32fe7d,_0x9ebdcb){_0x32fe7d=_0x32fe7d-0x0;var _0x3aa43d=_0x2209[_0x32fe7d];return _0x3aa43d;};'use strict';var Sequelize=require(_0x9220('0x0'));module[_0x9220('0x1')]={'body':{'type':Sequelize[_0x9220('0x2')](_0x9220('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9220('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9220('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x9220('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x9220('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 5cdd564..07811c1 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 _0xda62=['files','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','length','find','body','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','User','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server'];(function(_0x3dca00,_0x26156f){var _0x2cf74c=function(_0x65d84){while(--_0x65d84){_0x3dca00['push'](_0x3dca00['shift']());}};_0x2cf74c(++_0x26156f);}(_0xda62,0x90));var _0x2da6=function(_0x455b25,_0x5adb17){_0x455b25=_0x455b25-0x0;var _0x434f68=_0xda62[_0x455b25];return _0x434f68;};'use strict';var emlformat=require(_0x2da6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2da6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2da6('0x2'));var moment=require(_0x2da6('0x3'));var BPromise=require(_0x2da6('0x4'));var Mustache=require(_0x2da6('0x5'));var util=require(_0x2da6('0x6'));var path=require('path');var sox=require(_0x2da6('0x7'));var csv=require(_0x2da6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2da6('0x9'));var squel=require(_0x2da6('0xa'));var crypto=require(_0x2da6('0xb'));var jsforce=require(_0x2da6('0xc'));var deskjs=require(_0x2da6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2da6('0xe'));var Redis=require('ioredis');var authService=require(_0x2da6('0xf'));var qs=require(_0x2da6('0x10'));var as=require(_0x2da6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2da6('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2da6('0x13'));var licenseUtil=require(_0x2da6('0x14'));var db=require('../../mysqldb')['db'];config[_0x2da6('0x15')]=_[_0x2da6('0x16')](config[_0x2da6('0x15')],{'host':_0x2da6('0x17'),'port':0x18eb});var socket=require(_0x2da6('0x18'))(new Redis(config[_0x2da6('0x15')]));require(_0x2da6('0x19'))['register'](socket);var jayson=require(_0x2da6('0x1a'));var client=jayson['client'][_0x2da6('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1bfe25,_0x38380c,_0x2cedde,_0x349a3b){return new BPromise(function(_0xb25b0e,_0x5e7deb){var _0xd3b7f8=_0x349a3b||client;return _0xd3b7f8[_0x2da6('0x1c')](_0x1bfe25,_0x2cedde)[_0x2da6('0x1d')](function(_0x5bdf2f){logger[_0x2da6('0x1e')](_0x2da6('0x1f'),_0x38380c,'request\x20sent');logger[_0x2da6('0x20')](_0x2da6('0x21'),_0x38380c,_0x2da6('0x22'),JSON[_0x2da6('0x23')](_0x5bdf2f));if(_0x5bdf2f['error']){if(_0x5bdf2f['error'][_0x2da6('0x24')]===0x1f4){logger[_0x2da6('0x25')](_0x2da6('0x1f'),_0x38380c,_0x5bdf2f['error'][_0x2da6('0x26')]);return _0x5e7deb(_0x5bdf2f[_0x2da6('0x25')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x38380c,_0x5bdf2f['error']['message']);return _0xb25b0e(_0x5bdf2f['error'][_0x2da6('0x26')]);}else{logger[_0x2da6('0x1e')](_0x2da6('0x1f'),_0x38380c,_0x2da6('0x22'));_0xb25b0e(_0x5bdf2f[_0x2da6('0x27')]['message']);}})['catch'](function(_0x142d9f){logger['error'](_0x2da6('0x1f'),_0x38380c,_0x142d9f);_0x5e7deb(_0x142d9f);});});}function respondWithStatusCode(_0x570217,_0x57bf21){_0x57bf21=_0x57bf21||0xcc;return function(_0x1121e5){if(_0x1121e5){return _0x570217[_0x2da6('0x28')](_0x57bf21);}return _0x570217[_0x2da6('0x29')](_0x57bf21)[_0x2da6('0x2a')]();};}function respondWithResult(_0x559a64,_0x1de508){_0x1de508=_0x1de508||0xc8;return function(_0x598501){if(_0x598501){return _0x559a64['status'](_0x1de508)[_0x2da6('0x2b')](_0x598501);}};}function respondWithFilteredResult(_0x204e02,_0x2ae68a){return function(_0x20effe){if(_0x20effe){var _0x25c0dc=typeof _0x2ae68a[_0x2da6('0x2c')]===_0x2da6('0x2d')&&typeof _0x2ae68a[_0x2da6('0x2e')]===_0x2da6('0x2d');var _0x3cdc91=_0x20effe[_0x2da6('0x2f')];var _0x43cf1e=_0x25c0dc?0x0:_0x2ae68a[_0x2da6('0x2c')];var _0x2ebec7=_0x25c0dc?_0x20effe[_0x2da6('0x2f')]:_0x2ae68a[_0x2da6('0x2c')]+_0x2ae68a[_0x2da6('0x2e')];var _0x356408;if(_0x2ebec7>=_0x3cdc91){_0x2ebec7=_0x3cdc91;_0x356408=0xc8;}else{_0x356408=0xce;}_0x204e02[_0x2da6('0x29')](_0x356408);return _0x204e02[_0x2da6('0x30')](_0x2da6('0x31'),_0x43cf1e+'-'+_0x2ebec7+'/'+_0x3cdc91)[_0x2da6('0x2b')](_0x20effe);}return null;};}function patchUpdates(_0x25c933){return function(_0x23b2b5){try{jsonpatch[_0x2da6('0x32')](_0x23b2b5,_0x25c933,!![]);}catch(_0x775ebd){return BPromise[_0x2da6('0x33')](_0x775ebd);}return _0x23b2b5[_0x2da6('0x34')]();};}function saveUpdates(_0x298aca,_0x4673d4){return function(_0x4ca758){if(_0x4ca758){return _0x4ca758[_0x2da6('0x35')](_0x298aca)['then'](function(_0x2e7e12){return _0x2e7e12;});}return null;};}function removeEntity(_0x314f44,_0x267dcf){return function(_0x19c3c4){if(_0x19c3c4){return _0x19c3c4[_0x2da6('0x36')]()['then'](function(){_0x314f44['status'](0xcc)[_0x2da6('0x2a')]();});}};}function handleEntityNotFound(_0x730d55,_0x4af054){return function(_0x57b09e){if(!_0x57b09e){_0x730d55[_0x2da6('0x28')](0x194);}return _0x57b09e;};}function handleError(_0x460487,_0x18900a){_0x18900a=_0x18900a||0x1f4;return function(_0x55dfa4){logger[_0x2da6('0x25')](_0x55dfa4['stack']);if(_0x55dfa4[_0x2da6('0x37')]){delete _0x55dfa4[_0x2da6('0x37')];}_0x460487[_0x2da6('0x29')](_0x18900a)[_0x2da6('0x38')](_0x55dfa4);};}exports[_0x2da6('0x39')]=function(_0x3a71ab,_0x3c7203){var _0x3675b2={},_0x2d34e1={},_0x30a9a1={'count':0x0,'rows':[]};var _0x544862=_[_0x2da6('0x3a')](db[_0x2da6('0x3b')][_0x2da6('0x3c')],function(_0x213363){return{'name':_0x213363[_0x2da6('0x3d')],'type':_0x213363[_0x2da6('0x3e')]['key']};});_0x2d34e1[_0x2da6('0x3f')]=_[_0x2da6('0x3a')](_0x544862,_0x2da6('0x37'));_0x2d34e1['query']=_['keys'](_0x3a71ab[_0x2da6('0x40')]);_0x2d34e1[_0x2da6('0x41')]=_[_0x2da6('0x42')](_0x2d34e1[_0x2da6('0x3f')],_0x2d34e1[_0x2da6('0x40')]);_0x3675b2['attributes']=_[_0x2da6('0x42')](_0x2d34e1[_0x2da6('0x3f')],qs[_0x2da6('0x43')](_0x3a71ab[_0x2da6('0x40')][_0x2da6('0x43')]));_0x3675b2[_0x2da6('0x44')]=_0x3675b2[_0x2da6('0x44')]['length']?_0x3675b2[_0x2da6('0x44')]:_0x2d34e1[_0x2da6('0x3f')];if(!_0x3a71ab[_0x2da6('0x40')][_0x2da6('0x45')]('nolimit')){_0x3675b2['limit']=qs[_0x2da6('0x2e')](_0x3a71ab['query'][_0x2da6('0x2e')]);_0x3675b2[_0x2da6('0x2c')]=qs[_0x2da6('0x2c')](_0x3a71ab[_0x2da6('0x40')][_0x2da6('0x2c')]);}_0x3675b2['order']=qs['sort'](_0x3a71ab['query'][_0x2da6('0x46')]);_0x3675b2[_0x2da6('0x47')]=qs[_0x2da6('0x41')](_[_0x2da6('0x48')](_0x3a71ab[_0x2da6('0x40')],_0x2d34e1[_0x2da6('0x41')]),_0x544862);if(_0x3a71ab[_0x2da6('0x40')][_0x2da6('0x49')]){_0x3675b2[_0x2da6('0x47')]=_[_0x2da6('0x4a')](_0x3675b2[_0x2da6('0x47')],{'$or':_[_0x2da6('0x3a')](_0x544862,function(_0x2e6ab8){if(_0x2e6ab8[_0x2da6('0x3e')]!=='VIRTUAL'){var _0x4fbfda={};_0x4fbfda[_0x2e6ab8['name']]={'$like':'%'+_0x3a71ab[_0x2da6('0x40')][_0x2da6('0x49')]+'%'};return _0x4fbfda;}})});}_0x3675b2=_['merge']({},_0x3675b2,_0x3a71ab[_0x2da6('0x4b')]);var _0x501bd8={'where':_0x3675b2[_0x2da6('0x47')]};return db[_0x2da6('0x3b')][_0x2da6('0x2f')](_0x501bd8)[_0x2da6('0x1d')](function(_0x102f37){_0x30a9a1[_0x2da6('0x2f')]=_0x102f37;if(_0x3a71ab['query'][_0x2da6('0x4c')]){_0x3675b2[_0x2da6('0x4d')]=[{'all':!![]}];}return db[_0x2da6('0x3b')][_0x2da6('0x4e')](_0x3675b2);})[_0x2da6('0x1d')](function(_0x1081e7){_0x30a9a1[_0x2da6('0x4f')]=_0x1081e7;return _0x30a9a1;})['then'](respondWithFilteredResult(_0x3c7203,_0x3675b2))[_0x2da6('0x50')](handleError(_0x3c7203,null));};exports[_0x2da6('0x51')]=function(_0xf9a8a8,_0x1a4de9){var _0x122757={'raw':!![],'where':{'id':_0xf9a8a8['params']['id']}},_0xb73e0={};_0xb73e0['model']=_['keys'](db[_0x2da6('0x3b')][_0x2da6('0x3c')]);_0xb73e0[_0x2da6('0x40')]=_[_0x2da6('0x52')](_0xf9a8a8[_0x2da6('0x40')]);_0xb73e0[_0x2da6('0x41')]=_[_0x2da6('0x42')](_0xb73e0[_0x2da6('0x3f')],_0xb73e0[_0x2da6('0x40')]);_0x122757[_0x2da6('0x44')]=_[_0x2da6('0x42')](_0xb73e0[_0x2da6('0x3f')],qs[_0x2da6('0x43')](_0xf9a8a8[_0x2da6('0x40')]['fields']));_0x122757['attributes']=_0x122757[_0x2da6('0x44')][_0x2da6('0x53')]?_0x122757['attributes']:_0xb73e0['model'];if(_0xf9a8a8[_0x2da6('0x40')]['includeAll']){_0x122757[_0x2da6('0x4d')]=[{'all':!![]}];}_0x122757=_[_0x2da6('0x4a')]({},_0x122757,_0xf9a8a8[_0x2da6('0x4b')]);return db[_0x2da6('0x3b')][_0x2da6('0x54')](_0x122757)[_0x2da6('0x1d')](handleEntityNotFound(_0x1a4de9,null))[_0x2da6('0x1d')](respondWithResult(_0x1a4de9,null))['catch'](handleError(_0x1a4de9,null));};exports['update']=function(_0x447b5b,_0x5c0e84){if(_0x447b5b[_0x2da6('0x55')]['id']){delete _0x447b5b[_0x2da6('0x55')]['id'];}return db[_0x2da6('0x3b')][_0x2da6('0x54')]({'where':{'id':_0x447b5b['params']['id']}})['then'](handleEntityNotFound(_0x5c0e84,null))['then'](saveUpdates(_0x447b5b['body'],null))[_0x2da6('0x1d')](respondWithResult(_0x5c0e84,null))['catch'](handleError(_0x5c0e84,null));};exports[_0x2da6('0x36')]=function(_0xf221cc,_0x2f5725){return db[_0x2da6('0x3b')][_0x2da6('0x54')]({'where':{'id':_0xf221cc['params']['id']}})[_0x2da6('0x1d')](handleEntityNotFound(_0x2f5725,null))[_0x2da6('0x1d')](removeEntity(_0x2f5725,null))[_0x2da6('0x50')](handleError(_0x2f5725,null));};exports['describe']=function(_0xe67e53,_0x1dacae){return db[_0x2da6('0x3b')][_0x2da6('0x56')]()[_0x2da6('0x1d')](respondWithResult(_0x1dacae,null))[_0x2da6('0x50')](handleError(_0x1dacae,null));};var interaction_log=require('../../config/logger')(_0x2da6('0x57'));exports[_0x2da6('0x58')]=function(_0x4b188a,_0x1e453c,_0x413e14){var _0x26cabd={'agent':{},'channel':_0x2da6('0x59')};if(_0x4b188a[_0x2da6('0x55')]['id']){delete _0x4b188a[_0x2da6('0x55')]['id'];}_0x4b188a['body']['read']=!![];_0x4b188a['body'][_0x2da6('0x5a')]=moment()[_0x2da6('0x5b')](_0x2da6('0x5c'));_0x4b188a['body'][_0x2da6('0x5d')]=_0x4b188a[_0x2da6('0x55')][_0x2da6('0x5d')]||_0x4b188a[_0x2da6('0x5e')]['id'];_0x26cabd[_0x2da6('0x5f')]['id']=_0x4b188a[_0x2da6('0x55')]['UserId'];return db[_0x2da6('0x3b')]['find']({'where':{'id':_0x4b188a['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1e453c,null))['then'](saveUpdates(_0x4b188a[_0x2da6('0x55')],null))[_0x2da6('0x1d')](function(_0x5a41a7){if(_0x5a41a7){_0x26cabd[_0x2da6('0x26')]=_0x5a41a7[_0x2da6('0x60')]({'plain':!![]});return db['FaxInteraction'][_0x2da6('0x54')]({'where':{'id':_0x5a41a7['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1e453c,null))[_0x2da6('0x1d')](function(_0x38b517){if(_0x38b517){return _0x38b517[_0x2da6('0x35')]({'UserId':_0x4b188a[_0x2da6('0x55')]['UserId'],'read1stAt':_[_0x2da6('0x61')](_0x38b517[_0x2da6('0x62')])?moment()[_0x2da6('0x5b')](_0x2da6('0x5c')):undefined});}return null;})[_0x2da6('0x1d')](function(_0x1eb2c3){if(_0x1eb2c3){_0x26cabd[_0x2da6('0x63')]=_0x1eb2c3[_0x2da6('0x60')]({'plain':!![]});interaction_log[_0x2da6('0x1e')](_0x2da6('0x64'),_0x4b188a[_0x2da6('0x5e')]['id'],_0x4b188a[_0x2da6('0x5e')]['name'],_0x4b188a[_0x2da6('0x5e')][_0x2da6('0x65')],_0x26cabd[_0x2da6('0x63')]['id'],_0x4b188a[_0x2da6('0x55')]?JSON['stringify'](_0x4b188a[_0x2da6('0x55')]):_0x2da6('0x66'));return respondWithRpcPromise('AcceptMessage',_0x2da6('0x67'),_0x26cabd);}return null;})[_0x2da6('0x1d')](function(_0x510546){var _0x54eb26=_0x2da6('0x68')+_0x510546[_0x2da6('0x26')][_0x2da6('0x69')];return db[_0x2da6('0x6a')][_0x2da6('0x40')](_0x54eb26,{'type':db[_0x2da6('0x6b')][_0x2da6('0x6c')][_0x2da6('0x6d')],'raw':!![]})[_0x2da6('0x1d')](function(_0x1e13e6){return _0x1e13e6;});})[_0x2da6('0x1d')](function(_0x594095){if(_0x594095){_0x26cabd['message'][_0x2da6('0x6e')]=_0x594095[0x0];if(!_0x4b188a[_0x2da6('0x55')][_0x2da6('0x5d')])return;return db['User']['find']({'where':{'id':_0x4b188a[_0x2da6('0x55')][_0x2da6('0x5d')],'role':_0x2da6('0x5f')},'attributes':['id',_0x2da6('0x37'),_0x2da6('0x6f'),_0x2da6('0x70'),_0x2da6('0x71')],'raw':!![]});}return null;})[_0x2da6('0x1d')](function(_0x227158){if(!_0x227158)return null;_0x26cabd[_0x2da6('0x26')][_0x2da6('0x5f')]=_0x227158;return _0x26cabd;})[_0x2da6('0x1d')](function(_0x2c1381){if(_0x2c1381){if(_0x4b188a[_0x2da6('0x55')]['manual']){_0x26cabd['message'][_0x2da6('0x72')]=util[_0x2da6('0x5b')](_0x2da6('0x73'),_0x4b188a['user'][_0x2da6('0x37')]);_0x26cabd[_0x2da6('0x26')][_0x2da6('0x74')]=_0x26cabd['channel'];_0x26cabd['message'][_0x2da6('0x75')]=_0x26cabd[_0x2da6('0x74')];_0x26cabd['message'][_0x2da6('0x76')]='accept';return respondWithRpcPromise('EventManager',_0x2da6('0x77'),{'event':_0x2da6('0x78'),'message':_0x26cabd['message']},client9002)[_0x2da6('0x1d')](function(){return _0x26cabd;});}return _0x26cabd;}return null;})['then'](respondWithResult(_0x1e453c,null))[_0x2da6('0x50')](handleError(_0x1e453c,null));};var interaction_log=require(_0x2da6('0x12'))('fax-interactions');exports[_0x2da6('0x33')]=function(_0x1e1629,_0xc9c5ac,_0x14e792){var _0x5ed0a7={'agent':{},'channel':_0x2da6('0x59')};if(_0x1e1629[_0x2da6('0x55')]['id']){delete _0x1e1629[_0x2da6('0x55')]['id'];}_0x1e1629['body']['UserId']=_0x1e1629['body'][_0x2da6('0x5d')]||_0x1e1629['user']['id'];_0x5ed0a7[_0x2da6('0x5f')]['id']=_0x1e1629['body'][_0x2da6('0x5d')];return db['FaxMessage']['find']({'where':{'id':_0x1e1629['params']['id'],'UserId':null}})[_0x2da6('0x1d')](handleEntityNotFound(_0xc9c5ac,null))[_0x2da6('0x1d')](function(_0x498ae0){if(_0x498ae0){_0x5ed0a7[_0x2da6('0x26')]=_0x498ae0[_0x2da6('0x60')]({'plain':!![]});return db[_0x2da6('0x79')][_0x2da6('0x54')]({'where':{'id':_0x498ae0[_0x2da6('0x7a')]}});}return null;})[_0x2da6('0x1d')](handleEntityNotFound(_0xc9c5ac,null))['then'](function(_0x26f815){if(_0x26f815){_0x5ed0a7[_0x2da6('0x63')]=_0x26f815['get']({'plain':!![]});interaction_log[_0x2da6('0x1e')](_0x2da6('0x7b'),_0x1e1629['user']['id'],_0x1e1629['user']['name'],_0x1e1629[_0x2da6('0x5e')][_0x2da6('0x65')],_0x5ed0a7[_0x2da6('0x63')]['id'],_0x1e1629[_0x2da6('0x55')]?JSON[_0x2da6('0x23')](_0x1e1629[_0x2da6('0x55')]):_0x2da6('0x66'));return respondWithRpcPromise('RejectMessage',_0x2da6('0x7c'),_0x5ed0a7);}return null;})[_0x2da6('0x1d')](function(_0x49aa8e){var _0x53cb58='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49aa8e[_0x2da6('0x26')][_0x2da6('0x69')];return db[_0x2da6('0x6a')][_0x2da6('0x40')](_0x53cb58,{'type':db[_0x2da6('0x6b')][_0x2da6('0x6c')][_0x2da6('0x6d')],'raw':!![]})[_0x2da6('0x1d')](function(_0x3f6b4e){return _0x3f6b4e;});})['then'](function(_0x22c881){if(_0x22c881){_0x5ed0a7[_0x2da6('0x26')][_0x2da6('0x6e')]=_0x22c881[0x0];if(!_0x1e1629[_0x2da6('0x55')][_0x2da6('0x5d')])return;return db[_0x2da6('0x7d')][_0x2da6('0x54')]({'where':{'id':_0x1e1629[_0x2da6('0x55')][_0x2da6('0x5d')],'role':_0x2da6('0x5f')},'attributes':['id','name','fullname',_0x2da6('0x70'),'internal'],'raw':!![]});}return null;})[_0x2da6('0x1d')](function(_0x24f11a){if(!_0x24f11a)return null;_0x5ed0a7['message'][_0x2da6('0x5f')]=_0x24f11a;return _0x5ed0a7;})[_0x2da6('0x1d')](function(_0xa65227){if(_0xa65227){_0xa65227[_0x2da6('0x26')][_0x2da6('0x72')]=util[_0x2da6('0x5b')](_0x2da6('0x73'),_0x1e1629[_0x2da6('0x5e')][_0x2da6('0x37')]);_0xa65227['message'][_0x2da6('0x74')]=_0x5ed0a7[_0x2da6('0x74')];_0xa65227[_0x2da6('0x26')]['motionChannel']=_0x5ed0a7['channel'];_0xa65227[_0x2da6('0x26')]['event']='reject';respondWithRpcPromise(_0x2da6('0x77'),_0x2da6('0x77'),{'event':_0x2da6('0x7e'),'message':_0xa65227['message']},client9002);return _0x5ed0a7;}return null;})[_0x2da6('0x1d')](respondWithResult(_0xc9c5ac,null))[_0x2da6('0x50')](handleError(_0xc9c5ac,null));};exports['create']=function(_0x156e65,_0x2a7565){var _0x18762d;return db[_0x2da6('0x3b')][_0x2da6('0x7f')](_0x156e65[_0x2da6('0x55')],{})[_0x2da6('0x1d')](function(_0x2fcd1e){_0x18762d=_0x2fcd1e;return db[_0x2da6('0x80')][_0x2da6('0x81')]({'where':{'id':_0x18762d['ContactId']}});})[_0x2da6('0x1d')](function(_0x381259){if(_[_0x2da6('0x61')](_0x381259)){return;}else{_0x18762d[_0x2da6('0x59')]=_0x381259[_0x2da6('0x59')];return db[_0x2da6('0x82')]['findOne']({'where':{'id':_0x18762d[_0x2da6('0x83')]}});}})[_0x2da6('0x1d')](function(_0x269e84){return respondWithRpcPromise(_0x2da6('0x84'),_0x2da6('0x84'),{'FaxAccountId':_[_0x2da6('0x61')](_0x156e65['body'])?undefined:_0x156e65[_0x2da6('0x55')][_0x2da6('0x85')],'path':_[_0x2da6('0x61')](_0x269e84)?undefined:util[_0x2da6('0x5b')](_0x2da6('0x86'),_0x269e84[_0x2da6('0x87')]),'fax':_[_0x2da6('0x61')](_0x18762d['fax'])?undefined:_0x18762d[_0x2da6('0x59')],'AttachmentId':_0x18762d['AttachmentId']},client9002);})[_0x2da6('0x1d')](respondWithResult(_0x2a7565,0xc9))[_0x2da6('0x50')](handleError(_0x2a7565,null));};exports[_0x2da6('0x88')]=function(_0xdbf515,_0x55b3d2){var _0x248c4f=path[_0x2da6('0x89')](config[_0x2da6('0x8a')],_0x2da6('0x8b'),_0x2da6('0x8c'),'attachments');return db['FaxMessage'][_0x2da6('0x54')]({'where':{'id':_0xdbf515[_0x2da6('0x8d')]['id']},'include':[{'model':db[_0x2da6('0x82')],'as':_0x2da6('0x82')}]})[_0x2da6('0x1d')](handleEntityNotFound(_0x55b3d2,null))[_0x2da6('0x1d')](function(_0x41e8ca){if(_0x41e8ca){return _0x55b3d2[_0x2da6('0x88')](path[_0x2da6('0x89')](_0x248c4f,_0x41e8ca[_0x2da6('0x82')][_0x2da6('0x87')]));}})[_0x2da6('0x50')](handleError(_0x55b3d2,null));}; \ No newline at end of file +var _0xe82e=['info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','map','FaxMessage','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','includeAll','findAll','rows','params','rawAttributes','intersection','include','options','find','body','describe','../../config/logger','fax','read','readAt','UserId','agent','get','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','fax-interactions','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','SELECT','interface','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','attachments','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','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','./faxMessage.socket','register','client','http','request','then'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe82e,0x6f));var _0xee82=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xe82e[_0x45d3f0];return _0x314b79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee82('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee82('0x1'));var rp=require('request-promise');var moment=require(_0xee82('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xee82('0x3'));var util=require(_0xee82('0x4'));var path=require(_0xee82('0x5'));var sox=require(_0xee82('0x6'));var csv=require('to-csv');var ejs=require(_0xee82('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee82('0x8'));var squel=require('squel');var crypto=require(_0xee82('0x9'));var jsforce=require(_0xee82('0xa'));var deskjs=require(_0xee82('0xb'));var toCsv=require(_0xee82('0xc'));var querystring=require(_0xee82('0xd'));var Papa=require(_0xee82('0xe'));var Redis=require(_0xee82('0xf'));var authService=require(_0xee82('0x10'));var qs=require(_0xee82('0x11'));var as=require(_0xee82('0x12'));var hardwareService=require(_0xee82('0x13'));var logger=require('../../config/logger')(_0xee82('0x14'));var utils=require(_0xee82('0x15'));var config=require(_0xee82('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xee82('0x17')]=_[_0xee82('0x18')](config[_0xee82('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xee82('0x19'))(new Redis(config[_0xee82('0x17')]));require(_0xee82('0x1a'))[_0xee82('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xee82('0x1c')][_0xee82('0x1d')]({'port':0x232c});var client9002=jayson[_0xee82('0x1c')][_0xee82('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x55505d,_0x42a6ae,_0x420955,_0x503b6b){return new BPromise(function(_0x2293d4,_0x3c15fc){var _0x571992=_0x503b6b||client;return _0x571992[_0xee82('0x1e')](_0x55505d,_0x420955)[_0xee82('0x1f')](function(_0x115c24){logger[_0xee82('0x20')](_0xee82('0x21'),_0x42a6ae,'request\x20sent');logger[_0xee82('0x22')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x42a6ae,_0xee82('0x23'),JSON[_0xee82('0x24')](_0x115c24));if(_0x115c24[_0xee82('0x25')]){if(_0x115c24['error'][_0xee82('0x26')]===0x1f4){logger[_0xee82('0x25')](_0xee82('0x21'),_0x42a6ae,_0x115c24[_0xee82('0x25')][_0xee82('0x27')]);return _0x3c15fc(_0x115c24[_0xee82('0x25')][_0xee82('0x27')]);}logger[_0xee82('0x25')]('FaxMessage,\x20%s,\x20%s',_0x42a6ae,_0x115c24['error']['message']);return _0x2293d4(_0x115c24[_0xee82('0x25')][_0xee82('0x27')]);}else{logger['info'](_0xee82('0x21'),_0x42a6ae,_0xee82('0x23'));_0x2293d4(_0x115c24[_0xee82('0x28')][_0xee82('0x27')]);}})[_0xee82('0x29')](function(_0x38b596){logger[_0xee82('0x25')](_0xee82('0x21'),_0x42a6ae,_0x38b596);_0x3c15fc(_0x38b596);});});}function respondWithStatusCode(_0x3abe51,_0x1c2af4){_0x1c2af4=_0x1c2af4||0xcc;return function(_0x43f0fe){if(_0x43f0fe){return _0x3abe51[_0xee82('0x2a')](_0x1c2af4);}return _0x3abe51[_0xee82('0x2b')](_0x1c2af4)[_0xee82('0x2c')]();};}function respondWithResult(_0x4eab65,_0x24473f){_0x24473f=_0x24473f||0xc8;return function(_0x47bb94){if(_0x47bb94){return _0x4eab65[_0xee82('0x2b')](_0x24473f)[_0xee82('0x2d')](_0x47bb94);}};}function respondWithFilteredResult(_0x10d7d5,_0x54b2fb){return function(_0x22416b){if(_0x22416b){var _0x1f25e1=typeof _0x54b2fb[_0xee82('0x2e')]===_0xee82('0x2f')&&typeof _0x54b2fb[_0xee82('0x30')]==='undefined';var _0x3a24ee=_0x22416b[_0xee82('0x31')];var _0x3eebbf=_0x1f25e1?0x0:_0x54b2fb['offset'];var _0x47cc0d=_0x1f25e1?_0x22416b[_0xee82('0x31')]:_0x54b2fb[_0xee82('0x2e')]+_0x54b2fb['limit'];var _0x2ab784;if(_0x47cc0d>=_0x3a24ee){_0x47cc0d=_0x3a24ee;_0x2ab784=0xc8;}else{_0x2ab784=0xce;}_0x10d7d5['status'](_0x2ab784);return _0x10d7d5[_0xee82('0x32')](_0xee82('0x33'),_0x3eebbf+'-'+_0x47cc0d+'/'+_0x3a24ee)[_0xee82('0x2d')](_0x22416b);}return null;};}function patchUpdates(_0x5dd1d6){return function(_0x1e0ed4){try{jsonpatch['apply'](_0x1e0ed4,_0x5dd1d6,!![]);}catch(_0xdae3d3){return BPromise[_0xee82('0x34')](_0xdae3d3);}return _0x1e0ed4[_0xee82('0x35')]();};}function saveUpdates(_0x148243,_0x5b956e){return function(_0x25910a){if(_0x25910a){return _0x25910a[_0xee82('0x36')](_0x148243)['then'](function(_0x453d54){return _0x453d54;});}return null;};}function removeEntity(_0x4200de,_0x51c182){return function(_0x2217b5){if(_0x2217b5){return _0x2217b5[_0xee82('0x37')]()[_0xee82('0x1f')](function(){_0x4200de['status'](0xcc)[_0xee82('0x2c')]();});}};}function handleEntityNotFound(_0x2d8250,_0x3ab6dd){return function(_0x298ba4){if(!_0x298ba4){_0x2d8250[_0xee82('0x2a')](0x194);}return _0x298ba4;};}function handleError(_0xada6fb,_0x367dc4){_0x367dc4=_0x367dc4||0x1f4;return function(_0x11670c){logger['error'](_0x11670c[_0xee82('0x38')]);if(_0x11670c['name']){delete _0x11670c[_0xee82('0x39')];}_0xada6fb['status'](_0x367dc4)['send'](_0x11670c);};}exports['index']=function(_0x57d4d4,_0xcd067b){var _0x363dd8={},_0x98cedf={},_0x639e4b={'count':0x0,'rows':[]};var _0x16e7c4=_[_0xee82('0x3a')](db[_0xee82('0x3b')]['rawAttributes'],function(_0x580e58){return{'name':_0x580e58[_0xee82('0x3c')],'type':_0x580e58[_0xee82('0x3d')]['key']};});_0x98cedf[_0xee82('0x3e')]=_[_0xee82('0x3a')](_0x16e7c4,_0xee82('0x39'));_0x98cedf[_0xee82('0x3f')]=_[_0xee82('0x40')](_0x57d4d4[_0xee82('0x3f')]);_0x98cedf[_0xee82('0x41')]=_['intersection'](_0x98cedf[_0xee82('0x3e')],_0x98cedf[_0xee82('0x3f')]);_0x363dd8[_0xee82('0x42')]=_['intersection'](_0x98cedf['model'],qs['fields'](_0x57d4d4[_0xee82('0x3f')][_0xee82('0x43')]));_0x363dd8['attributes']=_0x363dd8['attributes'][_0xee82('0x44')]?_0x363dd8[_0xee82('0x42')]:_0x98cedf[_0xee82('0x3e')];if(!_0x57d4d4[_0xee82('0x3f')][_0xee82('0x45')](_0xee82('0x46'))){_0x363dd8[_0xee82('0x30')]=qs[_0xee82('0x30')](_0x57d4d4['query'][_0xee82('0x30')]);_0x363dd8['offset']=qs[_0xee82('0x2e')](_0x57d4d4[_0xee82('0x3f')][_0xee82('0x2e')]);}_0x363dd8[_0xee82('0x47')]=qs['sort'](_0x57d4d4['query']['sort']);_0x363dd8[_0xee82('0x48')]=qs[_0xee82('0x41')](_[_0xee82('0x49')](_0x57d4d4[_0xee82('0x3f')],_0x98cedf[_0xee82('0x41')]),_0x16e7c4);if(_0x57d4d4[_0xee82('0x3f')]['filter']){_0x363dd8[_0xee82('0x48')]=_['merge'](_0x363dd8[_0xee82('0x48')],{'$or':_[_0xee82('0x3a')](_0x16e7c4,function(_0x3337f2){if(_0x3337f2['type']!=='VIRTUAL'){var _0x4baae9={};_0x4baae9[_0x3337f2['name']]={'$like':'%'+_0x57d4d4[_0xee82('0x3f')][_0xee82('0x4a')]+'%'};return _0x4baae9;}})});}_0x363dd8=_[_0xee82('0x4b')]({},_0x363dd8,_0x57d4d4['options']);var _0x3cb866={'where':_0x363dd8[_0xee82('0x48')]};return db[_0xee82('0x3b')]['count'](_0x3cb866)[_0xee82('0x1f')](function(_0x546afd){_0x639e4b['count']=_0x546afd;if(_0x57d4d4[_0xee82('0x3f')][_0xee82('0x4c')]){_0x363dd8['include']=[{'all':!![]}];}return db[_0xee82('0x3b')][_0xee82('0x4d')](_0x363dd8);})[_0xee82('0x1f')](function(_0x121d36){_0x639e4b[_0xee82('0x4e')]=_0x121d36;return _0x639e4b;})[_0xee82('0x1f')](respondWithFilteredResult(_0xcd067b,_0x363dd8))[_0xee82('0x29')](handleError(_0xcd067b,null));};exports['show']=function(_0x453368,_0x481b26){var _0x36d099={'raw':!![],'where':{'id':_0x453368[_0xee82('0x4f')]['id']}},_0x5c49da={};_0x5c49da[_0xee82('0x3e')]=_['keys'](db[_0xee82('0x3b')][_0xee82('0x50')]);_0x5c49da['query']=_[_0xee82('0x40')](_0x453368[_0xee82('0x3f')]);_0x5c49da['filters']=_[_0xee82('0x51')](_0x5c49da[_0xee82('0x3e')],_0x5c49da[_0xee82('0x3f')]);_0x36d099['attributes']=_[_0xee82('0x51')](_0x5c49da['model'],qs[_0xee82('0x43')](_0x453368[_0xee82('0x3f')]['fields']));_0x36d099[_0xee82('0x42')]=_0x36d099['attributes'][_0xee82('0x44')]?_0x36d099[_0xee82('0x42')]:_0x5c49da[_0xee82('0x3e')];if(_0x453368['query'][_0xee82('0x4c')]){_0x36d099[_0xee82('0x52')]=[{'all':!![]}];}_0x36d099=_['merge']({},_0x36d099,_0x453368[_0xee82('0x53')]);return db[_0xee82('0x3b')][_0xee82('0x54')](_0x36d099)['then'](handleEntityNotFound(_0x481b26,null))[_0xee82('0x1f')](respondWithResult(_0x481b26,null))[_0xee82('0x29')](handleError(_0x481b26,null));};exports['update']=function(_0x4ff195,_0x57831b){if(_0x4ff195[_0xee82('0x55')]['id']){delete _0x4ff195[_0xee82('0x55')]['id'];}return db[_0xee82('0x3b')][_0xee82('0x54')]({'where':{'id':_0x4ff195[_0xee82('0x4f')]['id']}})['then'](handleEntityNotFound(_0x57831b,null))[_0xee82('0x1f')](saveUpdates(_0x4ff195[_0xee82('0x55')],null))[_0xee82('0x1f')](respondWithResult(_0x57831b,null))['catch'](handleError(_0x57831b,null));};exports[_0xee82('0x37')]=function(_0x248cb8,_0x49e47c){return db[_0xee82('0x3b')][_0xee82('0x54')]({'where':{'id':_0x248cb8[_0xee82('0x4f')]['id']}})[_0xee82('0x1f')](handleEntityNotFound(_0x49e47c,null))[_0xee82('0x1f')](removeEntity(_0x49e47c,null))[_0xee82('0x29')](handleError(_0x49e47c,null));};exports[_0xee82('0x56')]=function(_0x3e5f31,_0x19ef53){return db[_0xee82('0x3b')][_0xee82('0x56')]()[_0xee82('0x1f')](respondWithResult(_0x19ef53,null))[_0xee82('0x29')](handleError(_0x19ef53,null));};var interaction_log=require(_0xee82('0x57'))('fax-interactions');exports['accept']=function(_0x3579d8,_0x3a516c,_0x3ee75e){var _0x52e5e0={'agent':{},'channel':_0xee82('0x58')};if(_0x3579d8[_0xee82('0x55')]['id']){delete _0x3579d8['body']['id'];}_0x3579d8[_0xee82('0x55')][_0xee82('0x59')]=!![];_0x3579d8['body'][_0xee82('0x5a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3579d8[_0xee82('0x55')][_0xee82('0x5b')]=_0x3579d8['body']['UserId']||_0x3579d8['user']['id'];_0x52e5e0[_0xee82('0x5c')]['id']=_0x3579d8[_0xee82('0x55')][_0xee82('0x5b')];return db[_0xee82('0x3b')]['find']({'where':{'id':_0x3579d8[_0xee82('0x4f')]['id'],'UserId':null}})[_0xee82('0x1f')](handleEntityNotFound(_0x3a516c,null))[_0xee82('0x1f')](saveUpdates(_0x3579d8[_0xee82('0x55')],null))['then'](function(_0x208197){if(_0x208197){_0x52e5e0[_0xee82('0x27')]=_0x208197[_0xee82('0x5d')]({'plain':!![]});return db['FaxInteraction'][_0xee82('0x54')]({'where':{'id':_0x208197['FaxInteractionId']}});}return null;})[_0xee82('0x1f')](handleEntityNotFound(_0x3a516c,null))[_0xee82('0x1f')](function(_0x379318){if(_0x379318){return _0x379318[_0xee82('0x36')]({'UserId':_0x3579d8[_0xee82('0x55')]['UserId'],'read1stAt':_[_0xee82('0x5e')](_0x379318[_0xee82('0x5f')])?moment()[_0xee82('0x60')](_0xee82('0x61')):undefined});}return null;})[_0xee82('0x1f')](function(_0x4723f8){if(_0x4723f8){_0x52e5e0[_0xee82('0x62')]=_0x4723f8['get']({'plain':!![]});interaction_log[_0xee82('0x20')](_0xee82('0x63'),_0x3579d8[_0xee82('0x64')]['id'],_0x3579d8[_0xee82('0x64')][_0xee82('0x39')],_0x3579d8[_0xee82('0x64')][_0xee82('0x65')],_0x52e5e0[_0xee82('0x62')]['id'],_0x3579d8[_0xee82('0x55')]?JSON[_0xee82('0x24')](_0x3579d8['body']):_0xee82('0x66'));return respondWithRpcPromise(_0xee82('0x67'),'acceptMessage',_0x52e5e0);}return null;})[_0xee82('0x1f')](function(_0x59a492){var _0x66827c=_0xee82('0x68')+_0x59a492[_0xee82('0x27')][_0xee82('0x69')];return db[_0xee82('0x6a')][_0xee82('0x3f')](_0x66827c,{'type':db[_0xee82('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})[_0xee82('0x1f')](function(_0x3411f1){return _0x3411f1;});})[_0xee82('0x1f')](function(_0xd69546){if(_0xd69546){_0x52e5e0[_0xee82('0x27')][_0xee82('0x6c')]=_0xd69546[0x0];if(!_0x3579d8[_0xee82('0x55')][_0xee82('0x5b')])return;return db[_0xee82('0x6d')]['find']({'where':{'id':_0x3579d8[_0xee82('0x55')][_0xee82('0x5b')],'role':'agent'},'attributes':['id',_0xee82('0x39'),_0xee82('0x6e'),_0xee82('0x6f'),_0xee82('0x70')],'raw':!![]});}return null;})['then'](function(_0x19ec24){if(!_0x19ec24)return null;_0x52e5e0[_0xee82('0x27')][_0xee82('0x5c')]=_0x19ec24;return _0x52e5e0;})[_0xee82('0x1f')](function(_0x3cd78b){if(_0x3cd78b){if(_0x3579d8[_0xee82('0x55')][_0xee82('0x71')]){_0x52e5e0[_0xee82('0x27')]['interface']=util[_0xee82('0x60')](_0xee82('0x72'),_0x3579d8[_0xee82('0x64')]['name']);_0x52e5e0[_0xee82('0x27')][_0xee82('0x73')]=_0x52e5e0[_0xee82('0x73')];_0x52e5e0[_0xee82('0x27')][_0xee82('0x74')]=_0x52e5e0[_0xee82('0x73')];_0x52e5e0['message'][_0xee82('0x75')]=_0xee82('0x76');return respondWithRpcPromise(_0xee82('0x77'),_0xee82('0x77'),{'event':_0xee82('0x78'),'message':_0x52e5e0['message']},client9002)[_0xee82('0x1f')](function(){return _0x52e5e0;});}return _0x52e5e0;}return null;})['then'](respondWithResult(_0x3a516c,null))[_0xee82('0x29')](handleError(_0x3a516c,null));};var interaction_log=require(_0xee82('0x57'))(_0xee82('0x79'));exports[_0xee82('0x34')]=function(_0x24557d,_0x3e72a3,_0x380642){var _0x3468ca={'agent':{},'channel':_0xee82('0x58')};if(_0x24557d['body']['id']){delete _0x24557d[_0xee82('0x55')]['id'];}_0x24557d[_0xee82('0x55')]['UserId']=_0x24557d[_0xee82('0x55')]['UserId']||_0x24557d[_0xee82('0x64')]['id'];_0x3468ca['agent']['id']=_0x24557d['body'][_0xee82('0x5b')];return db[_0xee82('0x3b')]['find']({'where':{'id':_0x24557d[_0xee82('0x4f')]['id'],'UserId':null}})[_0xee82('0x1f')](handleEntityNotFound(_0x3e72a3,null))[_0xee82('0x1f')](function(_0x25fa38){if(_0x25fa38){_0x3468ca[_0xee82('0x27')]=_0x25fa38['get']({'plain':!![]});return db[_0xee82('0x7a')][_0xee82('0x54')]({'where':{'id':_0x25fa38[_0xee82('0x7b')]}});}return null;})[_0xee82('0x1f')](handleEntityNotFound(_0x3e72a3,null))[_0xee82('0x1f')](function(_0x3d597a){if(_0x3d597a){_0x3468ca[_0xee82('0x62')]=_0x3d597a['get']({'plain':!![]});interaction_log[_0xee82('0x20')](_0xee82('0x7c'),_0x24557d[_0xee82('0x64')]['id'],_0x24557d[_0xee82('0x64')][_0xee82('0x39')],_0x24557d[_0xee82('0x64')]['role'],_0x3468ca[_0xee82('0x62')]['id'],_0x24557d[_0xee82('0x55')]?JSON['stringify'](_0x24557d[_0xee82('0x55')]):_0xee82('0x66'));return respondWithRpcPromise(_0xee82('0x7d'),'rejectMessage',_0x3468ca);}return null;})[_0xee82('0x1f')](function(_0x5f1b62){var _0x2b38fb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5f1b62[_0xee82('0x27')][_0xee82('0x69')];return db['sequelize'][_0xee82('0x3f')](_0x2b38fb,{'type':db[_0xee82('0x6b')][_0xee82('0x7e')][_0xee82('0x7f')],'raw':!![]})[_0xee82('0x1f')](function(_0x9748a0){return _0x9748a0;});})['then'](function(_0x3032b5){if(_0x3032b5){_0x3468ca[_0xee82('0x27')][_0xee82('0x6c')]=_0x3032b5[0x0];if(!_0x24557d['body'][_0xee82('0x5b')])return;return db[_0xee82('0x6d')]['find']({'where':{'id':_0x24557d[_0xee82('0x55')][_0xee82('0x5b')],'role':_0xee82('0x5c')},'attributes':['id',_0xee82('0x39'),_0xee82('0x6e'),_0xee82('0x6f'),_0xee82('0x70')],'raw':!![]});}return null;})['then'](function(_0x23798e){if(!_0x23798e)return null;_0x3468ca[_0xee82('0x27')][_0xee82('0x5c')]=_0x23798e;return _0x3468ca;})[_0xee82('0x1f')](function(_0x3e8847){if(_0x3e8847){_0x3e8847[_0xee82('0x27')][_0xee82('0x80')]=util[_0xee82('0x60')](_0xee82('0x72'),_0x24557d[_0xee82('0x64')][_0xee82('0x39')]);_0x3e8847[_0xee82('0x27')][_0xee82('0x73')]=_0x3468ca[_0xee82('0x73')];_0x3e8847[_0xee82('0x27')][_0xee82('0x74')]=_0x3468ca[_0xee82('0x73')];_0x3e8847[_0xee82('0x27')][_0xee82('0x75')]=_0xee82('0x34');respondWithRpcPromise(_0xee82('0x77'),'EventManager',{'event':_0xee82('0x81'),'message':_0x3e8847[_0xee82('0x27')]},client9002);return _0x3468ca;}return null;})[_0xee82('0x1f')](respondWithResult(_0x3e72a3,null))['catch'](handleError(_0x3e72a3,null));};exports[_0xee82('0x82')]=function(_0x4d26cf,_0x42602f){var _0x599cc8;return db[_0xee82('0x3b')][_0xee82('0x82')](_0x4d26cf[_0xee82('0x55')],{})['then'](function(_0x32203d){_0x599cc8=_0x32203d;return db[_0xee82('0x83')]['findOne']({'where':{'id':_0x599cc8['ContactId']}});})[_0xee82('0x1f')](function(_0x5bd1e0){if(_['isNil'](_0x5bd1e0)){return;}else{_0x599cc8[_0xee82('0x58')]=_0x5bd1e0['fax'];return db[_0xee82('0x84')][_0xee82('0x85')]({'where':{'id':_0x599cc8[_0xee82('0x86')]}});}})['then'](function(_0x119d77){return respondWithRpcPromise('SendFax',_0xee82('0x87'),{'FaxAccountId':_[_0xee82('0x5e')](_0x4d26cf['body'])?undefined:_0x4d26cf['body'][_0xee82('0x88')],'path':_[_0xee82('0x5e')](_0x119d77)?undefined:util[_0xee82('0x60')](_0xee82('0x89'),_0x119d77[_0xee82('0x8a')]),'fax':_[_0xee82('0x5e')](_0x599cc8[_0xee82('0x58')])?undefined:_0x599cc8[_0xee82('0x58')],'AttachmentId':_0x599cc8['AttachmentId']},client9002);})['then'](respondWithResult(_0x42602f,0xc9))[_0xee82('0x29')](handleError(_0x42602f,null));};exports[_0xee82('0x8b')]=function(_0x41cdb6,_0x120a7e){var _0x402fcd=path[_0xee82('0x8c')](config[_0xee82('0x8d')],'server','files',_0xee82('0x8e'));return db[_0xee82('0x3b')][_0xee82('0x54')]({'where':{'id':_0x41cdb6[_0xee82('0x4f')]['id']},'include':[{'model':db[_0xee82('0x84')],'as':_0xee82('0x84')}]})[_0xee82('0x1f')](handleEntityNotFound(_0x120a7e,null))[_0xee82('0x1f')](function(_0x580293){if(_0x580293){return _0x120a7e[_0xee82('0x8b')](path[_0xee82('0x8c')](_0x402fcd,_0x580293[_0xee82('0x84')][_0xee82('0x8a')]));}})['catch'](handleError(_0x120a7e,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 26d9190..61272d4 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 _0x5581=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','FaxMessage'];(function(_0x559ba4,_0x117831){var _0x2467a5=function(_0x2e05b5){while(--_0x2e05b5){_0x559ba4['push'](_0x559ba4['shift']());}};_0x2467a5(++_0x117831);}(_0x5581,0x115));var _0x1558=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x5581[_0xbf8ebe];return _0x1e25e8;};'use strict';var EventEmitter=require(_0x1558('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x1558('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1558('0x2')](0x0);var events={'afterCreate':_0x1558('0x3'),'afterUpdate':_0x1558('0x4'),'afterDestroy':_0x1558('0x5')};function emitEvent(_0x325c21){return function(_0x48c6fa,_0x113434,_0xa09e11){FaxMessageEvents['emit'](_0x325c21+':'+_0x48c6fa['id'],_0x48c6fa);FaxMessageEvents[_0x1558('0x6')](_0x325c21,_0x48c6fa);_0xa09e11(null);};}for(var e in events){if(events[_0x1558('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x1558('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x147b=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x4fb334,_0x4ca8c9){var _0x56dc84=function(_0x470d7b){while(--_0x470d7b){_0x4fb334['push'](_0x4fb334['shift']());}};_0x56dc84(++_0x4ca8c9);}(_0x147b,0x193));var _0xb147=function(_0x46306f,_0x5aef14){_0x46306f=_0x46306f-0x0;var _0x16a27f=_0x147b[_0x46306f];return _0x16a27f;};'use strict';var EventEmitter=require(_0xb147('0x0'));var FaxMessage=require(_0xb147('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xb147('0x2')](0x0);var events={'afterCreate':_0xb147('0x3'),'afterUpdate':'update','afterDestroy':_0xb147('0x4')};function emitEvent(_0x2ff391){return function(_0x22eea5,_0x5f457b,_0x10b93f){FaxMessageEvents['emit'](_0x2ff391+':'+_0x22eea5['id'],_0x22eea5);FaxMessageEvents[_0xb147('0x5')](_0x2ff391,_0x22eea5);_0x10b93f(null);};}for(var e in events){if(events[_0xb147('0x6')](e)){var event=events[e];FaxMessage[_0xb147('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index b3270e1..af15ad2 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 _0xbe7b=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','FaxMessage','body','FULLTEXT','models','direction','toLowerCase','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xbe7b,0x1e2));var _0xbbe7=function(_0x26ef14,_0x54606f){_0x26ef14=_0x26ef14-0x0;var _0x209847=_0xbe7b[_0x26ef14];return _0x209847;};'use strict';var _=require(_0xbbe7('0x0'));var util=require(_0xbbe7('0x1'));var logger=require(_0xbbe7('0x2'))(_0xbbe7('0x3'));var moment=require(_0xbbe7('0x4'));var BPromise=require(_0xbbe7('0x5'));var rp=require(_0xbbe7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbe7('0x7'));var config=require(_0xbbe7('0x8'));var attributes=require('./faxMessage.attributes');module[_0xbbe7('0x9')]=function(_0x42828c,_0x529691){return _0x42828c[_0xbbe7('0xa')](_0xbbe7('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xbbe7('0xc')],'type':_0xbbe7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f52a0,_0x16bafd,_0x29da2c){var _0x3aa9bb=_0x42828c[_0xbbe7('0xe')];var _0x3a208e=_0x1f52a0['get']({'plain':!![]});if(_0x3a208e[_0xbbe7('0xf')][_0xbbe7('0x10')]()==='in'||_0x3a208e['direction'][_0xbbe7('0x10')]()==='out'&&!_0x3a208e['secret']&&!_[_0xbbe7('0x11')](_0x3a208e[_0xbbe7('0x12')])){_0x3aa9bb[_0xbbe7('0x13')][_0xbbe7('0x14')]({'where':{'id':_0x3a208e[_0xbbe7('0x15')]}})[_0xbbe7('0x16')](function(_0x563668){if(_0x563668){_0x563668[_0xbbe7('0x17')]({'lastMsgAt':_0x3a208e['createdAt'],'lastMsgDirection':_0x3a208e['direction'][_0xbbe7('0x10')]()});}})[_0xbbe7('0x18')](function(_0x29818b){console[_0xbbe7('0x19')](_0x29818b);});}_0x29da2c();}},'charset':_0xbbe7('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6fab=['rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','then','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path'];(function(_0xcb5252,_0x58f6d1){var _0x456676=function(_0x382e4d){while(--_0x382e4d){_0xcb5252['push'](_0xcb5252['shift']());}};_0x456676(++_0x58f6d1);}(_0x6fab,0x175));var _0xb6fa=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x6fab[_0xf51c06];return _0x1d5420;};'use strict';var _=require('lodash');var util=require(_0xb6fa('0x0'));var logger=require(_0xb6fa('0x1'))('api');var moment=require(_0xb6fa('0x2'));var BPromise=require(_0xb6fa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6fa('0x4'));var rimraf=require(_0xb6fa('0x5'));var config=require(_0xb6fa('0x6'));var attributes=require(_0xb6fa('0x7'));module[_0xb6fa('0x8')]=function(_0x3f9676,_0x2b0ab2){return _0x3f9676[_0xb6fa('0x9')](_0xb6fa('0xa'),attributes,{'tableName':_0xb6fa('0xb'),'paranoid':![],'indexes':[{'name':_0xb6fa('0xc'),'fields':['body'],'type':_0xb6fa('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x467c33,_0x327632,_0x264913){var _0x583b71=_0x3f9676[_0xb6fa('0xe')];var _0x34cacd=_0x467c33[_0xb6fa('0xf')]({'plain':!![]});if(_0x34cacd[_0xb6fa('0x10')][_0xb6fa('0x11')]()==='in'||_0x34cacd['direction'][_0xb6fa('0x11')]()==='out'&&!_0x34cacd[_0xb6fa('0x12')]&&!_[_0xb6fa('0x13')](_0x34cacd[_0xb6fa('0x14')])){_0x583b71[_0xb6fa('0x15')][_0xb6fa('0x16')]({'where':{'id':_0x34cacd['FaxInteractionId']}})[_0xb6fa('0x17')](function(_0x3553a6){if(_0x3553a6){_0x3553a6['update']({'lastMsgAt':_0x34cacd['createdAt'],'lastMsgDirection':_0x34cacd[_0xb6fa('0x10')]['toLowerCase']()});}})['catch'](function(_0xcb1978){console[_0xb6fa('0x18')](_0xcb1978);});}_0x264913();}},'charset':_0xb6fa('0x19'),'collate':_0xb6fa('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index cb8ef09..86c581c 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 _0xbd50=['request','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','options','raw','then','UpdateFaxMessage','FaxMessage','update','body','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','./faxMessage.socket','register'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xbd50,0x196));var _0x0bd5=function(_0x1a422a,_0x3468fd){_0x1a422a=_0x1a422a-0x0;var _0x4dcab4=_0xbd50[_0x1a422a];return _0x4dcab4;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});config[_0x0bd5('0xa')]=_[_0x0bd5('0xb')](config[_0x0bd5('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bd5('0xa')]));require(_0x0bd5('0xc'))[_0x0bd5('0xd')](socket);function respondWithRpcPromise(_0x5f5a0c,_0xa98f54,_0x2fa7d1){return new BPromise(function(_0x519bc6,_0x210f45){return client[_0x0bd5('0xe')](_0x5f5a0c,_0x2fa7d1)['then'](function(_0x1ce7dd){logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,'request\x20sent');logger[_0x0bd5('0x11')](_0x0bd5('0x12'),_0xa98f54,_0x0bd5('0x13'),JSON[_0x0bd5('0x14')](_0x1ce7dd));if(_0x1ce7dd[_0x0bd5('0x15')]){if(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x16')]===0x1f4){logger[_0x0bd5('0x15')]('FaxMessage,\x20%s,\x20%s',_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);return _0x210f45(_0x1ce7dd['error'][_0x0bd5('0x17')]);}logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')]['message']);return _0x519bc6(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);}else{logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,_0x0bd5('0x13'));_0x519bc6(_0x1ce7dd[_0x0bd5('0x18')][_0x0bd5('0x17')]);}})[_0x0bd5('0x19')](function(_0x29fa4c){logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x29fa4c);_0x210f45(_0x29fa4c);});});}exports[_0x0bd5('0x1a')]=function(_0x4008bd){var _0x2dc1e5=this;return new Promise(function(_0x527c37,_0x5ba943){return db['FaxMessage']['create'](_0x4008bd['body'],{'raw':_0x4008bd[_0x0bd5('0x1b')]?_0x4008bd[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![]})[_0x0bd5('0x1d')](function(_0x6ee1a8){logger['info'](_0x0bd5('0x1a'),_0x4008bd);logger[_0x0bd5('0x11')](_0x0bd5('0x1a'),_0x4008bd,JSON['stringify'](_0x6ee1a8));_0x527c37(_0x6ee1a8);})[_0x0bd5('0x19')](function(_0x4a8787){logger['error'](_0x0bd5('0x1a'),_0x4a8787[_0x0bd5('0x17')],_0x4008bd);_0x5ba943(_0x2dc1e5[_0x0bd5('0x15')](0x1f4,_0x4a8787['message']));});});};exports[_0x0bd5('0x1e')]=function(_0x5eab3e){var _0x456e87=this;return new Promise(function(_0x3ffb08,_0x18cec3){return db[_0x0bd5('0x1f')][_0x0bd5('0x20')](_0x5eab3e[_0x0bd5('0x21')],{'raw':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x22')]||null:null,'attributes':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['attributes']||null:null,'limit':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['limit']||null:null})[_0x0bd5('0x1d')](function(_0x8eccc9){logger['info'](_0x0bd5('0x1e'),_0x5eab3e);logger[_0x0bd5('0x11')](_0x0bd5('0x1e'),_0x5eab3e,JSON[_0x0bd5('0x14')](_0x8eccc9));_0x3ffb08(_0x8eccc9);})['catch'](function(_0x440e69){logger[_0x0bd5('0x15')](_0x0bd5('0x1e'),_0x440e69[_0x0bd5('0x17')],_0x5eab3e);_0x18cec3(_0x456e87[_0x0bd5('0x15')](0x1f4,_0x440e69[_0x0bd5('0x17')]));});});}; \ No newline at end of file +var _0xb903=['options','raw','then','stringify','UpdateFaxMessage','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','FaxMessage','create','body'];(function(_0x4958ec,_0x594e08){var _0x367443=function(_0x542f74){while(--_0x542f74){_0x4958ec['push'](_0x4958ec['shift']());}};_0x367443(++_0x594e08);}(_0xb903,0x185));var _0x3b90=function(_0x2d24a1,_0x2a9341){_0x2d24a1=_0x2d24a1-0x0;var _0xa1dc5e=_0xb903[_0x2d24a1];return _0xa1dc5e;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3b90('0xc')],{'host':_0x3b90('0xd'),'port':0x18eb});var socket=require(_0x3b90('0xe'))(new Redis(config[_0x3b90('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x52401e,_0x51f916,_0x56261b){return new BPromise(function(_0x55db3f,_0x336913){return client[_0x3b90('0xf')](_0x52401e,_0x56261b)['then'](function(_0x30c49c){logger[_0x3b90('0x10')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x3b90('0x11'));logger[_0x3b90('0x12')](_0x3b90('0x13'),_0x51f916,'request\x20sent',JSON['stringify'](_0x30c49c));if(_0x30c49c[_0x3b90('0x14')]){if(_0x30c49c['error']['code']===0x1f4){logger[_0x3b90('0x14')](_0x3b90('0x15'),_0x51f916,_0x30c49c['error']['message']);return _0x336913(_0x30c49c[_0x3b90('0x14')][_0x3b90('0x16')]);}logger[_0x3b90('0x14')](_0x3b90('0x15'),_0x51f916,_0x30c49c[_0x3b90('0x14')]['message']);return _0x55db3f(_0x30c49c['error'][_0x3b90('0x16')]);}else{logger[_0x3b90('0x10')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x3b90('0x11'));_0x55db3f(_0x30c49c[_0x3b90('0x17')][_0x3b90('0x16')]);}})[_0x3b90('0x18')](function(_0x4f388b){logger[_0x3b90('0x14')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x4f388b);_0x336913(_0x4f388b);});});}exports[_0x3b90('0x19')]=function(_0x231690){var _0x535894=this;return new Promise(function(_0x39ae7c,_0x12e1cf){return db[_0x3b90('0x1a')][_0x3b90('0x1b')](_0x231690[_0x3b90('0x1c')],{'raw':_0x231690[_0x3b90('0x1d')]?_0x231690[_0x3b90('0x1d')][_0x3b90('0x1e')]===undefined?!![]:![]:!![]})[_0x3b90('0x1f')](function(_0x3e5bb8){logger['info'](_0x3b90('0x19'),_0x231690);logger[_0x3b90('0x12')](_0x3b90('0x19'),_0x231690,JSON[_0x3b90('0x20')](_0x3e5bb8));_0x39ae7c(_0x3e5bb8);})[_0x3b90('0x18')](function(_0x93b8e7){logger['error']('CreateFaxMessage',_0x93b8e7[_0x3b90('0x16')],_0x231690);_0x12e1cf(_0x535894[_0x3b90('0x14')](0x1f4,_0x93b8e7[_0x3b90('0x16')]));});});};exports[_0x3b90('0x21')]=function(_0x583523){var _0x414462=this;return new Promise(function(_0x2936d7,_0x1787d1){return db['FaxMessage'][_0x3b90('0x22')](_0x583523[_0x3b90('0x1c')],{'raw':_0x583523[_0x3b90('0x1d')]?_0x583523[_0x3b90('0x1d')][_0x3b90('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x583523[_0x3b90('0x1d')]?_0x583523['options'][_0x3b90('0x23')]||null:null,'attributes':_0x583523['options']?_0x583523[_0x3b90('0x1d')][_0x3b90('0x24')]||null:null,'limit':_0x583523[_0x3b90('0x1d')]?_0x583523[_0x3b90('0x1d')][_0x3b90('0x25')]||null:null})[_0x3b90('0x1f')](function(_0x290283){logger[_0x3b90('0x10')]('UpdateFaxMessage',_0x583523);logger['debug'](_0x3b90('0x21'),_0x583523,JSON[_0x3b90('0x20')](_0x290283));_0x2936d7(_0x290283);})[_0x3b90('0x18')](function(_0x1c2e84){logger['error']('UpdateFaxMessage',_0x1c2e84[_0x3b90('0x16')],_0x583523);_0x1787d1(_0x414462[_0x3b90('0x14')](0x1f4,_0x1c2e84[_0x3b90('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 7bf6ce3..407e195 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 _0x0098=['length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x4a9941,_0x476e36){var _0x48923c=function(_0x2e2f34){while(--_0x2e2f34){_0x4a9941['push'](_0x4a9941['shift']());}};_0x48923c(++_0x476e36);}(_0x0098,0x185));var _0x8009=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x0098[_0x5d2803];return _0xdcad2c;};'use strict';var FaxMessageEvents=require(_0x8009('0x0'));var events=[_0x8009('0x1'),_0x8009('0x2'),_0x8009('0x3')];function createListener(_0x4b2b3b,_0x573acd){return function(_0x3cfb2c){_0x573acd[_0x8009('0x4')](_0x4b2b3b,_0x3cfb2c);};}function removeListener(_0x12c472,_0x42dad1){return function(){FaxMessageEvents[_0x8009('0x5')](_0x12c472,_0x42dad1);};}exports[_0x8009('0x6')]=function(_0x4cd92f){for(var _0xe6d126=0x0,_0x363295=events[_0x8009('0x7')];_0xe6d126<_0x363295;_0xe6d126++){var _0x426ef5=events[_0xe6d126];var _0x42acac=createListener(_0x8009('0x8')+_0x426ef5,_0x4cd92f);FaxMessageEvents['on'](_0x426ef5,_0x42acac);}}; \ No newline at end of file +var _0xf16d=['faxMessage:','./faxMessage.events','save','remove','emit','length'];(function(_0x184ae2,_0x5ca67b){var _0x538f2b=function(_0x32c520){while(--_0x32c520){_0x184ae2['push'](_0x184ae2['shift']());}};_0x538f2b(++_0x5ca67b);}(_0xf16d,0x13f));var _0xdf16=function(_0x127e2,_0x24417a){_0x127e2=_0x127e2-0x0;var _0xacfacd=_0xf16d[_0x127e2];return _0xacfacd;};'use strict';var FaxMessageEvents=require(_0xdf16('0x0'));var events=[_0xdf16('0x1'),_0xdf16('0x2'),'update'];function createListener(_0x50bcda,_0x43c3fd){return function(_0xb63a0c){_0x43c3fd[_0xdf16('0x3')](_0x50bcda,_0xb63a0c);};}function removeListener(_0x43996c,_0x216425){return function(){FaxMessageEvents['removeListener'](_0x43996c,_0x216425);};}exports['register']=function(_0x2e899f){for(var _0x502653=0x0,_0x1ea9e4=events[_0xdf16('0x4')];_0x502653<_0x1ea9e4;_0x502653++){var _0x5f002e=events[_0x502653];var _0x564fee=createListener(_0xdf16('0x5')+_0x5f002e,_0x2e899f);FaxMessageEvents['on'](_0x5f002e,_0x564fee);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index e48a32a..8d81219 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 _0x1be1=['create','put','update','/:id/accept','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','describe','/:id','/:id/download','download','post','tracked','faxmessage:create'];(function(_0x305486,_0x24acd4){var _0xa04940=function(_0x29e866){while(--_0x29e866){_0x305486['push'](_0x305486['shift']());}};_0xa04940(++_0x24acd4);}(_0x1be1,0x192));var _0x11be=function(_0x1f68c7,_0x46a99c){_0x1f68c7=_0x1f68c7-0x0;var _0x5b2217=_0x1be1[_0x1f68c7];return _0x5b2217;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/describe',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0x7')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller['show']);router[_0x11be('0x7')](_0x11be('0xb'),auth['isAuthenticated'](),controller[_0x11be('0xc')]);router[_0x11be('0xd')]('/',auth[_0x11be('0x8')](),interaction[_0x11be('0xe')]('fax',_0x11be('0xf')),controller[_0x11be('0x10')]);router[_0x11be('0x11')]('/:id',auth[_0x11be('0x8')](),controller[_0x11be('0x12')]);router['put'](_0x11be('0x13'),auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router['delete'](_0x11be('0xa'),auth['isAuthenticated'](),controller[_0x11be('0x14')]);module[_0x11be('0x15')]=router; \ No newline at end of file +var _0x9bde=['index','/describe','isAuthenticated','describe','/:id','show','download','post','fax','faxmessage:create','create','put','/:id/accept','/:id/reject','reject','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get'];(function(_0x1be814,_0x475cfe){var _0x22eee5=function(_0x5928f9){while(--_0x5928f9){_0x1be814['push'](_0x1be814['shift']());}};_0x22eee5(++_0x475cfe);}(_0x9bde,0xe1));var _0xe9bd=function(_0x22b550,_0x10ab61){_0x22b550=_0x22b550-0x0;var _0x3da430=_0x9bde[_0x22b550];return _0x3da430;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var fs_extra=require(_0xe9bd('0x3'));var auth=require(_0xe9bd('0x4'));var interaction=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var controller=require(_0xe9bd('0x7'));router[_0xe9bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9bd('0x9')]);router[_0xe9bd('0x8')](_0xe9bd('0xa'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0x8')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xe')]);router[_0xe9bd('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xe9bd('0xf')]);router[_0xe9bd('0x10')]('/',auth[_0xe9bd('0xb')](),interaction['tracked'](_0xe9bd('0x11'),_0xe9bd('0x12')),controller[_0xe9bd('0x13')]);router[_0xe9bd('0x14')]('/:id',auth[_0xe9bd('0xb')](),controller['update']);router[_0xe9bd('0x14')](_0xe9bd('0x15'),auth[_0xe9bd('0xb')](),controller['accept']);router['put'](_0xe9bd('0x16'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x17')]);router[_0xe9bd('0x18')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 3db2fe0..3c2aec6 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 _0xb89f=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x356596,_0x1a1a8c){var _0x231fa9=function(_0x2b0a09){while(--_0x2b0a09){_0x356596['push'](_0x356596['shift']());}};_0x231fa9(++_0x1a1a8c);}(_0xb89f,0x16a));var _0xfb89=function(_0x460276,_0x150705){_0x460276=_0x460276-0x0;var _0x354a2c=_0xb89f[_0x460276];return _0x354a2c;};'use strict';var Sequelize=require(_0xfb89('0x0'));module[_0xfb89('0x1')]={'name':{'type':Sequelize[_0xfb89('0x2')],'unique':_0xfb89('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfb89('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfb89('0x5')](_0xfb89('0x6'),_0xfb89('0x7'),_0xfb89('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xfb89('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8710=['exports','name','STRING','INTEGER','rrmemory','beepall','sequelize'];(function(_0x5d7747,_0x55c074){var _0x291142=function(_0x221f7d){while(--_0x221f7d){_0x5d7747['push'](_0x5d7747['shift']());}};_0x291142(++_0x55c074);}(_0x8710,0x68));var _0x0871=function(_0x2bb783,_0x20576e){_0x2bb783=_0x2bb783-0x0;var _0x5c5fe1=_0x8710[_0x2bb783];return _0x5c5fe1;};'use strict';var Sequelize=require(_0x0871('0x0'));module[_0x0871('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0871('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0871('0x3')]},'timeout':{'type':Sequelize[_0x0871('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0871('0x5'),_0x0871('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x0871('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 0b0cea6..ad95052 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 _0x9541=['body','describe','getMembers','findOne','UserFaxQueue','nolimit','limit','order','sort','filters','pick','FaxQueueId','filter','User','createdAt','format','%s/%s','SIP','faxPause','updatedAt','getTeams','Team','length','hasOwnProperty','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','emit','userFaxQueue:save','select','field','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','all','union','removeTeams','isEmpty','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','undefined','count','offset','set','Content-Range','json','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','send','index','map','FaxQueue','rawAttributes','type','key','where','include','query','findAll','rows','catch','show','params','model','keys','intersection','fields','attributes','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0x9541,0xb3));var _0x1954=function(_0x2229cf,_0x29dcc4){_0x2229cf=_0x2229cf-0x0;var _0x4c92f0=_0x9541[_0x2229cf];return _0x4c92f0;};'use strict';var BPromise=require(_0x1954('0x0'));var util=require(_0x1954('0x1'));var _=require(_0x1954('0x2'));var squel=require(_0x1954('0x3'));var Redis=require(_0x1954('0x4'));var qs=require(_0x1954('0x5'));var logger=require(_0x1954('0x6'))(_0x1954('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x1954('0x8')]=_[_0x1954('0x9')](config['redis'],{'host':_0x1954('0xa'),'port':0x18eb});var socket=require(_0x1954('0xb'))(new Redis(config[_0x1954('0x8')]));require(_0x1954('0xc'))[_0x1954('0xd')](socket);function respondWithStatusCode(_0xa7a784,_0x5d95b1){_0x5d95b1=_0x5d95b1||0xcc;return function(_0x22752d){if(_0x22752d){return _0xa7a784[_0x1954('0xe')](_0x5d95b1);}return _0xa7a784[_0x1954('0xf')](_0x5d95b1)[_0x1954('0x10')]();};}function respondWithResult(_0x40bbfb,_0x1733f8){_0x1733f8=_0x1733f8||0xc8;return function(_0x2f711d){if(_0x2f711d){return _0x40bbfb[_0x1954('0xf')](_0x1733f8)['json'](_0x2f711d);}};}function respondWithFilteredResult(_0x39e5fe,_0x2e1fb4){return function(_0x51a041){if(_0x51a041){var _0x267cfc=typeof _0x2e1fb4['offset']===_0x1954('0x11')&&typeof _0x2e1fb4['limit']==='undefined';var _0x5bfd52=_0x51a041[_0x1954('0x12')];var _0x1b33cb=_0x267cfc?0x0:_0x2e1fb4[_0x1954('0x13')];var _0x520dc7=_0x267cfc?_0x51a041[_0x1954('0x12')]:_0x2e1fb4['offset']+_0x2e1fb4['limit'];var _0xaeb0e3;if(_0x520dc7>=_0x5bfd52){_0x520dc7=_0x5bfd52;_0xaeb0e3=0xc8;}else{_0xaeb0e3=0xce;}_0x39e5fe[_0x1954('0xf')](_0xaeb0e3);return _0x39e5fe[_0x1954('0x14')](_0x1954('0x15'),_0x1b33cb+'-'+_0x520dc7+'/'+_0x5bfd52)[_0x1954('0x16')](_0x51a041);}return null;};}function saveUpdates(_0x37f4fc){return function(_0x166641){if(_0x166641){return _0x166641[_0x1954('0x17')](_0x37f4fc)[_0x1954('0x18')](function(_0xb9c2cd){return _0xb9c2cd;});}return null;};}function removeEntity(_0xc8cb0b){return function(_0x3da757){if(_0x3da757){return _0x3da757[_0x1954('0x19')]()[_0x1954('0x18')](function(){var _0x1db9f1=_0x3da757[_0x1954('0x1a')]({'plain':!![]});var _0x286ff1=_0x1954('0x1b');return db[_0x1954('0x1c')][_0x1954('0x19')]({'where':{'type':_0x286ff1,'resourceId':_0x1db9f1['id']}})['then'](function(){return _0x3da757;});})[_0x1954('0x18')](function(){_0xc8cb0b[_0x1954('0xf')](0xcc)[_0x1954('0x10')]();});}};}function handleEntityNotFound(_0x4455be){return function(_0x193f8f){if(!_0x193f8f){_0x4455be['sendStatus'](0x194);}return _0x193f8f;};}function handleError(_0x61107d,_0x15dd0b){_0x15dd0b=_0x15dd0b||0x1f4;return function(_0x5ea2c3){logger[_0x1954('0x1d')](_0x5ea2c3[_0x1954('0x1e')]);if(_0x5ea2c3['name']){delete _0x5ea2c3['name'];}_0x61107d[_0x1954('0xf')](_0x15dd0b)[_0x1954('0x1f')](_0x5ea2c3);};}exports[_0x1954('0x20')]=function(_0x406699,_0x5c1b19){var _0x21f395={};var _0x26484f={'count':0x0,'rows':[]};var _0x27dc66=_[_0x1954('0x21')](db[_0x1954('0x22')][_0x1954('0x23')],function(_0x46fdc1){return{'name':_0x46fdc1['fieldName'],'type':_0x46fdc1[_0x1954('0x24')][_0x1954('0x25')]};});_0x21f395=qs['getOptions'](_0x27dc66,_0x406699);var _0x14e94e={'where':_0x21f395[_0x1954('0x26')]};return db[_0x1954('0x22')][_0x1954('0x12')](_0x14e94e)[_0x1954('0x18')](function(_0x251386){_0x26484f[_0x1954('0x12')]=_0x251386;_0x21f395[_0x1954('0x27')]=qs[_0x1954('0x27')](_0x406699[_0x1954('0x28')]);return db[_0x1954('0x22')][_0x1954('0x29')](_0x21f395);})[_0x1954('0x18')](function(_0x22509c){_0x26484f[_0x1954('0x2a')]=_0x22509c;return _0x26484f;})[_0x1954('0x18')](respondWithFilteredResult(_0x5c1b19,_0x21f395))[_0x1954('0x2b')](handleError(_0x5c1b19,null));};exports[_0x1954('0x2c')]=function(_0x109312,_0x24032d){var _0x1bcf3a={'raw':!![],'where':{'id':_0x109312[_0x1954('0x2d')]['id']}},_0x2fe88d={};_0x2fe88d[_0x1954('0x2e')]=_['keys'](db['FaxQueue'][_0x1954('0x23')]);_0x2fe88d['query']=_[_0x1954('0x2f')](_0x109312[_0x1954('0x28')]);_0x2fe88d['filters']=_[_0x1954('0x30')](_0x2fe88d[_0x1954('0x2e')],_0x2fe88d['query']);_0x1bcf3a['attributes']=_[_0x1954('0x30')](_0x2fe88d[_0x1954('0x2e')],qs[_0x1954('0x31')](_0x109312[_0x1954('0x28')][_0x1954('0x31')]));_0x1bcf3a[_0x1954('0x32')]=_0x1bcf3a[_0x1954('0x32')]['length']?_0x1bcf3a['attributes']:_0x2fe88d[_0x1954('0x2e')];if(_0x109312[_0x1954('0x28')][_0x1954('0x33')]){_0x1bcf3a[_0x1954('0x27')]=[{'all':!![]}];}_0x1bcf3a=_[_0x1954('0x34')]({},_0x1bcf3a,_0x109312[_0x1954('0x35')]);return db['FaxQueue'][_0x1954('0x36')](_0x1bcf3a)[_0x1954('0x18')](handleEntityNotFound(_0x24032d,null))['then'](respondWithResult(_0x24032d,null))[_0x1954('0x2b')](handleError(_0x24032d,null));};exports[_0x1954('0x37')]=function(_0x524eeb,_0x580990){return db[_0x1954('0x22')][_0x1954('0x37')](_0x524eeb['body'],{})[_0x1954('0x18')](function(_0x341681){var _0x13725c=_0x524eeb[_0x1954('0x38')]['get']({'plain':!![]});if(!_0x13725c)throw new Error(_0x1954('0x39'));if(_0x13725c['role']===_0x1954('0x38')){var _0x3c3e3f=_0x341681[_0x1954('0x1a')]({'plain':!![]});var _0x57812c=_0x1954('0x1b');return db[_0x1954('0x3a')][_0x1954('0x36')]({'where':{'name':_0x57812c,'userProfileId':_0x13725c[_0x1954('0x3b')]},'raw':!![]})[_0x1954('0x18')](function(_0x517492){if(_0x517492&&_0x517492[_0x1954('0x3c')]===0x0){return db['UserProfileResource'][_0x1954('0x37')]({'name':_0x3c3e3f['name'],'resourceId':_0x3c3e3f['id'],'type':_0x517492[_0x1954('0x3d')],'sectionId':_0x517492['id']},{})[_0x1954('0x18')](function(){return _0x341681;});}else{return _0x341681;}})[_0x1954('0x2b')](function(_0x4334f9){logger['error'](_0x1954('0x3e'),_0x4334f9);throw _0x4334f9;});}return _0x341681;})['then'](respondWithResult(_0x580990,0xc9))[_0x1954('0x2b')](handleError(_0x580990,null));};exports[_0x1954('0x17')]=function(_0x59c4cb,_0x1dede8){if(_0x59c4cb[_0x1954('0x3f')]['id']){delete _0x59c4cb[_0x1954('0x3f')]['id'];}return db[_0x1954('0x22')][_0x1954('0x36')]({'where':{'id':_0x59c4cb[_0x1954('0x2d')]['id']}})[_0x1954('0x18')](handleEntityNotFound(_0x1dede8,null))[_0x1954('0x18')](saveUpdates(_0x59c4cb[_0x1954('0x3f')],null))['then'](respondWithResult(_0x1dede8,null))['catch'](handleError(_0x1dede8,null));};exports['destroy']=function(_0x259a45,_0x55f465){return db[_0x1954('0x22')][_0x1954('0x36')]({'where':{'id':_0x259a45[_0x1954('0x2d')]['id']}})[_0x1954('0x18')](handleEntityNotFound(_0x55f465,null))[_0x1954('0x18')](removeEntity(_0x55f465,null))[_0x1954('0x2b')](handleError(_0x55f465,null));};exports[_0x1954('0x40')]=function(_0x439862,_0x15243c){return db['FaxQueue']['describe']()[_0x1954('0x18')](respondWithResult(_0x15243c,null))['catch'](handleError(_0x15243c,null));};exports[_0x1954('0x41')]=function(_0x4e0359,_0x109b3e){var _0x8aeb7={'raw':!![],'where':{}},_0x231c42={},_0x3ab299;return db[_0x1954('0x22')][_0x1954('0x42')]({'where':{'id':_0x4e0359[_0x1954('0x2d')]['id']}})[_0x1954('0x18')](handleEntityNotFound(_0x109b3e,null))[_0x1954('0x18')](function(_0x2dd24d){if(_0x2dd24d){_0x3ab299=_0x2dd24d['get']({'plain':!![]});_0x231c42[_0x1954('0x2e')]=_[_0x1954('0x2f')](db[_0x1954('0x43')][_0x1954('0x23')]);_0x231c42['query']=_[_0x1954('0x2f')](_0x4e0359[_0x1954('0x28')]);_0x231c42['filters']=_[_0x1954('0x30')](_0x231c42['model'],_0x231c42[_0x1954('0x28')]);_0x8aeb7[_0x1954('0x32')]=_[_0x1954('0x30')](_0x231c42[_0x1954('0x2e')],qs[_0x1954('0x31')](_0x4e0359[_0x1954('0x28')][_0x1954('0x31')]));_0x8aeb7['attributes']=_0x8aeb7[_0x1954('0x32')]['length']?_0x8aeb7[_0x1954('0x32')]:_0x231c42[_0x1954('0x2e')];if(!_0x4e0359[_0x1954('0x28')]['hasOwnProperty'](_0x1954('0x44'))){_0x8aeb7[_0x1954('0x45')]=qs[_0x1954('0x45')](_0x4e0359[_0x1954('0x28')][_0x1954('0x45')]);_0x8aeb7['offset']=qs[_0x1954('0x13')](_0x4e0359[_0x1954('0x28')][_0x1954('0x13')]);}_0x8aeb7[_0x1954('0x46')]=qs[_0x1954('0x47')](_0x4e0359['query'][_0x1954('0x47')]);_0x8aeb7[_0x1954('0x26')]=qs[_0x1954('0x48')](_[_0x1954('0x49')](_0x4e0359[_0x1954('0x28')],_0x231c42[_0x1954('0x48')]));_0x8aeb7[_0x1954('0x26')][_0x1954('0x4a')]=_0x2dd24d['id'];if(_0x4e0359[_0x1954('0x28')]['filter']){_0x8aeb7[_0x1954('0x26')]=_[_0x1954('0x34')](_0x8aeb7[_0x1954('0x26')],{'$or':_[_0x1954('0x21')](_0x8aeb7[_0x1954('0x32')],function(_0x2e2943){var _0x1fa09b={};_0x1fa09b[_0x2e2943]={'$like':'%'+_0x4e0359[_0x1954('0x28')][_0x1954('0x4b')]+'%'};return _0x1fa09b;})});}_0x8aeb7=_[_0x1954('0x34')]({},_0x8aeb7,_0x4e0359[_0x1954('0x35')]);return db[_0x1954('0x43')][_0x1954('0x29')](_0x8aeb7);}})[_0x1954('0x18')](function(_0x1ad607){if(_0x1ad607){return db[_0x1954('0x4c')]['findAndCountAll']({'where':{'id':_['map'](_0x1ad607,'UserId'),'role':'agent'},'attributes':['id',_0x1954('0x3d'),'faxPause','updatedAt',_0x1954('0x4d')]});}})[_0x1954('0x18')](function(_0x989a6d){if(_0x989a6d){return{'count':_0x989a6d[_0x1954('0x12')],'rows':_[_0x1954('0x21')](_0x989a6d['rows'],function(_0x4a900c){return{'membername':_0x4a900c[_0x1954('0x3d')],'UserId':_0x4a900c['id'],'queue_name':_0x3ab299[_0x1954('0x3d')],'FaxQueueId':_0x3ab299['id'],'interface':util[_0x1954('0x4e')](_0x1954('0x4f'),_0x1954('0x50'),_0x4a900c[_0x1954('0x3d')]),'penalty':0x0,'paused':_0x4a900c[_0x1954('0x51')],'createdAt':_0x4a900c[_0x1954('0x4d')],'updatedAt':_0x4a900c[_0x1954('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x109b3e,_0x8aeb7))[_0x1954('0x2b')](handleError(_0x109b3e,null));};exports[_0x1954('0x53')]=function(_0xae43df,_0x4e6a10){var _0x2480d2={};var _0x28bca8={};var _0x2d0777;var _0x4ad813;return db[_0x1954('0x22')]['findOne']({'where':{'id':_0xae43df[_0x1954('0x2d')]['id']}})[_0x1954('0x18')](handleEntityNotFound(_0x4e6a10,null))[_0x1954('0x18')](function(_0xb7601d){if(_0xb7601d){_0x2d0777=_0xb7601d;_0x28bca8[_0x1954('0x2e')]=_[_0x1954('0x2f')](db[_0x1954('0x54')][_0x1954('0x23')]);_0x28bca8[_0x1954('0x28')]=_['keys'](_0xae43df[_0x1954('0x28')]);_0x28bca8[_0x1954('0x48')]=_['intersection'](_0x28bca8[_0x1954('0x2e')],_0x28bca8[_0x1954('0x28')]);_0x2480d2[_0x1954('0x32')]=_[_0x1954('0x30')](_0x28bca8['model'],qs[_0x1954('0x31')](_0xae43df[_0x1954('0x28')][_0x1954('0x31')]));_0x2480d2[_0x1954('0x32')]=_0x2480d2[_0x1954('0x32')][_0x1954('0x55')]?_0x2480d2[_0x1954('0x32')]:_0x28bca8[_0x1954('0x2e')];_0x2480d2['order']=qs['sort'](_0xae43df[_0x1954('0x28')]['sort']);_0x2480d2[_0x1954('0x26')]=qs['filters'](_[_0x1954('0x49')](_0xae43df[_0x1954('0x28')],_0x28bca8[_0x1954('0x48')]));if(_0xae43df['query'][_0x1954('0x4b')]){_0x2480d2[_0x1954('0x26')]=_[_0x1954('0x34')](_0x2480d2['where'],{'$or':_['map'](_0x2480d2[_0x1954('0x32')],function(_0x30b981){var _0x466758={};_0x466758[_0x30b981]={'$like':'%'+_0xae43df[_0x1954('0x28')]['filter']+'%'};return _0x466758;})});}_0x2480d2=_[_0x1954('0x34')]({},_0x2480d2,_0xae43df['options']);return _0x2d0777['getTeams'](_0x2480d2);}})['then'](function(_0x3b7520){if(_0x3b7520){_0x4ad813=_0x3b7520[_0x1954('0x55')];if(!_0xae43df[_0x1954('0x28')][_0x1954('0x56')]('nolimit')){_0x2480d2[_0x1954('0x45')]=qs[_0x1954('0x45')](_0xae43df['query'][_0x1954('0x45')]);_0x2480d2[_0x1954('0x13')]=qs[_0x1954('0x13')](_0xae43df[_0x1954('0x28')][_0x1954('0x13')]);}return _0x2d0777['getTeams'](_0x2480d2);}})[_0x1954('0x18')](function(_0x22f6d3){if(_0x22f6d3){return _0x22f6d3?{'count':_0x4ad813,'rows':_0x22f6d3}:null;}})['then'](respondWithResult(_0x4e6a10,null))['catch'](handleError(_0x4e6a10,null));};exports[_0x1954('0x57')]=function(_0x3d2f01,_0x565769){var _0x126ca6=_0x3d2f01[_0x1954('0x3f')][_0x1954('0x58')];return db['Team'][_0x1954('0x29')]({'where':{'id':_0x126ca6},'attributes':['id'],'include':[{'model':db[_0x1954('0x4c')],'as':_0x1954('0x59'),'attributes':['id',_0x1954('0x3d'),_0x1954('0x5a'),_0x1954('0x5b'),'interface'],'raw':!![]}]})[_0x1954('0x18')](function(_0x1bfc1d){if(_0x1bfc1d){var _0x38ef05=_[_0x1954('0x5c')](_0x1bfc1d,function(_0x23c24f){var _0x3ad0d9=_0x23c24f[_0x1954('0x1a')]({'plain':!![]});return _0x3ad0d9[_0x1954('0x59')];});return db[_0x1954('0x22')][_0x1954('0x36')]({'where':{'id':_0x3d2f01[_0x1954('0x2d')]['id']}})[_0x1954('0x18')](function(_0x1e8879){return db[_0x1954('0x5d')][_0x1954('0x5e')](function(_0x3479ef){return _0x1e8879['addTeams'](_0x126ca6,{'transaction':_0x3479ef})['then'](function(){return BPromise[_0x1954('0x5f')](_0x38ef05,function(_0x183efe){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x183efe['id'],'FaxQueueId':_0x3d2f01[_0x1954('0x2d')]['id']},'transaction':_0x3479ef});});})[_0x1954('0x18')](function(){_0x38ef05['forEach'](function(_0xa82f38){socket[_0x1954('0x60')](_0x1954('0x61'),{'UserId':_0xa82f38['id'],'FaxQueueId':_0x1e8879['id']});});});});});}})['then'](respondWithStatusCode(_0x565769,null))['catch'](handleError(_0x565769,null));};exports['removeTeams']=function(_0x5c206f,_0x364c64){return db[_0x1954('0x54')][_0x1954('0x29')]({'where':{'id':_0x5c206f[_0x1954('0x28')][_0x1954('0x58')]},'attributes':['id'],'include':[{'model':db[_0x1954('0x4c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1954('0x18')](handleEntityNotFound(_0x364c64,null))[_0x1954('0x18')](function(_0x38a188){var _0x2d04a0=_['map'](_0x38a188,'id');var _0x16c259=[];var _0x28c0a2=[];var _0x1a7cc7=squel[_0x1954('0x62')]();_0x1a7cc7[_0x1954('0x63')]('tq.TeamId')['from'](_0x1954('0x64'),'tq')[_0x1954('0x65')](_0x1954('0x66'),'ut',_0x1954('0x67'))[_0x1954('0x26')](_0x1954('0x68'),_0x5c206f[_0x1954('0x2d')]['id']);for(var _0x2b1453=0x0;_0x2b1453<_0x38a188[_0x1954('0x55')];_0x2b1453+=0x1){let _0x18553e=_0x38a188[_0x2b1453];for(var _0x2bd8ba=0x0;_0x2bd8ba<_0x18553e[_0x1954('0x59')][_0x1954('0x55')];_0x2bd8ba+=0x1){let _0x3985f5=_0x18553e[_0x1954('0x59')][_0x2bd8ba];var _0x340738=_0x1a7cc7[_0x1954('0x69')]();_0x340738[_0x1954('0x26')](_0x1954('0x6a'),_0x3985f5['id']);_0x28c0a2[_0x1954('0x6b')](db[_0x1954('0x5d')][_0x1954('0x28')](_0x340738[_0x1954('0x6c')](),{'type':db[_0x1954('0x5d')]['QueryTypes']['SELECT']})[_0x1954('0x18')](function(_0x2ac068){if(_0x2ac068['length']===0x1){return _0x3985f5['id'];}else{var _0x38cf87=_[_0x1954('0x6d')](_['map'](_0x2ac068,'TeamId'),function(_0x4ade20){return _['includes'](_0x2d04a0,_0x4ade20);});if(_0x38cf87){return _0x3985f5['id'];}}}));}}return BPromise[_0x1954('0x6e')](_0x28c0a2)[_0x1954('0x18')](function(_0x95a2fb){_0x16c259=_(_0x16c259)[_0x1954('0x6f')](_0x95a2fb)['compact']()['value']();return db[_0x1954('0x22')][_0x1954('0x36')]({'where':{'id':_0x5c206f['params']['id']}})[_0x1954('0x18')](function(_0x25c2f5){return db[_0x1954('0x5d')][_0x1954('0x5e')](function(_0x15be76){return _0x25c2f5[_0x1954('0x70')](_0x5c206f[_0x1954('0x28')][_0x1954('0x58')],{'transaction':_0x15be76})['then'](function(){if(!_[_0x1954('0x71')](_0x16c259)){return _0x25c2f5['removeAgents'](_0x16c259,{'transaction':_0x15be76});}})[_0x1954('0x18')](function(){_0x16c259['forEach'](function(_0x174104){socket['emit'](_0x1954('0x72'),{'UserId':_0x174104,'FaxQueueId':_0x25c2f5['id']});});});});});});})['then'](respondWithStatusCode(_0x364c64,null))[_0x1954('0x2b')](handleError(_0x364c64,null));};exports['addAgents']=function(_0x5161ff,_0x15c502){return db['FaxQueue'][_0x1954('0x36')]({'where':{'id':_0x5161ff['params']['id']}})['then'](handleEntityNotFound(_0x15c502,null))[_0x1954('0x18')](function(_0x456d83){if(_0x456d83){return _0x456d83[_0x1954('0x73')](_0x5161ff[_0x1954('0x3f')][_0x1954('0x58')],_[_0x1954('0x74')](_0x5161ff[_0x1954('0x3f')],['ids','id'])||{})[_0x1954('0x75')](function(_0xf82bfb){for(var _0x16ab2b=0x0;_0x16ab2b<_0x5161ff[_0x1954('0x3f')][_0x1954('0x58')][_0x1954('0x55')];_0x16ab2b+=0x1){socket[_0x1954('0x60')](_0x1954('0x61'),{'UserId':Number(_0x5161ff['body'][_0x1954('0x58')][_0x16ab2b]),'FaxQueueId':Number(_0x5161ff[_0x1954('0x2d')]['id'])});}return _0xf82bfb;});}})['then'](respondWithResult(_0x15c502,null))[_0x1954('0x2b')](handleError(_0x15c502,null));};exports[_0x1954('0x76')]=function(_0x284a27,_0x4b9697){return db[_0x1954('0x22')][_0x1954('0x36')]({'where':{'id':_0x284a27[_0x1954('0x2d')]['id']}})[_0x1954('0x18')](handleEntityNotFound(_0x4b9697,null))['then'](function(_0x19f88c){if(_0x19f88c){return _0x19f88c[_0x1954('0x76')](_0x284a27[_0x1954('0x28')][_0x1954('0x58')])['then'](function(){if(_[_0x1954('0x77')](_0x284a27['query'][_0x1954('0x58')])){for(var _0x17b9e1=0x0;_0x17b9e1<_0x284a27[_0x1954('0x28')]['ids'][_0x1954('0x55')];_0x17b9e1+=0x1){socket[_0x1954('0x60')]('userFaxQueue:remove',{'UserId':Number(_0x284a27[_0x1954('0x28')][_0x1954('0x58')][_0x17b9e1]),'FaxQueueId':Number(_0x284a27[_0x1954('0x2d')]['id'])});}}else{socket[_0x1954('0x60')](_0x1954('0x72'),{'UserId':Number(_0x284a27['query']['ids']),'FaxQueueId':Number(_0x284a27[_0x1954('0x2d')]['id'])});}});}})[_0x1954('0x18')](respondWithStatusCode(_0x4b9697,null))[_0x1954('0x2b')](handleError(_0x4b9697,null));};exports[_0x1954('0x78')]=function(_0x51503f,_0x2d4258){var _0x4a2752={};var _0x9f2f79={};var _0x36ae1b;var _0x44e09e;return db['FaxQueue'][_0x1954('0x42')]({'where':{'id':_0x51503f[_0x1954('0x2d')]['id']}})['then'](handleEntityNotFound(_0x2d4258,null))[_0x1954('0x18')](function(_0x14418b){if(_0x14418b){_0x36ae1b=_0x14418b;_0x9f2f79[_0x1954('0x2e')]=_[_0x1954('0x2f')](db[_0x1954('0x4c')][_0x1954('0x23')]);_0x9f2f79[_0x1954('0x28')]=_[_0x1954('0x2f')](_0x51503f[_0x1954('0x28')]);_0x9f2f79['filters']=_[_0x1954('0x30')](_0x9f2f79[_0x1954('0x2e')],_0x9f2f79[_0x1954('0x28')]);_0x4a2752[_0x1954('0x32')]=_[_0x1954('0x30')](_0x9f2f79[_0x1954('0x2e')],qs[_0x1954('0x31')](_0x51503f[_0x1954('0x28')][_0x1954('0x31')]));_0x4a2752['attributes']=_0x4a2752[_0x1954('0x32')][_0x1954('0x55')]?_0x4a2752[_0x1954('0x32')]:_0x9f2f79[_0x1954('0x2e')];_0x4a2752['order']=qs[_0x1954('0x47')](_0x51503f['query'][_0x1954('0x47')]);_0x4a2752[_0x1954('0x26')]=qs[_0x1954('0x48')](_[_0x1954('0x49')](_0x51503f[_0x1954('0x28')],_0x9f2f79[_0x1954('0x48')]));if(_0x51503f['query']['filter']){_0x4a2752[_0x1954('0x26')]=_[_0x1954('0x34')](_0x4a2752[_0x1954('0x26')],{'$or':_[_0x1954('0x21')](_0x4a2752['attributes'],function(_0x8a2d29){var _0x155d00={};_0x155d00[_0x8a2d29]={'$like':'%'+_0x51503f[_0x1954('0x28')]['filter']+'%'};return _0x155d00;})});}_0x4a2752=_[_0x1954('0x34')]({},_0x4a2752,_0x51503f[_0x1954('0x35')]);return _0x36ae1b[_0x1954('0x78')](_0x4a2752);}})['then'](function(_0x2e88f5){if(_0x2e88f5){_0x44e09e=_0x2e88f5['length'];if(!_0x51503f['query']['hasOwnProperty'](_0x1954('0x44'))){_0x4a2752[_0x1954('0x45')]=qs['limit'](_0x51503f[_0x1954('0x28')][_0x1954('0x45')]);_0x4a2752[_0x1954('0x13')]=qs[_0x1954('0x13')](_0x51503f[_0x1954('0x28')]['offset']);}return _0x36ae1b['getAgents'](_0x4a2752);}})[_0x1954('0x18')](function(_0x5990a1){if(_0x5990a1){return _0x5990a1?{'count':_0x44e09e,'rows':_0x5990a1}:null;}})[_0x1954('0x18')](respondWithResult(_0x2d4258,null))[_0x1954('0x2b')](handleError(_0x2d4258,null));}; \ No newline at end of file +var _0x11e5=['ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','addAgents','omit','spread','removeAgents','isArray','userFaxQueue:remove','getAgents','bluebird','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','FaxQueues','UserProfileResource','destroy','then','error','stack','name','map','FaxQueue','rawAttributes','fieldName','type','key','getOptions','include','findAll','rows','show','model','keys','query','filters','attributes','intersection','length','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','params','UserFaxQueue','fields','hasOwnProperty','nolimit','sort','where','pick','FaxQueueId','filter','User','findAndCountAll','UserId','faxPause','format','SIP','updatedAt','Team','getTeams','addTeams','ids','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone'];(function(_0x13c890,_0xffea04){var _0x4bbbae=function(_0x1cfa34){while(--_0x1cfa34){_0x13c890['push'](_0x13c890['shift']());}};_0x4bbbae(++_0xffea04);}(_0x11e5,0x8b));var _0x511e=function(_0x5463c2,_0x22c4cc){_0x5463c2=_0x5463c2-0x0;var _0x5a7da7=_0x11e5[_0x5463c2];return _0x5a7da7;};'use strict';var BPromise=require(_0x511e('0x0'));var util=require('util');var _=require(_0x511e('0x1'));var squel=require(_0x511e('0x2'));var Redis=require('ioredis');var qs=require(_0x511e('0x3'));var logger=require(_0x511e('0x4'))(_0x511e('0x5'));var config=require('../../config/environment');var db=require(_0x511e('0x6'))['db'];config['redis']=_['defaults'](config[_0x511e('0x7')],{'host':_0x511e('0x8'),'port':0x18eb});var socket=require(_0x511e('0x9'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x511e('0xa')](socket);function respondWithStatusCode(_0xf0ba86,_0x25deeb){_0x25deeb=_0x25deeb||0xcc;return function(_0x306694){if(_0x306694){return _0xf0ba86[_0x511e('0xb')](_0x25deeb);}return _0xf0ba86[_0x511e('0xc')](_0x25deeb)[_0x511e('0xd')]();};}function respondWithResult(_0x50564b,_0x2f547a){_0x2f547a=_0x2f547a||0xc8;return function(_0x1c6def){if(_0x1c6def){return _0x50564b[_0x511e('0xc')](_0x2f547a)['json'](_0x1c6def);}};}function respondWithFilteredResult(_0x7e50db,_0x5dd510){return function(_0x4d041f){if(_0x4d041f){var _0x3deecc=typeof _0x5dd510[_0x511e('0xe')]===_0x511e('0xf')&&typeof _0x5dd510[_0x511e('0x10')]===_0x511e('0xf');var _0x7dc1bc=_0x4d041f['count'];var _0xdd0dcd=_0x3deecc?0x0:_0x5dd510[_0x511e('0xe')];var _0x4e6507=_0x3deecc?_0x4d041f[_0x511e('0x11')]:_0x5dd510[_0x511e('0xe')]+_0x5dd510['limit'];var _0xed773e;if(_0x4e6507>=_0x7dc1bc){_0x4e6507=_0x7dc1bc;_0xed773e=0xc8;}else{_0xed773e=0xce;}_0x7e50db[_0x511e('0xc')](_0xed773e);return _0x7e50db[_0x511e('0x12')](_0x511e('0x13'),_0xdd0dcd+'-'+_0x4e6507+'/'+_0x7dc1bc)['json'](_0x4d041f);}return null;};}function saveUpdates(_0x3e0415){return function(_0x2dd346){if(_0x2dd346){return _0x2dd346[_0x511e('0x14')](_0x3e0415)['then'](function(_0x26af67){return _0x26af67;});}return null;};}function removeEntity(_0x5bd814){return function(_0x34e6cd){if(_0x34e6cd){return _0x34e6cd['destroy']()['then'](function(){var _0x37ae92=_0x34e6cd['get']({'plain':!![]});var _0x33bef5=_0x511e('0x15');return db[_0x511e('0x16')][_0x511e('0x17')]({'where':{'type':_0x33bef5,'resourceId':_0x37ae92['id']}})[_0x511e('0x18')](function(){return _0x34e6cd;});})[_0x511e('0x18')](function(){_0x5bd814[_0x511e('0xc')](0xcc)[_0x511e('0xd')]();});}};}function handleEntityNotFound(_0x4a8067){return function(_0x1e2b41){if(!_0x1e2b41){_0x4a8067[_0x511e('0xb')](0x194);}return _0x1e2b41;};}function handleError(_0x2ebf30,_0x1a273b){_0x1a273b=_0x1a273b||0x1f4;return function(_0xaea29d){logger[_0x511e('0x19')](_0xaea29d[_0x511e('0x1a')]);if(_0xaea29d[_0x511e('0x1b')]){delete _0xaea29d[_0x511e('0x1b')];}_0x2ebf30[_0x511e('0xc')](_0x1a273b)['send'](_0xaea29d);};}exports['index']=function(_0x3e1711,_0x4d94a1){var _0x1ff5c4={};var _0x53017d={'count':0x0,'rows':[]};var _0x3fbd19=_[_0x511e('0x1c')](db[_0x511e('0x1d')][_0x511e('0x1e')],function(_0x1bb7f9){return{'name':_0x1bb7f9[_0x511e('0x1f')],'type':_0x1bb7f9[_0x511e('0x20')][_0x511e('0x21')]};});_0x1ff5c4=qs[_0x511e('0x22')](_0x3fbd19,_0x3e1711);var _0x2451c2={'where':_0x1ff5c4['where']};return db[_0x511e('0x1d')][_0x511e('0x11')](_0x2451c2)[_0x511e('0x18')](function(_0x1aaac1){_0x53017d[_0x511e('0x11')]=_0x1aaac1;_0x1ff5c4['include']=qs[_0x511e('0x23')](_0x3e1711['query']);return db['FaxQueue'][_0x511e('0x24')](_0x1ff5c4);})[_0x511e('0x18')](function(_0xa3b110){_0x53017d[_0x511e('0x25')]=_0xa3b110;return _0x53017d;})[_0x511e('0x18')](respondWithFilteredResult(_0x4d94a1,_0x1ff5c4))['catch'](handleError(_0x4d94a1,null));};exports[_0x511e('0x26')]=function(_0x2e6529,_0xf2a22){var _0x32be08={'raw':!![],'where':{'id':_0x2e6529['params']['id']}},_0x43c95f={};_0x43c95f[_0x511e('0x27')]=_[_0x511e('0x28')](db[_0x511e('0x1d')][_0x511e('0x1e')]);_0x43c95f[_0x511e('0x29')]=_[_0x511e('0x28')](_0x2e6529[_0x511e('0x29')]);_0x43c95f[_0x511e('0x2a')]=_['intersection'](_0x43c95f[_0x511e('0x27')],_0x43c95f[_0x511e('0x29')]);_0x32be08[_0x511e('0x2b')]=_[_0x511e('0x2c')](_0x43c95f['model'],qs['fields'](_0x2e6529[_0x511e('0x29')]['fields']));_0x32be08['attributes']=_0x32be08[_0x511e('0x2b')][_0x511e('0x2d')]?_0x32be08[_0x511e('0x2b')]:_0x43c95f[_0x511e('0x27')];if(_0x2e6529[_0x511e('0x29')]['includeAll']){_0x32be08[_0x511e('0x23')]=[{'all':!![]}];}_0x32be08=_[_0x511e('0x2e')]({},_0x32be08,_0x2e6529[_0x511e('0x2f')]);return db['FaxQueue'][_0x511e('0x30')](_0x32be08)[_0x511e('0x18')](handleEntityNotFound(_0xf2a22,null))[_0x511e('0x18')](respondWithResult(_0xf2a22,null))['catch'](handleError(_0xf2a22,null));};exports[_0x511e('0x31')]=function(_0x2fd83d,_0x4f124f){return db[_0x511e('0x1d')][_0x511e('0x31')](_0x2fd83d[_0x511e('0x32')],{})[_0x511e('0x18')](function(_0xb1603e){var _0x1a989a=_0x2fd83d[_0x511e('0x33')][_0x511e('0x34')]({'plain':!![]});if(!_0x1a989a)throw new Error(_0x511e('0x35'));if(_0x1a989a[_0x511e('0x36')]===_0x511e('0x33')){var _0x4f1f1d=_0xb1603e[_0x511e('0x34')]({'plain':!![]});var _0x5dc823='FaxQueues';return db[_0x511e('0x37')]['find']({'where':{'name':_0x5dc823,'userProfileId':_0x1a989a['userProfileId']},'raw':!![]})[_0x511e('0x18')](function(_0x200207){if(_0x200207&&_0x200207[_0x511e('0x38')]===0x0){return db[_0x511e('0x16')][_0x511e('0x31')]({'name':_0x4f1f1d[_0x511e('0x1b')],'resourceId':_0x4f1f1d['id'],'type':_0x200207[_0x511e('0x1b')],'sectionId':_0x200207['id']},{})[_0x511e('0x18')](function(){return _0xb1603e;});}else{return _0xb1603e;}})[_0x511e('0x39')](function(_0x396542){logger[_0x511e('0x19')](_0x511e('0x3a'),_0x396542);throw _0x396542;});}return _0xb1603e;})[_0x511e('0x18')](respondWithResult(_0x4f124f,0xc9))[_0x511e('0x39')](handleError(_0x4f124f,null));};exports['update']=function(_0x5a7a12,_0x19ffde){if(_0x5a7a12[_0x511e('0x32')]['id']){delete _0x5a7a12[_0x511e('0x32')]['id'];}return db[_0x511e('0x1d')][_0x511e('0x30')]({'where':{'id':_0x5a7a12['params']['id']}})[_0x511e('0x18')](handleEntityNotFound(_0x19ffde,null))[_0x511e('0x18')](saveUpdates(_0x5a7a12[_0x511e('0x32')],null))['then'](respondWithResult(_0x19ffde,null))['catch'](handleError(_0x19ffde,null));};exports['destroy']=function(_0x311c5d,_0x20b859){return db[_0x511e('0x1d')]['find']({'where':{'id':_0x311c5d['params']['id']}})['then'](handleEntityNotFound(_0x20b859,null))[_0x511e('0x18')](removeEntity(_0x20b859,null))[_0x511e('0x39')](handleError(_0x20b859,null));};exports[_0x511e('0x3b')]=function(_0x1e6bc8,_0x40e017){return db[_0x511e('0x1d')][_0x511e('0x3b')]()[_0x511e('0x18')](respondWithResult(_0x40e017,null))[_0x511e('0x39')](handleError(_0x40e017,null));};exports[_0x511e('0x3c')]=function(_0x1a2e4,_0x354f06){var _0x19a6c8={'raw':!![],'where':{}},_0x411709={},_0x625454;return db[_0x511e('0x1d')][_0x511e('0x3d')]({'where':{'id':_0x1a2e4[_0x511e('0x3e')]['id']}})[_0x511e('0x18')](handleEntityNotFound(_0x354f06,null))[_0x511e('0x18')](function(_0x2a00a5){if(_0x2a00a5){_0x625454=_0x2a00a5[_0x511e('0x34')]({'plain':!![]});_0x411709[_0x511e('0x27')]=_[_0x511e('0x28')](db[_0x511e('0x3f')][_0x511e('0x1e')]);_0x411709[_0x511e('0x29')]=_[_0x511e('0x28')](_0x1a2e4[_0x511e('0x29')]);_0x411709[_0x511e('0x2a')]=_[_0x511e('0x2c')](_0x411709['model'],_0x411709[_0x511e('0x29')]);_0x19a6c8['attributes']=_[_0x511e('0x2c')](_0x411709[_0x511e('0x27')],qs[_0x511e('0x40')](_0x1a2e4['query'][_0x511e('0x40')]));_0x19a6c8[_0x511e('0x2b')]=_0x19a6c8[_0x511e('0x2b')]['length']?_0x19a6c8[_0x511e('0x2b')]:_0x411709[_0x511e('0x27')];if(!_0x1a2e4['query'][_0x511e('0x41')](_0x511e('0x42'))){_0x19a6c8[_0x511e('0x10')]=qs[_0x511e('0x10')](_0x1a2e4['query'][_0x511e('0x10')]);_0x19a6c8['offset']=qs[_0x511e('0xe')](_0x1a2e4[_0x511e('0x29')][_0x511e('0xe')]);}_0x19a6c8['order']=qs[_0x511e('0x43')](_0x1a2e4['query'][_0x511e('0x43')]);_0x19a6c8[_0x511e('0x44')]=qs[_0x511e('0x2a')](_[_0x511e('0x45')](_0x1a2e4[_0x511e('0x29')],_0x411709['filters']));_0x19a6c8[_0x511e('0x44')][_0x511e('0x46')]=_0x2a00a5['id'];if(_0x1a2e4[_0x511e('0x29')][_0x511e('0x47')]){_0x19a6c8[_0x511e('0x44')]=_[_0x511e('0x2e')](_0x19a6c8[_0x511e('0x44')],{'$or':_[_0x511e('0x1c')](_0x19a6c8['attributes'],function(_0x3f780c){var _0x2eb672={};_0x2eb672[_0x3f780c]={'$like':'%'+_0x1a2e4['query'][_0x511e('0x47')]+'%'};return _0x2eb672;})});}_0x19a6c8=_[_0x511e('0x2e')]({},_0x19a6c8,_0x1a2e4[_0x511e('0x2f')]);return db[_0x511e('0x3f')][_0x511e('0x24')](_0x19a6c8);}})[_0x511e('0x18')](function(_0x5d16e6){if(_0x5d16e6){return db[_0x511e('0x48')][_0x511e('0x49')]({'where':{'id':_['map'](_0x5d16e6,_0x511e('0x4a')),'role':'agent'},'attributes':['id',_0x511e('0x1b'),_0x511e('0x4b'),'updatedAt','createdAt']});}})['then'](function(_0x5a1511){if(_0x5a1511){return{'count':_0x5a1511[_0x511e('0x11')],'rows':_['map'](_0x5a1511['rows'],function(_0x14c28b){return{'membername':_0x14c28b[_0x511e('0x1b')],'UserId':_0x14c28b['id'],'queue_name':_0x625454['name'],'FaxQueueId':_0x625454['id'],'interface':util[_0x511e('0x4c')]('%s/%s',_0x511e('0x4d'),_0x14c28b['name']),'penalty':0x0,'paused':_0x14c28b['faxPause'],'createdAt':_0x14c28b['createdAt'],'updatedAt':_0x14c28b[_0x511e('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x511e('0x18')](respondWithFilteredResult(_0x354f06,_0x19a6c8))['catch'](handleError(_0x354f06,null));};exports['getTeams']=function(_0x51940a,_0x4f1e55){var _0x264470={};var _0x54d2b0={};var _0xb404bb;var _0x4e9ddd;return db[_0x511e('0x1d')][_0x511e('0x3d')]({'where':{'id':_0x51940a[_0x511e('0x3e')]['id']}})[_0x511e('0x18')](handleEntityNotFound(_0x4f1e55,null))['then'](function(_0x460a72){if(_0x460a72){_0xb404bb=_0x460a72;_0x54d2b0[_0x511e('0x27')]=_[_0x511e('0x28')](db[_0x511e('0x4f')][_0x511e('0x1e')]);_0x54d2b0['query']=_['keys'](_0x51940a[_0x511e('0x29')]);_0x54d2b0[_0x511e('0x2a')]=_[_0x511e('0x2c')](_0x54d2b0[_0x511e('0x27')],_0x54d2b0[_0x511e('0x29')]);_0x264470[_0x511e('0x2b')]=_[_0x511e('0x2c')](_0x54d2b0[_0x511e('0x27')],qs[_0x511e('0x40')](_0x51940a[_0x511e('0x29')]['fields']));_0x264470['attributes']=_0x264470['attributes'][_0x511e('0x2d')]?_0x264470['attributes']:_0x54d2b0[_0x511e('0x27')];_0x264470['order']=qs[_0x511e('0x43')](_0x51940a['query'][_0x511e('0x43')]);_0x264470[_0x511e('0x44')]=qs[_0x511e('0x2a')](_[_0x511e('0x45')](_0x51940a[_0x511e('0x29')],_0x54d2b0['filters']));if(_0x51940a[_0x511e('0x29')]['filter']){_0x264470[_0x511e('0x44')]=_[_0x511e('0x2e')](_0x264470[_0x511e('0x44')],{'$or':_['map'](_0x264470[_0x511e('0x2b')],function(_0x45eb71){var _0x376f1a={};_0x376f1a[_0x45eb71]={'$like':'%'+_0x51940a[_0x511e('0x29')]['filter']+'%'};return _0x376f1a;})});}_0x264470=_['merge']({},_0x264470,_0x51940a[_0x511e('0x2f')]);return _0xb404bb[_0x511e('0x50')](_0x264470);}})['then'](function(_0x2545d2){if(_0x2545d2){_0x4e9ddd=_0x2545d2['length'];if(!_0x51940a[_0x511e('0x29')][_0x511e('0x41')]('nolimit')){_0x264470['limit']=qs[_0x511e('0x10')](_0x51940a[_0x511e('0x29')][_0x511e('0x10')]);_0x264470['offset']=qs[_0x511e('0xe')](_0x51940a[_0x511e('0x29')][_0x511e('0xe')]);}return _0xb404bb[_0x511e('0x50')](_0x264470);}})[_0x511e('0x18')](function(_0x561d50){if(_0x561d50){return _0x561d50?{'count':_0x4e9ddd,'rows':_0x561d50}:null;}})[_0x511e('0x18')](respondWithResult(_0x4f1e55,null))['catch'](handleError(_0x4f1e55,null));};exports[_0x511e('0x51')]=function(_0x3fac95,_0x59daab){var _0x57c150=_0x3fac95[_0x511e('0x32')][_0x511e('0x52')];return db['Team'][_0x511e('0x24')]({'where':{'id':_0x57c150},'attributes':['id'],'include':[{'model':db['User'],'as':_0x511e('0x53'),'attributes':['id','name','online',_0x511e('0x54'),_0x511e('0x55')],'raw':!![]}]})[_0x511e('0x18')](function(_0x3a0284){if(_0x3a0284){var _0x42059c=_['flatMap'](_0x3a0284,function(_0x52ab0e){var _0x28e533=_0x52ab0e[_0x511e('0x34')]({'plain':!![]});return _0x28e533[_0x511e('0x53')];});return db['FaxQueue'][_0x511e('0x30')]({'where':{'id':_0x3fac95[_0x511e('0x3e')]['id']}})['then'](function(_0x4cb219){return db[_0x511e('0x56')][_0x511e('0x57')](function(_0x3be0cb){return _0x4cb219[_0x511e('0x51')](_0x57c150,{'transaction':_0x3be0cb})[_0x511e('0x18')](function(){return BPromise[_0x511e('0x58')](_0x42059c,function(_0x4f6ee9){return db[_0x511e('0x3f')][_0x511e('0x59')]({'where':{'UserId':_0x4f6ee9['id'],'FaxQueueId':_0x3fac95['params']['id']},'transaction':_0x3be0cb});});})['then'](function(){_0x42059c[_0x511e('0x5a')](function(_0x528885){socket[_0x511e('0x5b')]('userFaxQueue:save',{'UserId':_0x528885['id'],'FaxQueueId':_0x4cb219['id']});});});});});}})['then'](respondWithStatusCode(_0x59daab,null))[_0x511e('0x39')](handleError(_0x59daab,null));};exports[_0x511e('0x5c')]=function(_0x3129fc,_0x2c61a5){return db[_0x511e('0x4f')][_0x511e('0x24')]({'where':{'id':_0x3129fc[_0x511e('0x29')][_0x511e('0x52')]},'attributes':['id'],'include':[{'model':db[_0x511e('0x48')],'as':_0x511e('0x53'),'attributes':['id'],'raw':!![]}]})[_0x511e('0x18')](handleEntityNotFound(_0x2c61a5,null))[_0x511e('0x18')](function(_0x3b4712){var _0x2f35cc=_[_0x511e('0x1c')](_0x3b4712,'id');var _0x327516=[];var _0x4a07b7=[];var _0x38b1cc=squel[_0x511e('0x5d')]();_0x38b1cc[_0x511e('0x5e')](_0x511e('0x5f'))[_0x511e('0x60')](_0x511e('0x61'),'tq')[_0x511e('0x62')](_0x511e('0x63'),'ut',_0x511e('0x64'))[_0x511e('0x44')](_0x511e('0x65'),_0x3129fc['params']['id']);for(var _0x200470=0x0;_0x200470<_0x3b4712[_0x511e('0x2d')];_0x200470+=0x1){let _0x1d4eb0=_0x3b4712[_0x200470];for(var _0x362cf7=0x0;_0x362cf7<_0x1d4eb0['Agents'][_0x511e('0x2d')];_0x362cf7+=0x1){let _0x385f5a=_0x1d4eb0[_0x511e('0x53')][_0x362cf7];var _0x2e1750=_0x38b1cc[_0x511e('0x66')]();_0x2e1750[_0x511e('0x44')](_0x511e('0x67'),_0x385f5a['id']);_0x4a07b7[_0x511e('0x68')](db[_0x511e('0x56')][_0x511e('0x29')](_0x2e1750['toString'](),{'type':db[_0x511e('0x56')][_0x511e('0x69')][_0x511e('0x6a')]})[_0x511e('0x18')](function(_0x2dba35){if(_0x2dba35[_0x511e('0x2d')]===0x1){return _0x385f5a['id'];}else{var _0x436e65=_['every'](_['map'](_0x2dba35,_0x511e('0x6b')),function(_0x13446d){return _[_0x511e('0x6c')](_0x2f35cc,_0x13446d);});if(_0x436e65){return _0x385f5a['id'];}}}));}}return BPromise[_0x511e('0x6d')](_0x4a07b7)[_0x511e('0x18')](function(_0x4316de){_0x327516=_(_0x327516)[_0x511e('0x6e')](_0x4316de)[_0x511e('0x6f')]()[_0x511e('0x70')]();return db[_0x511e('0x1d')]['find']({'where':{'id':_0x3129fc[_0x511e('0x3e')]['id']}})[_0x511e('0x18')](function(_0x19671c){return db[_0x511e('0x56')][_0x511e('0x57')](function(_0x4d9773){return _0x19671c['removeTeams'](_0x3129fc[_0x511e('0x29')][_0x511e('0x52')],{'transaction':_0x4d9773})[_0x511e('0x18')](function(){if(!_[_0x511e('0x71')](_0x327516)){return _0x19671c['removeAgents'](_0x327516,{'transaction':_0x4d9773});}})[_0x511e('0x18')](function(){_0x327516[_0x511e('0x5a')](function(_0x5c9f54){socket[_0x511e('0x5b')]('userFaxQueue:remove',{'UserId':_0x5c9f54,'FaxQueueId':_0x19671c['id']});});});});});});})[_0x511e('0x18')](respondWithStatusCode(_0x2c61a5,null))[_0x511e('0x39')](handleError(_0x2c61a5,null));};exports[_0x511e('0x72')]=function(_0x473867,_0x128014){return db[_0x511e('0x1d')][_0x511e('0x30')]({'where':{'id':_0x473867[_0x511e('0x3e')]['id']}})[_0x511e('0x18')](handleEntityNotFound(_0x128014,null))[_0x511e('0x18')](function(_0x37bb80){if(_0x37bb80){return _0x37bb80[_0x511e('0x72')](_0x473867[_0x511e('0x32')][_0x511e('0x52')],_[_0x511e('0x73')](_0x473867[_0x511e('0x32')],[_0x511e('0x52'),'id'])||{})[_0x511e('0x74')](function(_0x50ccc7){for(var _0x26065a=0x0;_0x26065a<_0x473867[_0x511e('0x32')][_0x511e('0x52')][_0x511e('0x2d')];_0x26065a+=0x1){socket[_0x511e('0x5b')]('userFaxQueue:save',{'UserId':Number(_0x473867[_0x511e('0x32')][_0x511e('0x52')][_0x26065a]),'FaxQueueId':Number(_0x473867[_0x511e('0x3e')]['id'])});}return _0x50ccc7;});}})['then'](respondWithResult(_0x128014,null))[_0x511e('0x39')](handleError(_0x128014,null));};exports[_0x511e('0x75')]=function(_0x176941,_0x334374){return db['FaxQueue']['find']({'where':{'id':_0x176941['params']['id']}})[_0x511e('0x18')](handleEntityNotFound(_0x334374,null))[_0x511e('0x18')](function(_0x48a735){if(_0x48a735){return _0x48a735[_0x511e('0x75')](_0x176941['query'][_0x511e('0x52')])['then'](function(){if(_[_0x511e('0x76')](_0x176941[_0x511e('0x29')]['ids'])){for(var _0x222547=0x0;_0x222547<_0x176941[_0x511e('0x29')][_0x511e('0x52')][_0x511e('0x2d')];_0x222547+=0x1){socket[_0x511e('0x5b')]('userFaxQueue:remove',{'UserId':Number(_0x176941['query']['ids'][_0x222547]),'FaxQueueId':Number(_0x176941['params']['id'])});}}else{socket['emit'](_0x511e('0x77'),{'UserId':Number(_0x176941[_0x511e('0x29')][_0x511e('0x52')]),'FaxQueueId':Number(_0x176941['params']['id'])});}});}})[_0x511e('0x18')](respondWithStatusCode(_0x334374,null))[_0x511e('0x39')](handleError(_0x334374,null));};exports[_0x511e('0x78')]=function(_0x2c4f4d,_0x2f2af0){var _0x31cdb3={};var _0x35e894={};var _0x5e880f;var _0x26cf0c;return db[_0x511e('0x1d')][_0x511e('0x3d')]({'where':{'id':_0x2c4f4d['params']['id']}})[_0x511e('0x18')](handleEntityNotFound(_0x2f2af0,null))[_0x511e('0x18')](function(_0x5dcbf7){if(_0x5dcbf7){_0x5e880f=_0x5dcbf7;_0x35e894[_0x511e('0x27')]=_[_0x511e('0x28')](db[_0x511e('0x48')][_0x511e('0x1e')]);_0x35e894[_0x511e('0x29')]=_['keys'](_0x2c4f4d['query']);_0x35e894[_0x511e('0x2a')]=_[_0x511e('0x2c')](_0x35e894[_0x511e('0x27')],_0x35e894[_0x511e('0x29')]);_0x31cdb3['attributes']=_[_0x511e('0x2c')](_0x35e894[_0x511e('0x27')],qs[_0x511e('0x40')](_0x2c4f4d[_0x511e('0x29')][_0x511e('0x40')]));_0x31cdb3[_0x511e('0x2b')]=_0x31cdb3[_0x511e('0x2b')][_0x511e('0x2d')]?_0x31cdb3[_0x511e('0x2b')]:_0x35e894['model'];_0x31cdb3['order']=qs[_0x511e('0x43')](_0x2c4f4d['query'][_0x511e('0x43')]);_0x31cdb3[_0x511e('0x44')]=qs[_0x511e('0x2a')](_[_0x511e('0x45')](_0x2c4f4d[_0x511e('0x29')],_0x35e894[_0x511e('0x2a')]));if(_0x2c4f4d[_0x511e('0x29')]['filter']){_0x31cdb3[_0x511e('0x44')]=_['merge'](_0x31cdb3[_0x511e('0x44')],{'$or':_[_0x511e('0x1c')](_0x31cdb3[_0x511e('0x2b')],function(_0x330f4a){var _0x29340e={};_0x29340e[_0x330f4a]={'$like':'%'+_0x2c4f4d[_0x511e('0x29')][_0x511e('0x47')]+'%'};return _0x29340e;})});}_0x31cdb3=_[_0x511e('0x2e')]({},_0x31cdb3,_0x2c4f4d[_0x511e('0x2f')]);return _0x5e880f['getAgents'](_0x31cdb3);}})[_0x511e('0x18')](function(_0x85721e){if(_0x85721e){_0x26cf0c=_0x85721e[_0x511e('0x2d')];if(!_0x2c4f4d['query'][_0x511e('0x41')](_0x511e('0x42'))){_0x31cdb3[_0x511e('0x10')]=qs[_0x511e('0x10')](_0x2c4f4d[_0x511e('0x29')]['limit']);_0x31cdb3[_0x511e('0xe')]=qs[_0x511e('0xe')](_0x2c4f4d['query'][_0x511e('0xe')]);}return _0x5e880f['getAgents'](_0x31cdb3);}})[_0x511e('0x18')](function(_0x283214){if(_0x283214){return _0x283214?{'count':_0x26cf0c,'rows':_0x283214}:null;}})['then'](respondWithResult(_0x2f2af0,null))[_0x511e('0x39')](handleError(_0x2f2af0,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index d19e08c..752f428 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 _0x4a68=['../../mysqldb','FaxQueue','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x5238e0,_0x136900){var _0x29db3f=function(_0x4b724f){while(--_0x4b724f){_0x5238e0['push'](_0x5238e0['shift']());}};_0x29db3f(++_0x136900);}(_0x4a68,0x138));var _0x84a6=function(_0x24d916,_0x1c3c78){_0x24d916=_0x24d916-0x0;var _0x56a31f=_0x4a68[_0x24d916];return _0x56a31f;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x84a6('0x0'))['db'][_0x84a6('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x84a6('0x2'),'afterUpdate':_0x84a6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x130c54){return function(_0x31c20a,_0x201b85,_0x2cec2d){FaxQueueEvents[_0x84a6('0x4')](_0x130c54+':'+_0x31c20a['id'],_0x31c20a);FaxQueueEvents[_0x84a6('0x4')](_0x130c54,_0x31c20a);_0x2cec2d(null);};}for(var e in events){if(events[_0x84a6('0x5')](e)){var event=events[e];FaxQueue[_0x84a6('0x6')](e,emitEvent(event));}}module[_0x84a6('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x335e=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x4dc5f7,_0x3ab3c0){var _0x30d0de=function(_0x37ce8a){while(--_0x37ce8a){_0x4dc5f7['push'](_0x4dc5f7['shift']());}};_0x30d0de(++_0x3ab3c0);}(_0x335e,0x18f));var _0xe335=function(_0x372a48,_0x5b145c){_0x372a48=_0x372a48-0x0;var _0x4ee1fa=_0x335e[_0x372a48];return _0x4ee1fa;};'use strict';var EventEmitter=require(_0xe335('0x0'));var FaxQueue=require(_0xe335('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe335('0x2')](0x0);var events={'afterCreate':_0xe335('0x3'),'afterUpdate':_0xe335('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2bf963){return function(_0x5ed8d2,_0x9a465d,_0x4fac68){FaxQueueEvents['emit'](_0x2bf963+':'+_0x5ed8d2['id'],_0x5ed8d2);FaxQueueEvents[_0xe335('0x5')](_0x2bf963,_0x5ed8d2);_0x4fac68(null);};}for(var e in events){if(events[_0xe335('0x6')](e)){var event=events[e];FaxQueue[_0xe335('0x7')](e,emitEvent(event));}}module[_0xe335('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 3c9d3a8..cef94c1 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 _0x51a7=['exports','define','fax_queues','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x33df9d,_0x2adf1e){var _0x4d8653=function(_0x6d3b1c){while(--_0x6d3b1c){_0x33df9d['push'](_0x33df9d['shift']());}};_0x4d8653(++_0x2adf1e);}(_0x51a7,0xf3));var _0x751a=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x51a7[_0x425716];return _0x2d39af;};'use strict';var _=require(_0x751a('0x0'));var util=require(_0x751a('0x1'));var logger=require(_0x751a('0x2'))('api');var moment=require(_0x751a('0x3'));var BPromise=require(_0x751a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x751a('0x5'));var config=require(_0x751a('0x6'));var attributes=require('./faxQueue.attributes');module[_0x751a('0x7')]=function(_0x414112,_0xfe209b){return _0x414112[_0x751a('0x8')]('FaxQueue',attributes,{'tableName':_0x751a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4bc=['../../config/environment','./faxQueue.attributes','define','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4c321c,_0x3e9da0){var _0x25accb=function(_0x21bf7a){while(--_0x21bf7a){_0x4c321c['push'](_0x4c321c['shift']());}};_0x25accb(++_0x3e9da0);}(_0xa4bc,0x160));var _0xca4b=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xa4bc[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0xca4b('0x0'));var util=require(_0xca4b('0x1'));var logger=require(_0xca4b('0x2'))(_0xca4b('0x3'));var moment=require(_0xca4b('0x4'));var BPromise=require(_0xca4b('0x5'));var rp=require(_0xca4b('0x6'));var fs=require('fs');var path=require(_0xca4b('0x7'));var rimraf=require('rimraf');var config=require(_0xca4b('0x8'));var attributes=require(_0xca4b('0x9'));module['exports']=function(_0x4e8ba3,_0x5520ca){return _0x4e8ba3[_0xca4b('0xa')]('FaxQueue',attributes,{'tableName':_0xca4b('0xb'),'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 686a6a2..b9a273c 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 _0xba5e=['rpc','jayson/promise','client','http','redis','localhost','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','find','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x151231,_0x308fd9){var _0x5c0366=function(_0x5d0ccc){while(--_0x5d0ccc){_0x151231['push'](_0x151231['shift']());}};_0x5c0366(++_0x308fd9);}(_0xba5e,0xe9));var _0xeba5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xba5e[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xeba5('0x0'));var util=require(_0xeba5('0x1'));var moment=require('moment');var BPromise=require(_0xeba5('0x2'));var rs=require(_0xeba5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeba5('0x4'))['db'];var utils=require(_0xeba5('0x5'));var logger=require(_0xeba5('0x6'))(_0xeba5('0x7'));var config=require('../../config/environment');var jayson=require(_0xeba5('0x8'));var client=jayson[_0xeba5('0x9')][_0xeba5('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xeba5('0xb')],{'host':_0xeba5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeba5('0xb')]));require(_0xeba5('0xd'))[_0xeba5('0xe')](socket);function respondWithRpcPromise(_0x4872c7,_0x1f9ec1,_0x3e4481){return new BPromise(function(_0x433f3c,_0x3cd671){return client[_0xeba5('0xf')](_0x4872c7,_0x3e4481)['then'](function(_0x1ddbf9){logger[_0xeba5('0x10')](_0xeba5('0x11'),_0x1f9ec1,_0xeba5('0x12'));logger[_0xeba5('0x13')](_0xeba5('0x14'),_0x1f9ec1,_0xeba5('0x12'),JSON[_0xeba5('0x15')](_0x1ddbf9));if(_0x1ddbf9['error']){if(_0x1ddbf9[_0xeba5('0x16')][_0xeba5('0x17')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x1f9ec1,_0x1ddbf9['error'][_0xeba5('0x18')]);return _0x3cd671(_0x1ddbf9[_0xeba5('0x16')][_0xeba5('0x18')]);}logger[_0xeba5('0x16')](_0xeba5('0x11'),_0x1f9ec1,_0x1ddbf9['error']['message']);return _0x433f3c(_0x1ddbf9[_0xeba5('0x16')]['message']);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x1f9ec1,_0xeba5('0x12'));_0x433f3c(_0x1ddbf9[_0xeba5('0x19')]['message']);}})[_0xeba5('0x1a')](function(_0x2de4f7){logger[_0xeba5('0x16')]('FaxQueue,\x20%s,\x20%s',_0x1f9ec1,_0x2de4f7);_0x3cd671(_0x2de4f7);});});}exports[_0xeba5('0x1b')]=function(_0x1cab08){var _0x73e6ef=this;return new Promise(function(_0x356ff9,_0x533e6c){return db[_0xeba5('0x1c')]['findAll']({'raw':_0x1cab08[_0xeba5('0x1d')]?_0x1cab08[_0xeba5('0x1d')][_0xeba5('0x1e')]===undefined?!![]:![]:!![],'where':_0x1cab08['options']?_0x1cab08[_0xeba5('0x1d')][_0xeba5('0x1f')]||null:null,'attributes':_0x1cab08[_0xeba5('0x1d')]?_0x1cab08[_0xeba5('0x1d')][_0xeba5('0x20')]||null:null,'limit':_0x1cab08[_0xeba5('0x1d')]?_0x1cab08['options'][_0xeba5('0x21')]||null:null,'include':_0x1cab08[_0xeba5('0x1d')]?_0x1cab08['options'][_0xeba5('0x22')]?_[_0xeba5('0x23')](_0x1cab08[_0xeba5('0x1d')][_0xeba5('0x22')],function(_0x44d836){return{'model':db[_0x44d836[_0xeba5('0x24')]],'as':_0x44d836['as'],'attributes':_0x44d836[_0xeba5('0x20')],'include':_0x44d836[_0xeba5('0x22')]?_[_0xeba5('0x23')](_0x44d836[_0xeba5('0x22')],function(_0x53a5dd){return{'model':db[_0x53a5dd[_0xeba5('0x24')]],'as':_0x53a5dd['as'],'attributes':_0x53a5dd['attributes'],'include':_0x53a5dd[_0xeba5('0x22')]?_[_0xeba5('0x23')](_0x53a5dd['include'],function(_0x31ad43){return{'model':db[_0x31ad43[_0xeba5('0x24')]],'as':_0x31ad43['as'],'attributes':_0x31ad43[_0xeba5('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10cb73){logger[_0xeba5('0x10')]('GetFaxQueue',_0x1cab08);logger[_0xeba5('0x13')]('GetFaxQueue',_0x1cab08,JSON[_0xeba5('0x15')](_0x10cb73));_0x356ff9(_0x10cb73);})['catch'](function(_0x1fe1f5){logger['error'](_0xeba5('0x1b'),_0x1fe1f5[_0xeba5('0x18')],_0x1cab08);_0x533e6c(_0x73e6ef[_0xeba5('0x16')](0x1f4,_0x1fe1f5[_0xeba5('0x18')]));});});};exports[_0xeba5('0x25')]=function(_0x3138e6){var _0x5e7830=this;return new Promise(function(_0x5ec67d,_0x3c6c76){return db[_0xeba5('0x1c')][_0xeba5('0x26')]({'raw':_0x3138e6[_0xeba5('0x1d')]?_0x3138e6[_0xeba5('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3138e6['options']?_0x3138e6[_0xeba5('0x1d')][_0xeba5('0x1f')]||null:null,'attributes':_0x3138e6[_0xeba5('0x1d')]?_0x3138e6[_0xeba5('0x1d')][_0xeba5('0x20')]||null:null,'include':_0x3138e6[_0xeba5('0x1d')]?_0x3138e6[_0xeba5('0x1d')][_0xeba5('0x22')]?_[_0xeba5('0x23')](_0x3138e6[_0xeba5('0x1d')][_0xeba5('0x22')],function(_0x1b414a){return{'model':db[_0x1b414a[_0xeba5('0x24')]],'as':_0x1b414a['as'],'attributes':_0x1b414a[_0xeba5('0x20')],'include':_0x1b414a[_0xeba5('0x22')]?_[_0xeba5('0x23')](_0x1b414a['include'],function(_0x3c627a){return{'model':db[_0x3c627a[_0xeba5('0x24')]],'as':_0x3c627a['as'],'attributes':_0x3c627a[_0xeba5('0x20')],'include':_0x3c627a['include']?_[_0xeba5('0x23')](_0x3c627a['include'],function(_0x7b0810){return{'model':db[_0x7b0810[_0xeba5('0x24')]],'as':_0x7b0810['as'],'attributes':_0x7b0810[_0xeba5('0x20')]};}):[]};}):[]};}):[]:[]})[_0xeba5('0x27')](function(_0x1ab68e){logger[_0xeba5('0x10')](_0xeba5('0x25'),_0x3138e6);logger[_0xeba5('0x13')](_0xeba5('0x25'),_0x3138e6,JSON[_0xeba5('0x15')](_0x1ab68e));_0x5ec67d(_0x1ab68e);})[_0xeba5('0x1a')](function(_0x1a6c4e){logger[_0xeba5('0x16')](_0xeba5('0x25'),_0x1a6c4e[_0xeba5('0x18')],_0x3138e6);_0x3c6c76(_0x5e7830[_0xeba5('0x16')](0x1f4,_0x1a6c4e['message']));});});}; \ No newline at end of file +var _0x8f2b=['error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5a5bf0,_0x586555){var _0x33c9aa=function(_0x2873ff){while(--_0x2873ff){_0x5a5bf0['push'](_0x5a5bf0['shift']());}};_0x33c9aa(++_0x586555);}(_0x8f2b,0x183));var _0xb8f2=function(_0x5c3358,_0x246038){_0x5c3358=_0x5c3358-0x0;var _0x43ae35=_0x8f2b[_0x5c3358];return _0x43ae35;};'use strict';var _=require(_0xb8f2('0x0'));var util=require(_0xb8f2('0x1'));var moment=require(_0xb8f2('0x2'));var BPromise=require(_0xb8f2('0x3'));var rs=require(_0xb8f2('0x4'));var fs=require('fs');var Redis=require(_0xb8f2('0x5'));var db=require(_0xb8f2('0x6'))['db'];var utils=require(_0xb8f2('0x7'));var logger=require(_0xb8f2('0x8'))('rpc');var config=require(_0xb8f2('0x9'));var jayson=require(_0xb8f2('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xb8f2('0xb')]=_[_0xb8f2('0xc')](config[_0xb8f2('0xb')],{'host':_0xb8f2('0xd'),'port':0x18eb});var socket=require(_0xb8f2('0xe'))(new Redis(config['redis']));require(_0xb8f2('0xf'))[_0xb8f2('0x10')](socket);function respondWithRpcPromise(_0x5ac1ae,_0x1f1dcb,_0x3ecf99){return new BPromise(function(_0x43f7df,_0x13b26a){return client['request'](_0x5ac1ae,_0x3ecf99)[_0xb8f2('0x11')](function(_0x3dd8bb){logger[_0xb8f2('0x12')](_0xb8f2('0x13'),_0x1f1dcb,_0xb8f2('0x14'));logger[_0xb8f2('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x1f1dcb,'request\x20sent',JSON[_0xb8f2('0x16')](_0x3dd8bb));if(_0x3dd8bb[_0xb8f2('0x17')]){if(_0x3dd8bb[_0xb8f2('0x17')][_0xb8f2('0x18')]===0x1f4){logger[_0xb8f2('0x17')](_0xb8f2('0x13'),_0x1f1dcb,_0x3dd8bb[_0xb8f2('0x17')][_0xb8f2('0x19')]);return _0x13b26a(_0x3dd8bb[_0xb8f2('0x17')]['message']);}logger[_0xb8f2('0x17')]('FaxQueue,\x20%s,\x20%s',_0x1f1dcb,_0x3dd8bb[_0xb8f2('0x17')][_0xb8f2('0x19')]);return _0x43f7df(_0x3dd8bb['error'][_0xb8f2('0x19')]);}else{logger[_0xb8f2('0x12')](_0xb8f2('0x13'),_0x1f1dcb,_0xb8f2('0x14'));_0x43f7df(_0x3dd8bb[_0xb8f2('0x1a')][_0xb8f2('0x19')]);}})[_0xb8f2('0x1b')](function(_0x20d2ec){logger[_0xb8f2('0x17')](_0xb8f2('0x13'),_0x1f1dcb,_0x20d2ec);_0x13b26a(_0x20d2ec);});});}exports[_0xb8f2('0x1c')]=function(_0x34120c){var _0x241974=this;return new Promise(function(_0x1667d8,_0x6aff8){return db[_0xb8f2('0x1d')][_0xb8f2('0x1e')]({'raw':_0x34120c[_0xb8f2('0x1f')]?_0x34120c[_0xb8f2('0x1f')][_0xb8f2('0x20')]===undefined?!![]:![]:!![],'where':_0x34120c[_0xb8f2('0x1f')]?_0x34120c[_0xb8f2('0x1f')][_0xb8f2('0x21')]||null:null,'attributes':_0x34120c['options']?_0x34120c[_0xb8f2('0x1f')][_0xb8f2('0x22')]||null:null,'limit':_0x34120c[_0xb8f2('0x1f')]?_0x34120c['options'][_0xb8f2('0x23')]||null:null,'include':_0x34120c[_0xb8f2('0x1f')]?_0x34120c[_0xb8f2('0x1f')][_0xb8f2('0x24')]?_[_0xb8f2('0x25')](_0x34120c[_0xb8f2('0x1f')][_0xb8f2('0x24')],function(_0x4f8a3e){return{'model':db[_0x4f8a3e[_0xb8f2('0x26')]],'as':_0x4f8a3e['as'],'attributes':_0x4f8a3e[_0xb8f2('0x22')],'include':_0x4f8a3e['include']?_[_0xb8f2('0x25')](_0x4f8a3e[_0xb8f2('0x24')],function(_0x3025cc){return{'model':db[_0x3025cc[_0xb8f2('0x26')]],'as':_0x3025cc['as'],'attributes':_0x3025cc[_0xb8f2('0x22')],'include':_0x3025cc['include']?_['map'](_0x3025cc[_0xb8f2('0x24')],function(_0xb6bcf6){return{'model':db[_0xb6bcf6[_0xb8f2('0x26')]],'as':_0xb6bcf6['as'],'attributes':_0xb6bcf6[_0xb8f2('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9c3820){logger[_0xb8f2('0x12')]('GetFaxQueue',_0x34120c);logger[_0xb8f2('0x15')](_0xb8f2('0x1c'),_0x34120c,JSON[_0xb8f2('0x16')](_0x9c3820));_0x1667d8(_0x9c3820);})[_0xb8f2('0x1b')](function(_0x70795f){logger[_0xb8f2('0x17')](_0xb8f2('0x1c'),_0x70795f[_0xb8f2('0x19')],_0x34120c);_0x6aff8(_0x241974[_0xb8f2('0x17')](0x1f4,_0x70795f[_0xb8f2('0x19')]));});});};exports[_0xb8f2('0x27')]=function(_0x76f61e){var _0xbf71d4=this;return new Promise(function(_0x1efd94,_0x2c7a24){return db[_0xb8f2('0x1d')][_0xb8f2('0x28')]({'raw':_0x76f61e['options']?_0x76f61e[_0xb8f2('0x1f')][_0xb8f2('0x20')]===undefined?!![]:![]:!![],'where':_0x76f61e['options']?_0x76f61e[_0xb8f2('0x1f')][_0xb8f2('0x21')]||null:null,'attributes':_0x76f61e[_0xb8f2('0x1f')]?_0x76f61e[_0xb8f2('0x1f')][_0xb8f2('0x22')]||null:null,'include':_0x76f61e[_0xb8f2('0x1f')]?_0x76f61e[_0xb8f2('0x1f')][_0xb8f2('0x24')]?_[_0xb8f2('0x25')](_0x76f61e['options'][_0xb8f2('0x24')],function(_0x427a9c){return{'model':db[_0x427a9c[_0xb8f2('0x26')]],'as':_0x427a9c['as'],'attributes':_0x427a9c[_0xb8f2('0x22')],'include':_0x427a9c[_0xb8f2('0x24')]?_[_0xb8f2('0x25')](_0x427a9c['include'],function(_0x529d84){return{'model':db[_0x529d84[_0xb8f2('0x26')]],'as':_0x529d84['as'],'attributes':_0x529d84[_0xb8f2('0x22')],'include':_0x529d84['include']?_['map'](_0x529d84[_0xb8f2('0x24')],function(_0xe68dc6){return{'model':db[_0xe68dc6[_0xb8f2('0x26')]],'as':_0xe68dc6['as'],'attributes':_0xe68dc6[_0xb8f2('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34db91){logger['info'](_0xb8f2('0x27'),_0x76f61e);logger[_0xb8f2('0x15')](_0xb8f2('0x27'),_0x76f61e,JSON[_0xb8f2('0x16')](_0x34db91));_0x1efd94(_0x34db91);})[_0xb8f2('0x1b')](function(_0x3254bc){logger[_0xb8f2('0x17')](_0xb8f2('0x27'),_0x3254bc[_0xb8f2('0x19')],_0x76f61e);_0x2c7a24(_0xbf71d4[_0xb8f2('0x17')](0x1f4,_0x3254bc[_0xb8f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index bfa577d..7e60fed 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 _0x20e7=['update','emit','removeListener','length','./faxQueue.events','save'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x20e7,0x178));var _0x720e=function(_0x3a283b,_0x5ea077){_0x3a283b=_0x3a283b-0x0;var _0x3ac2ee=_0x20e7[_0x3a283b];return _0x3ac2ee;};'use strict';var FaxQueueEvents=require(_0x720e('0x0'));var events=[_0x720e('0x1'),'remove',_0x720e('0x2')];function createListener(_0x991cc6,_0x51dc24){return function(_0x3eb3ba){_0x51dc24[_0x720e('0x3')](_0x991cc6,_0x3eb3ba);};}function removeListener(_0x254ee3,_0x1cee97){return function(){FaxQueueEvents[_0x720e('0x4')](_0x254ee3,_0x1cee97);};}exports['register']=function(_0x14ff38){for(var _0x2b2c47=0x0,_0xf9e10c=events[_0x720e('0x5')];_0x2b2c47<_0xf9e10c;_0x2b2c47++){var _0x1a5c02=events[_0x2b2c47];var _0x15355f=createListener('faxQueue:'+_0x1a5c02,_0x14ff38);FaxQueueEvents['on'](_0x1a5c02,_0x15355f);}}; \ No newline at end of file +var _0x9417=['emit','removeListener','register','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x89d79e,_0x3b5ddf){var _0x1a01c7=function(_0xdca183){while(--_0xdca183){_0x89d79e['push'](_0x89d79e['shift']());}};_0x1a01c7(++_0x3b5ddf);}(_0x9417,0xb4));var _0x7941=function(_0x4fc421,_0x94e88){_0x4fc421=_0x4fc421-0x0;var _0x8c6d63=_0x9417[_0x4fc421];return _0x8c6d63;};'use strict';var FaxQueueEvents=require(_0x7941('0x0'));var events=[_0x7941('0x1'),_0x7941('0x2'),_0x7941('0x3')];function createListener(_0x5e2057,_0x32968f){return function(_0x240766){_0x32968f[_0x7941('0x4')](_0x5e2057,_0x240766);};}function removeListener(_0x3351ee,_0x6f6dca){return function(){FaxQueueEvents[_0x7941('0x5')](_0x3351ee,_0x6f6dca);};}exports[_0x7941('0x6')]=function(_0x3e38d8){for(var _0x1dee1a=0x0,_0x15c666=events['length'];_0x1dee1a<_0x15c666;_0x1dee1a++){var _0x11a155=events[_0x1dee1a];var _0x238e43=createListener(_0x7941('0x7')+_0x11a155,_0x3e38d8);FaxQueueEvents['on'](_0x11a155,_0x238e43);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index aae576e..7f28184 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 _0x5e0e=['get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x147982,_0xfa2350){var _0x17b5fa=function(_0x1e9570){while(--_0x1e9570){_0x147982['push'](_0x147982['shift']());}};_0x17b5fa(++_0xfa2350);}(_0x5e0e,0x89));var _0xe5e0=function(_0x3f9ec3,_0x3dfd37){_0x3f9ec3=_0x3f9ec3-0x0;var _0xe85b13=_0x5e0e[_0x3f9ec3];return _0xe85b13;};'use strict';var multer=require(_0xe5e0('0x0'));var util=require(_0xe5e0('0x1'));var path=require('path');var timeout=require(_0xe5e0('0x2'));var express=require(_0xe5e0('0x3'));var router=express[_0xe5e0('0x4')]();var fs_extra=require(_0xe5e0('0x5'));var auth=require(_0xe5e0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe5e0('0x7'));var controller=require('./faxQueue.controller');router[_0xe5e0('0x8')]('/',auth[_0xe5e0('0x9')](),controller[_0xe5e0('0xa')]);router[_0xe5e0('0x8')](_0xe5e0('0xb'),auth[_0xe5e0('0x9')](),controller['describe']);router[_0xe5e0('0x8')](_0xe5e0('0xc'),auth['isAuthenticated'](),controller[_0xe5e0('0xd')]);router[_0xe5e0('0x8')](_0xe5e0('0xe'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0xf')]);router[_0xe5e0('0x8')](_0xe5e0('0x10'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x11')]);router[_0xe5e0('0x8')](_0xe5e0('0x12'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe5e0('0x14')]);router[_0xe5e0('0x15')](_0xe5e0('0x10'),auth[_0xe5e0('0x9')](),controller['addTeams']);router[_0xe5e0('0x15')](_0xe5e0('0x12'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x16')]);router[_0xe5e0('0x17')](_0xe5e0('0xc'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x18')]);router[_0xe5e0('0x19')]('/:id',auth[_0xe5e0('0x9')](),controller['destroy']);router[_0xe5e0('0x19')]('/:id/teams',auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x1a')]);router['delete'](_0xe5e0('0x12'),auth['isAuthenticated'](),controller[_0xe5e0('0x1b')]);module[_0xe5e0('0x1c')]=router; \ No newline at end of file +var _0xa809=['express','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addAgents','put','update','delete','removeTeams','/:id/users','exports','util'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0xa809,0x1f3));var _0x9a80=function(_0x4dc4ac,_0x1e9bac){_0x4dc4ac=_0x4dc4ac-0x0;var _0x12d55b=_0xa809[_0x4dc4ac];return _0x12d55b;};'use strict';var multer=require('multer');var util=require(_0x9a80('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9a80('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9a80('0x2'));var config=require(_0x9a80('0x3'));var controller=require(_0x9a80('0x4'));router[_0x9a80('0x5')]('/',auth['isAuthenticated'](),controller[_0x9a80('0x6')]);router['get'](_0x9a80('0x7'),auth[_0x9a80('0x8')](),controller['describe']);router[_0x9a80('0x5')](_0x9a80('0x9'),auth[_0x9a80('0x8')](),controller[_0x9a80('0xa')]);router['get'](_0x9a80('0xb'),auth[_0x9a80('0x8')](),controller[_0x9a80('0xc')]);router[_0x9a80('0x5')](_0x9a80('0xd'),auth[_0x9a80('0x8')](),controller[_0x9a80('0xe')]);router[_0x9a80('0x5')]('/:id/users',auth[_0x9a80('0x8')](),controller[_0x9a80('0xf')]);router[_0x9a80('0x10')]('/',auth[_0x9a80('0x8')](),controller[_0x9a80('0x11')]);router[_0x9a80('0x10')](_0x9a80('0xd'),auth[_0x9a80('0x8')](),controller['addTeams']);router[_0x9a80('0x10')]('/:id/users',auth[_0x9a80('0x8')](),controller[_0x9a80('0x12')]);router[_0x9a80('0x13')]('/:id',auth[_0x9a80('0x8')](),controller[_0x9a80('0x14')]);router[_0x9a80('0x15')](_0x9a80('0x9'),auth[_0x9a80('0x8')](),controller['destroy']);router[_0x9a80('0x15')]('/:id/teams',auth[_0x9a80('0x8')](),controller[_0x9a80('0x16')]);router[_0x9a80('0x15')](_0x9a80('0x17'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x9a80('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index b89f362..7ff083c 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 _0xa3ab=['sequelize','exports','STRING','DATE','moment'];(function(_0x1689c3,_0x38dc2d){var _0x1e9df6=function(_0x1741d1){while(--_0x1741d1){_0x1689c3['push'](_0x1689c3['shift']());}};_0x1e9df6(++_0x38dc2d);}(_0xa3ab,0x103));var _0xba3a=function(_0xd16c3b,_0x126e40){_0xd16c3b=_0xd16c3b-0x0;var _0x155f00=_0xa3ab[_0xd16c3b];return _0x155f00;};'use strict';var moment=require(_0xba3a('0x0'));var Sequelize=require(_0xba3a('0x1'));module[_0xba3a('0x2')]={'uniqueid':{'type':Sequelize[_0xba3a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xba3a('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xba3a('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xba3a('0x4')]},'reason':{'type':Sequelize[_0xba3a('0x3')]}}; \ No newline at end of file +var _0xb34b=['moment','STRING','DATE'];(function(_0x42f8b5,_0x45e908){var _0x1c5c01=function(_0x4184a8){while(--_0x4184a8){_0x42f8b5['push'](_0x42f8b5['shift']());}};_0x1c5c01(++_0x45e908);}(_0xb34b,0x1e9));var _0xbb34=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xb34b[_0x1cc8fe];return _0x230054;};'use strict';var moment=require(_0xbb34('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xbb34('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xbb34('0x2')]},'leaveAt':{'type':Sequelize[_0xbb34('0x2')]},'acceptAt':{'type':Sequelize[_0xbb34('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xbb34('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 47189cf..4664978 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 _0x6ae0=['FaxQueueReport','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','fs-extra','squel','crypto','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','offset','count','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','status','send','index','map'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6ae0,0x192));var _0x06ae=function(_0x22fc91,_0x3bbbce){_0x22fc91=_0x22fc91-0x0;var _0x483790=_0x6ae0[_0x22fc91];return _0x483790;};'use strict';var emlformat=require(_0x06ae('0x0'));var rimraf=require(_0x06ae('0x1'));var zipdir=require(_0x06ae('0x2'));var jsonpatch=require(_0x06ae('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x06ae('0x4'));var Mustache=require('mustache');var util=require(_0x06ae('0x5'));var path=require('path');var sox=require(_0x06ae('0x6'));var csv=require(_0x06ae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06ae('0x8'));var _=require('lodash');var squel=require(_0x06ae('0x9'));var crypto=require(_0x06ae('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x06ae('0xb'));var toCsv=require(_0x06ae('0x7'));var querystring=require(_0x06ae('0xc'));var Papa=require(_0x06ae('0xd'));var Redis=require(_0x06ae('0xe'));var authService=require(_0x06ae('0xf'));var qs=require(_0x06ae('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06ae('0x11'));var logger=require(_0x06ae('0x12'))(_0x06ae('0x13'));var utils=require(_0x06ae('0x14'));var config=require(_0x06ae('0x15'));var licenseUtil=require(_0x06ae('0x16'));var db=require(_0x06ae('0x17'))['db'];function respondWithStatusCode(_0x4eb845,_0x5cd65f){_0x5cd65f=_0x5cd65f||0xcc;return function(_0x55ec89){if(_0x55ec89){return _0x4eb845[_0x06ae('0x18')](_0x5cd65f);}return _0x4eb845['status'](_0x5cd65f)[_0x06ae('0x19')]();};}function respondWithResult(_0xa858d2,_0x46dab3){_0x46dab3=_0x46dab3||0xc8;return function(_0x279e03){if(_0x279e03){return _0xa858d2['status'](_0x46dab3)['json'](_0x279e03);}};}function respondWithFilteredResult(_0x3f6ce2,_0x5f44a2){return function(_0x1c8fd7){if(_0x1c8fd7){var _0xf59273=typeof _0x5f44a2[_0x06ae('0x1a')]==='undefined'&&typeof _0x5f44a2['limit']==='undefined';var _0xf869c6=_0x1c8fd7[_0x06ae('0x1b')];var _0x35eab4=_0xf59273?0x0:_0x5f44a2[_0x06ae('0x1a')];var _0x1a8e35=_0xf59273?_0x1c8fd7[_0x06ae('0x1b')]:_0x5f44a2[_0x06ae('0x1a')]+_0x5f44a2['limit'];var _0x490cd0;if(_0x1a8e35>=_0xf869c6){_0x1a8e35=_0xf869c6;_0x490cd0=0xc8;}else{_0x490cd0=0xce;}_0x3f6ce2['status'](_0x490cd0);return _0x3f6ce2['set'](_0x06ae('0x1c'),_0x35eab4+'-'+_0x1a8e35+'/'+_0xf869c6)[_0x06ae('0x1d')](_0x1c8fd7);}return null;};}function patchUpdates(_0x5c65b6){return function(_0xd42b1c){try{jsonpatch[_0x06ae('0x1e')](_0xd42b1c,_0x5c65b6,!![]);}catch(_0x467156){return BPromise[_0x06ae('0x1f')](_0x467156);}return _0xd42b1c['save']();};}function saveUpdates(_0xfa1c6f,_0x54b8c7){return function(_0x14b374){if(_0x14b374){return _0x14b374[_0x06ae('0x20')](_0xfa1c6f)['then'](function(_0x32c535){return _0x32c535;});}return null;};}function removeEntity(_0x264785,_0x2c4480){return function(_0x512753){if(_0x512753){return _0x512753[_0x06ae('0x21')]()[_0x06ae('0x22')](function(){_0x264785['status'](0xcc)[_0x06ae('0x19')]();});}};}function handleEntityNotFound(_0xf6075b,_0x40f522){return function(_0x4f69f2){if(!_0x4f69f2){_0xf6075b[_0x06ae('0x18')](0x194);}return _0x4f69f2;};}function handleError(_0x47c5ca,_0x104db1){_0x104db1=_0x104db1||0x1f4;return function(_0x24410a){logger[_0x06ae('0x23')](_0x24410a[_0x06ae('0x24')]);if(_0x24410a['name']){delete _0x24410a[_0x06ae('0x25')];}_0x47c5ca[_0x06ae('0x26')](_0x104db1)[_0x06ae('0x27')](_0x24410a);};}exports[_0x06ae('0x28')]=function(_0x49f0b6,_0xfd320a){var _0x5ca32b={},_0x1baff9={},_0xa6c16b={'count':0x0,'rows':[]};var _0x11b569=_[_0x06ae('0x29')](db[_0x06ae('0x2a')]['rawAttributes'],function(_0x2a1d3a){return{'name':_0x2a1d3a[_0x06ae('0x2b')],'type':_0x2a1d3a['type'][_0x06ae('0x2c')]};});_0x1baff9['model']=_[_0x06ae('0x29')](_0x11b569,'name');_0x1baff9[_0x06ae('0x2d')]=_[_0x06ae('0x2e')](_0x49f0b6[_0x06ae('0x2d')]);_0x1baff9['filters']=_[_0x06ae('0x2f')](_0x1baff9['model'],_0x1baff9['query']);_0x5ca32b['attributes']=_[_0x06ae('0x2f')](_0x1baff9[_0x06ae('0x30')],qs['fields'](_0x49f0b6[_0x06ae('0x2d')][_0x06ae('0x31')]));_0x5ca32b['attributes']=_0x5ca32b[_0x06ae('0x32')][_0x06ae('0x33')]?_0x5ca32b['attributes']:_0x1baff9['model'];if(!_0x49f0b6['query'][_0x06ae('0x34')](_0x06ae('0x35'))){_0x5ca32b[_0x06ae('0x36')]=qs['limit'](_0x49f0b6['query'][_0x06ae('0x36')]);_0x5ca32b['offset']=qs['offset'](_0x49f0b6[_0x06ae('0x2d')][_0x06ae('0x1a')]);}_0x5ca32b[_0x06ae('0x37')]=qs[_0x06ae('0x38')](_0x49f0b6['query'][_0x06ae('0x38')]);_0x5ca32b[_0x06ae('0x39')]=qs[_0x06ae('0x3a')](_[_0x06ae('0x3b')](_0x49f0b6[_0x06ae('0x2d')],_0x1baff9[_0x06ae('0x3a')]),_0x11b569);if(_0x49f0b6[_0x06ae('0x2d')][_0x06ae('0x3c')]){_0x5ca32b[_0x06ae('0x39')]=_[_0x06ae('0x3d')](_0x5ca32b[_0x06ae('0x39')],{'$or':_[_0x06ae('0x29')](_0x11b569,function(_0xa2e675){if(_0xa2e675['type']!==_0x06ae('0x3e')){var _0x1fa92a={};_0x1fa92a[_0xa2e675[_0x06ae('0x25')]]={'$like':'%'+_0x49f0b6[_0x06ae('0x2d')][_0x06ae('0x3c')]+'%'};return _0x1fa92a;}})});}_0x5ca32b=_['merge']({},_0x5ca32b,_0x49f0b6[_0x06ae('0x3f')]);var _0x53a793={'where':_0x5ca32b[_0x06ae('0x39')]};return db[_0x06ae('0x2a')][_0x06ae('0x1b')](_0x53a793)[_0x06ae('0x22')](function(_0x2bc483){_0xa6c16b['count']=_0x2bc483;if(_0x49f0b6[_0x06ae('0x2d')][_0x06ae('0x40')]){_0x5ca32b[_0x06ae('0x41')]=[{'all':!![]}];}return db[_0x06ae('0x2a')][_0x06ae('0x42')](_0x5ca32b);})['then'](function(_0x187397){_0xa6c16b['rows']=_0x187397;return _0xa6c16b;})[_0x06ae('0x22')](respondWithFilteredResult(_0xfd320a,_0x5ca32b))[_0x06ae('0x43')](handleError(_0xfd320a,null));};exports[_0x06ae('0x44')]=function(_0x3662b1,_0x131341){var _0x4e9c3e={'raw':!![],'where':{'id':_0x3662b1[_0x06ae('0x45')]['id']}},_0x3d982a={};_0x3d982a['model']=_[_0x06ae('0x2e')](db[_0x06ae('0x2a')]['rawAttributes']);_0x3d982a[_0x06ae('0x2d')]=_['keys'](_0x3662b1['query']);_0x3d982a['filters']=_[_0x06ae('0x2f')](_0x3d982a[_0x06ae('0x30')],_0x3d982a[_0x06ae('0x2d')]);_0x4e9c3e[_0x06ae('0x32')]=_[_0x06ae('0x2f')](_0x3d982a[_0x06ae('0x30')],qs[_0x06ae('0x31')](_0x3662b1[_0x06ae('0x2d')]['fields']));_0x4e9c3e[_0x06ae('0x32')]=_0x4e9c3e[_0x06ae('0x32')][_0x06ae('0x33')]?_0x4e9c3e[_0x06ae('0x32')]:_0x3d982a['model'];if(_0x3662b1[_0x06ae('0x2d')][_0x06ae('0x40')]){_0x4e9c3e[_0x06ae('0x41')]=[{'all':!![]}];}_0x4e9c3e=_[_0x06ae('0x3d')]({},_0x4e9c3e,_0x3662b1[_0x06ae('0x3f')]);return db[_0x06ae('0x2a')][_0x06ae('0x46')](_0x4e9c3e)[_0x06ae('0x22')](handleEntityNotFound(_0x131341,null))[_0x06ae('0x22')](respondWithResult(_0x131341,null))[_0x06ae('0x43')](handleError(_0x131341,null));};exports[_0x06ae('0x47')]=function(_0x444dbb,_0x3ccbb5){return db[_0x06ae('0x2a')][_0x06ae('0x47')](_0x444dbb[_0x06ae('0x48')],{})[_0x06ae('0x22')](respondWithResult(_0x3ccbb5,0xc9))[_0x06ae('0x43')](handleError(_0x3ccbb5,null));};exports[_0x06ae('0x20')]=function(_0x509969,_0xa2b743){if(_0x509969[_0x06ae('0x48')]['id']){delete _0x509969[_0x06ae('0x48')]['id'];}return db[_0x06ae('0x2a')][_0x06ae('0x46')]({'where':{'id':_0x509969[_0x06ae('0x45')]['id']}})[_0x06ae('0x22')](handleEntityNotFound(_0xa2b743,null))[_0x06ae('0x22')](saveUpdates(_0x509969['body'],null))[_0x06ae('0x22')](respondWithResult(_0xa2b743,null))[_0x06ae('0x43')](handleError(_0xa2b743,null));};exports[_0x06ae('0x21')]=function(_0x262fea,_0x563eaa){return db['FaxQueueReport'][_0x06ae('0x46')]({'where':{'id':_0x262fea[_0x06ae('0x45')]['id']}})[_0x06ae('0x22')](handleEntityNotFound(_0x563eaa,null))[_0x06ae('0x22')](removeEntity(_0x563eaa,null))[_0x06ae('0x43')](handleError(_0x563eaa,null));};exports['describe']=function(_0x42ac0e,_0x43bca9){return db[_0x06ae('0x2a')][_0x06ae('0x49')]()['then'](respondWithResult(_0x43bca9,null))[_0x06ae('0x43')](handleError(_0x43bca9,null));}; \ No newline at end of file +var _0xf296=['create','body','destroy','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find'];(function(_0x4bf12a,_0x125aa0){var _0x1336c2=function(_0x326383){while(--_0x326383){_0x4bf12a['push'](_0x4bf12a['shift']());}};_0x1336c2(++_0x125aa0);}(_0xf296,0x94));var _0x6f29=function(_0x5da107,_0x10357c){_0x5da107=_0x5da107-0x0;var _0x224f15=_0xf296[_0x5da107];return _0x224f15;};'use strict';var emlformat=require(_0x6f29('0x0'));var rimraf=require(_0x6f29('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f29('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6f29('0x3'));var Mustache=require(_0x6f29('0x4'));var util=require('util');var path=require(_0x6f29('0x5'));var sox=require(_0x6f29('0x6'));var csv=require(_0x6f29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f29('0x8'));var _=require(_0x6f29('0x9'));var squel=require('squel');var crypto=require(_0x6f29('0xa'));var jsforce=require(_0x6f29('0xb'));var deskjs=require(_0x6f29('0xc'));var toCsv=require(_0x6f29('0x7'));var querystring=require(_0x6f29('0xd'));var Papa=require(_0x6f29('0xe'));var Redis=require(_0x6f29('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6f29('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6f29('0x11'));var utils=require('../../config/utils');var config=require(_0x6f29('0x12'));var licenseUtil=require(_0x6f29('0x13'));var db=require(_0x6f29('0x14'))['db'];function respondWithStatusCode(_0x56e2a4,_0x1ce6a2){_0x1ce6a2=_0x1ce6a2||0xcc;return function(_0x3cec2a){if(_0x3cec2a){return _0x56e2a4[_0x6f29('0x15')](_0x1ce6a2);}return _0x56e2a4[_0x6f29('0x16')](_0x1ce6a2)[_0x6f29('0x17')]();};}function respondWithResult(_0x4b9304,_0x429604){_0x429604=_0x429604||0xc8;return function(_0x115d08){if(_0x115d08){return _0x4b9304[_0x6f29('0x16')](_0x429604)['json'](_0x115d08);}};}function respondWithFilteredResult(_0x3602e4,_0x50e0d6){return function(_0x3959e4){if(_0x3959e4){var _0x2907e4=typeof _0x50e0d6[_0x6f29('0x18')]===_0x6f29('0x19')&&typeof _0x50e0d6['limit']==='undefined';var _0x28995e=_0x3959e4[_0x6f29('0x1a')];var _0x5b524d=_0x2907e4?0x0:_0x50e0d6['offset'];var _0x30e10f=_0x2907e4?_0x3959e4[_0x6f29('0x1a')]:_0x50e0d6[_0x6f29('0x18')]+_0x50e0d6[_0x6f29('0x1b')];var _0x29b580;if(_0x30e10f>=_0x28995e){_0x30e10f=_0x28995e;_0x29b580=0xc8;}else{_0x29b580=0xce;}_0x3602e4['status'](_0x29b580);return _0x3602e4[_0x6f29('0x1c')](_0x6f29('0x1d'),_0x5b524d+'-'+_0x30e10f+'/'+_0x28995e)[_0x6f29('0x1e')](_0x3959e4);}return null;};}function patchUpdates(_0x33afa3){return function(_0x1f7c53){try{jsonpatch[_0x6f29('0x1f')](_0x1f7c53,_0x33afa3,!![]);}catch(_0x56ca2d){return BPromise['reject'](_0x56ca2d);}return _0x1f7c53[_0x6f29('0x20')]();};}function saveUpdates(_0x430dc8,_0xf7309){return function(_0x4924ca){if(_0x4924ca){return _0x4924ca[_0x6f29('0x21')](_0x430dc8)[_0x6f29('0x22')](function(_0x1ae43e){return _0x1ae43e;});}return null;};}function removeEntity(_0x3e9977,_0x16eaa9){return function(_0x9d7eda){if(_0x9d7eda){return _0x9d7eda['destroy']()[_0x6f29('0x22')](function(){_0x3e9977[_0x6f29('0x16')](0xcc)[_0x6f29('0x17')]();});}};}function handleEntityNotFound(_0x54c05b,_0x5883e3){return function(_0x4fa5f9){if(!_0x4fa5f9){_0x54c05b[_0x6f29('0x15')](0x194);}return _0x4fa5f9;};}function handleError(_0x2593ba,_0x1b0ff7){_0x1b0ff7=_0x1b0ff7||0x1f4;return function(_0x301406){logger[_0x6f29('0x23')](_0x301406[_0x6f29('0x24')]);if(_0x301406[_0x6f29('0x25')]){delete _0x301406[_0x6f29('0x25')];}_0x2593ba['status'](_0x1b0ff7)[_0x6f29('0x26')](_0x301406);};}exports[_0x6f29('0x27')]=function(_0x4ceaea,_0x18f379){var _0x8e0348={},_0x3c6d71={},_0x305367={'count':0x0,'rows':[]};var _0x315116=_['map'](db[_0x6f29('0x28')][_0x6f29('0x29')],function(_0x5b57a3){return{'name':_0x5b57a3[_0x6f29('0x2a')],'type':_0x5b57a3[_0x6f29('0x2b')]['key']};});_0x3c6d71[_0x6f29('0x2c')]=_['map'](_0x315116,_0x6f29('0x25'));_0x3c6d71[_0x6f29('0x2d')]=_[_0x6f29('0x2e')](_0x4ceaea['query']);_0x3c6d71[_0x6f29('0x2f')]=_[_0x6f29('0x30')](_0x3c6d71[_0x6f29('0x2c')],_0x3c6d71['query']);_0x8e0348[_0x6f29('0x31')]=_[_0x6f29('0x30')](_0x3c6d71['model'],qs[_0x6f29('0x32')](_0x4ceaea[_0x6f29('0x2d')][_0x6f29('0x32')]));_0x8e0348[_0x6f29('0x31')]=_0x8e0348[_0x6f29('0x31')][_0x6f29('0x33')]?_0x8e0348[_0x6f29('0x31')]:_0x3c6d71[_0x6f29('0x2c')];if(!_0x4ceaea[_0x6f29('0x2d')][_0x6f29('0x34')]('nolimit')){_0x8e0348['limit']=qs[_0x6f29('0x1b')](_0x4ceaea['query'][_0x6f29('0x1b')]);_0x8e0348[_0x6f29('0x18')]=qs[_0x6f29('0x18')](_0x4ceaea['query'][_0x6f29('0x18')]);}_0x8e0348[_0x6f29('0x35')]=qs['sort'](_0x4ceaea[_0x6f29('0x2d')]['sort']);_0x8e0348[_0x6f29('0x36')]=qs[_0x6f29('0x2f')](_[_0x6f29('0x37')](_0x4ceaea['query'],_0x3c6d71[_0x6f29('0x2f')]),_0x315116);if(_0x4ceaea[_0x6f29('0x2d')][_0x6f29('0x38')]){_0x8e0348[_0x6f29('0x36')]=_[_0x6f29('0x39')](_0x8e0348[_0x6f29('0x36')],{'$or':_[_0x6f29('0x3a')](_0x315116,function(_0x2ebc0a){if(_0x2ebc0a[_0x6f29('0x2b')]!==_0x6f29('0x3b')){var _0x314004={};_0x314004[_0x2ebc0a[_0x6f29('0x25')]]={'$like':'%'+_0x4ceaea[_0x6f29('0x2d')]['filter']+'%'};return _0x314004;}})});}_0x8e0348=_['merge']({},_0x8e0348,_0x4ceaea[_0x6f29('0x3c')]);var _0x319ed2={'where':_0x8e0348[_0x6f29('0x36')]};return db[_0x6f29('0x28')][_0x6f29('0x1a')](_0x319ed2)[_0x6f29('0x22')](function(_0x1c3ed6){_0x305367['count']=_0x1c3ed6;if(_0x4ceaea[_0x6f29('0x2d')][_0x6f29('0x3d')]){_0x8e0348['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0x6f29('0x3e')](_0x8e0348);})['then'](function(_0x35e4c2){_0x305367[_0x6f29('0x3f')]=_0x35e4c2;return _0x305367;})[_0x6f29('0x22')](respondWithFilteredResult(_0x18f379,_0x8e0348))[_0x6f29('0x40')](handleError(_0x18f379,null));};exports['show']=function(_0x4eb78d,_0x320b64){var _0x12ab79={'raw':!![],'where':{'id':_0x4eb78d[_0x6f29('0x41')]['id']}},_0x41d214={};_0x41d214[_0x6f29('0x2c')]=_[_0x6f29('0x2e')](db['FaxQueueReport'][_0x6f29('0x29')]);_0x41d214[_0x6f29('0x2d')]=_['keys'](_0x4eb78d[_0x6f29('0x2d')]);_0x41d214[_0x6f29('0x2f')]=_[_0x6f29('0x30')](_0x41d214[_0x6f29('0x2c')],_0x41d214[_0x6f29('0x2d')]);_0x12ab79[_0x6f29('0x31')]=_[_0x6f29('0x30')](_0x41d214[_0x6f29('0x2c')],qs[_0x6f29('0x32')](_0x4eb78d[_0x6f29('0x2d')][_0x6f29('0x32')]));_0x12ab79[_0x6f29('0x31')]=_0x12ab79[_0x6f29('0x31')][_0x6f29('0x33')]?_0x12ab79['attributes']:_0x41d214[_0x6f29('0x2c')];if(_0x4eb78d[_0x6f29('0x2d')]['includeAll']){_0x12ab79[_0x6f29('0x42')]=[{'all':!![]}];}_0x12ab79=_[_0x6f29('0x39')]({},_0x12ab79,_0x4eb78d[_0x6f29('0x3c')]);return db['FaxQueueReport'][_0x6f29('0x43')](_0x12ab79)[_0x6f29('0x22')](handleEntityNotFound(_0x320b64,null))['then'](respondWithResult(_0x320b64,null))[_0x6f29('0x40')](handleError(_0x320b64,null));};exports[_0x6f29('0x44')]=function(_0x2c97e7,_0x9e10e){return db[_0x6f29('0x28')][_0x6f29('0x44')](_0x2c97e7[_0x6f29('0x45')],{})[_0x6f29('0x22')](respondWithResult(_0x9e10e,0xc9))['catch'](handleError(_0x9e10e,null));};exports[_0x6f29('0x21')]=function(_0x27d36f,_0x1042c9){if(_0x27d36f[_0x6f29('0x45')]['id']){delete _0x27d36f[_0x6f29('0x45')]['id'];}return db['FaxQueueReport'][_0x6f29('0x43')]({'where':{'id':_0x27d36f[_0x6f29('0x41')]['id']}})[_0x6f29('0x22')](handleEntityNotFound(_0x1042c9,null))[_0x6f29('0x22')](saveUpdates(_0x27d36f['body'],null))[_0x6f29('0x22')](respondWithResult(_0x1042c9,null))[_0x6f29('0x40')](handleError(_0x1042c9,null));};exports[_0x6f29('0x46')]=function(_0x341f64,_0x58f431){return db[_0x6f29('0x28')][_0x6f29('0x43')]({'where':{'id':_0x341f64[_0x6f29('0x41')]['id']}})[_0x6f29('0x22')](handleEntityNotFound(_0x58f431,null))['then'](removeEntity(_0x58f431,null))['catch'](handleError(_0x58f431,null));};exports[_0x6f29('0x47')]=function(_0x117ffb,_0x436fb4){return db[_0x6f29('0x28')][_0x6f29('0x47')]()[_0x6f29('0x22')](respondWithResult(_0x436fb4,null))[_0x6f29('0x40')](handleError(_0x436fb4,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 9e9ef66..a1410e9 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(_0x7476bd,_0x139b91){var _0x2cab00=function(_0x42c5e3){while(--_0x42c5e3){_0x7476bd['push'](_0x7476bd['shift']());}};_0x2cab00(++_0x139b91);}(_0x4975,0x86));var _0x5497=function(_0x1eb84a,_0xa63b61){_0x1eb84a=_0x1eb84a-0x0;var _0x1fdb44=_0x4975[_0x1eb84a];return _0x1fdb44;};'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 _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x3ed508,_0x5734c4){var _0x111e50=function(_0x29557){while(--_0x29557){_0x3ed508['push'](_0x3ed508['shift']());}};_0x111e50(++_0x5734c4);}(_0xf494,0x1c6));var _0x4f49=function(_0x756a10,_0x332327){_0x756a10=_0x756a10-0x0;var _0x2a8006=_0xf494[_0x756a10];return _0x2a8006;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 64460fc..41d288a 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 _0xe32f=['CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','debug','stringify','where','limit','UpdateFaxQueueReport','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch'];(function(_0x8c06b4,_0x222d26){var _0x21b7f9=function(_0x2ba6c0){while(--_0x2ba6c0){_0x8c06b4['push'](_0x8c06b4['shift']());}};_0x21b7f9(++_0x222d26);}(_0xe32f,0x8b));var _0xfe32=function(_0x318162,_0x476694){_0x318162=_0x318162-0x0;var _0x43f1d7=_0xe32f[_0x318162];return _0x43f1d7;};'use strict';var _=require('lodash');var util=require(_0xfe32('0x0'));var moment=require(_0xfe32('0x1'));var BPromise=require(_0xfe32('0x2'));var rs=require(_0xfe32('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfe32('0x4'));var logger=require(_0xfe32('0x5'))(_0xfe32('0x6'));var config=require(_0xfe32('0x7'));var jayson=require(_0xfe32('0x8'));var client=jayson[_0xfe32('0x9')][_0xfe32('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d6431,_0xaf0be0,_0x32954a){return new BPromise(function(_0xabf0f0,_0x432902){return client['request'](_0x1d6431,_0x32954a)[_0xfe32('0xb')](function(_0x39ff6c){logger[_0xfe32('0xc')](_0xfe32('0xd'),_0xaf0be0,'request\x20sent');logger['debug'](_0xfe32('0xe'),_0xaf0be0,'request\x20sent',JSON['stringify'](_0x39ff6c));if(_0x39ff6c[_0xfe32('0xf')]){if(_0x39ff6c[_0xfe32('0xf')][_0xfe32('0x10')]===0x1f4){logger[_0xfe32('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0xaf0be0,_0x39ff6c['error'][_0xfe32('0x11')]);return _0x432902(_0x39ff6c['error'][_0xfe32('0x11')]);}logger[_0xfe32('0xf')](_0xfe32('0xd'),_0xaf0be0,_0x39ff6c[_0xfe32('0xf')]['message']);return _0xabf0f0(_0x39ff6c[_0xfe32('0xf')][_0xfe32('0x11')]);}else{logger[_0xfe32('0xc')](_0xfe32('0xd'),_0xaf0be0,_0xfe32('0x12'));_0xabf0f0(_0x39ff6c[_0xfe32('0x13')]['message']);}})[_0xfe32('0x14')](function(_0x19ff60){logger[_0xfe32('0xf')](_0xfe32('0xd'),_0xaf0be0,_0x19ff60);_0x432902(_0x19ff60);});});}exports[_0xfe32('0x15')]=function(_0xe9a7ae){var _0x719d64=this;return new Promise(function(_0x2c3559,_0x56f155){return db[_0xfe32('0x16')][_0xfe32('0x17')](_0xe9a7ae[_0xfe32('0x18')],{'raw':_0xe9a7ae[_0xfe32('0x19')]?_0xe9a7ae[_0xfe32('0x19')][_0xfe32('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4658fd){logger[_0xfe32('0xc')](_0xfe32('0x15'),_0xe9a7ae);logger[_0xfe32('0x1b')]('CreateFaxQueueReport',_0xe9a7ae,JSON[_0xfe32('0x1c')](_0x4658fd));_0x2c3559(_0x4658fd);})[_0xfe32('0x14')](function(_0x1178c7){logger['error'](_0xfe32('0x15'),_0x1178c7[_0xfe32('0x11')],_0xe9a7ae);_0x56f155(_0x719d64[_0xfe32('0xf')](0x1f4,_0x1178c7['message']));});});};exports['UpdateFaxQueueReport']=function(_0x548caa){var _0x4a1387=this;return new Promise(function(_0x2fa497,_0x13520b){return db[_0xfe32('0x16')]['update'](_0x548caa[_0xfe32('0x18')],{'raw':_0x548caa[_0xfe32('0x19')]?_0x548caa['options'][_0xfe32('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x548caa[_0xfe32('0x19')]?_0x548caa[_0xfe32('0x19')][_0xfe32('0x1d')]||null:null,'attributes':_0x548caa[_0xfe32('0x19')]?_0x548caa['options']['attributes']||null:null,'limit':_0x548caa[_0xfe32('0x19')]?_0x548caa[_0xfe32('0x19')][_0xfe32('0x1e')]||null:null})[_0xfe32('0xb')](function(_0x99ddca){logger['info'](_0xfe32('0x1f'),_0x548caa);logger[_0xfe32('0x1b')](_0xfe32('0x1f'),_0x548caa,JSON[_0xfe32('0x1c')](_0x99ddca));_0x2fa497(_0x99ddca);})[_0xfe32('0x14')](function(_0x4ae7e6){logger['error'](_0xfe32('0x1f'),_0x4ae7e6[_0xfe32('0x11')],_0x548caa);_0x13520b(_0x4a1387[_0xfe32('0xf')](0x1f4,_0x4ae7e6[_0xfe32('0x11')]));});});}; \ No newline at end of file +var _0x8cc5=['../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','debug','UpdateFaxQueueReport','where','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8cc5,0x1ab));var _0x58cc=function(_0x20b9ac,_0x2b2e46){_0x20b9ac=_0x20b9ac-0x0;var _0x1772c8=_0x8cc5[_0x20b9ac];return _0x1772c8;};'use strict';var _=require('lodash');var util=require(_0x58cc('0x0'));var moment=require('moment');var BPromise=require(_0x58cc('0x1'));var rs=require(_0x58cc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58cc('0x3'))['db'];var utils=require(_0x58cc('0x4'));var logger=require(_0x58cc('0x5'))(_0x58cc('0x6'));var config=require(_0x58cc('0x7'));var jayson=require(_0x58cc('0x8'));var client=jayson[_0x58cc('0x9')][_0x58cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b68c3,_0xf6510b,_0x10283c){return new BPromise(function(_0x3e8222,_0x18aec3){return client[_0x58cc('0xb')](_0x2b68c3,_0x10283c)[_0x58cc('0xc')](function(_0x5b1a9d){logger[_0x58cc('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0xf6510b,'request\x20sent');logger['debug'](_0x58cc('0xe'),_0xf6510b,'request\x20sent',JSON[_0x58cc('0xf')](_0x5b1a9d));if(_0x5b1a9d[_0x58cc('0x10')]){if(_0x5b1a9d[_0x58cc('0x10')][_0x58cc('0x11')]===0x1f4){logger[_0x58cc('0x10')](_0x58cc('0x12'),_0xf6510b,_0x5b1a9d[_0x58cc('0x10')][_0x58cc('0x13')]);return _0x18aec3(_0x5b1a9d[_0x58cc('0x10')][_0x58cc('0x13')]);}logger[_0x58cc('0x10')](_0x58cc('0x12'),_0xf6510b,_0x5b1a9d[_0x58cc('0x10')][_0x58cc('0x13')]);return _0x3e8222(_0x5b1a9d[_0x58cc('0x10')]['message']);}else{logger[_0x58cc('0xd')](_0x58cc('0x12'),_0xf6510b,'request\x20sent');_0x3e8222(_0x5b1a9d[_0x58cc('0x14')][_0x58cc('0x13')]);}})[_0x58cc('0x15')](function(_0x460a77){logger[_0x58cc('0x10')](_0x58cc('0x12'),_0xf6510b,_0x460a77);_0x18aec3(_0x460a77);});});}exports['CreateFaxQueueReport']=function(_0x355184){var _0x5e8d01=this;return new Promise(function(_0x14b313,_0x5e8415){return db[_0x58cc('0x16')][_0x58cc('0x17')](_0x355184[_0x58cc('0x18')],{'raw':_0x355184['options']?_0x355184[_0x58cc('0x19')][_0x58cc('0x1a')]===undefined?!![]:![]:!![]})[_0x58cc('0xc')](function(_0x2f779d){logger[_0x58cc('0xd')](_0x58cc('0x1b'),_0x355184);logger[_0x58cc('0x1c')](_0x58cc('0x1b'),_0x355184,JSON[_0x58cc('0xf')](_0x2f779d));_0x14b313(_0x2f779d);})[_0x58cc('0x15')](function(_0x32a664){logger['error'](_0x58cc('0x1b'),_0x32a664[_0x58cc('0x13')],_0x355184);_0x5e8415(_0x5e8d01[_0x58cc('0x10')](0x1f4,_0x32a664[_0x58cc('0x13')]));});});};exports[_0x58cc('0x1d')]=function(_0x335ccb){var _0x217e7a=this;return new Promise(function(_0x31f3ae,_0x5d8cc3){return db['FaxQueueReport']['update'](_0x335ccb[_0x58cc('0x18')],{'raw':_0x335ccb['options']?_0x335ccb['options'][_0x58cc('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x335ccb['options']?_0x335ccb[_0x58cc('0x19')][_0x58cc('0x1e')]||null:null,'attributes':_0x335ccb['options']?_0x335ccb[_0x58cc('0x19')]['attributes']||null:null,'limit':_0x335ccb[_0x58cc('0x19')]?_0x335ccb[_0x58cc('0x19')]['limit']||null:null})[_0x58cc('0xc')](function(_0x192991){logger[_0x58cc('0xd')]('UpdateFaxQueueReport',_0x335ccb);logger[_0x58cc('0x1c')](_0x58cc('0x1d'),_0x335ccb,JSON[_0x58cc('0xf')](_0x192991));_0x31f3ae(_0x192991);})[_0x58cc('0x15')](function(_0x2596a2){logger[_0x58cc('0x10')](_0x58cc('0x1d'),_0x2596a2['message'],_0x335ccb);_0x5d8cc3(_0x217e7a[_0x58cc('0x10')](0x1f4,_0x2596a2[_0x58cc('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 0d77f8b..df3c0e6 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 _0xacf9=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','/describe','describe','/:id','post','isAuthenticated','create'];(function(_0x455161,_0x520f10){var _0x3e7c03=function(_0xb17908){while(--_0xb17908){_0x455161['push'](_0x455161['shift']());}};_0x3e7c03(++_0x520f10);}(_0xacf9,0x1d3));var _0x9acf=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xacf9[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0x9acf('0x0'));var util=require(_0x9acf('0x1'));var path=require(_0x9acf('0x2'));var timeout=require(_0x9acf('0x3'));var express=require('express');var router=express[_0x9acf('0x4')]();var fs_extra=require(_0x9acf('0x5'));var auth=require(_0x9acf('0x6'));var interaction=require(_0x9acf('0x7'));var config=require(_0x9acf('0x8'));var controller=require(_0x9acf('0x9'));router[_0x9acf('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9acf('0xa')](_0x9acf('0xb'),auth['isAuthenticated'](),controller[_0x9acf('0xc')]);router[_0x9acf('0xa')](_0x9acf('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9acf('0xe')]('/',auth[_0x9acf('0xf')](),controller[_0x9acf('0x10')]);router[_0x9acf('0x11')](_0x9acf('0xd'),auth[_0x9acf('0xf')](),controller[_0x9acf('0x12')]);router[_0x9acf('0x13')](_0x9acf('0xd'),auth[_0x9acf('0xf')](),controller[_0x9acf('0x14')]);module[_0x9acf('0x15')]=router; \ No newline at end of file +var _0x63e0=['update','delete','/:id','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','describe','post','create','put'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x63e0,0x1df));var _0x063e=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0x63e0[_0x3e2fcf];return _0x497db7;};'use strict';var multer=require(_0x063e('0x0'));var util=require(_0x063e('0x1'));var path=require(_0x063e('0x2'));var timeout=require(_0x063e('0x3'));var express=require('express');var router=express[_0x063e('0x4')]();var fs_extra=require(_0x063e('0x5'));var auth=require(_0x063e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x063e('0x7'));var controller=require(_0x063e('0x8'));router[_0x063e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x063e('0x9')]('/describe',auth[_0x063e('0xa')](),controller[_0x063e('0xb')]);router[_0x063e('0x9')]('/:id',auth[_0x063e('0xa')](),controller['show']);router[_0x063e('0xc')]('/',auth['isAuthenticated'](),controller[_0x063e('0xd')]);router[_0x063e('0xe')]('/:id',auth[_0x063e('0xa')](),controller[_0x063e('0xf')]);router[_0x063e('0x10')](_0x063e('0x11'),auth[_0x063e('0xa')](),controller[_0x063e('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index fe23d54..1b2612b 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x4778eb,_0x20712d){var _0xdbb30d=function(_0x4d4309){while(--_0x4d4309){_0x4778eb['push'](_0x4778eb['shift']());}};_0xdbb30d(++_0x20712d);}(_0x70e0,0x17b));var _0x070e=function(_0x254397,_0x27e2b6){_0x254397=_0x254397-0x0;var _0x30b96e=_0x70e0[_0x254397];return _0x30b96e;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0xe25c95,_0x1c7a4f){var _0xe566a7=function(_0x425da3){while(--_0x425da3){_0xe25c95['push'](_0xe25c95['shift']());}};_0xe566a7(++_0x1c7a4f);}(_0xaa88,0x137));var _0x8aa8=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0xaa88[_0x4e11d5];return _0x5e4e4c;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 8f65856..fca75c6 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 _0x0c80=['filters','attributes','intersection','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','length','create','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','name','map','FaxTransferReport','type','key','model','query','keys'];(function(_0x3d6fae,_0x2e77cf){var _0x268a15=function(_0x354493){while(--_0x354493){_0x3d6fae['push'](_0x3d6fae['shift']());}};_0x268a15(++_0x2e77cf);}(_0x0c80,0x1b5));var _0x00c8=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0c80[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x00c8('0x0'));var rimraf=require(_0x00c8('0x1'));var zipdir=require(_0x00c8('0x2'));var jsonpatch=require(_0x00c8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x00c8('0x4'));var Mustache=require('mustache');var util=require(_0x00c8('0x5'));var path=require(_0x00c8('0x6'));var sox=require(_0x00c8('0x7'));var csv=require(_0x00c8('0x8'));var ejs=require(_0x00c8('0x9'));var fs=require('fs');var fs_extra=require(_0x00c8('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x00c8('0xb'));var jsforce=require(_0x00c8('0xc'));var deskjs=require(_0x00c8('0xd'));var toCsv=require(_0x00c8('0x8'));var querystring=require('querystring');var Papa=require(_0x00c8('0xe'));var Redis=require('ioredis');var authService=require(_0x00c8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x00c8('0x10'));var hardwareService=require(_0x00c8('0x11'));var logger=require(_0x00c8('0x12'))('api');var utils=require(_0x00c8('0x13'));var config=require(_0x00c8('0x14'));var licenseUtil=require(_0x00c8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39378f,_0x594313){_0x594313=_0x594313||0xcc;return function(_0x22bcf9){if(_0x22bcf9){return _0x39378f[_0x00c8('0x16')](_0x594313);}return _0x39378f[_0x00c8('0x17')](_0x594313)[_0x00c8('0x18')]();};}function respondWithResult(_0x52da9a,_0x49df23){_0x49df23=_0x49df23||0xc8;return function(_0x50dcb2){if(_0x50dcb2){return _0x52da9a[_0x00c8('0x17')](_0x49df23)['json'](_0x50dcb2);}};}function respondWithFilteredResult(_0x3f6317,_0x4d8daf){return function(_0x40779f){if(_0x40779f){var _0x1144be=typeof _0x4d8daf[_0x00c8('0x19')]===_0x00c8('0x1a')&&typeof _0x4d8daf['limit']===_0x00c8('0x1a');var _0x93a147=_0x40779f[_0x00c8('0x1b')];var _0x53233d=_0x1144be?0x0:_0x4d8daf[_0x00c8('0x19')];var _0xd339fe=_0x1144be?_0x40779f['count']:_0x4d8daf[_0x00c8('0x19')]+_0x4d8daf[_0x00c8('0x1c')];var _0x1bd45c;if(_0xd339fe>=_0x93a147){_0xd339fe=_0x93a147;_0x1bd45c=0xc8;}else{_0x1bd45c=0xce;}_0x3f6317[_0x00c8('0x17')](_0x1bd45c);return _0x3f6317[_0x00c8('0x1d')](_0x00c8('0x1e'),_0x53233d+'-'+_0xd339fe+'/'+_0x93a147)[_0x00c8('0x1f')](_0x40779f);}return null;};}function patchUpdates(_0x19db3a){return function(_0x21a190){try{jsonpatch[_0x00c8('0x20')](_0x21a190,_0x19db3a,!![]);}catch(_0x3b5cfc){return BPromise[_0x00c8('0x21')](_0x3b5cfc);}return _0x21a190[_0x00c8('0x22')]();};}function saveUpdates(_0x43a1c9,_0x1d6bfe){return function(_0x146ad8){if(_0x146ad8){return _0x146ad8[_0x00c8('0x23')](_0x43a1c9)['then'](function(_0x4e36b2){return _0x4e36b2;});}return null;};}function removeEntity(_0x3af5b6,_0x2f08cf){return function(_0x1d73f1){if(_0x1d73f1){return _0x1d73f1[_0x00c8('0x24')]()[_0x00c8('0x25')](function(){_0x3af5b6[_0x00c8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x359b33,_0x877c78){return function(_0x56cd7d){if(!_0x56cd7d){_0x359b33[_0x00c8('0x16')](0x194);}return _0x56cd7d;};}function handleError(_0x12e409,_0x547214){_0x547214=_0x547214||0x1f4;return function(_0x5468bc){logger['error'](_0x5468bc['stack']);if(_0x5468bc[_0x00c8('0x26')]){delete _0x5468bc['name'];}_0x12e409[_0x00c8('0x17')](_0x547214)['send'](_0x5468bc);};}exports['index']=function(_0x41f728,_0x36642e){var _0x4250a4={},_0x14792b={},_0x4e1c21={'count':0x0,'rows':[]};var _0x4d23ff=_[_0x00c8('0x27')](db[_0x00c8('0x28')]['rawAttributes'],function(_0x4ac6c7){return{'name':_0x4ac6c7['fieldName'],'type':_0x4ac6c7[_0x00c8('0x29')][_0x00c8('0x2a')]};});_0x14792b[_0x00c8('0x2b')]=_[_0x00c8('0x27')](_0x4d23ff,_0x00c8('0x26'));_0x14792b[_0x00c8('0x2c')]=_[_0x00c8('0x2d')](_0x41f728[_0x00c8('0x2c')]);_0x14792b[_0x00c8('0x2e')]=_['intersection'](_0x14792b[_0x00c8('0x2b')],_0x14792b['query']);_0x4250a4[_0x00c8('0x2f')]=_[_0x00c8('0x30')](_0x14792b[_0x00c8('0x2b')],qs['fields'](_0x41f728[_0x00c8('0x2c')]['fields']));_0x4250a4[_0x00c8('0x2f')]=_0x4250a4[_0x00c8('0x2f')]['length']?_0x4250a4[_0x00c8('0x2f')]:_0x14792b[_0x00c8('0x2b')];if(!_0x41f728[_0x00c8('0x2c')][_0x00c8('0x31')]('nolimit')){_0x4250a4[_0x00c8('0x1c')]=qs['limit'](_0x41f728['query'][_0x00c8('0x1c')]);_0x4250a4['offset']=qs[_0x00c8('0x19')](_0x41f728[_0x00c8('0x2c')]['offset']);}_0x4250a4[_0x00c8('0x32')]=qs[_0x00c8('0x33')](_0x41f728[_0x00c8('0x2c')][_0x00c8('0x33')]);_0x4250a4['where']=qs[_0x00c8('0x2e')](_['pick'](_0x41f728[_0x00c8('0x2c')],_0x14792b[_0x00c8('0x2e')]),_0x4d23ff);if(_0x41f728['query']['filter']){_0x4250a4[_0x00c8('0x34')]=_[_0x00c8('0x35')](_0x4250a4[_0x00c8('0x34')],{'$or':_['map'](_0x4d23ff,function(_0x52a4c6){if(_0x52a4c6[_0x00c8('0x29')]!==_0x00c8('0x36')){var _0x3700ab={};_0x3700ab[_0x52a4c6['name']]={'$like':'%'+_0x41f728[_0x00c8('0x2c')]['filter']+'%'};return _0x3700ab;}})});}_0x4250a4=_[_0x00c8('0x35')]({},_0x4250a4,_0x41f728[_0x00c8('0x37')]);var _0xa38f3b={'where':_0x4250a4[_0x00c8('0x34')]};return db[_0x00c8('0x28')]['count'](_0xa38f3b)[_0x00c8('0x25')](function(_0x24c9d0){_0x4e1c21[_0x00c8('0x1b')]=_0x24c9d0;if(_0x41f728['query'][_0x00c8('0x38')]){_0x4250a4[_0x00c8('0x39')]=[{'all':!![]}];}return db[_0x00c8('0x28')][_0x00c8('0x3a')](_0x4250a4);})[_0x00c8('0x25')](function(_0x5214b5){_0x4e1c21[_0x00c8('0x3b')]=_0x5214b5;return _0x4e1c21;})[_0x00c8('0x25')](respondWithFilteredResult(_0x36642e,_0x4250a4))[_0x00c8('0x3c')](handleError(_0x36642e,null));};exports[_0x00c8('0x3d')]=function(_0x4b6cee,_0x515828){var _0x318ff3={'raw':!![],'where':{'id':_0x4b6cee[_0x00c8('0x3e')]['id']}},_0x232df2={};_0x232df2['model']=_[_0x00c8('0x2d')](db[_0x00c8('0x28')]['rawAttributes']);_0x232df2[_0x00c8('0x2c')]=_[_0x00c8('0x2d')](_0x4b6cee['query']);_0x232df2[_0x00c8('0x2e')]=_['intersection'](_0x232df2[_0x00c8('0x2b')],_0x232df2[_0x00c8('0x2c')]);_0x318ff3[_0x00c8('0x2f')]=_[_0x00c8('0x30')](_0x232df2[_0x00c8('0x2b')],qs['fields'](_0x4b6cee[_0x00c8('0x2c')][_0x00c8('0x3f')]));_0x318ff3[_0x00c8('0x2f')]=_0x318ff3[_0x00c8('0x2f')][_0x00c8('0x40')]?_0x318ff3[_0x00c8('0x2f')]:_0x232df2[_0x00c8('0x2b')];if(_0x4b6cee[_0x00c8('0x2c')][_0x00c8('0x38')]){_0x318ff3[_0x00c8('0x39')]=[{'all':!![]}];}_0x318ff3=_[_0x00c8('0x35')]({},_0x318ff3,_0x4b6cee[_0x00c8('0x37')]);return db[_0x00c8('0x28')]['find'](_0x318ff3)[_0x00c8('0x25')](handleEntityNotFound(_0x515828,null))[_0x00c8('0x25')](respondWithResult(_0x515828,null))[_0x00c8('0x3c')](handleError(_0x515828,null));};exports[_0x00c8('0x41')]=function(_0x1ee4d5,_0x178590){return db[_0x00c8('0x28')][_0x00c8('0x41')](_0x1ee4d5['body'],{})[_0x00c8('0x25')](respondWithResult(_0x178590,0xc9))[_0x00c8('0x3c')](handleError(_0x178590,null));};exports[_0x00c8('0x23')]=function(_0x3c115c,_0x5dbbf5){if(_0x3c115c['body']['id']){delete _0x3c115c['body']['id'];}return db[_0x00c8('0x28')][_0x00c8('0x42')]({'where':{'id':_0x3c115c['params']['id']}})[_0x00c8('0x25')](handleEntityNotFound(_0x5dbbf5,null))['then'](saveUpdates(_0x3c115c[_0x00c8('0x43')],null))[_0x00c8('0x25')](respondWithResult(_0x5dbbf5,null))[_0x00c8('0x3c')](handleError(_0x5dbbf5,null));};exports[_0x00c8('0x24')]=function(_0x456480,_0x40391c){return db[_0x00c8('0x28')][_0x00c8('0x42')]({'where':{'id':_0x456480[_0x00c8('0x3e')]['id']}})[_0x00c8('0x25')](handleEntityNotFound(_0x40391c,null))[_0x00c8('0x25')](removeEntity(_0x40391c,null))[_0x00c8('0x3c')](handleError(_0x40391c,null));};exports[_0x00c8('0x44')]=function(_0x145dc7,_0x15f005){return db['FaxTransferReport'][_0x00c8('0x44')]()[_0x00c8('0x25')](respondWithResult(_0x15f005,null))[_0x00c8('0x3c')](handleError(_0x15f005,null));}; \ No newline at end of file +var _0x8575=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','reject','save','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','VIRTUAL','filter','options','FaxTransferReport','includeAll','include','findAll','rows','catch','params','keys','find','create','update','body','describe','eml-format','rimraf'];(function(_0x52740f,_0x343961){var _0x1cbe11=function(_0x376976){while(--_0x376976){_0x52740f['push'](_0x52740f['shift']());}};_0x1cbe11(++_0x343961);}(_0x8575,0x9c));var _0x5857=function(_0x24f001,_0x5728ac){_0x24f001=_0x24f001-0x0;var _0x2b67b8=_0x8575[_0x24f001];return _0x2b67b8;};'use strict';var emlformat=require(_0x5857('0x0'));var rimraf=require(_0x5857('0x1'));var zipdir=require(_0x5857('0x2'));var jsonpatch=require(_0x5857('0x3'));var rp=require(_0x5857('0x4'));var moment=require(_0x5857('0x5'));var BPromise=require(_0x5857('0x6'));var Mustache=require(_0x5857('0x7'));var util=require(_0x5857('0x8'));var path=require('path');var sox=require(_0x5857('0x9'));var csv=require('to-csv');var ejs=require(_0x5857('0xa'));var fs=require('fs');var fs_extra=require(_0x5857('0xb'));var _=require(_0x5857('0xc'));var squel=require(_0x5857('0xd'));var crypto=require(_0x5857('0xe'));var jsforce=require(_0x5857('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5857('0x10'));var querystring=require(_0x5857('0x11'));var Papa=require(_0x5857('0x12'));var Redis=require(_0x5857('0x13'));var authService=require(_0x5857('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5857('0x15'));var hardwareService=require(_0x5857('0x16'));var logger=require(_0x5857('0x17'))(_0x5857('0x18'));var utils=require(_0x5857('0x19'));var config=require(_0x5857('0x1a'));var licenseUtil=require(_0x5857('0x1b'));var db=require(_0x5857('0x1c'))['db'];function respondWithStatusCode(_0xb0d532,_0x513545){_0x513545=_0x513545||0xcc;return function(_0x5d93b2){if(_0x5d93b2){return _0xb0d532[_0x5857('0x1d')](_0x513545);}return _0xb0d532[_0x5857('0x1e')](_0x513545)['end']();};}function respondWithResult(_0x387c32,_0x241658){_0x241658=_0x241658||0xc8;return function(_0x35a016){if(_0x35a016){return _0x387c32[_0x5857('0x1e')](_0x241658)[_0x5857('0x1f')](_0x35a016);}};}function respondWithFilteredResult(_0x45c7a1,_0x425a97){return function(_0x17ef0c){if(_0x17ef0c){var _0x302be5=typeof _0x425a97[_0x5857('0x20')]==='undefined'&&typeof _0x425a97[_0x5857('0x21')]==='undefined';var _0x5420c8=_0x17ef0c[_0x5857('0x22')];var _0x1d2363=_0x302be5?0x0:_0x425a97[_0x5857('0x20')];var _0x141f5b=_0x302be5?_0x17ef0c[_0x5857('0x22')]:_0x425a97[_0x5857('0x20')]+_0x425a97[_0x5857('0x21')];var _0x57d961;if(_0x141f5b>=_0x5420c8){_0x141f5b=_0x5420c8;_0x57d961=0xc8;}else{_0x57d961=0xce;}_0x45c7a1[_0x5857('0x1e')](_0x57d961);return _0x45c7a1[_0x5857('0x23')]('Content-Range',_0x1d2363+'-'+_0x141f5b+'/'+_0x5420c8)['json'](_0x17ef0c);}return null;};}function patchUpdates(_0x18bab2){return function(_0x463e6c){try{jsonpatch['apply'](_0x463e6c,_0x18bab2,!![]);}catch(_0x352b74){return BPromise[_0x5857('0x24')](_0x352b74);}return _0x463e6c[_0x5857('0x25')]();};}function saveUpdates(_0x337620,_0x1df13a){return function(_0x519508){if(_0x519508){return _0x519508['update'](_0x337620)[_0x5857('0x26')](function(_0x4dd017){return _0x4dd017;});}return null;};}function removeEntity(_0x3c5ce1,_0x7aaa48){return function(_0x766ecc){if(_0x766ecc){return _0x766ecc[_0x5857('0x27')]()[_0x5857('0x26')](function(){_0x3c5ce1['status'](0xcc)[_0x5857('0x28')]();});}};}function handleEntityNotFound(_0x5a1665,_0x5cbeef){return function(_0x2ae50f){if(!_0x2ae50f){_0x5a1665[_0x5857('0x1d')](0x194);}return _0x2ae50f;};}function handleError(_0x5d4bb2,_0x5212a2){_0x5212a2=_0x5212a2||0x1f4;return function(_0x155ca0){logger[_0x5857('0x29')](_0x155ca0[_0x5857('0x2a')]);if(_0x155ca0[_0x5857('0x2b')]){delete _0x155ca0[_0x5857('0x2b')];}_0x5d4bb2['status'](_0x5212a2)[_0x5857('0x2c')](_0x155ca0);};}exports['index']=function(_0x16847a,_0x157384){var _0x40891f={},_0x4f93c4={},_0x39eeeb={'count':0x0,'rows':[]};var _0xf4a711=_[_0x5857('0x2d')](db['FaxTransferReport'][_0x5857('0x2e')],function(_0x3250af){return{'name':_0x3250af[_0x5857('0x2f')],'type':_0x3250af[_0x5857('0x30')][_0x5857('0x31')]};});_0x4f93c4[_0x5857('0x32')]=_[_0x5857('0x2d')](_0xf4a711,_0x5857('0x2b'));_0x4f93c4[_0x5857('0x33')]=_['keys'](_0x16847a[_0x5857('0x33')]);_0x4f93c4[_0x5857('0x34')]=_[_0x5857('0x35')](_0x4f93c4[_0x5857('0x32')],_0x4f93c4[_0x5857('0x33')]);_0x40891f[_0x5857('0x36')]=_[_0x5857('0x35')](_0x4f93c4['model'],qs['fields'](_0x16847a[_0x5857('0x33')][_0x5857('0x37')]));_0x40891f['attributes']=_0x40891f[_0x5857('0x36')][_0x5857('0x38')]?_0x40891f[_0x5857('0x36')]:_0x4f93c4[_0x5857('0x32')];if(!_0x16847a[_0x5857('0x33')][_0x5857('0x39')](_0x5857('0x3a'))){_0x40891f[_0x5857('0x21')]=qs[_0x5857('0x21')](_0x16847a[_0x5857('0x33')][_0x5857('0x21')]);_0x40891f['offset']=qs[_0x5857('0x20')](_0x16847a[_0x5857('0x33')][_0x5857('0x20')]);}_0x40891f[_0x5857('0x3b')]=qs['sort'](_0x16847a[_0x5857('0x33')]['sort']);_0x40891f['where']=qs[_0x5857('0x34')](_[_0x5857('0x3c')](_0x16847a[_0x5857('0x33')],_0x4f93c4[_0x5857('0x34')]),_0xf4a711);if(_0x16847a['query']['filter']){_0x40891f[_0x5857('0x3d')]=_[_0x5857('0x3e')](_0x40891f[_0x5857('0x3d')],{'$or':_[_0x5857('0x2d')](_0xf4a711,function(_0x4c6ee0){if(_0x4c6ee0[_0x5857('0x30')]!==_0x5857('0x3f')){var _0x2cbd48={};_0x2cbd48[_0x4c6ee0[_0x5857('0x2b')]]={'$like':'%'+_0x16847a[_0x5857('0x33')][_0x5857('0x40')]+'%'};return _0x2cbd48;}})});}_0x40891f=_[_0x5857('0x3e')]({},_0x40891f,_0x16847a[_0x5857('0x41')]);var _0x1e8bc1={'where':_0x40891f[_0x5857('0x3d')]};return db[_0x5857('0x42')]['count'](_0x1e8bc1)[_0x5857('0x26')](function(_0x29e5f0){_0x39eeeb['count']=_0x29e5f0;if(_0x16847a[_0x5857('0x33')][_0x5857('0x43')]){_0x40891f[_0x5857('0x44')]=[{'all':!![]}];}return db[_0x5857('0x42')][_0x5857('0x45')](_0x40891f);})['then'](function(_0x16cf35){_0x39eeeb[_0x5857('0x46')]=_0x16cf35;return _0x39eeeb;})[_0x5857('0x26')](respondWithFilteredResult(_0x157384,_0x40891f))[_0x5857('0x47')](handleError(_0x157384,null));};exports['show']=function(_0x4fa1ec,_0x3e0378){var _0xdca3e3={'raw':!![],'where':{'id':_0x4fa1ec[_0x5857('0x48')]['id']}},_0x4997d4={};_0x4997d4[_0x5857('0x32')]=_[_0x5857('0x49')](db[_0x5857('0x42')][_0x5857('0x2e')]);_0x4997d4['query']=_[_0x5857('0x49')](_0x4fa1ec[_0x5857('0x33')]);_0x4997d4[_0x5857('0x34')]=_[_0x5857('0x35')](_0x4997d4[_0x5857('0x32')],_0x4997d4['query']);_0xdca3e3[_0x5857('0x36')]=_[_0x5857('0x35')](_0x4997d4[_0x5857('0x32')],qs['fields'](_0x4fa1ec[_0x5857('0x33')]['fields']));_0xdca3e3[_0x5857('0x36')]=_0xdca3e3['attributes'][_0x5857('0x38')]?_0xdca3e3['attributes']:_0x4997d4['model'];if(_0x4fa1ec[_0x5857('0x33')][_0x5857('0x43')]){_0xdca3e3[_0x5857('0x44')]=[{'all':!![]}];}_0xdca3e3=_[_0x5857('0x3e')]({},_0xdca3e3,_0x4fa1ec[_0x5857('0x41')]);return db[_0x5857('0x42')][_0x5857('0x4a')](_0xdca3e3)[_0x5857('0x26')](handleEntityNotFound(_0x3e0378,null))[_0x5857('0x26')](respondWithResult(_0x3e0378,null))[_0x5857('0x47')](handleError(_0x3e0378,null));};exports[_0x5857('0x4b')]=function(_0xb19cb3,_0x1e84e9){return db[_0x5857('0x42')]['create'](_0xb19cb3['body'],{})[_0x5857('0x26')](respondWithResult(_0x1e84e9,0xc9))[_0x5857('0x47')](handleError(_0x1e84e9,null));};exports[_0x5857('0x4c')]=function(_0x34cf48,_0x45cd5c){if(_0x34cf48['body']['id']){delete _0x34cf48[_0x5857('0x4d')]['id'];}return db[_0x5857('0x42')][_0x5857('0x4a')]({'where':{'id':_0x34cf48[_0x5857('0x48')]['id']}})[_0x5857('0x26')](handleEntityNotFound(_0x45cd5c,null))[_0x5857('0x26')](saveUpdates(_0x34cf48[_0x5857('0x4d')],null))[_0x5857('0x26')](respondWithResult(_0x45cd5c,null))[_0x5857('0x47')](handleError(_0x45cd5c,null));};exports[_0x5857('0x27')]=function(_0x7070c1,_0x51e2a1){return db['FaxTransferReport']['find']({'where':{'id':_0x7070c1[_0x5857('0x48')]['id']}})[_0x5857('0x26')](handleEntityNotFound(_0x51e2a1,null))[_0x5857('0x26')](removeEntity(_0x51e2a1,null))[_0x5857('0x47')](handleError(_0x51e2a1,null));};exports[_0x5857('0x4e')]=function(_0x48b679,_0x4f750b){return db[_0x5857('0x42')][_0x5857('0x4e')]()[_0x5857('0x26')](respondWithResult(_0x4f750b,null))[_0x5857('0x47')](handleError(_0x4f750b,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index a805cd2..05e6536 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 _0x737b=['define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x144009,_0x43c8e7){var _0x1b275c=function(_0x59f9bd){while(--_0x59f9bd){_0x144009['push'](_0x144009['shift']());}};_0x1b275c(++_0x43c8e7);}(_0x737b,0x16c));var _0xb737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x737b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb737('0x0'));var util=require(_0xb737('0x1'));var logger=require('../../config/logger')(_0xb737('0x2'));var moment=require(_0xb737('0x3'));var BPromise=require(_0xb737('0x4'));var rp=require(_0xb737('0x5'));var fs=require('fs');var path=require(_0xb737('0x6'));var rimraf=require(_0xb737('0x7'));var config=require(_0xb737('0x8'));var attributes=require(_0xb737('0x9'));module[_0xb737('0xa')]=function(_0x3a718e,_0x1c1cf4){return _0x3a718e[_0xb737('0xb')](_0xb737('0xc'),attributes,{'tableName':_0xb737('0xd'),'paranoid':![],'indexes':[{'name':_0xb737('0xe'),'fields':[_0xb737('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x116c=['./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x43ddd6,_0x5125ed){var _0x15976f=function(_0x1e1b63){while(--_0x1e1b63){_0x43ddd6['push'](_0x43ddd6['shift']());}};_0x15976f(++_0x5125ed);}(_0x116c,0xca));var _0xc116=function(_0x54ec00,_0xed3b66){_0x54ec00=_0x54ec00-0x0;var _0x32517e=_0x116c[_0x54ec00];return _0x32517e;};'use strict';var _=require(_0xc116('0x0'));var util=require(_0xc116('0x1'));var logger=require(_0xc116('0x2'))(_0xc116('0x3'));var moment=require(_0xc116('0x4'));var BPromise=require('bluebird');var rp=require(_0xc116('0x5'));var fs=require('fs');var path=require(_0xc116('0x6'));var rimraf=require('rimraf');var config=require(_0xc116('0x7'));var attributes=require(_0xc116('0x8'));module[_0xc116('0x9')]=function(_0x6ad633,_0x5950a1){return _0x6ad633[_0xc116('0xa')](_0xc116('0xb'),attributes,{'tableName':_0xc116('0xc'),'paranoid':![],'indexes':[{'name':_0xc116('0xd'),'fields':[_0xc116('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 6f98ba9..f9a34a7 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 _0xbfc2=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3a15ce,_0x5f0345){var _0x57cd6b=function(_0xa66edf){while(--_0xa66edf){_0x3a15ce['push'](_0x3a15ce['shift']());}};_0x57cd6b(++_0x5f0345);}(_0xbfc2,0xed));var _0x2bfc=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xbfc2[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x2bfc('0x0'));var util=require(_0x2bfc('0x1'));var moment=require(_0x2bfc('0x2'));var BPromise=require(_0x2bfc('0x3'));var rs=require(_0x2bfc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2bfc('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2bfc('0x6')][_0x2bfc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19d2f1,_0x2b07ff,_0x353ffc){return new BPromise(function(_0x35c066,_0x25c8e9){return client[_0x2bfc('0x8')](_0x19d2f1,_0x353ffc)[_0x2bfc('0x9')](function(_0x2c0662){logger['info'](_0x2bfc('0xa'),_0x2b07ff,_0x2bfc('0xb'));logger[_0x2bfc('0xc')](_0x2bfc('0xd'),_0x2b07ff,_0x2bfc('0xb'),JSON[_0x2bfc('0xe')](_0x2c0662));if(_0x2c0662['error']){if(_0x2c0662[_0x2bfc('0xf')][_0x2bfc('0x10')]===0x1f4){logger[_0x2bfc('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2b07ff,_0x2c0662[_0x2bfc('0xf')][_0x2bfc('0x11')]);return _0x25c8e9(_0x2c0662[_0x2bfc('0xf')][_0x2bfc('0x11')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x2b07ff,_0x2c0662[_0x2bfc('0xf')]['message']);return _0x35c066(_0x2c0662[_0x2bfc('0xf')][_0x2bfc('0x11')]);}else{logger[_0x2bfc('0x12')](_0x2bfc('0xa'),_0x2b07ff,_0x2bfc('0xb'));_0x35c066(_0x2c0662[_0x2bfc('0x13')][_0x2bfc('0x11')]);}})[_0x2bfc('0x14')](function(_0x51a1c8){logger[_0x2bfc('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2b07ff,_0x51a1c8);_0x25c8e9(_0x51a1c8);});});} \ No newline at end of file +var _0x6c33=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','FaxTransferReport,\x20%s,\x20%s','message','info','result','lodash'];(function(_0x5b697a,_0x280202){var _0x5de43b=function(_0x2bc32f){while(--_0x2bc32f){_0x5b697a['push'](_0x5b697a['shift']());}};_0x5de43b(++_0x280202);}(_0x6c33,0x120));var _0x36c3=function(_0x118c30,_0x7eb1eb){_0x118c30=_0x118c30-0x0;var _0x569999=_0x6c33[_0x118c30];return _0x569999;};'use strict';var _=require(_0x36c3('0x0'));var util=require(_0x36c3('0x1'));var moment=require('moment');var BPromise=require(_0x36c3('0x2'));var rs=require(_0x36c3('0x3'));var fs=require('fs');var Redis=require(_0x36c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x36c3('0x5'));var logger=require(_0x36c3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x36c3('0x7')][_0x36c3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3941ef,_0x2e5302,_0x3e5f38){return new BPromise(function(_0x316e3c,_0x4e8ef5){return client['request'](_0x3941ef,_0x3e5f38)['then'](function(_0x344ad4){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x2e5302,_0x36c3('0x9'));logger['debug'](_0x36c3('0xa'),_0x2e5302,_0x36c3('0x9'),JSON['stringify'](_0x344ad4));if(_0x344ad4[_0x36c3('0xb')]){if(_0x344ad4[_0x36c3('0xb')][_0x36c3('0xc')]===0x1f4){logger[_0x36c3('0xb')](_0x36c3('0xd'),_0x2e5302,_0x344ad4[_0x36c3('0xb')]['message']);return _0x4e8ef5(_0x344ad4[_0x36c3('0xb')]['message']);}logger[_0x36c3('0xb')](_0x36c3('0xd'),_0x2e5302,_0x344ad4['error'][_0x36c3('0xe')]);return _0x316e3c(_0x344ad4[_0x36c3('0xb')]['message']);}else{logger[_0x36c3('0xf')](_0x36c3('0xd'),_0x2e5302,_0x36c3('0x9'));_0x316e3c(_0x344ad4[_0x36c3('0x10')][_0x36c3('0xe')]);}})['catch'](function(_0x135cd9){logger[_0x36c3('0xb')](_0x36c3('0xd'),_0x2e5302,_0x135cd9);_0x4e8ef5(_0x135cd9);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 517963f..0527f0d 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 _0x4e43=['/:id','show','create','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x31bab2,_0x107288){var _0x242e5b=function(_0x85b342){while(--_0x85b342){_0x31bab2['push'](_0x31bab2['shift']());}};_0x242e5b(++_0x107288);}(_0x4e43,0x149));var _0x34e4=function(_0x3f22e8,_0x37732a){_0x3f22e8=_0x3f22e8-0x0;var _0x368a7e=_0x4e43[_0x3f22e8];return _0x368a7e;};'use strict';var multer=require('multer');var util=require(_0x34e4('0x0'));var path=require(_0x34e4('0x1'));var timeout=require(_0x34e4('0x2'));var express=require(_0x34e4('0x3'));var router=express[_0x34e4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34e4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x34e4('0x6'));var controller=require(_0x34e4('0x7'));router[_0x34e4('0x8')]('/',auth[_0x34e4('0x9')](),controller[_0x34e4('0xa')]);router[_0x34e4('0x8')](_0x34e4('0xb'),auth[_0x34e4('0x9')](),controller[_0x34e4('0xc')]);router[_0x34e4('0x8')](_0x34e4('0xd'),auth[_0x34e4('0x9')](),controller[_0x34e4('0xe')]);router['post']('/',auth[_0x34e4('0x9')](),controller[_0x34e4('0xf')]);router['put'](_0x34e4('0xd'),auth[_0x34e4('0x9')](),controller['update']);router[_0x34e4('0x10')](_0x34e4('0xd'),auth[_0x34e4('0x9')](),controller[_0x34e4('0x11')]);module[_0x34e4('0x12')]=router; \ No newline at end of file +var _0x9e2d=['isAuthenticated','index','/:id','show','post','create','put','delete','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get'];(function(_0x40b22c,_0x448a14){var _0x3384ed=function(_0x117a98){while(--_0x117a98){_0x40b22c['push'](_0x40b22c['shift']());}};_0x3384ed(++_0x448a14);}(_0x9e2d,0x17e));var _0xd9e2=function(_0x24c1fd,_0x347d2e){_0x24c1fd=_0x24c1fd-0x0;var _0x40cd59=_0x9e2d[_0x24c1fd];return _0x40cd59;};'use strict';var multer=require('multer');var util=require(_0xd9e2('0x0'));var path=require('path');var timeout=require(_0xd9e2('0x1'));var express=require(_0xd9e2('0x2'));var router=express['Router']();var fs_extra=require(_0xd9e2('0x3'));var auth=require(_0xd9e2('0x4'));var interaction=require(_0xd9e2('0x5'));var config=require(_0xd9e2('0x6'));var controller=require(_0xd9e2('0x7'));router[_0xd9e2('0x8')]('/',auth[_0xd9e2('0x9')](),controller[_0xd9e2('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd9e2('0x8')](_0xd9e2('0xb'),auth[_0xd9e2('0x9')](),controller[_0xd9e2('0xc')]);router[_0xd9e2('0xd')]('/',auth['isAuthenticated'](),controller[_0xd9e2('0xe')]);router[_0xd9e2('0xf')]('/:id',auth[_0xd9e2('0x9')](),controller['update']);router[_0xd9e2('0x10')](_0xd9e2('0xb'),auth[_0xd9e2('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index d2c5456..63c68de 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 _0x43fe=['destroy','exports','multer','path','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x186188,_0x329ead){var _0x4d70e6=function(_0x4e71b9){while(--_0x4e71b9){_0x186188['push'](_0x186188['shift']());}};_0x4d70e6(++_0x329ead);}(_0x43fe,0x9c));var _0xe43f=function(_0x4aa2c8,_0x44a256){_0x4aa2c8=_0x4aa2c8-0x0;var _0xf2893e=_0x43fe[_0x4aa2c8];return _0xf2893e;};'use strict';var multer=require(_0xe43f('0x0'));var util=require('util');var path=require(_0xe43f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe43f('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xe43f('0x3'));var config=require(_0xe43f('0x4'));var controller=require(_0xe43f('0x5'));router[_0xe43f('0x6')]('/',auth[_0xe43f('0x7')](),controller[_0xe43f('0x8')]);router[_0xe43f('0x6')](_0xe43f('0x9'),auth[_0xe43f('0x7')](),controller['show']);router['get'](_0xe43f('0xa'),auth[_0xe43f('0x7')](),controller[_0xe43f('0xb')]);router[_0xe43f('0x6')](_0xe43f('0xc'),auth[_0xe43f('0x7')](),controller[_0xe43f('0xd')]);router[_0xe43f('0xe')]('/',auth[_0xe43f('0x7')](),controller[_0xe43f('0xf')]);router['post']('/:id/configurations',auth[_0xe43f('0x7')](),controller[_0xe43f('0x10')]);router[_0xe43f('0x11')]('/:id',auth[_0xe43f('0x7')](),controller[_0xe43f('0x12')]);router[_0xe43f('0x13')](_0xe43f('0x9'),auth[_0xe43f('0x7')](),controller[_0xe43f('0x14')]);module[_0xe43f('0x15')]=router; \ No newline at end of file +var _0x2700=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','post','addConfiguration','put','update','destroy','exports','multer'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x2700,0x1b8));var _0x0270=function(_0x2fa4ee,_0x3e1dea){_0x2fa4ee=_0x2fa4ee-0x0;var _0x11b8aa=_0x2700[_0x2fa4ee];return _0x11b8aa;};'use strict';var multer=require(_0x0270('0x0'));var util=require(_0x0270('0x1'));var path=require(_0x0270('0x2'));var timeout=require(_0x0270('0x3'));var express=require(_0x0270('0x4'));var router=express[_0x0270('0x5')]();var fs_extra=require(_0x0270('0x6'));var auth=require(_0x0270('0x7'));var interaction=require(_0x0270('0x8'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0x0270('0x9')]('/',auth[_0x0270('0xa')](),controller['index']);router['get'](_0x0270('0xb'),auth[_0x0270('0xa')](),controller[_0x0270('0xc')]);router[_0x0270('0x9')](_0x0270('0xd'),auth[_0x0270('0xa')](),controller['getConfigurations']);router['get'](_0x0270('0xe'),auth[_0x0270('0xa')](),controller['getFields']);router[_0x0270('0xf')]('/',auth[_0x0270('0xa')](),controller['create']);router['post']('/:id/configurations',auth[_0x0270('0xa')](),controller[_0x0270('0x10')]);router[_0x0270('0x11')](_0x0270('0xb'),auth['isAuthenticated'](),controller[_0x0270('0x12')]);router['delete'](_0x0270('0xb'),auth['isAuthenticated'](),controller[_0x0270('0x13')]);module[_0x0270('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 669cf54..d5cc07c 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 _0x3cbf=['STRING','ENUM','basic','integrationTab','newTab','sequelize','exports'];(function(_0xe2a016,_0x493eef){var _0x5aece2=function(_0x4926eb){while(--_0x4926eb){_0xe2a016['push'](_0xe2a016['shift']());}};_0x5aece2(++_0x493eef);}(_0x3cbf,0x163));var _0xf3cb=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0x3cbf[_0x14a862];return _0x245eb5;};'use strict';var Sequelize=require(_0xf3cb('0x0'));module[_0xf3cb('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf3cb('0x2')]},'username':{'type':Sequelize[_0xf3cb('0x2')]},'remoteUri':{'type':Sequelize[_0xf3cb('0x2')]},'authType':{'type':Sequelize[_0xf3cb('0x3')](_0xf3cb('0x4')),'defaultValue':_0xf3cb('0x4')},'password':{'type':Sequelize[_0xf3cb('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xf3cb('0x2')]},'tokenSecret':{'type':Sequelize[_0xf3cb('0x2')]},'serverUrl':{'type':Sequelize[_0xf3cb('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf3cb('0x5'),_0xf3cb('0x6')),'defaultValue':_0xf3cb('0x5')}}; \ No newline at end of file +var _0xdb5f=['STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x468e00,_0x812a1f){var _0x500f08=function(_0x150470){while(--_0x150470){_0x468e00['push'](_0x468e00['shift']());}};_0x500f08(++_0x812a1f);}(_0xdb5f,0x9b));var _0xfdb5=function(_0x5c5e15,_0x52a61f){_0x5c5e15=_0x5c5e15-0x0;var _0x32358e=_0xdb5f[_0x5c5e15];return _0x32358e;};'use strict';var Sequelize=require(_0xfdb5('0x0'));module['exports']={'name':{'type':Sequelize[_0xfdb5('0x1')]},'description':{'type':Sequelize[_0xfdb5('0x1')]},'username':{'type':Sequelize[_0xfdb5('0x1')]},'remoteUri':{'type':Sequelize[_0xfdb5('0x1')]},'authType':{'type':Sequelize[_0xfdb5('0x2')](_0xfdb5('0x3')),'defaultValue':_0xfdb5('0x3')},'password':{'type':Sequelize[_0xfdb5('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xfdb5('0x1')]},'token':{'type':Sequelize[_0xfdb5('0x1')]},'tokenSecret':{'type':Sequelize[_0xfdb5('0x1')]},'serverUrl':{'type':Sequelize[_0xfdb5('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xfdb5('0x2')](_0xfdb5('0x4'),_0xfdb5('0x5')),'defaultValue':_0xfdb5('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 3a7acc7..abf226b 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 _0x714f=['Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','tokenSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','toString','concat','entries','active','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','sendStatus','stack','name','send','index','map','DeskAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','options','includeAll','include','findAll','show','params','rawAttributes','catch','create','body','update','find','destroy','getConfigurations','findOne','DeskConfiguration','filter','addConfiguration'];(function(_0x3ab88b,_0x5f53d6){var _0x5f4f78=function(_0x20636b){while(--_0x20636b){_0x3ab88b['push'](_0x3ab88b['shift']());}};_0x5f4f78(++_0x5f53d6);}(_0x714f,0x8e));var _0xf714=function(_0x3227c1,_0x4318c5){_0x3227c1=_0x3227c1-0x0;var _0x31fd48=_0x714f[_0x3227c1];return _0x31fd48;};'use strict';var emlformat=require(_0xf714('0x0'));var rimraf=require(_0xf714('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf714('0x2'));var rp=require(_0xf714('0x3'));var moment=require(_0xf714('0x4'));var BPromise=require(_0xf714('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf714('0x6'));var csv=require(_0xf714('0x7'));var ejs=require(_0xf714('0x8'));var fs=require('fs');var fs_extra=require(_0xf714('0x9'));var _=require(_0xf714('0xa'));var squel=require('squel');var crypto=require(_0xf714('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf714('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf714('0xd'));var Papa=require(_0xf714('0xe'));var Redis=require(_0xf714('0xf'));var authService=require(_0xf714('0x10'));var qs=require(_0xf714('0x11'));var as=require(_0xf714('0x12'));var hardwareService=require(_0xf714('0x13'));var logger=require('../../config/logger')(_0xf714('0x14'));var utils=require(_0xf714('0x15'));var config=require(_0xf714('0x16'));var licenseUtil=require(_0xf714('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x268eb3,_0x15296){_0x15296=_0x15296||0xcc;return function(_0x8e2718){if(_0x8e2718){return _0x268eb3['sendStatus'](_0x15296);}return _0x268eb3[_0xf714('0x18')](_0x15296)[_0xf714('0x19')]();};}function respondWithResult(_0x532fc8,_0x26146a){_0x26146a=_0x26146a||0xc8;return function(_0x383abe){if(_0x383abe){return _0x532fc8['status'](_0x26146a)[_0xf714('0x1a')](_0x383abe);}};}function respondWithFilteredResult(_0x358005,_0x1eca32){return function(_0x19a186){if(_0x19a186){var _0x17bdbd=typeof _0x1eca32[_0xf714('0x1b')]===_0xf714('0x1c')&&typeof _0x1eca32['limit']==='undefined';var _0x32c6d5=_0x19a186['count'];var _0x1fd8bc=_0x17bdbd?0x0:_0x1eca32[_0xf714('0x1b')];var _0x4ff76d=_0x17bdbd?_0x19a186[_0xf714('0x1d')]:_0x1eca32[_0xf714('0x1b')]+_0x1eca32['limit'];var _0x2f44bb;if(_0x4ff76d>=_0x32c6d5){_0x4ff76d=_0x32c6d5;_0x2f44bb=0xc8;}else{_0x2f44bb=0xce;}_0x358005[_0xf714('0x18')](_0x2f44bb);return _0x358005['set'](_0xf714('0x1e'),_0x1fd8bc+'-'+_0x4ff76d+'/'+_0x32c6d5)[_0xf714('0x1a')](_0x19a186);}return null;};}function patchUpdates(_0x36694e){return function(_0x2b5142){try{jsonpatch[_0xf714('0x1f')](_0x2b5142,_0x36694e,!![]);}catch(_0x4af83f){return BPromise[_0xf714('0x20')](_0x4af83f);}return _0x2b5142[_0xf714('0x21')]();};}function saveUpdates(_0x224208,_0x419a9e){return function(_0x1bddc6){if(_0x1bddc6){return _0x1bddc6['update'](_0x224208)[_0xf714('0x22')](function(_0x125a1d){return _0x125a1d;});}return null;};}function removeEntity(_0x15d238,_0x5af086){return function(_0x12d8ca){if(_0x12d8ca){return _0x12d8ca['destroy']()[_0xf714('0x22')](function(){_0x15d238[_0xf714('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b580c,_0x723b9d){return function(_0x2b223c){if(!_0x2b223c){_0x3b580c[_0xf714('0x23')](0x194);}return _0x2b223c;};}function handleError(_0x40c4bb,_0xb7361f){_0xb7361f=_0xb7361f||0x1f4;return function(_0x4d5719){logger['error'](_0x4d5719[_0xf714('0x24')]);if(_0x4d5719['name']){delete _0x4d5719[_0xf714('0x25')];}_0x40c4bb[_0xf714('0x18')](_0xb7361f)[_0xf714('0x26')](_0x4d5719);};}exports[_0xf714('0x27')]=function(_0x2fc894,_0x46976c){var _0x4bff93={},_0xf0ab72={},_0x41633a={'count':0x0,'rows':[]};var _0x27fc3a=_[_0xf714('0x28')](db[_0xf714('0x29')]['rawAttributes'],function(_0x3f4aa8){return{'name':_0x3f4aa8[_0xf714('0x2a')],'type':_0x3f4aa8[_0xf714('0x2b')]['key']};});_0xf0ab72[_0xf714('0x2c')]=_[_0xf714('0x28')](_0x27fc3a,_0xf714('0x25'));_0xf0ab72[_0xf714('0x2d')]=_[_0xf714('0x2e')](_0x2fc894['query']);_0xf0ab72[_0xf714('0x2f')]=_[_0xf714('0x30')](_0xf0ab72[_0xf714('0x2c')],_0xf0ab72[_0xf714('0x2d')]);_0x4bff93[_0xf714('0x31')]=_[_0xf714('0x30')](_0xf0ab72[_0xf714('0x2c')],qs[_0xf714('0x32')](_0x2fc894[_0xf714('0x2d')]['fields']));_0x4bff93[_0xf714('0x31')]=_0x4bff93[_0xf714('0x31')][_0xf714('0x33')]?_0x4bff93[_0xf714('0x31')]:_0xf0ab72['model'];if(!_0x2fc894[_0xf714('0x2d')][_0xf714('0x34')](_0xf714('0x35'))){_0x4bff93[_0xf714('0x36')]=qs['limit'](_0x2fc894['query'][_0xf714('0x36')]);_0x4bff93[_0xf714('0x1b')]=qs[_0xf714('0x1b')](_0x2fc894[_0xf714('0x2d')][_0xf714('0x1b')]);}_0x4bff93[_0xf714('0x37')]=qs[_0xf714('0x38')](_0x2fc894[_0xf714('0x2d')][_0xf714('0x38')]);_0x4bff93[_0xf714('0x39')]=qs[_0xf714('0x2f')](_[_0xf714('0x3a')](_0x2fc894[_0xf714('0x2d')],_0xf0ab72[_0xf714('0x2f')]),_0x27fc3a);if(_0x2fc894['query']['filter']){_0x4bff93['where']=_[_0xf714('0x3b')](_0x4bff93[_0xf714('0x39')],{'$or':_[_0xf714('0x28')](_0x27fc3a,function(_0x5e998d){if(_0x5e998d[_0xf714('0x2b')]!=='VIRTUAL'){var _0x545e01={};_0x545e01[_0x5e998d[_0xf714('0x25')]]={'$like':'%'+_0x2fc894[_0xf714('0x2d')]['filter']+'%'};return _0x545e01;}})});}_0x4bff93=_[_0xf714('0x3b')]({},_0x4bff93,_0x2fc894[_0xf714('0x3c')]);var _0x44bfa6={'where':_0x4bff93[_0xf714('0x39')]};return db['DeskAccount'][_0xf714('0x1d')](_0x44bfa6)[_0xf714('0x22')](function(_0x3d9193){_0x41633a['count']=_0x3d9193;if(_0x2fc894['query'][_0xf714('0x3d')]){_0x4bff93[_0xf714('0x3e')]=[{'all':!![]}];}return db[_0xf714('0x29')][_0xf714('0x3f')](_0x4bff93);})[_0xf714('0x22')](function(_0x4dbdfd){_0x41633a['rows']=_0x4dbdfd;return _0x41633a;})['then'](respondWithFilteredResult(_0x46976c,_0x4bff93))['catch'](handleError(_0x46976c,null));};exports[_0xf714('0x40')]=function(_0x11e8c9,_0x37085b){var _0x1bb042={'raw':![],'where':{'id':_0x11e8c9[_0xf714('0x41')]['id']}},_0x229a72={};_0x229a72['model']=_[_0xf714('0x2e')](db['DeskAccount'][_0xf714('0x42')]);_0x229a72[_0xf714('0x2d')]=_['keys'](_0x11e8c9[_0xf714('0x2d')]);_0x229a72[_0xf714('0x2f')]=_[_0xf714('0x30')](_0x229a72[_0xf714('0x2c')],_0x229a72['query']);_0x1bb042[_0xf714('0x31')]=_[_0xf714('0x30')](_0x229a72[_0xf714('0x2c')],qs[_0xf714('0x32')](_0x11e8c9[_0xf714('0x2d')][_0xf714('0x32')]));_0x1bb042[_0xf714('0x31')]=_0x1bb042['attributes'][_0xf714('0x33')]?_0x1bb042['attributes']:_0x229a72[_0xf714('0x2c')];if(_0x11e8c9[_0xf714('0x2d')]['includeAll']){_0x1bb042[_0xf714('0x3e')]=[{'all':!![]}];}_0x1bb042=_[_0xf714('0x3b')]({},_0x1bb042,_0x11e8c9['options']);return db['DeskAccount']['find'](_0x1bb042)[_0xf714('0x22')](handleEntityNotFound(_0x37085b,null))['then'](respondWithResult(_0x37085b,null))[_0xf714('0x43')](handleError(_0x37085b,null));};exports[_0xf714('0x44')]=function(_0x534763,_0xbd65b8){return db['DeskAccount'][_0xf714('0x44')](_0x534763[_0xf714('0x45')],{})['then'](respondWithResult(_0xbd65b8,0xc9))[_0xf714('0x43')](handleError(_0xbd65b8,null));};exports[_0xf714('0x46')]=function(_0x38e0b1,_0x185004){if(_0x38e0b1[_0xf714('0x45')]['id']){delete _0x38e0b1[_0xf714('0x45')]['id'];}return db[_0xf714('0x29')][_0xf714('0x47')]({'where':{'id':_0x38e0b1['params']['id']}})[_0xf714('0x22')](handleEntityNotFound(_0x185004,null))[_0xf714('0x22')](saveUpdates(_0x38e0b1['body'],null))[_0xf714('0x22')](respondWithResult(_0x185004,null))[_0xf714('0x43')](handleError(_0x185004,null));};exports[_0xf714('0x48')]=function(_0x56a222,_0x5a6d16){return db[_0xf714('0x29')][_0xf714('0x47')]({'where':{'id':_0x56a222[_0xf714('0x41')]['id']}})[_0xf714('0x22')](handleEntityNotFound(_0x5a6d16,null))[_0xf714('0x22')](removeEntity(_0x5a6d16,null))[_0xf714('0x43')](handleError(_0x5a6d16,null));};exports[_0xf714('0x49')]=function(_0x3ded37,_0x194d5d,_0x350685){var _0x38895e={};var _0x23aede={};var _0x89d21d;var _0x2464d0;return db[_0xf714('0x29')][_0xf714('0x4a')]({'where':{'id':_0x3ded37[_0xf714('0x41')]['id']}})['then'](handleEntityNotFound(_0x194d5d,null))[_0xf714('0x22')](function(_0x2d37b3){if(_0x2d37b3){_0x89d21d=_0x2d37b3;_0x23aede[_0xf714('0x2c')]=_[_0xf714('0x2e')](db[_0xf714('0x4b')][_0xf714('0x42')]);_0x23aede[_0xf714('0x2d')]=_['keys'](_0x3ded37[_0xf714('0x2d')]);_0x23aede[_0xf714('0x2f')]=_[_0xf714('0x30')](_0x23aede['model'],_0x23aede['query']);_0x38895e[_0xf714('0x31')]=_['intersection'](_0x23aede['model'],qs['fields'](_0x3ded37[_0xf714('0x2d')][_0xf714('0x32')]));_0x38895e[_0xf714('0x31')]=_0x38895e[_0xf714('0x31')]['length']?_0x38895e['attributes']:_0x23aede[_0xf714('0x2c')];_0x38895e[_0xf714('0x37')]=qs['sort'](_0x3ded37[_0xf714('0x2d')][_0xf714('0x38')]);_0x38895e[_0xf714('0x39')]=qs[_0xf714('0x2f')](_[_0xf714('0x3a')](_0x3ded37[_0xf714('0x2d')],_0x23aede['filters']));if(_0x3ded37[_0xf714('0x2d')][_0xf714('0x4c')]){_0x38895e[_0xf714('0x39')]=_['merge'](_0x38895e[_0xf714('0x39')],{'$or':_[_0xf714('0x28')](_0x38895e[_0xf714('0x31')],function(_0x235749){var _0x532558={};_0x532558[_0x235749]={'$like':'%'+_0x3ded37['query'][_0xf714('0x4c')]+'%'};return _0x532558;})});}_0x38895e=_[_0xf714('0x3b')]({},_0x38895e,_0x3ded37[_0xf714('0x3c')]);return _0x89d21d[_0xf714('0x49')](_0x38895e);}})[_0xf714('0x22')](function(_0x23b480){if(_0x23b480){_0x2464d0=_0x23b480[_0xf714('0x33')];if(!_0x3ded37['query']['hasOwnProperty'](_0xf714('0x35'))){_0x38895e[_0xf714('0x36')]=qs[_0xf714('0x36')](_0x3ded37[_0xf714('0x2d')][_0xf714('0x36')]);_0x38895e[_0xf714('0x1b')]=qs[_0xf714('0x1b')](_0x3ded37[_0xf714('0x2d')][_0xf714('0x1b')]);}return _0x89d21d[_0xf714('0x49')](_0x38895e);}})[_0xf714('0x22')](function(_0x871e52){if(_0x871e52){return _0x871e52?{'count':_0x2464d0,'rows':_0x871e52}:null;}})[_0xf714('0x22')](respondWithResult(_0x194d5d,null))[_0xf714('0x43')](handleError(_0x194d5d,null));};exports[_0xf714('0x4d')]=function(_0x3f3d2c,_0x3b8b7c,_0x157fd9){if(_0x3f3d2c[_0xf714('0x45')]['id']){delete _0x3f3d2c[_0xf714('0x45')]['id'];}return db['DeskAccount'][_0xf714('0x4a')]({'where':{'id':_0x3f3d2c['params']['id']}})['then'](handleEntityNotFound(_0x3b8b7c,null))[_0xf714('0x22')](function(_0x16cb1a){if(_0x16cb1a){_0x3f3d2c[_0xf714('0x45')]['AccountId']=_0x16cb1a['id'];_0x3f3d2c[_0xf714('0x45')][_0xf714('0x4e')]=integrations[_0xf714('0x4f')](_0x3f3d2c[_0xf714('0x45')][_0xf714('0x50')],_0x3f3d2c['body'][_0xf714('0x2b')]);_0x3f3d2c[_0xf714('0x45')][_0xf714('0x51')]=integrations[_0xf714('0x52')](_0x3f3d2c[_0xf714('0x45')][_0xf714('0x50')],_0x3f3d2c[_0xf714('0x45')]['type']);return db[_0xf714('0x4b')][_0xf714('0x44')](_0x3f3d2c[_0xf714('0x45')],{'include':[{'model':db['DeskField'],'as':_0xf714('0x4e')},{'model':db[_0xf714('0x53')],'as':_0xf714('0x51')}]});}return null;})[_0xf714('0x22')](respondWithResult(_0x3b8b7c,null))['catch'](handleError(_0x3b8b7c,null));};exports[_0xf714('0x54')]=function(_0xd8f3,_0x5aed71,_0x7ed5f){var _0x42c571=[{'name':_0xf714('0x55'),'label':_0xf714('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x295e3b='';return db['DeskAccount']['findOne']({'where':{'id':_0xd8f3[_0xf714('0x41')]['id']},'attributes':['id',_0xf714('0x56'),_0xf714('0x57'),'username',_0xf714('0x58'),_0xf714('0x59'),_0xf714('0x5a'),'token',_0xf714('0x5b')]})[_0xf714('0x22')](handleEntityNotFound(_0x5aed71,null))[_0xf714('0x22')](function(_0x54cbe8){if(_0x54cbe8){_0x295e3b=_0x54cbe8[_0xf714('0x56')];var _0x4ac45e=_0x295e3b[_0xf714('0x5c')](-0x1);if(_0x4ac45e==='/'){_0x295e3b=_0x295e3b[_0xf714('0x5d')](0x0,_0x295e3b[_0xf714('0x5e')](_0x4ac45e));}var _0x199fc9={'method':'GET','uri':util[_0xf714('0x5f')](_0xf714('0x60'),_0x295e3b),'headers':{'Content-Type':_0xf714('0x61'),'Accept':_0xf714('0x61')},'json':!![]};if(_0x54cbe8[_0xf714('0x57')]===_0xf714('0x62')){_0x199fc9[_0xf714('0x63')]['Authorization']=util['format'](_0xf714('0x64'),new Buffer(util[_0xf714('0x5f')]('%s:%s',_0x54cbe8['username'],_0x54cbe8['password']))[_0xf714('0x65')]('base64'));}return rp(_0x199fc9)[_0xf714('0x22')](function(_0x36097f){return _0x42c571[_0xf714('0x66')](_[_0xf714('0x28')](_0x36097f['_embedded'][_0xf714('0x67')],function(_0x53aab4){return{'id':_0x53aab4[_0xf714('0x25')],'name':_0x53aab4[_0xf714('0x25')],'type':_0x53aab4['type'],'active':_0x53aab4[_0xf714('0x68')],'label':_0x53aab4['label'],'custom':!![]};}));});}})[_0xf714('0x22')](function(_0x1e6edc){return{'count':_0x1e6edc[_0xf714('0x33')],'rows':_0x1e6edc};})[_0xf714('0x22')](respondWithResult(_0x5aed71,null))[_0xf714('0x43')](function(_0x107c70){var _0x3afc44=_0xd8f3[_0xf714('0x2d')][_0xf714('0x69')]?0x1f4:_0x107c70['statusCode']||0x1f4;logger[_0xf714('0x6a')](_0xf714('0x6b'),_0xf714('0x54'),_0x3afc44,JSON[_0xf714('0x6c')](_0x107c70));delete _0x107c70[_0xf714('0x25')];if(_0x3afc44===0x191){_0x3afc44=0x190;}_0x5aed71['status'](_0x3afc44)[_0xf714('0x26')](_0xd8f3[_0xf714('0x2d')][_0xf714('0x69')]?{'message':_0xf714('0x6d'),'statusCode':_0x107c70['statusCode']}:_0x107c70);});}; \ No newline at end of file +var _0x391d=['apply','reject','save','update','then','sendStatus','error','stack','name','index','map','DeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','catch','create','body','destroy','getConfigurations','pick','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','type','Descriptions','getDescriptions','Subjects','getFields','priority','findOne','remoteUri','username','consumerKey','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','headers','Basic\x20%s','%s:%s','password','toString','base64','concat','active','label','test','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count'];(function(_0x2f90ed,_0x90af12){var _0x4cda45=function(_0x46e1ca){while(--_0x46e1ca){_0x2f90ed['push'](_0x2f90ed['shift']());}};_0x4cda45(++_0x90af12);}(_0x391d,0xc6));var _0xd391=function(_0x39bf21,_0x5c2e3f){_0x39bf21=_0x39bf21-0x0;var _0x19c6e9=_0x391d[_0x39bf21];return _0x19c6e9;};'use strict';var emlformat=require(_0xd391('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd391('0x1'));var rp=require(_0xd391('0x2'));var moment=require(_0xd391('0x3'));var BPromise=require(_0xd391('0x4'));var Mustache=require(_0xd391('0x5'));var util=require(_0xd391('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd391('0x7'));var fs=require('fs');var fs_extra=require(_0xd391('0x8'));var _=require('lodash');var squel=require(_0xd391('0x9'));var crypto=require(_0xd391('0xa'));var jsforce=require(_0xd391('0xb'));var deskjs=require(_0xd391('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd391('0xd'));var Papa=require('papaparse');var Redis=require(_0xd391('0xe'));var authService=require(_0xd391('0xf'));var qs=require(_0xd391('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd391('0x11'));var logger=require('../../config/logger')(_0xd391('0x12'));var utils=require(_0xd391('0x13'));var config=require(_0xd391('0x14'));var licenseUtil=require(_0xd391('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd391('0x16'));function respondWithStatusCode(_0x7d6bae,_0x22c1e2){_0x22c1e2=_0x22c1e2||0xcc;return function(_0x2f3811){if(_0x2f3811){return _0x7d6bae['sendStatus'](_0x22c1e2);}return _0x7d6bae[_0xd391('0x17')](_0x22c1e2)[_0xd391('0x18')]();};}function respondWithResult(_0x1f149d,_0x1fc134){_0x1fc134=_0x1fc134||0xc8;return function(_0x3f3918){if(_0x3f3918){return _0x1f149d[_0xd391('0x17')](_0x1fc134)[_0xd391('0x19')](_0x3f3918);}};}function respondWithFilteredResult(_0x2bf9b6,_0x144245){return function(_0x11db3c){if(_0x11db3c){var _0x3fa735=typeof _0x144245[_0xd391('0x1a')]===_0xd391('0x1b')&&typeof _0x144245[_0xd391('0x1c')]===_0xd391('0x1b');var _0x2b6b53=_0x11db3c['count'];var _0x42cf82=_0x3fa735?0x0:_0x144245['offset'];var _0x59ec39=_0x3fa735?_0x11db3c[_0xd391('0x1d')]:_0x144245['offset']+_0x144245[_0xd391('0x1c')];var _0x1580f4;if(_0x59ec39>=_0x2b6b53){_0x59ec39=_0x2b6b53;_0x1580f4=0xc8;}else{_0x1580f4=0xce;}_0x2bf9b6[_0xd391('0x17')](_0x1580f4);return _0x2bf9b6['set']('Content-Range',_0x42cf82+'-'+_0x59ec39+'/'+_0x2b6b53)[_0xd391('0x19')](_0x11db3c);}return null;};}function patchUpdates(_0xa43f17){return function(_0x2022cf){try{jsonpatch[_0xd391('0x1e')](_0x2022cf,_0xa43f17,!![]);}catch(_0x3dea88){return BPromise[_0xd391('0x1f')](_0x3dea88);}return _0x2022cf[_0xd391('0x20')]();};}function saveUpdates(_0x222ebe,_0x4fbc35){return function(_0x513e45){if(_0x513e45){return _0x513e45[_0xd391('0x21')](_0x222ebe)[_0xd391('0x22')](function(_0x25f0f6){return _0x25f0f6;});}return null;};}function removeEntity(_0x45165a,_0x8bc5ed){return function(_0x414af2){if(_0x414af2){return _0x414af2['destroy']()[_0xd391('0x22')](function(){_0x45165a[_0xd391('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc1b584,_0x50b1d0){return function(_0x4a2fc3){if(!_0x4a2fc3){_0xc1b584[_0xd391('0x23')](0x194);}return _0x4a2fc3;};}function handleError(_0xc8ac1,_0x484823){_0x484823=_0x484823||0x1f4;return function(_0x34ae9a){logger[_0xd391('0x24')](_0x34ae9a[_0xd391('0x25')]);if(_0x34ae9a[_0xd391('0x26')]){delete _0x34ae9a['name'];}_0xc8ac1[_0xd391('0x17')](_0x484823)['send'](_0x34ae9a);};}exports[_0xd391('0x27')]=function(_0x5941b0,_0x3d7ac1){var _0x5b5525={},_0x4534b9={},_0xe243d2={'count':0x0,'rows':[]};var _0x2dd85b=_[_0xd391('0x28')](db[_0xd391('0x29')][_0xd391('0x2a')],function(_0x184543){return{'name':_0x184543[_0xd391('0x2b')],'type':_0x184543['type'][_0xd391('0x2c')]};});_0x4534b9[_0xd391('0x2d')]=_['map'](_0x2dd85b,_0xd391('0x26'));_0x4534b9[_0xd391('0x2e')]=_[_0xd391('0x2f')](_0x5941b0['query']);_0x4534b9[_0xd391('0x30')]=_['intersection'](_0x4534b9[_0xd391('0x2d')],_0x4534b9[_0xd391('0x2e')]);_0x5b5525[_0xd391('0x31')]=_[_0xd391('0x32')](_0x4534b9[_0xd391('0x2d')],qs['fields'](_0x5941b0[_0xd391('0x2e')]['fields']));_0x5b5525[_0xd391('0x31')]=_0x5b5525[_0xd391('0x31')][_0xd391('0x33')]?_0x5b5525['attributes']:_0x4534b9[_0xd391('0x2d')];if(!_0x5941b0[_0xd391('0x2e')]['hasOwnProperty'](_0xd391('0x34'))){_0x5b5525[_0xd391('0x1c')]=qs['limit'](_0x5941b0[_0xd391('0x2e')][_0xd391('0x1c')]);_0x5b5525[_0xd391('0x1a')]=qs['offset'](_0x5941b0[_0xd391('0x2e')][_0xd391('0x1a')]);}_0x5b5525[_0xd391('0x35')]=qs[_0xd391('0x36')](_0x5941b0['query'][_0xd391('0x36')]);_0x5b5525[_0xd391('0x37')]=qs[_0xd391('0x30')](_['pick'](_0x5941b0[_0xd391('0x2e')],_0x4534b9[_0xd391('0x30')]),_0x2dd85b);if(_0x5941b0[_0xd391('0x2e')][_0xd391('0x38')]){_0x5b5525['where']=_[_0xd391('0x39')](_0x5b5525['where'],{'$or':_['map'](_0x2dd85b,function(_0x55d3ca){if(_0x55d3ca['type']!==_0xd391('0x3a')){var _0x211ed9={};_0x211ed9[_0x55d3ca[_0xd391('0x26')]]={'$like':'%'+_0x5941b0[_0xd391('0x2e')][_0xd391('0x38')]+'%'};return _0x211ed9;}})});}_0x5b5525=_['merge']({},_0x5b5525,_0x5941b0[_0xd391('0x3b')]);var _0xc6aac9={'where':_0x5b5525[_0xd391('0x37')]};return db[_0xd391('0x29')][_0xd391('0x1d')](_0xc6aac9)['then'](function(_0xf76080){_0xe243d2['count']=_0xf76080;if(_0x5941b0[_0xd391('0x2e')][_0xd391('0x3c')]){_0x5b5525[_0xd391('0x3d')]=[{'all':!![]}];}return db[_0xd391('0x29')][_0xd391('0x3e')](_0x5b5525);})[_0xd391('0x22')](function(_0x4b40a6){_0xe243d2[_0xd391('0x3f')]=_0x4b40a6;return _0xe243d2;})[_0xd391('0x22')](respondWithFilteredResult(_0x3d7ac1,_0x5b5525))['catch'](handleError(_0x3d7ac1,null));};exports[_0xd391('0x40')]=function(_0xd1c20c,_0x30f4cd){var _0x4ea16e={'raw':![],'where':{'id':_0xd1c20c[_0xd391('0x41')]['id']}},_0x35f6b6={};_0x35f6b6[_0xd391('0x2d')]=_[_0xd391('0x2f')](db[_0xd391('0x29')]['rawAttributes']);_0x35f6b6[_0xd391('0x2e')]=_['keys'](_0xd1c20c[_0xd391('0x2e')]);_0x35f6b6['filters']=_[_0xd391('0x32')](_0x35f6b6[_0xd391('0x2d')],_0x35f6b6['query']);_0x4ea16e[_0xd391('0x31')]=_[_0xd391('0x32')](_0x35f6b6['model'],qs[_0xd391('0x42')](_0xd1c20c[_0xd391('0x2e')][_0xd391('0x42')]));_0x4ea16e['attributes']=_0x4ea16e['attributes'][_0xd391('0x33')]?_0x4ea16e[_0xd391('0x31')]:_0x35f6b6[_0xd391('0x2d')];if(_0xd1c20c[_0xd391('0x2e')][_0xd391('0x3c')]){_0x4ea16e[_0xd391('0x3d')]=[{'all':!![]}];}_0x4ea16e=_['merge']({},_0x4ea16e,_0xd1c20c['options']);return db[_0xd391('0x29')][_0xd391('0x43')](_0x4ea16e)[_0xd391('0x22')](handleEntityNotFound(_0x30f4cd,null))[_0xd391('0x22')](respondWithResult(_0x30f4cd,null))[_0xd391('0x44')](handleError(_0x30f4cd,null));};exports[_0xd391('0x45')]=function(_0x1f75bb,_0x3695d7){return db[_0xd391('0x29')][_0xd391('0x45')](_0x1f75bb[_0xd391('0x46')],{})['then'](respondWithResult(_0x3695d7,0xc9))[_0xd391('0x44')](handleError(_0x3695d7,null));};exports['update']=function(_0xfac182,_0x488873){if(_0xfac182[_0xd391('0x46')]['id']){delete _0xfac182[_0xd391('0x46')]['id'];}return db['DeskAccount'][_0xd391('0x43')]({'where':{'id':_0xfac182['params']['id']}})['then'](handleEntityNotFound(_0x488873,null))['then'](saveUpdates(_0xfac182[_0xd391('0x46')],null))[_0xd391('0x22')](respondWithResult(_0x488873,null))[_0xd391('0x44')](handleError(_0x488873,null));};exports[_0xd391('0x47')]=function(_0x1bc786,_0x4806c1){return db[_0xd391('0x29')][_0xd391('0x43')]({'where':{'id':_0x1bc786[_0xd391('0x41')]['id']}})[_0xd391('0x22')](handleEntityNotFound(_0x4806c1,null))['then'](removeEntity(_0x4806c1,null))['catch'](handleError(_0x4806c1,null));};exports[_0xd391('0x48')]=function(_0x162254,_0x2b3c86,_0x2114b3){var _0x478aa2={};var _0x479658={};var _0x2a1026;var _0x2d8bdd;return db['DeskAccount']['findOne']({'where':{'id':_0x162254[_0xd391('0x41')]['id']}})[_0xd391('0x22')](handleEntityNotFound(_0x2b3c86,null))[_0xd391('0x22')](function(_0xbfa2b7){if(_0xbfa2b7){_0x2a1026=_0xbfa2b7;_0x479658[_0xd391('0x2d')]=_[_0xd391('0x2f')](db['DeskConfiguration'][_0xd391('0x2a')]);_0x479658[_0xd391('0x2e')]=_[_0xd391('0x2f')](_0x162254[_0xd391('0x2e')]);_0x479658[_0xd391('0x30')]=_[_0xd391('0x32')](_0x479658['model'],_0x479658[_0xd391('0x2e')]);_0x478aa2[_0xd391('0x31')]=_[_0xd391('0x32')](_0x479658['model'],qs['fields'](_0x162254[_0xd391('0x2e')][_0xd391('0x42')]));_0x478aa2[_0xd391('0x31')]=_0x478aa2[_0xd391('0x31')][_0xd391('0x33')]?_0x478aa2[_0xd391('0x31')]:_0x479658[_0xd391('0x2d')];_0x478aa2[_0xd391('0x35')]=qs[_0xd391('0x36')](_0x162254[_0xd391('0x2e')][_0xd391('0x36')]);_0x478aa2['where']=qs[_0xd391('0x30')](_[_0xd391('0x49')](_0x162254[_0xd391('0x2e')],_0x479658[_0xd391('0x30')]));if(_0x162254[_0xd391('0x2e')][_0xd391('0x38')]){_0x478aa2[_0xd391('0x37')]=_['merge'](_0x478aa2['where'],{'$or':_[_0xd391('0x28')](_0x478aa2[_0xd391('0x31')],function(_0x175f5e){var _0x46a062={};_0x46a062[_0x175f5e]={'$like':'%'+_0x162254[_0xd391('0x2e')][_0xd391('0x38')]+'%'};return _0x46a062;})});}_0x478aa2=_[_0xd391('0x39')]({},_0x478aa2,_0x162254['options']);return _0x2a1026['getConfigurations'](_0x478aa2);}})['then'](function(_0x3e85f5){if(_0x3e85f5){_0x2d8bdd=_0x3e85f5['length'];if(!_0x162254[_0xd391('0x2e')][_0xd391('0x4a')](_0xd391('0x34'))){_0x478aa2[_0xd391('0x1c')]=qs[_0xd391('0x1c')](_0x162254[_0xd391('0x2e')][_0xd391('0x1c')]);_0x478aa2['offset']=qs[_0xd391('0x1a')](_0x162254[_0xd391('0x2e')][_0xd391('0x1a')]);}return _0x2a1026[_0xd391('0x48')](_0x478aa2);}})[_0xd391('0x22')](function(_0x92d8fd){if(_0x92d8fd){return _0x92d8fd?{'count':_0x2d8bdd,'rows':_0x92d8fd}:null;}})['then'](respondWithResult(_0x2b3c86,null))[_0xd391('0x44')](handleError(_0x2b3c86,null));};exports[_0xd391('0x4b')]=function(_0x4f34c9,_0x219624,_0x408105){if(_0x4f34c9[_0xd391('0x46')]['id']){delete _0x4f34c9[_0xd391('0x46')]['id'];}return db[_0xd391('0x29')]['findOne']({'where':{'id':_0x4f34c9['params']['id']}})[_0xd391('0x22')](handleEntityNotFound(_0x219624,null))['then'](function(_0x129c8e){if(_0x129c8e){_0x4f34c9[_0xd391('0x46')][_0xd391('0x4c')]=_0x129c8e['id'];_0x4f34c9[_0xd391('0x46')]['Subjects']=integrations[_0xd391('0x4d')](_0x4f34c9['body'][_0xd391('0x4e')],_0x4f34c9[_0xd391('0x46')][_0xd391('0x4f')]);_0x4f34c9[_0xd391('0x46')][_0xd391('0x50')]=integrations[_0xd391('0x51')](_0x4f34c9[_0xd391('0x46')][_0xd391('0x4e')],_0x4f34c9[_0xd391('0x46')][_0xd391('0x4f')]);return db['DeskConfiguration'][_0xd391('0x45')](_0x4f34c9[_0xd391('0x46')],{'include':[{'model':db['DeskField'],'as':_0xd391('0x52')},{'model':db['DeskField'],'as':_0xd391('0x50')}]});}return null;})[_0xd391('0x22')](respondWithResult(_0x219624,null))[_0xd391('0x44')](handleError(_0x219624,null));};exports[_0xd391('0x53')]=function(_0x3a6643,_0x18cc1a,_0x303c3c){var _0x3f401e=[{'name':_0xd391('0x54'),'label':_0xd391('0x54'),'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 _0x409315='';return db[_0xd391('0x29')][_0xd391('0x55')]({'where':{'id':_0x3a6643[_0xd391('0x41')]['id']},'attributes':['id',_0xd391('0x56'),'authType',_0xd391('0x57'),'password',_0xd391('0x58'),'consumerSecret',_0xd391('0x59'),_0xd391('0x5a')]})[_0xd391('0x22')](handleEntityNotFound(_0x18cc1a,null))[_0xd391('0x22')](function(_0x383a84){if(_0x383a84){_0x409315=_0x383a84[_0xd391('0x56')];var _0x5b9a7c=_0x409315[_0xd391('0x5b')](-0x1);if(_0x5b9a7c==='/'){_0x409315=_0x409315[_0xd391('0x5c')](0x0,_0x409315[_0xd391('0x5d')](_0x5b9a7c));}var _0x3164d0={'method':_0xd391('0x5e'),'uri':util[_0xd391('0x5f')](_0xd391('0x60'),_0x409315),'headers':{'Content-Type':_0xd391('0x61'),'Accept':_0xd391('0x61')},'json':!![]};if(_0x383a84[_0xd391('0x62')]===_0xd391('0x63')){_0x3164d0[_0xd391('0x64')]['Authorization']=util[_0xd391('0x5f')](_0xd391('0x65'),new Buffer(util['format'](_0xd391('0x66'),_0x383a84[_0xd391('0x57')],_0x383a84[_0xd391('0x67')]))[_0xd391('0x68')](_0xd391('0x69')));}return rp(_0x3164d0)[_0xd391('0x22')](function(_0x29bf91){return _0x3f401e[_0xd391('0x6a')](_[_0xd391('0x28')](_0x29bf91['_embedded']['entries'],function(_0xa2e92b){return{'id':_0xa2e92b[_0xd391('0x26')],'name':_0xa2e92b[_0xd391('0x26')],'type':_0xa2e92b[_0xd391('0x4f')],'active':_0xa2e92b[_0xd391('0x6b')],'label':_0xa2e92b[_0xd391('0x6c')],'custom':!![]};}));});}})[_0xd391('0x22')](function(_0x544d6c){return{'count':_0x544d6c[_0xd391('0x33')],'rows':_0x544d6c};})['then'](respondWithResult(_0x18cc1a,null))[_0xd391('0x44')](function(_0x475263){var _0x4c3eeb=_0x3a6643[_0xd391('0x2e')][_0xd391('0x6d')]?0x1f4:_0x475263['statusCode']||0x1f4;logger[_0xd391('0x24')](_0xd391('0x6e'),'getFields',_0x4c3eeb,JSON['stringify'](_0x475263));delete _0x475263[_0xd391('0x26')];if(_0x4c3eeb===0x191){_0x4c3eeb=0x190;}_0x18cc1a[_0xd391('0x17')](_0x4c3eeb)[_0xd391('0x6f')](_0x3a6643[_0xd391('0x2e')][_0xd391('0x6d')]?{'message':_0xd391('0x70'),'statusCode':_0x475263[_0xd391('0x71')]}:_0x475263);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 632386d..2a2bfbd 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 _0xc026=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0xc026,0x110));var _0x6c02=function(_0x2bfe52,_0x43946e){_0x2bfe52=_0x2bfe52-0x0;var _0x1cf649=_0xc026[_0x2bfe52];return _0x1cf649;};'use strict';var _=require(_0x6c02('0x0'));var util=require(_0x6c02('0x1'));var logger=require(_0x6c02('0x2'))(_0x6c02('0x3'));var moment=require(_0x6c02('0x4'));var BPromise=require(_0x6c02('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c02('0x6'));var rimraf=require(_0x6c02('0x7'));var config=require(_0x6c02('0x8'));var attributes=require(_0x6c02('0x9'));var integrations=require(_0x6c02('0xa'));module[_0x6c02('0xb')]=function(_0x5933b7,_0x13bf4d){return _0x5933b7[_0x6c02('0xc')]('DeskAccount',attributes,{'tableName':_0x6c02('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdab3=['path','rimraf','../../config/environment','./intDeskAccount.attributes','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','bluebird'];(function(_0x137d0c,_0x2b7de3){var _0x2c2efb=function(_0x4ac640){while(--_0x4ac640){_0x137d0c['push'](_0x137d0c['shift']());}};_0x2c2efb(++_0x2b7de3);}(_0xdab3,0x13f));var _0x3dab=function(_0x2e99b2,_0x112191){_0x2e99b2=_0x2e99b2-0x0;var _0x294107=_0xdab3[_0x2e99b2];return _0x294107;};'use strict';var _=require(_0x3dab('0x0'));var util=require(_0x3dab('0x1'));var logger=require(_0x3dab('0x2'))(_0x3dab('0x3'));var moment=require('moment');var BPromise=require(_0x3dab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3dab('0x5'));var rimraf=require(_0x3dab('0x6'));var config=require(_0x3dab('0x7'));var attributes=require(_0x3dab('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x24c9bf,_0x4af469){return _0x24c9bf[_0x3dab('0x9')](_0x3dab('0xa'),attributes,{'tableName':_0x3dab('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 13336ab..da8c497 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 _0xb1b6=['GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','include','map','model','stringify','ShowDeskAccount','find','raw','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x60878f,_0x1166d3){var _0x1fbefb=function(_0x375d8c){while(--_0x375d8c){_0x60878f['push'](_0x60878f['shift']());}};_0x1fbefb(++_0x1166d3);}(_0xb1b6,0x181));var _0x6b1b=function(_0x5dc44c,_0x42ab15){_0x5dc44c=_0x5dc44c-0x0;var _0x36381f=_0xb1b6[_0x5dc44c];return _0x36381f;};'use strict';var _=require(_0x6b1b('0x0'));var util=require(_0x6b1b('0x1'));var moment=require(_0x6b1b('0x2'));var BPromise=require('bluebird');var rs=require(_0x6b1b('0x3'));var fs=require('fs');var Redis=require(_0x6b1b('0x4'));var db=require(_0x6b1b('0x5'))['db'];var utils=require(_0x6b1b('0x6'));var logger=require('../../config/logger')(_0x6b1b('0x7'));var config=require(_0x6b1b('0x8'));var jayson=require(_0x6b1b('0x9'));var client=jayson[_0x6b1b('0xa')][_0x6b1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd0894d,_0x413cdb,_0x50f27c){return new BPromise(function(_0x12dc05,_0x459600){return client[_0x6b1b('0xc')](_0xd0894d,_0x50f27c)[_0x6b1b('0xd')](function(_0x3925ce){logger[_0x6b1b('0xe')](_0x6b1b('0xf'),_0x413cdb,_0x6b1b('0x10'));logger[_0x6b1b('0x11')](_0x6b1b('0x12'),_0x413cdb,_0x6b1b('0x10'),JSON['stringify'](_0x3925ce));if(_0x3925ce[_0x6b1b('0x13')]){if(_0x3925ce[_0x6b1b('0x13')]['code']===0x1f4){logger[_0x6b1b('0x13')]('DeskAccount,\x20%s,\x20%s',_0x413cdb,_0x3925ce[_0x6b1b('0x13')]['message']);return _0x459600(_0x3925ce[_0x6b1b('0x13')][_0x6b1b('0x14')]);}logger[_0x6b1b('0x13')](_0x6b1b('0xf'),_0x413cdb,_0x3925ce['error'][_0x6b1b('0x14')]);return _0x12dc05(_0x3925ce[_0x6b1b('0x13')]['message']);}else{logger['info'](_0x6b1b('0xf'),_0x413cdb,_0x6b1b('0x10'));_0x12dc05(_0x3925ce[_0x6b1b('0x15')][_0x6b1b('0x14')]);}})['catch'](function(_0x26cc09){logger[_0x6b1b('0x13')](_0x6b1b('0xf'),_0x413cdb,_0x26cc09);_0x459600(_0x26cc09);});});}exports[_0x6b1b('0x16')]=function(_0x136302){var _0x44e751=this;return new Promise(function(_0x52e86c,_0x9c1f0f){return db[_0x6b1b('0x17')][_0x6b1b('0x18')]({'raw':_0x136302['options']?_0x136302['options']['raw']===undefined?!![]:![]:!![],'where':_0x136302[_0x6b1b('0x19')]?_0x136302[_0x6b1b('0x19')][_0x6b1b('0x1a')]||null:null,'attributes':_0x136302[_0x6b1b('0x19')]?_0x136302[_0x6b1b('0x19')][_0x6b1b('0x1b')]||null:null,'limit':_0x136302['options']?_0x136302['options'][_0x6b1b('0x1c')]||null:null,'include':_0x136302[_0x6b1b('0x19')]?_0x136302[_0x6b1b('0x19')][_0x6b1b('0x1d')]?_[_0x6b1b('0x1e')](_0x136302[_0x6b1b('0x19')][_0x6b1b('0x1d')],function(_0x1b5ec2){return{'model':db[_0x1b5ec2[_0x6b1b('0x1f')]],'as':_0x1b5ec2['as'],'attributes':_0x1b5ec2[_0x6b1b('0x1b')],'include':_0x1b5ec2[_0x6b1b('0x1d')]?_[_0x6b1b('0x1e')](_0x1b5ec2[_0x6b1b('0x1d')],function(_0x442d24){return{'model':db[_0x442d24[_0x6b1b('0x1f')]],'as':_0x442d24['as'],'attributes':_0x442d24[_0x6b1b('0x1b')],'include':_0x442d24[_0x6b1b('0x1d')]?_['map'](_0x442d24[_0x6b1b('0x1d')],function(_0x2c1cf2){return{'model':db[_0x2c1cf2[_0x6b1b('0x1f')]],'as':_0x2c1cf2['as'],'attributes':_0x2c1cf2[_0x6b1b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47824a){logger[_0x6b1b('0xe')](_0x6b1b('0x16'),_0x136302);logger[_0x6b1b('0x11')](_0x6b1b('0x16'),_0x136302,JSON[_0x6b1b('0x20')](_0x47824a));_0x52e86c(_0x47824a);})['catch'](function(_0x593db9){logger[_0x6b1b('0x13')](_0x6b1b('0x16'),_0x593db9[_0x6b1b('0x14')],_0x136302);_0x9c1f0f(_0x44e751[_0x6b1b('0x13')](0x1f4,_0x593db9[_0x6b1b('0x14')]));});});};exports[_0x6b1b('0x21')]=function(_0x1a3908){var _0x45d20b=this;return new Promise(function(_0x582218,_0x11e0ec){return db[_0x6b1b('0x17')][_0x6b1b('0x22')]({'raw':_0x1a3908[_0x6b1b('0x19')]?_0x1a3908['options'][_0x6b1b('0x23')]===undefined?!![]:![]:!![],'where':_0x1a3908['options']?_0x1a3908[_0x6b1b('0x19')][_0x6b1b('0x1a')]||null:null,'attributes':_0x1a3908['options']?_0x1a3908[_0x6b1b('0x19')][_0x6b1b('0x1b')]||null:null,'include':_0x1a3908[_0x6b1b('0x19')]?_0x1a3908[_0x6b1b('0x19')][_0x6b1b('0x1d')]?_[_0x6b1b('0x1e')](_0x1a3908[_0x6b1b('0x19')]['include'],function(_0x2db0be){return{'model':db[_0x2db0be[_0x6b1b('0x1f')]],'as':_0x2db0be['as'],'attributes':_0x2db0be[_0x6b1b('0x1b')],'include':_0x2db0be[_0x6b1b('0x1d')]?_[_0x6b1b('0x1e')](_0x2db0be[_0x6b1b('0x1d')],function(_0x9d238b){return{'model':db[_0x9d238b[_0x6b1b('0x1f')]],'as':_0x9d238b['as'],'attributes':_0x9d238b[_0x6b1b('0x1b')],'include':_0x9d238b[_0x6b1b('0x1d')]?_[_0x6b1b('0x1e')](_0x9d238b['include'],function(_0x2d076b){return{'model':db[_0x2d076b[_0x6b1b('0x1f')]],'as':_0x2d076b['as'],'attributes':_0x2d076b['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b1b('0xd')](function(_0x44afe6){logger[_0x6b1b('0xe')]('ShowDeskAccount',_0x1a3908);logger[_0x6b1b('0x11')](_0x6b1b('0x21'),_0x1a3908,JSON['stringify'](_0x44afe6));_0x582218(_0x44afe6);})[_0x6b1b('0x24')](function(_0x1441bf){logger['error']('ShowDeskAccount',_0x1441bf[_0x6b1b('0x14')],_0x1a3908);_0x11e0ec(_0x45d20b[_0x6b1b('0x13')](0x1f4,_0x1441bf[_0x6b1b('0x14')]));});});}; \ No newline at end of file +var _0x0b01=['request\x20sent','result','catch','GetDeskAccount','findAll','options','raw','where','limit','include','attributes','map','model','DeskAccount','ShowDeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','DeskAccount,\x20%s,\x20%s','debug','error','code','message','info'];(function(_0x353c53,_0x2102c0){var _0x2c55da=function(_0x3fe2d5){while(--_0x3fe2d5){_0x353c53['push'](_0x353c53['shift']());}};_0x2c55da(++_0x2102c0);}(_0x0b01,0xfd));var _0x10b0=function(_0xd9fb1d,_0x122874){_0xd9fb1d=_0xd9fb1d-0x0;var _0x26ef43=_0x0b01[_0xd9fb1d];return _0x26ef43;};'use strict';var _=require(_0x10b0('0x0'));var util=require('util');var moment=require(_0x10b0('0x1'));var BPromise=require(_0x10b0('0x2'));var rs=require(_0x10b0('0x3'));var fs=require('fs');var Redis=require(_0x10b0('0x4'));var db=require(_0x10b0('0x5'))['db'];var utils=require(_0x10b0('0x6'));var logger=require(_0x10b0('0x7'))('rpc');var config=require(_0x10b0('0x8'));var jayson=require(_0x10b0('0x9'));var client=jayson[_0x10b0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22907e,_0x5be173,_0x27459c){return new BPromise(function(_0x27f8db,_0x5f3b18){return client[_0x10b0('0xb')](_0x22907e,_0x27459c)[_0x10b0('0xc')](function(_0x23b0bd){logger['info'](_0x10b0('0xd'),_0x5be173,'request\x20sent');logger[_0x10b0('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5be173,'request\x20sent',JSON['stringify'](_0x23b0bd));if(_0x23b0bd[_0x10b0('0xf')]){if(_0x23b0bd[_0x10b0('0xf')][_0x10b0('0x10')]===0x1f4){logger[_0x10b0('0xf')]('DeskAccount,\x20%s,\x20%s',_0x5be173,_0x23b0bd[_0x10b0('0xf')][_0x10b0('0x11')]);return _0x5f3b18(_0x23b0bd[_0x10b0('0xf')][_0x10b0('0x11')]);}logger[_0x10b0('0xf')](_0x10b0('0xd'),_0x5be173,_0x23b0bd[_0x10b0('0xf')][_0x10b0('0x11')]);return _0x27f8db(_0x23b0bd['error']['message']);}else{logger[_0x10b0('0x12')](_0x10b0('0xd'),_0x5be173,_0x10b0('0x13'));_0x27f8db(_0x23b0bd[_0x10b0('0x14')]['message']);}})[_0x10b0('0x15')](function(_0x41d6d6){logger[_0x10b0('0xf')](_0x10b0('0xd'),_0x5be173,_0x41d6d6);_0x5f3b18(_0x41d6d6);});});}exports[_0x10b0('0x16')]=function(_0x39a569){var _0x2546b6=this;return new Promise(function(_0x18dcab,_0x31acb7){return db['DeskAccount'][_0x10b0('0x17')]({'raw':_0x39a569[_0x10b0('0x18')]?_0x39a569[_0x10b0('0x18')][_0x10b0('0x19')]===undefined?!![]:![]:!![],'where':_0x39a569['options']?_0x39a569[_0x10b0('0x18')][_0x10b0('0x1a')]||null:null,'attributes':_0x39a569[_0x10b0('0x18')]?_0x39a569['options']['attributes']||null:null,'limit':_0x39a569[_0x10b0('0x18')]?_0x39a569[_0x10b0('0x18')][_0x10b0('0x1b')]||null:null,'include':_0x39a569[_0x10b0('0x18')]?_0x39a569[_0x10b0('0x18')][_0x10b0('0x1c')]?_['map'](_0x39a569[_0x10b0('0x18')][_0x10b0('0x1c')],function(_0x540364){return{'model':db[_0x540364['model']],'as':_0x540364['as'],'attributes':_0x540364[_0x10b0('0x1d')],'include':_0x540364[_0x10b0('0x1c')]?_[_0x10b0('0x1e')](_0x540364[_0x10b0('0x1c')],function(_0x431866){return{'model':db[_0x431866[_0x10b0('0x1f')]],'as':_0x431866['as'],'attributes':_0x431866[_0x10b0('0x1d')],'include':_0x431866[_0x10b0('0x1c')]?_['map'](_0x431866[_0x10b0('0x1c')],function(_0xe8b472){return{'model':db[_0xe8b472[_0x10b0('0x1f')]],'as':_0xe8b472['as'],'attributes':_0xe8b472[_0x10b0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x10b0('0xc')](function(_0x1cc173){logger[_0x10b0('0x12')](_0x10b0('0x16'),_0x39a569);logger[_0x10b0('0xe')](_0x10b0('0x16'),_0x39a569,JSON['stringify'](_0x1cc173));_0x18dcab(_0x1cc173);})['catch'](function(_0x341960){logger[_0x10b0('0xf')](_0x10b0('0x16'),_0x341960[_0x10b0('0x11')],_0x39a569);_0x31acb7(_0x2546b6[_0x10b0('0xf')](0x1f4,_0x341960[_0x10b0('0x11')]));});});};exports['ShowDeskAccount']=function(_0x160bce){var _0x18713d=this;return new Promise(function(_0x5e6a96,_0x3b997d){return db[_0x10b0('0x20')]['find']({'raw':_0x160bce['options']?_0x160bce['options'][_0x10b0('0x19')]===undefined?!![]:![]:!![],'where':_0x160bce[_0x10b0('0x18')]?_0x160bce[_0x10b0('0x18')][_0x10b0('0x1a')]||null:null,'attributes':_0x160bce['options']?_0x160bce[_0x10b0('0x18')][_0x10b0('0x1d')]||null:null,'include':_0x160bce[_0x10b0('0x18')]?_0x160bce[_0x10b0('0x18')]['include']?_[_0x10b0('0x1e')](_0x160bce[_0x10b0('0x18')][_0x10b0('0x1c')],function(_0xfbd8bf){return{'model':db[_0xfbd8bf['model']],'as':_0xfbd8bf['as'],'attributes':_0xfbd8bf[_0x10b0('0x1d')],'include':_0xfbd8bf['include']?_[_0x10b0('0x1e')](_0xfbd8bf['include'],function(_0x3fe700){return{'model':db[_0x3fe700[_0x10b0('0x1f')]],'as':_0x3fe700['as'],'attributes':_0x3fe700[_0x10b0('0x1d')],'include':_0x3fe700[_0x10b0('0x1c')]?_['map'](_0x3fe700['include'],function(_0x51f056){return{'model':db[_0x51f056['model']],'as':_0x51f056['as'],'attributes':_0x51f056[_0x10b0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x10b0('0xc')](function(_0x5b1bd9){logger['info']('ShowDeskAccount',_0x160bce);logger[_0x10b0('0xe')](_0x10b0('0x21'),_0x160bce,JSON['stringify'](_0x5b1bd9));_0x5e6a96(_0x5b1bd9);})[_0x10b0('0x15')](function(_0x46c292){logger[_0x10b0('0xf')](_0x10b0('0x21'),_0x46c292[_0x10b0('0x11')],_0x160bce);_0x3b997d(_0x18713d[_0x10b0('0xf')](0x1f4,_0x46c292[_0x10b0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 3f156d1..4e5c8b6 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 _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x5b9674,_0x854b9b){var _0x5d99b5=function(_0x1fbba6){while(--_0x1fbba6){_0x5b9674['push'](_0x5b9674['shift']());}};_0x5d99b5(++_0x854b9b);}(_0xedd9,0xfc));var _0x9edd=function(_0x1a19f6,_0x4a081f){_0x1a19f6=_0x1a19f6-0x0;var _0x539b1d=_0xedd9[_0x1a19f6];return _0x539b1d;};'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');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x50d5da,_0x3c9a6a){var _0x5cfacf=function(_0x415a6b){while(--_0x415a6b){_0x50d5da['push'](_0x50d5da['shift']());}};_0x5cfacf(++_0x3c9a6a);}(_0x34e8,0x12c));var _0x834e=function(_0x29c2a7,_0x298b2f){_0x29c2a7=_0x29c2a7-0x0;var _0x3f7dc3=_0x34e8[_0x29c2a7];return _0x3f7dc3;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 7b1e08a..1aad02b 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 _0x58b0=['exports','STRING','sequelize'];(function(_0x55bf78,_0x8d7da1){var _0x484e78=function(_0x80446b){while(--_0x80446b){_0x55bf78['push'](_0x55bf78['shift']());}};_0x484e78(++_0x8d7da1);}(_0x58b0,0x1b2));var _0x058b=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0x58b0[_0x365e54];return _0x13317a;};'use strict';var Sequelize=require(_0x058b('0x0'));module[_0x058b('0x1')]={'name':{'type':Sequelize[_0x058b('0x2')]},'description':{'type':Sequelize[_0x058b('0x2')]}}; \ No newline at end of file +var _0xc4ec=['STRING','sequelize','exports'];(function(_0x18be17,_0x3b0369){var _0x4950ba=function(_0x5bd6cf){while(--_0x5bd6cf){_0x18be17['push'](_0x18be17['shift']());}};_0x4950ba(++_0x3b0369);}(_0xc4ec,0x1cc));var _0xcc4e=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xc4ec[_0x2f5a22];return _0x326b70;};'use strict';var Sequelize=require(_0xcc4e('0x0'));module[_0xcc4e('0x1')]={'name':{'type':Sequelize[_0xcc4e('0x2')]},'description':{'type':Sequelize[_0xcc4e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index bb87974..ea3ff77 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 _0xd401=['getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','DeskConfiguration','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','params','include','find','create','body','catch','update','getFields','findOne','DeskField','rawAttributes','getSubjects','getDescriptions'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0xd401,0xfc));var _0x1d40=function(_0x49a4b5,_0x420d0c){_0x49a4b5=_0x49a4b5-0x0;var _0x343547=_0xd401[_0x49a4b5];return _0x343547;};'use strict';var emlformat=require(_0x1d40('0x0'));var rimraf=require(_0x1d40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1d40('0x2'));var rp=require(_0x1d40('0x3'));var moment=require(_0x1d40('0x4'));var BPromise=require(_0x1d40('0x5'));var Mustache=require(_0x1d40('0x6'));var util=require('util');var path=require(_0x1d40('0x7'));var sox=require(_0x1d40('0x8'));var csv=require('to-csv');var ejs=require(_0x1d40('0x9'));var fs=require('fs');var fs_extra=require(_0x1d40('0xa'));var _=require(_0x1d40('0xb'));var squel=require(_0x1d40('0xc'));var crypto=require(_0x1d40('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1d40('0xe'));var querystring=require('querystring');var Papa=require(_0x1d40('0xf'));var Redis=require(_0x1d40('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1d40('0x11'));var as=require(_0x1d40('0x12'));var hardwareService=require(_0x1d40('0x13'));var logger=require(_0x1d40('0x14'))('api');var utils=require(_0x1d40('0x15'));var config=require(_0x1d40('0x16'));var licenseUtil=require(_0x1d40('0x17'));var db=require(_0x1d40('0x18'))['db'];function respondWithStatusCode(_0x26d1ad,_0x4baf52){_0x4baf52=_0x4baf52||0xcc;return function(_0x41672e){if(_0x41672e){return _0x26d1ad[_0x1d40('0x19')](_0x4baf52);}return _0x26d1ad['status'](_0x4baf52)['end']();};}function respondWithResult(_0x39ff86,_0x2ee31f){_0x2ee31f=_0x2ee31f||0xc8;return function(_0x1f926f){if(_0x1f926f){return _0x39ff86[_0x1d40('0x1a')](_0x2ee31f)[_0x1d40('0x1b')](_0x1f926f);}};}function respondWithFilteredResult(_0x5bdc54,_0x4a36d0){return function(_0x366986){if(_0x366986){var _0x12c1cc=typeof _0x4a36d0['offset']==='undefined'&&typeof _0x4a36d0['limit']===_0x1d40('0x1c');var _0x7d7215=_0x366986['count'];var _0x474755=_0x12c1cc?0x0:_0x4a36d0[_0x1d40('0x1d')];var _0x3dc45b=_0x12c1cc?_0x366986[_0x1d40('0x1e')]:_0x4a36d0['offset']+_0x4a36d0[_0x1d40('0x1f')];var _0x333a4b;if(_0x3dc45b>=_0x7d7215){_0x3dc45b=_0x7d7215;_0x333a4b=0xc8;}else{_0x333a4b=0xce;}_0x5bdc54[_0x1d40('0x1a')](_0x333a4b);return _0x5bdc54[_0x1d40('0x20')](_0x1d40('0x21'),_0x474755+'-'+_0x3dc45b+'/'+_0x7d7215)[_0x1d40('0x1b')](_0x366986);}return null;};}function patchUpdates(_0x4140fd){return function(_0x4c7484){try{jsonpatch[_0x1d40('0x22')](_0x4c7484,_0x4140fd,!![]);}catch(_0x4c4719){return BPromise[_0x1d40('0x23')](_0x4c4719);}return _0x4c7484[_0x1d40('0x24')]();};}function saveUpdates(_0x370e6f,_0x28c3cc){return function(_0x2da749){if(_0x2da749){return _0x2da749['update'](_0x370e6f)[_0x1d40('0x25')](function(_0x1c352a){return _0x1c352a;});}return null;};}function removeEntity(_0x47771f,_0x168c23){return function(_0x5b9cd8){if(_0x5b9cd8){return _0x5b9cd8[_0x1d40('0x26')]()[_0x1d40('0x25')](function(){_0x47771f[_0x1d40('0x1a')](0xcc)[_0x1d40('0x27')]();});}};}function handleEntityNotFound(_0x68f044,_0x44653e){return function(_0x4cf65e){if(!_0x4cf65e){_0x68f044['sendStatus'](0x194);}return _0x4cf65e;};}function handleError(_0x2ffc50,_0x1d44b9){_0x1d44b9=_0x1d44b9||0x1f4;return function(_0xcd6402){logger[_0x1d40('0x28')](_0xcd6402[_0x1d40('0x29')]);if(_0xcd6402[_0x1d40('0x2a')]){delete _0xcd6402['name'];}_0x2ffc50[_0x1d40('0x1a')](_0x1d44b9)['send'](_0xcd6402);};}exports[_0x1d40('0x2b')]=function(_0x54fd58,_0xf39503){var _0xa4ea2d={},_0x479c35={},_0x367d02={'count':0x0,'rows':[]};var _0x201fc2=_[_0x1d40('0x2c')](db[_0x1d40('0x2d')]['rawAttributes'],function(_0x348e9c){return{'name':_0x348e9c['fieldName'],'type':_0x348e9c[_0x1d40('0x2e')]['key']};});_0x479c35[_0x1d40('0x2f')]=_[_0x1d40('0x2c')](_0x201fc2,_0x1d40('0x2a'));_0x479c35[_0x1d40('0x30')]=_[_0x1d40('0x31')](_0x54fd58[_0x1d40('0x30')]);_0x479c35[_0x1d40('0x32')]=_[_0x1d40('0x33')](_0x479c35[_0x1d40('0x2f')],_0x479c35['query']);_0xa4ea2d[_0x1d40('0x34')]=_[_0x1d40('0x33')](_0x479c35[_0x1d40('0x2f')],qs[_0x1d40('0x35')](_0x54fd58[_0x1d40('0x30')][_0x1d40('0x35')]));_0xa4ea2d[_0x1d40('0x34')]=_0xa4ea2d[_0x1d40('0x34')][_0x1d40('0x36')]?_0xa4ea2d[_0x1d40('0x34')]:_0x479c35[_0x1d40('0x2f')];if(!_0x54fd58[_0x1d40('0x30')][_0x1d40('0x37')](_0x1d40('0x38'))){_0xa4ea2d[_0x1d40('0x1f')]=qs[_0x1d40('0x1f')](_0x54fd58[_0x1d40('0x30')][_0x1d40('0x1f')]);_0xa4ea2d[_0x1d40('0x1d')]=qs[_0x1d40('0x1d')](_0x54fd58[_0x1d40('0x30')]['offset']);}_0xa4ea2d[_0x1d40('0x39')]=qs[_0x1d40('0x3a')](_0x54fd58[_0x1d40('0x30')][_0x1d40('0x3a')]);_0xa4ea2d[_0x1d40('0x3b')]=qs[_0x1d40('0x32')](_[_0x1d40('0x3c')](_0x54fd58['query'],_0x479c35[_0x1d40('0x32')]),_0x201fc2);if(_0x54fd58[_0x1d40('0x30')][_0x1d40('0x3d')]){_0xa4ea2d['where']=_[_0x1d40('0x3e')](_0xa4ea2d[_0x1d40('0x3b')],{'$or':_[_0x1d40('0x2c')](_0x201fc2,function(_0x44cef7){if(_0x44cef7[_0x1d40('0x2e')]!==_0x1d40('0x3f')){var _0xba0314={};_0xba0314[_0x44cef7[_0x1d40('0x2a')]]={'$like':'%'+_0x54fd58[_0x1d40('0x30')][_0x1d40('0x3d')]+'%'};return _0xba0314;}})});}_0xa4ea2d=_[_0x1d40('0x3e')]({},_0xa4ea2d,_0x54fd58[_0x1d40('0x40')]);var _0x4deea9={'where':_0xa4ea2d[_0x1d40('0x3b')]};return db[_0x1d40('0x2d')]['count'](_0x4deea9)['then'](function(_0x5ea2bc){_0x367d02[_0x1d40('0x1e')]=_0x5ea2bc;if(_0x54fd58['query']['includeAll']){_0xa4ea2d['include']=[{'all':!![]}];}return db[_0x1d40('0x2d')][_0x1d40('0x41')](_0xa4ea2d);})['then'](function(_0x3ef9d1){_0x367d02['rows']=_0x3ef9d1;return _0x367d02;})[_0x1d40('0x25')](respondWithFilteredResult(_0xf39503,_0xa4ea2d))['catch'](handleError(_0xf39503,null));};exports[_0x1d40('0x42')]=function(_0x2a5b37,_0x478e4d){var _0x4dea01={'raw':![],'where':{'id':_0x2a5b37[_0x1d40('0x43')]['id']}},_0x492730={};_0x492730['model']=_[_0x1d40('0x31')](db[_0x1d40('0x2d')]['rawAttributes']);_0x492730[_0x1d40('0x30')]=_[_0x1d40('0x31')](_0x2a5b37[_0x1d40('0x30')]);_0x492730[_0x1d40('0x32')]=_['intersection'](_0x492730[_0x1d40('0x2f')],_0x492730[_0x1d40('0x30')]);_0x4dea01[_0x1d40('0x34')]=_[_0x1d40('0x33')](_0x492730[_0x1d40('0x2f')],qs['fields'](_0x2a5b37['query'][_0x1d40('0x35')]));_0x4dea01['attributes']=_0x4dea01['attributes'][_0x1d40('0x36')]?_0x4dea01[_0x1d40('0x34')]:_0x492730['model'];if(_0x2a5b37[_0x1d40('0x30')]['includeAll']){_0x4dea01[_0x1d40('0x44')]=[{'all':!![]}];}_0x4dea01=_[_0x1d40('0x3e')]({},_0x4dea01,_0x2a5b37['options']);return db[_0x1d40('0x2d')][_0x1d40('0x45')](_0x4dea01)['then'](handleEntityNotFound(_0x478e4d,null))[_0x1d40('0x25')](respondWithResult(_0x478e4d,null))['catch'](handleError(_0x478e4d,null));};exports[_0x1d40('0x46')]=function(_0x5da169,_0x1b8a43){return db[_0x1d40('0x2d')][_0x1d40('0x46')](_0x5da169[_0x1d40('0x47')],{})['then'](respondWithResult(_0x1b8a43,0xc9))[_0x1d40('0x48')](handleError(_0x1b8a43,null));};exports[_0x1d40('0x49')]=function(_0x5a2b5c,_0x1a4a0a){if(_0x5a2b5c[_0x1d40('0x47')]['id']){delete _0x5a2b5c[_0x1d40('0x47')]['id'];}return db[_0x1d40('0x2d')][_0x1d40('0x45')]({'where':{'id':_0x5a2b5c[_0x1d40('0x43')]['id']}})[_0x1d40('0x25')](handleEntityNotFound(_0x1a4a0a,null))[_0x1d40('0x25')](saveUpdates(_0x5a2b5c[_0x1d40('0x47')],null))[_0x1d40('0x25')](respondWithResult(_0x1a4a0a,null))[_0x1d40('0x48')](handleError(_0x1a4a0a,null));};exports['destroy']=function(_0x288a76,_0x1921d0){return db['DeskConfiguration'][_0x1d40('0x45')]({'where':{'id':_0x288a76[_0x1d40('0x43')]['id']}})[_0x1d40('0x25')](handleEntityNotFound(_0x1921d0,null))[_0x1d40('0x25')](removeEntity(_0x1921d0,null))[_0x1d40('0x48')](handleError(_0x1921d0,null));};exports[_0x1d40('0x4a')]=function(_0x819d64,_0x553f28,_0x3b3450){var _0xf4fb24={};var _0x1146b7={};var _0xb0e22e;var _0x2d1881;return db[_0x1d40('0x2d')][_0x1d40('0x4b')]({'where':{'id':_0x819d64[_0x1d40('0x43')]['id']}})['then'](handleEntityNotFound(_0x553f28,null))[_0x1d40('0x25')](function(_0x4719ec){if(_0x4719ec){_0xb0e22e=_0x4719ec;_0x1146b7[_0x1d40('0x2f')]=_[_0x1d40('0x31')](db[_0x1d40('0x4c')][_0x1d40('0x4d')]);_0x1146b7[_0x1d40('0x30')]=_[_0x1d40('0x31')](_0x819d64[_0x1d40('0x30')]);_0x1146b7[_0x1d40('0x32')]=_[_0x1d40('0x33')](_0x1146b7[_0x1d40('0x2f')],_0x1146b7[_0x1d40('0x30')]);_0xf4fb24['attributes']=_[_0x1d40('0x33')](_0x1146b7[_0x1d40('0x2f')],qs[_0x1d40('0x35')](_0x819d64['query'][_0x1d40('0x35')]));_0xf4fb24[_0x1d40('0x34')]=_0xf4fb24[_0x1d40('0x34')][_0x1d40('0x36')]?_0xf4fb24[_0x1d40('0x34')]:_0x1146b7['model'];_0xf4fb24[_0x1d40('0x39')]=qs[_0x1d40('0x3a')](_0x819d64[_0x1d40('0x30')][_0x1d40('0x3a')]);_0xf4fb24[_0x1d40('0x3b')]=qs[_0x1d40('0x32')](_[_0x1d40('0x3c')](_0x819d64[_0x1d40('0x30')],_0x1146b7[_0x1d40('0x32')]));if(_0x819d64[_0x1d40('0x30')][_0x1d40('0x3d')]){_0xf4fb24[_0x1d40('0x3b')]=_[_0x1d40('0x3e')](_0xf4fb24[_0x1d40('0x3b')],{'$or':_[_0x1d40('0x2c')](_0xf4fb24[_0x1d40('0x34')],function(_0x4df967){var _0x5d532e={};_0x5d532e[_0x4df967]={'$like':'%'+_0x819d64['query'][_0x1d40('0x3d')]+'%'};return _0x5d532e;})});}_0xf4fb24=_['merge']({},_0xf4fb24,_0x819d64[_0x1d40('0x40')]);return _0xb0e22e[_0x1d40('0x4a')](_0xf4fb24);}})[_0x1d40('0x25')](function(_0x5d3b77){if(_0x5d3b77){_0x2d1881=_0x5d3b77[_0x1d40('0x36')];if(!_0x819d64[_0x1d40('0x30')][_0x1d40('0x37')](_0x1d40('0x38'))){_0xf4fb24[_0x1d40('0x1f')]=qs[_0x1d40('0x1f')](_0x819d64['query'][_0x1d40('0x1f')]);_0xf4fb24['offset']=qs[_0x1d40('0x1d')](_0x819d64[_0x1d40('0x30')]['offset']);}return _0xb0e22e[_0x1d40('0x4a')](_0xf4fb24);}})[_0x1d40('0x25')](function(_0x14fdc9){if(_0x14fdc9){return _0x14fdc9?{'count':_0x2d1881,'rows':_0x14fdc9}:null;}})[_0x1d40('0x25')](respondWithResult(_0x553f28,null))[_0x1d40('0x48')](handleError(_0x553f28,null));};exports[_0x1d40('0x4e')]=function(_0x36606a,_0x2b6225,_0x11cbe7){var _0x47a8e9={};var _0x3d7728={};var _0x3f2b96;var _0x497bd7;return db[_0x1d40('0x2d')][_0x1d40('0x4b')]({'where':{'id':_0x36606a[_0x1d40('0x43')]['id']}})[_0x1d40('0x25')](handleEntityNotFound(_0x2b6225,null))[_0x1d40('0x25')](function(_0x56eb9a){if(_0x56eb9a){_0x3f2b96=_0x56eb9a;_0x3d7728[_0x1d40('0x2f')]=_['keys'](db['DeskField'][_0x1d40('0x4d')]);_0x3d7728[_0x1d40('0x30')]=_[_0x1d40('0x31')](_0x36606a['query']);_0x3d7728[_0x1d40('0x32')]=_[_0x1d40('0x33')](_0x3d7728[_0x1d40('0x2f')],_0x3d7728[_0x1d40('0x30')]);_0x47a8e9[_0x1d40('0x34')]=_[_0x1d40('0x33')](_0x3d7728[_0x1d40('0x2f')],qs[_0x1d40('0x35')](_0x36606a[_0x1d40('0x30')][_0x1d40('0x35')]));_0x47a8e9[_0x1d40('0x34')]=_0x47a8e9[_0x1d40('0x34')][_0x1d40('0x36')]?_0x47a8e9[_0x1d40('0x34')]:_0x3d7728[_0x1d40('0x2f')];_0x47a8e9[_0x1d40('0x39')]=qs[_0x1d40('0x3a')](_0x36606a['query']['sort']);_0x47a8e9[_0x1d40('0x3b')]=qs['filters'](_[_0x1d40('0x3c')](_0x36606a[_0x1d40('0x30')],_0x3d7728[_0x1d40('0x32')]));if(_0x36606a[_0x1d40('0x30')][_0x1d40('0x3d')]){_0x47a8e9['where']=_[_0x1d40('0x3e')](_0x47a8e9[_0x1d40('0x3b')],{'$or':_[_0x1d40('0x2c')](_0x47a8e9[_0x1d40('0x34')],function(_0x3994f7){var _0x2ba72b={};_0x2ba72b[_0x3994f7]={'$like':'%'+_0x36606a[_0x1d40('0x30')][_0x1d40('0x3d')]+'%'};return _0x2ba72b;})});}_0x47a8e9=_[_0x1d40('0x3e')]({},_0x47a8e9,_0x36606a[_0x1d40('0x40')]);return _0x3f2b96[_0x1d40('0x4e')](_0x47a8e9);}})[_0x1d40('0x25')](function(_0x36e4f8){if(_0x36e4f8){_0x497bd7=_0x36e4f8[_0x1d40('0x36')];if(!_0x36606a[_0x1d40('0x30')][_0x1d40('0x37')]('nolimit')){_0x47a8e9[_0x1d40('0x1f')]=qs[_0x1d40('0x1f')](_0x36606a[_0x1d40('0x30')][_0x1d40('0x1f')]);_0x47a8e9[_0x1d40('0x1d')]=qs[_0x1d40('0x1d')](_0x36606a[_0x1d40('0x30')][_0x1d40('0x1d')]);}return _0x3f2b96['getSubjects'](_0x47a8e9);}})['then'](function(_0x554b9b){if(_0x554b9b){return _0x554b9b?{'count':_0x497bd7,'rows':_0x554b9b}:null;}})[_0x1d40('0x25')](respondWithResult(_0x2b6225,null))[_0x1d40('0x48')](handleError(_0x2b6225,null));};exports[_0x1d40('0x4f')]=function(_0x411728,_0x38d9f1,_0x5c1370){var _0xa287f9={};var _0x764934={};var _0x17c361;var _0x3c0ae3;return db[_0x1d40('0x2d')][_0x1d40('0x4b')]({'where':{'id':_0x411728['params']['id']}})['then'](handleEntityNotFound(_0x38d9f1,null))[_0x1d40('0x25')](function(_0x210fe0){if(_0x210fe0){_0x17c361=_0x210fe0;_0x764934['model']=_[_0x1d40('0x31')](db[_0x1d40('0x4c')][_0x1d40('0x4d')]);_0x764934[_0x1d40('0x30')]=_[_0x1d40('0x31')](_0x411728[_0x1d40('0x30')]);_0x764934['filters']=_[_0x1d40('0x33')](_0x764934[_0x1d40('0x2f')],_0x764934['query']);_0xa287f9['attributes']=_['intersection'](_0x764934[_0x1d40('0x2f')],qs[_0x1d40('0x35')](_0x411728[_0x1d40('0x30')]['fields']));_0xa287f9[_0x1d40('0x34')]=_0xa287f9[_0x1d40('0x34')][_0x1d40('0x36')]?_0xa287f9['attributes']:_0x764934[_0x1d40('0x2f')];_0xa287f9[_0x1d40('0x39')]=qs[_0x1d40('0x3a')](_0x411728[_0x1d40('0x30')]['sort']);_0xa287f9[_0x1d40('0x3b')]=qs['filters'](_[_0x1d40('0x3c')](_0x411728[_0x1d40('0x30')],_0x764934[_0x1d40('0x32')]));if(_0x411728[_0x1d40('0x30')][_0x1d40('0x3d')]){_0xa287f9[_0x1d40('0x3b')]=_[_0x1d40('0x3e')](_0xa287f9[_0x1d40('0x3b')],{'$or':_['map'](_0xa287f9[_0x1d40('0x34')],function(_0x38aa96){var _0x25d66b={};_0x25d66b[_0x38aa96]={'$like':'%'+_0x411728[_0x1d40('0x30')][_0x1d40('0x3d')]+'%'};return _0x25d66b;})});}_0xa287f9=_[_0x1d40('0x3e')]({},_0xa287f9,_0x411728[_0x1d40('0x40')]);return _0x17c361[_0x1d40('0x4f')](_0xa287f9);}})[_0x1d40('0x25')](function(_0x275d27){if(_0x275d27){_0x3c0ae3=_0x275d27[_0x1d40('0x36')];if(!_0x411728[_0x1d40('0x30')][_0x1d40('0x37')](_0x1d40('0x38'))){_0xa287f9[_0x1d40('0x1f')]=qs[_0x1d40('0x1f')](_0x411728['query'][_0x1d40('0x1f')]);_0xa287f9[_0x1d40('0x1d')]=qs[_0x1d40('0x1d')](_0x411728['query'][_0x1d40('0x1d')]);}return _0x17c361[_0x1d40('0x4f')](_0xa287f9);}})['then'](function(_0x559efe){if(_0x559efe){return _0x559efe?{'count':_0x3c0ae3,'rows':_0x559efe}:null;}})[_0x1d40('0x25')](respondWithResult(_0x38d9f1,null))[_0x1d40('0x48')](handleError(_0x38d9f1,null));};exports[_0x1d40('0x50')]=function(_0x5047c5,_0x182365,_0x22a464){var _0xbebc7={};var _0x23c691={};var _0x5099d9;var _0x591970;return db['DeskConfiguration'][_0x1d40('0x4b')]({'where':{'id':_0x5047c5[_0x1d40('0x43')]['id']}})[_0x1d40('0x25')](handleEntityNotFound(_0x182365,null))[_0x1d40('0x25')](function(_0x39bf3a){if(_0x39bf3a){_0x5099d9=_0x39bf3a;_0x23c691['model']=_[_0x1d40('0x31')](db['Tag'][_0x1d40('0x4d')]);_0x23c691[_0x1d40('0x30')]=_[_0x1d40('0x31')](_0x5047c5[_0x1d40('0x30')]);_0x23c691['filters']=_[_0x1d40('0x33')](_0x23c691['model'],_0x23c691['query']);_0xbebc7[_0x1d40('0x34')]=_[_0x1d40('0x33')](_0x23c691[_0x1d40('0x2f')],qs[_0x1d40('0x35')](_0x5047c5[_0x1d40('0x30')][_0x1d40('0x35')]));_0xbebc7[_0x1d40('0x34')]=_0xbebc7[_0x1d40('0x34')]['length']?_0xbebc7[_0x1d40('0x34')]:_0x23c691[_0x1d40('0x2f')];_0xbebc7[_0x1d40('0x39')]=qs[_0x1d40('0x3a')](_0x5047c5[_0x1d40('0x30')][_0x1d40('0x3a')]);_0xbebc7[_0x1d40('0x3b')]=qs['filters'](_[_0x1d40('0x3c')](_0x5047c5[_0x1d40('0x30')],_0x23c691['filters']));if(_0x5047c5['query'][_0x1d40('0x3d')]){_0xbebc7[_0x1d40('0x3b')]=_[_0x1d40('0x3e')](_0xbebc7[_0x1d40('0x3b')],{'$or':_[_0x1d40('0x2c')](_0xbebc7[_0x1d40('0x34')],function(_0x57fbe2){var _0x50b70a={};_0x50b70a[_0x57fbe2]={'$like':'%'+_0x5047c5[_0x1d40('0x30')][_0x1d40('0x3d')]+'%'};return _0x50b70a;})});}_0xbebc7=_[_0x1d40('0x3e')]({},_0xbebc7,_0x5047c5['options']);return _0x5099d9['getTags'](_0xbebc7);}})['then'](function(_0x27ad0c){if(_0x27ad0c){_0x591970=_0x27ad0c['length'];if(!_0x5047c5[_0x1d40('0x30')][_0x1d40('0x37')](_0x1d40('0x38'))){_0xbebc7[_0x1d40('0x1f')]=qs['limit'](_0x5047c5['query'][_0x1d40('0x1f')]);_0xbebc7[_0x1d40('0x1d')]=qs['offset'](_0x5047c5[_0x1d40('0x30')]['offset']);}return _0x5099d9[_0x1d40('0x50')](_0xbebc7);}})['then'](function(_0x1f5b44){if(_0x1f5b44){return _0x1f5b44?{'count':_0x591970,'rows':_0x1f5b44}:null;}})['then'](respondWithResult(_0x182365,null))['catch'](handleError(_0x182365,null));};exports[_0x1d40('0x51')]=function(_0xf76369,_0x39bac1,_0xa9fe1c){if(_0xf76369[_0x1d40('0x47')]['id']){delete _0xf76369[_0x1d40('0x47')]['id'];}return db[_0x1d40('0x2d')][_0x1d40('0x4b')]({'where':{'id':_0xf76369[_0x1d40('0x43')]['id']}})[_0x1d40('0x25')](handleEntityNotFound(_0x39bac1,null))[_0x1d40('0x25')](function(_0x53a16c){if(_0x53a16c){return _0x53a16c['setTags'](_0xf76369['body'][_0x1d40('0x52')]||[]);}return null;})[_0x1d40('0x25')](respondWithResult(_0x39bac1,null))['catch'](handleError(_0x39bac1,null));}; \ No newline at end of file +var _0xd86a=['crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','stack','map','DeskConfiguration','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','destroy','getFields','findOne','hasOwnProperty','getSubjects','DeskField','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x35c718,_0x33a696){var _0x5c3099=function(_0x2810cd){while(--_0x2810cd){_0x35c718['push'](_0x35c718['shift']());}};_0x5c3099(++_0x33a696);}(_0xd86a,0x98));var _0xad86=function(_0xcda377,_0x1e2678){_0xcda377=_0xcda377-0x0;var _0x1c024f=_0xd86a[_0xcda377];return _0x1c024f;};'use strict';var emlformat=require(_0xad86('0x0'));var rimraf=require(_0xad86('0x1'));var zipdir=require(_0xad86('0x2'));var jsonpatch=require(_0xad86('0x3'));var rp=require(_0xad86('0x4'));var moment=require(_0xad86('0x5'));var BPromise=require(_0xad86('0x6'));var Mustache=require(_0xad86('0x7'));var util=require(_0xad86('0x8'));var path=require(_0xad86('0x9'));var sox=require(_0xad86('0xa'));var csv=require(_0xad86('0xb'));var ejs=require(_0xad86('0xc'));var fs=require('fs');var fs_extra=require(_0xad86('0xd'));var _=require(_0xad86('0xe'));var squel=require(_0xad86('0xf'));var crypto=require(_0xad86('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xad86('0x11'));var toCsv=require(_0xad86('0xb'));var querystring=require('querystring');var Papa=require(_0xad86('0x12'));var Redis=require('ioredis');var authService=require(_0xad86('0x13'));var qs=require(_0xad86('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xad86('0x15'))(_0xad86('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xad86('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fe27d,_0x1d2a4d){_0x1d2a4d=_0x1d2a4d||0xcc;return function(_0x8d2a5d){if(_0x8d2a5d){return _0x3fe27d[_0xad86('0x18')](_0x1d2a4d);}return _0x3fe27d['status'](_0x1d2a4d)[_0xad86('0x19')]();};}function respondWithResult(_0x1d1bd7,_0x329b52){_0x329b52=_0x329b52||0xc8;return function(_0x5d5728){if(_0x5d5728){return _0x1d1bd7[_0xad86('0x1a')](_0x329b52)[_0xad86('0x1b')](_0x5d5728);}};}function respondWithFilteredResult(_0x108935,_0x2607a){return function(_0x68fb7f){if(_0x68fb7f){var _0x1b17aa=typeof _0x2607a[_0xad86('0x1c')]===_0xad86('0x1d')&&typeof _0x2607a['limit']==='undefined';var _0x186be5=_0x68fb7f['count'];var _0x4f57f0=_0x1b17aa?0x0:_0x2607a[_0xad86('0x1c')];var _0xb4a6d=_0x1b17aa?_0x68fb7f[_0xad86('0x1e')]:_0x2607a['offset']+_0x2607a[_0xad86('0x1f')];var _0x51e4dc;if(_0xb4a6d>=_0x186be5){_0xb4a6d=_0x186be5;_0x51e4dc=0xc8;}else{_0x51e4dc=0xce;}_0x108935['status'](_0x51e4dc);return _0x108935[_0xad86('0x20')](_0xad86('0x21'),_0x4f57f0+'-'+_0xb4a6d+'/'+_0x186be5)[_0xad86('0x1b')](_0x68fb7f);}return null;};}function patchUpdates(_0x2250f7){return function(_0x4aeccf){try{jsonpatch[_0xad86('0x22')](_0x4aeccf,_0x2250f7,!![]);}catch(_0x597b85){return BPromise[_0xad86('0x23')](_0x597b85);}return _0x4aeccf['save']();};}function saveUpdates(_0x4bae5b,_0x3559f7){return function(_0x295f77){if(_0x295f77){return _0x295f77[_0xad86('0x24')](_0x4bae5b)[_0xad86('0x25')](function(_0x3ba1b1){return _0x3ba1b1;});}return null;};}function removeEntity(_0x4e793a,_0xef944d){return function(_0x9f5072){if(_0x9f5072){return _0x9f5072['destroy']()[_0xad86('0x25')](function(){_0x4e793a[_0xad86('0x1a')](0xcc)[_0xad86('0x19')]();});}};}function handleEntityNotFound(_0x303d64,_0x41f9cf){return function(_0x52f94d){if(!_0x52f94d){_0x303d64[_0xad86('0x18')](0x194);}return _0x52f94d;};}function handleError(_0x53045f,_0x120a4c){_0x120a4c=_0x120a4c||0x1f4;return function(_0x3a5dcd){logger[_0xad86('0x26')](_0x3a5dcd[_0xad86('0x27')]);if(_0x3a5dcd['name']){delete _0x3a5dcd['name'];}_0x53045f[_0xad86('0x1a')](_0x120a4c)['send'](_0x3a5dcd);};}exports['index']=function(_0x2571a6,_0x285d48){var _0x287a67={},_0x242094={},_0x22bdee={'count':0x0,'rows':[]};var _0x9422e0=_[_0xad86('0x28')](db[_0xad86('0x29')][_0xad86('0x2a')],function(_0x386eeb){return{'name':_0x386eeb['fieldName'],'type':_0x386eeb[_0xad86('0x2b')][_0xad86('0x2c')]};});_0x242094[_0xad86('0x2d')]=_[_0xad86('0x28')](_0x9422e0,_0xad86('0x2e'));_0x242094[_0xad86('0x2f')]=_['keys'](_0x2571a6['query']);_0x242094[_0xad86('0x30')]=_[_0xad86('0x31')](_0x242094['model'],_0x242094[_0xad86('0x2f')]);_0x287a67[_0xad86('0x32')]=_[_0xad86('0x31')](_0x242094[_0xad86('0x2d')],qs['fields'](_0x2571a6[_0xad86('0x2f')][_0xad86('0x33')]));_0x287a67[_0xad86('0x32')]=_0x287a67['attributes'][_0xad86('0x34')]?_0x287a67[_0xad86('0x32')]:_0x242094[_0xad86('0x2d')];if(!_0x2571a6[_0xad86('0x2f')]['hasOwnProperty'](_0xad86('0x35'))){_0x287a67[_0xad86('0x1f')]=qs[_0xad86('0x1f')](_0x2571a6[_0xad86('0x2f')][_0xad86('0x1f')]);_0x287a67[_0xad86('0x1c')]=qs[_0xad86('0x1c')](_0x2571a6[_0xad86('0x2f')][_0xad86('0x1c')]);}_0x287a67[_0xad86('0x36')]=qs[_0xad86('0x37')](_0x2571a6[_0xad86('0x2f')]['sort']);_0x287a67['where']=qs['filters'](_[_0xad86('0x38')](_0x2571a6[_0xad86('0x2f')],_0x242094[_0xad86('0x30')]),_0x9422e0);if(_0x2571a6[_0xad86('0x2f')][_0xad86('0x39')]){_0x287a67[_0xad86('0x3a')]=_[_0xad86('0x3b')](_0x287a67[_0xad86('0x3a')],{'$or':_[_0xad86('0x28')](_0x9422e0,function(_0x10c824){if(_0x10c824[_0xad86('0x2b')]!==_0xad86('0x3c')){var _0x16d091={};_0x16d091[_0x10c824[_0xad86('0x2e')]]={'$like':'%'+_0x2571a6[_0xad86('0x2f')][_0xad86('0x39')]+'%'};return _0x16d091;}})});}_0x287a67=_[_0xad86('0x3b')]({},_0x287a67,_0x2571a6[_0xad86('0x3d')]);var _0x536eed={'where':_0x287a67[_0xad86('0x3a')]};return db['DeskConfiguration'][_0xad86('0x1e')](_0x536eed)[_0xad86('0x25')](function(_0x1012d4){_0x22bdee[_0xad86('0x1e')]=_0x1012d4;if(_0x2571a6[_0xad86('0x2f')][_0xad86('0x3e')]){_0x287a67[_0xad86('0x3f')]=[{'all':!![]}];}return db[_0xad86('0x29')][_0xad86('0x40')](_0x287a67);})[_0xad86('0x25')](function(_0x15ff77){_0x22bdee[_0xad86('0x41')]=_0x15ff77;return _0x22bdee;})[_0xad86('0x25')](respondWithFilteredResult(_0x285d48,_0x287a67))[_0xad86('0x42')](handleError(_0x285d48,null));};exports[_0xad86('0x43')]=function(_0x97dfb7,_0x431626){var _0x165ba3={'raw':![],'where':{'id':_0x97dfb7['params']['id']}},_0x5dcfe3={};_0x5dcfe3['model']=_[_0xad86('0x44')](db[_0xad86('0x29')][_0xad86('0x2a')]);_0x5dcfe3[_0xad86('0x2f')]=_[_0xad86('0x44')](_0x97dfb7[_0xad86('0x2f')]);_0x5dcfe3[_0xad86('0x30')]=_[_0xad86('0x31')](_0x5dcfe3[_0xad86('0x2d')],_0x5dcfe3[_0xad86('0x2f')]);_0x165ba3[_0xad86('0x32')]=_[_0xad86('0x31')](_0x5dcfe3[_0xad86('0x2d')],qs['fields'](_0x97dfb7['query'][_0xad86('0x33')]));_0x165ba3['attributes']=_0x165ba3[_0xad86('0x32')][_0xad86('0x34')]?_0x165ba3[_0xad86('0x32')]:_0x5dcfe3[_0xad86('0x2d')];if(_0x97dfb7[_0xad86('0x2f')]['includeAll']){_0x165ba3[_0xad86('0x3f')]=[{'all':!![]}];}_0x165ba3=_[_0xad86('0x3b')]({},_0x165ba3,_0x97dfb7[_0xad86('0x3d')]);return db[_0xad86('0x29')][_0xad86('0x45')](_0x165ba3)[_0xad86('0x25')](handleEntityNotFound(_0x431626,null))[_0xad86('0x25')](respondWithResult(_0x431626,null))[_0xad86('0x42')](handleError(_0x431626,null));};exports[_0xad86('0x46')]=function(_0x47f0cb,_0x1190db){return db[_0xad86('0x29')]['create'](_0x47f0cb[_0xad86('0x47')],{})[_0xad86('0x25')](respondWithResult(_0x1190db,0xc9))[_0xad86('0x42')](handleError(_0x1190db,null));};exports[_0xad86('0x24')]=function(_0x43cee4,_0x3a5a34){if(_0x43cee4[_0xad86('0x47')]['id']){delete _0x43cee4[_0xad86('0x47')]['id'];}return db[_0xad86('0x29')][_0xad86('0x45')]({'where':{'id':_0x43cee4[_0xad86('0x48')]['id']}})[_0xad86('0x25')](handleEntityNotFound(_0x3a5a34,null))[_0xad86('0x25')](saveUpdates(_0x43cee4[_0xad86('0x47')],null))[_0xad86('0x25')](respondWithResult(_0x3a5a34,null))['catch'](handleError(_0x3a5a34,null));};exports[_0xad86('0x49')]=function(_0xfde7bf,_0x487596){return db['DeskConfiguration'][_0xad86('0x45')]({'where':{'id':_0xfde7bf[_0xad86('0x48')]['id']}})['then'](handleEntityNotFound(_0x487596,null))[_0xad86('0x25')](removeEntity(_0x487596,null))[_0xad86('0x42')](handleError(_0x487596,null));};exports[_0xad86('0x4a')]=function(_0x4c6666,_0x408a5f,_0x3bdb90){var _0x19e8f3={};var _0x49a241={};var _0x766841;var _0x52233d;return db[_0xad86('0x29')][_0xad86('0x4b')]({'where':{'id':_0x4c6666[_0xad86('0x48')]['id']}})['then'](handleEntityNotFound(_0x408a5f,null))[_0xad86('0x25')](function(_0x2d6511){if(_0x2d6511){_0x766841=_0x2d6511;_0x49a241[_0xad86('0x2d')]=_[_0xad86('0x44')](db['DeskField']['rawAttributes']);_0x49a241[_0xad86('0x2f')]=_[_0xad86('0x44')](_0x4c6666[_0xad86('0x2f')]);_0x49a241[_0xad86('0x30')]=_[_0xad86('0x31')](_0x49a241[_0xad86('0x2d')],_0x49a241[_0xad86('0x2f')]);_0x19e8f3[_0xad86('0x32')]=_['intersection'](_0x49a241[_0xad86('0x2d')],qs['fields'](_0x4c6666[_0xad86('0x2f')][_0xad86('0x33')]));_0x19e8f3[_0xad86('0x32')]=_0x19e8f3[_0xad86('0x32')][_0xad86('0x34')]?_0x19e8f3[_0xad86('0x32')]:_0x49a241[_0xad86('0x2d')];_0x19e8f3[_0xad86('0x36')]=qs[_0xad86('0x37')](_0x4c6666[_0xad86('0x2f')][_0xad86('0x37')]);_0x19e8f3[_0xad86('0x3a')]=qs[_0xad86('0x30')](_[_0xad86('0x38')](_0x4c6666['query'],_0x49a241['filters']));if(_0x4c6666[_0xad86('0x2f')][_0xad86('0x39')]){_0x19e8f3[_0xad86('0x3a')]=_[_0xad86('0x3b')](_0x19e8f3['where'],{'$or':_[_0xad86('0x28')](_0x19e8f3[_0xad86('0x32')],function(_0x4e1e9b){var _0x2278c5={};_0x2278c5[_0x4e1e9b]={'$like':'%'+_0x4c6666[_0xad86('0x2f')][_0xad86('0x39')]+'%'};return _0x2278c5;})});}_0x19e8f3=_['merge']({},_0x19e8f3,_0x4c6666[_0xad86('0x3d')]);return _0x766841['getFields'](_0x19e8f3);}})[_0xad86('0x25')](function(_0x311c80){if(_0x311c80){_0x52233d=_0x311c80['length'];if(!_0x4c6666[_0xad86('0x2f')][_0xad86('0x4c')]('nolimit')){_0x19e8f3[_0xad86('0x1f')]=qs[_0xad86('0x1f')](_0x4c6666[_0xad86('0x2f')][_0xad86('0x1f')]);_0x19e8f3['offset']=qs[_0xad86('0x1c')](_0x4c6666[_0xad86('0x2f')][_0xad86('0x1c')]);}return _0x766841[_0xad86('0x4a')](_0x19e8f3);}})[_0xad86('0x25')](function(_0x78243f){if(_0x78243f){return _0x78243f?{'count':_0x52233d,'rows':_0x78243f}:null;}})[_0xad86('0x25')](respondWithResult(_0x408a5f,null))[_0xad86('0x42')](handleError(_0x408a5f,null));};exports[_0xad86('0x4d')]=function(_0xe254d4,_0x3f403b,_0x1eb37e){var _0x3bf2ce={};var _0xfbb2a8={};var _0x5f3062;var _0x4633aa;return db['DeskConfiguration'][_0xad86('0x4b')]({'where':{'id':_0xe254d4['params']['id']}})[_0xad86('0x25')](handleEntityNotFound(_0x3f403b,null))['then'](function(_0x15b0b2){if(_0x15b0b2){_0x5f3062=_0x15b0b2;_0xfbb2a8[_0xad86('0x2d')]=_[_0xad86('0x44')](db[_0xad86('0x4e')][_0xad86('0x2a')]);_0xfbb2a8[_0xad86('0x2f')]=_['keys'](_0xe254d4[_0xad86('0x2f')]);_0xfbb2a8[_0xad86('0x30')]=_[_0xad86('0x31')](_0xfbb2a8[_0xad86('0x2d')],_0xfbb2a8[_0xad86('0x2f')]);_0x3bf2ce[_0xad86('0x32')]=_['intersection'](_0xfbb2a8[_0xad86('0x2d')],qs[_0xad86('0x33')](_0xe254d4[_0xad86('0x2f')][_0xad86('0x33')]));_0x3bf2ce[_0xad86('0x32')]=_0x3bf2ce[_0xad86('0x32')][_0xad86('0x34')]?_0x3bf2ce['attributes']:_0xfbb2a8[_0xad86('0x2d')];_0x3bf2ce[_0xad86('0x36')]=qs[_0xad86('0x37')](_0xe254d4[_0xad86('0x2f')][_0xad86('0x37')]);_0x3bf2ce[_0xad86('0x3a')]=qs[_0xad86('0x30')](_[_0xad86('0x38')](_0xe254d4[_0xad86('0x2f')],_0xfbb2a8[_0xad86('0x30')]));if(_0xe254d4[_0xad86('0x2f')][_0xad86('0x39')]){_0x3bf2ce[_0xad86('0x3a')]=_['merge'](_0x3bf2ce['where'],{'$or':_[_0xad86('0x28')](_0x3bf2ce['attributes'],function(_0x404ff2){var _0x38ebe0={};_0x38ebe0[_0x404ff2]={'$like':'%'+_0xe254d4[_0xad86('0x2f')][_0xad86('0x39')]+'%'};return _0x38ebe0;})});}_0x3bf2ce=_[_0xad86('0x3b')]({},_0x3bf2ce,_0xe254d4['options']);return _0x5f3062['getSubjects'](_0x3bf2ce);}})[_0xad86('0x25')](function(_0x5da610){if(_0x5da610){_0x4633aa=_0x5da610[_0xad86('0x34')];if(!_0xe254d4[_0xad86('0x2f')][_0xad86('0x4c')]('nolimit')){_0x3bf2ce['limit']=qs[_0xad86('0x1f')](_0xe254d4['query'][_0xad86('0x1f')]);_0x3bf2ce[_0xad86('0x1c')]=qs[_0xad86('0x1c')](_0xe254d4['query'][_0xad86('0x1c')]);}return _0x5f3062[_0xad86('0x4d')](_0x3bf2ce);}})[_0xad86('0x25')](function(_0x296e3d){if(_0x296e3d){return _0x296e3d?{'count':_0x4633aa,'rows':_0x296e3d}:null;}})['then'](respondWithResult(_0x3f403b,null))[_0xad86('0x42')](handleError(_0x3f403b,null));};exports['getDescriptions']=function(_0x3ccbd2,_0x3bebf9,_0x2c8349){var _0x272b69={};var _0x4d2c6a={};var _0x3ed1a1;var _0x585e9b;return db['DeskConfiguration'][_0xad86('0x4b')]({'where':{'id':_0x3ccbd2[_0xad86('0x48')]['id']}})['then'](handleEntityNotFound(_0x3bebf9,null))[_0xad86('0x25')](function(_0x57f527){if(_0x57f527){_0x3ed1a1=_0x57f527;_0x4d2c6a[_0xad86('0x2d')]=_[_0xad86('0x44')](db[_0xad86('0x4e')][_0xad86('0x2a')]);_0x4d2c6a[_0xad86('0x2f')]=_['keys'](_0x3ccbd2['query']);_0x4d2c6a[_0xad86('0x30')]=_['intersection'](_0x4d2c6a[_0xad86('0x2d')],_0x4d2c6a['query']);_0x272b69['attributes']=_[_0xad86('0x31')](_0x4d2c6a[_0xad86('0x2d')],qs[_0xad86('0x33')](_0x3ccbd2[_0xad86('0x2f')][_0xad86('0x33')]));_0x272b69[_0xad86('0x32')]=_0x272b69[_0xad86('0x32')][_0xad86('0x34')]?_0x272b69[_0xad86('0x32')]:_0x4d2c6a[_0xad86('0x2d')];_0x272b69[_0xad86('0x36')]=qs[_0xad86('0x37')](_0x3ccbd2[_0xad86('0x2f')][_0xad86('0x37')]);_0x272b69['where']=qs[_0xad86('0x30')](_['pick'](_0x3ccbd2['query'],_0x4d2c6a[_0xad86('0x30')]));if(_0x3ccbd2[_0xad86('0x2f')][_0xad86('0x39')]){_0x272b69[_0xad86('0x3a')]=_[_0xad86('0x3b')](_0x272b69[_0xad86('0x3a')],{'$or':_[_0xad86('0x28')](_0x272b69['attributes'],function(_0x3daa83){var _0x561b5c={};_0x561b5c[_0x3daa83]={'$like':'%'+_0x3ccbd2[_0xad86('0x2f')][_0xad86('0x39')]+'%'};return _0x561b5c;})});}_0x272b69=_[_0xad86('0x3b')]({},_0x272b69,_0x3ccbd2[_0xad86('0x3d')]);return _0x3ed1a1[_0xad86('0x4f')](_0x272b69);}})[_0xad86('0x25')](function(_0x163a53){if(_0x163a53){_0x585e9b=_0x163a53[_0xad86('0x34')];if(!_0x3ccbd2[_0xad86('0x2f')][_0xad86('0x4c')](_0xad86('0x35'))){_0x272b69[_0xad86('0x1f')]=qs[_0xad86('0x1f')](_0x3ccbd2[_0xad86('0x2f')][_0xad86('0x1f')]);_0x272b69[_0xad86('0x1c')]=qs['offset'](_0x3ccbd2[_0xad86('0x2f')]['offset']);}return _0x3ed1a1['getDescriptions'](_0x272b69);}})[_0xad86('0x25')](function(_0x2a834f){if(_0x2a834f){return _0x2a834f?{'count':_0x585e9b,'rows':_0x2a834f}:null;}})[_0xad86('0x25')](respondWithResult(_0x3bebf9,null))[_0xad86('0x42')](handleError(_0x3bebf9,null));};exports['getTags']=function(_0x1d2b17,_0x4869a2,_0x26e996){var _0x41fec9={};var _0x5f9b8d={};var _0x59c484;var _0xbc2508;return db[_0xad86('0x29')]['findOne']({'where':{'id':_0x1d2b17['params']['id']}})['then'](handleEntityNotFound(_0x4869a2,null))[_0xad86('0x25')](function(_0x339d38){if(_0x339d38){_0x59c484=_0x339d38;_0x5f9b8d[_0xad86('0x2d')]=_[_0xad86('0x44')](db[_0xad86('0x50')][_0xad86('0x2a')]);_0x5f9b8d[_0xad86('0x2f')]=_[_0xad86('0x44')](_0x1d2b17[_0xad86('0x2f')]);_0x5f9b8d['filters']=_[_0xad86('0x31')](_0x5f9b8d[_0xad86('0x2d')],_0x5f9b8d[_0xad86('0x2f')]);_0x41fec9[_0xad86('0x32')]=_[_0xad86('0x31')](_0x5f9b8d[_0xad86('0x2d')],qs['fields'](_0x1d2b17[_0xad86('0x2f')][_0xad86('0x33')]));_0x41fec9[_0xad86('0x32')]=_0x41fec9[_0xad86('0x32')][_0xad86('0x34')]?_0x41fec9[_0xad86('0x32')]:_0x5f9b8d[_0xad86('0x2d')];_0x41fec9[_0xad86('0x36')]=qs[_0xad86('0x37')](_0x1d2b17[_0xad86('0x2f')][_0xad86('0x37')]);_0x41fec9['where']=qs[_0xad86('0x30')](_[_0xad86('0x38')](_0x1d2b17[_0xad86('0x2f')],_0x5f9b8d[_0xad86('0x30')]));if(_0x1d2b17[_0xad86('0x2f')][_0xad86('0x39')]){_0x41fec9[_0xad86('0x3a')]=_['merge'](_0x41fec9['where'],{'$or':_['map'](_0x41fec9[_0xad86('0x32')],function(_0x19e4c8){var _0x8d2a5c={};_0x8d2a5c[_0x19e4c8]={'$like':'%'+_0x1d2b17[_0xad86('0x2f')][_0xad86('0x39')]+'%'};return _0x8d2a5c;})});}_0x41fec9=_[_0xad86('0x3b')]({},_0x41fec9,_0x1d2b17[_0xad86('0x3d')]);return _0x59c484[_0xad86('0x51')](_0x41fec9);}})[_0xad86('0x25')](function(_0x3199ea){if(_0x3199ea){_0xbc2508=_0x3199ea['length'];if(!_0x1d2b17[_0xad86('0x2f')][_0xad86('0x4c')](_0xad86('0x35'))){_0x41fec9['limit']=qs[_0xad86('0x1f')](_0x1d2b17[_0xad86('0x2f')][_0xad86('0x1f')]);_0x41fec9[_0xad86('0x1c')]=qs['offset'](_0x1d2b17[_0xad86('0x2f')][_0xad86('0x1c')]);}return _0x59c484[_0xad86('0x51')](_0x41fec9);}})[_0xad86('0x25')](function(_0x3a6696){if(_0x3a6696){return _0x3a6696?{'count':_0xbc2508,'rows':_0x3a6696}:null;}})[_0xad86('0x25')](respondWithResult(_0x4869a2,null))[_0xad86('0x42')](handleError(_0x4869a2,null));};exports[_0xad86('0x52')]=function(_0x5b69ed,_0x3dcb59,_0x162c2a){if(_0x5b69ed['body']['id']){delete _0x5b69ed[_0xad86('0x47')]['id'];}return db[_0xad86('0x29')][_0xad86('0x4b')]({'where':{'id':_0x5b69ed['params']['id']}})[_0xad86('0x25')](handleEntityNotFound(_0x3dcb59,null))['then'](function(_0x5a760d){if(_0x5a760d){return _0x5a760d[_0xad86('0x52')](_0x5b69ed['body'][_0xad86('0x53')]||[]);}return null;})[_0xad86('0x25')](respondWithResult(_0x3dcb59,null))[_0xad86('0x42')](handleError(_0x3dcb59,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 3c5afd3..d223db9 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 _0xa396=['define','DeskConfiguration','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x4198cc,_0x386df1){var _0x345d5d=function(_0x2f609f){while(--_0x2f609f){_0x4198cc['push'](_0x4198cc['shift']());}};_0x345d5d(++_0x386df1);}(_0xa396,0xaa));var _0x6a39=function(_0xd26b88,_0x492521){_0xd26b88=_0xd26b88-0x0;var _0x21e5f0=_0xa396[_0xd26b88];return _0x21e5f0;};'use strict';var _=require(_0x6a39('0x0'));var util=require(_0x6a39('0x1'));var logger=require('../../config/logger')(_0x6a39('0x2'));var moment=require(_0x6a39('0x3'));var BPromise=require('bluebird');var rp=require(_0x6a39('0x4'));var fs=require('fs');var path=require(_0x6a39('0x5'));var rimraf=require(_0x6a39('0x6'));var config=require(_0x6a39('0x7'));var attributes=require(_0x6a39('0x8'));module[_0x6a39('0x9')]=function(_0x1cd04b,_0x44279c){return _0x1cd04b[_0x6a39('0xa')](_0x6a39('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x699a=['../../config/logger','api','bluebird','request-promise','path','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x603217,_0x308d49){var _0x373957=function(_0x431de6){while(--_0x431de6){_0x603217['push'](_0x603217['shift']());}};_0x373957(++_0x308d49);}(_0x699a,0x12a));var _0xa699=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x699a[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0xa699('0x0'));var util=require(_0xa699('0x1'));var logger=require(_0xa699('0x2'))(_0xa699('0x3'));var moment=require('moment');var BPromise=require(_0xa699('0x4'));var rp=require(_0xa699('0x5'));var fs=require('fs');var path=require(_0xa699('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa699('0x7'));module[_0xa699('0x8')]=function(_0x5e4564,_0x17e8e6){return _0x5e4564[_0xa699('0x9')](_0xa699('0xa'),attributes,{'tableName':_0xa699('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 07ddf0d..fb863c2 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 _0xa321=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','request','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment'];(function(_0x4f9f37,_0x1c2b67){var _0x370c88=function(_0x37641b){while(--_0x37641b){_0x4f9f37['push'](_0x4f9f37['shift']());}};_0x370c88(++_0x1c2b67);}(_0xa321,0x9d));var _0x1a32=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa321[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1a32('0x0'));var util=require(_0x1a32('0x1'));var moment=require(_0x1a32('0x2'));var BPromise=require(_0x1a32('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a32('0x4'));var db=require(_0x1a32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a32('0x6'))(_0x1a32('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1a32('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4859d6,_0x13b4d2,_0x1fa204){return new BPromise(function(_0xdfa9fe,_0x3f4723){return client[_0x1a32('0x9')](_0x4859d6,_0x1fa204)['then'](function(_0x343faf){logger[_0x1a32('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0x13b4d2,_0x1a32('0xb'));logger[_0x1a32('0xc')](_0x1a32('0xd'),_0x13b4d2,_0x1a32('0xb'),JSON[_0x1a32('0xe')](_0x343faf));if(_0x343faf[_0x1a32('0xf')]){if(_0x343faf['error'][_0x1a32('0x10')]===0x1f4){logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x343faf['error'][_0x1a32('0x12')]);return _0x3f4723(_0x343faf[_0x1a32('0xf')][_0x1a32('0x12')]);}logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x343faf['error'][_0x1a32('0x12')]);return _0xdfa9fe(_0x343faf[_0x1a32('0xf')][_0x1a32('0x12')]);}else{logger[_0x1a32('0xa')](_0x1a32('0x11'),_0x13b4d2,_0x1a32('0xb'));_0xdfa9fe(_0x343faf['result'][_0x1a32('0x12')]);}})[_0x1a32('0x13')](function(_0x47bb8e){logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x47bb8e);_0x3f4723(_0x47bb8e);});});} \ No newline at end of file +var _0x02fe=['error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2488c7,_0x21d448){var _0x3f811f=function(_0x30d73b){while(--_0x30d73b){_0x2488c7['push'](_0x2488c7['shift']());}};_0x3f811f(++_0x21d448);}(_0x02fe,0x1b8));var _0xe02f=function(_0x14f945,_0x56671f){_0x14f945=_0x14f945-0x0;var _0x154dd5=_0x02fe[_0x14f945];return _0x154dd5;};'use strict';var _=require('lodash');var util=require(_0xe02f('0x0'));var moment=require(_0xe02f('0x1'));var BPromise=require(_0xe02f('0x2'));var rs=require(_0xe02f('0x3'));var fs=require('fs');var Redis=require(_0xe02f('0x4'));var db=require(_0xe02f('0x5'))['db'];var utils=require(_0xe02f('0x6'));var logger=require(_0xe02f('0x7'))(_0xe02f('0x8'));var config=require(_0xe02f('0x9'));var jayson=require(_0xe02f('0xa'));var client=jayson[_0xe02f('0xb')][_0xe02f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b1150,_0x1106a4,_0x45f434){return new BPromise(function(_0x485ea1,_0x24fb5c){return client['request'](_0x3b1150,_0x45f434)[_0xe02f('0xd')](function(_0xe28b82){logger[_0xe02f('0xe')](_0xe02f('0xf'),_0x1106a4,'request\x20sent');logger[_0xe02f('0x10')](_0xe02f('0x11'),_0x1106a4,_0xe02f('0x12'),JSON[_0xe02f('0x13')](_0xe28b82));if(_0xe28b82[_0xe02f('0x14')]){if(_0xe28b82[_0xe02f('0x14')]['code']===0x1f4){logger[_0xe02f('0x14')](_0xe02f('0xf'),_0x1106a4,_0xe28b82[_0xe02f('0x14')][_0xe02f('0x15')]);return _0x24fb5c(_0xe28b82[_0xe02f('0x14')]['message']);}logger['error'](_0xe02f('0xf'),_0x1106a4,_0xe28b82[_0xe02f('0x14')][_0xe02f('0x15')]);return _0x485ea1(_0xe28b82['error']['message']);}else{logger[_0xe02f('0xe')](_0xe02f('0xf'),_0x1106a4,'request\x20sent');_0x485ea1(_0xe28b82['result']['message']);}})[_0xe02f('0x16')](function(_0x20d376){logger[_0xe02f('0x14')](_0xe02f('0xf'),_0x1106a4,_0x20d376);_0x24fb5c(_0x20d376);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index d24e933..f223edc 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 _0xf55d=['show','post','create','update','delete','/:id','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated'];(function(_0xa63ea3,_0x4367ff){var _0x2aa5ff=function(_0x30dc84){while(--_0x30dc84){_0xa63ea3['push'](_0xa63ea3['shift']());}};_0x2aa5ff(++_0x4367ff);}(_0xf55d,0x14b));var _0xdf55=function(_0x3199dc,_0xdd7b46){_0x3199dc=_0x3199dc-0x0;var _0x3f2b4a=_0xf55d[_0x3199dc];return _0x3f2b4a;};'use strict';var multer=require(_0xdf55('0x0'));var util=require(_0xdf55('0x1'));var path=require(_0xdf55('0x2'));var timeout=require('connect-timeout');var express=require(_0xdf55('0x3'));var router=express[_0xdf55('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdf55('0x5'));var interaction=require(_0xdf55('0x6'));var config=require(_0xdf55('0x7'));var controller=require(_0xdf55('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xdf55('0x9')]('/:id',auth[_0xdf55('0xa')](),controller[_0xdf55('0xb')]);router[_0xdf55('0xc')]('/',auth[_0xdf55('0xa')](),controller[_0xdf55('0xd')]);router['put']('/:id',auth[_0xdf55('0xa')](),controller[_0xdf55('0xe')]);router[_0xdf55('0xf')](_0xdf55('0x10'),auth[_0xdf55('0xa')](),controller[_0xdf55('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1e5a=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','isAuthenticated','index','get','/:id','show','create','update','delete'];(function(_0x515da8,_0x3b69d2){var _0x10da36=function(_0x50e50b){while(--_0x50e50b){_0x515da8['push'](_0x515da8['shift']());}};_0x10da36(++_0x3b69d2);}(_0x1e5a,0xb5));var _0xa1e5=function(_0x5e1f4b,_0x50b208){_0x5e1f4b=_0x5e1f4b-0x0;var _0x5ce7b4=_0x1e5a[_0x5e1f4b];return _0x5ce7b4;};'use strict';var multer=require(_0xa1e5('0x0'));var util=require(_0xa1e5('0x1'));var path=require(_0xa1e5('0x2'));var timeout=require(_0xa1e5('0x3'));var express=require(_0xa1e5('0x4'));var router=express['Router']();var fs_extra=require(_0xa1e5('0x5'));var auth=require(_0xa1e5('0x6'));var interaction=require(_0xa1e5('0x7'));var config=require('../../config/environment');var controller=require(_0xa1e5('0x8'));router['get']('/',auth[_0xa1e5('0x9')](),controller[_0xa1e5('0xa')]);router[_0xa1e5('0xb')](_0xa1e5('0xc'),auth[_0xa1e5('0x9')](),controller[_0xa1e5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa1e5('0xe')]);router['put'](_0xa1e5('0xc'),auth[_0xa1e5('0x9')](),controller[_0xa1e5('0xf')]);router[_0xa1e5('0x10')](_0xa1e5('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xa1e5('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 701bdf8..b421d98 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 _0xa07f=['variable','customVariable','keyValue','picklist','STRING','ENUM','sequelize','exports','string'];(function(_0x4cd4ca,_0x3c3623){var _0x2acb49=function(_0x381159){while(--_0x381159){_0x4cd4ca['push'](_0x4cd4ca['shift']());}};_0x2acb49(++_0x3c3623);}(_0xa07f,0x72));var _0xfa07=function(_0xaf88dc,_0x528f86){_0xaf88dc=_0xaf88dc-0x0;var _0x45e0a9=_0xa07f[_0xaf88dc];return _0x45e0a9;};'use strict';var Sequelize=require(_0xfa07('0x0'));module[_0xfa07('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfa07('0x2'),_0xfa07('0x3'),_0xfa07('0x4'),_0xfa07('0x5'),_0xfa07('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfa07('0x7')]},'key':{'type':Sequelize[_0xfa07('0x7')]},'keyType':{'type':Sequelize[_0xfa07('0x8')](_0xfa07('0x2'),_0xfa07('0x3'),_0xfa07('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfa07('0x7')]},'nameField':{'type':Sequelize[_0xfa07('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8886=['picklist','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8886,0x87));var _0x6888=function(_0x3a51b7,_0x423b97){_0x3a51b7=_0x3a51b7-0x0;var _0x8c807d=_0x8886[_0x3a51b7];return _0x8c807d;};'use strict';var Sequelize=require(_0x6888('0x0'));module[_0x6888('0x1')]={'type':{'type':Sequelize[_0x6888('0x2')]('string','variable',_0x6888('0x3'),_0x6888('0x4'),_0x6888('0x5')),'defaultValue':_0x6888('0x6')},'content':{'type':Sequelize[_0x6888('0x7')]},'key':{'type':Sequelize[_0x6888('0x7')]},'keyType':{'type':Sequelize[_0x6888('0x2')](_0x6888('0x6'),_0x6888('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x6888('0x7')]},'idField':{'type':Sequelize[_0x6888('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6888('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 51221b6..1239755 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 _0x29e8=['includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','update','then','destroy','name','send','index','map','DeskField','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','options'];(function(_0x5e08be,_0x9bf344){var _0x4db79e=function(_0x3b8cc3){while(--_0x3b8cc3){_0x5e08be['push'](_0x5e08be['shift']());}};_0x4db79e(++_0x9bf344);}(_0x29e8,0x116));var _0x829e=function(_0x2c07a6,_0x311e8d){_0x2c07a6=_0x2c07a6-0x0;var _0x34e485=_0x29e8[_0x2c07a6];return _0x34e485;};'use strict';var emlformat=require(_0x829e('0x0'));var rimraf=require(_0x829e('0x1'));var zipdir=require(_0x829e('0x2'));var jsonpatch=require(_0x829e('0x3'));var rp=require('request-promise');var moment=require(_0x829e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x829e('0x5'));var util=require(_0x829e('0x6'));var path=require(_0x829e('0x7'));var sox=require(_0x829e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x829e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x829e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x829e('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x829e('0xc'));var Redis=require(_0x829e('0xd'));var authService=require(_0x829e('0xe'));var qs=require(_0x829e('0xf'));var as=require(_0x829e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x829e('0x11'))(_0x829e('0x12'));var utils=require(_0x829e('0x13'));var config=require(_0x829e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x829e('0x15'))['db'];function respondWithStatusCode(_0x74950b,_0x3a1697){_0x3a1697=_0x3a1697||0xcc;return function(_0x5b4107){if(_0x5b4107){return _0x74950b[_0x829e('0x16')](_0x3a1697);}return _0x74950b[_0x829e('0x17')](_0x3a1697)[_0x829e('0x18')]();};}function respondWithResult(_0x1f81bb,_0x2f7c64){_0x2f7c64=_0x2f7c64||0xc8;return function(_0x2162a8){if(_0x2162a8){return _0x1f81bb['status'](_0x2f7c64)[_0x829e('0x19')](_0x2162a8);}};}function respondWithFilteredResult(_0xc48685,_0x4b6de9){return function(_0x599f8b){if(_0x599f8b){var _0x39fd66=typeof _0x4b6de9[_0x829e('0x1a')]===_0x829e('0x1b')&&typeof _0x4b6de9['limit']==='undefined';var _0x8bdd5f=_0x599f8b['count'];var _0x2a7f8d=_0x39fd66?0x0:_0x4b6de9[_0x829e('0x1a')];var _0x5d43a0=_0x39fd66?_0x599f8b[_0x829e('0x1c')]:_0x4b6de9[_0x829e('0x1a')]+_0x4b6de9[_0x829e('0x1d')];var _0x22f012;if(_0x5d43a0>=_0x8bdd5f){_0x5d43a0=_0x8bdd5f;_0x22f012=0xc8;}else{_0x22f012=0xce;}_0xc48685['status'](_0x22f012);return _0xc48685['set']('Content-Range',_0x2a7f8d+'-'+_0x5d43a0+'/'+_0x8bdd5f)[_0x829e('0x19')](_0x599f8b);}return null;};}function patchUpdates(_0x44196d){return function(_0x370d2c){try{jsonpatch['apply'](_0x370d2c,_0x44196d,!![]);}catch(_0x5605dd){return BPromise['reject'](_0x5605dd);}return _0x370d2c['save']();};}function saveUpdates(_0x1fc75f,_0x30f9ca){return function(_0x4b5711){if(_0x4b5711){return _0x4b5711[_0x829e('0x1e')](_0x1fc75f)[_0x829e('0x1f')](function(_0x244b66){return _0x244b66;});}return null;};}function removeEntity(_0x5e264b,_0x1efdba){return function(_0x4e1082){if(_0x4e1082){return _0x4e1082[_0x829e('0x20')]()[_0x829e('0x1f')](function(){_0x5e264b[_0x829e('0x17')](0xcc)[_0x829e('0x18')]();});}};}function handleEntityNotFound(_0x37a6c1,_0x13adf6){return function(_0x108f15){if(!_0x108f15){_0x37a6c1[_0x829e('0x16')](0x194);}return _0x108f15;};}function handleError(_0xbe9590,_0x497128){_0x497128=_0x497128||0x1f4;return function(_0xfc8699){logger['error'](_0xfc8699['stack']);if(_0xfc8699[_0x829e('0x21')]){delete _0xfc8699[_0x829e('0x21')];}_0xbe9590[_0x829e('0x17')](_0x497128)[_0x829e('0x22')](_0xfc8699);};}exports[_0x829e('0x23')]=function(_0xffd177,_0x22572b){var _0x357f28={},_0x55c0e5={},_0x257e5a={'count':0x0,'rows':[]};var _0x3c23b6=_[_0x829e('0x24')](db[_0x829e('0x25')][_0x829e('0x26')],function(_0xa0c589){return{'name':_0xa0c589[_0x829e('0x27')],'type':_0xa0c589['type'][_0x829e('0x28')]};});_0x55c0e5[_0x829e('0x29')]=_['map'](_0x3c23b6,_0x829e('0x21'));_0x55c0e5['query']=_[_0x829e('0x2a')](_0xffd177['query']);_0x55c0e5['filters']=_[_0x829e('0x2b')](_0x55c0e5[_0x829e('0x29')],_0x55c0e5[_0x829e('0x2c')]);_0x357f28[_0x829e('0x2d')]=_[_0x829e('0x2b')](_0x55c0e5[_0x829e('0x29')],qs[_0x829e('0x2e')](_0xffd177[_0x829e('0x2c')][_0x829e('0x2e')]));_0x357f28[_0x829e('0x2d')]=_0x357f28[_0x829e('0x2d')][_0x829e('0x2f')]?_0x357f28['attributes']:_0x55c0e5[_0x829e('0x29')];if(!_0xffd177['query'][_0x829e('0x30')](_0x829e('0x31'))){_0x357f28[_0x829e('0x1d')]=qs[_0x829e('0x1d')](_0xffd177[_0x829e('0x2c')][_0x829e('0x1d')]);_0x357f28[_0x829e('0x1a')]=qs[_0x829e('0x1a')](_0xffd177[_0x829e('0x2c')][_0x829e('0x1a')]);}_0x357f28[_0x829e('0x32')]=qs[_0x829e('0x33')](_0xffd177[_0x829e('0x2c')][_0x829e('0x33')]);_0x357f28[_0x829e('0x34')]=qs['filters'](_['pick'](_0xffd177['query'],_0x55c0e5[_0x829e('0x35')]),_0x3c23b6);if(_0xffd177['query']['filter']){_0x357f28[_0x829e('0x34')]=_[_0x829e('0x36')](_0x357f28[_0x829e('0x34')],{'$or':_[_0x829e('0x24')](_0x3c23b6,function(_0x7c8f1b){if(_0x7c8f1b['type']!==_0x829e('0x37')){var _0x4ac416={};_0x4ac416[_0x7c8f1b[_0x829e('0x21')]]={'$like':'%'+_0xffd177[_0x829e('0x2c')]['filter']+'%'};return _0x4ac416;}})});}_0x357f28=_[_0x829e('0x36')]({},_0x357f28,_0xffd177[_0x829e('0x38')]);var _0x273dcb={'where':_0x357f28[_0x829e('0x34')]};return db[_0x829e('0x25')][_0x829e('0x1c')](_0x273dcb)[_0x829e('0x1f')](function(_0x397dec){_0x257e5a[_0x829e('0x1c')]=_0x397dec;if(_0xffd177[_0x829e('0x2c')][_0x829e('0x39')]){_0x357f28[_0x829e('0x3a')]=[{'all':!![]}];}return db[_0x829e('0x25')][_0x829e('0x3b')](_0x357f28);})[_0x829e('0x1f')](function(_0x132a2e){_0x257e5a[_0x829e('0x3c')]=_0x132a2e;return _0x257e5a;})[_0x829e('0x1f')](respondWithFilteredResult(_0x22572b,_0x357f28))[_0x829e('0x3d')](handleError(_0x22572b,null));};exports[_0x829e('0x3e')]=function(_0x118e0a,_0x50c4de){var _0x2997b9={'raw':!![],'where':{'id':_0x118e0a[_0x829e('0x3f')]['id']}},_0x37acd7={};_0x37acd7['model']=_[_0x829e('0x2a')](db[_0x829e('0x25')][_0x829e('0x26')]);_0x37acd7[_0x829e('0x2c')]=_[_0x829e('0x2a')](_0x118e0a[_0x829e('0x2c')]);_0x37acd7['filters']=_['intersection'](_0x37acd7[_0x829e('0x29')],_0x37acd7[_0x829e('0x2c')]);_0x2997b9[_0x829e('0x2d')]=_[_0x829e('0x2b')](_0x37acd7[_0x829e('0x29')],qs['fields'](_0x118e0a[_0x829e('0x2c')]['fields']));_0x2997b9['attributes']=_0x2997b9['attributes'][_0x829e('0x2f')]?_0x2997b9[_0x829e('0x2d')]:_0x37acd7[_0x829e('0x29')];if(_0x118e0a['query']['includeAll']){_0x2997b9[_0x829e('0x3a')]=[{'all':!![]}];}_0x2997b9=_['merge']({},_0x2997b9,_0x118e0a['options']);return db[_0x829e('0x25')][_0x829e('0x40')](_0x2997b9)[_0x829e('0x1f')](handleEntityNotFound(_0x50c4de,null))['then'](respondWithResult(_0x50c4de,null))[_0x829e('0x3d')](handleError(_0x50c4de,null));};exports[_0x829e('0x41')]=function(_0x55f2d5,_0x218fc3){return db[_0x829e('0x25')][_0x829e('0x41')](_0x55f2d5['body'],{})['then'](respondWithResult(_0x218fc3,0xc9))[_0x829e('0x3d')](handleError(_0x218fc3,null));};exports[_0x829e('0x1e')]=function(_0x38f8bf,_0x3f4655){if(_0x38f8bf[_0x829e('0x42')]['id']){delete _0x38f8bf[_0x829e('0x42')]['id'];}return db[_0x829e('0x25')][_0x829e('0x40')]({'where':{'id':_0x38f8bf[_0x829e('0x3f')]['id']}})[_0x829e('0x1f')](handleEntityNotFound(_0x3f4655,null))[_0x829e('0x1f')](saveUpdates(_0x38f8bf[_0x829e('0x42')],null))[_0x829e('0x1f')](respondWithResult(_0x3f4655,null))[_0x829e('0x3d')](handleError(_0x3f4655,null));};exports['destroy']=function(_0xbff9cc,_0x128f3a){return db[_0x829e('0x25')][_0x829e('0x40')]({'where':{'id':_0xbff9cc['params']['id']}})[_0x829e('0x1f')](handleEntityNotFound(_0x128f3a,null))['then'](removeEntity(_0x128f3a,null))['catch'](handleError(_0x128f3a,null));}; \ No newline at end of file +var _0xd1b5=['DeskField','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','findAll','rows','catch','params','include','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','update','then','destroy','error','stack','name','send','index','map'];(function(_0x586d28,_0x252dbc){var _0x1902e9=function(_0x1b3375){while(--_0x1b3375){_0x586d28['push'](_0x586d28['shift']());}};_0x1902e9(++_0x252dbc);}(_0xd1b5,0x67));var _0x5d1b=function(_0x141b8b,_0x2685fb){_0x141b8b=_0x141b8b-0x0;var _0x40eb31=_0xd1b5[_0x141b8b];return _0x40eb31;};'use strict';var emlformat=require(_0x5d1b('0x0'));var rimraf=require(_0x5d1b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d1b('0x2'));var rp=require('request-promise');var moment=require(_0x5d1b('0x3'));var BPromise=require(_0x5d1b('0x4'));var Mustache=require(_0x5d1b('0x5'));var util=require(_0x5d1b('0x6'));var path=require(_0x5d1b('0x7'));var sox=require(_0x5d1b('0x8'));var csv=require(_0x5d1b('0x9'));var ejs=require(_0x5d1b('0xa'));var fs=require('fs');var fs_extra=require(_0x5d1b('0xb'));var _=require('lodash');var squel=require(_0x5d1b('0xc'));var crypto=require(_0x5d1b('0xd'));var jsforce=require(_0x5d1b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5d1b('0x9'));var querystring=require(_0x5d1b('0xf'));var Papa=require(_0x5d1b('0x10'));var Redis=require(_0x5d1b('0x11'));var authService=require(_0x5d1b('0x12'));var qs=require(_0x5d1b('0x13'));var as=require(_0x5d1b('0x14'));var hardwareService=require(_0x5d1b('0x15'));var logger=require(_0x5d1b('0x16'))(_0x5d1b('0x17'));var utils=require('../../config/utils');var config=require(_0x5d1b('0x18'));var licenseUtil=require(_0x5d1b('0x19'));var db=require(_0x5d1b('0x1a'))['db'];function respondWithStatusCode(_0x9d47c5,_0x4c4f46){_0x4c4f46=_0x4c4f46||0xcc;return function(_0x29d22f){if(_0x29d22f){return _0x9d47c5[_0x5d1b('0x1b')](_0x4c4f46);}return _0x9d47c5[_0x5d1b('0x1c')](_0x4c4f46)[_0x5d1b('0x1d')]();};}function respondWithResult(_0x5c24d9,_0x16714a){_0x16714a=_0x16714a||0xc8;return function(_0x3f5a88){if(_0x3f5a88){return _0x5c24d9['status'](_0x16714a)['json'](_0x3f5a88);}};}function respondWithFilteredResult(_0x5306d1,_0x571867){return function(_0x40acb8){if(_0x40acb8){var _0x18429f=typeof _0x571867[_0x5d1b('0x1e')]==='undefined'&&typeof _0x571867[_0x5d1b('0x1f')]===_0x5d1b('0x20');var _0x4fa02d=_0x40acb8[_0x5d1b('0x21')];var _0x565d58=_0x18429f?0x0:_0x571867[_0x5d1b('0x1e')];var _0x4aef24=_0x18429f?_0x40acb8[_0x5d1b('0x21')]:_0x571867[_0x5d1b('0x1e')]+_0x571867[_0x5d1b('0x1f')];var _0x281ae6;if(_0x4aef24>=_0x4fa02d){_0x4aef24=_0x4fa02d;_0x281ae6=0xc8;}else{_0x281ae6=0xce;}_0x5306d1['status'](_0x281ae6);return _0x5306d1[_0x5d1b('0x22')]('Content-Range',_0x565d58+'-'+_0x4aef24+'/'+_0x4fa02d)[_0x5d1b('0x23')](_0x40acb8);}return null;};}function patchUpdates(_0x18592d){return function(_0x3ece29){try{jsonpatch[_0x5d1b('0x24')](_0x3ece29,_0x18592d,!![]);}catch(_0x493a77){return BPromise[_0x5d1b('0x25')](_0x493a77);}return _0x3ece29['save']();};}function saveUpdates(_0x1d46c8,_0xff220b){return function(_0x2e367){if(_0x2e367){return _0x2e367[_0x5d1b('0x26')](_0x1d46c8)[_0x5d1b('0x27')](function(_0x247357){return _0x247357;});}return null;};}function removeEntity(_0xd6ffd8,_0x2229be){return function(_0x4ef949){if(_0x4ef949){return _0x4ef949[_0x5d1b('0x28')]()[_0x5d1b('0x27')](function(){_0xd6ffd8[_0x5d1b('0x1c')](0xcc)[_0x5d1b('0x1d')]();});}};}function handleEntityNotFound(_0x17a7d9,_0x403344){return function(_0x414ca0){if(!_0x414ca0){_0x17a7d9['sendStatus'](0x194);}return _0x414ca0;};}function handleError(_0x2e61f7,_0x27760e){_0x27760e=_0x27760e||0x1f4;return function(_0x118542){logger[_0x5d1b('0x29')](_0x118542[_0x5d1b('0x2a')]);if(_0x118542[_0x5d1b('0x2b')]){delete _0x118542[_0x5d1b('0x2b')];}_0x2e61f7['status'](_0x27760e)[_0x5d1b('0x2c')](_0x118542);};}exports[_0x5d1b('0x2d')]=function(_0x112f3a,_0x1e1941){var _0x2fc252={},_0x350981={},_0xc0e955={'count':0x0,'rows':[]};var _0x50f804=_[_0x5d1b('0x2e')](db[_0x5d1b('0x2f')][_0x5d1b('0x30')],function(_0x4ab682){return{'name':_0x4ab682[_0x5d1b('0x31')],'type':_0x4ab682[_0x5d1b('0x32')]['key']};});_0x350981[_0x5d1b('0x33')]=_[_0x5d1b('0x2e')](_0x50f804,_0x5d1b('0x2b'));_0x350981['query']=_[_0x5d1b('0x34')](_0x112f3a[_0x5d1b('0x35')]);_0x350981['filters']=_[_0x5d1b('0x36')](_0x350981[_0x5d1b('0x33')],_0x350981['query']);_0x2fc252['attributes']=_['intersection'](_0x350981[_0x5d1b('0x33')],qs[_0x5d1b('0x37')](_0x112f3a[_0x5d1b('0x35')][_0x5d1b('0x37')]));_0x2fc252['attributes']=_0x2fc252[_0x5d1b('0x38')]['length']?_0x2fc252[_0x5d1b('0x38')]:_0x350981[_0x5d1b('0x33')];if(!_0x112f3a[_0x5d1b('0x35')]['hasOwnProperty'](_0x5d1b('0x39'))){_0x2fc252[_0x5d1b('0x1f')]=qs['limit'](_0x112f3a[_0x5d1b('0x35')][_0x5d1b('0x1f')]);_0x2fc252[_0x5d1b('0x1e')]=qs[_0x5d1b('0x1e')](_0x112f3a[_0x5d1b('0x35')][_0x5d1b('0x1e')]);}_0x2fc252[_0x5d1b('0x3a')]=qs[_0x5d1b('0x3b')](_0x112f3a[_0x5d1b('0x35')][_0x5d1b('0x3b')]);_0x2fc252[_0x5d1b('0x3c')]=qs['filters'](_[_0x5d1b('0x3d')](_0x112f3a['query'],_0x350981[_0x5d1b('0x3e')]),_0x50f804);if(_0x112f3a['query'][_0x5d1b('0x3f')]){_0x2fc252[_0x5d1b('0x3c')]=_[_0x5d1b('0x40')](_0x2fc252[_0x5d1b('0x3c')],{'$or':_[_0x5d1b('0x2e')](_0x50f804,function(_0x38f46b){if(_0x38f46b[_0x5d1b('0x32')]!==_0x5d1b('0x41')){var _0x285494={};_0x285494[_0x38f46b[_0x5d1b('0x2b')]]={'$like':'%'+_0x112f3a[_0x5d1b('0x35')]['filter']+'%'};return _0x285494;}})});}_0x2fc252=_['merge']({},_0x2fc252,_0x112f3a[_0x5d1b('0x42')]);var _0x51c88d={'where':_0x2fc252[_0x5d1b('0x3c')]};return db[_0x5d1b('0x2f')]['count'](_0x51c88d)[_0x5d1b('0x27')](function(_0x25e546){_0xc0e955['count']=_0x25e546;if(_0x112f3a[_0x5d1b('0x35')]['includeAll']){_0x2fc252['include']=[{'all':!![]}];}return db['DeskField'][_0x5d1b('0x43')](_0x2fc252);})['then'](function(_0x441a10){_0xc0e955[_0x5d1b('0x44')]=_0x441a10;return _0xc0e955;})[_0x5d1b('0x27')](respondWithFilteredResult(_0x1e1941,_0x2fc252))[_0x5d1b('0x45')](handleError(_0x1e1941,null));};exports['show']=function(_0xa8ff40,_0x44c2e4){var _0xad3a43={'raw':!![],'where':{'id':_0xa8ff40[_0x5d1b('0x46')]['id']}},_0x5ec079={};_0x5ec079[_0x5d1b('0x33')]=_[_0x5d1b('0x34')](db[_0x5d1b('0x2f')][_0x5d1b('0x30')]);_0x5ec079[_0x5d1b('0x35')]=_['keys'](_0xa8ff40[_0x5d1b('0x35')]);_0x5ec079['filters']=_[_0x5d1b('0x36')](_0x5ec079[_0x5d1b('0x33')],_0x5ec079[_0x5d1b('0x35')]);_0xad3a43[_0x5d1b('0x38')]=_[_0x5d1b('0x36')](_0x5ec079[_0x5d1b('0x33')],qs['fields'](_0xa8ff40['query'][_0x5d1b('0x37')]));_0xad3a43[_0x5d1b('0x38')]=_0xad3a43[_0x5d1b('0x38')]['length']?_0xad3a43[_0x5d1b('0x38')]:_0x5ec079[_0x5d1b('0x33')];if(_0xa8ff40[_0x5d1b('0x35')]['includeAll']){_0xad3a43[_0x5d1b('0x47')]=[{'all':!![]}];}_0xad3a43=_['merge']({},_0xad3a43,_0xa8ff40['options']);return db[_0x5d1b('0x2f')][_0x5d1b('0x48')](_0xad3a43)[_0x5d1b('0x27')](handleEntityNotFound(_0x44c2e4,null))['then'](respondWithResult(_0x44c2e4,null))['catch'](handleError(_0x44c2e4,null));};exports[_0x5d1b('0x49')]=function(_0x498b41,_0x1a34d7){return db[_0x5d1b('0x2f')][_0x5d1b('0x49')](_0x498b41['body'],{})[_0x5d1b('0x27')](respondWithResult(_0x1a34d7,0xc9))[_0x5d1b('0x45')](handleError(_0x1a34d7,null));};exports['update']=function(_0x329182,_0x51fa65){if(_0x329182['body']['id']){delete _0x329182[_0x5d1b('0x4a')]['id'];}return db[_0x5d1b('0x2f')][_0x5d1b('0x48')]({'where':{'id':_0x329182['params']['id']}})[_0x5d1b('0x27')](handleEntityNotFound(_0x51fa65,null))[_0x5d1b('0x27')](saveUpdates(_0x329182['body'],null))[_0x5d1b('0x27')](respondWithResult(_0x51fa65,null))[_0x5d1b('0x45')](handleError(_0x51fa65,null));};exports['destroy']=function(_0x145ad6,_0x4b11ab){return db['DeskField'][_0x5d1b('0x48')]({'where':{'id':_0x145ad6[_0x5d1b('0x46')]['id']}})[_0x5d1b('0x27')](handleEntityNotFound(_0x4b11ab,null))['then'](removeEntity(_0x4b11ab,null))['catch'](handleError(_0x4b11ab,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 7a46b86..7711518 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 _0xfbde=['path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','api','moment','request-promise'];(function(_0x310428,_0xec9879){var _0x56c99d=function(_0x5f070a){while(--_0x5f070a){_0x310428['push'](_0x310428['shift']());}};_0x56c99d(++_0xec9879);}(_0xfbde,0x172));var _0xefbd=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xfbde[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0xefbd('0x0'));var util=require(_0xefbd('0x1'));var logger=require('../../config/logger')(_0xefbd('0x2'));var moment=require(_0xefbd('0x3'));var BPromise=require('bluebird');var rp=require(_0xefbd('0x4'));var fs=require('fs');var path=require(_0xefbd('0x5'));var rimraf=require(_0xefbd('0x6'));var config=require(_0xefbd('0x7'));var attributes=require(_0xefbd('0x8'));module['exports']=function(_0x43742f,_0x70a370){return _0x43742f[_0xefbd('0x9')](_0xefbd('0xa'),attributes,{'tableName':_0xefbd('0xb'),'paranoid':![],'indexes':[{'name':_0xefbd('0xc'),'fields':[_0xefbd('0xd'),_0xefbd('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x928e=['rimraf','exports','DeskField','int_desk_fields','idField','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x48cec2,_0x474d65){var _0x3d5c22=function(_0x4e53e3){while(--_0x4e53e3){_0x48cec2['push'](_0x48cec2['shift']());}};_0x3d5c22(++_0x474d65);}(_0x928e,0x139));var _0xe928=function(_0x4220fc,_0x3143e9){_0x4220fc=_0x4220fc-0x0;var _0x2f5f05=_0x928e[_0x4220fc];return _0x2f5f05;};'use strict';var _=require(_0xe928('0x0'));var util=require(_0xe928('0x1'));var logger=require(_0xe928('0x2'))(_0xe928('0x3'));var moment=require('moment');var BPromise=require(_0xe928('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe928('0x5'));var rimraf=require(_0xe928('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0xe928('0x7')]=function(_0x5e85aa,_0x167312){return _0x5e85aa['define'](_0xe928('0x8'),attributes,{'tableName':_0xe928('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xe928('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index bc72921..f6c0d38 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 _0xb9e7=['then','info','DeskField,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x24c489,_0x448537){var _0x3a711d=function(_0x4ec0ed){while(--_0x4ec0ed){_0x24c489['push'](_0x24c489['shift']());}};_0x3a711d(++_0x448537);}(_0xb9e7,0x135));var _0x7b9e=function(_0x24cc72,_0x4dc73a){_0x24cc72=_0x24cc72-0x0;var _0xd49f1e=_0xb9e7[_0x24cc72];return _0xd49f1e;};'use strict';var _=require(_0x7b9e('0x0'));var util=require(_0x7b9e('0x1'));var moment=require(_0x7b9e('0x2'));var BPromise=require(_0x7b9e('0x3'));var rs=require(_0x7b9e('0x4'));var fs=require('fs');var Redis=require(_0x7b9e('0x5'));var db=require(_0x7b9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b9e('0x7'))('rpc');var config=require(_0x7b9e('0x8'));var jayson=require(_0x7b9e('0x9'));var client=jayson[_0x7b9e('0xa')][_0x7b9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x986f1,_0x4ce734,_0x1c5925){return new BPromise(function(_0xcd94e1,_0x248bbd){return client[_0x7b9e('0xc')](_0x986f1,_0x1c5925)[_0x7b9e('0xd')](function(_0x387f8f){logger[_0x7b9e('0xe')](_0x7b9e('0xf'),_0x4ce734,'request\x20sent');logger[_0x7b9e('0x10')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4ce734,'request\x20sent',JSON['stringify'](_0x387f8f));if(_0x387f8f[_0x7b9e('0x11')]){if(_0x387f8f[_0x7b9e('0x11')][_0x7b9e('0x12')]===0x1f4){logger[_0x7b9e('0x11')]('DeskField,\x20%s,\x20%s',_0x4ce734,_0x387f8f[_0x7b9e('0x11')][_0x7b9e('0x13')]);return _0x248bbd(_0x387f8f[_0x7b9e('0x11')][_0x7b9e('0x13')]);}logger[_0x7b9e('0x11')]('DeskField,\x20%s,\x20%s',_0x4ce734,_0x387f8f['error'][_0x7b9e('0x13')]);return _0xcd94e1(_0x387f8f[_0x7b9e('0x11')][_0x7b9e('0x13')]);}else{logger[_0x7b9e('0xe')](_0x7b9e('0xf'),_0x4ce734,_0x7b9e('0x14'));_0xcd94e1(_0x387f8f[_0x7b9e('0x15')][_0x7b9e('0x13')]);}})[_0x7b9e('0x16')](function(_0x49a734){logger['error'](_0x7b9e('0xf'),_0x4ce734,_0x49a734);_0x248bbd(_0x49a734);});});} \ No newline at end of file +var _0x002b=['code','message','DeskField,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x002b,0x191));var _0xb002=function(_0x23fd09,_0x51c74c){_0x23fd09=_0x23fd09-0x0;var _0x5d8176=_0x002b[_0x23fd09];return _0x5d8176;};'use strict';var _=require(_0xb002('0x0'));var util=require(_0xb002('0x1'));var moment=require(_0xb002('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb002('0x3'));var db=require(_0xb002('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb002('0x5'))(_0xb002('0x6'));var config=require(_0xb002('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb002('0x8')][_0xb002('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c83cd,_0x48facf,_0x10a442){return new BPromise(function(_0x4e6c19,_0x42a2f3){return client['request'](_0x2c83cd,_0x10a442)[_0xb002('0xa')](function(_0x440285){logger[_0xb002('0xb')]('DeskField,\x20%s,\x20%s',_0x48facf,_0xb002('0xc'));logger[_0xb002('0xd')](_0xb002('0xe'),_0x48facf,_0xb002('0xc'),JSON[_0xb002('0xf')](_0x440285));if(_0x440285[_0xb002('0x10')]){if(_0x440285[_0xb002('0x10')][_0xb002('0x11')]===0x1f4){logger[_0xb002('0x10')]('DeskField,\x20%s,\x20%s',_0x48facf,_0x440285[_0xb002('0x10')][_0xb002('0x12')]);return _0x42a2f3(_0x440285['error'][_0xb002('0x12')]);}logger[_0xb002('0x10')](_0xb002('0x13'),_0x48facf,_0x440285[_0xb002('0x10')]['message']);return _0x4e6c19(_0x440285['error'][_0xb002('0x12')]);}else{logger[_0xb002('0xb')](_0xb002('0x13'),_0x48facf,'request\x20sent');_0x4e6c19(_0x440285[_0xb002('0x14')]['message']);}})[_0xb002('0x15')](function(_0x4624b5){logger[_0xb002('0x10')](_0xb002('0x13'),_0x48facf,_0x4624b5);_0x42a2f3(_0x4624b5);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 9613896..dd28380 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 _0x4471=['show','getConfigurations','getFields','create','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','isAuthenticated'];(function(_0x28f097,_0x169f73){var _0x3a21b8=function(_0x5b3273){while(--_0x5b3273){_0x28f097['push'](_0x28f097['shift']());}};_0x3a21b8(++_0x169f73);}(_0x4471,0x1d4));var _0x1447=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4471[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x1447('0x0'));var path=require(_0x1447('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1447('0x2')]();var fs_extra=require(_0x1447('0x3'));var auth=require(_0x1447('0x4'));var interaction=require(_0x1447('0x5'));var config=require(_0x1447('0x6'));var controller=require(_0x1447('0x7'));router[_0x1447('0x8')]('/',auth['isAuthenticated'](),controller[_0x1447('0x9')]);router[_0x1447('0x8')](_0x1447('0xa'),auth[_0x1447('0xb')](),controller[_0x1447('0xc')]);router['get']('/:id/configurations',auth[_0x1447('0xb')](),controller[_0x1447('0xd')]);router['get']('/:id/fields',auth[_0x1447('0xb')](),controller[_0x1447('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1447('0xf')]);router[_0x1447('0x10')](_0x1447('0x11'),auth[_0x1447('0xb')](),controller[_0x1447('0x12')]);router[_0x1447('0x13')](_0x1447('0xa'),auth[_0x1447('0xb')](),controller[_0x1447('0x14')]);router[_0x1447('0x15')](_0x1447('0xa'),auth[_0x1447('0xb')](),controller[_0x1447('0x16')]);module[_0x1447('0x17')]=router; \ No newline at end of file +var _0xc54b=['getFields','create','post','addConfiguration','/:id','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x3ed9a8,_0x37eb61){var _0x57a1db=function(_0x43f330){while(--_0x43f330){_0x3ed9a8['push'](_0x3ed9a8['shift']());}};_0x57a1db(++_0x37eb61);}(_0xc54b,0x147));var _0xbc54=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0xc54b[_0x439d59];return _0x3670c7;};'use strict';var multer=require(_0xbc54('0x0'));var util=require(_0xbc54('0x1'));var path=require(_0xbc54('0x2'));var timeout=require(_0xbc54('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbc54('0x4'));var auth=require(_0xbc54('0x5'));var interaction=require(_0xbc54('0x6'));var config=require('../../config/environment');var controller=require(_0xbc54('0x7'));router[_0xbc54('0x8')]('/',auth[_0xbc54('0x9')](),controller['index']);router[_0xbc54('0x8')]('/:id',auth[_0xbc54('0x9')](),controller['show']);router['get'](_0xbc54('0xa'),auth[_0xbc54('0x9')](),controller[_0xbc54('0xb')]);router[_0xbc54('0x8')](_0xbc54('0xc'),auth[_0xbc54('0x9')](),controller[_0xbc54('0xd')]);router['post']('/',auth[_0xbc54('0x9')](),controller[_0xbc54('0xe')]);router[_0xbc54('0xf')](_0xbc54('0xa'),auth[_0xbc54('0x9')](),controller[_0xbc54('0x10')]);router['put'](_0xbc54('0x11'),auth[_0xbc54('0x9')](),controller['update']);router[_0xbc54('0x12')](_0xbc54('0x11'),auth['isAuthenticated'](),controller[_0xbc54('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index c561377..4567c43 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 _0xe260=['BOOLEAN','sequelize','STRING'];(function(_0x1603ac,_0x3b5bce){var _0x482c04=function(_0x111c37){while(--_0x111c37){_0x1603ac['push'](_0x1603ac['shift']());}};_0x482c04(++_0x3b5bce);}(_0xe260,0x94));var _0x0e26=function(_0xe80f2a,_0x1d256a){_0xe80f2a=_0xe80f2a-0x0;var _0x5a9664=_0xe260[_0xe80f2a];return _0x5a9664;};'use strict';var Sequelize=require(_0x0e26('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e26('0x1')]},'username':{'type':Sequelize[_0x0e26('0x1')]},'password':{'type':Sequelize[_0x0e26('0x1')]},'remoteUri':{'type':Sequelize[_0x0e26('0x1')]},'tenantId':{'type':Sequelize[_0x0e26('0x1')]},'clientId':{'type':Sequelize[_0x0e26('0x1')]},'clientSecret':{'type':Sequelize[_0x0e26('0x1')]},'serverUrl':{'type':Sequelize[_0x0e26('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0e26('0x1')]},'modernAuthentication':{'type':Sequelize[_0x0e26('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7217=['sequelize','STRING','BOOLEAN'];(function(_0x4cfade,_0x5b1ccc){var _0xa7aafd=function(_0x5cf9e4){while(--_0x5cf9e4){_0x4cfade['push'](_0x4cfade['shift']());}};_0xa7aafd(++_0x5b1ccc);}(_0x7217,0x19e));var _0x7721=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7217[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')]},'username':{'type':Sequelize[_0x7721('0x1')]},'password':{'type':Sequelize[_0x7721('0x1')]},'remoteUri':{'type':Sequelize[_0x7721('0x1')]},'tenantId':{'type':Sequelize[_0x7721('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'modernAuthentication':{'type':Sequelize[_0x7721('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index e1cab44..3626e09 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 _0x557d=['4.0','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../mysqldb','../../components/integrations/configuration','status','offset','limit','count','set','Content-Range','json','update','then','destroy','end','sendStatus','error','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','key','map','keys','filters','intersection','query','attributes','fields','length','model','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','Dynamics365Configuration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','lastIndexOf','format','getFields','ticketType','incident','PhoneCall','title','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','overriddencreatedon','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','tenantId','clientSecret','modernAuthentication','CloudProvider','data5','data7','remoteUri','/oauth2/token','clientId','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','EntityDefinitions(','Attributes','remove','forEach','@odata.type','substring','MetadataId','all','isNil','BooleanAttributeMetadata','push','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)'];(function(_0x4fd994,_0x199a8a){var _0x5034ec=function(_0x43e6e0){while(--_0x43e6e0){_0x4fd994['push'](_0x4fd994['shift']());}};_0x5034ec(++_0x199a8a);}(_0x557d,0xcb));var _0xd557=function(_0x1ca28e,_0x85fc2e){_0x1ca28e=_0x1ca28e-0x0;var _0x568605=_0x557d[_0x1ca28e];return _0x568605;};'use strict';var rp=require(_0xd557('0x0'));var util=require(_0xd557('0x1'));var _=require(_0xd557('0x2'));var qs=require(_0xd557('0x3'));var logger=require('../../config/logger')('api');var db=require(_0xd557('0x4'))['db'];var integrations=require(_0xd557('0x5'));function respondWithResult(_0x49f9e8,_0x5f19d7){_0x5f19d7=_0x5f19d7||0xc8;return function(_0x479940){if(_0x479940){return _0x49f9e8[_0xd557('0x6')](_0x5f19d7)['json'](_0x479940);}};}function respondWithFilteredResult(_0x477de0,_0x2d3ccd){return function(_0x21173d){if(_0x21173d){var _0x559202=typeof _0x2d3ccd[_0xd557('0x7')]==='undefined'&&typeof _0x2d3ccd[_0xd557('0x8')]==='undefined';var _0x4c7cb8=_0x21173d[_0xd557('0x9')];var _0x380e15=_0x559202?0x0:_0x2d3ccd[_0xd557('0x7')];var _0x4626eb=_0x559202?_0x21173d[_0xd557('0x9')]:_0x2d3ccd[_0xd557('0x7')]+_0x2d3ccd['limit'];var _0x11e6a5;if(_0x4626eb>=_0x4c7cb8){_0x4626eb=_0x4c7cb8;_0x11e6a5=0xc8;}else{_0x11e6a5=0xce;}_0x477de0[_0xd557('0x6')](_0x11e6a5);return _0x477de0[_0xd557('0xa')](_0xd557('0xb'),_0x380e15+'-'+_0x4626eb+'/'+_0x4c7cb8)[_0xd557('0xc')](_0x21173d);}return null;};}function saveUpdates(_0x2ee82a){return function(_0x1cf73c){if(_0x1cf73c){return _0x1cf73c[_0xd557('0xd')](_0x2ee82a)[_0xd557('0xe')](function(_0x413e84){return _0x413e84;});}return null;};}function removeEntity(_0x48c933){return function(_0x3704db){if(_0x3704db){return _0x3704db[_0xd557('0xf')]()[_0xd557('0xe')](function(){_0x48c933[_0xd557('0x6')](0xcc)[_0xd557('0x10')]();});}};}function handleEntityNotFound(_0x438be0){return function(_0x208348){if(!_0x208348){_0x438be0[_0xd557('0x11')](0x194);}return _0x208348;};}function handleError(_0x1277b7,_0x28d212){_0x28d212=_0x28d212||0x1f4;return function(_0x38e628){logger[_0xd557('0x12')](_0x38e628[_0xd557('0x13')]);if(_0x38e628['name']){delete _0x38e628[_0xd557('0x14')];}_0x1277b7[_0xd557('0x6')](_0x28d212)[_0xd557('0x15')](_0x38e628);};}exports[_0xd557('0x16')]=function(_0x16d941,_0x4c7978){var _0xf2ff6a={},_0x4ecf3b={},_0x789481={'count':0x0,'rows':[]};var _0x5aa7d5=_['map'](db[_0xd557('0x17')][_0xd557('0x18')],function(_0x2335f3){return{'name':_0x2335f3[_0xd557('0x19')],'type':_0x2335f3['type'][_0xd557('0x1a')]};});_0x4ecf3b['model']=_[_0xd557('0x1b')](_0x5aa7d5,'name');_0x4ecf3b['query']=_[_0xd557('0x1c')](_0x16d941['query']);_0x4ecf3b[_0xd557('0x1d')]=_[_0xd557('0x1e')](_0x4ecf3b['model'],_0x4ecf3b[_0xd557('0x1f')]);_0xf2ff6a[_0xd557('0x20')]=_['intersection'](_0x4ecf3b['model'],qs[_0xd557('0x21')](_0x16d941[_0xd557('0x1f')]['fields']));_0xf2ff6a[_0xd557('0x20')]=_0xf2ff6a['attributes'][_0xd557('0x22')]?_0xf2ff6a[_0xd557('0x20')]:_0x4ecf3b[_0xd557('0x23')];if(!_0x16d941[_0xd557('0x1f')]['hasOwnProperty'](_0xd557('0x24'))){_0xf2ff6a['limit']=qs['limit'](_0x16d941[_0xd557('0x1f')][_0xd557('0x8')]);_0xf2ff6a[_0xd557('0x7')]=qs[_0xd557('0x7')](_0x16d941[_0xd557('0x1f')][_0xd557('0x7')]);}_0xf2ff6a[_0xd557('0x25')]=qs[_0xd557('0x26')](_0x16d941['query']['sort']);_0xf2ff6a['where']=qs[_0xd557('0x1d')](_['pick'](_0x16d941[_0xd557('0x1f')],_0x4ecf3b['filters']),_0x5aa7d5);if(_0x16d941[_0xd557('0x1f')][_0xd557('0x27')]){_0xf2ff6a[_0xd557('0x28')]=_[_0xd557('0x29')](_0xf2ff6a[_0xd557('0x28')],{'$or':_['map'](_0x5aa7d5,function(_0x5e490e){if(_0x5e490e[_0xd557('0x2a')]!==_0xd557('0x2b')){var _0x52644a={};_0x52644a[_0x5e490e[_0xd557('0x14')]]={'$like':'%'+_0x16d941[_0xd557('0x1f')][_0xd557('0x27')]+'%'};return _0x52644a;}})});}_0xf2ff6a=_[_0xd557('0x29')]({},_0xf2ff6a,_0x16d941[_0xd557('0x2c')]);var _0x33dcb1={'where':_0xf2ff6a[_0xd557('0x28')]};return db[_0xd557('0x17')]['count'](_0x33dcb1)['then'](function(_0xb2b6b2){_0x789481[_0xd557('0x9')]=_0xb2b6b2;if(_0x16d941['query'][_0xd557('0x2d')]){_0xf2ff6a[_0xd557('0x2e')]=[{'all':!![]}];}return db[_0xd557('0x17')][_0xd557('0x2f')](_0xf2ff6a);})[_0xd557('0xe')](function(_0x3507a6){_0x789481[_0xd557('0x30')]=_0x3507a6;return _0x789481;})[_0xd557('0xe')](respondWithFilteredResult(_0x4c7978,_0xf2ff6a))[_0xd557('0x31')](handleError(_0x4c7978,null));};exports[_0xd557('0x32')]=function(_0x25615c,_0x4d5dfd){var _0x1233ba={'raw':![],'where':{'id':_0x25615c[_0xd557('0x33')]['id']}},_0x3ce461={};_0x3ce461[_0xd557('0x23')]=_['keys'](db[_0xd557('0x17')][_0xd557('0x18')]);_0x3ce461[_0xd557('0x1f')]=_[_0xd557('0x1c')](_0x25615c[_0xd557('0x1f')]);_0x3ce461[_0xd557('0x1d')]=_[_0xd557('0x1e')](_0x3ce461[_0xd557('0x23')],_0x3ce461[_0xd557('0x1f')]);_0x1233ba[_0xd557('0x20')]=_['intersection'](_0x3ce461[_0xd557('0x23')],qs[_0xd557('0x21')](_0x25615c[_0xd557('0x1f')][_0xd557('0x21')]));_0x1233ba[_0xd557('0x20')]=_0x1233ba['attributes']['length']?_0x1233ba[_0xd557('0x20')]:_0x3ce461[_0xd557('0x23')];if(_0x25615c['query']['includeAll']){_0x1233ba[_0xd557('0x2e')]=[{'all':!![]}];}_0x1233ba=_[_0xd557('0x29')]({},_0x1233ba,_0x25615c[_0xd557('0x2c')]);return db[_0xd557('0x17')]['find'](_0x1233ba)[_0xd557('0xe')](handleEntityNotFound(_0x4d5dfd,null))[_0xd557('0xe')](respondWithResult(_0x4d5dfd,null))[_0xd557('0x31')](handleError(_0x4d5dfd,null));};exports[_0xd557('0x34')]=function(_0x4fcf12,_0x5bf23a){return db[_0xd557('0x17')][_0xd557('0x34')](_0x4fcf12['body'],{})[_0xd557('0xe')](respondWithResult(_0x5bf23a,0xc9))[_0xd557('0x31')](handleError(_0x5bf23a,null));};exports[_0xd557('0xd')]=function(_0x10d26b,_0x4c28a8){if(_0x10d26b['body']['id']){delete _0x10d26b['body']['id'];}return db[_0xd557('0x17')]['find']({'where':{'id':_0x10d26b['params']['id']}})[_0xd557('0xe')](handleEntityNotFound(_0x4c28a8,null))['then'](saveUpdates(_0x10d26b[_0xd557('0x35')],null))[_0xd557('0xe')](respondWithResult(_0x4c28a8,null))[_0xd557('0x31')](handleError(_0x4c28a8,null));};exports[_0xd557('0xf')]=function(_0x4b511a,_0x1b3096){return db[_0xd557('0x17')][_0xd557('0x36')]({'where':{'id':_0x4b511a[_0xd557('0x33')]['id']}})['then'](handleEntityNotFound(_0x1b3096,null))['then'](removeEntity(_0x1b3096,null))[_0xd557('0x31')](handleError(_0x1b3096,null));};exports[_0xd557('0x37')]=function(_0x4061c2,_0x3b42ae){var _0x674a50={};var _0x5de964={};var _0xd995b2;var _0xf97915;return db[_0xd557('0x17')][_0xd557('0x38')]({'where':{'id':_0x4061c2['params']['id']}})[_0xd557('0xe')](handleEntityNotFound(_0x3b42ae,null))['then'](function(_0x21bbe0){if(_0x21bbe0){_0xd995b2=_0x21bbe0;_0x5de964[_0xd557('0x23')]=_['keys'](db[_0xd557('0x39')]['rawAttributes']);_0x5de964[_0xd557('0x1f')]=_[_0xd557('0x1c')](_0x4061c2[_0xd557('0x1f')]);_0x5de964[_0xd557('0x1d')]=_[_0xd557('0x1e')](_0x5de964[_0xd557('0x23')],_0x5de964['query']);_0x674a50[_0xd557('0x20')]=_[_0xd557('0x1e')](_0x5de964[_0xd557('0x23')],qs[_0xd557('0x21')](_0x4061c2[_0xd557('0x1f')][_0xd557('0x21')]));_0x674a50['attributes']=_0x674a50['attributes'][_0xd557('0x22')]?_0x674a50[_0xd557('0x20')]:_0x5de964[_0xd557('0x23')];_0x674a50[_0xd557('0x25')]=qs['sort'](_0x4061c2[_0xd557('0x1f')]['sort']);_0x674a50[_0xd557('0x28')]=qs[_0xd557('0x1d')](_[_0xd557('0x3a')](_0x4061c2[_0xd557('0x1f')],_0x5de964[_0xd557('0x1d')]));if(_0x4061c2[_0xd557('0x1f')][_0xd557('0x27')]){_0x674a50[_0xd557('0x28')]=_[_0xd557('0x29')](_0x674a50[_0xd557('0x28')],{'$or':_[_0xd557('0x1b')](_0x674a50['attributes'],function(_0x3cba6f){var _0x3b20fd={};_0x3b20fd[_0x3cba6f]={'$like':'%'+_0x4061c2['query']['filter']+'%'};return _0x3b20fd;})});}_0x674a50=_[_0xd557('0x29')]({},_0x674a50,_0x4061c2[_0xd557('0x2c')]);return _0xd995b2[_0xd557('0x37')](_0x674a50);}})[_0xd557('0xe')](function(_0x533ba1){if(_0x533ba1){_0xf97915=_0x533ba1[_0xd557('0x22')];if(!_0x4061c2[_0xd557('0x1f')]['hasOwnProperty'](_0xd557('0x24'))){_0x674a50[_0xd557('0x8')]=qs[_0xd557('0x8')](_0x4061c2[_0xd557('0x1f')][_0xd557('0x8')]);_0x674a50['offset']=qs[_0xd557('0x7')](_0x4061c2['query']['offset']);}return _0xd995b2['getConfigurations'](_0x674a50);}})[_0xd557('0xe')](function(_0x56397f){if(_0x56397f){return _0x56397f?{'count':_0xf97915,'rows':_0x56397f}:null;}})[_0xd557('0xe')](respondWithResult(_0x3b42ae,null))[_0xd557('0x31')](handleError(_0x3b42ae,null));};exports[_0xd557('0x3b')]=function(_0x2cd8d6,_0x189e6f){if(_0x2cd8d6[_0xd557('0x35')]['id']){delete _0x2cd8d6['body']['id'];}return db['Dynamics365Account'][_0xd557('0x38')]({'where':{'id':_0x2cd8d6[_0xd557('0x33')]['id']}})[_0xd557('0xe')](handleEntityNotFound(_0x189e6f,null))['then'](function(_0x3f7533){if(_0x3f7533){_0x2cd8d6[_0xd557('0x35')][_0xd557('0x3c')]=_0x3f7533['id'];_0x2cd8d6[_0xd557('0x35')][_0xd557('0x3d')]=integrations[_0xd557('0x3e')](_0x2cd8d6[_0xd557('0x35')][_0xd557('0x3f')],_0x2cd8d6['body'][_0xd557('0x2a')]);_0x2cd8d6['body'][_0xd557('0x40')]=integrations[_0xd557('0x41')](_0x2cd8d6[_0xd557('0x35')][_0xd557('0x3f')],_0x2cd8d6['body'][_0xd557('0x2a')]);return db[_0xd557('0x39')][_0xd557('0x34')](_0x2cd8d6['body'],{'include':[{'model':db[_0xd557('0x42')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0xd557('0x40')}]});}return null;})['then'](respondWithResult(_0x189e6f,null))[_0xd557('0x31')](handleError(_0x189e6f,null));};function sanitizeRemoteUri(_0x5bc33c){var _0x824afd=_0x5bc33c[_0xd557('0x43')](-0x1);if(_0x824afd==='/')return _0x5bc33c['substring'](0x0,_0x5bc33c[_0xd557('0x44')](_0x824afd));return _0x5bc33c;}function getWebApiUrl(_0x2617fb){return util[_0xd557('0x45')]('%s/api/data/v9.0/',_0x2617fb);}exports[_0xd557('0x46')]=function(_0x5f2916,_0x1c4062){var _0x1ef38f=_0x5f2916[_0xd557('0x1f')][_0xd557('0x47')];var _0x42b7ec=_0x1ef38f===_0xd557('0x48')?'Incident':_0xd557('0x49');var _0xd1521='';var _0x107a48='';var _0x45afa1='';var _0x19dfe6='';var _0x58e05b='';var _0xfbaae6='';var _0x4b3253='';var _0x57772e='';var _0x4c8e06=[_0xd557('0x4a'),'description',_0xd557('0x4b'),_0xd557('0x4c'),_0xd557('0x4d'),'subject',_0xd557('0x4e'),_0xd557('0x4f'),_0xd557('0x50'),_0xd557('0x51')];var _0x1ea207=[_0xd557('0x52'),_0xd557('0x53'),_0xd557('0x54'),_0xd557('0x55'),_0xd557('0x56'),_0xd557('0x57'),'contractdetailidname',_0xd557('0x58'),_0xd557('0x59'),_0xd557('0x5a'),_0xd557('0x5b'),_0xd557('0x5c'),_0xd557('0x5d'),_0xd557('0x5e'),_0xd557('0x5f'),_0xd557('0x60'),_0xd557('0x61'),_0xd557('0x62'),_0xd557('0x63'),_0xd557('0x64'),_0xd557('0x65'),_0xd557('0x66'),_0xd557('0x67'),_0xd557('0x68'),_0xd557('0x69'),_0xd557('0x6a'),_0xd557('0x6b'),'influencescore',_0xd557('0x6c'),_0xd557('0x6d'),_0xd557('0x6e'),_0xd557('0x6f'),'modifiedbyexternalpartyyominame',_0xd557('0x70'),_0xd557('0x71'),_0xd557('0x72'),'modifiedonbehalfbyname',_0xd557('0x73'),_0xd557('0x74'),_0xd557('0x75'),'numberofchildincidents','onholdtime',_0xd557('0x76'),'owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname',_0xd557('0x77'),_0xd557('0x78'),_0xd557('0x79'),_0xd557('0x7a'),'resolveby',_0xd557('0x7b'),'responseby',_0xd557('0x7c'),_0xd557('0x7d'),'sentimentvalue',_0xd557('0x7e'),_0xd557('0x7f'),_0xd557('0x80'),_0xd557('0x81'),'statuscode',_0xd557('0x82'),_0xd557('0x83'),_0xd557('0x84'),_0xd557('0x85'),_0xd557('0x86'),_0xd557('0x87'),_0xd557('0x88')];var _0x64de7d=_0x4c8e06[_0xd557('0x89')](_0x1ea207);return db['Dynamics365Account']['findOne']({'where':{'id':_0x5f2916[_0xd557('0x33')]['id']},'attributes':['id','username',_0xd557('0x8a'),'remoteUri',_0xd557('0x8b'),'clientId',_0xd557('0x8c'),_0xd557('0x8d')],'include':[{'model':db[_0xd557('0x8e')],'as':'CloudProvider','attributes':['id',_0xd557('0x8f'),_0xd557('0x90')]}]})[_0xd557('0xe')](handleEntityNotFound(_0x1c4062,null))[_0xd557('0xe')](function(_0x3437e2){if(_0x3437e2){if(_0x3437e2[_0xd557('0x8d')]){_0x3437e2['access_token']=_0x3437e2['CloudProvider'][_0xd557('0x8f')];_0x57772e=sanitizeRemoteUri(_0x3437e2[_0xd557('0x8e')][_0xd557('0x90')]);_0x4b3253=getWebApiUrl(_0x57772e);return _0x3437e2;}_0x57772e=sanitizeRemoteUri(_0x3437e2[_0xd557('0x91')]);_0x4b3253=getWebApiUrl(_0x57772e);var _0x3cd61f={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x3437e2[_0xd557('0x8b')]+_0xd557('0x92'),'form':{'client_id':_0x3437e2[_0xd557('0x93')],'resource':_0x57772e,'username':_0x3437e2[_0xd557('0x94')],'password':_0x3437e2[_0xd557('0x8a')],'grant_type':_0xd557('0x8a'),'client_secret':_0x3437e2[_0xd557('0x8c')]},'json':!![]};return rp(_0x3cd61f);}})[_0xd557('0xe')](function(_0x4a5812){_0xfbaae6=_0x4a5812[_0xd557('0x95')];var _0x43a9da={'method':_0xd557('0x96'),'uri':encodeURI(_0x4b3253+_0xd557('0x97')+_0x42b7ec+'\x27'),'headers':{'Authorization':_0xd557('0x98')+_0xfbaae6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x43a9da);})[_0xd557('0xe')](function(_0x50efd8){var _0x210d5b=_0x50efd8[_0xd557('0x99')][0x0];var _0x9f8602=_0x210d5b['MetadataId'];var _0x35db48={'method':_0xd557('0x96'),'uri':_0x4b3253+_0xd557('0x9a')+_0x9f8602+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xd557('0x98')+_0xfbaae6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x35db48);})[_0xd557('0xe')](function(_0x3c6d9d){_0xd1521=_0x3c6d9d;_0x107a48=_0xd1521[_0xd557('0x9b')];_0x107a48=_[_0xd557('0x9c')](_0x107a48,function(_0x3d43b3){return!_0x64de7d['includes'](_0x3d43b3['LogicalName']);});var _0x219414=[];var _0x5bafc0=[];_0x107a48[_0xd557('0x9d')](function(_0x30776f){if(_0x30776f[_0xd557('0x9e')]){var _0x2d595c=_0x30776f[_0xd557('0x9e')][_0xd557('0x9f')](_0x30776f[_0xd557('0x9e')][_0xd557('0x44')]('.')+0x1);if(_0x2d595c==='PicklistAttributeMetadata'){_0x219414['push'](getSelectList(_0x4b3253,_0x1ef38f,_0x5bafc0,_0xd1521[_0xd557('0xa0')],_0x30776f[_0xd557('0xa0')],_0xfbaae6));}}});return Promise[_0xd557('0xa1')](_0x219414);})[_0xd557('0xe')](function(_0x3e4cc6){_0x45afa1=_0x3e4cc6[0x0];var _0x235f67=[];var _0x5ef37c=[];_0x107a48[_0xd557('0x9d')](function(_0x529297){if(!_[_0xd557('0xa2')](_0x529297['@odata.type'])){var _0x12899c=_0x529297[_0xd557('0x9e')][_0xd557('0x9f')](_0x529297['@odata.type'][_0xd557('0x44')]('.')+0x1);if(_0x12899c===_0xd557('0xa3')){_0x235f67[_0xd557('0xa4')](getBooleanList(_0x4b3253,_0x1ef38f,_0x5ef37c,_0xd1521[_0xd557('0xa0')],_0x529297['MetadataId'],_0xfbaae6));}}});return Promise['all'](_0x235f67);})[_0xd557('0xe')](function(_0x490b2c){_0x19dfe6=_0x490b2c[0x0];var _0x26edf2=[];var _0x153ecf=[];_0x107a48[_0xd557('0x9d')](function(_0x3bc725){if(_0x3bc725[_0xd557('0x9e')]){var _0x247041=_0x3bc725[_0xd557('0x9e')][_0xd557('0x9f')](_0x3bc725[_0xd557('0x9e')][_0xd557('0x44')]('.')+0x1);if(_0x247041==='StringAttributeMetadata'||_0x247041===_0xd557('0xa5')||_0x247041==='BigIntAttributeMetadata'||_0x247041===_0xd557('0xa6')||_0x247041===_0xd557('0xa7')||_0x247041===_0xd557('0xa8')||_0x247041===_0xd557('0xa9')||_0x247041===_0xd557('0xaa')||_0x247041===_0xd557('0xab')||_0x247041===_0xd557('0xac')){_0x26edf2[_0xd557('0xa4')](getInputList(_0x4b3253,_0x1ef38f,_0x247041,_0x153ecf,_0xd1521[_0xd557('0xa0')],_0x3bc725['MetadataId'],_0xfbaae6));}}});return Promise[_0xd557('0xa1')](_0x26edf2);})[_0xd557('0xe')](function(_0x151f68){_0x58e05b=_0x151f68[0x0];var _0x448546=_0x45afa1[_0xd557('0x89')](_0x19dfe6)['concat'](_0x58e05b);var _0x25ab87={'count':_0x448546[_0xd557('0x22')],'rows':_0x448546};return _0x25ab87;})[_0xd557('0xe')](respondWithResult(_0x1c4062,null))[_0xd557('0x31')](function(_0x195df5){var _0x152c00=_0x5f2916[_0xd557('0x1f')][_0xd557('0xad')]?0x1f4:_0x195df5['statusCode']||0x1f4;logger[_0xd557('0x12')](_0x195df5[_0xd557('0x13')]);delete _0x195df5[_0xd557('0x14')];if(_0x152c00===0x191){_0x152c00=0x190;}_0x1c4062[_0xd557('0x6')](_0x152c00)['send'](_0x5f2916[_0xd557('0x1f')][_0xd557('0xad')]?{'message':_0xd557('0xae'),'statusCode':_0x195df5['statusCode']}:_0x195df5);});};function getSelectList(_0x1b5d68,_0x3773cd,_0x5063c9,_0x1e245d,_0x279a1b,_0x18f9a6){var _0x2e2df2={'method':'GET','uri':_0x1b5d68+'EntityDefinitions('+_0x1e245d+_0xd557('0xaf')+_0x279a1b+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xd557('0xb0'),'headers':{'Authorization':_0xd557('0x98')+_0x18f9a6,'If-None-Match':null,'OData-Version':_0xd557('0xb1')},'json':!![]};return rp(_0x2e2df2)[_0xd557('0xe')](function(_0x3599fa){var _0x2f62a2=[];var _0x4bcd93=_0x3599fa['OptionSet'][_0xd557('0xb2')];_0x4bcd93[_0xd557('0x9d')](function(_0x2e09af){_0x2f62a2[_0xd557('0xa4')]({'name':_0x2e09af[_0xd557('0xb3')][_0xd557('0xb4')]['Label'],'value':String(_0x2e09af[_0xd557('0xb5')])});});var _0x574d9d={'id':_0x3773cd+'_'+_0x3599fa[_0xd557('0xb6')],'name':_0x3599fa[_0xd557('0xb7')]['UserLocalizedLabel'][_0xd557('0xb3')],'custom':![],'options':_0x2f62a2};_0x5063c9[_0xd557('0xa4')](_0x574d9d);return _0x5063c9;});}function getBooleanList(_0x4a6a9e,_0x1a7606,_0xa2a1c5,_0x54f77f,_0x23d659,_0x2832e8){var _0x58d578={'method':_0xd557('0x96'),'uri':_0x4a6a9e+_0xd557('0x9a')+_0x54f77f+_0xd557('0xaf')+_0x23d659+_0xd557('0xb8'),'headers':{'Authorization':_0xd557('0x98')+_0x2832e8,'If-None-Match':null,'OData-Version':_0xd557('0xb1')},'json':!![]};return rp(_0x58d578)[_0xd557('0xe')](function(_0xfcd3ca){var _0x506544=[];_0x506544[_0xd557('0xa4')]({'name':_0xfcd3ca[_0xd557('0xb9')][_0xd557('0xba')][_0xd557('0xb3')]['UserLocalizedLabel'][_0xd557('0xb3')],'value':'true'},{'name':_0xfcd3ca[_0xd557('0xb9')][_0xd557('0xbb')][_0xd557('0xb3')][_0xd557('0xb4')][_0xd557('0xb3')],'value':'false'});var _0x5e7856={'id':_0x1a7606+'_'+_0xfcd3ca[_0xd557('0xb6')],'name':_0xfcd3ca[_0xd557('0xb7')]['UserLocalizedLabel'][_0xd557('0xb3')],'custom':![],'options':_0x506544};_0xa2a1c5[_0xd557('0xa4')](_0x5e7856);return _0xa2a1c5;});}function getInputList(_0x5e50dd,_0x7b62e9,_0x1f7049,_0x3feb3b,_0x25e835,_0x56a65e,_0x795ab5){var _0x17985c={'method':_0xd557('0x96'),'uri':_0x5e50dd+_0xd557('0x9a')+_0x25e835+_0xd557('0xaf')+_0x56a65e+_0xd557('0xbc')+_0x1f7049+_0xd557('0xbd'),'headers':{'Authorization':_0xd557('0x98')+_0x795ab5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x17985c)['then'](function(_0x3f4696){var _0x5609a3={'id':_0x7b62e9+'_'+_0x3f4696[_0xd557('0xb6')],'name':_0x3f4696[_0xd557('0xb7')][_0xd557('0xb4')]?_0x3f4696[_0xd557('0xb7')]['UserLocalizedLabel'][_0xd557('0xb3')]:_0x3f4696['LogicalName'],'custom':![],'options':[]};_0x3feb3b[_0xd557('0xa4')](_0x5609a3);return _0x3feb3b;});} \ No newline at end of file +var _0xe884=['createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','includes','LogicalName','forEach','@odata.type','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','test','statusCode',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Value','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','Label','true','FalseOption','false','DisplayName','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','end','error','stack','name','send','map','Dynamics365Account','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','find','create','body','catch','getConfigurations','findOne','Dynamics365Configuration','sort','filter','nolimit','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','Subjects','slice','substring','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname'];(function(_0x1d5b9e,_0xd79a13){var _0x5695a5=function(_0xfa100b){while(--_0xfa100b){_0x1d5b9e['push'](_0x1d5b9e['shift']());}};_0x5695a5(++_0xd79a13);}(_0xe884,0x11f));var _0x4e88=function(_0x14e296,_0x4b28ac){_0x14e296=_0x14e296-0x0;var _0x4a2b13=_0xe884[_0x14e296];return _0x4a2b13;};'use strict';var rp=require('request-promise');var util=require(_0x4e88('0x0'));var _=require(_0x4e88('0x1'));var qs=require(_0x4e88('0x2'));var logger=require('../../config/logger')(_0x4e88('0x3'));var db=require(_0x4e88('0x4'))['db'];var integrations=require(_0x4e88('0x5'));function respondWithResult(_0xaf7b72,_0x26b9a2){_0x26b9a2=_0x26b9a2||0xc8;return function(_0xe0e2ce){if(_0xe0e2ce){return _0xaf7b72['status'](_0x26b9a2)[_0x4e88('0x6')](_0xe0e2ce);}};}function respondWithFilteredResult(_0x5b487c,_0x1e1897){return function(_0x4405b5){if(_0x4405b5){var _0x3b4279=typeof _0x1e1897[_0x4e88('0x7')]===_0x4e88('0x8')&&typeof _0x1e1897[_0x4e88('0x9')]===_0x4e88('0x8');var _0x368ea0=_0x4405b5[_0x4e88('0xa')];var _0xcdde5f=_0x3b4279?0x0:_0x1e1897[_0x4e88('0x7')];var _0x106fd8=_0x3b4279?_0x4405b5[_0x4e88('0xa')]:_0x1e1897[_0x4e88('0x7')]+_0x1e1897['limit'];var _0x3a2ae6;if(_0x106fd8>=_0x368ea0){_0x106fd8=_0x368ea0;_0x3a2ae6=0xc8;}else{_0x3a2ae6=0xce;}_0x5b487c[_0x4e88('0xb')](_0x3a2ae6);return _0x5b487c[_0x4e88('0xc')](_0x4e88('0xd'),_0xcdde5f+'-'+_0x106fd8+'/'+_0x368ea0)[_0x4e88('0x6')](_0x4405b5);}return null;};}function saveUpdates(_0x9065f8){return function(_0x42fe43){if(_0x42fe43){return _0x42fe43[_0x4e88('0xe')](_0x9065f8)[_0x4e88('0xf')](function(_0x454e21){return _0x454e21;});}return null;};}function removeEntity(_0x4eb737){return function(_0x63ca42){if(_0x63ca42){return _0x63ca42[_0x4e88('0x10')]()[_0x4e88('0xf')](function(){_0x4eb737[_0x4e88('0xb')](0xcc)[_0x4e88('0x11')]();});}};}function handleEntityNotFound(_0x26089d){return function(_0x4ea239){if(!_0x4ea239){_0x26089d['sendStatus'](0x194);}return _0x4ea239;};}function handleError(_0x5ad715,_0x56ab6a){_0x56ab6a=_0x56ab6a||0x1f4;return function(_0x57cd5c){logger[_0x4e88('0x12')](_0x57cd5c[_0x4e88('0x13')]);if(_0x57cd5c['name']){delete _0x57cd5c[_0x4e88('0x14')];}_0x5ad715[_0x4e88('0xb')](_0x56ab6a)[_0x4e88('0x15')](_0x57cd5c);};}exports['index']=function(_0x488fd9,_0x578719){var _0x496db7={},_0x178fdd={},_0x16b843={'count':0x0,'rows':[]};var _0x4694c3=_[_0x4e88('0x16')](db[_0x4e88('0x17')][_0x4e88('0x18')],function(_0x594c7e){return{'name':_0x594c7e[_0x4e88('0x19')],'type':_0x594c7e[_0x4e88('0x1a')]['key']};});_0x178fdd['model']=_[_0x4e88('0x16')](_0x4694c3,_0x4e88('0x14'));_0x178fdd[_0x4e88('0x1b')]=_['keys'](_0x488fd9[_0x4e88('0x1b')]);_0x178fdd[_0x4e88('0x1c')]=_[_0x4e88('0x1d')](_0x178fdd[_0x4e88('0x1e')],_0x178fdd[_0x4e88('0x1b')]);_0x496db7['attributes']=_[_0x4e88('0x1d')](_0x178fdd[_0x4e88('0x1e')],qs['fields'](_0x488fd9['query'][_0x4e88('0x1f')]));_0x496db7[_0x4e88('0x20')]=_0x496db7[_0x4e88('0x20')][_0x4e88('0x21')]?_0x496db7['attributes']:_0x178fdd['model'];if(!_0x488fd9['query'][_0x4e88('0x22')]('nolimit')){_0x496db7[_0x4e88('0x9')]=qs[_0x4e88('0x9')](_0x488fd9[_0x4e88('0x1b')][_0x4e88('0x9')]);_0x496db7['offset']=qs[_0x4e88('0x7')](_0x488fd9['query']['offset']);}_0x496db7[_0x4e88('0x23')]=qs['sort'](_0x488fd9[_0x4e88('0x1b')]['sort']);_0x496db7[_0x4e88('0x24')]=qs[_0x4e88('0x1c')](_[_0x4e88('0x25')](_0x488fd9[_0x4e88('0x1b')],_0x178fdd[_0x4e88('0x1c')]),_0x4694c3);if(_0x488fd9[_0x4e88('0x1b')]['filter']){_0x496db7[_0x4e88('0x24')]=_[_0x4e88('0x26')](_0x496db7[_0x4e88('0x24')],{'$or':_[_0x4e88('0x16')](_0x4694c3,function(_0x18748e){if(_0x18748e[_0x4e88('0x1a')]!==_0x4e88('0x27')){var _0x941c9a={};_0x941c9a[_0x18748e[_0x4e88('0x14')]]={'$like':'%'+_0x488fd9[_0x4e88('0x1b')]['filter']+'%'};return _0x941c9a;}})});}_0x496db7=_[_0x4e88('0x26')]({},_0x496db7,_0x488fd9[_0x4e88('0x28')]);var _0x41aa81={'where':_0x496db7[_0x4e88('0x24')]};return db['Dynamics365Account'][_0x4e88('0xa')](_0x41aa81)['then'](function(_0x4da854){_0x16b843[_0x4e88('0xa')]=_0x4da854;if(_0x488fd9[_0x4e88('0x1b')]['includeAll']){_0x496db7[_0x4e88('0x29')]=[{'all':!![]}];}return db[_0x4e88('0x17')][_0x4e88('0x2a')](_0x496db7);})[_0x4e88('0xf')](function(_0x4bd6b9){_0x16b843[_0x4e88('0x2b')]=_0x4bd6b9;return _0x16b843;})[_0x4e88('0xf')](respondWithFilteredResult(_0x578719,_0x496db7))['catch'](handleError(_0x578719,null));};exports[_0x4e88('0x2c')]=function(_0x26f5e9,_0x1d1f10){var _0xe6c283={'raw':![],'where':{'id':_0x26f5e9[_0x4e88('0x2d')]['id']}},_0x4807ab={};_0x4807ab[_0x4e88('0x1e')]=_['keys'](db[_0x4e88('0x17')][_0x4e88('0x18')]);_0x4807ab[_0x4e88('0x1b')]=_[_0x4e88('0x2e')](_0x26f5e9[_0x4e88('0x1b')]);_0x4807ab[_0x4e88('0x1c')]=_['intersection'](_0x4807ab[_0x4e88('0x1e')],_0x4807ab['query']);_0xe6c283[_0x4e88('0x20')]=_[_0x4e88('0x1d')](_0x4807ab['model'],qs['fields'](_0x26f5e9[_0x4e88('0x1b')][_0x4e88('0x1f')]));_0xe6c283['attributes']=_0xe6c283['attributes']['length']?_0xe6c283[_0x4e88('0x20')]:_0x4807ab[_0x4e88('0x1e')];if(_0x26f5e9[_0x4e88('0x1b')][_0x4e88('0x2f')]){_0xe6c283[_0x4e88('0x29')]=[{'all':!![]}];}_0xe6c283=_[_0x4e88('0x26')]({},_0xe6c283,_0x26f5e9[_0x4e88('0x28')]);return db['Dynamics365Account'][_0x4e88('0x30')](_0xe6c283)[_0x4e88('0xf')](handleEntityNotFound(_0x1d1f10,null))[_0x4e88('0xf')](respondWithResult(_0x1d1f10,null))['catch'](handleError(_0x1d1f10,null));};exports['create']=function(_0x4ce0d8,_0x2a0628){return db[_0x4e88('0x17')][_0x4e88('0x31')](_0x4ce0d8['body'],{})[_0x4e88('0xf')](respondWithResult(_0x2a0628,0xc9))['catch'](handleError(_0x2a0628,null));};exports[_0x4e88('0xe')]=function(_0x2b39ad,_0x5f05ed){if(_0x2b39ad[_0x4e88('0x32')]['id']){delete _0x2b39ad[_0x4e88('0x32')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x2b39ad['params']['id']}})[_0x4e88('0xf')](handleEntityNotFound(_0x5f05ed,null))[_0x4e88('0xf')](saveUpdates(_0x2b39ad['body'],null))[_0x4e88('0xf')](respondWithResult(_0x5f05ed,null))[_0x4e88('0x33')](handleError(_0x5f05ed,null));};exports[_0x4e88('0x10')]=function(_0xd49203,_0x34a332){return db['Dynamics365Account'][_0x4e88('0x30')]({'where':{'id':_0xd49203[_0x4e88('0x2d')]['id']}})[_0x4e88('0xf')](handleEntityNotFound(_0x34a332,null))[_0x4e88('0xf')](removeEntity(_0x34a332,null))['catch'](handleError(_0x34a332,null));};exports[_0x4e88('0x34')]=function(_0x5c6a0c,_0x53dc33){var _0xf327da={};var _0x25553c={};var _0x4a464d;var _0x27da46;return db['Dynamics365Account'][_0x4e88('0x35')]({'where':{'id':_0x5c6a0c['params']['id']}})['then'](handleEntityNotFound(_0x53dc33,null))[_0x4e88('0xf')](function(_0x1a8ec1){if(_0x1a8ec1){_0x4a464d=_0x1a8ec1;_0x25553c[_0x4e88('0x1e')]=_[_0x4e88('0x2e')](db[_0x4e88('0x36')][_0x4e88('0x18')]);_0x25553c[_0x4e88('0x1b')]=_[_0x4e88('0x2e')](_0x5c6a0c[_0x4e88('0x1b')]);_0x25553c[_0x4e88('0x1c')]=_[_0x4e88('0x1d')](_0x25553c[_0x4e88('0x1e')],_0x25553c[_0x4e88('0x1b')]);_0xf327da[_0x4e88('0x20')]=_[_0x4e88('0x1d')](_0x25553c['model'],qs[_0x4e88('0x1f')](_0x5c6a0c['query'][_0x4e88('0x1f')]));_0xf327da['attributes']=_0xf327da[_0x4e88('0x20')][_0x4e88('0x21')]?_0xf327da['attributes']:_0x25553c[_0x4e88('0x1e')];_0xf327da[_0x4e88('0x23')]=qs['sort'](_0x5c6a0c[_0x4e88('0x1b')][_0x4e88('0x37')]);_0xf327da['where']=qs[_0x4e88('0x1c')](_[_0x4e88('0x25')](_0x5c6a0c['query'],_0x25553c[_0x4e88('0x1c')]));if(_0x5c6a0c[_0x4e88('0x1b')][_0x4e88('0x38')]){_0xf327da[_0x4e88('0x24')]=_[_0x4e88('0x26')](_0xf327da[_0x4e88('0x24')],{'$or':_['map'](_0xf327da['attributes'],function(_0x2acafe){var _0x48ca06={};_0x48ca06[_0x2acafe]={'$like':'%'+_0x5c6a0c[_0x4e88('0x1b')]['filter']+'%'};return _0x48ca06;})});}_0xf327da=_[_0x4e88('0x26')]({},_0xf327da,_0x5c6a0c[_0x4e88('0x28')]);return _0x4a464d[_0x4e88('0x34')](_0xf327da);}})[_0x4e88('0xf')](function(_0x74d725){if(_0x74d725){_0x27da46=_0x74d725[_0x4e88('0x21')];if(!_0x5c6a0c[_0x4e88('0x1b')][_0x4e88('0x22')](_0x4e88('0x39'))){_0xf327da['limit']=qs['limit'](_0x5c6a0c['query']['limit']);_0xf327da[_0x4e88('0x7')]=qs[_0x4e88('0x7')](_0x5c6a0c[_0x4e88('0x1b')][_0x4e88('0x7')]);}return _0x4a464d[_0x4e88('0x34')](_0xf327da);}})[_0x4e88('0xf')](function(_0x152bca){if(_0x152bca){return _0x152bca?{'count':_0x27da46,'rows':_0x152bca}:null;}})[_0x4e88('0xf')](respondWithResult(_0x53dc33,null))['catch'](handleError(_0x53dc33,null));};exports[_0x4e88('0x3a')]=function(_0x1ccfeb,_0x16a16c){if(_0x1ccfeb[_0x4e88('0x32')]['id']){delete _0x1ccfeb['body']['id'];}return db[_0x4e88('0x17')][_0x4e88('0x35')]({'where':{'id':_0x1ccfeb[_0x4e88('0x2d')]['id']}})[_0x4e88('0xf')](handleEntityNotFound(_0x16a16c,null))[_0x4e88('0xf')](function(_0x56f4f7){if(_0x56f4f7){_0x1ccfeb[_0x4e88('0x32')]['AccountId']=_0x56f4f7['id'];_0x1ccfeb[_0x4e88('0x32')]['Subjects']=integrations[_0x4e88('0x3b')](_0x1ccfeb[_0x4e88('0x32')][_0x4e88('0x3c')],_0x1ccfeb[_0x4e88('0x32')]['type']);_0x1ccfeb[_0x4e88('0x32')][_0x4e88('0x3d')]=integrations[_0x4e88('0x3e')](_0x1ccfeb[_0x4e88('0x32')][_0x4e88('0x3c')],_0x1ccfeb[_0x4e88('0x32')]['type']);return db[_0x4e88('0x36')][_0x4e88('0x31')](_0x1ccfeb[_0x4e88('0x32')],{'include':[{'model':db[_0x4e88('0x3f')],'as':_0x4e88('0x40')},{'model':db[_0x4e88('0x3f')],'as':_0x4e88('0x3d')}]});}return null;})[_0x4e88('0xf')](respondWithResult(_0x16a16c,null))[_0x4e88('0x33')](handleError(_0x16a16c,null));};function sanitizeRemoteUri(_0x54cb55){var _0x4d1373=_0x54cb55[_0x4e88('0x41')](-0x1);if(_0x4d1373==='/')return _0x54cb55[_0x4e88('0x42')](0x0,_0x54cb55[_0x4e88('0x43')](_0x4d1373));return _0x54cb55;}function getWebApiUrl(_0x13c72a){return util['format'](_0x4e88('0x44'),_0x13c72a);}exports[_0x4e88('0x45')]=function(_0x16c52d,_0x2878ae){var _0x4284ec=_0x16c52d[_0x4e88('0x1b')][_0x4e88('0x46')];var _0x1e61b3=_0x4284ec===_0x4e88('0x47')?_0x4e88('0x48'):_0x4e88('0x49');var _0x54e64e='';var _0x52692d='';var _0x1af2a4='';var _0x338281='';var _0x4e90ff='';var _0x1e7caa='';var _0xbf728f='';var _0x1e6516='';var _0x33f55b=[_0x4e88('0x4a'),_0x4e88('0x4b'),_0x4e88('0x4c'),_0x4e88('0x4d'),'caseorigincode',_0x4e88('0x4e'),_0x4e88('0x4f'),_0x4e88('0x50'),_0x4e88('0x51'),'phonecall_activity_parties'];var _0x18ac48=['accountidname',_0x4e88('0x52'),_0x4e88('0x53'),_0x4e88('0x54'),_0x4e88('0x55'),_0x4e88('0x56'),_0x4e88('0x57'),_0x4e88('0x58'),'createdbyexternalpartyname',_0x4e88('0x59'),_0x4e88('0x5a'),_0x4e88('0x5b'),_0x4e88('0x5c'),'createdonbehalfbyname',_0x4e88('0x5d'),_0x4e88('0x5e'),_0x4e88('0x5f'),'customeridyominame',_0x4e88('0x60'),_0x4e88('0x61'),_0x4e88('0x62'),_0x4e88('0x63'),_0x4e88('0x64'),_0x4e88('0x65'),_0x4e88('0x66'),_0x4e88('0x67'),_0x4e88('0x68'),_0x4e88('0x69'),'kbarticleidname','lastonholdtime',_0x4e88('0x6a'),_0x4e88('0x6b'),'modifiedbyexternalpartyyominame',_0x4e88('0x6c'),_0x4e88('0x6d'),_0x4e88('0x6e'),_0x4e88('0x6f'),_0x4e88('0x70'),'msdyn_incidenttypename',_0x4e88('0x71'),'numberofchildincidents',_0x4e88('0x72'),'overriddencreatedon',_0x4e88('0x73'),_0x4e88('0x74'),_0x4e88('0x75'),_0x4e88('0x76'),_0x4e88('0x77'),'primarycontactidyominame',_0x4e88('0x78'),_0x4e88('0x79'),_0x4e88('0x7a'),'resolveby',_0x4e88('0x7b'),'responseby',_0x4e88('0x7c'),'responsiblecontactidyominame',_0x4e88('0x7d'),'slainvokedidname',_0x4e88('0x7e'),_0x4e88('0x7f'),'statecode',_0x4e88('0x80'),_0x4e88('0x81'),'ticketnumber',_0x4e88('0x82'),_0x4e88('0x83'),_0x4e88('0x84'),_0x4e88('0x85'),_0x4e88('0x86')];var _0x50e11d=_0x33f55b[_0x4e88('0x87')](_0x18ac48);return db[_0x4e88('0x17')][_0x4e88('0x35')]({'where':{'id':_0x16c52d['params']['id']},'attributes':['id',_0x4e88('0x88'),_0x4e88('0x89'),_0x4e88('0x8a'),_0x4e88('0x8b'),_0x4e88('0x8c'),_0x4e88('0x8d'),_0x4e88('0x8e')],'include':[{'model':db[_0x4e88('0x8f')],'as':_0x4e88('0x8f'),'attributes':['id',_0x4e88('0x90'),_0x4e88('0x91')]}]})[_0x4e88('0xf')](handleEntityNotFound(_0x2878ae,null))[_0x4e88('0xf')](function(_0x534cdb){if(_0x534cdb){if(_0x534cdb[_0x4e88('0x8e')]){_0x534cdb[_0x4e88('0x92')]=_0x534cdb[_0x4e88('0x8f')][_0x4e88('0x90')];_0x1e6516=sanitizeRemoteUri(_0x534cdb[_0x4e88('0x8f')]['data7']);_0xbf728f=getWebApiUrl(_0x1e6516);return _0x534cdb;}_0x1e6516=sanitizeRemoteUri(_0x534cdb[_0x4e88('0x8a')]);_0xbf728f=getWebApiUrl(_0x1e6516);var _0xc05b2c={'method':_0x4e88('0x93'),'uri':'https://login.microsoftonline.com/'+_0x534cdb[_0x4e88('0x8b')]+_0x4e88('0x94'),'form':{'client_id':_0x534cdb[_0x4e88('0x8c')],'resource':_0x1e6516,'username':_0x534cdb[_0x4e88('0x88')],'password':_0x534cdb[_0x4e88('0x89')],'grant_type':_0x4e88('0x89'),'client_secret':_0x534cdb[_0x4e88('0x8d')]},'json':!![]};return rp(_0xc05b2c);}})[_0x4e88('0xf')](function(_0x1d4b0c){_0x1e7caa=_0x1d4b0c[_0x4e88('0x92')];var _0x2f9652={'method':_0x4e88('0x95'),'uri':encodeURI(_0xbf728f+_0x4e88('0x96')+_0x1e61b3+'\x27'),'headers':{'Authorization':_0x4e88('0x97')+_0x1e7caa,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2f9652);})[_0x4e88('0xf')](function(_0x2c5534){var _0x5015fa=_0x2c5534[_0x4e88('0x98')][0x0];var _0x3bf463=_0x5015fa[_0x4e88('0x99')];var _0x55e193={'method':_0x4e88('0x95'),'uri':_0xbf728f+_0x4e88('0x9a')+_0x3bf463+_0x4e88('0x9b'),'headers':{'Authorization':'Bearer\x20'+_0x1e7caa,'If-None-Match':null,'OData-Version':_0x4e88('0x9c')},'json':!![]};return rp(_0x55e193);})['then'](function(_0x51c9ea){_0x54e64e=_0x51c9ea;_0x52692d=_0x54e64e[_0x4e88('0x9d')];_0x52692d=_['remove'](_0x52692d,function(_0x575ad1){return!_0x50e11d[_0x4e88('0x9e')](_0x575ad1[_0x4e88('0x9f')]);});var _0x204ee5=[];var _0x49e90b=[];_0x52692d[_0x4e88('0xa0')](function(_0x26923a){if(_0x26923a[_0x4e88('0xa1')]){var _0x454f44=_0x26923a[_0x4e88('0xa1')][_0x4e88('0x42')](_0x26923a[_0x4e88('0xa1')]['lastIndexOf']('.')+0x1);if(_0x454f44==='PicklistAttributeMetadata'){_0x204ee5[_0x4e88('0xa2')](getSelectList(_0xbf728f,_0x4284ec,_0x49e90b,_0x54e64e[_0x4e88('0x99')],_0x26923a[_0x4e88('0x99')],_0x1e7caa));}}});return Promise[_0x4e88('0xa3')](_0x204ee5);})['then'](function(_0x23412d){_0x1af2a4=_0x23412d[0x0];var _0x1a9e31=[];var _0x1212dd=[];_0x52692d[_0x4e88('0xa0')](function(_0x231a73){if(!_[_0x4e88('0xa4')](_0x231a73[_0x4e88('0xa1')])){var _0x5e9847=_0x231a73[_0x4e88('0xa1')][_0x4e88('0x42')](_0x231a73[_0x4e88('0xa1')][_0x4e88('0x43')]('.')+0x1);if(_0x5e9847===_0x4e88('0xa5')){_0x1a9e31[_0x4e88('0xa2')](getBooleanList(_0xbf728f,_0x4284ec,_0x1212dd,_0x54e64e[_0x4e88('0x99')],_0x231a73[_0x4e88('0x99')],_0x1e7caa));}}});return Promise[_0x4e88('0xa3')](_0x1a9e31);})[_0x4e88('0xf')](function(_0x84d916){_0x338281=_0x84d916[0x0];var _0x2c5ec7=[];var _0x827171=[];_0x52692d[_0x4e88('0xa0')](function(_0x5efbd1){if(_0x5efbd1[_0x4e88('0xa1')]){var _0x2cb12c=_0x5efbd1['@odata.type']['substring'](_0x5efbd1[_0x4e88('0xa1')][_0x4e88('0x43')]('.')+0x1);if(_0x2cb12c===_0x4e88('0xa6')||_0x2cb12c===_0x4e88('0xa7')||_0x2cb12c===_0x4e88('0xa8')||_0x2cb12c==='IntegerAttributeMetadata'||_0x2cb12c===_0x4e88('0xa9')||_0x2cb12c===_0x4e88('0xaa')||_0x2cb12c===_0x4e88('0xab')||_0x2cb12c==='EntityNameAttributeMetadata'||_0x2cb12c==='StateAttributeMetadata'||_0x2cb12c==='DecimalAttributeMetadata'){_0x2c5ec7[_0x4e88('0xa2')](getInputList(_0xbf728f,_0x4284ec,_0x2cb12c,_0x827171,_0x54e64e[_0x4e88('0x99')],_0x5efbd1['MetadataId'],_0x1e7caa));}}});return Promise[_0x4e88('0xa3')](_0x2c5ec7);})[_0x4e88('0xf')](function(_0x41647a){_0x4e90ff=_0x41647a[0x0];var _0x546293=_0x1af2a4[_0x4e88('0x87')](_0x338281)[_0x4e88('0x87')](_0x4e90ff);var _0x6bc176={'count':_0x546293[_0x4e88('0x21')],'rows':_0x546293};return _0x6bc176;})[_0x4e88('0xf')](respondWithResult(_0x2878ae,null))[_0x4e88('0x33')](function(_0x191f2d){var _0x55fce5=_0x16c52d[_0x4e88('0x1b')][_0x4e88('0xac')]?0x1f4:_0x191f2d[_0x4e88('0xad')]||0x1f4;logger[_0x4e88('0x12')](_0x191f2d[_0x4e88('0x13')]);delete _0x191f2d[_0x4e88('0x14')];if(_0x55fce5===0x191){_0x55fce5=0x190;}_0x2878ae[_0x4e88('0xb')](_0x55fce5)[_0x4e88('0x15')](_0x16c52d[_0x4e88('0x1b')][_0x4e88('0xac')]?{'message':'Wrong\x20credentials','statusCode':_0x191f2d[_0x4e88('0xad')]}:_0x191f2d);});};function getSelectList(_0x379957,_0x36b00d,_0x7acd92,_0x1c9edf,_0x2af2d0,_0x55f6db){var _0x1de710={'method':_0x4e88('0x95'),'uri':_0x379957+'EntityDefinitions('+_0x1c9edf+_0x4e88('0xae')+_0x2af2d0+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x4e88('0xaf'),'headers':{'Authorization':_0x4e88('0x97')+_0x55f6db,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1de710)[_0x4e88('0xf')](function(_0x40f65d){var _0x29d041=[];var _0x345102=_0x40f65d[_0x4e88('0xb0')][_0x4e88('0xb1')];_0x345102[_0x4e88('0xa0')](function(_0x56182d){_0x29d041['push']({'name':_0x56182d['Label']['UserLocalizedLabel']['Label'],'value':String(_0x56182d[_0x4e88('0xb2')])});});var _0x39ca93={'id':_0x36b00d+'_'+_0x40f65d[_0x4e88('0x9f')],'name':_0x40f65d['DisplayName'][_0x4e88('0xb3')]['Label'],'custom':![],'options':_0x29d041};_0x7acd92['push'](_0x39ca93);return _0x7acd92;});}function getBooleanList(_0x3ab0fc,_0x4f4747,_0x1f6631,_0x457b2a,_0x1a4b1f,_0x384944){var _0x75246c={'method':'GET','uri':_0x3ab0fc+_0x4e88('0x9a')+_0x457b2a+_0x4e88('0xae')+_0x1a4b1f+_0x4e88('0xb4'),'headers':{'Authorization':'Bearer\x20'+_0x384944,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x75246c)['then'](function(_0x5234b4){var _0x258ac5=[];_0x258ac5[_0x4e88('0xa2')]({'name':_0x5234b4[_0x4e88('0xb0')][_0x4e88('0xb5')]['Label'][_0x4e88('0xb3')][_0x4e88('0xb6')],'value':_0x4e88('0xb7')},{'name':_0x5234b4[_0x4e88('0xb0')][_0x4e88('0xb8')][_0x4e88('0xb6')][_0x4e88('0xb3')]['Label'],'value':_0x4e88('0xb9')});var _0x483a32={'id':_0x4f4747+'_'+_0x5234b4[_0x4e88('0x9f')],'name':_0x5234b4[_0x4e88('0xba')][_0x4e88('0xb3')][_0x4e88('0xb6')],'custom':![],'options':_0x258ac5};_0x1f6631['push'](_0x483a32);return _0x1f6631;});}function getInputList(_0x524753,_0xdffb3f,_0x1fef3f,_0x45b323,_0x57943d,_0x325e3b,_0x4d44f6){var _0x15c201={'method':_0x4e88('0x95'),'uri':_0x524753+_0x4e88('0x9a')+_0x57943d+_0x4e88('0xae')+_0x325e3b+')/Microsoft.Dynamics.CRM.'+_0x1fef3f+_0x4e88('0xbb'),'headers':{'Authorization':_0x4e88('0x97')+_0x4d44f6,'If-None-Match':null,'OData-Version':_0x4e88('0x9c')},'json':!![]};return rp(_0x15c201)['then'](function(_0x72bd81){var _0x40feb9={'id':_0xdffb3f+'_'+_0x72bd81['LogicalName'],'name':_0x72bd81[_0x4e88('0xba')][_0x4e88('0xb3')]?_0x72bd81[_0x4e88('0xba')]['UserLocalizedLabel']['Label']:_0x72bd81[_0x4e88('0x9f')],'custom':![],'options':[]};_0x45b323[_0x4e88('0xa2')](_0x40feb9);return _0x45b323;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index e833c1b..2af04f5 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 _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x1fb7d6,_0x124bd4){var _0x28d711=function(_0x2c84fa){while(--_0x2c84fa){_0x1fb7d6['push'](_0x1fb7d6['shift']());}};_0x28d711(++_0x124bd4);}(_0x757a,0xde));var _0xa757=function(_0x217773,_0x2c18a9){_0x217773=_0x217773-0x0;var _0x1ccfa5=_0x757a[_0x217773];return _0x1ccfa5;};'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'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x386ef3,_0x5837e2){var _0x5e92af=function(_0x1c3bca){while(--_0x1c3bca){_0x386ef3['push'](_0x386ef3['shift']());}};_0x5e92af(++_0x5837e2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 4975534..74d474d 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 _0x1721=['Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','catch','GetDynamics365Account','Dynamics365Account','options','where','attributes','limit','include','map','model','find','raw','then','ShowDynamics365Account','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','info','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1721,0x1d6));var _0x1172=function(_0x39c4b0,_0x2f6bd6){_0x39c4b0=_0x39c4b0-0x0;var _0x5c244f=_0x1721[_0x39c4b0];return _0x5c244f;};'use strict';var _=require(_0x1172('0x0'));var util=require(_0x1172('0x1'));var moment=require(_0x1172('0x2'));var BPromise=require(_0x1172('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1172('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1172('0x5'));var config=require(_0x1172('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1172('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29e206,_0x226faa,_0x5b6171){return new BPromise(function(_0x2d2cd6,_0x3a7821){return client['request'](_0x29e206,_0x5b6171)['then'](function(_0x5cd243){logger[_0x1172('0x8')]('Dynamics365Account,\x20%s,\x20%s',_0x226faa,'request\x20sent');logger[_0x1172('0x9')](_0x1172('0xa'),_0x226faa,_0x1172('0xb'),JSON[_0x1172('0xc')](_0x5cd243));if(_0x5cd243['error']){if(_0x5cd243[_0x1172('0xd')][_0x1172('0xe')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x226faa,_0x5cd243[_0x1172('0xd')][_0x1172('0xf')]);return _0x3a7821(_0x5cd243[_0x1172('0xd')][_0x1172('0xf')]);}logger['error'](_0x1172('0x10'),_0x226faa,_0x5cd243[_0x1172('0xd')][_0x1172('0xf')]);return _0x2d2cd6(_0x5cd243[_0x1172('0xd')][_0x1172('0xf')]);}else{logger[_0x1172('0x8')](_0x1172('0x10'),_0x226faa,'request\x20sent');_0x2d2cd6(_0x5cd243[_0x1172('0x11')]['message']);}})[_0x1172('0x12')](function(_0x50ae42){logger[_0x1172('0xd')](_0x1172('0x10'),_0x226faa,_0x50ae42);_0x3a7821(_0x50ae42);});});}exports[_0x1172('0x13')]=function(_0x576514){var _0x514984=this;return new Promise(function(_0x1a490b,_0x1f56b2){return db[_0x1172('0x14')]['findAll']({'raw':_0x576514[_0x1172('0x15')]?_0x576514[_0x1172('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x576514[_0x1172('0x15')]?_0x576514[_0x1172('0x15')][_0x1172('0x16')]||null:null,'attributes':_0x576514['options']?_0x576514[_0x1172('0x15')][_0x1172('0x17')]||null:null,'limit':_0x576514[_0x1172('0x15')]?_0x576514['options'][_0x1172('0x18')]||null:null,'include':_0x576514['options']?_0x576514[_0x1172('0x15')][_0x1172('0x19')]?_[_0x1172('0x1a')](_0x576514[_0x1172('0x15')][_0x1172('0x19')],function(_0x58ca50){return{'model':db[_0x58ca50['model']],'as':_0x58ca50['as'],'attributes':_0x58ca50['attributes'],'include':_0x58ca50[_0x1172('0x19')]?_[_0x1172('0x1a')](_0x58ca50['include'],function(_0x399821){return{'model':db[_0x399821[_0x1172('0x1b')]],'as':_0x399821['as'],'attributes':_0x399821[_0x1172('0x17')],'include':_0x399821[_0x1172('0x19')]?_[_0x1172('0x1a')](_0x399821[_0x1172('0x19')],function(_0x58e8fb){return{'model':db[_0x58e8fb['model']],'as':_0x58e8fb['as'],'attributes':_0x58e8fb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5aa4ef){logger[_0x1172('0x8')]('GetDynamics365Account',_0x576514);logger['debug'](_0x1172('0x13'),_0x576514,JSON['stringify'](_0x5aa4ef));_0x1a490b(_0x5aa4ef);})['catch'](function(_0x380913){logger[_0x1172('0xd')](_0x1172('0x13'),_0x380913[_0x1172('0xf')],_0x576514);_0x1f56b2(_0x514984[_0x1172('0xd')](0x1f4,_0x380913[_0x1172('0xf')]));});});};exports['ShowDynamics365Account']=function(_0xc5cba8){var _0x95df26=this;return new Promise(function(_0x56fd5e,_0x2ac1c6){return db[_0x1172('0x14')][_0x1172('0x1c')]({'raw':_0xc5cba8[_0x1172('0x15')]?_0xc5cba8[_0x1172('0x15')][_0x1172('0x1d')]===undefined?!![]:![]:!![],'where':_0xc5cba8[_0x1172('0x15')]?_0xc5cba8['options']['where']||null:null,'attributes':_0xc5cba8[_0x1172('0x15')]?_0xc5cba8[_0x1172('0x15')][_0x1172('0x17')]||null:null,'include':_0xc5cba8[_0x1172('0x15')]?_0xc5cba8[_0x1172('0x15')]['include']?_['map'](_0xc5cba8[_0x1172('0x15')][_0x1172('0x19')],function(_0x13c047){return{'model':db[_0x13c047[_0x1172('0x1b')]],'as':_0x13c047['as'],'attributes':_0x13c047[_0x1172('0x17')],'include':_0x13c047[_0x1172('0x19')]?_['map'](_0x13c047[_0x1172('0x19')],function(_0x52b7cf){return{'model':db[_0x52b7cf[_0x1172('0x1b')]],'as':_0x52b7cf['as'],'attributes':_0x52b7cf['attributes'],'include':_0x52b7cf[_0x1172('0x19')]?_[_0x1172('0x1a')](_0x52b7cf[_0x1172('0x19')],function(_0xe4dcba){return{'model':db[_0xe4dcba['model']],'as':_0xe4dcba['as'],'attributes':_0xe4dcba[_0x1172('0x17')]};}):[]};}):[]};}):[]:[]})[_0x1172('0x1e')](function(_0x840d6f){logger[_0x1172('0x8')](_0x1172('0x1f'),_0xc5cba8);logger[_0x1172('0x9')]('ShowDynamics365Account',_0xc5cba8,JSON[_0x1172('0xc')](_0x840d6f));_0x56fd5e(_0x840d6f);})['catch'](function(_0x37ccca){logger['error']('ShowDynamics365Account',_0x37ccca[_0x1172('0xf')],_0xc5cba8);_0x2ac1c6(_0x95df26['error'](0x1f4,_0x37ccca[_0x1172('0xf')]));});});}; \ No newline at end of file +var _0xc7fa=['attributes','limit','map','include','model','ShowDynamics365Account','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','request\x20sent','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where'];(function(_0x176671,_0x1127b0){var _0x46e12b=function(_0x49f910){while(--_0x49f910){_0x176671['push'](_0x176671['shift']());}};_0x46e12b(++_0x1127b0);}(_0xc7fa,0xf5));var _0xac7f=function(_0x25fd5d,_0x4fabf7){_0x25fd5d=_0x25fd5d-0x0;var _0x51d403=_0xc7fa[_0x25fd5d];return _0x51d403;};'use strict';var _=require(_0xac7f('0x0'));var util=require(_0xac7f('0x1'));var moment=require(_0xac7f('0x2'));var BPromise=require('bluebird');var rs=require(_0xac7f('0x3'));var fs=require('fs');var Redis=require(_0xac7f('0x4'));var db=require(_0xac7f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xac7f('0x6'))(_0xac7f('0x7'));var config=require(_0xac7f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xac7f('0x9')][_0xac7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ef058,_0x452d71,_0x524162){return new BPromise(function(_0x3e5ea8,_0x2a6b80){return client[_0xac7f('0xb')](_0x5ef058,_0x524162)[_0xac7f('0xc')](function(_0x5aa411){logger[_0xac7f('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x452d71,'request\x20sent');logger[_0xac7f('0xe')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x452d71,_0xac7f('0xf'),JSON[_0xac7f('0x10')](_0x5aa411));if(_0x5aa411[_0xac7f('0x11')]){if(_0x5aa411[_0xac7f('0x11')]['code']===0x1f4){logger['error'](_0xac7f('0x12'),_0x452d71,_0x5aa411[_0xac7f('0x11')][_0xac7f('0x13')]);return _0x2a6b80(_0x5aa411[_0xac7f('0x11')][_0xac7f('0x13')]);}logger[_0xac7f('0x11')](_0xac7f('0x12'),_0x452d71,_0x5aa411[_0xac7f('0x11')][_0xac7f('0x13')]);return _0x3e5ea8(_0x5aa411[_0xac7f('0x11')][_0xac7f('0x13')]);}else{logger[_0xac7f('0xd')](_0xac7f('0x12'),_0x452d71,_0xac7f('0xf'));_0x3e5ea8(_0x5aa411[_0xac7f('0x14')][_0xac7f('0x13')]);}})['catch'](function(_0x1db548){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x452d71,_0x1db548);_0x2a6b80(_0x1db548);});});}exports[_0xac7f('0x15')]=function(_0x2c2ee0){var _0x61f885=this;return new Promise(function(_0x22b06b,_0x25f18e){return db[_0xac7f('0x16')][_0xac7f('0x17')]({'raw':_0x2c2ee0['options']?_0x2c2ee0[_0xac7f('0x18')][_0xac7f('0x19')]===undefined?!![]:![]:!![],'where':_0x2c2ee0['options']?_0x2c2ee0['options'][_0xac7f('0x1a')]||null:null,'attributes':_0x2c2ee0[_0xac7f('0x18')]?_0x2c2ee0[_0xac7f('0x18')][_0xac7f('0x1b')]||null:null,'limit':_0x2c2ee0[_0xac7f('0x18')]?_0x2c2ee0['options'][_0xac7f('0x1c')]||null:null,'include':_0x2c2ee0[_0xac7f('0x18')]?_0x2c2ee0['options']['include']?_[_0xac7f('0x1d')](_0x2c2ee0[_0xac7f('0x18')][_0xac7f('0x1e')],function(_0x3249d7){return{'model':db[_0x3249d7[_0xac7f('0x1f')]],'as':_0x3249d7['as'],'attributes':_0x3249d7[_0xac7f('0x1b')],'include':_0x3249d7[_0xac7f('0x1e')]?_[_0xac7f('0x1d')](_0x3249d7[_0xac7f('0x1e')],function(_0x4147e3){return{'model':db[_0x4147e3[_0xac7f('0x1f')]],'as':_0x4147e3['as'],'attributes':_0x4147e3['attributes'],'include':_0x4147e3[_0xac7f('0x1e')]?_[_0xac7f('0x1d')](_0x4147e3['include'],function(_0x48be4f){return{'model':db[_0x48be4f[_0xac7f('0x1f')]],'as':_0x48be4f['as'],'attributes':_0x48be4f[_0xac7f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xac7f('0xc')](function(_0x16c62c){logger[_0xac7f('0xd')]('GetDynamics365Account',_0x2c2ee0);logger[_0xac7f('0xe')]('GetDynamics365Account',_0x2c2ee0,JSON[_0xac7f('0x10')](_0x16c62c));_0x22b06b(_0x16c62c);})['catch'](function(_0x485d7a){logger[_0xac7f('0x11')](_0xac7f('0x15'),_0x485d7a[_0xac7f('0x13')],_0x2c2ee0);_0x25f18e(_0x61f885[_0xac7f('0x11')](0x1f4,_0x485d7a['message']));});});};exports[_0xac7f('0x20')]=function(_0x26ab6b){var _0x543c49=this;return new Promise(function(_0x4fe45e,_0x3051b9){return db['Dynamics365Account']['find']({'raw':_0x26ab6b[_0xac7f('0x18')]?_0x26ab6b[_0xac7f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x26ab6b[_0xac7f('0x18')]?_0x26ab6b[_0xac7f('0x18')][_0xac7f('0x1a')]||null:null,'attributes':_0x26ab6b[_0xac7f('0x18')]?_0x26ab6b[_0xac7f('0x18')]['attributes']||null:null,'include':_0x26ab6b['options']?_0x26ab6b[_0xac7f('0x18')][_0xac7f('0x1e')]?_[_0xac7f('0x1d')](_0x26ab6b['options'][_0xac7f('0x1e')],function(_0x236b80){return{'model':db[_0x236b80[_0xac7f('0x1f')]],'as':_0x236b80['as'],'attributes':_0x236b80['attributes'],'include':_0x236b80['include']?_['map'](_0x236b80['include'],function(_0x2b52a5){return{'model':db[_0x2b52a5[_0xac7f('0x1f')]],'as':_0x2b52a5['as'],'attributes':_0x2b52a5[_0xac7f('0x1b')],'include':_0x2b52a5['include']?_['map'](_0x2b52a5[_0xac7f('0x1e')],function(_0x22bc5c){return{'model':db[_0x22bc5c['model']],'as':_0x22bc5c['as'],'attributes':_0x22bc5c['attributes']};}):[]};}):[]};}):[]:[]})[_0xac7f('0xc')](function(_0x5ddf04){logger[_0xac7f('0xd')](_0xac7f('0x20'),_0x26ab6b);logger[_0xac7f('0xe')]('ShowDynamics365Account',_0x26ab6b,JSON[_0xac7f('0x10')](_0x5ddf04));_0x4fe45e(_0x5ddf04);})[_0xac7f('0x21')](function(_0x3bbfb1){logger['error']('ShowDynamics365Account',_0x3bbfb1[_0xac7f('0x13')],_0x26ab6b);_0x3051b9(_0x543c49[_0xac7f('0x11')](0x1f4,_0x3bbfb1[_0xac7f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index eb704ff..6119e5b 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 _0x3192=['update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','/:id','show','/:id/fields','isAuthenticated','getFields','getDescriptions','create'];(function(_0x5a3f74,_0x132c3e){var _0x2e18d1=function(_0x344564){while(--_0x344564){_0x5a3f74['push'](_0x5a3f74['shift']());}};_0x2e18d1(++_0x132c3e);}(_0x3192,0x147));var _0x2319=function(_0x5333af,_0x4a7b92){_0x5333af=_0x5333af-0x0;var _0x1ba535=_0x3192[_0x5333af];return _0x1ba535;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2319('0x0'));var timeout=require(_0x2319('0x1'));var express=require(_0x2319('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2319('0x3'));var interaction=require(_0x2319('0x4'));var config=require(_0x2319('0x5'));var controller=require(_0x2319('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2319('0x7')](_0x2319('0x8'),auth['isAuthenticated'](),controller[_0x2319('0x9')]);router[_0x2319('0x7')](_0x2319('0xa'),auth[_0x2319('0xb')](),controller[_0x2319('0xc')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x2319('0x7')]('/:id/descriptions',auth[_0x2319('0xb')](),controller[_0x2319('0xd')]);router['post']('/',auth[_0x2319('0xb')](),controller[_0x2319('0xe')]);router['put'](_0x2319('0x8'),auth[_0x2319('0xb')](),controller[_0x2319('0xf')]);router[_0x2319('0x10')](_0x2319('0x8'),auth[_0x2319('0xb')](),controller[_0x2319('0x11')]);module[_0x2319('0x12')]=router; \ No newline at end of file +var _0xf643=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','update'];(function(_0x4286ad,_0x5a99ed){var _0x4382d3=function(_0xdc43a8){while(--_0xdc43a8){_0x4286ad['push'](_0x4286ad['shift']());}};_0x4382d3(++_0x5a99ed);}(_0xf643,0x122));var _0x3f64=function(_0x18847a,_0xd6898e){_0x18847a=_0x18847a-0x0;var _0x5b68ca=_0xf643[_0x18847a];return _0x5b68ca;};'use strict';var multer=require(_0x3f64('0x0'));var util=require(_0x3f64('0x1'));var path=require(_0x3f64('0x2'));var timeout=require(_0x3f64('0x3'));var express=require('express');var router=express[_0x3f64('0x4')]();var fs_extra=require(_0x3f64('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3f64('0x6'));var config=require(_0x3f64('0x7'));var controller=require(_0x3f64('0x8'));router[_0x3f64('0x9')]('/',auth[_0x3f64('0xa')](),controller[_0x3f64('0xb')]);router[_0x3f64('0x9')](_0x3f64('0xc'),auth[_0x3f64('0xa')](),controller[_0x3f64('0xd')]);router[_0x3f64('0x9')](_0x3f64('0xe'),auth[_0x3f64('0xa')](),controller[_0x3f64('0xf')]);router[_0x3f64('0x9')]('/:id/subjects',auth[_0x3f64('0xa')](),controller[_0x3f64('0x10')]);router[_0x3f64('0x9')]('/:id/descriptions',auth[_0x3f64('0xa')](),controller[_0x3f64('0x11')]);router[_0x3f64('0x12')]('/',auth[_0x3f64('0xa')](),controller[_0x3f64('0x13')]);router[_0x3f64('0x14')](_0x3f64('0xc'),auth[_0x3f64('0xa')](),controller[_0x3f64('0x15')]);router[_0x3f64('0x16')](_0x3f64('0xc'),auth[_0x3f64('0xa')](),controller['destroy']);module[_0x3f64('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 9de0ce5..2f721a3 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 _0x9f2e=['exports','ENUM','incident','phonecall','contact','STRING','BOOLEAN','sequelize'];(function(_0x160cf3,_0x5e117b){var _0x321aeb=function(_0x598952){while(--_0x598952){_0x160cf3['push'](_0x160cf3['shift']());}};_0x321aeb(++_0x5e117b);}(_0x9f2e,0x7f));var _0xe9f2=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9f2e[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require(_0xe9f2('0x0'));module[_0xe9f2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xe9f2('0x2')](_0xe9f2('0x3'),_0xe9f2('0x4')),'defaultValue':_0xe9f2('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0xe9f2('0x5'),'nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xe9f2('0x6')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xe9f2('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc390=['STRING','ENUM','incident','phonecall','contact','nothing','BOOLEAN','sequelize','exports'];(function(_0x2b0464,_0x231a86){var _0x23992b=function(_0x23464e){while(--_0x23464e){_0x2b0464['push'](_0x2b0464['shift']());}};_0x23992b(++_0x231a86);}(_0xc390,0x85));var _0x0c39=function(_0xad132d,_0xe39bac){_0xad132d=_0xad132d-0x0;var _0x4e0963=_0xc390[_0xad132d];return _0x4e0963;};'use strict';var Sequelize=require(_0x0c39('0x0'));module[_0x0c39('0x1')]={'name':{'type':Sequelize[_0x0c39('0x2')]},'description':{'type':Sequelize[_0x0c39('0x2')]},'ticketType':{'type':Sequelize[_0x0c39('0x3')](_0x0c39('0x4'),_0x0c39('0x5')),'defaultValue':_0x0c39('0x4')},'moduleCreate':{'type':Sequelize[_0x0c39('0x3')](_0x0c39('0x6'),_0x0c39('0x7')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x0c39('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x0c39('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index a9a6d1c..295378e 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 _0xd02d=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','body','find','Dynamics365Field','getFields','getSubjects','findOne','order','nolimit','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0xd02d,0xd7));var _0xdd02=function(_0x49408d,_0x590809){_0x49408d=_0x49408d-0x0;var _0x3555f3=_0xd02d[_0x49408d];return _0x3555f3;};'use strict';var emlformat=require(_0xdd02('0x0'));var rimraf=require(_0xdd02('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdd02('0x2'));var moment=require(_0xdd02('0x3'));var BPromise=require(_0xdd02('0x4'));var Mustache=require(_0xdd02('0x5'));var util=require('util');var path=require(_0xdd02('0x6'));var sox=require(_0xdd02('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd02('0x8'));var _=require(_0xdd02('0x9'));var squel=require(_0xdd02('0xa'));var crypto=require(_0xdd02('0xb'));var jsforce=require(_0xdd02('0xc'));var deskjs=require(_0xdd02('0xd'));var toCsv=require(_0xdd02('0xe'));var querystring=require('querystring');var Papa=require(_0xdd02('0xf'));var Redis=require(_0xdd02('0x10'));var authService=require(_0xdd02('0x11'));var qs=require(_0xdd02('0x12'));var as=require(_0xdd02('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd02('0x14'))(_0xdd02('0x15'));var utils=require('../../config/utils');var config=require(_0xdd02('0x16'));var licenseUtil=require(_0xdd02('0x17'));var db=require(_0xdd02('0x18'))['db'];function respondWithStatusCode(_0x13ff2b,_0x12fd6d){_0x12fd6d=_0x12fd6d||0xcc;return function(_0x36694b){if(_0x36694b){return _0x13ff2b[_0xdd02('0x19')](_0x12fd6d);}return _0x13ff2b[_0xdd02('0x1a')](_0x12fd6d)['end']();};}function respondWithResult(_0x1d2600,_0x25fa0c){_0x25fa0c=_0x25fa0c||0xc8;return function(_0x50f2a7){if(_0x50f2a7){return _0x1d2600['status'](_0x25fa0c)[_0xdd02('0x1b')](_0x50f2a7);}};}function respondWithFilteredResult(_0x47ad62,_0x4057db){return function(_0x49ae7a){if(_0x49ae7a){var _0x17fd67=typeof _0x4057db[_0xdd02('0x1c')]===_0xdd02('0x1d')&&typeof _0x4057db[_0xdd02('0x1e')]===_0xdd02('0x1d');var _0x6b03b3=_0x49ae7a[_0xdd02('0x1f')];var _0x13fed1=_0x17fd67?0x0:_0x4057db[_0xdd02('0x1c')];var _0x1ec9d8=_0x17fd67?_0x49ae7a['count']:_0x4057db[_0xdd02('0x1c')]+_0x4057db[_0xdd02('0x1e')];var _0x1c78a8;if(_0x1ec9d8>=_0x6b03b3){_0x1ec9d8=_0x6b03b3;_0x1c78a8=0xc8;}else{_0x1c78a8=0xce;}_0x47ad62['status'](_0x1c78a8);return _0x47ad62[_0xdd02('0x20')](_0xdd02('0x21'),_0x13fed1+'-'+_0x1ec9d8+'/'+_0x6b03b3)[_0xdd02('0x1b')](_0x49ae7a);}return null;};}function patchUpdates(_0x18e5aa){return function(_0x6639ec){try{jsonpatch[_0xdd02('0x22')](_0x6639ec,_0x18e5aa,!![]);}catch(_0x584699){return BPromise[_0xdd02('0x23')](_0x584699);}return _0x6639ec[_0xdd02('0x24')]();};}function saveUpdates(_0x23499b,_0x3a56d1){return function(_0x798ff1){if(_0x798ff1){return _0x798ff1[_0xdd02('0x25')](_0x23499b)[_0xdd02('0x26')](function(_0xa70783){return _0xa70783;});}return null;};}function removeEntity(_0x104687,_0x24e41d){return function(_0x2b83cd){if(_0x2b83cd){return _0x2b83cd[_0xdd02('0x27')]()[_0xdd02('0x26')](function(){_0x104687[_0xdd02('0x1a')](0xcc)[_0xdd02('0x28')]();});}};}function handleEntityNotFound(_0x28a203,_0x30bfe3){return function(_0x52d1f2){if(!_0x52d1f2){_0x28a203[_0xdd02('0x19')](0x194);}return _0x52d1f2;};}function handleError(_0x59d1fb,_0x7af219){_0x7af219=_0x7af219||0x1f4;return function(_0x536333){logger[_0xdd02('0x29')](_0x536333['stack']);if(_0x536333[_0xdd02('0x2a')]){delete _0x536333['name'];}_0x59d1fb[_0xdd02('0x1a')](_0x7af219)['send'](_0x536333);};}exports[_0xdd02('0x2b')]=function(_0x3b530d,_0x445d09){var _0x979357={},_0x5e8b8c={},_0x2588a9={'count':0x0,'rows':[]};var _0x465594=_[_0xdd02('0x2c')](db[_0xdd02('0x2d')][_0xdd02('0x2e')],function(_0x50ff23){return{'name':_0x50ff23[_0xdd02('0x2f')],'type':_0x50ff23[_0xdd02('0x30')][_0xdd02('0x31')]};});_0x5e8b8c[_0xdd02('0x32')]=_[_0xdd02('0x2c')](_0x465594,'name');_0x5e8b8c[_0xdd02('0x33')]=_[_0xdd02('0x34')](_0x3b530d[_0xdd02('0x33')]);_0x5e8b8c['filters']=_['intersection'](_0x5e8b8c[_0xdd02('0x32')],_0x5e8b8c[_0xdd02('0x33')]);_0x979357['attributes']=_[_0xdd02('0x35')](_0x5e8b8c['model'],qs[_0xdd02('0x36')](_0x3b530d[_0xdd02('0x33')][_0xdd02('0x36')]));_0x979357['attributes']=_0x979357['attributes'][_0xdd02('0x37')]?_0x979357[_0xdd02('0x38')]:_0x5e8b8c[_0xdd02('0x32')];if(!_0x3b530d[_0xdd02('0x33')][_0xdd02('0x39')]('nolimit')){_0x979357[_0xdd02('0x1e')]=qs['limit'](_0x3b530d[_0xdd02('0x33')][_0xdd02('0x1e')]);_0x979357[_0xdd02('0x1c')]=qs[_0xdd02('0x1c')](_0x3b530d['query'][_0xdd02('0x1c')]);}_0x979357['order']=qs[_0xdd02('0x3a')](_0x3b530d[_0xdd02('0x33')][_0xdd02('0x3a')]);_0x979357['where']=qs[_0xdd02('0x3b')](_[_0xdd02('0x3c')](_0x3b530d[_0xdd02('0x33')],_0x5e8b8c[_0xdd02('0x3b')]),_0x465594);if(_0x3b530d[_0xdd02('0x33')][_0xdd02('0x3d')]){_0x979357[_0xdd02('0x3e')]=_[_0xdd02('0x3f')](_0x979357['where'],{'$or':_[_0xdd02('0x2c')](_0x465594,function(_0x1f0e9d){if(_0x1f0e9d[_0xdd02('0x30')]!==_0xdd02('0x40')){var _0x3b3c80={};_0x3b3c80[_0x1f0e9d[_0xdd02('0x2a')]]={'$like':'%'+_0x3b530d[_0xdd02('0x33')]['filter']+'%'};return _0x3b3c80;}})});}_0x979357=_[_0xdd02('0x3f')]({},_0x979357,_0x3b530d[_0xdd02('0x41')]);var _0x4966ec={'where':_0x979357[_0xdd02('0x3e')]};return db[_0xdd02('0x2d')][_0xdd02('0x1f')](_0x4966ec)[_0xdd02('0x26')](function(_0x3d21da){_0x2588a9[_0xdd02('0x1f')]=_0x3d21da;if(_0x3b530d['query'][_0xdd02('0x42')]){_0x979357['include']=[{'all':!![]}];}return db[_0xdd02('0x2d')][_0xdd02('0x43')](_0x979357);})[_0xdd02('0x26')](function(_0xa56b6e){_0x2588a9['rows']=_0xa56b6e;return _0x2588a9;})[_0xdd02('0x26')](respondWithFilteredResult(_0x445d09,_0x979357))[_0xdd02('0x44')](handleError(_0x445d09,null));};exports[_0xdd02('0x45')]=function(_0x4065fb,_0x14c927){var _0x9d94ae={'raw':![],'where':{'id':_0x4065fb[_0xdd02('0x46')]['id']}},_0x45e4f9={};_0x45e4f9[_0xdd02('0x32')]=_[_0xdd02('0x34')](db[_0xdd02('0x2d')][_0xdd02('0x2e')]);_0x45e4f9[_0xdd02('0x33')]=_[_0xdd02('0x34')](_0x4065fb[_0xdd02('0x33')]);_0x45e4f9[_0xdd02('0x3b')]=_[_0xdd02('0x35')](_0x45e4f9[_0xdd02('0x32')],_0x45e4f9['query']);_0x9d94ae[_0xdd02('0x38')]=_['intersection'](_0x45e4f9[_0xdd02('0x32')],qs[_0xdd02('0x36')](_0x4065fb[_0xdd02('0x33')][_0xdd02('0x36')]));_0x9d94ae['attributes']=_0x9d94ae['attributes'][_0xdd02('0x37')]?_0x9d94ae[_0xdd02('0x38')]:_0x45e4f9[_0xdd02('0x32')];if(_0x4065fb[_0xdd02('0x33')][_0xdd02('0x42')]){_0x9d94ae['include']=[{'all':!![]}];}_0x9d94ae=_[_0xdd02('0x3f')]({},_0x9d94ae,_0x4065fb[_0xdd02('0x41')]);return db['Dynamics365Configuration']['find'](_0x9d94ae)[_0xdd02('0x26')](handleEntityNotFound(_0x14c927,null))[_0xdd02('0x26')](respondWithResult(_0x14c927,null))[_0xdd02('0x44')](handleError(_0x14c927,null));};exports['create']=function(_0x5f47df,_0x4e4f33){return db['Dynamics365Configuration']['create'](_0x5f47df[_0xdd02('0x47')],{})['then'](respondWithResult(_0x4e4f33,0xc9))[_0xdd02('0x44')](handleError(_0x4e4f33,null));};exports[_0xdd02('0x25')]=function(_0x12f4fc,_0x48f4e0){if(_0x12f4fc['body']['id']){delete _0x12f4fc[_0xdd02('0x47')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x12f4fc['params']['id']}})[_0xdd02('0x26')](handleEntityNotFound(_0x48f4e0,null))[_0xdd02('0x26')](saveUpdates(_0x12f4fc[_0xdd02('0x47')],null))['then'](respondWithResult(_0x48f4e0,null))[_0xdd02('0x44')](handleError(_0x48f4e0,null));};exports[_0xdd02('0x27')]=function(_0x4a2fb0,_0x32a83d){return db['Dynamics365Configuration'][_0xdd02('0x48')]({'where':{'id':_0x4a2fb0[_0xdd02('0x46')]['id']}})['then'](handleEntityNotFound(_0x32a83d,null))['then'](removeEntity(_0x32a83d,null))['catch'](handleError(_0x32a83d,null));};exports['getFields']=function(_0xc8c17b,_0x5bf617,_0x560415){var _0x5ced47={};var _0xf6a385={};var _0x2b521a;var _0x33e58d;return db[_0xdd02('0x2d')]['findOne']({'where':{'id':_0xc8c17b['params']['id']}})[_0xdd02('0x26')](handleEntityNotFound(_0x5bf617,null))[_0xdd02('0x26')](function(_0x4a318d){if(_0x4a318d){_0x2b521a=_0x4a318d;_0xf6a385[_0xdd02('0x32')]=_[_0xdd02('0x34')](db[_0xdd02('0x49')][_0xdd02('0x2e')]);_0xf6a385[_0xdd02('0x33')]=_[_0xdd02('0x34')](_0xc8c17b['query']);_0xf6a385[_0xdd02('0x3b')]=_['intersection'](_0xf6a385[_0xdd02('0x32')],_0xf6a385[_0xdd02('0x33')]);_0x5ced47['attributes']=_['intersection'](_0xf6a385['model'],qs[_0xdd02('0x36')](_0xc8c17b[_0xdd02('0x33')][_0xdd02('0x36')]));_0x5ced47['attributes']=_0x5ced47[_0xdd02('0x38')][_0xdd02('0x37')]?_0x5ced47[_0xdd02('0x38')]:_0xf6a385['model'];_0x5ced47['order']=qs[_0xdd02('0x3a')](_0xc8c17b[_0xdd02('0x33')][_0xdd02('0x3a')]);_0x5ced47['where']=qs[_0xdd02('0x3b')](_[_0xdd02('0x3c')](_0xc8c17b[_0xdd02('0x33')],_0xf6a385[_0xdd02('0x3b')]));if(_0xc8c17b['query'][_0xdd02('0x3d')]){_0x5ced47[_0xdd02('0x3e')]=_[_0xdd02('0x3f')](_0x5ced47[_0xdd02('0x3e')],{'$or':_[_0xdd02('0x2c')](_0x5ced47[_0xdd02('0x38')],function(_0x585f58){var _0x21deab={};_0x21deab[_0x585f58]={'$like':'%'+_0xc8c17b[_0xdd02('0x33')][_0xdd02('0x3d')]+'%'};return _0x21deab;})});}_0x5ced47=_[_0xdd02('0x3f')]({},_0x5ced47,_0xc8c17b[_0xdd02('0x41')]);return _0x2b521a[_0xdd02('0x4a')](_0x5ced47);}})[_0xdd02('0x26')](function(_0x37df32){if(_0x37df32){_0x33e58d=_0x37df32[_0xdd02('0x37')];if(!_0xc8c17b[_0xdd02('0x33')][_0xdd02('0x39')]('nolimit')){_0x5ced47[_0xdd02('0x1e')]=qs[_0xdd02('0x1e')](_0xc8c17b[_0xdd02('0x33')][_0xdd02('0x1e')]);_0x5ced47[_0xdd02('0x1c')]=qs[_0xdd02('0x1c')](_0xc8c17b[_0xdd02('0x33')][_0xdd02('0x1c')]);}return _0x2b521a[_0xdd02('0x4a')](_0x5ced47);}})[_0xdd02('0x26')](function(_0x2486db){if(_0x2486db){return _0x2486db?{'count':_0x33e58d,'rows':_0x2486db}:null;}})[_0xdd02('0x26')](respondWithResult(_0x5bf617,null))['catch'](handleError(_0x5bf617,null));};exports[_0xdd02('0x4b')]=function(_0xedea6f,_0xca429a,_0x12c467){var _0x55a78e={};var _0x2aed89={};var _0x3f5509;var _0x4c4639;return db[_0xdd02('0x2d')][_0xdd02('0x4c')]({'where':{'id':_0xedea6f['params']['id']}})['then'](handleEntityNotFound(_0xca429a,null))[_0xdd02('0x26')](function(_0x49e72e){if(_0x49e72e){_0x3f5509=_0x49e72e;_0x2aed89['model']=_['keys'](db['Dynamics365Field'][_0xdd02('0x2e')]);_0x2aed89[_0xdd02('0x33')]=_[_0xdd02('0x34')](_0xedea6f[_0xdd02('0x33')]);_0x2aed89['filters']=_[_0xdd02('0x35')](_0x2aed89['model'],_0x2aed89[_0xdd02('0x33')]);_0x55a78e[_0xdd02('0x38')]=_[_0xdd02('0x35')](_0x2aed89[_0xdd02('0x32')],qs[_0xdd02('0x36')](_0xedea6f[_0xdd02('0x33')][_0xdd02('0x36')]));_0x55a78e[_0xdd02('0x38')]=_0x55a78e['attributes']['length']?_0x55a78e[_0xdd02('0x38')]:_0x2aed89[_0xdd02('0x32')];_0x55a78e[_0xdd02('0x4d')]=qs[_0xdd02('0x3a')](_0xedea6f['query'][_0xdd02('0x3a')]);_0x55a78e[_0xdd02('0x3e')]=qs[_0xdd02('0x3b')](_[_0xdd02('0x3c')](_0xedea6f[_0xdd02('0x33')],_0x2aed89['filters']));if(_0xedea6f['query'][_0xdd02('0x3d')]){_0x55a78e[_0xdd02('0x3e')]=_['merge'](_0x55a78e[_0xdd02('0x3e')],{'$or':_['map'](_0x55a78e[_0xdd02('0x38')],function(_0x218eb6){var _0x3196d2={};_0x3196d2[_0x218eb6]={'$like':'%'+_0xedea6f[_0xdd02('0x33')][_0xdd02('0x3d')]+'%'};return _0x3196d2;})});}_0x55a78e=_[_0xdd02('0x3f')]({},_0x55a78e,_0xedea6f[_0xdd02('0x41')]);return _0x3f5509[_0xdd02('0x4b')](_0x55a78e);}})[_0xdd02('0x26')](function(_0x3ee776){if(_0x3ee776){_0x4c4639=_0x3ee776[_0xdd02('0x37')];if(!_0xedea6f[_0xdd02('0x33')][_0xdd02('0x39')](_0xdd02('0x4e'))){_0x55a78e[_0xdd02('0x1e')]=qs['limit'](_0xedea6f['query'][_0xdd02('0x1e')]);_0x55a78e['offset']=qs[_0xdd02('0x1c')](_0xedea6f[_0xdd02('0x33')]['offset']);}return _0x3f5509[_0xdd02('0x4b')](_0x55a78e);}})[_0xdd02('0x26')](function(_0x2b3fc7){if(_0x2b3fc7){return _0x2b3fc7?{'count':_0x4c4639,'rows':_0x2b3fc7}:null;}})[_0xdd02('0x26')](respondWithResult(_0xca429a,null))['catch'](handleError(_0xca429a,null));};exports[_0xdd02('0x4f')]=function(_0x8432b9,_0x3289e1,_0x3682ed){var _0x216ce1={};var _0x3d7914={};var _0x48eebd;var _0x9e0d2c;return db[_0xdd02('0x2d')][_0xdd02('0x4c')]({'where':{'id':_0x8432b9['params']['id']}})['then'](handleEntityNotFound(_0x3289e1,null))[_0xdd02('0x26')](function(_0x1b45cc){if(_0x1b45cc){_0x48eebd=_0x1b45cc;_0x3d7914[_0xdd02('0x32')]=_[_0xdd02('0x34')](db[_0xdd02('0x49')]['rawAttributes']);_0x3d7914[_0xdd02('0x33')]=_[_0xdd02('0x34')](_0x8432b9[_0xdd02('0x33')]);_0x3d7914[_0xdd02('0x3b')]=_[_0xdd02('0x35')](_0x3d7914[_0xdd02('0x32')],_0x3d7914[_0xdd02('0x33')]);_0x216ce1[_0xdd02('0x38')]=_[_0xdd02('0x35')](_0x3d7914['model'],qs[_0xdd02('0x36')](_0x8432b9[_0xdd02('0x33')][_0xdd02('0x36')]));_0x216ce1[_0xdd02('0x38')]=_0x216ce1[_0xdd02('0x38')][_0xdd02('0x37')]?_0x216ce1[_0xdd02('0x38')]:_0x3d7914[_0xdd02('0x32')];_0x216ce1['order']=qs[_0xdd02('0x3a')](_0x8432b9['query'][_0xdd02('0x3a')]);_0x216ce1[_0xdd02('0x3e')]=qs['filters'](_[_0xdd02('0x3c')](_0x8432b9[_0xdd02('0x33')],_0x3d7914['filters']));if(_0x8432b9[_0xdd02('0x33')][_0xdd02('0x3d')]){_0x216ce1['where']=_[_0xdd02('0x3f')](_0x216ce1['where'],{'$or':_[_0xdd02('0x2c')](_0x216ce1[_0xdd02('0x38')],function(_0x92dd49){var _0x3abb14={};_0x3abb14[_0x92dd49]={'$like':'%'+_0x8432b9[_0xdd02('0x33')][_0xdd02('0x3d')]+'%'};return _0x3abb14;})});}_0x216ce1=_[_0xdd02('0x3f')]({},_0x216ce1,_0x8432b9[_0xdd02('0x41')]);return _0x48eebd[_0xdd02('0x4f')](_0x216ce1);}})['then'](function(_0x54925a){if(_0x54925a){_0x9e0d2c=_0x54925a[_0xdd02('0x37')];if(!_0x8432b9['query'][_0xdd02('0x39')](_0xdd02('0x4e'))){_0x216ce1[_0xdd02('0x1e')]=qs[_0xdd02('0x1e')](_0x8432b9['query']['limit']);_0x216ce1['offset']=qs[_0xdd02('0x1c')](_0x8432b9[_0xdd02('0x33')][_0xdd02('0x1c')]);}return _0x48eebd[_0xdd02('0x4f')](_0x216ce1);}})[_0xdd02('0x26')](function(_0x39221e){if(_0x39221e){return _0x39221e?{'count':_0x9e0d2c,'rows':_0x39221e}:null;}})[_0xdd02('0x26')](respondWithResult(_0x3289e1,null))[_0xdd02('0x44')](handleError(_0x3289e1,null));}; \ No newline at end of file +var _0x0140=['pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','find','catch','body','params','getFields','Dynamics365Field','rawAttributes','getSubjects','findOne','hasOwnProperty','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','Dynamics365Configuration','fieldName','type','model','map','name','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort'];(function(_0x12bae4,_0x2b3a75){var _0x263880=function(_0x2cc494){while(--_0x2cc494){_0x12bae4['push'](_0x12bae4['shift']());}};_0x263880(++_0x2b3a75);}(_0x0140,0x64));var _0x0014=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x0140[_0x556bb1];return _0x45455f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0014('0x0'));var zipdir=require(_0x0014('0x1'));var jsonpatch=require(_0x0014('0x2'));var rp=require(_0x0014('0x3'));var moment=require(_0x0014('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0014('0x5'));var util=require(_0x0014('0x6'));var path=require(_0x0014('0x7'));var sox=require(_0x0014('0x8'));var csv=require('to-csv');var ejs=require(_0x0014('0x9'));var fs=require('fs');var fs_extra=require(_0x0014('0xa'));var _=require('lodash');var squel=require(_0x0014('0xb'));var crypto=require(_0x0014('0xc'));var jsforce=require(_0x0014('0xd'));var deskjs=require(_0x0014('0xe'));var toCsv=require(_0x0014('0xf'));var querystring=require('querystring');var Papa=require(_0x0014('0x10'));var Redis=require(_0x0014('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0014('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0014('0x13'));var logger=require('../../config/logger')(_0x0014('0x14'));var utils=require(_0x0014('0x15'));var config=require(_0x0014('0x16'));var licenseUtil=require(_0x0014('0x17'));var db=require(_0x0014('0x18'))['db'];function respondWithStatusCode(_0x2dd295,_0x14571a){_0x14571a=_0x14571a||0xcc;return function(_0x349769){if(_0x349769){return _0x2dd295[_0x0014('0x19')](_0x14571a);}return _0x2dd295[_0x0014('0x1a')](_0x14571a)[_0x0014('0x1b')]();};}function respondWithResult(_0xc889af,_0x2a2746){_0x2a2746=_0x2a2746||0xc8;return function(_0x52f4d0){if(_0x52f4d0){return _0xc889af[_0x0014('0x1a')](_0x2a2746)[_0x0014('0x1c')](_0x52f4d0);}};}function respondWithFilteredResult(_0x358624,_0x27ce23){return function(_0x1ba45d){if(_0x1ba45d){var _0x13ee16=typeof _0x27ce23[_0x0014('0x1d')]===_0x0014('0x1e')&&typeof _0x27ce23[_0x0014('0x1f')]===_0x0014('0x1e');var _0x2023df=_0x1ba45d[_0x0014('0x20')];var _0x1ccebe=_0x13ee16?0x0:_0x27ce23['offset'];var _0x4cf27d=_0x13ee16?_0x1ba45d[_0x0014('0x20')]:_0x27ce23[_0x0014('0x1d')]+_0x27ce23['limit'];var _0x3c2fb0;if(_0x4cf27d>=_0x2023df){_0x4cf27d=_0x2023df;_0x3c2fb0=0xc8;}else{_0x3c2fb0=0xce;}_0x358624['status'](_0x3c2fb0);return _0x358624[_0x0014('0x21')](_0x0014('0x22'),_0x1ccebe+'-'+_0x4cf27d+'/'+_0x2023df)['json'](_0x1ba45d);}return null;};}function patchUpdates(_0x57710f){return function(_0x27d4f0){try{jsonpatch[_0x0014('0x23')](_0x27d4f0,_0x57710f,!![]);}catch(_0x1da188){return BPromise[_0x0014('0x24')](_0x1da188);}return _0x27d4f0[_0x0014('0x25')]();};}function saveUpdates(_0x331926,_0x402226){return function(_0xe48f36){if(_0xe48f36){return _0xe48f36[_0x0014('0x26')](_0x331926)[_0x0014('0x27')](function(_0x4a91e3){return _0x4a91e3;});}return null;};}function removeEntity(_0x23ebb5,_0x12cbe5){return function(_0x14450b){if(_0x14450b){return _0x14450b[_0x0014('0x28')]()['then'](function(){_0x23ebb5['status'](0xcc)[_0x0014('0x1b')]();});}};}function handleEntityNotFound(_0x2c344d,_0x1e18e5){return function(_0x397c){if(!_0x397c){_0x2c344d['sendStatus'](0x194);}return _0x397c;};}function handleError(_0x1b5a1e,_0x2c191b){_0x2c191b=_0x2c191b||0x1f4;return function(_0x40e9ef){logger['error'](_0x40e9ef[_0x0014('0x29')]);if(_0x40e9ef['name']){delete _0x40e9ef['name'];}_0x1b5a1e[_0x0014('0x1a')](_0x2c191b)[_0x0014('0x2a')](_0x40e9ef);};}exports[_0x0014('0x2b')]=function(_0x4f9b3e,_0x527f49){var _0x4fe818={},_0x3fb48e={},_0x5ca3ea={'count':0x0,'rows':[]};var _0x525997=_['map'](db[_0x0014('0x2c')]['rawAttributes'],function(_0xe70489){return{'name':_0xe70489[_0x0014('0x2d')],'type':_0xe70489[_0x0014('0x2e')]['key']};});_0x3fb48e[_0x0014('0x2f')]=_[_0x0014('0x30')](_0x525997,_0x0014('0x31'));_0x3fb48e['query']=_[_0x0014('0x32')](_0x4f9b3e[_0x0014('0x33')]);_0x3fb48e[_0x0014('0x34')]=_[_0x0014('0x35')](_0x3fb48e[_0x0014('0x2f')],_0x3fb48e[_0x0014('0x33')]);_0x4fe818['attributes']=_[_0x0014('0x35')](_0x3fb48e[_0x0014('0x2f')],qs[_0x0014('0x36')](_0x4f9b3e[_0x0014('0x33')][_0x0014('0x36')]));_0x4fe818[_0x0014('0x37')]=_0x4fe818[_0x0014('0x37')][_0x0014('0x38')]?_0x4fe818[_0x0014('0x37')]:_0x3fb48e[_0x0014('0x2f')];if(!_0x4f9b3e['query']['hasOwnProperty'](_0x0014('0x39'))){_0x4fe818[_0x0014('0x1f')]=qs[_0x0014('0x1f')](_0x4f9b3e[_0x0014('0x33')][_0x0014('0x1f')]);_0x4fe818['offset']=qs[_0x0014('0x1d')](_0x4f9b3e['query'][_0x0014('0x1d')]);}_0x4fe818[_0x0014('0x3a')]=qs[_0x0014('0x3b')](_0x4f9b3e[_0x0014('0x33')][_0x0014('0x3b')]);_0x4fe818['where']=qs[_0x0014('0x34')](_[_0x0014('0x3c')](_0x4f9b3e[_0x0014('0x33')],_0x3fb48e[_0x0014('0x34')]),_0x525997);if(_0x4f9b3e[_0x0014('0x33')][_0x0014('0x3d')]){_0x4fe818[_0x0014('0x3e')]=_[_0x0014('0x3f')](_0x4fe818[_0x0014('0x3e')],{'$or':_['map'](_0x525997,function(_0x217d37){if(_0x217d37[_0x0014('0x2e')]!==_0x0014('0x40')){var _0x2c87b8={};_0x2c87b8[_0x217d37[_0x0014('0x31')]]={'$like':'%'+_0x4f9b3e['query']['filter']+'%'};return _0x2c87b8;}})});}_0x4fe818=_[_0x0014('0x3f')]({},_0x4fe818,_0x4f9b3e[_0x0014('0x41')]);var _0x58ce6d={'where':_0x4fe818[_0x0014('0x3e')]};return db['Dynamics365Configuration'][_0x0014('0x20')](_0x58ce6d)[_0x0014('0x27')](function(_0x5165a){_0x5ca3ea['count']=_0x5165a;if(_0x4f9b3e[_0x0014('0x33')][_0x0014('0x42')]){_0x4fe818['include']=[{'all':!![]}];}return db[_0x0014('0x2c')][_0x0014('0x43')](_0x4fe818);})['then'](function(_0x58e4fe){_0x5ca3ea['rows']=_0x58e4fe;return _0x5ca3ea;})[_0x0014('0x27')](respondWithFilteredResult(_0x527f49,_0x4fe818))['catch'](handleError(_0x527f49,null));};exports[_0x0014('0x44')]=function(_0x21be31,_0x4f2a21){var _0x1e43d9={'raw':![],'where':{'id':_0x21be31['params']['id']}},_0x56ecba={};_0x56ecba['model']=_[_0x0014('0x32')](db['Dynamics365Configuration']['rawAttributes']);_0x56ecba[_0x0014('0x33')]=_[_0x0014('0x32')](_0x21be31[_0x0014('0x33')]);_0x56ecba[_0x0014('0x34')]=_[_0x0014('0x35')](_0x56ecba[_0x0014('0x2f')],_0x56ecba[_0x0014('0x33')]);_0x1e43d9['attributes']=_[_0x0014('0x35')](_0x56ecba['model'],qs[_0x0014('0x36')](_0x21be31['query'][_0x0014('0x36')]));_0x1e43d9[_0x0014('0x37')]=_0x1e43d9[_0x0014('0x37')][_0x0014('0x38')]?_0x1e43d9['attributes']:_0x56ecba['model'];if(_0x21be31[_0x0014('0x33')][_0x0014('0x42')]){_0x1e43d9['include']=[{'all':!![]}];}_0x1e43d9=_[_0x0014('0x3f')]({},_0x1e43d9,_0x21be31['options']);return db[_0x0014('0x2c')][_0x0014('0x45')](_0x1e43d9)[_0x0014('0x27')](handleEntityNotFound(_0x4f2a21,null))['then'](respondWithResult(_0x4f2a21,null))[_0x0014('0x46')](handleError(_0x4f2a21,null));};exports['create']=function(_0x204abe,_0xc55717){return db[_0x0014('0x2c')]['create'](_0x204abe['body'],{})[_0x0014('0x27')](respondWithResult(_0xc55717,0xc9))[_0x0014('0x46')](handleError(_0xc55717,null));};exports['update']=function(_0x409612,_0x1039fc){if(_0x409612[_0x0014('0x47')]['id']){delete _0x409612['body']['id'];}return db[_0x0014('0x2c')][_0x0014('0x45')]({'where':{'id':_0x409612['params']['id']}})[_0x0014('0x27')](handleEntityNotFound(_0x1039fc,null))[_0x0014('0x27')](saveUpdates(_0x409612[_0x0014('0x47')],null))[_0x0014('0x27')](respondWithResult(_0x1039fc,null))[_0x0014('0x46')](handleError(_0x1039fc,null));};exports[_0x0014('0x28')]=function(_0x1d4488,_0x4aeb0e){return db['Dynamics365Configuration'][_0x0014('0x45')]({'where':{'id':_0x1d4488[_0x0014('0x48')]['id']}})[_0x0014('0x27')](handleEntityNotFound(_0x4aeb0e,null))['then'](removeEntity(_0x4aeb0e,null))[_0x0014('0x46')](handleError(_0x4aeb0e,null));};exports[_0x0014('0x49')]=function(_0xd0f348,_0x1b4ca1,_0x3a49d4){var _0x15a197={};var _0x4c14bd={};var _0x467612;var _0x48d782;return db[_0x0014('0x2c')]['findOne']({'where':{'id':_0xd0f348[_0x0014('0x48')]['id']}})[_0x0014('0x27')](handleEntityNotFound(_0x1b4ca1,null))['then'](function(_0x2de40b){if(_0x2de40b){_0x467612=_0x2de40b;_0x4c14bd['model']=_[_0x0014('0x32')](db[_0x0014('0x4a')][_0x0014('0x4b')]);_0x4c14bd[_0x0014('0x33')]=_['keys'](_0xd0f348['query']);_0x4c14bd['filters']=_['intersection'](_0x4c14bd['model'],_0x4c14bd[_0x0014('0x33')]);_0x15a197['attributes']=_[_0x0014('0x35')](_0x4c14bd[_0x0014('0x2f')],qs[_0x0014('0x36')](_0xd0f348[_0x0014('0x33')][_0x0014('0x36')]));_0x15a197[_0x0014('0x37')]=_0x15a197['attributes'][_0x0014('0x38')]?_0x15a197['attributes']:_0x4c14bd[_0x0014('0x2f')];_0x15a197[_0x0014('0x3a')]=qs[_0x0014('0x3b')](_0xd0f348[_0x0014('0x33')][_0x0014('0x3b')]);_0x15a197[_0x0014('0x3e')]=qs[_0x0014('0x34')](_[_0x0014('0x3c')](_0xd0f348[_0x0014('0x33')],_0x4c14bd[_0x0014('0x34')]));if(_0xd0f348[_0x0014('0x33')]['filter']){_0x15a197[_0x0014('0x3e')]=_[_0x0014('0x3f')](_0x15a197[_0x0014('0x3e')],{'$or':_[_0x0014('0x30')](_0x15a197[_0x0014('0x37')],function(_0x1f10d8){var _0x1b8d8a={};_0x1b8d8a[_0x1f10d8]={'$like':'%'+_0xd0f348[_0x0014('0x33')][_0x0014('0x3d')]+'%'};return _0x1b8d8a;})});}_0x15a197=_[_0x0014('0x3f')]({},_0x15a197,_0xd0f348['options']);return _0x467612[_0x0014('0x49')](_0x15a197);}})['then'](function(_0x2d3699){if(_0x2d3699){_0x48d782=_0x2d3699['length'];if(!_0xd0f348[_0x0014('0x33')]['hasOwnProperty'](_0x0014('0x39'))){_0x15a197[_0x0014('0x1f')]=qs[_0x0014('0x1f')](_0xd0f348[_0x0014('0x33')]['limit']);_0x15a197[_0x0014('0x1d')]=qs[_0x0014('0x1d')](_0xd0f348['query'][_0x0014('0x1d')]);}return _0x467612['getFields'](_0x15a197);}})['then'](function(_0x118830){if(_0x118830){return _0x118830?{'count':_0x48d782,'rows':_0x118830}:null;}})[_0x0014('0x27')](respondWithResult(_0x1b4ca1,null))[_0x0014('0x46')](handleError(_0x1b4ca1,null));};exports[_0x0014('0x4c')]=function(_0x29f39a,_0xe6ae9a,_0x13b11f){var _0x4f6870={};var _0x2c1c79={};var _0x195ef9;var _0x283205;return db[_0x0014('0x2c')][_0x0014('0x4d')]({'where':{'id':_0x29f39a[_0x0014('0x48')]['id']}})[_0x0014('0x27')](handleEntityNotFound(_0xe6ae9a,null))[_0x0014('0x27')](function(_0x1b201c){if(_0x1b201c){_0x195ef9=_0x1b201c;_0x2c1c79[_0x0014('0x2f')]=_['keys'](db[_0x0014('0x4a')][_0x0014('0x4b')]);_0x2c1c79[_0x0014('0x33')]=_[_0x0014('0x32')](_0x29f39a[_0x0014('0x33')]);_0x2c1c79[_0x0014('0x34')]=_[_0x0014('0x35')](_0x2c1c79['model'],_0x2c1c79['query']);_0x4f6870[_0x0014('0x37')]=_['intersection'](_0x2c1c79[_0x0014('0x2f')],qs[_0x0014('0x36')](_0x29f39a[_0x0014('0x33')]['fields']));_0x4f6870[_0x0014('0x37')]=_0x4f6870[_0x0014('0x37')]['length']?_0x4f6870['attributes']:_0x2c1c79[_0x0014('0x2f')];_0x4f6870['order']=qs['sort'](_0x29f39a[_0x0014('0x33')]['sort']);_0x4f6870['where']=qs[_0x0014('0x34')](_[_0x0014('0x3c')](_0x29f39a[_0x0014('0x33')],_0x2c1c79[_0x0014('0x34')]));if(_0x29f39a[_0x0014('0x33')][_0x0014('0x3d')]){_0x4f6870[_0x0014('0x3e')]=_[_0x0014('0x3f')](_0x4f6870[_0x0014('0x3e')],{'$or':_[_0x0014('0x30')](_0x4f6870[_0x0014('0x37')],function(_0x2590b7){var _0x402a6e={};_0x402a6e[_0x2590b7]={'$like':'%'+_0x29f39a[_0x0014('0x33')][_0x0014('0x3d')]+'%'};return _0x402a6e;})});}_0x4f6870=_[_0x0014('0x3f')]({},_0x4f6870,_0x29f39a['options']);return _0x195ef9[_0x0014('0x4c')](_0x4f6870);}})[_0x0014('0x27')](function(_0x4b6466){if(_0x4b6466){_0x283205=_0x4b6466['length'];if(!_0x29f39a[_0x0014('0x33')][_0x0014('0x4e')](_0x0014('0x39'))){_0x4f6870['limit']=qs[_0x0014('0x1f')](_0x29f39a[_0x0014('0x33')][_0x0014('0x1f')]);_0x4f6870[_0x0014('0x1d')]=qs[_0x0014('0x1d')](_0x29f39a[_0x0014('0x33')]['offset']);}return _0x195ef9[_0x0014('0x4c')](_0x4f6870);}})[_0x0014('0x27')](function(_0x5411b4){if(_0x5411b4){return _0x5411b4?{'count':_0x283205,'rows':_0x5411b4}:null;}})['then'](respondWithResult(_0xe6ae9a,null))[_0x0014('0x46')](handleError(_0xe6ae9a,null));};exports['getDescriptions']=function(_0x16f279,_0x2ca8dd,_0x47b70f){var _0x444246={};var _0x3e2e5b={};var _0xfe8625;var _0x7b9f;return db[_0x0014('0x2c')]['findOne']({'where':{'id':_0x16f279[_0x0014('0x48')]['id']}})[_0x0014('0x27')](handleEntityNotFound(_0x2ca8dd,null))[_0x0014('0x27')](function(_0x1e3f4a){if(_0x1e3f4a){_0xfe8625=_0x1e3f4a;_0x3e2e5b[_0x0014('0x2f')]=_[_0x0014('0x32')](db[_0x0014('0x4a')][_0x0014('0x4b')]);_0x3e2e5b['query']=_[_0x0014('0x32')](_0x16f279[_0x0014('0x33')]);_0x3e2e5b[_0x0014('0x34')]=_[_0x0014('0x35')](_0x3e2e5b[_0x0014('0x2f')],_0x3e2e5b['query']);_0x444246[_0x0014('0x37')]=_[_0x0014('0x35')](_0x3e2e5b[_0x0014('0x2f')],qs[_0x0014('0x36')](_0x16f279[_0x0014('0x33')]['fields']));_0x444246[_0x0014('0x37')]=_0x444246['attributes'][_0x0014('0x38')]?_0x444246['attributes']:_0x3e2e5b['model'];_0x444246[_0x0014('0x3a')]=qs['sort'](_0x16f279[_0x0014('0x33')][_0x0014('0x3b')]);_0x444246[_0x0014('0x3e')]=qs[_0x0014('0x34')](_[_0x0014('0x3c')](_0x16f279['query'],_0x3e2e5b['filters']));if(_0x16f279[_0x0014('0x33')]['filter']){_0x444246[_0x0014('0x3e')]=_['merge'](_0x444246['where'],{'$or':_[_0x0014('0x30')](_0x444246['attributes'],function(_0x21899e){var _0x3a7bae={};_0x3a7bae[_0x21899e]={'$like':'%'+_0x16f279[_0x0014('0x33')][_0x0014('0x3d')]+'%'};return _0x3a7bae;})});}_0x444246=_[_0x0014('0x3f')]({},_0x444246,_0x16f279['options']);return _0xfe8625[_0x0014('0x4f')](_0x444246);}})[_0x0014('0x27')](function(_0x2921e5){if(_0x2921e5){_0x7b9f=_0x2921e5[_0x0014('0x38')];if(!_0x16f279[_0x0014('0x33')][_0x0014('0x4e')](_0x0014('0x39'))){_0x444246[_0x0014('0x1f')]=qs[_0x0014('0x1f')](_0x16f279['query']['limit']);_0x444246[_0x0014('0x1d')]=qs[_0x0014('0x1d')](_0x16f279[_0x0014('0x33')][_0x0014('0x1d')]);}return _0xfe8625['getDescriptions'](_0x444246);}})[_0x0014('0x27')](function(_0x2826a5){if(_0x2826a5){return _0x2826a5?{'count':_0x7b9f,'rows':_0x2826a5}:null;}})[_0x0014('0x27')](respondWithResult(_0x2ca8dd,null))[_0x0014('0x46')](handleError(_0x2ca8dd,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 062ff5b..54b8330 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 _0xe14d=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','int_dynamics365_configurations','lodash'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe14d,0x1ee));var _0xde14=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xe14d[_0x53cf8e];return _0x459197;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('Dynamics365Configuration',attributes,{'tableName':_0xde14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x26b3c7,_0x2741f5){var _0x1fae93=function(_0x5d93b6){while(--_0x5d93b6){_0x26b3c7['push'](_0x26b3c7['shift']());}};_0x1fae93(++_0x2741f5);}(_0x00bb,0x1d8));var _0xb00b=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x00bb[_0x411add];return _0x238242;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'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 6aa5ac3..f864e5e 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 _0xe098=['rpc','../../config/environment','http','request','then','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger'];(function(_0x2ff99a,_0x4a864a){var _0x21caed=function(_0x3cf15e){while(--_0x3cf15e){_0x2ff99a['push'](_0x2ff99a['shift']());}};_0x21caed(++_0x4a864a);}(_0xe098,0x19c));var _0x8e09=function(_0x162507,_0x5bbb09){_0x162507=_0x162507-0x0;var _0x5b0da6=_0xe098[_0x162507];return _0x5b0da6;};'use strict';var _=require(_0x8e09('0x0'));var util=require(_0x8e09('0x1'));var moment=require(_0x8e09('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e09('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e09('0x4'));var logger=require(_0x8e09('0x5'))(_0x8e09('0x6'));var config=require(_0x8e09('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8e09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd9f20f,_0x5a0605,_0x5f69ba){return new BPromise(function(_0x22f42d,_0x20eb35){return client[_0x8e09('0x9')](_0xd9f20f,_0x5f69ba)[_0x8e09('0xa')](function(_0x41bb74){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x5a0605,_0x8e09('0xb'));logger[_0x8e09('0xc')](_0x8e09('0xd'),_0x5a0605,_0x8e09('0xb'),JSON[_0x8e09('0xe')](_0x41bb74));if(_0x41bb74[_0x8e09('0xf')]){if(_0x41bb74[_0x8e09('0xf')][_0x8e09('0x10')]===0x1f4){logger[_0x8e09('0xf')](_0x8e09('0x11'),_0x5a0605,_0x41bb74['error']['message']);return _0x20eb35(_0x41bb74[_0x8e09('0xf')][_0x8e09('0x12')]);}logger[_0x8e09('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5a0605,_0x41bb74[_0x8e09('0xf')][_0x8e09('0x12')]);return _0x22f42d(_0x41bb74[_0x8e09('0xf')][_0x8e09('0x12')]);}else{logger[_0x8e09('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5a0605,_0x8e09('0xb'));_0x22f42d(_0x41bb74[_0x8e09('0x14')][_0x8e09('0x12')]);}})[_0x8e09('0x15')](function(_0x2805a5){logger[_0x8e09('0xf')](_0x8e09('0x11'),_0x5a0605,_0x2805a5);_0x20eb35(_0x2805a5);});});} \ No newline at end of file +var _0x4d2e=['../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1f42c6,_0x5ea87e){var _0x11fa9e=function(_0xe4d090){while(--_0xe4d090){_0x1f42c6['push'](_0x1f42c6['shift']());}};_0x11fa9e(++_0x5ea87e);}(_0x4d2e,0x7f));var _0xe4d2=function(_0x441f00,_0x1bbc37){_0x441f00=_0x441f00-0x0;var _0x9b6173=_0x4d2e[_0x441f00];return _0x9b6173;};'use strict';var _=require(_0xe4d2('0x0'));var util=require(_0xe4d2('0x1'));var moment=require(_0xe4d2('0x2'));var BPromise=require(_0xe4d2('0x3'));var rs=require(_0xe4d2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4d2('0x5'))['db'];var utils=require(_0xe4d2('0x6'));var logger=require(_0xe4d2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe4d2('0x8')][_0xe4d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ed7c7,_0x31c89e,_0x2c33db){return new BPromise(function(_0x4a8106,_0x2c40db){return client[_0xe4d2('0xa')](_0x4ed7c7,_0x2c33db)[_0xe4d2('0xb')](function(_0x45492d){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x31c89e,'request\x20sent');logger[_0xe4d2('0xc')](_0xe4d2('0xd'),_0x31c89e,_0xe4d2('0xe'),JSON[_0xe4d2('0xf')](_0x45492d));if(_0x45492d['error']){if(_0x45492d[_0xe4d2('0x10')]['code']===0x1f4){logger[_0xe4d2('0x10')](_0xe4d2('0x11'),_0x31c89e,_0x45492d[_0xe4d2('0x10')][_0xe4d2('0x12')]);return _0x2c40db(_0x45492d[_0xe4d2('0x10')]['message']);}logger[_0xe4d2('0x10')](_0xe4d2('0x11'),_0x31c89e,_0x45492d[_0xe4d2('0x10')][_0xe4d2('0x12')]);return _0x4a8106(_0x45492d[_0xe4d2('0x10')][_0xe4d2('0x12')]);}else{logger[_0xe4d2('0x13')](_0xe4d2('0x11'),_0x31c89e,_0xe4d2('0xe'));_0x4a8106(_0x45492d[_0xe4d2('0x14')][_0xe4d2('0x12')]);}})[_0xe4d2('0x15')](function(_0x11831a){logger[_0xe4d2('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x31c89e,_0x11831a);_0x2c40db(_0x11831a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 4bae5b6..f2eefcf 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 _0x98fd=['put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','show','isAuthenticated','create'];(function(_0x477445,_0x5f37f1){var _0x1fd940=function(_0x5c70f8){while(--_0x5c70f8){_0x477445['push'](_0x477445['shift']());}};_0x1fd940(++_0x5f37f1);}(_0x98fd,0x195));var _0xd98f=function(_0xd0cd0b,_0x490956){_0xd0cd0b=_0xd0cd0b-0x0;var _0x59cced=_0x98fd[_0xd0cd0b];return _0x59cced;};'use strict';var multer=require(_0xd98f('0x0'));var util=require(_0xd98f('0x1'));var path=require(_0xd98f('0x2'));var timeout=require(_0xd98f('0x3'));var express=require(_0xd98f('0x4'));var router=express[_0xd98f('0x5')]();var fs_extra=require(_0xd98f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd98f('0x7'));var config=require(_0xd98f('0x8'));var controller=require(_0xd98f('0x9'));router[_0xd98f('0xa')]('/',auth['isAuthenticated'](),controller[_0xd98f('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd98f('0xc')]);router['post']('/',auth[_0xd98f('0xd')](),controller[_0xd98f('0xe')]);router[_0xd98f('0xf')](_0xd98f('0x10'),auth[_0xd98f('0xd')](),controller[_0xd98f('0x11')]);router['delete'](_0xd98f('0x10'),auth[_0xd98f('0xd')](),controller[_0xd98f('0x12')]);module[_0xd98f('0x13')]=router; \ No newline at end of file +var _0x2690=['../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','connect-timeout','fs-extra'];(function(_0x411dac,_0x4263db){var _0x30e2d9=function(_0x5123bd){while(--_0x5123bd){_0x411dac['push'](_0x411dac['shift']());}};_0x30e2d9(++_0x4263db);}(_0x2690,0x7d));var _0x0269=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x2690[_0x5d80de];return _0x1c7556;};'use strict';var multer=require(_0x0269('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0269('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0269('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x0269('0x3'));var config=require(_0x0269('0x4'));var controller=require(_0x0269('0x5'));router[_0x0269('0x6')]('/',auth[_0x0269('0x7')](),controller[_0x0269('0x8')]);router[_0x0269('0x6')](_0x0269('0x9'),auth[_0x0269('0x7')](),controller[_0x0269('0xa')]);router[_0x0269('0xb')]('/',auth[_0x0269('0x7')](),controller['create']);router[_0x0269('0xc')]('/:id',auth[_0x0269('0x7')](),controller[_0x0269('0xd')]);router[_0x0269('0xe')](_0x0269('0x9'),auth[_0x0269('0x7')](),controller[_0x0269('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 35cbc2c..2e8d2ec 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 _0x9956=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x5f5b60,_0x5b4610){var _0x4fe877=function(_0x480711){while(--_0x480711){_0x5f5b60['push'](_0x5f5b60['shift']());}};_0x4fe877(++_0x5b4610);}(_0x9956,0x1da));var _0x6995=function(_0x41221f,_0x352450){_0x41221f=_0x41221f-0x0;var _0x30d476=_0x9956[_0x41221f];return _0x30d476;};'use strict';var Sequelize=require(_0x6995('0x0'));module[_0x6995('0x1')]={'type':{'type':Sequelize[_0x6995('0x2')](_0x6995('0x3'),_0x6995('0x4'),_0x6995('0x5'),_0x6995('0x6'),'picklist'),'defaultValue':_0x6995('0x3')},'content':{'type':Sequelize[_0x6995('0x7')]},'key':{'type':Sequelize[_0x6995('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x6995('0x4'),_0x6995('0x5'))},'keyContent':{'type':Sequelize[_0x6995('0x7')]},'idField':{'type':Sequelize[_0x6995('0x7')]},'nameField':{'type':Sequelize[_0x6995('0x7')]},'customField':{'type':Sequelize[_0x6995('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6995('0x7')]}}; \ No newline at end of file +var _0xf586=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','variable'];(function(_0xfa0260,_0x75ecac){var _0x54e80d=function(_0x2bd794){while(--_0x2bd794){_0xfa0260['push'](_0xfa0260['shift']());}};_0x54e80d(++_0x75ecac);}(_0xf586,0x98));var _0x6f58=function(_0x32753a,_0x313eff){_0x32753a=_0x32753a-0x0;var _0x5cc638=_0xf586[_0x32753a];return _0x5cc638;};'use strict';var Sequelize=require(_0x6f58('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x6f58('0x1'),_0x6f58('0x2'),_0x6f58('0x3'),_0x6f58('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6f58('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x6f58('0x1'),_0x6f58('0x2'))},'keyContent':{'type':Sequelize[_0x6f58('0x5')]},'idField':{'type':Sequelize[_0x6f58('0x5')]},'nameField':{'type':Sequelize[_0x6f58('0x5')]},'customField':{'type':Sequelize[_0x6f58('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index e68fcfd..864d107 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 _0xad5a=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','Dynamics365Field','fieldName','type','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','rawAttributes','fields','include','find','create','body','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x5460cd,_0x312955){var _0x40ce3e=function(_0x25b5a2){while(--_0x25b5a2){_0x5460cd['push'](_0x5460cd['shift']());}};_0x40ce3e(++_0x312955);}(_0xad5a,0x122));var _0xaad5=function(_0xb5e5d0,_0x1b2010){_0xb5e5d0=_0xb5e5d0-0x0;var _0x464715=_0xad5a[_0xb5e5d0];return _0x464715;};'use strict';var emlformat=require(_0xaad5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaad5('0x1'));var jsonpatch=require(_0xaad5('0x2'));var rp=require('request-promise');var moment=require(_0xaad5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaad5('0x4'));var path=require(_0xaad5('0x5'));var sox=require(_0xaad5('0x6'));var csv=require(_0xaad5('0x7'));var ejs=require(_0xaad5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaad5('0x9'));var crypto=require(_0xaad5('0xa'));var jsforce=require(_0xaad5('0xb'));var deskjs=require(_0xaad5('0xc'));var toCsv=require(_0xaad5('0x7'));var querystring=require(_0xaad5('0xd'));var Papa=require(_0xaad5('0xe'));var Redis=require(_0xaad5('0xf'));var authService=require(_0xaad5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaad5('0x11'));var hardwareService=require(_0xaad5('0x12'));var logger=require(_0xaad5('0x13'))('api');var utils=require(_0xaad5('0x14'));var config=require(_0xaad5('0x15'));var licenseUtil=require(_0xaad5('0x16'));var db=require(_0xaad5('0x17'))['db'];function respondWithStatusCode(_0x165096,_0x5d1dc1){_0x5d1dc1=_0x5d1dc1||0xcc;return function(_0x131c29){if(_0x131c29){return _0x165096[_0xaad5('0x18')](_0x5d1dc1);}return _0x165096[_0xaad5('0x19')](_0x5d1dc1)[_0xaad5('0x1a')]();};}function respondWithResult(_0xe80902,_0x10c666){_0x10c666=_0x10c666||0xc8;return function(_0x1e289f){if(_0x1e289f){return _0xe80902[_0xaad5('0x19')](_0x10c666)['json'](_0x1e289f);}};}function respondWithFilteredResult(_0x165345,_0x10aa9c){return function(_0x1defbf){if(_0x1defbf){var _0xdb8215=typeof _0x10aa9c[_0xaad5('0x1b')]===_0xaad5('0x1c')&&typeof _0x10aa9c[_0xaad5('0x1d')]===_0xaad5('0x1c');var _0x4a3482=_0x1defbf['count'];var _0x3f43ea=_0xdb8215?0x0:_0x10aa9c[_0xaad5('0x1b')];var _0x5c1772=_0xdb8215?_0x1defbf[_0xaad5('0x1e')]:_0x10aa9c[_0xaad5('0x1b')]+_0x10aa9c['limit'];var _0x31da8c;if(_0x5c1772>=_0x4a3482){_0x5c1772=_0x4a3482;_0x31da8c=0xc8;}else{_0x31da8c=0xce;}_0x165345[_0xaad5('0x19')](_0x31da8c);return _0x165345[_0xaad5('0x1f')](_0xaad5('0x20'),_0x3f43ea+'-'+_0x5c1772+'/'+_0x4a3482)[_0xaad5('0x21')](_0x1defbf);}return null;};}function patchUpdates(_0x5dc97b){return function(_0x4a81b8){try{jsonpatch[_0xaad5('0x22')](_0x4a81b8,_0x5dc97b,!![]);}catch(_0x427380){return BPromise[_0xaad5('0x23')](_0x427380);}return _0x4a81b8[_0xaad5('0x24')]();};}function saveUpdates(_0x9129e0,_0x422320){return function(_0x3bbac4){if(_0x3bbac4){return _0x3bbac4[_0xaad5('0x25')](_0x9129e0)[_0xaad5('0x26')](function(_0x3f3672){return _0x3f3672;});}return null;};}function removeEntity(_0x4750da,_0x180279){return function(_0x372772){if(_0x372772){return _0x372772[_0xaad5('0x27')]()[_0xaad5('0x26')](function(){_0x4750da[_0xaad5('0x19')](0xcc)[_0xaad5('0x1a')]();});}};}function handleEntityNotFound(_0x38624b,_0x1b4eca){return function(_0x104529){if(!_0x104529){_0x38624b[_0xaad5('0x18')](0x194);}return _0x104529;};}function handleError(_0x11b8eb,_0x2f10eb){_0x2f10eb=_0x2f10eb||0x1f4;return function(_0x3f10e7){logger[_0xaad5('0x28')](_0x3f10e7[_0xaad5('0x29')]);if(_0x3f10e7['name']){delete _0x3f10e7[_0xaad5('0x2a')];}_0x11b8eb[_0xaad5('0x19')](_0x2f10eb)[_0xaad5('0x2b')](_0x3f10e7);};}exports[_0xaad5('0x2c')]=function(_0x4237a5,_0x1d937f){var _0x4ba2ec={},_0x18e8b8={},_0x2b8e3c={'count':0x0,'rows':[]};var _0x44e46f=_['map'](db[_0xaad5('0x2d')]['rawAttributes'],function(_0xe3be49){return{'name':_0xe3be49[_0xaad5('0x2e')],'type':_0xe3be49[_0xaad5('0x2f')][_0xaad5('0x30')]};});_0x18e8b8[_0xaad5('0x31')]=_[_0xaad5('0x32')](_0x44e46f,_0xaad5('0x2a'));_0x18e8b8[_0xaad5('0x33')]=_[_0xaad5('0x34')](_0x4237a5[_0xaad5('0x33')]);_0x18e8b8['filters']=_[_0xaad5('0x35')](_0x18e8b8['model'],_0x18e8b8[_0xaad5('0x33')]);_0x4ba2ec[_0xaad5('0x36')]=_[_0xaad5('0x35')](_0x18e8b8[_0xaad5('0x31')],qs['fields'](_0x4237a5['query']['fields']));_0x4ba2ec[_0xaad5('0x36')]=_0x4ba2ec[_0xaad5('0x36')][_0xaad5('0x37')]?_0x4ba2ec[_0xaad5('0x36')]:_0x18e8b8[_0xaad5('0x31')];if(!_0x4237a5[_0xaad5('0x33')][_0xaad5('0x38')](_0xaad5('0x39'))){_0x4ba2ec[_0xaad5('0x1d')]=qs[_0xaad5('0x1d')](_0x4237a5['query'][_0xaad5('0x1d')]);_0x4ba2ec[_0xaad5('0x1b')]=qs[_0xaad5('0x1b')](_0x4237a5['query'][_0xaad5('0x1b')]);}_0x4ba2ec['order']=qs[_0xaad5('0x3a')](_0x4237a5['query']['sort']);_0x4ba2ec[_0xaad5('0x3b')]=qs[_0xaad5('0x3c')](_[_0xaad5('0x3d')](_0x4237a5[_0xaad5('0x33')],_0x18e8b8[_0xaad5('0x3c')]),_0x44e46f);if(_0x4237a5[_0xaad5('0x33')]['filter']){_0x4ba2ec[_0xaad5('0x3b')]=_[_0xaad5('0x3e')](_0x4ba2ec[_0xaad5('0x3b')],{'$or':_[_0xaad5('0x32')](_0x44e46f,function(_0x19dba4){if(_0x19dba4['type']!==_0xaad5('0x3f')){var _0x393a31={};_0x393a31[_0x19dba4[_0xaad5('0x2a')]]={'$like':'%'+_0x4237a5[_0xaad5('0x33')][_0xaad5('0x40')]+'%'};return _0x393a31;}})});}_0x4ba2ec=_[_0xaad5('0x3e')]({},_0x4ba2ec,_0x4237a5[_0xaad5('0x41')]);var _0x23144b={'where':_0x4ba2ec['where']};return db[_0xaad5('0x2d')][_0xaad5('0x1e')](_0x23144b)[_0xaad5('0x26')](function(_0x502077){_0x2b8e3c[_0xaad5('0x1e')]=_0x502077;if(_0x4237a5[_0xaad5('0x33')][_0xaad5('0x42')]){_0x4ba2ec['include']=[{'all':!![]}];}return db[_0xaad5('0x2d')]['findAll'](_0x4ba2ec);})[_0xaad5('0x26')](function(_0x2f442c){_0x2b8e3c[_0xaad5('0x43')]=_0x2f442c;return _0x2b8e3c;})[_0xaad5('0x26')](respondWithFilteredResult(_0x1d937f,_0x4ba2ec))[_0xaad5('0x44')](handleError(_0x1d937f,null));};exports[_0xaad5('0x45')]=function(_0x264b8c,_0x326f3d){var _0x27c5b5={'raw':!![],'where':{'id':_0x264b8c[_0xaad5('0x46')]['id']}},_0x4f8107={};_0x4f8107[_0xaad5('0x31')]=_[_0xaad5('0x34')](db[_0xaad5('0x2d')][_0xaad5('0x47')]);_0x4f8107['query']=_[_0xaad5('0x34')](_0x264b8c[_0xaad5('0x33')]);_0x4f8107['filters']=_[_0xaad5('0x35')](_0x4f8107[_0xaad5('0x31')],_0x4f8107[_0xaad5('0x33')]);_0x27c5b5[_0xaad5('0x36')]=_[_0xaad5('0x35')](_0x4f8107[_0xaad5('0x31')],qs[_0xaad5('0x48')](_0x264b8c[_0xaad5('0x33')][_0xaad5('0x48')]));_0x27c5b5[_0xaad5('0x36')]=_0x27c5b5[_0xaad5('0x36')][_0xaad5('0x37')]?_0x27c5b5['attributes']:_0x4f8107[_0xaad5('0x31')];if(_0x264b8c[_0xaad5('0x33')][_0xaad5('0x42')]){_0x27c5b5[_0xaad5('0x49')]=[{'all':!![]}];}_0x27c5b5=_[_0xaad5('0x3e')]({},_0x27c5b5,_0x264b8c[_0xaad5('0x41')]);return db[_0xaad5('0x2d')][_0xaad5('0x4a')](_0x27c5b5)[_0xaad5('0x26')](handleEntityNotFound(_0x326f3d,null))['then'](respondWithResult(_0x326f3d,null))[_0xaad5('0x44')](handleError(_0x326f3d,null));};exports[_0xaad5('0x4b')]=function(_0x454d15,_0x5aa1e0){return db[_0xaad5('0x2d')][_0xaad5('0x4b')](_0x454d15[_0xaad5('0x4c')],{})[_0xaad5('0x26')](respondWithResult(_0x5aa1e0,0xc9))[_0xaad5('0x44')](handleError(_0x5aa1e0,null));};exports[_0xaad5('0x25')]=function(_0x41eb9e,_0x2b539b){if(_0x41eb9e[_0xaad5('0x4c')]['id']){delete _0x41eb9e[_0xaad5('0x4c')]['id'];}return db['Dynamics365Field'][_0xaad5('0x4a')]({'where':{'id':_0x41eb9e['params']['id']}})[_0xaad5('0x26')](handleEntityNotFound(_0x2b539b,null))[_0xaad5('0x26')](saveUpdates(_0x41eb9e[_0xaad5('0x4c')],null))[_0xaad5('0x26')](respondWithResult(_0x2b539b,null))['catch'](handleError(_0x2b539b,null));};exports[_0xaad5('0x27')]=function(_0xea6023,_0x12fc75){return db[_0xaad5('0x2d')][_0xaad5('0x4a')]({'where':{'id':_0xea6023[_0xaad5('0x46')]['id']}})[_0xaad5('0x26')](handleEntityNotFound(_0x12fc75,null))['then'](removeEntity(_0x12fc75,null))[_0xaad5('0x44')](handleError(_0x12fc75,null));}; \ No newline at end of file +var _0x31e4=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','send','index','Dynamics365Field','fieldName','type','key','model','map','name'];(function(_0x218683,_0x23bc63){var _0xb9ef9b=function(_0x4ac51e){while(--_0x4ac51e){_0x218683['push'](_0x218683['shift']());}};_0xb9ef9b(++_0x23bc63);}(_0x31e4,0x107));var _0x431e=function(_0x4a397d,_0x5bab1f){_0x4a397d=_0x4a397d-0x0;var _0x316571=_0x31e4[_0x4a397d];return _0x316571;};'use strict';var emlformat=require(_0x431e('0x0'));var rimraf=require(_0x431e('0x1'));var zipdir=require(_0x431e('0x2'));var jsonpatch=require(_0x431e('0x3'));var rp=require(_0x431e('0x4'));var moment=require(_0x431e('0x5'));var BPromise=require(_0x431e('0x6'));var Mustache=require(_0x431e('0x7'));var util=require('util');var path=require(_0x431e('0x8'));var sox=require(_0x431e('0x9'));var csv=require(_0x431e('0xa'));var ejs=require(_0x431e('0xb'));var fs=require('fs');var fs_extra=require(_0x431e('0xc'));var _=require('lodash');var squel=require(_0x431e('0xd'));var crypto=require(_0x431e('0xe'));var jsforce=require(_0x431e('0xf'));var deskjs=require(_0x431e('0x10'));var toCsv=require(_0x431e('0xa'));var querystring=require(_0x431e('0x11'));var Papa=require(_0x431e('0x12'));var Redis=require('ioredis');var authService=require(_0x431e('0x13'));var qs=require(_0x431e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x431e('0x15'));var logger=require(_0x431e('0x16'))(_0x431e('0x17'));var utils=require(_0x431e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x431e('0x19'));var db=require(_0x431e('0x1a'))['db'];function respondWithStatusCode(_0x4e47de,_0x14eacf){_0x14eacf=_0x14eacf||0xcc;return function(_0x46cb9d){if(_0x46cb9d){return _0x4e47de['sendStatus'](_0x14eacf);}return _0x4e47de['status'](_0x14eacf)[_0x431e('0x1b')]();};}function respondWithResult(_0x20eb99,_0xf094ee){_0xf094ee=_0xf094ee||0xc8;return function(_0x316483){if(_0x316483){return _0x20eb99[_0x431e('0x1c')](_0xf094ee)[_0x431e('0x1d')](_0x316483);}};}function respondWithFilteredResult(_0x19122d,_0x31345b){return function(_0x4e1662){if(_0x4e1662){var _0x31fcb0=typeof _0x31345b[_0x431e('0x1e')]===_0x431e('0x1f')&&typeof _0x31345b[_0x431e('0x20')]===_0x431e('0x1f');var _0x53b0ed=_0x4e1662['count'];var _0x7326ba=_0x31fcb0?0x0:_0x31345b[_0x431e('0x1e')];var _0x511b11=_0x31fcb0?_0x4e1662[_0x431e('0x21')]:_0x31345b[_0x431e('0x1e')]+_0x31345b[_0x431e('0x20')];var _0x26b691;if(_0x511b11>=_0x53b0ed){_0x511b11=_0x53b0ed;_0x26b691=0xc8;}else{_0x26b691=0xce;}_0x19122d[_0x431e('0x1c')](_0x26b691);return _0x19122d[_0x431e('0x22')](_0x431e('0x23'),_0x7326ba+'-'+_0x511b11+'/'+_0x53b0ed)[_0x431e('0x1d')](_0x4e1662);}return null;};}function patchUpdates(_0x3987ca){return function(_0x3883a0){try{jsonpatch[_0x431e('0x24')](_0x3883a0,_0x3987ca,!![]);}catch(_0x2f615e){return BPromise[_0x431e('0x25')](_0x2f615e);}return _0x3883a0[_0x431e('0x26')]();};}function saveUpdates(_0x527237,_0x5c0f91){return function(_0x10ecfc){if(_0x10ecfc){return _0x10ecfc['update'](_0x527237)[_0x431e('0x27')](function(_0x5662aa){return _0x5662aa;});}return null;};}function removeEntity(_0x56acd9,_0x56aff8){return function(_0x32d46b){if(_0x32d46b){return _0x32d46b[_0x431e('0x28')]()[_0x431e('0x27')](function(){_0x56acd9['status'](0xcc)[_0x431e('0x1b')]();});}};}function handleEntityNotFound(_0x4fa82c,_0x692736){return function(_0x4b7c91){if(!_0x4b7c91){_0x4fa82c[_0x431e('0x29')](0x194);}return _0x4b7c91;};}function handleError(_0x2e33f6,_0x36f236){_0x36f236=_0x36f236||0x1f4;return function(_0x30cc79){logger[_0x431e('0x2a')](_0x30cc79[_0x431e('0x2b')]);if(_0x30cc79['name']){delete _0x30cc79['name'];}_0x2e33f6[_0x431e('0x1c')](_0x36f236)[_0x431e('0x2c')](_0x30cc79);};}exports[_0x431e('0x2d')]=function(_0x4f3137,_0x20f463){var _0x574e07={},_0x1a4210={},_0x2f809c={'count':0x0,'rows':[]};var _0x3368d6=_['map'](db[_0x431e('0x2e')]['rawAttributes'],function(_0x3eb1b7){return{'name':_0x3eb1b7[_0x431e('0x2f')],'type':_0x3eb1b7[_0x431e('0x30')][_0x431e('0x31')]};});_0x1a4210[_0x431e('0x32')]=_[_0x431e('0x33')](_0x3368d6,_0x431e('0x34'));_0x1a4210[_0x431e('0x35')]=_[_0x431e('0x36')](_0x4f3137[_0x431e('0x35')]);_0x1a4210[_0x431e('0x37')]=_[_0x431e('0x38')](_0x1a4210[_0x431e('0x32')],_0x1a4210[_0x431e('0x35')]);_0x574e07[_0x431e('0x39')]=_['intersection'](_0x1a4210[_0x431e('0x32')],qs[_0x431e('0x3a')](_0x4f3137[_0x431e('0x35')][_0x431e('0x3a')]));_0x574e07[_0x431e('0x39')]=_0x574e07[_0x431e('0x39')]['length']?_0x574e07[_0x431e('0x39')]:_0x1a4210[_0x431e('0x32')];if(!_0x4f3137['query'][_0x431e('0x3b')](_0x431e('0x3c'))){_0x574e07['limit']=qs[_0x431e('0x20')](_0x4f3137[_0x431e('0x35')][_0x431e('0x20')]);_0x574e07[_0x431e('0x1e')]=qs[_0x431e('0x1e')](_0x4f3137[_0x431e('0x35')][_0x431e('0x1e')]);}_0x574e07['order']=qs[_0x431e('0x3d')](_0x4f3137[_0x431e('0x35')]['sort']);_0x574e07['where']=qs[_0x431e('0x37')](_[_0x431e('0x3e')](_0x4f3137['query'],_0x1a4210['filters']),_0x3368d6);if(_0x4f3137[_0x431e('0x35')][_0x431e('0x3f')]){_0x574e07[_0x431e('0x40')]=_['merge'](_0x574e07[_0x431e('0x40')],{'$or':_['map'](_0x3368d6,function(_0x3f7d35){if(_0x3f7d35[_0x431e('0x30')]!=='VIRTUAL'){var _0x2c7648={};_0x2c7648[_0x3f7d35[_0x431e('0x34')]]={'$like':'%'+_0x4f3137[_0x431e('0x35')][_0x431e('0x3f')]+'%'};return _0x2c7648;}})});}_0x574e07=_[_0x431e('0x41')]({},_0x574e07,_0x4f3137[_0x431e('0x42')]);var _0x1d7e46={'where':_0x574e07['where']};return db[_0x431e('0x2e')]['count'](_0x1d7e46)[_0x431e('0x27')](function(_0x2ddff9){_0x2f809c[_0x431e('0x21')]=_0x2ddff9;if(_0x4f3137[_0x431e('0x35')][_0x431e('0x43')]){_0x574e07[_0x431e('0x44')]=[{'all':!![]}];}return db[_0x431e('0x2e')][_0x431e('0x45')](_0x574e07);})['then'](function(_0x4ccde2){_0x2f809c[_0x431e('0x46')]=_0x4ccde2;return _0x2f809c;})['then'](respondWithFilteredResult(_0x20f463,_0x574e07))[_0x431e('0x47')](handleError(_0x20f463,null));};exports[_0x431e('0x48')]=function(_0xc3bd83,_0x19d9e8){var _0x3ceac5={'raw':!![],'where':{'id':_0xc3bd83[_0x431e('0x49')]['id']}},_0x400a42={};_0x400a42[_0x431e('0x32')]=_[_0x431e('0x36')](db['Dynamics365Field'][_0x431e('0x4a')]);_0x400a42[_0x431e('0x35')]=_[_0x431e('0x36')](_0xc3bd83[_0x431e('0x35')]);_0x400a42[_0x431e('0x37')]=_['intersection'](_0x400a42[_0x431e('0x32')],_0x400a42['query']);_0x3ceac5['attributes']=_[_0x431e('0x38')](_0x400a42['model'],qs[_0x431e('0x3a')](_0xc3bd83[_0x431e('0x35')][_0x431e('0x3a')]));_0x3ceac5[_0x431e('0x39')]=_0x3ceac5[_0x431e('0x39')]['length']?_0x3ceac5[_0x431e('0x39')]:_0x400a42[_0x431e('0x32')];if(_0xc3bd83[_0x431e('0x35')][_0x431e('0x43')]){_0x3ceac5['include']=[{'all':!![]}];}_0x3ceac5=_['merge']({},_0x3ceac5,_0xc3bd83[_0x431e('0x42')]);return db[_0x431e('0x2e')][_0x431e('0x4b')](_0x3ceac5)[_0x431e('0x27')](handleEntityNotFound(_0x19d9e8,null))[_0x431e('0x27')](respondWithResult(_0x19d9e8,null))[_0x431e('0x47')](handleError(_0x19d9e8,null));};exports[_0x431e('0x4c')]=function(_0x5341dd,_0x480734){return db['Dynamics365Field'][_0x431e('0x4c')](_0x5341dd[_0x431e('0x4d')],{})[_0x431e('0x27')](respondWithResult(_0x480734,0xc9))[_0x431e('0x47')](handleError(_0x480734,null));};exports[_0x431e('0x4e')]=function(_0x5734ea,_0x3c9fd1){if(_0x5734ea['body']['id']){delete _0x5734ea[_0x431e('0x4d')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x5734ea[_0x431e('0x49')]['id']}})[_0x431e('0x27')](handleEntityNotFound(_0x3c9fd1,null))[_0x431e('0x27')](saveUpdates(_0x5734ea[_0x431e('0x4d')],null))['then'](respondWithResult(_0x3c9fd1,null))[_0x431e('0x47')](handleError(_0x3c9fd1,null));};exports[_0x431e('0x28')]=function(_0x5244fd,_0x5600b5){return db[_0x431e('0x2e')][_0x431e('0x4b')]({'where':{'id':_0x5244fd['params']['id']}})['then'](handleEntityNotFound(_0x5600b5,null))[_0x431e('0x27')](removeEntity(_0x5600b5,null))[_0x431e('0x47')](handleError(_0x5600b5,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index b67af2f..f8ef612 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 _0x9522=['path','rimraf','./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','util','bluebird','request-promise'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x9522,0x13b));var _0x2952=function(_0xb2c2b4,_0x4800b2){_0xb2c2b4=_0xb2c2b4-0x0;var _0x362374=_0x9522[_0xb2c2b4];return _0x362374;};'use strict';var _=require(_0x2952('0x0'));var util=require(_0x2952('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2952('0x2'));var rp=require(_0x2952('0x3'));var fs=require('fs');var path=require(_0x2952('0x4'));var rimraf=require(_0x2952('0x5'));var config=require('../../config/environment');var attributes=require(_0x2952('0x6'));module['exports']=function(_0x2f2cd8,_0x62acb4){return _0x2f2cd8['define'](_0x2952('0x7'),attributes,{'tableName':_0x2952('0x8'),'paranoid':![],'indexes':[{'name':_0x2952('0x9'),'fields':['idField',_0x2952('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xea9c=['bluebird','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','util'];(function(_0xd3c72,_0x9e8b23){var _0x3c1592=function(_0x35c9a4){while(--_0x35c9a4){_0xd3c72['push'](_0xd3c72['shift']());}};_0x3c1592(++_0x9e8b23);}(_0xea9c,0x17e));var _0xcea9=function(_0x2749fd,_0x2d469f){_0x2749fd=_0x2749fd-0x0;var _0x546220=_0xea9c[_0x2749fd];return _0x546220;};'use strict';var _=require(_0xcea9('0x0'));var util=require(_0xcea9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcea9('0x2'));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(_0xcea9('0x3'));module['exports']=function(_0x259df3,_0x121099){return _0x259df3[_0xcea9('0x4')](_0xcea9('0x5'),attributes,{'tableName':_0xcea9('0x6'),'paranoid':![],'indexes':[{'name':_0xcea9('0x7'),'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 769bce6..4bbade6 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 _0x7881=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x4b651d,_0x282dc1){var _0x290343=function(_0x48e2d6){while(--_0x48e2d6){_0x4b651d['push'](_0x4b651d['shift']());}};_0x290343(++_0x282dc1);}(_0x7881,0x19f));var _0x1788=function(_0x420fe5,_0x2016e0){_0x420fe5=_0x420fe5-0x0;var _0x4ddabb=_0x7881[_0x420fe5];return _0x4ddabb;};'use strict';var _=require(_0x1788('0x0'));var util=require(_0x1788('0x1'));var moment=require(_0x1788('0x2'));var BPromise=require('bluebird');var rs=require(_0x1788('0x3'));var fs=require('fs');var Redis=require(_0x1788('0x4'));var db=require(_0x1788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1788('0x6'))(_0x1788('0x7'));var config=require(_0x1788('0x8'));var jayson=require(_0x1788('0x9'));var client=jayson[_0x1788('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x391a3c,_0x1d80ca,_0x28c78b){return new BPromise(function(_0x22381f,_0x9c8f43){return client['request'](_0x391a3c,_0x28c78b)['then'](function(_0x3af904){logger[_0x1788('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x1d80ca,_0x1788('0xc'));logger['debug'](_0x1788('0xd'),_0x1d80ca,'request\x20sent',JSON[_0x1788('0xe')](_0x3af904));if(_0x3af904['error']){if(_0x3af904[_0x1788('0xf')][_0x1788('0x10')]===0x1f4){logger[_0x1788('0xf')](_0x1788('0x11'),_0x1d80ca,_0x3af904['error'][_0x1788('0x12')]);return _0x9c8f43(_0x3af904[_0x1788('0xf')][_0x1788('0x12')]);}logger[_0x1788('0xf')](_0x1788('0x11'),_0x1d80ca,_0x3af904[_0x1788('0xf')]['message']);return _0x22381f(_0x3af904['error'][_0x1788('0x12')]);}else{logger[_0x1788('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x1d80ca,_0x1788('0xc'));_0x22381f(_0x3af904['result'][_0x1788('0x12')]);}})[_0x1788('0x13')](function(_0x680aae){logger[_0x1788('0xf')](_0x1788('0x11'),_0x1d80ca,_0x680aae);_0x9c8f43(_0x680aae);});});} \ No newline at end of file +var _0x68b8=['info','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x58836f,_0x5351e2){var _0x28f9b1=function(_0x30a6cc){while(--_0x30a6cc){_0x58836f['push'](_0x58836f['shift']());}};_0x28f9b1(++_0x5351e2);}(_0x68b8,0x168));var _0x868b=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x68b8[_0xa45395];return _0x3c83d2;};'use strict';var _=require(_0x868b('0x0'));var util=require('util');var moment=require(_0x868b('0x1'));var BPromise=require(_0x868b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x868b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x868b('0x4'))(_0x868b('0x5'));var config=require(_0x868b('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x868b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c6f22,_0x4ab8d6,_0x518d1d){return new BPromise(function(_0x58f984,_0x27a2d8){return client[_0x868b('0x8')](_0x5c6f22,_0x518d1d)[_0x868b('0x9')](function(_0x1d8c02){logger['info'](_0x868b('0xa'),_0x4ab8d6,_0x868b('0xb'));logger[_0x868b('0xc')](_0x868b('0xd'),_0x4ab8d6,_0x868b('0xb'),JSON[_0x868b('0xe')](_0x1d8c02));if(_0x1d8c02[_0x868b('0xf')]){if(_0x1d8c02[_0x868b('0xf')][_0x868b('0x10')]===0x1f4){logger[_0x868b('0xf')](_0x868b('0xa'),_0x4ab8d6,_0x1d8c02[_0x868b('0xf')][_0x868b('0x11')]);return _0x27a2d8(_0x1d8c02[_0x868b('0xf')][_0x868b('0x11')]);}logger[_0x868b('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x4ab8d6,_0x1d8c02[_0x868b('0xf')]['message']);return _0x58f984(_0x1d8c02[_0x868b('0xf')][_0x868b('0x11')]);}else{logger[_0x868b('0x12')](_0x868b('0xa'),_0x4ab8d6,_0x868b('0xb'));_0x58f984(_0x1d8c02[_0x868b('0x13')][_0x868b('0x11')]);}})[_0x868b('0x14')](function(_0x23d02f){logger[_0x868b('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x4ab8d6,_0x23d02f);_0x27a2d8(_0x23d02f);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index aa6ce8e..1cf9af3 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 _0x1970=['index','get','isAuthenticated','show','/:id/configurations','post','create','addConfiguration','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./intFreshdeskAccount.controller'];(function(_0x20c45d,_0x24b44b){var _0x3d5f2f=function(_0x2c35cd){while(--_0x2c35cd){_0x20c45d['push'](_0x20c45d['shift']());}};_0x3d5f2f(++_0x24b44b);}(_0x1970,0x107));var _0x0197=function(_0x1dc7ff,_0x3fdbe9){_0x1dc7ff=_0x1dc7ff-0x0;var _0x26a672=_0x1970[_0x1dc7ff];return _0x26a672;};'use strict';var multer=require(_0x0197('0x0'));var util=require(_0x0197('0x1'));var path=require('path');var timeout=require(_0x0197('0x2'));var express=require(_0x0197('0x3'));var router=express['Router']();var fs_extra=require(_0x0197('0x4'));var auth=require(_0x0197('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0197('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0197('0x7')]);router[_0x0197('0x8')]('/:id',auth[_0x0197('0x9')](),controller[_0x0197('0xa')]);router[_0x0197('0x8')](_0x0197('0xb'),auth[_0x0197('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x0197('0xc')]('/',auth[_0x0197('0x9')](),controller[_0x0197('0xd')]);router[_0x0197('0xc')](_0x0197('0xb'),auth[_0x0197('0x9')](),controller[_0x0197('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0197('0xf')]('/:id',auth[_0x0197('0x9')](),controller[_0x0197('0x10')]);module[_0x0197('0x11')]=router; \ No newline at end of file +var _0x2cb6=['/:id/fields','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations'];(function(_0xc22082,_0x185a14){var _0x18bc7c=function(_0x1181f4){while(--_0x1181f4){_0xc22082['push'](_0xc22082['shift']());}};_0x18bc7c(++_0x185a14);}(_0x2cb6,0x16b));var _0x62cb=function(_0x1bb931,_0x3e46d2){_0x1bb931=_0x1bb931-0x0;var _0x26601e=_0x2cb6[_0x1bb931];return _0x26601e;};'use strict';var multer=require(_0x62cb('0x0'));var util=require(_0x62cb('0x1'));var path=require(_0x62cb('0x2'));var timeout=require(_0x62cb('0x3'));var express=require(_0x62cb('0x4'));var router=express[_0x62cb('0x5')]();var fs_extra=require(_0x62cb('0x6'));var auth=require(_0x62cb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x62cb('0x8'));var controller=require(_0x62cb('0x9'));router[_0x62cb('0xa')]('/',auth[_0x62cb('0xb')](),controller['index']);router['get'](_0x62cb('0xc'),auth[_0x62cb('0xb')](),controller['show']);router['get'](_0x62cb('0xd'),auth[_0x62cb('0xb')](),controller[_0x62cb('0xe')]);router[_0x62cb('0xa')](_0x62cb('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x62cb('0x10')]('/',auth['isAuthenticated'](),controller[_0x62cb('0x11')]);router[_0x62cb('0x10')](_0x62cb('0xd'),auth[_0x62cb('0xb')](),controller['addConfiguration']);router[_0x62cb('0x12')](_0x62cb('0xc'),auth[_0x62cb('0xb')](),controller[_0x62cb('0x13')]);router['delete'](_0x62cb('0xc'),auth[_0x62cb('0xb')](),controller['destroy']);module[_0x62cb('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index a732ce7..01a4732 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 _0xf2e3=['STRING','username','remoteUri','sequelize'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xf2e3[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0x3f2e('0x0'));module['exports']={'name':{'type':Sequelize[_0x3f2e('0x1')]},'description':{'type':Sequelize[_0x3f2e('0x1')]},'username':{'type':Sequelize[_0x3f2e('0x1')],'unique':_0x3f2e('0x2')},'apiKey':{'type':Sequelize[_0x3f2e('0x1')]},'remoteUri':{'type':Sequelize[_0x3f2e('0x1')],'unique':_0x3f2e('0x3')},'serverUrl':{'type':Sequelize[_0x3f2e('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xadb5=['remoteUri','exports','STRING','username'];(function(_0x8cb2f9,_0x2b8706){var _0x164887=function(_0x1812cc){while(--_0x1812cc){_0x8cb2f9['push'](_0x8cb2f9['shift']());}};_0x164887(++_0x2b8706);}(_0xadb5,0xad));var _0x5adb=function(_0x9be14e,_0x3bcd4f){_0x9be14e=_0x9be14e-0x0;var _0x70e580=_0xadb5[_0x9be14e];return _0x70e580;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5adb('0x1')]},'username':{'type':Sequelize[_0x5adb('0x1')],'unique':_0x5adb('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5adb('0x1')],'unique':_0x5adb('0x3')},'serverUrl':{'type':Sequelize[_0x5adb('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index f34cc5f..70ac443 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 _0xb677=['map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','find','create','body','getConfigurations','findOne','addConfiguration','Subjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','api/v2/ticket_fields','%s:X','requester','subject','agent','priority','group','source','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','end','error','name','FreshdeskAccount','fieldName','type','key','model'];(function(_0x5e92ae,_0x15f7ea){var _0x13cb1d=function(_0x392bd9){while(--_0x392bd9){_0x5e92ae['push'](_0x5e92ae['shift']());}};_0x13cb1d(++_0x15f7ea);}(_0xb677,0x119));var _0x7b67=function(_0x23546c,_0x192572){_0x23546c=_0x23546c-0x0;var _0x35612b=_0xb677[_0x23546c];return _0x35612b;};'use strict';var emlformat=require(_0x7b67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b67('0x1'));var jsonpatch=require(_0x7b67('0x2'));var rp=require(_0x7b67('0x3'));var moment=require(_0x7b67('0x4'));var BPromise=require(_0x7b67('0x5'));var Mustache=require(_0x7b67('0x6'));var util=require(_0x7b67('0x7'));var path=require(_0x7b67('0x8'));var sox=require('sox');var csv=require(_0x7b67('0x9'));var ejs=require(_0x7b67('0xa'));var fs=require('fs');var fs_extra=require(_0x7b67('0xb'));var _=require(_0x7b67('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b67('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7b67('0xe'));var Papa=require('papaparse');var Redis=require(_0x7b67('0xf'));var authService=require(_0x7b67('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b67('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b67('0x12'))(_0x7b67('0x13'));var utils=require(_0x7b67('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x7b67('0x15'));function respondWithStatusCode(_0x454df4,_0x1e17fc){_0x1e17fc=_0x1e17fc||0xcc;return function(_0x963f60){if(_0x963f60){return _0x454df4[_0x7b67('0x16')](_0x1e17fc);}return _0x454df4[_0x7b67('0x17')](_0x1e17fc)['end']();};}function respondWithResult(_0x37eb7a,_0x473d10){_0x473d10=_0x473d10||0xc8;return function(_0x233388){if(_0x233388){return _0x37eb7a[_0x7b67('0x17')](_0x473d10)[_0x7b67('0x18')](_0x233388);}};}function respondWithFilteredResult(_0x309f1c,_0x1861d1){return function(_0xf99987){if(_0xf99987){var _0x52c21b=typeof _0x1861d1[_0x7b67('0x19')]===_0x7b67('0x1a')&&typeof _0x1861d1[_0x7b67('0x1b')]===_0x7b67('0x1a');var _0x241f1d=_0xf99987[_0x7b67('0x1c')];var _0x59fd3d=_0x52c21b?0x0:_0x1861d1[_0x7b67('0x19')];var _0x348f28=_0x52c21b?_0xf99987[_0x7b67('0x1c')]:_0x1861d1[_0x7b67('0x19')]+_0x1861d1[_0x7b67('0x1b')];var _0x4095e7;if(_0x348f28>=_0x241f1d){_0x348f28=_0x241f1d;_0x4095e7=0xc8;}else{_0x4095e7=0xce;}_0x309f1c[_0x7b67('0x17')](_0x4095e7);return _0x309f1c[_0x7b67('0x1d')](_0x7b67('0x1e'),_0x59fd3d+'-'+_0x348f28+'/'+_0x241f1d)[_0x7b67('0x18')](_0xf99987);}return null;};}function patchUpdates(_0x5ddb36){return function(_0x125924){try{jsonpatch[_0x7b67('0x1f')](_0x125924,_0x5ddb36,!![]);}catch(_0x55cab1){return BPromise['reject'](_0x55cab1);}return _0x125924['save']();};}function saveUpdates(_0x48944a,_0x44b951){return function(_0xeabc5c){if(_0xeabc5c){return _0xeabc5c[_0x7b67('0x20')](_0x48944a)[_0x7b67('0x21')](function(_0x2c3f11){return _0x2c3f11;});}return null;};}function removeEntity(_0x56b952,_0x3b4fea){return function(_0x12d848){if(_0x12d848){return _0x12d848[_0x7b67('0x22')]()[_0x7b67('0x21')](function(){_0x56b952[_0x7b67('0x17')](0xcc)[_0x7b67('0x23')]();});}};}function handleEntityNotFound(_0x2b6da7,_0x50e71c){return function(_0x463c41){if(!_0x463c41){_0x2b6da7['sendStatus'](0x194);}return _0x463c41;};}function handleError(_0x45da6b,_0x2f1e62){_0x2f1e62=_0x2f1e62||0x1f4;return function(_0x250fb0){logger[_0x7b67('0x24')](_0x250fb0['stack']);if(_0x250fb0[_0x7b67('0x25')]){delete _0x250fb0[_0x7b67('0x25')];}_0x45da6b[_0x7b67('0x17')](_0x2f1e62)['send'](_0x250fb0);};}exports['index']=function(_0x5ac43f,_0x8649ec){var _0x4bd8b7={},_0x5ee006={},_0x2cd200={'count':0x0,'rows':[]};var _0x3de320=_['map'](db[_0x7b67('0x26')]['rawAttributes'],function(_0x4815ab){return{'name':_0x4815ab[_0x7b67('0x27')],'type':_0x4815ab[_0x7b67('0x28')][_0x7b67('0x29')]};});_0x5ee006[_0x7b67('0x2a')]=_[_0x7b67('0x2b')](_0x3de320,_0x7b67('0x25'));_0x5ee006[_0x7b67('0x2c')]=_[_0x7b67('0x2d')](_0x5ac43f[_0x7b67('0x2c')]);_0x5ee006[_0x7b67('0x2e')]=_[_0x7b67('0x2f')](_0x5ee006[_0x7b67('0x2a')],_0x5ee006[_0x7b67('0x2c')]);_0x4bd8b7[_0x7b67('0x30')]=_[_0x7b67('0x2f')](_0x5ee006[_0x7b67('0x2a')],qs[_0x7b67('0x31')](_0x5ac43f['query'][_0x7b67('0x31')]));_0x4bd8b7[_0x7b67('0x30')]=_0x4bd8b7['attributes'][_0x7b67('0x32')]?_0x4bd8b7[_0x7b67('0x30')]:_0x5ee006[_0x7b67('0x2a')];if(!_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x33')](_0x7b67('0x34'))){_0x4bd8b7[_0x7b67('0x1b')]=qs[_0x7b67('0x1b')](_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x1b')]);_0x4bd8b7[_0x7b67('0x19')]=qs[_0x7b67('0x19')](_0x5ac43f[_0x7b67('0x2c')]['offset']);}_0x4bd8b7[_0x7b67('0x35')]=qs[_0x7b67('0x36')](_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x36')]);_0x4bd8b7['where']=qs[_0x7b67('0x2e')](_[_0x7b67('0x37')](_0x5ac43f[_0x7b67('0x2c')],_0x5ee006[_0x7b67('0x2e')]),_0x3de320);if(_0x5ac43f[_0x7b67('0x2c')]['filter']){_0x4bd8b7[_0x7b67('0x38')]=_[_0x7b67('0x39')](_0x4bd8b7[_0x7b67('0x38')],{'$or':_[_0x7b67('0x2b')](_0x3de320,function(_0x2f82ac){if(_0x2f82ac[_0x7b67('0x28')]!==_0x7b67('0x3a')){var _0x254eec={};_0x254eec[_0x2f82ac[_0x7b67('0x25')]]={'$like':'%'+_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x3b')]+'%'};return _0x254eec;}})});}_0x4bd8b7=_[_0x7b67('0x39')]({},_0x4bd8b7,_0x5ac43f[_0x7b67('0x3c')]);var _0x2ef44e={'where':_0x4bd8b7[_0x7b67('0x38')]};return db['FreshdeskAccount'][_0x7b67('0x1c')](_0x2ef44e)[_0x7b67('0x21')](function(_0x1d19c8){_0x2cd200[_0x7b67('0x1c')]=_0x1d19c8;if(_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x3d')]){_0x4bd8b7['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x7b67('0x3e')](_0x4bd8b7);})[_0x7b67('0x21')](function(_0x571ac9){_0x2cd200['rows']=_0x571ac9;return _0x2cd200;})[_0x7b67('0x21')](respondWithFilteredResult(_0x8649ec,_0x4bd8b7))[_0x7b67('0x3f')](handleError(_0x8649ec,null));};exports[_0x7b67('0x40')]=function(_0x30da75,_0x3e6f37){var _0x46629b={'raw':![],'where':{'id':_0x30da75[_0x7b67('0x41')]['id']}},_0x4f39df={};_0x4f39df[_0x7b67('0x2a')]=_[_0x7b67('0x2d')](db[_0x7b67('0x26')]['rawAttributes']);_0x4f39df[_0x7b67('0x2c')]=_[_0x7b67('0x2d')](_0x30da75[_0x7b67('0x2c')]);_0x4f39df['filters']=_['intersection'](_0x4f39df[_0x7b67('0x2a')],_0x4f39df['query']);_0x46629b[_0x7b67('0x30')]=_['intersection'](_0x4f39df['model'],qs[_0x7b67('0x31')](_0x30da75['query'][_0x7b67('0x31')]));_0x46629b['attributes']=_0x46629b[_0x7b67('0x30')][_0x7b67('0x32')]?_0x46629b['attributes']:_0x4f39df[_0x7b67('0x2a')];if(_0x30da75[_0x7b67('0x2c')][_0x7b67('0x3d')]){_0x46629b[_0x7b67('0x42')]=[{'all':!![]}];}_0x46629b=_[_0x7b67('0x39')]({},_0x46629b,_0x30da75[_0x7b67('0x3c')]);return db[_0x7b67('0x26')][_0x7b67('0x43')](_0x46629b)[_0x7b67('0x21')](handleEntityNotFound(_0x3e6f37,null))[_0x7b67('0x21')](respondWithResult(_0x3e6f37,null))[_0x7b67('0x3f')](handleError(_0x3e6f37,null));};exports[_0x7b67('0x44')]=function(_0x3dd431,_0x3e7b0f){return db['FreshdeskAccount'][_0x7b67('0x44')](_0x3dd431[_0x7b67('0x45')],{})['then'](respondWithResult(_0x3e7b0f,0xc9))[_0x7b67('0x3f')](handleError(_0x3e7b0f,null));};exports['update']=function(_0x1c80e9,_0x3ae6d5){if(_0x1c80e9[_0x7b67('0x45')]['id']){delete _0x1c80e9[_0x7b67('0x45')]['id'];}return db['FreshdeskAccount'][_0x7b67('0x43')]({'where':{'id':_0x1c80e9[_0x7b67('0x41')]['id']}})[_0x7b67('0x21')](handleEntityNotFound(_0x3ae6d5,null))['then'](saveUpdates(_0x1c80e9['body'],null))[_0x7b67('0x21')](respondWithResult(_0x3ae6d5,null))[_0x7b67('0x3f')](handleError(_0x3ae6d5,null));};exports['destroy']=function(_0x501088,_0x3d35c3){return db[_0x7b67('0x26')][_0x7b67('0x43')]({'where':{'id':_0x501088[_0x7b67('0x41')]['id']}})[_0x7b67('0x21')](handleEntityNotFound(_0x3d35c3,null))['then'](removeEntity(_0x3d35c3,null))[_0x7b67('0x3f')](handleError(_0x3d35c3,null));};exports[_0x7b67('0x46')]=function(_0x3689e4,_0x439551,_0x5a6b5d){var _0x1a2b81={};var _0x5465db={};var _0x3510b6;var _0x1ea2b5;return db[_0x7b67('0x26')][_0x7b67('0x47')]({'where':{'id':_0x3689e4[_0x7b67('0x41')]['id']}})[_0x7b67('0x21')](handleEntityNotFound(_0x439551,null))[_0x7b67('0x21')](function(_0x2023da){if(_0x2023da){_0x3510b6=_0x2023da;_0x5465db['model']=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x5465db[_0x7b67('0x2c')]=_[_0x7b67('0x2d')](_0x3689e4[_0x7b67('0x2c')]);_0x5465db[_0x7b67('0x2e')]=_[_0x7b67('0x2f')](_0x5465db['model'],_0x5465db[_0x7b67('0x2c')]);_0x1a2b81['attributes']=_[_0x7b67('0x2f')](_0x5465db[_0x7b67('0x2a')],qs[_0x7b67('0x31')](_0x3689e4[_0x7b67('0x2c')][_0x7b67('0x31')]));_0x1a2b81['attributes']=_0x1a2b81[_0x7b67('0x30')][_0x7b67('0x32')]?_0x1a2b81[_0x7b67('0x30')]:_0x5465db[_0x7b67('0x2a')];_0x1a2b81['order']=qs[_0x7b67('0x36')](_0x3689e4[_0x7b67('0x2c')]['sort']);_0x1a2b81[_0x7b67('0x38')]=qs[_0x7b67('0x2e')](_[_0x7b67('0x37')](_0x3689e4['query'],_0x5465db[_0x7b67('0x2e')]));if(_0x3689e4[_0x7b67('0x2c')]['filter']){_0x1a2b81['where']=_[_0x7b67('0x39')](_0x1a2b81[_0x7b67('0x38')],{'$or':_[_0x7b67('0x2b')](_0x1a2b81['attributes'],function(_0x1048e9){var _0x1767f9={};_0x1767f9[_0x1048e9]={'$like':'%'+_0x3689e4[_0x7b67('0x2c')]['filter']+'%'};return _0x1767f9;})});}_0x1a2b81=_[_0x7b67('0x39')]({},_0x1a2b81,_0x3689e4[_0x7b67('0x3c')]);return _0x3510b6['getConfigurations'](_0x1a2b81);}})['then'](function(_0x4f9267){if(_0x4f9267){_0x1ea2b5=_0x4f9267[_0x7b67('0x32')];if(!_0x3689e4[_0x7b67('0x2c')][_0x7b67('0x33')]('nolimit')){_0x1a2b81['limit']=qs[_0x7b67('0x1b')](_0x3689e4['query'][_0x7b67('0x1b')]);_0x1a2b81[_0x7b67('0x19')]=qs[_0x7b67('0x19')](_0x3689e4['query'][_0x7b67('0x19')]);}return _0x3510b6[_0x7b67('0x46')](_0x1a2b81);}})[_0x7b67('0x21')](function(_0x44d54b){if(_0x44d54b){return _0x44d54b?{'count':_0x1ea2b5,'rows':_0x44d54b}:null;}})[_0x7b67('0x21')](respondWithResult(_0x439551,null))[_0x7b67('0x3f')](handleError(_0x439551,null));};exports[_0x7b67('0x48')]=function(_0x7c9f96,_0x1e4b7a,_0x16dd22){if(_0x7c9f96['body']['id']){delete _0x7c9f96[_0x7b67('0x45')]['id'];}return db[_0x7b67('0x26')]['findOne']({'where':{'id':_0x7c9f96['params']['id']}})[_0x7b67('0x21')](handleEntityNotFound(_0x1e4b7a,null))['then'](function(_0x5115bc){if(_0x5115bc){_0x7c9f96[_0x7b67('0x45')]['AccountId']=_0x5115bc['id'];_0x7c9f96['body'][_0x7b67('0x49')]=integrations['getSubjects'](_0x7c9f96[_0x7b67('0x45')][_0x7b67('0x4a')],_0x7c9f96[_0x7b67('0x45')][_0x7b67('0x28')]);_0x7c9f96[_0x7b67('0x45')][_0x7b67('0x4b')]=integrations['getDescriptions'](_0x7c9f96['body']['channel'],_0x7c9f96[_0x7b67('0x45')][_0x7b67('0x28')]);return db[_0x7b67('0x4c')][_0x7b67('0x44')](_0x7c9f96['body'],{'include':[{'model':db[_0x7b67('0x4d')],'as':_0x7b67('0x49')},{'model':db[_0x7b67('0x4d')],'as':_0x7b67('0x4b')}]});}return null;})[_0x7b67('0x21')](respondWithResult(_0x1e4b7a,null))[_0x7b67('0x3f')](handleError(_0x1e4b7a,null));};exports[_0x7b67('0x4e')]=function(_0x2c83e7,_0x498b04,_0x3b7d30){var _0xd8ced3='';return db['FreshdeskAccount'][_0x7b67('0x47')]({'where':{'id':_0x2c83e7[_0x7b67('0x41')]['id']},'attributes':['id',_0x7b67('0x4f'),_0x7b67('0x50')]})[_0x7b67('0x21')](handleEntityNotFound(_0x498b04,null))['then'](function(_0x1cdecd){if(_0x1cdecd){_0xd8ced3=_0x1cdecd['remoteUri'];var _0x2cbab9=_0xd8ced3[_0x7b67('0x51')](-0x1);if(_0x2cbab9==='/'){_0xd8ced3=_0xd8ced3['substring'](0x0,_0xd8ced3[_0x7b67('0x52')](_0x2cbab9));}return rp({'method':_0x7b67('0x53'),'uri':util[_0x7b67('0x54')]('%s/%s',_0xd8ced3,_0x7b67('0x55')),'headers':{'Authorization':util[_0x7b67('0x54')]('Basic\x20%s',new Buffer(util[_0x7b67('0x54')](_0x7b67('0x56'),_0x1cdecd['apiKey']))['toString']('base64'))},'json':!![]});}})[_0x7b67('0x21')](function(_0x3293a1){if(_0x3293a1){var _0xa13bd9=[_0x7b67('0x57'),_0x7b67('0x58'),_0x7b67('0x59'),'description','status',_0x7b67('0x5a'),_0x7b67('0x5b'),_0x7b67('0x5c'),'ticket_type','group',_0x7b67('0x5d')];_[_0x7b67('0x5e')](_0x3293a1,function(_0x510b1f){return _0xa13bd9[_0x7b67('0x5f')](_0x510b1f[_0x7b67('0x25')])||!_0x510b1f[_0x7b67('0x60')]&&_0x510b1f['type']!==_0x7b67('0x61')&&_0x510b1f[_0x7b67('0x28')]!==_0x7b67('0x62');});return{'count':_0x3293a1[_0x7b67('0x32')],'rows':_[_0x7b67('0x2b')](_0x3293a1,function(_0xc6314f){return{'id':_0xc6314f[_0x7b67('0x25')],'name':_0xc6314f[_0x7b67('0x63')],'custom':!_0xc6314f[_0x7b67('0x60')],'options':_0xc6314f[_0x7b67('0x64')]?_['map'](_0xc6314f['choices'],function(_0x225000){return{'name':_[_0x7b67('0x65')](_0x225000),'value':_0x225000};}):[]};})};}})[_0x7b67('0x21')](respondWithResult(_0x498b04,null))['catch'](function(_0x2a9bcd){var _0x33f21b=_0x2c83e7['query'][_0x7b67('0x66')]?0x1f4:_0x2a9bcd[_0x7b67('0x67')]||0x1f4;logger[_0x7b67('0x24')](_0x7b67('0x68'),_0x7b67('0x4e'),_0x33f21b,JSON[_0x7b67('0x69')](_0x2a9bcd));delete _0x2a9bcd[_0x7b67('0x25')];if(_0x33f21b===0x191){_0x33f21b=0x190;}_0x498b04['status'](_0x33f21b)[_0x7b67('0x6a')](_0x2c83e7['query']['test']?{'message':_0x7b67('0x6b'),'statusCode':_0x2a9bcd[_0x7b67('0x67')]}:_0x2a9bcd);});}; \ No newline at end of file +var _0xb9be=['save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','FreshdeskAccount','includeAll','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','order','AccountId','getSubjects','type','Descriptions','channel','FreshdeskConfiguration','FreshdeskField','Subjects','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','base64','requester','subject','agent','description','priority','group','source','ticket_type','default','custom_dropdown','label','choices','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','reject'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xb9be,0xc5));var _0xeb9b=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0xb9be[_0x1fa759];return _0x2da9f4;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require(_0xeb9b('0x1'));var zipdir=require(_0xeb9b('0x2'));var jsonpatch=require(_0xeb9b('0x3'));var rp=require(_0xeb9b('0x4'));var moment=require(_0xeb9b('0x5'));var BPromise=require(_0xeb9b('0x6'));var Mustache=require(_0xeb9b('0x7'));var util=require(_0xeb9b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb9b('0x9'));var ejs=require(_0xeb9b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xb'));var _=require('lodash');var squel=require(_0xeb9b('0xc'));var crypto=require(_0xeb9b('0xd'));var jsforce=require(_0xeb9b('0xe'));var deskjs=require(_0xeb9b('0xf'));var toCsv=require(_0xeb9b('0x9'));var querystring=require(_0xeb9b('0x10'));var Papa=require(_0xeb9b('0x11'));var Redis=require(_0xeb9b('0x12'));var authService=require(_0xeb9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb9b('0x15'));var utils=require(_0xeb9b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeb9b('0x17'));var db=require(_0xeb9b('0x18'))['db'];var integrations=require(_0xeb9b('0x19'));function respondWithStatusCode(_0x2a01df,_0x51598f){_0x51598f=_0x51598f||0xcc;return function(_0x5e94e3){if(_0x5e94e3){return _0x2a01df['sendStatus'](_0x51598f);}return _0x2a01df[_0xeb9b('0x1a')](_0x51598f)[_0xeb9b('0x1b')]();};}function respondWithResult(_0x2674e6,_0x4ec46d){_0x4ec46d=_0x4ec46d||0xc8;return function(_0x5926e1){if(_0x5926e1){return _0x2674e6['status'](_0x4ec46d)[_0xeb9b('0x1c')](_0x5926e1);}};}function respondWithFilteredResult(_0x1a5f27,_0x406afd){return function(_0x3fa308){if(_0x3fa308){var _0x2c9aa6=typeof _0x406afd[_0xeb9b('0x1d')]===_0xeb9b('0x1e')&&typeof _0x406afd['limit']===_0xeb9b('0x1e');var _0x36e871=_0x3fa308[_0xeb9b('0x1f')];var _0x3a11e3=_0x2c9aa6?0x0:_0x406afd[_0xeb9b('0x1d')];var _0x1a140c=_0x2c9aa6?_0x3fa308[_0xeb9b('0x1f')]:_0x406afd[_0xeb9b('0x1d')]+_0x406afd[_0xeb9b('0x20')];var _0x26e312;if(_0x1a140c>=_0x36e871){_0x1a140c=_0x36e871;_0x26e312=0xc8;}else{_0x26e312=0xce;}_0x1a5f27['status'](_0x26e312);return _0x1a5f27[_0xeb9b('0x21')]('Content-Range',_0x3a11e3+'-'+_0x1a140c+'/'+_0x36e871)['json'](_0x3fa308);}return null;};}function patchUpdates(_0x580498){return function(_0x703f0b){try{jsonpatch['apply'](_0x703f0b,_0x580498,!![]);}catch(_0xbed5ce){return BPromise[_0xeb9b('0x22')](_0xbed5ce);}return _0x703f0b[_0xeb9b('0x23')]();};}function saveUpdates(_0x37d7e0,_0x3c8be7){return function(_0x43dab8){if(_0x43dab8){return _0x43dab8[_0xeb9b('0x24')](_0x37d7e0)[_0xeb9b('0x25')](function(_0x142d1c){return _0x142d1c;});}return null;};}function removeEntity(_0x46df93,_0x61c86d){return function(_0x296f95){if(_0x296f95){return _0x296f95[_0xeb9b('0x26')]()[_0xeb9b('0x25')](function(){_0x46df93[_0xeb9b('0x1a')](0xcc)[_0xeb9b('0x1b')]();});}};}function handleEntityNotFound(_0x4c997e,_0xd57390){return function(_0x4ed960){if(!_0x4ed960){_0x4c997e[_0xeb9b('0x27')](0x194);}return _0x4ed960;};}function handleError(_0x5d6846,_0x347ec1){_0x347ec1=_0x347ec1||0x1f4;return function(_0x4361b9){logger[_0xeb9b('0x28')](_0x4361b9[_0xeb9b('0x29')]);if(_0x4361b9['name']){delete _0x4361b9[_0xeb9b('0x2a')];}_0x5d6846[_0xeb9b('0x1a')](_0x347ec1)['send'](_0x4361b9);};}exports[_0xeb9b('0x2b')]=function(_0x33bb1d,_0x5ce745){var _0x2a4b51={},_0x2ea20f={},_0x4188d5={'count':0x0,'rows':[]};var _0x48c5f4=_[_0xeb9b('0x2c')](db['FreshdeskAccount'][_0xeb9b('0x2d')],function(_0x4c1331){return{'name':_0x4c1331[_0xeb9b('0x2e')],'type':_0x4c1331['type'][_0xeb9b('0x2f')]};});_0x2ea20f['model']=_[_0xeb9b('0x2c')](_0x48c5f4,'name');_0x2ea20f[_0xeb9b('0x30')]=_[_0xeb9b('0x31')](_0x33bb1d[_0xeb9b('0x30')]);_0x2ea20f[_0xeb9b('0x32')]=_[_0xeb9b('0x33')](_0x2ea20f[_0xeb9b('0x34')],_0x2ea20f[_0xeb9b('0x30')]);_0x2a4b51[_0xeb9b('0x35')]=_[_0xeb9b('0x33')](_0x2ea20f[_0xeb9b('0x34')],qs['fields'](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x36')]));_0x2a4b51[_0xeb9b('0x35')]=_0x2a4b51[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0x2a4b51[_0xeb9b('0x35')]:_0x2ea20f[_0xeb9b('0x34')];if(!_0x33bb1d['query'][_0xeb9b('0x38')](_0xeb9b('0x39'))){_0x2a4b51[_0xeb9b('0x20')]=qs['limit'](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x20')]);_0x2a4b51[_0xeb9b('0x1d')]=qs[_0xeb9b('0x1d')](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x1d')]);}_0x2a4b51['order']=qs[_0xeb9b('0x3a')](_0x33bb1d[_0xeb9b('0x30')]['sort']);_0x2a4b51[_0xeb9b('0x3b')]=qs[_0xeb9b('0x32')](_[_0xeb9b('0x3c')](_0x33bb1d[_0xeb9b('0x30')],_0x2ea20f[_0xeb9b('0x32')]),_0x48c5f4);if(_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x3d')]){_0x2a4b51['where']=_[_0xeb9b('0x3e')](_0x2a4b51[_0xeb9b('0x3b')],{'$or':_[_0xeb9b('0x2c')](_0x48c5f4,function(_0x53d2f7){if(_0x53d2f7['type']!=='VIRTUAL'){var _0x26dc71={};_0x26dc71[_0x53d2f7[_0xeb9b('0x2a')]]={'$like':'%'+_0x33bb1d[_0xeb9b('0x30')]['filter']+'%'};return _0x26dc71;}})});}_0x2a4b51=_[_0xeb9b('0x3e')]({},_0x2a4b51,_0x33bb1d[_0xeb9b('0x3f')]);var _0x240d8d={'where':_0x2a4b51[_0xeb9b('0x3b')]};return db[_0xeb9b('0x40')][_0xeb9b('0x1f')](_0x240d8d)[_0xeb9b('0x25')](function(_0x492122){_0x4188d5[_0xeb9b('0x1f')]=_0x492122;if(_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x41')]){_0x2a4b51['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0xeb9b('0x42')](_0x2a4b51);})[_0xeb9b('0x25')](function(_0x495998){_0x4188d5[_0xeb9b('0x43')]=_0x495998;return _0x4188d5;})['then'](respondWithFilteredResult(_0x5ce745,_0x2a4b51))[_0xeb9b('0x44')](handleError(_0x5ce745,null));};exports[_0xeb9b('0x45')]=function(_0x28b075,_0x300565){var _0xbee63e={'raw':![],'where':{'id':_0x28b075[_0xeb9b('0x46')]['id']}},_0x10f483={};_0x10f483[_0xeb9b('0x34')]=_[_0xeb9b('0x31')](db[_0xeb9b('0x40')][_0xeb9b('0x2d')]);_0x10f483[_0xeb9b('0x30')]=_['keys'](_0x28b075['query']);_0x10f483[_0xeb9b('0x32')]=_['intersection'](_0x10f483[_0xeb9b('0x34')],_0x10f483[_0xeb9b('0x30')]);_0xbee63e[_0xeb9b('0x35')]=_['intersection'](_0x10f483[_0xeb9b('0x34')],qs[_0xeb9b('0x36')](_0x28b075['query'][_0xeb9b('0x36')]));_0xbee63e[_0xeb9b('0x35')]=_0xbee63e[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0xbee63e[_0xeb9b('0x35')]:_0x10f483[_0xeb9b('0x34')];if(_0x28b075[_0xeb9b('0x30')][_0xeb9b('0x41')]){_0xbee63e['include']=[{'all':!![]}];}_0xbee63e=_['merge']({},_0xbee63e,_0x28b075[_0xeb9b('0x3f')]);return db['FreshdeskAccount']['find'](_0xbee63e)[_0xeb9b('0x25')](handleEntityNotFound(_0x300565,null))[_0xeb9b('0x25')](respondWithResult(_0x300565,null))[_0xeb9b('0x44')](handleError(_0x300565,null));};exports[_0xeb9b('0x47')]=function(_0x45bc74,_0x2fd6ee){return db['FreshdeskAccount']['create'](_0x45bc74['body'],{})[_0xeb9b('0x25')](respondWithResult(_0x2fd6ee,0xc9))['catch'](handleError(_0x2fd6ee,null));};exports[_0xeb9b('0x24')]=function(_0x2ee59c,_0x2ae9bf){if(_0x2ee59c[_0xeb9b('0x48')]['id']){delete _0x2ee59c[_0xeb9b('0x48')]['id'];}return db[_0xeb9b('0x40')][_0xeb9b('0x49')]({'where':{'id':_0x2ee59c[_0xeb9b('0x46')]['id']}})[_0xeb9b('0x25')](handleEntityNotFound(_0x2ae9bf,null))[_0xeb9b('0x25')](saveUpdates(_0x2ee59c['body'],null))['then'](respondWithResult(_0x2ae9bf,null))[_0xeb9b('0x44')](handleError(_0x2ae9bf,null));};exports[_0xeb9b('0x26')]=function(_0x542ef4,_0x19bfe9){return db['FreshdeskAccount'][_0xeb9b('0x49')]({'where':{'id':_0x542ef4[_0xeb9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x19bfe9,null))['then'](removeEntity(_0x19bfe9,null))['catch'](handleError(_0x19bfe9,null));};exports[_0xeb9b('0x4a')]=function(_0x32d8cd,_0x263453,_0x4fe9d0){var _0x4ded40={};var _0x471161={};var _0x1833c2;var _0x3e6e73;return db[_0xeb9b('0x40')][_0xeb9b('0x4b')]({'where':{'id':_0x32d8cd[_0xeb9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x263453,null))[_0xeb9b('0x25')](function(_0x1fab7a){if(_0x1fab7a){_0x1833c2=_0x1fab7a;_0x471161['model']=_[_0xeb9b('0x31')](db['FreshdeskConfiguration'][_0xeb9b('0x2d')]);_0x471161[_0xeb9b('0x30')]=_['keys'](_0x32d8cd[_0xeb9b('0x30')]);_0x471161['filters']=_[_0xeb9b('0x33')](_0x471161[_0xeb9b('0x34')],_0x471161[_0xeb9b('0x30')]);_0x4ded40[_0xeb9b('0x35')]=_[_0xeb9b('0x33')](_0x471161['model'],qs[_0xeb9b('0x36')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x36')]));_0x4ded40['attributes']=_0x4ded40[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0x4ded40[_0xeb9b('0x35')]:_0x471161[_0xeb9b('0x34')];_0x4ded40[_0xeb9b('0x4c')]=qs[_0xeb9b('0x3a')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x3a')]);_0x4ded40[_0xeb9b('0x3b')]=qs[_0xeb9b('0x32')](_[_0xeb9b('0x3c')](_0x32d8cd['query'],_0x471161['filters']));if(_0x32d8cd['query'][_0xeb9b('0x3d')]){_0x4ded40['where']=_[_0xeb9b('0x3e')](_0x4ded40[_0xeb9b('0x3b')],{'$or':_[_0xeb9b('0x2c')](_0x4ded40['attributes'],function(_0x27deea){var _0xb29d24={};_0xb29d24[_0x27deea]={'$like':'%'+_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x3d')]+'%'};return _0xb29d24;})});}_0x4ded40=_[_0xeb9b('0x3e')]({},_0x4ded40,_0x32d8cd[_0xeb9b('0x3f')]);return _0x1833c2[_0xeb9b('0x4a')](_0x4ded40);}})[_0xeb9b('0x25')](function(_0x58a3e2){if(_0x58a3e2){_0x3e6e73=_0x58a3e2['length'];if(!_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x38')](_0xeb9b('0x39'))){_0x4ded40['limit']=qs[_0xeb9b('0x20')](_0x32d8cd['query'][_0xeb9b('0x20')]);_0x4ded40['offset']=qs[_0xeb9b('0x1d')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x1d')]);}return _0x1833c2[_0xeb9b('0x4a')](_0x4ded40);}})[_0xeb9b('0x25')](function(_0x4be938){if(_0x4be938){return _0x4be938?{'count':_0x3e6e73,'rows':_0x4be938}:null;}})[_0xeb9b('0x25')](respondWithResult(_0x263453,null))[_0xeb9b('0x44')](handleError(_0x263453,null));};exports['addConfiguration']=function(_0x5a690a,_0x436470,_0x39c248){if(_0x5a690a['body']['id']){delete _0x5a690a[_0xeb9b('0x48')]['id'];}return db['FreshdeskAccount'][_0xeb9b('0x4b')]({'where':{'id':_0x5a690a['params']['id']}})[_0xeb9b('0x25')](handleEntityNotFound(_0x436470,null))[_0xeb9b('0x25')](function(_0x417221){if(_0x417221){_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x4d')]=_0x417221['id'];_0x5a690a[_0xeb9b('0x48')]['Subjects']=integrations[_0xeb9b('0x4e')](_0x5a690a[_0xeb9b('0x48')]['channel'],_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x4f')]);_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x50')]=integrations['getDescriptions'](_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x51')],_0x5a690a['body'][_0xeb9b('0x4f')]);return db[_0xeb9b('0x52')][_0xeb9b('0x47')](_0x5a690a[_0xeb9b('0x48')],{'include':[{'model':db[_0xeb9b('0x53')],'as':_0xeb9b('0x54')},{'model':db[_0xeb9b('0x53')],'as':'Descriptions'}]});}return null;})[_0xeb9b('0x25')](respondWithResult(_0x436470,null))[_0xeb9b('0x44')](handleError(_0x436470,null));};exports['getFields']=function(_0x289654,_0x6a85fd,_0x2fb07e){var _0x25398e='';return db['FreshdeskAccount'][_0xeb9b('0x4b')]({'where':{'id':_0x289654[_0xeb9b('0x46')]['id']},'attributes':['id',_0xeb9b('0x55'),_0xeb9b('0x56')]})[_0xeb9b('0x25')](handleEntityNotFound(_0x6a85fd,null))[_0xeb9b('0x25')](function(_0x46a070){if(_0x46a070){_0x25398e=_0x46a070[_0xeb9b('0x55')];var _0xdbb94f=_0x25398e[_0xeb9b('0x57')](-0x1);if(_0xdbb94f==='/'){_0x25398e=_0x25398e[_0xeb9b('0x58')](0x0,_0x25398e[_0xeb9b('0x59')](_0xdbb94f));}return rp({'method':_0xeb9b('0x5a'),'uri':util[_0xeb9b('0x5b')](_0xeb9b('0x5c'),_0x25398e,_0xeb9b('0x5d')),'headers':{'Authorization':util['format'](_0xeb9b('0x5e'),new Buffer(util[_0xeb9b('0x5b')](_0xeb9b('0x5f'),_0x46a070['apiKey']))['toString'](_0xeb9b('0x60')))},'json':!![]});}})['then'](function(_0x1e842f){if(_0x1e842f){var _0x463767=[_0xeb9b('0x61'),_0xeb9b('0x62'),_0xeb9b('0x63'),_0xeb9b('0x64'),_0xeb9b('0x1a'),_0xeb9b('0x65'),_0xeb9b('0x66'),_0xeb9b('0x67'),_0xeb9b('0x68'),_0xeb9b('0x66'),'company'];_['remove'](_0x1e842f,function(_0x2a47e1){return _0x463767['includes'](_0x2a47e1['name'])||!_0x2a47e1[_0xeb9b('0x69')]&&_0x2a47e1['type']!=='custom_text'&&_0x2a47e1['type']!==_0xeb9b('0x6a');});return{'count':_0x1e842f[_0xeb9b('0x37')],'rows':_[_0xeb9b('0x2c')](_0x1e842f,function(_0x37d1f5){return{'id':_0x37d1f5['name'],'name':_0x37d1f5[_0xeb9b('0x6b')],'custom':!_0x37d1f5[_0xeb9b('0x69')],'options':_0x37d1f5[_0xeb9b('0x6c')]?_['map'](_0x37d1f5['choices'],function(_0x3ea644){return{'name':_['capitalize'](_0x3ea644),'value':_0x3ea644};}):[]};})};}})[_0xeb9b('0x25')](respondWithResult(_0x6a85fd,null))['catch'](function(_0x4a18ef){var _0xa7e9c3=_0x289654['query'][_0xeb9b('0x6d')]?0x1f4:_0x4a18ef['statusCode']||0x1f4;logger['error'](_0xeb9b('0x6e'),_0xeb9b('0x6f'),_0xa7e9c3,JSON[_0xeb9b('0x70')](_0x4a18ef));delete _0x4a18ef[_0xeb9b('0x2a')];if(_0xa7e9c3===0x191){_0xa7e9c3=0x190;}_0x6a85fd['status'](_0xa7e9c3)[_0xeb9b('0x71')](_0x289654[_0xeb9b('0x30')][_0xeb9b('0x6d')]?{'message':_0xeb9b('0x72'),'statusCode':_0x4a18ef[_0xeb9b('0x73')]}:_0x4a18ef);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 35b7bea..cbaae4b 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 _0x3ff3=['path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','moment','request-promise'];(function(_0xf7941b,_0x1e022f){var _0xfabcd8=function(_0x12f654){while(--_0x12f654){_0xf7941b['push'](_0xf7941b['shift']());}};_0xfabcd8(++_0x1e022f);}(_0x3ff3,0x104));var _0x33ff=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x3ff3[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0x33ff('0x0'));var logger=require(_0x33ff('0x1'))('api');var moment=require(_0x33ff('0x2'));var BPromise=require('bluebird');var rp=require(_0x33ff('0x3'));var fs=require('fs');var path=require(_0x33ff('0x4'));var rimraf=require(_0x33ff('0x5'));var config=require(_0x33ff('0x6'));var attributes=require(_0x33ff('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x33ff('0x8')]=function(_0x162970,_0x19cc80){return _0x162970[_0x33ff('0x9')](_0x33ff('0xa'),attributes,{'tableName':_0x33ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf8bc=['request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird'];(function(_0x51cd7a,_0x5e42c2){var _0x16a584=function(_0x159230){while(--_0x159230){_0x51cd7a['push'](_0x51cd7a['shift']());}};_0x16a584(++_0x5e42c2);}(_0xf8bc,0xe9));var _0xcf8b=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0xf8bc[_0x453e2b];return _0x50f306;};'use strict';var _=require(_0xcf8b('0x0'));var util=require(_0xcf8b('0x1'));var logger=require(_0xcf8b('0x2'))(_0xcf8b('0x3'));var moment=require('moment');var BPromise=require(_0xcf8b('0x4'));var rp=require(_0xcf8b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcf8b('0x6'));var config=require(_0xcf8b('0x7'));var attributes=require(_0xcf8b('0x8'));var integrations=require(_0xcf8b('0x9'));module[_0xcf8b('0xa')]=function(_0x272a8f,_0x259e82){return _0x272a8f[_0xcf8b('0xb')](_0xcf8b('0xc'),attributes,{'tableName':_0xcf8b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 3518292..75e699d 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 _0xef1e=['request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','raw','options','where','attributes','limit','include','map','model','debug','ShowFreshdeskAccount','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x107fcd,_0x525873){var _0x4254bd=function(_0x3fbe38){while(--_0x3fbe38){_0x107fcd['push'](_0x107fcd['shift']());}};_0x4254bd(++_0x525873);}(_0xef1e,0x14e));var _0xeef1=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xef1e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xeef1('0x0'));var util=require(_0xeef1('0x1'));var moment=require(_0xeef1('0x2'));var BPromise=require(_0xeef1('0x3'));var rs=require(_0xeef1('0x4'));var fs=require('fs');var Redis=require(_0xeef1('0x5'));var db=require(_0xeef1('0x6'))['db'];var utils=require(_0xeef1('0x7'));var logger=require(_0xeef1('0x8'))(_0xeef1('0x9'));var config=require(_0xeef1('0xa'));var jayson=require(_0xeef1('0xb'));var client=jayson[_0xeef1('0xc')][_0xeef1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x27a8fa,_0x405c90,_0x404e9e){return new BPromise(function(_0x566b41,_0xc089cc){return client[_0xeef1('0xe')](_0x27a8fa,_0x404e9e)['then'](function(_0x19a293){logger[_0xeef1('0xf')](_0xeef1('0x10'),_0x405c90,_0xeef1('0x11'));logger['debug'](_0xeef1('0x12'),_0x405c90,_0xeef1('0x11'),JSON[_0xeef1('0x13')](_0x19a293));if(_0x19a293['error']){if(_0x19a293['error'][_0xeef1('0x14')]===0x1f4){logger[_0xeef1('0x15')]('FreshdeskAccount,\x20%s,\x20%s',_0x405c90,_0x19a293['error'][_0xeef1('0x16')]);return _0xc089cc(_0x19a293['error'][_0xeef1('0x16')]);}logger[_0xeef1('0x15')](_0xeef1('0x10'),_0x405c90,_0x19a293['error'][_0xeef1('0x16')]);return _0x566b41(_0x19a293[_0xeef1('0x15')][_0xeef1('0x16')]);}else{logger[_0xeef1('0xf')](_0xeef1('0x10'),_0x405c90,'request\x20sent');_0x566b41(_0x19a293['result'][_0xeef1('0x16')]);}})[_0xeef1('0x17')](function(_0x5e6c02){logger['error'](_0xeef1('0x10'),_0x405c90,_0x5e6c02);_0xc089cc(_0x5e6c02);});});}exports[_0xeef1('0x18')]=function(_0x37ed94){var _0x5df668=this;return new Promise(function(_0x2ac2e6,_0x4f801f){return db[_0xeef1('0x19')][_0xeef1('0x1a')]({'raw':_0x37ed94['options']?_0x37ed94['options'][_0xeef1('0x1b')]===undefined?!![]:![]:!![],'where':_0x37ed94[_0xeef1('0x1c')]?_0x37ed94[_0xeef1('0x1c')][_0xeef1('0x1d')]||null:null,'attributes':_0x37ed94[_0xeef1('0x1c')]?_0x37ed94[_0xeef1('0x1c')][_0xeef1('0x1e')]||null:null,'limit':_0x37ed94['options']?_0x37ed94[_0xeef1('0x1c')][_0xeef1('0x1f')]||null:null,'include':_0x37ed94['options']?_0x37ed94['options'][_0xeef1('0x20')]?_[_0xeef1('0x21')](_0x37ed94[_0xeef1('0x1c')]['include'],function(_0x422dcf){return{'model':db[_0x422dcf['model']],'as':_0x422dcf['as'],'attributes':_0x422dcf['attributes'],'include':_0x422dcf['include']?_[_0xeef1('0x21')](_0x422dcf[_0xeef1('0x20')],function(_0x7845cc){return{'model':db[_0x7845cc[_0xeef1('0x22')]],'as':_0x7845cc['as'],'attributes':_0x7845cc[_0xeef1('0x1e')],'include':_0x7845cc[_0xeef1('0x20')]?_[_0xeef1('0x21')](_0x7845cc[_0xeef1('0x20')],function(_0x1bbf2a){return{'model':db[_0x1bbf2a[_0xeef1('0x22')]],'as':_0x1bbf2a['as'],'attributes':_0x1bbf2a[_0xeef1('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xee70ca){logger[_0xeef1('0xf')](_0xeef1('0x18'),_0x37ed94);logger[_0xeef1('0x23')](_0xeef1('0x18'),_0x37ed94,JSON[_0xeef1('0x13')](_0xee70ca));_0x2ac2e6(_0xee70ca);})['catch'](function(_0x3b4ec7){logger[_0xeef1('0x15')](_0xeef1('0x18'),_0x3b4ec7['message'],_0x37ed94);_0x4f801f(_0x5df668[_0xeef1('0x15')](0x1f4,_0x3b4ec7[_0xeef1('0x16')]));});});};exports[_0xeef1('0x24')]=function(_0x33ccb3){var _0x252845=this;return new Promise(function(_0x33eec5,_0x3aa7b8){return db[_0xeef1('0x19')][_0xeef1('0x25')]({'raw':_0x33ccb3[_0xeef1('0x1c')]?_0x33ccb3[_0xeef1('0x1c')][_0xeef1('0x1b')]===undefined?!![]:![]:!![],'where':_0x33ccb3['options']?_0x33ccb3[_0xeef1('0x1c')]['where']||null:null,'attributes':_0x33ccb3[_0xeef1('0x1c')]?_0x33ccb3[_0xeef1('0x1c')][_0xeef1('0x1e')]||null:null,'include':_0x33ccb3[_0xeef1('0x1c')]?_0x33ccb3['options'][_0xeef1('0x20')]?_[_0xeef1('0x21')](_0x33ccb3[_0xeef1('0x1c')][_0xeef1('0x20')],function(_0x59d1ef){return{'model':db[_0x59d1ef[_0xeef1('0x22')]],'as':_0x59d1ef['as'],'attributes':_0x59d1ef[_0xeef1('0x1e')],'include':_0x59d1ef[_0xeef1('0x20')]?_[_0xeef1('0x21')](_0x59d1ef[_0xeef1('0x20')],function(_0x525413){return{'model':db[_0x525413['model']],'as':_0x525413['as'],'attributes':_0x525413[_0xeef1('0x1e')],'include':_0x525413[_0xeef1('0x20')]?_[_0xeef1('0x21')](_0x525413[_0xeef1('0x20')],function(_0x32e864){return{'model':db[_0x32e864[_0xeef1('0x22')]],'as':_0x32e864['as'],'attributes':_0x32e864[_0xeef1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xeef1('0x26')](function(_0x349b8f){logger[_0xeef1('0xf')]('ShowFreshdeskAccount',_0x33ccb3);logger[_0xeef1('0x23')](_0xeef1('0x24'),_0x33ccb3,JSON[_0xeef1('0x13')](_0x349b8f));_0x33eec5(_0x349b8f);})[_0xeef1('0x17')](function(_0x1d9b4b){logger['error'](_0xeef1('0x24'),_0x1d9b4b[_0xeef1('0x16')],_0x33ccb3);_0x3aa7b8(_0x252845[_0xeef1('0x15')](0x1f4,_0x1d9b4b['message']));});});}; \ No newline at end of file +var _0x1b66=['map','model','GetFreshdeskAccount','ShowFreshdeskAccount','FreshdeskAccount','find','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','findAll','options','raw','where','attributes','limit','include'];(function(_0x5a233b,_0x20c853){var _0x36c697=function(_0x4f25f0){while(--_0x4f25f0){_0x5a233b['push'](_0x5a233b['shift']());}};_0x36c697(++_0x20c853);}(_0x1b66,0xba));var _0x61b6=function(_0x10912e,_0x230c43){_0x10912e=_0x10912e-0x0;var _0x2dbf9e=_0x1b66[_0x10912e];return _0x2dbf9e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x61b6('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61b6('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x61b6('0x2'))(_0x61b6('0x3'));var config=require(_0x61b6('0x4'));var jayson=require(_0x61b6('0x5'));var client=jayson['client'][_0x61b6('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x501310,_0x577c74,_0x5c8b40){return new BPromise(function(_0x11d049,_0x34f688){return client['request'](_0x501310,_0x5c8b40)[_0x61b6('0x7')](function(_0x40c4dc){logger[_0x61b6('0x8')](_0x61b6('0x9'),_0x577c74,_0x61b6('0xa'));logger[_0x61b6('0xb')](_0x61b6('0xc'),_0x577c74,_0x61b6('0xa'),JSON[_0x61b6('0xd')](_0x40c4dc));if(_0x40c4dc[_0x61b6('0xe')]){if(_0x40c4dc[_0x61b6('0xe')]['code']===0x1f4){logger[_0x61b6('0xe')](_0x61b6('0x9'),_0x577c74,_0x40c4dc[_0x61b6('0xe')][_0x61b6('0xf')]);return _0x34f688(_0x40c4dc[_0x61b6('0xe')][_0x61b6('0xf')]);}logger[_0x61b6('0xe')](_0x61b6('0x9'),_0x577c74,_0x40c4dc['error']['message']);return _0x11d049(_0x40c4dc[_0x61b6('0xe')][_0x61b6('0xf')]);}else{logger['info'](_0x61b6('0x9'),_0x577c74,_0x61b6('0xa'));_0x11d049(_0x40c4dc['result'][_0x61b6('0xf')]);}})[_0x61b6('0x10')](function(_0x3a4f6a){logger[_0x61b6('0xe')](_0x61b6('0x9'),_0x577c74,_0x3a4f6a);_0x34f688(_0x3a4f6a);});});}exports['GetFreshdeskAccount']=function(_0x6535b7){var _0x2758e3=this;return new Promise(function(_0x197a06,_0x4c63a9){return db['FreshdeskAccount'][_0x61b6('0x11')]({'raw':_0x6535b7[_0x61b6('0x12')]?_0x6535b7['options'][_0x61b6('0x13')]===undefined?!![]:![]:!![],'where':_0x6535b7['options']?_0x6535b7[_0x61b6('0x12')][_0x61b6('0x14')]||null:null,'attributes':_0x6535b7['options']?_0x6535b7[_0x61b6('0x12')][_0x61b6('0x15')]||null:null,'limit':_0x6535b7[_0x61b6('0x12')]?_0x6535b7[_0x61b6('0x12')][_0x61b6('0x16')]||null:null,'include':_0x6535b7[_0x61b6('0x12')]?_0x6535b7[_0x61b6('0x12')][_0x61b6('0x17')]?_['map'](_0x6535b7['options']['include'],function(_0x2b5b6b){return{'model':db[_0x2b5b6b['model']],'as':_0x2b5b6b['as'],'attributes':_0x2b5b6b[_0x61b6('0x15')],'include':_0x2b5b6b['include']?_[_0x61b6('0x18')](_0x2b5b6b['include'],function(_0x1ffda7){return{'model':db[_0x1ffda7[_0x61b6('0x19')]],'as':_0x1ffda7['as'],'attributes':_0x1ffda7[_0x61b6('0x15')],'include':_0x1ffda7[_0x61b6('0x17')]?_['map'](_0x1ffda7['include'],function(_0x2d6e00){return{'model':db[_0x2d6e00[_0x61b6('0x19')]],'as':_0x2d6e00['as'],'attributes':_0x2d6e00[_0x61b6('0x15')]};}):[]};}):[]};}):[]:[]})[_0x61b6('0x7')](function(_0x1ec016){logger[_0x61b6('0x8')]('GetFreshdeskAccount',_0x6535b7);logger[_0x61b6('0xb')](_0x61b6('0x1a'),_0x6535b7,JSON[_0x61b6('0xd')](_0x1ec016));_0x197a06(_0x1ec016);})[_0x61b6('0x10')](function(_0x1e89ce){logger['error'](_0x61b6('0x1a'),_0x1e89ce[_0x61b6('0xf')],_0x6535b7);_0x4c63a9(_0x2758e3[_0x61b6('0xe')](0x1f4,_0x1e89ce['message']));});});};exports[_0x61b6('0x1b')]=function(_0x37d2cc){var _0x1e9d5a=this;return new Promise(function(_0x108423,_0x2f7c47){return db[_0x61b6('0x1c')][_0x61b6('0x1d')]({'raw':_0x37d2cc[_0x61b6('0x12')]?_0x37d2cc[_0x61b6('0x12')][_0x61b6('0x13')]===undefined?!![]:![]:!![],'where':_0x37d2cc[_0x61b6('0x12')]?_0x37d2cc['options'][_0x61b6('0x14')]||null:null,'attributes':_0x37d2cc[_0x61b6('0x12')]?_0x37d2cc[_0x61b6('0x12')][_0x61b6('0x15')]||null:null,'include':_0x37d2cc['options']?_0x37d2cc[_0x61b6('0x12')][_0x61b6('0x17')]?_[_0x61b6('0x18')](_0x37d2cc[_0x61b6('0x12')]['include'],function(_0x2189e3){return{'model':db[_0x2189e3[_0x61b6('0x19')]],'as':_0x2189e3['as'],'attributes':_0x2189e3[_0x61b6('0x15')],'include':_0x2189e3[_0x61b6('0x17')]?_[_0x61b6('0x18')](_0x2189e3[_0x61b6('0x17')],function(_0x3d0c73){return{'model':db[_0x3d0c73['model']],'as':_0x3d0c73['as'],'attributes':_0x3d0c73[_0x61b6('0x15')],'include':_0x3d0c73[_0x61b6('0x17')]?_[_0x61b6('0x18')](_0x3d0c73['include'],function(_0x1e18c8){return{'model':db[_0x1e18c8[_0x61b6('0x19')]],'as':_0x1e18c8['as'],'attributes':_0x1e18c8[_0x61b6('0x15')]};}):[]};}):[]};}):[]:[]})[_0x61b6('0x7')](function(_0x2dc443){logger[_0x61b6('0x8')](_0x61b6('0x1b'),_0x37d2cc);logger[_0x61b6('0xb')](_0x61b6('0x1b'),_0x37d2cc,JSON['stringify'](_0x2dc443));_0x108423(_0x2dc443);})[_0x61b6('0x10')](function(_0x40d8c9){logger[_0x61b6('0xe')](_0x61b6('0x1b'),_0x40d8c9[_0x61b6('0xf')],_0x37d2cc);_0x2f7c47(_0x1e9d5a[_0x61b6('0xe')](0x1f4,_0x40d8c9[_0x61b6('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index d9371bf..d880b96 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 _0x7f76=['get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2734fd,_0x5ba469){var _0x3170d2=function(_0xd1d36f){while(--_0xd1d36f){_0x2734fd['push'](_0x2734fd['shift']());}};_0x3170d2(++_0x5ba469);}(_0x7f76,0x117));var _0x67f7=function(_0x4f274f,_0x16a70c){_0x4f274f=_0x4f274f-0x0;var _0x18345b=_0x7f76[_0x4f274f];return _0x18345b;};'use strict';var multer=require('multer');var util=require(_0x67f7('0x0'));var path=require(_0x67f7('0x1'));var timeout=require(_0x67f7('0x2'));var express=require(_0x67f7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x67f7('0x4'));var interaction=require(_0x67f7('0x5'));var config=require(_0x67f7('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x67f7('0x7')]('/',auth['isAuthenticated'](),controller[_0x67f7('0x8')]);router['get']('/:id',auth[_0x67f7('0x9')](),controller[_0x67f7('0xa')]);router[_0x67f7('0x7')](_0x67f7('0xb'),auth[_0x67f7('0x9')](),controller[_0x67f7('0xc')]);router[_0x67f7('0x7')](_0x67f7('0xd'),auth[_0x67f7('0x9')](),controller['getSubjects']);router[_0x67f7('0x7')](_0x67f7('0xe'),auth[_0x67f7('0x9')](),controller[_0x67f7('0xf')]);router[_0x67f7('0x7')](_0x67f7('0x10'),auth[_0x67f7('0x9')](),controller[_0x67f7('0x11')]);router[_0x67f7('0x12')]('/',auth['isAuthenticated'](),controller[_0x67f7('0x13')]);router[_0x67f7('0x12')]('/:id/tags',auth[_0x67f7('0x9')](),controller[_0x67f7('0x14')]);router[_0x67f7('0x15')](_0x67f7('0x16'),auth[_0x67f7('0x9')](),controller[_0x67f7('0x17')]);router['delete'](_0x67f7('0x16'),auth[_0x67f7('0x9')](),controller[_0x67f7('0x18')]);module[_0x67f7('0x19')]=router; \ No newline at end of file +var _0xd6c6=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x329a6b,_0x9bbc23){var _0x3eb2fc=function(_0x5d35e7){while(--_0x5d35e7){_0x329a6b['push'](_0x329a6b['shift']());}};_0x3eb2fc(++_0x9bbc23);}(_0xd6c6,0x1eb));var _0x6d6c=function(_0x2ce324,_0x3ec3a2){_0x2ce324=_0x2ce324-0x0;var _0xfe7b62=_0xd6c6[_0x2ce324];return _0xfe7b62;};'use strict';var multer=require(_0x6d6c('0x0'));var util=require(_0x6d6c('0x1'));var path=require(_0x6d6c('0x2'));var timeout=require(_0x6d6c('0x3'));var express=require(_0x6d6c('0x4'));var router=express['Router']();var fs_extra=require(_0x6d6c('0x5'));var auth=require(_0x6d6c('0x6'));var interaction=require(_0x6d6c('0x7'));var config=require(_0x6d6c('0x8'));var controller=require(_0x6d6c('0x9'));router[_0x6d6c('0xa')]('/',auth[_0x6d6c('0xb')](),controller[_0x6d6c('0xc')]);router['get']('/:id',auth[_0x6d6c('0xb')](),controller[_0x6d6c('0xd')]);router[_0x6d6c('0xa')](_0x6d6c('0xe'),auth['isAuthenticated'](),controller[_0x6d6c('0xf')]);router[_0x6d6c('0xa')]('/:id/subjects',auth[_0x6d6c('0xb')](),controller['getSubjects']);router[_0x6d6c('0xa')](_0x6d6c('0x10'),auth[_0x6d6c('0xb')](),controller[_0x6d6c('0x11')]);router[_0x6d6c('0xa')](_0x6d6c('0x12'),auth[_0x6d6c('0xb')](),controller[_0x6d6c('0x13')]);router[_0x6d6c('0x14')]('/',auth['isAuthenticated'](),controller[_0x6d6c('0x15')]);router[_0x6d6c('0x14')](_0x6d6c('0x12'),auth['isAuthenticated'](),controller[_0x6d6c('0x16')]);router[_0x6d6c('0x17')](_0x6d6c('0x18'),auth[_0x6d6c('0xb')](),controller[_0x6d6c('0x19')]);router[_0x6d6c('0x1a')](_0x6d6c('0x18'),auth['isAuthenticated'](),controller[_0x6d6c('0x1b')]);module[_0x6d6c('0x1c')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 5422b93..d73d569 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 _0x6fa4=['sequelize','exports','STRING'];(function(_0x16d3e0,_0x187953){var _0x57f150=function(_0x5081cc){while(--_0x5081cc){_0x16d3e0['push'](_0x16d3e0['shift']());}};_0x57f150(++_0x187953);}(_0x6fa4,0xf3));var _0x46fa=function(_0x3b2f74,_0x2b843c){_0x3b2f74=_0x3b2f74-0x0;var _0x134bd8=_0x6fa4[_0x3b2f74];return _0x134bd8;};'use strict';var Sequelize=require(_0x46fa('0x0'));module[_0x46fa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x46fa('0x2')]}}; \ No newline at end of file +var _0x9ba7=['STRING','sequelize'];(function(_0x508685,_0x9f94af){var _0x976a76=function(_0x1bcb05){while(--_0x1bcb05){_0x508685['push'](_0x508685['shift']());}};_0x976a76(++_0x9f94af);}(_0x9ba7,0x13b));var _0x79ba=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x9ba7[_0x46efd7];return _0x5637e4;};'use strict';var Sequelize=require(_0x79ba('0x0'));module['exports']={'name':{'type':Sequelize[_0x79ba('0x1')]},'description':{'type':Sequelize[_0x79ba('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index ea844f0..b6938c6 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 _0x7a3c=['apply','reject','save','update','then','error','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','name','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','find','create','body','catch','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0x7a3c,0x1e4));var _0xc7a3=function(_0x10a940,_0x2dbfbd){_0x10a940=_0x10a940-0x0;var _0x1959da=_0x7a3c[_0x10a940];return _0x1959da;};'use strict';var emlformat=require(_0xc7a3('0x0'));var rimraf=require(_0xc7a3('0x1'));var zipdir=require(_0xc7a3('0x2'));var jsonpatch=require(_0xc7a3('0x3'));var rp=require('request-promise');var moment=require(_0xc7a3('0x4'));var BPromise=require(_0xc7a3('0x5'));var Mustache=require(_0xc7a3('0x6'));var util=require(_0xc7a3('0x7'));var path=require(_0xc7a3('0x8'));var sox=require(_0xc7a3('0x9'));var csv=require('to-csv');var ejs=require(_0xc7a3('0xa'));var fs=require('fs');var fs_extra=require(_0xc7a3('0xb'));var _=require(_0xc7a3('0xc'));var squel=require(_0xc7a3('0xd'));var crypto=require(_0xc7a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc7a3('0xf'));var querystring=require(_0xc7a3('0x10'));var Papa=require(_0xc7a3('0x11'));var Redis=require(_0xc7a3('0x12'));var authService=require(_0xc7a3('0x13'));var qs=require(_0xc7a3('0x14'));var as=require(_0xc7a3('0x15'));var hardwareService=require(_0xc7a3('0x16'));var logger=require('../../config/logger')(_0xc7a3('0x17'));var utils=require(_0xc7a3('0x18'));var config=require(_0xc7a3('0x19'));var licenseUtil=require(_0xc7a3('0x1a'));var db=require(_0xc7a3('0x1b'))['db'];function respondWithStatusCode(_0x358430,_0x4dac71){_0x4dac71=_0x4dac71||0xcc;return function(_0x1c0ffb){if(_0x1c0ffb){return _0x358430[_0xc7a3('0x1c')](_0x4dac71);}return _0x358430['status'](_0x4dac71)[_0xc7a3('0x1d')]();};}function respondWithResult(_0x2b53b4,_0xc4b62c){_0xc4b62c=_0xc4b62c||0xc8;return function(_0x1c1882){if(_0x1c1882){return _0x2b53b4[_0xc7a3('0x1e')](_0xc4b62c)[_0xc7a3('0x1f')](_0x1c1882);}};}function respondWithFilteredResult(_0x51b455,_0x1538e2){return function(_0x3306ce){if(_0x3306ce){var _0x68ef06=typeof _0x1538e2['offset']===_0xc7a3('0x20')&&typeof _0x1538e2[_0xc7a3('0x21')]===_0xc7a3('0x20');var _0x5d090a=_0x3306ce['count'];var _0x502895=_0x68ef06?0x0:_0x1538e2[_0xc7a3('0x22')];var _0x3acae4=_0x68ef06?_0x3306ce[_0xc7a3('0x23')]:_0x1538e2[_0xc7a3('0x22')]+_0x1538e2[_0xc7a3('0x21')];var _0x5c1a92;if(_0x3acae4>=_0x5d090a){_0x3acae4=_0x5d090a;_0x5c1a92=0xc8;}else{_0x5c1a92=0xce;}_0x51b455['status'](_0x5c1a92);return _0x51b455[_0xc7a3('0x24')](_0xc7a3('0x25'),_0x502895+'-'+_0x3acae4+'/'+_0x5d090a)[_0xc7a3('0x1f')](_0x3306ce);}return null;};}function patchUpdates(_0x214ba2){return function(_0x730769){try{jsonpatch[_0xc7a3('0x26')](_0x730769,_0x214ba2,!![]);}catch(_0x262ef9){return BPromise[_0xc7a3('0x27')](_0x262ef9);}return _0x730769[_0xc7a3('0x28')]();};}function saveUpdates(_0x48c6a2,_0x5718a8){return function(_0x36a846){if(_0x36a846){return _0x36a846[_0xc7a3('0x29')](_0x48c6a2)[_0xc7a3('0x2a')](function(_0x3b3ea0){return _0x3b3ea0;});}return null;};}function removeEntity(_0x235c59,_0x2f4112){return function(_0xc0b5c){if(_0xc0b5c){return _0xc0b5c['destroy']()['then'](function(){_0x235c59[_0xc7a3('0x1e')](0xcc)[_0xc7a3('0x1d')]();});}};}function handleEntityNotFound(_0x5d1c2a,_0x1dd1a3){return function(_0x22a713){if(!_0x22a713){_0x5d1c2a['sendStatus'](0x194);}return _0x22a713;};}function handleError(_0x264617,_0x3cb92f){_0x3cb92f=_0x3cb92f||0x1f4;return function(_0x49a27a){logger[_0xc7a3('0x2b')](_0x49a27a['stack']);if(_0x49a27a['name']){delete _0x49a27a['name'];}_0x264617[_0xc7a3('0x1e')](_0x3cb92f)[_0xc7a3('0x2c')](_0x49a27a);};}exports[_0xc7a3('0x2d')]=function(_0x508dcc,_0xb99941){var _0x3b40f4={},_0x3ddb18={},_0x1dbfc7={'count':0x0,'rows':[]};var _0x1622df=_[_0xc7a3('0x2e')](db[_0xc7a3('0x2f')][_0xc7a3('0x30')],function(_0x4cf586){return{'name':_0x4cf586[_0xc7a3('0x31')],'type':_0x4cf586[_0xc7a3('0x32')][_0xc7a3('0x33')]};});_0x3ddb18['model']=_[_0xc7a3('0x2e')](_0x1622df,_0xc7a3('0x34'));_0x3ddb18['query']=_[_0xc7a3('0x35')](_0x508dcc['query']);_0x3ddb18[_0xc7a3('0x36')]=_[_0xc7a3('0x37')](_0x3ddb18[_0xc7a3('0x38')],_0x3ddb18['query']);_0x3b40f4[_0xc7a3('0x39')]=_[_0xc7a3('0x37')](_0x3ddb18[_0xc7a3('0x38')],qs[_0xc7a3('0x3a')](_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x3a')]));_0x3b40f4[_0xc7a3('0x39')]=_0x3b40f4[_0xc7a3('0x39')][_0xc7a3('0x3c')]?_0x3b40f4[_0xc7a3('0x39')]:_0x3ddb18[_0xc7a3('0x38')];if(!_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x3d')](_0xc7a3('0x3e'))){_0x3b40f4[_0xc7a3('0x21')]=qs[_0xc7a3('0x21')](_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x21')]);_0x3b40f4[_0xc7a3('0x22')]=qs['offset'](_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x22')]);}_0x3b40f4[_0xc7a3('0x3f')]=qs[_0xc7a3('0x40')](_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x40')]);_0x3b40f4[_0xc7a3('0x41')]=qs['filters'](_[_0xc7a3('0x42')](_0x508dcc['query'],_0x3ddb18['filters']),_0x1622df);if(_0x508dcc[_0xc7a3('0x3b')]['filter']){_0x3b40f4[_0xc7a3('0x41')]=_['merge'](_0x3b40f4[_0xc7a3('0x41')],{'$or':_['map'](_0x1622df,function(_0x101866){if(_0x101866['type']!==_0xc7a3('0x43')){var _0x5e41e3={};_0x5e41e3[_0x101866['name']]={'$like':'%'+_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x44')]+'%'};return _0x5e41e3;}})});}_0x3b40f4=_[_0xc7a3('0x45')]({},_0x3b40f4,_0x508dcc[_0xc7a3('0x46')]);var _0x4f0e24={'where':_0x3b40f4[_0xc7a3('0x41')]};return db[_0xc7a3('0x2f')][_0xc7a3('0x23')](_0x4f0e24)[_0xc7a3('0x2a')](function(_0x1b34eb){_0x1dbfc7[_0xc7a3('0x23')]=_0x1b34eb;if(_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x47')]){_0x3b40f4[_0xc7a3('0x48')]=[{'all':!![]}];}return db[_0xc7a3('0x2f')][_0xc7a3('0x49')](_0x3b40f4);})['then'](function(_0x11f7d7){_0x1dbfc7[_0xc7a3('0x4a')]=_0x11f7d7;return _0x1dbfc7;})[_0xc7a3('0x2a')](respondWithFilteredResult(_0xb99941,_0x3b40f4))['catch'](handleError(_0xb99941,null));};exports['show']=function(_0x2113d5,_0x12329e){var _0x55c750={'raw':![],'where':{'id':_0x2113d5[_0xc7a3('0x4b')]['id']}},_0x1159ac={};_0x1159ac[_0xc7a3('0x38')]=_['keys'](db[_0xc7a3('0x2f')][_0xc7a3('0x30')]);_0x1159ac[_0xc7a3('0x3b')]=_[_0xc7a3('0x35')](_0x2113d5['query']);_0x1159ac['filters']=_['intersection'](_0x1159ac[_0xc7a3('0x38')],_0x1159ac['query']);_0x55c750['attributes']=_['intersection'](_0x1159ac[_0xc7a3('0x38')],qs[_0xc7a3('0x3a')](_0x2113d5[_0xc7a3('0x3b')]['fields']));_0x55c750['attributes']=_0x55c750['attributes'][_0xc7a3('0x3c')]?_0x55c750[_0xc7a3('0x39')]:_0x1159ac[_0xc7a3('0x38')];if(_0x2113d5[_0xc7a3('0x3b')][_0xc7a3('0x47')]){_0x55c750[_0xc7a3('0x48')]=[{'all':!![]}];}_0x55c750=_[_0xc7a3('0x45')]({},_0x55c750,_0x2113d5[_0xc7a3('0x46')]);return db[_0xc7a3('0x2f')][_0xc7a3('0x4c')](_0x55c750)[_0xc7a3('0x2a')](handleEntityNotFound(_0x12329e,null))[_0xc7a3('0x2a')](respondWithResult(_0x12329e,null))['catch'](handleError(_0x12329e,null));};exports[_0xc7a3('0x4d')]=function(_0x8f1ba9,_0x30cfd7){return db[_0xc7a3('0x2f')][_0xc7a3('0x4d')](_0x8f1ba9['body'],{})['then'](respondWithResult(_0x30cfd7,0xc9))['catch'](handleError(_0x30cfd7,null));};exports[_0xc7a3('0x29')]=function(_0x136202,_0x270119){if(_0x136202['body']['id']){delete _0x136202[_0xc7a3('0x4e')]['id'];}return db['FreshdeskConfiguration'][_0xc7a3('0x4c')]({'where':{'id':_0x136202[_0xc7a3('0x4b')]['id']}})[_0xc7a3('0x2a')](handleEntityNotFound(_0x270119,null))[_0xc7a3('0x2a')](saveUpdates(_0x136202[_0xc7a3('0x4e')],null))[_0xc7a3('0x2a')](respondWithResult(_0x270119,null))[_0xc7a3('0x4f')](handleError(_0x270119,null));};exports['destroy']=function(_0x52cb18,_0x4ec5f1){return db[_0xc7a3('0x2f')]['find']({'where':{'id':_0x52cb18[_0xc7a3('0x4b')]['id']}})[_0xc7a3('0x2a')](handleEntityNotFound(_0x4ec5f1,null))[_0xc7a3('0x2a')](removeEntity(_0x4ec5f1,null))[_0xc7a3('0x4f')](handleError(_0x4ec5f1,null));};exports[_0xc7a3('0x50')]=function(_0x10f572,_0x50f4b7,_0x39a5e8){var _0xd7db3d={};var _0x1cdefc={};var _0x3c3755;var _0x6a0ff;return db[_0xc7a3('0x2f')][_0xc7a3('0x51')]({'where':{'id':_0x10f572['params']['id']}})[_0xc7a3('0x2a')](handleEntityNotFound(_0x50f4b7,null))[_0xc7a3('0x2a')](function(_0x521186){if(_0x521186){_0x3c3755=_0x521186;_0x1cdefc[_0xc7a3('0x38')]=_[_0xc7a3('0x35')](db[_0xc7a3('0x52')]['rawAttributes']);_0x1cdefc[_0xc7a3('0x3b')]=_[_0xc7a3('0x35')](_0x10f572[_0xc7a3('0x3b')]);_0x1cdefc[_0xc7a3('0x36')]=_[_0xc7a3('0x37')](_0x1cdefc['model'],_0x1cdefc[_0xc7a3('0x3b')]);_0xd7db3d[_0xc7a3('0x39')]=_['intersection'](_0x1cdefc['model'],qs[_0xc7a3('0x3a')](_0x10f572[_0xc7a3('0x3b')][_0xc7a3('0x3a')]));_0xd7db3d[_0xc7a3('0x39')]=_0xd7db3d[_0xc7a3('0x39')][_0xc7a3('0x3c')]?_0xd7db3d['attributes']:_0x1cdefc['model'];_0xd7db3d[_0xc7a3('0x3f')]=qs[_0xc7a3('0x40')](_0x10f572[_0xc7a3('0x3b')][_0xc7a3('0x40')]);_0xd7db3d[_0xc7a3('0x41')]=qs[_0xc7a3('0x36')](_[_0xc7a3('0x42')](_0x10f572[_0xc7a3('0x3b')],_0x1cdefc[_0xc7a3('0x36')]));if(_0x10f572[_0xc7a3('0x3b')]['filter']){_0xd7db3d[_0xc7a3('0x41')]=_[_0xc7a3('0x45')](_0xd7db3d['where'],{'$or':_['map'](_0xd7db3d[_0xc7a3('0x39')],function(_0x40f468){var _0x1ff4c6={};_0x1ff4c6[_0x40f468]={'$like':'%'+_0x10f572[_0xc7a3('0x3b')][_0xc7a3('0x44')]+'%'};return _0x1ff4c6;})});}_0xd7db3d=_[_0xc7a3('0x45')]({},_0xd7db3d,_0x10f572[_0xc7a3('0x46')]);return _0x3c3755[_0xc7a3('0x50')](_0xd7db3d);}})[_0xc7a3('0x2a')](function(_0x40102d){if(_0x40102d){_0x6a0ff=_0x40102d['length'];if(!_0x10f572[_0xc7a3('0x3b')]['hasOwnProperty']('nolimit')){_0xd7db3d[_0xc7a3('0x21')]=qs[_0xc7a3('0x21')](_0x10f572[_0xc7a3('0x3b')]['limit']);_0xd7db3d[_0xc7a3('0x22')]=qs['offset'](_0x10f572[_0xc7a3('0x3b')][_0xc7a3('0x22')]);}return _0x3c3755[_0xc7a3('0x50')](_0xd7db3d);}})['then'](function(_0x56e349){if(_0x56e349){return _0x56e349?{'count':_0x6a0ff,'rows':_0x56e349}:null;}})[_0xc7a3('0x2a')](respondWithResult(_0x50f4b7,null))[_0xc7a3('0x4f')](handleError(_0x50f4b7,null));};exports[_0xc7a3('0x53')]=function(_0x2b9d2c,_0x4b838d,_0x69bc48){var _0x344b16={};var _0x1b16f5={};var _0x1f791e;var _0x2d3365;return db[_0xc7a3('0x2f')][_0xc7a3('0x51')]({'where':{'id':_0x2b9d2c[_0xc7a3('0x4b')]['id']}})[_0xc7a3('0x2a')](handleEntityNotFound(_0x4b838d,null))[_0xc7a3('0x2a')](function(_0x667a1f){if(_0x667a1f){_0x1f791e=_0x667a1f;_0x1b16f5['model']=_[_0xc7a3('0x35')](db[_0xc7a3('0x52')]['rawAttributes']);_0x1b16f5[_0xc7a3('0x3b')]=_[_0xc7a3('0x35')](_0x2b9d2c['query']);_0x1b16f5[_0xc7a3('0x36')]=_[_0xc7a3('0x37')](_0x1b16f5[_0xc7a3('0x38')],_0x1b16f5[_0xc7a3('0x3b')]);_0x344b16[_0xc7a3('0x39')]=_[_0xc7a3('0x37')](_0x1b16f5[_0xc7a3('0x38')],qs[_0xc7a3('0x3a')](_0x2b9d2c[_0xc7a3('0x3b')][_0xc7a3('0x3a')]));_0x344b16[_0xc7a3('0x39')]=_0x344b16[_0xc7a3('0x39')][_0xc7a3('0x3c')]?_0x344b16[_0xc7a3('0x39')]:_0x1b16f5[_0xc7a3('0x38')];_0x344b16[_0xc7a3('0x3f')]=qs[_0xc7a3('0x40')](_0x2b9d2c['query'][_0xc7a3('0x40')]);_0x344b16[_0xc7a3('0x41')]=qs[_0xc7a3('0x36')](_[_0xc7a3('0x42')](_0x2b9d2c[_0xc7a3('0x3b')],_0x1b16f5[_0xc7a3('0x36')]));if(_0x2b9d2c[_0xc7a3('0x3b')][_0xc7a3('0x44')]){_0x344b16[_0xc7a3('0x41')]=_[_0xc7a3('0x45')](_0x344b16[_0xc7a3('0x41')],{'$or':_[_0xc7a3('0x2e')](_0x344b16['attributes'],function(_0x4b9810){var _0x1ec80c={};_0x1ec80c[_0x4b9810]={'$like':'%'+_0x2b9d2c['query'][_0xc7a3('0x44')]+'%'};return _0x1ec80c;})});}_0x344b16=_[_0xc7a3('0x45')]({},_0x344b16,_0x2b9d2c[_0xc7a3('0x46')]);return _0x1f791e['getSubjects'](_0x344b16);}})[_0xc7a3('0x2a')](function(_0x108adf){if(_0x108adf){_0x2d3365=_0x108adf[_0xc7a3('0x3c')];if(!_0x2b9d2c[_0xc7a3('0x3b')][_0xc7a3('0x3d')](_0xc7a3('0x3e'))){_0x344b16[_0xc7a3('0x21')]=qs[_0xc7a3('0x21')](_0x2b9d2c[_0xc7a3('0x3b')]['limit']);_0x344b16['offset']=qs[_0xc7a3('0x22')](_0x2b9d2c['query'][_0xc7a3('0x22')]);}return _0x1f791e[_0xc7a3('0x53')](_0x344b16);}})['then'](function(_0x552bfe){if(_0x552bfe){return _0x552bfe?{'count':_0x2d3365,'rows':_0x552bfe}:null;}})['then'](respondWithResult(_0x4b838d,null))[_0xc7a3('0x4f')](handleError(_0x4b838d,null));};exports[_0xc7a3('0x54')]=function(_0x480384,_0x3c4351,_0x38d7dd){var _0x422d69={};var _0x2863e3={};var _0x253044;var _0x11fa47;return db[_0xc7a3('0x2f')]['findOne']({'where':{'id':_0x480384[_0xc7a3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3c4351,null))[_0xc7a3('0x2a')](function(_0xf23184){if(_0xf23184){_0x253044=_0xf23184;_0x2863e3[_0xc7a3('0x38')]=_[_0xc7a3('0x35')](db[_0xc7a3('0x52')][_0xc7a3('0x30')]);_0x2863e3[_0xc7a3('0x3b')]=_[_0xc7a3('0x35')](_0x480384['query']);_0x2863e3[_0xc7a3('0x36')]=_[_0xc7a3('0x37')](_0x2863e3[_0xc7a3('0x38')],_0x2863e3[_0xc7a3('0x3b')]);_0x422d69[_0xc7a3('0x39')]=_['intersection'](_0x2863e3[_0xc7a3('0x38')],qs[_0xc7a3('0x3a')](_0x480384[_0xc7a3('0x3b')][_0xc7a3('0x3a')]));_0x422d69['attributes']=_0x422d69['attributes'][_0xc7a3('0x3c')]?_0x422d69['attributes']:_0x2863e3[_0xc7a3('0x38')];_0x422d69['order']=qs[_0xc7a3('0x40')](_0x480384[_0xc7a3('0x3b')][_0xc7a3('0x40')]);_0x422d69[_0xc7a3('0x41')]=qs[_0xc7a3('0x36')](_[_0xc7a3('0x42')](_0x480384[_0xc7a3('0x3b')],_0x2863e3[_0xc7a3('0x36')]));if(_0x480384[_0xc7a3('0x3b')][_0xc7a3('0x44')]){_0x422d69['where']=_[_0xc7a3('0x45')](_0x422d69[_0xc7a3('0x41')],{'$or':_[_0xc7a3('0x2e')](_0x422d69['attributes'],function(_0x24241f){var _0x40b832={};_0x40b832[_0x24241f]={'$like':'%'+_0x480384[_0xc7a3('0x3b')][_0xc7a3('0x44')]+'%'};return _0x40b832;})});}_0x422d69=_['merge']({},_0x422d69,_0x480384[_0xc7a3('0x46')]);return _0x253044[_0xc7a3('0x54')](_0x422d69);}})[_0xc7a3('0x2a')](function(_0x4313e6){if(_0x4313e6){_0x11fa47=_0x4313e6[_0xc7a3('0x3c')];if(!_0x480384[_0xc7a3('0x3b')][_0xc7a3('0x3d')]('nolimit')){_0x422d69[_0xc7a3('0x21')]=qs[_0xc7a3('0x21')](_0x480384[_0xc7a3('0x3b')][_0xc7a3('0x21')]);_0x422d69[_0xc7a3('0x22')]=qs['offset'](_0x480384['query']['offset']);}return _0x253044[_0xc7a3('0x54')](_0x422d69);}})[_0xc7a3('0x2a')](function(_0x4afabb){if(_0x4afabb){return _0x4afabb?{'count':_0x11fa47,'rows':_0x4afabb}:null;}})[_0xc7a3('0x2a')](respondWithResult(_0x3c4351,null))[_0xc7a3('0x4f')](handleError(_0x3c4351,null));};exports[_0xc7a3('0x55')]=function(_0x1b322b,_0x56fd31,_0x27d741){var _0x1563ee={};var _0x8a29ab={};var _0x3a8003;var _0x37e29f;return db['FreshdeskConfiguration'][_0xc7a3('0x51')]({'where':{'id':_0x1b322b[_0xc7a3('0x4b')]['id']}})[_0xc7a3('0x2a')](handleEntityNotFound(_0x56fd31,null))[_0xc7a3('0x2a')](function(_0x5d4f16){if(_0x5d4f16){_0x3a8003=_0x5d4f16;_0x8a29ab['model']=_['keys'](db['Tag'][_0xc7a3('0x30')]);_0x8a29ab[_0xc7a3('0x3b')]=_[_0xc7a3('0x35')](_0x1b322b[_0xc7a3('0x3b')]);_0x8a29ab[_0xc7a3('0x36')]=_[_0xc7a3('0x37')](_0x8a29ab['model'],_0x8a29ab[_0xc7a3('0x3b')]);_0x1563ee['attributes']=_[_0xc7a3('0x37')](_0x8a29ab[_0xc7a3('0x38')],qs['fields'](_0x1b322b[_0xc7a3('0x3b')][_0xc7a3('0x3a')]));_0x1563ee['attributes']=_0x1563ee['attributes']['length']?_0x1563ee[_0xc7a3('0x39')]:_0x8a29ab[_0xc7a3('0x38')];_0x1563ee['order']=qs[_0xc7a3('0x40')](_0x1b322b[_0xc7a3('0x3b')][_0xc7a3('0x40')]);_0x1563ee['where']=qs['filters'](_['pick'](_0x1b322b['query'],_0x8a29ab[_0xc7a3('0x36')]));if(_0x1b322b[_0xc7a3('0x3b')][_0xc7a3('0x44')]){_0x1563ee[_0xc7a3('0x41')]=_[_0xc7a3('0x45')](_0x1563ee[_0xc7a3('0x41')],{'$or':_[_0xc7a3('0x2e')](_0x1563ee[_0xc7a3('0x39')],function(_0x3129b6){var _0x405d30={};_0x405d30[_0x3129b6]={'$like':'%'+_0x1b322b[_0xc7a3('0x3b')][_0xc7a3('0x44')]+'%'};return _0x405d30;})});}_0x1563ee=_[_0xc7a3('0x45')]({},_0x1563ee,_0x1b322b[_0xc7a3('0x46')]);return _0x3a8003['getTags'](_0x1563ee);}})[_0xc7a3('0x2a')](function(_0x1011db){if(_0x1011db){_0x37e29f=_0x1011db['length'];if(!_0x1b322b['query']['hasOwnProperty'](_0xc7a3('0x3e'))){_0x1563ee['limit']=qs[_0xc7a3('0x21')](_0x1b322b[_0xc7a3('0x3b')][_0xc7a3('0x21')]);_0x1563ee[_0xc7a3('0x22')]=qs[_0xc7a3('0x22')](_0x1b322b[_0xc7a3('0x3b')][_0xc7a3('0x22')]);}return _0x3a8003[_0xc7a3('0x55')](_0x1563ee);}})[_0xc7a3('0x2a')](function(_0x4470c4){if(_0x4470c4){return _0x4470c4?{'count':_0x37e29f,'rows':_0x4470c4}:null;}})[_0xc7a3('0x2a')](respondWithResult(_0x56fd31,null))['catch'](handleError(_0x56fd31,null));};exports['setTags']=function(_0x1723b2,_0x1cbd4a,_0x4b149a){if(_0x1723b2[_0xc7a3('0x4e')]['id']){delete _0x1723b2[_0xc7a3('0x4e')]['id'];}return db[_0xc7a3('0x2f')][_0xc7a3('0x51')]({'where':{'id':_0x1723b2[_0xc7a3('0x4b')]['id']}})[_0xc7a3('0x2a')](handleEntityNotFound(_0x1cbd4a,null))[_0xc7a3('0x2a')](function(_0x223d75){if(_0x223d75){return _0x223d75[_0xc7a3('0x56')](_0x1723b2['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x1cbd4a,null))['catch'](handleError(_0x1cbd4a,null));}; \ No newline at end of file +var _0x3407=['then','destroy','stack','name','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','includeAll','FreshdeskConfiguration','findAll','catch','show','params','keys','length','options','create','body','find','getFields','findOne','FreshdeskField','getSubjects','order','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x3407,0xd5));var _0x7340=function(_0x182c03,_0x32a560){_0x182c03=_0x182c03-0x0;var _0x1b6251=_0x3407[_0x182c03];return _0x1b6251;};'use strict';var emlformat=require(_0x7340('0x0'));var rimraf=require(_0x7340('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7340('0x2'));var rp=require('request-promise');var moment=require(_0x7340('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7340('0x4'));var util=require('util');var path=require(_0x7340('0x5'));var sox=require(_0x7340('0x6'));var csv=require(_0x7340('0x7'));var ejs=require(_0x7340('0x8'));var fs=require('fs');var fs_extra=require(_0x7340('0x9'));var _=require(_0x7340('0xa'));var squel=require(_0x7340('0xb'));var crypto=require(_0x7340('0xc'));var jsforce=require(_0x7340('0xd'));var deskjs=require(_0x7340('0xe'));var toCsv=require(_0x7340('0x7'));var querystring=require(_0x7340('0xf'));var Papa=require(_0x7340('0x10'));var Redis=require(_0x7340('0x11'));var authService=require(_0x7340('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7340('0x13'));var logger=require(_0x7340('0x14'))(_0x7340('0x15'));var utils=require(_0x7340('0x16'));var config=require(_0x7340('0x17'));var licenseUtil=require(_0x7340('0x18'));var db=require(_0x7340('0x19'))['db'];function respondWithStatusCode(_0x100d6f,_0x38bf88){_0x38bf88=_0x38bf88||0xcc;return function(_0x1f5509){if(_0x1f5509){return _0x100d6f[_0x7340('0x1a')](_0x38bf88);}return _0x100d6f['status'](_0x38bf88)[_0x7340('0x1b')]();};}function respondWithResult(_0x49eace,_0x14f3ab){_0x14f3ab=_0x14f3ab||0xc8;return function(_0x792a41){if(_0x792a41){return _0x49eace[_0x7340('0x1c')](_0x14f3ab)['json'](_0x792a41);}};}function respondWithFilteredResult(_0x30ace6,_0x59bd91){return function(_0x4fa3fb){if(_0x4fa3fb){var _0x441e3f=typeof _0x59bd91[_0x7340('0x1d')]===_0x7340('0x1e')&&typeof _0x59bd91[_0x7340('0x1f')]===_0x7340('0x1e');var _0x3a1fde=_0x4fa3fb['count'];var _0x5a7eaa=_0x441e3f?0x0:_0x59bd91[_0x7340('0x1d')];var _0x81f521=_0x441e3f?_0x4fa3fb[_0x7340('0x20')]:_0x59bd91['offset']+_0x59bd91[_0x7340('0x1f')];var _0x2ca8e9;if(_0x81f521>=_0x3a1fde){_0x81f521=_0x3a1fde;_0x2ca8e9=0xc8;}else{_0x2ca8e9=0xce;}_0x30ace6[_0x7340('0x1c')](_0x2ca8e9);return _0x30ace6[_0x7340('0x21')]('Content-Range',_0x5a7eaa+'-'+_0x81f521+'/'+_0x3a1fde)[_0x7340('0x22')](_0x4fa3fb);}return null;};}function patchUpdates(_0x5e30be){return function(_0x5c8c6f){try{jsonpatch[_0x7340('0x23')](_0x5c8c6f,_0x5e30be,!![]);}catch(_0x1d3f9b){return BPromise[_0x7340('0x24')](_0x1d3f9b);}return _0x5c8c6f[_0x7340('0x25')]();};}function saveUpdates(_0x10362d,_0x16ae42){return function(_0x444a84){if(_0x444a84){return _0x444a84[_0x7340('0x26')](_0x10362d)[_0x7340('0x27')](function(_0xe07ee5){return _0xe07ee5;});}return null;};}function removeEntity(_0x209023,_0x146b92){return function(_0xe57bcf){if(_0xe57bcf){return _0xe57bcf[_0x7340('0x28')]()[_0x7340('0x27')](function(){_0x209023[_0x7340('0x1c')](0xcc)[_0x7340('0x1b')]();});}};}function handleEntityNotFound(_0x43fe59,_0x326ee1){return function(_0x58a077){if(!_0x58a077){_0x43fe59['sendStatus'](0x194);}return _0x58a077;};}function handleError(_0x39322c,_0x1f6f3a){_0x1f6f3a=_0x1f6f3a||0x1f4;return function(_0x13f8c1){logger['error'](_0x13f8c1[_0x7340('0x29')]);if(_0x13f8c1[_0x7340('0x2a')]){delete _0x13f8c1[_0x7340('0x2a')];}_0x39322c['status'](_0x1f6f3a)['send'](_0x13f8c1);};}exports['index']=function(_0x2e8b74,_0x29ca71){var _0x249601={},_0x53a1c6={},_0x106e08={'count':0x0,'rows':[]};var _0x220fa0=_[_0x7340('0x2b')](db['FreshdeskConfiguration'][_0x7340('0x2c')],function(_0xb496b1){return{'name':_0xb496b1[_0x7340('0x2d')],'type':_0xb496b1[_0x7340('0x2e')][_0x7340('0x2f')]};});_0x53a1c6[_0x7340('0x30')]=_[_0x7340('0x2b')](_0x220fa0,_0x7340('0x2a'));_0x53a1c6[_0x7340('0x31')]=_['keys'](_0x2e8b74[_0x7340('0x31')]);_0x53a1c6[_0x7340('0x32')]=_[_0x7340('0x33')](_0x53a1c6[_0x7340('0x30')],_0x53a1c6[_0x7340('0x31')]);_0x249601[_0x7340('0x34')]=_[_0x7340('0x33')](_0x53a1c6[_0x7340('0x30')],qs[_0x7340('0x35')](_0x2e8b74['query'][_0x7340('0x35')]));_0x249601[_0x7340('0x34')]=_0x249601[_0x7340('0x34')]['length']?_0x249601['attributes']:_0x53a1c6[_0x7340('0x30')];if(!_0x2e8b74[_0x7340('0x31')][_0x7340('0x36')](_0x7340('0x37'))){_0x249601[_0x7340('0x1f')]=qs[_0x7340('0x1f')](_0x2e8b74[_0x7340('0x31')][_0x7340('0x1f')]);_0x249601[_0x7340('0x1d')]=qs['offset'](_0x2e8b74[_0x7340('0x31')][_0x7340('0x1d')]);}_0x249601['order']=qs[_0x7340('0x38')](_0x2e8b74[_0x7340('0x31')]['sort']);_0x249601[_0x7340('0x39')]=qs[_0x7340('0x32')](_[_0x7340('0x3a')](_0x2e8b74[_0x7340('0x31')],_0x53a1c6[_0x7340('0x32')]),_0x220fa0);if(_0x2e8b74[_0x7340('0x31')]['filter']){_0x249601['where']=_['merge'](_0x249601[_0x7340('0x39')],{'$or':_['map'](_0x220fa0,function(_0x350b9b){if(_0x350b9b[_0x7340('0x2e')]!==_0x7340('0x3b')){var _0x374536={};_0x374536[_0x350b9b[_0x7340('0x2a')]]={'$like':'%'+_0x2e8b74[_0x7340('0x31')][_0x7340('0x3c')]+'%'};return _0x374536;}})});}_0x249601=_[_0x7340('0x3d')]({},_0x249601,_0x2e8b74['options']);var _0x5ac696={'where':_0x249601[_0x7340('0x39')]};return db['FreshdeskConfiguration'][_0x7340('0x20')](_0x5ac696)[_0x7340('0x27')](function(_0x4a8573){_0x106e08[_0x7340('0x20')]=_0x4a8573;if(_0x2e8b74[_0x7340('0x31')][_0x7340('0x3e')]){_0x249601['include']=[{'all':!![]}];}return db[_0x7340('0x3f')][_0x7340('0x40')](_0x249601);})['then'](function(_0x56ecf9){_0x106e08['rows']=_0x56ecf9;return _0x106e08;})[_0x7340('0x27')](respondWithFilteredResult(_0x29ca71,_0x249601))[_0x7340('0x41')](handleError(_0x29ca71,null));};exports[_0x7340('0x42')]=function(_0x4545dd,_0x17d20f){var _0x5e2168={'raw':![],'where':{'id':_0x4545dd[_0x7340('0x43')]['id']}},_0x57978d={};_0x57978d[_0x7340('0x30')]=_[_0x7340('0x44')](db[_0x7340('0x3f')][_0x7340('0x2c')]);_0x57978d['query']=_[_0x7340('0x44')](_0x4545dd[_0x7340('0x31')]);_0x57978d[_0x7340('0x32')]=_[_0x7340('0x33')](_0x57978d['model'],_0x57978d[_0x7340('0x31')]);_0x5e2168[_0x7340('0x34')]=_[_0x7340('0x33')](_0x57978d['model'],qs[_0x7340('0x35')](_0x4545dd['query'][_0x7340('0x35')]));_0x5e2168[_0x7340('0x34')]=_0x5e2168[_0x7340('0x34')][_0x7340('0x45')]?_0x5e2168[_0x7340('0x34')]:_0x57978d[_0x7340('0x30')];if(_0x4545dd[_0x7340('0x31')][_0x7340('0x3e')]){_0x5e2168['include']=[{'all':!![]}];}_0x5e2168=_[_0x7340('0x3d')]({},_0x5e2168,_0x4545dd[_0x7340('0x46')]);return db[_0x7340('0x3f')]['find'](_0x5e2168)[_0x7340('0x27')](handleEntityNotFound(_0x17d20f,null))[_0x7340('0x27')](respondWithResult(_0x17d20f,null))[_0x7340('0x41')](handleError(_0x17d20f,null));};exports[_0x7340('0x47')]=function(_0x2af166,_0x4c1616){return db[_0x7340('0x3f')][_0x7340('0x47')](_0x2af166[_0x7340('0x48')],{})[_0x7340('0x27')](respondWithResult(_0x4c1616,0xc9))[_0x7340('0x41')](handleError(_0x4c1616,null));};exports['update']=function(_0x39a007,_0xd17da5){if(_0x39a007[_0x7340('0x48')]['id']){delete _0x39a007[_0x7340('0x48')]['id'];}return db['FreshdeskConfiguration'][_0x7340('0x49')]({'where':{'id':_0x39a007['params']['id']}})['then'](handleEntityNotFound(_0xd17da5,null))[_0x7340('0x27')](saveUpdates(_0x39a007[_0x7340('0x48')],null))['then'](respondWithResult(_0xd17da5,null))[_0x7340('0x41')](handleError(_0xd17da5,null));};exports[_0x7340('0x28')]=function(_0x3d6b82,_0x510dba){return db[_0x7340('0x3f')]['find']({'where':{'id':_0x3d6b82[_0x7340('0x43')]['id']}})[_0x7340('0x27')](handleEntityNotFound(_0x510dba,null))[_0x7340('0x27')](removeEntity(_0x510dba,null))['catch'](handleError(_0x510dba,null));};exports[_0x7340('0x4a')]=function(_0x46f9a8,_0x3aa953,_0x5c4f72){var _0x4e52e9={};var _0xdbef41={};var _0x3af93d;var _0x5c80ee;return db[_0x7340('0x3f')][_0x7340('0x4b')]({'where':{'id':_0x46f9a8['params']['id']}})[_0x7340('0x27')](handleEntityNotFound(_0x3aa953,null))[_0x7340('0x27')](function(_0x3702ae){if(_0x3702ae){_0x3af93d=_0x3702ae;_0xdbef41[_0x7340('0x30')]=_[_0x7340('0x44')](db['FreshdeskField'][_0x7340('0x2c')]);_0xdbef41['query']=_[_0x7340('0x44')](_0x46f9a8[_0x7340('0x31')]);_0xdbef41[_0x7340('0x32')]=_[_0x7340('0x33')](_0xdbef41[_0x7340('0x30')],_0xdbef41[_0x7340('0x31')]);_0x4e52e9['attributes']=_[_0x7340('0x33')](_0xdbef41[_0x7340('0x30')],qs[_0x7340('0x35')](_0x46f9a8['query']['fields']));_0x4e52e9[_0x7340('0x34')]=_0x4e52e9[_0x7340('0x34')][_0x7340('0x45')]?_0x4e52e9[_0x7340('0x34')]:_0xdbef41[_0x7340('0x30')];_0x4e52e9['order']=qs['sort'](_0x46f9a8[_0x7340('0x31')][_0x7340('0x38')]);_0x4e52e9['where']=qs[_0x7340('0x32')](_['pick'](_0x46f9a8['query'],_0xdbef41['filters']));if(_0x46f9a8[_0x7340('0x31')][_0x7340('0x3c')]){_0x4e52e9['where']=_[_0x7340('0x3d')](_0x4e52e9[_0x7340('0x39')],{'$or':_[_0x7340('0x2b')](_0x4e52e9[_0x7340('0x34')],function(_0x552c43){var _0x39fbc1={};_0x39fbc1[_0x552c43]={'$like':'%'+_0x46f9a8['query'][_0x7340('0x3c')]+'%'};return _0x39fbc1;})});}_0x4e52e9=_[_0x7340('0x3d')]({},_0x4e52e9,_0x46f9a8[_0x7340('0x46')]);return _0x3af93d['getFields'](_0x4e52e9);}})[_0x7340('0x27')](function(_0x1e5ac4){if(_0x1e5ac4){_0x5c80ee=_0x1e5ac4[_0x7340('0x45')];if(!_0x46f9a8[_0x7340('0x31')]['hasOwnProperty'](_0x7340('0x37'))){_0x4e52e9[_0x7340('0x1f')]=qs[_0x7340('0x1f')](_0x46f9a8[_0x7340('0x31')]['limit']);_0x4e52e9[_0x7340('0x1d')]=qs['offset'](_0x46f9a8[_0x7340('0x31')]['offset']);}return _0x3af93d['getFields'](_0x4e52e9);}})[_0x7340('0x27')](function(_0x9649b4){if(_0x9649b4){return _0x9649b4?{'count':_0x5c80ee,'rows':_0x9649b4}:null;}})[_0x7340('0x27')](respondWithResult(_0x3aa953,null))[_0x7340('0x41')](handleError(_0x3aa953,null));};exports['getSubjects']=function(_0x5325b4,_0x16bd5b,_0x1cbbf8){var _0x2ed036={};var _0x5edb45={};var _0x1568d3;var _0x2b0dbf;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x5325b4[_0x7340('0x43')]['id']}})[_0x7340('0x27')](handleEntityNotFound(_0x16bd5b,null))[_0x7340('0x27')](function(_0x2bad18){if(_0x2bad18){_0x1568d3=_0x2bad18;_0x5edb45['model']=_[_0x7340('0x44')](db[_0x7340('0x4c')]['rawAttributes']);_0x5edb45[_0x7340('0x31')]=_[_0x7340('0x44')](_0x5325b4[_0x7340('0x31')]);_0x5edb45['filters']=_[_0x7340('0x33')](_0x5edb45[_0x7340('0x30')],_0x5edb45[_0x7340('0x31')]);_0x2ed036[_0x7340('0x34')]=_[_0x7340('0x33')](_0x5edb45[_0x7340('0x30')],qs[_0x7340('0x35')](_0x5325b4[_0x7340('0x31')][_0x7340('0x35')]));_0x2ed036['attributes']=_0x2ed036['attributes'][_0x7340('0x45')]?_0x2ed036[_0x7340('0x34')]:_0x5edb45[_0x7340('0x30')];_0x2ed036['order']=qs[_0x7340('0x38')](_0x5325b4[_0x7340('0x31')][_0x7340('0x38')]);_0x2ed036[_0x7340('0x39')]=qs[_0x7340('0x32')](_[_0x7340('0x3a')](_0x5325b4[_0x7340('0x31')],_0x5edb45[_0x7340('0x32')]));if(_0x5325b4[_0x7340('0x31')][_0x7340('0x3c')]){_0x2ed036[_0x7340('0x39')]=_[_0x7340('0x3d')](_0x2ed036[_0x7340('0x39')],{'$or':_[_0x7340('0x2b')](_0x2ed036[_0x7340('0x34')],function(_0x3549e7){var _0x4fb6e2={};_0x4fb6e2[_0x3549e7]={'$like':'%'+_0x5325b4[_0x7340('0x31')]['filter']+'%'};return _0x4fb6e2;})});}_0x2ed036=_['merge']({},_0x2ed036,_0x5325b4[_0x7340('0x46')]);return _0x1568d3[_0x7340('0x4d')](_0x2ed036);}})['then'](function(_0x405f3d){if(_0x405f3d){_0x2b0dbf=_0x405f3d[_0x7340('0x45')];if(!_0x5325b4[_0x7340('0x31')][_0x7340('0x36')]('nolimit')){_0x2ed036[_0x7340('0x1f')]=qs[_0x7340('0x1f')](_0x5325b4[_0x7340('0x31')]['limit']);_0x2ed036[_0x7340('0x1d')]=qs[_0x7340('0x1d')](_0x5325b4['query']['offset']);}return _0x1568d3[_0x7340('0x4d')](_0x2ed036);}})[_0x7340('0x27')](function(_0x35e609){if(_0x35e609){return _0x35e609?{'count':_0x2b0dbf,'rows':_0x35e609}:null;}})[_0x7340('0x27')](respondWithResult(_0x16bd5b,null))[_0x7340('0x41')](handleError(_0x16bd5b,null));};exports['getDescriptions']=function(_0x2ed824,_0x822f55,_0x229d77){var _0x293065={};var _0x40cfae={};var _0x15d926;var _0x1ffbfc;return db[_0x7340('0x3f')]['findOne']({'where':{'id':_0x2ed824[_0x7340('0x43')]['id']}})[_0x7340('0x27')](handleEntityNotFound(_0x822f55,null))[_0x7340('0x27')](function(_0x11266c){if(_0x11266c){_0x15d926=_0x11266c;_0x40cfae[_0x7340('0x30')]=_[_0x7340('0x44')](db[_0x7340('0x4c')]['rawAttributes']);_0x40cfae[_0x7340('0x31')]=_['keys'](_0x2ed824[_0x7340('0x31')]);_0x40cfae[_0x7340('0x32')]=_['intersection'](_0x40cfae[_0x7340('0x30')],_0x40cfae[_0x7340('0x31')]);_0x293065[_0x7340('0x34')]=_[_0x7340('0x33')](_0x40cfae[_0x7340('0x30')],qs['fields'](_0x2ed824['query']['fields']));_0x293065[_0x7340('0x34')]=_0x293065[_0x7340('0x34')][_0x7340('0x45')]?_0x293065[_0x7340('0x34')]:_0x40cfae[_0x7340('0x30')];_0x293065[_0x7340('0x4e')]=qs['sort'](_0x2ed824[_0x7340('0x31')]['sort']);_0x293065['where']=qs['filters'](_[_0x7340('0x3a')](_0x2ed824['query'],_0x40cfae[_0x7340('0x32')]));if(_0x2ed824[_0x7340('0x31')][_0x7340('0x3c')]){_0x293065['where']=_['merge'](_0x293065[_0x7340('0x39')],{'$or':_['map'](_0x293065[_0x7340('0x34')],function(_0x1d406f){var _0x584c0a={};_0x584c0a[_0x1d406f]={'$like':'%'+_0x2ed824['query']['filter']+'%'};return _0x584c0a;})});}_0x293065=_[_0x7340('0x3d')]({},_0x293065,_0x2ed824[_0x7340('0x46')]);return _0x15d926[_0x7340('0x4f')](_0x293065);}})[_0x7340('0x27')](function(_0x1dd637){if(_0x1dd637){_0x1ffbfc=_0x1dd637[_0x7340('0x45')];if(!_0x2ed824[_0x7340('0x31')]['hasOwnProperty']('nolimit')){_0x293065['limit']=qs[_0x7340('0x1f')](_0x2ed824[_0x7340('0x31')][_0x7340('0x1f')]);_0x293065[_0x7340('0x1d')]=qs[_0x7340('0x1d')](_0x2ed824[_0x7340('0x31')]['offset']);}return _0x15d926['getDescriptions'](_0x293065);}})[_0x7340('0x27')](function(_0xca89e1){if(_0xca89e1){return _0xca89e1?{'count':_0x1ffbfc,'rows':_0xca89e1}:null;}})['then'](respondWithResult(_0x822f55,null))['catch'](handleError(_0x822f55,null));};exports[_0x7340('0x50')]=function(_0x18ffe3,_0x2889ff,_0x19ad47){var _0x29ed72={};var _0x392ce1={};var _0x225ecb;var _0x2873a2;return db['FreshdeskConfiguration'][_0x7340('0x4b')]({'where':{'id':_0x18ffe3[_0x7340('0x43')]['id']}})['then'](handleEntityNotFound(_0x2889ff,null))[_0x7340('0x27')](function(_0x17b692){if(_0x17b692){_0x225ecb=_0x17b692;_0x392ce1['model']=_[_0x7340('0x44')](db[_0x7340('0x51')][_0x7340('0x2c')]);_0x392ce1[_0x7340('0x31')]=_[_0x7340('0x44')](_0x18ffe3[_0x7340('0x31')]);_0x392ce1[_0x7340('0x32')]=_[_0x7340('0x33')](_0x392ce1['model'],_0x392ce1['query']);_0x29ed72[_0x7340('0x34')]=_['intersection'](_0x392ce1[_0x7340('0x30')],qs[_0x7340('0x35')](_0x18ffe3[_0x7340('0x31')][_0x7340('0x35')]));_0x29ed72[_0x7340('0x34')]=_0x29ed72['attributes']['length']?_0x29ed72[_0x7340('0x34')]:_0x392ce1[_0x7340('0x30')];_0x29ed72['order']=qs['sort'](_0x18ffe3['query'][_0x7340('0x38')]);_0x29ed72['where']=qs[_0x7340('0x32')](_[_0x7340('0x3a')](_0x18ffe3[_0x7340('0x31')],_0x392ce1[_0x7340('0x32')]));if(_0x18ffe3['query']['filter']){_0x29ed72['where']=_[_0x7340('0x3d')](_0x29ed72[_0x7340('0x39')],{'$or':_[_0x7340('0x2b')](_0x29ed72[_0x7340('0x34')],function(_0x5c72c7){var _0x165120={};_0x165120[_0x5c72c7]={'$like':'%'+_0x18ffe3['query']['filter']+'%'};return _0x165120;})});}_0x29ed72=_['merge']({},_0x29ed72,_0x18ffe3[_0x7340('0x46')]);return _0x225ecb[_0x7340('0x50')](_0x29ed72);}})[_0x7340('0x27')](function(_0x223b5b){if(_0x223b5b){_0x2873a2=_0x223b5b['length'];if(!_0x18ffe3[_0x7340('0x31')][_0x7340('0x36')]('nolimit')){_0x29ed72['limit']=qs['limit'](_0x18ffe3[_0x7340('0x31')]['limit']);_0x29ed72[_0x7340('0x1d')]=qs[_0x7340('0x1d')](_0x18ffe3[_0x7340('0x31')]['offset']);}return _0x225ecb[_0x7340('0x50')](_0x29ed72);}})[_0x7340('0x27')](function(_0x6cc9b8){if(_0x6cc9b8){return _0x6cc9b8?{'count':_0x2873a2,'rows':_0x6cc9b8}:null;}})[_0x7340('0x27')](respondWithResult(_0x2889ff,null))[_0x7340('0x41')](handleError(_0x2889ff,null));};exports[_0x7340('0x52')]=function(_0x5bcd02,_0x57154c,_0xf58269){if(_0x5bcd02[_0x7340('0x48')]['id']){delete _0x5bcd02[_0x7340('0x48')]['id'];}return db[_0x7340('0x3f')]['findOne']({'where':{'id':_0x5bcd02[_0x7340('0x43')]['id']}})['then'](handleEntityNotFound(_0x57154c,null))['then'](function(_0x491d5b){if(_0x491d5b){return _0x491d5b[_0x7340('0x52')](_0x5bcd02[_0x7340('0x48')][_0x7340('0x53')]||[]);}return null;})[_0x7340('0x27')](respondWithResult(_0x57154c,null))['catch'](handleError(_0x57154c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 3555336..d509179 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 _0x7009=['int_freshdesk_configurations','util','../../config/logger','moment','bluebird','request-promise','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0x7009,0x64));var _0x9700=function(_0x53a9cb,_0x1d7a73){_0x53a9cb=_0x53a9cb-0x0;var _0x4fc163=_0x7009[_0x53a9cb];return _0x4fc163;};'use strict';var _=require('lodash');var util=require(_0x9700('0x0'));var logger=require(_0x9700('0x1'))('api');var moment=require(_0x9700('0x2'));var BPromise=require(_0x9700('0x3'));var rp=require(_0x9700('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9700('0x5'));var config=require('../../config/environment');var attributes=require(_0x9700('0x6'));module[_0x9700('0x7')]=function(_0x2f16b3,_0x5f448e){return _0x2f16b3[_0x9700('0x8')](_0x9700('0x9'),attributes,{'tableName':_0x9700('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52a0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x5a9841,_0x950566){var _0xb4f748=function(_0xdecea8){while(--_0xdecea8){_0x5a9841['push'](_0x5a9841['shift']());}};_0xb4f748(++_0x950566);}(_0x52a0,0xb3));var _0x052a=function(_0x43a8b9,_0x4ff1e0){_0x43a8b9=_0x43a8b9-0x0;var _0x39894b=_0x52a0[_0x43a8b9];return _0x39894b;};'use strict';var _=require(_0x052a('0x0'));var util=require(_0x052a('0x1'));var logger=require(_0x052a('0x2'))(_0x052a('0x3'));var moment=require(_0x052a('0x4'));var BPromise=require(_0x052a('0x5'));var rp=require(_0x052a('0x6'));var fs=require('fs');var path=require(_0x052a('0x7'));var rimraf=require(_0x052a('0x8'));var config=require(_0x052a('0x9'));var attributes=require(_0x052a('0xa'));module[_0x052a('0xb')]=function(_0x43349c,_0x4a8be7){return _0x43349c[_0x052a('0xc')]('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 c0ec7be..5162fe3 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 _0x22f5=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22f5,0x134));var _0x522f=function(_0x4040d3,_0x5624c8){_0x4040d3=_0x4040d3-0x0;var _0x3d2d2d=_0x22f5[_0x4040d3];return _0x3d2d2d;};'use strict';var _=require(_0x522f('0x0'));var util=require(_0x522f('0x1'));var moment=require(_0x522f('0x2'));var BPromise=require('bluebird');var rs=require(_0x522f('0x3'));var fs=require('fs');var Redis=require(_0x522f('0x4'));var db=require(_0x522f('0x5'))['db'];var utils=require(_0x522f('0x6'));var logger=require(_0x522f('0x7'))(_0x522f('0x8'));var config=require('../../config/environment');var jayson=require(_0x522f('0x9'));var client=jayson[_0x522f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229f0e,_0x2b2407,_0x32bed2){return new BPromise(function(_0x390dfc,_0x29f24d){return client[_0x522f('0xb')](_0x229f0e,_0x32bed2)[_0x522f('0xc')](function(_0x4ff064){logger[_0x522f('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b2407,'request\x20sent');logger['debug'](_0x522f('0xe'),_0x2b2407,'request\x20sent',JSON[_0x522f('0xf')](_0x4ff064));if(_0x4ff064['error']){if(_0x4ff064[_0x522f('0x10')][_0x522f('0x11')]===0x1f4){logger[_0x522f('0x10')](_0x522f('0x12'),_0x2b2407,_0x4ff064['error'][_0x522f('0x13')]);return _0x29f24d(_0x4ff064[_0x522f('0x10')][_0x522f('0x13')]);}logger[_0x522f('0x10')](_0x522f('0x12'),_0x2b2407,_0x4ff064['error'][_0x522f('0x13')]);return _0x390dfc(_0x4ff064[_0x522f('0x10')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b2407,_0x522f('0x14'));_0x390dfc(_0x4ff064[_0x522f('0x15')]['message']);}})[_0x522f('0x16')](function(_0x3bc52c){logger['error'](_0x522f('0x12'),_0x2b2407,_0x3bc52c);_0x29f24d(_0x3bc52c);});});} \ No newline at end of file +var _0x0543=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x387ff0,_0x5c8876){var _0x2aefd6=function(_0x350b60){while(--_0x350b60){_0x387ff0['push'](_0x387ff0['shift']());}};_0x2aefd6(++_0x5c8876);}(_0x0543,0x1c9));var _0x3054=function(_0x224ffa,_0x18bd58){_0x224ffa=_0x224ffa-0x0;var _0x528bf0=_0x0543[_0x224ffa];return _0x528bf0;};'use strict';var _=require('lodash');var util=require(_0x3054('0x0'));var moment=require('moment');var BPromise=require(_0x3054('0x1'));var rs=require(_0x3054('0x2'));var fs=require('fs');var Redis=require(_0x3054('0x3'));var db=require(_0x3054('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3054('0x5'))(_0x3054('0x6'));var config=require(_0x3054('0x7'));var jayson=require(_0x3054('0x8'));var client=jayson['client'][_0x3054('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28c1f6,_0x4aa8fb,_0xf8927b){return new BPromise(function(_0x24b504,_0x39fdad){return client[_0x3054('0xa')](_0x28c1f6,_0xf8927b)[_0x3054('0xb')](function(_0xfeb016){logger[_0x3054('0xc')](_0x3054('0xd'),_0x4aa8fb,'request\x20sent');logger[_0x3054('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4aa8fb,_0x3054('0xf'),JSON[_0x3054('0x10')](_0xfeb016));if(_0xfeb016[_0x3054('0x11')]){if(_0xfeb016['error'][_0x3054('0x12')]===0x1f4){logger[_0x3054('0x11')](_0x3054('0xd'),_0x4aa8fb,_0xfeb016[_0x3054('0x11')][_0x3054('0x13')]);return _0x39fdad(_0xfeb016[_0x3054('0x11')]['message']);}logger['error'](_0x3054('0xd'),_0x4aa8fb,_0xfeb016[_0x3054('0x11')][_0x3054('0x13')]);return _0x24b504(_0xfeb016[_0x3054('0x11')][_0x3054('0x13')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4aa8fb,'request\x20sent');_0x24b504(_0xfeb016[_0x3054('0x14')][_0x3054('0x13')]);}})['catch'](function(_0x20853c){logger[_0x3054('0x11')](_0x3054('0xd'),_0x4aa8fb,_0x20853c);_0x39fdad(_0x20853c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 242e754..b3bb055 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 _0x9e7a=['Router','fs-extra','./intFreshdeskField.controller','isAuthenticated','get','/:id','show','create','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x374b7f,_0x419e36){var _0x20f2a4=function(_0x5bc66f){while(--_0x5bc66f){_0x374b7f['push'](_0x374b7f['shift']());}};_0x20f2a4(++_0x419e36);}(_0x9e7a,0xd0));var _0xa9e7=function(_0x1d335e,_0x3712e){_0x1d335e=_0x1d335e-0x0;var _0x3601f6=_0x9e7a[_0x1d335e];return _0x3601f6;};'use strict';var multer=require('multer');var util=require(_0xa9e7('0x0'));var path=require('path');var timeout=require(_0xa9e7('0x1'));var express=require('express');var router=express[_0xa9e7('0x2')]();var fs_extra=require(_0xa9e7('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa9e7('0x4'));router['get']('/',auth[_0xa9e7('0x5')](),controller['index']);router[_0xa9e7('0x6')](_0xa9e7('0x7'),auth[_0xa9e7('0x5')](),controller[_0xa9e7('0x8')]);router['post']('/',auth[_0xa9e7('0x5')](),controller[_0xa9e7('0x9')]);router[_0xa9e7('0xa')](_0xa9e7('0x7'),auth['isAuthenticated'](),controller[_0xa9e7('0xb')]);router[_0xa9e7('0xc')](_0xa9e7('0x7'),auth['isAuthenticated'](),controller[_0xa9e7('0xd')]);module[_0xa9e7('0xe')]=router; \ No newline at end of file +var _0x96f2=['put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96f2,0x1f0));var _0x296f=function(_0x1cd9a5,_0x35f6cd){_0x1cd9a5=_0x1cd9a5-0x0;var _0x115c83=_0x96f2[_0x1cd9a5];return _0x115c83;};'use strict';var multer=require(_0x296f('0x0'));var util=require(_0x296f('0x1'));var path=require(_0x296f('0x2'));var timeout=require(_0x296f('0x3'));var express=require(_0x296f('0x4'));var router=express[_0x296f('0x5')]();var fs_extra=require(_0x296f('0x6'));var auth=require(_0x296f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x296f('0x8'));var controller=require('./intFreshdeskField.controller');router[_0x296f('0x9')]('/',auth[_0x296f('0xa')](),controller['index']);router[_0x296f('0x9')](_0x296f('0xb'),auth[_0x296f('0xa')](),controller['show']);router[_0x296f('0xc')]('/',auth[_0x296f('0xa')](),controller[_0x296f('0xd')]);router[_0x296f('0xe')](_0x296f('0xb'),auth[_0x296f('0xa')](),controller[_0x296f('0xf')]);router['delete']('/:id',auth[_0x296f('0xa')](),controller[_0x296f('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 5dc0c35..71ddbac 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 _0xce01=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xce01,0xc7));var _0x1ce0=function(_0x1f203b,_0x2a4220){_0x1f203b=_0x1f203b-0x0;var _0x22c75a=_0xce01[_0x1f203b];return _0x22c75a;};'use strict';var Sequelize=require(_0x1ce0('0x0'));module[_0x1ce0('0x1')]={'type':{'type':Sequelize[_0x1ce0('0x2')](_0x1ce0('0x3'),_0x1ce0('0x4'),'customVariable',_0x1ce0('0x5'),_0x1ce0('0x6')),'defaultValue':_0x1ce0('0x3')},'content':{'type':Sequelize[_0x1ce0('0x7')]},'key':{'type':Sequelize[_0x1ce0('0x7')]},'keyType':{'type':Sequelize[_0x1ce0('0x2')](_0x1ce0('0x3'),_0x1ce0('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x1ce0('0x7')]},'idField':{'type':Sequelize[_0x1ce0('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1ce0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3905=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x3905,0xf8));var _0x5390=function(_0x134764,_0x112da5){_0x134764=_0x134764-0x0;var _0x2fe527=_0x3905[_0x134764];return _0x2fe527;};'use strict';var Sequelize=require(_0x5390('0x0'));module[_0x5390('0x1')]={'type':{'type':Sequelize[_0x5390('0x2')](_0x5390('0x3'),_0x5390('0x4'),_0x5390('0x5'),_0x5390('0x6'),_0x5390('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5390('0x8')]},'key':{'type':Sequelize[_0x5390('0x8')]},'keyType':{'type':Sequelize[_0x5390('0x2')](_0x5390('0x3'),_0x5390('0x4'),_0x5390('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5390('0x8')]},'nameField':{'type':Sequelize[_0x5390('0x8')]},'customField':{'type':Sequelize[_0x5390('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5390('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index ee2b01e..db1ff99 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 _0x765e=['sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','json','apply','update','then','destroy','error','stack','index','map','FreshdeskField','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','order'];(function(_0x47b520,_0x3f9430){var _0x23535e=function(_0x3ac020){while(--_0x3ac020){_0x47b520['push'](_0x47b520['shift']());}};_0x23535e(++_0x3f9430);}(_0x765e,0x131));var _0xe765=function(_0x5d732f,_0x59f8c6){_0x5d732f=_0x5d732f-0x0;var _0x20c2c7=_0x765e[_0x5d732f];return _0x20c2c7;};'use strict';var emlformat=require(_0xe765('0x0'));var rimraf=require(_0xe765('0x1'));var zipdir=require(_0xe765('0x2'));var jsonpatch=require(_0xe765('0x3'));var rp=require(_0xe765('0x4'));var moment=require(_0xe765('0x5'));var BPromise=require(_0xe765('0x6'));var Mustache=require(_0xe765('0x7'));var util=require(_0xe765('0x8'));var path=require(_0xe765('0x9'));var sox=require(_0xe765('0xa'));var csv=require(_0xe765('0xb'));var ejs=require(_0xe765('0xc'));var fs=require('fs');var fs_extra=require(_0xe765('0xd'));var _=require(_0xe765('0xe'));var squel=require('squel');var crypto=require(_0xe765('0xf'));var jsforce=require(_0xe765('0x10'));var deskjs=require(_0xe765('0x11'));var toCsv=require(_0xe765('0xb'));var querystring=require(_0xe765('0x12'));var Papa=require(_0xe765('0x13'));var Redis=require(_0xe765('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xe765('0x15'));var as=require(_0xe765('0x16'));var hardwareService=require(_0xe765('0x17'));var logger=require('../../config/logger')(_0xe765('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe765('0x19'))['db'];function respondWithStatusCode(_0x18177f,_0x9411a0){_0x9411a0=_0x9411a0||0xcc;return function(_0x27456b){if(_0x27456b){return _0x18177f[_0xe765('0x1a')](_0x9411a0);}return _0x18177f['status'](_0x9411a0)[_0xe765('0x1b')]();};}function respondWithResult(_0x3a26d8,_0x395312){_0x395312=_0x395312||0xc8;return function(_0x58dc37){if(_0x58dc37){return _0x3a26d8[_0xe765('0x1c')](_0x395312)['json'](_0x58dc37);}};}function respondWithFilteredResult(_0x50e2ab,_0x2f673b){return function(_0x1b1cfe){if(_0x1b1cfe){var _0x3c887b=typeof _0x2f673b['offset']===_0xe765('0x1d')&&typeof _0x2f673b[_0xe765('0x1e')]===_0xe765('0x1d');var _0x1db3ca=_0x1b1cfe[_0xe765('0x1f')];var _0xf93371=_0x3c887b?0x0:_0x2f673b[_0xe765('0x20')];var _0x2a95a9=_0x3c887b?_0x1b1cfe[_0xe765('0x1f')]:_0x2f673b['offset']+_0x2f673b[_0xe765('0x1e')];var _0x56905c;if(_0x2a95a9>=_0x1db3ca){_0x2a95a9=_0x1db3ca;_0x56905c=0xc8;}else{_0x56905c=0xce;}_0x50e2ab[_0xe765('0x1c')](_0x56905c);return _0x50e2ab[_0xe765('0x21')]('Content-Range',_0xf93371+'-'+_0x2a95a9+'/'+_0x1db3ca)[_0xe765('0x22')](_0x1b1cfe);}return null;};}function patchUpdates(_0x59118f){return function(_0x1c73c8){try{jsonpatch[_0xe765('0x23')](_0x1c73c8,_0x59118f,!![]);}catch(_0x1efb96){return BPromise['reject'](_0x1efb96);}return _0x1c73c8['save']();};}function saveUpdates(_0x4b789b,_0x1c6de4){return function(_0x2a4427){if(_0x2a4427){return _0x2a4427[_0xe765('0x24')](_0x4b789b)[_0xe765('0x25')](function(_0x54b59c){return _0x54b59c;});}return null;};}function removeEntity(_0x50cfcb,_0x18ba77){return function(_0x2e2a34){if(_0x2e2a34){return _0x2e2a34[_0xe765('0x26')]()[_0xe765('0x25')](function(){_0x50cfcb[_0xe765('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aacbc,_0x5464b4){return function(_0x2b1f66){if(!_0x2b1f66){_0x1aacbc[_0xe765('0x1a')](0x194);}return _0x2b1f66;};}function handleError(_0xd877f3,_0x357f4e){_0x357f4e=_0x357f4e||0x1f4;return function(_0x40492d){logger[_0xe765('0x27')](_0x40492d[_0xe765('0x28')]);if(_0x40492d['name']){delete _0x40492d['name'];}_0xd877f3[_0xe765('0x1c')](_0x357f4e)['send'](_0x40492d);};}exports[_0xe765('0x29')]=function(_0x3f7493,_0x2fcbc9){var _0x64ffd4={},_0x1a8c01={},_0x4fce2c={'count':0x0,'rows':[]};var _0x43349b=_[_0xe765('0x2a')](db[_0xe765('0x2b')]['rawAttributes'],function(_0x5947c1){return{'name':_0x5947c1[_0xe765('0x2c')],'type':_0x5947c1['type'][_0xe765('0x2d')]};});_0x1a8c01[_0xe765('0x2e')]=_[_0xe765('0x2a')](_0x43349b,_0xe765('0x2f'));_0x1a8c01[_0xe765('0x30')]=_['keys'](_0x3f7493['query']);_0x1a8c01[_0xe765('0x31')]=_[_0xe765('0x32')](_0x1a8c01[_0xe765('0x2e')],_0x1a8c01[_0xe765('0x30')]);_0x64ffd4[_0xe765('0x33')]=_['intersection'](_0x1a8c01['model'],qs[_0xe765('0x34')](_0x3f7493['query'][_0xe765('0x34')]));_0x64ffd4[_0xe765('0x33')]=_0x64ffd4[_0xe765('0x33')][_0xe765('0x35')]?_0x64ffd4[_0xe765('0x33')]:_0x1a8c01[_0xe765('0x2e')];if(!_0x3f7493[_0xe765('0x30')]['hasOwnProperty']('nolimit')){_0x64ffd4['limit']=qs[_0xe765('0x1e')](_0x3f7493[_0xe765('0x30')][_0xe765('0x1e')]);_0x64ffd4[_0xe765('0x20')]=qs['offset'](_0x3f7493[_0xe765('0x30')][_0xe765('0x20')]);}_0x64ffd4[_0xe765('0x36')]=qs[_0xe765('0x37')](_0x3f7493['query'][_0xe765('0x37')]);_0x64ffd4['where']=qs[_0xe765('0x31')](_[_0xe765('0x38')](_0x3f7493[_0xe765('0x30')],_0x1a8c01[_0xe765('0x31')]),_0x43349b);if(_0x3f7493[_0xe765('0x30')][_0xe765('0x39')]){_0x64ffd4[_0xe765('0x3a')]=_[_0xe765('0x3b')](_0x64ffd4[_0xe765('0x3a')],{'$or':_[_0xe765('0x2a')](_0x43349b,function(_0x5e21ae){if(_0x5e21ae[_0xe765('0x3c')]!==_0xe765('0x3d')){var _0x11b459={};_0x11b459[_0x5e21ae['name']]={'$like':'%'+_0x3f7493['query']['filter']+'%'};return _0x11b459;}})});}_0x64ffd4=_[_0xe765('0x3b')]({},_0x64ffd4,_0x3f7493['options']);var _0x1f0db1={'where':_0x64ffd4[_0xe765('0x3a')]};return db[_0xe765('0x2b')][_0xe765('0x1f')](_0x1f0db1)['then'](function(_0x363f59){_0x4fce2c[_0xe765('0x1f')]=_0x363f59;if(_0x3f7493[_0xe765('0x30')][_0xe765('0x3e')]){_0x64ffd4[_0xe765('0x3f')]=[{'all':!![]}];}return db[_0xe765('0x2b')][_0xe765('0x40')](_0x64ffd4);})[_0xe765('0x25')](function(_0xb92246){_0x4fce2c[_0xe765('0x41')]=_0xb92246;return _0x4fce2c;})['then'](respondWithFilteredResult(_0x2fcbc9,_0x64ffd4))[_0xe765('0x42')](handleError(_0x2fcbc9,null));};exports['show']=function(_0x1248ea,_0x1d2b24){var _0x4d2814={'raw':!![],'where':{'id':_0x1248ea['params']['id']}},_0x3977e5={};_0x3977e5['model']=_['keys'](db[_0xe765('0x2b')][_0xe765('0x43')]);_0x3977e5[_0xe765('0x30')]=_['keys'](_0x1248ea[_0xe765('0x30')]);_0x3977e5[_0xe765('0x31')]=_[_0xe765('0x32')](_0x3977e5[_0xe765('0x2e')],_0x3977e5[_0xe765('0x30')]);_0x4d2814[_0xe765('0x33')]=_[_0xe765('0x32')](_0x3977e5[_0xe765('0x2e')],qs[_0xe765('0x34')](_0x1248ea['query'][_0xe765('0x34')]));_0x4d2814['attributes']=_0x4d2814['attributes'][_0xe765('0x35')]?_0x4d2814['attributes']:_0x3977e5[_0xe765('0x2e')];if(_0x1248ea[_0xe765('0x30')][_0xe765('0x3e')]){_0x4d2814['include']=[{'all':!![]}];}_0x4d2814=_[_0xe765('0x3b')]({},_0x4d2814,_0x1248ea['options']);return db[_0xe765('0x2b')][_0xe765('0x44')](_0x4d2814)[_0xe765('0x25')](handleEntityNotFound(_0x1d2b24,null))['then'](respondWithResult(_0x1d2b24,null))[_0xe765('0x42')](handleError(_0x1d2b24,null));};exports[_0xe765('0x45')]=function(_0x115f16,_0x2d360e){return db['FreshdeskField']['create'](_0x115f16['body'],{})[_0xe765('0x25')](respondWithResult(_0x2d360e,0xc9))[_0xe765('0x42')](handleError(_0x2d360e,null));};exports[_0xe765('0x24')]=function(_0x58310d,_0x14834c){if(_0x58310d['body']['id']){delete _0x58310d[_0xe765('0x46')]['id'];}return db[_0xe765('0x2b')][_0xe765('0x44')]({'where':{'id':_0x58310d[_0xe765('0x47')]['id']}})[_0xe765('0x25')](handleEntityNotFound(_0x14834c,null))[_0xe765('0x25')](saveUpdates(_0x58310d['body'],null))[_0xe765('0x25')](respondWithResult(_0x14834c,null))[_0xe765('0x42')](handleError(_0x14834c,null));};exports[_0xe765('0x26')]=function(_0x1214a8,_0x14c3b5){return db[_0xe765('0x2b')]['find']({'where':{'id':_0x1214a8['params']['id']}})[_0xe765('0x25')](handleEntityNotFound(_0x14c3b5,null))[_0xe765('0x25')](removeEntity(_0x14c3b5,null))[_0xe765('0x42')](handleError(_0x14c3b5,null));}; \ No newline at end of file +var _0x9c2c=['VIRTUAL','filter','options','includeAll','FreshdeskField','findAll','rows','catch','show','params','keys','length','include','find','create','body','eml-format','rimraf','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge'];(function(_0x19f625,_0x15055b){var _0x5cc473=function(_0x24223c){while(--_0x24223c){_0x19f625['push'](_0x19f625['shift']());}};_0x5cc473(++_0x15055b);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc9c2('0x0'));var rimraf=require(_0xc9c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc9c2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc9c2('0x3'));var util=require(_0xc9c2('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xc9c2('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9c2('0x6'));var _=require(_0xc9c2('0x7'));var squel=require(_0xc9c2('0x8'));var crypto=require(_0xc9c2('0x9'));var jsforce=require(_0xc9c2('0xa'));var deskjs=require(_0xc9c2('0xb'));var toCsv=require(_0xc9c2('0x5'));var querystring=require(_0xc9c2('0xc'));var Papa=require(_0xc9c2('0xd'));var Redis=require('ioredis');var authService=require(_0xc9c2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc9c2('0xf'));var hardwareService=require(_0xc9c2('0x10'));var logger=require(_0xc9c2('0x11'))(_0xc9c2('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc9c2('0x13'));var db=require(_0xc9c2('0x14'))['db'];function respondWithStatusCode(_0x568f69,_0x7ec780){_0x7ec780=_0x7ec780||0xcc;return function(_0x1f08a7){if(_0x1f08a7){return _0x568f69[_0xc9c2('0x15')](_0x7ec780);}return _0x568f69[_0xc9c2('0x16')](_0x7ec780)[_0xc9c2('0x17')]();};}function respondWithResult(_0x3b0058,_0x33b288){_0x33b288=_0x33b288||0xc8;return function(_0x132702){if(_0x132702){return _0x3b0058[_0xc9c2('0x16')](_0x33b288)[_0xc9c2('0x18')](_0x132702);}};}function respondWithFilteredResult(_0xf94209,_0x383667){return function(_0x480d7c){if(_0x480d7c){var _0x27840d=typeof _0x383667[_0xc9c2('0x19')]===_0xc9c2('0x1a')&&typeof _0x383667[_0xc9c2('0x1b')]===_0xc9c2('0x1a');var _0x49413b=_0x480d7c[_0xc9c2('0x1c')];var _0x37c027=_0x27840d?0x0:_0x383667[_0xc9c2('0x19')];var _0x4e4ded=_0x27840d?_0x480d7c[_0xc9c2('0x1c')]:_0x383667[_0xc9c2('0x19')]+_0x383667[_0xc9c2('0x1b')];var _0x484ca3;if(_0x4e4ded>=_0x49413b){_0x4e4ded=_0x49413b;_0x484ca3=0xc8;}else{_0x484ca3=0xce;}_0xf94209[_0xc9c2('0x16')](_0x484ca3);return _0xf94209[_0xc9c2('0x1d')]('Content-Range',_0x37c027+'-'+_0x4e4ded+'/'+_0x49413b)['json'](_0x480d7c);}return null;};}function patchUpdates(_0x37e3){return function(_0x50f280){try{jsonpatch[_0xc9c2('0x1e')](_0x50f280,_0x37e3,!![]);}catch(_0x140c8a){return BPromise[_0xc9c2('0x1f')](_0x140c8a);}return _0x50f280[_0xc9c2('0x20')]();};}function saveUpdates(_0x3e1774,_0x53c460){return function(_0x1fbac4){if(_0x1fbac4){return _0x1fbac4[_0xc9c2('0x21')](_0x3e1774)[_0xc9c2('0x22')](function(_0x11cc07){return _0x11cc07;});}return null;};}function removeEntity(_0x32c372,_0x385030){return function(_0x56e515){if(_0x56e515){return _0x56e515[_0xc9c2('0x23')]()[_0xc9c2('0x22')](function(){_0x32c372['status'](0xcc)[_0xc9c2('0x17')]();});}};}function handleEntityNotFound(_0x4b3b97,_0xa18b32){return function(_0xd803e9){if(!_0xd803e9){_0x4b3b97[_0xc9c2('0x15')](0x194);}return _0xd803e9;};}function handleError(_0x2222e4,_0x484d55){_0x484d55=_0x484d55||0x1f4;return function(_0x2073ef){logger['error'](_0x2073ef[_0xc9c2('0x24')]);if(_0x2073ef[_0xc9c2('0x25')]){delete _0x2073ef[_0xc9c2('0x25')];}_0x2222e4[_0xc9c2('0x16')](_0x484d55)[_0xc9c2('0x26')](_0x2073ef);};}exports['index']=function(_0x3cedb5,_0xe2f93b){var _0x40033a={},_0x1554ae={},_0xa89cb8={'count':0x0,'rows':[]};var _0x460832=_[_0xc9c2('0x27')](db['FreshdeskField'][_0xc9c2('0x28')],function(_0x4a9fca){return{'name':_0x4a9fca[_0xc9c2('0x29')],'type':_0x4a9fca[_0xc9c2('0x2a')]['key']};});_0x1554ae[_0xc9c2('0x2b')]=_[_0xc9c2('0x27')](_0x460832,_0xc9c2('0x25'));_0x1554ae[_0xc9c2('0x2c')]=_['keys'](_0x3cedb5[_0xc9c2('0x2c')]);_0x1554ae[_0xc9c2('0x2d')]=_['intersection'](_0x1554ae['model'],_0x1554ae[_0xc9c2('0x2c')]);_0x40033a[_0xc9c2('0x2e')]=_[_0xc9c2('0x2f')](_0x1554ae['model'],qs['fields'](_0x3cedb5[_0xc9c2('0x2c')][_0xc9c2('0x30')]));_0x40033a['attributes']=_0x40033a[_0xc9c2('0x2e')]['length']?_0x40033a[_0xc9c2('0x2e')]:_0x1554ae[_0xc9c2('0x2b')];if(!_0x3cedb5[_0xc9c2('0x2c')][_0xc9c2('0x31')](_0xc9c2('0x32'))){_0x40033a[_0xc9c2('0x1b')]=qs[_0xc9c2('0x1b')](_0x3cedb5[_0xc9c2('0x2c')][_0xc9c2('0x1b')]);_0x40033a['offset']=qs[_0xc9c2('0x19')](_0x3cedb5['query'][_0xc9c2('0x19')]);}_0x40033a[_0xc9c2('0x33')]=qs['sort'](_0x3cedb5[_0xc9c2('0x2c')][_0xc9c2('0x34')]);_0x40033a['where']=qs[_0xc9c2('0x2d')](_[_0xc9c2('0x35')](_0x3cedb5[_0xc9c2('0x2c')],_0x1554ae['filters']),_0x460832);if(_0x3cedb5[_0xc9c2('0x2c')]['filter']){_0x40033a[_0xc9c2('0x36')]=_[_0xc9c2('0x37')](_0x40033a['where'],{'$or':_[_0xc9c2('0x27')](_0x460832,function(_0x3f718a){if(_0x3f718a[_0xc9c2('0x2a')]!==_0xc9c2('0x38')){var _0x3f9248={};_0x3f9248[_0x3f718a[_0xc9c2('0x25')]]={'$like':'%'+_0x3cedb5[_0xc9c2('0x2c')][_0xc9c2('0x39')]+'%'};return _0x3f9248;}})});}_0x40033a=_[_0xc9c2('0x37')]({},_0x40033a,_0x3cedb5[_0xc9c2('0x3a')]);var _0x8d6710={'where':_0x40033a['where']};return db['FreshdeskField'][_0xc9c2('0x1c')](_0x8d6710)[_0xc9c2('0x22')](function(_0x4507c9){_0xa89cb8[_0xc9c2('0x1c')]=_0x4507c9;if(_0x3cedb5[_0xc9c2('0x2c')][_0xc9c2('0x3b')]){_0x40033a['include']=[{'all':!![]}];}return db[_0xc9c2('0x3c')][_0xc9c2('0x3d')](_0x40033a);})[_0xc9c2('0x22')](function(_0x46c740){_0xa89cb8[_0xc9c2('0x3e')]=_0x46c740;return _0xa89cb8;})['then'](respondWithFilteredResult(_0xe2f93b,_0x40033a))[_0xc9c2('0x3f')](handleError(_0xe2f93b,null));};exports[_0xc9c2('0x40')]=function(_0x2126f8,_0x4f6bc9){var _0x3a05f8={'raw':!![],'where':{'id':_0x2126f8[_0xc9c2('0x41')]['id']}},_0xd3d946={};_0xd3d946[_0xc9c2('0x2b')]=_[_0xc9c2('0x42')](db['FreshdeskField']['rawAttributes']);_0xd3d946[_0xc9c2('0x2c')]=_[_0xc9c2('0x42')](_0x2126f8['query']);_0xd3d946[_0xc9c2('0x2d')]=_[_0xc9c2('0x2f')](_0xd3d946[_0xc9c2('0x2b')],_0xd3d946[_0xc9c2('0x2c')]);_0x3a05f8[_0xc9c2('0x2e')]=_[_0xc9c2('0x2f')](_0xd3d946[_0xc9c2('0x2b')],qs['fields'](_0x2126f8[_0xc9c2('0x2c')]['fields']));_0x3a05f8[_0xc9c2('0x2e')]=_0x3a05f8['attributes'][_0xc9c2('0x43')]?_0x3a05f8['attributes']:_0xd3d946[_0xc9c2('0x2b')];if(_0x2126f8['query'][_0xc9c2('0x3b')]){_0x3a05f8[_0xc9c2('0x44')]=[{'all':!![]}];}_0x3a05f8=_[_0xc9c2('0x37')]({},_0x3a05f8,_0x2126f8[_0xc9c2('0x3a')]);return db[_0xc9c2('0x3c')][_0xc9c2('0x45')](_0x3a05f8)[_0xc9c2('0x22')](handleEntityNotFound(_0x4f6bc9,null))['then'](respondWithResult(_0x4f6bc9,null))[_0xc9c2('0x3f')](handleError(_0x4f6bc9,null));};exports[_0xc9c2('0x46')]=function(_0x412df0,_0xad73d4){return db[_0xc9c2('0x3c')][_0xc9c2('0x46')](_0x412df0['body'],{})[_0xc9c2('0x22')](respondWithResult(_0xad73d4,0xc9))[_0xc9c2('0x3f')](handleError(_0xad73d4,null));};exports[_0xc9c2('0x21')]=function(_0x88fa84,_0x2e9925){if(_0x88fa84[_0xc9c2('0x47')]['id']){delete _0x88fa84[_0xc9c2('0x47')]['id'];}return db[_0xc9c2('0x3c')]['find']({'where':{'id':_0x88fa84[_0xc9c2('0x41')]['id']}})[_0xc9c2('0x22')](handleEntityNotFound(_0x2e9925,null))[_0xc9c2('0x22')](saveUpdates(_0x88fa84[_0xc9c2('0x47')],null))[_0xc9c2('0x22')](respondWithResult(_0x2e9925,null))['catch'](handleError(_0x2e9925,null));};exports[_0xc9c2('0x23')]=function(_0x4e2589,_0xdedc7c){return db['FreshdeskField'][_0xc9c2('0x45')]({'where':{'id':_0x4e2589['params']['id']}})[_0xc9c2('0x22')](handleEntityNotFound(_0xdedc7c,null))['then'](removeEntity(_0xdedc7c,null))['catch'](handleError(_0xdedc7c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 62b30a2..a840f39 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 _0x1233=['define','int_freshdesk_fields','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1233,0x1ca));var _0x3123=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0x1233[_0x32729c];return _0x482cfd;};'use strict';var _=require('lodash');var util=require(_0x3123('0x0'));var logger=require(_0x3123('0x1'))('api');var moment=require(_0x3123('0x2'));var BPromise=require(_0x3123('0x3'));var rp=require(_0x3123('0x4'));var fs=require('fs');var path=require(_0x3123('0x5'));var rimraf=require(_0x3123('0x6'));var config=require(_0x3123('0x7'));var attributes=require(_0x3123('0x8'));module[_0x3123('0x9')]=function(_0x2e568b,_0x321a81){return _0x2e568b[_0x3123('0xa')]('FreshdeskField',attributes,{'tableName':_0x3123('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x3123('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa863=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','FieldId','util','api','moment','path'];(function(_0x59f7b8,_0xb2ac21){var _0x7b28c5=function(_0x427d2d){while(--_0x427d2d){_0x59f7b8['push'](_0x59f7b8['shift']());}};_0x7b28c5(++_0xb2ac21);}(_0xa863,0x1d0));var _0x3a86=function(_0x55ffb5,_0x3bb935){_0x55ffb5=_0x55ffb5-0x0;var _0x1b9745=_0xa863[_0x55ffb5];return _0x1b9745;};'use strict';var _=require('lodash');var util=require(_0x3a86('0x0'));var logger=require('../../config/logger')(_0x3a86('0x1'));var moment=require(_0x3a86('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a86('0x3'));var rimraf=require(_0x3a86('0x4'));var config=require(_0x3a86('0x5'));var attributes=require(_0x3a86('0x6'));module[_0x3a86('0x7')]=function(_0x107486,_0x1fb484){return _0x107486[_0x3a86('0x8')](_0x3a86('0x9'),attributes,{'tableName':_0x3a86('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x3a86('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 0a8b75f..8786f24 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 _0x4775=['error','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4775,0x153));var _0x5477=function(_0x19f5fc,_0x4c658a){_0x19f5fc=_0x19f5fc-0x0;var _0x315fa3=_0x4775[_0x19f5fc];return _0x315fa3;};'use strict';var _=require(_0x5477('0x0'));var util=require(_0x5477('0x1'));var moment=require(_0x5477('0x2'));var BPromise=require(_0x5477('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5477('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5477('0x5'));var logger=require('../../config/logger')(_0x5477('0x6'));var config=require(_0x5477('0x7'));var jayson=require(_0x5477('0x8'));var client=jayson[_0x5477('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x586263,_0x312c1b,_0x4cb109){return new BPromise(function(_0x4acf98,_0x4168c3){return client[_0x5477('0xa')](_0x586263,_0x4cb109)[_0x5477('0xb')](function(_0x4d9f47){logger[_0x5477('0xc')](_0x5477('0xd'),_0x312c1b,_0x5477('0xe'));logger[_0x5477('0xf')](_0x5477('0x10'),_0x312c1b,'request\x20sent',JSON[_0x5477('0x11')](_0x4d9f47));if(_0x4d9f47[_0x5477('0x12')]){if(_0x4d9f47['error']['code']===0x1f4){logger[_0x5477('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x312c1b,_0x4d9f47[_0x5477('0x12')][_0x5477('0x13')]);return _0x4168c3(_0x4d9f47[_0x5477('0x12')][_0x5477('0x13')]);}logger[_0x5477('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x312c1b,_0x4d9f47['error'][_0x5477('0x13')]);return _0x4acf98(_0x4d9f47['error'][_0x5477('0x13')]);}else{logger[_0x5477('0xc')](_0x5477('0xd'),_0x312c1b,_0x5477('0xe'));_0x4acf98(_0x4d9f47['result']['message']);}})[_0x5477('0x14')](function(_0x127cd9){logger[_0x5477('0x12')](_0x5477('0xd'),_0x312c1b,_0x127cd9);_0x4168c3(_0x127cd9);});});} \ No newline at end of file +var _0xbc04=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util'];(function(_0x228a28,_0x95bebb){var _0x4fc4c5=function(_0x4f0419){while(--_0x4f0419){_0x228a28['push'](_0x228a28['shift']());}};_0x4fc4c5(++_0x95bebb);}(_0xbc04,0x1e2));var _0x4bc0=function(_0x324bcf,_0x2d4e18){_0x324bcf=_0x324bcf-0x0;var _0x459574=_0xbc04[_0x324bcf];return _0x459574;};'use strict';var _=require('lodash');var util=require(_0x4bc0('0x0'));var moment=require(_0x4bc0('0x1'));var BPromise=require(_0x4bc0('0x2'));var rs=require(_0x4bc0('0x3'));var fs=require('fs');var Redis=require(_0x4bc0('0x4'));var db=require(_0x4bc0('0x5'))['db'];var utils=require(_0x4bc0('0x6'));var logger=require(_0x4bc0('0x7'))(_0x4bc0('0x8'));var config=require('../../config/environment');var jayson=require(_0x4bc0('0x9'));var client=jayson['client'][_0x4bc0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b4a66,_0x1e4248,_0xe6ac66){return new BPromise(function(_0x5c09fa,_0x3a728e){return client[_0x4bc0('0xb')](_0x1b4a66,_0xe6ac66)['then'](function(_0x85d1d1){logger[_0x4bc0('0xc')](_0x4bc0('0xd'),_0x1e4248,'request\x20sent');logger[_0x4bc0('0xe')](_0x4bc0('0xf'),_0x1e4248,_0x4bc0('0x10'),JSON[_0x4bc0('0x11')](_0x85d1d1));if(_0x85d1d1[_0x4bc0('0x12')]){if(_0x85d1d1[_0x4bc0('0x12')][_0x4bc0('0x13')]===0x1f4){logger['error'](_0x4bc0('0xd'),_0x1e4248,_0x85d1d1[_0x4bc0('0x12')][_0x4bc0('0x14')]);return _0x3a728e(_0x85d1d1[_0x4bc0('0x12')]['message']);}logger[_0x4bc0('0x12')](_0x4bc0('0xd'),_0x1e4248,_0x85d1d1['error'][_0x4bc0('0x14')]);return _0x5c09fa(_0x85d1d1[_0x4bc0('0x12')][_0x4bc0('0x14')]);}else{logger[_0x4bc0('0xc')](_0x4bc0('0xd'),_0x1e4248,'request\x20sent');_0x5c09fa(_0x85d1d1[_0x4bc0('0x15')][_0x4bc0('0x14')]);}})[_0x4bc0('0x16')](function(_0xcd4b68){logger[_0x4bc0('0x12')](_0x4bc0('0xd'),_0x1e4248,_0xcd4b68);_0x3a728e(_0xcd4b68);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 3f4fff8..f2e3dec 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 _0x9ffd=['../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5e9697,_0x5adc82){_0x5e9697=_0x5e9697-0x0;var _0x4d4b7c=_0x9ffd[_0x5e9697];return _0x4d4b7c;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xb')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0x10')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0x10')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x12')]);router['put']('/:id',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller['destroy']);module[_0xd9ff('0x15')]=router; \ No newline at end of file +var _0xc900=['../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x18704c,_0x4d28c8){var _0x57200a=function(_0x21cabf){while(--_0x21cabf){_0x18704c['push'](_0x18704c['shift']());}};_0x57200a(++_0x4d28c8);}(_0xc900,0xb3));var _0x0c90=function(_0x212eff,_0x19aec3){_0x212eff=_0x212eff-0x0;var _0x25f068=_0xc900[_0x212eff];return _0x25f068;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0c90('0x0'));var timeout=require(_0x0c90('0x1'));var express=require(_0x0c90('0x2'));var router=express['Router']();var fs_extra=require(_0x0c90('0x3'));var auth=require(_0x0c90('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0c90('0x5'));var controller=require(_0x0c90('0x6'));router[_0x0c90('0x7')]('/',auth[_0x0c90('0x8')](),controller[_0x0c90('0x9')]);router[_0x0c90('0x7')]('/:id',auth[_0x0c90('0x8')](),controller[_0x0c90('0xa')]);router[_0x0c90('0x7')](_0x0c90('0xb'),auth[_0x0c90('0x8')](),controller[_0x0c90('0xc')]);router[_0x0c90('0x7')](_0x0c90('0xd'),auth[_0x0c90('0x8')](),controller[_0x0c90('0xe')]);router[_0x0c90('0xf')]('/',auth[_0x0c90('0x8')](),controller[_0x0c90('0x10')]);router['post'](_0x0c90('0xb'),auth['isAuthenticated'](),controller[_0x0c90('0x11')]);router['put'](_0x0c90('0x12'),auth[_0x0c90('0x8')](),controller[_0x0c90('0x13')]);router[_0x0c90('0x14')](_0x0c90('0x12'),auth['isAuthenticated'](),controller[_0x0c90('0x15')]);module[_0x0c90('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 9698046..dc7ad19 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 _0xadb5=['remoteUri','exports','STRING','username'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0xadb5,0xad));var _0x5adb=function(_0x522e32,_0x53bab3){_0x522e32=_0x522e32-0x0;var _0x83f324=_0xadb5[_0x522e32];return _0x83f324;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5adb('0x1')]},'username':{'type':Sequelize[_0x5adb('0x1')],'unique':_0x5adb('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5adb('0x1')],'unique':_0x5adb('0x3')},'serverUrl':{'type':Sequelize[_0x5adb('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5430=['STRING','username','remoteUri','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5430,0x10c));var _0x0543=function(_0x4f0336,_0xd1de23){_0x4f0336=_0x4f0336-0x0;var _0x5cbd9e=_0x5430[_0x4f0336];return _0x5cbd9e;};'use strict';var Sequelize=require(_0x0543('0x0'));module[_0x0543('0x1')]={'name':{'type':Sequelize[_0x0543('0x2')]},'description':{'type':Sequelize[_0x0543('0x2')]},'username':{'type':Sequelize[_0x0543('0x2')],'unique':_0x0543('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0543('0x4')},'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 269f8d2..13eb9a9 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 _0x19b0=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','length','find','create','body','findOne','getConfigurations','AccountId','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','Subjects','getFields','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x19b0,0xbf));var _0x019b=function(_0x489038,_0x54b469){_0x489038=_0x489038-0x0;var _0x4bd286=_0x19b0[_0x489038];return _0x4bd286;};'use strict';var emlformat=require(_0x019b('0x0'));var rimraf=require(_0x019b('0x1'));var zipdir=require(_0x019b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x019b('0x3'));var moment=require(_0x019b('0x4'));var BPromise=require(_0x019b('0x5'));var Mustache=require(_0x019b('0x6'));var util=require(_0x019b('0x7'));var path=require(_0x019b('0x8'));var sox=require(_0x019b('0x9'));var csv=require(_0x019b('0xa'));var ejs=require(_0x019b('0xb'));var fs=require('fs');var fs_extra=require(_0x019b('0xc'));var _=require(_0x019b('0xd'));var squel=require(_0x019b('0xe'));var crypto=require('crypto');var jsforce=require(_0x019b('0xf'));var deskjs=require(_0x019b('0x10'));var toCsv=require(_0x019b('0xa'));var querystring=require(_0x019b('0x11'));var Papa=require(_0x019b('0x12'));var Redis=require(_0x019b('0x13'));var authService=require(_0x019b('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x019b('0x15'));var logger=require(_0x019b('0x16'))(_0x019b('0x17'));var utils=require(_0x019b('0x18'));var config=require(_0x019b('0x19'));var licenseUtil=require(_0x019b('0x1a'));var db=require(_0x019b('0x1b'))['db'];var integrations=require(_0x019b('0x1c'));function respondWithStatusCode(_0x20c48e,_0x1c8396){_0x1c8396=_0x1c8396||0xcc;return function(_0x207579){if(_0x207579){return _0x20c48e[_0x019b('0x1d')](_0x1c8396);}return _0x20c48e[_0x019b('0x1e')](_0x1c8396)['end']();};}function respondWithResult(_0xfdf48e,_0x41054e){_0x41054e=_0x41054e||0xc8;return function(_0x5556a6){if(_0x5556a6){return _0xfdf48e[_0x019b('0x1e')](_0x41054e)['json'](_0x5556a6);}};}function respondWithFilteredResult(_0x2303c5,_0xa37b96){return function(_0x468cdd){if(_0x468cdd){var _0x21a529=typeof _0xa37b96[_0x019b('0x1f')]==='undefined'&&typeof _0xa37b96[_0x019b('0x20')]==='undefined';var _0x1613de=_0x468cdd['count'];var _0x40a500=_0x21a529?0x0:_0xa37b96[_0x019b('0x1f')];var _0x20aff8=_0x21a529?_0x468cdd[_0x019b('0x21')]:_0xa37b96[_0x019b('0x1f')]+_0xa37b96['limit'];var _0x54f8d1;if(_0x20aff8>=_0x1613de){_0x20aff8=_0x1613de;_0x54f8d1=0xc8;}else{_0x54f8d1=0xce;}_0x2303c5[_0x019b('0x1e')](_0x54f8d1);return _0x2303c5[_0x019b('0x22')](_0x019b('0x23'),_0x40a500+'-'+_0x20aff8+'/'+_0x1613de)['json'](_0x468cdd);}return null;};}function patchUpdates(_0x7f927a){return function(_0x293746){try{jsonpatch['apply'](_0x293746,_0x7f927a,!![]);}catch(_0x7b709d){return BPromise[_0x019b('0x24')](_0x7b709d);}return _0x293746[_0x019b('0x25')]();};}function saveUpdates(_0x26da45,_0x448b1d){return function(_0x33baba){if(_0x33baba){return _0x33baba[_0x019b('0x26')](_0x26da45)[_0x019b('0x27')](function(_0x2fc096){return _0x2fc096;});}return null;};}function removeEntity(_0xdbcda1,_0x4e02c8){return function(_0x1c74bb){if(_0x1c74bb){return _0x1c74bb[_0x019b('0x28')]()[_0x019b('0x27')](function(){_0xdbcda1[_0x019b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3be02d,_0x15f85b){return function(_0x4ca51e){if(!_0x4ca51e){_0x3be02d[_0x019b('0x1d')](0x194);}return _0x4ca51e;};}function handleError(_0x4c23e1,_0x1129a4){_0x1129a4=_0x1129a4||0x1f4;return function(_0xf628ae){logger[_0x019b('0x29')](_0xf628ae[_0x019b('0x2a')]);if(_0xf628ae[_0x019b('0x2b')]){delete _0xf628ae[_0x019b('0x2b')];}_0x4c23e1['status'](_0x1129a4)[_0x019b('0x2c')](_0xf628ae);};}exports[_0x019b('0x2d')]=function(_0x214dcc,_0x37957d){var _0x477339={},_0x40cdfe={},_0x3608a9={'count':0x0,'rows':[]};var _0x2ff2bc=_[_0x019b('0x2e')](db[_0x019b('0x2f')][_0x019b('0x30')],function(_0x3e97f6){return{'name':_0x3e97f6[_0x019b('0x31')],'type':_0x3e97f6[_0x019b('0x32')][_0x019b('0x33')]};});_0x40cdfe[_0x019b('0x34')]=_[_0x019b('0x2e')](_0x2ff2bc,_0x019b('0x2b'));_0x40cdfe[_0x019b('0x35')]=_[_0x019b('0x36')](_0x214dcc[_0x019b('0x35')]);_0x40cdfe['filters']=_[_0x019b('0x37')](_0x40cdfe['model'],_0x40cdfe[_0x019b('0x35')]);_0x477339[_0x019b('0x38')]=_[_0x019b('0x37')](_0x40cdfe[_0x019b('0x34')],qs[_0x019b('0x39')](_0x214dcc['query'][_0x019b('0x39')]));_0x477339[_0x019b('0x38')]=_0x477339[_0x019b('0x38')]['length']?_0x477339[_0x019b('0x38')]:_0x40cdfe[_0x019b('0x34')];if(!_0x214dcc[_0x019b('0x35')][_0x019b('0x3a')](_0x019b('0x3b'))){_0x477339[_0x019b('0x20')]=qs[_0x019b('0x20')](_0x214dcc[_0x019b('0x35')]['limit']);_0x477339['offset']=qs[_0x019b('0x1f')](_0x214dcc[_0x019b('0x35')][_0x019b('0x1f')]);}_0x477339['order']=qs[_0x019b('0x3c')](_0x214dcc['query'][_0x019b('0x3c')]);_0x477339[_0x019b('0x3d')]=qs[_0x019b('0x3e')](_[_0x019b('0x3f')](_0x214dcc[_0x019b('0x35')],_0x40cdfe[_0x019b('0x3e')]),_0x2ff2bc);if(_0x214dcc['query'][_0x019b('0x40')]){_0x477339[_0x019b('0x3d')]=_['merge'](_0x477339['where'],{'$or':_[_0x019b('0x2e')](_0x2ff2bc,function(_0x545762){if(_0x545762['type']!=='VIRTUAL'){var _0x19c1c5={};_0x19c1c5[_0x545762[_0x019b('0x2b')]]={'$like':'%'+_0x214dcc['query']['filter']+'%'};return _0x19c1c5;}})});}_0x477339=_[_0x019b('0x41')]({},_0x477339,_0x214dcc[_0x019b('0x42')]);var _0x25f0a8={'where':_0x477339[_0x019b('0x3d')]};return db[_0x019b('0x2f')][_0x019b('0x21')](_0x25f0a8)['then'](function(_0x4cde42){_0x3608a9[_0x019b('0x21')]=_0x4cde42;if(_0x214dcc[_0x019b('0x35')][_0x019b('0x43')]){_0x477339['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x019b('0x44')](_0x477339);})[_0x019b('0x27')](function(_0x494055){_0x3608a9[_0x019b('0x45')]=_0x494055;return _0x3608a9;})[_0x019b('0x27')](respondWithFilteredResult(_0x37957d,_0x477339))[_0x019b('0x46')](handleError(_0x37957d,null));};exports[_0x019b('0x47')]=function(_0x52ee72,_0x2fa5df){var _0x3399c4={'raw':![],'where':{'id':_0x52ee72[_0x019b('0x48')]['id']}},_0x1270d8={};_0x1270d8[_0x019b('0x34')]=_[_0x019b('0x36')](db[_0x019b('0x2f')][_0x019b('0x30')]);_0x1270d8[_0x019b('0x35')]=_[_0x019b('0x36')](_0x52ee72[_0x019b('0x35')]);_0x1270d8[_0x019b('0x3e')]=_['intersection'](_0x1270d8[_0x019b('0x34')],_0x1270d8[_0x019b('0x35')]);_0x3399c4[_0x019b('0x38')]=_[_0x019b('0x37')](_0x1270d8[_0x019b('0x34')],qs[_0x019b('0x39')](_0x52ee72['query'][_0x019b('0x39')]));_0x3399c4['attributes']=_0x3399c4['attributes'][_0x019b('0x49')]?_0x3399c4[_0x019b('0x38')]:_0x1270d8['model'];if(_0x52ee72[_0x019b('0x35')][_0x019b('0x43')]){_0x3399c4['include']=[{'all':!![]}];}_0x3399c4=_[_0x019b('0x41')]({},_0x3399c4,_0x52ee72[_0x019b('0x42')]);return db[_0x019b('0x2f')][_0x019b('0x4a')](_0x3399c4)[_0x019b('0x27')](handleEntityNotFound(_0x2fa5df,null))[_0x019b('0x27')](respondWithResult(_0x2fa5df,null))[_0x019b('0x46')](handleError(_0x2fa5df,null));};exports['create']=function(_0xfa1316,_0x37560b){return db[_0x019b('0x2f')][_0x019b('0x4b')](_0xfa1316[_0x019b('0x4c')],{})[_0x019b('0x27')](respondWithResult(_0x37560b,0xc9))[_0x019b('0x46')](handleError(_0x37560b,null));};exports[_0x019b('0x26')]=function(_0x3ae202,_0x429fb7){if(_0x3ae202[_0x019b('0x4c')]['id']){delete _0x3ae202[_0x019b('0x4c')]['id'];}return db[_0x019b('0x2f')][_0x019b('0x4a')]({'where':{'id':_0x3ae202[_0x019b('0x48')]['id']}})['then'](handleEntityNotFound(_0x429fb7,null))[_0x019b('0x27')](saveUpdates(_0x3ae202['body'],null))[_0x019b('0x27')](respondWithResult(_0x429fb7,null))[_0x019b('0x46')](handleError(_0x429fb7,null));};exports[_0x019b('0x28')]=function(_0x4d8df0,_0x247f94){return db['FreshsalesAccount']['find']({'where':{'id':_0x4d8df0[_0x019b('0x48')]['id']}})[_0x019b('0x27')](handleEntityNotFound(_0x247f94,null))[_0x019b('0x27')](removeEntity(_0x247f94,null))[_0x019b('0x46')](handleError(_0x247f94,null));};exports['getConfigurations']=function(_0x1d25d3,_0x38f887,_0x13bd41){var _0xc9ad92={};var _0x372252={};var _0x2f0baf;var _0x25d33a;return db[_0x019b('0x2f')][_0x019b('0x4d')]({'where':{'id':_0x1d25d3[_0x019b('0x48')]['id']}})[_0x019b('0x27')](handleEntityNotFound(_0x38f887,null))[_0x019b('0x27')](function(_0x2ba8bb){if(_0x2ba8bb){_0x2f0baf=_0x2ba8bb;_0x372252[_0x019b('0x34')]=_[_0x019b('0x36')](db['FreshsalesConfiguration']['rawAttributes']);_0x372252[_0x019b('0x35')]=_['keys'](_0x1d25d3['query']);_0x372252[_0x019b('0x3e')]=_[_0x019b('0x37')](_0x372252[_0x019b('0x34')],_0x372252['query']);_0xc9ad92['attributes']=_[_0x019b('0x37')](_0x372252[_0x019b('0x34')],qs[_0x019b('0x39')](_0x1d25d3[_0x019b('0x35')][_0x019b('0x39')]));_0xc9ad92['attributes']=_0xc9ad92[_0x019b('0x38')][_0x019b('0x49')]?_0xc9ad92[_0x019b('0x38')]:_0x372252[_0x019b('0x34')];_0xc9ad92['order']=qs[_0x019b('0x3c')](_0x1d25d3['query'][_0x019b('0x3c')]);_0xc9ad92[_0x019b('0x3d')]=qs[_0x019b('0x3e')](_[_0x019b('0x3f')](_0x1d25d3[_0x019b('0x35')],_0x372252[_0x019b('0x3e')]));if(_0x1d25d3['query'][_0x019b('0x40')]){_0xc9ad92['where']=_[_0x019b('0x41')](_0xc9ad92[_0x019b('0x3d')],{'$or':_[_0x019b('0x2e')](_0xc9ad92[_0x019b('0x38')],function(_0x4a1594){var _0xd7fbb={};_0xd7fbb[_0x4a1594]={'$like':'%'+_0x1d25d3[_0x019b('0x35')]['filter']+'%'};return _0xd7fbb;})});}_0xc9ad92=_[_0x019b('0x41')]({},_0xc9ad92,_0x1d25d3[_0x019b('0x42')]);return _0x2f0baf[_0x019b('0x4e')](_0xc9ad92);}})[_0x019b('0x27')](function(_0x13e747){if(_0x13e747){_0x25d33a=_0x13e747[_0x019b('0x49')];if(!_0x1d25d3[_0x019b('0x35')][_0x019b('0x3a')](_0x019b('0x3b'))){_0xc9ad92[_0x019b('0x20')]=qs[_0x019b('0x20')](_0x1d25d3[_0x019b('0x35')][_0x019b('0x20')]);_0xc9ad92[_0x019b('0x1f')]=qs[_0x019b('0x1f')](_0x1d25d3[_0x019b('0x35')][_0x019b('0x1f')]);}return _0x2f0baf[_0x019b('0x4e')](_0xc9ad92);}})['then'](function(_0x26f1fa){if(_0x26f1fa){return _0x26f1fa?{'count':_0x25d33a,'rows':_0x26f1fa}:null;}})[_0x019b('0x27')](respondWithResult(_0x38f887,null))[_0x019b('0x46')](handleError(_0x38f887,null));};exports['addConfiguration']=function(_0x44a449,_0xc1fc6b,_0xbfc85d){if(_0x44a449[_0x019b('0x4c')]['id']){delete _0x44a449[_0x019b('0x4c')]['id'];}return db[_0x019b('0x2f')][_0x019b('0x4d')]({'where':{'id':_0x44a449[_0x019b('0x48')]['id']}})[_0x019b('0x27')](handleEntityNotFound(_0xc1fc6b,null))[_0x019b('0x27')](function(_0x5327f3){if(_0x5327f3){_0x44a449[_0x019b('0x4c')][_0x019b('0x4f')]=_0x5327f3['id'];_0x44a449[_0x019b('0x4c')]['Subjects']=integrations['getSubjects'](_0x44a449[_0x019b('0x4c')][_0x019b('0x50')],_0x44a449['body'][_0x019b('0x32')]);_0x44a449[_0x019b('0x4c')][_0x019b('0x51')]=integrations[_0x019b('0x52')](_0x44a449[_0x019b('0x4c')][_0x019b('0x50')],_0x44a449[_0x019b('0x4c')]['type']);return db[_0x019b('0x53')][_0x019b('0x4b')](_0x44a449[_0x019b('0x4c')],{'include':[{'model':db[_0x019b('0x54')],'as':_0x019b('0x55')},{'model':db[_0x019b('0x54')],'as':'Descriptions'}]});}return null;})[_0x019b('0x27')](respondWithResult(_0xc1fc6b,null))[_0x019b('0x46')](handleError(_0xc1fc6b,null));};exports[_0x019b('0x56')]=function(_0x36ea7f,_0x121a8a,_0x260e33){var _0x143dee='';var _0x393695='';return db[_0x019b('0x2f')][_0x019b('0x4d')]({'where':{'id':_0x36ea7f[_0x019b('0x48')]['id']},'attributes':['id',_0x019b('0x57'),'remoteUri',_0x019b('0x58')]})['then'](handleEntityNotFound(_0x121a8a,null))[_0x019b('0x27')](function(_0x1abd31){if(_0x1abd31){_0x393695=_0x1abd31[_0x019b('0x57')];_0x143dee=_0x1abd31[_0x019b('0x59')];var _0x36a516=_0x1abd31[_0x019b('0x59')][_0x019b('0x5a')](-0x1);if(_0x36a516==='/'){_0x143dee=_0x143dee[_0x019b('0x5b')](0x0,_0x143dee[_0x019b('0x5c')](_0x36a516));}return rp({'method':_0x019b('0x5d'),'uri':util['format'](_0x019b('0x5e'),_0x143dee,_0x019b('0x5f')),'headers':{'Authorization':_0x019b('0x60')+_0x1abd31[_0x019b('0x58')]},'json':!![]});}})['then'](function(_0x5862fb){if(_0x5862fb){var _0x153adc=_0x5862fb['users'];var _0x4be09a=![];var _0xa8a739=null;for(_0xa8a739=0x0;_0xa8a739<_0x153adc[_0x019b('0x49')];_0xa8a739++){if(_0x153adc[_0xa8a739][_0x019b('0x61')]===_0x393695){_0x4be09a=!![];}}if(_0x4be09a){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x019b('0x62')});}}})[_0x019b('0x27')](respondWithResult(_0x121a8a,null))[_0x019b('0x46')](function(_0x331638){var _0x28166f=_0x36ea7f[_0x019b('0x35')][_0x019b('0x63')]?0x1f4:_0x331638[_0x019b('0x64')]||0x1f4;logger['error'](_0x019b('0x65'),_0x019b('0x56'),_0x28166f,JSON[_0x019b('0x66')](_0x331638));delete _0x331638[_0x019b('0x2b')];if(_0x28166f===0x191){_0x28166f=0x190;}_0x121a8a[_0x019b('0x1e')](_0x28166f)[_0x019b('0x2c')](_0x36ea7f[_0x019b('0x35')][_0x019b('0x63')]?{'message':_0x019b('0x67'),'statusCode':_0x331638[_0x019b('0x64')]}:_0x331638);});}; \ No newline at end of file +var _0xd038=['map','FreshsalesAccount','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','hasOwnProperty','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','substring','GET','format','Token\x20token=','email','statusCode','stringify','test','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','reject','save','update','destroy','then','error','stack','name','send','index'];(function(_0x1b8f6f,_0x3dacc0){var _0x15410d=function(_0x1071d1){while(--_0x1071d1){_0x1b8f6f['push'](_0x1b8f6f['shift']());}};_0x15410d(++_0x3dacc0);}(_0xd038,0x151));var _0x8d03=function(_0x9c8b4a,_0x2387ff){_0x9c8b4a=_0x9c8b4a-0x0;var _0x198bef=_0xd038[_0x9c8b4a];return _0x198bef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8d03('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8d03('0x1'));var moment=require(_0x8d03('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8d03('0x3'));var util=require(_0x8d03('0x4'));var path=require(_0x8d03('0x5'));var sox=require(_0x8d03('0x6'));var csv=require(_0x8d03('0x7'));var ejs=require(_0x8d03('0x8'));var fs=require('fs');var fs_extra=require(_0x8d03('0x9'));var _=require('lodash');var squel=require(_0x8d03('0xa'));var crypto=require(_0x8d03('0xb'));var jsforce=require(_0x8d03('0xc'));var deskjs=require(_0x8d03('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8d03('0xe'));var hardwareService=require(_0x8d03('0xf'));var logger=require(_0x8d03('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x8d03('0x11'));var licenseUtil=require(_0x8d03('0x12'));var db=require(_0x8d03('0x13'))['db'];var integrations=require(_0x8d03('0x14'));function respondWithStatusCode(_0x3e72b5,_0x152944){_0x152944=_0x152944||0xcc;return function(_0x2ccbe5){if(_0x2ccbe5){return _0x3e72b5[_0x8d03('0x15')](_0x152944);}return _0x3e72b5['status'](_0x152944)[_0x8d03('0x16')]();};}function respondWithResult(_0x17ae7e,_0x269409){_0x269409=_0x269409||0xc8;return function(_0x4bcdbe){if(_0x4bcdbe){return _0x17ae7e[_0x8d03('0x17')](_0x269409)[_0x8d03('0x18')](_0x4bcdbe);}};}function respondWithFilteredResult(_0xa4be9a,_0x5d6d61){return function(_0x5048e6){if(_0x5048e6){var _0x3370d4=typeof _0x5d6d61['offset']===_0x8d03('0x19')&&typeof _0x5d6d61[_0x8d03('0x1a')]===_0x8d03('0x19');var _0x38c116=_0x5048e6[_0x8d03('0x1b')];var _0x5eae34=_0x3370d4?0x0:_0x5d6d61[_0x8d03('0x1c')];var _0x4d8867=_0x3370d4?_0x5048e6[_0x8d03('0x1b')]:_0x5d6d61[_0x8d03('0x1c')]+_0x5d6d61[_0x8d03('0x1a')];var _0x3e5f5e;if(_0x4d8867>=_0x38c116){_0x4d8867=_0x38c116;_0x3e5f5e=0xc8;}else{_0x3e5f5e=0xce;}_0xa4be9a[_0x8d03('0x17')](_0x3e5f5e);return _0xa4be9a['set']('Content-Range',_0x5eae34+'-'+_0x4d8867+'/'+_0x38c116)['json'](_0x5048e6);}return null;};}function patchUpdates(_0x545fea){return function(_0x34376e){try{jsonpatch['apply'](_0x34376e,_0x545fea,!![]);}catch(_0x464f7c){return BPromise[_0x8d03('0x1d')](_0x464f7c);}return _0x34376e[_0x8d03('0x1e')]();};}function saveUpdates(_0x1182ed,_0x40174a){return function(_0x41055f){if(_0x41055f){return _0x41055f[_0x8d03('0x1f')](_0x1182ed)['then'](function(_0x47621e){return _0x47621e;});}return null;};}function removeEntity(_0x459f3c,_0x2752c8){return function(_0x17c23b){if(_0x17c23b){return _0x17c23b[_0x8d03('0x20')]()[_0x8d03('0x21')](function(){_0x459f3c[_0x8d03('0x17')](0xcc)[_0x8d03('0x16')]();});}};}function handleEntityNotFound(_0x3686e5,_0x551402){return function(_0x457d89){if(!_0x457d89){_0x3686e5['sendStatus'](0x194);}return _0x457d89;};}function handleError(_0x1e5a6e,_0x311ef5){_0x311ef5=_0x311ef5||0x1f4;return function(_0x56623b){logger[_0x8d03('0x22')](_0x56623b[_0x8d03('0x23')]);if(_0x56623b[_0x8d03('0x24')]){delete _0x56623b[_0x8d03('0x24')];}_0x1e5a6e[_0x8d03('0x17')](_0x311ef5)[_0x8d03('0x25')](_0x56623b);};}exports[_0x8d03('0x26')]=function(_0x2da423,_0x397e3b){var _0x12a3f9={},_0x241100={},_0x11bcb9={'count':0x0,'rows':[]};var _0x116eaa=_[_0x8d03('0x27')](db[_0x8d03('0x28')]['rawAttributes'],function(_0x56767f){return{'name':_0x56767f[_0x8d03('0x29')],'type':_0x56767f[_0x8d03('0x2a')]['key']};});_0x241100[_0x8d03('0x2b')]=_['map'](_0x116eaa,_0x8d03('0x24'));_0x241100[_0x8d03('0x2c')]=_[_0x8d03('0x2d')](_0x2da423[_0x8d03('0x2c')]);_0x241100['filters']=_[_0x8d03('0x2e')](_0x241100[_0x8d03('0x2b')],_0x241100[_0x8d03('0x2c')]);_0x12a3f9[_0x8d03('0x2f')]=_[_0x8d03('0x2e')](_0x241100['model'],qs[_0x8d03('0x30')](_0x2da423['query'][_0x8d03('0x30')]));_0x12a3f9['attributes']=_0x12a3f9[_0x8d03('0x2f')][_0x8d03('0x31')]?_0x12a3f9[_0x8d03('0x2f')]:_0x241100['model'];if(!_0x2da423['query']['hasOwnProperty'](_0x8d03('0x32'))){_0x12a3f9[_0x8d03('0x1a')]=qs['limit'](_0x2da423[_0x8d03('0x2c')]['limit']);_0x12a3f9[_0x8d03('0x1c')]=qs[_0x8d03('0x1c')](_0x2da423['query'][_0x8d03('0x1c')]);}_0x12a3f9[_0x8d03('0x33')]=qs[_0x8d03('0x34')](_0x2da423[_0x8d03('0x2c')]['sort']);_0x12a3f9[_0x8d03('0x35')]=qs[_0x8d03('0x36')](_[_0x8d03('0x37')](_0x2da423['query'],_0x241100['filters']),_0x116eaa);if(_0x2da423[_0x8d03('0x2c')][_0x8d03('0x38')]){_0x12a3f9[_0x8d03('0x35')]=_[_0x8d03('0x39')](_0x12a3f9[_0x8d03('0x35')],{'$or':_[_0x8d03('0x27')](_0x116eaa,function(_0x12bed3){if(_0x12bed3[_0x8d03('0x2a')]!==_0x8d03('0x3a')){var _0x8fa717={};_0x8fa717[_0x12bed3[_0x8d03('0x24')]]={'$like':'%'+_0x2da423[_0x8d03('0x2c')]['filter']+'%'};return _0x8fa717;}})});}_0x12a3f9=_[_0x8d03('0x39')]({},_0x12a3f9,_0x2da423[_0x8d03('0x3b')]);var _0x109cd4={'where':_0x12a3f9[_0x8d03('0x35')]};return db[_0x8d03('0x28')][_0x8d03('0x1b')](_0x109cd4)[_0x8d03('0x21')](function(_0x52273d){_0x11bcb9[_0x8d03('0x1b')]=_0x52273d;if(_0x2da423[_0x8d03('0x2c')][_0x8d03('0x3c')]){_0x12a3f9['include']=[{'all':!![]}];}return db[_0x8d03('0x28')][_0x8d03('0x3d')](_0x12a3f9);})[_0x8d03('0x21')](function(_0xea3685){_0x11bcb9['rows']=_0xea3685;return _0x11bcb9;})[_0x8d03('0x21')](respondWithFilteredResult(_0x397e3b,_0x12a3f9))[_0x8d03('0x3e')](handleError(_0x397e3b,null));};exports[_0x8d03('0x3f')]=function(_0x25c399,_0x262eba){var _0x4725aa={'raw':![],'where':{'id':_0x25c399[_0x8d03('0x40')]['id']}},_0x179437={};_0x179437[_0x8d03('0x2b')]=_['keys'](db[_0x8d03('0x28')][_0x8d03('0x41')]);_0x179437[_0x8d03('0x2c')]=_[_0x8d03('0x2d')](_0x25c399[_0x8d03('0x2c')]);_0x179437[_0x8d03('0x36')]=_[_0x8d03('0x2e')](_0x179437[_0x8d03('0x2b')],_0x179437['query']);_0x4725aa[_0x8d03('0x2f')]=_[_0x8d03('0x2e')](_0x179437[_0x8d03('0x2b')],qs['fields'](_0x25c399[_0x8d03('0x2c')][_0x8d03('0x30')]));_0x4725aa[_0x8d03('0x2f')]=_0x4725aa[_0x8d03('0x2f')][_0x8d03('0x31')]?_0x4725aa['attributes']:_0x179437[_0x8d03('0x2b')];if(_0x25c399[_0x8d03('0x2c')][_0x8d03('0x3c')]){_0x4725aa[_0x8d03('0x42')]=[{'all':!![]}];}_0x4725aa=_['merge']({},_0x4725aa,_0x25c399['options']);return db[_0x8d03('0x28')][_0x8d03('0x43')](_0x4725aa)[_0x8d03('0x21')](handleEntityNotFound(_0x262eba,null))[_0x8d03('0x21')](respondWithResult(_0x262eba,null))[_0x8d03('0x3e')](handleError(_0x262eba,null));};exports[_0x8d03('0x44')]=function(_0x495ddb,_0x5049e7){return db[_0x8d03('0x28')][_0x8d03('0x44')](_0x495ddb['body'],{})['then'](respondWithResult(_0x5049e7,0xc9))['catch'](handleError(_0x5049e7,null));};exports[_0x8d03('0x1f')]=function(_0x4b0cf9,_0x451946){if(_0x4b0cf9['body']['id']){delete _0x4b0cf9[_0x8d03('0x45')]['id'];}return db['FreshsalesAccount'][_0x8d03('0x43')]({'where':{'id':_0x4b0cf9[_0x8d03('0x40')]['id']}})[_0x8d03('0x21')](handleEntityNotFound(_0x451946,null))[_0x8d03('0x21')](saveUpdates(_0x4b0cf9[_0x8d03('0x45')],null))[_0x8d03('0x21')](respondWithResult(_0x451946,null))['catch'](handleError(_0x451946,null));};exports[_0x8d03('0x20')]=function(_0x565a4f,_0x161a46){return db[_0x8d03('0x28')][_0x8d03('0x43')]({'where':{'id':_0x565a4f[_0x8d03('0x40')]['id']}})[_0x8d03('0x21')](handleEntityNotFound(_0x161a46,null))[_0x8d03('0x21')](removeEntity(_0x161a46,null))['catch'](handleError(_0x161a46,null));};exports[_0x8d03('0x46')]=function(_0x3f53c3,_0x138b10,_0x568196){var _0x2cd268={};var _0x16d033={};var _0x4ab28e;var _0x19bb0f;return db['FreshsalesAccount'][_0x8d03('0x47')]({'where':{'id':_0x3f53c3[_0x8d03('0x40')]['id']}})[_0x8d03('0x21')](handleEntityNotFound(_0x138b10,null))[_0x8d03('0x21')](function(_0x1852e7){if(_0x1852e7){_0x4ab28e=_0x1852e7;_0x16d033[_0x8d03('0x2b')]=_['keys'](db[_0x8d03('0x48')][_0x8d03('0x41')]);_0x16d033[_0x8d03('0x2c')]=_[_0x8d03('0x2d')](_0x3f53c3[_0x8d03('0x2c')]);_0x16d033['filters']=_[_0x8d03('0x2e')](_0x16d033['model'],_0x16d033['query']);_0x2cd268['attributes']=_[_0x8d03('0x2e')](_0x16d033[_0x8d03('0x2b')],qs[_0x8d03('0x30')](_0x3f53c3[_0x8d03('0x2c')]['fields']));_0x2cd268[_0x8d03('0x2f')]=_0x2cd268[_0x8d03('0x2f')][_0x8d03('0x31')]?_0x2cd268[_0x8d03('0x2f')]:_0x16d033[_0x8d03('0x2b')];_0x2cd268[_0x8d03('0x33')]=qs[_0x8d03('0x34')](_0x3f53c3['query']['sort']);_0x2cd268['where']=qs[_0x8d03('0x36')](_['pick'](_0x3f53c3[_0x8d03('0x2c')],_0x16d033[_0x8d03('0x36')]));if(_0x3f53c3[_0x8d03('0x2c')][_0x8d03('0x38')]){_0x2cd268[_0x8d03('0x35')]=_[_0x8d03('0x39')](_0x2cd268[_0x8d03('0x35')],{'$or':_[_0x8d03('0x27')](_0x2cd268[_0x8d03('0x2f')],function(_0x2ea402){var _0x2046a0={};_0x2046a0[_0x2ea402]={'$like':'%'+_0x3f53c3[_0x8d03('0x2c')]['filter']+'%'};return _0x2046a0;})});}_0x2cd268=_[_0x8d03('0x39')]({},_0x2cd268,_0x3f53c3[_0x8d03('0x3b')]);return _0x4ab28e[_0x8d03('0x46')](_0x2cd268);}})[_0x8d03('0x21')](function(_0x38ba2c){if(_0x38ba2c){_0x19bb0f=_0x38ba2c[_0x8d03('0x31')];if(!_0x3f53c3['query'][_0x8d03('0x49')](_0x8d03('0x32'))){_0x2cd268[_0x8d03('0x1a')]=qs['limit'](_0x3f53c3[_0x8d03('0x2c')][_0x8d03('0x1a')]);_0x2cd268[_0x8d03('0x1c')]=qs['offset'](_0x3f53c3['query'][_0x8d03('0x1c')]);}return _0x4ab28e[_0x8d03('0x46')](_0x2cd268);}})[_0x8d03('0x21')](function(_0x5f474){if(_0x5f474){return _0x5f474?{'count':_0x19bb0f,'rows':_0x5f474}:null;}})[_0x8d03('0x21')](respondWithResult(_0x138b10,null))[_0x8d03('0x3e')](handleError(_0x138b10,null));};exports['addConfiguration']=function(_0x18ce64,_0x57ac19,_0x539907){if(_0x18ce64[_0x8d03('0x45')]['id']){delete _0x18ce64['body']['id'];}return db[_0x8d03('0x28')][_0x8d03('0x47')]({'where':{'id':_0x18ce64[_0x8d03('0x40')]['id']}})['then'](handleEntityNotFound(_0x57ac19,null))['then'](function(_0x4ff877){if(_0x4ff877){_0x18ce64[_0x8d03('0x45')][_0x8d03('0x4a')]=_0x4ff877['id'];_0x18ce64['body']['Subjects']=integrations[_0x8d03('0x4b')](_0x18ce64[_0x8d03('0x45')][_0x8d03('0x4c')],_0x18ce64[_0x8d03('0x45')]['type']);_0x18ce64[_0x8d03('0x45')][_0x8d03('0x4d')]=integrations[_0x8d03('0x4e')](_0x18ce64[_0x8d03('0x45')][_0x8d03('0x4c')],_0x18ce64[_0x8d03('0x45')][_0x8d03('0x2a')]);return db[_0x8d03('0x48')]['create'](_0x18ce64[_0x8d03('0x45')],{'include':[{'model':db[_0x8d03('0x4f')],'as':_0x8d03('0x50')},{'model':db['FreshsalesField'],'as':_0x8d03('0x4d')}]});}return null;})[_0x8d03('0x21')](respondWithResult(_0x57ac19,null))[_0x8d03('0x3e')](handleError(_0x57ac19,null));};exports[_0x8d03('0x51')]=function(_0x4ae66a,_0x115a91,_0x2f2e38){var _0x30b713='';var _0x2e8b50='';return db[_0x8d03('0x28')][_0x8d03('0x47')]({'where':{'id':_0x4ae66a[_0x8d03('0x40')]['id']},'attributes':['id',_0x8d03('0x52'),_0x8d03('0x53'),_0x8d03('0x54')]})[_0x8d03('0x21')](handleEntityNotFound(_0x115a91,null))[_0x8d03('0x21')](function(_0x269068){if(_0x269068){_0x2e8b50=_0x269068[_0x8d03('0x52')];_0x30b713=_0x269068[_0x8d03('0x53')];var _0x23edac=_0x269068['remoteUri'][_0x8d03('0x55')](-0x1);if(_0x23edac==='/'){_0x30b713=_0x30b713[_0x8d03('0x56')](0x0,_0x30b713['lastIndexOf'](_0x23edac));}return rp({'method':_0x8d03('0x57'),'uri':util[_0x8d03('0x58')]('%s%s',_0x30b713,'/api/selector/owners'),'headers':{'Authorization':_0x8d03('0x59')+_0x269068['apiKey']},'json':!![]});}})[_0x8d03('0x21')](function(_0xd96162){if(_0xd96162){var _0x17b304=_0xd96162['users'];var _0x43b158=![];var _0x5e448b=null;for(_0x5e448b=0x0;_0x5e448b<_0x17b304[_0x8d03('0x31')];_0x5e448b++){if(_0x17b304[_0x5e448b][_0x8d03('0x5a')]===_0x2e8b50){_0x43b158=!![];}}if(_0x43b158){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x8d03('0x21')](respondWithResult(_0x115a91,null))[_0x8d03('0x3e')](function(_0x46c6e4){var _0x3941d6=_0x4ae66a[_0x8d03('0x2c')]['test']?0x1f4:_0x46c6e4[_0x8d03('0x5b')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x8d03('0x51'),_0x3941d6,JSON[_0x8d03('0x5c')](_0x46c6e4));delete _0x46c6e4['name'];if(_0x3941d6===0x191){_0x3941d6=0x190;}_0x115a91[_0x8d03('0x17')](_0x3941d6)[_0x8d03('0x25')](_0x4ae66a[_0x8d03('0x2c')][_0x8d03('0x5d')]?{'message':'Wrong\x20credentials','statusCode':_0x46c6e4[_0x8d03('0x5b')]}:_0x46c6e4);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 97da018..f6c8351 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 _0x2272=['request-promise','path','rimraf','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x4431c3,_0x32b598){var _0x5f1caf=function(_0x4fd6eb){while(--_0x4fd6eb){_0x4431c3['push'](_0x4431c3['shift']());}};_0x5f1caf(++_0x32b598);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var logger=require(_0x2227('0x2'))(_0x2227('0x3'));var moment=require(_0x2227('0x4'));var BPromise=require('bluebird');var rp=require(_0x2227('0x5'));var fs=require('fs');var path=require(_0x2227('0x6'));var rimraf=require(_0x2227('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x2227('0x8'));module[_0x2227('0x9')]=function(_0xb33647,_0x2591db){return _0xb33647[_0x2227('0xa')](_0x2227('0xb'),attributes,{'tableName':_0x2227('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a37=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','FreshsalesAccount','lodash','util'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x1a37,0xb4));var _0x71a3=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x1a37[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var logger=require(_0x71a3('0x2'))(_0x71a3('0x3'));var moment=require(_0x71a3('0x4'));var BPromise=require(_0x71a3('0x5'));var rp=require(_0x71a3('0x6'));var fs=require('fs');var path=require(_0x71a3('0x7'));var rimraf=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x71a3('0xa'));module['exports']=function(_0xd09f7,_0x45050a){return _0xd09f7[_0x71a3('0xb')](_0x71a3('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index f747b84..be3b122 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 _0xafb9=['ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','limit','map','attributes','include','model','debug'];(function(_0x50c389,_0x5f5cc7){var _0x59de09=function(_0x58ef92){while(--_0x58ef92){_0x50c389['push'](_0x50c389['shift']());}};_0x59de09(++_0x5f5cc7);}(_0xafb9,0x68));var _0x9afb=function(_0x509da5,_0x50bafe){_0x509da5=_0x509da5-0x0;var _0x468a7d=_0xafb9[_0x509da5];return _0x468a7d;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548b24,_0x556880,_0x4c0e9d){return new BPromise(function(_0x1edf77,_0x20b8c1){return client['request'](_0x548b24,_0x4c0e9d)[_0x9afb('0xb')](function(_0x3e0264){logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x556880,_0x9afb('0xe'),JSON[_0x9afb('0xf')](_0x3e0264));if(_0x3e0264[_0x9afb('0x10')]){if(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x11')]===0x1f4){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);return _0x20b8c1(_0x3e0264[_0x9afb('0x10')]['message']);}logger[_0x9afb('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x556880,_0x3e0264['error'][_0x9afb('0x12')]);return _0x1edf77(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);}else{logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));_0x1edf77(_0x3e0264[_0x9afb('0x13')]['message']);}})[_0x9afb('0x14')](function(_0x2145c2){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x2145c2);_0x20b8c1(_0x2145c2);});});}exports[_0x9afb('0x15')]=function(_0x508433){var _0x201ff4=this;return new Promise(function(_0x50a7e4,_0x3fdb34){return db[_0x9afb('0x16')]['findAll']({'raw':_0x508433['options']?_0x508433[_0x9afb('0x17')][_0x9afb('0x18')]===undefined?!![]:![]:!![],'where':_0x508433[_0x9afb('0x17')]?_0x508433[_0x9afb('0x17')][_0x9afb('0x19')]||null:null,'attributes':_0x508433['options']?_0x508433[_0x9afb('0x17')]['attributes']||null:null,'limit':_0x508433['options']?_0x508433[_0x9afb('0x17')][_0x9afb('0x1a')]||null:null,'include':_0x508433[_0x9afb('0x17')]?_0x508433[_0x9afb('0x17')]['include']?_[_0x9afb('0x1b')](_0x508433[_0x9afb('0x17')]['include'],function(_0x571bd9){return{'model':db[_0x571bd9['model']],'as':_0x571bd9['as'],'attributes':_0x571bd9[_0x9afb('0x1c')],'include':_0x571bd9['include']?_[_0x9afb('0x1b')](_0x571bd9[_0x9afb('0x1d')],function(_0x50a919){return{'model':db[_0x50a919[_0x9afb('0x1e')]],'as':_0x50a919['as'],'attributes':_0x50a919[_0x9afb('0x1c')],'include':_0x50a919[_0x9afb('0x1d')]?_[_0x9afb('0x1b')](_0x50a919['include'],function(_0x348255){return{'model':db[_0x348255['model']],'as':_0x348255['as'],'attributes':_0x348255[_0x9afb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5692fa){logger[_0x9afb('0xc')](_0x9afb('0x15'),_0x508433);logger[_0x9afb('0x1f')](_0x9afb('0x15'),_0x508433,JSON[_0x9afb('0xf')](_0x5692fa));_0x50a7e4(_0x5692fa);})[_0x9afb('0x14')](function(_0x46673d){logger['error']('GetFreshsalesAccount',_0x46673d[_0x9afb('0x12')],_0x508433);_0x3fdb34(_0x201ff4[_0x9afb('0x10')](0x1f4,_0x46673d['message']));});});};exports[_0x9afb('0x20')]=function(_0x2f388c){var _0x5560bd=this;return new Promise(function(_0x1b9f18,_0xc220e9){return db[_0x9afb('0x16')][_0x9afb('0x21')]({'raw':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x18')]===undefined?!![]:![]:!![],'where':_0x2f388c[_0x9afb('0x17')]?_0x2f388c['options']['where']||null:null,'attributes':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x1c')]||null:null,'include':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x1d')]?_[_0x9afb('0x1b')](_0x2f388c['options']['include'],function(_0x67d63a){return{'model':db[_0x67d63a[_0x9afb('0x1e')]],'as':_0x67d63a['as'],'attributes':_0x67d63a['attributes'],'include':_0x67d63a[_0x9afb('0x1d')]?_['map'](_0x67d63a[_0x9afb('0x1d')],function(_0xc59d55){return{'model':db[_0xc59d55['model']],'as':_0xc59d55['as'],'attributes':_0xc59d55[_0x9afb('0x1c')],'include':_0xc59d55['include']?_[_0x9afb('0x1b')](_0xc59d55[_0x9afb('0x1d')],function(_0x45c57f){return{'model':db[_0x45c57f[_0x9afb('0x1e')]],'as':_0x45c57f['as'],'attributes':_0x45c57f[_0x9afb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9afb('0xb')](function(_0x19227f){logger[_0x9afb('0xc')]('ShowFreshsalesAccount',_0x2f388c);logger[_0x9afb('0x1f')]('ShowFreshsalesAccount',_0x2f388c,JSON[_0x9afb('0xf')](_0x19227f));_0x1b9f18(_0x19227f);})[_0x9afb('0x14')](function(_0x3c5231){logger[_0x9afb('0x10')](_0x9afb('0x20'),_0x3c5231[_0x9afb('0x12')],_0x2f388c);_0xc220e9(_0x5560bd[_0x9afb('0x10')](0x1f4,_0x3c5231[_0x9afb('0x12')]));});});}; \ No newline at end of file +var _0x0598=['map','model','then','ShowFreshsalesAccount','find','where','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','limit','include'];(function(_0x574632,_0x3a9b4d){var _0x1c4b34=function(_0x33fecc){while(--_0x33fecc){_0x574632['push'](_0x574632['shift']());}};_0x1c4b34(++_0x3a9b4d);}(_0x0598,0x92));var _0x8059=function(_0x5a3658,_0x5d7a85){_0x5a3658=_0x5a3658-0x0;var _0x1498b8=_0x0598[_0x5a3658];return _0x1498b8;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}exports[_0x8059('0xf')]=function(_0x4b6d55){var _0x10ad98=this;return new Promise(function(_0x2bb670,_0x37e926){return db[_0x8059('0x10')]['findAll']({'raw':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x4b6d55['options']?_0x4b6d55[_0x8059('0x11')]['where']||null:null,'attributes':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x13')]||null:null,'limit':_0x4b6d55['options']?_0x4b6d55['options'][_0x8059('0x14')]||null:null,'include':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')]?_['map'](_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')],function(_0x3da080){return{'model':db[_0x3da080['model']],'as':_0x3da080['as'],'attributes':_0x3da080[_0x8059('0x13')],'include':_0x3da080[_0x8059('0x15')]?_[_0x8059('0x16')](_0x3da080[_0x8059('0x15')],function(_0x59d3a6){return{'model':db[_0x59d3a6[_0x8059('0x17')]],'as':_0x59d3a6['as'],'attributes':_0x59d3a6[_0x8059('0x13')],'include':_0x59d3a6[_0x8059('0x15')]?_[_0x8059('0x16')](_0x59d3a6[_0x8059('0x15')],function(_0x54b88b){return{'model':db[_0x54b88b[_0x8059('0x17')]],'as':_0x54b88b['as'],'attributes':_0x54b88b[_0x8059('0x13')]};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x4a294f){logger['info']('GetFreshsalesAccount',_0x4b6d55);logger[_0x8059('0xa')](_0x8059('0xf'),_0x4b6d55,JSON[_0x8059('0xb')](_0x4a294f));_0x2bb670(_0x4a294f);})[_0x8059('0xe')](function(_0x59abe9){logger[_0x8059('0xc')]('GetFreshsalesAccount',_0x59abe9[_0x8059('0xd')],_0x4b6d55);_0x37e926(_0x10ad98[_0x8059('0xc')](0x1f4,_0x59abe9['message']));});});};exports[_0x8059('0x19')]=function(_0x1aead2){var _0x30aac2=this;return new Promise(function(_0x260ba8,_0x2799b7){return db[_0x8059('0x10')][_0x8059('0x1a')]({'raw':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x1b')]||null:null,'attributes':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x13')]||null:null,'include':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x15')]?_[_0x8059('0x16')](_0x1aead2[_0x8059('0x11')][_0x8059('0x15')],function(_0x175d57){return{'model':db[_0x175d57[_0x8059('0x17')]],'as':_0x175d57['as'],'attributes':_0x175d57[_0x8059('0x13')],'include':_0x175d57['include']?_[_0x8059('0x16')](_0x175d57['include'],function(_0x24194d){return{'model':db[_0x24194d['model']],'as':_0x24194d['as'],'attributes':_0x24194d['attributes'],'include':_0x24194d[_0x8059('0x15')]?_['map'](_0x24194d[_0x8059('0x15')],function(_0x50c745){return{'model':db[_0x50c745[_0x8059('0x17')]],'as':_0x50c745['as'],'attributes':_0x50c745['attributes']};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x5c4aa0){logger['info'](_0x8059('0x19'),_0x1aead2);logger[_0x8059('0xa')](_0x8059('0x19'),_0x1aead2,JSON['stringify'](_0x5c4aa0));_0x260ba8(_0x5c4aa0);})[_0x8059('0xe')](function(_0x4927c9){logger[_0x8059('0xc')]('ShowFreshsalesAccount',_0x4927c9[_0x8059('0xd')],_0x1aead2);_0x2799b7(_0x30aac2[_0x8059('0xc')](0x1f4,_0x4927c9[_0x8059('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index e730c8d..a2c50d4 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 _0xc92f=['../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x72c396,_0x110635){var _0x19e821=function(_0x55b439){while(--_0x55b439){_0x72c396['push'](_0x72c396['shift']());}};_0x19e821(++_0x110635);}(_0xc92f,0x1d4));var _0xfc92=function(_0x4e01ef,_0x575f94){_0x4e01ef=_0x4e01ef-0x0;var _0x56ae50=_0xc92f[_0x4e01ef];return _0x56ae50;};'use strict';var multer=require(_0xfc92('0x0'));var util=require(_0xfc92('0x1'));var path=require(_0xfc92('0x2'));var timeout=require(_0xfc92('0x3'));var express=require(_0xfc92('0x4'));var router=express[_0xfc92('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfc92('0x6'));var config=require(_0xfc92('0x7'));var controller=require(_0xfc92('0x8'));router[_0xfc92('0x9')]('/',auth[_0xfc92('0xa')](),controller[_0xfc92('0xb')]);router[_0xfc92('0x9')](_0xfc92('0xc'),auth['isAuthenticated'](),controller[_0xfc92('0xd')]);router['get'](_0xfc92('0xe'),auth[_0xfc92('0xa')](),controller[_0xfc92('0xf')]);router['get'](_0xfc92('0x10'),auth[_0xfc92('0xa')](),controller[_0xfc92('0x11')]);router['get'](_0xfc92('0x12'),auth[_0xfc92('0xa')](),controller[_0xfc92('0x13')]);router[_0xfc92('0x14')]('/',auth[_0xfc92('0xa')](),controller['create']);router['put'](_0xfc92('0xc'),auth[_0xfc92('0xa')](),controller[_0xfc92('0x15')]);router[_0xfc92('0x16')](_0xfc92('0xc'),auth['isAuthenticated'](),controller[_0xfc92('0x17')]);module[_0xfc92('0x18')]=router; \ No newline at end of file +var _0x92ff=['create','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','show','getSubjects','/:id/descriptions','/:id/fields','getFields','post'];(function(_0x124142,_0x1723a6){var _0x175d8d=function(_0x33acc2){while(--_0x33acc2){_0x124142['push'](_0x124142['shift']());}};_0x175d8d(++_0x1723a6);}(_0x92ff,0x9f));var _0xf92f=function(_0x51926c,_0x4c7ffe){_0x51926c=_0x51926c-0x0;var _0x2034ca=_0x92ff[_0x51926c];return _0x2034ca;};'use strict';var multer=require('multer');var util=require(_0xf92f('0x0'));var path=require(_0xf92f('0x1'));var timeout=require(_0xf92f('0x2'));var express=require(_0xf92f('0x3'));var router=express['Router']();var fs_extra=require(_0xf92f('0x4'));var auth=require(_0xf92f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf92f('0x6'));var controller=require(_0xf92f('0x7'));router[_0xf92f('0x8')]('/',auth[_0xf92f('0x9')](),controller['index']);router[_0xf92f('0x8')](_0xf92f('0xa'),auth[_0xf92f('0x9')](),controller[_0xf92f('0xb')]);router[_0xf92f('0x8')]('/:id/subjects',auth[_0xf92f('0x9')](),controller[_0xf92f('0xc')]);router[_0xf92f('0x8')](_0xf92f('0xd'),auth[_0xf92f('0x9')](),controller['getDescriptions']);router[_0xf92f('0x8')](_0xf92f('0xe'),auth['isAuthenticated'](),controller[_0xf92f('0xf')]);router[_0xf92f('0x10')]('/',auth[_0xf92f('0x9')](),controller[_0xf92f('0x11')]);router[_0xf92f('0x12')](_0xf92f('0xa'),auth[_0xf92f('0x9')](),controller['update']);router[_0xf92f('0x13')](_0xf92f('0xa'),auth[_0xf92f('0x9')](),controller[_0xf92f('0x14')]);module[_0xf92f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 159361e..65c0bc9 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 _0x40db=['sequelize','exports','STRING'];(function(_0x118fd1,_0x23605d){var _0x5f5742=function(_0x5af907){while(--_0x5af907){_0x118fd1['push'](_0x118fd1['shift']());}};_0x5f5742(++_0x23605d);}(_0x40db,0x1b6));var _0xb40d=function(_0x922e81,_0x48da6f){_0x922e81=_0x922e81-0x0;var _0x5880a1=_0x40db[_0x922e81];return _0x5880a1;};'use strict';var Sequelize=require(_0xb40d('0x0'));module[_0xb40d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb40d('0x2')]}}; \ No newline at end of file +var _0x23be=['STRING','sequelize'];(function(_0x614ef4,_0x28a060){var _0x35e8e2=function(_0x55e81b){while(--_0x55e81b){_0x614ef4['push'](_0x614ef4['shift']());}};_0x35e8e2(++_0x28a060);}(_0x23be,0xad));var _0xe23b=function(_0x3e1c59,_0x4eff25){_0x3e1c59=_0x3e1c59-0x0;var _0x42e558=_0x23be[_0x3e1c59];return _0x42e558;};'use strict';var Sequelize=require(_0xe23b('0x0'));module['exports']={'name':{'type':Sequelize[_0xe23b('0x1')]},'description':{'type':Sequelize[_0xe23b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 29419b2..46ea32e 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 _0x3c4c=['show','params','find','create','body','destroy','sort','options','getDescriptions','FreshsalesField','getFields','findOne','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','VIRTUAL','merge','includeAll','include','rows','catch'];(function(_0x6e08ed,_0x439b56){var _0x4e1198=function(_0x574b63){while(--_0x574b63){_0x6e08ed['push'](_0x6e08ed['shift']());}};_0x4e1198(++_0x439b56);}(_0x3c4c,0x192));var _0xc3c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3c4c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc3c4('0x0'));var rimraf=require(_0xc3c4('0x1'));var zipdir=require(_0xc3c4('0x2'));var jsonpatch=require(_0xc3c4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc3c4('0x4'));var util=require(_0xc3c4('0x5'));var path=require(_0xc3c4('0x6'));var sox=require('sox');var csv=require(_0xc3c4('0x7'));var ejs=require(_0xc3c4('0x8'));var fs=require('fs');var fs_extra=require(_0xc3c4('0x9'));var _=require(_0xc3c4('0xa'));var squel=require('squel');var crypto=require(_0xc3c4('0xb'));var jsforce=require(_0xc3c4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc3c4('0x7'));var querystring=require(_0xc3c4('0xd'));var Papa=require(_0xc3c4('0xe'));var Redis=require(_0xc3c4('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc3c4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3c4('0x11'))(_0xc3c4('0x12'));var utils=require(_0xc3c4('0x13'));var config=require(_0xc3c4('0x14'));var licenseUtil=require(_0xc3c4('0x15'));var db=require(_0xc3c4('0x16'))['db'];function respondWithStatusCode(_0x1c7b5d,_0x24d138){_0x24d138=_0x24d138||0xcc;return function(_0x1c277b){if(_0x1c277b){return _0x1c7b5d[_0xc3c4('0x17')](_0x24d138);}return _0x1c7b5d['status'](_0x24d138)[_0xc3c4('0x18')]();};}function respondWithResult(_0x4b96fa,_0x344d27){_0x344d27=_0x344d27||0xc8;return function(_0x2054d6){if(_0x2054d6){return _0x4b96fa[_0xc3c4('0x19')](_0x344d27)[_0xc3c4('0x1a')](_0x2054d6);}};}function respondWithFilteredResult(_0x43b629,_0x45c988){return function(_0x20bd9b){if(_0x20bd9b){var _0x35644c=typeof _0x45c988[_0xc3c4('0x1b')]===_0xc3c4('0x1c')&&typeof _0x45c988[_0xc3c4('0x1d')]===_0xc3c4('0x1c');var _0x2a9860=_0x20bd9b['count'];var _0x349a4e=_0x35644c?0x0:_0x45c988[_0xc3c4('0x1b')];var _0xebf96a=_0x35644c?_0x20bd9b[_0xc3c4('0x1e')]:_0x45c988[_0xc3c4('0x1b')]+_0x45c988[_0xc3c4('0x1d')];var _0x18aa75;if(_0xebf96a>=_0x2a9860){_0xebf96a=_0x2a9860;_0x18aa75=0xc8;}else{_0x18aa75=0xce;}_0x43b629[_0xc3c4('0x19')](_0x18aa75);return _0x43b629['set'](_0xc3c4('0x1f'),_0x349a4e+'-'+_0xebf96a+'/'+_0x2a9860)[_0xc3c4('0x1a')](_0x20bd9b);}return null;};}function patchUpdates(_0x26784c){return function(_0x162c8b){try{jsonpatch[_0xc3c4('0x20')](_0x162c8b,_0x26784c,!![]);}catch(_0x47ffb3){return BPromise[_0xc3c4('0x21')](_0x47ffb3);}return _0x162c8b[_0xc3c4('0x22')]();};}function saveUpdates(_0x7a2b43,_0x35a6c2){return function(_0x55f3f5){if(_0x55f3f5){return _0x55f3f5[_0xc3c4('0x23')](_0x7a2b43)[_0xc3c4('0x24')](function(_0x2c74d9){return _0x2c74d9;});}return null;};}function removeEntity(_0x229596,_0xe629a0){return function(_0x2ce5a5){if(_0x2ce5a5){return _0x2ce5a5['destroy']()[_0xc3c4('0x24')](function(){_0x229596[_0xc3c4('0x19')](0xcc)[_0xc3c4('0x18')]();});}};}function handleEntityNotFound(_0x3bf4ef,_0x453b8f){return function(_0x5c9a2a){if(!_0x5c9a2a){_0x3bf4ef[_0xc3c4('0x17')](0x194);}return _0x5c9a2a;};}function handleError(_0x578c10,_0x1bb654){_0x1bb654=_0x1bb654||0x1f4;return function(_0x47b2c0){logger[_0xc3c4('0x25')](_0x47b2c0['stack']);if(_0x47b2c0[_0xc3c4('0x26')]){delete _0x47b2c0[_0xc3c4('0x26')];}_0x578c10['status'](_0x1bb654)[_0xc3c4('0x27')](_0x47b2c0);};}exports[_0xc3c4('0x28')]=function(_0x32963b,_0x57a9f8){var _0x2a4f55={},_0x32077d={},_0x395683={'count':0x0,'rows':[]};var _0x52cbb1=_[_0xc3c4('0x29')](db[_0xc3c4('0x2a')][_0xc3c4('0x2b')],function(_0x29d466){return{'name':_0x29d466[_0xc3c4('0x2c')],'type':_0x29d466[_0xc3c4('0x2d')]['key']};});_0x32077d[_0xc3c4('0x2e')]=_['map'](_0x52cbb1,_0xc3c4('0x26'));_0x32077d['query']=_[_0xc3c4('0x2f')](_0x32963b[_0xc3c4('0x30')]);_0x32077d['filters']=_[_0xc3c4('0x31')](_0x32077d[_0xc3c4('0x2e')],_0x32077d[_0xc3c4('0x30')]);_0x2a4f55[_0xc3c4('0x32')]=_[_0xc3c4('0x31')](_0x32077d[_0xc3c4('0x2e')],qs[_0xc3c4('0x33')](_0x32963b[_0xc3c4('0x30')][_0xc3c4('0x33')]));_0x2a4f55[_0xc3c4('0x32')]=_0x2a4f55[_0xc3c4('0x32')][_0xc3c4('0x34')]?_0x2a4f55['attributes']:_0x32077d[_0xc3c4('0x2e')];if(!_0x32963b['query'][_0xc3c4('0x35')](_0xc3c4('0x36'))){_0x2a4f55[_0xc3c4('0x1d')]=qs[_0xc3c4('0x1d')](_0x32963b[_0xc3c4('0x30')][_0xc3c4('0x1d')]);_0x2a4f55[_0xc3c4('0x1b')]=qs[_0xc3c4('0x1b')](_0x32963b[_0xc3c4('0x30')]['offset']);}_0x2a4f55[_0xc3c4('0x37')]=qs['sort'](_0x32963b[_0xc3c4('0x30')]['sort']);_0x2a4f55[_0xc3c4('0x38')]=qs['filters'](_[_0xc3c4('0x39')](_0x32963b[_0xc3c4('0x30')],_0x32077d[_0xc3c4('0x3a')]),_0x52cbb1);if(_0x32963b[_0xc3c4('0x30')][_0xc3c4('0x3b')]){_0x2a4f55['where']=_['merge'](_0x2a4f55[_0xc3c4('0x38')],{'$or':_[_0xc3c4('0x29')](_0x52cbb1,function(_0x57eeb9){if(_0x57eeb9[_0xc3c4('0x2d')]!==_0xc3c4('0x3c')){var _0x252537={};_0x252537[_0x57eeb9[_0xc3c4('0x26')]]={'$like':'%'+_0x32963b[_0xc3c4('0x30')][_0xc3c4('0x3b')]+'%'};return _0x252537;}})});}_0x2a4f55=_[_0xc3c4('0x3d')]({},_0x2a4f55,_0x32963b['options']);var _0x3df53f={'where':_0x2a4f55[_0xc3c4('0x38')]};return db[_0xc3c4('0x2a')][_0xc3c4('0x1e')](_0x3df53f)[_0xc3c4('0x24')](function(_0x240e46){_0x395683['count']=_0x240e46;if(_0x32963b[_0xc3c4('0x30')][_0xc3c4('0x3e')]){_0x2a4f55[_0xc3c4('0x3f')]=[{'all':!![]}];}return db[_0xc3c4('0x2a')]['findAll'](_0x2a4f55);})[_0xc3c4('0x24')](function(_0x24e577){_0x395683[_0xc3c4('0x40')]=_0x24e577;return _0x395683;})[_0xc3c4('0x24')](respondWithFilteredResult(_0x57a9f8,_0x2a4f55))[_0xc3c4('0x41')](handleError(_0x57a9f8,null));};exports[_0xc3c4('0x42')]=function(_0x5c1c96,_0x392fc4){var _0x3bc526={'raw':![],'where':{'id':_0x5c1c96[_0xc3c4('0x43')]['id']}},_0x469bef={};_0x469bef[_0xc3c4('0x2e')]=_[_0xc3c4('0x2f')](db[_0xc3c4('0x2a')]['rawAttributes']);_0x469bef[_0xc3c4('0x30')]=_[_0xc3c4('0x2f')](_0x5c1c96[_0xc3c4('0x30')]);_0x469bef[_0xc3c4('0x3a')]=_['intersection'](_0x469bef['model'],_0x469bef[_0xc3c4('0x30')]);_0x3bc526['attributes']=_[_0xc3c4('0x31')](_0x469bef['model'],qs[_0xc3c4('0x33')](_0x5c1c96[_0xc3c4('0x30')][_0xc3c4('0x33')]));_0x3bc526[_0xc3c4('0x32')]=_0x3bc526[_0xc3c4('0x32')][_0xc3c4('0x34')]?_0x3bc526['attributes']:_0x469bef[_0xc3c4('0x2e')];if(_0x5c1c96['query']['includeAll']){_0x3bc526[_0xc3c4('0x3f')]=[{'all':!![]}];}_0x3bc526=_['merge']({},_0x3bc526,_0x5c1c96['options']);return db[_0xc3c4('0x2a')][_0xc3c4('0x44')](_0x3bc526)['then'](handleEntityNotFound(_0x392fc4,null))[_0xc3c4('0x24')](respondWithResult(_0x392fc4,null))['catch'](handleError(_0x392fc4,null));};exports['create']=function(_0x3684a3,_0x15cced){return db[_0xc3c4('0x2a')][_0xc3c4('0x45')](_0x3684a3[_0xc3c4('0x46')],{})[_0xc3c4('0x24')](respondWithResult(_0x15cced,0xc9))['catch'](handleError(_0x15cced,null));};exports[_0xc3c4('0x23')]=function(_0x43de6a,_0xf550cc){if(_0x43de6a['body']['id']){delete _0x43de6a['body']['id'];}return db['FreshsalesConfiguration'][_0xc3c4('0x44')]({'where':{'id':_0x43de6a[_0xc3c4('0x43')]['id']}})[_0xc3c4('0x24')](handleEntityNotFound(_0xf550cc,null))[_0xc3c4('0x24')](saveUpdates(_0x43de6a[_0xc3c4('0x46')],null))[_0xc3c4('0x24')](respondWithResult(_0xf550cc,null))['catch'](handleError(_0xf550cc,null));};exports[_0xc3c4('0x47')]=function(_0x4ec36a,_0x283707){return db[_0xc3c4('0x2a')][_0xc3c4('0x44')]({'where':{'id':_0x4ec36a['params']['id']}})['then'](handleEntityNotFound(_0x283707,null))[_0xc3c4('0x24')](removeEntity(_0x283707,null))[_0xc3c4('0x41')](handleError(_0x283707,null));};exports['getSubjects']=function(_0x37c02b,_0x3e424a,_0x176968){var _0x1e3e9a={};var _0x356353={};var _0x377405;var _0x18647b;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x37c02b['params']['id']}})[_0xc3c4('0x24')](handleEntityNotFound(_0x3e424a,null))[_0xc3c4('0x24')](function(_0xaad96a){if(_0xaad96a){_0x377405=_0xaad96a;_0x356353[_0xc3c4('0x2e')]=_[_0xc3c4('0x2f')](db['FreshsalesField'][_0xc3c4('0x2b')]);_0x356353[_0xc3c4('0x30')]=_[_0xc3c4('0x2f')](_0x37c02b[_0xc3c4('0x30')]);_0x356353[_0xc3c4('0x3a')]=_[_0xc3c4('0x31')](_0x356353[_0xc3c4('0x2e')],_0x356353[_0xc3c4('0x30')]);_0x1e3e9a[_0xc3c4('0x32')]=_[_0xc3c4('0x31')](_0x356353[_0xc3c4('0x2e')],qs[_0xc3c4('0x33')](_0x37c02b['query']['fields']));_0x1e3e9a[_0xc3c4('0x32')]=_0x1e3e9a['attributes']['length']?_0x1e3e9a['attributes']:_0x356353[_0xc3c4('0x2e')];_0x1e3e9a[_0xc3c4('0x37')]=qs[_0xc3c4('0x48')](_0x37c02b[_0xc3c4('0x30')]['sort']);_0x1e3e9a[_0xc3c4('0x38')]=qs[_0xc3c4('0x3a')](_[_0xc3c4('0x39')](_0x37c02b['query'],_0x356353['filters']));if(_0x37c02b['query'][_0xc3c4('0x3b')]){_0x1e3e9a[_0xc3c4('0x38')]=_[_0xc3c4('0x3d')](_0x1e3e9a[_0xc3c4('0x38')],{'$or':_['map'](_0x1e3e9a['attributes'],function(_0x431e13){var _0x523af9={};_0x523af9[_0x431e13]={'$like':'%'+_0x37c02b[_0xc3c4('0x30')]['filter']+'%'};return _0x523af9;})});}_0x1e3e9a=_[_0xc3c4('0x3d')]({},_0x1e3e9a,_0x37c02b[_0xc3c4('0x49')]);return _0x377405['getSubjects'](_0x1e3e9a);}})[_0xc3c4('0x24')](function(_0x351ff8){if(_0x351ff8){_0x18647b=_0x351ff8[_0xc3c4('0x34')];if(!_0x37c02b['query'][_0xc3c4('0x35')](_0xc3c4('0x36'))){_0x1e3e9a[_0xc3c4('0x1d')]=qs[_0xc3c4('0x1d')](_0x37c02b[_0xc3c4('0x30')][_0xc3c4('0x1d')]);_0x1e3e9a['offset']=qs['offset'](_0x37c02b[_0xc3c4('0x30')]['offset']);}return _0x377405['getSubjects'](_0x1e3e9a);}})[_0xc3c4('0x24')](function(_0x59eb80){if(_0x59eb80){return _0x59eb80?{'count':_0x18647b,'rows':_0x59eb80}:null;}})[_0xc3c4('0x24')](respondWithResult(_0x3e424a,null))[_0xc3c4('0x41')](handleError(_0x3e424a,null));};exports[_0xc3c4('0x4a')]=function(_0x425601,_0x1ff852,_0x2d5d18){var _0x2f55dc={};var _0x311339={};var _0x21d6e9;var _0x192307;return db[_0xc3c4('0x2a')]['findOne']({'where':{'id':_0x425601[_0xc3c4('0x43')]['id']}})[_0xc3c4('0x24')](handleEntityNotFound(_0x1ff852,null))['then'](function(_0x39a267){if(_0x39a267){_0x21d6e9=_0x39a267;_0x311339[_0xc3c4('0x2e')]=_[_0xc3c4('0x2f')](db[_0xc3c4('0x4b')][_0xc3c4('0x2b')]);_0x311339['query']=_[_0xc3c4('0x2f')](_0x425601['query']);_0x311339[_0xc3c4('0x3a')]=_['intersection'](_0x311339['model'],_0x311339[_0xc3c4('0x30')]);_0x2f55dc['attributes']=_[_0xc3c4('0x31')](_0x311339[_0xc3c4('0x2e')],qs['fields'](_0x425601[_0xc3c4('0x30')]['fields']));_0x2f55dc['attributes']=_0x2f55dc[_0xc3c4('0x32')][_0xc3c4('0x34')]?_0x2f55dc[_0xc3c4('0x32')]:_0x311339[_0xc3c4('0x2e')];_0x2f55dc[_0xc3c4('0x37')]=qs[_0xc3c4('0x48')](_0x425601[_0xc3c4('0x30')][_0xc3c4('0x48')]);_0x2f55dc['where']=qs['filters'](_[_0xc3c4('0x39')](_0x425601[_0xc3c4('0x30')],_0x311339['filters']));if(_0x425601['query'][_0xc3c4('0x3b')]){_0x2f55dc[_0xc3c4('0x38')]=_[_0xc3c4('0x3d')](_0x2f55dc[_0xc3c4('0x38')],{'$or':_[_0xc3c4('0x29')](_0x2f55dc[_0xc3c4('0x32')],function(_0x5dedd0){var _0x3c4d88={};_0x3c4d88[_0x5dedd0]={'$like':'%'+_0x425601[_0xc3c4('0x30')][_0xc3c4('0x3b')]+'%'};return _0x3c4d88;})});}_0x2f55dc=_[_0xc3c4('0x3d')]({},_0x2f55dc,_0x425601[_0xc3c4('0x49')]);return _0x21d6e9[_0xc3c4('0x4a')](_0x2f55dc);}})[_0xc3c4('0x24')](function(_0x182ea1){if(_0x182ea1){_0x192307=_0x182ea1[_0xc3c4('0x34')];if(!_0x425601[_0xc3c4('0x30')][_0xc3c4('0x35')](_0xc3c4('0x36'))){_0x2f55dc[_0xc3c4('0x1d')]=qs[_0xc3c4('0x1d')](_0x425601[_0xc3c4('0x30')]['limit']);_0x2f55dc[_0xc3c4('0x1b')]=qs[_0xc3c4('0x1b')](_0x425601[_0xc3c4('0x30')][_0xc3c4('0x1b')]);}return _0x21d6e9['getDescriptions'](_0x2f55dc);}})[_0xc3c4('0x24')](function(_0x1751b9){if(_0x1751b9){return _0x1751b9?{'count':_0x192307,'rows':_0x1751b9}:null;}})[_0xc3c4('0x24')](respondWithResult(_0x1ff852,null))[_0xc3c4('0x41')](handleError(_0x1ff852,null));};exports[_0xc3c4('0x4c')]=function(_0x5d8c92,_0x158998,_0x15d34d){var _0x5868bb={};var _0x79577c={};var _0xb9d524;var _0x3719ce;return db[_0xc3c4('0x2a')][_0xc3c4('0x4d')]({'where':{'id':_0x5d8c92[_0xc3c4('0x43')]['id']}})['then'](handleEntityNotFound(_0x158998,null))[_0xc3c4('0x24')](function(_0x1d3d6d){if(_0x1d3d6d){_0xb9d524=_0x1d3d6d;_0x79577c[_0xc3c4('0x2e')]=_[_0xc3c4('0x2f')](db[_0xc3c4('0x4b')][_0xc3c4('0x2b')]);_0x79577c[_0xc3c4('0x30')]=_[_0xc3c4('0x2f')](_0x5d8c92['query']);_0x79577c['filters']=_[_0xc3c4('0x31')](_0x79577c[_0xc3c4('0x2e')],_0x79577c[_0xc3c4('0x30')]);_0x5868bb[_0xc3c4('0x32')]=_[_0xc3c4('0x31')](_0x79577c[_0xc3c4('0x2e')],qs[_0xc3c4('0x33')](_0x5d8c92[_0xc3c4('0x30')][_0xc3c4('0x33')]));_0x5868bb[_0xc3c4('0x32')]=_0x5868bb[_0xc3c4('0x32')][_0xc3c4('0x34')]?_0x5868bb[_0xc3c4('0x32')]:_0x79577c[_0xc3c4('0x2e')];_0x5868bb[_0xc3c4('0x37')]=qs['sort'](_0x5d8c92[_0xc3c4('0x30')]['sort']);_0x5868bb[_0xc3c4('0x38')]=qs[_0xc3c4('0x3a')](_[_0xc3c4('0x39')](_0x5d8c92[_0xc3c4('0x30')],_0x79577c[_0xc3c4('0x3a')]));if(_0x5d8c92['query'][_0xc3c4('0x3b')]){_0x5868bb['where']=_[_0xc3c4('0x3d')](_0x5868bb[_0xc3c4('0x38')],{'$or':_[_0xc3c4('0x29')](_0x5868bb[_0xc3c4('0x32')],function(_0x5918e2){var _0x21defd={};_0x21defd[_0x5918e2]={'$like':'%'+_0x5d8c92[_0xc3c4('0x30')]['filter']+'%'};return _0x21defd;})});}_0x5868bb=_[_0xc3c4('0x3d')]({},_0x5868bb,_0x5d8c92[_0xc3c4('0x49')]);return _0xb9d524[_0xc3c4('0x4c')](_0x5868bb);}})[_0xc3c4('0x24')](function(_0x345c04){if(_0x345c04){_0x3719ce=_0x345c04[_0xc3c4('0x34')];if(!_0x5d8c92[_0xc3c4('0x30')][_0xc3c4('0x35')](_0xc3c4('0x36'))){_0x5868bb[_0xc3c4('0x1d')]=qs[_0xc3c4('0x1d')](_0x5d8c92[_0xc3c4('0x30')][_0xc3c4('0x1d')]);_0x5868bb['offset']=qs[_0xc3c4('0x1b')](_0x5d8c92[_0xc3c4('0x30')][_0xc3c4('0x1b')]);}return _0xb9d524['getFields'](_0x5868bb);}})[_0xc3c4('0x24')](function(_0x413dde){if(_0x413dde){return _0x413dde?{'count':_0x3719ce,'rows':_0x413dde}:null;}})[_0xc3c4('0x24')](respondWithResult(_0x158998,null))[_0xc3c4('0x41')](handleError(_0x158998,null));}; \ No newline at end of file +var _0xc9b8=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','FreshsalesConfiguration','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','where','pick','merge','VIRTUAL','includeAll','include','rows','catch','options','find','create','body','params','getSubjects','FreshsalesField','order','sort','getDescriptions','findOne','filter','getFields','rimraf'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc9b8,0x1eb));var _0x8c9b=function(_0xa1e7d7,_0x5714bb){_0xa1e7d7=_0xa1e7d7-0x0;var _0x287bee=_0xc9b8[_0xa1e7d7];return _0x287bee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c9b('0x0'));var zipdir=require(_0x8c9b('0x1'));var jsonpatch=require(_0x8c9b('0x2'));var rp=require(_0x8c9b('0x3'));var moment=require(_0x8c9b('0x4'));var BPromise=require(_0x8c9b('0x5'));var Mustache=require(_0x8c9b('0x6'));var util=require('util');var path=require(_0x8c9b('0x7'));var sox=require('sox');var csv=require(_0x8c9b('0x8'));var ejs=require(_0x8c9b('0x9'));var fs=require('fs');var fs_extra=require(_0x8c9b('0xa'));var _=require(_0x8c9b('0xb'));var squel=require(_0x8c9b('0xc'));var crypto=require(_0x8c9b('0xd'));var jsforce=require(_0x8c9b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8c9b('0x8'));var querystring=require(_0x8c9b('0xf'));var Papa=require(_0x8c9b('0x10'));var Redis=require(_0x8c9b('0x11'));var authService=require(_0x8c9b('0x12'));var qs=require(_0x8c9b('0x13'));var as=require(_0x8c9b('0x14'));var hardwareService=require(_0x8c9b('0x15'));var logger=require(_0x8c9b('0x16'))(_0x8c9b('0x17'));var utils=require(_0x8c9b('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8c9b('0x19'))['db'];function respondWithStatusCode(_0x102735,_0x3d523d){_0x3d523d=_0x3d523d||0xcc;return function(_0x1cb0b1){if(_0x1cb0b1){return _0x102735[_0x8c9b('0x1a')](_0x3d523d);}return _0x102735[_0x8c9b('0x1b')](_0x3d523d)[_0x8c9b('0x1c')]();};}function respondWithResult(_0x54c161,_0x37e324){_0x37e324=_0x37e324||0xc8;return function(_0x54cff1){if(_0x54cff1){return _0x54c161[_0x8c9b('0x1b')](_0x37e324)[_0x8c9b('0x1d')](_0x54cff1);}};}function respondWithFilteredResult(_0x1e5999,_0x46bf25){return function(_0x58b00a){if(_0x58b00a){var _0x2484dd=typeof _0x46bf25[_0x8c9b('0x1e')]===_0x8c9b('0x1f')&&typeof _0x46bf25['limit']==='undefined';var _0x33b751=_0x58b00a[_0x8c9b('0x20')];var _0xe83e1d=_0x2484dd?0x0:_0x46bf25[_0x8c9b('0x1e')];var _0x361088=_0x2484dd?_0x58b00a[_0x8c9b('0x20')]:_0x46bf25[_0x8c9b('0x1e')]+_0x46bf25['limit'];var _0xcb06f8;if(_0x361088>=_0x33b751){_0x361088=_0x33b751;_0xcb06f8=0xc8;}else{_0xcb06f8=0xce;}_0x1e5999[_0x8c9b('0x1b')](_0xcb06f8);return _0x1e5999[_0x8c9b('0x21')](_0x8c9b('0x22'),_0xe83e1d+'-'+_0x361088+'/'+_0x33b751)[_0x8c9b('0x1d')](_0x58b00a);}return null;};}function patchUpdates(_0x21c7f4){return function(_0x24e9ef){try{jsonpatch[_0x8c9b('0x23')](_0x24e9ef,_0x21c7f4,!![]);}catch(_0x212e5b){return BPromise[_0x8c9b('0x24')](_0x212e5b);}return _0x24e9ef[_0x8c9b('0x25')]();};}function saveUpdates(_0x32bb29,_0x38423c){return function(_0x1385c9){if(_0x1385c9){return _0x1385c9[_0x8c9b('0x26')](_0x32bb29)[_0x8c9b('0x27')](function(_0xb06ebb){return _0xb06ebb;});}return null;};}function removeEntity(_0x28dc9e,_0x4da2df){return function(_0x27509b){if(_0x27509b){return _0x27509b[_0x8c9b('0x28')]()[_0x8c9b('0x27')](function(){_0x28dc9e['status'](0xcc)[_0x8c9b('0x1c')]();});}};}function handleEntityNotFound(_0x457146,_0x21d0d6){return function(_0x15b163){if(!_0x15b163){_0x457146['sendStatus'](0x194);}return _0x15b163;};}function handleError(_0x2a00c8,_0x864a50){_0x864a50=_0x864a50||0x1f4;return function(_0x31e596){logger[_0x8c9b('0x29')](_0x31e596[_0x8c9b('0x2a')]);if(_0x31e596[_0x8c9b('0x2b')]){delete _0x31e596[_0x8c9b('0x2b')];}_0x2a00c8[_0x8c9b('0x1b')](_0x864a50)['send'](_0x31e596);};}exports['index']=function(_0x5e2021,_0x339241){var _0xc0c861={},_0x18853a={},_0x3495f6={'count':0x0,'rows':[]};var _0x405470=_['map'](db[_0x8c9b('0x2c')][_0x8c9b('0x2d')],function(_0x1c4b8a){return{'name':_0x1c4b8a[_0x8c9b('0x2e')],'type':_0x1c4b8a[_0x8c9b('0x2f')][_0x8c9b('0x30')]};});_0x18853a['model']=_[_0x8c9b('0x31')](_0x405470,_0x8c9b('0x2b'));_0x18853a[_0x8c9b('0x32')]=_[_0x8c9b('0x33')](_0x5e2021[_0x8c9b('0x32')]);_0x18853a[_0x8c9b('0x34')]=_[_0x8c9b('0x35')](_0x18853a[_0x8c9b('0x36')],_0x18853a[_0x8c9b('0x32')]);_0xc0c861[_0x8c9b('0x37')]=_['intersection'](_0x18853a[_0x8c9b('0x36')],qs[_0x8c9b('0x38')](_0x5e2021['query'][_0x8c9b('0x38')]));_0xc0c861[_0x8c9b('0x37')]=_0xc0c861['attributes'][_0x8c9b('0x39')]?_0xc0c861[_0x8c9b('0x37')]:_0x18853a['model'];if(!_0x5e2021[_0x8c9b('0x32')][_0x8c9b('0x3a')](_0x8c9b('0x3b'))){_0xc0c861[_0x8c9b('0x3c')]=qs['limit'](_0x5e2021[_0x8c9b('0x32')][_0x8c9b('0x3c')]);_0xc0c861[_0x8c9b('0x1e')]=qs[_0x8c9b('0x1e')](_0x5e2021[_0x8c9b('0x32')][_0x8c9b('0x1e')]);}_0xc0c861['order']=qs['sort'](_0x5e2021[_0x8c9b('0x32')]['sort']);_0xc0c861[_0x8c9b('0x3d')]=qs['filters'](_[_0x8c9b('0x3e')](_0x5e2021[_0x8c9b('0x32')],_0x18853a[_0x8c9b('0x34')]),_0x405470);if(_0x5e2021['query']['filter']){_0xc0c861['where']=_[_0x8c9b('0x3f')](_0xc0c861[_0x8c9b('0x3d')],{'$or':_[_0x8c9b('0x31')](_0x405470,function(_0x11b1ed){if(_0x11b1ed[_0x8c9b('0x2f')]!==_0x8c9b('0x40')){var _0x402ae1={};_0x402ae1[_0x11b1ed[_0x8c9b('0x2b')]]={'$like':'%'+_0x5e2021['query']['filter']+'%'};return _0x402ae1;}})});}_0xc0c861=_[_0x8c9b('0x3f')]({},_0xc0c861,_0x5e2021['options']);var _0x4638b1={'where':_0xc0c861[_0x8c9b('0x3d')]};return db[_0x8c9b('0x2c')][_0x8c9b('0x20')](_0x4638b1)[_0x8c9b('0x27')](function(_0x4d7240){_0x3495f6[_0x8c9b('0x20')]=_0x4d7240;if(_0x5e2021[_0x8c9b('0x32')][_0x8c9b('0x41')]){_0xc0c861[_0x8c9b('0x42')]=[{'all':!![]}];}return db[_0x8c9b('0x2c')]['findAll'](_0xc0c861);})[_0x8c9b('0x27')](function(_0x139d63){_0x3495f6[_0x8c9b('0x43')]=_0x139d63;return _0x3495f6;})[_0x8c9b('0x27')](respondWithFilteredResult(_0x339241,_0xc0c861))[_0x8c9b('0x44')](handleError(_0x339241,null));};exports['show']=function(_0xe70fb4,_0x547533){var _0x36a9e8={'raw':![],'where':{'id':_0xe70fb4['params']['id']}},_0x5a0745={};_0x5a0745['model']=_[_0x8c9b('0x33')](db['FreshsalesConfiguration'][_0x8c9b('0x2d')]);_0x5a0745[_0x8c9b('0x32')]=_['keys'](_0xe70fb4[_0x8c9b('0x32')]);_0x5a0745[_0x8c9b('0x34')]=_['intersection'](_0x5a0745['model'],_0x5a0745[_0x8c9b('0x32')]);_0x36a9e8[_0x8c9b('0x37')]=_['intersection'](_0x5a0745['model'],qs[_0x8c9b('0x38')](_0xe70fb4['query'][_0x8c9b('0x38')]));_0x36a9e8[_0x8c9b('0x37')]=_0x36a9e8['attributes'][_0x8c9b('0x39')]?_0x36a9e8[_0x8c9b('0x37')]:_0x5a0745['model'];if(_0xe70fb4[_0x8c9b('0x32')][_0x8c9b('0x41')]){_0x36a9e8[_0x8c9b('0x42')]=[{'all':!![]}];}_0x36a9e8=_[_0x8c9b('0x3f')]({},_0x36a9e8,_0xe70fb4[_0x8c9b('0x45')]);return db['FreshsalesConfiguration'][_0x8c9b('0x46')](_0x36a9e8)['then'](handleEntityNotFound(_0x547533,null))[_0x8c9b('0x27')](respondWithResult(_0x547533,null))[_0x8c9b('0x44')](handleError(_0x547533,null));};exports[_0x8c9b('0x47')]=function(_0x528bc0,_0x5cc4ba){return db[_0x8c9b('0x2c')][_0x8c9b('0x47')](_0x528bc0[_0x8c9b('0x48')],{})[_0x8c9b('0x27')](respondWithResult(_0x5cc4ba,0xc9))['catch'](handleError(_0x5cc4ba,null));};exports[_0x8c9b('0x26')]=function(_0x1e1ecf,_0x14550a){if(_0x1e1ecf[_0x8c9b('0x48')]['id']){delete _0x1e1ecf[_0x8c9b('0x48')]['id'];}return db[_0x8c9b('0x2c')][_0x8c9b('0x46')]({'where':{'id':_0x1e1ecf[_0x8c9b('0x49')]['id']}})[_0x8c9b('0x27')](handleEntityNotFound(_0x14550a,null))['then'](saveUpdates(_0x1e1ecf[_0x8c9b('0x48')],null))[_0x8c9b('0x27')](respondWithResult(_0x14550a,null))[_0x8c9b('0x44')](handleError(_0x14550a,null));};exports[_0x8c9b('0x28')]=function(_0x38f224,_0x2205d4){return db[_0x8c9b('0x2c')][_0x8c9b('0x46')]({'where':{'id':_0x38f224['params']['id']}})[_0x8c9b('0x27')](handleEntityNotFound(_0x2205d4,null))[_0x8c9b('0x27')](removeEntity(_0x2205d4,null))[_0x8c9b('0x44')](handleError(_0x2205d4,null));};exports[_0x8c9b('0x4a')]=function(_0x5bc7be,_0x4baf03,_0xa25a58){var _0x3d1095={};var _0x10570d={};var _0x5c571c;var _0x22b250;return db[_0x8c9b('0x2c')]['findOne']({'where':{'id':_0x5bc7be[_0x8c9b('0x49')]['id']}})[_0x8c9b('0x27')](handleEntityNotFound(_0x4baf03,null))[_0x8c9b('0x27')](function(_0x9a5a4e){if(_0x9a5a4e){_0x5c571c=_0x9a5a4e;_0x10570d['model']=_[_0x8c9b('0x33')](db[_0x8c9b('0x4b')][_0x8c9b('0x2d')]);_0x10570d[_0x8c9b('0x32')]=_['keys'](_0x5bc7be[_0x8c9b('0x32')]);_0x10570d[_0x8c9b('0x34')]=_['intersection'](_0x10570d[_0x8c9b('0x36')],_0x10570d[_0x8c9b('0x32')]);_0x3d1095[_0x8c9b('0x37')]=_[_0x8c9b('0x35')](_0x10570d[_0x8c9b('0x36')],qs[_0x8c9b('0x38')](_0x5bc7be[_0x8c9b('0x32')]['fields']));_0x3d1095[_0x8c9b('0x37')]=_0x3d1095[_0x8c9b('0x37')][_0x8c9b('0x39')]?_0x3d1095[_0x8c9b('0x37')]:_0x10570d[_0x8c9b('0x36')];_0x3d1095[_0x8c9b('0x4c')]=qs[_0x8c9b('0x4d')](_0x5bc7be[_0x8c9b('0x32')][_0x8c9b('0x4d')]);_0x3d1095[_0x8c9b('0x3d')]=qs[_0x8c9b('0x34')](_[_0x8c9b('0x3e')](_0x5bc7be['query'],_0x10570d[_0x8c9b('0x34')]));if(_0x5bc7be[_0x8c9b('0x32')]['filter']){_0x3d1095[_0x8c9b('0x3d')]=_[_0x8c9b('0x3f')](_0x3d1095[_0x8c9b('0x3d')],{'$or':_[_0x8c9b('0x31')](_0x3d1095[_0x8c9b('0x37')],function(_0x495cc7){var _0x1f15eb={};_0x1f15eb[_0x495cc7]={'$like':'%'+_0x5bc7be[_0x8c9b('0x32')]['filter']+'%'};return _0x1f15eb;})});}_0x3d1095=_[_0x8c9b('0x3f')]({},_0x3d1095,_0x5bc7be[_0x8c9b('0x45')]);return _0x5c571c[_0x8c9b('0x4a')](_0x3d1095);}})[_0x8c9b('0x27')](function(_0x5298ee){if(_0x5298ee){_0x22b250=_0x5298ee[_0x8c9b('0x39')];if(!_0x5bc7be[_0x8c9b('0x32')][_0x8c9b('0x3a')](_0x8c9b('0x3b'))){_0x3d1095[_0x8c9b('0x3c')]=qs['limit'](_0x5bc7be['query']['limit']);_0x3d1095[_0x8c9b('0x1e')]=qs[_0x8c9b('0x1e')](_0x5bc7be['query'][_0x8c9b('0x1e')]);}return _0x5c571c[_0x8c9b('0x4a')](_0x3d1095);}})[_0x8c9b('0x27')](function(_0x147c8d){if(_0x147c8d){return _0x147c8d?{'count':_0x22b250,'rows':_0x147c8d}:null;}})[_0x8c9b('0x27')](respondWithResult(_0x4baf03,null))['catch'](handleError(_0x4baf03,null));};exports[_0x8c9b('0x4e')]=function(_0x2daea5,_0x5207f9,_0x41b6b0){var _0x138559={};var _0x314b81={};var _0x2ca645;var _0x3431c8;return db[_0x8c9b('0x2c')][_0x8c9b('0x4f')]({'where':{'id':_0x2daea5[_0x8c9b('0x49')]['id']}})['then'](handleEntityNotFound(_0x5207f9,null))[_0x8c9b('0x27')](function(_0x286582){if(_0x286582){_0x2ca645=_0x286582;_0x314b81['model']=_[_0x8c9b('0x33')](db[_0x8c9b('0x4b')][_0x8c9b('0x2d')]);_0x314b81[_0x8c9b('0x32')]=_[_0x8c9b('0x33')](_0x2daea5[_0x8c9b('0x32')]);_0x314b81['filters']=_[_0x8c9b('0x35')](_0x314b81[_0x8c9b('0x36')],_0x314b81[_0x8c9b('0x32')]);_0x138559[_0x8c9b('0x37')]=_[_0x8c9b('0x35')](_0x314b81['model'],qs[_0x8c9b('0x38')](_0x2daea5[_0x8c9b('0x32')][_0x8c9b('0x38')]));_0x138559['attributes']=_0x138559[_0x8c9b('0x37')][_0x8c9b('0x39')]?_0x138559[_0x8c9b('0x37')]:_0x314b81['model'];_0x138559[_0x8c9b('0x4c')]=qs[_0x8c9b('0x4d')](_0x2daea5[_0x8c9b('0x32')][_0x8c9b('0x4d')]);_0x138559[_0x8c9b('0x3d')]=qs['filters'](_['pick'](_0x2daea5['query'],_0x314b81['filters']));if(_0x2daea5[_0x8c9b('0x32')][_0x8c9b('0x50')]){_0x138559[_0x8c9b('0x3d')]=_[_0x8c9b('0x3f')](_0x138559['where'],{'$or':_[_0x8c9b('0x31')](_0x138559[_0x8c9b('0x37')],function(_0x169add){var _0x210842={};_0x210842[_0x169add]={'$like':'%'+_0x2daea5['query'][_0x8c9b('0x50')]+'%'};return _0x210842;})});}_0x138559=_[_0x8c9b('0x3f')]({},_0x138559,_0x2daea5[_0x8c9b('0x45')]);return _0x2ca645[_0x8c9b('0x4e')](_0x138559);}})[_0x8c9b('0x27')](function(_0x568c35){if(_0x568c35){_0x3431c8=_0x568c35['length'];if(!_0x2daea5[_0x8c9b('0x32')][_0x8c9b('0x3a')](_0x8c9b('0x3b'))){_0x138559['limit']=qs[_0x8c9b('0x3c')](_0x2daea5[_0x8c9b('0x32')][_0x8c9b('0x3c')]);_0x138559[_0x8c9b('0x1e')]=qs[_0x8c9b('0x1e')](_0x2daea5[_0x8c9b('0x32')][_0x8c9b('0x1e')]);}return _0x2ca645[_0x8c9b('0x4e')](_0x138559);}})[_0x8c9b('0x27')](function(_0xe50c3d){if(_0xe50c3d){return _0xe50c3d?{'count':_0x3431c8,'rows':_0xe50c3d}:null;}})[_0x8c9b('0x27')](respondWithResult(_0x5207f9,null))[_0x8c9b('0x44')](handleError(_0x5207f9,null));};exports[_0x8c9b('0x51')]=function(_0x5f05d4,_0x18ff75,_0x2c87ce){var _0x7c67a2={};var _0x422a35={};var _0x1a60fb;var _0x1cff2b;return db[_0x8c9b('0x2c')][_0x8c9b('0x4f')]({'where':{'id':_0x5f05d4[_0x8c9b('0x49')]['id']}})['then'](handleEntityNotFound(_0x18ff75,null))[_0x8c9b('0x27')](function(_0x16734e){if(_0x16734e){_0x1a60fb=_0x16734e;_0x422a35[_0x8c9b('0x36')]=_[_0x8c9b('0x33')](db[_0x8c9b('0x4b')][_0x8c9b('0x2d')]);_0x422a35[_0x8c9b('0x32')]=_[_0x8c9b('0x33')](_0x5f05d4['query']);_0x422a35[_0x8c9b('0x34')]=_['intersection'](_0x422a35[_0x8c9b('0x36')],_0x422a35[_0x8c9b('0x32')]);_0x7c67a2['attributes']=_['intersection'](_0x422a35[_0x8c9b('0x36')],qs[_0x8c9b('0x38')](_0x5f05d4[_0x8c9b('0x32')]['fields']));_0x7c67a2[_0x8c9b('0x37')]=_0x7c67a2[_0x8c9b('0x37')][_0x8c9b('0x39')]?_0x7c67a2['attributes']:_0x422a35[_0x8c9b('0x36')];_0x7c67a2[_0x8c9b('0x4c')]=qs[_0x8c9b('0x4d')](_0x5f05d4[_0x8c9b('0x32')][_0x8c9b('0x4d')]);_0x7c67a2['where']=qs[_0x8c9b('0x34')](_[_0x8c9b('0x3e')](_0x5f05d4[_0x8c9b('0x32')],_0x422a35['filters']));if(_0x5f05d4[_0x8c9b('0x32')]['filter']){_0x7c67a2[_0x8c9b('0x3d')]=_['merge'](_0x7c67a2[_0x8c9b('0x3d')],{'$or':_[_0x8c9b('0x31')](_0x7c67a2['attributes'],function(_0x40ade6){var _0x6a62d0={};_0x6a62d0[_0x40ade6]={'$like':'%'+_0x5f05d4[_0x8c9b('0x32')][_0x8c9b('0x50')]+'%'};return _0x6a62d0;})});}_0x7c67a2=_['merge']({},_0x7c67a2,_0x5f05d4[_0x8c9b('0x45')]);return _0x1a60fb[_0x8c9b('0x51')](_0x7c67a2);}})['then'](function(_0x59d644){if(_0x59d644){_0x1cff2b=_0x59d644[_0x8c9b('0x39')];if(!_0x5f05d4['query']['hasOwnProperty']('nolimit')){_0x7c67a2[_0x8c9b('0x3c')]=qs[_0x8c9b('0x3c')](_0x5f05d4[_0x8c9b('0x32')][_0x8c9b('0x3c')]);_0x7c67a2[_0x8c9b('0x1e')]=qs['offset'](_0x5f05d4[_0x8c9b('0x32')][_0x8c9b('0x1e')]);}return _0x1a60fb[_0x8c9b('0x51')](_0x7c67a2);}})[_0x8c9b('0x27')](function(_0xd4eea3){if(_0xd4eea3){return _0xd4eea3?{'count':_0x1cff2b,'rows':_0xd4eea3}:null;}})[_0x8c9b('0x27')](respondWithResult(_0x18ff75,null))[_0x8c9b('0x44')](handleError(_0x18ff75,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index b43a526..7adab77 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 _0x41bc=['int_freshsales_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41bc,0x85));var _0xc41b=function(_0x1d2f7c,_0xe9915b){_0x1d2f7c=_0x1d2f7c-0x0;var _0xf5965d=_0x41bc[_0x1d2f7c];return _0xf5965d;};'use strict';var _=require(_0xc41b('0x0'));var util=require(_0xc41b('0x1'));var logger=require(_0xc41b('0x2'))(_0xc41b('0x3'));var moment=require('moment');var BPromise=require(_0xc41b('0x4'));var rp=require(_0xc41b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc41b('0x6'));var attributes=require(_0xc41b('0x7'));module[_0xc41b('0x8')]=function(_0x2c0b86,_0x3b65a6){return _0x2c0b86['define'](_0xc41b('0x9'),attributes,{'tableName':_0xc41b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefe7=['path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','util','api','bluebird','request-promise'];(function(_0xc19697,_0x262eca){var _0x3bc68f=function(_0x59cebc){while(--_0x59cebc){_0xc19697['push'](_0xc19697['shift']());}};_0x3bc68f(++_0x262eca);}(_0xefe7,0x11a));var _0x7efe=function(_0x36ea95,_0x2e3792){_0x36ea95=_0x36ea95-0x0;var _0x355dcd=_0xefe7[_0x36ea95];return _0x355dcd;};'use strict';var _=require('lodash');var util=require(_0x7efe('0x0'));var logger=require('../../config/logger')(_0x7efe('0x1'));var moment=require('moment');var BPromise=require(_0x7efe('0x2'));var rp=require(_0x7efe('0x3'));var fs=require('fs');var path=require(_0x7efe('0x4'));var rimraf=require('rimraf');var config=require(_0x7efe('0x5'));var attributes=require(_0x7efe('0x6'));module[_0x7efe('0x7')]=function(_0x3e1d22,_0x5506a4){return _0x3e1d22[_0x7efe('0x8')](_0x7efe('0x9'),attributes,{'tableName':_0x7efe('0xa'),'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 2aa93b3..d1b94e3 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 _0x17da=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x388e4e,_0x49cd53){var _0x5f5ad4=function(_0x1c37c7){while(--_0x1c37c7){_0x388e4e['push'](_0x388e4e['shift']());}};_0x5f5ad4(++_0x49cd53);}(_0x17da,0x1f2));var _0xa17d=function(_0x34e311,_0xca7350){_0x34e311=_0x34e311-0x0;var _0x31ac06=_0x17da[_0x34e311];return _0x31ac06;};'use strict';var _=require(_0xa17d('0x0'));var util=require('util');var moment=require(_0xa17d('0x1'));var BPromise=require(_0xa17d('0x2'));var rs=require(_0xa17d('0x3'));var fs=require('fs');var Redis=require(_0xa17d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa17d('0x5'));var logger=require(_0xa17d('0x6'))(_0xa17d('0x7'));var config=require('../../config/environment');var jayson=require(_0xa17d('0x8'));var client=jayson[_0xa17d('0x9')][_0xa17d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53b7fd,_0x57b561,_0x57a779){return new BPromise(function(_0x3f47d4,_0x9dcdd9){return client[_0xa17d('0xb')](_0x53b7fd,_0x57a779)[_0xa17d('0xc')](function(_0x20f1bc){logger[_0xa17d('0xd')](_0xa17d('0xe'),_0x57b561,'request\x20sent');logger[_0xa17d('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x57b561,_0xa17d('0x10'),JSON['stringify'](_0x20f1bc));if(_0x20f1bc[_0xa17d('0x11')]){if(_0x20f1bc[_0xa17d('0x11')][_0xa17d('0x12')]===0x1f4){logger[_0xa17d('0x11')](_0xa17d('0xe'),_0x57b561,_0x20f1bc[_0xa17d('0x11')]['message']);return _0x9dcdd9(_0x20f1bc[_0xa17d('0x11')][_0xa17d('0x13')]);}logger[_0xa17d('0x11')](_0xa17d('0xe'),_0x57b561,_0x20f1bc[_0xa17d('0x11')][_0xa17d('0x13')]);return _0x3f47d4(_0x20f1bc[_0xa17d('0x11')]['message']);}else{logger[_0xa17d('0xd')](_0xa17d('0xe'),_0x57b561,_0xa17d('0x10'));_0x3f47d4(_0x20f1bc[_0xa17d('0x14')][_0xa17d('0x13')]);}})['catch'](function(_0x30d057){logger[_0xa17d('0x11')](_0xa17d('0xe'),_0x57b561,_0x30d057);_0x9dcdd9(_0x30d057);});});} \ No newline at end of file +var _0xd505=['request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2072b7,_0x21fb38){var _0x36a1b7=function(_0x19bb1e){while(--_0x19bb1e){_0x2072b7['push'](_0x2072b7['shift']());}};_0x36a1b7(++_0x21fb38);}(_0xd505,0xbe));var _0x5d50=function(_0x38ccdf,_0x9d5605){_0x38ccdf=_0x38ccdf-0x0;var _0x5b483c=_0xd505[_0x38ccdf];return _0x5b483c;};'use strict';var _=require('lodash');var util=require(_0x5d50('0x0'));var moment=require('moment');var BPromise=require(_0x5d50('0x1'));var rs=require(_0x5d50('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d50('0x3'))['db'];var utils=require(_0x5d50('0x4'));var logger=require(_0x5d50('0x5'))(_0x5d50('0x6'));var config=require(_0x5d50('0x7'));var jayson=require(_0x5d50('0x8'));var client=jayson[_0x5d50('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39fd90,_0x1bd546,_0x419e1d){return new BPromise(function(_0x449df6,_0x6ae484){return client[_0x5d50('0xa')](_0x39fd90,_0x419e1d)[_0x5d50('0xb')](function(_0x58cfb8){logger[_0x5d50('0xc')](_0x5d50('0xd'),_0x1bd546,'request\x20sent');logger[_0x5d50('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x1bd546,_0x5d50('0xf'),JSON['stringify'](_0x58cfb8));if(_0x58cfb8[_0x5d50('0x10')]){if(_0x58cfb8[_0x5d50('0x10')][_0x5d50('0x11')]===0x1f4){logger['error'](_0x5d50('0xd'),_0x1bd546,_0x58cfb8[_0x5d50('0x10')][_0x5d50('0x12')]);return _0x6ae484(_0x58cfb8[_0x5d50('0x10')][_0x5d50('0x12')]);}logger[_0x5d50('0x10')](_0x5d50('0xd'),_0x1bd546,_0x58cfb8['error']['message']);return _0x449df6(_0x58cfb8[_0x5d50('0x10')]['message']);}else{logger[_0x5d50('0xc')](_0x5d50('0xd'),_0x1bd546,'request\x20sent');_0x449df6(_0x58cfb8['result'][_0x5d50('0x12')]);}})[_0x5d50('0x13')](function(_0x57b1dc){logger[_0x5d50('0x10')](_0x5d50('0xd'),_0x1bd546,_0x57b1dc);_0x6ae484(_0x57b1dc);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index d7c7b04..25dad6d 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 _0x0b96=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x0b96,0xa5));var _0x60b9=function(_0x522ae8,_0x3b637e){_0x522ae8=_0x522ae8-0x0;var _0x3189b9=_0x0b96[_0x522ae8];return _0x3189b9;};'use strict';var multer=require(_0x60b9('0x0'));var util=require(_0x60b9('0x1'));var path=require(_0x60b9('0x2'));var timeout=require('connect-timeout');var express=require(_0x60b9('0x3'));var router=express[_0x60b9('0x4')]();var fs_extra=require(_0x60b9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x60b9('0x6'));var config=require(_0x60b9('0x7'));var controller=require('./intFreshsalesField.controller');router[_0x60b9('0x8')]('/',auth[_0x60b9('0x9')](),controller[_0x60b9('0xa')]);router[_0x60b9('0x8')](_0x60b9('0xb'),auth[_0x60b9('0x9')](),controller[_0x60b9('0xc')]);router['post']('/',auth[_0x60b9('0x9')](),controller['create']);router['put'](_0x60b9('0xb'),auth[_0x60b9('0x9')](),controller[_0x60b9('0xd')]);router[_0x60b9('0xe')]('/:id',auth[_0x60b9('0x9')](),controller[_0x60b9('0xf')]);module[_0x60b9('0x10')]=router; \ No newline at end of file +var _0x324f=['../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x30b159,_0x3fbb50){var _0x23c3f9=function(_0xa21305){while(--_0xa21305){_0x30b159['push'](_0x30b159['shift']());}};_0x23c3f9(++_0x3fbb50);}(_0x324f,0x94));var _0xf324=function(_0x172445,_0xb3f0b0){_0x172445=_0x172445-0x0;var _0x246d78=_0x324f[_0x172445];return _0x246d78;};'use strict';var multer=require(_0xf324('0x0'));var util=require(_0xf324('0x1'));var path=require(_0xf324('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf324('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf324('0x4'));var interaction=require(_0xf324('0x5'));var config=require('../../config/environment');var controller=require(_0xf324('0x6'));router[_0xf324('0x7')]('/',auth['isAuthenticated'](),controller[_0xf324('0x8')]);router[_0xf324('0x7')](_0xf324('0x9'),auth[_0xf324('0xa')](),controller[_0xf324('0xb')]);router[_0xf324('0xc')]('/',auth[_0xf324('0xa')](),controller[_0xf324('0xd')]);router[_0xf324('0xe')]('/:id',auth[_0xf324('0xa')](),controller[_0xf324('0xf')]);router[_0xf324('0x10')](_0xf324('0x9'),auth['isAuthenticated'](),controller[_0xf324('0x11')]);module[_0xf324('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index ddfde68..bc57273 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 _0x11fd=['BOOLEAN','sequelize','exports','variable','customVariable','keyValue','picklist','string','STRING','ENUM'];(function(_0x27d697,_0xcab9a2){var _0x3dbadf=function(_0x25d161){while(--_0x25d161){_0x27d697['push'](_0x27d697['shift']());}};_0x3dbadf(++_0xcab9a2);}(_0x11fd,0xfb));var _0xd11f=function(_0x210c86,_0x3ea966){_0x210c86=_0x210c86-0x0;var _0xd44855=_0x11fd[_0x210c86];return _0xd44855;};'use strict';var Sequelize=require(_0xd11f('0x0'));module[_0xd11f('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xd11f('0x2'),_0xd11f('0x3'),_0xd11f('0x4'),_0xd11f('0x5')),'defaultValue':_0xd11f('0x6')},'content':{'type':Sequelize[_0xd11f('0x7')]},'key':{'type':Sequelize[_0xd11f('0x7')]},'keyType':{'type':Sequelize[_0xd11f('0x8')](_0xd11f('0x6'),'variable',_0xd11f('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd11f('0x7')]},'nameField':{'type':Sequelize[_0xd11f('0x7')]},'customField':{'type':Sequelize[_0xd11f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd11f('0x7')]}}; \ No newline at end of file +var _0xbff1=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x4eae5a,_0x49fd68){var _0xc3420e=function(_0x282b2c){while(--_0x282b2c){_0x4eae5a['push'](_0x4eae5a['shift']());}};_0xc3420e(++_0x49fd68);}(_0xbff1,0x15c));var _0x1bff=function(_0x7f14eb,_0x293155){_0x7f14eb=_0x7f14eb-0x0;var _0x554bff=_0xbff1[_0x7f14eb];return _0x554bff;};'use strict';var Sequelize=require(_0x1bff('0x0'));module[_0x1bff('0x1')]={'type':{'type':Sequelize[_0x1bff('0x2')](_0x1bff('0x3'),_0x1bff('0x4'),_0x1bff('0x5'),'keyValue',_0x1bff('0x6')),'defaultValue':_0x1bff('0x3')},'content':{'type':Sequelize[_0x1bff('0x7')]},'key':{'type':Sequelize[_0x1bff('0x7')]},'keyType':{'type':Sequelize[_0x1bff('0x2')](_0x1bff('0x3'),_0x1bff('0x4'),_0x1bff('0x5'))},'keyContent':{'type':Sequelize[_0x1bff('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1bff('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1bff('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index a864437..9273165 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 _0x8fdb=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','findAll','catch','show','params','includeAll','include','find','create','body','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','limit','undefined','count','offset','apply','reject','update','destroy','then','sendStatus','error','stack','name','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys'];(function(_0x128443,_0x2fe025){var _0x1a4ce1=function(_0x12d72c){while(--_0x12d72c){_0x128443['push'](_0x128443['shift']());}};_0x1a4ce1(++_0x2fe025);}(_0x8fdb,0x1c1));var _0xb8fd=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x8fdb[_0x46efd7];return _0x5637e4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb8fd('0x0'));var rp=require('request-promise');var moment=require(_0xb8fd('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xb8fd('0x2'));var util=require(_0xb8fd('0x3'));var path=require(_0xb8fd('0x4'));var sox=require('sox');var csv=require(_0xb8fd('0x5'));var ejs=require(_0xb8fd('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8fd('0x7'));var squel=require(_0xb8fd('0x8'));var crypto=require('crypto');var jsforce=require(_0xb8fd('0x9'));var deskjs=require(_0xb8fd('0xa'));var toCsv=require(_0xb8fd('0x5'));var querystring=require(_0xb8fd('0xb'));var Papa=require(_0xb8fd('0xc'));var Redis=require(_0xb8fd('0xd'));var authService=require(_0xb8fd('0xe'));var qs=require(_0xb8fd('0xf'));var as=require(_0xb8fd('0x10'));var hardwareService=require(_0xb8fd('0x11'));var logger=require(_0xb8fd('0x12'))(_0xb8fd('0x13'));var utils=require(_0xb8fd('0x14'));var config=require(_0xb8fd('0x15'));var licenseUtil=require(_0xb8fd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bbfac,_0x1e2452){_0x1e2452=_0x1e2452||0xcc;return function(_0x31aeb1){if(_0x31aeb1){return _0x3bbfac['sendStatus'](_0x1e2452);}return _0x3bbfac['status'](_0x1e2452)[_0xb8fd('0x17')]();};}function respondWithResult(_0x593d68,_0x16bb3b){_0x16bb3b=_0x16bb3b||0xc8;return function(_0x47d744){if(_0x47d744){return _0x593d68[_0xb8fd('0x18')](_0x16bb3b)[_0xb8fd('0x19')](_0x47d744);}};}function respondWithFilteredResult(_0x4d5a28,_0x3e6840){return function(_0x512a3c){if(_0x512a3c){var _0x289b99=typeof _0x3e6840['offset']==='undefined'&&typeof _0x3e6840[_0xb8fd('0x1a')]===_0xb8fd('0x1b');var _0x5d622d=_0x512a3c[_0xb8fd('0x1c')];var _0x4f1f1d=_0x289b99?0x0:_0x3e6840[_0xb8fd('0x1d')];var _0x635c6=_0x289b99?_0x512a3c[_0xb8fd('0x1c')]:_0x3e6840[_0xb8fd('0x1d')]+_0x3e6840[_0xb8fd('0x1a')];var _0xf052b2;if(_0x635c6>=_0x5d622d){_0x635c6=_0x5d622d;_0xf052b2=0xc8;}else{_0xf052b2=0xce;}_0x4d5a28[_0xb8fd('0x18')](_0xf052b2);return _0x4d5a28['set']('Content-Range',_0x4f1f1d+'-'+_0x635c6+'/'+_0x5d622d)[_0xb8fd('0x19')](_0x512a3c);}return null;};}function patchUpdates(_0x1a7e6e){return function(_0x4a14b8){try{jsonpatch[_0xb8fd('0x1e')](_0x4a14b8,_0x1a7e6e,!![]);}catch(_0x1e8125){return BPromise[_0xb8fd('0x1f')](_0x1e8125);}return _0x4a14b8['save']();};}function saveUpdates(_0x4e393c,_0xba9803){return function(_0x33208e){if(_0x33208e){return _0x33208e[_0xb8fd('0x20')](_0x4e393c)['then'](function(_0x21ac62){return _0x21ac62;});}return null;};}function removeEntity(_0x4e8ef1,_0x4c8321){return function(_0x2cb487){if(_0x2cb487){return _0x2cb487[_0xb8fd('0x21')]()[_0xb8fd('0x22')](function(){_0x4e8ef1[_0xb8fd('0x18')](0xcc)[_0xb8fd('0x17')]();});}};}function handleEntityNotFound(_0xf3c8da,_0x270239){return function(_0x58420b){if(!_0x58420b){_0xf3c8da[_0xb8fd('0x23')](0x194);}return _0x58420b;};}function handleError(_0x3b425e,_0x1caaa2){_0x1caaa2=_0x1caaa2||0x1f4;return function(_0x32c977){logger[_0xb8fd('0x24')](_0x32c977[_0xb8fd('0x25')]);if(_0x32c977[_0xb8fd('0x26')]){delete _0x32c977[_0xb8fd('0x26')];}_0x3b425e[_0xb8fd('0x18')](_0x1caaa2)['send'](_0x32c977);};}exports[_0xb8fd('0x27')]=function(_0x3a01fb,_0x2cfb23){var _0x299c95={},_0x1fc7e1={},_0x54438b={'count':0x0,'rows':[]};var _0xd3c83d=_[_0xb8fd('0x28')](db[_0xb8fd('0x29')][_0xb8fd('0x2a')],function(_0x10a6ad){return{'name':_0x10a6ad[_0xb8fd('0x2b')],'type':_0x10a6ad[_0xb8fd('0x2c')]['key']};});_0x1fc7e1[_0xb8fd('0x2d')]=_[_0xb8fd('0x28')](_0xd3c83d,_0xb8fd('0x26'));_0x1fc7e1[_0xb8fd('0x2e')]=_[_0xb8fd('0x2f')](_0x3a01fb[_0xb8fd('0x2e')]);_0x1fc7e1['filters']=_[_0xb8fd('0x30')](_0x1fc7e1[_0xb8fd('0x2d')],_0x1fc7e1[_0xb8fd('0x2e')]);_0x299c95[_0xb8fd('0x31')]=_[_0xb8fd('0x30')](_0x1fc7e1[_0xb8fd('0x2d')],qs[_0xb8fd('0x32')](_0x3a01fb['query']['fields']));_0x299c95['attributes']=_0x299c95[_0xb8fd('0x31')][_0xb8fd('0x33')]?_0x299c95[_0xb8fd('0x31')]:_0x1fc7e1[_0xb8fd('0x2d')];if(!_0x3a01fb[_0xb8fd('0x2e')][_0xb8fd('0x34')](_0xb8fd('0x35'))){_0x299c95['limit']=qs[_0xb8fd('0x1a')](_0x3a01fb[_0xb8fd('0x2e')][_0xb8fd('0x1a')]);_0x299c95[_0xb8fd('0x1d')]=qs[_0xb8fd('0x1d')](_0x3a01fb['query'][_0xb8fd('0x1d')]);}_0x299c95[_0xb8fd('0x36')]=qs[_0xb8fd('0x37')](_0x3a01fb['query'][_0xb8fd('0x37')]);_0x299c95[_0xb8fd('0x38')]=qs[_0xb8fd('0x39')](_[_0xb8fd('0x3a')](_0x3a01fb['query'],_0x1fc7e1[_0xb8fd('0x39')]),_0xd3c83d);if(_0x3a01fb[_0xb8fd('0x2e')]['filter']){_0x299c95[_0xb8fd('0x38')]=_['merge'](_0x299c95[_0xb8fd('0x38')],{'$or':_[_0xb8fd('0x28')](_0xd3c83d,function(_0x2286d4){if(_0x2286d4[_0xb8fd('0x2c')]!=='VIRTUAL'){var _0xf6ee5b={};_0xf6ee5b[_0x2286d4['name']]={'$like':'%'+_0x3a01fb['query'][_0xb8fd('0x3b')]+'%'};return _0xf6ee5b;}})});}_0x299c95=_[_0xb8fd('0x3c')]({},_0x299c95,_0x3a01fb[_0xb8fd('0x3d')]);var _0x1cb87c={'where':_0x299c95[_0xb8fd('0x38')]};return db['FreshsalesField']['count'](_0x1cb87c)[_0xb8fd('0x22')](function(_0xea3af0){_0x54438b[_0xb8fd('0x1c')]=_0xea3af0;if(_0x3a01fb[_0xb8fd('0x2e')]['includeAll']){_0x299c95['include']=[{'all':!![]}];}return db[_0xb8fd('0x29')][_0xb8fd('0x3e')](_0x299c95);})[_0xb8fd('0x22')](function(_0x3f4da8){_0x54438b['rows']=_0x3f4da8;return _0x54438b;})['then'](respondWithFilteredResult(_0x2cfb23,_0x299c95))[_0xb8fd('0x3f')](handleError(_0x2cfb23,null));};exports[_0xb8fd('0x40')]=function(_0x5f5a28,_0x28320d){var _0x4524ff={'raw':!![],'where':{'id':_0x5f5a28[_0xb8fd('0x41')]['id']}},_0x21cf50={};_0x21cf50[_0xb8fd('0x2d')]=_[_0xb8fd('0x2f')](db[_0xb8fd('0x29')][_0xb8fd('0x2a')]);_0x21cf50[_0xb8fd('0x2e')]=_[_0xb8fd('0x2f')](_0x5f5a28[_0xb8fd('0x2e')]);_0x21cf50[_0xb8fd('0x39')]=_[_0xb8fd('0x30')](_0x21cf50['model'],_0x21cf50['query']);_0x4524ff[_0xb8fd('0x31')]=_[_0xb8fd('0x30')](_0x21cf50[_0xb8fd('0x2d')],qs[_0xb8fd('0x32')](_0x5f5a28['query']['fields']));_0x4524ff['attributes']=_0x4524ff['attributes'][_0xb8fd('0x33')]?_0x4524ff[_0xb8fd('0x31')]:_0x21cf50[_0xb8fd('0x2d')];if(_0x5f5a28[_0xb8fd('0x2e')][_0xb8fd('0x42')]){_0x4524ff[_0xb8fd('0x43')]=[{'all':!![]}];}_0x4524ff=_[_0xb8fd('0x3c')]({},_0x4524ff,_0x5f5a28[_0xb8fd('0x3d')]);return db[_0xb8fd('0x29')][_0xb8fd('0x44')](_0x4524ff)[_0xb8fd('0x22')](handleEntityNotFound(_0x28320d,null))[_0xb8fd('0x22')](respondWithResult(_0x28320d,null))[_0xb8fd('0x3f')](handleError(_0x28320d,null));};exports[_0xb8fd('0x45')]=function(_0x4ee7b5,_0x11a429){return db[_0xb8fd('0x29')][_0xb8fd('0x45')](_0x4ee7b5[_0xb8fd('0x46')],{})[_0xb8fd('0x22')](respondWithResult(_0x11a429,0xc9))[_0xb8fd('0x3f')](handleError(_0x11a429,null));};exports['update']=function(_0x5b9494,_0x5b1048){if(_0x5b9494['body']['id']){delete _0x5b9494[_0xb8fd('0x46')]['id'];}return db[_0xb8fd('0x29')][_0xb8fd('0x44')]({'where':{'id':_0x5b9494['params']['id']}})[_0xb8fd('0x22')](handleEntityNotFound(_0x5b1048,null))['then'](saveUpdates(_0x5b9494[_0xb8fd('0x46')],null))[_0xb8fd('0x22')](respondWithResult(_0x5b1048,null))['catch'](handleError(_0x5b1048,null));};exports[_0xb8fd('0x21')]=function(_0x1bae0f,_0x5efa19){return db['FreshsalesField'][_0xb8fd('0x44')]({'where':{'id':_0x1bae0f[_0xb8fd('0x41')]['id']}})[_0xb8fd('0x22')](handleEntityNotFound(_0x5efa19,null))['then'](removeEntity(_0x5efa19,null))[_0xb8fd('0x3f')](handleError(_0x5efa19,null));}; \ No newline at end of file +var _0xc35f=['error','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','merge','where','filter','options','then','includeAll','findAll','rows','catch','show','params','find','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy'];(function(_0x5af97c,_0x24a49f){var _0x3472ae=function(_0x54cdc3){while(--_0x54cdc3){_0x5af97c['push'](_0x5af97c['shift']());}};_0x3472ae(++_0x24a49f);}(_0xc35f,0x17b));var _0xfc35=function(_0x27b914,_0x5ae1ff){_0x27b914=_0x27b914-0x0;var _0xdb7298=_0xc35f[_0x27b914];return _0xdb7298;};'use strict';var emlformat=require(_0xfc35('0x0'));var rimraf=require(_0xfc35('0x1'));var zipdir=require(_0xfc35('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc35('0x3'));var moment=require(_0xfc35('0x4'));var BPromise=require(_0xfc35('0x5'));var Mustache=require(_0xfc35('0x6'));var util=require(_0xfc35('0x7'));var path=require(_0xfc35('0x8'));var sox=require(_0xfc35('0x9'));var csv=require(_0xfc35('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc35('0xb'));var _=require('lodash');var squel=require(_0xfc35('0xc'));var crypto=require('crypto');var jsforce=require(_0xfc35('0xd'));var deskjs=require(_0xfc35('0xe'));var toCsv=require(_0xfc35('0xa'));var querystring=require(_0xfc35('0xf'));var Papa=require(_0xfc35('0x10'));var Redis=require('ioredis');var authService=require(_0xfc35('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc35('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xfc35('0x13'));var licenseUtil=require(_0xfc35('0x14'));var db=require(_0xfc35('0x15'))['db'];function respondWithStatusCode(_0x3d68e4,_0x347c5f){_0x347c5f=_0x347c5f||0xcc;return function(_0x599d58){if(_0x599d58){return _0x3d68e4[_0xfc35('0x16')](_0x347c5f);}return _0x3d68e4['status'](_0x347c5f)[_0xfc35('0x17')]();};}function respondWithResult(_0x916786,_0x1177fa){_0x1177fa=_0x1177fa||0xc8;return function(_0x56dc81){if(_0x56dc81){return _0x916786[_0xfc35('0x18')](_0x1177fa)[_0xfc35('0x19')](_0x56dc81);}};}function respondWithFilteredResult(_0x4bf259,_0x1a73c8){return function(_0x40614c){if(_0x40614c){var _0x4eb94d=typeof _0x1a73c8[_0xfc35('0x1a')]===_0xfc35('0x1b')&&typeof _0x1a73c8[_0xfc35('0x1c')]==='undefined';var _0x155e16=_0x40614c[_0xfc35('0x1d')];var _0x53f43f=_0x4eb94d?0x0:_0x1a73c8[_0xfc35('0x1a')];var _0x474169=_0x4eb94d?_0x40614c['count']:_0x1a73c8['offset']+_0x1a73c8['limit'];var _0xc99847;if(_0x474169>=_0x155e16){_0x474169=_0x155e16;_0xc99847=0xc8;}else{_0xc99847=0xce;}_0x4bf259[_0xfc35('0x18')](_0xc99847);return _0x4bf259[_0xfc35('0x1e')]('Content-Range',_0x53f43f+'-'+_0x474169+'/'+_0x155e16)[_0xfc35('0x19')](_0x40614c);}return null;};}function patchUpdates(_0x4f81b7){return function(_0x1fa138){try{jsonpatch[_0xfc35('0x1f')](_0x1fa138,_0x4f81b7,!![]);}catch(_0x5ba661){return BPromise[_0xfc35('0x20')](_0x5ba661);}return _0x1fa138[_0xfc35('0x21')]();};}function saveUpdates(_0x52febc,_0x4a95ad){return function(_0x1ca146){if(_0x1ca146){return _0x1ca146['update'](_0x52febc)['then'](function(_0x20ea58){return _0x20ea58;});}return null;};}function removeEntity(_0x6eeaee,_0x4669b8){return function(_0x24bebf){if(_0x24bebf){return _0x24bebf[_0xfc35('0x22')]()['then'](function(){_0x6eeaee[_0xfc35('0x18')](0xcc)[_0xfc35('0x17')]();});}};}function handleEntityNotFound(_0x7dfa74,_0x2328ea){return function(_0x3f065a){if(!_0x3f065a){_0x7dfa74[_0xfc35('0x16')](0x194);}return _0x3f065a;};}function handleError(_0x139f93,_0x250db2){_0x250db2=_0x250db2||0x1f4;return function(_0x25e1f3){logger[_0xfc35('0x23')](_0x25e1f3['stack']);if(_0x25e1f3[_0xfc35('0x24')]){delete _0x25e1f3[_0xfc35('0x24')];}_0x139f93['status'](_0x250db2)[_0xfc35('0x25')](_0x25e1f3);};}exports[_0xfc35('0x26')]=function(_0x219cf9,_0x122d6b){var _0x197f08={},_0x27b474={},_0x169219={'count':0x0,'rows':[]};var _0xbc2023=_[_0xfc35('0x27')](db[_0xfc35('0x28')][_0xfc35('0x29')],function(_0x48832b){return{'name':_0x48832b[_0xfc35('0x2a')],'type':_0x48832b[_0xfc35('0x2b')]['key']};});_0x27b474[_0xfc35('0x2c')]=_[_0xfc35('0x27')](_0xbc2023,'name');_0x27b474['query']=_[_0xfc35('0x2d')](_0x219cf9[_0xfc35('0x2e')]);_0x27b474[_0xfc35('0x2f')]=_['intersection'](_0x27b474[_0xfc35('0x2c')],_0x27b474['query']);_0x197f08['attributes']=_[_0xfc35('0x30')](_0x27b474[_0xfc35('0x2c')],qs[_0xfc35('0x31')](_0x219cf9[_0xfc35('0x2e')][_0xfc35('0x31')]));_0x197f08[_0xfc35('0x32')]=_0x197f08[_0xfc35('0x32')][_0xfc35('0x33')]?_0x197f08['attributes']:_0x27b474['model'];if(!_0x219cf9[_0xfc35('0x2e')][_0xfc35('0x34')](_0xfc35('0x35'))){_0x197f08[_0xfc35('0x1c')]=qs[_0xfc35('0x1c')](_0x219cf9['query'][_0xfc35('0x1c')]);_0x197f08[_0xfc35('0x1a')]=qs['offset'](_0x219cf9[_0xfc35('0x2e')][_0xfc35('0x1a')]);}_0x197f08[_0xfc35('0x36')]=qs['sort'](_0x219cf9[_0xfc35('0x2e')][_0xfc35('0x37')]);_0x197f08['where']=qs[_0xfc35('0x2f')](_['pick'](_0x219cf9[_0xfc35('0x2e')],_0x27b474[_0xfc35('0x2f')]),_0xbc2023);if(_0x219cf9[_0xfc35('0x2e')]['filter']){_0x197f08['where']=_[_0xfc35('0x38')](_0x197f08[_0xfc35('0x39')],{'$or':_[_0xfc35('0x27')](_0xbc2023,function(_0x4f9045){if(_0x4f9045[_0xfc35('0x2b')]!=='VIRTUAL'){var _0x5eb24b={};_0x5eb24b[_0x4f9045['name']]={'$like':'%'+_0x219cf9[_0xfc35('0x2e')][_0xfc35('0x3a')]+'%'};return _0x5eb24b;}})});}_0x197f08=_['merge']({},_0x197f08,_0x219cf9[_0xfc35('0x3b')]);var _0x567984={'where':_0x197f08[_0xfc35('0x39')]};return db[_0xfc35('0x28')][_0xfc35('0x1d')](_0x567984)[_0xfc35('0x3c')](function(_0x1ca4a7){_0x169219[_0xfc35('0x1d')]=_0x1ca4a7;if(_0x219cf9[_0xfc35('0x2e')][_0xfc35('0x3d')]){_0x197f08['include']=[{'all':!![]}];}return db['FreshsalesField'][_0xfc35('0x3e')](_0x197f08);})['then'](function(_0x3605b5){_0x169219[_0xfc35('0x3f')]=_0x3605b5;return _0x169219;})[_0xfc35('0x3c')](respondWithFilteredResult(_0x122d6b,_0x197f08))[_0xfc35('0x40')](handleError(_0x122d6b,null));};exports[_0xfc35('0x41')]=function(_0x4931ce,_0x41c9b5){var _0x4a96d9={'raw':!![],'where':{'id':_0x4931ce[_0xfc35('0x42')]['id']}},_0xd1e44a={};_0xd1e44a[_0xfc35('0x2c')]=_[_0xfc35('0x2d')](db[_0xfc35('0x28')]['rawAttributes']);_0xd1e44a[_0xfc35('0x2e')]=_[_0xfc35('0x2d')](_0x4931ce[_0xfc35('0x2e')]);_0xd1e44a[_0xfc35('0x2f')]=_[_0xfc35('0x30')](_0xd1e44a['model'],_0xd1e44a[_0xfc35('0x2e')]);_0x4a96d9['attributes']=_[_0xfc35('0x30')](_0xd1e44a['model'],qs[_0xfc35('0x31')](_0x4931ce[_0xfc35('0x2e')][_0xfc35('0x31')]));_0x4a96d9[_0xfc35('0x32')]=_0x4a96d9[_0xfc35('0x32')][_0xfc35('0x33')]?_0x4a96d9[_0xfc35('0x32')]:_0xd1e44a['model'];if(_0x4931ce[_0xfc35('0x2e')][_0xfc35('0x3d')]){_0x4a96d9['include']=[{'all':!![]}];}_0x4a96d9=_[_0xfc35('0x38')]({},_0x4a96d9,_0x4931ce[_0xfc35('0x3b')]);return db[_0xfc35('0x28')][_0xfc35('0x43')](_0x4a96d9)[_0xfc35('0x3c')](handleEntityNotFound(_0x41c9b5,null))[_0xfc35('0x3c')](respondWithResult(_0x41c9b5,null))['catch'](handleError(_0x41c9b5,null));};exports['create']=function(_0x11e88c,_0x52e2fa){return db[_0xfc35('0x28')]['create'](_0x11e88c[_0xfc35('0x44')],{})[_0xfc35('0x3c')](respondWithResult(_0x52e2fa,0xc9))[_0xfc35('0x40')](handleError(_0x52e2fa,null));};exports['update']=function(_0xf5b164,_0x395083){if(_0xf5b164[_0xfc35('0x44')]['id']){delete _0xf5b164[_0xfc35('0x44')]['id'];}return db[_0xfc35('0x28')][_0xfc35('0x43')]({'where':{'id':_0xf5b164[_0xfc35('0x42')]['id']}})['then'](handleEntityNotFound(_0x395083,null))['then'](saveUpdates(_0xf5b164[_0xfc35('0x44')],null))[_0xfc35('0x3c')](respondWithResult(_0x395083,null))[_0xfc35('0x40')](handleError(_0x395083,null));};exports[_0xfc35('0x22')]=function(_0x2acbe2,_0x144792){return db[_0xfc35('0x28')][_0xfc35('0x43')]({'where':{'id':_0x2acbe2['params']['id']}})[_0xfc35('0x3c')](handleEntityNotFound(_0x144792,null))[_0xfc35('0x3c')](removeEntity(_0x144792,null))['catch'](handleError(_0x144792,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index ddf9fdd..37292a1 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 _0xac35=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','freshsales_unique_index','idField'];(function(_0x3d3ca4,_0x46d385){var _0x180a39=function(_0x3307cf){while(--_0x3307cf){_0x3d3ca4['push'](_0x3d3ca4['shift']());}};_0x180a39(++_0x46d385);}(_0xac35,0x141));var _0x5ac3=function(_0x1ca0d5,_0x3960bd){_0x1ca0d5=_0x1ca0d5-0x0;var _0x3aad05=_0xac35[_0x1ca0d5];return _0x3aad05;};'use strict';var _=require(_0x5ac3('0x0'));var util=require(_0x5ac3('0x1'));var logger=require(_0x5ac3('0x2'))(_0x5ac3('0x3'));var moment=require(_0x5ac3('0x4'));var BPromise=require(_0x5ac3('0x5'));var rp=require(_0x5ac3('0x6'));var fs=require('fs');var path=require(_0x5ac3('0x7'));var rimraf=require(_0x5ac3('0x8'));var config=require(_0x5ac3('0x9'));var attributes=require(_0x5ac3('0xa'));module[_0x5ac3('0xb')]=function(_0x33a8f2,_0x13d4fb){return _0x33a8f2['define'](_0x5ac3('0xc'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x5ac3('0xd'),'fields':[_0x5ac3('0xe'),_0x5ac3('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x63ef=['idField','FieldId','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x63ef,0x11a));var _0xf63e=function(_0x29ce14,_0x334166){_0x29ce14=_0x29ce14-0x0;var _0x48f289=_0x63ef[_0x29ce14];return _0x48f289;};'use strict';var _=require(_0xf63e('0x0'));var util=require(_0xf63e('0x1'));var logger=require(_0xf63e('0x2'))('api');var moment=require(_0xf63e('0x3'));var BPromise=require(_0xf63e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf63e('0x5'));var config=require(_0xf63e('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0xf63e('0x7')]=function(_0x367f73,_0x519a33){return _0x367f73[_0xf63e('0x8')](_0xf63e('0x9'),attributes,{'tableName':_0xf63e('0xa'),'paranoid':![],'indexes':[{'name':_0xf63e('0xb'),'fields':[_0xf63e('0xc'),_0xf63e('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 9950688..d27d7af 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 _0x1883=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x16fee5,_0x392d4e){var _0x2f042a=function(_0x1d8340){while(--_0x1d8340){_0x16fee5['push'](_0x16fee5['shift']());}};_0x2f042a(++_0x392d4e);}(_0x1883,0xab));var _0x3188=function(_0x538751,_0x3217e6){_0x538751=_0x538751-0x0;var _0x52ebe8=_0x1883[_0x538751];return _0x52ebe8;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});} \ No newline at end of file +var _0x2bd8=['info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x3d8b8a,_0x39a5cd){var _0x2aa5f2=function(_0x3dfd60){while(--_0x3dfd60){_0x3d8b8a['push'](_0x3d8b8a['shift']());}};_0x2aa5f2(++_0x39a5cd);}(_0x2bd8,0x130));var _0x82bd=function(_0x2c818e,_0x48c9e1){_0x2c818e=_0x2c818e-0x0;var _0xe3f553=_0x2bd8[_0x2c818e];return _0xe3f553;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var moment=require(_0x82bd('0x1'));var BPromise=require(_0x82bd('0x2'));var rs=require(_0x82bd('0x3'));var fs=require('fs');var Redis=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];var utils=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('rpc');var config=require(_0x82bd('0x8'));var jayson=require(_0x82bd('0x9'));var client=jayson[_0x82bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){return client[_0x82bd('0xb')](_0x19dbb1,_0x226f60)['then'](function(_0x4a9b2c){logger['info'](_0x82bd('0xc'),_0x77d7a9,'request\x20sent');logger['debug'](_0x82bd('0xd'),_0x77d7a9,'request\x20sent',JSON['stringify'](_0x4a9b2c));if(_0x4a9b2c[_0x82bd('0xe')]){if(_0x4a9b2c[_0x82bd('0xe')]['code']===0x1f4){logger[_0x82bd('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x4a9b2c[_0x82bd('0xe')]['message']);return _0x4dc3a6(_0x4a9b2c[_0x82bd('0xe')][_0x82bd('0xf')]);}logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x4a9b2c['error'][_0x82bd('0xf')]);return _0x1f7463(_0x4a9b2c[_0x82bd('0xe')]['message']);}else{logger[_0x82bd('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x82bd('0x11'));_0x1f7463(_0x4a9b2c[_0x82bd('0x12')][_0x82bd('0xf')]);}})[_0x82bd('0x13')](function(_0x209081){logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x209081);_0x4dc3a6(_0x209081);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index d4c65b6..650a803 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(_0x565ddb,_0x2e3dce){var _0x1c3b57=function(_0x23d1b5){while(--_0x23d1b5){_0x565ddb['push'](_0x565ddb['shift']());}};_0x1c3b57(++_0x2e3dce);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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(_0x1eb1c8,_0x182556){var _0xa40819=function(_0xac8a6){while(--_0xac8a6){_0x1eb1c8['push'](_0x1eb1c8['shift']());}};_0xa40819(++_0x182556);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 4297ccf..0acc50d 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 _0xd481=['username','ENUM','newTab','integrationTab','sequelize','STRING'];(function(_0x1385dc,_0x2c7fd7){var _0x2f6469=function(_0x47ed8a){while(--_0x47ed8a){_0x1385dc['push'](_0x1385dc['shift']());}};_0x2f6469(++_0x2c7fd7);}(_0xd481,0x1e4));var _0x1d48=function(_0x4e1169,_0xc95789){_0x4e1169=_0x4e1169-0x0;var _0x7d531c=_0xd481[_0x4e1169];return _0x7d531c;};'use strict';var Sequelize=require(_0x1d48('0x0'));module['exports']={'name':{'type':Sequelize[_0x1d48('0x1')]},'description':{'type':Sequelize[_0x1d48('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x1d48('0x2')},'remoteUri':{'type':Sequelize[_0x1d48('0x1')]},'password':{'type':Sequelize[_0x1d48('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1d48('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1d48('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1d48('0x3')]('integrationTab',_0x1d48('0x4')),'defaultValue':_0x1d48('0x5')}}; \ No newline at end of file +var _0x7bd0=['sequelize','exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x5761d9,_0xa2fec){var _0x2b557b=function(_0x4b6c33){while(--_0x4b6c33){_0x5761d9['push'](_0x5761d9['shift']());}};_0x2b557b(++_0xa2fec);}(_0x7bd0,0x111));var _0x07bd=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x7bd0[_0xd22d95];return _0x15d7a3;};'use strict';var Sequelize=require(_0x07bd('0x0'));module[_0x07bd('0x1')]={'name':{'type':Sequelize[_0x07bd('0x2')]},'description':{'type':Sequelize[_0x07bd('0x2')]},'username':{'type':Sequelize[_0x07bd('0x2')],'unique':_0x07bd('0x3')},'remoteUri':{'type':Sequelize[_0x07bd('0x2')]},'password':{'type':Sequelize[_0x07bd('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x07bd('0x2')]},'securityToken':{'type':Sequelize[_0x07bd('0x2')]},'serverUrl':{'type':Sequelize[_0x07bd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x07bd('0x4')](_0x07bd('0x5'),_0x07bd('0x6')),'defaultValue':_0x07bd('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index cfed9ca..ce1ab27 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 _0x3a4b=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SalesforceAccount','includeAll','include','findAll','catch','keys','length','options','find','create','body','params','getConfigurations','findOne','SalesforceConfiguration','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','Subjects','getFields','Task','clientId','clientSecret','username','securityToken','remoteUri','slice','substring','Connection','login','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','textarea','phone','remove','includes','label','custom','picklistValues','value','True','False','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a4b,0x151));var _0xb3a4=function(_0x353ab7,_0x3c507b){_0x353ab7=_0x353ab7-0x0;var _0x5c663e=_0x3a4b[_0x353ab7];return _0x5c663e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb3a4('0x0'));var zipdir=require(_0xb3a4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3a4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb3a4('0x3'));var path=require('path');var sox=require(_0xb3a4('0x4'));var csv=require(_0xb3a4('0x5'));var ejs=require(_0xb3a4('0x6'));var fs=require('fs');var fs_extra=require(_0xb3a4('0x7'));var _=require(_0xb3a4('0x8'));var squel=require(_0xb3a4('0x9'));var crypto=require(_0xb3a4('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb3a4('0x5'));var querystring=require(_0xb3a4('0xb'));var Papa=require(_0xb3a4('0xc'));var Redis=require('ioredis');var authService=require(_0xb3a4('0xd'));var qs=require(_0xb3a4('0xe'));var as=require(_0xb3a4('0xf'));var hardwareService=require(_0xb3a4('0x10'));var logger=require(_0xb3a4('0x11'))(_0xb3a4('0x12'));var utils=require(_0xb3a4('0x13'));var config=require(_0xb3a4('0x14'));var licenseUtil=require(_0xb3a4('0x15'));var db=require(_0xb3a4('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5e85a4,_0x10860a){_0x10860a=_0x10860a||0xcc;return function(_0x365b13){if(_0x365b13){return _0x5e85a4['sendStatus'](_0x10860a);}return _0x5e85a4[_0xb3a4('0x17')](_0x10860a)[_0xb3a4('0x18')]();};}function respondWithResult(_0x13362d,_0x334e47){_0x334e47=_0x334e47||0xc8;return function(_0x10bdc7){if(_0x10bdc7){return _0x13362d[_0xb3a4('0x17')](_0x334e47)[_0xb3a4('0x19')](_0x10bdc7);}};}function respondWithFilteredResult(_0x2c3f2f,_0x39f600){return function(_0x4589cc){if(_0x4589cc){var _0x1dc821=typeof _0x39f600[_0xb3a4('0x1a')]===_0xb3a4('0x1b')&&typeof _0x39f600[_0xb3a4('0x1c')]===_0xb3a4('0x1b');var _0x44267b=_0x4589cc[_0xb3a4('0x1d')];var _0x463ab0=_0x1dc821?0x0:_0x39f600['offset'];var _0x8e5b5=_0x1dc821?_0x4589cc[_0xb3a4('0x1d')]:_0x39f600['offset']+_0x39f600[_0xb3a4('0x1c')];var _0x14838b;if(_0x8e5b5>=_0x44267b){_0x8e5b5=_0x44267b;_0x14838b=0xc8;}else{_0x14838b=0xce;}_0x2c3f2f[_0xb3a4('0x17')](_0x14838b);return _0x2c3f2f[_0xb3a4('0x1e')]('Content-Range',_0x463ab0+'-'+_0x8e5b5+'/'+_0x44267b)[_0xb3a4('0x19')](_0x4589cc);}return null;};}function patchUpdates(_0x1b46ba){return function(_0x6e0716){try{jsonpatch['apply'](_0x6e0716,_0x1b46ba,!![]);}catch(_0x9f1aed){return BPromise[_0xb3a4('0x1f')](_0x9f1aed);}return _0x6e0716['save']();};}function saveUpdates(_0x4725ad,_0x1e12d3){return function(_0x53adfc){if(_0x53adfc){return _0x53adfc[_0xb3a4('0x20')](_0x4725ad)[_0xb3a4('0x21')](function(_0x26df1c){return _0x26df1c;});}return null;};}function removeEntity(_0x58e238,_0x2615c9){return function(_0x5ac9e8){if(_0x5ac9e8){return _0x5ac9e8[_0xb3a4('0x22')]()[_0xb3a4('0x21')](function(){_0x58e238['status'](0xcc)[_0xb3a4('0x18')]();});}};}function handleEntityNotFound(_0x27b73f,_0x6279f9){return function(_0xeeabb){if(!_0xeeabb){_0x27b73f[_0xb3a4('0x23')](0x194);}return _0xeeabb;};}function handleError(_0x5490c4,_0x1ff82a){_0x1ff82a=_0x1ff82a||0x1f4;return function(_0x586859){logger['error'](_0x586859[_0xb3a4('0x24')]);if(_0x586859[_0xb3a4('0x25')]){delete _0x586859[_0xb3a4('0x25')];}_0x5490c4[_0xb3a4('0x17')](_0x1ff82a)[_0xb3a4('0x26')](_0x586859);};}exports['index']=function(_0x3ccd09,_0x521650){var _0x5d06d7={},_0x2c0b67={},_0x541342={'count':0x0,'rows':[]};var _0x244adb=_[_0xb3a4('0x27')](db['SalesforceAccount'][_0xb3a4('0x28')],function(_0x504924){return{'name':_0x504924[_0xb3a4('0x29')],'type':_0x504924[_0xb3a4('0x2a')][_0xb3a4('0x2b')]};});_0x2c0b67[_0xb3a4('0x2c')]=_[_0xb3a4('0x27')](_0x244adb,_0xb3a4('0x25'));_0x2c0b67['query']=_['keys'](_0x3ccd09[_0xb3a4('0x2d')]);_0x2c0b67[_0xb3a4('0x2e')]=_[_0xb3a4('0x2f')](_0x2c0b67['model'],_0x2c0b67[_0xb3a4('0x2d')]);_0x5d06d7[_0xb3a4('0x30')]=_[_0xb3a4('0x2f')](_0x2c0b67[_0xb3a4('0x2c')],qs[_0xb3a4('0x31')](_0x3ccd09['query'][_0xb3a4('0x31')]));_0x5d06d7[_0xb3a4('0x30')]=_0x5d06d7[_0xb3a4('0x30')]['length']?_0x5d06d7['attributes']:_0x2c0b67['model'];if(!_0x3ccd09[_0xb3a4('0x2d')][_0xb3a4('0x32')](_0xb3a4('0x33'))){_0x5d06d7['limit']=qs[_0xb3a4('0x1c')](_0x3ccd09[_0xb3a4('0x2d')][_0xb3a4('0x1c')]);_0x5d06d7['offset']=qs[_0xb3a4('0x1a')](_0x3ccd09[_0xb3a4('0x2d')][_0xb3a4('0x1a')]);}_0x5d06d7[_0xb3a4('0x34')]=qs[_0xb3a4('0x35')](_0x3ccd09[_0xb3a4('0x2d')]['sort']);_0x5d06d7[_0xb3a4('0x36')]=qs[_0xb3a4('0x2e')](_[_0xb3a4('0x37')](_0x3ccd09[_0xb3a4('0x2d')],_0x2c0b67[_0xb3a4('0x2e')]),_0x244adb);if(_0x3ccd09[_0xb3a4('0x2d')][_0xb3a4('0x38')]){_0x5d06d7[_0xb3a4('0x36')]=_[_0xb3a4('0x39')](_0x5d06d7['where'],{'$or':_[_0xb3a4('0x27')](_0x244adb,function(_0x1a6cde){if(_0x1a6cde['type']!==_0xb3a4('0x3a')){var _0x666847={};_0x666847[_0x1a6cde[_0xb3a4('0x25')]]={'$like':'%'+_0x3ccd09[_0xb3a4('0x2d')][_0xb3a4('0x38')]+'%'};return _0x666847;}})});}_0x5d06d7=_[_0xb3a4('0x39')]({},_0x5d06d7,_0x3ccd09['options']);var _0x294770={'where':_0x5d06d7[_0xb3a4('0x36')]};return db[_0xb3a4('0x3b')][_0xb3a4('0x1d')](_0x294770)[_0xb3a4('0x21')](function(_0x33ae97){_0x541342[_0xb3a4('0x1d')]=_0x33ae97;if(_0x3ccd09[_0xb3a4('0x2d')][_0xb3a4('0x3c')]){_0x5d06d7[_0xb3a4('0x3d')]=[{'all':!![]}];}return db[_0xb3a4('0x3b')][_0xb3a4('0x3e')](_0x5d06d7);})[_0xb3a4('0x21')](function(_0x2d4d5b){_0x541342['rows']=_0x2d4d5b;return _0x541342;})['then'](respondWithFilteredResult(_0x521650,_0x5d06d7))[_0xb3a4('0x3f')](handleError(_0x521650,null));};exports['show']=function(_0x313863,_0x1a6124){var _0x5476e5={'raw':![],'where':{'id':_0x313863['params']['id']}},_0x15510b={};_0x15510b['model']=_[_0xb3a4('0x40')](db['SalesforceAccount'][_0xb3a4('0x28')]);_0x15510b[_0xb3a4('0x2d')]=_[_0xb3a4('0x40')](_0x313863[_0xb3a4('0x2d')]);_0x15510b['filters']=_['intersection'](_0x15510b[_0xb3a4('0x2c')],_0x15510b[_0xb3a4('0x2d')]);_0x5476e5[_0xb3a4('0x30')]=_[_0xb3a4('0x2f')](_0x15510b[_0xb3a4('0x2c')],qs['fields'](_0x313863['query'][_0xb3a4('0x31')]));_0x5476e5[_0xb3a4('0x30')]=_0x5476e5['attributes'][_0xb3a4('0x41')]?_0x5476e5[_0xb3a4('0x30')]:_0x15510b[_0xb3a4('0x2c')];if(_0x313863['query'][_0xb3a4('0x3c')]){_0x5476e5['include']=[{'all':!![]}];}_0x5476e5=_[_0xb3a4('0x39')]({},_0x5476e5,_0x313863[_0xb3a4('0x42')]);return db[_0xb3a4('0x3b')][_0xb3a4('0x43')](_0x5476e5)[_0xb3a4('0x21')](handleEntityNotFound(_0x1a6124,null))[_0xb3a4('0x21')](respondWithResult(_0x1a6124,null))[_0xb3a4('0x3f')](handleError(_0x1a6124,null));};exports[_0xb3a4('0x44')]=function(_0x5c8002,_0x59aa25){return db['SalesforceAccount'][_0xb3a4('0x44')](_0x5c8002['body'],{})[_0xb3a4('0x21')](respondWithResult(_0x59aa25,0xc9))[_0xb3a4('0x3f')](handleError(_0x59aa25,null));};exports[_0xb3a4('0x20')]=function(_0x891f05,_0x53b337){if(_0x891f05[_0xb3a4('0x45')]['id']){delete _0x891f05[_0xb3a4('0x45')]['id'];}return db[_0xb3a4('0x3b')]['find']({'where':{'id':_0x891f05[_0xb3a4('0x46')]['id']}})[_0xb3a4('0x21')](handleEntityNotFound(_0x53b337,null))[_0xb3a4('0x21')](saveUpdates(_0x891f05['body'],null))[_0xb3a4('0x21')](respondWithResult(_0x53b337,null))[_0xb3a4('0x3f')](handleError(_0x53b337,null));};exports['destroy']=function(_0x4618a8,_0x2bce32){return db['SalesforceAccount'][_0xb3a4('0x43')]({'where':{'id':_0x4618a8[_0xb3a4('0x46')]['id']}})['then'](handleEntityNotFound(_0x2bce32,null))[_0xb3a4('0x21')](removeEntity(_0x2bce32,null))[_0xb3a4('0x3f')](handleError(_0x2bce32,null));};exports[_0xb3a4('0x47')]=function(_0x5dd76e,_0x59f072,_0x5c28a5){var _0x6da538={};var _0x27ee56={};var _0x46e8b5;var _0x56f1e9;return db[_0xb3a4('0x3b')][_0xb3a4('0x48')]({'where':{'id':_0x5dd76e['params']['id']}})[_0xb3a4('0x21')](handleEntityNotFound(_0x59f072,null))[_0xb3a4('0x21')](function(_0x2c4791){if(_0x2c4791){_0x46e8b5=_0x2c4791;_0x27ee56[_0xb3a4('0x2c')]=_['keys'](db[_0xb3a4('0x49')]['rawAttributes']);_0x27ee56[_0xb3a4('0x2d')]=_[_0xb3a4('0x40')](_0x5dd76e['query']);_0x27ee56[_0xb3a4('0x2e')]=_[_0xb3a4('0x2f')](_0x27ee56[_0xb3a4('0x2c')],_0x27ee56['query']);_0x6da538[_0xb3a4('0x30')]=_[_0xb3a4('0x2f')](_0x27ee56[_0xb3a4('0x2c')],qs[_0xb3a4('0x31')](_0x5dd76e[_0xb3a4('0x2d')][_0xb3a4('0x31')]));_0x6da538['attributes']=_0x6da538['attributes']['length']?_0x6da538[_0xb3a4('0x30')]:_0x27ee56['model'];_0x6da538['order']=qs[_0xb3a4('0x35')](_0x5dd76e[_0xb3a4('0x2d')]['sort']);_0x6da538[_0xb3a4('0x36')]=qs[_0xb3a4('0x2e')](_[_0xb3a4('0x37')](_0x5dd76e['query'],_0x27ee56[_0xb3a4('0x2e')]));if(_0x5dd76e[_0xb3a4('0x2d')][_0xb3a4('0x38')]){_0x6da538[_0xb3a4('0x36')]=_[_0xb3a4('0x39')](_0x6da538[_0xb3a4('0x36')],{'$or':_[_0xb3a4('0x27')](_0x6da538[_0xb3a4('0x30')],function(_0x2954e1){var _0x2b0ed3={};_0x2b0ed3[_0x2954e1]={'$like':'%'+_0x5dd76e['query']['filter']+'%'};return _0x2b0ed3;})});}_0x6da538=_[_0xb3a4('0x39')]({},_0x6da538,_0x5dd76e['options']);return _0x46e8b5['getConfigurations'](_0x6da538);}})[_0xb3a4('0x21')](function(_0x52c953){if(_0x52c953){_0x56f1e9=_0x52c953[_0xb3a4('0x41')];if(!_0x5dd76e[_0xb3a4('0x2d')][_0xb3a4('0x32')]('nolimit')){_0x6da538[_0xb3a4('0x1c')]=qs['limit'](_0x5dd76e['query']['limit']);_0x6da538[_0xb3a4('0x1a')]=qs[_0xb3a4('0x1a')](_0x5dd76e[_0xb3a4('0x2d')][_0xb3a4('0x1a')]);}return _0x46e8b5[_0xb3a4('0x47')](_0x6da538);}})[_0xb3a4('0x21')](function(_0x2c5643){if(_0x2c5643){return _0x2c5643?{'count':_0x56f1e9,'rows':_0x2c5643}:null;}})[_0xb3a4('0x21')](respondWithResult(_0x59f072,null))[_0xb3a4('0x3f')](handleError(_0x59f072,null));};exports['addConfiguration']=function(_0x107547,_0x54afff,_0x16e08c){if(_0x107547[_0xb3a4('0x45')]['id']){delete _0x107547[_0xb3a4('0x45')]['id'];}return db[_0xb3a4('0x3b')]['findOne']({'where':{'id':_0x107547[_0xb3a4('0x46')]['id']}})[_0xb3a4('0x21')](handleEntityNotFound(_0x54afff,null))['then'](function(_0x5b286f){if(_0x5b286f){_0x107547[_0xb3a4('0x45')]['AccountId']=_0x5b286f['id'];_0x107547['body']['Subjects']=integrations[_0xb3a4('0x4a')](_0x107547['body']['channel'],_0x107547[_0xb3a4('0x45')]['type']);_0x107547['body'][_0xb3a4('0x4b')]=integrations[_0xb3a4('0x4c')](_0x107547['body'][_0xb3a4('0x4d')],_0x107547[_0xb3a4('0x45')]['type']);return db[_0xb3a4('0x49')]['create'](_0x107547[_0xb3a4('0x45')],{'include':[{'model':db[_0xb3a4('0x4e')],'as':_0xb3a4('0x4f')},{'model':db[_0xb3a4('0x4e')],'as':'Descriptions'}]});}return null;})[_0xb3a4('0x21')](respondWithResult(_0x54afff,null))[_0xb3a4('0x3f')](handleError(_0x54afff,null));};exports[_0xb3a4('0x50')]=function(_0x5da9ab,_0x51f72b,_0x2ad750){var _0xbb517c;var _0xbbbe5='';var _0x45c1df=_0xb3a4('0x51');return db[_0xb3a4('0x3b')][_0xb3a4('0x48')]({'where':{'id':_0x5da9ab[_0xb3a4('0x46')]['id']},'attributes':['id','remoteUri',_0xb3a4('0x52'),_0xb3a4('0x53'),_0xb3a4('0x54'),'password',_0xb3a4('0x55')]})[_0xb3a4('0x21')](handleEntityNotFound(_0x51f72b,null))[_0xb3a4('0x21')](function(_0x32a374){if(_0x32a374){_0xbbbe5=_0x32a374[_0xb3a4('0x56')];var _0x3513e1=_0xbbbe5[_0xb3a4('0x57')](-0x1);if(_0x3513e1==='/'){_0xbbbe5=_0xbbbe5[_0xb3a4('0x58')](0x0,_0xbbbe5['lastIndexOf'](_0x3513e1));}_0xbb517c=new jsforce[(_0xb3a4('0x59'))]({'oauth2':{'loginUrl':_0xbbbe5,'clientId':_0x32a374['clientId'],'clientSecret':_0x32a374[_0xb3a4('0x53')]}});return _0xbb517c[_0xb3a4('0x5a')](_0x32a374[_0xb3a4('0x54')],_0x32a374['password'][_0xb3a4('0x5b')](_0x32a374[_0xb3a4('0x55')]));}})[_0xb3a4('0x21')](function(_0x179ce8){if(_0x179ce8){if(!_[_0xb3a4('0x5c')](_0x5da9ab['query'][_0xb3a4('0x5d')])){_0x45c1df=_0x5da9ab[_0xb3a4('0x2d')][_0xb3a4('0x5d')];}return _0xbb517c['sobject'](_0x45c1df)[_0xb3a4('0x5e')]();}})[_0xb3a4('0x21')](function(_0x2d2729){var _0x5a9c95=[_0xb3a4('0x5f'),_0xb3a4('0x60'),_0xb3a4('0x61'),_0xb3a4('0x62'),_0xb3a4('0x63'),_0xb3a4('0x64')];var _0x19b85f=[_0xb3a4('0x65'),'int',_0xb3a4('0x66'),_0xb3a4('0x67'),'email',_0xb3a4('0x68'),_0xb3a4('0x69')];if(_0x2d2729){_[_0xb3a4('0x6a')](_0x2d2729['fields'],function(_0x2753b6){return _0x5a9c95['includes'](_0x2753b6[_0xb3a4('0x25')])||!_0x19b85f[_0xb3a4('0x6b')](_0x2753b6[_0xb3a4('0x2a')]);});return{'count':_0x2d2729['fields'][_0xb3a4('0x41')],'rows':_[_0xb3a4('0x27')](_0x2d2729[_0xb3a4('0x31')],function(_0x2eee5b){return{'id':_0x2eee5b[_0xb3a4('0x25')],'name':_0x2eee5b[_0xb3a4('0x6c')],'custom':_0x2eee5b[_0xb3a4('0x6d')],'options':_0x2eee5b[_0xb3a4('0x6e')][_0xb3a4('0x41')]>0x0?_[_0xb3a4('0x27')](_0x2eee5b[_0xb3a4('0x6e')],function(_0x305263){return{'name':_0x305263[_0xb3a4('0x6c')],'value':_0x305263[_0xb3a4('0x6f')]};}):_0x2eee5b[_0xb3a4('0x2a')]==_0xb3a4('0x67')?[{'name':_0xb3a4('0x70'),'value':'true'},{'name':_0xb3a4('0x71'),'value':'false'}]:[]};})};}})[_0xb3a4('0x21')](respondWithResult(_0x51f72b,null))[_0xb3a4('0x3f')](function(_0x474372){var _0x590fc3=_0x5da9ab[_0xb3a4('0x2d')][_0xb3a4('0x72')]?0x1f4:_0x474372[_0xb3a4('0x73')]||0x1f4;logger[_0xb3a4('0x74')](_0xb3a4('0x75'),_0xb3a4('0x50'),_0x590fc3,JSON['stringify'](_0x474372));delete _0x474372[_0xb3a4('0x25')];if(_0x590fc3===0x191){_0x590fc3=0x190;}_0x51f72b[_0xb3a4('0x17')](_0x590fc3)['send'](_0x5da9ab[_0xb3a4('0x2d')][_0xb3a4('0x72')]?{'message':_0xb3a4('0x76'),'statusCode':_0x474372[_0xb3a4('0x73')]}:_0x474372);});}; \ No newline at end of file +var _0x988a=['../../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','update','then','destroy','error','stack','name','send','index','map','SalesforceAccount','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','body','find','getConfigurations','findOne','SalesforceConfiguration','rawAttributes','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','password','securityToken','Connection','username','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','picklist','boolean','email','textarea','phone','remove','includes','label','picklistValues','value','true','False','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x47367b,_0x4688ac){var _0x493c30=function(_0x527527){while(--_0x527527){_0x47367b['push'](_0x47367b['shift']());}};_0x493c30(++_0x4688ac);}(_0x988a,0xe9));var _0xa988=function(_0x31174c,_0x1d42f1){_0x31174c=_0x31174c-0x0;var _0x2af0a4=_0x988a[_0x31174c];return _0x2af0a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa988('0x0'));var zipdir=require(_0xa988('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa988('0x2'));var moment=require(_0xa988('0x3'));var BPromise=require(_0xa988('0x4'));var Mustache=require(_0xa988('0x5'));var util=require('util');var path=require(_0xa988('0x6'));var sox=require('sox');var csv=require(_0xa988('0x7'));var ejs=require(_0xa988('0x8'));var fs=require('fs');var fs_extra=require(_0xa988('0x9'));var _=require(_0xa988('0xa'));var squel=require(_0xa988('0xb'));var crypto=require('crypto');var jsforce=require(_0xa988('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa988('0xd'));var Papa=require(_0xa988('0xe'));var Redis=require(_0xa988('0xf'));var authService=require(_0xa988('0x10'));var qs=require(_0xa988('0x11'));var as=require(_0xa988('0x12'));var hardwareService=require(_0xa988('0x13'));var logger=require(_0xa988('0x14'))(_0xa988('0x15'));var utils=require(_0xa988('0x16'));var config=require(_0xa988('0x17'));var licenseUtil=require(_0xa988('0x18'));var db=require(_0xa988('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x12ffd6,_0x16142d){_0x16142d=_0x16142d||0xcc;return function(_0x3e7bc9){if(_0x3e7bc9){return _0x12ffd6[_0xa988('0x1a')](_0x16142d);}return _0x12ffd6[_0xa988('0x1b')](_0x16142d)[_0xa988('0x1c')]();};}function respondWithResult(_0x5f550a,_0x215206){_0x215206=_0x215206||0xc8;return function(_0x3c8f55){if(_0x3c8f55){return _0x5f550a[_0xa988('0x1b')](_0x215206)[_0xa988('0x1d')](_0x3c8f55);}};}function respondWithFilteredResult(_0x20726c,_0x3e079e){return function(_0x21ecbd){if(_0x21ecbd){var _0x3963b9=typeof _0x3e079e[_0xa988('0x1e')]===_0xa988('0x1f')&&typeof _0x3e079e[_0xa988('0x20')]===_0xa988('0x1f');var _0x8fbe21=_0x21ecbd[_0xa988('0x21')];var _0x46ba86=_0x3963b9?0x0:_0x3e079e[_0xa988('0x1e')];var _0x50bb9e=_0x3963b9?_0x21ecbd[_0xa988('0x21')]:_0x3e079e[_0xa988('0x1e')]+_0x3e079e['limit'];var _0x2e1a65;if(_0x50bb9e>=_0x8fbe21){_0x50bb9e=_0x8fbe21;_0x2e1a65=0xc8;}else{_0x2e1a65=0xce;}_0x20726c['status'](_0x2e1a65);return _0x20726c['set'](_0xa988('0x22'),_0x46ba86+'-'+_0x50bb9e+'/'+_0x8fbe21)[_0xa988('0x1d')](_0x21ecbd);}return null;};}function patchUpdates(_0x3bdd3c){return function(_0x5d959c){try{jsonpatch[_0xa988('0x23')](_0x5d959c,_0x3bdd3c,!![]);}catch(_0x47ad73){return BPromise[_0xa988('0x24')](_0x47ad73);}return _0x5d959c[_0xa988('0x25')]();};}function saveUpdates(_0x56f0b,_0x397b59){return function(_0x58e08c){if(_0x58e08c){return _0x58e08c[_0xa988('0x26')](_0x56f0b)[_0xa988('0x27')](function(_0x5f4360){return _0x5f4360;});}return null;};}function removeEntity(_0x422752,_0x3f81c6){return function(_0x1bfb67){if(_0x1bfb67){return _0x1bfb67[_0xa988('0x28')]()[_0xa988('0x27')](function(){_0x422752[_0xa988('0x1b')](0xcc)[_0xa988('0x1c')]();});}};}function handleEntityNotFound(_0x573999,_0x369c7a){return function(_0xb24972){if(!_0xb24972){_0x573999['sendStatus'](0x194);}return _0xb24972;};}function handleError(_0x591f73,_0x3a2deb){_0x3a2deb=_0x3a2deb||0x1f4;return function(_0x293dd0){logger[_0xa988('0x29')](_0x293dd0[_0xa988('0x2a')]);if(_0x293dd0[_0xa988('0x2b')]){delete _0x293dd0[_0xa988('0x2b')];}_0x591f73[_0xa988('0x1b')](_0x3a2deb)[_0xa988('0x2c')](_0x293dd0);};}exports[_0xa988('0x2d')]=function(_0x436144,_0x56540f){var _0x7886e3={},_0x51a520={},_0x59cfb3={'count':0x0,'rows':[]};var _0x1fa36d=_[_0xa988('0x2e')](db[_0xa988('0x2f')]['rawAttributes'],function(_0x5c18db){return{'name':_0x5c18db[_0xa988('0x30')],'type':_0x5c18db[_0xa988('0x31')][_0xa988('0x32')]};});_0x51a520['model']=_[_0xa988('0x2e')](_0x1fa36d,_0xa988('0x2b'));_0x51a520[_0xa988('0x33')]=_[_0xa988('0x34')](_0x436144[_0xa988('0x33')]);_0x51a520[_0xa988('0x35')]=_[_0xa988('0x36')](_0x51a520['model'],_0x51a520[_0xa988('0x33')]);_0x7886e3[_0xa988('0x37')]=_[_0xa988('0x36')](_0x51a520['model'],qs[_0xa988('0x38')](_0x436144[_0xa988('0x33')][_0xa988('0x38')]));_0x7886e3[_0xa988('0x37')]=_0x7886e3[_0xa988('0x37')][_0xa988('0x39')]?_0x7886e3[_0xa988('0x37')]:_0x51a520[_0xa988('0x3a')];if(!_0x436144[_0xa988('0x33')][_0xa988('0x3b')]('nolimit')){_0x7886e3[_0xa988('0x20')]=qs[_0xa988('0x20')](_0x436144[_0xa988('0x33')][_0xa988('0x20')]);_0x7886e3[_0xa988('0x1e')]=qs[_0xa988('0x1e')](_0x436144[_0xa988('0x33')][_0xa988('0x1e')]);}_0x7886e3[_0xa988('0x3c')]=qs['sort'](_0x436144[_0xa988('0x33')][_0xa988('0x3d')]);_0x7886e3[_0xa988('0x3e')]=qs[_0xa988('0x35')](_[_0xa988('0x3f')](_0x436144['query'],_0x51a520[_0xa988('0x35')]),_0x1fa36d);if(_0x436144[_0xa988('0x33')]['filter']){_0x7886e3[_0xa988('0x3e')]=_[_0xa988('0x40')](_0x7886e3[_0xa988('0x3e')],{'$or':_[_0xa988('0x2e')](_0x1fa36d,function(_0x36b59f){if(_0x36b59f['type']!==_0xa988('0x41')){var _0xfedbb6={};_0xfedbb6[_0x36b59f[_0xa988('0x2b')]]={'$like':'%'+_0x436144['query'][_0xa988('0x42')]+'%'};return _0xfedbb6;}})});}_0x7886e3=_[_0xa988('0x40')]({},_0x7886e3,_0x436144[_0xa988('0x43')]);var _0x34e70d={'where':_0x7886e3['where']};return db['SalesforceAccount']['count'](_0x34e70d)[_0xa988('0x27')](function(_0x535599){_0x59cfb3['count']=_0x535599;if(_0x436144[_0xa988('0x33')][_0xa988('0x44')]){_0x7886e3[_0xa988('0x45')]=[{'all':!![]}];}return db[_0xa988('0x2f')][_0xa988('0x46')](_0x7886e3);})[_0xa988('0x27')](function(_0x39251f){_0x59cfb3['rows']=_0x39251f;return _0x59cfb3;})[_0xa988('0x27')](respondWithFilteredResult(_0x56540f,_0x7886e3))[_0xa988('0x47')](handleError(_0x56540f,null));};exports[_0xa988('0x48')]=function(_0x3eebe4,_0x328dd7){var _0x27e3c7={'raw':![],'where':{'id':_0x3eebe4[_0xa988('0x49')]['id']}},_0x30eca9={};_0x30eca9[_0xa988('0x3a')]=_[_0xa988('0x34')](db[_0xa988('0x2f')]['rawAttributes']);_0x30eca9[_0xa988('0x33')]=_[_0xa988('0x34')](_0x3eebe4[_0xa988('0x33')]);_0x30eca9['filters']=_[_0xa988('0x36')](_0x30eca9[_0xa988('0x3a')],_0x30eca9[_0xa988('0x33')]);_0x27e3c7[_0xa988('0x37')]=_['intersection'](_0x30eca9[_0xa988('0x3a')],qs[_0xa988('0x38')](_0x3eebe4[_0xa988('0x33')][_0xa988('0x38')]));_0x27e3c7[_0xa988('0x37')]=_0x27e3c7['attributes'][_0xa988('0x39')]?_0x27e3c7[_0xa988('0x37')]:_0x30eca9[_0xa988('0x3a')];if(_0x3eebe4[_0xa988('0x33')][_0xa988('0x44')]){_0x27e3c7[_0xa988('0x45')]=[{'all':!![]}];}_0x27e3c7=_[_0xa988('0x40')]({},_0x27e3c7,_0x3eebe4['options']);return db[_0xa988('0x2f')]['find'](_0x27e3c7)[_0xa988('0x27')](handleEntityNotFound(_0x328dd7,null))[_0xa988('0x27')](respondWithResult(_0x328dd7,null))[_0xa988('0x47')](handleError(_0x328dd7,null));};exports['create']=function(_0x1b1b3e,_0x153a28){return db[_0xa988('0x2f')]['create'](_0x1b1b3e[_0xa988('0x4a')],{})['then'](respondWithResult(_0x153a28,0xc9))[_0xa988('0x47')](handleError(_0x153a28,null));};exports['update']=function(_0x5b325f,_0x5b1de3){if(_0x5b325f[_0xa988('0x4a')]['id']){delete _0x5b325f[_0xa988('0x4a')]['id'];}return db[_0xa988('0x2f')][_0xa988('0x4b')]({'where':{'id':_0x5b325f[_0xa988('0x49')]['id']}})[_0xa988('0x27')](handleEntityNotFound(_0x5b1de3,null))[_0xa988('0x27')](saveUpdates(_0x5b325f[_0xa988('0x4a')],null))[_0xa988('0x27')](respondWithResult(_0x5b1de3,null))[_0xa988('0x47')](handleError(_0x5b1de3,null));};exports[_0xa988('0x28')]=function(_0x13a132,_0x686eda){return db[_0xa988('0x2f')]['find']({'where':{'id':_0x13a132[_0xa988('0x49')]['id']}})[_0xa988('0x27')](handleEntityNotFound(_0x686eda,null))[_0xa988('0x27')](removeEntity(_0x686eda,null))['catch'](handleError(_0x686eda,null));};exports[_0xa988('0x4c')]=function(_0x341a68,_0x4da1ce,_0x249936){var _0x4b75ed={};var _0xda0780={};var _0x274e85;var _0x1a5e7c;return db['SalesforceAccount'][_0xa988('0x4d')]({'where':{'id':_0x341a68[_0xa988('0x49')]['id']}})['then'](handleEntityNotFound(_0x4da1ce,null))['then'](function(_0xebd0fb){if(_0xebd0fb){_0x274e85=_0xebd0fb;_0xda0780[_0xa988('0x3a')]=_[_0xa988('0x34')](db[_0xa988('0x4e')][_0xa988('0x4f')]);_0xda0780[_0xa988('0x33')]=_['keys'](_0x341a68['query']);_0xda0780[_0xa988('0x35')]=_['intersection'](_0xda0780['model'],_0xda0780[_0xa988('0x33')]);_0x4b75ed[_0xa988('0x37')]=_[_0xa988('0x36')](_0xda0780['model'],qs[_0xa988('0x38')](_0x341a68[_0xa988('0x33')][_0xa988('0x38')]));_0x4b75ed[_0xa988('0x37')]=_0x4b75ed[_0xa988('0x37')][_0xa988('0x39')]?_0x4b75ed[_0xa988('0x37')]:_0xda0780[_0xa988('0x3a')];_0x4b75ed[_0xa988('0x3c')]=qs[_0xa988('0x3d')](_0x341a68[_0xa988('0x33')]['sort']);_0x4b75ed[_0xa988('0x3e')]=qs['filters'](_['pick'](_0x341a68[_0xa988('0x33')],_0xda0780[_0xa988('0x35')]));if(_0x341a68[_0xa988('0x33')][_0xa988('0x42')]){_0x4b75ed[_0xa988('0x3e')]=_[_0xa988('0x40')](_0x4b75ed['where'],{'$or':_[_0xa988('0x2e')](_0x4b75ed[_0xa988('0x37')],function(_0x3677cd){var _0xd183f2={};_0xd183f2[_0x3677cd]={'$like':'%'+_0x341a68['query']['filter']+'%'};return _0xd183f2;})});}_0x4b75ed=_[_0xa988('0x40')]({},_0x4b75ed,_0x341a68[_0xa988('0x43')]);return _0x274e85[_0xa988('0x4c')](_0x4b75ed);}})['then'](function(_0x46b515){if(_0x46b515){_0x1a5e7c=_0x46b515[_0xa988('0x39')];if(!_0x341a68[_0xa988('0x33')][_0xa988('0x3b')](_0xa988('0x50'))){_0x4b75ed[_0xa988('0x20')]=qs[_0xa988('0x20')](_0x341a68[_0xa988('0x33')][_0xa988('0x20')]);_0x4b75ed[_0xa988('0x1e')]=qs[_0xa988('0x1e')](_0x341a68[_0xa988('0x33')]['offset']);}return _0x274e85[_0xa988('0x4c')](_0x4b75ed);}})[_0xa988('0x27')](function(_0x52a030){if(_0x52a030){return _0x52a030?{'count':_0x1a5e7c,'rows':_0x52a030}:null;}})['then'](respondWithResult(_0x4da1ce,null))['catch'](handleError(_0x4da1ce,null));};exports[_0xa988('0x51')]=function(_0xf5bd2c,_0xa67c3a,_0x894a1){if(_0xf5bd2c[_0xa988('0x4a')]['id']){delete _0xf5bd2c[_0xa988('0x4a')]['id'];}return db[_0xa988('0x2f')]['findOne']({'where':{'id':_0xf5bd2c[_0xa988('0x49')]['id']}})[_0xa988('0x27')](handleEntityNotFound(_0xa67c3a,null))['then'](function(_0x5a1ab1){if(_0x5a1ab1){_0xf5bd2c[_0xa988('0x4a')][_0xa988('0x52')]=_0x5a1ab1['id'];_0xf5bd2c['body'][_0xa988('0x53')]=integrations[_0xa988('0x54')](_0xf5bd2c['body'][_0xa988('0x55')],_0xf5bd2c['body'][_0xa988('0x31')]);_0xf5bd2c['body'][_0xa988('0x56')]=integrations[_0xa988('0x57')](_0xf5bd2c['body'][_0xa988('0x55')],_0xf5bd2c[_0xa988('0x4a')]['type']);return db[_0xa988('0x4e')][_0xa988('0x58')](_0xf5bd2c[_0xa988('0x4a')],{'include':[{'model':db[_0xa988('0x59')],'as':_0xa988('0x53')},{'model':db[_0xa988('0x59')],'as':_0xa988('0x56')}]});}return null;})[_0xa988('0x27')](respondWithResult(_0xa67c3a,null))[_0xa988('0x47')](handleError(_0xa67c3a,null));};exports[_0xa988('0x5a')]=function(_0x372152,_0x5e75a1,_0x442a7c){var _0x3b1f62;var _0x17df49='';var _0x3138cb=_0xa988('0x5b');return db[_0xa988('0x2f')][_0xa988('0x4d')]({'where':{'id':_0x372152[_0xa988('0x49')]['id']},'attributes':['id',_0xa988('0x5c'),_0xa988('0x5d'),_0xa988('0x5e'),'username',_0xa988('0x5f'),_0xa988('0x60')]})['then'](handleEntityNotFound(_0x5e75a1,null))['then'](function(_0x32dd1b){if(_0x32dd1b){_0x17df49=_0x32dd1b[_0xa988('0x5c')];var _0x2102fd=_0x17df49['slice'](-0x1);if(_0x2102fd==='/'){_0x17df49=_0x17df49['substring'](0x0,_0x17df49['lastIndexOf'](_0x2102fd));}_0x3b1f62=new jsforce[(_0xa988('0x61'))]({'oauth2':{'loginUrl':_0x17df49,'clientId':_0x32dd1b[_0xa988('0x5d')],'clientSecret':_0x32dd1b['clientSecret']}});return _0x3b1f62['login'](_0x32dd1b[_0xa988('0x62')],_0x32dd1b[_0xa988('0x5f')]['concat'](_0x32dd1b[_0xa988('0x60')]));}})[_0xa988('0x27')](function(_0x26d22e){if(_0x26d22e){if(!_[_0xa988('0x63')](_0x372152[_0xa988('0x33')][_0xa988('0x64')])){_0x3138cb=_0x372152[_0xa988('0x33')][_0xa988('0x64')];}return _0x3b1f62[_0xa988('0x65')](_0x3138cb)[_0xa988('0x66')]();}})[_0xa988('0x27')](function(_0x35fd7b){var _0x24294c=[_0xa988('0x67'),_0xa988('0x68'),_0xa988('0x69'),_0xa988('0x6a'),_0xa988('0x6b'),'Description'];var _0x294f85=[_0xa988('0x6c'),'int',_0xa988('0x6d'),_0xa988('0x6e'),_0xa988('0x6f'),_0xa988('0x70'),_0xa988('0x71')];if(_0x35fd7b){_[_0xa988('0x72')](_0x35fd7b['fields'],function(_0x5a0111){return _0x24294c[_0xa988('0x73')](_0x5a0111[_0xa988('0x2b')])||!_0x294f85['includes'](_0x5a0111[_0xa988('0x31')]);});return{'count':_0x35fd7b['fields']['length'],'rows':_[_0xa988('0x2e')](_0x35fd7b[_0xa988('0x38')],function(_0x80ebc4){return{'id':_0x80ebc4[_0xa988('0x2b')],'name':_0x80ebc4[_0xa988('0x74')],'custom':_0x80ebc4['custom'],'options':_0x80ebc4['picklistValues'][_0xa988('0x39')]>0x0?_[_0xa988('0x2e')](_0x80ebc4[_0xa988('0x75')],function(_0x4c72eb){return{'name':_0x4c72eb[_0xa988('0x74')],'value':_0x4c72eb[_0xa988('0x76')]};}):_0x80ebc4[_0xa988('0x31')]==_0xa988('0x6e')?[{'name':'True','value':_0xa988('0x77')},{'name':_0xa988('0x78'),'value':'false'}]:[]};})};}})[_0xa988('0x27')](respondWithResult(_0x5e75a1,null))[_0xa988('0x47')](function(_0xb80dd0){var _0x3fede1=_0x372152[_0xa988('0x33')]['test']?0x1f4:_0xb80dd0['statusCode']||0x1f4;logger[_0xa988('0x29')](_0xa988('0x79'),_0xa988('0x5a'),_0x3fede1,JSON[_0xa988('0x7a')](_0xb80dd0));delete _0xb80dd0[_0xa988('0x2b')];if(_0x3fede1===0x191){_0x3fede1=0x190;}_0x5e75a1[_0xa988('0x1b')](_0x3fede1)[_0xa988('0x2c')](_0x372152[_0xa988('0x33')][_0xa988('0x7b')]?{'message':_0xa988('0x7c'),'statusCode':_0xb80dd0['statusCode']}:_0xb80dd0);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 67b6423..b8ad0e0 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 _0x807b=['lodash','util','../../config/logger','api','bluebird','path','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts'];(function(_0x569fef,_0x49c37a){var _0x11f20b=function(_0x3721d8){while(--_0x3721d8){_0x569fef['push'](_0x569fef['shift']());}};_0x11f20b(++_0x49c37a);}(_0x807b,0x13f));var _0xb807=function(_0x9c744d,_0x7bd499){_0x9c744d=_0x9c744d-0x0;var _0x1c0718=_0x807b[_0x9c744d];return _0x1c0718;};'use strict';var _=require(_0xb807('0x0'));var util=require(_0xb807('0x1'));var logger=require(_0xb807('0x2'))(_0xb807('0x3'));var moment=require('moment');var BPromise=require(_0xb807('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb807('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb807('0x6'));var integrations=require(_0xb807('0x7'));module[_0xb807('0x8')]=function(_0x309df0,_0x689131){return _0x309df0['define'](_0xb807('0x9'),attributes,{'tableName':_0xb807('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf975=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','int_salesforce_accounts','util','../../config/logger','api','moment','path','rimraf'];(function(_0x337736,_0x4a117d){var _0x40a747=function(_0x13e9d3){while(--_0x13e9d3){_0x337736['push'](_0x337736['shift']());}};_0x40a747(++_0x4a117d);}(_0xf975,0x1c8));var _0x5f97=function(_0x312c87,_0x336076){_0x312c87=_0x312c87-0x0;var _0x3f4a1a=_0xf975[_0x312c87];return _0x3f4a1a;};'use strict';var _=require('lodash');var util=require(_0x5f97('0x0'));var logger=require(_0x5f97('0x1'))(_0x5f97('0x2'));var moment=require(_0x5f97('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f97('0x4'));var rimraf=require(_0x5f97('0x5'));var config=require(_0x5f97('0x6'));var attributes=require(_0x5f97('0x7'));var integrations=require(_0x5f97('0x8'));module['exports']=function(_0x33ef5e,_0x1e3731){return _0x33ef5e[_0x5f97('0x9')]('SalesforceAccount',attributes,{'tableName':_0x5f97('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 04693e2..c2ab2ca 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 _0x1fb4=['code','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','attributes','limit','include','map','model','stringify','ShowSalesforceAccount','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x188dc5,_0x56631f){var _0x450d46=function(_0x368e4c){while(--_0x368e4c){_0x188dc5['push'](_0x188dc5['shift']());}};_0x450d46(++_0x56631f);}(_0x1fb4,0x120));var _0x41fb=function(_0x1e2bc4,_0x360038){_0x1e2bc4=_0x1e2bc4-0x0;var _0x19a465=_0x1fb4[_0x1e2bc4];return _0x19a465;};'use strict';var _=require(_0x41fb('0x0'));var util=require(_0x41fb('0x1'));var moment=require(_0x41fb('0x2'));var BPromise=require(_0x41fb('0x3'));var rs=require(_0x41fb('0x4'));var fs=require('fs');var Redis=require(_0x41fb('0x5'));var db=require(_0x41fb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x41fb('0x7'))('rpc');var config=require(_0x41fb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x41fb('0x9')][_0x41fb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33cd84,_0x11dadf,_0x343b7a){return new BPromise(function(_0x3ba6b5,_0x456be4){return client[_0x41fb('0xb')](_0x33cd84,_0x343b7a)[_0x41fb('0xc')](function(_0x36b45b){logger[_0x41fb('0xd')](_0x41fb('0xe'),_0x11dadf,_0x41fb('0xf'));logger[_0x41fb('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x11dadf,_0x41fb('0xf'),JSON['stringify'](_0x36b45b));if(_0x36b45b[_0x41fb('0x11')]){if(_0x36b45b[_0x41fb('0x11')][_0x41fb('0x12')]===0x1f4){logger[_0x41fb('0x11')](_0x41fb('0xe'),_0x11dadf,_0x36b45b[_0x41fb('0x11')]['message']);return _0x456be4(_0x36b45b[_0x41fb('0x11')][_0x41fb('0x13')]);}logger[_0x41fb('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x11dadf,_0x36b45b['error'][_0x41fb('0x13')]);return _0x3ba6b5(_0x36b45b[_0x41fb('0x11')]['message']);}else{logger[_0x41fb('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x11dadf,_0x41fb('0xf'));_0x3ba6b5(_0x36b45b[_0x41fb('0x14')]['message']);}})[_0x41fb('0x15')](function(_0x1f5f5d){logger[_0x41fb('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x11dadf,_0x1f5f5d);_0x456be4(_0x1f5f5d);});});}exports[_0x41fb('0x16')]=function(_0x5389f9){var _0x31c53a=this;return new Promise(function(_0x567739,_0x4f0298){return db[_0x41fb('0x17')]['findAll']({'raw':_0x5389f9[_0x41fb('0x18')]?_0x5389f9[_0x41fb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5389f9[_0x41fb('0x18')]?_0x5389f9[_0x41fb('0x18')]['where']||null:null,'attributes':_0x5389f9[_0x41fb('0x18')]?_0x5389f9[_0x41fb('0x18')][_0x41fb('0x19')]||null:null,'limit':_0x5389f9[_0x41fb('0x18')]?_0x5389f9[_0x41fb('0x18')][_0x41fb('0x1a')]||null:null,'include':_0x5389f9['options']?_0x5389f9[_0x41fb('0x18')][_0x41fb('0x1b')]?_[_0x41fb('0x1c')](_0x5389f9['options'][_0x41fb('0x1b')],function(_0x4e670b){return{'model':db[_0x4e670b[_0x41fb('0x1d')]],'as':_0x4e670b['as'],'attributes':_0x4e670b['attributes'],'include':_0x4e670b[_0x41fb('0x1b')]?_[_0x41fb('0x1c')](_0x4e670b[_0x41fb('0x1b')],function(_0x1aff06){return{'model':db[_0x1aff06[_0x41fb('0x1d')]],'as':_0x1aff06['as'],'attributes':_0x1aff06[_0x41fb('0x19')],'include':_0x1aff06[_0x41fb('0x1b')]?_[_0x41fb('0x1c')](_0x1aff06[_0x41fb('0x1b')],function(_0x23b347){return{'model':db[_0x23b347[_0x41fb('0x1d')]],'as':_0x23b347['as'],'attributes':_0x23b347['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30868b){logger[_0x41fb('0xd')]('GetSalesforceAccount',_0x5389f9);logger[_0x41fb('0x10')](_0x41fb('0x16'),_0x5389f9,JSON[_0x41fb('0x1e')](_0x30868b));_0x567739(_0x30868b);})[_0x41fb('0x15')](function(_0x20733d){logger[_0x41fb('0x11')](_0x41fb('0x16'),_0x20733d[_0x41fb('0x13')],_0x5389f9);_0x4f0298(_0x31c53a[_0x41fb('0x11')](0x1f4,_0x20733d['message']));});});};exports[_0x41fb('0x1f')]=function(_0x3328ea){var _0x4057f9=this;return new Promise(function(_0x20f7cf,_0x39ed3a){return db[_0x41fb('0x17')]['find']({'raw':_0x3328ea[_0x41fb('0x18')]?_0x3328ea[_0x41fb('0x18')][_0x41fb('0x20')]===undefined?!![]:![]:!![],'where':_0x3328ea[_0x41fb('0x18')]?_0x3328ea[_0x41fb('0x18')][_0x41fb('0x21')]||null:null,'attributes':_0x3328ea[_0x41fb('0x18')]?_0x3328ea[_0x41fb('0x18')][_0x41fb('0x19')]||null:null,'include':_0x3328ea['options']?_0x3328ea[_0x41fb('0x18')]['include']?_[_0x41fb('0x1c')](_0x3328ea[_0x41fb('0x18')][_0x41fb('0x1b')],function(_0x233bfd){return{'model':db[_0x233bfd[_0x41fb('0x1d')]],'as':_0x233bfd['as'],'attributes':_0x233bfd[_0x41fb('0x19')],'include':_0x233bfd[_0x41fb('0x1b')]?_[_0x41fb('0x1c')](_0x233bfd[_0x41fb('0x1b')],function(_0x43319e){return{'model':db[_0x43319e[_0x41fb('0x1d')]],'as':_0x43319e['as'],'attributes':_0x43319e[_0x41fb('0x19')],'include':_0x43319e['include']?_[_0x41fb('0x1c')](_0x43319e[_0x41fb('0x1b')],function(_0x331e19){return{'model':db[_0x331e19[_0x41fb('0x1d')]],'as':_0x331e19['as'],'attributes':_0x331e19[_0x41fb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x41fb('0xc')](function(_0x1c1bf3){logger[_0x41fb('0xd')](_0x41fb('0x1f'),_0x3328ea);logger[_0x41fb('0x10')](_0x41fb('0x1f'),_0x3328ea,JSON[_0x41fb('0x1e')](_0x1c1bf3));_0x20f7cf(_0x1c1bf3);})[_0x41fb('0x15')](function(_0x58c8a1){logger[_0x41fb('0x11')](_0x41fb('0x1f'),_0x58c8a1['message'],_0x3328ea);_0x39ed3a(_0x4057f9[_0x41fb('0x11')](0x1f4,_0x58c8a1[_0x41fb('0x13')]));});});}; \ No newline at end of file +var _0x7939=['where','attributes','limit','map','model','include','then','debug','GetSalesforceAccount','catch','ShowSalesforceAccount','find','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','findAll','raw','options'];(function(_0x2340bd,_0x4aa281){var _0x233a59=function(_0x2b47e9){while(--_0x2b47e9){_0x2340bd['push'](_0x2340bd['shift']());}};_0x233a59(++_0x4aa281);}(_0x7939,0x11c));var _0x9793=function(_0x5272cf,_0x5460bb){_0x5272cf=_0x5272cf-0x0;var _0x5e5f62=_0x7939[_0x5272cf];return _0x5e5f62;};'use strict';var _=require('lodash');var util=require(_0x9793('0x0'));var moment=require(_0x9793('0x1'));var BPromise=require(_0x9793('0x2'));var rs=require(_0x9793('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9793('0x4'))(_0x9793('0x5'));var config=require(_0x9793('0x6'));var jayson=require(_0x9793('0x7'));var client=jayson[_0x9793('0x8')][_0x9793('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31ea17,_0x508f94,_0x1a2859){return new BPromise(function(_0x8ab0eb,_0x45bbff){return client[_0x9793('0xa')](_0x31ea17,_0x1a2859)['then'](function(_0x3901f3){logger['info'](_0x9793('0xb'),_0x508f94,_0x9793('0xc'));logger['debug'](_0x9793('0xd'),_0x508f94,_0x9793('0xc'),JSON[_0x9793('0xe')](_0x3901f3));if(_0x3901f3[_0x9793('0xf')]){if(_0x3901f3[_0x9793('0xf')]['code']===0x1f4){logger['error'](_0x9793('0xb'),_0x508f94,_0x3901f3[_0x9793('0xf')][_0x9793('0x10')]);return _0x45bbff(_0x3901f3[_0x9793('0xf')][_0x9793('0x10')]);}logger[_0x9793('0xf')](_0x9793('0xb'),_0x508f94,_0x3901f3[_0x9793('0xf')][_0x9793('0x10')]);return _0x8ab0eb(_0x3901f3[_0x9793('0xf')][_0x9793('0x10')]);}else{logger[_0x9793('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x508f94,_0x9793('0xc'));_0x8ab0eb(_0x3901f3[_0x9793('0x12')]['message']);}})['catch'](function(_0x16aa79){logger['error'](_0x9793('0xb'),_0x508f94,_0x16aa79);_0x45bbff(_0x16aa79);});});}exports['GetSalesforceAccount']=function(_0x372fd2){var _0x41617c=this;return new Promise(function(_0x3e7771,_0x5f02b3){return db['SalesforceAccount'][_0x9793('0x13')]({'raw':_0x372fd2['options']?_0x372fd2['options'][_0x9793('0x14')]===undefined?!![]:![]:!![],'where':_0x372fd2['options']?_0x372fd2[_0x9793('0x15')][_0x9793('0x16')]||null:null,'attributes':_0x372fd2[_0x9793('0x15')]?_0x372fd2[_0x9793('0x15')][_0x9793('0x17')]||null:null,'limit':_0x372fd2['options']?_0x372fd2[_0x9793('0x15')][_0x9793('0x18')]||null:null,'include':_0x372fd2['options']?_0x372fd2[_0x9793('0x15')]['include']?_[_0x9793('0x19')](_0x372fd2[_0x9793('0x15')]['include'],function(_0x4eacb2){return{'model':db[_0x4eacb2[_0x9793('0x1a')]],'as':_0x4eacb2['as'],'attributes':_0x4eacb2[_0x9793('0x17')],'include':_0x4eacb2[_0x9793('0x1b')]?_['map'](_0x4eacb2[_0x9793('0x1b')],function(_0xd94215){return{'model':db[_0xd94215[_0x9793('0x1a')]],'as':_0xd94215['as'],'attributes':_0xd94215[_0x9793('0x17')],'include':_0xd94215[_0x9793('0x1b')]?_[_0x9793('0x19')](_0xd94215[_0x9793('0x1b')],function(_0x38ddbf){return{'model':db[_0x38ddbf[_0x9793('0x1a')]],'as':_0x38ddbf['as'],'attributes':_0x38ddbf[_0x9793('0x17')]};}):[]};}):[]};}):[]:[]})[_0x9793('0x1c')](function(_0xf8e48d){logger[_0x9793('0x11')]('GetSalesforceAccount',_0x372fd2);logger[_0x9793('0x1d')](_0x9793('0x1e'),_0x372fd2,JSON[_0x9793('0xe')](_0xf8e48d));_0x3e7771(_0xf8e48d);})[_0x9793('0x1f')](function(_0x481e8a){logger[_0x9793('0xf')](_0x9793('0x1e'),_0x481e8a['message'],_0x372fd2);_0x5f02b3(_0x41617c[_0x9793('0xf')](0x1f4,_0x481e8a[_0x9793('0x10')]));});});};exports[_0x9793('0x20')]=function(_0x53ba5f){var _0x3afde6=this;return new Promise(function(_0x3a8897,_0x35e785){return db['SalesforceAccount'][_0x9793('0x21')]({'raw':_0x53ba5f[_0x9793('0x15')]?_0x53ba5f['options'][_0x9793('0x14')]===undefined?!![]:![]:!![],'where':_0x53ba5f[_0x9793('0x15')]?_0x53ba5f['options'][_0x9793('0x16')]||null:null,'attributes':_0x53ba5f[_0x9793('0x15')]?_0x53ba5f[_0x9793('0x15')][_0x9793('0x17')]||null:null,'include':_0x53ba5f[_0x9793('0x15')]?_0x53ba5f[_0x9793('0x15')][_0x9793('0x1b')]?_[_0x9793('0x19')](_0x53ba5f[_0x9793('0x15')][_0x9793('0x1b')],function(_0x3e8a6f){return{'model':db[_0x3e8a6f[_0x9793('0x1a')]],'as':_0x3e8a6f['as'],'attributes':_0x3e8a6f['attributes'],'include':_0x3e8a6f[_0x9793('0x1b')]?_[_0x9793('0x19')](_0x3e8a6f[_0x9793('0x1b')],function(_0x56ec91){return{'model':db[_0x56ec91['model']],'as':_0x56ec91['as'],'attributes':_0x56ec91['attributes'],'include':_0x56ec91[_0x9793('0x1b')]?_['map'](_0x56ec91[_0x9793('0x1b')],function(_0x41d93a){return{'model':db[_0x41d93a[_0x9793('0x1a')]],'as':_0x41d93a['as'],'attributes':_0x41d93a[_0x9793('0x17')]};}):[]};}):[]};}):[]:[]})[_0x9793('0x1c')](function(_0x74cd7){logger[_0x9793('0x11')](_0x9793('0x20'),_0x53ba5f);logger['debug'](_0x9793('0x20'),_0x53ba5f,JSON[_0x9793('0xe')](_0x74cd7));_0x3a8897(_0x74cd7);})[_0x9793('0x1f')](function(_0x1ff1c8){logger[_0x9793('0xf')]('ShowSalesforceAccount',_0x1ff1c8['message'],_0x53ba5f);_0x35e785(_0x3afde6[_0x9793('0xf')](0x1f4,_0x1ff1c8[_0x9793('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 037af67..1b9b7e7 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 _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x19781c,_0x40d6c2){var _0x4828f6=function(_0x198070){while(--_0x198070){_0x19781c['push'](_0x19781c['shift']());}};_0x4828f6(++_0x40d6c2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +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(_0x90a867,_0x4eccd2){var _0x290381=function(_0x2830f5){while(--_0x2830f5){_0x90a867['push'](_0x90a867['shift']());}};_0x290381(++_0x4eccd2);}(_0x2ef3,0xba));var _0x32ef=function(_0x2cc36e,_0x312139){_0x2cc36e=_0x2cc36e-0x0;var _0x5ed960=_0x2ef3[_0x2cc36e];return _0x5ed960;};'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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 218ecb5..56944f4 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 _0xc120=['contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','STRING','Case','Task','ENUM'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xc120,0x1be));var _0x0c12=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xc120[_0xbe200f];return _0x192597;};'use strict';var Sequelize=require(_0x0c12('0x0'));module['exports']={'name':{'type':Sequelize[_0x0c12('0x1')]},'description':{'type':Sequelize[_0x0c12('0x1')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0x0c12('0x2')),'defaultValue':_0x0c12('0x3')},'moduleSearch':{'type':Sequelize[_0x0c12('0x4')](_0x0c12('0x5'),_0x0c12('0x6'),_0x0c12('0x7'),_0x0c12('0x8'),_0x0c12('0x9')),'defaultValue':_0x0c12('0x5')},'moduleCreate':{'type':Sequelize[_0x0c12('0x4')](_0x0c12('0xa'),_0x0c12('0x6'),_0x0c12('0x7'),_0x0c12('0x9')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x0c12('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x0c12('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x0c12('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x0c12('0x1')]}}; \ No newline at end of file +var _0xb4f4=['STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','sequelize','exports'];(function(_0x469607,_0x2185ca){var _0x216d2c=function(_0x247939){while(--_0x247939){_0x469607['push'](_0x469607['shift']());}};_0x216d2c(++_0x2185ca);}(_0xb4f4,0xda));var _0x4b4f=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xb4f4[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require(_0x4b4f('0x0'));module[_0x4b4f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4b4f('0x2')]},'ticketType':{'type':Sequelize[_0x4b4f('0x3')](_0x4b4f('0x4'),_0x4b4f('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x4b4f('0x3')](_0x4b4f('0x6'),_0x4b4f('0x7'),_0x4b4f('0x8'),_0x4b4f('0x9'),_0x4b4f('0xa')),'defaultValue':_0x4b4f('0x6')},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0x4b4f('0x7'),_0x4b4f('0x8'),_0x4b4f('0xa')),'defaultValue':_0x4b4f('0x8')},'leadId':{'type':Sequelize[_0x4b4f('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x4b4f('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x4b4f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 4095795..a3bfc10 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 _0xefa7=['SalesforceConfiguration','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','options','includeAll','findAll','rows','show','params','length','include','catch','create','body','find','getFields','findOne','getSubjects','pick','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map'];(function(_0x116023,_0x2f561b){var _0x20074c=function(_0x5cec36){while(--_0x5cec36){_0x116023['push'](_0x116023['shift']());}};_0x20074c(++_0x2f561b);}(_0xefa7,0xc5));var _0x7efa=function(_0x304d0e,_0x4e2e3c){_0x304d0e=_0x304d0e-0x0;var _0x2f9310=_0xefa7[_0x304d0e];return _0x2f9310;};'use strict';var emlformat=require(_0x7efa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7efa('0x1'));var jsonpatch=require(_0x7efa('0x2'));var rp=require(_0x7efa('0x3'));var moment=require(_0x7efa('0x4'));var BPromise=require(_0x7efa('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7efa('0x6'));var sox=require(_0x7efa('0x7'));var csv=require(_0x7efa('0x8'));var ejs=require(_0x7efa('0x9'));var fs=require('fs');var fs_extra=require(_0x7efa('0xa'));var _=require(_0x7efa('0xb'));var squel=require(_0x7efa('0xc'));var crypto=require(_0x7efa('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7efa('0xe'));var toCsv=require(_0x7efa('0x8'));var querystring=require(_0x7efa('0xf'));var Papa=require(_0x7efa('0x10'));var Redis=require(_0x7efa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7efa('0x12'));var as=require(_0x7efa('0x13'));var hardwareService=require(_0x7efa('0x14'));var logger=require('../../config/logger')(_0x7efa('0x15'));var utils=require(_0x7efa('0x16'));var config=require(_0x7efa('0x17'));var licenseUtil=require(_0x7efa('0x18'));var db=require(_0x7efa('0x19'))['db'];function respondWithStatusCode(_0x46bc4b,_0x1e81dd){_0x1e81dd=_0x1e81dd||0xcc;return function(_0x466037){if(_0x466037){return _0x46bc4b[_0x7efa('0x1a')](_0x1e81dd);}return _0x46bc4b[_0x7efa('0x1b')](_0x1e81dd)[_0x7efa('0x1c')]();};}function respondWithResult(_0x2ba684,_0x387e1a){_0x387e1a=_0x387e1a||0xc8;return function(_0x5b8500){if(_0x5b8500){return _0x2ba684['status'](_0x387e1a)[_0x7efa('0x1d')](_0x5b8500);}};}function respondWithFilteredResult(_0x34a8d5,_0x4da556){return function(_0xa1318e){if(_0xa1318e){var _0x1ae231=typeof _0x4da556[_0x7efa('0x1e')]===_0x7efa('0x1f')&&typeof _0x4da556[_0x7efa('0x20')]==='undefined';var _0x4f2788=_0xa1318e[_0x7efa('0x21')];var _0x46d8e0=_0x1ae231?0x0:_0x4da556[_0x7efa('0x1e')];var _0x1df18d=_0x1ae231?_0xa1318e['count']:_0x4da556['offset']+_0x4da556['limit'];var _0x22ba62;if(_0x1df18d>=_0x4f2788){_0x1df18d=_0x4f2788;_0x22ba62=0xc8;}else{_0x22ba62=0xce;}_0x34a8d5[_0x7efa('0x1b')](_0x22ba62);return _0x34a8d5[_0x7efa('0x22')](_0x7efa('0x23'),_0x46d8e0+'-'+_0x1df18d+'/'+_0x4f2788)[_0x7efa('0x1d')](_0xa1318e);}return null;};}function patchUpdates(_0x3cb60e){return function(_0x379dca){try{jsonpatch[_0x7efa('0x24')](_0x379dca,_0x3cb60e,!![]);}catch(_0x387779){return BPromise['reject'](_0x387779);}return _0x379dca[_0x7efa('0x25')]();};}function saveUpdates(_0x2b5f5c,_0x3bb54e){return function(_0x4bbcda){if(_0x4bbcda){return _0x4bbcda[_0x7efa('0x26')](_0x2b5f5c)[_0x7efa('0x27')](function(_0x35885a){return _0x35885a;});}return null;};}function removeEntity(_0x2a5891,_0x3a043c){return function(_0x4b94e6){if(_0x4b94e6){return _0x4b94e6[_0x7efa('0x28')]()['then'](function(){_0x2a5891[_0x7efa('0x1b')](0xcc)[_0x7efa('0x1c')]();});}};}function handleEntityNotFound(_0x500d6e,_0x17d9e6){return function(_0x52b47f){if(!_0x52b47f){_0x500d6e[_0x7efa('0x1a')](0x194);}return _0x52b47f;};}function handleError(_0x1b037a,_0x482276){_0x482276=_0x482276||0x1f4;return function(_0x5397cd){logger[_0x7efa('0x29')](_0x5397cd['stack']);if(_0x5397cd[_0x7efa('0x2a')]){delete _0x5397cd[_0x7efa('0x2a')];}_0x1b037a['status'](_0x482276)[_0x7efa('0x2b')](_0x5397cd);};}exports[_0x7efa('0x2c')]=function(_0x181276,_0x2706b8){var _0x152f41={},_0x3eec9b={},_0x22f992={'count':0x0,'rows':[]};var _0xb38720=_[_0x7efa('0x2d')](db[_0x7efa('0x2e')][_0x7efa('0x2f')],function(_0x9e6c98){return{'name':_0x9e6c98['fieldName'],'type':_0x9e6c98['type'][_0x7efa('0x30')]};});_0x3eec9b[_0x7efa('0x31')]=_[_0x7efa('0x2d')](_0xb38720,_0x7efa('0x2a'));_0x3eec9b[_0x7efa('0x32')]=_[_0x7efa('0x33')](_0x181276['query']);_0x3eec9b[_0x7efa('0x34')]=_[_0x7efa('0x35')](_0x3eec9b[_0x7efa('0x31')],_0x3eec9b[_0x7efa('0x32')]);_0x152f41[_0x7efa('0x36')]=_[_0x7efa('0x35')](_0x3eec9b[_0x7efa('0x31')],qs[_0x7efa('0x37')](_0x181276[_0x7efa('0x32')][_0x7efa('0x37')]));_0x152f41[_0x7efa('0x36')]=_0x152f41[_0x7efa('0x36')]['length']?_0x152f41[_0x7efa('0x36')]:_0x3eec9b[_0x7efa('0x31')];if(!_0x181276['query'][_0x7efa('0x38')](_0x7efa('0x39'))){_0x152f41[_0x7efa('0x20')]=qs[_0x7efa('0x20')](_0x181276[_0x7efa('0x32')][_0x7efa('0x20')]);_0x152f41[_0x7efa('0x1e')]=qs['offset'](_0x181276[_0x7efa('0x32')][_0x7efa('0x1e')]);}_0x152f41[_0x7efa('0x3a')]=qs['sort'](_0x181276['query'][_0x7efa('0x3b')]);_0x152f41['where']=qs[_0x7efa('0x34')](_['pick'](_0x181276[_0x7efa('0x32')],_0x3eec9b['filters']),_0xb38720);if(_0x181276[_0x7efa('0x32')][_0x7efa('0x3c')]){_0x152f41[_0x7efa('0x3d')]=_[_0x7efa('0x3e')](_0x152f41['where'],{'$or':_[_0x7efa('0x2d')](_0xb38720,function(_0x100c4f){if(_0x100c4f[_0x7efa('0x3f')]!=='VIRTUAL'){var _0x2db298={};_0x2db298[_0x100c4f[_0x7efa('0x2a')]]={'$like':'%'+_0x181276['query']['filter']+'%'};return _0x2db298;}})});}_0x152f41=_[_0x7efa('0x3e')]({},_0x152f41,_0x181276[_0x7efa('0x40')]);var _0x30969b={'where':_0x152f41[_0x7efa('0x3d')]};return db[_0x7efa('0x2e')][_0x7efa('0x21')](_0x30969b)['then'](function(_0x2151da){_0x22f992[_0x7efa('0x21')]=_0x2151da;if(_0x181276[_0x7efa('0x32')][_0x7efa('0x41')]){_0x152f41['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x7efa('0x42')](_0x152f41);})[_0x7efa('0x27')](function(_0x1ff1c9){_0x22f992[_0x7efa('0x43')]=_0x1ff1c9;return _0x22f992;})[_0x7efa('0x27')](respondWithFilteredResult(_0x2706b8,_0x152f41))['catch'](handleError(_0x2706b8,null));};exports[_0x7efa('0x44')]=function(_0x5d3d8d,_0x3b7912){var _0x652b96={'raw':![],'where':{'id':_0x5d3d8d[_0x7efa('0x45')]['id']}},_0x4eab0d={};_0x4eab0d[_0x7efa('0x31')]=_['keys'](db[_0x7efa('0x2e')][_0x7efa('0x2f')]);_0x4eab0d['query']=_[_0x7efa('0x33')](_0x5d3d8d['query']);_0x4eab0d['filters']=_['intersection'](_0x4eab0d['model'],_0x4eab0d['query']);_0x652b96[_0x7efa('0x36')]=_['intersection'](_0x4eab0d[_0x7efa('0x31')],qs[_0x7efa('0x37')](_0x5d3d8d['query'][_0x7efa('0x37')]));_0x652b96[_0x7efa('0x36')]=_0x652b96['attributes'][_0x7efa('0x46')]?_0x652b96[_0x7efa('0x36')]:_0x4eab0d[_0x7efa('0x31')];if(_0x5d3d8d[_0x7efa('0x32')][_0x7efa('0x41')]){_0x652b96[_0x7efa('0x47')]=[{'all':!![]}];}_0x652b96=_['merge']({},_0x652b96,_0x5d3d8d[_0x7efa('0x40')]);return db[_0x7efa('0x2e')]['find'](_0x652b96)[_0x7efa('0x27')](handleEntityNotFound(_0x3b7912,null))[_0x7efa('0x27')](respondWithResult(_0x3b7912,null))[_0x7efa('0x48')](handleError(_0x3b7912,null));};exports[_0x7efa('0x49')]=function(_0x2ec1e9,_0x4998a8){return db[_0x7efa('0x2e')][_0x7efa('0x49')](_0x2ec1e9[_0x7efa('0x4a')],{})[_0x7efa('0x27')](respondWithResult(_0x4998a8,0xc9))[_0x7efa('0x48')](handleError(_0x4998a8,null));};exports[_0x7efa('0x26')]=function(_0x3db066,_0x4aecef){if(_0x3db066[_0x7efa('0x4a')]['id']){delete _0x3db066['body']['id'];}return db[_0x7efa('0x2e')][_0x7efa('0x4b')]({'where':{'id':_0x3db066[_0x7efa('0x45')]['id']}})[_0x7efa('0x27')](handleEntityNotFound(_0x4aecef,null))[_0x7efa('0x27')](saveUpdates(_0x3db066['body'],null))[_0x7efa('0x27')](respondWithResult(_0x4aecef,null))[_0x7efa('0x48')](handleError(_0x4aecef,null));};exports[_0x7efa('0x28')]=function(_0x28c83e,_0x4b52d3){return db[_0x7efa('0x2e')][_0x7efa('0x4b')]({'where':{'id':_0x28c83e[_0x7efa('0x45')]['id']}})[_0x7efa('0x27')](handleEntityNotFound(_0x4b52d3,null))[_0x7efa('0x27')](removeEntity(_0x4b52d3,null))[_0x7efa('0x48')](handleError(_0x4b52d3,null));};exports[_0x7efa('0x4c')]=function(_0x2cb45f,_0x111396,_0x490d01){var _0xe33e14={};var _0x1b8b8f={};var _0x5331d8;var _0x1177d5;return db[_0x7efa('0x2e')][_0x7efa('0x4d')]({'where':{'id':_0x2cb45f[_0x7efa('0x45')]['id']}})[_0x7efa('0x27')](handleEntityNotFound(_0x111396,null))['then'](function(_0x279fd3){if(_0x279fd3){_0x5331d8=_0x279fd3;_0x1b8b8f[_0x7efa('0x31')]=_[_0x7efa('0x33')](db['SalesforceField'][_0x7efa('0x2f')]);_0x1b8b8f[_0x7efa('0x32')]=_['keys'](_0x2cb45f['query']);_0x1b8b8f[_0x7efa('0x34')]=_[_0x7efa('0x35')](_0x1b8b8f[_0x7efa('0x31')],_0x1b8b8f[_0x7efa('0x32')]);_0xe33e14[_0x7efa('0x36')]=_[_0x7efa('0x35')](_0x1b8b8f[_0x7efa('0x31')],qs['fields'](_0x2cb45f[_0x7efa('0x32')][_0x7efa('0x37')]));_0xe33e14['attributes']=_0xe33e14[_0x7efa('0x36')][_0x7efa('0x46')]?_0xe33e14['attributes']:_0x1b8b8f['model'];_0xe33e14['order']=qs[_0x7efa('0x3b')](_0x2cb45f[_0x7efa('0x32')][_0x7efa('0x3b')]);_0xe33e14[_0x7efa('0x3d')]=qs[_0x7efa('0x34')](_['pick'](_0x2cb45f[_0x7efa('0x32')],_0x1b8b8f[_0x7efa('0x34')]));if(_0x2cb45f[_0x7efa('0x32')][_0x7efa('0x3c')]){_0xe33e14[_0x7efa('0x3d')]=_[_0x7efa('0x3e')](_0xe33e14['where'],{'$or':_['map'](_0xe33e14[_0x7efa('0x36')],function(_0x3ca871){var _0x4d53e5={};_0x4d53e5[_0x3ca871]={'$like':'%'+_0x2cb45f[_0x7efa('0x32')][_0x7efa('0x3c')]+'%'};return _0x4d53e5;})});}_0xe33e14=_['merge']({},_0xe33e14,_0x2cb45f['options']);return _0x5331d8['getFields'](_0xe33e14);}})[_0x7efa('0x27')](function(_0xb44bb1){if(_0xb44bb1){_0x1177d5=_0xb44bb1[_0x7efa('0x46')];if(!_0x2cb45f[_0x7efa('0x32')][_0x7efa('0x38')](_0x7efa('0x39'))){_0xe33e14['limit']=qs['limit'](_0x2cb45f['query'][_0x7efa('0x20')]);_0xe33e14['offset']=qs['offset'](_0x2cb45f['query'][_0x7efa('0x1e')]);}return _0x5331d8[_0x7efa('0x4c')](_0xe33e14);}})[_0x7efa('0x27')](function(_0x354dc6){if(_0x354dc6){return _0x354dc6?{'count':_0x1177d5,'rows':_0x354dc6}:null;}})['then'](respondWithResult(_0x111396,null))[_0x7efa('0x48')](handleError(_0x111396,null));};exports[_0x7efa('0x4e')]=function(_0x5a35ab,_0x1f45b5,_0x341573){var _0x22c62f={};var _0x4c533a={};var _0x36007c;var _0x7fe196;return db[_0x7efa('0x2e')][_0x7efa('0x4d')]({'where':{'id':_0x5a35ab['params']['id']}})[_0x7efa('0x27')](handleEntityNotFound(_0x1f45b5,null))[_0x7efa('0x27')](function(_0x4352dc){if(_0x4352dc){_0x36007c=_0x4352dc;_0x4c533a[_0x7efa('0x31')]=_[_0x7efa('0x33')](db['SalesforceField'][_0x7efa('0x2f')]);_0x4c533a[_0x7efa('0x32')]=_[_0x7efa('0x33')](_0x5a35ab[_0x7efa('0x32')]);_0x4c533a['filters']=_[_0x7efa('0x35')](_0x4c533a['model'],_0x4c533a[_0x7efa('0x32')]);_0x22c62f[_0x7efa('0x36')]=_[_0x7efa('0x35')](_0x4c533a[_0x7efa('0x31')],qs['fields'](_0x5a35ab[_0x7efa('0x32')][_0x7efa('0x37')]));_0x22c62f[_0x7efa('0x36')]=_0x22c62f[_0x7efa('0x36')][_0x7efa('0x46')]?_0x22c62f[_0x7efa('0x36')]:_0x4c533a[_0x7efa('0x31')];_0x22c62f[_0x7efa('0x3a')]=qs[_0x7efa('0x3b')](_0x5a35ab[_0x7efa('0x32')][_0x7efa('0x3b')]);_0x22c62f[_0x7efa('0x3d')]=qs['filters'](_['pick'](_0x5a35ab['query'],_0x4c533a[_0x7efa('0x34')]));if(_0x5a35ab[_0x7efa('0x32')][_0x7efa('0x3c')]){_0x22c62f[_0x7efa('0x3d')]=_[_0x7efa('0x3e')](_0x22c62f[_0x7efa('0x3d')],{'$or':_[_0x7efa('0x2d')](_0x22c62f['attributes'],function(_0x4c2eb4){var _0x34fa9f={};_0x34fa9f[_0x4c2eb4]={'$like':'%'+_0x5a35ab['query'][_0x7efa('0x3c')]+'%'};return _0x34fa9f;})});}_0x22c62f=_[_0x7efa('0x3e')]({},_0x22c62f,_0x5a35ab['options']);return _0x36007c[_0x7efa('0x4e')](_0x22c62f);}})[_0x7efa('0x27')](function(_0x15a28e){if(_0x15a28e){_0x7fe196=_0x15a28e[_0x7efa('0x46')];if(!_0x5a35ab[_0x7efa('0x32')][_0x7efa('0x38')](_0x7efa('0x39'))){_0x22c62f[_0x7efa('0x20')]=qs[_0x7efa('0x20')](_0x5a35ab['query'][_0x7efa('0x20')]);_0x22c62f['offset']=qs[_0x7efa('0x1e')](_0x5a35ab['query'][_0x7efa('0x1e')]);}return _0x36007c[_0x7efa('0x4e')](_0x22c62f);}})[_0x7efa('0x27')](function(_0x30cc3a){if(_0x30cc3a){return _0x30cc3a?{'count':_0x7fe196,'rows':_0x30cc3a}:null;}})['then'](respondWithResult(_0x1f45b5,null))[_0x7efa('0x48')](handleError(_0x1f45b5,null));};exports['getDescriptions']=function(_0x20ada9,_0x2418a6,_0x55c3c6){var _0x2bcc43={};var _0x5ab4fd={};var _0x15cf6d;var _0x57d60c;return db[_0x7efa('0x2e')][_0x7efa('0x4d')]({'where':{'id':_0x20ada9['params']['id']}})['then'](handleEntityNotFound(_0x2418a6,null))[_0x7efa('0x27')](function(_0x7d5f72){if(_0x7d5f72){_0x15cf6d=_0x7d5f72;_0x5ab4fd['model']=_[_0x7efa('0x33')](db['SalesforceField']['rawAttributes']);_0x5ab4fd['query']=_[_0x7efa('0x33')](_0x20ada9['query']);_0x5ab4fd['filters']=_['intersection'](_0x5ab4fd['model'],_0x5ab4fd[_0x7efa('0x32')]);_0x2bcc43['attributes']=_[_0x7efa('0x35')](_0x5ab4fd[_0x7efa('0x31')],qs[_0x7efa('0x37')](_0x20ada9[_0x7efa('0x32')][_0x7efa('0x37')]));_0x2bcc43[_0x7efa('0x36')]=_0x2bcc43[_0x7efa('0x36')][_0x7efa('0x46')]?_0x2bcc43['attributes']:_0x5ab4fd[_0x7efa('0x31')];_0x2bcc43['order']=qs['sort'](_0x20ada9[_0x7efa('0x32')][_0x7efa('0x3b')]);_0x2bcc43['where']=qs[_0x7efa('0x34')](_[_0x7efa('0x4f')](_0x20ada9[_0x7efa('0x32')],_0x5ab4fd[_0x7efa('0x34')]));if(_0x20ada9[_0x7efa('0x32')][_0x7efa('0x3c')]){_0x2bcc43[_0x7efa('0x3d')]=_['merge'](_0x2bcc43[_0x7efa('0x3d')],{'$or':_[_0x7efa('0x2d')](_0x2bcc43[_0x7efa('0x36')],function(_0x4b8d88){var _0x12160a={};_0x12160a[_0x4b8d88]={'$like':'%'+_0x20ada9[_0x7efa('0x32')][_0x7efa('0x3c')]+'%'};return _0x12160a;})});}_0x2bcc43=_[_0x7efa('0x3e')]({},_0x2bcc43,_0x20ada9[_0x7efa('0x40')]);return _0x15cf6d[_0x7efa('0x50')](_0x2bcc43);}})[_0x7efa('0x27')](function(_0x715beb){if(_0x715beb){_0x57d60c=_0x715beb[_0x7efa('0x46')];if(!_0x20ada9[_0x7efa('0x32')][_0x7efa('0x38')](_0x7efa('0x39'))){_0x2bcc43['limit']=qs[_0x7efa('0x20')](_0x20ada9['query'][_0x7efa('0x20')]);_0x2bcc43[_0x7efa('0x1e')]=qs[_0x7efa('0x1e')](_0x20ada9[_0x7efa('0x32')]['offset']);}return _0x15cf6d[_0x7efa('0x50')](_0x2bcc43);}})[_0x7efa('0x27')](function(_0x253bcc){if(_0x253bcc){return _0x253bcc?{'count':_0x57d60c,'rows':_0x253bcc}:null;}})[_0x7efa('0x27')](respondWithResult(_0x2418a6,null))[_0x7efa('0x48')](handleError(_0x2418a6,null));}; \ No newline at end of file +var _0xc519=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','create','find','params','getFields','findOne','SalesforceField','pick','getSubjects','getDescriptions','zip-dir','request-promise','moment','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xc519,0x11b));var _0x9c51=function(_0x247bf1,_0x841b04){_0x247bf1=_0x247bf1-0x0;var _0x30e6f5=_0xc519[_0x247bf1];return _0x30e6f5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9c51('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c51('0x1'));var moment=require(_0x9c51('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9c51('0x3'));var path=require(_0x9c51('0x4'));var sox=require('sox');var csv=require(_0x9c51('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c51('0x6'));var _=require(_0x9c51('0x7'));var squel=require('squel');var crypto=require(_0x9c51('0x8'));var jsforce=require(_0x9c51('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x9c51('0x5'));var querystring=require(_0x9c51('0xa'));var Papa=require(_0x9c51('0xb'));var Redis=require(_0x9c51('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x9c51('0xd'));var as=require(_0x9c51('0xe'));var hardwareService=require(_0x9c51('0xf'));var logger=require(_0x9c51('0x10'))(_0x9c51('0x11'));var utils=require(_0x9c51('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9c51('0x13'))['db'];function respondWithStatusCode(_0x5cbed0,_0x3e6bd4){_0x3e6bd4=_0x3e6bd4||0xcc;return function(_0xd78aea){if(_0xd78aea){return _0x5cbed0[_0x9c51('0x14')](_0x3e6bd4);}return _0x5cbed0[_0x9c51('0x15')](_0x3e6bd4)[_0x9c51('0x16')]();};}function respondWithResult(_0x39bfc2,_0x44487c){_0x44487c=_0x44487c||0xc8;return function(_0x58375e){if(_0x58375e){return _0x39bfc2[_0x9c51('0x15')](_0x44487c)[_0x9c51('0x17')](_0x58375e);}};}function respondWithFilteredResult(_0x25a640,_0x4598ac){return function(_0x3064c4){if(_0x3064c4){var _0x11c33f=typeof _0x4598ac[_0x9c51('0x18')]==='undefined'&&typeof _0x4598ac[_0x9c51('0x19')]==='undefined';var _0x52d8b7=_0x3064c4[_0x9c51('0x1a')];var _0x5d9daf=_0x11c33f?0x0:_0x4598ac['offset'];var _0x691273=_0x11c33f?_0x3064c4[_0x9c51('0x1a')]:_0x4598ac[_0x9c51('0x18')]+_0x4598ac[_0x9c51('0x19')];var _0x3f0ad7;if(_0x691273>=_0x52d8b7){_0x691273=_0x52d8b7;_0x3f0ad7=0xc8;}else{_0x3f0ad7=0xce;}_0x25a640[_0x9c51('0x15')](_0x3f0ad7);return _0x25a640[_0x9c51('0x1b')](_0x9c51('0x1c'),_0x5d9daf+'-'+_0x691273+'/'+_0x52d8b7)[_0x9c51('0x17')](_0x3064c4);}return null;};}function patchUpdates(_0x483b37){return function(_0x432f16){try{jsonpatch[_0x9c51('0x1d')](_0x432f16,_0x483b37,!![]);}catch(_0x58a047){return BPromise[_0x9c51('0x1e')](_0x58a047);}return _0x432f16[_0x9c51('0x1f')]();};}function saveUpdates(_0x26a2b2,_0x16be2e){return function(_0x3a8693){if(_0x3a8693){return _0x3a8693[_0x9c51('0x20')](_0x26a2b2)[_0x9c51('0x21')](function(_0x104b30){return _0x104b30;});}return null;};}function removeEntity(_0x51ae02,_0x3c4253){return function(_0x3d8283){if(_0x3d8283){return _0x3d8283[_0x9c51('0x22')]()[_0x9c51('0x21')](function(){_0x51ae02[_0x9c51('0x15')](0xcc)[_0x9c51('0x16')]();});}};}function handleEntityNotFound(_0x574b68,_0x40a786){return function(_0x73dc43){if(!_0x73dc43){_0x574b68['sendStatus'](0x194);}return _0x73dc43;};}function handleError(_0x51863a,_0x4eb9d7){_0x4eb9d7=_0x4eb9d7||0x1f4;return function(_0x5e9c41){logger[_0x9c51('0x23')](_0x5e9c41[_0x9c51('0x24')]);if(_0x5e9c41[_0x9c51('0x25')]){delete _0x5e9c41[_0x9c51('0x25')];}_0x51863a[_0x9c51('0x15')](_0x4eb9d7)[_0x9c51('0x26')](_0x5e9c41);};}exports[_0x9c51('0x27')]=function(_0x48db4a,_0xe70cd6){var _0x394bc9={},_0x9a5705={},_0x9183f={'count':0x0,'rows':[]};var _0x57c998=_['map'](db[_0x9c51('0x28')][_0x9c51('0x29')],function(_0x5182b0){return{'name':_0x5182b0[_0x9c51('0x2a')],'type':_0x5182b0[_0x9c51('0x2b')][_0x9c51('0x2c')]};});_0x9a5705[_0x9c51('0x2d')]=_[_0x9c51('0x2e')](_0x57c998,_0x9c51('0x25'));_0x9a5705['query']=_['keys'](_0x48db4a[_0x9c51('0x2f')]);_0x9a5705[_0x9c51('0x30')]=_[_0x9c51('0x31')](_0x9a5705[_0x9c51('0x2d')],_0x9a5705[_0x9c51('0x2f')]);_0x394bc9[_0x9c51('0x32')]=_[_0x9c51('0x31')](_0x9a5705[_0x9c51('0x2d')],qs[_0x9c51('0x33')](_0x48db4a['query']['fields']));_0x394bc9[_0x9c51('0x32')]=_0x394bc9[_0x9c51('0x32')][_0x9c51('0x34')]?_0x394bc9[_0x9c51('0x32')]:_0x9a5705[_0x9c51('0x2d')];if(!_0x48db4a[_0x9c51('0x2f')][_0x9c51('0x35')](_0x9c51('0x36'))){_0x394bc9['limit']=qs['limit'](_0x48db4a[_0x9c51('0x2f')]['limit']);_0x394bc9[_0x9c51('0x18')]=qs['offset'](_0x48db4a[_0x9c51('0x2f')][_0x9c51('0x18')]);}_0x394bc9[_0x9c51('0x37')]=qs[_0x9c51('0x38')](_0x48db4a[_0x9c51('0x2f')]['sort']);_0x394bc9[_0x9c51('0x39')]=qs[_0x9c51('0x30')](_['pick'](_0x48db4a[_0x9c51('0x2f')],_0x9a5705[_0x9c51('0x30')]),_0x57c998);if(_0x48db4a[_0x9c51('0x2f')][_0x9c51('0x3a')]){_0x394bc9[_0x9c51('0x39')]=_[_0x9c51('0x3b')](_0x394bc9['where'],{'$or':_[_0x9c51('0x2e')](_0x57c998,function(_0x1e5282){if(_0x1e5282[_0x9c51('0x2b')]!==_0x9c51('0x3c')){var _0x30a629={};_0x30a629[_0x1e5282[_0x9c51('0x25')]]={'$like':'%'+_0x48db4a[_0x9c51('0x2f')]['filter']+'%'};return _0x30a629;}})});}_0x394bc9=_[_0x9c51('0x3b')]({},_0x394bc9,_0x48db4a[_0x9c51('0x3d')]);var _0x34de73={'where':_0x394bc9[_0x9c51('0x39')]};return db['SalesforceConfiguration'][_0x9c51('0x1a')](_0x34de73)[_0x9c51('0x21')](function(_0x2170dd){_0x9183f[_0x9c51('0x1a')]=_0x2170dd;if(_0x48db4a['query'][_0x9c51('0x3e')]){_0x394bc9[_0x9c51('0x3f')]=[{'all':!![]}];}return db[_0x9c51('0x28')]['findAll'](_0x394bc9);})[_0x9c51('0x21')](function(_0x1a2f16){_0x9183f[_0x9c51('0x40')]=_0x1a2f16;return _0x9183f;})[_0x9c51('0x21')](respondWithFilteredResult(_0xe70cd6,_0x394bc9))[_0x9c51('0x41')](handleError(_0xe70cd6,null));};exports[_0x9c51('0x42')]=function(_0xaeda82,_0xe74e89){var _0x5c2c2e={'raw':![],'where':{'id':_0xaeda82['params']['id']}},_0x34a6d1={};_0x34a6d1[_0x9c51('0x2d')]=_[_0x9c51('0x43')](db['SalesforceConfiguration'][_0x9c51('0x29')]);_0x34a6d1[_0x9c51('0x2f')]=_[_0x9c51('0x43')](_0xaeda82['query']);_0x34a6d1['filters']=_[_0x9c51('0x31')](_0x34a6d1[_0x9c51('0x2d')],_0x34a6d1['query']);_0x5c2c2e[_0x9c51('0x32')]=_['intersection'](_0x34a6d1[_0x9c51('0x2d')],qs[_0x9c51('0x33')](_0xaeda82['query']['fields']));_0x5c2c2e[_0x9c51('0x32')]=_0x5c2c2e[_0x9c51('0x32')][_0x9c51('0x34')]?_0x5c2c2e['attributes']:_0x34a6d1[_0x9c51('0x2d')];if(_0xaeda82[_0x9c51('0x2f')][_0x9c51('0x3e')]){_0x5c2c2e[_0x9c51('0x3f')]=[{'all':!![]}];}_0x5c2c2e=_['merge']({},_0x5c2c2e,_0xaeda82[_0x9c51('0x3d')]);return db[_0x9c51('0x28')]['find'](_0x5c2c2e)['then'](handleEntityNotFound(_0xe74e89,null))[_0x9c51('0x21')](respondWithResult(_0xe74e89,null))[_0x9c51('0x41')](handleError(_0xe74e89,null));};exports[_0x9c51('0x44')]=function(_0x2d2d0e,_0x5382a1){return db[_0x9c51('0x28')][_0x9c51('0x44')](_0x2d2d0e['body'],{})[_0x9c51('0x21')](respondWithResult(_0x5382a1,0xc9))['catch'](handleError(_0x5382a1,null));};exports['update']=function(_0x558b02,_0x5e40b4){if(_0x558b02['body']['id']){delete _0x558b02['body']['id'];}return db[_0x9c51('0x28')][_0x9c51('0x45')]({'where':{'id':_0x558b02[_0x9c51('0x46')]['id']}})[_0x9c51('0x21')](handleEntityNotFound(_0x5e40b4,null))['then'](saveUpdates(_0x558b02['body'],null))[_0x9c51('0x21')](respondWithResult(_0x5e40b4,null))['catch'](handleError(_0x5e40b4,null));};exports[_0x9c51('0x22')]=function(_0x5e0a99,_0x4c057b){return db[_0x9c51('0x28')][_0x9c51('0x45')]({'where':{'id':_0x5e0a99['params']['id']}})[_0x9c51('0x21')](handleEntityNotFound(_0x4c057b,null))[_0x9c51('0x21')](removeEntity(_0x4c057b,null))[_0x9c51('0x41')](handleError(_0x4c057b,null));};exports[_0x9c51('0x47')]=function(_0x1f1b6e,_0x2f80a8,_0x129523){var _0x12d3aa={};var _0x21f79b={};var _0x328a53;var _0x4d78f8;return db[_0x9c51('0x28')][_0x9c51('0x48')]({'where':{'id':_0x1f1b6e[_0x9c51('0x46')]['id']}})[_0x9c51('0x21')](handleEntityNotFound(_0x2f80a8,null))[_0x9c51('0x21')](function(_0x53ae7c){if(_0x53ae7c){_0x328a53=_0x53ae7c;_0x21f79b[_0x9c51('0x2d')]=_[_0x9c51('0x43')](db[_0x9c51('0x49')]['rawAttributes']);_0x21f79b['query']=_['keys'](_0x1f1b6e['query']);_0x21f79b[_0x9c51('0x30')]=_[_0x9c51('0x31')](_0x21f79b[_0x9c51('0x2d')],_0x21f79b[_0x9c51('0x2f')]);_0x12d3aa['attributes']=_[_0x9c51('0x31')](_0x21f79b[_0x9c51('0x2d')],qs[_0x9c51('0x33')](_0x1f1b6e[_0x9c51('0x2f')]['fields']));_0x12d3aa['attributes']=_0x12d3aa[_0x9c51('0x32')][_0x9c51('0x34')]?_0x12d3aa[_0x9c51('0x32')]:_0x21f79b[_0x9c51('0x2d')];_0x12d3aa[_0x9c51('0x37')]=qs[_0x9c51('0x38')](_0x1f1b6e[_0x9c51('0x2f')]['sort']);_0x12d3aa[_0x9c51('0x39')]=qs['filters'](_[_0x9c51('0x4a')](_0x1f1b6e[_0x9c51('0x2f')],_0x21f79b['filters']));if(_0x1f1b6e[_0x9c51('0x2f')]['filter']){_0x12d3aa[_0x9c51('0x39')]=_[_0x9c51('0x3b')](_0x12d3aa[_0x9c51('0x39')],{'$or':_[_0x9c51('0x2e')](_0x12d3aa[_0x9c51('0x32')],function(_0x545947){var _0x6d801={};_0x6d801[_0x545947]={'$like':'%'+_0x1f1b6e[_0x9c51('0x2f')][_0x9c51('0x3a')]+'%'};return _0x6d801;})});}_0x12d3aa=_[_0x9c51('0x3b')]({},_0x12d3aa,_0x1f1b6e['options']);return _0x328a53[_0x9c51('0x47')](_0x12d3aa);}})[_0x9c51('0x21')](function(_0x1296a8){if(_0x1296a8){_0x4d78f8=_0x1296a8[_0x9c51('0x34')];if(!_0x1f1b6e['query'][_0x9c51('0x35')]('nolimit')){_0x12d3aa[_0x9c51('0x19')]=qs[_0x9c51('0x19')](_0x1f1b6e[_0x9c51('0x2f')][_0x9c51('0x19')]);_0x12d3aa[_0x9c51('0x18')]=qs[_0x9c51('0x18')](_0x1f1b6e['query'][_0x9c51('0x18')]);}return _0x328a53[_0x9c51('0x47')](_0x12d3aa);}})['then'](function(_0x15d406){if(_0x15d406){return _0x15d406?{'count':_0x4d78f8,'rows':_0x15d406}:null;}})[_0x9c51('0x21')](respondWithResult(_0x2f80a8,null))['catch'](handleError(_0x2f80a8,null));};exports[_0x9c51('0x4b')]=function(_0x1949d6,_0x10ad68,_0x29238f){var _0x4fe1c9={};var _0x48173e={};var _0x236d58;var _0x263f43;return db['SalesforceConfiguration'][_0x9c51('0x48')]({'where':{'id':_0x1949d6[_0x9c51('0x46')]['id']}})[_0x9c51('0x21')](handleEntityNotFound(_0x10ad68,null))[_0x9c51('0x21')](function(_0x101b24){if(_0x101b24){_0x236d58=_0x101b24;_0x48173e['model']=_[_0x9c51('0x43')](db['SalesforceField'][_0x9c51('0x29')]);_0x48173e['query']=_['keys'](_0x1949d6[_0x9c51('0x2f')]);_0x48173e['filters']=_['intersection'](_0x48173e[_0x9c51('0x2d')],_0x48173e['query']);_0x4fe1c9[_0x9c51('0x32')]=_[_0x9c51('0x31')](_0x48173e[_0x9c51('0x2d')],qs[_0x9c51('0x33')](_0x1949d6[_0x9c51('0x2f')][_0x9c51('0x33')]));_0x4fe1c9[_0x9c51('0x32')]=_0x4fe1c9[_0x9c51('0x32')][_0x9c51('0x34')]?_0x4fe1c9[_0x9c51('0x32')]:_0x48173e[_0x9c51('0x2d')];_0x4fe1c9[_0x9c51('0x37')]=qs[_0x9c51('0x38')](_0x1949d6[_0x9c51('0x2f')][_0x9c51('0x38')]);_0x4fe1c9[_0x9c51('0x39')]=qs[_0x9c51('0x30')](_['pick'](_0x1949d6[_0x9c51('0x2f')],_0x48173e[_0x9c51('0x30')]));if(_0x1949d6['query'][_0x9c51('0x3a')]){_0x4fe1c9[_0x9c51('0x39')]=_[_0x9c51('0x3b')](_0x4fe1c9['where'],{'$or':_[_0x9c51('0x2e')](_0x4fe1c9[_0x9c51('0x32')],function(_0x185fb9){var _0x458b70={};_0x458b70[_0x185fb9]={'$like':'%'+_0x1949d6[_0x9c51('0x2f')][_0x9c51('0x3a')]+'%'};return _0x458b70;})});}_0x4fe1c9=_[_0x9c51('0x3b')]({},_0x4fe1c9,_0x1949d6[_0x9c51('0x3d')]);return _0x236d58['getSubjects'](_0x4fe1c9);}})[_0x9c51('0x21')](function(_0x376882){if(_0x376882){_0x263f43=_0x376882[_0x9c51('0x34')];if(!_0x1949d6[_0x9c51('0x2f')][_0x9c51('0x35')](_0x9c51('0x36'))){_0x4fe1c9[_0x9c51('0x19')]=qs[_0x9c51('0x19')](_0x1949d6[_0x9c51('0x2f')][_0x9c51('0x19')]);_0x4fe1c9[_0x9c51('0x18')]=qs['offset'](_0x1949d6[_0x9c51('0x2f')][_0x9c51('0x18')]);}return _0x236d58['getSubjects'](_0x4fe1c9);}})[_0x9c51('0x21')](function(_0x4ee03b){if(_0x4ee03b){return _0x4ee03b?{'count':_0x263f43,'rows':_0x4ee03b}:null;}})[_0x9c51('0x21')](respondWithResult(_0x10ad68,null))['catch'](handleError(_0x10ad68,null));};exports[_0x9c51('0x4c')]=function(_0x2da1c2,_0x8dcca4,_0x2c0c4b){var _0x4adec2={};var _0x144c4f={};var _0x4a20b9;var _0xcb0ac2;return db[_0x9c51('0x28')][_0x9c51('0x48')]({'where':{'id':_0x2da1c2[_0x9c51('0x46')]['id']}})['then'](handleEntityNotFound(_0x8dcca4,null))[_0x9c51('0x21')](function(_0xf4be83){if(_0xf4be83){_0x4a20b9=_0xf4be83;_0x144c4f[_0x9c51('0x2d')]=_[_0x9c51('0x43')](db[_0x9c51('0x49')][_0x9c51('0x29')]);_0x144c4f['query']=_['keys'](_0x2da1c2[_0x9c51('0x2f')]);_0x144c4f[_0x9c51('0x30')]=_[_0x9c51('0x31')](_0x144c4f[_0x9c51('0x2d')],_0x144c4f[_0x9c51('0x2f')]);_0x4adec2[_0x9c51('0x32')]=_['intersection'](_0x144c4f[_0x9c51('0x2d')],qs[_0x9c51('0x33')](_0x2da1c2[_0x9c51('0x2f')][_0x9c51('0x33')]));_0x4adec2[_0x9c51('0x32')]=_0x4adec2[_0x9c51('0x32')]['length']?_0x4adec2['attributes']:_0x144c4f[_0x9c51('0x2d')];_0x4adec2['order']=qs[_0x9c51('0x38')](_0x2da1c2['query'][_0x9c51('0x38')]);_0x4adec2[_0x9c51('0x39')]=qs['filters'](_[_0x9c51('0x4a')](_0x2da1c2[_0x9c51('0x2f')],_0x144c4f[_0x9c51('0x30')]));if(_0x2da1c2['query']['filter']){_0x4adec2[_0x9c51('0x39')]=_[_0x9c51('0x3b')](_0x4adec2[_0x9c51('0x39')],{'$or':_[_0x9c51('0x2e')](_0x4adec2[_0x9c51('0x32')],function(_0x1524de){var _0x158ab0={};_0x158ab0[_0x1524de]={'$like':'%'+_0x2da1c2[_0x9c51('0x2f')]['filter']+'%'};return _0x158ab0;})});}_0x4adec2=_['merge']({},_0x4adec2,_0x2da1c2[_0x9c51('0x3d')]);return _0x4a20b9[_0x9c51('0x4c')](_0x4adec2);}})[_0x9c51('0x21')](function(_0x30304a){if(_0x30304a){_0xcb0ac2=_0x30304a['length'];if(!_0x2da1c2[_0x9c51('0x2f')][_0x9c51('0x35')](_0x9c51('0x36'))){_0x4adec2[_0x9c51('0x19')]=qs['limit'](_0x2da1c2[_0x9c51('0x2f')][_0x9c51('0x19')]);_0x4adec2[_0x9c51('0x18')]=qs['offset'](_0x2da1c2[_0x9c51('0x2f')][_0x9c51('0x18')]);}return _0x4a20b9['getDescriptions'](_0x4adec2);}})[_0x9c51('0x21')](function(_0x358a37){if(_0x358a37){return _0x358a37?{'count':_0xcb0ac2,'rows':_0x358a37}:null;}})[_0x9c51('0x21')](respondWithResult(_0x8dcca4,null))[_0x9c51('0x41')](handleError(_0x8dcca4,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index fd9df63..3632cfc 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 _0x788d=['../../config/environment','exports','define','SalesforceConfiguration','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x524d72,_0x489125){var _0x18ca9d=function(_0x415f35){while(--_0x415f35){_0x524d72['push'](_0x524d72['shift']());}};_0x18ca9d(++_0x489125);}(_0x788d,0xca));var _0xd788=function(_0x2d17ac,_0x3babca){_0x2d17ac=_0x2d17ac-0x0;var _0x28b912=_0x788d[_0x2d17ac];return _0x28b912;};'use strict';var _=require(_0xd788('0x0'));var util=require(_0xd788('0x1'));var logger=require('../../config/logger')(_0xd788('0x2'));var moment=require(_0xd788('0x3'));var BPromise=require(_0xd788('0x4'));var rp=require(_0xd788('0x5'));var fs=require('fs');var path=require(_0xd788('0x6'));var rimraf=require('rimraf');var config=require(_0xd788('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xd788('0x8')]=function(_0x250e01,_0x39cbb8){return _0x250e01[_0xd788('0x9')](_0xd788('0xa'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96ef=['./intSalesforceConfiguration.attributes','int_salesforce_configurations','util','api','moment','bluebird','path','rimraf'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x96ef,0xd2));var _0xf96e=function(_0x5f1cfe,_0xeb0d23){_0x5f1cfe=_0x5f1cfe-0x0;var _0x23a983=_0x96ef[_0x5f1cfe];return _0x23a983;};'use strict';var _=require('lodash');var util=require(_0xf96e('0x0'));var logger=require('../../config/logger')(_0xf96e('0x1'));var moment=require(_0xf96e('0x2'));var BPromise=require(_0xf96e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf96e('0x4'));var rimraf=require(_0xf96e('0x5'));var config=require('../../config/environment');var attributes=require(_0xf96e('0x6'));module['exports']=function(_0x5c038d,_0x3d37c1){return _0x5c038d['define']('SalesforceConfiguration',attributes,{'tableName':_0xf96e('0x7'),'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 d39faf6..2b6fb42 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 _0x742c=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x2a8bd6,_0x3bfc91){var _0x461842=function(_0x64fcca){while(--_0x64fcca){_0x2a8bd6['push'](_0x2a8bd6['shift']());}};_0x461842(++_0x3bfc91);}(_0x742c,0x12f));var _0xc742=function(_0x538c70,_0x35531f){_0x538c70=_0x538c70-0x0;var _0x42ae01=_0x742c[_0x538c70];return _0x42ae01;};'use strict';var _=require(_0xc742('0x0'));var util=require(_0xc742('0x1'));var moment=require(_0xc742('0x2'));var BPromise=require(_0xc742('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc742('0x4'))['db'];var utils=require(_0xc742('0x5'));var logger=require(_0xc742('0x6'))('rpc');var config=require(_0xc742('0x7'));var jayson=require(_0xc742('0x8'));var client=jayson['client'][_0xc742('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12f3c2,_0xbf01fd,_0x24df05){return new BPromise(function(_0x2460ae,_0x257968){return client['request'](_0x12f3c2,_0x24df05)[_0xc742('0xa')](function(_0x100d89){logger[_0xc742('0xb')](_0xc742('0xc'),_0xbf01fd,_0xc742('0xd'));logger['debug'](_0xc742('0xe'),_0xbf01fd,_0xc742('0xd'),JSON['stringify'](_0x100d89));if(_0x100d89[_0xc742('0xf')]){if(_0x100d89[_0xc742('0xf')]['code']===0x1f4){logger['error'](_0xc742('0xc'),_0xbf01fd,_0x100d89[_0xc742('0xf')][_0xc742('0x10')]);return _0x257968(_0x100d89[_0xc742('0xf')][_0xc742('0x10')]);}logger[_0xc742('0xf')](_0xc742('0xc'),_0xbf01fd,_0x100d89[_0xc742('0xf')][_0xc742('0x10')]);return _0x2460ae(_0x100d89[_0xc742('0xf')][_0xc742('0x10')]);}else{logger[_0xc742('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0xbf01fd,_0xc742('0xd'));_0x2460ae(_0x100d89[_0xc742('0x11')][_0xc742('0x10')]);}})[_0xc742('0x12')](function(_0x389667){logger[_0xc742('0xf')](_0xc742('0xc'),_0xbf01fd,_0x389667);_0x257968(_0x389667);});});} \ No newline at end of file +var _0x2a30=['info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x2a30,0xee));var _0x02a3=function(_0x5f091b,_0x1f8cb5){_0x5f091b=_0x5f091b-0x0;var _0x4f7f8c=_0x2a30[_0x5f091b];return _0x4f7f8c;};'use strict';var _=require('lodash');var util=require(_0x02a3('0x0'));var moment=require('moment');var BPromise=require(_0x02a3('0x1'));var rs=require(_0x02a3('0x2'));var fs=require('fs');var Redis=require(_0x02a3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x02a3('0x4'))(_0x02a3('0x5'));var config=require(_0x02a3('0x6'));var jayson=require(_0x02a3('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a40f7,_0x2d49aa,_0x34ca48){return new BPromise(function(_0x53da0d,_0x36ad84){return client[_0x02a3('0x8')](_0x4a40f7,_0x34ca48)['then'](function(_0xe3edbf){logger[_0x02a3('0x9')](_0x02a3('0xa'),_0x2d49aa,_0x02a3('0xb'));logger[_0x02a3('0xc')](_0x02a3('0xd'),_0x2d49aa,_0x02a3('0xb'),JSON['stringify'](_0xe3edbf));if(_0xe3edbf['error']){if(_0xe3edbf[_0x02a3('0xe')][_0x02a3('0xf')]===0x1f4){logger[_0x02a3('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2d49aa,_0xe3edbf[_0x02a3('0xe')]['message']);return _0x36ad84(_0xe3edbf['error'][_0x02a3('0x10')]);}logger[_0x02a3('0xe')](_0x02a3('0xa'),_0x2d49aa,_0xe3edbf[_0x02a3('0xe')][_0x02a3('0x10')]);return _0x53da0d(_0xe3edbf[_0x02a3('0xe')][_0x02a3('0x10')]);}else{logger[_0x02a3('0x9')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2d49aa,_0x02a3('0xb'));_0x53da0d(_0xe3edbf[_0x02a3('0x11')]['message']);}})[_0x02a3('0x12')](function(_0x5a101a){logger[_0x02a3('0xe')](_0x02a3('0xa'),_0x2d49aa,_0x5a101a);_0x36ad84(_0x5a101a);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index c30d857..721201a 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 _0x917a=['./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x179d9b,_0x465c8e){var _0x7e11dd=function(_0x6aec91){while(--_0x6aec91){_0x179d9b['push'](_0x179d9b['shift']());}};_0x7e11dd(++_0x465c8e);}(_0x917a,0x187));var _0xa917=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x917a[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xa917('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa917('0x1'));var express=require(_0xa917('0x2'));var router=express[_0xa917('0x3')]();var fs_extra=require(_0xa917('0x4'));var auth=require(_0xa917('0x5'));var interaction=require(_0xa917('0x6'));var config=require(_0xa917('0x7'));var controller=require(_0xa917('0x8'));router[_0xa917('0x9')]('/',auth[_0xa917('0xa')](),controller[_0xa917('0xb')]);router[_0xa917('0x9')](_0xa917('0xc'),auth[_0xa917('0xa')](),controller[_0xa917('0xd')]);router[_0xa917('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa917('0xf')](_0xa917('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa917('0x10')](_0xa917('0xc'),auth[_0xa917('0xa')](),controller[_0xa917('0x11')]);module[_0xa917('0x12')]=router; \ No newline at end of file +var _0xcc66=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','update'];(function(_0x2ace30,_0x172089){var _0x24c292=function(_0x4fb949){while(--_0x4fb949){_0x2ace30['push'](_0x2ace30['shift']());}};_0x24c292(++_0x172089);}(_0xcc66,0xf0));var _0x6cc6=function(_0x44d6e2,_0x220aa1){_0x44d6e2=_0x44d6e2-0x0;var _0xc0707d=_0xcc66[_0x44d6e2];return _0xc0707d;};'use strict';var multer=require(_0x6cc6('0x0'));var util=require(_0x6cc6('0x1'));var path=require(_0x6cc6('0x2'));var timeout=require(_0x6cc6('0x3'));var express=require(_0x6cc6('0x4'));var router=express['Router']();var fs_extra=require(_0x6cc6('0x5'));var auth=require(_0x6cc6('0x6'));var interaction=require(_0x6cc6('0x7'));var config=require(_0x6cc6('0x8'));var controller=require('./intSalesforceField.controller');router[_0x6cc6('0x9')]('/',auth[_0x6cc6('0xa')](),controller['index']);router[_0x6cc6('0x9')](_0x6cc6('0xb'),auth[_0x6cc6('0xa')](),controller['show']);router[_0x6cc6('0xc')]('/',auth['isAuthenticated'](),controller[_0x6cc6('0xd')]);router['put'](_0x6cc6('0xb'),auth[_0x6cc6('0xa')](),controller[_0x6cc6('0xe')]);router['delete'](_0x6cc6('0xb'),auth[_0x6cc6('0xa')](),controller[_0x6cc6('0xf')]);module[_0x6cc6('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index b4b564b..e929e13 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 _0x641f=['exports','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x1c4f97,_0x547fb4){var _0xd6346e=function(_0x1ac0d7){while(--_0x1ac0d7){_0x1c4f97['push'](_0x1c4f97['shift']());}};_0xd6346e(++_0x547fb4);}(_0x641f,0xb6));var _0xf641=function(_0x33c294,_0x5d5c56){_0x33c294=_0x33c294-0x0;var _0x3b5125=_0x641f[_0x33c294];return _0x3b5125;};'use strict';var Sequelize=require('sequelize');module[_0xf641('0x0')]={'type':{'type':Sequelize[_0xf641('0x1')](_0xf641('0x2'),_0xf641('0x3'),'customVariable',_0xf641('0x4'),'picklist'),'defaultValue':_0xf641('0x2')},'content':{'type':Sequelize[_0xf641('0x5')]},'key':{'type':Sequelize[_0xf641('0x5')]},'keyType':{'type':Sequelize[_0xf641('0x1')](_0xf641('0x2'),_0xf641('0x3'),_0xf641('0x6'))},'keyContent':{'type':Sequelize[_0xf641('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xf641('0x5')]}}; \ No newline at end of file +var _0x9a97=['string','variable','customVariable','picklist','STRING','sequelize','exports','ENUM'];(function(_0x5c1b17,_0x4d91c7){var _0x3aea22=function(_0x4c0c4b){while(--_0x4c0c4b){_0x5c1b17['push'](_0x5c1b17['shift']());}};_0x3aea22(++_0x4d91c7);}(_0x9a97,0x65));var _0x79a9=function(_0x1c77b9,_0x4d291d){_0x1c77b9=_0x1c77b9-0x0;var _0x3b3dda=_0x9a97[_0x1c77b9];return _0x3b3dda;};'use strict';var Sequelize=require(_0x79a9('0x0'));module[_0x79a9('0x1')]={'type':{'type':Sequelize[_0x79a9('0x2')](_0x79a9('0x3'),_0x79a9('0x4'),_0x79a9('0x5'),'keyValue',_0x79a9('0x6')),'defaultValue':_0x79a9('0x3')},'content':{'type':Sequelize[_0x79a9('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x79a9('0x2')](_0x79a9('0x3'),'variable',_0x79a9('0x5'))},'keyContent':{'type':Sequelize[_0x79a9('0x7')]},'idField':{'type':Sequelize[_0x79a9('0x7')]},'variableName':{'type':Sequelize[_0x79a9('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index e81fbe7..59b4187 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 _0xbb8a=['rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','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','count','offset','limit','set','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format'];(function(_0x4cd0ed,_0x1969de){var _0x5043dc=function(_0x2465ce){while(--_0x2465ce){_0x4cd0ed['push'](_0x4cd0ed['shift']());}};_0x5043dc(++_0x1969de);}(_0xbb8a,0x99));var _0xabb8=function(_0x524366,_0x1e6911){_0x524366=_0x524366-0x0;var _0x5a9616=_0xbb8a[_0x524366];return _0x5a9616;};'use strict';var emlformat=require(_0xabb8('0x0'));var rimraf=require(_0xabb8('0x1'));var zipdir=require(_0xabb8('0x2'));var jsonpatch=require(_0xabb8('0x3'));var rp=require('request-promise');var moment=require(_0xabb8('0x4'));var BPromise=require(_0xabb8('0x5'));var Mustache=require('mustache');var util=require(_0xabb8('0x6'));var path=require(_0xabb8('0x7'));var sox=require(_0xabb8('0x8'));var csv=require(_0xabb8('0x9'));var ejs=require(_0xabb8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xabb8('0xb'));var squel=require(_0xabb8('0xc'));var crypto=require('crypto');var jsforce=require(_0xabb8('0xd'));var deskjs=require(_0xabb8('0xe'));var toCsv=require(_0xabb8('0x9'));var querystring=require('querystring');var Papa=require(_0xabb8('0xf'));var Redis=require(_0xabb8('0x10'));var authService=require(_0xabb8('0x11'));var qs=require(_0xabb8('0x12'));var as=require(_0xabb8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabb8('0x14'))('api');var utils=require(_0xabb8('0x15'));var config=require(_0xabb8('0x16'));var licenseUtil=require(_0xabb8('0x17'));var db=require(_0xabb8('0x18'))['db'];function respondWithStatusCode(_0x20dfdf,_0x555ce8){_0x555ce8=_0x555ce8||0xcc;return function(_0xf46fe){if(_0xf46fe){return _0x20dfdf[_0xabb8('0x19')](_0x555ce8);}return _0x20dfdf[_0xabb8('0x1a')](_0x555ce8)[_0xabb8('0x1b')]();};}function respondWithResult(_0xb7403b,_0x21a0dd){_0x21a0dd=_0x21a0dd||0xc8;return function(_0x31c7bf){if(_0x31c7bf){return _0xb7403b['status'](_0x21a0dd)['json'](_0x31c7bf);}};}function respondWithFilteredResult(_0x5a4711,_0x34c866){return function(_0xc7ef3e){if(_0xc7ef3e){var _0x6ec3da=typeof _0x34c866['offset']===_0xabb8('0x1c')&&typeof _0x34c866['limit']===_0xabb8('0x1c');var _0x41a5ca=_0xc7ef3e[_0xabb8('0x1d')];var _0xf52931=_0x6ec3da?0x0:_0x34c866[_0xabb8('0x1e')];var _0x5c3209=_0x6ec3da?_0xc7ef3e[_0xabb8('0x1d')]:_0x34c866[_0xabb8('0x1e')]+_0x34c866[_0xabb8('0x1f')];var _0x5d2a88;if(_0x5c3209>=_0x41a5ca){_0x5c3209=_0x41a5ca;_0x5d2a88=0xc8;}else{_0x5d2a88=0xce;}_0x5a4711[_0xabb8('0x1a')](_0x5d2a88);return _0x5a4711[_0xabb8('0x20')]('Content-Range',_0xf52931+'-'+_0x5c3209+'/'+_0x41a5ca)[_0xabb8('0x21')](_0xc7ef3e);}return null;};}function patchUpdates(_0x75e869){return function(_0x1737ae){try{jsonpatch[_0xabb8('0x22')](_0x1737ae,_0x75e869,!![]);}catch(_0x31f3f4){return BPromise[_0xabb8('0x23')](_0x31f3f4);}return _0x1737ae['save']();};}function saveUpdates(_0x2808b2,_0x4f0618){return function(_0x1f04f7){if(_0x1f04f7){return _0x1f04f7[_0xabb8('0x24')](_0x2808b2)[_0xabb8('0x25')](function(_0x31f5f3){return _0x31f5f3;});}return null;};}function removeEntity(_0x44688b,_0x222036){return function(_0x5733fc){if(_0x5733fc){return _0x5733fc[_0xabb8('0x26')]()[_0xabb8('0x25')](function(){_0x44688b[_0xabb8('0x1a')](0xcc)[_0xabb8('0x1b')]();});}};}function handleEntityNotFound(_0x2c821a,_0x4f5764){return function(_0x1eed88){if(!_0x1eed88){_0x2c821a['sendStatus'](0x194);}return _0x1eed88;};}function handleError(_0x20a548,_0x231437){_0x231437=_0x231437||0x1f4;return function(_0x1061c3){logger[_0xabb8('0x27')](_0x1061c3[_0xabb8('0x28')]);if(_0x1061c3['name']){delete _0x1061c3[_0xabb8('0x29')];}_0x20a548[_0xabb8('0x1a')](_0x231437)[_0xabb8('0x2a')](_0x1061c3);};}exports[_0xabb8('0x2b')]=function(_0xe1a291,_0x5e4514){var _0x292b64={},_0x4e8954={},_0x3e5ecd={'count':0x0,'rows':[]};var _0x1c270a=_[_0xabb8('0x2c')](db[_0xabb8('0x2d')][_0xabb8('0x2e')],function(_0x17f707){return{'name':_0x17f707['fieldName'],'type':_0x17f707[_0xabb8('0x2f')][_0xabb8('0x30')]};});_0x4e8954[_0xabb8('0x31')]=_['map'](_0x1c270a,'name');_0x4e8954[_0xabb8('0x32')]=_[_0xabb8('0x33')](_0xe1a291[_0xabb8('0x32')]);_0x4e8954[_0xabb8('0x34')]=_[_0xabb8('0x35')](_0x4e8954[_0xabb8('0x31')],_0x4e8954[_0xabb8('0x32')]);_0x292b64['attributes']=_[_0xabb8('0x35')](_0x4e8954[_0xabb8('0x31')],qs[_0xabb8('0x36')](_0xe1a291[_0xabb8('0x32')][_0xabb8('0x36')]));_0x292b64[_0xabb8('0x37')]=_0x292b64[_0xabb8('0x37')][_0xabb8('0x38')]?_0x292b64['attributes']:_0x4e8954[_0xabb8('0x31')];if(!_0xe1a291[_0xabb8('0x32')][_0xabb8('0x39')](_0xabb8('0x3a'))){_0x292b64[_0xabb8('0x1f')]=qs['limit'](_0xe1a291[_0xabb8('0x32')][_0xabb8('0x1f')]);_0x292b64[_0xabb8('0x1e')]=qs[_0xabb8('0x1e')](_0xe1a291['query']['offset']);}_0x292b64[_0xabb8('0x3b')]=qs['sort'](_0xe1a291[_0xabb8('0x32')][_0xabb8('0x3c')]);_0x292b64[_0xabb8('0x3d')]=qs[_0xabb8('0x34')](_[_0xabb8('0x3e')](_0xe1a291[_0xabb8('0x32')],_0x4e8954[_0xabb8('0x34')]),_0x1c270a);if(_0xe1a291[_0xabb8('0x32')][_0xabb8('0x3f')]){_0x292b64['where']=_[_0xabb8('0x40')](_0x292b64[_0xabb8('0x3d')],{'$or':_[_0xabb8('0x2c')](_0x1c270a,function(_0x28ec72){if(_0x28ec72[_0xabb8('0x2f')]!==_0xabb8('0x41')){var _0x4e01d9={};_0x4e01d9[_0x28ec72[_0xabb8('0x29')]]={'$like':'%'+_0xe1a291[_0xabb8('0x32')][_0xabb8('0x3f')]+'%'};return _0x4e01d9;}})});}_0x292b64=_[_0xabb8('0x40')]({},_0x292b64,_0xe1a291[_0xabb8('0x42')]);var _0x2f1653={'where':_0x292b64['where']};return db[_0xabb8('0x2d')][_0xabb8('0x1d')](_0x2f1653)[_0xabb8('0x25')](function(_0x4fe37d){_0x3e5ecd[_0xabb8('0x1d')]=_0x4fe37d;if(_0xe1a291[_0xabb8('0x32')][_0xabb8('0x43')]){_0x292b64[_0xabb8('0x44')]=[{'all':!![]}];}return db['SalesforceField'][_0xabb8('0x45')](_0x292b64);})[_0xabb8('0x25')](function(_0x316319){_0x3e5ecd[_0xabb8('0x46')]=_0x316319;return _0x3e5ecd;})[_0xabb8('0x25')](respondWithFilteredResult(_0x5e4514,_0x292b64))[_0xabb8('0x47')](handleError(_0x5e4514,null));};exports[_0xabb8('0x48')]=function(_0x2e2db6,_0x42d6ff){var _0x1d0f0a={'raw':!![],'where':{'id':_0x2e2db6[_0xabb8('0x49')]['id']}},_0x277858={};_0x277858[_0xabb8('0x31')]=_['keys'](db[_0xabb8('0x2d')]['rawAttributes']);_0x277858['query']=_[_0xabb8('0x33')](_0x2e2db6['query']);_0x277858[_0xabb8('0x34')]=_[_0xabb8('0x35')](_0x277858[_0xabb8('0x31')],_0x277858[_0xabb8('0x32')]);_0x1d0f0a[_0xabb8('0x37')]=_['intersection'](_0x277858[_0xabb8('0x31')],qs[_0xabb8('0x36')](_0x2e2db6[_0xabb8('0x32')][_0xabb8('0x36')]));_0x1d0f0a[_0xabb8('0x37')]=_0x1d0f0a[_0xabb8('0x37')][_0xabb8('0x38')]?_0x1d0f0a[_0xabb8('0x37')]:_0x277858[_0xabb8('0x31')];if(_0x2e2db6['query'][_0xabb8('0x43')]){_0x1d0f0a[_0xabb8('0x44')]=[{'all':!![]}];}_0x1d0f0a=_[_0xabb8('0x40')]({},_0x1d0f0a,_0x2e2db6[_0xabb8('0x42')]);return db['SalesforceField'][_0xabb8('0x4a')](_0x1d0f0a)[_0xabb8('0x25')](handleEntityNotFound(_0x42d6ff,null))[_0xabb8('0x25')](respondWithResult(_0x42d6ff,null))[_0xabb8('0x47')](handleError(_0x42d6ff,null));};exports[_0xabb8('0x4b')]=function(_0x1da80b,_0x4b0c44){return db[_0xabb8('0x2d')][_0xabb8('0x4b')](_0x1da80b[_0xabb8('0x4c')],{})[_0xabb8('0x25')](respondWithResult(_0x4b0c44,0xc9))[_0xabb8('0x47')](handleError(_0x4b0c44,null));};exports[_0xabb8('0x24')]=function(_0x2ef7c5,_0x5b8f4e){if(_0x2ef7c5['body']['id']){delete _0x2ef7c5[_0xabb8('0x4c')]['id'];}return db[_0xabb8('0x2d')][_0xabb8('0x4a')]({'where':{'id':_0x2ef7c5[_0xabb8('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b8f4e,null))['then'](saveUpdates(_0x2ef7c5[_0xabb8('0x4c')],null))[_0xabb8('0x25')](respondWithResult(_0x5b8f4e,null))[_0xabb8('0x47')](handleError(_0x5b8f4e,null));};exports[_0xabb8('0x26')]=function(_0x57b97d,_0x1da512){return db[_0xabb8('0x2d')]['find']({'where':{'id':_0x57b97d[_0xabb8('0x49')]['id']}})[_0xabb8('0x25')](handleEntityNotFound(_0x1da512,null))[_0xabb8('0x25')](removeEntity(_0x1da512,null))[_0xabb8('0x47')](handleError(_0x1da512,null));}; \ No newline at end of file +var _0x79e3=['destroy','end','sendStatus','error','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SalesforceField','count','include','findAll','show','length','includeAll','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','apply','reject','save','update','then'];(function(_0x1807c5,_0x2759e6){var _0x2063aa=function(_0x6fb3a2){while(--_0x6fb3a2){_0x1807c5['push'](_0x1807c5['shift']());}};_0x2063aa(++_0x2759e6);}(_0x79e3,0x109));var _0x379e=function(_0x401508,_0x3e4e11){_0x401508=_0x401508-0x0;var _0x16544d=_0x79e3[_0x401508];return _0x16544d;};'use strict';var emlformat=require(_0x379e('0x0'));var rimraf=require(_0x379e('0x1'));var zipdir=require(_0x379e('0x2'));var jsonpatch=require(_0x379e('0x3'));var rp=require('request-promise');var moment=require(_0x379e('0x4'));var BPromise=require(_0x379e('0x5'));var Mustache=require(_0x379e('0x6'));var util=require(_0x379e('0x7'));var path=require(_0x379e('0x8'));var sox=require('sox');var csv=require(_0x379e('0x9'));var ejs=require(_0x379e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x379e('0xb'));var squel=require(_0x379e('0xc'));var crypto=require('crypto');var jsforce=require(_0x379e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x379e('0x9'));var querystring=require('querystring');var Papa=require(_0x379e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x379e('0xf'));var as=require(_0x379e('0x10'));var hardwareService=require(_0x379e('0x11'));var logger=require(_0x379e('0x12'))(_0x379e('0x13'));var utils=require(_0x379e('0x14'));var config=require(_0x379e('0x15'));var licenseUtil=require(_0x379e('0x16'));var db=require(_0x379e('0x17'))['db'];function respondWithStatusCode(_0x4b0693,_0x264670){_0x264670=_0x264670||0xcc;return function(_0x6464b){if(_0x6464b){return _0x4b0693['sendStatus'](_0x264670);}return _0x4b0693['status'](_0x264670)['end']();};}function respondWithResult(_0x5bb74a,_0x29fe0f){_0x29fe0f=_0x29fe0f||0xc8;return function(_0x26b76e){if(_0x26b76e){return _0x5bb74a[_0x379e('0x18')](_0x29fe0f)[_0x379e('0x19')](_0x26b76e);}};}function respondWithFilteredResult(_0x3e3b47,_0x4c126e){return function(_0x16817f){if(_0x16817f){var _0x4f156c=typeof _0x4c126e[_0x379e('0x1a')]===_0x379e('0x1b')&&typeof _0x4c126e[_0x379e('0x1c')]===_0x379e('0x1b');var _0x5159e9=_0x16817f['count'];var _0x11930c=_0x4f156c?0x0:_0x4c126e[_0x379e('0x1a')];var _0x269e8b=_0x4f156c?_0x16817f['count']:_0x4c126e[_0x379e('0x1a')]+_0x4c126e[_0x379e('0x1c')];var _0x3a37c8;if(_0x269e8b>=_0x5159e9){_0x269e8b=_0x5159e9;_0x3a37c8=0xc8;}else{_0x3a37c8=0xce;}_0x3e3b47['status'](_0x3a37c8);return _0x3e3b47[_0x379e('0x1d')]('Content-Range',_0x11930c+'-'+_0x269e8b+'/'+_0x5159e9)[_0x379e('0x19')](_0x16817f);}return null;};}function patchUpdates(_0x402b69){return function(_0x13721d){try{jsonpatch[_0x379e('0x1e')](_0x13721d,_0x402b69,!![]);}catch(_0x476829){return BPromise[_0x379e('0x1f')](_0x476829);}return _0x13721d[_0x379e('0x20')]();};}function saveUpdates(_0x189ebf,_0x293eef){return function(_0x2c3e94){if(_0x2c3e94){return _0x2c3e94[_0x379e('0x21')](_0x189ebf)[_0x379e('0x22')](function(_0x3f68a8){return _0x3f68a8;});}return null;};}function removeEntity(_0x2f5685,_0x5885f7){return function(_0x86234a){if(_0x86234a){return _0x86234a[_0x379e('0x23')]()[_0x379e('0x22')](function(){_0x2f5685[_0x379e('0x18')](0xcc)[_0x379e('0x24')]();});}};}function handleEntityNotFound(_0x448fd1,_0x553bff){return function(_0x4f9d40){if(!_0x4f9d40){_0x448fd1[_0x379e('0x25')](0x194);}return _0x4f9d40;};}function handleError(_0x2a4505,_0x7805a7){_0x7805a7=_0x7805a7||0x1f4;return function(_0x44ce49){logger[_0x379e('0x26')](_0x44ce49['stack']);if(_0x44ce49[_0x379e('0x27')]){delete _0x44ce49[_0x379e('0x27')];}_0x2a4505['status'](_0x7805a7)[_0x379e('0x28')](_0x44ce49);};}exports[_0x379e('0x29')]=function(_0x3656f3,_0x9f0eff){var _0x25dc1e={},_0x34ac92={},_0x76c041={'count':0x0,'rows':[]};var _0x4e2fe5=_[_0x379e('0x2a')](db['SalesforceField'][_0x379e('0x2b')],function(_0x4c3b6d){return{'name':_0x4c3b6d[_0x379e('0x2c')],'type':_0x4c3b6d['type']['key']};});_0x34ac92[_0x379e('0x2d')]=_['map'](_0x4e2fe5,_0x379e('0x27'));_0x34ac92[_0x379e('0x2e')]=_[_0x379e('0x2f')](_0x3656f3['query']);_0x34ac92[_0x379e('0x30')]=_[_0x379e('0x31')](_0x34ac92[_0x379e('0x2d')],_0x34ac92[_0x379e('0x2e')]);_0x25dc1e[_0x379e('0x32')]=_[_0x379e('0x31')](_0x34ac92[_0x379e('0x2d')],qs[_0x379e('0x33')](_0x3656f3['query'][_0x379e('0x33')]));_0x25dc1e[_0x379e('0x32')]=_0x25dc1e[_0x379e('0x32')]['length']?_0x25dc1e[_0x379e('0x32')]:_0x34ac92[_0x379e('0x2d')];if(!_0x3656f3[_0x379e('0x2e')][_0x379e('0x34')](_0x379e('0x35'))){_0x25dc1e['limit']=qs[_0x379e('0x1c')](_0x3656f3['query'][_0x379e('0x1c')]);_0x25dc1e[_0x379e('0x1a')]=qs[_0x379e('0x1a')](_0x3656f3[_0x379e('0x2e')][_0x379e('0x1a')]);}_0x25dc1e[_0x379e('0x36')]=qs[_0x379e('0x37')](_0x3656f3[_0x379e('0x2e')][_0x379e('0x37')]);_0x25dc1e[_0x379e('0x38')]=qs['filters'](_[_0x379e('0x39')](_0x3656f3[_0x379e('0x2e')],_0x34ac92[_0x379e('0x30')]),_0x4e2fe5);if(_0x3656f3['query'][_0x379e('0x3a')]){_0x25dc1e[_0x379e('0x38')]=_[_0x379e('0x3b')](_0x25dc1e[_0x379e('0x38')],{'$or':_['map'](_0x4e2fe5,function(_0x197d27){if(_0x197d27[_0x379e('0x3c')]!==_0x379e('0x3d')){var _0x37a665={};_0x37a665[_0x197d27['name']]={'$like':'%'+_0x3656f3['query']['filter']+'%'};return _0x37a665;}})});}_0x25dc1e=_[_0x379e('0x3b')]({},_0x25dc1e,_0x3656f3[_0x379e('0x3e')]);var _0x5531be={'where':_0x25dc1e[_0x379e('0x38')]};return db[_0x379e('0x3f')]['count'](_0x5531be)[_0x379e('0x22')](function(_0x346921){_0x76c041[_0x379e('0x40')]=_0x346921;if(_0x3656f3[_0x379e('0x2e')]['includeAll']){_0x25dc1e[_0x379e('0x41')]=[{'all':!![]}];}return db['SalesforceField'][_0x379e('0x42')](_0x25dc1e);})[_0x379e('0x22')](function(_0x1c1165){_0x76c041['rows']=_0x1c1165;return _0x76c041;})[_0x379e('0x22')](respondWithFilteredResult(_0x9f0eff,_0x25dc1e))['catch'](handleError(_0x9f0eff,null));};exports[_0x379e('0x43')]=function(_0x564f5f,_0x5e0bf1){var _0x1dc67c={'raw':!![],'where':{'id':_0x564f5f['params']['id']}},_0x522804={};_0x522804[_0x379e('0x2d')]=_[_0x379e('0x2f')](db['SalesforceField'][_0x379e('0x2b')]);_0x522804[_0x379e('0x2e')]=_['keys'](_0x564f5f[_0x379e('0x2e')]);_0x522804[_0x379e('0x30')]=_['intersection'](_0x522804['model'],_0x522804[_0x379e('0x2e')]);_0x1dc67c[_0x379e('0x32')]=_['intersection'](_0x522804[_0x379e('0x2d')],qs[_0x379e('0x33')](_0x564f5f[_0x379e('0x2e')][_0x379e('0x33')]));_0x1dc67c[_0x379e('0x32')]=_0x1dc67c[_0x379e('0x32')][_0x379e('0x44')]?_0x1dc67c[_0x379e('0x32')]:_0x522804[_0x379e('0x2d')];if(_0x564f5f[_0x379e('0x2e')][_0x379e('0x45')]){_0x1dc67c[_0x379e('0x41')]=[{'all':!![]}];}_0x1dc67c=_[_0x379e('0x3b')]({},_0x1dc67c,_0x564f5f[_0x379e('0x3e')]);return db[_0x379e('0x3f')][_0x379e('0x46')](_0x1dc67c)[_0x379e('0x22')](handleEntityNotFound(_0x5e0bf1,null))[_0x379e('0x22')](respondWithResult(_0x5e0bf1,null))[_0x379e('0x47')](handleError(_0x5e0bf1,null));};exports[_0x379e('0x48')]=function(_0x12edd2,_0x48e5ce){return db['SalesforceField'][_0x379e('0x48')](_0x12edd2['body'],{})[_0x379e('0x22')](respondWithResult(_0x48e5ce,0xc9))['catch'](handleError(_0x48e5ce,null));};exports[_0x379e('0x21')]=function(_0x55cc48,_0x242b9e){if(_0x55cc48['body']['id']){delete _0x55cc48[_0x379e('0x49')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x55cc48[_0x379e('0x4a')]['id']}})[_0x379e('0x22')](handleEntityNotFound(_0x242b9e,null))[_0x379e('0x22')](saveUpdates(_0x55cc48[_0x379e('0x49')],null))['then'](respondWithResult(_0x242b9e,null))[_0x379e('0x47')](handleError(_0x242b9e,null));};exports[_0x379e('0x23')]=function(_0x59ef93,_0x161dad){return db['SalesforceField']['find']({'where':{'id':_0x59ef93[_0x379e('0x4a')]['id']}})[_0x379e('0x22')](handleEntityNotFound(_0x161dad,null))[_0x379e('0x22')](removeEntity(_0x161dad,null))[_0x379e('0x47')](handleError(_0x161dad,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 4a11e0c..f193bc3 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 _0xa324=['path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise'];(function(_0x8d1e41,_0xf57eed){var _0x11bcf8=function(_0x1a3ec8){while(--_0x1a3ec8){_0x8d1e41['push'](_0x8d1e41['shift']());}};_0x11bcf8(++_0xf57eed);}(_0xa324,0x9b));var _0x4a32=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xa324[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require(_0x4a32('0x0'));var logger=require(_0x4a32('0x1'))(_0x4a32('0x2'));var moment=require('moment');var BPromise=require(_0x4a32('0x3'));var rp=require(_0x4a32('0x4'));var fs=require('fs');var path=require(_0x4a32('0x5'));var rimraf=require(_0x4a32('0x6'));var config=require(_0x4a32('0x7'));var attributes=require(_0x4a32('0x8'));module[_0x4a32('0x9')]=function(_0x3f2e17,_0xdea93e){return _0x3f2e17[_0x4a32('0xa')](_0x4a32('0xb'),attributes,{'tableName':_0x4a32('0xc'),'paranoid':![],'indexes':[{'name':_0x4a32('0xd'),'fields':[_0x4a32('0xe'),_0x4a32('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd4a7=['exports','define','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceField.attributes'];(function(_0x4be961,_0x4448d6){var _0x3c6b91=function(_0x23cac0){while(--_0x23cac0){_0x4be961['push'](_0x4be961['shift']());}};_0x3c6b91(++_0x4448d6);}(_0xd4a7,0x7a));var _0x7d4a=function(_0x1c76b4,_0x1711fb){_0x1c76b4=_0x1c76b4-0x0;var _0x497eea=_0xd4a7[_0x1c76b4];return _0x497eea;};'use strict';var _=require(_0x7d4a('0x0'));var util=require('util');var logger=require(_0x7d4a('0x1'))('api');var moment=require(_0x7d4a('0x2'));var BPromise=require(_0x7d4a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d4a('0x4'));var rimraf=require(_0x7d4a('0x5'));var config=require(_0x7d4a('0x6'));var attributes=require(_0x7d4a('0x7'));module[_0x7d4a('0x8')]=function(_0x19e206,_0x5e9e04){return _0x19e206[_0x7d4a('0x9')]('SalesforceField',attributes,{'tableName':_0x7d4a('0xa'),'paranoid':![],'indexes':[{'name':_0x7d4a('0xb'),'fields':['idField',_0x7d4a('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 99856b2..65d9090 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 _0x0ff5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x0ff5,0x1cd));var _0x50ff=function(_0x54e9e7,_0x337069){_0x54e9e7=_0x54e9e7-0x0;var _0x3d4d8c=_0x0ff5[_0x54e9e7];return _0x3d4d8c;};'use strict';var _=require(_0x50ff('0x0'));var util=require('util');var moment=require(_0x50ff('0x1'));var BPromise=require(_0x50ff('0x2'));var rs=require(_0x50ff('0x3'));var fs=require('fs');var Redis=require(_0x50ff('0x4'));var db=require(_0x50ff('0x5'))['db'];var utils=require(_0x50ff('0x6'));var logger=require(_0x50ff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x50ff('0x8'));var client=jayson[_0x50ff('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf2f29d,_0x21f158,_0xc26ebb){return new BPromise(function(_0x51ae45,_0x5106fd){return client[_0x50ff('0xa')](_0xf2f29d,_0xc26ebb)['then'](function(_0x5cc2c7){logger[_0x50ff('0xb')](_0x50ff('0xc'),_0x21f158,_0x50ff('0xd'));logger[_0x50ff('0xe')](_0x50ff('0xf'),_0x21f158,'request\x20sent',JSON[_0x50ff('0x10')](_0x5cc2c7));if(_0x5cc2c7[_0x50ff('0x11')]){if(_0x5cc2c7[_0x50ff('0x11')][_0x50ff('0x12')]===0x1f4){logger[_0x50ff('0x11')]('SalesforceField,\x20%s,\x20%s',_0x21f158,_0x5cc2c7[_0x50ff('0x11')][_0x50ff('0x13')]);return _0x5106fd(_0x5cc2c7[_0x50ff('0x11')][_0x50ff('0x13')]);}logger[_0x50ff('0x11')]('SalesforceField,\x20%s,\x20%s',_0x21f158,_0x5cc2c7[_0x50ff('0x11')][_0x50ff('0x13')]);return _0x51ae45(_0x5cc2c7[_0x50ff('0x11')][_0x50ff('0x13')]);}else{logger[_0x50ff('0xb')](_0x50ff('0xc'),_0x21f158,'request\x20sent');_0x51ae45(_0x5cc2c7[_0x50ff('0x14')]['message']);}})[_0x50ff('0x15')](function(_0x419f88){logger[_0x50ff('0x11')]('SalesforceField,\x20%s,\x20%s',_0x21f158,_0x419f88);_0x5106fd(_0x419f88);});});} \ No newline at end of file +var _0xbc25=['SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x48b49a,_0x19af12){var _0x3b2587=function(_0x7b66a1){while(--_0x7b66a1){_0x48b49a['push'](_0x48b49a['shift']());}};_0x3b2587(++_0x19af12);}(_0xbc25,0x185));var _0x5bc2=function(_0x2662e5,_0x3db3b1){_0x2662e5=_0x2662e5-0x0;var _0x2c9ca4=_0xbc25[_0x2662e5];return _0x2c9ca4;};'use strict';var _=require(_0x5bc2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5bc2('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5bc2('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bc2('0x3'))(_0x5bc2('0x4'));var config=require(_0x5bc2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x5bc2('0x6')][_0x5bc2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2edf0b,_0x5aae4a,_0x3adeb9){return new BPromise(function(_0x406b2e,_0x11a4a0){return client[_0x5bc2('0x8')](_0x2edf0b,_0x3adeb9)[_0x5bc2('0x9')](function(_0x25c4cc){logger['info'](_0x5bc2('0xa'),_0x5aae4a,_0x5bc2('0xb'));logger[_0x5bc2('0xc')](_0x5bc2('0xd'),_0x5aae4a,_0x5bc2('0xb'),JSON[_0x5bc2('0xe')](_0x25c4cc));if(_0x25c4cc[_0x5bc2('0xf')]){if(_0x25c4cc[_0x5bc2('0xf')][_0x5bc2('0x10')]===0x1f4){logger['error'](_0x5bc2('0xa'),_0x5aae4a,_0x25c4cc[_0x5bc2('0xf')][_0x5bc2('0x11')]);return _0x11a4a0(_0x25c4cc[_0x5bc2('0xf')][_0x5bc2('0x11')]);}logger['error'](_0x5bc2('0xa'),_0x5aae4a,_0x25c4cc[_0x5bc2('0xf')][_0x5bc2('0x11')]);return _0x406b2e(_0x25c4cc[_0x5bc2('0xf')][_0x5bc2('0x11')]);}else{logger['info'](_0x5bc2('0xa'),_0x5aae4a,_0x5bc2('0xb'));_0x406b2e(_0x25c4cc['result'][_0x5bc2('0x11')]);}})[_0x5bc2('0x12')](function(_0xc11d4c){logger[_0x5bc2('0xf')](_0x5bc2('0xa'),_0x5aae4a,_0xc11d4c);_0x11a4a0(_0xc11d4c);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 3e7f6b8..e4ac290 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 _0x5397=['getConfigurations','getFields','post','create','addConfiguration','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x3e84f4,_0x227df7){var _0x585800=function(_0x5d39ad){while(--_0x5d39ad){_0x3e84f4['push'](_0x3e84f4['shift']());}};_0x585800(++_0x227df7);}(_0x5397,0x105));var _0x7539=function(_0x334b98,_0x4a712a){_0x334b98=_0x334b98-0x0;var _0x1a10d9=_0x5397[_0x334b98];return _0x1a10d9;};'use strict';var multer=require('multer');var util=require(_0x7539('0x0'));var path=require(_0x7539('0x1'));var timeout=require(_0x7539('0x2'));var express=require(_0x7539('0x3'));var router=express[_0x7539('0x4')]();var fs_extra=require(_0x7539('0x5'));var auth=require(_0x7539('0x6'));var interaction=require(_0x7539('0x7'));var config=require(_0x7539('0x8'));var controller=require('./intServicenowAccount.controller');router[_0x7539('0x9')]('/',auth[_0x7539('0xa')](),controller[_0x7539('0xb')]);router[_0x7539('0x9')](_0x7539('0xc'),auth['isAuthenticated'](),controller[_0x7539('0xd')]);router['get'](_0x7539('0xe'),auth[_0x7539('0xa')](),controller[_0x7539('0xf')]);router[_0x7539('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7539('0x10')]);router[_0x7539('0x11')]('/',auth[_0x7539('0xa')](),controller[_0x7539('0x12')]);router[_0x7539('0x11')]('/:id/configurations',auth[_0x7539('0xa')](),controller[_0x7539('0x13')]);router['put'](_0x7539('0xc'),auth[_0x7539('0xa')](),controller['update']);router[_0x7539('0x14')](_0x7539('0xc'),auth['isAuthenticated'](),controller[_0x7539('0x15')]);module[_0x7539('0x16')]=router; \ No newline at end of file +var _0xe07b=['addConfiguration','put','/:id','update','destroy','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create'];(function(_0x490e25,_0x2f6932){var _0x1358fb=function(_0x1d6f0a){while(--_0x1d6f0a){_0x490e25['push'](_0x490e25['shift']());}};_0x1358fb(++_0x2f6932);}(_0xe07b,0x181));var _0xbe07=function(_0x157661,_0x3bec27){_0x157661=_0x157661-0x0;var _0x5a2003=_0xe07b[_0x157661];return _0x5a2003;};'use strict';var multer=require(_0xbe07('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe07('0x1'));var router=express[_0xbe07('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xbe07('0x3'));var interaction=require(_0xbe07('0x4'));var config=require(_0xbe07('0x5'));var controller=require('./intServicenowAccount.controller');router[_0xbe07('0x6')]('/',auth[_0xbe07('0x7')](),controller[_0xbe07('0x8')]);router[_0xbe07('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xbe07('0x9')]);router[_0xbe07('0x6')](_0xbe07('0xa'),auth[_0xbe07('0x7')](),controller[_0xbe07('0xb')]);router[_0xbe07('0x6')](_0xbe07('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xbe07('0xd')]('/',auth['isAuthenticated'](),controller[_0xbe07('0xe')]);router[_0xbe07('0xd')](_0xbe07('0xa'),auth[_0xbe07('0x7')](),controller[_0xbe07('0xf')]);router[_0xbe07('0x10')](_0xbe07('0x11'),auth[_0xbe07('0x7')](),controller[_0xbe07('0x12')]);router['delete']('/:id',auth[_0xbe07('0x7')](),controller[_0xbe07('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 1a06532..cb1fed6 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 _0x11d4=['STRING','username','remoteUri','sequelize','exports'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x11d4,0x12f));var _0x411d=function(_0x3ce3b7,_0x29397e){_0x3ce3b7=_0x3ce3b7-0x0;var _0x4c957c=_0x11d4[_0x3ce3b7];return _0x4c957c;};'use strict';var Sequelize=require(_0x411d('0x0'));module[_0x411d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x411d('0x2')]},'username':{'type':Sequelize[_0x411d('0x2')],'unique':_0x411d('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x411d('0x2')]},'remoteUri':{'type':Sequelize[_0x411d('0x2')],'unique':_0x411d('0x4')},'serverUrl':{'type':Sequelize[_0x411d('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc57b=['username','remoteUri','sequelize','exports','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc57b,0x192));var _0xbc57=function(_0x163ecf,_0x5ba049){_0x163ecf=_0x163ecf-0x0;var _0x91c7af=_0xc57b[_0x163ecf];return _0x91c7af;};'use strict';var Sequelize=require(_0xbc57('0x0'));module[_0xbc57('0x1')]={'name':{'type':Sequelize[_0xbc57('0x2')]},'description':{'type':Sequelize[_0xbc57('0x2')]},'username':{'type':Sequelize[_0xbc57('0x2')],'unique':_0xbc57('0x3')},'password':{'type':Sequelize[_0xbc57('0x2')]},'email':{'type':Sequelize[_0xbc57('0x2')]},'remoteUri':{'type':Sequelize[_0xbc57('0x2')],'unique':_0xbc57('0x4')},'serverUrl':{'type':Sequelize[_0xbc57('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 39f3059..2df4e3a 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 _0x8df2=['work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','business_duration','group_list','work_end','caller_id','approval_set','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','urgency','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','sys_mod_count','sys_tags','escalation','correlation_id','location','username','email','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','log','TCL:\x20_object','includes','test','error','Wrong\x20credentials','statusCode','boolean','True','true','False','false','inactive','eml-format','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','update','then','destroy','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','find','create','body','params','ServicenowConfiguration','sort','getConfigurations','findOne','AccountId','Subjects','channel','type','Descriptions','getDescriptions','ServicenowField','getFields','knowledge','close_code','notify','incident_state','category','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','hold_reason','approval_history','resolved_by','opened_by','state','closed_at','cmdb_ci','delivery_plan','active'];(function(_0x422be2,_0x1c439e){var _0x1b820e=function(_0x513cc8){while(--_0x513cc8){_0x422be2['push'](_0x422be2['shift']());}};_0x1b820e(++_0x1c439e);}(_0x8df2,0x1a7));var _0x28df=function(_0x109721,_0x22da20){_0x109721=_0x109721-0x0;var _0x5460aa=_0x8df2[_0x109721];return _0x5460aa;};'use strict';var emlformat=require(_0x28df('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x28df('0x1'));var moment=require(_0x28df('0x2'));var BPromise=require(_0x28df('0x3'));var Mustache=require(_0x28df('0x4'));var util=require('util');var path=require('path');var sox=require(_0x28df('0x5'));var csv=require('to-csv');var ejs=require(_0x28df('0x6'));var fs=require('fs');var fs_extra=require(_0x28df('0x7'));var _=require('lodash');var squel=require(_0x28df('0x8'));var crypto=require(_0x28df('0x9'));var jsforce=require(_0x28df('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x28df('0xb'));var querystring=require(_0x28df('0xc'));var Papa=require(_0x28df('0xd'));var Redis=require(_0x28df('0xe'));var authService=require(_0x28df('0xf'));var qs=require(_0x28df('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28df('0x11'));var logger=require(_0x28df('0x12'))(_0x28df('0x13'));var utils=require('../../config/utils');var config=require(_0x28df('0x14'));var licenseUtil=require(_0x28df('0x15'));var db=require(_0x28df('0x16'))['db'];var integrations=require(_0x28df('0x17'));function respondWithStatusCode(_0x52cff6,_0x1927db){_0x1927db=_0x1927db||0xcc;return function(_0x37a6c0){if(_0x37a6c0){return _0x52cff6[_0x28df('0x18')](_0x1927db);}return _0x52cff6[_0x28df('0x19')](_0x1927db)[_0x28df('0x1a')]();};}function respondWithResult(_0x500927,_0x40bf66){_0x40bf66=_0x40bf66||0xc8;return function(_0x1853de){if(_0x1853de){return _0x500927[_0x28df('0x19')](_0x40bf66)['json'](_0x1853de);}};}function respondWithFilteredResult(_0x3ce8d5,_0x366bd2){return function(_0x16d52a){if(_0x16d52a){var _0x313a31=typeof _0x366bd2[_0x28df('0x1b')]===_0x28df('0x1c')&&typeof _0x366bd2[_0x28df('0x1d')]===_0x28df('0x1c');var _0x41d86b=_0x16d52a['count'];var _0x2d8340=_0x313a31?0x0:_0x366bd2[_0x28df('0x1b')];var _0x5c47eb=_0x313a31?_0x16d52a[_0x28df('0x1e')]:_0x366bd2[_0x28df('0x1b')]+_0x366bd2['limit'];var _0x35ff88;if(_0x5c47eb>=_0x41d86b){_0x5c47eb=_0x41d86b;_0x35ff88=0xc8;}else{_0x35ff88=0xce;}_0x3ce8d5[_0x28df('0x19')](_0x35ff88);return _0x3ce8d5['set'](_0x28df('0x1f'),_0x2d8340+'-'+_0x5c47eb+'/'+_0x41d86b)[_0x28df('0x20')](_0x16d52a);}return null;};}function patchUpdates(_0xdd69da){return function(_0x495cdc){try{jsonpatch[_0x28df('0x21')](_0x495cdc,_0xdd69da,!![]);}catch(_0x3a885b){return BPromise['reject'](_0x3a885b);}return _0x495cdc['save']();};}function saveUpdates(_0x51a864,_0x358a68){return function(_0x6a59ec){if(_0x6a59ec){return _0x6a59ec[_0x28df('0x22')](_0x51a864)[_0x28df('0x23')](function(_0xe0aed6){return _0xe0aed6;});}return null;};}function removeEntity(_0x2d0608,_0x5b28bd){return function(_0x531d5d){if(_0x531d5d){return _0x531d5d[_0x28df('0x24')]()[_0x28df('0x23')](function(){_0x2d0608['status'](0xcc)[_0x28df('0x1a')]();});}};}function handleEntityNotFound(_0xeceaf4,_0xd33b7e){return function(_0x11191f){if(!_0x11191f){_0xeceaf4[_0x28df('0x18')](0x194);}return _0x11191f;};}function handleError(_0x4e2a0c,_0x34d9bc){_0x34d9bc=_0x34d9bc||0x1f4;return function(_0x4f97b3){logger['error'](_0x4f97b3[_0x28df('0x25')]);if(_0x4f97b3[_0x28df('0x26')]){delete _0x4f97b3[_0x28df('0x26')];}_0x4e2a0c[_0x28df('0x19')](_0x34d9bc)[_0x28df('0x27')](_0x4f97b3);};}exports['index']=function(_0xbd9987,_0x450186){var _0x1882df={},_0x505973={},_0x21b4a3={'count':0x0,'rows':[]};var _0x1ec07e=_[_0x28df('0x28')](db[_0x28df('0x29')][_0x28df('0x2a')],function(_0xae9fc1){return{'name':_0xae9fc1[_0x28df('0x2b')],'type':_0xae9fc1['type']['key']};});_0x505973['model']=_[_0x28df('0x28')](_0x1ec07e,'name');_0x505973[_0x28df('0x2c')]=_[_0x28df('0x2d')](_0xbd9987[_0x28df('0x2c')]);_0x505973['filters']=_[_0x28df('0x2e')](_0x505973[_0x28df('0x2f')],_0x505973[_0x28df('0x2c')]);_0x1882df[_0x28df('0x30')]=_[_0x28df('0x2e')](_0x505973[_0x28df('0x2f')],qs[_0x28df('0x31')](_0xbd9987[_0x28df('0x2c')][_0x28df('0x31')]));_0x1882df[_0x28df('0x30')]=_0x1882df[_0x28df('0x30')][_0x28df('0x32')]?_0x1882df[_0x28df('0x30')]:_0x505973[_0x28df('0x2f')];if(!_0xbd9987[_0x28df('0x2c')][_0x28df('0x33')](_0x28df('0x34'))){_0x1882df[_0x28df('0x1d')]=qs[_0x28df('0x1d')](_0xbd9987[_0x28df('0x2c')][_0x28df('0x1d')]);_0x1882df['offset']=qs[_0x28df('0x1b')](_0xbd9987[_0x28df('0x2c')][_0x28df('0x1b')]);}_0x1882df[_0x28df('0x35')]=qs['sort'](_0xbd9987[_0x28df('0x2c')]['sort']);_0x1882df[_0x28df('0x36')]=qs[_0x28df('0x37')](_[_0x28df('0x38')](_0xbd9987[_0x28df('0x2c')],_0x505973[_0x28df('0x37')]),_0x1ec07e);if(_0xbd9987[_0x28df('0x2c')][_0x28df('0x39')]){_0x1882df['where']=_[_0x28df('0x3a')](_0x1882df[_0x28df('0x36')],{'$or':_[_0x28df('0x28')](_0x1ec07e,function(_0x4ebac8){if(_0x4ebac8['type']!==_0x28df('0x3b')){var _0x5f4f15={};_0x5f4f15[_0x4ebac8['name']]={'$like':'%'+_0xbd9987[_0x28df('0x2c')]['filter']+'%'};return _0x5f4f15;}})});}_0x1882df=_[_0x28df('0x3a')]({},_0x1882df,_0xbd9987[_0x28df('0x3c')]);var _0x9fb665={'where':_0x1882df[_0x28df('0x36')]};return db['ServicenowAccount'][_0x28df('0x1e')](_0x9fb665)[_0x28df('0x23')](function(_0x4457fe){_0x21b4a3[_0x28df('0x1e')]=_0x4457fe;if(_0xbd9987[_0x28df('0x2c')][_0x28df('0x3d')]){_0x1882df[_0x28df('0x3e')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x1882df);})[_0x28df('0x23')](function(_0x6a2561){_0x21b4a3['rows']=_0x6a2561;return _0x21b4a3;})[_0x28df('0x23')](respondWithFilteredResult(_0x450186,_0x1882df))[_0x28df('0x3f')](handleError(_0x450186,null));};exports['show']=function(_0x1577ae,_0xad9e69){var _0x3f0914={'raw':![],'where':{'id':_0x1577ae['params']['id']}},_0x5e1a81={};_0x5e1a81['model']=_[_0x28df('0x2d')](db[_0x28df('0x29')][_0x28df('0x2a')]);_0x5e1a81[_0x28df('0x2c')]=_[_0x28df('0x2d')](_0x1577ae[_0x28df('0x2c')]);_0x5e1a81[_0x28df('0x37')]=_[_0x28df('0x2e')](_0x5e1a81[_0x28df('0x2f')],_0x5e1a81[_0x28df('0x2c')]);_0x3f0914['attributes']=_[_0x28df('0x2e')](_0x5e1a81[_0x28df('0x2f')],qs[_0x28df('0x31')](_0x1577ae['query'][_0x28df('0x31')]));_0x3f0914[_0x28df('0x30')]=_0x3f0914[_0x28df('0x30')][_0x28df('0x32')]?_0x3f0914[_0x28df('0x30')]:_0x5e1a81[_0x28df('0x2f')];if(_0x1577ae[_0x28df('0x2c')]['includeAll']){_0x3f0914[_0x28df('0x3e')]=[{'all':!![]}];}_0x3f0914=_['merge']({},_0x3f0914,_0x1577ae[_0x28df('0x3c')]);return db[_0x28df('0x29')][_0x28df('0x40')](_0x3f0914)[_0x28df('0x23')](handleEntityNotFound(_0xad9e69,null))['then'](respondWithResult(_0xad9e69,null))[_0x28df('0x3f')](handleError(_0xad9e69,null));};exports[_0x28df('0x41')]=function(_0x3acbf7,_0x5c8790){return db[_0x28df('0x29')][_0x28df('0x41')](_0x3acbf7[_0x28df('0x42')],{})[_0x28df('0x23')](respondWithResult(_0x5c8790,0xc9))['catch'](handleError(_0x5c8790,null));};exports[_0x28df('0x22')]=function(_0x204886,_0x562fec){if(_0x204886[_0x28df('0x42')]['id']){delete _0x204886[_0x28df('0x42')]['id'];}return db['ServicenowAccount'][_0x28df('0x40')]({'where':{'id':_0x204886[_0x28df('0x43')]['id']}})['then'](handleEntityNotFound(_0x562fec,null))[_0x28df('0x23')](saveUpdates(_0x204886[_0x28df('0x42')],null))[_0x28df('0x23')](respondWithResult(_0x562fec,null))[_0x28df('0x3f')](handleError(_0x562fec,null));};exports[_0x28df('0x24')]=function(_0x4eb514,_0x59a892){return db['ServicenowAccount'][_0x28df('0x40')]({'where':{'id':_0x4eb514[_0x28df('0x43')]['id']}})['then'](handleEntityNotFound(_0x59a892,null))[_0x28df('0x23')](removeEntity(_0x59a892,null))[_0x28df('0x3f')](handleError(_0x59a892,null));};exports['getConfigurations']=function(_0x1c8cd7,_0x1b6a60,_0x32d255){var _0x3f1342={};var _0x5e1503={};var _0x5486fa;var _0x548f76;return db[_0x28df('0x29')]['findOne']({'where':{'id':_0x1c8cd7[_0x28df('0x43')]['id']}})[_0x28df('0x23')](handleEntityNotFound(_0x1b6a60,null))['then'](function(_0x1c8732){if(_0x1c8732){_0x5486fa=_0x1c8732;_0x5e1503[_0x28df('0x2f')]=_['keys'](db[_0x28df('0x44')][_0x28df('0x2a')]);_0x5e1503[_0x28df('0x2c')]=_[_0x28df('0x2d')](_0x1c8cd7['query']);_0x5e1503['filters']=_[_0x28df('0x2e')](_0x5e1503[_0x28df('0x2f')],_0x5e1503[_0x28df('0x2c')]);_0x3f1342['attributes']=_['intersection'](_0x5e1503[_0x28df('0x2f')],qs[_0x28df('0x31')](_0x1c8cd7[_0x28df('0x2c')][_0x28df('0x31')]));_0x3f1342['attributes']=_0x3f1342[_0x28df('0x30')]['length']?_0x3f1342['attributes']:_0x5e1503[_0x28df('0x2f')];_0x3f1342[_0x28df('0x35')]=qs[_0x28df('0x45')](_0x1c8cd7[_0x28df('0x2c')][_0x28df('0x45')]);_0x3f1342[_0x28df('0x36')]=qs[_0x28df('0x37')](_['pick'](_0x1c8cd7['query'],_0x5e1503['filters']));if(_0x1c8cd7[_0x28df('0x2c')]['filter']){_0x3f1342[_0x28df('0x36')]=_['merge'](_0x3f1342[_0x28df('0x36')],{'$or':_[_0x28df('0x28')](_0x3f1342[_0x28df('0x30')],function(_0x5e93e7){var _0x1de318={};_0x1de318[_0x5e93e7]={'$like':'%'+_0x1c8cd7[_0x28df('0x2c')][_0x28df('0x39')]+'%'};return _0x1de318;})});}_0x3f1342=_[_0x28df('0x3a')]({},_0x3f1342,_0x1c8cd7[_0x28df('0x3c')]);return _0x5486fa[_0x28df('0x46')](_0x3f1342);}})[_0x28df('0x23')](function(_0x57ba03){if(_0x57ba03){_0x548f76=_0x57ba03[_0x28df('0x32')];if(!_0x1c8cd7[_0x28df('0x2c')]['hasOwnProperty'](_0x28df('0x34'))){_0x3f1342[_0x28df('0x1d')]=qs[_0x28df('0x1d')](_0x1c8cd7['query'][_0x28df('0x1d')]);_0x3f1342[_0x28df('0x1b')]=qs[_0x28df('0x1b')](_0x1c8cd7[_0x28df('0x2c')][_0x28df('0x1b')]);}return _0x5486fa[_0x28df('0x46')](_0x3f1342);}})[_0x28df('0x23')](function(_0x198b4d){if(_0x198b4d){return _0x198b4d?{'count':_0x548f76,'rows':_0x198b4d}:null;}})[_0x28df('0x23')](respondWithResult(_0x1b6a60,null))[_0x28df('0x3f')](handleError(_0x1b6a60,null));};exports['addConfiguration']=function(_0x3def4d,_0x1da1e8,_0x17efa5){if(_0x3def4d['body']['id']){delete _0x3def4d[_0x28df('0x42')]['id'];}return db[_0x28df('0x29')][_0x28df('0x47')]({'where':{'id':_0x3def4d['params']['id']}})[_0x28df('0x23')](handleEntityNotFound(_0x1da1e8,null))['then'](function(_0x15b5d9){if(_0x15b5d9){_0x3def4d[_0x28df('0x42')][_0x28df('0x48')]=_0x15b5d9['id'];_0x3def4d[_0x28df('0x42')][_0x28df('0x49')]=integrations['getSubjects'](_0x3def4d[_0x28df('0x42')][_0x28df('0x4a')],_0x3def4d['body'][_0x28df('0x4b')]);_0x3def4d['body'][_0x28df('0x4c')]=integrations[_0x28df('0x4d')](_0x3def4d['body']['channel'],_0x3def4d[_0x28df('0x42')]['type']);return db[_0x28df('0x44')][_0x28df('0x41')](_0x3def4d[_0x28df('0x42')],{'include':[{'model':db[_0x28df('0x4e')],'as':'Subjects'},{'model':db[_0x28df('0x4e')],'as':'Descriptions'}]});}return null;})[_0x28df('0x23')](respondWithResult(_0x1da1e8,null))['catch'](handleError(_0x1da1e8,null));};exports[_0x28df('0x4f')]=function(_0x3ab2ca,_0x15437f,_0x2989ff){var _0x542df9=['made_sla','hold_reason',_0x28df('0x50'),'subcategory',_0x28df('0x51'),_0x28df('0x52'),_0x28df('0x53'),'severity',_0x28df('0x54')];var _0x4908c0=['parent',_0x28df('0x55'),_0x28df('0x56'),_0x28df('0x57'),_0x28df('0x58'),_0x28df('0x59'),'child_incidents',_0x28df('0x5a'),_0x28df('0x5b'),'number',_0x28df('0x5c'),'sys_updated_by',_0x28df('0x5d'),'user_input','sys_created_on','sys_domain',_0x28df('0x5e'),'sys_created_by',_0x28df('0x50'),_0x28df('0x35'),'calendar_stc',_0x28df('0x5f'),_0x28df('0x60'),_0x28df('0x61'),'impact',_0x28df('0x62'),_0x28df('0x63'),_0x28df('0x64'),_0x28df('0x65'),_0x28df('0x66'),'rfc',_0x28df('0x67'),_0x28df('0x68'),'opened_at',_0x28df('0x69'),_0x28df('0x6a'),_0x28df('0x6b'),'reopened_time','resolved_at',_0x28df('0x6c'),_0x28df('0x6d'),'subcategory',_0x28df('0x6e'),'short_description','close_code',_0x28df('0x6f'),_0x28df('0x70'),_0x28df('0x71'),_0x28df('0x72'),_0x28df('0x73'),_0x28df('0x74'),_0x28df('0x75'),_0x28df('0x76'),_0x28df('0x52'),_0x28df('0x77'),_0x28df('0x78'),_0x28df('0x79'),_0x28df('0x7a'),'parent_incident',_0x28df('0x7b'),_0x28df('0x7c'),'reopened_by',_0x28df('0x53'),_0x28df('0x7d'),'problem_id',_0x28df('0x7e'),_0x28df('0x7f'),_0x28df('0x80'),_0x28df('0x81'),_0x28df('0x82'),_0x28df('0x83'),_0x28df('0x84'),_0x28df('0x85'),'comments_and_work_notes','due_date',_0x28df('0x86'),'reopen_count',_0x28df('0x87'),_0x28df('0x88'),'upon_approval',_0x28df('0x89'),_0x28df('0x8a'),_0x28df('0x54')];var _0x3d697a='';var _0x10b124='';var _0x29899c=[];var _0x188f64='';var _0x4ca639='';var _0x295bb4=[];var _0x2a711e='';var _0x2738ed='';var _0x167901={};var _0x46671c='';return db[_0x28df('0x29')][_0x28df('0x47')]({'where':{'id':_0x3ab2ca['params']['id']},'attributes':['id',_0x28df('0x8b'),'password',_0x28df('0x8c'),'remoteUri',_0x28df('0x8d')]})[_0x28df('0x23')](handleEntityNotFound(_0x15437f,null))[_0x28df('0x23')](function(_0x247485){if(_0x247485){_0x46671c=_0x247485[_0x28df('0x8e')];var _0x5624ec=_0x46671c[_0x28df('0x8f')](-0x1);if(_0x5624ec==='/'){_0x46671c=_0x46671c[_0x28df('0x90')](0x0,_0x46671c[_0x28df('0x91')](_0x5624ec));}_0x2738ed=util[_0x28df('0x92')](_0x28df('0x93'),_0x46671c);_0x2a711e=util[_0x28df('0x92')](_0x28df('0x94'),_0x46671c);_0x167901={'user':_0x247485[_0x28df('0x8b')],'pass':_0x247485[_0x28df('0x95')]};var _0xa3f379={'method':_0x28df('0x96'),'uri':_0x2738ed+_0x28df('0x97'),'auth':_0x167901,'json':!![]};return rp(_0xa3f379);}})[_0x28df('0x23')](function(_0x5085f2){if(_0x5085f2[_0x28df('0x98')]['length']>0x0){_0x3d697a=_0x5085f2[_0x28df('0x98')];}console['log'](_0x28df('0x99'),_0x3d697a);_0x295bb4=[];_0x10b124=Object[_0x28df('0x9a')]([],_0x3d697a);_[_0x28df('0x9b')](_0x10b124,function(_0x511388){return!_0x542df9['includes'](_0x511388[_0x28df('0x26')]);});_0x10b124[_0x28df('0x9c')](function(_0x104639){var _0x38877b=createFieldObject(_0x2a711e,_0x167901,_0x104639[_0x28df('0x9d')],_0x104639[_0x28df('0x26')],_0x104639[_0x28df('0x9e')],![]);_0x295bb4[_0x28df('0x9f')](_0x38877b);});return Promise[_0x28df('0xa0')](_0x295bb4);})[_0x28df('0x23')](function(_0x1da8a8){_0x29899c=_0x1da8a8;_0x188f64=Object['assign']([],_0x3d697a);console[_0x28df('0xa1')](_0x28df('0xa2'),_0x3d697a);_[_0x28df('0x9b')](_0x188f64,function(_0x201c12){return _0x4908c0[_0x28df('0xa3')](_0x201c12['name']);});console[_0x28df('0xa1')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x188f64);_0x295bb4=[];_0x188f64['forEach'](function(_0x40de3a){var _0x4dd7a4=createFieldObject(_0x2a711e,_0x167901,_0x40de3a['internalType'],_0x40de3a['name'],_0x40de3a[_0x28df('0x9e')],!![]);_0x295bb4[_0x28df('0x9f')](_0x4dd7a4);});return Promise[_0x28df('0xa0')](_0x295bb4);})[_0x28df('0x23')](function(_0x2776d1){_0x4ca639=_0x2776d1;var _0x41871f=_0x29899c['concat'](_0x4ca639);return{'count':_0x41871f[_0x28df('0x32')],'rows':_0x41871f};})['then'](respondWithResult(_0x15437f,null))[_0x28df('0x3f')](function(_0x33c83f){console['log']('ServiceNow\x20error:\x20'+_0x33c83f);var _0x4dfb79=_0x3ab2ca['query'][_0x28df('0xa4')]?0x1f4:_0x33c83f['statusCode']||0x1f4;logger[_0x28df('0xa5')](_0x33c83f['stack']);delete _0x33c83f[_0x28df('0x26')];if(_0x4dfb79===0x191){_0x4dfb79=0x190;}_0x15437f[_0x28df('0x19')](_0x4dfb79)['send'](_0x3ab2ca[_0x28df('0x2c')][_0x28df('0xa4')]?{'message':_0x28df('0xa6'),'statusCode':_0x33c83f[_0x28df('0xa7')]}:_0x33c83f);});};function createFieldObject(_0x217107,_0x316c60,_0xd29f6d,_0x14d20c,_0x2c5479,_0x4a48f9){return new Promise(function(_0x1a71aa,_0x509617){var _0x4e92fe={'id':_0x14d20c,'name':_0x2c5479,'custom':_0x4a48f9};if(_0xd29f6d===_0x28df('0xa8')){_0x4e92fe[_0x28df('0x3c')]=[{'name':_0x28df('0xa9'),'value':_0x28df('0xaa')},{'name':_0x28df('0xab'),'value':_0x28df('0xac')}];_0x1a71aa(_0x4e92fe);}else{var _0x2da384={'method':_0x28df('0x96'),'uri':_0x217107+'sys_choice?sysparm_query=name=incident^element='+_0x14d20c,'auth':_0x316c60,'json':!![]};return rp(_0x2da384)[_0x28df('0x23')](function(_0x5d0695){var _0x33ff2e=[];if(_0x5d0695[_0x28df('0x98')][_0x28df('0x32')]>0x0){_0x5d0695['result'][_0x28df('0x9c')](function(_0x9b904f){if(_0x9b904f[_0x28df('0xad')]===_0x28df('0xac')){var _0x5d0b37={'name':_0x9b904f[_0x28df('0x9e')],'value':_0x9b904f['value']};_0x33ff2e[_0x28df('0x9f')](_0x5d0b37);}});}_0x4e92fe['options']=_0x33ff2e;if(_0x4e92fe[_0x28df('0x3c')][_0x28df('0x32')]>0x0){_0x1a71aa(_0x4e92fe);}else{if(_0x4a48f9==![]){_0x1a71aa();}else{_0x1a71aa(_0x4e92fe);}}});}});} \ No newline at end of file +var _0x3042=['getDescriptions','ServicenowField','Subjects','Descriptions','getFields','made_sla','knowledge','close_code','notify','incident_state','severity','watch_list','sys_updated_on','child_incidents','hold_reason','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','business_service','sys_domain_path','expected_start','opened_at','business_duration','work_end','reopened_time','approval_set','short_description','correlation_display','delivery_task','assignment_group','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','sys_mod_count','escalation','correlation_id','location','category','username','password','email','remoteUri','serverUrl','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','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','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','filter','merge','includeAll','rows','catch','params','include','options','find','create','body','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','AccountId','getSubjects','channel'];(function(_0x1ffe86,_0x1f920c){var _0x44c631=function(_0x1c8bfa){while(--_0x1c8bfa){_0x1ffe86['push'](_0x1ffe86['shift']());}};_0x44c631(++_0x1f920c);}(_0x3042,0x1b7));var _0x2304=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0x3042[_0x35ef6b];return _0x3ad145;};'use strict';var emlformat=require(_0x2304('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2304('0x1'));var rp=require(_0x2304('0x2'));var moment=require('moment');var BPromise=require(_0x2304('0x3'));var Mustache=require(_0x2304('0x4'));var util=require(_0x2304('0x5'));var path=require(_0x2304('0x6'));var sox=require('sox');var csv=require(_0x2304('0x7'));var ejs=require(_0x2304('0x8'));var fs=require('fs');var fs_extra=require(_0x2304('0x9'));var _=require(_0x2304('0xa'));var squel=require(_0x2304('0xb'));var crypto=require(_0x2304('0xc'));var jsforce=require(_0x2304('0xd'));var deskjs=require(_0x2304('0xe'));var toCsv=require(_0x2304('0x7'));var querystring=require(_0x2304('0xf'));var Papa=require(_0x2304('0x10'));var Redis=require(_0x2304('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2304('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2304('0x13'));var logger=require(_0x2304('0x14'))(_0x2304('0x15'));var utils=require('../../config/utils');var config=require(_0x2304('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x2304('0x17'));function respondWithStatusCode(_0x2cc6b7,_0x1ab829){_0x1ab829=_0x1ab829||0xcc;return function(_0x423874){if(_0x423874){return _0x2cc6b7[_0x2304('0x18')](_0x1ab829);}return _0x2cc6b7[_0x2304('0x19')](_0x1ab829)[_0x2304('0x1a')]();};}function respondWithResult(_0x47352a,_0x5662af){_0x5662af=_0x5662af||0xc8;return function(_0x34e21e){if(_0x34e21e){return _0x47352a[_0x2304('0x19')](_0x5662af)['json'](_0x34e21e);}};}function respondWithFilteredResult(_0x59cb30,_0x134268){return function(_0x4677ee){if(_0x4677ee){var _0x5a5470=typeof _0x134268[_0x2304('0x1b')]===_0x2304('0x1c')&&typeof _0x134268[_0x2304('0x1d')]===_0x2304('0x1c');var _0x34c4ff=_0x4677ee[_0x2304('0x1e')];var _0x250615=_0x5a5470?0x0:_0x134268[_0x2304('0x1b')];var _0x410b31=_0x5a5470?_0x4677ee[_0x2304('0x1e')]:_0x134268[_0x2304('0x1b')]+_0x134268['limit'];var _0x206b51;if(_0x410b31>=_0x34c4ff){_0x410b31=_0x34c4ff;_0x206b51=0xc8;}else{_0x206b51=0xce;}_0x59cb30[_0x2304('0x19')](_0x206b51);return _0x59cb30[_0x2304('0x1f')](_0x2304('0x20'),_0x250615+'-'+_0x410b31+'/'+_0x34c4ff)[_0x2304('0x21')](_0x4677ee);}return null;};}function patchUpdates(_0xaaea92){return function(_0x58bbf0){try{jsonpatch['apply'](_0x58bbf0,_0xaaea92,!![]);}catch(_0x28823b){return BPromise[_0x2304('0x22')](_0x28823b);}return _0x58bbf0[_0x2304('0x23')]();};}function saveUpdates(_0x7a4668,_0x281d17){return function(_0xcd2d){if(_0xcd2d){return _0xcd2d['update'](_0x7a4668)[_0x2304('0x24')](function(_0xa52c8f){return _0xa52c8f;});}return null;};}function removeEntity(_0x23994e,_0x14e294){return function(_0x47a655){if(_0x47a655){return _0x47a655[_0x2304('0x25')]()[_0x2304('0x24')](function(){_0x23994e[_0x2304('0x19')](0xcc)[_0x2304('0x1a')]();});}};}function handleEntityNotFound(_0x4bff75,_0x1b2ad6){return function(_0x206c46){if(!_0x206c46){_0x4bff75['sendStatus'](0x194);}return _0x206c46;};}function handleError(_0xc25b4b,_0x57460a){_0x57460a=_0x57460a||0x1f4;return function(_0x1153f7){logger[_0x2304('0x26')](_0x1153f7[_0x2304('0x27')]);if(_0x1153f7[_0x2304('0x28')]){delete _0x1153f7[_0x2304('0x28')];}_0xc25b4b[_0x2304('0x19')](_0x57460a)[_0x2304('0x29')](_0x1153f7);};}exports[_0x2304('0x2a')]=function(_0x13f830,_0x2de0c4){var _0x1506e7={},_0x283f29={},_0x3a5b7f={'count':0x0,'rows':[]};var _0x12f5fa=_[_0x2304('0x2b')](db[_0x2304('0x2c')][_0x2304('0x2d')],function(_0x249931){return{'name':_0x249931[_0x2304('0x2e')],'type':_0x249931[_0x2304('0x2f')]['key']};});_0x283f29[_0x2304('0x30')]=_[_0x2304('0x2b')](_0x12f5fa,_0x2304('0x28'));_0x283f29[_0x2304('0x31')]=_[_0x2304('0x32')](_0x13f830[_0x2304('0x31')]);_0x283f29['filters']=_[_0x2304('0x33')](_0x283f29[_0x2304('0x30')],_0x283f29[_0x2304('0x31')]);_0x1506e7['attributes']=_[_0x2304('0x33')](_0x283f29[_0x2304('0x30')],qs[_0x2304('0x34')](_0x13f830[_0x2304('0x31')][_0x2304('0x34')]));_0x1506e7['attributes']=_0x1506e7[_0x2304('0x35')][_0x2304('0x36')]?_0x1506e7['attributes']:_0x283f29[_0x2304('0x30')];if(!_0x13f830['query'][_0x2304('0x37')](_0x2304('0x38'))){_0x1506e7['limit']=qs[_0x2304('0x1d')](_0x13f830[_0x2304('0x31')][_0x2304('0x1d')]);_0x1506e7['offset']=qs['offset'](_0x13f830[_0x2304('0x31')][_0x2304('0x1b')]);}_0x1506e7[_0x2304('0x39')]=qs[_0x2304('0x3a')](_0x13f830[_0x2304('0x31')][_0x2304('0x3a')]);_0x1506e7['where']=qs[_0x2304('0x3b')](_[_0x2304('0x3c')](_0x13f830[_0x2304('0x31')],_0x283f29[_0x2304('0x3b')]),_0x12f5fa);if(_0x13f830['query']['filter']){_0x1506e7[_0x2304('0x3d')]=_['merge'](_0x1506e7[_0x2304('0x3d')],{'$or':_[_0x2304('0x2b')](_0x12f5fa,function(_0x46cd64){if(_0x46cd64['type']!=='VIRTUAL'){var _0x46b0af={};_0x46b0af[_0x46cd64[_0x2304('0x28')]]={'$like':'%'+_0x13f830[_0x2304('0x31')][_0x2304('0x3e')]+'%'};return _0x46b0af;}})});}_0x1506e7=_[_0x2304('0x3f')]({},_0x1506e7,_0x13f830['options']);var _0x59fbc6={'where':_0x1506e7[_0x2304('0x3d')]};return db[_0x2304('0x2c')][_0x2304('0x1e')](_0x59fbc6)['then'](function(_0x446829){_0x3a5b7f['count']=_0x446829;if(_0x13f830['query'][_0x2304('0x40')]){_0x1506e7['include']=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x1506e7);})[_0x2304('0x24')](function(_0xfc89fe){_0x3a5b7f[_0x2304('0x41')]=_0xfc89fe;return _0x3a5b7f;})[_0x2304('0x24')](respondWithFilteredResult(_0x2de0c4,_0x1506e7))[_0x2304('0x42')](handleError(_0x2de0c4,null));};exports['show']=function(_0xaf94a4,_0x3b4bcd){var _0x7bb686={'raw':![],'where':{'id':_0xaf94a4[_0x2304('0x43')]['id']}},_0x128510={};_0x128510[_0x2304('0x30')]=_[_0x2304('0x32')](db[_0x2304('0x2c')]['rawAttributes']);_0x128510[_0x2304('0x31')]=_[_0x2304('0x32')](_0xaf94a4[_0x2304('0x31')]);_0x128510[_0x2304('0x3b')]=_[_0x2304('0x33')](_0x128510[_0x2304('0x30')],_0x128510[_0x2304('0x31')]);_0x7bb686[_0x2304('0x35')]=_[_0x2304('0x33')](_0x128510[_0x2304('0x30')],qs[_0x2304('0x34')](_0xaf94a4[_0x2304('0x31')][_0x2304('0x34')]));_0x7bb686['attributes']=_0x7bb686['attributes']['length']?_0x7bb686[_0x2304('0x35')]:_0x128510[_0x2304('0x30')];if(_0xaf94a4[_0x2304('0x31')][_0x2304('0x40')]){_0x7bb686[_0x2304('0x44')]=[{'all':!![]}];}_0x7bb686=_[_0x2304('0x3f')]({},_0x7bb686,_0xaf94a4[_0x2304('0x45')]);return db[_0x2304('0x2c')][_0x2304('0x46')](_0x7bb686)['then'](handleEntityNotFound(_0x3b4bcd,null))['then'](respondWithResult(_0x3b4bcd,null))['catch'](handleError(_0x3b4bcd,null));};exports[_0x2304('0x47')]=function(_0x4b6e65,_0x13744f){return db['ServicenowAccount'][_0x2304('0x47')](_0x4b6e65[_0x2304('0x48')],{})['then'](respondWithResult(_0x13744f,0xc9))['catch'](handleError(_0x13744f,null));};exports['update']=function(_0x2bd585,_0x246a19){if(_0x2bd585[_0x2304('0x48')]['id']){delete _0x2bd585[_0x2304('0x48')]['id'];}return db[_0x2304('0x2c')][_0x2304('0x46')]({'where':{'id':_0x2bd585[_0x2304('0x43')]['id']}})[_0x2304('0x24')](handleEntityNotFound(_0x246a19,null))[_0x2304('0x24')](saveUpdates(_0x2bd585[_0x2304('0x48')],null))[_0x2304('0x24')](respondWithResult(_0x246a19,null))[_0x2304('0x42')](handleError(_0x246a19,null));};exports[_0x2304('0x25')]=function(_0x146c42,_0x5933d6){return db[_0x2304('0x2c')][_0x2304('0x46')]({'where':{'id':_0x146c42[_0x2304('0x43')]['id']}})[_0x2304('0x24')](handleEntityNotFound(_0x5933d6,null))['then'](removeEntity(_0x5933d6,null))['catch'](handleError(_0x5933d6,null));};exports['getConfigurations']=function(_0x2ba1fd,_0x5e5c0f,_0x3a84cc){var _0x5bcd8f={};var _0x127225={};var _0x2449f5;var _0x117ece;return db['ServicenowAccount'][_0x2304('0x49')]({'where':{'id':_0x2ba1fd[_0x2304('0x43')]['id']}})['then'](handleEntityNotFound(_0x5e5c0f,null))[_0x2304('0x24')](function(_0x114279){if(_0x114279){_0x2449f5=_0x114279;_0x127225[_0x2304('0x30')]=_['keys'](db[_0x2304('0x4a')]['rawAttributes']);_0x127225['query']=_[_0x2304('0x32')](_0x2ba1fd[_0x2304('0x31')]);_0x127225[_0x2304('0x3b')]=_[_0x2304('0x33')](_0x127225[_0x2304('0x30')],_0x127225[_0x2304('0x31')]);_0x5bcd8f[_0x2304('0x35')]=_['intersection'](_0x127225[_0x2304('0x30')],qs[_0x2304('0x34')](_0x2ba1fd['query']['fields']));_0x5bcd8f[_0x2304('0x35')]=_0x5bcd8f['attributes'][_0x2304('0x36')]?_0x5bcd8f[_0x2304('0x35')]:_0x127225['model'];_0x5bcd8f[_0x2304('0x39')]=qs[_0x2304('0x3a')](_0x2ba1fd[_0x2304('0x31')][_0x2304('0x3a')]);_0x5bcd8f[_0x2304('0x3d')]=qs[_0x2304('0x3b')](_['pick'](_0x2ba1fd['query'],_0x127225[_0x2304('0x3b')]));if(_0x2ba1fd[_0x2304('0x31')][_0x2304('0x3e')]){_0x5bcd8f[_0x2304('0x3d')]=_[_0x2304('0x3f')](_0x5bcd8f[_0x2304('0x3d')],{'$or':_[_0x2304('0x2b')](_0x5bcd8f[_0x2304('0x35')],function(_0x46afe4){var _0x587a17={};_0x587a17[_0x46afe4]={'$like':'%'+_0x2ba1fd[_0x2304('0x31')]['filter']+'%'};return _0x587a17;})});}_0x5bcd8f=_[_0x2304('0x3f')]({},_0x5bcd8f,_0x2ba1fd[_0x2304('0x45')]);return _0x2449f5['getConfigurations'](_0x5bcd8f);}})[_0x2304('0x24')](function(_0x2cd5c5){if(_0x2cd5c5){_0x117ece=_0x2cd5c5[_0x2304('0x36')];if(!_0x2ba1fd[_0x2304('0x31')]['hasOwnProperty'](_0x2304('0x38'))){_0x5bcd8f[_0x2304('0x1d')]=qs[_0x2304('0x1d')](_0x2ba1fd[_0x2304('0x31')][_0x2304('0x1d')]);_0x5bcd8f[_0x2304('0x1b')]=qs[_0x2304('0x1b')](_0x2ba1fd[_0x2304('0x31')]['offset']);}return _0x2449f5[_0x2304('0x4b')](_0x5bcd8f);}})[_0x2304('0x24')](function(_0x300b81){if(_0x300b81){return _0x300b81?{'count':_0x117ece,'rows':_0x300b81}:null;}})[_0x2304('0x24')](respondWithResult(_0x5e5c0f,null))[_0x2304('0x42')](handleError(_0x5e5c0f,null));};exports[_0x2304('0x4c')]=function(_0xd552d5,_0x719a79,_0x236daf){if(_0xd552d5[_0x2304('0x48')]['id']){delete _0xd552d5['body']['id'];}return db[_0x2304('0x2c')][_0x2304('0x49')]({'where':{'id':_0xd552d5['params']['id']}})[_0x2304('0x24')](handleEntityNotFound(_0x719a79,null))[_0x2304('0x24')](function(_0x4bcd06){if(_0x4bcd06){_0xd552d5[_0x2304('0x48')][_0x2304('0x4d')]=_0x4bcd06['id'];_0xd552d5['body']['Subjects']=integrations[_0x2304('0x4e')](_0xd552d5['body'][_0x2304('0x4f')],_0xd552d5[_0x2304('0x48')][_0x2304('0x2f')]);_0xd552d5['body']['Descriptions']=integrations[_0x2304('0x50')](_0xd552d5[_0x2304('0x48')][_0x2304('0x4f')],_0xd552d5[_0x2304('0x48')]['type']);return db[_0x2304('0x4a')][_0x2304('0x47')](_0xd552d5[_0x2304('0x48')],{'include':[{'model':db[_0x2304('0x51')],'as':_0x2304('0x52')},{'model':db[_0x2304('0x51')],'as':_0x2304('0x53')}]});}return null;})[_0x2304('0x24')](respondWithResult(_0x719a79,null))['catch'](handleError(_0x719a79,null));};exports[_0x2304('0x54')]=function(_0x4bbdb6,_0x10686d,_0x592d2c){var _0x1b8f55=[_0x2304('0x55'),'hold_reason',_0x2304('0x56'),'subcategory',_0x2304('0x57'),_0x2304('0x58'),_0x2304('0x59'),_0x2304('0x5a'),'category'];var _0x1023d1=['parent',_0x2304('0x55'),'caused_by',_0x2304('0x5b'),'upon_reject',_0x2304('0x5c'),_0x2304('0x5d'),_0x2304('0x5e'),'approval_history','number',_0x2304('0x5f'),_0x2304('0x60'),_0x2304('0x61'),_0x2304('0x62'),_0x2304('0x63'),_0x2304('0x64'),_0x2304('0x65'),_0x2304('0x66'),_0x2304('0x56'),_0x2304('0x39'),_0x2304('0x67'),_0x2304('0x68'),_0x2304('0x69'),_0x2304('0x6a'),_0x2304('0x6b'),_0x2304('0x6c'),'work_notes_list',_0x2304('0x6d'),'priority',_0x2304('0x6e'),'rfc','time_worked',_0x2304('0x6f'),_0x2304('0x70'),_0x2304('0x71'),'group_list',_0x2304('0x72'),_0x2304('0x73'),'resolved_at','caller_id',_0x2304('0x74'),'subcategory','work_notes',_0x2304('0x75'),_0x2304('0x57'),_0x2304('0x76'),_0x2304('0x77'),'work_start',_0x2304('0x78'),'business_stc','additional_assignee_list',_0x2304('0x79'),_0x2304('0x7a'),_0x2304('0x58'),_0x2304('0x7b'),_0x2304('0x7c'),_0x2304('0x7d'),_0x2304('0x7e'),_0x2304('0x7f'),_0x2304('0x80'),_0x2304('0x81'),'reopened_by',_0x2304('0x59'),_0x2304('0x82'),_0x2304('0x83'),_0x2304('0x84'),_0x2304('0x85'),_0x2304('0x86'),'assigned_to',_0x2304('0x5a'),_0x2304('0x87'),_0x2304('0x88'),_0x2304('0x89'),'comments_and_work_notes','due_date',_0x2304('0x8a'),'reopen_count','sys_tags',_0x2304('0x8b'),'upon_approval',_0x2304('0x8c'),_0x2304('0x8d'),_0x2304('0x8e')];var _0x324780='';var _0x4a9f79='';var _0x5175cd=[];var _0xef854f='';var _0x4e0ec2='';var _0x250d23=[];var _0x49cd81='';var _0x348017='';var _0x50ccad={};var _0x22cbe8='';return db[_0x2304('0x2c')][_0x2304('0x49')]({'where':{'id':_0x4bbdb6[_0x2304('0x43')]['id']},'attributes':['id',_0x2304('0x8f'),_0x2304('0x90'),_0x2304('0x91'),_0x2304('0x92'),_0x2304('0x93')]})[_0x2304('0x24')](handleEntityNotFound(_0x10686d,null))[_0x2304('0x24')](function(_0x360c8f){if(_0x360c8f){_0x22cbe8=_0x360c8f[_0x2304('0x92')];var _0x314aae=_0x22cbe8['slice'](-0x1);if(_0x314aae==='/'){_0x22cbe8=_0x22cbe8['substring'](0x0,_0x22cbe8['lastIndexOf'](_0x314aae));}_0x348017=util['format']('%s/api/now/doc/table/schema/',_0x22cbe8);_0x49cd81=util[_0x2304('0x94')](_0x2304('0x95'),_0x22cbe8);_0x50ccad={'user':_0x360c8f['username'],'pass':_0x360c8f[_0x2304('0x90')]};var _0x6a33ad={'method':_0x2304('0x96'),'uri':_0x348017+_0x2304('0x97'),'auth':_0x50ccad,'json':!![]};return rp(_0x6a33ad);}})[_0x2304('0x24')](function(_0x44d559){if(_0x44d559[_0x2304('0x98')][_0x2304('0x36')]>0x0){_0x324780=_0x44d559['result'];}console[_0x2304('0x99')](_0x2304('0x9a'),_0x324780);_0x250d23=[];_0x4a9f79=Object[_0x2304('0x9b')]([],_0x324780);_[_0x2304('0x9c')](_0x4a9f79,function(_0x529790){return!_0x1b8f55[_0x2304('0x9d')](_0x529790[_0x2304('0x28')]);});_0x4a9f79[_0x2304('0x9e')](function(_0x473d2d){var _0x395112=createFieldObject(_0x49cd81,_0x50ccad,_0x473d2d[_0x2304('0x9f')],_0x473d2d[_0x2304('0x28')],_0x473d2d['label'],![]);_0x250d23[_0x2304('0xa0')](_0x395112);});return Promise[_0x2304('0xa1')](_0x250d23);})[_0x2304('0x24')](function(_0x34011c){_0x5175cd=_0x34011c;_0xef854f=Object[_0x2304('0x9b')]([],_0x324780);console[_0x2304('0x99')](_0x2304('0xa2'),_0x324780);_['remove'](_0xef854f,function(_0x5e51d3){return _0x1023d1[_0x2304('0x9d')](_0x5e51d3[_0x2304('0x28')]);});console[_0x2304('0x99')](_0x2304('0xa3'),_0xef854f);_0x250d23=[];_0xef854f[_0x2304('0x9e')](function(_0x3db6c3){var _0x20fd81=createFieldObject(_0x49cd81,_0x50ccad,_0x3db6c3[_0x2304('0x9f')],_0x3db6c3[_0x2304('0x28')],_0x3db6c3[_0x2304('0xa4')],!![]);_0x250d23['push'](_0x20fd81);});return Promise[_0x2304('0xa1')](_0x250d23);})[_0x2304('0x24')](function(_0x1b3f12){_0x4e0ec2=_0x1b3f12;var _0x4e5b73=_0x5175cd['concat'](_0x4e0ec2);return{'count':_0x4e5b73[_0x2304('0x36')],'rows':_0x4e5b73};})[_0x2304('0x24')](respondWithResult(_0x10686d,null))['catch'](function(_0x304fb5){console[_0x2304('0x99')](_0x2304('0xa5')+_0x304fb5);var _0x92cbdc=_0x4bbdb6[_0x2304('0x31')]['test']?0x1f4:_0x304fb5[_0x2304('0xa6')]||0x1f4;logger[_0x2304('0x26')](_0x304fb5[_0x2304('0x27')]);delete _0x304fb5[_0x2304('0x28')];if(_0x92cbdc===0x191){_0x92cbdc=0x190;}_0x10686d[_0x2304('0x19')](_0x92cbdc)[_0x2304('0x29')](_0x4bbdb6[_0x2304('0x31')]['test']?{'message':_0x2304('0xa7'),'statusCode':_0x304fb5['statusCode']}:_0x304fb5);});};function createFieldObject(_0x449216,_0x1947ce,_0x35443e,_0x40b650,_0x4b5b1a,_0x2b2c2f){return new Promise(function(_0x39a062,_0x24671d){var _0x1020bf={'id':_0x40b650,'name':_0x4b5b1a,'custom':_0x2b2c2f};if(_0x35443e==='boolean'){_0x1020bf['options']=[{'name':'True','value':_0x2304('0xa8')},{'name':_0x2304('0xa9'),'value':'false'}];_0x39a062(_0x1020bf);}else{var _0x26f8fe={'method':_0x2304('0x96'),'uri':_0x449216+_0x2304('0xaa')+_0x40b650,'auth':_0x1947ce,'json':!![]};return rp(_0x26f8fe)[_0x2304('0x24')](function(_0x21664d){var _0x5a0ac6=[];if(_0x21664d[_0x2304('0x98')][_0x2304('0x36')]>0x0){_0x21664d[_0x2304('0x98')]['forEach'](function(_0x5e17f1){if(_0x5e17f1[_0x2304('0xab')]===_0x2304('0xac')){var _0x514a85={'name':_0x5e17f1[_0x2304('0xa4')],'value':_0x5e17f1['value']};_0x5a0ac6['push'](_0x514a85);}});}_0x1020bf[_0x2304('0x45')]=_0x5a0ac6;if(_0x1020bf[_0x2304('0x45')][_0x2304('0x36')]>0x0){_0x39a062(_0x1020bf);}else{if(_0x2b2c2f==![]){_0x39a062();}else{_0x39a062(_0x1020bf);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index b7b6e0c..f90d31e 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 _0x9c5a=['int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x4a1f6d,_0xc93606){var _0x4568a1=function(_0x1f33b7){while(--_0x1f33b7){_0x4a1f6d['push'](_0x4a1f6d['shift']());}};_0x4568a1(++_0xc93606);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0xb048b8,_0x3d82ab){_0xb048b8=_0xb048b8-0x0;var _0x5c0ece=_0x9c5a[_0xb048b8];return _0x5c0ece;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xa9c5('0x8'));module['exports']=function(_0x394d84,_0x3df556){return _0x394d84['define']('ServicenowAccount',attributes,{'tableName':_0xa9c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d58=['request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','bluebird'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0x5d58,0x187));var _0x85d5=function(_0x56de52,_0xf537aa){_0x56de52=_0x56de52-0x0;var _0x3bb011=_0x5d58[_0x56de52];return _0x3bb011;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x85d5('0x4'));module[_0x85d5('0x5')]=function(_0x578fad,_0x46e7b4){return _0x578fad['define'](_0x85d5('0x6'),attributes,{'tableName':_0x85d5('0x7'),'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 103d9a6..7e5eabf 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 _0xeaef=['raw','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ServicenowAccount','options','attributes','include','model','map','GetServicenowAccount','ShowServicenowAccount','find'];(function(_0x334dd4,_0x3507da){var _0x231358=function(_0x4e9d69){while(--_0x4e9d69){_0x334dd4['push'](_0x334dd4['shift']());}};_0x231358(++_0x3507da);}(_0xeaef,0x1c2));var _0xfeae=function(_0x3e9e46,_0x4c5e3a){_0x3e9e46=_0x3e9e46-0x0;var _0x8c9837=_0xeaef[_0x3e9e46];return _0x8c9837;};'use strict';var _=require(_0xfeae('0x0'));var util=require(_0xfeae('0x1'));var moment=require('moment');var BPromise=require(_0xfeae('0x2'));var rs=require(_0xfeae('0x3'));var fs=require('fs');var Redis=require(_0xfeae('0x4'));var db=require(_0xfeae('0x5'))['db'];var utils=require(_0xfeae('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfeae('0x7'));var client=jayson['client'][_0xfeae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x194d97,_0x3bb2d0,_0x3f5ebe){return new BPromise(function(_0x1665c5,_0x464e0b){return client[_0xfeae('0x9')](_0x194d97,_0x3f5ebe)[_0xfeae('0xa')](function(_0x35de28){logger[_0xfeae('0xb')](_0xfeae('0xc'),_0x3bb2d0,'request\x20sent');logger[_0xfeae('0xd')](_0xfeae('0xe'),_0x3bb2d0,_0xfeae('0xf'),JSON[_0xfeae('0x10')](_0x35de28));if(_0x35de28[_0xfeae('0x11')]){if(_0x35de28['error']['code']===0x1f4){logger[_0xfeae('0x11')](_0xfeae('0xc'),_0x3bb2d0,_0x35de28['error'][_0xfeae('0x12')]);return _0x464e0b(_0x35de28[_0xfeae('0x11')][_0xfeae('0x12')]);}logger[_0xfeae('0x11')](_0xfeae('0xc'),_0x3bb2d0,_0x35de28[_0xfeae('0x11')][_0xfeae('0x12')]);return _0x1665c5(_0x35de28['error'][_0xfeae('0x12')]);}else{logger[_0xfeae('0xb')](_0xfeae('0xc'),_0x3bb2d0,_0xfeae('0xf'));_0x1665c5(_0x35de28[_0xfeae('0x13')]['message']);}})[_0xfeae('0x14')](function(_0x393da4){logger[_0xfeae('0x11')](_0xfeae('0xc'),_0x3bb2d0,_0x393da4);_0x464e0b(_0x393da4);});});}exports['GetServicenowAccount']=function(_0x269c7f){var _0x356bd1=this;return new Promise(function(_0x20401b,_0x4717db){return db[_0xfeae('0x15')]['findAll']({'raw':_0x269c7f[_0xfeae('0x16')]?_0x269c7f[_0xfeae('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x269c7f[_0xfeae('0x16')]?_0x269c7f['options']['where']||null:null,'attributes':_0x269c7f[_0xfeae('0x16')]?_0x269c7f['options'][_0xfeae('0x17')]||null:null,'limit':_0x269c7f[_0xfeae('0x16')]?_0x269c7f[_0xfeae('0x16')]['limit']||null:null,'include':_0x269c7f[_0xfeae('0x16')]?_0x269c7f['options']['include']?_['map'](_0x269c7f['options'][_0xfeae('0x18')],function(_0x438e91){return{'model':db[_0x438e91[_0xfeae('0x19')]],'as':_0x438e91['as'],'attributes':_0x438e91[_0xfeae('0x17')],'include':_0x438e91[_0xfeae('0x18')]?_[_0xfeae('0x1a')](_0x438e91['include'],function(_0x560276){return{'model':db[_0x560276[_0xfeae('0x19')]],'as':_0x560276['as'],'attributes':_0x560276[_0xfeae('0x17')],'include':_0x560276['include']?_[_0xfeae('0x1a')](_0x560276[_0xfeae('0x18')],function(_0x3d8f71){return{'model':db[_0x3d8f71[_0xfeae('0x19')]],'as':_0x3d8f71['as'],'attributes':_0x3d8f71[_0xfeae('0x17')]};}):[]};}):[]};}):[]:[]})[_0xfeae('0xa')](function(_0x472754){logger['info'](_0xfeae('0x1b'),_0x269c7f);logger[_0xfeae('0xd')](_0xfeae('0x1b'),_0x269c7f,JSON[_0xfeae('0x10')](_0x472754));_0x20401b(_0x472754);})[_0xfeae('0x14')](function(_0x3ce80a){logger[_0xfeae('0x11')](_0xfeae('0x1b'),_0x3ce80a['message'],_0x269c7f);_0x4717db(_0x356bd1[_0xfeae('0x11')](0x1f4,_0x3ce80a[_0xfeae('0x12')]));});});};exports[_0xfeae('0x1c')]=function(_0x143000){var _0x94302a=this;return new Promise(function(_0x43cc7d,_0x4074f1){return db[_0xfeae('0x15')][_0xfeae('0x1d')]({'raw':_0x143000[_0xfeae('0x16')]?_0x143000[_0xfeae('0x16')][_0xfeae('0x1e')]===undefined?!![]:![]:!![],'where':_0x143000[_0xfeae('0x16')]?_0x143000[_0xfeae('0x16')][_0xfeae('0x1f')]||null:null,'attributes':_0x143000['options']?_0x143000[_0xfeae('0x16')][_0xfeae('0x17')]||null:null,'include':_0x143000[_0xfeae('0x16')]?_0x143000[_0xfeae('0x16')][_0xfeae('0x18')]?_[_0xfeae('0x1a')](_0x143000[_0xfeae('0x16')][_0xfeae('0x18')],function(_0x4da7dd){return{'model':db[_0x4da7dd[_0xfeae('0x19')]],'as':_0x4da7dd['as'],'attributes':_0x4da7dd['attributes'],'include':_0x4da7dd[_0xfeae('0x18')]?_['map'](_0x4da7dd[_0xfeae('0x18')],function(_0x71cfd2){return{'model':db[_0x71cfd2[_0xfeae('0x19')]],'as':_0x71cfd2['as'],'attributes':_0x71cfd2[_0xfeae('0x17')],'include':_0x71cfd2[_0xfeae('0x18')]?_[_0xfeae('0x1a')](_0x71cfd2[_0xfeae('0x18')],function(_0x4ae33a){return{'model':db[_0x4ae33a[_0xfeae('0x19')]],'as':_0x4ae33a['as'],'attributes':_0x4ae33a[_0xfeae('0x17')]};}):[]};}):[]};}):[]:[]})[_0xfeae('0xa')](function(_0x4f4fcd){logger[_0xfeae('0xb')]('ShowServicenowAccount',_0x143000);logger[_0xfeae('0xd')](_0xfeae('0x1c'),_0x143000,JSON[_0xfeae('0x10')](_0x4f4fcd));_0x43cc7d(_0x4f4fcd);})[_0xfeae('0x14')](function(_0x502a17){logger[_0xfeae('0x11')](_0xfeae('0x1c'),_0x502a17[_0xfeae('0x12')],_0x143000);_0x4074f1(_0x94302a['error'](0x1f4,_0x502a17[_0xfeae('0x12')]));});});}; \ No newline at end of file +var _0x55e8=['ServicenowAccount','findAll','options','where','model','attributes','map','include','catch','find','raw','info','ShowServicenowAccount','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','GetServicenowAccount'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55e8,0x1ef));var _0x855e=function(_0x386d41,_0x3f92c5){_0x386d41=_0x386d41-0x0;var _0x5da2e1=_0x55e8[_0x386d41];return _0x5da2e1;};'use strict';var _=require(_0x855e('0x0'));var util=require(_0x855e('0x1'));var moment=require(_0x855e('0x2'));var BPromise=require(_0x855e('0x3'));var rs=require(_0x855e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x855e('0x5'))['db'];var utils=require(_0x855e('0x6'));var logger=require('../../config/logger')(_0x855e('0x7'));var config=require(_0x855e('0x8'));var jayson=require(_0x855e('0x9'));var client=jayson[_0x855e('0xa')][_0x855e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b926f,_0x4d7db9,_0x3994e9){return new BPromise(function(_0x287370,_0xde2e13){return client[_0x855e('0xc')](_0x3b926f,_0x3994e9)[_0x855e('0xd')](function(_0x3b3805){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x4d7db9,'request\x20sent');logger[_0x855e('0xe')](_0x855e('0xf'),_0x4d7db9,_0x855e('0x10'),JSON['stringify'](_0x3b3805));if(_0x3b3805[_0x855e('0x11')]){if(_0x3b3805[_0x855e('0x11')][_0x855e('0x12')]===0x1f4){logger[_0x855e('0x11')](_0x855e('0x13'),_0x4d7db9,_0x3b3805['error'][_0x855e('0x14')]);return _0xde2e13(_0x3b3805[_0x855e('0x11')][_0x855e('0x14')]);}logger[_0x855e('0x11')](_0x855e('0x13'),_0x4d7db9,_0x3b3805[_0x855e('0x11')][_0x855e('0x14')]);return _0x287370(_0x3b3805['error'][_0x855e('0x14')]);}else{logger['info'](_0x855e('0x13'),_0x4d7db9,'request\x20sent');_0x287370(_0x3b3805[_0x855e('0x15')][_0x855e('0x14')]);}})['catch'](function(_0x4bc4b0){logger['error'](_0x855e('0x13'),_0x4d7db9,_0x4bc4b0);_0xde2e13(_0x4bc4b0);});});}exports[_0x855e('0x16')]=function(_0x4083d9){var _0x191ed9=this;return new Promise(function(_0x8ba6b1,_0x32b702){return db[_0x855e('0x17')][_0x855e('0x18')]({'raw':_0x4083d9[_0x855e('0x19')]?_0x4083d9[_0x855e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4083d9[_0x855e('0x19')]?_0x4083d9[_0x855e('0x19')][_0x855e('0x1a')]||null:null,'attributes':_0x4083d9['options']?_0x4083d9['options']['attributes']||null:null,'limit':_0x4083d9[_0x855e('0x19')]?_0x4083d9[_0x855e('0x19')]['limit']||null:null,'include':_0x4083d9['options']?_0x4083d9[_0x855e('0x19')]['include']?_['map'](_0x4083d9['options']['include'],function(_0x1da4e0){return{'model':db[_0x1da4e0[_0x855e('0x1b')]],'as':_0x1da4e0['as'],'attributes':_0x1da4e0[_0x855e('0x1c')],'include':_0x1da4e0['include']?_[_0x855e('0x1d')](_0x1da4e0[_0x855e('0x1e')],function(_0x51d96c){return{'model':db[_0x51d96c['model']],'as':_0x51d96c['as'],'attributes':_0x51d96c['attributes'],'include':_0x51d96c[_0x855e('0x1e')]?_['map'](_0x51d96c['include'],function(_0x5836f3){return{'model':db[_0x5836f3['model']],'as':_0x5836f3['as'],'attributes':_0x5836f3[_0x855e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14f2ec){logger['info'](_0x855e('0x16'),_0x4083d9);logger[_0x855e('0xe')](_0x855e('0x16'),_0x4083d9,JSON['stringify'](_0x14f2ec));_0x8ba6b1(_0x14f2ec);})[_0x855e('0x1f')](function(_0x439bf3){logger[_0x855e('0x11')](_0x855e('0x16'),_0x439bf3['message'],_0x4083d9);_0x32b702(_0x191ed9[_0x855e('0x11')](0x1f4,_0x439bf3['message']));});});};exports['ShowServicenowAccount']=function(_0x6a3b81){var _0xf86b36=this;return new Promise(function(_0x4dcf2c,_0x496522){return db[_0x855e('0x17')][_0x855e('0x20')]({'raw':_0x6a3b81[_0x855e('0x19')]?_0x6a3b81[_0x855e('0x19')][_0x855e('0x21')]===undefined?!![]:![]:!![],'where':_0x6a3b81[_0x855e('0x19')]?_0x6a3b81[_0x855e('0x19')][_0x855e('0x1a')]||null:null,'attributes':_0x6a3b81[_0x855e('0x19')]?_0x6a3b81[_0x855e('0x19')][_0x855e('0x1c')]||null:null,'include':_0x6a3b81[_0x855e('0x19')]?_0x6a3b81[_0x855e('0x19')][_0x855e('0x1e')]?_[_0x855e('0x1d')](_0x6a3b81[_0x855e('0x19')][_0x855e('0x1e')],function(_0x57d47c){return{'model':db[_0x57d47c['model']],'as':_0x57d47c['as'],'attributes':_0x57d47c[_0x855e('0x1c')],'include':_0x57d47c[_0x855e('0x1e')]?_[_0x855e('0x1d')](_0x57d47c[_0x855e('0x1e')],function(_0x1d573a){return{'model':db[_0x1d573a[_0x855e('0x1b')]],'as':_0x1d573a['as'],'attributes':_0x1d573a[_0x855e('0x1c')],'include':_0x1d573a[_0x855e('0x1e')]?_['map'](_0x1d573a['include'],function(_0x12ccb0){return{'model':db[_0x12ccb0[_0x855e('0x1b')]],'as':_0x12ccb0['as'],'attributes':_0x12ccb0['attributes']};}):[]};}):[]};}):[]:[]})[_0x855e('0xd')](function(_0x40036f){logger[_0x855e('0x22')]('ShowServicenowAccount',_0x6a3b81);logger[_0x855e('0xe')](_0x855e('0x23'),_0x6a3b81,JSON[_0x855e('0x24')](_0x40036f));_0x4dcf2c(_0x40036f);})[_0x855e('0x1f')](function(_0x45b88d){logger[_0x855e('0x11')](_0x855e('0x23'),_0x45b88d[_0x855e('0x14')],_0x6a3b81);_0x496522(_0xf86b36[_0x855e('0x11')](0x1f4,_0x45b88d[_0x855e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 265747b..99db3cf 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 _0x20e3=['getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects'];(function(_0x37de5d,_0x403dfc){var _0x1937da=function(_0x4bb723){while(--_0x4bb723){_0x37de5d['push'](_0x37de5d['shift']());}};_0x1937da(++_0x403dfc);}(_0x20e3,0x199));var _0x320e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x20e3[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x320e('0x0'));var util=require(_0x320e('0x1'));var path=require(_0x320e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x320e('0x3')]();var fs_extra=require(_0x320e('0x4'));var auth=require(_0x320e('0x5'));var interaction=require(_0x320e('0x6'));var config=require(_0x320e('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0x320e('0x8')]('/',auth['isAuthenticated'](),controller[_0x320e('0x9')]);router['get'](_0x320e('0xa'),auth[_0x320e('0xb')](),controller[_0x320e('0xc')]);router[_0x320e('0x8')](_0x320e('0xd'),auth[_0x320e('0xb')](),controller[_0x320e('0xe')]);router[_0x320e('0x8')](_0x320e('0xf'),auth[_0x320e('0xb')](),controller[_0x320e('0x10')]);router['get'](_0x320e('0x11'),auth[_0x320e('0xb')](),controller[_0x320e('0x12')]);router[_0x320e('0x13')]('/',auth[_0x320e('0xb')](),controller['create']);router[_0x320e('0x14')](_0x320e('0xa'),auth[_0x320e('0xb')](),controller[_0x320e('0x15')]);router[_0x320e('0x16')](_0x320e('0xa'),auth[_0x320e('0xb')](),controller[_0x320e('0x17')]);module[_0x320e('0x18')]=router; \ No newline at end of file +var _0xb421=['create','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','post'];(function(_0x4717bf,_0x69a7ab){var _0x2ffe7c=function(_0x52a047){while(--_0x52a047){_0x4717bf['push'](_0x4717bf['shift']());}};_0x2ffe7c(++_0x69a7ab);}(_0xb421,0x155));var _0x1b42=function(_0x121b3a,_0x3706ab){_0x121b3a=_0x121b3a-0x0;var _0x3859f5=_0xb421[_0x121b3a];return _0x3859f5;};'use strict';var multer=require(_0x1b42('0x0'));var util=require(_0x1b42('0x1'));var path=require(_0x1b42('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b42('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1b42('0x4'));var interaction=require(_0x1b42('0x5'));var config=require('../../config/environment');var controller=require(_0x1b42('0x6'));router[_0x1b42('0x7')]('/',auth['isAuthenticated'](),controller[_0x1b42('0x8')]);router[_0x1b42('0x7')](_0x1b42('0x9'),auth[_0x1b42('0xa')](),controller['show']);router[_0x1b42('0x7')](_0x1b42('0xb'),auth[_0x1b42('0xa')](),controller[_0x1b42('0xc')]);router[_0x1b42('0x7')]('/:id/subjects',auth[_0x1b42('0xa')](),controller[_0x1b42('0xd')]);router[_0x1b42('0x7')](_0x1b42('0xe'),auth[_0x1b42('0xa')](),controller['getDescriptions']);router[_0x1b42('0xf')]('/',auth[_0x1b42('0xa')](),controller[_0x1b42('0x10')]);router[_0x1b42('0x11')](_0x1b42('0x9'),auth['isAuthenticated'](),controller[_0x1b42('0x12')]);router[_0x1b42('0x13')](_0x1b42('0x9'),auth[_0x1b42('0xa')](),controller[_0x1b42('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 805de9f..e37c9b0 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 _0x113e=['exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x113e,0xba));var _0xe113=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x113e[_0x11c573];return _0x6b72de;};'use strict';var Sequelize=require('sequelize');module[_0xe113('0x0')]={'name':{'type':Sequelize[_0xe113('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0950=['exports','STRING'];(function(_0x1eedff,_0x1a349b){var _0x4e760e=function(_0x4fa5b2){while(--_0x4fa5b2){_0x1eedff['push'](_0x1eedff['shift']());}};_0x4e760e(++_0x1a349b);}(_0x0950,0xd4));var _0x0095=function(_0x528bb5,_0x119c5b){_0x528bb5=_0x528bb5-0x0;var _0x58e8ca=_0x0950[_0x528bb5];return _0x58e8ca;};'use strict';var Sequelize=require('sequelize');module[_0x0095('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0095('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index d22ec7b..be15f67 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 _0xda33=['request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','apply','reject','save','update','then','error','name','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','getFields','findOne','order','nolimit','getSubjects','ServicenowField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xda33,0x187));var _0x3da3=function(_0x6d053f,_0x2e4108){_0x6d053f=_0x6d053f-0x0;var _0x5b6234=_0xda33[_0x6d053f];return _0x5b6234;};'use strict';var emlformat=require(_0x3da3('0x0'));var rimraf=require(_0x3da3('0x1'));var zipdir=require(_0x3da3('0x2'));var jsonpatch=require(_0x3da3('0x3'));var rp=require(_0x3da3('0x4'));var moment=require('moment');var BPromise=require(_0x3da3('0x5'));var Mustache=require('mustache');var util=require(_0x3da3('0x6'));var path=require(_0x3da3('0x7'));var sox=require('sox');var csv=require(_0x3da3('0x8'));var ejs=require(_0x3da3('0x9'));var fs=require('fs');var fs_extra=require(_0x3da3('0xa'));var _=require(_0x3da3('0xb'));var squel=require(_0x3da3('0xc'));var crypto=require('crypto');var jsforce=require(_0x3da3('0xd'));var deskjs=require(_0x3da3('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3da3('0xf'));var Redis=require(_0x3da3('0x10'));var authService=require(_0x3da3('0x11'));var qs=require(_0x3da3('0x12'));var as=require(_0x3da3('0x13'));var hardwareService=require(_0x3da3('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3da3('0x15'));var config=require(_0x3da3('0x16'));var licenseUtil=require(_0x3da3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfbecd1,_0x20e66f){_0x20e66f=_0x20e66f||0xcc;return function(_0x2a3ff7){if(_0x2a3ff7){return _0xfbecd1[_0x3da3('0x18')](_0x20e66f);}return _0xfbecd1[_0x3da3('0x19')](_0x20e66f)[_0x3da3('0x1a')]();};}function respondWithResult(_0x411f04,_0x3aed79){_0x3aed79=_0x3aed79||0xc8;return function(_0x3d902e){if(_0x3d902e){return _0x411f04[_0x3da3('0x19')](_0x3aed79)[_0x3da3('0x1b')](_0x3d902e);}};}function respondWithFilteredResult(_0x57e954,_0x359538){return function(_0x39944a){if(_0x39944a){var _0x4328d6=typeof _0x359538['offset']==='undefined'&&typeof _0x359538[_0x3da3('0x1c')]==='undefined';var _0x4de4f5=_0x39944a[_0x3da3('0x1d')];var _0x56b2a9=_0x4328d6?0x0:_0x359538[_0x3da3('0x1e')];var _0x1ed997=_0x4328d6?_0x39944a[_0x3da3('0x1d')]:_0x359538[_0x3da3('0x1e')]+_0x359538[_0x3da3('0x1c')];var _0x3afbd3;if(_0x1ed997>=_0x4de4f5){_0x1ed997=_0x4de4f5;_0x3afbd3=0xc8;}else{_0x3afbd3=0xce;}_0x57e954[_0x3da3('0x19')](_0x3afbd3);return _0x57e954[_0x3da3('0x1f')]('Content-Range',_0x56b2a9+'-'+_0x1ed997+'/'+_0x4de4f5)[_0x3da3('0x1b')](_0x39944a);}return null;};}function patchUpdates(_0x4c59df){return function(_0x350f6e){try{jsonpatch[_0x3da3('0x20')](_0x350f6e,_0x4c59df,!![]);}catch(_0x1bde7){return BPromise[_0x3da3('0x21')](_0x1bde7);}return _0x350f6e[_0x3da3('0x22')]();};}function saveUpdates(_0x5eac27,_0x39560c){return function(_0x5d810f){if(_0x5d810f){return _0x5d810f[_0x3da3('0x23')](_0x5eac27)['then'](function(_0x36bc89){return _0x36bc89;});}return null;};}function removeEntity(_0x1bd147,_0x3fa73c){return function(_0x16247){if(_0x16247){return _0x16247['destroy']()[_0x3da3('0x24')](function(){_0x1bd147[_0x3da3('0x19')](0xcc)[_0x3da3('0x1a')]();});}};}function handleEntityNotFound(_0x3fc911,_0x3dd3eb){return function(_0x3fabd3){if(!_0x3fabd3){_0x3fc911[_0x3da3('0x18')](0x194);}return _0x3fabd3;};}function handleError(_0x413781,_0x5baafc){_0x5baafc=_0x5baafc||0x1f4;return function(_0x40befc){logger[_0x3da3('0x25')](_0x40befc['stack']);if(_0x40befc['name']){delete _0x40befc[_0x3da3('0x26')];}_0x413781[_0x3da3('0x19')](_0x5baafc)['send'](_0x40befc);};}exports['index']=function(_0x144a89,_0x1119eb){var _0x1200e2={},_0x2f8c16={},_0x3072ba={'count':0x0,'rows':[]};var _0x4a6a3c=_['map'](db[_0x3da3('0x27')][_0x3da3('0x28')],function(_0x5029d9){return{'name':_0x5029d9[_0x3da3('0x29')],'type':_0x5029d9[_0x3da3('0x2a')][_0x3da3('0x2b')]};});_0x2f8c16[_0x3da3('0x2c')]=_[_0x3da3('0x2d')](_0x4a6a3c,_0x3da3('0x26'));_0x2f8c16[_0x3da3('0x2e')]=_[_0x3da3('0x2f')](_0x144a89['query']);_0x2f8c16[_0x3da3('0x30')]=_[_0x3da3('0x31')](_0x2f8c16[_0x3da3('0x2c')],_0x2f8c16[_0x3da3('0x2e')]);_0x1200e2[_0x3da3('0x32')]=_[_0x3da3('0x31')](_0x2f8c16[_0x3da3('0x2c')],qs[_0x3da3('0x33')](_0x144a89[_0x3da3('0x2e')][_0x3da3('0x33')]));_0x1200e2[_0x3da3('0x32')]=_0x1200e2[_0x3da3('0x32')]['length']?_0x1200e2[_0x3da3('0x32')]:_0x2f8c16['model'];if(!_0x144a89['query'][_0x3da3('0x34')]('nolimit')){_0x1200e2[_0x3da3('0x1c')]=qs['limit'](_0x144a89[_0x3da3('0x2e')][_0x3da3('0x1c')]);_0x1200e2[_0x3da3('0x1e')]=qs[_0x3da3('0x1e')](_0x144a89[_0x3da3('0x2e')][_0x3da3('0x1e')]);}_0x1200e2['order']=qs[_0x3da3('0x35')](_0x144a89[_0x3da3('0x2e')]['sort']);_0x1200e2['where']=qs['filters'](_[_0x3da3('0x36')](_0x144a89['query'],_0x2f8c16[_0x3da3('0x30')]),_0x4a6a3c);if(_0x144a89[_0x3da3('0x2e')]['filter']){_0x1200e2[_0x3da3('0x37')]=_[_0x3da3('0x38')](_0x1200e2[_0x3da3('0x37')],{'$or':_['map'](_0x4a6a3c,function(_0x479bd4){if(_0x479bd4['type']!==_0x3da3('0x39')){var _0x2eeb46={};_0x2eeb46[_0x479bd4[_0x3da3('0x26')]]={'$like':'%'+_0x144a89['query'][_0x3da3('0x3a')]+'%'};return _0x2eeb46;}})});}_0x1200e2=_[_0x3da3('0x38')]({},_0x1200e2,_0x144a89[_0x3da3('0x3b')]);var _0x445602={'where':_0x1200e2[_0x3da3('0x37')]};return db['ServicenowConfiguration'][_0x3da3('0x1d')](_0x445602)[_0x3da3('0x24')](function(_0xc9b8cc){_0x3072ba['count']=_0xc9b8cc;if(_0x144a89[_0x3da3('0x2e')][_0x3da3('0x3c')]){_0x1200e2[_0x3da3('0x3d')]=[{'all':!![]}];}return db[_0x3da3('0x27')][_0x3da3('0x3e')](_0x1200e2);})['then'](function(_0x2990d9){_0x3072ba[_0x3da3('0x3f')]=_0x2990d9;return _0x3072ba;})['then'](respondWithFilteredResult(_0x1119eb,_0x1200e2))[_0x3da3('0x40')](handleError(_0x1119eb,null));};exports[_0x3da3('0x41')]=function(_0x2e3e65,_0x26a40c){var _0x4290ff={'raw':![],'where':{'id':_0x2e3e65[_0x3da3('0x42')]['id']}},_0x452349={};_0x452349['model']=_['keys'](db['ServicenowConfiguration'][_0x3da3('0x28')]);_0x452349[_0x3da3('0x2e')]=_[_0x3da3('0x2f')](_0x2e3e65[_0x3da3('0x2e')]);_0x452349['filters']=_['intersection'](_0x452349[_0x3da3('0x2c')],_0x452349[_0x3da3('0x2e')]);_0x4290ff['attributes']=_[_0x3da3('0x31')](_0x452349[_0x3da3('0x2c')],qs['fields'](_0x2e3e65[_0x3da3('0x2e')][_0x3da3('0x33')]));_0x4290ff[_0x3da3('0x32')]=_0x4290ff['attributes'][_0x3da3('0x43')]?_0x4290ff[_0x3da3('0x32')]:_0x452349[_0x3da3('0x2c')];if(_0x2e3e65[_0x3da3('0x2e')][_0x3da3('0x3c')]){_0x4290ff[_0x3da3('0x3d')]=[{'all':!![]}];}_0x4290ff=_[_0x3da3('0x38')]({},_0x4290ff,_0x2e3e65['options']);return db['ServicenowConfiguration'][_0x3da3('0x44')](_0x4290ff)['then'](handleEntityNotFound(_0x26a40c,null))[_0x3da3('0x24')](respondWithResult(_0x26a40c,null))[_0x3da3('0x40')](handleError(_0x26a40c,null));};exports[_0x3da3('0x45')]=function(_0x2909ec,_0x1ae2b5){return db[_0x3da3('0x27')][_0x3da3('0x45')](_0x2909ec[_0x3da3('0x46')],{})[_0x3da3('0x24')](respondWithResult(_0x1ae2b5,0xc9))[_0x3da3('0x40')](handleError(_0x1ae2b5,null));};exports['update']=function(_0x11ffb6,_0x201373){if(_0x11ffb6[_0x3da3('0x46')]['id']){delete _0x11ffb6[_0x3da3('0x46')]['id'];}return db[_0x3da3('0x27')]['find']({'where':{'id':_0x11ffb6[_0x3da3('0x42')]['id']}})['then'](handleEntityNotFound(_0x201373,null))[_0x3da3('0x24')](saveUpdates(_0x11ffb6['body'],null))['then'](respondWithResult(_0x201373,null))[_0x3da3('0x40')](handleError(_0x201373,null));};exports[_0x3da3('0x47')]=function(_0x59d224,_0x4e69b2){return db[_0x3da3('0x27')][_0x3da3('0x44')]({'where':{'id':_0x59d224[_0x3da3('0x42')]['id']}})[_0x3da3('0x24')](handleEntityNotFound(_0x4e69b2,null))[_0x3da3('0x24')](removeEntity(_0x4e69b2,null))[_0x3da3('0x40')](handleError(_0x4e69b2,null));};exports[_0x3da3('0x48')]=function(_0x5954ec,_0x1b90e1,_0x1a2088){var _0x5b80ef={};var _0x9b285d={};var _0x10b5d0;var _0x26502d;return db['ServicenowConfiguration'][_0x3da3('0x49')]({'where':{'id':_0x5954ec['params']['id']}})[_0x3da3('0x24')](handleEntityNotFound(_0x1b90e1,null))[_0x3da3('0x24')](function(_0x86dfaa){if(_0x86dfaa){_0x10b5d0=_0x86dfaa;_0x9b285d['model']=_['keys'](db['ServicenowField'][_0x3da3('0x28')]);_0x9b285d[_0x3da3('0x2e')]=_['keys'](_0x5954ec['query']);_0x9b285d[_0x3da3('0x30')]=_[_0x3da3('0x31')](_0x9b285d['model'],_0x9b285d[_0x3da3('0x2e')]);_0x5b80ef[_0x3da3('0x32')]=_[_0x3da3('0x31')](_0x9b285d[_0x3da3('0x2c')],qs['fields'](_0x5954ec[_0x3da3('0x2e')]['fields']));_0x5b80ef[_0x3da3('0x32')]=_0x5b80ef['attributes'][_0x3da3('0x43')]?_0x5b80ef[_0x3da3('0x32')]:_0x9b285d[_0x3da3('0x2c')];_0x5b80ef[_0x3da3('0x4a')]=qs[_0x3da3('0x35')](_0x5954ec[_0x3da3('0x2e')][_0x3da3('0x35')]);_0x5b80ef[_0x3da3('0x37')]=qs['filters'](_[_0x3da3('0x36')](_0x5954ec[_0x3da3('0x2e')],_0x9b285d[_0x3da3('0x30')]));if(_0x5954ec[_0x3da3('0x2e')][_0x3da3('0x3a')]){_0x5b80ef['where']=_[_0x3da3('0x38')](_0x5b80ef[_0x3da3('0x37')],{'$or':_['map'](_0x5b80ef[_0x3da3('0x32')],function(_0x2e41e9){var _0x25024b={};_0x25024b[_0x2e41e9]={'$like':'%'+_0x5954ec[_0x3da3('0x2e')][_0x3da3('0x3a')]+'%'};return _0x25024b;})});}_0x5b80ef=_[_0x3da3('0x38')]({},_0x5b80ef,_0x5954ec[_0x3da3('0x3b')]);return _0x10b5d0[_0x3da3('0x48')](_0x5b80ef);}})[_0x3da3('0x24')](function(_0x489437){if(_0x489437){_0x26502d=_0x489437[_0x3da3('0x43')];if(!_0x5954ec['query'][_0x3da3('0x34')](_0x3da3('0x4b'))){_0x5b80ef['limit']=qs['limit'](_0x5954ec[_0x3da3('0x2e')][_0x3da3('0x1c')]);_0x5b80ef[_0x3da3('0x1e')]=qs[_0x3da3('0x1e')](_0x5954ec[_0x3da3('0x2e')][_0x3da3('0x1e')]);}return _0x10b5d0[_0x3da3('0x48')](_0x5b80ef);}})[_0x3da3('0x24')](function(_0x46b0f4){if(_0x46b0f4){return _0x46b0f4?{'count':_0x26502d,'rows':_0x46b0f4}:null;}})[_0x3da3('0x24')](respondWithResult(_0x1b90e1,null))[_0x3da3('0x40')](handleError(_0x1b90e1,null));};exports[_0x3da3('0x4c')]=function(_0x722b2d,_0x5d1e89,_0x3225ac){var _0x4cba31={};var _0xd3829f={};var _0x5c1162;var _0x295663;return db[_0x3da3('0x27')]['findOne']({'where':{'id':_0x722b2d[_0x3da3('0x42')]['id']}})[_0x3da3('0x24')](handleEntityNotFound(_0x5d1e89,null))[_0x3da3('0x24')](function(_0xa26b49){if(_0xa26b49){_0x5c1162=_0xa26b49;_0xd3829f[_0x3da3('0x2c')]=_['keys'](db[_0x3da3('0x4d')][_0x3da3('0x28')]);_0xd3829f['query']=_['keys'](_0x722b2d[_0x3da3('0x2e')]);_0xd3829f['filters']=_[_0x3da3('0x31')](_0xd3829f['model'],_0xd3829f['query']);_0x4cba31[_0x3da3('0x32')]=_[_0x3da3('0x31')](_0xd3829f[_0x3da3('0x2c')],qs[_0x3da3('0x33')](_0x722b2d[_0x3da3('0x2e')][_0x3da3('0x33')]));_0x4cba31[_0x3da3('0x32')]=_0x4cba31[_0x3da3('0x32')][_0x3da3('0x43')]?_0x4cba31['attributes']:_0xd3829f[_0x3da3('0x2c')];_0x4cba31[_0x3da3('0x4a')]=qs['sort'](_0x722b2d[_0x3da3('0x2e')][_0x3da3('0x35')]);_0x4cba31[_0x3da3('0x37')]=qs['filters'](_[_0x3da3('0x36')](_0x722b2d[_0x3da3('0x2e')],_0xd3829f[_0x3da3('0x30')]));if(_0x722b2d['query'][_0x3da3('0x3a')]){_0x4cba31[_0x3da3('0x37')]=_[_0x3da3('0x38')](_0x4cba31[_0x3da3('0x37')],{'$or':_[_0x3da3('0x2d')](_0x4cba31['attributes'],function(_0x50b4f0){var _0x4b0ce5={};_0x4b0ce5[_0x50b4f0]={'$like':'%'+_0x722b2d[_0x3da3('0x2e')]['filter']+'%'};return _0x4b0ce5;})});}_0x4cba31=_[_0x3da3('0x38')]({},_0x4cba31,_0x722b2d[_0x3da3('0x3b')]);return _0x5c1162[_0x3da3('0x4c')](_0x4cba31);}})[_0x3da3('0x24')](function(_0x5ab864){if(_0x5ab864){_0x295663=_0x5ab864['length'];if(!_0x722b2d['query'][_0x3da3('0x34')](_0x3da3('0x4b'))){_0x4cba31[_0x3da3('0x1c')]=qs[_0x3da3('0x1c')](_0x722b2d[_0x3da3('0x2e')][_0x3da3('0x1c')]);_0x4cba31[_0x3da3('0x1e')]=qs['offset'](_0x722b2d['query'][_0x3da3('0x1e')]);}return _0x5c1162[_0x3da3('0x4c')](_0x4cba31);}})[_0x3da3('0x24')](function(_0x27ecee){if(_0x27ecee){return _0x27ecee?{'count':_0x295663,'rows':_0x27ecee}:null;}})[_0x3da3('0x24')](respondWithResult(_0x5d1e89,null))['catch'](handleError(_0x5d1e89,null));};exports['getDescriptions']=function(_0x377518,_0x527a99,_0x371543){var _0x546108={};var _0x5ab2a8={};var _0x529c29;var _0x20e39a;return db[_0x3da3('0x27')][_0x3da3('0x49')]({'where':{'id':_0x377518[_0x3da3('0x42')]['id']}})[_0x3da3('0x24')](handleEntityNotFound(_0x527a99,null))[_0x3da3('0x24')](function(_0x247ad9){if(_0x247ad9){_0x529c29=_0x247ad9;_0x5ab2a8['model']=_[_0x3da3('0x2f')](db[_0x3da3('0x4d')]['rawAttributes']);_0x5ab2a8['query']=_[_0x3da3('0x2f')](_0x377518[_0x3da3('0x2e')]);_0x5ab2a8[_0x3da3('0x30')]=_[_0x3da3('0x31')](_0x5ab2a8[_0x3da3('0x2c')],_0x5ab2a8[_0x3da3('0x2e')]);_0x546108['attributes']=_['intersection'](_0x5ab2a8[_0x3da3('0x2c')],qs[_0x3da3('0x33')](_0x377518[_0x3da3('0x2e')][_0x3da3('0x33')]));_0x546108[_0x3da3('0x32')]=_0x546108[_0x3da3('0x32')]['length']?_0x546108[_0x3da3('0x32')]:_0x5ab2a8['model'];_0x546108[_0x3da3('0x4a')]=qs[_0x3da3('0x35')](_0x377518[_0x3da3('0x2e')][_0x3da3('0x35')]);_0x546108[_0x3da3('0x37')]=qs[_0x3da3('0x30')](_[_0x3da3('0x36')](_0x377518['query'],_0x5ab2a8[_0x3da3('0x30')]));if(_0x377518[_0x3da3('0x2e')][_0x3da3('0x3a')]){_0x546108[_0x3da3('0x37')]=_['merge'](_0x546108['where'],{'$or':_[_0x3da3('0x2d')](_0x546108[_0x3da3('0x32')],function(_0x204507){var _0x53c745={};_0x53c745[_0x204507]={'$like':'%'+_0x377518['query'][_0x3da3('0x3a')]+'%'};return _0x53c745;})});}_0x546108=_[_0x3da3('0x38')]({},_0x546108,_0x377518[_0x3da3('0x3b')]);return _0x529c29['getDescriptions'](_0x546108);}})[_0x3da3('0x24')](function(_0x454d34){if(_0x454d34){_0x20e39a=_0x454d34[_0x3da3('0x43')];if(!_0x377518[_0x3da3('0x2e')][_0x3da3('0x34')]('nolimit')){_0x546108[_0x3da3('0x1c')]=qs['limit'](_0x377518[_0x3da3('0x2e')][_0x3da3('0x1c')]);_0x546108[_0x3da3('0x1e')]=qs['offset'](_0x377518['query'][_0x3da3('0x1e')]);}return _0x529c29[_0x3da3('0x4e')](_0x546108);}})['then'](function(_0x5cb0f3){if(_0x5cb0f3){return _0x5cb0f3?{'count':_0x20e39a,'rows':_0x5cb0f3}:null;}})[_0x3da3('0x24')](respondWithResult(_0x527a99,null))[_0x3da3('0x40')](handleError(_0x527a99,null));}; \ No newline at end of file +var _0x56b8=['reject','update','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','getFields','findOne','ServicenowField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply'];(function(_0x2c2980,_0x34282a){var _0x2a20a9=function(_0x537b18){while(--_0x537b18){_0x2c2980['push'](_0x2c2980['shift']());}};_0x2a20a9(++_0x34282a);}(_0x56b8,0x180));var _0x856b=function(_0x29a8f7,_0x2441f8){_0x29a8f7=_0x29a8f7-0x0;var _0x37a48c=_0x56b8[_0x29a8f7];return _0x37a48c;};'use strict';var emlformat=require(_0x856b('0x0'));var rimraf=require(_0x856b('0x1'));var zipdir=require(_0x856b('0x2'));var jsonpatch=require(_0x856b('0x3'));var rp=require('request-promise');var moment=require(_0x856b('0x4'));var BPromise=require(_0x856b('0x5'));var Mustache=require(_0x856b('0x6'));var util=require(_0x856b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x856b('0x8'));var ejs=require(_0x856b('0x9'));var fs=require('fs');var fs_extra=require(_0x856b('0xa'));var _=require(_0x856b('0xb'));var squel=require(_0x856b('0xc'));var crypto=require(_0x856b('0xd'));var jsforce=require(_0x856b('0xe'));var deskjs=require(_0x856b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x856b('0x10'));var Papa=require('papaparse');var Redis=require(_0x856b('0x11'));var authService=require(_0x856b('0x12'));var qs=require(_0x856b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x856b('0x14'));var logger=require(_0x856b('0x15'))(_0x856b('0x16'));var utils=require(_0x856b('0x17'));var config=require(_0x856b('0x18'));var licenseUtil=require(_0x856b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dc4af,_0x19e454){_0x19e454=_0x19e454||0xcc;return function(_0xfce9b5){if(_0xfce9b5){return _0x3dc4af[_0x856b('0x1a')](_0x19e454);}return _0x3dc4af['status'](_0x19e454)['end']();};}function respondWithResult(_0x565c32,_0x113a3d){_0x113a3d=_0x113a3d||0xc8;return function(_0x5c7614){if(_0x5c7614){return _0x565c32[_0x856b('0x1b')](_0x113a3d)['json'](_0x5c7614);}};}function respondWithFilteredResult(_0x21cecd,_0xb3456f){return function(_0x1d57f8){if(_0x1d57f8){var _0x26f015=typeof _0xb3456f['offset']===_0x856b('0x1c')&&typeof _0xb3456f['limit']===_0x856b('0x1c');var _0x143250=_0x1d57f8[_0x856b('0x1d')];var _0x5c8554=_0x26f015?0x0:_0xb3456f[_0x856b('0x1e')];var _0x5f166b=_0x26f015?_0x1d57f8['count']:_0xb3456f[_0x856b('0x1e')]+_0xb3456f[_0x856b('0x1f')];var _0x525671;if(_0x5f166b>=_0x143250){_0x5f166b=_0x143250;_0x525671=0xc8;}else{_0x525671=0xce;}_0x21cecd['status'](_0x525671);return _0x21cecd[_0x856b('0x20')](_0x856b('0x21'),_0x5c8554+'-'+_0x5f166b+'/'+_0x143250)[_0x856b('0x22')](_0x1d57f8);}return null;};}function patchUpdates(_0x148b12){return function(_0x2bc920){try{jsonpatch[_0x856b('0x23')](_0x2bc920,_0x148b12,!![]);}catch(_0x47937e){return BPromise[_0x856b('0x24')](_0x47937e);}return _0x2bc920['save']();};}function saveUpdates(_0xfbaeb3,_0x1d62ac){return function(_0x118d2e){if(_0x118d2e){return _0x118d2e[_0x856b('0x25')](_0xfbaeb3)['then'](function(_0x330be2){return _0x330be2;});}return null;};}function removeEntity(_0x3aa9bf,_0x292aa9){return function(_0x499701){if(_0x499701){return _0x499701['destroy']()['then'](function(){_0x3aa9bf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e433d,_0xab06e9){return function(_0x398192){if(!_0x398192){_0x5e433d[_0x856b('0x1a')](0x194);}return _0x398192;};}function handleError(_0x3182d8,_0x42fd45){_0x42fd45=_0x42fd45||0x1f4;return function(_0x22c020){logger[_0x856b('0x26')](_0x22c020[_0x856b('0x27')]);if(_0x22c020[_0x856b('0x28')]){delete _0x22c020[_0x856b('0x28')];}_0x3182d8[_0x856b('0x1b')](_0x42fd45)[_0x856b('0x29')](_0x22c020);};}exports[_0x856b('0x2a')]=function(_0x8ed568,_0x541a8e){var _0x1c53fb={},_0xafd5e8={},_0x59a073={'count':0x0,'rows':[]};var _0x490497=_[_0x856b('0x2b')](db[_0x856b('0x2c')][_0x856b('0x2d')],function(_0x1db8a0){return{'name':_0x1db8a0[_0x856b('0x2e')],'type':_0x1db8a0[_0x856b('0x2f')][_0x856b('0x30')]};});_0xafd5e8[_0x856b('0x31')]=_['map'](_0x490497,'name');_0xafd5e8[_0x856b('0x32')]=_[_0x856b('0x33')](_0x8ed568[_0x856b('0x32')]);_0xafd5e8['filters']=_[_0x856b('0x34')](_0xafd5e8[_0x856b('0x31')],_0xafd5e8[_0x856b('0x32')]);_0x1c53fb[_0x856b('0x35')]=_[_0x856b('0x34')](_0xafd5e8['model'],qs[_0x856b('0x36')](_0x8ed568[_0x856b('0x32')][_0x856b('0x36')]));_0x1c53fb[_0x856b('0x35')]=_0x1c53fb['attributes'][_0x856b('0x37')]?_0x1c53fb[_0x856b('0x35')]:_0xafd5e8[_0x856b('0x31')];if(!_0x8ed568[_0x856b('0x32')][_0x856b('0x38')]('nolimit')){_0x1c53fb[_0x856b('0x1f')]=qs[_0x856b('0x1f')](_0x8ed568['query'][_0x856b('0x1f')]);_0x1c53fb[_0x856b('0x1e')]=qs[_0x856b('0x1e')](_0x8ed568['query'][_0x856b('0x1e')]);}_0x1c53fb[_0x856b('0x39')]=qs[_0x856b('0x3a')](_0x8ed568[_0x856b('0x32')]['sort']);_0x1c53fb['where']=qs[_0x856b('0x3b')](_[_0x856b('0x3c')](_0x8ed568['query'],_0xafd5e8[_0x856b('0x3b')]),_0x490497);if(_0x8ed568[_0x856b('0x32')][_0x856b('0x3d')]){_0x1c53fb[_0x856b('0x3e')]=_[_0x856b('0x3f')](_0x1c53fb[_0x856b('0x3e')],{'$or':_[_0x856b('0x2b')](_0x490497,function(_0x469ca7){if(_0x469ca7[_0x856b('0x2f')]!==_0x856b('0x40')){var _0x38967e={};_0x38967e[_0x469ca7[_0x856b('0x28')]]={'$like':'%'+_0x8ed568[_0x856b('0x32')][_0x856b('0x3d')]+'%'};return _0x38967e;}})});}_0x1c53fb=_[_0x856b('0x3f')]({},_0x1c53fb,_0x8ed568[_0x856b('0x41')]);var _0x6a3c20={'where':_0x1c53fb['where']};return db[_0x856b('0x2c')][_0x856b('0x1d')](_0x6a3c20)[_0x856b('0x42')](function(_0x1205b3){_0x59a073[_0x856b('0x1d')]=_0x1205b3;if(_0x8ed568['query'][_0x856b('0x43')]){_0x1c53fb[_0x856b('0x44')]=[{'all':!![]}];}return db[_0x856b('0x2c')][_0x856b('0x45')](_0x1c53fb);})[_0x856b('0x42')](function(_0x1d8f05){_0x59a073[_0x856b('0x46')]=_0x1d8f05;return _0x59a073;})[_0x856b('0x42')](respondWithFilteredResult(_0x541a8e,_0x1c53fb))['catch'](handleError(_0x541a8e,null));};exports[_0x856b('0x47')]=function(_0xe809aa,_0x189d36){var _0x2a9c53={'raw':![],'where':{'id':_0xe809aa[_0x856b('0x48')]['id']}},_0x2046dc={};_0x2046dc[_0x856b('0x31')]=_[_0x856b('0x33')](db[_0x856b('0x2c')][_0x856b('0x2d')]);_0x2046dc[_0x856b('0x32')]=_[_0x856b('0x33')](_0xe809aa['query']);_0x2046dc[_0x856b('0x3b')]=_['intersection'](_0x2046dc[_0x856b('0x31')],_0x2046dc[_0x856b('0x32')]);_0x2a9c53[_0x856b('0x35')]=_[_0x856b('0x34')](_0x2046dc[_0x856b('0x31')],qs[_0x856b('0x36')](_0xe809aa['query']['fields']));_0x2a9c53[_0x856b('0x35')]=_0x2a9c53['attributes'][_0x856b('0x37')]?_0x2a9c53['attributes']:_0x2046dc[_0x856b('0x31')];if(_0xe809aa[_0x856b('0x32')][_0x856b('0x43')]){_0x2a9c53[_0x856b('0x44')]=[{'all':!![]}];}_0x2a9c53=_[_0x856b('0x3f')]({},_0x2a9c53,_0xe809aa[_0x856b('0x41')]);return db['ServicenowConfiguration'][_0x856b('0x49')](_0x2a9c53)[_0x856b('0x42')](handleEntityNotFound(_0x189d36,null))[_0x856b('0x42')](respondWithResult(_0x189d36,null))[_0x856b('0x4a')](handleError(_0x189d36,null));};exports[_0x856b('0x4b')]=function(_0x351561,_0x24322c){return db[_0x856b('0x2c')][_0x856b('0x4b')](_0x351561[_0x856b('0x4c')],{})[_0x856b('0x42')](respondWithResult(_0x24322c,0xc9))[_0x856b('0x4a')](handleError(_0x24322c,null));};exports[_0x856b('0x25')]=function(_0x277eff,_0x347e06){if(_0x277eff[_0x856b('0x4c')]['id']){delete _0x277eff[_0x856b('0x4c')]['id'];}return db['ServicenowConfiguration'][_0x856b('0x49')]({'where':{'id':_0x277eff['params']['id']}})[_0x856b('0x42')](handleEntityNotFound(_0x347e06,null))[_0x856b('0x42')](saveUpdates(_0x277eff[_0x856b('0x4c')],null))[_0x856b('0x42')](respondWithResult(_0x347e06,null))[_0x856b('0x4a')](handleError(_0x347e06,null));};exports[_0x856b('0x4d')]=function(_0x1b40ed,_0x238a40){return db['ServicenowConfiguration'][_0x856b('0x49')]({'where':{'id':_0x1b40ed[_0x856b('0x48')]['id']}})['then'](handleEntityNotFound(_0x238a40,null))[_0x856b('0x42')](removeEntity(_0x238a40,null))[_0x856b('0x4a')](handleError(_0x238a40,null));};exports[_0x856b('0x4e')]=function(_0x3a6b48,_0x3494a2,_0x1635e8){var _0x1f6bff={};var _0x1fe62e={};var _0x2ece17;var _0x48a03a;return db[_0x856b('0x2c')][_0x856b('0x4f')]({'where':{'id':_0x3a6b48[_0x856b('0x48')]['id']}})[_0x856b('0x42')](handleEntityNotFound(_0x3494a2,null))[_0x856b('0x42')](function(_0x567fbe){if(_0x567fbe){_0x2ece17=_0x567fbe;_0x1fe62e[_0x856b('0x31')]=_['keys'](db[_0x856b('0x50')][_0x856b('0x2d')]);_0x1fe62e[_0x856b('0x32')]=_['keys'](_0x3a6b48[_0x856b('0x32')]);_0x1fe62e[_0x856b('0x3b')]=_[_0x856b('0x34')](_0x1fe62e[_0x856b('0x31')],_0x1fe62e[_0x856b('0x32')]);_0x1f6bff['attributes']=_[_0x856b('0x34')](_0x1fe62e[_0x856b('0x31')],qs[_0x856b('0x36')](_0x3a6b48['query'][_0x856b('0x36')]));_0x1f6bff[_0x856b('0x35')]=_0x1f6bff[_0x856b('0x35')][_0x856b('0x37')]?_0x1f6bff[_0x856b('0x35')]:_0x1fe62e['model'];_0x1f6bff[_0x856b('0x39')]=qs[_0x856b('0x3a')](_0x3a6b48[_0x856b('0x32')][_0x856b('0x3a')]);_0x1f6bff[_0x856b('0x3e')]=qs[_0x856b('0x3b')](_['pick'](_0x3a6b48[_0x856b('0x32')],_0x1fe62e[_0x856b('0x3b')]));if(_0x3a6b48[_0x856b('0x32')][_0x856b('0x3d')]){_0x1f6bff[_0x856b('0x3e')]=_[_0x856b('0x3f')](_0x1f6bff[_0x856b('0x3e')],{'$or':_[_0x856b('0x2b')](_0x1f6bff[_0x856b('0x35')],function(_0x145711){var _0x16861a={};_0x16861a[_0x145711]={'$like':'%'+_0x3a6b48[_0x856b('0x32')][_0x856b('0x3d')]+'%'};return _0x16861a;})});}_0x1f6bff=_['merge']({},_0x1f6bff,_0x3a6b48[_0x856b('0x41')]);return _0x2ece17[_0x856b('0x4e')](_0x1f6bff);}})[_0x856b('0x42')](function(_0xefb201){if(_0xefb201){_0x48a03a=_0xefb201[_0x856b('0x37')];if(!_0x3a6b48[_0x856b('0x32')][_0x856b('0x38')](_0x856b('0x51'))){_0x1f6bff['limit']=qs['limit'](_0x3a6b48['query'][_0x856b('0x1f')]);_0x1f6bff[_0x856b('0x1e')]=qs[_0x856b('0x1e')](_0x3a6b48[_0x856b('0x32')][_0x856b('0x1e')]);}return _0x2ece17[_0x856b('0x4e')](_0x1f6bff);}})[_0x856b('0x42')](function(_0xd414d4){if(_0xd414d4){return _0xd414d4?{'count':_0x48a03a,'rows':_0xd414d4}:null;}})[_0x856b('0x42')](respondWithResult(_0x3494a2,null))[_0x856b('0x4a')](handleError(_0x3494a2,null));};exports[_0x856b('0x52')]=function(_0x312e99,_0x1db1a8,_0x2de5e9){var _0x724bf6={};var _0x312f51={};var _0x3ccff9;var _0x42fa3e;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x312e99['params']['id']}})[_0x856b('0x42')](handleEntityNotFound(_0x1db1a8,null))[_0x856b('0x42')](function(_0x7eab1f){if(_0x7eab1f){_0x3ccff9=_0x7eab1f;_0x312f51[_0x856b('0x31')]=_[_0x856b('0x33')](db[_0x856b('0x50')]['rawAttributes']);_0x312f51['query']=_['keys'](_0x312e99[_0x856b('0x32')]);_0x312f51[_0x856b('0x3b')]=_[_0x856b('0x34')](_0x312f51['model'],_0x312f51[_0x856b('0x32')]);_0x724bf6[_0x856b('0x35')]=_[_0x856b('0x34')](_0x312f51[_0x856b('0x31')],qs[_0x856b('0x36')](_0x312e99[_0x856b('0x32')][_0x856b('0x36')]));_0x724bf6[_0x856b('0x35')]=_0x724bf6[_0x856b('0x35')]['length']?_0x724bf6['attributes']:_0x312f51[_0x856b('0x31')];_0x724bf6[_0x856b('0x39')]=qs[_0x856b('0x3a')](_0x312e99['query'][_0x856b('0x3a')]);_0x724bf6[_0x856b('0x3e')]=qs[_0x856b('0x3b')](_[_0x856b('0x3c')](_0x312e99['query'],_0x312f51[_0x856b('0x3b')]));if(_0x312e99[_0x856b('0x32')]['filter']){_0x724bf6[_0x856b('0x3e')]=_['merge'](_0x724bf6[_0x856b('0x3e')],{'$or':_[_0x856b('0x2b')](_0x724bf6[_0x856b('0x35')],function(_0x158c33){var _0x46a69f={};_0x46a69f[_0x158c33]={'$like':'%'+_0x312e99[_0x856b('0x32')][_0x856b('0x3d')]+'%'};return _0x46a69f;})});}_0x724bf6=_[_0x856b('0x3f')]({},_0x724bf6,_0x312e99[_0x856b('0x41')]);return _0x3ccff9[_0x856b('0x52')](_0x724bf6);}})[_0x856b('0x42')](function(_0x2d47b2){if(_0x2d47b2){_0x42fa3e=_0x2d47b2[_0x856b('0x37')];if(!_0x312e99['query']['hasOwnProperty'](_0x856b('0x51'))){_0x724bf6[_0x856b('0x1f')]=qs[_0x856b('0x1f')](_0x312e99[_0x856b('0x32')][_0x856b('0x1f')]);_0x724bf6[_0x856b('0x1e')]=qs[_0x856b('0x1e')](_0x312e99[_0x856b('0x32')][_0x856b('0x1e')]);}return _0x3ccff9[_0x856b('0x52')](_0x724bf6);}})[_0x856b('0x42')](function(_0x4e6c49){if(_0x4e6c49){return _0x4e6c49?{'count':_0x42fa3e,'rows':_0x4e6c49}:null;}})['then'](respondWithResult(_0x1db1a8,null))[_0x856b('0x4a')](handleError(_0x1db1a8,null));};exports[_0x856b('0x53')]=function(_0x3b59e5,_0xe8351,_0x58cc50){var _0xf408fd={};var _0x260a74={};var _0x59b296;var _0x4eed61;return db[_0x856b('0x2c')]['findOne']({'where':{'id':_0x3b59e5[_0x856b('0x48')]['id']}})[_0x856b('0x42')](handleEntityNotFound(_0xe8351,null))['then'](function(_0x48eb97){if(_0x48eb97){_0x59b296=_0x48eb97;_0x260a74['model']=_[_0x856b('0x33')](db[_0x856b('0x50')][_0x856b('0x2d')]);_0x260a74[_0x856b('0x32')]=_[_0x856b('0x33')](_0x3b59e5[_0x856b('0x32')]);_0x260a74[_0x856b('0x3b')]=_[_0x856b('0x34')](_0x260a74['model'],_0x260a74[_0x856b('0x32')]);_0xf408fd[_0x856b('0x35')]=_[_0x856b('0x34')](_0x260a74[_0x856b('0x31')],qs[_0x856b('0x36')](_0x3b59e5['query'][_0x856b('0x36')]));_0xf408fd['attributes']=_0xf408fd['attributes'][_0x856b('0x37')]?_0xf408fd['attributes']:_0x260a74[_0x856b('0x31')];_0xf408fd[_0x856b('0x39')]=qs[_0x856b('0x3a')](_0x3b59e5['query']['sort']);_0xf408fd[_0x856b('0x3e')]=qs[_0x856b('0x3b')](_[_0x856b('0x3c')](_0x3b59e5['query'],_0x260a74[_0x856b('0x3b')]));if(_0x3b59e5[_0x856b('0x32')][_0x856b('0x3d')]){_0xf408fd[_0x856b('0x3e')]=_[_0x856b('0x3f')](_0xf408fd[_0x856b('0x3e')],{'$or':_[_0x856b('0x2b')](_0xf408fd['attributes'],function(_0x460d96){var _0x2308ed={};_0x2308ed[_0x460d96]={'$like':'%'+_0x3b59e5[_0x856b('0x32')][_0x856b('0x3d')]+'%'};return _0x2308ed;})});}_0xf408fd=_[_0x856b('0x3f')]({},_0xf408fd,_0x3b59e5[_0x856b('0x41')]);return _0x59b296[_0x856b('0x53')](_0xf408fd);}})[_0x856b('0x42')](function(_0x34cc5c){if(_0x34cc5c){_0x4eed61=_0x34cc5c[_0x856b('0x37')];if(!_0x3b59e5[_0x856b('0x32')]['hasOwnProperty'](_0x856b('0x51'))){_0xf408fd['limit']=qs['limit'](_0x3b59e5[_0x856b('0x32')][_0x856b('0x1f')]);_0xf408fd[_0x856b('0x1e')]=qs[_0x856b('0x1e')](_0x3b59e5['query'][_0x856b('0x1e')]);}return _0x59b296[_0x856b('0x53')](_0xf408fd);}})[_0x856b('0x42')](function(_0x2f2f21){if(_0x2f2f21){return _0x2f2f21?{'count':_0x4eed61,'rows':_0x2f2f21}:null;}})[_0x856b('0x42')](respondWithResult(_0xe8351,null))[_0x856b('0x4a')](handleError(_0xe8351,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index f4980ba..f8afac9 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 _0xa7fa=['exports','int_servicenow_configurations','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x5c6951,_0x507abb){var _0x5ee145=function(_0x4f8b75){while(--_0x4f8b75){_0x5c6951['push'](_0x5c6951['shift']());}};_0x5ee145(++_0x507abb);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa7f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa7f('0x1'));var moment=require(_0xaa7f('0x2'));var BPromise=require(_0xaa7f('0x3'));var rp=require(_0xaa7f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa7f('0x5'));var config=require(_0xaa7f('0x6'));var attributes=require(_0xaa7f('0x7'));module[_0xaa7f('0x8')]=function(_0x48e98f,_0xf79d63){return _0x48e98f['define']('ServicenowConfiguration',attributes,{'tableName':_0xaa7f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x854f=['../../config/logger','api','moment','bluebird','path','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x585c4e,_0x25453f){var _0x458af1=function(_0x1893e3){while(--_0x1893e3){_0x585c4e['push'](_0x585c4e['shift']());}};_0x458af1(++_0x25453f);}(_0x854f,0xc1));var _0xf854=function(_0x4f6bd8,_0x3719ee){_0x4f6bd8=_0x4f6bd8-0x0;var _0x5f7c63=_0x854f[_0x4f6bd8];return _0x5f7c63;};'use strict';var _=require(_0xf854('0x0'));var util=require(_0xf854('0x1'));var logger=require(_0xf854('0x2'))(_0xf854('0x3'));var moment=require(_0xf854('0x4'));var BPromise=require(_0xf854('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf854('0x6'));var rimraf=require('rimraf');var config=require(_0xf854('0x7'));var attributes=require(_0xf854('0x8'));module[_0xf854('0x9')]=function(_0x1f5ec4,_0x4b1ca8){return _0x1f5ec4[_0xf854('0xa')](_0xf854('0xb'),attributes,{'tableName':_0xf854('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 8c751aa..185c466 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 _0x4c41=['then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4fbfd7,_0x3b7dc6){var _0x5b6ea7=function(_0x4884df){while(--_0x4884df){_0x4fbfd7['push'](_0x4fbfd7['shift']());}};_0x5b6ea7(++_0x3b7dc6);}(_0x4c41,0xda));var _0x14c4=function(_0x28b7d3,_0x100e30){_0x28b7d3=_0x28b7d3-0x0;var _0xba06c0=_0x4c41[_0x28b7d3];return _0xba06c0;};'use strict';var _=require(_0x14c4('0x0'));var util=require(_0x14c4('0x1'));var moment=require(_0x14c4('0x2'));var BPromise=require(_0x14c4('0x3'));var rs=require(_0x14c4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14c4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x14c4('0x6'));var config=require(_0x14c4('0x7'));var jayson=require(_0x14c4('0x8'));var client=jayson[_0x14c4('0x9')][_0x14c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x356a5e,_0x562702,_0x1661bb){return new BPromise(function(_0x55f6e4,_0x5133b1){return client[_0x14c4('0xb')](_0x356a5e,_0x1661bb)[_0x14c4('0xc')](function(_0x39343c){logger['info'](_0x14c4('0xd'),_0x562702,_0x14c4('0xe'));logger['debug'](_0x14c4('0xf'),_0x562702,_0x14c4('0xe'),JSON[_0x14c4('0x10')](_0x39343c));if(_0x39343c[_0x14c4('0x11')]){if(_0x39343c['error'][_0x14c4('0x12')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x562702,_0x39343c[_0x14c4('0x11')]['message']);return _0x5133b1(_0x39343c['error'][_0x14c4('0x13')]);}logger[_0x14c4('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x562702,_0x39343c[_0x14c4('0x11')][_0x14c4('0x13')]);return _0x55f6e4(_0x39343c['error'][_0x14c4('0x13')]);}else{logger[_0x14c4('0x14')](_0x14c4('0xd'),_0x562702,_0x14c4('0xe'));_0x55f6e4(_0x39343c[_0x14c4('0x15')][_0x14c4('0x13')]);}})[_0x14c4('0x16')](function(_0x57cf0f){logger['error'](_0x14c4('0xd'),_0x562702,_0x57cf0f);_0x5133b1(_0x57cf0f);});});} \ No newline at end of file +var _0x2f1e=['result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x2fff83,_0x29d5fe){var _0xa2a722=function(_0x18b6b0){while(--_0x18b6b0){_0x2fff83['push'](_0x2fff83['shift']());}};_0xa2a722(++_0x29d5fe);}(_0x2f1e,0xd9));var _0xe2f1=function(_0x31d06c,_0x2125a6){_0x31d06c=_0x31d06c-0x0;var _0x26b12c=_0x2f1e[_0x31d06c];return _0x26b12c;};'use strict';var _=require(_0xe2f1('0x0'));var util=require(_0xe2f1('0x1'));var moment=require(_0xe2f1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2f1('0x3'));var db=require(_0xe2f1('0x4'))['db'];var utils=require(_0xe2f1('0x5'));var logger=require(_0xe2f1('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe2f1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x445054,_0xc6dc70,_0x190f6e){return new BPromise(function(_0x576918,_0x4a6126){return client['request'](_0x445054,_0x190f6e)[_0xe2f1('0x8')](function(_0x49afa6){logger[_0xe2f1('0x9')](_0xe2f1('0xa'),_0xc6dc70,'request\x20sent');logger[_0xe2f1('0xb')](_0xe2f1('0xc'),_0xc6dc70,_0xe2f1('0xd'),JSON['stringify'](_0x49afa6));if(_0x49afa6['error']){if(_0x49afa6[_0xe2f1('0xe')][_0xe2f1('0xf')]===0x1f4){logger[_0xe2f1('0xe')](_0xe2f1('0xa'),_0xc6dc70,_0x49afa6['error']['message']);return _0x4a6126(_0x49afa6[_0xe2f1('0xe')][_0xe2f1('0x10')]);}logger[_0xe2f1('0xe')](_0xe2f1('0xa'),_0xc6dc70,_0x49afa6[_0xe2f1('0xe')]['message']);return _0x576918(_0x49afa6[_0xe2f1('0xe')][_0xe2f1('0x10')]);}else{logger[_0xe2f1('0x9')](_0xe2f1('0xa'),_0xc6dc70,_0xe2f1('0xd'));_0x576918(_0x49afa6[_0xe2f1('0x11')][_0xe2f1('0x10')]);}})['catch'](function(_0x386f2d){logger['error'](_0xe2f1('0xa'),_0xc6dc70,_0x386f2d);_0x4a6126(_0x386f2d);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 065a570..f4c8e3d 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 _0x7eca=['delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x7eca,0xbd));var _0xa7ec=function(_0x25524d,_0x2ca31c){_0x25524d=_0x25524d-0x0;var _0x3c3894=_0x7eca[_0x25524d];return _0x3c3894;};'use strict';var multer=require(_0xa7ec('0x0'));var util=require(_0xa7ec('0x1'));var path=require('path');var timeout=require(_0xa7ec('0x2'));var express=require(_0xa7ec('0x3'));var router=express['Router']();var fs_extra=require(_0xa7ec('0x4'));var auth=require(_0xa7ec('0x5'));var interaction=require(_0xa7ec('0x6'));var config=require(_0xa7ec('0x7'));var controller=require('./intServicenowField.controller');router[_0xa7ec('0x8')]('/',auth[_0xa7ec('0x9')](),controller['index']);router[_0xa7ec('0x8')](_0xa7ec('0xa'),auth[_0xa7ec('0x9')](),controller[_0xa7ec('0xb')]);router[_0xa7ec('0xc')]('/',auth[_0xa7ec('0x9')](),controller[_0xa7ec('0xd')]);router['put'](_0xa7ec('0xa'),auth[_0xa7ec('0x9')](),controller[_0xa7ec('0xe')]);router[_0xa7ec('0xf')](_0xa7ec('0xa'),auth['isAuthenticated'](),controller[_0xa7ec('0x10')]);module['exports']=router; \ No newline at end of file +var _0xaab4=['put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','index','get','/:id','show','post','isAuthenticated'];(function(_0x56f0b2,_0xdcf225){var _0x194f36=function(_0x640df6){while(--_0x640df6){_0x56f0b2['push'](_0x56f0b2['shift']());}};_0x194f36(++_0xdcf225);}(_0xaab4,0x1e9));var _0x4aab=function(_0x1ffd67,_0x52077d){_0x1ffd67=_0x1ffd67-0x0;var _0x51c64d=_0xaab4[_0x1ffd67];return _0x51c64d;};'use strict';var multer=require(_0x4aab('0x0'));var util=require('util');var path=require(_0x4aab('0x1'));var timeout=require(_0x4aab('0x2'));var express=require(_0x4aab('0x3'));var router=express[_0x4aab('0x4')]();var fs_extra=require(_0x4aab('0x5'));var auth=require(_0x4aab('0x6'));var interaction=require(_0x4aab('0x7'));var config=require('../../config/environment');var controller=require(_0x4aab('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4aab('0x9')]);router[_0x4aab('0xa')](_0x4aab('0xb'),auth['isAuthenticated'](),controller[_0x4aab('0xc')]);router[_0x4aab('0xd')]('/',auth[_0x4aab('0xe')](),controller['create']);router[_0x4aab('0xf')]('/:id',auth[_0x4aab('0xe')](),controller['update']);router[_0x4aab('0x10')](_0x4aab('0xb'),auth[_0x4aab('0xe')](),controller['destroy']);module[_0x4aab('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 9d324fc..9f6e09b 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 _0xaee3=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x420012,_0x2fc91a){var _0x43e24c=function(_0x4f1cac){while(--_0x4f1cac){_0x420012['push'](_0x420012['shift']());}};_0x43e24c(++_0x2fc91a);}(_0xaee3,0x133));var _0x3aee=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0xaee3[_0x143a91];return _0x1906f5;};'use strict';var Sequelize=require(_0x3aee('0x0'));module[_0x3aee('0x1')]={'type':{'type':Sequelize[_0x3aee('0x2')](_0x3aee('0x3'),_0x3aee('0x4'),_0x3aee('0x5'),_0x3aee('0x6'),_0x3aee('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3aee('0x8')]},'key':{'type':Sequelize[_0x3aee('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x3aee('0x3'),_0x3aee('0x4'),_0x3aee('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3aee('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8781=['ENUM','BOOLEAN','sequelize','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8781,0x77));var _0x1878=function(_0xf2f611,_0x4fd95e){_0xf2f611=_0xf2f611-0x0;var _0x54fe31=_0x8781[_0xf2f611];return _0x54fe31;};'use strict';var Sequelize=require(_0x1878('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x1878('0x1'),_0x1878('0x2'),_0x1878('0x3'),_0x1878('0x4'),_0x1878('0x5')),'defaultValue':_0x1878('0x1')},'content':{'type':Sequelize[_0x1878('0x6')]},'key':{'type':Sequelize[_0x1878('0x6')]},'keyType':{'type':Sequelize[_0x1878('0x7')](_0x1878('0x1'),_0x1878('0x2'),_0x1878('0x3'))},'keyContent':{'type':Sequelize[_0x1878('0x6')]},'idField':{'type':Sequelize[_0x1878('0x6')]},'nameField':{'type':Sequelize[_0x1878('0x6')]},'customField':{'type':Sequelize[_0x1878('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1878('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 83dca63..ced2d62 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 _0x3447=['hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','catch','params','keys','options','create','body','update','find','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','apply','reject','save','then','destroy','error','stack','name','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x20f214,_0x4b02b7){var _0x5e7db5=function(_0xf2798b){while(--_0xf2798b){_0x20f214['push'](_0x20f214['shift']());}};_0x5e7db5(++_0x4b02b7);}(_0x3447,0xa1));var _0x7344=function(_0x12309b,_0x59dd8c){_0x12309b=_0x12309b-0x0;var _0x482e4d=_0x3447[_0x12309b];return _0x482e4d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7344('0x0'));var rp=require(_0x7344('0x1'));var moment=require(_0x7344('0x2'));var BPromise=require(_0x7344('0x3'));var Mustache=require(_0x7344('0x4'));var util=require(_0x7344('0x5'));var path=require(_0x7344('0x6'));var sox=require(_0x7344('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7344('0x8'));var _=require(_0x7344('0x9'));var squel=require('squel');var crypto=require(_0x7344('0xa'));var jsforce=require(_0x7344('0xb'));var deskjs=require(_0x7344('0xc'));var toCsv=require(_0x7344('0xd'));var querystring=require(_0x7344('0xe'));var Papa=require('papaparse');var Redis=require(_0x7344('0xf'));var authService=require(_0x7344('0x10'));var qs=require(_0x7344('0x11'));var as=require(_0x7344('0x12'));var hardwareService=require(_0x7344('0x13'));var logger=require(_0x7344('0x14'))('api');var utils=require(_0x7344('0x15'));var config=require(_0x7344('0x16'));var licenseUtil=require(_0x7344('0x17'));var db=require(_0x7344('0x18'))['db'];function respondWithStatusCode(_0x548201,_0x54fbd1){_0x54fbd1=_0x54fbd1||0xcc;return function(_0x56740b){if(_0x56740b){return _0x548201[_0x7344('0x19')](_0x54fbd1);}return _0x548201[_0x7344('0x1a')](_0x54fbd1)[_0x7344('0x1b')]();};}function respondWithResult(_0x43b511,_0x4cbee3){_0x4cbee3=_0x4cbee3||0xc8;return function(_0x47cf2c){if(_0x47cf2c){return _0x43b511[_0x7344('0x1a')](_0x4cbee3)[_0x7344('0x1c')](_0x47cf2c);}};}function respondWithFilteredResult(_0xc088fd,_0x25b96f){return function(_0xebd5a5){if(_0xebd5a5){var _0x353521=typeof _0x25b96f['offset']==='undefined'&&typeof _0x25b96f['limit']===_0x7344('0x1d');var _0x5dde39=_0xebd5a5['count'];var _0x168ac7=_0x353521?0x0:_0x25b96f[_0x7344('0x1e')];var _0x5bc948=_0x353521?_0xebd5a5[_0x7344('0x1f')]:_0x25b96f[_0x7344('0x1e')]+_0x25b96f[_0x7344('0x20')];var _0x2b3dd2;if(_0x5bc948>=_0x5dde39){_0x5bc948=_0x5dde39;_0x2b3dd2=0xc8;}else{_0x2b3dd2=0xce;}_0xc088fd['status'](_0x2b3dd2);return _0xc088fd[_0x7344('0x21')]('Content-Range',_0x168ac7+'-'+_0x5bc948+'/'+_0x5dde39)[_0x7344('0x1c')](_0xebd5a5);}return null;};}function patchUpdates(_0x46b002){return function(_0xbd091){try{jsonpatch[_0x7344('0x22')](_0xbd091,_0x46b002,!![]);}catch(_0x2b0e08){return BPromise[_0x7344('0x23')](_0x2b0e08);}return _0xbd091[_0x7344('0x24')]();};}function saveUpdates(_0x576247,_0x3e4532){return function(_0x46f08b){if(_0x46f08b){return _0x46f08b['update'](_0x576247)[_0x7344('0x25')](function(_0x1fd222){return _0x1fd222;});}return null;};}function removeEntity(_0x386cfb,_0x3dbc78){return function(_0x53be86){if(_0x53be86){return _0x53be86[_0x7344('0x26')]()[_0x7344('0x25')](function(){_0x386cfb[_0x7344('0x1a')](0xcc)[_0x7344('0x1b')]();});}};}function handleEntityNotFound(_0x1096bb,_0x5ed8c3){return function(_0x2b09d8){if(!_0x2b09d8){_0x1096bb[_0x7344('0x19')](0x194);}return _0x2b09d8;};}function handleError(_0x334d22,_0x57cb28){_0x57cb28=_0x57cb28||0x1f4;return function(_0x7b357a){logger[_0x7344('0x27')](_0x7b357a[_0x7344('0x28')]);if(_0x7b357a[_0x7344('0x29')]){delete _0x7b357a['name'];}_0x334d22[_0x7344('0x1a')](_0x57cb28)['send'](_0x7b357a);};}exports['index']=function(_0x433146,_0x586d72){var _0x21e52f={},_0x1fdb58={},_0x5be5d2={'count':0x0,'rows':[]};var _0x271764=_[_0x7344('0x2a')](db[_0x7344('0x2b')][_0x7344('0x2c')],function(_0x3f6a15){return{'name':_0x3f6a15[_0x7344('0x2d')],'type':_0x3f6a15[_0x7344('0x2e')][_0x7344('0x2f')]};});_0x1fdb58[_0x7344('0x30')]=_[_0x7344('0x2a')](_0x271764,_0x7344('0x29'));_0x1fdb58[_0x7344('0x31')]=_['keys'](_0x433146[_0x7344('0x31')]);_0x1fdb58[_0x7344('0x32')]=_[_0x7344('0x33')](_0x1fdb58[_0x7344('0x30')],_0x1fdb58['query']);_0x21e52f[_0x7344('0x34')]=_[_0x7344('0x33')](_0x1fdb58['model'],qs[_0x7344('0x35')](_0x433146[_0x7344('0x31')]['fields']));_0x21e52f[_0x7344('0x34')]=_0x21e52f[_0x7344('0x34')][_0x7344('0x36')]?_0x21e52f[_0x7344('0x34')]:_0x1fdb58[_0x7344('0x30')];if(!_0x433146['query'][_0x7344('0x37')](_0x7344('0x38'))){_0x21e52f['limit']=qs[_0x7344('0x20')](_0x433146[_0x7344('0x31')][_0x7344('0x20')]);_0x21e52f[_0x7344('0x1e')]=qs['offset'](_0x433146[_0x7344('0x31')][_0x7344('0x1e')]);}_0x21e52f[_0x7344('0x39')]=qs['sort'](_0x433146[_0x7344('0x31')][_0x7344('0x3a')]);_0x21e52f[_0x7344('0x3b')]=qs[_0x7344('0x32')](_['pick'](_0x433146[_0x7344('0x31')],_0x1fdb58[_0x7344('0x32')]),_0x271764);if(_0x433146['query'][_0x7344('0x3c')]){_0x21e52f[_0x7344('0x3b')]=_[_0x7344('0x3d')](_0x21e52f[_0x7344('0x3b')],{'$or':_[_0x7344('0x2a')](_0x271764,function(_0x38153f){if(_0x38153f[_0x7344('0x2e')]!=='VIRTUAL'){var _0x91902a={};_0x91902a[_0x38153f['name']]={'$like':'%'+_0x433146[_0x7344('0x31')][_0x7344('0x3c')]+'%'};return _0x91902a;}})});}_0x21e52f=_[_0x7344('0x3d')]({},_0x21e52f,_0x433146['options']);var _0x104d07={'where':_0x21e52f[_0x7344('0x3b')]};return db[_0x7344('0x2b')][_0x7344('0x1f')](_0x104d07)[_0x7344('0x25')](function(_0x32cced){_0x5be5d2[_0x7344('0x1f')]=_0x32cced;if(_0x433146[_0x7344('0x31')][_0x7344('0x3e')]){_0x21e52f[_0x7344('0x3f')]=[{'all':!![]}];}return db[_0x7344('0x2b')]['findAll'](_0x21e52f);})[_0x7344('0x25')](function(_0x1c8747){_0x5be5d2['rows']=_0x1c8747;return _0x5be5d2;})['then'](respondWithFilteredResult(_0x586d72,_0x21e52f))[_0x7344('0x40')](handleError(_0x586d72,null));};exports['show']=function(_0x72a608,_0x1ea452){var _0x59a19c={'raw':!![],'where':{'id':_0x72a608[_0x7344('0x41')]['id']}},_0x2b3161={};_0x2b3161['model']=_[_0x7344('0x42')](db[_0x7344('0x2b')][_0x7344('0x2c')]);_0x2b3161['query']=_[_0x7344('0x42')](_0x72a608[_0x7344('0x31')]);_0x2b3161[_0x7344('0x32')]=_[_0x7344('0x33')](_0x2b3161[_0x7344('0x30')],_0x2b3161['query']);_0x59a19c[_0x7344('0x34')]=_[_0x7344('0x33')](_0x2b3161[_0x7344('0x30')],qs[_0x7344('0x35')](_0x72a608['query'][_0x7344('0x35')]));_0x59a19c[_0x7344('0x34')]=_0x59a19c[_0x7344('0x34')][_0x7344('0x36')]?_0x59a19c[_0x7344('0x34')]:_0x2b3161['model'];if(_0x72a608[_0x7344('0x31')]['includeAll']){_0x59a19c[_0x7344('0x3f')]=[{'all':!![]}];}_0x59a19c=_[_0x7344('0x3d')]({},_0x59a19c,_0x72a608[_0x7344('0x43')]);return db[_0x7344('0x2b')]['find'](_0x59a19c)['then'](handleEntityNotFound(_0x1ea452,null))[_0x7344('0x25')](respondWithResult(_0x1ea452,null))[_0x7344('0x40')](handleError(_0x1ea452,null));};exports[_0x7344('0x44')]=function(_0x2e3923,_0xb90516){return db[_0x7344('0x2b')][_0x7344('0x44')](_0x2e3923[_0x7344('0x45')],{})['then'](respondWithResult(_0xb90516,0xc9))[_0x7344('0x40')](handleError(_0xb90516,null));};exports[_0x7344('0x46')]=function(_0x5d717a,_0x39e6c8){if(_0x5d717a[_0x7344('0x45')]['id']){delete _0x5d717a['body']['id'];}return db['ServicenowField'][_0x7344('0x47')]({'where':{'id':_0x5d717a[_0x7344('0x41')]['id']}})[_0x7344('0x25')](handleEntityNotFound(_0x39e6c8,null))[_0x7344('0x25')](saveUpdates(_0x5d717a[_0x7344('0x45')],null))['then'](respondWithResult(_0x39e6c8,null))[_0x7344('0x40')](handleError(_0x39e6c8,null));};exports['destroy']=function(_0x561cdd,_0x48ac22){return db['ServicenowField'][_0x7344('0x47')]({'where':{'id':_0x561cdd[_0x7344('0x41')]['id']}})[_0x7344('0x25')](handleEntityNotFound(_0x48ac22,null))['then'](removeEntity(_0x48ac22,null))[_0x7344('0x40')](handleError(_0x48ac22,null));}; \ No newline at end of file +var _0x5ce6=['includeAll','include','rows','catch','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','ServicenowField','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL'];(function(_0x5972dd,_0x26edae){var _0x35c353=function(_0x1b5a53){while(--_0x1b5a53){_0x5972dd['push'](_0x5972dd['shift']());}};_0x35c353(++_0x26edae);}(_0x5ce6,0x195));var _0x65ce=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x5ce6[_0x174ef5];return _0x1cc379;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65ce('0x0'));var zipdir=require(_0x65ce('0x1'));var jsonpatch=require(_0x65ce('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x65ce('0x3'));var Mustache=require('mustache');var util=require(_0x65ce('0x4'));var path=require(_0x65ce('0x5'));var sox=require(_0x65ce('0x6'));var csv=require(_0x65ce('0x7'));var ejs=require(_0x65ce('0x8'));var fs=require('fs');var fs_extra=require(_0x65ce('0x9'));var _=require(_0x65ce('0xa'));var squel=require('squel');var crypto=require(_0x65ce('0xb'));var jsforce=require(_0x65ce('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x65ce('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x65ce('0xd'));var authService=require(_0x65ce('0xe'));var qs=require(_0x65ce('0xf'));var as=require(_0x65ce('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x65ce('0x11'));var utils=require(_0x65ce('0x12'));var config=require(_0x65ce('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x443d20,_0x1f56cb){_0x1f56cb=_0x1f56cb||0xcc;return function(_0x1d3fa6){if(_0x1d3fa6){return _0x443d20[_0x65ce('0x14')](_0x1f56cb);}return _0x443d20[_0x65ce('0x15')](_0x1f56cb)[_0x65ce('0x16')]();};}function respondWithResult(_0x241900,_0x2fe274){_0x2fe274=_0x2fe274||0xc8;return function(_0xb28202){if(_0xb28202){return _0x241900[_0x65ce('0x15')](_0x2fe274)[_0x65ce('0x17')](_0xb28202);}};}function respondWithFilteredResult(_0xced544,_0x19d536){return function(_0x157240){if(_0x157240){var _0x1a5ccb=typeof _0x19d536[_0x65ce('0x18')]===_0x65ce('0x19')&&typeof _0x19d536['limit']==='undefined';var _0x1bbc23=_0x157240[_0x65ce('0x1a')];var _0xa516d3=_0x1a5ccb?0x0:_0x19d536[_0x65ce('0x18')];var _0x53994b=_0x1a5ccb?_0x157240[_0x65ce('0x1a')]:_0x19d536[_0x65ce('0x18')]+_0x19d536[_0x65ce('0x1b')];var _0x32e6f7;if(_0x53994b>=_0x1bbc23){_0x53994b=_0x1bbc23;_0x32e6f7=0xc8;}else{_0x32e6f7=0xce;}_0xced544[_0x65ce('0x15')](_0x32e6f7);return _0xced544[_0x65ce('0x1c')](_0x65ce('0x1d'),_0xa516d3+'-'+_0x53994b+'/'+_0x1bbc23)[_0x65ce('0x17')](_0x157240);}return null;};}function patchUpdates(_0x2441c3){return function(_0x388b3f){try{jsonpatch[_0x65ce('0x1e')](_0x388b3f,_0x2441c3,!![]);}catch(_0x1517fa){return BPromise['reject'](_0x1517fa);}return _0x388b3f['save']();};}function saveUpdates(_0x50503e,_0x28dcf6){return function(_0x166b46){if(_0x166b46){return _0x166b46[_0x65ce('0x1f')](_0x50503e)[_0x65ce('0x20')](function(_0x2f84e3){return _0x2f84e3;});}return null;};}function removeEntity(_0x37a27f,_0x2d62cf){return function(_0x5ac070){if(_0x5ac070){return _0x5ac070[_0x65ce('0x21')]()[_0x65ce('0x20')](function(){_0x37a27f[_0x65ce('0x15')](0xcc)[_0x65ce('0x16')]();});}};}function handleEntityNotFound(_0xcc6c4e,_0x215997){return function(_0x10694a){if(!_0x10694a){_0xcc6c4e[_0x65ce('0x14')](0x194);}return _0x10694a;};}function handleError(_0x52f3b8,_0x15e51b){_0x15e51b=_0x15e51b||0x1f4;return function(_0x102c5b){logger['error'](_0x102c5b[_0x65ce('0x22')]);if(_0x102c5b[_0x65ce('0x23')]){delete _0x102c5b[_0x65ce('0x23')];}_0x52f3b8['status'](_0x15e51b)[_0x65ce('0x24')](_0x102c5b);};}exports[_0x65ce('0x25')]=function(_0x2458e4,_0xd6964b){var _0x35fef0={},_0x2c7a20={},_0x4f2bbb={'count':0x0,'rows':[]};var _0x502e46=_[_0x65ce('0x26')](db[_0x65ce('0x27')][_0x65ce('0x28')],function(_0xd5d25d){return{'name':_0xd5d25d['fieldName'],'type':_0xd5d25d[_0x65ce('0x29')][_0x65ce('0x2a')]};});_0x2c7a20['model']=_[_0x65ce('0x26')](_0x502e46,_0x65ce('0x23'));_0x2c7a20[_0x65ce('0x2b')]=_[_0x65ce('0x2c')](_0x2458e4[_0x65ce('0x2b')]);_0x2c7a20[_0x65ce('0x2d')]=_[_0x65ce('0x2e')](_0x2c7a20[_0x65ce('0x2f')],_0x2c7a20['query']);_0x35fef0[_0x65ce('0x30')]=_[_0x65ce('0x2e')](_0x2c7a20['model'],qs[_0x65ce('0x31')](_0x2458e4['query'][_0x65ce('0x31')]));_0x35fef0[_0x65ce('0x30')]=_0x35fef0[_0x65ce('0x30')][_0x65ce('0x32')]?_0x35fef0[_0x65ce('0x30')]:_0x2c7a20['model'];if(!_0x2458e4[_0x65ce('0x2b')]['hasOwnProperty']('nolimit')){_0x35fef0['limit']=qs['limit'](_0x2458e4[_0x65ce('0x2b')][_0x65ce('0x1b')]);_0x35fef0['offset']=qs[_0x65ce('0x18')](_0x2458e4[_0x65ce('0x2b')][_0x65ce('0x18')]);}_0x35fef0[_0x65ce('0x33')]=qs[_0x65ce('0x34')](_0x2458e4[_0x65ce('0x2b')][_0x65ce('0x34')]);_0x35fef0[_0x65ce('0x35')]=qs['filters'](_['pick'](_0x2458e4[_0x65ce('0x2b')],_0x2c7a20[_0x65ce('0x2d')]),_0x502e46);if(_0x2458e4[_0x65ce('0x2b')][_0x65ce('0x36')]){_0x35fef0[_0x65ce('0x35')]=_[_0x65ce('0x37')](_0x35fef0[_0x65ce('0x35')],{'$or':_[_0x65ce('0x26')](_0x502e46,function(_0x22b753){if(_0x22b753[_0x65ce('0x29')]!==_0x65ce('0x38')){var _0x5c3eae={};_0x5c3eae[_0x22b753[_0x65ce('0x23')]]={'$like':'%'+_0x2458e4[_0x65ce('0x2b')][_0x65ce('0x36')]+'%'};return _0x5c3eae;}})});}_0x35fef0=_[_0x65ce('0x37')]({},_0x35fef0,_0x2458e4['options']);var _0x550018={'where':_0x35fef0['where']};return db[_0x65ce('0x27')]['count'](_0x550018)[_0x65ce('0x20')](function(_0x120f16){_0x4f2bbb[_0x65ce('0x1a')]=_0x120f16;if(_0x2458e4[_0x65ce('0x2b')][_0x65ce('0x39')]){_0x35fef0[_0x65ce('0x3a')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x35fef0);})[_0x65ce('0x20')](function(_0xefb10){_0x4f2bbb[_0x65ce('0x3b')]=_0xefb10;return _0x4f2bbb;})[_0x65ce('0x20')](respondWithFilteredResult(_0xd6964b,_0x35fef0))[_0x65ce('0x3c')](handleError(_0xd6964b,null));};exports['show']=function(_0x6a2769,_0x1c9ba8){var _0x1783c9={'raw':!![],'where':{'id':_0x6a2769[_0x65ce('0x3d')]['id']}},_0x17d1dc={};_0x17d1dc[_0x65ce('0x2f')]=_[_0x65ce('0x2c')](db[_0x65ce('0x27')][_0x65ce('0x28')]);_0x17d1dc[_0x65ce('0x2b')]=_[_0x65ce('0x2c')](_0x6a2769[_0x65ce('0x2b')]);_0x17d1dc[_0x65ce('0x2d')]=_[_0x65ce('0x2e')](_0x17d1dc[_0x65ce('0x2f')],_0x17d1dc[_0x65ce('0x2b')]);_0x1783c9[_0x65ce('0x30')]=_['intersection'](_0x17d1dc[_0x65ce('0x2f')],qs[_0x65ce('0x31')](_0x6a2769['query'][_0x65ce('0x31')]));_0x1783c9['attributes']=_0x1783c9['attributes'][_0x65ce('0x32')]?_0x1783c9[_0x65ce('0x30')]:_0x17d1dc[_0x65ce('0x2f')];if(_0x6a2769[_0x65ce('0x2b')][_0x65ce('0x39')]){_0x1783c9[_0x65ce('0x3a')]=[{'all':!![]}];}_0x1783c9=_[_0x65ce('0x37')]({},_0x1783c9,_0x6a2769[_0x65ce('0x3e')]);return db['ServicenowField'][_0x65ce('0x3f')](_0x1783c9)[_0x65ce('0x20')](handleEntityNotFound(_0x1c9ba8,null))[_0x65ce('0x20')](respondWithResult(_0x1c9ba8,null))['catch'](handleError(_0x1c9ba8,null));};exports[_0x65ce('0x40')]=function(_0x1212e9,_0x5c21e7){return db[_0x65ce('0x27')]['create'](_0x1212e9['body'],{})[_0x65ce('0x20')](respondWithResult(_0x5c21e7,0xc9))[_0x65ce('0x3c')](handleError(_0x5c21e7,null));};exports[_0x65ce('0x1f')]=function(_0x55d501,_0x22bf4a){if(_0x55d501['body']['id']){delete _0x55d501['body']['id'];}return db['ServicenowField']['find']({'where':{'id':_0x55d501[_0x65ce('0x3d')]['id']}})['then'](handleEntityNotFound(_0x22bf4a,null))[_0x65ce('0x20')](saveUpdates(_0x55d501[_0x65ce('0x41')],null))[_0x65ce('0x20')](respondWithResult(_0x22bf4a,null))['catch'](handleError(_0x22bf4a,null));};exports[_0x65ce('0x21')]=function(_0x4e1ec1,_0x1ffb25){return db[_0x65ce('0x27')][_0x65ce('0x3f')]({'where':{'id':_0x4e1ec1[_0x65ce('0x3d')]['id']}})[_0x65ce('0x20')](handleEntityNotFound(_0x1ffb25,null))[_0x65ce('0x20')](removeEntity(_0x1ffb25,null))[_0x65ce('0x3c')](handleError(_0x1ffb25,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 2858ad9..98758f2 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 _0xa116=['idField','FieldId','lodash','util','api','request-promise','path','rimraf','../../config/environment','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x2a1185,_0x2740c5){var _0x5588d9=function(_0x16024c){while(--_0x16024c){_0x2a1185['push'](_0x2a1185['shift']());}};_0x5588d9(++_0x2740c5);}(_0xa116,0x152));var _0x6a11=function(_0x446b59,_0x31eb4d){_0x446b59=_0x446b59-0x0;var _0xa27477=_0xa116[_0x446b59];return _0xa27477;};'use strict';var _=require(_0x6a11('0x0'));var util=require(_0x6a11('0x1'));var logger=require('../../config/logger')(_0x6a11('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6a11('0x3'));var fs=require('fs');var path=require(_0x6a11('0x4'));var rimraf=require(_0x6a11('0x5'));var config=require(_0x6a11('0x6'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x3f4948,_0x4cfa27){return _0x3f4948['define'](_0x6a11('0x7'),attributes,{'tableName':_0x6a11('0x8'),'paranoid':![],'indexes':[{'name':_0x6a11('0x9'),'fields':[_0x6a11('0xa'),_0x6a11('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe1e0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','util','api'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xe1e0,0x169));var _0x0e1e=function(_0x9448d2,_0x2c41bb){_0x9448d2=_0x9448d2-0x0;var _0x2e499c=_0xe1e0[_0x9448d2];return _0x2e499c;};'use strict';var _=require(_0x0e1e('0x0'));var util=require(_0x0e1e('0x1'));var logger=require('../../config/logger')(_0x0e1e('0x2'));var moment=require(_0x0e1e('0x3'));var BPromise=require(_0x0e1e('0x4'));var rp=require(_0x0e1e('0x5'));var fs=require('fs');var path=require(_0x0e1e('0x6'));var rimraf=require(_0x0e1e('0x7'));var config=require(_0x0e1e('0x8'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x541a01,_0x417498){return _0x541a01['define'](_0x0e1e('0x9'),attributes,{'tableName':_0x0e1e('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x0e1e('0xb'),_0x0e1e('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index cc81982..9b73e58 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 _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xac4a,0x13f));var _0xaac4=function(_0x41319d,_0x2bcdeb){_0x41319d=_0x41319d-0x0;var _0x2c3b07=_0xac4a[_0x41319d];return _0x2c3b07;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x1eeca7,_0x40f7e4){var _0x2c7209=function(_0x1c74af){while(--_0x1c74af){_0x1eeca7['push'](_0x1eeca7['shift']());}};_0x2c7209(++_0x40f7e4);}(_0xb7e7,0x121));var _0x7b7e=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xb7e7[_0x122096];return _0x3d1966;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index e5319be..9d4877b 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(_0x4b18a3,_0x58859e){var _0x2b2e3f=function(_0x1a1d4d){while(--_0x1a1d4d){_0x4b18a3['push'](_0x4b18a3['shift']());}};_0x2b2e3f(++_0x58859e);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x867b81,_0x1d0d1e){var _0x40445a=function(_0x486852){while(--_0x486852){_0x867b81['push'](_0x867b81['shift']());}};_0x40445a(++_0x1d0d1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 77f6537..3308e67 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(_0x431795,_0x2755a6){var _0x2d5d11=function(_0x3e9eb2){while(--_0x3e9eb2){_0x431795['push'](_0x431795['shift']());}};_0x2d5d11(++_0x2755a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x15ac30,_0xb3aa72){var _0x3a341a=function(_0x150a71){while(--_0x150a71){_0x15ac30['push'](_0x15ac30['shift']());}};_0x3a341a(++_0xb3aa72);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 25f2e3c..9058350 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 _0x0ade=['end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','send','index','map','SugarcrmAccount','rawAttributes','type','key','model','name','query','keys','intersection','attributes','length','hasOwnProperty','sort','filters','pick','filter','where','merge','options','includeAll','include','rows','catch','params','fields','find','create','body','findOne','SugarcrmConfiguration','order','getConfigurations','nolimit','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','username','password','remoteUri','substring','lastIndexOf','POST','%s%s','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','format','get_module_fields','stringify','Calls','values','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status'];(function(_0x179cce,_0x239422){var _0x54ac6d=function(_0x21a7f0){while(--_0x21a7f0){_0x179cce['push'](_0x179cce['shift']());}};_0x54ac6d(++_0x239422);}(_0x0ade,0x1bb));var _0xe0ad=function(_0x3729c,_0x1b1faf){_0x3729c=_0x3729c-0x0;var _0x20ce1f=_0x0ade[_0x3729c];return _0x20ce1f;};'use strict';var emlformat=require(_0xe0ad('0x0'));var rimraf=require(_0xe0ad('0x1'));var zipdir=require(_0xe0ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0ad('0x3'));var moment=require(_0xe0ad('0x4'));var BPromise=require(_0xe0ad('0x5'));var Mustache=require('mustache');var util=require(_0xe0ad('0x6'));var path=require(_0xe0ad('0x7'));var sox=require(_0xe0ad('0x8'));var csv=require('to-csv');var ejs=require(_0xe0ad('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0ad('0xa'));var squel=require(_0xe0ad('0xb'));var crypto=require('crypto');var jsforce=require(_0xe0ad('0xc'));var deskjs=require(_0xe0ad('0xd'));var toCsv=require(_0xe0ad('0xe'));var querystring=require(_0xe0ad('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0ad('0x10'));var authService=require(_0xe0ad('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0ad('0x12'))('api');var utils=require(_0xe0ad('0x13'));var config=require(_0xe0ad('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0ad('0x15'))['db'];var integrations=require(_0xe0ad('0x16'));function respondWithStatusCode(_0x5a1735,_0x120534){_0x120534=_0x120534||0xcc;return function(_0x54d3a1){if(_0x54d3a1){return _0x5a1735[_0xe0ad('0x17')](_0x120534);}return _0x5a1735[_0xe0ad('0x18')](_0x120534)[_0xe0ad('0x19')]();};}function respondWithResult(_0x2a3894,_0x4984a9){_0x4984a9=_0x4984a9||0xc8;return function(_0x30aca6){if(_0x30aca6){return _0x2a3894[_0xe0ad('0x18')](_0x4984a9)['json'](_0x30aca6);}};}function respondWithFilteredResult(_0x182d24,_0x5ca517){return function(_0x4b468e){if(_0x4b468e){var _0x3ff728=typeof _0x5ca517[_0xe0ad('0x1a')]===_0xe0ad('0x1b')&&typeof _0x5ca517[_0xe0ad('0x1c')]===_0xe0ad('0x1b');var _0x2b87c4=_0x4b468e[_0xe0ad('0x1d')];var _0x1eeb36=_0x3ff728?0x0:_0x5ca517['offset'];var _0x463012=_0x3ff728?_0x4b468e[_0xe0ad('0x1d')]:_0x5ca517['offset']+_0x5ca517['limit'];var _0xfe51c4;if(_0x463012>=_0x2b87c4){_0x463012=_0x2b87c4;_0xfe51c4=0xc8;}else{_0xfe51c4=0xce;}_0x182d24['status'](_0xfe51c4);return _0x182d24[_0xe0ad('0x1e')](_0xe0ad('0x1f'),_0x1eeb36+'-'+_0x463012+'/'+_0x2b87c4)[_0xe0ad('0x20')](_0x4b468e);}return null;};}function patchUpdates(_0xee7fe2){return function(_0x268128){try{jsonpatch[_0xe0ad('0x21')](_0x268128,_0xee7fe2,!![]);}catch(_0x39703d){return BPromise[_0xe0ad('0x22')](_0x39703d);}return _0x268128['save']();};}function saveUpdates(_0x1e68a6,_0x32696a){return function(_0x28aacb){if(_0x28aacb){return _0x28aacb[_0xe0ad('0x23')](_0x1e68a6)[_0xe0ad('0x24')](function(_0x2125e4){return _0x2125e4;});}return null;};}function removeEntity(_0x5c0ff5,_0x2d95db){return function(_0x3a2768){if(_0x3a2768){return _0x3a2768[_0xe0ad('0x25')]()[_0xe0ad('0x24')](function(){_0x5c0ff5[_0xe0ad('0x18')](0xcc)[_0xe0ad('0x19')]();});}};}function handleEntityNotFound(_0x2eedf2,_0x217ce4){return function(_0x2bb01e){if(!_0x2bb01e){_0x2eedf2[_0xe0ad('0x17')](0x194);}return _0x2bb01e;};}function handleError(_0x4a216e,_0x57d404){_0x57d404=_0x57d404||0x1f4;return function(_0x2d5fec){logger[_0xe0ad('0x26')](_0x2d5fec[_0xe0ad('0x27')]);if(_0x2d5fec['name']){delete _0x2d5fec['name'];}_0x4a216e[_0xe0ad('0x18')](_0x57d404)[_0xe0ad('0x28')](_0x2d5fec);};}exports[_0xe0ad('0x29')]=function(_0x54f087,_0x47f106){var _0x31a99c={},_0x98e80e={},_0x19e809={'count':0x0,'rows':[]};var _0x4b5a6b=_[_0xe0ad('0x2a')](db[_0xe0ad('0x2b')][_0xe0ad('0x2c')],function(_0x3c9ddd){return{'name':_0x3c9ddd['fieldName'],'type':_0x3c9ddd[_0xe0ad('0x2d')][_0xe0ad('0x2e')]};});_0x98e80e[_0xe0ad('0x2f')]=_['map'](_0x4b5a6b,_0xe0ad('0x30'));_0x98e80e[_0xe0ad('0x31')]=_[_0xe0ad('0x32')](_0x54f087[_0xe0ad('0x31')]);_0x98e80e['filters']=_[_0xe0ad('0x33')](_0x98e80e[_0xe0ad('0x2f')],_0x98e80e[_0xe0ad('0x31')]);_0x31a99c[_0xe0ad('0x34')]=_[_0xe0ad('0x33')](_0x98e80e[_0xe0ad('0x2f')],qs['fields'](_0x54f087[_0xe0ad('0x31')]['fields']));_0x31a99c['attributes']=_0x31a99c[_0xe0ad('0x34')][_0xe0ad('0x35')]?_0x31a99c[_0xe0ad('0x34')]:_0x98e80e[_0xe0ad('0x2f')];if(!_0x54f087[_0xe0ad('0x31')][_0xe0ad('0x36')]('nolimit')){_0x31a99c[_0xe0ad('0x1c')]=qs[_0xe0ad('0x1c')](_0x54f087[_0xe0ad('0x31')]['limit']);_0x31a99c['offset']=qs['offset'](_0x54f087[_0xe0ad('0x31')][_0xe0ad('0x1a')]);}_0x31a99c['order']=qs[_0xe0ad('0x37')](_0x54f087[_0xe0ad('0x31')][_0xe0ad('0x37')]);_0x31a99c['where']=qs[_0xe0ad('0x38')](_[_0xe0ad('0x39')](_0x54f087[_0xe0ad('0x31')],_0x98e80e[_0xe0ad('0x38')]),_0x4b5a6b);if(_0x54f087[_0xe0ad('0x31')][_0xe0ad('0x3a')]){_0x31a99c[_0xe0ad('0x3b')]=_['merge'](_0x31a99c[_0xe0ad('0x3b')],{'$or':_[_0xe0ad('0x2a')](_0x4b5a6b,function(_0x260401){if(_0x260401[_0xe0ad('0x2d')]!=='VIRTUAL'){var _0x39309a={};_0x39309a[_0x260401[_0xe0ad('0x30')]]={'$like':'%'+_0x54f087[_0xe0ad('0x31')]['filter']+'%'};return _0x39309a;}})});}_0x31a99c=_[_0xe0ad('0x3c')]({},_0x31a99c,_0x54f087[_0xe0ad('0x3d')]);var _0x5e8cf3={'where':_0x31a99c['where']};return db[_0xe0ad('0x2b')][_0xe0ad('0x1d')](_0x5e8cf3)[_0xe0ad('0x24')](function(_0x4e047b){_0x19e809['count']=_0x4e047b;if(_0x54f087[_0xe0ad('0x31')][_0xe0ad('0x3e')]){_0x31a99c[_0xe0ad('0x3f')]=[{'all':!![]}];}return db[_0xe0ad('0x2b')]['findAll'](_0x31a99c);})[_0xe0ad('0x24')](function(_0x2c3cd9){_0x19e809[_0xe0ad('0x40')]=_0x2c3cd9;return _0x19e809;})[_0xe0ad('0x24')](respondWithFilteredResult(_0x47f106,_0x31a99c))[_0xe0ad('0x41')](handleError(_0x47f106,null));};exports['show']=function(_0x533ca7,_0x3295fc){var _0x27a1de={'raw':![],'where':{'id':_0x533ca7[_0xe0ad('0x42')]['id']}},_0x280b77={};_0x280b77[_0xe0ad('0x2f')]=_[_0xe0ad('0x32')](db[_0xe0ad('0x2b')]['rawAttributes']);_0x280b77[_0xe0ad('0x31')]=_['keys'](_0x533ca7[_0xe0ad('0x31')]);_0x280b77[_0xe0ad('0x38')]=_['intersection'](_0x280b77[_0xe0ad('0x2f')],_0x280b77[_0xe0ad('0x31')]);_0x27a1de[_0xe0ad('0x34')]=_[_0xe0ad('0x33')](_0x280b77[_0xe0ad('0x2f')],qs[_0xe0ad('0x43')](_0x533ca7[_0xe0ad('0x31')][_0xe0ad('0x43')]));_0x27a1de[_0xe0ad('0x34')]=_0x27a1de[_0xe0ad('0x34')][_0xe0ad('0x35')]?_0x27a1de['attributes']:_0x280b77['model'];if(_0x533ca7['query']['includeAll']){_0x27a1de[_0xe0ad('0x3f')]=[{'all':!![]}];}_0x27a1de=_['merge']({},_0x27a1de,_0x533ca7['options']);return db['SugarcrmAccount'][_0xe0ad('0x44')](_0x27a1de)['then'](handleEntityNotFound(_0x3295fc,null))[_0xe0ad('0x24')](respondWithResult(_0x3295fc,null))['catch'](handleError(_0x3295fc,null));};exports[_0xe0ad('0x45')]=function(_0x1368bf,_0x44e031){return db[_0xe0ad('0x2b')][_0xe0ad('0x45')](_0x1368bf[_0xe0ad('0x46')],{})[_0xe0ad('0x24')](respondWithResult(_0x44e031,0xc9))['catch'](handleError(_0x44e031,null));};exports['update']=function(_0x31a6ed,_0x25f4ea){if(_0x31a6ed[_0xe0ad('0x46')]['id']){delete _0x31a6ed[_0xe0ad('0x46')]['id'];}return db[_0xe0ad('0x2b')]['find']({'where':{'id':_0x31a6ed[_0xe0ad('0x42')]['id']}})['then'](handleEntityNotFound(_0x25f4ea,null))['then'](saveUpdates(_0x31a6ed[_0xe0ad('0x46')],null))[_0xe0ad('0x24')](respondWithResult(_0x25f4ea,null))[_0xe0ad('0x41')](handleError(_0x25f4ea,null));};exports['destroy']=function(_0x843db4,_0x51b07f){return db[_0xe0ad('0x2b')][_0xe0ad('0x44')]({'where':{'id':_0x843db4[_0xe0ad('0x42')]['id']}})[_0xe0ad('0x24')](handleEntityNotFound(_0x51b07f,null))[_0xe0ad('0x24')](removeEntity(_0x51b07f,null))[_0xe0ad('0x41')](handleError(_0x51b07f,null));};exports['getConfigurations']=function(_0x2b8b81,_0x233b7c,_0x3ff000){var _0x57b5d1={};var _0x2c7701={};var _0x21559d;var _0x48815c;return db[_0xe0ad('0x2b')][_0xe0ad('0x47')]({'where':{'id':_0x2b8b81[_0xe0ad('0x42')]['id']}})[_0xe0ad('0x24')](handleEntityNotFound(_0x233b7c,null))[_0xe0ad('0x24')](function(_0x13fbdf){if(_0x13fbdf){_0x21559d=_0x13fbdf;_0x2c7701[_0xe0ad('0x2f')]=_[_0xe0ad('0x32')](db[_0xe0ad('0x48')][_0xe0ad('0x2c')]);_0x2c7701['query']=_[_0xe0ad('0x32')](_0x2b8b81['query']);_0x2c7701[_0xe0ad('0x38')]=_[_0xe0ad('0x33')](_0x2c7701[_0xe0ad('0x2f')],_0x2c7701[_0xe0ad('0x31')]);_0x57b5d1[_0xe0ad('0x34')]=_['intersection'](_0x2c7701[_0xe0ad('0x2f')],qs['fields'](_0x2b8b81[_0xe0ad('0x31')][_0xe0ad('0x43')]));_0x57b5d1[_0xe0ad('0x34')]=_0x57b5d1['attributes'][_0xe0ad('0x35')]?_0x57b5d1[_0xe0ad('0x34')]:_0x2c7701[_0xe0ad('0x2f')];_0x57b5d1[_0xe0ad('0x49')]=qs[_0xe0ad('0x37')](_0x2b8b81[_0xe0ad('0x31')][_0xe0ad('0x37')]);_0x57b5d1[_0xe0ad('0x3b')]=qs[_0xe0ad('0x38')](_[_0xe0ad('0x39')](_0x2b8b81[_0xe0ad('0x31')],_0x2c7701['filters']));if(_0x2b8b81[_0xe0ad('0x31')][_0xe0ad('0x3a')]){_0x57b5d1['where']=_[_0xe0ad('0x3c')](_0x57b5d1[_0xe0ad('0x3b')],{'$or':_[_0xe0ad('0x2a')](_0x57b5d1['attributes'],function(_0x16fb08){var _0x319d55={};_0x319d55[_0x16fb08]={'$like':'%'+_0x2b8b81[_0xe0ad('0x31')]['filter']+'%'};return _0x319d55;})});}_0x57b5d1=_[_0xe0ad('0x3c')]({},_0x57b5d1,_0x2b8b81[_0xe0ad('0x3d')]);return _0x21559d[_0xe0ad('0x4a')](_0x57b5d1);}})[_0xe0ad('0x24')](function(_0x1ef310){if(_0x1ef310){_0x48815c=_0x1ef310[_0xe0ad('0x35')];if(!_0x2b8b81[_0xe0ad('0x31')][_0xe0ad('0x36')](_0xe0ad('0x4b'))){_0x57b5d1[_0xe0ad('0x1c')]=qs[_0xe0ad('0x1c')](_0x2b8b81[_0xe0ad('0x31')]['limit']);_0x57b5d1[_0xe0ad('0x1a')]=qs[_0xe0ad('0x1a')](_0x2b8b81[_0xe0ad('0x31')][_0xe0ad('0x1a')]);}return _0x21559d[_0xe0ad('0x4a')](_0x57b5d1);}})[_0xe0ad('0x24')](function(_0x280774){if(_0x280774){return _0x280774?{'count':_0x48815c,'rows':_0x280774}:null;}})[_0xe0ad('0x24')](respondWithResult(_0x233b7c,null))[_0xe0ad('0x41')](handleError(_0x233b7c,null));};exports['addConfiguration']=function(_0x527854,_0x5a2e22,_0x111fc1){if(_0x527854[_0xe0ad('0x46')]['id']){delete _0x527854[_0xe0ad('0x46')]['id'];}return db['SugarcrmAccount'][_0xe0ad('0x47')]({'where':{'id':_0x527854[_0xe0ad('0x42')]['id']}})[_0xe0ad('0x24')](handleEntityNotFound(_0x5a2e22,null))[_0xe0ad('0x24')](function(_0xb8c9e6){if(_0xb8c9e6){_0x527854[_0xe0ad('0x46')][_0xe0ad('0x4c')]=_0xb8c9e6['id'];_0x527854[_0xe0ad('0x46')][_0xe0ad('0x4d')]=integrations[_0xe0ad('0x4e')](_0x527854[_0xe0ad('0x46')][_0xe0ad('0x4f')],_0x527854[_0xe0ad('0x46')][_0xe0ad('0x2d')]);_0x527854['body']['Descriptions']=integrations[_0xe0ad('0x50')](_0x527854[_0xe0ad('0x46')][_0xe0ad('0x4f')],_0x527854[_0xe0ad('0x46')]['type']);return db['SugarcrmConfiguration']['create'](_0x527854[_0xe0ad('0x46')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0xe0ad('0x51')],'as':_0xe0ad('0x52')}]});}return null;})[_0xe0ad('0x24')](respondWithResult(_0x5a2e22,null))[_0xe0ad('0x41')](handleError(_0x5a2e22,null));};exports[_0xe0ad('0x53')]=function(_0x58a6c9,_0x110f4d,_0x15e912){var _0x2fb639='';var _0x31d4bb=['id','name',_0xe0ad('0x54'),_0xe0ad('0x55'),_0xe0ad('0x56'),_0xe0ad('0x57'),_0xe0ad('0x58'),_0xe0ad('0x59'),_0xe0ad('0x5a'),'parent_type','parent_name','direction'];return db['SugarcrmAccount'][_0xe0ad('0x47')]({'where':{'id':_0x58a6c9[_0xe0ad('0x42')]['id']},'attributes':['id',_0xe0ad('0x5b'),_0xe0ad('0x5c'),_0xe0ad('0x5d')]})['then'](handleEntityNotFound(_0x110f4d,null))['then'](function(_0x2f1168){if(_0x2f1168){_0x2fb639=_0x2f1168['remoteUri'];var _0x2c187e=_0x2fb639['slice'](-0x1);if(_0x2c187e==='/'){_0x2fb639=_0x2fb639[_0xe0ad('0x5e')](0x0,_0x2fb639[_0xe0ad('0x5f')](_0x2c187e));}return rp({'method':_0xe0ad('0x60'),'uri':util['format'](_0xe0ad('0x61'),_0x2fb639,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xe0ad('0x62'),'input_type':_0xe0ad('0x63'),'response_type':_0xe0ad('0x63'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2f1168['username'],'password':_0x2f1168[_0xe0ad('0x5c')],'encryption':_0xe0ad('0x64')},'application':_0xe0ad('0x65')})}});}})['then'](function(_0x247d08){if(_0x247d08&&_0x247d08['name']!=='Invalid\x20Login'&&_0x247d08[_0xe0ad('0x30')]!==_0xe0ad('0x66')){return rp({'method':'POST','uri':util[_0xe0ad('0x67')](_0xe0ad('0x61'),_0x2fb639,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xe0ad('0x68'),'input_type':_0xe0ad('0x63'),'response_type':_0xe0ad('0x63'),'rest_data':JSON[_0xe0ad('0x69')]({'session':_0x247d08['id'],'module_name':_0xe0ad('0x6a')})}})['then'](function(_0x42205e){if(_0x42205e){var _0x30fe7e=_[_0xe0ad('0x6b')](_0x42205e['module_fields']);_[_0xe0ad('0x6c')](_0x30fe7e,function(_0x2e090d){return _0x31d4bb[_0xe0ad('0x6d')](_0x2e090d['name']);});return{'count':_0x30fe7e[_0xe0ad('0x35')],'rows':_[_0xe0ad('0x2a')](_0x30fe7e,function(_0x39e241){return{'id':_0x39e241['name'],'name':_0x39e241[_0xe0ad('0x6e')],'custom':_[_0xe0ad('0x6f')](_0x39e241[_0xe0ad('0x30')],'_c')?!![]:![],'options':_0x39e241[_0xe0ad('0x3d')]?_['map'](_[_0xe0ad('0x6b')](_0x39e241[_0xe0ad('0x3d')]),function(_0x710353){return{'name':_0x710353[_0xe0ad('0x70')],'value':_0x710353['name']};}):[]};})};}})[_0xe0ad('0x24')](respondWithResult(_0x110f4d,null))[_0xe0ad('0x41')](function(_0x439201){var _0x5db6d9=_0x58a6c9[_0xe0ad('0x31')]['test']?0x1f4:_0x439201[_0xe0ad('0x71')]||0x1f4;logger[_0xe0ad('0x26')](_0xe0ad('0x72'),_0xe0ad('0x53'),_0x5db6d9,JSON['stringify'](_0x439201));delete _0x439201[_0xe0ad('0x30')];if(_0x5db6d9===0x191){_0x5db6d9=0x190;}_0x110f4d[_0xe0ad('0x18')](_0x5db6d9)[_0xe0ad('0x28')](_0x58a6c9[_0xe0ad('0x31')][_0xe0ad('0x73')]?{'message':_0xe0ad('0x74'),'statusCode':_0x439201[_0xe0ad('0x71')]}:_0x439201);});}else{var _0x146172=0x1f4;_0x110f4d[_0xe0ad('0x18')](_0x146172)['send']({'message':_0xe0ad('0x74'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x28f1=['SugarcrmConfiguration','create','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','values','module_fields','remove','includes','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','Wrong\x20credentials','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','show','include','find','catch','body','params','destroy','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions'];(function(_0x56e061,_0x19e774){var _0x433833=function(_0x27dc5f){while(--_0x27dc5f){_0x56e061['push'](_0x56e061['shift']());}};_0x433833(++_0x19e774);}(_0x28f1,0x196));var _0x128f=function(_0x4b99c7,_0x44b1b3){_0x4b99c7=_0x4b99c7-0x0;var _0x5d8f5b=_0x28f1[_0x4b99c7];return _0x5d8f5b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x128f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x128f('0x1'));var moment=require(_0x128f('0x2'));var BPromise=require(_0x128f('0x3'));var Mustache=require(_0x128f('0x4'));var util=require(_0x128f('0x5'));var path=require(_0x128f('0x6'));var sox=require(_0x128f('0x7'));var csv=require(_0x128f('0x8'));var ejs=require(_0x128f('0x9'));var fs=require('fs');var fs_extra=require(_0x128f('0xa'));var _=require('lodash');var squel=require(_0x128f('0xb'));var crypto=require(_0x128f('0xc'));var jsforce=require(_0x128f('0xd'));var deskjs=require(_0x128f('0xe'));var toCsv=require(_0x128f('0x8'));var querystring=require(_0x128f('0xf'));var Papa=require('papaparse');var Redis=require(_0x128f('0x10'));var authService=require(_0x128f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x128f('0x12'));var hardwareService=require(_0x128f('0x13'));var logger=require(_0x128f('0x14'))(_0x128f('0x15'));var utils=require(_0x128f('0x16'));var config=require(_0x128f('0x17'));var licenseUtil=require(_0x128f('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x29e524,_0x382adc){_0x382adc=_0x382adc||0xcc;return function(_0x54d4b0){if(_0x54d4b0){return _0x29e524[_0x128f('0x19')](_0x382adc);}return _0x29e524[_0x128f('0x1a')](_0x382adc)[_0x128f('0x1b')]();};}function respondWithResult(_0x3e7349,_0x27e46d){_0x27e46d=_0x27e46d||0xc8;return function(_0x59b397){if(_0x59b397){return _0x3e7349[_0x128f('0x1a')](_0x27e46d)[_0x128f('0x1c')](_0x59b397);}};}function respondWithFilteredResult(_0x381b83,_0x49e8ad){return function(_0x2d6f3d){if(_0x2d6f3d){var _0x1da017=typeof _0x49e8ad[_0x128f('0x1d')]===_0x128f('0x1e')&&typeof _0x49e8ad[_0x128f('0x1f')]===_0x128f('0x1e');var _0x32f788=_0x2d6f3d['count'];var _0x1561a7=_0x1da017?0x0:_0x49e8ad[_0x128f('0x1d')];var _0x28a794=_0x1da017?_0x2d6f3d[_0x128f('0x20')]:_0x49e8ad[_0x128f('0x1d')]+_0x49e8ad[_0x128f('0x1f')];var _0x2a286d;if(_0x28a794>=_0x32f788){_0x28a794=_0x32f788;_0x2a286d=0xc8;}else{_0x2a286d=0xce;}_0x381b83[_0x128f('0x1a')](_0x2a286d);return _0x381b83['set'](_0x128f('0x21'),_0x1561a7+'-'+_0x28a794+'/'+_0x32f788)['json'](_0x2d6f3d);}return null;};}function patchUpdates(_0x209c7f){return function(_0x1351e3){try{jsonpatch[_0x128f('0x22')](_0x1351e3,_0x209c7f,!![]);}catch(_0x587abe){return BPromise[_0x128f('0x23')](_0x587abe);}return _0x1351e3['save']();};}function saveUpdates(_0x16d4bb,_0x5acb54){return function(_0x4cbc7d){if(_0x4cbc7d){return _0x4cbc7d[_0x128f('0x24')](_0x16d4bb)[_0x128f('0x25')](function(_0x4e6b19){return _0x4e6b19;});}return null;};}function removeEntity(_0x1615fe,_0x56066a){return function(_0x5b8d42){if(_0x5b8d42){return _0x5b8d42['destroy']()[_0x128f('0x25')](function(){_0x1615fe[_0x128f('0x1a')](0xcc)[_0x128f('0x1b')]();});}};}function handleEntityNotFound(_0x4b2d2d,_0x2ed282){return function(_0xbf4c12){if(!_0xbf4c12){_0x4b2d2d[_0x128f('0x19')](0x194);}return _0xbf4c12;};}function handleError(_0x233cdb,_0x43f2aa){_0x43f2aa=_0x43f2aa||0x1f4;return function(_0x136fe4){logger[_0x128f('0x26')](_0x136fe4[_0x128f('0x27')]);if(_0x136fe4[_0x128f('0x28')]){delete _0x136fe4[_0x128f('0x28')];}_0x233cdb['status'](_0x43f2aa)[_0x128f('0x29')](_0x136fe4);};}exports['index']=function(_0x34e2fa,_0x5b9807){var _0x54c9bd={},_0x18f252={},_0x3ffa08={'count':0x0,'rows':[]};var _0x5dfb59=_[_0x128f('0x2a')](db[_0x128f('0x2b')][_0x128f('0x2c')],function(_0x28e27c){return{'name':_0x28e27c[_0x128f('0x2d')],'type':_0x28e27c[_0x128f('0x2e')]['key']};});_0x18f252[_0x128f('0x2f')]=_[_0x128f('0x2a')](_0x5dfb59,'name');_0x18f252[_0x128f('0x30')]=_[_0x128f('0x31')](_0x34e2fa[_0x128f('0x30')]);_0x18f252['filters']=_[_0x128f('0x32')](_0x18f252['model'],_0x18f252[_0x128f('0x30')]);_0x54c9bd['attributes']=_[_0x128f('0x32')](_0x18f252['model'],qs['fields'](_0x34e2fa['query'][_0x128f('0x33')]));_0x54c9bd[_0x128f('0x34')]=_0x54c9bd[_0x128f('0x34')][_0x128f('0x35')]?_0x54c9bd[_0x128f('0x34')]:_0x18f252[_0x128f('0x2f')];if(!_0x34e2fa[_0x128f('0x30')][_0x128f('0x36')](_0x128f('0x37'))){_0x54c9bd[_0x128f('0x1f')]=qs['limit'](_0x34e2fa['query'][_0x128f('0x1f')]);_0x54c9bd['offset']=qs[_0x128f('0x1d')](_0x34e2fa[_0x128f('0x30')][_0x128f('0x1d')]);}_0x54c9bd['order']=qs[_0x128f('0x38')](_0x34e2fa[_0x128f('0x30')]['sort']);_0x54c9bd[_0x128f('0x39')]=qs['filters'](_[_0x128f('0x3a')](_0x34e2fa[_0x128f('0x30')],_0x18f252[_0x128f('0x3b')]),_0x5dfb59);if(_0x34e2fa['query'][_0x128f('0x3c')]){_0x54c9bd[_0x128f('0x39')]=_[_0x128f('0x3d')](_0x54c9bd[_0x128f('0x39')],{'$or':_[_0x128f('0x2a')](_0x5dfb59,function(_0xdd7032){if(_0xdd7032[_0x128f('0x2e')]!==_0x128f('0x3e')){var _0x6b55de={};_0x6b55de[_0xdd7032['name']]={'$like':'%'+_0x34e2fa[_0x128f('0x30')][_0x128f('0x3c')]+'%'};return _0x6b55de;}})});}_0x54c9bd=_[_0x128f('0x3d')]({},_0x54c9bd,_0x34e2fa[_0x128f('0x3f')]);var _0x4ff44c={'where':_0x54c9bd[_0x128f('0x39')]};return db['SugarcrmAccount']['count'](_0x4ff44c)['then'](function(_0xe4825){_0x3ffa08[_0x128f('0x20')]=_0xe4825;if(_0x34e2fa[_0x128f('0x30')][_0x128f('0x40')]){_0x54c9bd['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x128f('0x41')](_0x54c9bd);})['then'](function(_0x4a66c2){_0x3ffa08['rows']=_0x4a66c2;return _0x3ffa08;})[_0x128f('0x25')](respondWithFilteredResult(_0x5b9807,_0x54c9bd))['catch'](handleError(_0x5b9807,null));};exports[_0x128f('0x42')]=function(_0x3d2d6b,_0x198d71){var _0x5c8da3={'raw':![],'where':{'id':_0x3d2d6b['params']['id']}},_0x2fae9e={};_0x2fae9e[_0x128f('0x2f')]=_[_0x128f('0x31')](db[_0x128f('0x2b')][_0x128f('0x2c')]);_0x2fae9e['query']=_[_0x128f('0x31')](_0x3d2d6b[_0x128f('0x30')]);_0x2fae9e[_0x128f('0x3b')]=_['intersection'](_0x2fae9e[_0x128f('0x2f')],_0x2fae9e[_0x128f('0x30')]);_0x5c8da3[_0x128f('0x34')]=_[_0x128f('0x32')](_0x2fae9e[_0x128f('0x2f')],qs[_0x128f('0x33')](_0x3d2d6b['query']['fields']));_0x5c8da3[_0x128f('0x34')]=_0x5c8da3[_0x128f('0x34')][_0x128f('0x35')]?_0x5c8da3['attributes']:_0x2fae9e[_0x128f('0x2f')];if(_0x3d2d6b[_0x128f('0x30')]['includeAll']){_0x5c8da3[_0x128f('0x43')]=[{'all':!![]}];}_0x5c8da3=_[_0x128f('0x3d')]({},_0x5c8da3,_0x3d2d6b[_0x128f('0x3f')]);return db[_0x128f('0x2b')][_0x128f('0x44')](_0x5c8da3)[_0x128f('0x25')](handleEntityNotFound(_0x198d71,null))['then'](respondWithResult(_0x198d71,null))[_0x128f('0x45')](handleError(_0x198d71,null));};exports['create']=function(_0x17fe8b,_0xe6afaa){return db['SugarcrmAccount']['create'](_0x17fe8b[_0x128f('0x46')],{})[_0x128f('0x25')](respondWithResult(_0xe6afaa,0xc9))['catch'](handleError(_0xe6afaa,null));};exports[_0x128f('0x24')]=function(_0x3da7e5,_0x25ebae){if(_0x3da7e5[_0x128f('0x46')]['id']){delete _0x3da7e5['body']['id'];}return db[_0x128f('0x2b')]['find']({'where':{'id':_0x3da7e5[_0x128f('0x47')]['id']}})['then'](handleEntityNotFound(_0x25ebae,null))[_0x128f('0x25')](saveUpdates(_0x3da7e5[_0x128f('0x46')],null))[_0x128f('0x25')](respondWithResult(_0x25ebae,null))[_0x128f('0x45')](handleError(_0x25ebae,null));};exports[_0x128f('0x48')]=function(_0x2f9072,_0x18c38d){return db[_0x128f('0x2b')][_0x128f('0x44')]({'where':{'id':_0x2f9072[_0x128f('0x47')]['id']}})[_0x128f('0x25')](handleEntityNotFound(_0x18c38d,null))['then'](removeEntity(_0x18c38d,null))['catch'](handleError(_0x18c38d,null));};exports[_0x128f('0x49')]=function(_0x2a1e1c,_0x3c6258,_0x5d7b0a){var _0x5161be={};var _0x55f4fb={};var _0x3e9e7d;var _0x22ac49;return db[_0x128f('0x2b')][_0x128f('0x4a')]({'where':{'id':_0x2a1e1c['params']['id']}})[_0x128f('0x25')](handleEntityNotFound(_0x3c6258,null))[_0x128f('0x25')](function(_0x3f07e0){if(_0x3f07e0){_0x3e9e7d=_0x3f07e0;_0x55f4fb[_0x128f('0x2f')]=_[_0x128f('0x31')](db['SugarcrmConfiguration']['rawAttributes']);_0x55f4fb[_0x128f('0x30')]=_[_0x128f('0x31')](_0x2a1e1c[_0x128f('0x30')]);_0x55f4fb['filters']=_[_0x128f('0x32')](_0x55f4fb['model'],_0x55f4fb[_0x128f('0x30')]);_0x5161be[_0x128f('0x34')]=_['intersection'](_0x55f4fb[_0x128f('0x2f')],qs['fields'](_0x2a1e1c['query'][_0x128f('0x33')]));_0x5161be[_0x128f('0x34')]=_0x5161be[_0x128f('0x34')][_0x128f('0x35')]?_0x5161be[_0x128f('0x34')]:_0x55f4fb[_0x128f('0x2f')];_0x5161be[_0x128f('0x4b')]=qs[_0x128f('0x38')](_0x2a1e1c[_0x128f('0x30')]['sort']);_0x5161be['where']=qs[_0x128f('0x3b')](_[_0x128f('0x3a')](_0x2a1e1c[_0x128f('0x30')],_0x55f4fb[_0x128f('0x3b')]));if(_0x2a1e1c[_0x128f('0x30')][_0x128f('0x3c')]){_0x5161be[_0x128f('0x39')]=_[_0x128f('0x3d')](_0x5161be[_0x128f('0x39')],{'$or':_['map'](_0x5161be['attributes'],function(_0x52a76c){var _0x3efc26={};_0x3efc26[_0x52a76c]={'$like':'%'+_0x2a1e1c[_0x128f('0x30')][_0x128f('0x3c')]+'%'};return _0x3efc26;})});}_0x5161be=_[_0x128f('0x3d')]({},_0x5161be,_0x2a1e1c[_0x128f('0x3f')]);return _0x3e9e7d[_0x128f('0x49')](_0x5161be);}})[_0x128f('0x25')](function(_0x22d310){if(_0x22d310){_0x22ac49=_0x22d310[_0x128f('0x35')];if(!_0x2a1e1c[_0x128f('0x30')][_0x128f('0x36')]('nolimit')){_0x5161be[_0x128f('0x1f')]=qs[_0x128f('0x1f')](_0x2a1e1c[_0x128f('0x30')][_0x128f('0x1f')]);_0x5161be[_0x128f('0x1d')]=qs[_0x128f('0x1d')](_0x2a1e1c['query']['offset']);}return _0x3e9e7d['getConfigurations'](_0x5161be);}})['then'](function(_0x3d6c86){if(_0x3d6c86){return _0x3d6c86?{'count':_0x22ac49,'rows':_0x3d6c86}:null;}})[_0x128f('0x25')](respondWithResult(_0x3c6258,null))[_0x128f('0x45')](handleError(_0x3c6258,null));};exports[_0x128f('0x4c')]=function(_0x42b2f6,_0x23e55b,_0x341be0){if(_0x42b2f6[_0x128f('0x46')]['id']){delete _0x42b2f6[_0x128f('0x46')]['id'];}return db['SugarcrmAccount'][_0x128f('0x4a')]({'where':{'id':_0x42b2f6[_0x128f('0x47')]['id']}})[_0x128f('0x25')](handleEntityNotFound(_0x23e55b,null))[_0x128f('0x25')](function(_0xaec81c){if(_0xaec81c){_0x42b2f6[_0x128f('0x46')][_0x128f('0x4d')]=_0xaec81c['id'];_0x42b2f6['body'][_0x128f('0x4e')]=integrations['getSubjects'](_0x42b2f6[_0x128f('0x46')][_0x128f('0x4f')],_0x42b2f6['body'][_0x128f('0x2e')]);_0x42b2f6[_0x128f('0x46')][_0x128f('0x50')]=integrations[_0x128f('0x51')](_0x42b2f6['body']['channel'],_0x42b2f6['body'][_0x128f('0x2e')]);return db[_0x128f('0x52')][_0x128f('0x53')](_0x42b2f6[_0x128f('0x46')],{'include':[{'model':db['SugarcrmField'],'as':_0x128f('0x4e')},{'model':db['SugarcrmField'],'as':_0x128f('0x50')}]});}return null;})['then'](respondWithResult(_0x23e55b,null))[_0x128f('0x45')](handleError(_0x23e55b,null));};exports[_0x128f('0x54')]=function(_0x4501fc,_0x4c1fe3,_0x46aa2c){var _0x302fb4='';var _0x20f0aa=['id','name',_0x128f('0x55'),'created_by',_0x128f('0x56'),_0x128f('0x57'),_0x128f('0x58'),_0x128f('0x59'),_0x128f('0x5a'),_0x128f('0x5b'),_0x128f('0x5c'),_0x128f('0x5d')];return db[_0x128f('0x2b')]['findOne']({'where':{'id':_0x4501fc[_0x128f('0x47')]['id']},'attributes':['id',_0x128f('0x5e'),_0x128f('0x5f'),_0x128f('0x60')]})[_0x128f('0x25')](handleEntityNotFound(_0x4c1fe3,null))[_0x128f('0x25')](function(_0x574fee){if(_0x574fee){_0x302fb4=_0x574fee[_0x128f('0x60')];var _0x5610eb=_0x302fb4[_0x128f('0x61')](-0x1);if(_0x5610eb==='/'){_0x302fb4=_0x302fb4[_0x128f('0x62')](0x0,_0x302fb4[_0x128f('0x63')](_0x5610eb));}return rp({'method':_0x128f('0x64'),'uri':util[_0x128f('0x65')](_0x128f('0x66'),_0x302fb4,_0x128f('0x67')),'json':!![],'form':{'method':_0x128f('0x68'),'input_type':_0x128f('0x69'),'response_type':'JSON','rest_data':JSON[_0x128f('0x6a')]({'user_auth':{'user_name':_0x574fee['username'],'password':_0x574fee[_0x128f('0x5f')],'encryption':_0x128f('0x6b')},'application':_0x128f('0x6c')})}});}})['then'](function(_0x5651f0){if(_0x5651f0&&_0x5651f0['name']!==_0x128f('0x6d')&&_0x5651f0[_0x128f('0x28')]!==_0x128f('0x6e')){return rp({'method':_0x128f('0x64'),'uri':util[_0x128f('0x65')](_0x128f('0x66'),_0x302fb4,_0x128f('0x67')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x128f('0x69'),'response_type':_0x128f('0x69'),'rest_data':JSON[_0x128f('0x6a')]({'session':_0x5651f0['id'],'module_name':_0x128f('0x6f')})}})[_0x128f('0x25')](function(_0x72d200){if(_0x72d200){var _0x96c339=_[_0x128f('0x70')](_0x72d200[_0x128f('0x71')]);_[_0x128f('0x72')](_0x96c339,function(_0x28d198){return _0x20f0aa[_0x128f('0x73')](_0x28d198[_0x128f('0x28')]);});return{'count':_0x96c339[_0x128f('0x35')],'rows':_['map'](_0x96c339,function(_0x16d563){return{'id':_0x16d563[_0x128f('0x28')],'name':_0x16d563['label'],'custom':_[_0x128f('0x74')](_0x16d563[_0x128f('0x28')],'_c')?!![]:![],'options':_0x16d563[_0x128f('0x3f')]?_[_0x128f('0x2a')](_['values'](_0x16d563[_0x128f('0x3f')]),function(_0x18439c){return{'name':_0x18439c[_0x128f('0x75')],'value':_0x18439c['name']};}):[]};})};}})[_0x128f('0x25')](respondWithResult(_0x4c1fe3,null))['catch'](function(_0x178c2a){var _0x1c9d19=_0x4501fc[_0x128f('0x30')][_0x128f('0x76')]?0x1f4:_0x178c2a['statusCode']||0x1f4;logger[_0x128f('0x26')](_0x128f('0x77'),_0x128f('0x54'),_0x1c9d19,JSON[_0x128f('0x6a')](_0x178c2a));delete _0x178c2a[_0x128f('0x28')];if(_0x1c9d19===0x191){_0x1c9d19=0x190;}_0x4c1fe3[_0x128f('0x1a')](_0x1c9d19)[_0x128f('0x29')](_0x4501fc[_0x128f('0x30')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x178c2a[_0x128f('0x78')]}:_0x178c2a);});}else{var _0x3092b5=0x1f4;_0x4c1fe3[_0x128f('0x1a')](_0x3092b5)[_0x128f('0x29')]({'message':_0x128f('0x79'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 630d7e4..4d21d62 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 _0xc35f=['bluebird','request-promise','path','../../config/environment','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api'];(function(_0xb7172a,_0x28ca14){var _0x51911a=function(_0x44b811){while(--_0x44b811){_0xb7172a['push'](_0xb7172a['shift']());}};_0x51911a(++_0x28ca14);}(_0xc35f,0x1ca));var _0xfc35=function(_0x2b2680,_0x3adf49){_0x2b2680=_0x2b2680-0x0;var _0x2d5403=_0xc35f[_0x2b2680];return _0x2d5403;};'use strict';var _=require(_0xfc35('0x0'));var util=require(_0xfc35('0x1'));var logger=require(_0xfc35('0x2'))(_0xfc35('0x3'));var moment=require('moment');var BPromise=require(_0xfc35('0x4'));var rp=require(_0xfc35('0x5'));var fs=require('fs');var path=require(_0xfc35('0x6'));var rimraf=require('rimraf');var config=require(_0xfc35('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xfc35('0x8')]=function(_0x1991a5,_0x4c92db){return _0x1991a5['define'](_0xfc35('0x9'),attributes,{'tableName':_0xfc35('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x151b=['../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment','bluebird','path','./intSugarcrmAccount.attributes'];(function(_0x566865,_0xad743b){var _0xf86a5d=function(_0x59d49f){while(--_0x59d49f){_0x566865['push'](_0x566865['shift']());}};_0xf86a5d(++_0xad743b);}(_0x151b,0x149));var _0xb151=function(_0x5adf01,_0x5049c0){_0x5adf01=_0x5adf01-0x0;var _0x40ab25=_0x151b[_0x5adf01];return _0x40ab25;};'use strict';var _=require(_0xb151('0x0'));var util=require(_0xb151('0x1'));var logger=require(_0xb151('0x2'))('api');var moment=require(_0xb151('0x3'));var BPromise=require(_0xb151('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb151('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb151('0x6'));var integrations=require(_0xb151('0x7'));module[_0xb151('0x8')]=function(_0x45ed62,_0x227611){return _0x45ed62[_0xb151('0x9')](_0xb151('0xa'),attributes,{'tableName':_0xb151('0xb'),'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 60047f1..2b0bdb4 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 _0x5b68=['request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','options','raw','where','limit','include','map','model','attributes','GetSugarcrmAccount','stringify','SugarcrmAccount','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x3f93db,_0x1e3f0a){var _0x2900a4=function(_0x3ce657){while(--_0x3ce657){_0x3f93db['push'](_0x3f93db['shift']());}};_0x2900a4(++_0x1e3f0a);}(_0x5b68,0x1d6));var _0x85b6=function(_0x504dee,_0x3cefd3){_0x504dee=_0x504dee-0x0;var _0x3fb6c0=_0x5b68[_0x504dee];return _0x3fb6c0;};'use strict';var _=require(_0x85b6('0x0'));var util=require(_0x85b6('0x1'));var moment=require(_0x85b6('0x2'));var BPromise=require(_0x85b6('0x3'));var rs=require(_0x85b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x85b6('0x5'));var logger=require('../../config/logger')(_0x85b6('0x6'));var config=require(_0x85b6('0x7'));var jayson=require(_0x85b6('0x8'));var client=jayson['client'][_0x85b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22bbc4,_0x440bd3,_0x2d23e6){return new BPromise(function(_0x182273,_0x1df8ad){return client[_0x85b6('0xa')](_0x22bbc4,_0x2d23e6)[_0x85b6('0xb')](function(_0x448897){logger[_0x85b6('0xc')](_0x85b6('0xd'),_0x440bd3,_0x85b6('0xe'));logger[_0x85b6('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x440bd3,_0x85b6('0xe'),JSON['stringify'](_0x448897));if(_0x448897['error']){if(_0x448897[_0x85b6('0x10')]['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x440bd3,_0x448897[_0x85b6('0x10')]['message']);return _0x1df8ad(_0x448897[_0x85b6('0x10')][_0x85b6('0x11')]);}logger['error'](_0x85b6('0xd'),_0x440bd3,_0x448897[_0x85b6('0x10')][_0x85b6('0x11')]);return _0x182273(_0x448897[_0x85b6('0x10')][_0x85b6('0x11')]);}else{logger['info'](_0x85b6('0xd'),_0x440bd3,_0x85b6('0xe'));_0x182273(_0x448897[_0x85b6('0x12')][_0x85b6('0x11')]);}})[_0x85b6('0x13')](function(_0xa08a02){logger[_0x85b6('0x10')](_0x85b6('0xd'),_0x440bd3,_0xa08a02);_0x1df8ad(_0xa08a02);});});}exports['GetSugarcrmAccount']=function(_0x140fae){var _0x3d4027=this;return new Promise(function(_0x38e2cb,_0x380af4){return db['SugarcrmAccount']['findAll']({'raw':_0x140fae[_0x85b6('0x14')]?_0x140fae['options'][_0x85b6('0x15')]===undefined?!![]:![]:!![],'where':_0x140fae[_0x85b6('0x14')]?_0x140fae[_0x85b6('0x14')][_0x85b6('0x16')]||null:null,'attributes':_0x140fae[_0x85b6('0x14')]?_0x140fae[_0x85b6('0x14')]['attributes']||null:null,'limit':_0x140fae[_0x85b6('0x14')]?_0x140fae[_0x85b6('0x14')][_0x85b6('0x17')]||null:null,'include':_0x140fae[_0x85b6('0x14')]?_0x140fae[_0x85b6('0x14')][_0x85b6('0x18')]?_[_0x85b6('0x19')](_0x140fae['options'][_0x85b6('0x18')],function(_0x4d84a9){return{'model':db[_0x4d84a9[_0x85b6('0x1a')]],'as':_0x4d84a9['as'],'attributes':_0x4d84a9[_0x85b6('0x1b')],'include':_0x4d84a9[_0x85b6('0x18')]?_[_0x85b6('0x19')](_0x4d84a9['include'],function(_0x43b5fb){return{'model':db[_0x43b5fb[_0x85b6('0x1a')]],'as':_0x43b5fb['as'],'attributes':_0x43b5fb[_0x85b6('0x1b')],'include':_0x43b5fb['include']?_['map'](_0x43b5fb['include'],function(_0xd88e9d){return{'model':db[_0xd88e9d['model']],'as':_0xd88e9d['as'],'attributes':_0xd88e9d[_0x85b6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36e186){logger['info'](_0x85b6('0x1c'),_0x140fae);logger[_0x85b6('0xf')]('GetSugarcrmAccount',_0x140fae,JSON[_0x85b6('0x1d')](_0x36e186));_0x38e2cb(_0x36e186);})[_0x85b6('0x13')](function(_0x1e0ef0){logger[_0x85b6('0x10')](_0x85b6('0x1c'),_0x1e0ef0['message'],_0x140fae);_0x380af4(_0x3d4027['error'](0x1f4,_0x1e0ef0[_0x85b6('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x3dda74){var _0x1fd28a=this;return new Promise(function(_0x403e9b,_0x24a6c9){return db[_0x85b6('0x1e')]['find']({'raw':_0x3dda74[_0x85b6('0x14')]?_0x3dda74[_0x85b6('0x14')][_0x85b6('0x15')]===undefined?!![]:![]:!![],'where':_0x3dda74[_0x85b6('0x14')]?_0x3dda74['options'][_0x85b6('0x16')]||null:null,'attributes':_0x3dda74[_0x85b6('0x14')]?_0x3dda74[_0x85b6('0x14')]['attributes']||null:null,'include':_0x3dda74['options']?_0x3dda74[_0x85b6('0x14')][_0x85b6('0x18')]?_[_0x85b6('0x19')](_0x3dda74[_0x85b6('0x14')][_0x85b6('0x18')],function(_0xc73d0c){return{'model':db[_0xc73d0c[_0x85b6('0x1a')]],'as':_0xc73d0c['as'],'attributes':_0xc73d0c[_0x85b6('0x1b')],'include':_0xc73d0c[_0x85b6('0x18')]?_[_0x85b6('0x19')](_0xc73d0c['include'],function(_0xbd6e75){return{'model':db[_0xbd6e75['model']],'as':_0xbd6e75['as'],'attributes':_0xbd6e75[_0x85b6('0x1b')],'include':_0xbd6e75[_0x85b6('0x18')]?_[_0x85b6('0x19')](_0xbd6e75['include'],function(_0x274b05){return{'model':db[_0x274b05['model']],'as':_0x274b05['as'],'attributes':_0x274b05['attributes']};}):[]};}):[]};}):[]:[]})[_0x85b6('0xb')](function(_0x3cc2ab){logger[_0x85b6('0xc')](_0x85b6('0x1f'),_0x3dda74);logger['debug'](_0x85b6('0x1f'),_0x3dda74,JSON[_0x85b6('0x1d')](_0x3cc2ab));_0x403e9b(_0x3cc2ab);})[_0x85b6('0x13')](function(_0x482281){logger[_0x85b6('0x10')](_0x85b6('0x1f'),_0x482281[_0x85b6('0x11')],_0x3dda74);_0x24a6c9(_0x1fd28a[_0x85b6('0x10')](0x1f4,_0x482281[_0x85b6('0x11')]));});});}; \ No newline at end of file +var _0x0c00=['SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','attributes','include','map','model','stringify','find','where','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x8cb9a1,_0x27c769){var _0x3b7a07=function(_0x5a4eaa){while(--_0x5a4eaa){_0x8cb9a1['push'](_0x8cb9a1['shift']());}};_0x3b7a07(++_0x27c769);}(_0x0c00,0x1be));var _0x00c0=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x0c00[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x00c0('0x0'));var util=require(_0x00c0('0x1'));var moment=require(_0x00c0('0x2'));var BPromise=require(_0x00c0('0x3'));var rs=require(_0x00c0('0x4'));var fs=require('fs');var Redis=require(_0x00c0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x00c0('0x6'));var logger=require(_0x00c0('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x00c0('0x8'));var client=jayson['client'][_0x00c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5da5bb,_0x254dd2,_0x11625b){return new BPromise(function(_0x2cc2b9,_0x1de16e){return client[_0x00c0('0xa')](_0x5da5bb,_0x11625b)[_0x00c0('0xb')](function(_0x44fdc6){logger[_0x00c0('0xc')](_0x00c0('0xd'),_0x254dd2,_0x00c0('0xe'));logger[_0x00c0('0xf')](_0x00c0('0x10'),_0x254dd2,'request\x20sent',JSON['stringify'](_0x44fdc6));if(_0x44fdc6[_0x00c0('0x11')]){if(_0x44fdc6['error'][_0x00c0('0x12')]===0x1f4){logger[_0x00c0('0x11')](_0x00c0('0xd'),_0x254dd2,_0x44fdc6['error'][_0x00c0('0x13')]);return _0x1de16e(_0x44fdc6['error'][_0x00c0('0x13')]);}logger['error'](_0x00c0('0xd'),_0x254dd2,_0x44fdc6['error'][_0x00c0('0x13')]);return _0x2cc2b9(_0x44fdc6[_0x00c0('0x11')][_0x00c0('0x13')]);}else{logger['info'](_0x00c0('0xd'),_0x254dd2,'request\x20sent');_0x2cc2b9(_0x44fdc6['result'][_0x00c0('0x13')]);}})[_0x00c0('0x14')](function(_0x11f145){logger[_0x00c0('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x254dd2,_0x11f145);_0x1de16e(_0x11f145);});});}exports[_0x00c0('0x15')]=function(_0x308400){var _0x2ef2e3=this;return new Promise(function(_0x3c8221,_0x3ad8b4){return db[_0x00c0('0x16')]['findAll']({'raw':_0x308400[_0x00c0('0x17')]?_0x308400['options'][_0x00c0('0x18')]===undefined?!![]:![]:!![],'where':_0x308400[_0x00c0('0x17')]?_0x308400[_0x00c0('0x17')]['where']||null:null,'attributes':_0x308400[_0x00c0('0x17')]?_0x308400[_0x00c0('0x17')][_0x00c0('0x19')]||null:null,'limit':_0x308400[_0x00c0('0x17')]?_0x308400[_0x00c0('0x17')]['limit']||null:null,'include':_0x308400['options']?_0x308400[_0x00c0('0x17')][_0x00c0('0x1a')]?_[_0x00c0('0x1b')](_0x308400[_0x00c0('0x17')][_0x00c0('0x1a')],function(_0x27bd0e){return{'model':db[_0x27bd0e[_0x00c0('0x1c')]],'as':_0x27bd0e['as'],'attributes':_0x27bd0e[_0x00c0('0x19')],'include':_0x27bd0e[_0x00c0('0x1a')]?_[_0x00c0('0x1b')](_0x27bd0e[_0x00c0('0x1a')],function(_0x1565a9){return{'model':db[_0x1565a9[_0x00c0('0x1c')]],'as':_0x1565a9['as'],'attributes':_0x1565a9[_0x00c0('0x19')],'include':_0x1565a9['include']?_['map'](_0x1565a9[_0x00c0('0x1a')],function(_0x5a900c){return{'model':db[_0x5a900c['model']],'as':_0x5a900c['as'],'attributes':_0x5a900c[_0x00c0('0x19')]};}):[]};}):[]};}):[]:[]})[_0x00c0('0xb')](function(_0x3072f5){logger[_0x00c0('0xc')](_0x00c0('0x15'),_0x308400);logger['debug']('GetSugarcrmAccount',_0x308400,JSON[_0x00c0('0x1d')](_0x3072f5));_0x3c8221(_0x3072f5);})[_0x00c0('0x14')](function(_0xaf1d52){logger['error'](_0x00c0('0x15'),_0xaf1d52[_0x00c0('0x13')],_0x308400);_0x3ad8b4(_0x2ef2e3[_0x00c0('0x11')](0x1f4,_0xaf1d52[_0x00c0('0x13')]));});});};exports['ShowSugarcrmAccount']=function(_0x4f90de){var _0x2bd759=this;return new Promise(function(_0x4b8722,_0x25657d){return db['SugarcrmAccount'][_0x00c0('0x1e')]({'raw':_0x4f90de['options']?_0x4f90de[_0x00c0('0x17')][_0x00c0('0x18')]===undefined?!![]:![]:!![],'where':_0x4f90de[_0x00c0('0x17')]?_0x4f90de[_0x00c0('0x17')][_0x00c0('0x1f')]||null:null,'attributes':_0x4f90de[_0x00c0('0x17')]?_0x4f90de[_0x00c0('0x17')][_0x00c0('0x19')]||null:null,'include':_0x4f90de[_0x00c0('0x17')]?_0x4f90de[_0x00c0('0x17')][_0x00c0('0x1a')]?_[_0x00c0('0x1b')](_0x4f90de['options'][_0x00c0('0x1a')],function(_0x436eaa){return{'model':db[_0x436eaa[_0x00c0('0x1c')]],'as':_0x436eaa['as'],'attributes':_0x436eaa[_0x00c0('0x19')],'include':_0x436eaa[_0x00c0('0x1a')]?_[_0x00c0('0x1b')](_0x436eaa['include'],function(_0x437611){return{'model':db[_0x437611[_0x00c0('0x1c')]],'as':_0x437611['as'],'attributes':_0x437611[_0x00c0('0x19')],'include':_0x437611['include']?_[_0x00c0('0x1b')](_0x437611[_0x00c0('0x1a')],function(_0x4a39e6){return{'model':db[_0x4a39e6['model']],'as':_0x4a39e6['as'],'attributes':_0x4a39e6[_0x00c0('0x19')]};}):[]};}):[]};}):[]:[]})[_0x00c0('0xb')](function(_0x191d98){logger[_0x00c0('0xc')](_0x00c0('0x20'),_0x4f90de);logger['debug']('ShowSugarcrmAccount',_0x4f90de,JSON[_0x00c0('0x1d')](_0x191d98));_0x4b8722(_0x191d98);})[_0x00c0('0x14')](function(_0xcdb878){logger[_0x00c0('0x11')](_0x00c0('0x20'),_0xcdb878['message'],_0x4f90de);_0x25657d(_0x2bd759[_0x00c0('0x11')](0x1f4,_0xcdb878[_0x00c0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 9b51d1b..1b3ba42 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 _0xb44f=['./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4c62af,_0x278628){var _0x420d2e=function(_0x3f1050){while(--_0x3f1050){_0x4c62af['push'](_0x4c62af['shift']());}};_0x420d2e(++_0x278628);}(_0xb44f,0xe3));var _0xfb44=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb44f[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xfb44('0x0'));var util=require(_0xfb44('0x1'));var path=require('path');var timeout=require(_0xfb44('0x2'));var express=require(_0xfb44('0x3'));var router=express[_0xfb44('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfb44('0x5'));var config=require(_0xfb44('0x6'));var controller=require(_0xfb44('0x7'));router[_0xfb44('0x8')]('/',auth[_0xfb44('0x9')](),controller[_0xfb44('0xa')]);router[_0xfb44('0x8')](_0xfb44('0xb'),auth['isAuthenticated'](),controller[_0xfb44('0xc')]);router['get'](_0xfb44('0xd'),auth[_0xfb44('0x9')](),controller[_0xfb44('0xe')]);router[_0xfb44('0x8')](_0xfb44('0xf'),auth['isAuthenticated'](),controller[_0xfb44('0x10')]);router['get'](_0xfb44('0x11'),auth['isAuthenticated'](),controller[_0xfb44('0x12')]);router[_0xfb44('0x13')]('/',auth[_0xfb44('0x9')](),controller[_0xfb44('0x14')]);router[_0xfb44('0x15')](_0xfb44('0xb'),auth[_0xfb44('0x9')](),controller[_0xfb44('0x16')]);router[_0xfb44('0x17')]('/:id',auth[_0xfb44('0x9')](),controller[_0xfb44('0x18')]);module[_0xfb44('0x19')]=router; \ No newline at end of file +var _0x97a0=['../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x551ece,_0x23d845){var _0x24ac88=function(_0x4d801a){while(--_0x4d801a){_0x551ece['push'](_0x551ece['shift']());}};_0x24ac88(++_0x23d845);}(_0x97a0,0x171));var _0x097a=function(_0x103ad4,_0x49c8c3){_0x103ad4=_0x103ad4-0x0;var _0x528267=_0x97a0[_0x103ad4];return _0x528267;};'use strict';var multer=require(_0x097a('0x0'));var util=require(_0x097a('0x1'));var path=require(_0x097a('0x2'));var timeout=require(_0x097a('0x3'));var express=require(_0x097a('0x4'));var router=express[_0x097a('0x5')]();var fs_extra=require(_0x097a('0x6'));var auth=require(_0x097a('0x7'));var interaction=require(_0x097a('0x8'));var config=require(_0x097a('0x9'));var controller=require(_0x097a('0xa'));router[_0x097a('0xb')]('/',auth[_0x097a('0xc')](),controller[_0x097a('0xd')]);router[_0x097a('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x097a('0xe')]);router[_0x097a('0xb')](_0x097a('0xf'),auth[_0x097a('0xc')](),controller[_0x097a('0x10')]);router[_0x097a('0xb')]('/:id/subjects',auth[_0x097a('0xc')](),controller[_0x097a('0x11')]);router[_0x097a('0xb')](_0x097a('0x12'),auth[_0x097a('0xc')](),controller['getDescriptions']);router[_0x097a('0x13')]('/',auth[_0x097a('0xc')](),controller[_0x097a('0x14')]);router[_0x097a('0x15')]('/:id',auth[_0x097a('0xc')](),controller[_0x097a('0x16')]);router[_0x097a('0x17')](_0x097a('0x18'),auth[_0x097a('0xc')](),controller[_0x097a('0x19')]);module[_0x097a('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 73c3f85..c4774d4 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 _0x56d2=['sequelize','exports','STRING'];(function(_0x202662,_0x48def7){var _0x3d797e=function(_0x26be52){while(--_0x26be52){_0x202662['push'](_0x202662['shift']());}};_0x3d797e(++_0x48def7);}(_0x56d2,0xa8));var _0x256d=function(_0x1f847e,_0x1672ec){_0x1f847e=_0x1f847e-0x0;var _0x313e0f=_0x56d2[_0x1f847e];return _0x313e0f;};'use strict';var Sequelize=require(_0x256d('0x0'));module[_0x256d('0x1')]={'name':{'type':Sequelize[_0x256d('0x2')]},'description':{'type':Sequelize[_0x256d('0x2')]}}; \ No newline at end of file +var _0x6873=['STRING','exports'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0x6873,0x8f));var _0x3687=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x6873[_0x525c7b];return _0x27b33e;};'use strict';var Sequelize=require('sequelize');module[_0x3687('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3687('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 51b3347..399abc8 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 _0xf67c=['options','find','create','body','params','destroy','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','keys'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xf67c,0x9f));var _0xcf67=function(_0xca9031,_0x35bc10){_0xca9031=_0xca9031-0x0;var _0x1149d8=_0xf67c[_0xca9031];return _0x1149d8;};'use strict';var emlformat=require(_0xcf67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf67('0x1'));var jsonpatch=require(_0xcf67('0x2'));var rp=require('request-promise');var moment=require(_0xcf67('0x3'));var BPromise=require(_0xcf67('0x4'));var Mustache=require(_0xcf67('0x5'));var util=require('util');var path=require(_0xcf67('0x6'));var sox=require(_0xcf67('0x7'));var csv=require(_0xcf67('0x8'));var ejs=require(_0xcf67('0x9'));var fs=require('fs');var fs_extra=require(_0xcf67('0xa'));var _=require('lodash');var squel=require(_0xcf67('0xb'));var crypto=require(_0xcf67('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcf67('0xd'));var toCsv=require(_0xcf67('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcf67('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcf67('0xf'));var hardwareService=require(_0xcf67('0x10'));var logger=require(_0xcf67('0x11'))('api');var utils=require(_0xcf67('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xcf67('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42a856,_0x1abc24){_0x1abc24=_0x1abc24||0xcc;return function(_0x551b86){if(_0x551b86){return _0x42a856['sendStatus'](_0x1abc24);}return _0x42a856['status'](_0x1abc24)[_0xcf67('0x14')]();};}function respondWithResult(_0x400571,_0x31ff77){_0x31ff77=_0x31ff77||0xc8;return function(_0x321062){if(_0x321062){return _0x400571[_0xcf67('0x15')](_0x31ff77)[_0xcf67('0x16')](_0x321062);}};}function respondWithFilteredResult(_0x211910,_0x12dcf0){return function(_0x511028){if(_0x511028){var _0x592644=typeof _0x12dcf0[_0xcf67('0x17')]===_0xcf67('0x18')&&typeof _0x12dcf0[_0xcf67('0x19')]==='undefined';var _0x4f2201=_0x511028[_0xcf67('0x1a')];var _0xe1b209=_0x592644?0x0:_0x12dcf0[_0xcf67('0x17')];var _0x43d167=_0x592644?_0x511028[_0xcf67('0x1a')]:_0x12dcf0[_0xcf67('0x17')]+_0x12dcf0[_0xcf67('0x19')];var _0x4f4fa5;if(_0x43d167>=_0x4f2201){_0x43d167=_0x4f2201;_0x4f4fa5=0xc8;}else{_0x4f4fa5=0xce;}_0x211910['status'](_0x4f4fa5);return _0x211910[_0xcf67('0x1b')](_0xcf67('0x1c'),_0xe1b209+'-'+_0x43d167+'/'+_0x4f2201)[_0xcf67('0x16')](_0x511028);}return null;};}function patchUpdates(_0x151e22){return function(_0x31d814){try{jsonpatch['apply'](_0x31d814,_0x151e22,!![]);}catch(_0x870bf7){return BPromise['reject'](_0x870bf7);}return _0x31d814[_0xcf67('0x1d')]();};}function saveUpdates(_0x5177d1,_0x24037a){return function(_0x370e3c){if(_0x370e3c){return _0x370e3c[_0xcf67('0x1e')](_0x5177d1)['then'](function(_0x256f0d){return _0x256f0d;});}return null;};}function removeEntity(_0x3a6827,_0x1d3906){return function(_0x19a4cb){if(_0x19a4cb){return _0x19a4cb['destroy']()[_0xcf67('0x1f')](function(){_0x3a6827[_0xcf67('0x15')](0xcc)[_0xcf67('0x14')]();});}};}function handleEntityNotFound(_0x587e9c,_0x278b5a){return function(_0x431657){if(!_0x431657){_0x587e9c['sendStatus'](0x194);}return _0x431657;};}function handleError(_0x178777,_0x23b017){_0x23b017=_0x23b017||0x1f4;return function(_0xa05163){logger[_0xcf67('0x20')](_0xa05163['stack']);if(_0xa05163[_0xcf67('0x21')]){delete _0xa05163[_0xcf67('0x21')];}_0x178777[_0xcf67('0x15')](_0x23b017)[_0xcf67('0x22')](_0xa05163);};}exports[_0xcf67('0x23')]=function(_0x16c931,_0x4d767e){var _0x41f04d={},_0x1df399={},_0x2bfcec={'count':0x0,'rows':[]};var _0xccbaab=_[_0xcf67('0x24')](db[_0xcf67('0x25')][_0xcf67('0x26')],function(_0xd86433){return{'name':_0xd86433[_0xcf67('0x27')],'type':_0xd86433[_0xcf67('0x28')][_0xcf67('0x29')]};});_0x1df399[_0xcf67('0x2a')]=_['map'](_0xccbaab,_0xcf67('0x21'));_0x1df399[_0xcf67('0x2b')]=_['keys'](_0x16c931[_0xcf67('0x2b')]);_0x1df399[_0xcf67('0x2c')]=_[_0xcf67('0x2d')](_0x1df399[_0xcf67('0x2a')],_0x1df399['query']);_0x41f04d[_0xcf67('0x2e')]=_['intersection'](_0x1df399[_0xcf67('0x2a')],qs[_0xcf67('0x2f')](_0x16c931[_0xcf67('0x2b')]['fields']));_0x41f04d['attributes']=_0x41f04d[_0xcf67('0x2e')][_0xcf67('0x30')]?_0x41f04d['attributes']:_0x1df399['model'];if(!_0x16c931['query'][_0xcf67('0x31')](_0xcf67('0x32'))){_0x41f04d[_0xcf67('0x19')]=qs[_0xcf67('0x19')](_0x16c931[_0xcf67('0x2b')]['limit']);_0x41f04d[_0xcf67('0x17')]=qs[_0xcf67('0x17')](_0x16c931[_0xcf67('0x2b')][_0xcf67('0x17')]);}_0x41f04d[_0xcf67('0x33')]=qs[_0xcf67('0x34')](_0x16c931[_0xcf67('0x2b')][_0xcf67('0x34')]);_0x41f04d[_0xcf67('0x35')]=qs[_0xcf67('0x2c')](_[_0xcf67('0x36')](_0x16c931[_0xcf67('0x2b')],_0x1df399[_0xcf67('0x2c')]),_0xccbaab);if(_0x16c931[_0xcf67('0x2b')][_0xcf67('0x37')]){_0x41f04d[_0xcf67('0x35')]=_[_0xcf67('0x38')](_0x41f04d[_0xcf67('0x35')],{'$or':_['map'](_0xccbaab,function(_0x36c530){if(_0x36c530[_0xcf67('0x28')]!=='VIRTUAL'){var _0x47a094={};_0x47a094[_0x36c530[_0xcf67('0x21')]]={'$like':'%'+_0x16c931[_0xcf67('0x2b')][_0xcf67('0x37')]+'%'};return _0x47a094;}})});}_0x41f04d=_[_0xcf67('0x38')]({},_0x41f04d,_0x16c931['options']);var _0x34448e={'where':_0x41f04d[_0xcf67('0x35')]};return db[_0xcf67('0x25')]['count'](_0x34448e)[_0xcf67('0x1f')](function(_0x43fbfd){_0x2bfcec[_0xcf67('0x1a')]=_0x43fbfd;if(_0x16c931[_0xcf67('0x2b')][_0xcf67('0x39')]){_0x41f04d[_0xcf67('0x3a')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xcf67('0x3b')](_0x41f04d);})[_0xcf67('0x1f')](function(_0x229ce8){_0x2bfcec[_0xcf67('0x3c')]=_0x229ce8;return _0x2bfcec;})[_0xcf67('0x1f')](respondWithFilteredResult(_0x4d767e,_0x41f04d))[_0xcf67('0x3d')](handleError(_0x4d767e,null));};exports['show']=function(_0xbe4a4,_0x117c62){var _0x7ead0b={'raw':![],'where':{'id':_0xbe4a4['params']['id']}},_0x40499e={};_0x40499e[_0xcf67('0x2a')]=_[_0xcf67('0x3e')](db[_0xcf67('0x25')][_0xcf67('0x26')]);_0x40499e[_0xcf67('0x2b')]=_[_0xcf67('0x3e')](_0xbe4a4['query']);_0x40499e['filters']=_[_0xcf67('0x2d')](_0x40499e[_0xcf67('0x2a')],_0x40499e[_0xcf67('0x2b')]);_0x7ead0b['attributes']=_[_0xcf67('0x2d')](_0x40499e['model'],qs[_0xcf67('0x2f')](_0xbe4a4['query']['fields']));_0x7ead0b[_0xcf67('0x2e')]=_0x7ead0b[_0xcf67('0x2e')][_0xcf67('0x30')]?_0x7ead0b['attributes']:_0x40499e['model'];if(_0xbe4a4[_0xcf67('0x2b')][_0xcf67('0x39')]){_0x7ead0b[_0xcf67('0x3a')]=[{'all':!![]}];}_0x7ead0b=_[_0xcf67('0x38')]({},_0x7ead0b,_0xbe4a4[_0xcf67('0x3f')]);return db[_0xcf67('0x25')][_0xcf67('0x40')](_0x7ead0b)['then'](handleEntityNotFound(_0x117c62,null))[_0xcf67('0x1f')](respondWithResult(_0x117c62,null))[_0xcf67('0x3d')](handleError(_0x117c62,null));};exports[_0xcf67('0x41')]=function(_0x1cfd77,_0x4c6a59){return db[_0xcf67('0x25')][_0xcf67('0x41')](_0x1cfd77[_0xcf67('0x42')],{})[_0xcf67('0x1f')](respondWithResult(_0x4c6a59,0xc9))[_0xcf67('0x3d')](handleError(_0x4c6a59,null));};exports[_0xcf67('0x1e')]=function(_0x1c7ecf,_0x368826){if(_0x1c7ecf[_0xcf67('0x42')]['id']){delete _0x1c7ecf[_0xcf67('0x42')]['id'];}return db[_0xcf67('0x25')][_0xcf67('0x40')]({'where':{'id':_0x1c7ecf[_0xcf67('0x43')]['id']}})[_0xcf67('0x1f')](handleEntityNotFound(_0x368826,null))['then'](saveUpdates(_0x1c7ecf[_0xcf67('0x42')],null))[_0xcf67('0x1f')](respondWithResult(_0x368826,null))[_0xcf67('0x3d')](handleError(_0x368826,null));};exports[_0xcf67('0x44')]=function(_0x41d281,_0x7277fa){return db[_0xcf67('0x25')][_0xcf67('0x40')]({'where':{'id':_0x41d281[_0xcf67('0x43')]['id']}})[_0xcf67('0x1f')](handleEntityNotFound(_0x7277fa,null))['then'](removeEntity(_0x7277fa,null))[_0xcf67('0x3d')](handleError(_0x7277fa,null));};exports[_0xcf67('0x45')]=function(_0x7a06c4,_0x215c26,_0x9cab94){var _0x5dae8f={};var _0x4028b8={};var _0x373379;var _0x5a4045;return db[_0xcf67('0x25')][_0xcf67('0x46')]({'where':{'id':_0x7a06c4['params']['id']}})['then'](handleEntityNotFound(_0x215c26,null))[_0xcf67('0x1f')](function(_0xb37fdb){if(_0xb37fdb){_0x373379=_0xb37fdb;_0x4028b8[_0xcf67('0x2a')]=_[_0xcf67('0x3e')](db[_0xcf67('0x47')][_0xcf67('0x26')]);_0x4028b8['query']=_['keys'](_0x7a06c4['query']);_0x4028b8['filters']=_[_0xcf67('0x2d')](_0x4028b8[_0xcf67('0x2a')],_0x4028b8[_0xcf67('0x2b')]);_0x5dae8f[_0xcf67('0x2e')]=_[_0xcf67('0x2d')](_0x4028b8[_0xcf67('0x2a')],qs['fields'](_0x7a06c4['query'][_0xcf67('0x2f')]));_0x5dae8f['attributes']=_0x5dae8f['attributes'][_0xcf67('0x30')]?_0x5dae8f[_0xcf67('0x2e')]:_0x4028b8[_0xcf67('0x2a')];_0x5dae8f[_0xcf67('0x33')]=qs[_0xcf67('0x34')](_0x7a06c4['query'][_0xcf67('0x34')]);_0x5dae8f[_0xcf67('0x35')]=qs[_0xcf67('0x2c')](_['pick'](_0x7a06c4[_0xcf67('0x2b')],_0x4028b8['filters']));if(_0x7a06c4[_0xcf67('0x2b')][_0xcf67('0x37')]){_0x5dae8f['where']=_[_0xcf67('0x38')](_0x5dae8f[_0xcf67('0x35')],{'$or':_['map'](_0x5dae8f[_0xcf67('0x2e')],function(_0x3974c9){var _0x1ca0ef={};_0x1ca0ef[_0x3974c9]={'$like':'%'+_0x7a06c4['query'][_0xcf67('0x37')]+'%'};return _0x1ca0ef;})});}_0x5dae8f=_[_0xcf67('0x38')]({},_0x5dae8f,_0x7a06c4[_0xcf67('0x3f')]);return _0x373379['getFields'](_0x5dae8f);}})[_0xcf67('0x1f')](function(_0x399eb8){if(_0x399eb8){_0x5a4045=_0x399eb8['length'];if(!_0x7a06c4['query']['hasOwnProperty'](_0xcf67('0x32'))){_0x5dae8f[_0xcf67('0x19')]=qs[_0xcf67('0x19')](_0x7a06c4[_0xcf67('0x2b')][_0xcf67('0x19')]);_0x5dae8f[_0xcf67('0x17')]=qs[_0xcf67('0x17')](_0x7a06c4[_0xcf67('0x2b')][_0xcf67('0x17')]);}return _0x373379['getFields'](_0x5dae8f);}})[_0xcf67('0x1f')](function(_0x56c629){if(_0x56c629){return _0x56c629?{'count':_0x5a4045,'rows':_0x56c629}:null;}})[_0xcf67('0x1f')](respondWithResult(_0x215c26,null))[_0xcf67('0x3d')](handleError(_0x215c26,null));};exports[_0xcf67('0x48')]=function(_0x1c7979,_0x5de8c0,_0x59cd8e){var _0xcb80a5={};var _0x57bf8c={};var _0x235535;var _0x10cc4b;return db[_0xcf67('0x25')][_0xcf67('0x46')]({'where':{'id':_0x1c7979[_0xcf67('0x43')]['id']}})[_0xcf67('0x1f')](handleEntityNotFound(_0x5de8c0,null))[_0xcf67('0x1f')](function(_0x95bb03){if(_0x95bb03){_0x235535=_0x95bb03;_0x57bf8c[_0xcf67('0x2a')]=_[_0xcf67('0x3e')](db['SugarcrmField'][_0xcf67('0x26')]);_0x57bf8c[_0xcf67('0x2b')]=_[_0xcf67('0x3e')](_0x1c7979['query']);_0x57bf8c['filters']=_[_0xcf67('0x2d')](_0x57bf8c[_0xcf67('0x2a')],_0x57bf8c[_0xcf67('0x2b')]);_0xcb80a5[_0xcf67('0x2e')]=_[_0xcf67('0x2d')](_0x57bf8c[_0xcf67('0x2a')],qs[_0xcf67('0x2f')](_0x1c7979['query']['fields']));_0xcb80a5[_0xcf67('0x2e')]=_0xcb80a5[_0xcf67('0x2e')][_0xcf67('0x30')]?_0xcb80a5[_0xcf67('0x2e')]:_0x57bf8c[_0xcf67('0x2a')];_0xcb80a5[_0xcf67('0x33')]=qs[_0xcf67('0x34')](_0x1c7979['query'][_0xcf67('0x34')]);_0xcb80a5[_0xcf67('0x35')]=qs[_0xcf67('0x2c')](_[_0xcf67('0x36')](_0x1c7979['query'],_0x57bf8c[_0xcf67('0x2c')]));if(_0x1c7979['query']['filter']){_0xcb80a5['where']=_['merge'](_0xcb80a5[_0xcf67('0x35')],{'$or':_[_0xcf67('0x24')](_0xcb80a5[_0xcf67('0x2e')],function(_0x18a92b){var _0x19d91a={};_0x19d91a[_0x18a92b]={'$like':'%'+_0x1c7979[_0xcf67('0x2b')][_0xcf67('0x37')]+'%'};return _0x19d91a;})});}_0xcb80a5=_[_0xcf67('0x38')]({},_0xcb80a5,_0x1c7979[_0xcf67('0x3f')]);return _0x235535[_0xcf67('0x48')](_0xcb80a5);}})[_0xcf67('0x1f')](function(_0x6c1d2c){if(_0x6c1d2c){_0x10cc4b=_0x6c1d2c['length'];if(!_0x1c7979[_0xcf67('0x2b')][_0xcf67('0x31')]('nolimit')){_0xcb80a5[_0xcf67('0x19')]=qs[_0xcf67('0x19')](_0x1c7979[_0xcf67('0x2b')][_0xcf67('0x19')]);_0xcb80a5[_0xcf67('0x17')]=qs['offset'](_0x1c7979[_0xcf67('0x2b')]['offset']);}return _0x235535['getSubjects'](_0xcb80a5);}})[_0xcf67('0x1f')](function(_0xa8cb1a){if(_0xa8cb1a){return _0xa8cb1a?{'count':_0x10cc4b,'rows':_0xa8cb1a}:null;}})['then'](respondWithResult(_0x5de8c0,null))[_0xcf67('0x3d')](handleError(_0x5de8c0,null));};exports[_0xcf67('0x49')]=function(_0x51413e,_0xc52b13,_0x2fec38){var _0x4fff3b={};var _0x4aba31={};var _0x1fa30e;var _0x49b215;return db[_0xcf67('0x25')][_0xcf67('0x46')]({'where':{'id':_0x51413e[_0xcf67('0x43')]['id']}})[_0xcf67('0x1f')](handleEntityNotFound(_0xc52b13,null))[_0xcf67('0x1f')](function(_0x86a19a){if(_0x86a19a){_0x1fa30e=_0x86a19a;_0x4aba31['model']=_[_0xcf67('0x3e')](db[_0xcf67('0x47')][_0xcf67('0x26')]);_0x4aba31[_0xcf67('0x2b')]=_['keys'](_0x51413e[_0xcf67('0x2b')]);_0x4aba31['filters']=_[_0xcf67('0x2d')](_0x4aba31['model'],_0x4aba31[_0xcf67('0x2b')]);_0x4fff3b[_0xcf67('0x2e')]=_[_0xcf67('0x2d')](_0x4aba31[_0xcf67('0x2a')],qs['fields'](_0x51413e['query'][_0xcf67('0x2f')]));_0x4fff3b['attributes']=_0x4fff3b[_0xcf67('0x2e')]['length']?_0x4fff3b['attributes']:_0x4aba31[_0xcf67('0x2a')];_0x4fff3b[_0xcf67('0x33')]=qs[_0xcf67('0x34')](_0x51413e[_0xcf67('0x2b')][_0xcf67('0x34')]);_0x4fff3b[_0xcf67('0x35')]=qs[_0xcf67('0x2c')](_[_0xcf67('0x36')](_0x51413e[_0xcf67('0x2b')],_0x4aba31[_0xcf67('0x2c')]));if(_0x51413e[_0xcf67('0x2b')][_0xcf67('0x37')]){_0x4fff3b[_0xcf67('0x35')]=_[_0xcf67('0x38')](_0x4fff3b[_0xcf67('0x35')],{'$or':_[_0xcf67('0x24')](_0x4fff3b[_0xcf67('0x2e')],function(_0x1d42eb){var _0x2ba8f1={};_0x2ba8f1[_0x1d42eb]={'$like':'%'+_0x51413e[_0xcf67('0x2b')][_0xcf67('0x37')]+'%'};return _0x2ba8f1;})});}_0x4fff3b=_['merge']({},_0x4fff3b,_0x51413e[_0xcf67('0x3f')]);return _0x1fa30e[_0xcf67('0x49')](_0x4fff3b);}})['then'](function(_0x1bbc26){if(_0x1bbc26){_0x49b215=_0x1bbc26[_0xcf67('0x30')];if(!_0x51413e['query'][_0xcf67('0x31')](_0xcf67('0x32'))){_0x4fff3b[_0xcf67('0x19')]=qs[_0xcf67('0x19')](_0x51413e[_0xcf67('0x2b')]['limit']);_0x4fff3b['offset']=qs[_0xcf67('0x17')](_0x51413e[_0xcf67('0x2b')]['offset']);}return _0x1fa30e[_0xcf67('0x49')](_0x4fff3b);}})['then'](function(_0x18e96e){if(_0x18e96e){return _0x18e96e?{'count':_0x49b215,'rows':_0x18e96e}:null;}})[_0xcf67('0x1f')](respondWithResult(_0xc52b13,null))[_0xcf67('0x3d')](handleError(_0xc52b13,null));}; \ No newline at end of file +var _0xe3a5=['fast-json-patch','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','destroy','then','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','rows','show','params','keys','merge','catch','create','body','update','find','findOne','SugarcrmField','getFields','getSubjects','nolimit','getDescriptions','rimraf'];(function(_0x532972,_0x23f2da){var _0x308435=function(_0x4d0ebc){while(--_0x4d0ebc){_0x532972['push'](_0x532972['shift']());}};_0x308435(++_0x23f2da);}(_0xe3a5,0xe6));var _0x5e3a=function(_0x1737a2,_0x5a6464){_0x1737a2=_0x1737a2-0x0;var _0x11c2a0=_0xe3a5[_0x1737a2];return _0x11c2a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e3a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e3a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5e3a('0x2'));var Mustache=require(_0x5e3a('0x3'));var util=require('util');var path=require(_0x5e3a('0x4'));var sox=require(_0x5e3a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e3a('0x6'));var _=require(_0x5e3a('0x7'));var squel=require(_0x5e3a('0x8'));var crypto=require(_0x5e3a('0x9'));var jsforce=require(_0x5e3a('0xa'));var deskjs=require(_0x5e3a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5e3a('0xc'));var Papa=require('papaparse');var Redis=require(_0x5e3a('0xd'));var authService=require(_0x5e3a('0xe'));var qs=require(_0x5e3a('0xf'));var as=require(_0x5e3a('0x10'));var hardwareService=require(_0x5e3a('0x11'));var logger=require(_0x5e3a('0x12'))(_0x5e3a('0x13'));var utils=require(_0x5e3a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5e3a('0x15'));var db=require(_0x5e3a('0x16'))['db'];function respondWithStatusCode(_0x4a1581,_0x510327){_0x510327=_0x510327||0xcc;return function(_0x506042){if(_0x506042){return _0x4a1581[_0x5e3a('0x17')](_0x510327);}return _0x4a1581[_0x5e3a('0x18')](_0x510327)['end']();};}function respondWithResult(_0x37d14a,_0x3ea4ae){_0x3ea4ae=_0x3ea4ae||0xc8;return function(_0x2235f3){if(_0x2235f3){return _0x37d14a[_0x5e3a('0x18')](_0x3ea4ae)['json'](_0x2235f3);}};}function respondWithFilteredResult(_0x2451c6,_0x56d8ed){return function(_0x2d8d30){if(_0x2d8d30){var _0x6fc10b=typeof _0x56d8ed[_0x5e3a('0x19')]===_0x5e3a('0x1a')&&typeof _0x56d8ed[_0x5e3a('0x1b')]===_0x5e3a('0x1a');var _0x20379c=_0x2d8d30[_0x5e3a('0x1c')];var _0x187056=_0x6fc10b?0x0:_0x56d8ed[_0x5e3a('0x19')];var _0x253a85=_0x6fc10b?_0x2d8d30[_0x5e3a('0x1c')]:_0x56d8ed[_0x5e3a('0x19')]+_0x56d8ed[_0x5e3a('0x1b')];var _0x1c9996;if(_0x253a85>=_0x20379c){_0x253a85=_0x20379c;_0x1c9996=0xc8;}else{_0x1c9996=0xce;}_0x2451c6[_0x5e3a('0x18')](_0x1c9996);return _0x2451c6[_0x5e3a('0x1d')]('Content-Range',_0x187056+'-'+_0x253a85+'/'+_0x20379c)[_0x5e3a('0x1e')](_0x2d8d30);}return null;};}function patchUpdates(_0x266505){return function(_0x37ef83){try{jsonpatch[_0x5e3a('0x1f')](_0x37ef83,_0x266505,!![]);}catch(_0x18de61){return BPromise[_0x5e3a('0x20')](_0x18de61);}return _0x37ef83[_0x5e3a('0x21')]();};}function saveUpdates(_0x172a37,_0x102e43){return function(_0x55a44b){if(_0x55a44b){return _0x55a44b['update'](_0x172a37)['then'](function(_0x52b13b){return _0x52b13b;});}return null;};}function removeEntity(_0x1af322,_0x4bc891){return function(_0x237d04){if(_0x237d04){return _0x237d04[_0x5e3a('0x22')]()[_0x5e3a('0x23')](function(){_0x1af322[_0x5e3a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3984c4,_0x68f983){return function(_0x43c588){if(!_0x43c588){_0x3984c4['sendStatus'](0x194);}return _0x43c588;};}function handleError(_0x858ae4,_0x5906a8){_0x5906a8=_0x5906a8||0x1f4;return function(_0x2484c9){logger['error'](_0x2484c9['stack']);if(_0x2484c9[_0x5e3a('0x24')]){delete _0x2484c9[_0x5e3a('0x24')];}_0x858ae4[_0x5e3a('0x18')](_0x5906a8)[_0x5e3a('0x25')](_0x2484c9);};}exports[_0x5e3a('0x26')]=function(_0x4fc02,_0x52bc0e){var _0x25e94d={},_0x276a7d={},_0x46dd94={'count':0x0,'rows':[]};var _0x12ef12=_[_0x5e3a('0x27')](db[_0x5e3a('0x28')][_0x5e3a('0x29')],function(_0x296b9f){return{'name':_0x296b9f[_0x5e3a('0x2a')],'type':_0x296b9f[_0x5e3a('0x2b')]['key']};});_0x276a7d[_0x5e3a('0x2c')]=_['map'](_0x12ef12,_0x5e3a('0x24'));_0x276a7d[_0x5e3a('0x2d')]=_['keys'](_0x4fc02[_0x5e3a('0x2d')]);_0x276a7d['filters']=_[_0x5e3a('0x2e')](_0x276a7d[_0x5e3a('0x2c')],_0x276a7d[_0x5e3a('0x2d')]);_0x25e94d[_0x5e3a('0x2f')]=_[_0x5e3a('0x2e')](_0x276a7d[_0x5e3a('0x2c')],qs[_0x5e3a('0x30')](_0x4fc02['query'][_0x5e3a('0x30')]));_0x25e94d[_0x5e3a('0x2f')]=_0x25e94d[_0x5e3a('0x2f')][_0x5e3a('0x31')]?_0x25e94d[_0x5e3a('0x2f')]:_0x276a7d[_0x5e3a('0x2c')];if(!_0x4fc02['query'][_0x5e3a('0x32')]('nolimit')){_0x25e94d[_0x5e3a('0x1b')]=qs[_0x5e3a('0x1b')](_0x4fc02[_0x5e3a('0x2d')][_0x5e3a('0x1b')]);_0x25e94d[_0x5e3a('0x19')]=qs[_0x5e3a('0x19')](_0x4fc02[_0x5e3a('0x2d')]['offset']);}_0x25e94d[_0x5e3a('0x33')]=qs[_0x5e3a('0x34')](_0x4fc02[_0x5e3a('0x2d')][_0x5e3a('0x34')]);_0x25e94d['where']=qs[_0x5e3a('0x35')](_[_0x5e3a('0x36')](_0x4fc02[_0x5e3a('0x2d')],_0x276a7d[_0x5e3a('0x35')]),_0x12ef12);if(_0x4fc02['query'][_0x5e3a('0x37')]){_0x25e94d[_0x5e3a('0x38')]=_['merge'](_0x25e94d[_0x5e3a('0x38')],{'$or':_[_0x5e3a('0x27')](_0x12ef12,function(_0x13f24d){if(_0x13f24d[_0x5e3a('0x2b')]!==_0x5e3a('0x39')){var _0x5ce107={};_0x5ce107[_0x13f24d[_0x5e3a('0x24')]]={'$like':'%'+_0x4fc02['query']['filter']+'%'};return _0x5ce107;}})});}_0x25e94d=_['merge']({},_0x25e94d,_0x4fc02[_0x5e3a('0x3a')]);var _0x5b8e3d={'where':_0x25e94d[_0x5e3a('0x38')]};return db['SugarcrmConfiguration'][_0x5e3a('0x1c')](_0x5b8e3d)[_0x5e3a('0x23')](function(_0x35fc87){_0x46dd94[_0x5e3a('0x1c')]=_0x35fc87;if(_0x4fc02[_0x5e3a('0x2d')][_0x5e3a('0x3b')]){_0x25e94d[_0x5e3a('0x3c')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x25e94d);})[_0x5e3a('0x23')](function(_0x4f4401){_0x46dd94[_0x5e3a('0x3d')]=_0x4f4401;return _0x46dd94;})[_0x5e3a('0x23')](respondWithFilteredResult(_0x52bc0e,_0x25e94d))['catch'](handleError(_0x52bc0e,null));};exports[_0x5e3a('0x3e')]=function(_0x5d582c,_0x49b662){var _0x373152={'raw':![],'where':{'id':_0x5d582c[_0x5e3a('0x3f')]['id']}},_0x1f5a91={};_0x1f5a91[_0x5e3a('0x2c')]=_[_0x5e3a('0x40')](db['SugarcrmConfiguration'][_0x5e3a('0x29')]);_0x1f5a91[_0x5e3a('0x2d')]=_['keys'](_0x5d582c[_0x5e3a('0x2d')]);_0x1f5a91[_0x5e3a('0x35')]=_[_0x5e3a('0x2e')](_0x1f5a91[_0x5e3a('0x2c')],_0x1f5a91[_0x5e3a('0x2d')]);_0x373152[_0x5e3a('0x2f')]=_[_0x5e3a('0x2e')](_0x1f5a91[_0x5e3a('0x2c')],qs['fields'](_0x5d582c['query'][_0x5e3a('0x30')]));_0x373152[_0x5e3a('0x2f')]=_0x373152[_0x5e3a('0x2f')][_0x5e3a('0x31')]?_0x373152['attributes']:_0x1f5a91[_0x5e3a('0x2c')];if(_0x5d582c['query']['includeAll']){_0x373152[_0x5e3a('0x3c')]=[{'all':!![]}];}_0x373152=_[_0x5e3a('0x41')]({},_0x373152,_0x5d582c[_0x5e3a('0x3a')]);return db[_0x5e3a('0x28')]['find'](_0x373152)[_0x5e3a('0x23')](handleEntityNotFound(_0x49b662,null))[_0x5e3a('0x23')](respondWithResult(_0x49b662,null))[_0x5e3a('0x42')](handleError(_0x49b662,null));};exports[_0x5e3a('0x43')]=function(_0x3494a2,_0x4893c2){return db[_0x5e3a('0x28')][_0x5e3a('0x43')](_0x3494a2[_0x5e3a('0x44')],{})['then'](respondWithResult(_0x4893c2,0xc9))[_0x5e3a('0x42')](handleError(_0x4893c2,null));};exports[_0x5e3a('0x45')]=function(_0x59abbe,_0x4f9a26){if(_0x59abbe[_0x5e3a('0x44')]['id']){delete _0x59abbe[_0x5e3a('0x44')]['id'];}return db[_0x5e3a('0x28')]['find']({'where':{'id':_0x59abbe['params']['id']}})[_0x5e3a('0x23')](handleEntityNotFound(_0x4f9a26,null))[_0x5e3a('0x23')](saveUpdates(_0x59abbe[_0x5e3a('0x44')],null))[_0x5e3a('0x23')](respondWithResult(_0x4f9a26,null))[_0x5e3a('0x42')](handleError(_0x4f9a26,null));};exports[_0x5e3a('0x22')]=function(_0x13b704,_0x19d285){return db['SugarcrmConfiguration'][_0x5e3a('0x46')]({'where':{'id':_0x13b704[_0x5e3a('0x3f')]['id']}})[_0x5e3a('0x23')](handleEntityNotFound(_0x19d285,null))[_0x5e3a('0x23')](removeEntity(_0x19d285,null))[_0x5e3a('0x42')](handleError(_0x19d285,null));};exports['getFields']=function(_0x2172ef,_0x587ebf,_0x189d31){var _0x4f811e={};var _0x530eb0={};var _0x373462;var _0x5d9337;return db['SugarcrmConfiguration'][_0x5e3a('0x47')]({'where':{'id':_0x2172ef[_0x5e3a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x587ebf,null))[_0x5e3a('0x23')](function(_0x3f3c95){if(_0x3f3c95){_0x373462=_0x3f3c95;_0x530eb0[_0x5e3a('0x2c')]=_[_0x5e3a('0x40')](db[_0x5e3a('0x48')][_0x5e3a('0x29')]);_0x530eb0[_0x5e3a('0x2d')]=_['keys'](_0x2172ef['query']);_0x530eb0[_0x5e3a('0x35')]=_[_0x5e3a('0x2e')](_0x530eb0[_0x5e3a('0x2c')],_0x530eb0[_0x5e3a('0x2d')]);_0x4f811e['attributes']=_[_0x5e3a('0x2e')](_0x530eb0[_0x5e3a('0x2c')],qs[_0x5e3a('0x30')](_0x2172ef[_0x5e3a('0x2d')][_0x5e3a('0x30')]));_0x4f811e[_0x5e3a('0x2f')]=_0x4f811e[_0x5e3a('0x2f')]['length']?_0x4f811e[_0x5e3a('0x2f')]:_0x530eb0['model'];_0x4f811e[_0x5e3a('0x33')]=qs['sort'](_0x2172ef[_0x5e3a('0x2d')][_0x5e3a('0x34')]);_0x4f811e['where']=qs[_0x5e3a('0x35')](_['pick'](_0x2172ef[_0x5e3a('0x2d')],_0x530eb0[_0x5e3a('0x35')]));if(_0x2172ef[_0x5e3a('0x2d')]['filter']){_0x4f811e[_0x5e3a('0x38')]=_[_0x5e3a('0x41')](_0x4f811e[_0x5e3a('0x38')],{'$or':_[_0x5e3a('0x27')](_0x4f811e[_0x5e3a('0x2f')],function(_0x56582e){var _0x1e43e7={};_0x1e43e7[_0x56582e]={'$like':'%'+_0x2172ef['query']['filter']+'%'};return _0x1e43e7;})});}_0x4f811e=_[_0x5e3a('0x41')]({},_0x4f811e,_0x2172ef[_0x5e3a('0x3a')]);return _0x373462[_0x5e3a('0x49')](_0x4f811e);}})['then'](function(_0x103876){if(_0x103876){_0x5d9337=_0x103876[_0x5e3a('0x31')];if(!_0x2172ef[_0x5e3a('0x2d')][_0x5e3a('0x32')]('nolimit')){_0x4f811e[_0x5e3a('0x1b')]=qs[_0x5e3a('0x1b')](_0x2172ef['query'][_0x5e3a('0x1b')]);_0x4f811e[_0x5e3a('0x19')]=qs[_0x5e3a('0x19')](_0x2172ef['query'][_0x5e3a('0x19')]);}return _0x373462[_0x5e3a('0x49')](_0x4f811e);}})[_0x5e3a('0x23')](function(_0x2f1514){if(_0x2f1514){return _0x2f1514?{'count':_0x5d9337,'rows':_0x2f1514}:null;}})[_0x5e3a('0x23')](respondWithResult(_0x587ebf,null))['catch'](handleError(_0x587ebf,null));};exports[_0x5e3a('0x4a')]=function(_0x175ed9,_0x4ba66c,_0x1e0197){var _0x2a0a61={};var _0x4837e2={};var _0x19669e;var _0xf5e989;return db['SugarcrmConfiguration'][_0x5e3a('0x47')]({'where':{'id':_0x175ed9[_0x5e3a('0x3f')]['id']}})[_0x5e3a('0x23')](handleEntityNotFound(_0x4ba66c,null))[_0x5e3a('0x23')](function(_0x3eaeb2){if(_0x3eaeb2){_0x19669e=_0x3eaeb2;_0x4837e2['model']=_['keys'](db[_0x5e3a('0x48')][_0x5e3a('0x29')]);_0x4837e2[_0x5e3a('0x2d')]=_[_0x5e3a('0x40')](_0x175ed9[_0x5e3a('0x2d')]);_0x4837e2['filters']=_['intersection'](_0x4837e2[_0x5e3a('0x2c')],_0x4837e2[_0x5e3a('0x2d')]);_0x2a0a61[_0x5e3a('0x2f')]=_['intersection'](_0x4837e2[_0x5e3a('0x2c')],qs[_0x5e3a('0x30')](_0x175ed9[_0x5e3a('0x2d')][_0x5e3a('0x30')]));_0x2a0a61[_0x5e3a('0x2f')]=_0x2a0a61[_0x5e3a('0x2f')][_0x5e3a('0x31')]?_0x2a0a61[_0x5e3a('0x2f')]:_0x4837e2[_0x5e3a('0x2c')];_0x2a0a61[_0x5e3a('0x33')]=qs['sort'](_0x175ed9[_0x5e3a('0x2d')][_0x5e3a('0x34')]);_0x2a0a61[_0x5e3a('0x38')]=qs['filters'](_[_0x5e3a('0x36')](_0x175ed9[_0x5e3a('0x2d')],_0x4837e2[_0x5e3a('0x35')]));if(_0x175ed9[_0x5e3a('0x2d')][_0x5e3a('0x37')]){_0x2a0a61[_0x5e3a('0x38')]=_[_0x5e3a('0x41')](_0x2a0a61['where'],{'$or':_[_0x5e3a('0x27')](_0x2a0a61[_0x5e3a('0x2f')],function(_0x2659ff){var _0xbeb390={};_0xbeb390[_0x2659ff]={'$like':'%'+_0x175ed9[_0x5e3a('0x2d')][_0x5e3a('0x37')]+'%'};return _0xbeb390;})});}_0x2a0a61=_['merge']({},_0x2a0a61,_0x175ed9['options']);return _0x19669e[_0x5e3a('0x4a')](_0x2a0a61);}})[_0x5e3a('0x23')](function(_0x5f3c98){if(_0x5f3c98){_0xf5e989=_0x5f3c98[_0x5e3a('0x31')];if(!_0x175ed9[_0x5e3a('0x2d')][_0x5e3a('0x32')](_0x5e3a('0x4b'))){_0x2a0a61[_0x5e3a('0x1b')]=qs[_0x5e3a('0x1b')](_0x175ed9[_0x5e3a('0x2d')][_0x5e3a('0x1b')]);_0x2a0a61[_0x5e3a('0x19')]=qs['offset'](_0x175ed9[_0x5e3a('0x2d')]['offset']);}return _0x19669e[_0x5e3a('0x4a')](_0x2a0a61);}})[_0x5e3a('0x23')](function(_0x5b0875){if(_0x5b0875){return _0x5b0875?{'count':_0xf5e989,'rows':_0x5b0875}:null;}})[_0x5e3a('0x23')](respondWithResult(_0x4ba66c,null))[_0x5e3a('0x42')](handleError(_0x4ba66c,null));};exports[_0x5e3a('0x4c')]=function(_0x38b749,_0x266769,_0x1e25d2){var _0x138a97={};var _0x6644a={};var _0x4c0c97;var _0x533beb;return db[_0x5e3a('0x28')]['findOne']({'where':{'id':_0x38b749[_0x5e3a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x266769,null))[_0x5e3a('0x23')](function(_0x4bbe53){if(_0x4bbe53){_0x4c0c97=_0x4bbe53;_0x6644a[_0x5e3a('0x2c')]=_[_0x5e3a('0x40')](db['SugarcrmField'][_0x5e3a('0x29')]);_0x6644a[_0x5e3a('0x2d')]=_[_0x5e3a('0x40')](_0x38b749[_0x5e3a('0x2d')]);_0x6644a['filters']=_['intersection'](_0x6644a['model'],_0x6644a[_0x5e3a('0x2d')]);_0x138a97[_0x5e3a('0x2f')]=_['intersection'](_0x6644a[_0x5e3a('0x2c')],qs[_0x5e3a('0x30')](_0x38b749[_0x5e3a('0x2d')][_0x5e3a('0x30')]));_0x138a97[_0x5e3a('0x2f')]=_0x138a97[_0x5e3a('0x2f')][_0x5e3a('0x31')]?_0x138a97['attributes']:_0x6644a[_0x5e3a('0x2c')];_0x138a97['order']=qs['sort'](_0x38b749[_0x5e3a('0x2d')][_0x5e3a('0x34')]);_0x138a97[_0x5e3a('0x38')]=qs[_0x5e3a('0x35')](_['pick'](_0x38b749[_0x5e3a('0x2d')],_0x6644a[_0x5e3a('0x35')]));if(_0x38b749[_0x5e3a('0x2d')][_0x5e3a('0x37')]){_0x138a97[_0x5e3a('0x38')]=_[_0x5e3a('0x41')](_0x138a97['where'],{'$or':_['map'](_0x138a97[_0x5e3a('0x2f')],function(_0xc8f409){var _0x1ff8bb={};_0x1ff8bb[_0xc8f409]={'$like':'%'+_0x38b749['query'][_0x5e3a('0x37')]+'%'};return _0x1ff8bb;})});}_0x138a97=_[_0x5e3a('0x41')]({},_0x138a97,_0x38b749[_0x5e3a('0x3a')]);return _0x4c0c97[_0x5e3a('0x4c')](_0x138a97);}})[_0x5e3a('0x23')](function(_0x818a3){if(_0x818a3){_0x533beb=_0x818a3[_0x5e3a('0x31')];if(!_0x38b749[_0x5e3a('0x2d')]['hasOwnProperty'](_0x5e3a('0x4b'))){_0x138a97[_0x5e3a('0x1b')]=qs[_0x5e3a('0x1b')](_0x38b749[_0x5e3a('0x2d')][_0x5e3a('0x1b')]);_0x138a97[_0x5e3a('0x19')]=qs[_0x5e3a('0x19')](_0x38b749[_0x5e3a('0x2d')][_0x5e3a('0x19')]);}return _0x4c0c97[_0x5e3a('0x4c')](_0x138a97);}})['then'](function(_0x27d288){if(_0x27d288){return _0x27d288?{'count':_0x533beb,'rows':_0x27d288}:null;}})[_0x5e3a('0x23')](respondWithResult(_0x266769,null))[_0x5e3a('0x42')](handleError(_0x266769,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 87a0e44..0e75feb 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 _0xa05d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xa05d,0xdd));var _0xda05=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0xa05d[_0x46efd7];return _0x5637e4;};'use strict';var _=require('lodash');var util=require(_0xda05('0x0'));var logger=require(_0xda05('0x1'))(_0xda05('0x2'));var moment=require(_0xda05('0x3'));var BPromise=require(_0xda05('0x4'));var rp=require(_0xda05('0x5'));var fs=require('fs');var path=require(_0xda05('0x6'));var rimraf=require(_0xda05('0x7'));var config=require(_0xda05('0x8'));var attributes=require(_0xda05('0x9'));module[_0xda05('0xa')]=function(_0x5dd432,_0xdb8acc){return _0x5dd432[_0xda05('0xb')](_0xda05('0xc'),attributes,{'tableName':_0xda05('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49fb=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x49fb,0x9c));var _0xb49f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x49fb[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xb49f('0x0'));var util=require(_0xb49f('0x1'));var logger=require('../../config/logger')(_0xb49f('0x2'));var moment=require(_0xb49f('0x3'));var BPromise=require('bluebird');var rp=require(_0xb49f('0x4'));var fs=require('fs');var path=require(_0xb49f('0x5'));var rimraf=require(_0xb49f('0x6'));var config=require(_0xb49f('0x7'));var attributes=require(_0xb49f('0x8'));module[_0xb49f('0x9')]=function(_0x257764,_0x10f002){return _0x257764[_0xb49f('0xa')](_0xb49f('0xb'),attributes,{'tableName':_0xb49f('0xc'),'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 05a89f6..13a9d1f 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 _0x5f56=['client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5f56,0x1c2));var _0x65f5=function(_0x58418a,_0x3d9f06){_0x58418a=_0x58418a-0x0;var _0x2716bf=_0x5f56[_0x58418a];return _0x2716bf;};'use strict';var _=require('lodash');var util=require(_0x65f5('0x0'));var moment=require('moment');var BPromise=require(_0x65f5('0x1'));var rs=require(_0x65f5('0x2'));var fs=require('fs');var Redis=require(_0x65f5('0x3'));var db=require(_0x65f5('0x4'))['db'];var utils=require(_0x65f5('0x5'));var logger=require(_0x65f5('0x6'))(_0x65f5('0x7'));var config=require(_0x65f5('0x8'));var jayson=require(_0x65f5('0x9'));var client=jayson[_0x65f5('0xa')][_0x65f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x597951,_0x2900c4,_0x5e99a0){return new BPromise(function(_0x4f9512,_0x4fc5e7){return client[_0x65f5('0xc')](_0x597951,_0x5e99a0)['then'](function(_0xe75e08){logger[_0x65f5('0xd')](_0x65f5('0xe'),_0x2900c4,'request\x20sent');logger['debug'](_0x65f5('0xf'),_0x2900c4,_0x65f5('0x10'),JSON[_0x65f5('0x11')](_0xe75e08));if(_0xe75e08[_0x65f5('0x12')]){if(_0xe75e08['error'][_0x65f5('0x13')]===0x1f4){logger[_0x65f5('0x12')](_0x65f5('0xe'),_0x2900c4,_0xe75e08['error'][_0x65f5('0x14')]);return _0x4fc5e7(_0xe75e08[_0x65f5('0x12')]['message']);}logger[_0x65f5('0x12')](_0x65f5('0xe'),_0x2900c4,_0xe75e08[_0x65f5('0x12')][_0x65f5('0x14')]);return _0x4f9512(_0xe75e08[_0x65f5('0x12')][_0x65f5('0x14')]);}else{logger[_0x65f5('0xd')](_0x65f5('0xe'),_0x2900c4,'request\x20sent');_0x4f9512(_0xe75e08[_0x65f5('0x15')][_0x65f5('0x14')]);}})[_0x65f5('0x16')](function(_0x113ea1){logger[_0x65f5('0x12')](_0x65f5('0xe'),_0x2900c4,_0x113ea1);_0x4fc5e7(_0x113ea1);});});} \ No newline at end of file +var _0x08ca=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x254bb6,_0x28d0a8){var _0x32be0b=function(_0x1a2352){while(--_0x1a2352){_0x254bb6['push'](_0x254bb6['shift']());}};_0x32be0b(++_0x28d0a8);}(_0x08ca,0x6a));var _0xa08c=function(_0x4a44e4,_0x51bc71){_0x4a44e4=_0x4a44e4-0x0;var _0x3e0c33=_0x08ca[_0x4a44e4];return _0x3e0c33;};'use strict';var _=require(_0xa08c('0x0'));var util=require('util');var moment=require(_0xa08c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa08c('0x2'));var db=require(_0xa08c('0x3'))['db'];var utils=require(_0xa08c('0x4'));var logger=require(_0xa08c('0x5'))(_0xa08c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd1da,_0x225c33,_0x518b44){return new BPromise(function(_0x570eb1,_0x1f486d){return client[_0xa08c('0x7')](_0xd1da,_0x518b44)[_0xa08c('0x8')](function(_0x47e3da){logger[_0xa08c('0x9')](_0xa08c('0xa'),_0x225c33,_0xa08c('0xb'));logger['debug'](_0xa08c('0xc'),_0x225c33,_0xa08c('0xb'),JSON[_0xa08c('0xd')](_0x47e3da));if(_0x47e3da['error']){if(_0x47e3da[_0xa08c('0xe')]['code']===0x1f4){logger['error'](_0xa08c('0xa'),_0x225c33,_0x47e3da['error']['message']);return _0x1f486d(_0x47e3da[_0xa08c('0xe')][_0xa08c('0xf')]);}logger['error'](_0xa08c('0xa'),_0x225c33,_0x47e3da[_0xa08c('0xe')][_0xa08c('0xf')]);return _0x570eb1(_0x47e3da[_0xa08c('0xe')]['message']);}else{logger[_0xa08c('0x9')](_0xa08c('0xa'),_0x225c33,_0xa08c('0xb'));_0x570eb1(_0x47e3da[_0xa08c('0x10')][_0xa08c('0xf')]);}})[_0xa08c('0x11')](function(_0x63a31a){logger['error'](_0xa08c('0xa'),_0x225c33,_0x63a31a);_0x1f486d(_0x63a31a);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 960a1ea..c986243 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 _0x9a29=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4a81c3,_0x504a70){var _0x17a34f=function(_0x1e3218){while(--_0x1e3218){_0x4a81c3['push'](_0x4a81c3['shift']());}};_0x17a34f(++_0x504a70);}(_0x9a29,0x11a));var _0x99a2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9a29[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x99a2('0x0'));var util=require(_0x99a2('0x1'));var path=require(_0x99a2('0x2'));var timeout=require(_0x99a2('0x3'));var express=require(_0x99a2('0x4'));var router=express[_0x99a2('0x5')]();var fs_extra=require(_0x99a2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x99a2('0x7'));var config=require(_0x99a2('0x8'));var controller=require(_0x99a2('0x9'));router[_0x99a2('0xa')]('/',auth[_0x99a2('0xb')](),controller[_0x99a2('0xc')]);router[_0x99a2('0xa')](_0x99a2('0xd'),auth[_0x99a2('0xb')](),controller[_0x99a2('0xe')]);router[_0x99a2('0xf')]('/',auth[_0x99a2('0xb')](),controller[_0x99a2('0x10')]);router[_0x99a2('0x11')](_0x99a2('0xd'),auth[_0x99a2('0xb')](),controller[_0x99a2('0x12')]);router[_0x99a2('0x13')](_0x99a2('0xd'),auth['isAuthenticated'](),controller[_0x99a2('0x14')]);module[_0x99a2('0x15')]=router; \ No newline at end of file +var _0x041b=['./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x57abd0,_0x11171e){var _0x2dd0c3=function(_0x3df00e){while(--_0x3df00e){_0x57abd0['push'](_0x57abd0['shift']());}};_0x2dd0c3(++_0x11171e);}(_0x041b,0x13d));var _0xb041=function(_0x6f33f0,_0x39ae94){_0x6f33f0=_0x6f33f0-0x0;var _0x46b052=_0x041b[_0x6f33f0];return _0x46b052;};'use strict';var multer=require(_0xb041('0x0'));var util=require(_0xb041('0x1'));var path=require('path');var timeout=require(_0xb041('0x2'));var express=require('express');var router=express[_0xb041('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb041('0x4'));var config=require(_0xb041('0x5'));var controller=require(_0xb041('0x6'));router[_0xb041('0x7')]('/',auth[_0xb041('0x8')](),controller[_0xb041('0x9')]);router[_0xb041('0x7')](_0xb041('0xa'),auth['isAuthenticated'](),controller[_0xb041('0xb')]);router[_0xb041('0xc')]('/',auth[_0xb041('0x8')](),controller[_0xb041('0xd')]);router['put'](_0xb041('0xa'),auth[_0xb041('0x8')](),controller[_0xb041('0xe')]);router[_0xb041('0xf')](_0xb041('0xa'),auth[_0xb041('0x8')](),controller[_0xb041('0x10')]);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 8251694..bf2006b 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 _0x4f00=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x3bf0b2,_0x271310){var _0x63ad3d=function(_0x251e6f){while(--_0x251e6f){_0x3bf0b2['push'](_0x3bf0b2['shift']());}};_0x63ad3d(++_0x271310);}(_0x4f00,0xfb));var _0x04f0=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x4f00[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require(_0x04f0('0x0'));module[_0x04f0('0x1')]={'type':{'type':Sequelize[_0x04f0('0x2')]('string',_0x04f0('0x3'),_0x04f0('0x4'),'keyValue','picklist'),'defaultValue':_0x04f0('0x5')},'content':{'type':Sequelize[_0x04f0('0x6')]},'key':{'type':Sequelize[_0x04f0('0x6')]},'keyType':{'type':Sequelize[_0x04f0('0x2')](_0x04f0('0x5'),_0x04f0('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x04f0('0x6')]},'nameField':{'type':Sequelize[_0x04f0('0x6')]},'customField':{'type':Sequelize[_0x04f0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x04f0('0x6')]}}; \ No newline at end of file +var _0x30e0=['customVariable','keyValue','STRING','ENUM','BOOLEAN','exports','string','variable'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x30e0,0x12d));var _0x030e=function(_0x3a6d3e,_0x4f0ac5){_0x3a6d3e=_0x3a6d3e-0x0;var _0x735896=_0x30e0[_0x3a6d3e];return _0x735896;};'use strict';var Sequelize=require('sequelize');module[_0x030e('0x0')]={'type':{'type':Sequelize['ENUM'](_0x030e('0x1'),_0x030e('0x2'),_0x030e('0x3'),_0x030e('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x030e('0x5')]},'key':{'type':Sequelize[_0x030e('0x5')]},'keyType':{'type':Sequelize[_0x030e('0x6')](_0x030e('0x1'),_0x030e('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x030e('0x5')]},'idField':{'type':Sequelize[_0x030e('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x030e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index d0cfcd1..4ad7b1f 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 _0x1842=['find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','apply','reject','save','update','destroy','then','end','send','index','map','SugarcrmField','rawAttributes','key','model','name','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','show','params','include','merge'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0x1842,0x171));var _0x2184=function(_0x6181a4,_0x3df1e7){_0x6181a4=_0x6181a4-0x0;var _0x263199=_0x1842[_0x6181a4];return _0x263199;};'use strict';var emlformat=require(_0x2184('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2184('0x1'));var jsonpatch=require(_0x2184('0x2'));var rp=require(_0x2184('0x3'));var moment=require(_0x2184('0x4'));var BPromise=require(_0x2184('0x5'));var Mustache=require('mustache');var util=require(_0x2184('0x6'));var path=require(_0x2184('0x7'));var sox=require(_0x2184('0x8'));var csv=require(_0x2184('0x9'));var ejs=require(_0x2184('0xa'));var fs=require('fs');var fs_extra=require(_0x2184('0xb'));var _=require('lodash');var squel=require(_0x2184('0xc'));var crypto=require(_0x2184('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2184('0xe'));var toCsv=require(_0x2184('0x9'));var querystring=require(_0x2184('0xf'));var Papa=require(_0x2184('0x10'));var Redis=require(_0x2184('0x11'));var authService=require(_0x2184('0x12'));var qs=require(_0x2184('0x13'));var as=require(_0x2184('0x14'));var hardwareService=require(_0x2184('0x15'));var logger=require(_0x2184('0x16'))(_0x2184('0x17'));var utils=require(_0x2184('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2184('0x19'));var db=require(_0x2184('0x1a'))['db'];function respondWithStatusCode(_0x1b53ff,_0x301e5e){_0x301e5e=_0x301e5e||0xcc;return function(_0x3d80e5){if(_0x3d80e5){return _0x1b53ff[_0x2184('0x1b')](_0x301e5e);}return _0x1b53ff[_0x2184('0x1c')](_0x301e5e)['end']();};}function respondWithResult(_0x63629c,_0xafebdc){_0xafebdc=_0xafebdc||0xc8;return function(_0x48e0a6){if(_0x48e0a6){return _0x63629c['status'](_0xafebdc)[_0x2184('0x1d')](_0x48e0a6);}};}function respondWithFilteredResult(_0x281cf9,_0x4aa82c){return function(_0x8d4204){if(_0x8d4204){var _0x570e49=typeof _0x4aa82c[_0x2184('0x1e')]==='undefined'&&typeof _0x4aa82c[_0x2184('0x1f')]==='undefined';var _0x5ab1aa=_0x8d4204[_0x2184('0x20')];var _0x572f98=_0x570e49?0x0:_0x4aa82c['offset'];var _0x13cf7f=_0x570e49?_0x8d4204[_0x2184('0x20')]:_0x4aa82c['offset']+_0x4aa82c[_0x2184('0x1f')];var _0x51e889;if(_0x13cf7f>=_0x5ab1aa){_0x13cf7f=_0x5ab1aa;_0x51e889=0xc8;}else{_0x51e889=0xce;}_0x281cf9[_0x2184('0x1c')](_0x51e889);return _0x281cf9['set']('Content-Range',_0x572f98+'-'+_0x13cf7f+'/'+_0x5ab1aa)['json'](_0x8d4204);}return null;};}function patchUpdates(_0x3c12d0){return function(_0x27b2d8){try{jsonpatch[_0x2184('0x21')](_0x27b2d8,_0x3c12d0,!![]);}catch(_0x2d214c){return BPromise[_0x2184('0x22')](_0x2d214c);}return _0x27b2d8[_0x2184('0x23')]();};}function saveUpdates(_0x219fbb,_0x2bd43){return function(_0x2690e7){if(_0x2690e7){return _0x2690e7[_0x2184('0x24')](_0x219fbb)['then'](function(_0x1ff954){return _0x1ff954;});}return null;};}function removeEntity(_0x518757,_0x4e8efd){return function(_0x5ed594){if(_0x5ed594){return _0x5ed594[_0x2184('0x25')]()[_0x2184('0x26')](function(){_0x518757[_0x2184('0x1c')](0xcc)[_0x2184('0x27')]();});}};}function handleEntityNotFound(_0x2318a8,_0x3db6f7){return function(_0x23e7d8){if(!_0x23e7d8){_0x2318a8['sendStatus'](0x194);}return _0x23e7d8;};}function handleError(_0xb68b4e,_0x2ad268){_0x2ad268=_0x2ad268||0x1f4;return function(_0x454ef6){logger['error'](_0x454ef6['stack']);if(_0x454ef6['name']){delete _0x454ef6['name'];}_0xb68b4e[_0x2184('0x1c')](_0x2ad268)[_0x2184('0x28')](_0x454ef6);};}exports[_0x2184('0x29')]=function(_0xf1005a,_0x5ce5fe){var _0x28e7f7={},_0x25d437={},_0x43fdc5={'count':0x0,'rows':[]};var _0x438178=_[_0x2184('0x2a')](db[_0x2184('0x2b')][_0x2184('0x2c')],function(_0x5b5ead){return{'name':_0x5b5ead['fieldName'],'type':_0x5b5ead['type'][_0x2184('0x2d')]};});_0x25d437[_0x2184('0x2e')]=_['map'](_0x438178,_0x2184('0x2f'));_0x25d437['query']=_[_0x2184('0x30')](_0xf1005a[_0x2184('0x31')]);_0x25d437[_0x2184('0x32')]=_[_0x2184('0x33')](_0x25d437[_0x2184('0x2e')],_0x25d437['query']);_0x28e7f7[_0x2184('0x34')]=_[_0x2184('0x33')](_0x25d437['model'],qs['fields'](_0xf1005a['query'][_0x2184('0x35')]));_0x28e7f7['attributes']=_0x28e7f7[_0x2184('0x34')][_0x2184('0x36')]?_0x28e7f7[_0x2184('0x34')]:_0x25d437['model'];if(!_0xf1005a[_0x2184('0x31')]['hasOwnProperty']('nolimit')){_0x28e7f7[_0x2184('0x1f')]=qs[_0x2184('0x1f')](_0xf1005a[_0x2184('0x31')][_0x2184('0x1f')]);_0x28e7f7['offset']=qs[_0x2184('0x1e')](_0xf1005a[_0x2184('0x31')][_0x2184('0x1e')]);}_0x28e7f7[_0x2184('0x37')]=qs[_0x2184('0x38')](_0xf1005a[_0x2184('0x31')]['sort']);_0x28e7f7[_0x2184('0x39')]=qs[_0x2184('0x32')](_[_0x2184('0x3a')](_0xf1005a[_0x2184('0x31')],_0x25d437[_0x2184('0x32')]),_0x438178);if(_0xf1005a[_0x2184('0x31')][_0x2184('0x3b')]){_0x28e7f7[_0x2184('0x39')]=_['merge'](_0x28e7f7[_0x2184('0x39')],{'$or':_['map'](_0x438178,function(_0x43ca92){if(_0x43ca92[_0x2184('0x3c')]!==_0x2184('0x3d')){var _0x205f75={};_0x205f75[_0x43ca92[_0x2184('0x2f')]]={'$like':'%'+_0xf1005a['query'][_0x2184('0x3b')]+'%'};return _0x205f75;}})});}_0x28e7f7=_['merge']({},_0x28e7f7,_0xf1005a[_0x2184('0x3e')]);var _0x2ff955={'where':_0x28e7f7[_0x2184('0x39')]};return db[_0x2184('0x2b')][_0x2184('0x20')](_0x2ff955)[_0x2184('0x26')](function(_0x54b3ed){_0x43fdc5[_0x2184('0x20')]=_0x54b3ed;if(_0xf1005a[_0x2184('0x31')][_0x2184('0x3f')]){_0x28e7f7['include']=[{'all':!![]}];}return db['SugarcrmField'][_0x2184('0x40')](_0x28e7f7);})[_0x2184('0x26')](function(_0x4c83c2){_0x43fdc5['rows']=_0x4c83c2;return _0x43fdc5;})[_0x2184('0x26')](respondWithFilteredResult(_0x5ce5fe,_0x28e7f7))['catch'](handleError(_0x5ce5fe,null));};exports[_0x2184('0x41')]=function(_0x51890c,_0x49031e){var _0x46d53c={'raw':!![],'where':{'id':_0x51890c[_0x2184('0x42')]['id']}},_0x11b7d0={};_0x11b7d0[_0x2184('0x2e')]=_[_0x2184('0x30')](db[_0x2184('0x2b')]['rawAttributes']);_0x11b7d0[_0x2184('0x31')]=_['keys'](_0x51890c[_0x2184('0x31')]);_0x11b7d0[_0x2184('0x32')]=_[_0x2184('0x33')](_0x11b7d0['model'],_0x11b7d0[_0x2184('0x31')]);_0x46d53c[_0x2184('0x34')]=_[_0x2184('0x33')](_0x11b7d0[_0x2184('0x2e')],qs[_0x2184('0x35')](_0x51890c['query']['fields']));_0x46d53c[_0x2184('0x34')]=_0x46d53c[_0x2184('0x34')]['length']?_0x46d53c[_0x2184('0x34')]:_0x11b7d0[_0x2184('0x2e')];if(_0x51890c[_0x2184('0x31')]['includeAll']){_0x46d53c[_0x2184('0x43')]=[{'all':!![]}];}_0x46d53c=_[_0x2184('0x44')]({},_0x46d53c,_0x51890c[_0x2184('0x3e')]);return db[_0x2184('0x2b')][_0x2184('0x45')](_0x46d53c)[_0x2184('0x26')](handleEntityNotFound(_0x49031e,null))[_0x2184('0x26')](respondWithResult(_0x49031e,null))[_0x2184('0x46')](handleError(_0x49031e,null));};exports[_0x2184('0x47')]=function(_0x4e5218,_0x1304fc){return db[_0x2184('0x2b')]['create'](_0x4e5218['body'],{})[_0x2184('0x26')](respondWithResult(_0x1304fc,0xc9))[_0x2184('0x46')](handleError(_0x1304fc,null));};exports[_0x2184('0x24')]=function(_0x25feb5,_0x359b17){if(_0x25feb5[_0x2184('0x48')]['id']){delete _0x25feb5[_0x2184('0x48')]['id'];}return db[_0x2184('0x2b')][_0x2184('0x45')]({'where':{'id':_0x25feb5[_0x2184('0x42')]['id']}})[_0x2184('0x26')](handleEntityNotFound(_0x359b17,null))['then'](saveUpdates(_0x25feb5[_0x2184('0x48')],null))['then'](respondWithResult(_0x359b17,null))[_0x2184('0x46')](handleError(_0x359b17,null));};exports[_0x2184('0x25')]=function(_0x4c8432,_0x373e60){return db[_0x2184('0x2b')][_0x2184('0x45')]({'where':{'id':_0x4c8432[_0x2184('0x42')]['id']}})['then'](handleEntityNotFound(_0x373e60,null))[_0x2184('0x26')](removeEntity(_0x373e60,null))[_0x2184('0x46')](handleError(_0x373e60,null));}; \ No newline at end of file +var _0x65dd=['includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','key','map','query','keys','model','attributes','fields','length','nolimit','order','sort','filters','filter','merge','type','VIRTUAL','options','SugarcrmField'];(function(_0x55520f,_0xc39c6f){var _0xd1ca1f=function(_0x3ef02e){while(--_0x3ef02e){_0x55520f['push'](_0x55520f['shift']());}};_0xd1ca1f(++_0xc39c6f);}(_0x65dd,0x187));var _0xd65d=function(_0x284ee2,_0x2f1746){_0x284ee2=_0x284ee2-0x0;var _0x13e648=_0x65dd[_0x284ee2];return _0x13e648;};'use strict';var emlformat=require(_0xd65d('0x0'));var rimraf=require(_0xd65d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd65d('0x2'));var rp=require('request-promise');var moment=require(_0xd65d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd65d('0x4'));var util=require(_0xd65d('0x5'));var path=require(_0xd65d('0x6'));var sox=require(_0xd65d('0x7'));var csv=require(_0xd65d('0x8'));var ejs=require(_0xd65d('0x9'));var fs=require('fs');var fs_extra=require(_0xd65d('0xa'));var _=require(_0xd65d('0xb'));var squel=require(_0xd65d('0xc'));var crypto=require(_0xd65d('0xd'));var jsforce=require(_0xd65d('0xe'));var deskjs=require(_0xd65d('0xf'));var toCsv=require(_0xd65d('0x8'));var querystring=require(_0xd65d('0x10'));var Papa=require(_0xd65d('0x11'));var Redis=require('ioredis');var authService=require(_0xd65d('0x12'));var qs=require(_0xd65d('0x13'));var as=require(_0xd65d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd65d('0x15'))('api');var utils=require(_0xd65d('0x16'));var config=require(_0xd65d('0x17'));var licenseUtil=require(_0xd65d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27448f,_0x55092c){_0x55092c=_0x55092c||0xcc;return function(_0x248287){if(_0x248287){return _0x27448f['sendStatus'](_0x55092c);}return _0x27448f[_0xd65d('0x19')](_0x55092c)[_0xd65d('0x1a')]();};}function respondWithResult(_0x901cc1,_0x2476ce){_0x2476ce=_0x2476ce||0xc8;return function(_0x2b4935){if(_0x2b4935){return _0x901cc1[_0xd65d('0x19')](_0x2476ce)[_0xd65d('0x1b')](_0x2b4935);}};}function respondWithFilteredResult(_0x165941,_0x1b3781){return function(_0x2418de){if(_0x2418de){var _0x4e97cf=typeof _0x1b3781[_0xd65d('0x1c')]==='undefined'&&typeof _0x1b3781['limit']===_0xd65d('0x1d');var _0x3e0b6a=_0x2418de[_0xd65d('0x1e')];var _0x57cfa6=_0x4e97cf?0x0:_0x1b3781[_0xd65d('0x1c')];var _0x174e48=_0x4e97cf?_0x2418de[_0xd65d('0x1e')]:_0x1b3781[_0xd65d('0x1c')]+_0x1b3781[_0xd65d('0x1f')];var _0x5371bf;if(_0x174e48>=_0x3e0b6a){_0x174e48=_0x3e0b6a;_0x5371bf=0xc8;}else{_0x5371bf=0xce;}_0x165941[_0xd65d('0x19')](_0x5371bf);return _0x165941[_0xd65d('0x20')](_0xd65d('0x21'),_0x57cfa6+'-'+_0x174e48+'/'+_0x3e0b6a)[_0xd65d('0x1b')](_0x2418de);}return null;};}function patchUpdates(_0x26e27b){return function(_0x3c487b){try{jsonpatch[_0xd65d('0x22')](_0x3c487b,_0x26e27b,!![]);}catch(_0x325dfd){return BPromise[_0xd65d('0x23')](_0x325dfd);}return _0x3c487b[_0xd65d('0x24')]();};}function saveUpdates(_0x5e86d2,_0x184aea){return function(_0x5db560){if(_0x5db560){return _0x5db560[_0xd65d('0x25')](_0x5e86d2)[_0xd65d('0x26')](function(_0x1d6b5a){return _0x1d6b5a;});}return null;};}function removeEntity(_0x3f7f3a,_0x1fd2f0){return function(_0x201331){if(_0x201331){return _0x201331['destroy']()[_0xd65d('0x26')](function(){_0x3f7f3a[_0xd65d('0x19')](0xcc)[_0xd65d('0x1a')]();});}};}function handleEntityNotFound(_0x1b335d,_0x1b1bc7){return function(_0x78e70c){if(!_0x78e70c){_0x1b335d[_0xd65d('0x27')](0x194);}return _0x78e70c;};}function handleError(_0xf5883a,_0x1c43f8){_0x1c43f8=_0x1c43f8||0x1f4;return function(_0x515910){logger[_0xd65d('0x28')](_0x515910[_0xd65d('0x29')]);if(_0x515910[_0xd65d('0x2a')]){delete _0x515910[_0xd65d('0x2a')];}_0xf5883a['status'](_0x1c43f8)[_0xd65d('0x2b')](_0x515910);};}exports[_0xd65d('0x2c')]=function(_0x1053b1,_0xaa3c5f){var _0x4c5ed7={},_0x1c6e8f={},_0x110f64={'count':0x0,'rows':[]};var _0x2a95bd=_['map'](db['SugarcrmField'][_0xd65d('0x2d')],function(_0x12594b){return{'name':_0x12594b[_0xd65d('0x2e')],'type':_0x12594b['type'][_0xd65d('0x2f')]};});_0x1c6e8f['model']=_[_0xd65d('0x30')](_0x2a95bd,_0xd65d('0x2a'));_0x1c6e8f[_0xd65d('0x31')]=_[_0xd65d('0x32')](_0x1053b1[_0xd65d('0x31')]);_0x1c6e8f['filters']=_['intersection'](_0x1c6e8f[_0xd65d('0x33')],_0x1c6e8f['query']);_0x4c5ed7[_0xd65d('0x34')]=_['intersection'](_0x1c6e8f[_0xd65d('0x33')],qs[_0xd65d('0x35')](_0x1053b1[_0xd65d('0x31')][_0xd65d('0x35')]));_0x4c5ed7[_0xd65d('0x34')]=_0x4c5ed7[_0xd65d('0x34')][_0xd65d('0x36')]?_0x4c5ed7[_0xd65d('0x34')]:_0x1c6e8f['model'];if(!_0x1053b1[_0xd65d('0x31')]['hasOwnProperty'](_0xd65d('0x37'))){_0x4c5ed7[_0xd65d('0x1f')]=qs[_0xd65d('0x1f')](_0x1053b1['query'][_0xd65d('0x1f')]);_0x4c5ed7[_0xd65d('0x1c')]=qs[_0xd65d('0x1c')](_0x1053b1['query'][_0xd65d('0x1c')]);}_0x4c5ed7[_0xd65d('0x38')]=qs['sort'](_0x1053b1[_0xd65d('0x31')][_0xd65d('0x39')]);_0x4c5ed7['where']=qs[_0xd65d('0x3a')](_['pick'](_0x1053b1[_0xd65d('0x31')],_0x1c6e8f[_0xd65d('0x3a')]),_0x2a95bd);if(_0x1053b1[_0xd65d('0x31')][_0xd65d('0x3b')]){_0x4c5ed7['where']=_[_0xd65d('0x3c')](_0x4c5ed7['where'],{'$or':_[_0xd65d('0x30')](_0x2a95bd,function(_0x39cc8e){if(_0x39cc8e[_0xd65d('0x3d')]!==_0xd65d('0x3e')){var _0x4b7698={};_0x4b7698[_0x39cc8e['name']]={'$like':'%'+_0x1053b1['query'][_0xd65d('0x3b')]+'%'};return _0x4b7698;}})});}_0x4c5ed7=_[_0xd65d('0x3c')]({},_0x4c5ed7,_0x1053b1[_0xd65d('0x3f')]);var _0x1acc95={'where':_0x4c5ed7['where']};return db[_0xd65d('0x40')][_0xd65d('0x1e')](_0x1acc95)[_0xd65d('0x26')](function(_0x38b3ce){_0x110f64[_0xd65d('0x1e')]=_0x38b3ce;if(_0x1053b1[_0xd65d('0x31')][_0xd65d('0x41')]){_0x4c5ed7[_0xd65d('0x42')]=[{'all':!![]}];}return db[_0xd65d('0x40')][_0xd65d('0x43')](_0x4c5ed7);})[_0xd65d('0x26')](function(_0x5c1b5f){_0x110f64[_0xd65d('0x44')]=_0x5c1b5f;return _0x110f64;})[_0xd65d('0x26')](respondWithFilteredResult(_0xaa3c5f,_0x4c5ed7))[_0xd65d('0x45')](handleError(_0xaa3c5f,null));};exports[_0xd65d('0x46')]=function(_0x16598a,_0x126471){var _0x5d2040={'raw':!![],'where':{'id':_0x16598a[_0xd65d('0x47')]['id']}},_0xbe7a62={};_0xbe7a62[_0xd65d('0x33')]=_[_0xd65d('0x32')](db[_0xd65d('0x40')]['rawAttributes']);_0xbe7a62[_0xd65d('0x31')]=_['keys'](_0x16598a[_0xd65d('0x31')]);_0xbe7a62[_0xd65d('0x3a')]=_['intersection'](_0xbe7a62['model'],_0xbe7a62[_0xd65d('0x31')]);_0x5d2040[_0xd65d('0x34')]=_['intersection'](_0xbe7a62['model'],qs[_0xd65d('0x35')](_0x16598a[_0xd65d('0x31')][_0xd65d('0x35')]));_0x5d2040[_0xd65d('0x34')]=_0x5d2040[_0xd65d('0x34')][_0xd65d('0x36')]?_0x5d2040[_0xd65d('0x34')]:_0xbe7a62[_0xd65d('0x33')];if(_0x16598a['query']['includeAll']){_0x5d2040[_0xd65d('0x42')]=[{'all':!![]}];}_0x5d2040=_['merge']({},_0x5d2040,_0x16598a[_0xd65d('0x3f')]);return db['SugarcrmField'][_0xd65d('0x48')](_0x5d2040)[_0xd65d('0x26')](handleEntityNotFound(_0x126471,null))['then'](respondWithResult(_0x126471,null))[_0xd65d('0x45')](handleError(_0x126471,null));};exports[_0xd65d('0x49')]=function(_0x59bdb4,_0x145486){return db[_0xd65d('0x40')][_0xd65d('0x49')](_0x59bdb4[_0xd65d('0x4a')],{})[_0xd65d('0x26')](respondWithResult(_0x145486,0xc9))[_0xd65d('0x45')](handleError(_0x145486,null));};exports[_0xd65d('0x25')]=function(_0x3de4d5,_0x30e102){if(_0x3de4d5['body']['id']){delete _0x3de4d5['body']['id'];}return db[_0xd65d('0x40')][_0xd65d('0x48')]({'where':{'id':_0x3de4d5[_0xd65d('0x47')]['id']}})['then'](handleEntityNotFound(_0x30e102,null))[_0xd65d('0x26')](saveUpdates(_0x3de4d5[_0xd65d('0x4a')],null))['then'](respondWithResult(_0x30e102,null))[_0xd65d('0x45')](handleError(_0x30e102,null));};exports[_0xd65d('0x4b')]=function(_0x417b63,_0xdfa5cb){return db[_0xd65d('0x40')][_0xd65d('0x48')]({'where':{'id':_0x417b63[_0xd65d('0x47')]['id']}})[_0xd65d('0x26')](handleEntityNotFound(_0xdfa5cb,null))[_0xd65d('0x26')](removeEntity(_0xdfa5cb,null))[_0xd65d('0x45')](handleError(_0xdfa5cb,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 58f3c8d..fc40edb 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 _0x3292=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x55e532,_0x2ce26d){var _0x2e7bc1=function(_0xff2ed8){while(--_0xff2ed8){_0x55e532['push'](_0x55e532['shift']());}};_0x2e7bc1(++_0x2ce26d);}(_0x3292,0x1d1));var _0x2329=function(_0x198d77,_0x57932f){_0x198d77=_0x198d77-0x0;var _0xca7c1a=_0x3292[_0x198d77];return _0xca7c1a;};'use strict';var _=require(_0x2329('0x0'));var util=require(_0x2329('0x1'));var logger=require(_0x2329('0x2'))(_0x2329('0x3'));var moment=require(_0x2329('0x4'));var BPromise=require(_0x2329('0x5'));var rp=require(_0x2329('0x6'));var fs=require('fs');var path=require(_0x2329('0x7'));var rimraf=require(_0x2329('0x8'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0x2329('0x9')]=function(_0x3133c3,_0x856242){return _0x3133c3[_0x2329('0xa')](_0x2329('0xb'),attributes,{'tableName':_0x2329('0xc'),'paranoid':![],'indexes':[{'name':_0x2329('0xd'),'fields':[_0x2329('0xe'),_0x2329('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e2d=['bluebird','../../config/environment','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger','moment'];(function(_0x5451f9,_0x34b46c){var _0x21ba78=function(_0x1433fc){while(--_0x1433fc){_0x5451f9['push'](_0x5451f9['shift']());}};_0x21ba78(++_0x34b46c);}(_0x4e2d,0x76));var _0xd4e2=function(_0x3b2b7c,_0x10f7ad){_0x3b2b7c=_0x3b2b7c-0x0;var _0xb2158e=_0x4e2d[_0x3b2b7c];return _0xb2158e;};'use strict';var _=require(_0xd4e2('0x0'));var util=require('util');var logger=require(_0xd4e2('0x1'))('api');var moment=require(_0xd4e2('0x2'));var BPromise=require(_0xd4e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd4e2('0x4'));var attributes=require('./intSugarcrmField.attributes');module[_0xd4e2('0x5')]=function(_0x2b4c91,_0xabb35c){return _0x2b4c91[_0xd4e2('0x6')]('SugarcrmField',attributes,{'tableName':_0xd4e2('0x7'),'paranoid':![],'indexes':[{'name':_0xd4e2('0x8'),'fields':[_0xd4e2('0x9'),_0xd4e2('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 5d223e6..b68bbaa 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 _0x0952=['debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','info','SugarcrmField,\x20%s,\x20%s'];(function(_0xb2e670,_0x436e56){var _0x598b6b=function(_0x5ecdd8){while(--_0x5ecdd8){_0xb2e670['push'](_0xb2e670['shift']());}};_0x598b6b(++_0x436e56);}(_0x0952,0x95));var _0x2095=function(_0x1c9715,_0x94bdcf){_0x1c9715=_0x1c9715-0x0;var _0x43eb5e=_0x0952[_0x1c9715];return _0x43eb5e;};'use strict';var _=require(_0x2095('0x0'));var util=require(_0x2095('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2095('0x2'));var fs=require('fs');var Redis=require(_0x2095('0x3'));var db=require(_0x2095('0x4'))['db'];var utils=require(_0x2095('0x5'));var logger=require(_0x2095('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2095('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33be46,_0x5d7407,_0xa0d669){return new BPromise(function(_0x1bb3d0,_0x458a4a){return client[_0x2095('0x8')](_0x33be46,_0xa0d669)['then'](function(_0x3cc658){logger[_0x2095('0x9')](_0x2095('0xa'),_0x5d7407,'request\x20sent');logger[_0x2095('0xb')](_0x2095('0xc'),_0x5d7407,_0x2095('0xd'),JSON[_0x2095('0xe')](_0x3cc658));if(_0x3cc658['error']){if(_0x3cc658['error'][_0x2095('0xf')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x5d7407,_0x3cc658[_0x2095('0x10')][_0x2095('0x11')]);return _0x458a4a(_0x3cc658[_0x2095('0x10')][_0x2095('0x11')]);}logger[_0x2095('0x10')](_0x2095('0xa'),_0x5d7407,_0x3cc658[_0x2095('0x10')][_0x2095('0x11')]);return _0x1bb3d0(_0x3cc658[_0x2095('0x10')][_0x2095('0x11')]);}else{logger['info'](_0x2095('0xa'),_0x5d7407,_0x2095('0xd'));_0x1bb3d0(_0x3cc658[_0x2095('0x12')][_0x2095('0x11')]);}})[_0x2095('0x13')](function(_0x579675){logger[_0x2095('0x10')](_0x2095('0xa'),_0x5d7407,_0x579675);_0x458a4a(_0x579675);});});} \ No newline at end of file +var _0x4aad=['rpc','jayson/promise','client','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2656a4,_0x28dd1b){var _0x48ce85=function(_0x41d957){while(--_0x41d957){_0x2656a4['push'](_0x2656a4['shift']());}};_0x48ce85(++_0x28dd1b);}(_0x4aad,0x188));var _0xd4aa=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x4aad[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require(_0xd4aa('0x0'));var moment=require(_0xd4aa('0x1'));var BPromise=require(_0xd4aa('0x2'));var rs=require(_0xd4aa('0x3'));var fs=require('fs');var Redis=require(_0xd4aa('0x4'));var db=require(_0xd4aa('0x5'))['db'];var utils=require(_0xd4aa('0x6'));var logger=require(_0xd4aa('0x7'))(_0xd4aa('0x8'));var config=require('../../config/environment');var jayson=require(_0xd4aa('0x9'));var client=jayson[_0xd4aa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17d51c,_0x1f5312,_0x48c57f){return new BPromise(function(_0x2753a8,_0x236cff){return client['request'](_0x17d51c,_0x48c57f)[_0xd4aa('0xb')](function(_0x5070b1){logger['info'](_0xd4aa('0xc'),_0x1f5312,_0xd4aa('0xd'));logger[_0xd4aa('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1f5312,_0xd4aa('0xd'),JSON['stringify'](_0x5070b1));if(_0x5070b1[_0xd4aa('0xf')]){if(_0x5070b1[_0xd4aa('0xf')][_0xd4aa('0x10')]===0x1f4){logger[_0xd4aa('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x1f5312,_0x5070b1['error'][_0xd4aa('0x11')]);return _0x236cff(_0x5070b1[_0xd4aa('0xf')]['message']);}logger[_0xd4aa('0xf')](_0xd4aa('0xc'),_0x1f5312,_0x5070b1[_0xd4aa('0xf')][_0xd4aa('0x11')]);return _0x2753a8(_0x5070b1['error'][_0xd4aa('0x11')]);}else{logger[_0xd4aa('0x12')](_0xd4aa('0xc'),_0x1f5312,_0xd4aa('0xd'));_0x2753a8(_0x5070b1['result'][_0xd4aa('0x11')]);}})[_0xd4aa('0x13')](function(_0x365acd){logger[_0xd4aa('0xf')](_0xd4aa('0xc'),_0x1f5312,_0x365acd);_0x236cff(_0x365acd);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 625dff2..ed690eb 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 _0x925e=['exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','/:id'];(function(_0x34967e,_0x11f483){var _0x406971=function(_0xc805e3){while(--_0xc805e3){_0x34967e['push'](_0x34967e['shift']());}};_0x406971(++_0x11f483);}(_0x925e,0x199));var _0xe925=function(_0x19f733,_0x332935){_0x19f733=_0x19f733-0x0;var _0x5795e8=_0x925e[_0x19f733];return _0x5795e8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe925('0x0'));var timeout=require(_0xe925('0x1'));var express=require(_0xe925('0x2'));var router=express['Router']();var fs_extra=require(_0xe925('0x3'));var auth=require(_0xe925('0x4'));var interaction=require(_0xe925('0x5'));var config=require(_0xe925('0x6'));var controller=require(_0xe925('0x7'));router[_0xe925('0x8')]('/',auth[_0xe925('0x9')](),controller[_0xe925('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe925('0xb')]);router['get'](_0xe925('0xc'),auth['isAuthenticated'](),controller[_0xe925('0xd')]);router[_0xe925('0x8')](_0xe925('0xe'),auth[_0xe925('0x9')](),controller[_0xe925('0xf')]);router[_0xe925('0x10')]('/',auth[_0xe925('0x9')](),controller[_0xe925('0x11')]);router[_0xe925('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xe925('0x12')]);router[_0xe925('0x13')]('/:id',auth[_0xe925('0x9')](),controller[_0xe925('0x14')]);router[_0xe925('0x15')](_0xe925('0x16'),auth[_0xe925('0x9')](),controller['destroy']);module[_0xe925('0x17')]=router; \ No newline at end of file +var _0xc770=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','isAuthenticated','/:id/configurations','/:id/fields','post','create','addConfiguration','put','/:id','destroy'];(function(_0x2682e5,_0xbeaa9b){var _0x3417bd=function(_0x497960){while(--_0x497960){_0x2682e5['push'](_0x2682e5['shift']());}};_0x3417bd(++_0xbeaa9b);}(_0xc770,0xd3));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0c77('0x0'));var util=require(_0x0c77('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c77('0x2'));var router=express[_0x0c77('0x3')]();var fs_extra=require(_0x0c77('0x4'));var auth=require(_0x0c77('0x5'));var interaction=require(_0x0c77('0x6'));var config=require(_0x0c77('0x7'));var controller=require(_0x0c77('0x8'));router[_0x0c77('0x9')]('/',auth['isAuthenticated'](),controller[_0x0c77('0xa')]);router[_0x0c77('0x9')]('/:id',auth[_0x0c77('0xb')](),controller['show']);router[_0x0c77('0x9')](_0x0c77('0xc'),auth[_0x0c77('0xb')](),controller['getConfigurations']);router[_0x0c77('0x9')](_0x0c77('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0x0c77('0xe')]('/',auth['isAuthenticated'](),controller[_0x0c77('0xf')]);router[_0x0c77('0xe')]('/:id/configurations',auth[_0x0c77('0xb')](),controller[_0x0c77('0x10')]);router[_0x0c77('0x11')](_0x0c77('0x12'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0c77('0x12'),auth[_0x0c77('0xb')](),controller[_0x0c77('0x13')]);module[_0x0c77('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 9d4032a..4665746 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 _0x77e3=['sequelize','exports','STRING','HelpDesk'];(function(_0xd63549,_0x5068b1){var _0xb2c2de=function(_0x2053ef){while(--_0x2053ef){_0xd63549['push'](_0xd63549['shift']());}};_0xb2c2de(++_0x5068b1);}(_0x77e3,0x130));var _0x377e=function(_0x49cfb6,_0x5ccff2){_0x49cfb6=_0x49cfb6-0x0;var _0x1ba905=_0x77e3[_0x49cfb6];return _0x1ba905;};'use strict';var Sequelize=require(_0x377e('0x0'));module[_0x377e('0x1')]={'name':{'type':Sequelize[_0x377e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x377e('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x377e('0x3')},'remoteUri':{'type':Sequelize[_0x377e('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5276=['STRING','HelpDesk','exports'];(function(_0x59240f,_0x52a159){var _0xcf2315=function(_0x93dbc5){while(--_0x93dbc5){_0x59240f['push'](_0x59240f['shift']());}};_0xcf2315(++_0x52a159);}(_0x5276,0x14c));var _0x6527=function(_0x305c2f,_0x306f52){_0x305c2f=_0x305c2f-0x0;var _0x1ad4fc=_0x5276[_0x305c2f];return _0x1ad4fc;};'use strict';var Sequelize=require('sequelize');module[_0x6527('0x0')]={'name':{'type':Sequelize[_0x6527('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6527('0x1')]},'username':{'type':Sequelize[_0x6527('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6527('0x1')],'allowNull':![],'defaultValue':_0x6527('0x2')},'remoteUri':{'type':Sequelize[_0x6527('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6527('0x1')],'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 0172d43..50230f7 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 _0x5628=['intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','VtigerAccount','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','VtigerConfiguration','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','getFields','description','moduleName','serverUrl','accessKey','username','remoteUri','lastIndexOf','%s/webservice.php','GET','getchallenge','login','result','token','success','describe','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklistValues','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','filters'];(function(_0x21244e,_0x315135){var _0x3fbf6f=function(_0x45df90){while(--_0x45df90){_0x21244e['push'](_0x21244e['shift']());}};_0x3fbf6f(++_0x315135);}(_0x5628,0x136));var _0x8562=function(_0x9525a3,_0x39df4a){_0x9525a3=_0x9525a3-0x0;var _0x46927d=_0x5628[_0x9525a3];return _0x46927d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8562('0x0'));var zipdir=require(_0x8562('0x1'));var jsonpatch=require(_0x8562('0x2'));var rp=require(_0x8562('0x3'));var moment=require(_0x8562('0x4'));var BPromise=require(_0x8562('0x5'));var Mustache=require(_0x8562('0x6'));var util=require(_0x8562('0x7'));var path=require(_0x8562('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8562('0x9'));var fs=require('fs');var fs_extra=require(_0x8562('0xa'));var _=require(_0x8562('0xb'));var squel=require(_0x8562('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8562('0xd'));var toCsv=require(_0x8562('0xe'));var querystring=require(_0x8562('0xf'));var Papa=require(_0x8562('0x10'));var Redis=require(_0x8562('0x11'));var authService=require(_0x8562('0x12'));var qs=require(_0x8562('0x13'));var as=require(_0x8562('0x14'));var hardwareService=require(_0x8562('0x15'));var logger=require(_0x8562('0x16'))(_0x8562('0x17'));var utils=require(_0x8562('0x18'));var config=require(_0x8562('0x19'));var licenseUtil=require(_0x8562('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x278909,_0x5b7896){_0x5b7896=_0x5b7896||0xcc;return function(_0x3910fc){if(_0x3910fc){return _0x278909[_0x8562('0x1b')](_0x5b7896);}return _0x278909[_0x8562('0x1c')](_0x5b7896)['end']();};}function respondWithResult(_0x3aeff2,_0x1734c8){_0x1734c8=_0x1734c8||0xc8;return function(_0x413705){if(_0x413705){return _0x3aeff2[_0x8562('0x1c')](_0x1734c8)['json'](_0x413705);}};}function respondWithFilteredResult(_0xcb8b01,_0x12f796){return function(_0x1b0254){if(_0x1b0254){var _0x1ecadc=typeof _0x12f796[_0x8562('0x1d')]===_0x8562('0x1e')&&typeof _0x12f796[_0x8562('0x1f')]===_0x8562('0x1e');var _0x26fdef=_0x1b0254['count'];var _0x15598e=_0x1ecadc?0x0:_0x12f796[_0x8562('0x1d')];var _0x38188b=_0x1ecadc?_0x1b0254[_0x8562('0x20')]:_0x12f796[_0x8562('0x1d')]+_0x12f796[_0x8562('0x1f')];var _0x2d1e89;if(_0x38188b>=_0x26fdef){_0x38188b=_0x26fdef;_0x2d1e89=0xc8;}else{_0x2d1e89=0xce;}_0xcb8b01[_0x8562('0x1c')](_0x2d1e89);return _0xcb8b01['set'](_0x8562('0x21'),_0x15598e+'-'+_0x38188b+'/'+_0x26fdef)[_0x8562('0x22')](_0x1b0254);}return null;};}function patchUpdates(_0x212236){return function(_0x315244){try{jsonpatch[_0x8562('0x23')](_0x315244,_0x212236,!![]);}catch(_0x5c0905){return BPromise[_0x8562('0x24')](_0x5c0905);}return _0x315244[_0x8562('0x25')]();};}function saveUpdates(_0x1a5616,_0x408fba){return function(_0x1b366f){if(_0x1b366f){return _0x1b366f[_0x8562('0x26')](_0x1a5616)['then'](function(_0x488fcf){return _0x488fcf;});}return null;};}function removeEntity(_0x5aa020,_0x17ecf1){return function(_0x59edb2){if(_0x59edb2){return _0x59edb2[_0x8562('0x27')]()[_0x8562('0x28')](function(){_0x5aa020['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1904d3,_0x1df48f){return function(_0x599cbb){if(!_0x599cbb){_0x1904d3[_0x8562('0x1b')](0x194);}return _0x599cbb;};}function handleError(_0x488895,_0x50fa8a){_0x50fa8a=_0x50fa8a||0x1f4;return function(_0x2b494f){logger[_0x8562('0x29')](_0x2b494f[_0x8562('0x2a')]);if(_0x2b494f[_0x8562('0x2b')]){delete _0x2b494f[_0x8562('0x2b')];}_0x488895[_0x8562('0x1c')](_0x50fa8a)['send'](_0x2b494f);};}exports[_0x8562('0x2c')]=function(_0x4f3767,_0x5912bf){var _0x29a547={},_0x597fa5={},_0x656bca={'count':0x0,'rows':[]};var _0x3e52e8=_[_0x8562('0x2d')](db['VtigerAccount'][_0x8562('0x2e')],function(_0x88321a){return{'name':_0x88321a[_0x8562('0x2f')],'type':_0x88321a[_0x8562('0x30')][_0x8562('0x31')]};});_0x597fa5[_0x8562('0x32')]=_[_0x8562('0x2d')](_0x3e52e8,_0x8562('0x2b'));_0x597fa5['query']=_[_0x8562('0x33')](_0x4f3767['query']);_0x597fa5[_0x8562('0x34')]=_[_0x8562('0x35')](_0x597fa5['model'],_0x597fa5[_0x8562('0x36')]);_0x29a547[_0x8562('0x37')]=_[_0x8562('0x35')](_0x597fa5['model'],qs[_0x8562('0x38')](_0x4f3767[_0x8562('0x36')][_0x8562('0x38')]));_0x29a547[_0x8562('0x37')]=_0x29a547[_0x8562('0x37')]['length']?_0x29a547[_0x8562('0x37')]:_0x597fa5[_0x8562('0x32')];if(!_0x4f3767[_0x8562('0x36')][_0x8562('0x39')]('nolimit')){_0x29a547[_0x8562('0x1f')]=qs[_0x8562('0x1f')](_0x4f3767[_0x8562('0x36')]['limit']);_0x29a547['offset']=qs[_0x8562('0x1d')](_0x4f3767['query']['offset']);}_0x29a547[_0x8562('0x3a')]=qs['sort'](_0x4f3767[_0x8562('0x36')][_0x8562('0x3b')]);_0x29a547[_0x8562('0x3c')]=qs[_0x8562('0x34')](_['pick'](_0x4f3767['query'],_0x597fa5[_0x8562('0x34')]),_0x3e52e8);if(_0x4f3767[_0x8562('0x36')][_0x8562('0x3d')]){_0x29a547['where']=_[_0x8562('0x3e')](_0x29a547['where'],{'$or':_['map'](_0x3e52e8,function(_0x1a3b62){if(_0x1a3b62[_0x8562('0x30')]!==_0x8562('0x3f')){var _0x4b9f58={};_0x4b9f58[_0x1a3b62['name']]={'$like':'%'+_0x4f3767[_0x8562('0x36')][_0x8562('0x3d')]+'%'};return _0x4b9f58;}})});}_0x29a547=_[_0x8562('0x3e')]({},_0x29a547,_0x4f3767[_0x8562('0x40')]);var _0xcd6cff={'where':_0x29a547['where']};return db[_0x8562('0x41')][_0x8562('0x20')](_0xcd6cff)[_0x8562('0x28')](function(_0x1197da){_0x656bca[_0x8562('0x20')]=_0x1197da;if(_0x4f3767[_0x8562('0x36')][_0x8562('0x42')]){_0x29a547[_0x8562('0x43')]=[{'all':!![]}];}return db[_0x8562('0x41')][_0x8562('0x44')](_0x29a547);})[_0x8562('0x28')](function(_0x3adf1b){_0x656bca[_0x8562('0x45')]=_0x3adf1b;return _0x656bca;})[_0x8562('0x28')](respondWithFilteredResult(_0x5912bf,_0x29a547))[_0x8562('0x46')](handleError(_0x5912bf,null));};exports[_0x8562('0x47')]=function(_0x5afdc5,_0x1a0d4c){var _0x27a852={'raw':![],'where':{'id':_0x5afdc5[_0x8562('0x48')]['id']}},_0x38bb6b={};_0x38bb6b[_0x8562('0x32')]=_[_0x8562('0x33')](db[_0x8562('0x41')][_0x8562('0x2e')]);_0x38bb6b[_0x8562('0x36')]=_[_0x8562('0x33')](_0x5afdc5['query']);_0x38bb6b[_0x8562('0x34')]=_[_0x8562('0x35')](_0x38bb6b[_0x8562('0x32')],_0x38bb6b[_0x8562('0x36')]);_0x27a852[_0x8562('0x37')]=_[_0x8562('0x35')](_0x38bb6b[_0x8562('0x32')],qs[_0x8562('0x38')](_0x5afdc5['query']['fields']));_0x27a852[_0x8562('0x37')]=_0x27a852['attributes'][_0x8562('0x49')]?_0x27a852[_0x8562('0x37')]:_0x38bb6b[_0x8562('0x32')];if(_0x5afdc5[_0x8562('0x36')][_0x8562('0x42')]){_0x27a852[_0x8562('0x43')]=[{'all':!![]}];}_0x27a852=_[_0x8562('0x3e')]({},_0x27a852,_0x5afdc5[_0x8562('0x40')]);return db['VtigerAccount'][_0x8562('0x4a')](_0x27a852)[_0x8562('0x28')](handleEntityNotFound(_0x1a0d4c,null))['then'](respondWithResult(_0x1a0d4c,null))[_0x8562('0x46')](handleError(_0x1a0d4c,null));};exports['create']=function(_0x319f57,_0x7835f2){return db['VtigerAccount'][_0x8562('0x4b')](_0x319f57['body'],{})[_0x8562('0x28')](respondWithResult(_0x7835f2,0xc9))[_0x8562('0x46')](handleError(_0x7835f2,null));};exports[_0x8562('0x26')]=function(_0x550ba3,_0x21c448){if(_0x550ba3[_0x8562('0x4c')]['id']){delete _0x550ba3[_0x8562('0x4c')]['id'];}return db[_0x8562('0x41')]['find']({'where':{'id':_0x550ba3[_0x8562('0x48')]['id']}})[_0x8562('0x28')](handleEntityNotFound(_0x21c448,null))['then'](saveUpdates(_0x550ba3['body'],null))[_0x8562('0x28')](respondWithResult(_0x21c448,null))['catch'](handleError(_0x21c448,null));};exports[_0x8562('0x27')]=function(_0x50c8d2,_0x190c18){return db[_0x8562('0x41')]['find']({'where':{'id':_0x50c8d2[_0x8562('0x48')]['id']}})[_0x8562('0x28')](handleEntityNotFound(_0x190c18,null))[_0x8562('0x28')](removeEntity(_0x190c18,null))[_0x8562('0x46')](handleError(_0x190c18,null));};exports[_0x8562('0x4d')]=function(_0x5f223c,_0x2f8b19,_0x2623b1){var _0x1cc240={};var _0x1a2e2a={};var _0x5041b3;var _0x1be7a6;return db['VtigerAccount'][_0x8562('0x4e')]({'where':{'id':_0x5f223c[_0x8562('0x48')]['id']}})[_0x8562('0x28')](handleEntityNotFound(_0x2f8b19,null))[_0x8562('0x28')](function(_0x342e3b){if(_0x342e3b){_0x5041b3=_0x342e3b;_0x1a2e2a[_0x8562('0x32')]=_[_0x8562('0x33')](db[_0x8562('0x4f')][_0x8562('0x2e')]);_0x1a2e2a[_0x8562('0x36')]=_['keys'](_0x5f223c[_0x8562('0x36')]);_0x1a2e2a[_0x8562('0x34')]=_[_0x8562('0x35')](_0x1a2e2a[_0x8562('0x32')],_0x1a2e2a[_0x8562('0x36')]);_0x1cc240[_0x8562('0x37')]=_[_0x8562('0x35')](_0x1a2e2a[_0x8562('0x32')],qs[_0x8562('0x38')](_0x5f223c[_0x8562('0x36')]['fields']));_0x1cc240[_0x8562('0x37')]=_0x1cc240['attributes'][_0x8562('0x49')]?_0x1cc240[_0x8562('0x37')]:_0x1a2e2a[_0x8562('0x32')];_0x1cc240[_0x8562('0x3a')]=qs[_0x8562('0x3b')](_0x5f223c[_0x8562('0x36')][_0x8562('0x3b')]);_0x1cc240[_0x8562('0x3c')]=qs['filters'](_['pick'](_0x5f223c[_0x8562('0x36')],_0x1a2e2a[_0x8562('0x34')]));if(_0x5f223c[_0x8562('0x36')][_0x8562('0x3d')]){_0x1cc240[_0x8562('0x3c')]=_[_0x8562('0x3e')](_0x1cc240[_0x8562('0x3c')],{'$or':_[_0x8562('0x2d')](_0x1cc240[_0x8562('0x37')],function(_0x59c489){var _0x2f4059={};_0x2f4059[_0x59c489]={'$like':'%'+_0x5f223c[_0x8562('0x36')]['filter']+'%'};return _0x2f4059;})});}_0x1cc240=_[_0x8562('0x3e')]({},_0x1cc240,_0x5f223c['options']);return _0x5041b3['getConfigurations'](_0x1cc240);}})['then'](function(_0x5e9812){if(_0x5e9812){_0x1be7a6=_0x5e9812['length'];if(!_0x5f223c[_0x8562('0x36')][_0x8562('0x39')](_0x8562('0x50'))){_0x1cc240[_0x8562('0x1f')]=qs[_0x8562('0x1f')](_0x5f223c[_0x8562('0x36')][_0x8562('0x1f')]);_0x1cc240[_0x8562('0x1d')]=qs[_0x8562('0x1d')](_0x5f223c[_0x8562('0x36')][_0x8562('0x1d')]);}return _0x5041b3[_0x8562('0x4d')](_0x1cc240);}})[_0x8562('0x28')](function(_0x3ca216){if(_0x3ca216){return _0x3ca216?{'count':_0x1be7a6,'rows':_0x3ca216}:null;}})[_0x8562('0x28')](respondWithResult(_0x2f8b19,null))[_0x8562('0x46')](handleError(_0x2f8b19,null));};exports[_0x8562('0x51')]=function(_0x58e545,_0x357b63,_0x55031e){if(_0x58e545[_0x8562('0x4c')]['id']){delete _0x58e545[_0x8562('0x4c')]['id'];}return db['VtigerAccount'][_0x8562('0x4e')]({'where':{'id':_0x58e545['params']['id']}})['then'](handleEntityNotFound(_0x357b63,null))[_0x8562('0x28')](function(_0x2af104){if(_0x2af104){_0x58e545[_0x8562('0x4c')]['AccountId']=_0x2af104['id'];_0x58e545['body'][_0x8562('0x52')]=integrations[_0x8562('0x53')](_0x58e545['body'][_0x8562('0x54')],_0x58e545['body'][_0x8562('0x30')]);_0x58e545[_0x8562('0x4c')][_0x8562('0x55')]=integrations['getDescriptions'](_0x58e545[_0x8562('0x4c')]['channel'],_0x58e545['body'][_0x8562('0x30')]);return db['VtigerConfiguration']['create'](_0x58e545['body'],{'include':[{'model':db[_0x8562('0x56')],'as':'Subjects'},{'model':db[_0x8562('0x56')],'as':_0x8562('0x55')}]});}return null;})[_0x8562('0x28')](respondWithResult(_0x357b63,null))[_0x8562('0x46')](handleError(_0x357b63,null));};var md5=require(_0x8562('0x57'));exports[_0x8562('0x58')]=function(_0x5967f1,_0x35776f,_0x9248ee){var _0x48c728=null;var _0x495a2c=null;var _0x545580=null;var _0x1da845=null;var _0x2b6955='';return db[_0x8562('0x41')][_0x8562('0x4e')]({'where':{'id':_0x5967f1[_0x8562('0x48')]['id']},'attributes':['id','name','username',_0x8562('0x59'),_0x8562('0x5a'),'remoteUri',_0x8562('0x5b'),_0x8562('0x5c')]})[_0x8562('0x28')](handleEntityNotFound(_0x35776f,null))[_0x8562('0x28')](function(_0x23398a){if(_0x23398a){_0x48c728=_0x23398a[_0x8562('0x5d')];_0x495a2c=_0x23398a['accessKey'];_0x545580=_0x23398a['moduleName'];_0x2b6955=_0x23398a[_0x8562('0x5e')];var _0x228ca5=_0x2b6955['slice'](-0x1);if(_0x228ca5==='/'){_0x2b6955=_0x2b6955['substring'](0x0,_0x2b6955[_0x8562('0x5f')](_0x228ca5));}_0x1da845=util['format'](_0x8562('0x60'),_0x2b6955);var _0x1e4b9c={'method':_0x8562('0x61'),'uri':_0x1da845,'qs':{'operation':_0x8562('0x62'),'username':_0x23398a[_0x8562('0x5d')]},'json':!![]};return rp(_0x1e4b9c);}})[_0x8562('0x28')](function(_0x4aad4e){if(_0x4aad4e['success']){var _0x2a0f4d={'method':'POST','uri':_0x1da845,'form':{'operation':_0x8562('0x63'),'username':_0x48c728,'accessKey':md5(_0x4aad4e[_0x8562('0x64')][_0x8562('0x65')]+_0x495a2c)},'json':!![]};return rp(_0x2a0f4d);}})[_0x8562('0x28')](function(_0x589935){if(_0x589935[_0x8562('0x66')]){var _0xc3958={'method':_0x8562('0x61'),'uri':_0x1da845,'qs':{'operation':_0x8562('0x67'),'username':_0x48c728,'sessionName':_0x589935[_0x8562('0x64')]['sessionName'],'elementType':_0x545580},'json':!![]};return rp(_0xc3958);}})[_0x8562('0x28')](function(_0x59449c){if(_0x59449c[_0x8562('0x66')]){var _0x188113=['autogenerated',_0x8562('0x68'),_0x8562('0x69')];_[_0x8562('0x6a')](_0x59449c[_0x8562('0x64')][_0x8562('0x38')],function(_0x5b1791){return _0x188113[_0x8562('0x6b')](_0x5b1791[_0x8562('0x30')][_0x8562('0x2b')]);});_[_0x8562('0x6a')](_0x59449c[_0x8562('0x64')]['fields'],function(_0x546aef){return _0x546aef[_0x8562('0x6c')]===_0x8562('0x6d');});return{'count':_0x59449c['result'][_0x8562('0x38')][_0x8562('0x49')],'rows':_['map'](_0x59449c[_0x8562('0x64')][_0x8562('0x38')],function(_0x31778b){return{'id':_0x31778b[_0x8562('0x2b')],'name':_0x31778b[_0x8562('0x6e')],'custom':_[_0x8562('0x6f')](_0x31778b[_0x8562('0x2b')],_0x8562('0x70'))?!![]:![],'options':_0x31778b[_0x8562('0x30')][_0x8562('0x2b')]==='picklist'&&_0x31778b['type'][_0x8562('0x71')][_0x8562('0x49')]>0x0?_[_0x8562('0x2d')](_0x31778b[_0x8562('0x30')][_0x8562('0x71')],function(_0x1d1696){return{'name':_0x1d1696[_0x8562('0x6e')],'value':_0x1d1696['value']};}):[]};})};}})[_0x8562('0x28')](respondWithResult(_0x35776f,null))[_0x8562('0x46')](function(_0x2d7db5){console[_0x8562('0x72')]('vTiger\x20error:\x20'+_0x2d7db5);var _0x5d7811=_0x5967f1[_0x8562('0x36')][_0x8562('0x73')]?0x1f4:_0x2d7db5[_0x8562('0x74')]||0x1f4;logger[_0x8562('0x29')](_0x8562('0x75'),_0x8562('0x58'),_0x5d7811,JSON[_0x8562('0x76')](_0x2d7db5));delete _0x2d7db5[_0x8562('0x2b')];if(_0x5d7811===0x191){_0x5d7811=0x190;}_0x35776f[_0x8562('0x1c')](_0x5d7811)[_0x8562('0x77')](_0x5967f1['query'][_0x8562('0x73')]?{'message':_0x8562('0x78'),'statusCode':_0x2d7db5['statusCode']}:_0x2d7db5);});}; \ No newline at end of file +var _0x16e6=['update','destroy','getConfigurations','VtigerConfiguration','order','pick','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerField','Subjects','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','token','success','describe','result','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','then','error','stack','name','send','map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','body'];(function(_0x2726fe,_0x270860){var _0x37108e=function(_0x65dd65){while(--_0x65dd65){_0x2726fe['push'](_0x2726fe['shift']());}};_0x37108e(++_0x270860);}(_0x16e6,0x1ba));var _0x616e=function(_0x23ec06,_0x561142){_0x23ec06=_0x23ec06-0x0;var _0x2831d4=_0x16e6[_0x23ec06];return _0x2831d4;};'use strict';var emlformat=require(_0x616e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x616e('0x1'));var jsonpatch=require(_0x616e('0x2'));var rp=require(_0x616e('0x3'));var moment=require(_0x616e('0x4'));var BPromise=require(_0x616e('0x5'));var Mustache=require(_0x616e('0x6'));var util=require(_0x616e('0x7'));var path=require('path');var sox=require(_0x616e('0x8'));var csv=require(_0x616e('0x9'));var ejs=require(_0x616e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x616e('0xb'));var squel=require(_0x616e('0xc'));var crypto=require(_0x616e('0xd'));var jsforce=require(_0x616e('0xe'));var deskjs=require(_0x616e('0xf'));var toCsv=require(_0x616e('0x9'));var querystring=require(_0x616e('0x10'));var Papa=require('papaparse');var Redis=require(_0x616e('0x11'));var authService=require(_0x616e('0x12'));var qs=require(_0x616e('0x13'));var as=require(_0x616e('0x14'));var hardwareService=require(_0x616e('0x15'));var logger=require('../../config/logger')(_0x616e('0x16'));var utils=require('../../config/utils');var config=require(_0x616e('0x17'));var licenseUtil=require(_0x616e('0x18'));var db=require(_0x616e('0x19'))['db'];var integrations=require(_0x616e('0x1a'));function respondWithStatusCode(_0x3aa021,_0x34e5a9){_0x34e5a9=_0x34e5a9||0xcc;return function(_0x3cfbe9){if(_0x3cfbe9){return _0x3aa021[_0x616e('0x1b')](_0x34e5a9);}return _0x3aa021['status'](_0x34e5a9)[_0x616e('0x1c')]();};}function respondWithResult(_0xb5cd73,_0x37c1fc){_0x37c1fc=_0x37c1fc||0xc8;return function(_0xda2a20){if(_0xda2a20){return _0xb5cd73['status'](_0x37c1fc)['json'](_0xda2a20);}};}function respondWithFilteredResult(_0x2f7b31,_0x4315b7){return function(_0x274d7d){if(_0x274d7d){var _0x444be5=typeof _0x4315b7[_0x616e('0x1d')]===_0x616e('0x1e')&&typeof _0x4315b7[_0x616e('0x1f')]===_0x616e('0x1e');var _0x2c4a53=_0x274d7d[_0x616e('0x20')];var _0x136f60=_0x444be5?0x0:_0x4315b7[_0x616e('0x1d')];var _0x9bbded=_0x444be5?_0x274d7d['count']:_0x4315b7[_0x616e('0x1d')]+_0x4315b7[_0x616e('0x1f')];var _0x35406a;if(_0x9bbded>=_0x2c4a53){_0x9bbded=_0x2c4a53;_0x35406a=0xc8;}else{_0x35406a=0xce;}_0x2f7b31[_0x616e('0x21')](_0x35406a);return _0x2f7b31[_0x616e('0x22')](_0x616e('0x23'),_0x136f60+'-'+_0x9bbded+'/'+_0x2c4a53)[_0x616e('0x24')](_0x274d7d);}return null;};}function patchUpdates(_0x25c8ef){return function(_0x29c104){try{jsonpatch[_0x616e('0x25')](_0x29c104,_0x25c8ef,!![]);}catch(_0x3728c6){return BPromise[_0x616e('0x26')](_0x3728c6);}return _0x29c104['save']();};}function saveUpdates(_0x5cc71d,_0xd1cc1e){return function(_0x508338){if(_0x508338){return _0x508338['update'](_0x5cc71d)[_0x616e('0x27')](function(_0x1d9027){return _0x1d9027;});}return null;};}function removeEntity(_0x4ac358,_0x8a462e){return function(_0x2db737){if(_0x2db737){return _0x2db737['destroy']()['then'](function(){_0x4ac358[_0x616e('0x21')](0xcc)[_0x616e('0x1c')]();});}};}function handleEntityNotFound(_0x3c7e45,_0x599c20){return function(_0xc347a2){if(!_0xc347a2){_0x3c7e45[_0x616e('0x1b')](0x194);}return _0xc347a2;};}function handleError(_0x398463,_0x516aba){_0x516aba=_0x516aba||0x1f4;return function(_0x4c8908){logger[_0x616e('0x28')](_0x4c8908[_0x616e('0x29')]);if(_0x4c8908[_0x616e('0x2a')]){delete _0x4c8908[_0x616e('0x2a')];}_0x398463[_0x616e('0x21')](_0x516aba)[_0x616e('0x2b')](_0x4c8908);};}exports['index']=function(_0xdc386b,_0x127e29){var _0x501854={},_0x30127f={},_0x8d5630={'count':0x0,'rows':[]};var _0x444eba=_[_0x616e('0x2c')](db[_0x616e('0x2d')][_0x616e('0x2e')],function(_0x17f30b){return{'name':_0x17f30b[_0x616e('0x2f')],'type':_0x17f30b['type'][_0x616e('0x30')]};});_0x30127f[_0x616e('0x31')]=_[_0x616e('0x2c')](_0x444eba,_0x616e('0x2a'));_0x30127f[_0x616e('0x32')]=_[_0x616e('0x33')](_0xdc386b[_0x616e('0x32')]);_0x30127f[_0x616e('0x34')]=_[_0x616e('0x35')](_0x30127f[_0x616e('0x31')],_0x30127f['query']);_0x501854[_0x616e('0x36')]=_[_0x616e('0x35')](_0x30127f['model'],qs[_0x616e('0x37')](_0xdc386b[_0x616e('0x32')][_0x616e('0x37')]));_0x501854[_0x616e('0x36')]=_0x501854['attributes']['length']?_0x501854[_0x616e('0x36')]:_0x30127f['model'];if(!_0xdc386b[_0x616e('0x32')][_0x616e('0x38')](_0x616e('0x39'))){_0x501854[_0x616e('0x1f')]=qs[_0x616e('0x1f')](_0xdc386b[_0x616e('0x32')][_0x616e('0x1f')]);_0x501854['offset']=qs['offset'](_0xdc386b[_0x616e('0x32')][_0x616e('0x1d')]);}_0x501854['order']=qs[_0x616e('0x3a')](_0xdc386b[_0x616e('0x32')][_0x616e('0x3a')]);_0x501854['where']=qs[_0x616e('0x34')](_['pick'](_0xdc386b[_0x616e('0x32')],_0x30127f[_0x616e('0x34')]),_0x444eba);if(_0xdc386b[_0x616e('0x32')][_0x616e('0x3b')]){_0x501854['where']=_[_0x616e('0x3c')](_0x501854[_0x616e('0x3d')],{'$or':_[_0x616e('0x2c')](_0x444eba,function(_0x209af9){if(_0x209af9[_0x616e('0x3e')]!==_0x616e('0x3f')){var _0x706e30={};_0x706e30[_0x209af9[_0x616e('0x2a')]]={'$like':'%'+_0xdc386b[_0x616e('0x32')][_0x616e('0x3b')]+'%'};return _0x706e30;}})});}_0x501854=_[_0x616e('0x3c')]({},_0x501854,_0xdc386b[_0x616e('0x40')]);var _0x4f4696={'where':_0x501854[_0x616e('0x3d')]};return db[_0x616e('0x2d')][_0x616e('0x20')](_0x4f4696)['then'](function(_0x2235d1){_0x8d5630[_0x616e('0x20')]=_0x2235d1;if(_0xdc386b[_0x616e('0x32')][_0x616e('0x41')]){_0x501854[_0x616e('0x42')]=[{'all':!![]}];}return db['VtigerAccount'][_0x616e('0x43')](_0x501854);})[_0x616e('0x27')](function(_0x2067a9){_0x8d5630['rows']=_0x2067a9;return _0x8d5630;})[_0x616e('0x27')](respondWithFilteredResult(_0x127e29,_0x501854))[_0x616e('0x44')](handleError(_0x127e29,null));};exports[_0x616e('0x45')]=function(_0x7dda78,_0x1be928){var _0x7c6551={'raw':![],'where':{'id':_0x7dda78[_0x616e('0x46')]['id']}},_0x12ac9d={};_0x12ac9d['model']=_['keys'](db['VtigerAccount'][_0x616e('0x2e')]);_0x12ac9d[_0x616e('0x32')]=_['keys'](_0x7dda78[_0x616e('0x32')]);_0x12ac9d[_0x616e('0x34')]=_[_0x616e('0x35')](_0x12ac9d['model'],_0x12ac9d[_0x616e('0x32')]);_0x7c6551[_0x616e('0x36')]=_[_0x616e('0x35')](_0x12ac9d[_0x616e('0x31')],qs[_0x616e('0x37')](_0x7dda78[_0x616e('0x32')][_0x616e('0x37')]));_0x7c6551[_0x616e('0x36')]=_0x7c6551[_0x616e('0x36')][_0x616e('0x47')]?_0x7c6551[_0x616e('0x36')]:_0x12ac9d[_0x616e('0x31')];if(_0x7dda78['query'][_0x616e('0x41')]){_0x7c6551[_0x616e('0x42')]=[{'all':!![]}];}_0x7c6551=_[_0x616e('0x3c')]({},_0x7c6551,_0x7dda78[_0x616e('0x40')]);return db[_0x616e('0x2d')][_0x616e('0x48')](_0x7c6551)[_0x616e('0x27')](handleEntityNotFound(_0x1be928,null))[_0x616e('0x27')](respondWithResult(_0x1be928,null))[_0x616e('0x44')](handleError(_0x1be928,null));};exports['create']=function(_0x561c9c,_0x49769c){return db[_0x616e('0x2d')]['create'](_0x561c9c[_0x616e('0x49')],{})['then'](respondWithResult(_0x49769c,0xc9))['catch'](handleError(_0x49769c,null));};exports[_0x616e('0x4a')]=function(_0x49ee72,_0x4e6b3e){if(_0x49ee72[_0x616e('0x49')]['id']){delete _0x49ee72[_0x616e('0x49')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x49ee72[_0x616e('0x46')]['id']}})[_0x616e('0x27')](handleEntityNotFound(_0x4e6b3e,null))[_0x616e('0x27')](saveUpdates(_0x49ee72[_0x616e('0x49')],null))['then'](respondWithResult(_0x4e6b3e,null))[_0x616e('0x44')](handleError(_0x4e6b3e,null));};exports[_0x616e('0x4b')]=function(_0x121e12,_0x2c62f9){return db[_0x616e('0x2d')][_0x616e('0x48')]({'where':{'id':_0x121e12[_0x616e('0x46')]['id']}})[_0x616e('0x27')](handleEntityNotFound(_0x2c62f9,null))[_0x616e('0x27')](removeEntity(_0x2c62f9,null))['catch'](handleError(_0x2c62f9,null));};exports[_0x616e('0x4c')]=function(_0x251be3,_0x1db201,_0x32695a){var _0x452cdf={};var _0x107e4d={};var _0x10c46c;var _0x536540;return db['VtigerAccount']['findOne']({'where':{'id':_0x251be3['params']['id']}})['then'](handleEntityNotFound(_0x1db201,null))[_0x616e('0x27')](function(_0x2d35be){if(_0x2d35be){_0x10c46c=_0x2d35be;_0x107e4d[_0x616e('0x31')]=_[_0x616e('0x33')](db[_0x616e('0x4d')][_0x616e('0x2e')]);_0x107e4d[_0x616e('0x32')]=_[_0x616e('0x33')](_0x251be3[_0x616e('0x32')]);_0x107e4d['filters']=_[_0x616e('0x35')](_0x107e4d['model'],_0x107e4d[_0x616e('0x32')]);_0x452cdf[_0x616e('0x36')]=_['intersection'](_0x107e4d[_0x616e('0x31')],qs[_0x616e('0x37')](_0x251be3[_0x616e('0x32')][_0x616e('0x37')]));_0x452cdf[_0x616e('0x36')]=_0x452cdf[_0x616e('0x36')]['length']?_0x452cdf['attributes']:_0x107e4d[_0x616e('0x31')];_0x452cdf[_0x616e('0x4e')]=qs[_0x616e('0x3a')](_0x251be3[_0x616e('0x32')][_0x616e('0x3a')]);_0x452cdf[_0x616e('0x3d')]=qs[_0x616e('0x34')](_[_0x616e('0x4f')](_0x251be3[_0x616e('0x32')],_0x107e4d['filters']));if(_0x251be3[_0x616e('0x32')][_0x616e('0x3b')]){_0x452cdf[_0x616e('0x3d')]=_['merge'](_0x452cdf[_0x616e('0x3d')],{'$or':_[_0x616e('0x2c')](_0x452cdf[_0x616e('0x36')],function(_0x4faee8){var _0x54eda7={};_0x54eda7[_0x4faee8]={'$like':'%'+_0x251be3[_0x616e('0x32')][_0x616e('0x3b')]+'%'};return _0x54eda7;})});}_0x452cdf=_['merge']({},_0x452cdf,_0x251be3[_0x616e('0x40')]);return _0x10c46c[_0x616e('0x4c')](_0x452cdf);}})[_0x616e('0x27')](function(_0x3ac4fb){if(_0x3ac4fb){_0x536540=_0x3ac4fb[_0x616e('0x47')];if(!_0x251be3[_0x616e('0x32')][_0x616e('0x38')](_0x616e('0x39'))){_0x452cdf[_0x616e('0x1f')]=qs[_0x616e('0x1f')](_0x251be3['query'][_0x616e('0x1f')]);_0x452cdf[_0x616e('0x1d')]=qs[_0x616e('0x1d')](_0x251be3['query'][_0x616e('0x1d')]);}return _0x10c46c[_0x616e('0x4c')](_0x452cdf);}})['then'](function(_0x231e9b){if(_0x231e9b){return _0x231e9b?{'count':_0x536540,'rows':_0x231e9b}:null;}})['then'](respondWithResult(_0x1db201,null))['catch'](handleError(_0x1db201,null));};exports[_0x616e('0x50')]=function(_0xa27e63,_0x489ddf,_0xdf26df){if(_0xa27e63[_0x616e('0x49')]['id']){delete _0xa27e63['body']['id'];}return db[_0x616e('0x2d')][_0x616e('0x51')]({'where':{'id':_0xa27e63[_0x616e('0x46')]['id']}})[_0x616e('0x27')](handleEntityNotFound(_0x489ddf,null))[_0x616e('0x27')](function(_0x444473){if(_0x444473){_0xa27e63[_0x616e('0x49')][_0x616e('0x52')]=_0x444473['id'];_0xa27e63['body']['Subjects']=integrations[_0x616e('0x53')](_0xa27e63[_0x616e('0x49')][_0x616e('0x54')],_0xa27e63[_0x616e('0x49')][_0x616e('0x3e')]);_0xa27e63[_0x616e('0x49')][_0x616e('0x55')]=integrations[_0x616e('0x56')](_0xa27e63[_0x616e('0x49')][_0x616e('0x54')],_0xa27e63['body'][_0x616e('0x3e')]);return db['VtigerConfiguration']['create'](_0xa27e63['body'],{'include':[{'model':db[_0x616e('0x57')],'as':_0x616e('0x58')},{'model':db[_0x616e('0x57')],'as':_0x616e('0x55')}]});}return null;})[_0x616e('0x27')](respondWithResult(_0x489ddf,null))[_0x616e('0x44')](handleError(_0x489ddf,null));};var md5=require(_0x616e('0x59'));exports[_0x616e('0x5a')]=function(_0x2771d0,_0xd5ba2a,_0x26f0c0){var _0x425f4c=null;var _0x3df205=null;var _0x4fd381=null;var _0x28b4c0=null;var _0x122d41='';return db[_0x616e('0x2d')][_0x616e('0x51')]({'where':{'id':_0x2771d0[_0x616e('0x46')]['id']},'attributes':['id','name',_0x616e('0x5b'),_0x616e('0x5c'),_0x616e('0x5d'),_0x616e('0x5e'),_0x616e('0x5f'),_0x616e('0x60')]})[_0x616e('0x27')](handleEntityNotFound(_0xd5ba2a,null))[_0x616e('0x27')](function(_0x52bbcb){if(_0x52bbcb){_0x425f4c=_0x52bbcb[_0x616e('0x5b')];_0x3df205=_0x52bbcb[_0x616e('0x60')];_0x4fd381=_0x52bbcb[_0x616e('0x5d')];_0x122d41=_0x52bbcb[_0x616e('0x5e')];var _0x1b74b9=_0x122d41['slice'](-0x1);if(_0x1b74b9==='/'){_0x122d41=_0x122d41[_0x616e('0x61')](0x0,_0x122d41[_0x616e('0x62')](_0x1b74b9));}_0x28b4c0=util[_0x616e('0x63')](_0x616e('0x64'),_0x122d41);var _0x38d5e8={'method':_0x616e('0x65'),'uri':_0x28b4c0,'qs':{'operation':_0x616e('0x66'),'username':_0x52bbcb[_0x616e('0x5b')]},'json':!![]};return rp(_0x38d5e8);}})[_0x616e('0x27')](function(_0x4b9705){if(_0x4b9705['success']){var _0x5326da={'method':_0x616e('0x67'),'uri':_0x28b4c0,'form':{'operation':_0x616e('0x68'),'username':_0x425f4c,'accessKey':md5(_0x4b9705['result'][_0x616e('0x69')]+_0x3df205)},'json':!![]};return rp(_0x5326da);}})['then'](function(_0x647267){if(_0x647267[_0x616e('0x6a')]){var _0x2673e0={'method':'GET','uri':_0x28b4c0,'qs':{'operation':_0x616e('0x6b'),'username':_0x425f4c,'sessionName':_0x647267[_0x616e('0x6c')][_0x616e('0x6d')],'elementType':_0x4fd381},'json':!![]};return rp(_0x2673e0);}})[_0x616e('0x27')](function(_0x8373ff){if(_0x8373ff[_0x616e('0x6a')]){var _0x3387c8=[_0x616e('0x6e'),_0x616e('0x6f'),_0x616e('0x70')];_[_0x616e('0x71')](_0x8373ff[_0x616e('0x6c')][_0x616e('0x37')],function(_0x113022){return _0x3387c8[_0x616e('0x72')](_0x113022[_0x616e('0x3e')][_0x616e('0x2a')]);});_[_0x616e('0x71')](_0x8373ff[_0x616e('0x6c')]['fields'],function(_0x558793){return _0x558793[_0x616e('0x73')]===_0x616e('0x74');});return{'count':_0x8373ff[_0x616e('0x6c')][_0x616e('0x37')][_0x616e('0x47')],'rows':_[_0x616e('0x2c')](_0x8373ff[_0x616e('0x6c')][_0x616e('0x37')],function(_0x53b0e0){return{'id':_0x53b0e0[_0x616e('0x2a')],'name':_0x53b0e0[_0x616e('0x75')],'custom':_[_0x616e('0x76')](_0x53b0e0[_0x616e('0x2a')],_0x616e('0x77'))?!![]:![],'options':_0x53b0e0[_0x616e('0x3e')]['name']===_0x616e('0x78')&&_0x53b0e0['type']['picklistValues'][_0x616e('0x47')]>0x0?_[_0x616e('0x2c')](_0x53b0e0['type'][_0x616e('0x79')],function(_0x3e9ff3){return{'name':_0x3e9ff3[_0x616e('0x75')],'value':_0x3e9ff3['value']};}):[]};})};}})[_0x616e('0x27')](respondWithResult(_0xd5ba2a,null))[_0x616e('0x44')](function(_0x45e95b){console[_0x616e('0x7a')](_0x616e('0x7b')+_0x45e95b);var _0x12b1c9=_0x2771d0['query'][_0x616e('0x7c')]?0x1f4:_0x45e95b['statusCode']||0x1f4;logger[_0x616e('0x28')](_0x616e('0x7d'),_0x616e('0x5a'),_0x12b1c9,JSON[_0x616e('0x7e')](_0x45e95b));delete _0x45e95b['name'];if(_0x12b1c9===0x191){_0x12b1c9=0x190;}_0xd5ba2a[_0x616e('0x21')](_0x12b1c9)[_0x616e('0x2b')](_0x2771d0[_0x616e('0x32')][_0x616e('0x7c')]?{'message':_0x616e('0x7f'),'statusCode':_0x45e95b[_0x616e('0x80')]}:_0x45e95b);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 9ea1d5e..449822b 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 _0x1e11=['../../config/logger','api','moment','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1e11,0xe4));var _0x11e1=function(_0xa1c700,_0x2b7abf){_0xa1c700=_0xa1c700-0x0;var _0x35da71=_0x1e11[_0xa1c700];return _0x35da71;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x11e1('0x0'))(_0x11e1('0x1'));var moment=require(_0x11e1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x11e1('0x3'));var rimraf=require(_0x11e1('0x4'));var config=require(_0x11e1('0x5'));var attributes=require(_0x11e1('0x6'));var integrations=require(_0x11e1('0x7'));module[_0x11e1('0x8')]=function(_0x5a810d,_0xa1c9f9){return _0x5a810d[_0x11e1('0x9')](_0x11e1('0xa'),attributes,{'tableName':_0x11e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe29=['request-promise','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','lodash','../../config/logger','api','moment'];(function(_0x3d4cdb,_0x190628){var _0x27ea48=function(_0x4dbea0){while(--_0x4dbea0){_0x3d4cdb['push'](_0x3d4cdb['shift']());}};_0x27ea48(++_0x190628);}(_0xfe29,0xf9));var _0x9fe2=function(_0x50f9a0,_0x2ccdfb){_0x50f9a0=_0x50f9a0-0x0;var _0x233152=_0xfe29[_0x50f9a0];return _0x233152;};'use strict';var _=require(_0x9fe2('0x0'));var util=require('util');var logger=require(_0x9fe2('0x1'))(_0x9fe2('0x2'));var moment=require(_0x9fe2('0x3'));var BPromise=require('bluebird');var rp=require(_0x9fe2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9fe2('0x5'));var config=require('../../config/environment');var attributes=require(_0x9fe2('0x6'));var integrations=require(_0x9fe2('0x7'));module[_0x9fe2('0x8')]=function(_0x14b0da,_0x475993){return _0x14b0da[_0x9fe2('0x9')](_0x9fe2('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 ac4d45a..f90c564 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 _0xac4a=['info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','include','model','attributes','map','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then'];(function(_0x3da920,_0x1c7d2c){var _0xb9ef8a=function(_0x44fdd0){while(--_0x44fdd0){_0x3da920['push'](_0x3da920['shift']());}};_0xb9ef8a(++_0x1c7d2c);}(_0xac4a,0x13f));var _0xaac4=function(_0x4b0cf3,_0x552943){_0x4b0cf3=_0x4b0cf3-0x0;var _0xd46326=_0xac4a[_0x4b0cf3];return _0xd46326;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}exports[_0xaac4('0x15')]=function(_0x52085a){var _0x220630=this;return new Promise(function(_0x5b6fd6,_0x3ce35a){return db[_0xaac4('0x16')][_0xaac4('0x17')]({'raw':_0x52085a[_0xaac4('0x18')]?_0x52085a[_0xaac4('0x18')][_0xaac4('0x19')]===undefined?!![]:![]:!![],'where':_0x52085a[_0xaac4('0x18')]?_0x52085a[_0xaac4('0x18')][_0xaac4('0x1a')]||null:null,'attributes':_0x52085a['options']?_0x52085a[_0xaac4('0x18')]['attributes']||null:null,'limit':_0x52085a[_0xaac4('0x18')]?_0x52085a[_0xaac4('0x18')][_0xaac4('0x1b')]||null:null,'include':_0x52085a[_0xaac4('0x18')]?_0x52085a[_0xaac4('0x18')][_0xaac4('0x1c')]?_['map'](_0x52085a[_0xaac4('0x18')][_0xaac4('0x1c')],function(_0x174860){return{'model':db[_0x174860[_0xaac4('0x1d')]],'as':_0x174860['as'],'attributes':_0x174860[_0xaac4('0x1e')],'include':_0x174860[_0xaac4('0x1c')]?_[_0xaac4('0x1f')](_0x174860['include'],function(_0x24186b){return{'model':db[_0x24186b['model']],'as':_0x24186b['as'],'attributes':_0x24186b['attributes'],'include':_0x24186b['include']?_['map'](_0x24186b[_0xaac4('0x1c')],function(_0x17d25f){return{'model':db[_0x17d25f[_0xaac4('0x1d')]],'as':_0x17d25f['as'],'attributes':_0x17d25f[_0xaac4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaac4('0xa')](function(_0x249a5d){logger[_0xaac4('0xb')](_0xaac4('0x15'),_0x52085a);logger[_0xaac4('0xc')](_0xaac4('0x15'),_0x52085a,JSON['stringify'](_0x249a5d));_0x5b6fd6(_0x249a5d);})[_0xaac4('0x14')](function(_0x16b33c){logger[_0xaac4('0x10')](_0xaac4('0x15'),_0x16b33c[_0xaac4('0x12')],_0x52085a);_0x3ce35a(_0x220630[_0xaac4('0x10')](0x1f4,_0x16b33c['message']));});});};exports[_0xaac4('0x20')]=function(_0x5d2c9a){var _0x2df7e3=this;return new Promise(function(_0xab5d04,_0x182343){return db[_0xaac4('0x16')]['find']({'raw':_0x5d2c9a['options']?_0x5d2c9a['options'][_0xaac4('0x19')]===undefined?!![]:![]:!![],'where':_0x5d2c9a[_0xaac4('0x18')]?_0x5d2c9a[_0xaac4('0x18')][_0xaac4('0x1a')]||null:null,'attributes':_0x5d2c9a[_0xaac4('0x18')]?_0x5d2c9a[_0xaac4('0x18')][_0xaac4('0x1e')]||null:null,'include':_0x5d2c9a[_0xaac4('0x18')]?_0x5d2c9a[_0xaac4('0x18')][_0xaac4('0x1c')]?_[_0xaac4('0x1f')](_0x5d2c9a[_0xaac4('0x18')][_0xaac4('0x1c')],function(_0x3b93e5){return{'model':db[_0x3b93e5[_0xaac4('0x1d')]],'as':_0x3b93e5['as'],'attributes':_0x3b93e5['attributes'],'include':_0x3b93e5['include']?_[_0xaac4('0x1f')](_0x3b93e5[_0xaac4('0x1c')],function(_0xa07d0){return{'model':db[_0xa07d0['model']],'as':_0xa07d0['as'],'attributes':_0xa07d0[_0xaac4('0x1e')],'include':_0xa07d0[_0xaac4('0x1c')]?_[_0xaac4('0x1f')](_0xa07d0[_0xaac4('0x1c')],function(_0x1ec59d){return{'model':db[_0x1ec59d[_0xaac4('0x1d')]],'as':_0x1ec59d['as'],'attributes':_0x1ec59d[_0xaac4('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36591a){logger[_0xaac4('0xb')](_0xaac4('0x20'),_0x5d2c9a);logger['debug'](_0xaac4('0x20'),_0x5d2c9a,JSON['stringify'](_0x36591a));_0xab5d04(_0x36591a);})['catch'](function(_0x344d05){logger[_0xaac4('0x10')](_0xaac4('0x20'),_0x344d05['message'],_0x5d2c9a);_0x182343(_0x2df7e3['error'](0x1f4,_0x344d05[_0xaac4('0x12')]));});});}; \ No newline at end of file +var _0xf4eb=['VtigerAccount','findAll','options','where','attributes','limit','map','model','include','find','raw','ShowVtigerAccount','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVtigerAccount'];(function(_0x222608,_0x5ecde4){var _0x250b73=function(_0x3462be){while(--_0x3462be){_0x222608['push'](_0x222608['shift']());}};_0x250b73(++_0x5ecde4);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4a0d5b,_0x23021a){_0x4a0d5b=_0x4a0d5b-0x0;var _0x3a1e35=_0xf4eb[_0x4a0d5b];return _0x3a1e35;};'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')]('VtigerAccount,\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')]('VtigerAccount,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}exports[_0xbf4e('0x13')]=function(_0x577c27){var _0x5db03f=this;return new Promise(function(_0x566ec3,_0x4f8762){return db[_0xbf4e('0x14')][_0xbf4e('0x15')]({'raw':_0x577c27[_0xbf4e('0x16')]?_0x577c27['options']['raw']===undefined?!![]:![]:!![],'where':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x17')]||null:null,'attributes':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x18')]||null:null,'limit':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x19')]||null:null,'include':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')]['include']?_[_0xbf4e('0x1a')](_0x577c27[_0xbf4e('0x16')]['include'],function(_0x31e3f5){return{'model':db[_0x31e3f5[_0xbf4e('0x1b')]],'as':_0x31e3f5['as'],'attributes':_0x31e3f5[_0xbf4e('0x18')],'include':_0x31e3f5[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x31e3f5['include'],function(_0x90635e){return{'model':db[_0x90635e[_0xbf4e('0x1b')]],'as':_0x90635e['as'],'attributes':_0x90635e[_0xbf4e('0x18')],'include':_0x90635e['include']?_[_0xbf4e('0x1a')](_0x90635e['include'],function(_0x5bcf71){return{'model':db[_0x5bcf71[_0xbf4e('0x1b')]],'as':_0x5bcf71['as'],'attributes':_0x5bcf71['attributes']};}):[]};}):[]};}):[]:[]})[_0xbf4e('0x9')](function(_0x315df3){logger[_0xbf4e('0xa')](_0xbf4e('0x13'),_0x577c27);logger['debug'](_0xbf4e('0x13'),_0x577c27,JSON[_0xbf4e('0xe')](_0x315df3));_0x566ec3(_0x315df3);})[_0xbf4e('0x12')](function(_0x4cd4a1){logger[_0xbf4e('0xf')]('GetVtigerAccount',_0x4cd4a1[_0xbf4e('0x11')],_0x577c27);_0x4f8762(_0x5db03f[_0xbf4e('0xf')](0x1f4,_0x4cd4a1[_0xbf4e('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x1d12e2){var _0x362716=this;return new Promise(function(_0x2f3cf8,_0xc7ca87){return db[_0xbf4e('0x14')][_0xbf4e('0x1d')]({'raw':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')][_0xbf4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')][_0xbf4e('0x17')]||null:null,'attributes':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')]['attributes']||null:null,'include':_0x1d12e2[_0xbf4e('0x16')]?_0x1d12e2['options'][_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x1d12e2[_0xbf4e('0x16')]['include'],function(_0x2716b7){return{'model':db[_0x2716b7[_0xbf4e('0x1b')]],'as':_0x2716b7['as'],'attributes':_0x2716b7[_0xbf4e('0x18')],'include':_0x2716b7[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x2716b7[_0xbf4e('0x1c')],function(_0x5b8440){return{'model':db[_0x5b8440[_0xbf4e('0x1b')]],'as':_0x5b8440['as'],'attributes':_0x5b8440[_0xbf4e('0x18')],'include':_0x5b8440[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x5b8440[_0xbf4e('0x1c')],function(_0x5b7ea1){return{'model':db[_0x5b7ea1['model']],'as':_0x5b7ea1['as'],'attributes':_0x5b7ea1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x429c07){logger[_0xbf4e('0xa')](_0xbf4e('0x1f'),_0x1d12e2);logger[_0xbf4e('0xd')](_0xbf4e('0x1f'),_0x1d12e2,JSON[_0xbf4e('0xe')](_0x429c07));_0x2f3cf8(_0x429c07);})[_0xbf4e('0x12')](function(_0x467b74){logger[_0xbf4e('0xf')]('ShowVtigerAccount',_0x467b74['message'],_0x1d12e2);_0xc7ca87(_0x362716[_0xbf4e('0xf')](0x1f4,_0x467b74[_0xbf4e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index a3e38f7..877f343 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 _0x0718=['../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x0718,0xe0));var _0x8071=function(_0x14b4c1,_0x587f60){_0x14b4c1=_0x14b4c1-0x0;var _0x40c266=_0x0718[_0x14b4c1];return _0x40c266;};'use strict';var multer=require('multer');var util=require(_0x8071('0x0'));var path=require(_0x8071('0x1'));var timeout=require(_0x8071('0x2'));var express=require('express');var router=express[_0x8071('0x3')]();var fs_extra=require(_0x8071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8071('0x5'));var config=require(_0x8071('0x6'));var controller=require(_0x8071('0x7'));router['get']('/',auth[_0x8071('0x8')](),controller[_0x8071('0x9')]);router[_0x8071('0xa')]('/:id',auth[_0x8071('0x8')](),controller['show']);router['get'](_0x8071('0xb'),auth[_0x8071('0x8')](),controller[_0x8071('0xc')]);router[_0x8071('0xa')](_0x8071('0xd'),auth[_0x8071('0x8')](),controller[_0x8071('0xe')]);router[_0x8071('0xa')](_0x8071('0xf'),auth[_0x8071('0x8')](),controller[_0x8071('0x10')]);router['post']('/',auth[_0x8071('0x8')](),controller[_0x8071('0x11')]);router[_0x8071('0x12')](_0x8071('0x13'),auth['isAuthenticated'](),controller[_0x8071('0x14')]);router['delete'](_0x8071('0x13'),auth[_0x8071('0x8')](),controller[_0x8071('0x15')]);module[_0x8071('0x16')]=router; \ No newline at end of file +var _0xd5a1=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','delete','destroy','exports','multer','util'];(function(_0x116f7f,_0x4515ef){var _0xcefefb=function(_0x2ba183){while(--_0x2ba183){_0x116f7f['push'](_0x116f7f['shift']());}};_0xcefefb(++_0x4515ef);}(_0xd5a1,0x16a));var _0x1d5a=function(_0x1325c6,_0x69d973){_0x1325c6=_0x1325c6-0x0;var _0x202425=_0xd5a1[_0x1325c6];return _0x202425;};'use strict';var multer=require(_0x1d5a('0x0'));var util=require(_0x1d5a('0x1'));var path=require(_0x1d5a('0x2'));var timeout=require(_0x1d5a('0x3'));var express=require(_0x1d5a('0x4'));var router=express[_0x1d5a('0x5')]();var fs_extra=require(_0x1d5a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1d5a('0x7'));var config=require(_0x1d5a('0x8'));var controller=require(_0x1d5a('0x9'));router[_0x1d5a('0xa')]('/',auth[_0x1d5a('0xb')](),controller[_0x1d5a('0xc')]);router['get'](_0x1d5a('0xd'),auth[_0x1d5a('0xb')](),controller[_0x1d5a('0xe')]);router[_0x1d5a('0xa')](_0x1d5a('0xf'),auth[_0x1d5a('0xb')](),controller[_0x1d5a('0x10')]);router[_0x1d5a('0xa')](_0x1d5a('0x11'),auth['isAuthenticated'](),controller[_0x1d5a('0x12')]);router[_0x1d5a('0xa')](_0x1d5a('0x13'),auth['isAuthenticated'](),controller[_0x1d5a('0x14')]);router[_0x1d5a('0x15')]('/',auth[_0x1d5a('0xb')](),controller['create']);router['put'](_0x1d5a('0xd'),auth['isAuthenticated'](),controller[_0x1d5a('0x16')]);router[_0x1d5a('0x17')](_0x1d5a('0xd'),auth[_0x1d5a('0xb')](),controller[_0x1d5a('0x18')]);module[_0x1d5a('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 7b5fbfd..bc51af5 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 _0x2aa2=['exports','STRING','sequelize'];(function(_0x534147,_0x26bebf){var _0xb12f5=function(_0x14dc93){while(--_0x14dc93){_0x534147['push'](_0x534147['shift']());}};_0xb12f5(++_0x26bebf);}(_0x2aa2,0x161));var _0x22aa=function(_0x3e0991,_0x4f7df4){_0x3e0991=_0x3e0991-0x0;var _0xea4798=_0x2aa2[_0x3e0991];return _0xea4798;};'use strict';var Sequelize=require(_0x22aa('0x0'));module[_0x22aa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x22aa('0x2')]}}; \ No newline at end of file +var _0x5f7b=['exports','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5f7b,0x13b));var _0xb5f7=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x5f7b[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0xb5f7('0x0'));module[_0xb5f7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index fa7874e..81072e8 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 _0x1105=['squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','keys','include','find','create','body','params','findOne','VtigerField','length','getSubjects','pick','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1105,0x124));var _0x5110=function(_0x4bbc15,_0x5ed722){_0x4bbc15=_0x4bbc15-0x0;var _0x192991=_0x1105[_0x4bbc15];return _0x192991;};'use strict';var emlformat=require(_0x5110('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5110('0x1'));var jsonpatch=require(_0x5110('0x2'));var rp=require(_0x5110('0x3'));var moment=require(_0x5110('0x4'));var BPromise=require(_0x5110('0x5'));var Mustache=require(_0x5110('0x6'));var util=require('util');var path=require(_0x5110('0x7'));var sox=require(_0x5110('0x8'));var csv=require(_0x5110('0x9'));var ejs=require(_0x5110('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5110('0xb'));var squel=require(_0x5110('0xc'));var crypto=require(_0x5110('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5110('0x9'));var querystring=require(_0x5110('0xe'));var Papa=require(_0x5110('0xf'));var Redis=require(_0x5110('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5110('0x11'));var as=require(_0x5110('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5110('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5110('0x14'))['db'];function respondWithStatusCode(_0x18395b,_0x3a8828){_0x3a8828=_0x3a8828||0xcc;return function(_0x558c34){if(_0x558c34){return _0x18395b[_0x5110('0x15')](_0x3a8828);}return _0x18395b[_0x5110('0x16')](_0x3a8828)['end']();};}function respondWithResult(_0x8435e5,_0x5220bd){_0x5220bd=_0x5220bd||0xc8;return function(_0x51dad2){if(_0x51dad2){return _0x8435e5[_0x5110('0x16')](_0x5220bd)[_0x5110('0x17')](_0x51dad2);}};}function respondWithFilteredResult(_0x3355bb,_0x3d05ef){return function(_0x3f0cbe){if(_0x3f0cbe){var _0x239aa0=typeof _0x3d05ef[_0x5110('0x18')]==='undefined'&&typeof _0x3d05ef['limit']==='undefined';var _0x40e2fc=_0x3f0cbe[_0x5110('0x19')];var _0x1f49b9=_0x239aa0?0x0:_0x3d05ef[_0x5110('0x18')];var _0x48f42b=_0x239aa0?_0x3f0cbe[_0x5110('0x19')]:_0x3d05ef['offset']+_0x3d05ef[_0x5110('0x1a')];var _0x258dc6;if(_0x48f42b>=_0x40e2fc){_0x48f42b=_0x40e2fc;_0x258dc6=0xc8;}else{_0x258dc6=0xce;}_0x3355bb['status'](_0x258dc6);return _0x3355bb[_0x5110('0x1b')](_0x5110('0x1c'),_0x1f49b9+'-'+_0x48f42b+'/'+_0x40e2fc)[_0x5110('0x17')](_0x3f0cbe);}return null;};}function patchUpdates(_0x4cdaf1){return function(_0xf460ea){try{jsonpatch[_0x5110('0x1d')](_0xf460ea,_0x4cdaf1,!![]);}catch(_0x4788a9){return BPromise[_0x5110('0x1e')](_0x4788a9);}return _0xf460ea[_0x5110('0x1f')]();};}function saveUpdates(_0x3adf6d,_0x4180e8){return function(_0x20cb2a){if(_0x20cb2a){return _0x20cb2a[_0x5110('0x20')](_0x3adf6d)[_0x5110('0x21')](function(_0x47a91b){return _0x47a91b;});}return null;};}function removeEntity(_0x20be50,_0x293b30){return function(_0x3a56e6){if(_0x3a56e6){return _0x3a56e6[_0x5110('0x22')]()[_0x5110('0x21')](function(){_0x20be50[_0x5110('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aef6c,_0x50bd63){return function(_0x5e4ec6){if(!_0x5e4ec6){_0x4aef6c[_0x5110('0x15')](0x194);}return _0x5e4ec6;};}function handleError(_0x2b783a,_0x224ca2){_0x224ca2=_0x224ca2||0x1f4;return function(_0x13a7c2){logger[_0x5110('0x23')](_0x13a7c2[_0x5110('0x24')]);if(_0x13a7c2[_0x5110('0x25')]){delete _0x13a7c2[_0x5110('0x25')];}_0x2b783a[_0x5110('0x16')](_0x224ca2)[_0x5110('0x26')](_0x13a7c2);};}exports['index']=function(_0xd86d86,_0x107a43){var _0x4ad05f={},_0x123311={},_0x45cb3a={'count':0x0,'rows':[]};var _0x1704c3=_[_0x5110('0x27')](db[_0x5110('0x28')][_0x5110('0x29')],function(_0x4ff948){return{'name':_0x4ff948[_0x5110('0x2a')],'type':_0x4ff948[_0x5110('0x2b')][_0x5110('0x2c')]};});_0x123311[_0x5110('0x2d')]=_['map'](_0x1704c3,_0x5110('0x25'));_0x123311['query']=_['keys'](_0xd86d86['query']);_0x123311['filters']=_[_0x5110('0x2e')](_0x123311['model'],_0x123311[_0x5110('0x2f')]);_0x4ad05f[_0x5110('0x30')]=_['intersection'](_0x123311[_0x5110('0x2d')],qs[_0x5110('0x31')](_0xd86d86[_0x5110('0x2f')]['fields']));_0x4ad05f['attributes']=_0x4ad05f[_0x5110('0x30')]['length']?_0x4ad05f[_0x5110('0x30')]:_0x123311[_0x5110('0x2d')];if(!_0xd86d86[_0x5110('0x2f')][_0x5110('0x32')](_0x5110('0x33'))){_0x4ad05f[_0x5110('0x1a')]=qs[_0x5110('0x1a')](_0xd86d86[_0x5110('0x2f')]['limit']);_0x4ad05f[_0x5110('0x18')]=qs[_0x5110('0x18')](_0xd86d86['query'][_0x5110('0x18')]);}_0x4ad05f[_0x5110('0x34')]=qs[_0x5110('0x35')](_0xd86d86['query'][_0x5110('0x35')]);_0x4ad05f[_0x5110('0x36')]=qs[_0x5110('0x37')](_['pick'](_0xd86d86['query'],_0x123311[_0x5110('0x37')]),_0x1704c3);if(_0xd86d86[_0x5110('0x2f')][_0x5110('0x38')]){_0x4ad05f[_0x5110('0x36')]=_[_0x5110('0x39')](_0x4ad05f['where'],{'$or':_['map'](_0x1704c3,function(_0x1e13ad){if(_0x1e13ad['type']!==_0x5110('0x3a')){var _0x5cfd77={};_0x5cfd77[_0x1e13ad[_0x5110('0x25')]]={'$like':'%'+_0xd86d86[_0x5110('0x2f')][_0x5110('0x38')]+'%'};return _0x5cfd77;}})});}_0x4ad05f=_[_0x5110('0x39')]({},_0x4ad05f,_0xd86d86[_0x5110('0x3b')]);var _0x4867fb={'where':_0x4ad05f['where']};return db[_0x5110('0x28')][_0x5110('0x19')](_0x4867fb)['then'](function(_0x30df61){_0x45cb3a[_0x5110('0x19')]=_0x30df61;if(_0xd86d86[_0x5110('0x2f')][_0x5110('0x3c')]){_0x4ad05f['include']=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x4ad05f);})[_0x5110('0x21')](function(_0x414fda){_0x45cb3a[_0x5110('0x3d')]=_0x414fda;return _0x45cb3a;})['then'](respondWithFilteredResult(_0x107a43,_0x4ad05f))[_0x5110('0x3e')](handleError(_0x107a43,null));};exports[_0x5110('0x3f')]=function(_0x1467db,_0xbb130b){var _0x418f54={'raw':![],'where':{'id':_0x1467db['params']['id']}},_0x2af5be={};_0x2af5be['model']=_[_0x5110('0x40')](db[_0x5110('0x28')][_0x5110('0x29')]);_0x2af5be[_0x5110('0x2f')]=_[_0x5110('0x40')](_0x1467db[_0x5110('0x2f')]);_0x2af5be[_0x5110('0x37')]=_[_0x5110('0x2e')](_0x2af5be[_0x5110('0x2d')],_0x2af5be[_0x5110('0x2f')]);_0x418f54[_0x5110('0x30')]=_[_0x5110('0x2e')](_0x2af5be[_0x5110('0x2d')],qs[_0x5110('0x31')](_0x1467db[_0x5110('0x2f')][_0x5110('0x31')]));_0x418f54[_0x5110('0x30')]=_0x418f54[_0x5110('0x30')]['length']?_0x418f54[_0x5110('0x30')]:_0x2af5be[_0x5110('0x2d')];if(_0x1467db[_0x5110('0x2f')][_0x5110('0x3c')]){_0x418f54[_0x5110('0x41')]=[{'all':!![]}];}_0x418f54=_[_0x5110('0x39')]({},_0x418f54,_0x1467db[_0x5110('0x3b')]);return db[_0x5110('0x28')][_0x5110('0x42')](_0x418f54)[_0x5110('0x21')](handleEntityNotFound(_0xbb130b,null))['then'](respondWithResult(_0xbb130b,null))['catch'](handleError(_0xbb130b,null));};exports['create']=function(_0x1dafe3,_0x2d80e4){return db['VtigerConfiguration'][_0x5110('0x43')](_0x1dafe3[_0x5110('0x44')],{})[_0x5110('0x21')](respondWithResult(_0x2d80e4,0xc9))[_0x5110('0x3e')](handleError(_0x2d80e4,null));};exports[_0x5110('0x20')]=function(_0x5541ad,_0x28c512){if(_0x5541ad[_0x5110('0x44')]['id']){delete _0x5541ad[_0x5110('0x44')]['id'];}return db[_0x5110('0x28')]['find']({'where':{'id':_0x5541ad[_0x5110('0x45')]['id']}})[_0x5110('0x21')](handleEntityNotFound(_0x28c512,null))[_0x5110('0x21')](saveUpdates(_0x5541ad['body'],null))[_0x5110('0x21')](respondWithResult(_0x28c512,null))[_0x5110('0x3e')](handleError(_0x28c512,null));};exports[_0x5110('0x22')]=function(_0x36798e,_0x369d5c){return db['VtigerConfiguration'][_0x5110('0x42')]({'where':{'id':_0x36798e[_0x5110('0x45')]['id']}})[_0x5110('0x21')](handleEntityNotFound(_0x369d5c,null))['then'](removeEntity(_0x369d5c,null))['catch'](handleError(_0x369d5c,null));};exports['getFields']=function(_0x536c14,_0x2318ef,_0x2ecc71){var _0x395fe5={};var _0x41d750={};var _0x4f67c9;var _0xb54cdc;return db[_0x5110('0x28')][_0x5110('0x46')]({'where':{'id':_0x536c14[_0x5110('0x45')]['id']}})[_0x5110('0x21')](handleEntityNotFound(_0x2318ef,null))[_0x5110('0x21')](function(_0x4907dd){if(_0x4907dd){_0x4f67c9=_0x4907dd;_0x41d750[_0x5110('0x2d')]=_[_0x5110('0x40')](db[_0x5110('0x47')][_0x5110('0x29')]);_0x41d750[_0x5110('0x2f')]=_[_0x5110('0x40')](_0x536c14[_0x5110('0x2f')]);_0x41d750[_0x5110('0x37')]=_['intersection'](_0x41d750[_0x5110('0x2d')],_0x41d750['query']);_0x395fe5['attributes']=_[_0x5110('0x2e')](_0x41d750[_0x5110('0x2d')],qs[_0x5110('0x31')](_0x536c14['query'][_0x5110('0x31')]));_0x395fe5[_0x5110('0x30')]=_0x395fe5[_0x5110('0x30')][_0x5110('0x48')]?_0x395fe5[_0x5110('0x30')]:_0x41d750[_0x5110('0x2d')];_0x395fe5['order']=qs[_0x5110('0x35')](_0x536c14[_0x5110('0x2f')][_0x5110('0x35')]);_0x395fe5[_0x5110('0x36')]=qs[_0x5110('0x37')](_['pick'](_0x536c14['query'],_0x41d750[_0x5110('0x37')]));if(_0x536c14['query']['filter']){_0x395fe5['where']=_[_0x5110('0x39')](_0x395fe5[_0x5110('0x36')],{'$or':_[_0x5110('0x27')](_0x395fe5[_0x5110('0x30')],function(_0x1d5944){var _0x2747f1={};_0x2747f1[_0x1d5944]={'$like':'%'+_0x536c14[_0x5110('0x2f')][_0x5110('0x38')]+'%'};return _0x2747f1;})});}_0x395fe5=_['merge']({},_0x395fe5,_0x536c14[_0x5110('0x3b')]);return _0x4f67c9['getFields'](_0x395fe5);}})[_0x5110('0x21')](function(_0xc46944){if(_0xc46944){_0xb54cdc=_0xc46944[_0x5110('0x48')];if(!_0x536c14[_0x5110('0x2f')][_0x5110('0x32')]('nolimit')){_0x395fe5['limit']=qs[_0x5110('0x1a')](_0x536c14[_0x5110('0x2f')]['limit']);_0x395fe5[_0x5110('0x18')]=qs[_0x5110('0x18')](_0x536c14[_0x5110('0x2f')][_0x5110('0x18')]);}return _0x4f67c9['getFields'](_0x395fe5);}})['then'](function(_0x1de2f3){if(_0x1de2f3){return _0x1de2f3?{'count':_0xb54cdc,'rows':_0x1de2f3}:null;}})[_0x5110('0x21')](respondWithResult(_0x2318ef,null))[_0x5110('0x3e')](handleError(_0x2318ef,null));};exports[_0x5110('0x49')]=function(_0x124e27,_0xb01f04,_0x5ce839){var _0x5635dd={};var _0x38d6c8={};var _0x3ee5c6;var _0x390775;return db['VtigerConfiguration'][_0x5110('0x46')]({'where':{'id':_0x124e27[_0x5110('0x45')]['id']}})['then'](handleEntityNotFound(_0xb01f04,null))[_0x5110('0x21')](function(_0x182699){if(_0x182699){_0x3ee5c6=_0x182699;_0x38d6c8['model']=_[_0x5110('0x40')](db[_0x5110('0x47')]['rawAttributes']);_0x38d6c8[_0x5110('0x2f')]=_[_0x5110('0x40')](_0x124e27[_0x5110('0x2f')]);_0x38d6c8[_0x5110('0x37')]=_[_0x5110('0x2e')](_0x38d6c8[_0x5110('0x2d')],_0x38d6c8[_0x5110('0x2f')]);_0x5635dd[_0x5110('0x30')]=_[_0x5110('0x2e')](_0x38d6c8[_0x5110('0x2d')],qs['fields'](_0x124e27[_0x5110('0x2f')][_0x5110('0x31')]));_0x5635dd[_0x5110('0x30')]=_0x5635dd[_0x5110('0x30')]['length']?_0x5635dd['attributes']:_0x38d6c8[_0x5110('0x2d')];_0x5635dd[_0x5110('0x34')]=qs[_0x5110('0x35')](_0x124e27[_0x5110('0x2f')][_0x5110('0x35')]);_0x5635dd[_0x5110('0x36')]=qs[_0x5110('0x37')](_[_0x5110('0x4a')](_0x124e27['query'],_0x38d6c8[_0x5110('0x37')]));if(_0x124e27[_0x5110('0x2f')][_0x5110('0x38')]){_0x5635dd[_0x5110('0x36')]=_[_0x5110('0x39')](_0x5635dd['where'],{'$or':_[_0x5110('0x27')](_0x5635dd[_0x5110('0x30')],function(_0x1f9856){var _0x32003a={};_0x32003a[_0x1f9856]={'$like':'%'+_0x124e27[_0x5110('0x2f')][_0x5110('0x38')]+'%'};return _0x32003a;})});}_0x5635dd=_['merge']({},_0x5635dd,_0x124e27['options']);return _0x3ee5c6['getSubjects'](_0x5635dd);}})[_0x5110('0x21')](function(_0x49d992){if(_0x49d992){_0x390775=_0x49d992[_0x5110('0x48')];if(!_0x124e27[_0x5110('0x2f')]['hasOwnProperty'](_0x5110('0x33'))){_0x5635dd[_0x5110('0x1a')]=qs[_0x5110('0x1a')](_0x124e27[_0x5110('0x2f')]['limit']);_0x5635dd[_0x5110('0x18')]=qs[_0x5110('0x18')](_0x124e27[_0x5110('0x2f')][_0x5110('0x18')]);}return _0x3ee5c6[_0x5110('0x49')](_0x5635dd);}})['then'](function(_0x58e1d3){if(_0x58e1d3){return _0x58e1d3?{'count':_0x390775,'rows':_0x58e1d3}:null;}})[_0x5110('0x21')](respondWithResult(_0xb01f04,null))[_0x5110('0x3e')](handleError(_0xb01f04,null));};exports[_0x5110('0x4b')]=function(_0x2d6a51,_0x2ba849,_0x3fe140){var _0x358efa={};var _0xe1378b={};var _0x52e1d4;var _0x12eed4;return db[_0x5110('0x28')][_0x5110('0x46')]({'where':{'id':_0x2d6a51[_0x5110('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ba849,null))[_0x5110('0x21')](function(_0x221437){if(_0x221437){_0x52e1d4=_0x221437;_0xe1378b['model']=_[_0x5110('0x40')](db['VtigerField']['rawAttributes']);_0xe1378b['query']=_[_0x5110('0x40')](_0x2d6a51[_0x5110('0x2f')]);_0xe1378b[_0x5110('0x37')]=_[_0x5110('0x2e')](_0xe1378b['model'],_0xe1378b[_0x5110('0x2f')]);_0x358efa[_0x5110('0x30')]=_[_0x5110('0x2e')](_0xe1378b['model'],qs[_0x5110('0x31')](_0x2d6a51[_0x5110('0x2f')]['fields']));_0x358efa['attributes']=_0x358efa[_0x5110('0x30')][_0x5110('0x48')]?_0x358efa[_0x5110('0x30')]:_0xe1378b[_0x5110('0x2d')];_0x358efa['order']=qs[_0x5110('0x35')](_0x2d6a51[_0x5110('0x2f')][_0x5110('0x35')]);_0x358efa[_0x5110('0x36')]=qs[_0x5110('0x37')](_['pick'](_0x2d6a51[_0x5110('0x2f')],_0xe1378b[_0x5110('0x37')]));if(_0x2d6a51['query']['filter']){_0x358efa['where']=_[_0x5110('0x39')](_0x358efa[_0x5110('0x36')],{'$or':_[_0x5110('0x27')](_0x358efa[_0x5110('0x30')],function(_0x310042){var _0x4424d1={};_0x4424d1[_0x310042]={'$like':'%'+_0x2d6a51[_0x5110('0x2f')][_0x5110('0x38')]+'%'};return _0x4424d1;})});}_0x358efa=_[_0x5110('0x39')]({},_0x358efa,_0x2d6a51[_0x5110('0x3b')]);return _0x52e1d4[_0x5110('0x4b')](_0x358efa);}})[_0x5110('0x21')](function(_0x172bf2){if(_0x172bf2){_0x12eed4=_0x172bf2[_0x5110('0x48')];if(!_0x2d6a51[_0x5110('0x2f')]['hasOwnProperty'](_0x5110('0x33'))){_0x358efa['limit']=qs[_0x5110('0x1a')](_0x2d6a51['query'][_0x5110('0x1a')]);_0x358efa[_0x5110('0x18')]=qs['offset'](_0x2d6a51[_0x5110('0x2f')][_0x5110('0x18')]);}return _0x52e1d4[_0x5110('0x4b')](_0x358efa);}})[_0x5110('0x21')](function(_0x3fb199){if(_0x3fb199){return _0x3fb199?{'count':_0x12eed4,'rows':_0x3fb199}:null;}})[_0x5110('0x21')](respondWithResult(_0x2ba849,null))[_0x5110('0x3e')](handleError(_0x2ba849,null));}; \ No newline at end of file +var _0x3fb7=['moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','options','VtigerConfiguration','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','VtigerField','keys','filter','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3d3696,_0x411325){var _0x389c45=function(_0x4062ed){while(--_0x4062ed){_0x3d3696['push'](_0x3d3696['shift']());}};_0x389c45(++_0x411325);}(_0x3fb7,0x187));var _0x73fb=function(_0x138406,_0x4d598c){_0x138406=_0x138406-0x0;var _0x9952cd=_0x3fb7[_0x138406];return _0x9952cd;};'use strict';var emlformat=require(_0x73fb('0x0'));var rimraf=require(_0x73fb('0x1'));var zipdir=require(_0x73fb('0x2'));var jsonpatch=require(_0x73fb('0x3'));var rp=require('request-promise');var moment=require(_0x73fb('0x4'));var BPromise=require(_0x73fb('0x5'));var Mustache=require(_0x73fb('0x6'));var util=require(_0x73fb('0x7'));var path=require('path');var sox=require(_0x73fb('0x8'));var csv=require(_0x73fb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73fb('0xa'));var _=require('lodash');var squel=require(_0x73fb('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x73fb('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x73fb('0xd'));var Redis=require(_0x73fb('0xe'));var authService=require(_0x73fb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x73fb('0x10'));var hardwareService=require(_0x73fb('0x11'));var logger=require(_0x73fb('0x12'))(_0x73fb('0x13'));var utils=require(_0x73fb('0x14'));var config=require(_0x73fb('0x15'));var licenseUtil=require(_0x73fb('0x16'));var db=require(_0x73fb('0x17'))['db'];function respondWithStatusCode(_0x297ae4,_0x3ad47a){_0x3ad47a=_0x3ad47a||0xcc;return function(_0x568a82){if(_0x568a82){return _0x297ae4[_0x73fb('0x18')](_0x3ad47a);}return _0x297ae4[_0x73fb('0x19')](_0x3ad47a)['end']();};}function respondWithResult(_0x3b50df,_0x408d32){_0x408d32=_0x408d32||0xc8;return function(_0x191225){if(_0x191225){return _0x3b50df[_0x73fb('0x19')](_0x408d32)[_0x73fb('0x1a')](_0x191225);}};}function respondWithFilteredResult(_0x39f2ea,_0x944607){return function(_0x26a5b5){if(_0x26a5b5){var _0x2bf934=typeof _0x944607['offset']===_0x73fb('0x1b')&&typeof _0x944607[_0x73fb('0x1c')]==='undefined';var _0x3385f4=_0x26a5b5[_0x73fb('0x1d')];var _0x162f53=_0x2bf934?0x0:_0x944607[_0x73fb('0x1e')];var _0x407606=_0x2bf934?_0x26a5b5[_0x73fb('0x1d')]:_0x944607[_0x73fb('0x1e')]+_0x944607['limit'];var _0x4b9b69;if(_0x407606>=_0x3385f4){_0x407606=_0x3385f4;_0x4b9b69=0xc8;}else{_0x4b9b69=0xce;}_0x39f2ea[_0x73fb('0x19')](_0x4b9b69);return _0x39f2ea[_0x73fb('0x1f')](_0x73fb('0x20'),_0x162f53+'-'+_0x407606+'/'+_0x3385f4)[_0x73fb('0x1a')](_0x26a5b5);}return null;};}function patchUpdates(_0x582b57){return function(_0x166b8e){try{jsonpatch[_0x73fb('0x21')](_0x166b8e,_0x582b57,!![]);}catch(_0x1dbca4){return BPromise[_0x73fb('0x22')](_0x1dbca4);}return _0x166b8e['save']();};}function saveUpdates(_0x3dc160,_0x4d9b7a){return function(_0x59f520){if(_0x59f520){return _0x59f520[_0x73fb('0x23')](_0x3dc160)[_0x73fb('0x24')](function(_0x2661ce){return _0x2661ce;});}return null;};}function removeEntity(_0x3275ba,_0x871c49){return function(_0x49a3dc){if(_0x49a3dc){return _0x49a3dc[_0x73fb('0x25')]()[_0x73fb('0x24')](function(){_0x3275ba['status'](0xcc)[_0x73fb('0x26')]();});}};}function handleEntityNotFound(_0x22b597,_0xa494eb){return function(_0x4034f7){if(!_0x4034f7){_0x22b597[_0x73fb('0x18')](0x194);}return _0x4034f7;};}function handleError(_0x517e30,_0x1762ca){_0x1762ca=_0x1762ca||0x1f4;return function(_0x147a57){logger[_0x73fb('0x27')](_0x147a57['stack']);if(_0x147a57[_0x73fb('0x28')]){delete _0x147a57[_0x73fb('0x28')];}_0x517e30[_0x73fb('0x19')](_0x1762ca)['send'](_0x147a57);};}exports[_0x73fb('0x29')]=function(_0x5283b5,_0xa4e2bc){var _0x7d4387={},_0xa145ec={},_0x103075={'count':0x0,'rows':[]};var _0x261556=_[_0x73fb('0x2a')](db['VtigerConfiguration'][_0x73fb('0x2b')],function(_0x4397c7){return{'name':_0x4397c7[_0x73fb('0x2c')],'type':_0x4397c7[_0x73fb('0x2d')][_0x73fb('0x2e')]};});_0xa145ec['model']=_[_0x73fb('0x2a')](_0x261556,'name');_0xa145ec[_0x73fb('0x2f')]=_['keys'](_0x5283b5[_0x73fb('0x2f')]);_0xa145ec['filters']=_[_0x73fb('0x30')](_0xa145ec[_0x73fb('0x31')],_0xa145ec[_0x73fb('0x2f')]);_0x7d4387[_0x73fb('0x32')]=_[_0x73fb('0x30')](_0xa145ec['model'],qs[_0x73fb('0x33')](_0x5283b5[_0x73fb('0x2f')]['fields']));_0x7d4387[_0x73fb('0x32')]=_0x7d4387[_0x73fb('0x32')][_0x73fb('0x34')]?_0x7d4387['attributes']:_0xa145ec['model'];if(!_0x5283b5['query'][_0x73fb('0x35')]('nolimit')){_0x7d4387[_0x73fb('0x1c')]=qs[_0x73fb('0x1c')](_0x5283b5[_0x73fb('0x2f')][_0x73fb('0x1c')]);_0x7d4387[_0x73fb('0x1e')]=qs[_0x73fb('0x1e')](_0x5283b5[_0x73fb('0x2f')][_0x73fb('0x1e')]);}_0x7d4387[_0x73fb('0x36')]=qs[_0x73fb('0x37')](_0x5283b5[_0x73fb('0x2f')]['sort']);_0x7d4387[_0x73fb('0x38')]=qs[_0x73fb('0x39')](_[_0x73fb('0x3a')](_0x5283b5['query'],_0xa145ec[_0x73fb('0x39')]),_0x261556);if(_0x5283b5['query']['filter']){_0x7d4387[_0x73fb('0x38')]=_[_0x73fb('0x3b')](_0x7d4387[_0x73fb('0x38')],{'$or':_[_0x73fb('0x2a')](_0x261556,function(_0x27e3b7){if(_0x27e3b7[_0x73fb('0x2d')]!=='VIRTUAL'){var _0x7f98a2={};_0x7f98a2[_0x27e3b7[_0x73fb('0x28')]]={'$like':'%'+_0x5283b5[_0x73fb('0x2f')]['filter']+'%'};return _0x7f98a2;}})});}_0x7d4387=_[_0x73fb('0x3b')]({},_0x7d4387,_0x5283b5[_0x73fb('0x3c')]);var _0x1521fe={'where':_0x7d4387[_0x73fb('0x38')]};return db[_0x73fb('0x3d')][_0x73fb('0x1d')](_0x1521fe)[_0x73fb('0x24')](function(_0x3bb7b6){_0x103075[_0x73fb('0x1d')]=_0x3bb7b6;if(_0x5283b5[_0x73fb('0x2f')]['includeAll']){_0x7d4387[_0x73fb('0x3e')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x73fb('0x3f')](_0x7d4387);})[_0x73fb('0x24')](function(_0x4d199a){_0x103075[_0x73fb('0x40')]=_0x4d199a;return _0x103075;})[_0x73fb('0x24')](respondWithFilteredResult(_0xa4e2bc,_0x7d4387))[_0x73fb('0x41')](handleError(_0xa4e2bc,null));};exports[_0x73fb('0x42')]=function(_0x121b55,_0x5f439a){var _0x10b02d={'raw':![],'where':{'id':_0x121b55[_0x73fb('0x43')]['id']}},_0x18cabd={};_0x18cabd['model']=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x18cabd[_0x73fb('0x2f')]=_['keys'](_0x121b55[_0x73fb('0x2f')]);_0x18cabd[_0x73fb('0x39')]=_[_0x73fb('0x30')](_0x18cabd[_0x73fb('0x31')],_0x18cabd[_0x73fb('0x2f')]);_0x10b02d[_0x73fb('0x32')]=_[_0x73fb('0x30')](_0x18cabd[_0x73fb('0x31')],qs[_0x73fb('0x33')](_0x121b55[_0x73fb('0x2f')]['fields']));_0x10b02d[_0x73fb('0x32')]=_0x10b02d[_0x73fb('0x32')]['length']?_0x10b02d[_0x73fb('0x32')]:_0x18cabd[_0x73fb('0x31')];if(_0x121b55['query']['includeAll']){_0x10b02d[_0x73fb('0x3e')]=[{'all':!![]}];}_0x10b02d=_[_0x73fb('0x3b')]({},_0x10b02d,_0x121b55['options']);return db[_0x73fb('0x3d')][_0x73fb('0x44')](_0x10b02d)['then'](handleEntityNotFound(_0x5f439a,null))[_0x73fb('0x24')](respondWithResult(_0x5f439a,null))[_0x73fb('0x41')](handleError(_0x5f439a,null));};exports[_0x73fb('0x45')]=function(_0x4783da,_0x3692a7){return db[_0x73fb('0x3d')]['create'](_0x4783da[_0x73fb('0x46')],{})[_0x73fb('0x24')](respondWithResult(_0x3692a7,0xc9))[_0x73fb('0x41')](handleError(_0x3692a7,null));};exports[_0x73fb('0x23')]=function(_0x165553,_0xda4628){if(_0x165553[_0x73fb('0x46')]['id']){delete _0x165553['body']['id'];}return db['VtigerConfiguration'][_0x73fb('0x44')]({'where':{'id':_0x165553[_0x73fb('0x43')]['id']}})[_0x73fb('0x24')](handleEntityNotFound(_0xda4628,null))[_0x73fb('0x24')](saveUpdates(_0x165553[_0x73fb('0x46')],null))['then'](respondWithResult(_0xda4628,null))[_0x73fb('0x41')](handleError(_0xda4628,null));};exports[_0x73fb('0x25')]=function(_0x18c4af,_0x39314e){return db[_0x73fb('0x3d')][_0x73fb('0x44')]({'where':{'id':_0x18c4af[_0x73fb('0x43')]['id']}})[_0x73fb('0x24')](handleEntityNotFound(_0x39314e,null))[_0x73fb('0x24')](removeEntity(_0x39314e,null))['catch'](handleError(_0x39314e,null));};exports[_0x73fb('0x47')]=function(_0x1e5279,_0x455351,_0x458ebe){var _0x42bad8={};var _0x1f8f17={};var _0x889973;var _0x50008b;return db[_0x73fb('0x3d')][_0x73fb('0x48')]({'where':{'id':_0x1e5279[_0x73fb('0x43')]['id']}})[_0x73fb('0x24')](handleEntityNotFound(_0x455351,null))[_0x73fb('0x24')](function(_0x310c47){if(_0x310c47){_0x889973=_0x310c47;_0x1f8f17[_0x73fb('0x31')]=_['keys'](db[_0x73fb('0x49')]['rawAttributes']);_0x1f8f17[_0x73fb('0x2f')]=_[_0x73fb('0x4a')](_0x1e5279[_0x73fb('0x2f')]);_0x1f8f17[_0x73fb('0x39')]=_['intersection'](_0x1f8f17[_0x73fb('0x31')],_0x1f8f17[_0x73fb('0x2f')]);_0x42bad8[_0x73fb('0x32')]=_[_0x73fb('0x30')](_0x1f8f17[_0x73fb('0x31')],qs['fields'](_0x1e5279[_0x73fb('0x2f')][_0x73fb('0x33')]));_0x42bad8[_0x73fb('0x32')]=_0x42bad8['attributes'][_0x73fb('0x34')]?_0x42bad8['attributes']:_0x1f8f17[_0x73fb('0x31')];_0x42bad8[_0x73fb('0x36')]=qs[_0x73fb('0x37')](_0x1e5279['query']['sort']);_0x42bad8[_0x73fb('0x38')]=qs[_0x73fb('0x39')](_[_0x73fb('0x3a')](_0x1e5279[_0x73fb('0x2f')],_0x1f8f17[_0x73fb('0x39')]));if(_0x1e5279['query'][_0x73fb('0x4b')]){_0x42bad8['where']=_['merge'](_0x42bad8[_0x73fb('0x38')],{'$or':_[_0x73fb('0x2a')](_0x42bad8[_0x73fb('0x32')],function(_0x57859b){var _0x475fcc={};_0x475fcc[_0x57859b]={'$like':'%'+_0x1e5279[_0x73fb('0x2f')][_0x73fb('0x4b')]+'%'};return _0x475fcc;})});}_0x42bad8=_[_0x73fb('0x3b')]({},_0x42bad8,_0x1e5279['options']);return _0x889973[_0x73fb('0x47')](_0x42bad8);}})['then'](function(_0x2a9332){if(_0x2a9332){_0x50008b=_0x2a9332['length'];if(!_0x1e5279[_0x73fb('0x2f')][_0x73fb('0x35')](_0x73fb('0x4c'))){_0x42bad8[_0x73fb('0x1c')]=qs[_0x73fb('0x1c')](_0x1e5279[_0x73fb('0x2f')][_0x73fb('0x1c')]);_0x42bad8[_0x73fb('0x1e')]=qs[_0x73fb('0x1e')](_0x1e5279[_0x73fb('0x2f')][_0x73fb('0x1e')]);}return _0x889973[_0x73fb('0x47')](_0x42bad8);}})[_0x73fb('0x24')](function(_0x238424){if(_0x238424){return _0x238424?{'count':_0x50008b,'rows':_0x238424}:null;}})[_0x73fb('0x24')](respondWithResult(_0x455351,null))[_0x73fb('0x41')](handleError(_0x455351,null));};exports[_0x73fb('0x4d')]=function(_0xaa6bd2,_0x4dabcf,_0x22c367){var _0x4d16d1={};var _0x120a15={};var _0x1f6b94;var _0x284be1;return db['VtigerConfiguration']['findOne']({'where':{'id':_0xaa6bd2[_0x73fb('0x43')]['id']}})['then'](handleEntityNotFound(_0x4dabcf,null))['then'](function(_0x482fcc){if(_0x482fcc){_0x1f6b94=_0x482fcc;_0x120a15[_0x73fb('0x31')]=_[_0x73fb('0x4a')](db[_0x73fb('0x49')][_0x73fb('0x2b')]);_0x120a15['query']=_['keys'](_0xaa6bd2[_0x73fb('0x2f')]);_0x120a15[_0x73fb('0x39')]=_[_0x73fb('0x30')](_0x120a15[_0x73fb('0x31')],_0x120a15[_0x73fb('0x2f')]);_0x4d16d1[_0x73fb('0x32')]=_[_0x73fb('0x30')](_0x120a15[_0x73fb('0x31')],qs[_0x73fb('0x33')](_0xaa6bd2[_0x73fb('0x2f')][_0x73fb('0x33')]));_0x4d16d1['attributes']=_0x4d16d1['attributes'][_0x73fb('0x34')]?_0x4d16d1[_0x73fb('0x32')]:_0x120a15['model'];_0x4d16d1[_0x73fb('0x36')]=qs[_0x73fb('0x37')](_0xaa6bd2[_0x73fb('0x2f')][_0x73fb('0x37')]);_0x4d16d1['where']=qs['filters'](_[_0x73fb('0x3a')](_0xaa6bd2[_0x73fb('0x2f')],_0x120a15[_0x73fb('0x39')]));if(_0xaa6bd2[_0x73fb('0x2f')][_0x73fb('0x4b')]){_0x4d16d1[_0x73fb('0x38')]=_[_0x73fb('0x3b')](_0x4d16d1[_0x73fb('0x38')],{'$or':_['map'](_0x4d16d1['attributes'],function(_0x2b92d3){var _0x12a88c={};_0x12a88c[_0x2b92d3]={'$like':'%'+_0xaa6bd2[_0x73fb('0x2f')]['filter']+'%'};return _0x12a88c;})});}_0x4d16d1=_['merge']({},_0x4d16d1,_0xaa6bd2['options']);return _0x1f6b94[_0x73fb('0x4d')](_0x4d16d1);}})['then'](function(_0x483132){if(_0x483132){_0x284be1=_0x483132[_0x73fb('0x34')];if(!_0xaa6bd2[_0x73fb('0x2f')][_0x73fb('0x35')](_0x73fb('0x4c'))){_0x4d16d1[_0x73fb('0x1c')]=qs[_0x73fb('0x1c')](_0xaa6bd2[_0x73fb('0x2f')]['limit']);_0x4d16d1[_0x73fb('0x1e')]=qs[_0x73fb('0x1e')](_0xaa6bd2['query'][_0x73fb('0x1e')]);}return _0x1f6b94['getSubjects'](_0x4d16d1);}})[_0x73fb('0x24')](function(_0x2fe385){if(_0x2fe385){return _0x2fe385?{'count':_0x284be1,'rows':_0x2fe385}:null;}})[_0x73fb('0x24')](respondWithResult(_0x4dabcf,null))['catch'](handleError(_0x4dabcf,null));};exports[_0x73fb('0x4e')]=function(_0x19e4fa,_0x243695,_0x329972){var _0x5a85e3={};var _0x1add77={};var _0x55edf1;var _0x5d1072;return db[_0x73fb('0x3d')][_0x73fb('0x48')]({'where':{'id':_0x19e4fa['params']['id']}})['then'](handleEntityNotFound(_0x243695,null))['then'](function(_0xfcd6e3){if(_0xfcd6e3){_0x55edf1=_0xfcd6e3;_0x1add77[_0x73fb('0x31')]=_[_0x73fb('0x4a')](db[_0x73fb('0x49')][_0x73fb('0x2b')]);_0x1add77['query']=_[_0x73fb('0x4a')](_0x19e4fa['query']);_0x1add77[_0x73fb('0x39')]=_['intersection'](_0x1add77[_0x73fb('0x31')],_0x1add77['query']);_0x5a85e3[_0x73fb('0x32')]=_[_0x73fb('0x30')](_0x1add77[_0x73fb('0x31')],qs[_0x73fb('0x33')](_0x19e4fa[_0x73fb('0x2f')][_0x73fb('0x33')]));_0x5a85e3[_0x73fb('0x32')]=_0x5a85e3['attributes'][_0x73fb('0x34')]?_0x5a85e3['attributes']:_0x1add77[_0x73fb('0x31')];_0x5a85e3['order']=qs['sort'](_0x19e4fa[_0x73fb('0x2f')][_0x73fb('0x37')]);_0x5a85e3[_0x73fb('0x38')]=qs[_0x73fb('0x39')](_['pick'](_0x19e4fa['query'],_0x1add77['filters']));if(_0x19e4fa[_0x73fb('0x2f')][_0x73fb('0x4b')]){_0x5a85e3[_0x73fb('0x38')]=_[_0x73fb('0x3b')](_0x5a85e3[_0x73fb('0x38')],{'$or':_['map'](_0x5a85e3[_0x73fb('0x32')],function(_0x1dea62){var _0x527e68={};_0x527e68[_0x1dea62]={'$like':'%'+_0x19e4fa[_0x73fb('0x2f')][_0x73fb('0x4b')]+'%'};return _0x527e68;})});}_0x5a85e3=_[_0x73fb('0x3b')]({},_0x5a85e3,_0x19e4fa['options']);return _0x55edf1['getDescriptions'](_0x5a85e3);}})['then'](function(_0x57a62c){if(_0x57a62c){_0x5d1072=_0x57a62c['length'];if(!_0x19e4fa[_0x73fb('0x2f')][_0x73fb('0x35')](_0x73fb('0x4c'))){_0x5a85e3[_0x73fb('0x1c')]=qs['limit'](_0x19e4fa[_0x73fb('0x2f')][_0x73fb('0x1c')]);_0x5a85e3[_0x73fb('0x1e')]=qs['offset'](_0x19e4fa[_0x73fb('0x2f')][_0x73fb('0x1e')]);}return _0x55edf1['getDescriptions'](_0x5a85e3);}})[_0x73fb('0x24')](function(_0x5c6896){if(_0x5c6896){return _0x5c6896?{'count':_0x5d1072,'rows':_0x5c6896}:null;}})['then'](respondWithResult(_0x243695,null))[_0x73fb('0x41')](handleError(_0x243695,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 9253d28..fa9e8dd 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 _0xa15b=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util'];(function(_0x3f1b61,_0x23ff33){var _0x15560c=function(_0x39a1c7){while(--_0x39a1c7){_0x3f1b61['push'](_0x3f1b61['shift']());}};_0x15560c(++_0x23ff33);}(_0xa15b,0x1df));var _0xba15=function(_0x47b326,_0x18ff51){_0x47b326=_0x47b326-0x0;var _0x23d5a1=_0xa15b[_0x47b326];return _0x23d5a1;};'use strict';var _=require(_0xba15('0x0'));var util=require(_0xba15('0x1'));var logger=require(_0xba15('0x2'))('api');var moment=require('moment');var BPromise=require(_0xba15('0x3'));var rp=require(_0xba15('0x4'));var fs=require('fs');var path=require(_0xba15('0x5'));var rimraf=require(_0xba15('0x6'));var config=require(_0xba15('0x7'));var attributes=require(_0xba15('0x8'));module[_0xba15('0x9')]=function(_0x4df367,_0x4a71fb){return _0x4df367[_0xba15('0xa')](_0xba15('0xb'),attributes,{'tableName':_0xba15('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd47d=['int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration'];(function(_0x55410b,_0x59e074){var _0x154f9a=function(_0x18d523){while(--_0x18d523){_0x55410b['push'](_0x55410b['shift']());}};_0x154f9a(++_0x59e074);}(_0xd47d,0xef));var _0xdd47=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0xd47d[_0x389832];return _0x59429e;};'use strict';var _=require(_0xdd47('0x0'));var util=require(_0xdd47('0x1'));var logger=require(_0xdd47('0x2'))(_0xdd47('0x3'));var moment=require(_0xdd47('0x4'));var BPromise=require(_0xdd47('0x5'));var rp=require(_0xdd47('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd47('0x7'));var config=require(_0xdd47('0x8'));var attributes=require(_0xdd47('0x9'));module[_0xdd47('0xa')]=function(_0x109a6b,_0x26edde){return _0x109a6b[_0xdd47('0xb')](_0xdd47('0xc'),attributes,{'tableName':_0xdd47('0xd'),'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 d1b9158..f8dbd47 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 _0x3d30=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x5c8915,_0x5f2a0c){var _0x3ae2d7=function(_0x248085){while(--_0x248085){_0x5c8915['push'](_0x5c8915['shift']());}};_0x3ae2d7(++_0x5f2a0c);}(_0x3d30,0xf1));var _0x03d3=function(_0x1ad0af,_0x140b7e){_0x1ad0af=_0x1ad0af-0x0;var _0x39d66c=_0x3d30[_0x1ad0af];return _0x39d66c;};'use strict';var _=require(_0x03d3('0x0'));var util=require(_0x03d3('0x1'));var moment=require(_0x03d3('0x2'));var BPromise=require(_0x03d3('0x3'));var rs=require(_0x03d3('0x4'));var fs=require('fs');var Redis=require(_0x03d3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x03d3('0x6'))(_0x03d3('0x7'));var config=require(_0x03d3('0x8'));var jayson=require(_0x03d3('0x9'));var client=jayson['client'][_0x03d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f9432,_0x4397df,_0x101bc0){return new BPromise(function(_0x307789,_0x3847d8){return client['request'](_0x3f9432,_0x101bc0)['then'](function(_0x374af8){logger[_0x03d3('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x4397df,'request\x20sent');logger[_0x03d3('0xc')](_0x03d3('0xd'),_0x4397df,_0x03d3('0xe'),JSON[_0x03d3('0xf')](_0x374af8));if(_0x374af8[_0x03d3('0x10')]){if(_0x374af8[_0x03d3('0x10')][_0x03d3('0x11')]===0x1f4){logger[_0x03d3('0x10')](_0x03d3('0x12'),_0x4397df,_0x374af8[_0x03d3('0x10')][_0x03d3('0x13')]);return _0x3847d8(_0x374af8[_0x03d3('0x10')]['message']);}logger[_0x03d3('0x10')](_0x03d3('0x12'),_0x4397df,_0x374af8[_0x03d3('0x10')][_0x03d3('0x13')]);return _0x307789(_0x374af8[_0x03d3('0x10')][_0x03d3('0x13')]);}else{logger[_0x03d3('0xb')](_0x03d3('0x12'),_0x4397df,_0x03d3('0xe'));_0x307789(_0x374af8[_0x03d3('0x14')][_0x03d3('0x13')]);}})[_0x03d3('0x15')](function(_0x220c52){logger['error'](_0x03d3('0x12'),_0x4397df,_0x220c52);_0x3847d8(_0x220c52);});});} \ No newline at end of file +var _0x76ec=['stringify','error','code','message','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3923ea,_0x19d953){var _0x1146cc=function(_0x1327e2){while(--_0x1327e2){_0x3923ea['push'](_0x3923ea['shift']());}};_0x1146cc(++_0x19d953);}(_0x76ec,0x1d1));var _0xc76e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x76ec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc76e('0x0'));var util=require(_0xc76e('0x1'));var moment=require(_0xc76e('0x2'));var BPromise=require('bluebird');var rs=require(_0xc76e('0x3'));var fs=require('fs');var Redis=require(_0xc76e('0x4'));var db=require(_0xc76e('0x5'))['db'];var utils=require(_0xc76e('0x6'));var logger=require(_0xc76e('0x7'))(_0xc76e('0x8'));var config=require(_0xc76e('0x9'));var jayson=require(_0xc76e('0xa'));var client=jayson[_0xc76e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ba05f,_0x29e489,_0x21de64){return new BPromise(function(_0x5e6aca,_0x4d0480){return client[_0xc76e('0xc')](_0x4ba05f,_0x21de64)[_0xc76e('0xd')](function(_0x2c909f){logger['info'](_0xc76e('0xe'),_0x29e489,_0xc76e('0xf'));logger[_0xc76e('0x10')](_0xc76e('0x11'),_0x29e489,'request\x20sent',JSON[_0xc76e('0x12')](_0x2c909f));if(_0x2c909f[_0xc76e('0x13')]){if(_0x2c909f[_0xc76e('0x13')][_0xc76e('0x14')]===0x1f4){logger[_0xc76e('0x13')](_0xc76e('0xe'),_0x29e489,_0x2c909f[_0xc76e('0x13')]['message']);return _0x4d0480(_0x2c909f[_0xc76e('0x13')][_0xc76e('0x15')]);}logger[_0xc76e('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x29e489,_0x2c909f[_0xc76e('0x13')][_0xc76e('0x15')]);return _0x5e6aca(_0x2c909f['error']['message']);}else{logger[_0xc76e('0x16')]('VtigerConfiguration,\x20%s,\x20%s',_0x29e489,_0xc76e('0xf'));_0x5e6aca(_0x2c909f['result'][_0xc76e('0x15')]);}})['catch'](function(_0x456e30){logger[_0xc76e('0x13')](_0xc76e('0xe'),_0x29e489,_0x456e30);_0x4d0480(_0x456e30);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index a4082ec..ccc6fcc 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 _0x07f9=['delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create','put','update'];(function(_0x34b6aa,_0x5ddd29){var _0x3ead29=function(_0x53979c){while(--_0x53979c){_0x34b6aa['push'](_0x34b6aa['shift']());}};_0x3ead29(++_0x5ddd29);}(_0x07f9,0x123));var _0x907f=function(_0x79dafd,_0x240134){_0x79dafd=_0x79dafd-0x0;var _0x405d32=_0x07f9[_0x79dafd];return _0x405d32;};'use strict';var multer=require('multer');var util=require(_0x907f('0x0'));var path=require(_0x907f('0x1'));var timeout=require('connect-timeout');var express=require(_0x907f('0x2'));var router=express[_0x907f('0x3')]();var fs_extra=require(_0x907f('0x4'));var auth=require(_0x907f('0x5'));var interaction=require(_0x907f('0x6'));var config=require(_0x907f('0x7'));var controller=require('./intVtigerField.controller');router[_0x907f('0x8')]('/',auth['isAuthenticated'](),controller[_0x907f('0x9')]);router[_0x907f('0x8')](_0x907f('0xa'),auth[_0x907f('0xb')](),controller['show']);router['post']('/',auth[_0x907f('0xb')](),controller[_0x907f('0xc')]);router[_0x907f('0xd')](_0x907f('0xa'),auth[_0x907f('0xb')](),controller[_0x907f('0xe')]);router[_0x907f('0xf')](_0x907f('0xa'),auth[_0x907f('0xb')](),controller[_0x907f('0x10')]);module['exports']=router; \ No newline at end of file +var _0x90a7=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','update','exports','multer','path','connect-timeout'];(function(_0x2fcb3b,_0x2b43a8){var _0x273e3d=function(_0x1b1d8a){while(--_0x1b1d8a){_0x2fcb3b['push'](_0x2fcb3b['shift']());}};_0x273e3d(++_0x2b43a8);}(_0x90a7,0x173));var _0x790a=function(_0x25a0b7,_0x1b9079){_0x25a0b7=_0x25a0b7-0x0;var _0x28d223=_0x90a7[_0x25a0b7];return _0x28d223;};'use strict';var multer=require(_0x790a('0x0'));var util=require('util');var path=require(_0x790a('0x1'));var timeout=require(_0x790a('0x2'));var express=require(_0x790a('0x3'));var router=express[_0x790a('0x4')]();var fs_extra=require(_0x790a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x790a('0x6'));var config=require(_0x790a('0x7'));var controller=require('./intVtigerField.controller');router[_0x790a('0x8')]('/',auth[_0x790a('0x9')](),controller[_0x790a('0xa')]);router[_0x790a('0x8')]('/:id',auth[_0x790a('0x9')](),controller[_0x790a('0xb')]);router[_0x790a('0xc')]('/',auth[_0x790a('0x9')](),controller[_0x790a('0xd')]);router[_0x790a('0xe')]('/:id',auth[_0x790a('0x9')](),controller[_0x790a('0xf')]);router['delete']('/:id',auth[_0x790a('0x9')](),controller['destroy']);module[_0x790a('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 73d2d47..9f65e8a 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 _0xa382=['customVariable','keyValue','picklist','STRING','sequelize','ENUM','string','variable'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0xa382,0x6c));var _0x2a38=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa382[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x2a38('0x0'));module['exports']={'type':{'type':Sequelize[_0x2a38('0x1')](_0x2a38('0x2'),_0x2a38('0x3'),_0x2a38('0x4'),_0x2a38('0x5'),_0x2a38('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2a38('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2a38('0x1')](_0x2a38('0x2'),_0x2a38('0x3'),_0x2a38('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2a38('0x7')]},'nameField':{'type':Sequelize[_0x2a38('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2a38('0x7')]}}; \ No newline at end of file +var _0xff02=['keyValue','picklist','STRING','ENUM','BOOLEAN','exports','string','variable','customVariable'];(function(_0x248a7a,_0x184d92){var _0xf9c371=function(_0x5bd0f5){while(--_0x5bd0f5){_0x248a7a['push'](_0x248a7a['shift']());}};_0xf9c371(++_0x184d92);}(_0xff02,0x101));var _0x2ff0=function(_0x4990cd,_0xdf7383){_0x4990cd=_0x4990cd-0x0;var _0x5b038f=_0xff02[_0x4990cd];return _0x5b038f;};'use strict';var Sequelize=require('sequelize');module[_0x2ff0('0x0')]={'type':{'type':Sequelize['ENUM'](_0x2ff0('0x1'),_0x2ff0('0x2'),_0x2ff0('0x3'),_0x2ff0('0x4'),_0x2ff0('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2ff0('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2ff0('0x7')]('string',_0x2ff0('0x2'),_0x2ff0('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2ff0('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2ff0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2ff0('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 59df61d..4246b81 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 _0xf881=['where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','VtigerField','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x2ff293,_0x34fdef){var _0x5462bb=function(_0x2a321a){while(--_0x2a321a){_0x2ff293['push'](_0x2ff293['shift']());}};_0x5462bb(++_0x34fdef);}(_0xf881,0x9f));var _0x1f88=function(_0x36240e,_0x11c6bd){_0x36240e=_0x36240e-0x0;var _0x3d0d10=_0xf881[_0x36240e];return _0x3d0d10;};'use strict';var emlformat=require(_0x1f88('0x0'));var rimraf=require(_0x1f88('0x1'));var zipdir=require(_0x1f88('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f88('0x3'));var moment=require(_0x1f88('0x4'));var BPromise=require(_0x1f88('0x5'));var Mustache=require(_0x1f88('0x6'));var util=require('util');var path=require(_0x1f88('0x7'));var sox=require('sox');var csv=require(_0x1f88('0x8'));var ejs=require(_0x1f88('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f88('0xa'));var squel=require(_0x1f88('0xb'));var crypto=require(_0x1f88('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1f88('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1f88('0xe'));var Redis=require(_0x1f88('0xf'));var authService=require(_0x1f88('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f88('0x11'))(_0x1f88('0x12'));var utils=require(_0x1f88('0x13'));var config=require(_0x1f88('0x14'));var licenseUtil=require(_0x1f88('0x15'));var db=require(_0x1f88('0x16'))['db'];function respondWithStatusCode(_0xf8c3c6,_0x5df301){_0x5df301=_0x5df301||0xcc;return function(_0x52dd67){if(_0x52dd67){return _0xf8c3c6[_0x1f88('0x17')](_0x5df301);}return _0xf8c3c6[_0x1f88('0x18')](_0x5df301)[_0x1f88('0x19')]();};}function respondWithResult(_0xee0d80,_0x380dbc){_0x380dbc=_0x380dbc||0xc8;return function(_0x1299a2){if(_0x1299a2){return _0xee0d80[_0x1f88('0x18')](_0x380dbc)['json'](_0x1299a2);}};}function respondWithFilteredResult(_0x52da82,_0x3ac73a){return function(_0x1ef29e){if(_0x1ef29e){var _0x26c299=typeof _0x3ac73a[_0x1f88('0x1a')]===_0x1f88('0x1b')&&typeof _0x3ac73a[_0x1f88('0x1c')]==='undefined';var _0x754b66=_0x1ef29e['count'];var _0x362aad=_0x26c299?0x0:_0x3ac73a[_0x1f88('0x1a')];var _0x55df4f=_0x26c299?_0x1ef29e[_0x1f88('0x1d')]:_0x3ac73a[_0x1f88('0x1a')]+_0x3ac73a['limit'];var _0x4309bb;if(_0x55df4f>=_0x754b66){_0x55df4f=_0x754b66;_0x4309bb=0xc8;}else{_0x4309bb=0xce;}_0x52da82[_0x1f88('0x18')](_0x4309bb);return _0x52da82['set'](_0x1f88('0x1e'),_0x362aad+'-'+_0x55df4f+'/'+_0x754b66)['json'](_0x1ef29e);}return null;};}function patchUpdates(_0x44ca7d){return function(_0x55601f){try{jsonpatch[_0x1f88('0x1f')](_0x55601f,_0x44ca7d,!![]);}catch(_0x5b83){return BPromise[_0x1f88('0x20')](_0x5b83);}return _0x55601f[_0x1f88('0x21')]();};}function saveUpdates(_0x35d3f2,_0x58f840){return function(_0x2e01d8){if(_0x2e01d8){return _0x2e01d8['update'](_0x35d3f2)['then'](function(_0x57194a){return _0x57194a;});}return null;};}function removeEntity(_0x340cf4,_0x48f7e6){return function(_0x45d897){if(_0x45d897){return _0x45d897['destroy']()[_0x1f88('0x22')](function(){_0x340cf4[_0x1f88('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fbb6f,_0x390dd7){return function(_0x3d3966){if(!_0x3d3966){_0x1fbb6f['sendStatus'](0x194);}return _0x3d3966;};}function handleError(_0x23218e,_0x480962){_0x480962=_0x480962||0x1f4;return function(_0x1ce44b){logger[_0x1f88('0x23')](_0x1ce44b[_0x1f88('0x24')]);if(_0x1ce44b['name']){delete _0x1ce44b[_0x1f88('0x25')];}_0x23218e[_0x1f88('0x18')](_0x480962)[_0x1f88('0x26')](_0x1ce44b);};}exports[_0x1f88('0x27')]=function(_0x2ff7ee,_0x5ed957){var _0x14c57f={},_0x510ace={},_0x538d9d={'count':0x0,'rows':[]};var _0x2cf279=_[_0x1f88('0x28')](db[_0x1f88('0x29')][_0x1f88('0x2a')],function(_0x540540){return{'name':_0x540540['fieldName'],'type':_0x540540['type'][_0x1f88('0x2b')]};});_0x510ace[_0x1f88('0x2c')]=_[_0x1f88('0x28')](_0x2cf279,'name');_0x510ace[_0x1f88('0x2d')]=_[_0x1f88('0x2e')](_0x2ff7ee[_0x1f88('0x2d')]);_0x510ace['filters']=_['intersection'](_0x510ace['model'],_0x510ace[_0x1f88('0x2d')]);_0x14c57f[_0x1f88('0x2f')]=_[_0x1f88('0x30')](_0x510ace[_0x1f88('0x2c')],qs[_0x1f88('0x31')](_0x2ff7ee[_0x1f88('0x2d')][_0x1f88('0x31')]));_0x14c57f[_0x1f88('0x2f')]=_0x14c57f['attributes'][_0x1f88('0x32')]?_0x14c57f['attributes']:_0x510ace[_0x1f88('0x2c')];if(!_0x2ff7ee[_0x1f88('0x2d')][_0x1f88('0x33')](_0x1f88('0x34'))){_0x14c57f[_0x1f88('0x1c')]=qs[_0x1f88('0x1c')](_0x2ff7ee['query']['limit']);_0x14c57f['offset']=qs[_0x1f88('0x1a')](_0x2ff7ee[_0x1f88('0x2d')]['offset']);}_0x14c57f['order']=qs[_0x1f88('0x35')](_0x2ff7ee[_0x1f88('0x2d')]['sort']);_0x14c57f[_0x1f88('0x36')]=qs[_0x1f88('0x37')](_[_0x1f88('0x38')](_0x2ff7ee[_0x1f88('0x2d')],_0x510ace[_0x1f88('0x37')]),_0x2cf279);if(_0x2ff7ee[_0x1f88('0x2d')][_0x1f88('0x39')]){_0x14c57f['where']=_[_0x1f88('0x3a')](_0x14c57f['where'],{'$or':_[_0x1f88('0x28')](_0x2cf279,function(_0x2556e1){if(_0x2556e1[_0x1f88('0x3b')]!==_0x1f88('0x3c')){var _0x432b6d={};_0x432b6d[_0x2556e1[_0x1f88('0x25')]]={'$like':'%'+_0x2ff7ee['query'][_0x1f88('0x39')]+'%'};return _0x432b6d;}})});}_0x14c57f=_['merge']({},_0x14c57f,_0x2ff7ee[_0x1f88('0x3d')]);var _0x2f2a7b={'where':_0x14c57f[_0x1f88('0x36')]};return db[_0x1f88('0x29')][_0x1f88('0x1d')](_0x2f2a7b)[_0x1f88('0x22')](function(_0x421988){_0x538d9d[_0x1f88('0x1d')]=_0x421988;if(_0x2ff7ee[_0x1f88('0x2d')][_0x1f88('0x3e')]){_0x14c57f[_0x1f88('0x3f')]=[{'all':!![]}];}return db[_0x1f88('0x29')][_0x1f88('0x40')](_0x14c57f);})[_0x1f88('0x22')](function(_0x454b0c){_0x538d9d['rows']=_0x454b0c;return _0x538d9d;})['then'](respondWithFilteredResult(_0x5ed957,_0x14c57f))[_0x1f88('0x41')](handleError(_0x5ed957,null));};exports['show']=function(_0x5cecd8,_0x3a8ebf){var _0x1cbe42={'raw':!![],'where':{'id':_0x5cecd8['params']['id']}},_0x4c8584={};_0x4c8584[_0x1f88('0x2c')]=_['keys'](db[_0x1f88('0x29')][_0x1f88('0x2a')]);_0x4c8584['query']=_[_0x1f88('0x2e')](_0x5cecd8[_0x1f88('0x2d')]);_0x4c8584[_0x1f88('0x37')]=_[_0x1f88('0x30')](_0x4c8584[_0x1f88('0x2c')],_0x4c8584[_0x1f88('0x2d')]);_0x1cbe42['attributes']=_[_0x1f88('0x30')](_0x4c8584[_0x1f88('0x2c')],qs[_0x1f88('0x31')](_0x5cecd8[_0x1f88('0x2d')][_0x1f88('0x31')]));_0x1cbe42[_0x1f88('0x2f')]=_0x1cbe42[_0x1f88('0x2f')][_0x1f88('0x32')]?_0x1cbe42[_0x1f88('0x2f')]:_0x4c8584[_0x1f88('0x2c')];if(_0x5cecd8[_0x1f88('0x2d')]['includeAll']){_0x1cbe42[_0x1f88('0x3f')]=[{'all':!![]}];}_0x1cbe42=_[_0x1f88('0x3a')]({},_0x1cbe42,_0x5cecd8[_0x1f88('0x3d')]);return db[_0x1f88('0x29')][_0x1f88('0x42')](_0x1cbe42)['then'](handleEntityNotFound(_0x3a8ebf,null))['then'](respondWithResult(_0x3a8ebf,null))[_0x1f88('0x41')](handleError(_0x3a8ebf,null));};exports[_0x1f88('0x43')]=function(_0x41d55a,_0x39f9ad){return db[_0x1f88('0x29')]['create'](_0x41d55a[_0x1f88('0x44')],{})['then'](respondWithResult(_0x39f9ad,0xc9))['catch'](handleError(_0x39f9ad,null));};exports['update']=function(_0x38a0d6,_0xdefd5a){if(_0x38a0d6[_0x1f88('0x44')]['id']){delete _0x38a0d6['body']['id'];}return db[_0x1f88('0x29')][_0x1f88('0x42')]({'where':{'id':_0x38a0d6[_0x1f88('0x45')]['id']}})[_0x1f88('0x22')](handleEntityNotFound(_0xdefd5a,null))[_0x1f88('0x22')](saveUpdates(_0x38a0d6[_0x1f88('0x44')],null))[_0x1f88('0x22')](respondWithResult(_0xdefd5a,null))['catch'](handleError(_0xdefd5a,null));};exports[_0x1f88('0x46')]=function(_0x110101,_0x1fe42e){return db[_0x1f88('0x29')][_0x1f88('0x42')]({'where':{'id':_0x110101[_0x1f88('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fe42e,null))['then'](removeEntity(_0x1fe42e,null))[_0x1f88('0x41')](handleError(_0x1fe42e,null));}; \ No newline at end of file +var _0x6f28=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','end','error','name','index','VtigerField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel'];(function(_0x21ef65,_0x15f001){var _0x309f7b=function(_0x1bd40a){while(--_0x1bd40a){_0x21ef65['push'](_0x21ef65['shift']());}};_0x309f7b(++_0x15f001);}(_0x6f28,0x118));var _0x86f2=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0x6f28[_0x1d1d09];return _0x8827e;};'use strict';var emlformat=require(_0x86f2('0x0'));var rimraf=require(_0x86f2('0x1'));var zipdir=require(_0x86f2('0x2'));var jsonpatch=require(_0x86f2('0x3'));var rp=require('request-promise');var moment=require(_0x86f2('0x4'));var BPromise=require(_0x86f2('0x5'));var Mustache=require(_0x86f2('0x6'));var util=require('util');var path=require('path');var sox=require(_0x86f2('0x7'));var csv=require(_0x86f2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86f2('0x9'));var _=require(_0x86f2('0xa'));var squel=require(_0x86f2('0xb'));var crypto=require('crypto');var jsforce=require(_0x86f2('0xc'));var deskjs=require(_0x86f2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x86f2('0xe'));var Papa=require('papaparse');var Redis=require(_0x86f2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x86f2('0x10'));var as=require(_0x86f2('0x11'));var hardwareService=require(_0x86f2('0x12'));var logger=require(_0x86f2('0x13'))(_0x86f2('0x14'));var utils=require(_0x86f2('0x15'));var config=require(_0x86f2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x86f2('0x17'))['db'];function respondWithStatusCode(_0x42e35e,_0x8bc130){_0x8bc130=_0x8bc130||0xcc;return function(_0x4d46af){if(_0x4d46af){return _0x42e35e[_0x86f2('0x18')](_0x8bc130);}return _0x42e35e[_0x86f2('0x19')](_0x8bc130)['end']();};}function respondWithResult(_0x26ee59,_0x2d857f){_0x2d857f=_0x2d857f||0xc8;return function(_0x59bd05){if(_0x59bd05){return _0x26ee59[_0x86f2('0x19')](_0x2d857f)['json'](_0x59bd05);}};}function respondWithFilteredResult(_0x8dce02,_0x4ffe1a){return function(_0x3e3f9c){if(_0x3e3f9c){var _0x194129=typeof _0x4ffe1a[_0x86f2('0x1a')]===_0x86f2('0x1b')&&typeof _0x4ffe1a['limit']===_0x86f2('0x1b');var _0x1af596=_0x3e3f9c[_0x86f2('0x1c')];var _0x2cbe1d=_0x194129?0x0:_0x4ffe1a['offset'];var _0x1bcfef=_0x194129?_0x3e3f9c['count']:_0x4ffe1a['offset']+_0x4ffe1a[_0x86f2('0x1d')];var _0x51fd79;if(_0x1bcfef>=_0x1af596){_0x1bcfef=_0x1af596;_0x51fd79=0xc8;}else{_0x51fd79=0xce;}_0x8dce02['status'](_0x51fd79);return _0x8dce02[_0x86f2('0x1e')](_0x86f2('0x1f'),_0x2cbe1d+'-'+_0x1bcfef+'/'+_0x1af596)[_0x86f2('0x20')](_0x3e3f9c);}return null;};}function patchUpdates(_0x125d5e){return function(_0x252f91){try{jsonpatch[_0x86f2('0x21')](_0x252f91,_0x125d5e,!![]);}catch(_0x34779c){return BPromise['reject'](_0x34779c);}return _0x252f91[_0x86f2('0x22')]();};}function saveUpdates(_0x51b529,_0x2ca0ad){return function(_0x1a32df){if(_0x1a32df){return _0x1a32df[_0x86f2('0x23')](_0x51b529)[_0x86f2('0x24')](function(_0xf8dcfc){return _0xf8dcfc;});}return null;};}function removeEntity(_0x9f644a,_0x2a6e43){return function(_0x46c1e9){if(_0x46c1e9){return _0x46c1e9[_0x86f2('0x25')]()[_0x86f2('0x24')](function(){_0x9f644a['status'](0xcc)[_0x86f2('0x26')]();});}};}function handleEntityNotFound(_0x3f3ffd,_0x419cc6){return function(_0x3f7b12){if(!_0x3f7b12){_0x3f3ffd[_0x86f2('0x18')](0x194);}return _0x3f7b12;};}function handleError(_0x4d74e4,_0x2f53b3){_0x2f53b3=_0x2f53b3||0x1f4;return function(_0x798832){logger[_0x86f2('0x27')](_0x798832['stack']);if(_0x798832[_0x86f2('0x28')]){delete _0x798832['name'];}_0x4d74e4[_0x86f2('0x19')](_0x2f53b3)['send'](_0x798832);};}exports[_0x86f2('0x29')]=function(_0x58d2c9,_0x1be671){var _0x58f902={},_0x1cc20e={},_0x5b10d9={'count':0x0,'rows':[]};var _0x382ac7=_['map'](db[_0x86f2('0x2a')][_0x86f2('0x2b')],function(_0x334c05){return{'name':_0x334c05[_0x86f2('0x2c')],'type':_0x334c05[_0x86f2('0x2d')][_0x86f2('0x2e')]};});_0x1cc20e[_0x86f2('0x2f')]=_[_0x86f2('0x30')](_0x382ac7,'name');_0x1cc20e[_0x86f2('0x31')]=_[_0x86f2('0x32')](_0x58d2c9[_0x86f2('0x31')]);_0x1cc20e[_0x86f2('0x33')]=_['intersection'](_0x1cc20e[_0x86f2('0x2f')],_0x1cc20e[_0x86f2('0x31')]);_0x58f902[_0x86f2('0x34')]=_[_0x86f2('0x35')](_0x1cc20e[_0x86f2('0x2f')],qs[_0x86f2('0x36')](_0x58d2c9['query'][_0x86f2('0x36')]));_0x58f902[_0x86f2('0x34')]=_0x58f902['attributes'][_0x86f2('0x37')]?_0x58f902[_0x86f2('0x34')]:_0x1cc20e[_0x86f2('0x2f')];if(!_0x58d2c9[_0x86f2('0x31')][_0x86f2('0x38')]('nolimit')){_0x58f902['limit']=qs[_0x86f2('0x1d')](_0x58d2c9[_0x86f2('0x31')][_0x86f2('0x1d')]);_0x58f902[_0x86f2('0x1a')]=qs[_0x86f2('0x1a')](_0x58d2c9[_0x86f2('0x31')]['offset']);}_0x58f902[_0x86f2('0x39')]=qs['sort'](_0x58d2c9[_0x86f2('0x31')][_0x86f2('0x3a')]);_0x58f902[_0x86f2('0x3b')]=qs[_0x86f2('0x33')](_['pick'](_0x58d2c9[_0x86f2('0x31')],_0x1cc20e[_0x86f2('0x33')]),_0x382ac7);if(_0x58d2c9['query'][_0x86f2('0x3c')]){_0x58f902[_0x86f2('0x3b')]=_[_0x86f2('0x3d')](_0x58f902[_0x86f2('0x3b')],{'$or':_[_0x86f2('0x30')](_0x382ac7,function(_0x40f778){if(_0x40f778['type']!==_0x86f2('0x3e')){var _0x192392={};_0x192392[_0x40f778['name']]={'$like':'%'+_0x58d2c9[_0x86f2('0x31')][_0x86f2('0x3c')]+'%'};return _0x192392;}})});}_0x58f902=_[_0x86f2('0x3d')]({},_0x58f902,_0x58d2c9['options']);var _0x2a2913={'where':_0x58f902[_0x86f2('0x3b')]};return db[_0x86f2('0x2a')][_0x86f2('0x1c')](_0x2a2913)['then'](function(_0x209af3){_0x5b10d9[_0x86f2('0x1c')]=_0x209af3;if(_0x58d2c9[_0x86f2('0x31')][_0x86f2('0x3f')]){_0x58f902['include']=[{'all':!![]}];}return db[_0x86f2('0x2a')][_0x86f2('0x40')](_0x58f902);})[_0x86f2('0x24')](function(_0x4476bd){_0x5b10d9['rows']=_0x4476bd;return _0x5b10d9;})[_0x86f2('0x24')](respondWithFilteredResult(_0x1be671,_0x58f902))[_0x86f2('0x41')](handleError(_0x1be671,null));};exports[_0x86f2('0x42')]=function(_0x2d3608,_0x241404){var _0x4d410e={'raw':!![],'where':{'id':_0x2d3608[_0x86f2('0x43')]['id']}},_0x1347e6={};_0x1347e6[_0x86f2('0x2f')]=_[_0x86f2('0x32')](db[_0x86f2('0x2a')][_0x86f2('0x2b')]);_0x1347e6['query']=_[_0x86f2('0x32')](_0x2d3608['query']);_0x1347e6['filters']=_[_0x86f2('0x35')](_0x1347e6[_0x86f2('0x2f')],_0x1347e6[_0x86f2('0x31')]);_0x4d410e[_0x86f2('0x34')]=_[_0x86f2('0x35')](_0x1347e6[_0x86f2('0x2f')],qs['fields'](_0x2d3608[_0x86f2('0x31')]['fields']));_0x4d410e[_0x86f2('0x34')]=_0x4d410e['attributes'][_0x86f2('0x37')]?_0x4d410e[_0x86f2('0x34')]:_0x1347e6[_0x86f2('0x2f')];if(_0x2d3608[_0x86f2('0x31')][_0x86f2('0x3f')]){_0x4d410e[_0x86f2('0x44')]=[{'all':!![]}];}_0x4d410e=_['merge']({},_0x4d410e,_0x2d3608[_0x86f2('0x45')]);return db[_0x86f2('0x2a')]['find'](_0x4d410e)[_0x86f2('0x24')](handleEntityNotFound(_0x241404,null))[_0x86f2('0x24')](respondWithResult(_0x241404,null))[_0x86f2('0x41')](handleError(_0x241404,null));};exports['create']=function(_0x552471,_0x41ff08){return db[_0x86f2('0x2a')][_0x86f2('0x46')](_0x552471['body'],{})[_0x86f2('0x24')](respondWithResult(_0x41ff08,0xc9))[_0x86f2('0x41')](handleError(_0x41ff08,null));};exports[_0x86f2('0x23')]=function(_0x124efb,_0x258ccb){if(_0x124efb[_0x86f2('0x47')]['id']){delete _0x124efb[_0x86f2('0x47')]['id'];}return db[_0x86f2('0x2a')][_0x86f2('0x48')]({'where':{'id':_0x124efb[_0x86f2('0x43')]['id']}})['then'](handleEntityNotFound(_0x258ccb,null))[_0x86f2('0x24')](saveUpdates(_0x124efb[_0x86f2('0x47')],null))[_0x86f2('0x24')](respondWithResult(_0x258ccb,null))[_0x86f2('0x41')](handleError(_0x258ccb,null));};exports[_0x86f2('0x25')]=function(_0x4902e3,_0x2dc7d5){return db[_0x86f2('0x2a')][_0x86f2('0x48')]({'where':{'id':_0x4902e3[_0x86f2('0x43')]['id']}})[_0x86f2('0x24')](handleEntityNotFound(_0x2dc7d5,null))['then'](removeEntity(_0x2dc7d5,null))[_0x86f2('0x41')](handleError(_0x2dc7d5,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 7e69ee2..9a4c905 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 _0x1f05=['vtiger_unique_index','FieldId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','VtigerField','int_vtiger_fields'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0x1f05,0x1bc));var _0x51f0=function(_0xca15a6,_0x366acb){_0xca15a6=_0xca15a6-0x0;var _0x118b13=_0x1f05[_0xca15a6];return _0x118b13;};'use strict';var _=require(_0x51f0('0x0'));var util=require('util');var logger=require(_0x51f0('0x1'))(_0x51f0('0x2'));var moment=require('moment');var BPromise=require(_0x51f0('0x3'));var rp=require(_0x51f0('0x4'));var fs=require('fs');var path=require(_0x51f0('0x5'));var rimraf=require(_0x51f0('0x6'));var config=require(_0x51f0('0x7'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x1dc67b,_0x53c8f9){return _0x1dc67b[_0x51f0('0x8')](_0x51f0('0x9'),attributes,{'tableName':_0x51f0('0xa'),'paranoid':![],'indexes':[{'name':_0x51f0('0xb'),'fields':['idField',_0x51f0('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1181=['exports','define','VtigerField','vtiger_unique_index','FieldId','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x1181,0x7a));var _0x1118=function(_0xfd9b19,_0x21d75f){_0xfd9b19=_0xfd9b19-0x0;var _0x514918=_0x1181[_0xfd9b19];return _0x514918;};'use strict';var _=require('lodash');var util=require(_0x1118('0x0'));var logger=require(_0x1118('0x1'))('api');var moment=require(_0x1118('0x2'));var BPromise=require(_0x1118('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1118('0x4'));var rimraf=require(_0x1118('0x5'));var config=require(_0x1118('0x6'));var attributes=require(_0x1118('0x7'));module[_0x1118('0x8')]=function(_0x4e2f45,_0x4c5342){return _0x4e2f45[_0x1118('0x9')](_0x1118('0xa'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x1118('0xb'),'fields':['idField',_0x1118('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 77ae626..3ff351e 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 _0xbbc1=['info','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5b1844,_0x274b04){var _0x2ca355=function(_0x18d9ac){while(--_0x18d9ac){_0x5b1844['push'](_0x5b1844['shift']());}};_0x2ca355(++_0x274b04);}(_0xbbc1,0x8e));var _0x1bbc=function(_0x158b72,_0xc0c898){_0x158b72=_0x158b72-0x0;var _0x3c7fc8=_0xbbc1[_0x158b72];return _0x3c7fc8;};'use strict';var _=require(_0x1bbc('0x0'));var util=require(_0x1bbc('0x1'));var moment=require(_0x1bbc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bbc('0x3'));var db=require(_0x1bbc('0x4'))['db'];var utils=require(_0x1bbc('0x5'));var logger=require('../../config/logger')(_0x1bbc('0x6'));var config=require(_0x1bbc('0x7'));var jayson=require(_0x1bbc('0x8'));var client=jayson[_0x1bbc('0x9')][_0x1bbc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40824c,_0xfe90be,_0x17abfc){return new BPromise(function(_0x543939,_0x5b53a5){return client[_0x1bbc('0xb')](_0x40824c,_0x17abfc)['then'](function(_0x4cc44b){logger[_0x1bbc('0xc')]('VtigerField,\x20%s,\x20%s',_0xfe90be,'request\x20sent');logger['debug'](_0x1bbc('0xd'),_0xfe90be,_0x1bbc('0xe'),JSON[_0x1bbc('0xf')](_0x4cc44b));if(_0x4cc44b['error']){if(_0x4cc44b[_0x1bbc('0x10')][_0x1bbc('0x11')]===0x1f4){logger['error'](_0x1bbc('0x12'),_0xfe90be,_0x4cc44b['error']['message']);return _0x5b53a5(_0x4cc44b[_0x1bbc('0x10')]['message']);}logger[_0x1bbc('0x10')]('VtigerField,\x20%s,\x20%s',_0xfe90be,_0x4cc44b[_0x1bbc('0x10')][_0x1bbc('0x13')]);return _0x543939(_0x4cc44b[_0x1bbc('0x10')][_0x1bbc('0x13')]);}else{logger[_0x1bbc('0xc')](_0x1bbc('0x12'),_0xfe90be,_0x1bbc('0xe'));_0x543939(_0x4cc44b[_0x1bbc('0x14')][_0x1bbc('0x13')]);}})[_0x1bbc('0x15')](function(_0x2b690f){logger[_0x1bbc('0x10')]('VtigerField,\x20%s,\x20%s',_0xfe90be,_0x2b690f);_0x5b53a5(_0x2b690f);});});} \ No newline at end of file +var _0xd5db=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VtigerField,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring'];(function(_0x4618da,_0x27c024){var _0xede04a=function(_0x2bdf4c){while(--_0x2bdf4c){_0x4618da['push'](_0x4618da['shift']());}};_0xede04a(++_0x27c024);}(_0xd5db,0x176));var _0xbd5d=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xd5db[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0xbd5d('0x0'));var util=require(_0xbd5d('0x1'));var moment=require(_0xbd5d('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd5d('0x3'));var fs=require('fs');var Redis=require(_0xbd5d('0x4'));var db=require(_0xbd5d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd5d('0x6'))(_0xbd5d('0x7'));var config=require(_0xbd5d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbd5d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x142cbf,_0x5ede7d,_0x510d7d){return new BPromise(function(_0x8d779d,_0x5b7022){return client['request'](_0x142cbf,_0x510d7d)[_0xbd5d('0xa')](function(_0x582778){logger[_0xbd5d('0xb')]('VtigerField,\x20%s,\x20%s',_0x5ede7d,_0xbd5d('0xc'));logger['debug'](_0xbd5d('0xd'),_0x5ede7d,_0xbd5d('0xc'),JSON[_0xbd5d('0xe')](_0x582778));if(_0x582778[_0xbd5d('0xf')]){if(_0x582778['error'][_0xbd5d('0x10')]===0x1f4){logger[_0xbd5d('0xf')]('VtigerField,\x20%s,\x20%s',_0x5ede7d,_0x582778[_0xbd5d('0xf')]['message']);return _0x5b7022(_0x582778['error'][_0xbd5d('0x11')]);}logger[_0xbd5d('0xf')](_0xbd5d('0x12'),_0x5ede7d,_0x582778[_0xbd5d('0xf')][_0xbd5d('0x11')]);return _0x8d779d(_0x582778['error'][_0xbd5d('0x11')]);}else{logger[_0xbd5d('0xb')](_0xbd5d('0x12'),_0x5ede7d,_0xbd5d('0xc'));_0x8d779d(_0x582778[_0xbd5d('0x13')][_0xbd5d('0x11')]);}})[_0xbd5d('0x14')](function(_0x9096d8){logger[_0xbd5d('0xf')](_0xbd5d('0x12'),_0x5ede7d,_0x9096d8);_0x5b7022(_0x9096d8);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 44e2ea2..55ae3e8 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 _0xf13b=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','path','connect-timeout','express'];(function(_0xd1c87,_0x4eacc6){var _0x42b9b8=function(_0x298732){while(--_0x298732){_0xd1c87['push'](_0xd1c87['shift']());}};_0x42b9b8(++_0x4eacc6);}(_0xf13b,0xf9));var _0xbf13=function(_0xc611d9,_0x1447d4){_0xc611d9=_0xc611d9-0x0;var _0xc6649e=_0xf13b[_0xc611d9];return _0xc6649e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbf13('0x0'));var timeout=require(_0xbf13('0x1'));var express=require(_0xbf13('0x2'));var router=express['Router']();var fs_extra=require(_0xbf13('0x3'));var auth=require(_0xbf13('0x4'));var interaction=require(_0xbf13('0x5'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0xbf13('0x6')]('/',auth[_0xbf13('0x7')](),controller['index']);router[_0xbf13('0x6')](_0xbf13('0x8'),auth[_0xbf13('0x7')](),controller[_0xbf13('0x9')]);router[_0xbf13('0x6')](_0xbf13('0xa'),auth[_0xbf13('0x7')](),controller[_0xbf13('0xb')]);router[_0xbf13('0x6')](_0xbf13('0xc'),auth[_0xbf13('0x7')](),controller[_0xbf13('0xd')]);router[_0xbf13('0xe')]('/',auth[_0xbf13('0x7')](),controller[_0xbf13('0xf')]);router[_0xbf13('0xe')](_0xbf13('0xa'),auth[_0xbf13('0x7')](),controller[_0xbf13('0x10')]);router[_0xbf13('0x11')](_0xbf13('0x8'),auth[_0xbf13('0x7')](),controller[_0xbf13('0x12')]);router[_0xbf13('0x13')](_0xbf13('0x8'),auth[_0xbf13('0x7')](),controller['destroy']);module[_0xbf13('0x14')]=router; \ No newline at end of file +var _0xc9c5=['util','path','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','multer'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xc9c5,0x1e3));var _0x5c9c=function(_0x48fcee,_0x431a8b){_0x48fcee=_0x48fcee-0x0;var _0x28d65a=_0xc9c5[_0x48fcee];return _0x28d65a;};'use strict';var multer=require(_0x5c9c('0x0'));var util=require(_0x5c9c('0x1'));var path=require(_0x5c9c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5c9c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5c9c('0x4'));var config=require(_0x5c9c('0x5'));var controller=require(_0x5c9c('0x6'));router[_0x5c9c('0x7')]('/',auth[_0x5c9c('0x8')](),controller[_0x5c9c('0x9')]);router['get'](_0x5c9c('0xa'),auth[_0x5c9c('0x8')](),controller[_0x5c9c('0xb')]);router['get'](_0x5c9c('0xc'),auth['isAuthenticated'](),controller[_0x5c9c('0xd')]);router[_0x5c9c('0x7')](_0x5c9c('0xe'),auth['isAuthenticated'](),controller[_0x5c9c('0xf')]);router[_0x5c9c('0x10')]('/',auth['isAuthenticated'](),controller[_0x5c9c('0x11')]);router['post'](_0x5c9c('0xc'),auth[_0x5c9c('0x8')](),controller[_0x5c9c('0x12')]);router[_0x5c9c('0x13')](_0x5c9c('0xa'),auth[_0x5c9c('0x8')](),controller[_0x5c9c('0x14')]);router[_0x5c9c('0x15')]('/:id',auth[_0x5c9c('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index cef9999..442df06 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 _0xc1fc=['password','integrationTab','newTab','exports','STRING','username','remoteUri','ENUM'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xc1fc,0x93));var _0xcc1f=function(_0x3fb3ad,_0x7e2e03){_0x3fb3ad=_0x3fb3ad-0x0;var _0x5464c1=_0xc1fc[_0x3fb3ad];return _0x5464c1;};'use strict';var Sequelize=require('sequelize');module[_0xcc1f('0x0')]={'name':{'type':Sequelize[_0xcc1f('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xcc1f('0x1')],'unique':_0xcc1f('0x2')},'password':{'type':Sequelize[_0xcc1f('0x1')]},'token':{'type':Sequelize[_0xcc1f('0x1')]},'remoteUri':{'type':Sequelize[_0xcc1f('0x1')],'unique':_0xcc1f('0x3')},'authType':{'type':Sequelize[_0xcc1f('0x4')](_0xcc1f('0x5'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xcc1f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xcc1f('0x4')](_0xcc1f('0x6'),_0xcc1f('0x7')),'defaultValue':_0xcc1f('0x6')}}; \ No newline at end of file +var _0x9b0d=['STRING','remoteUri','password','token','ENUM','integrationTab','newTab','exports'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x5053df,_0x8b254a){_0x5053df=_0x5053df-0x0;var _0x3c2daf=_0x9b0d[_0x5053df];return _0x3c2daf;};'use strict';var Sequelize=require('sequelize');module[_0xd9b0('0x0')]={'name':{'type':Sequelize[_0xd9b0('0x1')]},'description':{'type':Sequelize[_0xd9b0('0x1')]},'username':{'type':Sequelize[_0xd9b0('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xd9b0('0x1')]},'token':{'type':Sequelize[_0xd9b0('0x1')]},'remoteUri':{'type':Sequelize[_0xd9b0('0x1')],'unique':_0xd9b0('0x2')},'authType':{'type':Sequelize['ENUM'](_0xd9b0('0x3'),_0xd9b0('0x4')),'defaultValue':_0xd9b0('0x3')},'serverUrl':{'type':Sequelize[_0xd9b0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd9b0('0x5')](_0xd9b0('0x6'),_0xd9b0('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 0858c8d..6b675f5 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 _0x39cb=['count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','ZendeskConfiguration','order','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','token','authType','remoteUri','slice','substring','format','%s/%s','headers','Basic\x20%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x46f7df,_0x224a06){var _0x26e96f=function(_0xcba5b5){while(--_0xcba5b5){_0x46f7df['push'](_0x46f7df['shift']());}};_0x26e96f(++_0x224a06);}(_0x39cb,0x1bd));var _0xb39c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x39cb[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb39c('0x0'));var zipdir=require(_0xb39c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb39c('0x2'));var moment=require(_0xb39c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb39c('0x4'));var util=require(_0xb39c('0x5'));var path=require(_0xb39c('0x6'));var sox=require(_0xb39c('0x7'));var csv=require(_0xb39c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb39c('0x9'));var _=require(_0xb39c('0xa'));var squel=require(_0xb39c('0xb'));var crypto=require(_0xb39c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb39c('0x8'));var querystring=require(_0xb39c('0xd'));var Papa=require(_0xb39c('0xe'));var Redis=require(_0xb39c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb39c('0x10'));var logger=require(_0xb39c('0x11'))(_0xb39c('0x12'));var utils=require(_0xb39c('0x13'));var config=require(_0xb39c('0x14'));var licenseUtil=require(_0xb39c('0x15'));var db=require(_0xb39c('0x16'))['db'];var integrations=require(_0xb39c('0x17'));function respondWithStatusCode(_0x51ff24,_0x31e07e){_0x31e07e=_0x31e07e||0xcc;return function(_0x468995){if(_0x468995){return _0x51ff24[_0xb39c('0x18')](_0x31e07e);}return _0x51ff24['status'](_0x31e07e)[_0xb39c('0x19')]();};}function respondWithResult(_0x40a6d3,_0x42a203){_0x42a203=_0x42a203||0xc8;return function(_0x386c80){if(_0x386c80){return _0x40a6d3[_0xb39c('0x1a')](_0x42a203)[_0xb39c('0x1b')](_0x386c80);}};}function respondWithFilteredResult(_0x8e9181,_0x5277ce){return function(_0x316c9b){if(_0x316c9b){var _0x3223f6=typeof _0x5277ce[_0xb39c('0x1c')]===_0xb39c('0x1d')&&typeof _0x5277ce[_0xb39c('0x1e')]===_0xb39c('0x1d');var _0x1a2f48=_0x316c9b[_0xb39c('0x1f')];var _0x35dade=_0x3223f6?0x0:_0x5277ce[_0xb39c('0x1c')];var _0x559ad6=_0x3223f6?_0x316c9b[_0xb39c('0x1f')]:_0x5277ce[_0xb39c('0x1c')]+_0x5277ce[_0xb39c('0x1e')];var _0x447352;if(_0x559ad6>=_0x1a2f48){_0x559ad6=_0x1a2f48;_0x447352=0xc8;}else{_0x447352=0xce;}_0x8e9181['status'](_0x447352);return _0x8e9181[_0xb39c('0x20')](_0xb39c('0x21'),_0x35dade+'-'+_0x559ad6+'/'+_0x1a2f48)['json'](_0x316c9b);}return null;};}function patchUpdates(_0x2d8e93){return function(_0x363e52){try{jsonpatch[_0xb39c('0x22')](_0x363e52,_0x2d8e93,!![]);}catch(_0x4ebfca){return BPromise['reject'](_0x4ebfca);}return _0x363e52[_0xb39c('0x23')]();};}function saveUpdates(_0x1a5b9d,_0x3c8dfd){return function(_0x5719e2){if(_0x5719e2){return _0x5719e2[_0xb39c('0x24')](_0x1a5b9d)[_0xb39c('0x25')](function(_0x1bb895){return _0x1bb895;});}return null;};}function removeEntity(_0x16f3b0,_0x3b03ed){return function(_0x4a32f6){if(_0x4a32f6){return _0x4a32f6[_0xb39c('0x26')]()[_0xb39c('0x25')](function(){_0x16f3b0['status'](0xcc)[_0xb39c('0x19')]();});}};}function handleEntityNotFound(_0x4492a4,_0x39116b){return function(_0x12be70){if(!_0x12be70){_0x4492a4[_0xb39c('0x18')](0x194);}return _0x12be70;};}function handleError(_0x5453a6,_0x23a2f1){_0x23a2f1=_0x23a2f1||0x1f4;return function(_0x299c27){logger[_0xb39c('0x27')](_0x299c27['stack']);if(_0x299c27[_0xb39c('0x28')]){delete _0x299c27[_0xb39c('0x28')];}_0x5453a6['status'](_0x23a2f1)[_0xb39c('0x29')](_0x299c27);};}exports[_0xb39c('0x2a')]=function(_0x328db1,_0x4e9672){var _0x714d20={},_0x45fed4={},_0x59172f={'count':0x0,'rows':[]};var _0x2bc742=_['map'](db[_0xb39c('0x2b')][_0xb39c('0x2c')],function(_0x309697){return{'name':_0x309697[_0xb39c('0x2d')],'type':_0x309697[_0xb39c('0x2e')]['key']};});_0x45fed4[_0xb39c('0x2f')]=_['map'](_0x2bc742,_0xb39c('0x28'));_0x45fed4['query']=_[_0xb39c('0x30')](_0x328db1[_0xb39c('0x31')]);_0x45fed4[_0xb39c('0x32')]=_[_0xb39c('0x33')](_0x45fed4['model'],_0x45fed4['query']);_0x714d20[_0xb39c('0x34')]=_[_0xb39c('0x33')](_0x45fed4['model'],qs[_0xb39c('0x35')](_0x328db1[_0xb39c('0x31')][_0xb39c('0x35')]));_0x714d20[_0xb39c('0x34')]=_0x714d20[_0xb39c('0x34')][_0xb39c('0x36')]?_0x714d20[_0xb39c('0x34')]:_0x45fed4[_0xb39c('0x2f')];if(!_0x328db1[_0xb39c('0x31')][_0xb39c('0x37')](_0xb39c('0x38'))){_0x714d20[_0xb39c('0x1e')]=qs[_0xb39c('0x1e')](_0x328db1[_0xb39c('0x31')][_0xb39c('0x1e')]);_0x714d20[_0xb39c('0x1c')]=qs[_0xb39c('0x1c')](_0x328db1[_0xb39c('0x31')][_0xb39c('0x1c')]);}_0x714d20['order']=qs[_0xb39c('0x39')](_0x328db1[_0xb39c('0x31')]['sort']);_0x714d20['where']=qs['filters'](_[_0xb39c('0x3a')](_0x328db1[_0xb39c('0x31')],_0x45fed4[_0xb39c('0x32')]),_0x2bc742);if(_0x328db1['query'][_0xb39c('0x3b')]){_0x714d20[_0xb39c('0x3c')]=_[_0xb39c('0x3d')](_0x714d20[_0xb39c('0x3c')],{'$or':_[_0xb39c('0x3e')](_0x2bc742,function(_0x4b51ac){if(_0x4b51ac[_0xb39c('0x2e')]!==_0xb39c('0x3f')){var _0x51b489={};_0x51b489[_0x4b51ac[_0xb39c('0x28')]]={'$like':'%'+_0x328db1['query'][_0xb39c('0x3b')]+'%'};return _0x51b489;}})});}_0x714d20=_[_0xb39c('0x3d')]({},_0x714d20,_0x328db1[_0xb39c('0x40')]);var _0x4c043a={'where':_0x714d20[_0xb39c('0x3c')]};return db[_0xb39c('0x2b')][_0xb39c('0x1f')](_0x4c043a)[_0xb39c('0x25')](function(_0x10b87b){_0x59172f[_0xb39c('0x1f')]=_0x10b87b;if(_0x328db1[_0xb39c('0x31')][_0xb39c('0x41')]){_0x714d20[_0xb39c('0x42')]=[{'all':!![]}];}return db[_0xb39c('0x2b')][_0xb39c('0x43')](_0x714d20);})[_0xb39c('0x25')](function(_0x53347e){_0x59172f[_0xb39c('0x44')]=_0x53347e;return _0x59172f;})[_0xb39c('0x25')](respondWithFilteredResult(_0x4e9672,_0x714d20))[_0xb39c('0x45')](handleError(_0x4e9672,null));};exports[_0xb39c('0x46')]=function(_0x3d301e,_0x390cd7){var _0x1db549={'raw':![],'where':{'id':_0x3d301e[_0xb39c('0x47')]['id']}},_0x8cb33a={};_0x8cb33a['model']=_['keys'](db[_0xb39c('0x2b')][_0xb39c('0x2c')]);_0x8cb33a['query']=_['keys'](_0x3d301e[_0xb39c('0x31')]);_0x8cb33a['filters']=_[_0xb39c('0x33')](_0x8cb33a[_0xb39c('0x2f')],_0x8cb33a[_0xb39c('0x31')]);_0x1db549[_0xb39c('0x34')]=_[_0xb39c('0x33')](_0x8cb33a['model'],qs[_0xb39c('0x35')](_0x3d301e[_0xb39c('0x31')]['fields']));_0x1db549['attributes']=_0x1db549[_0xb39c('0x34')]['length']?_0x1db549['attributes']:_0x8cb33a[_0xb39c('0x2f')];if(_0x3d301e[_0xb39c('0x31')][_0xb39c('0x41')]){_0x1db549[_0xb39c('0x42')]=[{'all':!![]}];}_0x1db549=_[_0xb39c('0x3d')]({},_0x1db549,_0x3d301e[_0xb39c('0x40')]);return db[_0xb39c('0x2b')][_0xb39c('0x48')](_0x1db549)[_0xb39c('0x25')](handleEntityNotFound(_0x390cd7,null))[_0xb39c('0x25')](respondWithResult(_0x390cd7,null))['catch'](handleError(_0x390cd7,null));};exports[_0xb39c('0x49')]=function(_0x7e9750,_0xe329bf){return db[_0xb39c('0x2b')][_0xb39c('0x49')](_0x7e9750[_0xb39c('0x4a')],{})[_0xb39c('0x25')](respondWithResult(_0xe329bf,0xc9))[_0xb39c('0x45')](handleError(_0xe329bf,null));};exports[_0xb39c('0x24')]=function(_0x1ae2cb,_0x2150aa){if(_0x1ae2cb[_0xb39c('0x4a')]['id']){delete _0x1ae2cb[_0xb39c('0x4a')]['id'];}return db[_0xb39c('0x2b')][_0xb39c('0x48')]({'where':{'id':_0x1ae2cb[_0xb39c('0x47')]['id']}})['then'](handleEntityNotFound(_0x2150aa,null))[_0xb39c('0x25')](saveUpdates(_0x1ae2cb[_0xb39c('0x4a')],null))[_0xb39c('0x25')](respondWithResult(_0x2150aa,null))[_0xb39c('0x45')](handleError(_0x2150aa,null));};exports[_0xb39c('0x26')]=function(_0x18db8f,_0xd4f368){return db[_0xb39c('0x2b')]['find']({'where':{'id':_0x18db8f['params']['id']}})[_0xb39c('0x25')](handleEntityNotFound(_0xd4f368,null))[_0xb39c('0x25')](removeEntity(_0xd4f368,null))['catch'](handleError(_0xd4f368,null));};exports['getConfigurations']=function(_0x226f60,_0x1d1abf,_0x538258){var _0x2a55db={};var _0x55b6b1={};var _0x5e367e;var _0x2d88dd;return db['ZendeskAccount'][_0xb39c('0x4b')]({'where':{'id':_0x226f60[_0xb39c('0x47')]['id']}})[_0xb39c('0x25')](handleEntityNotFound(_0x1d1abf,null))[_0xb39c('0x25')](function(_0x2f2944){if(_0x2f2944){_0x5e367e=_0x2f2944;_0x55b6b1[_0xb39c('0x2f')]=_['keys'](db[_0xb39c('0x4c')][_0xb39c('0x2c')]);_0x55b6b1[_0xb39c('0x31')]=_[_0xb39c('0x30')](_0x226f60[_0xb39c('0x31')]);_0x55b6b1['filters']=_[_0xb39c('0x33')](_0x55b6b1['model'],_0x55b6b1[_0xb39c('0x31')]);_0x2a55db[_0xb39c('0x34')]=_[_0xb39c('0x33')](_0x55b6b1[_0xb39c('0x2f')],qs[_0xb39c('0x35')](_0x226f60[_0xb39c('0x31')][_0xb39c('0x35')]));_0x2a55db[_0xb39c('0x34')]=_0x2a55db[_0xb39c('0x34')][_0xb39c('0x36')]?_0x2a55db[_0xb39c('0x34')]:_0x55b6b1[_0xb39c('0x2f')];_0x2a55db[_0xb39c('0x4d')]=qs[_0xb39c('0x39')](_0x226f60[_0xb39c('0x31')][_0xb39c('0x39')]);_0x2a55db[_0xb39c('0x3c')]=qs[_0xb39c('0x32')](_[_0xb39c('0x3a')](_0x226f60['query'],_0x55b6b1['filters']));if(_0x226f60[_0xb39c('0x31')][_0xb39c('0x3b')]){_0x2a55db['where']=_[_0xb39c('0x3d')](_0x2a55db[_0xb39c('0x3c')],{'$or':_['map'](_0x2a55db[_0xb39c('0x34')],function(_0x121545){var _0x129d1f={};_0x129d1f[_0x121545]={'$like':'%'+_0x226f60[_0xb39c('0x31')][_0xb39c('0x3b')]+'%'};return _0x129d1f;})});}_0x2a55db=_[_0xb39c('0x3d')]({},_0x2a55db,_0x226f60['options']);return _0x5e367e[_0xb39c('0x4e')](_0x2a55db);}})[_0xb39c('0x25')](function(_0x1c16c5){if(_0x1c16c5){_0x2d88dd=_0x1c16c5[_0xb39c('0x36')];if(!_0x226f60[_0xb39c('0x31')][_0xb39c('0x37')](_0xb39c('0x38'))){_0x2a55db['limit']=qs[_0xb39c('0x1e')](_0x226f60[_0xb39c('0x31')][_0xb39c('0x1e')]);_0x2a55db[_0xb39c('0x1c')]=qs[_0xb39c('0x1c')](_0x226f60['query']['offset']);}return _0x5e367e[_0xb39c('0x4e')](_0x2a55db);}})[_0xb39c('0x25')](function(_0x26b55f){if(_0x26b55f){return _0x26b55f?{'count':_0x2d88dd,'rows':_0x26b55f}:null;}})['then'](respondWithResult(_0x1d1abf,null))[_0xb39c('0x45')](handleError(_0x1d1abf,null));};exports['addConfiguration']=function(_0x2f3c24,_0x5ce5fb,_0x1abe57){if(_0x2f3c24[_0xb39c('0x4a')]['id']){delete _0x2f3c24[_0xb39c('0x4a')]['id'];}return db['ZendeskAccount'][_0xb39c('0x4b')]({'where':{'id':_0x2f3c24[_0xb39c('0x47')]['id']}})[_0xb39c('0x25')](handleEntityNotFound(_0x5ce5fb,null))[_0xb39c('0x25')](function(_0x3e8783){if(_0x3e8783){_0x2f3c24[_0xb39c('0x4a')][_0xb39c('0x4f')]=_0x3e8783['id'];_0x2f3c24[_0xb39c('0x4a')][_0xb39c('0x50')]=integrations[_0xb39c('0x51')](_0x2f3c24[_0xb39c('0x4a')][_0xb39c('0x52')],_0x2f3c24[_0xb39c('0x4a')][_0xb39c('0x2e')]);_0x2f3c24[_0xb39c('0x4a')][_0xb39c('0x53')]=integrations[_0xb39c('0x54')](_0x2f3c24['body'][_0xb39c('0x52')],_0x2f3c24[_0xb39c('0x4a')][_0xb39c('0x2e')]);return db['ZendeskConfiguration'][_0xb39c('0x49')](_0x2f3c24['body'],{'include':[{'model':db['ZendeskField'],'as':_0xb39c('0x50')},{'model':db[_0xb39c('0x55')],'as':_0xb39c('0x53')}]});}return null;})[_0xb39c('0x25')](respondWithResult(_0x5ce5fb,null))[_0xb39c('0x45')](handleError(_0x5ce5fb,null));};exports['getFields']=function(_0x5de073,_0x26d08c,_0x27723c){var _0x5cfd2a='';return db[_0xb39c('0x2b')][_0xb39c('0x4b')]({'where':{'id':_0x5de073[_0xb39c('0x47')]['id']},'attributes':['id',_0xb39c('0x56'),_0xb39c('0x57'),_0xb39c('0x58'),_0xb39c('0x59'),_0xb39c('0x5a')]})[_0xb39c('0x25')](handleEntityNotFound(_0x26d08c,null))[_0xb39c('0x25')](function(_0xb5e7fb){if(_0xb5e7fb){_0x5cfd2a=_0xb5e7fb[_0xb39c('0x5a')];var _0x29b793=_0x5cfd2a[_0xb39c('0x5b')](-0x1);if(_0x29b793==='/'){_0x5cfd2a=_0x5cfd2a[_0xb39c('0x5c')](0x0,_0x5cfd2a['lastIndexOf'](_0x29b793));}var _0x2bba77={'method':'GET','uri':util[_0xb39c('0x5d')](_0xb39c('0x5e'),_0x5cfd2a,'ticket_fields'),'json':!![]};switch(_0xb5e7fb[_0xb39c('0x59')]){case _0xb39c('0x57'):_0x2bba77[_0xb39c('0x5f')]={'Authorization':util[_0xb39c('0x5d')](_0xb39c('0x60'),new Buffer(util[_0xb39c('0x5d')]('%s:%s',_0xb5e7fb[_0xb39c('0x56')],_0xb5e7fb[_0xb39c('0x57')]))[_0xb39c('0x61')](_0xb39c('0x62')))};break;case _0xb39c('0x58'):_0x2bba77[_0xb39c('0x5f')]={'Authorization':util[_0xb39c('0x5d')](_0xb39c('0x60'),new Buffer(util[_0xb39c('0x5d')]('%s/token:%s',_0xb5e7fb[_0xb39c('0x56')],_0xb5e7fb[_0xb39c('0x58')]))[_0xb39c('0x61')](_0xb39c('0x62')))};break;default:throw new db[(_0xb39c('0x63'))][(_0xb39c('0x64'))](_0xb39c('0x65'));}return rp(_0x2bba77);}})['then'](function(_0x29b32c){if(_0x29b32c){var _0xe23f8=[_0xb39c('0x66'),_0xb39c('0x67'),_0xb39c('0x68'),_0xb39c('0x69')];_[_0xb39c('0x6a')](_0x29b32c[_0xb39c('0x6b')],function(_0x483be1){return _0xe23f8[_0xb39c('0x6c')](_0x483be1['type']);});return{'count':_0x29b32c[_0xb39c('0x6b')][_0xb39c('0x36')],'rows':_[_0xb39c('0x3e')](_0x29b32c[_0xb39c('0x6b')],function(_0x37f395){return{'id':_0x37f395['id'],'name':_0x37f395[_0xb39c('0x6d')]>0x7?_0x37f395[_0xb39c('0x6e')]:_0x37f395[_0xb39c('0x2e')],'custom':_0x37f395['position']>0x7?!![]:![],'options':_0x37f395[_0xb39c('0x6f')]?_0x37f395[_0xb39c('0x6f')]:_0x37f395[_0xb39c('0x70')]?_0x37f395[_0xb39c('0x70')]:[]};})};}})[_0xb39c('0x25')](respondWithResult(_0x26d08c,null))[_0xb39c('0x45')](function(_0x26f2a0){var _0x46dcef=_0x5de073[_0xb39c('0x31')][_0xb39c('0x71')]?0x1f4:_0x26f2a0[_0xb39c('0x72')]||0x1f4;logger[_0xb39c('0x27')](_0xb39c('0x73'),_0xb39c('0x74'),_0x46dcef,JSON[_0xb39c('0x75')](_0x26f2a0));delete _0x26f2a0[_0xb39c('0x28')];if(_0x46dcef===0x191){_0x46dcef=0x190;}_0x26d08c['status'](_0x46dcef)['send'](_0x5de073[_0xb39c('0x31')][_0xb39c('0x71')]?{'message':_0xb39c('0x76'),'statusCode':_0x26f2a0['statusCode']}:_0x26f2a0);});}; \ No newline at end of file +var _0x3f8c=['%s/%s','headers','Basic\x20%s','%s:%s','toString','base64','token','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','ticket_fields','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','ZendeskAccount','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','username','password','authType','remoteUri','substring','lastIndexOf','format'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3f8c,0x104));var _0xc3f8=function(_0x51db34,_0x1e5241){_0x51db34=_0x51db34-0x0;var _0x8ac68d=_0x3f8c[_0x51db34];return _0x8ac68d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];var integrations=require(_0xc3f8('0x16'));function respondWithStatusCode(_0x155c80,_0x511763){_0x511763=_0x511763||0xcc;return function(_0x84f489){if(_0x84f489){return _0x155c80[_0xc3f8('0x17')](_0x511763);}return _0x155c80[_0xc3f8('0x18')](_0x511763)[_0xc3f8('0x19')]();};}function respondWithResult(_0x6155e9,_0x47754c){_0x47754c=_0x47754c||0xc8;return function(_0x29e2b6){if(_0x29e2b6){return _0x6155e9[_0xc3f8('0x18')](_0x47754c)[_0xc3f8('0x1a')](_0x29e2b6);}};}function respondWithFilteredResult(_0x2fd8e8,_0x3cb28a){return function(_0x2a9f64){if(_0x2a9f64){var _0x29d031=typeof _0x3cb28a['offset']===_0xc3f8('0x1b')&&typeof _0x3cb28a['limit']==='undefined';var _0x3df137=_0x2a9f64[_0xc3f8('0x1c')];var _0x35500f=_0x29d031?0x0:_0x3cb28a[_0xc3f8('0x1d')];var _0x47a185=_0x29d031?_0x2a9f64[_0xc3f8('0x1c')]:_0x3cb28a[_0xc3f8('0x1d')]+_0x3cb28a['limit'];var _0xe14074;if(_0x47a185>=_0x3df137){_0x47a185=_0x3df137;_0xe14074=0xc8;}else{_0xe14074=0xce;}_0x2fd8e8['status'](_0xe14074);return _0x2fd8e8[_0xc3f8('0x1e')](_0xc3f8('0x1f'),_0x35500f+'-'+_0x47a185+'/'+_0x3df137)[_0xc3f8('0x1a')](_0x2a9f64);}return null;};}function patchUpdates(_0x53ada5){return function(_0x543dca){try{jsonpatch[_0xc3f8('0x20')](_0x543dca,_0x53ada5,!![]);}catch(_0x2a7096){return BPromise[_0xc3f8('0x21')](_0x2a7096);}return _0x543dca[_0xc3f8('0x22')]();};}function saveUpdates(_0x6522e9,_0x251bf7){return function(_0x43b2b4){if(_0x43b2b4){return _0x43b2b4[_0xc3f8('0x23')](_0x6522e9)['then'](function(_0x571f92){return _0x571f92;});}return null;};}function removeEntity(_0x4b83f0,_0x2559a4){return function(_0x5e1d14){if(_0x5e1d14){return _0x5e1d14[_0xc3f8('0x24')]()[_0xc3f8('0x25')](function(){_0x4b83f0['status'](0xcc)[_0xc3f8('0x19')]();});}};}function handleEntityNotFound(_0x327b2d,_0x2d237e){return function(_0xb883b5){if(!_0xb883b5){_0x327b2d[_0xc3f8('0x17')](0x194);}return _0xb883b5;};}function handleError(_0x9d43b4,_0xf1d460){_0xf1d460=_0xf1d460||0x1f4;return function(_0x7f14ad){logger[_0xc3f8('0x26')](_0x7f14ad[_0xc3f8('0x27')]);if(_0x7f14ad[_0xc3f8('0x28')]){delete _0x7f14ad[_0xc3f8('0x28')];}_0x9d43b4[_0xc3f8('0x18')](_0xf1d460)[_0xc3f8('0x29')](_0x7f14ad);};}exports['index']=function(_0x58b303,_0x2909f8){var _0x218029={},_0x5bf6e2={},_0x151bba={'count':0x0,'rows':[]};var _0x4d39a0=_[_0xc3f8('0x2a')](db[_0xc3f8('0x2b')]['rawAttributes'],function(_0x48b32e){return{'name':_0x48b32e[_0xc3f8('0x2c')],'type':_0x48b32e[_0xc3f8('0x2d')][_0xc3f8('0x2e')]};});_0x5bf6e2[_0xc3f8('0x2f')]=_[_0xc3f8('0x2a')](_0x4d39a0,_0xc3f8('0x28'));_0x5bf6e2[_0xc3f8('0x30')]=_[_0xc3f8('0x31')](_0x58b303[_0xc3f8('0x30')]);_0x5bf6e2[_0xc3f8('0x32')]=_['intersection'](_0x5bf6e2[_0xc3f8('0x2f')],_0x5bf6e2[_0xc3f8('0x30')]);_0x218029[_0xc3f8('0x33')]=_[_0xc3f8('0x34')](_0x5bf6e2[_0xc3f8('0x2f')],qs['fields'](_0x58b303['query'][_0xc3f8('0x35')]));_0x218029[_0xc3f8('0x33')]=_0x218029[_0xc3f8('0x33')][_0xc3f8('0x36')]?_0x218029[_0xc3f8('0x33')]:_0x5bf6e2['model'];if(!_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x37')](_0xc3f8('0x38'))){_0x218029['limit']=qs[_0xc3f8('0x39')](_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x39')]);_0x218029['offset']=qs[_0xc3f8('0x1d')](_0x58b303[_0xc3f8('0x30')]['offset']);}_0x218029[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3b')](_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x3b')]);_0x218029[_0xc3f8('0x3c')]=qs[_0xc3f8('0x32')](_['pick'](_0x58b303[_0xc3f8('0x30')],_0x5bf6e2[_0xc3f8('0x32')]),_0x4d39a0);if(_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x3d')]){_0x218029[_0xc3f8('0x3c')]=_['merge'](_0x218029[_0xc3f8('0x3c')],{'$or':_[_0xc3f8('0x2a')](_0x4d39a0,function(_0xaa4c98){if(_0xaa4c98['type']!==_0xc3f8('0x3e')){var _0x83b7ab={};_0x83b7ab[_0xaa4c98[_0xc3f8('0x28')]]={'$like':'%'+_0x58b303[_0xc3f8('0x30')]['filter']+'%'};return _0x83b7ab;}})});}_0x218029=_[_0xc3f8('0x3f')]({},_0x218029,_0x58b303[_0xc3f8('0x40')]);var _0x2df096={'where':_0x218029[_0xc3f8('0x3c')]};return db['ZendeskAccount'][_0xc3f8('0x1c')](_0x2df096)['then'](function(_0x5d144b){_0x151bba[_0xc3f8('0x1c')]=_0x5d144b;if(_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x41')]){_0x218029[_0xc3f8('0x42')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x218029);})[_0xc3f8('0x25')](function(_0x16805c){_0x151bba[_0xc3f8('0x43')]=_0x16805c;return _0x151bba;})[_0xc3f8('0x25')](respondWithFilteredResult(_0x2909f8,_0x218029))[_0xc3f8('0x44')](handleError(_0x2909f8,null));};exports[_0xc3f8('0x45')]=function(_0x3113b4,_0x45e6ea){var _0x13d8dc={'raw':![],'where':{'id':_0x3113b4[_0xc3f8('0x46')]['id']}},_0x34bccd={};_0x34bccd['model']=_[_0xc3f8('0x31')](db[_0xc3f8('0x2b')]['rawAttributes']);_0x34bccd[_0xc3f8('0x30')]=_[_0xc3f8('0x31')](_0x3113b4['query']);_0x34bccd[_0xc3f8('0x32')]=_[_0xc3f8('0x34')](_0x34bccd[_0xc3f8('0x2f')],_0x34bccd[_0xc3f8('0x30')]);_0x13d8dc[_0xc3f8('0x33')]=_[_0xc3f8('0x34')](_0x34bccd[_0xc3f8('0x2f')],qs[_0xc3f8('0x35')](_0x3113b4[_0xc3f8('0x30')][_0xc3f8('0x35')]));_0x13d8dc[_0xc3f8('0x33')]=_0x13d8dc['attributes'][_0xc3f8('0x36')]?_0x13d8dc[_0xc3f8('0x33')]:_0x34bccd['model'];if(_0x3113b4[_0xc3f8('0x30')][_0xc3f8('0x41')]){_0x13d8dc[_0xc3f8('0x42')]=[{'all':!![]}];}_0x13d8dc=_[_0xc3f8('0x3f')]({},_0x13d8dc,_0x3113b4['options']);return db['ZendeskAccount'][_0xc3f8('0x47')](_0x13d8dc)[_0xc3f8('0x25')](handleEntityNotFound(_0x45e6ea,null))[_0xc3f8('0x25')](respondWithResult(_0x45e6ea,null))['catch'](handleError(_0x45e6ea,null));};exports[_0xc3f8('0x48')]=function(_0x3a665e,_0x418961){return db[_0xc3f8('0x2b')][_0xc3f8('0x48')](_0x3a665e['body'],{})[_0xc3f8('0x25')](respondWithResult(_0x418961,0xc9))[_0xc3f8('0x44')](handleError(_0x418961,null));};exports['update']=function(_0x1becae,_0x3fcb6a){if(_0x1becae[_0xc3f8('0x49')]['id']){delete _0x1becae[_0xc3f8('0x49')]['id'];}return db[_0xc3f8('0x2b')][_0xc3f8('0x47')]({'where':{'id':_0x1becae[_0xc3f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fcb6a,null))[_0xc3f8('0x25')](saveUpdates(_0x1becae[_0xc3f8('0x49')],null))['then'](respondWithResult(_0x3fcb6a,null))[_0xc3f8('0x44')](handleError(_0x3fcb6a,null));};exports[_0xc3f8('0x24')]=function(_0x2448bf,_0x33e5c5){return db[_0xc3f8('0x2b')][_0xc3f8('0x47')]({'where':{'id':_0x2448bf[_0xc3f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x33e5c5,null))[_0xc3f8('0x25')](removeEntity(_0x33e5c5,null))[_0xc3f8('0x44')](handleError(_0x33e5c5,null));};exports[_0xc3f8('0x4a')]=function(_0x267c95,_0x3e6c1d,_0x3d752a){var _0x97a88e={};var _0x920f4b={};var _0x4fc02c;var _0x51249a;return db[_0xc3f8('0x2b')][_0xc3f8('0x4b')]({'where':{'id':_0x267c95['params']['id']}})['then'](handleEntityNotFound(_0x3e6c1d,null))[_0xc3f8('0x25')](function(_0x4b4adb){if(_0x4b4adb){_0x4fc02c=_0x4b4adb;_0x920f4b[_0xc3f8('0x2f')]=_[_0xc3f8('0x31')](db[_0xc3f8('0x4c')]['rawAttributes']);_0x920f4b[_0xc3f8('0x30')]=_['keys'](_0x267c95['query']);_0x920f4b[_0xc3f8('0x32')]=_['intersection'](_0x920f4b[_0xc3f8('0x2f')],_0x920f4b[_0xc3f8('0x30')]);_0x97a88e[_0xc3f8('0x33')]=_['intersection'](_0x920f4b[_0xc3f8('0x2f')],qs[_0xc3f8('0x35')](_0x267c95[_0xc3f8('0x30')][_0xc3f8('0x35')]));_0x97a88e[_0xc3f8('0x33')]=_0x97a88e['attributes']['length']?_0x97a88e[_0xc3f8('0x33')]:_0x920f4b[_0xc3f8('0x2f')];_0x97a88e[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3b')](_0x267c95[_0xc3f8('0x30')]['sort']);_0x97a88e[_0xc3f8('0x3c')]=qs['filters'](_[_0xc3f8('0x4d')](_0x267c95[_0xc3f8('0x30')],_0x920f4b[_0xc3f8('0x32')]));if(_0x267c95[_0xc3f8('0x30')]['filter']){_0x97a88e[_0xc3f8('0x3c')]=_['merge'](_0x97a88e['where'],{'$or':_['map'](_0x97a88e['attributes'],function(_0x12df02){var _0x143d50={};_0x143d50[_0x12df02]={'$like':'%'+_0x267c95[_0xc3f8('0x30')][_0xc3f8('0x3d')]+'%'};return _0x143d50;})});}_0x97a88e=_[_0xc3f8('0x3f')]({},_0x97a88e,_0x267c95[_0xc3f8('0x40')]);return _0x4fc02c[_0xc3f8('0x4a')](_0x97a88e);}})[_0xc3f8('0x25')](function(_0x5250df){if(_0x5250df){_0x51249a=_0x5250df[_0xc3f8('0x36')];if(!_0x267c95[_0xc3f8('0x30')][_0xc3f8('0x37')](_0xc3f8('0x38'))){_0x97a88e[_0xc3f8('0x39')]=qs['limit'](_0x267c95[_0xc3f8('0x30')][_0xc3f8('0x39')]);_0x97a88e[_0xc3f8('0x1d')]=qs[_0xc3f8('0x1d')](_0x267c95[_0xc3f8('0x30')]['offset']);}return _0x4fc02c[_0xc3f8('0x4a')](_0x97a88e);}})[_0xc3f8('0x25')](function(_0x42b255){if(_0x42b255){return _0x42b255?{'count':_0x51249a,'rows':_0x42b255}:null;}})[_0xc3f8('0x25')](respondWithResult(_0x3e6c1d,null))[_0xc3f8('0x44')](handleError(_0x3e6c1d,null));};exports[_0xc3f8('0x4e')]=function(_0x56fd61,_0x2f199d,_0x4ca426){if(_0x56fd61[_0xc3f8('0x49')]['id']){delete _0x56fd61['body']['id'];}return db[_0xc3f8('0x2b')][_0xc3f8('0x4b')]({'where':{'id':_0x56fd61['params']['id']}})['then'](handleEntityNotFound(_0x2f199d,null))[_0xc3f8('0x25')](function(_0x2c7ab9){if(_0x2c7ab9){_0x56fd61['body'][_0xc3f8('0x4f')]=_0x2c7ab9['id'];_0x56fd61[_0xc3f8('0x49')][_0xc3f8('0x50')]=integrations[_0xc3f8('0x51')](_0x56fd61[_0xc3f8('0x49')][_0xc3f8('0x52')],_0x56fd61[_0xc3f8('0x49')][_0xc3f8('0x2d')]);_0x56fd61['body']['Descriptions']=integrations[_0xc3f8('0x53')](_0x56fd61['body']['channel'],_0x56fd61['body']['type']);return db['ZendeskConfiguration'][_0xc3f8('0x48')](_0x56fd61[_0xc3f8('0x49')],{'include':[{'model':db[_0xc3f8('0x54')],'as':_0xc3f8('0x50')},{'model':db['ZendeskField'],'as':_0xc3f8('0x55')}]});}return null;})[_0xc3f8('0x25')](respondWithResult(_0x2f199d,null))['catch'](handleError(_0x2f199d,null));};exports[_0xc3f8('0x56')]=function(_0x273faf,_0x104eec,_0x531de8){var _0xaedf89='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x273faf['params']['id']},'attributes':['id',_0xc3f8('0x57'),_0xc3f8('0x58'),'token',_0xc3f8('0x59'),_0xc3f8('0x5a')]})['then'](handleEntityNotFound(_0x104eec,null))[_0xc3f8('0x25')](function(_0x2f957a){if(_0x2f957a){_0xaedf89=_0x2f957a['remoteUri'];var _0x34edb9=_0xaedf89['slice'](-0x1);if(_0x34edb9==='/'){_0xaedf89=_0xaedf89[_0xc3f8('0x5b')](0x0,_0xaedf89[_0xc3f8('0x5c')](_0x34edb9));}var _0x4cc654={'method':'GET','uri':util[_0xc3f8('0x5d')](_0xc3f8('0x5e'),_0xaedf89,'ticket_fields'),'json':!![]};switch(_0x2f957a[_0xc3f8('0x59')]){case'password':_0x4cc654[_0xc3f8('0x5f')]={'Authorization':util['format'](_0xc3f8('0x60'),new Buffer(util[_0xc3f8('0x5d')](_0xc3f8('0x61'),_0x2f957a[_0xc3f8('0x57')],_0x2f957a[_0xc3f8('0x58')]))[_0xc3f8('0x62')](_0xc3f8('0x63')))};break;case _0xc3f8('0x64'):_0x4cc654[_0xc3f8('0x5f')]={'Authorization':util['format'](_0xc3f8('0x60'),new Buffer(util[_0xc3f8('0x5d')](_0xc3f8('0x65'),_0x2f957a[_0xc3f8('0x57')],_0x2f957a[_0xc3f8('0x64')]))['toString'](_0xc3f8('0x63')))};break;default:throw new db[(_0xc3f8('0x66'))][(_0xc3f8('0x67'))](_0xc3f8('0x68'));}return rp(_0x4cc654);}})[_0xc3f8('0x25')](function(_0x53c815){if(_0x53c815){var _0x2f69f7=[_0xc3f8('0x69'),_0xc3f8('0x6a'),'group','assignee'];_[_0xc3f8('0x6b')](_0x53c815[_0xc3f8('0x6c')],function(_0x1a9c33){return _0x2f69f7[_0xc3f8('0x6d')](_0x1a9c33['type']);});return{'count':_0x53c815[_0xc3f8('0x6c')][_0xc3f8('0x36')],'rows':_[_0xc3f8('0x2a')](_0x53c815['ticket_fields'],function(_0x2a29fa){return{'id':_0x2a29fa['id'],'name':_0x2a29fa[_0xc3f8('0x6e')]>0x7?_0x2a29fa['title']:_0x2a29fa['type'],'custom':_0x2a29fa[_0xc3f8('0x6e')]>0x7?!![]:![],'options':_0x2a29fa[_0xc3f8('0x6f')]?_0x2a29fa['system_field_options']:_0x2a29fa[_0xc3f8('0x70')]?_0x2a29fa[_0xc3f8('0x70')]:[]};})};}})['then'](respondWithResult(_0x104eec,null))[_0xc3f8('0x44')](function(_0x5f2d86){var _0x3d080a=_0x273faf['query'][_0xc3f8('0x71')]?0x1f4:_0x5f2d86[_0xc3f8('0x72')]||0x1f4;logger[_0xc3f8('0x26')](_0xc3f8('0x73'),_0xc3f8('0x56'),_0x3d080a,JSON[_0xc3f8('0x74')](_0x5f2d86));delete _0x5f2d86[_0xc3f8('0x28')];if(_0x3d080a===0x191){_0x3d080a=0x190;}_0x104eec[_0xc3f8('0x18')](_0x3d080a)[_0xc3f8('0x29')](_0x273faf['query']['test']?{'message':_0xc3f8('0x75'),'statusCode':_0x5f2d86['statusCode']}:_0x5f2d86);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 26c2e2c..c2794ed 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 _0x0316=['api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0316,0x115));var _0x6031=function(_0x29efce,_0xb0d231){_0x29efce=_0x29efce-0x0;var _0x2e4617=_0x0316[_0x29efce];return _0x2e4617;};'use strict';var _=require(_0x6031('0x0'));var util=require(_0x6031('0x1'));var logger=require(_0x6031('0x2'))(_0x6031('0x3'));var moment=require(_0x6031('0x4'));var BPromise=require('bluebird');var rp=require(_0x6031('0x5'));var fs=require('fs');var path=require(_0x6031('0x6'));var rimraf=require(_0x6031('0x7'));var config=require(_0x6031('0x8'));var attributes=require(_0x6031('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x6031('0xa')]=function(_0x15bc1d,_0x312586){return _0x15bc1d[_0x6031('0xb')](_0x6031('0xc'),attributes,{'tableName':_0x6031('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfdb=['path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','moment','request-promise'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xdfdb,0xa4));var _0xbdfd=function(_0x303864,_0x1a0eaf){_0x303864=_0x303864-0x0;var _0x250c15=_0xdfdb[_0x303864];return _0x250c15;};'use strict';var _=require(_0xbdfd('0x0'));var util=require('util');var logger=require(_0xbdfd('0x1'))('api');var moment=require(_0xbdfd('0x2'));var BPromise=require('bluebird');var rp=require(_0xbdfd('0x3'));var fs=require('fs');var path=require(_0xbdfd('0x4'));var rimraf=require('rimraf');var config=require(_0xbdfd('0x5'));var attributes=require(_0xbdfd('0x6'));var integrations=require(_0xbdfd('0x7'));module[_0xbdfd('0x8')]=function(_0x5740ce,_0xfbe9b2){return _0x5740ce[_0xbdfd('0x9')](_0xbdfd('0xa'),attributes,{'tableName':_0xbdfd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index acd1b21..b66abdb 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 _0x246b=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','include','map','model','find','ShowZendeskAccount'];(function(_0x22befc,_0x408fb8){var _0x14f120=function(_0x3b281c){while(--_0x3b281c){_0x22befc['push'](_0x22befc['shift']());}};_0x14f120(++_0x408fb8);}(_0x246b,0x176));var _0xb246=function(_0x56139e,_0x44fe83){_0x56139e=_0x56139e-0x0;var _0x51fc8a=_0x246b[_0x56139e];return _0x51fc8a;};'use strict';var _=require(_0xb246('0x0'));var util=require(_0xb246('0x1'));var moment=require(_0xb246('0x2'));var BPromise=require(_0xb246('0x3'));var rs=require(_0xb246('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb246('0x5'))['db'];var utils=require(_0xb246('0x6'));var logger=require(_0xb246('0x7'))(_0xb246('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb246('0x9')][_0xb246('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x275da7,_0x4dbd51,_0x4be6a4){return new BPromise(function(_0x54c53c,_0x11a8f3){return client['request'](_0x275da7,_0x4be6a4)[_0xb246('0xb')](function(_0x3c37df){logger['info'](_0xb246('0xc'),_0x4dbd51,'request\x20sent');logger[_0xb246('0xd')](_0xb246('0xe'),_0x4dbd51,_0xb246('0xf'),JSON[_0xb246('0x10')](_0x3c37df));if(_0x3c37df[_0xb246('0x11')]){if(_0x3c37df[_0xb246('0x11')][_0xb246('0x12')]===0x1f4){logger['error'](_0xb246('0xc'),_0x4dbd51,_0x3c37df['error'][_0xb246('0x13')]);return _0x11a8f3(_0x3c37df['error'][_0xb246('0x13')]);}logger[_0xb246('0x11')](_0xb246('0xc'),_0x4dbd51,_0x3c37df[_0xb246('0x11')][_0xb246('0x13')]);return _0x54c53c(_0x3c37df[_0xb246('0x11')][_0xb246('0x13')]);}else{logger[_0xb246('0x14')](_0xb246('0xc'),_0x4dbd51,_0xb246('0xf'));_0x54c53c(_0x3c37df[_0xb246('0x15')][_0xb246('0x13')]);}})[_0xb246('0x16')](function(_0x1ba384){logger['error'](_0xb246('0xc'),_0x4dbd51,_0x1ba384);_0x11a8f3(_0x1ba384);});});}exports[_0xb246('0x17')]=function(_0x30e951){var _0x5303d9=this;return new Promise(function(_0x32c7a4,_0x500cc7){return db[_0xb246('0x18')]['findAll']({'raw':_0x30e951[_0xb246('0x19')]?_0x30e951[_0xb246('0x19')][_0xb246('0x1a')]===undefined?!![]:![]:!![],'where':_0x30e951[_0xb246('0x19')]?_0x30e951['options'][_0xb246('0x1b')]||null:null,'attributes':_0x30e951[_0xb246('0x19')]?_0x30e951[_0xb246('0x19')][_0xb246('0x1c')]||null:null,'limit':_0x30e951[_0xb246('0x19')]?_0x30e951[_0xb246('0x19')]['limit']||null:null,'include':_0x30e951[_0xb246('0x19')]?_0x30e951[_0xb246('0x19')][_0xb246('0x1d')]?_[_0xb246('0x1e')](_0x30e951['options']['include'],function(_0x25cd9e){return{'model':db[_0x25cd9e['model']],'as':_0x25cd9e['as'],'attributes':_0x25cd9e[_0xb246('0x1c')],'include':_0x25cd9e[_0xb246('0x1d')]?_['map'](_0x25cd9e[_0xb246('0x1d')],function(_0x9af137){return{'model':db[_0x9af137[_0xb246('0x1f')]],'as':_0x9af137['as'],'attributes':_0x9af137[_0xb246('0x1c')],'include':_0x9af137['include']?_['map'](_0x9af137['include'],function(_0x17d5d1){return{'model':db[_0x17d5d1[_0xb246('0x1f')]],'as':_0x17d5d1['as'],'attributes':_0x17d5d1[_0xb246('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b8b01){logger[_0xb246('0x14')](_0xb246('0x17'),_0x30e951);logger[_0xb246('0xd')](_0xb246('0x17'),_0x30e951,JSON[_0xb246('0x10')](_0x4b8b01));_0x32c7a4(_0x4b8b01);})[_0xb246('0x16')](function(_0x1ce36f){logger[_0xb246('0x11')](_0xb246('0x17'),_0x1ce36f[_0xb246('0x13')],_0x30e951);_0x500cc7(_0x5303d9['error'](0x1f4,_0x1ce36f[_0xb246('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x1bfa06){var _0x14a69e=this;return new Promise(function(_0xabf125,_0x55ba49){return db[_0xb246('0x18')][_0xb246('0x20')]({'raw':_0x1bfa06['options']?_0x1bfa06['options'][_0xb246('0x1a')]===undefined?!![]:![]:!![],'where':_0x1bfa06[_0xb246('0x19')]?_0x1bfa06[_0xb246('0x19')][_0xb246('0x1b')]||null:null,'attributes':_0x1bfa06[_0xb246('0x19')]?_0x1bfa06[_0xb246('0x19')][_0xb246('0x1c')]||null:null,'include':_0x1bfa06['options']?_0x1bfa06[_0xb246('0x19')][_0xb246('0x1d')]?_[_0xb246('0x1e')](_0x1bfa06[_0xb246('0x19')][_0xb246('0x1d')],function(_0x5cc1d1){return{'model':db[_0x5cc1d1[_0xb246('0x1f')]],'as':_0x5cc1d1['as'],'attributes':_0x5cc1d1[_0xb246('0x1c')],'include':_0x5cc1d1[_0xb246('0x1d')]?_[_0xb246('0x1e')](_0x5cc1d1['include'],function(_0x231353){return{'model':db[_0x231353[_0xb246('0x1f')]],'as':_0x231353['as'],'attributes':_0x231353[_0xb246('0x1c')],'include':_0x231353[_0xb246('0x1d')]?_[_0xb246('0x1e')](_0x231353[_0xb246('0x1d')],function(_0x526dd6){return{'model':db[_0x526dd6['model']],'as':_0x526dd6['as'],'attributes':_0x526dd6[_0xb246('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb246('0xb')](function(_0x64d804){logger[_0xb246('0x14')](_0xb246('0x21'),_0x1bfa06);logger['debug'](_0xb246('0x21'),_0x1bfa06,JSON[_0xb246('0x10')](_0x64d804));_0xabf125(_0x64d804);})['catch'](function(_0x30836f){logger['error'](_0xb246('0x21'),_0x30836f['message'],_0x1bfa06);_0x55ba49(_0x14a69e[_0xb246('0x11')](0x1f4,_0x30836f[_0xb246('0x13')]));});});}; \ No newline at end of file +var _0x3187=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ZendeskAccount','options','raw','where','attributes','include','map','model','GetZendeskAccount','stringify','ShowZendeskAccount','find','lodash','util'];(function(_0x16af01,_0x980a1c){var _0x5bd20e=function(_0x4dcc09){while(--_0x4dcc09){_0x16af01['push'](_0x16af01['shift']());}};_0x5bd20e(++_0x980a1c);}(_0x3187,0xfa));var _0x7318=function(_0x48ccc4,_0x4045e4){_0x48ccc4=_0x48ccc4-0x0;var _0x49d8bd=_0x3187[_0x48ccc4];return _0x49d8bd;};'use strict';var _=require(_0x7318('0x0'));var util=require(_0x7318('0x1'));var moment=require('moment');var BPromise=require(_0x7318('0x2'));var rs=require(_0x7318('0x3'));var fs=require('fs');var Redis=require(_0x7318('0x4'));var db=require(_0x7318('0x5'))['db'];var utils=require(_0x7318('0x6'));var logger=require(_0x7318('0x7'))(_0x7318('0x8'));var config=require(_0x7318('0x9'));var jayson=require(_0x7318('0xa'));var client=jayson[_0x7318('0xb')][_0x7318('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f9a90,_0x729643,_0x55ed15){return new BPromise(function(_0x4d7409,_0x362e74){return client[_0x7318('0xd')](_0x4f9a90,_0x55ed15)[_0x7318('0xe')](function(_0x119d1d){logger[_0x7318('0xf')](_0x7318('0x10'),_0x729643,_0x7318('0x11'));logger[_0x7318('0x12')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x729643,_0x7318('0x11'),JSON['stringify'](_0x119d1d));if(_0x119d1d[_0x7318('0x13')]){if(_0x119d1d[_0x7318('0x13')][_0x7318('0x14')]===0x1f4){logger[_0x7318('0x13')](_0x7318('0x10'),_0x729643,_0x119d1d['error']['message']);return _0x362e74(_0x119d1d[_0x7318('0x13')][_0x7318('0x15')]);}logger[_0x7318('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x729643,_0x119d1d[_0x7318('0x13')][_0x7318('0x15')]);return _0x4d7409(_0x119d1d['error'][_0x7318('0x15')]);}else{logger[_0x7318('0xf')](_0x7318('0x10'),_0x729643,_0x7318('0x11'));_0x4d7409(_0x119d1d[_0x7318('0x16')][_0x7318('0x15')]);}})[_0x7318('0x17')](function(_0x307bb5){logger[_0x7318('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x729643,_0x307bb5);_0x362e74(_0x307bb5);});});}exports['GetZendeskAccount']=function(_0x5dfd17){var _0x1bb1ee=this;return new Promise(function(_0x1cd731,_0x6fcfcd){return db[_0x7318('0x18')]['findAll']({'raw':_0x5dfd17[_0x7318('0x19')]?_0x5dfd17[_0x7318('0x19')][_0x7318('0x1a')]===undefined?!![]:![]:!![],'where':_0x5dfd17[_0x7318('0x19')]?_0x5dfd17['options'][_0x7318('0x1b')]||null:null,'attributes':_0x5dfd17[_0x7318('0x19')]?_0x5dfd17[_0x7318('0x19')][_0x7318('0x1c')]||null:null,'limit':_0x5dfd17[_0x7318('0x19')]?_0x5dfd17[_0x7318('0x19')]['limit']||null:null,'include':_0x5dfd17['options']?_0x5dfd17['options'][_0x7318('0x1d')]?_[_0x7318('0x1e')](_0x5dfd17[_0x7318('0x19')][_0x7318('0x1d')],function(_0x5e43e5){return{'model':db[_0x5e43e5['model']],'as':_0x5e43e5['as'],'attributes':_0x5e43e5[_0x7318('0x1c')],'include':_0x5e43e5[_0x7318('0x1d')]?_[_0x7318('0x1e')](_0x5e43e5[_0x7318('0x1d')],function(_0x31ceb1){return{'model':db[_0x31ceb1[_0x7318('0x1f')]],'as':_0x31ceb1['as'],'attributes':_0x31ceb1['attributes'],'include':_0x31ceb1['include']?_['map'](_0x31ceb1['include'],function(_0x3e6de6){return{'model':db[_0x3e6de6[_0x7318('0x1f')]],'as':_0x3e6de6['as'],'attributes':_0x3e6de6[_0x7318('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7318('0xe')](function(_0x1fa578){logger[_0x7318('0xf')](_0x7318('0x20'),_0x5dfd17);logger['debug'](_0x7318('0x20'),_0x5dfd17,JSON[_0x7318('0x21')](_0x1fa578));_0x1cd731(_0x1fa578);})[_0x7318('0x17')](function(_0x209916){logger[_0x7318('0x13')]('GetZendeskAccount',_0x209916['message'],_0x5dfd17);_0x6fcfcd(_0x1bb1ee[_0x7318('0x13')](0x1f4,_0x209916[_0x7318('0x15')]));});});};exports[_0x7318('0x22')]=function(_0x7ac46b){var _0x4ac588=this;return new Promise(function(_0x15b970,_0x50755f){return db[_0x7318('0x18')][_0x7318('0x23')]({'raw':_0x7ac46b[_0x7318('0x19')]?_0x7ac46b[_0x7318('0x19')][_0x7318('0x1a')]===undefined?!![]:![]:!![],'where':_0x7ac46b['options']?_0x7ac46b['options'][_0x7318('0x1b')]||null:null,'attributes':_0x7ac46b[_0x7318('0x19')]?_0x7ac46b[_0x7318('0x19')][_0x7318('0x1c')]||null:null,'include':_0x7ac46b['options']?_0x7ac46b[_0x7318('0x19')][_0x7318('0x1d')]?_[_0x7318('0x1e')](_0x7ac46b['options'][_0x7318('0x1d')],function(_0x5ce0de){return{'model':db[_0x5ce0de['model']],'as':_0x5ce0de['as'],'attributes':_0x5ce0de[_0x7318('0x1c')],'include':_0x5ce0de['include']?_[_0x7318('0x1e')](_0x5ce0de[_0x7318('0x1d')],function(_0x2ffd65){return{'model':db[_0x2ffd65[_0x7318('0x1f')]],'as':_0x2ffd65['as'],'attributes':_0x2ffd65['attributes'],'include':_0x2ffd65[_0x7318('0x1d')]?_['map'](_0x2ffd65['include'],function(_0x36faa7){return{'model':db[_0x36faa7['model']],'as':_0x36faa7['as'],'attributes':_0x36faa7['attributes']};}):[]};}):[]};}):[]:[]})[_0x7318('0xe')](function(_0x2315e5){logger[_0x7318('0xf')]('ShowZendeskAccount',_0x7ac46b);logger['debug'](_0x7318('0x22'),_0x7ac46b,JSON['stringify'](_0x2315e5));_0x15b970(_0x2315e5);})['catch'](function(_0x54280){logger[_0x7318('0x13')](_0x7318('0x22'),_0x54280[_0x7318('0x15')],_0x7ac46b);_0x50755f(_0x4ac588[_0x7318('0x13')](0x1f4,_0x54280[_0x7318('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index c4c9eb5..508c247 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 _0x0713=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','setTags','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x7f0774,_0x3ce09c){var _0x5d5a31=function(_0x53e30f){while(--_0x53e30f){_0x7f0774['push'](_0x7f0774['shift']());}};_0x5d5a31(++_0x3ce09c);}(_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['getFields']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/descriptions',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x8')](_0x3071('0x11'),auth[_0x3071('0x9')](),controller['getTags']);router['post']('/',auth[_0x3071('0x9')](),controller['create']);router[_0x3071('0x12')](_0x3071('0x11'),auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['put'](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x14')]);router[_0x3071('0x15')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x16')]);module[_0x3071('0x17')]=router; \ No newline at end of file +var _0xbaf0=['isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x2298bd,_0x4595cd){var _0xd89269=function(_0x420e62){while(--_0x420e62){_0x2298bd['push'](_0x2298bd['shift']());}};_0xd89269(++_0x4595cd);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0x9')]('/:id/fields',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0x9')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x9')](_0x0baf('0x10'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0x14')]);router['post'](_0x0baf('0x15'),auth['isAuthenticated'](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x18')]);router[_0x0baf('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);module[_0x0baf('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 5f66f15..2568a7f 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 _0xebc0=['exports','STRING','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xebc0,0x1e2));var _0x0ebc=function(_0x1c9ec1,_0x4ec841){_0x1c9ec1=_0x1c9ec1-0x0;var _0x3814a6=_0xebc0[_0x1c9ec1];return _0x3814a6;};'use strict';var Sequelize=require(_0x0ebc('0x0'));module[_0x0ebc('0x1')]={'name':{'type':Sequelize[_0x0ebc('0x2')]},'description':{'type':Sequelize[_0x0ebc('0x2')]}}; \ No newline at end of file +var _0x6fc3=['exports','STRING','sequelize'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x6fc3,0x17f));var _0x36fc=function(_0x3a0f2a,_0x141715){_0x3a0f2a=_0x3a0f2a-0x0;var _0x4a3b11=_0x6fc3[_0x3a0f2a];return _0x4a3b11;};'use strict';var Sequelize=require(_0x36fc('0x0'));module[_0x36fc('0x1')]={'name':{'type':Sequelize[_0x36fc('0x2')]},'description':{'type':Sequelize[_0x36fc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d0d4c00..bd127af 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 _0x3be9=['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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','rawAttributes','type','key','model','map','keys','intersection','query','fields','attributes','length','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','ZendeskConfiguration','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','ZendeskField','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format'];(function(_0x18981a,_0x418117){var _0x487367=function(_0x3a6696){while(--_0x3a6696){_0x18981a['push'](_0x18981a['shift']());}};_0x487367(++_0x418117);}(_0x3be9,0x1bc));var _0x93be=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0x3be9[_0x532112];return _0x23e5fb;};'use strict';var emlformat=require(_0x93be('0x0'));var rimraf=require(_0x93be('0x1'));var zipdir=require(_0x93be('0x2'));var jsonpatch=require(_0x93be('0x3'));var rp=require(_0x93be('0x4'));var moment=require(_0x93be('0x5'));var BPromise=require(_0x93be('0x6'));var Mustache=require(_0x93be('0x7'));var util=require(_0x93be('0x8'));var path=require(_0x93be('0x9'));var sox=require(_0x93be('0xa'));var csv=require(_0x93be('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93be('0xc'));var _=require(_0x93be('0xd'));var squel=require(_0x93be('0xe'));var crypto=require(_0x93be('0xf'));var jsforce=require(_0x93be('0x10'));var deskjs=require(_0x93be('0x11'));var toCsv=require(_0x93be('0xb'));var querystring=require(_0x93be('0x12'));var Papa=require(_0x93be('0x13'));var Redis=require(_0x93be('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x93be('0x15'));var as=require(_0x93be('0x16'));var hardwareService=require(_0x93be('0x17'));var logger=require(_0x93be('0x18'))('api');var utils=require(_0x93be('0x19'));var config=require(_0x93be('0x1a'));var licenseUtil=require(_0x93be('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x365c40,_0x2c6cf1){_0x2c6cf1=_0x2c6cf1||0xcc;return function(_0x41b564){if(_0x41b564){return _0x365c40[_0x93be('0x1c')](_0x2c6cf1);}return _0x365c40[_0x93be('0x1d')](_0x2c6cf1)[_0x93be('0x1e')]();};}function respondWithResult(_0x2ba89d,_0x22b6b0){_0x22b6b0=_0x22b6b0||0xc8;return function(_0x487b64){if(_0x487b64){return _0x2ba89d[_0x93be('0x1d')](_0x22b6b0)[_0x93be('0x1f')](_0x487b64);}};}function respondWithFilteredResult(_0x2ef59b,_0x3dac11){return function(_0x44398f){if(_0x44398f){var _0xdb9a81=typeof _0x3dac11[_0x93be('0x20')]===_0x93be('0x21')&&typeof _0x3dac11[_0x93be('0x22')]===_0x93be('0x21');var _0x33a303=_0x44398f[_0x93be('0x23')];var _0xe5a69c=_0xdb9a81?0x0:_0x3dac11['offset'];var _0x23dcc1=_0xdb9a81?_0x44398f[_0x93be('0x23')]:_0x3dac11[_0x93be('0x20')]+_0x3dac11[_0x93be('0x22')];var _0x3e9424;if(_0x23dcc1>=_0x33a303){_0x23dcc1=_0x33a303;_0x3e9424=0xc8;}else{_0x3e9424=0xce;}_0x2ef59b[_0x93be('0x1d')](_0x3e9424);return _0x2ef59b[_0x93be('0x24')](_0x93be('0x25'),_0xe5a69c+'-'+_0x23dcc1+'/'+_0x33a303)[_0x93be('0x1f')](_0x44398f);}return null;};}function patchUpdates(_0x3a3eb9){return function(_0x6afab){try{jsonpatch[_0x93be('0x26')](_0x6afab,_0x3a3eb9,!![]);}catch(_0x24fc3a){return BPromise[_0x93be('0x27')](_0x24fc3a);}return _0x6afab[_0x93be('0x28')]();};}function saveUpdates(_0x209dba,_0x7121e){return function(_0xf517a0){if(_0xf517a0){return _0xf517a0[_0x93be('0x29')](_0x209dba)['then'](function(_0x2fa565){return _0x2fa565;});}return null;};}function removeEntity(_0x30f8b4,_0x48885f){return function(_0x122863){if(_0x122863){return _0x122863[_0x93be('0x2a')]()['then'](function(){_0x30f8b4['status'](0xcc)[_0x93be('0x1e')]();});}};}function handleEntityNotFound(_0x33d07c,_0x176e31){return function(_0x1c9990){if(!_0x1c9990){_0x33d07c[_0x93be('0x1c')](0x194);}return _0x1c9990;};}function handleError(_0x385ebf,_0x391b1a){_0x391b1a=_0x391b1a||0x1f4;return function(_0x4d8db6){logger[_0x93be('0x2b')](_0x4d8db6[_0x93be('0x2c')]);if(_0x4d8db6[_0x93be('0x2d')]){delete _0x4d8db6['name'];}_0x385ebf[_0x93be('0x1d')](_0x391b1a)[_0x93be('0x2e')](_0x4d8db6);};}exports['index']=function(_0x13c62d,_0x2174fa){var _0x200553={},_0x4b47ee={},_0x43e76a={'count':0x0,'rows':[]};var _0xfc0cc8=_['map'](db['ZendeskConfiguration'][_0x93be('0x2f')],function(_0x191b35){return{'name':_0x191b35['fieldName'],'type':_0x191b35[_0x93be('0x30')][_0x93be('0x31')]};});_0x4b47ee[_0x93be('0x32')]=_[_0x93be('0x33')](_0xfc0cc8,_0x93be('0x2d'));_0x4b47ee['query']=_[_0x93be('0x34')](_0x13c62d['query']);_0x4b47ee['filters']=_[_0x93be('0x35')](_0x4b47ee[_0x93be('0x32')],_0x4b47ee[_0x93be('0x36')]);_0x200553['attributes']=_[_0x93be('0x35')](_0x4b47ee[_0x93be('0x32')],qs[_0x93be('0x37')](_0x13c62d[_0x93be('0x36')][_0x93be('0x37')]));_0x200553[_0x93be('0x38')]=_0x200553[_0x93be('0x38')][_0x93be('0x39')]?_0x200553['attributes']:_0x4b47ee[_0x93be('0x32')];if(!_0x13c62d[_0x93be('0x36')]['hasOwnProperty'](_0x93be('0x3a'))){_0x200553[_0x93be('0x22')]=qs['limit'](_0x13c62d[_0x93be('0x36')][_0x93be('0x22')]);_0x200553[_0x93be('0x20')]=qs[_0x93be('0x20')](_0x13c62d[_0x93be('0x36')]['offset']);}_0x200553[_0x93be('0x3b')]=qs[_0x93be('0x3c')](_0x13c62d[_0x93be('0x36')][_0x93be('0x3c')]);_0x200553['where']=qs[_0x93be('0x3d')](_['pick'](_0x13c62d[_0x93be('0x36')],_0x4b47ee[_0x93be('0x3d')]),_0xfc0cc8);if(_0x13c62d[_0x93be('0x36')][_0x93be('0x3e')]){_0x200553[_0x93be('0x3f')]=_[_0x93be('0x40')](_0x200553[_0x93be('0x3f')],{'$or':_['map'](_0xfc0cc8,function(_0x25a12b){if(_0x25a12b[_0x93be('0x30')]!==_0x93be('0x41')){var _0x1acc00={};_0x1acc00[_0x25a12b[_0x93be('0x2d')]]={'$like':'%'+_0x13c62d[_0x93be('0x36')][_0x93be('0x3e')]+'%'};return _0x1acc00;}})});}_0x200553=_[_0x93be('0x40')]({},_0x200553,_0x13c62d[_0x93be('0x42')]);var _0x90f69c={'where':_0x200553['where']};return db[_0x93be('0x43')]['count'](_0x90f69c)[_0x93be('0x44')](function(_0x174985){_0x43e76a[_0x93be('0x23')]=_0x174985;if(_0x13c62d['query'][_0x93be('0x45')]){_0x200553[_0x93be('0x46')]=[{'all':!![]}];}return db[_0x93be('0x43')][_0x93be('0x47')](_0x200553);})[_0x93be('0x44')](function(_0x4b72b2){_0x43e76a[_0x93be('0x48')]=_0x4b72b2;return _0x43e76a;})[_0x93be('0x44')](respondWithFilteredResult(_0x2174fa,_0x200553))[_0x93be('0x49')](handleError(_0x2174fa,null));};exports[_0x93be('0x4a')]=function(_0x32cec5,_0x15831a){var _0x5d68a7={'raw':![],'where':{'id':_0x32cec5[_0x93be('0x4b')]['id']}},_0x540ab7={};_0x540ab7[_0x93be('0x32')]=_[_0x93be('0x34')](db['ZendeskConfiguration'][_0x93be('0x2f')]);_0x540ab7['query']=_[_0x93be('0x34')](_0x32cec5['query']);_0x540ab7[_0x93be('0x3d')]=_['intersection'](_0x540ab7[_0x93be('0x32')],_0x540ab7[_0x93be('0x36')]);_0x5d68a7[_0x93be('0x38')]=_['intersection'](_0x540ab7['model'],qs[_0x93be('0x37')](_0x32cec5['query'][_0x93be('0x37')]));_0x5d68a7[_0x93be('0x38')]=_0x5d68a7[_0x93be('0x38')][_0x93be('0x39')]?_0x5d68a7['attributes']:_0x540ab7[_0x93be('0x32')];if(_0x32cec5['query'][_0x93be('0x45')]){_0x5d68a7[_0x93be('0x46')]=[{'all':!![]}];}_0x5d68a7=_[_0x93be('0x40')]({},_0x5d68a7,_0x32cec5[_0x93be('0x42')]);return db[_0x93be('0x43')][_0x93be('0x4c')](_0x5d68a7)[_0x93be('0x44')](handleEntityNotFound(_0x15831a,null))[_0x93be('0x44')](respondWithResult(_0x15831a,null))[_0x93be('0x49')](handleError(_0x15831a,null));};exports[_0x93be('0x4d')]=function(_0x174b64,_0x2ee04b){return db['ZendeskConfiguration']['create'](_0x174b64[_0x93be('0x4e')],{})[_0x93be('0x44')](respondWithResult(_0x2ee04b,0xc9))[_0x93be('0x49')](handleError(_0x2ee04b,null));};exports[_0x93be('0x29')]=function(_0x567f6b,_0x1b4196){if(_0x567f6b[_0x93be('0x4e')]['id']){delete _0x567f6b[_0x93be('0x4e')]['id'];}return db[_0x93be('0x43')]['find']({'where':{'id':_0x567f6b[_0x93be('0x4b')]['id']}})[_0x93be('0x44')](handleEntityNotFound(_0x1b4196,null))[_0x93be('0x44')](saveUpdates(_0x567f6b[_0x93be('0x4e')],null))[_0x93be('0x44')](respondWithResult(_0x1b4196,null))[_0x93be('0x49')](handleError(_0x1b4196,null));};exports[_0x93be('0x2a')]=function(_0x1acc3b,_0x44bc07){return db[_0x93be('0x43')][_0x93be('0x4c')]({'where':{'id':_0x1acc3b[_0x93be('0x4b')]['id']}})[_0x93be('0x44')](handleEntityNotFound(_0x44bc07,null))[_0x93be('0x44')](removeEntity(_0x44bc07,null))[_0x93be('0x49')](handleError(_0x44bc07,null));};exports[_0x93be('0x4f')]=function(_0x343143,_0x3500c5,_0x223b92){var _0x5ce933={};var _0x4dced5={};var _0x5833a0;var _0x1e801d;return db[_0x93be('0x43')][_0x93be('0x50')]({'where':{'id':_0x343143[_0x93be('0x4b')]['id']}})[_0x93be('0x44')](handleEntityNotFound(_0x3500c5,null))[_0x93be('0x44')](function(_0x164d06){if(_0x164d06){_0x5833a0=_0x164d06;_0x4dced5[_0x93be('0x32')]=_[_0x93be('0x34')](db[_0x93be('0x51')]['rawAttributes']);_0x4dced5[_0x93be('0x36')]=_[_0x93be('0x34')](_0x343143[_0x93be('0x36')]);_0x4dced5[_0x93be('0x3d')]=_[_0x93be('0x35')](_0x4dced5[_0x93be('0x32')],_0x4dced5[_0x93be('0x36')]);_0x5ce933[_0x93be('0x38')]=_[_0x93be('0x35')](_0x4dced5[_0x93be('0x32')],qs[_0x93be('0x37')](_0x343143['query'][_0x93be('0x37')]));_0x5ce933['attributes']=_0x5ce933[_0x93be('0x38')][_0x93be('0x39')]?_0x5ce933[_0x93be('0x38')]:_0x4dced5[_0x93be('0x32')];_0x5ce933[_0x93be('0x3b')]=qs[_0x93be('0x3c')](_0x343143[_0x93be('0x36')]['sort']);_0x5ce933[_0x93be('0x3f')]=qs[_0x93be('0x3d')](_[_0x93be('0x52')](_0x343143[_0x93be('0x36')],_0x4dced5[_0x93be('0x3d')]));if(_0x343143[_0x93be('0x36')][_0x93be('0x3e')]){_0x5ce933[_0x93be('0x3f')]=_[_0x93be('0x40')](_0x5ce933[_0x93be('0x3f')],{'$or':_[_0x93be('0x33')](_0x5ce933[_0x93be('0x38')],function(_0x5a6f07){var _0x54ec9a={};_0x54ec9a[_0x5a6f07]={'$like':'%'+_0x343143[_0x93be('0x36')][_0x93be('0x3e')]+'%'};return _0x54ec9a;})});}_0x5ce933=_[_0x93be('0x40')]({},_0x5ce933,_0x343143[_0x93be('0x42')]);return _0x5833a0[_0x93be('0x4f')](_0x5ce933);}})[_0x93be('0x44')](function(_0x3d2bf9){if(_0x3d2bf9){_0x1e801d=_0x3d2bf9[_0x93be('0x39')];if(!_0x343143[_0x93be('0x36')][_0x93be('0x53')]('nolimit')){_0x5ce933[_0x93be('0x22')]=qs['limit'](_0x343143[_0x93be('0x36')][_0x93be('0x22')]);_0x5ce933['offset']=qs[_0x93be('0x20')](_0x343143[_0x93be('0x36')][_0x93be('0x20')]);}return _0x5833a0[_0x93be('0x4f')](_0x5ce933);}})[_0x93be('0x44')](function(_0x5e341f){if(_0x5e341f){return _0x5e341f?{'count':_0x1e801d,'rows':_0x5e341f}:null;}})[_0x93be('0x44')](respondWithResult(_0x3500c5,null))[_0x93be('0x49')](handleError(_0x3500c5,null));};exports[_0x93be('0x54')]=function(_0x1a2b0e,_0xfc7702,_0x34dbd2){var _0x49adb6={};var _0x56bf51={};var _0x2fbdc2;var _0x2776c8;return db[_0x93be('0x43')][_0x93be('0x50')]({'where':{'id':_0x1a2b0e['params']['id']}})[_0x93be('0x44')](handleEntityNotFound(_0xfc7702,null))[_0x93be('0x44')](function(_0x2855de){if(_0x2855de){_0x2fbdc2=_0x2855de;_0x56bf51[_0x93be('0x32')]=_['keys'](db[_0x93be('0x51')][_0x93be('0x2f')]);_0x56bf51[_0x93be('0x36')]=_[_0x93be('0x34')](_0x1a2b0e[_0x93be('0x36')]);_0x56bf51[_0x93be('0x3d')]=_[_0x93be('0x35')](_0x56bf51[_0x93be('0x32')],_0x56bf51[_0x93be('0x36')]);_0x49adb6['attributes']=_[_0x93be('0x35')](_0x56bf51[_0x93be('0x32')],qs[_0x93be('0x37')](_0x1a2b0e[_0x93be('0x36')][_0x93be('0x37')]));_0x49adb6[_0x93be('0x38')]=_0x49adb6[_0x93be('0x38')][_0x93be('0x39')]?_0x49adb6[_0x93be('0x38')]:_0x56bf51[_0x93be('0x32')];_0x49adb6[_0x93be('0x3b')]=qs[_0x93be('0x3c')](_0x1a2b0e['query']['sort']);_0x49adb6[_0x93be('0x3f')]=qs[_0x93be('0x3d')](_['pick'](_0x1a2b0e[_0x93be('0x36')],_0x56bf51[_0x93be('0x3d')]));if(_0x1a2b0e[_0x93be('0x36')]['filter']){_0x49adb6[_0x93be('0x3f')]=_[_0x93be('0x40')](_0x49adb6[_0x93be('0x3f')],{'$or':_[_0x93be('0x33')](_0x49adb6[_0x93be('0x38')],function(_0x176129){var _0x27c136={};_0x27c136[_0x176129]={'$like':'%'+_0x1a2b0e[_0x93be('0x36')]['filter']+'%'};return _0x27c136;})});}_0x49adb6=_[_0x93be('0x40')]({},_0x49adb6,_0x1a2b0e[_0x93be('0x42')]);return _0x2fbdc2[_0x93be('0x54')](_0x49adb6);}})[_0x93be('0x44')](function(_0x25e434){if(_0x25e434){_0x2776c8=_0x25e434[_0x93be('0x39')];if(!_0x1a2b0e[_0x93be('0x36')][_0x93be('0x53')]('nolimit')){_0x49adb6[_0x93be('0x22')]=qs[_0x93be('0x22')](_0x1a2b0e['query']['limit']);_0x49adb6[_0x93be('0x20')]=qs[_0x93be('0x20')](_0x1a2b0e['query'][_0x93be('0x20')]);}return _0x2fbdc2[_0x93be('0x54')](_0x49adb6);}})[_0x93be('0x44')](function(_0x41dac1){if(_0x41dac1){return _0x41dac1?{'count':_0x2776c8,'rows':_0x41dac1}:null;}})[_0x93be('0x44')](respondWithResult(_0xfc7702,null))[_0x93be('0x49')](handleError(_0xfc7702,null));};exports[_0x93be('0x55')]=function(_0x824277,_0x3d6be3,_0x1b20da){var _0x683045={};var _0x4d67e0={};var _0x553502;var _0x27cbbd;return db[_0x93be('0x43')][_0x93be('0x50')]({'where':{'id':_0x824277['params']['id']}})[_0x93be('0x44')](handleEntityNotFound(_0x3d6be3,null))[_0x93be('0x44')](function(_0x10ef9f){if(_0x10ef9f){_0x553502=_0x10ef9f;_0x4d67e0[_0x93be('0x32')]=_[_0x93be('0x34')](db['ZendeskField']['rawAttributes']);_0x4d67e0[_0x93be('0x36')]=_[_0x93be('0x34')](_0x824277[_0x93be('0x36')]);_0x4d67e0['filters']=_[_0x93be('0x35')](_0x4d67e0['model'],_0x4d67e0[_0x93be('0x36')]);_0x683045[_0x93be('0x38')]=_[_0x93be('0x35')](_0x4d67e0[_0x93be('0x32')],qs[_0x93be('0x37')](_0x824277['query']['fields']));_0x683045['attributes']=_0x683045['attributes'][_0x93be('0x39')]?_0x683045[_0x93be('0x38')]:_0x4d67e0[_0x93be('0x32')];_0x683045['order']=qs['sort'](_0x824277['query'][_0x93be('0x3c')]);_0x683045['where']=qs[_0x93be('0x3d')](_[_0x93be('0x52')](_0x824277[_0x93be('0x36')],_0x4d67e0[_0x93be('0x3d')]));if(_0x824277['query'][_0x93be('0x3e')]){_0x683045['where']=_[_0x93be('0x40')](_0x683045[_0x93be('0x3f')],{'$or':_[_0x93be('0x33')](_0x683045[_0x93be('0x38')],function(_0x5c7f47){var _0x2233fe={};_0x2233fe[_0x5c7f47]={'$like':'%'+_0x824277[_0x93be('0x36')][_0x93be('0x3e')]+'%'};return _0x2233fe;})});}_0x683045=_[_0x93be('0x40')]({},_0x683045,_0x824277['options']);return _0x553502['getDescriptions'](_0x683045);}})['then'](function(_0x20942a){if(_0x20942a){_0x27cbbd=_0x20942a['length'];if(!_0x824277['query'][_0x93be('0x53')](_0x93be('0x3a'))){_0x683045['limit']=qs[_0x93be('0x22')](_0x824277[_0x93be('0x36')][_0x93be('0x22')]);_0x683045['offset']=qs['offset'](_0x824277[_0x93be('0x36')][_0x93be('0x20')]);}return _0x553502[_0x93be('0x55')](_0x683045);}})[_0x93be('0x44')](function(_0x234f7){if(_0x234f7){return _0x234f7?{'count':_0x27cbbd,'rows':_0x234f7}:null;}})[_0x93be('0x44')](respondWithResult(_0x3d6be3,null))[_0x93be('0x49')](handleError(_0x3d6be3,null));};exports[_0x93be('0x56')]=function(_0x8b9a8d,_0x2cfad5,_0x3e2243){var _0x5d5431={};var _0x3a616b={};var _0x476292;var _0xc3460a;return db[_0x93be('0x43')]['findOne']({'where':{'id':_0x8b9a8d['params']['id']}})[_0x93be('0x44')](handleEntityNotFound(_0x2cfad5,null))[_0x93be('0x44')](function(_0x4fb76a){if(_0x4fb76a){_0x476292=_0x4fb76a;_0x3a616b[_0x93be('0x32')]=_[_0x93be('0x34')](db[_0x93be('0x57')][_0x93be('0x2f')]);_0x3a616b['query']=_[_0x93be('0x34')](_0x8b9a8d[_0x93be('0x36')]);_0x3a616b[_0x93be('0x3d')]=_['intersection'](_0x3a616b[_0x93be('0x32')],_0x3a616b[_0x93be('0x36')]);_0x5d5431[_0x93be('0x38')]=_[_0x93be('0x35')](_0x3a616b[_0x93be('0x32')],qs['fields'](_0x8b9a8d[_0x93be('0x36')][_0x93be('0x37')]));_0x5d5431[_0x93be('0x38')]=_0x5d5431[_0x93be('0x38')][_0x93be('0x39')]?_0x5d5431[_0x93be('0x38')]:_0x3a616b[_0x93be('0x32')];_0x5d5431[_0x93be('0x3b')]=qs['sort'](_0x8b9a8d[_0x93be('0x36')][_0x93be('0x3c')]);_0x5d5431[_0x93be('0x3f')]=qs[_0x93be('0x3d')](_[_0x93be('0x52')](_0x8b9a8d[_0x93be('0x36')],_0x3a616b['filters']));if(_0x8b9a8d[_0x93be('0x36')][_0x93be('0x3e')]){_0x5d5431['where']=_[_0x93be('0x40')](_0x5d5431[_0x93be('0x3f')],{'$or':_[_0x93be('0x33')](_0x5d5431[_0x93be('0x38')],function(_0x4a0d57){var _0x39471c={};_0x39471c[_0x4a0d57]={'$like':'%'+_0x8b9a8d[_0x93be('0x36')][_0x93be('0x3e')]+'%'};return _0x39471c;})});}_0x5d5431=_[_0x93be('0x40')]({},_0x5d5431,_0x8b9a8d[_0x93be('0x42')]);return _0x476292[_0x93be('0x56')](_0x5d5431);}})['then'](function(_0x3ec6b1){if(_0x3ec6b1){_0xc3460a=_0x3ec6b1[_0x93be('0x39')];if(!_0x8b9a8d[_0x93be('0x36')][_0x93be('0x53')](_0x93be('0x3a'))){_0x5d5431[_0x93be('0x22')]=qs[_0x93be('0x22')](_0x8b9a8d[_0x93be('0x36')][_0x93be('0x22')]);_0x5d5431[_0x93be('0x20')]=qs['offset'](_0x8b9a8d[_0x93be('0x36')][_0x93be('0x20')]);}return _0x476292[_0x93be('0x56')](_0x5d5431);}})[_0x93be('0x44')](function(_0x552c1e){if(_0x552c1e){return _0x552c1e?{'count':_0xc3460a,'rows':_0x552c1e}:null;}})[_0x93be('0x44')](respondWithResult(_0x2cfad5,null))['catch'](handleError(_0x2cfad5,null));};exports[_0x93be('0x58')]=function(_0x34cb63,_0x1b5674,_0x6b7ea){if(_0x34cb63[_0x93be('0x4e')]['id']){delete _0x34cb63['body']['id'];}return db[_0x93be('0x43')][_0x93be('0x50')]({'where':{'id':_0x34cb63[_0x93be('0x4b')]['id']}})[_0x93be('0x44')](handleEntityNotFound(_0x1b5674,null))[_0x93be('0x44')](function(_0x54d2b0){if(_0x54d2b0){return _0x54d2b0[_0x93be('0x58')](_0x34cb63[_0x93be('0x4e')]['ids']||[]);}return null;})[_0x93be('0x44')](respondWithResult(_0x1b5674,null))[_0x93be('0x49')](handleError(_0x1b5674,null));}; \ No newline at end of file +var _0x9062=['end','json','offset','undefined','count','limit','reject','save','update','then','destroy','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','length','find','create','body','params','getFields','findOne','ZendeskField','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x332dbc,_0x2a80b2){var _0x4ed4e4=function(_0x3954af){while(--_0x3954af){_0x332dbc['push'](_0x332dbc['shift']());}};_0x4ed4e4(++_0x2a80b2);}(_0x9062,0x1e0));var _0x2906=function(_0x3ba8c4,_0x29b4cb){_0x3ba8c4=_0x3ba8c4-0x0;var _0x20d5ec=_0x9062[_0x3ba8c4];return _0x20d5ec;};'use strict';var emlformat=require(_0x2906('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2906('0x1'));var jsonpatch=require(_0x2906('0x2'));var rp=require(_0x2906('0x3'));var moment=require('moment');var BPromise=require(_0x2906('0x4'));var Mustache=require(_0x2906('0x5'));var util=require(_0x2906('0x6'));var path=require(_0x2906('0x7'));var sox=require(_0x2906('0x8'));var csv=require('to-csv');var ejs=require(_0x2906('0x9'));var fs=require('fs');var fs_extra=require(_0x2906('0xa'));var _=require(_0x2906('0xb'));var squel=require(_0x2906('0xc'));var crypto=require(_0x2906('0xd'));var jsforce=require(_0x2906('0xe'));var deskjs=require(_0x2906('0xf'));var toCsv=require(_0x2906('0x10'));var querystring=require(_0x2906('0x11'));var Papa=require(_0x2906('0x12'));var Redis=require(_0x2906('0x13'));var authService=require(_0x2906('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x2906('0x15'));var hardwareService=require(_0x2906('0x16'));var logger=require(_0x2906('0x17'))(_0x2906('0x18'));var utils=require(_0x2906('0x19'));var config=require(_0x2906('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2906('0x1b'))['db'];function respondWithStatusCode(_0x3967d3,_0x38d3a4){_0x38d3a4=_0x38d3a4||0xcc;return function(_0x1d8693){if(_0x1d8693){return _0x3967d3[_0x2906('0x1c')](_0x38d3a4);}return _0x3967d3[_0x2906('0x1d')](_0x38d3a4)[_0x2906('0x1e')]();};}function respondWithResult(_0x536fa6,_0xe15717){_0xe15717=_0xe15717||0xc8;return function(_0x7ea8e3){if(_0x7ea8e3){return _0x536fa6['status'](_0xe15717)[_0x2906('0x1f')](_0x7ea8e3);}};}function respondWithFilteredResult(_0x43c800,_0x183ae7){return function(_0x3c8509){if(_0x3c8509){var _0x1741e3=typeof _0x183ae7[_0x2906('0x20')]===_0x2906('0x21')&&typeof _0x183ae7['limit']===_0x2906('0x21');var _0x2a1ab2=_0x3c8509['count'];var _0x5555e6=_0x1741e3?0x0:_0x183ae7[_0x2906('0x20')];var _0x49d7b0=_0x1741e3?_0x3c8509[_0x2906('0x22')]:_0x183ae7[_0x2906('0x20')]+_0x183ae7[_0x2906('0x23')];var _0x51218b;if(_0x49d7b0>=_0x2a1ab2){_0x49d7b0=_0x2a1ab2;_0x51218b=0xc8;}else{_0x51218b=0xce;}_0x43c800[_0x2906('0x1d')](_0x51218b);return _0x43c800['set']('Content-Range',_0x5555e6+'-'+_0x49d7b0+'/'+_0x2a1ab2)[_0x2906('0x1f')](_0x3c8509);}return null;};}function patchUpdates(_0x23e7f1){return function(_0x47427c){try{jsonpatch['apply'](_0x47427c,_0x23e7f1,!![]);}catch(_0x5cb7da){return BPromise[_0x2906('0x24')](_0x5cb7da);}return _0x47427c[_0x2906('0x25')]();};}function saveUpdates(_0x1ac265,_0x468c6d){return function(_0x449578){if(_0x449578){return _0x449578[_0x2906('0x26')](_0x1ac265)[_0x2906('0x27')](function(_0x4023a3){return _0x4023a3;});}return null;};}function removeEntity(_0x22a034,_0x7acf19){return function(_0x48b60a){if(_0x48b60a){return _0x48b60a[_0x2906('0x28')]()[_0x2906('0x27')](function(){_0x22a034['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39f6a9,_0x2f34ac){return function(_0x3a4929){if(!_0x3a4929){_0x39f6a9[_0x2906('0x1c')](0x194);}return _0x3a4929;};}function handleError(_0x98802d,_0x4bd7cc){_0x4bd7cc=_0x4bd7cc||0x1f4;return function(_0x322935){logger['error'](_0x322935[_0x2906('0x29')]);if(_0x322935['name']){delete _0x322935[_0x2906('0x2a')];}_0x98802d[_0x2906('0x1d')](_0x4bd7cc)['send'](_0x322935);};}exports[_0x2906('0x2b')]=function(_0x5d5241,_0x3d2f8f){var _0x4e7ecb={},_0x52d3f1={},_0x4fbeb5={'count':0x0,'rows':[]};var _0x1267e5=_[_0x2906('0x2c')](db[_0x2906('0x2d')][_0x2906('0x2e')],function(_0x5542a3){return{'name':_0x5542a3[_0x2906('0x2f')],'type':_0x5542a3[_0x2906('0x30')][_0x2906('0x31')]};});_0x52d3f1[_0x2906('0x32')]=_['map'](_0x1267e5,_0x2906('0x2a'));_0x52d3f1[_0x2906('0x33')]=_[_0x2906('0x34')](_0x5d5241[_0x2906('0x33')]);_0x52d3f1[_0x2906('0x35')]=_[_0x2906('0x36')](_0x52d3f1[_0x2906('0x32')],_0x52d3f1['query']);_0x4e7ecb['attributes']=_[_0x2906('0x36')](_0x52d3f1[_0x2906('0x32')],qs[_0x2906('0x37')](_0x5d5241[_0x2906('0x33')][_0x2906('0x37')]));_0x4e7ecb[_0x2906('0x38')]=_0x4e7ecb['attributes']['length']?_0x4e7ecb[_0x2906('0x38')]:_0x52d3f1[_0x2906('0x32')];if(!_0x5d5241[_0x2906('0x33')][_0x2906('0x39')]('nolimit')){_0x4e7ecb[_0x2906('0x23')]=qs[_0x2906('0x23')](_0x5d5241[_0x2906('0x33')]['limit']);_0x4e7ecb[_0x2906('0x20')]=qs[_0x2906('0x20')](_0x5d5241[_0x2906('0x33')]['offset']);}_0x4e7ecb[_0x2906('0x3a')]=qs[_0x2906('0x3b')](_0x5d5241[_0x2906('0x33')][_0x2906('0x3b')]);_0x4e7ecb[_0x2906('0x3c')]=qs[_0x2906('0x35')](_[_0x2906('0x3d')](_0x5d5241[_0x2906('0x33')],_0x52d3f1[_0x2906('0x35')]),_0x1267e5);if(_0x5d5241[_0x2906('0x33')][_0x2906('0x3e')]){_0x4e7ecb[_0x2906('0x3c')]=_[_0x2906('0x3f')](_0x4e7ecb[_0x2906('0x3c')],{'$or':_[_0x2906('0x2c')](_0x1267e5,function(_0x39a3b4){if(_0x39a3b4[_0x2906('0x30')]!=='VIRTUAL'){var _0x28048c={};_0x28048c[_0x39a3b4[_0x2906('0x2a')]]={'$like':'%'+_0x5d5241['query'][_0x2906('0x3e')]+'%'};return _0x28048c;}})});}_0x4e7ecb=_['merge']({},_0x4e7ecb,_0x5d5241[_0x2906('0x40')]);var _0x3e0764={'where':_0x4e7ecb[_0x2906('0x3c')]};return db[_0x2906('0x2d')]['count'](_0x3e0764)[_0x2906('0x27')](function(_0x152898){_0x4fbeb5[_0x2906('0x22')]=_0x152898;if(_0x5d5241['query'][_0x2906('0x41')]){_0x4e7ecb[_0x2906('0x42')]=[{'all':!![]}];}return db[_0x2906('0x2d')][_0x2906('0x43')](_0x4e7ecb);})[_0x2906('0x27')](function(_0x48ed04){_0x4fbeb5['rows']=_0x48ed04;return _0x4fbeb5;})[_0x2906('0x27')](respondWithFilteredResult(_0x3d2f8f,_0x4e7ecb))[_0x2906('0x44')](handleError(_0x3d2f8f,null));};exports[_0x2906('0x45')]=function(_0x4cb4fb,_0x441a06){var _0x3fc7db={'raw':![],'where':{'id':_0x4cb4fb['params']['id']}},_0x29c437={};_0x29c437[_0x2906('0x32')]=_[_0x2906('0x34')](db[_0x2906('0x2d')][_0x2906('0x2e')]);_0x29c437['query']=_[_0x2906('0x34')](_0x4cb4fb[_0x2906('0x33')]);_0x29c437[_0x2906('0x35')]=_[_0x2906('0x36')](_0x29c437[_0x2906('0x32')],_0x29c437[_0x2906('0x33')]);_0x3fc7db[_0x2906('0x38')]=_[_0x2906('0x36')](_0x29c437[_0x2906('0x32')],qs[_0x2906('0x37')](_0x4cb4fb[_0x2906('0x33')][_0x2906('0x37')]));_0x3fc7db[_0x2906('0x38')]=_0x3fc7db['attributes'][_0x2906('0x46')]?_0x3fc7db[_0x2906('0x38')]:_0x29c437[_0x2906('0x32')];if(_0x4cb4fb[_0x2906('0x33')][_0x2906('0x41')]){_0x3fc7db['include']=[{'all':!![]}];}_0x3fc7db=_[_0x2906('0x3f')]({},_0x3fc7db,_0x4cb4fb[_0x2906('0x40')]);return db[_0x2906('0x2d')][_0x2906('0x47')](_0x3fc7db)[_0x2906('0x27')](handleEntityNotFound(_0x441a06,null))[_0x2906('0x27')](respondWithResult(_0x441a06,null))['catch'](handleError(_0x441a06,null));};exports[_0x2906('0x48')]=function(_0x29d99c,_0x20599a){return db[_0x2906('0x2d')][_0x2906('0x48')](_0x29d99c[_0x2906('0x49')],{})['then'](respondWithResult(_0x20599a,0xc9))[_0x2906('0x44')](handleError(_0x20599a,null));};exports['update']=function(_0x1236d6,_0x29e752){if(_0x1236d6[_0x2906('0x49')]['id']){delete _0x1236d6[_0x2906('0x49')]['id'];}return db[_0x2906('0x2d')][_0x2906('0x47')]({'where':{'id':_0x1236d6[_0x2906('0x4a')]['id']}})[_0x2906('0x27')](handleEntityNotFound(_0x29e752,null))[_0x2906('0x27')](saveUpdates(_0x1236d6[_0x2906('0x49')],null))[_0x2906('0x27')](respondWithResult(_0x29e752,null))[_0x2906('0x44')](handleError(_0x29e752,null));};exports[_0x2906('0x28')]=function(_0x443647,_0x1f8f6e){return db[_0x2906('0x2d')]['find']({'where':{'id':_0x443647[_0x2906('0x4a')]['id']}})[_0x2906('0x27')](handleEntityNotFound(_0x1f8f6e,null))[_0x2906('0x27')](removeEntity(_0x1f8f6e,null))['catch'](handleError(_0x1f8f6e,null));};exports[_0x2906('0x4b')]=function(_0x419bf3,_0x899642,_0x45e644){var _0x49a418={};var _0xcce6d2={};var _0x18a598;var _0x22ae8e;return db[_0x2906('0x2d')][_0x2906('0x4c')]({'where':{'id':_0x419bf3[_0x2906('0x4a')]['id']}})['then'](handleEntityNotFound(_0x899642,null))[_0x2906('0x27')](function(_0x40c998){if(_0x40c998){_0x18a598=_0x40c998;_0xcce6d2[_0x2906('0x32')]=_[_0x2906('0x34')](db[_0x2906('0x4d')][_0x2906('0x2e')]);_0xcce6d2['query']=_[_0x2906('0x34')](_0x419bf3[_0x2906('0x33')]);_0xcce6d2[_0x2906('0x35')]=_[_0x2906('0x36')](_0xcce6d2[_0x2906('0x32')],_0xcce6d2[_0x2906('0x33')]);_0x49a418[_0x2906('0x38')]=_['intersection'](_0xcce6d2[_0x2906('0x32')],qs[_0x2906('0x37')](_0x419bf3[_0x2906('0x33')][_0x2906('0x37')]));_0x49a418[_0x2906('0x38')]=_0x49a418[_0x2906('0x38')][_0x2906('0x46')]?_0x49a418[_0x2906('0x38')]:_0xcce6d2[_0x2906('0x32')];_0x49a418['order']=qs[_0x2906('0x3b')](_0x419bf3[_0x2906('0x33')][_0x2906('0x3b')]);_0x49a418['where']=qs[_0x2906('0x35')](_[_0x2906('0x3d')](_0x419bf3[_0x2906('0x33')],_0xcce6d2[_0x2906('0x35')]));if(_0x419bf3[_0x2906('0x33')]['filter']){_0x49a418[_0x2906('0x3c')]=_[_0x2906('0x3f')](_0x49a418[_0x2906('0x3c')],{'$or':_[_0x2906('0x2c')](_0x49a418[_0x2906('0x38')],function(_0x26713c){var _0x3a5231={};_0x3a5231[_0x26713c]={'$like':'%'+_0x419bf3['query']['filter']+'%'};return _0x3a5231;})});}_0x49a418=_[_0x2906('0x3f')]({},_0x49a418,_0x419bf3['options']);return _0x18a598['getFields'](_0x49a418);}})[_0x2906('0x27')](function(_0x328ecf){if(_0x328ecf){_0x22ae8e=_0x328ecf[_0x2906('0x46')];if(!_0x419bf3[_0x2906('0x33')][_0x2906('0x39')](_0x2906('0x4e'))){_0x49a418[_0x2906('0x23')]=qs[_0x2906('0x23')](_0x419bf3[_0x2906('0x33')][_0x2906('0x23')]);_0x49a418[_0x2906('0x20')]=qs[_0x2906('0x20')](_0x419bf3[_0x2906('0x33')]['offset']);}return _0x18a598[_0x2906('0x4b')](_0x49a418);}})['then'](function(_0x5ea8d1){if(_0x5ea8d1){return _0x5ea8d1?{'count':_0x22ae8e,'rows':_0x5ea8d1}:null;}})[_0x2906('0x27')](respondWithResult(_0x899642,null))[_0x2906('0x44')](handleError(_0x899642,null));};exports['getSubjects']=function(_0x129865,_0x330cfd,_0xf63219){var _0x100a7b={};var _0x593ffb={};var _0x35245e;var _0x27dfcf;return db[_0x2906('0x2d')]['findOne']({'where':{'id':_0x129865['params']['id']}})[_0x2906('0x27')](handleEntityNotFound(_0x330cfd,null))[_0x2906('0x27')](function(_0x59ce3c){if(_0x59ce3c){_0x35245e=_0x59ce3c;_0x593ffb['model']=_[_0x2906('0x34')](db[_0x2906('0x4d')][_0x2906('0x2e')]);_0x593ffb[_0x2906('0x33')]=_[_0x2906('0x34')](_0x129865['query']);_0x593ffb[_0x2906('0x35')]=_['intersection'](_0x593ffb[_0x2906('0x32')],_0x593ffb['query']);_0x100a7b['attributes']=_[_0x2906('0x36')](_0x593ffb['model'],qs['fields'](_0x129865[_0x2906('0x33')][_0x2906('0x37')]));_0x100a7b[_0x2906('0x38')]=_0x100a7b[_0x2906('0x38')][_0x2906('0x46')]?_0x100a7b['attributes']:_0x593ffb[_0x2906('0x32')];_0x100a7b[_0x2906('0x3a')]=qs['sort'](_0x129865[_0x2906('0x33')][_0x2906('0x3b')]);_0x100a7b[_0x2906('0x3c')]=qs[_0x2906('0x35')](_[_0x2906('0x3d')](_0x129865['query'],_0x593ffb[_0x2906('0x35')]));if(_0x129865[_0x2906('0x33')][_0x2906('0x3e')]){_0x100a7b['where']=_[_0x2906('0x3f')](_0x100a7b[_0x2906('0x3c')],{'$or':_[_0x2906('0x2c')](_0x100a7b[_0x2906('0x38')],function(_0x54fd75){var _0x518f79={};_0x518f79[_0x54fd75]={'$like':'%'+_0x129865[_0x2906('0x33')][_0x2906('0x3e')]+'%'};return _0x518f79;})});}_0x100a7b=_[_0x2906('0x3f')]({},_0x100a7b,_0x129865[_0x2906('0x40')]);return _0x35245e[_0x2906('0x4f')](_0x100a7b);}})['then'](function(_0xb212d8){if(_0xb212d8){_0x27dfcf=_0xb212d8[_0x2906('0x46')];if(!_0x129865[_0x2906('0x33')][_0x2906('0x39')](_0x2906('0x4e'))){_0x100a7b[_0x2906('0x23')]=qs[_0x2906('0x23')](_0x129865[_0x2906('0x33')][_0x2906('0x23')]);_0x100a7b[_0x2906('0x20')]=qs[_0x2906('0x20')](_0x129865[_0x2906('0x33')][_0x2906('0x20')]);}return _0x35245e[_0x2906('0x4f')](_0x100a7b);}})[_0x2906('0x27')](function(_0x25895f){if(_0x25895f){return _0x25895f?{'count':_0x27dfcf,'rows':_0x25895f}:null;}})[_0x2906('0x27')](respondWithResult(_0x330cfd,null))[_0x2906('0x44')](handleError(_0x330cfd,null));};exports[_0x2906('0x50')]=function(_0x2d2c5d,_0x24abba,_0x5b12f3){var _0x40b7ab={};var _0x52d3f7={};var _0x3a81e8;var _0x1cf445;return db['ZendeskConfiguration'][_0x2906('0x4c')]({'where':{'id':_0x2d2c5d[_0x2906('0x4a')]['id']}})[_0x2906('0x27')](handleEntityNotFound(_0x24abba,null))[_0x2906('0x27')](function(_0x342011){if(_0x342011){_0x3a81e8=_0x342011;_0x52d3f7[_0x2906('0x32')]=_['keys'](db[_0x2906('0x4d')]['rawAttributes']);_0x52d3f7['query']=_[_0x2906('0x34')](_0x2d2c5d[_0x2906('0x33')]);_0x52d3f7[_0x2906('0x35')]=_[_0x2906('0x36')](_0x52d3f7[_0x2906('0x32')],_0x52d3f7[_0x2906('0x33')]);_0x40b7ab[_0x2906('0x38')]=_['intersection'](_0x52d3f7[_0x2906('0x32')],qs['fields'](_0x2d2c5d[_0x2906('0x33')][_0x2906('0x37')]));_0x40b7ab[_0x2906('0x38')]=_0x40b7ab[_0x2906('0x38')]['length']?_0x40b7ab[_0x2906('0x38')]:_0x52d3f7[_0x2906('0x32')];_0x40b7ab[_0x2906('0x3a')]=qs[_0x2906('0x3b')](_0x2d2c5d[_0x2906('0x33')][_0x2906('0x3b')]);_0x40b7ab[_0x2906('0x3c')]=qs[_0x2906('0x35')](_[_0x2906('0x3d')](_0x2d2c5d[_0x2906('0x33')],_0x52d3f7[_0x2906('0x35')]));if(_0x2d2c5d[_0x2906('0x33')][_0x2906('0x3e')]){_0x40b7ab[_0x2906('0x3c')]=_['merge'](_0x40b7ab['where'],{'$or':_[_0x2906('0x2c')](_0x40b7ab[_0x2906('0x38')],function(_0x3df8a7){var _0x3f3619={};_0x3f3619[_0x3df8a7]={'$like':'%'+_0x2d2c5d[_0x2906('0x33')][_0x2906('0x3e')]+'%'};return _0x3f3619;})});}_0x40b7ab=_['merge']({},_0x40b7ab,_0x2d2c5d[_0x2906('0x40')]);return _0x3a81e8[_0x2906('0x50')](_0x40b7ab);}})[_0x2906('0x27')](function(_0x54a1d0){if(_0x54a1d0){_0x1cf445=_0x54a1d0[_0x2906('0x46')];if(!_0x2d2c5d['query'][_0x2906('0x39')](_0x2906('0x4e'))){_0x40b7ab[_0x2906('0x23')]=qs[_0x2906('0x23')](_0x2d2c5d['query']['limit']);_0x40b7ab[_0x2906('0x20')]=qs[_0x2906('0x20')](_0x2d2c5d[_0x2906('0x33')][_0x2906('0x20')]);}return _0x3a81e8[_0x2906('0x50')](_0x40b7ab);}})[_0x2906('0x27')](function(_0x3edf22){if(_0x3edf22){return _0x3edf22?{'count':_0x1cf445,'rows':_0x3edf22}:null;}})[_0x2906('0x27')](respondWithResult(_0x24abba,null))[_0x2906('0x44')](handleError(_0x24abba,null));};exports[_0x2906('0x51')]=function(_0x3348f7,_0x101809,_0x2ca023){var _0x266ed7={};var _0x3d3245={};var _0x53a289;var _0x326053;return db[_0x2906('0x2d')]['findOne']({'where':{'id':_0x3348f7[_0x2906('0x4a')]['id']}})[_0x2906('0x27')](handleEntityNotFound(_0x101809,null))[_0x2906('0x27')](function(_0x9933d5){if(_0x9933d5){_0x53a289=_0x9933d5;_0x3d3245[_0x2906('0x32')]=_['keys'](db[_0x2906('0x52')][_0x2906('0x2e')]);_0x3d3245[_0x2906('0x33')]=_['keys'](_0x3348f7['query']);_0x3d3245[_0x2906('0x35')]=_['intersection'](_0x3d3245[_0x2906('0x32')],_0x3d3245[_0x2906('0x33')]);_0x266ed7[_0x2906('0x38')]=_[_0x2906('0x36')](_0x3d3245[_0x2906('0x32')],qs[_0x2906('0x37')](_0x3348f7[_0x2906('0x33')][_0x2906('0x37')]));_0x266ed7[_0x2906('0x38')]=_0x266ed7[_0x2906('0x38')][_0x2906('0x46')]?_0x266ed7[_0x2906('0x38')]:_0x3d3245[_0x2906('0x32')];_0x266ed7[_0x2906('0x3a')]=qs[_0x2906('0x3b')](_0x3348f7[_0x2906('0x33')]['sort']);_0x266ed7[_0x2906('0x3c')]=qs[_0x2906('0x35')](_[_0x2906('0x3d')](_0x3348f7[_0x2906('0x33')],_0x3d3245[_0x2906('0x35')]));if(_0x3348f7[_0x2906('0x33')][_0x2906('0x3e')]){_0x266ed7[_0x2906('0x3c')]=_['merge'](_0x266ed7['where'],{'$or':_[_0x2906('0x2c')](_0x266ed7['attributes'],function(_0x1778c2){var _0x3a1802={};_0x3a1802[_0x1778c2]={'$like':'%'+_0x3348f7[_0x2906('0x33')][_0x2906('0x3e')]+'%'};return _0x3a1802;})});}_0x266ed7=_[_0x2906('0x3f')]({},_0x266ed7,_0x3348f7[_0x2906('0x40')]);return _0x53a289[_0x2906('0x51')](_0x266ed7);}})['then'](function(_0x162d40){if(_0x162d40){_0x326053=_0x162d40['length'];if(!_0x3348f7['query']['hasOwnProperty'](_0x2906('0x4e'))){_0x266ed7[_0x2906('0x23')]=qs[_0x2906('0x23')](_0x3348f7[_0x2906('0x33')][_0x2906('0x23')]);_0x266ed7[_0x2906('0x20')]=qs[_0x2906('0x20')](_0x3348f7[_0x2906('0x33')]['offset']);}return _0x53a289['getTags'](_0x266ed7);}})[_0x2906('0x27')](function(_0x1436a5){if(_0x1436a5){return _0x1436a5?{'count':_0x326053,'rows':_0x1436a5}:null;}})[_0x2906('0x27')](respondWithResult(_0x101809,null))[_0x2906('0x44')](handleError(_0x101809,null));};exports[_0x2906('0x53')]=function(_0x4f26aa,_0x16166f,_0x1fa5c8){if(_0x4f26aa[_0x2906('0x49')]['id']){delete _0x4f26aa[_0x2906('0x49')]['id'];}return db[_0x2906('0x2d')][_0x2906('0x4c')]({'where':{'id':_0x4f26aa['params']['id']}})[_0x2906('0x27')](handleEntityNotFound(_0x16166f,null))[_0x2906('0x27')](function(_0x4022b7){if(_0x4022b7){return _0x4022b7[_0x2906('0x53')](_0x4f26aa['body'][_0x2906('0x54')]||[]);}return null;})[_0x2906('0x27')](respondWithResult(_0x16166f,null))[_0x2906('0x44')](handleError(_0x16166f,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index c7a3042..c95e59f 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 _0x5b12=['int_zendesk_configurations','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','ZendeskConfiguration'];(function(_0x182dd9,_0x3c81cf){var _0x349502=function(_0x44fc6f){while(--_0x44fc6f){_0x182dd9['push'](_0x182dd9['shift']());}};_0x349502(++_0x3c81cf);}(_0x5b12,0xa3));var _0x25b1=function(_0x1de390,_0x3e5e2c){_0x1de390=_0x1de390-0x0;var _0x3a3f13=_0x5b12[_0x1de390];return _0x3a3f13;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var logger=require(_0x25b1('0x2'))('api');var moment=require(_0x25b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x25b1('0x4'));var fs=require('fs');var path=require(_0x25b1('0x5'));var rimraf=require('rimraf');var config=require(_0x25b1('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x35d90b,_0x5523c9){return _0x35d90b['define'](_0x25b1('0x7'),attributes,{'tableName':_0x25b1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb62e=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','int_zendesk_configurations','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb62e,0x1de));var _0xeb62=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xb62e[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var logger=require(_0xeb62('0x2'))(_0xeb62('0x3'));var moment=require('moment');var BPromise=require(_0xeb62('0x4'));var rp=require(_0xeb62('0x5'));var fs=require('fs');var path=require(_0xeb62('0x6'));var rimraf=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var attributes=require(_0xeb62('0x9'));module['exports']=function(_0x3ec879,_0x455e1a){return _0x3ec879[_0xeb62('0xa')]('ZendeskConfiguration',attributes,{'tableName':_0xeb62('0xb'),'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 5ffcd95..d64f99d 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 _0x130a=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x2e5184,_0x3d9825){var _0x298144=function(_0x1e1b2b){while(--_0x1e1b2b){_0x2e5184['push'](_0x2e5184['shift']());}};_0x298144(++_0x3d9825);}(_0x130a,0x103));var _0xa130=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0x130a[_0x2f4c1c];return _0x25e0f2;};'use strict';var _=require(_0xa130('0x0'));var util=require(_0xa130('0x1'));var moment=require(_0xa130('0x2'));var BPromise=require('bluebird');var rs=require(_0xa130('0x3'));var fs=require('fs');var Redis=require(_0xa130('0x4'));var db=require(_0xa130('0x5'))['db'];var utils=require(_0xa130('0x6'));var logger=require('../../config/logger')(_0xa130('0x7'));var config=require(_0xa130('0x8'));var jayson=require(_0xa130('0x9'));var client=jayson[_0xa130('0xa')][_0xa130('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e662a,_0x401ff6,_0x1e36d8){return new BPromise(function(_0x418568,_0x1c7cba){return client[_0xa130('0xc')](_0x1e662a,_0x1e36d8)['then'](function(_0x39abe9){logger[_0xa130('0xd')](_0xa130('0xe'),_0x401ff6,_0xa130('0xf'));logger[_0xa130('0x10')](_0xa130('0x11'),_0x401ff6,_0xa130('0xf'),JSON[_0xa130('0x12')](_0x39abe9));if(_0x39abe9[_0xa130('0x13')]){if(_0x39abe9[_0xa130('0x13')][_0xa130('0x14')]===0x1f4){logger[_0xa130('0x13')](_0xa130('0xe'),_0x401ff6,_0x39abe9['error'][_0xa130('0x15')]);return _0x1c7cba(_0x39abe9[_0xa130('0x13')][_0xa130('0x15')]);}logger[_0xa130('0x13')](_0xa130('0xe'),_0x401ff6,_0x39abe9[_0xa130('0x13')][_0xa130('0x15')]);return _0x418568(_0x39abe9[_0xa130('0x13')][_0xa130('0x15')]);}else{logger[_0xa130('0xd')](_0xa130('0xe'),_0x401ff6,_0xa130('0xf'));_0x418568(_0x39abe9[_0xa130('0x16')][_0xa130('0x15')]);}})[_0xa130('0x17')](function(_0xc66c7b){logger[_0xa130('0x13')](_0xa130('0xe'),_0x401ff6,_0xc66c7b);_0x1c7cba(_0xc66c7b);});});} \ No newline at end of file +var _0x7632=['code','message','info','result','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x7632,0xf4));var _0x2763=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0x7632[_0x19d24c];return _0x2fae8d;};'use strict';var _=require(_0x2763('0x0'));var util=require(_0x2763('0x1'));var moment=require('moment');var BPromise=require(_0x2763('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2763('0x3'));var logger=require(_0x2763('0x4'))(_0x2763('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2763('0x6')][_0x2763('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4fe082,_0x55db5a,_0x365608){return new BPromise(function(_0x36e226,_0x213959){return client[_0x2763('0x8')](_0x4fe082,_0x365608)[_0x2763('0x9')](function(_0x673d31){logger['info'](_0x2763('0xa'),_0x55db5a,_0x2763('0xb'));logger[_0x2763('0xc')](_0x2763('0xd'),_0x55db5a,_0x2763('0xb'),JSON[_0x2763('0xe')](_0x673d31));if(_0x673d31[_0x2763('0xf')]){if(_0x673d31[_0x2763('0xf')][_0x2763('0x10')]===0x1f4){logger[_0x2763('0xf')](_0x2763('0xa'),_0x55db5a,_0x673d31['error'][_0x2763('0x11')]);return _0x213959(_0x673d31[_0x2763('0xf')][_0x2763('0x11')]);}logger[_0x2763('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x55db5a,_0x673d31[_0x2763('0xf')][_0x2763('0x11')]);return _0x36e226(_0x673d31[_0x2763('0xf')]['message']);}else{logger[_0x2763('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x55db5a,_0x2763('0xb'));_0x36e226(_0x673d31[_0x2763('0x13')][_0x2763('0x11')]);}})['catch'](function(_0x108e48){logger[_0x2763('0xf')](_0x2763('0xa'),_0x55db5a,_0x108e48);_0x213959(_0x108e48);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index dbee0b2..5820e75 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 _0xc3fc=['../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4f0a7d,_0x1a2052){var _0x55d9f1=function(_0x2be6bd){while(--_0x2be6bd){_0x4f0a7d['push'](_0x4f0a7d['shift']());}};_0x55d9f1(++_0x1a2052);}(_0xc3fc,0x163));var _0xcc3f=function(_0x194bdb,_0xbffaf9){_0x194bdb=_0x194bdb-0x0;var _0x59b220=_0xc3fc[_0x194bdb];return _0x59b220;};'use strict';var multer=require(_0xcc3f('0x0'));var util=require(_0xcc3f('0x1'));var path=require('path');var timeout=require(_0xcc3f('0x2'));var express=require(_0xcc3f('0x3'));var router=express[_0xcc3f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcc3f('0x5'));var interaction=require(_0xcc3f('0x6'));var config=require(_0xcc3f('0x7'));var controller=require(_0xcc3f('0x8'));router['get']('/',auth[_0xcc3f('0x9')](),controller[_0xcc3f('0xa')]);router[_0xcc3f('0xb')](_0xcc3f('0xc'),auth['isAuthenticated'](),controller[_0xcc3f('0xd')]);router['post']('/',auth[_0xcc3f('0x9')](),controller[_0xcc3f('0xe')]);router[_0xcc3f('0xf')]('/:id',auth[_0xcc3f('0x9')](),controller[_0xcc3f('0x10')]);router[_0xcc3f('0x11')](_0xcc3f('0xc'),auth[_0xcc3f('0x9')](),controller['destroy']);module[_0xcc3f('0x12')]=router; \ No newline at end of file +var _0xec7a=['post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intZendeskField.controller','index','get','isAuthenticated','show'];(function(_0x38a155,_0x2aa026){var _0x269403=function(_0x47263b){while(--_0x47263b){_0x38a155['push'](_0x38a155['shift']());}};_0x269403(++_0x2aa026);}(_0xec7a,0x1ce));var _0xaec7=function(_0x59f7b8,_0xb2ac21){_0x59f7b8=_0x59f7b8-0x0;var _0x7b28c5=_0xec7a[_0x59f7b8];return _0x7b28c5;};'use strict';var multer=require(_0xaec7('0x0'));var util=require(_0xaec7('0x1'));var path=require(_0xaec7('0x2'));var timeout=require(_0xaec7('0x3'));var express=require(_0xaec7('0x4'));var router=express[_0xaec7('0x5')]();var fs_extra=require(_0xaec7('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaec7('0x7'));var controller=require(_0xaec7('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xaec7('0x9')]);router[_0xaec7('0xa')]('/:id',auth[_0xaec7('0xb')](),controller[_0xaec7('0xc')]);router[_0xaec7('0xd')]('/',auth[_0xaec7('0xb')](),controller[_0xaec7('0xe')]);router[_0xaec7('0xf')](_0xaec7('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xaec7('0x10'),auth[_0xaec7('0xb')](),controller[_0xaec7('0x11')]);module[_0xaec7('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index c10988b..6d10494 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 _0x3010=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable'];(function(_0xe91c2f,_0x186b38){var _0x32c63c=function(_0x5a3d45){while(--_0x5a3d45){_0xe91c2f['push'](_0xe91c2f['shift']());}};_0x32c63c(++_0x186b38);}(_0x3010,0x123));var _0x0301=function(_0x565b67,_0x25d78c){_0x565b67=_0x565b67-0x0;var _0x54ba32=_0x3010[_0x565b67];return _0x54ba32;};'use strict';var Sequelize=require(_0x0301('0x0'));module[_0x0301('0x1')]={'type':{'type':Sequelize[_0x0301('0x2')](_0x0301('0x3'),'variable',_0x0301('0x4'),_0x0301('0x5'),_0x0301('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0301('0x7')]},'key':{'type':Sequelize[_0x0301('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x0301('0x8'),_0x0301('0x4'))},'keyContent':{'type':Sequelize[_0x0301('0x7')]},'idField':{'type':Sequelize[_0x0301('0x7')]},'nameField':{'type':Sequelize[_0x0301('0x7')]},'customField':{'type':Sequelize[_0x0301('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0301('0x7')]}}; \ No newline at end of file +var _0x85f6=['exports','string','variable','customVariable','STRING','ENUM'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x85f6,0x12c));var _0x685f=function(_0x1d3166,_0x2c05ed){_0x1d3166=_0x1d3166-0x0;var _0x5bdbc0=_0x85f6[_0x1d3166];return _0x5bdbc0;};'use strict';var Sequelize=require('sequelize');module[_0x685f('0x0')]={'type':{'type':Sequelize['ENUM'](_0x685f('0x1'),_0x685f('0x2'),_0x685f('0x3'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x685f('0x4')]},'key':{'type':Sequelize[_0x685f('0x4')]},'keyType':{'type':Sequelize[_0x685f('0x5')]('string',_0x685f('0x2'),_0x685f('0x3'))},'keyContent':{'type':Sequelize[_0x685f('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index d2a5042..577bdaa 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 _0x846f=['body','update','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','set','Content-Range','json','reject','then','destroy','end','sendStatus','error','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','find','create'];(function(_0x321008,_0x3c121e){var _0x4e569d=function(_0x555e52){while(--_0x555e52){_0x321008['push'](_0x321008['shift']());}};_0x4e569d(++_0x3c121e);}(_0x846f,0x93));var _0xf846=function(_0x37a53d,_0x3d92c0){_0x37a53d=_0x37a53d-0x0;var _0x41f7da=_0x846f[_0x37a53d];return _0x41f7da;};'use strict';var emlformat=require(_0xf846('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf846('0x1'));var jsonpatch=require(_0xf846('0x2'));var rp=require(_0xf846('0x3'));var moment=require('moment');var BPromise=require(_0xf846('0x4'));var Mustache=require(_0xf846('0x5'));var util=require(_0xf846('0x6'));var path=require(_0xf846('0x7'));var sox=require(_0xf846('0x8'));var csv=require('to-csv');var ejs=require(_0xf846('0x9'));var fs=require('fs');var fs_extra=require(_0xf846('0xa'));var _=require(_0xf846('0xb'));var squel=require(_0xf846('0xc'));var crypto=require(_0xf846('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf846('0xe'));var querystring=require(_0xf846('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf846('0x10'));var hardwareService=require(_0xf846('0x11'));var logger=require('../../config/logger')(_0xf846('0x12'));var utils=require(_0xf846('0x13'));var config=require(_0xf846('0x14'));var licenseUtil=require(_0xf846('0x15'));var db=require(_0xf846('0x16'))['db'];function respondWithStatusCode(_0x28e634,_0x55ddb1){_0x55ddb1=_0x55ddb1||0xcc;return function(_0x145449){if(_0x145449){return _0x28e634['sendStatus'](_0x55ddb1);}return _0x28e634['status'](_0x55ddb1)['end']();};}function respondWithResult(_0x81f7cd,_0xc3d1ef){_0xc3d1ef=_0xc3d1ef||0xc8;return function(_0x5b9f9e){if(_0x5b9f9e){return _0x81f7cd[_0xf846('0x17')](_0xc3d1ef)['json'](_0x5b9f9e);}};}function respondWithFilteredResult(_0x548fbf,_0x4cb115){return function(_0x59fe82){if(_0x59fe82){var _0x1e3c2b=typeof _0x4cb115[_0xf846('0x18')]===_0xf846('0x19')&&typeof _0x4cb115[_0xf846('0x1a')]===_0xf846('0x19');var _0x578e61=_0x59fe82['count'];var _0x231dd1=_0x1e3c2b?0x0:_0x4cb115['offset'];var _0x716f7d=_0x1e3c2b?_0x59fe82['count']:_0x4cb115[_0xf846('0x18')]+_0x4cb115['limit'];var _0x20e95e;if(_0x716f7d>=_0x578e61){_0x716f7d=_0x578e61;_0x20e95e=0xc8;}else{_0x20e95e=0xce;}_0x548fbf[_0xf846('0x17')](_0x20e95e);return _0x548fbf[_0xf846('0x1b')](_0xf846('0x1c'),_0x231dd1+'-'+_0x716f7d+'/'+_0x578e61)[_0xf846('0x1d')](_0x59fe82);}return null;};}function patchUpdates(_0x26a976){return function(_0x48d276){try{jsonpatch['apply'](_0x48d276,_0x26a976,!![]);}catch(_0x50f244){return BPromise[_0xf846('0x1e')](_0x50f244);}return _0x48d276['save']();};}function saveUpdates(_0x300e11,_0x17e4fa){return function(_0x5c2e05){if(_0x5c2e05){return _0x5c2e05['update'](_0x300e11)[_0xf846('0x1f')](function(_0x123d2d){return _0x123d2d;});}return null;};}function removeEntity(_0x32a00d,_0x5d18a9){return function(_0xe2dfa2){if(_0xe2dfa2){return _0xe2dfa2[_0xf846('0x20')]()[_0xf846('0x1f')](function(){_0x32a00d['status'](0xcc)[_0xf846('0x21')]();});}};}function handleEntityNotFound(_0x51e458,_0x1d8dc4){return function(_0x19602a){if(!_0x19602a){_0x51e458[_0xf846('0x22')](0x194);}return _0x19602a;};}function handleError(_0x58e045,_0x11ac05){_0x11ac05=_0x11ac05||0x1f4;return function(_0x575ddb){logger[_0xf846('0x23')](_0x575ddb['stack']);if(_0x575ddb[_0xf846('0x24')]){delete _0x575ddb[_0xf846('0x24')];}_0x58e045['status'](_0x11ac05)[_0xf846('0x25')](_0x575ddb);};}exports[_0xf846('0x26')]=function(_0x4f756a,_0x1ffdff){var _0x4b3629={},_0x3e49f5={},_0x367981={'count':0x0,'rows':[]};var _0x3dda7e=_['map'](db[_0xf846('0x27')][_0xf846('0x28')],function(_0x1dbdab){return{'name':_0x1dbdab[_0xf846('0x29')],'type':_0x1dbdab[_0xf846('0x2a')][_0xf846('0x2b')]};});_0x3e49f5['model']=_[_0xf846('0x2c')](_0x3dda7e,_0xf846('0x24'));_0x3e49f5[_0xf846('0x2d')]=_[_0xf846('0x2e')](_0x4f756a[_0xf846('0x2d')]);_0x3e49f5[_0xf846('0x2f')]=_[_0xf846('0x30')](_0x3e49f5[_0xf846('0x31')],_0x3e49f5['query']);_0x4b3629['attributes']=_[_0xf846('0x30')](_0x3e49f5['model'],qs['fields'](_0x4f756a[_0xf846('0x2d')][_0xf846('0x32')]));_0x4b3629['attributes']=_0x4b3629[_0xf846('0x33')][_0xf846('0x34')]?_0x4b3629[_0xf846('0x33')]:_0x3e49f5[_0xf846('0x31')];if(!_0x4f756a[_0xf846('0x2d')][_0xf846('0x35')]('nolimit')){_0x4b3629['limit']=qs[_0xf846('0x1a')](_0x4f756a[_0xf846('0x2d')][_0xf846('0x1a')]);_0x4b3629['offset']=qs['offset'](_0x4f756a[_0xf846('0x2d')][_0xf846('0x18')]);}_0x4b3629[_0xf846('0x36')]=qs[_0xf846('0x37')](_0x4f756a[_0xf846('0x2d')]['sort']);_0x4b3629[_0xf846('0x38')]=qs[_0xf846('0x2f')](_[_0xf846('0x39')](_0x4f756a['query'],_0x3e49f5[_0xf846('0x2f')]),_0x3dda7e);if(_0x4f756a[_0xf846('0x2d')][_0xf846('0x3a')]){_0x4b3629[_0xf846('0x38')]=_[_0xf846('0x3b')](_0x4b3629[_0xf846('0x38')],{'$or':_[_0xf846('0x2c')](_0x3dda7e,function(_0x181387){if(_0x181387[_0xf846('0x2a')]!==_0xf846('0x3c')){var _0x4bce39={};_0x4bce39[_0x181387[_0xf846('0x24')]]={'$like':'%'+_0x4f756a[_0xf846('0x2d')][_0xf846('0x3a')]+'%'};return _0x4bce39;}})});}_0x4b3629=_[_0xf846('0x3b')]({},_0x4b3629,_0x4f756a['options']);var _0x3085e9={'where':_0x4b3629[_0xf846('0x38')]};return db[_0xf846('0x27')][_0xf846('0x3d')](_0x3085e9)[_0xf846('0x1f')](function(_0x39fd69){_0x367981[_0xf846('0x3d')]=_0x39fd69;if(_0x4f756a[_0xf846('0x2d')][_0xf846('0x3e')]){_0x4b3629[_0xf846('0x3f')]=[{'all':!![]}];}return db[_0xf846('0x27')]['findAll'](_0x4b3629);})['then'](function(_0x187e01){_0x367981[_0xf846('0x40')]=_0x187e01;return _0x367981;})['then'](respondWithFilteredResult(_0x1ffdff,_0x4b3629))[_0xf846('0x41')](handleError(_0x1ffdff,null));};exports[_0xf846('0x42')]=function(_0x5edd68,_0xbf92a6){var _0x6fa310={'raw':!![],'where':{'id':_0x5edd68['params']['id']}},_0x36cc3b={};_0x36cc3b[_0xf846('0x31')]=_[_0xf846('0x2e')](db[_0xf846('0x27')][_0xf846('0x28')]);_0x36cc3b['query']=_[_0xf846('0x2e')](_0x5edd68['query']);_0x36cc3b['filters']=_[_0xf846('0x30')](_0x36cc3b[_0xf846('0x31')],_0x36cc3b['query']);_0x6fa310[_0xf846('0x33')]=_['intersection'](_0x36cc3b[_0xf846('0x31')],qs[_0xf846('0x32')](_0x5edd68[_0xf846('0x2d')]['fields']));_0x6fa310[_0xf846('0x33')]=_0x6fa310['attributes'][_0xf846('0x34')]?_0x6fa310[_0xf846('0x33')]:_0x36cc3b[_0xf846('0x31')];if(_0x5edd68[_0xf846('0x2d')]['includeAll']){_0x6fa310[_0xf846('0x3f')]=[{'all':!![]}];}_0x6fa310=_[_0xf846('0x3b')]({},_0x6fa310,_0x5edd68['options']);return db['ZendeskField'][_0xf846('0x43')](_0x6fa310)['then'](handleEntityNotFound(_0xbf92a6,null))['then'](respondWithResult(_0xbf92a6,null))['catch'](handleError(_0xbf92a6,null));};exports['create']=function(_0x43a4f5,_0x5b6427){return db[_0xf846('0x27')][_0xf846('0x44')](_0x43a4f5[_0xf846('0x45')],{})[_0xf846('0x1f')](respondWithResult(_0x5b6427,0xc9))['catch'](handleError(_0x5b6427,null));};exports[_0xf846('0x46')]=function(_0x44cfb8,_0x271afc){if(_0x44cfb8['body']['id']){delete _0x44cfb8['body']['id'];}return db[_0xf846('0x27')][_0xf846('0x43')]({'where':{'id':_0x44cfb8[_0xf846('0x47')]['id']}})[_0xf846('0x1f')](handleEntityNotFound(_0x271afc,null))[_0xf846('0x1f')](saveUpdates(_0x44cfb8[_0xf846('0x45')],null))[_0xf846('0x1f')](respondWithResult(_0x271afc,null))[_0xf846('0x41')](handleError(_0x271afc,null));};exports[_0xf846('0x20')]=function(_0x17df95,_0x30e072){return db['ZendeskField'][_0xf846('0x43')]({'where':{'id':_0x17df95['params']['id']}})[_0xf846('0x1f')](handleEntityNotFound(_0x30e072,null))['then'](removeEntity(_0x30e072,null))[_0xf846('0x41')](handleError(_0x30e072,null));}; \ No newline at end of file +var _0xb40e=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ZendeskField','rawAttributes','type','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','intersection','length','includeAll','include','create','body','find','eml-format','zip-dir','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x427cde,_0x125958){var _0x5c0392=function(_0x1a3c9a){while(--_0x1a3c9a){_0x427cde['push'](_0x427cde['shift']());}};_0x5c0392(++_0x125958);}(_0xb40e,0x120));var _0xeb40=function(_0x36b037,_0x2b234e){_0x36b037=_0x36b037-0x0;var _0x409194=_0xb40e[_0x36b037];return _0x409194;};'use strict';var emlformat=require(_0xeb40('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeb40('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeb40('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xeb40('0x3'));var util=require(_0xeb40('0x4'));var path=require('path');var sox=require(_0xeb40('0x5'));var csv=require(_0xeb40('0x6'));var ejs=require(_0xeb40('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb40('0x8'));var squel=require(_0xeb40('0x9'));var crypto=require(_0xeb40('0xa'));var jsforce=require(_0xeb40('0xb'));var deskjs=require(_0xeb40('0xc'));var toCsv=require(_0xeb40('0x6'));var querystring=require(_0xeb40('0xd'));var Papa=require(_0xeb40('0xe'));var Redis=require(_0xeb40('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeb40('0x10'));var hardwareService=require(_0xeb40('0x11'));var logger=require(_0xeb40('0x12'))(_0xeb40('0x13'));var utils=require(_0xeb40('0x14'));var config=require(_0xeb40('0x15'));var licenseUtil=require(_0xeb40('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x222e09,_0x21171c){_0x21171c=_0x21171c||0xcc;return function(_0x127b76){if(_0x127b76){return _0x222e09[_0xeb40('0x17')](_0x21171c);}return _0x222e09[_0xeb40('0x18')](_0x21171c)[_0xeb40('0x19')]();};}function respondWithResult(_0xccbff3,_0x5139e2){_0x5139e2=_0x5139e2||0xc8;return function(_0x1926fa){if(_0x1926fa){return _0xccbff3[_0xeb40('0x18')](_0x5139e2)[_0xeb40('0x1a')](_0x1926fa);}};}function respondWithFilteredResult(_0x17f2e6,_0x4e3e0c){return function(_0x50e791){if(_0x50e791){var _0xc0a619=typeof _0x4e3e0c[_0xeb40('0x1b')]===_0xeb40('0x1c')&&typeof _0x4e3e0c['limit']===_0xeb40('0x1c');var _0x334ba7=_0x50e791[_0xeb40('0x1d')];var _0x4a9e36=_0xc0a619?0x0:_0x4e3e0c['offset'];var _0x4f20a0=_0xc0a619?_0x50e791[_0xeb40('0x1d')]:_0x4e3e0c[_0xeb40('0x1b')]+_0x4e3e0c[_0xeb40('0x1e')];var _0x5d2a28;if(_0x4f20a0>=_0x334ba7){_0x4f20a0=_0x334ba7;_0x5d2a28=0xc8;}else{_0x5d2a28=0xce;}_0x17f2e6[_0xeb40('0x18')](_0x5d2a28);return _0x17f2e6[_0xeb40('0x1f')](_0xeb40('0x20'),_0x4a9e36+'-'+_0x4f20a0+'/'+_0x334ba7)[_0xeb40('0x1a')](_0x50e791);}return null;};}function patchUpdates(_0x1f55fc){return function(_0x261a2e){try{jsonpatch[_0xeb40('0x21')](_0x261a2e,_0x1f55fc,!![]);}catch(_0x32d77e){return BPromise[_0xeb40('0x22')](_0x32d77e);}return _0x261a2e[_0xeb40('0x23')]();};}function saveUpdates(_0x50c497,_0x40c37a){return function(_0x2c104b){if(_0x2c104b){return _0x2c104b[_0xeb40('0x24')](_0x50c497)[_0xeb40('0x25')](function(_0x2ab11e){return _0x2ab11e;});}return null;};}function removeEntity(_0x4ca6d6,_0x477bb6){return function(_0x187329){if(_0x187329){return _0x187329[_0xeb40('0x26')]()[_0xeb40('0x25')](function(){_0x4ca6d6[_0xeb40('0x18')](0xcc)[_0xeb40('0x19')]();});}};}function handleEntityNotFound(_0x38aa92,_0x562d5b){return function(_0x122ec4){if(!_0x122ec4){_0x38aa92[_0xeb40('0x17')](0x194);}return _0x122ec4;};}function handleError(_0x2d6f78,_0x122a27){_0x122a27=_0x122a27||0x1f4;return function(_0x52b688){logger[_0xeb40('0x27')](_0x52b688[_0xeb40('0x28')]);if(_0x52b688['name']){delete _0x52b688[_0xeb40('0x29')];}_0x2d6f78['status'](_0x122a27)[_0xeb40('0x2a')](_0x52b688);};}exports[_0xeb40('0x2b')]=function(_0x33a21e,_0x24126e){var _0x4115d6={},_0x4154b1={},_0x7f7ee3={'count':0x0,'rows':[]};var _0x285f90=_['map'](db[_0xeb40('0x2c')][_0xeb40('0x2d')],function(_0x204b0a){return{'name':_0x204b0a['fieldName'],'type':_0x204b0a[_0xeb40('0x2e')][_0xeb40('0x2f')]};});_0x4154b1[_0xeb40('0x30')]=_[_0xeb40('0x31')](_0x285f90,_0xeb40('0x29'));_0x4154b1[_0xeb40('0x32')]=_[_0xeb40('0x33')](_0x33a21e['query']);_0x4154b1[_0xeb40('0x34')]=_['intersection'](_0x4154b1[_0xeb40('0x30')],_0x4154b1[_0xeb40('0x32')]);_0x4115d6[_0xeb40('0x35')]=_['intersection'](_0x4154b1[_0xeb40('0x30')],qs[_0xeb40('0x36')](_0x33a21e[_0xeb40('0x32')][_0xeb40('0x36')]));_0x4115d6[_0xeb40('0x35')]=_0x4115d6[_0xeb40('0x35')]['length']?_0x4115d6[_0xeb40('0x35')]:_0x4154b1['model'];if(!_0x33a21e['query'][_0xeb40('0x37')](_0xeb40('0x38'))){_0x4115d6[_0xeb40('0x1e')]=qs[_0xeb40('0x1e')](_0x33a21e[_0xeb40('0x32')]['limit']);_0x4115d6[_0xeb40('0x1b')]=qs[_0xeb40('0x1b')](_0x33a21e[_0xeb40('0x32')]['offset']);}_0x4115d6[_0xeb40('0x39')]=qs[_0xeb40('0x3a')](_0x33a21e['query'][_0xeb40('0x3a')]);_0x4115d6[_0xeb40('0x3b')]=qs[_0xeb40('0x34')](_[_0xeb40('0x3c')](_0x33a21e['query'],_0x4154b1[_0xeb40('0x34')]),_0x285f90);if(_0x33a21e[_0xeb40('0x32')][_0xeb40('0x3d')]){_0x4115d6['where']=_['merge'](_0x4115d6['where'],{'$or':_['map'](_0x285f90,function(_0x33f766){if(_0x33f766[_0xeb40('0x2e')]!=='VIRTUAL'){var _0x3a1a7c={};_0x3a1a7c[_0x33f766[_0xeb40('0x29')]]={'$like':'%'+_0x33a21e[_0xeb40('0x32')][_0xeb40('0x3d')]+'%'};return _0x3a1a7c;}})});}_0x4115d6=_[_0xeb40('0x3e')]({},_0x4115d6,_0x33a21e[_0xeb40('0x3f')]);var _0x5a6e71={'where':_0x4115d6['where']};return db[_0xeb40('0x2c')][_0xeb40('0x1d')](_0x5a6e71)['then'](function(_0x11df8b){_0x7f7ee3['count']=_0x11df8b;if(_0x33a21e[_0xeb40('0x32')]['includeAll']){_0x4115d6['include']=[{'all':!![]}];}return db[_0xeb40('0x2c')][_0xeb40('0x40')](_0x4115d6);})[_0xeb40('0x25')](function(_0x29b29b){_0x7f7ee3[_0xeb40('0x41')]=_0x29b29b;return _0x7f7ee3;})['then'](respondWithFilteredResult(_0x24126e,_0x4115d6))[_0xeb40('0x42')](handleError(_0x24126e,null));};exports[_0xeb40('0x43')]=function(_0x275646,_0x2afb04){var _0x7794a4={'raw':!![],'where':{'id':_0x275646[_0xeb40('0x44')]['id']}},_0x45858f={};_0x45858f[_0xeb40('0x30')]=_[_0xeb40('0x33')](db[_0xeb40('0x2c')]['rawAttributes']);_0x45858f[_0xeb40('0x32')]=_[_0xeb40('0x33')](_0x275646[_0xeb40('0x32')]);_0x45858f[_0xeb40('0x34')]=_[_0xeb40('0x45')](_0x45858f['model'],_0x45858f[_0xeb40('0x32')]);_0x7794a4[_0xeb40('0x35')]=_[_0xeb40('0x45')](_0x45858f[_0xeb40('0x30')],qs[_0xeb40('0x36')](_0x275646[_0xeb40('0x32')]['fields']));_0x7794a4[_0xeb40('0x35')]=_0x7794a4[_0xeb40('0x35')][_0xeb40('0x46')]?_0x7794a4[_0xeb40('0x35')]:_0x45858f[_0xeb40('0x30')];if(_0x275646['query'][_0xeb40('0x47')]){_0x7794a4[_0xeb40('0x48')]=[{'all':!![]}];}_0x7794a4=_['merge']({},_0x7794a4,_0x275646[_0xeb40('0x3f')]);return db[_0xeb40('0x2c')]['find'](_0x7794a4)[_0xeb40('0x25')](handleEntityNotFound(_0x2afb04,null))[_0xeb40('0x25')](respondWithResult(_0x2afb04,null))[_0xeb40('0x42')](handleError(_0x2afb04,null));};exports[_0xeb40('0x49')]=function(_0x1f544a,_0xd4eca2){return db['ZendeskField'][_0xeb40('0x49')](_0x1f544a[_0xeb40('0x4a')],{})['then'](respondWithResult(_0xd4eca2,0xc9))[_0xeb40('0x42')](handleError(_0xd4eca2,null));};exports[_0xeb40('0x24')]=function(_0x5430c1,_0x5914cd){if(_0x5430c1['body']['id']){delete _0x5430c1[_0xeb40('0x4a')]['id'];}return db[_0xeb40('0x2c')][_0xeb40('0x4b')]({'where':{'id':_0x5430c1[_0xeb40('0x44')]['id']}})[_0xeb40('0x25')](handleEntityNotFound(_0x5914cd,null))[_0xeb40('0x25')](saveUpdates(_0x5430c1[_0xeb40('0x4a')],null))[_0xeb40('0x25')](respondWithResult(_0x5914cd,null))[_0xeb40('0x42')](handleError(_0x5914cd,null));};exports[_0xeb40('0x26')]=function(_0x52b91e,_0x5b9a13){return db['ZendeskField'][_0xeb40('0x4b')]({'where':{'id':_0x52b91e['params']['id']}})[_0xeb40('0x25')](handleEntityNotFound(_0x5b9a13,null))[_0xeb40('0x25')](removeEntity(_0x5b9a13,null))['catch'](handleError(_0x5b9a13,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index ab8304c..c7ca151 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 _0x0bed=['./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5b1a3e,_0xb3967b){var _0x193aa2=function(_0x2d0ca6){while(--_0x2d0ca6){_0x5b1a3e['push'](_0x5b1a3e['shift']());}};_0x193aa2(++_0xb3967b);}(_0x0bed,0xb6));var _0xd0be=function(_0x100ad3,_0x1e560a){_0x100ad3=_0x100ad3-0x0;var _0x96040e=_0x0bed[_0x100ad3];return _0x96040e;};'use strict';var _=require(_0xd0be('0x0'));var util=require(_0xd0be('0x1'));var logger=require(_0xd0be('0x2'))(_0xd0be('0x3'));var moment=require(_0xd0be('0x4'));var BPromise=require(_0xd0be('0x5'));var rp=require(_0xd0be('0x6'));var fs=require('fs');var path=require(_0xd0be('0x7'));var rimraf=require(_0xd0be('0x8'));var config=require(_0xd0be('0x9'));var attributes=require(_0xd0be('0xa'));module['exports']=function(_0x4215a1,_0x36eb88){return _0x4215a1[_0xd0be('0xb')]('ZendeskField',attributes,{'tableName':_0xd0be('0xc'),'paranoid':![],'indexes':[{'name':_0xd0be('0xd'),'fields':[_0xd0be('0xe'),_0xd0be('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa8ef=['api','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x23e2bb,_0xd82b6d){var _0x2dd8ed=function(_0x4af0ce){while(--_0x4af0ce){_0x23e2bb['push'](_0x23e2bb['shift']());}};_0x2dd8ed(++_0xd82b6d);}(_0xa8ef,0x10b));var _0xfa8e=function(_0x404ae1,_0x412917){_0x404ae1=_0x404ae1-0x0;var _0x270694=_0xa8ef[_0x404ae1];return _0x270694;};'use strict';var _=require(_0xfa8e('0x0'));var util=require(_0xfa8e('0x1'));var logger=require(_0xfa8e('0x2'))(_0xfa8e('0x3'));var moment=require('moment');var BPromise=require(_0xfa8e('0x4'));var rp=require(_0xfa8e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa8e('0x6'));var config=require(_0xfa8e('0x7'));var attributes=require(_0xfa8e('0x8'));module[_0xfa8e('0x9')]=function(_0x5e7f5d,_0x582635){return _0x5e7f5d[_0xfa8e('0xa')](_0xfa8e('0xb'),attributes,{'tableName':_0xfa8e('0xc'),'paranoid':![],'indexes':[{'name':_0xfa8e('0xd'),'fields':['idField',_0xfa8e('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 0acf3bb..2822dc3 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 _0x74c3=['info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4327fe,_0x4f8040){var _0x138651=function(_0x418acc){while(--_0x418acc){_0x4327fe['push'](_0x4327fe['shift']());}};_0x138651(++_0x4f8040);}(_0x74c3,0x1bc));var _0x374c=function(_0x3a37f0,_0x2bb0d8){_0x3a37f0=_0x3a37f0-0x0;var _0x380e06=_0x74c3[_0x3a37f0];return _0x380e06;};'use strict';var _=require(_0x374c('0x0'));var util=require('util');var moment=require(_0x374c('0x1'));var BPromise=require(_0x374c('0x2'));var rs=require(_0x374c('0x3'));var fs=require('fs');var Redis=require(_0x374c('0x4'));var db=require(_0x374c('0x5'))['db'];var utils=require(_0x374c('0x6'));var logger=require(_0x374c('0x7'))(_0x374c('0x8'));var config=require('../../config/environment');var jayson=require(_0x374c('0x9'));var client=jayson[_0x374c('0xa')][_0x374c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b0fc7,_0x2b4a9d,_0x51dedc){return new BPromise(function(_0x45a68b,_0x2bda90){return client['request'](_0x4b0fc7,_0x51dedc)['then'](function(_0x124313){logger[_0x374c('0xc')](_0x374c('0xd'),_0x2b4a9d,_0x374c('0xe'));logger['debug'](_0x374c('0xf'),_0x2b4a9d,_0x374c('0xe'),JSON['stringify'](_0x124313));if(_0x124313[_0x374c('0x10')]){if(_0x124313['error']['code']===0x1f4){logger['error'](_0x374c('0xd'),_0x2b4a9d,_0x124313['error']['message']);return _0x2bda90(_0x124313[_0x374c('0x10')]['message']);}logger['error'](_0x374c('0xd'),_0x2b4a9d,_0x124313[_0x374c('0x10')][_0x374c('0x11')]);return _0x45a68b(_0x124313[_0x374c('0x10')][_0x374c('0x11')]);}else{logger[_0x374c('0xc')](_0x374c('0xd'),_0x2b4a9d,'request\x20sent');_0x45a68b(_0x124313['result'][_0x374c('0x11')]);}})[_0x374c('0x12')](function(_0x18b961){logger['error'](_0x374c('0xd'),_0x2b4a9d,_0x18b961);_0x2bda90(_0x18b961);});});} \ No newline at end of file +var _0xf373=['message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0xf373,0xbd));var _0x3f37=function(_0x4bbbb3,_0x454add){_0x4bbbb3=_0x4bbbb3-0x0;var _0x28bacb=_0xf373[_0x4bbbb3];return _0x28bacb;};'use strict';var _=require('lodash');var util=require(_0x3f37('0x0'));var moment=require(_0x3f37('0x1'));var BPromise=require(_0x3f37('0x2'));var rs=require(_0x3f37('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f37('0x4'))['db'];var utils=require(_0x3f37('0x5'));var logger=require('../../config/logger')(_0x3f37('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f37('0x7')][_0x3f37('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5998fc,_0x59b888,_0x1379f5){return new BPromise(function(_0xebc578,_0x23b1ea){return client[_0x3f37('0x9')](_0x5998fc,_0x1379f5)[_0x3f37('0xa')](function(_0x3e3bac){logger['info'](_0x3f37('0xb'),_0x59b888,_0x3f37('0xc'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x59b888,_0x3f37('0xc'),JSON[_0x3f37('0xd')](_0x3e3bac));if(_0x3e3bac[_0x3f37('0xe')]){if(_0x3e3bac[_0x3f37('0xe')]['code']===0x1f4){logger[_0x3f37('0xe')]('ZendeskField,\x20%s,\x20%s',_0x59b888,_0x3e3bac['error'][_0x3f37('0xf')]);return _0x23b1ea(_0x3e3bac[_0x3f37('0xe')]['message']);}logger[_0x3f37('0xe')](_0x3f37('0xb'),_0x59b888,_0x3e3bac[_0x3f37('0xe')]['message']);return _0xebc578(_0x3e3bac[_0x3f37('0xe')][_0x3f37('0xf')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x59b888,_0x3f37('0xc'));_0xebc578(_0x3e3bac['result']['message']);}})[_0x3f37('0x10')](function(_0x25f2eb){logger['error'](_0x3f37('0xb'),_0x59b888,_0x25f2eb);_0x23b1ea(_0x25f2eb);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index dd4d555..db4732c 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 _0x98b7=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','post','/:id/configurations','put','update','delete'];(function(_0x44c61e,_0xa02775){var _0x1dcf3f=function(_0x38e153){while(--_0x38e153){_0x44c61e['push'](_0x44c61e['shift']());}};_0x1dcf3f(++_0xa02775);}(_0x98b7,0x1a6));var _0x798b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x98b7[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x798b('0x0'));var util=require(_0x798b('0x1'));var path=require(_0x798b('0x2'));var timeout=require(_0x798b('0x3'));var express=require('express');var router=express[_0x798b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x798b('0x5'));var interaction=require(_0x798b('0x6'));var config=require(_0x798b('0x7'));var controller=require('./intZohoAccount.controller');router[_0x798b('0x8')]('/',auth[_0x798b('0x9')](),controller[_0x798b('0xa')]);router[_0x798b('0x8')](_0x798b('0xb'),auth[_0x798b('0x9')](),controller[_0x798b('0xc')]);router[_0x798b('0x8')]('/:id/configurations',auth[_0x798b('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x798b('0x9')](),controller[_0x798b('0xd')]);router[_0x798b('0xe')]('/',auth[_0x798b('0x9')](),controller['create']);router['post'](_0x798b('0xf'),auth[_0x798b('0x9')](),controller['addConfiguration']);router[_0x798b('0x10')]('/:id',auth[_0x798b('0x9')](),controller[_0x798b('0x11')]);router[_0x798b('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x798b('0x13')]);module[_0x798b('0x14')]=router; \ No newline at end of file +var _0x452e=['/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','index','get','/:id','isAuthenticated','show'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x452e,0x1bc));var _0xe452=function(_0x44945c,_0x581341){_0x44945c=_0x44945c-0x0;var _0x23b333=_0x452e[_0x44945c];return _0x23b333;};'use strict';var multer=require(_0xe452('0x0'));var util=require(_0xe452('0x1'));var path=require(_0xe452('0x2'));var timeout=require(_0xe452('0x3'));var express=require(_0xe452('0x4'));var router=express[_0xe452('0x5')]();var fs_extra=require(_0xe452('0x6'));var auth=require(_0xe452('0x7'));var interaction=require(_0xe452('0x8'));var config=require(_0xe452('0x9'));var controller=require(_0xe452('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xe452('0xb')]);router[_0xe452('0xc')](_0xe452('0xd'),auth[_0xe452('0xe')](),controller[_0xe452('0xf')]);router[_0xe452('0xc')](_0xe452('0x10'),auth['isAuthenticated'](),controller[_0xe452('0x11')]);router[_0xe452('0xc')]('/:id/fields',auth[_0xe452('0xe')](),controller[_0xe452('0x12')]);router[_0xe452('0x13')]('/',auth[_0xe452('0xe')](),controller[_0xe452('0x14')]);router[_0xe452('0x13')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xe452('0x15')]);router['put'](_0xe452('0xd'),auth[_0xe452('0xe')](),controller['update']);router['delete'](_0xe452('0xd'),auth[_0xe452('0xe')](),controller[_0xe452('0x16')]);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 b3f3b76..6e19e0a 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 _0x5ff3=['STRING','exports'];(function(_0x59e4fe,_0x416bba){var _0x4591da=function(_0x17c6d7){while(--_0x17c6d7){_0x59e4fe['push'](_0x59e4fe['shift']());}};_0x4591da(++_0x416bba);}(_0x5ff3,0x17d));var _0x35ff=function(_0xd0a872,_0x55e1be){_0xd0a872=_0xd0a872-0x0;var _0x5c28d6=_0x5ff3[_0xd0a872];return _0x5c28d6;};'use strict';var Sequelize=require('sequelize');module[_0x35ff('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x35ff('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x35ff('0x1')]},'clientId':{'type':Sequelize[_0x35ff('0x1')]},'clientSecret':{'type':Sequelize[_0x35ff('0x1')]},'serverUrl':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x35ff('0x1')]}}; \ No newline at end of file +var _0x0a9a=['STRING','exports'];(function(_0x2aa3cf,_0xa10585){var _0x2bb607=function(_0x532399){while(--_0x532399){_0x2aa3cf['push'](_0x2aa3cf['shift']());}};_0x2bb607(++_0xa10585);}(_0x0a9a,0x183));var _0xa0a9=function(_0x32bae7,_0x5ac6a2){_0x32bae7=_0x32bae7-0x0;var _0x15afe6=_0x0a9a[_0x32bae7];return _0x15afe6;};'use strict';var Sequelize=require('sequelize');module[_0xa0a9('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa0a9('0x1')]},'host':{'type':Sequelize[_0xa0a9('0x1')]},'zone':{'type':Sequelize[_0xa0a9('0x1')]},'clientId':{'type':Sequelize[_0xa0a9('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa0a9('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xa0a9('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 6f00ae2..a183c58 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 _0x87db=['moment','bluebird','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','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','ZohoAccount','then','includeAll','findAll','rows','catch','show','params','length','include','find','create','update','body','getConfigurations','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','includes','api_name','system_mandatory','display_label','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2d9535,_0x4bc592){var _0xb4e710=function(_0x50b9a9){while(--_0x50b9a9){_0x2d9535['push'](_0x2d9535['shift']());}};_0xb4e710(++_0x4bc592);}(_0x87db,0x1ef));var _0xb87d=function(_0x3ed672,_0x3c8e83){_0x3ed672=_0x3ed672-0x0;var _0x1d2b02=_0x87db[_0x3ed672];return _0x1d2b02;};'use strict';var emlformat=require(_0xb87d('0x0'));var rimraf=require(_0xb87d('0x1'));var zipdir=require(_0xb87d('0x2'));var jsonpatch=require(_0xb87d('0x3'));var rp=require(_0xb87d('0x4'));var moment=require(_0xb87d('0x5'));var BPromise=require(_0xb87d('0x6'));var Mustache=require('mustache');var util=require(_0xb87d('0x7'));var path=require('path');var sox=require(_0xb87d('0x8'));var csv=require(_0xb87d('0x9'));var ejs=require(_0xb87d('0xa'));var fs=require('fs');var fs_extra=require(_0xb87d('0xb'));var _=require(_0xb87d('0xc'));var squel=require(_0xb87d('0xd'));var crypto=require(_0xb87d('0xe'));var jsforce=require(_0xb87d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb87d('0x9'));var querystring=require(_0xb87d('0x10'));var Papa=require(_0xb87d('0x11'));var Redis=require(_0xb87d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb87d('0x13'));var as=require(_0xb87d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb87d('0x15'))(_0xb87d('0x16'));var utils=require(_0xb87d('0x17'));var config=require(_0xb87d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb87d('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x772c26,_0x255435){_0x255435=_0x255435||0xcc;return function(_0x5dbea9){if(_0x5dbea9){return _0x772c26['sendStatus'](_0x255435);}return _0x772c26['status'](_0x255435)[_0xb87d('0x1a')]();};}function respondWithResult(_0x25ac79,_0x4e93b5){_0x4e93b5=_0x4e93b5||0xc8;return function(_0x1928c0){if(_0x1928c0){return _0x25ac79[_0xb87d('0x1b')](_0x4e93b5)['json'](_0x1928c0);}};}function respondWithFilteredResult(_0x50877f,_0x2dd3e3){return function(_0x2455a4){if(_0x2455a4){var _0x30a52d=typeof _0x2dd3e3[_0xb87d('0x1c')]===_0xb87d('0x1d')&&typeof _0x2dd3e3[_0xb87d('0x1e')]==='undefined';var _0x1b4e40=_0x2455a4['count'];var _0x58368c=_0x30a52d?0x0:_0x2dd3e3[_0xb87d('0x1c')];var _0x539ec7=_0x30a52d?_0x2455a4[_0xb87d('0x1f')]:_0x2dd3e3[_0xb87d('0x1c')]+_0x2dd3e3[_0xb87d('0x1e')];var _0x50d41a;if(_0x539ec7>=_0x1b4e40){_0x539ec7=_0x1b4e40;_0x50d41a=0xc8;}else{_0x50d41a=0xce;}_0x50877f['status'](_0x50d41a);return _0x50877f[_0xb87d('0x20')](_0xb87d('0x21'),_0x58368c+'-'+_0x539ec7+'/'+_0x1b4e40)[_0xb87d('0x22')](_0x2455a4);}return null;};}function patchUpdates(_0x4b25c4){return function(_0x2bd6bb){try{jsonpatch['apply'](_0x2bd6bb,_0x4b25c4,!![]);}catch(_0x569314){return BPromise[_0xb87d('0x23')](_0x569314);}return _0x2bd6bb[_0xb87d('0x24')]();};}function saveUpdates(_0x5dbf2f,_0x2a2d39){return function(_0x2d34de){if(_0x2d34de){return _0x2d34de['update'](_0x5dbf2f)['then'](function(_0x153277){return _0x153277;});}return null;};}function removeEntity(_0x225b89,_0x3e99bb){return function(_0x1c4364){if(_0x1c4364){return _0x1c4364['destroy']()['then'](function(){_0x225b89[_0xb87d('0x1b')](0xcc)[_0xb87d('0x1a')]();});}};}function handleEntityNotFound(_0x5d5032,_0x5afa50){return function(_0x23baa5){if(!_0x23baa5){_0x5d5032['sendStatus'](0x194);}return _0x23baa5;};}function handleError(_0x19ed9f,_0xc87988){_0xc87988=_0xc87988||0x1f4;return function(_0x4f67a1){logger[_0xb87d('0x25')](_0x4f67a1[_0xb87d('0x26')]);if(_0x4f67a1[_0xb87d('0x27')]){delete _0x4f67a1[_0xb87d('0x27')];}_0x19ed9f[_0xb87d('0x1b')](_0xc87988)[_0xb87d('0x28')](_0x4f67a1);};}exports[_0xb87d('0x29')]=function(_0x8e6b43,_0x5456b4){var _0x4b2fa1={},_0x30e26e={},_0x51acf8={'count':0x0,'rows':[]};var _0x4e4e9a=_[_0xb87d('0x2a')](db['ZohoAccount'][_0xb87d('0x2b')],function(_0x4776e6){return{'name':_0x4776e6['fieldName'],'type':_0x4776e6[_0xb87d('0x2c')][_0xb87d('0x2d')]};});_0x30e26e[_0xb87d('0x2e')]=_[_0xb87d('0x2a')](_0x4e4e9a,_0xb87d('0x27'));_0x30e26e[_0xb87d('0x2f')]=_[_0xb87d('0x30')](_0x8e6b43[_0xb87d('0x2f')]);_0x30e26e[_0xb87d('0x31')]=_[_0xb87d('0x32')](_0x30e26e[_0xb87d('0x2e')],_0x30e26e[_0xb87d('0x2f')]);_0x4b2fa1[_0xb87d('0x33')]=_[_0xb87d('0x32')](_0x30e26e['model'],qs[_0xb87d('0x34')](_0x8e6b43[_0xb87d('0x2f')]['fields']));_0x4b2fa1[_0xb87d('0x33')]=_0x4b2fa1[_0xb87d('0x33')]['length']?_0x4b2fa1['attributes']:_0x30e26e[_0xb87d('0x2e')];if(!_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x35')]('nolimit')){_0x4b2fa1['limit']=qs[_0xb87d('0x1e')](_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x1e')]);_0x4b2fa1[_0xb87d('0x1c')]=qs[_0xb87d('0x1c')](_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x1c')]);}_0x4b2fa1['order']=qs['sort'](_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x36')]);_0x4b2fa1['where']=qs[_0xb87d('0x31')](_['pick'](_0x8e6b43[_0xb87d('0x2f')],_0x30e26e[_0xb87d('0x31')]),_0x4e4e9a);if(_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x37')]){_0x4b2fa1[_0xb87d('0x38')]=_[_0xb87d('0x39')](_0x4b2fa1[_0xb87d('0x38')],{'$or':_['map'](_0x4e4e9a,function(_0x7c698){if(_0x7c698[_0xb87d('0x2c')]!==_0xb87d('0x3a')){var _0x24a222={};_0x24a222[_0x7c698[_0xb87d('0x27')]]={'$like':'%'+_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x37')]+'%'};return _0x24a222;}})});}_0x4b2fa1=_[_0xb87d('0x39')]({},_0x4b2fa1,_0x8e6b43[_0xb87d('0x3b')]);var _0xbd8389={'where':_0x4b2fa1[_0xb87d('0x38')]};return db[_0xb87d('0x3c')][_0xb87d('0x1f')](_0xbd8389)[_0xb87d('0x3d')](function(_0x43136c){_0x51acf8[_0xb87d('0x1f')]=_0x43136c;if(_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x3e')]){_0x4b2fa1['include']=[{'all':!![]}];}return db[_0xb87d('0x3c')][_0xb87d('0x3f')](_0x4b2fa1);})[_0xb87d('0x3d')](function(_0x35a160){_0x51acf8[_0xb87d('0x40')]=_0x35a160;return _0x51acf8;})[_0xb87d('0x3d')](respondWithFilteredResult(_0x5456b4,_0x4b2fa1))[_0xb87d('0x41')](handleError(_0x5456b4,null));};exports[_0xb87d('0x42')]=function(_0x36971e,_0x47b51d){var _0x3d4ec0={'raw':![],'where':{'id':_0x36971e[_0xb87d('0x43')]['id']}},_0x488195={};_0x488195['model']=_[_0xb87d('0x30')](db['ZohoAccount'][_0xb87d('0x2b')]);_0x488195[_0xb87d('0x2f')]=_[_0xb87d('0x30')](_0x36971e[_0xb87d('0x2f')]);_0x488195['filters']=_[_0xb87d('0x32')](_0x488195[_0xb87d('0x2e')],_0x488195[_0xb87d('0x2f')]);_0x3d4ec0[_0xb87d('0x33')]=_['intersection'](_0x488195[_0xb87d('0x2e')],qs[_0xb87d('0x34')](_0x36971e['query'][_0xb87d('0x34')]));_0x3d4ec0[_0xb87d('0x33')]=_0x3d4ec0[_0xb87d('0x33')][_0xb87d('0x44')]?_0x3d4ec0[_0xb87d('0x33')]:_0x488195[_0xb87d('0x2e')];if(_0x36971e[_0xb87d('0x2f')][_0xb87d('0x3e')]){_0x3d4ec0[_0xb87d('0x45')]=[{'all':!![]}];}_0x3d4ec0=_[_0xb87d('0x39')]({},_0x3d4ec0,_0x36971e['options']);return db[_0xb87d('0x3c')][_0xb87d('0x46')](_0x3d4ec0)['then'](handleEntityNotFound(_0x47b51d,null))['then'](respondWithResult(_0x47b51d,null))[_0xb87d('0x41')](handleError(_0x47b51d,null));};exports['create']=function(_0x3ac28d,_0x6cd580){return db['ZohoAccount'][_0xb87d('0x47')](_0x3ac28d['body'],{})[_0xb87d('0x3d')](respondWithResult(_0x6cd580,0xc9))[_0xb87d('0x41')](handleError(_0x6cd580,null));};exports[_0xb87d('0x48')]=function(_0x2382e8,_0x421041){if(_0x2382e8[_0xb87d('0x49')]['id']){delete _0x2382e8[_0xb87d('0x49')]['id'];}return db['ZohoAccount'][_0xb87d('0x46')]({'where':{'id':_0x2382e8[_0xb87d('0x43')]['id']}})['then'](handleEntityNotFound(_0x421041,null))[_0xb87d('0x3d')](saveUpdates(_0x2382e8[_0xb87d('0x49')],null))['then'](respondWithResult(_0x421041,null))[_0xb87d('0x41')](handleError(_0x421041,null));};exports['destroy']=function(_0x13cb79,_0x5bd72b){return db[_0xb87d('0x3c')]['find']({'where':{'id':_0x13cb79[_0xb87d('0x43')]['id']}})['then'](handleEntityNotFound(_0x5bd72b,null))[_0xb87d('0x3d')](removeEntity(_0x5bd72b,null))[_0xb87d('0x41')](handleError(_0x5bd72b,null));};exports[_0xb87d('0x4a')]=function(_0x2cae57,_0x5a7933,_0x5921f3){var _0x59ff51={};var _0x40d729={};var _0x2c3145;var _0x2f52b7;return db[_0xb87d('0x3c')][_0xb87d('0x4b')]({'where':{'id':_0x2cae57['params']['id']}})[_0xb87d('0x3d')](handleEntityNotFound(_0x5a7933,null))['then'](function(_0x1473d4){if(_0x1473d4){_0x2c3145=_0x1473d4;_0x40d729['model']=_[_0xb87d('0x30')](db['ZohoConfiguration'][_0xb87d('0x2b')]);_0x40d729[_0xb87d('0x2f')]=_[_0xb87d('0x30')](_0x2cae57[_0xb87d('0x2f')]);_0x40d729[_0xb87d('0x31')]=_[_0xb87d('0x32')](_0x40d729['model'],_0x40d729[_0xb87d('0x2f')]);_0x59ff51['attributes']=_[_0xb87d('0x32')](_0x40d729[_0xb87d('0x2e')],qs[_0xb87d('0x34')](_0x2cae57[_0xb87d('0x2f')][_0xb87d('0x34')]));_0x59ff51[_0xb87d('0x33')]=_0x59ff51['attributes'][_0xb87d('0x44')]?_0x59ff51['attributes']:_0x40d729[_0xb87d('0x2e')];_0x59ff51['order']=qs[_0xb87d('0x36')](_0x2cae57[_0xb87d('0x2f')][_0xb87d('0x36')]);_0x59ff51[_0xb87d('0x38')]=qs['filters'](_['pick'](_0x2cae57['query'],_0x40d729[_0xb87d('0x31')]));if(_0x2cae57[_0xb87d('0x2f')]['filter']){_0x59ff51[_0xb87d('0x38')]=_[_0xb87d('0x39')](_0x59ff51[_0xb87d('0x38')],{'$or':_[_0xb87d('0x2a')](_0x59ff51['attributes'],function(_0x329a72){var _0x1eff41={};_0x1eff41[_0x329a72]={'$like':'%'+_0x2cae57['query'][_0xb87d('0x37')]+'%'};return _0x1eff41;})});}_0x59ff51=_[_0xb87d('0x39')]({},_0x59ff51,_0x2cae57[_0xb87d('0x3b')]);return _0x2c3145[_0xb87d('0x4a')](_0x59ff51);}})['then'](function(_0x1b21c4){if(_0x1b21c4){_0x2f52b7=_0x1b21c4[_0xb87d('0x44')];if(!_0x2cae57[_0xb87d('0x2f')][_0xb87d('0x35')]('nolimit')){_0x59ff51[_0xb87d('0x1e')]=qs[_0xb87d('0x1e')](_0x2cae57[_0xb87d('0x2f')]['limit']);_0x59ff51[_0xb87d('0x1c')]=qs['offset'](_0x2cae57['query'][_0xb87d('0x1c')]);}return _0x2c3145[_0xb87d('0x4a')](_0x59ff51);}})[_0xb87d('0x3d')](function(_0x1117b8){if(_0x1117b8){return _0x1117b8?{'count':_0x2f52b7,'rows':_0x1117b8}:null;}})['then'](respondWithResult(_0x5a7933,null))['catch'](handleError(_0x5a7933,null));};exports['addConfiguration']=function(_0x4a5895,_0x1fa03,_0x59f352){if(_0x4a5895[_0xb87d('0x49')]['id']){delete _0x4a5895['body']['id'];}return db[_0xb87d('0x3c')][_0xb87d('0x4b')]({'where':{'id':_0x4a5895[_0xb87d('0x43')]['id']}})['then'](handleEntityNotFound(_0x1fa03,null))['then'](function(_0x1f6b1a){if(_0x1f6b1a){_0x4a5895[_0xb87d('0x49')][_0xb87d('0x4c')]=_0x1f6b1a['id'];_0x4a5895[_0xb87d('0x49')][_0xb87d('0x4d')]=integrations[_0xb87d('0x4e')](_0x4a5895[_0xb87d('0x49')]['channel'],_0x4a5895['body'][_0xb87d('0x2c')]);_0x4a5895[_0xb87d('0x49')][_0xb87d('0x4f')]=integrations[_0xb87d('0x50')](_0x4a5895[_0xb87d('0x49')]['channel'],_0x4a5895[_0xb87d('0x49')][_0xb87d('0x2c')]);return db['ZohoConfiguration'][_0xb87d('0x47')](_0x4a5895[_0xb87d('0x49')],{'include':[{'model':db[_0xb87d('0x51')],'as':_0xb87d('0x4d')},{'model':db['ZohoField'],'as':_0xb87d('0x4f')}]});}return null;})[_0xb87d('0x3d')](respondWithResult(_0x1fa03,null))[_0xb87d('0x41')](handleError(_0x1fa03,null));};function getAccessToken(_0x56090a){return new Promise(function(_0x22569b,_0x4e99b6){var _0x398149;switch(_0x56090a[_0xb87d('0x52')]){case'US':_0x398149=_0xb87d('0x53');break;case'AU':_0x398149=_0xb87d('0x54');break;case'EU':_0x398149=_0xb87d('0x55');break;case'IN':_0x398149=_0xb87d('0x56');break;case'CN':_0x398149=_0xb87d('0x57');break;default:_0x398149='https://accounts.zoho.eu';break;}var _0x3abdad={'method':_0xb87d('0x58'),'uri':_0x398149+_0xb87d('0x59'),'qs':{'refresh_token':_0x56090a[_0xb87d('0x5a')],'client_id':_0x56090a[_0xb87d('0x5b')],'client_secret':_0x56090a[_0xb87d('0x5c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3abdad)[_0xb87d('0x3d')](function(_0x31daf8){if(_0x31daf8[_0xb87d('0x5d')]){_0x22569b(_0x31daf8['access_token']);}else{_0x4e99b6(_0xb87d('0x5e'));}})[_0xb87d('0x41')](function(_0x4f74e1){_0x4e99b6(_0x4f74e1);});});}exports[_0xb87d('0x5f')]=function(_0x4fb807,_0x1e753f,_0x22979c){var _0x5eb50e,_0x32f31e,_0x476e5e,_0x12a164,_0x5c9702;return db[_0xb87d('0x3c')]['findOne']({'where':{'id':_0x4fb807['params']['id']},'attributes':['id',_0xb87d('0x60'),_0xb87d('0x52'),_0xb87d('0x5b'),_0xb87d('0x5c'),_0xb87d('0x61'),'code',_0xb87d('0x5a')]})['then'](handleEntityNotFound(_0x1e753f,null))[_0xb87d('0x3d')](function(_0x2080b4){_0x5c9702=_0x2080b4;_0x5eb50e=_0x5c9702[_0xb87d('0x60')];_0x32f31e=_0x5eb50e===_0xb87d('0x62')?'eu':_0xb87d('0x63');_0x476e5e=_0x5c9702['serverUrl'];var _0x1e422a=_0x476e5e[_0xb87d('0x64')](-0x1);if(_0x1e422a==='/'||_0x1e422a==='\x5c'||_0x1e422a===':'){_0x476e5e=_0x476e5e[_0xb87d('0x65')](0x0,_0x476e5e[_0xb87d('0x66')](_0x1e422a));}if(!_0x5c9702['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x5c9702);})[_0xb87d('0x3d')](function(_0x5409bb){if(_0x5409bb){return rp({'method':_0xb87d('0x67'),'uri':util['format'](_0xb87d('0x68'),_0x32f31e),'qs':{'module':_0xb87d('0x69')},'headers':{'Authorization':_0xb87d('0x6a')+_0x5409bb},'json':!![]});}})['then'](function(_0x33d12c){if(_0x33d12c){if(_0x33d12c[_0xb87d('0x6b')]&&_0x33d12c[_0xb87d('0x6b')][_0xb87d('0x25')]){throw new Error(_0x33d12c['response']['error'][_0xb87d('0x6c')]);}var _0x10a42e=[];var _0x56283e=[];var _0x395d59=[_0xb87d('0x6d'),_0xb87d('0x6e'),_0xb87d('0x6f'),_0xb87d('0x70'),_0xb87d('0x71'),_0xb87d('0x72'),_0xb87d('0x73'),'Call_Type'];_0x56283e=_['remove'](_0x33d12c[_0xb87d('0x34')],function(_0x30a648){return _0x395d59[_0xb87d('0x74')](_0x30a648[_0xb87d('0x75')]);});for(var _0x584c74=0x0;_0x584c74<_0x56283e[_0xb87d('0x44')];_0x584c74++){if(_0x56283e[_0x584c74][_0xb87d('0x76')]===![]){_0x10a42e['push']({'id':_0x56283e[_0x584c74]['id'],'name':_0x56283e[_0x584c74][_0xb87d('0x77')],'custom':_0x56283e[_0x584c74]['custom_field'],'options':_0x56283e[_0x584c74]['data_type']==='picklist'&&_0x56283e[_0x584c74]['pick_list_values'][_0xb87d('0x44')]>-0x1?_[_0xb87d('0x2a')](_0x56283e[_0x584c74][_0xb87d('0x78')],function(_0x2c8d02){return{'name':_0x2c8d02,'value':_0x2c8d02};}):[]});}}return{'count':_0x10a42e[_0xb87d('0x44')],'rows':_0x10a42e};}else{return{'count':0x0,'rows':[]};}})[_0xb87d('0x3d')](respondWithResult(_0x1e753f,null))[_0xb87d('0x41')](function(_0x347a64){var _0x521e8f=_0x4fb807[_0xb87d('0x2f')][_0xb87d('0x79')]?0x1f4:_0x347a64[_0xb87d('0x7a')]||0x1f4;logger['error'](_0xb87d('0x7b'),_0xb87d('0x5f'),_0x521e8f,JSON[_0xb87d('0x7c')](_0x347a64));delete _0x347a64[_0xb87d('0x27')];if(_0x521e8f===0x191){_0x521e8f=0x190;}_0x1e753f['status'](_0x521e8f)[_0xb87d('0x28')](_0x4fb807['query'][_0xb87d('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x347a64[_0xb87d('0x7a')]}:_0x347a64);});}; \ No newline at end of file +var _0x0326=['undefined','limit','count','set','Content-Range','json','reject','save','update','then','error','name','send','index','map','ZohoAccount','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','findAll','rows','params','rawAttributes','find','catch','create','body','destroy','getConfigurations','findOne','order','nolimit','Subjects','type','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','serverUrl','code','host','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x0326,0xe1));var _0x6032=function(_0x1f1c17,_0x4ed89e){_0x1f1c17=_0x1f1c17-0x0;var _0x59109b=_0x0326[_0x1f1c17];return _0x59109b;};'use strict';var emlformat=require(_0x6032('0x0'));var rimraf=require(_0x6032('0x1'));var zipdir=require(_0x6032('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6032('0x3'));var moment=require(_0x6032('0x4'));var BPromise=require(_0x6032('0x5'));var Mustache=require(_0x6032('0x6'));var util=require(_0x6032('0x7'));var path=require(_0x6032('0x8'));var sox=require(_0x6032('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6032('0xa'));var _=require('lodash');var squel=require(_0x6032('0xb'));var crypto=require(_0x6032('0xc'));var jsforce=require(_0x6032('0xd'));var deskjs=require(_0x6032('0xe'));var toCsv=require(_0x6032('0xf'));var querystring=require(_0x6032('0x10'));var Papa=require(_0x6032('0x11'));var Redis=require(_0x6032('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6032('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6032('0x14'));var logger=require(_0x6032('0x15'))(_0x6032('0x16'));var utils=require(_0x6032('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6032('0x18'));var db=require(_0x6032('0x19'))['db'];var integrations=require(_0x6032('0x1a'));function respondWithStatusCode(_0x366b6d,_0x217de0){_0x217de0=_0x217de0||0xcc;return function(_0x556a48){if(_0x556a48){return _0x366b6d[_0x6032('0x1b')](_0x217de0);}return _0x366b6d[_0x6032('0x1c')](_0x217de0)[_0x6032('0x1d')]();};}function respondWithResult(_0x51e00c,_0x402427){_0x402427=_0x402427||0xc8;return function(_0x344024){if(_0x344024){return _0x51e00c[_0x6032('0x1c')](_0x402427)['json'](_0x344024);}};}function respondWithFilteredResult(_0x4d2145,_0x579066){return function(_0x4609ab){if(_0x4609ab){var _0x361e3c=typeof _0x579066[_0x6032('0x1e')]===_0x6032('0x1f')&&typeof _0x579066[_0x6032('0x20')]==='undefined';var _0x2b6c57=_0x4609ab[_0x6032('0x21')];var _0xa4f4d6=_0x361e3c?0x0:_0x579066[_0x6032('0x1e')];var _0x43a0ac=_0x361e3c?_0x4609ab[_0x6032('0x21')]:_0x579066[_0x6032('0x1e')]+_0x579066['limit'];var _0x880a6f;if(_0x43a0ac>=_0x2b6c57){_0x43a0ac=_0x2b6c57;_0x880a6f=0xc8;}else{_0x880a6f=0xce;}_0x4d2145[_0x6032('0x1c')](_0x880a6f);return _0x4d2145[_0x6032('0x22')](_0x6032('0x23'),_0xa4f4d6+'-'+_0x43a0ac+'/'+_0x2b6c57)[_0x6032('0x24')](_0x4609ab);}return null;};}function patchUpdates(_0x10e589){return function(_0x5bf370){try{jsonpatch['apply'](_0x5bf370,_0x10e589,!![]);}catch(_0x1018b6){return BPromise[_0x6032('0x25')](_0x1018b6);}return _0x5bf370[_0x6032('0x26')]();};}function saveUpdates(_0x2f9f64,_0xa67daa){return function(_0x4b2591){if(_0x4b2591){return _0x4b2591[_0x6032('0x27')](_0x2f9f64)[_0x6032('0x28')](function(_0x3e0993){return _0x3e0993;});}return null;};}function removeEntity(_0x55c33d,_0x57630e){return function(_0x403421){if(_0x403421){return _0x403421['destroy']()[_0x6032('0x28')](function(){_0x55c33d[_0x6032('0x1c')](0xcc)[_0x6032('0x1d')]();});}};}function handleEntityNotFound(_0x5b4de1,_0x593f80){return function(_0x26d357){if(!_0x26d357){_0x5b4de1[_0x6032('0x1b')](0x194);}return _0x26d357;};}function handleError(_0x468f02,_0x1aa872){_0x1aa872=_0x1aa872||0x1f4;return function(_0x4ed1e1){logger[_0x6032('0x29')](_0x4ed1e1['stack']);if(_0x4ed1e1[_0x6032('0x2a')]){delete _0x4ed1e1['name'];}_0x468f02[_0x6032('0x1c')](_0x1aa872)[_0x6032('0x2b')](_0x4ed1e1);};}exports[_0x6032('0x2c')]=function(_0x304887,_0x59e3c9){var _0x1fac8b={},_0x32bdb6={},_0x2a390e={'count':0x0,'rows':[]};var _0x14ba68=_[_0x6032('0x2d')](db[_0x6032('0x2e')]['rawAttributes'],function(_0x4ae3da){return{'name':_0x4ae3da[_0x6032('0x2f')],'type':_0x4ae3da['type']['key']};});_0x32bdb6[_0x6032('0x30')]=_['map'](_0x14ba68,'name');_0x32bdb6[_0x6032('0x31')]=_[_0x6032('0x32')](_0x304887[_0x6032('0x31')]);_0x32bdb6[_0x6032('0x33')]=_['intersection'](_0x32bdb6['model'],_0x32bdb6[_0x6032('0x31')]);_0x1fac8b[_0x6032('0x34')]=_[_0x6032('0x35')](_0x32bdb6[_0x6032('0x30')],qs[_0x6032('0x36')](_0x304887[_0x6032('0x31')][_0x6032('0x36')]));_0x1fac8b['attributes']=_0x1fac8b[_0x6032('0x34')][_0x6032('0x37')]?_0x1fac8b['attributes']:_0x32bdb6[_0x6032('0x30')];if(!_0x304887[_0x6032('0x31')][_0x6032('0x38')]('nolimit')){_0x1fac8b['limit']=qs[_0x6032('0x20')](_0x304887[_0x6032('0x31')][_0x6032('0x20')]);_0x1fac8b[_0x6032('0x1e')]=qs[_0x6032('0x1e')](_0x304887[_0x6032('0x31')]['offset']);}_0x1fac8b['order']=qs[_0x6032('0x39')](_0x304887[_0x6032('0x31')][_0x6032('0x39')]);_0x1fac8b[_0x6032('0x3a')]=qs[_0x6032('0x33')](_[_0x6032('0x3b')](_0x304887['query'],_0x32bdb6[_0x6032('0x33')]),_0x14ba68);if(_0x304887['query'][_0x6032('0x3c')]){_0x1fac8b['where']=_[_0x6032('0x3d')](_0x1fac8b['where'],{'$or':_[_0x6032('0x2d')](_0x14ba68,function(_0x4128e6){if(_0x4128e6['type']!=='VIRTUAL'){var _0x5e1fd9={};_0x5e1fd9[_0x4128e6['name']]={'$like':'%'+_0x304887[_0x6032('0x31')][_0x6032('0x3c')]+'%'};return _0x5e1fd9;}})});}_0x1fac8b=_[_0x6032('0x3d')]({},_0x1fac8b,_0x304887[_0x6032('0x3e')]);var _0x3c1b09={'where':_0x1fac8b[_0x6032('0x3a')]};return db['ZohoAccount'][_0x6032('0x21')](_0x3c1b09)[_0x6032('0x28')](function(_0x9a4dd2){_0x2a390e['count']=_0x9a4dd2;if(_0x304887['query'][_0x6032('0x3f')]){_0x1fac8b['include']=[{'all':!![]}];}return db['ZohoAccount'][_0x6032('0x40')](_0x1fac8b);})[_0x6032('0x28')](function(_0x4f15a3){_0x2a390e[_0x6032('0x41')]=_0x4f15a3;return _0x2a390e;})[_0x6032('0x28')](respondWithFilteredResult(_0x59e3c9,_0x1fac8b))['catch'](handleError(_0x59e3c9,null));};exports['show']=function(_0x540f7c,_0x9d1917){var _0x512509={'raw':![],'where':{'id':_0x540f7c[_0x6032('0x42')]['id']}},_0x47a45d={};_0x47a45d[_0x6032('0x30')]=_[_0x6032('0x32')](db[_0x6032('0x2e')][_0x6032('0x43')]);_0x47a45d['query']=_['keys'](_0x540f7c[_0x6032('0x31')]);_0x47a45d[_0x6032('0x33')]=_[_0x6032('0x35')](_0x47a45d[_0x6032('0x30')],_0x47a45d[_0x6032('0x31')]);_0x512509['attributes']=_[_0x6032('0x35')](_0x47a45d[_0x6032('0x30')],qs['fields'](_0x540f7c[_0x6032('0x31')]['fields']));_0x512509['attributes']=_0x512509[_0x6032('0x34')][_0x6032('0x37')]?_0x512509['attributes']:_0x47a45d['model'];if(_0x540f7c[_0x6032('0x31')][_0x6032('0x3f')]){_0x512509['include']=[{'all':!![]}];}_0x512509=_['merge']({},_0x512509,_0x540f7c['options']);return db[_0x6032('0x2e')][_0x6032('0x44')](_0x512509)[_0x6032('0x28')](handleEntityNotFound(_0x9d1917,null))[_0x6032('0x28')](respondWithResult(_0x9d1917,null))[_0x6032('0x45')](handleError(_0x9d1917,null));};exports['create']=function(_0x3a79cb,_0x193c23){return db[_0x6032('0x2e')][_0x6032('0x46')](_0x3a79cb[_0x6032('0x47')],{})['then'](respondWithResult(_0x193c23,0xc9))[_0x6032('0x45')](handleError(_0x193c23,null));};exports['update']=function(_0x2803fe,_0x420815){if(_0x2803fe[_0x6032('0x47')]['id']){delete _0x2803fe[_0x6032('0x47')]['id'];}return db[_0x6032('0x2e')]['find']({'where':{'id':_0x2803fe[_0x6032('0x42')]['id']}})[_0x6032('0x28')](handleEntityNotFound(_0x420815,null))[_0x6032('0x28')](saveUpdates(_0x2803fe[_0x6032('0x47')],null))[_0x6032('0x28')](respondWithResult(_0x420815,null))['catch'](handleError(_0x420815,null));};exports[_0x6032('0x48')]=function(_0x2b581e,_0x49c589){return db[_0x6032('0x2e')][_0x6032('0x44')]({'where':{'id':_0x2b581e[_0x6032('0x42')]['id']}})[_0x6032('0x28')](handleEntityNotFound(_0x49c589,null))['then'](removeEntity(_0x49c589,null))[_0x6032('0x45')](handleError(_0x49c589,null));};exports[_0x6032('0x49')]=function(_0x536be6,_0x3f9017,_0x8b584e){var _0x36842d={};var _0x103a9c={};var _0x420791;var _0x52d72e;return db[_0x6032('0x2e')][_0x6032('0x4a')]({'where':{'id':_0x536be6[_0x6032('0x42')]['id']}})[_0x6032('0x28')](handleEntityNotFound(_0x3f9017,null))[_0x6032('0x28')](function(_0x188dd0){if(_0x188dd0){_0x420791=_0x188dd0;_0x103a9c[_0x6032('0x30')]=_[_0x6032('0x32')](db['ZohoConfiguration'][_0x6032('0x43')]);_0x103a9c[_0x6032('0x31')]=_[_0x6032('0x32')](_0x536be6[_0x6032('0x31')]);_0x103a9c['filters']=_[_0x6032('0x35')](_0x103a9c['model'],_0x103a9c['query']);_0x36842d[_0x6032('0x34')]=_['intersection'](_0x103a9c[_0x6032('0x30')],qs[_0x6032('0x36')](_0x536be6[_0x6032('0x31')][_0x6032('0x36')]));_0x36842d[_0x6032('0x34')]=_0x36842d['attributes'][_0x6032('0x37')]?_0x36842d[_0x6032('0x34')]:_0x103a9c[_0x6032('0x30')];_0x36842d[_0x6032('0x4b')]=qs[_0x6032('0x39')](_0x536be6[_0x6032('0x31')][_0x6032('0x39')]);_0x36842d[_0x6032('0x3a')]=qs[_0x6032('0x33')](_[_0x6032('0x3b')](_0x536be6['query'],_0x103a9c[_0x6032('0x33')]));if(_0x536be6['query']['filter']){_0x36842d[_0x6032('0x3a')]=_[_0x6032('0x3d')](_0x36842d[_0x6032('0x3a')],{'$or':_['map'](_0x36842d[_0x6032('0x34')],function(_0x2512f1){var _0x5e24e8={};_0x5e24e8[_0x2512f1]={'$like':'%'+_0x536be6[_0x6032('0x31')]['filter']+'%'};return _0x5e24e8;})});}_0x36842d=_[_0x6032('0x3d')]({},_0x36842d,_0x536be6['options']);return _0x420791[_0x6032('0x49')](_0x36842d);}})[_0x6032('0x28')](function(_0x5f5cdf){if(_0x5f5cdf){_0x52d72e=_0x5f5cdf[_0x6032('0x37')];if(!_0x536be6[_0x6032('0x31')][_0x6032('0x38')](_0x6032('0x4c'))){_0x36842d['limit']=qs[_0x6032('0x20')](_0x536be6[_0x6032('0x31')][_0x6032('0x20')]);_0x36842d['offset']=qs[_0x6032('0x1e')](_0x536be6['query'][_0x6032('0x1e')]);}return _0x420791[_0x6032('0x49')](_0x36842d);}})[_0x6032('0x28')](function(_0x546f5c){if(_0x546f5c){return _0x546f5c?{'count':_0x52d72e,'rows':_0x546f5c}:null;}})[_0x6032('0x28')](respondWithResult(_0x3f9017,null))[_0x6032('0x45')](handleError(_0x3f9017,null));};exports['addConfiguration']=function(_0xecacac,_0x1b4664,_0x1d3b94){if(_0xecacac[_0x6032('0x47')]['id']){delete _0xecacac['body']['id'];}return db[_0x6032('0x2e')][_0x6032('0x4a')]({'where':{'id':_0xecacac[_0x6032('0x42')]['id']}})[_0x6032('0x28')](handleEntityNotFound(_0x1b4664,null))['then'](function(_0x5d6934){if(_0x5d6934){_0xecacac[_0x6032('0x47')]['AccountId']=_0x5d6934['id'];_0xecacac[_0x6032('0x47')][_0x6032('0x4d')]=integrations['getSubjects'](_0xecacac[_0x6032('0x47')]['channel'],_0xecacac['body'][_0x6032('0x4e')]);_0xecacac['body'][_0x6032('0x4f')]=integrations[_0x6032('0x50')](_0xecacac[_0x6032('0x47')][_0x6032('0x51')],_0xecacac['body'][_0x6032('0x4e')]);return db['ZohoConfiguration'][_0x6032('0x46')](_0xecacac[_0x6032('0x47')],{'include':[{'model':db[_0x6032('0x52')],'as':_0x6032('0x4d')},{'model':db[_0x6032('0x52')],'as':_0x6032('0x4f')}]});}return null;})[_0x6032('0x28')](respondWithResult(_0x1b4664,null))['catch'](handleError(_0x1b4664,null));};function getAccessToken(_0x54b2bd){return new Promise(function(_0x2818c8,_0x21bff7){var _0x591274;switch(_0x54b2bd[_0x6032('0x53')]){case'US':_0x591274=_0x6032('0x54');break;case'AU':_0x591274=_0x6032('0x55');break;case'EU':_0x591274='https://accounts.zoho.eu';break;case'IN':_0x591274='https://accounts.zoho.in';break;case'CN':_0x591274=_0x6032('0x56');break;default:_0x591274=_0x6032('0x57');break;}var _0x4a74b8={'method':_0x6032('0x58'),'uri':_0x591274+'/oauth/v2/token','qs':{'refresh_token':_0x54b2bd[_0x6032('0x59')],'client_id':_0x54b2bd[_0x6032('0x5a')],'client_secret':_0x54b2bd[_0x6032('0x5b')],'grant_type':_0x6032('0x5c')},'json':!![]};return rp(_0x4a74b8)[_0x6032('0x28')](function(_0x256823){if(_0x256823[_0x6032('0x5d')]){_0x2818c8(_0x256823[_0x6032('0x5d')]);}else{_0x21bff7('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x6032('0x45')](function(_0x426aba){_0x21bff7(_0x426aba);});});}exports[_0x6032('0x5e')]=function(_0x5570b3,_0x2b0169,_0x2a8378){var _0x12b502,_0x18b4c0,_0x409bc9,_0x14b5f0,_0x4fa84a;return db['ZohoAccount']['findOne']({'where':{'id':_0x5570b3[_0x6032('0x42')]['id']},'attributes':['id','host',_0x6032('0x53'),_0x6032('0x5a'),_0x6032('0x5b'),_0x6032('0x5f'),_0x6032('0x60'),'refreshToken']})[_0x6032('0x28')](handleEntityNotFound(_0x2b0169,null))['then'](function(_0x2b8910){_0x4fa84a=_0x2b8910;_0x12b502=_0x4fa84a[_0x6032('0x61')];_0x18b4c0=_0x12b502===_0x6032('0x62')?'eu':'com';_0x409bc9=_0x4fa84a['serverUrl'];var _0x3bb71a=_0x409bc9[_0x6032('0x63')](-0x1);if(_0x3bb71a==='/'||_0x3bb71a==='\x5c'||_0x3bb71a===':'){_0x409bc9=_0x409bc9[_0x6032('0x64')](0x0,_0x409bc9[_0x6032('0x65')](_0x3bb71a));}if(!_0x4fa84a[_0x6032('0x59')]){throw new Error(_0x6032('0x66'));}return getAccessToken(_0x4fa84a);})[_0x6032('0x28')](function(_0x1fbc28){if(_0x1fbc28){return rp({'method':_0x6032('0x67'),'uri':util[_0x6032('0x68')](_0x6032('0x69'),_0x18b4c0),'qs':{'module':_0x6032('0x6a')},'headers':{'Authorization':_0x6032('0x6b')+_0x1fbc28},'json':!![]});}})[_0x6032('0x28')](function(_0x29549c){if(_0x29549c){if(_0x29549c[_0x6032('0x6c')]&&_0x29549c[_0x6032('0x6c')][_0x6032('0x29')]){throw new Error(_0x29549c['response'][_0x6032('0x29')]['message']);}var _0x5a2d5e=[];var _0x3f5317=[];var _0x14d654=['Owner',_0x6032('0x6d'),_0x6032('0x6e'),_0x6032('0x6f'),_0x6032('0x70'),'Call_Result',_0x6032('0x71'),_0x6032('0x72')];_0x3f5317=_[_0x6032('0x73')](_0x29549c[_0x6032('0x36')],function(_0x1d4cea){return _0x14d654[_0x6032('0x74')](_0x1d4cea[_0x6032('0x75')]);});for(var _0x3c8864=0x0;_0x3c8864<_0x3f5317[_0x6032('0x37')];_0x3c8864++){if(_0x3f5317[_0x3c8864][_0x6032('0x76')]===![]){_0x5a2d5e[_0x6032('0x77')]({'id':_0x3f5317[_0x3c8864]['id'],'name':_0x3f5317[_0x3c8864][_0x6032('0x78')],'custom':_0x3f5317[_0x3c8864]['custom_field'],'options':_0x3f5317[_0x3c8864][_0x6032('0x79')]===_0x6032('0x7a')&&_0x3f5317[_0x3c8864][_0x6032('0x7b')]['length']>-0x1?_[_0x6032('0x2d')](_0x3f5317[_0x3c8864][_0x6032('0x7b')],function(_0x45468a){return{'name':_0x45468a,'value':_0x45468a};}):[]});}}return{'count':_0x5a2d5e[_0x6032('0x37')],'rows':_0x5a2d5e};}else{return{'count':0x0,'rows':[]};}})[_0x6032('0x28')](respondWithResult(_0x2b0169,null))[_0x6032('0x45')](function(_0x3e8d76){var _0x3bc001=_0x5570b3[_0x6032('0x31')]['test']?0x1f4:_0x3e8d76[_0x6032('0x7c')]||0x1f4;logger[_0x6032('0x29')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x3bc001,JSON[_0x6032('0x7d')](_0x3e8d76));delete _0x3e8d76[_0x6032('0x2a')];if(_0x3bc001===0x191){_0x3bc001=0x190;}_0x2b0169['status'](_0x3bc001)[_0x6032('0x2b')](_0x5570b3['query'][_0x6032('0x7e')]?{'message':_0x6032('0x7f'),'statusCode':_0x3e8d76['statusCode']}:_0x3e8d76);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 207a3a6..d97c971 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 _0xc6a3=['api','moment','bluebird','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','code','https://accounts.zoho.com','util','../../config/logger'];(function(_0x404f40,_0x1221af){var _0x38e296=function(_0x2699a6){while(--_0x2699a6){_0x404f40['push'](_0x404f40['shift']());}};_0x38e296(++_0x1221af);}(_0xc6a3,0x166));var _0x3c6a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc6a3[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x3c6a('0x0'));var logger=require(_0x3c6a('0x1'))(_0x3c6a('0x2'));var moment=require(_0x3c6a('0x3'));var BPromise=require(_0x3c6a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3c6a('0x5'));var config=require('../../config/environment');var attributes=require(_0x3c6a('0x6'));var integrations=require(_0x3c6a('0x7'));module[_0x3c6a('0x8')]=function(_0x1d1101,_0x5ecff2){return _0x1d1101['define']('ZohoAccount',attributes,{'tableName':_0x3c6a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b3ba8,_0x1138db,_0x227e57){if(_0x2b3ba8[_0x3c6a('0xa')](_0x3c6a('0xb'))||_0x2b3ba8[_0x3c6a('0xa')](_0x3c6a('0xc'))||_0x2b3ba8['changed'](_0x3c6a('0xd'))||_0x2b3ba8['changed'](_0x3c6a('0xe'))||_0x2b3ba8['changed']('code')||_0x2b3ba8[_0x3c6a('0xa')](_0x3c6a('0xf'))){var _0x4ab691,_0x379893;_0x4ab691=_0x2b3ba8[_0x3c6a('0xc')];var _0x107d56=_0x4ab691[_0x3c6a('0x10')](-0x1);if(_0x107d56==='/'||_0x107d56==='\x5c'||_0x107d56===':'){_0x4ab691=_0x4ab691[_0x3c6a('0x11')](0x0,_0x4ab691[_0x3c6a('0x12')](_0x107d56));}switch(_0x2b3ba8[_0x3c6a('0xb')]){case'US':_0x379893='https://accounts.zoho.com';break;case'AU':_0x379893=_0x3c6a('0x13');break;case'IN':_0x379893=_0x3c6a('0x14');break;case'CN':_0x379893=_0x3c6a('0x15');break;default:_0x379893=_0x3c6a('0x16');break;}var _0x2476e9={'method':_0x3c6a('0x17'),'uri':_0x379893+_0x3c6a('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x2b3ba8['clientId'],'client_secret':_0x2b3ba8[_0x3c6a('0xe')],'redirect_uri':_0x2b3ba8[_0x3c6a('0xc')],'code':_0x2b3ba8['code']},'headers':{'Content-Type':_0x3c6a('0x19')}};return rp(_0x2476e9)[_0x3c6a('0x1a')](function(_0x2301eb){var _0x11fac6=JSON[_0x3c6a('0x1b')](_0x2301eb);if(_0x11fac6[_0x3c6a('0x1c')]){_0x2b3ba8[_0x3c6a('0x1d')]=_0x11fac6[_0x3c6a('0x1c')];logger[_0x3c6a('0x1e')](util[_0x3c6a('0x1f')](_0x3c6a('0x20'),_0x2b3ba8[_0x3c6a('0x21')],_0x2b3ba8['id']));}else{logger[_0x3c6a('0x22')](util[_0x3c6a('0x1f')](_0x3c6a('0x23'),_0x2b3ba8['name'],_0x2b3ba8['id']),util[_0x3c6a('0x24')](_0x11fac6,{'showHidden':![],'depth':null}));}return _0x227e57(null,_0x1138db);})[_0x3c6a('0x25')](function(_0x261a30){logger[_0x3c6a('0x22')](util[_0x3c6a('0x1f')](_0x3c6a('0x23'),_0x2b3ba8[_0x3c6a('0x21')],_0x2b3ba8['id']),util[_0x3c6a('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x227e57(_0x261a30);});}else{return _0x227e57(null,_0x1138db);}},'beforeUpdate':function(_0x3b1594,_0x419ca4,_0x54ca94){if(_0x3b1594[_0x3c6a('0xa')](_0x3c6a('0xb'))||_0x3b1594[_0x3c6a('0xa')](_0x3c6a('0xc'))||_0x3b1594['changed'](_0x3c6a('0xd'))||_0x3b1594[_0x3c6a('0xa')]('clientSecret')||_0x3b1594[_0x3c6a('0xa')](_0x3c6a('0x26'))||_0x3b1594[_0x3c6a('0xa')]('host')){var _0x18eeb7,_0x50a89a;_0x18eeb7=_0x3b1594['serverUrl'];var _0x28c45f=_0x18eeb7[_0x3c6a('0x10')](-0x1);if(_0x28c45f==='/'||_0x28c45f==='\x5c'||_0x28c45f===':'){_0x18eeb7=_0x18eeb7['substring'](0x0,_0x18eeb7[_0x3c6a('0x12')](_0x28c45f));}switch(_0x3b1594[_0x3c6a('0xb')]){case'US':_0x50a89a=_0x3c6a('0x27');break;case'AU':_0x50a89a=_0x3c6a('0x13');break;case'IN':_0x50a89a=_0x3c6a('0x14');break;case'CN':_0x50a89a=_0x3c6a('0x15');break;default:_0x50a89a=_0x3c6a('0x16');break;}var _0x4f7f86={'method':_0x3c6a('0x17'),'uri':_0x50a89a+_0x3c6a('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x3b1594['clientId'],'client_secret':_0x3b1594[_0x3c6a('0xe')],'redirect_uri':_0x3b1594['serverUrl'],'code':_0x3b1594[_0x3c6a('0x26')]},'headers':{'Content-Type':_0x3c6a('0x19')}};return rp(_0x4f7f86)[_0x3c6a('0x1a')](function(_0x5cb9cb){var _0x12da32=JSON[_0x3c6a('0x1b')](_0x5cb9cb);if(_0x12da32['refresh_token']){_0x3b1594[_0x3c6a('0x1d')]=_0x12da32['refresh_token'];logger[_0x3c6a('0x1e')](util[_0x3c6a('0x1f')](_0x3c6a('0x20'),_0x3b1594[_0x3c6a('0x21')],_0x3b1594['id']));}else{logger[_0x3c6a('0x22')](util[_0x3c6a('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3b1594['name'],_0x3b1594['id']),util[_0x3c6a('0x24')](_0x12da32,{'showHidden':![],'depth':null}));}return _0x54ca94(null,_0x419ca4);})[_0x3c6a('0x25')](function(_0x4da265){logger[_0x3c6a('0x22')](util[_0x3c6a('0x1f')](_0x3c6a('0x23'),_0x3b1594['name'],_0x3b1594['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x54ca94(_0x4da265);});}else{return _0x54ca94(null,_0x419ca4);}}}});}; \ No newline at end of file +var _0x9060=['int_zoho_accounts','changed','serverUrl','clientSecret','code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','slice','zone','catch','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9060,0x1f1));var _0x0906=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x9060[_0x3740fe];return _0x55492b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0906('0x0'))(_0x0906('0x1'));var moment=require(_0x0906('0x2'));var BPromise=require(_0x0906('0x3'));var rp=require(_0x0906('0x4'));var fs=require('fs');var path=require(_0x0906('0x5'));var rimraf=require(_0x0906('0x6'));var config=require(_0x0906('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x0906('0x8'));module['exports']=function(_0x26208e,_0x4041b0){return _0x26208e[_0x0906('0x9')]('ZohoAccount',attributes,{'tableName':_0x0906('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x12d237,_0x260665,_0x32df01){if(_0x12d237[_0x0906('0xb')]('zone')||_0x12d237['changed'](_0x0906('0xc'))||_0x12d237[_0x0906('0xb')]('clientId')||_0x12d237[_0x0906('0xb')](_0x0906('0xd'))||_0x12d237[_0x0906('0xb')](_0x0906('0xe'))||_0x12d237[_0x0906('0xb')](_0x0906('0xf'))){var _0x4b0b5f,_0xc1815c;_0x4b0b5f=_0x12d237[_0x0906('0xc')];var _0x4c5a30=_0x4b0b5f['slice'](-0x1);if(_0x4c5a30==='/'||_0x4c5a30==='\x5c'||_0x4c5a30===':'){_0x4b0b5f=_0x4b0b5f[_0x0906('0x10')](0x0,_0x4b0b5f[_0x0906('0x11')](_0x4c5a30));}switch(_0x12d237['zone']){case'US':_0xc1815c=_0x0906('0x12');break;case'AU':_0xc1815c=_0x0906('0x13');break;case'IN':_0xc1815c='https://accounts.zoho.in';break;case'CN':_0xc1815c=_0x0906('0x14');break;default:_0xc1815c=_0x0906('0x15');break;}var _0x49c27b={'method':_0x0906('0x16'),'uri':_0xc1815c+_0x0906('0x17'),'form':{'grant_type':_0x0906('0x18'),'client_id':_0x12d237[_0x0906('0x19')],'client_secret':_0x12d237[_0x0906('0xd')],'redirect_uri':_0x12d237['serverUrl'],'code':_0x12d237['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x49c27b)[_0x0906('0x1a')](function(_0x43e126){var _0x3c7c28=JSON['parse'](_0x43e126);if(_0x3c7c28[_0x0906('0x1b')]){_0x12d237[_0x0906('0x1c')]=_0x3c7c28[_0x0906('0x1b')];logger[_0x0906('0x1d')](util[_0x0906('0x1e')](_0x0906('0x1f'),_0x12d237[_0x0906('0x20')],_0x12d237['id']));}else{logger[_0x0906('0x21')](util[_0x0906('0x1e')](_0x0906('0x22'),_0x12d237[_0x0906('0x20')],_0x12d237['id']),util[_0x0906('0x23')](_0x3c7c28,{'showHidden':![],'depth':null}));}return _0x32df01(null,_0x260665);})['catch'](function(_0x42bbf9){logger[_0x0906('0x21')](util[_0x0906('0x1e')](_0x0906('0x22'),_0x12d237[_0x0906('0x20')],_0x12d237['id']),util[_0x0906('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x32df01(_0x42bbf9);});}else{return _0x32df01(null,_0x260665);}},'beforeUpdate':function(_0x188a8b,_0xef0dd4,_0x55838b){if(_0x188a8b[_0x0906('0xb')]('zone')||_0x188a8b['changed'](_0x0906('0xc'))||_0x188a8b[_0x0906('0xb')]('clientId')||_0x188a8b[_0x0906('0xb')](_0x0906('0xd'))||_0x188a8b[_0x0906('0xb')](_0x0906('0xe'))||_0x188a8b[_0x0906('0xb')](_0x0906('0xf'))){var _0x35d1fb,_0x440612;_0x35d1fb=_0x188a8b['serverUrl'];var _0x4af439=_0x35d1fb[_0x0906('0x24')](-0x1);if(_0x4af439==='/'||_0x4af439==='\x5c'||_0x4af439===':'){_0x35d1fb=_0x35d1fb[_0x0906('0x10')](0x0,_0x35d1fb[_0x0906('0x11')](_0x4af439));}switch(_0x188a8b[_0x0906('0x25')]){case'US':_0x440612=_0x0906('0x12');break;case'AU':_0x440612=_0x0906('0x13');break;case'IN':_0x440612='https://accounts.zoho.in';break;case'CN':_0x440612=_0x0906('0x14');break;default:_0x440612=_0x0906('0x15');break;}var _0x4ad785={'method':'POST','uri':_0x440612+_0x0906('0x17'),'form':{'grant_type':_0x0906('0x18'),'client_id':_0x188a8b['clientId'],'client_secret':_0x188a8b['clientSecret'],'redirect_uri':_0x188a8b['serverUrl'],'code':_0x188a8b[_0x0906('0xe')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4ad785)[_0x0906('0x1a')](function(_0x3ecd30){var _0x1b8df2=JSON['parse'](_0x3ecd30);if(_0x1b8df2[_0x0906('0x1b')]){_0x188a8b['refreshToken']=_0x1b8df2['refresh_token'];logger[_0x0906('0x1d')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x188a8b[_0x0906('0x20')],_0x188a8b['id']));}else{logger['error'](util[_0x0906('0x1e')](_0x0906('0x22'),_0x188a8b[_0x0906('0x20')],_0x188a8b['id']),util[_0x0906('0x23')](_0x1b8df2,{'showHidden':![],'depth':null}));}return _0x55838b(null,_0xef0dd4);})[_0x0906('0x26')](function(_0x5e98d7){logger[_0x0906('0x21')](util[_0x0906('0x1e')](_0x0906('0x22'),_0x188a8b[_0x0906('0x20')],_0x188a8b['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x55838b(_0x5e98d7);});}else{return _0x55838b(null,_0xef0dd4);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 595c3ea..be90f71 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 _0xbedb=['message','catch','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','then','GetZohoAccount','ShowZohoAccount','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xbedb,0x12e));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbbed('0x0'));var util=require('util');var moment=require(_0xbbed('0x1'));var BPromise=require(_0xbbed('0x2'));var rs=require(_0xbbed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbbed('0x4'));var logger=require(_0xbbed('0x5'))(_0xbbed('0x6'));var config=require(_0xbbed('0x7'));var jayson=require(_0xbbed('0x8'));var client=jayson[_0xbbed('0x9')][_0xbbed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a3d9c,_0x44f7ff,_0x42f499){return new BPromise(function(_0x51d8c6,_0x12e6d0){return client['request'](_0x3a3d9c,_0x42f499)['then'](function(_0x3f5d87){logger[_0xbbed('0xb')](_0xbbed('0xc'),_0x44f7ff,'request\x20sent');logger['debug'](_0xbbed('0xd'),_0x44f7ff,_0xbbed('0xe'),JSON[_0xbbed('0xf')](_0x3f5d87));if(_0x3f5d87[_0xbbed('0x10')]){if(_0x3f5d87[_0xbbed('0x10')][_0xbbed('0x11')]===0x1f4){logger['error'](_0xbbed('0xc'),_0x44f7ff,_0x3f5d87['error'][_0xbbed('0x12')]);return _0x12e6d0(_0x3f5d87[_0xbbed('0x10')][_0xbbed('0x12')]);}logger[_0xbbed('0x10')](_0xbbed('0xc'),_0x44f7ff,_0x3f5d87[_0xbbed('0x10')][_0xbbed('0x12')]);return _0x51d8c6(_0x3f5d87[_0xbbed('0x10')][_0xbbed('0x12')]);}else{logger[_0xbbed('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x44f7ff,_0xbbed('0xe'));_0x51d8c6(_0x3f5d87['result'][_0xbbed('0x12')]);}})[_0xbbed('0x13')](function(_0xf860ff){logger[_0xbbed('0x10')](_0xbbed('0xc'),_0x44f7ff,_0xf860ff);_0x12e6d0(_0xf860ff);});});}exports['GetZohoAccount']=function(_0x19e9ce){var _0x2e1789=this;return new Promise(function(_0x44fd74,_0xb8a474){return db[_0xbbed('0x14')][_0xbbed('0x15')]({'raw':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce[_0xbbed('0x16')][_0xbbed('0x17')]===undefined?!![]:![]:!![],'where':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce[_0xbbed('0x16')][_0xbbed('0x18')]||null:null,'attributes':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce['options'][_0xbbed('0x19')]||null:null,'limit':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce[_0xbbed('0x16')]['limit']||null:null,'include':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce[_0xbbed('0x16')][_0xbbed('0x1a')]?_[_0xbbed('0x1b')](_0x19e9ce['options'][_0xbbed('0x1a')],function(_0x479c81){return{'model':db[_0x479c81[_0xbbed('0x1c')]],'as':_0x479c81['as'],'attributes':_0x479c81[_0xbbed('0x19')],'include':_0x479c81['include']?_[_0xbbed('0x1b')](_0x479c81[_0xbbed('0x1a')],function(_0x11ebcf){return{'model':db[_0x11ebcf[_0xbbed('0x1c')]],'as':_0x11ebcf['as'],'attributes':_0x11ebcf[_0xbbed('0x19')],'include':_0x11ebcf[_0xbbed('0x1a')]?_['map'](_0x11ebcf[_0xbbed('0x1a')],function(_0x5dd187){return{'model':db[_0x5dd187[_0xbbed('0x1c')]],'as':_0x5dd187['as'],'attributes':_0x5dd187['attributes']};}):[]};}):[]};}):[]:[]})[_0xbbed('0x1d')](function(_0x457b58){logger[_0xbbed('0xb')](_0xbbed('0x1e'),_0x19e9ce);logger['debug'](_0xbbed('0x1e'),_0x19e9ce,JSON[_0xbbed('0xf')](_0x457b58));_0x44fd74(_0x457b58);})[_0xbbed('0x13')](function(_0x446c21){logger['error'](_0xbbed('0x1e'),_0x446c21['message'],_0x19e9ce);_0xb8a474(_0x2e1789[_0xbbed('0x10')](0x1f4,_0x446c21[_0xbbed('0x12')]));});});};exports['ShowZohoAccount']=function(_0x35fb77){var _0xe9870c=this;return new Promise(function(_0x4d444f,_0x5de590){return db['ZohoAccount']['find']({'raw':_0x35fb77['options']?_0x35fb77[_0xbbed('0x16')][_0xbbed('0x17')]===undefined?!![]:![]:!![],'where':_0x35fb77['options']?_0x35fb77['options'][_0xbbed('0x18')]||null:null,'attributes':_0x35fb77[_0xbbed('0x16')]?_0x35fb77['options'][_0xbbed('0x19')]||null:null,'include':_0x35fb77['options']?_0x35fb77[_0xbbed('0x16')][_0xbbed('0x1a')]?_[_0xbbed('0x1b')](_0x35fb77['options'][_0xbbed('0x1a')],function(_0x1e598c){return{'model':db[_0x1e598c[_0xbbed('0x1c')]],'as':_0x1e598c['as'],'attributes':_0x1e598c[_0xbbed('0x19')],'include':_0x1e598c[_0xbbed('0x1a')]?_[_0xbbed('0x1b')](_0x1e598c['include'],function(_0x3324eb){return{'model':db[_0x3324eb['model']],'as':_0x3324eb['as'],'attributes':_0x3324eb['attributes'],'include':_0x3324eb[_0xbbed('0x1a')]?_['map'](_0x3324eb[_0xbbed('0x1a')],function(_0x46e494){return{'model':db[_0x46e494[_0xbbed('0x1c')]],'as':_0x46e494['as'],'attributes':_0x46e494[_0xbbed('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b25fd){logger[_0xbbed('0xb')]('ShowZohoAccount',_0x35fb77);logger['debug']('ShowZohoAccount',_0x35fb77,JSON[_0xbbed('0xf')](_0x1b25fd));_0x4d444f(_0x1b25fd);})[_0xbbed('0x13')](function(_0x2ab97c){logger[_0xbbed('0x10')](_0xbbed('0x1f'),_0x2ab97c[_0xbbed('0x12')],_0x35fb77);_0x5de590(_0xe9870c[_0xbbed('0x10')](0x1f4,_0x2ab97c['message']));});});}; \ No newline at end of file +var _0x6829=['client','http','then','ZohoAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','ZohoAccount','findAll','options','raw','attributes','limit','include','map','model','GetZohoAccount','catch','ShowZohoAccount','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x287d2a,_0x14e300){var _0x4d5869=function(_0x21b576){while(--_0x21b576){_0x287d2a['push'](_0x287d2a['shift']());}};_0x4d5869(++_0x14e300);}(_0x6829,0x14c));var _0x9682=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x6829[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x9682('0x0'));var util=require(_0x9682('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9682('0x2'));var db=require(_0x9682('0x3'))['db'];var utils=require(_0x9682('0x4'));var logger=require(_0x9682('0x5'))(_0x9682('0x6'));var config=require(_0x9682('0x7'));var jayson=require(_0x9682('0x8'));var client=jayson[_0x9682('0x9')][_0x9682('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cec91,_0x37ab0a,_0x1cca2f){return new BPromise(function(_0x576a39,_0x519138){return client['request'](_0x4cec91,_0x1cca2f)[_0x9682('0xb')](function(_0x1b27c2){logger['info'](_0x9682('0xc'),_0x37ab0a,'request\x20sent');logger[_0x9682('0xd')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x37ab0a,_0x9682('0xe'),JSON[_0x9682('0xf')](_0x1b27c2));if(_0x1b27c2[_0x9682('0x10')]){if(_0x1b27c2['error']['code']===0x1f4){logger[_0x9682('0x10')](_0x9682('0xc'),_0x37ab0a,_0x1b27c2['error'][_0x9682('0x11')]);return _0x519138(_0x1b27c2['error'][_0x9682('0x11')]);}logger[_0x9682('0x10')](_0x9682('0xc'),_0x37ab0a,_0x1b27c2[_0x9682('0x10')][_0x9682('0x11')]);return _0x576a39(_0x1b27c2[_0x9682('0x10')][_0x9682('0x11')]);}else{logger[_0x9682('0x12')](_0x9682('0xc'),_0x37ab0a,_0x9682('0xe'));_0x576a39(_0x1b27c2['result'][_0x9682('0x11')]);}})['catch'](function(_0x23eef6){logger[_0x9682('0x10')](_0x9682('0xc'),_0x37ab0a,_0x23eef6);_0x519138(_0x23eef6);});});}exports['GetZohoAccount']=function(_0x1c73ee){var _0x4e0dfb=this;return new Promise(function(_0x107291,_0x51c1a8){return db[_0x9682('0x13')][_0x9682('0x14')]({'raw':_0x1c73ee[_0x9682('0x15')]?_0x1c73ee[_0x9682('0x15')][_0x9682('0x16')]===undefined?!![]:![]:!![],'where':_0x1c73ee['options']?_0x1c73ee['options']['where']||null:null,'attributes':_0x1c73ee[_0x9682('0x15')]?_0x1c73ee['options'][_0x9682('0x17')]||null:null,'limit':_0x1c73ee[_0x9682('0x15')]?_0x1c73ee['options'][_0x9682('0x18')]||null:null,'include':_0x1c73ee[_0x9682('0x15')]?_0x1c73ee[_0x9682('0x15')][_0x9682('0x19')]?_[_0x9682('0x1a')](_0x1c73ee[_0x9682('0x15')][_0x9682('0x19')],function(_0x40e927){return{'model':db[_0x40e927[_0x9682('0x1b')]],'as':_0x40e927['as'],'attributes':_0x40e927[_0x9682('0x17')],'include':_0x40e927['include']?_[_0x9682('0x1a')](_0x40e927[_0x9682('0x19')],function(_0x88419f){return{'model':db[_0x88419f[_0x9682('0x1b')]],'as':_0x88419f['as'],'attributes':_0x88419f[_0x9682('0x17')],'include':_0x88419f['include']?_[_0x9682('0x1a')](_0x88419f[_0x9682('0x19')],function(_0x44808c){return{'model':db[_0x44808c[_0x9682('0x1b')]],'as':_0x44808c['as'],'attributes':_0x44808c[_0x9682('0x17')]};}):[]};}):[]};}):[]:[]})[_0x9682('0xb')](function(_0x48e821){logger[_0x9682('0x12')](_0x9682('0x1c'),_0x1c73ee);logger[_0x9682('0xd')](_0x9682('0x1c'),_0x1c73ee,JSON[_0x9682('0xf')](_0x48e821));_0x107291(_0x48e821);})[_0x9682('0x1d')](function(_0x176624){logger[_0x9682('0x10')]('GetZohoAccount',_0x176624[_0x9682('0x11')],_0x1c73ee);_0x51c1a8(_0x4e0dfb['error'](0x1f4,_0x176624[_0x9682('0x11')]));});});};exports[_0x9682('0x1e')]=function(_0x598248){var _0x54c860=this;return new Promise(function(_0x4b4c5d,_0x5a2ad3){return db[_0x9682('0x13')]['find']({'raw':_0x598248[_0x9682('0x15')]?_0x598248[_0x9682('0x15')][_0x9682('0x16')]===undefined?!![]:![]:!![],'where':_0x598248[_0x9682('0x15')]?_0x598248['options']['where']||null:null,'attributes':_0x598248[_0x9682('0x15')]?_0x598248[_0x9682('0x15')][_0x9682('0x17')]||null:null,'include':_0x598248[_0x9682('0x15')]?_0x598248[_0x9682('0x15')]['include']?_['map'](_0x598248[_0x9682('0x15')][_0x9682('0x19')],function(_0x76f489){return{'model':db[_0x76f489[_0x9682('0x1b')]],'as':_0x76f489['as'],'attributes':_0x76f489[_0x9682('0x17')],'include':_0x76f489[_0x9682('0x19')]?_[_0x9682('0x1a')](_0x76f489['include'],function(_0x27c9dd){return{'model':db[_0x27c9dd[_0x9682('0x1b')]],'as':_0x27c9dd['as'],'attributes':_0x27c9dd[_0x9682('0x17')],'include':_0x27c9dd[_0x9682('0x19')]?_[_0x9682('0x1a')](_0x27c9dd['include'],function(_0x194bda){return{'model':db[_0x194bda['model']],'as':_0x194bda['as'],'attributes':_0x194bda[_0x9682('0x17')]};}):[]};}):[]};}):[]:[]})[_0x9682('0xb')](function(_0x43d782){logger[_0x9682('0x12')](_0x9682('0x1e'),_0x598248);logger[_0x9682('0xd')](_0x9682('0x1e'),_0x598248,JSON['stringify'](_0x43d782));_0x4b4c5d(_0x43d782);})[_0x9682('0x1d')](function(_0x555634){logger[_0x9682('0x10')]('ShowZohoAccount',_0x555634[_0x9682('0x11')],_0x598248);_0x5a2ad3(_0x54c860[_0x9682('0x10')](0x1f4,_0x555634[_0x9682('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 331edee..af08574 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 _0x502c=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','getSubjects','/:id/descriptions','getDescriptions','post','update','destroy','exports','multer','util','path'];(function(_0x150397,_0x258581){var _0x5cadab=function(_0x3052d6){while(--_0x3052d6){_0x150397['push'](_0x150397['shift']());}};_0x5cadab(++_0x258581);}(_0x502c,0x1f1));var _0xc502=function(_0xba24f8,_0x4da107){_0xba24f8=_0xba24f8-0x0;var _0x430857=_0x502c[_0xba24f8];return _0x430857;};'use strict';var multer=require(_0xc502('0x0'));var util=require(_0xc502('0x1'));var path=require(_0xc502('0x2'));var timeout=require(_0xc502('0x3'));var express=require(_0xc502('0x4'));var router=express[_0xc502('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc502('0x6'));var config=require(_0xc502('0x7'));var controller=require(_0xc502('0x8'));router[_0xc502('0x9')]('/',auth[_0xc502('0xa')](),controller[_0xc502('0xb')]);router[_0xc502('0x9')]('/:id',auth[_0xc502('0xa')](),controller[_0xc502('0xc')]);router['get']('/:id/fields',auth[_0xc502('0xa')](),controller['getFields']);router[_0xc502('0x9')]('/:id/subjects',auth[_0xc502('0xa')](),controller[_0xc502('0xd')]);router[_0xc502('0x9')](_0xc502('0xe'),auth[_0xc502('0xa')](),controller[_0xc502('0xf')]);router[_0xc502('0x10')]('/',auth[_0xc502('0xa')](),controller['create']);router['put']('/:id',auth[_0xc502('0xa')](),controller[_0xc502('0x11')]);router['delete']('/:id',auth[_0xc502('0xa')](),controller[_0xc502('0x12')]);module[_0xc502('0x13')]=router; \ No newline at end of file +var _0x5c62=['../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x41444f,_0x12a5ae){var _0x40250c=function(_0x3ead0c){while(--_0x3ead0c){_0x41444f['push'](_0x41444f['shift']());}};_0x40250c(++_0x12a5ae);}(_0x5c62,0x64));var _0x25c6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5c62[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x25c6('0x0'));var util=require('util');var path=require(_0x25c6('0x1'));var timeout=require(_0x25c6('0x2'));var express=require('express');var router=express[_0x25c6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x25c6('0x4'));var config=require(_0x25c6('0x5'));var controller=require(_0x25c6('0x6'));router[_0x25c6('0x7')]('/',auth[_0x25c6('0x8')](),controller[_0x25c6('0x9')]);router['get']('/:id',auth[_0x25c6('0x8')](),controller['show']);router[_0x25c6('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get'](_0x25c6('0xa'),auth[_0x25c6('0x8')](),controller[_0x25c6('0xb')]);router[_0x25c6('0x7')](_0x25c6('0xc'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x25c6('0xd')]('/',auth['isAuthenticated'](),controller[_0x25c6('0xe')]);router[_0x25c6('0xf')]('/:id',auth[_0x25c6('0x8')](),controller[_0x25c6('0x10')]);router[_0x25c6('0x11')](_0x25c6('0x12'),auth['isAuthenticated'](),controller[_0x25c6('0x13')]);module[_0x25c6('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 2892c0b..f7ac76a 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 _0x138b=['STRING','ENUM','lead','contact','nothing','contact_lead','exports'];(function(_0xc95e9b,_0x4e9058){var _0x43d048=function(_0x9fba56){while(--_0x9fba56){_0xc95e9b['push'](_0xc95e9b['shift']());}};_0x43d048(++_0x4e9058);}(_0x138b,0x156));var _0xb138=function(_0x3df43a,_0x109af6){_0x3df43a=_0x3df43a-0x0;var _0x25d612=_0x138b[_0x3df43a];return _0x25d612;};'use strict';var Sequelize=require('sequelize');module[_0xb138('0x0')]={'name':{'type':Sequelize[_0xb138('0x1')]},'moduleCreate':{'type':Sequelize[_0xb138('0x2')](_0xb138('0x3'),_0xb138('0x4'),_0xb138('0x5')),'defaultValue':_0xb138('0x3')},'moduleSearch':{'type':Sequelize[_0xb138('0x2')]('contact_lead','contact',_0xb138('0x3')),'defaultValue':_0xb138('0x6')},'description':{'type':Sequelize[_0xb138('0x1')]}}; \ No newline at end of file +var _0x4c22=['ENUM','lead','contact','nothing','contact_lead','STRING'];(function(_0x3d3fe5,_0x2fcf2b){var _0xb4ce88=function(_0x2fdb90){while(--_0x2fdb90){_0x3d3fe5['push'](_0x3d3fe5['shift']());}};_0xb4ce88(++_0x2fcf2b);}(_0x4c22,0x168));var _0x24c2=function(_0x41809b,_0x2fc9e9){_0x41809b=_0x41809b-0x0;var _0x2eb3d8=_0x4c22[_0x41809b];return _0x2eb3d8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x24c2('0x0')](_0x24c2('0x1'),_0x24c2('0x2'),_0x24c2('0x3')),'defaultValue':_0x24c2('0x1')},'moduleSearch':{'type':Sequelize[_0x24c2('0x0')](_0x24c2('0x4'),_0x24c2('0x2'),_0x24c2('0x1')),'defaultValue':_0x24c2('0x4')},'description':{'type':Sequelize[_0x24c2('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 00b55cc..1ebb17d 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 _0x4873=['end','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','findAll','rows','show','params','length','includeAll','find','catch','create','body','getFields','findOne','ZohoField','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy'];(function(_0xf6ca8e,_0x280706){var _0xb44fcd=function(_0xdc879e){while(--_0xdc879e){_0xf6ca8e['push'](_0xf6ca8e['shift']());}};_0xb44fcd(++_0x280706);}(_0x4873,0x7c));var _0x3487=function(_0x56fed8,_0x517c21){_0x56fed8=_0x56fed8-0x0;var _0x21bc5b=_0x4873[_0x56fed8];return _0x21bc5b;};'use strict';var emlformat=require(_0x3487('0x0'));var rimraf=require(_0x3487('0x1'));var zipdir=require(_0x3487('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3487('0x3'));var moment=require(_0x3487('0x4'));var BPromise=require(_0x3487('0x5'));var Mustache=require('mustache');var util=require(_0x3487('0x6'));var path=require(_0x3487('0x7'));var sox=require('sox');var csv=require(_0x3487('0x8'));var ejs=require(_0x3487('0x9'));var fs=require('fs');var fs_extra=require(_0x3487('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3487('0xb'));var deskjs=require(_0x3487('0xc'));var toCsv=require(_0x3487('0x8'));var querystring=require(_0x3487('0xd'));var Papa=require(_0x3487('0xe'));var Redis=require(_0x3487('0xf'));var authService=require(_0x3487('0x10'));var qs=require(_0x3487('0x11'));var as=require(_0x3487('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3487('0x13'))(_0x3487('0x14'));var utils=require(_0x3487('0x15'));var config=require(_0x3487('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3487('0x17'))['db'];function respondWithStatusCode(_0x312e98,_0x2e1445){_0x2e1445=_0x2e1445||0xcc;return function(_0x1b515a){if(_0x1b515a){return _0x312e98[_0x3487('0x18')](_0x2e1445);}return _0x312e98['status'](_0x2e1445)['end']();};}function respondWithResult(_0x88b4bc,_0x4efb04){_0x4efb04=_0x4efb04||0xc8;return function(_0x2c9255){if(_0x2c9255){return _0x88b4bc[_0x3487('0x19')](_0x4efb04)['json'](_0x2c9255);}};}function respondWithFilteredResult(_0xdabf9d,_0x41225d){return function(_0x2df947){if(_0x2df947){var _0x460027=typeof _0x41225d[_0x3487('0x1a')]===_0x3487('0x1b')&&typeof _0x41225d[_0x3487('0x1c')]===_0x3487('0x1b');var _0x25b2b2=_0x2df947[_0x3487('0x1d')];var _0x2bc54e=_0x460027?0x0:_0x41225d[_0x3487('0x1a')];var _0x18c624=_0x460027?_0x2df947['count']:_0x41225d[_0x3487('0x1a')]+_0x41225d[_0x3487('0x1c')];var _0xbda1f6;if(_0x18c624>=_0x25b2b2){_0x18c624=_0x25b2b2;_0xbda1f6=0xc8;}else{_0xbda1f6=0xce;}_0xdabf9d[_0x3487('0x19')](_0xbda1f6);return _0xdabf9d[_0x3487('0x1e')](_0x3487('0x1f'),_0x2bc54e+'-'+_0x18c624+'/'+_0x25b2b2)[_0x3487('0x20')](_0x2df947);}return null;};}function patchUpdates(_0x1a4c7e){return function(_0x11a9af){try{jsonpatch[_0x3487('0x21')](_0x11a9af,_0x1a4c7e,!![]);}catch(_0x2b2985){return BPromise['reject'](_0x2b2985);}return _0x11a9af[_0x3487('0x22')]();};}function saveUpdates(_0x3c94b4,_0x3aea6c){return function(_0x2526dc){if(_0x2526dc){return _0x2526dc[_0x3487('0x23')](_0x3c94b4)[_0x3487('0x24')](function(_0x24c03f){return _0x24c03f;});}return null;};}function removeEntity(_0x193f46,_0x218bb9){return function(_0x57d658){if(_0x57d658){return _0x57d658[_0x3487('0x25')]()[_0x3487('0x24')](function(){_0x193f46[_0x3487('0x19')](0xcc)[_0x3487('0x26')]();});}};}function handleEntityNotFound(_0x4d9b71,_0x2d8862){return function(_0x47ecc5){if(!_0x47ecc5){_0x4d9b71['sendStatus'](0x194);}return _0x47ecc5;};}function handleError(_0x3195d5,_0x552a32){_0x552a32=_0x552a32||0x1f4;return function(_0x107ae2){logger[_0x3487('0x27')](_0x107ae2[_0x3487('0x28')]);if(_0x107ae2[_0x3487('0x29')]){delete _0x107ae2['name'];}_0x3195d5[_0x3487('0x19')](_0x552a32)[_0x3487('0x2a')](_0x107ae2);};}exports[_0x3487('0x2b')]=function(_0x53551d,_0x2261ee){var _0x8bdc69={},_0x144c3c={},_0x998682={'count':0x0,'rows':[]};var _0x2c1e38=_[_0x3487('0x2c')](db[_0x3487('0x2d')][_0x3487('0x2e')],function(_0x4c9a9e){return{'name':_0x4c9a9e[_0x3487('0x2f')],'type':_0x4c9a9e[_0x3487('0x30')][_0x3487('0x31')]};});_0x144c3c[_0x3487('0x32')]=_[_0x3487('0x2c')](_0x2c1e38,_0x3487('0x29'));_0x144c3c[_0x3487('0x33')]=_[_0x3487('0x34')](_0x53551d[_0x3487('0x33')]);_0x144c3c[_0x3487('0x35')]=_['intersection'](_0x144c3c[_0x3487('0x32')],_0x144c3c[_0x3487('0x33')]);_0x8bdc69[_0x3487('0x36')]=_[_0x3487('0x37')](_0x144c3c[_0x3487('0x32')],qs[_0x3487('0x38')](_0x53551d[_0x3487('0x33')][_0x3487('0x38')]));_0x8bdc69[_0x3487('0x36')]=_0x8bdc69[_0x3487('0x36')]['length']?_0x8bdc69['attributes']:_0x144c3c[_0x3487('0x32')];if(!_0x53551d[_0x3487('0x33')][_0x3487('0x39')](_0x3487('0x3a'))){_0x8bdc69['limit']=qs['limit'](_0x53551d[_0x3487('0x33')][_0x3487('0x1c')]);_0x8bdc69['offset']=qs[_0x3487('0x1a')](_0x53551d['query'][_0x3487('0x1a')]);}_0x8bdc69[_0x3487('0x3b')]=qs[_0x3487('0x3c')](_0x53551d[_0x3487('0x33')]['sort']);_0x8bdc69[_0x3487('0x3d')]=qs[_0x3487('0x35')](_['pick'](_0x53551d[_0x3487('0x33')],_0x144c3c[_0x3487('0x35')]),_0x2c1e38);if(_0x53551d[_0x3487('0x33')]['filter']){_0x8bdc69[_0x3487('0x3d')]=_[_0x3487('0x3e')](_0x8bdc69['where'],{'$or':_[_0x3487('0x2c')](_0x2c1e38,function(_0x37bb70){if(_0x37bb70[_0x3487('0x30')]!=='VIRTUAL'){var _0x39c85e={};_0x39c85e[_0x37bb70[_0x3487('0x29')]]={'$like':'%'+_0x53551d['query'][_0x3487('0x3f')]+'%'};return _0x39c85e;}})});}_0x8bdc69=_[_0x3487('0x3e')]({},_0x8bdc69,_0x53551d[_0x3487('0x40')]);var _0x5aaee9={'where':_0x8bdc69[_0x3487('0x3d')]};return db[_0x3487('0x2d')][_0x3487('0x1d')](_0x5aaee9)[_0x3487('0x24')](function(_0x345278){_0x998682['count']=_0x345278;if(_0x53551d[_0x3487('0x33')]['includeAll']){_0x8bdc69['include']=[{'all':!![]}];}return db[_0x3487('0x2d')][_0x3487('0x41')](_0x8bdc69);})[_0x3487('0x24')](function(_0x176343){_0x998682[_0x3487('0x42')]=_0x176343;return _0x998682;})[_0x3487('0x24')](respondWithFilteredResult(_0x2261ee,_0x8bdc69))['catch'](handleError(_0x2261ee,null));};exports[_0x3487('0x43')]=function(_0x46e04e,_0x4b1f55){var _0x2f2e56={'raw':![],'where':{'id':_0x46e04e[_0x3487('0x44')]['id']}},_0x245263={};_0x245263['model']=_[_0x3487('0x34')](db[_0x3487('0x2d')][_0x3487('0x2e')]);_0x245263['query']=_[_0x3487('0x34')](_0x46e04e[_0x3487('0x33')]);_0x245263['filters']=_[_0x3487('0x37')](_0x245263['model'],_0x245263[_0x3487('0x33')]);_0x2f2e56[_0x3487('0x36')]=_[_0x3487('0x37')](_0x245263[_0x3487('0x32')],qs[_0x3487('0x38')](_0x46e04e[_0x3487('0x33')][_0x3487('0x38')]));_0x2f2e56[_0x3487('0x36')]=_0x2f2e56[_0x3487('0x36')][_0x3487('0x45')]?_0x2f2e56[_0x3487('0x36')]:_0x245263[_0x3487('0x32')];if(_0x46e04e[_0x3487('0x33')][_0x3487('0x46')]){_0x2f2e56['include']=[{'all':!![]}];}_0x2f2e56=_[_0x3487('0x3e')]({},_0x2f2e56,_0x46e04e[_0x3487('0x40')]);return db['ZohoConfiguration'][_0x3487('0x47')](_0x2f2e56)[_0x3487('0x24')](handleEntityNotFound(_0x4b1f55,null))['then'](respondWithResult(_0x4b1f55,null))[_0x3487('0x48')](handleError(_0x4b1f55,null));};exports['create']=function(_0xfa4b83,_0xcd2b14){return db[_0x3487('0x2d')][_0x3487('0x49')](_0xfa4b83['body'],{})[_0x3487('0x24')](respondWithResult(_0xcd2b14,0xc9))[_0x3487('0x48')](handleError(_0xcd2b14,null));};exports[_0x3487('0x23')]=function(_0x50f64f,_0xfad25b){if(_0x50f64f['body']['id']){delete _0x50f64f[_0x3487('0x4a')]['id'];}return db[_0x3487('0x2d')][_0x3487('0x47')]({'where':{'id':_0x50f64f[_0x3487('0x44')]['id']}})['then'](handleEntityNotFound(_0xfad25b,null))[_0x3487('0x24')](saveUpdates(_0x50f64f[_0x3487('0x4a')],null))['then'](respondWithResult(_0xfad25b,null))[_0x3487('0x48')](handleError(_0xfad25b,null));};exports[_0x3487('0x25')]=function(_0x3c7991,_0xa9b6cb){return db[_0x3487('0x2d')][_0x3487('0x47')]({'where':{'id':_0x3c7991['params']['id']}})[_0x3487('0x24')](handleEntityNotFound(_0xa9b6cb,null))[_0x3487('0x24')](removeEntity(_0xa9b6cb,null))[_0x3487('0x48')](handleError(_0xa9b6cb,null));};exports[_0x3487('0x4b')]=function(_0x18c2f3,_0x853c16,_0x34cf67){var _0xcdef85={};var _0x187373={};var _0x32b634;var _0xce717f;return db[_0x3487('0x2d')][_0x3487('0x4c')]({'where':{'id':_0x18c2f3[_0x3487('0x44')]['id']}})[_0x3487('0x24')](handleEntityNotFound(_0x853c16,null))[_0x3487('0x24')](function(_0x3f54d5){if(_0x3f54d5){_0x32b634=_0x3f54d5;_0x187373[_0x3487('0x32')]=_[_0x3487('0x34')](db[_0x3487('0x4d')][_0x3487('0x2e')]);_0x187373[_0x3487('0x33')]=_[_0x3487('0x34')](_0x18c2f3[_0x3487('0x33')]);_0x187373[_0x3487('0x35')]=_[_0x3487('0x37')](_0x187373[_0x3487('0x32')],_0x187373[_0x3487('0x33')]);_0xcdef85['attributes']=_[_0x3487('0x37')](_0x187373[_0x3487('0x32')],qs[_0x3487('0x38')](_0x18c2f3['query']['fields']));_0xcdef85[_0x3487('0x36')]=_0xcdef85['attributes'][_0x3487('0x45')]?_0xcdef85[_0x3487('0x36')]:_0x187373[_0x3487('0x32')];_0xcdef85['order']=qs[_0x3487('0x3c')](_0x18c2f3[_0x3487('0x33')][_0x3487('0x3c')]);_0xcdef85['where']=qs[_0x3487('0x35')](_['pick'](_0x18c2f3['query'],_0x187373['filters']));if(_0x18c2f3['query'][_0x3487('0x3f')]){_0xcdef85[_0x3487('0x3d')]=_['merge'](_0xcdef85[_0x3487('0x3d')],{'$or':_[_0x3487('0x2c')](_0xcdef85['attributes'],function(_0x4c4892){var _0x27596b={};_0x27596b[_0x4c4892]={'$like':'%'+_0x18c2f3[_0x3487('0x33')][_0x3487('0x3f')]+'%'};return _0x27596b;})});}_0xcdef85=_[_0x3487('0x3e')]({},_0xcdef85,_0x18c2f3[_0x3487('0x40')]);return _0x32b634[_0x3487('0x4b')](_0xcdef85);}})[_0x3487('0x24')](function(_0x148703){if(_0x148703){_0xce717f=_0x148703[_0x3487('0x45')];if(!_0x18c2f3[_0x3487('0x33')][_0x3487('0x39')]('nolimit')){_0xcdef85[_0x3487('0x1c')]=qs['limit'](_0x18c2f3[_0x3487('0x33')][_0x3487('0x1c')]);_0xcdef85[_0x3487('0x1a')]=qs[_0x3487('0x1a')](_0x18c2f3[_0x3487('0x33')][_0x3487('0x1a')]);}return _0x32b634[_0x3487('0x4b')](_0xcdef85);}})['then'](function(_0x85bea4){if(_0x85bea4){return _0x85bea4?{'count':_0xce717f,'rows':_0x85bea4}:null;}})[_0x3487('0x24')](respondWithResult(_0x853c16,null))[_0x3487('0x48')](handleError(_0x853c16,null));};exports[_0x3487('0x4e')]=function(_0x32570f,_0x4a1a2d,_0x12faa9){var _0x23eae1={};var _0x253100={};var _0x34623a;var _0x47803d;return db['ZohoConfiguration'][_0x3487('0x4c')]({'where':{'id':_0x32570f[_0x3487('0x44')]['id']}})[_0x3487('0x24')](handleEntityNotFound(_0x4a1a2d,null))[_0x3487('0x24')](function(_0x19af7b){if(_0x19af7b){_0x34623a=_0x19af7b;_0x253100[_0x3487('0x32')]=_[_0x3487('0x34')](db[_0x3487('0x4d')][_0x3487('0x2e')]);_0x253100[_0x3487('0x33')]=_[_0x3487('0x34')](_0x32570f[_0x3487('0x33')]);_0x253100[_0x3487('0x35')]=_[_0x3487('0x37')](_0x253100[_0x3487('0x32')],_0x253100['query']);_0x23eae1[_0x3487('0x36')]=_[_0x3487('0x37')](_0x253100[_0x3487('0x32')],qs['fields'](_0x32570f[_0x3487('0x33')]['fields']));_0x23eae1[_0x3487('0x36')]=_0x23eae1['attributes'][_0x3487('0x45')]?_0x23eae1[_0x3487('0x36')]:_0x253100[_0x3487('0x32')];_0x23eae1['order']=qs[_0x3487('0x3c')](_0x32570f[_0x3487('0x33')][_0x3487('0x3c')]);_0x23eae1[_0x3487('0x3d')]=qs[_0x3487('0x35')](_[_0x3487('0x4f')](_0x32570f[_0x3487('0x33')],_0x253100[_0x3487('0x35')]));if(_0x32570f[_0x3487('0x33')][_0x3487('0x3f')]){_0x23eae1['where']=_[_0x3487('0x3e')](_0x23eae1[_0x3487('0x3d')],{'$or':_[_0x3487('0x2c')](_0x23eae1['attributes'],function(_0xda5dcc){var _0x261b31={};_0x261b31[_0xda5dcc]={'$like':'%'+_0x32570f[_0x3487('0x33')][_0x3487('0x3f')]+'%'};return _0x261b31;})});}_0x23eae1=_[_0x3487('0x3e')]({},_0x23eae1,_0x32570f[_0x3487('0x40')]);return _0x34623a[_0x3487('0x4e')](_0x23eae1);}})[_0x3487('0x24')](function(_0x301045){if(_0x301045){_0x47803d=_0x301045[_0x3487('0x45')];if(!_0x32570f[_0x3487('0x33')]['hasOwnProperty'](_0x3487('0x3a'))){_0x23eae1[_0x3487('0x1c')]=qs[_0x3487('0x1c')](_0x32570f['query'][_0x3487('0x1c')]);_0x23eae1[_0x3487('0x1a')]=qs['offset'](_0x32570f['query'][_0x3487('0x1a')]);}return _0x34623a[_0x3487('0x4e')](_0x23eae1);}})[_0x3487('0x24')](function(_0x534b07){if(_0x534b07){return _0x534b07?{'count':_0x47803d,'rows':_0x534b07}:null;}})[_0x3487('0x24')](respondWithResult(_0x4a1a2d,null))[_0x3487('0x48')](handleError(_0x4a1a2d,null));};exports['getDescriptions']=function(_0x494970,_0x141aff,_0x1aa0e7){var _0x26091a={};var _0x135678={};var _0x575ab5;var _0x165b80;return db[_0x3487('0x2d')]['findOne']({'where':{'id':_0x494970['params']['id']}})[_0x3487('0x24')](handleEntityNotFound(_0x141aff,null))[_0x3487('0x24')](function(_0x4837c2){if(_0x4837c2){_0x575ab5=_0x4837c2;_0x135678[_0x3487('0x32')]=_[_0x3487('0x34')](db[_0x3487('0x4d')][_0x3487('0x2e')]);_0x135678[_0x3487('0x33')]=_[_0x3487('0x34')](_0x494970['query']);_0x135678[_0x3487('0x35')]=_[_0x3487('0x37')](_0x135678[_0x3487('0x32')],_0x135678[_0x3487('0x33')]);_0x26091a[_0x3487('0x36')]=_[_0x3487('0x37')](_0x135678[_0x3487('0x32')],qs[_0x3487('0x38')](_0x494970[_0x3487('0x33')][_0x3487('0x38')]));_0x26091a[_0x3487('0x36')]=_0x26091a[_0x3487('0x36')][_0x3487('0x45')]?_0x26091a[_0x3487('0x36')]:_0x135678[_0x3487('0x32')];_0x26091a['order']=qs[_0x3487('0x3c')](_0x494970[_0x3487('0x33')]['sort']);_0x26091a[_0x3487('0x3d')]=qs[_0x3487('0x35')](_[_0x3487('0x4f')](_0x494970['query'],_0x135678[_0x3487('0x35')]));if(_0x494970[_0x3487('0x33')]['filter']){_0x26091a[_0x3487('0x3d')]=_[_0x3487('0x3e')](_0x26091a['where'],{'$or':_[_0x3487('0x2c')](_0x26091a['attributes'],function(_0xdf43eb){var _0xc1b61c={};_0xc1b61c[_0xdf43eb]={'$like':'%'+_0x494970[_0x3487('0x33')][_0x3487('0x3f')]+'%'};return _0xc1b61c;})});}_0x26091a=_[_0x3487('0x3e')]({},_0x26091a,_0x494970[_0x3487('0x40')]);return _0x575ab5['getDescriptions'](_0x26091a);}})[_0x3487('0x24')](function(_0x3a80ad){if(_0x3a80ad){_0x165b80=_0x3a80ad[_0x3487('0x45')];if(!_0x494970[_0x3487('0x33')][_0x3487('0x39')]('nolimit')){_0x26091a['limit']=qs[_0x3487('0x1c')](_0x494970['query'][_0x3487('0x1c')]);_0x26091a[_0x3487('0x1a')]=qs[_0x3487('0x1a')](_0x494970[_0x3487('0x33')][_0x3487('0x1a')]);}return _0x575ab5[_0x3487('0x50')](_0x26091a);}})['then'](function(_0x5a8fd5){if(_0x5a8fd5){return _0x5a8fd5?{'count':_0x165b80,'rows':_0x5a8fd5}:null;}})['then'](respondWithResult(_0x141aff,null))['catch'](handleError(_0x141aff,null));}; \ No newline at end of file +var _0x6e82=['find','destroy','getFields','ZohoField','pick','filter','nolimit','getSubjects','findOne','getDescriptions','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','ZohoConfiguration','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','create','update','body'];(function(_0x5cc26b,_0x2d1c21){var _0x2d68e4=function(_0x5d2057){while(--_0x5d2057){_0x5cc26b['push'](_0x5cc26b['shift']());}};_0x2d68e4(++_0x2d1c21);}(_0x6e82,0x152));var _0x26e8=function(_0x2a5bb7,_0x3a0bf3){_0x2a5bb7=_0x2a5bb7-0x0;var _0x503330=_0x6e82[_0x2a5bb7];return _0x503330;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x26e8('0x0'));var jsonpatch=require(_0x26e8('0x1'));var rp=require('request-promise');var moment=require(_0x26e8('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x26e8('0x3'));var util=require(_0x26e8('0x4'));var path=require(_0x26e8('0x5'));var sox=require(_0x26e8('0x6'));var csv=require(_0x26e8('0x7'));var ejs=require(_0x26e8('0x8'));var fs=require('fs');var fs_extra=require(_0x26e8('0x9'));var _=require(_0x26e8('0xa'));var squel=require(_0x26e8('0xb'));var crypto=require('crypto');var jsforce=require(_0x26e8('0xc'));var deskjs=require(_0x26e8('0xd'));var toCsv=require(_0x26e8('0x7'));var querystring=require('querystring');var Papa=require(_0x26e8('0xe'));var Redis=require(_0x26e8('0xf'));var authService=require(_0x26e8('0x10'));var qs=require(_0x26e8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26e8('0x12'));var logger=require(_0x26e8('0x13'))(_0x26e8('0x14'));var utils=require(_0x26e8('0x15'));var config=require(_0x26e8('0x16'));var licenseUtil=require(_0x26e8('0x17'));var db=require(_0x26e8('0x18'))['db'];function respondWithStatusCode(_0x1c370f,_0x178396){_0x178396=_0x178396||0xcc;return function(_0xdb2213){if(_0xdb2213){return _0x1c370f[_0x26e8('0x19')](_0x178396);}return _0x1c370f[_0x26e8('0x1a')](_0x178396)[_0x26e8('0x1b')]();};}function respondWithResult(_0x150336,_0x2b57d0){_0x2b57d0=_0x2b57d0||0xc8;return function(_0x1fd5e1){if(_0x1fd5e1){return _0x150336[_0x26e8('0x1a')](_0x2b57d0)[_0x26e8('0x1c')](_0x1fd5e1);}};}function respondWithFilteredResult(_0x43601f,_0x4f5f10){return function(_0x1247dd){if(_0x1247dd){var _0x274d8f=typeof _0x4f5f10[_0x26e8('0x1d')]===_0x26e8('0x1e')&&typeof _0x4f5f10['limit']==='undefined';var _0x5f4d08=_0x1247dd[_0x26e8('0x1f')];var _0x565846=_0x274d8f?0x0:_0x4f5f10[_0x26e8('0x1d')];var _0x27af5f=_0x274d8f?_0x1247dd[_0x26e8('0x1f')]:_0x4f5f10[_0x26e8('0x1d')]+_0x4f5f10[_0x26e8('0x20')];var _0x40b191;if(_0x27af5f>=_0x5f4d08){_0x27af5f=_0x5f4d08;_0x40b191=0xc8;}else{_0x40b191=0xce;}_0x43601f[_0x26e8('0x1a')](_0x40b191);return _0x43601f[_0x26e8('0x21')](_0x26e8('0x22'),_0x565846+'-'+_0x27af5f+'/'+_0x5f4d08)[_0x26e8('0x1c')](_0x1247dd);}return null;};}function patchUpdates(_0x207248){return function(_0x35cf7c){try{jsonpatch[_0x26e8('0x23')](_0x35cf7c,_0x207248,!![]);}catch(_0x16f7dd){return BPromise[_0x26e8('0x24')](_0x16f7dd);}return _0x35cf7c[_0x26e8('0x25')]();};}function saveUpdates(_0x4550d2,_0x451f18){return function(_0x5264df){if(_0x5264df){return _0x5264df['update'](_0x4550d2)[_0x26e8('0x26')](function(_0x11b8b2){return _0x11b8b2;});}return null;};}function removeEntity(_0x13e15a,_0x16b8c3){return function(_0x1a0b2e){if(_0x1a0b2e){return _0x1a0b2e['destroy']()[_0x26e8('0x26')](function(){_0x13e15a[_0x26e8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4818b5,_0x3f192e){return function(_0x32c8b2){if(!_0x32c8b2){_0x4818b5[_0x26e8('0x19')](0x194);}return _0x32c8b2;};}function handleError(_0x533bba,_0x4a7b1c){_0x4a7b1c=_0x4a7b1c||0x1f4;return function(_0x293016){logger[_0x26e8('0x27')](_0x293016[_0x26e8('0x28')]);if(_0x293016[_0x26e8('0x29')]){delete _0x293016['name'];}_0x533bba[_0x26e8('0x1a')](_0x4a7b1c)[_0x26e8('0x2a')](_0x293016);};}exports[_0x26e8('0x2b')]=function(_0xace09d,_0xaf108e){var _0x34efb7={},_0x3cbf4f={},_0x1d7c46={'count':0x0,'rows':[]};var _0x57f033=_[_0x26e8('0x2c')](db[_0x26e8('0x2d')]['rawAttributes'],function(_0x436278){return{'name':_0x436278[_0x26e8('0x2e')],'type':_0x436278['type'][_0x26e8('0x2f')]};});_0x3cbf4f['model']=_[_0x26e8('0x2c')](_0x57f033,_0x26e8('0x29'));_0x3cbf4f[_0x26e8('0x30')]=_[_0x26e8('0x31')](_0xace09d['query']);_0x3cbf4f[_0x26e8('0x32')]=_[_0x26e8('0x33')](_0x3cbf4f[_0x26e8('0x34')],_0x3cbf4f[_0x26e8('0x30')]);_0x34efb7[_0x26e8('0x35')]=_[_0x26e8('0x33')](_0x3cbf4f[_0x26e8('0x34')],qs[_0x26e8('0x36')](_0xace09d[_0x26e8('0x30')][_0x26e8('0x36')]));_0x34efb7[_0x26e8('0x35')]=_0x34efb7['attributes'][_0x26e8('0x37')]?_0x34efb7['attributes']:_0x3cbf4f[_0x26e8('0x34')];if(!_0xace09d['query'][_0x26e8('0x38')]('nolimit')){_0x34efb7[_0x26e8('0x20')]=qs[_0x26e8('0x20')](_0xace09d[_0x26e8('0x30')][_0x26e8('0x20')]);_0x34efb7[_0x26e8('0x1d')]=qs[_0x26e8('0x1d')](_0xace09d[_0x26e8('0x30')][_0x26e8('0x1d')]);}_0x34efb7[_0x26e8('0x39')]=qs[_0x26e8('0x3a')](_0xace09d[_0x26e8('0x30')]['sort']);_0x34efb7[_0x26e8('0x3b')]=qs[_0x26e8('0x32')](_['pick'](_0xace09d[_0x26e8('0x30')],_0x3cbf4f[_0x26e8('0x32')]),_0x57f033);if(_0xace09d[_0x26e8('0x30')]['filter']){_0x34efb7['where']=_[_0x26e8('0x3c')](_0x34efb7['where'],{'$or':_[_0x26e8('0x2c')](_0x57f033,function(_0x92bef8){if(_0x92bef8['type']!==_0x26e8('0x3d')){var _0x4acc24={};_0x4acc24[_0x92bef8[_0x26e8('0x29')]]={'$like':'%'+_0xace09d[_0x26e8('0x30')]['filter']+'%'};return _0x4acc24;}})});}_0x34efb7=_[_0x26e8('0x3c')]({},_0x34efb7,_0xace09d[_0x26e8('0x3e')]);var _0x1fadaa={'where':_0x34efb7[_0x26e8('0x3b')]};return db[_0x26e8('0x2d')][_0x26e8('0x1f')](_0x1fadaa)[_0x26e8('0x26')](function(_0x5a8618){_0x1d7c46[_0x26e8('0x1f')]=_0x5a8618;if(_0xace09d[_0x26e8('0x30')][_0x26e8('0x3f')]){_0x34efb7['include']=[{'all':!![]}];}return db[_0x26e8('0x2d')][_0x26e8('0x40')](_0x34efb7);})['then'](function(_0x483e7f){_0x1d7c46['rows']=_0x483e7f;return _0x1d7c46;})[_0x26e8('0x26')](respondWithFilteredResult(_0xaf108e,_0x34efb7))[_0x26e8('0x41')](handleError(_0xaf108e,null));};exports[_0x26e8('0x42')]=function(_0x3f9995,_0x3bf458){var _0x325665={'raw':![],'where':{'id':_0x3f9995[_0x26e8('0x43')]['id']}},_0xfb6186={};_0xfb6186['model']=_[_0x26e8('0x31')](db['ZohoConfiguration'][_0x26e8('0x44')]);_0xfb6186[_0x26e8('0x30')]=_[_0x26e8('0x31')](_0x3f9995['query']);_0xfb6186[_0x26e8('0x32')]=_[_0x26e8('0x33')](_0xfb6186[_0x26e8('0x34')],_0xfb6186['query']);_0x325665['attributes']=_['intersection'](_0xfb6186[_0x26e8('0x34')],qs[_0x26e8('0x36')](_0x3f9995[_0x26e8('0x30')][_0x26e8('0x36')]));_0x325665[_0x26e8('0x35')]=_0x325665['attributes']['length']?_0x325665['attributes']:_0xfb6186['model'];if(_0x3f9995[_0x26e8('0x30')][_0x26e8('0x3f')]){_0x325665['include']=[{'all':!![]}];}_0x325665=_[_0x26e8('0x3c')]({},_0x325665,_0x3f9995[_0x26e8('0x3e')]);return db[_0x26e8('0x2d')]['find'](_0x325665)[_0x26e8('0x26')](handleEntityNotFound(_0x3bf458,null))[_0x26e8('0x26')](respondWithResult(_0x3bf458,null))['catch'](handleError(_0x3bf458,null));};exports['create']=function(_0x3acbed,_0x53d6c7){return db[_0x26e8('0x2d')][_0x26e8('0x45')](_0x3acbed['body'],{})[_0x26e8('0x26')](respondWithResult(_0x53d6c7,0xc9))[_0x26e8('0x41')](handleError(_0x53d6c7,null));};exports[_0x26e8('0x46')]=function(_0x571ea5,_0x24902f){if(_0x571ea5[_0x26e8('0x47')]['id']){delete _0x571ea5['body']['id'];}return db[_0x26e8('0x2d')][_0x26e8('0x48')]({'where':{'id':_0x571ea5[_0x26e8('0x43')]['id']}})[_0x26e8('0x26')](handleEntityNotFound(_0x24902f,null))[_0x26e8('0x26')](saveUpdates(_0x571ea5[_0x26e8('0x47')],null))[_0x26e8('0x26')](respondWithResult(_0x24902f,null))[_0x26e8('0x41')](handleError(_0x24902f,null));};exports[_0x26e8('0x49')]=function(_0x3afe06,_0x40523f){return db['ZohoConfiguration']['find']({'where':{'id':_0x3afe06[_0x26e8('0x43')]['id']}})[_0x26e8('0x26')](handleEntityNotFound(_0x40523f,null))['then'](removeEntity(_0x40523f,null))[_0x26e8('0x41')](handleError(_0x40523f,null));};exports[_0x26e8('0x4a')]=function(_0x4ad368,_0x2530e5,_0x4919f9){var _0x235176={};var _0x4a0a87={};var _0x18a061;var _0x49e039;return db[_0x26e8('0x2d')]['findOne']({'where':{'id':_0x4ad368[_0x26e8('0x43')]['id']}})[_0x26e8('0x26')](handleEntityNotFound(_0x2530e5,null))[_0x26e8('0x26')](function(_0x375628){if(_0x375628){_0x18a061=_0x375628;_0x4a0a87['model']=_['keys'](db[_0x26e8('0x4b')][_0x26e8('0x44')]);_0x4a0a87[_0x26e8('0x30')]=_[_0x26e8('0x31')](_0x4ad368[_0x26e8('0x30')]);_0x4a0a87['filters']=_[_0x26e8('0x33')](_0x4a0a87['model'],_0x4a0a87[_0x26e8('0x30')]);_0x235176[_0x26e8('0x35')]=_[_0x26e8('0x33')](_0x4a0a87[_0x26e8('0x34')],qs[_0x26e8('0x36')](_0x4ad368[_0x26e8('0x30')][_0x26e8('0x36')]));_0x235176[_0x26e8('0x35')]=_0x235176[_0x26e8('0x35')][_0x26e8('0x37')]?_0x235176[_0x26e8('0x35')]:_0x4a0a87[_0x26e8('0x34')];_0x235176[_0x26e8('0x39')]=qs[_0x26e8('0x3a')](_0x4ad368['query']['sort']);_0x235176[_0x26e8('0x3b')]=qs[_0x26e8('0x32')](_[_0x26e8('0x4c')](_0x4ad368[_0x26e8('0x30')],_0x4a0a87[_0x26e8('0x32')]));if(_0x4ad368[_0x26e8('0x30')][_0x26e8('0x4d')]){_0x235176[_0x26e8('0x3b')]=_[_0x26e8('0x3c')](_0x235176[_0x26e8('0x3b')],{'$or':_[_0x26e8('0x2c')](_0x235176['attributes'],function(_0x30c981){var _0x163672={};_0x163672[_0x30c981]={'$like':'%'+_0x4ad368[_0x26e8('0x30')]['filter']+'%'};return _0x163672;})});}_0x235176=_[_0x26e8('0x3c')]({},_0x235176,_0x4ad368['options']);return _0x18a061[_0x26e8('0x4a')](_0x235176);}})['then'](function(_0x50d05e){if(_0x50d05e){_0x49e039=_0x50d05e[_0x26e8('0x37')];if(!_0x4ad368[_0x26e8('0x30')][_0x26e8('0x38')](_0x26e8('0x4e'))){_0x235176[_0x26e8('0x20')]=qs[_0x26e8('0x20')](_0x4ad368[_0x26e8('0x30')]['limit']);_0x235176[_0x26e8('0x1d')]=qs[_0x26e8('0x1d')](_0x4ad368[_0x26e8('0x30')][_0x26e8('0x1d')]);}return _0x18a061[_0x26e8('0x4a')](_0x235176);}})[_0x26e8('0x26')](function(_0x23a55b){if(_0x23a55b){return _0x23a55b?{'count':_0x49e039,'rows':_0x23a55b}:null;}})[_0x26e8('0x26')](respondWithResult(_0x2530e5,null))[_0x26e8('0x41')](handleError(_0x2530e5,null));};exports[_0x26e8('0x4f')]=function(_0x11cc2c,_0x30be31,_0xbbfe31){var _0x54014c={};var _0x1a58d8={};var _0x2800de;var _0x4318f1;return db['ZohoConfiguration'][_0x26e8('0x50')]({'where':{'id':_0x11cc2c[_0x26e8('0x43')]['id']}})[_0x26e8('0x26')](handleEntityNotFound(_0x30be31,null))['then'](function(_0x172607){if(_0x172607){_0x2800de=_0x172607;_0x1a58d8[_0x26e8('0x34')]=_[_0x26e8('0x31')](db[_0x26e8('0x4b')][_0x26e8('0x44')]);_0x1a58d8['query']=_[_0x26e8('0x31')](_0x11cc2c['query']);_0x1a58d8[_0x26e8('0x32')]=_[_0x26e8('0x33')](_0x1a58d8[_0x26e8('0x34')],_0x1a58d8[_0x26e8('0x30')]);_0x54014c[_0x26e8('0x35')]=_[_0x26e8('0x33')](_0x1a58d8['model'],qs[_0x26e8('0x36')](_0x11cc2c[_0x26e8('0x30')][_0x26e8('0x36')]));_0x54014c[_0x26e8('0x35')]=_0x54014c[_0x26e8('0x35')]['length']?_0x54014c[_0x26e8('0x35')]:_0x1a58d8['model'];_0x54014c['order']=qs[_0x26e8('0x3a')](_0x11cc2c['query']['sort']);_0x54014c[_0x26e8('0x3b')]=qs[_0x26e8('0x32')](_[_0x26e8('0x4c')](_0x11cc2c['query'],_0x1a58d8[_0x26e8('0x32')]));if(_0x11cc2c[_0x26e8('0x30')][_0x26e8('0x4d')]){_0x54014c['where']=_[_0x26e8('0x3c')](_0x54014c['where'],{'$or':_[_0x26e8('0x2c')](_0x54014c[_0x26e8('0x35')],function(_0x18e0bb){var _0x5d2842={};_0x5d2842[_0x18e0bb]={'$like':'%'+_0x11cc2c[_0x26e8('0x30')][_0x26e8('0x4d')]+'%'};return _0x5d2842;})});}_0x54014c=_[_0x26e8('0x3c')]({},_0x54014c,_0x11cc2c['options']);return _0x2800de[_0x26e8('0x4f')](_0x54014c);}})[_0x26e8('0x26')](function(_0x14ff15){if(_0x14ff15){_0x4318f1=_0x14ff15[_0x26e8('0x37')];if(!_0x11cc2c[_0x26e8('0x30')]['hasOwnProperty'](_0x26e8('0x4e'))){_0x54014c[_0x26e8('0x20')]=qs[_0x26e8('0x20')](_0x11cc2c[_0x26e8('0x30')][_0x26e8('0x20')]);_0x54014c[_0x26e8('0x1d')]=qs['offset'](_0x11cc2c[_0x26e8('0x30')][_0x26e8('0x1d')]);}return _0x2800de[_0x26e8('0x4f')](_0x54014c);}})[_0x26e8('0x26')](function(_0x6b1cde){if(_0x6b1cde){return _0x6b1cde?{'count':_0x4318f1,'rows':_0x6b1cde}:null;}})[_0x26e8('0x26')](respondWithResult(_0x30be31,null))[_0x26e8('0x41')](handleError(_0x30be31,null));};exports['getDescriptions']=function(_0x5b994a,_0x14a0be,_0x388c77){var _0x4e9812={};var _0x370ec7={};var _0x206d71;var _0x3cd6d4;return db[_0x26e8('0x2d')][_0x26e8('0x50')]({'where':{'id':_0x5b994a[_0x26e8('0x43')]['id']}})[_0x26e8('0x26')](handleEntityNotFound(_0x14a0be,null))[_0x26e8('0x26')](function(_0x2220de){if(_0x2220de){_0x206d71=_0x2220de;_0x370ec7[_0x26e8('0x34')]=_[_0x26e8('0x31')](db[_0x26e8('0x4b')][_0x26e8('0x44')]);_0x370ec7[_0x26e8('0x30')]=_[_0x26e8('0x31')](_0x5b994a[_0x26e8('0x30')]);_0x370ec7[_0x26e8('0x32')]=_[_0x26e8('0x33')](_0x370ec7[_0x26e8('0x34')],_0x370ec7[_0x26e8('0x30')]);_0x4e9812[_0x26e8('0x35')]=_[_0x26e8('0x33')](_0x370ec7[_0x26e8('0x34')],qs[_0x26e8('0x36')](_0x5b994a[_0x26e8('0x30')]['fields']));_0x4e9812['attributes']=_0x4e9812[_0x26e8('0x35')][_0x26e8('0x37')]?_0x4e9812[_0x26e8('0x35')]:_0x370ec7[_0x26e8('0x34')];_0x4e9812[_0x26e8('0x39')]=qs['sort'](_0x5b994a[_0x26e8('0x30')][_0x26e8('0x3a')]);_0x4e9812['where']=qs[_0x26e8('0x32')](_[_0x26e8('0x4c')](_0x5b994a[_0x26e8('0x30')],_0x370ec7['filters']));if(_0x5b994a[_0x26e8('0x30')][_0x26e8('0x4d')]){_0x4e9812[_0x26e8('0x3b')]=_[_0x26e8('0x3c')](_0x4e9812['where'],{'$or':_['map'](_0x4e9812[_0x26e8('0x35')],function(_0x4ff30f){var _0x48eabb={};_0x48eabb[_0x4ff30f]={'$like':'%'+_0x5b994a[_0x26e8('0x30')][_0x26e8('0x4d')]+'%'};return _0x48eabb;})});}_0x4e9812=_[_0x26e8('0x3c')]({},_0x4e9812,_0x5b994a[_0x26e8('0x3e')]);return _0x206d71[_0x26e8('0x51')](_0x4e9812);}})['then'](function(_0x2931db){if(_0x2931db){_0x3cd6d4=_0x2931db[_0x26e8('0x37')];if(!_0x5b994a['query'][_0x26e8('0x38')](_0x26e8('0x4e'))){_0x4e9812[_0x26e8('0x20')]=qs['limit'](_0x5b994a[_0x26e8('0x30')]['limit']);_0x4e9812['offset']=qs[_0x26e8('0x1d')](_0x5b994a[_0x26e8('0x30')][_0x26e8('0x1d')]);}return _0x206d71[_0x26e8('0x51')](_0x4e9812);}})[_0x26e8('0x26')](function(_0x25f00b){if(_0x25f00b){return _0x25f00b?{'count':_0x3cd6d4,'rows':_0x25f00b}:null;}})[_0x26e8('0x26')](respondWithResult(_0x14a0be,null))[_0x26e8('0x41')](handleError(_0x14a0be,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 8a5e638..57bd112 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 _0xabeb=['../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2c47f4,_0x3e7d5c){var _0x5e3e6a=function(_0x33be81){while(--_0x33be81){_0x2c47f4['push'](_0x2c47f4['shift']());}};_0x5e3e6a(++_0x3e7d5c);}(_0xabeb,0xd1));var _0xbabe=function(_0x1716ac,_0x245897){_0x1716ac=_0x1716ac-0x0;var _0xa54aaa=_0xabeb[_0x1716ac];return _0xa54aaa;};'use strict';var _=require('lodash');var util=require(_0xbabe('0x0'));var logger=require(_0xbabe('0x1'))(_0xbabe('0x2'));var moment=require(_0xbabe('0x3'));var BPromise=require(_0xbabe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbabe('0x5'));var rimraf=require(_0xbabe('0x6'));var config=require(_0xbabe('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0xbabe('0x8')]=function(_0x26c525,_0x4d2474){return _0x26c525[_0xbabe('0x9')](_0xbabe('0xa'),attributes,{'tableName':_0xbabe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae4a=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4e61f1,_0x259acc){var _0x293660=function(_0x4844f3){while(--_0x4844f3){_0x4e61f1['push'](_0x4e61f1['shift']());}};_0x293660(++_0x259acc);}(_0xae4a,0x1b5));var _0xaae4=function(_0x25f5b8,_0x4de605){_0x25f5b8=_0x25f5b8-0x0;var _0x39779f=_0xae4a[_0x25f5b8];return _0x39779f;};'use strict';var _=require('lodash');var util=require(_0xaae4('0x0'));var logger=require(_0xaae4('0x1'))(_0xaae4('0x2'));var moment=require(_0xaae4('0x3'));var BPromise=require(_0xaae4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaae4('0x5'));var rimraf=require(_0xaae4('0x6'));var config=require('../../config/environment');var attributes=require(_0xaae4('0x7'));module[_0xaae4('0x8')]=function(_0x438fd9,_0x3ac318){return _0x438fd9[_0xaae4('0x9')](_0xaae4('0xa'),attributes,{'tableName':_0xaae4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 05a1c69..62bb7cb 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 _0x29bc=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x29bc,0xa1));var _0xc29b=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x29bc[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require(_0xc29b('0x0'));var util=require(_0xc29b('0x1'));var moment=require(_0xc29b('0x2'));var BPromise=require('bluebird');var rs=require(_0xc29b('0x3'));var fs=require('fs');var Redis=require(_0xc29b('0x4'));var db=require(_0xc29b('0x5'))['db'];var utils=require(_0xc29b('0x6'));var logger=require(_0xc29b('0x7'))(_0xc29b('0x8'));var config=require(_0xc29b('0x9'));var jayson=require(_0xc29b('0xa'));var client=jayson[_0xc29b('0xb')][_0xc29b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e180d,_0x17f4b9,_0x2bcb55){return new BPromise(function(_0xd21575,_0x99977){return client[_0xc29b('0xd')](_0x2e180d,_0x2bcb55)['then'](function(_0x5dfa15){logger[_0xc29b('0xe')](_0xc29b('0xf'),_0x17f4b9,_0xc29b('0x10'));logger[_0xc29b('0x11')](_0xc29b('0x12'),_0x17f4b9,_0xc29b('0x10'),JSON['stringify'](_0x5dfa15));if(_0x5dfa15[_0xc29b('0x13')]){if(_0x5dfa15[_0xc29b('0x13')][_0xc29b('0x14')]===0x1f4){logger['error'](_0xc29b('0xf'),_0x17f4b9,_0x5dfa15[_0xc29b('0x13')][_0xc29b('0x15')]);return _0x99977(_0x5dfa15[_0xc29b('0x13')][_0xc29b('0x15')]);}logger[_0xc29b('0x13')](_0xc29b('0xf'),_0x17f4b9,_0x5dfa15[_0xc29b('0x13')][_0xc29b('0x15')]);return _0xd21575(_0x5dfa15['error']['message']);}else{logger[_0xc29b('0xe')](_0xc29b('0xf'),_0x17f4b9,_0xc29b('0x10'));_0xd21575(_0x5dfa15[_0xc29b('0x16')]['message']);}})[_0xc29b('0x17')](function(_0x21f2b1){logger['error'](_0xc29b('0xf'),_0x17f4b9,_0x21f2b1);_0x99977(_0x21f2b1);});});} \ No newline at end of file +var _0x5405=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info'];(function(_0x1d0500,_0x395f37){var _0x145545=function(_0x3b5ab6){while(--_0x3b5ab6){_0x1d0500['push'](_0x1d0500['shift']());}};_0x145545(++_0x395f37);}(_0x5405,0x67));var _0x5540=function(_0x27787d,_0x3c832a){_0x27787d=_0x27787d-0x0;var _0x2ec19c=_0x5405[_0x27787d];return _0x2ec19c;};'use strict';var _=require(_0x5540('0x0'));var util=require(_0x5540('0x1'));var moment=require('moment');var BPromise=require(_0x5540('0x2'));var rs=require(_0x5540('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5540('0x4'))['db'];var utils=require(_0x5540('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5540('0x6'));var jayson=require(_0x5540('0x7'));var client=jayson['client'][_0x5540('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13611d,_0x57d44e,_0x47b753){return new BPromise(function(_0x2135e4,_0x1b8264){return client[_0x5540('0x9')](_0x13611d,_0x47b753)['then'](function(_0x15044b){logger[_0x5540('0xa')](_0x5540('0xb'),_0x57d44e,_0x5540('0xc'));logger[_0x5540('0xd')](_0x5540('0xe'),_0x57d44e,_0x5540('0xc'),JSON[_0x5540('0xf')](_0x15044b));if(_0x15044b[_0x5540('0x10')]){if(_0x15044b['error'][_0x5540('0x11')]===0x1f4){logger['error'](_0x5540('0xb'),_0x57d44e,_0x15044b[_0x5540('0x10')][_0x5540('0x12')]);return _0x1b8264(_0x15044b[_0x5540('0x10')][_0x5540('0x12')]);}logger['error'](_0x5540('0xb'),_0x57d44e,_0x15044b[_0x5540('0x10')][_0x5540('0x12')]);return _0x2135e4(_0x15044b[_0x5540('0x10')]['message']);}else{logger[_0x5540('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x57d44e,_0x5540('0xc'));_0x2135e4(_0x15044b['result']['message']);}})['catch'](function(_0x396a2c){logger[_0x5540('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x57d44e,_0x396a2c);_0x1b8264(_0x396a2c);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 65f1882..efd805d 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 _0x94ad=['update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','show','post','create','put','/:id'];(function(_0x116927,_0x315e84){var _0x393752=function(_0x16aaa1){while(--_0x16aaa1){_0x116927['push'](_0x116927['shift']());}};_0x393752(++_0x315e84);}(_0x94ad,0xc1));var _0xd94a=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x94ad[_0x3c8e9a];return _0x2d4c57;};'use strict';var multer=require(_0xd94a('0x0'));var util=require(_0xd94a('0x1'));var path=require(_0xd94a('0x2'));var timeout=require('connect-timeout');var express=require(_0xd94a('0x3'));var router=express[_0xd94a('0x4')]();var fs_extra=require(_0xd94a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd94a('0x6'));var config=require(_0xd94a('0x7'));var controller=require(_0xd94a('0x8'));router[_0xd94a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd94a('0x9')]('/:id',auth[_0xd94a('0xa')](),controller[_0xd94a('0xb')]);router[_0xd94a('0xc')]('/',auth[_0xd94a('0xa')](),controller[_0xd94a('0xd')]);router[_0xd94a('0xe')](_0xd94a('0xf'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x10')]);router[_0xd94a('0x11')](_0xd94a('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xd94a('0x12')]=router; \ No newline at end of file +var _0xe142=['put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','create'];(function(_0x41270b,_0x5db444){var _0x2b6090=function(_0x23e7e0){while(--_0x23e7e0){_0x41270b['push'](_0x41270b['shift']());}};_0x2b6090(++_0x5db444);}(_0xe142,0xed));var _0x2e14=function(_0x505766,_0x4d4a04){_0x505766=_0x505766-0x0;var _0x429123=_0xe142[_0x505766];return _0x429123;};'use strict';var multer=require(_0x2e14('0x0'));var util=require(_0x2e14('0x1'));var path=require('path');var timeout=require(_0x2e14('0x2'));var express=require(_0x2e14('0x3'));var router=express[_0x2e14('0x4')]();var fs_extra=require(_0x2e14('0x5'));var auth=require(_0x2e14('0x6'));var interaction=require(_0x2e14('0x7'));var config=require(_0x2e14('0x8'));var controller=require('./intZohoField.controller');router['get']('/',auth[_0x2e14('0x9')](),controller['index']);router[_0x2e14('0xa')](_0x2e14('0xb'),auth[_0x2e14('0x9')](),controller[_0x2e14('0xc')]);router[_0x2e14('0xd')]('/',auth[_0x2e14('0x9')](),controller[_0x2e14('0xe')]);router[_0x2e14('0xf')](_0x2e14('0xb'),auth[_0x2e14('0x9')](),controller['update']);router[_0x2e14('0x10')](_0x2e14('0xb'),auth['isAuthenticated'](),controller[_0x2e14('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 e7b1a06..cff9227 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 _0x16ad=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0x16ad,0x1bc));var _0xd16a=function(_0x194338,_0x4f8d65){_0x194338=_0x194338-0x0;var _0x169a3b=_0x16ad[_0x194338];return _0x169a3b;};'use strict';var Sequelize=require('sequelize');module[_0xd16a('0x0')]={'type':{'type':Sequelize[_0xd16a('0x1')](_0xd16a('0x2'),_0xd16a('0x3'),_0xd16a('0x4'),_0xd16a('0x5'),_0xd16a('0x6')),'defaultValue':_0xd16a('0x2')},'content':{'type':Sequelize[_0xd16a('0x7')]},'key':{'type':Sequelize[_0xd16a('0x7')]},'keyType':{'type':Sequelize[_0xd16a('0x1')](_0xd16a('0x2'),_0xd16a('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xd16a('0x7')]},'idField':{'type':Sequelize[_0xd16a('0x7')]},'nameField':{'type':Sequelize[_0xd16a('0x7')]},'customField':{'type':Sequelize[_0xd16a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd16a('0x7')]}}; \ No newline at end of file +var _0xc097=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x507a87,_0x11207d){var _0x5a1c9d=function(_0x4473ca){while(--_0x4473ca){_0x507a87['push'](_0x507a87['shift']());}};_0x5a1c9d(++_0x11207d);}(_0xc097,0xae));var _0x7c09=function(_0xf82f2b,_0x59e0bb){_0xf82f2b=_0xf82f2b-0x0;var _0x16415c=_0xc097[_0xf82f2b];return _0x16415c;};'use strict';var Sequelize=require('sequelize');module[_0x7c09('0x0')]={'type':{'type':Sequelize[_0x7c09('0x1')](_0x7c09('0x2'),_0x7c09('0x3'),_0x7c09('0x4'),_0x7c09('0x5'),_0x7c09('0x6')),'defaultValue':_0x7c09('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7c09('0x1')](_0x7c09('0x2'),_0x7c09('0x3'),_0x7c09('0x4'))},'keyContent':{'type':Sequelize[_0x7c09('0x7')]},'idField':{'type':Sequelize[_0x7c09('0x7')]},'nameField':{'type':Sequelize[_0x7c09('0x7')]},'customField':{'type':Sequelize[_0x7c09('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7c09('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index b6ff64e..6fa4c6a 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 _0x58ab=['name','send','index','ZohoField','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','create','body','catch','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack'];(function(_0x19b9c1,_0x17c9e2){var _0x927134=function(_0x40fef4){while(--_0x40fef4){_0x19b9c1['push'](_0x19b9c1['shift']());}};_0x927134(++_0x17c9e2);}(_0x58ab,0xf8));var _0xb58a=function(_0x1cdaf1,_0x4d9699){_0x1cdaf1=_0x1cdaf1-0x0;var _0x397c09=_0x58ab[_0x1cdaf1];return _0x397c09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb58a('0x0'));var zipdir=require(_0xb58a('0x1'));var jsonpatch=require(_0xb58a('0x2'));var rp=require('request-promise');var moment=require(_0xb58a('0x3'));var BPromise=require(_0xb58a('0x4'));var Mustache=require(_0xb58a('0x5'));var util=require(_0xb58a('0x6'));var path=require('path');var sox=require(_0xb58a('0x7'));var csv=require(_0xb58a('0x8'));var ejs=require(_0xb58a('0x9'));var fs=require('fs');var fs_extra=require(_0xb58a('0xa'));var _=require('lodash');var squel=require(_0xb58a('0xb'));var crypto=require(_0xb58a('0xc'));var jsforce=require(_0xb58a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb58a('0x8'));var querystring=require(_0xb58a('0xe'));var Papa=require('papaparse');var Redis=require(_0xb58a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb58a('0x10'));var as=require(_0xb58a('0x11'));var hardwareService=require(_0xb58a('0x12'));var logger=require(_0xb58a('0x13'))(_0xb58a('0x14'));var utils=require(_0xb58a('0x15'));var config=require(_0xb58a('0x16'));var licenseUtil=require(_0xb58a('0x17'));var db=require(_0xb58a('0x18'))['db'];function respondWithStatusCode(_0x3d04d7,_0x22d143){_0x22d143=_0x22d143||0xcc;return function(_0x1a68cf){if(_0x1a68cf){return _0x3d04d7[_0xb58a('0x19')](_0x22d143);}return _0x3d04d7['status'](_0x22d143)[_0xb58a('0x1a')]();};}function respondWithResult(_0x5b8443,_0x450dcf){_0x450dcf=_0x450dcf||0xc8;return function(_0x4131b1){if(_0x4131b1){return _0x5b8443[_0xb58a('0x1b')](_0x450dcf)[_0xb58a('0x1c')](_0x4131b1);}};}function respondWithFilteredResult(_0xb3ba0a,_0x464991){return function(_0x42d3d9){if(_0x42d3d9){var _0x48bac8=typeof _0x464991[_0xb58a('0x1d')]===_0xb58a('0x1e')&&typeof _0x464991[_0xb58a('0x1f')]===_0xb58a('0x1e');var _0x4a054e=_0x42d3d9[_0xb58a('0x20')];var _0x99aa29=_0x48bac8?0x0:_0x464991['offset'];var _0x4329ca=_0x48bac8?_0x42d3d9[_0xb58a('0x20')]:_0x464991[_0xb58a('0x1d')]+_0x464991['limit'];var _0x49d899;if(_0x4329ca>=_0x4a054e){_0x4329ca=_0x4a054e;_0x49d899=0xc8;}else{_0x49d899=0xce;}_0xb3ba0a[_0xb58a('0x1b')](_0x49d899);return _0xb3ba0a['set']('Content-Range',_0x99aa29+'-'+_0x4329ca+'/'+_0x4a054e)['json'](_0x42d3d9);}return null;};}function patchUpdates(_0x22895b){return function(_0x3fb0dc){try{jsonpatch[_0xb58a('0x21')](_0x3fb0dc,_0x22895b,!![]);}catch(_0x44fed4){return BPromise['reject'](_0x44fed4);}return _0x3fb0dc[_0xb58a('0x22')]();};}function saveUpdates(_0x51d271,_0x15a35d){return function(_0x4435f6){if(_0x4435f6){return _0x4435f6[_0xb58a('0x23')](_0x51d271)[_0xb58a('0x24')](function(_0x31f625){return _0x31f625;});}return null;};}function removeEntity(_0x3eb664,_0x2eb035){return function(_0x927f4){if(_0x927f4){return _0x927f4[_0xb58a('0x25')]()['then'](function(){_0x3eb664[_0xb58a('0x1b')](0xcc)[_0xb58a('0x1a')]();});}};}function handleEntityNotFound(_0x543212,_0x5a2254){return function(_0xa52543){if(!_0xa52543){_0x543212[_0xb58a('0x19')](0x194);}return _0xa52543;};}function handleError(_0x3e61a9,_0x1869bd){_0x1869bd=_0x1869bd||0x1f4;return function(_0x5d8923){logger[_0xb58a('0x26')](_0x5d8923[_0xb58a('0x27')]);if(_0x5d8923['name']){delete _0x5d8923[_0xb58a('0x28')];}_0x3e61a9[_0xb58a('0x1b')](_0x1869bd)[_0xb58a('0x29')](_0x5d8923);};}exports[_0xb58a('0x2a')]=function(_0x3ba89f,_0x5461bc){var _0x2ebf78={},_0x14c49f={},_0x58b57f={'count':0x0,'rows':[]};var _0x15a5e9=_['map'](db[_0xb58a('0x2b')]['rawAttributes'],function(_0x33cd88){return{'name':_0x33cd88['fieldName'],'type':_0x33cd88[_0xb58a('0x2c')][_0xb58a('0x2d')]};});_0x14c49f[_0xb58a('0x2e')]=_[_0xb58a('0x2f')](_0x15a5e9,_0xb58a('0x28'));_0x14c49f[_0xb58a('0x30')]=_[_0xb58a('0x31')](_0x3ba89f['query']);_0x14c49f[_0xb58a('0x32')]=_['intersection'](_0x14c49f[_0xb58a('0x2e')],_0x14c49f[_0xb58a('0x30')]);_0x2ebf78[_0xb58a('0x33')]=_[_0xb58a('0x34')](_0x14c49f[_0xb58a('0x2e')],qs[_0xb58a('0x35')](_0x3ba89f[_0xb58a('0x30')][_0xb58a('0x35')]));_0x2ebf78[_0xb58a('0x33')]=_0x2ebf78['attributes'][_0xb58a('0x36')]?_0x2ebf78[_0xb58a('0x33')]:_0x14c49f[_0xb58a('0x2e')];if(!_0x3ba89f['query'][_0xb58a('0x37')]('nolimit')){_0x2ebf78['limit']=qs[_0xb58a('0x1f')](_0x3ba89f[_0xb58a('0x30')][_0xb58a('0x1f')]);_0x2ebf78['offset']=qs[_0xb58a('0x1d')](_0x3ba89f['query'][_0xb58a('0x1d')]);}_0x2ebf78[_0xb58a('0x38')]=qs['sort'](_0x3ba89f[_0xb58a('0x30')]['sort']);_0x2ebf78[_0xb58a('0x39')]=qs[_0xb58a('0x32')](_[_0xb58a('0x3a')](_0x3ba89f[_0xb58a('0x30')],_0x14c49f[_0xb58a('0x32')]),_0x15a5e9);if(_0x3ba89f['query']['filter']){_0x2ebf78[_0xb58a('0x39')]=_[_0xb58a('0x3b')](_0x2ebf78['where'],{'$or':_['map'](_0x15a5e9,function(_0x397398){if(_0x397398['type']!=='VIRTUAL'){var _0x2c3442={};_0x2c3442[_0x397398[_0xb58a('0x28')]]={'$like':'%'+_0x3ba89f['query'][_0xb58a('0x3c')]+'%'};return _0x2c3442;}})});}_0x2ebf78=_['merge']({},_0x2ebf78,_0x3ba89f[_0xb58a('0x3d')]);var _0x471250={'where':_0x2ebf78[_0xb58a('0x39')]};return db[_0xb58a('0x2b')][_0xb58a('0x20')](_0x471250)[_0xb58a('0x24')](function(_0x21d22f){_0x58b57f['count']=_0x21d22f;if(_0x3ba89f[_0xb58a('0x30')][_0xb58a('0x3e')]){_0x2ebf78[_0xb58a('0x3f')]=[{'all':!![]}];}return db[_0xb58a('0x2b')][_0xb58a('0x40')](_0x2ebf78);})[_0xb58a('0x24')](function(_0x23e594){_0x58b57f[_0xb58a('0x41')]=_0x23e594;return _0x58b57f;})['then'](respondWithFilteredResult(_0x5461bc,_0x2ebf78))['catch'](handleError(_0x5461bc,null));};exports[_0xb58a('0x42')]=function(_0x2cc73f,_0x3a6626){var _0x689ca7={'raw':!![],'where':{'id':_0x2cc73f[_0xb58a('0x43')]['id']}},_0x39867d={};_0x39867d[_0xb58a('0x2e')]=_[_0xb58a('0x31')](db[_0xb58a('0x2b')]['rawAttributes']);_0x39867d['query']=_['keys'](_0x2cc73f['query']);_0x39867d[_0xb58a('0x32')]=_[_0xb58a('0x34')](_0x39867d[_0xb58a('0x2e')],_0x39867d[_0xb58a('0x30')]);_0x689ca7[_0xb58a('0x33')]=_[_0xb58a('0x34')](_0x39867d['model'],qs['fields'](_0x2cc73f[_0xb58a('0x30')]['fields']));_0x689ca7[_0xb58a('0x33')]=_0x689ca7[_0xb58a('0x33')][_0xb58a('0x36')]?_0x689ca7[_0xb58a('0x33')]:_0x39867d[_0xb58a('0x2e')];if(_0x2cc73f[_0xb58a('0x30')]['includeAll']){_0x689ca7[_0xb58a('0x3f')]=[{'all':!![]}];}_0x689ca7=_[_0xb58a('0x3b')]({},_0x689ca7,_0x2cc73f[_0xb58a('0x3d')]);return db['ZohoField']['find'](_0x689ca7)[_0xb58a('0x24')](handleEntityNotFound(_0x3a6626,null))['then'](respondWithResult(_0x3a6626,null))['catch'](handleError(_0x3a6626,null));};exports[_0xb58a('0x44')]=function(_0x3fb003,_0x448e89){return db[_0xb58a('0x2b')][_0xb58a('0x44')](_0x3fb003[_0xb58a('0x45')],{})[_0xb58a('0x24')](respondWithResult(_0x448e89,0xc9))[_0xb58a('0x46')](handleError(_0x448e89,null));};exports['update']=function(_0x2df8ed,_0x3c40f9){if(_0x2df8ed['body']['id']){delete _0x2df8ed[_0xb58a('0x45')]['id'];}return db[_0xb58a('0x2b')][_0xb58a('0x47')]({'where':{'id':_0x2df8ed[_0xb58a('0x43')]['id']}})[_0xb58a('0x24')](handleEntityNotFound(_0x3c40f9,null))[_0xb58a('0x24')](saveUpdates(_0x2df8ed[_0xb58a('0x45')],null))[_0xb58a('0x24')](respondWithResult(_0x3c40f9,null))[_0xb58a('0x46')](handleError(_0x3c40f9,null));};exports['destroy']=function(_0x5eba1c,_0x31c7bc){return db[_0xb58a('0x2b')][_0xb58a('0x47')]({'where':{'id':_0x5eba1c[_0xb58a('0x43')]['id']}})['then'](handleEntityNotFound(_0x31c7bc,null))[_0xb58a('0x24')](removeEntity(_0x31c7bc,null))[_0xb58a('0x46')](handleError(_0x31c7bc,null));}; \ No newline at end of file +var _0x7647=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','Content-Range','reject','save','update','then','destroy','error','stack','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','name','merge','options','ZohoField','include','findAll','rows','catch','rawAttributes','includeAll','create','body','params','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x3e81a6,_0xd4e7d7){var _0x3fc033=function(_0x3dc930){while(--_0x3dc930){_0x3e81a6['push'](_0x3e81a6['shift']());}};_0x3fc033(++_0xd4e7d7);}(_0x7647,0x12d));var _0x7764=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7647[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x7764('0x0'));var rimraf=require(_0x7764('0x1'));var zipdir=require(_0x7764('0x2'));var jsonpatch=require(_0x7764('0x3'));var rp=require(_0x7764('0x4'));var moment=require(_0x7764('0x5'));var BPromise=require(_0x7764('0x6'));var Mustache=require(_0x7764('0x7'));var util=require(_0x7764('0x8'));var path=require(_0x7764('0x9'));var sox=require(_0x7764('0xa'));var csv=require(_0x7764('0xb'));var ejs=require(_0x7764('0xc'));var fs=require('fs');var fs_extra=require(_0x7764('0xd'));var _=require(_0x7764('0xe'));var squel=require(_0x7764('0xf'));var crypto=require(_0x7764('0x10'));var jsforce=require(_0x7764('0x11'));var deskjs=require(_0x7764('0x12'));var toCsv=require('to-csv');var querystring=require(_0x7764('0x13'));var Papa=require(_0x7764('0x14'));var Redis=require(_0x7764('0x15'));var authService=require(_0x7764('0x16'));var qs=require(_0x7764('0x17'));var as=require(_0x7764('0x18'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7764('0x19'));var config=require(_0x7764('0x1a'));var licenseUtil=require(_0x7764('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x552656,_0x356aca){_0x356aca=_0x356aca||0xcc;return function(_0x20d42d){if(_0x20d42d){return _0x552656[_0x7764('0x1c')](_0x356aca);}return _0x552656['status'](_0x356aca)[_0x7764('0x1d')]();};}function respondWithResult(_0x4a9d67,_0x15827f){_0x15827f=_0x15827f||0xc8;return function(_0x450dea){if(_0x450dea){return _0x4a9d67[_0x7764('0x1e')](_0x15827f)[_0x7764('0x1f')](_0x450dea);}};}function respondWithFilteredResult(_0x1881ac,_0x150f54){return function(_0x291d3b){if(_0x291d3b){var _0x2c162e=typeof _0x150f54[_0x7764('0x20')]===_0x7764('0x21')&&typeof _0x150f54['limit']===_0x7764('0x21');var _0x51f8cc=_0x291d3b[_0x7764('0x22')];var _0x64509f=_0x2c162e?0x0:_0x150f54[_0x7764('0x20')];var _0x440b9d=_0x2c162e?_0x291d3b['count']:_0x150f54[_0x7764('0x20')]+_0x150f54['limit'];var _0x19a4f7;if(_0x440b9d>=_0x51f8cc){_0x440b9d=_0x51f8cc;_0x19a4f7=0xc8;}else{_0x19a4f7=0xce;}_0x1881ac[_0x7764('0x1e')](_0x19a4f7);return _0x1881ac['set'](_0x7764('0x23'),_0x64509f+'-'+_0x440b9d+'/'+_0x51f8cc)[_0x7764('0x1f')](_0x291d3b);}return null;};}function patchUpdates(_0x1652db){return function(_0x2917eb){try{jsonpatch['apply'](_0x2917eb,_0x1652db,!![]);}catch(_0x504f92){return BPromise[_0x7764('0x24')](_0x504f92);}return _0x2917eb[_0x7764('0x25')]();};}function saveUpdates(_0x53b96e,_0x39415f){return function(_0x235b99){if(_0x235b99){return _0x235b99[_0x7764('0x26')](_0x53b96e)[_0x7764('0x27')](function(_0x27df2b){return _0x27df2b;});}return null;};}function removeEntity(_0xa338f0,_0x59da12){return function(_0x2e4636){if(_0x2e4636){return _0x2e4636[_0x7764('0x28')]()[_0x7764('0x27')](function(){_0xa338f0['status'](0xcc)[_0x7764('0x1d')]();});}};}function handleEntityNotFound(_0x45d090,_0x1e93a5){return function(_0x2e8a2f){if(!_0x2e8a2f){_0x45d090[_0x7764('0x1c')](0x194);}return _0x2e8a2f;};}function handleError(_0x334c16,_0x39087d){_0x39087d=_0x39087d||0x1f4;return function(_0x56c2f7){logger[_0x7764('0x29')](_0x56c2f7[_0x7764('0x2a')]);if(_0x56c2f7['name']){delete _0x56c2f7['name'];}_0x334c16['status'](_0x39087d)[_0x7764('0x2b')](_0x56c2f7);};}exports[_0x7764('0x2c')]=function(_0x533c94,_0x212c42){var _0x33eee8={},_0x297cb1={},_0x43e6fb={'count':0x0,'rows':[]};var _0x5cf41a=_[_0x7764('0x2d')](db['ZohoField']['rawAttributes'],function(_0x419d14){return{'name':_0x419d14[_0x7764('0x2e')],'type':_0x419d14[_0x7764('0x2f')][_0x7764('0x30')]};});_0x297cb1[_0x7764('0x31')]=_[_0x7764('0x2d')](_0x5cf41a,'name');_0x297cb1['query']=_[_0x7764('0x32')](_0x533c94[_0x7764('0x33')]);_0x297cb1[_0x7764('0x34')]=_[_0x7764('0x35')](_0x297cb1[_0x7764('0x31')],_0x297cb1[_0x7764('0x33')]);_0x33eee8[_0x7764('0x36')]=_['intersection'](_0x297cb1[_0x7764('0x31')],qs[_0x7764('0x37')](_0x533c94[_0x7764('0x33')][_0x7764('0x37')]));_0x33eee8['attributes']=_0x33eee8[_0x7764('0x36')][_0x7764('0x38')]?_0x33eee8[_0x7764('0x36')]:_0x297cb1['model'];if(!_0x533c94[_0x7764('0x33')]['hasOwnProperty'](_0x7764('0x39'))){_0x33eee8[_0x7764('0x3a')]=qs[_0x7764('0x3a')](_0x533c94['query'][_0x7764('0x3a')]);_0x33eee8[_0x7764('0x20')]=qs[_0x7764('0x20')](_0x533c94[_0x7764('0x33')][_0x7764('0x20')]);}_0x33eee8[_0x7764('0x3b')]=qs[_0x7764('0x3c')](_0x533c94['query'][_0x7764('0x3c')]);_0x33eee8['where']=qs[_0x7764('0x34')](_[_0x7764('0x3d')](_0x533c94[_0x7764('0x33')],_0x297cb1[_0x7764('0x34')]),_0x5cf41a);if(_0x533c94[_0x7764('0x33')][_0x7764('0x3e')]){_0x33eee8[_0x7764('0x3f')]=_['merge'](_0x33eee8[_0x7764('0x3f')],{'$or':_[_0x7764('0x2d')](_0x5cf41a,function(_0x47d8bb){if(_0x47d8bb['type']!==_0x7764('0x40')){var _0x2f6818={};_0x2f6818[_0x47d8bb[_0x7764('0x41')]]={'$like':'%'+_0x533c94[_0x7764('0x33')]['filter']+'%'};return _0x2f6818;}})});}_0x33eee8=_[_0x7764('0x42')]({},_0x33eee8,_0x533c94[_0x7764('0x43')]);var _0x23f19d={'where':_0x33eee8['where']};return db[_0x7764('0x44')][_0x7764('0x22')](_0x23f19d)['then'](function(_0x339d68){_0x43e6fb[_0x7764('0x22')]=_0x339d68;if(_0x533c94[_0x7764('0x33')]['includeAll']){_0x33eee8[_0x7764('0x45')]=[{'all':!![]}];}return db[_0x7764('0x44')][_0x7764('0x46')](_0x33eee8);})[_0x7764('0x27')](function(_0x52de20){_0x43e6fb[_0x7764('0x47')]=_0x52de20;return _0x43e6fb;})[_0x7764('0x27')](respondWithFilteredResult(_0x212c42,_0x33eee8))[_0x7764('0x48')](handleError(_0x212c42,null));};exports['show']=function(_0x3533a5,_0x434605){var _0x2992fa={'raw':!![],'where':{'id':_0x3533a5['params']['id']}},_0x48d128={};_0x48d128['model']=_[_0x7764('0x32')](db[_0x7764('0x44')][_0x7764('0x49')]);_0x48d128[_0x7764('0x33')]=_['keys'](_0x3533a5[_0x7764('0x33')]);_0x48d128[_0x7764('0x34')]=_[_0x7764('0x35')](_0x48d128[_0x7764('0x31')],_0x48d128['query']);_0x2992fa[_0x7764('0x36')]=_[_0x7764('0x35')](_0x48d128['model'],qs[_0x7764('0x37')](_0x3533a5[_0x7764('0x33')]['fields']));_0x2992fa[_0x7764('0x36')]=_0x2992fa['attributes'][_0x7764('0x38')]?_0x2992fa[_0x7764('0x36')]:_0x48d128[_0x7764('0x31')];if(_0x3533a5[_0x7764('0x33')][_0x7764('0x4a')]){_0x2992fa[_0x7764('0x45')]=[{'all':!![]}];}_0x2992fa=_[_0x7764('0x42')]({},_0x2992fa,_0x3533a5[_0x7764('0x43')]);return db[_0x7764('0x44')]['find'](_0x2992fa)['then'](handleEntityNotFound(_0x434605,null))[_0x7764('0x27')](respondWithResult(_0x434605,null))[_0x7764('0x48')](handleError(_0x434605,null));};exports[_0x7764('0x4b')]=function(_0x166fe5,_0x260ba8){return db[_0x7764('0x44')]['create'](_0x166fe5[_0x7764('0x4c')],{})[_0x7764('0x27')](respondWithResult(_0x260ba8,0xc9))[_0x7764('0x48')](handleError(_0x260ba8,null));};exports[_0x7764('0x26')]=function(_0x24e742,_0x38dbd8){if(_0x24e742[_0x7764('0x4c')]['id']){delete _0x24e742[_0x7764('0x4c')]['id'];}return db['ZohoField']['find']({'where':{'id':_0x24e742[_0x7764('0x4d')]['id']}})[_0x7764('0x27')](handleEntityNotFound(_0x38dbd8,null))[_0x7764('0x27')](saveUpdates(_0x24e742[_0x7764('0x4c')],null))[_0x7764('0x27')](respondWithResult(_0x38dbd8,null))[_0x7764('0x48')](handleError(_0x38dbd8,null));};exports[_0x7764('0x28')]=function(_0x1264ac,_0x5d364f){return db['ZohoField'][_0x7764('0x4e')]({'where':{'id':_0x1264ac[_0x7764('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5d364f,null))[_0x7764('0x27')](removeEntity(_0x5d364f,null))[_0x7764('0x48')](handleError(_0x5d364f,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 6a8ccfb..28bd7a9 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 _0xadb5=['ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xadb5,0xad));var _0x5adb=function(_0xe25d69,_0x28142f){_0xe25d69=_0xe25d69-0x0;var _0x1f8ab1=_0xadb5[_0xe25d69];return _0x1f8ab1;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./intZohoField.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[{'name':_0x5adb('0xb'),'fields':[_0x5adb('0xc'),_0x5adb('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd046=['util','../../config/logger','api','bluebird','rimraf','./intZohoField.attributes','define','zoho_unique_index','idField'];(function(_0x19bfe9,_0x28c2da){var _0x3e4fee=function(_0x46ec88){while(--_0x46ec88){_0x19bfe9['push'](_0x19bfe9['shift']());}};_0x3e4fee(++_0x28c2da);}(_0xd046,0x129));var _0x6d04=function(_0x4faed3,_0x1fc8d4){_0x4faed3=_0x4faed3-0x0;var _0x4889bb=_0xd046[_0x4faed3];return _0x4889bb;};'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 diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index e7b6429..48e1310 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 _0xb841=['code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb841,0x118));var _0x1b84=function(_0x51413f,_0x2177d7){_0x51413f=_0x51413f-0x0;var _0x5dbbf5=_0xb841[_0x51413f];return _0x5dbbf5;};'use strict';var _=require(_0x1b84('0x0'));var util=require('util');var moment=require(_0x1b84('0x1'));var BPromise=require(_0x1b84('0x2'));var rs=require(_0x1b84('0x3'));var fs=require('fs');var Redis=require(_0x1b84('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b84('0x5'));var logger=require(_0x1b84('0x6'))(_0x1b84('0x7'));var config=require(_0x1b84('0x8'));var jayson=require(_0x1b84('0x9'));var client=jayson[_0x1b84('0xa')][_0x1b84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38ca37,_0xd5419e,_0x1c2796){return new BPromise(function(_0x342a9d,_0x3f7d5d){return client[_0x1b84('0xc')](_0x38ca37,_0x1c2796)['then'](function(_0x3bf861){logger['info'](_0x1b84('0xd'),_0xd5419e,_0x1b84('0xe'));logger[_0x1b84('0xf')](_0x1b84('0x10'),_0xd5419e,'request\x20sent',JSON[_0x1b84('0x11')](_0x3bf861));if(_0x3bf861[_0x1b84('0x12')]){if(_0x3bf861[_0x1b84('0x12')][_0x1b84('0x13')]===0x1f4){logger['error'](_0x1b84('0xd'),_0xd5419e,_0x3bf861['error']['message']);return _0x3f7d5d(_0x3bf861[_0x1b84('0x12')][_0x1b84('0x14')]);}logger['error'](_0x1b84('0xd'),_0xd5419e,_0x3bf861[_0x1b84('0x12')][_0x1b84('0x14')]);return _0x342a9d(_0x3bf861[_0x1b84('0x12')]['message']);}else{logger[_0x1b84('0x15')](_0x1b84('0xd'),_0xd5419e,_0x1b84('0xe'));_0x342a9d(_0x3bf861[_0x1b84('0x16')]['message']);}})['catch'](function(_0x5eb96e){logger[_0x1b84('0x12')](_0x1b84('0xd'),_0xd5419e,_0x5eb96e);_0x3f7d5d(_0x5eb96e);});});} \ No newline at end of file +var _0x80e3=['request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ZohoField,\x20%s,\x20%s'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x80e3,0x75));var _0x380e=function(_0x40ba70,_0x31b4ce){_0x40ba70=_0x40ba70-0x0;var _0x5b31a5=_0x80e3[_0x40ba70];return _0x5b31a5;};'use strict';var _=require(_0x380e('0x0'));var util=require(_0x380e('0x1'));var moment=require('moment');var BPromise=require(_0x380e('0x2'));var rs=require(_0x380e('0x3'));var fs=require('fs');var Redis=require(_0x380e('0x4'));var db=require(_0x380e('0x5'))['db'];var utils=require(_0x380e('0x6'));var logger=require(_0x380e('0x7'))('rpc');var config=require(_0x380e('0x8'));var jayson=require(_0x380e('0x9'));var client=jayson[_0x380e('0xa')][_0x380e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54b021,_0x19df20,_0x166ff7){return new BPromise(function(_0x112998,_0x50698b){return client['request'](_0x54b021,_0x166ff7)[_0x380e('0xc')](function(_0x2cb24a){logger[_0x380e('0xd')](_0x380e('0xe'),_0x19df20,_0x380e('0xf'));logger['debug'](_0x380e('0x10'),_0x19df20,_0x380e('0xf'),JSON['stringify'](_0x2cb24a));if(_0x2cb24a[_0x380e('0x11')]){if(_0x2cb24a[_0x380e('0x11')][_0x380e('0x12')]===0x1f4){logger[_0x380e('0x11')](_0x380e('0xe'),_0x19df20,_0x2cb24a[_0x380e('0x11')][_0x380e('0x13')]);return _0x50698b(_0x2cb24a[_0x380e('0x11')]['message']);}logger[_0x380e('0x11')](_0x380e('0xe'),_0x19df20,_0x2cb24a[_0x380e('0x11')]['message']);return _0x112998(_0x2cb24a[_0x380e('0x11')][_0x380e('0x13')]);}else{logger['info'](_0x380e('0xe'),_0x19df20,_0x380e('0xf'));_0x112998(_0x2cb24a[_0x380e('0x14')]['message']);}})[_0x380e('0x15')](function(_0x69faa4){logger[_0x380e('0x11')](_0x380e('0xe'),_0x19df20,_0x69faa4);_0x50698b(_0x69faa4);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index dabf99a..985eea1 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x427473,_0x5b5951){var _0x419e0f=function(_0x474910){while(--_0x474910){_0x427473['push'](_0x427473['shift']());}};_0x419e0f(++_0x5b5951);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x33080e,_0x1c600a){_0x33080e=_0x33080e-0x0;var _0x407395=_0xcb91[_0x33080e];return _0x407395;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1202a2,_0x2912d9){var _0x3a8ac6=function(_0x3fd5fe){while(--_0x3fd5fe){_0x1202a2['push'](_0x1202a2['shift']());}};_0x3a8ac6(++_0x2912d9);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 68e1c08..072cae4 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 _0x161d=['exports','STRING','unique_name_and_version','INTEGER','sequelize'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x161d,0x171));var _0xd161=function(_0x1df951,_0xb89e8e){_0x1df951=_0x1df951-0x0;var _0x27c50c=_0x161d[_0x1df951];return _0x27c50c;};'use strict';var Sequelize=require(_0xd161('0x0'));module[_0xd161('0x1')]={'name':{'type':Sequelize[_0xd161('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd161('0x3')},'main':{'type':Sequelize[_0xd161('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xd161('0x2')]},'path':{'type':Sequelize[_0xd161('0x2')]},'type':{'type':Sequelize[_0xd161('0x2')]},'size':{'type':Sequelize[_0xd161('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xd161('0x2')]},'logo':{'type':Sequelize[_0xd161('0x2')]},'state':{'type':Sequelize[_0xd161('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xd161('0x2')]},'title':{'type':Sequelize[_0xd161('0x2')]},'remoteUri':{'type':Sequelize[_0xd161('0x2')]},'link':{'type':Sequelize[_0xd161('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x26dc=['state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x26dc,0x1b9));var _0xc26d=function(_0x1fcef5,_0x16eb6f){_0x1fcef5=_0x1fcef5-0x0;var _0x9e7c1b=_0x26dc[_0x1fcef5];return _0x9e7c1b;};'use strict';var Sequelize=require(_0xc26d('0x0'));module[_0xc26d('0x1')]={'name':{'type':Sequelize[_0xc26d('0x2')],'allowNull':![],'unique':_0xc26d('0x3')},'version':{'type':Sequelize[_0xc26d('0x2')],'allowNull':![],'unique':_0xc26d('0x3')},'main':{'type':Sequelize[_0xc26d('0x2')],'defaultValue':_0xc26d('0x4')},'filename':{'type':Sequelize[_0xc26d('0x2')]},'path':{'type':Sequelize[_0xc26d('0x2')]},'type':{'type':Sequelize[_0xc26d('0x2')]},'size':{'type':Sequelize[_0xc26d('0x5')]},'active':{'type':Sequelize[_0xc26d('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xc26d('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0xc26d('0x7')},'description':{'type':Sequelize[_0xc26d('0x2')]},'title':{'type':Sequelize[_0xc26d('0x2')]},'remoteUri':{'type':Sequelize[_0xc26d('0x2')]},'link':{'type':Sequelize[_0xc26d('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 80cf041..e443e58 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 _0xc1c6=['type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','Integration','rawAttributes'];(function(_0x1c99f7,_0x14134f){var _0x443613=function(_0x129e02){while(--_0x129e02){_0x1c99f7['push'](_0x1c99f7['shift']());}};_0x443613(++_0x14134f);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x11ce99,_0x9ab527){_0x11ce99=_0x11ce99-0x0;var _0x5206c6=_0xc1c6[_0x11ce99];return _0x5206c6;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['Integration']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['Integration'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['Integration'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['Integration']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));}; \ No newline at end of file +var _0xdb28=['error','stack','name','send','index','Integration','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x580d88,_0x18a3b7){var _0x2ab01d=function(_0x2415ba){while(--_0x2415ba){_0x580d88['push'](_0x580d88['shift']());}};_0x2ab01d(++_0x18a3b7);}(_0xdb28,0x106));var _0x8db2=function(_0xfca0f,_0x4737b5){_0xfca0f=_0xfca0f-0x0;var _0x515631=_0xdb28[_0xfca0f];return _0x515631;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index b7f81bd..39d8136 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 _0x3c5d=['api','request-promise','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c5d,0x174));var _0xd3c5=function(_0x50d148,_0x98e59b){_0x50d148=_0x50d148-0x0;var _0x5fdc4d=_0x3c5d[_0x50d148];return _0x5fdc4d;};'use strict';var _=require(_0xd3c5('0x0'));var util=require('util');var logger=require(_0xd3c5('0x1'))(_0xd3c5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd3c5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3c5('0x4'));var config=require(_0xd3c5('0x5'));var attributes=require(_0xd3c5('0x6'));module[_0xd3c5('0x7')]=function(_0x517e84,_0x391195){return _0x517e84[_0xd3c5('0x8')](_0xd3c5('0x9'),attributes,{'tableName':_0xd3c5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x120b=['path','rimraf','../../config/environment','exports','Integration','integrations','util','api','moment','bluebird','request-promise'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x120b,0x8a));var _0xb120=function(_0x24cc49,_0x1ec295){_0x24cc49=_0x24cc49-0x0;var _0x5918a4=_0x120b[_0x24cc49];return _0x5918a4;};'use strict';var _=require('lodash');var util=require(_0xb120('0x0'));var logger=require('../../config/logger')(_0xb120('0x1'));var moment=require(_0xb120('0x2'));var BPromise=require(_0xb120('0x3'));var rp=require(_0xb120('0x4'));var fs=require('fs');var path=require(_0xb120('0x5'));var rimraf=require(_0xb120('0x6'));var config=require(_0xb120('0x7'));var attributes=require('./integration.attributes');module[_0xb120('0x8')]=function(_0x46f8d6,_0x244712){return _0x46f8d6['define'](_0xb120('0x9'),attributes,{'tableName':_0xb120('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 013d19e..a61649e 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 _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x5d0e5c,_0x1eb95f){var _0x2c4bd4=function(_0x5528dd){while(--_0x5528dd){_0x5d0e5c['push'](_0x5d0e5c['shift']());}};_0x2c4bd4(++_0x1eb95f);}(_0xda2d,0x102));var _0xdda2=function(_0x19bc2b,_0x39d493){_0x19bc2b=_0x19bc2b-0x0;var _0x28c6b9=_0xda2d[_0x19bc2b];return _0x28c6b9;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Integration,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file +var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x2c3a47,_0x170687){var _0x1c04de=function(_0x367deb){while(--_0x367deb){_0x2c3a47['push'](_0x2c3a47['shift']());}};_0x1c04de(++_0x170687);}(_0xda2d,0x102));var _0xdda2=function(_0x372c3e,_0x4ebb70){_0x372c3e=_0x372c3e-0x0;var _0x4b5b54=_0xda2d[_0x372c3e];return _0x4b5b54;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Integration,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index f030928..b1af24e 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 _0x955f=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0xf0c959,_0x223921){var _0xc006e8=function(_0x56c650){while(--_0x56c650){_0xf0c959['push'](_0xf0c959['shift']());}};_0xc006e8(++_0x223921);}(_0x955f,0x1eb));var _0xf955=function(_0x6944ba,_0x855e0e){_0x6944ba=_0x6944ba-0x0;var _0x1ff574=_0x955f[_0x6944ba];return _0x1ff574;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./integrationReport.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['put'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);router[_0xf955('0x10')](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./integrationReport.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['show']);router['post']('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router[_0x65f6('0xd')](_0x65f6('0xb'),auth['isAuthenticated'](),controller[_0x65f6('0xe')]);router['delete']('/:id',auth[_0x65f6('0x8')](),controller['destroy']);module[_0x65f6('0xf')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 5375bee..a21c195 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 _0xbf11=['TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x5a037a,_0x44a3fc){var _0x28ff57=function(_0x13d49f){while(--_0x13d49f){_0x5a037a['push'](_0x5a037a['shift']());}};_0x28ff57(++_0x44a3fc);}(_0xbf11,0x1f2));var _0x1bf1=function(_0x333752,_0x11b776){_0x333752=_0x333752-0x0;var _0x2c3de5=_0xbf11[_0x333752];return _0x2c3de5;};'use strict';var Sequelize=require(_0x1bf1('0x0'));module[_0x1bf1('0x1')]={'integration':{'type':Sequelize[_0x1bf1('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x1bf1('0x2')]},'uniqueid':{'type':Sequelize[_0x1bf1('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1bf1('0x2')]},'queue':{'type':Sequelize[_0x1bf1('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1bf1('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x1bf1('0x3')]},'holdtime':{'type':Sequelize[_0x1bf1('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x1bf1('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x1bf1('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1bf1('0x4')]},'reason':{'type':Sequelize[_0x1bf1('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x1bf1('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x1bf1('0x3')]},'agentdump':{'type':Sequelize[_0x1bf1('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x1bf1('0x3')]},'lastevent':{'type':Sequelize[_0x1bf1('0x2')]},'channel':{'type':Sequelize[_0x1bf1('0x2')]},'channelstate':{'type':Sequelize[_0x1bf1('0x4')]},'channelstatedesc':{'type':Sequelize[_0x1bf1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1bf1('0x2')]},'connectedlinename':{'type':Sequelize[_0x1bf1('0x2')]},'language':{'type':Sequelize[_0x1bf1('0x2')]},'accountcode':{'type':Sequelize[_0x1bf1('0x2')]},'context':{'type':Sequelize[_0x1bf1('0x2')]},'exten':{'type':Sequelize[_0x1bf1('0x2')]},'priority':{'type':Sequelize[_0x1bf1('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x1bf1('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x1bf1('0x2')]},'destcalleridnum':{'type':Sequelize[_0x1bf1('0x2')]},'destcalleridname':{'type':Sequelize[_0x1bf1('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x1bf1('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x1bf1('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x1bf1('0x2')]},'destexten':{'type':Sequelize[_0x1bf1('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x1bf1('0x2')]},'messageId':{'type':Sequelize[_0x1bf1('0x2')]},'inReplyTo':{'type':Sequelize[_0x1bf1('0x2')]},'subject':{'type':Sequelize[_0x1bf1('0x2')]},'from':{'type':Sequelize[_0x1bf1('0x2')]},'to':{'type':Sequelize[_0x1bf1('0x2')]},'cc':{'type':Sequelize[_0x1bf1('0x2')]},'attachment':{'type':Sequelize[_0x1bf1('0x6')]},'html':{'type':Sequelize[_0x1bf1('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x1bf1('0x7')](_0x1bf1('0x8'),_0x1bf1('0x9'),_0x1bf1('0xa'),_0x1bf1('0xb'))},'url':{'type':Sequelize[_0x1bf1('0x2')]},'app':{'type':Sequelize[_0x1bf1('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x1bf1('0x4')]}}; \ No newline at end of file +var _0x1988=['STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','RECEIVED','FAILED','sequelize','exports'];(function(_0x502a54,_0x1498b7){var _0xc9a31c=function(_0x8ff578){while(--_0x8ff578){_0x502a54['push'](_0x502a54['shift']());}};_0xc9a31c(++_0x1498b7);}(_0x1988,0x17a));var _0x8198=function(_0x1da22f,_0xdc13dc){_0x1da22f=_0x1da22f-0x0;var _0x8ea9d8=_0x1988[_0x1da22f];return _0x8ea9d8;};'use strict';var Sequelize=require(_0x8198('0x0'));module[_0x8198('0x1')]={'integration':{'type':Sequelize[_0x8198('0x2')]},'eventChannel':{'type':Sequelize[_0x8198('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x8198('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8198('0x2')]},'calleridnum':{'type':Sequelize[_0x8198('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8198('0x2')]},'interface':{'type':Sequelize[_0x8198('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x8198('0x4')]},'agentconnectAt':{'type':Sequelize[_0x8198('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8198('0x4')]},'talktime':{'type':Sequelize[_0x8198('0x3')]},'agentacw':{'type':Sequelize[_0x8198('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8198('0x3')]},'reason':{'type':Sequelize[_0x8198('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x8198('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8198('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8198('0x4')]},'lastevent':{'type':Sequelize[_0x8198('0x2')]},'channel':{'type':Sequelize[_0x8198('0x2')]},'channelstate':{'type':Sequelize[_0x8198('0x3')]},'channelstatedesc':{'type':Sequelize[_0x8198('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8198('0x2')]},'language':{'type':Sequelize[_0x8198('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8198('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8198('0x2')]},'destchannel':{'type':Sequelize[_0x8198('0x2')]},'destchannelstate':{'type':Sequelize[_0x8198('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x8198('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8198('0x2')]},'destcalleridname':{'type':Sequelize[_0x8198('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8198('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x8198('0x2')]},'destlanguage':{'type':Sequelize[_0x8198('0x2')]},'destaccountcode':{'type':Sequelize[_0x8198('0x2')]},'destcontext':{'type':Sequelize[_0x8198('0x2')]},'destexten':{'type':Sequelize[_0x8198('0x2')]},'destpriority':{'type':Sequelize[_0x8198('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x8198('0x2')]},'inReplyTo':{'type':Sequelize[_0x8198('0x2')]},'subject':{'type':Sequelize[_0x8198('0x2')]},'from':{'type':Sequelize[_0x8198('0x2')]},'to':{'type':Sequelize[_0x8198('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x8198('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x8198('0x6')]},'status':{'type':Sequelize['ENUM'](_0x8198('0x7'),'SENDING',_0x8198('0x8'),_0x8198('0x9'))},'url':{'type':Sequelize[_0x8198('0x2')]},'app':{'type':Sequelize[_0x8198('0x2')]},'appdata':{'type':Sequelize[_0x8198('0x2')]},'projectId':{'type':Sequelize[_0x8198('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index fe5610e..2a374da 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 _0x7e85=['offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create','body','describe','eml-format','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/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json'];(function(_0x35c836,_0x3479ee){var _0x5b8845=function(_0x430ea1){while(--_0x430ea1){_0x35c836['push'](_0x35c836['shift']());}};_0x5b8845(++_0x3479ee);}(_0x7e85,0x1b1));var _0x57e8=function(_0x585723,_0x25250e){_0x585723=_0x585723-0x0;var _0x54edcf=_0x7e85[_0x585723];return _0x54edcf;};'use strict';var emlformat=require(_0x57e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x57e8('0x1'));var jsonpatch=require(_0x57e8('0x2'));var rp=require(_0x57e8('0x3'));var moment=require(_0x57e8('0x4'));var BPromise=require(_0x57e8('0x5'));var Mustache=require(_0x57e8('0x6'));var util=require(_0x57e8('0x7'));var path=require('path');var sox=require(_0x57e8('0x8'));var csv=require('to-csv');var ejs=require(_0x57e8('0x9'));var fs=require('fs');var fs_extra=require(_0x57e8('0xa'));var _=require('lodash');var squel=require(_0x57e8('0xb'));var crypto=require(_0x57e8('0xc'));var jsforce=require(_0x57e8('0xd'));var deskjs=require(_0x57e8('0xe'));var toCsv=require(_0x57e8('0xf'));var querystring=require(_0x57e8('0x10'));var Papa=require(_0x57e8('0x11'));var Redis=require(_0x57e8('0x12'));var authService=require(_0x57e8('0x13'));var qs=require(_0x57e8('0x14'));var as=require(_0x57e8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x57e8('0x16'))(_0x57e8('0x17'));var utils=require(_0x57e8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x57e8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcc9c57,_0x45d0fd){_0x45d0fd=_0x45d0fd||0xcc;return function(_0x3a6e9d){if(_0x3a6e9d){return _0xcc9c57[_0x57e8('0x1a')](_0x45d0fd);}return _0xcc9c57['status'](_0x45d0fd)['end']();};}function respondWithResult(_0xf11327,_0x192c34){_0x192c34=_0x192c34||0xc8;return function(_0x595eef){if(_0x595eef){return _0xf11327[_0x57e8('0x1b')](_0x192c34)[_0x57e8('0x1c')](_0x595eef);}};}function respondWithFilteredResult(_0x3273cf,_0xa11f1e){return function(_0x4f9ad0){if(_0x4f9ad0){var _0x190882=typeof _0xa11f1e[_0x57e8('0x1d')]===_0x57e8('0x1e')&&typeof _0xa11f1e[_0x57e8('0x1f')]==='undefined';var _0xf36e81=_0x4f9ad0[_0x57e8('0x20')];var _0x461ffd=_0x190882?0x0:_0xa11f1e['offset'];var _0xd72a6e=_0x190882?_0x4f9ad0[_0x57e8('0x20')]:_0xa11f1e[_0x57e8('0x1d')]+_0xa11f1e[_0x57e8('0x1f')];var _0x193163;if(_0xd72a6e>=_0xf36e81){_0xd72a6e=_0xf36e81;_0x193163=0xc8;}else{_0x193163=0xce;}_0x3273cf[_0x57e8('0x1b')](_0x193163);return _0x3273cf[_0x57e8('0x21')](_0x57e8('0x22'),_0x461ffd+'-'+_0xd72a6e+'/'+_0xf36e81)['json'](_0x4f9ad0);}return null;};}function patchUpdates(_0x31ae0d){return function(_0x8c2303){try{jsonpatch['apply'](_0x8c2303,_0x31ae0d,!![]);}catch(_0x196f98){return BPromise[_0x57e8('0x23')](_0x196f98);}return _0x8c2303['save']();};}function saveUpdates(_0xb7a33e,_0x48fea7){return function(_0x1bfafa){if(_0x1bfafa){return _0x1bfafa[_0x57e8('0x24')](_0xb7a33e)[_0x57e8('0x25')](function(_0x948130){return _0x948130;});}return null;};}function removeEntity(_0x233f20,_0x48dc36){return function(_0x529ed9){if(_0x529ed9){return _0x529ed9[_0x57e8('0x26')]()[_0x57e8('0x25')](function(){_0x233f20[_0x57e8('0x1b')](0xcc)[_0x57e8('0x27')]();});}};}function handleEntityNotFound(_0x459877,_0x19fd45){return function(_0x113592){if(!_0x113592){_0x459877[_0x57e8('0x1a')](0x194);}return _0x113592;};}function handleError(_0x365923,_0x3419ec){_0x3419ec=_0x3419ec||0x1f4;return function(_0x4f5f0d){logger[_0x57e8('0x28')](_0x4f5f0d[_0x57e8('0x29')]);if(_0x4f5f0d[_0x57e8('0x2a')]){delete _0x4f5f0d['name'];}_0x365923[_0x57e8('0x1b')](_0x3419ec)[_0x57e8('0x2b')](_0x4f5f0d);};}exports[_0x57e8('0x2c')]=function(_0x272ee8,_0x1e1181){var _0x48e5ca={},_0x3d0125={},_0x329900={'count':0x0,'rows':[]};var _0x4ea782=_[_0x57e8('0x2d')](db[_0x57e8('0x2e')][_0x57e8('0x2f')],function(_0xef5427){return{'name':_0xef5427[_0x57e8('0x30')],'type':_0xef5427[_0x57e8('0x31')][_0x57e8('0x32')]};});_0x3d0125[_0x57e8('0x33')]=_['map'](_0x4ea782,_0x57e8('0x2a'));_0x3d0125[_0x57e8('0x34')]=_[_0x57e8('0x35')](_0x272ee8[_0x57e8('0x34')]);_0x3d0125[_0x57e8('0x36')]=_['intersection'](_0x3d0125['model'],_0x3d0125['query']);_0x48e5ca[_0x57e8('0x37')]=_[_0x57e8('0x38')](_0x3d0125[_0x57e8('0x33')],qs[_0x57e8('0x39')](_0x272ee8[_0x57e8('0x34')][_0x57e8('0x39')]));_0x48e5ca['attributes']=_0x48e5ca['attributes'][_0x57e8('0x3a')]?_0x48e5ca[_0x57e8('0x37')]:_0x3d0125[_0x57e8('0x33')];if(!_0x272ee8[_0x57e8('0x34')][_0x57e8('0x3b')](_0x57e8('0x3c'))){_0x48e5ca[_0x57e8('0x1f')]=qs['limit'](_0x272ee8['query']['limit']);_0x48e5ca['offset']=qs[_0x57e8('0x1d')](_0x272ee8[_0x57e8('0x34')][_0x57e8('0x1d')]);}_0x48e5ca['order']=qs['sort'](_0x272ee8[_0x57e8('0x34')][_0x57e8('0x3d')]);_0x48e5ca[_0x57e8('0x3e')]=qs[_0x57e8('0x36')](_[_0x57e8('0x3f')](_0x272ee8[_0x57e8('0x34')],_0x3d0125[_0x57e8('0x36')]),_0x4ea782);if(_0x272ee8[_0x57e8('0x34')][_0x57e8('0x40')]){_0x48e5ca[_0x57e8('0x3e')]=_['merge'](_0x48e5ca[_0x57e8('0x3e')],{'$or':_['map'](_0x4ea782,function(_0x240804){if(_0x240804[_0x57e8('0x31')]!==_0x57e8('0x41')){var _0x245064={};_0x245064[_0x240804[_0x57e8('0x2a')]]={'$like':'%'+_0x272ee8['query'][_0x57e8('0x40')]+'%'};return _0x245064;}})});}_0x48e5ca=_[_0x57e8('0x42')]({},_0x48e5ca,_0x272ee8[_0x57e8('0x43')]);var _0x5b319e={'where':_0x48e5ca[_0x57e8('0x3e')]};return db[_0x57e8('0x2e')][_0x57e8('0x20')](_0x5b319e)[_0x57e8('0x25')](function(_0x1c268a){_0x329900[_0x57e8('0x20')]=_0x1c268a;if(_0x272ee8[_0x57e8('0x34')][_0x57e8('0x44')]){_0x48e5ca[_0x57e8('0x45')]=[{'all':!![]}];}return db[_0x57e8('0x2e')]['findAll'](_0x48e5ca);})['then'](function(_0x4101e2){_0x329900[_0x57e8('0x46')]=_0x4101e2;return _0x329900;})[_0x57e8('0x25')](respondWithFilteredResult(_0x1e1181,_0x48e5ca))[_0x57e8('0x47')](handleError(_0x1e1181,null));};exports['show']=function(_0x31bbce,_0x351398){var _0x406a0={'raw':![],'where':{'id':_0x31bbce[_0x57e8('0x48')]['id']}},_0x4ab0d0={};_0x4ab0d0[_0x57e8('0x33')]=_['keys'](db['IntegrationReport'][_0x57e8('0x2f')]);_0x4ab0d0[_0x57e8('0x34')]=_[_0x57e8('0x35')](_0x31bbce[_0x57e8('0x34')]);_0x4ab0d0[_0x57e8('0x36')]=_[_0x57e8('0x38')](_0x4ab0d0['model'],_0x4ab0d0['query']);_0x406a0[_0x57e8('0x37')]=_[_0x57e8('0x38')](_0x4ab0d0[_0x57e8('0x33')],qs[_0x57e8('0x39')](_0x31bbce[_0x57e8('0x34')][_0x57e8('0x39')]));_0x406a0[_0x57e8('0x37')]=_0x406a0[_0x57e8('0x37')]['length']?_0x406a0[_0x57e8('0x37')]:_0x4ab0d0['model'];if(_0x31bbce[_0x57e8('0x34')][_0x57e8('0x44')]){_0x406a0['include']=[{'all':!![]}];}_0x406a0=_[_0x57e8('0x42')]({},_0x406a0,_0x31bbce[_0x57e8('0x43')]);return db[_0x57e8('0x2e')][_0x57e8('0x49')](_0x406a0)['then'](handleEntityNotFound(_0x351398,null))[_0x57e8('0x25')](respondWithResult(_0x351398,null))[_0x57e8('0x47')](handleError(_0x351398,null));};exports[_0x57e8('0x4a')]=function(_0x3a8b9f,_0x568aaf){return db[_0x57e8('0x2e')]['create'](_0x3a8b9f[_0x57e8('0x4b')],{})[_0x57e8('0x25')](respondWithResult(_0x568aaf,0xc9))[_0x57e8('0x47')](handleError(_0x568aaf,null));};exports['update']=function(_0x15d55e,_0x44ce3f){if(_0x15d55e[_0x57e8('0x4b')]['id']){delete _0x15d55e['body']['id'];}return db[_0x57e8('0x2e')][_0x57e8('0x49')]({'where':{'id':_0x15d55e['params']['id']}})[_0x57e8('0x25')](handleEntityNotFound(_0x44ce3f,null))[_0x57e8('0x25')](saveUpdates(_0x15d55e[_0x57e8('0x4b')],null))[_0x57e8('0x25')](respondWithResult(_0x44ce3f,null))['catch'](handleError(_0x44ce3f,null));};exports['destroy']=function(_0x190642,_0x5ba92b){return db[_0x57e8('0x2e')]['find']({'where':{'id':_0x190642[_0x57e8('0x48')]['id']}})[_0x57e8('0x25')](handleEntityNotFound(_0x5ba92b,null))[_0x57e8('0x25')](removeEntity(_0x5ba92b,null))[_0x57e8('0x47')](handleError(_0x5ba92b,null));};exports[_0x57e8('0x4c')]=function(_0x43304e,_0x369bb9){return db[_0x57e8('0x2e')][_0x57e8('0x4c')]()[_0x57e8('0x25')](respondWithResult(_0x369bb9,null))[_0x57e8('0x47')](handleError(_0x369bb9,null));}; \ No newline at end of file +var _0x18e6=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','update','then','destroy','error','stack','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','IntegrationReport','findAll','rows','show','find','create','body','params','catch','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x25426d,_0x15b9a4){var _0x22e1b4=function(_0x768880){while(--_0x768880){_0x25426d['push'](_0x25426d['shift']());}};_0x22e1b4(++_0x15b9a4);}(_0x18e6,0x123));var _0x618e=function(_0x2e3cf5,_0xd68ea0){_0x2e3cf5=_0x2e3cf5-0x0;var _0x389b3a=_0x18e6[_0x2e3cf5];return _0x389b3a;};'use strict';var emlformat=require(_0x618e('0x0'));var rimraf=require(_0x618e('0x1'));var zipdir=require(_0x618e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x618e('0x3'));var moment=require(_0x618e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x618e('0x5'));var path=require(_0x618e('0x6'));var sox=require(_0x618e('0x7'));var csv=require(_0x618e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x618e('0x9'));var _=require(_0x618e('0xa'));var squel=require(_0x618e('0xb'));var crypto=require(_0x618e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x618e('0xd'));var Redis=require(_0x618e('0xe'));var authService=require(_0x618e('0xf'));var qs=require(_0x618e('0x10'));var as=require(_0x618e('0x11'));var hardwareService=require(_0x618e('0x12'));var logger=require(_0x618e('0x13'))(_0x618e('0x14'));var utils=require(_0x618e('0x15'));var config=require(_0x618e('0x16'));var licenseUtil=require(_0x618e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x343e1d,_0x3dd5a9){_0x3dd5a9=_0x3dd5a9||0xcc;return function(_0x11d7fa){if(_0x11d7fa){return _0x343e1d['sendStatus'](_0x3dd5a9);}return _0x343e1d['status'](_0x3dd5a9)[_0x618e('0x18')]();};}function respondWithResult(_0x57acd7,_0x4a3733){_0x4a3733=_0x4a3733||0xc8;return function(_0x11a11f){if(_0x11a11f){return _0x57acd7[_0x618e('0x19')](_0x4a3733)['json'](_0x11a11f);}};}function respondWithFilteredResult(_0x431cda,_0x248989){return function(_0xffd894){if(_0xffd894){var _0x3a42ab=typeof _0x248989[_0x618e('0x1a')]==='undefined'&&typeof _0x248989[_0x618e('0x1b')]===_0x618e('0x1c');var _0x270d5c=_0xffd894[_0x618e('0x1d')];var _0x164fea=_0x3a42ab?0x0:_0x248989[_0x618e('0x1a')];var _0x134028=_0x3a42ab?_0xffd894['count']:_0x248989[_0x618e('0x1a')]+_0x248989[_0x618e('0x1b')];var _0x48379d;if(_0x134028>=_0x270d5c){_0x134028=_0x270d5c;_0x48379d=0xc8;}else{_0x48379d=0xce;}_0x431cda[_0x618e('0x19')](_0x48379d);return _0x431cda[_0x618e('0x1e')](_0x618e('0x1f'),_0x164fea+'-'+_0x134028+'/'+_0x270d5c)[_0x618e('0x20')](_0xffd894);}return null;};}function patchUpdates(_0x549ed0){return function(_0x49abfe){try{jsonpatch[_0x618e('0x21')](_0x49abfe,_0x549ed0,!![]);}catch(_0x3f0279){return BPromise['reject'](_0x3f0279);}return _0x49abfe['save']();};}function saveUpdates(_0x54c7e4,_0x534b79){return function(_0x42fab9){if(_0x42fab9){return _0x42fab9[_0x618e('0x22')](_0x54c7e4)[_0x618e('0x23')](function(_0xde5df9){return _0xde5df9;});}return null;};}function removeEntity(_0x453e69,_0x3419fe){return function(_0x5c01a8){if(_0x5c01a8){return _0x5c01a8[_0x618e('0x24')]()['then'](function(){_0x453e69[_0x618e('0x19')](0xcc)[_0x618e('0x18')]();});}};}function handleEntityNotFound(_0x136485,_0x535952){return function(_0x4657d2){if(!_0x4657d2){_0x136485['sendStatus'](0x194);}return _0x4657d2;};}function handleError(_0xe0b598,_0x3fac58){_0x3fac58=_0x3fac58||0x1f4;return function(_0x3266e1){logger[_0x618e('0x25')](_0x3266e1[_0x618e('0x26')]);if(_0x3266e1['name']){delete _0x3266e1['name'];}_0xe0b598[_0x618e('0x19')](_0x3fac58)[_0x618e('0x27')](_0x3266e1);};}exports[_0x618e('0x28')]=function(_0x1f06f5,_0x433b1f){var _0x3500cd={},_0x54a051={},_0x294585={'count':0x0,'rows':[]};var _0x2fab1c=_[_0x618e('0x29')](db['IntegrationReport'][_0x618e('0x2a')],function(_0x1737ed){return{'name':_0x1737ed['fieldName'],'type':_0x1737ed[_0x618e('0x2b')][_0x618e('0x2c')]};});_0x54a051[_0x618e('0x2d')]=_['map'](_0x2fab1c,_0x618e('0x2e'));_0x54a051[_0x618e('0x2f')]=_[_0x618e('0x30')](_0x1f06f5[_0x618e('0x2f')]);_0x54a051[_0x618e('0x31')]=_[_0x618e('0x32')](_0x54a051[_0x618e('0x2d')],_0x54a051['query']);_0x3500cd[_0x618e('0x33')]=_[_0x618e('0x32')](_0x54a051['model'],qs[_0x618e('0x34')](_0x1f06f5[_0x618e('0x2f')]['fields']));_0x3500cd[_0x618e('0x33')]=_0x3500cd[_0x618e('0x33')][_0x618e('0x35')]?_0x3500cd[_0x618e('0x33')]:_0x54a051[_0x618e('0x2d')];if(!_0x1f06f5[_0x618e('0x2f')][_0x618e('0x36')](_0x618e('0x37'))){_0x3500cd[_0x618e('0x1b')]=qs[_0x618e('0x1b')](_0x1f06f5[_0x618e('0x2f')]['limit']);_0x3500cd[_0x618e('0x1a')]=qs[_0x618e('0x1a')](_0x1f06f5['query']['offset']);}_0x3500cd[_0x618e('0x38')]=qs[_0x618e('0x39')](_0x1f06f5[_0x618e('0x2f')][_0x618e('0x39')]);_0x3500cd['where']=qs[_0x618e('0x31')](_[_0x618e('0x3a')](_0x1f06f5[_0x618e('0x2f')],_0x54a051[_0x618e('0x31')]),_0x2fab1c);if(_0x1f06f5[_0x618e('0x2f')][_0x618e('0x3b')]){_0x3500cd[_0x618e('0x3c')]=_[_0x618e('0x3d')](_0x3500cd[_0x618e('0x3c')],{'$or':_[_0x618e('0x29')](_0x2fab1c,function(_0x5c19e0){if(_0x5c19e0['type']!==_0x618e('0x3e')){var _0x216064={};_0x216064[_0x5c19e0['name']]={'$like':'%'+_0x1f06f5[_0x618e('0x2f')][_0x618e('0x3b')]+'%'};return _0x216064;}})});}_0x3500cd=_['merge']({},_0x3500cd,_0x1f06f5[_0x618e('0x3f')]);var _0x221458={'where':_0x3500cd['where']};return db['IntegrationReport'][_0x618e('0x1d')](_0x221458)['then'](function(_0x27bbdf){_0x294585[_0x618e('0x1d')]=_0x27bbdf;if(_0x1f06f5[_0x618e('0x2f')][_0x618e('0x40')]){_0x3500cd[_0x618e('0x41')]=[{'all':!![]}];}return db[_0x618e('0x42')][_0x618e('0x43')](_0x3500cd);})[_0x618e('0x23')](function(_0x428250){_0x294585[_0x618e('0x44')]=_0x428250;return _0x294585;})[_0x618e('0x23')](respondWithFilteredResult(_0x433b1f,_0x3500cd))['catch'](handleError(_0x433b1f,null));};exports[_0x618e('0x45')]=function(_0x2bbd5c,_0x229cc3){var _0x18f494={'raw':![],'where':{'id':_0x2bbd5c['params']['id']}},_0xaee18b={};_0xaee18b[_0x618e('0x2d')]=_[_0x618e('0x30')](db[_0x618e('0x42')]['rawAttributes']);_0xaee18b[_0x618e('0x2f')]=_[_0x618e('0x30')](_0x2bbd5c[_0x618e('0x2f')]);_0xaee18b[_0x618e('0x31')]=_[_0x618e('0x32')](_0xaee18b[_0x618e('0x2d')],_0xaee18b[_0x618e('0x2f')]);_0x18f494['attributes']=_['intersection'](_0xaee18b[_0x618e('0x2d')],qs[_0x618e('0x34')](_0x2bbd5c['query'][_0x618e('0x34')]));_0x18f494[_0x618e('0x33')]=_0x18f494[_0x618e('0x33')]['length']?_0x18f494['attributes']:_0xaee18b[_0x618e('0x2d')];if(_0x2bbd5c['query'][_0x618e('0x40')]){_0x18f494[_0x618e('0x41')]=[{'all':!![]}];}_0x18f494=_[_0x618e('0x3d')]({},_0x18f494,_0x2bbd5c[_0x618e('0x3f')]);return db[_0x618e('0x42')][_0x618e('0x46')](_0x18f494)[_0x618e('0x23')](handleEntityNotFound(_0x229cc3,null))[_0x618e('0x23')](respondWithResult(_0x229cc3,null))['catch'](handleError(_0x229cc3,null));};exports['create']=function(_0x597b03,_0xaadece){return db['IntegrationReport'][_0x618e('0x47')](_0x597b03[_0x618e('0x48')],{})['then'](respondWithResult(_0xaadece,0xc9))['catch'](handleError(_0xaadece,null));};exports[_0x618e('0x22')]=function(_0x589d04,_0x3c61fd){if(_0x589d04[_0x618e('0x48')]['id']){delete _0x589d04['body']['id'];}return db[_0x618e('0x42')][_0x618e('0x46')]({'where':{'id':_0x589d04[_0x618e('0x49')]['id']}})[_0x618e('0x23')](handleEntityNotFound(_0x3c61fd,null))[_0x618e('0x23')](saveUpdates(_0x589d04['body'],null))[_0x618e('0x23')](respondWithResult(_0x3c61fd,null))[_0x618e('0x4a')](handleError(_0x3c61fd,null));};exports[_0x618e('0x24')]=function(_0x3a842c,_0x5af804){return db[_0x618e('0x42')][_0x618e('0x46')]({'where':{'id':_0x3a842c['params']['id']}})['then'](handleEntityNotFound(_0x5af804,null))['then'](removeEntity(_0x5af804,null))[_0x618e('0x4a')](handleError(_0x5af804,null));};exports[_0x618e('0x4b')]=function(_0x3dae3f,_0x2e5a79){return db[_0x618e('0x42')][_0x618e('0x4b')]()[_0x618e('0x23')](respondWithResult(_0x2e5a79,null))['catch'](handleError(_0x2e5a79,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index b672450..bd49e48 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 _0x1ed9=['request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','../../config/logger','api','moment','bluebird'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1ed9,0xa3));var _0x91ed=function(_0x3d4022,_0x5ae979){_0x3d4022=_0x3d4022-0x0;var _0x5c560e=_0x1ed9[_0x3d4022];return _0x5c560e;};'use strict';var _=require('lodash');var util=require(_0x91ed('0x0'));var logger=require(_0x91ed('0x1'))(_0x91ed('0x2'));var moment=require(_0x91ed('0x3'));var BPromise=require(_0x91ed('0x4'));var rp=require(_0x91ed('0x5'));var fs=require('fs');var path=require(_0x91ed('0x6'));var rimraf=require(_0x91ed('0x7'));var config=require(_0x91ed('0x8'));var attributes=require(_0x91ed('0x9'));module[_0x91ed('0xa')]=function(_0x4d8efd,_0x4f6c44){return _0x4d8efd[_0x91ed('0xb')](_0x91ed('0xc'),attributes,{'tableName':_0x91ed('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x363a=['rimraf','define','IntegrationReport','report_integration','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x42b3e6,_0x17971d){var _0x159e9c=function(_0x2bc10d){while(--_0x2bc10d){_0x42b3e6['push'](_0x42b3e6['shift']());}};_0x159e9c(++_0x17971d);}(_0x363a,0x112));var _0xa363=function(_0x1eed52,_0x1bb3c1){_0x1eed52=_0x1eed52-0x0;var _0x57782a=_0x363a[_0x1eed52];return _0x57782a;};'use strict';var _=require(_0xa363('0x0'));var util=require('util');var logger=require(_0xa363('0x1'))('api');var moment=require(_0xa363('0x2'));var BPromise=require(_0xa363('0x3'));var rp=require(_0xa363('0x4'));var fs=require('fs');var path=require(_0xa363('0x5'));var rimraf=require(_0xa363('0x6'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module['exports']=function(_0x4c4f0f,_0x4728b4){return _0x4c4f0f[_0xa363('0x7')](_0xa363('0x8'),attributes,{'tableName':_0xa363('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index a3d88c7..1904512 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 _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x31294d,_0x171296){var _0x47231b=function(_0x4be0c2){while(--_0x4be0c2){_0x31294d['push'](_0x31294d['shift']());}};_0x47231b(++_0x171296);}(_0x187d,0x93));var _0xd187=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x187d[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0xf494,0x1c6));var _0x4f49=function(_0x1c0e09,_0x109a80){_0x1c0e09=_0x1c0e09-0x0;var _0x29363c=_0xf494[_0x1c0e09];return _0x29363c;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 8cae9e7..adaf744 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 _0x9f7a=['getIntervals','create','addInterval','post','/:id/sub_intervals/create_many','addIntervals','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','../../config/environment','./interval.controller','index','show','/:id/sub_intervals','isAuthenticated'];(function(_0x489c95,_0x53159c){var _0x10e7a7=function(_0xcb4342){while(--_0xcb4342){_0x489c95['push'](_0x489c95['shift']());}};_0x10e7a7(++_0x53159c);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x9f7a[_0x47aa64];return _0x549c7a;};'use strict';var multer=require(_0xa9f7('0x0'));var util=require(_0xa9f7('0x1'));var path=require(_0xa9f7('0x2'));var timeout=require(_0xa9f7('0x3'));var express=require('express');var router=express[_0xa9f7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa9f7('0x5'));var controller=require(_0xa9f7('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa9f7('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa9f7('0x8')]);router['get'](_0xa9f7('0x9'),auth[_0xa9f7('0xa')](),controller[_0xa9f7('0xb')]);router['post']('/',auth[_0xa9f7('0xa')](),controller[_0xa9f7('0xc')]);router['post'](_0xa9f7('0x9'),auth[_0xa9f7('0xa')](),controller[_0xa9f7('0xd')]);router[_0xa9f7('0xe')](_0xa9f7('0xf'),auth[_0xa9f7('0xa')](),controller[_0xa9f7('0x10')]);router['put'](_0xa9f7('0x11'),auth['isAuthenticated'](),controller[_0xa9f7('0x12')]);router[_0xa9f7('0x13')](_0xa9f7('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xa9f7('0x14')]=router; \ No newline at end of file +var _0x6363=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','update','delete'];(function(_0x34f1e7,_0x566996){var _0x8155d2=function(_0x5b59b6){while(--_0x5b59b6){_0x34f1e7['push'](_0x34f1e7['shift']());}};_0x8155d2(++_0x566996);}(_0x6363,0x13a));var _0x3636=function(_0x1e1dec,_0x663930){_0x1e1dec=_0x1e1dec-0x0;var _0x2b7c43=_0x6363[_0x1e1dec];return _0x2b7c43;};'use strict';var multer=require(_0x3636('0x0'));var util=require('util');var path=require(_0x3636('0x1'));var timeout=require(_0x3636('0x2'));var express=require(_0x3636('0x3'));var router=express[_0x3636('0x4')]();var fs_extra=require(_0x3636('0x5'));var auth=require(_0x3636('0x6'));var interaction=require(_0x3636('0x7'));var config=require(_0x3636('0x8'));var controller=require(_0x3636('0x9'));router[_0x3636('0xa')]('/',auth[_0x3636('0xb')](),controller[_0x3636('0xc')]);router[_0x3636('0xa')](_0x3636('0xd'),auth['isAuthenticated'](),controller[_0x3636('0xe')]);router['get'](_0x3636('0xf'),auth[_0x3636('0xb')](),controller[_0x3636('0x10')]);router[_0x3636('0x11')]('/',auth[_0x3636('0xb')](),controller[_0x3636('0x12')]);router[_0x3636('0x11')](_0x3636('0xf'),auth[_0x3636('0xb')](),controller['addInterval']);router['post'](_0x3636('0x13'),auth['isAuthenticated'](),controller[_0x3636('0x14')]);router[_0x3636('0x15')](_0x3636('0xd'),auth[_0x3636('0xb')](),controller[_0x3636('0x16')]);router[_0x3636('0x17')](_0x3636('0xd'),auth[_0x3636('0xb')](),controller[_0x3636('0x18')]);module[_0x3636('0x19')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index b555645..9ccf01d 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 _0xa09f=['sequelize','exports','STRING'];(function(_0x560330,_0x7b1661){var _0x37d254=function(_0x4ebea2){while(--_0x4ebea2){_0x560330['push'](_0x560330['shift']());}};_0x37d254(++_0x7b1661);}(_0xa09f,0x198));var _0xfa09=function(_0x58e423,_0x5b76d2){_0x58e423=_0x58e423-0x0;var _0x4db656=_0xa09f[_0x58e423];return _0x4db656;};'use strict';var Sequelize=require(_0xfa09('0x0'));module[_0xfa09('0x1')]={'name':{'type':Sequelize[_0xfa09('0x2')]},'description':{'type':Sequelize[_0xfa09('0x2')]},'interval':{'type':Sequelize[_0xfa09('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x2fcc=['STRING','exports'];(function(_0x117ec1,_0x533e8f){var _0x2a6c36=function(_0x373739){while(--_0x373739){_0x117ec1['push'](_0x117ec1['shift']());}};_0x2a6c36(++_0x533e8f);}(_0x2fcc,0x18b));var _0xc2fc=function(_0x8db3d4,_0xab1fdb){_0x8db3d4=_0x8db3d4-0x0;var _0x5e7882=_0x2fcc[_0x8db3d4];return _0x5e7882;};'use strict';var Sequelize=require('sequelize');module[_0xc2fc('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc2fc('0x1')]},'interval':{'type':Sequelize[_0xc2fc('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index f0478a1..7f0ccef 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 _0xc07e=['json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','Intervals','UserProfileResource','sendStatus','stack','name','send','index','map','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','Interval','findAll','rows','show','params','length','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','IntervalId','rawAttributes','order','pick','getIntervals','addIntervals','findOne','sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/extensions/rewrite','status','end'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0xc07e,0xf4));var _0xec07=function(_0x4a925f,_0x2c8f90){_0x4a925f=_0x4a925f-0x0;var _0x19ab6a=_0xc07e[_0x4a925f];return _0x19ab6a;};'use strict';var emlformat=require(_0xec07('0x0'));var rimraf=require(_0xec07('0x1'));var zipdir=require(_0xec07('0x2'));var jsonpatch=require(_0xec07('0x3'));var rp=require(_0xec07('0x4'));var moment=require(_0xec07('0x5'));var BPromise=require(_0xec07('0x6'));var Mustache=require(_0xec07('0x7'));var util=require(_0xec07('0x8'));var path=require(_0xec07('0x9'));var sox=require(_0xec07('0xa'));var csv=require('to-csv');var ejs=require(_0xec07('0xb'));var fs=require('fs');var fs_extra=require(_0xec07('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xec07('0xd'));var jsforce=require(_0xec07('0xe'));var deskjs=require(_0xec07('0xf'));var toCsv=require(_0xec07('0x10'));var querystring=require(_0xec07('0x11'));var Papa=require(_0xec07('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xec07('0x13'));var as=require(_0xec07('0x14'));var hardwareService=require(_0xec07('0x15'));var logger=require(_0xec07('0x16'))(_0xec07('0x17'));var utils=require('../../config/utils');var config=require(_0xec07('0x18'));var licenseUtil=require(_0xec07('0x19'));var db=require('../../mysqldb')['db'];var extensions=require(_0xec07('0x1a'));function respondWithStatusCode(_0x12e8d3,_0x3a0aed){_0x3a0aed=_0x3a0aed||0xcc;return function(_0x5d4fc7){if(_0x5d4fc7){return _0x12e8d3['sendStatus'](_0x3a0aed);}return _0x12e8d3[_0xec07('0x1b')](_0x3a0aed)[_0xec07('0x1c')]();};}function respondWithResult(_0x2eb52a,_0x58273a){_0x58273a=_0x58273a||0xc8;return function(_0x49f4e9){if(_0x49f4e9){return _0x2eb52a[_0xec07('0x1b')](_0x58273a)[_0xec07('0x1d')](_0x49f4e9);}};}function respondWithFilteredResult(_0x346b58,_0x444935){return function(_0x33e077){if(_0x33e077){var _0x1ef53c=typeof _0x444935[_0xec07('0x1e')]===_0xec07('0x1f')&&typeof _0x444935[_0xec07('0x20')]===_0xec07('0x1f');var _0x7fe802=_0x33e077[_0xec07('0x21')];var _0x3336c3=_0x1ef53c?0x0:_0x444935[_0xec07('0x1e')];var _0xd9ef67=_0x1ef53c?_0x33e077[_0xec07('0x21')]:_0x444935[_0xec07('0x1e')]+_0x444935[_0xec07('0x20')];var _0x195dbd;if(_0xd9ef67>=_0x7fe802){_0xd9ef67=_0x7fe802;_0x195dbd=0xc8;}else{_0x195dbd=0xce;}_0x346b58[_0xec07('0x1b')](_0x195dbd);return _0x346b58['set'](_0xec07('0x22'),_0x3336c3+'-'+_0xd9ef67+'/'+_0x7fe802)[_0xec07('0x1d')](_0x33e077);}return null;};}function patchUpdates(_0xd7a30c){return function(_0x339cba){try{jsonpatch['apply'](_0x339cba,_0xd7a30c,!![]);}catch(_0x49242b){return BPromise[_0xec07('0x23')](_0x49242b);}return _0x339cba[_0xec07('0x24')]();};}function saveUpdates(_0x2ec0be,_0x346065){return function(_0x464330){if(_0x464330){return _0x464330[_0xec07('0x25')](_0x2ec0be)[_0xec07('0x26')](function(_0x38c7ae){return _0x38c7ae;});}return null;};}function removeEntity(_0x3d6fa3,_0x1e6bed){return function(_0xa9a143){if(_0xa9a143){return _0xa9a143[_0xec07('0x27')]()[_0xec07('0x26')](function(){var _0x57f0f1=_0xa9a143[_0xec07('0x28')]({'plain':!![]});var _0x8cb18e=_0xec07('0x29');return db[_0xec07('0x2a')][_0xec07('0x27')]({'where':{'type':_0x8cb18e,'resourceId':_0x57f0f1['id']}})['then'](function(){return _0xa9a143;});})[_0xec07('0x26')](function(){_0x3d6fa3[_0xec07('0x1b')](0xcc)[_0xec07('0x1c')]();});}};}function handleEntityNotFound(_0x113e94,_0x1cc9fe){return function(_0x38c3b8){if(!_0x38c3b8){_0x113e94[_0xec07('0x2b')](0x194);}return _0x38c3b8;};}function handleError(_0xd4b70b,_0x206311){_0x206311=_0x206311||0x1f4;return function(_0x5e1abe){logger['error'](_0x5e1abe[_0xec07('0x2c')]);if(_0x5e1abe[_0xec07('0x2d')]){delete _0x5e1abe[_0xec07('0x2d')];}_0xd4b70b[_0xec07('0x1b')](_0x206311)[_0xec07('0x2e')](_0x5e1abe);};}exports[_0xec07('0x2f')]=function(_0x1ee55f,_0xc63351){var _0x1d292b={},_0x4a48c0={},_0x41b1b2={'count':0x0,'rows':[]};var _0x545f80=_[_0xec07('0x30')](db['Interval']['rawAttributes'],function(_0x2c2f27){return{'name':_0x2c2f27[_0xec07('0x31')],'type':_0x2c2f27[_0xec07('0x32')]['key']};});_0x4a48c0[_0xec07('0x33')]=_[_0xec07('0x30')](_0x545f80,_0xec07('0x2d'));_0x4a48c0['query']=_[_0xec07('0x34')](_0x1ee55f[_0xec07('0x35')]);_0x4a48c0[_0xec07('0x36')]=_[_0xec07('0x37')](_0x4a48c0[_0xec07('0x33')],_0x4a48c0[_0xec07('0x35')]);_0x1d292b['attributes']=_['intersection'](_0x4a48c0[_0xec07('0x33')],qs['fields'](_0x1ee55f[_0xec07('0x35')][_0xec07('0x38')]));_0x1d292b[_0xec07('0x39')]=_0x1d292b[_0xec07('0x39')]['length']?_0x1d292b[_0xec07('0x39')]:_0x4a48c0['model'];if(!_0x1ee55f['query'][_0xec07('0x3a')](_0xec07('0x3b'))){_0x1d292b[_0xec07('0x20')]=qs[_0xec07('0x20')](_0x1ee55f['query']['limit']);_0x1d292b[_0xec07('0x1e')]=qs[_0xec07('0x1e')](_0x1ee55f[_0xec07('0x35')][_0xec07('0x1e')]);}_0x1d292b['order']=qs[_0xec07('0x3c')](_0x1ee55f[_0xec07('0x35')][_0xec07('0x3c')]);_0x1d292b[_0xec07('0x3d')]=qs[_0xec07('0x36')](_['pick'](_0x1ee55f[_0xec07('0x35')],_0x4a48c0[_0xec07('0x36')]),_0x545f80);if(_0x1ee55f['query']['filter']){_0x1d292b[_0xec07('0x3d')]=_[_0xec07('0x3e')](_0x1d292b[_0xec07('0x3d')],{'$or':_['map'](_0x545f80,function(_0x1de8ce){if(_0x1de8ce[_0xec07('0x32')]!==_0xec07('0x3f')){var _0x2c14b1={};_0x2c14b1[_0x1de8ce[_0xec07('0x2d')]]={'$like':'%'+_0x1ee55f[_0xec07('0x35')][_0xec07('0x40')]+'%'};return _0x2c14b1;}})});}_0x1d292b=_[_0xec07('0x3e')]({},_0x1d292b,_0x1ee55f[_0xec07('0x41')]);var _0x4cdb9e={'where':_0x1d292b[_0xec07('0x3d')]};return db['Interval'][_0xec07('0x21')](_0x4cdb9e)[_0xec07('0x26')](function(_0x586643){_0x41b1b2[_0xec07('0x21')]=_0x586643;if(_0x1ee55f['query']['includeAll']){_0x1d292b['include']=[{'all':!![]}];}return db[_0xec07('0x42')][_0xec07('0x43')](_0x1d292b);})[_0xec07('0x26')](function(_0x22d93c){_0x41b1b2[_0xec07('0x44')]=_0x22d93c;return _0x41b1b2;})[_0xec07('0x26')](respondWithFilteredResult(_0xc63351,_0x1d292b))['catch'](handleError(_0xc63351,null));};exports[_0xec07('0x45')]=function(_0x3a28ec,_0x4ce113){var _0x84d986={'raw':!![],'where':{'id':_0x3a28ec[_0xec07('0x46')]['id']}},_0x3be2ab={};_0x3be2ab[_0xec07('0x33')]=_[_0xec07('0x34')](db['Interval']['rawAttributes']);_0x3be2ab[_0xec07('0x35')]=_['keys'](_0x3a28ec['query']);_0x3be2ab[_0xec07('0x36')]=_[_0xec07('0x37')](_0x3be2ab['model'],_0x3be2ab[_0xec07('0x35')]);_0x84d986[_0xec07('0x39')]=_[_0xec07('0x37')](_0x3be2ab['model'],qs['fields'](_0x3a28ec[_0xec07('0x35')][_0xec07('0x38')]));_0x84d986[_0xec07('0x39')]=_0x84d986[_0xec07('0x39')][_0xec07('0x47')]?_0x84d986[_0xec07('0x39')]:_0x3be2ab[_0xec07('0x33')];if(_0x3a28ec[_0xec07('0x35')]['includeAll']){_0x84d986[_0xec07('0x48')]=[{'all':!![]}];}_0x84d986=_['merge']({},_0x84d986,_0x3a28ec[_0xec07('0x41')]);return db['Interval'][_0xec07('0x49')](_0x84d986)[_0xec07('0x26')](handleEntityNotFound(_0x4ce113,null))['then'](respondWithResult(_0x4ce113,null))[_0xec07('0x4a')](handleError(_0x4ce113,null));};exports[_0xec07('0x4b')]=function(_0x4ea02a,_0x2808ce){return db[_0xec07('0x42')][_0xec07('0x4b')](_0x4ea02a[_0xec07('0x4c')],{})['then'](function(_0x16707b){var _0x2df12e=_0x4ea02a['user']['get']({'plain':!![]});if(!_0x2df12e)throw new Error(_0xec07('0x4d'));if(_0x2df12e[_0xec07('0x4e')]==='user'){var _0x1e2a9b=_0x16707b[_0xec07('0x28')]({'plain':!![]});var _0x18d549=_0xec07('0x29');return db[_0xec07('0x4f')][_0xec07('0x49')]({'where':{'name':_0x18d549,'userProfileId':_0x2df12e[_0xec07('0x50')]},'raw':!![]})[_0xec07('0x26')](function(_0x4a893a){if(_0x4a893a&&_0x4a893a[_0xec07('0x51')]===0x0){return db[_0xec07('0x2a')][_0xec07('0x4b')]({'name':_0x1e2a9b['name'],'resourceId':_0x1e2a9b['id'],'type':_0x4a893a[_0xec07('0x2d')],'sectionId':_0x4a893a['id']},{})[_0xec07('0x26')](function(){return _0x16707b;});}else{return _0x16707b;}})[_0xec07('0x4a')](function(_0x4fb3f4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fb3f4);throw _0x4fb3f4;});}return _0x16707b;})['then'](respondWithResult(_0x2808ce,0xc9))[_0xec07('0x4a')](handleError(_0x2808ce,null));};exports[_0xec07('0x25')]=function(_0x32d9d8,_0x3a7ecf){if(_0x32d9d8[_0xec07('0x4c')]['id']){delete _0x32d9d8[_0xec07('0x4c')]['id'];}return db[_0xec07('0x42')][_0xec07('0x49')]({'where':{'id':_0x32d9d8[_0xec07('0x46')]['id']}})[_0xec07('0x26')](handleEntityNotFound(_0x3a7ecf,null))['then'](saveUpdates(_0x32d9d8['body'],null))[_0xec07('0x26')](respondWithResult(_0x3a7ecf,null))[_0xec07('0x4a')](handleError(_0x3a7ecf,null));};exports[_0xec07('0x27')]=function(_0x2193db,_0x402635){return db['Interval']['find']({'where':{'id':_0x2193db['params']['id']}})['then'](handleEntityNotFound(_0x402635,null))[_0xec07('0x26')](removeEntity(_0x402635,null))[_0xec07('0x4a')](handleError(_0x402635,null));};exports['addInterval']=function(_0x3be561,_0xb63511,_0x136f1d){if(_0x3be561[_0xec07('0x4c')]['id']){delete _0x3be561[_0xec07('0x4c')]['id'];}return db[_0xec07('0x42')][_0xec07('0x49')]({'where':{'id':_0x3be561[_0xec07('0x46')]['id']}})['then'](handleEntityNotFound(_0xb63511,null))[_0xec07('0x26')](function(_0x4aaba1){if(_0x4aaba1){_0x3be561[_0xec07('0x4c')][_0xec07('0x52')]=_0x4aaba1['id'];return db[_0xec07('0x42')][_0xec07('0x4b')](_0x3be561[_0xec07('0x4c')]);}})[_0xec07('0x26')](respondWithResult(_0xb63511,null))[_0xec07('0x4a')](handleError(_0xb63511,null));};exports['getIntervals']=function(_0x1ad907,_0x284910,_0x1be321){var _0x54fad3={};var _0x3de768={};var _0x3d1926;var _0x5a2a4a;return db['Interval']['findOne']({'where':{'id':_0x1ad907[_0xec07('0x46')]['id']}})[_0xec07('0x26')](handleEntityNotFound(_0x284910,null))[_0xec07('0x26')](function(_0xb51fa6){if(_0xb51fa6){_0x3d1926=_0xb51fa6;_0x3de768[_0xec07('0x33')]=_['keys'](db['Interval'][_0xec07('0x53')]);_0x3de768[_0xec07('0x35')]=_[_0xec07('0x34')](_0x1ad907['query']);_0x3de768[_0xec07('0x36')]=_[_0xec07('0x37')](_0x3de768[_0xec07('0x33')],_0x3de768[_0xec07('0x35')]);_0x54fad3[_0xec07('0x39')]=_[_0xec07('0x37')](_0x3de768[_0xec07('0x33')],qs[_0xec07('0x38')](_0x1ad907[_0xec07('0x35')][_0xec07('0x38')]));_0x54fad3[_0xec07('0x39')]=_0x54fad3[_0xec07('0x39')][_0xec07('0x47')]?_0x54fad3[_0xec07('0x39')]:_0x3de768[_0xec07('0x33')];_0x54fad3[_0xec07('0x54')]=qs[_0xec07('0x3c')](_0x1ad907['query'][_0xec07('0x3c')]);_0x54fad3[_0xec07('0x3d')]=qs['filters'](_[_0xec07('0x55')](_0x1ad907[_0xec07('0x35')],_0x3de768[_0xec07('0x36')]));if(_0x1ad907[_0xec07('0x35')][_0xec07('0x40')]){_0x54fad3[_0xec07('0x3d')]=_[_0xec07('0x3e')](_0x54fad3['where'],{'$or':_[_0xec07('0x30')](_0x54fad3['attributes'],function(_0x4e3166){var _0x16baab={};_0x16baab[_0x4e3166]={'$like':'%'+_0x1ad907[_0xec07('0x35')][_0xec07('0x40')]+'%'};return _0x16baab;})});}_0x54fad3=_['merge']({},_0x54fad3,_0x1ad907[_0xec07('0x41')]);return _0x3d1926[_0xec07('0x56')](_0x54fad3);}})['then'](function(_0x41530a){if(_0x41530a){_0x5a2a4a=_0x41530a[_0xec07('0x47')];if(!_0x1ad907[_0xec07('0x35')][_0xec07('0x3a')]('nolimit')){_0x54fad3['limit']=qs['limit'](_0x1ad907[_0xec07('0x35')][_0xec07('0x20')]);_0x54fad3['offset']=qs[_0xec07('0x1e')](_0x1ad907[_0xec07('0x35')][_0xec07('0x1e')]);}return _0x3d1926['getIntervals'](_0x54fad3);}})[_0xec07('0x26')](function(_0x350a91){if(_0x350a91){return _0x350a91?{'count':_0x5a2a4a,'rows':_0x350a91}:null;}})[_0xec07('0x26')](respondWithResult(_0x284910,null))[_0xec07('0x4a')](handleError(_0x284910,null));};exports[_0xec07('0x57')]=function(_0x1868f1,_0x3345e7,_0x1d48bb){return db[_0xec07('0x42')][_0xec07('0x58')]({'where':{'id':_0x1868f1[_0xec07('0x46')]['id']}})['then'](handleEntityNotFound(_0x3345e7,null))[_0xec07('0x26')](function(_0x11d212){if(_0x11d212){return db[_0xec07('0x59')][_0xec07('0x5a')](function(_0x137080){return db['Interval'][_0xec07('0x27')]({'where':{'IntervalId':_0x1868f1[_0xec07('0x46')]['id']},'transaction':_0x137080})[_0xec07('0x26')](function(_0xbd8da){var _0x125e14=_[_0xec07('0x30')](_0x1868f1[_0xec07('0x4c')],function(_0x2920b7){delete _0x2920b7['id'];_0x2920b7['IntervalId']=_0x1868f1[_0xec07('0x46')]['id'];return _0x2920b7;});return db[_0xec07('0x42')]['bulkCreate'](_0x125e14,{'transaction':_0x137080});});})[_0xec07('0x26')](function(){return db[_0xec07('0x42')][_0xec07('0x43')]({'where':{'IntervalId':_0x1868f1[_0xec07('0x46')]['id']}});});}})[_0xec07('0x26')](respondWithResult(_0x3345e7,null))[_0xec07('0x4a')](handleError(_0x3345e7,null));}; \ No newline at end of file +var _0x6c81=['options','include','findAll','rows','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','addInterval','IntervalId','getIntervals','findOne','rawAttributes','nolimit','sequelize','transaction','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','sendStatus','error','stack','name','send','index','map','Interval','fieldName','type','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge'];(function(_0x158cb9,_0x4c600f){var _0x100940=function(_0x445d36){while(--_0x445d36){_0x158cb9['push'](_0x158cb9['shift']());}};_0x100940(++_0x4c600f);}(_0x6c81,0x181));var _0x16c8=function(_0x506d2b,_0x51eba7){_0x506d2b=_0x506d2b-0x0;var _0x1198da=_0x6c81[_0x506d2b];return _0x1198da;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x16c8('0x0'));var jsonpatch=require(_0x16c8('0x1'));var rp=require(_0x16c8('0x2'));var moment=require('moment');var BPromise=require(_0x16c8('0x3'));var Mustache=require(_0x16c8('0x4'));var util=require(_0x16c8('0x5'));var path=require(_0x16c8('0x6'));var sox=require('sox');var csv=require(_0x16c8('0x7'));var ejs=require(_0x16c8('0x8'));var fs=require('fs');var fs_extra=require(_0x16c8('0x9'));var _=require(_0x16c8('0xa'));var squel=require('squel');var crypto=require(_0x16c8('0xb'));var jsforce=require(_0x16c8('0xc'));var deskjs=require(_0x16c8('0xd'));var toCsv=require(_0x16c8('0x7'));var querystring=require('querystring');var Papa=require(_0x16c8('0xe'));var Redis=require(_0x16c8('0xf'));var authService=require(_0x16c8('0x10'));var qs=require(_0x16c8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x16c8('0x12'));var utils=require('../../config/utils');var config=require(_0x16c8('0x13'));var licenseUtil=require(_0x16c8('0x14'));var db=require(_0x16c8('0x15'))['db'];var extensions=require(_0x16c8('0x16'));function respondWithStatusCode(_0x41adf7,_0x56ade6){_0x56ade6=_0x56ade6||0xcc;return function(_0x21b0b7){if(_0x21b0b7){return _0x41adf7['sendStatus'](_0x56ade6);}return _0x41adf7[_0x16c8('0x17')](_0x56ade6)[_0x16c8('0x18')]();};}function respondWithResult(_0x19aad5,_0x1bde2e){_0x1bde2e=_0x1bde2e||0xc8;return function(_0x23e611){if(_0x23e611){return _0x19aad5[_0x16c8('0x17')](_0x1bde2e)['json'](_0x23e611);}};}function respondWithFilteredResult(_0x3868d6,_0xc57411){return function(_0x18dfec){if(_0x18dfec){var _0x21c784=typeof _0xc57411[_0x16c8('0x19')]===_0x16c8('0x1a')&&typeof _0xc57411[_0x16c8('0x1b')]===_0x16c8('0x1a');var _0x5099c3=_0x18dfec['count'];var _0x9fab89=_0x21c784?0x0:_0xc57411[_0x16c8('0x19')];var _0x112736=_0x21c784?_0x18dfec[_0x16c8('0x1c')]:_0xc57411['offset']+_0xc57411['limit'];var _0x466a01;if(_0x112736>=_0x5099c3){_0x112736=_0x5099c3;_0x466a01=0xc8;}else{_0x466a01=0xce;}_0x3868d6[_0x16c8('0x17')](_0x466a01);return _0x3868d6[_0x16c8('0x1d')](_0x16c8('0x1e'),_0x9fab89+'-'+_0x112736+'/'+_0x5099c3)['json'](_0x18dfec);}return null;};}function patchUpdates(_0x3c595f){return function(_0x14b0ac){try{jsonpatch[_0x16c8('0x1f')](_0x14b0ac,_0x3c595f,!![]);}catch(_0x443bfc){return BPromise[_0x16c8('0x20')](_0x443bfc);}return _0x14b0ac[_0x16c8('0x21')]();};}function saveUpdates(_0x30e1a6,_0x25b694){return function(_0x46c58b){if(_0x46c58b){return _0x46c58b[_0x16c8('0x22')](_0x30e1a6)[_0x16c8('0x23')](function(_0x60e330){return _0x60e330;});}return null;};}function removeEntity(_0x5e8e82,_0x24aed5){return function(_0x11351b){if(_0x11351b){return _0x11351b[_0x16c8('0x24')]()[_0x16c8('0x23')](function(){var _0x4e9197=_0x11351b[_0x16c8('0x25')]({'plain':!![]});var _0x2a6b7d=_0x16c8('0x26');return db[_0x16c8('0x27')][_0x16c8('0x24')]({'where':{'type':_0x2a6b7d,'resourceId':_0x4e9197['id']}})[_0x16c8('0x23')](function(){return _0x11351b;});})[_0x16c8('0x23')](function(){_0x5e8e82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe80e44,_0x18bd5f){return function(_0x57b436){if(!_0x57b436){_0xe80e44[_0x16c8('0x28')](0x194);}return _0x57b436;};}function handleError(_0xa2e955,_0x2838cd){_0x2838cd=_0x2838cd||0x1f4;return function(_0x5924ba){logger[_0x16c8('0x29')](_0x5924ba[_0x16c8('0x2a')]);if(_0x5924ba[_0x16c8('0x2b')]){delete _0x5924ba[_0x16c8('0x2b')];}_0xa2e955[_0x16c8('0x17')](_0x2838cd)[_0x16c8('0x2c')](_0x5924ba);};}exports[_0x16c8('0x2d')]=function(_0x450b77,_0x459cbe){var _0x400215={},_0x5c056d={},_0x152909={'count':0x0,'rows':[]};var _0x16ed02=_[_0x16c8('0x2e')](db[_0x16c8('0x2f')]['rawAttributes'],function(_0x50cea5){return{'name':_0x50cea5[_0x16c8('0x30')],'type':_0x50cea5[_0x16c8('0x31')]['key']};});_0x5c056d['model']=_[_0x16c8('0x2e')](_0x16ed02,_0x16c8('0x2b'));_0x5c056d[_0x16c8('0x32')]=_[_0x16c8('0x33')](_0x450b77[_0x16c8('0x32')]);_0x5c056d['filters']=_['intersection'](_0x5c056d[_0x16c8('0x34')],_0x5c056d[_0x16c8('0x32')]);_0x400215[_0x16c8('0x35')]=_[_0x16c8('0x36')](_0x5c056d[_0x16c8('0x34')],qs[_0x16c8('0x37')](_0x450b77[_0x16c8('0x32')][_0x16c8('0x37')]));_0x400215[_0x16c8('0x35')]=_0x400215['attributes'][_0x16c8('0x38')]?_0x400215[_0x16c8('0x35')]:_0x5c056d['model'];if(!_0x450b77[_0x16c8('0x32')][_0x16c8('0x39')]('nolimit')){_0x400215[_0x16c8('0x1b')]=qs[_0x16c8('0x1b')](_0x450b77[_0x16c8('0x32')][_0x16c8('0x1b')]);_0x400215[_0x16c8('0x19')]=qs[_0x16c8('0x19')](_0x450b77[_0x16c8('0x32')][_0x16c8('0x19')]);}_0x400215[_0x16c8('0x3a')]=qs['sort'](_0x450b77[_0x16c8('0x32')][_0x16c8('0x3b')]);_0x400215[_0x16c8('0x3c')]=qs[_0x16c8('0x3d')](_[_0x16c8('0x3e')](_0x450b77[_0x16c8('0x32')],_0x5c056d[_0x16c8('0x3d')]),_0x16ed02);if(_0x450b77['query'][_0x16c8('0x3f')]){_0x400215[_0x16c8('0x3c')]=_[_0x16c8('0x40')](_0x400215['where'],{'$or':_[_0x16c8('0x2e')](_0x16ed02,function(_0x5b79b3){if(_0x5b79b3['type']!=='VIRTUAL'){var _0x100538={};_0x100538[_0x5b79b3['name']]={'$like':'%'+_0x450b77[_0x16c8('0x32')][_0x16c8('0x3f')]+'%'};return _0x100538;}})});}_0x400215=_['merge']({},_0x400215,_0x450b77[_0x16c8('0x41')]);var _0x27bd55={'where':_0x400215[_0x16c8('0x3c')]};return db[_0x16c8('0x2f')][_0x16c8('0x1c')](_0x27bd55)['then'](function(_0xfc6b21){_0x152909[_0x16c8('0x1c')]=_0xfc6b21;if(_0x450b77['query']['includeAll']){_0x400215[_0x16c8('0x42')]=[{'all':!![]}];}return db['Interval'][_0x16c8('0x43')](_0x400215);})[_0x16c8('0x23')](function(_0x4acb5b){_0x152909[_0x16c8('0x44')]=_0x4acb5b;return _0x152909;})[_0x16c8('0x23')](respondWithFilteredResult(_0x459cbe,_0x400215))['catch'](handleError(_0x459cbe,null));};exports[_0x16c8('0x45')]=function(_0x46a03a,_0x57fc7c){var _0x1189d4={'raw':!![],'where':{'id':_0x46a03a[_0x16c8('0x46')]['id']}},_0x5dbc50={};_0x5dbc50[_0x16c8('0x34')]=_[_0x16c8('0x33')](db[_0x16c8('0x2f')]['rawAttributes']);_0x5dbc50[_0x16c8('0x32')]=_['keys'](_0x46a03a[_0x16c8('0x32')]);_0x5dbc50[_0x16c8('0x3d')]=_['intersection'](_0x5dbc50[_0x16c8('0x34')],_0x5dbc50[_0x16c8('0x32')]);_0x1189d4[_0x16c8('0x35')]=_[_0x16c8('0x36')](_0x5dbc50[_0x16c8('0x34')],qs['fields'](_0x46a03a['query'][_0x16c8('0x37')]));_0x1189d4[_0x16c8('0x35')]=_0x1189d4[_0x16c8('0x35')][_0x16c8('0x38')]?_0x1189d4[_0x16c8('0x35')]:_0x5dbc50[_0x16c8('0x34')];if(_0x46a03a[_0x16c8('0x32')][_0x16c8('0x47')]){_0x1189d4[_0x16c8('0x42')]=[{'all':!![]}];}_0x1189d4=_['merge']({},_0x1189d4,_0x46a03a[_0x16c8('0x41')]);return db[_0x16c8('0x2f')][_0x16c8('0x48')](_0x1189d4)[_0x16c8('0x23')](handleEntityNotFound(_0x57fc7c,null))['then'](respondWithResult(_0x57fc7c,null))['catch'](handleError(_0x57fc7c,null));};exports[_0x16c8('0x49')]=function(_0x182bf0,_0x47a747){return db[_0x16c8('0x2f')][_0x16c8('0x49')](_0x182bf0[_0x16c8('0x4a')],{})['then'](function(_0x2f04f5){var _0x931df0=_0x182bf0[_0x16c8('0x4b')][_0x16c8('0x25')]({'plain':!![]});if(!_0x931df0)throw new Error(_0x16c8('0x4c'));if(_0x931df0[_0x16c8('0x4d')]===_0x16c8('0x4b')){var _0x48ca63=_0x2f04f5[_0x16c8('0x25')]({'plain':!![]});var _0x159ba2=_0x16c8('0x26');return db[_0x16c8('0x4e')][_0x16c8('0x48')]({'where':{'name':_0x159ba2,'userProfileId':_0x931df0[_0x16c8('0x4f')]},'raw':!![]})[_0x16c8('0x23')](function(_0x48917b){if(_0x48917b&&_0x48917b['autoAssociation']===0x0){return db[_0x16c8('0x27')][_0x16c8('0x49')]({'name':_0x48ca63[_0x16c8('0x2b')],'resourceId':_0x48ca63['id'],'type':_0x48917b['name'],'sectionId':_0x48917b['id']},{})[_0x16c8('0x23')](function(){return _0x2f04f5;});}else{return _0x2f04f5;}})['catch'](function(_0x245161){logger[_0x16c8('0x29')](_0x16c8('0x50'),_0x245161);throw _0x245161;});}return _0x2f04f5;})[_0x16c8('0x23')](respondWithResult(_0x47a747,0xc9))[_0x16c8('0x51')](handleError(_0x47a747,null));};exports[_0x16c8('0x22')]=function(_0x4c9cc2,_0x5d08d5){if(_0x4c9cc2[_0x16c8('0x4a')]['id']){delete _0x4c9cc2[_0x16c8('0x4a')]['id'];}return db[_0x16c8('0x2f')][_0x16c8('0x48')]({'where':{'id':_0x4c9cc2[_0x16c8('0x46')]['id']}})['then'](handleEntityNotFound(_0x5d08d5,null))[_0x16c8('0x23')](saveUpdates(_0x4c9cc2[_0x16c8('0x4a')],null))[_0x16c8('0x23')](respondWithResult(_0x5d08d5,null))['catch'](handleError(_0x5d08d5,null));};exports[_0x16c8('0x24')]=function(_0x53d904,_0x35cab5){return db[_0x16c8('0x2f')][_0x16c8('0x48')]({'where':{'id':_0x53d904[_0x16c8('0x46')]['id']}})['then'](handleEntityNotFound(_0x35cab5,null))[_0x16c8('0x23')](removeEntity(_0x35cab5,null))[_0x16c8('0x51')](handleError(_0x35cab5,null));};exports[_0x16c8('0x52')]=function(_0x3d1faa,_0x4041ef,_0x415ede){if(_0x3d1faa[_0x16c8('0x4a')]['id']){delete _0x3d1faa[_0x16c8('0x4a')]['id'];}return db['Interval'][_0x16c8('0x48')]({'where':{'id':_0x3d1faa[_0x16c8('0x46')]['id']}})[_0x16c8('0x23')](handleEntityNotFound(_0x4041ef,null))[_0x16c8('0x23')](function(_0x36f4de){if(_0x36f4de){_0x3d1faa[_0x16c8('0x4a')][_0x16c8('0x53')]=_0x36f4de['id'];return db['Interval']['create'](_0x3d1faa['body']);}})[_0x16c8('0x23')](respondWithResult(_0x4041ef,null))[_0x16c8('0x51')](handleError(_0x4041ef,null));};exports[_0x16c8('0x54')]=function(_0x430687,_0x100928,_0x386b97){var _0x103b46={};var _0x1c1bf2={};var _0x206be6;var _0x1db863;return db['Interval'][_0x16c8('0x55')]({'where':{'id':_0x430687[_0x16c8('0x46')]['id']}})[_0x16c8('0x23')](handleEntityNotFound(_0x100928,null))['then'](function(_0x56c19b){if(_0x56c19b){_0x206be6=_0x56c19b;_0x1c1bf2[_0x16c8('0x34')]=_[_0x16c8('0x33')](db['Interval'][_0x16c8('0x56')]);_0x1c1bf2[_0x16c8('0x32')]=_[_0x16c8('0x33')](_0x430687[_0x16c8('0x32')]);_0x1c1bf2[_0x16c8('0x3d')]=_[_0x16c8('0x36')](_0x1c1bf2[_0x16c8('0x34')],_0x1c1bf2[_0x16c8('0x32')]);_0x103b46[_0x16c8('0x35')]=_[_0x16c8('0x36')](_0x1c1bf2['model'],qs[_0x16c8('0x37')](_0x430687[_0x16c8('0x32')]['fields']));_0x103b46[_0x16c8('0x35')]=_0x103b46['attributes'][_0x16c8('0x38')]?_0x103b46[_0x16c8('0x35')]:_0x1c1bf2['model'];_0x103b46['order']=qs[_0x16c8('0x3b')](_0x430687[_0x16c8('0x32')][_0x16c8('0x3b')]);_0x103b46[_0x16c8('0x3c')]=qs[_0x16c8('0x3d')](_['pick'](_0x430687[_0x16c8('0x32')],_0x1c1bf2[_0x16c8('0x3d')]));if(_0x430687[_0x16c8('0x32')]['filter']){_0x103b46[_0x16c8('0x3c')]=_[_0x16c8('0x40')](_0x103b46[_0x16c8('0x3c')],{'$or':_[_0x16c8('0x2e')](_0x103b46['attributes'],function(_0x228ccc){var _0x14e121={};_0x14e121[_0x228ccc]={'$like':'%'+_0x430687[_0x16c8('0x32')]['filter']+'%'};return _0x14e121;})});}_0x103b46=_[_0x16c8('0x40')]({},_0x103b46,_0x430687['options']);return _0x206be6[_0x16c8('0x54')](_0x103b46);}})[_0x16c8('0x23')](function(_0x2c782c){if(_0x2c782c){_0x1db863=_0x2c782c['length'];if(!_0x430687[_0x16c8('0x32')][_0x16c8('0x39')](_0x16c8('0x57'))){_0x103b46['limit']=qs['limit'](_0x430687[_0x16c8('0x32')][_0x16c8('0x1b')]);_0x103b46[_0x16c8('0x19')]=qs['offset'](_0x430687[_0x16c8('0x32')][_0x16c8('0x19')]);}return _0x206be6[_0x16c8('0x54')](_0x103b46);}})[_0x16c8('0x23')](function(_0x5ee751){if(_0x5ee751){return _0x5ee751?{'count':_0x1db863,'rows':_0x5ee751}:null;}})[_0x16c8('0x23')](respondWithResult(_0x100928,null))[_0x16c8('0x51')](handleError(_0x100928,null));};exports['addIntervals']=function(_0x123922,_0x3f5118,_0x461126){return db[_0x16c8('0x2f')][_0x16c8('0x55')]({'where':{'id':_0x123922[_0x16c8('0x46')]['id']}})[_0x16c8('0x23')](handleEntityNotFound(_0x3f5118,null))['then'](function(_0x38102d){if(_0x38102d){return db[_0x16c8('0x58')][_0x16c8('0x59')](function(_0x40aef1){return db[_0x16c8('0x2f')][_0x16c8('0x24')]({'where':{'IntervalId':_0x123922[_0x16c8('0x46')]['id']},'transaction':_0x40aef1})['then'](function(_0x1ba17a){var _0x1453f8=_[_0x16c8('0x2e')](_0x123922[_0x16c8('0x4a')],function(_0x52c056){delete _0x52c056['id'];_0x52c056['IntervalId']=_0x123922[_0x16c8('0x46')]['id'];return _0x52c056;});return db['Interval']['bulkCreate'](_0x1453f8,{'transaction':_0x40aef1});});})['then'](function(){return db[_0x16c8('0x2f')][_0x16c8('0x43')]({'where':{'IntervalId':_0x123922[_0x16c8('0x46')]['id']}});});}})[_0x16c8('0x23')](respondWithResult(_0x3f5118,null))[_0x16c8('0x51')](handleError(_0x3f5118,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 8274987..9bb507c 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 _0xebd0=['all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','Interval','tools_intervals','rewrite','interval','string','getIntervals','then'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xebd0,0x6a));var _0x0ebd=function(_0x5d36a5,_0x61494){_0x5d36a5=_0x5d36a5-0x0;var _0x1fee3b=_0xebd0[_0x5d36a5];return _0x1fee3b;};'use strict';var attributes=require(_0x0ebd('0x0'));var extensions=require(_0x0ebd('0x1'));var iftime=require(_0x0ebd('0x2'))[_0x0ebd('0x3')];module[_0x0ebd('0x4')]=function(_0x253e3){return _0x253e3[_0x0ebd('0x5')](_0x0ebd('0x6'),attributes,{'tableName':_0x0ebd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x529ad9){extensions[_0x0ebd('0x8')](_0x253e3,_0x529ad9);},'afterBulkCreate':function(_0x1530bf,_0xdd79cc,_0x4eedd8){_0x4eedd8();extensions[_0x0ebd('0x8')](_0x253e3,_0x1530bf[0x0]);},'afterUpdate':function(_0x44acd2){extensions[_0x0ebd('0x8')](_0x253e3,_0x44acd2);},'afterDestroy':function(_0x2efdff){extensions[_0x0ebd('0x8')](_0x253e3,_0x2efdff);}},'instanceMethods':{'ifTime':function(_0x535e14=undefined,_0x4dc477=new Date()){if(typeof this[_0x0ebd('0x9')]===_0x0ebd('0xa')){return iftime(this[_0x0ebd('0x9')],_0x535e14,_0x4dc477);}else{return this[_0x0ebd('0xb')]()[_0x0ebd('0xc')](function(_0x4cac4b){return Promise[_0x0ebd('0xd')](_0x4cac4b[_0x0ebd('0xe')](function(_0x432d12){return _0x432d12[_0x0ebd('0xf')](_0x535e14,_0x4dc477);}));})[_0x0ebd('0xc')](function(_0x2655da){return _0x2655da[_0x0ebd('0x10')](function(_0x16e122,_0x2c3bbf){return _0x16e122||_0x2c3bbf;},![]);});}}}});}; \ No newline at end of file +var _0x8198=['getIntervals','then','all','map','ifTime','reduce','../../components/extensions/rewrite','iftime','exports','define','Interval','rewrite','string','interval'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x8198,0xca));var _0x8819=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0x8198[_0xea343d];return _0x2c6e9c;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x8819('0x0'));var iftime=require('../../utils/iftime')[_0x8819('0x1')];module[_0x8819('0x2')]=function(_0x45e087){return _0x45e087[_0x8819('0x3')](_0x8819('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x57488c){extensions[_0x8819('0x5')](_0x45e087,_0x57488c);},'afterBulkCreate':function(_0xe8e652,_0x48d4fb,_0x529792){_0x529792();extensions[_0x8819('0x5')](_0x45e087,_0xe8e652[0x0]);},'afterUpdate':function(_0x392280){extensions[_0x8819('0x5')](_0x45e087,_0x392280);},'afterDestroy':function(_0x44e88b){extensions[_0x8819('0x5')](_0x45e087,_0x44e88b);}},'instanceMethods':{'ifTime':function(_0x5c5b18=undefined,_0x48d9a4=new Date()){if(typeof this['interval']===_0x8819('0x6')){return iftime(this[_0x8819('0x7')],_0x5c5b18,_0x48d9a4);}else{return this[_0x8819('0x8')]()[_0x8819('0x9')](function(_0x1cc214){return Promise[_0x8819('0xa')](_0x1cc214[_0x8819('0xb')](function(_0x13d440){return _0x13d440[_0x8819('0xc')](_0x5c5b18,_0x48d9a4);}));})['then'](function(_0x1697f2){return _0x1697f2[_0x8819('0xd')](function(_0x5ccce5,_0x40ad88){return _0x5ccce5||_0x40ad88;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 12c2004..ca92c27 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 _0xe9f4=['timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','resolve','lodash','../../mysqldb','../../utils/iftime','../../config/logger','rpc','GetInterval','findAll','options','raw','where','attributes','limit','include','model','map','then','info','debug','stringify','catch','error','ShowInterval','Interval','find','message','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime','intervalIds','isArray','intervals','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9f4,0x107));var _0x4e9f=function(_0x478446,_0x2b8654){_0x478446=_0x478446-0x0;var _0x3de39b=_0xe9f4[_0x478446];return _0x3de39b;};'use strict';var _=require(_0x4e9f('0x0'));var util=require('util');var db=require(_0x4e9f('0x1'))['db'];var iftime=require(_0x4e9f('0x2'))['iftime'];var logger=require(_0x4e9f('0x3'))(_0x4e9f('0x4'));exports[_0x4e9f('0x5')]=function(_0x1766a8){var _0x14b3da=this;return new Promise(function(_0x1cbc48,_0x58fb77){return db['Interval'][_0x4e9f('0x6')]({'raw':_0x1766a8[_0x4e9f('0x7')]?_0x1766a8[_0x4e9f('0x7')][_0x4e9f('0x8')]===undefined?!![]:![]:!![],'where':_0x1766a8['options']?_0x1766a8[_0x4e9f('0x7')][_0x4e9f('0x9')]||null:null,'attributes':_0x1766a8['options']?_0x1766a8[_0x4e9f('0x7')][_0x4e9f('0xa')]||null:null,'limit':_0x1766a8[_0x4e9f('0x7')]?_0x1766a8[_0x4e9f('0x7')][_0x4e9f('0xb')]||null:null,'include':_0x1766a8[_0x4e9f('0x7')]?_0x1766a8[_0x4e9f('0x7')][_0x4e9f('0xc')]?_['map'](_0x1766a8[_0x4e9f('0x7')][_0x4e9f('0xc')],function(_0x47a1cc){return{'model':db[_0x47a1cc[_0x4e9f('0xd')]],'as':_0x47a1cc['as'],'attributes':_0x47a1cc[_0x4e9f('0xa')],'include':_0x47a1cc[_0x4e9f('0xc')]?_['map'](_0x47a1cc[_0x4e9f('0xc')],function(_0x48b14f){return{'model':db[_0x48b14f[_0x4e9f('0xd')]],'as':_0x48b14f['as'],'attributes':_0x48b14f[_0x4e9f('0xa')],'include':_0x48b14f[_0x4e9f('0xc')]?_[_0x4e9f('0xe')](_0x48b14f[_0x4e9f('0xc')],function(_0x178b66){return{'model':db[_0x178b66[_0x4e9f('0xd')]],'as':_0x178b66['as'],'attributes':_0x178b66[_0x4e9f('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4e9f('0xf')](function(_0x3aa941){logger[_0x4e9f('0x10')](_0x4e9f('0x5'),_0x1766a8);logger[_0x4e9f('0x11')](_0x4e9f('0x5'),_0x1766a8,JSON[_0x4e9f('0x12')](_0x3aa941));_0x1cbc48(_0x3aa941);})[_0x4e9f('0x13')](function(_0x5bf1d8){logger[_0x4e9f('0x14')]('GetInterval',_0x5bf1d8['message'],_0x1766a8);_0x58fb77(_0x14b3da[_0x4e9f('0x14')](0x1f4,_0x5bf1d8['message']));});});};exports[_0x4e9f('0x15')]=function(_0x99db3a){var _0x18f2c5=this;return new Promise(function(_0x4a6718,_0x518704){return db[_0x4e9f('0x16')][_0x4e9f('0x17')]({'raw':_0x99db3a[_0x4e9f('0x7')]?_0x99db3a['options'][_0x4e9f('0x8')]===undefined?!![]:![]:!![],'where':_0x99db3a[_0x4e9f('0x7')]?_0x99db3a[_0x4e9f('0x7')][_0x4e9f('0x9')]||null:null,'attributes':_0x99db3a[_0x4e9f('0x7')]?_0x99db3a[_0x4e9f('0x7')][_0x4e9f('0xa')]||null:null,'include':_0x99db3a[_0x4e9f('0x7')]?_0x99db3a['options'][_0x4e9f('0xc')]?_[_0x4e9f('0xe')](_0x99db3a['options'][_0x4e9f('0xc')],function(_0x3277c8){return{'model':db[_0x3277c8[_0x4e9f('0xd')]],'as':_0x3277c8['as'],'attributes':_0x3277c8[_0x4e9f('0xa')],'include':_0x3277c8[_0x4e9f('0xc')]?_[_0x4e9f('0xe')](_0x3277c8[_0x4e9f('0xc')],function(_0x25802c){return{'model':db[_0x25802c[_0x4e9f('0xd')]],'as':_0x25802c['as'],'attributes':_0x25802c[_0x4e9f('0xa')],'include':_0x25802c[_0x4e9f('0xc')]?_['map'](_0x25802c[_0x4e9f('0xc')],function(_0x1384ed){return{'model':db[_0x1384ed[_0x4e9f('0xd')]],'as':_0x1384ed['as'],'attributes':_0x1384ed[_0x4e9f('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4e9f('0xf')](function(_0x38c8e1){logger[_0x4e9f('0x10')]('ShowInterval',_0x99db3a);logger[_0x4e9f('0x11')](_0x4e9f('0x15'),_0x99db3a,JSON[_0x4e9f('0x12')](_0x38c8e1));_0x4a6718(_0x38c8e1);})[_0x4e9f('0x13')](function(_0x406d21){logger[_0x4e9f('0x14')](_0x4e9f('0x15'),_0x406d21[_0x4e9f('0x18')],_0x99db3a);_0x518704(_0x18f2c5['error'](0x1f4,_0x406d21[_0x4e9f('0x18')]));});});};function checkArrayOfIntervals(_0x301710,_0x2d93ca){var _0x3841d0=[];return db[_0x4e9f('0x16')][_0x4e9f('0x6')]({'where':{'id':_0x301710}})[_0x4e9f('0xf')](function(_0x18d955){_0x3841d0=_0x18d955;return Promise[_0x4e9f('0x19')](_0x3841d0['map'](function(_0x31b933){return _0x31b933[_0x4e9f('0x1a')](_0x2d93ca);}));})['then'](function(_0x4bddcf){var _0x257f15=_0x4bddcf[_0x4e9f('0x1b')](function(_0x466771,_0x2b7b74){return _0x466771||_0x2b7b74;},![]);logger[_0x4e9f('0x10')](util[_0x4e9f('0x1c')](_0x4e9f('0x1d'),_0x3841d0['map'](function(_0x24ae5d){return _0x24ae5d[_0x4e9f('0x1e')];})[_0x4e9f('0x1f')](',\x20'),_0x3841d0[_0x4e9f('0xe')](function(_0x40bb79){return _0x40bb79['id'];})[_0x4e9f('0x1f')](',\x20')));return _0x257f15;});}function checkSingleInterval(_0x42e652,_0x50fc6d){return db[_0x4e9f('0x16')][_0x4e9f('0x20')](_0x42e652)['then'](function(_0x442b11){if(_0x442b11){logger['info'](util[_0x4e9f('0x1c')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x442b11[_0x4e9f('0x1e')],_0x442b11['id']));return _0x442b11['ifTime'](_0x50fc6d);}});}exports[_0x4e9f('0x21')]=function(_0x3aca93){var _0x196117=_0x3aca93[_0x4e9f('0x22')];var _0xb0547a=Array[_0x4e9f('0x23')](_0x3aca93[_0x4e9f('0x24')])?_0x3aca93[_0x4e9f('0x24')]:typeof _0x3aca93['intervals']===_0x4e9f('0x25')?[_0x3aca93[_0x4e9f('0x24')]]:[];var _0x20a9b9=_0x3aca93[_0x4e9f('0x26')]||undefined;var _0x2981ce=![];if(_0xb0547a['length']){logger[_0x4e9f('0x10')](util[_0x4e9f('0x1c')](_0x4e9f('0x27'),_0xb0547a[_0x4e9f('0x1f')](';\x20')));}if(_0x20a9b9){logger[_0x4e9f('0x10')](util[_0x4e9f('0x1c')](_0x4e9f('0x28'),_0x20a9b9));}logger['debug'](_0x4e9f('0x29'),_0x2981ce);logger['silly']('IntervalIftime',_0x3aca93);return Promise[_0x4e9f('0x2a')]()[_0x4e9f('0xf')](function(){if(Array[_0x4e9f('0x23')](_0x196117)){return checkArrayOfIntervals(_0x196117,_0x20a9b9);}else if(_0x196117){return checkSingleInterval(_0x196117,_0x20a9b9);}})[_0x4e9f('0xf')](function(_0xae13d){var _0x844811=_0xb0547a[_0x4e9f('0x1b')](function(_0x7e6609,_0x5569e2){return _0x7e6609||iftime(_0x5569e2,_0x20a9b9);},![]);_0x2981ce=_0xae13d||_0x844811;return _0x2981ce;})[_0x4e9f('0x13')](function(_0x5f4232){logger['error'](_0x4e9f('0x21'),_0x3aca93,_0x5f4232);throw this[_0x4e9f('0x14')](0x1f4,_0x5f4232[_0x4e9f('0x18')]);});}; \ No newline at end of file +var _0x4270=['isArray','intervals','string','timezone','length','IntervalIftime:\x20timezone\x20=\x20%s','silly','resolve','lodash','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','raw','options','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','Interval','ShowInterval','findAll','all','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','ifTime','IntervalIftime','intervalIds'];(function(_0x53153f,_0x5b9a80){var _0x381bc1=function(_0x4423dc){while(--_0x4423dc){_0x53153f['push'](_0x53153f['shift']());}};_0x381bc1(++_0x5b9a80);}(_0x4270,0xe4));var _0x0427=function(_0x49ddcf,_0xd9451b){_0x49ddcf=_0x49ddcf-0x0;var _0x233053=_0x4270[_0x49ddcf];return _0x233053;};'use strict';var _=require(_0x0427('0x0'));var util=require('util');var db=require(_0x0427('0x1'))['db'];var iftime=require(_0x0427('0x2'))[_0x0427('0x3')];var logger=require(_0x0427('0x4'))(_0x0427('0x5'));exports[_0x0427('0x6')]=function(_0x4b3cdd){var _0x32345b=this;return new Promise(function(_0x5444c4,_0xa90c46){return db['Interval']['findAll']({'raw':_0x4b3cdd['options']?_0x4b3cdd['options'][_0x0427('0x7')]===undefined?!![]:![]:!![],'where':_0x4b3cdd[_0x0427('0x8')]?_0x4b3cdd[_0x0427('0x8')][_0x0427('0x9')]||null:null,'attributes':_0x4b3cdd['options']?_0x4b3cdd['options'][_0x0427('0xa')]||null:null,'limit':_0x4b3cdd[_0x0427('0x8')]?_0x4b3cdd[_0x0427('0x8')][_0x0427('0xb')]||null:null,'include':_0x4b3cdd[_0x0427('0x8')]?_0x4b3cdd[_0x0427('0x8')][_0x0427('0xc')]?_[_0x0427('0xd')](_0x4b3cdd[_0x0427('0x8')][_0x0427('0xc')],function(_0x3731ed){return{'model':db[_0x3731ed[_0x0427('0xe')]],'as':_0x3731ed['as'],'attributes':_0x3731ed['attributes'],'include':_0x3731ed['include']?_[_0x0427('0xd')](_0x3731ed['include'],function(_0x521f5a){return{'model':db[_0x521f5a[_0x0427('0xe')]],'as':_0x521f5a['as'],'attributes':_0x521f5a['attributes'],'include':_0x521f5a[_0x0427('0xc')]?_['map'](_0x521f5a['include'],function(_0x49c174){return{'model':db[_0x49c174['model']],'as':_0x49c174['as'],'attributes':_0x49c174['attributes']};}):[]};}):[]};}):[]:[]})[_0x0427('0xf')](function(_0x296e4f){logger[_0x0427('0x10')](_0x0427('0x6'),_0x4b3cdd);logger[_0x0427('0x11')]('GetInterval',_0x4b3cdd,JSON[_0x0427('0x12')](_0x296e4f));_0x5444c4(_0x296e4f);})[_0x0427('0x13')](function(_0x9f95f4){logger[_0x0427('0x14')](_0x0427('0x6'),_0x9f95f4[_0x0427('0x15')],_0x4b3cdd);_0xa90c46(_0x32345b[_0x0427('0x14')](0x1f4,_0x9f95f4[_0x0427('0x15')]));});});};exports['ShowInterval']=function(_0x41fb0b){var _0x2af28e=this;return new Promise(function(_0x59f884,_0xaefe5d){return db[_0x0427('0x16')]['find']({'raw':_0x41fb0b[_0x0427('0x8')]?_0x41fb0b[_0x0427('0x8')][_0x0427('0x7')]===undefined?!![]:![]:!![],'where':_0x41fb0b[_0x0427('0x8')]?_0x41fb0b['options']['where']||null:null,'attributes':_0x41fb0b[_0x0427('0x8')]?_0x41fb0b[_0x0427('0x8')][_0x0427('0xa')]||null:null,'include':_0x41fb0b[_0x0427('0x8')]?_0x41fb0b['options']['include']?_[_0x0427('0xd')](_0x41fb0b[_0x0427('0x8')][_0x0427('0xc')],function(_0x1d4788){return{'model':db[_0x1d4788[_0x0427('0xe')]],'as':_0x1d4788['as'],'attributes':_0x1d4788['attributes'],'include':_0x1d4788[_0x0427('0xc')]?_[_0x0427('0xd')](_0x1d4788[_0x0427('0xc')],function(_0x2119c5){return{'model':db[_0x2119c5[_0x0427('0xe')]],'as':_0x2119c5['as'],'attributes':_0x2119c5[_0x0427('0xa')],'include':_0x2119c5[_0x0427('0xc')]?_['map'](_0x2119c5['include'],function(_0x4744e2){return{'model':db[_0x4744e2['model']],'as':_0x4744e2['as'],'attributes':_0x4744e2[_0x0427('0xa')]};}):[]};}):[]};}):[]:[]})[_0x0427('0xf')](function(_0x36c02e){logger[_0x0427('0x10')](_0x0427('0x17'),_0x41fb0b);logger[_0x0427('0x11')]('ShowInterval',_0x41fb0b,JSON[_0x0427('0x12')](_0x36c02e));_0x59f884(_0x36c02e);})[_0x0427('0x13')](function(_0x54c224){logger['error'](_0x0427('0x17'),_0x54c224[_0x0427('0x15')],_0x41fb0b);_0xaefe5d(_0x2af28e['error'](0x1f4,_0x54c224[_0x0427('0x15')]));});});};function checkArrayOfIntervals(_0x2ad61f,_0x102269){var _0x4dfcdf=[];return db[_0x0427('0x16')][_0x0427('0x18')]({'where':{'id':_0x2ad61f}})['then'](function(_0x16a165){_0x4dfcdf=_0x16a165;return Promise[_0x0427('0x19')](_0x4dfcdf['map'](function(_0x15e9c3){return _0x15e9c3['ifTime'](_0x102269);}));})[_0x0427('0xf')](function(_0x49f9d7){var _0x455ad8=_0x49f9d7[_0x0427('0x1a')](function(_0x54fbbc,_0x17a450){return _0x54fbbc||_0x17a450;},![]);logger['info'](util[_0x0427('0x1b')](_0x0427('0x1c'),_0x4dfcdf[_0x0427('0xd')](function(_0x5eb870){return _0x5eb870[_0x0427('0x1d')];})[_0x0427('0x1e')](',\x20'),_0x4dfcdf['map'](function(_0xc8f3cb){return _0xc8f3cb['id'];})[_0x0427('0x1e')](',\x20')));return _0x455ad8;});}function checkSingleInterval(_0x50691c,_0x50524b){return db['Interval'][_0x0427('0x1f')](_0x50691c)[_0x0427('0xf')](function(_0x3ece9b){if(_0x3ece9b){logger[_0x0427('0x10')](util[_0x0427('0x1b')](_0x0427('0x20'),_0x3ece9b[_0x0427('0x1d')],_0x3ece9b['id']));return _0x3ece9b[_0x0427('0x21')](_0x50524b);}});}exports[_0x0427('0x22')]=function(_0x3f4ea8){var _0xb2db5d=_0x3f4ea8[_0x0427('0x23')];var _0x5afca5=Array[_0x0427('0x24')](_0x3f4ea8[_0x0427('0x25')])?_0x3f4ea8['intervals']:typeof _0x3f4ea8[_0x0427('0x25')]===_0x0427('0x26')?[_0x3f4ea8['intervals']]:[];var _0x260839=_0x3f4ea8[_0x0427('0x27')]||undefined;var _0x482ad2=![];if(_0x5afca5[_0x0427('0x28')]){logger[_0x0427('0x10')](util['format']('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x5afca5[_0x0427('0x1e')](';\x20')));}if(_0x260839){logger[_0x0427('0x10')](util[_0x0427('0x1b')](_0x0427('0x29'),_0x260839));}logger[_0x0427('0x11')]('Iftime',_0x482ad2);logger[_0x0427('0x2a')](_0x0427('0x22'),_0x3f4ea8);return Promise[_0x0427('0x2b')]()[_0x0427('0xf')](function(){if(Array[_0x0427('0x24')](_0xb2db5d)){return checkArrayOfIntervals(_0xb2db5d,_0x260839);}else if(_0xb2db5d){return checkSingleInterval(_0xb2db5d,_0x260839);}})[_0x0427('0xf')](function(_0x5eff75){var _0x36cd09=_0x5afca5[_0x0427('0x1a')](function(_0x5cd1ed,_0x590ea0){return _0x5cd1ed||iftime(_0x590ea0,_0x260839);},![]);_0x482ad2=_0x5eff75||_0x36cd09;return _0x482ad2;})[_0x0427('0x13')](function(_0x333f5c){logger[_0x0427('0x14')](_0x0427('0x22'),_0x3f4ea8,_0x333f5c);throw this[_0x0427('0x14')](0x1f4,_0x333f5c['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 97beb65..7a17b13 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 _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x57a6f6,_0x263cc3){var _0x48dfb4=function(_0x3c9c09){while(--_0x3c9c09){_0x57a6f6['push'](_0x57a6f6['shift']());}};_0x48dfb4(++_0x263cc3);}(_0xadb5,0xad));var _0x5adb=function(_0x28c20f,_0x27ee55){_0x28c20f=_0x28c20f-0x0;var _0x2cbd15=_0xadb5[_0x28c20f];return _0x2cbd15;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 0845a09..522603a 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 _0xb7a0=['socket','connection','https','../../config/logger','api','support','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','email','customfield_11502','customfield_11503','name','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','request','setEncoding','utf8','data','end','status','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','x-forwarded-for','remoteAddress'];(function(_0x14e9e9,_0x42ba7c){var _0x426c1a=function(_0x244aa){while(--_0x244aa){_0x14e9e9['push'](_0x14e9e9['shift']());}};_0x426c1a(++_0x42ba7c);}(_0xb7a0,0x7a));var _0x0b7a=function(_0x23600e,_0x3742e4){_0x23600e=_0x23600e-0x0;var _0x5794d9=_0xb7a0[_0x23600e];return _0x5794d9;};'use strict';var BPromise=require('bluebird');var https=require(_0x0b7a('0x0'));var logger=require(_0x0b7a('0x1'))(_0x0b7a('0x2'));var USERNAME=_0x0b7a('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x20e0c2,_0x1ddedb){var _0x337efb={'fields':{'project':{'key':_0x20e0c2['key']||_0x0b7a('0x4')},'summary':(_0x20e0c2['summary']||_0x0b7a('0x5'))+_0x0b7a('0x6')+_0x20e0c2['ip'],'description':_0x20e0c2[_0x0b7a('0x7')]||JSON[_0x0b7a('0x8')](_0x20e0c2),'issuetype':{'name':_0x20e0c2[_0x0b7a('0x9')]||'Bug'}}};_0x337efb[_0x0b7a('0xa')][_0x0b7a('0xb')]=_0x20e0c2[_0x0b7a('0xc')];_0x337efb[_0x0b7a('0xa')]['customfield_11501']=_0x20e0c2['oldToken'];_0x337efb[_0x0b7a('0xa')][_0x0b7a('0xd')]=_0x20e0c2['newToken'];_0x337efb[_0x0b7a('0xa')][_0x0b7a('0xe')]=_0x20e0c2[_0x0b7a('0xf')];_0x337efb[_0x0b7a('0xa')][_0x0b7a('0x10')]=_0x20e0c2['reason'];_0x337efb[_0x0b7a('0xa')][_0x0b7a('0x11')]=_0x20e0c2['ip'];var _0x23d6fd={'host':_0x0b7a('0x12'),'port':0x1bb,'path':_0x0b7a('0x13'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x0b7a('0x14'),'Authorization':_0x0b7a('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x0b7a('0x16')]('base64')}};var _0x318e6b=JSON[_0x0b7a('0x8')](_0x337efb);var _0x3d5637=https[_0x0b7a('0x17')](_0x23d6fd,function(_0x4126ea){_0x4126ea[_0x0b7a('0x18')](_0x0b7a('0x19'));var _0x26fb70='';_0x4126ea['on'](_0x0b7a('0x1a'),function(_0x5e0d64){_0x26fb70+=_0x5e0d64;});_0x4126ea['on'](_0x0b7a('0x1b'),function(){if(_0x1ddedb){return _0x1ddedb[_0x0b7a('0x1c')](_0x4126ea['statusCode'])[_0x0b7a('0x1d')](JSON['parse'](_0x26fb70));}});});_0x3d5637['on'](_0x0b7a('0x1e'),function(_0x547c60){if(_0x1ddedb){return _0x1ddedb[_0x0b7a('0x1c')](0x1f4)[_0x0b7a('0x1d')]({'errors':[{'message':_0x0b7a('0x1f'),'type':'api.jira'}]});}});_0x3d5637[_0x0b7a('0x20')](_0x318e6b);_0x3d5637[_0x0b7a('0x1b')]();}exports[_0x0b7a('0x21')]=openIssue;exports[_0x0b7a('0x22')]=function(_0x5c94bc,_0x1026af){_0x5c94bc[_0x0b7a('0x23')]['ip']=_0x5c94bc['headers'][_0x0b7a('0x24')]||_0x5c94bc['connection'][_0x0b7a('0x25')]||_0x5c94bc[_0x0b7a('0x26')][_0x0b7a('0x25')]||_0x5c94bc[_0x0b7a('0x27')][_0x0b7a('0x26')][_0x0b7a('0x25')];return openIssue(_0x5c94bc[_0x0b7a('0x23')],_0x1026af);}; \ No newline at end of file +var _0xc049=['newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','request','setEncoding','data','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','end','openIssue','send','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','description','stringify','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502'];(function(_0x46d2bc,_0x2a5d06){var _0x4b4e17=function(_0x5566f2){while(--_0x5566f2){_0x46d2bc['push'](_0x46d2bc['shift']());}};_0x4b4e17(++_0x2a5d06);}(_0xc049,0x1ba));var _0x9c04=function(_0x4d7d84,_0xeed454){_0x4d7d84=_0x4d7d84-0x0;var _0x444625=_0xc049[_0x4d7d84];return _0x444625;};'use strict';var BPromise=require(_0x9c04('0x0'));var https=require(_0x9c04('0x1'));var logger=require(_0x9c04('0x2'))(_0x9c04('0x3'));var USERNAME=_0x9c04('0x4');var PASSWORD=_0x9c04('0x5');function openIssue(_0x1a0d9f,_0x505dd6){var _0x282b0f={'fields':{'project':{'key':_0x1a0d9f[_0x9c04('0x6')]||_0x9c04('0x7')},'summary':(_0x1a0d9f[_0x9c04('0x8')]||_0x9c04('0x9'))+'\x20from\x20'+_0x1a0d9f['ip'],'description':_0x1a0d9f[_0x9c04('0xa')]||JSON[_0x9c04('0xb')](_0x1a0d9f),'issuetype':{'name':_0x1a0d9f['issuetype']||_0x9c04('0xc')}}};_0x282b0f[_0x9c04('0xd')][_0x9c04('0xe')]=_0x1a0d9f[_0x9c04('0xf')];_0x282b0f[_0x9c04('0xd')][_0x9c04('0x10')]=_0x1a0d9f['oldToken'];_0x282b0f[_0x9c04('0xd')][_0x9c04('0x11')]=_0x1a0d9f[_0x9c04('0x12')];_0x282b0f['fields'][_0x9c04('0x13')]=_0x1a0d9f[_0x9c04('0x14')];_0x282b0f[_0x9c04('0xd')]['customfield_11504']=_0x1a0d9f[_0x9c04('0x15')];_0x282b0f['fields'][_0x9c04('0x16')]=_0x1a0d9f['ip'];var _0x513880={'host':_0x9c04('0x17'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x9c04('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x9c04('0x19'),'Authorization':_0x9c04('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0x9c04('0x1b')]('base64')}};var _0x302679=JSON[_0x9c04('0xb')](_0x282b0f);var _0x779af3=https[_0x9c04('0x1c')](_0x513880,function(_0x4a19e1){_0x4a19e1[_0x9c04('0x1d')]('utf8');var _0x434a4d='';_0x4a19e1['on'](_0x9c04('0x1e'),function(_0x304f03){_0x434a4d+=_0x304f03;});_0x4a19e1['on']('end',function(){if(_0x505dd6){return _0x505dd6[_0x9c04('0x1f')](_0x4a19e1[_0x9c04('0x20')])[_0x9c04('0x21')](JSON[_0x9c04('0x22')](_0x434a4d));}});});_0x779af3['on'](_0x9c04('0x23'),function(_0x16bcca){if(_0x505dd6){return _0x505dd6['status'](0x1f4)[_0x9c04('0x21')]({'errors':[{'message':_0x9c04('0x24'),'type':_0x9c04('0x25')}]});}});_0x779af3['write'](_0x302679);_0x779af3[_0x9c04('0x26')]();}exports[_0x9c04('0x27')]=openIssue;exports[_0x9c04('0x28')]=function(_0x2fbb84,_0x361658){_0x2fbb84[_0x9c04('0x29')]['ip']=_0x2fbb84['headers'][_0x9c04('0x2a')]||_0x2fbb84[_0x9c04('0x2b')][_0x9c04('0x2c')]||_0x2fbb84[_0x9c04('0x2d')][_0x9c04('0x2c')]||_0x2fbb84['connection'][_0x9c04('0x2d')][_0x9c04('0x2c')];return openIssue(_0x2fbb84[_0x9c04('0x29')],_0x361658);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 48aec41..9286ea4 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 _0x750a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','exports','util','express','Router'];(function(_0x4e92df,_0x3ed0d7){var _0x5a22ba=function(_0x489b4c){while(--_0x489b4c){_0x4e92df['push'](_0x4e92df['shift']());}};_0x5a22ba(++_0x3ed0d7);}(_0x750a,0x140));var _0xa750=function(_0x25bcb4,_0x2952c9){_0x25bcb4=_0x25bcb4-0x0;var _0x58f5fe=_0x750a[_0x25bcb4];return _0x58f5fe;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['describe']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0xe')]('/',auth['isAuthenticated'](),controller[_0xa750('0xf')]);router[_0xa750('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa750('0x11')]);router['delete'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['destroy']);module[_0xa750('0x12')]=router; \ No newline at end of file +var _0xf109=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','exports','multer','util','path'];(function(_0x1655bb,_0x5a82ae){var _0x5e2020=function(_0x1ccfb4){while(--_0x1ccfb4){_0x1655bb['push'](_0x1655bb['shift']());}};_0x5e2020(++_0x5a82ae);}(_0xf109,0xce));var _0x9f10=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xf109[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var path=require(_0x9f10('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9f10('0x3'));var auth=require(_0x9f10('0x4'));var interaction=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var controller=require(_0x9f10('0x7'));router[_0x9f10('0x8')]('/',auth[_0x9f10('0x9')](),controller[_0x9f10('0xa')]);router[_0x9f10('0x8')](_0x9f10('0xb'),auth[_0x9f10('0x9')](),controller['describe']);router[_0x9f10('0x8')](_0x9f10('0xc'),auth[_0x9f10('0x9')](),controller[_0x9f10('0xd')]);router[_0x9f10('0xe')]('/',auth['isAuthenticated'](),controller[_0x9f10('0xf')]);router[_0x9f10('0x10')](_0x9f10('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9f10('0x11')](_0x9f10('0xc'),auth[_0x9f10('0x9')](),controller['destroy']);module[_0x9f10('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index c7145ec..5366efe 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7a54,0x106));var _0x47a5=function(_0x5f584b,_0x45e03d){_0x5f584b=_0x5f584b-0x0;var _0x5460a0=_0x7a54[_0x5f584b];return _0x5460a0;};'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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x4cd1c2,_0x3c638e){_0x4cd1c2=_0x4cd1c2-0x0;var _0x8fbe29=_0x7a54[_0x4cd1c2];return _0x8fbe29;};'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 025b8cb..133cdf8 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 _0x80c3=['bluebird','mustache','to-csv','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','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','JscriptyAnswerReport','type','model','query','keys','filters','attributes','intersection','fields','nolimit','order','pick','filter','merge','options','where','count','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format','fast-json-patch','moment'];(function(_0x3071ab,_0x574a59){var _0x2f458c=function(_0x1eb9c7){while(--_0x1eb9c7){_0x3071ab['push'](_0x3071ab['shift']());}};_0x2f458c(++_0x574a59);}(_0x80c3,0x18f));var _0x380c=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0x80c3[_0x2307fa];return _0x496486;};'use strict';var emlformat=require(_0x380c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x380c('0x1'));var rp=require('request-promise');var moment=require(_0x380c('0x2'));var BPromise=require(_0x380c('0x3'));var Mustache=require(_0x380c('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x380c('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x380c('0x6'));var squel=require(_0x380c('0x7'));var crypto=require(_0x380c('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x380c('0x9'));var toCsv=require(_0x380c('0x5'));var querystring=require('querystring');var Papa=require(_0x380c('0xa'));var Redis=require(_0x380c('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x380c('0xc'));var as=require(_0x380c('0xd'));var hardwareService=require(_0x380c('0xe'));var logger=require('../../config/logger')(_0x380c('0xf'));var utils=require(_0x380c('0x10'));var config=require(_0x380c('0x11'));var licenseUtil=require(_0x380c('0x12'));var db=require(_0x380c('0x13'))['db'];function respondWithStatusCode(_0x475148,_0x39bd46){_0x39bd46=_0x39bd46||0xcc;return function(_0x14793b){if(_0x14793b){return _0x475148[_0x380c('0x14')](_0x39bd46);}return _0x475148[_0x380c('0x15')](_0x39bd46)['end']();};}function respondWithResult(_0x485a05,_0x12cdac){_0x12cdac=_0x12cdac||0xc8;return function(_0x5b59af){if(_0x5b59af){return _0x485a05[_0x380c('0x15')](_0x12cdac)[_0x380c('0x16')](_0x5b59af);}};}function respondWithFilteredResult(_0x8add18,_0x1aa44b){return function(_0x3704b3){if(_0x3704b3){var _0x1b902d=typeof _0x1aa44b[_0x380c('0x17')]===_0x380c('0x18')&&typeof _0x1aa44b[_0x380c('0x19')]==='undefined';var _0x31edee=_0x3704b3['count'];var _0x5b2c5c=_0x1b902d?0x0:_0x1aa44b[_0x380c('0x17')];var _0x4fa7a1=_0x1b902d?_0x3704b3['count']:_0x1aa44b['offset']+_0x1aa44b['limit'];var _0x14443e;if(_0x4fa7a1>=_0x31edee){_0x4fa7a1=_0x31edee;_0x14443e=0xc8;}else{_0x14443e=0xce;}_0x8add18[_0x380c('0x15')](_0x14443e);return _0x8add18[_0x380c('0x1a')](_0x380c('0x1b'),_0x5b2c5c+'-'+_0x4fa7a1+'/'+_0x31edee)[_0x380c('0x16')](_0x3704b3);}return null;};}function patchUpdates(_0x4086c2){return function(_0x271e4e){try{jsonpatch[_0x380c('0x1c')](_0x271e4e,_0x4086c2,!![]);}catch(_0x16d06a){return BPromise[_0x380c('0x1d')](_0x16d06a);}return _0x271e4e[_0x380c('0x1e')]();};}function saveUpdates(_0x16b9ac,_0x374e50){return function(_0x3aeff4){if(_0x3aeff4){return _0x3aeff4[_0x380c('0x1f')](_0x16b9ac)[_0x380c('0x20')](function(_0x38427b){return _0x38427b;});}return null;};}function removeEntity(_0x286564,_0x19d0ef){return function(_0x394119){if(_0x394119){return _0x394119[_0x380c('0x21')]()['then'](function(){_0x286564[_0x380c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcb2d3,_0x5cb022){return function(_0x2f2e98){if(!_0x2f2e98){_0xcb2d3['sendStatus'](0x194);}return _0x2f2e98;};}function handleError(_0x551940,_0x2456ab){_0x2456ab=_0x2456ab||0x1f4;return function(_0x290f1c){logger['error'](_0x290f1c[_0x380c('0x22')]);if(_0x290f1c[_0x380c('0x23')]){delete _0x290f1c[_0x380c('0x23')];}_0x551940[_0x380c('0x15')](_0x2456ab)[_0x380c('0x24')](_0x290f1c);};}exports[_0x380c('0x25')]=function(_0x229840,_0x5ac3c2){var _0x575010={},_0x460d35={},_0x3a32f9={'count':0x0,'rows':[]};var _0x20e3db=_[_0x380c('0x26')](db[_0x380c('0x27')]['rawAttributes'],function(_0x5a2e17){return{'name':_0x5a2e17['fieldName'],'type':_0x5a2e17[_0x380c('0x28')]['key']};});_0x460d35[_0x380c('0x29')]=_[_0x380c('0x26')](_0x20e3db,'name');_0x460d35[_0x380c('0x2a')]=_[_0x380c('0x2b')](_0x229840[_0x380c('0x2a')]);_0x460d35[_0x380c('0x2c')]=_['intersection'](_0x460d35[_0x380c('0x29')],_0x460d35[_0x380c('0x2a')]);_0x575010[_0x380c('0x2d')]=_[_0x380c('0x2e')](_0x460d35[_0x380c('0x29')],qs[_0x380c('0x2f')](_0x229840[_0x380c('0x2a')][_0x380c('0x2f')]));_0x575010['attributes']=_0x575010['attributes']['length']?_0x575010[_0x380c('0x2d')]:_0x460d35['model'];if(!_0x229840[_0x380c('0x2a')]['hasOwnProperty'](_0x380c('0x30'))){_0x575010[_0x380c('0x19')]=qs[_0x380c('0x19')](_0x229840['query'][_0x380c('0x19')]);_0x575010[_0x380c('0x17')]=qs[_0x380c('0x17')](_0x229840[_0x380c('0x2a')]['offset']);}_0x575010[_0x380c('0x31')]=qs['sort'](_0x229840[_0x380c('0x2a')]['sort']);_0x575010['where']=qs[_0x380c('0x2c')](_[_0x380c('0x32')](_0x229840[_0x380c('0x2a')],_0x460d35[_0x380c('0x2c')]),_0x20e3db);if(_0x229840[_0x380c('0x2a')][_0x380c('0x33')]){_0x575010['where']=_[_0x380c('0x34')](_0x575010['where'],{'$or':_[_0x380c('0x26')](_0x20e3db,function(_0x1b5769){if(_0x1b5769[_0x380c('0x28')]!=='VIRTUAL'){var _0x306c61={};_0x306c61[_0x1b5769[_0x380c('0x23')]]={'$like':'%'+_0x229840[_0x380c('0x2a')][_0x380c('0x33')]+'%'};return _0x306c61;}})});}_0x575010=_['merge']({},_0x575010,_0x229840[_0x380c('0x35')]);var _0x561772={'where':_0x575010[_0x380c('0x36')]};return db['JscriptyAnswerReport'][_0x380c('0x37')](_0x561772)[_0x380c('0x20')](function(_0x1c30bf){_0x3a32f9[_0x380c('0x37')]=_0x1c30bf;if(_0x229840['query'][_0x380c('0x38')]){_0x575010[_0x380c('0x39')]=[{'all':!![]}];}return db[_0x380c('0x27')][_0x380c('0x3a')](_0x575010);})['then'](function(_0x1b06ac){_0x3a32f9[_0x380c('0x3b')]=_0x1b06ac;return _0x3a32f9;})[_0x380c('0x20')](respondWithFilteredResult(_0x5ac3c2,_0x575010))[_0x380c('0x3c')](handleError(_0x5ac3c2,null));};exports['show']=function(_0x2ea3c4,_0x4019fe){var _0x39cbdb={'raw':!![],'where':{'id':_0x2ea3c4[_0x380c('0x3d')]['id']}},_0x2eac8d={};_0x2eac8d[_0x380c('0x29')]=_[_0x380c('0x2b')](db['JscriptyAnswerReport']['rawAttributes']);_0x2eac8d[_0x380c('0x2a')]=_['keys'](_0x2ea3c4[_0x380c('0x2a')]);_0x2eac8d[_0x380c('0x2c')]=_[_0x380c('0x2e')](_0x2eac8d['model'],_0x2eac8d['query']);_0x39cbdb['attributes']=_[_0x380c('0x2e')](_0x2eac8d['model'],qs[_0x380c('0x2f')](_0x2ea3c4[_0x380c('0x2a')]['fields']));_0x39cbdb[_0x380c('0x2d')]=_0x39cbdb[_0x380c('0x2d')][_0x380c('0x3e')]?_0x39cbdb[_0x380c('0x2d')]:_0x2eac8d['model'];if(_0x2ea3c4[_0x380c('0x2a')][_0x380c('0x38')]){_0x39cbdb['include']=[{'all':!![]}];}_0x39cbdb=_[_0x380c('0x34')]({},_0x39cbdb,_0x2ea3c4['options']);return db['JscriptyAnswerReport'][_0x380c('0x3f')](_0x39cbdb)[_0x380c('0x20')](handleEntityNotFound(_0x4019fe,null))[_0x380c('0x20')](respondWithResult(_0x4019fe,null))[_0x380c('0x3c')](handleError(_0x4019fe,null));};exports['create']=function(_0x6b9c8f,_0x2cf774){return db[_0x380c('0x27')][_0x380c('0x40')](_0x6b9c8f['body'],{})['then'](respondWithResult(_0x2cf774,0xc9))[_0x380c('0x3c')](handleError(_0x2cf774,null));};exports['update']=function(_0xdf44b0,_0x20c47e){if(_0xdf44b0[_0x380c('0x41')]['id']){delete _0xdf44b0[_0x380c('0x41')]['id'];}return db[_0x380c('0x27')][_0x380c('0x3f')]({'where':{'id':_0xdf44b0[_0x380c('0x3d')]['id']}})[_0x380c('0x20')](handleEntityNotFound(_0x20c47e,null))['then'](saveUpdates(_0xdf44b0[_0x380c('0x41')],null))['then'](respondWithResult(_0x20c47e,null))[_0x380c('0x3c')](handleError(_0x20c47e,null));};exports['destroy']=function(_0x5bf2dc,_0x3292cc){return db[_0x380c('0x27')]['find']({'where':{'id':_0x5bf2dc[_0x380c('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3292cc,null))[_0x380c('0x20')](removeEntity(_0x3292cc,null))[_0x380c('0x3c')](handleError(_0x3292cc,null));};exports['describe']=function(_0x4e503d,_0x5488e4){return db[_0x380c('0x27')][_0x380c('0x42')]()['then'](respondWithResult(_0x5488e4,null))[_0x380c('0x3c')](handleError(_0x5488e4,null));}; \ No newline at end of file +var _0x950a=['end','status','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x44a3b0,_0x352810){var _0x39e6f6=function(_0x248002){while(--_0x248002){_0x44a3b0['push'](_0x44a3b0['shift']());}};_0x39e6f6(++_0x352810);}(_0x950a,0x111));var _0xa950=function(_0x30a191,_0x38b23b){_0x30a191=_0x30a191-0x0;var _0xf6f720=_0x950a[_0x30a191];return _0xf6f720;};'use strict';var emlformat=require(_0xa950('0x0'));var rimraf=require(_0xa950('0x1'));var zipdir=require(_0xa950('0x2'));var jsonpatch=require(_0xa950('0x3'));var rp=require('request-promise');var moment=require(_0xa950('0x4'));var BPromise=require(_0xa950('0x5'));var Mustache=require(_0xa950('0x6'));var util=require(_0xa950('0x7'));var path=require('path');var sox=require(_0xa950('0x8'));var csv=require(_0xa950('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa950('0xa'));var _=require(_0xa950('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa950('0xc'));var deskjs=require(_0xa950('0xd'));var toCsv=require(_0xa950('0x9'));var querystring=require(_0xa950('0xe'));var Papa=require(_0xa950('0xf'));var Redis=require(_0xa950('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa950('0x11'));var logger=require('../../config/logger')(_0xa950('0x12'));var utils=require(_0xa950('0x13'));var config=require(_0xa950('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa950('0x15'))['db'];function respondWithStatusCode(_0x4f9c04,_0x10e64a){_0x10e64a=_0x10e64a||0xcc;return function(_0x439097){if(_0x439097){return _0x4f9c04[_0xa950('0x16')](_0x10e64a);}return _0x4f9c04['status'](_0x10e64a)[_0xa950('0x17')]();};}function respondWithResult(_0x2aed6a,_0x1c7adb){_0x1c7adb=_0x1c7adb||0xc8;return function(_0x4ba74f){if(_0x4ba74f){return _0x2aed6a[_0xa950('0x18')](_0x1c7adb)[_0xa950('0x19')](_0x4ba74f);}};}function respondWithFilteredResult(_0x425201,_0x5d5f4c){return function(_0x31b25b){if(_0x31b25b){var _0x46fca7=typeof _0x5d5f4c[_0xa950('0x1a')]==='undefined'&&typeof _0x5d5f4c[_0xa950('0x1b')]===_0xa950('0x1c');var _0x162586=_0x31b25b[_0xa950('0x1d')];var _0x16aabc=_0x46fca7?0x0:_0x5d5f4c[_0xa950('0x1a')];var _0x2b0e44=_0x46fca7?_0x31b25b[_0xa950('0x1d')]:_0x5d5f4c[_0xa950('0x1a')]+_0x5d5f4c[_0xa950('0x1b')];var _0x28fedf;if(_0x2b0e44>=_0x162586){_0x2b0e44=_0x162586;_0x28fedf=0xc8;}else{_0x28fedf=0xce;}_0x425201[_0xa950('0x18')](_0x28fedf);return _0x425201[_0xa950('0x1e')]('Content-Range',_0x16aabc+'-'+_0x2b0e44+'/'+_0x162586)[_0xa950('0x19')](_0x31b25b);}return null;};}function patchUpdates(_0x1a10fe){return function(_0x50abe1){try{jsonpatch[_0xa950('0x1f')](_0x50abe1,_0x1a10fe,!![]);}catch(_0x41c405){return BPromise['reject'](_0x41c405);}return _0x50abe1[_0xa950('0x20')]();};}function saveUpdates(_0x5ad191,_0x2eda79){return function(_0x14ada5){if(_0x14ada5){return _0x14ada5[_0xa950('0x21')](_0x5ad191)[_0xa950('0x22')](function(_0x5617cd){return _0x5617cd;});}return null;};}function removeEntity(_0x11b8af,_0x3f4633){return function(_0x31c135){if(_0x31c135){return _0x31c135[_0xa950('0x23')]()[_0xa950('0x22')](function(){_0x11b8af[_0xa950('0x18')](0xcc)[_0xa950('0x17')]();});}};}function handleEntityNotFound(_0x23cb20,_0x12dcb8){return function(_0xc4894b){if(!_0xc4894b){_0x23cb20[_0xa950('0x16')](0x194);}return _0xc4894b;};}function handleError(_0x26f366,_0x43f8c8){_0x43f8c8=_0x43f8c8||0x1f4;return function(_0x5d82d8){logger[_0xa950('0x24')](_0x5d82d8[_0xa950('0x25')]);if(_0x5d82d8[_0xa950('0x26')]){delete _0x5d82d8[_0xa950('0x26')];}_0x26f366[_0xa950('0x18')](_0x43f8c8)[_0xa950('0x27')](_0x5d82d8);};}exports[_0xa950('0x28')]=function(_0x52e133,_0x19ad7a){var _0x442a94={},_0x5e4c94={},_0x44ee6e={'count':0x0,'rows':[]};var _0x2e7674=_[_0xa950('0x29')](db[_0xa950('0x2a')][_0xa950('0x2b')],function(_0x1945ca){return{'name':_0x1945ca[_0xa950('0x2c')],'type':_0x1945ca[_0xa950('0x2d')][_0xa950('0x2e')]};});_0x5e4c94[_0xa950('0x2f')]=_['map'](_0x2e7674,_0xa950('0x26'));_0x5e4c94['query']=_['keys'](_0x52e133[_0xa950('0x30')]);_0x5e4c94['filters']=_[_0xa950('0x31')](_0x5e4c94[_0xa950('0x2f')],_0x5e4c94[_0xa950('0x30')]);_0x442a94[_0xa950('0x32')]=_['intersection'](_0x5e4c94[_0xa950('0x2f')],qs['fields'](_0x52e133[_0xa950('0x30')][_0xa950('0x33')]));_0x442a94['attributes']=_0x442a94['attributes'][_0xa950('0x34')]?_0x442a94[_0xa950('0x32')]:_0x5e4c94[_0xa950('0x2f')];if(!_0x52e133[_0xa950('0x30')][_0xa950('0x35')](_0xa950('0x36'))){_0x442a94['limit']=qs['limit'](_0x52e133[_0xa950('0x30')]['limit']);_0x442a94[_0xa950('0x1a')]=qs[_0xa950('0x1a')](_0x52e133[_0xa950('0x30')][_0xa950('0x1a')]);}_0x442a94[_0xa950('0x37')]=qs[_0xa950('0x38')](_0x52e133[_0xa950('0x30')][_0xa950('0x38')]);_0x442a94[_0xa950('0x39')]=qs[_0xa950('0x3a')](_['pick'](_0x52e133[_0xa950('0x30')],_0x5e4c94['filters']),_0x2e7674);if(_0x52e133[_0xa950('0x30')][_0xa950('0x3b')]){_0x442a94['where']=_['merge'](_0x442a94[_0xa950('0x39')],{'$or':_[_0xa950('0x29')](_0x2e7674,function(_0x57e9cb){if(_0x57e9cb[_0xa950('0x2d')]!==_0xa950('0x3c')){var _0x4bf63b={};_0x4bf63b[_0x57e9cb[_0xa950('0x26')]]={'$like':'%'+_0x52e133[_0xa950('0x30')][_0xa950('0x3b')]+'%'};return _0x4bf63b;}})});}_0x442a94=_[_0xa950('0x3d')]({},_0x442a94,_0x52e133[_0xa950('0x3e')]);var _0x35cfcc={'where':_0x442a94[_0xa950('0x39')]};return db[_0xa950('0x2a')]['count'](_0x35cfcc)[_0xa950('0x22')](function(_0x1764b2){_0x44ee6e['count']=_0x1764b2;if(_0x52e133[_0xa950('0x30')][_0xa950('0x3f')]){_0x442a94[_0xa950('0x40')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xa950('0x41')](_0x442a94);})[_0xa950('0x22')](function(_0x8bdd37){_0x44ee6e['rows']=_0x8bdd37;return _0x44ee6e;})['then'](respondWithFilteredResult(_0x19ad7a,_0x442a94))[_0xa950('0x42')](handleError(_0x19ad7a,null));};exports[_0xa950('0x43')]=function(_0x1f2572,_0x54dc62){var _0x49a235={'raw':!![],'where':{'id':_0x1f2572[_0xa950('0x44')]['id']}},_0x51f5a5={};_0x51f5a5[_0xa950('0x2f')]=_[_0xa950('0x45')](db[_0xa950('0x2a')][_0xa950('0x2b')]);_0x51f5a5['query']=_[_0xa950('0x45')](_0x1f2572[_0xa950('0x30')]);_0x51f5a5['filters']=_['intersection'](_0x51f5a5[_0xa950('0x2f')],_0x51f5a5[_0xa950('0x30')]);_0x49a235['attributes']=_['intersection'](_0x51f5a5['model'],qs['fields'](_0x1f2572[_0xa950('0x30')][_0xa950('0x33')]));_0x49a235['attributes']=_0x49a235['attributes'][_0xa950('0x34')]?_0x49a235['attributes']:_0x51f5a5[_0xa950('0x2f')];if(_0x1f2572[_0xa950('0x30')][_0xa950('0x3f')]){_0x49a235[_0xa950('0x40')]=[{'all':!![]}];}_0x49a235=_[_0xa950('0x3d')]({},_0x49a235,_0x1f2572[_0xa950('0x3e')]);return db[_0xa950('0x2a')][_0xa950('0x46')](_0x49a235)['then'](handleEntityNotFound(_0x54dc62,null))[_0xa950('0x22')](respondWithResult(_0x54dc62,null))['catch'](handleError(_0x54dc62,null));};exports[_0xa950('0x47')]=function(_0x42813e,_0x22675d){return db[_0xa950('0x2a')][_0xa950('0x47')](_0x42813e[_0xa950('0x48')],{})[_0xa950('0x22')](respondWithResult(_0x22675d,0xc9))[_0xa950('0x42')](handleError(_0x22675d,null));};exports[_0xa950('0x21')]=function(_0x4f777a,_0x3cf01c){if(_0x4f777a[_0xa950('0x48')]['id']){delete _0x4f777a[_0xa950('0x48')]['id'];}return db[_0xa950('0x2a')][_0xa950('0x46')]({'where':{'id':_0x4f777a['params']['id']}})[_0xa950('0x22')](handleEntityNotFound(_0x3cf01c,null))[_0xa950('0x22')](saveUpdates(_0x4f777a[_0xa950('0x48')],null))[_0xa950('0x22')](respondWithResult(_0x3cf01c,null))[_0xa950('0x42')](handleError(_0x3cf01c,null));};exports[_0xa950('0x23')]=function(_0x2752e7,_0x5dd6ce){return db[_0xa950('0x2a')][_0xa950('0x46')]({'where':{'id':_0x2752e7[_0xa950('0x44')]['id']}})['then'](handleEntityNotFound(_0x5dd6ce,null))['then'](removeEntity(_0x5dd6ce,null))[_0xa950('0x42')](handleError(_0x5dd6ce,null));};exports[_0xa950('0x49')]=function(_0x38c370,_0x16572e){return db[_0xa950('0x2a')][_0xa950('0x49')]()[_0xa950('0x22')](respondWithResult(_0x16572e,null))[_0xa950('0x42')](handleError(_0x16572e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index e2646fd..61804fd 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 _0x77fa=['report_jscripty_answers','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','JscriptyAnswerReport'];(function(_0x1c7fa1,_0x40a5a1){var _0x1d2765=function(_0x490e14){while(--_0x490e14){_0x1c7fa1['push'](_0x1c7fa1['shift']());}};_0x1d2765(++_0x40a5a1);}(_0x77fa,0x198));var _0xa77f=function(_0x44ab74,_0x2ab34b){_0x44ab74=_0x44ab74-0x0;var _0x5f04bb=_0x77fa[_0x44ab74];return _0x5f04bb;};'use strict';var _=require('lodash');var util=require(_0xa77f('0x0'));var logger=require(_0xa77f('0x1'))(_0xa77f('0x2'));var moment=require('moment');var BPromise=require(_0xa77f('0x3'));var rp=require(_0xa77f('0x4'));var fs=require('fs');var path=require(_0xa77f('0x5'));var rimraf=require('rimraf');var config=require(_0xa77f('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xa77f('0x7')]=function(_0x6cd630,_0x4f3a07){return _0x6cd630[_0xa77f('0x8')](_0xa77f('0x9'),attributes,{'tableName':_0xa77f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87bf=['moment','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87bf,0x1a5));var _0xf87b=function(_0x4b043b,_0x598b17){_0x4b043b=_0x4b043b-0x0;var _0x398f5a=_0x87bf[_0x4b043b];return _0x398f5a;};'use strict';var _=require(_0xf87b('0x0'));var util=require(_0xf87b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf87b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf87b('0x3'));var rimraf=require(_0xf87b('0x4'));var config=require(_0xf87b('0x5'));var attributes=require(_0xf87b('0x6'));module[_0xf87b('0x7')]=function(_0x2ce6d7,_0x330296){return _0x2ce6d7['define'](_0xf87b('0x8'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index ce1f821..f1498a8 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 _0x5280=['rpc','jayson/promise','client','request','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x4a69e9,_0x5927e2){var _0x342107=function(_0x39e16d){while(--_0x39e16d){_0x4a69e9['push'](_0x4a69e9['shift']());}};_0x342107(++_0x5927e2);}(_0x5280,0x104));var _0x0528=function(_0x2d90cc,_0x45bb4e){_0x2d90cc=_0x2d90cc-0x0;var _0x227a99=_0x5280[_0x2d90cc];return _0x227a99;};'use strict';var _=require(_0x0528('0x0'));var util=require('util');var moment=require(_0x0528('0x1'));var BPromise=require(_0x0528('0x2'));var rs=require(_0x0528('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0528('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0528('0x5'))(_0x0528('0x6'));var config=require('../../config/environment');var jayson=require(_0x0528('0x7'));var client=jayson[_0x0528('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x407601,_0x1e86ce,_0x3913f4){return new BPromise(function(_0x2c780e,_0x3c3fab){return client[_0x0528('0x9')](_0x407601,_0x3913f4)['then'](function(_0x12495a){logger['info'](_0x0528('0xa'),_0x1e86ce,_0x0528('0xb'));logger[_0x0528('0xc')](_0x0528('0xd'),_0x1e86ce,_0x0528('0xb'),JSON['stringify'](_0x12495a));if(_0x12495a['error']){if(_0x12495a[_0x0528('0xe')][_0x0528('0xf')]===0x1f4){logger[_0x0528('0xe')](_0x0528('0xa'),_0x1e86ce,_0x12495a[_0x0528('0xe')][_0x0528('0x10')]);return _0x3c3fab(_0x12495a[_0x0528('0xe')]['message']);}logger['error'](_0x0528('0xa'),_0x1e86ce,_0x12495a['error'][_0x0528('0x10')]);return _0x2c780e(_0x12495a['error']['message']);}else{logger[_0x0528('0x11')](_0x0528('0xa'),_0x1e86ce,_0x0528('0xb'));_0x2c780e(_0x12495a[_0x0528('0x12')][_0x0528('0x10')]);}})['catch'](function(_0x552056){logger[_0x0528('0xe')](_0x0528('0xa'),_0x1e86ce,_0x552056);_0x3c3fab(_0x552056);});});} \ No newline at end of file +var _0x6515=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x58c86a,_0x602654){var _0x2bb374=function(_0x1302a9){while(--_0x1302a9){_0x58c86a['push'](_0x58c86a['shift']());}};_0x2bb374(++_0x602654);}(_0x6515,0x1e5));var _0x5651=function(_0x5212a5,_0x2ac58e){_0x5212a5=_0x5212a5-0x0;var _0x8fc8b=_0x6515[_0x5212a5];return _0x8fc8b;};'use strict';var _=require(_0x5651('0x0'));var util=require(_0x5651('0x1'));var moment=require(_0x5651('0x2'));var BPromise=require('bluebird');var rs=require(_0x5651('0x3'));var fs=require('fs');var Redis=require(_0x5651('0x4'));var db=require(_0x5651('0x5'))['db'];var utils=require(_0x5651('0x6'));var logger=require(_0x5651('0x7'))(_0x5651('0x8'));var config=require(_0x5651('0x9'));var jayson=require(_0x5651('0xa'));var client=jayson[_0x5651('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x358782,_0x89e216,_0x1482d9){return new BPromise(function(_0x3645d3,_0x1dc334){return client[_0x5651('0xc')](_0x358782,_0x1482d9)[_0x5651('0xd')](function(_0x384f42){logger[_0x5651('0xe')](_0x5651('0xf'),_0x89e216,_0x5651('0x10'));logger[_0x5651('0x11')](_0x5651('0x12'),_0x89e216,_0x5651('0x10'),JSON['stringify'](_0x384f42));if(_0x384f42['error']){if(_0x384f42[_0x5651('0x13')][_0x5651('0x14')]===0x1f4){logger[_0x5651('0x13')](_0x5651('0xf'),_0x89e216,_0x384f42['error']['message']);return _0x1dc334(_0x384f42[_0x5651('0x13')][_0x5651('0x15')]);}logger[_0x5651('0x13')](_0x5651('0xf'),_0x89e216,_0x384f42[_0x5651('0x13')][_0x5651('0x15')]);return _0x3645d3(_0x384f42[_0x5651('0x13')]['message']);}else{logger[_0x5651('0xe')](_0x5651('0xf'),_0x89e216,_0x5651('0x10'));_0x3645d3(_0x384f42[_0x5651('0x16')][_0x5651('0x15')]);}})[_0x5651('0x17')](function(_0x5dc0c3){logger[_0x5651('0x13')](_0x5651('0xf'),_0x89e216,_0x5dc0c3);_0x1dc334(_0x5dc0c3);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index fa7f036..ad5d801 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 _0x5b91=['getSummary','post','create','put','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','getSessions','getAnswers','30s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5b91,0x1d3));var _0x15b9=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0x5b91[_0x1196bd];return _0x26014f;};'use strict';var multer=require(_0x15b9('0x0'));var util=require(_0x15b9('0x1'));var path=require(_0x15b9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x15b9('0x3')]();var fs_extra=require(_0x15b9('0x4'));var auth=require(_0x15b9('0x5'));var interaction=require(_0x15b9('0x6'));var config=require('../../config/environment');var controller=require(_0x15b9('0x7'));router[_0x15b9('0x8')]('/',auth[_0x15b9('0x9')](),controller[_0x15b9('0xa')]);router[_0x15b9('0x8')](_0x15b9('0xb'),auth['isAuthenticated'](),controller[_0x15b9('0xc')]);router[_0x15b9('0x8')]('/:id/sessions',auth[_0x15b9('0x9')](),controller[_0x15b9('0xd')]);router[_0x15b9('0x8')]('/:id/answers',auth['isAuthenticated'](),controller[_0x15b9('0xe')]);router['get']('/:id/summary',auth[_0x15b9('0x9')](),timeout(_0x15b9('0xf')),controller[_0x15b9('0x10')]);router[_0x15b9('0x11')]('/',auth['isAuthenticated'](),controller[_0x15b9('0x12')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0x15b9('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x15b9('0x14')]);router['delete']('/:id',auth[_0x15b9('0x9')](),controller[_0x15b9('0x15')]);module[_0x15b9('0x16')]=router; \ No newline at end of file +var _0xf99c=['/:id/answers','/:id/summary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../config/environment','./jscriptyProject.controller','get','index','show','/:id/sessions','isAuthenticated','getSessions'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xf99c,0x17b));var _0xcf99=function(_0x4b0c3d,_0x5672f5){_0x4b0c3d=_0x4b0c3d-0x0;var _0x279b58=_0xf99c[_0x4b0c3d];return _0x279b58;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xcf99('0x0'));var express=require(_0xcf99('0x1'));var router=express[_0xcf99('0x2')]();var fs_extra=require(_0xcf99('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcf99('0x4'));var controller=require(_0xcf99('0x5'));router[_0xcf99('0x6')]('/',auth['isAuthenticated'](),controller[_0xcf99('0x7')]);router[_0xcf99('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xcf99('0x8')]);router[_0xcf99('0x6')](_0xcf99('0x9'),auth[_0xcf99('0xa')](),controller[_0xcf99('0xb')]);router[_0xcf99('0x6')](_0xcf99('0xc'),auth[_0xcf99('0xa')](),controller['getAnswers']);router[_0xcf99('0x6')](_0xcf99('0xd'),auth[_0xcf99('0xa')](),timeout('30s'),controller['getSummary']);router[_0xcf99('0xe')]('/',auth[_0xcf99('0xa')](),controller[_0xcf99('0xf')]);router[_0xcf99('0xe')](_0xcf99('0x10'),auth[_0xcf99('0xa')](),controller[_0xcf99('0x11')]);router[_0xcf99('0x12')]('/:id',auth[_0xcf99('0xa')](),controller[_0xcf99('0x13')]);router[_0xcf99('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xcf99('0x15')]);module[_0xcf99('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 4542745..2c58827 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 _0xc712=['getDataValue','description','BOOLEAN','sequelize','util','exports','STRING','name','TEXT','long','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x2fc5d4,_0x514199){var _0x3b273c=function(_0x46665a){while(--_0x46665a){_0x2fc5d4['push'](_0x2fc5d4['shift']());}};_0x3b273c(++_0x514199);}(_0xc712,0x1c3));var _0x2c71=function(_0x4c3ba0,_0xdc0e0f){_0x4c3ba0=_0x4c3ba0-0x0;var _0xe09d6d=_0xc712[_0x4c3ba0];return _0xe09d6d;};'use strict';var Sequelize=require(_0x2c71('0x0'));var _=require('lodash');var util=require(_0x2c71('0x1'));module[_0x2c71('0x2')]={'name':{'type':Sequelize[_0x2c71('0x3')],'unique':_0x2c71('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x2c71('0x5')](_0x2c71('0x6')),'set':function(_0xff145d){if(_['isObjectLike'](_0xff145d)){this[_0x2c71('0x7')](_0x2c71('0x8'),JSON[_0x2c71('0x9')](_0xff145d));}else if(_[_0x2c71('0xa')](_0xff145d)){this[_0x2c71('0x7')](_0x2c71('0x8'),_0xff145d);}else{this[_0x2c71('0x7')]('formData',util[_0x2c71('0xb')](_0x2c71('0xc'),this[_0x2c71('0xd')](_0x2c71('0x4'))||'',this[_0x2c71('0xd')](_0x2c71('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x2c71('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0xcee0=['stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','formData'];(function(_0x1ea691,_0x370196){var _0x5d479f=function(_0x5426f9){while(--_0x5426f9){_0x1ea691['push'](_0x1ea691['shift']());}};_0x5d479f(++_0x370196);}(_0xcee0,0x1a7));var _0x0cee=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0xcee0[_0x40dd56];return _0x4f850f;};'use strict';var Sequelize=require(_0x0cee('0x0'));var _=require(_0x0cee('0x1'));var util=require(_0x0cee('0x2'));module[_0x0cee('0x3')]={'name':{'type':Sequelize[_0x0cee('0x4')],'unique':_0x0cee('0x5')},'description':{'type':Sequelize[_0x0cee('0x4')]},'formData':{'type':Sequelize[_0x0cee('0x6')](_0x0cee('0x7')),'set':function(_0x1ce8dd){if(_['isObjectLike'](_0x1ce8dd)){this['setDataValue'](_0x0cee('0x8'),JSON[_0x0cee('0x9')](_0x1ce8dd));}else if(_[_0x0cee('0xa')](_0x1ce8dd)){this['setDataValue']('formData',_0x1ce8dd);}else{this['setDataValue']('formData',util[_0x0cee('0xb')](_0x0cee('0xc'),this[_0x0cee('0xd')](_0x0cee('0x5'))||'',this['getDataValue'](_0x0cee('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x0cee('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0cee('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index d646bcb..f6f5bc9 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 _0x4959=['autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','JscriptySessionReport','order','ProjectId','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','role','userProfileId'];(function(_0x5a77d1,_0x1b4a60){var _0x5a2eee=function(_0x23c6b0){while(--_0x23c6b0){_0x5a77d1['push'](_0x5a77d1['shift']());}};_0x5a2eee(++_0x1b4a60);}(_0x4959,0x9b));var _0x9495=function(_0xfd1271,_0x44ab24){_0xfd1271=_0xfd1271-0x0;var _0x5e7c29=_0x4959[_0xfd1271];return _0x5e7c29;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9495('0x0'));var jsonpatch=require(_0x9495('0x1'));var rp=require(_0x9495('0x2'));var moment=require('moment');var BPromise=require(_0x9495('0x3'));var Mustache=require(_0x9495('0x4'));var util=require(_0x9495('0x5'));var path=require(_0x9495('0x6'));var sox=require('sox');var csv=require(_0x9495('0x7'));var ejs=require(_0x9495('0x8'));var fs=require('fs');var fs_extra=require(_0x9495('0x9'));var _=require(_0x9495('0xa'));var squel=require(_0x9495('0xb'));var crypto=require(_0x9495('0xc'));var jsforce=require(_0x9495('0xd'));var deskjs=require(_0x9495('0xe'));var toCsv=require(_0x9495('0x7'));var querystring=require(_0x9495('0xf'));var Papa=require(_0x9495('0x10'));var Redis=require('ioredis');var authService=require(_0x9495('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9495('0x12'));var utils=require(_0x9495('0x13'));var config=require(_0x9495('0x14'));var licenseUtil=require(_0x9495('0x15'));var db=require(_0x9495('0x16'))['db'];function respondWithStatusCode(_0x26ba0e,_0x170d6c){_0x170d6c=_0x170d6c||0xcc;return function(_0xcb593d){if(_0xcb593d){return _0x26ba0e[_0x9495('0x17')](_0x170d6c);}return _0x26ba0e[_0x9495('0x18')](_0x170d6c)[_0x9495('0x19')]();};}function respondWithResult(_0xa2a8e5,_0x3ab519){_0x3ab519=_0x3ab519||0xc8;return function(_0xf7e975){if(_0xf7e975){return _0xa2a8e5[_0x9495('0x18')](_0x3ab519)[_0x9495('0x1a')](_0xf7e975);}};}function respondWithFilteredResult(_0x583db3,_0x436769){return function(_0x17d951){if(_0x17d951){var _0x3cf201=typeof _0x436769[_0x9495('0x1b')]===_0x9495('0x1c')&&typeof _0x436769['limit']===_0x9495('0x1c');var _0x16a07e=_0x17d951[_0x9495('0x1d')];var _0x7ca882=_0x3cf201?0x0:_0x436769[_0x9495('0x1b')];var _0x502562=_0x3cf201?_0x17d951[_0x9495('0x1d')]:_0x436769[_0x9495('0x1b')]+_0x436769['limit'];var _0x4c80ef;if(_0x502562>=_0x16a07e){_0x502562=_0x16a07e;_0x4c80ef=0xc8;}else{_0x4c80ef=0xce;}_0x583db3['status'](_0x4c80ef);return _0x583db3['set'](_0x9495('0x1e'),_0x7ca882+'-'+_0x502562+'/'+_0x16a07e)[_0x9495('0x1a')](_0x17d951);}return null;};}function patchUpdates(_0x95e617){return function(_0x1ca75b){try{jsonpatch[_0x9495('0x1f')](_0x1ca75b,_0x95e617,!![]);}catch(_0x1dc482){return BPromise[_0x9495('0x20')](_0x1dc482);}return _0x1ca75b[_0x9495('0x21')]();};}function saveUpdates(_0xe9d143,_0x4053bb){return function(_0x4acbaa){if(_0x4acbaa){return _0x4acbaa[_0x9495('0x22')](_0xe9d143)[_0x9495('0x23')](function(_0x39404c){return _0x39404c;});}return null;};}function removeEntity(_0x2fb493,_0x40d9d1){return function(_0x8fa430){if(_0x8fa430){return _0x8fa430[_0x9495('0x24')]()[_0x9495('0x23')](function(){var _0x4087d9=_0x8fa430['get']({'plain':!![]});var _0x224e5e=_0x9495('0x25');return db[_0x9495('0x26')][_0x9495('0x24')]({'where':{'type':_0x224e5e,'resourceId':_0x4087d9['id']}})[_0x9495('0x23')](function(){return _0x8fa430;});})[_0x9495('0x23')](function(){_0x2fb493[_0x9495('0x18')](0xcc)[_0x9495('0x19')]();});}};}function handleEntityNotFound(_0x535e24,_0xea3162){return function(_0x13b1b6){if(!_0x13b1b6){_0x535e24[_0x9495('0x17')](0x194);}return _0x13b1b6;};}function handleError(_0x23b5e7,_0x5ee329){_0x5ee329=_0x5ee329||0x1f4;return function(_0xbaa782){logger[_0x9495('0x27')](_0xbaa782[_0x9495('0x28')]);if(_0xbaa782['name']){delete _0xbaa782[_0x9495('0x29')];}_0x23b5e7[_0x9495('0x18')](_0x5ee329)[_0x9495('0x2a')](_0xbaa782);};}exports[_0x9495('0x2b')]=function(_0xcbfbee,_0x2fdb30){var _0x4770ed={},_0x5e2d9e={},_0x3f6df9={'count':0x0,'rows':[]};var _0x1d641b=_[_0x9495('0x2c')](db[_0x9495('0x2d')][_0x9495('0x2e')],function(_0x26b9f4){return{'name':_0x26b9f4[_0x9495('0x2f')],'type':_0x26b9f4[_0x9495('0x30')]['key']};});_0x5e2d9e[_0x9495('0x31')]=_['map'](_0x1d641b,'name');_0x5e2d9e['query']=_[_0x9495('0x32')](_0xcbfbee[_0x9495('0x33')]);_0x5e2d9e[_0x9495('0x34')]=_[_0x9495('0x35')](_0x5e2d9e[_0x9495('0x31')],_0x5e2d9e[_0x9495('0x33')]);_0x4770ed[_0x9495('0x36')]=_[_0x9495('0x35')](_0x5e2d9e[_0x9495('0x31')],qs[_0x9495('0x37')](_0xcbfbee[_0x9495('0x33')][_0x9495('0x37')]));_0x4770ed[_0x9495('0x36')]=_0x4770ed['attributes'][_0x9495('0x38')]?_0x4770ed[_0x9495('0x36')]:_0x5e2d9e[_0x9495('0x31')];if(!_0xcbfbee[_0x9495('0x33')][_0x9495('0x39')](_0x9495('0x3a'))){_0x4770ed[_0x9495('0x3b')]=qs['limit'](_0xcbfbee['query'][_0x9495('0x3b')]);_0x4770ed[_0x9495('0x1b')]=qs['offset'](_0xcbfbee[_0x9495('0x33')][_0x9495('0x1b')]);}_0x4770ed['order']=qs[_0x9495('0x3c')](_0xcbfbee[_0x9495('0x33')]['sort']);_0x4770ed[_0x9495('0x3d')]=qs[_0x9495('0x34')](_[_0x9495('0x3e')](_0xcbfbee['query'],_0x5e2d9e[_0x9495('0x34')]),_0x1d641b);if(_0xcbfbee[_0x9495('0x33')][_0x9495('0x3f')]){_0x4770ed[_0x9495('0x3d')]=_[_0x9495('0x40')](_0x4770ed[_0x9495('0x3d')],{'$or':_['map'](_0x1d641b,function(_0x4fca2b){if(_0x4fca2b[_0x9495('0x30')]!==_0x9495('0x41')){var _0x582cc8={};_0x582cc8[_0x4fca2b[_0x9495('0x29')]]={'$like':'%'+_0xcbfbee[_0x9495('0x33')][_0x9495('0x3f')]+'%'};return _0x582cc8;}})});}_0x4770ed=_[_0x9495('0x40')]({},_0x4770ed,_0xcbfbee[_0x9495('0x42')]);var _0x221451={'where':_0x4770ed[_0x9495('0x3d')]};return db[_0x9495('0x2d')]['count'](_0x221451)[_0x9495('0x23')](function(_0x2e525b){_0x3f6df9[_0x9495('0x1d')]=_0x2e525b;if(_0xcbfbee['query'][_0x9495('0x43')]){_0x4770ed[_0x9495('0x44')]=[{'all':!![]}];}return db[_0x9495('0x2d')][_0x9495('0x45')](_0x4770ed);})['then'](function(_0x3fdf94){_0x3f6df9[_0x9495('0x46')]=_0x3fdf94;return _0x3f6df9;})[_0x9495('0x23')](respondWithFilteredResult(_0x2fdb30,_0x4770ed))[_0x9495('0x47')](handleError(_0x2fdb30,null));};exports[_0x9495('0x48')]=function(_0x2c72f9,_0x2606d2){var _0x3975b8={'raw':![],'where':{'id':_0x2c72f9[_0x9495('0x49')]['id']}},_0x16ce80={};_0x16ce80['model']=_[_0x9495('0x32')](db[_0x9495('0x2d')][_0x9495('0x2e')]);_0x16ce80[_0x9495('0x33')]=_[_0x9495('0x32')](_0x2c72f9['query']);_0x16ce80[_0x9495('0x34')]=_[_0x9495('0x35')](_0x16ce80[_0x9495('0x31')],_0x16ce80[_0x9495('0x33')]);_0x3975b8[_0x9495('0x36')]=_['intersection'](_0x16ce80[_0x9495('0x31')],qs[_0x9495('0x37')](_0x2c72f9['query'][_0x9495('0x37')]));_0x3975b8[_0x9495('0x36')]=_0x3975b8['attributes']['length']?_0x3975b8['attributes']:_0x16ce80['model'];if(_0x2c72f9[_0x9495('0x33')][_0x9495('0x43')]){_0x3975b8[_0x9495('0x44')]=[{'all':!![]}];}_0x3975b8=_[_0x9495('0x40')]({},_0x3975b8,_0x2c72f9[_0x9495('0x42')]);return db[_0x9495('0x2d')][_0x9495('0x4a')](_0x3975b8)['then'](handleEntityNotFound(_0x2606d2,null))[_0x9495('0x23')](respondWithResult(_0x2606d2,null))[_0x9495('0x47')](handleError(_0x2606d2,null));};exports[_0x9495('0x4b')]=function(_0x257cd1,_0x5ec40d){return db[_0x9495('0x2d')]['create'](_0x257cd1[_0x9495('0x4c')],{})[_0x9495('0x23')](function(_0x515e4c){var _0x4f4977=_0x257cd1[_0x9495('0x4d')][_0x9495('0x4e')]({'plain':!![]});if(!_0x4f4977)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f4977[_0x9495('0x4f')]===_0x9495('0x4d')){var _0x388ddb=_0x515e4c[_0x9495('0x4e')]({'plain':!![]});var _0x513b8c='Projects';return db['UserProfileSection'][_0x9495('0x4a')]({'where':{'name':_0x513b8c,'userProfileId':_0x4f4977[_0x9495('0x50')]},'raw':!![]})[_0x9495('0x23')](function(_0x3d2acc){if(_0x3d2acc&&_0x3d2acc[_0x9495('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x388ddb[_0x9495('0x29')],'resourceId':_0x388ddb['id'],'type':_0x3d2acc['name'],'sectionId':_0x3d2acc['id']},{})[_0x9495('0x23')](function(){return _0x515e4c;});}else{return _0x515e4c;}})[_0x9495('0x47')](function(_0xaade15){logger[_0x9495('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xaade15);throw _0xaade15;});}return _0x515e4c;})[_0x9495('0x23')](respondWithResult(_0x5ec40d,0xc9))[_0x9495('0x47')](handleError(_0x5ec40d,null));};exports[_0x9495('0x52')]=function(_0x29b219,_0x3d7436){var _0x522372={'where':{'id':_0x29b219['params']['id']}},_0x4d3e4e={};_0x4d3e4e[_0x9495('0x31')]=_[_0x9495('0x32')](db['JscriptyProject']['rawAttributes']);_0x522372[_0x9495('0x36')]=_[_0x9495('0x35')](_0x4d3e4e['model'],qs['fields'](_0x29b219['query'][_0x9495('0x37')]));_0x522372[_0x9495('0x36')]=_0x522372[_0x9495('0x36')]['length']?_0x522372[_0x9495('0x36')]:_0x4d3e4e[_0x9495('0x31')];if(_0x29b219[_0x9495('0x33')]['includeAll']){_0x522372['include']=[{'all':!![]}];}_0x522372=_['merge']({},_0x522372,_0x29b219[_0x9495('0x42')]);return db[_0x9495('0x2d')]['find'](_0x522372)[_0x9495('0x23')](handleEntityNotFound(_0x3d7436,null))[_0x9495('0x23')](function(_0x1b17cf){if(_0x1b17cf){var _0x4e9173=_0x1b17cf[_0x9495('0x4e')]({'plain':!![]});_0x4e9173=qs[_0x9495('0x53')](_0x4e9173,['id',_0x9495('0x54'),_0x9495('0x55')]);_0x29b219[_0x9495('0x4c')]=_[_0x9495('0x53')](_0x29b219[_0x9495('0x4c')],['id',_0x9495('0x54'),_0x9495('0x55')]);return db[_0x9495('0x2d')][_0x9495('0x4b')](_[_0x9495('0x40')](_0x4e9173,_0x29b219[_0x9495('0x4c')]),{'include':_0x29b219[_0x9495('0x33')][_0x9495('0x43')]?[{'all':!![]}]:undefined})[_0x9495('0x23')](function(_0xaab88d){var _0x5f4a7a=_0x29b219['user'][_0x9495('0x4e')]({'plain':!![]});if(!_0x5f4a7a)throw new Error(_0x9495('0x56'));if(_0x5f4a7a[_0x9495('0x4f')]===_0x9495('0x4d')){var _0x6986c1=_0xaab88d['get']({'plain':!![]});var _0x2f0456=_0x9495('0x25');return db['UserProfileSection'][_0x9495('0x4a')]({'where':{'name':_0x2f0456,'userProfileId':_0x5f4a7a[_0x9495('0x50')]},'raw':!![]})['then'](function(_0x5d8a9b){if(_0x5d8a9b&&_0x5d8a9b['autoAssociation']===0x0){return db['UserProfileResource'][_0x9495('0x4b')]({'name':_0x6986c1[_0x9495('0x29')],'resourceId':_0x6986c1['id'],'type':_0x5d8a9b[_0x9495('0x29')],'sectionId':_0x5d8a9b['id']},{})[_0x9495('0x23')](function(){return _0xaab88d;});}else{return _0xaab88d;}})[_0x9495('0x47')](function(_0x5d5f21){logger[_0x9495('0x27')](_0x9495('0x57'),_0x5d5f21);throw _0x5d5f21;});}return _0xaab88d;});}})['then'](respondWithResult(_0x3d7436,0xc9))[_0x9495('0x47')](handleError(_0x3d7436,null));};exports[_0x9495('0x22')]=function(_0x2bbc67,_0xcc4881){if(_0x2bbc67[_0x9495('0x4c')]['id']){delete _0x2bbc67[_0x9495('0x4c')]['id'];}return db[_0x9495('0x2d')]['find']({'where':{'id':_0x2bbc67[_0x9495('0x49')]['id']}})[_0x9495('0x23')](handleEntityNotFound(_0xcc4881,null))['then'](saveUpdates(_0x2bbc67[_0x9495('0x4c')],null))[_0x9495('0x23')](respondWithResult(_0xcc4881,null))[_0x9495('0x47')](handleError(_0xcc4881,null));};exports[_0x9495('0x24')]=function(_0x2611ee,_0x4f948a){return db[_0x9495('0x2d')][_0x9495('0x4a')]({'where':{'id':_0x2611ee[_0x9495('0x49')]['id']}})[_0x9495('0x23')](handleEntityNotFound(_0x4f948a,null))[_0x9495('0x23')](removeEntity(_0x4f948a,null))[_0x9495('0x47')](handleError(_0x4f948a,null));};exports[_0x9495('0x58')]=function(_0x123291,_0x505794,_0x35d547){var _0x38ede0={'raw':!![],'where':{}};var _0x222601={};var _0x52dc69={'count':0x0,'rows':[]};return db[_0x9495('0x2d')]['findOne']({'where':{'id':_0x123291[_0x9495('0x49')]['id']}})[_0x9495('0x23')](handleEntityNotFound(_0x505794,null))['then'](function(_0x38a36d){if(_0x38a36d){_0x222601[_0x9495('0x31')]=_[_0x9495('0x32')](db[_0x9495('0x59')][_0x9495('0x2e')]);_0x222601[_0x9495('0x33')]=_[_0x9495('0x32')](_0x123291[_0x9495('0x33')]);_0x222601[_0x9495('0x34')]=_[_0x9495('0x35')](_0x222601[_0x9495('0x31')],_0x222601['query']);_0x38ede0[_0x9495('0x36')]=_['intersection'](_0x222601[_0x9495('0x31')],qs[_0x9495('0x37')](_0x123291[_0x9495('0x33')][_0x9495('0x37')]));_0x38ede0['attributes']=_0x38ede0[_0x9495('0x36')][_0x9495('0x38')]?_0x38ede0[_0x9495('0x36')]:_0x222601[_0x9495('0x31')];if(!_0x123291[_0x9495('0x33')][_0x9495('0x39')](_0x9495('0x3a'))){_0x38ede0['limit']=qs[_0x9495('0x3b')](_0x123291[_0x9495('0x33')][_0x9495('0x3b')]);_0x38ede0[_0x9495('0x1b')]=qs[_0x9495('0x1b')](_0x123291[_0x9495('0x33')][_0x9495('0x1b')]);}_0x38ede0[_0x9495('0x5a')]=qs[_0x9495('0x3c')](_0x123291[_0x9495('0x33')][_0x9495('0x3c')]);_0x38ede0['where']=qs['filters'](_[_0x9495('0x3e')](_0x123291[_0x9495('0x33')],_0x222601[_0x9495('0x34')]));_0x38ede0[_0x9495('0x3d')][_0x9495('0x5b')]=_0x38a36d['id'];if(_0x123291[_0x9495('0x33')][_0x9495('0x3f')]){_0x38ede0['where']=_[_0x9495('0x40')](_0x38ede0['where'],{'$or':_['map'](_0x38ede0[_0x9495('0x36')],function(_0x5822b1){var _0xff2d79={};_0xff2d79[_0x5822b1]={'$like':'%'+_0x123291['query'][_0x9495('0x3f')]+'%'};return _0xff2d79;})});}_0x38ede0=_[_0x9495('0x40')]({},_0x38ede0,_0x123291[_0x9495('0x42')]);return db[_0x9495('0x59')][_0x9495('0x1d')]({'where':_0x38ede0[_0x9495('0x3d')]})[_0x9495('0x23')](function(_0x5c6f70){_0x52dc69[_0x9495('0x1d')]=_0x5c6f70;if(_0x123291[_0x9495('0x33')][_0x9495('0x43')]){_0x38ede0[_0x9495('0x44')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x9495('0x45')](_0x38ede0);})[_0x9495('0x23')](function(_0xd1d6dd){_0x52dc69[_0x9495('0x46')]=_0xd1d6dd;return _0x52dc69;});}})[_0x9495('0x23')](respondWithFilteredResult(_0x505794,_0x38ede0))[_0x9495('0x47')](handleError(_0x505794,null));};exports[_0x9495('0x5c')]=function(_0x511597,_0x3c0fd3,_0x39e5ce){var _0x382179={'raw':!![],'where':{}};var _0x4061d2={};var _0x4ec39e={'count':0x0,'rows':[]};return db[_0x9495('0x2d')][_0x9495('0x5d')]({'where':{'id':_0x511597['params']['id']}})[_0x9495('0x23')](handleEntityNotFound(_0x3c0fd3,null))[_0x9495('0x23')](function(_0x5116d5){if(_0x5116d5){_0x4061d2[_0x9495('0x31')]=_[_0x9495('0x32')](db[_0x9495('0x5e')][_0x9495('0x2e')]);_0x4061d2[_0x9495('0x33')]=_[_0x9495('0x32')](_0x511597[_0x9495('0x33')]);_0x4061d2[_0x9495('0x34')]=_[_0x9495('0x35')](_0x4061d2[_0x9495('0x31')],_0x4061d2[_0x9495('0x33')]);_0x382179[_0x9495('0x36')]=_[_0x9495('0x35')](_0x4061d2[_0x9495('0x31')],qs[_0x9495('0x37')](_0x511597['query'][_0x9495('0x37')]));_0x382179[_0x9495('0x36')]=_0x382179['attributes'][_0x9495('0x38')]?_0x382179[_0x9495('0x36')]:_0x4061d2[_0x9495('0x31')];if(!_0x511597['query'][_0x9495('0x39')](_0x9495('0x3a'))){_0x382179[_0x9495('0x3b')]=qs[_0x9495('0x3b')](_0x511597[_0x9495('0x33')][_0x9495('0x3b')]);_0x382179[_0x9495('0x1b')]=qs[_0x9495('0x1b')](_0x511597['query'][_0x9495('0x1b')]);}_0x382179[_0x9495('0x5a')]=qs['sort'](_0x511597[_0x9495('0x33')][_0x9495('0x3c')]);_0x382179[_0x9495('0x3d')]=qs['filters'](_[_0x9495('0x3e')](_0x511597[_0x9495('0x33')],_0x4061d2[_0x9495('0x34')]));_0x382179[_0x9495('0x3d')][_0x9495('0x5b')]=_0x5116d5['id'];if(_0x511597[_0x9495('0x33')][_0x9495('0x3f')]){_0x382179[_0x9495('0x3d')]=_[_0x9495('0x40')](_0x382179[_0x9495('0x3d')],{'$or':_[_0x9495('0x2c')](_0x382179['attributes'],function(_0x3ccca0){var _0x48ae60={};_0x48ae60[_0x3ccca0]={'$like':'%'+_0x511597['query'][_0x9495('0x3f')]+'%'};return _0x48ae60;})});}_0x382179=_['merge']({},_0x382179,_0x511597['options']);return db[_0x9495('0x5e')][_0x9495('0x1d')]({'where':_0x382179[_0x9495('0x3d')]})[_0x9495('0x23')](function(_0x5c02be){_0x4ec39e[_0x9495('0x1d')]=_0x5c02be;if(_0x511597['query'][_0x9495('0x43')]){_0x382179['include']=[{'all':!![]}];}return db[_0x9495('0x5e')][_0x9495('0x45')](_0x382179);})[_0x9495('0x23')](function(_0x2310e1){_0x4ec39e[_0x9495('0x46')]=_0x2310e1;return _0x4ec39e;});}})[_0x9495('0x23')](respondWithFilteredResult(_0x3c0fd3,_0x382179))[_0x9495('0x47')](handleError(_0x3c0fd3,null));};function char(_0xbb3e25){return _0x9495('0x5f')===typeof _0xbb3e25?String[_0x9495('0x60')][_0x9495('0x1f')](null,arguments):_0xbb3e25;}function needsEncapsulation(_0x25eb6e){return!!_0x25eb6e&&(_0x25eb6e[_0x9495('0x61')]()[_0x9495('0x62')](char(0xd))>=0x0||_0x25eb6e[_0x9495('0x61')]()[_0x9495('0x62')](char(0xa))>=0x0||_0x25eb6e[_0x9495('0x61')]()[_0x9495('0x62')](char(0x2c))>=0x0||_0x25eb6e[_0x9495('0x61')]()[_0x9495('0x62')](char(0x22))>=0x0);}function encapsulate(_0x35758e){var _0x1470db=char(0x22),_0x3fcf93='\x5c'+char(0x22),_0x4f33e0=_0x35758e[_0x9495('0x61')]()[_0x9495('0x63')](new RegExp(_0x1470db,'g'),_0x3fcf93);return _0x1470db+_0x4f33e0+_0x1470db;}exports['getSummary']=function(_0x3f629b,_0x278eb3,_0x5d939f){var _0x240ba4,_0x512d7a;var _0x1ab41f={'where':{'ProjectId':_0x3f629b[_0x9495('0x49')]['id']}};if(_0x3f629b[_0x9495('0x33')][_0x9495('0x64')]){_0x1ab41f[_0x9495('0x3d')]['starttime']=JSON[_0x9495('0x65')](_0x3f629b[_0x9495('0x33')][_0x9495('0x64')]);}return db[_0x9495('0x59')][_0x9495('0x45')](_0x1ab41f)['then'](handleEntityNotFound(_0x278eb3,null))[_0x9495('0x23')](function(_0x36204f){if(_0x36204f){_0x240ba4=_0x36204f;return db[_0x9495('0x66')][_0x9495('0x45')]({'where':{'SessionId':{'$in':_[_0x9495('0x2c')](_0x240ba4,'id')},'ProjectId':_0x3f629b[_0x9495('0x49')]['id']},'order':_0x9495('0x67')});}})['then'](handleEntityNotFound(_0x278eb3,null))[_0x9495('0x23')](function(_0x62135b){if(_0x62135b){_0x512d7a=_0x62135b;var _0x22d786={};for(var _0x4a42c4=0x0,_0x2646a5=_0x512d7a[_0x9495('0x38')];_0x4a42c4<_0x2646a5;_0x4a42c4++){if(!_0x22d786[_0x9495('0x39')](_0x512d7a[_0x4a42c4][_0x9495('0x68')])){_0x22d786[_0x512d7a[_0x4a42c4][_0x9495('0x68')]]=needsEncapsulation(_0x512d7a[_0x4a42c4][_0x9495('0x69')])?encapsulate(_0x512d7a[_0x4a42c4][_0x9495('0x69')]):_0x512d7a[_0x4a42c4]['question'];}}var _0x62285a=[],_0x140498={};for(var _0x4bedf9=0x0,_0x55f493=_0x240ba4['length'];_0x4bedf9<_0x55f493;_0x4bedf9++){_0x140498={'ProjectId':_0x3f629b['params']['id'],'SessionId':_0x240ba4[_0x4bedf9]['id'],'StartTime':moment(_0x240ba4[_0x4bedf9]['starttime'])[_0x9495('0x6a')](_0x9495('0x6b'))};for(var _0x1a0f3a=0x0,_0x231f5f=_0x512d7a[_0x9495('0x38')];_0x1a0f3a<_0x231f5f;_0x1a0f3a++){if(_0x512d7a[_0x1a0f3a]['SessionId']==_0x240ba4[_0x4bedf9]['id']&&_0x22d786['hasOwnProperty'](_0x512d7a[_0x1a0f3a][_0x9495('0x68')])){_0x140498[_0x22d786[_0x512d7a[_0x1a0f3a][_0x9495('0x68')]]]=_0x512d7a[_0x1a0f3a]['answer'];}}for(var _0x2396f1 in _0x22d786){if(!_0x140498['hasOwnProperty'](_0x22d786[_0x2396f1])){_0x140498[_0x22d786[_0x2396f1]]=null;}}_0x62285a[_0x9495('0x6c')](_0x140498);}return _0x62285a;}})[_0x9495('0x23')](function(_0xaae89b){if(!_[_0x9495('0x6d')](_0xaae89b)){var _0x466ebd=toCsv(_0xaae89b);var _0x1733b3=Date[_0x9495('0x6e')]();fs[_0x9495('0x6f')](util['format'](_0x9495('0x70'),_0x3f629b[_0x9495('0x49')]['id'],_0x1733b3),_0x466ebd);_0x278eb3[_0x9495('0x71')](_0x9495('0x72'),_0x9495('0x73')+util[_0x9495('0x6a')](_0x9495('0x74'),_0x3f629b[_0x9495('0x49')]['id'],_0x1733b3));_0x278eb3['setHeader'](_0x9495('0x75'),'text/csv');return _0x278eb3['download'](util[_0x9495('0x6a')](_0x9495('0x70'),_0x3f629b['params']['id'],_0x1733b3));}else{return _0x278eb3[_0x9495('0x17')](0xcc);}})[_0x9495('0x47')](handleError(_0x278eb3,null));}; \ No newline at end of file +var _0x7275=['../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','UserProfileResource','destroy','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','create','UserProfileSection','getSessions','findOne','JscriptySessionReport','order','ProjectId','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId','answer','push','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','text/csv','download','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x35d21a,_0x82b92a){var _0x2eb565=function(_0x5bc084){while(--_0x5bc084){_0x35d21a['push'](_0x35d21a['shift']());}};_0x2eb565(++_0x82b92a);}(_0x7275,0x143));var _0x5727=function(_0x462d2f,_0x302f19){_0x462d2f=_0x462d2f-0x0;var _0x1cf62c=_0x7275[_0x462d2f];return _0x1cf62c;};'use strict';var emlformat=require(_0x5727('0x0'));var rimraf=require(_0x5727('0x1'));var zipdir=require(_0x5727('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5727('0x3'));var moment=require('moment');var BPromise=require(_0x5727('0x4'));var Mustache=require(_0x5727('0x5'));var util=require('util');var path=require(_0x5727('0x6'));var sox=require(_0x5727('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5727('0x8'));var squel=require('squel');var crypto=require(_0x5727('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x5727('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5727('0xb'));var Papa=require(_0x5727('0xc'));var Redis=require('ioredis');var authService=require(_0x5727('0xd'));var qs=require(_0x5727('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5727('0xf'));var logger=require(_0x5727('0x10'))('api');var utils=require(_0x5727('0x11'));var config=require(_0x5727('0x12'));var licenseUtil=require(_0x5727('0x13'));var db=require(_0x5727('0x14'))['db'];function respondWithStatusCode(_0x362b0e,_0x45ec3c){_0x45ec3c=_0x45ec3c||0xcc;return function(_0x48c6f4){if(_0x48c6f4){return _0x362b0e[_0x5727('0x15')](_0x45ec3c);}return _0x362b0e[_0x5727('0x16')](_0x45ec3c)[_0x5727('0x17')]();};}function respondWithResult(_0x242b6a,_0x2a01df){_0x2a01df=_0x2a01df||0xc8;return function(_0x463721){if(_0x463721){return _0x242b6a[_0x5727('0x16')](_0x2a01df)['json'](_0x463721);}};}function respondWithFilteredResult(_0x24e514,_0x284633){return function(_0x1dcefc){if(_0x1dcefc){var _0x12b045=typeof _0x284633[_0x5727('0x18')]===_0x5727('0x19')&&typeof _0x284633[_0x5727('0x1a')]==='undefined';var _0x11d52c=_0x1dcefc['count'];var _0x360be0=_0x12b045?0x0:_0x284633[_0x5727('0x18')];var _0x55fc33=_0x12b045?_0x1dcefc[_0x5727('0x1b')]:_0x284633[_0x5727('0x18')]+_0x284633[_0x5727('0x1a')];var _0x35e30f;if(_0x55fc33>=_0x11d52c){_0x55fc33=_0x11d52c;_0x35e30f=0xc8;}else{_0x35e30f=0xce;}_0x24e514[_0x5727('0x16')](_0x35e30f);return _0x24e514['set']('Content-Range',_0x360be0+'-'+_0x55fc33+'/'+_0x11d52c)[_0x5727('0x1c')](_0x1dcefc);}return null;};}function patchUpdates(_0xb99c6e){return function(_0x84c9e2){try{jsonpatch[_0x5727('0x1d')](_0x84c9e2,_0xb99c6e,!![]);}catch(_0xf584e8){return BPromise[_0x5727('0x1e')](_0xf584e8);}return _0x84c9e2[_0x5727('0x1f')]();};}function saveUpdates(_0x5c63ef,_0x4aa3af){return function(_0x476a47){if(_0x476a47){return _0x476a47[_0x5727('0x20')](_0x5c63ef)['then'](function(_0x1cb06f){return _0x1cb06f;});}return null;};}function removeEntity(_0xb217a7,_0x3775b5){return function(_0x4a3e6b){if(_0x4a3e6b){return _0x4a3e6b['destroy']()[_0x5727('0x21')](function(){var _0x179e74=_0x4a3e6b['get']({'plain':!![]});var _0x41cd74='Projects';return db[_0x5727('0x22')][_0x5727('0x23')]({'where':{'type':_0x41cd74,'resourceId':_0x179e74['id']}})['then'](function(){return _0x4a3e6b;});})['then'](function(){_0xb217a7[_0x5727('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5305,_0x3dd7d2){return function(_0x161f5){if(!_0x161f5){_0x4c5305[_0x5727('0x15')](0x194);}return _0x161f5;};}function handleError(_0xf82573,_0x3afd59){_0x3afd59=_0x3afd59||0x1f4;return function(_0x56e93d){logger['error'](_0x56e93d[_0x5727('0x24')]);if(_0x56e93d[_0x5727('0x25')]){delete _0x56e93d[_0x5727('0x25')];}_0xf82573[_0x5727('0x16')](_0x3afd59)['send'](_0x56e93d);};}exports[_0x5727('0x26')]=function(_0x4b8ce3,_0x1d81ab){var _0x4bdae7={},_0x19636b={},_0x5a6827={'count':0x0,'rows':[]};var _0xe3a786=_[_0x5727('0x27')](db[_0x5727('0x28')][_0x5727('0x29')],function(_0x58080b){return{'name':_0x58080b[_0x5727('0x2a')],'type':_0x58080b[_0x5727('0x2b')]['key']};});_0x19636b['model']=_[_0x5727('0x27')](_0xe3a786,_0x5727('0x25'));_0x19636b[_0x5727('0x2c')]=_[_0x5727('0x2d')](_0x4b8ce3[_0x5727('0x2c')]);_0x19636b['filters']=_[_0x5727('0x2e')](_0x19636b[_0x5727('0x2f')],_0x19636b[_0x5727('0x2c')]);_0x4bdae7[_0x5727('0x30')]=_[_0x5727('0x2e')](_0x19636b[_0x5727('0x2f')],qs[_0x5727('0x31')](_0x4b8ce3[_0x5727('0x2c')][_0x5727('0x31')]));_0x4bdae7[_0x5727('0x30')]=_0x4bdae7[_0x5727('0x30')][_0x5727('0x32')]?_0x4bdae7[_0x5727('0x30')]:_0x19636b[_0x5727('0x2f')];if(!_0x4b8ce3['query'][_0x5727('0x33')](_0x5727('0x34'))){_0x4bdae7[_0x5727('0x1a')]=qs[_0x5727('0x1a')](_0x4b8ce3[_0x5727('0x2c')]['limit']);_0x4bdae7[_0x5727('0x18')]=qs[_0x5727('0x18')](_0x4b8ce3[_0x5727('0x2c')]['offset']);}_0x4bdae7['order']=qs[_0x5727('0x35')](_0x4b8ce3['query']['sort']);_0x4bdae7['where']=qs['filters'](_[_0x5727('0x36')](_0x4b8ce3[_0x5727('0x2c')],_0x19636b[_0x5727('0x37')]),_0xe3a786);if(_0x4b8ce3['query'][_0x5727('0x38')]){_0x4bdae7[_0x5727('0x39')]=_[_0x5727('0x3a')](_0x4bdae7['where'],{'$or':_[_0x5727('0x27')](_0xe3a786,function(_0x1eeac5){if(_0x1eeac5[_0x5727('0x2b')]!=='VIRTUAL'){var _0xfa0b1e={};_0xfa0b1e[_0x1eeac5['name']]={'$like':'%'+_0x4b8ce3[_0x5727('0x2c')][_0x5727('0x38')]+'%'};return _0xfa0b1e;}})});}_0x4bdae7=_['merge']({},_0x4bdae7,_0x4b8ce3[_0x5727('0x3b')]);var _0xa8269b={'where':_0x4bdae7[_0x5727('0x39')]};return db[_0x5727('0x28')][_0x5727('0x1b')](_0xa8269b)[_0x5727('0x21')](function(_0x1e580f){_0x5a6827['count']=_0x1e580f;if(_0x4b8ce3[_0x5727('0x2c')][_0x5727('0x3c')]){_0x4bdae7[_0x5727('0x3d')]=[{'all':!![]}];}return db['JscriptyProject'][_0x5727('0x3e')](_0x4bdae7);})[_0x5727('0x21')](function(_0x47074e){_0x5a6827[_0x5727('0x3f')]=_0x47074e;return _0x5a6827;})[_0x5727('0x21')](respondWithFilteredResult(_0x1d81ab,_0x4bdae7))[_0x5727('0x40')](handleError(_0x1d81ab,null));};exports[_0x5727('0x41')]=function(_0x4da232,_0x91b888){var _0x245189={'raw':![],'where':{'id':_0x4da232[_0x5727('0x42')]['id']}},_0x7620cd={};_0x7620cd[_0x5727('0x2f')]=_[_0x5727('0x2d')](db[_0x5727('0x28')][_0x5727('0x29')]);_0x7620cd[_0x5727('0x2c')]=_[_0x5727('0x2d')](_0x4da232[_0x5727('0x2c')]);_0x7620cd[_0x5727('0x37')]=_[_0x5727('0x2e')](_0x7620cd[_0x5727('0x2f')],_0x7620cd[_0x5727('0x2c')]);_0x245189[_0x5727('0x30')]=_[_0x5727('0x2e')](_0x7620cd[_0x5727('0x2f')],qs['fields'](_0x4da232['query'][_0x5727('0x31')]));_0x245189[_0x5727('0x30')]=_0x245189['attributes'][_0x5727('0x32')]?_0x245189['attributes']:_0x7620cd[_0x5727('0x2f')];if(_0x4da232[_0x5727('0x2c')][_0x5727('0x3c')]){_0x245189[_0x5727('0x3d')]=[{'all':!![]}];}_0x245189=_['merge']({},_0x245189,_0x4da232['options']);return db[_0x5727('0x28')][_0x5727('0x43')](_0x245189)[_0x5727('0x21')](handleEntityNotFound(_0x91b888,null))[_0x5727('0x21')](respondWithResult(_0x91b888,null))[_0x5727('0x40')](handleError(_0x91b888,null));};exports['create']=function(_0x40887d,_0xb168c){return db[_0x5727('0x28')]['create'](_0x40887d[_0x5727('0x44')],{})[_0x5727('0x21')](function(_0x318c43){var _0x43cb66=_0x40887d[_0x5727('0x45')][_0x5727('0x46')]({'plain':!![]});if(!_0x43cb66)throw new Error(_0x5727('0x47'));if(_0x43cb66[_0x5727('0x48')]==='user'){var _0x9a3222=_0x318c43[_0x5727('0x46')]({'plain':!![]});var _0x4a7417=_0x5727('0x49');return db['UserProfileSection'][_0x5727('0x43')]({'where':{'name':_0x4a7417,'userProfileId':_0x43cb66[_0x5727('0x4a')]},'raw':!![]})[_0x5727('0x21')](function(_0x50e166){if(_0x50e166&&_0x50e166[_0x5727('0x4b')]===0x0){return db[_0x5727('0x22')]['create']({'name':_0x9a3222[_0x5727('0x25')],'resourceId':_0x9a3222['id'],'type':_0x50e166[_0x5727('0x25')],'sectionId':_0x50e166['id']},{})[_0x5727('0x21')](function(){return _0x318c43;});}else{return _0x318c43;}})[_0x5727('0x40')](function(_0xa68aa1){logger[_0x5727('0x4c')](_0x5727('0x4d'),_0xa68aa1);throw _0xa68aa1;});}return _0x318c43;})[_0x5727('0x21')](respondWithResult(_0xb168c,0xc9))[_0x5727('0x40')](handleError(_0xb168c,null));};exports[_0x5727('0x4e')]=function(_0x3151cd,_0x169d11){var _0x29cee7={'where':{'id':_0x3151cd[_0x5727('0x42')]['id']}},_0x273085={};_0x273085['model']=_['keys'](db[_0x5727('0x28')][_0x5727('0x29')]);_0x29cee7['attributes']=_['intersection'](_0x273085['model'],qs[_0x5727('0x31')](_0x3151cd[_0x5727('0x2c')][_0x5727('0x31')]));_0x29cee7[_0x5727('0x30')]=_0x29cee7[_0x5727('0x30')][_0x5727('0x32')]?_0x29cee7[_0x5727('0x30')]:_0x273085[_0x5727('0x2f')];if(_0x3151cd[_0x5727('0x2c')][_0x5727('0x3c')]){_0x29cee7[_0x5727('0x3d')]=[{'all':!![]}];}_0x29cee7=_[_0x5727('0x3a')]({},_0x29cee7,_0x3151cd['options']);return db[_0x5727('0x28')]['find'](_0x29cee7)[_0x5727('0x21')](handleEntityNotFound(_0x169d11,null))[_0x5727('0x21')](function(_0x21c1b1){if(_0x21c1b1){var _0x180f05=_0x21c1b1[_0x5727('0x46')]({'plain':!![]});_0x180f05=qs['omit'](_0x180f05,['id',_0x5727('0x4f'),_0x5727('0x50')]);_0x3151cd[_0x5727('0x44')]=_[_0x5727('0x51')](_0x3151cd['body'],['id',_0x5727('0x4f'),_0x5727('0x50')]);return db[_0x5727('0x28')][_0x5727('0x52')](_[_0x5727('0x3a')](_0x180f05,_0x3151cd[_0x5727('0x44')]),{'include':_0x3151cd['query'][_0x5727('0x3c')]?[{'all':!![]}]:undefined})[_0x5727('0x21')](function(_0x1ba6eb){var _0xfccdb7=_0x3151cd[_0x5727('0x45')]['get']({'plain':!![]});if(!_0xfccdb7)throw new Error(_0x5727('0x47'));if(_0xfccdb7[_0x5727('0x48')]===_0x5727('0x45')){var _0x324e95=_0x1ba6eb[_0x5727('0x46')]({'plain':!![]});var _0x5c90f0=_0x5727('0x49');return db[_0x5727('0x53')][_0x5727('0x43')]({'where':{'name':_0x5c90f0,'userProfileId':_0xfccdb7[_0x5727('0x4a')]},'raw':!![]})[_0x5727('0x21')](function(_0x433b09){if(_0x433b09&&_0x433b09['autoAssociation']===0x0){return db[_0x5727('0x22')][_0x5727('0x52')]({'name':_0x324e95[_0x5727('0x25')],'resourceId':_0x324e95['id'],'type':_0x433b09[_0x5727('0x25')],'sectionId':_0x433b09['id']},{})[_0x5727('0x21')](function(){return _0x1ba6eb;});}else{return _0x1ba6eb;}})[_0x5727('0x40')](function(_0x709762){logger['error'](_0x5727('0x4d'),_0x709762);throw _0x709762;});}return _0x1ba6eb;});}})[_0x5727('0x21')](respondWithResult(_0x169d11,0xc9))[_0x5727('0x40')](handleError(_0x169d11,null));};exports[_0x5727('0x20')]=function(_0x59bf27,_0x38c627){if(_0x59bf27[_0x5727('0x44')]['id']){delete _0x59bf27[_0x5727('0x44')]['id'];}return db[_0x5727('0x28')][_0x5727('0x43')]({'where':{'id':_0x59bf27['params']['id']}})[_0x5727('0x21')](handleEntityNotFound(_0x38c627,null))[_0x5727('0x21')](saveUpdates(_0x59bf27['body'],null))[_0x5727('0x21')](respondWithResult(_0x38c627,null))[_0x5727('0x40')](handleError(_0x38c627,null));};exports[_0x5727('0x23')]=function(_0x1e2f3b,_0xc37b31){return db['JscriptyProject'][_0x5727('0x43')]({'where':{'id':_0x1e2f3b[_0x5727('0x42')]['id']}})['then'](handleEntityNotFound(_0xc37b31,null))[_0x5727('0x21')](removeEntity(_0xc37b31,null))[_0x5727('0x40')](handleError(_0xc37b31,null));};exports[_0x5727('0x54')]=function(_0x4d78ba,_0x1c62be,_0x297d4e){var _0x370a65={'raw':!![],'where':{}};var _0x1b417b={};var _0x318b0d={'count':0x0,'rows':[]};return db[_0x5727('0x28')][_0x5727('0x55')]({'where':{'id':_0x4d78ba[_0x5727('0x42')]['id']}})['then'](handleEntityNotFound(_0x1c62be,null))[_0x5727('0x21')](function(_0x261cc6){if(_0x261cc6){_0x1b417b[_0x5727('0x2f')]=_['keys'](db[_0x5727('0x56')]['rawAttributes']);_0x1b417b[_0x5727('0x2c')]=_[_0x5727('0x2d')](_0x4d78ba[_0x5727('0x2c')]);_0x1b417b[_0x5727('0x37')]=_['intersection'](_0x1b417b[_0x5727('0x2f')],_0x1b417b[_0x5727('0x2c')]);_0x370a65[_0x5727('0x30')]=_['intersection'](_0x1b417b[_0x5727('0x2f')],qs[_0x5727('0x31')](_0x4d78ba['query'][_0x5727('0x31')]));_0x370a65['attributes']=_0x370a65[_0x5727('0x30')][_0x5727('0x32')]?_0x370a65[_0x5727('0x30')]:_0x1b417b[_0x5727('0x2f')];if(!_0x4d78ba[_0x5727('0x2c')]['hasOwnProperty'](_0x5727('0x34'))){_0x370a65[_0x5727('0x1a')]=qs['limit'](_0x4d78ba[_0x5727('0x2c')][_0x5727('0x1a')]);_0x370a65['offset']=qs[_0x5727('0x18')](_0x4d78ba[_0x5727('0x2c')]['offset']);}_0x370a65[_0x5727('0x57')]=qs[_0x5727('0x35')](_0x4d78ba['query'][_0x5727('0x35')]);_0x370a65[_0x5727('0x39')]=qs[_0x5727('0x37')](_[_0x5727('0x36')](_0x4d78ba[_0x5727('0x2c')],_0x1b417b[_0x5727('0x37')]));_0x370a65[_0x5727('0x39')][_0x5727('0x58')]=_0x261cc6['id'];if(_0x4d78ba['query'][_0x5727('0x38')]){_0x370a65['where']=_[_0x5727('0x3a')](_0x370a65[_0x5727('0x39')],{'$or':_[_0x5727('0x27')](_0x370a65[_0x5727('0x30')],function(_0x424b5a){var _0x7f4b90={};_0x7f4b90[_0x424b5a]={'$like':'%'+_0x4d78ba[_0x5727('0x2c')][_0x5727('0x38')]+'%'};return _0x7f4b90;})});}_0x370a65=_[_0x5727('0x3a')]({},_0x370a65,_0x4d78ba['options']);return db[_0x5727('0x56')][_0x5727('0x1b')]({'where':_0x370a65[_0x5727('0x39')]})[_0x5727('0x21')](function(_0x394c48){_0x318b0d[_0x5727('0x1b')]=_0x394c48;if(_0x4d78ba[_0x5727('0x2c')][_0x5727('0x3c')]){_0x370a65['include']=[{'all':!![]}];}return db[_0x5727('0x56')][_0x5727('0x3e')](_0x370a65);})[_0x5727('0x21')](function(_0x4328d3){_0x318b0d[_0x5727('0x3f')]=_0x4328d3;return _0x318b0d;});}})[_0x5727('0x21')](respondWithFilteredResult(_0x1c62be,_0x370a65))[_0x5727('0x40')](handleError(_0x1c62be,null));};exports['getAnswers']=function(_0x1b10b7,_0x35de7b,_0x132879){var _0x3db853={'raw':!![],'where':{}};var _0x4abf7e={};var _0x28ee57={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x5727('0x55')]({'where':{'id':_0x1b10b7[_0x5727('0x42')]['id']}})['then'](handleEntityNotFound(_0x35de7b,null))['then'](function(_0x3ac017){if(_0x3ac017){_0x4abf7e[_0x5727('0x2f')]=_[_0x5727('0x2d')](db['JscriptyAnswerReport']['rawAttributes']);_0x4abf7e[_0x5727('0x2c')]=_[_0x5727('0x2d')](_0x1b10b7['query']);_0x4abf7e[_0x5727('0x37')]=_[_0x5727('0x2e')](_0x4abf7e[_0x5727('0x2f')],_0x4abf7e[_0x5727('0x2c')]);_0x3db853[_0x5727('0x30')]=_[_0x5727('0x2e')](_0x4abf7e[_0x5727('0x2f')],qs['fields'](_0x1b10b7[_0x5727('0x2c')]['fields']));_0x3db853[_0x5727('0x30')]=_0x3db853['attributes'][_0x5727('0x32')]?_0x3db853['attributes']:_0x4abf7e[_0x5727('0x2f')];if(!_0x1b10b7[_0x5727('0x2c')][_0x5727('0x33')](_0x5727('0x34'))){_0x3db853['limit']=qs[_0x5727('0x1a')](_0x1b10b7[_0x5727('0x2c')][_0x5727('0x1a')]);_0x3db853[_0x5727('0x18')]=qs[_0x5727('0x18')](_0x1b10b7[_0x5727('0x2c')][_0x5727('0x18')]);}_0x3db853[_0x5727('0x57')]=qs['sort'](_0x1b10b7[_0x5727('0x2c')][_0x5727('0x35')]);_0x3db853[_0x5727('0x39')]=qs[_0x5727('0x37')](_[_0x5727('0x36')](_0x1b10b7[_0x5727('0x2c')],_0x4abf7e['filters']));_0x3db853[_0x5727('0x39')][_0x5727('0x58')]=_0x3ac017['id'];if(_0x1b10b7[_0x5727('0x2c')]['filter']){_0x3db853[_0x5727('0x39')]=_[_0x5727('0x3a')](_0x3db853[_0x5727('0x39')],{'$or':_['map'](_0x3db853[_0x5727('0x30')],function(_0x54d139){var _0x6ec164={};_0x6ec164[_0x54d139]={'$like':'%'+_0x1b10b7[_0x5727('0x2c')]['filter']+'%'};return _0x6ec164;})});}_0x3db853=_[_0x5727('0x3a')]({},_0x3db853,_0x1b10b7['options']);return db[_0x5727('0x59')][_0x5727('0x1b')]({'where':_0x3db853[_0x5727('0x39')]})[_0x5727('0x21')](function(_0x316559){_0x28ee57[_0x5727('0x1b')]=_0x316559;if(_0x1b10b7[_0x5727('0x2c')]['includeAll']){_0x3db853[_0x5727('0x3d')]=[{'all':!![]}];}return db[_0x5727('0x59')]['findAll'](_0x3db853);})[_0x5727('0x21')](function(_0xd40492){_0x28ee57[_0x5727('0x3f')]=_0xd40492;return _0x28ee57;});}})['then'](respondWithFilteredResult(_0x35de7b,_0x3db853))['catch'](handleError(_0x35de7b,null));};function char(_0x45401c){return _0x5727('0x5a')===typeof _0x45401c?String['fromCharCode'][_0x5727('0x1d')](null,arguments):_0x45401c;}function needsEncapsulation(_0x582926){return!!_0x582926&&(_0x582926[_0x5727('0x5b')]()[_0x5727('0x5c')](char(0xd))>=0x0||_0x582926[_0x5727('0x5b')]()[_0x5727('0x5c')](char(0xa))>=0x0||_0x582926[_0x5727('0x5b')]()['indexOf'](char(0x2c))>=0x0||_0x582926[_0x5727('0x5b')]()[_0x5727('0x5c')](char(0x22))>=0x0);}function encapsulate(_0x5cfe3b){var _0x3d4f89=char(0x22),_0x445b60='\x5c'+char(0x22),_0xa1c4dd=_0x5cfe3b[_0x5727('0x5b')]()[_0x5727('0x5d')](new RegExp(_0x3d4f89,'g'),_0x445b60);return _0x3d4f89+_0xa1c4dd+_0x3d4f89;}exports[_0x5727('0x5e')]=function(_0x270d00,_0xb8ba32,_0x447f54){var _0x172740,_0x2a6606;var _0x1160d5={'where':{'ProjectId':_0x270d00[_0x5727('0x42')]['id']}};if(_0x270d00[_0x5727('0x2c')][_0x5727('0x5f')]){_0x1160d5[_0x5727('0x39')][_0x5727('0x60')]=JSON[_0x5727('0x61')](_0x270d00[_0x5727('0x2c')][_0x5727('0x5f')]);}return db[_0x5727('0x56')][_0x5727('0x3e')](_0x1160d5)['then'](handleEntityNotFound(_0xb8ba32,null))['then'](function(_0x36c435){if(_0x36c435){_0x172740=_0x36c435;return db[_0x5727('0x62')][_0x5727('0x3e')]({'where':{'SessionId':{'$in':_[_0x5727('0x27')](_0x172740,'id')},'ProjectId':_0x270d00['params']['id']},'order':_0x5727('0x63')});}})[_0x5727('0x21')](handleEntityNotFound(_0xb8ba32,null))['then'](function(_0x360200){if(_0x360200){_0x2a6606=_0x360200;var _0x3952a1={};for(var _0x513bbe=0x0,_0x947570=_0x2a6606[_0x5727('0x32')];_0x513bbe<_0x947570;_0x513bbe++){if(!_0x3952a1[_0x5727('0x33')](_0x2a6606[_0x513bbe]['questionId'])){_0x3952a1[_0x2a6606[_0x513bbe][_0x5727('0x64')]]=needsEncapsulation(_0x2a6606[_0x513bbe]['question'])?encapsulate(_0x2a6606[_0x513bbe][_0x5727('0x65')]):_0x2a6606[_0x513bbe][_0x5727('0x65')];}}var _0x2890d8=[],_0x9dfca5={};for(var _0x5a6be0=0x0,_0x24ccd1=_0x172740[_0x5727('0x32')];_0x5a6be0<_0x24ccd1;_0x5a6be0++){_0x9dfca5={'ProjectId':_0x270d00[_0x5727('0x42')]['id'],'SessionId':_0x172740[_0x5a6be0]['id'],'StartTime':moment(_0x172740[_0x5a6be0][_0x5727('0x60')])[_0x5727('0x66')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x3987d6=0x0,_0x368c44=_0x2a6606[_0x5727('0x32')];_0x3987d6<_0x368c44;_0x3987d6++){if(_0x2a6606[_0x3987d6][_0x5727('0x67')]==_0x172740[_0x5a6be0]['id']&&_0x3952a1[_0x5727('0x33')](_0x2a6606[_0x3987d6][_0x5727('0x64')])){_0x9dfca5[_0x3952a1[_0x2a6606[_0x3987d6][_0x5727('0x64')]]]=_0x2a6606[_0x3987d6][_0x5727('0x68')];}}for(var _0x249a2b in _0x3952a1){if(!_0x9dfca5['hasOwnProperty'](_0x3952a1[_0x249a2b])){_0x9dfca5[_0x3952a1[_0x249a2b]]=null;}}_0x2890d8[_0x5727('0x69')](_0x9dfca5);}return _0x2890d8;}})[_0x5727('0x21')](function(_0x41b41d){if(!_['isEmpty'](_0x41b41d)){var _0x4266df=toCsv(_0x41b41d);var _0xdd46ac=Date['now']();fs[_0x5727('0x6a')](util[_0x5727('0x66')](_0x5727('0x6b'),_0x270d00[_0x5727('0x42')]['id'],_0xdd46ac),_0x4266df);_0xb8ba32['setHeader'](_0x5727('0x6c'),_0x5727('0x6d')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x270d00[_0x5727('0x42')]['id'],_0xdd46ac));_0xb8ba32[_0x5727('0x6e')](_0x5727('0x6f'),_0x5727('0x70'));return _0xb8ba32[_0x5727('0x71')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x270d00['params']['id'],_0xdd46ac));}else{return _0xb8ba32[_0x5727('0x15')](0xcc);}})[_0x5727('0x40')](handleError(_0xb8ba32,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 5a715ed..0d0c8a0 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 _0x72a2=['define','JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x401676,_0x3f1436){var _0x4f13fe=function(_0xd2f197){while(--_0xd2f197){_0x401676['push'](_0x401676['shift']());}};_0x4f13fe(++_0x3f1436);}(_0x72a2,0x161));var _0x272a=function(_0x40519e,_0x3b403d){_0x40519e=_0x40519e-0x0;var _0x4813a4=_0x72a2[_0x40519e];return _0x4813a4;};'use strict';var _=require('lodash');var util=require(_0x272a('0x0'));var logger=require(_0x272a('0x1'))(_0x272a('0x2'));var moment=require(_0x272a('0x3'));var BPromise=require(_0x272a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x272a('0x5'));var rimraf=require('rimraf');var config=require(_0x272a('0x6'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x4f628a,_0x2ba5db){return _0x4f628a[_0x272a('0x7')](_0x272a('0x8'),attributes,{'tableName':_0x272a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9829=['./jscriptyProject.attributes','exports','define','JscriptyProject','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x479509,_0x1daf8a){var _0x382da8=function(_0x39d77c){while(--_0x39d77c){_0x479509['push'](_0x479509['shift']());}};_0x382da8(++_0x1daf8a);}(_0x9829,0xc4));var _0x9982=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x9829[_0x531d15];return _0x271a18;};'use strict';var _=require(_0x9982('0x0'));var util=require(_0x9982('0x1'));var logger=require(_0x9982('0x2'))(_0x9982('0x3'));var moment=require(_0x9982('0x4'));var BPromise=require('bluebird');var rp=require(_0x9982('0x5'));var fs=require('fs');var path=require(_0x9982('0x6'));var rimraf=require(_0x9982('0x7'));var config=require('../../config/environment');var attributes=require(_0x9982('0x8'));module[_0x9982('0x9')]=function(_0x58f8fe,_0x500dfd){return _0x58f8fe[_0x9982('0xa')](_0x9982('0xb'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index fb6d66b..544e21e 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 _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0xda3f,0xec));var _0xfda3=function(_0x1e7c6f,_0x3858be){_0x1e7c6f=_0x1e7c6f-0x0;var _0x1e077e=_0xda3f[_0x1e7c6f];return _0x1e077e;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ 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(_0x4d9443,_0xe0d01f){var _0x350586=function(_0x1e8783){while(--_0x1e8783){_0x4d9443['push'](_0x4d9443['shift']());}};_0x350586(++_0xe0d01f);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2ddfb5,_0x13bd8a){_0x2ddfb5=_0x2ddfb5-0x0;var _0x8fd436=_0xf4eb[_0x2ddfb5];return _0x8fd436;};'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 7c80d57..217bc8d 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 _0xc800=['get','/describe','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','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index'];(function(_0xf7d613,_0x5da9d6){var _0x42278b=function(_0x4286b2){while(--_0x4286b2){_0xf7d613['push'](_0xf7d613['shift']());}};_0x42278b(++_0x5da9d6);}(_0xc800,0x183));var _0x0c80=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0xc800[_0x43fdf8];return _0x1160c6;};'use strict';var multer=require(_0x0c80('0x0'));var util=require(_0x0c80('0x1'));var path=require(_0x0c80('0x2'));var timeout=require(_0x0c80('0x3'));var express=require(_0x0c80('0x4'));var router=express[_0x0c80('0x5')]();var fs_extra=require(_0x0c80('0x6'));var auth=require(_0x0c80('0x7'));var interaction=require(_0x0c80('0x8'));var config=require(_0x0c80('0x9'));var controller=require(_0x0c80('0xa'));router['get']('/',auth[_0x0c80('0xb')](),controller[_0x0c80('0xc')]);router[_0x0c80('0xd')](_0x0c80('0xe'),auth[_0x0c80('0xb')](),controller[_0x0c80('0xf')]);router['get'](_0x0c80('0x10'),auth['isAuthenticated'](),controller[_0x0c80('0x11')]);router[_0x0c80('0x12')]('/',auth[_0x0c80('0xb')](),controller[_0x0c80('0x13')]);router[_0x0c80('0x14')](_0x0c80('0x10'),auth[_0x0c80('0xb')](),controller[_0x0c80('0x15')]);router[_0x0c80('0x16')](_0x0c80('0x10'),auth[_0x0c80('0xb')](),controller[_0x0c80('0x17')]);module[_0x0c80('0x18')]=router; \ No newline at end of file +var _0xcc10=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','/describe','isAuthenticated','/:id','show','post','put','delete','destroy','exports','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xcc10,0x1af));var _0x0cc1=function(_0x2050fa,_0x333772){_0x2050fa=_0x2050fa-0x0;var _0x40d603=_0xcc10[_0x2050fa];return _0x40d603;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0cc1('0x0'));var timeout=require('connect-timeout');var express=require(_0x0cc1('0x1'));var router=express[_0x0cc1('0x2')]();var fs_extra=require(_0x0cc1('0x3'));var auth=require(_0x0cc1('0x4'));var interaction=require(_0x0cc1('0x5'));var config=require(_0x0cc1('0x6'));var controller=require(_0x0cc1('0x7'));router[_0x0cc1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0cc1('0x9'),auth[_0x0cc1('0xa')](),controller['describe']);router[_0x0cc1('0x8')](_0x0cc1('0xb'),auth['isAuthenticated'](),controller[_0x0cc1('0xc')]);router[_0x0cc1('0xd')]('/',auth[_0x0cc1('0xa')](),controller['create']);router[_0x0cc1('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0cc1('0xf')](_0x0cc1('0xb'),auth['isAuthenticated'](),controller[_0x0cc1('0x10')]);module[_0x0cc1('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 5e1edad..0469dfe 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(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7a54,0x106));var _0x47a5=function(_0x2ec1e5,_0x1d191e){_0x2ec1e5=_0x2ec1e5-0x0;var _0x2356a3=_0x7a54[_0x2ec1e5];return _0x2356a3;};'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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0xa9d3c1,_0x3c141b){_0xa9d3c1=_0xa9d3c1-0x0;var _0x8c8ec=_0x7a54[_0xa9d3c1];return _0x8c8ec;};'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 711ef4e..744ac26 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 _0x2da5=['key','model','map','query','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL','JscriptyQuestionReport','includeAll','include','findAll','rows','params','keys','options','find','catch','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','update','destroy','then','error','name','send','index','rawAttributes','type'];(function(_0x2302a1,_0x4bc33d){var _0x413cae=function(_0x233632){while(--_0x233632){_0x2302a1['push'](_0x2302a1['shift']());}};_0x413cae(++_0x4bc33d);}(_0x2da5,0x175));var _0x52da=function(_0x1231ba,_0x441f87){_0x1231ba=_0x1231ba-0x0;var _0x25f913=_0x2da5[_0x1231ba];return _0x25f913;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x52da('0x0'));var jsonpatch=require(_0x52da('0x1'));var rp=require('request-promise');var moment=require(_0x52da('0x2'));var BPromise=require(_0x52da('0x3'));var Mustache=require(_0x52da('0x4'));var util=require(_0x52da('0x5'));var path=require(_0x52da('0x6'));var sox=require(_0x52da('0x7'));var csv=require(_0x52da('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x52da('0x9'));var _=require('lodash');var squel=require(_0x52da('0xa'));var crypto=require(_0x52da('0xb'));var jsforce=require(_0x52da('0xc'));var deskjs=require(_0x52da('0xd'));var toCsv=require(_0x52da('0x8'));var querystring=require('querystring');var Papa=require(_0x52da('0xe'));var Redis=require(_0x52da('0xf'));var authService=require(_0x52da('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x52da('0x11'));var hardwareService=require(_0x52da('0x12'));var logger=require(_0x52da('0x13'))(_0x52da('0x14'));var utils=require(_0x52da('0x15'));var config=require(_0x52da('0x16'));var licenseUtil=require(_0x52da('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26d29e,_0xcb88e7){_0xcb88e7=_0xcb88e7||0xcc;return function(_0x152960){if(_0x152960){return _0x26d29e['sendStatus'](_0xcb88e7);}return _0x26d29e[_0x52da('0x18')](_0xcb88e7)[_0x52da('0x19')]();};}function respondWithResult(_0x3aeafd,_0x6ca680){_0x6ca680=_0x6ca680||0xc8;return function(_0x2ff557){if(_0x2ff557){return _0x3aeafd[_0x52da('0x18')](_0x6ca680)[_0x52da('0x1a')](_0x2ff557);}};}function respondWithFilteredResult(_0x3d490e,_0x1140ca){return function(_0x39b7c7){if(_0x39b7c7){var _0x2d4b87=typeof _0x1140ca[_0x52da('0x1b')]===_0x52da('0x1c')&&typeof _0x1140ca[_0x52da('0x1d')]===_0x52da('0x1c');var _0x972ec=_0x39b7c7[_0x52da('0x1e')];var _0x5697bd=_0x2d4b87?0x0:_0x1140ca[_0x52da('0x1b')];var _0xc910dc=_0x2d4b87?_0x39b7c7[_0x52da('0x1e')]:_0x1140ca['offset']+_0x1140ca['limit'];var _0x51140c;if(_0xc910dc>=_0x972ec){_0xc910dc=_0x972ec;_0x51140c=0xc8;}else{_0x51140c=0xce;}_0x3d490e[_0x52da('0x18')](_0x51140c);return _0x3d490e['set']('Content-Range',_0x5697bd+'-'+_0xc910dc+'/'+_0x972ec)[_0x52da('0x1a')](_0x39b7c7);}return null;};}function patchUpdates(_0x43dd1a){return function(_0x43d988){try{jsonpatch[_0x52da('0x1f')](_0x43d988,_0x43dd1a,!![]);}catch(_0x5e7cd5){return BPromise['reject'](_0x5e7cd5);}return _0x43d988['save']();};}function saveUpdates(_0x37d541,_0x271926){return function(_0x53fdc3){if(_0x53fdc3){return _0x53fdc3[_0x52da('0x20')](_0x37d541)['then'](function(_0x5c6b99){return _0x5c6b99;});}return null;};}function removeEntity(_0xb05170,_0xbb4aa7){return function(_0x53f24b){if(_0x53f24b){return _0x53f24b[_0x52da('0x21')]()[_0x52da('0x22')](function(){_0xb05170[_0x52da('0x18')](0xcc)[_0x52da('0x19')]();});}};}function handleEntityNotFound(_0xeb4e2c,_0x36d258){return function(_0x3742d1){if(!_0x3742d1){_0xeb4e2c['sendStatus'](0x194);}return _0x3742d1;};}function handleError(_0x3c6275,_0x5d8d48){_0x5d8d48=_0x5d8d48||0x1f4;return function(_0x380e0a){logger[_0x52da('0x23')](_0x380e0a['stack']);if(_0x380e0a[_0x52da('0x24')]){delete _0x380e0a[_0x52da('0x24')];}_0x3c6275[_0x52da('0x18')](_0x5d8d48)[_0x52da('0x25')](_0x380e0a);};}exports[_0x52da('0x26')]=function(_0xa6238b,_0x33a93b){var _0x53066a={},_0x107dc8={},_0x43c098={'count':0x0,'rows':[]};var _0x53f2ed=_['map'](db['JscriptyQuestionReport'][_0x52da('0x27')],function(_0x17accc){return{'name':_0x17accc['fieldName'],'type':_0x17accc[_0x52da('0x28')][_0x52da('0x29')]};});_0x107dc8[_0x52da('0x2a')]=_[_0x52da('0x2b')](_0x53f2ed,_0x52da('0x24'));_0x107dc8[_0x52da('0x2c')]=_['keys'](_0xa6238b[_0x52da('0x2c')]);_0x107dc8[_0x52da('0x2d')]=_[_0x52da('0x2e')](_0x107dc8['model'],_0x107dc8[_0x52da('0x2c')]);_0x53066a[_0x52da('0x2f')]=_[_0x52da('0x2e')](_0x107dc8['model'],qs[_0x52da('0x30')](_0xa6238b[_0x52da('0x2c')][_0x52da('0x30')]));_0x53066a[_0x52da('0x2f')]=_0x53066a[_0x52da('0x2f')][_0x52da('0x31')]?_0x53066a['attributes']:_0x107dc8[_0x52da('0x2a')];if(!_0xa6238b[_0x52da('0x2c')]['hasOwnProperty']('nolimit')){_0x53066a[_0x52da('0x1d')]=qs[_0x52da('0x1d')](_0xa6238b[_0x52da('0x2c')]['limit']);_0x53066a[_0x52da('0x1b')]=qs[_0x52da('0x1b')](_0xa6238b[_0x52da('0x2c')]['offset']);}_0x53066a[_0x52da('0x32')]=qs[_0x52da('0x33')](_0xa6238b['query'][_0x52da('0x33')]);_0x53066a['where']=qs[_0x52da('0x2d')](_['pick'](_0xa6238b[_0x52da('0x2c')],_0x107dc8[_0x52da('0x2d')]),_0x53f2ed);if(_0xa6238b['query'][_0x52da('0x34')]){_0x53066a[_0x52da('0x35')]=_[_0x52da('0x36')](_0x53066a[_0x52da('0x35')],{'$or':_[_0x52da('0x2b')](_0x53f2ed,function(_0x1e7430){if(_0x1e7430[_0x52da('0x28')]!==_0x52da('0x37')){var _0x782304={};_0x782304[_0x1e7430[_0x52da('0x24')]]={'$like':'%'+_0xa6238b[_0x52da('0x2c')][_0x52da('0x34')]+'%'};return _0x782304;}})});}_0x53066a=_['merge']({},_0x53066a,_0xa6238b['options']);var _0x4ae4eb={'where':_0x53066a[_0x52da('0x35')]};return db[_0x52da('0x38')][_0x52da('0x1e')](_0x4ae4eb)[_0x52da('0x22')](function(_0x49d66){_0x43c098[_0x52da('0x1e')]=_0x49d66;if(_0xa6238b[_0x52da('0x2c')][_0x52da('0x39')]){_0x53066a[_0x52da('0x3a')]=[{'all':!![]}];}return db[_0x52da('0x38')][_0x52da('0x3b')](_0x53066a);})['then'](function(_0x7592db){_0x43c098[_0x52da('0x3c')]=_0x7592db;return _0x43c098;})['then'](respondWithFilteredResult(_0x33a93b,_0x53066a))['catch'](handleError(_0x33a93b,null));};exports['show']=function(_0x40fcbd,_0x40e90e){var _0xd78e29={'raw':!![],'where':{'id':_0x40fcbd[_0x52da('0x3d')]['id']}},_0x47156d={};_0x47156d['model']=_[_0x52da('0x3e')](db[_0x52da('0x38')][_0x52da('0x27')]);_0x47156d[_0x52da('0x2c')]=_['keys'](_0x40fcbd[_0x52da('0x2c')]);_0x47156d[_0x52da('0x2d')]=_['intersection'](_0x47156d[_0x52da('0x2a')],_0x47156d['query']);_0xd78e29[_0x52da('0x2f')]=_['intersection'](_0x47156d[_0x52da('0x2a')],qs[_0x52da('0x30')](_0x40fcbd[_0x52da('0x2c')][_0x52da('0x30')]));_0xd78e29[_0x52da('0x2f')]=_0xd78e29['attributes'][_0x52da('0x31')]?_0xd78e29[_0x52da('0x2f')]:_0x47156d[_0x52da('0x2a')];if(_0x40fcbd[_0x52da('0x2c')]['includeAll']){_0xd78e29[_0x52da('0x3a')]=[{'all':!![]}];}_0xd78e29=_[_0x52da('0x36')]({},_0xd78e29,_0x40fcbd[_0x52da('0x3f')]);return db[_0x52da('0x38')][_0x52da('0x40')](_0xd78e29)[_0x52da('0x22')](handleEntityNotFound(_0x40e90e,null))[_0x52da('0x22')](respondWithResult(_0x40e90e,null))[_0x52da('0x41')](handleError(_0x40e90e,null));};exports[_0x52da('0x42')]=function(_0x14f970,_0x3ebcf6){return db[_0x52da('0x38')][_0x52da('0x42')](_0x14f970[_0x52da('0x43')],{})[_0x52da('0x22')](respondWithResult(_0x3ebcf6,0xc9))[_0x52da('0x41')](handleError(_0x3ebcf6,null));};exports[_0x52da('0x20')]=function(_0x401dea,_0x34337e){if(_0x401dea[_0x52da('0x43')]['id']){delete _0x401dea[_0x52da('0x43')]['id'];}return db[_0x52da('0x38')][_0x52da('0x40')]({'where':{'id':_0x401dea[_0x52da('0x3d')]['id']}})[_0x52da('0x22')](handleEntityNotFound(_0x34337e,null))['then'](saveUpdates(_0x401dea['body'],null))[_0x52da('0x22')](respondWithResult(_0x34337e,null))['catch'](handleError(_0x34337e,null));};exports[_0x52da('0x21')]=function(_0x8c33dc,_0xaa7700){return db[_0x52da('0x38')]['find']({'where':{'id':_0x8c33dc[_0x52da('0x3d')]['id']}})[_0x52da('0x22')](handleEntityNotFound(_0xaa7700,null))[_0x52da('0x22')](removeEntity(_0xaa7700,null))[_0x52da('0x41')](handleError(_0xaa7700,null));};exports['describe']=function(_0x2347a5,_0x5a6deb){return db[_0x52da('0x38')][_0x52da('0x44')]()[_0x52da('0x22')](respondWithResult(_0x5a6deb,null))[_0x52da('0x41')](handleError(_0x5a6deb,null));}; \ No newline at end of file +var _0xc43c=['include','findAll','catch','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','Content-Range','reject','save','update','then','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','pick','filter','where','merge','options','includeAll'];(function(_0xdec3d8,_0x54eb20){var _0xdf8b50=function(_0x619f78){while(--_0x619f78){_0xdec3d8['push'](_0xdec3d8['shift']());}};_0xdf8b50(++_0x54eb20);}(_0xc43c,0x1ec));var _0xcc43=function(_0x365d36,_0x56ed88){_0x365d36=_0x365d36-0x0;var _0x38d126=_0xc43c[_0x365d36];return _0x38d126;};'use strict';var emlformat=require(_0xcc43('0x0'));var rimraf=require(_0xcc43('0x1'));var zipdir=require(_0xcc43('0x2'));var jsonpatch=require(_0xcc43('0x3'));var rp=require(_0xcc43('0x4'));var moment=require('moment');var BPromise=require(_0xcc43('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcc43('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc43('0x7'));var _=require(_0xcc43('0x8'));var squel=require(_0xcc43('0x9'));var crypto=require(_0xcc43('0xa'));var jsforce=require(_0xcc43('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcc43('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcc43('0xc'));var authService=require(_0xcc43('0xd'));var qs=require(_0xcc43('0xe'));var as=require(_0xcc43('0xf'));var hardwareService=require(_0xcc43('0x10'));var logger=require('../../config/logger')(_0xcc43('0x11'));var utils=require(_0xcc43('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xcc43('0x13'));var db=require(_0xcc43('0x14'))['db'];function respondWithStatusCode(_0x475567,_0x21387e){_0x21387e=_0x21387e||0xcc;return function(_0x225d12){if(_0x225d12){return _0x475567[_0xcc43('0x15')](_0x21387e);}return _0x475567['status'](_0x21387e)[_0xcc43('0x16')]();};}function respondWithResult(_0xf0514e,_0x513235){_0x513235=_0x513235||0xc8;return function(_0x10f90f){if(_0x10f90f){return _0xf0514e['status'](_0x513235)[_0xcc43('0x17')](_0x10f90f);}};}function respondWithFilteredResult(_0x40eb52,_0xd06de3){return function(_0x55058c){if(_0x55058c){var _0x401f48=typeof _0xd06de3[_0xcc43('0x18')]===_0xcc43('0x19')&&typeof _0xd06de3['limit']==='undefined';var _0x1102d9=_0x55058c[_0xcc43('0x1a')];var _0x4fbfbb=_0x401f48?0x0:_0xd06de3['offset'];var _0x2cb40c=_0x401f48?_0x55058c[_0xcc43('0x1a')]:_0xd06de3[_0xcc43('0x18')]+_0xd06de3['limit'];var _0x1e5043;if(_0x2cb40c>=_0x1102d9){_0x2cb40c=_0x1102d9;_0x1e5043=0xc8;}else{_0x1e5043=0xce;}_0x40eb52[_0xcc43('0x1b')](_0x1e5043);return _0x40eb52['set'](_0xcc43('0x1c'),_0x4fbfbb+'-'+_0x2cb40c+'/'+_0x1102d9)[_0xcc43('0x17')](_0x55058c);}return null;};}function patchUpdates(_0x2f2e71){return function(_0xf17b52){try{jsonpatch['apply'](_0xf17b52,_0x2f2e71,!![]);}catch(_0x4793f5){return BPromise[_0xcc43('0x1d')](_0x4793f5);}return _0xf17b52[_0xcc43('0x1e')]();};}function saveUpdates(_0x4c1d99,_0x4d724a){return function(_0x461d02){if(_0x461d02){return _0x461d02[_0xcc43('0x1f')](_0x4c1d99)['then'](function(_0x282009){return _0x282009;});}return null;};}function removeEntity(_0x2b761a,_0xcdaab1){return function(_0x5be555){if(_0x5be555){return _0x5be555['destroy']()[_0xcc43('0x20')](function(){_0x2b761a[_0xcc43('0x1b')](0xcc)[_0xcc43('0x16')]();});}};}function handleEntityNotFound(_0x499b24,_0x2cc685){return function(_0x2cc5a2){if(!_0x2cc5a2){_0x499b24[_0xcc43('0x15')](0x194);}return _0x2cc5a2;};}function handleError(_0x28197e,_0x5af371){_0x5af371=_0x5af371||0x1f4;return function(_0x280575){logger[_0xcc43('0x21')](_0x280575['stack']);if(_0x280575[_0xcc43('0x22')]){delete _0x280575[_0xcc43('0x22')];}_0x28197e[_0xcc43('0x1b')](_0x5af371)[_0xcc43('0x23')](_0x280575);};}exports[_0xcc43('0x24')]=function(_0x58946e,_0x58da42){var _0x473edf={},_0x5f2fa0={},_0x1acb4e={'count':0x0,'rows':[]};var _0x38582e=_[_0xcc43('0x25')](db[_0xcc43('0x26')][_0xcc43('0x27')],function(_0x26c9b0){return{'name':_0x26c9b0[_0xcc43('0x28')],'type':_0x26c9b0[_0xcc43('0x29')]['key']};});_0x5f2fa0['model']=_[_0xcc43('0x25')](_0x38582e,_0xcc43('0x22'));_0x5f2fa0[_0xcc43('0x2a')]=_[_0xcc43('0x2b')](_0x58946e[_0xcc43('0x2a')]);_0x5f2fa0[_0xcc43('0x2c')]=_[_0xcc43('0x2d')](_0x5f2fa0[_0xcc43('0x2e')],_0x5f2fa0[_0xcc43('0x2a')]);_0x473edf['attributes']=_[_0xcc43('0x2d')](_0x5f2fa0['model'],qs[_0xcc43('0x2f')](_0x58946e['query'][_0xcc43('0x2f')]));_0x473edf[_0xcc43('0x30')]=_0x473edf[_0xcc43('0x30')][_0xcc43('0x31')]?_0x473edf[_0xcc43('0x30')]:_0x5f2fa0['model'];if(!_0x58946e[_0xcc43('0x2a')][_0xcc43('0x32')](_0xcc43('0x33'))){_0x473edf[_0xcc43('0x34')]=qs[_0xcc43('0x34')](_0x58946e[_0xcc43('0x2a')][_0xcc43('0x34')]);_0x473edf['offset']=qs['offset'](_0x58946e[_0xcc43('0x2a')][_0xcc43('0x18')]);}_0x473edf[_0xcc43('0x35')]=qs['sort'](_0x58946e[_0xcc43('0x2a')]['sort']);_0x473edf['where']=qs[_0xcc43('0x2c')](_[_0xcc43('0x36')](_0x58946e[_0xcc43('0x2a')],_0x5f2fa0[_0xcc43('0x2c')]),_0x38582e);if(_0x58946e[_0xcc43('0x2a')][_0xcc43('0x37')]){_0x473edf[_0xcc43('0x38')]=_['merge'](_0x473edf[_0xcc43('0x38')],{'$or':_[_0xcc43('0x25')](_0x38582e,function(_0x34272d){if(_0x34272d[_0xcc43('0x29')]!=='VIRTUAL'){var _0x2d7690={};_0x2d7690[_0x34272d['name']]={'$like':'%'+_0x58946e[_0xcc43('0x2a')]['filter']+'%'};return _0x2d7690;}})});}_0x473edf=_[_0xcc43('0x39')]({},_0x473edf,_0x58946e[_0xcc43('0x3a')]);var _0x3b1256={'where':_0x473edf[_0xcc43('0x38')]};return db[_0xcc43('0x26')]['count'](_0x3b1256)[_0xcc43('0x20')](function(_0x4408e5){_0x1acb4e[_0xcc43('0x1a')]=_0x4408e5;if(_0x58946e[_0xcc43('0x2a')][_0xcc43('0x3b')]){_0x473edf[_0xcc43('0x3c')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xcc43('0x3d')](_0x473edf);})[_0xcc43('0x20')](function(_0x5a6a84){_0x1acb4e['rows']=_0x5a6a84;return _0x1acb4e;})[_0xcc43('0x20')](respondWithFilteredResult(_0x58da42,_0x473edf))[_0xcc43('0x3e')](handleError(_0x58da42,null));};exports['show']=function(_0x490576,_0x4d0bb9){var _0x1ece91={'raw':!![],'where':{'id':_0x490576[_0xcc43('0x3f')]['id']}},_0x2a2c64={};_0x2a2c64[_0xcc43('0x2e')]=_[_0xcc43('0x2b')](db[_0xcc43('0x26')][_0xcc43('0x27')]);_0x2a2c64[_0xcc43('0x2a')]=_[_0xcc43('0x2b')](_0x490576[_0xcc43('0x2a')]);_0x2a2c64['filters']=_['intersection'](_0x2a2c64[_0xcc43('0x2e')],_0x2a2c64['query']);_0x1ece91['attributes']=_[_0xcc43('0x2d')](_0x2a2c64[_0xcc43('0x2e')],qs['fields'](_0x490576['query']['fields']));_0x1ece91[_0xcc43('0x30')]=_0x1ece91[_0xcc43('0x30')][_0xcc43('0x31')]?_0x1ece91['attributes']:_0x2a2c64['model'];if(_0x490576[_0xcc43('0x2a')][_0xcc43('0x3b')]){_0x1ece91[_0xcc43('0x3c')]=[{'all':!![]}];}_0x1ece91=_[_0xcc43('0x39')]({},_0x1ece91,_0x490576[_0xcc43('0x3a')]);return db[_0xcc43('0x26')][_0xcc43('0x40')](_0x1ece91)[_0xcc43('0x20')](handleEntityNotFound(_0x4d0bb9,null))[_0xcc43('0x20')](respondWithResult(_0x4d0bb9,null))[_0xcc43('0x3e')](handleError(_0x4d0bb9,null));};exports[_0xcc43('0x41')]=function(_0x23f260,_0x15fafa){return db[_0xcc43('0x26')][_0xcc43('0x41')](_0x23f260[_0xcc43('0x42')],{})[_0xcc43('0x20')](respondWithResult(_0x15fafa,0xc9))['catch'](handleError(_0x15fafa,null));};exports['update']=function(_0x37e680,_0x269420){if(_0x37e680[_0xcc43('0x42')]['id']){delete _0x37e680[_0xcc43('0x42')]['id'];}return db[_0xcc43('0x26')][_0xcc43('0x40')]({'where':{'id':_0x37e680[_0xcc43('0x3f')]['id']}})[_0xcc43('0x20')](handleEntityNotFound(_0x269420,null))[_0xcc43('0x20')](saveUpdates(_0x37e680[_0xcc43('0x42')],null))[_0xcc43('0x20')](respondWithResult(_0x269420,null))[_0xcc43('0x3e')](handleError(_0x269420,null));};exports[_0xcc43('0x43')]=function(_0xbc57bd,_0x1d14a2){return db[_0xcc43('0x26')][_0xcc43('0x40')]({'where':{'id':_0xbc57bd[_0xcc43('0x3f')]['id']}})[_0xcc43('0x20')](handleEntityNotFound(_0x1d14a2,null))[_0xcc43('0x20')](removeEntity(_0x1d14a2,null))[_0xcc43('0x3e')](handleError(_0x1d14a2,null));};exports[_0xcc43('0x44')]=function(_0x1d77fe,_0x2830a8){return db[_0xcc43('0x26')][_0xcc43('0x44')]()[_0xcc43('0x20')](respondWithResult(_0x2830a8,null))[_0xcc43('0x3e')](handleError(_0x2830a8,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index ef7d359..a6d1607 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 _0xbdd5=['request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2595a6,_0x48fc45){var _0x460197=function(_0x18f9db){while(--_0x18f9db){_0x2595a6['push'](_0x2595a6['shift']());}};_0x460197(++_0x48fc45);}(_0xbdd5,0x140));var _0x5bdd=function(_0xca81f6,_0x35cb4f){_0xca81f6=_0xca81f6-0x0;var _0x2f6673=_0xbdd5[_0xca81f6];return _0x2f6673;};'use strict';var _=require(_0x5bdd('0x0'));var util=require('util');var logger=require(_0x5bdd('0x1'))(_0x5bdd('0x2'));var moment=require(_0x5bdd('0x3'));var BPromise=require(_0x5bdd('0x4'));var rp=require(_0x5bdd('0x5'));var fs=require('fs');var path=require(_0x5bdd('0x6'));var rimraf=require('rimraf');var config=require(_0x5bdd('0x7'));var attributes=require(_0x5bdd('0x8'));module[_0x5bdd('0x9')]=function(_0xe3bea1,_0x42a7f6){return _0xe3bea1[_0x5bdd('0xa')](_0x5bdd('0xb'),attributes,{'tableName':_0x5bdd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d68=['request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','util','../../config/logger','api','moment','bluebird'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x6d68,0x193));var _0x86d6=function(_0x4fe1bb,_0x9b6bcb){_0x4fe1bb=_0x4fe1bb-0x0;var _0x37f838=_0x6d68[_0x4fe1bb];return _0x37f838;};'use strict';var _=require('lodash');var util=require(_0x86d6('0x0'));var logger=require(_0x86d6('0x1'))(_0x86d6('0x2'));var moment=require(_0x86d6('0x3'));var BPromise=require(_0x86d6('0x4'));var rp=require(_0x86d6('0x5'));var fs=require('fs');var path=require(_0x86d6('0x6'));var rimraf=require(_0x86d6('0x7'));var config=require('../../config/environment');var attributes=require(_0x86d6('0x8'));module[_0x86d6('0x9')]=function(_0x11f98b,_0x4afa03){return _0x11f98b[_0x86d6('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x86d6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 635b286..03c5720 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 _0xc2c4=['stringify','error','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','JscriptyQuestionReport,\x20%s,\x20%s','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s'];(function(_0x3937fe,_0xbc0f87){var _0x37910f=function(_0x4f6b06){while(--_0x4f6b06){_0x3937fe['push'](_0x3937fe['shift']());}};_0x37910f(++_0xbc0f87);}(_0xc2c4,0x17d));var _0x4c2c=function(_0x5c54f5,_0x493113){_0x5c54f5=_0x5c54f5-0x0;var _0x3df2bc=_0xc2c4[_0x5c54f5];return _0x3df2bc;};'use strict';var _=require(_0x4c2c('0x0'));var util=require(_0x4c2c('0x1'));var moment=require(_0x4c2c('0x2'));var BPromise=require(_0x4c2c('0x3'));var rs=require(_0x4c2c('0x4'));var fs=require('fs');var Redis=require(_0x4c2c('0x5'));var db=require(_0x4c2c('0x6'))['db'];var utils=require(_0x4c2c('0x7'));var logger=require(_0x4c2c('0x8'))(_0x4c2c('0x9'));var config=require(_0x4c2c('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c91b8,_0x26d7cb,_0x4b86da){return new BPromise(function(_0x55bb24,_0x278598){return client[_0x4c2c('0xb')](_0x3c91b8,_0x4b86da)[_0x4c2c('0xc')](function(_0x4d9273){logger['info'](_0x4c2c('0xd'),_0x26d7cb,'request\x20sent');logger['debug'](_0x4c2c('0xe'),_0x26d7cb,'request\x20sent',JSON[_0x4c2c('0xf')](_0x4d9273));if(_0x4d9273[_0x4c2c('0x10')]){if(_0x4d9273['error']['code']===0x1f4){logger[_0x4c2c('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x26d7cb,_0x4d9273[_0x4c2c('0x10')]['message']);return _0x278598(_0x4d9273[_0x4c2c('0x10')][_0x4c2c('0x11')]);}logger[_0x4c2c('0x10')](_0x4c2c('0xd'),_0x26d7cb,_0x4d9273[_0x4c2c('0x10')][_0x4c2c('0x11')]);return _0x55bb24(_0x4d9273[_0x4c2c('0x10')][_0x4c2c('0x11')]);}else{logger[_0x4c2c('0x12')](_0x4c2c('0xd'),_0x26d7cb,_0x4c2c('0x13'));_0x55bb24(_0x4d9273[_0x4c2c('0x14')][_0x4c2c('0x11')]);}})[_0x4c2c('0x15')](function(_0x4913d1){logger[_0x4c2c('0x10')](_0x4c2c('0xd'),_0x26d7cb,_0x4913d1);_0x278598(_0x4913d1);});});} \ No newline at end of file +var _0x5e75=['result','catch','JscriptyQuestionReport,\x20%s,\x20%s','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x3271db,_0x1679c8){var _0x21f4bb=function(_0xf45b0e){while(--_0xf45b0e){_0x3271db['push'](_0x3271db['shift']());}};_0x21f4bb(++_0x1679c8);}(_0x5e75,0x17d));var _0x55e7=function(_0x4e6a00,_0x51040d){_0x4e6a00=_0x4e6a00-0x0;var _0xaa0eb3=_0x5e75[_0x4e6a00];return _0xaa0eb3;};'use strict';var _=require(_0x55e7('0x0'));var util=require('util');var moment=require(_0x55e7('0x1'));var BPromise=require(_0x55e7('0x2'));var rs=require(_0x55e7('0x3'));var fs=require('fs');var Redis=require(_0x55e7('0x4'));var db=require(_0x55e7('0x5'))['db'];var utils=require(_0x55e7('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x55e7('0x7'));var client=jayson[_0x55e7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19cf74,_0x419d5a,_0x2b04ac){return new BPromise(function(_0x3ffc54,_0x510d45){return client[_0x55e7('0x9')](_0x19cf74,_0x2b04ac)[_0x55e7('0xa')](function(_0x2b19cf){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x419d5a,_0x55e7('0xb'));logger[_0x55e7('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x419d5a,_0x55e7('0xb'),JSON[_0x55e7('0xd')](_0x2b19cf));if(_0x2b19cf[_0x55e7('0xe')]){if(_0x2b19cf[_0x55e7('0xe')][_0x55e7('0xf')]===0x1f4){logger[_0x55e7('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x419d5a,_0x2b19cf[_0x55e7('0xe')][_0x55e7('0x10')]);return _0x510d45(_0x2b19cf[_0x55e7('0xe')][_0x55e7('0x10')]);}logger[_0x55e7('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x419d5a,_0x2b19cf[_0x55e7('0xe')][_0x55e7('0x10')]);return _0x3ffc54(_0x2b19cf['error'][_0x55e7('0x10')]);}else{logger[_0x55e7('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x419d5a,_0x55e7('0xb'));_0x3ffc54(_0x2b19cf[_0x55e7('0x12')]['message']);}})[_0x55e7('0x13')](function(_0x24fb32){logger[_0x55e7('0xe')](_0x55e7('0x14'),_0x419d5a,_0x24fb32);_0x510d45(_0x24fb32);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 2f0896e..04d4a0e 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 _0xbadd=['../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x15dbc1,_0x553399){var _0x2a178c=function(_0x5eb288){while(--_0x5eb288){_0x15dbc1['push'](_0x15dbc1['shift']());}};_0x2a178c(++_0x553399);}(_0xbadd,0x142));var _0xdbad=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xbadd[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0xdbad('0x0'));var util=require('util');var path=require(_0xdbad('0x1'));var timeout=require(_0xdbad('0x2'));var express=require(_0xdbad('0x3'));var router=express[_0xdbad('0x4')]();var fs_extra=require(_0xdbad('0x5'));var auth=require(_0xdbad('0x6'));var interaction=require(_0xdbad('0x7'));var config=require(_0xdbad('0x8'));var controller=require(_0xdbad('0x9'));router[_0xdbad('0xa')]('/',auth[_0xdbad('0xb')](),controller[_0xdbad('0xc')]);router[_0xdbad('0xa')](_0xdbad('0xd'),auth[_0xdbad('0xb')](),controller[_0xdbad('0xe')]);router[_0xdbad('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xdbad('0xf')]);router[_0xdbad('0xa')]('/:id/questions',auth[_0xdbad('0xb')](),controller['getQuestions']);router[_0xdbad('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdbad('0x11')](_0xdbad('0x12'),auth['isAuthenticated'](),controller[_0xdbad('0x13')]);router[_0xdbad('0x14')](_0xdbad('0x12'),auth[_0xdbad('0xb')](),controller[_0xdbad('0x15')]);module['exports']=router; \ No newline at end of file +var _0x4255=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/questions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4255,0xbb));var _0x5425=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x4255[_0x68c979];return _0x4f0001;};'use strict';var multer=require(_0x5425('0x0'));var util=require(_0x5425('0x1'));var path=require(_0x5425('0x2'));var timeout=require(_0x5425('0x3'));var express=require(_0x5425('0x4'));var router=express[_0x5425('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5425('0x6'));var interaction=require(_0x5425('0x7'));var config=require(_0x5425('0x8'));var controller=require(_0x5425('0x9'));router[_0x5425('0xa')]('/',auth[_0x5425('0xb')](),controller['index']);router[_0x5425('0xa')](_0x5425('0xc'),auth['isAuthenticated'](),controller[_0x5425('0xd')]);router[_0x5425('0xa')](_0x5425('0xe'),auth[_0x5425('0xb')](),controller[_0x5425('0xf')]);router[_0x5425('0xa')](_0x5425('0x10'),auth[_0x5425('0xb')](),controller['getQuestions']);router[_0x5425('0x11')]('/',auth['isAuthenticated'](),controller[_0x5425('0x12')]);router[_0x5425('0x13')](_0x5425('0xe'),auth[_0x5425('0xb')](),controller[_0x5425('0x14')]);router[_0x5425('0x15')](_0x5425('0xe'),auth[_0x5425('0xb')](),controller[_0x5425('0x16')]);module[_0x5425('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 4c2d322..eb1b06e 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 _0x8c75=['DATE','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8c75,0x1d1));var _0x58c7=function(_0x33a5d0,_0x470669){_0x33a5d0=_0x33a5d0-0x0;var _0x5e2b53=_0x8c75[_0x33a5d0];return _0x5e2b53;};'use strict';var moment=require(_0x58c7('0x0'));var Sequelize=require(_0x58c7('0x1'));module[_0x58c7('0x2')]={'starttime':{'type':Sequelize[_0x58c7('0x3')],'set':function(_0x52509d){this[_0x58c7('0x4')]('starttime',_0x52509d);this[_0x58c7('0x4')](_0x58c7('0x5'),moment()['format'](_0x58c7('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x58c7('0x7')]},'projectname':{'type':Sequelize[_0x58c7('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x58c7('0x7')]},'calleridname':{'type':Sequelize[_0x58c7('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x58c7('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xcd3b=['STRING','BOOLEAN','moment','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3b1fa1,_0x254f7f){var _0x2fd10c=function(_0x25ba77){while(--_0x25ba77){_0x3b1fa1['push'](_0x3b1fa1['shift']());}};_0x2fd10c(++_0x254f7f);}(_0xcd3b,0x19c));var _0xbcd3=function(_0x6ce2c5,_0x412960){_0x6ce2c5=_0x6ce2c5-0x0;var _0x309bc9=_0xcd3b[_0x6ce2c5];return _0x309bc9;};'use strict';var moment=require(_0xbcd3('0x0'));var Sequelize=require('sequelize');module[_0xbcd3('0x1')]={'starttime':{'type':Sequelize[_0xbcd3('0x2')],'set':function(_0x35319d){this[_0xbcd3('0x3')](_0xbcd3('0x4'),_0x35319d);this['setDataValue'](_0xbcd3('0x5'),moment()[_0xbcd3('0x6')](_0xbcd3('0x7')));}},'endtime':{'type':Sequelize[_0xbcd3('0x2')]},'membername':{'type':Sequelize[_0xbcd3('0x8')]},'projectname':{'type':Sequelize[_0xbcd3('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xbcd3('0x8')]},'calleridname':{'type':Sequelize[_0xbcd3('0x8')]},'calleridnum':{'type':Sequelize[_0xbcd3('0x8')]},'completed':{'type':Sequelize[_0xbcd3('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index c316e64..7858a56 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 _0xb886=['key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','JscriptySessionReport','includeAll','include','findAll','rows','catch','params','create','body','find','describe','getQuestions','JscriptyQuestionReport','SessionId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type'];(function(_0x1b736a,_0x3ddec4){var _0x557e9a=function(_0x340fbb){while(--_0x340fbb){_0x1b736a['push'](_0x1b736a['shift']());}};_0x557e9a(++_0x3ddec4);}(_0xb886,0xbd));var _0x6b88=function(_0x12ce6b,_0x3e38d9){_0x12ce6b=_0x12ce6b-0x0;var _0x37f604=_0xb886[_0x12ce6b];return _0x37f604;};'use strict';var emlformat=require(_0x6b88('0x0'));var rimraf=require(_0x6b88('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b88('0x2'));var rp=require(_0x6b88('0x3'));var moment=require(_0x6b88('0x4'));var BPromise=require(_0x6b88('0x5'));var Mustache=require('mustache');var util=require(_0x6b88('0x6'));var path=require(_0x6b88('0x7'));var sox=require(_0x6b88('0x8'));var csv=require(_0x6b88('0x9'));var ejs=require(_0x6b88('0xa'));var fs=require('fs');var fs_extra=require(_0x6b88('0xb'));var _=require('lodash');var squel=require(_0x6b88('0xc'));var crypto=require('crypto');var jsforce=require(_0x6b88('0xd'));var deskjs=require(_0x6b88('0xe'));var toCsv=require(_0x6b88('0x9'));var querystring=require('querystring');var Papa=require(_0x6b88('0xf'));var Redis=require('ioredis');var authService=require(_0x6b88('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6b88('0x11'));var hardwareService=require(_0x6b88('0x12'));var logger=require(_0x6b88('0x13'))(_0x6b88('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6b88('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12110a,_0x15a08a){_0x15a08a=_0x15a08a||0xcc;return function(_0x2903eb){if(_0x2903eb){return _0x12110a[_0x6b88('0x16')](_0x15a08a);}return _0x12110a['status'](_0x15a08a)['end']();};}function respondWithResult(_0x227341,_0x2188bb){_0x2188bb=_0x2188bb||0xc8;return function(_0x4cbb71){if(_0x4cbb71){return _0x227341['status'](_0x2188bb)[_0x6b88('0x17')](_0x4cbb71);}};}function respondWithFilteredResult(_0x1e4781,_0x4aedd8){return function(_0x18363a){if(_0x18363a){var _0x4340eb=typeof _0x4aedd8[_0x6b88('0x18')]===_0x6b88('0x19')&&typeof _0x4aedd8[_0x6b88('0x1a')]==='undefined';var _0x327865=_0x18363a[_0x6b88('0x1b')];var _0x4b17c5=_0x4340eb?0x0:_0x4aedd8[_0x6b88('0x18')];var _0x44865d=_0x4340eb?_0x18363a[_0x6b88('0x1b')]:_0x4aedd8[_0x6b88('0x18')]+_0x4aedd8[_0x6b88('0x1a')];var _0x358d7b;if(_0x44865d>=_0x327865){_0x44865d=_0x327865;_0x358d7b=0xc8;}else{_0x358d7b=0xce;}_0x1e4781[_0x6b88('0x1c')](_0x358d7b);return _0x1e4781[_0x6b88('0x1d')](_0x6b88('0x1e'),_0x4b17c5+'-'+_0x44865d+'/'+_0x327865)['json'](_0x18363a);}return null;};}function patchUpdates(_0x3ce50f){return function(_0x4317f7){try{jsonpatch['apply'](_0x4317f7,_0x3ce50f,!![]);}catch(_0x12c1fd){return BPromise[_0x6b88('0x1f')](_0x12c1fd);}return _0x4317f7[_0x6b88('0x20')]();};}function saveUpdates(_0x4b6080,_0x4dc307){return function(_0x59c726){if(_0x59c726){return _0x59c726[_0x6b88('0x21')](_0x4b6080)[_0x6b88('0x22')](function(_0x2db1af){return _0x2db1af;});}return null;};}function removeEntity(_0x385007,_0x86a999){return function(_0xfe46d2){if(_0xfe46d2){return _0xfe46d2[_0x6b88('0x23')]()[_0x6b88('0x22')](function(){_0x385007[_0x6b88('0x1c')](0xcc)[_0x6b88('0x24')]();});}};}function handleEntityNotFound(_0x44dc9f,_0x4a7ea8){return function(_0x279d63){if(!_0x279d63){_0x44dc9f[_0x6b88('0x16')](0x194);}return _0x279d63;};}function handleError(_0x34edb1,_0x42559d){_0x42559d=_0x42559d||0x1f4;return function(_0x251213){logger[_0x6b88('0x25')](_0x251213[_0x6b88('0x26')]);if(_0x251213['name']){delete _0x251213[_0x6b88('0x27')];}_0x34edb1[_0x6b88('0x1c')](_0x42559d)['send'](_0x251213);};}exports[_0x6b88('0x28')]=function(_0x1a3471,_0x5db09c){var _0x2e8312={},_0x1f6689={},_0x32bd00={'count':0x0,'rows':[]};var _0x55a00c=_[_0x6b88('0x29')](db['JscriptySessionReport'][_0x6b88('0x2a')],function(_0x31a530){return{'name':_0x31a530[_0x6b88('0x2b')],'type':_0x31a530[_0x6b88('0x2c')][_0x6b88('0x2d')]};});_0x1f6689[_0x6b88('0x2e')]=_[_0x6b88('0x29')](_0x55a00c,_0x6b88('0x27'));_0x1f6689[_0x6b88('0x2f')]=_[_0x6b88('0x30')](_0x1a3471[_0x6b88('0x2f')]);_0x1f6689['filters']=_[_0x6b88('0x31')](_0x1f6689['model'],_0x1f6689[_0x6b88('0x2f')]);_0x2e8312[_0x6b88('0x32')]=_['intersection'](_0x1f6689[_0x6b88('0x2e')],qs[_0x6b88('0x33')](_0x1a3471[_0x6b88('0x2f')]['fields']));_0x2e8312['attributes']=_0x2e8312[_0x6b88('0x32')][_0x6b88('0x34')]?_0x2e8312[_0x6b88('0x32')]:_0x1f6689[_0x6b88('0x2e')];if(!_0x1a3471[_0x6b88('0x2f')][_0x6b88('0x35')](_0x6b88('0x36'))){_0x2e8312[_0x6b88('0x1a')]=qs[_0x6b88('0x1a')](_0x1a3471[_0x6b88('0x2f')][_0x6b88('0x1a')]);_0x2e8312['offset']=qs[_0x6b88('0x18')](_0x1a3471[_0x6b88('0x2f')][_0x6b88('0x18')]);}_0x2e8312[_0x6b88('0x37')]=qs[_0x6b88('0x38')](_0x1a3471[_0x6b88('0x2f')][_0x6b88('0x38')]);_0x2e8312[_0x6b88('0x39')]=qs[_0x6b88('0x3a')](_[_0x6b88('0x3b')](_0x1a3471[_0x6b88('0x2f')],_0x1f6689[_0x6b88('0x3a')]),_0x55a00c);if(_0x1a3471['query'][_0x6b88('0x3c')]){_0x2e8312[_0x6b88('0x39')]=_[_0x6b88('0x3d')](_0x2e8312[_0x6b88('0x39')],{'$or':_[_0x6b88('0x29')](_0x55a00c,function(_0x376927){if(_0x376927[_0x6b88('0x2c')]!==_0x6b88('0x3e')){var _0x1d24bc={};_0x1d24bc[_0x376927[_0x6b88('0x27')]]={'$like':'%'+_0x1a3471[_0x6b88('0x2f')][_0x6b88('0x3c')]+'%'};return _0x1d24bc;}})});}_0x2e8312=_[_0x6b88('0x3d')]({},_0x2e8312,_0x1a3471[_0x6b88('0x3f')]);var _0x8fea33={'where':_0x2e8312['where']};return db[_0x6b88('0x40')][_0x6b88('0x1b')](_0x8fea33)[_0x6b88('0x22')](function(_0x758836){_0x32bd00[_0x6b88('0x1b')]=_0x758836;if(_0x1a3471[_0x6b88('0x2f')][_0x6b88('0x41')]){_0x2e8312[_0x6b88('0x42')]=[{'all':!![]}];}return db[_0x6b88('0x40')][_0x6b88('0x43')](_0x2e8312);})[_0x6b88('0x22')](function(_0x58c3fc){_0x32bd00[_0x6b88('0x44')]=_0x58c3fc;return _0x32bd00;})[_0x6b88('0x22')](respondWithFilteredResult(_0x5db09c,_0x2e8312))[_0x6b88('0x45')](handleError(_0x5db09c,null));};exports['show']=function(_0x5b3846,_0x5b0308){var _0x45805b={'raw':!![],'where':{'id':_0x5b3846[_0x6b88('0x46')]['id']}},_0x3f4b97={};_0x3f4b97['model']=_['keys'](db[_0x6b88('0x40')][_0x6b88('0x2a')]);_0x3f4b97['query']=_[_0x6b88('0x30')](_0x5b3846[_0x6b88('0x2f')]);_0x3f4b97[_0x6b88('0x3a')]=_[_0x6b88('0x31')](_0x3f4b97[_0x6b88('0x2e')],_0x3f4b97['query']);_0x45805b[_0x6b88('0x32')]=_[_0x6b88('0x31')](_0x3f4b97[_0x6b88('0x2e')],qs[_0x6b88('0x33')](_0x5b3846['query'][_0x6b88('0x33')]));_0x45805b[_0x6b88('0x32')]=_0x45805b[_0x6b88('0x32')]['length']?_0x45805b[_0x6b88('0x32')]:_0x3f4b97['model'];if(_0x5b3846[_0x6b88('0x2f')][_0x6b88('0x41')]){_0x45805b[_0x6b88('0x42')]=[{'all':!![]}];}_0x45805b=_[_0x6b88('0x3d')]({},_0x45805b,_0x5b3846[_0x6b88('0x3f')]);return db[_0x6b88('0x40')]['find'](_0x45805b)[_0x6b88('0x22')](handleEntityNotFound(_0x5b0308,null))[_0x6b88('0x22')](respondWithResult(_0x5b0308,null))['catch'](handleError(_0x5b0308,null));};exports['create']=function(_0x35581b,_0x1a7ca7){return db[_0x6b88('0x40')][_0x6b88('0x47')](_0x35581b['body'],{})[_0x6b88('0x22')](respondWithResult(_0x1a7ca7,0xc9))[_0x6b88('0x45')](handleError(_0x1a7ca7,null));};exports['update']=function(_0x1569f4,_0x46b3ba){if(_0x1569f4[_0x6b88('0x48')]['id']){delete _0x1569f4[_0x6b88('0x48')]['id'];}return db[_0x6b88('0x40')]['find']({'where':{'id':_0x1569f4['params']['id']}})[_0x6b88('0x22')](handleEntityNotFound(_0x46b3ba,null))[_0x6b88('0x22')](saveUpdates(_0x1569f4['body'],null))['then'](respondWithResult(_0x46b3ba,null))[_0x6b88('0x45')](handleError(_0x46b3ba,null));};exports[_0x6b88('0x23')]=function(_0xd5dea3,_0x431cba){return db['JscriptySessionReport'][_0x6b88('0x49')]({'where':{'id':_0xd5dea3[_0x6b88('0x46')]['id']}})['then'](handleEntityNotFound(_0x431cba,null))['then'](removeEntity(_0x431cba,null))['catch'](handleError(_0x431cba,null));};exports[_0x6b88('0x4a')]=function(_0x94afd8,_0x317759){return db[_0x6b88('0x40')][_0x6b88('0x4a')]()[_0x6b88('0x22')](respondWithResult(_0x317759,null))[_0x6b88('0x45')](handleError(_0x317759,null));};exports[_0x6b88('0x4b')]=function(_0x1d00b9,_0x2c8c9b,_0x4c5791){var _0x87b933={'raw':!![],'where':{}};var _0x267314={};var _0x3766c5={'count':0x0,'rows':[]};return db[_0x6b88('0x40')]['findOne']({'where':{'id':_0x1d00b9[_0x6b88('0x46')]['id']}})[_0x6b88('0x22')](handleEntityNotFound(_0x2c8c9b,null))[_0x6b88('0x22')](function(_0x420db1){if(_0x420db1){_0x267314[_0x6b88('0x2e')]=_[_0x6b88('0x30')](db[_0x6b88('0x4c')][_0x6b88('0x2a')]);_0x267314[_0x6b88('0x2f')]=_[_0x6b88('0x30')](_0x1d00b9[_0x6b88('0x2f')]);_0x267314['filters']=_[_0x6b88('0x31')](_0x267314[_0x6b88('0x2e')],_0x267314[_0x6b88('0x2f')]);_0x87b933[_0x6b88('0x32')]=_[_0x6b88('0x31')](_0x267314[_0x6b88('0x2e')],qs[_0x6b88('0x33')](_0x1d00b9[_0x6b88('0x2f')][_0x6b88('0x33')]));_0x87b933[_0x6b88('0x32')]=_0x87b933[_0x6b88('0x32')][_0x6b88('0x34')]?_0x87b933[_0x6b88('0x32')]:_0x267314['model'];if(!_0x1d00b9[_0x6b88('0x2f')][_0x6b88('0x35')](_0x6b88('0x36'))){_0x87b933[_0x6b88('0x1a')]=qs[_0x6b88('0x1a')](_0x1d00b9['query'][_0x6b88('0x1a')]);_0x87b933[_0x6b88('0x18')]=qs['offset'](_0x1d00b9[_0x6b88('0x2f')][_0x6b88('0x18')]);}_0x87b933[_0x6b88('0x37')]=qs[_0x6b88('0x38')](_0x1d00b9[_0x6b88('0x2f')]['sort']);_0x87b933[_0x6b88('0x39')]=qs[_0x6b88('0x3a')](_['pick'](_0x1d00b9[_0x6b88('0x2f')],_0x267314['filters']));_0x87b933[_0x6b88('0x39')][_0x6b88('0x4d')]=_0x420db1['id'];if(_0x1d00b9[_0x6b88('0x2f')][_0x6b88('0x3c')]){_0x87b933[_0x6b88('0x39')]=_[_0x6b88('0x3d')](_0x87b933[_0x6b88('0x39')],{'$or':_[_0x6b88('0x29')](_0x87b933[_0x6b88('0x32')],function(_0x9a0b0){var _0x413d88={};_0x413d88[_0x9a0b0]={'$like':'%'+_0x1d00b9[_0x6b88('0x2f')][_0x6b88('0x3c')]+'%'};return _0x413d88;})});}_0x87b933=_[_0x6b88('0x3d')]({},_0x87b933,_0x1d00b9['options']);return db[_0x6b88('0x4c')][_0x6b88('0x1b')]({'where':_0x87b933[_0x6b88('0x39')]})[_0x6b88('0x22')](function(_0x4ffcdb){_0x3766c5['count']=_0x4ffcdb;if(_0x1d00b9['query'][_0x6b88('0x41')]){_0x87b933[_0x6b88('0x42')]=[{'all':!![]}];}return db[_0x6b88('0x4c')][_0x6b88('0x43')](_0x87b933);})[_0x6b88('0x22')](function(_0x13a60b){_0x3766c5[_0x6b88('0x44')]=_0x13a60b;return _0x3766c5;});}})[_0x6b88('0x22')](respondWithFilteredResult(_0x2c8c9b,_0x87b933))['catch'](handleError(_0x2c8c9b,null));}; \ No newline at end of file +var _0xf1fa=['../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','show','keys','find','create','body','params','catch','destroy','describe','getQuestions','findOne','length','JscriptyQuestionReport','findAll','eml-format','zip-dir','request-promise','moment','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xf1fa,0x82));var _0xaf1f=function(_0x54afbe,_0x4aed33){_0x54afbe=_0x54afbe-0x0;var _0x496024=_0xf1fa[_0x54afbe];return _0x496024;};'use strict';var emlformat=require(_0xaf1f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf1f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf1f('0x2'));var moment=require(_0xaf1f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xaf1f('0x4'));var util=require(_0xaf1f('0x5'));var path=require(_0xaf1f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaf1f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf1f('0x8'));var squel=require(_0xaf1f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaf1f('0xa'));var toCsv=require(_0xaf1f('0xb'));var querystring=require(_0xaf1f('0xc'));var Papa=require(_0xaf1f('0xd'));var Redis=require(_0xaf1f('0xe'));var authService=require(_0xaf1f('0xf'));var qs=require(_0xaf1f('0x10'));var as=require(_0xaf1f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xaf1f('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xaf1f('0x13'));var db=require(_0xaf1f('0x14'))['db'];function respondWithStatusCode(_0x35cf60,_0x2182f5){_0x2182f5=_0x2182f5||0xcc;return function(_0x512c01){if(_0x512c01){return _0x35cf60[_0xaf1f('0x15')](_0x2182f5);}return _0x35cf60[_0xaf1f('0x16')](_0x2182f5)[_0xaf1f('0x17')]();};}function respondWithResult(_0x2f3788,_0x5b8d62){_0x5b8d62=_0x5b8d62||0xc8;return function(_0x546f01){if(_0x546f01){return _0x2f3788[_0xaf1f('0x16')](_0x5b8d62)[_0xaf1f('0x18')](_0x546f01);}};}function respondWithFilteredResult(_0x508b7d,_0x190bff){return function(_0x25548a){if(_0x25548a){var _0x811550=typeof _0x190bff['offset']===_0xaf1f('0x19')&&typeof _0x190bff[_0xaf1f('0x1a')]==='undefined';var _0x2a93cf=_0x25548a[_0xaf1f('0x1b')];var _0x2e68fe=_0x811550?0x0:_0x190bff[_0xaf1f('0x1c')];var _0x18ea88=_0x811550?_0x25548a[_0xaf1f('0x1b')]:_0x190bff[_0xaf1f('0x1c')]+_0x190bff['limit'];var _0x171aaf;if(_0x18ea88>=_0x2a93cf){_0x18ea88=_0x2a93cf;_0x171aaf=0xc8;}else{_0x171aaf=0xce;}_0x508b7d[_0xaf1f('0x16')](_0x171aaf);return _0x508b7d[_0xaf1f('0x1d')]('Content-Range',_0x2e68fe+'-'+_0x18ea88+'/'+_0x2a93cf)['json'](_0x25548a);}return null;};}function patchUpdates(_0xc8d443){return function(_0x3a0291){try{jsonpatch['apply'](_0x3a0291,_0xc8d443,!![]);}catch(_0xb436a2){return BPromise[_0xaf1f('0x1e')](_0xb436a2);}return _0x3a0291[_0xaf1f('0x1f')]();};}function saveUpdates(_0xf95df,_0x1c4d74){return function(_0x57cad4){if(_0x57cad4){return _0x57cad4[_0xaf1f('0x20')](_0xf95df)[_0xaf1f('0x21')](function(_0x15f33b){return _0x15f33b;});}return null;};}function removeEntity(_0x4b3373,_0x5d0ecf){return function(_0x47ab12){if(_0x47ab12){return _0x47ab12['destroy']()['then'](function(){_0x4b3373[_0xaf1f('0x16')](0xcc)[_0xaf1f('0x17')]();});}};}function handleEntityNotFound(_0x5659d1,_0x400e75){return function(_0x344454){if(!_0x344454){_0x5659d1['sendStatus'](0x194);}return _0x344454;};}function handleError(_0x1eb42c,_0x3698a6){_0x3698a6=_0x3698a6||0x1f4;return function(_0x4fc963){logger[_0xaf1f('0x22')](_0x4fc963[_0xaf1f('0x23')]);if(_0x4fc963[_0xaf1f('0x24')]){delete _0x4fc963[_0xaf1f('0x24')];}_0x1eb42c[_0xaf1f('0x16')](_0x3698a6)[_0xaf1f('0x25')](_0x4fc963);};}exports[_0xaf1f('0x26')]=function(_0x3cd63e,_0x1af4a0){var _0x245ab3={},_0x92b70d={},_0x4832fe={'count':0x0,'rows':[]};var _0x2cc943=_[_0xaf1f('0x27')](db[_0xaf1f('0x28')][_0xaf1f('0x29')],function(_0x33ed6e){return{'name':_0x33ed6e[_0xaf1f('0x2a')],'type':_0x33ed6e[_0xaf1f('0x2b')]['key']};});_0x92b70d[_0xaf1f('0x2c')]=_[_0xaf1f('0x27')](_0x2cc943,_0xaf1f('0x24'));_0x92b70d[_0xaf1f('0x2d')]=_['keys'](_0x3cd63e[_0xaf1f('0x2d')]);_0x92b70d[_0xaf1f('0x2e')]=_[_0xaf1f('0x2f')](_0x92b70d['model'],_0x92b70d['query']);_0x245ab3[_0xaf1f('0x30')]=_['intersection'](_0x92b70d[_0xaf1f('0x2c')],qs[_0xaf1f('0x31')](_0x3cd63e['query']['fields']));_0x245ab3[_0xaf1f('0x30')]=_0x245ab3[_0xaf1f('0x30')]['length']?_0x245ab3[_0xaf1f('0x30')]:_0x92b70d[_0xaf1f('0x2c')];if(!_0x3cd63e['query'][_0xaf1f('0x32')](_0xaf1f('0x33'))){_0x245ab3[_0xaf1f('0x1a')]=qs[_0xaf1f('0x1a')](_0x3cd63e['query'][_0xaf1f('0x1a')]);_0x245ab3[_0xaf1f('0x1c')]=qs['offset'](_0x3cd63e['query']['offset']);}_0x245ab3[_0xaf1f('0x34')]=qs[_0xaf1f('0x35')](_0x3cd63e[_0xaf1f('0x2d')]['sort']);_0x245ab3['where']=qs[_0xaf1f('0x2e')](_[_0xaf1f('0x36')](_0x3cd63e[_0xaf1f('0x2d')],_0x92b70d['filters']),_0x2cc943);if(_0x3cd63e[_0xaf1f('0x2d')]['filter']){_0x245ab3[_0xaf1f('0x37')]=_[_0xaf1f('0x38')](_0x245ab3[_0xaf1f('0x37')],{'$or':_['map'](_0x2cc943,function(_0x3178fb){if(_0x3178fb[_0xaf1f('0x2b')]!=='VIRTUAL'){var _0x6679e5={};_0x6679e5[_0x3178fb[_0xaf1f('0x24')]]={'$like':'%'+_0x3cd63e['query'][_0xaf1f('0x39')]+'%'};return _0x6679e5;}})});}_0x245ab3=_['merge']({},_0x245ab3,_0x3cd63e[_0xaf1f('0x3a')]);var _0x3f849={'where':_0x245ab3['where']};return db[_0xaf1f('0x28')][_0xaf1f('0x1b')](_0x3f849)['then'](function(_0x1c6275){_0x4832fe[_0xaf1f('0x1b')]=_0x1c6275;if(_0x3cd63e[_0xaf1f('0x2d')][_0xaf1f('0x3b')]){_0x245ab3[_0xaf1f('0x3c')]=[{'all':!![]}];}return db[_0xaf1f('0x28')]['findAll'](_0x245ab3);})[_0xaf1f('0x21')](function(_0x570941){_0x4832fe['rows']=_0x570941;return _0x4832fe;})[_0xaf1f('0x21')](respondWithFilteredResult(_0x1af4a0,_0x245ab3))['catch'](handleError(_0x1af4a0,null));};exports[_0xaf1f('0x3d')]=function(_0x47cba8,_0x21d58d){var _0x319752={'raw':!![],'where':{'id':_0x47cba8['params']['id']}},_0x342ec0={};_0x342ec0['model']=_[_0xaf1f('0x3e')](db[_0xaf1f('0x28')][_0xaf1f('0x29')]);_0x342ec0[_0xaf1f('0x2d')]=_[_0xaf1f('0x3e')](_0x47cba8['query']);_0x342ec0[_0xaf1f('0x2e')]=_[_0xaf1f('0x2f')](_0x342ec0[_0xaf1f('0x2c')],_0x342ec0[_0xaf1f('0x2d')]);_0x319752[_0xaf1f('0x30')]=_[_0xaf1f('0x2f')](_0x342ec0['model'],qs['fields'](_0x47cba8[_0xaf1f('0x2d')][_0xaf1f('0x31')]));_0x319752[_0xaf1f('0x30')]=_0x319752[_0xaf1f('0x30')]['length']?_0x319752[_0xaf1f('0x30')]:_0x342ec0[_0xaf1f('0x2c')];if(_0x47cba8[_0xaf1f('0x2d')]['includeAll']){_0x319752['include']=[{'all':!![]}];}_0x319752=_[_0xaf1f('0x38')]({},_0x319752,_0x47cba8['options']);return db[_0xaf1f('0x28')][_0xaf1f('0x3f')](_0x319752)[_0xaf1f('0x21')](handleEntityNotFound(_0x21d58d,null))[_0xaf1f('0x21')](respondWithResult(_0x21d58d,null))['catch'](handleError(_0x21d58d,null));};exports[_0xaf1f('0x40')]=function(_0x1b9371,_0x38aaf0){return db[_0xaf1f('0x28')][_0xaf1f('0x40')](_0x1b9371[_0xaf1f('0x41')],{})[_0xaf1f('0x21')](respondWithResult(_0x38aaf0,0xc9))['catch'](handleError(_0x38aaf0,null));};exports['update']=function(_0x1d1582,_0x1bde3f){if(_0x1d1582[_0xaf1f('0x41')]['id']){delete _0x1d1582[_0xaf1f('0x41')]['id'];}return db[_0xaf1f('0x28')][_0xaf1f('0x3f')]({'where':{'id':_0x1d1582[_0xaf1f('0x42')]['id']}})['then'](handleEntityNotFound(_0x1bde3f,null))[_0xaf1f('0x21')](saveUpdates(_0x1d1582[_0xaf1f('0x41')],null))[_0xaf1f('0x21')](respondWithResult(_0x1bde3f,null))[_0xaf1f('0x43')](handleError(_0x1bde3f,null));};exports[_0xaf1f('0x44')]=function(_0x41364e,_0x36bd7a){return db[_0xaf1f('0x28')][_0xaf1f('0x3f')]({'where':{'id':_0x41364e[_0xaf1f('0x42')]['id']}})['then'](handleEntityNotFound(_0x36bd7a,null))['then'](removeEntity(_0x36bd7a,null))[_0xaf1f('0x43')](handleError(_0x36bd7a,null));};exports['describe']=function(_0x28c205,_0x3dd4df){return db['JscriptySessionReport'][_0xaf1f('0x45')]()['then'](respondWithResult(_0x3dd4df,null))['catch'](handleError(_0x3dd4df,null));};exports[_0xaf1f('0x46')]=function(_0x46628d,_0x2d188e,_0x32afff){var _0x32066d={'raw':!![],'where':{}};var _0x569043={};var _0x57d01a={'count':0x0,'rows':[]};return db[_0xaf1f('0x28')][_0xaf1f('0x47')]({'where':{'id':_0x46628d['params']['id']}})['then'](handleEntityNotFound(_0x2d188e,null))[_0xaf1f('0x21')](function(_0x1cdfab){if(_0x1cdfab){_0x569043[_0xaf1f('0x2c')]=_['keys'](db['JscriptyQuestionReport'][_0xaf1f('0x29')]);_0x569043[_0xaf1f('0x2d')]=_[_0xaf1f('0x3e')](_0x46628d[_0xaf1f('0x2d')]);_0x569043[_0xaf1f('0x2e')]=_[_0xaf1f('0x2f')](_0x569043['model'],_0x569043[_0xaf1f('0x2d')]);_0x32066d['attributes']=_[_0xaf1f('0x2f')](_0x569043['model'],qs[_0xaf1f('0x31')](_0x46628d['query']['fields']));_0x32066d[_0xaf1f('0x30')]=_0x32066d[_0xaf1f('0x30')][_0xaf1f('0x48')]?_0x32066d[_0xaf1f('0x30')]:_0x569043[_0xaf1f('0x2c')];if(!_0x46628d[_0xaf1f('0x2d')]['hasOwnProperty'](_0xaf1f('0x33'))){_0x32066d['limit']=qs[_0xaf1f('0x1a')](_0x46628d[_0xaf1f('0x2d')][_0xaf1f('0x1a')]);_0x32066d[_0xaf1f('0x1c')]=qs['offset'](_0x46628d[_0xaf1f('0x2d')][_0xaf1f('0x1c')]);}_0x32066d[_0xaf1f('0x34')]=qs[_0xaf1f('0x35')](_0x46628d['query'][_0xaf1f('0x35')]);_0x32066d[_0xaf1f('0x37')]=qs[_0xaf1f('0x2e')](_['pick'](_0x46628d['query'],_0x569043[_0xaf1f('0x2e')]));_0x32066d[_0xaf1f('0x37')]['SessionId']=_0x1cdfab['id'];if(_0x46628d[_0xaf1f('0x2d')][_0xaf1f('0x39')]){_0x32066d[_0xaf1f('0x37')]=_[_0xaf1f('0x38')](_0x32066d[_0xaf1f('0x37')],{'$or':_[_0xaf1f('0x27')](_0x32066d[_0xaf1f('0x30')],function(_0x2d49ea){var _0x59082d={};_0x59082d[_0x2d49ea]={'$like':'%'+_0x46628d[_0xaf1f('0x2d')][_0xaf1f('0x39')]+'%'};return _0x59082d;})});}_0x32066d=_['merge']({},_0x32066d,_0x46628d[_0xaf1f('0x3a')]);return db[_0xaf1f('0x49')]['count']({'where':_0x32066d[_0xaf1f('0x37')]})['then'](function(_0xbcb859){_0x57d01a['count']=_0xbcb859;if(_0x46628d[_0xaf1f('0x2d')]['includeAll']){_0x32066d[_0xaf1f('0x3c')]=[{'all':!![]}];}return db[_0xaf1f('0x49')][_0xaf1f('0x4a')](_0x32066d);})[_0xaf1f('0x21')](function(_0x5a8b5c){_0x57d01a['rows']=_0x5a8b5c;return _0x57d01a;});}})[_0xaf1f('0x21')](respondWithFilteredResult(_0x2d188e,_0x32066d))[_0xaf1f('0x43')](handleError(_0x2d188e,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 9059bfa..6a0433a 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 _0xcb66=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','util'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xcb66,0x19f));var _0x6cb6=function(_0x5c78d9,_0x2736c7){_0x5c78d9=_0x5c78d9-0x0;var _0x69ae1f=_0xcb66[_0x5c78d9];return _0x69ae1f;};'use strict';var _=require('lodash');var util=require(_0x6cb6('0x0'));var logger=require(_0x6cb6('0x1'))(_0x6cb6('0x2'));var moment=require(_0x6cb6('0x3'));var BPromise=require(_0x6cb6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6cb6('0x5'));var rimraf=require(_0x6cb6('0x6'));var config=require(_0x6cb6('0x7'));var attributes=require(_0x6cb6('0x8'));module[_0x6cb6('0x9')]=function(_0x506d14,_0x53078d){return _0x506d14[_0x6cb6('0xa')](_0x6cb6('0xb'),attributes,{'tableName':_0x6cb6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['path','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xafc4,0x69));var _0x4afc=function(_0x25f115,_0x123022){_0x25f115=_0x25f115-0x0;var _0x1eda6b=_0xafc4[_0x25f115];return _0x1eda6b;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 64cd121..0a4fc78 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 _0x1967=['then','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x1967,0x173));var _0x7196=function(_0x560945,_0x5a2a1d){_0x560945=_0x560945-0x0;var _0x2a21c7=_0x1967[_0x560945];return _0x2a21c7;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file +var _0x4c60=['client','http','request','then','debug','request\x20sent','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise'];(function(_0x251f42,_0x45cef2){var _0x406278=function(_0x2e1bbd){while(--_0x2e1bbd){_0x251f42['push'](_0x251f42['shift']());}};_0x406278(++_0x45cef2);}(_0x4c60,0xc1));var _0x04c6=function(_0x1c0b36,_0x45ee6b){_0x1c0b36=_0x1c0b36-0x0;var _0x598115=_0x4c60[_0x1c0b36];return _0x598115;};'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']('JscriptySessionReport,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('JscriptySessionReport,\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 diff --git a/server/api/license/index.js b/server/api/license/index.js index 05898e8..7081a7b 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 _0xc578=['../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','/download_log_file','isAuthenticated','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x126bb6,_0x3ca06d){var _0x9dd2d2=function(_0x545c26){while(--_0x545c26){_0x126bb6['push'](_0x126bb6['shift']());}};_0x9dd2d2(++_0x3ca06d);}(_0xc578,0x89));var _0x8c57=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xc578[_0x1beef3];return _0x5af964;};'use strict';var multer=require(_0x8c57('0x0'));var util=require(_0x8c57('0x1'));var path=require(_0x8c57('0x2'));var timeout=require(_0x8c57('0x3'));var express=require(_0x8c57('0x4'));var router=express[_0x8c57('0x5')]();var fs_extra=require(_0x8c57('0x6'));var auth=require(_0x8c57('0x7'));var interaction=require(_0x8c57('0x8'));var config=require(_0x8c57('0x9'));var controller=require(_0x8c57('0xa'));router[_0x8c57('0xb')]('/',controller[_0x8c57('0xc')]);router['put'](_0x8c57('0xd'),auth['isAuthenticated'](),controller['update']);router['get'](_0x8c57('0xe'),auth[_0x8c57('0xf')](),controller[_0x8c57('0x10')]);module[_0x8c57('0x11')]=router; \ No newline at end of file +var _0x2029=['./license.controller','get','put','isAuthenticated','/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x2029,0x8e));var _0x9202=function(_0x255318,_0x40030b){_0x255318=_0x255318-0x0;var _0x46ed11=_0x2029[_0x255318];return _0x46ed11;};'use strict';var multer=require(_0x9202('0x0'));var util=require(_0x9202('0x1'));var path=require(_0x9202('0x2'));var timeout=require(_0x9202('0x3'));var express=require(_0x9202('0x4'));var router=express[_0x9202('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9202('0x6'));var config=require(_0x9202('0x7'));var controller=require(_0x9202('0x8'));router[_0x9202('0x9')]('/',controller['index']);router[_0x9202('0xa')]('/:id',auth[_0x9202('0xb')](),controller['update']);router[_0x9202('0x9')](_0x9202('0xc'),auth[_0x9202('0xb')](),controller[_0x9202('0xd')]);module[_0x9202('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index d0505e4..1a88170 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 _0x04ab=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x46f623,_0x3aa940){var _0x575d0d=function(_0x2731e7){while(--_0x2731e7){_0x46f623['push'](_0x46f623['shift']());}};_0x575d0d(++_0x3aa940);}(_0x04ab,0xfe));var _0xb04a=function(_0x483e00,_0x4bc2db){_0x483e00=_0x483e00-0x0;var _0x53b424=_0x04ab[_0x483e00];return _0x53b424;};'use strict';var Sequelize=require(_0xb04a('0x0'));module[_0xb04a('0x1')]={'license':{'type':Sequelize[_0xb04a('0x2')]},'data1':{'type':Sequelize[_0xb04a('0x3')]},'data2':{'type':Sequelize[_0xb04a('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xb04a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc741=['sequelize','TEXT','INTEGER'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc741,0x1ef));var _0x1c74=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc741[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require(_0x1c74('0x0'));module['exports']={'license':{'type':Sequelize[_0x1c74('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x1c74('0x2')],'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 6abf697..a1dae91 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 _0x876a=['index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','update','body','find','params','get','key','demo','license-info.log','join','xcally','setHeader','Content-disposition','Content-Type','text/plain','download','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','../../config/license/util'];(function(_0x1da9d5,_0x847c97){var _0x34b30e=function(_0x56a4f4){while(--_0x56a4f4){_0x1da9d5['push'](_0x1da9d5['shift']());}};_0x34b30e(++_0x847c97);}(_0x876a,0xe2));var _0xa876=function(_0x5e20df,_0x353238){_0x5e20df=_0x5e20df-0x0;var _0x5750f0=_0x876a[_0x5e20df];return _0x5750f0;};'use strict';var emlformat=require(_0xa876('0x0'));var rimraf=require(_0xa876('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa876('0x2'));var moment=require(_0xa876('0x3'));var BPromise=require(_0xa876('0x4'));var Mustache=require(_0xa876('0x5'));var util=require(_0xa876('0x6'));var path=require(_0xa876('0x7'));var sox=require('sox');var csv=require(_0xa876('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa876('0x9'));var _=require(_0xa876('0xa'));var squel=require(_0xa876('0xb'));var crypto=require(_0xa876('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa876('0xd'));var toCsv=require(_0xa876('0x8'));var querystring=require(_0xa876('0xe'));var Papa=require('papaparse');var Redis=require(_0xa876('0xf'));var authService=require(_0xa876('0x10'));var qs=require(_0xa876('0x11'));var as=require(_0xa876('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa876('0x13'));var utils=require(_0xa876('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa876('0x15'))['db'];function respondWithStatusCode(_0x4cda82,_0x54be95){_0x54be95=_0x54be95||0xcc;return function(_0x1d954f){if(_0x1d954f){return _0x4cda82[_0xa876('0x16')](_0x54be95);}return _0x4cda82[_0xa876('0x17')](_0x54be95)['end']();};}function respondWithResult(_0x2ee851,_0xe37f3b){_0xe37f3b=_0xe37f3b||0xc8;return function(_0x45a8ef){if(_0x45a8ef){return _0x2ee851[_0xa876('0x17')](_0xe37f3b)['json'](_0x45a8ef);}};}function respondWithFilteredResult(_0x97abcc,_0x4feb6e){return function(_0x460ded){if(_0x460ded){var _0x5285ed=typeof _0x4feb6e[_0xa876('0x18')]===_0xa876('0x19')&&typeof _0x4feb6e[_0xa876('0x1a')]===_0xa876('0x19');var _0x3e945a=_0x460ded[_0xa876('0x1b')];var _0x1aa332=_0x5285ed?0x0:_0x4feb6e[_0xa876('0x18')];var _0x2e7d35=_0x5285ed?_0x460ded['count']:_0x4feb6e[_0xa876('0x18')]+_0x4feb6e['limit'];var _0x3bc1d6;if(_0x2e7d35>=_0x3e945a){_0x2e7d35=_0x3e945a;_0x3bc1d6=0xc8;}else{_0x3bc1d6=0xce;}_0x97abcc[_0xa876('0x17')](_0x3bc1d6);return _0x97abcc[_0xa876('0x1c')](_0xa876('0x1d'),_0x1aa332+'-'+_0x2e7d35+'/'+_0x3e945a)['json'](_0x460ded);}return null;};}function patchUpdates(_0x4ef202){return function(_0x3faf31){try{jsonpatch['apply'](_0x3faf31,_0x4ef202,!![]);}catch(_0x42c42e){return BPromise['reject'](_0x42c42e);}return _0x3faf31[_0xa876('0x1e')]();};}function saveUpdates(_0x21f80a,_0x4c1397){return function(_0x17118a){if(_0x17118a){return _0x17118a['update'](_0x21f80a)[_0xa876('0x1f')](function(_0x1e3b19){return _0x1e3b19;});}return null;};}function removeEntity(_0x2445be,_0x46fc5b){return function(_0x79484){if(_0x79484){return _0x79484[_0xa876('0x20')]()[_0xa876('0x1f')](function(){_0x2445be[_0xa876('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19092f,_0x597a33){return function(_0x5839c4){if(!_0x5839c4){_0x19092f[_0xa876('0x16')](0x194);}return _0x5839c4;};}function handleError(_0x45ca1e,_0x45539a){_0x45539a=_0x45539a||0x1f4;return function(_0x2cfc3e){logger[_0xa876('0x21')](_0x2cfc3e[_0xa876('0x22')]);if(_0x2cfc3e['name']){delete _0x2cfc3e[_0xa876('0x23')];}_0x45ca1e[_0xa876('0x17')](_0x45539a)[_0xa876('0x24')](_0x2cfc3e);};}var utilLicense=require(_0xa876('0x25'));exports[_0xa876('0x26')]=function(_0x41aa8c,_0x5d28a3){var _0x4ee8eb={'raw':!![],'where':{'id':0x1}},_0x8cd85b={};_0x8cd85b[_0xa876('0x27')]=_[_0xa876('0x28')](db[_0xa876('0x29')][_0xa876('0x2a')]);_0x8cd85b[_0xa876('0x2b')]=_[_0xa876('0x28')](_0x41aa8c[_0xa876('0x2b')]);_0x8cd85b[_0xa876('0x2c')]=_[_0xa876('0x2d')](_0x8cd85b[_0xa876('0x27')],_0x8cd85b[_0xa876('0x2b')]);_0x4ee8eb[_0xa876('0x2e')]=_[_0xa876('0x2d')](_0x8cd85b['model'],qs[_0xa876('0x2f')](_0x41aa8c[_0xa876('0x2b')][_0xa876('0x2f')]));_0x4ee8eb[_0xa876('0x2e')]=_0x4ee8eb[_0xa876('0x2e')][_0xa876('0x30')]?_0x4ee8eb[_0xa876('0x2e')]:_0x8cd85b[_0xa876('0x27')];_0x4ee8eb=_['merge']({},_0x4ee8eb,_0x41aa8c[_0xa876('0x31')]);return utilLicense[_0xa876('0x32')](_0x4ee8eb)[_0xa876('0x1f')](respondWithResult(_0x5d28a3,null))['catch'](handleError(_0x5d28a3,null));};exports[_0xa876('0x33')]=function(_0x12949f,_0x4c4434){if(_0x12949f[_0xa876('0x34')]['id']){delete _0x12949f[_0xa876('0x34')]['id'];}return db[_0xa876('0x29')][_0xa876('0x35')]({'where':{'id':_0x12949f[_0xa876('0x36')]['id']}})[_0xa876('0x1f')](handleEntityNotFound(_0x4c4434,null))[_0xa876('0x1f')](function(_0xec86cf){var _0x1244fb=_0xec86cf[_0xa876('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x1244fb,_0x12949f[_0xa876('0x34')][_0xa876('0x38')]);})[_0xa876('0x1f')](function(_0x269059){if(!_0x269059[_0xa876('0x39')]){return saveUpdates(_0x12949f[_0xa876('0x34')],null);}return _0x269059;})[_0xa876('0x1f')](respondWithResult(_0x4c4434,null))['catch'](handleError(_0x4c4434,null));};exports['downloadLogFile']=function(_0x2d4550,_0x44436b){var _0x28710d=_0xa876('0x3a');var _0x26c11f=path[_0xa876('0x3b')]('/var','log',_0xa876('0x3c'),_0x28710d);_0x44436b[_0xa876('0x3d')](_0xa876('0x3e'),'attachment;\x20filename='+_0x28710d);_0x44436b[_0xa876('0x1c')](_0xa876('0x3f'),_0xa876('0x40'));_0x44436b[_0xa876('0x41')](_0x26c11f);}; \ No newline at end of file +var _0xfa7a=['text/plain','download','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','error','name','send','index','model','License','rawAttributes','query','intersection','fields','attributes','length','options','getLicense','body','find','params','get','checkLicense','key','catch','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','set','Content-Type'];(function(_0x143ac0,_0x5242b1){var _0x590ebb=function(_0x2649e9){while(--_0x2649e9){_0x143ac0['push'](_0x143ac0['shift']());}};_0x590ebb(++_0x5242b1);}(_0xfa7a,0x11a));var _0xafa7=function(_0xfed0b8,_0x4cb13f){_0xfed0b8=_0xfed0b8-0x0;var _0x1f2000=_0xfa7a[_0xfed0b8];return _0x1f2000;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xafa7('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xafa7('0x1'));var moment=require('moment');var BPromise=require(_0xafa7('0x2'));var Mustache=require(_0xafa7('0x3'));var util=require(_0xafa7('0x4'));var path=require(_0xafa7('0x5'));var sox=require(_0xafa7('0x6'));var csv=require('to-csv');var ejs=require(_0xafa7('0x7'));var fs=require('fs');var fs_extra=require(_0xafa7('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xafa7('0x9'));var jsforce=require(_0xafa7('0xa'));var deskjs=require(_0xafa7('0xb'));var toCsv=require(_0xafa7('0xc'));var querystring=require(_0xafa7('0xd'));var Papa=require(_0xafa7('0xe'));var Redis=require('ioredis');var authService=require(_0xafa7('0xf'));var qs=require(_0xafa7('0x10'));var as=require(_0xafa7('0x11'));var hardwareService=require(_0xafa7('0x12'));var logger=require(_0xafa7('0x13'))(_0xafa7('0x14'));var utils=require(_0xafa7('0x15'));var config=require(_0xafa7('0x16'));var licenseUtil=require(_0xafa7('0x17'));var db=require(_0xafa7('0x18'))['db'];function respondWithStatusCode(_0x4796f1,_0x3e6e43){_0x3e6e43=_0x3e6e43||0xcc;return function(_0x4c0a42){if(_0x4c0a42){return _0x4796f1[_0xafa7('0x19')](_0x3e6e43);}return _0x4796f1[_0xafa7('0x1a')](_0x3e6e43)[_0xafa7('0x1b')]();};}function respondWithResult(_0xfb4c82,_0x4cc77c){_0x4cc77c=_0x4cc77c||0xc8;return function(_0x496753){if(_0x496753){return _0xfb4c82[_0xafa7('0x1a')](_0x4cc77c)[_0xafa7('0x1c')](_0x496753);}};}function respondWithFilteredResult(_0x1d10fa,_0x2a0da3){return function(_0x3be879){if(_0x3be879){var _0x44c3db=typeof _0x2a0da3[_0xafa7('0x1d')]==='undefined'&&typeof _0x2a0da3['limit']===_0xafa7('0x1e');var _0x126a8e=_0x3be879['count'];var _0x20c82a=_0x44c3db?0x0:_0x2a0da3[_0xafa7('0x1d')];var _0x180250=_0x44c3db?_0x3be879[_0xafa7('0x1f')]:_0x2a0da3[_0xafa7('0x1d')]+_0x2a0da3['limit'];var _0x1b0607;if(_0x180250>=_0x126a8e){_0x180250=_0x126a8e;_0x1b0607=0xc8;}else{_0x1b0607=0xce;}_0x1d10fa['status'](_0x1b0607);return _0x1d10fa['set'](_0xafa7('0x20'),_0x20c82a+'-'+_0x180250+'/'+_0x126a8e)['json'](_0x3be879);}return null;};}function patchUpdates(_0x4dfc49){return function(_0x3ebd69){try{jsonpatch[_0xafa7('0x21')](_0x3ebd69,_0x4dfc49,!![]);}catch(_0x146d59){return BPromise[_0xafa7('0x22')](_0x146d59);}return _0x3ebd69[_0xafa7('0x23')]();};}function saveUpdates(_0x1d7a69,_0x7bdc35){return function(_0x569604){if(_0x569604){return _0x569604[_0xafa7('0x24')](_0x1d7a69)[_0xafa7('0x25')](function(_0x501062){return _0x501062;});}return null;};}function removeEntity(_0x38948f,_0x44f2df){return function(_0x2969bd){if(_0x2969bd){return _0x2969bd['destroy']()[_0xafa7('0x25')](function(){_0x38948f[_0xafa7('0x1a')](0xcc)[_0xafa7('0x1b')]();});}};}function handleEntityNotFound(_0x5e8879,_0x2668e5){return function(_0x28b58b){if(!_0x28b58b){_0x5e8879[_0xafa7('0x19')](0x194);}return _0x28b58b;};}function handleError(_0x200b84,_0x27ad59){_0x27ad59=_0x27ad59||0x1f4;return function(_0x4677bd){logger[_0xafa7('0x26')](_0x4677bd['stack']);if(_0x4677bd[_0xafa7('0x27')]){delete _0x4677bd[_0xafa7('0x27')];}_0x200b84[_0xafa7('0x1a')](_0x27ad59)[_0xafa7('0x28')](_0x4677bd);};}var utilLicense=require(_0xafa7('0x17'));exports[_0xafa7('0x29')]=function(_0x537615,_0x4bb77b){var _0x5bd36d={'raw':!![],'where':{'id':0x1}},_0x33383d={};_0x33383d[_0xafa7('0x2a')]=_['keys'](db[_0xafa7('0x2b')][_0xafa7('0x2c')]);_0x33383d[_0xafa7('0x2d')]=_['keys'](_0x537615[_0xafa7('0x2d')]);_0x33383d['filters']=_[_0xafa7('0x2e')](_0x33383d['model'],_0x33383d[_0xafa7('0x2d')]);_0x5bd36d['attributes']=_[_0xafa7('0x2e')](_0x33383d['model'],qs['fields'](_0x537615[_0xafa7('0x2d')][_0xafa7('0x2f')]));_0x5bd36d[_0xafa7('0x30')]=_0x5bd36d[_0xafa7('0x30')][_0xafa7('0x31')]?_0x5bd36d[_0xafa7('0x30')]:_0x33383d['model'];_0x5bd36d=_['merge']({},_0x5bd36d,_0x537615[_0xafa7('0x32')]);return utilLicense[_0xafa7('0x33')](_0x5bd36d)['then'](respondWithResult(_0x4bb77b,null))['catch'](handleError(_0x4bb77b,null));};exports[_0xafa7('0x24')]=function(_0x4c8c80,_0x5be2f5){if(_0x4c8c80[_0xafa7('0x34')]['id']){delete _0x4c8c80['body']['id'];}return db['License'][_0xafa7('0x35')]({'where':{'id':_0x4c8c80[_0xafa7('0x36')]['id']}})[_0xafa7('0x25')](handleEntityNotFound(_0x5be2f5,null))[_0xafa7('0x25')](function(_0x58bb52){var _0x2c65d0=_0x58bb52[_0xafa7('0x37')]({'plain':!![]});return utilLicense[_0xafa7('0x38')](_0x2c65d0,_0x4c8c80[_0xafa7('0x34')][_0xafa7('0x39')]);})[_0xafa7('0x25')](function(_0x6bad62){if(!_0x6bad62['demo']){return saveUpdates(_0x4c8c80['body'],null);}return _0x6bad62;})[_0xafa7('0x25')](respondWithResult(_0x5be2f5,null))[_0xafa7('0x3a')](handleError(_0x5be2f5,null));};exports['downloadLogFile']=function(_0x1994ab,_0xa75d26){var _0x47d786='license-info.log';var _0x4c3358=path[_0xafa7('0x3b')](_0xafa7('0x3c'),_0xafa7('0x3d'),_0xafa7('0x3e'),_0x47d786);_0xa75d26[_0xafa7('0x3f')](_0xafa7('0x40'),_0xafa7('0x41')+_0x47d786);_0xa75d26[_0xafa7('0x42')](_0xafa7('0x43'),_0xafa7('0x44'));_0xa75d26[_0xafa7('0x45')](_0x4c3358);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 2739f7c..8246db5 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 _0xc64f=['request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','lodash','util','../../config/logger','api','moment'];(function(_0x283bc4,_0x46d959){var _0x3ef1c9=function(_0x199ed0){while(--_0x199ed0){_0x283bc4['push'](_0x283bc4['shift']());}};_0x3ef1c9(++_0x46d959);}(_0xc64f,0x1a8));var _0xfc64=function(_0x568aa5,_0x3c0edd){_0x568aa5=_0x568aa5-0x0;var _0xa935db=_0xc64f[_0x568aa5];return _0xa935db;};'use strict';var _=require(_0xfc64('0x0'));var util=require(_0xfc64('0x1'));var logger=require(_0xfc64('0x2'))(_0xfc64('0x3'));var moment=require(_0xfc64('0x4'));var BPromise=require('bluebird');var rp=require(_0xfc64('0x5'));var fs=require('fs');var path=require(_0xfc64('0x6'));var rimraf=require(_0xfc64('0x7'));var config=require(_0xfc64('0x8'));var attributes=require(_0xfc64('0x9'));module[_0xfc64('0xa')]=function(_0xc47a3d,_0x3e15a3){return _0xc47a3d[_0xfc64('0xb')](_0xfc64('0xc'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x900c=['define','license','lodash','../../config/logger','api','moment','bluebird','../../config/environment','exports'];(function(_0x3873ab,_0x152776){var _0x42f6ed=function(_0x189425){while(--_0x189425){_0x3873ab['push'](_0x3873ab['shift']());}};_0x42f6ed(++_0x152776);}(_0x900c,0x134));var _0xc900=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x900c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc900('0x0'));var util=require('util');var logger=require(_0xc900('0x1'))(_0xc900('0x2'));var moment=require(_0xc900('0x3'));var BPromise=require(_0xc900('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc900('0x5'));var attributes=require('./license.attributes');module[_0xc900('0x6')]=function(_0x430f53,_0x1838fe){return _0x430f53[_0xc900('0x7')]('License',attributes,{'tableName':_0xc900('0x8'),'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 6c6d0d8..8fbf962 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 _0xe8a3=['debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x4a2036,_0x2e8401){var _0x46aa57=function(_0x4fbcf7){while(--_0x4fbcf7){_0x4a2036['push'](_0x4a2036['shift']());}};_0x46aa57(++_0x2e8401);}(_0xe8a3,0x93));var _0x3e8a=function(_0x15c056,_0x5bf32d){_0x15c056=_0x15c056-0x0;var _0x3838c3=_0xe8a3[_0x15c056];return _0x3838c3;};'use strict';var _=require('lodash');var util=require(_0x3e8a('0x0'));var moment=require('moment');var BPromise=require(_0x3e8a('0x1'));var rs=require(_0x3e8a('0x2'));var fs=require('fs');var Redis=require(_0x3e8a('0x3'));var db=require(_0x3e8a('0x4'))['db'];var utils=require(_0x3e8a('0x5'));var logger=require(_0x3e8a('0x6'))('rpc');var config=require(_0x3e8a('0x7'));var jayson=require(_0x3e8a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ff282,_0x4f98de,_0x5b07e1){return new BPromise(function(_0x35d93e,_0x568888){return client['request'](_0x4ff282,_0x5b07e1)[_0x3e8a('0x9')](function(_0x323ed0){logger[_0x3e8a('0xa')](_0x3e8a('0xb'),_0x4f98de,_0x3e8a('0xc'));logger[_0x3e8a('0xd')]('License,\x20%s,\x20%s,\x20%s',_0x4f98de,'request\x20sent',JSON[_0x3e8a('0xe')](_0x323ed0));if(_0x323ed0[_0x3e8a('0xf')]){if(_0x323ed0[_0x3e8a('0xf')][_0x3e8a('0x10')]===0x1f4){logger['error'](_0x3e8a('0xb'),_0x4f98de,_0x323ed0['error'][_0x3e8a('0x11')]);return _0x568888(_0x323ed0[_0x3e8a('0xf')][_0x3e8a('0x11')]);}logger[_0x3e8a('0xf')](_0x3e8a('0xb'),_0x4f98de,_0x323ed0[_0x3e8a('0xf')][_0x3e8a('0x11')]);return _0x35d93e(_0x323ed0[_0x3e8a('0xf')][_0x3e8a('0x11')]);}else{logger[_0x3e8a('0xa')]('License,\x20%s,\x20%s',_0x4f98de,_0x3e8a('0xc'));_0x35d93e(_0x323ed0[_0x3e8a('0x12')][_0x3e8a('0x11')]);}})[_0x3e8a('0x13')](function(_0xc29180){logger[_0x3e8a('0xf')](_0x3e8a('0xb'),_0x4f98de,_0xc29180);_0x568888(_0xc29180);});});} \ No newline at end of file +var _0x424d=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x97ac1,_0x3478fe){var _0x12673e=function(_0x1d9c97){while(--_0x1d9c97){_0x97ac1['push'](_0x97ac1['shift']());}};_0x12673e(++_0x3478fe);}(_0x424d,0x9b));var _0xd424=function(_0x523615,_0x522ee8){_0x523615=_0x523615-0x0;var _0x9863eb=_0x424d[_0x523615];return _0x9863eb;};'use strict';var _=require(_0xd424('0x0'));var util=require(_0xd424('0x1'));var moment=require(_0xd424('0x2'));var BPromise=require(_0xd424('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd424('0x4'));var db=require(_0xd424('0x5'))['db'];var utils=require(_0xd424('0x6'));var logger=require(_0xd424('0x7'))(_0xd424('0x8'));var config=require('../../config/environment');var jayson=require(_0xd424('0x9'));var client=jayson[_0xd424('0xa')][_0xd424('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc55073,_0x2abcab,_0x3f5323){return new BPromise(function(_0x347c31,_0x29fb2c){return client[_0xd424('0xc')](_0xc55073,_0x3f5323)[_0xd424('0xd')](function(_0x21a7b2){logger['info']('License,\x20%s,\x20%s',_0x2abcab,_0xd424('0xe'));logger['debug'](_0xd424('0xf'),_0x2abcab,_0xd424('0xe'),JSON[_0xd424('0x10')](_0x21a7b2));if(_0x21a7b2[_0xd424('0x11')]){if(_0x21a7b2[_0xd424('0x11')][_0xd424('0x12')]===0x1f4){logger[_0xd424('0x11')](_0xd424('0x13'),_0x2abcab,_0x21a7b2[_0xd424('0x11')][_0xd424('0x14')]);return _0x29fb2c(_0x21a7b2[_0xd424('0x11')][_0xd424('0x14')]);}logger[_0xd424('0x11')](_0xd424('0x13'),_0x2abcab,_0x21a7b2[_0xd424('0x11')][_0xd424('0x14')]);return _0x347c31(_0x21a7b2[_0xd424('0x11')][_0xd424('0x14')]);}else{logger[_0xd424('0x15')](_0xd424('0x13'),_0x2abcab,'request\x20sent');_0x347c31(_0x21a7b2[_0xd424('0x16')][_0xd424('0x14')]);}})['catch'](function(_0x2be3d2){logger[_0xd424('0x11')](_0xd424('0x13'),_0x2abcab,_0x2be3d2);_0x29fb2c(_0x2be3d2);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 994a2f7..c2b83dc 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 _0x4900=['/:id/applications','/:id/messages','/:id/users','getAgents','/:id/dispositions','addDisposition','post','addAnswer','create','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','delete','removeDispositions','removeImap','removeSmtp','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions'];(function(_0x88f701,_0x5ed538){var _0x53bf89=function(_0x31756e){while(--_0x31756e){_0x88f701['push'](_0x88f701['shift']());}};_0x53bf89(++_0x5ed538);}(_0x4900,0x16e));var _0x0490=function(_0x3e90a2,_0x1bd9f9){_0x3e90a2=_0x3e90a2-0x0;var _0x4fe655=_0x4900[_0x3e90a2];return _0x4fe655;};'use strict';var multer=require(_0x0490('0x0'));var util=require(_0x0490('0x1'));var path=require(_0x0490('0x2'));var timeout=require('connect-timeout');var express=require(_0x0490('0x3'));var router=express[_0x0490('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0490('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0490('0x6'));var controller=require(_0x0490('0x7'));router[_0x0490('0x8')]('/',auth[_0x0490('0x9')](),controller['index']);router[_0x0490('0x8')](_0x0490('0xa'),auth['isAuthenticated'](),controller[_0x0490('0xb')]);router[_0x0490('0x8')](_0x0490('0xc'),auth[_0x0490('0x9')](),controller[_0x0490('0xd')]);router['get']('/:id/dispositions',auth[_0x0490('0x9')](),controller[_0x0490('0xe')]);router[_0x0490('0x8')](_0x0490('0xf'),auth[_0x0490('0x9')](),controller['getAnswers']);router[_0x0490('0x8')](_0x0490('0x10'),auth[_0x0490('0x9')](),controller[_0x0490('0x11')]);router[_0x0490('0x8')]('/:id/out_servers',auth[_0x0490('0x9')](),controller[_0x0490('0x12')]);router[_0x0490('0x8')](_0x0490('0x13'),auth[_0x0490('0x9')](),controller[_0x0490('0x14')]);router[_0x0490('0x8')](_0x0490('0x15'),auth[_0x0490('0x9')](),controller['getApplications']);router[_0x0490('0x8')](_0x0490('0x16'),auth[_0x0490('0x9')](),controller['getMessages']);router[_0x0490('0x8')]('/:id/verify',auth[_0x0490('0x9')](),controller['verifySmtp']);router['get'](_0x0490('0x17'),auth[_0x0490('0x9')](),controller[_0x0490('0x18')]);router['post'](_0x0490('0x19'),auth[_0x0490('0x9')](),controller[_0x0490('0x1a')]);router[_0x0490('0x1b')](_0x0490('0xf'),auth[_0x0490('0x9')](),controller[_0x0490('0x1c')]);router[_0x0490('0x1b')]('/',auth['isAuthenticated'](),controller[_0x0490('0x1d')]);router[_0x0490('0x1b')]('/:id/in_servers',auth[_0x0490('0x9')](),controller['addImap']);router[_0x0490('0x1b')](_0x0490('0x1e'),auth['isAuthenticated'](),controller[_0x0490('0x1f')]);router[_0x0490('0x1b')](_0x0490('0x13'),auth[_0x0490('0x9')](),controller[_0x0490('0x20')]);router[_0x0490('0x1b')]('/:id/applications',auth['isAuthenticated'](),controller[_0x0490('0x21')]);router['post'](_0x0490('0x22'),auth['isAuthenticated'](),controller[_0x0490('0x23')]);router[_0x0490('0x1b')](_0x0490('0x17'),auth[_0x0490('0x9')](),controller[_0x0490('0x24')]);router['put'](_0x0490('0xc'),auth[_0x0490('0x9')](),controller['update']);router[_0x0490('0x25')](_0x0490('0x19'),auth['isAuthenticated'](),controller[_0x0490('0x26')]);router[_0x0490('0x25')]('/:id/canned_answers',auth[_0x0490('0x9')](),controller['removeAnswers']);router[_0x0490('0x25')](_0x0490('0x10'),auth[_0x0490('0x9')](),controller[_0x0490('0x27')]);router[_0x0490('0x25')](_0x0490('0x1e'),auth[_0x0490('0x9')](),controller[_0x0490('0x28')]);router['delete']('/:id',auth[_0x0490('0x9')](),controller[_0x0490('0x29')]);router[_0x0490('0x25')](_0x0490('0x17'),auth[_0x0490('0x9')](),controller['removeAgents']);module[_0x0490('0x2a')]=router; \ No newline at end of file +var _0xe450=['/:id/dispositions','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','delete','removeDispositions','removeImap','removeSmtp','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./mailAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','getDispositions','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post'];(function(_0x47c071,_0x6c4ab7){var _0x1de017=function(_0x580473){while(--_0x580473){_0x47c071['push'](_0x47c071['shift']());}};_0x1de017(++_0x6c4ab7);}(_0xe450,0x168));var _0x0e45=function(_0x44dd32,_0x205f75){_0x44dd32=_0x44dd32-0x0;var _0x463d74=_0xe450[_0x44dd32];return _0x463d74;};'use strict';var multer=require(_0x0e45('0x0'));var util=require('util');var path=require(_0x0e45('0x1'));var timeout=require(_0x0e45('0x2'));var express=require(_0x0e45('0x3'));var router=express[_0x0e45('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0e45('0x5'));var config=require('../../config/environment');var controller=require(_0x0e45('0x6'));router[_0x0e45('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0e45('0x7')](_0x0e45('0x8'),auth[_0x0e45('0x9')](),controller[_0x0e45('0xa')]);router['get'](_0x0e45('0xb'),auth[_0x0e45('0x9')](),controller[_0x0e45('0xc')]);router[_0x0e45('0x7')]('/:id/dispositions',auth[_0x0e45('0x9')](),controller[_0x0e45('0xd')]);router[_0x0e45('0x7')]('/:id/canned_answers',auth[_0x0e45('0x9')](),controller['getAnswers']);router[_0x0e45('0x7')](_0x0e45('0xe'),auth[_0x0e45('0x9')](),controller[_0x0e45('0xf')]);router[_0x0e45('0x7')](_0x0e45('0x10'),auth['isAuthenticated'](),controller[_0x0e45('0x11')]);router[_0x0e45('0x7')](_0x0e45('0x12'),auth[_0x0e45('0x9')](),controller['getInteractions']);router[_0x0e45('0x7')](_0x0e45('0x13'),auth['isAuthenticated'](),controller['getApplications']);router['get'](_0x0e45('0x14'),auth[_0x0e45('0x9')](),controller[_0x0e45('0x15')]);router['get'](_0x0e45('0x16'),auth['isAuthenticated'](),controller[_0x0e45('0x17')]);router[_0x0e45('0x7')](_0x0e45('0x18'),auth[_0x0e45('0x9')](),controller[_0x0e45('0x19')]);router[_0x0e45('0x1a')](_0x0e45('0x1b'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x0e45('0x1a')]('/:id/canned_answers',auth[_0x0e45('0x9')](),controller[_0x0e45('0x1c')]);router[_0x0e45('0x1a')]('/',auth[_0x0e45('0x9')](),controller[_0x0e45('0x1d')]);router[_0x0e45('0x1a')](_0x0e45('0xe'),auth[_0x0e45('0x9')](),controller[_0x0e45('0x1e')]);router[_0x0e45('0x1a')]('/:id/out_servers',auth[_0x0e45('0x9')](),controller[_0x0e45('0x1f')]);router[_0x0e45('0x1a')](_0x0e45('0x12'),auth[_0x0e45('0x9')](),controller[_0x0e45('0x20')]);router['post'](_0x0e45('0x13'),auth[_0x0e45('0x9')](),controller[_0x0e45('0x21')]);router[_0x0e45('0x1a')](_0x0e45('0x22'),auth['isAuthenticated'](),controller[_0x0e45('0x23')]);router[_0x0e45('0x1a')](_0x0e45('0x18'),auth[_0x0e45('0x9')](),controller[_0x0e45('0x24')]);router['put'](_0x0e45('0xb'),auth[_0x0e45('0x9')](),controller['update']);router[_0x0e45('0x25')](_0x0e45('0x1b'),auth['isAuthenticated'](),controller[_0x0e45('0x26')]);router[_0x0e45('0x25')]('/:id/canned_answers',auth[_0x0e45('0x9')](),controller['removeAnswers']);router[_0x0e45('0x25')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x0e45('0x27')]);router[_0x0e45('0x25')](_0x0e45('0x10'),auth[_0x0e45('0x9')](),controller[_0x0e45('0x28')]);router['delete'](_0x0e45('0xb'),auth[_0x0e45('0x9')](),controller['destroy']);router['delete'](_0x0e45('0x18'),auth['isAuthenticated'](),controller[_0x0e45('0x29')]);module[_0x0e45('0x2a')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 06f8727..3c6dd9c 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 _0xb5a9=['TEXT','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','provider','custom','getDataValue','sequelize','exports','STRING','BOOLEAN'];(function(_0x17c7f7,_0x402af8){var _0xf196dc=function(_0x381d3f){while(--_0x381d3f){_0x17c7f7['push'](_0x17c7f7['shift']());}};_0xf196dc(++_0x402af8);}(_0xb5a9,0x19e));var _0x9b5a=function(_0x3c645f,_0x512146){_0x3c645f=_0x3c645f-0x0;var _0x2e2d24=_0xb5a9[_0x3c645f];return _0x2e2d24;};'use strict';var Sequelize=require(_0x9b5a('0x0'));module[_0x9b5a('0x1')]={'description':{'type':Sequelize[_0x9b5a('0x2')]},'name':{'type':Sequelize[_0x9b5a('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9b5a('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x9b5a('0x4')]},'markAsUnread':{'type':Sequelize[_0x9b5a('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9b5a('0x2')],'allowNull':![],'defaultValue':_0x9b5a('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x9b5a('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x9b5a('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9b5a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9b5a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9b5a('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x9b5a('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1b1c7f){if(!_0x1b1c7f)this[_0x9b5a('0x9')](_0x9b5a('0xa'),null);this[_0x9b5a('0x9')](_0x9b5a('0xb'),_0x1b1c7f);}},'provider':{'type':Sequelize[_0x9b5a('0xc')](_0x9b5a('0xd'),_0x9b5a('0xe'),_0x9b5a('0xf'),'outlook365'),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x9b5a('0x10')))return _0x9b5a('0x11');return this[_0x9b5a('0x12')](_0x9b5a('0x10'));},'set':function(_0x4904d4){if(_0x4904d4===_0x9b5a('0x11'))_0x4904d4=null;return this[_0x9b5a('0x9')]('provider',_0x4904d4);}}}; \ No newline at end of file +var _0xc587=['INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','hotmail','yahoo','getDataValue','provider','custom','sequelize','STRING','TEXT','BOOLEAN'];(function(_0x1b50a6,_0x30a5fc){var _0x394b1f=function(_0x29112f){while(--_0x29112f){_0x1b50a6['push'](_0x1b50a6['shift']());}};_0x394b1f(++_0x30a5fc);}(_0xc587,0x1b6));var _0x7c58=function(_0xcecf36,_0x4e8811){_0xcecf36=_0xcecf36-0x0;var _0xe80f2e=_0xc587[_0xcecf36];return _0xe80f2e;};'use strict';var Sequelize=require(_0x7c58('0x0'));module['exports']={'description':{'type':Sequelize[_0x7c58('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x7c58('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x7c58('0x2')]},'markAsUnread':{'type':Sequelize[_0x7c58('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7c58('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x7c58('0x4')](0x2)[_0x7c58('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x7c58('0x2')],'defaultValue':function(){return _0x7c58('0x6');}},'notificationSound':{'type':Sequelize[_0x7c58('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7c58('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7c58('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x7c58('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7c58('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7c58('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7c58('0x4')],'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[_0x7c58('0x3')],'defaultValue':![],'comment':_0x7c58('0x7'),'set':function(_0x292f47){if(!_0x292f47)this[_0x7c58('0x8')](_0x7c58('0x9'),null);this['setDataValue'](_0x7c58('0xa'),_0x292f47);}},'provider':{'type':Sequelize['ENUM'](_0x7c58('0xb'),_0x7c58('0xc'),_0x7c58('0xd'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x7c58('0xe')](_0x7c58('0xf')))return _0x7c58('0x10');return this[_0x7c58('0xe')]('provider');},'set':function(_0x152d76){if(_0x152d76===_0x7c58('0x10'))_0x152d76=null;return this[_0x7c58('0x8')]('provider',_0x152d76);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 0cef81e..aa04cc5 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 _0xea95=['hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','MailAccount','includeAll','include','show','params','MailServerOut','find','body','provider','custom','describe','addDisposition','MailAccountId','create','getDispositions','Disposition','rows','removeDispositions','ids','CannedAnswer','findAll','removeAnswers','email','ListId','isNil','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','send','getApplications','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','split','List','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','%s\x20<%s>','attachments','join','root','getSmtpOptions','SendMail','sendMail','Contacts','CmContact','defaults','messageId','from','attach','out','Interaction','MailMessage','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','emit','userMailAccount:save','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./mailAccount.socket','jayson/promise','client','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','update','then','destroy','get','MailAccounts','stack','name','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','username','authentication','Imap','Smtp','index','MailServerIn','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x306334,_0x482970){var _0x49e21a=function(_0x3d6ca6){while(--_0x3d6ca6){_0x306334['push'](_0x306334['shift']());}};_0x49e21a(++_0x482970);}(_0xea95,0x129));var _0x5ea9=function(_0x1e1f31,_0x42b9a9){_0x1e1f31=_0x1e1f31-0x0;var _0x1ea43c=_0xea95[_0x1e1f31];return _0x1ea43c;};'use strict';var moment=require(_0x5ea9('0x0'));var BPromise=require(_0x5ea9('0x1'));var util=require(_0x5ea9('0x2'));var path=require(_0x5ea9('0x3'));var _=require(_0x5ea9('0x4'));var juice=require(_0x5ea9('0x5'));var Redis=require(_0x5ea9('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x5ea9('0x7'))(_0x5ea9('0x8'));var config=require(_0x5ea9('0x9'));var db=require(_0x5ea9('0xa'))['db'];config[_0x5ea9('0xb')]=_['defaults'](config[_0x5ea9('0xb')],{'host':_0x5ea9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ea9('0xb')]));require(_0x5ea9('0xd'))['register'](socket);var jayson=require(_0x5ea9('0xe'));var client=jayson[_0x5ea9('0xf')]['http']({'port':0x232b});function respondWithRpcPromise(_0x542590,_0x56220,_0x441646,_0x221f4e){return new BPromise(function(_0x55584e,_0x53f913){var _0x193c07=_0x221f4e||client;return _0x193c07[_0x5ea9('0x10')](_0x542590,_0x441646)['then'](function(_0x1e1d1d){logger[_0x5ea9('0x11')](_0x5ea9('0x12'),_0x56220,_0x5ea9('0x13'));logger[_0x5ea9('0x14')](_0x5ea9('0x15'),_0x56220,_0x5ea9('0x13'),JSON[_0x5ea9('0x16')](_0x1e1d1d));if(_0x1e1d1d[_0x5ea9('0x17')]){if(_0x1e1d1d[_0x5ea9('0x17')][_0x5ea9('0x18')]===0x1f4){logger[_0x5ea9('0x17')](_0x5ea9('0x12'),_0x56220,_0x1e1d1d[_0x5ea9('0x17')]['message']);return _0x53f913(_0x1e1d1d[_0x5ea9('0x17')]['message']);}logger['error'](_0x5ea9('0x12'),_0x56220,_0x1e1d1d[_0x5ea9('0x17')]['message']);return _0x55584e(_0x1e1d1d[_0x5ea9('0x17')][_0x5ea9('0x19')]);}else{logger[_0x5ea9('0x11')](_0x5ea9('0x12'),_0x56220,_0x5ea9('0x13'));_0x55584e(_0x1e1d1d[_0x5ea9('0x1a')][_0x5ea9('0x19')]);}})[_0x5ea9('0x1b')](function(_0x51f7e8){logger[_0x5ea9('0x17')](_0x5ea9('0x12'),_0x56220,_0x51f7e8);_0x53f913(_0x51f7e8);});});}function respondWithStatusCode(_0x3b1fb8,_0x1959cf){_0x1959cf=_0x1959cf||0xcc;return function(_0x50ae5d){if(_0x50ae5d){return _0x3b1fb8[_0x5ea9('0x1c')](_0x1959cf);}return _0x3b1fb8[_0x5ea9('0x1d')](_0x1959cf)[_0x5ea9('0x1e')]();};}function respondWithResult(_0x3ae87a,_0x2e8076){_0x2e8076=_0x2e8076||0xc8;return function(_0x45a493){if(_0x45a493){return _0x3ae87a[_0x5ea9('0x1d')](_0x2e8076)[_0x5ea9('0x1f')](_0x45a493);}};}function respondWithFilteredResult(_0x51c330,_0x164db7){return function(_0x2eeaae){if(_0x2eeaae){var _0x4c4d48=typeof _0x164db7[_0x5ea9('0x20')]===_0x5ea9('0x21')&&typeof _0x164db7['limit']===_0x5ea9('0x21');var _0x1941e4=_0x2eeaae['count'];var _0x8c5a38=_0x4c4d48?0x0:_0x164db7[_0x5ea9('0x20')];var _0x235b19=_0x4c4d48?_0x2eeaae[_0x5ea9('0x22')]:_0x164db7[_0x5ea9('0x20')]+_0x164db7[_0x5ea9('0x23')];var _0x5805a5;if(_0x235b19>=_0x1941e4){_0x235b19=_0x1941e4;_0x5805a5=0xc8;}else{_0x5805a5=0xce;}_0x51c330[_0x5ea9('0x1d')](_0x5805a5);return _0x51c330[_0x5ea9('0x24')]('Content-Range',_0x8c5a38+'-'+_0x235b19+'/'+_0x1941e4)[_0x5ea9('0x1f')](_0x2eeaae);}return null;};}function saveUpdates(_0x136200){return function(_0x383c57){if(_0x383c57){return _0x383c57[_0x5ea9('0x25')](_0x136200)[_0x5ea9('0x26')](function(_0x45234f){return _0x45234f;});}return null;};}function removeEntity(_0x373977){return function(_0x52b560){if(_0x52b560){return _0x52b560[_0x5ea9('0x27')]()[_0x5ea9('0x26')](function(){var _0x5755f1=_0x52b560[_0x5ea9('0x28')]({'plain':!![]});var _0x18657e=_0x5ea9('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x18657e,'resourceId':_0x5755f1['id']}})[_0x5ea9('0x26')](function(){return _0x52b560;});})[_0x5ea9('0x26')](function(){_0x373977[_0x5ea9('0x1d')](0xcc)[_0x5ea9('0x1e')]();});}};}function handleEntityNotFound(_0x3dd156){return function(_0x2cb287){if(!_0x2cb287){_0x3dd156[_0x5ea9('0x1c')](0x194);}return _0x2cb287;};}function handleError(_0x442bd9,_0x25fd94){_0x25fd94=_0x25fd94||0x1f4;return function(_0x5dfc01){logger[_0x5ea9('0x17')](_0x5dfc01[_0x5ea9('0x2a')]);if(_0x5dfc01[_0x5ea9('0x2b')]){delete _0x5dfc01[_0x5ea9('0x2b')];}_0x442bd9[_0x5ea9('0x1d')](_0x25fd94)['send'](_0x5dfc01);};}function getImapHost(_0x414840){switch(_0x414840){case _0x5ea9('0x2c'):return _0x5ea9('0x2d');case _0x5ea9('0x2e'):return _0x5ea9('0x2f');case _0x5ea9('0x30'):return _0x5ea9('0x31');case _0x5ea9('0x32'):return'outlook.office365.com';}throw new Error(_0x5ea9('0x33'),_0x414840);}function getSmtpHost(_0x1d429f){switch(_0x1d429f){case _0x5ea9('0x2c'):return _0x5ea9('0x34');case _0x5ea9('0x2e'):return _0x5ea9('0x35');case _0x5ea9('0x30'):return _0x5ea9('0x36');case'outlook365':return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x1d429f);}function getAuthenticationOptions(_0x31ddf1,_0x493e16){var _0x2c5719={};var _0x328db6={};if(_0x31ddf1){_0x2c5719[_0x5ea9('0x37')]=_0x328db6[_0x5ea9('0x37')]=_0x493e16['username'];_0x2c5719[_0x5ea9('0x38')]=_0x328db6[_0x5ea9('0x39')]=_0x493e16['password'];if(_0x493e16[_0x5ea9('0x3a')]){_0x2c5719[_0x5ea9('0x3a')]=_0x328db6[_0x5ea9('0x3a')]=!![];_0x2c5719[_0x5ea9('0x3b')]=_0x328db6[_0x5ea9('0x3b')]=_0x493e16[_0x5ea9('0x3b')];_0x2c5719[_0x5ea9('0x38')]=_0x328db6[_0x5ea9('0x39')]=null;}else{_0x2c5719[_0x5ea9('0x3b')]=_0x328db6[_0x5ea9('0x3b')]=null;}_0x2c5719[_0x5ea9('0x3c')]=getImapHost(_0x31ddf1);_0x2c5719['port']=0x3e1;_0x328db6[_0x5ea9('0x3c')]=getSmtpHost(_0x31ddf1);_0x328db6[_0x5ea9('0x3d')]=0x24b;_0x328db6[_0x5ea9('0x3e')]=![];_0x2c5719['service']=_0x328db6[_0x5ea9('0x3f')]=null;}else{if(_0x493e16['authentication']){_0x2c5719[_0x5ea9('0x37')]=_0x328db6['user']=_0x493e16[_0x5ea9('0x40')];_0x2c5719[_0x5ea9('0x38')]=_0x328db6['pass']=_0x493e16[_0x5ea9('0x38')];}else{_0x2c5719[_0x5ea9('0x41')]=_0x328db6[_0x5ea9('0x41')]=![];_0x2c5719[_0x5ea9('0x37')]=_0x328db6[_0x5ea9('0x37')]=null;_0x2c5719[_0x5ea9('0x38')]=_0x328db6[_0x5ea9('0x39')]=null;}_0x2c5719[_0x5ea9('0x3c')]=_0x493e16[_0x5ea9('0x42')]['host'];_0x2c5719['port']=_0x493e16[_0x5ea9('0x42')][_0x5ea9('0x3d')];_0x328db6[_0x5ea9('0x3c')]=_0x493e16['Smtp'][_0x5ea9('0x3c')];_0x328db6['port']=_0x493e16[_0x5ea9('0x43')][_0x5ea9('0x3d')];}return{'Imap':_0x2c5719,'Smtp':_0x328db6};}exports[_0x5ea9('0x44')]=function(_0x415c99,_0x5290e2){var _0x55adce={'include':[{'model':db[_0x5ea9('0x45')],'as':_0x5ea9('0x42')},{'model':db['MailServerOut'],'as':_0x5ea9('0x43')},{'model':db[_0x5ea9('0x46')],'as':_0x5ea9('0x47')}]},_0x1a74b2={},_0x59771a={'count':0x0,'rows':[]};var _0x2ab669=_[_0x5ea9('0x48')](db['MailAccount'][_0x5ea9('0x49')],function(_0x4a1c59){return{'name':_0x4a1c59[_0x5ea9('0x4a')],'type':_0x4a1c59[_0x5ea9('0x4b')][_0x5ea9('0x4c')]};});_0x1a74b2[_0x5ea9('0x4d')]=_[_0x5ea9('0x48')](_0x2ab669,'name');_0x1a74b2['query']=_[_0x5ea9('0x4e')](_0x415c99[_0x5ea9('0x4f')]);_0x1a74b2[_0x5ea9('0x50')]=_[_0x5ea9('0x51')](_0x1a74b2['model'],_0x1a74b2[_0x5ea9('0x4f')]);_0x55adce[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x1a74b2['model'],qs[_0x5ea9('0x53')](_0x415c99[_0x5ea9('0x4f')][_0x5ea9('0x53')]));_0x55adce[_0x5ea9('0x52')]=_0x55adce[_0x5ea9('0x52')][_0x5ea9('0x54')]?_0x55adce[_0x5ea9('0x52')]:_0x1a74b2[_0x5ea9('0x4d')];if(!_0x415c99[_0x5ea9('0x4f')][_0x5ea9('0x55')](_0x5ea9('0x56'))){_0x55adce[_0x5ea9('0x23')]=qs[_0x5ea9('0x23')](_0x415c99[_0x5ea9('0x4f')][_0x5ea9('0x23')]);_0x55adce[_0x5ea9('0x20')]=qs[_0x5ea9('0x20')](_0x415c99['query'][_0x5ea9('0x20')]);}_0x55adce[_0x5ea9('0x57')]=qs[_0x5ea9('0x58')](_0x415c99[_0x5ea9('0x4f')][_0x5ea9('0x58')]);_0x55adce['where']=qs['filters'](_[_0x5ea9('0x59')](_0x415c99[_0x5ea9('0x4f')],_0x1a74b2[_0x5ea9('0x50')]),_0x2ab669);if(_0x415c99[_0x5ea9('0x4f')]['filter']){_0x55adce[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x55adce[_0x5ea9('0x5a')],{'$or':_[_0x5ea9('0x48')](_0x2ab669,function(_0x14463c){if(_0x14463c[_0x5ea9('0x4b')]!=='VIRTUAL'){var _0x125a96={};_0x125a96[_0x14463c[_0x5ea9('0x2b')]]={'$like':'%'+_0x415c99[_0x5ea9('0x4f')][_0x5ea9('0x5c')]+'%'};return _0x125a96;}})});}_0x55adce=_[_0x5ea9('0x5b')]({},_0x55adce,_0x415c99[_0x5ea9('0x5d')]);var _0x5111ef={'where':_0x55adce[_0x5ea9('0x5a')]};return db[_0x5ea9('0x5e')][_0x5ea9('0x22')](_0x5111ef)[_0x5ea9('0x26')](function(_0x53aa9b){_0x59771a[_0x5ea9('0x22')]=_0x53aa9b;if(_0x415c99[_0x5ea9('0x4f')][_0x5ea9('0x5f')]){_0x55adce[_0x5ea9('0x60')]=[{'all':!![]}];}return db[_0x5ea9('0x5e')]['findAll'](_0x55adce);})['then'](function(_0x4efdd9){_0x59771a['rows']=_0x4efdd9;return _0x59771a;})[_0x5ea9('0x26')](respondWithFilteredResult(_0x5290e2,_0x55adce))['catch'](handleError(_0x5290e2,null));};exports[_0x5ea9('0x61')]=function(_0x5874bd,_0x281f91){var _0x3785c={'raw':![],'where':{'id':_0x5874bd[_0x5ea9('0x62')]['id']},'include':[{'model':db[_0x5ea9('0x45')],'as':_0x5ea9('0x42')},{'model':db[_0x5ea9('0x63')],'as':_0x5ea9('0x43')},{'model':db['Pause'],'as':_0x5ea9('0x47')}]},_0x142bd7={};_0x142bd7['model']=_['keys'](db[_0x5ea9('0x5e')][_0x5ea9('0x49')]);_0x142bd7['query']=_[_0x5ea9('0x4e')](_0x5874bd[_0x5ea9('0x4f')]);_0x142bd7[_0x5ea9('0x50')]=_[_0x5ea9('0x51')](_0x142bd7[_0x5ea9('0x4d')],_0x142bd7['query']);_0x3785c[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x142bd7['model'],qs[_0x5ea9('0x53')](_0x5874bd['query']['fields']));_0x3785c['attributes']=_0x3785c[_0x5ea9('0x52')][_0x5ea9('0x54')]?_0x3785c[_0x5ea9('0x52')]:_0x142bd7[_0x5ea9('0x4d')];if(_0x5874bd[_0x5ea9('0x4f')]['includeAll']){_0x3785c[_0x5ea9('0x60')]=[{'all':!![]}];}_0x3785c=_[_0x5ea9('0x5b')]({},_0x3785c,_0x5874bd[_0x5ea9('0x5d')]);return db['MailAccount'][_0x5ea9('0x64')](_0x3785c)[_0x5ea9('0x26')](handleEntityNotFound(_0x281f91,null))[_0x5ea9('0x26')](respondWithResult(_0x281f91,null))[_0x5ea9('0x1b')](handleError(_0x281f91,null));};exports[_0x5ea9('0x25')]=function(_0x898cb6,_0x37f276){if(_0x898cb6['body']['id']){delete _0x898cb6[_0x5ea9('0x65')]['id'];}var _0x1721d6=_0x898cb6['body'][_0x5ea9('0x66')]===_0x5ea9('0x67')?null:_0x898cb6[_0x5ea9('0x65')][_0x5ea9('0x66')];var _0x39a88e=_0x898cb6['body'][_0x5ea9('0x42')]||{};var _0x5d301a=_0x898cb6['body']['Smtp']||{};if(_0x1721d6){_0x39a88e['host']=getImapHost(_0x1721d6);_0x39a88e['port']=0x3e1;_0x5d301a['host']=getSmtpHost(_0x1721d6);_0x5d301a[_0x5ea9('0x3d')]=0x24b;_0x5d301a['secure']=![];}if(_0x5d301a['modernAuthentication']){_0x5d301a['secure']=![];}else{_0x5d301a[_0x5ea9('0x3b')]=null;}if(!_0x39a88e[_0x5ea9('0x3a')])_0x39a88e[_0x5ea9('0x3b')]=null;_0x898cb6['body'][_0x5ea9('0x42')]=_0x39a88e;_0x898cb6['body']['Smtp']=_0x5d301a;return db['MailAccount'][_0x5ea9('0x64')]({'where':{'id':_0x898cb6[_0x5ea9('0x62')]['id']},'include':[{'model':db[_0x5ea9('0x45')],'as':_0x5ea9('0x42')},{'model':db[_0x5ea9('0x63')],'as':_0x5ea9('0x43')},{'model':db[_0x5ea9('0x46')],'as':_0x5ea9('0x47')}]})[_0x5ea9('0x26')](handleEntityNotFound(_0x37f276,null))[_0x5ea9('0x26')](function(_0x271212){if(!_0x271212)throw new Error('Mail\x20Account\x20not\x20found');if(_0x271212[_0x5ea9('0x3f')])delete _0x898cb6[_0x5ea9('0x65')][_0x5ea9('0x42')];return _0x271212;})[_0x5ea9('0x26')](saveUpdates(_0x898cb6['body'],null))[_0x5ea9('0x26')](function(_0x3ab508){if(!_0x898cb6['body']['Imap'])return _0x3ab508;return db[_0x5ea9('0x45')]['update'](_0x898cb6[_0x5ea9('0x65')][_0x5ea9('0x42')],{'where':{'MailAccountId':_0x3ab508['id']}})[_0x5ea9('0x26')](function(){return _0x3ab508;});})[_0x5ea9('0x26')](function(_0x1576de){if(!_0x898cb6[_0x5ea9('0x65')][_0x5ea9('0x43')])return _0x1576de;return db[_0x5ea9('0x63')][_0x5ea9('0x25')](_0x898cb6[_0x5ea9('0x65')][_0x5ea9('0x43')],{'where':{'MailAccountId':_0x1576de['id']}})['then'](function(){return _0x1576de;});})[_0x5ea9('0x26')](respondWithResult(_0x37f276,null))[_0x5ea9('0x1b')](handleError(_0x37f276,null));};exports[_0x5ea9('0x68')]=function(_0x5bde8c,_0xd50c9c){return db[_0x5ea9('0x5e')][_0x5ea9('0x68')]()['then'](respondWithResult(_0xd50c9c,null))[_0x5ea9('0x1b')](handleError(_0xd50c9c,null));};exports[_0x5ea9('0x69')]=function(_0x4fb575,_0x9cfe9c){if(_0x4fb575[_0x5ea9('0x65')]['id']){delete _0x4fb575[_0x5ea9('0x65')]['id'];}return db[_0x5ea9('0x5e')]['find']({'where':{'id':_0x4fb575[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x9cfe9c,null))[_0x5ea9('0x26')](function(_0x435aad){if(_0x435aad){_0x4fb575['body'][_0x5ea9('0x6a')]=_0x435aad['id'];return db['Disposition'][_0x5ea9('0x6b')](_0x4fb575[_0x5ea9('0x65')]);}})['then'](respondWithResult(_0x9cfe9c,null))[_0x5ea9('0x1b')](handleError(_0x9cfe9c,null));};exports[_0x5ea9('0x6c')]=function(_0x3803e2,_0x345264){var _0x1f9529={'raw':![],'where':{}};var _0x2007e4={};var _0x619cf7={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x3803e2[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x345264,null))[_0x5ea9('0x26')](function(_0x47d6d6){if(_0x47d6d6){_0x2007e4[_0x5ea9('0x4d')]=_[_0x5ea9('0x4e')](db[_0x5ea9('0x6d')][_0x5ea9('0x49')]);_0x2007e4[_0x5ea9('0x4f')]=_['keys'](_0x3803e2[_0x5ea9('0x4f')]);_0x2007e4['filters']=_[_0x5ea9('0x51')](_0x2007e4[_0x5ea9('0x4d')],_0x2007e4[_0x5ea9('0x4f')]);_0x1f9529[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x2007e4[_0x5ea9('0x4d')],qs[_0x5ea9('0x53')](_0x3803e2[_0x5ea9('0x4f')][_0x5ea9('0x53')]));_0x1f9529[_0x5ea9('0x52')]=_0x1f9529[_0x5ea9('0x52')][_0x5ea9('0x54')]?_0x1f9529[_0x5ea9('0x52')]:_0x2007e4[_0x5ea9('0x4d')];if(!_0x3803e2[_0x5ea9('0x4f')][_0x5ea9('0x55')](_0x5ea9('0x56'))){_0x1f9529[_0x5ea9('0x23')]=qs[_0x5ea9('0x23')](_0x3803e2[_0x5ea9('0x4f')]['limit']);_0x1f9529[_0x5ea9('0x20')]=qs[_0x5ea9('0x20')](_0x3803e2['query']['offset']);}_0x1f9529[_0x5ea9('0x57')]=qs[_0x5ea9('0x58')](_0x3803e2[_0x5ea9('0x4f')]['sort']);_0x1f9529[_0x5ea9('0x5a')]=qs[_0x5ea9('0x50')](_['pick'](_0x3803e2[_0x5ea9('0x4f')],_0x2007e4['filters']));_0x1f9529['where'][_0x5ea9('0x6a')]=_0x47d6d6['id'];if(_0x3803e2['query'][_0x5ea9('0x5c')]){_0x1f9529[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x1f9529['where'],{'$or':_['map'](_0x1f9529['attributes'],function(_0x42b9a2){var _0x5e1f14={};_0x5e1f14[_0x42b9a2]={'$like':'%'+_0x3803e2[_0x5ea9('0x4f')]['filter']+'%'};return _0x5e1f14;})});}_0x1f9529=_['merge']({},_0x1f9529,_0x3803e2[_0x5ea9('0x5d')]);return db[_0x5ea9('0x6d')][_0x5ea9('0x22')]({'where':_0x1f9529[_0x5ea9('0x5a')]})[_0x5ea9('0x26')](function(_0x1db6b2){_0x619cf7[_0x5ea9('0x22')]=_0x1db6b2;if(_0x3803e2[_0x5ea9('0x4f')]['includeAll']){_0x1f9529[_0x5ea9('0x60')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1f9529);})[_0x5ea9('0x26')](function(_0x3abcd1){_0x619cf7[_0x5ea9('0x6e')]=_0x3abcd1;return _0x619cf7;});}})['then'](respondWithFilteredResult(_0x345264,_0x1f9529))[_0x5ea9('0x1b')](handleError(_0x345264,null));};exports['removeDispositions']=function(_0x22777e,_0x1c1028){return db[_0x5ea9('0x5e')][_0x5ea9('0x64')]({'where':{'id':_0x22777e[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x1c1028,null))[_0x5ea9('0x26')](function(_0x143f83){if(_0x143f83){return _0x143f83[_0x5ea9('0x6f')](_0x22777e[_0x5ea9('0x4f')][_0x5ea9('0x70')]);}})[_0x5ea9('0x26')](respondWithStatusCode(_0x1c1028,null))[_0x5ea9('0x1b')](handleError(_0x1c1028,null));};exports['addAnswer']=function(_0x4309ed,_0x5cfe32){if(_0x4309ed[_0x5ea9('0x65')]['id']){delete _0x4309ed[_0x5ea9('0x65')]['id'];}return db['MailAccount'][_0x5ea9('0x64')]({'where':{'id':_0x4309ed[_0x5ea9('0x62')]['id']}})['then'](handleEntityNotFound(_0x5cfe32,null))[_0x5ea9('0x26')](function(_0x24603b){if(_0x24603b){_0x4309ed['body']['MailAccountId']=_0x24603b['id'];return db[_0x5ea9('0x71')][_0x5ea9('0x6b')](_0x4309ed[_0x5ea9('0x65')]);}})[_0x5ea9('0x26')](respondWithResult(_0x5cfe32,null))[_0x5ea9('0x1b')](handleError(_0x5cfe32,null));};exports['getAnswers']=function(_0x2e508f,_0x3ab635){var _0x50f69c={'raw':![],'where':{}};var _0x42d44c={};var _0x48adaf={'count':0x0,'rows':[]};return db[_0x5ea9('0x5e')]['findOne']({'where':{'id':_0x2e508f[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x3ab635,null))[_0x5ea9('0x26')](function(_0x1adc13){if(_0x1adc13){_0x42d44c['model']=_[_0x5ea9('0x4e')](db['CannedAnswer'][_0x5ea9('0x49')]);_0x42d44c['query']=_[_0x5ea9('0x4e')](_0x2e508f[_0x5ea9('0x4f')]);_0x42d44c[_0x5ea9('0x50')]=_[_0x5ea9('0x51')](_0x42d44c[_0x5ea9('0x4d')],_0x42d44c[_0x5ea9('0x4f')]);_0x50f69c[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x42d44c[_0x5ea9('0x4d')],qs[_0x5ea9('0x53')](_0x2e508f[_0x5ea9('0x4f')][_0x5ea9('0x53')]));_0x50f69c['attributes']=_0x50f69c['attributes']['length']?_0x50f69c[_0x5ea9('0x52')]:_0x42d44c['model'];if(!_0x2e508f[_0x5ea9('0x4f')][_0x5ea9('0x55')](_0x5ea9('0x56'))){_0x50f69c['limit']=qs[_0x5ea9('0x23')](_0x2e508f[_0x5ea9('0x4f')][_0x5ea9('0x23')]);_0x50f69c[_0x5ea9('0x20')]=qs[_0x5ea9('0x20')](_0x2e508f[_0x5ea9('0x4f')]['offset']);}_0x50f69c['order']=qs[_0x5ea9('0x58')](_0x2e508f[_0x5ea9('0x4f')]['sort']);_0x50f69c[_0x5ea9('0x5a')]=qs[_0x5ea9('0x50')](_[_0x5ea9('0x59')](_0x2e508f['query'],_0x42d44c[_0x5ea9('0x50')]));_0x50f69c['where']['MailAccountId']=_0x1adc13['id'];if(_0x2e508f['query'][_0x5ea9('0x5c')]){_0x50f69c[_0x5ea9('0x5a')]=_['merge'](_0x50f69c[_0x5ea9('0x5a')],{'$or':_[_0x5ea9('0x48')](_0x50f69c[_0x5ea9('0x52')],function(_0xd5c2fd){var _0x2a1572={};_0x2a1572[_0xd5c2fd]={'$like':'%'+_0x2e508f['query'][_0x5ea9('0x5c')]+'%'};return _0x2a1572;})});}_0x50f69c=_['merge']({},_0x50f69c,_0x2e508f[_0x5ea9('0x5d')]);return db[_0x5ea9('0x71')][_0x5ea9('0x22')]({'where':_0x50f69c['where']})['then'](function(_0x171969){_0x48adaf[_0x5ea9('0x22')]=_0x171969;if(_0x2e508f[_0x5ea9('0x4f')][_0x5ea9('0x5f')]){_0x50f69c[_0x5ea9('0x60')]=[{'all':!![]}];}return db[_0x5ea9('0x71')][_0x5ea9('0x72')](_0x50f69c);})[_0x5ea9('0x26')](function(_0x220dbf){_0x48adaf[_0x5ea9('0x6e')]=_0x220dbf;return _0x48adaf;});}})[_0x5ea9('0x26')](respondWithFilteredResult(_0x3ab635,_0x50f69c))[_0x5ea9('0x1b')](handleError(_0x3ab635,null));};exports[_0x5ea9('0x73')]=function(_0x3a1d99,_0x49733c){return db[_0x5ea9('0x5e')]['find']({'where':{'id':_0x3a1d99[_0x5ea9('0x62')]['id']}})['then'](handleEntityNotFound(_0x49733c,null))[_0x5ea9('0x26')](function(_0x5c954c){if(_0x5c954c){return _0x5c954c[_0x5ea9('0x73')](_0x3a1d99[_0x5ea9('0x4f')][_0x5ea9('0x70')]);}})[_0x5ea9('0x26')](respondWithStatusCode(_0x49733c,null))[_0x5ea9('0x1b')](handleError(_0x49733c,null));};exports[_0x5ea9('0x6b')]=function(_0x18a1d9,_0x2ae19a){var _0x24e91f={'name':_0x18a1d9[_0x5ea9('0x65')][_0x5ea9('0x2b')],'key':_0x18a1d9[_0x5ea9('0x65')][_0x5ea9('0x4c')],'provider':_0x18a1d9[_0x5ea9('0x65')]['provider']==='custom'?null:_0x18a1d9[_0x5ea9('0x65')][_0x5ea9('0x66')],'email':_0x18a1d9['body'][_0x5ea9('0x74')],'ListId':_0x18a1d9[_0x5ea9('0x65')][_0x5ea9('0x75')],'active':!_[_0x5ea9('0x76')](_0x18a1d9[_0x5ea9('0x65')]['active'])?_0x18a1d9[_0x5ea9('0x65')]['active']:!![],'description':_0x18a1d9[_0x5ea9('0x65')][_0x5ea9('0x77')]||null};var _0x4bb83c=getAuthenticationOptions(_0x24e91f[_0x5ea9('0x66')],_0x18a1d9[_0x5ea9('0x65')]);_0x24e91f[_0x5ea9('0x42')]=_0x4bb83c[_0x5ea9('0x42')];_0x24e91f[_0x5ea9('0x43')]=_0x4bb83c[_0x5ea9('0x43')];return db[_0x5ea9('0x5e')][_0x5ea9('0x6b')](_0x24e91f,{'include':[{'model':db[_0x5ea9('0x63')],'as':_0x5ea9('0x43')},{'model':db[_0x5ea9('0x45')],'as':_0x5ea9('0x42')}]})[_0x5ea9('0x26')](function(_0x1a2049){var _0x104599=_0x18a1d9[_0x5ea9('0x37')][_0x5ea9('0x28')]({'plain':!![]});if(!_0x104599)throw new Error(_0x5ea9('0x78'));if(_0x104599[_0x5ea9('0x79')]===_0x5ea9('0x37')){var _0x204080=_0x1a2049[_0x5ea9('0x28')]({'plain':!![]});return db[_0x5ea9('0x7a')][_0x5ea9('0x64')]({'where':{'name':_0x5ea9('0x29'),'userProfileId':_0x104599[_0x5ea9('0x7b')]},'raw':!![]})[_0x5ea9('0x26')](function(_0x582df5){if(_0x582df5&&_0x582df5[_0x5ea9('0x7c')]===0x0){return db['UserProfileResource']['create']({'name':_0x204080[_0x5ea9('0x2b')],'resourceId':_0x204080['id'],'type':_0x582df5[_0x5ea9('0x2b')],'sectionId':_0x582df5['id']},{})['then'](function(){return _0x1a2049;});}else{return _0x1a2049;}})[_0x5ea9('0x1b')](function(_0xf7e6e9){logger[_0x5ea9('0x17')](_0x5ea9('0x7d'),_0xf7e6e9);throw _0xf7e6e9;});}return _0x1a2049;})[_0x5ea9('0x26')](respondWithResult(_0x2ae19a,0xc9))[_0x5ea9('0x1b')](handleError(_0x2ae19a,null));};exports['getImap']=function(_0x564228,_0x3b27a9){return db['MailAccount'][_0x5ea9('0x7e')]({'where':{'id':_0x564228[_0x5ea9('0x62')]['id']}})['then'](handleEntityNotFound(_0x3b27a9,null))['then'](function(_0x47f5d3){if(_0x47f5d3){return _0x47f5d3['getImap']();}return null;})[_0x5ea9('0x26')](respondWithResult(_0x3b27a9,null))[_0x5ea9('0x1b')](handleError(_0x3b27a9,null));};exports[_0x5ea9('0x7f')]=function(_0x74b764,_0x2b755b){if(_0x74b764[_0x5ea9('0x65')]['id']){delete _0x74b764['body']['id'];}return db[_0x5ea9('0x5e')][_0x5ea9('0x64')]({'where':{'id':_0x74b764[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x2b755b,null))[_0x5ea9('0x26')](function(_0x39d917){if(_0x39d917){_0x74b764[_0x5ea9('0x65')][_0x5ea9('0x6a')]=_0x39d917['id'];return db[_0x5ea9('0x45')]['create'](_0x74b764[_0x5ea9('0x65')]);}})[_0x5ea9('0x26')](respondWithResult(_0x2b755b,null))[_0x5ea9('0x1b')](handleError(_0x2b755b,null));};exports[_0x5ea9('0x80')]=function(_0x10b9f4,_0x5664c3){return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x10b9f4[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x5664c3,null))[_0x5ea9('0x26')](function(_0x1e9a34){if(_0x1e9a34){return _0x1e9a34[_0x5ea9('0x81')](null);}return null;})['then'](respondWithStatusCode(_0x5664c3,null))['catch'](handleError(_0x5664c3,null));};exports[_0x5ea9('0x82')]=function(_0x1ac3d1,_0x4ab187){return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x1ac3d1[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x4ab187,null))[_0x5ea9('0x26')](function(_0x5a3b63){if(_0x5a3b63){return _0x5a3b63[_0x5ea9('0x82')]();}return null;})[_0x5ea9('0x26')](respondWithResult(_0x4ab187,null))['catch'](handleError(_0x4ab187,null));};exports[_0x5ea9('0x83')]=function(_0x11a95a,_0x115fea){if(_0x11a95a[_0x5ea9('0x65')]['id']){delete _0x11a95a[_0x5ea9('0x65')]['id'];}return db['MailAccount'][_0x5ea9('0x64')]({'where':{'id':_0x11a95a[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x115fea,null))[_0x5ea9('0x26')](function(_0x2e7844){if(_0x2e7844){_0x11a95a[_0x5ea9('0x65')]['MailAccountId']=_0x2e7844['id'];return db[_0x5ea9('0x63')]['create'](_0x11a95a[_0x5ea9('0x65')]);}})['then'](respondWithResult(_0x115fea,null))[_0x5ea9('0x1b')](handleError(_0x115fea,null));};exports[_0x5ea9('0x84')]=function(_0x56d6af,_0x1eff1c){return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x56d6af['params']['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x1eff1c,null))[_0x5ea9('0x26')](function(_0x302f6d){if(_0x302f6d){return _0x302f6d[_0x5ea9('0x85')](null);}return null;})['then'](respondWithStatusCode(_0x1eff1c,null))['catch'](handleError(_0x1eff1c,null));};exports['addInteraction']=function(_0x5941f6,_0x2bbcf6){return db[_0x5ea9('0x86')][_0x5ea9('0x64')]({'where':{'id':_0x5941f6[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x2bbcf6,null))[_0x5ea9('0x26')](function(_0x44d42c){if(_0x44d42c){return _0x44d42c[_0x5ea9('0x87')](_0x5941f6[_0x5ea9('0x65')][_0x5ea9('0x70')],_['omit'](_0x5941f6[_0x5ea9('0x65')],[_0x5ea9('0x70'),'id'])||{});}})[_0x5ea9('0x26')](respondWithResult(_0x2bbcf6,null))[_0x5ea9('0x1b')](handleError(_0x2bbcf6,null));};exports[_0x5ea9('0x88')]=function(_0x19baca,_0x4cea60){var _0x575a01={'raw':![],'where':{}};var _0x560400={};var _0x16b675={'count':0x0,'rows':[]};return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x19baca[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x4cea60,null))['then'](function(_0x283dc7){if(_0x283dc7){_0x560400[_0x5ea9('0x4d')]=_[_0x5ea9('0x4e')](db[_0x5ea9('0x86')][_0x5ea9('0x49')]);_0x560400[_0x5ea9('0x4f')]=_[_0x5ea9('0x4e')](_0x19baca['query']);_0x560400[_0x5ea9('0x50')]=_[_0x5ea9('0x51')](_0x560400[_0x5ea9('0x4d')],_0x560400[_0x5ea9('0x4f')]);_0x575a01[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x560400['model'],qs['fields'](_0x19baca[_0x5ea9('0x4f')]['fields']));_0x575a01[_0x5ea9('0x52')]=_0x575a01['attributes'][_0x5ea9('0x54')]?_0x575a01[_0x5ea9('0x52')]:_0x560400[_0x5ea9('0x4d')];if(!_0x19baca[_0x5ea9('0x4f')][_0x5ea9('0x55')](_0x5ea9('0x56'))){_0x575a01['limit']=qs[_0x5ea9('0x23')](_0x19baca[_0x5ea9('0x4f')][_0x5ea9('0x23')]);_0x575a01[_0x5ea9('0x20')]=qs['offset'](_0x19baca[_0x5ea9('0x4f')]['offset']);}_0x575a01[_0x5ea9('0x57')]=qs[_0x5ea9('0x58')](_0x19baca[_0x5ea9('0x4f')][_0x5ea9('0x58')]);_0x575a01[_0x5ea9('0x5a')]=qs[_0x5ea9('0x50')](_[_0x5ea9('0x59')](_0x19baca[_0x5ea9('0x4f')],_0x560400[_0x5ea9('0x50')]));_0x575a01[_0x5ea9('0x5a')][_0x5ea9('0x6a')]=_0x283dc7['id'];if(_0x19baca['query'][_0x5ea9('0x5c')]){_0x575a01[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x575a01[_0x5ea9('0x5a')],{'$or':_[_0x5ea9('0x48')](_0x575a01[_0x5ea9('0x52')],function(_0x595f26){var _0x3e3550={};_0x3e3550[_0x595f26]={'$like':'%'+_0x19baca['query']['filter']+'%'};return _0x3e3550;})});}_0x575a01=_['merge']({},_0x575a01,_0x19baca[_0x5ea9('0x5d')]);return db['MailInteraction'][_0x5ea9('0x22')]({'where':_0x575a01['where']})[_0x5ea9('0x26')](function(_0x3ec6a9){_0x16b675[_0x5ea9('0x22')]=_0x3ec6a9;if(_0x19baca[_0x5ea9('0x4f')]['includeAll']){_0x575a01[_0x5ea9('0x60')]=[{'model':db['CmContact'],'as':_0x5ea9('0x89'),'required':![]},{'model':db[_0x5ea9('0x8a')],'as':_0x5ea9('0x8b'),'attributes':[_0x5ea9('0x2b'),_0x5ea9('0x8c'),_0x5ea9('0x8d')],'required':![]},{'model':db[_0x5ea9('0x8e')],'as':'Tags','attributes':['id','name','color'],'where':_0x19baca[_0x5ea9('0x4f')][_0x5ea9('0x8f')]?{'id':_0x19baca[_0x5ea9('0x4f')][_0x5ea9('0x8f')]}:undefined,'required':_0x19baca['query'][_0x5ea9('0x8f')]?!![]:![]}];}return db[_0x5ea9('0x86')]['findAll'](_0x575a01);})[_0x5ea9('0x26')](function(_0x1a144d){_0x16b675[_0x5ea9('0x6e')]=_0x1a144d;return _0x16b675;});}})[_0x5ea9('0x26')](respondWithFilteredResult(_0x4cea60,_0x575a01))['catch'](handleError(_0x4cea60,null));};exports[_0x5ea9('0x90')]=function addApplications(_0x38f296,_0x325d09){var _0x320410=_0x38f296[_0x5ea9('0x62')]['id'];var _0x3f7c17=_0x38f296['body'];var _0x20c1a1=0xc8;var _0x16bedc=null;return db[_0x5ea9('0x91')][_0x5ea9('0x92')]({'isolationLevel':db[_0x5ea9('0x91')]['Transaction'][_0x5ea9('0x93')][_0x5ea9('0x94')]},function(_0x4775f2){return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x320410},'transaction':_0x4775f2})[_0x5ea9('0x26')](function(_0x92d011){if(_0x92d011){return db[_0x5ea9('0x95')]['destroy']({'where':{'MailAccountId':_0x320410},'transaction':_0x4775f2})[_0x5ea9('0x26')](function(){var _0xaa2196=_['map'](_0x3f7c17,function(_0x514a59){_0x514a59[_0x5ea9('0x6a')]=_0x320410;return _0x514a59;});return db[_0x5ea9('0x95')][_0x5ea9('0x96')](_0xaa2196,{'transaction':_0x4775f2});});}else{_0x20c1a1=0x194;_0x16bedc=[];}});})['then'](function(){if(_0x20c1a1!==0x194){return db[_0x5ea9('0x95')][_0x5ea9('0x97')]({'where':{'MailAccountId':_0x320410},'order':'priority'})[_0x5ea9('0x26')](function(_0x3b9c32){_0x16bedc=_0x3b9c32;});}})['catch'](function(_0x54901b){_0x20c1a1=0x1f4;logger['error'](_0x54901b[_0x5ea9('0x2a')]);if(_0x54901b[_0x5ea9('0x2b')]){delete _0x54901b['name'];}_0x16bedc=_0x54901b;})['finally'](function(){if(_0x16bedc===null){_0x325d09[_0x5ea9('0x1c')](_0x20c1a1);}else{if(_0x20c1a1===0x1f4){_0x325d09[_0x5ea9('0x1d')](_0x20c1a1)[_0x5ea9('0x98')](_0x16bedc);}else{_0x325d09[_0x5ea9('0x1d')](_0x20c1a1)[_0x5ea9('0x1f')](_0x16bedc);}}});};exports[_0x5ea9('0x99')]=function(_0x4e43f1,_0x4241fb){var _0x592100={};var _0x3009f3={};var _0x3e1edd;var _0x3ed4f6;return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x4e43f1['params']['id']}})['then'](handleEntityNotFound(_0x4241fb,null))[_0x5ea9('0x26')](function(_0x2d3c98){if(_0x2d3c98){_0x3e1edd=_0x2d3c98;_0x3009f3['model']=_[_0x5ea9('0x4e')](db['MailApplication'][_0x5ea9('0x49')]);_0x3009f3[_0x5ea9('0x4f')]=_[_0x5ea9('0x4e')](_0x4e43f1[_0x5ea9('0x4f')]);_0x3009f3['filters']=_['intersection'](_0x3009f3['model'],_0x3009f3['query']);_0x592100[_0x5ea9('0x52')]=_['intersection'](_0x3009f3[_0x5ea9('0x4d')],qs['fields'](_0x4e43f1['query'][_0x5ea9('0x53')]));_0x592100[_0x5ea9('0x52')]=_0x592100['attributes'][_0x5ea9('0x54')]?_0x592100['attributes']:_0x3009f3[_0x5ea9('0x4d')];_0x592100[_0x5ea9('0x57')]=qs[_0x5ea9('0x58')](_0x4e43f1[_0x5ea9('0x4f')]['sort']);_0x592100[_0x5ea9('0x5a')]=qs[_0x5ea9('0x50')](_['pick'](_0x4e43f1[_0x5ea9('0x4f')],_0x3009f3[_0x5ea9('0x50')]));if(_0x4e43f1[_0x5ea9('0x4f')][_0x5ea9('0x5c')]){_0x592100[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x592100[_0x5ea9('0x5a')],{'$or':_['map'](_0x592100[_0x5ea9('0x52')],function(_0x2008a6){var _0x57260a={};_0x57260a[_0x2008a6]={'$like':'%'+_0x4e43f1[_0x5ea9('0x4f')]['filter']+'%'};return _0x57260a;})});}_0x592100=_[_0x5ea9('0x5b')]({},_0x592100,_0x4e43f1[_0x5ea9('0x5d')]);return _0x3e1edd[_0x5ea9('0x99')](_0x592100);}})[_0x5ea9('0x26')](function(_0x40282c){if(_0x40282c){_0x3ed4f6=_0x40282c['length'];if(!_0x4e43f1['query'][_0x5ea9('0x55')]('nolimit')){_0x592100[_0x5ea9('0x23')]=qs[_0x5ea9('0x23')](_0x4e43f1[_0x5ea9('0x4f')][_0x5ea9('0x23')]);_0x592100[_0x5ea9('0x20')]=qs[_0x5ea9('0x20')](_0x4e43f1[_0x5ea9('0x4f')]['offset']);}return _0x3e1edd['getApplications'](_0x592100);}})[_0x5ea9('0x26')](function(_0x204093){if(_0x204093){return _0x204093?{'count':_0x3ed4f6,'rows':_0x204093}:null;}})[_0x5ea9('0x26')](respondWithResult(_0x4241fb,null))[_0x5ea9('0x1b')](handleError(_0x4241fb,null));};exports['getMessages']=function(_0x1fa5f8,_0x1cc226){var _0x324d7f={'raw':!![],'where':{}};var _0x53d218={};var _0x2b3a3f={'count':0x0,'rows':[]};return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x1fa5f8['params']['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x1cc226,null))[_0x5ea9('0x26')](function(_0x34d3c3){if(_0x34d3c3){_0x53d218['model']=_['keys'](db['MailMessage']['rawAttributes']);_0x53d218['query']=_[_0x5ea9('0x4e')](_0x1fa5f8['query']);_0x53d218[_0x5ea9('0x50')]=_['intersection'](_0x53d218[_0x5ea9('0x4d')],_0x53d218[_0x5ea9('0x4f')]);_0x324d7f[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x53d218[_0x5ea9('0x4d')],qs[_0x5ea9('0x53')](_0x1fa5f8[_0x5ea9('0x4f')][_0x5ea9('0x53')]));_0x324d7f[_0x5ea9('0x52')]=_0x324d7f[_0x5ea9('0x52')][_0x5ea9('0x54')]?_0x324d7f[_0x5ea9('0x52')]:_0x53d218[_0x5ea9('0x4d')];if(!_0x1fa5f8[_0x5ea9('0x4f')][_0x5ea9('0x55')]('nolimit')){_0x324d7f[_0x5ea9('0x23')]=qs[_0x5ea9('0x23')](_0x1fa5f8['query'][_0x5ea9('0x23')]);_0x324d7f[_0x5ea9('0x20')]=qs[_0x5ea9('0x20')](_0x1fa5f8['query']['offset']);}_0x324d7f[_0x5ea9('0x57')]=qs[_0x5ea9('0x58')](_0x1fa5f8[_0x5ea9('0x4f')]['sort']);_0x324d7f[_0x5ea9('0x5a')]=qs[_0x5ea9('0x50')](_[_0x5ea9('0x59')](_0x1fa5f8[_0x5ea9('0x4f')],_0x53d218['filters']));_0x324d7f['where'][_0x5ea9('0x6a')]=_0x34d3c3['id'];if(_0x1fa5f8['query'][_0x5ea9('0x5c')]){_0x324d7f[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x324d7f[_0x5ea9('0x5a')],{'$or':_['map'](_0x324d7f['attributes'],function(_0x308ebc){var _0x41a1ea={};_0x41a1ea[_0x308ebc]={'$like':'%'+_0x1fa5f8[_0x5ea9('0x4f')][_0x5ea9('0x5c')]+'%'};return _0x41a1ea;})});}if(_0x1fa5f8[_0x5ea9('0x4f')][_0x5ea9('0x9a')]){var _0x565685=_0x1fa5f8['query'][_0x5ea9('0x9a')]['split'](',');var _0x143165={};_0x143165[_0x565685[0x0]]={'$gte':moment(_0x565685[0x1])[_0x5ea9('0x9b')](_0x5ea9('0x9c'))};_0x324d7f[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x324d7f['where'],_0x143165);}_0x324d7f=_['merge']({},_0x324d7f,_0x1fa5f8['options']);return db['MailMessage']['count']({'where':_0x324d7f[_0x5ea9('0x5a')]})[_0x5ea9('0x26')](function(_0x3d1515){_0x2b3a3f[_0x5ea9('0x22')]=_0x3d1515;if(_0x1fa5f8[_0x5ea9('0x4f')][_0x5ea9('0x5f')]){_0x324d7f[_0x5ea9('0x60')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x324d7f);})[_0x5ea9('0x26')](function(_0x5b668a){if(_0x1fa5f8[_0x5ea9('0x4f')][_0x5ea9('0x9d')]==='true'){for(var _0x330c6e=0x0;_0x330c6e<_0x5b668a[_0x5ea9('0x54')];_0x330c6e++){_0x5b668a[_0x330c6e][_0x5ea9('0x65')]=juice(_0x5b668a[_0x330c6e][_0x5ea9('0x65')]);}}_0x2b3a3f[_0x5ea9('0x6e')]=_0x5b668a;return _0x2b3a3f;});}})[_0x5ea9('0x26')](respondWithFilteredResult(_0x1cc226,_0x324d7f))[_0x5ea9('0x1b')](handleError(_0x1cc226,null));};exports[_0x5ea9('0x98')]=function(_0x399f55,_0xb75d29){var _0x555b30,_0x434907={},_0x35ff29;if(_0x399f55['body']['to']){_0x35ff29=_0x399f55[_0x5ea9('0x65')]['to'][_0x5ea9('0x9e')](',')[0x0];}return db[_0x5ea9('0x5e')][_0x5ea9('0x64')]({'where':{'id':_0x399f55[_0x5ea9('0x62')]['id']},'include':[{'model':db['CmList'],'as':_0x5ea9('0x9f'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x35ff29},'limit':0x1,'order':[[_0x5ea9('0xa0'),_0x5ea9('0xa1')]]}]},{'model':db['MailServerOut'],'as':_0x5ea9('0x43'),'raw':!![],'include':[{'model':db[_0x5ea9('0xa2')],'as':_0x5ea9('0xa2'),'raw':!![]}]}]})[_0x5ea9('0x26')](handleEntityNotFound(_0xb75d29,null))[_0x5ea9('0x26')](function(_0x13f8f7){if(!_0x13f8f7)return;_0x555b30=_0x13f8f7;if(!_0x13f8f7[_0x5ea9('0x43')])throw new Error(_0x5ea9('0xa3'));if(_[_0x5ea9('0x76')](_0x399f55[_0x5ea9('0x65')]['from'])){_0x399f55[_0x5ea9('0x65')]['from']=util['format'](_0x5ea9('0xa4'),_0x13f8f7[_0x5ea9('0x2b')],_0x13f8f7['email']||_0x13f8f7[_0x5ea9('0x43')][_0x5ea9('0x37')]);}if(_0x399f55['body']['attachments']&&_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xa5')][_0x5ea9('0x54')]){for(var _0x466c48=0x0;_0x466c48<_0x399f55[_0x5ea9('0x65')]['attachments'][_0x5ea9('0x54')];_0x466c48+=0x1){_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xa5')][_0x466c48]={'filename':_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xa5')][_0x466c48][_0x5ea9('0x2b')],'path':path[_0x5ea9('0xa6')](config[_0x5ea9('0xa7')],'server/files/attachments',_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xa5')][_0x466c48]['basename'])};}}var _0x4addb0=_0x13f8f7[_0x5ea9('0xa8')]();return respondWithRpcPromise(_0x5ea9('0xa9'),_0x5ea9('0xaa'),{'account':_0x4addb0,'message':_0x399f55[_0x5ea9('0x65')]});})[_0x5ea9('0x26')](function(_0x3e7cb8){if(!_0x3e7cb8)return;_0x434907=_0x3e7cb8;if(!_0x555b30['List'])throw new Error('List\x20not\x20found');if(_0x555b30['List']['Contacts'][_0x5ea9('0x54')])return _0x555b30[_0x5ea9('0x9f')][_0x5ea9('0xab')][0x0];return db[_0x5ea9('0xac')][_0x5ea9('0x6b')](_[_0x5ea9('0xad')](_0x399f55['body'],{'firstName':_0x399f55[_0x5ea9('0x65')]['to'],'email':_0x399f55[_0x5ea9('0x65')]['to'],'phone':_0x399f55[_0x5ea9('0x65')]['to'],'ListId':_0x555b30['ListId']}));})[_0x5ea9('0x26')](function(_0x5d6991){if(!_0x5d6991)return;var _0x5a38a1={'UserId':_0x399f55[_0x5ea9('0x37')]['id'],'ContactId':_0x5d6991['id'],'MailAccountId':_0x555b30['id'],'inReplyTo':_0x434907[_0x5ea9('0xae')],'to':_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xaf')],'cc':_0x399f55[_0x5ea9('0x65')]['cc'],'subject':_0x399f55['body']['subject'],'attach':_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xb0')],'firstMsgDirection':_0x5ea9('0xb1'),'lastMsgAt':moment()['format'](_0x5ea9('0x9c')),'lastMsgDirection':_0x5ea9('0xb1'),'Messages':[_[_0x5ea9('0x5b')](_0x399f55['body'],{'messageId':_0x434907[_0x5ea9('0xae')],'sentAt':moment()['format'](_0x5ea9('0x9c')),'read':!![],'MailAccountId':_0x555b30['id'],'UserId':_0x399f55[_0x5ea9('0x37')]['id'],'ContactId':_0x5d6991['id']})]};if(_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xb2')]){_0x5a38a1=_[_0x5ea9('0x5b')](_0x5a38a1,_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xb2')]);}return db[_0x5ea9('0x86')][_0x5ea9('0x6b')](_0x5a38a1,{'include':[{'model':db[_0x5ea9('0xb3')],'as':_0x5ea9('0xb4')}]});})['then'](respondWithResult(_0xb75d29,null))[_0x5ea9('0x1b')](handleError(_0xb75d29,null));};exports[_0x5ea9('0xb5')]=function(_0x4769fc,_0x1a4329){return db['MailAccount']['find']({'where':{'id':_0x4769fc[_0x5ea9('0x62')]['id']},'include':[{'model':db[_0x5ea9('0x63')],'as':_0x5ea9('0x43'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5ea9('0xa2'),'raw':!![]}]}]})[_0x5ea9('0x26')](handleEntityNotFound(_0x1a4329,null))['then'](function(_0x23d4f1){if(!_0x23d4f1[_0x5ea9('0x43')])return;var _0x5d3077=_0x23d4f1[_0x5ea9('0xa8')]();return respondWithRpcPromise(_0x5ea9('0xb6'),_0x5ea9('0xb5'),{'account':_0x5d3077});})['then'](respondWithResult(_0x1a4329,null))[_0x5ea9('0x1b')](handleError(_0x1a4329,null));};exports['destroy']=function(_0x549199,_0x30ec8b){return db[_0x5ea9('0x5e')]['find']({'where':{'id':_0x549199[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x30ec8b,null))[_0x5ea9('0x26')](function(_0x59ce8f){if(_0x59ce8f&&_0x59ce8f[_0x5ea9('0x3f')]){throw new db[(_0x5ea9('0xb7'))]['ValidationError'](_0x5ea9('0xb8'));}return _0x59ce8f;})[_0x5ea9('0x26')](removeEntity(_0x30ec8b,null))[_0x5ea9('0x1b')](handleError(_0x30ec8b,null));};exports[_0x5ea9('0xb9')]=function(_0x576248,_0x376a2d){return db[_0x5ea9('0x5e')][_0x5ea9('0x64')]({'where':{'id':_0x576248['params']['id']}})['then'](handleEntityNotFound(_0x376a2d,null))[_0x5ea9('0x26')](function(_0x10c75a){if(_0x10c75a){return _0x10c75a[_0x5ea9('0xb9')](_0x576248[_0x5ea9('0x65')][_0x5ea9('0x70')],_[_0x5ea9('0xba')](_0x576248[_0x5ea9('0x65')],['ids','id'])||{})['spread'](function(_0x4e90b1){for(var _0x1140fa=0x0;_0x1140fa<_0x576248[_0x5ea9('0x65')][_0x5ea9('0x70')][_0x5ea9('0x54')];_0x1140fa+=0x1){socket[_0x5ea9('0xbb')](_0x5ea9('0xbc'),{'UserId':Number(_0x576248[_0x5ea9('0x65')]['ids'][_0x1140fa]),'MailAccountId':Number(_0x576248['params']['id'])});}return _0x4e90b1;});}})['then'](respondWithResult(_0x376a2d,null))[_0x5ea9('0x1b')](handleError(_0x376a2d,null));};exports['removeAgents']=function(_0x19dfbe,_0x397bf4){return db[_0x5ea9('0x5e')][_0x5ea9('0x64')]({'where':{'id':_0x19dfbe['params']['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x397bf4,null))[_0x5ea9('0x26')](function(_0x58e0d3){if(_0x58e0d3){return _0x58e0d3['removeAgents'](_0x19dfbe[_0x5ea9('0x4f')][_0x5ea9('0x70')])['then'](function(){if(_['isArray'](_0x19dfbe[_0x5ea9('0x4f')][_0x5ea9('0x70')])){for(var _0x36af14=0x0;_0x36af14<_0x19dfbe[_0x5ea9('0x4f')]['ids'][_0x5ea9('0x54')];_0x36af14+=0x1){socket[_0x5ea9('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x19dfbe[_0x5ea9('0x4f')]['ids'][_0x36af14]),'MailAccountId':Number(_0x19dfbe[_0x5ea9('0x62')]['id'])});}}else{socket[_0x5ea9('0xbb')](_0x5ea9('0xbd'),{'UserId':Number(_0x19dfbe[_0x5ea9('0x4f')][_0x5ea9('0x70')]),'MailAccountId':Number(_0x19dfbe['params']['id'])});}});}})[_0x5ea9('0x26')](respondWithStatusCode(_0x397bf4,null))[_0x5ea9('0x1b')](handleError(_0x397bf4,null));};exports['getAgents']=function(_0x2a7455,_0x33eae0){var _0x373893={};var _0x1f4a9b={};var _0x61f7c8;var _0x2c9408;return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x2a7455[_0x5ea9('0x62')]['id']}})['then'](handleEntityNotFound(_0x33eae0,null))['then'](function(_0x56b716){if(_0x56b716){_0x61f7c8=_0x56b716;_0x1f4a9b[_0x5ea9('0x4d')]=_[_0x5ea9('0x4e')](db[_0x5ea9('0x8a')][_0x5ea9('0x49')]);_0x1f4a9b[_0x5ea9('0x4f')]=_[_0x5ea9('0x4e')](_0x2a7455[_0x5ea9('0x4f')]);_0x1f4a9b[_0x5ea9('0x50')]=_[_0x5ea9('0x51')](_0x1f4a9b[_0x5ea9('0x4d')],_0x1f4a9b['query']);_0x373893[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x1f4a9b['model'],qs[_0x5ea9('0x53')](_0x2a7455['query'][_0x5ea9('0x53')]));_0x373893[_0x5ea9('0x52')]=_0x373893['attributes']['length']?_0x373893['attributes']:_0x1f4a9b[_0x5ea9('0x4d')];_0x373893[_0x5ea9('0x57')]=qs[_0x5ea9('0x58')](_0x2a7455[_0x5ea9('0x4f')][_0x5ea9('0x58')]);_0x373893['where']=qs[_0x5ea9('0x50')](_[_0x5ea9('0x59')](_0x2a7455[_0x5ea9('0x4f')],_0x1f4a9b[_0x5ea9('0x50')]));if(_0x2a7455[_0x5ea9('0x4f')][_0x5ea9('0x5c')]){_0x373893[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x373893[_0x5ea9('0x5a')],{'$or':_[_0x5ea9('0x48')](_0x373893['attributes'],function(_0x122062){var _0x221d0a={};_0x221d0a[_0x122062]={'$like':'%'+_0x2a7455[_0x5ea9('0x4f')][_0x5ea9('0x5c')]+'%'};return _0x221d0a;})});}_0x373893=_[_0x5ea9('0x5b')]({},_0x373893,_0x2a7455['options']);return _0x61f7c8[_0x5ea9('0xbe')](_0x373893);}})[_0x5ea9('0x26')](function(_0x3fb97f){if(_0x3fb97f){_0x2c9408=_0x3fb97f['length'];if(!_0x2a7455[_0x5ea9('0x4f')][_0x5ea9('0x55')](_0x5ea9('0x56'))){_0x373893[_0x5ea9('0x23')]=qs[_0x5ea9('0x23')](_0x2a7455[_0x5ea9('0x4f')][_0x5ea9('0x23')]);_0x373893['offset']=qs[_0x5ea9('0x20')](_0x2a7455[_0x5ea9('0x4f')][_0x5ea9('0x20')]);}return _0x61f7c8[_0x5ea9('0xbe')](_0x373893);}})[_0x5ea9('0x26')](function(_0x2f06bf){if(_0x2f06bf){return _0x2f06bf?{'count':_0x2c9408,'rows':_0x2f06bf}:null;}})[_0x5ea9('0x26')](respondWithResult(_0x33eae0,null))[_0x5ea9('0x1b')](handleError(_0x33eae0,null));}; \ No newline at end of file +var _0xb1be=['socket.io-emitter','jayson/promise','http','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','offset','set','Content-Range','update','destroy','get','MailAccounts','end','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','pass','password','modernAuthentication','CloudProviderId','port','host','service','authentication','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','params','find','body','custom','provider','secure','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','addAnswer','pick','CannedAnswer','removeAnswers','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','MailInteraction','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','format','MailMessage','inlineCss','true','CmList','List','Contacts','updatedAt','CloudProvider','from','%s\x20<%s>','attachments','root','server/files/attachments','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','subject','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','VerifySmtp','addAgents','omit','removeAgents','emit','getAgents','User','bluebird','util','path','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x34b011,_0xbd807b){var _0x2f5175=function(_0x40bcf0){while(--_0x40bcf0){_0x34b011['push'](_0x34b011['shift']());}};_0x2f5175(++_0xbd807b);}(_0xb1be,0xb1));var _0xeb1b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1be[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var BPromise=require(_0xeb1b('0x0'));var util=require(_0xeb1b('0x1'));var path=require(_0xeb1b('0x2'));var _=require('lodash');var juice=require(_0xeb1b('0x3'));var Redis=require(_0xeb1b('0x4'));var qs=require(_0xeb1b('0x5'));var logger=require(_0xeb1b('0x6'))(_0xeb1b('0x7'));var config=require(_0xeb1b('0x8'));var db=require(_0xeb1b('0x9'))['db'];config[_0xeb1b('0xa')]=_[_0xeb1b('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xeb1b('0xc'))(new Redis(config[_0xeb1b('0xa')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0xeb1b('0xd'));var client=jayson['client'][_0xeb1b('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x2e4157,_0x58645b,_0x289616,_0x2794c8){return new BPromise(function(_0x5a69ed,_0x3797f6){var _0x49b014=_0x2794c8||client;return _0x49b014[_0xeb1b('0xf')](_0x2e4157,_0x289616)[_0xeb1b('0x10')](function(_0x3c6216){logger[_0xeb1b('0x11')]('MailAccount,\x20%s,\x20%s',_0x58645b,_0xeb1b('0x12'));logger['debug'](_0xeb1b('0x13'),_0x58645b,'request\x20sent',JSON[_0xeb1b('0x14')](_0x3c6216));if(_0x3c6216[_0xeb1b('0x15')]){if(_0x3c6216['error'][_0xeb1b('0x16')]===0x1f4){logger[_0xeb1b('0x15')](_0xeb1b('0x17'),_0x58645b,_0x3c6216[_0xeb1b('0x15')][_0xeb1b('0x18')]);return _0x3797f6(_0x3c6216[_0xeb1b('0x15')][_0xeb1b('0x18')]);}logger[_0xeb1b('0x15')](_0xeb1b('0x17'),_0x58645b,_0x3c6216['error'][_0xeb1b('0x18')]);return _0x5a69ed(_0x3c6216['error'][_0xeb1b('0x18')]);}else{logger[_0xeb1b('0x11')](_0xeb1b('0x17'),_0x58645b,'request\x20sent');_0x5a69ed(_0x3c6216[_0xeb1b('0x19')][_0xeb1b('0x18')]);}})[_0xeb1b('0x1a')](function(_0xc232cb){logger[_0xeb1b('0x15')](_0xeb1b('0x17'),_0x58645b,_0xc232cb);_0x3797f6(_0xc232cb);});});}function respondWithStatusCode(_0x4ca137,_0x132d81){_0x132d81=_0x132d81||0xcc;return function(_0x1eaf50){if(_0x1eaf50){return _0x4ca137[_0xeb1b('0x1b')](_0x132d81);}return _0x4ca137[_0xeb1b('0x1c')](_0x132d81)['end']();};}function respondWithResult(_0x343245,_0x5712ce){_0x5712ce=_0x5712ce||0xc8;return function(_0x2a3161){if(_0x2a3161){return _0x343245[_0xeb1b('0x1c')](_0x5712ce)[_0xeb1b('0x1d')](_0x2a3161);}};}function respondWithFilteredResult(_0x29ac19,_0x239ddb){return function(_0xa386e6){if(_0xa386e6){var _0x353f2f=typeof _0x239ddb['offset']===_0xeb1b('0x1e')&&typeof _0x239ddb[_0xeb1b('0x1f')]===_0xeb1b('0x1e');var _0x583c08=_0xa386e6['count'];var _0x427dd9=_0x353f2f?0x0:_0x239ddb[_0xeb1b('0x20')];var _0x4a4b0b=_0x353f2f?_0xa386e6['count']:_0x239ddb[_0xeb1b('0x20')]+_0x239ddb[_0xeb1b('0x1f')];var _0x15bfbd;if(_0x4a4b0b>=_0x583c08){_0x4a4b0b=_0x583c08;_0x15bfbd=0xc8;}else{_0x15bfbd=0xce;}_0x29ac19[_0xeb1b('0x1c')](_0x15bfbd);return _0x29ac19[_0xeb1b('0x21')](_0xeb1b('0x22'),_0x427dd9+'-'+_0x4a4b0b+'/'+_0x583c08)['json'](_0xa386e6);}return null;};}function saveUpdates(_0x499a34){return function(_0x45e632){if(_0x45e632){return _0x45e632[_0xeb1b('0x23')](_0x499a34)[_0xeb1b('0x10')](function(_0x5dd739){return _0x5dd739;});}return null;};}function removeEntity(_0x2c010b){return function(_0x13a8f0){if(_0x13a8f0){return _0x13a8f0[_0xeb1b('0x24')]()['then'](function(){var _0x1e7aa0=_0x13a8f0[_0xeb1b('0x25')]({'plain':!![]});var _0x56ba10=_0xeb1b('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x56ba10,'resourceId':_0x1e7aa0['id']}})['then'](function(){return _0x13a8f0;});})['then'](function(){_0x2c010b[_0xeb1b('0x1c')](0xcc)[_0xeb1b('0x27')]();});}};}function handleEntityNotFound(_0x22a4af){return function(_0x5df414){if(!_0x5df414){_0x22a4af['sendStatus'](0x194);}return _0x5df414;};}function handleError(_0x501265,_0x529116){_0x529116=_0x529116||0x1f4;return function(_0xfe8dbf){logger[_0xeb1b('0x15')](_0xfe8dbf[_0xeb1b('0x28')]);if(_0xfe8dbf[_0xeb1b('0x29')]){delete _0xfe8dbf[_0xeb1b('0x29')];}_0x501265[_0xeb1b('0x1c')](_0x529116)[_0xeb1b('0x2a')](_0xfe8dbf);};}function getImapHost(_0x5d0c50){switch(_0x5d0c50){case _0xeb1b('0x2b'):return _0xeb1b('0x2c');case _0xeb1b('0x2d'):return'imap.mail.yahoo.com';case _0xeb1b('0x2e'):return _0xeb1b('0x2f');case _0xeb1b('0x30'):return'outlook.office365.com';}throw new Error(_0xeb1b('0x31'),_0x5d0c50);}function getSmtpHost(_0x4bf660){switch(_0x4bf660){case _0xeb1b('0x2b'):return _0xeb1b('0x32');case'yahoo':return _0xeb1b('0x33');case _0xeb1b('0x2e'):return _0xeb1b('0x34');case _0xeb1b('0x30'):return _0xeb1b('0x35');}throw new Error(_0xeb1b('0x31'),_0x4bf660);}function getAuthenticationOptions(_0x9dfd8a,_0x260861){var _0x13309d={};var _0x41b838={};if(_0x9dfd8a){_0x13309d['user']=_0x41b838[_0xeb1b('0x36')]=_0x260861['username'];_0x13309d['password']=_0x41b838[_0xeb1b('0x37')]=_0x260861[_0xeb1b('0x38')];if(_0x260861[_0xeb1b('0x39')]){_0x13309d[_0xeb1b('0x39')]=_0x41b838[_0xeb1b('0x39')]=!![];_0x13309d[_0xeb1b('0x3a')]=_0x41b838['CloudProviderId']=_0x260861[_0xeb1b('0x3a')];_0x13309d[_0xeb1b('0x38')]=_0x41b838[_0xeb1b('0x37')]=null;}else{_0x13309d[_0xeb1b('0x3a')]=_0x41b838[_0xeb1b('0x3a')]=null;}_0x13309d['host']=getImapHost(_0x9dfd8a);_0x13309d[_0xeb1b('0x3b')]=0x3e1;_0x41b838[_0xeb1b('0x3c')]=getSmtpHost(_0x9dfd8a);_0x41b838[_0xeb1b('0x3b')]=0x24b;_0x41b838['secure']=![];_0x13309d[_0xeb1b('0x3d')]=_0x41b838[_0xeb1b('0x3d')]=null;}else{if(_0x260861[_0xeb1b('0x3e')]){_0x13309d['user']=_0x41b838[_0xeb1b('0x36')]=_0x260861['username'];_0x13309d[_0xeb1b('0x38')]=_0x41b838[_0xeb1b('0x37')]=_0x260861[_0xeb1b('0x38')];}else{_0x13309d[_0xeb1b('0x3e')]=_0x41b838[_0xeb1b('0x3e')]=![];_0x13309d['user']=_0x41b838[_0xeb1b('0x36')]=null;_0x13309d[_0xeb1b('0x38')]=_0x41b838['pass']=null;}_0x13309d['host']=_0x260861[_0xeb1b('0x3f')][_0xeb1b('0x3c')];_0x13309d[_0xeb1b('0x3b')]=_0x260861[_0xeb1b('0x3f')]['port'];_0x41b838[_0xeb1b('0x3c')]=_0x260861[_0xeb1b('0x40')][_0xeb1b('0x3c')];_0x41b838[_0xeb1b('0x3b')]=_0x260861[_0xeb1b('0x40')][_0xeb1b('0x3b')];}return{'Imap':_0x13309d,'Smtp':_0x41b838};}exports['index']=function(_0x45f664,_0x4bdc25){var _0xbd8175={'include':[{'model':db[_0xeb1b('0x41')],'as':_0xeb1b('0x3f')},{'model':db[_0xeb1b('0x42')],'as':_0xeb1b('0x40')},{'model':db[_0xeb1b('0x43')],'as':_0xeb1b('0x44')}]},_0x5421a2={},_0x3528bb={'count':0x0,'rows':[]};var _0x41882e=_[_0xeb1b('0x45')](db[_0xeb1b('0x46')][_0xeb1b('0x47')],function(_0x50b49e){return{'name':_0x50b49e['fieldName'],'type':_0x50b49e['type']['key']};});_0x5421a2['model']=_[_0xeb1b('0x45')](_0x41882e,_0xeb1b('0x29'));_0x5421a2['query']=_[_0xeb1b('0x48')](_0x45f664[_0xeb1b('0x49')]);_0x5421a2['filters']=_[_0xeb1b('0x4a')](_0x5421a2[_0xeb1b('0x4b')],_0x5421a2[_0xeb1b('0x49')]);_0xbd8175[_0xeb1b('0x4c')]=_[_0xeb1b('0x4a')](_0x5421a2[_0xeb1b('0x4b')],qs['fields'](_0x45f664[_0xeb1b('0x49')][_0xeb1b('0x4d')]));_0xbd8175[_0xeb1b('0x4c')]=_0xbd8175[_0xeb1b('0x4c')][_0xeb1b('0x4e')]?_0xbd8175[_0xeb1b('0x4c')]:_0x5421a2[_0xeb1b('0x4b')];if(!_0x45f664[_0xeb1b('0x49')][_0xeb1b('0x4f')](_0xeb1b('0x50'))){_0xbd8175[_0xeb1b('0x1f')]=qs[_0xeb1b('0x1f')](_0x45f664[_0xeb1b('0x49')][_0xeb1b('0x1f')]);_0xbd8175[_0xeb1b('0x20')]=qs[_0xeb1b('0x20')](_0x45f664[_0xeb1b('0x49')][_0xeb1b('0x20')]);}_0xbd8175[_0xeb1b('0x51')]=qs[_0xeb1b('0x52')](_0x45f664[_0xeb1b('0x49')][_0xeb1b('0x52')]);_0xbd8175[_0xeb1b('0x53')]=qs[_0xeb1b('0x54')](_['pick'](_0x45f664[_0xeb1b('0x49')],_0x5421a2[_0xeb1b('0x54')]),_0x41882e);if(_0x45f664[_0xeb1b('0x49')][_0xeb1b('0x55')]){_0xbd8175[_0xeb1b('0x53')]=_[_0xeb1b('0x56')](_0xbd8175[_0xeb1b('0x53')],{'$or':_[_0xeb1b('0x45')](_0x41882e,function(_0x5c7312){if(_0x5c7312[_0xeb1b('0x57')]!==_0xeb1b('0x58')){var _0x5f5556={};_0x5f5556[_0x5c7312[_0xeb1b('0x29')]]={'$like':'%'+_0x45f664[_0xeb1b('0x49')]['filter']+'%'};return _0x5f5556;}})});}_0xbd8175=_[_0xeb1b('0x56')]({},_0xbd8175,_0x45f664[_0xeb1b('0x59')]);var _0xb1838e={'where':_0xbd8175[_0xeb1b('0x53')]};return db[_0xeb1b('0x46')][_0xeb1b('0x5a')](_0xb1838e)[_0xeb1b('0x10')](function(_0x29c4fb){_0x3528bb[_0xeb1b('0x5a')]=_0x29c4fb;if(_0x45f664['query'][_0xeb1b('0x5b')]){_0xbd8175[_0xeb1b('0x5c')]=[{'all':!![]}];}return db['MailAccount'][_0xeb1b('0x5d')](_0xbd8175);})[_0xeb1b('0x10')](function(_0xcf410b){_0x3528bb[_0xeb1b('0x5e')]=_0xcf410b;return _0x3528bb;})[_0xeb1b('0x10')](respondWithFilteredResult(_0x4bdc25,_0xbd8175))[_0xeb1b('0x1a')](handleError(_0x4bdc25,null));};exports['show']=function(_0x5a1693,_0x1ee40b){var _0x58894e={'raw':![],'where':{'id':_0x5a1693[_0xeb1b('0x5f')]['id']},'include':[{'model':db[_0xeb1b('0x41')],'as':_0xeb1b('0x3f')},{'model':db[_0xeb1b('0x42')],'as':_0xeb1b('0x40')},{'model':db[_0xeb1b('0x43')],'as':_0xeb1b('0x44')}]},_0x2a9a90={};_0x2a9a90[_0xeb1b('0x4b')]=_[_0xeb1b('0x48')](db['MailAccount'][_0xeb1b('0x47')]);_0x2a9a90[_0xeb1b('0x49')]=_[_0xeb1b('0x48')](_0x5a1693[_0xeb1b('0x49')]);_0x2a9a90['filters']=_[_0xeb1b('0x4a')](_0x2a9a90[_0xeb1b('0x4b')],_0x2a9a90[_0xeb1b('0x49')]);_0x58894e['attributes']=_[_0xeb1b('0x4a')](_0x2a9a90[_0xeb1b('0x4b')],qs[_0xeb1b('0x4d')](_0x5a1693[_0xeb1b('0x49')]['fields']));_0x58894e['attributes']=_0x58894e[_0xeb1b('0x4c')][_0xeb1b('0x4e')]?_0x58894e[_0xeb1b('0x4c')]:_0x2a9a90[_0xeb1b('0x4b')];if(_0x5a1693[_0xeb1b('0x49')]['includeAll']){_0x58894e['include']=[{'all':!![]}];}_0x58894e=_[_0xeb1b('0x56')]({},_0x58894e,_0x5a1693[_0xeb1b('0x59')]);return db['MailAccount'][_0xeb1b('0x60')](_0x58894e)[_0xeb1b('0x10')](handleEntityNotFound(_0x1ee40b,null))[_0xeb1b('0x10')](respondWithResult(_0x1ee40b,null))[_0xeb1b('0x1a')](handleError(_0x1ee40b,null));};exports[_0xeb1b('0x23')]=function(_0x37ec30,_0x405448){if(_0x37ec30[_0xeb1b('0x61')]['id']){delete _0x37ec30['body']['id'];}var _0x158894=_0x37ec30[_0xeb1b('0x61')]['provider']===_0xeb1b('0x62')?null:_0x37ec30[_0xeb1b('0x61')][_0xeb1b('0x63')];var _0x2cd874=_0x37ec30[_0xeb1b('0x61')][_0xeb1b('0x3f')]||{};var _0x562acb=_0x37ec30['body']['Smtp']||{};if(_0x158894){_0x2cd874[_0xeb1b('0x3c')]=getImapHost(_0x158894);_0x2cd874[_0xeb1b('0x3b')]=0x3e1;_0x562acb[_0xeb1b('0x3c')]=getSmtpHost(_0x158894);_0x562acb[_0xeb1b('0x3b')]=0x24b;_0x562acb['secure']=![];}if(_0x562acb[_0xeb1b('0x39')]){_0x562acb[_0xeb1b('0x64')]=![];}else{_0x562acb[_0xeb1b('0x3a')]=null;}if(!_0x2cd874[_0xeb1b('0x39')])_0x2cd874[_0xeb1b('0x3a')]=null;_0x37ec30[_0xeb1b('0x61')][_0xeb1b('0x3f')]=_0x2cd874;_0x37ec30[_0xeb1b('0x61')][_0xeb1b('0x40')]=_0x562acb;return db[_0xeb1b('0x46')][_0xeb1b('0x60')]({'where':{'id':_0x37ec30[_0xeb1b('0x5f')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xeb1b('0x42')],'as':_0xeb1b('0x40')},{'model':db['Pause'],'as':_0xeb1b('0x44')}]})[_0xeb1b('0x10')](handleEntityNotFound(_0x405448,null))['then'](function(_0x45b1ff){if(!_0x45b1ff)throw new Error(_0xeb1b('0x65'));if(_0x45b1ff[_0xeb1b('0x3d')])delete _0x37ec30[_0xeb1b('0x61')][_0xeb1b('0x3f')];return _0x45b1ff;})[_0xeb1b('0x10')](saveUpdates(_0x37ec30['body'],null))[_0xeb1b('0x10')](function(_0x530508){if(!_0x37ec30['body'][_0xeb1b('0x3f')])return _0x530508;return db[_0xeb1b('0x41')][_0xeb1b('0x23')](_0x37ec30['body']['Imap'],{'where':{'MailAccountId':_0x530508['id']}})['then'](function(){return _0x530508;});})[_0xeb1b('0x10')](function(_0x35470d){if(!_0x37ec30[_0xeb1b('0x61')][_0xeb1b('0x40')])return _0x35470d;return db[_0xeb1b('0x42')][_0xeb1b('0x23')](_0x37ec30[_0xeb1b('0x61')][_0xeb1b('0x40')],{'where':{'MailAccountId':_0x35470d['id']}})['then'](function(){return _0x35470d;});})[_0xeb1b('0x10')](respondWithResult(_0x405448,null))['catch'](handleError(_0x405448,null));};exports['describe']=function(_0x297c02,_0x589bb1){return db['MailAccount'][_0xeb1b('0x66')]()[_0xeb1b('0x10')](respondWithResult(_0x589bb1,null))[_0xeb1b('0x1a')](handleError(_0x589bb1,null));};exports[_0xeb1b('0x67')]=function(_0x114263,_0x26fe31){if(_0x114263[_0xeb1b('0x61')]['id']){delete _0x114263[_0xeb1b('0x61')]['id'];}return db['MailAccount'][_0xeb1b('0x60')]({'where':{'id':_0x114263[_0xeb1b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x26fe31,null))[_0xeb1b('0x10')](function(_0x40e42a){if(_0x40e42a){_0x114263[_0xeb1b('0x61')][_0xeb1b('0x68')]=_0x40e42a['id'];return db[_0xeb1b('0x69')][_0xeb1b('0x6a')](_0x114263[_0xeb1b('0x61')]);}})[_0xeb1b('0x10')](respondWithResult(_0x26fe31,null))['catch'](handleError(_0x26fe31,null));};exports[_0xeb1b('0x6b')]=function(_0x207238,_0x295774){var _0x3d470e={'raw':![],'where':{}};var _0x174fc3={};var _0x29d4f0={'count':0x0,'rows':[]};return db[_0xeb1b('0x46')][_0xeb1b('0x6c')]({'where':{'id':_0x207238[_0xeb1b('0x5f')]['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x295774,null))[_0xeb1b('0x10')](function(_0x89f492){if(_0x89f492){_0x174fc3[_0xeb1b('0x4b')]=_['keys'](db[_0xeb1b('0x69')][_0xeb1b('0x47')]);_0x174fc3[_0xeb1b('0x49')]=_[_0xeb1b('0x48')](_0x207238[_0xeb1b('0x49')]);_0x174fc3['filters']=_[_0xeb1b('0x4a')](_0x174fc3[_0xeb1b('0x4b')],_0x174fc3['query']);_0x3d470e[_0xeb1b('0x4c')]=_[_0xeb1b('0x4a')](_0x174fc3[_0xeb1b('0x4b')],qs[_0xeb1b('0x4d')](_0x207238['query'][_0xeb1b('0x4d')]));_0x3d470e[_0xeb1b('0x4c')]=_0x3d470e[_0xeb1b('0x4c')][_0xeb1b('0x4e')]?_0x3d470e[_0xeb1b('0x4c')]:_0x174fc3[_0xeb1b('0x4b')];if(!_0x207238[_0xeb1b('0x49')]['hasOwnProperty'](_0xeb1b('0x50'))){_0x3d470e[_0xeb1b('0x1f')]=qs[_0xeb1b('0x1f')](_0x207238[_0xeb1b('0x49')][_0xeb1b('0x1f')]);_0x3d470e['offset']=qs[_0xeb1b('0x20')](_0x207238[_0xeb1b('0x49')]['offset']);}_0x3d470e[_0xeb1b('0x51')]=qs[_0xeb1b('0x52')](_0x207238[_0xeb1b('0x49')][_0xeb1b('0x52')]);_0x3d470e['where']=qs[_0xeb1b('0x54')](_['pick'](_0x207238[_0xeb1b('0x49')],_0x174fc3[_0xeb1b('0x54')]));_0x3d470e[_0xeb1b('0x53')][_0xeb1b('0x68')]=_0x89f492['id'];if(_0x207238[_0xeb1b('0x49')][_0xeb1b('0x55')]){_0x3d470e[_0xeb1b('0x53')]=_[_0xeb1b('0x56')](_0x3d470e[_0xeb1b('0x53')],{'$or':_['map'](_0x3d470e[_0xeb1b('0x4c')],function(_0x4ea454){var _0x1e536d={};_0x1e536d[_0x4ea454]={'$like':'%'+_0x207238['query']['filter']+'%'};return _0x1e536d;})});}_0x3d470e=_[_0xeb1b('0x56')]({},_0x3d470e,_0x207238[_0xeb1b('0x59')]);return db['Disposition'][_0xeb1b('0x5a')]({'where':_0x3d470e['where']})['then'](function(_0x3acdf5){_0x29d4f0[_0xeb1b('0x5a')]=_0x3acdf5;if(_0x207238[_0xeb1b('0x49')][_0xeb1b('0x5b')]){_0x3d470e[_0xeb1b('0x5c')]=[{'all':!![]}];}return db[_0xeb1b('0x69')][_0xeb1b('0x5d')](_0x3d470e);})[_0xeb1b('0x10')](function(_0x226425){_0x29d4f0[_0xeb1b('0x5e')]=_0x226425;return _0x29d4f0;});}})['then'](respondWithFilteredResult(_0x295774,_0x3d470e))[_0xeb1b('0x1a')](handleError(_0x295774,null));};exports['removeDispositions']=function(_0x451ba5,_0x57dcc6){return db[_0xeb1b('0x46')][_0xeb1b('0x60')]({'where':{'id':_0x451ba5[_0xeb1b('0x5f')]['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x57dcc6,null))[_0xeb1b('0x10')](function(_0x189a1b){if(_0x189a1b){return _0x189a1b[_0xeb1b('0x6d')](_0x451ba5['query'][_0xeb1b('0x6e')]);}})[_0xeb1b('0x10')](respondWithStatusCode(_0x57dcc6,null))[_0xeb1b('0x1a')](handleError(_0x57dcc6,null));};exports[_0xeb1b('0x6f')]=function(_0x2bb375,_0x46ea71){if(_0x2bb375['body']['id']){delete _0x2bb375[_0xeb1b('0x61')]['id'];}return db[_0xeb1b('0x46')]['find']({'where':{'id':_0x2bb375[_0xeb1b('0x5f')]['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x46ea71,null))[_0xeb1b('0x10')](function(_0x293f5c){if(_0x293f5c){_0x2bb375[_0xeb1b('0x61')][_0xeb1b('0x68')]=_0x293f5c['id'];return db['CannedAnswer'][_0xeb1b('0x6a')](_0x2bb375['body']);}})[_0xeb1b('0x10')](respondWithResult(_0x46ea71,null))[_0xeb1b('0x1a')](handleError(_0x46ea71,null));};exports['getAnswers']=function(_0x345522,_0x1aae8f){var _0x31eb56={'raw':![],'where':{}};var _0x275dbd={};var _0x2cbf37={'count':0x0,'rows':[]};return db['MailAccount'][_0xeb1b('0x6c')]({'where':{'id':_0x345522['params']['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x1aae8f,null))[_0xeb1b('0x10')](function(_0x58f080){if(_0x58f080){_0x275dbd['model']=_[_0xeb1b('0x48')](db['CannedAnswer'][_0xeb1b('0x47')]);_0x275dbd[_0xeb1b('0x49')]=_[_0xeb1b('0x48')](_0x345522[_0xeb1b('0x49')]);_0x275dbd[_0xeb1b('0x54')]=_['intersection'](_0x275dbd[_0xeb1b('0x4b')],_0x275dbd['query']);_0x31eb56[_0xeb1b('0x4c')]=_['intersection'](_0x275dbd[_0xeb1b('0x4b')],qs[_0xeb1b('0x4d')](_0x345522[_0xeb1b('0x49')][_0xeb1b('0x4d')]));_0x31eb56[_0xeb1b('0x4c')]=_0x31eb56[_0xeb1b('0x4c')][_0xeb1b('0x4e')]?_0x31eb56[_0xeb1b('0x4c')]:_0x275dbd[_0xeb1b('0x4b')];if(!_0x345522['query'][_0xeb1b('0x4f')]('nolimit')){_0x31eb56[_0xeb1b('0x1f')]=qs[_0xeb1b('0x1f')](_0x345522['query']['limit']);_0x31eb56[_0xeb1b('0x20')]=qs[_0xeb1b('0x20')](_0x345522[_0xeb1b('0x49')][_0xeb1b('0x20')]);}_0x31eb56[_0xeb1b('0x51')]=qs[_0xeb1b('0x52')](_0x345522[_0xeb1b('0x49')]['sort']);_0x31eb56[_0xeb1b('0x53')]=qs['filters'](_[_0xeb1b('0x70')](_0x345522[_0xeb1b('0x49')],_0x275dbd[_0xeb1b('0x54')]));_0x31eb56[_0xeb1b('0x53')][_0xeb1b('0x68')]=_0x58f080['id'];if(_0x345522[_0xeb1b('0x49')][_0xeb1b('0x55')]){_0x31eb56[_0xeb1b('0x53')]=_['merge'](_0x31eb56[_0xeb1b('0x53')],{'$or':_['map'](_0x31eb56[_0xeb1b('0x4c')],function(_0x35d283){var _0x32480f={};_0x32480f[_0x35d283]={'$like':'%'+_0x345522[_0xeb1b('0x49')][_0xeb1b('0x55')]+'%'};return _0x32480f;})});}_0x31eb56=_[_0xeb1b('0x56')]({},_0x31eb56,_0x345522['options']);return db[_0xeb1b('0x71')]['count']({'where':_0x31eb56[_0xeb1b('0x53')]})[_0xeb1b('0x10')](function(_0x39bbc6){_0x2cbf37[_0xeb1b('0x5a')]=_0x39bbc6;if(_0x345522[_0xeb1b('0x49')][_0xeb1b('0x5b')]){_0x31eb56[_0xeb1b('0x5c')]=[{'all':!![]}];}return db['CannedAnswer'][_0xeb1b('0x5d')](_0x31eb56);})[_0xeb1b('0x10')](function(_0x5db47e){_0x2cbf37[_0xeb1b('0x5e')]=_0x5db47e;return _0x2cbf37;});}})[_0xeb1b('0x10')](respondWithFilteredResult(_0x1aae8f,_0x31eb56))['catch'](handleError(_0x1aae8f,null));};exports[_0xeb1b('0x72')]=function(_0x145bef,_0x5052ff){return db[_0xeb1b('0x46')][_0xeb1b('0x60')]({'where':{'id':_0x145bef[_0xeb1b('0x5f')]['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x5052ff,null))[_0xeb1b('0x10')](function(_0x521f4a){if(_0x521f4a){return _0x521f4a[_0xeb1b('0x72')](_0x145bef[_0xeb1b('0x49')][_0xeb1b('0x6e')]);}})[_0xeb1b('0x10')](respondWithStatusCode(_0x5052ff,null))['catch'](handleError(_0x5052ff,null));};exports[_0xeb1b('0x6a')]=function(_0x2afacc,_0x2322cc){var _0x5c7492={'name':_0x2afacc['body'][_0xeb1b('0x29')],'key':_0x2afacc['body']['key'],'provider':_0x2afacc['body'][_0xeb1b('0x63')]===_0xeb1b('0x62')?null:_0x2afacc[_0xeb1b('0x61')]['provider'],'email':_0x2afacc[_0xeb1b('0x61')][_0xeb1b('0x73')],'ListId':_0x2afacc['body'][_0xeb1b('0x74')],'active':!_[_0xeb1b('0x75')](_0x2afacc[_0xeb1b('0x61')][_0xeb1b('0x76')])?_0x2afacc[_0xeb1b('0x61')][_0xeb1b('0x76')]:!![],'description':_0x2afacc['body'][_0xeb1b('0x77')]||null};var _0x17e66e=getAuthenticationOptions(_0x5c7492[_0xeb1b('0x63')],_0x2afacc[_0xeb1b('0x61')]);_0x5c7492['Imap']=_0x17e66e[_0xeb1b('0x3f')];_0x5c7492[_0xeb1b('0x40')]=_0x17e66e[_0xeb1b('0x40')];return db[_0xeb1b('0x46')][_0xeb1b('0x6a')](_0x5c7492,{'include':[{'model':db['MailServerOut'],'as':_0xeb1b('0x40')},{'model':db[_0xeb1b('0x41')],'as':'Imap'}]})['then'](function(_0x12e0f0){var _0x35f308=_0x2afacc[_0xeb1b('0x36')][_0xeb1b('0x25')]({'plain':!![]});if(!_0x35f308)throw new Error(_0xeb1b('0x78'));if(_0x35f308[_0xeb1b('0x79')]==='user'){var _0xc247d4=_0x12e0f0[_0xeb1b('0x25')]({'plain':!![]});return db[_0xeb1b('0x7a')][_0xeb1b('0x60')]({'where':{'name':'MailAccounts','userProfileId':_0x35f308[_0xeb1b('0x7b')]},'raw':!![]})[_0xeb1b('0x10')](function(_0x565f95){if(_0x565f95&&_0x565f95[_0xeb1b('0x7c')]===0x0){return db[_0xeb1b('0x7d')][_0xeb1b('0x6a')]({'name':_0xc247d4[_0xeb1b('0x29')],'resourceId':_0xc247d4['id'],'type':_0x565f95[_0xeb1b('0x29')],'sectionId':_0x565f95['id']},{})[_0xeb1b('0x10')](function(){return _0x12e0f0;});}else{return _0x12e0f0;}})[_0xeb1b('0x1a')](function(_0x4965e6){logger[_0xeb1b('0x15')](_0xeb1b('0x7e'),_0x4965e6);throw _0x4965e6;});}return _0x12e0f0;})['then'](respondWithResult(_0x2322cc,0xc9))['catch'](handleError(_0x2322cc,null));};exports['getImap']=function(_0x1ca3a8,_0x43dbff){return db['MailAccount'][_0xeb1b('0x6c')]({'where':{'id':_0x1ca3a8[_0xeb1b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x43dbff,null))[_0xeb1b('0x10')](function(_0x1c8a4d){if(_0x1c8a4d){return _0x1c8a4d[_0xeb1b('0x7f')]();}return null;})[_0xeb1b('0x10')](respondWithResult(_0x43dbff,null))['catch'](handleError(_0x43dbff,null));};exports[_0xeb1b('0x80')]=function(_0xda07dd,_0x16cfd6){if(_0xda07dd[_0xeb1b('0x61')]['id']){delete _0xda07dd[_0xeb1b('0x61')]['id'];}return db[_0xeb1b('0x46')][_0xeb1b('0x60')]({'where':{'id':_0xda07dd['params']['id']}})['then'](handleEntityNotFound(_0x16cfd6,null))[_0xeb1b('0x10')](function(_0x247eb5){if(_0x247eb5){_0xda07dd[_0xeb1b('0x61')][_0xeb1b('0x68')]=_0x247eb5['id'];return db[_0xeb1b('0x41')]['create'](_0xda07dd[_0xeb1b('0x61')]);}})['then'](respondWithResult(_0x16cfd6,null))[_0xeb1b('0x1a')](handleError(_0x16cfd6,null));};exports[_0xeb1b('0x81')]=function(_0x14da2d,_0x442797){return db['MailAccount'][_0xeb1b('0x6c')]({'where':{'id':_0x14da2d['params']['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x442797,null))[_0xeb1b('0x10')](function(_0x17303e){if(_0x17303e){return _0x17303e[_0xeb1b('0x82')](null);}return null;})[_0xeb1b('0x10')](respondWithStatusCode(_0x442797,null))['catch'](handleError(_0x442797,null));};exports[_0xeb1b('0x83')]=function(_0x36a3d5,_0x2688b8){return db[_0xeb1b('0x46')]['findOne']({'where':{'id':_0x36a3d5[_0xeb1b('0x5f')]['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x2688b8,null))['then'](function(_0x3b5b59){if(_0x3b5b59){return _0x3b5b59['getSmtp']();}return null;})[_0xeb1b('0x10')](respondWithResult(_0x2688b8,null))[_0xeb1b('0x1a')](handleError(_0x2688b8,null));};exports['addSmtp']=function(_0x31b839,_0x5ea751){if(_0x31b839[_0xeb1b('0x61')]['id']){delete _0x31b839[_0xeb1b('0x61')]['id'];}return db['MailAccount'][_0xeb1b('0x60')]({'where':{'id':_0x31b839['params']['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x5ea751,null))[_0xeb1b('0x10')](function(_0x5e6d6a){if(_0x5e6d6a){_0x31b839[_0xeb1b('0x61')][_0xeb1b('0x68')]=_0x5e6d6a['id'];return db[_0xeb1b('0x42')][_0xeb1b('0x6a')](_0x31b839['body']);}})[_0xeb1b('0x10')](respondWithResult(_0x5ea751,null))[_0xeb1b('0x1a')](handleError(_0x5ea751,null));};exports[_0xeb1b('0x84')]=function(_0xc2814c,_0x4a38b8){return db[_0xeb1b('0x46')]['findOne']({'where':{'id':_0xc2814c[_0xeb1b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4a38b8,null))['then'](function(_0x3b3363){if(_0x3b3363){return _0x3b3363['setSmtp'](null);}return null;})[_0xeb1b('0x10')](respondWithStatusCode(_0x4a38b8,null))['catch'](handleError(_0x4a38b8,null));};exports['addInteraction']=function(_0x3a1fbd,_0xa2bbfe){return db[_0xeb1b('0x85')][_0xeb1b('0x60')]({'where':{'id':_0x3a1fbd[_0xeb1b('0x5f')]['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0xa2bbfe,null))[_0xeb1b('0x10')](function(_0x25743e){if(_0x25743e){return _0x25743e['addInteraction'](_0x3a1fbd[_0xeb1b('0x61')][_0xeb1b('0x6e')],_['omit'](_0x3a1fbd[_0xeb1b('0x61')],[_0xeb1b('0x6e'),'id'])||{});}})[_0xeb1b('0x10')](respondWithResult(_0xa2bbfe,null))[_0xeb1b('0x1a')](handleError(_0xa2bbfe,null));};exports[_0xeb1b('0x86')]=function(_0x494c25,_0x1f2bb0){var _0x50fa6d={'raw':![],'where':{}};var _0x5076eb={};var _0x3cc833={'count':0x0,'rows':[]};return db[_0xeb1b('0x46')][_0xeb1b('0x6c')]({'where':{'id':_0x494c25[_0xeb1b('0x5f')]['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x1f2bb0,null))[_0xeb1b('0x10')](function(_0x36db07){if(_0x36db07){_0x5076eb[_0xeb1b('0x4b')]=_['keys'](db[_0xeb1b('0x85')][_0xeb1b('0x47')]);_0x5076eb[_0xeb1b('0x49')]=_['keys'](_0x494c25[_0xeb1b('0x49')]);_0x5076eb[_0xeb1b('0x54')]=_[_0xeb1b('0x4a')](_0x5076eb[_0xeb1b('0x4b')],_0x5076eb['query']);_0x50fa6d[_0xeb1b('0x4c')]=_['intersection'](_0x5076eb[_0xeb1b('0x4b')],qs[_0xeb1b('0x4d')](_0x494c25['query'][_0xeb1b('0x4d')]));_0x50fa6d[_0xeb1b('0x4c')]=_0x50fa6d['attributes'][_0xeb1b('0x4e')]?_0x50fa6d[_0xeb1b('0x4c')]:_0x5076eb[_0xeb1b('0x4b')];if(!_0x494c25['query']['hasOwnProperty'](_0xeb1b('0x50'))){_0x50fa6d['limit']=qs[_0xeb1b('0x1f')](_0x494c25['query'][_0xeb1b('0x1f')]);_0x50fa6d['offset']=qs[_0xeb1b('0x20')](_0x494c25[_0xeb1b('0x49')][_0xeb1b('0x20')]);}_0x50fa6d[_0xeb1b('0x51')]=qs[_0xeb1b('0x52')](_0x494c25[_0xeb1b('0x49')][_0xeb1b('0x52')]);_0x50fa6d[_0xeb1b('0x53')]=qs[_0xeb1b('0x54')](_[_0xeb1b('0x70')](_0x494c25['query'],_0x5076eb['filters']));_0x50fa6d[_0xeb1b('0x53')][_0xeb1b('0x68')]=_0x36db07['id'];if(_0x494c25[_0xeb1b('0x49')]['filter']){_0x50fa6d[_0xeb1b('0x53')]=_['merge'](_0x50fa6d['where'],{'$or':_[_0xeb1b('0x45')](_0x50fa6d[_0xeb1b('0x4c')],function(_0x5359ab){var _0x319f50={};_0x319f50[_0x5359ab]={'$like':'%'+_0x494c25[_0xeb1b('0x49')][_0xeb1b('0x55')]+'%'};return _0x319f50;})});}_0x50fa6d=_['merge']({},_0x50fa6d,_0x494c25['options']);return db[_0xeb1b('0x85')]['count']({'where':_0x50fa6d[_0xeb1b('0x53')]})[_0xeb1b('0x10')](function(_0xd1826c){_0x3cc833[_0xeb1b('0x5a')]=_0xd1826c;if(_0x494c25[_0xeb1b('0x49')][_0xeb1b('0x5b')]){_0x50fa6d['include']=[{'model':db[_0xeb1b('0x87')],'as':_0xeb1b('0x88'),'required':![]},{'model':db['User'],'as':_0xeb1b('0x89'),'attributes':[_0xeb1b('0x29'),_0xeb1b('0x8a'),_0xeb1b('0x8b')],'required':![]},{'model':db[_0xeb1b('0x8c')],'as':_0xeb1b('0x8d'),'attributes':['id',_0xeb1b('0x29'),'color'],'where':_0x494c25['query'][_0xeb1b('0x8e')]?{'id':_0x494c25['query'][_0xeb1b('0x8e')]}:undefined,'required':_0x494c25['query'][_0xeb1b('0x8e')]?!![]:![]}];}return db[_0xeb1b('0x85')]['findAll'](_0x50fa6d);})[_0xeb1b('0x10')](function(_0x2de46a){_0x3cc833[_0xeb1b('0x5e')]=_0x2de46a;return _0x3cc833;});}})[_0xeb1b('0x10')](respondWithFilteredResult(_0x1f2bb0,_0x50fa6d))['catch'](handleError(_0x1f2bb0,null));};exports[_0xeb1b('0x8f')]=function addApplications(_0x3096f6,_0x190b6c){var _0x564580=_0x3096f6[_0xeb1b('0x5f')]['id'];var _0x521689=_0x3096f6[_0xeb1b('0x61')];var _0x412eee=0xc8;var _0x5e11f0=null;return db[_0xeb1b('0x90')][_0xeb1b('0x91')]({'isolationLevel':db['sequelize']['Transaction'][_0xeb1b('0x92')][_0xeb1b('0x93')]},function(_0x3ed7f0){return db[_0xeb1b('0x46')][_0xeb1b('0x6c')]({'where':{'id':_0x564580},'transaction':_0x3ed7f0})[_0xeb1b('0x10')](function(_0x52c18d){if(_0x52c18d){return db[_0xeb1b('0x94')][_0xeb1b('0x24')]({'where':{'MailAccountId':_0x564580},'transaction':_0x3ed7f0})['then'](function(){var _0xb2c453=_[_0xeb1b('0x45')](_0x521689,function(_0x14222d){_0x14222d[_0xeb1b('0x68')]=_0x564580;return _0x14222d;});return db['MailApplication'][_0xeb1b('0x95')](_0xb2c453,{'transaction':_0x3ed7f0});});}else{_0x412eee=0x194;_0x5e11f0=[];}});})[_0xeb1b('0x10')](function(){if(_0x412eee!==0x194){return db['MailApplication'][_0xeb1b('0x96')]({'where':{'MailAccountId':_0x564580},'order':_0xeb1b('0x97')})[_0xeb1b('0x10')](function(_0x4bde7f){_0x5e11f0=_0x4bde7f;});}})[_0xeb1b('0x1a')](function(_0x11cee6){_0x412eee=0x1f4;logger[_0xeb1b('0x15')](_0x11cee6[_0xeb1b('0x28')]);if(_0x11cee6[_0xeb1b('0x29')]){delete _0x11cee6[_0xeb1b('0x29')];}_0x5e11f0=_0x11cee6;})[_0xeb1b('0x98')](function(){if(_0x5e11f0===null){_0x190b6c[_0xeb1b('0x1b')](_0x412eee);}else{if(_0x412eee===0x1f4){_0x190b6c['status'](_0x412eee)[_0xeb1b('0x2a')](_0x5e11f0);}else{_0x190b6c[_0xeb1b('0x1c')](_0x412eee)['json'](_0x5e11f0);}}});};exports[_0xeb1b('0x99')]=function(_0x299117,_0x554b47){var _0x549f2a={};var _0x186faf={};var _0x46f9b5;var _0x534fe2;return db[_0xeb1b('0x46')][_0xeb1b('0x6c')]({'where':{'id':_0x299117['params']['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x554b47,null))['then'](function(_0x4f1df1){if(_0x4f1df1){_0x46f9b5=_0x4f1df1;_0x186faf[_0xeb1b('0x4b')]=_['keys'](db[_0xeb1b('0x94')]['rawAttributes']);_0x186faf[_0xeb1b('0x49')]=_[_0xeb1b('0x48')](_0x299117[_0xeb1b('0x49')]);_0x186faf[_0xeb1b('0x54')]=_['intersection'](_0x186faf['model'],_0x186faf['query']);_0x549f2a['attributes']=_[_0xeb1b('0x4a')](_0x186faf[_0xeb1b('0x4b')],qs[_0xeb1b('0x4d')](_0x299117[_0xeb1b('0x49')][_0xeb1b('0x4d')]));_0x549f2a[_0xeb1b('0x4c')]=_0x549f2a[_0xeb1b('0x4c')][_0xeb1b('0x4e')]?_0x549f2a[_0xeb1b('0x4c')]:_0x186faf[_0xeb1b('0x4b')];_0x549f2a[_0xeb1b('0x51')]=qs[_0xeb1b('0x52')](_0x299117[_0xeb1b('0x49')][_0xeb1b('0x52')]);_0x549f2a[_0xeb1b('0x53')]=qs[_0xeb1b('0x54')](_[_0xeb1b('0x70')](_0x299117[_0xeb1b('0x49')],_0x186faf['filters']));if(_0x299117['query'][_0xeb1b('0x55')]){_0x549f2a[_0xeb1b('0x53')]=_['merge'](_0x549f2a[_0xeb1b('0x53')],{'$or':_[_0xeb1b('0x45')](_0x549f2a['attributes'],function(_0x435f4d){var _0x460aba={};_0x460aba[_0x435f4d]={'$like':'%'+_0x299117['query'][_0xeb1b('0x55')]+'%'};return _0x460aba;})});}_0x549f2a=_[_0xeb1b('0x56')]({},_0x549f2a,_0x299117[_0xeb1b('0x59')]);return _0x46f9b5[_0xeb1b('0x99')](_0x549f2a);}})[_0xeb1b('0x10')](function(_0x1164bf){if(_0x1164bf){_0x534fe2=_0x1164bf[_0xeb1b('0x4e')];if(!_0x299117['query'][_0xeb1b('0x4f')](_0xeb1b('0x50'))){_0x549f2a[_0xeb1b('0x1f')]=qs['limit'](_0x299117[_0xeb1b('0x49')][_0xeb1b('0x1f')]);_0x549f2a[_0xeb1b('0x20')]=qs[_0xeb1b('0x20')](_0x299117['query'][_0xeb1b('0x20')]);}return _0x46f9b5['getApplications'](_0x549f2a);}})[_0xeb1b('0x10')](function(_0x2e7c67){if(_0x2e7c67){return _0x2e7c67?{'count':_0x534fe2,'rows':_0x2e7c67}:null;}})[_0xeb1b('0x10')](respondWithResult(_0x554b47,null))[_0xeb1b('0x1a')](handleError(_0x554b47,null));};exports[_0xeb1b('0x9a')]=function(_0x3e718a,_0x438c08){var _0x191dee={'raw':!![],'where':{}};var _0x412892={};var _0x326544={'count':0x0,'rows':[]};return db[_0xeb1b('0x46')]['findOne']({'where':{'id':_0x3e718a[_0xeb1b('0x5f')]['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x438c08,null))[_0xeb1b('0x10')](function(_0x1c80f7){if(_0x1c80f7){_0x412892[_0xeb1b('0x4b')]=_[_0xeb1b('0x48')](db['MailMessage']['rawAttributes']);_0x412892[_0xeb1b('0x49')]=_[_0xeb1b('0x48')](_0x3e718a[_0xeb1b('0x49')]);_0x412892[_0xeb1b('0x54')]=_['intersection'](_0x412892[_0xeb1b('0x4b')],_0x412892[_0xeb1b('0x49')]);_0x191dee['attributes']=_[_0xeb1b('0x4a')](_0x412892['model'],qs[_0xeb1b('0x4d')](_0x3e718a[_0xeb1b('0x49')][_0xeb1b('0x4d')]));_0x191dee[_0xeb1b('0x4c')]=_0x191dee[_0xeb1b('0x4c')][_0xeb1b('0x4e')]?_0x191dee['attributes']:_0x412892['model'];if(!_0x3e718a[_0xeb1b('0x49')][_0xeb1b('0x4f')](_0xeb1b('0x50'))){_0x191dee['limit']=qs[_0xeb1b('0x1f')](_0x3e718a['query']['limit']);_0x191dee[_0xeb1b('0x20')]=qs[_0xeb1b('0x20')](_0x3e718a[_0xeb1b('0x49')]['offset']);}_0x191dee[_0xeb1b('0x51')]=qs[_0xeb1b('0x52')](_0x3e718a[_0xeb1b('0x49')][_0xeb1b('0x52')]);_0x191dee[_0xeb1b('0x53')]=qs[_0xeb1b('0x54')](_[_0xeb1b('0x70')](_0x3e718a[_0xeb1b('0x49')],_0x412892[_0xeb1b('0x54')]));_0x191dee[_0xeb1b('0x53')][_0xeb1b('0x68')]=_0x1c80f7['id'];if(_0x3e718a['query']['filter']){_0x191dee[_0xeb1b('0x53')]=_[_0xeb1b('0x56')](_0x191dee['where'],{'$or':_[_0xeb1b('0x45')](_0x191dee[_0xeb1b('0x4c')],function(_0x32494d){var _0x39a08d={};_0x39a08d[_0x32494d]={'$like':'%'+_0x3e718a[_0xeb1b('0x49')][_0xeb1b('0x55')]+'%'};return _0x39a08d;})});}if(_0x3e718a[_0xeb1b('0x49')][_0xeb1b('0x9b')]){var _0x51909d=_0x3e718a[_0xeb1b('0x49')][_0xeb1b('0x9b')][_0xeb1b('0x9c')](',');var _0x1959cb={};_0x1959cb[_0x51909d[0x0]]={'$gte':moment(_0x51909d[0x1])[_0xeb1b('0x9d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x191dee['where']=_[_0xeb1b('0x56')](_0x191dee['where'],_0x1959cb);}_0x191dee=_[_0xeb1b('0x56')]({},_0x191dee,_0x3e718a[_0xeb1b('0x59')]);return db[_0xeb1b('0x9e')][_0xeb1b('0x5a')]({'where':_0x191dee[_0xeb1b('0x53')]})[_0xeb1b('0x10')](function(_0xc1fe24){_0x326544['count']=_0xc1fe24;if(_0x3e718a[_0xeb1b('0x49')][_0xeb1b('0x5b')]){_0x191dee[_0xeb1b('0x5c')]=[{'all':!![]}];}return db[_0xeb1b('0x9e')][_0xeb1b('0x5d')](_0x191dee);})[_0xeb1b('0x10')](function(_0x5ddbcd){if(_0x3e718a[_0xeb1b('0x49')][_0xeb1b('0x9f')]===_0xeb1b('0xa0')){for(var _0x2237ea=0x0;_0x2237ea<_0x5ddbcd[_0xeb1b('0x4e')];_0x2237ea++){_0x5ddbcd[_0x2237ea]['body']=juice(_0x5ddbcd[_0x2237ea][_0xeb1b('0x61')]);}}_0x326544[_0xeb1b('0x5e')]=_0x5ddbcd;return _0x326544;});}})['then'](respondWithFilteredResult(_0x438c08,_0x191dee))[_0xeb1b('0x1a')](handleError(_0x438c08,null));};exports[_0xeb1b('0x2a')]=function(_0x186c01,_0x4ff5fa){var _0x291aeb,_0x5a98b2={},_0x37bf4a;if(_0x186c01[_0xeb1b('0x61')]['to']){_0x37bf4a=_0x186c01['body']['to'][_0xeb1b('0x9c')](',')[0x0];}return db[_0xeb1b('0x46')][_0xeb1b('0x60')]({'where':{'id':_0x186c01[_0xeb1b('0x5f')]['id']},'include':[{'model':db[_0xeb1b('0xa1')],'as':_0xeb1b('0xa2'),'include':[{'model':db[_0xeb1b('0x87')],'as':_0xeb1b('0xa3'),'where':{'email':_0x37bf4a},'limit':0x1,'order':[[_0xeb1b('0xa4'),'DESC']]}]},{'model':db[_0xeb1b('0x42')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xeb1b('0xa5')],'as':_0xeb1b('0xa5'),'raw':!![]}]}]})[_0xeb1b('0x10')](handleEntityNotFound(_0x4ff5fa,null))[_0xeb1b('0x10')](function(_0x2bab8e){if(!_0x2bab8e)return;_0x291aeb=_0x2bab8e;if(!_0x2bab8e[_0xeb1b('0x40')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0xeb1b('0x75')](_0x186c01['body'][_0xeb1b('0xa6')])){_0x186c01[_0xeb1b('0x61')][_0xeb1b('0xa6')]=util[_0xeb1b('0x9d')](_0xeb1b('0xa7'),_0x2bab8e[_0xeb1b('0x29')],_0x2bab8e[_0xeb1b('0x73')]||_0x2bab8e[_0xeb1b('0x40')]['user']);}if(_0x186c01['body'][_0xeb1b('0xa8')]&&_0x186c01[_0xeb1b('0x61')]['attachments'][_0xeb1b('0x4e')]){for(var _0x1c1aaa=0x0;_0x1c1aaa<_0x186c01['body']['attachments'][_0xeb1b('0x4e')];_0x1c1aaa+=0x1){_0x186c01['body'][_0xeb1b('0xa8')][_0x1c1aaa]={'filename':_0x186c01[_0xeb1b('0x61')][_0xeb1b('0xa8')][_0x1c1aaa][_0xeb1b('0x29')],'path':path['join'](config[_0xeb1b('0xa9')],_0xeb1b('0xaa'),_0x186c01[_0xeb1b('0x61')]['attachments'][_0x1c1aaa]['basename'])};}}var _0x477e04=_0x2bab8e[_0xeb1b('0xab')]();return respondWithRpcPromise(_0xeb1b('0xac'),_0xeb1b('0xad'),{'account':_0x477e04,'message':_0x186c01[_0xeb1b('0x61')]});})[_0xeb1b('0x10')](function(_0x110f8a){if(!_0x110f8a)return;_0x5a98b2=_0x110f8a;if(!_0x291aeb['List'])throw new Error(_0xeb1b('0xae'));if(_0x291aeb['List'][_0xeb1b('0xa3')][_0xeb1b('0x4e')])return _0x291aeb[_0xeb1b('0xa2')][_0xeb1b('0xa3')][0x0];return db['CmContact']['create'](_['defaults'](_0x186c01[_0xeb1b('0x61')],{'firstName':_0x186c01[_0xeb1b('0x61')]['to'],'email':_0x186c01['body']['to'],'phone':_0x186c01[_0xeb1b('0x61')]['to'],'ListId':_0x291aeb[_0xeb1b('0x74')]}));})[_0xeb1b('0x10')](function(_0x50f308){if(!_0x50f308)return;var _0x3a3cd3={'UserId':_0x186c01['user']['id'],'ContactId':_0x50f308['id'],'MailAccountId':_0x291aeb['id'],'inReplyTo':_0x5a98b2[_0xeb1b('0xaf')],'to':_0x186c01[_0xeb1b('0x61')][_0xeb1b('0xa6')],'cc':_0x186c01['body']['cc'],'subject':_0x186c01[_0xeb1b('0x61')][_0xeb1b('0xb0')],'attach':_0x186c01[_0xeb1b('0x61')]['attach'],'firstMsgDirection':_0xeb1b('0xb1'),'lastMsgAt':moment()[_0xeb1b('0x9d')](_0xeb1b('0xb2')),'lastMsgDirection':_0xeb1b('0xb1'),'Messages':[_[_0xeb1b('0x56')](_0x186c01[_0xeb1b('0x61')],{'messageId':_0x5a98b2['messageId'],'sentAt':moment()[_0xeb1b('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x291aeb['id'],'UserId':_0x186c01[_0xeb1b('0x36')]['id'],'ContactId':_0x50f308['id']})]};if(_0x186c01['body'][_0xeb1b('0xb3')]){_0x3a3cd3=_[_0xeb1b('0x56')](_0x3a3cd3,_0x186c01[_0xeb1b('0x61')]['Interaction']);}return db[_0xeb1b('0x85')][_0xeb1b('0x6a')](_0x3a3cd3,{'include':[{'model':db[_0xeb1b('0x9e')],'as':_0xeb1b('0xb4')}]});})[_0xeb1b('0x10')](respondWithResult(_0x4ff5fa,null))[_0xeb1b('0x1a')](handleError(_0x4ff5fa,null));};exports[_0xeb1b('0xb5')]=function(_0x309465,_0x2987bf){return db[_0xeb1b('0x46')][_0xeb1b('0x60')]({'where':{'id':_0x309465['params']['id']},'include':[{'model':db[_0xeb1b('0x42')],'as':_0xeb1b('0x40'),'raw':!![],'include':[{'model':db[_0xeb1b('0xa5')],'as':_0xeb1b('0xa5'),'raw':!![]}]}]})[_0xeb1b('0x10')](handleEntityNotFound(_0x2987bf,null))['then'](function(_0x5e660b){if(!_0x5e660b['Smtp'])return;var _0x14f048=_0x5e660b[_0xeb1b('0xab')]();return respondWithRpcPromise(_0xeb1b('0xb6'),'verifySmtp',{'account':_0x14f048});})['then'](respondWithResult(_0x2987bf,null))[_0xeb1b('0x1a')](handleError(_0x2987bf,null));};exports['destroy']=function(_0x5f81b6,_0x39cc18){return db[_0xeb1b('0x46')][_0xeb1b('0x60')]({'where':{'id':_0x5f81b6[_0xeb1b('0x5f')]['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x39cc18,null))['then'](function(_0x3e660d){if(_0x3e660d&&_0x3e660d[_0xeb1b('0x3d')]){throw new db['Sequelize']['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x3e660d;})[_0xeb1b('0x10')](removeEntity(_0x39cc18,null))['catch'](handleError(_0x39cc18,null));};exports[_0xeb1b('0xb7')]=function(_0x27ceb7,_0x55cd59){return db[_0xeb1b('0x46')][_0xeb1b('0x60')]({'where':{'id':_0x27ceb7[_0xeb1b('0x5f')]['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x55cd59,null))[_0xeb1b('0x10')](function(_0x3ba708){if(_0x3ba708){return _0x3ba708[_0xeb1b('0xb7')](_0x27ceb7[_0xeb1b('0x61')][_0xeb1b('0x6e')],_[_0xeb1b('0xb8')](_0x27ceb7[_0xeb1b('0x61')],[_0xeb1b('0x6e'),'id'])||{})['spread'](function(_0x29affd){for(var _0x331315=0x0;_0x331315<_0x27ceb7[_0xeb1b('0x61')]['ids']['length'];_0x331315+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x27ceb7[_0xeb1b('0x61')]['ids'][_0x331315]),'MailAccountId':Number(_0x27ceb7[_0xeb1b('0x5f')]['id'])});}return _0x29affd;});}})['then'](respondWithResult(_0x55cd59,null))[_0xeb1b('0x1a')](handleError(_0x55cd59,null));};exports['removeAgents']=function(_0xfa3fcd,_0x155baa){return db[_0xeb1b('0x46')]['find']({'where':{'id':_0xfa3fcd[_0xeb1b('0x5f')]['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x155baa,null))[_0xeb1b('0x10')](function(_0x363dd8){if(_0x363dd8){return _0x363dd8[_0xeb1b('0xb9')](_0xfa3fcd['query'][_0xeb1b('0x6e')])[_0xeb1b('0x10')](function(){if(_['isArray'](_0xfa3fcd['query'][_0xeb1b('0x6e')])){for(var _0xe1d938=0x0;_0xe1d938<_0xfa3fcd[_0xeb1b('0x49')][_0xeb1b('0x6e')][_0xeb1b('0x4e')];_0xe1d938+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0xfa3fcd['query'][_0xeb1b('0x6e')][_0xe1d938]),'MailAccountId':Number(_0xfa3fcd[_0xeb1b('0x5f')]['id'])});}}else{socket[_0xeb1b('0xba')]('userMailAccount:remove',{'UserId':Number(_0xfa3fcd[_0xeb1b('0x49')]['ids']),'MailAccountId':Number(_0xfa3fcd[_0xeb1b('0x5f')]['id'])});}});}})[_0xeb1b('0x10')](respondWithStatusCode(_0x155baa,null))[_0xeb1b('0x1a')](handleError(_0x155baa,null));};exports[_0xeb1b('0xbb')]=function(_0x1aaff5,_0x679d2a){var _0x289070={};var _0x3cf332={};var _0x59952f;var _0x5b984f;return db['MailAccount'][_0xeb1b('0x6c')]({'where':{'id':_0x1aaff5[_0xeb1b('0x5f')]['id']}})[_0xeb1b('0x10')](handleEntityNotFound(_0x679d2a,null))[_0xeb1b('0x10')](function(_0x337243){if(_0x337243){_0x59952f=_0x337243;_0x3cf332['model']=_[_0xeb1b('0x48')](db[_0xeb1b('0xbc')]['rawAttributes']);_0x3cf332['query']=_[_0xeb1b('0x48')](_0x1aaff5['query']);_0x3cf332[_0xeb1b('0x54')]=_['intersection'](_0x3cf332['model'],_0x3cf332['query']);_0x289070['attributes']=_[_0xeb1b('0x4a')](_0x3cf332[_0xeb1b('0x4b')],qs[_0xeb1b('0x4d')](_0x1aaff5[_0xeb1b('0x49')]['fields']));_0x289070[_0xeb1b('0x4c')]=_0x289070[_0xeb1b('0x4c')][_0xeb1b('0x4e')]?_0x289070[_0xeb1b('0x4c')]:_0x3cf332[_0xeb1b('0x4b')];_0x289070[_0xeb1b('0x51')]=qs[_0xeb1b('0x52')](_0x1aaff5[_0xeb1b('0x49')][_0xeb1b('0x52')]);_0x289070[_0xeb1b('0x53')]=qs[_0xeb1b('0x54')](_[_0xeb1b('0x70')](_0x1aaff5[_0xeb1b('0x49')],_0x3cf332[_0xeb1b('0x54')]));if(_0x1aaff5[_0xeb1b('0x49')][_0xeb1b('0x55')]){_0x289070[_0xeb1b('0x53')]=_[_0xeb1b('0x56')](_0x289070[_0xeb1b('0x53')],{'$or':_[_0xeb1b('0x45')](_0x289070[_0xeb1b('0x4c')],function(_0x3a7c65){var _0x201cf4={};_0x201cf4[_0x3a7c65]={'$like':'%'+_0x1aaff5[_0xeb1b('0x49')][_0xeb1b('0x55')]+'%'};return _0x201cf4;})});}_0x289070=_[_0xeb1b('0x56')]({},_0x289070,_0x1aaff5[_0xeb1b('0x59')]);return _0x59952f[_0xeb1b('0xbb')](_0x289070);}})[_0xeb1b('0x10')](function(_0x5c0bc2){if(_0x5c0bc2){_0x5b984f=_0x5c0bc2[_0xeb1b('0x4e')];if(!_0x1aaff5['query'][_0xeb1b('0x4f')](_0xeb1b('0x50'))){_0x289070[_0xeb1b('0x1f')]=qs[_0xeb1b('0x1f')](_0x1aaff5[_0xeb1b('0x49')][_0xeb1b('0x1f')]);_0x289070[_0xeb1b('0x20')]=qs[_0xeb1b('0x20')](_0x1aaff5[_0xeb1b('0x49')][_0xeb1b('0x20')]);}return _0x59952f['getAgents'](_0x289070);}})[_0xeb1b('0x10')](function(_0x325f0b){if(_0x325f0b){return _0x325f0b?{'count':_0x5b984f,'rows':_0x325f0b}:null;}})['then'](respondWithResult(_0x679d2a,null))[_0xeb1b('0x1a')](handleError(_0x679d2a,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index c2b0deb..247835d 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 _0xbd36=['hook','exports','events','../../mysqldb','MailAccount','update','remove','emit','hasOwnProperty'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0xbd36,0x65));var _0x6bd3=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xbd36[_0x2dea24];return _0x309d58;};'use strict';var EventEmitter=require(_0x6bd3('0x0'));var MailAccount=require(_0x6bd3('0x1'))['db'][_0x6bd3('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6bd3('0x3'),'afterDestroy':_0x6bd3('0x4')};function emitEvent(_0x513e89){return function(_0x3b2956,_0xa0380,_0x31143d){MailAccountEvents[_0x6bd3('0x5')](_0x513e89+':'+_0x3b2956['id'],_0x3b2956);MailAccountEvents['emit'](_0x513e89,_0x3b2956);_0x31143d(null);};}for(var e in events){if(events[_0x6bd3('0x6')](e)){var event=events[e];MailAccount[_0x6bd3('0x7')](e,emitEvent(event));}}module[_0x6bd3('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x565e=['MailAccount','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x3e4a56,_0x2cf0b0){var _0x3bb1b2=function(_0x1b933c){while(--_0x1b933c){_0x3e4a56['push'](_0x3e4a56['shift']());}};_0x3bb1b2(++_0x2cf0b0);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xe565('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xe565('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe565('0x2')](0x0);var events={'afterCreate':_0xe565('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x42e589){return function(_0x33fd83,_0x14f472,_0x1b6e64){MailAccountEvents[_0xe565('0x4')](_0x42e589+':'+_0x33fd83['id'],_0x33fd83);MailAccountEvents[_0xe565('0x4')](_0x42e589,_0x33fd83);_0x1b6e64(null);};}for(var e in events){if(events[_0xe565('0x5')](e)){var event=events[e];MailAccount[_0xe565('0x6')](e,emitEvent(event));}}module[_0xe565('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 08a74a0..fb264de 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 _0xb5f2=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','host','Smtp','port','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','pass'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xb5f2,0x1ba));var _0x2b5f=function(_0x1b82ec,_0x3788ed){_0x1b82ec=_0x1b82ec-0x0;var _0x1ecfff=_0xb5f2[_0x1b82ec];return _0x1ecfff;};'use strict';var attributes=require(_0x2b5f('0x0'));module[_0x2b5f('0x1')]=function(_0x5dc9df){return _0x5dc9df[_0x2b5f('0x2')](_0x2b5f('0x3'),attributes,{'tableName':_0x2b5f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5c209f=this;var _0xa7d2a9={'id':_0x5c209f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5c209f[_0x2b5f('0x5')]!=='custom'){_0xa7d2a9['service']=_0x5c209f[_0x2b5f('0x5')];}else{_0xa7d2a9[_0x2b5f('0x6')]=_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0x6')];_0xa7d2a9[_0x2b5f('0x8')]=_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0x8')];_0xa7d2a9[_0x2b5f('0x9')]=_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0x9')];}if(_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0xa')]){if(_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0xb')]){if(!_0x5c209f[_0x2b5f('0x7')]['CloudProvider'])throw new Error(_0x2b5f('0xc'));_0xa7d2a9[_0x2b5f('0xd')]={'type':'OAuth2','user':_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0xe')],'accessToken':_0x5c209f[_0x2b5f('0x7')]['CloudProvider'][_0x2b5f('0xf')]};}else{_0xa7d2a9['auth']={'user':_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0xe')],'pass':_0x5c209f['Smtp'][_0x2b5f('0x10')]};}}return _0xa7d2a9;}}});}; \ No newline at end of file +var _0x47ef=['auth','OAuth2','user','data5','pass','./mailAccount.attributes','exports','MailAccount','provider','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found'];(function(_0xbebee7,_0x3fccca){var _0x1e5242=function(_0x5c259c){while(--_0x5c259c){_0xbebee7['push'](_0xbebee7['shift']());}};_0x1e5242(++_0x3fccca);}(_0x47ef,0x15b));var _0xf47e=function(_0x1b7ddb,_0x2bd622){_0x1b7ddb=_0x1b7ddb-0x0;var _0x31a891=_0x47ef[_0x1b7ddb];return _0x31a891;};'use strict';var attributes=require(_0xf47e('0x0'));module[_0xf47e('0x1')]=function(_0x49b756){return _0x49b756['define'](_0xf47e('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5203aa=this;var _0xf24ed7={'id':_0x5203aa['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5203aa[_0xf47e('0x3')]!=='custom'){_0xf24ed7[_0xf47e('0x4')]=_0x5203aa[_0xf47e('0x3')];}else{_0xf24ed7[_0xf47e('0x5')]=_0x5203aa[_0xf47e('0x6')]['host'];_0xf24ed7[_0xf47e('0x7')]=_0x5203aa[_0xf47e('0x6')]['port'];_0xf24ed7[_0xf47e('0x8')]=_0x5203aa[_0xf47e('0x6')][_0xf47e('0x8')];}if(_0x5203aa[_0xf47e('0x6')][_0xf47e('0x9')]){if(_0x5203aa[_0xf47e('0x6')][_0xf47e('0xa')]){if(!_0x5203aa[_0xf47e('0x6')][_0xf47e('0xb')])throw new Error(_0xf47e('0xc'));_0xf24ed7[_0xf47e('0xd')]={'type':_0xf47e('0xe'),'user':_0x5203aa[_0xf47e('0x6')][_0xf47e('0xf')],'accessToken':_0x5203aa[_0xf47e('0x6')][_0xf47e('0xb')][_0xf47e('0x10')]};}else{_0xf24ed7[_0xf47e('0xd')]={'user':_0x5203aa['Smtp']['user'],'pass':_0x5203aa[_0xf47e('0x6')][_0xf47e('0x11')]};}}return _0xf24ed7;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 1c9d738..d8f1ca0 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 _0xbd51=['message','info','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','model','map','catch','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','List','get','omit','account','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','defaults','from','create','List\x20not\x20found','contact','messageId','generate','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inReplyTo','Contact\x20not\x20found','update','subject','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','waitForTheAssignedAgent','queueId','unshift','queue','waitForTheAssignedQueue','Start','lodash','bluebird','randomstring','ioredis','../../mysqldb','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x470940,_0x3a6afd){_0x470940=_0x470940-0x0;var _0x58b1df=_0xbd51[_0x470940];return _0x58b1df;};'use strict';var _=require(_0x1bd5('0x0'));var moment=require('moment');var BPromise=require(_0x1bd5('0x1'));var rs=require(_0x1bd5('0x2'));var Redis=require(_0x1bd5('0x3'));var db=require(_0x1bd5('0x4'))['db'];var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1bd5('0x5')][_0x1bd5('0x6')]({'port':0x232c});config[_0x1bd5('0x7')]=_['defaults'](config[_0x1bd5('0x7')],{'host':_0x1bd5('0x8'),'port':0x18eb});var socket=require(_0x1bd5('0x9'))(new Redis(config[_0x1bd5('0x7')]));require(_0x1bd5('0xa'))['register'](socket);function respondWithRpcPromise(_0x36ef1a,_0x5c8e0d,_0x2bd975){return new BPromise(function(_0x28df8e,_0x3b868a){return client[_0x1bd5('0xb')](_0x36ef1a,_0x2bd975)[_0x1bd5('0xc')](function(_0x3e3d06){logger['info'](_0x1bd5('0xd'),_0x5c8e0d,'request\x20sent');logger[_0x1bd5('0xe')](_0x1bd5('0xf'),_0x5c8e0d,_0x1bd5('0x10'),JSON[_0x1bd5('0x11')](_0x3e3d06));if(_0x3e3d06[_0x1bd5('0x12')]){if(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x13')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x5c8e0d,_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);return _0x3b868a(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5c8e0d,_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);return _0x28df8e(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);}else{logger[_0x1bd5('0x15')](_0x1bd5('0xd'),_0x5c8e0d,_0x1bd5('0x10'));_0x28df8e(_0x3e3d06[_0x1bd5('0x16')][_0x1bd5('0x14')]);}})['catch'](function(_0x53ad5e){logger[_0x1bd5('0x12')](_0x1bd5('0xd'),_0x5c8e0d,_0x53ad5e);_0x3b868a(_0x53ad5e);});});}exports[_0x1bd5('0x17')]=function(_0xb95d4e){var _0x459649=this;return new Promise(function(_0x2ff39a,_0x3fbb39){return db[_0x1bd5('0x18')][_0x1bd5('0x19')]({'raw':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1b')]===undefined?!![]:![]:!![],'where':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1c')]||null:null,'attributes':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1d')]||null:null,'limit':_0xb95d4e['options']?_0xb95d4e[_0x1bd5('0x1a')]['limit']||null:null,'include':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1e')]?_['map'](_0xb95d4e[_0x1bd5('0x1a')]['include'],function(_0x2ed551){return{'model':db[_0x2ed551[_0x1bd5('0x1f')]],'as':_0x2ed551['as'],'attributes':_0x2ed551[_0x1bd5('0x1d')],'include':_0x2ed551[_0x1bd5('0x1e')]?_['map'](_0x2ed551[_0x1bd5('0x1e')],function(_0x69bb17){return{'model':db[_0x69bb17[_0x1bd5('0x1f')]],'as':_0x69bb17['as'],'attributes':_0x69bb17[_0x1bd5('0x1d')],'include':_0x69bb17['include']?_[_0x1bd5('0x20')](_0x69bb17[_0x1bd5('0x1e')],function(_0x3595e9){return{'model':db[_0x3595e9[_0x1bd5('0x1f')]],'as':_0x3595e9['as'],'attributes':_0x3595e9[_0x1bd5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1bd5('0xc')](function(_0x4e72b2){logger[_0x1bd5('0x15')](_0x1bd5('0x17'),_0xb95d4e);logger[_0x1bd5('0xe')]('GetMailAccount',_0xb95d4e,JSON[_0x1bd5('0x11')](_0x4e72b2));_0x2ff39a(_0x4e72b2);})[_0x1bd5('0x21')](function(_0x345181){logger[_0x1bd5('0x12')](_0x1bd5('0x17'),_0x345181[_0x1bd5('0x14')],_0xb95d4e);_0x3fbb39(_0x459649['error'](0x1f4,_0x345181['message']));});});};exports[_0x1bd5('0x22')]=function(_0x305126){var _0x5542aa=this;return new Promise(function(_0x36649d,_0x198b88){return db[_0x1bd5('0x18')][_0x1bd5('0x23')]({'raw':_0x305126['options']?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1b')]===undefined?!![]:![]:!![],'where':_0x305126[_0x1bd5('0x1a')]?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1c')]||null:null,'attributes':_0x305126[_0x1bd5('0x1a')]?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1d')]||null:null,'include':_0x305126['options']?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1e')]?_[_0x1bd5('0x20')](_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1e')],function(_0x18a9db){return{'model':db[_0x18a9db[_0x1bd5('0x1f')]],'as':_0x18a9db['as'],'attributes':_0x18a9db['attributes'],'include':_0x18a9db[_0x1bd5('0x1e')]?_[_0x1bd5('0x20')](_0x18a9db[_0x1bd5('0x1e')],function(_0x2f5a48){return{'model':db[_0x2f5a48[_0x1bd5('0x1f')]],'as':_0x2f5a48['as'],'attributes':_0x2f5a48[_0x1bd5('0x1d')],'include':_0x2f5a48[_0x1bd5('0x1e')]?_['map'](_0x2f5a48['include'],function(_0x155e4c){return{'model':db[_0x155e4c[_0x1bd5('0x1f')]],'as':_0x155e4c['as'],'attributes':_0x155e4c[_0x1bd5('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4595a0){if(_0x305126['options'][_0x1bd5('0x24')]===!![])_0x4595a0[_0x1bd5('0x25')](_0x1bd5('0x26'),_0x4595a0[_0x1bd5('0x27')]());logger[_0x1bd5('0x15')](_0x1bd5('0x22'),_0x305126);logger[_0x1bd5('0xe')](_0x1bd5('0x22'),_0x305126,JSON['stringify'](_0x4595a0));_0x36649d(_0x4595a0);})[_0x1bd5('0x21')](function(_0x2978d8){logger['error'](_0x1bd5('0x22'),_0x2978d8[_0x1bd5('0x14')],_0x305126);_0x198b88(_0x5542aa[_0x1bd5('0x12')](0x1f4,_0x2978d8['message']));});});};exports[_0x1bd5('0x28')]=function(_0x53482){var _0x2997a2=this;return new Promise(function(_0x4074f1,_0x4e8ff7){var _0x305720={'body':_0x53482[_0x1bd5('0x29')],'channel':_0x1bd5('0x2a')};var _0x11e996=_['difference'](_['keys'](db[_0x1bd5('0x2b')][_0x1bd5('0x2c')]),[_0x1bd5('0x2d'),'updatedAt',_0x1bd5('0x2e'),_0x1bd5('0x2f')]);var _0x574d95=![];if(_0x53482[_0x1bd5('0x29')]['id']){delete _0x53482['body']['id'];}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')]['from'])){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x31')));}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')])||_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')]===''){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x32')));}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')][_0x1bd5('0x33')])){return _0x4e8ff7(_0x2997a2['error'](0x1f4,_0x1bd5('0x34')+_0x11e996));}if(!_[_0x1bd5('0x35')](_0x11e996,_0x53482[_0x1bd5('0x29')]['mapKey'])){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x36')+_0x11e996));}var _0x5bb8a6={};_0x5bb8a6[_0x53482[_0x1bd5('0x29')]['mapKey']]=_0x53482[_0x1bd5('0x29')]['from'];return db[_0x1bd5('0x18')][_0x1bd5('0x23')]({'where':{'id':_0x53482['account']['id']},'include':[{'model':db[_0x1bd5('0x37')],'as':'List','include':[{'model':db[_0x1bd5('0x2b')],'as':_0x1bd5('0x38'),'where':_0x5bb8a6,'limit':0x1,'order':[[_0x1bd5('0x39'),_0x1bd5('0x3a')]]}]},{'model':db[_0x1bd5('0x3b')],'as':_0x1bd5('0x3c')},{'model':db[_0x1bd5('0x3d')],'as':_0x1bd5('0x3e'),'include':[{'model':db['CloudProvider'],'as':_0x1bd5('0x3f')}]}]})[_0x1bd5('0xc')](function(_0x2a1ece){if(_0x2a1ece&&_0x2a1ece[_0x1bd5('0x40')]){var _0x34452a=_0x2a1ece[_0x1bd5('0x41')]({'plain':!![]});_0x305720['account']=_[_0x1bd5('0x42')](_0x34452a,[_0x1bd5('0x3c'),_0x1bd5('0x40')]);_0x305720[_0x1bd5('0x43')][_0x1bd5('0x26')]=_0x2a1ece[_0x1bd5('0x27')]();_0x305720[_0x1bd5('0x44')]=_0x34452a['Applications'];_0x305720['list']=_0x34452a[_0x1bd5('0x40')];_0x305720[_0x1bd5('0x44')]=_[_0x1bd5('0x45')](_0x305720['applications'],[_0x1bd5('0x46')],[_0x1bd5('0x47')]);if(_0x305720[_0x1bd5('0x43')]&&_0x305720[_0x1bd5('0x43')][_0x1bd5('0x48')]){_0x305720[_0x1bd5('0x44')][_0x1bd5('0x49')]({'id':0x0,'priority':_0x305720['applications'][_0x1bd5('0x4a')]+0x1,'app':_0x1bd5('0x4b'),'appdata':'autoclose','interval':_0x1bd5('0x4c')});}if(_0x305720['account'][_0x1bd5('0x3c')]){delete _0x305720['account'][_0x1bd5('0x3c')];}if(_0x305720[_0x1bd5('0x43')]['List']){delete _0x305720[_0x1bd5('0x43')][_0x1bd5('0x40')];}if(_0x34452a[_0x1bd5('0x40')][_0x1bd5('0x38')][_0x1bd5('0x4a')]){return _0x34452a[_0x1bd5('0x40')][_0x1bd5('0x38')][0x0];}var _0x51aebe=_[_0x1bd5('0x4d')](_0x53482['body'],{'firstName':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x4e')],'ListId':_0x34452a[_0x1bd5('0x2f')]});_0x51aebe[_0x53482['body']['mapKey']]=_0x53482[_0x1bd5('0x29')][_0x1bd5('0x4e')];return db[_0x1bd5('0x2b')][_0x1bd5('0x4f')](_0x51aebe);}else{throw new Error(_0x1bd5('0x50'));}})[_0x1bd5('0xc')](function(_0x46e36c){_0x305720[_0x1bd5('0x51')]=_0x46e36c;if(_0x46e36c){if(!_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['messageId']){_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x52')]=rs[_0x1bd5('0x53')]()+'\x20'+_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x4e')];}var _0x17b3a9={'ContactId':_0x46e36c['id'],'MailAccountId':_0x53482[_0x1bd5('0x43')]['id'],'inReplyTo':_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x52')],'to':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['from'],'cc':_0x53482['body'][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['subject'],'attach':_0x53482['body'][_0x1bd5('0x14')]['attach'],'lastMsgAt':moment()[_0x1bd5('0x54')](_0x1bd5('0x55')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x1bd5('0x23')]({'where':{'closed':![],'MailAccountId':_0x53482['account']['id']},'include':[{'model':db[_0x1bd5('0x56')],'as':'Messages','attributes':[_0x1bd5('0x52')],'where':{'messageId':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x57')]}}]})[_0x1bd5('0xc')](function(_0x47ca3f){if(_0x47ca3f){return[_0x47ca3f,![]];}return db['MailInteraction'][_0x1bd5('0x4f')](_0x17b3a9)[_0x1bd5('0xc')](function(_0x1a9ad2){return[_0x1a9ad2,!![]];});});}else{throw new Error(_0x1bd5('0x58'));}})['spread'](function(_0x551f22,_0x14dd41){if(_0x551f22){_0x574d95=_0x14dd41;if(!_0x14dd41){return _0x551f22[_0x1bd5('0x59')]({'inReplyTo':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x52')],'to':_0x53482[_0x1bd5('0x29')]['message']['from'],'cc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5a')],'attach':_0x551f22['attach']?_0x551f22[_0x1bd5('0x5b')]:_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x5b')],'substatus':null,'substatusAt':moment()[_0x1bd5('0x54')](_0x1bd5('0x55')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x551f22;}}})[_0x1bd5('0xc')](function(_0x36d62e){_0x305720[_0x1bd5('0x5c')]=_0x36d62e[_0x1bd5('0x41')]({'plain':!![]});_0x305720[_0x1bd5('0x5c')][_0x1bd5('0x5d')]=_0x574d95;return db[_0x1bd5('0x56')][_0x1bd5('0x4f')]({'body':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')],'MailAccountId':_0x53482[_0x1bd5('0x43')]['id'],'MailInteractionId':_0x36d62e['id'],'direction':'in','ContactId':_0x305720[_0x1bd5('0x51')]['id'],'messageId':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x52')],'from':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x4e')],'to':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['to'],'cc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['subject'],'attach':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5b')],'Attachments':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5e')],'originTo':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x5f')],'originCc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x60')],'bcc':_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x61')],'ChatWebsiteId':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x62')]||null,'originChannel':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['originChannel']||_0x1bd5('0x63'),'ChatOfflineMessageId':_0x53482['body']['message'][_0x1bd5('0x64')]||null},{'include':[{'model':db['Attachment'],'as':_0x1bd5('0x65')}]});})[_0x1bd5('0xc')](function(_0x560f20){_0x305720[_0x1bd5('0x14')]=_0x560f20;if(!_0x305720[_0x1bd5('0x5c')][_0x1bd5('0x66')]){return;}return db[_0x1bd5('0x67')][_0x1bd5('0x23')]({'attributes':['id',_0x1bd5('0x68')],'where':{'id':_0x305720['interaction'][_0x1bd5('0x66')]}});})[_0x1bd5('0xc')](function(_0xdd5183){if(_0xdd5183){_0x305720[_0x1bd5('0x44')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xdd5183[_0x1bd5('0x68')]+','+(_0x305720[_0x1bd5('0x43')][_0x1bd5('0x69')]||0xa),'interval':_0x1bd5('0x4c')});}if(!_0x305720['interaction'][_0x1bd5('0x6a')]){return;}return db['MailQueue']['find']({'attributes':['id',_0x1bd5('0x68')],'where':{'id':_0x305720['interaction'][_0x1bd5('0x6a')]}});})[_0x1bd5('0xc')](function(_0x231556){if(_0x231556){_0x305720[_0x1bd5('0x44')][_0x1bd5('0x6b')]({'id':0x0,'priority':0x1,'app':_0x1bd5('0x6c'),'appdata':_0x231556[_0x1bd5('0x68')]+','+(_0x305720[_0x1bd5('0x43')][_0x1bd5('0x6d')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x1bd5('0x6e'),'startRouting',_0x305720);})['then'](function(_0x59b491){_0x4074f1(_0x59b491);})[_0x1bd5('0x21')](function(_0x524b86){_0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x524b86[_0x1bd5('0x14')]));});});}; \ No newline at end of file +var _0x83d0=['ShowMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','Contacts','DESC','MailApplication','Applications','MailServerOut','CloudProvider','List','omit','applications','list','orderBy','priority','asc','autoclose','push','close','*,*,*,*','length','create','List\x20not\x20found','messageId','generate','subject','attach','format','MailMessage','Messages','inReplyTo','MailInteraction','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','queueId','MailQueue','queue','waitForTheAssignedQueue','Start','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','redis','defaults','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','attributes','limit','include','map','model','raw','where','smtpOptions','getSmtpOptions'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x83d0,0xb7));var _0x083d=function(_0x3dadbd,_0x21561c){_0x3dadbd=_0x3dadbd-0x0;var _0x52bd28=_0x83d0[_0x3dadbd];return _0x52bd28;};'use strict';var _=require(_0x083d('0x0'));var moment=require(_0x083d('0x1'));var BPromise=require(_0x083d('0x2'));var rs=require(_0x083d('0x3'));var Redis=require(_0x083d('0x4'));var db=require(_0x083d('0x5'))['db'];var logger=require('../../config/logger')(_0x083d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x083d('0x7')][_0x083d('0x8')]({'port':0x232c});config[_0x083d('0x9')]=_[_0x083d('0xa')](config[_0x083d('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x083d('0x9')]));require(_0x083d('0xb'))[_0x083d('0xc')](socket);function respondWithRpcPromise(_0x5528a4,_0x3ca407,_0x412ea9){return new BPromise(function(_0x40f5ed,_0xcf2319){return client['request'](_0x5528a4,_0x412ea9)[_0x083d('0xd')](function(_0x5be91f){logger[_0x083d('0xe')](_0x083d('0xf'),_0x3ca407,'request\x20sent');logger[_0x083d('0x10')](_0x083d('0x11'),_0x3ca407,_0x083d('0x12'),JSON[_0x083d('0x13')](_0x5be91f));if(_0x5be91f[_0x083d('0x14')]){if(_0x5be91f['error'][_0x083d('0x15')]===0x1f4){logger[_0x083d('0x14')]('MailAccount,\x20%s,\x20%s',_0x3ca407,_0x5be91f[_0x083d('0x14')]['message']);return _0xcf2319(_0x5be91f['error'][_0x083d('0x16')]);}logger[_0x083d('0x14')](_0x083d('0xf'),_0x3ca407,_0x5be91f[_0x083d('0x14')][_0x083d('0x16')]);return _0x40f5ed(_0x5be91f['error'][_0x083d('0x16')]);}else{logger['info'](_0x083d('0xf'),_0x3ca407,_0x083d('0x12'));_0x40f5ed(_0x5be91f[_0x083d('0x17')][_0x083d('0x16')]);}})[_0x083d('0x18')](function(_0x63c0b6){logger[_0x083d('0x14')](_0x083d('0xf'),_0x3ca407,_0x63c0b6);_0xcf2319(_0x63c0b6);});});}exports[_0x083d('0x19')]=function(_0x2cb79c){var _0x3ae260=this;return new Promise(function(_0xb8a16f,_0x5dd1ba){return db[_0x083d('0x1a')]['findAll']({'raw':_0x2cb79c[_0x083d('0x1b')]?_0x2cb79c[_0x083d('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2cb79c[_0x083d('0x1b')]?_0x2cb79c['options']['where']||null:null,'attributes':_0x2cb79c['options']?_0x2cb79c[_0x083d('0x1b')][_0x083d('0x1c')]||null:null,'limit':_0x2cb79c[_0x083d('0x1b')]?_0x2cb79c[_0x083d('0x1b')][_0x083d('0x1d')]||null:null,'include':_0x2cb79c[_0x083d('0x1b')]?_0x2cb79c['options'][_0x083d('0x1e')]?_[_0x083d('0x1f')](_0x2cb79c['options'][_0x083d('0x1e')],function(_0x38ca23){return{'model':db[_0x38ca23[_0x083d('0x20')]],'as':_0x38ca23['as'],'attributes':_0x38ca23[_0x083d('0x1c')],'include':_0x38ca23[_0x083d('0x1e')]?_[_0x083d('0x1f')](_0x38ca23[_0x083d('0x1e')],function(_0x3923ff){return{'model':db[_0x3923ff['model']],'as':_0x3923ff['as'],'attributes':_0x3923ff[_0x083d('0x1c')],'include':_0x3923ff['include']?_[_0x083d('0x1f')](_0x3923ff[_0x083d('0x1e')],function(_0x252340){return{'model':db[_0x252340[_0x083d('0x20')]],'as':_0x252340['as'],'attributes':_0x252340[_0x083d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x083d('0xd')](function(_0x2b4825){logger[_0x083d('0xe')](_0x083d('0x19'),_0x2cb79c);logger[_0x083d('0x10')](_0x083d('0x19'),_0x2cb79c,JSON[_0x083d('0x13')](_0x2b4825));_0xb8a16f(_0x2b4825);})[_0x083d('0x18')](function(_0x2c7223){logger[_0x083d('0x14')]('GetMailAccount',_0x2c7223[_0x083d('0x16')],_0x2cb79c);_0x5dd1ba(_0x3ae260[_0x083d('0x14')](0x1f4,_0x2c7223['message']));});});};exports['ShowMailAccount']=function(_0x21a5d9){var _0x560cd0=this;return new Promise(function(_0x225c15,_0x49515c){return db[_0x083d('0x1a')]['find']({'raw':_0x21a5d9[_0x083d('0x1b')]?_0x21a5d9[_0x083d('0x1b')][_0x083d('0x21')]===undefined?!![]:![]:!![],'where':_0x21a5d9['options']?_0x21a5d9['options'][_0x083d('0x22')]||null:null,'attributes':_0x21a5d9['options']?_0x21a5d9[_0x083d('0x1b')][_0x083d('0x1c')]||null:null,'include':_0x21a5d9[_0x083d('0x1b')]?_0x21a5d9[_0x083d('0x1b')]['include']?_[_0x083d('0x1f')](_0x21a5d9[_0x083d('0x1b')][_0x083d('0x1e')],function(_0x30f4ad){return{'model':db[_0x30f4ad['model']],'as':_0x30f4ad['as'],'attributes':_0x30f4ad[_0x083d('0x1c')],'include':_0x30f4ad[_0x083d('0x1e')]?_[_0x083d('0x1f')](_0x30f4ad[_0x083d('0x1e')],function(_0x5d2836){return{'model':db[_0x5d2836['model']],'as':_0x5d2836['as'],'attributes':_0x5d2836[_0x083d('0x1c')],'include':_0x5d2836[_0x083d('0x1e')]?_[_0x083d('0x1f')](_0x5d2836[_0x083d('0x1e')],function(_0x1d75ef){return{'model':db[_0x1d75ef['model']],'as':_0x1d75ef['as'],'attributes':_0x1d75ef[_0x083d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x083d('0xd')](function(_0x48bafb){if(_0x21a5d9[_0x083d('0x1b')]['smtp']===!![])_0x48bafb['setDataValue'](_0x083d('0x23'),_0x48bafb[_0x083d('0x24')]());logger['info'](_0x083d('0x25'),_0x21a5d9);logger[_0x083d('0x10')](_0x083d('0x25'),_0x21a5d9,JSON['stringify'](_0x48bafb));_0x225c15(_0x48bafb);})['catch'](function(_0x48e297){logger['error'](_0x083d('0x25'),_0x48e297[_0x083d('0x16')],_0x21a5d9);_0x49515c(_0x560cd0[_0x083d('0x14')](0x1f4,_0x48e297[_0x083d('0x16')]));});});};exports['NotifyMailAccount']=function(_0x5ad9f2){var _0x1a99c9=this;return new Promise(function(_0x5706d1,_0x11a43f){var _0x368241={'body':_0x5ad9f2[_0x083d('0x26')],'channel':_0x083d('0x27')};var _0x177269=_[_0x083d('0x28')](_[_0x083d('0x29')](db[_0x083d('0x2a')]['rawAttributes']),[_0x083d('0x2b'),_0x083d('0x2c'),_0x083d('0x2d'),_0x083d('0x2e')]);var _0x2fd7cb=![];if(_0x5ad9f2[_0x083d('0x26')]['id']){delete _0x5ad9f2[_0x083d('0x26')]['id'];}if(_['isNil'](_0x5ad9f2[_0x083d('0x26')][_0x083d('0x2f')])){return _0x11a43f(_0x1a99c9['error'](0x1f4,_0x083d('0x30')));}if(_[_0x083d('0x31')](_0x5ad9f2[_0x083d('0x26')][_0x083d('0x26')])||_0x5ad9f2[_0x083d('0x26')]['body']===''){return _0x11a43f(_0x1a99c9[_0x083d('0x14')](0x1f4,_0x083d('0x32')));}if(_[_0x083d('0x31')](_0x5ad9f2[_0x083d('0x26')][_0x083d('0x33')])){return _0x11a43f(_0x1a99c9['error'](0x1f4,_0x083d('0x34')+_0x177269));}if(!_[_0x083d('0x35')](_0x177269,_0x5ad9f2[_0x083d('0x26')][_0x083d('0x33')])){return _0x11a43f(_0x1a99c9[_0x083d('0x14')](0x1f4,_0x083d('0x36')+_0x177269));}var _0x592d1a={};_0x592d1a[_0x5ad9f2[_0x083d('0x26')][_0x083d('0x33')]]=_0x5ad9f2[_0x083d('0x26')][_0x083d('0x2f')];return db[_0x083d('0x1a')][_0x083d('0x37')]({'where':{'id':_0x5ad9f2[_0x083d('0x38')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x083d('0x39'),'where':_0x592d1a,'limit':0x1,'order':[['updatedAt',_0x083d('0x3a')]]}]},{'model':db[_0x083d('0x3b')],'as':_0x083d('0x3c')},{'model':db[_0x083d('0x3d')],'as':'Smtp','include':[{'model':db[_0x083d('0x3e')],'as':_0x083d('0x3e')}]}]})[_0x083d('0xd')](function(_0x235998){if(_0x235998&&_0x235998[_0x083d('0x3f')]){var _0x5853d3=_0x235998['get']({'plain':!![]});_0x368241['account']=_[_0x083d('0x40')](_0x5853d3,[_0x083d('0x3c'),_0x083d('0x3f')]);_0x368241[_0x083d('0x38')][_0x083d('0x23')]=_0x235998[_0x083d('0x24')]();_0x368241[_0x083d('0x41')]=_0x5853d3[_0x083d('0x3c')];_0x368241[_0x083d('0x42')]=_0x5853d3['List'];_0x368241['applications']=_[_0x083d('0x43')](_0x368241['applications'],[_0x083d('0x44')],[_0x083d('0x45')]);if(_0x368241[_0x083d('0x38')]&&_0x368241[_0x083d('0x38')][_0x083d('0x46')]){_0x368241['applications'][_0x083d('0x47')]({'id':0x0,'priority':_0x368241['applications']['length']+0x1,'app':_0x083d('0x48'),'appdata':_0x083d('0x46'),'interval':_0x083d('0x49')});}if(_0x368241[_0x083d('0x38')][_0x083d('0x3c')]){delete _0x368241[_0x083d('0x38')][_0x083d('0x3c')];}if(_0x368241['account'][_0x083d('0x3f')]){delete _0x368241[_0x083d('0x38')][_0x083d('0x3f')];}if(_0x5853d3[_0x083d('0x3f')][_0x083d('0x39')][_0x083d('0x4a')]){return _0x5853d3[_0x083d('0x3f')][_0x083d('0x39')][0x0];}var _0x53b072=_[_0x083d('0xa')](_0x5ad9f2[_0x083d('0x26')],{'firstName':_0x5ad9f2[_0x083d('0x26')][_0x083d('0x2f')],'ListId':_0x5853d3[_0x083d('0x2e')]});_0x53b072[_0x5ad9f2[_0x083d('0x26')][_0x083d('0x33')]]=_0x5ad9f2[_0x083d('0x26')][_0x083d('0x2f')];return db[_0x083d('0x2a')][_0x083d('0x4b')](_0x53b072);}else{throw new Error(_0x083d('0x4c'));}})[_0x083d('0xd')](function(_0x497598){_0x368241['contact']=_0x497598;if(_0x497598){if(!_0x5ad9f2[_0x083d('0x26')][_0x083d('0x16')][_0x083d('0x4d')]){_0x5ad9f2[_0x083d('0x26')]['message'][_0x083d('0x4d')]=rs[_0x083d('0x4e')]()+'\x20'+_0x5ad9f2[_0x083d('0x26')][_0x083d('0x16')][_0x083d('0x2f')];}var _0x48c6b3={'ContactId':_0x497598['id'],'MailAccountId':_0x5ad9f2['account']['id'],'inReplyTo':_0x5ad9f2[_0x083d('0x26')][_0x083d('0x16')][_0x083d('0x4d')],'to':_0x5ad9f2['body'][_0x083d('0x16')][_0x083d('0x2f')],'cc':_0x5ad9f2['body'][_0x083d('0x16')]['cc'],'subject':_0x5ad9f2[_0x083d('0x26')]['message'][_0x083d('0x4f')],'attach':_0x5ad9f2[_0x083d('0x26')]['message'][_0x083d('0x50')],'lastMsgAt':moment()[_0x083d('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0x083d('0x37')]({'where':{'closed':![],'MailAccountId':_0x5ad9f2[_0x083d('0x38')]['id']},'include':[{'model':db[_0x083d('0x52')],'as':_0x083d('0x53'),'attributes':['messageId'],'where':{'messageId':_0x5ad9f2[_0x083d('0x26')][_0x083d('0x16')][_0x083d('0x54')]}}]})['then'](function(_0x15b8f7){if(_0x15b8f7){return[_0x15b8f7,![]];}return db[_0x083d('0x55')][_0x083d('0x4b')](_0x48c6b3)[_0x083d('0xd')](function(_0x56c903){return[_0x56c903,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x083d('0x56')](function(_0x38f1b8,_0x5acf5d){if(_0x38f1b8){_0x2fd7cb=_0x5acf5d;if(!_0x5acf5d){return _0x38f1b8[_0x083d('0x57')]({'inReplyTo':_0x5ad9f2[_0x083d('0x26')][_0x083d('0x16')][_0x083d('0x4d')],'to':_0x5ad9f2[_0x083d('0x26')]['message'][_0x083d('0x2f')],'cc':_0x5ad9f2[_0x083d('0x26')][_0x083d('0x16')]['cc'],'subject':_0x5ad9f2[_0x083d('0x26')][_0x083d('0x16')][_0x083d('0x4f')],'attach':_0x38f1b8[_0x083d('0x50')]?_0x38f1b8[_0x083d('0x50')]:_0x5ad9f2['body'][_0x083d('0x16')][_0x083d('0x50')],'substatus':null,'substatusAt':moment()[_0x083d('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x083d('0x58')),'lastMsgDirection':'in'});}else{return _0x38f1b8;}}})[_0x083d('0xd')](function(_0x258905){_0x368241[_0x083d('0x59')]=_0x258905['get']({'plain':!![]});_0x368241[_0x083d('0x59')]['created']=_0x2fd7cb;return db['MailMessage'][_0x083d('0x4b')]({'body':_0x5ad9f2[_0x083d('0x26')][_0x083d('0x26')],'MailAccountId':_0x5ad9f2[_0x083d('0x38')]['id'],'MailInteractionId':_0x258905['id'],'direction':'in','ContactId':_0x368241[_0x083d('0x5a')]['id'],'messageId':_0x5ad9f2[_0x083d('0x26')][_0x083d('0x16')][_0x083d('0x4d')],'from':_0x5ad9f2[_0x083d('0x26')][_0x083d('0x16')][_0x083d('0x2f')],'to':_0x5ad9f2['body'][_0x083d('0x16')]['to'],'cc':_0x5ad9f2['body']['message']['cc'],'subject':_0x5ad9f2[_0x083d('0x26')][_0x083d('0x16')][_0x083d('0x4f')],'attach':_0x5ad9f2[_0x083d('0x26')]['message']['attach'],'Attachments':_0x5ad9f2[_0x083d('0x26')][_0x083d('0x16')][_0x083d('0x5b')],'originTo':_0x5ad9f2['body'][_0x083d('0x16')][_0x083d('0x5c')],'originCc':_0x5ad9f2['body'][_0x083d('0x16')][_0x083d('0x5d')],'bcc':_0x5ad9f2[_0x083d('0x26')][_0x083d('0x16')][_0x083d('0x5e')],'ChatWebsiteId':_0x5ad9f2[_0x083d('0x26')]['message'][_0x083d('0x5f')]||null,'originChannel':_0x5ad9f2['body'][_0x083d('0x16')]['originChannel']||'Email','ChatOfflineMessageId':_0x5ad9f2[_0x083d('0x26')]['message'][_0x083d('0x60')]||null},{'include':[{'model':db[_0x083d('0x61')],'as':_0x083d('0x62')}]});})[_0x083d('0xd')](function(_0x495c48){_0x368241[_0x083d('0x16')]=_0x495c48;if(!_0x368241[_0x083d('0x59')][_0x083d('0x63')]){return;}return db[_0x083d('0x64')][_0x083d('0x37')]({'attributes':['id',_0x083d('0x65')],'where':{'id':_0x368241['interaction'][_0x083d('0x63')]}});})[_0x083d('0xd')](function(_0x3859c4){if(_0x3859c4){_0x368241['applications'][_0x083d('0x66')]({'id':0x0,'priority':0x0,'app':_0x083d('0x67'),'appdata':_0x3859c4[_0x083d('0x65')]+','+(_0x368241[_0x083d('0x38')][_0x083d('0x68')]||0xa),'interval':_0x083d('0x49')});}if(!_0x368241['interaction'][_0x083d('0x69')]){return;}return db[_0x083d('0x6a')]['find']({'attributes':['id',_0x083d('0x65')],'where':{'id':_0x368241[_0x083d('0x59')][_0x083d('0x69')]}});})['then'](function(_0x20957f){if(_0x20957f){_0x368241[_0x083d('0x41')]['unshift']({'id':0x0,'priority':0x1,'app':_0x083d('0x6b'),'appdata':_0x20957f['name']+','+(_0x368241[_0x083d('0x38')][_0x083d('0x6c')]||0x12c),'interval':_0x083d('0x49')});}return respondWithRpcPromise(_0x083d('0x6d'),'startRouting',_0x368241);})[_0x083d('0xd')](function(_0x497e38){_0x5706d1(_0x497e38);})[_0x083d('0x18')](function(_0x1502db){_0x11a43f(_0x1a99c9['error'](0x1f4,_0x1502db[_0x083d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 98ebde0..9d81093 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 _0x78ce=['emit','register','length','mailAccount:','update'];(function(_0xa6c1a1,_0xf4f801){var _0x1d6ac7=function(_0x3346e8){while(--_0x3346e8){_0xa6c1a1['push'](_0xa6c1a1['shift']());}};_0x1d6ac7(++_0xf4f801);}(_0x78ce,0x158));var _0xe78c=function(_0x45d174,_0x47c6bb){_0x45d174=_0x45d174-0x0;var _0x3a0128=_0x78ce[_0x45d174];return _0x3a0128;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save','remove',_0xe78c('0x0')];function createListener(_0x32c698,_0x107af8){return function(_0x41887a){_0x107af8[_0xe78c('0x1')](_0x32c698,_0x41887a);};}function removeListener(_0x3cdad6,_0x5768cb){return function(){MailAccountEvents['removeListener'](_0x3cdad6,_0x5768cb);};}exports[_0xe78c('0x2')]=function(_0x1e76fb){for(var _0x288d17=0x0,_0x45d0f9=events[_0xe78c('0x3')];_0x288d17<_0x45d0f9;_0x288d17++){var _0x72ec90=events[_0x288d17];var _0x2ac46b=createListener(_0xe78c('0x4')+_0x72ec90,_0x1e76fb);MailAccountEvents['on'](_0x72ec90,_0x2ac46b);}}; \ No newline at end of file +var _0x9a6d=['register','length','mailAccount:','./mailAccount.events','save','update','emit','removeListener'];(function(_0x14afda,_0x512394){var _0x1923af=function(_0x6919df){while(--_0x6919df){_0x14afda['push'](_0x14afda['shift']());}};_0x1923af(++_0x512394);}(_0x9a6d,0x10b));var _0xd9a6=function(_0x5d4aa0,_0x2d9fa3){_0x5d4aa0=_0x5d4aa0-0x0;var _0x4b03d2=_0x9a6d[_0x5d4aa0];return _0x4b03d2;};'use strict';var MailAccountEvents=require(_0xd9a6('0x0'));var events=[_0xd9a6('0x1'),'remove',_0xd9a6('0x2')];function createListener(_0x3e5806,_0x72f834){return function(_0xd4daec){_0x72f834[_0xd9a6('0x3')](_0x3e5806,_0xd4daec);};}function removeListener(_0x541d50,_0x45446e){return function(){MailAccountEvents[_0xd9a6('0x4')](_0x541d50,_0x45446e);};}exports[_0xd9a6('0x5')]=function(_0x583850){for(var _0x2326a3=0x0,_0x585700=events[_0xd9a6('0x6')];_0x2326a3<_0x585700;_0x2326a3++){var _0x5b7b19=events[_0x2326a3];var _0x176ffe=createListener(_0xd9a6('0x7')+_0x5b7b19,_0x583850);MailAccountEvents['on'](_0x5b7b19,_0x176ffe);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index f3da283..0513169 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 _0x437f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','/:id','delete','destroy','exports','multer','util','path'];(function(_0x41de3d,_0x41170d){var _0x2f3a63=function(_0x465e42){while(--_0x465e42){_0x41de3d['push'](_0x41de3d['shift']());}};_0x2f3a63(++_0x41170d);}(_0x437f,0x107));var _0xf437=function(_0x4a752b,_0x1a8b9a){_0x4a752b=_0x4a752b-0x0;var _0x4696a4=_0x437f[_0x4a752b];return _0x4696a4;};'use strict';var multer=require(_0xf437('0x0'));var util=require(_0xf437('0x1'));var path=require(_0xf437('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf437('0x3'));var auth=require(_0xf437('0x4'));var interaction=require(_0xf437('0x5'));var config=require(_0xf437('0x6'));var controller=require(_0xf437('0x7'));router['get']('/:id',auth[_0xf437('0x8')](),controller[_0xf437('0x9')]);router['put'](_0xf437('0xa'),auth[_0xf437('0x8')](),controller['update']);router[_0xf437('0xb')](_0xf437('0xa'),auth['isAuthenticated'](),controller[_0xf437('0xc')]);module[_0xf437('0xd')]=router; \ No newline at end of file +var _0x0a33=['util','connect-timeout','Router','../../components/interaction/service','./mailApplication.controller','get','/:id','show','isAuthenticated','delete','exports','multer'];(function(_0x263cb4,_0x53ce57){var _0x32a04b=function(_0x31e87b){while(--_0x31e87b){_0x263cb4['push'](_0x263cb4['shift']());}};_0x32a04b(++_0x53ce57);}(_0x0a33,0x1af));var _0x30a3=function(_0x36db65,_0x2b4af1){_0x36db65=_0x36db65-0x0;var _0x5bea6a=_0x0a33[_0x36db65];return _0x5bea6a;};'use strict';var multer=require(_0x30a3('0x0'));var util=require(_0x30a3('0x1'));var path=require('path');var timeout=require(_0x30a3('0x2'));var express=require('express');var router=express[_0x30a3('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x30a3('0x4'));var config=require('../../config/environment');var controller=require(_0x30a3('0x5'));router[_0x30a3('0x6')](_0x30a3('0x7'),auth['isAuthenticated'](),controller[_0x30a3('0x8')]);router['put'](_0x30a3('0x7'),auth[_0x30a3('0x9')](),controller['update']);router[_0x30a3('0xa')](_0x30a3('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x30a3('0xb')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 997802a..a92502e 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 _0xd748=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xd748,0x184));var _0x8d74=function(_0x529abc,_0x17b97e){_0x529abc=_0x529abc-0x0;var _0x453afa=_0xd748[_0x529abc];return _0x453afa;};'use strict';var Sequelize=require(_0x8d74('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8d74('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8d74('0x2')],'allowNull':![],'defaultValue':_0x8d74('0x3')},'appdata':{'type':Sequelize[_0x8d74('0x4')]()},'description':{'type':Sequelize[_0x8d74('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x8d74('0x5')}}; \ No newline at end of file +var _0x8b86=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x1ad110,_0x1d17b6){var _0x5ba3b3=function(_0x4dc8aa){while(--_0x4dc8aa){_0x1ad110['push'](_0x1ad110['shift']());}};_0x5ba3b3(++_0x1d17b6);}(_0x8b86,0x112));var _0x68b8=function(_0x1465e2,_0x7e5150){_0x1465e2=_0x1465e2-0x0;var _0x38f758=_0x8b86[_0x1465e2];return _0x38f758;};'use strict';var Sequelize=require(_0x68b8('0x0'));module[_0x68b8('0x1')]={'priority':{'type':Sequelize[_0x68b8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x68b8('0x3')],'allowNull':![],'defaultValue':_0x68b8('0x4')},'appdata':{'type':Sequelize[_0x68b8('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x68b8('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 1b50485..8228ca3 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 _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(_0x381f2d,_0x5a7622){var _0xbf594=function(_0x599c42){while(--_0x599c42){_0x381f2d['push'](_0x381f2d['shift']());}};_0xbf594(++_0x5a7622);}(_0xb43b,0x1b2));var _0xbb43=function(_0x40fc58,_0xe7b094){_0x40fc58=_0x40fc58-0x0;var _0x11974f=_0xb43b[_0x40fc58];return _0x11974f;};'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 +var _0xa9e0=['includeAll','merge','options','find','catch','body','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','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x49d51d,_0x503117){var _0x3326fa=function(_0x42b36f){while(--_0x42b36f){_0x49d51d['push'](_0x49d51d['shift']());}};_0x3326fa(++_0x503117);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 27e365f..c798256 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 _0xb168=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','util'];(function(_0x13c704,_0x485ae0){var _0x3a2103=function(_0x32a200){while(--_0x32a200){_0x13c704['push'](_0x13c704['shift']());}};_0x3a2103(++_0x485ae0);}(_0xb168,0x67));var _0x8b16=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xb168[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require('lodash');var util=require(_0x8b16('0x0'));var logger=require(_0x8b16('0x1'))(_0x8b16('0x2'));var moment=require(_0x8b16('0x3'));var BPromise=require(_0x8b16('0x4'));var rp=require(_0x8b16('0x5'));var fs=require('fs');var path=require(_0x8b16('0x6'));var rimraf=require('rimraf');var config=require(_0x8b16('0x7'));var attributes=require(_0x8b16('0x8'));module[_0x8b16('0x9')]=function(_0x718878,_0x589a97){return _0x718878[_0x8b16('0xa')](_0x8b16('0xb'),attributes,{'tableName':_0x8b16('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf09c=['rimraf','../../config/environment','exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2af627,_0x33d47f){var _0x14eda9=function(_0x38679a){while(--_0x38679a){_0x2af627['push'](_0x2af627['shift']());}};_0x14eda9(++_0x33d47f);}(_0xf09c,0x165));var _0xcf09=function(_0x2a041f,_0x124a26){_0x2a041f=_0x2a041f-0x0;var _0x1ed6c9=_0xf09c[_0x2a041f];return _0x1ed6c9;};'use strict';var _=require(_0xcf09('0x0'));var util=require(_0xcf09('0x1'));var logger=require(_0xcf09('0x2'))('api');var moment=require(_0xcf09('0x3'));var BPromise=require(_0xcf09('0x4'));var rp=require(_0xcf09('0x5'));var fs=require('fs');var path=require(_0xcf09('0x6'));var rimraf=require(_0xcf09('0x7'));var config=require(_0xcf09('0x8'));var attributes=require('./mailApplication.attributes');module[_0xcf09('0x9')]=function(_0x50fb36,_0x21a439){return _0x50fb36['define'](_0xcf09('0xa'),attributes,{'tableName':_0xcf09('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcf09('0xc'),'collate':_0xcf09('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6729ffc..3a9947a 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 _0x385e=['MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x385e,0x1bc));var _0xe385=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0x385e[_0x171fdc];return _0x3782ea;};'use strict';var _=require(_0xe385('0x0'));var util=require(_0xe385('0x1'));var moment=require(_0xe385('0x2'));var BPromise=require(_0xe385('0x3'));var rs=require(_0xe385('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe385('0x5'))['db'];var utils=require(_0xe385('0x6'));var logger=require(_0xe385('0x7'))(_0xe385('0x8'));var config=require('../../config/environment');var jayson=require(_0xe385('0x9'));var client=jayson[_0xe385('0xa')][_0xe385('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c39cc,_0x585f95,_0x1235c6){return new BPromise(function(_0x2d3915,_0x3b3755){return client[_0xe385('0xc')](_0x2c39cc,_0x1235c6)[_0xe385('0xd')](function(_0xa3452d){logger[_0xe385('0xe')](_0xe385('0xf'),_0x585f95,_0xe385('0x10'));logger[_0xe385('0x11')](_0xe385('0x12'),_0x585f95,_0xe385('0x10'),JSON[_0xe385('0x13')](_0xa3452d));if(_0xa3452d[_0xe385('0x14')]){if(_0xa3452d[_0xe385('0x14')][_0xe385('0x15')]===0x1f4){logger[_0xe385('0x14')]('MailApplication,\x20%s,\x20%s',_0x585f95,_0xa3452d[_0xe385('0x14')]['message']);return _0x3b3755(_0xa3452d['error'][_0xe385('0x16')]);}logger[_0xe385('0x14')]('MailApplication,\x20%s,\x20%s',_0x585f95,_0xa3452d[_0xe385('0x14')][_0xe385('0x16')]);return _0x2d3915(_0xa3452d[_0xe385('0x14')][_0xe385('0x16')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x585f95,_0xe385('0x10'));_0x2d3915(_0xa3452d[_0xe385('0x17')]['message']);}})['catch'](function(_0x2c8dfc){logger['error']('MailApplication,\x20%s,\x20%s',_0x585f95,_0x2c8dfc);_0x3b3755(_0x2c8dfc);});});}exports[_0xe385('0x18')]=function(_0x530cc2){var _0x17e530=this;return new Promise(function(_0x5ec6de,_0x945191){return db[_0xe385('0x19')][_0xe385('0x1a')](_0x530cc2[_0xe385('0x1b')],{'raw':_0x530cc2['options']?_0x530cc2[_0xe385('0x1c')][_0xe385('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x530cc2[_0xe385('0x1c')]?_0x530cc2[_0xe385('0x1c')][_0xe385('0x1e')]||null:null,'attributes':_0x530cc2[_0xe385('0x1c')]?_0x530cc2['options'][_0xe385('0x1f')]||null:null,'limit':_0x530cc2[_0xe385('0x1c')]?_0x530cc2['options']['limit']||null:null})[_0xe385('0xd')](function(_0x3f52de){logger[_0xe385('0xe')](_0xe385('0x18'),_0x530cc2);logger['debug'](_0xe385('0x18'),_0x530cc2,JSON[_0xe385('0x13')](_0x3f52de));_0x5ec6de(_0x3f52de);})[_0xe385('0x20')](function(_0x303cd8){logger[_0xe385('0x14')]('UpdateMailApplication',_0x303cd8[_0xe385('0x16')],_0x530cc2);_0x945191(_0x17e530[_0xe385('0x14')](0x1f4,_0x303cd8['message']));});});}; \ No newline at end of file +var _0xc84a=['where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw'];(function(_0x4d0c03,_0x3f0ade){var _0x4c3c5f=function(_0xc4b7){while(--_0xc4b7){_0x4d0c03['push'](_0x4d0c03['shift']());}};_0x4c3c5f(++_0x3f0ade);}(_0xc84a,0x106));var _0xac84=function(_0x257a76,_0x5f37a9){_0x257a76=_0x257a76-0x0;var _0xcca621=_0xc84a[_0x257a76];return _0xcca621;};'use strict';var _=require(_0xac84('0x0'));var util=require('util');var moment=require(_0xac84('0x1'));var BPromise=require(_0xac84('0x2'));var rs=require(_0xac84('0x3'));var fs=require('fs');var Redis=require(_0xac84('0x4'));var db=require(_0xac84('0x5'))['db'];var utils=require(_0xac84('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xac84('0x7'));var jayson=require(_0xac84('0x8'));var client=jayson[_0xac84('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2812b6,_0x4845f5,_0x3297aa){return new BPromise(function(_0x4cb7e5,_0x1eeb8c){return client[_0xac84('0xa')](_0x2812b6,_0x3297aa)[_0xac84('0xb')](function(_0x47b853){logger[_0xac84('0xc')](_0xac84('0xd'),_0x4845f5,_0xac84('0xe'));logger[_0xac84('0xf')](_0xac84('0x10'),_0x4845f5,_0xac84('0xe'),JSON['stringify'](_0x47b853));if(_0x47b853[_0xac84('0x11')]){if(_0x47b853['error'][_0xac84('0x12')]===0x1f4){logger[_0xac84('0x11')]('MailApplication,\x20%s,\x20%s',_0x4845f5,_0x47b853[_0xac84('0x11')][_0xac84('0x13')]);return _0x1eeb8c(_0x47b853['error'][_0xac84('0x13')]);}logger[_0xac84('0x11')](_0xac84('0xd'),_0x4845f5,_0x47b853[_0xac84('0x11')][_0xac84('0x13')]);return _0x4cb7e5(_0x47b853[_0xac84('0x11')]['message']);}else{logger[_0xac84('0xc')](_0xac84('0xd'),_0x4845f5,_0xac84('0xe'));_0x4cb7e5(_0x47b853[_0xac84('0x14')][_0xac84('0x13')]);}})[_0xac84('0x15')](function(_0x3dd47d){logger[_0xac84('0x11')](_0xac84('0xd'),_0x4845f5,_0x3dd47d);_0x1eeb8c(_0x3dd47d);});});}exports[_0xac84('0x16')]=function(_0x2e1d54){var _0x4b4c26=this;return new Promise(function(_0x6913d,_0x5d40b9){return db[_0xac84('0x17')][_0xac84('0x18')](_0x2e1d54[_0xac84('0x19')],{'raw':_0x2e1d54[_0xac84('0x1a')]?_0x2e1d54[_0xac84('0x1a')][_0xac84('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e1d54['options']?_0x2e1d54[_0xac84('0x1a')][_0xac84('0x1c')]||null:null,'attributes':_0x2e1d54[_0xac84('0x1a')]?_0x2e1d54['options']['attributes']||null:null,'limit':_0x2e1d54['options']?_0x2e1d54['options']['limit']||null:null})[_0xac84('0xb')](function(_0x5de81a){logger[_0xac84('0xc')](_0xac84('0x16'),_0x2e1d54);logger[_0xac84('0xf')](_0xac84('0x16'),_0x2e1d54,JSON['stringify'](_0x5de81a));_0x6913d(_0x5de81a);})[_0xac84('0x15')](function(_0x51420c){logger[_0xac84('0x11')]('UpdateMailApplication',_0x51420c['message'],_0x2e1d54);_0x5d40b9(_0x4b4c26[_0xac84('0x11')](0x1f4,_0x51420c[_0xac84('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index c56229c..42fa779 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 _0xa722=['post','/:id/messages','/:id/tags','mail','mailinteraction:addtags','put','mailinteraction:update','/:id','tracked','destroy','delete','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','index','get','/describe','isAuthenticated','describe','getMessages','/:id/download','create'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0xa722,0x1c7));var _0x2a72=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0xa722[_0x296809];return _0x18c0d3;};'use strict';var express=require(_0x2a72('0x0'));var router=express[_0x2a72('0x1')]();var auth=require(_0x2a72('0x2'));var interaction=require(_0x2a72('0x3'));var controller=require(_0x2a72('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x2a72('0x5')]);router[_0x2a72('0x6')](_0x2a72('0x7'),auth[_0x2a72('0x8')](),controller[_0x2a72('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2a72('0x6')]('/:id/messages',auth[_0x2a72('0x8')](),controller[_0x2a72('0xa')]);router[_0x2a72('0x6')](_0x2a72('0xb'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x2a72('0x8')](),controller[_0x2a72('0xc')]);router[_0x2a72('0xd')](_0x2a72('0xe'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x2a72('0xf'),auth[_0x2a72('0x8')](),interaction['tracked'](_0x2a72('0x10'),_0x2a72('0x11')),controller['addTags']);router[_0x2a72('0x12')]('/:id',auth[_0x2a72('0x8')](),interaction['tracked'](_0x2a72('0x10'),_0x2a72('0x13')),controller['update']);router['delete'](_0x2a72('0x14'),auth[_0x2a72('0x8')](),interaction[_0x2a72('0x15')](_0x2a72('0x10'),'mailinteraction:destroy'),controller[_0x2a72('0x16')]);router[_0x2a72('0x17')](_0x2a72('0xf'),auth['isAuthenticated'](),controller[_0x2a72('0x18')]);module[_0x2a72('0x19')]=router; \ No newline at end of file +var _0xf3ba=['mailinteraction:update','update','delete','destroy','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','/describe','isAuthenticated','describe','/:id','getMessages','/:id/download','post','create','/:id/messages','addMessage','tracked','mail','mailinteraction:addtags','addTags'];(function(_0x57ede1,_0x130326){var _0x203a00=function(_0x468a61){while(--_0x468a61){_0x57ede1['push'](_0x57ede1['shift']());}};_0x203a00(++_0x130326);}(_0xf3ba,0x1b7));var _0xaf3b=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0xf3ba[_0x4394b6];return _0x360244;};'use strict';var express=require(_0xaf3b('0x0'));var router=express[_0xaf3b('0x1')]();var auth=require(_0xaf3b('0x2'));var interaction=require(_0xaf3b('0x3'));var controller=require(_0xaf3b('0x4'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xaf3b('0x5')](_0xaf3b('0x6'),auth[_0xaf3b('0x7')](),controller[_0xaf3b('0x8')]);router['get'](_0xaf3b('0x9'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xaf3b('0xa')]);router[_0xaf3b('0x5')](_0xaf3b('0xb'),auth['isAuthenticated'](),controller['download']);router[_0xaf3b('0xc')]('/',auth[_0xaf3b('0x7')](),controller[_0xaf3b('0xd')]);router[_0xaf3b('0xc')](_0xaf3b('0xe'),auth[_0xaf3b('0x7')](),controller[_0xaf3b('0xf')]);router['post']('/:id/tags',auth[_0xaf3b('0x7')](),interaction[_0xaf3b('0x10')](_0xaf3b('0x11'),_0xaf3b('0x12')),controller[_0xaf3b('0x13')]);router['put'](_0xaf3b('0x9'),auth['isAuthenticated'](),interaction[_0xaf3b('0x10')](_0xaf3b('0x11'),_0xaf3b('0x14')),controller[_0xaf3b('0x15')]);router[_0xaf3b('0x16')](_0xaf3b('0x9'),auth[_0xaf3b('0x7')](),interaction[_0xaf3b('0x10')](_0xaf3b('0x11'),'mailinteraction:destroy'),controller[_0xaf3b('0x17')]);router[_0xaf3b('0x16')](_0xaf3b('0x18'),auth[_0xaf3b('0x7')](),controller[_0xaf3b('0x19')]);module[_0xaf3b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 39a7181..955a654 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 _0xe8a7=['ENUM','INTEGER','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','out'];(function(_0x26efac,_0x21ab8a){var _0x8482e4=function(_0x14db32){while(--_0x14db32){_0x26efac['push'](_0x26efac['shift']());}};_0x8482e4(++_0x21ab8a);}(_0xe8a7,0x136));var _0x7e8a=function(_0xa69a96,_0x286688){_0xa69a96=_0xa69a96-0x0;var _0x51918a=_0xe8a7[_0xa69a96];return _0x51918a;};'use strict';var Sequelize=require(_0x7e8a('0x0'));var iconv=require(_0x7e8a('0x1'));module[_0x7e8a('0x2')]={'closed':{'type':Sequelize[_0x7e8a('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7e8a('0x4')]},'disposition':{'type':Sequelize[_0x7e8a('0x5')]},'secondDisposition':{'type':Sequelize[_0x7e8a('0x5')]},'thirdDisposition':{'type':Sequelize[_0x7e8a('0x5')]},'note':{'type':Sequelize[_0x7e8a('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x7e8a('0x5')]},'cc':{'type':Sequelize[_0x7e8a('0x6')](_0x7e8a('0x7'))},'subject':{'type':Sequelize[_0x7e8a('0x6')]()},'attach':{'type':Sequelize[_0x7e8a('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x7e8a('0x4')]},'substatus':{'type':Sequelize[_0x7e8a('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7e8a('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7e8a('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x7e8a('0x9')]('in',_0x7e8a('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x7e8a('0xa')]}}; \ No newline at end of file +var _0x4576=['out','BOOLEAN','DATE','STRING','TEXT','long','ENUM'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0x4576,0xaa));var _0x6457=function(_0x199a37,_0xed1c57){_0x199a37=_0x199a37-0x0;var _0x53071c=_0x4576[_0x199a37];return _0x53071c;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6457('0x0')]},'disposition':{'type':Sequelize[_0x6457('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6457('0x1')]},'inReplyTo':{'type':Sequelize[_0x6457('0x1')](0x1fe)},'to':{'type':Sequelize[_0x6457('0x1')]},'cc':{'type':Sequelize[_0x6457('0x2')](_0x6457('0x3'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x6457('0x0')]},'substatus':{'type':Sequelize[_0x6457('0x1')](0x3c)},'substatusAt':{'type':Sequelize[_0x6457('0x0')]},'firstMsgDirection':{'type':Sequelize[_0x6457('0x4')]('in',_0x6457('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6457('0x0')]},'lastMsgDirection':{'type':Sequelize[_0x6457('0x4')]('in',_0x6457('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6457('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 9becda1..c12f082 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 _0xe895=['options','find','create','body','describe','addMessage','MailMessage','omit','ids','getMessages','findOne','hasOwnProperty','order','sort','where','filter','map','$gte','split','format','inlineCss','rows','addTags','spread','color','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','push','Attachments','Messages','from','bcc','subject','get','mkdirSync','each','missing.recipient@your.company.com','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','sendStatus','eml-format','zip-dir','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','getOptions','findAll','mail','query','user','catch','params','model','MailInteraction','keys','filters','intersection','attributes','fields','length','includeAll','include','merge'];(function(_0x18f917,_0x4d3ae5){var _0x4d013d=function(_0x5c9acc){while(--_0x5c9acc){_0x18f917['push'](_0x18f917['shift']());}};_0x4d013d(++_0x4d3ae5);}(_0xe895,0x11b));var _0x5e89=function(_0x55bd12,_0x3ccb52){_0x55bd12=_0x55bd12-0x0;var _0x1941dd=_0xe895[_0x55bd12];return _0x1941dd;};'use strict';var emlformat=require(_0x5e89('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e89('0x1'));var moment=require(_0x5e89('0x2'));var BPromise=require(_0x5e89('0x3'));var util=require(_0x5e89('0x4'));var path=require(_0x5e89('0x5'));var fs=require('fs');var _=require(_0x5e89('0x6'));var juice=require(_0x5e89('0x7'));var Redis=require(_0x5e89('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0x5e89('0x9'));var logger=require(_0x5e89('0xa'))(_0x5e89('0xb'));var config=require(_0x5e89('0xc'));var db=require(_0x5e89('0xd'))['db'];var htmlEntities=require('html-entities');config[_0x5e89('0xe')]=_['defaults'](config[_0x5e89('0xe')],{'host':_0x5e89('0xf'),'port':0x18eb});var socket=require(_0x5e89('0x10'))(new Redis(config['redis']));require(_0x5e89('0x11'))[_0x5e89('0x12')](socket);function respondWithStatusCode(_0x2f4e15,_0x2ea423){_0x2ea423=_0x2ea423||0xcc;return function(_0x158d4c){if(_0x158d4c){return _0x2f4e15['sendStatus'](_0x2ea423);}return _0x2f4e15[_0x5e89('0x13')](_0x2ea423)['end']();};}function respondWithResult(_0x304dda,_0x205223){_0x205223=_0x205223||0xc8;return function(_0xf4e24e){if(_0xf4e24e){return _0x304dda[_0x5e89('0x13')](_0x205223)[_0x5e89('0x14')](_0xf4e24e);}};}function respondWithFilteredResult(_0x226ace,_0x522ba1){return function(_0x4c6436){if(_0x4c6436){var _0x1a9781=typeof _0x522ba1[_0x5e89('0x15')]==='undefined'&&typeof _0x522ba1[_0x5e89('0x16')]===_0x5e89('0x17');var _0x2160e1=_0x4c6436[_0x5e89('0x18')];var _0x1d795b=_0x1a9781?0x0:_0x522ba1[_0x5e89('0x15')];var _0x18d9aa=_0x1a9781?_0x4c6436[_0x5e89('0x18')]:_0x522ba1[_0x5e89('0x15')]+_0x522ba1[_0x5e89('0x16')];var _0x1e6902;if(_0x18d9aa>=_0x2160e1){_0x18d9aa=_0x2160e1;_0x1e6902=0xc8;}else{_0x1e6902=0xce;}_0x226ace['status'](_0x1e6902);return _0x226ace[_0x5e89('0x19')](_0x5e89('0x1a'),_0x1d795b+'-'+_0x18d9aa+'/'+_0x2160e1)[_0x5e89('0x14')](_0x4c6436);}return null;};}function saveUpdates(_0x4b5b60){return function(_0x10e7d6){if(_0x10e7d6){return _0x10e7d6[_0x5e89('0x1b')](_0x4b5b60)[_0x5e89('0x1c')](function(_0x1208ff){return _0x1208ff;});}return null;};}function removeEntity(_0x3114e9){return function(_0x39ae79){if(_0x39ae79){return _0x39ae79[_0x5e89('0x1d')]()['then'](function(){_0x3114e9[_0x5e89('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18b4bf){return function(_0x16a775){if(!_0x16a775){_0x18b4bf['sendStatus'](0x194);}return _0x16a775;};}function handleError(_0x42c08d,_0x41af3a){_0x41af3a=_0x41af3a||0x1f4;return function(_0x381996){logger[_0x5e89('0x1e')](_0x381996[_0x5e89('0x1f')]);if(_0x381996[_0x5e89('0x20')]){delete _0x381996[_0x5e89('0x20')];}_0x42c08d[_0x5e89('0x13')](_0x41af3a)[_0x5e89('0x21')](_0x381996);};}exports[_0x5e89('0x22')]=function(_0x39ae4b,_0x5da418){var _0x2d1f77={};var _0x2c15e0=_['map'](db['MailInteraction'][_0x5e89('0x23')],function(_0x3b874e){return{'name':_0x3b874e[_0x5e89('0x24')],'type':_0x3b874e[_0x5e89('0x25')]['key']};});_0x2d1f77=qs[_0x5e89('0x26')](_0x2c15e0,_0x39ae4b);return interaction[_0x5e89('0x27')](_0x5e89('0x28'),_0x39ae4b[_0x5e89('0x29')],_0x39ae4b[_0x5e89('0x2a')],_0x2d1f77,_0x2c15e0)['then'](respondWithFilteredResult(_0x5da418,_0x2d1f77))[_0x5e89('0x2b')](handleError(_0x5da418,null));};exports['show']=function(_0xdfa356,_0x2f8fe5){var _0xfdf5c9={'raw':![],'where':{'id':_0xdfa356[_0x5e89('0x2c')]['id']}},_0x466690={};_0x466690[_0x5e89('0x2d')]=_['keys'](db[_0x5e89('0x2e')][_0x5e89('0x23')]);_0x466690[_0x5e89('0x29')]=_[_0x5e89('0x2f')](_0xdfa356[_0x5e89('0x29')]);_0x466690[_0x5e89('0x30')]=_[_0x5e89('0x31')](_0x466690[_0x5e89('0x2d')],_0x466690[_0x5e89('0x29')]);_0xfdf5c9[_0x5e89('0x32')]=_[_0x5e89('0x31')](_0x466690[_0x5e89('0x2d')],qs[_0x5e89('0x33')](_0xdfa356['query'][_0x5e89('0x33')]));_0xfdf5c9[_0x5e89('0x32')]=_0xfdf5c9[_0x5e89('0x32')][_0x5e89('0x34')]?_0xfdf5c9['attributes']:_0x466690[_0x5e89('0x2d')];if(_0xdfa356[_0x5e89('0x29')][_0x5e89('0x35')]){_0xfdf5c9[_0x5e89('0x36')]=[{'all':!![]}];}_0xfdf5c9=_[_0x5e89('0x37')]({},_0xfdf5c9,_0xdfa356[_0x5e89('0x38')]);return db[_0x5e89('0x2e')][_0x5e89('0x39')](_0xfdf5c9)['then'](handleEntityNotFound(_0x2f8fe5,null))[_0x5e89('0x1c')](respondWithResult(_0x2f8fe5,null))[_0x5e89('0x2b')](handleError(_0x2f8fe5,null));};exports[_0x5e89('0x3a')]=function(_0x510723,_0x5d871f){return db[_0x5e89('0x2e')]['create'](_0x510723[_0x5e89('0x3b')],{})[_0x5e89('0x1c')](respondWithResult(_0x5d871f,0xc9))[_0x5e89('0x2b')](handleError(_0x5d871f,null));};exports['update']=function(_0x11bf71,_0x3fe354){if(_0x11bf71['body']['id']){delete _0x11bf71[_0x5e89('0x3b')]['id'];}return db[_0x5e89('0x2e')]['find']({'where':{'id':_0x11bf71[_0x5e89('0x2c')]['id']}})[_0x5e89('0x1c')](handleEntityNotFound(_0x3fe354,null))[_0x5e89('0x1c')](saveUpdates(_0x11bf71['body'],null))['then'](respondWithResult(_0x3fe354,null))[_0x5e89('0x2b')](handleError(_0x3fe354,null));};exports[_0x5e89('0x1d')]=function(_0x33e644,_0x484a2b){return db[_0x5e89('0x2e')][_0x5e89('0x39')]({'where':{'id':_0x33e644[_0x5e89('0x2c')]['id']}})[_0x5e89('0x1c')](handleEntityNotFound(_0x484a2b,null))['then'](removeEntity(_0x484a2b,null))[_0x5e89('0x2b')](handleError(_0x484a2b,null));};exports[_0x5e89('0x3c')]=function(_0x181aeb,_0x323b4c){return db['MailInteraction'][_0x5e89('0x3c')]()['then'](respondWithResult(_0x323b4c,null))[_0x5e89('0x2b')](handleError(_0x323b4c,null));};exports[_0x5e89('0x3d')]=function(_0x12333a,_0x53d3d0){return db[_0x5e89('0x3e')][_0x5e89('0x39')]({'where':{'id':_0x12333a[_0x5e89('0x2c')]['id']}})[_0x5e89('0x1c')](handleEntityNotFound(_0x53d3d0,null))[_0x5e89('0x1c')](function(_0x5796d2){if(_0x5796d2){return _0x5796d2[_0x5e89('0x3d')](_0x12333a[_0x5e89('0x3b')]['ids'],_[_0x5e89('0x3f')](_0x12333a['body'],[_0x5e89('0x40'),'id'])||{});}})['then'](respondWithResult(_0x53d3d0,null))[_0x5e89('0x2b')](handleError(_0x53d3d0,null));};exports[_0x5e89('0x41')]=function(_0x34dba6,_0x5ce050){var _0x4ab079={'raw':![],'where':{}};var _0x4bf1ea={};var _0x312dda={'count':0x0,'rows':[]};return db[_0x5e89('0x2e')][_0x5e89('0x42')]({'where':{'id':_0x34dba6[_0x5e89('0x2c')]['id']}})[_0x5e89('0x1c')](handleEntityNotFound(_0x5ce050,null))[_0x5e89('0x1c')](function(_0x5409bc){if(_0x5409bc){_0x4bf1ea[_0x5e89('0x2d')]=_[_0x5e89('0x2f')](db[_0x5e89('0x3e')][_0x5e89('0x23')]);_0x4bf1ea['query']=_['keys'](_0x34dba6[_0x5e89('0x29')]);_0x4bf1ea[_0x5e89('0x30')]=_['intersection'](_0x4bf1ea[_0x5e89('0x2d')],_0x4bf1ea['query']);_0x4ab079['attributes']=_[_0x5e89('0x31')](_0x4bf1ea['model'],qs['fields'](_0x34dba6[_0x5e89('0x29')][_0x5e89('0x33')]));_0x4ab079[_0x5e89('0x32')]=_0x4ab079[_0x5e89('0x32')][_0x5e89('0x34')]?_0x4ab079[_0x5e89('0x32')]:_0x4bf1ea[_0x5e89('0x2d')];if(!_0x34dba6[_0x5e89('0x29')][_0x5e89('0x43')]('nolimit')){_0x4ab079[_0x5e89('0x16')]=qs[_0x5e89('0x16')](_0x34dba6['query'][_0x5e89('0x16')]);_0x4ab079[_0x5e89('0x15')]=qs['offset'](_0x34dba6[_0x5e89('0x29')][_0x5e89('0x15')]);}_0x4ab079[_0x5e89('0x44')]=qs[_0x5e89('0x45')](_0x34dba6[_0x5e89('0x29')]['sort']);_0x4ab079[_0x5e89('0x46')]=qs['filters'](_['pick'](_0x34dba6[_0x5e89('0x29')],_0x4bf1ea[_0x5e89('0x30')]));_0x4ab079[_0x5e89('0x46')]['MailInteractionId']=_0x5409bc['id'];if(_0x34dba6[_0x5e89('0x29')][_0x5e89('0x47')]){_0x4ab079[_0x5e89('0x46')]=_['merge'](_0x4ab079['where'],{'$or':_[_0x5e89('0x48')](_0x4ab079[_0x5e89('0x32')],function(_0x287ccd){var _0x59ed2d={};_0x59ed2d[_0x287ccd]={'$like':'%'+_0x34dba6[_0x5e89('0x29')]['filter']+'%'};return _0x59ed2d;})});}if(_0x34dba6[_0x5e89('0x29')][_0x5e89('0x49')]){var _0x21df8a=_0x34dba6[_0x5e89('0x29')][_0x5e89('0x49')][_0x5e89('0x4a')](',');var _0x2ca99b={};_0x2ca99b[_0x21df8a[0x0]]={'$gte':moment(_0x21df8a[0x1])[_0x5e89('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4ab079[_0x5e89('0x46')]=_[_0x5e89('0x37')](_0x4ab079[_0x5e89('0x46')],_0x2ca99b);}_0x4ab079=_[_0x5e89('0x37')]({},_0x4ab079,_0x34dba6[_0x5e89('0x38')]);return db[_0x5e89('0x3e')][_0x5e89('0x18')]({'where':_0x4ab079['where']})[_0x5e89('0x1c')](function(_0x3e27b1){_0x312dda['count']=_0x3e27b1;if(_0x34dba6['query'][_0x5e89('0x35')]){_0x4ab079['include']=[{'all':!![]}];}return db[_0x5e89('0x3e')]['findAll'](_0x4ab079);})[_0x5e89('0x1c')](function(_0x3160e3){if(_0x34dba6['query'][_0x5e89('0x4c')]==='true'){for(var _0x2146ed=0x0;_0x2146ed<_0x3160e3[_0x5e89('0x34')];_0x2146ed++){_0x3160e3[_0x2146ed]['body']=juice(_0x3160e3[_0x2146ed]['body']);}}_0x312dda[_0x5e89('0x4d')]=_0x3160e3;return _0x312dda;});}})[_0x5e89('0x1c')](respondWithFilteredResult(_0x5ce050,_0x4ab079))[_0x5e89('0x2b')](handleError(_0x5ce050,null));};exports[_0x5e89('0x4e')]=function(_0x105eb0,_0x135494){return db[_0x5e89('0x2e')]['find']({'where':{'id':_0x105eb0['params']['id']}})[_0x5e89('0x1c')](handleEntityNotFound(_0x135494,null))['then'](function(_0x25189b){if(_0x25189b){return _0x25189b['setTags'](_0x105eb0[_0x5e89('0x3b')][_0x5e89('0x40')],_['omit'](_0x105eb0[_0x5e89('0x3b')],['ids','id'])||{})[_0x5e89('0x4f')](function(){return db['Tag'][_0x5e89('0x27')]({'attributes':['id','name',_0x5e89('0x50')],'where':{'id':_0x105eb0[_0x5e89('0x3b')][_0x5e89('0x40')]}});})[_0x5e89('0x1c')](function(_0x2e31f6){socket[_0x5e89('0x51')](_0x5e89('0x52'),{'id':Number(_0x105eb0['params']['id']),'tags':_0x2e31f6||[]});return{'id':Number(_0x105eb0[_0x5e89('0x2c')]['id']),'tags':_0x2e31f6||[]};});}})[_0x5e89('0x1c')](respondWithResult(_0x135494,null))[_0x5e89('0x2b')](handleError(_0x135494,null));};exports[_0x5e89('0x53')]=function(_0x2ff94e,_0x329c5d){return db[_0x5e89('0x2e')]['find']({'where':{'id':_0x2ff94e['params']['id']}})[_0x5e89('0x1c')](handleEntityNotFound(_0x329c5d,null))['then'](function(_0x463530){if(_0x463530){return _0x463530['removeTags'](_0x2ff94e[_0x5e89('0x29')]['ids']);}})[_0x5e89('0x1c')](respondWithStatusCode(_0x329c5d,null))['catch'](handleError(_0x329c5d,null));};exports[_0x5e89('0x54')]=function(_0xbcea20,_0x5b3896){var _0x3fce25=moment()[_0x5e89('0x55')]()['toString']();var _0x478377=path[_0x5e89('0x56')](config['root'],_0x5e89('0x57'),'files',_0x5e89('0x58'));var _0x3bbd2c=path[_0x5e89('0x56')](config[_0x5e89('0x59')],_0x5e89('0x57'),_0x5e89('0x5a'),_0x5e89('0x5b'));var _0x47f3e8=path[_0x5e89('0x56')](_0x478377,_0x3fce25);var _0x2353b3=util[_0x5e89('0x4b')]('transcript-%d-%s.zip',_0xbcea20['params']['id'],_0x3fce25);var _0xcfbf4f=path[_0x5e89('0x56')](_0x478377,_0x2353b3);var _0x41f956=[];if(_0xbcea20[_0x5e89('0x29')][_0x5e89('0x5b')]){_0x41f956[_0x5e89('0x5c')]({'model':db['Attachment'],'as':_0x5e89('0x5d'),'raw':!![]});}var _0x11e4c0=[{'model':db[_0x5e89('0x3e')],'as':_0x5e89('0x5e'),'attributes':['id',_0x5e89('0x3b'),_0x5e89('0x5f'),'to','cc',_0x5e89('0x60'),_0x5e89('0x61'),'createdAt'],'where':{'secret':![]},'order':qs[_0x5e89('0x45')]('id'),'include':_0x41f956}];return db[_0x5e89('0x2e')]['find']({'where':{'id':_0xbcea20[_0x5e89('0x2c')]['id']},'include':_0x11e4c0})['then'](handleEntityNotFound(_0x5b3896,null))[_0x5e89('0x1c')](function(_0x5cfad2){if(_0x5cfad2&&_0x5cfad2[_0x5e89('0x5e')]){var _0x2e424e=_0x5cfad2[_0x5e89('0x62')]({'plain':!![]});fs[_0x5e89('0x63')](_0x47f3e8);return BPromise[_0x5e89('0x64')](_0x2e424e[_0x5e89('0x5e')],function(_0x402988,_0x9998f){var _0x17e666={'from':_0x402988['from'],'to':_0x402988['to']||_0x5e89('0x65'),'subject':_0x402988[_0x5e89('0x61')],'html':htmlEntities['decode'](_0x402988[_0x5e89('0x3b')]),'headers':{'Date':moment(_0x402988[_0x5e89('0x66')])[_0x5e89('0x4b')](_0x5e89('0x67'))},'attachments':[]};if(_0x402988['cc']){_0x17e666['headers']['Cc']=_0x402988['cc'];}if(_0x402988[_0x5e89('0x60')]){_0x17e666[_0x5e89('0x68')][_0x5e89('0x69')]=_0x402988[_0x5e89('0x60')];}return new BPromise(function(_0x2a82be,_0x2e52fd){if(_0x402988['Attachments']){for(var _0x32bac2=0x0;_0x32bac2<_0x402988[_0x5e89('0x5d')][_0x5e89('0x34')];_0x32bac2++){var _0x590111=_0x402988[_0x5e89('0x5d')][_0x32bac2];var _0x32b221=path[_0x5e89('0x56')](_0x3bbd2c,_0x590111['basename']);if(fs[_0x5e89('0x6a')](_0x32b221)){_0x17e666[_0x5e89('0x5b')]['push']({'name':_0x590111[_0x5e89('0x20')],'contentType':_0x590111[_0x5e89('0x25')],'data':fs[_0x5e89('0x6b')](_0x32b221)});}}}emlformat[_0x5e89('0x6c')](_0x17e666,function(_0x361a6d,_0x334cc3){if(_0x361a6d)return _0x2e52fd(_0x361a6d);fs[_0x5e89('0x6d')](path['join'](_0x47f3e8,util[_0x5e89('0x4b')](_0x5e89('0x6e'),_0x9998f)),_0x334cc3);return _0x2a82be(_0x334cc3);});});})[_0x5e89('0x1c')](function(){return new BPromise(function(_0x3f7265,_0x445d7d){zipdir(_0x47f3e8,{'saveTo':_0xcfbf4f},function(_0x597f02,_0x1877bc){if(_0x597f02)return _0x445d7d(_0x597f02);return _0x3f7265(_0x1877bc);});})[_0x5e89('0x1c')](function(){return new BPromise(function(_0x4f2f3b,_0x161c63){rimraf(_0x47f3e8,function(_0x278075){if(_0x278075)_0x161c63(_0x278075);return _0x4f2f3b();});});})[_0x5e89('0x1c')](function(){return _0x5b3896[_0x5e89('0x54')](_0xcfbf4f,_0x2353b3,function(_0x37d194){if(!_0x37d194)fs[_0x5e89('0x6f')](_0xcfbf4f);});});});}else{return _0x5b3896[_0x5e89('0x70')](0xc8);}})[_0x5e89('0x2b')](handleError(_0x5b3896,null));}; \ No newline at end of file +var _0xc26e=['params','describe','MailMessage','addMessage','ids','getMessages','findOne','sort','where','pick','MailInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','inlineCss','true','rows','setTags','omit','spread','Tag','color','emit','mailInteractionTags:save','removeTags','toString','root','join','server','files','attachments','Attachments','Messages','bcc','subject','createdAt','get','from','missing.recipient@your.company.com','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','html-entities','redis','localhost','./mailInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','update','then','end','error','name','send','index','map','rawAttributes','type','key','getOptions','user','catch','show','model','keys','MailInteraction','query','filters','attributes','intersection','fields','length','merge','options','find','create','body'];(function(_0x4b831b,_0xa6c4f2){var _0x4b63e5=function(_0xc71177){while(--_0xc71177){_0x4b831b['push'](_0x4b831b['shift']());}};_0x4b63e5(++_0xa6c4f2);}(_0xc26e,0x10b));var _0xec26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xec26('0x0'));var rimraf=require(_0xec26('0x1'));var zipdir=require(_0xec26('0x2'));var moment=require(_0xec26('0x3'));var BPromise=require(_0xec26('0x4'));var util=require(_0xec26('0x5'));var path=require(_0xec26('0x6'));var fs=require('fs');var _=require('lodash');var juice=require(_0xec26('0x7'));var Redis=require(_0xec26('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0xec26('0x9'));var logger=require(_0xec26('0xa'))(_0xec26('0xb'));var config=require(_0xec26('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xec26('0xd'));config[_0xec26('0xe')]=_['defaults'](config['redis'],{'host':_0xec26('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xec26('0xe')]));require(_0xec26('0x10'))['register'](socket);function respondWithStatusCode(_0x53ce76,_0x38e5de){_0x38e5de=_0x38e5de||0xcc;return function(_0x3dd5ad){if(_0x3dd5ad){return _0x53ce76[_0xec26('0x11')](_0x38e5de);}return _0x53ce76[_0xec26('0x12')](_0x38e5de)['end']();};}function respondWithResult(_0x41a110,_0x1c00d7){_0x1c00d7=_0x1c00d7||0xc8;return function(_0x451505){if(_0x451505){return _0x41a110['status'](_0x1c00d7)[_0xec26('0x13')](_0x451505);}};}function respondWithFilteredResult(_0x103b72,_0x28bbb5){return function(_0xe80d25){if(_0xe80d25){var _0x225de9=typeof _0x28bbb5[_0xec26('0x14')]===_0xec26('0x15')&&typeof _0x28bbb5[_0xec26('0x16')]===_0xec26('0x15');var _0x2ad3c8=_0xe80d25[_0xec26('0x17')];var _0x42099f=_0x225de9?0x0:_0x28bbb5[_0xec26('0x14')];var _0x45f404=_0x225de9?_0xe80d25[_0xec26('0x17')]:_0x28bbb5[_0xec26('0x14')]+_0x28bbb5['limit'];var _0x4eccff;if(_0x45f404>=_0x2ad3c8){_0x45f404=_0x2ad3c8;_0x4eccff=0xc8;}else{_0x4eccff=0xce;}_0x103b72['status'](_0x4eccff);return _0x103b72[_0xec26('0x18')]('Content-Range',_0x42099f+'-'+_0x45f404+'/'+_0x2ad3c8)[_0xec26('0x13')](_0xe80d25);}return null;};}function saveUpdates(_0x7a9326){return function(_0x44663d){if(_0x44663d){return _0x44663d[_0xec26('0x19')](_0x7a9326)[_0xec26('0x1a')](function(_0x186b22){return _0x186b22;});}return null;};}function removeEntity(_0x55884a){return function(_0x11c09d){if(_0x11c09d){return _0x11c09d['destroy']()['then'](function(){_0x55884a[_0xec26('0x12')](0xcc)[_0xec26('0x1b')]();});}};}function handleEntityNotFound(_0x345e10){return function(_0xeb2429){if(!_0xeb2429){_0x345e10[_0xec26('0x11')](0x194);}return _0xeb2429;};}function handleError(_0x7135c0,_0x3348e3){_0x3348e3=_0x3348e3||0x1f4;return function(_0x27e3e4){logger[_0xec26('0x1c')](_0x27e3e4['stack']);if(_0x27e3e4[_0xec26('0x1d')]){delete _0x27e3e4[_0xec26('0x1d')];}_0x7135c0[_0xec26('0x12')](_0x3348e3)[_0xec26('0x1e')](_0x27e3e4);};}exports[_0xec26('0x1f')]=function(_0xd74fbb,_0x553a48){var _0xb7635d={};var _0x301e03=_[_0xec26('0x20')](db['MailInteraction'][_0xec26('0x21')],function(_0x3af5f0){return{'name':_0x3af5f0['fieldName'],'type':_0x3af5f0[_0xec26('0x22')][_0xec26('0x23')]};});_0xb7635d=qs[_0xec26('0x24')](_0x301e03,_0xd74fbb);return interaction['findAll']('mail',_0xd74fbb['query'],_0xd74fbb[_0xec26('0x25')],_0xb7635d,_0x301e03)['then'](respondWithFilteredResult(_0x553a48,_0xb7635d))[_0xec26('0x26')](handleError(_0x553a48,null));};exports[_0xec26('0x27')]=function(_0x2d95e2,_0x5c0079){var _0x5c7127={'raw':![],'where':{'id':_0x2d95e2['params']['id']}},_0x16a8b1={};_0x16a8b1[_0xec26('0x28')]=_[_0xec26('0x29')](db[_0xec26('0x2a')][_0xec26('0x21')]);_0x16a8b1['query']=_[_0xec26('0x29')](_0x2d95e2[_0xec26('0x2b')]);_0x16a8b1[_0xec26('0x2c')]=_['intersection'](_0x16a8b1[_0xec26('0x28')],_0x16a8b1[_0xec26('0x2b')]);_0x5c7127[_0xec26('0x2d')]=_[_0xec26('0x2e')](_0x16a8b1[_0xec26('0x28')],qs[_0xec26('0x2f')](_0x2d95e2[_0xec26('0x2b')][_0xec26('0x2f')]));_0x5c7127[_0xec26('0x2d')]=_0x5c7127[_0xec26('0x2d')][_0xec26('0x30')]?_0x5c7127[_0xec26('0x2d')]:_0x16a8b1[_0xec26('0x28')];if(_0x2d95e2[_0xec26('0x2b')]['includeAll']){_0x5c7127['include']=[{'all':!![]}];}_0x5c7127=_[_0xec26('0x31')]({},_0x5c7127,_0x2d95e2[_0xec26('0x32')]);return db[_0xec26('0x2a')][_0xec26('0x33')](_0x5c7127)['then'](handleEntityNotFound(_0x5c0079,null))[_0xec26('0x1a')](respondWithResult(_0x5c0079,null))[_0xec26('0x26')](handleError(_0x5c0079,null));};exports[_0xec26('0x34')]=function(_0x477ff3,_0x5aa9ce){return db['MailInteraction'][_0xec26('0x34')](_0x477ff3['body'],{})[_0xec26('0x1a')](respondWithResult(_0x5aa9ce,0xc9))[_0xec26('0x26')](handleError(_0x5aa9ce,null));};exports[_0xec26('0x19')]=function(_0x29bab8,_0x1def93){if(_0x29bab8['body']['id']){delete _0x29bab8[_0xec26('0x35')]['id'];}return db[_0xec26('0x2a')][_0xec26('0x33')]({'where':{'id':_0x29bab8[_0xec26('0x36')]['id']}})[_0xec26('0x1a')](handleEntityNotFound(_0x1def93,null))[_0xec26('0x1a')](saveUpdates(_0x29bab8['body'],null))[_0xec26('0x1a')](respondWithResult(_0x1def93,null))[_0xec26('0x26')](handleError(_0x1def93,null));};exports['destroy']=function(_0x5b9c32,_0x5dd9af){return db[_0xec26('0x2a')][_0xec26('0x33')]({'where':{'id':_0x5b9c32['params']['id']}})['then'](handleEntityNotFound(_0x5dd9af,null))[_0xec26('0x1a')](removeEntity(_0x5dd9af,null))[_0xec26('0x26')](handleError(_0x5dd9af,null));};exports[_0xec26('0x37')]=function(_0x1eac1a,_0x5f2daa){return db[_0xec26('0x2a')][_0xec26('0x37')]()[_0xec26('0x1a')](respondWithResult(_0x5f2daa,null))[_0xec26('0x26')](handleError(_0x5f2daa,null));};exports['addMessage']=function(_0x4e9e7c,_0x2abdaf){return db[_0xec26('0x38')][_0xec26('0x33')]({'where':{'id':_0x4e9e7c[_0xec26('0x36')]['id']}})[_0xec26('0x1a')](handleEntityNotFound(_0x2abdaf,null))[_0xec26('0x1a')](function(_0x3b5924){if(_0x3b5924){return _0x3b5924[_0xec26('0x39')](_0x4e9e7c[_0xec26('0x35')][_0xec26('0x3a')],_['omit'](_0x4e9e7c[_0xec26('0x35')],[_0xec26('0x3a'),'id'])||{});}})[_0xec26('0x1a')](respondWithResult(_0x2abdaf,null))[_0xec26('0x26')](handleError(_0x2abdaf,null));};exports[_0xec26('0x3b')]=function(_0x167d68,_0x2ad9e7){var _0x1d9d55={'raw':![],'where':{}};var _0x246e69={};var _0x2e087c={'count':0x0,'rows':[]};return db[_0xec26('0x2a')][_0xec26('0x3c')]({'where':{'id':_0x167d68['params']['id']}})[_0xec26('0x1a')](handleEntityNotFound(_0x2ad9e7,null))[_0xec26('0x1a')](function(_0x4913c2){if(_0x4913c2){_0x246e69['model']=_[_0xec26('0x29')](db[_0xec26('0x38')][_0xec26('0x21')]);_0x246e69[_0xec26('0x2b')]=_[_0xec26('0x29')](_0x167d68['query']);_0x246e69[_0xec26('0x2c')]=_[_0xec26('0x2e')](_0x246e69['model'],_0x246e69[_0xec26('0x2b')]);_0x1d9d55[_0xec26('0x2d')]=_[_0xec26('0x2e')](_0x246e69[_0xec26('0x28')],qs['fields'](_0x167d68[_0xec26('0x2b')][_0xec26('0x2f')]));_0x1d9d55['attributes']=_0x1d9d55[_0xec26('0x2d')][_0xec26('0x30')]?_0x1d9d55[_0xec26('0x2d')]:_0x246e69[_0xec26('0x28')];if(!_0x167d68[_0xec26('0x2b')]['hasOwnProperty']('nolimit')){_0x1d9d55[_0xec26('0x16')]=qs[_0xec26('0x16')](_0x167d68[_0xec26('0x2b')][_0xec26('0x16')]);_0x1d9d55['offset']=qs[_0xec26('0x14')](_0x167d68[_0xec26('0x2b')][_0xec26('0x14')]);}_0x1d9d55['order']=qs[_0xec26('0x3d')](_0x167d68['query'][_0xec26('0x3d')]);_0x1d9d55[_0xec26('0x3e')]=qs['filters'](_[_0xec26('0x3f')](_0x167d68[_0xec26('0x2b')],_0x246e69[_0xec26('0x2c')]));_0x1d9d55[_0xec26('0x3e')][_0xec26('0x40')]=_0x4913c2['id'];if(_0x167d68[_0xec26('0x2b')][_0xec26('0x41')]){_0x1d9d55[_0xec26('0x3e')]=_[_0xec26('0x31')](_0x1d9d55[_0xec26('0x3e')],{'$or':_[_0xec26('0x20')](_0x1d9d55[_0xec26('0x2d')],function(_0x1c4c0e){var _0x22f8a6={};_0x22f8a6[_0x1c4c0e]={'$like':'%'+_0x167d68[_0xec26('0x2b')][_0xec26('0x41')]+'%'};return _0x22f8a6;})});}if(_0x167d68[_0xec26('0x2b')][_0xec26('0x42')]){var _0x5d9652=_0x167d68[_0xec26('0x2b')][_0xec26('0x42')]['split'](',');var _0x34c418={};_0x34c418[_0x5d9652[0x0]]={'$gte':moment(_0x5d9652[0x1])[_0xec26('0x43')](_0xec26('0x44'))};_0x1d9d55[_0xec26('0x3e')]=_[_0xec26('0x31')](_0x1d9d55[_0xec26('0x3e')],_0x34c418);}_0x1d9d55=_[_0xec26('0x31')]({},_0x1d9d55,_0x167d68['options']);return db[_0xec26('0x38')][_0xec26('0x17')]({'where':_0x1d9d55['where']})[_0xec26('0x1a')](function(_0x23e490){_0x2e087c[_0xec26('0x17')]=_0x23e490;if(_0x167d68['query'][_0xec26('0x45')]){_0x1d9d55[_0xec26('0x46')]=[{'all':!![]}];}return db[_0xec26('0x38')][_0xec26('0x47')](_0x1d9d55);})[_0xec26('0x1a')](function(_0xb5a932){if(_0x167d68['query'][_0xec26('0x48')]===_0xec26('0x49')){for(var _0x2f944e=0x0;_0x2f944e<_0xb5a932['length'];_0x2f944e++){_0xb5a932[_0x2f944e]['body']=juice(_0xb5a932[_0x2f944e][_0xec26('0x35')]);}}_0x2e087c[_0xec26('0x4a')]=_0xb5a932;return _0x2e087c;});}})[_0xec26('0x1a')](respondWithFilteredResult(_0x2ad9e7,_0x1d9d55))[_0xec26('0x26')](handleError(_0x2ad9e7,null));};exports['addTags']=function(_0x5281ce,_0x2a6b13){return db[_0xec26('0x2a')][_0xec26('0x33')]({'where':{'id':_0x5281ce[_0xec26('0x36')]['id']}})['then'](handleEntityNotFound(_0x2a6b13,null))[_0xec26('0x1a')](function(_0x8c97e){if(_0x8c97e){return _0x8c97e[_0xec26('0x4b')](_0x5281ce[_0xec26('0x35')]['ids'],_[_0xec26('0x4c')](_0x5281ce['body'],[_0xec26('0x3a'),'id'])||{})[_0xec26('0x4d')](function(){return db[_0xec26('0x4e')][_0xec26('0x47')]({'attributes':['id',_0xec26('0x1d'),_0xec26('0x4f')],'where':{'id':_0x5281ce['body'][_0xec26('0x3a')]}});})[_0xec26('0x1a')](function(_0xa9be79){socket[_0xec26('0x50')](_0xec26('0x51'),{'id':Number(_0x5281ce[_0xec26('0x36')]['id']),'tags':_0xa9be79||[]});return{'id':Number(_0x5281ce[_0xec26('0x36')]['id']),'tags':_0xa9be79||[]};});}})[_0xec26('0x1a')](respondWithResult(_0x2a6b13,null))['catch'](handleError(_0x2a6b13,null));};exports[_0xec26('0x52')]=function(_0x3c298f,_0xd807f4){return db[_0xec26('0x2a')][_0xec26('0x33')]({'where':{'id':_0x3c298f[_0xec26('0x36')]['id']}})[_0xec26('0x1a')](handleEntityNotFound(_0xd807f4,null))['then'](function(_0x58d065){if(_0x58d065){return _0x58d065[_0xec26('0x52')](_0x3c298f['query'][_0xec26('0x3a')]);}})[_0xec26('0x1a')](respondWithStatusCode(_0xd807f4,null))[_0xec26('0x26')](handleError(_0xd807f4,null));};exports['download']=function(_0x365666,_0x8bda5b){var _0x4a539d=moment()['unix']()[_0xec26('0x53')]();var _0x521226=path['join'](config[_0xec26('0x54')],'server','files','tmp');var _0xc1594f=path[_0xec26('0x55')](config[_0xec26('0x54')],_0xec26('0x56'),_0xec26('0x57'),'attachments');var _0x2e8bff=path[_0xec26('0x55')](_0x521226,_0x4a539d);var _0x514b94=util[_0xec26('0x43')]('transcript-%d-%s.zip',_0x365666['params']['id'],_0x4a539d);var _0x20217b=path[_0xec26('0x55')](_0x521226,_0x514b94);var _0x590452=[];if(_0x365666['query'][_0xec26('0x58')]){_0x590452['push']({'model':db['Attachment'],'as':_0xec26('0x59'),'raw':!![]});}var _0x37a0c9=[{'model':db[_0xec26('0x38')],'as':_0xec26('0x5a'),'attributes':['id',_0xec26('0x35'),'from','to','cc',_0xec26('0x5b'),_0xec26('0x5c'),_0xec26('0x5d')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x590452}];return db['MailInteraction'][_0xec26('0x33')]({'where':{'id':_0x365666[_0xec26('0x36')]['id']},'include':_0x37a0c9})[_0xec26('0x1a')](handleEntityNotFound(_0x8bda5b,null))[_0xec26('0x1a')](function(_0x7da894){if(_0x7da894&&_0x7da894['Messages']){var _0x16d1cc=_0x7da894[_0xec26('0x5e')]({'plain':!![]});fs['mkdirSync'](_0x2e8bff);return BPromise['each'](_0x16d1cc[_0xec26('0x5a')],function(_0x258e02,_0x21e5fd){var _0x3699d2={'from':_0x258e02[_0xec26('0x5f')],'to':_0x258e02['to']||_0xec26('0x60'),'subject':_0x258e02[_0xec26('0x5c')],'html':htmlEntities['decode'](_0x258e02['body']),'headers':{'Date':moment(_0x258e02['createdAt'])['format'](_0xec26('0x61'))},'attachments':[]};if(_0x258e02['cc']){_0x3699d2[_0xec26('0x62')]['Cc']=_0x258e02['cc'];}if(_0x258e02[_0xec26('0x5b')]){_0x3699d2[_0xec26('0x62')][_0xec26('0x63')]=_0x258e02[_0xec26('0x5b')];}return new BPromise(function(_0x3bce92,_0x1b152e){if(_0x258e02[_0xec26('0x59')]){for(var _0x4ae93e=0x0;_0x4ae93e<_0x258e02[_0xec26('0x59')][_0xec26('0x30')];_0x4ae93e++){var _0x1b953f=_0x258e02[_0xec26('0x59')][_0x4ae93e];var _0x1cb193=path[_0xec26('0x55')](_0xc1594f,_0x1b953f['basename']);if(fs['existsSync'](_0x1cb193)){_0x3699d2[_0xec26('0x58')][_0xec26('0x64')]({'name':_0x1b953f[_0xec26('0x1d')],'contentType':_0x1b953f[_0xec26('0x22')],'data':fs[_0xec26('0x65')](_0x1cb193)});}}}emlformat[_0xec26('0x66')](_0x3699d2,function(_0x15d2e3,_0x45f446){if(_0x15d2e3)return _0x1b152e(_0x15d2e3);fs[_0xec26('0x67')](path['join'](_0x2e8bff,util[_0xec26('0x43')](_0xec26('0x68'),_0x21e5fd)),_0x45f446);return _0x3bce92(_0x45f446);});});})['then'](function(){return new BPromise(function(_0x5a56d8,_0x128a0d){zipdir(_0x2e8bff,{'saveTo':_0x20217b},function(_0x1feefb,_0x38b96a){if(_0x1feefb)return _0x128a0d(_0x1feefb);return _0x5a56d8(_0x38b96a);});})[_0xec26('0x1a')](function(){return new BPromise(function(_0x4fde6a,_0x4bbf15){rimraf(_0x2e8bff,function(_0x3a37c7){if(_0x3a37c7)_0x4bbf15(_0x3a37c7);return _0x4fde6a();});});})[_0xec26('0x1a')](function(){return _0x8bda5b[_0xec26('0x69')](_0x20217b,_0x514b94,function(_0x363ff0){if(!_0x363ff0)fs[_0xec26('0x6a')](_0x20217b);});});});}else{return _0x8bda5b[_0xec26('0x11')](0xc8);}})['catch'](handleError(_0x8bda5b,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index d9bf468..c83ae1a 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 _0x946d=['hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','emit','catch'];(function(_0x1039bb,_0x509899){var _0x279dc2=function(_0x10f980){while(--_0x10f980){_0x1039bb['push'](_0x1039bb['shift']());}};_0x279dc2(++_0x509899);}(_0x946d,0x1c2));var _0xd946=function(_0x498288,_0x2c34ec){_0x498288=_0x498288-0x0;var _0xc37555=_0x946d[_0x498288];return _0xc37555;};'use strict';var EventEmitter=require(_0xd946('0x0'));var MailInteraction=require(_0xd946('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xd946('0x1'))['db'][_0xd946('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xd946('0x3')](0x0);var events={'afterCreate':_0xd946('0x4'),'afterUpdate':_0xd946('0x5'),'afterDestroy':_0xd946('0x6')};function emitEvent(_0x56b21f){return function(_0x523278,_0x55bbaf,_0x4971f0){_0x523278[_0xd946('0x7')]({'attributes':['id'],'raw':!![]})[_0xd946('0x8')](function(_0x1f574e){_0x523278[_0xd946('0x9')](_0xd946('0xa'),_0x1f574e[_0xd946('0xb')](function(_0x3200af){return{'id':_0x3200af['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x523278['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd946('0x8')](function(_0x21a96b){_0x523278[_0xd946('0x9')]('unreadMessages',_0x21a96b['length']);MailInteractionEvents[_0xd946('0xc')](_0x56b21f+':'+_0x523278['id'],_0x523278);MailInteractionEvents[_0xd946('0xc')](_0x56b21f,_0x523278);_0x4971f0(null);})[_0xd946('0xd')](_0x4971f0(null));};}for(var e in events){if(events[_0xd946('0xe')](e)){var event=events[e];MailInteraction[_0xd946('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xdfe2=['MailInteraction','MailMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x510237,_0x3a393e){var _0x55aa65=function(_0x119d9f){while(--_0x119d9f){_0x510237['push'](_0x510237['shift']());}};_0x55aa65(++_0x3a393e);}(_0xdfe2,0x7c));var _0x2dfe=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xdfe2[_0x46698a];return _0x356db0;};'use strict';var EventEmitter=require(_0x2dfe('0x0'));var MailInteraction=require(_0x2dfe('0x1'))['db'][_0x2dfe('0x2')];var MailMessage=require(_0x2dfe('0x1'))['db'][_0x2dfe('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2dfe('0x4')](0x0);var events={'afterCreate':_0x2dfe('0x5'),'afterUpdate':_0x2dfe('0x6'),'afterDestroy':'remove'};function emitEvent(_0x35d250){return function(_0x3bbccb,_0x579991,_0x17bcaa){_0x3bbccb[_0x2dfe('0x7')]({'attributes':['id'],'raw':!![]})[_0x2dfe('0x8')](function(_0x1a23ae){_0x3bbccb[_0x2dfe('0x9')](_0x2dfe('0xa'),_0x1a23ae[_0x2dfe('0xb')](function(_0xd89edd){return{'id':_0xd89edd['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x3bbccb['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x28ac07){_0x3bbccb['setDataValue'](_0x2dfe('0xc'),_0x28ac07[_0x2dfe('0xd')]);MailInteractionEvents[_0x2dfe('0xe')](_0x35d250+':'+_0x3bbccb['id'],_0x3bbccb);MailInteractionEvents[_0x2dfe('0xe')](_0x35d250,_0x3bbccb);_0x17bcaa(null);})['catch'](_0x17bcaa(null));};}for(var e in events){if(events[_0x2dfe('0xf')](e)){var event=events[e];MailInteraction[_0x2dfe('0x10')](e,emitEvent(event));}}module[_0x2dfe('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 3d5cd18..4d771ea 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 _0x748c=['catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','substatus','changed','closed','get','MailMessage','then'];(function(_0x1e22f8,_0xea094e){var _0x5e0633=function(_0x3f8f1a){while(--_0x3f8f1a){_0x1e22f8['push'](_0x1e22f8['shift']());}};_0x5e0633(++_0xea094e);}(_0x748c,0x125));var _0xc748=function(_0x1b69af,_0x534c91){_0x1b69af=_0x1b69af-0x0;var _0xc78ff7=_0x748c[_0x1b69af];return _0xc78ff7;};'use strict';var _=require(_0xc748('0x0'));var util=require(_0xc748('0x1'));var logger=require(_0xc748('0x2'))(_0xc748('0x3'));var moment=require(_0xc748('0x4'));var BPromise=require(_0xc748('0x5'));var rp=require(_0xc748('0x6'));var fs=require('fs');var path=require(_0xc748('0x7'));var rimraf=require(_0xc748('0x8'));var config=require(_0xc748('0x9'));var attributes=require(_0xc748('0xa'));module[_0xc748('0xb')]=function(_0x3f4b80,_0x2bb866){return _0x3f4b80['define'](_0xc748('0xc'),attributes,{'tableName':_0xc748('0xd'),'paranoid':![],'indexes':[{'name':_0xc748('0xe'),'fields':[_0xc748('0xf'),'to'],'type':_0xc748('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x20542d,_0x3e2d66,_0x492769){if(_0x20542d['substatus']){_0x20542d[_0xc748('0x11')]=moment()[_0xc748('0x12')](_0xc748('0x13'));}if(_0x20542d['closed']){_0x20542d['closedAt']=moment()[_0xc748('0x12')](_0xc748('0x13'));}_0x492769(null,_0x3e2d66);},'beforeUpdate':function(_0x2f3dbb,_0x2542be,_0x32807a){if(_0x2f3dbb['changed'](_0xc748('0x14'))){_0x2f3dbb[_0xc748('0x11')]=_0x2f3dbb[_0xc748('0x14')]?moment()['format'](_0xc748('0x13')):null;}if(_0x2f3dbb[_0xc748('0x15')](_0xc748('0x16'))){_0x2f3dbb['closedAt']=moment()[_0xc748('0x12')](_0xc748('0x13'));_0x2f3dbb['substatus']=null;_0x2f3dbb[_0xc748('0x11')]=null;}_0x32807a(null,_0x2f3dbb);},'afterUpdate':function(_0x55e8c2,_0x51457a,_0x17ddc1){var _0x1e2fce=_0x3f4b80['models'];var _0x534584=_0x55e8c2[_0xc748('0x17')]({'plain':!![]});if(_0x534584[_0xc748('0x16')]){return _0x1e2fce[_0xc748('0x18')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x534584['id']}})[_0xc748('0x19')](function(){_0x17ddc1();})[_0xc748('0x1a')](function(_0x1ec7cf){_0x17ddc1(_0x1ec7cf);});}else{_0x17ddc1();}}},'charset':_0xc748('0x1b'),'collate':_0xc748('0x1c')});}; \ No newline at end of file +var _0x2e04=['bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','MailMessage','then','catch','utf8mb4_unicode_ci','lodash','../../config/logger','moment'];(function(_0x50c492,_0x5c1e67){var _0x3505a8=function(_0x2f7937){while(--_0x2f7937){_0x50c492['push'](_0x50c492['shift']());}};_0x3505a8(++_0x5c1e67);}(_0x2e04,0x8d));var _0x42e0=function(_0xba5568,_0x192cd5){_0xba5568=_0xba5568-0x0;var _0x2f1bfc=_0x2e04[_0xba5568];return _0x2f1bfc;};'use strict';var _=require(_0x42e0('0x0'));var util=require('util');var logger=require(_0x42e0('0x1'))('api');var moment=require(_0x42e0('0x2'));var BPromise=require(_0x42e0('0x3'));var rp=require(_0x42e0('0x4'));var fs=require('fs');var path=require(_0x42e0('0x5'));var rimraf=require(_0x42e0('0x6'));var config=require(_0x42e0('0x7'));var attributes=require(_0x42e0('0x8'));module['exports']=function(_0x58732c,_0x4aaf15){return _0x58732c[_0x42e0('0x9')](_0x42e0('0xa'),attributes,{'tableName':_0x42e0('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x42e0('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x28c8a1,_0x1c5f68,_0x280808){if(_0x28c8a1[_0x42e0('0xd')]){_0x28c8a1[_0x42e0('0xe')]=moment()[_0x42e0('0xf')](_0x42e0('0x10'));}if(_0x28c8a1[_0x42e0('0x11')]){_0x28c8a1[_0x42e0('0x12')]=moment()[_0x42e0('0xf')](_0x42e0('0x10'));}_0x280808(null,_0x1c5f68);},'beforeUpdate':function(_0x4f20e4,_0x6a9469,_0x4a43ae){if(_0x4f20e4[_0x42e0('0x13')](_0x42e0('0xd'))){_0x4f20e4[_0x42e0('0xe')]=_0x4f20e4[_0x42e0('0xd')]?moment()[_0x42e0('0xf')](_0x42e0('0x10')):null;}if(_0x4f20e4[_0x42e0('0x13')](_0x42e0('0x11'))){_0x4f20e4[_0x42e0('0x12')]=moment()[_0x42e0('0xf')](_0x42e0('0x10'));_0x4f20e4[_0x42e0('0xd')]=null;_0x4f20e4[_0x42e0('0xe')]=null;}_0x4a43ae(null,_0x4f20e4);},'afterUpdate':function(_0x55adcc,_0x21c299,_0x28e37d){var _0x2a4aeb=_0x58732c['models'];var _0x203fb2=_0x55adcc['get']({'plain':!![]});if(_0x203fb2[_0x42e0('0x11')]){return _0x2a4aeb[_0x42e0('0x14')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x203fb2['id']}})[_0x42e0('0x15')](function(){_0x28e37d();})[_0x42e0('0x16')](function(_0x13474f){_0x28e37d(_0x13474f);});}else{_0x28e37d();}}},'charset':'utf8mb4','collate':_0x42e0('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 41da678..ddc710f 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 _0xdc6f=['client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','MailInteraction','body','options','raw','where','attributes','UpdateMailInteraction','AddTagsToMailInteraction','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xdc6f,0x6d));var _0xfdc6=function(_0x4565eb,_0x167f79){_0x4565eb=_0x4565eb-0x0;var _0x67832=_0xdc6f[_0x4565eb];return _0x67832;};'use strict';var _=require(_0xfdc6('0x0'));var util=require(_0xfdc6('0x1'));var moment=require(_0xfdc6('0x2'));var BPromise=require(_0xfdc6('0x3'));var rs=require(_0xfdc6('0x4'));var fs=require('fs');var Redis=require(_0xfdc6('0x5'));var db=require(_0xfdc6('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfdc6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfdc6('0x8')][_0xfdc6('0x9')]({'port':0x232a});config[_0xfdc6('0xa')]=_['defaults'](config[_0xfdc6('0xa')],{'host':_0xfdc6('0xb'),'port':0x18eb});var socket=require(_0xfdc6('0xc'))(new Redis(config[_0xfdc6('0xa')]));require(_0xfdc6('0xd'))[_0xfdc6('0xe')](socket);function respondWithRpcPromise(_0x20c067,_0x5c06a0,_0x4e2b64){return new BPromise(function(_0x50e028,_0x1b1e29){return client[_0xfdc6('0xf')](_0x20c067,_0x4e2b64)[_0xfdc6('0x10')](function(_0xe4c282){logger[_0xfdc6('0x11')](_0xfdc6('0x12'),_0x5c06a0,_0xfdc6('0x13'));logger[_0xfdc6('0x14')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x5c06a0,'request\x20sent',JSON[_0xfdc6('0x15')](_0xe4c282));if(_0xe4c282[_0xfdc6('0x16')]){if(_0xe4c282['error'][_0xfdc6('0x17')]===0x1f4){logger[_0xfdc6('0x16')](_0xfdc6('0x12'),_0x5c06a0,_0xe4c282[_0xfdc6('0x16')][_0xfdc6('0x18')]);return _0x1b1e29(_0xe4c282[_0xfdc6('0x16')]['message']);}logger['error'](_0xfdc6('0x12'),_0x5c06a0,_0xe4c282['error'][_0xfdc6('0x18')]);return _0x50e028(_0xe4c282[_0xfdc6('0x16')][_0xfdc6('0x18')]);}else{logger[_0xfdc6('0x11')](_0xfdc6('0x12'),_0x5c06a0,_0xfdc6('0x13'));_0x50e028(_0xe4c282[_0xfdc6('0x19')][_0xfdc6('0x18')]);}})[_0xfdc6('0x1a')](function(_0x573404){logger[_0xfdc6('0x16')]('MailInteraction,\x20%s,\x20%s',_0x5c06a0,_0x573404);_0x1b1e29(_0x573404);});});}exports['UpdateMailInteraction']=function(_0x2c153e){var _0x2f9bec=this;return new Promise(function(_0x3ee545,_0x23b151){return db[_0xfdc6('0x1b')]['update'](_0x2c153e[_0xfdc6('0x1c')],{'raw':_0x2c153e[_0xfdc6('0x1d')]?_0x2c153e['options'][_0xfdc6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c153e[_0xfdc6('0x1d')]?_0x2c153e[_0xfdc6('0x1d')][_0xfdc6('0x1f')]||null:null,'attributes':_0x2c153e[_0xfdc6('0x1d')]?_0x2c153e['options'][_0xfdc6('0x20')]||null:null,'limit':_0x2c153e[_0xfdc6('0x1d')]?_0x2c153e[_0xfdc6('0x1d')]['limit']||null:null})[_0xfdc6('0x10')](function(_0x32e986){logger[_0xfdc6('0x11')]('UpdateMailInteraction',_0x2c153e);logger[_0xfdc6('0x14')]('UpdateMailInteraction',_0x2c153e,JSON[_0xfdc6('0x15')](_0x32e986));_0x3ee545(_0x32e986);})[_0xfdc6('0x1a')](function(_0x257b66){logger[_0xfdc6('0x16')](_0xfdc6('0x21'),_0x257b66[_0xfdc6('0x18')],_0x2c153e);_0x23b151(_0x2f9bec[_0xfdc6('0x16')](0x1f4,_0x257b66[_0xfdc6('0x18')]));});});};exports[_0xfdc6('0x22')]=function(_0x2e48af){return new Promise(function(_0x5402d2,_0x4d28b5){return db[_0xfdc6('0x1b')]['find']({'where':_0x2e48af['options']?_0x2e48af[_0xfdc6('0x1d')][_0xfdc6('0x1f')]||null:null})[_0xfdc6('0x10')](function(_0x1a099b){if(_0x1a099b){return _0x1a099b['addTags'](_0x2e48af[_0xfdc6('0x1c')]['ids'],_[_0xfdc6('0x23')](_0x2e48af[_0xfdc6('0x1c')],[_0xfdc6('0x24'),'id'])||{});}})[_0xfdc6('0x25')](function(_0x3b298a){logger[_0xfdc6('0x11')](_0xfdc6('0x26'),_0x2e48af);logger[_0xfdc6('0x14')](_0xfdc6('0x26'),_0x2e48af,JSON[_0xfdc6('0x15')](_0x3b298a));_0x5402d2(_0x3b298a);})[_0xfdc6('0x1a')](function(_0xb0361d){logger[_0xfdc6('0x16')](_0xfdc6('0x26'),_0xb0361d[_0xfdc6('0x18')],_0x2e48af);_0x4d28b5(_this[_0xfdc6('0x16')](0x1f4,_0xb0361d[_0xfdc6('0x18')]));});});}; \ No newline at end of file +var _0x0b99=['register','request','then','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','catch','AddTagsToMailInteraction','body','omit','ids','spread','AddTags','lodash','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x4de0aa,_0x22628e){var _0x2214bb=function(_0x550863){while(--_0x550863){_0x4de0aa['push'](_0x4de0aa['shift']());}};_0x2214bb(++_0x22628e);}(_0x0b99,0xd9));var _0x90b9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0b99[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x90b9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x90b9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90b9('0x2'))['db'];var utils=require(_0x90b9('0x3'));var logger=require('../../config/logger')(_0x90b9('0x4'));var config=require(_0x90b9('0x5'));var jayson=require(_0x90b9('0x6'));var client=jayson['client'][_0x90b9('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x90b9('0x8')],{'host':_0x90b9('0x9'),'port':0x18eb});var socket=require(_0x90b9('0xa'))(new Redis(config[_0x90b9('0x8')]));require('./mailInteraction.socket')[_0x90b9('0xb')](socket);function respondWithRpcPromise(_0x2f2e62,_0x599251,_0x527a6e){return new BPromise(function(_0x1b0703,_0x272470){return client[_0x90b9('0xc')](_0x2f2e62,_0x527a6e)[_0x90b9('0xd')](function(_0x4cbb51){logger['info'](_0x90b9('0xe'),_0x599251,'request\x20sent');logger[_0x90b9('0xf')](_0x90b9('0x10'),_0x599251,_0x90b9('0x11'),JSON[_0x90b9('0x12')](_0x4cbb51));if(_0x4cbb51[_0x90b9('0x13')]){if(_0x4cbb51[_0x90b9('0x13')][_0x90b9('0x14')]===0x1f4){logger[_0x90b9('0x13')](_0x90b9('0xe'),_0x599251,_0x4cbb51[_0x90b9('0x13')][_0x90b9('0x15')]);return _0x272470(_0x4cbb51[_0x90b9('0x13')][_0x90b9('0x15')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x599251,_0x4cbb51[_0x90b9('0x13')][_0x90b9('0x15')]);return _0x1b0703(_0x4cbb51[_0x90b9('0x13')][_0x90b9('0x15')]);}else{logger[_0x90b9('0x16')](_0x90b9('0xe'),_0x599251,_0x90b9('0x11'));_0x1b0703(_0x4cbb51[_0x90b9('0x17')][_0x90b9('0x15')]);}})['catch'](function(_0x1e3d31){logger[_0x90b9('0x13')]('MailInteraction,\x20%s,\x20%s',_0x599251,_0x1e3d31);_0x272470(_0x1e3d31);});});}exports[_0x90b9('0x18')]=function(_0x379238){var _0x366461=this;return new Promise(function(_0x346e12,_0x3da9cc){return db[_0x90b9('0x19')][_0x90b9('0x1a')](_0x379238['body'],{'raw':_0x379238[_0x90b9('0x1b')]?_0x379238[_0x90b9('0x1b')][_0x90b9('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x379238[_0x90b9('0x1b')]?_0x379238[_0x90b9('0x1b')][_0x90b9('0x1d')]||null:null,'attributes':_0x379238[_0x90b9('0x1b')]?_0x379238['options'][_0x90b9('0x1e')]||null:null,'limit':_0x379238[_0x90b9('0x1b')]?_0x379238[_0x90b9('0x1b')]['limit']||null:null})[_0x90b9('0xd')](function(_0x5cdb59){logger[_0x90b9('0x16')](_0x90b9('0x18'),_0x379238);logger[_0x90b9('0xf')](_0x90b9('0x18'),_0x379238,JSON['stringify'](_0x5cdb59));_0x346e12(_0x5cdb59);})[_0x90b9('0x1f')](function(_0x560a71){logger[_0x90b9('0x13')]('UpdateMailInteraction',_0x560a71[_0x90b9('0x15')],_0x379238);_0x3da9cc(_0x366461['error'](0x1f4,_0x560a71[_0x90b9('0x15')]));});});};exports[_0x90b9('0x20')]=function(_0x1d7019){return new Promise(function(_0x28d8a1,_0x48010e){return db[_0x90b9('0x19')]['find']({'where':_0x1d7019[_0x90b9('0x1b')]?_0x1d7019[_0x90b9('0x1b')][_0x90b9('0x1d')]||null:null})[_0x90b9('0xd')](function(_0x1094f0){if(_0x1094f0){return _0x1094f0['addTags'](_0x1d7019[_0x90b9('0x21')]['ids'],_[_0x90b9('0x22')](_0x1d7019[_0x90b9('0x21')],[_0x90b9('0x23'),'id'])||{});}})[_0x90b9('0x24')](function(_0x33e180){logger[_0x90b9('0x16')](_0x90b9('0x25'),_0x1d7019);logger[_0x90b9('0xf')](_0x90b9('0x25'),_0x1d7019,JSON['stringify'](_0x33e180));_0x28d8a1(_0x33e180);})[_0x90b9('0x1f')](function(_0x59cd75){logger[_0x90b9('0x13')](_0x90b9('0x25'),_0x59cd75['message'],_0x1d7019);_0x48010e(_this['error'](0x1f4,_0x59cd75[_0x90b9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 3767a59..bf16eaf 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 _0x9994=['update','emit','register','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x35d6c4,_0x2773a4){var _0x42a30f=function(_0x2703e1){while(--_0x2703e1){_0x35d6c4['push'](_0x35d6c4['shift']());}};_0x42a30f(++_0x2773a4);}(_0x9994,0x85));var _0x4999=function(_0x11dc39,_0x491115){_0x11dc39=_0x11dc39-0x0;var _0x457277=_0x9994[_0x11dc39];return _0x457277;};'use strict';var MailInteractionEvents=require(_0x4999('0x0'));var events=[_0x4999('0x1'),_0x4999('0x2'),_0x4999('0x3')];function createListener(_0x26095b,_0x355181){return function(_0x141007){_0x355181[_0x4999('0x4')](_0x26095b,_0x141007);};}function removeListener(_0x4b2e00,_0x462062){return function(){MailInteractionEvents['removeListener'](_0x4b2e00,_0x462062);};}exports[_0x4999('0x5')]=function(_0x12dae1){for(var _0x1f6c9b=0x0,_0x1ba5c3=events[_0x4999('0x6')];_0x1f6c9b<_0x1ba5c3;_0x1f6c9b++){var _0x49d7e8=events[_0x1f6c9b];var _0x30b4b6=createListener(_0x4999('0x7')+_0x49d7e8,_0x12dae1);MailInteractionEvents['on'](_0x49d7e8,_0x30b4b6);}}; \ No newline at end of file +var _0xf40f=['register','length','mailInteraction:','save','remove','removeListener'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0xf40f,0x159));var _0xff40=function(_0x13a4c2,_0x47c109){_0x13a4c2=_0x13a4c2-0x0;var _0x14b7b4=_0xf40f[_0x13a4c2];return _0x14b7b4;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xff40('0x0'),_0xff40('0x1'),'update'];function createListener(_0x481e38,_0x2c7060){return function(_0x3a8f22){_0x2c7060['emit'](_0x481e38,_0x3a8f22);};}function removeListener(_0x396795,_0x5d65b7){return function(){MailInteractionEvents[_0xff40('0x2')](_0x396795,_0x5d65b7);};}exports[_0xff40('0x3')]=function(_0x33a76a){for(var _0x11ce4f=0x0,_0x11895d=events[_0xff40('0x4')];_0x11ce4f<_0x11895d;_0x11ce4f++){var _0x3ac854=events[_0x11ce4f];var _0x4d7245=createListener(_0xff40('0x5')+_0x3ac854,_0x33a76a);MailInteractionEvents['on'](_0x3ac854,_0x4d7245);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 93dbfe6..4e055d9 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 _0xc8de=['tracked','mail','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','/describe','describe','/:id','show','/:id/download','isAuthenticated','download','post'];(function(_0x3ecb5a,_0x2c2e99){var _0x31a071=function(_0x39716d){while(--_0x39716d){_0x3ecb5a['push'](_0x3ecb5a['shift']());}};_0x31a071(++_0x2c2e99);}(_0xc8de,0x167));var _0xec8d=function(_0x34058d,_0x2a325e){_0x34058d=_0x34058d-0x0;var _0x112248=_0xc8de[_0x34058d];return _0x112248;};'use strict';var multer=require('multer');var util=require(_0xec8d('0x0'));var path=require(_0xec8d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xec8d('0x2')]();var fs_extra=require(_0xec8d('0x3'));var auth=require(_0xec8d('0x4'));var interaction=require(_0xec8d('0x5'));var config=require(_0xec8d('0x6'));var controller=require(_0xec8d('0x7'));router[_0xec8d('0x8')]('/',auth['isAuthenticated'](),controller[_0xec8d('0x9')]);router['get'](_0xec8d('0xa'),auth['isAuthenticated'](),controller[_0xec8d('0xb')]);router['get'](_0xec8d('0xc'),auth['isAuthenticated'](),controller[_0xec8d('0xd')]);router[_0xec8d('0x8')](_0xec8d('0xe'),auth[_0xec8d('0xf')](),controller[_0xec8d('0x10')]);router[_0xec8d('0x11')]('/',auth[_0xec8d('0xf')](),interaction[_0xec8d('0x12')](_0xec8d('0x13'),_0xec8d('0x14')),controller['create']);router[_0xec8d('0x15')](_0xec8d('0xc'),auth[_0xec8d('0xf')](),controller[_0xec8d('0x16')]);router[_0xec8d('0x15')](_0xec8d('0x17'),auth[_0xec8d('0xf')](),controller[_0xec8d('0x18')]);router[_0xec8d('0x15')](_0xec8d('0x19'),auth[_0xec8d('0xf')](),controller[_0xec8d('0x1a')]);router['delete'](_0xec8d('0xc'),auth[_0xec8d('0xf')](),controller[_0xec8d('0x1b')]);module[_0xec8d('0x1c')]=router; \ No newline at end of file +var _0xd52d=['/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','tracked','mailmessage:create','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd52d,0x1c7));var _0xdd52=function(_0x216600,_0x1f2edc){_0x216600=_0x216600-0x0;var _0x1c029d=_0xd52d[_0x216600];return _0x1c029d;};'use strict';var multer=require('multer');var util=require(_0xdd52('0x0'));var path=require(_0xdd52('0x1'));var timeout=require('connect-timeout');var express=require(_0xdd52('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdd52('0x3'));var interaction=require(_0xdd52('0x4'));var config=require(_0xdd52('0x5'));var controller=require(_0xdd52('0x6'));router[_0xdd52('0x7')]('/',auth[_0xdd52('0x8')](),controller[_0xdd52('0x9')]);router[_0xdd52('0x7')]('/describe',auth[_0xdd52('0x8')](),controller[_0xdd52('0xa')]);router[_0xdd52('0x7')](_0xdd52('0xb'),auth[_0xdd52('0x8')](),controller[_0xdd52('0xc')]);router[_0xdd52('0x7')](_0xdd52('0xd'),auth[_0xdd52('0x8')](),controller[_0xdd52('0xe')]);router[_0xdd52('0xf')]('/',auth[_0xdd52('0x8')](),interaction[_0xdd52('0x10')]('mail',_0xdd52('0x11')),controller[_0xdd52('0x12')]);router[_0xdd52('0x13')](_0xdd52('0xb'),auth[_0xdd52('0x8')](),controller[_0xdd52('0x14')]);router['put'](_0xdd52('0x15'),auth[_0xdd52('0x8')](),controller[_0xdd52('0x16')]);router['put'](_0xdd52('0x17'),auth[_0xdd52('0x8')](),controller[_0xdd52('0x18')]);router[_0xdd52('0x19')](_0xdd52('0xb'),auth[_0xdd52('0x8')](),controller[_0xdd52('0x1a')]);module[_0xdd52('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index d025802..8284ee8 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 _0xd9da=['BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Chat','Email','lodash','exports','TEXT','long'];(function(_0x137701,_0x4b5e06){var _0x535e28=function(_0x37997f){while(--_0x37997f){_0x137701['push'](_0x137701['shift']());}};_0x535e28(++_0x4b5e06);}(_0xd9da,0x170));var _0xad9d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd9da[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');var _=require(_0xad9d('0x0'));module[_0xad9d('0x1')]={'body':{'type':Sequelize[_0xad9d('0x2')](_0xad9d('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xad9d('0x2')]('medium')},'read':{'type':Sequelize[_0xad9d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xad9d('0x5')]('in',_0xad9d('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xad9d('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xad9d('0x2')](_0xad9d('0x3'))},'cc':{'type':Sequelize[_0xad9d('0x2')](_0xad9d('0x3'))},'bcc':{'type':Sequelize[_0xad9d('0x2')](_0xad9d('0x3'))},'subject':{'type':Sequelize[_0xad9d('0x2')]},'sentAt':{'type':Sequelize[_0xad9d('0x8')]},'attach':{'type':Sequelize[_0xad9d('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xad9d('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xad9d('0x8')]},'originTo':{'type':Sequelize[_0xad9d('0x2')]('long')},'originCc':{'type':Sequelize[_0xad9d('0x2')](_0xad9d('0x3'))},'originChannel':{'type':Sequelize[_0xad9d('0x5')]('Email',_0xad9d('0xa')),'defaultValue':_0xad9d('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0xc9a5=['STRING','DATE','INTEGER','Chat','Email','sequelize','lodash','exports','long','TEXT','BOOLEAN','ENUM','out'];(function(_0x5b3d37,_0x1d7e56){var _0x5e6bed=function(_0x24408c){while(--_0x24408c){_0x5b3d37['push'](_0x5b3d37['shift']());}};_0x5e6bed(++_0x1d7e56);}(_0xc9a5,0x17e));var _0x5c9a=function(_0x2418ee,_0x512591){_0x2418ee=_0x2418ee-0x0;var _0x572ac9=_0xc9a5[_0x2418ee];return _0x572ac9;};'use strict';var Sequelize=require(_0x5c9a('0x0'));var _=require(_0x5c9a('0x1'));module[_0x5c9a('0x2')]={'body':{'type':Sequelize['TEXT'](_0x5c9a('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5c9a('0x4')]('medium')},'read':{'type':Sequelize[_0x5c9a('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5c9a('0x6')]('in',_0x5c9a('0x7')),'defaultValue':_0x5c9a('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5c9a('0x8')](0x1fe)},'from':{'type':Sequelize[_0x5c9a('0x8')]},'to':{'type':Sequelize[_0x5c9a('0x4')](_0x5c9a('0x3'))},'cc':{'type':Sequelize[_0x5c9a('0x4')]('long')},'bcc':{'type':Sequelize[_0x5c9a('0x4')]('long')},'subject':{'type':Sequelize[_0x5c9a('0x4')]},'sentAt':{'type':Sequelize[_0x5c9a('0x9')]},'attach':{'type':Sequelize[_0x5c9a('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x5c9a('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x5c9a('0x4')]('long')},'originCc':{'type':Sequelize[_0x5c9a('0x4')](_0x5c9a('0x3'))},'originChannel':{'type':Sequelize['ENUM']('Email',_0x5c9a('0xb')),'defaultValue':_0x5c9a('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index ef49806..068abaa 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 _0x32de=['fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','ListId','List\x20not\x20found','SendMail','messageId','format','mail','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','fromString','EventManager','acceptmessage','reject','MailInteraction','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','SELECT','motionChannel','unix','toString','server','tmp','files','message-%s.eml','from','subject','Attachment','decode','headers','bcc','Bcc','Attachments','existsSync','push','build','writeFileSync','download','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../mysqldb','defaults','redis','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','json','undefined','offset','count','limit','status','set','update','destroy','end','sendStatus','stack','name','map','MailMessage','rawAttributes','type','key','model','query','filters','attributes','intersection'];(function(_0x522e52,_0x16a0ae){var _0x19134b=function(_0x55f4b3){while(--_0x55f4b3){_0x522e52['push'](_0x522e52['shift']());}};_0x19134b(++_0x16a0ae);}(_0x32de,0x10d));var _0xe32d=function(_0x571f36,_0x58551e){_0x571f36=_0x571f36-0x0;var _0x12724f=_0x32de[_0x571f36];return _0x12724f;};'use strict';var emlformat=require(_0xe32d('0x0'));var moment=require(_0xe32d('0x1'));var BPromise=require('bluebird');var util=require(_0xe32d('0x2'));var path=require(_0xe32d('0x3'));var fs=require('fs');var _=require(_0xe32d('0x4'));var Redis=require(_0xe32d('0x5'));var htmlToText=require(_0xe32d('0x6'));var qs=require(_0xe32d('0x7'));var logger=require('../../config/logger')(_0xe32d('0x8'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require('../../config/environment');var db=require(_0xe32d('0x9'))['db'];config['redis']=_[_0xe32d('0xa')](config[_0xe32d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe32d('0xc'))(new Redis(config[_0xe32d('0xb')]));var htmlEntities=require(_0xe32d('0xd'));require(_0xe32d('0xe'))[_0xe32d('0xf')](socket);var jayson=require(_0xe32d('0x10'));var client=jayson[_0xe32d('0x11')]['http']({'port':0x232c});var client9003=jayson[_0xe32d('0x11')][_0xe32d('0x12')]({'port':0x232b});var client9002=jayson[_0xe32d('0x11')][_0xe32d('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x2061b7,_0x282bff,_0x396a3b,_0x4fa52a){return new BPromise(function(_0xab410c,_0x484695){var _0x155b49=_0x4fa52a||client;return _0x155b49[_0xe32d('0x13')](_0x2061b7,_0x396a3b)[_0xe32d('0x14')](function(_0x352f14){logger[_0xe32d('0x15')](_0xe32d('0x16'),_0x282bff,_0xe32d('0x17'));logger[_0xe32d('0x18')](_0xe32d('0x19'),_0x282bff,_0xe32d('0x17'),JSON[_0xe32d('0x1a')](_0x352f14));if(_0x352f14[_0xe32d('0x1b')]){if(_0x352f14[_0xe32d('0x1b')][_0xe32d('0x1c')]===0x1f4){logger[_0xe32d('0x1b')](_0xe32d('0x16'),_0x282bff,_0x352f14[_0xe32d('0x1b')][_0xe32d('0x1d')]);return _0x484695(_0x352f14['error'][_0xe32d('0x1d')]);}logger[_0xe32d('0x1b')](_0xe32d('0x16'),_0x282bff,_0x352f14[_0xe32d('0x1b')]['message']);return _0xab410c(_0x352f14['error']['message']);}else{logger[_0xe32d('0x15')](_0xe32d('0x16'),_0x282bff,_0xe32d('0x17'));_0xab410c(_0x352f14[_0xe32d('0x1e')][_0xe32d('0x1d')]);}})[_0xe32d('0x1f')](function(_0x5dd05f){logger[_0xe32d('0x1b')]('MailMessage,\x20%s,\x20%s',_0x282bff,_0x5dd05f);_0x484695(_0x5dd05f);});});}function respondWithResult(_0x5260bb,_0x46d47a){_0x46d47a=_0x46d47a||0xc8;return function(_0x8bf0b){if(_0x8bf0b){return _0x5260bb['status'](_0x46d47a)[_0xe32d('0x20')](_0x8bf0b);}};}function respondWithFilteredResult(_0xb31d23,_0x58d925){return function(_0x1c1153){if(_0x1c1153){var _0x2f2e1b=typeof _0x58d925['offset']==='undefined'&&typeof _0x58d925['limit']===_0xe32d('0x21');var _0x4a41d4=_0x1c1153['count'];var _0x3894b4=_0x2f2e1b?0x0:_0x58d925[_0xe32d('0x22')];var _0x42a6a9=_0x2f2e1b?_0x1c1153[_0xe32d('0x23')]:_0x58d925[_0xe32d('0x22')]+_0x58d925[_0xe32d('0x24')];var _0xa46817;if(_0x42a6a9>=_0x4a41d4){_0x42a6a9=_0x4a41d4;_0xa46817=0xc8;}else{_0xa46817=0xce;}_0xb31d23[_0xe32d('0x25')](_0xa46817);return _0xb31d23[_0xe32d('0x26')]('Content-Range',_0x3894b4+'-'+_0x42a6a9+'/'+_0x4a41d4)[_0xe32d('0x20')](_0x1c1153);}return null;};}function saveUpdates(_0x5b8418){return function(_0x45608e){if(_0x45608e){return _0x45608e[_0xe32d('0x27')](_0x5b8418)[_0xe32d('0x14')](function(_0x127a5a){return _0x127a5a;});}return null;};}function removeEntity(_0x1240b1){return function(_0x7867ea){if(_0x7867ea){return _0x7867ea[_0xe32d('0x28')]()[_0xe32d('0x14')](function(){_0x1240b1[_0xe32d('0x25')](0xcc)[_0xe32d('0x29')]();});}};}function handleEntityNotFound(_0x1981f5){return function(_0x32339b){if(!_0x32339b){_0x1981f5[_0xe32d('0x2a')](0x194);}return _0x32339b;};}function handleError(_0x224fe3,_0x34839b){_0x34839b=_0x34839b||0x1f4;return function(_0x571cab){logger['error'](_0x571cab[_0xe32d('0x2b')]);if(_0x571cab[_0xe32d('0x2c')]){delete _0x571cab[_0xe32d('0x2c')];}_0x224fe3[_0xe32d('0x25')](_0x34839b)['send'](_0x571cab);};}exports['index']=function(_0x44a3b0,_0x4a63ab){var _0x35c5da={},_0xf4498c={},_0x5b3db0={'count':0x0,'rows':[]};var _0x29291a=_[_0xe32d('0x2d')](db[_0xe32d('0x2e')][_0xe32d('0x2f')],function(_0x273beb){return{'name':_0x273beb['fieldName'],'type':_0x273beb[_0xe32d('0x30')][_0xe32d('0x31')]};});_0xf4498c[_0xe32d('0x32')]=_[_0xe32d('0x2d')](_0x29291a,_0xe32d('0x2c'));_0xf4498c[_0xe32d('0x33')]=_['keys'](_0x44a3b0[_0xe32d('0x33')]);_0xf4498c[_0xe32d('0x34')]=_['intersection'](_0xf4498c[_0xe32d('0x32')],_0xf4498c['query']);_0x35c5da[_0xe32d('0x35')]=_[_0xe32d('0x36')](_0xf4498c['model'],qs['fields'](_0x44a3b0[_0xe32d('0x33')][_0xe32d('0x37')]));_0x35c5da['attributes']=_0x35c5da[_0xe32d('0x35')][_0xe32d('0x38')]?_0x35c5da['attributes']:_0xf4498c[_0xe32d('0x32')];if(!_0x44a3b0[_0xe32d('0x33')][_0xe32d('0x39')](_0xe32d('0x3a'))){_0x35c5da[_0xe32d('0x24')]=qs[_0xe32d('0x24')](_0x44a3b0[_0xe32d('0x33')][_0xe32d('0x24')]);_0x35c5da[_0xe32d('0x22')]=qs[_0xe32d('0x22')](_0x44a3b0[_0xe32d('0x33')]['offset']);}_0x35c5da['order']=qs[_0xe32d('0x3b')](_0x44a3b0[_0xe32d('0x33')]['sort']);_0x35c5da['where']=qs['filters'](_[_0xe32d('0x3c')](_0x44a3b0[_0xe32d('0x33')],_0xf4498c['filters']),_0x29291a);if(_0x44a3b0[_0xe32d('0x33')][_0xe32d('0x3d')]){_0x35c5da[_0xe32d('0x3e')]=_[_0xe32d('0x3f')](_0x35c5da[_0xe32d('0x3e')],{'$or':_['map'](_0x29291a,function(_0x2dac67){if(_0x2dac67[_0xe32d('0x30')]!==_0xe32d('0x40')){var _0x2c54bc={};_0x2c54bc[_0x2dac67[_0xe32d('0x2c')]]={'$like':'%'+_0x44a3b0['query'][_0xe32d('0x3d')]+'%'};return _0x2c54bc;}})});}_0x35c5da=_[_0xe32d('0x3f')]({},_0x35c5da,_0x44a3b0[_0xe32d('0x41')]);var _0x2a7118={'where':_0x35c5da['where']};return db['MailMessage'][_0xe32d('0x23')](_0x2a7118)[_0xe32d('0x14')](function(_0x2ddf83){_0x5b3db0[_0xe32d('0x23')]=_0x2ddf83;if(_0x44a3b0[_0xe32d('0x33')][_0xe32d('0x42')]){_0x35c5da[_0xe32d('0x43')]=[{'all':!![]}];}return db[_0xe32d('0x2e')][_0xe32d('0x44')](_0x35c5da);})['then'](function(_0x4c0341){_0x5b3db0[_0xe32d('0x45')]=_0x4c0341;return _0x5b3db0;})[_0xe32d('0x14')](respondWithFilteredResult(_0x4a63ab,_0x35c5da))[_0xe32d('0x1f')](handleError(_0x4a63ab,null));};exports['show']=function(_0xeffe98,_0x44a9ed){var _0x18a92c={'raw':!![],'where':{'id':_0xeffe98[_0xe32d('0x46')]['id']}},_0x51dfc7={};_0x51dfc7[_0xe32d('0x32')]=_[_0xe32d('0x47')](db[_0xe32d('0x2e')][_0xe32d('0x2f')]);_0x51dfc7[_0xe32d('0x33')]=_[_0xe32d('0x47')](_0xeffe98[_0xe32d('0x33')]);_0x51dfc7['filters']=_[_0xe32d('0x36')](_0x51dfc7[_0xe32d('0x32')],_0x51dfc7[_0xe32d('0x33')]);_0x18a92c['attributes']=_[_0xe32d('0x36')](_0x51dfc7[_0xe32d('0x32')],qs[_0xe32d('0x37')](_0xeffe98[_0xe32d('0x33')][_0xe32d('0x37')]));_0x18a92c[_0xe32d('0x35')]=_0x18a92c[_0xe32d('0x35')][_0xe32d('0x38')]?_0x18a92c[_0xe32d('0x35')]:_0x51dfc7['model'];if(_0xeffe98[_0xe32d('0x33')]['includeAll']){_0x18a92c[_0xe32d('0x43')]=[{'all':!![]}];}_0x18a92c=_['merge']({},_0x18a92c,_0xeffe98['options']);return db[_0xe32d('0x2e')][_0xe32d('0x48')](_0x18a92c)[_0xe32d('0x14')](handleEntityNotFound(_0x44a9ed,null))['then'](respondWithResult(_0x44a9ed,null))[_0xe32d('0x1f')](handleError(_0x44a9ed,null));};exports[_0xe32d('0x27')]=function(_0x5c7036,_0x6f4e6a){if(_0x5c7036[_0xe32d('0x49')]['id']){delete _0x5c7036[_0xe32d('0x49')]['id'];}return db['MailMessage'][_0xe32d('0x48')]({'where':{'id':_0x5c7036[_0xe32d('0x46')]['id']}})[_0xe32d('0x14')](handleEntityNotFound(_0x6f4e6a,null))[_0xe32d('0x14')](saveUpdates(_0x5c7036[_0xe32d('0x49')],null))['then'](respondWithResult(_0x6f4e6a,null))['catch'](handleError(_0x6f4e6a,null));};exports['destroy']=function(_0x1d8c65,_0x409ae4){return db[_0xe32d('0x2e')]['find']({'where':{'id':_0x1d8c65['params']['id']}})[_0xe32d('0x14')](handleEntityNotFound(_0x409ae4,null))[_0xe32d('0x14')](removeEntity(_0x409ae4,null))[_0xe32d('0x1f')](handleError(_0x409ae4,null));};exports[_0xe32d('0x4a')]=function(_0x1dadd5,_0x572e3a){return db[_0xe32d('0x2e')][_0xe32d('0x4a')]()[_0xe32d('0x14')](respondWithResult(_0x572e3a,null))[_0xe32d('0x1f')](handleError(_0x572e3a,null));};exports[_0xe32d('0x4b')]=function(_0x3c2370,_0x1eedbf){return db[_0xe32d('0x2e')][_0xe32d('0x4b')](_0x3c2370['body'])['then'](function(_0x4fb38b){if(_0x4fb38b){if(_0x4fb38b[_0xe32d('0x4c')]===_0xe32d('0x4d')&&!_0x4fb38b[_0xe32d('0x4e')]){var _0x445b9c,_0x392c36,_0x3f602d;if(_0x3c2370[_0xe32d('0x49')]['to']){_0x392c36=_0x3c2370[_0xe32d('0x49')]['to'][_0xe32d('0x4f')](',')[0x0];}return db[_0xe32d('0x50')][_0xe32d('0x51')]({'where':{'id':_0x4fb38b['MailAccountId']},'include':[{'model':db[_0xe32d('0x52')],'as':_0xe32d('0x53'),'include':[{'model':db[_0xe32d('0x54')],'as':_0xe32d('0x55'),'where':{'email':_0x392c36},'limit':0x1,'order':[[_0xe32d('0x56'),_0xe32d('0x57')]]}]},{'model':db[_0xe32d('0x58')],'as':_0xe32d('0x59'),'raw':!![],'include':[{'model':db[_0xe32d('0x5a')],'as':'CloudProvider','raw':!![]}]}]})['then'](function(_0x28543c){_0x445b9c=_0x28543c;if(!_0x445b9c||!_0x445b9c['Smtp'])return;var _0x5d2d43=_0x445b9c[_0xe32d('0x5b')]();if(_0x3c2370[_0xe32d('0x49')][_0xe32d('0x5c')]&&_0x3c2370[_0xe32d('0x49')][_0xe32d('0x5c')][_0xe32d('0x38')]){for(var _0x266e01=0x0;_0x266e01<_0x3c2370[_0xe32d('0x49')]['attachments'][_0xe32d('0x38')];_0x266e01+=0x1){_0x3c2370[_0xe32d('0x49')][_0xe32d('0x5c')][_0x266e01]={'filename':_0x3c2370[_0xe32d('0x49')][_0xe32d('0x5c')][_0x266e01][_0xe32d('0x2c')],'path':path[_0xe32d('0x5d')](config[_0xe32d('0x5e')],_0xe32d('0x5f'),_0x3c2370[_0xe32d('0x49')]['attachments'][_0x266e01]['basename'])};}}_0x3f602d={'account':_0x5d2d43,'message':_0x3c2370[_0xe32d('0x49')]};return;})[_0xe32d('0x14')](function(){if(_0x445b9c[_0xe32d('0x53')]){if(_0x445b9c['List'][_0xe32d('0x55')][_0xe32d('0x38')]){return _0x445b9c[_0xe32d('0x53')][_0xe32d('0x55')][0x0];}else{return db[_0xe32d('0x54')][_0xe32d('0x4b')](_['defaults'](_0x3c2370[_0xe32d('0x49')],{'firstName':_0x3c2370[_0xe32d('0x49')]['to'],'email':_0x3c2370['body']['to'],'phone':_0x3c2370[_0xe32d('0x49')]['to'],'ListId':_0x445b9c[_0xe32d('0x60')]}));}}else{throw new Error(_0xe32d('0x61'));}})[_0xe32d('0x14')](function(){if(_0x3f602d){return respondWithRpcPromise(_0xe32d('0x62'),'sendMail',_0x3f602d,client9003)[_0xe32d('0x14')](function(_0x24a89){return _0x4fb38b[_0xe32d('0x27')]({'read':!![],'messageId':_0x24a89[_0xe32d('0x63')],'sentAt':moment()[_0xe32d('0x64')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xe32d('0x1f')](function(_0x56c003){logger[_0xe32d('0x1b')]('%s',JSON[_0xe32d('0x1a')](_0x56c003));return _0x4fb38b;});}return _0x4fb38b;});}return _0x4fb38b;}})[_0xe32d('0x14')](respondWithResult(_0x1eedbf,0xc9))[_0xe32d('0x1f')](handleError(_0x1eedbf,null));};exports['accept']=function(_0x3fb2f7,_0x13d32a){var _0xfc28e3={'agent':{},'channel':_0xe32d('0x65')};if(_0x3fb2f7[_0xe32d('0x49')]['id']){delete _0x3fb2f7[_0xe32d('0x49')]['id'];}_0x3fb2f7[_0xe32d('0x49')]['read']=!![];_0x3fb2f7['body'][_0xe32d('0x66')]=moment()[_0xe32d('0x64')](_0xe32d('0x67'));_0x3fb2f7[_0xe32d('0x49')][_0xe32d('0x68')]=_0x3fb2f7[_0xe32d('0x49')][_0xe32d('0x68')]||_0x3fb2f7[_0xe32d('0x69')]['id'];_0xfc28e3[_0xe32d('0x6a')]['id']=_0x3fb2f7[_0xe32d('0x49')][_0xe32d('0x68')];return db['MailMessage'][_0xe32d('0x48')]({'where':{'id':_0x3fb2f7[_0xe32d('0x46')]['id'],'UserId':null}})[_0xe32d('0x14')](handleEntityNotFound(_0x13d32a,null))[_0xe32d('0x14')](saveUpdates(_0x3fb2f7[_0xe32d('0x49')],null))[_0xe32d('0x14')](function(_0x212d51){if(_0x212d51){_0xfc28e3[_0xe32d('0x1d')]=_0x212d51[_0xe32d('0x6b')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x212d51['MailInteractionId']}});}return null;})[_0xe32d('0x14')](handleEntityNotFound(_0x13d32a,null))[_0xe32d('0x14')](function(_0x461627){if(_0x461627){return _0x461627[_0xe32d('0x27')]({'UserId':_0x3fb2f7['body'][_0xe32d('0x68')],'read1stAt':_[_0xe32d('0x6c')](_0x461627['read1stAt'])?moment()[_0xe32d('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x3c18c6){if(_0x3c18c6){_0xfc28e3['interaction']=_0x3c18c6[_0xe32d('0x6b')]({'plain':!![]});interaction_log['info'](_0xe32d('0x6d'),_0x3fb2f7[_0xe32d('0x69')]['id'],_0x3fb2f7[_0xe32d('0x69')][_0xe32d('0x2c')],_0x3fb2f7[_0xe32d('0x69')][_0xe32d('0x6e')],_0xfc28e3[_0xe32d('0x6f')]['id'],_0x3fb2f7[_0xe32d('0x49')]?JSON['stringify'](_0x3fb2f7[_0xe32d('0x49')]):_0xe32d('0x70'));return respondWithRpcPromise(_0xe32d('0x71'),_0xe32d('0x72'),_0xfc28e3);}return null;})[_0xe32d('0x14')](function(_0x4fdfc8){var _0x229b88=_0xe32d('0x73')+_0x4fdfc8[_0xe32d('0x1d')][_0xe32d('0x74')];return db[_0xe32d('0x75')][_0xe32d('0x33')](_0x229b88,{'type':db[_0xe32d('0x76')]['QueryTypes']['SELECT'],'raw':!![]})[_0xe32d('0x14')](function(_0xe5b4c5){return _0xe5b4c5;});})['then'](function(_0x358a24){if(_0x358a24){_0xfc28e3[_0xe32d('0x1d')][_0xe32d('0x77')]=_0x358a24[0x0];if(!_0x3fb2f7[_0xe32d('0x49')][_0xe32d('0x68')])return;return db[_0xe32d('0x78')]['find']({'where':{'id':_0x3fb2f7[_0xe32d('0x49')][_0xe32d('0x68')],'role':_0xe32d('0x6a')},'attributes':['id',_0xe32d('0x2c'),_0xe32d('0x79'),_0xe32d('0x7a'),_0xe32d('0x7b')],'raw':!![]});}return null;})[_0xe32d('0x14')](function(_0x3a08cd){if(!_0x3a08cd)return null;_0xfc28e3[_0xe32d('0x1d')][_0xe32d('0x6a')]=_0x3a08cd;return _0xfc28e3;})[_0xe32d('0x14')](function(_0x24b14e){if(_0x24b14e){if(_0x3fb2f7[_0xe32d('0x49')][_0xe32d('0x7c')]){_0xfc28e3['message'][_0xe32d('0x7d')]=util['format'](_0xe32d('0x7e'),_0x3fb2f7[_0xe32d('0x69')][_0xe32d('0x2c')]);_0xfc28e3[_0xe32d('0x1d')]['channel']=_0xfc28e3[_0xe32d('0x7f')];_0xfc28e3[_0xe32d('0x1d')]['motionChannel']=_0xfc28e3[_0xe32d('0x7f')];_0xfc28e3[_0xe32d('0x1d')][_0xe32d('0x80')]=_0xe32d('0x81');_0xfc28e3[_0xe32d('0x1d')][_0xe32d('0x49')]=htmlToText[_0xe32d('0x82')](_0xfc28e3[_0xe32d('0x1d')][_0xe32d('0x49')]);return respondWithRpcPromise(_0xe32d('0x83'),'EventManager',{'event':_0xe32d('0x84'),'message':_0xfc28e3['message']},client9002)[_0xe32d('0x14')](function(){return _0xfc28e3;});}return _0xfc28e3;}return null;})[_0xe32d('0x14')](respondWithResult(_0x13d32a,null))[_0xe32d('0x1f')](handleError(_0x13d32a,null));};exports[_0xe32d('0x85')]=function(_0x45a64f,_0x273b8f){var _0x33d1db={'agent':{},'channel':_0xe32d('0x65')};if(_0x45a64f[_0xe32d('0x49')]['id']){delete _0x45a64f['body']['id'];}_0x45a64f['body'][_0xe32d('0x68')]=_0x45a64f[_0xe32d('0x49')][_0xe32d('0x68')]||_0x45a64f[_0xe32d('0x69')]['id'];_0x33d1db['agent']['id']=_0x45a64f[_0xe32d('0x49')][_0xe32d('0x68')];return db[_0xe32d('0x2e')][_0xe32d('0x48')]({'where':{'id':_0x45a64f[_0xe32d('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x273b8f,null))['then'](function(_0x10090b){if(_0x10090b){_0x33d1db[_0xe32d('0x1d')]=_0x10090b[_0xe32d('0x6b')]({'plain':!![]});return db[_0xe32d('0x86')][_0xe32d('0x48')]({'where':{'id':_0x10090b[_0xe32d('0x87')]}});}return null;})[_0xe32d('0x14')](handleEntityNotFound(_0x273b8f,null))['then'](function(_0x463512){if(_0x463512){_0x33d1db[_0xe32d('0x6f')]=_0x463512[_0xe32d('0x6b')]({'plain':!![]});interaction_log[_0xe32d('0x15')](_0xe32d('0x88'),_0x45a64f['user']['id'],_0x45a64f[_0xe32d('0x69')][_0xe32d('0x2c')],_0x45a64f[_0xe32d('0x69')][_0xe32d('0x6e')],_0x33d1db[_0xe32d('0x6f')]['id'],_0x45a64f[_0xe32d('0x49')]?JSON[_0xe32d('0x1a')](_0x45a64f[_0xe32d('0x49')]):_0xe32d('0x70'));return respondWithRpcPromise(_0xe32d('0x89'),_0xe32d('0x8a'),_0x33d1db);}return null;})[_0xe32d('0x14')](function(_0x4ef039){var _0x181cfb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4ef039[_0xe32d('0x1d')][_0xe32d('0x74')];return db[_0xe32d('0x75')][_0xe32d('0x33')](_0x181cfb,{'type':db[_0xe32d('0x76')][_0xe32d('0x8b')][_0xe32d('0x8c')],'raw':!![]})['then'](function(_0x16bcc1){return _0x16bcc1;});})[_0xe32d('0x14')](function(_0x124275){if(_0x124275){_0x33d1db[_0xe32d('0x1d')][_0xe32d('0x77')]=_0x124275[0x0];if(!_0x45a64f['body'][_0xe32d('0x68')])return;return db[_0xe32d('0x78')][_0xe32d('0x48')]({'where':{'id':_0x45a64f[_0xe32d('0x49')][_0xe32d('0x68')],'role':_0xe32d('0x6a')},'attributes':['id',_0xe32d('0x2c'),_0xe32d('0x79'),_0xe32d('0x7a'),_0xe32d('0x7b')],'raw':!![]});}return null;})[_0xe32d('0x14')](function(_0x1f6dbb){if(!_0x1f6dbb)return null;_0x33d1db[_0xe32d('0x1d')]['agent']=_0x1f6dbb;return _0x33d1db;})[_0xe32d('0x14')](function(_0x2dad95){if(_0x2dad95){_0x2dad95[_0xe32d('0x1d')][_0xe32d('0x7d')]=util['format'](_0xe32d('0x7e'),_0x45a64f[_0xe32d('0x69')][_0xe32d('0x2c')]);_0x2dad95[_0xe32d('0x1d')]['channel']=_0x33d1db['channel'];_0x2dad95['message'][_0xe32d('0x8d')]=_0x33d1db[_0xe32d('0x7f')];_0x2dad95[_0xe32d('0x1d')][_0xe32d('0x80')]=_0xe32d('0x85');_0x2dad95[_0xe32d('0x1d')][_0xe32d('0x49')]=htmlToText[_0xe32d('0x82')](_0x33d1db['message'][_0xe32d('0x49')]);respondWithRpcPromise('EventManager',_0xe32d('0x83'),{'event':'rejectmessage','message':_0x2dad95[_0xe32d('0x1d')]},client9002);return _0x33d1db;}return null;})['then'](respondWithResult(_0x273b8f,null))[_0xe32d('0x1f')](handleError(_0x273b8f,null));};exports['download']=function(_0x499506,_0x56d698){var _0x1d92a1=moment()[_0xe32d('0x8e')]()[_0xe32d('0x8f')]();var _0x47630b=path[_0xe32d('0x5d')](config[_0xe32d('0x5e')],_0xe32d('0x90'),'files',_0xe32d('0x91'));var _0xe97cd7=path['join'](config[_0xe32d('0x5e')],_0xe32d('0x90'),_0xe32d('0x92'),_0xe32d('0x5c'));var _0x3d387b=util['format'](_0xe32d('0x93'),_0x1d92a1);return db[_0xe32d('0x2e')][_0xe32d('0x48')]({'where':{'id':_0x499506[_0xe32d('0x46')]['id']},'attributes':['id',_0xe32d('0x49'),_0xe32d('0x94'),'to','cc','bcc',_0xe32d('0x95'),'createdAt'],'include':_0x499506[_0xe32d('0x33')]['attachments']?[{'model':db[_0xe32d('0x96')],'as':'Attachments'}]:undefined})[_0xe32d('0x14')](handleEntityNotFound(_0x56d698,null))[_0xe32d('0x14')](function(_0x527e08){if(_0x527e08){var _0x58c1cc=_0x527e08;var _0xb2a371={'from':_0x58c1cc[_0xe32d('0x94')],'to':_0x58c1cc['to'],'subject':_0x58c1cc[_0xe32d('0x95')],'html':htmlEntities[_0xe32d('0x97')](_0x58c1cc[_0xe32d('0x49')]),'headers':{'Date':moment(_0x58c1cc['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x527e08['cc']){_0xb2a371[_0xe32d('0x98')]['Cc']=_0x527e08['cc'];}if(_0x527e08[_0xe32d('0x99')]){_0xb2a371[_0xe32d('0x98')][_0xe32d('0x9a')]=_0x527e08[_0xe32d('0x99')];}return new BPromise(function(_0x1b2863,_0x26bd55){if(_0x527e08[_0xe32d('0x9b')]){for(var _0x5a6bca=0x0;_0x5a6bca<_0x527e08[_0xe32d('0x9b')][_0xe32d('0x38')];_0x5a6bca++){var _0x55faba=_0x527e08['Attachments'][_0x5a6bca];var _0xaf0618=path[_0xe32d('0x5d')](_0xe97cd7,_0x55faba['basename']);if(fs[_0xe32d('0x9c')](_0xaf0618)){_0xb2a371[_0xe32d('0x5c')][_0xe32d('0x9d')]({'name':_0x55faba[_0xe32d('0x2c')],'contentType':_0x55faba['type'],'data':fs['readFileSync'](_0xaf0618)});}}}emlformat[_0xe32d('0x9e')](_0xb2a371,function(_0xb82dfb,_0x212b4d){if(_0xb82dfb)return _0x26bd55(_0xb82dfb);fs[_0xe32d('0x9f')](path['join'](_0x47630b,_0x3d387b),_0x212b4d);return _0x1b2863(_0x212b4d);});});}})['then'](function(_0x49fbb5){if(_0x49fbb5){return _0x56d698[_0xe32d('0xa0')](path[_0xe32d('0x5d')](_0x47630b,_0x3d387b),_0x3d387b,function(_0x2c401c){if(!_0x2c401c)fs[_0xe32d('0xa1')](path['join'](_0x47630b,_0x3d387b));});}})[_0xe32d('0x1f')](handleError(_0x56d698,null));}; \ No newline at end of file +var _0x4110=['includeAll','include','findAll','catch','show','attributes','length','body','params','find','describe','create','direction','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','DESC','CloudProvider','Smtp','getSmtpOptions','attachments','join','server/files/attachments','basename','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','UserId','user','agent','MailInteraction','MailInteractionId','isNil','interaction','get','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','reject','RejectMessage','rejectMessage','internal','fromString','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','Attachments','decode','createdAt','headers','Bcc','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','util','path','lodash','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','json','offset','undefined','limit','count','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','type','key','model','query','keys','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options'];(function(_0x58b4c,_0x3a54d7){var _0x2a5560=function(_0x1af1db){while(--_0x1af1db){_0x58b4c['push'](_0x58b4c['shift']());}};_0x2a5560(++_0x3a54d7);}(_0x4110,0x19e));var _0x0411=function(_0x6ef702,_0x563b49){_0x6ef702=_0x6ef702-0x0;var _0x4a2bfa=_0x4110[_0x6ef702];return _0x4a2bfa;};'use strict';var emlformat=require(_0x0411('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0411('0x1'));var path=require(_0x0411('0x2'));var fs=require('fs');var _=require(_0x0411('0x3'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0x0411('0x4'));var logger=require(_0x0411('0x5'))('api');var interaction_log=require(_0x0411('0x5'))(_0x0411('0x6'));var config=require(_0x0411('0x7'));var db=require(_0x0411('0x8'))['db'];config[_0x0411('0x9')]=_['defaults'](config[_0x0411('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x0411('0xa'))(new Redis(config['redis']));var htmlEntities=require(_0x0411('0xb'));require(_0x0411('0xc'))[_0x0411('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0411('0xe')][_0x0411('0xf')]({'port':0x232c});var client9003=jayson[_0x0411('0xe')][_0x0411('0xf')]({'port':0x232b});var client9002=jayson[_0x0411('0xe')][_0x0411('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x18925a,_0xc329f0,_0x59e2ee,_0x5df03b){return new BPromise(function(_0x5adfbc,_0x2b0374){var _0x3b80be=_0x5df03b||client;return _0x3b80be[_0x0411('0x10')](_0x18925a,_0x59e2ee)[_0x0411('0x11')](function(_0x165d0b){logger[_0x0411('0x12')](_0x0411('0x13'),_0xc329f0,'request\x20sent');logger[_0x0411('0x14')](_0x0411('0x15'),_0xc329f0,_0x0411('0x16'),JSON[_0x0411('0x17')](_0x165d0b));if(_0x165d0b[_0x0411('0x18')]){if(_0x165d0b[_0x0411('0x18')][_0x0411('0x19')]===0x1f4){logger['error'](_0x0411('0x13'),_0xc329f0,_0x165d0b[_0x0411('0x18')]['message']);return _0x2b0374(_0x165d0b[_0x0411('0x18')][_0x0411('0x1a')]);}logger[_0x0411('0x18')](_0x0411('0x13'),_0xc329f0,_0x165d0b[_0x0411('0x18')][_0x0411('0x1a')]);return _0x5adfbc(_0x165d0b[_0x0411('0x18')][_0x0411('0x1a')]);}else{logger[_0x0411('0x12')]('MailMessage,\x20%s,\x20%s',_0xc329f0,_0x0411('0x16'));_0x5adfbc(_0x165d0b['result']['message']);}})['catch'](function(_0x187a91){logger[_0x0411('0x18')]('MailMessage,\x20%s,\x20%s',_0xc329f0,_0x187a91);_0x2b0374(_0x187a91);});});}function respondWithResult(_0x140b93,_0x322894){_0x322894=_0x322894||0xc8;return function(_0x2fae15){if(_0x2fae15){return _0x140b93[_0x0411('0x1b')](_0x322894)[_0x0411('0x1c')](_0x2fae15);}};}function respondWithFilteredResult(_0x5acafe,_0x352245){return function(_0x2cc1f5){if(_0x2cc1f5){var _0x15c587=typeof _0x352245[_0x0411('0x1d')]===_0x0411('0x1e')&&typeof _0x352245[_0x0411('0x1f')]===_0x0411('0x1e');var _0x380b29=_0x2cc1f5[_0x0411('0x20')];var _0x3b08ee=_0x15c587?0x0:_0x352245['offset'];var _0x20483f=_0x15c587?_0x2cc1f5['count']:_0x352245[_0x0411('0x1d')]+_0x352245[_0x0411('0x1f')];var _0x346322;if(_0x20483f>=_0x380b29){_0x20483f=_0x380b29;_0x346322=0xc8;}else{_0x346322=0xce;}_0x5acafe[_0x0411('0x1b')](_0x346322);return _0x5acafe['set'](_0x0411('0x21'),_0x3b08ee+'-'+_0x20483f+'/'+_0x380b29)[_0x0411('0x1c')](_0x2cc1f5);}return null;};}function saveUpdates(_0x2d91a2){return function(_0x3d18e1){if(_0x3d18e1){return _0x3d18e1[_0x0411('0x22')](_0x2d91a2)[_0x0411('0x11')](function(_0x249225){return _0x249225;});}return null;};}function removeEntity(_0x3d149c){return function(_0x2241f8){if(_0x2241f8){return _0x2241f8[_0x0411('0x23')]()[_0x0411('0x11')](function(){_0x3d149c[_0x0411('0x1b')](0xcc)[_0x0411('0x24')]();});}};}function handleEntityNotFound(_0x5cc4d6){return function(_0x374d55){if(!_0x374d55){_0x5cc4d6[_0x0411('0x25')](0x194);}return _0x374d55;};}function handleError(_0x2ada5c,_0x5d65f3){_0x5d65f3=_0x5d65f3||0x1f4;return function(_0x635243){logger['error'](_0x635243[_0x0411('0x26')]);if(_0x635243[_0x0411('0x27')]){delete _0x635243['name'];}_0x2ada5c[_0x0411('0x1b')](_0x5d65f3)[_0x0411('0x28')](_0x635243);};}exports[_0x0411('0x29')]=function(_0x18bc4b,_0x2ae49e){var _0x360533={},_0x30ded4={},_0xf8c98c={'count':0x0,'rows':[]};var _0x3175f8=_[_0x0411('0x2a')](db[_0x0411('0x2b')][_0x0411('0x2c')],function(_0x5b01c6){return{'name':_0x5b01c6['fieldName'],'type':_0x5b01c6[_0x0411('0x2d')][_0x0411('0x2e')]};});_0x30ded4[_0x0411('0x2f')]=_[_0x0411('0x2a')](_0x3175f8,_0x0411('0x27'));_0x30ded4[_0x0411('0x30')]=_[_0x0411('0x31')](_0x18bc4b['query']);_0x30ded4['filters']=_[_0x0411('0x32')](_0x30ded4[_0x0411('0x2f')],_0x30ded4[_0x0411('0x30')]);_0x360533['attributes']=_['intersection'](_0x30ded4[_0x0411('0x2f')],qs[_0x0411('0x33')](_0x18bc4b['query'][_0x0411('0x33')]));_0x360533['attributes']=_0x360533['attributes']['length']?_0x360533['attributes']:_0x30ded4[_0x0411('0x2f')];if(!_0x18bc4b[_0x0411('0x30')][_0x0411('0x34')](_0x0411('0x35'))){_0x360533[_0x0411('0x1f')]=qs[_0x0411('0x1f')](_0x18bc4b[_0x0411('0x30')][_0x0411('0x1f')]);_0x360533['offset']=qs[_0x0411('0x1d')](_0x18bc4b[_0x0411('0x30')][_0x0411('0x1d')]);}_0x360533[_0x0411('0x36')]=qs[_0x0411('0x37')](_0x18bc4b['query']['sort']);_0x360533['where']=qs['filters'](_[_0x0411('0x38')](_0x18bc4b[_0x0411('0x30')],_0x30ded4[_0x0411('0x39')]),_0x3175f8);if(_0x18bc4b['query'][_0x0411('0x3a')]){_0x360533[_0x0411('0x3b')]=_[_0x0411('0x3c')](_0x360533[_0x0411('0x3b')],{'$or':_[_0x0411('0x2a')](_0x3175f8,function(_0x5615a2){if(_0x5615a2['type']!==_0x0411('0x3d')){var _0x1a441a={};_0x1a441a[_0x5615a2[_0x0411('0x27')]]={'$like':'%'+_0x18bc4b[_0x0411('0x30')][_0x0411('0x3a')]+'%'};return _0x1a441a;}})});}_0x360533=_[_0x0411('0x3c')]({},_0x360533,_0x18bc4b[_0x0411('0x3e')]);var _0x4ab69b={'where':_0x360533[_0x0411('0x3b')]};return db['MailMessage'][_0x0411('0x20')](_0x4ab69b)['then'](function(_0x38712d){_0xf8c98c[_0x0411('0x20')]=_0x38712d;if(_0x18bc4b['query'][_0x0411('0x3f')]){_0x360533[_0x0411('0x40')]=[{'all':!![]}];}return db[_0x0411('0x2b')][_0x0411('0x41')](_0x360533);})['then'](function(_0x339ae3){_0xf8c98c['rows']=_0x339ae3;return _0xf8c98c;})['then'](respondWithFilteredResult(_0x2ae49e,_0x360533))[_0x0411('0x42')](handleError(_0x2ae49e,null));};exports[_0x0411('0x43')]=function(_0x20bbe2,_0x41b601){var _0x305a31={'raw':!![],'where':{'id':_0x20bbe2['params']['id']}},_0xeb054c={};_0xeb054c[_0x0411('0x2f')]=_['keys'](db[_0x0411('0x2b')]['rawAttributes']);_0xeb054c[_0x0411('0x30')]=_[_0x0411('0x31')](_0x20bbe2['query']);_0xeb054c[_0x0411('0x39')]=_['intersection'](_0xeb054c[_0x0411('0x2f')],_0xeb054c[_0x0411('0x30')]);_0x305a31[_0x0411('0x44')]=_[_0x0411('0x32')](_0xeb054c['model'],qs['fields'](_0x20bbe2[_0x0411('0x30')][_0x0411('0x33')]));_0x305a31['attributes']=_0x305a31[_0x0411('0x44')][_0x0411('0x45')]?_0x305a31['attributes']:_0xeb054c[_0x0411('0x2f')];if(_0x20bbe2[_0x0411('0x30')][_0x0411('0x3f')]){_0x305a31['include']=[{'all':!![]}];}_0x305a31=_[_0x0411('0x3c')]({},_0x305a31,_0x20bbe2['options']);return db[_0x0411('0x2b')]['find'](_0x305a31)[_0x0411('0x11')](handleEntityNotFound(_0x41b601,null))[_0x0411('0x11')](respondWithResult(_0x41b601,null))[_0x0411('0x42')](handleError(_0x41b601,null));};exports['update']=function(_0x223ac8,_0x259cae){if(_0x223ac8[_0x0411('0x46')]['id']){delete _0x223ac8[_0x0411('0x46')]['id'];}return db[_0x0411('0x2b')]['find']({'where':{'id':_0x223ac8[_0x0411('0x47')]['id']}})[_0x0411('0x11')](handleEntityNotFound(_0x259cae,null))[_0x0411('0x11')](saveUpdates(_0x223ac8[_0x0411('0x46')],null))[_0x0411('0x11')](respondWithResult(_0x259cae,null))[_0x0411('0x42')](handleError(_0x259cae,null));};exports['destroy']=function(_0x54baf1,_0x43c60f){return db['MailMessage'][_0x0411('0x48')]({'where':{'id':_0x54baf1[_0x0411('0x47')]['id']}})[_0x0411('0x11')](handleEntityNotFound(_0x43c60f,null))[_0x0411('0x11')](removeEntity(_0x43c60f,null))[_0x0411('0x42')](handleError(_0x43c60f,null));};exports[_0x0411('0x49')]=function(_0x3ccd5c,_0x2e2650){return db['MailMessage'][_0x0411('0x49')]()[_0x0411('0x11')](respondWithResult(_0x2e2650,null))[_0x0411('0x42')](handleError(_0x2e2650,null));};exports[_0x0411('0x4a')]=function(_0xa7e197,_0x639520){return db[_0x0411('0x2b')][_0x0411('0x4a')](_0xa7e197[_0x0411('0x46')])[_0x0411('0x11')](function(_0xcdf904){if(_0xcdf904){if(_0xcdf904[_0x0411('0x4b')]==='out'&&!_0xcdf904[_0x0411('0x4c')]){var _0x15a8c1,_0x331933,_0x32a6de;if(_0xa7e197[_0x0411('0x46')]['to']){_0x331933=_0xa7e197[_0x0411('0x46')]['to']['split'](',')[0x0];}return db[_0x0411('0x4d')][_0x0411('0x4e')]({'where':{'id':_0xcdf904[_0x0411('0x4f')]},'include':[{'model':db[_0x0411('0x50')],'as':_0x0411('0x51'),'include':[{'model':db[_0x0411('0x52')],'as':_0x0411('0x53'),'where':{'email':_0x331933},'limit':0x1,'order':[['updatedAt',_0x0411('0x54')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x0411('0x55')],'as':'CloudProvider','raw':!![]}]}]})['then'](function(_0x6958cc){_0x15a8c1=_0x6958cc;if(!_0x15a8c1||!_0x15a8c1[_0x0411('0x56')])return;var _0x5ac873=_0x15a8c1[_0x0411('0x57')]();if(_0xa7e197[_0x0411('0x46')][_0x0411('0x58')]&&_0xa7e197['body'][_0x0411('0x58')]['length']){for(var _0x1eb656=0x0;_0x1eb656<_0xa7e197[_0x0411('0x46')]['attachments']['length'];_0x1eb656+=0x1){_0xa7e197['body'][_0x0411('0x58')][_0x1eb656]={'filename':_0xa7e197[_0x0411('0x46')][_0x0411('0x58')][_0x1eb656][_0x0411('0x27')],'path':path[_0x0411('0x59')](config['root'],_0x0411('0x5a'),_0xa7e197[_0x0411('0x46')][_0x0411('0x58')][_0x1eb656][_0x0411('0x5b')])};}}_0x32a6de={'account':_0x5ac873,'message':_0xa7e197[_0x0411('0x46')]};return;})['then'](function(){if(_0x15a8c1['List']){if(_0x15a8c1[_0x0411('0x51')]['Contacts'][_0x0411('0x45')]){return _0x15a8c1[_0x0411('0x51')][_0x0411('0x53')][0x0];}else{return db[_0x0411('0x52')][_0x0411('0x4a')](_[_0x0411('0x5c')](_0xa7e197['body'],{'firstName':_0xa7e197[_0x0411('0x46')]['to'],'email':_0xa7e197[_0x0411('0x46')]['to'],'phone':_0xa7e197[_0x0411('0x46')]['to'],'ListId':_0x15a8c1[_0x0411('0x5d')]}));}}else{throw new Error(_0x0411('0x5e'));}})['then'](function(){if(_0x32a6de){return respondWithRpcPromise(_0x0411('0x5f'),_0x0411('0x60'),_0x32a6de,client9003)[_0x0411('0x11')](function(_0x3c9ede){return _0xcdf904['update']({'read':!![],'messageId':_0x3c9ede[_0x0411('0x61')],'sentAt':moment()[_0x0411('0x62')](_0x0411('0x63'))});})[_0x0411('0x42')](function(_0x4769d5){logger[_0x0411('0x18')]('%s',JSON[_0x0411('0x17')](_0x4769d5));return _0xcdf904;});}return _0xcdf904;});}return _0xcdf904;}})[_0x0411('0x11')](respondWithResult(_0x639520,0xc9))[_0x0411('0x42')](handleError(_0x639520,null));};exports['accept']=function(_0x26cf7d,_0x471bc2){var _0x4a8298={'agent':{},'channel':_0x0411('0x64')};if(_0x26cf7d[_0x0411('0x46')]['id']){delete _0x26cf7d['body']['id'];}_0x26cf7d[_0x0411('0x46')][_0x0411('0x65')]=!![];_0x26cf7d['body']['readAt']=moment()['format'](_0x0411('0x63'));_0x26cf7d[_0x0411('0x46')]['UserId']=_0x26cf7d['body'][_0x0411('0x66')]||_0x26cf7d[_0x0411('0x67')]['id'];_0x4a8298[_0x0411('0x68')]['id']=_0x26cf7d[_0x0411('0x46')][_0x0411('0x66')];return db[_0x0411('0x2b')][_0x0411('0x48')]({'where':{'id':_0x26cf7d[_0x0411('0x47')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x471bc2,null))[_0x0411('0x11')](saveUpdates(_0x26cf7d[_0x0411('0x46')],null))[_0x0411('0x11')](function(_0x4b9418){if(_0x4b9418){_0x4a8298[_0x0411('0x1a')]=_0x4b9418['get']({'plain':!![]});return db[_0x0411('0x69')][_0x0411('0x48')]({'where':{'id':_0x4b9418[_0x0411('0x6a')]}});}return null;})[_0x0411('0x11')](handleEntityNotFound(_0x471bc2,null))['then'](function(_0xb987f0){if(_0xb987f0){return _0xb987f0[_0x0411('0x22')]({'UserId':_0x26cf7d[_0x0411('0x46')][_0x0411('0x66')],'read1stAt':_[_0x0411('0x6b')](_0xb987f0['read1stAt'])?moment()[_0x0411('0x62')](_0x0411('0x63')):undefined});}return null;})['then'](function(_0x3fdcb5){if(_0x3fdcb5){_0x4a8298[_0x0411('0x6c')]=_0x3fdcb5[_0x0411('0x6d')]({'plain':!![]});interaction_log[_0x0411('0x12')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x26cf7d['user']['id'],_0x26cf7d['user'][_0x0411('0x27')],_0x26cf7d[_0x0411('0x67')][_0x0411('0x6e')],_0x4a8298[_0x0411('0x6c')]['id'],_0x26cf7d['body']?JSON['stringify'](_0x26cf7d[_0x0411('0x46')]):_0x0411('0x6f'));return respondWithRpcPromise(_0x0411('0x70'),_0x0411('0x71'),_0x4a8298);}return null;})[_0x0411('0x11')](function(_0x389008){var _0x4c1c85=_0x0411('0x72')+_0x389008[_0x0411('0x1a')][_0x0411('0x73')];return db[_0x0411('0x74')]['query'](_0x4c1c85,{'type':db[_0x0411('0x75')][_0x0411('0x76')][_0x0411('0x77')],'raw':!![]})[_0x0411('0x11')](function(_0x3ee111){return _0x3ee111;});})[_0x0411('0x11')](function(_0x17fb8f){if(_0x17fb8f){_0x4a8298[_0x0411('0x1a')][_0x0411('0x78')]=_0x17fb8f[0x0];if(!_0x26cf7d[_0x0411('0x46')][_0x0411('0x66')])return;return db[_0x0411('0x79')][_0x0411('0x48')]({'where':{'id':_0x26cf7d[_0x0411('0x46')][_0x0411('0x66')],'role':_0x0411('0x68')},'attributes':['id',_0x0411('0x27'),_0x0411('0x7a'),_0x0411('0x7b'),'internal'],'raw':!![]});}return null;})['then'](function(_0x103268){if(!_0x103268)return null;_0x4a8298[_0x0411('0x1a')]['agent']=_0x103268;return _0x4a8298;})[_0x0411('0x11')](function(_0x3d564b){if(_0x3d564b){if(_0x26cf7d['body'][_0x0411('0x7c')]){_0x4a8298[_0x0411('0x1a')][_0x0411('0x7d')]=util[_0x0411('0x62')](_0x0411('0x7e'),_0x26cf7d[_0x0411('0x67')]['name']);_0x4a8298[_0x0411('0x1a')][_0x0411('0x7f')]=_0x4a8298[_0x0411('0x7f')];_0x4a8298[_0x0411('0x1a')][_0x0411('0x80')]=_0x4a8298[_0x0411('0x7f')];_0x4a8298['message'][_0x0411('0x81')]=_0x0411('0x82');_0x4a8298[_0x0411('0x1a')][_0x0411('0x46')]=htmlToText['fromString'](_0x4a8298[_0x0411('0x1a')]['body']);return respondWithRpcPromise(_0x0411('0x83'),_0x0411('0x83'),{'event':'acceptmessage','message':_0x4a8298['message']},client9002)['then'](function(){return _0x4a8298;});}return _0x4a8298;}return null;})['then'](respondWithResult(_0x471bc2,null))['catch'](handleError(_0x471bc2,null));};exports[_0x0411('0x84')]=function(_0x44a25d,_0xc7eba6){var _0xb87ffd={'agent':{},'channel':_0x0411('0x64')};if(_0x44a25d[_0x0411('0x46')]['id']){delete _0x44a25d[_0x0411('0x46')]['id'];}_0x44a25d[_0x0411('0x46')][_0x0411('0x66')]=_0x44a25d[_0x0411('0x46')][_0x0411('0x66')]||_0x44a25d[_0x0411('0x67')]['id'];_0xb87ffd[_0x0411('0x68')]['id']=_0x44a25d[_0x0411('0x46')][_0x0411('0x66')];return db[_0x0411('0x2b')][_0x0411('0x48')]({'where':{'id':_0x44a25d[_0x0411('0x47')]['id'],'UserId':null}})[_0x0411('0x11')](handleEntityNotFound(_0xc7eba6,null))['then'](function(_0x5c15e8){if(_0x5c15e8){_0xb87ffd[_0x0411('0x1a')]=_0x5c15e8['get']({'plain':!![]});return db[_0x0411('0x69')]['find']({'where':{'id':_0x5c15e8['MailInteractionId']}});}return null;})[_0x0411('0x11')](handleEntityNotFound(_0xc7eba6,null))[_0x0411('0x11')](function(_0x423360){if(_0x423360){_0xb87ffd['interaction']=_0x423360['get']({'plain':!![]});interaction_log[_0x0411('0x12')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x44a25d[_0x0411('0x67')]['id'],_0x44a25d[_0x0411('0x67')][_0x0411('0x27')],_0x44a25d[_0x0411('0x67')][_0x0411('0x6e')],_0xb87ffd[_0x0411('0x6c')]['id'],_0x44a25d[_0x0411('0x46')]?JSON[_0x0411('0x17')](_0x44a25d['body']):'null');return respondWithRpcPromise(_0x0411('0x85'),_0x0411('0x86'),_0xb87ffd);}return null;})[_0x0411('0x11')](function(_0x5679ff){var _0x5dc167=_0x0411('0x72')+_0x5679ff[_0x0411('0x1a')]['ContactId'];return db[_0x0411('0x74')][_0x0411('0x30')](_0x5dc167,{'type':db[_0x0411('0x75')][_0x0411('0x76')][_0x0411('0x77')],'raw':!![]})[_0x0411('0x11')](function(_0x394aa1){return _0x394aa1;});})[_0x0411('0x11')](function(_0x191231){if(_0x191231){_0xb87ffd[_0x0411('0x1a')]['contact']=_0x191231[0x0];if(!_0x44a25d[_0x0411('0x46')][_0x0411('0x66')])return;return db[_0x0411('0x79')]['find']({'where':{'id':_0x44a25d[_0x0411('0x46')][_0x0411('0x66')],'role':_0x0411('0x68')},'attributes':['id',_0x0411('0x27'),_0x0411('0x7a'),_0x0411('0x7b'),_0x0411('0x87')],'raw':!![]});}return null;})[_0x0411('0x11')](function(_0x53cbcb){if(!_0x53cbcb)return null;_0xb87ffd[_0x0411('0x1a')][_0x0411('0x68')]=_0x53cbcb;return _0xb87ffd;})[_0x0411('0x11')](function(_0x174087){if(_0x174087){_0x174087[_0x0411('0x1a')][_0x0411('0x7d')]=util[_0x0411('0x62')](_0x0411('0x7e'),_0x44a25d[_0x0411('0x67')][_0x0411('0x27')]);_0x174087[_0x0411('0x1a')][_0x0411('0x7f')]=_0xb87ffd[_0x0411('0x7f')];_0x174087[_0x0411('0x1a')][_0x0411('0x80')]=_0xb87ffd[_0x0411('0x7f')];_0x174087[_0x0411('0x1a')]['event']=_0x0411('0x84');_0x174087[_0x0411('0x1a')][_0x0411('0x46')]=htmlToText[_0x0411('0x88')](_0xb87ffd[_0x0411('0x1a')][_0x0411('0x46')]);respondWithRpcPromise(_0x0411('0x83'),_0x0411('0x83'),{'event':_0x0411('0x89'),'message':_0x174087['message']},client9002);return _0xb87ffd;}return null;})[_0x0411('0x11')](respondWithResult(_0xc7eba6,null))['catch'](handleError(_0xc7eba6,null));};exports[_0x0411('0x8a')]=function(_0x5521d5,_0x1f0c4a){var _0x1be2cb=moment()[_0x0411('0x8b')]()[_0x0411('0x8c')]();var _0x47d3a4=path[_0x0411('0x59')](config['root'],_0x0411('0x8d'),_0x0411('0x8e'),_0x0411('0x8f'));var _0x4c69b7=path[_0x0411('0x59')](config['root'],_0x0411('0x8d'),_0x0411('0x8e'),'attachments');var _0x370316=util[_0x0411('0x62')](_0x0411('0x90'),_0x1be2cb);return db[_0x0411('0x2b')]['find']({'where':{'id':_0x5521d5[_0x0411('0x47')]['id']},'attributes':['id',_0x0411('0x46'),_0x0411('0x91'),'to','cc',_0x0411('0x92'),_0x0411('0x93'),'createdAt'],'include':_0x5521d5['query'][_0x0411('0x58')]?[{'model':db[_0x0411('0x94')],'as':_0x0411('0x95')}]:undefined})[_0x0411('0x11')](handleEntityNotFound(_0x1f0c4a,null))['then'](function(_0x12e195){if(_0x12e195){var _0x20660a=_0x12e195;var _0x419741={'from':_0x20660a[_0x0411('0x91')],'to':_0x20660a['to'],'subject':_0x20660a['subject'],'html':htmlEntities[_0x0411('0x96')](_0x20660a[_0x0411('0x46')]),'headers':{'Date':moment(_0x20660a[_0x0411('0x97')])[_0x0411('0x62')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x12e195['cc']){_0x419741[_0x0411('0x98')]['Cc']=_0x12e195['cc'];}if(_0x12e195[_0x0411('0x92')]){_0x419741[_0x0411('0x98')][_0x0411('0x99')]=_0x12e195[_0x0411('0x92')];}return new BPromise(function(_0x1ade32,_0x394635){if(_0x12e195[_0x0411('0x95')]){for(var _0x10d23d=0x0;_0x10d23d<_0x12e195[_0x0411('0x95')][_0x0411('0x45')];_0x10d23d++){var _0x117206=_0x12e195['Attachments'][_0x10d23d];var _0x45c311=path['join'](_0x4c69b7,_0x117206[_0x0411('0x5b')]);if(fs['existsSync'](_0x45c311)){_0x419741[_0x0411('0x58')][_0x0411('0x9a')]({'name':_0x117206[_0x0411('0x27')],'contentType':_0x117206[_0x0411('0x2d')],'data':fs[_0x0411('0x9b')](_0x45c311)});}}}emlformat[_0x0411('0x9c')](_0x419741,function(_0x404629,_0x361597){if(_0x404629)return _0x394635(_0x404629);fs[_0x0411('0x9d')](path[_0x0411('0x59')](_0x47d3a4,_0x370316),_0x361597);return _0x1ade32(_0x361597);});});}})[_0x0411('0x11')](function(_0x15f519){if(_0x15f519){return _0x1f0c4a[_0x0411('0x8a')](path[_0x0411('0x59')](_0x47d3a4,_0x370316),_0x370316,function(_0xaf7246){if(!_0xaf7246)fs[_0x0411('0x9e')](path[_0x0411('0x59')](_0x47d3a4,_0x370316));});}})[_0x0411('0x42')](handleError(_0x1f0c4a,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index c407a2c..761b8bb 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 _0xb063=['MailMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xb063,0x152));var _0x3b06=function(_0x7d2272,_0x41f365){_0x7d2272=_0x7d2272-0x0;var _0x5bc56e=_0xb063[_0x7d2272];return _0x5bc56e;};'use strict';var EventEmitter=require(_0x3b06('0x0'));var MailMessage=require(_0x3b06('0x1'))['db'][_0x3b06('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x3b06('0x3')](0x0);var events={'afterCreate':_0x3b06('0x4'),'afterUpdate':_0x3b06('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4682a1){return function(_0x5e5120,_0x6b5091,_0x287ca7){MailMessageEvents['emit'](_0x4682a1+':'+_0x5e5120['id'],_0x5e5120);MailMessageEvents[_0x3b06('0x6')](_0x4682a1,_0x5e5120);_0x287ca7(null);};}for(var e in events){if(events[_0x3b06('0x7')](e)){var event=events[e];MailMessage[_0x3b06('0x8')](e,emitEvent(event));}}module[_0x3b06('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x9199=['setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9199,0x7f));var _0x9919=function(_0x5a8315,_0x9ef47d){_0x5a8315=_0x5a8315-0x0;var _0x5cc037=_0x9199[_0x5a8315];return _0x5cc037;};'use strict';var EventEmitter=require(_0x9919('0x0'));var MailMessage=require(_0x9919('0x1'))['db'][_0x9919('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x9919('0x3')](0x0);var events={'afterCreate':_0x9919('0x4'),'afterUpdate':_0x9919('0x5'),'afterDestroy':_0x9919('0x6')};function emitEvent(_0x5147e1){return function(_0x3a3a07,_0x238db1,_0x481322){MailMessageEvents['emit'](_0x5147e1+':'+_0x3a3a07['id'],_0x3a3a07);MailMessageEvents['emit'](_0x5147e1,_0x3a3a07);_0x481322(null);};}for(var e in events){if(events[_0x9919('0x7')](e)){var event=events[e];MailMessage[_0x9919('0x8')](e,emitEvent(event));}}module[_0x9919('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 1e05137..47aeb5c 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 _0xa594=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailMessage.attributes','mail_messages','messageId','plainBody','FULLTEXT','body','fromString','models','direction','toLowerCase','isNil','UserId','MailInteraction','MailInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0xd21d83,_0x1de2ee){var _0x2f0012=function(_0x4c87fc){while(--_0x4c87fc){_0xd21d83['push'](_0xd21d83['shift']());}};_0x2f0012(++_0x1de2ee);}(_0xa594,0x1b3));var _0x4a59=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0xa594[_0xc14df7];return _0x34a445;};'use strict';var _=require(_0x4a59('0x0'));var util=require(_0x4a59('0x1'));var logger=require(_0x4a59('0x2'))(_0x4a59('0x3'));var moment=require(_0x4a59('0x4'));var BPromise=require(_0x4a59('0x5'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x4a59('0x6'));var rimraf=require(_0x4a59('0x7'));var config=require(_0x4a59('0x8'));var attributes=require(_0x4a59('0x9'));module['exports']=function(_0x343578,_0x413af8){return _0x343578['define']('MailMessage',attributes,{'tableName':_0x4a59('0xa'),'paranoid':![],'indexes':[{'name':_0x4a59('0xb'),'fields':['messageId']},{'name':'fti_mail_messages','fields':[_0x4a59('0xc'),'subject'],'type':_0x4a59('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x246d57,_0x4c27ba,_0x35c122){if(_0x246d57[_0x4a59('0xe')]){_0x246d57[_0x4a59('0xc')]=htmlToText[_0x4a59('0xf')](_0x246d57[_0x4a59('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x35c122(null,_0x4c27ba);},'afterCreate':function(_0x41e16b,_0x2c789,_0x2167c5){var _0x112b49=_0x343578[_0x4a59('0x10')];var _0x4b4c76=_0x41e16b['get']({'plain':!![]});if(_0x4b4c76[_0x4a59('0x11')][_0x4a59('0x12')]()==='in'||_0x4b4c76['direction'][_0x4a59('0x12')]()==='out'&&!_0x4b4c76['secret']&&!_[_0x4a59('0x13')](_0x4b4c76[_0x4a59('0x14')])){_0x112b49[_0x4a59('0x15')]['findOne']({'where':{'id':_0x4b4c76[_0x4a59('0x16')]}})[_0x4a59('0x17')](function(_0x4bb22d){if(_0x4bb22d){_0x4bb22d[_0x4a59('0x18')]({'lastMsgAt':_0x4b4c76['createdAt'],'lastMsgDirection':_0x4b4c76[_0x4a59('0x11')][_0x4a59('0x12')]()});}})[_0x4a59('0x19')](function(_0x3a164c){console[_0x4a59('0x1a')](_0x3a164c);});}_0x2167c5();}},'charset':_0x4a59('0x1b'),'collate':_0x4a59('0x1c')});}; \ No newline at end of file +var _0x1fc5=['html-to-text','../../config/environment','./mailMessage.attributes','exports','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x552b03,_0x48e023){var _0x14ab19=function(_0x58fb5e){while(--_0x58fb5e){_0x552b03['push'](_0x552b03['shift']());}};_0x14ab19(++_0x48e023);}(_0x1fc5,0x144));var _0x51fc=function(_0x446761,_0x267e15){_0x446761=_0x446761-0x0;var _0x380aba=_0x1fc5[_0x446761];return _0x380aba;};'use strict';var _=require(_0x51fc('0x0'));var util=require(_0x51fc('0x1'));var logger=require(_0x51fc('0x2'))('api');var moment=require(_0x51fc('0x3'));var BPromise=require(_0x51fc('0x4'));var rp=require(_0x51fc('0x5'));var htmlToText=require(_0x51fc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x51fc('0x7'));var attributes=require(_0x51fc('0x8'));module[_0x51fc('0x9')]=function(_0x23e9a9,_0x13f76e){return _0x23e9a9['define']('MailMessage',attributes,{'tableName':_0x51fc('0xa'),'paranoid':![],'indexes':[{'name':_0x51fc('0xb'),'fields':[_0x51fc('0xb')]},{'name':_0x51fc('0xc'),'fields':[_0x51fc('0xd'),_0x51fc('0xe')],'type':_0x51fc('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x51db39,_0x11a825,_0x2add36){if(_0x51db39[_0x51fc('0x10')]){_0x51db39['plainBody']=htmlToText['fromString'](_0x51db39[_0x51fc('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2add36(null,_0x11a825);},'afterCreate':function(_0x122849,_0x314268,_0x2f701c){var _0x48c10b=_0x23e9a9[_0x51fc('0x11')];var _0x3f0a2d=_0x122849[_0x51fc('0x12')]({'plain':!![]});if(_0x3f0a2d[_0x51fc('0x13')][_0x51fc('0x14')]()==='in'||_0x3f0a2d[_0x51fc('0x13')][_0x51fc('0x14')]()===_0x51fc('0x15')&&!_0x3f0a2d[_0x51fc('0x16')]&&!_[_0x51fc('0x17')](_0x3f0a2d[_0x51fc('0x18')])){_0x48c10b[_0x51fc('0x19')][_0x51fc('0x1a')]({'where':{'id':_0x3f0a2d[_0x51fc('0x1b')]}})[_0x51fc('0x1c')](function(_0x86cd){if(_0x86cd){_0x86cd[_0x51fc('0x1d')]({'lastMsgAt':_0x3f0a2d[_0x51fc('0x1e')],'lastMsgDirection':_0x3f0a2d['direction'][_0x51fc('0x14')]()});}})['catch'](function(_0x33296c){console[_0x51fc('0x1f')](_0x33296c);});}_0x2f701c();}},'charset':'utf8mb4','collate':_0x51fc('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 53bc59c..e4f15c9 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 _0xb574=['../../config/environment','http','socket.io-emitter','redis','./mailMessage.socket','register','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','info','catch','CreateMailMessage','MailMessage','body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0xb574,0x106));var _0x4b57=function(_0x5980a9,_0x2241e9){_0x5980a9=_0x5980a9-0x0;var _0x2d7949=_0xb574[_0x5980a9];return _0x2d7949;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require('moment');var BPromise=require(_0x4b57('0x2'));var rs=require(_0x4b57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b57('0x4'))['db'];var utils=require(_0x4b57('0x5'));var logger=require(_0x4b57('0x6'))(_0x4b57('0x7'));var config=require(_0x4b57('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b57('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4b57('0xa'))(new Redis(config[_0x4b57('0xb')]));require(_0x4b57('0xc'))[_0x4b57('0xd')](socket);function respondWithRpcPromise(_0xce47ad,_0x116958,_0x1db79a){return new BPromise(function(_0x43b108,_0x5593b8){return client[_0x4b57('0xe')](_0xce47ad,_0x1db79a)[_0x4b57('0xf')](function(_0x274912){logger['info']('MailMessage,\x20%s,\x20%s',_0x116958,_0x4b57('0x10'));logger[_0x4b57('0x11')](_0x4b57('0x12'),_0x116958,_0x4b57('0x10'),JSON[_0x4b57('0x13')](_0x274912));if(_0x274912[_0x4b57('0x14')]){if(_0x274912[_0x4b57('0x14')][_0x4b57('0x15')]===0x1f4){logger[_0x4b57('0x14')]('MailMessage,\x20%s,\x20%s',_0x116958,_0x274912['error'][_0x4b57('0x16')]);return _0x5593b8(_0x274912[_0x4b57('0x14')][_0x4b57('0x16')]);}logger['error'](_0x4b57('0x17'),_0x116958,_0x274912['error'][_0x4b57('0x16')]);return _0x43b108(_0x274912[_0x4b57('0x14')][_0x4b57('0x16')]);}else{logger[_0x4b57('0x18')](_0x4b57('0x17'),_0x116958,_0x4b57('0x10'));_0x43b108(_0x274912['result'][_0x4b57('0x16')]);}})[_0x4b57('0x19')](function(_0x53f29a){logger[_0x4b57('0x14')]('MailMessage,\x20%s,\x20%s',_0x116958,_0x53f29a);_0x5593b8(_0x53f29a);});});}exports[_0x4b57('0x1a')]=function(_0x1ca49e){var _0xad9165=this;return new Promise(function(_0x2682d6,_0xef1eae){return db[_0x4b57('0x1b')]['create'](_0x1ca49e[_0x4b57('0x1c')],{'raw':_0x1ca49e[_0x4b57('0x1d')]?_0x1ca49e[_0x4b57('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x4b57('0xf')](function(_0x4a34b2){logger[_0x4b57('0x18')](_0x4b57('0x1a'),_0x1ca49e);logger['debug'](_0x4b57('0x1a'),_0x1ca49e,JSON[_0x4b57('0x13')](_0x4a34b2));_0x2682d6(_0x4a34b2);})['catch'](function(_0x3e7b96){logger[_0x4b57('0x14')](_0x4b57('0x1a'),_0x3e7b96[_0x4b57('0x16')],_0x1ca49e);_0xef1eae(_0xad9165['error'](0x1f4,_0x3e7b96[_0x4b57('0x16')]));});});}; \ No newline at end of file +var _0xbaf0=['request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','MailMessage','create','body','options','raw','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register'];(function(_0x4ae89d,_0x2d5da1){var _0xd3a1a0=function(_0x1fb178){while(--_0x1fb178){_0x4ae89d['push'](_0x4ae89d['shift']());}};_0xd3a1a0(++_0x2d5da1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});config[_0x0baf('0xc')]=_[_0x0baf('0xd')](config[_0x0baf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0xe'))(new Redis(config['redis']));require(_0x0baf('0xf'))[_0x0baf('0x10')](socket);function respondWithRpcPromise(_0x465528,_0x2f46e8,_0x7f54d4){return new BPromise(function(_0xf4c8ac,_0x41cead){return client[_0x0baf('0x11')](_0x465528,_0x7f54d4)[_0x0baf('0x12')](function(_0x1d60a2){logger[_0x0baf('0x13')]('MailMessage,\x20%s,\x20%s',_0x2f46e8,'request\x20sent');logger[_0x0baf('0x14')](_0x0baf('0x15'),_0x2f46e8,_0x0baf('0x16'),JSON[_0x0baf('0x17')](_0x1d60a2));if(_0x1d60a2['error']){if(_0x1d60a2[_0x0baf('0x18')]['code']===0x1f4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0x41cead(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0xf4c8ac(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}else{logger[_0x0baf('0x13')](_0x0baf('0x19'),_0x2f46e8,'request\x20sent');_0xf4c8ac(_0x1d60a2[_0x0baf('0x1b')][_0x0baf('0x1a')]);}})[_0x0baf('0x1c')](function(_0x3e9cb4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x3e9cb4);_0x41cead(_0x3e9cb4);});});}exports['CreateMailMessage']=function(_0x5cff5d){var _0x1410ec=this;return new Promise(function(_0x154f48,_0x32e839){return db[_0x0baf('0x1d')][_0x0baf('0x1e')](_0x5cff5d[_0x0baf('0x1f')],{'raw':_0x5cff5d[_0x0baf('0x20')]?_0x5cff5d[_0x0baf('0x20')][_0x0baf('0x21')]===undefined?!![]:![]:!![]})[_0x0baf('0x12')](function(_0x54f2fa){logger[_0x0baf('0x13')]('CreateMailMessage',_0x5cff5d);logger[_0x0baf('0x14')]('CreateMailMessage',_0x5cff5d,JSON['stringify'](_0x54f2fa));_0x154f48(_0x54f2fa);})[_0x0baf('0x1c')](function(_0x48a0e9){logger['error'](_0x0baf('0x22'),_0x48a0e9[_0x0baf('0x1a')],_0x5cff5d);_0x32e839(_0x1410ec[_0x0baf('0x18')](0x1f4,_0x48a0e9[_0x0baf('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index a996f57..457714c 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 _0x9b0d=['mailMessage:','./mailMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x9b0d,0x139));var _0xd9b0=function(_0x432262,_0x2e6c48){_0x432262=_0x432262-0x0;var _0x152d35=_0x9b0d[_0x432262];return _0x152d35;};'use strict';var MailMessageEvents=require(_0xd9b0('0x0'));var events=[_0xd9b0('0x1'),_0xd9b0('0x2'),_0xd9b0('0x3')];function createListener(_0x14d7bf,_0x241d78){return function(_0x4ba81f){_0x241d78[_0xd9b0('0x4')](_0x14d7bf,_0x4ba81f);};}function removeListener(_0x3768f4,_0x1e3ec4){return function(){MailMessageEvents[_0xd9b0('0x5')](_0x3768f4,_0x1e3ec4);};}exports[_0xd9b0('0x6')]=function(_0x527c72){for(var _0xe201a4=0x0,_0x1efd16=events['length'];_0xe201a4<_0x1efd16;_0xe201a4++){var _0x5c41de=events[_0xe201a4];var _0x3a76bb=createListener(_0xd9b0('0x7')+_0x5c41de,_0x527c72);MailMessageEvents['on'](_0x5c41de,_0x3a76bb);}}; \ No newline at end of file +var _0x7b40=['remove','update','emit','removeListener','mailMessage:','./mailMessage.events','save'];(function(_0x15a732,_0x127338){var _0x3c8fdc=function(_0x62ae30){while(--_0x62ae30){_0x15a732['push'](_0x15a732['shift']());}};_0x3c8fdc(++_0x127338);}(_0x7b40,0x7c));var _0x07b4=function(_0x8c44aa,_0x2737d6){_0x8c44aa=_0x8c44aa-0x0;var _0x2a67d3=_0x7b40[_0x8c44aa];return _0x2a67d3;};'use strict';var MailMessageEvents=require(_0x07b4('0x0'));var events=[_0x07b4('0x1'),_0x07b4('0x2'),_0x07b4('0x3')];function createListener(_0x708cb5,_0x126dd2){return function(_0x3e3575){_0x126dd2[_0x07b4('0x4')](_0x708cb5,_0x3e3575);};}function removeListener(_0x396501,_0x4ab696){return function(){MailMessageEvents[_0x07b4('0x5')](_0x396501,_0x4ab696);};}exports['register']=function(_0x2e7f47){for(var _0xd45f4d=0x0,_0x415c99=events['length'];_0xd45f4d<_0x415c99;_0xd45f4d++){var _0x1351ab=events[_0xd45f4d];var _0x251677=createListener(_0x07b4('0x6')+_0x1351ab,_0x2e7f47);MailMessageEvents['on'](_0x1351ab,_0x251677);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index eab387d..0ef87e7 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 _0xd04f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0xd04f,0x7e));var _0xfd04=function(_0x5b2f92,_0x49efdb){_0x5b2f92=_0x5b2f92-0x0;var _0x134d3c=_0xd04f[_0x5b2f92];return _0x134d3c;};'use strict';var multer=require(_0xfd04('0x0'));var util=require(_0xfd04('0x1'));var path=require('path');var timeout=require(_0xfd04('0x2'));var express=require(_0xfd04('0x3'));var router=express[_0xfd04('0x4')]();var fs_extra=require(_0xfd04('0x5'));var auth=require(_0xfd04('0x6'));var interaction=require(_0xfd04('0x7'));var config=require('../../config/environment');var controller=require(_0xfd04('0x8'));router[_0xfd04('0x9')]('/',auth[_0xfd04('0xa')](),controller[_0xfd04('0xb')]);router[_0xfd04('0x9')](_0xfd04('0xc'),auth[_0xfd04('0xa')](),controller[_0xfd04('0xd')]);router[_0xfd04('0x9')](_0xfd04('0xe'),auth['isAuthenticated'](),controller[_0xfd04('0xf')]);router[_0xfd04('0x9')](_0xfd04('0x10'),auth[_0xfd04('0xa')](),controller[_0xfd04('0x11')]);router[_0xfd04('0x9')](_0xfd04('0x12'),auth[_0xfd04('0xa')](),controller[_0xfd04('0x13')]);router['get'](_0xfd04('0x14'),auth['isAuthenticated'](),controller[_0xfd04('0x15')]);router[_0xfd04('0x16')]('/',auth['isAuthenticated'](),controller[_0xfd04('0x17')]);router[_0xfd04('0x16')](_0xfd04('0x12'),auth[_0xfd04('0xa')](),controller[_0xfd04('0x18')]);router[_0xfd04('0x16')]('/:id/users',auth[_0xfd04('0xa')](),controller[_0xfd04('0x19')]);router[_0xfd04('0x1a')]('/:id',auth[_0xfd04('0xa')](),controller[_0xfd04('0x1b')]);router[_0xfd04('0x1c')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xfd04('0x1c')](_0xfd04('0x12'),auth[_0xfd04('0xa')](),controller[_0xfd04('0x1d')]);router[_0xfd04('0x1c')](_0xfd04('0x14'),auth[_0xfd04('0xa')](),controller[_0xfd04('0x1e')]);module[_0xfd04('0x1f')]=router; \ No newline at end of file +var _0x8696=['exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','removeAgents'];(function(_0x24b46e,_0x294281){var _0x5a8e1c=function(_0x3c610c){while(--_0x3c610c){_0x24b46e['push'](_0x24b46e['shift']());}};_0x5a8e1c(++_0x294281);}(_0x8696,0x187));var _0x6869=function(_0x14389d,_0x18ca71){_0x14389d=_0x14389d-0x0;var _0x3d60e7=_0x8696[_0x14389d];return _0x3d60e7;};'use strict';var multer=require(_0x6869('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6869('0x1'));var express=require(_0x6869('0x2'));var router=express[_0x6869('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6869('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6869('0x5'));var controller=require(_0x6869('0x6'));router[_0x6869('0x7')]('/',auth[_0x6869('0x8')](),controller[_0x6869('0x9')]);router[_0x6869('0x7')]('/describe',auth[_0x6869('0x8')](),controller[_0x6869('0xa')]);router['get'](_0x6869('0xb'),auth[_0x6869('0x8')](),controller['show']);router[_0x6869('0x7')](_0x6869('0xc'),auth['isAuthenticated'](),controller[_0x6869('0xd')]);router[_0x6869('0x7')](_0x6869('0xe'),auth[_0x6869('0x8')](),controller[_0x6869('0xf')]);router[_0x6869('0x7')](_0x6869('0x10'),auth['isAuthenticated'](),controller[_0x6869('0x11')]);router[_0x6869('0x12')]('/',auth[_0x6869('0x8')](),controller[_0x6869('0x13')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x6869('0x14')]);router[_0x6869('0x12')](_0x6869('0x10'),auth[_0x6869('0x8')](),controller[_0x6869('0x15')]);router['put'](_0x6869('0xb'),auth['isAuthenticated'](),controller[_0x6869('0x16')]);router[_0x6869('0x17')](_0x6869('0xb'),auth[_0x6869('0x8')](),controller['destroy']);router[_0x6869('0x17')]('/:id/teams',auth[_0x6869('0x8')](),controller['removeTeams']);router[_0x6869('0x17')]('/:id/users',auth[_0x6869('0x8')](),controller[_0x6869('0x18')]);module[_0x6869('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 03c3a49..0f6a8ae 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 _0x2f1a=['beepall','roundrobin','sequelize','STRING','INTEGER','ENUM','rrmemory'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x2f1a,0xe9));var _0xa2f1=function(_0x10448d,_0x57a5cd){_0x10448d=_0x10448d-0x0;var _0x4066fc=_0x2f1a[_0x10448d];return _0x4066fc;};'use strict';var Sequelize=require(_0xa2f1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa2f1('0x1')]},'timeout':{'type':Sequelize[_0xa2f1('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa2f1('0x3')](_0xa2f1('0x4'),_0xa2f1('0x5'),_0xa2f1('0x6'))}}; \ No newline at end of file +var _0x0b78=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','name'];(function(_0x322d46,_0x5ebcca){var _0x34f8d9=function(_0x533291){while(--_0x533291){_0x322d46['push'](_0x322d46['shift']());}};_0x34f8d9(++_0x5ebcca);}(_0x0b78,0xd6));var _0x80b7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0b78[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0x80b7('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x80b7('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x80b7('0x2')]},'timeout':{'type':Sequelize[_0x80b7('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x80b7('0x4')](_0x80b7('0x5'),_0x80b7('0x6'),_0x80b7('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 88b3908..1907a9e 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 _0x67f0=['role','get','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','keys','UserMailQueue','nolimit','order','sort','pick','MailQueueId','filter','findAndCountAll','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','MailQueues','UserProfileResource','error','name','send','map','rawAttributes','fieldName','type','where','MailQueue','include','query','findAll','rows','show','params','model','filters','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x5c4585,_0x3d0eab){var _0x21dede=function(_0x5c3d6a){while(--_0x5c3d6a){_0x5c4585['push'](_0x5c4585['shift']());}};_0x21dede(++_0x3d0eab);}(_0x67f0,0x136));var _0x067f=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x67f0[_0x5ecadc];return _0x565037;};'use strict';var BPromise=require(_0x067f('0x0'));var util=require(_0x067f('0x1'));var _=require(_0x067f('0x2'));var squel=require(_0x067f('0x3'));var Redis=require('ioredis');var qs=require(_0x067f('0x4'));var logger=require(_0x067f('0x5'))(_0x067f('0x6'));var config=require(_0x067f('0x7'));var db=require(_0x067f('0x8'))['db'];config[_0x067f('0x9')]=_['defaults'](config[_0x067f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x067f('0xa'))(new Redis(config[_0x067f('0x9')]));require('./mailQueue.socket')[_0x067f('0xb')](socket);function respondWithStatusCode(_0x11e136,_0x42cf70){_0x42cf70=_0x42cf70||0xcc;return function(_0x418a71){if(_0x418a71){return _0x11e136[_0x067f('0xc')](_0x42cf70);}return _0x11e136['status'](_0x42cf70)[_0x067f('0xd')]();};}function respondWithResult(_0x2a47a5,_0x3c462a){_0x3c462a=_0x3c462a||0xc8;return function(_0x554364){if(_0x554364){return _0x2a47a5[_0x067f('0xe')](_0x3c462a)[_0x067f('0xf')](_0x554364);}};}function respondWithFilteredResult(_0x3b4049,_0xaed4d1){return function(_0x2506bb){if(_0x2506bb){var _0x3ede5c=typeof _0xaed4d1['offset']===_0x067f('0x10')&&typeof _0xaed4d1[_0x067f('0x11')]==='undefined';var _0x3b6941=_0x2506bb[_0x067f('0x12')];var _0x37157c=_0x3ede5c?0x0:_0xaed4d1[_0x067f('0x13')];var _0x5e1bc0=_0x3ede5c?_0x2506bb[_0x067f('0x12')]:_0xaed4d1[_0x067f('0x13')]+_0xaed4d1[_0x067f('0x11')];var _0x5ce18f;if(_0x5e1bc0>=_0x3b6941){_0x5e1bc0=_0x3b6941;_0x5ce18f=0xc8;}else{_0x5ce18f=0xce;}_0x3b4049['status'](_0x5ce18f);return _0x3b4049[_0x067f('0x14')](_0x067f('0x15'),_0x37157c+'-'+_0x5e1bc0+'/'+_0x3b6941)[_0x067f('0xf')](_0x2506bb);}return null;};}function saveUpdates(_0xe9240){return function(_0x48a6b7){if(_0x48a6b7){return _0x48a6b7[_0x067f('0x16')](_0xe9240)[_0x067f('0x17')](function(_0x52fb58){return _0x52fb58;});}return null;};}function removeEntity(_0x287df5){return function(_0x462f8b){if(_0x462f8b){return _0x462f8b[_0x067f('0x18')]()[_0x067f('0x17')](function(){var _0x274dba=_0x462f8b['get']({'plain':!![]});var _0x23d665=_0x067f('0x19');return db[_0x067f('0x1a')][_0x067f('0x18')]({'where':{'type':_0x23d665,'resourceId':_0x274dba['id']}})[_0x067f('0x17')](function(){return _0x462f8b;});})[_0x067f('0x17')](function(){_0x287df5['status'](0xcc)[_0x067f('0xd')]();});}};}function handleEntityNotFound(_0x4d9417){return function(_0x1b136c){if(!_0x1b136c){_0x4d9417['sendStatus'](0x194);}return _0x1b136c;};}function handleError(_0x2a40c4,_0x23b04a){_0x23b04a=_0x23b04a||0x1f4;return function(_0x26a37c){logger[_0x067f('0x1b')](_0x26a37c['stack']);if(_0x26a37c[_0x067f('0x1c')]){delete _0x26a37c[_0x067f('0x1c')];}_0x2a40c4['status'](_0x23b04a)[_0x067f('0x1d')](_0x26a37c);};}exports['index']=function(_0x3a884c,_0x2aa122){var _0x151e0b={};var _0x3c62ab={'count':0x0,'rows':[]};var _0x1e3b6c=_[_0x067f('0x1e')](db['MailQueue'][_0x067f('0x1f')],function(_0x130d48){return{'name':_0x130d48[_0x067f('0x20')],'type':_0x130d48[_0x067f('0x21')]['key']};});_0x151e0b=qs['getOptions'](_0x1e3b6c,_0x3a884c);var _0x9726f7={'where':_0x151e0b[_0x067f('0x22')]};return db[_0x067f('0x23')][_0x067f('0x12')](_0x9726f7)[_0x067f('0x17')](function(_0x5497de){_0x3c62ab[_0x067f('0x12')]=_0x5497de;_0x151e0b[_0x067f('0x24')]=qs['include'](_0x3a884c[_0x067f('0x25')]);return db[_0x067f('0x23')][_0x067f('0x26')](_0x151e0b);})[_0x067f('0x17')](function(_0x13ca2b){_0x3c62ab[_0x067f('0x27')]=_0x13ca2b;return _0x3c62ab;})['then'](respondWithFilteredResult(_0x2aa122,_0x151e0b))['catch'](handleError(_0x2aa122,null));};exports[_0x067f('0x28')]=function(_0x59be6,_0x5a7c56){var _0x550024={'raw':!![],'where':{'id':_0x59be6[_0x067f('0x29')]['id']}},_0x3da6f8={};_0x3da6f8[_0x067f('0x2a')]=_['keys'](db[_0x067f('0x23')]['rawAttributes']);_0x3da6f8[_0x067f('0x25')]=_['keys'](_0x59be6['query']);_0x3da6f8[_0x067f('0x2b')]=_[_0x067f('0x2c')](_0x3da6f8[_0x067f('0x2a')],_0x3da6f8['query']);_0x550024['attributes']=_[_0x067f('0x2c')](_0x3da6f8['model'],qs[_0x067f('0x2d')](_0x59be6['query'][_0x067f('0x2d')]));_0x550024[_0x067f('0x2e')]=_0x550024['attributes'][_0x067f('0x2f')]?_0x550024[_0x067f('0x2e')]:_0x3da6f8[_0x067f('0x2a')];if(_0x59be6[_0x067f('0x25')][_0x067f('0x30')]){_0x550024[_0x067f('0x24')]=[{'all':!![]}];}_0x550024=_[_0x067f('0x31')]({},_0x550024,_0x59be6[_0x067f('0x32')]);return db[_0x067f('0x23')][_0x067f('0x33')](_0x550024)[_0x067f('0x17')](handleEntityNotFound(_0x5a7c56,null))[_0x067f('0x17')](respondWithResult(_0x5a7c56,null))['catch'](handleError(_0x5a7c56,null));};exports['create']=function(_0x373ce8,_0x1fda37){return db[_0x067f('0x23')][_0x067f('0x34')](_0x373ce8[_0x067f('0x35')],{})['then'](function(_0x32b884){var _0x4c059e=_0x373ce8[_0x067f('0x36')]['get']({'plain':!![]});if(!_0x4c059e)throw new Error(_0x067f('0x37'));if(_0x4c059e[_0x067f('0x38')]==='user'){var _0x92da89=_0x32b884[_0x067f('0x39')]({'plain':!![]});var _0x4ae522='MailQueues';return db['UserProfileSection'][_0x067f('0x33')]({'where':{'name':_0x4ae522,'userProfileId':_0x4c059e[_0x067f('0x3a')]},'raw':!![]})[_0x067f('0x17')](function(_0x4dfc0f){if(_0x4dfc0f&&_0x4dfc0f[_0x067f('0x3b')]===0x0){return db[_0x067f('0x1a')][_0x067f('0x34')]({'name':_0x92da89[_0x067f('0x1c')],'resourceId':_0x92da89['id'],'type':_0x4dfc0f[_0x067f('0x1c')],'sectionId':_0x4dfc0f['id']},{})[_0x067f('0x17')](function(){return _0x32b884;});}else{return _0x32b884;}})[_0x067f('0x3c')](function(_0x1fe2a0){logger[_0x067f('0x1b')](_0x067f('0x3d'),_0x1fe2a0);throw _0x1fe2a0;});}return _0x32b884;})['then'](respondWithResult(_0x1fda37,0xc9))[_0x067f('0x3c')](handleError(_0x1fda37,null));};exports[_0x067f('0x16')]=function(_0x2848e2,_0x2499ca){if(_0x2848e2[_0x067f('0x35')]['id']){delete _0x2848e2[_0x067f('0x35')]['id'];}return db['MailQueue'][_0x067f('0x33')]({'where':{'id':_0x2848e2['params']['id']}})[_0x067f('0x17')](handleEntityNotFound(_0x2499ca,null))[_0x067f('0x17')](saveUpdates(_0x2848e2[_0x067f('0x35')],null))[_0x067f('0x17')](respondWithResult(_0x2499ca,null))['catch'](handleError(_0x2499ca,null));};exports[_0x067f('0x18')]=function(_0x4e6a65,_0x5b640e){return db[_0x067f('0x23')][_0x067f('0x33')]({'where':{'id':_0x4e6a65[_0x067f('0x29')]['id']}})[_0x067f('0x17')](handleEntityNotFound(_0x5b640e,null))[_0x067f('0x17')](removeEntity(_0x5b640e,null))['catch'](handleError(_0x5b640e,null));};exports[_0x067f('0x3e')]=function(_0x82a100,_0x5eb2df){return db[_0x067f('0x23')]['describe']()['then'](respondWithResult(_0x5eb2df,null))[_0x067f('0x3c')](handleError(_0x5eb2df,null));};exports['getMembers']=function(_0x2d973a,_0x31d130){var _0xdd94b7={'raw':!![],'where':{}},_0x2e75b6={},_0x1547ae;return db[_0x067f('0x23')][_0x067f('0x3f')]({'where':{'id':_0x2d973a['params']['id']}})[_0x067f('0x17')](handleEntityNotFound(_0x31d130,null))[_0x067f('0x17')](function(_0x45efca){if(_0x45efca){_0x1547ae=_0x45efca[_0x067f('0x39')]({'plain':!![]});_0x2e75b6[_0x067f('0x2a')]=_[_0x067f('0x40')](db[_0x067f('0x41')][_0x067f('0x1f')]);_0x2e75b6[_0x067f('0x25')]=_['keys'](_0x2d973a['query']);_0x2e75b6[_0x067f('0x2b')]=_[_0x067f('0x2c')](_0x2e75b6[_0x067f('0x2a')],_0x2e75b6[_0x067f('0x25')]);_0xdd94b7[_0x067f('0x2e')]=_[_0x067f('0x2c')](_0x2e75b6[_0x067f('0x2a')],qs['fields'](_0x2d973a[_0x067f('0x25')]['fields']));_0xdd94b7[_0x067f('0x2e')]=_0xdd94b7[_0x067f('0x2e')]['length']?_0xdd94b7[_0x067f('0x2e')]:_0x2e75b6[_0x067f('0x2a')];if(!_0x2d973a[_0x067f('0x25')]['hasOwnProperty'](_0x067f('0x42'))){_0xdd94b7['limit']=qs[_0x067f('0x11')](_0x2d973a[_0x067f('0x25')][_0x067f('0x11')]);_0xdd94b7[_0x067f('0x13')]=qs[_0x067f('0x13')](_0x2d973a[_0x067f('0x25')]['offset']);}_0xdd94b7[_0x067f('0x43')]=qs['sort'](_0x2d973a[_0x067f('0x25')][_0x067f('0x44')]);_0xdd94b7['where']=qs[_0x067f('0x2b')](_[_0x067f('0x45')](_0x2d973a['query'],_0x2e75b6[_0x067f('0x2b')]));_0xdd94b7['where'][_0x067f('0x46')]=_0x45efca['id'];if(_0x2d973a[_0x067f('0x25')][_0x067f('0x47')]){_0xdd94b7[_0x067f('0x22')]=_[_0x067f('0x31')](_0xdd94b7[_0x067f('0x22')],{'$or':_[_0x067f('0x1e')](_0xdd94b7['attributes'],function(_0x3d7c65){var _0x25b980={};_0x25b980[_0x3d7c65]={'$like':'%'+_0x2d973a[_0x067f('0x25')]['filter']+'%'};return _0x25b980;})});}_0xdd94b7=_['merge']({},_0xdd94b7,_0x2d973a[_0x067f('0x32')]);return db[_0x067f('0x41')][_0x067f('0x26')](_0xdd94b7);}})[_0x067f('0x17')](function(_0xe94eb7){if(_0xe94eb7){return db['User'][_0x067f('0x48')]({'where':{'id':_[_0x067f('0x1e')](_0xe94eb7,'UserId'),'role':_0x067f('0x49')},'attributes':['id','name',_0x067f('0x4a'),_0x067f('0x4b'),_0x067f('0x4c')]});}})['then'](function(_0x58460d){if(_0x58460d){return{'count':_0x58460d[_0x067f('0x12')],'rows':_['map'](_0x58460d[_0x067f('0x27')],function(_0x4c0c07){return{'membername':_0x4c0c07[_0x067f('0x1c')],'UserId':_0x4c0c07['id'],'queue_name':_0x1547ae[_0x067f('0x1c')],'MailQueueId':_0x1547ae['id'],'interface':util['format'](_0x067f('0x4d'),_0x067f('0x4e'),_0x4c0c07['name']),'penalty':0x0,'paused':_0x4c0c07[_0x067f('0x4a')],'createdAt':_0x4c0c07[_0x067f('0x4c')],'updatedAt':_0x4c0c07[_0x067f('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x067f('0x17')](respondWithFilteredResult(_0x31d130,_0xdd94b7))[_0x067f('0x3c')](handleError(_0x31d130,null));};exports[_0x067f('0x4f')]=function(_0x149a89,_0x33807f){var _0x5edc4b={};var _0x5d9848={};var _0x22e49f;var _0x51d8b7;return db['MailQueue']['findOne']({'where':{'id':_0x149a89[_0x067f('0x29')]['id']}})[_0x067f('0x17')](handleEntityNotFound(_0x33807f,null))[_0x067f('0x17')](function(_0x575938){if(_0x575938){_0x22e49f=_0x575938;_0x5d9848[_0x067f('0x2a')]=_[_0x067f('0x40')](db[_0x067f('0x50')]['rawAttributes']);_0x5d9848['query']=_[_0x067f('0x40')](_0x149a89[_0x067f('0x25')]);_0x5d9848[_0x067f('0x2b')]=_[_0x067f('0x2c')](_0x5d9848[_0x067f('0x2a')],_0x5d9848[_0x067f('0x25')]);_0x5edc4b['attributes']=_[_0x067f('0x2c')](_0x5d9848[_0x067f('0x2a')],qs['fields'](_0x149a89[_0x067f('0x25')]['fields']));_0x5edc4b['attributes']=_0x5edc4b[_0x067f('0x2e')][_0x067f('0x2f')]?_0x5edc4b[_0x067f('0x2e')]:_0x5d9848[_0x067f('0x2a')];_0x5edc4b[_0x067f('0x43')]=qs[_0x067f('0x44')](_0x149a89[_0x067f('0x25')][_0x067f('0x44')]);_0x5edc4b[_0x067f('0x22')]=qs[_0x067f('0x2b')](_[_0x067f('0x45')](_0x149a89['query'],_0x5d9848['filters']));if(_0x149a89[_0x067f('0x25')]['filter']){_0x5edc4b[_0x067f('0x22')]=_[_0x067f('0x31')](_0x5edc4b['where'],{'$or':_[_0x067f('0x1e')](_0x5edc4b['attributes'],function(_0x332c5e){var _0x589180={};_0x589180[_0x332c5e]={'$like':'%'+_0x149a89[_0x067f('0x25')][_0x067f('0x47')]+'%'};return _0x589180;})});}_0x5edc4b=_['merge']({},_0x5edc4b,_0x149a89[_0x067f('0x32')]);return _0x22e49f[_0x067f('0x4f')](_0x5edc4b);}})[_0x067f('0x17')](function(_0x14918a){if(_0x14918a){_0x51d8b7=_0x14918a[_0x067f('0x2f')];if(!_0x149a89[_0x067f('0x25')][_0x067f('0x51')](_0x067f('0x42'))){_0x5edc4b[_0x067f('0x11')]=qs[_0x067f('0x11')](_0x149a89['query'][_0x067f('0x11')]);_0x5edc4b[_0x067f('0x13')]=qs[_0x067f('0x13')](_0x149a89['query'][_0x067f('0x13')]);}return _0x22e49f[_0x067f('0x4f')](_0x5edc4b);}})['then'](function(_0x5c8f9d){if(_0x5c8f9d){return _0x5c8f9d?{'count':_0x51d8b7,'rows':_0x5c8f9d}:null;}})[_0x067f('0x17')](respondWithResult(_0x33807f,null))[_0x067f('0x3c')](handleError(_0x33807f,null));};exports[_0x067f('0x52')]=function(_0x57f8db,_0x1e3c65){var _0x55e577=_0x57f8db[_0x067f('0x35')][_0x067f('0x53')];return db[_0x067f('0x50')]['findAll']({'where':{'id':_0x55e577},'attributes':['id'],'include':[{'model':db[_0x067f('0x54')],'as':_0x067f('0x55'),'attributes':['id',_0x067f('0x1c'),_0x067f('0x56'),_0x067f('0x57'),_0x067f('0x58')],'raw':!![]}]})[_0x067f('0x17')](function(_0xe5f8da){if(_0xe5f8da){var _0x376d2d=_[_0x067f('0x59')](_0xe5f8da,function(_0x481338){var _0x1f45bc=_0x481338[_0x067f('0x39')]({'plain':!![]});return _0x1f45bc[_0x067f('0x55')];});return db[_0x067f('0x23')]['find']({'where':{'id':_0x57f8db[_0x067f('0x29')]['id']}})[_0x067f('0x17')](function(_0x2226dc){return db[_0x067f('0x5a')]['transaction'](function(_0x179854){return _0x2226dc['addTeams'](_0x55e577,{'transaction':_0x179854})[_0x067f('0x17')](function(){return BPromise[_0x067f('0x5b')](_0x376d2d,function(_0x30fff9){return db[_0x067f('0x41')][_0x067f('0x5c')]({'where':{'UserId':_0x30fff9['id'],'MailQueueId':_0x57f8db[_0x067f('0x29')]['id']},'transaction':_0x179854});});})[_0x067f('0x17')](function(){_0x376d2d[_0x067f('0x5d')](function(_0x5982a1){socket[_0x067f('0x5e')]('userMailQueue:save',{'UserId':_0x5982a1['id'],'MailQueueId':_0x2226dc['id']});});});});});}})[_0x067f('0x17')](respondWithStatusCode(_0x1e3c65,null))['catch'](handleError(_0x1e3c65,null));};exports[_0x067f('0x5f')]=function(_0x5485e4,_0x4db0b9){return db[_0x067f('0x50')][_0x067f('0x26')]({'where':{'id':_0x5485e4[_0x067f('0x25')][_0x067f('0x53')]},'attributes':['id'],'include':[{'model':db[_0x067f('0x54')],'as':_0x067f('0x55'),'attributes':['id'],'raw':!![]}]})[_0x067f('0x17')](handleEntityNotFound(_0x4db0b9,null))[_0x067f('0x17')](function(_0x7f4473){var _0x308ea1=_[_0x067f('0x1e')](_0x7f4473,'id');var _0x48be2d=[];var _0x3a2fa8=[];var _0x55f4c5=squel['select']();_0x55f4c5['field'](_0x067f('0x60'))[_0x067f('0x61')](_0x067f('0x62'),'tq')[_0x067f('0x63')]('user_has_teams','ut',_0x067f('0x64'))[_0x067f('0x22')](_0x067f('0x65'),_0x5485e4[_0x067f('0x29')]['id']);for(var _0x58d127=0x0;_0x58d127<_0x7f4473[_0x067f('0x2f')];_0x58d127+=0x1){let _0x593065=_0x7f4473[_0x58d127];for(var _0x5b7ae6=0x0;_0x5b7ae6<_0x593065[_0x067f('0x55')][_0x067f('0x2f')];_0x5b7ae6+=0x1){let _0x26c194=_0x593065[_0x067f('0x55')][_0x5b7ae6];var _0xf14057=_0x55f4c5[_0x067f('0x66')]();_0xf14057[_0x067f('0x22')](_0x067f('0x67'),_0x26c194['id']);_0x3a2fa8[_0x067f('0x68')](db[_0x067f('0x5a')][_0x067f('0x25')](_0xf14057[_0x067f('0x69')](),{'type':db[_0x067f('0x5a')][_0x067f('0x6a')][_0x067f('0x6b')]})[_0x067f('0x17')](function(_0x5f2936){if(_0x5f2936[_0x067f('0x2f')]===0x1){return _0x26c194['id'];}else{var _0x5841b0=_[_0x067f('0x6c')](_[_0x067f('0x1e')](_0x5f2936,_0x067f('0x6d')),function(_0x1187a0){return _[_0x067f('0x6e')](_0x308ea1,_0x1187a0);});if(_0x5841b0){return _0x26c194['id'];}}}));}}return BPromise[_0x067f('0x6f')](_0x3a2fa8)['then'](function(_0x5510ba){_0x48be2d=_(_0x48be2d)[_0x067f('0x70')](_0x5510ba)['compact']()['value']();return db[_0x067f('0x23')][_0x067f('0x33')]({'where':{'id':_0x5485e4[_0x067f('0x29')]['id']}})[_0x067f('0x17')](function(_0x22cb23){return db['sequelize'][_0x067f('0x71')](function(_0x2cda18){return _0x22cb23[_0x067f('0x5f')](_0x5485e4[_0x067f('0x25')][_0x067f('0x53')],{'transaction':_0x2cda18})[_0x067f('0x17')](function(){if(!_[_0x067f('0x72')](_0x48be2d)){return _0x22cb23[_0x067f('0x73')](_0x48be2d,{'transaction':_0x2cda18});}})[_0x067f('0x17')](function(){_0x48be2d[_0x067f('0x5d')](function(_0x420ead){socket[_0x067f('0x5e')]('userMailQueue:remove',{'UserId':_0x420ead,'MailQueueId':_0x22cb23['id']});});});});});});})['then'](respondWithStatusCode(_0x4db0b9,null))[_0x067f('0x3c')](handleError(_0x4db0b9,null));};exports['addAgents']=function(_0x56b51b,_0x5484bf){return db[_0x067f('0x23')][_0x067f('0x33')]({'where':{'id':_0x56b51b['params']['id']}})[_0x067f('0x17')](handleEntityNotFound(_0x5484bf,null))[_0x067f('0x17')](function(_0x403046){if(_0x403046){return _0x403046[_0x067f('0x74')](_0x56b51b[_0x067f('0x35')][_0x067f('0x53')],_[_0x067f('0x75')](_0x56b51b[_0x067f('0x35')],['ids','id'])||{})[_0x067f('0x76')](function(_0x3677f1){for(var _0x1626a7=0x0;_0x1626a7<_0x56b51b[_0x067f('0x35')]['ids'][_0x067f('0x2f')];_0x1626a7+=0x1){socket[_0x067f('0x5e')]('userMailQueue:save',{'UserId':Number(_0x56b51b[_0x067f('0x35')][_0x067f('0x53')][_0x1626a7]),'MailQueueId':Number(_0x56b51b['params']['id'])});}return _0x3677f1;});}})[_0x067f('0x17')](respondWithResult(_0x5484bf,null))[_0x067f('0x3c')](handleError(_0x5484bf,null));};exports[_0x067f('0x73')]=function(_0x5f1a49,_0x522a97){return db[_0x067f('0x23')][_0x067f('0x33')]({'where':{'id':_0x5f1a49[_0x067f('0x29')]['id']}})[_0x067f('0x17')](handleEntityNotFound(_0x522a97,null))[_0x067f('0x17')](function(_0x4413ef){if(_0x4413ef){return _0x4413ef[_0x067f('0x73')](_0x5f1a49[_0x067f('0x25')][_0x067f('0x53')])[_0x067f('0x17')](function(){if(_[_0x067f('0x77')](_0x5f1a49[_0x067f('0x25')][_0x067f('0x53')])){for(var _0x3e1c4c=0x0;_0x3e1c4c<_0x5f1a49['query'][_0x067f('0x53')][_0x067f('0x2f')];_0x3e1c4c+=0x1){socket['emit'](_0x067f('0x78'),{'UserId':Number(_0x5f1a49[_0x067f('0x25')][_0x067f('0x53')][_0x3e1c4c]),'MailQueueId':Number(_0x5f1a49['params']['id'])});}}else{socket['emit'](_0x067f('0x78'),{'UserId':Number(_0x5f1a49[_0x067f('0x25')][_0x067f('0x53')]),'MailQueueId':Number(_0x5f1a49[_0x067f('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x522a97,null))['catch'](handleError(_0x522a97,null));};exports[_0x067f('0x79')]=function(_0x5e6572,_0xb80081){var _0x1a3df1={};var _0x3f90fb={};var _0x3d65b9;var _0xfad42a;return db[_0x067f('0x23')][_0x067f('0x3f')]({'where':{'id':_0x5e6572[_0x067f('0x29')]['id']}})[_0x067f('0x17')](handleEntityNotFound(_0xb80081,null))[_0x067f('0x17')](function(_0x59531a){if(_0x59531a){_0x3d65b9=_0x59531a;_0x3f90fb[_0x067f('0x2a')]=_[_0x067f('0x40')](db[_0x067f('0x54')][_0x067f('0x1f')]);_0x3f90fb[_0x067f('0x25')]=_[_0x067f('0x40')](_0x5e6572[_0x067f('0x25')]);_0x3f90fb[_0x067f('0x2b')]=_[_0x067f('0x2c')](_0x3f90fb[_0x067f('0x2a')],_0x3f90fb[_0x067f('0x25')]);_0x1a3df1[_0x067f('0x2e')]=_[_0x067f('0x2c')](_0x3f90fb[_0x067f('0x2a')],qs[_0x067f('0x2d')](_0x5e6572[_0x067f('0x25')]['fields']));_0x1a3df1['attributes']=_0x1a3df1[_0x067f('0x2e')][_0x067f('0x2f')]?_0x1a3df1['attributes']:_0x3f90fb[_0x067f('0x2a')];_0x1a3df1[_0x067f('0x43')]=qs[_0x067f('0x44')](_0x5e6572[_0x067f('0x25')][_0x067f('0x44')]);_0x1a3df1['where']=qs[_0x067f('0x2b')](_[_0x067f('0x45')](_0x5e6572[_0x067f('0x25')],_0x3f90fb[_0x067f('0x2b')]));if(_0x5e6572[_0x067f('0x25')][_0x067f('0x47')]){_0x1a3df1[_0x067f('0x22')]=_['merge'](_0x1a3df1['where'],{'$or':_['map'](_0x1a3df1['attributes'],function(_0x4da5ea){var _0x5cbed7={};_0x5cbed7[_0x4da5ea]={'$like':'%'+_0x5e6572[_0x067f('0x25')][_0x067f('0x47')]+'%'};return _0x5cbed7;})});}_0x1a3df1=_[_0x067f('0x31')]({},_0x1a3df1,_0x5e6572[_0x067f('0x32')]);return _0x3d65b9[_0x067f('0x79')](_0x1a3df1);}})[_0x067f('0x17')](function(_0x41dee9){if(_0x41dee9){_0xfad42a=_0x41dee9[_0x067f('0x2f')];if(!_0x5e6572[_0x067f('0x25')][_0x067f('0x51')](_0x067f('0x42'))){_0x1a3df1['limit']=qs[_0x067f('0x11')](_0x5e6572['query']['limit']);_0x1a3df1[_0x067f('0x13')]=qs[_0x067f('0x13')](_0x5e6572[_0x067f('0x25')][_0x067f('0x13')]);}return _0x3d65b9[_0x067f('0x79')](_0x1a3df1);}})[_0x067f('0x17')](function(_0x7c3929){if(_0x7c3929){return _0x7c3929?{'count':_0xfad42a,'rows':_0x7c3929}:null;}})[_0x067f('0x17')](respondWithResult(_0xb80081,null))[_0x067f('0x3c')](handleError(_0xb80081,null));}; \ No newline at end of file +var _0x2a9d=['getOptions','where','include','query','findAll','catch','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','nolimit','order','MailQueueId','filter','map','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','sort','pick','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','UserMailQueue','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','SELECT','every','TeamId','all','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','bluebird','util','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','MailQueues','UserProfileResource','destroy','sendStatus','error','name','send','index','MailQueue','rawAttributes','fieldName','type','key'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0x2a9d,0x147));var _0xd2a9=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0x2a9d[_0x35f7f5];return _0x5567a4;};'use strict';var BPromise=require(_0xd2a9('0x0'));var util=require(_0xd2a9('0x1'));var _=require(_0xd2a9('0x2'));var squel=require('squel');var Redis=require(_0xd2a9('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xd2a9('0x4'))(_0xd2a9('0x5'));var config=require(_0xd2a9('0x6'));var db=require(_0xd2a9('0x7'))['db'];config[_0xd2a9('0x8')]=_['defaults'](config[_0xd2a9('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x1126d5,_0x517e7a){_0x517e7a=_0x517e7a||0xcc;return function(_0x4482b0){if(_0x4482b0){return _0x1126d5['sendStatus'](_0x517e7a);}return _0x1126d5[_0xd2a9('0x9')](_0x517e7a)[_0xd2a9('0xa')]();};}function respondWithResult(_0xb301b0,_0x35694d){_0x35694d=_0x35694d||0xc8;return function(_0x577aa4){if(_0x577aa4){return _0xb301b0[_0xd2a9('0x9')](_0x35694d)[_0xd2a9('0xb')](_0x577aa4);}};}function respondWithFilteredResult(_0xe34d71,_0x3a0441){return function(_0x23b7b7){if(_0x23b7b7){var _0x5a813b=typeof _0x3a0441[_0xd2a9('0xc')]===_0xd2a9('0xd')&&typeof _0x3a0441[_0xd2a9('0xe')]===_0xd2a9('0xd');var _0x36bd2c=_0x23b7b7['count'];var _0x57f87a=_0x5a813b?0x0:_0x3a0441['offset'];var _0x5287b6=_0x5a813b?_0x23b7b7[_0xd2a9('0xf')]:_0x3a0441[_0xd2a9('0xc')]+_0x3a0441[_0xd2a9('0xe')];var _0x4e206e;if(_0x5287b6>=_0x36bd2c){_0x5287b6=_0x36bd2c;_0x4e206e=0xc8;}else{_0x4e206e=0xce;}_0xe34d71[_0xd2a9('0x9')](_0x4e206e);return _0xe34d71[_0xd2a9('0x10')](_0xd2a9('0x11'),_0x57f87a+'-'+_0x5287b6+'/'+_0x36bd2c)['json'](_0x23b7b7);}return null;};}function saveUpdates(_0x253f74){return function(_0x511337){if(_0x511337){return _0x511337[_0xd2a9('0x12')](_0x253f74)[_0xd2a9('0x13')](function(_0x1909bb){return _0x1909bb;});}return null;};}function removeEntity(_0x1b886c){return function(_0x28d3dc){if(_0x28d3dc){return _0x28d3dc['destroy']()[_0xd2a9('0x13')](function(){var _0x4766a1=_0x28d3dc['get']({'plain':!![]});var _0x354469=_0xd2a9('0x14');return db[_0xd2a9('0x15')][_0xd2a9('0x16')]({'where':{'type':_0x354469,'resourceId':_0x4766a1['id']}})[_0xd2a9('0x13')](function(){return _0x28d3dc;});})[_0xd2a9('0x13')](function(){_0x1b886c[_0xd2a9('0x9')](0xcc)[_0xd2a9('0xa')]();});}};}function handleEntityNotFound(_0x4ee0da){return function(_0x1c19eb){if(!_0x1c19eb){_0x4ee0da[_0xd2a9('0x17')](0x194);}return _0x1c19eb;};}function handleError(_0xcff9f6,_0x40902b){_0x40902b=_0x40902b||0x1f4;return function(_0x59cbf1){logger[_0xd2a9('0x18')](_0x59cbf1['stack']);if(_0x59cbf1[_0xd2a9('0x19')]){delete _0x59cbf1[_0xd2a9('0x19')];}_0xcff9f6[_0xd2a9('0x9')](_0x40902b)[_0xd2a9('0x1a')](_0x59cbf1);};}exports[_0xd2a9('0x1b')]=function(_0x35453f,_0x1fb23d){var _0x36098e={};var _0x322fa3={'count':0x0,'rows':[]};var _0x5c27d4=_['map'](db[_0xd2a9('0x1c')][_0xd2a9('0x1d')],function(_0x4b7adc){return{'name':_0x4b7adc[_0xd2a9('0x1e')],'type':_0x4b7adc[_0xd2a9('0x1f')][_0xd2a9('0x20')]};});_0x36098e=qs[_0xd2a9('0x21')](_0x5c27d4,_0x35453f);var _0x518031={'where':_0x36098e[_0xd2a9('0x22')]};return db[_0xd2a9('0x1c')][_0xd2a9('0xf')](_0x518031)[_0xd2a9('0x13')](function(_0x105cb2){_0x322fa3[_0xd2a9('0xf')]=_0x105cb2;_0x36098e[_0xd2a9('0x23')]=qs[_0xd2a9('0x23')](_0x35453f[_0xd2a9('0x24')]);return db['MailQueue'][_0xd2a9('0x25')](_0x36098e);})[_0xd2a9('0x13')](function(_0x579a5c){_0x322fa3['rows']=_0x579a5c;return _0x322fa3;})[_0xd2a9('0x13')](respondWithFilteredResult(_0x1fb23d,_0x36098e))[_0xd2a9('0x26')](handleError(_0x1fb23d,null));};exports[_0xd2a9('0x27')]=function(_0x494e73,_0x3fe9ad){var _0xb3a07b={'raw':!![],'where':{'id':_0x494e73[_0xd2a9('0x28')]['id']}},_0x5a9300={};_0x5a9300[_0xd2a9('0x29')]=_[_0xd2a9('0x2a')](db[_0xd2a9('0x1c')][_0xd2a9('0x1d')]);_0x5a9300[_0xd2a9('0x24')]=_[_0xd2a9('0x2a')](_0x494e73['query']);_0x5a9300[_0xd2a9('0x2b')]=_[_0xd2a9('0x2c')](_0x5a9300[_0xd2a9('0x29')],_0x5a9300[_0xd2a9('0x24')]);_0xb3a07b['attributes']=_[_0xd2a9('0x2c')](_0x5a9300[_0xd2a9('0x29')],qs[_0xd2a9('0x2d')](_0x494e73['query'][_0xd2a9('0x2d')]));_0xb3a07b[_0xd2a9('0x2e')]=_0xb3a07b[_0xd2a9('0x2e')][_0xd2a9('0x2f')]?_0xb3a07b[_0xd2a9('0x2e')]:_0x5a9300[_0xd2a9('0x29')];if(_0x494e73['query'][_0xd2a9('0x30')]){_0xb3a07b['include']=[{'all':!![]}];}_0xb3a07b=_[_0xd2a9('0x31')]({},_0xb3a07b,_0x494e73[_0xd2a9('0x32')]);return db[_0xd2a9('0x1c')][_0xd2a9('0x33')](_0xb3a07b)[_0xd2a9('0x13')](handleEntityNotFound(_0x3fe9ad,null))[_0xd2a9('0x13')](respondWithResult(_0x3fe9ad,null))[_0xd2a9('0x26')](handleError(_0x3fe9ad,null));};exports[_0xd2a9('0x34')]=function(_0x19a218,_0x4e689f){return db[_0xd2a9('0x1c')]['create'](_0x19a218['body'],{})[_0xd2a9('0x13')](function(_0x20bb12){var _0x1266ee=_0x19a218[_0xd2a9('0x35')]['get']({'plain':!![]});if(!_0x1266ee)throw new Error(_0xd2a9('0x36'));if(_0x1266ee[_0xd2a9('0x37')]===_0xd2a9('0x35')){var _0x252cca=_0x20bb12[_0xd2a9('0x38')]({'plain':!![]});var _0x447c1f=_0xd2a9('0x14');return db[_0xd2a9('0x39')][_0xd2a9('0x33')]({'where':{'name':_0x447c1f,'userProfileId':_0x1266ee[_0xd2a9('0x3a')]},'raw':!![]})[_0xd2a9('0x13')](function(_0x254568){if(_0x254568&&_0x254568[_0xd2a9('0x3b')]===0x0){return db[_0xd2a9('0x15')][_0xd2a9('0x34')]({'name':_0x252cca[_0xd2a9('0x19')],'resourceId':_0x252cca['id'],'type':_0x254568[_0xd2a9('0x19')],'sectionId':_0x254568['id']},{})[_0xd2a9('0x13')](function(){return _0x20bb12;});}else{return _0x20bb12;}})['catch'](function(_0x4e9a36){logger['error'](_0xd2a9('0x3c'),_0x4e9a36);throw _0x4e9a36;});}return _0x20bb12;})[_0xd2a9('0x13')](respondWithResult(_0x4e689f,0xc9))[_0xd2a9('0x26')](handleError(_0x4e689f,null));};exports[_0xd2a9('0x12')]=function(_0x48cde8,_0x33c3aa){if(_0x48cde8[_0xd2a9('0x3d')]['id']){delete _0x48cde8[_0xd2a9('0x3d')]['id'];}return db['MailQueue'][_0xd2a9('0x33')]({'where':{'id':_0x48cde8[_0xd2a9('0x28')]['id']}})[_0xd2a9('0x13')](handleEntityNotFound(_0x33c3aa,null))[_0xd2a9('0x13')](saveUpdates(_0x48cde8[_0xd2a9('0x3d')],null))['then'](respondWithResult(_0x33c3aa,null))[_0xd2a9('0x26')](handleError(_0x33c3aa,null));};exports[_0xd2a9('0x16')]=function(_0x47b325,_0x2a3a07){return db['MailQueue'][_0xd2a9('0x33')]({'where':{'id':_0x47b325[_0xd2a9('0x28')]['id']}})[_0xd2a9('0x13')](handleEntityNotFound(_0x2a3a07,null))[_0xd2a9('0x13')](removeEntity(_0x2a3a07,null))['catch'](handleError(_0x2a3a07,null));};exports[_0xd2a9('0x3e')]=function(_0x15eb7c,_0x8efc53){return db[_0xd2a9('0x1c')]['describe']()[_0xd2a9('0x13')](respondWithResult(_0x8efc53,null))[_0xd2a9('0x26')](handleError(_0x8efc53,null));};exports['getMembers']=function(_0x2458bd,_0x1c6439){var _0x4555f9={'raw':!![],'where':{}},_0x28d7ef={},_0x1cbc67;return db[_0xd2a9('0x1c')]['findOne']({'where':{'id':_0x2458bd['params']['id']}})[_0xd2a9('0x13')](handleEntityNotFound(_0x1c6439,null))[_0xd2a9('0x13')](function(_0x46e3cd){if(_0x46e3cd){_0x1cbc67=_0x46e3cd[_0xd2a9('0x38')]({'plain':!![]});_0x28d7ef[_0xd2a9('0x29')]=_[_0xd2a9('0x2a')](db['UserMailQueue']['rawAttributes']);_0x28d7ef[_0xd2a9('0x24')]=_['keys'](_0x2458bd['query']);_0x28d7ef[_0xd2a9('0x2b')]=_[_0xd2a9('0x2c')](_0x28d7ef[_0xd2a9('0x29')],_0x28d7ef[_0xd2a9('0x24')]);_0x4555f9[_0xd2a9('0x2e')]=_[_0xd2a9('0x2c')](_0x28d7ef[_0xd2a9('0x29')],qs[_0xd2a9('0x2d')](_0x2458bd[_0xd2a9('0x24')][_0xd2a9('0x2d')]));_0x4555f9[_0xd2a9('0x2e')]=_0x4555f9[_0xd2a9('0x2e')][_0xd2a9('0x2f')]?_0x4555f9[_0xd2a9('0x2e')]:_0x28d7ef[_0xd2a9('0x29')];if(!_0x2458bd['query']['hasOwnProperty'](_0xd2a9('0x3f'))){_0x4555f9[_0xd2a9('0xe')]=qs[_0xd2a9('0xe')](_0x2458bd[_0xd2a9('0x24')][_0xd2a9('0xe')]);_0x4555f9[_0xd2a9('0xc')]=qs[_0xd2a9('0xc')](_0x2458bd[_0xd2a9('0x24')][_0xd2a9('0xc')]);}_0x4555f9[_0xd2a9('0x40')]=qs['sort'](_0x2458bd[_0xd2a9('0x24')]['sort']);_0x4555f9[_0xd2a9('0x22')]=qs[_0xd2a9('0x2b')](_['pick'](_0x2458bd[_0xd2a9('0x24')],_0x28d7ef[_0xd2a9('0x2b')]));_0x4555f9[_0xd2a9('0x22')][_0xd2a9('0x41')]=_0x46e3cd['id'];if(_0x2458bd[_0xd2a9('0x24')][_0xd2a9('0x42')]){_0x4555f9[_0xd2a9('0x22')]=_['merge'](_0x4555f9[_0xd2a9('0x22')],{'$or':_[_0xd2a9('0x43')](_0x4555f9['attributes'],function(_0x3d0ae2){var _0x2110de={};_0x2110de[_0x3d0ae2]={'$like':'%'+_0x2458bd['query']['filter']+'%'};return _0x2110de;})});}_0x4555f9=_['merge']({},_0x4555f9,_0x2458bd[_0xd2a9('0x32')]);return db['UserMailQueue'][_0xd2a9('0x25')](_0x4555f9);}})[_0xd2a9('0x13')](function(_0x2c3468){if(_0x2c3468){return db[_0xd2a9('0x44')][_0xd2a9('0x45')]({'where':{'id':_['map'](_0x2c3468,_0xd2a9('0x46')),'role':_0xd2a9('0x47')},'attributes':['id',_0xd2a9('0x19'),_0xd2a9('0x48'),_0xd2a9('0x49'),_0xd2a9('0x4a')]});}})[_0xd2a9('0x13')](function(_0x8c69f1){if(_0x8c69f1){return{'count':_0x8c69f1[_0xd2a9('0xf')],'rows':_[_0xd2a9('0x43')](_0x8c69f1['rows'],function(_0x3ad213){return{'membername':_0x3ad213[_0xd2a9('0x19')],'UserId':_0x3ad213['id'],'queue_name':_0x1cbc67[_0xd2a9('0x19')],'MailQueueId':_0x1cbc67['id'],'interface':util['format'](_0xd2a9('0x4b'),_0xd2a9('0x4c'),_0x3ad213[_0xd2a9('0x19')]),'penalty':0x0,'paused':_0x3ad213[_0xd2a9('0x48')],'createdAt':_0x3ad213[_0xd2a9('0x4a')],'updatedAt':_0x3ad213[_0xd2a9('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd2a9('0x13')](respondWithFilteredResult(_0x1c6439,_0x4555f9))['catch'](handleError(_0x1c6439,null));};exports[_0xd2a9('0x4d')]=function(_0x554104,_0x1bc3ef){var _0x1d6034={};var _0x3fb379={};var _0x48b969;var _0x4d02cd;return db[_0xd2a9('0x1c')]['findOne']({'where':{'id':_0x554104['params']['id']}})[_0xd2a9('0x13')](handleEntityNotFound(_0x1bc3ef,null))['then'](function(_0xcfc204){if(_0xcfc204){_0x48b969=_0xcfc204;_0x3fb379[_0xd2a9('0x29')]=_['keys'](db[_0xd2a9('0x4e')]['rawAttributes']);_0x3fb379[_0xd2a9('0x24')]=_[_0xd2a9('0x2a')](_0x554104[_0xd2a9('0x24')]);_0x3fb379['filters']=_['intersection'](_0x3fb379['model'],_0x3fb379[_0xd2a9('0x24')]);_0x1d6034[_0xd2a9('0x2e')]=_[_0xd2a9('0x2c')](_0x3fb379[_0xd2a9('0x29')],qs['fields'](_0x554104['query']['fields']));_0x1d6034[_0xd2a9('0x2e')]=_0x1d6034[_0xd2a9('0x2e')][_0xd2a9('0x2f')]?_0x1d6034[_0xd2a9('0x2e')]:_0x3fb379[_0xd2a9('0x29')];_0x1d6034[_0xd2a9('0x40')]=qs[_0xd2a9('0x4f')](_0x554104[_0xd2a9('0x24')][_0xd2a9('0x4f')]);_0x1d6034['where']=qs['filters'](_[_0xd2a9('0x50')](_0x554104[_0xd2a9('0x24')],_0x3fb379[_0xd2a9('0x2b')]));if(_0x554104[_0xd2a9('0x24')]['filter']){_0x1d6034[_0xd2a9('0x22')]=_[_0xd2a9('0x31')](_0x1d6034[_0xd2a9('0x22')],{'$or':_[_0xd2a9('0x43')](_0x1d6034[_0xd2a9('0x2e')],function(_0x181a9b){var _0x3bbbb4={};_0x3bbbb4[_0x181a9b]={'$like':'%'+_0x554104['query'][_0xd2a9('0x42')]+'%'};return _0x3bbbb4;})});}_0x1d6034=_[_0xd2a9('0x31')]({},_0x1d6034,_0x554104[_0xd2a9('0x32')]);return _0x48b969[_0xd2a9('0x4d')](_0x1d6034);}})[_0xd2a9('0x13')](function(_0x1fd269){if(_0x1fd269){_0x4d02cd=_0x1fd269['length'];if(!_0x554104['query']['hasOwnProperty'](_0xd2a9('0x3f'))){_0x1d6034[_0xd2a9('0xe')]=qs[_0xd2a9('0xe')](_0x554104[_0xd2a9('0x24')][_0xd2a9('0xe')]);_0x1d6034[_0xd2a9('0xc')]=qs[_0xd2a9('0xc')](_0x554104['query'][_0xd2a9('0xc')]);}return _0x48b969['getTeams'](_0x1d6034);}})['then'](function(_0x428495){if(_0x428495){return _0x428495?{'count':_0x4d02cd,'rows':_0x428495}:null;}})[_0xd2a9('0x13')](respondWithResult(_0x1bc3ef,null))[_0xd2a9('0x26')](handleError(_0x1bc3ef,null));};exports[_0xd2a9('0x51')]=function(_0x19b6d8,_0x42c25d){var _0x335e17=_0x19b6d8[_0xd2a9('0x3d')][_0xd2a9('0x52')];return db[_0xd2a9('0x4e')][_0xd2a9('0x25')]({'where':{'id':_0x335e17},'attributes':['id'],'include':[{'model':db[_0xd2a9('0x44')],'as':'Agents','attributes':['id','name',_0xd2a9('0x53'),_0xd2a9('0x54'),_0xd2a9('0x55')],'raw':!![]}]})[_0xd2a9('0x13')](function(_0x3c106d){if(_0x3c106d){var _0x20612f=_[_0xd2a9('0x56')](_0x3c106d,function(_0x4b24f0){var _0x11aa02=_0x4b24f0[_0xd2a9('0x38')]({'plain':!![]});return _0x11aa02[_0xd2a9('0x57')];});return db['MailQueue'][_0xd2a9('0x33')]({'where':{'id':_0x19b6d8[_0xd2a9('0x28')]['id']}})[_0xd2a9('0x13')](function(_0x489953){return db[_0xd2a9('0x58')][_0xd2a9('0x59')](function(_0x40df35){return _0x489953[_0xd2a9('0x51')](_0x335e17,{'transaction':_0x40df35})[_0xd2a9('0x13')](function(){return BPromise[_0xd2a9('0x5a')](_0x20612f,function(_0x4b268f){return db[_0xd2a9('0x5b')][_0xd2a9('0x5c')]({'where':{'UserId':_0x4b268f['id'],'MailQueueId':_0x19b6d8[_0xd2a9('0x28')]['id']},'transaction':_0x40df35});});})[_0xd2a9('0x13')](function(){_0x20612f[_0xd2a9('0x5d')](function(_0x2404b3){socket[_0xd2a9('0x5e')](_0xd2a9('0x5f'),{'UserId':_0x2404b3['id'],'MailQueueId':_0x489953['id']});});});});});}})['then'](respondWithStatusCode(_0x42c25d,null))['catch'](handleError(_0x42c25d,null));};exports[_0xd2a9('0x60')]=function(_0x2ecb45,_0x2f6ed7){return db[_0xd2a9('0x4e')][_0xd2a9('0x25')]({'where':{'id':_0x2ecb45[_0xd2a9('0x24')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd2a9('0x57'),'attributes':['id'],'raw':!![]}]})[_0xd2a9('0x13')](handleEntityNotFound(_0x2f6ed7,null))['then'](function(_0x41712d){var _0x348437=_[_0xd2a9('0x43')](_0x41712d,'id');var _0x267541=[];var _0x3d84b9=[];var _0x192a2c=squel[_0xd2a9('0x61')]();_0x192a2c[_0xd2a9('0x62')](_0xd2a9('0x63'))[_0xd2a9('0x64')]('team_has_mail_queues','tq')['join'](_0xd2a9('0x65'),'ut',_0xd2a9('0x66'))[_0xd2a9('0x22')]('MailQueueId\x20=\x20?',_0x2ecb45['params']['id']);for(var _0x3bdfb2=0x0;_0x3bdfb2<_0x41712d[_0xd2a9('0x2f')];_0x3bdfb2+=0x1){let _0x376db7=_0x41712d[_0x3bdfb2];for(var _0x377e9b=0x0;_0x377e9b<_0x376db7[_0xd2a9('0x57')][_0xd2a9('0x2f')];_0x377e9b+=0x1){let _0x310a01=_0x376db7['Agents'][_0x377e9b];var _0x4a7189=_0x192a2c[_0xd2a9('0x67')]();_0x4a7189[_0xd2a9('0x22')](_0xd2a9('0x68'),_0x310a01['id']);_0x3d84b9['push'](db['sequelize']['query'](_0x4a7189['toString'](),{'type':db[_0xd2a9('0x58')]['QueryTypes'][_0xd2a9('0x69')]})[_0xd2a9('0x13')](function(_0x2da5da){if(_0x2da5da[_0xd2a9('0x2f')]===0x1){return _0x310a01['id'];}else{var _0x4de456=_[_0xd2a9('0x6a')](_[_0xd2a9('0x43')](_0x2da5da,_0xd2a9('0x6b')),function(_0x508d7d){return _['includes'](_0x348437,_0x508d7d);});if(_0x4de456){return _0x310a01['id'];}}}));}}return BPromise[_0xd2a9('0x6c')](_0x3d84b9)[_0xd2a9('0x13')](function(_0x5a3198){_0x267541=_(_0x267541)['union'](_0x5a3198)[_0xd2a9('0x6d')]()[_0xd2a9('0x6e')]();return db[_0xd2a9('0x1c')][_0xd2a9('0x33')]({'where':{'id':_0x2ecb45[_0xd2a9('0x28')]['id']}})[_0xd2a9('0x13')](function(_0x4b7156){return db[_0xd2a9('0x58')]['transaction'](function(_0x2b150f){return _0x4b7156['removeTeams'](_0x2ecb45[_0xd2a9('0x24')][_0xd2a9('0x52')],{'transaction':_0x2b150f})['then'](function(){if(!_[_0xd2a9('0x6f')](_0x267541)){return _0x4b7156[_0xd2a9('0x70')](_0x267541,{'transaction':_0x2b150f});}})[_0xd2a9('0x13')](function(){_0x267541['forEach'](function(_0x3b4b50){socket['emit'](_0xd2a9('0x71'),{'UserId':_0x3b4b50,'MailQueueId':_0x4b7156['id']});});});});});});})[_0xd2a9('0x13')](respondWithStatusCode(_0x2f6ed7,null))[_0xd2a9('0x26')](handleError(_0x2f6ed7,null));};exports[_0xd2a9('0x72')]=function(_0x277d55,_0x5458d6){return db[_0xd2a9('0x1c')][_0xd2a9('0x33')]({'where':{'id':_0x277d55['params']['id']}})[_0xd2a9('0x13')](handleEntityNotFound(_0x5458d6,null))[_0xd2a9('0x13')](function(_0x143755){if(_0x143755){return _0x143755[_0xd2a9('0x72')](_0x277d55[_0xd2a9('0x3d')][_0xd2a9('0x52')],_[_0xd2a9('0x73')](_0x277d55[_0xd2a9('0x3d')],['ids','id'])||{})[_0xd2a9('0x74')](function(_0x267b71){for(var _0x53a630=0x0;_0x53a630<_0x277d55[_0xd2a9('0x3d')][_0xd2a9('0x52')][_0xd2a9('0x2f')];_0x53a630+=0x1){socket['emit'](_0xd2a9('0x5f'),{'UserId':Number(_0x277d55[_0xd2a9('0x3d')][_0xd2a9('0x52')][_0x53a630]),'MailQueueId':Number(_0x277d55['params']['id'])});}return _0x267b71;});}})['then'](respondWithResult(_0x5458d6,null))[_0xd2a9('0x26')](handleError(_0x5458d6,null));};exports[_0xd2a9('0x70')]=function(_0x2265be,_0x3ba19d){return db[_0xd2a9('0x1c')][_0xd2a9('0x33')]({'where':{'id':_0x2265be[_0xd2a9('0x28')]['id']}})[_0xd2a9('0x13')](handleEntityNotFound(_0x3ba19d,null))[_0xd2a9('0x13')](function(_0x5b39d9){if(_0x5b39d9){return _0x5b39d9[_0xd2a9('0x70')](_0x2265be['query'][_0xd2a9('0x52')])[_0xd2a9('0x13')](function(){if(_[_0xd2a9('0x75')](_0x2265be[_0xd2a9('0x24')][_0xd2a9('0x52')])){for(var _0x306df3=0x0;_0x306df3<_0x2265be[_0xd2a9('0x24')][_0xd2a9('0x52')]['length'];_0x306df3+=0x1){socket[_0xd2a9('0x5e')](_0xd2a9('0x71'),{'UserId':Number(_0x2265be[_0xd2a9('0x24')][_0xd2a9('0x52')][_0x306df3]),'MailQueueId':Number(_0x2265be[_0xd2a9('0x28')]['id'])});}}else{socket[_0xd2a9('0x5e')](_0xd2a9('0x71'),{'UserId':Number(_0x2265be[_0xd2a9('0x24')][_0xd2a9('0x52')]),'MailQueueId':Number(_0x2265be[_0xd2a9('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x3ba19d,null))[_0xd2a9('0x26')](handleError(_0x3ba19d,null));};exports[_0xd2a9('0x76')]=function(_0x517aaa,_0x4b5ec7){var _0x389636={};var _0x35d129={};var _0x24588f;var _0x4f4c35;return db[_0xd2a9('0x1c')][_0xd2a9('0x77')]({'where':{'id':_0x517aaa[_0xd2a9('0x28')]['id']}})[_0xd2a9('0x13')](handleEntityNotFound(_0x4b5ec7,null))[_0xd2a9('0x13')](function(_0x4bbcee){if(_0x4bbcee){_0x24588f=_0x4bbcee;_0x35d129['model']=_[_0xd2a9('0x2a')](db[_0xd2a9('0x44')][_0xd2a9('0x1d')]);_0x35d129[_0xd2a9('0x24')]=_[_0xd2a9('0x2a')](_0x517aaa[_0xd2a9('0x24')]);_0x35d129[_0xd2a9('0x2b')]=_[_0xd2a9('0x2c')](_0x35d129[_0xd2a9('0x29')],_0x35d129[_0xd2a9('0x24')]);_0x389636[_0xd2a9('0x2e')]=_[_0xd2a9('0x2c')](_0x35d129[_0xd2a9('0x29')],qs['fields'](_0x517aaa['query'][_0xd2a9('0x2d')]));_0x389636['attributes']=_0x389636[_0xd2a9('0x2e')][_0xd2a9('0x2f')]?_0x389636[_0xd2a9('0x2e')]:_0x35d129['model'];_0x389636[_0xd2a9('0x40')]=qs[_0xd2a9('0x4f')](_0x517aaa[_0xd2a9('0x24')]['sort']);_0x389636[_0xd2a9('0x22')]=qs[_0xd2a9('0x2b')](_['pick'](_0x517aaa[_0xd2a9('0x24')],_0x35d129[_0xd2a9('0x2b')]));if(_0x517aaa[_0xd2a9('0x24')][_0xd2a9('0x42')]){_0x389636['where']=_[_0xd2a9('0x31')](_0x389636[_0xd2a9('0x22')],{'$or':_[_0xd2a9('0x43')](_0x389636[_0xd2a9('0x2e')],function(_0x519f52){var _0x950ae3={};_0x950ae3[_0x519f52]={'$like':'%'+_0x517aaa[_0xd2a9('0x24')][_0xd2a9('0x42')]+'%'};return _0x950ae3;})});}_0x389636=_['merge']({},_0x389636,_0x517aaa['options']);return _0x24588f[_0xd2a9('0x76')](_0x389636);}})[_0xd2a9('0x13')](function(_0x26d69f){if(_0x26d69f){_0x4f4c35=_0x26d69f[_0xd2a9('0x2f')];if(!_0x517aaa[_0xd2a9('0x24')]['hasOwnProperty']('nolimit')){_0x389636[_0xd2a9('0xe')]=qs[_0xd2a9('0xe')](_0x517aaa[_0xd2a9('0x24')][_0xd2a9('0xe')]);_0x389636[_0xd2a9('0xc')]=qs[_0xd2a9('0xc')](_0x517aaa['query'][_0xd2a9('0xc')]);}return _0x24588f[_0xd2a9('0x76')](_0x389636);}})[_0xd2a9('0x13')](function(_0x31a137){if(_0x31a137){return _0x31a137?{'count':_0x4f4c35,'rows':_0x31a137}:null;}})[_0xd2a9('0x13')](respondWithResult(_0x4b5ec7,null))[_0xd2a9('0x26')](handleError(_0x4b5ec7,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 0cb51b9..1caa183 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 _0x0610=['../../mysqldb','MailQueue','setMaxListeners','save','remove','emit','exports','events'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0x0610,0xaf));var _0x0061=function(_0x130b0f,_0x3bb0de){_0x130b0f=_0x130b0f-0x0;var _0x5f4468=_0x0610[_0x130b0f];return _0x5f4468;};'use strict';var EventEmitter=require(_0x0061('0x0'));var MailQueue=require(_0x0061('0x1'))['db'][_0x0061('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x0061('0x3')](0x0);var events={'afterCreate':_0x0061('0x4'),'afterUpdate':'update','afterDestroy':_0x0061('0x5')};function emitEvent(_0x455246){return function(_0x4841f2,_0x2da1d9,_0x4beca5){MailQueueEvents[_0x0061('0x6')](_0x455246+':'+_0x4841f2['id'],_0x4841f2);MailQueueEvents[_0x0061('0x6')](_0x455246,_0x4841f2);_0x4beca5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x0061('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x87ab=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x87ab,0x13d));var _0xb87a=function(_0x500f2a,_0x1f4102){_0x500f2a=_0x500f2a-0x0;var _0x2b431c=_0x87ab[_0x500f2a];return _0x2b431c;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xb87a('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xb87a('0x1')](0x0);var events={'afterCreate':_0xb87a('0x2'),'afterUpdate':_0xb87a('0x3'),'afterDestroy':_0xb87a('0x4')};function emitEvent(_0x1b4737){return function(_0x134ee3,_0x40b315,_0x234f6a){MailQueueEvents[_0xb87a('0x5')](_0x1b4737+':'+_0x134ee3['id'],_0x134ee3);MailQueueEvents[_0xb87a('0x5')](_0x1b4737,_0x134ee3);_0x234f6a(null);};}for(var e in events){if(events[_0xb87a('0x6')](e)){var event=events[e];MailQueue[_0xb87a('0x7')](e,emitEvent(event));}}module[_0xb87a('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 9a0bad5..4820e8b 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 _0xcd64=['define','MailQueue','mail_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0xf6d8f1,_0x87ece3){var _0x3fd9d1=function(_0x3d0dbd){while(--_0x3d0dbd){_0xf6d8f1['push'](_0xf6d8f1['shift']());}};_0x3fd9d1(++_0x87ece3);}(_0xcd64,0x123));var _0x4cd6=function(_0x388ef9,_0x2751b8){_0x388ef9=_0x388ef9-0x0;var _0x80e8aa=_0xcd64[_0x388ef9];return _0x80e8aa;};'use strict';var _=require('lodash');var util=require(_0x4cd6('0x0'));var logger=require(_0x4cd6('0x1'))(_0x4cd6('0x2'));var moment=require(_0x4cd6('0x3'));var BPromise=require('bluebird');var rp=require(_0x4cd6('0x4'));var fs=require('fs');var path=require(_0x4cd6('0x5'));var rimraf=require(_0x4cd6('0x6'));var config=require(_0x4cd6('0x7'));var attributes=require(_0x4cd6('0x8'));module['exports']=function(_0x28b983,_0x172a11){return _0x28b983[_0x4cd6('0x9')](_0x4cd6('0xa'),attributes,{'tableName':_0x4cd6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x647b=['moment','request-promise','../../config/environment','exports','mail_queues','lodash','../../config/logger'];(function(_0x745c75,_0x3ddc96){var _0x15d6c2=function(_0x14f803){while(--_0x14f803){_0x745c75['push'](_0x745c75['shift']());}};_0x15d6c2(++_0x3ddc96);}(_0x647b,0x140));var _0xb647=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x647b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb647('0x0'));var util=require('util');var logger=require(_0xb647('0x1'))('api');var moment=require(_0xb647('0x2'));var BPromise=require('bluebird');var rp=require(_0xb647('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb647('0x4'));var attributes=require('./mailQueue.attributes');module[_0xb647('0x5')]=function(_0x556cd6,_0x289798){return _0x556cd6['define']('MailQueue',attributes,{'tableName':_0xb647('0x6'),'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 a6dd0ed..1dc6669 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 _0x5c70=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','debug','request\x20sent','stringify','error','code','MailQueue,\x20%s,\x20%s','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','limit','include','map','model','ShowMailQueue','find','raw'];(function(_0x2afe0c,_0x306d23){var _0x2395ca=function(_0x5e0d1f){while(--_0x5e0d1f){_0x2afe0c['push'](_0x2afe0c['shift']());}};_0x2395ca(++_0x306d23);}(_0x5c70,0x102));var _0x05c7=function(_0x948262,_0x1610b5){_0x948262=_0x948262-0x0;var _0x582757=_0x5c70[_0x948262];return _0x582757;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x05c7('0x0'));var BPromise=require(_0x05c7('0x1'));var rs=require(_0x05c7('0x2'));var fs=require('fs');var Redis=require(_0x05c7('0x3'));var db=require(_0x05c7('0x4'))['db'];var utils=require(_0x05c7('0x5'));var logger=require(_0x05c7('0x6'))(_0x05c7('0x7'));var config=require(_0x05c7('0x8'));var jayson=require(_0x05c7('0x9'));var client=jayson[_0x05c7('0xa')][_0x05c7('0xb')]({'port':0x232a});config[_0x05c7('0xc')]=_[_0x05c7('0xd')](config['redis'],{'host':_0x05c7('0xe'),'port':0x18eb});var socket=require(_0x05c7('0xf'))(new Redis(config[_0x05c7('0xc')]));require(_0x05c7('0x10'))[_0x05c7('0x11')](socket);function respondWithRpcPromise(_0x26b9d8,_0x2e331b,_0x355053){return new BPromise(function(_0x2ea087,_0x2b6c28){return client[_0x05c7('0x12')](_0x26b9d8,_0x355053)[_0x05c7('0x13')](function(_0x4ccd02){logger['info']('MailQueue,\x20%s,\x20%s',_0x2e331b,'request\x20sent');logger[_0x05c7('0x14')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x2e331b,_0x05c7('0x15'),JSON[_0x05c7('0x16')](_0x4ccd02));if(_0x4ccd02[_0x05c7('0x17')]){if(_0x4ccd02[_0x05c7('0x17')][_0x05c7('0x18')]===0x1f4){logger[_0x05c7('0x17')](_0x05c7('0x19'),_0x2e331b,_0x4ccd02[_0x05c7('0x17')][_0x05c7('0x1a')]);return _0x2b6c28(_0x4ccd02[_0x05c7('0x17')][_0x05c7('0x1a')]);}logger['error'](_0x05c7('0x19'),_0x2e331b,_0x4ccd02[_0x05c7('0x17')][_0x05c7('0x1a')]);return _0x2ea087(_0x4ccd02[_0x05c7('0x17')][_0x05c7('0x1a')]);}else{logger[_0x05c7('0x1b')](_0x05c7('0x19'),_0x2e331b,_0x05c7('0x15'));_0x2ea087(_0x4ccd02[_0x05c7('0x1c')][_0x05c7('0x1a')]);}})[_0x05c7('0x1d')](function(_0x42608e){logger['error'](_0x05c7('0x19'),_0x2e331b,_0x42608e);_0x2b6c28(_0x42608e);});});}exports[_0x05c7('0x1e')]=function(_0x650270){var _0x561b9d=this;return new Promise(function(_0x21ed11,_0x1091f4){return db[_0x05c7('0x1f')][_0x05c7('0x20')]({'raw':_0x650270[_0x05c7('0x21')]?_0x650270[_0x05c7('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x650270[_0x05c7('0x21')]?_0x650270[_0x05c7('0x21')][_0x05c7('0x22')]||null:null,'attributes':_0x650270[_0x05c7('0x21')]?_0x650270[_0x05c7('0x21')][_0x05c7('0x23')]||null:null,'limit':_0x650270['options']?_0x650270[_0x05c7('0x21')][_0x05c7('0x24')]||null:null,'include':_0x650270[_0x05c7('0x21')]?_0x650270[_0x05c7('0x21')][_0x05c7('0x25')]?_[_0x05c7('0x26')](_0x650270[_0x05c7('0x21')]['include'],function(_0x2abc92){return{'model':db[_0x2abc92[_0x05c7('0x27')]],'as':_0x2abc92['as'],'attributes':_0x2abc92[_0x05c7('0x23')],'include':_0x2abc92[_0x05c7('0x25')]?_['map'](_0x2abc92[_0x05c7('0x25')],function(_0x33b885){return{'model':db[_0x33b885[_0x05c7('0x27')]],'as':_0x33b885['as'],'attributes':_0x33b885[_0x05c7('0x23')],'include':_0x33b885[_0x05c7('0x25')]?_[_0x05c7('0x26')](_0x33b885[_0x05c7('0x25')],function(_0x4c27bc){return{'model':db[_0x4c27bc[_0x05c7('0x27')]],'as':_0x4c27bc['as'],'attributes':_0x4c27bc[_0x05c7('0x23')]};}):[]};}):[]};}):[]:[]})[_0x05c7('0x13')](function(_0x588975){logger[_0x05c7('0x1b')](_0x05c7('0x1e'),_0x650270);logger[_0x05c7('0x14')]('GetMailQueue',_0x650270,JSON['stringify'](_0x588975));_0x21ed11(_0x588975);})[_0x05c7('0x1d')](function(_0x3e3df2){logger[_0x05c7('0x17')](_0x05c7('0x1e'),_0x3e3df2[_0x05c7('0x1a')],_0x650270);_0x1091f4(_0x561b9d[_0x05c7('0x17')](0x1f4,_0x3e3df2[_0x05c7('0x1a')]));});});};exports[_0x05c7('0x28')]=function(_0x2daf79){var _0x1bd05c=this;return new Promise(function(_0x312222,_0x24a160){return db[_0x05c7('0x1f')][_0x05c7('0x29')]({'raw':_0x2daf79[_0x05c7('0x21')]?_0x2daf79[_0x05c7('0x21')][_0x05c7('0x2a')]===undefined?!![]:![]:!![],'where':_0x2daf79[_0x05c7('0x21')]?_0x2daf79['options'][_0x05c7('0x22')]||null:null,'attributes':_0x2daf79['options']?_0x2daf79['options'][_0x05c7('0x23')]||null:null,'include':_0x2daf79[_0x05c7('0x21')]?_0x2daf79[_0x05c7('0x21')][_0x05c7('0x25')]?_['map'](_0x2daf79[_0x05c7('0x21')][_0x05c7('0x25')],function(_0x5dd100){return{'model':db[_0x5dd100['model']],'as':_0x5dd100['as'],'attributes':_0x5dd100['attributes'],'include':_0x5dd100[_0x05c7('0x25')]?_[_0x05c7('0x26')](_0x5dd100[_0x05c7('0x25')],function(_0x5c10ae){return{'model':db[_0x5c10ae[_0x05c7('0x27')]],'as':_0x5c10ae['as'],'attributes':_0x5c10ae[_0x05c7('0x23')],'include':_0x5c10ae['include']?_[_0x05c7('0x26')](_0x5c10ae[_0x05c7('0x25')],function(_0x3ed66e){return{'model':db[_0x3ed66e[_0x05c7('0x27')]],'as':_0x3ed66e['as'],'attributes':_0x3ed66e[_0x05c7('0x23')]};}):[]};}):[]};}):[]:[]})[_0x05c7('0x13')](function(_0x1e5183){logger[_0x05c7('0x1b')]('ShowMailQueue',_0x2daf79);logger['debug'](_0x05c7('0x28'),_0x2daf79,JSON[_0x05c7('0x16')](_0x1e5183));_0x312222(_0x1e5183);})['catch'](function(_0x2c3587){logger['error'](_0x05c7('0x28'),_0x2c3587[_0x05c7('0x1a')],_0x2daf79);_0x24a160(_0x1bd05c['error'](0x1f4,_0x2c3587[_0x05c7('0x1a')]));});});}; \ No newline at end of file +var _0x8e87=['raw','attributes','include','map','model','ShowMailQueue','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options'];(function(_0x40601e,_0x3ee87e){var _0x3abf64=function(_0x4eaee3){while(--_0x4eaee3){_0x40601e['push'](_0x40601e['shift']());}};_0x3abf64(++_0x3ee87e);}(_0x8e87,0x1a2));var _0x78e8=function(_0x426c7d,_0x5ad443){_0x426c7d=_0x426c7d-0x0;var _0x26b055=_0x8e87[_0x426c7d];return _0x26b055;};'use strict';var _=require(_0x78e8('0x0'));var util=require(_0x78e8('0x1'));var moment=require(_0x78e8('0x2'));var BPromise=require('bluebird');var rs=require(_0x78e8('0x3'));var fs=require('fs');var Redis=require(_0x78e8('0x4'));var db=require(_0x78e8('0x5'))['db'];var utils=require(_0x78e8('0x6'));var logger=require(_0x78e8('0x7'))(_0x78e8('0x8'));var config=require(_0x78e8('0x9'));var jayson=require(_0x78e8('0xa'));var client=jayson['client'][_0x78e8('0xb')]({'port':0x232a});config[_0x78e8('0xc')]=_[_0x78e8('0xd')](config[_0x78e8('0xc')],{'host':_0x78e8('0xe'),'port':0x18eb});var socket=require(_0x78e8('0xf'))(new Redis(config[_0x78e8('0xc')]));require('./mailQueue.socket')[_0x78e8('0x10')](socket);function respondWithRpcPromise(_0x1d95a0,_0x2707eb,_0x563364){return new BPromise(function(_0x2617f3,_0x4ef3a9){return client[_0x78e8('0x11')](_0x1d95a0,_0x563364)[_0x78e8('0x12')](function(_0x26f931){logger[_0x78e8('0x13')](_0x78e8('0x14'),_0x2707eb,'request\x20sent');logger[_0x78e8('0x15')](_0x78e8('0x16'),_0x2707eb,_0x78e8('0x17'),JSON[_0x78e8('0x18')](_0x26f931));if(_0x26f931[_0x78e8('0x19')]){if(_0x26f931[_0x78e8('0x19')][_0x78e8('0x1a')]===0x1f4){logger[_0x78e8('0x19')](_0x78e8('0x14'),_0x2707eb,_0x26f931[_0x78e8('0x19')][_0x78e8('0x1b')]);return _0x4ef3a9(_0x26f931[_0x78e8('0x19')][_0x78e8('0x1b')]);}logger[_0x78e8('0x19')](_0x78e8('0x14'),_0x2707eb,_0x26f931[_0x78e8('0x19')]['message']);return _0x2617f3(_0x26f931[_0x78e8('0x19')]['message']);}else{logger[_0x78e8('0x13')](_0x78e8('0x14'),_0x2707eb,_0x78e8('0x17'));_0x2617f3(_0x26f931['result']['message']);}})[_0x78e8('0x1c')](function(_0x1624fc){logger[_0x78e8('0x19')]('MailQueue,\x20%s,\x20%s',_0x2707eb,_0x1624fc);_0x4ef3a9(_0x1624fc);});});}exports[_0x78e8('0x1d')]=function(_0x213b7f){var _0x38fe5a=this;return new Promise(function(_0x4269a7,_0x454b34){return db[_0x78e8('0x1e')][_0x78e8('0x1f')]({'raw':_0x213b7f[_0x78e8('0x20')]?_0x213b7f[_0x78e8('0x20')][_0x78e8('0x21')]===undefined?!![]:![]:!![],'where':_0x213b7f[_0x78e8('0x20')]?_0x213b7f['options']['where']||null:null,'attributes':_0x213b7f[_0x78e8('0x20')]?_0x213b7f[_0x78e8('0x20')][_0x78e8('0x22')]||null:null,'limit':_0x213b7f[_0x78e8('0x20')]?_0x213b7f['options']['limit']||null:null,'include':_0x213b7f['options']?_0x213b7f['options'][_0x78e8('0x23')]?_[_0x78e8('0x24')](_0x213b7f[_0x78e8('0x20')][_0x78e8('0x23')],function(_0x4816cd){return{'model':db[_0x4816cd['model']],'as':_0x4816cd['as'],'attributes':_0x4816cd[_0x78e8('0x22')],'include':_0x4816cd[_0x78e8('0x23')]?_['map'](_0x4816cd[_0x78e8('0x23')],function(_0x1eb689){return{'model':db[_0x1eb689['model']],'as':_0x1eb689['as'],'attributes':_0x1eb689[_0x78e8('0x22')],'include':_0x1eb689['include']?_[_0x78e8('0x24')](_0x1eb689['include'],function(_0x4c80b9){return{'model':db[_0x4c80b9[_0x78e8('0x25')]],'as':_0x4c80b9['as'],'attributes':_0x4c80b9[_0x78e8('0x22')]};}):[]};}):[]};}):[]:[]})[_0x78e8('0x12')](function(_0x354a08){logger[_0x78e8('0x13')](_0x78e8('0x1d'),_0x213b7f);logger[_0x78e8('0x15')](_0x78e8('0x1d'),_0x213b7f,JSON[_0x78e8('0x18')](_0x354a08));_0x4269a7(_0x354a08);})[_0x78e8('0x1c')](function(_0x3905db){logger[_0x78e8('0x19')](_0x78e8('0x1d'),_0x3905db[_0x78e8('0x1b')],_0x213b7f);_0x454b34(_0x38fe5a[_0x78e8('0x19')](0x1f4,_0x3905db[_0x78e8('0x1b')]));});});};exports[_0x78e8('0x26')]=function(_0x42229f){var _0x3606bd=this;return new Promise(function(_0x1c195a,_0x1a4fd7){return db[_0x78e8('0x1e')][_0x78e8('0x27')]({'raw':_0x42229f[_0x78e8('0x20')]?_0x42229f[_0x78e8('0x20')][_0x78e8('0x21')]===undefined?!![]:![]:!![],'where':_0x42229f[_0x78e8('0x20')]?_0x42229f[_0x78e8('0x20')][_0x78e8('0x28')]||null:null,'attributes':_0x42229f['options']?_0x42229f[_0x78e8('0x20')][_0x78e8('0x22')]||null:null,'include':_0x42229f[_0x78e8('0x20')]?_0x42229f[_0x78e8('0x20')][_0x78e8('0x23')]?_['map'](_0x42229f['options'][_0x78e8('0x23')],function(_0x3a8b6a){return{'model':db[_0x3a8b6a['model']],'as':_0x3a8b6a['as'],'attributes':_0x3a8b6a[_0x78e8('0x22')],'include':_0x3a8b6a[_0x78e8('0x23')]?_[_0x78e8('0x24')](_0x3a8b6a['include'],function(_0x53a084){return{'model':db[_0x53a084[_0x78e8('0x25')]],'as':_0x53a084['as'],'attributes':_0x53a084[_0x78e8('0x22')],'include':_0x53a084['include']?_[_0x78e8('0x24')](_0x53a084[_0x78e8('0x23')],function(_0x2888e4){return{'model':db[_0x2888e4[_0x78e8('0x25')]],'as':_0x2888e4['as'],'attributes':_0x2888e4[_0x78e8('0x22')]};}):[]};}):[]};}):[]:[]})[_0x78e8('0x12')](function(_0x404e9d){logger[_0x78e8('0x13')](_0x78e8('0x26'),_0x42229f);logger['debug'](_0x78e8('0x26'),_0x42229f,JSON[_0x78e8('0x18')](_0x404e9d));_0x1c195a(_0x404e9d);})[_0x78e8('0x1c')](function(_0x37aea3){logger[_0x78e8('0x19')](_0x78e8('0x26'),_0x37aea3['message'],_0x42229f);_0x1a4fd7(_0x3606bd[_0x78e8('0x19')](0x1f4,_0x37aea3[_0x78e8('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 02dae34..074f2a7 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 _0x2fee=['length','mailQueue:','./mailQueue.events','remove','emit','removeListener','register'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0x2fee,0x11a));var _0xe2fe=function(_0x4fcd21,_0x3b4148){_0x4fcd21=_0x4fcd21-0x0;var _0x3af7b8=_0x2fee[_0x4fcd21];return _0x3af7b8;};'use strict';var MailQueueEvents=require(_0xe2fe('0x0'));var events=['save',_0xe2fe('0x1'),'update'];function createListener(_0x1d5e13,_0x5dd7b6){return function(_0x35d241){_0x5dd7b6[_0xe2fe('0x2')](_0x1d5e13,_0x35d241);};}function removeListener(_0x4ca9af,_0x15f1a2){return function(){MailQueueEvents[_0xe2fe('0x3')](_0x4ca9af,_0x15f1a2);};}exports[_0xe2fe('0x4')]=function(_0x4d4ac4){for(var _0x20d031=0x0,_0x361d40=events[_0xe2fe('0x5')];_0x20d031<_0x361d40;_0x20d031++){var _0xe0f512=events[_0x20d031];var _0x39a31c=createListener(_0xe2fe('0x6')+_0xe0f512,_0x4d4ac4);MailQueueEvents['on'](_0xe0f512,_0x39a31c);}}; \ No newline at end of file +var _0x122a=['update','emit','removeListener','register','./mailQueue.events','save','remove'];(function(_0x3d825a,_0x7ef0a5){var _0xbe1609=function(_0x572ac2){while(--_0x572ac2){_0x3d825a['push'](_0x3d825a['shift']());}};_0xbe1609(++_0x7ef0a5);}(_0x122a,0xba));var _0xa122=function(_0x387a4d,_0x371322){_0x387a4d=_0x387a4d-0x0;var _0x300c70=_0x122a[_0x387a4d];return _0x300c70;};'use strict';var MailQueueEvents=require(_0xa122('0x0'));var events=[_0xa122('0x1'),_0xa122('0x2'),_0xa122('0x3')];function createListener(_0x223434,_0x4db0d3){return function(_0x5cbed0){_0x4db0d3[_0xa122('0x4')](_0x223434,_0x5cbed0);};}function removeListener(_0x54d20a,_0x1c87aa){return function(){MailQueueEvents[_0xa122('0x5')](_0x54d20a,_0x1c87aa);};}exports[_0xa122('0x6')]=function(_0x3c8130){for(var _0x526272=0x0,_0x576d57=events['length'];_0x526272<_0x576d57;_0x526272++){var _0x23e139=events[_0x526272];var _0x190f74=createListener('mailQueue:'+_0x23e139,_0x3c8130);MailQueueEvents['on'](_0x23e139,_0x190f74);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index e951a04..54a46b5 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 _0xbc2d=['isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','express','Router','../../config/environment','./mailQueueReport.controller','get'];(function(_0x3324d4,_0x115bef){var _0x88552f=function(_0x329114){while(--_0x329114){_0x3324d4['push'](_0x3324d4['shift']());}};_0x88552f(++_0x115bef);}(_0xbc2d,0x172));var _0xdbc2=function(_0x40b9d9,_0x53eaec){_0x40b9d9=_0x40b9d9-0x0;var _0x3edc14=_0xbc2d[_0x40b9d9];return _0x3edc14;};'use strict';var multer=require(_0xdbc2('0x0'));var util=require('util');var path=require(_0xdbc2('0x1'));var timeout=require(_0xdbc2('0x2'));var express=require(_0xdbc2('0x3'));var router=express[_0xdbc2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdbc2('0x5'));var controller=require(_0xdbc2('0x6'));router[_0xdbc2('0x7')]('/',auth[_0xdbc2('0x8')](),controller['index']);router[_0xdbc2('0x7')](_0xdbc2('0x9'),auth[_0xdbc2('0x8')](),controller[_0xdbc2('0xa')]);router[_0xdbc2('0x7')](_0xdbc2('0xb'),auth[_0xdbc2('0x8')](),controller[_0xdbc2('0xc')]);router[_0xdbc2('0xd')]('/',auth[_0xdbc2('0x8')](),controller[_0xdbc2('0xe')]);router['put']('/:id',auth[_0xdbc2('0x8')](),controller[_0xdbc2('0xf')]);router[_0xdbc2('0x10')](_0xdbc2('0xb'),auth[_0xdbc2('0x8')](),controller[_0xdbc2('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa739=['post','create','put','destroy','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x407451,_0x192803){var _0x5008b7=function(_0x1c61e0){while(--_0x1c61e0){_0x407451['push'](_0x407451['shift']());}};_0x5008b7(++_0x192803);}(_0xa739,0x136));var _0x9a73=function(_0x4415a7,_0x1c8454){_0x4415a7=_0x4415a7-0x0;var _0x325797=_0xa739[_0x4415a7];return _0x325797;};'use strict';var multer=require('multer');var util=require(_0x9a73('0x0'));var path=require(_0x9a73('0x1'));var timeout=require('connect-timeout');var express=require(_0x9a73('0x2'));var router=express[_0x9a73('0x3')]();var fs_extra=require(_0x9a73('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9a73('0x5'));var config=require(_0x9a73('0x6'));var controller=require('./mailQueueReport.controller');router[_0x9a73('0x7')]('/',auth[_0x9a73('0x8')](),controller[_0x9a73('0x9')]);router[_0x9a73('0x7')](_0x9a73('0xa'),auth[_0x9a73('0x8')](),controller[_0x9a73('0xb')]);router[_0x9a73('0x7')](_0x9a73('0xc'),auth['isAuthenticated'](),controller[_0x9a73('0xd')]);router[_0x9a73('0xe')]('/',auth[_0x9a73('0x8')](),controller[_0x9a73('0xf')]);router[_0x9a73('0x10')](_0x9a73('0xc'),auth[_0x9a73('0x8')](),controller['update']);router['delete']('/:id',auth[_0x9a73('0x8')](),controller[_0x9a73('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 86528dc..7781673 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 _0xa7ac=['DATE','sequelize','STRING'];(function(_0x484969,_0x59cf16){var _0x4a04b3=function(_0x506475){while(--_0x506475){_0x484969['push'](_0x484969['shift']());}};_0x4a04b3(++_0x59cf16);}(_0xa7ac,0x14e));var _0xca7a=function(_0x17dc52,_0x1912b2){_0x17dc52=_0x17dc52-0x0;var _0x2faf8b=_0xa7ac[_0x17dc52];return _0x2faf8b;};'use strict';var moment=require('moment');var Sequelize=require(_0xca7a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xca7a('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xca7a('0x2')]},'leaveAt':{'type':Sequelize[_0xca7a('0x2')]},'acceptAt':{'type':Sequelize[_0xca7a('0x2')]},'exitAt':{'type':Sequelize[_0xca7a('0x2')]},'reason':{'type':Sequelize[_0xca7a('0x1')]}}; \ No newline at end of file +var _0xded6=['DATE','moment','sequelize','exports','STRING'];(function(_0xef8198,_0x284916){var _0x26de91=function(_0x3dd046){while(--_0x3dd046){_0xef8198['push'](_0xef8198['shift']());}};_0x26de91(++_0x284916);}(_0xded6,0x1aa));var _0x6ded=function(_0x34ae5b,_0x30981f){_0x34ae5b=_0x34ae5b-0x0;var _0x2fe241=_0xded6[_0x34ae5b];return _0x2fe241;};'use strict';var moment=require(_0x6ded('0x0'));var Sequelize=require(_0x6ded('0x1'));module[_0x6ded('0x2')]={'uniqueid':{'type':Sequelize[_0x6ded('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6ded('0x4')]},'leaveAt':{'type':Sequelize[_0x6ded('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6ded('0x4')]},'reason':{'type':Sequelize[_0x6ded('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 76d4c65..f2e0bea 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 _0xc1c6=['filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','MailQueueReport','rawAttributes','type','key','model','query'];(function(_0x290df2,_0x2ff46d){var _0x2db4dd=function(_0x8aba30){while(--_0x8aba30){_0x290df2['push'](_0x290df2['shift']());}};_0x2db4dd(++_0x2ff46d);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x4f9b35,_0x14d869){_0x4f9b35=_0x4f9b35-0x0;var _0x243002=_0xc1c6[_0x4f9b35];return _0x243002;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['MailQueueReport']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['MailQueueReport'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':!![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['MailQueueReport'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['MailQueueReport']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));};exports[_0x6c1c('0x49')]=function(_0x2450ab,_0x5489ac){return db['MailQueueReport'][_0x6c1c('0x49')]()[_0x6c1c('0x25')](respondWithResult(_0x5489ac,null))['catch'](handleError(_0x5489ac,null));}; \ No newline at end of file +var _0x5c3c=['findAll','rows','params','merge','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','MailQueueReport','includeAll','include'];(function(_0x5a2b96,_0x4d16b7){var _0x35787e=function(_0x5db484){while(--_0x5db484){_0x5a2b96['push'](_0x5a2b96['shift']());}};_0x35787e(++_0x4d16b7);}(_0x5c3c,0x132));var _0xc5c3=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x5c3c[_0x45f951];return _0x24756c;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){_0x52d638[_0xc5c3('0x18')](0xcc)[_0xc5c3('0x19')]();});}};}function handleEntityNotFound(_0x38a3df,_0x52e54a){return function(_0x4af067){if(!_0x4af067){_0x38a3df[_0xc5c3('0x24')](0x194);}return _0x4af067;};}function handleError(_0x22f607,_0x20c506){_0x20c506=_0x20c506||0x1f4;return function(_0x29791c){logger['error'](_0x29791c[_0xc5c3('0x25')]);if(_0x29791c['name']){delete _0x29791c[_0xc5c3('0x26')];}_0x22f607['status'](_0x20c506)[_0xc5c3('0x27')](_0x29791c);};}exports[_0xc5c3('0x28')]=function(_0x4269eb,_0x4773c5){var _0x15361c={},_0x2d07e1={},_0x35a397={'count':0x0,'rows':[]};var _0x4b5a0c=_[_0xc5c3('0x29')](db['MailQueueReport'][_0xc5c3('0x2a')],function(_0x43ebfc){return{'name':_0x43ebfc['fieldName'],'type':_0x43ebfc['type'][_0xc5c3('0x2b')]};});_0x2d07e1[_0xc5c3('0x2c')]=_[_0xc5c3('0x29')](_0x4b5a0c,_0xc5c3('0x26'));_0x2d07e1['query']=_[_0xc5c3('0x2d')](_0x4269eb[_0xc5c3('0x2e')]);_0x2d07e1[_0xc5c3('0x2f')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],_0x2d07e1[_0xc5c3('0x2e')]);_0x15361c[_0xc5c3('0x31')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],qs['fields'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x32')]));_0x15361c[_0xc5c3('0x31')]=_0x15361c[_0xc5c3('0x31')][_0xc5c3('0x33')]?_0x15361c[_0xc5c3('0x31')]:_0x2d07e1[_0xc5c3('0x2c')];if(!_0x4269eb['query']['hasOwnProperty'](_0xc5c3('0x34'))){_0x15361c['limit']=qs[_0xc5c3('0x1a')](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x1a')]);_0x15361c[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0x4269eb['query'][_0xc5c3('0x1c')]);}_0x15361c[_0xc5c3('0x35')]=qs['sort'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x36')]);_0x15361c[_0xc5c3('0x37')]=qs[_0xc5c3('0x2f')](_[_0xc5c3('0x38')](_0x4269eb[_0xc5c3('0x2e')],_0x2d07e1[_0xc5c3('0x2f')]),_0x4b5a0c);if(_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x39')]){_0x15361c[_0xc5c3('0x37')]=_['merge'](_0x15361c[_0xc5c3('0x37')],{'$or':_['map'](_0x4b5a0c,function(_0x4fdbe6){if(_0x4fdbe6[_0xc5c3('0x3a')]!==_0xc5c3('0x3b')){var _0x1b546e={};_0x1b546e[_0x4fdbe6[_0xc5c3('0x26')]]={'$like':'%'+_0x4269eb[_0xc5c3('0x2e')]['filter']+'%'};return _0x1b546e;}})});}_0x15361c=_['merge']({},_0x15361c,_0x4269eb[_0xc5c3('0x3c')]);var _0xa7cb91={'where':_0x15361c['where']};return db[_0xc5c3('0x3d')]['count'](_0xa7cb91)[_0xc5c3('0x23')](function(_0x2dfd19){_0x35a397[_0xc5c3('0x1b')]=_0x2dfd19;if(_0x4269eb['query'][_0xc5c3('0x3e')]){_0x15361c[_0xc5c3('0x3f')]=[{'all':!![]}];}return db['MailQueueReport'][_0xc5c3('0x40')](_0x15361c);})['then'](function(_0x33936c){_0x35a397[_0xc5c3('0x41')]=_0x33936c;return _0x35a397;})['then'](respondWithFilteredResult(_0x4773c5,_0x15361c))['catch'](handleError(_0x4773c5,null));};exports['show']=function(_0xfb64bb,_0x2f02ab){var _0x49b1fc={'raw':!![],'where':{'id':_0xfb64bb[_0xc5c3('0x42')]['id']}},_0x1a8490={};_0x1a8490[_0xc5c3('0x2c')]=_[_0xc5c3('0x2d')](db['MailQueueReport'][_0xc5c3('0x2a')]);_0x1a8490['query']=_['keys'](_0xfb64bb[_0xc5c3('0x2e')]);_0x1a8490[_0xc5c3('0x2f')]=_['intersection'](_0x1a8490[_0xc5c3('0x2c')],_0x1a8490[_0xc5c3('0x2e')]);_0x49b1fc['attributes']=_[_0xc5c3('0x30')](_0x1a8490['model'],qs[_0xc5c3('0x32')](_0xfb64bb[_0xc5c3('0x2e')]['fields']));_0x49b1fc[_0xc5c3('0x31')]=_0x49b1fc['attributes'][_0xc5c3('0x33')]?_0x49b1fc[_0xc5c3('0x31')]:_0x1a8490['model'];if(_0xfb64bb[_0xc5c3('0x2e')][_0xc5c3('0x3e')]){_0x49b1fc[_0xc5c3('0x3f')]=[{'all':!![]}];}_0x49b1fc=_[_0xc5c3('0x43')]({},_0x49b1fc,_0xfb64bb[_0xc5c3('0x3c')]);return db[_0xc5c3('0x3d')]['find'](_0x49b1fc)[_0xc5c3('0x23')](handleEntityNotFound(_0x2f02ab,null))[_0xc5c3('0x23')](respondWithResult(_0x2f02ab,null))[_0xc5c3('0x44')](handleError(_0x2f02ab,null));};exports[_0xc5c3('0x45')]=function(_0x23002b,_0x4a7330){return db['MailQueueReport'][_0xc5c3('0x45')](_0x23002b[_0xc5c3('0x46')],{})[_0xc5c3('0x23')](respondWithResult(_0x4a7330,0xc9))['catch'](handleError(_0x4a7330,null));};exports[_0xc5c3('0x22')]=function(_0x65f720,_0x3a901f){if(_0x65f720[_0xc5c3('0x46')]['id']){delete _0x65f720[_0xc5c3('0x46')]['id'];}return db[_0xc5c3('0x3d')][_0xc5c3('0x47')]({'where':{'id':_0x65f720['params']['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x3a901f,null))[_0xc5c3('0x23')](saveUpdates(_0x65f720[_0xc5c3('0x46')],null))['then'](respondWithResult(_0x3a901f,null))[_0xc5c3('0x44')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x48')]=function(_0x3b1bc2,_0x103bde){return db[_0xc5c3('0x3d')]['find']({'where':{'id':_0x3b1bc2[_0xc5c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x103bde,null))[_0xc5c3('0x23')](removeEntity(_0x103bde,null))['catch'](handleError(_0x103bde,null));};exports[_0xc5c3('0x49')]=function(_0x34a2c3,_0x4add6b){return db[_0xc5c3('0x3d')][_0xc5c3('0x49')]()['then'](respondWithResult(_0x4add6b,null))[_0xc5c3('0x44')](handleError(_0x4add6b,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index d675758..f6021b7 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 _0xd3e7=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','lodash'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0xd3e7,0xe3));var _0x7d3e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd3e7[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7d3e('0x0'));var util=require('util');var logger=require(_0x7d3e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7d3e('0x2'));var rp=require(_0x7d3e('0x3'));var fs=require('fs');var path=require(_0x7d3e('0x4'));var rimraf=require(_0x7d3e('0x5'));var config=require(_0x7d3e('0x6'));var attributes=require(_0x7d3e('0x7'));module[_0x7d3e('0x8')]=function(_0x155c51,_0x506bf){return _0x155c51[_0x7d3e('0x9')](_0x7d3e('0xa'),attributes,{'tableName':_0x7d3e('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9793=['rimraf','./mailQueueReport.attributes','define','MailQueueReport','uniqueid','api','moment','bluebird','request-promise'];(function(_0x29b68d,_0x22601e){var _0x54f929=function(_0x1439c6){while(--_0x1439c6){_0x29b68d['push'](_0x29b68d['shift']());}};_0x54f929(++_0x22601e);}(_0x9793,0x1a3));var _0x3979=function(_0x33a35e,_0x1e9408){_0x33a35e=_0x33a35e-0x0;var _0x5245c4=_0x9793[_0x33a35e];return _0x5245c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3979('0x0'));var moment=require(_0x3979('0x1'));var BPromise=require(_0x3979('0x2'));var rp=require(_0x3979('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3979('0x4'));var config=require('../../config/environment');var attributes=require(_0x3979('0x5'));module['exports']=function(_0x51217c,_0x2ec000){return _0x51217c[_0x3979('0x6')](_0x3979('0x7'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x3979('0x8'),'fields':[_0x3979('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 89164c4..51a8cf9 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 _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x339ab4,_0x192626){var _0x1da7ca=function(_0x2ab7bd){while(--_0x2ab7bd){_0x339ab4['push'](_0x339ab4['shift']());}};_0x1da7ca(++_0x192626);}(_0x7a54,0x106));var _0x47a5=function(_0x1473d5,_0x5cbde8){_0x1473d5=_0x1473d5-0x0;var _0x5ea5e8=_0x7a54[_0x1473d5];return _0x5ea5e8;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x1628b3,_0x5f1805){var _0x4bad95=function(_0x1afa12){while(--_0x1afa12){_0x1628b3['push'](_0x1628b3['shift']());}};_0x4bad95(++_0x5f1805);}(_0x2ef3,0xba));var _0x32ef=function(_0x538afc,_0x4d11fe){_0x538afc=_0x538afc-0x0;var _0x1aeb55=_0x2ef3[_0x538afc];return _0x1aeb55;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 08c73d3..ec07ade 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4869c0,_0x1a6fa2){var _0x519b1c=function(_0xaa69c9){while(--_0xaa69c9){_0x4869c0['push'](_0x4869c0['shift']());}};_0x519b1c(++_0x1a6fa2);}(_0xe706,0xa3));var _0x6e70=function(_0x4c10fe,_0x19e0b2){_0x4c10fe=_0x4c10fe-0x0;var _0x5d4ffe=_0xe706[_0x4c10fe];return _0x5d4ffe;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x54afe3,_0x258ce5){var _0x3e76d6=function(_0x328441){while(--_0x328441){_0x54afe3['push'](_0x54afe3['shift']());}};_0x3e76d6(++_0x258ce5);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'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 d44fd19..08a8b77 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 _0x17c9=['BOOLEAN','INBOX','INTEGER','exports','STRING'];(function(_0x42f2a5,_0x3fd9a3){var _0x56d5b6=function(_0x53e87b){while(--_0x53e87b){_0x42f2a5['push'](_0x42f2a5['shift']());}};_0x56d5b6(++_0x3fd9a3);}(_0x17c9,0xee));var _0x917c=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x17c9[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require('sequelize');module[_0x917c('0x0')]={'description':{'type':Sequelize[_0x917c('0x1')]},'host':{'type':Sequelize[_0x917c('0x1')]},'authentication':{'type':Sequelize[_0x917c('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x917c('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x917c('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x917c('0x1')],'defaultValue':_0x917c('0x3')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x917c('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x917c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3177=['INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x145a4d,_0x315b84){var _0x1753a5=function(_0x176bd2){while(--_0x176bd2){_0x145a4d['push'](_0x145a4d['shift']());}};_0x1753a5(++_0x315b84);}(_0x3177,0xda));var _0x7317=function(_0x44fc33,_0x480283){_0x44fc33=_0x44fc33-0x0;var _0x1e64a1=_0x3177[_0x44fc33];return _0x1e64a1;};'use strict';var Sequelize=require(_0x7317('0x0'));module[_0x7317('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x7317('0x2')]},'authentication':{'type':Sequelize[_0x7317('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x7317('0x2')]},'port':{'type':Sequelize[_0x7317('0x4')]},'tls':{'type':Sequelize[_0x7317('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7317('0x2')],'defaultValue':_0x7317('0x5')},'connTimeout':{'type':Sequelize[_0x7317('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x7317('0x2')]},'modernAuthentication':{'type':Sequelize[_0x7317('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index f99e6f3..0e6edfa 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 _0xa520=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','lodash','../../config/logger','api'];(function(_0x344eb8,_0x12a8a5){var _0x3f197c=function(_0x21fa6e){while(--_0x21fa6e){_0x344eb8['push'](_0x344eb8['shift']());}};_0x3f197c(++_0x12a8a5);}(_0xa520,0x19d));var _0x0a52=function(_0x2f275b,_0x4ee0ab){_0x2f275b=_0x2f275b-0x0;var _0x3c2c76=_0xa520[_0x2f275b];return _0x3c2c76;};'use strict';var _=require(_0x0a52('0x0'));var util=require('util');var logger=require(_0x0a52('0x1'))(_0x0a52('0x2'));var moment=require(_0x0a52('0x3'));var BPromise=require(_0x0a52('0x4'));var rp=require(_0x0a52('0x5'));var fs=require('fs');var path=require(_0x0a52('0x6'));var rimraf=require(_0x0a52('0x7'));var config=require(_0x0a52('0x8'));var attributes=require(_0x0a52('0x9'));module[_0x0a52('0xa')]=function(_0x2c6614,_0x517bed){return _0x2c6614[_0x0a52('0xb')](_0x0a52('0xc'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15a7=['../../config/environment','exports','define','mail_servers_in','lodash','bluebird','request-promise','path','rimraf'];(function(_0x1aba4a,_0x727e00){var _0x10cbde=function(_0x3d985e){while(--_0x3d985e){_0x1aba4a['push'](_0x1aba4a['shift']());}};_0x10cbde(++_0x727e00);}(_0x15a7,0x79));var _0x715a=function(_0x2ba66e,_0x5a390d){_0x2ba66e=_0x2ba66e-0x0;var _0x48584b=_0x15a7[_0x2ba66e];return _0x48584b;};'use strict';var _=require(_0x715a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x715a('0x1'));var rp=require(_0x715a('0x2'));var fs=require('fs');var path=require(_0x715a('0x3'));var rimraf=require(_0x715a('0x4'));var config=require(_0x715a('0x5'));var attributes=require('./mailServerIn.attributes');module[_0x715a('0x6')]=function(_0x323cec,_0x4acabf){return _0x323cec[_0x715a('0x7')]('MailServerIn',attributes,{'tableName':_0x715a('0x8'),'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 7a7c242..27202c4 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 _0x49f2=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','limit','include','map','model','lodash','util'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0x49f2,0x86));var _0x249f=function(_0x2bd8fd,_0x3e4ce3){_0x2bd8fd=_0x2bd8fd-0x0;var _0x10c92a=_0x49f2[_0x2bd8fd];return _0x10c92a;};'use strict';var _=require(_0x249f('0x0'));var util=require(_0x249f('0x1'));var moment=require(_0x249f('0x2'));var BPromise=require('bluebird');var rs=require(_0x249f('0x3'));var fs=require('fs');var Redis=require(_0x249f('0x4'));var db=require(_0x249f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x249f('0x6'))(_0x249f('0x7'));var config=require(_0x249f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x249f('0x9')][_0x249f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4308ec,_0x47b9c4,_0x50dc6b){return new BPromise(function(_0x2d81e8,_0x3d266d){return client[_0x249f('0xb')](_0x4308ec,_0x50dc6b)[_0x249f('0xc')](function(_0x5a9eb8){logger[_0x249f('0xd')]('MailServerIn,\x20%s,\x20%s',_0x47b9c4,_0x249f('0xe'));logger[_0x249f('0xf')](_0x249f('0x10'),_0x47b9c4,_0x249f('0xe'),JSON[_0x249f('0x11')](_0x5a9eb8));if(_0x5a9eb8[_0x249f('0x12')]){if(_0x5a9eb8[_0x249f('0x12')][_0x249f('0x13')]===0x1f4){logger['error'](_0x249f('0x14'),_0x47b9c4,_0x5a9eb8['error']['message']);return _0x3d266d(_0x5a9eb8[_0x249f('0x12')][_0x249f('0x15')]);}logger[_0x249f('0x12')](_0x249f('0x14'),_0x47b9c4,_0x5a9eb8[_0x249f('0x12')][_0x249f('0x15')]);return _0x2d81e8(_0x5a9eb8[_0x249f('0x12')][_0x249f('0x15')]);}else{logger[_0x249f('0xd')](_0x249f('0x14'),_0x47b9c4,_0x249f('0xe'));_0x2d81e8(_0x5a9eb8[_0x249f('0x16')][_0x249f('0x15')]);}})[_0x249f('0x17')](function(_0x527f64){logger[_0x249f('0x12')](_0x249f('0x14'),_0x47b9c4,_0x527f64);_0x3d266d(_0x527f64);});});}exports[_0x249f('0x18')]=function(_0x392ed3){var _0x5e6395=this;return new Promise(function(_0x3820c5,_0x4f61b9){return db[_0x249f('0x19')]['findAll']({'raw':_0x392ed3[_0x249f('0x1a')]?_0x392ed3['options'][_0x249f('0x1b')]===undefined?!![]:![]:!![],'where':_0x392ed3['options']?_0x392ed3[_0x249f('0x1a')][_0x249f('0x1c')]||null:null,'attributes':_0x392ed3[_0x249f('0x1a')]?_0x392ed3[_0x249f('0x1a')][_0x249f('0x1d')]||null:null,'limit':_0x392ed3[_0x249f('0x1a')]?_0x392ed3[_0x249f('0x1a')][_0x249f('0x1e')]||null:null,'include':_0x392ed3['options']?_0x392ed3[_0x249f('0x1a')][_0x249f('0x1f')]?_[_0x249f('0x20')](_0x392ed3[_0x249f('0x1a')]['include'],function(_0x5ebdd1){return{'model':db[_0x5ebdd1[_0x249f('0x21')]],'as':_0x5ebdd1['as'],'attributes':_0x5ebdd1['attributes'],'include':_0x5ebdd1[_0x249f('0x1f')]?_[_0x249f('0x20')](_0x5ebdd1['include'],function(_0x1f1ca3){return{'model':db[_0x1f1ca3[_0x249f('0x21')]],'as':_0x1f1ca3['as'],'attributes':_0x1f1ca3[_0x249f('0x1d')],'include':_0x1f1ca3['include']?_[_0x249f('0x20')](_0x1f1ca3[_0x249f('0x1f')],function(_0x4f2d8a){return{'model':db[_0x4f2d8a[_0x249f('0x21')]],'as':_0x4f2d8a['as'],'attributes':_0x4f2d8a[_0x249f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x249f('0xc')](function(_0x3de798){logger[_0x249f('0xd')](_0x249f('0x18'),_0x392ed3);logger[_0x249f('0xf')](_0x249f('0x18'),_0x392ed3,JSON[_0x249f('0x11')](_0x3de798));_0x3820c5(_0x3de798);})[_0x249f('0x17')](function(_0xfa7e9f){logger[_0x249f('0x12')](_0x249f('0x18'),_0xfa7e9f[_0x249f('0x15')],_0x392ed3);_0x4f61b9(_0x5e6395[_0x249f('0x12')](0x1f4,_0xfa7e9f[_0x249f('0x15')]));});});}; \ No newline at end of file +var _0x565c=['request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailServerIn','findAll','options','raw','where','limit','include','model','attributes','map','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0x2c5d97,_0x490f3a){var _0x1976e0=function(_0x5e0713){while(--_0x5e0713){_0x2c5d97['push'](_0x2c5d97['shift']());}};_0x1976e0(++_0x490f3a);}(_0x565c,0x73));var _0xc565=function(_0x52bd69,_0x570765){_0x52bd69=_0x52bd69-0x0;var _0x281822=_0x565c[_0x52bd69];return _0x281822;};'use strict';var _=require(_0xc565('0x0'));var util=require(_0xc565('0x1'));var moment=require(_0xc565('0x2'));var BPromise=require(_0xc565('0x3'));var rs=require(_0xc565('0x4'));var fs=require('fs');var Redis=require(_0xc565('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc565('0x6'));var config=require(_0xc565('0x7'));var jayson=require(_0xc565('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x226477,_0x4959ff,_0x2d8278){return new BPromise(function(_0x228e36,_0x1c3147){return client[_0xc565('0x9')](_0x226477,_0x2d8278)[_0xc565('0xa')](function(_0x3841c7){logger['info'](_0xc565('0xb'),_0x4959ff,_0xc565('0xc'));logger['debug'](_0xc565('0xd'),_0x4959ff,_0xc565('0xc'),JSON[_0xc565('0xe')](_0x3841c7));if(_0x3841c7[_0xc565('0xf')]){if(_0x3841c7[_0xc565('0xf')][_0xc565('0x10')]===0x1f4){logger[_0xc565('0xf')](_0xc565('0xb'),_0x4959ff,_0x3841c7[_0xc565('0xf')]['message']);return _0x1c3147(_0x3841c7['error']['message']);}logger['error'](_0xc565('0xb'),_0x4959ff,_0x3841c7[_0xc565('0xf')]['message']);return _0x228e36(_0x3841c7[_0xc565('0xf')][_0xc565('0x11')]);}else{logger[_0xc565('0x12')](_0xc565('0xb'),_0x4959ff,_0xc565('0xc'));_0x228e36(_0x3841c7[_0xc565('0x13')][_0xc565('0x11')]);}})[_0xc565('0x14')](function(_0x2818bd){logger[_0xc565('0xf')](_0xc565('0xb'),_0x4959ff,_0x2818bd);_0x1c3147(_0x2818bd);});});}exports[_0xc565('0x15')]=function(_0x16cabe){var _0x368069=this;return new Promise(function(_0x275e7b,_0x4fbace){return db['MailServerIn'][_0xc565('0x16')]({'raw':_0x16cabe[_0xc565('0x17')]?_0x16cabe[_0xc565('0x17')][_0xc565('0x18')]===undefined?!![]:![]:!![],'where':_0x16cabe['options']?_0x16cabe[_0xc565('0x17')][_0xc565('0x19')]||null:null,'attributes':_0x16cabe[_0xc565('0x17')]?_0x16cabe[_0xc565('0x17')]['attributes']||null:null,'limit':_0x16cabe[_0xc565('0x17')]?_0x16cabe[_0xc565('0x17')][_0xc565('0x1a')]||null:null,'include':_0x16cabe[_0xc565('0x17')]?_0x16cabe[_0xc565('0x17')][_0xc565('0x1b')]?_['map'](_0x16cabe['options'][_0xc565('0x1b')],function(_0x422a6c){return{'model':db[_0x422a6c[_0xc565('0x1c')]],'as':_0x422a6c['as'],'attributes':_0x422a6c[_0xc565('0x1d')],'include':_0x422a6c[_0xc565('0x1b')]?_['map'](_0x422a6c['include'],function(_0x2d3961){return{'model':db[_0x2d3961[_0xc565('0x1c')]],'as':_0x2d3961['as'],'attributes':_0x2d3961[_0xc565('0x1d')],'include':_0x2d3961['include']?_[_0xc565('0x1e')](_0x2d3961[_0xc565('0x1b')],function(_0x39c49d){return{'model':db[_0x39c49d[_0xc565('0x1c')]],'as':_0x39c49d['as'],'attributes':_0x39c49d[_0xc565('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42a0c9){logger[_0xc565('0x12')](_0xc565('0x15'),_0x16cabe);logger['debug'](_0xc565('0x15'),_0x16cabe,JSON[_0xc565('0xe')](_0x42a0c9));_0x275e7b(_0x42a0c9);})[_0xc565('0x14')](function(_0xd8ea12){logger[_0xc565('0xf')](_0xc565('0x15'),_0xd8ea12[_0xc565('0x11')],_0x16cabe);_0x4fbace(_0x368069['error'](0x1f4,_0xd8ea12[_0xc565('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 2fe5399..bd02d7e 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(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 3211121..cff157e 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 _0x7072=['exports','STRING','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7072,0x138));var _0x2707=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x7072[_0x1b4b23];return _0x2a325b;};'use strict';var Sequelize=require('sequelize');module[_0x2707('0x0')]={'description':{'type':Sequelize[_0x2707('0x1')]},'host':{'type':Sequelize[_0x2707('0x1')]},'user':{'type':Sequelize[_0x2707('0x1')]},'pass':{'type':Sequelize[_0x2707('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x2707('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x2707('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x0102=['exports','STRING','BOOLEAN'];(function(_0x2e2292,_0x1891b8){var _0x4f77ab=function(_0x3e5cb6){while(--_0x3e5cb6){_0x2e2292['push'](_0x2e2292['shift']());}};_0x4f77ab(++_0x1891b8);}(_0x0102,0x186));var _0x2010=function(_0x562e57,_0x1a262f){_0x562e57=_0x562e57-0x0;var _0x4bb191=_0x0102[_0x562e57];return _0x4bb191;};'use strict';var Sequelize=require('sequelize');module[_0x2010('0x0')]={'description':{'type':Sequelize[_0x2010('0x1')]},'host':{'type':Sequelize[_0x2010('0x1')]},'user':{'type':Sequelize[_0x2010('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x2010('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 063764b..7a9b993 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 _0x4bb9=['create','catch','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find'];(function(_0x5704b3,_0x2fde4f){var _0x594a4f=function(_0x45dbac){while(--_0x45dbac){_0x5704b3['push'](_0x5704b3['shift']());}};_0x594a4f(++_0x2fde4f);}(_0x4bb9,0xdb));var _0x94bb=function(_0x173449,_0x5dd89a){_0x173449=_0x173449-0x0;var _0x230295=_0x4bb9[_0x173449];return _0x230295;};'use strict';var emlformat=require(_0x94bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x94bb('0x1'));var jsonpatch=require(_0x94bb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x94bb('0x3'));var Mustache=require(_0x94bb('0x4'));var util=require(_0x94bb('0x5'));var path=require(_0x94bb('0x6'));var sox=require('sox');var csv=require(_0x94bb('0x7'));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(_0x94bb('0x8'));var deskjs=require(_0x94bb('0x9'));var toCsv=require(_0x94bb('0x7'));var querystring=require(_0x94bb('0xa'));var Papa=require(_0x94bb('0xb'));var Redis=require(_0x94bb('0xc'));var authService=require(_0x94bb('0xd'));var qs=require(_0x94bb('0xe'));var as=require(_0x94bb('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x94bb('0x10'))(_0x94bb('0x11'));var utils=require(_0x94bb('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x94bb('0x13'));var db=require(_0x94bb('0x14'))['db'];function respondWithStatusCode(_0x50b967,_0x1a2f16){_0x1a2f16=_0x1a2f16||0xcc;return function(_0x3a8bd3){if(_0x3a8bd3){return _0x50b967[_0x94bb('0x15')](_0x1a2f16);}return _0x50b967[_0x94bb('0x16')](_0x1a2f16)[_0x94bb('0x17')]();};}function respondWithResult(_0x52d805,_0x48f0b9){_0x48f0b9=_0x48f0b9||0xc8;return function(_0x44533d){if(_0x44533d){return _0x52d805[_0x94bb('0x16')](_0x48f0b9)[_0x94bb('0x18')](_0x44533d);}};}function respondWithFilteredResult(_0x2550b9,_0x175edf){return function(_0x33c5e5){if(_0x33c5e5){var _0x478941=typeof _0x175edf[_0x94bb('0x19')]===_0x94bb('0x1a')&&typeof _0x175edf[_0x94bb('0x1b')]==='undefined';var _0x54c66a=_0x33c5e5[_0x94bb('0x1c')];var _0x947b7a=_0x478941?0x0:_0x175edf[_0x94bb('0x19')];var _0x27c1f3=_0x478941?_0x33c5e5[_0x94bb('0x1c')]:_0x175edf[_0x94bb('0x19')]+_0x175edf[_0x94bb('0x1b')];var _0x10135d;if(_0x27c1f3>=_0x54c66a){_0x27c1f3=_0x54c66a;_0x10135d=0xc8;}else{_0x10135d=0xce;}_0x2550b9[_0x94bb('0x16')](_0x10135d);return _0x2550b9[_0x94bb('0x1d')](_0x94bb('0x1e'),_0x947b7a+'-'+_0x27c1f3+'/'+_0x54c66a)[_0x94bb('0x18')](_0x33c5e5);}return null;};}function patchUpdates(_0x222d83){return function(_0x2c9980){try{jsonpatch[_0x94bb('0x1f')](_0x2c9980,_0x222d83,!![]);}catch(_0x1ae645){return BPromise[_0x94bb('0x20')](_0x1ae645);}return _0x2c9980[_0x94bb('0x21')]();};}function saveUpdates(_0xaafe41,_0x5af1d3){return function(_0x1e061b){if(_0x1e061b){return _0x1e061b[_0x94bb('0x22')](_0xaafe41)[_0x94bb('0x23')](function(_0x121084){return _0x121084;});}return null;};}function removeEntity(_0x3e01ce,_0x15f7dc){return function(_0x17568b){if(_0x17568b){return _0x17568b[_0x94bb('0x24')]()['then'](function(){_0x3e01ce['status'](0xcc)[_0x94bb('0x17')]();});}};}function handleEntityNotFound(_0xe2f263,_0xc37ae8){return function(_0x426d20){if(!_0x426d20){_0xe2f263[_0x94bb('0x15')](0x194);}return _0x426d20;};}function handleError(_0x16441f,_0x264a7a){_0x264a7a=_0x264a7a||0x1f4;return function(_0x649b53){logger[_0x94bb('0x25')](_0x649b53['stack']);if(_0x649b53[_0x94bb('0x26')]){delete _0x649b53[_0x94bb('0x26')];}_0x16441f[_0x94bb('0x16')](_0x264a7a)['send'](_0x649b53);};}exports[_0x94bb('0x27')]=function(_0x1d5536,_0x1a20b4){var _0x4fb049={},_0x3757b5={},_0x423030={'count':0x0,'rows':[]};var _0x21bbd2=_['map'](db[_0x94bb('0x28')][_0x94bb('0x29')],function(_0x2f8a13){return{'name':_0x2f8a13[_0x94bb('0x2a')],'type':_0x2f8a13[_0x94bb('0x2b')][_0x94bb('0x2c')]};});_0x3757b5[_0x94bb('0x2d')]=_['map'](_0x21bbd2,_0x94bb('0x26'));_0x3757b5[_0x94bb('0x2e')]=_[_0x94bb('0x2f')](_0x1d5536['query']);_0x3757b5['filters']=_[_0x94bb('0x30')](_0x3757b5[_0x94bb('0x2d')],_0x3757b5['query']);_0x4fb049['attributes']=_['intersection'](_0x3757b5[_0x94bb('0x2d')],qs[_0x94bb('0x31')](_0x1d5536[_0x94bb('0x2e')]['fields']));_0x4fb049['attributes']=_0x4fb049[_0x94bb('0x32')][_0x94bb('0x33')]?_0x4fb049[_0x94bb('0x32')]:_0x3757b5['model'];if(!_0x1d5536[_0x94bb('0x2e')][_0x94bb('0x34')](_0x94bb('0x35'))){_0x4fb049[_0x94bb('0x1b')]=qs[_0x94bb('0x1b')](_0x1d5536[_0x94bb('0x2e')][_0x94bb('0x1b')]);_0x4fb049['offset']=qs[_0x94bb('0x19')](_0x1d5536[_0x94bb('0x2e')]['offset']);}_0x4fb049[_0x94bb('0x36')]=qs['sort'](_0x1d5536[_0x94bb('0x2e')][_0x94bb('0x37')]);_0x4fb049['where']=qs[_0x94bb('0x38')](_['pick'](_0x1d5536[_0x94bb('0x2e')],_0x3757b5[_0x94bb('0x38')]),_0x21bbd2);if(_0x1d5536[_0x94bb('0x2e')]['filter']){_0x4fb049[_0x94bb('0x39')]=_[_0x94bb('0x3a')](_0x4fb049[_0x94bb('0x39')],{'$or':_[_0x94bb('0x3b')](_0x21bbd2,function(_0x3b04cf){if(_0x3b04cf[_0x94bb('0x2b')]!==_0x94bb('0x3c')){var _0x49c814={};_0x49c814[_0x3b04cf['name']]={'$like':'%'+_0x1d5536[_0x94bb('0x2e')][_0x94bb('0x3d')]+'%'};return _0x49c814;}})});}_0x4fb049=_[_0x94bb('0x3a')]({},_0x4fb049,_0x1d5536[_0x94bb('0x3e')]);var _0x2bcbce={'where':_0x4fb049[_0x94bb('0x39')]};return db[_0x94bb('0x28')][_0x94bb('0x1c')](_0x2bcbce)['then'](function(_0x4c8c80){_0x423030[_0x94bb('0x1c')]=_0x4c8c80;if(_0x1d5536['query'][_0x94bb('0x3f')]){_0x4fb049[_0x94bb('0x40')]=[{'all':!![]}];}return db[_0x94bb('0x28')][_0x94bb('0x41')](_0x4fb049);})[_0x94bb('0x23')](function(_0x51ff80){_0x423030['rows']=_0x51ff80;return _0x423030;})[_0x94bb('0x23')](respondWithFilteredResult(_0x1a20b4,_0x4fb049))['catch'](handleError(_0x1a20b4,null));};exports[_0x94bb('0x42')]=function(_0x40c8f5,_0x4b543f){var _0x71c371={'raw':!![],'where':{'id':_0x40c8f5[_0x94bb('0x43')]['id']}},_0x598e20={};_0x598e20['model']=_[_0x94bb('0x2f')](db[_0x94bb('0x28')][_0x94bb('0x29')]);_0x598e20[_0x94bb('0x2e')]=_[_0x94bb('0x2f')](_0x40c8f5[_0x94bb('0x2e')]);_0x598e20[_0x94bb('0x38')]=_['intersection'](_0x598e20[_0x94bb('0x2d')],_0x598e20[_0x94bb('0x2e')]);_0x71c371[_0x94bb('0x32')]=_[_0x94bb('0x30')](_0x598e20['model'],qs['fields'](_0x40c8f5[_0x94bb('0x2e')][_0x94bb('0x31')]));_0x71c371['attributes']=_0x71c371[_0x94bb('0x32')]['length']?_0x71c371[_0x94bb('0x32')]:_0x598e20[_0x94bb('0x2d')];if(_0x40c8f5['query'][_0x94bb('0x3f')]){_0x71c371[_0x94bb('0x40')]=[{'all':!![]}];}_0x71c371=_[_0x94bb('0x3a')]({},_0x71c371,_0x40c8f5[_0x94bb('0x3e')]);return db['MailServerOut'][_0x94bb('0x44')](_0x71c371)[_0x94bb('0x23')](handleEntityNotFound(_0x4b543f,null))[_0x94bb('0x23')](respondWithResult(_0x4b543f,null))['catch'](handleError(_0x4b543f,null));};exports[_0x94bb('0x45')]=function(_0x107596,_0x2d3555){return db[_0x94bb('0x28')][_0x94bb('0x45')](_0x107596['body'],{})[_0x94bb('0x23')](respondWithResult(_0x2d3555,0xc9))[_0x94bb('0x46')](handleError(_0x2d3555,null));};exports[_0x94bb('0x22')]=function(_0x5339cd,_0x33955f){if(_0x5339cd['body']['id']){delete _0x5339cd[_0x94bb('0x47')]['id'];}return db['MailServerOut'][_0x94bb('0x44')]({'where':{'id':_0x5339cd['params']['id']}})[_0x94bb('0x23')](handleEntityNotFound(_0x33955f,null))[_0x94bb('0x23')](saveUpdates(_0x5339cd[_0x94bb('0x47')],null))[_0x94bb('0x23')](respondWithResult(_0x33955f,null))[_0x94bb('0x46')](handleError(_0x33955f,null));};exports['destroy']=function(_0x4a98db,_0x560969){return db[_0x94bb('0x28')][_0x94bb('0x44')]({'where':{'id':_0x4a98db[_0x94bb('0x43')]['id']}})[_0x94bb('0x23')](handleEntityNotFound(_0x560969,null))['then'](removeEntity(_0x560969,null))['catch'](handleError(_0x560969,null));}; \ No newline at end of file +var _0x16e0=['catch','show','keys','length','include','find','create','body','params','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','destroy','then','end','error','name','send','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0x16e0,0xe1));var _0x016e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16e0[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x016e('0x0'));var jsonpatch=require(_0x016e('0x1'));var rp=require('request-promise');var moment=require(_0x016e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x016e('0x3'));var util=require(_0x016e('0x4'));var path=require(_0x016e('0x5'));var sox=require(_0x016e('0x6'));var csv=require(_0x016e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x016e('0x8'));var _=require(_0x016e('0x9'));var squel=require(_0x016e('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x016e('0xb'));var toCsv=require(_0x016e('0x7'));var querystring=require(_0x016e('0xc'));var Papa=require(_0x016e('0xd'));var Redis=require(_0x016e('0xe'));var authService=require(_0x016e('0xf'));var qs=require(_0x016e('0x10'));var as=require(_0x016e('0x11'));var hardwareService=require(_0x016e('0x12'));var logger=require(_0x016e('0x13'))(_0x016e('0x14'));var utils=require(_0x016e('0x15'));var config=require(_0x016e('0x16'));var licenseUtil=require(_0x016e('0x17'));var db=require(_0x016e('0x18'))['db'];function respondWithStatusCode(_0x53d71e,_0x3d7f18){_0x3d7f18=_0x3d7f18||0xcc;return function(_0x5b916a){if(_0x5b916a){return _0x53d71e[_0x016e('0x19')](_0x3d7f18);}return _0x53d71e[_0x016e('0x1a')](_0x3d7f18)['end']();};}function respondWithResult(_0x16267c,_0x5b29bd){_0x5b29bd=_0x5b29bd||0xc8;return function(_0x2ad63f){if(_0x2ad63f){return _0x16267c[_0x016e('0x1a')](_0x5b29bd)[_0x016e('0x1b')](_0x2ad63f);}};}function respondWithFilteredResult(_0x394f8e,_0x242e38){return function(_0x1ae019){if(_0x1ae019){var _0x5cb8e8=typeof _0x242e38[_0x016e('0x1c')]===_0x016e('0x1d')&&typeof _0x242e38[_0x016e('0x1e')]===_0x016e('0x1d');var _0x41b1cc=_0x1ae019[_0x016e('0x1f')];var _0x30d8dd=_0x5cb8e8?0x0:_0x242e38[_0x016e('0x1c')];var _0x3d126d=_0x5cb8e8?_0x1ae019[_0x016e('0x1f')]:_0x242e38[_0x016e('0x1c')]+_0x242e38[_0x016e('0x1e')];var _0x1d26f1;if(_0x3d126d>=_0x41b1cc){_0x3d126d=_0x41b1cc;_0x1d26f1=0xc8;}else{_0x1d26f1=0xce;}_0x394f8e[_0x016e('0x1a')](_0x1d26f1);return _0x394f8e[_0x016e('0x20')]('Content-Range',_0x30d8dd+'-'+_0x3d126d+'/'+_0x41b1cc)[_0x016e('0x1b')](_0x1ae019);}return null;};}function patchUpdates(_0x1d7feb){return function(_0x4bde79){try{jsonpatch[_0x016e('0x21')](_0x4bde79,_0x1d7feb,!![]);}catch(_0x2964f5){return BPromise['reject'](_0x2964f5);}return _0x4bde79['save']();};}function saveUpdates(_0x24db6d,_0x5d258c){return function(_0x321b2f){if(_0x321b2f){return _0x321b2f[_0x016e('0x22')](_0x24db6d)['then'](function(_0xadec88){return _0xadec88;});}return null;};}function removeEntity(_0x15c7e0,_0x5c25cd){return function(_0xcc7365){if(_0xcc7365){return _0xcc7365[_0x016e('0x23')]()[_0x016e('0x24')](function(){_0x15c7e0[_0x016e('0x1a')](0xcc)[_0x016e('0x25')]();});}};}function handleEntityNotFound(_0x669388,_0x138a9b){return function(_0x1e9be4){if(!_0x1e9be4){_0x669388[_0x016e('0x19')](0x194);}return _0x1e9be4;};}function handleError(_0xe39d97,_0x182f83){_0x182f83=_0x182f83||0x1f4;return function(_0x774bc4){logger[_0x016e('0x26')](_0x774bc4['stack']);if(_0x774bc4[_0x016e('0x27')]){delete _0x774bc4[_0x016e('0x27')];}_0xe39d97[_0x016e('0x1a')](_0x182f83)[_0x016e('0x28')](_0x774bc4);};}exports['index']=function(_0x197d7c,_0x2cca4e){var _0x53967a={},_0x34e982={},_0x3b6096={'count':0x0,'rows':[]};var _0x22e1cd=_[_0x016e('0x29')](db[_0x016e('0x2a')][_0x016e('0x2b')],function(_0x4c6062){return{'name':_0x4c6062[_0x016e('0x2c')],'type':_0x4c6062[_0x016e('0x2d')][_0x016e('0x2e')]};});_0x34e982[_0x016e('0x2f')]=_[_0x016e('0x29')](_0x22e1cd,_0x016e('0x27'));_0x34e982[_0x016e('0x30')]=_['keys'](_0x197d7c[_0x016e('0x30')]);_0x34e982['filters']=_[_0x016e('0x31')](_0x34e982[_0x016e('0x2f')],_0x34e982[_0x016e('0x30')]);_0x53967a[_0x016e('0x32')]=_['intersection'](_0x34e982[_0x016e('0x2f')],qs[_0x016e('0x33')](_0x197d7c[_0x016e('0x30')][_0x016e('0x33')]));_0x53967a[_0x016e('0x32')]=_0x53967a['attributes']['length']?_0x53967a[_0x016e('0x32')]:_0x34e982[_0x016e('0x2f')];if(!_0x197d7c[_0x016e('0x30')]['hasOwnProperty'](_0x016e('0x34'))){_0x53967a[_0x016e('0x1e')]=qs[_0x016e('0x1e')](_0x197d7c[_0x016e('0x30')][_0x016e('0x1e')]);_0x53967a['offset']=qs[_0x016e('0x1c')](_0x197d7c[_0x016e('0x30')][_0x016e('0x1c')]);}_0x53967a[_0x016e('0x35')]=qs[_0x016e('0x36')](_0x197d7c[_0x016e('0x30')][_0x016e('0x36')]);_0x53967a[_0x016e('0x37')]=qs[_0x016e('0x38')](_['pick'](_0x197d7c['query'],_0x34e982[_0x016e('0x38')]),_0x22e1cd);if(_0x197d7c['query'][_0x016e('0x39')]){_0x53967a[_0x016e('0x37')]=_[_0x016e('0x3a')](_0x53967a['where'],{'$or':_[_0x016e('0x29')](_0x22e1cd,function(_0x10820c){if(_0x10820c[_0x016e('0x2d')]!==_0x016e('0x3b')){var _0x16fc7e={};_0x16fc7e[_0x10820c['name']]={'$like':'%'+_0x197d7c[_0x016e('0x30')][_0x016e('0x39')]+'%'};return _0x16fc7e;}})});}_0x53967a=_[_0x016e('0x3a')]({},_0x53967a,_0x197d7c[_0x016e('0x3c')]);var _0x22378e={'where':_0x53967a['where']};return db['MailServerOut'][_0x016e('0x1f')](_0x22378e)[_0x016e('0x24')](function(_0x262508){_0x3b6096['count']=_0x262508;if(_0x197d7c[_0x016e('0x30')][_0x016e('0x3d')]){_0x53967a['include']=[{'all':!![]}];}return db[_0x016e('0x2a')]['findAll'](_0x53967a);})[_0x016e('0x24')](function(_0x537941){_0x3b6096[_0x016e('0x3e')]=_0x537941;return _0x3b6096;})[_0x016e('0x24')](respondWithFilteredResult(_0x2cca4e,_0x53967a))[_0x016e('0x3f')](handleError(_0x2cca4e,null));};exports[_0x016e('0x40')]=function(_0x4ddfe1,_0x46a69b){var _0x2859bc={'raw':!![],'where':{'id':_0x4ddfe1['params']['id']}},_0xb56afb={};_0xb56afb['model']=_[_0x016e('0x41')](db['MailServerOut'][_0x016e('0x2b')]);_0xb56afb[_0x016e('0x30')]=_['keys'](_0x4ddfe1[_0x016e('0x30')]);_0xb56afb['filters']=_['intersection'](_0xb56afb['model'],_0xb56afb[_0x016e('0x30')]);_0x2859bc['attributes']=_[_0x016e('0x31')](_0xb56afb[_0x016e('0x2f')],qs[_0x016e('0x33')](_0x4ddfe1[_0x016e('0x30')][_0x016e('0x33')]));_0x2859bc[_0x016e('0x32')]=_0x2859bc[_0x016e('0x32')][_0x016e('0x42')]?_0x2859bc['attributes']:_0xb56afb[_0x016e('0x2f')];if(_0x4ddfe1['query'][_0x016e('0x3d')]){_0x2859bc[_0x016e('0x43')]=[{'all':!![]}];}_0x2859bc=_['merge']({},_0x2859bc,_0x4ddfe1[_0x016e('0x3c')]);return db[_0x016e('0x2a')][_0x016e('0x44')](_0x2859bc)['then'](handleEntityNotFound(_0x46a69b,null))[_0x016e('0x24')](respondWithResult(_0x46a69b,null))[_0x016e('0x3f')](handleError(_0x46a69b,null));};exports[_0x016e('0x45')]=function(_0x4b3c4a,_0x1a64d3){return db[_0x016e('0x2a')][_0x016e('0x45')](_0x4b3c4a[_0x016e('0x46')],{})['then'](respondWithResult(_0x1a64d3,0xc9))[_0x016e('0x3f')](handleError(_0x1a64d3,null));};exports[_0x016e('0x22')]=function(_0x39803f,_0x3da98b){if(_0x39803f[_0x016e('0x46')]['id']){delete _0x39803f[_0x016e('0x46')]['id'];}return db[_0x016e('0x2a')]['find']({'where':{'id':_0x39803f[_0x016e('0x47')]['id']}})[_0x016e('0x24')](handleEntityNotFound(_0x3da98b,null))[_0x016e('0x24')](saveUpdates(_0x39803f['body'],null))[_0x016e('0x24')](respondWithResult(_0x3da98b,null))['catch'](handleError(_0x3da98b,null));};exports[_0x016e('0x23')]=function(_0x288ca0,_0x2a30d4){return db[_0x016e('0x2a')][_0x016e('0x44')]({'where':{'id':_0x288ca0[_0x016e('0x47')]['id']}})[_0x016e('0x24')](handleEntityNotFound(_0x2a30d4,null))[_0x016e('0x24')](removeEntity(_0x2a30d4,null))[_0x016e('0x3f')](handleError(_0x2a30d4,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index e8d38bd..88fe57b 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 _0xb7c2=['rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','api','moment','bluebird','request-promise','path'];(function(_0x4862f4,_0xe6f851){var _0x18137e=function(_0x1d09b4){while(--_0x1d09b4){_0x4862f4['push'](_0x4862f4['shift']());}};_0x18137e(++_0xe6f851);}(_0xb7c2,0x1f3));var _0x2b7c=function(_0x3ac4be,_0x3a7c54){_0x3ac4be=_0x3ac4be-0x0;var _0x2ed804=_0xb7c2[_0x3ac4be];return _0x2ed804;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2b7c('0x0'));var moment=require(_0x2b7c('0x1'));var BPromise=require(_0x2b7c('0x2'));var rp=require(_0x2b7c('0x3'));var fs=require('fs');var path=require(_0x2b7c('0x4'));var rimraf=require(_0x2b7c('0x5'));var config=require(_0x2b7c('0x6'));var attributes=require(_0x2b7c('0x7'));module[_0x2b7c('0x8')]=function(_0x294f6c,_0x3aaba3){return _0x294f6c[_0x2b7c('0x9')](_0x2b7c('0xa'),attributes,{'tableName':_0x2b7c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff91=['exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','bluebird','request-promise','path','./mailServerOut.attributes'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0xff91,0x10c));var _0x1ff9=function(_0x5bb9bb,_0x4b5fbb){_0x5bb9bb=_0x5bb9bb-0x0;var _0x3b6bdf=_0xff91[_0x5bb9bb];return _0x3b6bdf;};'use strict';var _=require(_0x1ff9('0x0'));var util=require(_0x1ff9('0x1'));var logger=require(_0x1ff9('0x2'))(_0x1ff9('0x3'));var moment=require('moment');var BPromise=require(_0x1ff9('0x4'));var rp=require(_0x1ff9('0x5'));var fs=require('fs');var path=require(_0x1ff9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1ff9('0x7'));module[_0x1ff9('0x8')]=function(_0x8fe3e2,_0x1c68a0){return _0x8fe3e2[_0x1ff9('0x9')](_0x1ff9('0xa'),attributes,{'tableName':_0x1ff9('0xb'),'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 1d48d50..9a99b95 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(_0x1a14c4,_0x2dabb0){var _0x2a407d=function(_0xb655c0){while(--_0xb655c0){_0x1a14c4['push'](_0x1a14c4['shift']());}};_0x2a407d(++_0x2dabb0);}(_0x2ef3,0xba));var _0x32ef=function(_0x546237,_0x441eae){_0x546237=_0x546237-0x0;var _0x5e351d=_0x2ef3[_0x546237];return _0x5e351d;};'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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x3c2746,_0xfed187){var _0x18a686=function(_0x297271){while(--_0x297271){_0x3c2746['push'](_0x3c2746['shift']());}};_0x18a686(++_0xfed187);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'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')]('MailServerOut,\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 diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index d859b57..028048a 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 _0x596f=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x596f,0x64));var _0xf596=function(_0x337970,_0x591854){_0x337970=_0x337970-0x0;var _0x164d62=_0x596f[_0x337970];return _0x164d62;};'use strict';var multer=require(_0xf596('0x0'));var util=require(_0xf596('0x1'));var path=require(_0xf596('0x2'));var timeout=require(_0xf596('0x3'));var express=require(_0xf596('0x4'));var router=express[_0xf596('0x5')]();var fs_extra=require(_0xf596('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf596('0x7'));var config=require(_0xf596('0x8'));var controller=require(_0xf596('0x9'));router[_0xf596('0xa')]('/',auth[_0xf596('0xb')](),controller[_0xf596('0xc')]);router[_0xf596('0xa')](_0xf596('0xd'),auth[_0xf596('0xb')](),controller[_0xf596('0xe')]);router['get'](_0xf596('0xf'),auth[_0xf596('0xb')](),controller[_0xf596('0x10')]);router['post']('/',auth[_0xf596('0xb')](),controller[_0xf596('0x11')]);router[_0xf596('0x12')](_0xf596('0xf'),auth[_0xf596('0xb')](),controller[_0xf596('0x13')]);router[_0xf596('0x14')](_0xf596('0xf'),auth[_0xf596('0xb')](),controller['destroy']);module[_0xf596('0x15')]=router; \ No newline at end of file +var _0xf4e2=['fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x3b6f35,_0x4c512f){var _0x35a800=function(_0x28d7c5){while(--_0x28d7c5){_0x3b6f35['push'](_0x3b6f35['shift']());}};_0x35a800(++_0x4c512f);}(_0xf4e2,0xa3));var _0x2f4e=function(_0x2a00dd,_0x10da34){_0x2a00dd=_0x2a00dd-0x0;var _0x54613f=_0xf4e2[_0x2a00dd];return _0x54613f;};'use strict';var multer=require(_0x2f4e('0x0'));var util=require(_0x2f4e('0x1'));var path=require('path');var timeout=require(_0x2f4e('0x2'));var express=require(_0x2f4e('0x3'));var router=express[_0x2f4e('0x4')]();var fs_extra=require(_0x2f4e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2f4e('0x6'));var config=require(_0x2f4e('0x7'));var controller=require(_0x2f4e('0x8'));router[_0x2f4e('0x9')]('/',auth[_0x2f4e('0xa')](),controller[_0x2f4e('0xb')]);router[_0x2f4e('0x9')]('/describe',auth[_0x2f4e('0xa')](),controller[_0x2f4e('0xc')]);router[_0x2f4e('0x9')](_0x2f4e('0xd'),auth[_0x2f4e('0xa')](),controller[_0x2f4e('0xe')]);router[_0x2f4e('0xf')]('/',auth['isAuthenticated'](),controller[_0x2f4e('0x10')]);router[_0x2f4e('0x11')](_0x2f4e('0xd'),auth[_0x2f4e('0xa')](),controller[_0x2f4e('0x12')]);router[_0x2f4e('0x13')](_0x2f4e('0xd'),auth[_0x2f4e('0xa')](),controller[_0x2f4e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 108716d..7caad41 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 _0xdbb1=['STRING','sequelize'];(function(_0xd9eb0c,_0x242300){var _0x2371c3=function(_0x5b999e){while(--_0x5b999e){_0xd9eb0c['push'](_0xd9eb0c['shift']());}};_0x2371c3(++_0x242300);}(_0xdbb1,0x105));var _0x1dbb=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xdbb1[_0x10004e];return _0x5af990;};'use strict';var Sequelize=require(_0x1dbb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1dbb('0x1')]}}; \ No newline at end of file +var _0xda19=['STRING','exports'];(function(_0x1ce9a7,_0x3fc14d){var _0xc83e8f=function(_0x4a2620){while(--_0x4a2620){_0x1ce9a7['push'](_0x1ce9a7['shift']());}};_0xc83e8f(++_0x3fc14d);}(_0xda19,0xd5));var _0x9da1=function(_0x4b17aa,_0x2534d9){_0x4b17aa=_0x4b17aa-0x0;var _0x5a7e38=_0xda19[_0x4b17aa];return _0x5a7e38;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9da1('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 081c66b..ad43910 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 _0x00e2=['filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','apply','reject','save','update','then','destroy','end','error','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where'];(function(_0x3cb52a,_0x5a586d){var _0x4e6bab=function(_0xd38f5){while(--_0xd38f5){_0x3cb52a['push'](_0x3cb52a['shift']());}};_0x4e6bab(++_0x5a586d);}(_0x00e2,0x126));var _0x200e=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0x00e2[_0x2af160];return _0x439d67;};'use strict';var emlformat=require(_0x200e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x200e('0x1'));var jsonpatch=require(_0x200e('0x2'));var rp=require('request-promise');var moment=require(_0x200e('0x3'));var BPromise=require(_0x200e('0x4'));var Mustache=require('mustache');var util=require(_0x200e('0x5'));var path=require(_0x200e('0x6'));var sox=require('sox');var csv=require(_0x200e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x200e('0x8'));var _=require('lodash');var squel=require(_0x200e('0x9'));var crypto=require(_0x200e('0xa'));var jsforce=require(_0x200e('0xb'));var deskjs=require(_0x200e('0xc'));var toCsv=require(_0x200e('0x7'));var querystring=require(_0x200e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x200e('0xe'));var qs=require(_0x200e('0xf'));var as=require(_0x200e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x200e('0x11'))('api');var utils=require(_0x200e('0x12'));var config=require(_0x200e('0x13'));var licenseUtil=require(_0x200e('0x14'));var db=require(_0x200e('0x15'))['db'];function respondWithStatusCode(_0x5913e3,_0x41c100){_0x41c100=_0x41c100||0xcc;return function(_0x5a0d39){if(_0x5a0d39){return _0x5913e3[_0x200e('0x16')](_0x41c100);}return _0x5913e3[_0x200e('0x17')](_0x41c100)['end']();};}function respondWithResult(_0x4d3ddc,_0x3c4960){_0x3c4960=_0x3c4960||0xc8;return function(_0x25c435){if(_0x25c435){return _0x4d3ddc[_0x200e('0x17')](_0x3c4960)['json'](_0x25c435);}};}function respondWithFilteredResult(_0x584c42,_0x4c9046){return function(_0x2765b0){if(_0x2765b0){var _0x48c16c=typeof _0x4c9046[_0x200e('0x18')]===_0x200e('0x19')&&typeof _0x4c9046['limit']===_0x200e('0x19');var _0x2a51fe=_0x2765b0[_0x200e('0x1a')];var _0xbd86d7=_0x48c16c?0x0:_0x4c9046[_0x200e('0x18')];var _0x54ee31=_0x48c16c?_0x2765b0[_0x200e('0x1a')]:_0x4c9046[_0x200e('0x18')]+_0x4c9046[_0x200e('0x1b')];var _0x8a5d6b;if(_0x54ee31>=_0x2a51fe){_0x54ee31=_0x2a51fe;_0x8a5d6b=0xc8;}else{_0x8a5d6b=0xce;}_0x584c42['status'](_0x8a5d6b);return _0x584c42['set']('Content-Range',_0xbd86d7+'-'+_0x54ee31+'/'+_0x2a51fe)['json'](_0x2765b0);}return null;};}function patchUpdates(_0x7d403b){return function(_0xb5be3b){try{jsonpatch[_0x200e('0x1c')](_0xb5be3b,_0x7d403b,!![]);}catch(_0x519bbf){return BPromise[_0x200e('0x1d')](_0x519bbf);}return _0xb5be3b[_0x200e('0x1e')]();};}function saveUpdates(_0x3d0dce,_0x2dfe48){return function(_0x21317b){if(_0x21317b){return _0x21317b[_0x200e('0x1f')](_0x3d0dce)[_0x200e('0x20')](function(_0x349c17){return _0x349c17;});}return null;};}function removeEntity(_0x1103e8,_0x1a484f){return function(_0x21ca0f){if(_0x21ca0f){return _0x21ca0f[_0x200e('0x21')]()['then'](function(){_0x1103e8[_0x200e('0x17')](0xcc)[_0x200e('0x22')]();});}};}function handleEntityNotFound(_0x2da88e,_0x59e8b3){return function(_0x32f157){if(!_0x32f157){_0x2da88e[_0x200e('0x16')](0x194);}return _0x32f157;};}function handleError(_0x3190bf,_0x222372){_0x222372=_0x222372||0x1f4;return function(_0x3f27ee){logger[_0x200e('0x23')](_0x3f27ee['stack']);if(_0x3f27ee[_0x200e('0x24')]){delete _0x3f27ee[_0x200e('0x24')];}_0x3190bf['status'](_0x222372)[_0x200e('0x25')](_0x3f27ee);};}exports[_0x200e('0x26')]=function(_0x438cf5,_0x22513d){var _0x88f265={},_0x595121={},_0xa8945a={'count':0x0,'rows':[]};var _0x14127f=_[_0x200e('0x27')](db[_0x200e('0x28')][_0x200e('0x29')],function(_0x2b8c30){return{'name':_0x2b8c30[_0x200e('0x2a')],'type':_0x2b8c30[_0x200e('0x2b')][_0x200e('0x2c')]};});_0x595121[_0x200e('0x2d')]=_[_0x200e('0x27')](_0x14127f,_0x200e('0x24'));_0x595121[_0x200e('0x2e')]=_[_0x200e('0x2f')](_0x438cf5[_0x200e('0x2e')]);_0x595121[_0x200e('0x30')]=_[_0x200e('0x31')](_0x595121[_0x200e('0x2d')],_0x595121['query']);_0x88f265[_0x200e('0x32')]=_[_0x200e('0x31')](_0x595121['model'],qs[_0x200e('0x33')](_0x438cf5[_0x200e('0x2e')][_0x200e('0x33')]));_0x88f265['attributes']=_0x88f265[_0x200e('0x32')][_0x200e('0x34')]?_0x88f265[_0x200e('0x32')]:_0x595121[_0x200e('0x2d')];if(!_0x438cf5[_0x200e('0x2e')]['hasOwnProperty']('nolimit')){_0x88f265[_0x200e('0x1b')]=qs['limit'](_0x438cf5[_0x200e('0x2e')][_0x200e('0x1b')]);_0x88f265['offset']=qs[_0x200e('0x18')](_0x438cf5[_0x200e('0x2e')]['offset']);}_0x88f265[_0x200e('0x35')]=qs[_0x200e('0x36')](_0x438cf5[_0x200e('0x2e')][_0x200e('0x36')]);_0x88f265[_0x200e('0x37')]=qs[_0x200e('0x30')](_['pick'](_0x438cf5[_0x200e('0x2e')],_0x595121[_0x200e('0x30')]),_0x14127f);if(_0x438cf5['query'][_0x200e('0x38')]){_0x88f265[_0x200e('0x37')]=_['merge'](_0x88f265['where'],{'$or':_['map'](_0x14127f,function(_0x1f41a1){if(_0x1f41a1[_0x200e('0x2b')]!==_0x200e('0x39')){var _0xeed03b={};_0xeed03b[_0x1f41a1[_0x200e('0x24')]]={'$like':'%'+_0x438cf5[_0x200e('0x2e')][_0x200e('0x38')]+'%'};return _0xeed03b;}})});}_0x88f265=_[_0x200e('0x3a')]({},_0x88f265,_0x438cf5['options']);var _0x43f33c={'where':_0x88f265[_0x200e('0x37')]};return db[_0x200e('0x28')][_0x200e('0x1a')](_0x43f33c)['then'](function(_0x3bb6d3){_0xa8945a['count']=_0x3bb6d3;if(_0x438cf5[_0x200e('0x2e')][_0x200e('0x3b')]){_0x88f265[_0x200e('0x3c')]=[{'all':!![]}];}return db[_0x200e('0x28')][_0x200e('0x3d')](_0x88f265);})[_0x200e('0x20')](function(_0x2ab570){_0xa8945a[_0x200e('0x3e')]=_0x2ab570;return _0xa8945a;})[_0x200e('0x20')](respondWithFilteredResult(_0x22513d,_0x88f265))[_0x200e('0x3f')](handleError(_0x22513d,null));};exports[_0x200e('0x40')]=function(_0x3a6ddf,_0x18d82c){var _0x2c9c3e={'raw':!![],'where':{'id':_0x3a6ddf[_0x200e('0x41')]['id']}},_0x1c2441={};_0x1c2441[_0x200e('0x2d')]=_[_0x200e('0x2f')](db[_0x200e('0x28')][_0x200e('0x29')]);_0x1c2441[_0x200e('0x2e')]=_[_0x200e('0x2f')](_0x3a6ddf[_0x200e('0x2e')]);_0x1c2441['filters']=_['intersection'](_0x1c2441[_0x200e('0x2d')],_0x1c2441[_0x200e('0x2e')]);_0x2c9c3e['attributes']=_['intersection'](_0x1c2441[_0x200e('0x2d')],qs['fields'](_0x3a6ddf[_0x200e('0x2e')]['fields']));_0x2c9c3e['attributes']=_0x2c9c3e[_0x200e('0x32')][_0x200e('0x34')]?_0x2c9c3e[_0x200e('0x32')]:_0x1c2441[_0x200e('0x2d')];if(_0x3a6ddf[_0x200e('0x2e')][_0x200e('0x3b')]){_0x2c9c3e[_0x200e('0x3c')]=[{'all':!![]}];}_0x2c9c3e=_[_0x200e('0x3a')]({},_0x2c9c3e,_0x3a6ddf['options']);return db['MailSubstatus'][_0x200e('0x42')](_0x2c9c3e)[_0x200e('0x20')](handleEntityNotFound(_0x18d82c,null))['then'](respondWithResult(_0x18d82c,null))[_0x200e('0x3f')](handleError(_0x18d82c,null));};exports[_0x200e('0x43')]=function(_0x43e520,_0x3fc8ee){return db[_0x200e('0x28')][_0x200e('0x43')](_0x43e520[_0x200e('0x44')],{})[_0x200e('0x20')](respondWithResult(_0x3fc8ee,0xc9))['catch'](handleError(_0x3fc8ee,null));};exports[_0x200e('0x1f')]=function(_0x4e40bb,_0x4554ae){if(_0x4e40bb[_0x200e('0x44')]['id']){delete _0x4e40bb[_0x200e('0x44')]['id'];}return db['MailSubstatus'][_0x200e('0x42')]({'where':{'id':_0x4e40bb[_0x200e('0x41')]['id']}})[_0x200e('0x20')](handleEntityNotFound(_0x4554ae,null))[_0x200e('0x20')](saveUpdates(_0x4e40bb[_0x200e('0x44')],null))['then'](respondWithResult(_0x4554ae,null))['catch'](handleError(_0x4554ae,null));};exports[_0x200e('0x21')]=function(_0x2eecef,_0x3b3255){return db[_0x200e('0x28')][_0x200e('0x42')]({'where':{'id':_0x2eecef[_0x200e('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b3255,null))[_0x200e('0x20')](removeEntity(_0x3b3255,null))[_0x200e('0x3f')](handleError(_0x3b3255,null));};exports[_0x200e('0x45')]=function(_0x33cb7b,_0x59e4f9){return db[_0x200e('0x28')]['describe']()[_0x200e('0x20')](respondWithResult(_0x59e4f9,null))['catch'](handleError(_0x59e4f9,null));}; \ No newline at end of file +var _0xafb4=['type','VIRTUAL','filter','merge','include','rows','catch','show','params','keys','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','reject','update','then','destroy','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0x4ca333,_0x1218a3){var _0x13b2e1=function(_0x1eaf45){while(--_0x1eaf45){_0x4ca333['push'](_0x4ca333['shift']());}};_0x13b2e1(++_0x1218a3);}(_0xafb4,0x124));var _0x4afb=function(_0x598965,_0xf1c449){_0x598965=_0x598965-0x0;var _0x37c71c=_0xafb4[_0x598965];return _0x37c71c;};'use strict';var emlformat=require(_0x4afb('0x0'));var rimraf=require(_0x4afb('0x1'));var zipdir=require(_0x4afb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4afb('0x3'));var Mustache=require(_0x4afb('0x4'));var util=require(_0x4afb('0x5'));var path=require(_0x4afb('0x6'));var sox=require('sox');var csv=require(_0x4afb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4afb('0x8'));var _=require('lodash');var squel=require(_0x4afb('0x9'));var crypto=require(_0x4afb('0xa'));var jsforce=require(_0x4afb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4afb('0x7'));var querystring=require(_0x4afb('0xc'));var Papa=require(_0x4afb('0xd'));var Redis=require(_0x4afb('0xe'));var authService=require(_0x4afb('0xf'));var qs=require(_0x4afb('0x10'));var as=require(_0x4afb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4afb('0x12'));var config=require(_0x4afb('0x13'));var licenseUtil=require(_0x4afb('0x14'));var db=require(_0x4afb('0x15'))['db'];function respondWithStatusCode(_0x4bcaa9,_0x16e655){_0x16e655=_0x16e655||0xcc;return function(_0x405813){if(_0x405813){return _0x4bcaa9['sendStatus'](_0x16e655);}return _0x4bcaa9[_0x4afb('0x16')](_0x16e655)[_0x4afb('0x17')]();};}function respondWithResult(_0x322e89,_0x564637){_0x564637=_0x564637||0xc8;return function(_0x11037c){if(_0x11037c){return _0x322e89['status'](_0x564637)[_0x4afb('0x18')](_0x11037c);}};}function respondWithFilteredResult(_0xae22c,_0x7b492b){return function(_0x3b14a0){if(_0x3b14a0){var _0x24a58f=typeof _0x7b492b['offset']===_0x4afb('0x19')&&typeof _0x7b492b['limit']==='undefined';var _0x4a9394=_0x3b14a0[_0x4afb('0x1a')];var _0x14b263=_0x24a58f?0x0:_0x7b492b[_0x4afb('0x1b')];var _0x4fad05=_0x24a58f?_0x3b14a0[_0x4afb('0x1a')]:_0x7b492b['offset']+_0x7b492b[_0x4afb('0x1c')];var _0x2aff51;if(_0x4fad05>=_0x4a9394){_0x4fad05=_0x4a9394;_0x2aff51=0xc8;}else{_0x2aff51=0xce;}_0xae22c[_0x4afb('0x16')](_0x2aff51);return _0xae22c['set'](_0x4afb('0x1d'),_0x14b263+'-'+_0x4fad05+'/'+_0x4a9394)[_0x4afb('0x18')](_0x3b14a0);}return null;};}function patchUpdates(_0xc8334c){return function(_0x25fe46){try{jsonpatch['apply'](_0x25fe46,_0xc8334c,!![]);}catch(_0x206df3){return BPromise[_0x4afb('0x1e')](_0x206df3);}return _0x25fe46['save']();};}function saveUpdates(_0x2cfd1f,_0x4ab2ce){return function(_0x606799){if(_0x606799){return _0x606799[_0x4afb('0x1f')](_0x2cfd1f)[_0x4afb('0x20')](function(_0x5c218d){return _0x5c218d;});}return null;};}function removeEntity(_0xc625ee,_0x597641){return function(_0x380d38){if(_0x380d38){return _0x380d38[_0x4afb('0x21')]()[_0x4afb('0x20')](function(){_0xc625ee['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7275,_0x119d43){return function(_0x20068e){if(!_0x20068e){_0x1c7275['sendStatus'](0x194);}return _0x20068e;};}function handleError(_0x9ec463,_0x754b6f){_0x754b6f=_0x754b6f||0x1f4;return function(_0x3f36ad){logger['error'](_0x3f36ad[_0x4afb('0x22')]);if(_0x3f36ad[_0x4afb('0x23')]){delete _0x3f36ad[_0x4afb('0x23')];}_0x9ec463[_0x4afb('0x16')](_0x754b6f)[_0x4afb('0x24')](_0x3f36ad);};}exports['index']=function(_0x512c5f,_0x3dfa46){var _0x467d9f={},_0x1bdf1f={},_0x244d74={'count':0x0,'rows':[]};var _0x3b3e55=_[_0x4afb('0x25')](db[_0x4afb('0x26')][_0x4afb('0x27')],function(_0x3a5741){return{'name':_0x3a5741[_0x4afb('0x28')],'type':_0x3a5741['type'][_0x4afb('0x29')]};});_0x1bdf1f[_0x4afb('0x2a')]=_[_0x4afb('0x25')](_0x3b3e55,_0x4afb('0x23'));_0x1bdf1f[_0x4afb('0x2b')]=_['keys'](_0x512c5f[_0x4afb('0x2b')]);_0x1bdf1f[_0x4afb('0x2c')]=_[_0x4afb('0x2d')](_0x1bdf1f['model'],_0x1bdf1f[_0x4afb('0x2b')]);_0x467d9f[_0x4afb('0x2e')]=_[_0x4afb('0x2d')](_0x1bdf1f[_0x4afb('0x2a')],qs[_0x4afb('0x2f')](_0x512c5f[_0x4afb('0x2b')]['fields']));_0x467d9f['attributes']=_0x467d9f[_0x4afb('0x2e')][_0x4afb('0x30')]?_0x467d9f[_0x4afb('0x2e')]:_0x1bdf1f['model'];if(!_0x512c5f[_0x4afb('0x2b')]['hasOwnProperty'](_0x4afb('0x31'))){_0x467d9f['limit']=qs[_0x4afb('0x1c')](_0x512c5f[_0x4afb('0x2b')]['limit']);_0x467d9f[_0x4afb('0x1b')]=qs[_0x4afb('0x1b')](_0x512c5f['query'][_0x4afb('0x1b')]);}_0x467d9f[_0x4afb('0x32')]=qs['sort'](_0x512c5f[_0x4afb('0x2b')][_0x4afb('0x33')]);_0x467d9f[_0x4afb('0x34')]=qs[_0x4afb('0x2c')](_['pick'](_0x512c5f[_0x4afb('0x2b')],_0x1bdf1f[_0x4afb('0x2c')]),_0x3b3e55);if(_0x512c5f[_0x4afb('0x2b')]['filter']){_0x467d9f[_0x4afb('0x34')]=_['merge'](_0x467d9f[_0x4afb('0x34')],{'$or':_['map'](_0x3b3e55,function(_0x3bf71b){if(_0x3bf71b[_0x4afb('0x35')]!==_0x4afb('0x36')){var _0x21f410={};_0x21f410[_0x3bf71b[_0x4afb('0x23')]]={'$like':'%'+_0x512c5f['query'][_0x4afb('0x37')]+'%'};return _0x21f410;}})});}_0x467d9f=_[_0x4afb('0x38')]({},_0x467d9f,_0x512c5f['options']);var _0x2f8ddf={'where':_0x467d9f['where']};return db[_0x4afb('0x26')][_0x4afb('0x1a')](_0x2f8ddf)['then'](function(_0x1550d8){_0x244d74[_0x4afb('0x1a')]=_0x1550d8;if(_0x512c5f['query']['includeAll']){_0x467d9f[_0x4afb('0x39')]=[{'all':!![]}];}return db[_0x4afb('0x26')]['findAll'](_0x467d9f);})[_0x4afb('0x20')](function(_0x46e968){_0x244d74[_0x4afb('0x3a')]=_0x46e968;return _0x244d74;})['then'](respondWithFilteredResult(_0x3dfa46,_0x467d9f))[_0x4afb('0x3b')](handleError(_0x3dfa46,null));};exports[_0x4afb('0x3c')]=function(_0x3dfa64,_0x24eace){var _0xd314b7={'raw':!![],'where':{'id':_0x3dfa64[_0x4afb('0x3d')]['id']}},_0x1ae66b={};_0x1ae66b[_0x4afb('0x2a')]=_[_0x4afb('0x3e')](db[_0x4afb('0x26')][_0x4afb('0x27')]);_0x1ae66b['query']=_['keys'](_0x3dfa64[_0x4afb('0x2b')]);_0x1ae66b[_0x4afb('0x2c')]=_['intersection'](_0x1ae66b[_0x4afb('0x2a')],_0x1ae66b[_0x4afb('0x2b')]);_0xd314b7[_0x4afb('0x2e')]=_['intersection'](_0x1ae66b[_0x4afb('0x2a')],qs['fields'](_0x3dfa64[_0x4afb('0x2b')][_0x4afb('0x2f')]));_0xd314b7[_0x4afb('0x2e')]=_0xd314b7[_0x4afb('0x2e')][_0x4afb('0x30')]?_0xd314b7[_0x4afb('0x2e')]:_0x1ae66b[_0x4afb('0x2a')];if(_0x3dfa64[_0x4afb('0x2b')][_0x4afb('0x3f')]){_0xd314b7[_0x4afb('0x39')]=[{'all':!![]}];}_0xd314b7=_[_0x4afb('0x38')]({},_0xd314b7,_0x3dfa64[_0x4afb('0x40')]);return db[_0x4afb('0x26')][_0x4afb('0x41')](_0xd314b7)[_0x4afb('0x20')](handleEntityNotFound(_0x24eace,null))['then'](respondWithResult(_0x24eace,null))[_0x4afb('0x3b')](handleError(_0x24eace,null));};exports[_0x4afb('0x42')]=function(_0x58fa5b,_0x4fd4ee){return db[_0x4afb('0x26')][_0x4afb('0x42')](_0x58fa5b[_0x4afb('0x43')],{})[_0x4afb('0x20')](respondWithResult(_0x4fd4ee,0xc9))['catch'](handleError(_0x4fd4ee,null));};exports[_0x4afb('0x1f')]=function(_0x409920,_0x15051c){if(_0x409920[_0x4afb('0x43')]['id']){delete _0x409920['body']['id'];}return db['MailSubstatus'][_0x4afb('0x41')]({'where':{'id':_0x409920['params']['id']}})['then'](handleEntityNotFound(_0x15051c,null))[_0x4afb('0x20')](saveUpdates(_0x409920['body'],null))[_0x4afb('0x20')](respondWithResult(_0x15051c,null))[_0x4afb('0x3b')](handleError(_0x15051c,null));};exports[_0x4afb('0x21')]=function(_0x41e7fa,_0xecfd87){return db[_0x4afb('0x26')][_0x4afb('0x41')]({'where':{'id':_0x41e7fa['params']['id']}})[_0x4afb('0x20')](handleEntityNotFound(_0xecfd87,null))[_0x4afb('0x20')](removeEntity(_0xecfd87,null))[_0x4afb('0x3b')](handleError(_0xecfd87,null));};exports[_0x4afb('0x44')]=function(_0x5314b6,_0x50251e){return db['MailSubstatus'][_0x4afb('0x44')]()[_0x4afb('0x20')](respondWithResult(_0x50251e,null))[_0x4afb('0x3b')](handleError(_0x50251e,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 4c0fd86..ef172cb 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e60=['hasOwnProperty','exports','events','../../mysqldb','MailSubstatus','update','emit'];(function(_0x27ada5,_0x2390c5){var _0x57a42a=function(_0x460f84){while(--_0x460f84){_0x27ada5['push'](_0x27ada5['shift']());}};_0x57a42a(++_0x2390c5);}(_0x4e60,0x9c));var _0x04e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4e60[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x04e6('0x0'));var MailSubstatus=require(_0x04e6('0x1'))['db'][_0x04e6('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x04e6('0x3')};function emitEvent(_0x4beb40){return function(_0x3acb87,_0x522345,_0x519025){MailSubstatusEvents['emit'](_0x4beb40+':'+_0x3acb87['id'],_0x3acb87);MailSubstatusEvents[_0x04e6('0x4')](_0x4beb40,_0x3acb87);_0x519025(null);};}for(var e in events){if(events[_0x04e6('0x5')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x04e6('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0x81a9=['events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x81a9,0x1c2));var _0x981a=function(_0x3cfe15,_0xbd391b){_0x3cfe15=_0x3cfe15-0x0;var _0x113904=_0x81a9[_0x3cfe15];return _0x113904;};'use strict';var EventEmitter=require(_0x981a('0x0'));var MailSubstatus=require(_0x981a('0x1'))['db'][_0x981a('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x981a('0x3')](0x0);var events={'afterUpdate':_0x981a('0x4')};function emitEvent(_0x242841){return function(_0x32839a,_0x5d6a6a,_0x26a562){MailSubstatusEvents[_0x981a('0x5')](_0x242841+':'+_0x32839a['id'],_0x32839a);MailSubstatusEvents[_0x981a('0x5')](_0x242841,_0x32839a);_0x26a562(null);};}for(var e in events){if(events[_0x981a('0x6')](e)){var event=events[e];MailSubstatus[_0x981a('0x7')](e,emitEvent(event));}}module[_0x981a('0x8')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 5576d55..88029e4 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 _0x9c87=['_previousDataValues','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus'];(function(_0x50ae20,_0x4e52fb){var _0x5153dc=function(_0x2832ae){while(--_0x2832ae){_0x50ae20['push'](_0x50ae20['shift']());}};_0x5153dc(++_0x4e52fb);}(_0x9c87,0x86));var _0x79c8=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x9c87[_0x419e17];return _0x1f2044;};'use strict';var attributes=require(_0x79c8('0x0'));module[_0x79c8('0x1')]=function(_0x45572e){var _0x376b79=_0x45572e[_0x79c8('0x2')];return _0x45572e[_0x79c8('0x3')](_0x79c8('0x4'),attributes,{'tableName':_0x79c8('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5439d4,_0xb3b314,_0x5e8095){return _0x376b79[_0x79c8('0x6')][_0x79c8('0x7')]({'value':_0x5439d4[_0x79c8('0x8')]},{'where':{'field':_0x79c8('0x9'),'value':_0x5439d4[_0x79c8('0xa')]['name']}})['then'](function(){_0x5e8095();})[_0x79c8('0xb')](function(_0x4ef00c){_0x5e8095(_0x4ef00c);});}}});}; \ No newline at end of file +var _0x0e5a=['_previousDataValues','name','then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','mailSubstatus'];(function(_0x929683,_0x10a2db){var _0x601c27=function(_0x34cda5){while(--_0x34cda5){_0x929683['push'](_0x929683['shift']());}};_0x601c27(++_0x10a2db);}(_0x0e5a,0x70));var _0xa0e5=function(_0x2d1c84,_0xb44a74){_0x2d1c84=_0x2d1c84-0x0;var _0xa22c82=_0x0e5a[_0x2d1c84];return _0xa22c82;};'use strict';var attributes=require(_0xa0e5('0x0'));module[_0xa0e5('0x1')]=function(_0x497505){var _0x5151ea=_0x497505[_0xa0e5('0x2')];return _0x497505[_0xa0e5('0x3')](_0xa0e5('0x4'),attributes,{'tableName':_0xa0e5('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x522260,_0x238311,_0xd79f30){return _0x5151ea[_0xa0e5('0x6')]['update']({'value':_0x522260['name']},{'where':{'field':_0xa0e5('0x7'),'value':_0x522260[_0xa0e5('0x8')][_0xa0e5('0x9')]}})[_0xa0e5('0xa')](function(){_0xd79f30();})[_0xa0e5('0xb')](function(_0x2c2613){_0xd79f30(_0x2c2613);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 83bd33c..efe1202 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 _0xa5c9=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x348d2c,_0x1f7ecc){var _0x383ac5=function(_0x5cbd24){while(--_0x5cbd24){_0x348d2c['push'](_0x348d2c['shift']());}};_0x383ac5(++_0x1f7ecc);}(_0xa5c9,0x199));var _0x9a5c=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xa5c9[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9a5c('0x0'));var BPromise=require(_0x9a5c('0x1'));var rs=require(_0x9a5c('0x2'));var fs=require('fs');var Redis=require(_0x9a5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a5c('0x4'));var logger=require(_0x9a5c('0x5'))(_0x9a5c('0x6'));var config=require(_0x9a5c('0x7'));var jayson=require(_0x9a5c('0x8'));var client=jayson[_0x9a5c('0x9')][_0x9a5c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a7951,_0x22265c,_0x33a547){return new BPromise(function(_0x3b67c8,_0x4b9292){return client['request'](_0x5a7951,_0x33a547)[_0x9a5c('0xb')](function(_0x5cd4a9){logger[_0x9a5c('0xc')](_0x9a5c('0xd'),_0x22265c,_0x9a5c('0xe'));logger[_0x9a5c('0xf')](_0x9a5c('0x10'),_0x22265c,_0x9a5c('0xe'),JSON[_0x9a5c('0x11')](_0x5cd4a9));if(_0x5cd4a9[_0x9a5c('0x12')]){if(_0x5cd4a9[_0x9a5c('0x12')][_0x9a5c('0x13')]===0x1f4){logger['error'](_0x9a5c('0xd'),_0x22265c,_0x5cd4a9[_0x9a5c('0x12')][_0x9a5c('0x14')]);return _0x4b9292(_0x5cd4a9[_0x9a5c('0x12')][_0x9a5c('0x14')]);}logger[_0x9a5c('0x12')](_0x9a5c('0xd'),_0x22265c,_0x5cd4a9[_0x9a5c('0x12')][_0x9a5c('0x14')]);return _0x3b67c8(_0x5cd4a9[_0x9a5c('0x12')][_0x9a5c('0x14')]);}else{logger[_0x9a5c('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x22265c,_0x9a5c('0xe'));_0x3b67c8(_0x5cd4a9[_0x9a5c('0x15')][_0x9a5c('0x14')]);}})[_0x9a5c('0x16')](function(_0x4a0ed6){logger[_0x9a5c('0x12')](_0x9a5c('0xd'),_0x22265c,_0x4a0ed6);_0x4b9292(_0x4a0ed6);});});} \ No newline at end of file +var _0xdd5b=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x11a524,_0x27e0c9){var _0x3756b6=function(_0x320e1f){while(--_0x320e1f){_0x11a524['push'](_0x11a524['shift']());}};_0x3756b6(++_0x27e0c9);}(_0xdd5b,0x150));var _0xbdd5=function(_0x5b4742,_0x304b37){_0x5b4742=_0x5b4742-0x0;var _0x2c6b94=_0xdd5b[_0x5b4742];return _0x2c6b94;};'use strict';var _=require(_0xbdd5('0x0'));var util=require('util');var moment=require(_0xbdd5('0x1'));var BPromise=require(_0xbdd5('0x2'));var rs=require(_0xbdd5('0x3'));var fs=require('fs');var Redis=require(_0xbdd5('0x4'));var db=require(_0xbdd5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdd5('0x6'))('rpc');var config=require(_0xbdd5('0x7'));var jayson=require(_0xbdd5('0x8'));var client=jayson[_0xbdd5('0x9')][_0xbdd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x590b50,_0x372ef8,_0x2708a8){return new BPromise(function(_0x3d2b99,_0x172ee6){return client['request'](_0x590b50,_0x2708a8)['then'](function(_0x291e1d){logger[_0xbdd5('0xb')](_0xbdd5('0xc'),_0x372ef8,_0xbdd5('0xd'));logger['debug'](_0xbdd5('0xe'),_0x372ef8,_0xbdd5('0xd'),JSON[_0xbdd5('0xf')](_0x291e1d));if(_0x291e1d[_0xbdd5('0x10')]){if(_0x291e1d[_0xbdd5('0x10')][_0xbdd5('0x11')]===0x1f4){logger[_0xbdd5('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x372ef8,_0x291e1d[_0xbdd5('0x10')][_0xbdd5('0x12')]);return _0x172ee6(_0x291e1d[_0xbdd5('0x10')][_0xbdd5('0x12')]);}logger[_0xbdd5('0x10')](_0xbdd5('0xc'),_0x372ef8,_0x291e1d[_0xbdd5('0x10')][_0xbdd5('0x12')]);return _0x3d2b99(_0x291e1d[_0xbdd5('0x10')][_0xbdd5('0x12')]);}else{logger['info'](_0xbdd5('0xc'),_0x372ef8,_0xbdd5('0xd'));_0x3d2b99(_0x291e1d[_0xbdd5('0x13')]['message']);}})['catch'](function(_0x34a2c2){logger[_0xbdd5('0x10')](_0xbdd5('0xc'),_0x372ef8,_0x34a2c2);_0x172ee6(_0x34a2c2);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 2b21933..c6ce6e6 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 _0x80de=['describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x80de,0x169));var _0xe80d=function(_0x33b934,_0x22591d){_0x33b934=_0x33b934-0x0;var _0x4c1d91=_0x80de[_0x33b934];return _0x4c1d91;};'use strict';var multer=require(_0xe80d('0x0'));var util=require(_0xe80d('0x1'));var path=require(_0xe80d('0x2'));var timeout=require(_0xe80d('0x3'));var express=require(_0xe80d('0x4'));var router=express[_0xe80d('0x5')]();var fs_extra=require(_0xe80d('0x6'));var auth=require(_0xe80d('0x7'));var interaction=require(_0xe80d('0x8'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router[_0xe80d('0x9')]('/',auth[_0xe80d('0xa')](),controller[_0xe80d('0xb')]);router[_0xe80d('0x9')](_0xe80d('0xc'),auth['isAuthenticated'](),controller[_0xe80d('0xd')]);router['get'](_0xe80d('0xe'),auth[_0xe80d('0xa')](),controller[_0xe80d('0xf')]);router[_0xe80d('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe80d('0x11')](_0xe80d('0xe'),auth[_0xe80d('0xa')](),controller[_0xe80d('0x12')]);router[_0xe80d('0x13')]('/:id',auth[_0xe80d('0xa')](),controller[_0xe80d('0x14')]);module[_0xe80d('0x15')]=router; \ No newline at end of file +var _0x8abd=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','destroy','multer'];(function(_0x257e8f,_0xdc7fc9){var _0x2d8b1e=function(_0x24739a){while(--_0x24739a){_0x257e8f['push'](_0x257e8f['shift']());}};_0x2d8b1e(++_0xdc7fc9);}(_0x8abd,0x117));var _0xd8ab=function(_0x3df0e3,_0x3e5975){_0x3df0e3=_0x3df0e3-0x0;var _0x3a896f=_0x8abd[_0x3df0e3];return _0x3a896f;};'use strict';var multer=require(_0xd8ab('0x0'));var util=require(_0xd8ab('0x1'));var path=require(_0xd8ab('0x2'));var timeout=require(_0xd8ab('0x3'));var express=require('express');var router=express[_0xd8ab('0x4')]();var fs_extra=require(_0xd8ab('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd8ab('0x6'));var config=require(_0xd8ab('0x7'));var controller=require(_0xd8ab('0x8'));router[_0xd8ab('0x9')]('/',auth[_0xd8ab('0xa')](),controller[_0xd8ab('0xb')]);router[_0xd8ab('0x9')]('/describe',auth[_0xd8ab('0xa')](),controller[_0xd8ab('0xc')]);router[_0xd8ab('0x9')](_0xd8ab('0xd'),auth['isAuthenticated'](),controller[_0xd8ab('0xe')]);router[_0xd8ab('0xf')]('/',auth[_0xd8ab('0xa')](),controller['create']);router[_0xd8ab('0x10')](_0xd8ab('0xd'),auth[_0xd8ab('0xa')](),controller[_0xd8ab('0x11')]);router[_0xd8ab('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd8ab('0x13')]);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 5abd923..f6be163 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x3c707b,_0x1d958d){var _0x14a0a7=function(_0x406774){while(--_0x406774){_0x3c707b['push'](_0x3c707b['shift']());}};_0x14a0a7(++_0x1d958d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d6ac0,_0x201628){_0x4d6ac0=_0x4d6ac0-0x0;var _0x5296c4=_0xcb91[_0x4d6ac0];return _0x5296c4;};'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 +var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x43edaa,_0xfbbb1b){var _0x103689=function(_0x20e808){while(--_0x20e808){_0x43edaa['push'](_0x43edaa['shift']());}};_0x103689(++_0xfbbb1b);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b84[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index e139c2b..0cafeef 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 _0xcd0c=['map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','error','name','index'];(function(_0x4e82bb,_0x4c39d5){var _0x1b5ac5=function(_0x578c77){while(--_0x578c77){_0x4e82bb['push'](_0x4e82bb['shift']());}};_0x1b5ac5(++_0x4c39d5);}(_0xcd0c,0x1f2));var _0xccd0=function(_0x5acaea,_0x442cb0){_0x5acaea=_0x5acaea-0x0;var _0x509dfa=_0xcd0c[_0x5acaea];return _0x509dfa;};'use strict';var emlformat=require(_0xccd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xccd0('0x1'));var jsonpatch=require(_0xccd0('0x2'));var rp=require('request-promise');var moment=require(_0xccd0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xccd0('0x4'));var util=require(_0xccd0('0x5'));var path=require(_0xccd0('0x6'));var sox=require(_0xccd0('0x7'));var csv=require(_0xccd0('0x8'));var ejs=require(_0xccd0('0x9'));var fs=require('fs');var fs_extra=require(_0xccd0('0xa'));var _=require(_0xccd0('0xb'));var squel=require(_0xccd0('0xc'));var crypto=require(_0xccd0('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xccd0('0x8'));var querystring=require(_0xccd0('0xe'));var Papa=require(_0xccd0('0xf'));var Redis=require(_0xccd0('0x10'));var authService=require(_0xccd0('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xccd0('0x12'))(_0xccd0('0x13'));var utils=require(_0xccd0('0x14'));var config=require(_0xccd0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xccd0('0x16'))['db'];function respondWithStatusCode(_0xc3e353,_0x71b4db){_0x71b4db=_0x71b4db||0xcc;return function(_0x132cf9){if(_0x132cf9){return _0xc3e353[_0xccd0('0x17')](_0x71b4db);}return _0xc3e353['status'](_0x71b4db)[_0xccd0('0x18')]();};}function respondWithResult(_0x2b5d12,_0x3bfb7b){_0x3bfb7b=_0x3bfb7b||0xc8;return function(_0x5bc5d1){if(_0x5bc5d1){return _0x2b5d12[_0xccd0('0x19')](_0x3bfb7b)[_0xccd0('0x1a')](_0x5bc5d1);}};}function respondWithFilteredResult(_0x501202,_0x42c791){return function(_0x447e03){if(_0x447e03){var _0x14dab7=typeof _0x42c791[_0xccd0('0x1b')]==='undefined'&&typeof _0x42c791['limit']===_0xccd0('0x1c');var _0x1e8c31=_0x447e03[_0xccd0('0x1d')];var _0x3afc51=_0x14dab7?0x0:_0x42c791['offset'];var _0x42b0ff=_0x14dab7?_0x447e03[_0xccd0('0x1d')]:_0x42c791[_0xccd0('0x1b')]+_0x42c791[_0xccd0('0x1e')];var _0x1a6b1c;if(_0x42b0ff>=_0x1e8c31){_0x42b0ff=_0x1e8c31;_0x1a6b1c=0xc8;}else{_0x1a6b1c=0xce;}_0x501202['status'](_0x1a6b1c);return _0x501202[_0xccd0('0x1f')](_0xccd0('0x20'),_0x3afc51+'-'+_0x42b0ff+'/'+_0x1e8c31)[_0xccd0('0x1a')](_0x447e03);}return null;};}function patchUpdates(_0x533753){return function(_0x2065d9){try{jsonpatch[_0xccd0('0x21')](_0x2065d9,_0x533753,!![]);}catch(_0x32ad06){return BPromise[_0xccd0('0x22')](_0x32ad06);}return _0x2065d9[_0xccd0('0x23')]();};}function saveUpdates(_0x1339c9,_0xeca904){return function(_0x2382b4){if(_0x2382b4){return _0x2382b4[_0xccd0('0x24')](_0x1339c9)['then'](function(_0x2584f5){return _0x2584f5;});}return null;};}function removeEntity(_0x6ee207,_0x6441a0){return function(_0x345868){if(_0x345868){return _0x345868[_0xccd0('0x25')]()['then'](function(){_0x6ee207[_0xccd0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c0f35,_0x3541e8){return function(_0x7cf87e){if(!_0x7cf87e){_0x1c0f35[_0xccd0('0x17')](0x194);}return _0x7cf87e;};}function handleError(_0x198554,_0x2c8d8e){_0x2c8d8e=_0x2c8d8e||0x1f4;return function(_0x4f98a1){logger[_0xccd0('0x26')](_0x4f98a1['stack']);if(_0x4f98a1[_0xccd0('0x27')]){delete _0x4f98a1['name'];}_0x198554[_0xccd0('0x19')](_0x2c8d8e)['send'](_0x4f98a1);};}exports[_0xccd0('0x28')]=function(_0x2a8920,_0x261615){var _0x11a784={},_0x277309={},_0x135336={'count':0x0,'rows':[]};var _0x46342d=_[_0xccd0('0x29')](db[_0xccd0('0x2a')][_0xccd0('0x2b')],function(_0x51d57a){return{'name':_0x51d57a[_0xccd0('0x2c')],'type':_0x51d57a[_0xccd0('0x2d')][_0xccd0('0x2e')]};});_0x277309['model']=_[_0xccd0('0x29')](_0x46342d,_0xccd0('0x27'));_0x277309[_0xccd0('0x2f')]=_[_0xccd0('0x30')](_0x2a8920[_0xccd0('0x2f')]);_0x277309[_0xccd0('0x31')]=_['intersection'](_0x277309[_0xccd0('0x32')],_0x277309[_0xccd0('0x2f')]);_0x11a784[_0xccd0('0x33')]=_[_0xccd0('0x34')](_0x277309['model'],qs[_0xccd0('0x35')](_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x35')]));_0x11a784[_0xccd0('0x33')]=_0x11a784[_0xccd0('0x33')]['length']?_0x11a784[_0xccd0('0x33')]:_0x277309[_0xccd0('0x32')];if(!_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x36')](_0xccd0('0x37'))){_0x11a784[_0xccd0('0x1e')]=qs[_0xccd0('0x1e')](_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x1e')]);_0x11a784[_0xccd0('0x1b')]=qs[_0xccd0('0x1b')](_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x1b')]);}_0x11a784[_0xccd0('0x38')]=qs[_0xccd0('0x39')](_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x39')]);_0x11a784[_0xccd0('0x3a')]=qs['filters'](_[_0xccd0('0x3b')](_0x2a8920[_0xccd0('0x2f')],_0x277309[_0xccd0('0x31')]),_0x46342d);if(_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x3c')]){_0x11a784['where']=_[_0xccd0('0x3d')](_0x11a784['where'],{'$or':_[_0xccd0('0x29')](_0x46342d,function(_0x1629b6){if(_0x1629b6[_0xccd0('0x2d')]!==_0xccd0('0x3e')){var _0x308e63={};_0x308e63[_0x1629b6[_0xccd0('0x27')]]={'$like':'%'+_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x3c')]+'%'};return _0x308e63;}})});}_0x11a784=_[_0xccd0('0x3d')]({},_0x11a784,_0x2a8920[_0xccd0('0x3f')]);var _0x41b325={'where':_0x11a784[_0xccd0('0x3a')]};return db[_0xccd0('0x2a')][_0xccd0('0x1d')](_0x41b325)[_0xccd0('0x40')](function(_0x2ae5f1){_0x135336['count']=_0x2ae5f1;if(_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x41')]){_0x11a784['include']=[{'all':!![]}];}return db[_0xccd0('0x2a')][_0xccd0('0x42')](_0x11a784);})[_0xccd0('0x40')](function(_0x3174bc){_0x135336[_0xccd0('0x43')]=_0x3174bc;return _0x135336;})[_0xccd0('0x40')](respondWithFilteredResult(_0x261615,_0x11a784))[_0xccd0('0x44')](handleError(_0x261615,null));};exports[_0xccd0('0x45')]=function(_0x266dbf,_0x1e3174){var _0x32d00a={'raw':!![],'where':{'id':_0x266dbf[_0xccd0('0x46')]['id']}},_0x35fa4b={};_0x35fa4b[_0xccd0('0x32')]=_[_0xccd0('0x30')](db[_0xccd0('0x2a')][_0xccd0('0x2b')]);_0x35fa4b['query']=_['keys'](_0x266dbf['query']);_0x35fa4b[_0xccd0('0x31')]=_['intersection'](_0x35fa4b[_0xccd0('0x32')],_0x35fa4b[_0xccd0('0x2f')]);_0x32d00a[_0xccd0('0x33')]=_[_0xccd0('0x34')](_0x35fa4b[_0xccd0('0x32')],qs[_0xccd0('0x35')](_0x266dbf[_0xccd0('0x2f')]['fields']));_0x32d00a[_0xccd0('0x33')]=_0x32d00a[_0xccd0('0x33')][_0xccd0('0x47')]?_0x32d00a[_0xccd0('0x33')]:_0x35fa4b['model'];if(_0x266dbf['query'][_0xccd0('0x41')]){_0x32d00a[_0xccd0('0x48')]=[{'all':!![]}];}_0x32d00a=_[_0xccd0('0x3d')]({},_0x32d00a,_0x266dbf[_0xccd0('0x3f')]);return db[_0xccd0('0x2a')][_0xccd0('0x49')](_0x32d00a)[_0xccd0('0x40')](handleEntityNotFound(_0x1e3174,null))[_0xccd0('0x40')](respondWithResult(_0x1e3174,null))[_0xccd0('0x44')](handleError(_0x1e3174,null));};exports[_0xccd0('0x4a')]=function(_0x358577,_0x20a440){return db[_0xccd0('0x2a')]['create'](_0x358577[_0xccd0('0x4b')],{})[_0xccd0('0x40')](respondWithResult(_0x20a440,0xc9))[_0xccd0('0x44')](handleError(_0x20a440,null));};exports[_0xccd0('0x24')]=function(_0x366998,_0x50ac8f){if(_0x366998['body']['id']){delete _0x366998[_0xccd0('0x4b')]['id'];}return db[_0xccd0('0x2a')][_0xccd0('0x49')]({'where':{'id':_0x366998[_0xccd0('0x46')]['id']}})[_0xccd0('0x40')](handleEntityNotFound(_0x50ac8f,null))[_0xccd0('0x40')](saveUpdates(_0x366998[_0xccd0('0x4b')],null))['then'](respondWithResult(_0x50ac8f,null))[_0xccd0('0x44')](handleError(_0x50ac8f,null));};exports[_0xccd0('0x25')]=function(_0x477e50,_0x3e3bb4){return db[_0xccd0('0x2a')][_0xccd0('0x49')]({'where':{'id':_0x477e50['params']['id']}})[_0xccd0('0x40')](handleEntityNotFound(_0x3e3bb4,null))[_0xccd0('0x40')](removeEntity(_0x3e3bb4,null))[_0xccd0('0x44')](handleError(_0x3e3bb4,null));};exports[_0xccd0('0x4c')]=function(_0x4daa4e,_0x46f4d6){return db[_0xccd0('0x2a')][_0xccd0('0x4c')]()[_0xccd0('0x40')](respondWithResult(_0x46f4d6,null))[_0xccd0('0x44')](handleError(_0x46f4d6,null));}; \ No newline at end of file +var _0xd8e0=['save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','query','intersection','model','attributes','fields','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','MailTransferReport','findAll','rows','catch','params','keys','length','find','create','body','describe','rimraf','request-promise','moment','util','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','../../config/license/util','../../mysqldb','sendStatus','end','offset','count','limit','status','set','Content-Range','apply','reject'];(function(_0x1c38bf,_0x15aff7){var _0x205774=function(_0x121732){while(--_0x121732){_0x1c38bf['push'](_0x1c38bf['shift']());}};_0x205774(++_0x15aff7);}(_0xd8e0,0x13e));var _0x0d8e=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xd8e0[_0x173441];return _0x2423a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d8e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8e('0x1'));var moment=require(_0x0d8e('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0d8e('0x3'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8e('0x4'));var fs=require('fs');var fs_extra=require(_0x0d8e('0x5'));var _=require(_0x0d8e('0x6'));var squel=require(_0x0d8e('0x7'));var crypto=require('crypto');var jsforce=require(_0x0d8e('0x8'));var deskjs=require(_0x0d8e('0x9'));var toCsv=require('to-csv');var querystring=require(_0x0d8e('0xa'));var Papa=require(_0x0d8e('0xb'));var Redis=require(_0x0d8e('0xc'));var authService=require(_0x0d8e('0xd'));var qs=require(_0x0d8e('0xe'));var as=require(_0x0d8e('0xf'));var hardwareService=require(_0x0d8e('0x10'));var logger=require('../../config/logger')(_0x0d8e('0x11'));var utils=require(_0x0d8e('0x12'));var config=require(_0x0d8e('0x13'));var licenseUtil=require(_0x0d8e('0x14'));var db=require(_0x0d8e('0x15'))['db'];function respondWithStatusCode(_0x439989,_0x3bd2c9){_0x3bd2c9=_0x3bd2c9||0xcc;return function(_0x2b9b11){if(_0x2b9b11){return _0x439989[_0x0d8e('0x16')](_0x3bd2c9);}return _0x439989['status'](_0x3bd2c9)[_0x0d8e('0x17')]();};}function respondWithResult(_0x82ba82,_0x2e3a4a){_0x2e3a4a=_0x2e3a4a||0xc8;return function(_0x223d36){if(_0x223d36){return _0x82ba82['status'](_0x2e3a4a)['json'](_0x223d36);}};}function respondWithFilteredResult(_0xcff6bc,_0x2b946a){return function(_0x33a23e){if(_0x33a23e){var _0x47664b=typeof _0x2b946a[_0x0d8e('0x18')]==='undefined'&&typeof _0x2b946a['limit']==='undefined';var _0x33f3ca=_0x33a23e['count'];var _0x3b26a3=_0x47664b?0x0:_0x2b946a[_0x0d8e('0x18')];var _0x58fade=_0x47664b?_0x33a23e[_0x0d8e('0x19')]:_0x2b946a[_0x0d8e('0x18')]+_0x2b946a[_0x0d8e('0x1a')];var _0x4ec5f0;if(_0x58fade>=_0x33f3ca){_0x58fade=_0x33f3ca;_0x4ec5f0=0xc8;}else{_0x4ec5f0=0xce;}_0xcff6bc[_0x0d8e('0x1b')](_0x4ec5f0);return _0xcff6bc[_0x0d8e('0x1c')](_0x0d8e('0x1d'),_0x3b26a3+'-'+_0x58fade+'/'+_0x33f3ca)['json'](_0x33a23e);}return null;};}function patchUpdates(_0x59959b){return function(_0x5787e9){try{jsonpatch[_0x0d8e('0x1e')](_0x5787e9,_0x59959b,!![]);}catch(_0x19c423){return BPromise[_0x0d8e('0x1f')](_0x19c423);}return _0x5787e9[_0x0d8e('0x20')]();};}function saveUpdates(_0x151d8b,_0x422957){return function(_0x2424d3){if(_0x2424d3){return _0x2424d3[_0x0d8e('0x21')](_0x151d8b)[_0x0d8e('0x22')](function(_0x344a30){return _0x344a30;});}return null;};}function removeEntity(_0x5db2e0,_0x20b866){return function(_0x435ca0){if(_0x435ca0){return _0x435ca0[_0x0d8e('0x23')]()['then'](function(){_0x5db2e0[_0x0d8e('0x1b')](0xcc)[_0x0d8e('0x17')]();});}};}function handleEntityNotFound(_0x49808f,_0x460b17){return function(_0x9acc62){if(!_0x9acc62){_0x49808f[_0x0d8e('0x16')](0x194);}return _0x9acc62;};}function handleError(_0x250a8b,_0x32e30b){_0x32e30b=_0x32e30b||0x1f4;return function(_0x4391a5){logger[_0x0d8e('0x24')](_0x4391a5[_0x0d8e('0x25')]);if(_0x4391a5[_0x0d8e('0x26')]){delete _0x4391a5[_0x0d8e('0x26')];}_0x250a8b[_0x0d8e('0x1b')](_0x32e30b)[_0x0d8e('0x27')](_0x4391a5);};}exports[_0x0d8e('0x28')]=function(_0x3f2563,_0x360d50){var _0x580df8={},_0x30a575={},_0x23e6e7={'count':0x0,'rows':[]};var _0x17417f=_[_0x0d8e('0x29')](db['MailTransferReport'][_0x0d8e('0x2a')],function(_0x34501e){return{'name':_0x34501e['fieldName'],'type':_0x34501e[_0x0d8e('0x2b')]['key']};});_0x30a575['model']=_['map'](_0x17417f,'name');_0x30a575[_0x0d8e('0x2c')]=_['keys'](_0x3f2563['query']);_0x30a575['filters']=_[_0x0d8e('0x2d')](_0x30a575[_0x0d8e('0x2e')],_0x30a575[_0x0d8e('0x2c')]);_0x580df8[_0x0d8e('0x2f')]=_['intersection'](_0x30a575[_0x0d8e('0x2e')],qs['fields'](_0x3f2563['query'][_0x0d8e('0x30')]));_0x580df8[_0x0d8e('0x2f')]=_0x580df8[_0x0d8e('0x2f')]['length']?_0x580df8['attributes']:_0x30a575[_0x0d8e('0x2e')];if(!_0x3f2563[_0x0d8e('0x2c')]['hasOwnProperty']('nolimit')){_0x580df8[_0x0d8e('0x1a')]=qs[_0x0d8e('0x1a')](_0x3f2563['query'][_0x0d8e('0x1a')]);_0x580df8['offset']=qs[_0x0d8e('0x18')](_0x3f2563[_0x0d8e('0x2c')][_0x0d8e('0x18')]);}_0x580df8[_0x0d8e('0x31')]=qs[_0x0d8e('0x32')](_0x3f2563['query'][_0x0d8e('0x32')]);_0x580df8[_0x0d8e('0x33')]=qs[_0x0d8e('0x34')](_['pick'](_0x3f2563['query'],_0x30a575[_0x0d8e('0x34')]),_0x17417f);if(_0x3f2563[_0x0d8e('0x2c')][_0x0d8e('0x35')]){_0x580df8[_0x0d8e('0x33')]=_[_0x0d8e('0x36')](_0x580df8[_0x0d8e('0x33')],{'$or':_[_0x0d8e('0x29')](_0x17417f,function(_0x557061){if(_0x557061[_0x0d8e('0x2b')]!==_0x0d8e('0x37')){var _0x3f1d35={};_0x3f1d35[_0x557061[_0x0d8e('0x26')]]={'$like':'%'+_0x3f2563[_0x0d8e('0x2c')][_0x0d8e('0x35')]+'%'};return _0x3f1d35;}})});}_0x580df8=_[_0x0d8e('0x36')]({},_0x580df8,_0x3f2563[_0x0d8e('0x38')]);var _0x53771d={'where':_0x580df8[_0x0d8e('0x33')]};return db['MailTransferReport'][_0x0d8e('0x19')](_0x53771d)[_0x0d8e('0x22')](function(_0x2b5deb){_0x23e6e7[_0x0d8e('0x19')]=_0x2b5deb;if(_0x3f2563['query'][_0x0d8e('0x39')]){_0x580df8[_0x0d8e('0x3a')]=[{'all':!![]}];}return db[_0x0d8e('0x3b')][_0x0d8e('0x3c')](_0x580df8);})[_0x0d8e('0x22')](function(_0x48b32e){_0x23e6e7[_0x0d8e('0x3d')]=_0x48b32e;return _0x23e6e7;})[_0x0d8e('0x22')](respondWithFilteredResult(_0x360d50,_0x580df8))[_0x0d8e('0x3e')](handleError(_0x360d50,null));};exports['show']=function(_0x3d205c,_0x5a46a9){var _0x5b73d2={'raw':!![],'where':{'id':_0x3d205c[_0x0d8e('0x3f')]['id']}},_0x3fa894={};_0x3fa894[_0x0d8e('0x2e')]=_[_0x0d8e('0x40')](db[_0x0d8e('0x3b')][_0x0d8e('0x2a')]);_0x3fa894[_0x0d8e('0x2c')]=_[_0x0d8e('0x40')](_0x3d205c['query']);_0x3fa894[_0x0d8e('0x34')]=_[_0x0d8e('0x2d')](_0x3fa894[_0x0d8e('0x2e')],_0x3fa894[_0x0d8e('0x2c')]);_0x5b73d2[_0x0d8e('0x2f')]=_['intersection'](_0x3fa894['model'],qs['fields'](_0x3d205c[_0x0d8e('0x2c')]['fields']));_0x5b73d2[_0x0d8e('0x2f')]=_0x5b73d2[_0x0d8e('0x2f')][_0x0d8e('0x41')]?_0x5b73d2[_0x0d8e('0x2f')]:_0x3fa894[_0x0d8e('0x2e')];if(_0x3d205c[_0x0d8e('0x2c')][_0x0d8e('0x39')]){_0x5b73d2[_0x0d8e('0x3a')]=[{'all':!![]}];}_0x5b73d2=_['merge']({},_0x5b73d2,_0x3d205c[_0x0d8e('0x38')]);return db[_0x0d8e('0x3b')][_0x0d8e('0x42')](_0x5b73d2)[_0x0d8e('0x22')](handleEntityNotFound(_0x5a46a9,null))[_0x0d8e('0x22')](respondWithResult(_0x5a46a9,null))['catch'](handleError(_0x5a46a9,null));};exports[_0x0d8e('0x43')]=function(_0x10c2ff,_0x6551d3){return db[_0x0d8e('0x3b')][_0x0d8e('0x43')](_0x10c2ff['body'],{})[_0x0d8e('0x22')](respondWithResult(_0x6551d3,0xc9))[_0x0d8e('0x3e')](handleError(_0x6551d3,null));};exports[_0x0d8e('0x21')]=function(_0x24a67c,_0x170d72){if(_0x24a67c[_0x0d8e('0x44')]['id']){delete _0x24a67c[_0x0d8e('0x44')]['id'];}return db[_0x0d8e('0x3b')][_0x0d8e('0x42')]({'where':{'id':_0x24a67c[_0x0d8e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x170d72,null))['then'](saveUpdates(_0x24a67c[_0x0d8e('0x44')],null))[_0x0d8e('0x22')](respondWithResult(_0x170d72,null))['catch'](handleError(_0x170d72,null));};exports['destroy']=function(_0x49efb2,_0x34c163){return db[_0x0d8e('0x3b')][_0x0d8e('0x42')]({'where':{'id':_0x49efb2['params']['id']}})['then'](handleEntityNotFound(_0x34c163,null))[_0x0d8e('0x22')](removeEntity(_0x34c163,null))[_0x0d8e('0x3e')](handleError(_0x34c163,null));};exports[_0x0d8e('0x45')]=function(_0x3b7650,_0x566b81){return db[_0x0d8e('0x3b')][_0x0d8e('0x45')]()[_0x0d8e('0x22')](respondWithResult(_0x566b81,null))[_0x0d8e('0x3e')](handleError(_0x566b81,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index fe50528..a8da3c1 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 _0xf7ed=['bluebird','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger','moment'];(function(_0x53e93b,_0x488a91){var _0x1a5985=function(_0x1c6c3c){while(--_0x1c6c3c){_0x53e93b['push'](_0x53e93b['shift']());}};_0x1a5985(++_0x488a91);}(_0xf7ed,0x1a1));var _0xdf7e=function(_0x33840e,_0x45b058){_0x33840e=_0x33840e-0x0;var _0x3bf4ec=_0xf7ed[_0x33840e];return _0x3bf4ec;};'use strict';var _=require('lodash');var util=require(_0xdf7e('0x0'));var logger=require(_0xdf7e('0x1'))('api');var moment=require(_0xdf7e('0x2'));var BPromise=require(_0xdf7e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf7e('0x4'));var rimraf=require(_0xdf7e('0x5'));var config=require('../../config/environment');var attributes=require(_0xdf7e('0x6'));module[_0xdf7e('0x7')]=function(_0x1c4f77,_0x51db33){return _0x1c4f77[_0xdf7e('0x8')](_0xdf7e('0x9'),attributes,{'tableName':_0xdf7e('0xa'),'paranoid':![],'indexes':[{'name':_0xdf7e('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc8e9=['path','rimraf','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger','api','request-promise'];(function(_0x178619,_0x35734e){var _0x2a71e9=function(_0x32ca77){while(--_0x32ca77){_0x178619['push'](_0x178619['shift']());}};_0x2a71e9(++_0x35734e);}(_0xc8e9,0x1f4));var _0x9c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9c8e('0x0'));var logger=require(_0x9c8e('0x1'))(_0x9c8e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9c8e('0x3'));var fs=require('fs');var path=require(_0x9c8e('0x4'));var rimraf=require(_0x9c8e('0x5'));var config=require(_0x9c8e('0x6'));var attributes=require('./mailTransferReport.attributes');module[_0x9c8e('0x7')]=function(_0x38c013,_0x241bea){return _0x38c013[_0x9c8e('0x8')](_0x9c8e('0x9'),attributes,{'tableName':_0x9c8e('0xa'),'paranoid':![],'indexes':[{'name':_0x9c8e('0xb'),'fields':[_0x9c8e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 4ec665d..bef2699 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 _0xeadf=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x1061c8,_0x2eb6a3){var _0x7f876d=function(_0x599dc3){while(--_0x599dc3){_0x1061c8['push'](_0x1061c8['shift']());}};_0x7f876d(++_0x2eb6a3);}(_0xeadf,0xa4));var _0xfead=function(_0x5ba513,_0x459c3b){_0x5ba513=_0x5ba513-0x0;var _0x1132a0=_0xeadf[_0x5ba513];return _0x1132a0;};'use strict';var _=require(_0xfead('0x0'));var util=require('util');var moment=require(_0xfead('0x1'));var BPromise=require(_0xfead('0x2'));var rs=require(_0xfead('0x3'));var fs=require('fs');var Redis=require(_0xfead('0x4'));var db=require(_0xfead('0x5'))['db'];var utils=require(_0xfead('0x6'));var logger=require(_0xfead('0x7'))(_0xfead('0x8'));var config=require('../../config/environment');var jayson=require(_0xfead('0x9'));var client=jayson['client'][_0xfead('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56afbf,_0x1d3aa7,_0x4eb17d){return new BPromise(function(_0x7faaa5,_0x50feef){return client[_0xfead('0xb')](_0x56afbf,_0x4eb17d)[_0xfead('0xc')](function(_0x310edc){logger['info'](_0xfead('0xd'),_0x1d3aa7,_0xfead('0xe'));logger[_0xfead('0xf')](_0xfead('0x10'),_0x1d3aa7,_0xfead('0xe'),JSON[_0xfead('0x11')](_0x310edc));if(_0x310edc[_0xfead('0x12')]){if(_0x310edc[_0xfead('0x12')][_0xfead('0x13')]===0x1f4){logger[_0xfead('0x12')](_0xfead('0xd'),_0x1d3aa7,_0x310edc[_0xfead('0x12')][_0xfead('0x14')]);return _0x50feef(_0x310edc[_0xfead('0x12')][_0xfead('0x14')]);}logger['error'](_0xfead('0xd'),_0x1d3aa7,_0x310edc['error']['message']);return _0x7faaa5(_0x310edc[_0xfead('0x12')]['message']);}else{logger[_0xfead('0x15')](_0xfead('0xd'),_0x1d3aa7,'request\x20sent');_0x7faaa5(_0x310edc[_0xfead('0x16')][_0xfead('0x14')]);}})[_0xfead('0x17')](function(_0x23d3ba){logger[_0xfead('0x12')](_0xfead('0xd'),_0x1d3aa7,_0x23d3ba);_0x50feef(_0x23d3ba);});});} \ No newline at end of file +var _0x92f8=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','client','request','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x20e622,_0x4d19c2){var _0x30aac2=function(_0x33fd70){while(--_0x33fd70){_0x20e622['push'](_0x20e622['shift']());}};_0x30aac2(++_0x4d19c2);}(_0x92f8,0x109));var _0x892f=function(_0x17b2f0,_0x1f6e62){_0x17b2f0=_0x17b2f0-0x0;var _0x42372a=_0x92f8[_0x17b2f0];return _0x42372a;};'use strict';var _=require(_0x892f('0x0'));var util=require(_0x892f('0x1'));var moment=require(_0x892f('0x2'));var BPromise=require(_0x892f('0x3'));var rs=require(_0x892f('0x4'));var fs=require('fs');var Redis=require(_0x892f('0x5'));var db=require(_0x892f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x892f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25cd9a,_0x370188,_0x3702b3){return new BPromise(function(_0x165bc4,_0x82fe60){return client[_0x892f('0x8')](_0x25cd9a,_0x3702b3)['then'](function(_0x5479d1){logger[_0x892f('0x9')](_0x892f('0xa'),_0x370188,'request\x20sent');logger[_0x892f('0xb')](_0x892f('0xc'),_0x370188,_0x892f('0xd'),JSON[_0x892f('0xe')](_0x5479d1));if(_0x5479d1['error']){if(_0x5479d1[_0x892f('0xf')][_0x892f('0x10')]===0x1f4){logger[_0x892f('0xf')](_0x892f('0xa'),_0x370188,_0x5479d1[_0x892f('0xf')]['message']);return _0x82fe60(_0x5479d1[_0x892f('0xf')]['message']);}logger['error'](_0x892f('0xa'),_0x370188,_0x5479d1[_0x892f('0xf')][_0x892f('0x11')]);return _0x165bc4(_0x5479d1['error'][_0x892f('0x11')]);}else{logger[_0x892f('0x9')](_0x892f('0xa'),_0x370188,_0x892f('0xd'));_0x165bc4(_0x5479d1['result'][_0x892f('0x11')]);}})[_0x892f('0x12')](function(_0x47c1b4){logger['error'](_0x892f('0xa'),_0x370188,_0x47c1b4);_0x82fe60(_0x47c1b4);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 16ae2de..118adf4 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 _0xaabd=['index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get'];(function(_0x467cb0,_0x303070){var _0x2153f7=function(_0x51775a){while(--_0x51775a){_0x467cb0['push'](_0x467cb0['shift']());}};_0x2153f7(++_0x303070);}(_0xaabd,0x1c1));var _0xdaab=function(_0x56213b,_0x20a174){_0x56213b=_0x56213b-0x0;var _0x1d74be=_0xaabd[_0x56213b];return _0x1d74be;};'use strict';var multer=require(_0xdaab('0x0'));var util=require(_0xdaab('0x1'));var path=require(_0xdaab('0x2'));var timeout=require(_0xdaab('0x3'));var express=require(_0xdaab('0x4'));var router=express[_0xdaab('0x5')]();var fs_extra=require(_0xdaab('0x6'));var auth=require(_0xdaab('0x7'));var interaction=require(_0xdaab('0x8'));var config=require('../../config/environment');var controller=require(_0xdaab('0x9'));router[_0xdaab('0xa')]('/',auth['isAuthenticated'](),controller[_0xdaab('0xb')]);router[_0xdaab('0xa')](_0xdaab('0xc'),auth[_0xdaab('0xd')](),controller['describe']);router[_0xdaab('0xa')]('/:id',auth[_0xdaab('0xd')](),controller[_0xdaab('0xe')]);router[_0xdaab('0xf')]('/',auth[_0xdaab('0xd')](),controller[_0xdaab('0x10')]);router[_0xdaab('0x11')](_0xdaab('0x12'),auth['isAuthenticated'](),controller[_0xdaab('0x13')]);router[_0xdaab('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xdaab('0x15')]);module[_0xdaab('0x16')]=router; \ No newline at end of file +var _0xca58=['create','put','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','index','isAuthenticated','describe','/:id','show'];(function(_0x3de63e,_0x2e80fd){var _0x1d25ef=function(_0x3e53f6){while(--_0x3e53f6){_0x3de63e['push'](_0x3de63e['shift']());}};_0x1d25ef(++_0x2e80fd);}(_0xca58,0x1b5));var _0x8ca5=function(_0x55c91d,_0x5802b5){_0x55c91d=_0x55c91d-0x0;var _0x50e614=_0xca58[_0x55c91d];return _0x50e614;};'use strict';var multer=require('multer');var util=require(_0x8ca5('0x0'));var path=require(_0x8ca5('0x1'));var timeout=require(_0x8ca5('0x2'));var express=require(_0x8ca5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8ca5('0x4'));var interaction=require(_0x8ca5('0x5'));var config=require('../../config/environment');var controller=require(_0x8ca5('0x6'));router[_0x8ca5('0x7')]('/',auth['isAuthenticated'](),controller[_0x8ca5('0x8')]);router['get']('/describe',auth[_0x8ca5('0x9')](),controller[_0x8ca5('0xa')]);router[_0x8ca5('0x7')](_0x8ca5('0xb'),auth['isAuthenticated'](),controller[_0x8ca5('0xc')]);router['post']('/',auth[_0x8ca5('0x9')](),controller[_0x8ca5('0xd')]);router[_0x8ca5('0xe')](_0x8ca5('0xb'),auth[_0x8ca5('0x9')](),controller['update']);router[_0x8ca5('0xf')](_0x8ca5('0xb'),auth[_0x8ca5('0x9')](),controller[_0x8ca5('0x10')]);module[_0x8ca5('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 4bcfbda..5ca1645 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 _0x0dae=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize'];(function(_0x215f22,_0x208e27){var _0xab09fe=function(_0x13deae){while(--_0x13deae){_0x215f22['push'](_0x215f22['shift']());}};_0xab09fe(++_0x208e27);}(_0x0dae,0x18e));var _0xe0da=function(_0xb60ae4,_0x48b458){_0xb60ae4=_0xb60ae4-0x0;var _0x53d530=_0x0dae[_0xb60ae4];return _0x53d530;};'use strict';var Sequelize=require(_0xe0da('0x0'));var moment=require('moment');module[_0xe0da('0x1')]={'channel':{'type':Sequelize[_0xe0da('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xe0da('0x2')]},'type':{'type':Sequelize[_0xe0da('0x2')],'defaultValue':_0xe0da('0x3'),'comment':_0xe0da('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xe0da('0x5')]},'exitAt':{'type':Sequelize[_0xe0da('0x5')],'set':function(_0x1a5cd2){var _0x4cbc80=moment(_0x1a5cd2);var _0x149e9a=moment(this[_0xe0da('0x6')](_0xe0da('0x7')));var _0x4fbde7=_0x4cbc80[_0xe0da('0x8')](_0x149e9a,_0xe0da('0x9'));this[_0xe0da('0xa')](_0xe0da('0xb'),_0x1a5cd2);this['setDataValue'](_0xe0da('0xc'),_0x4fbde7>=0x0?_0x4fbde7:null);}},'data1':{'type':Sequelize[_0xe0da('0x2')],'comment':_0xe0da('0xd')},'data2':{'type':Sequelize[_0xe0da('0x2')],'comment':_0xe0da('0xe')},'data3':{'type':Sequelize[_0xe0da('0x2')],'comment':_0xe0da('0xf')},'data4':{'type':Sequelize['STRING'],'comment':_0xe0da('0x10')},'data5':{'type':Sequelize[_0xe0da('0x2')],'comment':_0xe0da('0x11')},'role':{'type':Sequelize[_0xe0da('0x2')]},'internal':{'type':Sequelize[_0xe0da('0x12')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xacfe=['setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','exitAt'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xacfe,0xe4));var _0xeacf=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xacfe[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require(_0xeacf('0x0'));var moment=require(_0xeacf('0x1'));module['exports']={'channel':{'type':Sequelize[_0xeacf('0x2')]},'membername':{'type':Sequelize[_0xeacf('0x2')]},'interface':{'type':Sequelize[_0xeacf('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xeacf('0x3'),'comment':_0xeacf('0x4')},'duration':{'type':Sequelize[_0xeacf('0x5')]},'enterAt':{'type':Sequelize[_0xeacf('0x6')]},'exitAt':{'type':Sequelize[_0xeacf('0x6')],'set':function(_0x2d441b){var _0x33edb4=moment(_0x2d441b);var _0x387e7f=moment(this[_0xeacf('0x7')](_0xeacf('0x8')));var _0x4783dd=_0x33edb4[_0xeacf('0x9')](_0x387e7f,_0xeacf('0xa'));this['setDataValue'](_0xeacf('0xb'),_0x2d441b);this[_0xeacf('0xc')]('duration',_0x4783dd>=0x0?_0x4783dd:null);}},'data1':{'type':Sequelize[_0xeacf('0x2')],'comment':_0xeacf('0xd')},'data2':{'type':Sequelize[_0xeacf('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xeacf('0x2')],'comment':_0xeacf('0xe')},'data4':{'type':Sequelize[_0xeacf('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0xeacf('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xeacf('0x5')]},'uniqueid':{'type':Sequelize[_0xeacf('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 2dd4ee0..e1183e0 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(_0xf1a005,_0x361fee){var _0x5313f6=function(_0x3753f8){while(--_0x3753f8){_0xf1a005['push'](_0xf1a005['shift']());}};_0x5313f6(++_0x361fee);}(_0x008c,0x188));var _0xc008=function(_0x50c7e5,_0x380f0f){_0x50c7e5=_0x50c7e5-0x0;var _0x108f56=_0x008c[_0x50c7e5];return _0x108f56;};'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 _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x26df3e,_0x597419){var _0x259f32=function(_0x1167e5){while(--_0x1167e5){_0x26df3e['push'](_0x26df3e['shift']());}};_0x259f32(++_0x597419);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index ea0f32b..80b4e8e 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 _0x2171=['api','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername','interface','util','../../config/logger'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0x2171,0x143));var _0x1217=function(_0xee8ecf,_0x428de6){_0xee8ecf=_0xee8ecf-0x0;var _0x1884c4=_0x2171[_0xee8ecf];return _0x1884c4;};'use strict';var _=require('lodash');var util=require(_0x1217('0x0'));var logger=require(_0x1217('0x1'))(_0x1217('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1217('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1217('0x4'));var config=require(_0x1217('0x5'));var attributes=require(_0x1217('0x6'));module[_0x1217('0x7')]=function(_0x4eb644,_0xafdf42){return _0x4eb644[_0x1217('0x8')](_0x1217('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x1217('0xa'),'fields':[_0x1217('0xb'),_0x1217('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf1d6=['../../config/logger','api','moment','request-promise','path','rimraf','define','MemberReport','report_member','lodash','util'];(function(_0x2f88bf,_0x761a0e){var _0x1b451e=function(_0x1116fa){while(--_0x1116fa){_0x2f88bf['push'](_0x2f88bf['shift']());}};_0x1b451e(++_0x761a0e);}(_0xf1d6,0x195));var _0x6f1d=function(_0x349a13,_0x3cd835){_0x349a13=_0x349a13-0x0;var _0x47ddc0=_0xf1d6[_0x349a13];return _0x47ddc0;};'use strict';var _=require(_0x6f1d('0x0'));var util=require(_0x6f1d('0x1'));var logger=require(_0x6f1d('0x2'))(_0x6f1d('0x3'));var moment=require(_0x6f1d('0x4'));var BPromise=require('bluebird');var rp=require(_0x6f1d('0x5'));var fs=require('fs');var path=require(_0x6f1d('0x6'));var rimraf=require(_0x6f1d('0x7'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module['exports']=function(_0x309bb7,_0x3c52ec){return _0x309bb7[_0x6f1d('0x8')](_0x6f1d('0x9'),attributes,{'tableName':_0x6f1d('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index fa7a8e3..93df07f 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 _0x6b4e=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','MemberReport,\x20%s,\x20%s','message','result','catch','MemberReport','options','raw','where','limit','include','map','model','attributes','GetMemberReport','CreateMemberReport','body','stringify','update','UpdateMemberReport','util','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x37c987,_0x437c1f){_0x37c987=_0x37c987-0x0;var _0x26c65a=_0x6b4e[_0x37c987];return _0x26c65a;};'use strict';var _=require('lodash');var util=require(_0xe6b4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe6b4('0x1'))['db'];var utils=require(_0xe6b4('0x2'));var logger=require(_0xe6b4('0x3'))(_0xe6b4('0x4'));var config=require(_0xe6b4('0x5'));var jayson=require(_0xe6b4('0x6'));var client=jayson['client'][_0xe6b4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3458d8,_0x3391b9,_0x1d062b){return new BPromise(function(_0x15cf31,_0x3e5506){return client[_0xe6b4('0x8')](_0x3458d8,_0x1d062b)[_0xe6b4('0x9')](function(_0x461f53){logger[_0xe6b4('0xa')]('MemberReport,\x20%s,\x20%s',_0x3391b9,_0xe6b4('0xb'));logger[_0xe6b4('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x3391b9,'request\x20sent',JSON['stringify'](_0x461f53));if(_0x461f53[_0xe6b4('0xd')]){if(_0x461f53[_0xe6b4('0xd')]['code']===0x1f4){logger[_0xe6b4('0xd')](_0xe6b4('0xe'),_0x3391b9,_0x461f53[_0xe6b4('0xd')][_0xe6b4('0xf')]);return _0x3e5506(_0x461f53[_0xe6b4('0xd')]['message']);}logger[_0xe6b4('0xd')](_0xe6b4('0xe'),_0x3391b9,_0x461f53[_0xe6b4('0xd')][_0xe6b4('0xf')]);return _0x15cf31(_0x461f53['error'][_0xe6b4('0xf')]);}else{logger[_0xe6b4('0xa')](_0xe6b4('0xe'),_0x3391b9,_0xe6b4('0xb'));_0x15cf31(_0x461f53[_0xe6b4('0x10')]['message']);}})[_0xe6b4('0x11')](function(_0x2c9335){logger[_0xe6b4('0xd')]('MemberReport,\x20%s,\x20%s',_0x3391b9,_0x2c9335);_0x3e5506(_0x2c9335);});});}exports['GetMemberReport']=function(_0x5e77f2){var _0x3b5ce6=this;return new Promise(function(_0x5877c1,_0x529858){return db[_0xe6b4('0x12')]['findAll']({'raw':_0x5e77f2[_0xe6b4('0x13')]?_0x5e77f2[_0xe6b4('0x13')][_0xe6b4('0x14')]===undefined?!![]:![]:!![],'where':_0x5e77f2[_0xe6b4('0x13')]?_0x5e77f2[_0xe6b4('0x13')][_0xe6b4('0x15')]||null:null,'attributes':_0x5e77f2[_0xe6b4('0x13')]?_0x5e77f2[_0xe6b4('0x13')]['attributes']||null:null,'limit':_0x5e77f2[_0xe6b4('0x13')]?_0x5e77f2['options'][_0xe6b4('0x16')]||null:null,'include':_0x5e77f2[_0xe6b4('0x13')]?_0x5e77f2[_0xe6b4('0x13')][_0xe6b4('0x17')]?_[_0xe6b4('0x18')](_0x5e77f2['options']['include'],function(_0x52ee39){return{'model':db[_0x52ee39[_0xe6b4('0x19')]],'as':_0x52ee39['as'],'attributes':_0x52ee39['attributes'],'include':_0x52ee39[_0xe6b4('0x17')]?_[_0xe6b4('0x18')](_0x52ee39[_0xe6b4('0x17')],function(_0x28bfef){return{'model':db[_0x28bfef['model']],'as':_0x28bfef['as'],'attributes':_0x28bfef[_0xe6b4('0x1a')],'include':_0x28bfef[_0xe6b4('0x17')]?_[_0xe6b4('0x18')](_0x28bfef['include'],function(_0x45a397){return{'model':db[_0x45a397['model']],'as':_0x45a397['as'],'attributes':_0x45a397[_0xe6b4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe6b4('0x9')](function(_0x5a4e25){logger[_0xe6b4('0xa')](_0xe6b4('0x1b'),_0x5e77f2);logger[_0xe6b4('0xc')]('GetMemberReport',_0x5e77f2,JSON['stringify'](_0x5a4e25));_0x5877c1(_0x5a4e25);})[_0xe6b4('0x11')](function(_0x223239){logger[_0xe6b4('0xd')](_0xe6b4('0x1b'),_0x223239[_0xe6b4('0xf')],_0x5e77f2);_0x529858(_0x3b5ce6[_0xe6b4('0xd')](0x1f4,_0x223239[_0xe6b4('0xf')]));});});};exports[_0xe6b4('0x1c')]=function(_0x42f875){var _0x56a91e=this;return new Promise(function(_0x4f2c58,_0x1e236b){return db[_0xe6b4('0x12')]['create'](_0x42f875[_0xe6b4('0x1d')],{'raw':_0x42f875[_0xe6b4('0x13')]?_0x42f875[_0xe6b4('0x13')]['raw']===undefined?!![]:![]:!![]})[_0xe6b4('0x9')](function(_0x3a9c18){logger[_0xe6b4('0xa')](_0xe6b4('0x1c'),_0x42f875);logger[_0xe6b4('0xc')](_0xe6b4('0x1c'),_0x42f875,JSON[_0xe6b4('0x1e')](_0x3a9c18));_0x4f2c58(_0x3a9c18);})['catch'](function(_0x195cb1){logger[_0xe6b4('0xd')](_0xe6b4('0x1c'),_0x195cb1['message'],_0x42f875);_0x1e236b(_0x56a91e[_0xe6b4('0xd')](0x1f4,_0x195cb1[_0xe6b4('0xf')]));});});};exports['UpdateMemberReport']=function(_0x28e3a8){var _0x425b84=this;return new Promise(function(_0x2b846a,_0x46ea16){return db['MemberReport'][_0xe6b4('0x1f')](_0x28e3a8[_0xe6b4('0x1d')],{'raw':_0x28e3a8[_0xe6b4('0x13')]?_0x28e3a8['options'][_0xe6b4('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28e3a8['options']?_0x28e3a8[_0xe6b4('0x13')]['where']||null:null,'attributes':_0x28e3a8['options']?_0x28e3a8[_0xe6b4('0x13')][_0xe6b4('0x1a')]||null:null,'limit':_0x28e3a8[_0xe6b4('0x13')]?_0x28e3a8['options'][_0xe6b4('0x16')]||null:null})[_0xe6b4('0x9')](function(_0x417787){logger[_0xe6b4('0xa')](_0xe6b4('0x20'),_0x28e3a8);logger[_0xe6b4('0xc')](_0xe6b4('0x20'),_0x28e3a8,JSON[_0xe6b4('0x1e')](_0x417787));_0x2b846a(_0x417787);})[_0xe6b4('0x11')](function(_0x54a545){logger[_0xe6b4('0xd')]('UpdateMemberReport',_0x54a545['message'],_0x28e3a8);_0x46ea16(_0x425b84[_0xe6b4('0xd')](0x1f4,_0x54a545[_0xe6b4('0xf')]));});});}; \ No newline at end of file +var _0xa49e=['map','model','then','info','catch','CreateMemberReport','UpdateMemberReport','update','body','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','GetMemberReport','MemberReport','findAll','options','where','attributes','include'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xa49e,0x1de));var _0xea49=function(_0x17d82f,_0x5d9172){_0x17d82f=_0x17d82f-0x0;var _0x58137b=_0xa49e[_0x17d82f];return _0x58137b;};'use strict';var _=require(_0xea49('0x0'));var util=require(_0xea49('0x1'));var moment=require(_0xea49('0x2'));var BPromise=require(_0xea49('0x3'));var rs=require(_0xea49('0x4'));var fs=require('fs');var Redis=require(_0xea49('0x5'));var db=require(_0xea49('0x6'))['db'];var utils=require(_0xea49('0x7'));var logger=require('../../config/logger')(_0xea49('0x8'));var config=require(_0xea49('0x9'));var jayson=require(_0xea49('0xa'));var client=jayson['client'][_0xea49('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x184e00,_0xc682a,_0x35c89e){return new BPromise(function(_0x304770,_0x4d4dee){return client[_0xea49('0xc')](_0x184e00,_0x35c89e)['then'](function(_0x1ab756){logger['info']('MemberReport,\x20%s,\x20%s',_0xc682a,'request\x20sent');logger[_0xea49('0xd')](_0xea49('0xe'),_0xc682a,_0xea49('0xf'),JSON[_0xea49('0x10')](_0x1ab756));if(_0x1ab756[_0xea49('0x11')]){if(_0x1ab756[_0xea49('0x11')][_0xea49('0x12')]===0x1f4){logger[_0xea49('0x11')](_0xea49('0x13'),_0xc682a,_0x1ab756[_0xea49('0x11')][_0xea49('0x14')]);return _0x4d4dee(_0x1ab756['error'][_0xea49('0x14')]);}logger[_0xea49('0x11')](_0xea49('0x13'),_0xc682a,_0x1ab756[_0xea49('0x11')]['message']);return _0x304770(_0x1ab756[_0xea49('0x11')][_0xea49('0x14')]);}else{logger['info'](_0xea49('0x13'),_0xc682a,_0xea49('0xf'));_0x304770(_0x1ab756[_0xea49('0x15')][_0xea49('0x14')]);}})['catch'](function(_0x538efa){logger[_0xea49('0x11')]('MemberReport,\x20%s,\x20%s',_0xc682a,_0x538efa);_0x4d4dee(_0x538efa);});});}exports[_0xea49('0x16')]=function(_0x2010a0){var _0x27d0a2=this;return new Promise(function(_0x5f2984,_0x2f0bf6){return db[_0xea49('0x17')][_0xea49('0x18')]({'raw':_0x2010a0['options']?_0x2010a0[_0xea49('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2010a0[_0xea49('0x19')]?_0x2010a0[_0xea49('0x19')][_0xea49('0x1a')]||null:null,'attributes':_0x2010a0[_0xea49('0x19')]?_0x2010a0[_0xea49('0x19')][_0xea49('0x1b')]||null:null,'limit':_0x2010a0[_0xea49('0x19')]?_0x2010a0[_0xea49('0x19')]['limit']||null:null,'include':_0x2010a0[_0xea49('0x19')]?_0x2010a0['options'][_0xea49('0x1c')]?_[_0xea49('0x1d')](_0x2010a0[_0xea49('0x19')][_0xea49('0x1c')],function(_0x20c832){return{'model':db[_0x20c832['model']],'as':_0x20c832['as'],'attributes':_0x20c832[_0xea49('0x1b')],'include':_0x20c832[_0xea49('0x1c')]?_[_0xea49('0x1d')](_0x20c832[_0xea49('0x1c')],function(_0xb13981){return{'model':db[_0xb13981['model']],'as':_0xb13981['as'],'attributes':_0xb13981[_0xea49('0x1b')],'include':_0xb13981[_0xea49('0x1c')]?_[_0xea49('0x1d')](_0xb13981[_0xea49('0x1c')],function(_0x48deb4){return{'model':db[_0x48deb4[_0xea49('0x1e')]],'as':_0x48deb4['as'],'attributes':_0x48deb4[_0xea49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xea49('0x1f')](function(_0x180d2b){logger[_0xea49('0x20')]('GetMemberReport',_0x2010a0);logger[_0xea49('0xd')](_0xea49('0x16'),_0x2010a0,JSON[_0xea49('0x10')](_0x180d2b));_0x5f2984(_0x180d2b);})[_0xea49('0x21')](function(_0x1ed0d4){logger[_0xea49('0x11')](_0xea49('0x16'),_0x1ed0d4[_0xea49('0x14')],_0x2010a0);_0x2f0bf6(_0x27d0a2[_0xea49('0x11')](0x1f4,_0x1ed0d4['message']));});});};exports['CreateMemberReport']=function(_0x1e63a2){var _0x268266=this;return new Promise(function(_0x9d2618,_0x56d69c){return db[_0xea49('0x17')]['create'](_0x1e63a2['body'],{'raw':_0x1e63a2[_0xea49('0x19')]?_0x1e63a2[_0xea49('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xea49('0x1f')](function(_0x4cd235){logger[_0xea49('0x20')](_0xea49('0x22'),_0x1e63a2);logger[_0xea49('0xd')]('CreateMemberReport',_0x1e63a2,JSON[_0xea49('0x10')](_0x4cd235));_0x9d2618(_0x4cd235);})[_0xea49('0x21')](function(_0x3cf9cc){logger[_0xea49('0x11')](_0xea49('0x22'),_0x3cf9cc[_0xea49('0x14')],_0x1e63a2);_0x56d69c(_0x268266[_0xea49('0x11')](0x1f4,_0x3cf9cc[_0xea49('0x14')]));});});};exports[_0xea49('0x23')]=function(_0x502026){var _0x2c3fef=this;return new Promise(function(_0x40bbeb,_0x23ab88){return db['MemberReport'][_0xea49('0x24')](_0x502026[_0xea49('0x25')],{'raw':_0x502026[_0xea49('0x19')]?_0x502026[_0xea49('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x502026[_0xea49('0x19')]?_0x502026[_0xea49('0x19')][_0xea49('0x1a')]||null:null,'attributes':_0x502026[_0xea49('0x19')]?_0x502026[_0xea49('0x19')][_0xea49('0x1b')]||null:null,'limit':_0x502026[_0xea49('0x19')]?_0x502026[_0xea49('0x19')][_0xea49('0x26')]||null:null})[_0xea49('0x1f')](function(_0x273a58){logger[_0xea49('0x20')](_0xea49('0x23'),_0x502026);logger['debug']('UpdateMemberReport',_0x502026,JSON[_0xea49('0x10')](_0x273a58));_0x40bbeb(_0x273a58);})[_0xea49('0x21')](function(_0x487c31){logger[_0xea49('0x11')](_0xea49('0x23'),_0x487c31['message'],_0x502026);_0x23ab88(_0x2c3fef['error'](0x1f4,_0x487c31['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 2cad589..4c1e7fc 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 _0xe0bf=['../../components/auth/service','../../config/environment','get','index','exports','util','connect-timeout','express','Router'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xe0bf,0xa7));var _0xfe0b=function(_0x18222c,_0x30fcd9){_0x18222c=_0x18222c-0x0;var _0x50bdab=_0xe0bf[_0x18222c];return _0x50bdab;};'use strict';var multer=require('multer');var util=require(_0xfe0b('0x0'));var path=require('path');var timeout=require(_0xfe0b('0x1'));var express=require(_0xfe0b('0x2'));var router=express[_0xfe0b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfe0b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfe0b('0x5'));var controller=require('./migration.controller');router[_0xfe0b('0x6')]('/',controller[_0xfe0b('0x7')]);module[_0xfe0b('0x8')]=router; \ No newline at end of file +var _0xad1a=['get','index','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller'];(function(_0x445261,_0x320105){var _0xec00a2=function(_0x324634){while(--_0x324634){_0x445261['push'](_0x445261['shift']());}};_0xec00a2(++_0x320105);}(_0xad1a,0xff));var _0xaad1=function(_0x39f83e,_0x2d1370){_0x39f83e=_0x39f83e-0x0;var _0x8fe9ad=_0xad1a[_0x39f83e];return _0x8fe9ad;};'use strict';var multer=require(_0xaad1('0x0'));var util=require(_0xaad1('0x1'));var path=require(_0xaad1('0x2'));var timeout=require(_0xaad1('0x3'));var express=require(_0xaad1('0x4'));var router=express[_0xaad1('0x5')]();var fs_extra=require(_0xaad1('0x6'));var auth=require(_0xaad1('0x7'));var interaction=require(_0xaad1('0x8'));var config=require(_0xaad1('0x9'));var controller=require(_0xaad1('0xa'));router[_0xaad1('0xb')]('/',controller[_0xaad1('0xc')]);module[_0xaad1('0xd')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 902482b..5fa4739 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 _0x1816=['exports','STRING','version','sequelize'];(function(_0x134836,_0x2da340){var _0x2bef16=function(_0x3579ad){while(--_0x3579ad){_0x134836['push'](_0x134836['shift']());}};_0x2bef16(++_0x2da340);}(_0x1816,0x1ab));var _0x6181=function(_0x220759,_0x3d2209){_0x220759=_0x220759-0x0;var _0x5b6439=_0x1816[_0x220759];return _0x5b6439;};'use strict';var Sequelize=require(_0x6181('0x0'));module[_0x6181('0x1')]={'version':{'type':Sequelize[_0x6181('0x2')],'unique':_0x6181('0x3')}}; \ No newline at end of file +var _0x7802=['STRING','version'];(function(_0x779c76,_0x2a1f6e){var _0x5de701=function(_0x13b41e){while(--_0x13b41e){_0x779c76['push'](_0x779c76['shift']());}};_0x5de701(++_0x2a1f6e);}(_0x7802,0x104));var _0x2780=function(_0x31df6f,_0x380e73){_0x31df6f=_0x31df6f-0x0;var _0x31e353=_0x7802[_0x31df6f];return _0x31e353;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0x2780('0x0')],'unique':_0x2780('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 70f0e65..870e684 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 _0x3516=['VIRTUAL','Migration','includeAll','include','rows','catch','zip-dir','request-promise','bluebird','mustache','util','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','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3516,0x192));var _0x6351=function(_0x5a4960,_0x36e10b){_0x5a4960=_0x5a4960-0x0;var _0x59a7a8=_0x3516[_0x5a4960];return _0x59a7a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6351('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6351('0x1'));var moment=require('moment');var BPromise=require(_0x6351('0x2'));var Mustache=require(_0x6351('0x3'));var util=require(_0x6351('0x4'));var path=require('path');var sox=require(_0x6351('0x5'));var csv=require(_0x6351('0x6'));var ejs=require(_0x6351('0x7'));var fs=require('fs');var fs_extra=require(_0x6351('0x8'));var _=require(_0x6351('0x9'));var squel=require(_0x6351('0xa'));var crypto=require(_0x6351('0xb'));var jsforce=require(_0x6351('0xc'));var deskjs=require(_0x6351('0xd'));var toCsv=require(_0x6351('0x6'));var querystring=require(_0x6351('0xe'));var Papa=require(_0x6351('0xf'));var Redis=require(_0x6351('0x10'));var authService=require(_0x6351('0x11'));var qs=require(_0x6351('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6351('0x13'));var logger=require(_0x6351('0x14'))(_0x6351('0x15'));var utils=require(_0x6351('0x16'));var config=require(_0x6351('0x17'));var licenseUtil=require(_0x6351('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x436b29,_0x4f3267){_0x4f3267=_0x4f3267||0xcc;return function(_0xea9e6c){if(_0xea9e6c){return _0x436b29[_0x6351('0x19')](_0x4f3267);}return _0x436b29[_0x6351('0x1a')](_0x4f3267)[_0x6351('0x1b')]();};}function respondWithResult(_0xc9fe39,_0x156761){_0x156761=_0x156761||0xc8;return function(_0x5b6025){if(_0x5b6025){return _0xc9fe39[_0x6351('0x1a')](_0x156761)[_0x6351('0x1c')](_0x5b6025);}};}function respondWithFilteredResult(_0xfea6e8,_0x3d656c){return function(_0x4d2eff){if(_0x4d2eff){var _0x216b10=typeof _0x3d656c['offset']===_0x6351('0x1d')&&typeof _0x3d656c[_0x6351('0x1e')]===_0x6351('0x1d');var _0x4542d7=_0x4d2eff[_0x6351('0x1f')];var _0x400af5=_0x216b10?0x0:_0x3d656c[_0x6351('0x20')];var _0x4735fe=_0x216b10?_0x4d2eff['count']:_0x3d656c[_0x6351('0x20')]+_0x3d656c[_0x6351('0x1e')];var _0x2d786f;if(_0x4735fe>=_0x4542d7){_0x4735fe=_0x4542d7;_0x2d786f=0xc8;}else{_0x2d786f=0xce;}_0xfea6e8[_0x6351('0x1a')](_0x2d786f);return _0xfea6e8[_0x6351('0x21')](_0x6351('0x22'),_0x400af5+'-'+_0x4735fe+'/'+_0x4542d7)[_0x6351('0x1c')](_0x4d2eff);}return null;};}function patchUpdates(_0x152896){return function(_0x22b634){try{jsonpatch[_0x6351('0x23')](_0x22b634,_0x152896,!![]);}catch(_0x24cb02){return BPromise['reject'](_0x24cb02);}return _0x22b634['save']();};}function saveUpdates(_0x313eb0,_0x359d4a){return function(_0x3c8e1a){if(_0x3c8e1a){return _0x3c8e1a[_0x6351('0x24')](_0x313eb0)[_0x6351('0x25')](function(_0x4a7cd8){return _0x4a7cd8;});}return null;};}function removeEntity(_0x50298e,_0x4637b5){return function(_0x5cd02d){if(_0x5cd02d){return _0x5cd02d[_0x6351('0x26')]()['then'](function(){_0x50298e[_0x6351('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ec370,_0x212ec1){return function(_0x2c6367){if(!_0x2c6367){_0x4ec370[_0x6351('0x19')](0x194);}return _0x2c6367;};}function handleError(_0x441586,_0x44dc0e){_0x44dc0e=_0x44dc0e||0x1f4;return function(_0x317b6b){logger['error'](_0x317b6b[_0x6351('0x27')]);if(_0x317b6b[_0x6351('0x28')]){delete _0x317b6b[_0x6351('0x28')];}_0x441586[_0x6351('0x1a')](_0x44dc0e)['send'](_0x317b6b);};}exports[_0x6351('0x29')]=function(_0x8f5ca1,_0x491315){var _0x9260cd={},_0x413fcf={},_0x2e6887={'count':0x0,'rows':[]};var _0x41a7a3=_[_0x6351('0x2a')](db['Migration'][_0x6351('0x2b')],function(_0xaf8492){return{'name':_0xaf8492[_0x6351('0x2c')],'type':_0xaf8492[_0x6351('0x2d')][_0x6351('0x2e')]};});_0x413fcf[_0x6351('0x2f')]=_[_0x6351('0x2a')](_0x41a7a3,_0x6351('0x28'));_0x413fcf[_0x6351('0x30')]=_['keys'](_0x8f5ca1[_0x6351('0x30')]);_0x413fcf[_0x6351('0x31')]=_[_0x6351('0x32')](_0x413fcf['model'],_0x413fcf['query']);_0x9260cd['attributes']=_[_0x6351('0x32')](_0x413fcf[_0x6351('0x2f')],qs[_0x6351('0x33')](_0x8f5ca1[_0x6351('0x30')][_0x6351('0x33')]));_0x9260cd[_0x6351('0x34')]=_0x9260cd[_0x6351('0x34')]['length']?_0x9260cd[_0x6351('0x34')]:_0x413fcf['model'];if(!_0x8f5ca1[_0x6351('0x30')][_0x6351('0x35')]('nolimit')){_0x9260cd[_0x6351('0x1e')]=qs['limit'](_0x8f5ca1[_0x6351('0x30')][_0x6351('0x1e')]);_0x9260cd[_0x6351('0x20')]=qs[_0x6351('0x20')](_0x8f5ca1[_0x6351('0x30')][_0x6351('0x20')]);}_0x9260cd[_0x6351('0x36')]=qs[_0x6351('0x37')](_0x8f5ca1[_0x6351('0x30')][_0x6351('0x37')]);_0x9260cd[_0x6351('0x38')]=qs[_0x6351('0x31')](_[_0x6351('0x39')](_0x8f5ca1[_0x6351('0x30')],_0x413fcf[_0x6351('0x31')]),_0x41a7a3);if(_0x8f5ca1[_0x6351('0x30')][_0x6351('0x3a')]){_0x9260cd[_0x6351('0x38')]=_[_0x6351('0x3b')](_0x9260cd['where'],{'$or':_['map'](_0x41a7a3,function(_0x5ea7a9){if(_0x5ea7a9['type']!==_0x6351('0x3c')){var _0x28df48={};_0x28df48[_0x5ea7a9['name']]={'$like':'%'+_0x8f5ca1['query'][_0x6351('0x3a')]+'%'};return _0x28df48;}})});}_0x9260cd=_[_0x6351('0x3b')]({},_0x9260cd,_0x8f5ca1['options']);var _0x272658={'where':_0x9260cd[_0x6351('0x38')]};return db[_0x6351('0x3d')]['count'](_0x272658)[_0x6351('0x25')](function(_0x16544c){_0x2e6887['count']=_0x16544c;if(_0x8f5ca1[_0x6351('0x30')][_0x6351('0x3e')]){_0x9260cd[_0x6351('0x3f')]=[{'all':!![]}];}return db[_0x6351('0x3d')]['findAll'](_0x9260cd);})['then'](function(_0x235d35){_0x2e6887[_0x6351('0x40')]=_0x235d35;return _0x2e6887;})[_0x6351('0x25')](respondWithFilteredResult(_0x491315,_0x9260cd))[_0x6351('0x41')](handleError(_0x491315,null));}; \ No newline at end of file +var _0xadbe=['options','Migration','includeAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','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','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0xfdedff,_0x959e24){var _0x429de9=function(_0x35f439){while(--_0x35f439){_0xfdedff['push'](_0xfdedff['shift']());}};_0x429de9(++_0x959e24);}(_0xadbe,0x1af));var _0xeadb=function(_0x1b0111,_0x27aa91){_0x1b0111=_0x1b0111-0x0;var _0x3ed76f=_0xadbe[_0x1b0111];return _0x3ed76f;};'use strict';var emlformat=require(_0xeadb('0x0'));var rimraf=require(_0xeadb('0x1'));var zipdir=require(_0xeadb('0x2'));var jsonpatch=require(_0xeadb('0x3'));var rp=require('request-promise');var moment=require(_0xeadb('0x4'));var BPromise=require(_0xeadb('0x5'));var Mustache=require(_0xeadb('0x6'));var util=require(_0xeadb('0x7'));var path=require(_0xeadb('0x8'));var sox=require(_0xeadb('0x9'));var csv=require('to-csv');var ejs=require(_0xeadb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeadb('0xb'));var squel=require(_0xeadb('0xc'));var crypto=require(_0xeadb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeadb('0xe'));var toCsv=require(_0xeadb('0xf'));var querystring=require(_0xeadb('0x10'));var Papa=require(_0xeadb('0x11'));var Redis=require(_0xeadb('0x12'));var authService=require(_0xeadb('0x13'));var qs=require(_0xeadb('0x14'));var as=require(_0xeadb('0x15'));var hardwareService=require(_0xeadb('0x16'));var logger=require(_0xeadb('0x17'))(_0xeadb('0x18'));var utils=require(_0xeadb('0x19'));var config=require(_0xeadb('0x1a'));var licenseUtil=require(_0xeadb('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16c809,_0x2e4229){_0x2e4229=_0x2e4229||0xcc;return function(_0x529707){if(_0x529707){return _0x16c809['sendStatus'](_0x2e4229);}return _0x16c809[_0xeadb('0x1c')](_0x2e4229)[_0xeadb('0x1d')]();};}function respondWithResult(_0x448fc3,_0x4e6642){_0x4e6642=_0x4e6642||0xc8;return function(_0x4b5887){if(_0x4b5887){return _0x448fc3['status'](_0x4e6642)[_0xeadb('0x1e')](_0x4b5887);}};}function respondWithFilteredResult(_0x567574,_0x39abd7){return function(_0x30551e){if(_0x30551e){var _0x248139=typeof _0x39abd7[_0xeadb('0x1f')]===_0xeadb('0x20')&&typeof _0x39abd7[_0xeadb('0x21')]===_0xeadb('0x20');var _0x4c696c=_0x30551e[_0xeadb('0x22')];var _0xfb4740=_0x248139?0x0:_0x39abd7['offset'];var _0x2f64e8=_0x248139?_0x30551e['count']:_0x39abd7['offset']+_0x39abd7[_0xeadb('0x21')];var _0x45d460;if(_0x2f64e8>=_0x4c696c){_0x2f64e8=_0x4c696c;_0x45d460=0xc8;}else{_0x45d460=0xce;}_0x567574[_0xeadb('0x1c')](_0x45d460);return _0x567574[_0xeadb('0x23')](_0xeadb('0x24'),_0xfb4740+'-'+_0x2f64e8+'/'+_0x4c696c)['json'](_0x30551e);}return null;};}function patchUpdates(_0x50779a){return function(_0x42ed60){try{jsonpatch[_0xeadb('0x25')](_0x42ed60,_0x50779a,!![]);}catch(_0x589a8c){return BPromise[_0xeadb('0x26')](_0x589a8c);}return _0x42ed60[_0xeadb('0x27')]();};}function saveUpdates(_0x29392a,_0x146a95){return function(_0x4c67f7){if(_0x4c67f7){return _0x4c67f7[_0xeadb('0x28')](_0x29392a)[_0xeadb('0x29')](function(_0x15a447){return _0x15a447;});}return null;};}function removeEntity(_0x3e5511,_0x4bf91a){return function(_0x16bf81){if(_0x16bf81){return _0x16bf81[_0xeadb('0x2a')]()[_0xeadb('0x29')](function(){_0x3e5511[_0xeadb('0x1c')](0xcc)[_0xeadb('0x1d')]();});}};}function handleEntityNotFound(_0x7c32ad,_0x1462cb){return function(_0x3d599f){if(!_0x3d599f){_0x7c32ad[_0xeadb('0x2b')](0x194);}return _0x3d599f;};}function handleError(_0x34c2f9,_0x70daab){_0x70daab=_0x70daab||0x1f4;return function(_0x14cece){logger['error'](_0x14cece['stack']);if(_0x14cece[_0xeadb('0x2c')]){delete _0x14cece['name'];}_0x34c2f9[_0xeadb('0x1c')](_0x70daab)[_0xeadb('0x2d')](_0x14cece);};}exports[_0xeadb('0x2e')]=function(_0x26dd4a,_0x25a5ee){var _0x9b55a={},_0x5de119={},_0x1b5000={'count':0x0,'rows':[]};var _0x325f19=_[_0xeadb('0x2f')](db['Migration'][_0xeadb('0x30')],function(_0x2f8f50){return{'name':_0x2f8f50[_0xeadb('0x31')],'type':_0x2f8f50[_0xeadb('0x32')]['key']};});_0x5de119[_0xeadb('0x33')]=_[_0xeadb('0x2f')](_0x325f19,_0xeadb('0x2c'));_0x5de119[_0xeadb('0x34')]=_['keys'](_0x26dd4a[_0xeadb('0x34')]);_0x5de119[_0xeadb('0x35')]=_[_0xeadb('0x36')](_0x5de119[_0xeadb('0x33')],_0x5de119['query']);_0x9b55a[_0xeadb('0x37')]=_[_0xeadb('0x36')](_0x5de119[_0xeadb('0x33')],qs[_0xeadb('0x38')](_0x26dd4a[_0xeadb('0x34')][_0xeadb('0x38')]));_0x9b55a[_0xeadb('0x37')]=_0x9b55a['attributes'][_0xeadb('0x39')]?_0x9b55a['attributes']:_0x5de119['model'];if(!_0x26dd4a['query'][_0xeadb('0x3a')](_0xeadb('0x3b'))){_0x9b55a[_0xeadb('0x21')]=qs[_0xeadb('0x21')](_0x26dd4a[_0xeadb('0x34')][_0xeadb('0x21')]);_0x9b55a[_0xeadb('0x1f')]=qs[_0xeadb('0x1f')](_0x26dd4a[_0xeadb('0x34')][_0xeadb('0x1f')]);}_0x9b55a[_0xeadb('0x3c')]=qs[_0xeadb('0x3d')](_0x26dd4a['query'][_0xeadb('0x3d')]);_0x9b55a[_0xeadb('0x3e')]=qs[_0xeadb('0x35')](_['pick'](_0x26dd4a['query'],_0x5de119[_0xeadb('0x35')]),_0x325f19);if(_0x26dd4a[_0xeadb('0x34')][_0xeadb('0x3f')]){_0x9b55a[_0xeadb('0x3e')]=_['merge'](_0x9b55a['where'],{'$or':_[_0xeadb('0x2f')](_0x325f19,function(_0x4b7525){if(_0x4b7525[_0xeadb('0x32')]!==_0xeadb('0x40')){var _0x4f2eff={};_0x4f2eff[_0x4b7525[_0xeadb('0x2c')]]={'$like':'%'+_0x26dd4a['query'][_0xeadb('0x3f')]+'%'};return _0x4f2eff;}})});}_0x9b55a=_[_0xeadb('0x41')]({},_0x9b55a,_0x26dd4a[_0xeadb('0x42')]);var _0x15f249={'where':_0x9b55a[_0xeadb('0x3e')]};return db[_0xeadb('0x43')][_0xeadb('0x22')](_0x15f249)['then'](function(_0x57b0fc){_0x1b5000[_0xeadb('0x22')]=_0x57b0fc;if(_0x26dd4a[_0xeadb('0x34')][_0xeadb('0x44')]){_0x9b55a['include']=[{'all':!![]}];}return db[_0xeadb('0x43')]['findAll'](_0x9b55a);})[_0xeadb('0x29')](function(_0x384bcf){_0x1b5000[_0xeadb('0x45')]=_0x384bcf;return _0x1b5000;})[_0xeadb('0x29')](respondWithFilteredResult(_0x25a5ee,_0x9b55a))[_0xeadb('0x46')](handleError(_0x25a5ee,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 63a5176..609b765 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 _0xceae=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xceae,0x1a0));var _0xecea=function(_0x1cb701,_0xaebc06){_0x1cb701=_0x1cb701-0x0;var _0x2ac38d=_0xceae[_0x1cb701];return _0x2ac38d;};'use strict';var _=require(_0xecea('0x0'));var util=require('util');var logger=require(_0xecea('0x1'))(_0xecea('0x2'));var moment=require('moment');var BPromise=require(_0xecea('0x3'));var rp=require(_0xecea('0x4'));var fs=require('fs');var path=require(_0xecea('0x5'));var rimraf=require(_0xecea('0x6'));var config=require(_0xecea('0x7'));var attributes=require(_0xecea('0x8'));module[_0xecea('0x9')]=function(_0x3f3fd8,_0x58429a){return _0x3f3fd8[_0xecea('0xa')](_0xecea('0xb'),attributes,{'tableName':_0xecea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb889=['api','moment','request-promise','path','rimraf','../../config/environment','./migration.attributes','define','Migration','lodash','util'];(function(_0x41243e,_0x19b98c){var _0x540ef9=function(_0x4e6ccf){while(--_0x4e6ccf){_0x41243e['push'](_0x41243e['shift']());}};_0x540ef9(++_0x19b98c);}(_0xb889,0x1c1));var _0x9b88=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xb889[_0x35da42];return _0x370035;};'use strict';var _=require(_0x9b88('0x0'));var util=require(_0x9b88('0x1'));var logger=require('../../config/logger')(_0x9b88('0x2'));var moment=require(_0x9b88('0x3'));var BPromise=require('bluebird');var rp=require(_0x9b88('0x4'));var fs=require('fs');var path=require(_0x9b88('0x5'));var rimraf=require(_0x9b88('0x6'));var config=require(_0x9b88('0x7'));var attributes=require(_0x9b88('0x8'));module['exports']=function(_0x2a0fe9,_0x137fc2){return _0x2a0fe9[_0x9b88('0x9')](_0x9b88('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 70e846f..6446550 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 _0x67da=['error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0x67da,0x192));var _0xa67d=function(_0x12e146,_0x3bb7bf){_0x12e146=_0x12e146-0x0;var _0x3c1602=_0x67da[_0x12e146];return _0x3c1602;};'use strict';var _=require('lodash');var util=require(_0xa67d('0x0'));var moment=require(_0xa67d('0x1'));var BPromise=require(_0xa67d('0x2'));var rs=require(_0xa67d('0x3'));var fs=require('fs');var Redis=require(_0xa67d('0x4'));var db=require(_0xa67d('0x5'))['db'];var utils=require(_0xa67d('0x6'));var logger=require(_0xa67d('0x7'))(_0xa67d('0x8'));var config=require(_0xa67d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa67d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d2734,_0x31d56a,_0x2346f4){return new BPromise(function(_0x10f89a,_0x2c37c2){return client[_0xa67d('0xb')](_0x4d2734,_0x2346f4)[_0xa67d('0xc')](function(_0x330a9f){logger[_0xa67d('0xd')](_0xa67d('0xe'),_0x31d56a,_0xa67d('0xf'));logger['debug'](_0xa67d('0x10'),_0x31d56a,_0xa67d('0xf'),JSON[_0xa67d('0x11')](_0x330a9f));if(_0x330a9f[_0xa67d('0x12')]){if(_0x330a9f['error'][_0xa67d('0x13')]===0x1f4){logger[_0xa67d('0x12')]('Migration,\x20%s,\x20%s',_0x31d56a,_0x330a9f['error'][_0xa67d('0x14')]);return _0x2c37c2(_0x330a9f['error'][_0xa67d('0x14')]);}logger['error']('Migration,\x20%s,\x20%s',_0x31d56a,_0x330a9f[_0xa67d('0x12')][_0xa67d('0x14')]);return _0x10f89a(_0x330a9f['error'][_0xa67d('0x14')]);}else{logger[_0xa67d('0xd')](_0xa67d('0xe'),_0x31d56a,_0xa67d('0xf'));_0x10f89a(_0x330a9f['result']['message']);}})['catch'](function(_0x4fa50f){logger[_0xa67d('0x12')]('Migration,\x20%s,\x20%s',_0x31d56a,_0x4fa50f);_0x2c37c2(_0x4fa50f);});});} \ No newline at end of file +var _0x1be1=['stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0x1be1,0x192));var _0x11be=function(_0x5587d5,_0x385034){_0x5587d5=_0x5587d5-0x0;var _0x5467e0=_0x1be1[_0x5587d5];return _0x5467e0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x11be('0x0'));var BPromise=require(_0x11be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11be('0x2'));var db=require(_0x11be('0x3'))['db'];var utils=require(_0x11be('0x4'));var logger=require(_0x11be('0x5'))('rpc');var config=require(_0x11be('0x6'));var jayson=require(_0x11be('0x7'));var client=jayson[_0x11be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe8c62,_0x497730,_0x18f661){return new BPromise(function(_0x11fc15,_0x246772){return client[_0x11be('0x9')](_0xfe8c62,_0x18f661)[_0x11be('0xa')](function(_0x5f3d04){logger[_0x11be('0xb')](_0x11be('0xc'),_0x497730,'request\x20sent');logger[_0x11be('0xd')](_0x11be('0xe'),_0x497730,_0x11be('0xf'),JSON[_0x11be('0x10')](_0x5f3d04));if(_0x5f3d04['error']){if(_0x5f3d04[_0x11be('0x11')][_0x11be('0x12')]===0x1f4){logger[_0x11be('0x11')]('Migration,\x20%s,\x20%s',_0x497730,_0x5f3d04[_0x11be('0x11')][_0x11be('0x13')]);return _0x246772(_0x5f3d04['error'][_0x11be('0x13')]);}logger['error']('Migration,\x20%s,\x20%s',_0x497730,_0x5f3d04['error']['message']);return _0x11fc15(_0x5f3d04['error']['message']);}else{logger['info'](_0x11be('0xc'),_0x497730,'request\x20sent');_0x11fc15(_0x5f3d04[_0x11be('0x14')][_0x11be('0x13')]);}})[_0x11be('0x15')](function(_0x216b8c){logger['error'](_0x11be('0xc'),_0x497730,_0x216b8c);_0x246772(_0x216b8c);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index aa376d4..53c897c 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 _0x2706=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x209d0a,_0x46ff15){var _0x9ddd1f=function(_0x590be6){while(--_0x590be6){_0x209d0a['push'](_0x209d0a['shift']());}};_0x9ddd1f(++_0x46ff15);}(_0x2706,0x107));var _0x6270=function(_0x112916,_0x1b8cba){_0x112916=_0x112916-0x0;var _0xf5381f=_0x2706[_0x112916];return _0xf5381f;};'use strict';var multer=require('multer');var util=require(_0x6270('0x0'));var path=require(_0x6270('0x1'));var timeout=require(_0x6270('0x2'));var express=require(_0x6270('0x3'));var router=express['Router']();var fs_extra=require(_0x6270('0x4'));var auth=require(_0x6270('0x5'));var interaction=require(_0x6270('0x6'));var config=require(_0x6270('0x7'));var controller=require(_0x6270('0x8'));router[_0x6270('0x9')]('/',auth[_0x6270('0xa')](),controller[_0x6270('0xb')]);router['get'](_0x6270('0xc'),auth[_0x6270('0xa')](),controller['show']);router[_0x6270('0xd')]('/',auth[_0x6270('0xa')](),controller[_0x6270('0xe')]);router[_0x6270('0xf')](_0x6270('0xc'),auth[_0x6270('0xa')](),controller['update']);router[_0x6270('0x10')](_0x6270('0xc'),auth[_0x6270('0xa')](),controller[_0x6270('0x11')]);module[_0x6270('0x12')]=router; \ No newline at end of file +var _0xf777=['isAuthenticated','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','index','/:id','show','post'];(function(_0x279f85,_0x3935ee){var _0x1722d5=function(_0x158ba7){while(--_0x158ba7){_0x279f85['push'](_0x279f85['shift']());}};_0x1722d5(++_0x3935ee);}(_0xf777,0x1e9));var _0x7f77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf777[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7f77('0x0'));var util=require(_0x7f77('0x1'));var path=require(_0x7f77('0x2'));var timeout=require(_0x7f77('0x3'));var express=require(_0x7f77('0x4'));var router=express[_0x7f77('0x5')]();var fs_extra=require(_0x7f77('0x6'));var auth=require(_0x7f77('0x7'));var interaction=require(_0x7f77('0x8'));var config=require('../../config/environment');var controller=require(_0x7f77('0x9'));router[_0x7f77('0xa')]('/',auth['isAuthenticated'](),controller[_0x7f77('0xb')]);router['get'](_0x7f77('0xc'),auth['isAuthenticated'](),controller[_0x7f77('0xd')]);router[_0x7f77('0xe')]('/',auth[_0x7f77('0xf')](),controller[_0x7f77('0x10')]);router[_0x7f77('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7f77('0x12')]);router[_0x7f77('0x13')](_0x7f77('0xc'),auth[_0x7f77('0xf')](),controller[_0x7f77('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index fa78ef4..0c354b3 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 _0xc6ec=['exports','ENUM','localnet','stun','turn','STRING','sequelize'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0xc6ec,0x92));var _0xcc6e=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0xc6ec[_0x217c2e];return _0x22b7d8;};'use strict';var Sequelize=require(_0xcc6e('0x0'));module[_0xcc6e('0x1')]={'type':{'type':Sequelize[_0xcc6e('0x2')](_0xcc6e('0x3'),'externip',_0xcc6e('0x4'),_0xcc6e('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xcc6e('0x6')]}}; \ No newline at end of file +var _0x90ca=['localnet','externip','stun','turn','STRING','sequelize'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x90ca,0xcb));var _0xa90c=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x90ca[_0x5c9307];return _0x373e29;};'use strict';var Sequelize=require(_0xa90c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xa90c('0x1'),_0xa90c('0x2'),_0xa90c('0x3'),_0xa90c('0x4'))},'value':{'type':Sequelize[_0xa90c('0x5')]},'username':{'type':Sequelize[_0xa90c('0x5')]},'password':{'type':Sequelize[_0xa90c('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 0ebc3c9..76230f5 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 _0x891f=['sort','pick','filter','merge','options','where','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','create','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','update','find','/etc/asterisk/sip_xcally_%s.conf','util','path','ejs','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','http','then','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','undefined','limit','count','offset','set','Content-Range','json','destroy','end','stack','name','map','Network','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit'];(function(_0x69998a,_0x112648){var _0x2ab0b9=function(_0x5267dd){while(--_0x5267dd){_0x69998a['push'](_0x69998a['shift']());}};_0x2ab0b9(++_0x112648);}(_0x891f,0xc9));var _0xf891=function(_0x2e8a7e,_0x99071){_0x2e8a7e=_0x2e8a7e-0x0;var _0x4a525d=_0x891f[_0x2e8a7e];return _0x4a525d;};'use strict';var util=require(_0xf891('0x0'));var path=require(_0xf891('0x1'));var ejs=require(_0xf891('0x2'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0xf891('0x3'))('api');var config=require(_0xf891('0x4'));var db=require(_0xf891('0x5'))['db'];var jayson=require(_0xf891('0x6'));var client=jayson['client'][_0xf891('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c44f5,_0x4e216c,_0x75bda4,_0x312d22){return new Promise(function(_0x319274,_0x3b3c67){var _0x2b7eff=_0x312d22||client;return _0x2b7eff['request'](_0x3c44f5,_0x75bda4)[_0xf891('0x8')](function(_0x5152b2){logger['info'](_0xf891('0x9'),_0x4e216c,_0xf891('0xa'));logger['debug'](_0xf891('0xb'),_0x4e216c,_0xf891('0xa'),JSON[_0xf891('0xc')](_0x5152b2));if(_0x5152b2[_0xf891('0xd')]){if(_0x5152b2['error'][_0xf891('0xe')]===0x1f4){logger['error'](_0xf891('0x9'),_0x4e216c,_0x5152b2['error'][_0xf891('0xf')]);return _0x3b3c67(_0x5152b2[_0xf891('0xd')][_0xf891('0xf')]);}logger[_0xf891('0xd')](_0xf891('0x9'),_0x4e216c,_0x5152b2['error']['message']);return _0x319274(_0x5152b2[_0xf891('0xd')][_0xf891('0xf')]);}else{logger['info'](_0xf891('0x9'),_0x4e216c,_0xf891('0xa'));_0x319274(_0x5152b2[_0xf891('0x10')][_0xf891('0xf')]);}})[_0xf891('0x11')](function(_0x351ebb){logger['error'](_0xf891('0x9'),_0x4e216c,_0x351ebb);_0x3b3c67(_0x351ebb);});});}function respondWithResult(_0x421927,_0x393cd2){_0x393cd2=_0x393cd2||0xc8;return function(_0x1bcd0c){if(_0x1bcd0c){return _0x421927[_0xf891('0x12')](_0x393cd2)['json'](_0x1bcd0c);}};}function respondWithFilteredResult(_0x4f1730,_0x56c068){return function(_0x1a5fe2){if(_0x1a5fe2){var _0x3ead04=typeof _0x56c068['offset']===_0xf891('0x13')&&typeof _0x56c068[_0xf891('0x14')]===_0xf891('0x13');var _0x30764a=_0x1a5fe2[_0xf891('0x15')];var _0x20ba3b=_0x3ead04?0x0:_0x56c068[_0xf891('0x16')];var _0x3ed043=_0x3ead04?_0x1a5fe2[_0xf891('0x15')]:_0x56c068[_0xf891('0x16')]+_0x56c068[_0xf891('0x14')];var _0x11bae0;if(_0x3ed043>=_0x30764a){_0x3ed043=_0x30764a;_0x11bae0=0xc8;}else{_0x11bae0=0xce;}_0x4f1730[_0xf891('0x12')](_0x11bae0);return _0x4f1730[_0xf891('0x17')](_0xf891('0x18'),_0x20ba3b+'-'+_0x3ed043+'/'+_0x30764a)[_0xf891('0x19')](_0x1a5fe2);}return null;};}function saveUpdates(_0xaf4901){return function(_0xb1b377){if(_0xb1b377){return _0xb1b377['update'](_0xaf4901)[_0xf891('0x8')](function(_0x42c76e){return _0x42c76e;});}return null;};}function removeEntity(_0x9b1678){return function(_0x14b627){if(_0x14b627){return _0x14b627[_0xf891('0x1a')]()[_0xf891('0x8')](function(){_0x9b1678[_0xf891('0x12')](0xcc)[_0xf891('0x1b')]();});}};}function handleEntityNotFound(_0x2f571b){return function(_0x3190fc){if(!_0x3190fc){_0x2f571b['sendStatus'](0x194);}return _0x3190fc;};}function handleError(_0x3faa81,_0x3726ed){_0x3726ed=_0x3726ed||0x1f4;return function(_0x3d8955){logger['error'](_0x3d8955[_0xf891('0x1c')]);if(_0x3d8955[_0xf891('0x1d')]){delete _0x3d8955[_0xf891('0x1d')];}_0x3faa81['status'](_0x3726ed)['send'](_0x3d8955);};}exports['index']=function(_0x44ce1f,_0x24514d){var _0x5d1a2f={},_0x437448={},_0x4d07df={'count':0x0,'rows':[]};var _0x3f6409=_[_0xf891('0x1e')](db[_0xf891('0x1f')]['rawAttributes'],function(_0x405839){return{'name':_0x405839[_0xf891('0x20')],'type':_0x405839[_0xf891('0x21')][_0xf891('0x22')]};});_0x437448[_0xf891('0x23')]=_[_0xf891('0x1e')](_0x3f6409,_0xf891('0x1d'));_0x437448['query']=_['keys'](_0x44ce1f[_0xf891('0x24')]);_0x437448[_0xf891('0x25')]=_[_0xf891('0x26')](_0x437448['model'],_0x437448[_0xf891('0x24')]);_0x5d1a2f[_0xf891('0x27')]=_[_0xf891('0x26')](_0x437448[_0xf891('0x23')],qs[_0xf891('0x28')](_0x44ce1f['query'][_0xf891('0x28')]));_0x5d1a2f['attributes']=_0x5d1a2f[_0xf891('0x27')]['length']?_0x5d1a2f[_0xf891('0x27')]:_0x437448[_0xf891('0x23')];if(!_0x44ce1f[_0xf891('0x24')]['hasOwnProperty'](_0xf891('0x29'))){_0x5d1a2f[_0xf891('0x14')]=qs['limit'](_0x44ce1f[_0xf891('0x24')][_0xf891('0x14')]);_0x5d1a2f[_0xf891('0x16')]=qs[_0xf891('0x16')](_0x44ce1f[_0xf891('0x24')][_0xf891('0x16')]);}_0x5d1a2f['order']=qs['sort'](_0x44ce1f[_0xf891('0x24')][_0xf891('0x2a')]);_0x5d1a2f['where']=qs[_0xf891('0x25')](_[_0xf891('0x2b')](_0x44ce1f[_0xf891('0x24')],_0x437448['filters']),_0x3f6409);if(_0x44ce1f['query'][_0xf891('0x2c')]){_0x5d1a2f['where']=_[_0xf891('0x2d')](_0x5d1a2f['where'],{'$or':_['map'](_0x3f6409,function(_0x41d745){if(_0x41d745[_0xf891('0x21')]!=='VIRTUAL'){var _0x580c2a={};_0x580c2a[_0x41d745['name']]={'$like':'%'+_0x44ce1f[_0xf891('0x24')][_0xf891('0x2c')]+'%'};return _0x580c2a;}})});}_0x5d1a2f=_[_0xf891('0x2d')]({},_0x5d1a2f,_0x44ce1f[_0xf891('0x2e')]);var _0x55ecbd={'where':_0x5d1a2f[_0xf891('0x2f')]};return db['Network'][_0xf891('0x15')](_0x55ecbd)[_0xf891('0x8')](function(_0x406f4a){_0x4d07df['count']=_0x406f4a;if(_0x44ce1f['query'][_0xf891('0x30')]){_0x5d1a2f[_0xf891('0x31')]=[{'all':!![]}];}return db[_0xf891('0x1f')][_0xf891('0x32')](_0x5d1a2f);})[_0xf891('0x8')](function(_0x10016b){_0x4d07df[_0xf891('0x33')]=_0x10016b;return _0x4d07df;})[_0xf891('0x8')](respondWithFilteredResult(_0x24514d,_0x5d1a2f))[_0xf891('0x11')](handleError(_0x24514d,null));};exports[_0xf891('0x34')]=function(_0x33f018,_0xd95684){var _0x4d2e38={'raw':!![],'where':{'id':_0x33f018[_0xf891('0x35')]['id']}},_0x1e33f5={};_0x1e33f5[_0xf891('0x23')]=_[_0xf891('0x36')](db['Network'][_0xf891('0x37')]);_0x1e33f5[_0xf891('0x24')]=_[_0xf891('0x36')](_0x33f018[_0xf891('0x24')]);_0x1e33f5[_0xf891('0x25')]=_[_0xf891('0x26')](_0x1e33f5['model'],_0x1e33f5[_0xf891('0x24')]);_0x4d2e38['attributes']=_[_0xf891('0x26')](_0x1e33f5[_0xf891('0x23')],qs[_0xf891('0x28')](_0x33f018[_0xf891('0x24')][_0xf891('0x28')]));_0x4d2e38[_0xf891('0x27')]=_0x4d2e38[_0xf891('0x27')][_0xf891('0x38')]?_0x4d2e38['attributes']:_0x1e33f5[_0xf891('0x23')];if(_0x33f018['query']['includeAll']){_0x4d2e38[_0xf891('0x31')]=[{'all':!![]}];}_0x4d2e38=_[_0xf891('0x2d')]({},_0x4d2e38,_0x33f018[_0xf891('0x2e')]);return db['Network']['find'](_0x4d2e38)[_0xf891('0x8')](handleEntityNotFound(_0xd95684,null))['then'](respondWithResult(_0xd95684,null))[_0xf891('0x11')](handleError(_0xd95684,null));};exports['create']=function(_0x37ebdd,_0x5bdcc5){var _0x304b2f;return db['Network'][_0xf891('0x39')](_0x37ebdd[_0xf891('0x3a')],{'raw':!![]})[_0xf891('0x8')](function(_0x4d1e27){_0x304b2f=_0x4d1e27;return db[_0xf891('0x1f')][_0xf891('0x32')]({'where':{'type':_0x37ebdd[_0xf891('0x3a')]['type']},'raw':!![]});})[_0xf891('0x8')](function(_0x3cee04){if(_0x304b2f['type'][_0xf891('0x3b')]()==_0xf891('0x3c')){var _0xbf1fb=fs[_0xf891('0x3d')](path['join'](config[_0xf891('0x3e')],_0xf891('0x3f')),_0xf891('0x40'));var _0x288244=ejs[_0xf891('0x41')](_0xbf1fb,{'networks':_0x3cee04||[]});fs[_0xf891('0x42')](_0xf891('0x43'),_0x288244);return respondWithRpcPromise('Reload',_0xf891('0x39'),{'module':_0xf891('0x44')});}else if(_0x304b2f[_0xf891('0x21')][_0xf891('0x3b')]()==_0xf891('0x45')){var _0x2a800c=fs[_0xf891('0x3d')](path[_0xf891('0x46')](config[_0xf891('0x3e')],_0xf891('0x47')),_0xf891('0x40'));var _0x3f3072=ejs[_0xf891('0x41')](_0x2a800c,{'networks':_0x3cee04||[]});fs[_0xf891('0x42')](_0xf891('0x48'),_0x3f3072);return respondWithRpcPromise(_0xf891('0x49'),_0xf891('0x39'),{'module':_0xf891('0x44')});}else{var _0x1dbb3b=fs['readFileSync'](path['join'](config[_0xf891('0x3e')],_0xf891('0x4a')),_0xf891('0x40'));var _0x5806dd=ejs[_0xf891('0x41')](_0x1dbb3b,{'networks':_0x3cee04||[]});fs[_0xf891('0x42')](util[_0xf891('0x4b')]('/etc/asterisk/sip_xcally_%s.conf',_0x37ebdd[_0xf891('0x3a')][_0xf891('0x21')][_0xf891('0x4c')]()),_0x5806dd);return respondWithRpcPromise('Reload',_0xf891('0x39'),{'module':_0xf891('0x4d')});}})[_0xf891('0x8')](function(){return _0x304b2f;})[_0xf891('0x8')](respondWithResult(_0x5bdcc5,0xc9))['catch'](handleError(_0x5bdcc5,null));};exports[_0xf891('0x4e')]=function(_0x1877b5,_0xa81555){var _0x53f4df;return db['Network'][_0xf891('0x4f')]({'where':{'id':_0x1877b5[_0xf891('0x35')]['id']}})[_0xf891('0x8')](handleEntityNotFound(_0xa81555,null))['then'](saveUpdates(_0x1877b5[_0xf891('0x3a')],null))[_0xf891('0x8')](function(_0x9b1b8d){if(_0x9b1b8d){_0x53f4df=_0x9b1b8d;return db[_0xf891('0x1f')][_0xf891('0x32')]({'where':{'type':_0x53f4df[_0xf891('0x21')]},'raw':!![]});}return null;})['then'](function(_0x423f5f){if(_0x53f4df[_0xf891('0x21')][_0xf891('0x3b')]()==_0xf891('0x3c')){var _0x2d82e9=fs['readFileSync'](path['join'](config['root'],_0xf891('0x3f')),_0xf891('0x40'));var _0x204428=ejs[_0xf891('0x41')](_0x2d82e9,{'networks':_0x423f5f||[]});fs[_0xf891('0x42')]('/etc/asterisk/stun_xcally.conf',_0x204428);return respondWithRpcPromise('Reload','update',{'module':_0xf891('0x44')});}else if(_0x53f4df[_0xf891('0x21')][_0xf891('0x3b')]()=='TURN'){var _0x217b77=fs[_0xf891('0x3d')](path['join'](config[_0xf891('0x3e')],_0xf891('0x47')),_0xf891('0x40'));var _0x2150cc=ejs[_0xf891('0x41')](_0x217b77,{'networks':_0x423f5f||[]});fs[_0xf891('0x42')](_0xf891('0x48'),_0x2150cc);return respondWithRpcPromise(_0xf891('0x49'),_0xf891('0x4e'),{'module':_0xf891('0x44')});}else{var _0x336451=fs[_0xf891('0x3d')](path[_0xf891('0x46')](config['root'],_0xf891('0x4a')),_0xf891('0x40'));var _0x14b6d1=ejs[_0xf891('0x41')](_0x336451,{'networks':_0x423f5f||[]});fs[_0xf891('0x42')](util[_0xf891('0x4b')](_0xf891('0x50'),_0x1877b5[_0xf891('0x3a')][_0xf891('0x21')][_0xf891('0x4c')]()),_0x14b6d1);return respondWithRpcPromise(_0xf891('0x49'),_0xf891('0x4e'),{'module':_0xf891('0x4d')});}})[_0xf891('0x8')](function(_0x36c1d6){if(_0x36c1d6){return _0x53f4df;}return null;})[_0xf891('0x8')](respondWithResult(_0xa81555,null))['catch'](handleError(_0xa81555,null));};exports[_0xf891('0x1a')]=function(_0x4f3a3b,_0x316b36){var _0x2b3f2d;return db[_0xf891('0x1f')][_0xf891('0x4f')]({'where':{'id':_0x4f3a3b[_0xf891('0x35')]['id']}})['then'](function(_0x1b8a0e){_0x2b3f2d=_0x1b8a0e;return _0x1b8a0e;})[_0xf891('0x8')](handleEntityNotFound(_0x316b36,null))[_0xf891('0x8')](removeEntity(_0x316b36,null))['then'](function(){if(_0x2b3f2d){return db[_0xf891('0x1f')]['findAll']({'where':{'type':_0x2b3f2d['type']},'raw':!![]});}})[_0xf891('0x8')](function(_0x36640c){if(_0x2b3f2d['type']['toUpperCase']()==_0xf891('0x3c')){var _0x5c7cbb=fs[_0xf891('0x3d')](path[_0xf891('0x46')](config[_0xf891('0x3e')],_0xf891('0x3f')),_0xf891('0x40'));var _0x47628b=ejs[_0xf891('0x41')](_0x5c7cbb,{'networks':_0x36640c||[]});fs[_0xf891('0x42')](_0xf891('0x43'),_0x47628b);return respondWithRpcPromise(_0xf891('0x49'),'destroy',{'module':_0xf891('0x44')});}else if(_0x2b3f2d[_0xf891('0x21')][_0xf891('0x3b')]()=='TURN'){var _0x1b6240=fs[_0xf891('0x3d')](path['join'](config[_0xf891('0x3e')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x5a61bf=ejs[_0xf891('0x41')](_0x1b6240,{'networks':_0x36640c||[]});fs[_0xf891('0x42')](_0xf891('0x48'),_0x5a61bf);return respondWithRpcPromise('Reload','destroy',{'module':_0xf891('0x44')});}else{var _0x46f6f4=fs[_0xf891('0x3d')](path[_0xf891('0x46')](config[_0xf891('0x3e')],_0xf891('0x4a')),'utf8');var _0x316fe4=ejs[_0xf891('0x41')](_0x46f6f4,{'networks':_0x36640c||[]});fs[_0xf891('0x42')](util[_0xf891('0x4b')](_0xf891('0x50'),_0x2b3f2d[_0xf891('0x21')][_0xf891('0x4c')]()),_0x316fe4);return respondWithRpcPromise(_0xf891('0x49'),_0xf891('0x1a'),{'module':'chan_sip.so'});}})['catch'](handleError(_0x316b36,null));}; \ No newline at end of file +var _0x7276=['TURN','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','server/files/templates/turn_multiple.ejs','format','server/files/templates/network.ejs','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','request','then','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','Network,\x20%s,\x20%s','message','info','result','json','offset','undefined','status','Content-Range','update','destroy','end','sendStatus','stack','name','send','Network','rawAttributes','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','count','includeAll','include','rows','catch','show','params','find','create','body','findAll','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf'];(function(_0x36af18,_0x46052a){var _0x55a4c1=function(_0x3675f6){while(--_0x3675f6){_0x36af18['push'](_0x36af18['shift']());}};_0x55a4c1(++_0x46052a);}(_0x7276,0x16e));var _0x6727=function(_0x3f06b8,_0x45c58c){_0x3f06b8=_0x3f06b8-0x0;var _0x5d2028=_0x7276[_0x3f06b8];return _0x5d2028;};'use strict';var util=require(_0x6727('0x0'));var path=require(_0x6727('0x1'));var ejs=require(_0x6727('0x2'));var fs=require('fs');var _=require(_0x6727('0x3'));var qs=require(_0x6727('0x4'));var logger=require(_0x6727('0x5'))(_0x6727('0x6'));var config=require(_0x6727('0x7'));var db=require(_0x6727('0x8'))['db'];var jayson=require(_0x6727('0x9'));var client=jayson['client'][_0x6727('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cb7d6,_0x56c17e,_0x5c6c29,_0x130a92){return new Promise(function(_0x421a97,_0x6fe7e7){var _0x4e8f22=_0x130a92||client;return _0x4e8f22[_0x6727('0xb')](_0x1cb7d6,_0x5c6c29)[_0x6727('0xc')](function(_0x29789f){logger['info']('Network,\x20%s,\x20%s',_0x56c17e,_0x6727('0xd'));logger[_0x6727('0xe')](_0x6727('0xf'),_0x56c17e,_0x6727('0xd'),JSON[_0x6727('0x10')](_0x29789f));if(_0x29789f[_0x6727('0x11')]){if(_0x29789f['error']['code']===0x1f4){logger['error'](_0x6727('0x12'),_0x56c17e,_0x29789f[_0x6727('0x11')][_0x6727('0x13')]);return _0x6fe7e7(_0x29789f[_0x6727('0x11')][_0x6727('0x13')]);}logger['error'](_0x6727('0x12'),_0x56c17e,_0x29789f['error'][_0x6727('0x13')]);return _0x421a97(_0x29789f['error'][_0x6727('0x13')]);}else{logger[_0x6727('0x14')](_0x6727('0x12'),_0x56c17e,'request\x20sent');_0x421a97(_0x29789f[_0x6727('0x15')][_0x6727('0x13')]);}})['catch'](function(_0x4e1c28){logger[_0x6727('0x11')](_0x6727('0x12'),_0x56c17e,_0x4e1c28);_0x6fe7e7(_0x4e1c28);});});}function respondWithResult(_0x4911bf,_0x5b4758){_0x5b4758=_0x5b4758||0xc8;return function(_0x409dc2){if(_0x409dc2){return _0x4911bf['status'](_0x5b4758)[_0x6727('0x16')](_0x409dc2);}};}function respondWithFilteredResult(_0x13f7fd,_0x19ea96){return function(_0x4c4350){if(_0x4c4350){var _0x504c5e=typeof _0x19ea96[_0x6727('0x17')]===_0x6727('0x18')&&typeof _0x19ea96['limit']===_0x6727('0x18');var _0x5a2377=_0x4c4350['count'];var _0x336203=_0x504c5e?0x0:_0x19ea96['offset'];var _0x4edfc1=_0x504c5e?_0x4c4350['count']:_0x19ea96[_0x6727('0x17')]+_0x19ea96['limit'];var _0x553b26;if(_0x4edfc1>=_0x5a2377){_0x4edfc1=_0x5a2377;_0x553b26=0xc8;}else{_0x553b26=0xce;}_0x13f7fd[_0x6727('0x19')](_0x553b26);return _0x13f7fd['set'](_0x6727('0x1a'),_0x336203+'-'+_0x4edfc1+'/'+_0x5a2377)['json'](_0x4c4350);}return null;};}function saveUpdates(_0x1bd03b){return function(_0x5e875f){if(_0x5e875f){return _0x5e875f[_0x6727('0x1b')](_0x1bd03b)[_0x6727('0xc')](function(_0x281087){return _0x281087;});}return null;};}function removeEntity(_0x35c641){return function(_0x4702de){if(_0x4702de){return _0x4702de[_0x6727('0x1c')]()[_0x6727('0xc')](function(){_0x35c641[_0x6727('0x19')](0xcc)[_0x6727('0x1d')]();});}};}function handleEntityNotFound(_0x35524b){return function(_0x4d5b3a){if(!_0x4d5b3a){_0x35524b[_0x6727('0x1e')](0x194);}return _0x4d5b3a;};}function handleError(_0x565f6e,_0x4f0295){_0x4f0295=_0x4f0295||0x1f4;return function(_0x55560a){logger['error'](_0x55560a[_0x6727('0x1f')]);if(_0x55560a[_0x6727('0x20')]){delete _0x55560a[_0x6727('0x20')];}_0x565f6e[_0x6727('0x19')](_0x4f0295)[_0x6727('0x21')](_0x55560a);};}exports['index']=function(_0x13cdb7,_0x539039){var _0x4200a0={},_0xc85522={},_0x5e105a={'count':0x0,'rows':[]};var _0x25b877=_['map'](db[_0x6727('0x22')][_0x6727('0x23')],function(_0x5d1017){return{'name':_0x5d1017[_0x6727('0x24')],'type':_0x5d1017['type'][_0x6727('0x25')]};});_0xc85522['model']=_[_0x6727('0x26')](_0x25b877,_0x6727('0x20'));_0xc85522[_0x6727('0x27')]=_[_0x6727('0x28')](_0x13cdb7[_0x6727('0x27')]);_0xc85522[_0x6727('0x29')]=_['intersection'](_0xc85522[_0x6727('0x2a')],_0xc85522[_0x6727('0x27')]);_0x4200a0[_0x6727('0x2b')]=_[_0x6727('0x2c')](_0xc85522['model'],qs[_0x6727('0x2d')](_0x13cdb7[_0x6727('0x27')][_0x6727('0x2d')]));_0x4200a0[_0x6727('0x2b')]=_0x4200a0[_0x6727('0x2b')][_0x6727('0x2e')]?_0x4200a0[_0x6727('0x2b')]:_0xc85522['model'];if(!_0x13cdb7[_0x6727('0x27')][_0x6727('0x2f')]('nolimit')){_0x4200a0[_0x6727('0x30')]=qs[_0x6727('0x30')](_0x13cdb7[_0x6727('0x27')]['limit']);_0x4200a0['offset']=qs[_0x6727('0x17')](_0x13cdb7['query'][_0x6727('0x17')]);}_0x4200a0[_0x6727('0x31')]=qs[_0x6727('0x32')](_0x13cdb7['query'][_0x6727('0x32')]);_0x4200a0[_0x6727('0x33')]=qs[_0x6727('0x29')](_[_0x6727('0x34')](_0x13cdb7[_0x6727('0x27')],_0xc85522['filters']),_0x25b877);if(_0x13cdb7[_0x6727('0x27')]['filter']){_0x4200a0[_0x6727('0x33')]=_[_0x6727('0x35')](_0x4200a0[_0x6727('0x33')],{'$or':_[_0x6727('0x26')](_0x25b877,function(_0x1c0109){if(_0x1c0109[_0x6727('0x36')]!==_0x6727('0x37')){var _0x4534e7={};_0x4534e7[_0x1c0109[_0x6727('0x20')]]={'$like':'%'+_0x13cdb7['query'][_0x6727('0x38')]+'%'};return _0x4534e7;}})});}_0x4200a0=_['merge']({},_0x4200a0,_0x13cdb7[_0x6727('0x39')]);var _0x3c1188={'where':_0x4200a0[_0x6727('0x33')]};return db[_0x6727('0x22')][_0x6727('0x3a')](_0x3c1188)['then'](function(_0x48792c){_0x5e105a[_0x6727('0x3a')]=_0x48792c;if(_0x13cdb7[_0x6727('0x27')][_0x6727('0x3b')]){_0x4200a0[_0x6727('0x3c')]=[{'all':!![]}];}return db[_0x6727('0x22')]['findAll'](_0x4200a0);})[_0x6727('0xc')](function(_0x3ac0e1){_0x5e105a[_0x6727('0x3d')]=_0x3ac0e1;return _0x5e105a;})[_0x6727('0xc')](respondWithFilteredResult(_0x539039,_0x4200a0))[_0x6727('0x3e')](handleError(_0x539039,null));};exports[_0x6727('0x3f')]=function(_0x2d0dca,_0x5b9921){var _0x4f8626={'raw':!![],'where':{'id':_0x2d0dca[_0x6727('0x40')]['id']}},_0x1222cd={};_0x1222cd[_0x6727('0x2a')]=_[_0x6727('0x28')](db['Network']['rawAttributes']);_0x1222cd[_0x6727('0x27')]=_[_0x6727('0x28')](_0x2d0dca[_0x6727('0x27')]);_0x1222cd[_0x6727('0x29')]=_[_0x6727('0x2c')](_0x1222cd['model'],_0x1222cd['query']);_0x4f8626[_0x6727('0x2b')]=_['intersection'](_0x1222cd['model'],qs[_0x6727('0x2d')](_0x2d0dca[_0x6727('0x27')][_0x6727('0x2d')]));_0x4f8626[_0x6727('0x2b')]=_0x4f8626[_0x6727('0x2b')]['length']?_0x4f8626[_0x6727('0x2b')]:_0x1222cd[_0x6727('0x2a')];if(_0x2d0dca[_0x6727('0x27')][_0x6727('0x3b')]){_0x4f8626[_0x6727('0x3c')]=[{'all':!![]}];}_0x4f8626=_[_0x6727('0x35')]({},_0x4f8626,_0x2d0dca['options']);return db['Network'][_0x6727('0x41')](_0x4f8626)[_0x6727('0xc')](handleEntityNotFound(_0x5b9921,null))['then'](respondWithResult(_0x5b9921,null))[_0x6727('0x3e')](handleError(_0x5b9921,null));};exports[_0x6727('0x42')]=function(_0x515ec1,_0x4f1bf4){var _0x3a218d;return db['Network'][_0x6727('0x42')](_0x515ec1[_0x6727('0x43')],{'raw':!![]})[_0x6727('0xc')](function(_0x3f83c1){_0x3a218d=_0x3f83c1;return db['Network'][_0x6727('0x44')]({'where':{'type':_0x515ec1[_0x6727('0x43')][_0x6727('0x36')]},'raw':!![]});})[_0x6727('0xc')](function(_0x5dadd5){if(_0x3a218d['type'][_0x6727('0x45')]()==_0x6727('0x46')){var _0x8ad26e=fs[_0x6727('0x47')](path[_0x6727('0x48')](config[_0x6727('0x49')],_0x6727('0x4a')),_0x6727('0x4b'));var _0x196110=ejs[_0x6727('0x4c')](_0x8ad26e,{'networks':_0x5dadd5||[]});fs[_0x6727('0x4d')](_0x6727('0x4e'),_0x196110);return respondWithRpcPromise('Reload',_0x6727('0x42'),{'module':'res_stun_monitor.so'});}else if(_0x3a218d[_0x6727('0x36')][_0x6727('0x45')]()==_0x6727('0x4f')){var _0x38ae08=fs[_0x6727('0x47')](path[_0x6727('0x48')](config[_0x6727('0x49')],'server/files/templates/turn_multiple.ejs'),_0x6727('0x4b'));var _0x2e9035=ejs['render'](_0x38ae08,{'networks':_0x5dadd5||[]});fs[_0x6727('0x4d')](_0x6727('0x50'),_0x2e9035);return respondWithRpcPromise('Reload',_0x6727('0x42'),{'module':_0x6727('0x51')});}else{var _0x264038=fs['readFileSync'](path[_0x6727('0x48')](config['root'],'server/files/templates/network.ejs'),_0x6727('0x4b'));var _0x5c782a=ejs[_0x6727('0x4c')](_0x264038,{'networks':_0x5dadd5||[]});fs[_0x6727('0x4d')](util['format'](_0x6727('0x52'),_0x515ec1[_0x6727('0x43')][_0x6727('0x36')][_0x6727('0x53')]()),_0x5c782a);return respondWithRpcPromise(_0x6727('0x54'),_0x6727('0x42'),{'module':_0x6727('0x55')});}})[_0x6727('0xc')](function(){return _0x3a218d;})[_0x6727('0xc')](respondWithResult(_0x4f1bf4,0xc9))[_0x6727('0x3e')](handleError(_0x4f1bf4,null));};exports[_0x6727('0x1b')]=function(_0x5d8f95,_0x349567){var _0x5275cc;return db[_0x6727('0x22')][_0x6727('0x41')]({'where':{'id':_0x5d8f95[_0x6727('0x40')]['id']}})[_0x6727('0xc')](handleEntityNotFound(_0x349567,null))[_0x6727('0xc')](saveUpdates(_0x5d8f95[_0x6727('0x43')],null))[_0x6727('0xc')](function(_0x4ffce5){if(_0x4ffce5){_0x5275cc=_0x4ffce5;return db[_0x6727('0x22')][_0x6727('0x44')]({'where':{'type':_0x5275cc[_0x6727('0x36')]},'raw':!![]});}return null;})[_0x6727('0xc')](function(_0x245d3d){if(_0x5275cc[_0x6727('0x36')][_0x6727('0x45')]()=='STUN'){var _0x607e60=fs['readFileSync'](path['join'](config['root'],_0x6727('0x4a')),_0x6727('0x4b'));var _0x5a7a59=ejs[_0x6727('0x4c')](_0x607e60,{'networks':_0x245d3d||[]});fs[_0x6727('0x4d')]('/etc/asterisk/stun_xcally.conf',_0x5a7a59);return respondWithRpcPromise('Reload','update',{'module':_0x6727('0x51')});}else if(_0x5275cc[_0x6727('0x36')][_0x6727('0x45')]()==_0x6727('0x4f')){var _0x4a7cb4=fs['readFileSync'](path[_0x6727('0x48')](config[_0x6727('0x49')],_0x6727('0x56')),'utf8');var _0x12cd37=ejs['render'](_0x4a7cb4,{'networks':_0x245d3d||[]});fs[_0x6727('0x4d')]('/etc/asterisk/turn_xcally.conf',_0x12cd37);return respondWithRpcPromise('Reload',_0x6727('0x1b'),{'module':_0x6727('0x51')});}else{var _0x139413=fs['readFileSync'](path[_0x6727('0x48')](config['root'],'server/files/templates/network.ejs'),_0x6727('0x4b'));var _0x2f7449=ejs['render'](_0x139413,{'networks':_0x245d3d||[]});fs[_0x6727('0x4d')](util[_0x6727('0x57')](_0x6727('0x52'),_0x5d8f95[_0x6727('0x43')][_0x6727('0x36')]['toLowerCase']()),_0x2f7449);return respondWithRpcPromise(_0x6727('0x54'),_0x6727('0x1b'),{'module':'chan_sip.so'});}})[_0x6727('0xc')](function(_0x5e64d6){if(_0x5e64d6){return _0x5275cc;}return null;})[_0x6727('0xc')](respondWithResult(_0x349567,null))[_0x6727('0x3e')](handleError(_0x349567,null));};exports[_0x6727('0x1c')]=function(_0x286a76,_0x247321){var _0x134df6;return db[_0x6727('0x22')]['find']({'where':{'id':_0x286a76['params']['id']}})[_0x6727('0xc')](function(_0x5c0b08){_0x134df6=_0x5c0b08;return _0x5c0b08;})[_0x6727('0xc')](handleEntityNotFound(_0x247321,null))[_0x6727('0xc')](removeEntity(_0x247321,null))[_0x6727('0xc')](function(){if(_0x134df6){return db[_0x6727('0x22')][_0x6727('0x44')]({'where':{'type':_0x134df6[_0x6727('0x36')]},'raw':!![]});}})[_0x6727('0xc')](function(_0x248146){if(_0x134df6[_0x6727('0x36')]['toUpperCase']()==_0x6727('0x46')){var _0x4c5319=fs[_0x6727('0x47')](path[_0x6727('0x48')](config[_0x6727('0x49')],_0x6727('0x4a')),'utf8');var _0x563fad=ejs[_0x6727('0x4c')](_0x4c5319,{'networks':_0x248146||[]});fs['writeFileSync'](_0x6727('0x4e'),_0x563fad);return respondWithRpcPromise('Reload','destroy',{'module':_0x6727('0x51')});}else if(_0x134df6[_0x6727('0x36')]['toUpperCase']()==_0x6727('0x4f')){var _0x5f0b09=fs[_0x6727('0x47')](path[_0x6727('0x48')](config[_0x6727('0x49')],_0x6727('0x56')),_0x6727('0x4b'));var _0x4a2a94=ejs[_0x6727('0x4c')](_0x5f0b09,{'networks':_0x248146||[]});fs[_0x6727('0x4d')]('/etc/asterisk/turn_xcally.conf',_0x4a2a94);return respondWithRpcPromise(_0x6727('0x54'),'destroy',{'module':_0x6727('0x51')});}else{var _0x7fb7a0=fs['readFileSync'](path['join'](config[_0x6727('0x49')],_0x6727('0x58')),_0x6727('0x4b'));var _0x1c4e52=ejs[_0x6727('0x4c')](_0x7fb7a0,{'networks':_0x248146||[]});fs[_0x6727('0x4d')](util[_0x6727('0x57')](_0x6727('0x52'),_0x134df6[_0x6727('0x36')][_0x6727('0x53')]()),_0x1c4e52);return respondWithRpcPromise(_0x6727('0x54'),'destroy',{'module':_0x6727('0x55')});}})['catch'](handleError(_0x247321,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 3e43420..7baa286 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 _0xc6d8=['../../config/logger','moment','request-promise','../../config/environment','./network.attributes','exports','define','Network','lodash'];(function(_0x856fb0,_0x571677){var _0x2e35ca=function(_0xdf485a){while(--_0xdf485a){_0x856fb0['push'](_0x856fb0['shift']());}};_0x2e35ca(++_0x571677);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x4b92b9,_0x1bd47d){_0x4b92b9=_0x4b92b9-0x0;var _0x157b9d=_0xc6d8[_0x4b92b9];return _0x157b9d;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var logger=require(_0x8c6d('0x1'))('api');var moment=require(_0x8c6d('0x2'));var BPromise=require('bluebird');var rp=require(_0x8c6d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8c6d('0x4'));var attributes=require(_0x8c6d('0x5'));module[_0x8c6d('0x6')]=function(_0x4f5e8f,_0x3c265c){return _0x4f5e8f[_0x8c6d('0x7')](_0x8c6d('0x8'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac55=['path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5bcdf7,_0x101970){var _0x426e36=function(_0x248143){while(--_0x248143){_0x5bcdf7['push'](_0x5bcdf7['shift']());}};_0x426e36(++_0x101970);}(_0xac55,0x1c8));var _0x5ac5=function(_0x1804fe,_0x3c1ee9){_0x1804fe=_0x1804fe-0x0;var _0x4b765e=_0xac55[_0x1804fe];return _0x4b765e;};'use strict';var _=require(_0x5ac5('0x0'));var util=require(_0x5ac5('0x1'));var logger=require(_0x5ac5('0x2'))(_0x5ac5('0x3'));var moment=require('moment');var BPromise=require(_0x5ac5('0x4'));var rp=require(_0x5ac5('0x5'));var fs=require('fs');var path=require(_0x5ac5('0x6'));var rimraf=require(_0x5ac5('0x7'));var config=require(_0x5ac5('0x8'));var attributes=require(_0x5ac5('0x9'));module[_0x5ac5('0xa')]=function(_0x52e117,_0x57f615){return _0x52e117[_0x5ac5('0xb')](_0x5ac5('0xc'),attributes,{'tableName':_0x5ac5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 3886626..7845a94 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x6fe074,_0x337e39){_0x6fe074=_0x6fe074-0x0;var _0x2949cb=_0x7a54[_0x6fe074];return _0x2949cb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x395f2c,_0x31140e){_0x395f2c=_0x395f2c-0x0;var _0x525dff=_0x7a54[_0x395f2c];return _0x525dff;};'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 bf948ea..154dc5d 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 _0x8048=['index','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','notify','addApplications','/:id/send','send','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get'];(function(_0x6db2fc,_0x3279b6){var _0x30eadd=function(_0x3385f5){while(--_0x3385f5){_0x6db2fc['push'](_0x6db2fc['shift']());}};_0x30eadd(++_0x3279b6);}(_0x8048,0xcb));var _0x8804=function(_0xa6cb09,_0x39410f){_0xa6cb09=_0xa6cb09-0x0;var _0x12b437=_0x8048[_0xa6cb09];return _0x12b437;};'use strict';var multer=require('multer');var util=require(_0x8804('0x0'));var path=require('path');var timeout=require(_0x8804('0x1'));var express=require(_0x8804('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8804('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8804('0x4'));var controller=require(_0x8804('0x5'));router[_0x8804('0x6')]('/',auth['isAuthenticated'](),controller[_0x8804('0x7')]);router[_0x8804('0x6')]('/describe',auth[_0x8804('0x8')](),controller[_0x8804('0x9')]);router[_0x8804('0x6')](_0x8804('0xa'),auth[_0x8804('0x8')](),controller[_0x8804('0xb')]);router[_0x8804('0x6')](_0x8804('0xc'),auth[_0x8804('0x8')](),controller['getDispositions']);router[_0x8804('0x6')](_0x8804('0xd'),auth[_0x8804('0x8')](),controller[_0x8804('0xe')]);router['get'](_0x8804('0xf'),auth['isAuthenticated'](),controller['getApplications']);router[_0x8804('0x6')](_0x8804('0x10'),auth[_0x8804('0x8')](),controller[_0x8804('0x11')]);router[_0x8804('0x6')](_0x8804('0x12'),auth[_0x8804('0x8')](),controller[_0x8804('0x13')]);router[_0x8804('0x14')]('/',auth[_0x8804('0x8')](),controller[_0x8804('0x15')]);router['post'](_0x8804('0xc'),auth['isAuthenticated'](),controller[_0x8804('0x16')]);router[_0x8804('0x14')](_0x8804('0xd'),auth[_0x8804('0x8')](),controller[_0x8804('0x17')]);router[_0x8804('0x14')]('/:id/notify',controller[_0x8804('0x18')]);router['post'](_0x8804('0xf'),auth[_0x8804('0x8')](),controller[_0x8804('0x19')]);router['post'](_0x8804('0x12'),auth[_0x8804('0x8')](),controller['addAgents']);router[_0x8804('0x14')](_0x8804('0x1a'),auth[_0x8804('0x8')](),controller[_0x8804('0x1b')]);router[_0x8804('0x1c')](_0x8804('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x8804('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x8804('0x1e')]);router[_0x8804('0x1d')](_0x8804('0xc'),auth[_0x8804('0x8')](),controller[_0x8804('0x1f')]);router[_0x8804('0x1d')](_0x8804('0xd'),auth[_0x8804('0x8')](),controller[_0x8804('0x20')]);router[_0x8804('0x1d')](_0x8804('0x12'),auth[_0x8804('0x8')](),controller[_0x8804('0x21')]);module[_0x8804('0x22')]=router; \ No newline at end of file +var _0xaf18=['get','describe','show','getDispositions','getAnswers','/:id/applications','/:id/interactions','/:id/users','getAgents','create','post','/:id/dispositions','/:id/canned_answers','addApplications','/:id/send','send','put','update','delete','/:id','destroy','removeDispositions','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','isAuthenticated'];(function(_0x28e334,_0x419adf){var _0x5d65fa=function(_0x5040a6){while(--_0x5040a6){_0x28e334['push'](_0x28e334['shift']());}};_0x5d65fa(++_0x419adf);}(_0xaf18,0xcb));var _0x8af1=function(_0x390aaf,_0x119328){_0x390aaf=_0x390aaf-0x0;var _0x5ddab8=_0xaf18[_0x390aaf];return _0x5ddab8;};'use strict';var multer=require(_0x8af1('0x0'));var util=require(_0x8af1('0x1'));var path=require('path');var timeout=require(_0x8af1('0x2'));var express=require(_0x8af1('0x3'));var router=express['Router']();var fs_extra=require(_0x8af1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8af1('0x5'));var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0x8af1('0x6')](),controller['index']);router[_0x8af1('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x8af1('0x8')]);router['get']('/:id',auth[_0x8af1('0x6')](),controller[_0x8af1('0x9')]);router['get']('/:id/dispositions',auth[_0x8af1('0x6')](),controller[_0x8af1('0xa')]);router[_0x8af1('0x7')]('/:id/canned_answers',auth[_0x8af1('0x6')](),controller[_0x8af1('0xb')]);router[_0x8af1('0x7')](_0x8af1('0xc'),auth[_0x8af1('0x6')](),controller['getApplications']);router[_0x8af1('0x7')](_0x8af1('0xd'),auth[_0x8af1('0x6')](),controller['getInteractions']);router['get'](_0x8af1('0xe'),auth['isAuthenticated'](),controller[_0x8af1('0xf')]);router['post']('/',auth[_0x8af1('0x6')](),controller[_0x8af1('0x10')]);router[_0x8af1('0x11')](_0x8af1('0x12'),auth[_0x8af1('0x6')](),controller['addDisposition']);router[_0x8af1('0x11')](_0x8af1('0x13'),auth[_0x8af1('0x6')](),controller['addAnswer']);router[_0x8af1('0x11')]('/:id/notify',controller['notify']);router[_0x8af1('0x11')](_0x8af1('0xc'),auth[_0x8af1('0x6')](),controller[_0x8af1('0x14')]);router[_0x8af1('0x11')]('/:id/users',auth[_0x8af1('0x6')](),controller['addAgents']);router[_0x8af1('0x11')](_0x8af1('0x15'),auth[_0x8af1('0x6')](),controller[_0x8af1('0x16')]);router[_0x8af1('0x17')]('/:id',auth[_0x8af1('0x6')](),controller[_0x8af1('0x18')]);router[_0x8af1('0x19')](_0x8af1('0x1a'),auth[_0x8af1('0x6')](),controller[_0x8af1('0x1b')]);router[_0x8af1('0x19')](_0x8af1('0x12'),auth[_0x8af1('0x6')](),controller[_0x8af1('0x1c')]);router[_0x8af1('0x19')](_0x8af1('0x13'),auth[_0x8af1('0x6')](),controller['removeAnswers']);router[_0x8af1('0x19')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x8af1('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index fe5f0a5..cc5b6a7 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 _0x717c=['sequelize','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDisposition'];(function(_0x589eb9,_0x30290c){var _0x5bd498=function(_0x1dec09){while(--_0x1dec09){_0x589eb9['push'](_0x589eb9['shift']());}};_0x5bd498(++_0x30290c);}(_0x717c,0xdc));var _0xc717=function(_0x7af2d3,_0x2ce735){_0x7af2d3=_0x7af2d3-0x0;var _0xf3a9d0=_0x717c[_0x7af2d3];return _0xf3a9d0;};'use strict';var Sequelize=require(_0xc717('0x0'));var rs=require('randomstring');module[_0xc717('0x1')]={'name':{'type':Sequelize[_0xc717('0x2')],'unique':_0xc717('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xc717('0x2')],'defaultValue':function(){return rs[_0xc717('0x4')]();}},'replyUri':{'type':Sequelize[_0xc717('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc717('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc717('0x5')],'defaultValue':function(){return _0xc717('0x6');}},'notificationSound':{'type':Sequelize[_0xc717('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc717('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc717('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc717('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc717('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc717('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc717('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc717('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc717('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc717('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x50cb20){if(!_0x50cb20)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xc717('0x9')](_0xc717('0xa'),_0x50cb20);}}}; \ No newline at end of file +var _0xf9a7=['INTEGER','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','name','generate','STRING','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf9a7,0x10c));var _0x7f9a=function(_0x23f43e,_0xa002a9){_0x23f43e=_0x23f43e-0x0;var _0x2d0ae6=_0xf9a7[_0x23f43e];return _0x2d0ae6;};'use strict';var Sequelize=require(_0x7f9a('0x0'));var rs=require(_0x7f9a('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7f9a('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x7f9a('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x7f9a('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7f9a('0x5')],'defaultValue':function(){return _0x7f9a('0x6');}},'notificationSound':{'type':Sequelize[_0x7f9a('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7f9a('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7f9a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x7f9a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x7f9a('0x4')]},'queueTransfer':{'type':Sequelize[_0x7f9a('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7f9a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7f9a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7f9a('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7f9a('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x28023d){if(!_0x28023d)this['setDataValue'](_0x7f9a('0x9'),null);this[_0x7f9a('0xa')](_0x7f9a('0xb'),_0x28023d);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 2d7e294..223ae19 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 _0x6462=['params','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','update','body','describe','getDispositions','findOne','Disposition','filter','removeDispositions','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','removeAnswers','ids','notify','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','DESC','Applications','List','applications','list','priority','asc','account','Contacts','defaults','from','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','contact','lastName','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','User','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','transaction','sequelize','Transaction','ISOLATION_LEVELS','OpenchannelApplication','bulkCreate','finally','getApplications','Contact','Owner','fullname','Tag','Tags','color','tag','addAgents','emit','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','get','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','OpenchannelAccount','includeAll','include','findAll','rows','show'];(function(_0x29bef7,_0x5127f0){var _0x1ba0c1=function(_0x90b156){while(--_0x90b156){_0x29bef7['push'](_0x29bef7['shift']());}};_0x1ba0c1(++_0x5127f0);}(_0x6462,0x11f));var _0x2646=function(_0x55b3c9,_0x109d9f){_0x55b3c9=_0x55b3c9-0x0;var _0x41886b=_0x6462[_0x55b3c9];return _0x41886b;};'use strict';var emlformat=require(_0x2646('0x0'));var rimraf=require(_0x2646('0x1'));var zipdir=require(_0x2646('0x2'));var jsonpatch=require(_0x2646('0x3'));var rp=require('request-promise');var moment=require(_0x2646('0x4'));var BPromise=require(_0x2646('0x5'));var Mustache=require(_0x2646('0x6'));var util=require(_0x2646('0x7'));var path=require(_0x2646('0x8'));var sox=require(_0x2646('0x9'));var csv=require(_0x2646('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2646('0xb'));var squel=require(_0x2646('0xc'));var crypto=require(_0x2646('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2646('0xe'));var toCsv=require(_0x2646('0xa'));var querystring=require(_0x2646('0xf'));var Papa=require(_0x2646('0x10'));var Redis=require(_0x2646('0x11'));var authService=require(_0x2646('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2646('0x13'));var hardwareService=require(_0x2646('0x14'));var logger=require('../../config/logger')(_0x2646('0x15'));var utils=require('../../config/utils');var config=require(_0x2646('0x16'));var licenseUtil=require(_0x2646('0x17'));var db=require(_0x2646('0x18'))['db'];config[_0x2646('0x19')]=_['defaults'](config[_0x2646('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2646('0x19')]));require('./openchannelAccount.socket')[_0x2646('0x1a')](socket);var jayson=require(_0x2646('0x1b'));var client=jayson[_0x2646('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0x2646('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x19a4a1,_0x52914d,_0x58cd87,_0x477528){return new BPromise(function(_0x29d0e6,_0x22819e){var _0x7d2ddb=_0x477528||client;return _0x7d2ddb[_0x2646('0x1e')](_0x19a4a1,_0x58cd87)[_0x2646('0x1f')](function(_0x45d577){logger[_0x2646('0x20')](_0x2646('0x21'),_0x52914d,_0x2646('0x22'));logger[_0x2646('0x23')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x52914d,'request\x20sent',JSON['stringify'](_0x45d577));if(_0x45d577[_0x2646('0x24')]){if(_0x45d577[_0x2646('0x24')][_0x2646('0x25')]===0x1f4){logger[_0x2646('0x24')](_0x2646('0x21'),_0x52914d,_0x45d577['error'][_0x2646('0x26')]);return _0x22819e(_0x45d577[_0x2646('0x24')][_0x2646('0x26')]);}logger[_0x2646('0x24')](_0x2646('0x21'),_0x52914d,_0x45d577[_0x2646('0x24')][_0x2646('0x26')]);return _0x29d0e6(_0x45d577[_0x2646('0x24')][_0x2646('0x26')]);}else{logger[_0x2646('0x20')](_0x2646('0x21'),_0x52914d,_0x2646('0x22'));_0x29d0e6(_0x45d577[_0x2646('0x27')]['message']);}})[_0x2646('0x28')](function(_0x3d0ee3){logger['error'](_0x2646('0x21'),_0x52914d,_0x3d0ee3);_0x22819e(_0x3d0ee3);});});}function respondWithStatusCode(_0x585380,_0x4566d5){_0x4566d5=_0x4566d5||0xcc;return function(_0x46e2a2){if(_0x46e2a2){return _0x585380[_0x2646('0x29')](_0x4566d5);}return _0x585380[_0x2646('0x2a')](_0x4566d5)['end']();};}function respondWithResult(_0x3a2f6d,_0x43bd0a){_0x43bd0a=_0x43bd0a||0xc8;return function(_0x203407){if(_0x203407){return _0x3a2f6d[_0x2646('0x2a')](_0x43bd0a)[_0x2646('0x2b')](_0x203407);}};}function respondWithFilteredResult(_0x3e12b9,_0x5b3a9b){return function(_0x43bb08){if(_0x43bb08){var _0x460f34=typeof _0x5b3a9b[_0x2646('0x2c')]===_0x2646('0x2d')&&typeof _0x5b3a9b[_0x2646('0x2e')]===_0x2646('0x2d');var _0x2b23c9=_0x43bb08[_0x2646('0x2f')];var _0x29ef79=_0x460f34?0x0:_0x5b3a9b[_0x2646('0x2c')];var _0x2f3be3=_0x460f34?_0x43bb08[_0x2646('0x2f')]:_0x5b3a9b[_0x2646('0x2c')]+_0x5b3a9b['limit'];var _0x3579dc;if(_0x2f3be3>=_0x2b23c9){_0x2f3be3=_0x2b23c9;_0x3579dc=0xc8;}else{_0x3579dc=0xce;}_0x3e12b9[_0x2646('0x2a')](_0x3579dc);return _0x3e12b9[_0x2646('0x30')](_0x2646('0x31'),_0x29ef79+'-'+_0x2f3be3+'/'+_0x2b23c9)[_0x2646('0x2b')](_0x43bb08);}return null;};}function patchUpdates(_0x4d4c03){return function(_0x365fe0){try{jsonpatch['apply'](_0x365fe0,_0x4d4c03,!![]);}catch(_0x30ac55){return BPromise[_0x2646('0x32')](_0x30ac55);}return _0x365fe0[_0x2646('0x33')]();};}function saveUpdates(_0x22ba31,_0x19284d){return function(_0x492596){if(_0x492596){return _0x492596['update'](_0x22ba31)['then'](function(_0x224373){return _0x224373;});}return null;};}function removeEntity(_0xb2e8dc,_0x168e2c){return function(_0x23c503){if(_0x23c503){return _0x23c503['destroy']()[_0x2646('0x1f')](function(){var _0x3978fe=_0x23c503[_0x2646('0x34')]({'plain':!![]});var _0x56cdc7=_0x2646('0x35');return db[_0x2646('0x36')][_0x2646('0x37')]({'where':{'type':_0x56cdc7,'resourceId':_0x3978fe['id']}})[_0x2646('0x1f')](function(){return _0x23c503;});})['then'](function(){_0xb2e8dc[_0x2646('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x285440,_0x5a61e4){return function(_0xabbc72){if(!_0xabbc72){_0x285440['sendStatus'](0x194);}return _0xabbc72;};}function handleError(_0x7de16,_0x44b717){_0x44b717=_0x44b717||0x1f4;return function(_0x165685){logger['error'](_0x165685[_0x2646('0x38')]);if(_0x165685['name']){delete _0x165685[_0x2646('0x39')];}_0x7de16[_0x2646('0x2a')](_0x44b717)[_0x2646('0x3a')](_0x165685);};}exports[_0x2646('0x3b')]=function(_0x5dca9a,_0x4600a6){var _0x218a5b={'include':[{'model':db[_0x2646('0x3c')],'as':_0x2646('0x3d')}]},_0x48a48e={},_0x232c4f={'count':0x0,'rows':[]};var _0x172781=_[_0x2646('0x3e')](db['OpenchannelAccount']['rawAttributes'],function(_0x50730f){return{'name':_0x50730f[_0x2646('0x3f')],'type':_0x50730f[_0x2646('0x40')][_0x2646('0x41')]};});_0x48a48e[_0x2646('0x42')]=_[_0x2646('0x3e')](_0x172781,_0x2646('0x39'));_0x48a48e[_0x2646('0x43')]=_[_0x2646('0x44')](_0x5dca9a[_0x2646('0x43')]);_0x48a48e[_0x2646('0x45')]=_[_0x2646('0x46')](_0x48a48e[_0x2646('0x42')],_0x48a48e['query']);_0x218a5b['attributes']=_[_0x2646('0x46')](_0x48a48e['model'],qs[_0x2646('0x47')](_0x5dca9a[_0x2646('0x43')][_0x2646('0x47')]));_0x218a5b['attributes']=_0x218a5b[_0x2646('0x48')][_0x2646('0x49')]?_0x218a5b[_0x2646('0x48')]:_0x48a48e[_0x2646('0x42')];if(!_0x5dca9a[_0x2646('0x43')][_0x2646('0x4a')](_0x2646('0x4b'))){_0x218a5b['limit']=qs['limit'](_0x5dca9a[_0x2646('0x43')][_0x2646('0x2e')]);_0x218a5b[_0x2646('0x2c')]=qs['offset'](_0x5dca9a[_0x2646('0x43')]['offset']);}_0x218a5b[_0x2646('0x4c')]=qs[_0x2646('0x4d')](_0x5dca9a[_0x2646('0x43')]['sort']);_0x218a5b[_0x2646('0x4e')]=qs['filters'](_[_0x2646('0x4f')](_0x5dca9a[_0x2646('0x43')],_0x48a48e['filters']),_0x172781);if(_0x5dca9a[_0x2646('0x43')]['filter']){_0x218a5b[_0x2646('0x4e')]=_['merge'](_0x218a5b[_0x2646('0x4e')],{'$or':_[_0x2646('0x3e')](_0x172781,function(_0x35499b){if(_0x35499b[_0x2646('0x40')]!==_0x2646('0x50')){var _0x2c066e={};_0x2c066e[_0x35499b['name']]={'$like':'%'+_0x5dca9a[_0x2646('0x43')]['filter']+'%'};return _0x2c066e;}})});}_0x218a5b=_[_0x2646('0x51')]({},_0x218a5b,_0x5dca9a[_0x2646('0x52')]);var _0x462b73={'where':_0x218a5b[_0x2646('0x4e')]};return db[_0x2646('0x53')][_0x2646('0x2f')](_0x462b73)[_0x2646('0x1f')](function(_0x292afa){_0x232c4f[_0x2646('0x2f')]=_0x292afa;if(_0x5dca9a[_0x2646('0x43')][_0x2646('0x54')]){_0x218a5b[_0x2646('0x55')]=[{'all':!![]}];}return db[_0x2646('0x53')][_0x2646('0x56')](_0x218a5b);})[_0x2646('0x1f')](function(_0x1c3987){_0x232c4f[_0x2646('0x57')]=_0x1c3987;return _0x232c4f;})[_0x2646('0x1f')](respondWithFilteredResult(_0x4600a6,_0x218a5b))['catch'](handleError(_0x4600a6,null));};exports[_0x2646('0x58')]=function(_0x352beb,_0x5d6e63){var _0x58924a={'raw':![],'where':{'id':_0x352beb[_0x2646('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1e6aa9={};_0x1e6aa9[_0x2646('0x42')]=_[_0x2646('0x44')](db[_0x2646('0x53')][_0x2646('0x5a')]);_0x1e6aa9[_0x2646('0x43')]=_[_0x2646('0x44')](_0x352beb[_0x2646('0x43')]);_0x1e6aa9['filters']=_[_0x2646('0x46')](_0x1e6aa9[_0x2646('0x42')],_0x1e6aa9[_0x2646('0x43')]);_0x58924a[_0x2646('0x48')]=_[_0x2646('0x46')](_0x1e6aa9['model'],qs[_0x2646('0x47')](_0x352beb[_0x2646('0x43')][_0x2646('0x47')]));_0x58924a[_0x2646('0x48')]=_0x58924a['attributes'][_0x2646('0x49')]?_0x58924a[_0x2646('0x48')]:_0x1e6aa9[_0x2646('0x42')];if(_0x352beb[_0x2646('0x43')][_0x2646('0x54')]){_0x58924a[_0x2646('0x55')]=[{'all':!![]}];}_0x58924a=_[_0x2646('0x51')]({},_0x58924a,_0x352beb['options']);return db[_0x2646('0x53')][_0x2646('0x5b')](_0x58924a)[_0x2646('0x1f')](handleEntityNotFound(_0x5d6e63,null))[_0x2646('0x1f')](respondWithResult(_0x5d6e63,null))[_0x2646('0x28')](handleError(_0x5d6e63,null));};exports[_0x2646('0x5c')]=function(_0x479cdf,_0x3135c3){return db['OpenchannelAccount'][_0x2646('0x5c')](_0x479cdf['body'],{})[_0x2646('0x1f')](function(_0x16df63){var _0x46081a=_0x479cdf['user']['get']({'plain':!![]});if(!_0x46081a)throw new Error(_0x2646('0x5d'));if(_0x46081a[_0x2646('0x5e')]===_0x2646('0x5f')){var _0xfeb1c=_0x16df63[_0x2646('0x34')]({'plain':!![]});var _0x3d6b25=_0x2646('0x35');return db[_0x2646('0x60')][_0x2646('0x5b')]({'where':{'name':_0x3d6b25,'userProfileId':_0x46081a[_0x2646('0x61')]},'raw':!![]})[_0x2646('0x1f')](function(_0x59de60){if(_0x59de60&&_0x59de60['autoAssociation']===0x0){return db['UserProfileResource'][_0x2646('0x5c')]({'name':_0xfeb1c[_0x2646('0x39')],'resourceId':_0xfeb1c['id'],'type':_0x59de60[_0x2646('0x39')],'sectionId':_0x59de60['id']},{})['then'](function(){return _0x16df63;});}else{return _0x16df63;}})[_0x2646('0x28')](function(_0xa95b63){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa95b63);throw _0xa95b63;});}return _0x16df63;})[_0x2646('0x1f')](respondWithResult(_0x3135c3,0xc9))['catch'](handleError(_0x3135c3,null));};exports[_0x2646('0x62')]=function(_0x584c8f,_0x502436){if(_0x584c8f[_0x2646('0x63')]['id']){delete _0x584c8f[_0x2646('0x63')]['id'];}return db[_0x2646('0x53')]['find']({'where':{'id':_0x584c8f[_0x2646('0x59')]['id']},'include':[{'model':db[_0x2646('0x3c')],'as':_0x2646('0x3d')}]})['then'](handleEntityNotFound(_0x502436,null))[_0x2646('0x1f')](saveUpdates(_0x584c8f[_0x2646('0x63')],null))[_0x2646('0x1f')](respondWithResult(_0x502436,null))['catch'](handleError(_0x502436,null));};exports[_0x2646('0x37')]=function(_0xfe02b0,_0x4db5d8){return db['OpenchannelAccount']['find']({'where':{'id':_0xfe02b0[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x4db5d8,null))['then'](removeEntity(_0x4db5d8,null))[_0x2646('0x28')](handleError(_0x4db5d8,null));};exports[_0x2646('0x64')]=function(_0x21daa8,_0x5d917c){return db[_0x2646('0x53')][_0x2646('0x64')]()[_0x2646('0x1f')](respondWithResult(_0x5d917c,null))[_0x2646('0x28')](handleError(_0x5d917c,null));};exports['addDisposition']=function(_0xf4ab5,_0x433b79,_0x1a767c){if(_0xf4ab5['body']['id']){delete _0xf4ab5[_0x2646('0x63')]['id'];}return db[_0x2646('0x53')][_0x2646('0x5b')]({'where':{'id':_0xf4ab5[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x433b79,null))['then'](function(_0x569c46){if(_0x569c46){_0xf4ab5[_0x2646('0x63')]['OpenchannelAccountId']=_0x569c46['id'];return db['Disposition'][_0x2646('0x5c')](_0xf4ab5[_0x2646('0x63')]);}})[_0x2646('0x1f')](respondWithResult(_0x433b79,null))['catch'](handleError(_0x433b79,null));};exports[_0x2646('0x65')]=function(_0x5758c1,_0x2661da,_0x99c33d){var _0x5313fc={'raw':![],'where':{}};var _0x9579b5={};var _0x58ab6e={'count':0x0,'rows':[]};return db[_0x2646('0x53')][_0x2646('0x66')]({'where':{'id':_0x5758c1[_0x2646('0x59')]['id']}})['then'](handleEntityNotFound(_0x2661da,null))['then'](function(_0x1405eb){if(_0x1405eb){_0x9579b5['model']=_['keys'](db[_0x2646('0x67')][_0x2646('0x5a')]);_0x9579b5[_0x2646('0x43')]=_[_0x2646('0x44')](_0x5758c1['query']);_0x9579b5['filters']=_['intersection'](_0x9579b5[_0x2646('0x42')],_0x9579b5[_0x2646('0x43')]);_0x5313fc[_0x2646('0x48')]=_[_0x2646('0x46')](_0x9579b5[_0x2646('0x42')],qs[_0x2646('0x47')](_0x5758c1[_0x2646('0x43')]['fields']));_0x5313fc[_0x2646('0x48')]=_0x5313fc[_0x2646('0x48')][_0x2646('0x49')]?_0x5313fc[_0x2646('0x48')]:_0x9579b5[_0x2646('0x42')];if(!_0x5758c1[_0x2646('0x43')][_0x2646('0x4a')](_0x2646('0x4b'))){_0x5313fc[_0x2646('0x2e')]=qs[_0x2646('0x2e')](_0x5758c1['query']['limit']);_0x5313fc[_0x2646('0x2c')]=qs[_0x2646('0x2c')](_0x5758c1[_0x2646('0x43')][_0x2646('0x2c')]);}_0x5313fc[_0x2646('0x4c')]=qs['sort'](_0x5758c1['query'][_0x2646('0x4d')]);_0x5313fc[_0x2646('0x4e')]=qs[_0x2646('0x45')](_[_0x2646('0x4f')](_0x5758c1['query'],_0x9579b5['filters']));_0x5313fc[_0x2646('0x4e')]['OpenchannelAccountId']=_0x1405eb['id'];if(_0x5758c1[_0x2646('0x43')][_0x2646('0x68')]){_0x5313fc['where']=_['merge'](_0x5313fc[_0x2646('0x4e')],{'$or':_[_0x2646('0x3e')](_0x5313fc['attributes'],function(_0x308677){var _0xd13fec={};_0xd13fec[_0x308677]={'$like':'%'+_0x5758c1['query'][_0x2646('0x68')]+'%'};return _0xd13fec;})});}_0x5313fc=_['merge']({},_0x5313fc,_0x5758c1[_0x2646('0x52')]);return db[_0x2646('0x67')][_0x2646('0x2f')]({'where':_0x5313fc[_0x2646('0x4e')]})[_0x2646('0x1f')](function(_0x59c362){_0x58ab6e[_0x2646('0x2f')]=_0x59c362;if(_0x5758c1[_0x2646('0x43')][_0x2646('0x54')]){_0x5313fc[_0x2646('0x55')]=[{'all':!![]}];}return db[_0x2646('0x67')][_0x2646('0x56')](_0x5313fc);})['then'](function(_0x19fc52){_0x58ab6e[_0x2646('0x57')]=_0x19fc52;return _0x58ab6e;});}})[_0x2646('0x1f')](respondWithFilteredResult(_0x2661da,_0x5313fc))[_0x2646('0x28')](handleError(_0x2661da,null));};exports[_0x2646('0x69')]=function(_0x4178f7,_0x26e340,_0x5ad62c){return db[_0x2646('0x53')]['find']({'where':{'id':_0x4178f7[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x26e340,null))[_0x2646('0x1f')](function(_0x3ab543){if(_0x3ab543){return _0x3ab543[_0x2646('0x69')](_0x4178f7['query']['ids']);}})[_0x2646('0x1f')](respondWithStatusCode(_0x26e340,null))[_0x2646('0x28')](handleError(_0x26e340,null));};exports[_0x2646('0x6a')]=function(_0x4fa75f,_0x21b140,_0x225e54){if(_0x4fa75f[_0x2646('0x63')]['id']){delete _0x4fa75f[_0x2646('0x63')]['id'];}return db[_0x2646('0x53')][_0x2646('0x5b')]({'where':{'id':_0x4fa75f['params']['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x21b140,null))[_0x2646('0x1f')](function(_0x597e0c){if(_0x597e0c){_0x4fa75f['body'][_0x2646('0x6b')]=_0x597e0c['id'];return db[_0x2646('0x6c')][_0x2646('0x5c')](_0x4fa75f['body']);}})[_0x2646('0x1f')](respondWithResult(_0x21b140,null))[_0x2646('0x28')](handleError(_0x21b140,null));};exports[_0x2646('0x6d')]=function(_0x371844,_0x337aa9,_0x433f32){var _0xc88084={'raw':![],'where':{}};var _0x2eee38={};var _0x28f9a9={'count':0x0,'rows':[]};return db[_0x2646('0x53')][_0x2646('0x66')]({'where':{'id':_0x371844[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x337aa9,null))['then'](function(_0x43cca7){if(_0x43cca7){_0x2eee38[_0x2646('0x42')]=_['keys'](db[_0x2646('0x6c')][_0x2646('0x5a')]);_0x2eee38[_0x2646('0x43')]=_[_0x2646('0x44')](_0x371844[_0x2646('0x43')]);_0x2eee38[_0x2646('0x45')]=_['intersection'](_0x2eee38[_0x2646('0x42')],_0x2eee38['query']);_0xc88084['attributes']=_['intersection'](_0x2eee38[_0x2646('0x42')],qs[_0x2646('0x47')](_0x371844['query'][_0x2646('0x47')]));_0xc88084[_0x2646('0x48')]=_0xc88084['attributes'][_0x2646('0x49')]?_0xc88084['attributes']:_0x2eee38[_0x2646('0x42')];if(!_0x371844[_0x2646('0x43')][_0x2646('0x4a')]('nolimit')){_0xc88084['limit']=qs[_0x2646('0x2e')](_0x371844[_0x2646('0x43')]['limit']);_0xc88084['offset']=qs[_0x2646('0x2c')](_0x371844[_0x2646('0x43')][_0x2646('0x2c')]);}_0xc88084[_0x2646('0x4c')]=qs[_0x2646('0x4d')](_0x371844[_0x2646('0x43')][_0x2646('0x4d')]);_0xc88084[_0x2646('0x4e')]=qs['filters'](_['pick'](_0x371844['query'],_0x2eee38['filters']));_0xc88084[_0x2646('0x4e')][_0x2646('0x6b')]=_0x43cca7['id'];if(_0x371844[_0x2646('0x43')][_0x2646('0x68')]){_0xc88084[_0x2646('0x4e')]=_[_0x2646('0x51')](_0xc88084[_0x2646('0x4e')],{'$or':_['map'](_0xc88084[_0x2646('0x48')],function(_0x436158){var _0x1a8d4e={};_0x1a8d4e[_0x436158]={'$like':'%'+_0x371844[_0x2646('0x43')][_0x2646('0x68')]+'%'};return _0x1a8d4e;})});}_0xc88084=_[_0x2646('0x51')]({},_0xc88084,_0x371844[_0x2646('0x52')]);return db['CannedAnswer'][_0x2646('0x2f')]({'where':_0xc88084[_0x2646('0x4e')]})[_0x2646('0x1f')](function(_0x3aba33){_0x28f9a9[_0x2646('0x2f')]=_0x3aba33;if(_0x371844[_0x2646('0x43')][_0x2646('0x54')]){_0xc88084[_0x2646('0x55')]=[{'all':!![]}];}return db[_0x2646('0x6c')]['findAll'](_0xc88084);})[_0x2646('0x1f')](function(_0x2db151){_0x28f9a9[_0x2646('0x57')]=_0x2db151;return _0x28f9a9;});}})['then'](respondWithFilteredResult(_0x337aa9,_0xc88084))[_0x2646('0x28')](handleError(_0x337aa9,null));};exports[_0x2646('0x6e')]=function(_0x3b093d,_0x4707e4,_0x33018d){return db[_0x2646('0x53')][_0x2646('0x5b')]({'where':{'id':_0x3b093d[_0x2646('0x59')]['id']}})['then'](handleEntityNotFound(_0x4707e4,null))['then'](function(_0x309556){if(_0x309556){return _0x309556[_0x2646('0x6e')](_0x3b093d[_0x2646('0x43')][_0x2646('0x6f')]);}})[_0x2646('0x1f')](respondWithStatusCode(_0x4707e4,null))[_0x2646('0x28')](handleError(_0x4707e4,null));};exports[_0x2646('0x70')]=function(_0x5ea5c7,_0x4c1ee0,_0x2fe60e){var _0x2f7ce6={'body':_0x5ea5c7[_0x2646('0x63')],'channel':'openchannel'};var _0x17fab8=[];var _0x46ac3e=[];var _0xca0bbe={};var _0x11a7eb=![];return db['CmContact']['describe']()['then'](function(_0x56cd34){if(!_0x56cd34){throw new db[(_0x2646('0x71'))]['ValidationError'](_0x2646('0x72'));}_0x17fab8=_[_0x2646('0x73')](_[_0x2646('0x44')](_0x56cd34),[_0x2646('0x74'),_0x2646('0x75')]);_0x46ac3e=_[_0x2646('0x73')](_[_0x2646('0x44')](_0x56cd34),[_0x2646('0x74'),'updatedAt',_0x2646('0x76'),_0x2646('0x77')]);if(_0x5ea5c7[_0x2646('0x63')]['id']){delete _0x5ea5c7[_0x2646('0x63')]['id'];}if(_[_0x2646('0x78')](_0x5ea5c7['body']['from'])){throw new db[(_0x2646('0x71'))]['ValidationError'](_0x2646('0x79'));}if(_[_0x2646('0x78')](_0x5ea5c7[_0x2646('0x63')][_0x2646('0x63')])||_0x5ea5c7[_0x2646('0x63')][_0x2646('0x63')]===''){throw new db[(_0x2646('0x71'))][(_0x2646('0x7a'))](_0x2646('0x7b'));}if(_[_0x2646('0x78')](_0x5ea5c7[_0x2646('0x63')]['mapKey'])){throw new db[(_0x2646('0x71'))][(_0x2646('0x7a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x46ac3e);}if(!_['includes'](_0x46ac3e,_0x5ea5c7[_0x2646('0x63')][_0x2646('0x7c')])){throw new db['Sequelize'][(_0x2646('0x7a'))](_0x2646('0x7d')+_0x46ac3e);}_0xca0bbe[_0x5ea5c7[_0x2646('0x63')][_0x2646('0x7c')]]=_0x5ea5c7[_0x2646('0x63')]['from'];})['then'](function(){return db[_0x2646('0x53')][_0x2646('0x5b')]({'where':{'id':_0x5ea5c7['params']['id']},'include':[{'model':db[_0x2646('0x7e')],'as':'List','include':[{'model':db[_0x2646('0x7f')],'as':'Contacts','where':_0xca0bbe,'limit':0x1,'order':[['updatedAt',_0x2646('0x80')]]}]},{'model':db['OpenchannelApplication'],'as':_0x2646('0x81')}]});})[_0x2646('0x1f')](handleEntityNotFound(_0x4c1ee0,null))[_0x2646('0x1f')](function(_0x157401){if(_0x157401&&_0x157401[_0x2646('0x82')]){_0x2f7ce6['account']=_0x157401;_0x2f7ce6[_0x2646('0x83')]=_0x157401[_0x2646('0x81')];_0x2f7ce6[_0x2646('0x84')]=_0x157401[_0x2646('0x82')];_0x2f7ce6['applications']=_['orderBy'](_0x2f7ce6[_0x2646('0x83')],[_0x2646('0x85')],[_0x2646('0x86')]);if(_0x2f7ce6[_0x2646('0x87')][_0x2646('0x81')]){delete _0x2f7ce6[_0x2646('0x87')][_0x2646('0x81')];}if(_0x2f7ce6[_0x2646('0x87')]['List']&&_0x2f7ce6[_0x2646('0x87')][_0x2646('0x82')][_0x2646('0x88')][_0x2646('0x49')]){return _0x2f7ce6['account'][_0x2646('0x82')][_0x2646('0x88')][0x0];}var _0x13a669=_[_0x2646('0x89')](_0x5ea5c7[_0x2646('0x63')],{'firstName':_0x5ea5c7['body'][_0x2646('0x8a')],'ListId':_0x157401[_0x2646('0x77')]});_0x13a669[_0x5ea5c7['body'][_0x2646('0x7c')]]=_0x5ea5c7[_0x2646('0x63')]['from'];return db['CmContact'][_0x2646('0x5c')](_0x13a669,{'fields':_0x17fab8,'raw':!![]});}})[_0x2646('0x1f')](handleEntityNotFound(_0x4c1ee0,null))[_0x2646('0x1f')](function(_0xbb5b05){_0x2f7ce6['contact']=_0xbb5b05;if(_0xbb5b05){var _0x3d9965={'ContactId':_0xbb5b05['id'],'OpenchannelAccountId':_0x5ea5c7[_0x2646('0x59')]['id'],'from':(_0xbb5b05['firstName']||'')+'\x20'+(_0xbb5b05['lastName']||'')};var _0x57c0c9={'OpenchannelAccountId':_0x5ea5c7[_0x2646('0x59')]['id'],'closed':![]};if(_0x5ea5c7['body']['threadId']){_0x57c0c9[_0x2646('0x8b')]=_0x5ea5c7['body'][_0x2646('0x8b')];return db[_0x2646('0x8c')]['find']({'where':_0x57c0c9})['then'](function(_0x2f2efe){if(_0x2f2efe){return[_0x2f2efe,![]];}_0x3d9965[_0x2646('0x8b')]=_0x5ea5c7[_0x2646('0x63')][_0x2646('0x8b')];_0x3d9965[_0x2646('0x8d')]=_0x5ea5c7['body'][_0x2646('0x8d')];return db[_0x2646('0x8c')][_0x2646('0x5c')](_0x3d9965)['then'](function(_0xde919b){return[_0xde919b,!![]];});});}else{_0x57c0c9['threadId']=null;}_0x57c0c9[_0x2646('0x8e')]=_0xbb5b05['id'];return db[_0x2646('0x8c')][_0x2646('0x5b')]({'where':_0x57c0c9})[_0x2646('0x1f')](function(_0x2878a7){if(_0x2878a7){return[_0x2878a7,![]];}return db[_0x2646('0x8c')][_0x2646('0x5c')](_0x3d9965)[_0x2646('0x1f')](function(_0x33a21c){return[_0x33a21c,!![]];});});}})[_0x2646('0x8f')](function(_0x20e7e8,_0x5e028b){if(_0x20e7e8){_0x11a7eb=_0x5e028b;if(!_0x5e028b){var _0x5bc921={'from':(_0x2f7ce6['contact'][_0x2646('0x90')]||'')+'\x20'+(_0x2f7ce6[_0x2646('0x91')][_0x2646('0x92')]||'')};if(_0x5ea5c7[_0x2646('0x63')][_0x2646('0x8b')]&&_0x5ea5c7[_0x2646('0x63')][_0x2646('0x93')]&&_0x5ea5c7[_0x2646('0x63')]['threadId']!=_0x5ea5c7[_0x2646('0x63')][_0x2646('0x93')]){_0x5bc921[_0x2646('0x8b')]=_0x5ea5c7[_0x2646('0x63')][_0x2646('0x93')];}return _0x20e7e8['update'](_0x5bc921);}else{return _0x20e7e8;}}})[_0x2646('0x1f')](function(_0x57c494){_0x2f7ce6['interaction']=_0x57c494[_0x2646('0x34')]({'plain':!![]});_0x2f7ce6[_0x2646('0x94')][_0x2646('0x95')]=_0x11a7eb;if(_0x2f7ce6[_0x2646('0x94')][_0x2646('0x95')]){if(_0x2f7ce6[_0x2646('0x87')][_0x2646('0x96')]){_0x2f7ce6[_0x2646('0x83')]['push']({'id':0x0,'priority':_0x2f7ce6[_0x2646('0x83')][_0x2646('0x49')]+0x1,'app':_0x2646('0x97'),'appdata':_0x2646('0x98'),'interval':_0x2646('0x99')});}}return db[_0x2646('0x9a')][_0x2646('0x5c')]({'body':_0x5ea5c7[_0x2646('0x63')][_0x2646('0x63')],'OpenchannelAccountId':_0x5ea5c7[_0x2646('0x59')]['id'],'OpenchannelInteractionId':_0x57c494['id'],'direction':'in','ContactId':_0x2f7ce6[_0x2646('0x91')]['id'],'AttachmentId':_0x5ea5c7[_0x2646('0x63')]['AttachmentId']});})[_0x2646('0x1f')](function(_0x3092cc){_0x2f7ce6['message']=_0x3092cc;if(!_0x2f7ce6[_0x2646('0x94')]['UserId'])return;return db[_0x2646('0x9b')]['find']({'attributes':['id','name'],'where':{'id':_0x2f7ce6[_0x2646('0x94')]['UserId']}});})['then'](function(_0x102722){if(_0x102722){_0x2f7ce6['applications'][_0x2646('0x9c')]({'id':0x0,'priority':0x0,'app':_0x2646('0x9d'),'appdata':_0x102722['name']+','+(_0x2f7ce6['account'][_0x2646('0x9e')]||0xa),'interval':'*,*,*,*'});}if(!_0x2f7ce6[_0x2646('0x94')][_0x2646('0x9f')])return;return db[_0x2646('0xa0')]['find']({'attributes':['id',_0x2646('0x39')],'where':{'id':_0x2f7ce6[_0x2646('0x94')][_0x2646('0x9f')]}});})['then'](function(_0x4114b6){if(_0x4114b6){_0x2f7ce6[_0x2646('0x83')][_0x2646('0x9c')]({'id':0x0,'priority':0x1,'app':_0x2646('0xa1'),'appdata':_0x4114b6[_0x2646('0x39')]+','+(_0x2f7ce6[_0x2646('0x87')][_0x2646('0xa2')]||0x12c),'interval':_0x2646('0x99')});}return respondWithRpcPromise(_0x2646('0xa3'),'startRouting',_0x2f7ce6);})['then'](function(_0x48aa95){respondWithRpcPromise('EventManager','EventManager',{'event':_0x2646('0x70'),'message':_0x48aa95},client9002);return _0x48aa95;})[_0x2646('0x1f')](respondWithResult(_0x4c1ee0,null))[_0x2646('0x28')](handleError(_0x4c1ee0,null));};exports['addApplications']=function(_0x5ca682,_0x407212){var _0x1c6951=_0x5ca682[_0x2646('0x59')]['id'];var _0x117c50=_0x5ca682[_0x2646('0x63')];var _0x556c07=0xc8;var _0xf7867=null;return db['sequelize'][_0x2646('0xa4')]({'isolationLevel':db[_0x2646('0xa5')][_0x2646('0xa6')][_0x2646('0xa7')]['READ_COMMITTED']},function(_0x5884eb){return db['OpenchannelAccount'][_0x2646('0x66')]({'where':{'id':_0x1c6951},'transaction':_0x5884eb})[_0x2646('0x1f')](function(_0x3c4808){if(_0x3c4808){return db['OpenchannelApplication'][_0x2646('0x37')]({'where':{'OpenchannelAccountId':_0x1c6951},'transaction':_0x5884eb})[_0x2646('0x1f')](function(){var _0x7248cf=_[_0x2646('0x3e')](_0x117c50,function(_0x439906){_0x439906['OpenchannelAccountId']=_0x1c6951;return _0x439906;});return db[_0x2646('0xa8')][_0x2646('0xa9')](_0x7248cf,{'transaction':_0x5884eb});});}else{_0x556c07=0x194;_0xf7867=[];}});})['then'](function(){if(_0x556c07!==0x194){return db[_0x2646('0xa8')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x1c6951},'order':_0x2646('0x85')})[_0x2646('0x1f')](function(_0x10b491){_0xf7867=_0x10b491;});}})[_0x2646('0x28')](function(_0x532e34){_0x556c07=0x1f4;logger[_0x2646('0x24')](_0x532e34[_0x2646('0x38')]);if(_0x532e34[_0x2646('0x39')]){delete _0x532e34[_0x2646('0x39')];}_0xf7867=_0x532e34;})[_0x2646('0xaa')](function(){if(_0xf7867===null){_0x407212[_0x2646('0x29')](_0x556c07);}else{if(_0x556c07===0x1f4){_0x407212['status'](_0x556c07)['send'](_0xf7867);}else{_0x407212['status'](_0x556c07)[_0x2646('0x2b')](_0xf7867);}}});};exports[_0x2646('0xab')]=function(_0x5476e9,_0x533882,_0x3c9865){var _0x36558a={};var _0x3c0c33={};var _0x5846f0;var _0x49d632;return db[_0x2646('0x53')][_0x2646('0x66')]({'where':{'id':_0x5476e9[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x533882,null))[_0x2646('0x1f')](function(_0xc1fed1){if(_0xc1fed1){_0x5846f0=_0xc1fed1;_0x3c0c33[_0x2646('0x42')]=_[_0x2646('0x44')](db[_0x2646('0xa8')][_0x2646('0x5a')]);_0x3c0c33[_0x2646('0x43')]=_['keys'](_0x5476e9[_0x2646('0x43')]);_0x3c0c33['filters']=_['intersection'](_0x3c0c33[_0x2646('0x42')],_0x3c0c33['query']);_0x36558a['attributes']=_['intersection'](_0x3c0c33[_0x2646('0x42')],qs[_0x2646('0x47')](_0x5476e9[_0x2646('0x43')][_0x2646('0x47')]));_0x36558a['attributes']=_0x36558a[_0x2646('0x48')][_0x2646('0x49')]?_0x36558a[_0x2646('0x48')]:_0x3c0c33[_0x2646('0x42')];_0x36558a[_0x2646('0x4c')]=qs['sort'](_0x5476e9[_0x2646('0x43')][_0x2646('0x4d')]);_0x36558a[_0x2646('0x4e')]=qs['filters'](_[_0x2646('0x4f')](_0x5476e9[_0x2646('0x43')],_0x3c0c33[_0x2646('0x45')]));if(_0x5476e9['query']['filter']){_0x36558a['where']=_['merge'](_0x36558a[_0x2646('0x4e')],{'$or':_['map'](_0x36558a[_0x2646('0x48')],function(_0x2c8a12){var _0x616982={};_0x616982[_0x2c8a12]={'$like':'%'+_0x5476e9['query']['filter']+'%'};return _0x616982;})});}_0x36558a=_[_0x2646('0x51')]({},_0x36558a,_0x5476e9[_0x2646('0x52')]);return _0x5846f0[_0x2646('0xab')](_0x36558a);}})[_0x2646('0x1f')](function(_0x18f4d0){if(_0x18f4d0){_0x49d632=_0x18f4d0[_0x2646('0x49')];if(!_0x5476e9['query'][_0x2646('0x4a')]('nolimit')){_0x36558a[_0x2646('0x2e')]=qs[_0x2646('0x2e')](_0x5476e9[_0x2646('0x43')][_0x2646('0x2e')]);_0x36558a['offset']=qs[_0x2646('0x2c')](_0x5476e9[_0x2646('0x43')][_0x2646('0x2c')]);}return _0x5846f0['getApplications'](_0x36558a);}})['then'](function(_0x4602f1){if(_0x4602f1){return _0x4602f1?{'count':_0x49d632,'rows':_0x4602f1}:null;}})[_0x2646('0x1f')](respondWithResult(_0x533882,null))['catch'](handleError(_0x533882,null));};exports['getInteractions']=function(_0x246cde,_0x45f4a3,_0x3cd27c){var _0x100075={'raw':![],'where':{}};var _0x294618={};var _0x5a4f2e={'count':0x0,'rows':[]};return db[_0x2646('0x53')][_0x2646('0x66')]({'where':{'id':_0x246cde[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x45f4a3,null))[_0x2646('0x1f')](function(_0x5160e5){if(_0x5160e5){_0x294618[_0x2646('0x42')]=_[_0x2646('0x44')](db[_0x2646('0x8c')][_0x2646('0x5a')]);_0x294618[_0x2646('0x43')]=_['keys'](_0x246cde[_0x2646('0x43')]);_0x294618[_0x2646('0x45')]=_[_0x2646('0x46')](_0x294618[_0x2646('0x42')],_0x294618[_0x2646('0x43')]);_0x100075[_0x2646('0x48')]=_[_0x2646('0x46')](_0x294618[_0x2646('0x42')],qs[_0x2646('0x47')](_0x246cde[_0x2646('0x43')]['fields']));_0x100075[_0x2646('0x48')]=_0x100075[_0x2646('0x48')][_0x2646('0x49')]?_0x100075[_0x2646('0x48')]:_0x294618[_0x2646('0x42')];if(!_0x246cde[_0x2646('0x43')]['hasOwnProperty'](_0x2646('0x4b'))){_0x100075[_0x2646('0x2e')]=qs[_0x2646('0x2e')](_0x246cde[_0x2646('0x43')][_0x2646('0x2e')]);_0x100075[_0x2646('0x2c')]=qs[_0x2646('0x2c')](_0x246cde[_0x2646('0x43')][_0x2646('0x2c')]);}_0x100075[_0x2646('0x4c')]=qs[_0x2646('0x4d')](_0x246cde['query'][_0x2646('0x4d')]);_0x100075['where']=qs[_0x2646('0x45')](_[_0x2646('0x4f')](_0x246cde[_0x2646('0x43')],_0x294618[_0x2646('0x45')]));_0x100075[_0x2646('0x4e')][_0x2646('0x6b')]=_0x5160e5['id'];if(_0x246cde[_0x2646('0x43')][_0x2646('0x68')]){_0x100075[_0x2646('0x4e')]=_[_0x2646('0x51')](_0x100075[_0x2646('0x4e')],{'$or':_['map'](_0x100075['attributes'],function(_0x492a4c){var _0x4eab86={};_0x4eab86[_0x492a4c]={'$like':'%'+_0x246cde[_0x2646('0x43')][_0x2646('0x68')]+'%'};return _0x4eab86;})});}_0x100075=_[_0x2646('0x51')]({},_0x100075,_0x246cde[_0x2646('0x52')]);return db[_0x2646('0x8c')][_0x2646('0x2f')]({'where':_0x100075[_0x2646('0x4e')]})[_0x2646('0x1f')](function(_0x411976){_0x5a4f2e['count']=_0x411976;if(_0x246cde[_0x2646('0x43')]['includeAll']){_0x100075[_0x2646('0x55')]=[{'model':db[_0x2646('0x7f')],'as':_0x2646('0xac'),'required':![]},{'model':db[_0x2646('0x9b')],'as':_0x2646('0xad'),'attributes':[_0x2646('0x39'),_0x2646('0xae'),'internal'],'required':![]},{'model':db[_0x2646('0xaf')],'as':_0x2646('0xb0'),'attributes':['id',_0x2646('0x39'),_0x2646('0xb1')],'where':_0x246cde[_0x2646('0x43')][_0x2646('0xb2')]?{'id':_0x246cde['query'][_0x2646('0xb2')]}:undefined,'required':_0x246cde[_0x2646('0x43')][_0x2646('0xb2')]?!![]:![]}];}return db[_0x2646('0x8c')][_0x2646('0x56')](_0x100075);})[_0x2646('0x1f')](function(_0x2ad4a2){_0x5a4f2e[_0x2646('0x57')]=_0x2ad4a2;return _0x5a4f2e;});}})[_0x2646('0x1f')](respondWithFilteredResult(_0x45f4a3,_0x100075))[_0x2646('0x28')](handleError(_0x45f4a3,null));};exports[_0x2646('0xb3')]=function(_0x1ec012,_0x437270,_0x4fb80a){return db[_0x2646('0x53')][_0x2646('0x5b')]({'where':{'id':_0x1ec012[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x437270,null))[_0x2646('0x1f')](function(_0x228431){if(_0x228431){return _0x228431[_0x2646('0xb3')](_0x1ec012[_0x2646('0x63')][_0x2646('0x6f')],_['omit'](_0x1ec012[_0x2646('0x63')],[_0x2646('0x6f'),'id'])||{})[_0x2646('0x8f')](function(_0x4cfeee){for(var _0x183e89=0x0;_0x183e89<_0x1ec012[_0x2646('0x63')][_0x2646('0x6f')][_0x2646('0x49')];_0x183e89+=0x1){socket[_0x2646('0xb4')]('userOpenchannelAccount:save',{'UserId':Number(_0x1ec012['body'][_0x2646('0x6f')][_0x183e89]),'OpenchannelAccountId':Number(_0x1ec012[_0x2646('0x59')]['id'])});}return _0x4cfeee;});}})[_0x2646('0x1f')](respondWithResult(_0x437270,null))['catch'](handleError(_0x437270,null));};exports['removeAgents']=function(_0x275caf,_0x344b12,_0x5bda8c){return db[_0x2646('0x53')][_0x2646('0x5b')]({'where':{'id':_0x275caf[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x344b12,null))[_0x2646('0x1f')](function(_0x3e970b){if(_0x3e970b){return _0x3e970b['removeAgents'](_0x275caf[_0x2646('0x43')][_0x2646('0x6f')])[_0x2646('0x1f')](function(){if(_[_0x2646('0xb5')](_0x275caf[_0x2646('0x43')][_0x2646('0x6f')])){for(var _0x5dc74e=0x0;_0x5dc74e<_0x275caf['query'][_0x2646('0x6f')][_0x2646('0x49')];_0x5dc74e+=0x1){socket[_0x2646('0xb4')](_0x2646('0xb6'),{'UserId':Number(_0x275caf['query'][_0x2646('0x6f')][_0x5dc74e]),'OpenchannelAccountId':Number(_0x275caf[_0x2646('0x59')]['id'])});}}else{socket['emit'](_0x2646('0xb6'),{'UserId':Number(_0x275caf[_0x2646('0x43')][_0x2646('0x6f')]),'OpenchannelAccountId':Number(_0x275caf[_0x2646('0x59')]['id'])});}});}})[_0x2646('0x1f')](respondWithStatusCode(_0x344b12,null))['catch'](handleError(_0x344b12,null));};exports[_0x2646('0xb7')]=function(_0x186208,_0x5d0390,_0x58e07a){var _0x496ae0={};var _0x51637f={};var _0x488165;var _0x1e7d4d;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x186208[_0x2646('0x59')]['id']}})['then'](handleEntityNotFound(_0x5d0390,null))['then'](function(_0x26825c){if(_0x26825c){_0x488165=_0x26825c;_0x51637f[_0x2646('0x42')]=_[_0x2646('0x44')](db[_0x2646('0x9b')][_0x2646('0x5a')]);_0x51637f[_0x2646('0x43')]=_['keys'](_0x186208[_0x2646('0x43')]);_0x51637f[_0x2646('0x45')]=_[_0x2646('0x46')](_0x51637f[_0x2646('0x42')],_0x51637f[_0x2646('0x43')]);_0x496ae0[_0x2646('0x48')]=_[_0x2646('0x46')](_0x51637f[_0x2646('0x42')],qs[_0x2646('0x47')](_0x186208[_0x2646('0x43')]['fields']));_0x496ae0[_0x2646('0x48')]=_0x496ae0[_0x2646('0x48')][_0x2646('0x49')]?_0x496ae0[_0x2646('0x48')]:_0x51637f[_0x2646('0x42')];_0x496ae0[_0x2646('0x4c')]=qs[_0x2646('0x4d')](_0x186208[_0x2646('0x43')]['sort']);_0x496ae0[_0x2646('0x4e')]=qs[_0x2646('0x45')](_[_0x2646('0x4f')](_0x186208[_0x2646('0x43')],_0x51637f[_0x2646('0x45')]));if(_0x186208[_0x2646('0x43')][_0x2646('0x68')]){_0x496ae0[_0x2646('0x4e')]=_['merge'](_0x496ae0[_0x2646('0x4e')],{'$or':_[_0x2646('0x3e')](_0x496ae0[_0x2646('0x48')],function(_0x578b64){var _0xfb39e1={};_0xfb39e1[_0x578b64]={'$like':'%'+_0x186208[_0x2646('0x43')][_0x2646('0x68')]+'%'};return _0xfb39e1;})});}_0x496ae0=_['merge']({},_0x496ae0,_0x186208[_0x2646('0x52')]);return _0x488165[_0x2646('0xb7')](_0x496ae0);}})[_0x2646('0x1f')](function(_0x8a521b){if(_0x8a521b){_0x1e7d4d=_0x8a521b[_0x2646('0x49')];if(!_0x186208[_0x2646('0x43')][_0x2646('0x4a')](_0x2646('0x4b'))){_0x496ae0[_0x2646('0x2e')]=qs[_0x2646('0x2e')](_0x186208[_0x2646('0x43')][_0x2646('0x2e')]);_0x496ae0[_0x2646('0x2c')]=qs[_0x2646('0x2c')](_0x186208[_0x2646('0x43')][_0x2646('0x2c')]);}return _0x488165[_0x2646('0xb7')](_0x496ae0);}})[_0x2646('0x1f')](function(_0x2400d6){if(_0x2400d6){return _0x2400d6?{'count':_0x1e7d4d,'rows':_0x2400d6}:null;}})['then'](respondWithResult(_0x5d0390,null))[_0x2646('0x28')](handleError(_0x5d0390,null));};exports['send']=function(_0x36d6c5,_0x1c86bf,_0x4c4de6){var _0x459fac,_0x5dc980,_0x567520;if(_[_0x2646('0x78')](_0x36d6c5['body'][_0x2646('0x63')])||_0x36d6c5[_0x2646('0x63')]['body']===''){throw new db[(_0x2646('0x71'))][(_0x2646('0x7a'))](_0x2646('0x7b'));}if(_[_0x2646('0x78')](_0x36d6c5[_0x2646('0x63')]['to'])){}_0x459fac=_0x36d6c5['body']['to'];return db[_0x2646('0x53')][_0x2646('0x66')]({'where':{'id':_0x36d6c5['params']['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x1c86bf,null))[_0x2646('0x1f')](function(_0x346f3c){if(_0x346f3c){return db[_0x2646('0x53')]['find']({'where':{'id':_0x346f3c['id']},'include':[{'model':db[_0x2646('0x7e')],'as':_0x2646('0x82'),'include':[{'model':db[_0x2646('0x7f')],'as':_0x2646('0x88'),'where':{[_0x346f3c[_0x2646('0x7c')]]:_0x459fac},'limit':0x1,'order':[[_0x2646('0x75'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x1c86bf,null))[_0x2646('0x1f')](function(_0x21ec99){if(_0x21ec99&&_0x21ec99['List']){_0x5dc980=_0x21ec99['get']({'plain':!![]});if(_0x5dc980['List']&&_0x5dc980[_0x2646('0x82')]['Contacts'][_0x2646('0x49')]){return _0x5dc980[_0x2646('0x82')]['Contacts'][0x0];}return db[_0x2646('0x7f')][_0x2646('0x5c')](_[_0x2646('0x89')](_0x36d6c5['body'],{'firstName':_0x459fac,[_0x21ec99['mapKey']]:_0x459fac,'phone':_0x459fac,'ListId':_0x5dc980[_0x2646('0x77')]}));}})[_0x2646('0x1f')](handleEntityNotFound(_0x1c86bf,null))[_0x2646('0x1f')](function(_0x5a1290){if(_0x5a1290){_0x567520=_0x5a1290;return db['OpenchannelInteraction'][_0x2646('0x5b')]({'where':{'ContactId':_0x567520['id'],'closed':![],'OpenchannelAccountId':_0x5dc980['id']}})[_0x2646('0x1f')](function(_0x23f12f){if(_0x23f12f){return[_0x23f12f,![]];}return db[_0x2646('0x8c')][_0x2646('0x5c')]({'UserId':_0x36d6c5[_0x2646('0x5f')]['id'],'ContactId':_0x567520['id'],'OpenchannelAccountId':_0x5dc980['id'],'lastMsgDirection':_0x2646('0xb8'),'firstMsgDirection':_0x2646('0xb8'),'Messages':[_[_0x2646('0x51')](_0x36d6c5['body'],{'read':![],'body':_0x36d6c5['body'][_0x2646('0x63')],'OpenchannelAccountId':_0x5dc980['id'],'UserId':_0x36d6c5[_0x2646('0x5f')]['id'],'ContactId':_0x567520['id']})]},{'include':[{'model':db[_0x2646('0x9a')],'as':_0x2646('0xb9')}]})[_0x2646('0x1f')](function(_0x58c0ca){return[_0x58c0ca,!![]];});});}})[_0x2646('0x8f')](function(_0x2993f6,_0x36961f){if(_0x36961f){return _0x2993f6;}return db[_0x2646('0x9a')][_0x2646('0x5c')](_['merge'](_0x36d6c5[_0x2646('0x63')],{'read':![],'body':_0x36d6c5['body'][_0x2646('0x63')],'OpenchannelAccountId':_0x5dc980['id'],'OpenchannelInteractionId':_0x2993f6['id'],'UserId':_0x36d6c5[_0x2646('0x5f')]['id'],'ContactId':_0x567520['id']}))[_0x2646('0x1f')](function(_0x562232){_0x2993f6[_0x2646('0xba')]['Messages']=[];_0x2993f6['dataValues'][_0x2646('0xb9')][_0x2646('0xbb')](_0x562232['dataValues']);return _0x2993f6;});});}})[_0x2646('0x1f')](respondWithResult(_0x1c86bf,null))[_0x2646('0x28')](handleError(_0x1c86bf,null));}; \ No newline at end of file +var _0xff01=['eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','http','client','then','info','OpenchannelAccount,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','sendStatus','end','status','undefined','count','offset','limit','set','json','apply','reject','update','destroy','get','stack','name','send','Pause','OpenchannelAccount','type','model','map','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','autoAssociation','UserProfileResource','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','Contacts','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','queueId','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xff01,0xb7));var _0x1ff0=function(_0x1c2a22,_0x598ba5){_0x1c2a22=_0x1c2a22-0x0;var _0x4c48cb=_0xff01[_0x1c2a22];return _0x4c48cb;};'use strict';var emlformat=require(_0x1ff0('0x0'));var rimraf=require(_0x1ff0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ff0('0x2'));var rp=require('request-promise');var moment=require(_0x1ff0('0x3'));var BPromise=require(_0x1ff0('0x4'));var Mustache=require(_0x1ff0('0x5'));var util=require('util');var path=require(_0x1ff0('0x6'));var sox=require('sox');var csv=require(_0x1ff0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ff0('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1ff0('0x9'));var jsforce=require(_0x1ff0('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1ff0('0x7'));var querystring=require(_0x1ff0('0xb'));var Papa=require(_0x1ff0('0xc'));var Redis=require(_0x1ff0('0xd'));var authService=require(_0x1ff0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1ff0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ff0('0x10'))(_0x1ff0('0x11'));var utils=require(_0x1ff0('0x12'));var config=require(_0x1ff0('0x13'));var licenseUtil=require(_0x1ff0('0x14'));var db=require(_0x1ff0('0x15'))['db'];config[_0x1ff0('0x16')]=_[_0x1ff0('0x17')](config[_0x1ff0('0x16')],{'host':_0x1ff0('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ff0('0x16')]));require(_0x1ff0('0x19'))[_0x1ff0('0x1a')](socket);var jayson=require(_0x1ff0('0x1b'));var client=jayson['client'][_0x1ff0('0x1c')]({'port':0x232c});var client9002=jayson[_0x1ff0('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9b0565,_0xc53d05,_0x736afd,_0x49df7a){return new BPromise(function(_0x564940,_0x28624f){var _0x402adc=_0x49df7a||client;return _0x402adc['request'](_0x9b0565,_0x736afd)[_0x1ff0('0x1e')](function(_0x3b0b40){logger[_0x1ff0('0x1f')](_0x1ff0('0x20'),_0xc53d05,'request\x20sent');logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0xc53d05,'request\x20sent',JSON[_0x1ff0('0x21')](_0x3b0b40));if(_0x3b0b40[_0x1ff0('0x22')]){if(_0x3b0b40[_0x1ff0('0x22')]['code']===0x1f4){logger[_0x1ff0('0x22')](_0x1ff0('0x20'),_0xc53d05,_0x3b0b40[_0x1ff0('0x22')][_0x1ff0('0x23')]);return _0x28624f(_0x3b0b40[_0x1ff0('0x22')][_0x1ff0('0x23')]);}logger[_0x1ff0('0x22')](_0x1ff0('0x20'),_0xc53d05,_0x3b0b40[_0x1ff0('0x22')][_0x1ff0('0x23')]);return _0x564940(_0x3b0b40[_0x1ff0('0x22')]['message']);}else{logger[_0x1ff0('0x1f')]('OpenchannelAccount,\x20%s,\x20%s',_0xc53d05,_0x1ff0('0x24'));_0x564940(_0x3b0b40['result'][_0x1ff0('0x23')]);}})[_0x1ff0('0x25')](function(_0x3c9e6e){logger[_0x1ff0('0x22')](_0x1ff0('0x20'),_0xc53d05,_0x3c9e6e);_0x28624f(_0x3c9e6e);});});}function respondWithStatusCode(_0x5f258e,_0x2c711a){_0x2c711a=_0x2c711a||0xcc;return function(_0x4635ca){if(_0x4635ca){return _0x5f258e[_0x1ff0('0x26')](_0x2c711a);}return _0x5f258e['status'](_0x2c711a)[_0x1ff0('0x27')]();};}function respondWithResult(_0x1bf3d0,_0x29fdb2){_0x29fdb2=_0x29fdb2||0xc8;return function(_0x21e703){if(_0x21e703){return _0x1bf3d0[_0x1ff0('0x28')](_0x29fdb2)['json'](_0x21e703);}};}function respondWithFilteredResult(_0xbd4cdd,_0x16cd1a){return function(_0x37c24){if(_0x37c24){var _0x16a084=typeof _0x16cd1a['offset']===_0x1ff0('0x29')&&typeof _0x16cd1a['limit']===_0x1ff0('0x29');var _0x1f8aab=_0x37c24['count'];var _0x5a3069=_0x16a084?0x0:_0x16cd1a['offset'];var _0x49218f=_0x16a084?_0x37c24[_0x1ff0('0x2a')]:_0x16cd1a[_0x1ff0('0x2b')]+_0x16cd1a[_0x1ff0('0x2c')];var _0x579c2c;if(_0x49218f>=_0x1f8aab){_0x49218f=_0x1f8aab;_0x579c2c=0xc8;}else{_0x579c2c=0xce;}_0xbd4cdd[_0x1ff0('0x28')](_0x579c2c);return _0xbd4cdd[_0x1ff0('0x2d')]('Content-Range',_0x5a3069+'-'+_0x49218f+'/'+_0x1f8aab)[_0x1ff0('0x2e')](_0x37c24);}return null;};}function patchUpdates(_0x42ca21){return function(_0x1a6bed){try{jsonpatch[_0x1ff0('0x2f')](_0x1a6bed,_0x42ca21,!![]);}catch(_0x5b3619){return BPromise[_0x1ff0('0x30')](_0x5b3619);}return _0x1a6bed['save']();};}function saveUpdates(_0x3d4749,_0x2cc0f2){return function(_0x2d3271){if(_0x2d3271){return _0x2d3271[_0x1ff0('0x31')](_0x3d4749)[_0x1ff0('0x1e')](function(_0x26e4f6){return _0x26e4f6;});}return null;};}function removeEntity(_0x3fbadb,_0x39eb11){return function(_0x54f324){if(_0x54f324){return _0x54f324[_0x1ff0('0x32')]()['then'](function(){var _0xbb539c=_0x54f324[_0x1ff0('0x33')]({'plain':!![]});var _0x27cf13='OpenchannelAccounts';return db['UserProfileResource'][_0x1ff0('0x32')]({'where':{'type':_0x27cf13,'resourceId':_0xbb539c['id']}})['then'](function(){return _0x54f324;});})[_0x1ff0('0x1e')](function(){_0x3fbadb[_0x1ff0('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x365eec,_0x16a76c){return function(_0x44cf72){if(!_0x44cf72){_0x365eec[_0x1ff0('0x26')](0x194);}return _0x44cf72;};}function handleError(_0x3a1642,_0x8d805c){_0x8d805c=_0x8d805c||0x1f4;return function(_0x5c272f){logger[_0x1ff0('0x22')](_0x5c272f[_0x1ff0('0x34')]);if(_0x5c272f[_0x1ff0('0x35')]){delete _0x5c272f['name'];}_0x3a1642['status'](_0x8d805c)[_0x1ff0('0x36')](_0x5c272f);};}exports['index']=function(_0x3e6f28,_0x2152ab){var _0x532f47={'include':[{'model':db[_0x1ff0('0x37')],'as':'mandatoryDispositionPause'}]},_0x52947e={},_0x3a4703={'count':0x0,'rows':[]};var _0x16e910=_['map'](db[_0x1ff0('0x38')]['rawAttributes'],function(_0x52ec8e){return{'name':_0x52ec8e['fieldName'],'type':_0x52ec8e[_0x1ff0('0x39')]['key']};});_0x52947e[_0x1ff0('0x3a')]=_[_0x1ff0('0x3b')](_0x16e910,'name');_0x52947e[_0x1ff0('0x3c')]=_[_0x1ff0('0x3d')](_0x3e6f28[_0x1ff0('0x3c')]);_0x52947e[_0x1ff0('0x3e')]=_['intersection'](_0x52947e[_0x1ff0('0x3a')],_0x52947e[_0x1ff0('0x3c')]);_0x532f47[_0x1ff0('0x3f')]=_[_0x1ff0('0x40')](_0x52947e[_0x1ff0('0x3a')],qs[_0x1ff0('0x41')](_0x3e6f28[_0x1ff0('0x3c')]['fields']));_0x532f47[_0x1ff0('0x3f')]=_0x532f47['attributes']['length']?_0x532f47[_0x1ff0('0x3f')]:_0x52947e[_0x1ff0('0x3a')];if(!_0x3e6f28[_0x1ff0('0x3c')]['hasOwnProperty'](_0x1ff0('0x42'))){_0x532f47[_0x1ff0('0x2c')]=qs[_0x1ff0('0x2c')](_0x3e6f28[_0x1ff0('0x3c')][_0x1ff0('0x2c')]);_0x532f47[_0x1ff0('0x2b')]=qs['offset'](_0x3e6f28['query'][_0x1ff0('0x2b')]);}_0x532f47[_0x1ff0('0x43')]=qs[_0x1ff0('0x44')](_0x3e6f28['query'][_0x1ff0('0x44')]);_0x532f47[_0x1ff0('0x45')]=qs[_0x1ff0('0x3e')](_[_0x1ff0('0x46')](_0x3e6f28[_0x1ff0('0x3c')],_0x52947e['filters']),_0x16e910);if(_0x3e6f28[_0x1ff0('0x3c')][_0x1ff0('0x47')]){_0x532f47['where']=_['merge'](_0x532f47['where'],{'$or':_[_0x1ff0('0x3b')](_0x16e910,function(_0x2c31dc){if(_0x2c31dc[_0x1ff0('0x39')]!==_0x1ff0('0x48')){var _0x36013b={};_0x36013b[_0x2c31dc['name']]={'$like':'%'+_0x3e6f28['query'][_0x1ff0('0x47')]+'%'};return _0x36013b;}})});}_0x532f47=_[_0x1ff0('0x49')]({},_0x532f47,_0x3e6f28[_0x1ff0('0x4a')]);var _0x4a381e={'where':_0x532f47[_0x1ff0('0x45')]};return db[_0x1ff0('0x38')][_0x1ff0('0x2a')](_0x4a381e)[_0x1ff0('0x1e')](function(_0x3c68cd){_0x3a4703['count']=_0x3c68cd;if(_0x3e6f28[_0x1ff0('0x3c')][_0x1ff0('0x4b')]){_0x532f47[_0x1ff0('0x4c')]=[{'all':!![]}];}return db[_0x1ff0('0x38')][_0x1ff0('0x4d')](_0x532f47);})['then'](function(_0x44774f){_0x3a4703[_0x1ff0('0x4e')]=_0x44774f;return _0x3a4703;})[_0x1ff0('0x1e')](respondWithFilteredResult(_0x2152ab,_0x532f47))[_0x1ff0('0x25')](handleError(_0x2152ab,null));};exports[_0x1ff0('0x4f')]=function(_0x455246,_0x3ad5d5){var _0x4e7e97={'raw':![],'where':{'id':_0x455246[_0x1ff0('0x50')]['id']},'include':[{'model':db[_0x1ff0('0x37')],'as':_0x1ff0('0x51')}]},_0x44dce6={};_0x44dce6[_0x1ff0('0x3a')]=_[_0x1ff0('0x3d')](db[_0x1ff0('0x38')][_0x1ff0('0x52')]);_0x44dce6[_0x1ff0('0x3c')]=_[_0x1ff0('0x3d')](_0x455246[_0x1ff0('0x3c')]);_0x44dce6[_0x1ff0('0x3e')]=_[_0x1ff0('0x40')](_0x44dce6['model'],_0x44dce6[_0x1ff0('0x3c')]);_0x4e7e97['attributes']=_[_0x1ff0('0x40')](_0x44dce6[_0x1ff0('0x3a')],qs[_0x1ff0('0x41')](_0x455246[_0x1ff0('0x3c')][_0x1ff0('0x41')]));_0x4e7e97[_0x1ff0('0x3f')]=_0x4e7e97[_0x1ff0('0x3f')][_0x1ff0('0x53')]?_0x4e7e97[_0x1ff0('0x3f')]:_0x44dce6[_0x1ff0('0x3a')];if(_0x455246[_0x1ff0('0x3c')][_0x1ff0('0x4b')]){_0x4e7e97['include']=[{'all':!![]}];}_0x4e7e97=_[_0x1ff0('0x49')]({},_0x4e7e97,_0x455246[_0x1ff0('0x4a')]);return db[_0x1ff0('0x38')][_0x1ff0('0x54')](_0x4e7e97)[_0x1ff0('0x1e')](handleEntityNotFound(_0x3ad5d5,null))[_0x1ff0('0x1e')](respondWithResult(_0x3ad5d5,null))[_0x1ff0('0x25')](handleError(_0x3ad5d5,null));};exports[_0x1ff0('0x55')]=function(_0x1bc613,_0x49c286){return db[_0x1ff0('0x38')][_0x1ff0('0x55')](_0x1bc613[_0x1ff0('0x56')],{})[_0x1ff0('0x1e')](function(_0x790d7a){var _0xc22df1=_0x1bc613[_0x1ff0('0x57')][_0x1ff0('0x33')]({'plain':!![]});if(!_0xc22df1)throw new Error(_0x1ff0('0x58'));if(_0xc22df1[_0x1ff0('0x59')]===_0x1ff0('0x57')){var _0xa5b83c=_0x790d7a[_0x1ff0('0x33')]({'plain':!![]});var _0x53d68c=_0x1ff0('0x5a');return db[_0x1ff0('0x5b')][_0x1ff0('0x54')]({'where':{'name':_0x53d68c,'userProfileId':_0xc22df1['userProfileId']},'raw':!![]})['then'](function(_0x40053d){if(_0x40053d&&_0x40053d[_0x1ff0('0x5c')]===0x0){return db[_0x1ff0('0x5d')]['create']({'name':_0xa5b83c['name'],'resourceId':_0xa5b83c['id'],'type':_0x40053d[_0x1ff0('0x35')],'sectionId':_0x40053d['id']},{})[_0x1ff0('0x1e')](function(){return _0x790d7a;});}else{return _0x790d7a;}})[_0x1ff0('0x25')](function(_0x1ae35e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ae35e);throw _0x1ae35e;});}return _0x790d7a;})[_0x1ff0('0x1e')](respondWithResult(_0x49c286,0xc9))[_0x1ff0('0x25')](handleError(_0x49c286,null));};exports[_0x1ff0('0x31')]=function(_0x11e0f2,_0x313ea1){if(_0x11e0f2[_0x1ff0('0x56')]['id']){delete _0x11e0f2[_0x1ff0('0x56')]['id'];}return db[_0x1ff0('0x38')][_0x1ff0('0x54')]({'where':{'id':_0x11e0f2[_0x1ff0('0x50')]['id']},'include':[{'model':db[_0x1ff0('0x37')],'as':_0x1ff0('0x51')}]})[_0x1ff0('0x1e')](handleEntityNotFound(_0x313ea1,null))[_0x1ff0('0x1e')](saveUpdates(_0x11e0f2[_0x1ff0('0x56')],null))[_0x1ff0('0x1e')](respondWithResult(_0x313ea1,null))[_0x1ff0('0x25')](handleError(_0x313ea1,null));};exports[_0x1ff0('0x32')]=function(_0x477828,_0x379ff3){return db[_0x1ff0('0x38')][_0x1ff0('0x54')]({'where':{'id':_0x477828[_0x1ff0('0x50')]['id']}})['then'](handleEntityNotFound(_0x379ff3,null))[_0x1ff0('0x1e')](removeEntity(_0x379ff3,null))[_0x1ff0('0x25')](handleError(_0x379ff3,null));};exports[_0x1ff0('0x5e')]=function(_0x2a6c4c,_0x332810){return db[_0x1ff0('0x38')][_0x1ff0('0x5e')]()[_0x1ff0('0x1e')](respondWithResult(_0x332810,null))[_0x1ff0('0x25')](handleError(_0x332810,null));};exports['addDisposition']=function(_0x45f19b,_0x2bbfa8,_0x256e4c){if(_0x45f19b[_0x1ff0('0x56')]['id']){delete _0x45f19b[_0x1ff0('0x56')]['id'];}return db[_0x1ff0('0x38')]['find']({'where':{'id':_0x45f19b[_0x1ff0('0x50')]['id']}})[_0x1ff0('0x1e')](handleEntityNotFound(_0x2bbfa8,null))[_0x1ff0('0x1e')](function(_0x37b67a){if(_0x37b67a){_0x45f19b[_0x1ff0('0x56')][_0x1ff0('0x5f')]=_0x37b67a['id'];return db[_0x1ff0('0x60')][_0x1ff0('0x55')](_0x45f19b['body']);}})[_0x1ff0('0x1e')](respondWithResult(_0x2bbfa8,null))[_0x1ff0('0x25')](handleError(_0x2bbfa8,null));};exports[_0x1ff0('0x61')]=function(_0x36df1e,_0x10c8a3,_0x4ca4c4){var _0x5a322d={'raw':![],'where':{}};var _0x346b34={};var _0x5e44e5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x1ff0('0x62')]({'where':{'id':_0x36df1e[_0x1ff0('0x50')]['id']}})[_0x1ff0('0x1e')](handleEntityNotFound(_0x10c8a3,null))[_0x1ff0('0x1e')](function(_0x308fe7){if(_0x308fe7){_0x346b34[_0x1ff0('0x3a')]=_[_0x1ff0('0x3d')](db[_0x1ff0('0x60')][_0x1ff0('0x52')]);_0x346b34[_0x1ff0('0x3c')]=_['keys'](_0x36df1e[_0x1ff0('0x3c')]);_0x346b34[_0x1ff0('0x3e')]=_[_0x1ff0('0x40')](_0x346b34[_0x1ff0('0x3a')],_0x346b34[_0x1ff0('0x3c')]);_0x5a322d[_0x1ff0('0x3f')]=_[_0x1ff0('0x40')](_0x346b34[_0x1ff0('0x3a')],qs['fields'](_0x36df1e[_0x1ff0('0x3c')][_0x1ff0('0x41')]));_0x5a322d[_0x1ff0('0x3f')]=_0x5a322d['attributes'][_0x1ff0('0x53')]?_0x5a322d[_0x1ff0('0x3f')]:_0x346b34[_0x1ff0('0x3a')];if(!_0x36df1e['query'][_0x1ff0('0x63')](_0x1ff0('0x42'))){_0x5a322d[_0x1ff0('0x2c')]=qs['limit'](_0x36df1e[_0x1ff0('0x3c')][_0x1ff0('0x2c')]);_0x5a322d[_0x1ff0('0x2b')]=qs[_0x1ff0('0x2b')](_0x36df1e[_0x1ff0('0x3c')]['offset']);}_0x5a322d['order']=qs['sort'](_0x36df1e[_0x1ff0('0x3c')][_0x1ff0('0x44')]);_0x5a322d[_0x1ff0('0x45')]=qs[_0x1ff0('0x3e')](_[_0x1ff0('0x46')](_0x36df1e[_0x1ff0('0x3c')],_0x346b34[_0x1ff0('0x3e')]));_0x5a322d[_0x1ff0('0x45')][_0x1ff0('0x5f')]=_0x308fe7['id'];if(_0x36df1e[_0x1ff0('0x3c')][_0x1ff0('0x47')]){_0x5a322d[_0x1ff0('0x45')]=_[_0x1ff0('0x49')](_0x5a322d[_0x1ff0('0x45')],{'$or':_[_0x1ff0('0x3b')](_0x5a322d['attributes'],function(_0x43a16e){var _0x51d132={};_0x51d132[_0x43a16e]={'$like':'%'+_0x36df1e[_0x1ff0('0x3c')]['filter']+'%'};return _0x51d132;})});}_0x5a322d=_[_0x1ff0('0x49')]({},_0x5a322d,_0x36df1e[_0x1ff0('0x4a')]);return db[_0x1ff0('0x60')]['count']({'where':_0x5a322d[_0x1ff0('0x45')]})[_0x1ff0('0x1e')](function(_0x210ff8){_0x5e44e5[_0x1ff0('0x2a')]=_0x210ff8;if(_0x36df1e[_0x1ff0('0x3c')][_0x1ff0('0x4b')]){_0x5a322d[_0x1ff0('0x4c')]=[{'all':!![]}];}return db[_0x1ff0('0x60')][_0x1ff0('0x4d')](_0x5a322d);})[_0x1ff0('0x1e')](function(_0x4d9661){_0x5e44e5[_0x1ff0('0x4e')]=_0x4d9661;return _0x5e44e5;});}})[_0x1ff0('0x1e')](respondWithFilteredResult(_0x10c8a3,_0x5a322d))[_0x1ff0('0x25')](handleError(_0x10c8a3,null));};exports[_0x1ff0('0x64')]=function(_0x4a0502,_0x2b12cb,_0x4201d5){return db['OpenchannelAccount']['find']({'where':{'id':_0x4a0502['params']['id']}})['then'](handleEntityNotFound(_0x2b12cb,null))[_0x1ff0('0x1e')](function(_0x3be1db){if(_0x3be1db){return _0x3be1db['removeDispositions'](_0x4a0502[_0x1ff0('0x3c')]['ids']);}})['then'](respondWithStatusCode(_0x2b12cb,null))[_0x1ff0('0x25')](handleError(_0x2b12cb,null));};exports[_0x1ff0('0x65')]=function(_0x2f4c49,_0x4458f3,_0x43b01e){if(_0x2f4c49[_0x1ff0('0x56')]['id']){delete _0x2f4c49['body']['id'];}return db['OpenchannelAccount'][_0x1ff0('0x54')]({'where':{'id':_0x2f4c49[_0x1ff0('0x50')]['id']}})[_0x1ff0('0x1e')](handleEntityNotFound(_0x4458f3,null))['then'](function(_0x4782ea){if(_0x4782ea){_0x2f4c49['body'][_0x1ff0('0x5f')]=_0x4782ea['id'];return db['CannedAnswer'][_0x1ff0('0x55')](_0x2f4c49[_0x1ff0('0x56')]);}})[_0x1ff0('0x1e')](respondWithResult(_0x4458f3,null))[_0x1ff0('0x25')](handleError(_0x4458f3,null));};exports[_0x1ff0('0x66')]=function(_0x15d3c1,_0x46fe98,_0x5b4f8c){var _0x1409e0={'raw':![],'where':{}};var _0x3319eb={};var _0x11450b={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x1ff0('0x62')]({'where':{'id':_0x15d3c1[_0x1ff0('0x50')]['id']}})[_0x1ff0('0x1e')](handleEntityNotFound(_0x46fe98,null))[_0x1ff0('0x1e')](function(_0x2cd53d){if(_0x2cd53d){_0x3319eb[_0x1ff0('0x3a')]=_[_0x1ff0('0x3d')](db[_0x1ff0('0x67')][_0x1ff0('0x52')]);_0x3319eb[_0x1ff0('0x3c')]=_['keys'](_0x15d3c1[_0x1ff0('0x3c')]);_0x3319eb[_0x1ff0('0x3e')]=_[_0x1ff0('0x40')](_0x3319eb[_0x1ff0('0x3a')],_0x3319eb[_0x1ff0('0x3c')]);_0x1409e0['attributes']=_[_0x1ff0('0x40')](_0x3319eb[_0x1ff0('0x3a')],qs[_0x1ff0('0x41')](_0x15d3c1[_0x1ff0('0x3c')][_0x1ff0('0x41')]));_0x1409e0[_0x1ff0('0x3f')]=_0x1409e0['attributes'][_0x1ff0('0x53')]?_0x1409e0[_0x1ff0('0x3f')]:_0x3319eb[_0x1ff0('0x3a')];if(!_0x15d3c1[_0x1ff0('0x3c')][_0x1ff0('0x63')](_0x1ff0('0x42'))){_0x1409e0[_0x1ff0('0x2c')]=qs[_0x1ff0('0x2c')](_0x15d3c1[_0x1ff0('0x3c')]['limit']);_0x1409e0[_0x1ff0('0x2b')]=qs[_0x1ff0('0x2b')](_0x15d3c1[_0x1ff0('0x3c')][_0x1ff0('0x2b')]);}_0x1409e0[_0x1ff0('0x43')]=qs[_0x1ff0('0x44')](_0x15d3c1[_0x1ff0('0x3c')][_0x1ff0('0x44')]);_0x1409e0[_0x1ff0('0x45')]=qs[_0x1ff0('0x3e')](_[_0x1ff0('0x46')](_0x15d3c1[_0x1ff0('0x3c')],_0x3319eb[_0x1ff0('0x3e')]));_0x1409e0[_0x1ff0('0x45')][_0x1ff0('0x5f')]=_0x2cd53d['id'];if(_0x15d3c1[_0x1ff0('0x3c')]['filter']){_0x1409e0[_0x1ff0('0x45')]=_[_0x1ff0('0x49')](_0x1409e0['where'],{'$or':_[_0x1ff0('0x3b')](_0x1409e0[_0x1ff0('0x3f')],function(_0x18ba7d){var _0x44efd7={};_0x44efd7[_0x18ba7d]={'$like':'%'+_0x15d3c1[_0x1ff0('0x3c')]['filter']+'%'};return _0x44efd7;})});}_0x1409e0=_[_0x1ff0('0x49')]({},_0x1409e0,_0x15d3c1[_0x1ff0('0x4a')]);return db[_0x1ff0('0x67')][_0x1ff0('0x2a')]({'where':_0x1409e0[_0x1ff0('0x45')]})['then'](function(_0x21f80c){_0x11450b[_0x1ff0('0x2a')]=_0x21f80c;if(_0x15d3c1[_0x1ff0('0x3c')][_0x1ff0('0x4b')]){_0x1409e0['include']=[{'all':!![]}];}return db[_0x1ff0('0x67')]['findAll'](_0x1409e0);})['then'](function(_0x678910){_0x11450b[_0x1ff0('0x4e')]=_0x678910;return _0x11450b;});}})['then'](respondWithFilteredResult(_0x46fe98,_0x1409e0))[_0x1ff0('0x25')](handleError(_0x46fe98,null));};exports[_0x1ff0('0x68')]=function(_0x2d9fa0,_0x5965e0,_0x2e29ed){return db[_0x1ff0('0x38')]['find']({'where':{'id':_0x2d9fa0[_0x1ff0('0x50')]['id']}})[_0x1ff0('0x1e')](handleEntityNotFound(_0x5965e0,null))[_0x1ff0('0x1e')](function(_0xbf4605){if(_0xbf4605){return _0xbf4605[_0x1ff0('0x68')](_0x2d9fa0['query'][_0x1ff0('0x69')]);}})['then'](respondWithStatusCode(_0x5965e0,null))[_0x1ff0('0x25')](handleError(_0x5965e0,null));};exports['notify']=function(_0x3c2cf4,_0x5c5e08,_0x18f524){var _0x2fbbbe={'body':_0x3c2cf4[_0x1ff0('0x56')],'channel':_0x1ff0('0x6a')};var _0x36b76f=[];var _0x370f6e=[];var _0xd20d6={};var _0x3a0537=![];return db[_0x1ff0('0x6b')][_0x1ff0('0x5e')]()[_0x1ff0('0x1e')](function(_0x5e8401){if(!_0x5e8401){throw new db[(_0x1ff0('0x6c'))][(_0x1ff0('0x6d'))](_0x1ff0('0x6e'));}_0x36b76f=_[_0x1ff0('0x6f')](_[_0x1ff0('0x3d')](_0x5e8401),[_0x1ff0('0x70'),_0x1ff0('0x71')]);_0x370f6e=_[_0x1ff0('0x6f')](_['keys'](_0x5e8401),[_0x1ff0('0x70'),_0x1ff0('0x71'),_0x1ff0('0x72'),_0x1ff0('0x73')]);if(_0x3c2cf4[_0x1ff0('0x56')]['id']){delete _0x3c2cf4['body']['id'];}if(_[_0x1ff0('0x74')](_0x3c2cf4[_0x1ff0('0x56')][_0x1ff0('0x75')])){throw new db[(_0x1ff0('0x6c'))][(_0x1ff0('0x6d'))](_0x1ff0('0x76'));}if(_[_0x1ff0('0x74')](_0x3c2cf4['body'][_0x1ff0('0x56')])||_0x3c2cf4['body'][_0x1ff0('0x56')]===''){throw new db[(_0x1ff0('0x6c'))][(_0x1ff0('0x6d'))](_0x1ff0('0x77'));}if(_['isNil'](_0x3c2cf4[_0x1ff0('0x56')][_0x1ff0('0x78')])){throw new db[(_0x1ff0('0x6c'))][(_0x1ff0('0x6d'))](_0x1ff0('0x79')+_0x370f6e);}if(!_[_0x1ff0('0x7a')](_0x370f6e,_0x3c2cf4[_0x1ff0('0x56')]['mapKey'])){throw new db[(_0x1ff0('0x6c'))][(_0x1ff0('0x6d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x370f6e);}_0xd20d6[_0x3c2cf4[_0x1ff0('0x56')][_0x1ff0('0x78')]]=_0x3c2cf4[_0x1ff0('0x56')][_0x1ff0('0x75')];})['then'](function(){return db[_0x1ff0('0x38')][_0x1ff0('0x54')]({'where':{'id':_0x3c2cf4[_0x1ff0('0x50')]['id']},'include':[{'model':db[_0x1ff0('0x7b')],'as':_0x1ff0('0x7c'),'include':[{'model':db[_0x1ff0('0x6b')],'as':'Contacts','where':_0xd20d6,'limit':0x1,'order':[[_0x1ff0('0x71'),_0x1ff0('0x7d')]]}]},{'model':db[_0x1ff0('0x7e')],'as':_0x1ff0('0x7f')}]});})[_0x1ff0('0x1e')](handleEntityNotFound(_0x5c5e08,null))[_0x1ff0('0x1e')](function(_0x51efb5){if(_0x51efb5&&_0x51efb5['List']){_0x2fbbbe[_0x1ff0('0x80')]=_0x51efb5;_0x2fbbbe[_0x1ff0('0x81')]=_0x51efb5[_0x1ff0('0x7f')];_0x2fbbbe[_0x1ff0('0x82')]=_0x51efb5[_0x1ff0('0x7c')];_0x2fbbbe[_0x1ff0('0x81')]=_[_0x1ff0('0x83')](_0x2fbbbe[_0x1ff0('0x81')],[_0x1ff0('0x84')],['asc']);if(_0x2fbbbe[_0x1ff0('0x80')][_0x1ff0('0x7f')]){delete _0x2fbbbe[_0x1ff0('0x80')][_0x1ff0('0x7f')];}if(_0x2fbbbe[_0x1ff0('0x80')][_0x1ff0('0x7c')]&&_0x2fbbbe['account'][_0x1ff0('0x7c')][_0x1ff0('0x85')]['length']){return _0x2fbbbe[_0x1ff0('0x80')][_0x1ff0('0x7c')][_0x1ff0('0x85')][0x0];}var _0x17cb69=_[_0x1ff0('0x17')](_0x3c2cf4[_0x1ff0('0x56')],{'firstName':_0x3c2cf4[_0x1ff0('0x56')][_0x1ff0('0x75')],'ListId':_0x51efb5['ListId']});_0x17cb69[_0x3c2cf4[_0x1ff0('0x56')][_0x1ff0('0x78')]]=_0x3c2cf4[_0x1ff0('0x56')]['from'];return db[_0x1ff0('0x6b')][_0x1ff0('0x55')](_0x17cb69,{'fields':_0x36b76f,'raw':!![]});}})[_0x1ff0('0x1e')](handleEntityNotFound(_0x5c5e08,null))[_0x1ff0('0x1e')](function(_0x32b9e0){_0x2fbbbe[_0x1ff0('0x86')]=_0x32b9e0;if(_0x32b9e0){var _0x566b5c={'ContactId':_0x32b9e0['id'],'OpenchannelAccountId':_0x3c2cf4[_0x1ff0('0x50')]['id'],'from':(_0x32b9e0[_0x1ff0('0x87')]||'')+'\x20'+(_0x32b9e0[_0x1ff0('0x88')]||'')};var _0x3221d1={'OpenchannelAccountId':_0x3c2cf4[_0x1ff0('0x50')]['id'],'closed':![]};if(_0x3c2cf4[_0x1ff0('0x56')][_0x1ff0('0x89')]){_0x3221d1[_0x1ff0('0x89')]=_0x3c2cf4['body'][_0x1ff0('0x89')];return db['OpenchannelInteraction'][_0x1ff0('0x54')]({'where':_0x3221d1})[_0x1ff0('0x1e')](function(_0x9ebe19){if(_0x9ebe19){return[_0x9ebe19,![]];}_0x566b5c['threadId']=_0x3c2cf4[_0x1ff0('0x56')][_0x1ff0('0x89')];_0x566b5c['externalUrl']=_0x3c2cf4[_0x1ff0('0x56')][_0x1ff0('0x8a')];return db[_0x1ff0('0x8b')][_0x1ff0('0x55')](_0x566b5c)['then'](function(_0x420046){return[_0x420046,!![]];});});}else{_0x3221d1[_0x1ff0('0x89')]=null;}_0x3221d1[_0x1ff0('0x8c')]=_0x32b9e0['id'];return db[_0x1ff0('0x8b')]['find']({'where':_0x3221d1})[_0x1ff0('0x1e')](function(_0x5324bb){if(_0x5324bb){return[_0x5324bb,![]];}return db[_0x1ff0('0x8b')][_0x1ff0('0x55')](_0x566b5c)[_0x1ff0('0x1e')](function(_0x29582a){return[_0x29582a,!![]];});});}})[_0x1ff0('0x8d')](function(_0x396be2,_0xbe4ff3){if(_0x396be2){_0x3a0537=_0xbe4ff3;if(!_0xbe4ff3){var _0x4bee35={'from':(_0x2fbbbe[_0x1ff0('0x86')]['firstName']||'')+'\x20'+(_0x2fbbbe[_0x1ff0('0x86')]['lastName']||'')};if(_0x3c2cf4[_0x1ff0('0x56')]['threadId']&&_0x3c2cf4[_0x1ff0('0x56')][_0x1ff0('0x8e')]&&_0x3c2cf4[_0x1ff0('0x56')]['threadId']!=_0x3c2cf4['body']['messageId']){_0x4bee35[_0x1ff0('0x89')]=_0x3c2cf4[_0x1ff0('0x56')]['messageId'];}return _0x396be2['update'](_0x4bee35);}else{return _0x396be2;}}})[_0x1ff0('0x1e')](function(_0x447399){_0x2fbbbe['interaction']=_0x447399['get']({'plain':!![]});_0x2fbbbe[_0x1ff0('0x8f')][_0x1ff0('0x90')]=_0x3a0537;if(_0x2fbbbe[_0x1ff0('0x8f')][_0x1ff0('0x90')]){if(_0x2fbbbe['account'][_0x1ff0('0x91')]){_0x2fbbbe[_0x1ff0('0x81')][_0x1ff0('0x92')]({'id':0x0,'priority':_0x2fbbbe['applications'][_0x1ff0('0x53')]+0x1,'app':'close','appdata':_0x1ff0('0x93'),'interval':_0x1ff0('0x94')});}}return db[_0x1ff0('0x95')][_0x1ff0('0x55')]({'body':_0x3c2cf4['body'][_0x1ff0('0x56')],'OpenchannelAccountId':_0x3c2cf4[_0x1ff0('0x50')]['id'],'OpenchannelInteractionId':_0x447399['id'],'direction':'in','ContactId':_0x2fbbbe['contact']['id'],'AttachmentId':_0x3c2cf4[_0x1ff0('0x56')][_0x1ff0('0x96')]});})[_0x1ff0('0x1e')](function(_0x41d26f){_0x2fbbbe[_0x1ff0('0x23')]=_0x41d26f;if(!_0x2fbbbe['interaction'][_0x1ff0('0x97')])return;return db[_0x1ff0('0x98')]['find']({'attributes':['id',_0x1ff0('0x35')],'where':{'id':_0x2fbbbe[_0x1ff0('0x8f')]['UserId']}});})['then'](function(_0x2b6c48){if(_0x2b6c48){_0x2fbbbe[_0x1ff0('0x81')][_0x1ff0('0x99')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2b6c48[_0x1ff0('0x35')]+','+(_0x2fbbbe[_0x1ff0('0x80')][_0x1ff0('0x9a')]||0xa),'interval':_0x1ff0('0x94')});}if(!_0x2fbbbe[_0x1ff0('0x8f')][_0x1ff0('0x9b')])return;return db['OpenchannelQueue'][_0x1ff0('0x54')]({'attributes':['id',_0x1ff0('0x35')],'where':{'id':_0x2fbbbe[_0x1ff0('0x8f')][_0x1ff0('0x9b')]}});})[_0x1ff0('0x1e')](function(_0xbbbf16){if(_0xbbbf16){_0x2fbbbe['applications'][_0x1ff0('0x99')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0xbbbf16[_0x1ff0('0x35')]+','+(_0x2fbbbe['account'][_0x1ff0('0x9c')]||0x12c),'interval':_0x1ff0('0x94')});}return respondWithRpcPromise(_0x1ff0('0x9d'),_0x1ff0('0x9e'),_0x2fbbbe);})[_0x1ff0('0x1e')](function(_0x417cbc){respondWithRpcPromise(_0x1ff0('0x9f'),_0x1ff0('0x9f'),{'event':'notify','message':_0x417cbc},client9002);return _0x417cbc;})['then'](respondWithResult(_0x5c5e08,null))[_0x1ff0('0x25')](handleError(_0x5c5e08,null));};exports[_0x1ff0('0xa0')]=function(_0x4c28c7,_0x32ab3d){var _0x4734f3=_0x4c28c7[_0x1ff0('0x50')]['id'];var _0x5a1034=_0x4c28c7[_0x1ff0('0x56')];var _0x2f757f=0xc8;var _0x50dea4=null;return db[_0x1ff0('0xa1')]['transaction']({'isolationLevel':db['sequelize'][_0x1ff0('0xa2')]['ISOLATION_LEVELS'][_0x1ff0('0xa3')]},function(_0x2d2127){return db[_0x1ff0('0x38')][_0x1ff0('0x62')]({'where':{'id':_0x4734f3},'transaction':_0x2d2127})['then'](function(_0x4c7435){if(_0x4c7435){return db['OpenchannelApplication'][_0x1ff0('0x32')]({'where':{'OpenchannelAccountId':_0x4734f3},'transaction':_0x2d2127})[_0x1ff0('0x1e')](function(){var _0xf5423b=_['map'](_0x5a1034,function(_0x367d3c){_0x367d3c[_0x1ff0('0x5f')]=_0x4734f3;return _0x367d3c;});return db['OpenchannelApplication'][_0x1ff0('0xa4')](_0xf5423b,{'transaction':_0x2d2127});});}else{_0x2f757f=0x194;_0x50dea4=[];}});})['then'](function(){if(_0x2f757f!==0x194){return db[_0x1ff0('0x7e')][_0x1ff0('0xa5')]({'where':{'OpenchannelAccountId':_0x4734f3},'order':_0x1ff0('0x84')})['then'](function(_0x1dcf6f){_0x50dea4=_0x1dcf6f;});}})[_0x1ff0('0x25')](function(_0x4e03af){_0x2f757f=0x1f4;logger['error'](_0x4e03af[_0x1ff0('0x34')]);if(_0x4e03af[_0x1ff0('0x35')]){delete _0x4e03af[_0x1ff0('0x35')];}_0x50dea4=_0x4e03af;})['finally'](function(){if(_0x50dea4===null){_0x32ab3d[_0x1ff0('0x26')](_0x2f757f);}else{if(_0x2f757f===0x1f4){_0x32ab3d['status'](_0x2f757f)[_0x1ff0('0x36')](_0x50dea4);}else{_0x32ab3d[_0x1ff0('0x28')](_0x2f757f)[_0x1ff0('0x2e')](_0x50dea4);}}});};exports['getApplications']=function(_0x2983af,_0x15c84a,_0x163e02){var _0x4b4adb={};var _0x503ebb={};var _0x3ce8a8;var _0xcfa669;return db[_0x1ff0('0x38')][_0x1ff0('0x62')]({'where':{'id':_0x2983af['params']['id']}})[_0x1ff0('0x1e')](handleEntityNotFound(_0x15c84a,null))[_0x1ff0('0x1e')](function(_0x4615d8){if(_0x4615d8){_0x3ce8a8=_0x4615d8;_0x503ebb[_0x1ff0('0x3a')]=_['keys'](db[_0x1ff0('0x7e')][_0x1ff0('0x52')]);_0x503ebb[_0x1ff0('0x3c')]=_[_0x1ff0('0x3d')](_0x2983af[_0x1ff0('0x3c')]);_0x503ebb['filters']=_['intersection'](_0x503ebb[_0x1ff0('0x3a')],_0x503ebb[_0x1ff0('0x3c')]);_0x4b4adb[_0x1ff0('0x3f')]=_[_0x1ff0('0x40')](_0x503ebb[_0x1ff0('0x3a')],qs['fields'](_0x2983af[_0x1ff0('0x3c')][_0x1ff0('0x41')]));_0x4b4adb['attributes']=_0x4b4adb[_0x1ff0('0x3f')][_0x1ff0('0x53')]?_0x4b4adb[_0x1ff0('0x3f')]:_0x503ebb[_0x1ff0('0x3a')];_0x4b4adb[_0x1ff0('0x43')]=qs['sort'](_0x2983af[_0x1ff0('0x3c')][_0x1ff0('0x44')]);_0x4b4adb[_0x1ff0('0x45')]=qs[_0x1ff0('0x3e')](_['pick'](_0x2983af[_0x1ff0('0x3c')],_0x503ebb['filters']));if(_0x2983af['query']['filter']){_0x4b4adb[_0x1ff0('0x45')]=_[_0x1ff0('0x49')](_0x4b4adb[_0x1ff0('0x45')],{'$or':_[_0x1ff0('0x3b')](_0x4b4adb[_0x1ff0('0x3f')],function(_0x4fab0e){var _0x394b30={};_0x394b30[_0x4fab0e]={'$like':'%'+_0x2983af[_0x1ff0('0x3c')][_0x1ff0('0x47')]+'%'};return _0x394b30;})});}_0x4b4adb=_[_0x1ff0('0x49')]({},_0x4b4adb,_0x2983af['options']);return _0x3ce8a8[_0x1ff0('0xa6')](_0x4b4adb);}})[_0x1ff0('0x1e')](function(_0x1fc3db){if(_0x1fc3db){_0xcfa669=_0x1fc3db['length'];if(!_0x2983af['query'][_0x1ff0('0x63')](_0x1ff0('0x42'))){_0x4b4adb[_0x1ff0('0x2c')]=qs[_0x1ff0('0x2c')](_0x2983af['query'][_0x1ff0('0x2c')]);_0x4b4adb['offset']=qs['offset'](_0x2983af[_0x1ff0('0x3c')]['offset']);}return _0x3ce8a8[_0x1ff0('0xa6')](_0x4b4adb);}})[_0x1ff0('0x1e')](function(_0x4e0615){if(_0x4e0615){return _0x4e0615?{'count':_0xcfa669,'rows':_0x4e0615}:null;}})[_0x1ff0('0x1e')](respondWithResult(_0x15c84a,null))['catch'](handleError(_0x15c84a,null));};exports[_0x1ff0('0xa7')]=function(_0x2c3098,_0xfddfb6,_0x378d5c){var _0x87e8c3={'raw':![],'where':{}};var _0x3fc15f={};var _0x5f0354={'count':0x0,'rows':[]};return db[_0x1ff0('0x38')][_0x1ff0('0x62')]({'where':{'id':_0x2c3098[_0x1ff0('0x50')]['id']}})['then'](handleEntityNotFound(_0xfddfb6,null))[_0x1ff0('0x1e')](function(_0x40e96){if(_0x40e96){_0x3fc15f['model']=_[_0x1ff0('0x3d')](db[_0x1ff0('0x8b')][_0x1ff0('0x52')]);_0x3fc15f['query']=_['keys'](_0x2c3098[_0x1ff0('0x3c')]);_0x3fc15f['filters']=_[_0x1ff0('0x40')](_0x3fc15f['model'],_0x3fc15f[_0x1ff0('0x3c')]);_0x87e8c3['attributes']=_[_0x1ff0('0x40')](_0x3fc15f[_0x1ff0('0x3a')],qs[_0x1ff0('0x41')](_0x2c3098[_0x1ff0('0x3c')][_0x1ff0('0x41')]));_0x87e8c3[_0x1ff0('0x3f')]=_0x87e8c3[_0x1ff0('0x3f')][_0x1ff0('0x53')]?_0x87e8c3[_0x1ff0('0x3f')]:_0x3fc15f[_0x1ff0('0x3a')];if(!_0x2c3098[_0x1ff0('0x3c')][_0x1ff0('0x63')](_0x1ff0('0x42'))){_0x87e8c3['limit']=qs['limit'](_0x2c3098[_0x1ff0('0x3c')]['limit']);_0x87e8c3[_0x1ff0('0x2b')]=qs['offset'](_0x2c3098[_0x1ff0('0x3c')]['offset']);}_0x87e8c3[_0x1ff0('0x43')]=qs[_0x1ff0('0x44')](_0x2c3098[_0x1ff0('0x3c')][_0x1ff0('0x44')]);_0x87e8c3[_0x1ff0('0x45')]=qs[_0x1ff0('0x3e')](_[_0x1ff0('0x46')](_0x2c3098[_0x1ff0('0x3c')],_0x3fc15f[_0x1ff0('0x3e')]));_0x87e8c3[_0x1ff0('0x45')][_0x1ff0('0x5f')]=_0x40e96['id'];if(_0x2c3098[_0x1ff0('0x3c')][_0x1ff0('0x47')]){_0x87e8c3['where']=_['merge'](_0x87e8c3['where'],{'$or':_[_0x1ff0('0x3b')](_0x87e8c3['attributes'],function(_0x4d295c){var _0x1766ae={};_0x1766ae[_0x4d295c]={'$like':'%'+_0x2c3098[_0x1ff0('0x3c')]['filter']+'%'};return _0x1766ae;})});}_0x87e8c3=_[_0x1ff0('0x49')]({},_0x87e8c3,_0x2c3098[_0x1ff0('0x4a')]);return db[_0x1ff0('0x8b')][_0x1ff0('0x2a')]({'where':_0x87e8c3[_0x1ff0('0x45')]})[_0x1ff0('0x1e')](function(_0xab448a){_0x5f0354[_0x1ff0('0x2a')]=_0xab448a;if(_0x2c3098[_0x1ff0('0x3c')][_0x1ff0('0x4b')]){_0x87e8c3[_0x1ff0('0x4c')]=[{'model':db[_0x1ff0('0x6b')],'as':'Contact','required':![]},{'model':db[_0x1ff0('0x98')],'as':_0x1ff0('0xa8'),'attributes':[_0x1ff0('0x35'),_0x1ff0('0xa9'),_0x1ff0('0xaa')],'required':![]},{'model':db[_0x1ff0('0xab')],'as':_0x1ff0('0xac'),'attributes':['id',_0x1ff0('0x35'),'color'],'where':_0x2c3098[_0x1ff0('0x3c')][_0x1ff0('0xad')]?{'id':_0x2c3098[_0x1ff0('0x3c')][_0x1ff0('0xad')]}:undefined,'required':_0x2c3098[_0x1ff0('0x3c')]['tag']?!![]:![]}];}return db[_0x1ff0('0x8b')][_0x1ff0('0x4d')](_0x87e8c3);})[_0x1ff0('0x1e')](function(_0xa0f3e2){_0x5f0354['rows']=_0xa0f3e2;return _0x5f0354;});}})[_0x1ff0('0x1e')](respondWithFilteredResult(_0xfddfb6,_0x87e8c3))[_0x1ff0('0x25')](handleError(_0xfddfb6,null));};exports['addAgents']=function(_0x5d92e2,_0x4c739c,_0x4b0af3){return db[_0x1ff0('0x38')][_0x1ff0('0x54')]({'where':{'id':_0x5d92e2[_0x1ff0('0x50')]['id']}})[_0x1ff0('0x1e')](handleEntityNotFound(_0x4c739c,null))['then'](function(_0x7771ec){if(_0x7771ec){return _0x7771ec[_0x1ff0('0xae')](_0x5d92e2['body'][_0x1ff0('0x69')],_['omit'](_0x5d92e2[_0x1ff0('0x56')],[_0x1ff0('0x69'),'id'])||{})['spread'](function(_0x4bd369){for(var _0x2b22f0=0x0;_0x2b22f0<_0x5d92e2['body']['ids'][_0x1ff0('0x53')];_0x2b22f0+=0x1){socket[_0x1ff0('0xaf')](_0x1ff0('0xb0'),{'UserId':Number(_0x5d92e2[_0x1ff0('0x56')][_0x1ff0('0x69')][_0x2b22f0]),'OpenchannelAccountId':Number(_0x5d92e2[_0x1ff0('0x50')]['id'])});}return _0x4bd369;});}})[_0x1ff0('0x1e')](respondWithResult(_0x4c739c,null))[_0x1ff0('0x25')](handleError(_0x4c739c,null));};exports[_0x1ff0('0xb1')]=function(_0x1d7f77,_0x14ffab,_0x52fb70){return db[_0x1ff0('0x38')][_0x1ff0('0x54')]({'where':{'id':_0x1d7f77['params']['id']}})[_0x1ff0('0x1e')](handleEntityNotFound(_0x14ffab,null))[_0x1ff0('0x1e')](function(_0x21415d){if(_0x21415d){return _0x21415d[_0x1ff0('0xb1')](_0x1d7f77[_0x1ff0('0x3c')]['ids'])[_0x1ff0('0x1e')](function(){if(_['isArray'](_0x1d7f77['query'][_0x1ff0('0x69')])){for(var _0xb6cf1=0x0;_0xb6cf1<_0x1d7f77[_0x1ff0('0x3c')]['ids'][_0x1ff0('0x53')];_0xb6cf1+=0x1){socket[_0x1ff0('0xaf')](_0x1ff0('0xb2'),{'UserId':Number(_0x1d7f77[_0x1ff0('0x3c')][_0x1ff0('0x69')][_0xb6cf1]),'OpenchannelAccountId':Number(_0x1d7f77['params']['id'])});}}else{socket[_0x1ff0('0xaf')](_0x1ff0('0xb2'),{'UserId':Number(_0x1d7f77[_0x1ff0('0x3c')][_0x1ff0('0x69')]),'OpenchannelAccountId':Number(_0x1d7f77[_0x1ff0('0x50')]['id'])});}});}})[_0x1ff0('0x1e')](respondWithStatusCode(_0x14ffab,null))[_0x1ff0('0x25')](handleError(_0x14ffab,null));};exports[_0x1ff0('0xb3')]=function(_0x4c63fd,_0x46a6e2,_0x2c54fd){var _0x389e59={};var _0x4a2295={};var _0x7cc41c;var _0x1a42c;return db[_0x1ff0('0x38')][_0x1ff0('0x62')]({'where':{'id':_0x4c63fd[_0x1ff0('0x50')]['id']}})[_0x1ff0('0x1e')](handleEntityNotFound(_0x46a6e2,null))[_0x1ff0('0x1e')](function(_0xe4919a){if(_0xe4919a){_0x7cc41c=_0xe4919a;_0x4a2295[_0x1ff0('0x3a')]=_[_0x1ff0('0x3d')](db[_0x1ff0('0x98')]['rawAttributes']);_0x4a2295[_0x1ff0('0x3c')]=_[_0x1ff0('0x3d')](_0x4c63fd[_0x1ff0('0x3c')]);_0x4a2295[_0x1ff0('0x3e')]=_['intersection'](_0x4a2295[_0x1ff0('0x3a')],_0x4a2295[_0x1ff0('0x3c')]);_0x389e59[_0x1ff0('0x3f')]=_[_0x1ff0('0x40')](_0x4a2295[_0x1ff0('0x3a')],qs[_0x1ff0('0x41')](_0x4c63fd[_0x1ff0('0x3c')][_0x1ff0('0x41')]));_0x389e59['attributes']=_0x389e59[_0x1ff0('0x3f')]['length']?_0x389e59[_0x1ff0('0x3f')]:_0x4a2295[_0x1ff0('0x3a')];_0x389e59[_0x1ff0('0x43')]=qs[_0x1ff0('0x44')](_0x4c63fd[_0x1ff0('0x3c')][_0x1ff0('0x44')]);_0x389e59[_0x1ff0('0x45')]=qs[_0x1ff0('0x3e')](_[_0x1ff0('0x46')](_0x4c63fd['query'],_0x4a2295[_0x1ff0('0x3e')]));if(_0x4c63fd['query']['filter']){_0x389e59[_0x1ff0('0x45')]=_[_0x1ff0('0x49')](_0x389e59[_0x1ff0('0x45')],{'$or':_[_0x1ff0('0x3b')](_0x389e59[_0x1ff0('0x3f')],function(_0x56cc19){var _0xf41395={};_0xf41395[_0x56cc19]={'$like':'%'+_0x4c63fd[_0x1ff0('0x3c')][_0x1ff0('0x47')]+'%'};return _0xf41395;})});}_0x389e59=_[_0x1ff0('0x49')]({},_0x389e59,_0x4c63fd['options']);return _0x7cc41c[_0x1ff0('0xb3')](_0x389e59);}})[_0x1ff0('0x1e')](function(_0x3d2d7f){if(_0x3d2d7f){_0x1a42c=_0x3d2d7f[_0x1ff0('0x53')];if(!_0x4c63fd[_0x1ff0('0x3c')][_0x1ff0('0x63')](_0x1ff0('0x42'))){_0x389e59[_0x1ff0('0x2c')]=qs[_0x1ff0('0x2c')](_0x4c63fd[_0x1ff0('0x3c')][_0x1ff0('0x2c')]);_0x389e59['offset']=qs[_0x1ff0('0x2b')](_0x4c63fd[_0x1ff0('0x3c')]['offset']);}return _0x7cc41c[_0x1ff0('0xb3')](_0x389e59);}})[_0x1ff0('0x1e')](function(_0x59f20e){if(_0x59f20e){return _0x59f20e?{'count':_0x1a42c,'rows':_0x59f20e}:null;}})[_0x1ff0('0x1e')](respondWithResult(_0x46a6e2,null))[_0x1ff0('0x25')](handleError(_0x46a6e2,null));};exports[_0x1ff0('0x36')]=function(_0x10ac79,_0x5518ab,_0x1fe5e2){var _0x3297fe,_0x260d8a,_0x3d1c9c;if(_[_0x1ff0('0x74')](_0x10ac79['body'][_0x1ff0('0x56')])||_0x10ac79['body'][_0x1ff0('0x56')]===''){throw new db[(_0x1ff0('0x6c'))][(_0x1ff0('0x6d'))](_0x1ff0('0x77'));}if(_[_0x1ff0('0x74')](_0x10ac79[_0x1ff0('0x56')]['to'])){}_0x3297fe=_0x10ac79[_0x1ff0('0x56')]['to'];return db[_0x1ff0('0x38')]['findOne']({'where':{'id':_0x10ac79[_0x1ff0('0x50')]['id']}})[_0x1ff0('0x1e')](handleEntityNotFound(_0x5518ab,null))[_0x1ff0('0x1e')](function(_0x560d11){if(_0x560d11){return db[_0x1ff0('0x38')][_0x1ff0('0x54')]({'where':{'id':_0x560d11['id']},'include':[{'model':db[_0x1ff0('0x7b')],'as':_0x1ff0('0x7c'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x560d11['mapKey']]:_0x3297fe},'limit':0x1,'order':[[_0x1ff0('0x71'),_0x1ff0('0x7d')]]}]}]})['then'](handleEntityNotFound(_0x5518ab,null))[_0x1ff0('0x1e')](function(_0x44c589){if(_0x44c589&&_0x44c589[_0x1ff0('0x7c')]){_0x260d8a=_0x44c589['get']({'plain':!![]});if(_0x260d8a[_0x1ff0('0x7c')]&&_0x260d8a['List']['Contacts'][_0x1ff0('0x53')]){return _0x260d8a[_0x1ff0('0x7c')][_0x1ff0('0x85')][0x0];}return db['CmContact'][_0x1ff0('0x55')](_[_0x1ff0('0x17')](_0x10ac79[_0x1ff0('0x56')],{'firstName':_0x3297fe,[_0x44c589[_0x1ff0('0x78')]]:_0x3297fe,'phone':_0x3297fe,'ListId':_0x260d8a[_0x1ff0('0x73')]}));}})['then'](handleEntityNotFound(_0x5518ab,null))['then'](function(_0x213c19){if(_0x213c19){_0x3d1c9c=_0x213c19;return db['OpenchannelInteraction'][_0x1ff0('0x54')]({'where':{'ContactId':_0x3d1c9c['id'],'closed':![],'OpenchannelAccountId':_0x260d8a['id']}})[_0x1ff0('0x1e')](function(_0x31ad3a){if(_0x31ad3a){return[_0x31ad3a,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x10ac79['user']['id'],'ContactId':_0x3d1c9c['id'],'OpenchannelAccountId':_0x260d8a['id'],'lastMsgDirection':'out','firstMsgDirection':_0x1ff0('0xb4'),'Messages':[_['merge'](_0x10ac79[_0x1ff0('0x56')],{'read':![],'body':_0x10ac79[_0x1ff0('0x56')][_0x1ff0('0x56')],'OpenchannelAccountId':_0x260d8a['id'],'UserId':_0x10ac79[_0x1ff0('0x57')]['id'],'ContactId':_0x3d1c9c['id']})]},{'include':[{'model':db[_0x1ff0('0x95')],'as':_0x1ff0('0xb5')}]})[_0x1ff0('0x1e')](function(_0x31d132){return[_0x31d132,!![]];});});}})[_0x1ff0('0x8d')](function(_0x2e8d0f,_0x35585a){if(_0x35585a){return _0x2e8d0f;}return db[_0x1ff0('0x95')][_0x1ff0('0x55')](_['merge'](_0x10ac79[_0x1ff0('0x56')],{'read':![],'body':_0x10ac79[_0x1ff0('0x56')][_0x1ff0('0x56')],'OpenchannelAccountId':_0x260d8a['id'],'OpenchannelInteractionId':_0x2e8d0f['id'],'UserId':_0x10ac79[_0x1ff0('0x57')]['id'],'ContactId':_0x3d1c9c['id']}))[_0x1ff0('0x1e')](function(_0xf3aab7){_0x2e8d0f[_0x1ff0('0xb6')][_0x1ff0('0xb5')]=[];_0x2e8d0f[_0x1ff0('0xb6')][_0x1ff0('0xb5')][_0x1ff0('0x92')](_0xf3aab7[_0x1ff0('0xb6')]);return _0x2e8d0f;});});}})[_0x1ff0('0x1e')](respondWithResult(_0x5518ab,null))[_0x1ff0('0x25')](handleError(_0x5518ab,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 55d2200..7d2cf38 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 _0xb688=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x257268,_0x2d5655){var _0x5a7a98=function(_0x8f3db4){while(--_0x8f3db4){_0x257268['push'](_0x257268['shift']());}};_0x5a7a98(++_0x2d5655);}(_0xb688,0xcf));var _0x8b68=function(_0x4f87f5,_0xc0627f){_0x4f87f5=_0x4f87f5-0x0;var _0x107af9=_0xb688[_0x4f87f5];return _0x107af9;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x8b68('0x0'))['db'][_0x8b68('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8b68('0x2')](0x0);var events={'afterCreate':_0x8b68('0x3'),'afterUpdate':_0x8b68('0x4'),'afterDestroy':_0x8b68('0x5')};function emitEvent(_0x4e281c){return function(_0x41030e,_0x27925d,_0x30f33d){OpenchannelAccountEvents[_0x8b68('0x6')](_0x4e281c+':'+_0x41030e['id'],_0x41030e);OpenchannelAccountEvents['emit'](_0x4e281c,_0x41030e);_0x30f33d(null);};}for(var e in events){if(events[_0x8b68('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x8b68('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xb903=['setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb','OpenchannelAccount'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xb903,0x185));var _0x3b90=function(_0x18080,_0x7c606a){_0x18080=_0x18080-0x0;var _0x43ece3=_0xb903[_0x18080];return _0x43ece3;};'use strict';var EventEmitter=require(_0x3b90('0x0'));var OpenchannelAccount=require(_0x3b90('0x1'))['db'][_0x3b90('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x3b90('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3b90('0x4'),'afterDestroy':_0x3b90('0x5')};function emitEvent(_0x3b024a){return function(_0x1cd5d8,_0x30d8db,_0x40f726){OpenchannelAccountEvents[_0x3b90('0x6')](_0x3b024a+':'+_0x1cd5d8['id'],_0x1cd5d8);OpenchannelAccountEvents['emit'](_0x3b024a,_0x1cd5d8);_0x40f726(null);};}for(var e in events){if(events[_0x3b90('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index f611f05..3aa288a 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(_0x1252ca,_0x593c02){var _0x19ff97=function(_0x4d979d){while(--_0x4d979d){_0x1252ca['push'](_0x1252ca['shift']());}};_0x19ff97(++_0x593c02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x4ee25d,_0x124ee0){var _0x3a9704=function(_0x473edb){while(--_0x473edb){_0x4ee25d['push'](_0x4ee25d['shift']());}};_0x3a9704(++_0x124ee0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 29122e8..3db70af 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 _0x1152=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','socket.io-emitter','redis','./openchannelAccount.socket','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1f1b09,_0x41f1b9){var _0x43505c=function(_0x3bc2d5){while(--_0x3bc2d5){_0x1f1b09['push'](_0x1f1b09['shift']());}};_0x43505c(++_0x41f1b9);}(_0x1152,0x182));var _0x2115=function(_0xe5287b,_0x26b8ab){_0xe5287b=_0xe5287b-0x0;var _0x346f77=_0x1152[_0xe5287b];return _0x346f77;};'use strict';var _=require(_0x2115('0x0'));var util=require(_0x2115('0x1'));var moment=require(_0x2115('0x2'));var BPromise=require(_0x2115('0x3'));var rs=require(_0x2115('0x4'));var fs=require('fs');var Redis=require(_0x2115('0x5'));var db=require(_0x2115('0x6'))['db'];var utils=require(_0x2115('0x7'));var logger=require('../../config/logger')(_0x2115('0x8'));var config=require('../../config/environment');var jayson=require(_0x2115('0x9'));var client=jayson[_0x2115('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2115('0xb'))(new Redis(config[_0x2115('0xc')]));require(_0x2115('0xd'))['register'](socket);function respondWithRpcPromise(_0x254648,_0x534958,_0x5ca468){return new BPromise(function(_0x225a1c,_0x272a95){return client[_0x2115('0xe')](_0x254648,_0x5ca468)['then'](function(_0x400b19){logger['info'](_0x2115('0xf'),_0x534958,_0x2115('0x10'));logger[_0x2115('0x11')](_0x2115('0x12'),_0x534958,_0x2115('0x10'),JSON['stringify'](_0x400b19));if(_0x400b19[_0x2115('0x13')]){if(_0x400b19['error'][_0x2115('0x14')]===0x1f4){logger[_0x2115('0x13')](_0x2115('0xf'),_0x534958,_0x400b19[_0x2115('0x13')][_0x2115('0x15')]);return _0x272a95(_0x400b19[_0x2115('0x13')][_0x2115('0x15')]);}logger['error'](_0x2115('0xf'),_0x534958,_0x400b19[_0x2115('0x13')][_0x2115('0x15')]);return _0x225a1c(_0x400b19[_0x2115('0x13')][_0x2115('0x15')]);}else{logger[_0x2115('0x16')](_0x2115('0xf'),_0x534958,_0x2115('0x10'));_0x225a1c(_0x400b19['result'][_0x2115('0x15')]);}})[_0x2115('0x17')](function(_0x38c26f){logger['error'](_0x2115('0xf'),_0x534958,_0x38c26f);_0x272a95(_0x38c26f);});});} \ No newline at end of file +var _0x4ded=['request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x27c068,_0x342981){var _0xe5a67f=function(_0x20658a){while(--_0x20658a){_0x27c068['push'](_0x27c068['shift']());}};_0xe5a67f(++_0x342981);}(_0x4ded,0x116));var _0xd4de=function(_0x1246a5,_0x560cac){_0x1246a5=_0x1246a5-0x0;var _0x5ad733=_0x4ded[_0x1246a5];return _0x5ad733;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var moment=require(_0xd4de('0x2'));var BPromise=require(_0xd4de('0x3'));var rs=require(_0xd4de('0x4'));var fs=require('fs');var Redis=require(_0xd4de('0x5'));var db=require(_0xd4de('0x6'))['db'];var utils=require(_0xd4de('0x7'));var logger=require(_0xd4de('0x8'))(_0xd4de('0x9'));var config=require(_0xd4de('0xa'));var jayson=require(_0xd4de('0xb'));var client=jayson['client'][_0xd4de('0xc')]({'port':0x232a});config[_0xd4de('0xd')]=_[_0xd4de('0xe')](config[_0xd4de('0xd')],{'host':_0xd4de('0xf'),'port':0x18eb});var socket=require(_0xd4de('0x10'))(new Redis(config['redis']));require(_0xd4de('0x11'))['register'](socket);function respondWithRpcPromise(_0x4ab822,_0x4b0876,_0x176b31){return new BPromise(function(_0x459a46,_0x4e5b10){return client['request'](_0x4ab822,_0x176b31)['then'](function(_0x29e265){logger['info'](_0xd4de('0x12'),_0x4b0876,_0xd4de('0x13'));logger[_0xd4de('0x14')](_0xd4de('0x15'),_0x4b0876,_0xd4de('0x13'),JSON[_0xd4de('0x16')](_0x29e265));if(_0x29e265[_0xd4de('0x17')]){if(_0x29e265[_0xd4de('0x17')][_0xd4de('0x18')]===0x1f4){logger[_0xd4de('0x17')](_0xd4de('0x12'),_0x4b0876,_0x29e265[_0xd4de('0x17')][_0xd4de('0x19')]);return _0x4e5b10(_0x29e265[_0xd4de('0x17')][_0xd4de('0x19')]);}logger[_0xd4de('0x17')](_0xd4de('0x12'),_0x4b0876,_0x29e265['error']['message']);return _0x459a46(_0x29e265[_0xd4de('0x17')][_0xd4de('0x19')]);}else{logger[_0xd4de('0x1a')](_0xd4de('0x12'),_0x4b0876,'request\x20sent');_0x459a46(_0x29e265['result'][_0xd4de('0x19')]);}})['catch'](function(_0xeaaefa){logger[_0xd4de('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x4b0876,_0xeaaefa);_0x4e5b10(_0xeaaefa);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 52c5348..f92174c 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 _0x4f88=['removeListener','register','length','./openchannelAccount.events','save','update'];(function(_0x5ae268,_0x4b3d90){var _0x3fea8b=function(_0x4a0c9c){while(--_0x4a0c9c){_0x5ae268['push'](_0x5ae268['shift']());}};_0x3fea8b(++_0x4b3d90);}(_0x4f88,0xf3));var _0x84f8=function(_0x3c4e4c,_0x36ff70){_0x3c4e4c=_0x3c4e4c-0x0;var _0x144a87=_0x4f88[_0x3c4e4c];return _0x144a87;};'use strict';var OpenchannelAccountEvents=require(_0x84f8('0x0'));var events=[_0x84f8('0x1'),'remove',_0x84f8('0x2')];function createListener(_0x1b0c3f,_0x305358){return function(_0x4c27ff){_0x305358['emit'](_0x1b0c3f,_0x4c27ff);};}function removeListener(_0xef8394,_0x17ca7c){return function(){OpenchannelAccountEvents[_0x84f8('0x3')](_0xef8394,_0x17ca7c);};}exports[_0x84f8('0x4')]=function(_0x79dcec){for(var _0x1ac0c8=0x0,_0x5aa345=events[_0x84f8('0x5')];_0x1ac0c8<_0x5aa345;_0x1ac0c8++){var _0x40e5f3=events[_0x1ac0c8];var _0x4ae430=createListener('openchannelAccount:'+_0x40e5f3,_0x79dcec);OpenchannelAccountEvents['on'](_0x40e5f3,_0x4ae430);}}; \ No newline at end of file +var _0x195e=['save','remove','update','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x8aa169,_0x206565){var _0x12a7bb=function(_0x5e2a48){while(--_0x5e2a48){_0x8aa169['push'](_0x8aa169['shift']());}};_0x12a7bb(++_0x206565);}(_0x195e,0xfb));var _0xe195=function(_0x528841,_0x388489){_0x528841=_0x528841-0x0;var _0x9d01a8=_0x195e[_0x528841];return _0x9d01a8;};'use strict';var OpenchannelAccountEvents=require(_0xe195('0x0'));var events=[_0xe195('0x1'),_0xe195('0x2'),_0xe195('0x3')];function createListener(_0x40fe4d,_0x3975a9){return function(_0x31ca3b){_0x3975a9[_0xe195('0x4')](_0x40fe4d,_0x31ca3b);};}function removeListener(_0x2243e9,_0x30011c){return function(){OpenchannelAccountEvents[_0xe195('0x5')](_0x2243e9,_0x30011c);};}exports[_0xe195('0x6')]=function(_0x11cc55){for(var _0x595c13=0x0,_0x2a1acc=events[_0xe195('0x7')];_0x595c13<_0x2a1acc;_0x595c13++){var _0x2ead59=events[_0x595c13];var _0x28c1a9=createListener(_0xe195('0x8')+_0x2ead59,_0x11cc55);OpenchannelAccountEvents['on'](_0x2ead59,_0x28c1a9);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index efde182..57511c7 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 _0xc51b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','create','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x409124,_0x2c73e6){var _0x4eb007=function(_0x131345){while(--_0x131345){_0x409124['push'](_0x409124['shift']());}};_0x4eb007(++_0x2c73e6);}(_0xc51b,0x152));var _0xbc51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc51b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbc51('0x0'));var util=require(_0xbc51('0x1'));var path=require(_0xbc51('0x2'));var timeout=require(_0xbc51('0x3'));var express=require('express');var router=express[_0xbc51('0x4')]();var fs_extra=require(_0xbc51('0x5'));var auth=require(_0xbc51('0x6'));var interaction=require(_0xbc51('0x7'));var config=require(_0xbc51('0x8'));var controller=require(_0xbc51('0x9'));router[_0xbc51('0xa')]('/',auth[_0xbc51('0xb')](),controller[_0xbc51('0xc')]);router[_0xbc51('0xa')](_0xbc51('0xd'),auth[_0xbc51('0xb')](),controller['show']);router[_0xbc51('0xe')]('/',auth[_0xbc51('0xb')](),controller[_0xbc51('0xf')]);router['put'](_0xbc51('0xd'),auth['isAuthenticated'](),controller[_0xbc51('0x10')]);router[_0xbc51('0x11')](_0xbc51('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xbc51('0x12')]=router; \ No newline at end of file +var _0x785c=['put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x2cda78,_0x545368){var _0x2f33cd=function(_0x1d9549){while(--_0x1d9549){_0x2cda78['push'](_0x2cda78['shift']());}};_0x2f33cd(++_0x545368);}(_0x785c,0x16d));var _0xc785=function(_0x422acf,_0x3bb9bf){_0x422acf=_0x422acf-0x0;var _0x2d3527=_0x785c[_0x422acf];return _0x2d3527;};'use strict';var multer=require('multer');var util=require(_0xc785('0x0'));var path=require(_0xc785('0x1'));var timeout=require(_0xc785('0x2'));var express=require(_0xc785('0x3'));var router=express[_0xc785('0x4')]();var fs_extra=require(_0xc785('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc785('0x6'));var config=require(_0xc785('0x7'));var controller=require(_0xc785('0x8'));router[_0xc785('0x9')]('/',auth[_0xc785('0xa')](),controller[_0xc785('0xb')]);router[_0xc785('0x9')](_0xc785('0xc'),auth[_0xc785('0xa')](),controller[_0xc785('0xd')]);router[_0xc785('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc785('0xf')](_0xc785('0xc'),auth[_0xc785('0xa')](),controller[_0xc785('0x10')]);router['delete']('/:id',auth[_0xc785('0xa')](),controller[_0xc785('0x11')]);module[_0xc785('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 5d8c0e3..73a4f39 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 _0x233c=['exports','STRING','noop','sequelize'];(function(_0x5379a4,_0x533a6d){var _0x3e78f3=function(_0x261ede){while(--_0x261ede){_0x5379a4['push'](_0x5379a4['shift']());}};_0x3e78f3(++_0x533a6d);}(_0x233c,0x6f));var _0xc233=function(_0x5db25b,_0x4455a9){_0x5db25b=_0x5db25b-0x0;var _0x408708=_0x233c[_0x5db25b];return _0x408708;};'use strict';var Sequelize=require(_0xc233('0x0'));module[_0xc233('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc233('0x2')],'allowNull':![],'defaultValue':_0xc233('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc233('0x2')]},'interval':{'type':Sequelize[_0xc233('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xa09b=['INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x45fe28,_0x1c74a1){var _0x5bc0c1=function(_0x1a9023){while(--_0x1a9023){_0x45fe28['push'](_0x45fe28['shift']());}};_0x5bc0c1(++_0x1c74a1);}(_0xa09b,0x171));var _0xba09=function(_0x2e5733,_0x4a0d7a){_0x2e5733=_0x2e5733-0x0;var _0xafec34=_0xa09b[_0x2e5733];return _0xafec34;};'use strict';var Sequelize=require(_0xba09('0x0'));module['exports']={'priority':{'type':Sequelize[_0xba09('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xba09('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xba09('0x3')]},'interval':{'type':Sequelize[_0xba09('0x3')],'defaultValue':_0xba09('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 1f8492a..ce386fd 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 _0x621e=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','OpenchannelApplication','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x621e,0x16b));var _0xe621=function(_0x969a32,_0x3cabe8){_0x969a32=_0x969a32-0x0;var _0x5945e7=_0x621e[_0x969a32];return _0x5945e7;};'use strict';var emlformat=require(_0xe621('0x0'));var rimraf=require(_0xe621('0x1'));var zipdir=require(_0xe621('0x2'));var jsonpatch=require(_0xe621('0x3'));var rp=require(_0xe621('0x4'));var moment=require(_0xe621('0x5'));var BPromise=require(_0xe621('0x6'));var Mustache=require(_0xe621('0x7'));var util=require('util');var path=require(_0xe621('0x8'));var sox=require(_0xe621('0x9'));var csv=require(_0xe621('0xa'));var ejs=require(_0xe621('0xb'));var fs=require('fs');var fs_extra=require(_0xe621('0xc'));var _=require(_0xe621('0xd'));var squel=require(_0xe621('0xe'));var crypto=require(_0xe621('0xf'));var jsforce=require(_0xe621('0x10'));var deskjs=require(_0xe621('0x11'));var toCsv=require(_0xe621('0xa'));var querystring=require(_0xe621('0x12'));var Papa=require(_0xe621('0x13'));var Redis=require('ioredis');var authService=require(_0xe621('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe621('0x15'));var hardwareService=require(_0xe621('0x16'));var logger=require(_0xe621('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xe621('0x18'));var licenseUtil=require(_0xe621('0x19'));var db=require(_0xe621('0x1a'))['db'];function respondWithStatusCode(_0x3fed9a,_0x1e171b){_0x1e171b=_0x1e171b||0xcc;return function(_0x1d3118){if(_0x1d3118){return _0x3fed9a[_0xe621('0x1b')](_0x1e171b);}return _0x3fed9a[_0xe621('0x1c')](_0x1e171b)[_0xe621('0x1d')]();};}function respondWithResult(_0x2871df,_0x1c914b){_0x1c914b=_0x1c914b||0xc8;return function(_0x12c4f4){if(_0x12c4f4){return _0x2871df['status'](_0x1c914b)['json'](_0x12c4f4);}};}function respondWithFilteredResult(_0x146564,_0x3da25b){return function(_0x274b93){if(_0x274b93){var _0x2f7d39=typeof _0x3da25b[_0xe621('0x1e')]===_0xe621('0x1f')&&typeof _0x3da25b['limit']===_0xe621('0x1f');var _0x435531=_0x274b93[_0xe621('0x20')];var _0x418035=_0x2f7d39?0x0:_0x3da25b[_0xe621('0x1e')];var _0x53de63=_0x2f7d39?_0x274b93[_0xe621('0x20')]:_0x3da25b[_0xe621('0x1e')]+_0x3da25b[_0xe621('0x21')];var _0x1afe53;if(_0x53de63>=_0x435531){_0x53de63=_0x435531;_0x1afe53=0xc8;}else{_0x1afe53=0xce;}_0x146564['status'](_0x1afe53);return _0x146564['set'](_0xe621('0x22'),_0x418035+'-'+_0x53de63+'/'+_0x435531)[_0xe621('0x23')](_0x274b93);}return null;};}function patchUpdates(_0x328451){return function(_0x4f7ae7){try{jsonpatch[_0xe621('0x24')](_0x4f7ae7,_0x328451,!![]);}catch(_0x1d27af){return BPromise[_0xe621('0x25')](_0x1d27af);}return _0x4f7ae7[_0xe621('0x26')]();};}function saveUpdates(_0x4f7c92,_0x222717){return function(_0x58821a){if(_0x58821a){return _0x58821a[_0xe621('0x27')](_0x4f7c92)[_0xe621('0x28')](function(_0x51d0a0){return _0x51d0a0;});}return null;};}function removeEntity(_0x45d786,_0x3d7e50){return function(_0x1a0ce1){if(_0x1a0ce1){return _0x1a0ce1[_0xe621('0x29')]()[_0xe621('0x28')](function(){_0x45d786[_0xe621('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b7d72,_0x19241c){return function(_0x5bcb4a){if(!_0x5bcb4a){_0x1b7d72[_0xe621('0x1b')](0x194);}return _0x5bcb4a;};}function handleError(_0x1a93c7,_0x3d93e1){_0x3d93e1=_0x3d93e1||0x1f4;return function(_0xa114b9){logger[_0xe621('0x2a')](_0xa114b9['stack']);if(_0xa114b9['name']){delete _0xa114b9['name'];}_0x1a93c7[_0xe621('0x1c')](_0x3d93e1)['send'](_0xa114b9);};}exports[_0xe621('0x2b')]=function(_0x33dece,_0x950d17){var _0x2da886={},_0x56433a={},_0x450b44={'count':0x0,'rows':[]};var _0x3d1377=_[_0xe621('0x2c')](db['OpenchannelApplication'][_0xe621('0x2d')],function(_0x4655ef){return{'name':_0x4655ef[_0xe621('0x2e')],'type':_0x4655ef[_0xe621('0x2f')][_0xe621('0x30')]};});_0x56433a[_0xe621('0x31')]=_[_0xe621('0x2c')](_0x3d1377,'name');_0x56433a[_0xe621('0x32')]=_[_0xe621('0x33')](_0x33dece[_0xe621('0x32')]);_0x56433a[_0xe621('0x34')]=_['intersection'](_0x56433a['model'],_0x56433a[_0xe621('0x32')]);_0x2da886['attributes']=_[_0xe621('0x35')](_0x56433a[_0xe621('0x31')],qs['fields'](_0x33dece['query'][_0xe621('0x36')]));_0x2da886[_0xe621('0x37')]=_0x2da886[_0xe621('0x37')][_0xe621('0x38')]?_0x2da886[_0xe621('0x37')]:_0x56433a[_0xe621('0x31')];if(!_0x33dece[_0xe621('0x32')]['hasOwnProperty'](_0xe621('0x39'))){_0x2da886[_0xe621('0x21')]=qs['limit'](_0x33dece[_0xe621('0x32')][_0xe621('0x21')]);_0x2da886['offset']=qs[_0xe621('0x1e')](_0x33dece[_0xe621('0x32')][_0xe621('0x1e')]);}_0x2da886[_0xe621('0x3a')]=qs[_0xe621('0x3b')](_0x33dece[_0xe621('0x32')][_0xe621('0x3b')]);_0x2da886[_0xe621('0x3c')]=qs[_0xe621('0x34')](_['pick'](_0x33dece[_0xe621('0x32')],_0x56433a[_0xe621('0x34')]),_0x3d1377);if(_0x33dece['query'][_0xe621('0x3d')]){_0x2da886['where']=_[_0xe621('0x3e')](_0x2da886[_0xe621('0x3c')],{'$or':_[_0xe621('0x2c')](_0x3d1377,function(_0x43a1f9){if(_0x43a1f9[_0xe621('0x2f')]!==_0xe621('0x3f')){var _0x9c2240={};_0x9c2240[_0x43a1f9[_0xe621('0x40')]]={'$like':'%'+_0x33dece['query'][_0xe621('0x3d')]+'%'};return _0x9c2240;}})});}_0x2da886=_['merge']({},_0x2da886,_0x33dece[_0xe621('0x41')]);var _0x4126eb={'where':_0x2da886['where']};return db[_0xe621('0x42')][_0xe621('0x20')](_0x4126eb)['then'](function(_0x3eb6b0){_0x450b44[_0xe621('0x20')]=_0x3eb6b0;if(_0x33dece[_0xe621('0x32')][_0xe621('0x43')]){_0x2da886[_0xe621('0x44')]=[{'all':!![]}];}return db[_0xe621('0x42')]['findAll'](_0x2da886);})[_0xe621('0x28')](function(_0x5ea8a1){_0x450b44[_0xe621('0x45')]=_0x5ea8a1;return _0x450b44;})[_0xe621('0x28')](respondWithFilteredResult(_0x950d17,_0x2da886))[_0xe621('0x46')](handleError(_0x950d17,null));};exports[_0xe621('0x47')]=function(_0x4f3bd6,_0x2f0320){var _0x58abec={'raw':!![],'where':{'id':_0x4f3bd6[_0xe621('0x48')]['id']}},_0xdd7c9a={};_0xdd7c9a[_0xe621('0x31')]=_[_0xe621('0x33')](db[_0xe621('0x42')]['rawAttributes']);_0xdd7c9a[_0xe621('0x32')]=_[_0xe621('0x33')](_0x4f3bd6[_0xe621('0x32')]);_0xdd7c9a[_0xe621('0x34')]=_[_0xe621('0x35')](_0xdd7c9a[_0xe621('0x31')],_0xdd7c9a[_0xe621('0x32')]);_0x58abec[_0xe621('0x37')]=_[_0xe621('0x35')](_0xdd7c9a[_0xe621('0x31')],qs['fields'](_0x4f3bd6[_0xe621('0x32')][_0xe621('0x36')]));_0x58abec[_0xe621('0x37')]=_0x58abec[_0xe621('0x37')][_0xe621('0x38')]?_0x58abec[_0xe621('0x37')]:_0xdd7c9a[_0xe621('0x31')];if(_0x4f3bd6['query']['includeAll']){_0x58abec[_0xe621('0x44')]=[{'all':!![]}];}_0x58abec=_[_0xe621('0x3e')]({},_0x58abec,_0x4f3bd6[_0xe621('0x41')]);return db['OpenchannelApplication'][_0xe621('0x49')](_0x58abec)[_0xe621('0x28')](handleEntityNotFound(_0x2f0320,null))[_0xe621('0x28')](respondWithResult(_0x2f0320,null))['catch'](handleError(_0x2f0320,null));};exports[_0xe621('0x4a')]=function(_0x3654ad,_0x1a114a){return db[_0xe621('0x42')][_0xe621('0x4a')](_0x3654ad[_0xe621('0x4b')],{})[_0xe621('0x28')](respondWithResult(_0x1a114a,0xc9))[_0xe621('0x46')](handleError(_0x1a114a,null));};exports[_0xe621('0x27')]=function(_0x2d7948,_0x4d0a1f){if(_0x2d7948[_0xe621('0x4b')]['id']){delete _0x2d7948[_0xe621('0x4b')]['id'];}return db[_0xe621('0x42')][_0xe621('0x49')]({'where':{'id':_0x2d7948[_0xe621('0x48')]['id']}})[_0xe621('0x28')](handleEntityNotFound(_0x4d0a1f,null))['then'](saveUpdates(_0x2d7948['body'],null))['then'](respondWithResult(_0x4d0a1f,null))[_0xe621('0x46')](handleError(_0x4d0a1f,null));};exports[_0xe621('0x29')]=function(_0x25ddc5,_0x1ae158){return db['OpenchannelApplication'][_0xe621('0x49')]({'where':{'id':_0x25ddc5['params']['id']}})['then'](handleEntityNotFound(_0x1ae158,null))[_0xe621('0x28')](removeEntity(_0x1ae158,null))['catch'](handleError(_0x1ae158,null));}; \ No newline at end of file +var _0xc273=['map','OpenchannelApplication','rawAttributes','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','catch','show','params','include','find','create','body','destroy','zip-dir','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index'];(function(_0x36f284,_0x24cbd1){var _0x4ea099=function(_0xea729e){while(--_0xea729e){_0x36f284['push'](_0x36f284['shift']());}};_0x4ea099(++_0x24cbd1);}(_0xc273,0x6e));var _0x3c27=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0xc273[_0x4314d7];return _0x5c599b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3c27('0x0'));var jsonpatch=require(_0x3c27('0x1'));var rp=require(_0x3c27('0x2'));var moment=require(_0x3c27('0x3'));var BPromise=require(_0x3c27('0x4'));var Mustache=require(_0x3c27('0x5'));var util=require(_0x3c27('0x6'));var path=require(_0x3c27('0x7'));var sox=require(_0x3c27('0x8'));var csv=require(_0x3c27('0x9'));var ejs=require(_0x3c27('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c27('0xb'));var squel=require(_0x3c27('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3c27('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3c27('0xe'));var Papa=require(_0x3c27('0xf'));var Redis=require(_0x3c27('0x10'));var authService=require(_0x3c27('0x11'));var qs=require(_0x3c27('0x12'));var as=require(_0x3c27('0x13'));var hardwareService=require(_0x3c27('0x14'));var logger=require(_0x3c27('0x15'))(_0x3c27('0x16'));var utils=require(_0x3c27('0x17'));var config=require(_0x3c27('0x18'));var licenseUtil=require(_0x3c27('0x19'));var db=require(_0x3c27('0x1a'))['db'];function respondWithStatusCode(_0x217101,_0x2a6521){_0x2a6521=_0x2a6521||0xcc;return function(_0x376825){if(_0x376825){return _0x217101['sendStatus'](_0x2a6521);}return _0x217101[_0x3c27('0x1b')](_0x2a6521)[_0x3c27('0x1c')]();};}function respondWithResult(_0x4d3b30,_0x528f0a){_0x528f0a=_0x528f0a||0xc8;return function(_0x26c564){if(_0x26c564){return _0x4d3b30[_0x3c27('0x1b')](_0x528f0a)[_0x3c27('0x1d')](_0x26c564);}};}function respondWithFilteredResult(_0x4aaa58,_0xaef348){return function(_0x1755bd){if(_0x1755bd){var _0x3a88f7=typeof _0xaef348['offset']===_0x3c27('0x1e')&&typeof _0xaef348[_0x3c27('0x1f')]===_0x3c27('0x1e');var _0x1d1f61=_0x1755bd['count'];var _0x3e1ce8=_0x3a88f7?0x0:_0xaef348[_0x3c27('0x20')];var _0x531bdb=_0x3a88f7?_0x1755bd['count']:_0xaef348[_0x3c27('0x20')]+_0xaef348['limit'];var _0x3cd4f5;if(_0x531bdb>=_0x1d1f61){_0x531bdb=_0x1d1f61;_0x3cd4f5=0xc8;}else{_0x3cd4f5=0xce;}_0x4aaa58[_0x3c27('0x1b')](_0x3cd4f5);return _0x4aaa58[_0x3c27('0x21')](_0x3c27('0x22'),_0x3e1ce8+'-'+_0x531bdb+'/'+_0x1d1f61)[_0x3c27('0x1d')](_0x1755bd);}return null;};}function patchUpdates(_0x4604f4){return function(_0x147789){try{jsonpatch[_0x3c27('0x23')](_0x147789,_0x4604f4,!![]);}catch(_0x570a4e){return BPromise[_0x3c27('0x24')](_0x570a4e);}return _0x147789[_0x3c27('0x25')]();};}function saveUpdates(_0x16cd30,_0x29994e){return function(_0x177672){if(_0x177672){return _0x177672[_0x3c27('0x26')](_0x16cd30)[_0x3c27('0x27')](function(_0xecf3df){return _0xecf3df;});}return null;};}function removeEntity(_0x4db9ca,_0x2e55f5){return function(_0x3c1249){if(_0x3c1249){return _0x3c1249['destroy']()['then'](function(){_0x4db9ca[_0x3c27('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x445562,_0x4f2181){return function(_0x44885f){if(!_0x44885f){_0x445562[_0x3c27('0x28')](0x194);}return _0x44885f;};}function handleError(_0x44f19b,_0x374efa){_0x374efa=_0x374efa||0x1f4;return function(_0x40fe86){logger[_0x3c27('0x29')](_0x40fe86[_0x3c27('0x2a')]);if(_0x40fe86['name']){delete _0x40fe86[_0x3c27('0x2b')];}_0x44f19b[_0x3c27('0x1b')](_0x374efa)[_0x3c27('0x2c')](_0x40fe86);};}exports[_0x3c27('0x2d')]=function(_0x49beb1,_0x2fafaf){var _0x4c838c={},_0x16a198={},_0x38fa3f={'count':0x0,'rows':[]};var _0x55b2d7=_[_0x3c27('0x2e')](db[_0x3c27('0x2f')][_0x3c27('0x30')],function(_0x2b1970){return{'name':_0x2b1970['fieldName'],'type':_0x2b1970['type'][_0x3c27('0x31')]};});_0x16a198[_0x3c27('0x32')]=_[_0x3c27('0x2e')](_0x55b2d7,_0x3c27('0x2b'));_0x16a198['query']=_[_0x3c27('0x33')](_0x49beb1['query']);_0x16a198['filters']=_['intersection'](_0x16a198['model'],_0x16a198[_0x3c27('0x34')]);_0x4c838c['attributes']=_[_0x3c27('0x35')](_0x16a198[_0x3c27('0x32')],qs[_0x3c27('0x36')](_0x49beb1[_0x3c27('0x34')][_0x3c27('0x36')]));_0x4c838c[_0x3c27('0x37')]=_0x4c838c['attributes'][_0x3c27('0x38')]?_0x4c838c[_0x3c27('0x37')]:_0x16a198[_0x3c27('0x32')];if(!_0x49beb1[_0x3c27('0x34')][_0x3c27('0x39')](_0x3c27('0x3a'))){_0x4c838c['limit']=qs['limit'](_0x49beb1['query'][_0x3c27('0x1f')]);_0x4c838c['offset']=qs[_0x3c27('0x20')](_0x49beb1[_0x3c27('0x34')][_0x3c27('0x20')]);}_0x4c838c['order']=qs['sort'](_0x49beb1['query'][_0x3c27('0x3b')]);_0x4c838c[_0x3c27('0x3c')]=qs[_0x3c27('0x3d')](_['pick'](_0x49beb1[_0x3c27('0x34')],_0x16a198[_0x3c27('0x3d')]),_0x55b2d7);if(_0x49beb1[_0x3c27('0x34')][_0x3c27('0x3e')]){_0x4c838c[_0x3c27('0x3c')]=_[_0x3c27('0x3f')](_0x4c838c[_0x3c27('0x3c')],{'$or':_[_0x3c27('0x2e')](_0x55b2d7,function(_0x30a870){if(_0x30a870[_0x3c27('0x40')]!==_0x3c27('0x41')){var _0x43a797={};_0x43a797[_0x30a870[_0x3c27('0x2b')]]={'$like':'%'+_0x49beb1[_0x3c27('0x34')][_0x3c27('0x3e')]+'%'};return _0x43a797;}})});}_0x4c838c=_[_0x3c27('0x3f')]({},_0x4c838c,_0x49beb1[_0x3c27('0x42')]);var _0x4e7a40={'where':_0x4c838c['where']};return db[_0x3c27('0x2f')][_0x3c27('0x43')](_0x4e7a40)[_0x3c27('0x27')](function(_0x583862){_0x38fa3f['count']=_0x583862;if(_0x49beb1[_0x3c27('0x34')][_0x3c27('0x44')]){_0x4c838c['include']=[{'all':!![]}];}return db[_0x3c27('0x2f')][_0x3c27('0x45')](_0x4c838c);})[_0x3c27('0x27')](function(_0x24baee){_0x38fa3f['rows']=_0x24baee;return _0x38fa3f;})['then'](respondWithFilteredResult(_0x2fafaf,_0x4c838c))[_0x3c27('0x46')](handleError(_0x2fafaf,null));};exports[_0x3c27('0x47')]=function(_0x2b0b55,_0x17ac78){var _0x518458={'raw':!![],'where':{'id':_0x2b0b55[_0x3c27('0x48')]['id']}},_0x189cf5={};_0x189cf5[_0x3c27('0x32')]=_['keys'](db[_0x3c27('0x2f')][_0x3c27('0x30')]);_0x189cf5['query']=_[_0x3c27('0x33')](_0x2b0b55[_0x3c27('0x34')]);_0x189cf5[_0x3c27('0x3d')]=_['intersection'](_0x189cf5[_0x3c27('0x32')],_0x189cf5[_0x3c27('0x34')]);_0x518458[_0x3c27('0x37')]=_[_0x3c27('0x35')](_0x189cf5[_0x3c27('0x32')],qs['fields'](_0x2b0b55[_0x3c27('0x34')][_0x3c27('0x36')]));_0x518458[_0x3c27('0x37')]=_0x518458[_0x3c27('0x37')][_0x3c27('0x38')]?_0x518458[_0x3c27('0x37')]:_0x189cf5[_0x3c27('0x32')];if(_0x2b0b55[_0x3c27('0x34')][_0x3c27('0x44')]){_0x518458[_0x3c27('0x49')]=[{'all':!![]}];}_0x518458=_[_0x3c27('0x3f')]({},_0x518458,_0x2b0b55[_0x3c27('0x42')]);return db[_0x3c27('0x2f')][_0x3c27('0x4a')](_0x518458)[_0x3c27('0x27')](handleEntityNotFound(_0x17ac78,null))[_0x3c27('0x27')](respondWithResult(_0x17ac78,null))['catch'](handleError(_0x17ac78,null));};exports[_0x3c27('0x4b')]=function(_0x28031b,_0x3038a6){return db['OpenchannelApplication'][_0x3c27('0x4b')](_0x28031b[_0x3c27('0x4c')],{})[_0x3c27('0x27')](respondWithResult(_0x3038a6,0xc9))[_0x3c27('0x46')](handleError(_0x3038a6,null));};exports[_0x3c27('0x26')]=function(_0x46e676,_0x4f6e9a){if(_0x46e676['body']['id']){delete _0x46e676[_0x3c27('0x4c')]['id'];}return db[_0x3c27('0x2f')][_0x3c27('0x4a')]({'where':{'id':_0x46e676[_0x3c27('0x48')]['id']}})[_0x3c27('0x27')](handleEntityNotFound(_0x4f6e9a,null))['then'](saveUpdates(_0x46e676[_0x3c27('0x4c')],null))['then'](respondWithResult(_0x4f6e9a,null))['catch'](handleError(_0x4f6e9a,null));};exports[_0x3c27('0x4d')]=function(_0x409d68,_0x1f037c){return db['OpenchannelApplication'][_0x3c27('0x4a')]({'where':{'id':_0x409d68[_0x3c27('0x48')]['id']}})[_0x3c27('0x27')](handleEntityNotFound(_0x1f037c,null))['then'](removeEntity(_0x1f037c,null))[_0x3c27('0x46')](handleError(_0x1f037c,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 7b96857..5d91832 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 _0x9e14=['rimraf','../../config/environment','exports','OpenchannelApplication','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xa7915c,_0x416c03){var _0x5a9555=function(_0xd5aaf0){while(--_0xd5aaf0){_0xa7915c['push'](_0xa7915c['shift']());}};_0x5a9555(++_0x416c03);}(_0x9e14,0x65));var _0x49e1=function(_0x1a5f16,_0x37427a){_0x1a5f16=_0x1a5f16-0x0;var _0x231f07=_0x9e14[_0x1a5f16];return _0x231f07;};'use strict';var _=require(_0x49e1('0x0'));var util=require(_0x49e1('0x1'));var logger=require('../../config/logger')(_0x49e1('0x2'));var moment=require(_0x49e1('0x3'));var BPromise=require(_0x49e1('0x4'));var rp=require(_0x49e1('0x5'));var fs=require('fs');var path=require(_0x49e1('0x6'));var rimraf=require(_0x49e1('0x7'));var config=require(_0x49e1('0x8'));var attributes=require('./openchannelApplication.attributes');module[_0x49e1('0x9')]=function(_0xaf0556,_0x3f7761){return _0xaf0556['define'](_0x49e1('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x49e1('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe951=['request-promise','path','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x22b772,_0x86ba59){var _0x444e9b=function(_0x759042){while(--_0x759042){_0x22b772['push'](_0x22b772['shift']());}};_0x444e9b(++_0x86ba59);}(_0xe951,0x136));var _0x1e95=function(_0x11c7d3,_0x47fe03){_0x11c7d3=_0x11c7d3-0x0;var _0x351767=_0xe951[_0x11c7d3];return _0x351767;};'use strict';var _=require(_0x1e95('0x0'));var util=require(_0x1e95('0x1'));var logger=require(_0x1e95('0x2'))(_0x1e95('0x3'));var moment=require('moment');var BPromise=require(_0x1e95('0x4'));var rp=require(_0x1e95('0x5'));var fs=require('fs');var path=require(_0x1e95('0x6'));var rimraf=require(_0x1e95('0x7'));var config=require('../../config/environment');var attributes=require(_0x1e95('0x8'));module[_0x1e95('0x9')]=function(_0x535891,_0x1321c5){return _0x535891[_0x1e95('0xa')](_0x1e95('0xb'),attributes,{'tableName':_0x1e95('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1e95('0xd'),'collate':_0x1e95('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 003ea1b..bf5c0d4 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 _0xefe2=['OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','UpdateOpenchannelApplication','update','body','options','raw','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x26cfa1,_0x2f8769){var _0x65353c=function(_0x52377b){while(--_0x52377b){_0x26cfa1['push'](_0x26cfa1['shift']());}};_0x65353c(++_0x2f8769);}(_0xefe2,0xeb));var _0x2efe=function(_0x1eab44,_0x5f0d5e){_0x1eab44=_0x1eab44-0x0;var _0x54ec11=_0xefe2[_0x1eab44];return _0x54ec11;};'use strict';var _=require(_0x2efe('0x0'));var util=require(_0x2efe('0x1'));var moment=require(_0x2efe('0x2'));var BPromise=require(_0x2efe('0x3'));var rs=require(_0x2efe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2efe('0x5'))['db'];var utils=require(_0x2efe('0x6'));var logger=require(_0x2efe('0x7'))(_0x2efe('0x8'));var config=require(_0x2efe('0x9'));var jayson=require(_0x2efe('0xa'));var client=jayson['client'][_0x2efe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc72550,_0x42b865,_0x35a9b5){return new BPromise(function(_0x53f17,_0x129ab8){return client[_0x2efe('0xc')](_0xc72550,_0x35a9b5)['then'](function(_0x36ed54){logger['info'](_0x2efe('0xd'),_0x42b865,_0x2efe('0xe'));logger[_0x2efe('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x42b865,_0x2efe('0xe'),JSON[_0x2efe('0x10')](_0x36ed54));if(_0x36ed54[_0x2efe('0x11')]){if(_0x36ed54[_0x2efe('0x11')][_0x2efe('0x12')]===0x1f4){logger[_0x2efe('0x11')](_0x2efe('0xd'),_0x42b865,_0x36ed54[_0x2efe('0x11')][_0x2efe('0x13')]);return _0x129ab8(_0x36ed54[_0x2efe('0x11')][_0x2efe('0x13')]);}logger[_0x2efe('0x11')](_0x2efe('0xd'),_0x42b865,_0x36ed54[_0x2efe('0x11')]['message']);return _0x53f17(_0x36ed54[_0x2efe('0x11')][_0x2efe('0x13')]);}else{logger[_0x2efe('0x14')](_0x2efe('0xd'),_0x42b865,_0x2efe('0xe'));_0x53f17(_0x36ed54[_0x2efe('0x15')][_0x2efe('0x13')]);}})['catch'](function(_0x212e82){logger[_0x2efe('0x11')](_0x2efe('0xd'),_0x42b865,_0x212e82);_0x129ab8(_0x212e82);});});}exports[_0x2efe('0x16')]=function(_0x453c30){var _0x57e745=this;return new Promise(function(_0x172ade,_0x1712bf){return db['OpenchannelApplication'][_0x2efe('0x17')](_0x453c30[_0x2efe('0x18')],{'raw':_0x453c30[_0x2efe('0x19')]?_0x453c30[_0x2efe('0x19')][_0x2efe('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x453c30[_0x2efe('0x19')]?_0x453c30[_0x2efe('0x19')][_0x2efe('0x1b')]||null:null,'attributes':_0x453c30['options']?_0x453c30['options'][_0x2efe('0x1c')]||null:null,'limit':_0x453c30[_0x2efe('0x19')]?_0x453c30['options'][_0x2efe('0x1d')]||null:null})['then'](function(_0x53978f){logger[_0x2efe('0x14')](_0x2efe('0x16'),_0x453c30);logger[_0x2efe('0xf')]('UpdateOpenchannelApplication',_0x453c30,JSON[_0x2efe('0x10')](_0x53978f));_0x172ade(_0x53978f);})[_0x2efe('0x1e')](function(_0x32d90b){logger[_0x2efe('0x11')]('UpdateOpenchannelApplication',_0x32d90b[_0x2efe('0x13')],_0x453c30);_0x1712bf(_0x57e745[_0x2efe('0x11')](0x1f4,_0x32d90b[_0x2efe('0x13')]));});});}; \ No newline at end of file +var _0xbefe=['options','raw','where','attributes','limit','then','debug','UpdateOpenchannelApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','error','code','message','catch','OpenchannelApplication'];(function(_0x33e326,_0x53a184){var _0x18505e=function(_0x51848a){while(--_0x51848a){_0x33e326['push'](_0x33e326['shift']());}};_0x18505e(++_0x53a184);}(_0xbefe,0x1b8));var _0xebef=function(_0x4cc588,_0x4a9bc4){_0x4cc588=_0x4cc588-0x0;var _0x36619d=_0xbefe[_0x4cc588];return _0x36619d;};'use strict';var _=require(_0xebef('0x0'));var util=require(_0xebef('0x1'));var moment=require(_0xebef('0x2'));var BPromise=require(_0xebef('0x3'));var rs=require(_0xebef('0x4'));var fs=require('fs');var Redis=require(_0xebef('0x5'));var db=require(_0xebef('0x6'))['db'];var utils=require(_0xebef('0x7'));var logger=require('../../config/logger')(_0xebef('0x8'));var config=require(_0xebef('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xebef('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dc57e,_0x2c1ff4,_0x330a16){return new BPromise(function(_0x2c39f8,_0x441a24){return client[_0xebef('0xb')](_0x2dc57e,_0x330a16)['then'](function(_0x315807){logger['info'](_0xebef('0xc'),_0x2c1ff4,_0xebef('0xd'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x2c1ff4,_0xebef('0xd'),JSON['stringify'](_0x315807));if(_0x315807[_0xebef('0xe')]){if(_0x315807[_0xebef('0xe')][_0xebef('0xf')]===0x1f4){logger[_0xebef('0xe')](_0xebef('0xc'),_0x2c1ff4,_0x315807[_0xebef('0xe')][_0xebef('0x10')]);return _0x441a24(_0x315807[_0xebef('0xe')][_0xebef('0x10')]);}logger['error'](_0xebef('0xc'),_0x2c1ff4,_0x315807[_0xebef('0xe')][_0xebef('0x10')]);return _0x2c39f8(_0x315807[_0xebef('0xe')][_0xebef('0x10')]);}else{logger['info'](_0xebef('0xc'),_0x2c1ff4,_0xebef('0xd'));_0x2c39f8(_0x315807['result'][_0xebef('0x10')]);}})[_0xebef('0x11')](function(_0x1e7735){logger[_0xebef('0xe')](_0xebef('0xc'),_0x2c1ff4,_0x1e7735);_0x441a24(_0x1e7735);});});}exports['UpdateOpenchannelApplication']=function(_0x4590db){var _0x881844=this;return new Promise(function(_0x50bb16,_0x3d07d5){return db[_0xebef('0x12')]['update'](_0x4590db['body'],{'raw':_0x4590db['options']?_0x4590db[_0xebef('0x13')][_0xebef('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4590db[_0xebef('0x13')]?_0x4590db[_0xebef('0x13')][_0xebef('0x15')]||null:null,'attributes':_0x4590db[_0xebef('0x13')]?_0x4590db['options'][_0xebef('0x16')]||null:null,'limit':_0x4590db[_0xebef('0x13')]?_0x4590db['options'][_0xebef('0x17')]||null:null})[_0xebef('0x18')](function(_0x369907){logger['info']('UpdateOpenchannelApplication',_0x4590db);logger[_0xebef('0x19')](_0xebef('0x1a'),_0x4590db,JSON['stringify'](_0x369907));_0x50bb16(_0x369907);})['catch'](function(_0x16bef0){logger['error']('UpdateOpenchannelApplication',_0x16bef0['message'],_0x4590db);_0x3d07d5(_0x881844[_0xebef('0xe')](0x1f4,_0x16bef0[_0xebef('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 4d635a4..29d8be1 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 _0x72ae=['getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','delete','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x1d8dbd,_0x106d2e){var _0xe85ad4=function(_0x2953fb){while(--_0x2953fb){_0x1d8dbd['push'](_0x1d8dbd['shift']());}};_0xe85ad4(++_0x106d2e);}(_0x72ae,0xd9));var _0xe72a=function(_0x2c83c5,_0x498f9b){_0x2c83c5=_0x2c83c5-0x0;var _0x3b1cd3=_0x72ae[_0x2c83c5];return _0x3b1cd3;};'use strict';var multer=require(_0xe72a('0x0'));var util=require(_0xe72a('0x1'));var path=require(_0xe72a('0x2'));var timeout=require(_0xe72a('0x3'));var express=require(_0xe72a('0x4'));var router=express[_0xe72a('0x5')]();var fs_extra=require(_0xe72a('0x6'));var auth=require(_0xe72a('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe72a('0x8'));router[_0xe72a('0x9')]('/',auth[_0xe72a('0xa')](),controller['index']);router[_0xe72a('0x9')](_0xe72a('0xb'),auth[_0xe72a('0xa')](),controller[_0xe72a('0xc')]);router[_0xe72a('0x9')](_0xe72a('0xd'),auth[_0xe72a('0xa')](),controller[_0xe72a('0xe')]);router['get']('/:id/messages',auth[_0xe72a('0xa')](),controller[_0xe72a('0xf')]);router[_0xe72a('0x9')](_0xe72a('0x10'),auth[_0xe72a('0xa')](),controller[_0xe72a('0x11')]);router[_0xe72a('0x12')]('/',auth[_0xe72a('0xa')](),controller[_0xe72a('0x13')]);router['post'](_0xe72a('0x14'),auth[_0xe72a('0xa')](),controller[_0xe72a('0x15')]);router[_0xe72a('0x12')](_0xe72a('0x16'),auth[_0xe72a('0xa')](),interaction[_0xe72a('0x17')](_0xe72a('0x18'),_0xe72a('0x19')),controller[_0xe72a('0x1a')]);router['put'](_0xe72a('0xd'),auth[_0xe72a('0xa')](),interaction[_0xe72a('0x17')]('openchannel','openchannelinteraction:update'),controller['update']);router[_0xe72a('0x1b')](_0xe72a('0xd'),auth[_0xe72a('0xa')](),interaction['tracked']('openchannel','openchannelinteraction:destroy'),controller['destroy']);router[_0xe72a('0x1b')](_0xe72a('0x16'),auth[_0xe72a('0xa')](),controller[_0xe72a('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x7ce7=['/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','delete','tracked','removeTags','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','addMessage'];(function(_0x3a4b9a,_0x1fd412){var _0x42aba4=function(_0x1c854a){while(--_0x1c854a){_0x3a4b9a['push'](_0x3a4b9a['shift']());}};_0x42aba4(++_0x1fd412);}(_0x7ce7,0x175));var _0x77ce=function(_0x47a3e8,_0x3c6161){_0x47a3e8=_0x47a3e8-0x0;var _0x12c045=_0x7ce7[_0x47a3e8];return _0x12c045;};'use strict';var multer=require(_0x77ce('0x0'));var util=require(_0x77ce('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x77ce('0x2'));var router=express[_0x77ce('0x3')]();var fs_extra=require(_0x77ce('0x4'));var auth=require(_0x77ce('0x5'));var interaction=require(_0x77ce('0x6'));var config=require(_0x77ce('0x7'));var controller=require(_0x77ce('0x8'));router[_0x77ce('0x9')]('/',auth[_0x77ce('0xa')](),controller[_0x77ce('0xb')]);router[_0x77ce('0x9')](_0x77ce('0xc'),auth[_0x77ce('0xa')](),controller[_0x77ce('0xd')]);router[_0x77ce('0x9')](_0x77ce('0xe'),auth[_0x77ce('0xa')](),controller[_0x77ce('0xf')]);router['get']('/:id/messages',auth[_0x77ce('0xa')](),controller[_0x77ce('0x10')]);router['get'](_0x77ce('0x11'),auth[_0x77ce('0xa')](),controller[_0x77ce('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x77ce('0x13')]);router[_0x77ce('0x14')](_0x77ce('0x15'),auth[_0x77ce('0xa')](),controller[_0x77ce('0x16')]);router[_0x77ce('0x14')](_0x77ce('0x17'),auth[_0x77ce('0xa')](),interaction['tracked'](_0x77ce('0x18'),_0x77ce('0x19')),controller[_0x77ce('0x1a')]);router[_0x77ce('0x1b')]('/:id',auth['isAuthenticated'](),interaction['tracked']('openchannel',_0x77ce('0x1c')),controller['update']);router[_0x77ce('0x1d')]('/:id',auth[_0x77ce('0xa')](),interaction[_0x77ce('0x1e')](_0x77ce('0x18'),'openchannelinteraction:destroy'),controller['destroy']);router[_0x77ce('0x1d')](_0x77ce('0x17'),auth[_0x77ce('0xa')](),controller[_0x77ce('0x1f')]);module[_0x77ce('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 04a35d0..9b291d5 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 _0x065e=['ENUM','out','INTEGER','sequelize','STRING'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x065e,0x1a7));var _0xe065=function(_0x3dd720,_0x1b4dd8){_0x3dd720=_0x3dd720-0x0;var _0x5385fb=_0x065e[_0x3dd720];return _0x5385fb;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe065('0x1')]},'secondDisposition':{'type':Sequelize[_0xe065('0x1')]},'thirdDisposition':{'type':Sequelize[_0xe065('0x1')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xe065('0x1')]},'externalUrl':{'type':Sequelize[_0xe065('0x1')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xe065('0x2')]('in',_0xe065('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xe065('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xe065('0x1')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xe065('0x4')]}}; \ No newline at end of file +var _0x8e44=['DATE','ENUM','out','INTEGER','sequelize','exports','BOOLEAN','STRING'];(function(_0x2e147f,_0x5869f0){var _0x2d02b4=function(_0x1844ec){while(--_0x1844ec){_0x2e147f['push'](_0x2e147f['shift']());}};_0x2d02b4(++_0x5869f0);}(_0x8e44,0x1ac));var _0x48e4=function(_0x309f90,_0x25c101){_0x309f90=_0x309f90-0x0;var _0x458db7=_0x8e44[_0x309f90];return _0x458db7;};'use strict';var Sequelize=require(_0x48e4('0x0'));module[_0x48e4('0x1')]={'closed':{'type':Sequelize[_0x48e4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x48e4('0x3')]},'thirdDisposition':{'type':Sequelize[_0x48e4('0x3')]},'note':{'type':Sequelize[_0x48e4('0x3')]},'read1stAt':{'type':Sequelize[_0x48e4('0x4')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x48e4('0x3')]},'lastMsgAt':{'type':Sequelize[_0x48e4('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x48e4('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x48e4('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x48e4('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x48e4('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x48e4('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 94bd739..123dc38 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 _0xfdd4=['fields','includeAll','merge','options','create','body','find','params','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','intersection','sort','where','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','transcript-%d-%s.zip','push','User','CmContact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','OpenchannelAccount','Account','Owner','fullname','get','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','Private','map','basename','existsSync','pipe','out','System','Contact','secret','read','value','renderFile','views','downloadInteraction.ejs','transcript-','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','then','end','name','send','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','catch','show','query','from','keys','filters','model','attributes'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xfdd4,0x156));var _0x4fdd=function(_0x27fd9e,_0x4cb1ed){_0x27fd9e=_0x27fd9e-0x0;var _0xc2fe24=_0xfdd4[_0x27fd9e];return _0xc2fe24;};'use strict';var rimraf=require(_0x4fdd('0x0'));var zipdir=require(_0x4fdd('0x1'));var moment=require(_0x4fdd('0x2'));var util=require(_0x4fdd('0x3'));var path=require(_0x4fdd('0x4'));var ejs=require(_0x4fdd('0x5'));var fs=require('fs');var _=require(_0x4fdd('0x6'));var Redis=require(_0x4fdd('0x7'));var interaction=require(_0x4fdd('0x8'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x4fdd('0x9'))(_0x4fdd('0xa'));var config=require('../../config/environment');var db=require(_0x4fdd('0xb'))['db'];config['redis']=_[_0x4fdd('0xc')](config['redis'],{'host':_0x4fdd('0xd'),'port':0x18eb});var socket=require(_0x4fdd('0xe'))(new Redis(config['redis']));require(_0x4fdd('0xf'))[_0x4fdd('0x10')](socket);function respondWithStatusCode(_0x1d72c3,_0x506957){_0x506957=_0x506957||0xcc;return function(_0x3b3174){if(_0x3b3174){return _0x1d72c3[_0x4fdd('0x11')](_0x506957);}return _0x1d72c3['status'](_0x506957)['end']();};}function respondWithResult(_0x22caf5,_0x2cdec3){_0x2cdec3=_0x2cdec3||0xc8;return function(_0x1b2d20){if(_0x1b2d20){return _0x22caf5[_0x4fdd('0x12')](_0x2cdec3)[_0x4fdd('0x13')](_0x1b2d20);}};}function respondWithFilteredResult(_0x5e7426,_0x140c7e){return function(_0x22864e){if(_0x22864e){var _0x3dd032=typeof _0x140c7e['offset']===_0x4fdd('0x14')&&typeof _0x140c7e[_0x4fdd('0x15')]===_0x4fdd('0x14');var _0x4cea53=_0x22864e[_0x4fdd('0x16')];var _0x2c8382=_0x3dd032?0x0:_0x140c7e[_0x4fdd('0x17')];var _0x3ebb63=_0x3dd032?_0x22864e[_0x4fdd('0x16')]:_0x140c7e['offset']+_0x140c7e['limit'];var _0x59ce3c;if(_0x3ebb63>=_0x4cea53){_0x3ebb63=_0x4cea53;_0x59ce3c=0xc8;}else{_0x59ce3c=0xce;}_0x5e7426[_0x4fdd('0x12')](_0x59ce3c);return _0x5e7426[_0x4fdd('0x18')](_0x4fdd('0x19'),_0x2c8382+'-'+_0x3ebb63+'/'+_0x4cea53)[_0x4fdd('0x13')](_0x22864e);}return null;};}function saveUpdates(_0x59e3da){return function(_0x80a5e8){if(_0x80a5e8){return _0x80a5e8[_0x4fdd('0x1a')](_0x59e3da)['then'](function(_0x29d37d){return _0x29d37d;});}return null;};}function removeEntity(_0x2bb229){return function(_0x2b59c2){if(_0x2b59c2){return _0x2b59c2[_0x4fdd('0x1b')]()[_0x4fdd('0x1c')](function(){_0x2bb229[_0x4fdd('0x12')](0xcc)[_0x4fdd('0x1d')]();});}};}function handleEntityNotFound(_0x242dff){return function(_0xef9e24){if(!_0xef9e24){_0x242dff['sendStatus'](0x194);}return _0xef9e24;};}function handleError(_0x560144,_0xe9fb90){_0xe9fb90=_0xe9fb90||0x1f4;return function(_0x21af33){logger['error'](_0x21af33['stack']);if(_0x21af33[_0x4fdd('0x1e')]){delete _0x21af33[_0x4fdd('0x1e')];}_0x560144[_0x4fdd('0x12')](_0xe9fb90)[_0x4fdd('0x1f')](_0x21af33);};}exports[_0x4fdd('0x20')]=function(_0x4faf34,_0x1053e0){var _0x2facc0={};var _0x1b48f9=_['map'](db[_0x4fdd('0x21')][_0x4fdd('0x22')],function(_0x4b4bab){return{'name':_0x4b4bab[_0x4fdd('0x23')],'type':_0x4b4bab[_0x4fdd('0x24')][_0x4fdd('0x25')]};});_0x2facc0=qs[_0x4fdd('0x26')](_0x1b48f9,_0x4faf34);return interaction[_0x4fdd('0x27')]('openchannel',_0x4faf34['query'],_0x4faf34['user'],_0x2facc0,_0x1b48f9)['then'](respondWithFilteredResult(_0x1053e0,_0x2facc0))[_0x4fdd('0x28')](handleError(_0x1053e0,null));};exports[_0x4fdd('0x29')]=function(_0x42aecf,_0x192ca7){var _0x3a5bd8={};if(_0x42aecf['query'][_0x4fdd('0x24')]&&_0x42aecf[_0x4fdd('0x2a')]['type']===_0x4fdd('0x2b')){_0x3a5bd8[_0x4fdd('0x2b')]=_0x42aecf['params']['id'];}else{_0x3a5bd8['id']=_0x42aecf['params']['id'];}var _0x54f56a={'raw':![],'where':_0x3a5bd8},_0x3b1d56={};_0x3b1d56['model']=_[_0x4fdd('0x2c')](db['OpenchannelInteraction'][_0x4fdd('0x22')]);_0x3b1d56['query']=_['keys'](_0x42aecf[_0x4fdd('0x2a')]);_0x3b1d56[_0x4fdd('0x2d')]=_['intersection'](_0x3b1d56[_0x4fdd('0x2e')],_0x3b1d56[_0x4fdd('0x2a')]);_0x54f56a[_0x4fdd('0x2f')]=_['intersection'](_0x3b1d56['model'],qs[_0x4fdd('0x30')](_0x42aecf['query'][_0x4fdd('0x30')]));_0x54f56a[_0x4fdd('0x2f')]=_0x54f56a[_0x4fdd('0x2f')]['length']?_0x54f56a[_0x4fdd('0x2f')]:_0x3b1d56[_0x4fdd('0x2e')];if(_0x42aecf[_0x4fdd('0x2a')][_0x4fdd('0x31')]){_0x54f56a['include']=[{'all':!![]}];}_0x54f56a=_[_0x4fdd('0x32')]({},_0x54f56a,_0x42aecf[_0x4fdd('0x33')]);return db['OpenchannelInteraction']['find'](_0x54f56a)[_0x4fdd('0x1c')](handleEntityNotFound(_0x192ca7,null))[_0x4fdd('0x1c')](respondWithResult(_0x192ca7,null))[_0x4fdd('0x28')](handleError(_0x192ca7,null));};exports['create']=function(_0x19bc47,_0x5d1d78){return db[_0x4fdd('0x21')][_0x4fdd('0x34')](_0x19bc47[_0x4fdd('0x35')],{})[_0x4fdd('0x1c')](respondWithResult(_0x5d1d78,0xc9))[_0x4fdd('0x28')](handleError(_0x5d1d78,null));};exports[_0x4fdd('0x1a')]=function(_0x25d3ef,_0x5bb1c4){if(_0x25d3ef[_0x4fdd('0x35')]['id']){delete _0x25d3ef[_0x4fdd('0x35')]['id'];}return db[_0x4fdd('0x21')][_0x4fdd('0x36')]({'where':{'id':_0x25d3ef[_0x4fdd('0x37')]['id']}})[_0x4fdd('0x1c')](handleEntityNotFound(_0x5bb1c4,null))[_0x4fdd('0x1c')](saveUpdates(_0x25d3ef[_0x4fdd('0x35')],null))[_0x4fdd('0x1c')](respondWithResult(_0x5bb1c4,null))[_0x4fdd('0x28')](handleError(_0x5bb1c4,null));};exports['destroy']=function(_0x49ccda,_0x36bdd6){return db[_0x4fdd('0x21')][_0x4fdd('0x36')]({'where':{'id':_0x49ccda[_0x4fdd('0x37')]['id']}})[_0x4fdd('0x1c')](handleEntityNotFound(_0x36bdd6,null))['then'](removeEntity(_0x36bdd6,null))[_0x4fdd('0x28')](handleError(_0x36bdd6,null));};exports[_0x4fdd('0x38')]=function(_0x390d67,_0x19a79c){return db[_0x4fdd('0x21')][_0x4fdd('0x38')]()[_0x4fdd('0x1c')](respondWithResult(_0x19a79c,null))['catch'](handleError(_0x19a79c,null));};exports[_0x4fdd('0x39')]=function(_0xf8f0f9,_0x173b95){return db[_0x4fdd('0x3a')][_0x4fdd('0x36')]({'where':{'id':_0xf8f0f9[_0x4fdd('0x37')]['id']}})['then'](handleEntityNotFound(_0x173b95,null))[_0x4fdd('0x1c')](function(_0x437be2){if(_0x437be2){return _0x437be2[_0x4fdd('0x39')](_0xf8f0f9[_0x4fdd('0x35')][_0x4fdd('0x3b')],_[_0x4fdd('0x3c')](_0xf8f0f9[_0x4fdd('0x35')],[_0x4fdd('0x3b'),'id'])||{});}})[_0x4fdd('0x1c')](respondWithResult(_0x173b95,null))['catch'](handleError(_0x173b95,null));};exports[_0x4fdd('0x3d')]=function(_0x334701,_0x498355){var _0x180288={'raw':![],'where':{}};var _0x265204={};var _0x122253={'count':0x0,'rows':[]};return db[_0x4fdd('0x21')]['findOne']({'where':{'id':_0x334701[_0x4fdd('0x37')]['id']}})[_0x4fdd('0x1c')](handleEntityNotFound(_0x498355,null))[_0x4fdd('0x1c')](function(_0x1cf520){if(_0x1cf520){_0x265204[_0x4fdd('0x2e')]=_['keys'](db[_0x4fdd('0x3a')][_0x4fdd('0x22')]);_0x265204[_0x4fdd('0x2a')]=_[_0x4fdd('0x2c')](_0x334701[_0x4fdd('0x2a')]);_0x265204['filters']=_[_0x4fdd('0x3e')](_0x265204[_0x4fdd('0x2e')],_0x265204[_0x4fdd('0x2a')]);_0x180288['attributes']=_[_0x4fdd('0x3e')](_0x265204[_0x4fdd('0x2e')],qs[_0x4fdd('0x30')](_0x334701[_0x4fdd('0x2a')][_0x4fdd('0x30')]));_0x180288[_0x4fdd('0x2f')]=_0x180288[_0x4fdd('0x2f')]['length']?_0x180288[_0x4fdd('0x2f')]:_0x265204[_0x4fdd('0x2e')];if(!_0x334701[_0x4fdd('0x2a')]['hasOwnProperty']('nolimit')){_0x180288[_0x4fdd('0x15')]=qs['limit'](_0x334701['query']['limit']);_0x180288[_0x4fdd('0x17')]=qs[_0x4fdd('0x17')](_0x334701[_0x4fdd('0x2a')][_0x4fdd('0x17')]);}_0x180288['order']=qs[_0x4fdd('0x3f')](_0x334701[_0x4fdd('0x2a')][_0x4fdd('0x3f')]);_0x180288[_0x4fdd('0x40')]=qs['filters'](_['pick'](_0x334701['query'],_0x265204[_0x4fdd('0x2d')]));_0x180288[_0x4fdd('0x40')][_0x4fdd('0x41')]=_0x1cf520['id'];if(_0x334701[_0x4fdd('0x2a')]['filter']){_0x180288[_0x4fdd('0x40')]=_['merge'](_0x180288[_0x4fdd('0x40')],{'$or':_['map'](_0x180288['attributes'],function(_0x1ca741){var _0x104640={};_0x104640[_0x1ca741]={'$like':'%'+_0x334701[_0x4fdd('0x2a')][_0x4fdd('0x42')]+'%'};return _0x104640;})});}if(_0x334701['query'][_0x4fdd('0x43')]){var _0xc4a92a=_0x334701[_0x4fdd('0x2a')][_0x4fdd('0x43')][_0x4fdd('0x44')](',');var _0x15d758={};_0x15d758[_0xc4a92a[0x0]]={'$gte':moment(_0xc4a92a[0x1])[_0x4fdd('0x45')](_0x4fdd('0x46'))};_0x180288[_0x4fdd('0x40')]=_[_0x4fdd('0x32')](_0x180288['where'],_0x15d758);}_0x180288=_[_0x4fdd('0x32')]({},_0x180288,_0x334701[_0x4fdd('0x33')]);return db[_0x4fdd('0x3a')][_0x4fdd('0x16')]({'where':_0x180288[_0x4fdd('0x40')]})[_0x4fdd('0x1c')](function(_0x21ae29){_0x122253['count']=_0x21ae29;if(_0x334701[_0x4fdd('0x2a')][_0x4fdd('0x31')]){_0x180288[_0x4fdd('0x47')]=[{'all':!![]}];}return db[_0x4fdd('0x3a')][_0x4fdd('0x27')](_0x180288);})[_0x4fdd('0x1c')](function(_0x191caa){_0x122253[_0x4fdd('0x48')]=_0x191caa;return _0x122253;});}})[_0x4fdd('0x1c')](respondWithFilteredResult(_0x498355,_0x180288))['catch'](handleError(_0x498355,null));};exports[_0x4fdd('0x49')]=function(_0x412669,_0x1de338){return db[_0x4fdd('0x21')][_0x4fdd('0x36')]({'where':{'id':_0x412669['params']['id']}})['then'](handleEntityNotFound(_0x1de338,null))[_0x4fdd('0x1c')](function(_0x24329e){if(_0x24329e){return _0x24329e[_0x4fdd('0x4a')](_0x412669['body'][_0x4fdd('0x3b')],_[_0x4fdd('0x3c')](_0x412669[_0x4fdd('0x35')],[_0x4fdd('0x3b'),'id'])||{})[_0x4fdd('0x4b')](function(){return db[_0x4fdd('0x4c')][_0x4fdd('0x27')]({'attributes':['id',_0x4fdd('0x1e'),_0x4fdd('0x4d')],'where':{'id':_0x412669[_0x4fdd('0x35')][_0x4fdd('0x3b')]}});})['then'](function(_0x303835){socket[_0x4fdd('0x4e')](_0x4fdd('0x4f'),{'id':Number(_0x412669[_0x4fdd('0x37')]['id']),'tags':_0x303835||[]});return{'id':Number(_0x412669[_0x4fdd('0x37')]['id']),'tags':_0x303835||[]};});}})[_0x4fdd('0x1c')](respondWithResult(_0x1de338,null))[_0x4fdd('0x28')](handleError(_0x1de338,null));};exports[_0x4fdd('0x50')]=function(_0x2383a7,_0x2d50c3){return db[_0x4fdd('0x21')][_0x4fdd('0x36')]({'where':{'id':_0x2383a7['params']['id']}})[_0x4fdd('0x1c')](handleEntityNotFound(_0x2d50c3,null))[_0x4fdd('0x1c')](function(_0x1eebfa){if(_0x1eebfa){return _0x1eebfa[_0x4fdd('0x50')](_0x2383a7[_0x4fdd('0x2a')][_0x4fdd('0x3b')]);}})[_0x4fdd('0x1c')](respondWithStatusCode(_0x2d50c3,null))[_0x4fdd('0x28')](handleError(_0x2d50c3,null));};exports[_0x4fdd('0x51')]=function(_0x2dfe1d,_0x329071){var _0x32d09b=moment()[_0x4fdd('0x52')]()[_0x4fdd('0x53')]();var _0x578d52=path[_0x4fdd('0x54')](config[_0x4fdd('0x55')],_0x4fdd('0x56'),_0x4fdd('0x57'),'tmp');var _0x56a9b8=path[_0x4fdd('0x54')](config[_0x4fdd('0x55')],'server',_0x4fdd('0x57'),'attachments');var _0x52c3d9=path['join'](_0x578d52,_0x32d09b);var _0x440d5a=util[_0x4fdd('0x45')](_0x4fdd('0x58'),_0x2dfe1d[_0x4fdd('0x37')]['id'],_0x32d09b);var _0x595bb2=path[_0x4fdd('0x54')](_0x578d52,_0x440d5a);var _0x11c99e=[];_0x11c99e[_0x4fdd('0x59')]({'model':db[_0x4fdd('0x5a')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x11c99e[_0x4fdd('0x59')]({'model':db[_0x4fdd('0x5b')],'as':'Contact','attributes':['id',_0x4fdd('0x5c'),_0x4fdd('0x5d')],'raw':!![]});if(_0x2dfe1d['query'][_0x4fdd('0x5e')]){_0x11c99e['push']({'model':db[_0x4fdd('0x5f')],'as':'Attachment','raw':!![]});}var _0x52694b=[{'model':db[_0x4fdd('0x3a')],'as':_0x4fdd('0x60'),'attributes':['id','body',_0x4fdd('0x61'),_0x4fdd('0x62'),'secret','read'],'include':_0x11c99e}];_0x52694b[_0x4fdd('0x59')]({'model':db[_0x4fdd('0x63')],'as':_0x4fdd('0x64'),'attributes':['id','name']});_0x52694b[_0x4fdd('0x59')]({'model':db[_0x4fdd('0x5a')],'as':_0x4fdd('0x65'),'attributes':['id',_0x4fdd('0x66')]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x2dfe1d['params']['id']},'include':_0x52694b})[_0x4fdd('0x1c')](handleEntityNotFound(_0x329071,null))['then'](function(_0x41b4a1){if(_0x41b4a1){var _0x556f29=_0x41b4a1[_0x4fdd('0x67')]({'plain':!![]});fs[_0x4fdd('0x68')](_0x52c3d9);var _0x151c7e={'channel':_0x4fdd('0x69'),'account':_0x556f29[_0x4fdd('0x64')]['name'],'agent':_0x556f29[_0x4fdd('0x65')]?_0x556f29[_0x4fdd('0x65')]['fullname']:_0x4fdd('0x6a'),'createdAt':moment(_0x556f29[_0x4fdd('0x61')])[_0x4fdd('0x45')](_0x4fdd('0x46'))[_0x4fdd('0x53')](),'closedAt':_0x556f29[_0x4fdd('0x6b')]?moment(_0x556f29[_0x4fdd('0x6c')])[_0x4fdd('0x45')](_0x4fdd('0x46'))['toString']():'','disposition':_0x556f29[_0x4fdd('0x6d')],'visibility':_0x556f29[_0x4fdd('0x6e')]?_0x4fdd('0x6f'):_0x4fdd('0x70'),'messages':_(_0x556f29[_0x4fdd('0x60')])[_0x4fdd('0x42')]({'secret':![]})[_0x4fdd('0x71')](function(_0x84382e){if(_0x84382e[_0x4fdd('0x5f')]){var _0x2bc64f=path['join'](_0x56a9b8,_0x84382e['Attachment'][_0x4fdd('0x72')]);if(fs[_0x4fdd('0x73')](_0x2bc64f)){fs['createReadStream'](_0x2bc64f)[_0x4fdd('0x74')](fs['createWriteStream'](path[_0x4fdd('0x54')](_0x52c3d9,_0x84382e[_0x4fdd('0x5f')]['basename'])));}}return{'date':moment(_0x84382e['createdAt'])['format'](_0x4fdd('0x46'))[_0x4fdd('0x53')](),'sender':_0x84382e[_0x4fdd('0x62')]===_0x4fdd('0x75')?_0x84382e['User']?_0x84382e[_0x4fdd('0x5a')]['fullname']:_0x4fdd('0x76'):_0x84382e['Contact'][_0x4fdd('0x5c')]+(_0x84382e[_0x4fdd('0x77')][_0x4fdd('0x5d')]?'\x20'+_0x84382e[_0x4fdd('0x77')][_0x4fdd('0x5d')]:''),'body':_0x84382e[_0x4fdd('0x5f')]?_0x84382e[_0x4fdd('0x5f')]['basename']:_0x84382e['body'],'direction':_0x84382e[_0x4fdd('0x62')]===_0x4fdd('0x75')?'A':'C','secret':_0x84382e[_0x4fdd('0x78')],'read':_0x84382e[_0x4fdd('0x79')],'attachment':_0x84382e[_0x4fdd('0x5f')]};})[_0x4fdd('0x7a')]()};return ejs[_0x4fdd('0x7b')](path[_0x4fdd('0x54')](config[_0x4fdd('0x55')],_0x4fdd('0x56'),_0x4fdd('0x7c'),_0x4fdd('0x7d')),{'interaction':_0x151c7e})[_0x4fdd('0x1c')](function(_0x15ba30){var _0x19c792=path[_0x4fdd('0x54')](_0x52c3d9,_0x4fdd('0x7e')+_0x556f29['id']+'-'+_0x32d09b+'.pdf');var _0x507921={'path':_0x19c792,'channel':_0x4fdd('0x69'),'interactionId':_0x556f29['id']};return pdf['createPdfFromHTML'](_0x15ba30,_0x507921);})[_0x4fdd('0x1c')](function(){return new Promise(function(_0x276ec1,_0x59148a){zipdir(_0x52c3d9,{'saveTo':_0x595bb2},function(_0x20ac62,_0x1b44c5){if(_0x20ac62)return _0x59148a(_0x20ac62);return _0x276ec1(_0x1b44c5);});})[_0x4fdd('0x1c')](function(){return new Promise(function(_0x46610e,_0x47fbcd){rimraf(_0x52c3d9,function(_0x499831){if(_0x499831)_0x47fbcd(_0x499831);return _0x46610e();});});})['then'](function(){return _0x329071['download'](_0x595bb2,_0x440d5a,function(_0x310df0){if(_0x310df0){logger[_0x4fdd('0x7f')](_0x4fdd('0x80'),_0x310df0);}else{fs[_0x4fdd('0x81')](_0x595bb2);}});});});}else{return _0x329071[_0x4fdd('0x11')](0xc8);}})['catch'](handleError(_0x329071,null));}; \ No newline at end of file +var _0xbe8c=['count','offset','limit','set','Content-Range','update','then','destroy','error','stack','name','map','OpenchannelInteraction','type','key','findAll','openchannel','query','user','catch','from','params','keys','rawAttributes','filters','attributes','intersection','model','fields','length','includeAll','include','merge','options','body','find','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','tmp','join','files','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','direction','secret','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','N.A.','toString','closed','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','createWriteStream','createdAt','out','System','read','value','views','downloadInteraction.ejs','transcript-','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','moment','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined'];(function(_0x5526cd,_0x3810bc){var _0x15324a=function(_0x100b4d){while(--_0x100b4d){_0x5526cd['push'](_0x5526cd['shift']());}};_0x15324a(++_0x3810bc);}(_0xbe8c,0x16a));var _0xcbe8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xbe8c[_0x3ab51d];return _0x29a04e;};'use strict';var rimraf=require(_0xcbe8('0x0'));var zipdir=require('zip-dir');var moment=require(_0xcbe8('0x1'));var util=require(_0xcbe8('0x2'));var path=require(_0xcbe8('0x3'));var ejs=require(_0xcbe8('0x4'));var fs=require('fs');var _=require(_0xcbe8('0x5'));var Redis=require(_0xcbe8('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xcbe8('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0xcbe8('0x8'))(_0xcbe8('0x9'));var config=require(_0xcbe8('0xa'));var db=require(_0xcbe8('0xb'))['db'];config[_0xcbe8('0xc')]=_[_0xcbe8('0xd')](config[_0xcbe8('0xc')],{'host':_0xcbe8('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcbe8('0xc')]));require(_0xcbe8('0xf'))[_0xcbe8('0x10')](socket);function respondWithStatusCode(_0x3b61bd,_0x12343c){_0x12343c=_0x12343c||0xcc;return function(_0x171802){if(_0x171802){return _0x3b61bd[_0xcbe8('0x11')](_0x12343c);}return _0x3b61bd[_0xcbe8('0x12')](_0x12343c)[_0xcbe8('0x13')]();};}function respondWithResult(_0x488a33,_0x4d8d25){_0x4d8d25=_0x4d8d25||0xc8;return function(_0xe18567){if(_0xe18567){return _0x488a33[_0xcbe8('0x12')](_0x4d8d25)[_0xcbe8('0x14')](_0xe18567);}};}function respondWithFilteredResult(_0x29498b,_0x219d72){return function(_0x4250f5){if(_0x4250f5){var _0x909b9=typeof _0x219d72['offset']===_0xcbe8('0x15')&&typeof _0x219d72['limit']===_0xcbe8('0x15');var _0x28aa58=_0x4250f5[_0xcbe8('0x16')];var _0x381708=_0x909b9?0x0:_0x219d72[_0xcbe8('0x17')];var _0x2749cd=_0x909b9?_0x4250f5[_0xcbe8('0x16')]:_0x219d72[_0xcbe8('0x17')]+_0x219d72[_0xcbe8('0x18')];var _0x4461aa;if(_0x2749cd>=_0x28aa58){_0x2749cd=_0x28aa58;_0x4461aa=0xc8;}else{_0x4461aa=0xce;}_0x29498b[_0xcbe8('0x12')](_0x4461aa);return _0x29498b[_0xcbe8('0x19')](_0xcbe8('0x1a'),_0x381708+'-'+_0x2749cd+'/'+_0x28aa58)['json'](_0x4250f5);}return null;};}function saveUpdates(_0x18c520){return function(_0x1c997d){if(_0x1c997d){return _0x1c997d[_0xcbe8('0x1b')](_0x18c520)[_0xcbe8('0x1c')](function(_0x3e27af){return _0x3e27af;});}return null;};}function removeEntity(_0x49835d){return function(_0x1357ab){if(_0x1357ab){return _0x1357ab[_0xcbe8('0x1d')]()[_0xcbe8('0x1c')](function(){_0x49835d[_0xcbe8('0x12')](0xcc)[_0xcbe8('0x13')]();});}};}function handleEntityNotFound(_0x4263a2){return function(_0xb187f2){if(!_0xb187f2){_0x4263a2[_0xcbe8('0x11')](0x194);}return _0xb187f2;};}function handleError(_0x2e4694,_0x391e69){_0x391e69=_0x391e69||0x1f4;return function(_0x42e654){logger[_0xcbe8('0x1e')](_0x42e654[_0xcbe8('0x1f')]);if(_0x42e654['name']){delete _0x42e654[_0xcbe8('0x20')];}_0x2e4694[_0xcbe8('0x12')](_0x391e69)['send'](_0x42e654);};}exports['index']=function(_0x348a49,_0x481f18){var _0x1dd7dc={};var _0x39c929=_[_0xcbe8('0x21')](db[_0xcbe8('0x22')]['rawAttributes'],function(_0x3fd71f){return{'name':_0x3fd71f['fieldName'],'type':_0x3fd71f[_0xcbe8('0x23')][_0xcbe8('0x24')]};});_0x1dd7dc=qs['getOptions'](_0x39c929,_0x348a49);return interaction[_0xcbe8('0x25')](_0xcbe8('0x26'),_0x348a49[_0xcbe8('0x27')],_0x348a49[_0xcbe8('0x28')],_0x1dd7dc,_0x39c929)[_0xcbe8('0x1c')](respondWithFilteredResult(_0x481f18,_0x1dd7dc))[_0xcbe8('0x29')](handleError(_0x481f18,null));};exports['show']=function(_0x500a35,_0x10c279){var _0x2e3066={};if(_0x500a35[_0xcbe8('0x27')][_0xcbe8('0x23')]&&_0x500a35[_0xcbe8('0x27')]['type']===_0xcbe8('0x2a')){_0x2e3066['from']=_0x500a35[_0xcbe8('0x2b')]['id'];}else{_0x2e3066['id']=_0x500a35[_0xcbe8('0x2b')]['id'];}var _0x146d43={'raw':![],'where':_0x2e3066},_0x1700c4={};_0x1700c4['model']=_[_0xcbe8('0x2c')](db[_0xcbe8('0x22')][_0xcbe8('0x2d')]);_0x1700c4['query']=_['keys'](_0x500a35[_0xcbe8('0x27')]);_0x1700c4[_0xcbe8('0x2e')]=_['intersection'](_0x1700c4['model'],_0x1700c4[_0xcbe8('0x27')]);_0x146d43[_0xcbe8('0x2f')]=_[_0xcbe8('0x30')](_0x1700c4[_0xcbe8('0x31')],qs[_0xcbe8('0x32')](_0x500a35[_0xcbe8('0x27')][_0xcbe8('0x32')]));_0x146d43[_0xcbe8('0x2f')]=_0x146d43[_0xcbe8('0x2f')][_0xcbe8('0x33')]?_0x146d43['attributes']:_0x1700c4[_0xcbe8('0x31')];if(_0x500a35[_0xcbe8('0x27')][_0xcbe8('0x34')]){_0x146d43[_0xcbe8('0x35')]=[{'all':!![]}];}_0x146d43=_[_0xcbe8('0x36')]({},_0x146d43,_0x500a35[_0xcbe8('0x37')]);return db[_0xcbe8('0x22')]['find'](_0x146d43)[_0xcbe8('0x1c')](handleEntityNotFound(_0x10c279,null))[_0xcbe8('0x1c')](respondWithResult(_0x10c279,null))['catch'](handleError(_0x10c279,null));};exports['create']=function(_0x12536d,_0x28f7c3){return db['OpenchannelInteraction']['create'](_0x12536d['body'],{})[_0xcbe8('0x1c')](respondWithResult(_0x28f7c3,0xc9))[_0xcbe8('0x29')](handleError(_0x28f7c3,null));};exports[_0xcbe8('0x1b')]=function(_0x34b593,_0x42b96c){if(_0x34b593['body']['id']){delete _0x34b593[_0xcbe8('0x38')]['id'];}return db[_0xcbe8('0x22')][_0xcbe8('0x39')]({'where':{'id':_0x34b593[_0xcbe8('0x2b')]['id']}})[_0xcbe8('0x1c')](handleEntityNotFound(_0x42b96c,null))[_0xcbe8('0x1c')](saveUpdates(_0x34b593['body'],null))['then'](respondWithResult(_0x42b96c,null))[_0xcbe8('0x29')](handleError(_0x42b96c,null));};exports['destroy']=function(_0x2326f1,_0x519b19){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2326f1['params']['id']}})[_0xcbe8('0x1c')](handleEntityNotFound(_0x519b19,null))[_0xcbe8('0x1c')](removeEntity(_0x519b19,null))['catch'](handleError(_0x519b19,null));};exports[_0xcbe8('0x3a')]=function(_0x5eda14,_0x19a796){return db[_0xcbe8('0x22')]['describe']()[_0xcbe8('0x1c')](respondWithResult(_0x19a796,null))['catch'](handleError(_0x19a796,null));};exports[_0xcbe8('0x3b')]=function(_0x216f28,_0x2f13cb){return db[_0xcbe8('0x3c')][_0xcbe8('0x39')]({'where':{'id':_0x216f28['params']['id']}})['then'](handleEntityNotFound(_0x2f13cb,null))[_0xcbe8('0x1c')](function(_0x4c9408){if(_0x4c9408){return _0x4c9408[_0xcbe8('0x3b')](_0x216f28[_0xcbe8('0x38')][_0xcbe8('0x3d')],_[_0xcbe8('0x3e')](_0x216f28['body'],[_0xcbe8('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x2f13cb,null))[_0xcbe8('0x29')](handleError(_0x2f13cb,null));};exports[_0xcbe8('0x3f')]=function(_0x47be35,_0x14632c){var _0x14631a={'raw':![],'where':{}};var _0xbeb120={};var _0x27652d={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x47be35[_0xcbe8('0x2b')]['id']}})[_0xcbe8('0x1c')](handleEntityNotFound(_0x14632c,null))[_0xcbe8('0x1c')](function(_0x30efc2){if(_0x30efc2){_0xbeb120[_0xcbe8('0x31')]=_['keys'](db[_0xcbe8('0x3c')]['rawAttributes']);_0xbeb120['query']=_['keys'](_0x47be35[_0xcbe8('0x27')]);_0xbeb120[_0xcbe8('0x2e')]=_['intersection'](_0xbeb120['model'],_0xbeb120[_0xcbe8('0x27')]);_0x14631a[_0xcbe8('0x2f')]=_[_0xcbe8('0x30')](_0xbeb120[_0xcbe8('0x31')],qs[_0xcbe8('0x32')](_0x47be35[_0xcbe8('0x27')][_0xcbe8('0x32')]));_0x14631a[_0xcbe8('0x2f')]=_0x14631a['attributes']['length']?_0x14631a[_0xcbe8('0x2f')]:_0xbeb120[_0xcbe8('0x31')];if(!_0x47be35['query'][_0xcbe8('0x40')](_0xcbe8('0x41'))){_0x14631a[_0xcbe8('0x18')]=qs['limit'](_0x47be35[_0xcbe8('0x27')][_0xcbe8('0x18')]);_0x14631a[_0xcbe8('0x17')]=qs['offset'](_0x47be35[_0xcbe8('0x27')][_0xcbe8('0x17')]);}_0x14631a[_0xcbe8('0x42')]=qs[_0xcbe8('0x43')](_0x47be35[_0xcbe8('0x27')][_0xcbe8('0x43')]);_0x14631a['where']=qs['filters'](_[_0xcbe8('0x44')](_0x47be35[_0xcbe8('0x27')],_0xbeb120[_0xcbe8('0x2e')]));_0x14631a[_0xcbe8('0x45')]['OpenchannelInteractionId']=_0x30efc2['id'];if(_0x47be35[_0xcbe8('0x27')][_0xcbe8('0x46')]){_0x14631a[_0xcbe8('0x45')]=_[_0xcbe8('0x36')](_0x14631a[_0xcbe8('0x45')],{'$or':_[_0xcbe8('0x21')](_0x14631a['attributes'],function(_0x4d77a7){var _0x195e3f={};_0x195e3f[_0x4d77a7]={'$like':'%'+_0x47be35[_0xcbe8('0x27')][_0xcbe8('0x46')]+'%'};return _0x195e3f;})});}if(_0x47be35[_0xcbe8('0x27')][_0xcbe8('0x47')]){var _0x363774=_0x47be35[_0xcbe8('0x27')]['$gte'][_0xcbe8('0x48')](',');var _0x20dbc4={};_0x20dbc4[_0x363774[0x0]]={'$gte':moment(_0x363774[0x1])[_0xcbe8('0x49')](_0xcbe8('0x4a'))};_0x14631a[_0xcbe8('0x45')]=_[_0xcbe8('0x36')](_0x14631a[_0xcbe8('0x45')],_0x20dbc4);}_0x14631a=_[_0xcbe8('0x36')]({},_0x14631a,_0x47be35[_0xcbe8('0x37')]);return db['OpenchannelMessage'][_0xcbe8('0x16')]({'where':_0x14631a[_0xcbe8('0x45')]})[_0xcbe8('0x1c')](function(_0x2ab26c){_0x27652d[_0xcbe8('0x16')]=_0x2ab26c;if(_0x47be35['query'][_0xcbe8('0x34')]){_0x14631a[_0xcbe8('0x35')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xcbe8('0x25')](_0x14631a);})[_0xcbe8('0x1c')](function(_0x134c4a){_0x27652d[_0xcbe8('0x4b')]=_0x134c4a;return _0x27652d;});}})[_0xcbe8('0x1c')](respondWithFilteredResult(_0x14632c,_0x14631a))[_0xcbe8('0x29')](handleError(_0x14632c,null));};exports['addTags']=function(_0x19c44f,_0x4b3c02){return db[_0xcbe8('0x22')][_0xcbe8('0x39')]({'where':{'id':_0x19c44f[_0xcbe8('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4b3c02,null))['then'](function(_0x2a8e4a){if(_0x2a8e4a){return _0x2a8e4a[_0xcbe8('0x4c')](_0x19c44f['body']['ids'],_['omit'](_0x19c44f['body'],['ids','id'])||{})[_0xcbe8('0x4d')](function(){return db[_0xcbe8('0x4e')][_0xcbe8('0x25')]({'attributes':['id','name',_0xcbe8('0x4f')],'where':{'id':_0x19c44f['body']['ids']}});})[_0xcbe8('0x1c')](function(_0x5136b8){socket[_0xcbe8('0x50')](_0xcbe8('0x51'),{'id':Number(_0x19c44f[_0xcbe8('0x2b')]['id']),'tags':_0x5136b8||[]});return{'id':Number(_0x19c44f[_0xcbe8('0x2b')]['id']),'tags':_0x5136b8||[]};});}})['then'](respondWithResult(_0x4b3c02,null))[_0xcbe8('0x29')](handleError(_0x4b3c02,null));};exports[_0xcbe8('0x52')]=function(_0x1077cb,_0x25ffb8){return db[_0xcbe8('0x22')][_0xcbe8('0x39')]({'where':{'id':_0x1077cb[_0xcbe8('0x2b')]['id']}})[_0xcbe8('0x1c')](handleEntityNotFound(_0x25ffb8,null))[_0xcbe8('0x1c')](function(_0x5eb810){if(_0x5eb810){return _0x5eb810[_0xcbe8('0x52')](_0x1077cb[_0xcbe8('0x27')]['ids']);}})[_0xcbe8('0x1c')](respondWithStatusCode(_0x25ffb8,null))[_0xcbe8('0x29')](handleError(_0x25ffb8,null));};exports[_0xcbe8('0x53')]=function(_0x28d6c6,_0xc1a85b){var _0x5e7820=moment()[_0xcbe8('0x54')]()['toString']();var _0x5c73c3=path['join'](config[_0xcbe8('0x55')],_0xcbe8('0x56'),'files',_0xcbe8('0x57'));var _0x191e98=path[_0xcbe8('0x58')](config[_0xcbe8('0x55')],_0xcbe8('0x56'),_0xcbe8('0x59'),'attachments');var _0x32122b=path[_0xcbe8('0x58')](_0x5c73c3,_0x5e7820);var _0x43a243=util[_0xcbe8('0x49')](_0xcbe8('0x5a'),_0x28d6c6[_0xcbe8('0x2b')]['id'],_0x5e7820);var _0x1f66a7=path[_0xcbe8('0x58')](_0x5c73c3,_0x43a243);var _0x39c29f=[];_0x39c29f[_0xcbe8('0x5b')]({'model':db[_0xcbe8('0x5c')],'as':_0xcbe8('0x5c'),'attributes':['id',_0xcbe8('0x5d')],'raw':!![]});_0x39c29f['push']({'model':db[_0xcbe8('0x5e')],'as':_0xcbe8('0x5f'),'attributes':['id',_0xcbe8('0x60'),_0xcbe8('0x61')],'raw':!![]});if(_0x28d6c6['query']['attachments']){_0x39c29f[_0xcbe8('0x5b')]({'model':db[_0xcbe8('0x62')],'as':_0xcbe8('0x62'),'raw':!![]});}var _0x20b28a=[{'model':db[_0xcbe8('0x3c')],'as':'Messages','attributes':['id',_0xcbe8('0x38'),'createdAt',_0xcbe8('0x63'),_0xcbe8('0x64'),'read'],'include':_0x39c29f}];_0x20b28a[_0xcbe8('0x5b')]({'model':db[_0xcbe8('0x65')],'as':_0xcbe8('0x66'),'attributes':['id',_0xcbe8('0x20')]});_0x20b28a[_0xcbe8('0x5b')]({'model':db[_0xcbe8('0x5c')],'as':_0xcbe8('0x67'),'attributes':['id',_0xcbe8('0x5d')]});return db[_0xcbe8('0x22')][_0xcbe8('0x39')]({'where':{'id':_0x28d6c6[_0xcbe8('0x2b')]['id']},'include':_0x20b28a})[_0xcbe8('0x1c')](handleEntityNotFound(_0xc1a85b,null))['then'](function(_0x18684d){if(_0x18684d){var _0x2d728f=_0x18684d['get']({'plain':!![]});fs[_0xcbe8('0x68')](_0x32122b);var _0x5edbce={'channel':_0xcbe8('0x69'),'account':_0x2d728f[_0xcbe8('0x66')][_0xcbe8('0x20')],'agent':_0x2d728f[_0xcbe8('0x67')]?_0x2d728f[_0xcbe8('0x67')][_0xcbe8('0x5d')]:_0xcbe8('0x6a'),'createdAt':moment(_0x2d728f['createdAt'])[_0xcbe8('0x49')](_0xcbe8('0x4a'))[_0xcbe8('0x6b')](),'closedAt':_0x2d728f[_0xcbe8('0x6c')]?moment(_0x2d728f[_0xcbe8('0x6d')])[_0xcbe8('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0xcbe8('0x6b')]():'','disposition':_0x2d728f[_0xcbe8('0x6e')],'visibility':_0x2d728f[_0xcbe8('0x6f')]?'Public':_0xcbe8('0x70'),'messages':_(_0x2d728f['Messages'])['filter']({'secret':![]})[_0xcbe8('0x21')](function(_0x2737f3){if(_0x2737f3['Attachment']){var _0x1a4572=path[_0xcbe8('0x58')](_0x191e98,_0x2737f3[_0xcbe8('0x62')][_0xcbe8('0x71')]);if(fs[_0xcbe8('0x72')](_0x1a4572)){fs[_0xcbe8('0x73')](_0x1a4572)[_0xcbe8('0x74')](fs[_0xcbe8('0x75')](path[_0xcbe8('0x58')](_0x32122b,_0x2737f3[_0xcbe8('0x62')][_0xcbe8('0x71')])));}}return{'date':moment(_0x2737f3[_0xcbe8('0x76')])[_0xcbe8('0x49')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2737f3[_0xcbe8('0x63')]===_0xcbe8('0x77')?_0x2737f3[_0xcbe8('0x5c')]?_0x2737f3[_0xcbe8('0x5c')][_0xcbe8('0x5d')]:_0xcbe8('0x78'):_0x2737f3[_0xcbe8('0x5f')][_0xcbe8('0x60')]+(_0x2737f3['Contact']['lastName']?'\x20'+_0x2737f3[_0xcbe8('0x5f')][_0xcbe8('0x61')]:''),'body':_0x2737f3['Attachment']?_0x2737f3['Attachment']['basename']:_0x2737f3['body'],'direction':_0x2737f3[_0xcbe8('0x63')]===_0xcbe8('0x77')?'A':'C','secret':_0x2737f3['secret'],'read':_0x2737f3[_0xcbe8('0x79')],'attachment':_0x2737f3[_0xcbe8('0x62')]};})[_0xcbe8('0x7a')]()};return ejs['renderFile'](path[_0xcbe8('0x58')](config[_0xcbe8('0x55')],_0xcbe8('0x56'),_0xcbe8('0x7b'),_0xcbe8('0x7c')),{'interaction':_0x5edbce})[_0xcbe8('0x1c')](function(_0x261193){var _0x4e9348=path[_0xcbe8('0x58')](_0x32122b,_0xcbe8('0x7d')+_0x2d728f['id']+'-'+_0x5e7820+'.pdf');var _0x13802f={'path':_0x4e9348,'channel':'Openchannel','interactionId':_0x2d728f['id']};return pdf['createPdfFromHTML'](_0x261193,_0x13802f);})[_0xcbe8('0x1c')](function(){return new Promise(function(_0x5ce48c,_0x3f1080){zipdir(_0x32122b,{'saveTo':_0x1f66a7},function(_0x128bdd,_0x392027){if(_0x128bdd)return _0x3f1080(_0x128bdd);return _0x5ce48c(_0x392027);});})[_0xcbe8('0x1c')](function(){return new Promise(function(_0x44d943,_0x35eebb){rimraf(_0x32122b,function(_0x789405){if(_0x789405)_0x35eebb(_0x789405);return _0x44d943();});});})[_0xcbe8('0x1c')](function(){return _0xc1a85b[_0xcbe8('0x53')](_0x1f66a7,_0x43a243,function(_0x47ce08){if(_0x47ce08){logger['error'](_0xcbe8('0x7e'),_0x47ce08);}else{fs[_0xcbe8('0x7f')](_0x1f66a7);}});});});}else{return _0xc1a85b[_0xcbe8('0x11')](0xc8);}})[_0xcbe8('0x29')](handleError(_0xc1a85b,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 742af84..1522529 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 _0x5b19=['then','unreadMessages','length','emit','catch','hook','../../mysqldb','OpenchannelMessage','save','update','getUsers','setDataValue','Users','map','findAll'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x5b19,0xba));var _0x95b1=function(_0x2351b7,_0x56b743){_0x2351b7=_0x2351b7-0x0;var _0x1b2e84=_0x5b19[_0x2351b7];return _0x1b2e84;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x95b1('0x0'))['db'][_0x95b1('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x95b1('0x2'),'afterUpdate':_0x95b1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3eee82){return function(_0x23fb24,_0xf5192,_0x1e7fa9){_0x23fb24[_0x95b1('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x344543){_0x23fb24[_0x95b1('0x5')](_0x95b1('0x6'),_0x344543[_0x95b1('0x7')](function(_0x590cac){return{'id':_0x590cac['id']};}));return OpenchannelMessage[_0x95b1('0x8')]({'where':{'OpenchannelInteractionId':_0x23fb24['id'],'direction':'in','read':![]},'raw':!![]});})[_0x95b1('0x9')](function(_0x26356f){_0x23fb24[_0x95b1('0x5')](_0x95b1('0xa'),_0x26356f[_0x95b1('0xb')]);OpenchannelInteractionEvents['emit'](_0x3eee82+':'+_0x23fb24['id'],_0x23fb24);OpenchannelInteractionEvents[_0x95b1('0xc')](_0x3eee82,_0x23fb24);_0x1e7fa9(null);})[_0x95b1('0xd')](_0x1e7fa9(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x95b1('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xe481=['OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb'];(function(_0x45f870,_0xf9f9fc){var _0x303cf0=function(_0x5e86d6){while(--_0x5e86d6){_0x45f870['push'](_0x45f870['shift']());}};_0x303cf0(++_0xf9f9fc);}(_0xe481,0x7c));var _0x1e48=function(_0x2042ee,_0x1a1e0a){_0x2042ee=_0x2042ee-0x0;var _0xe57ee7=_0xe481[_0x2042ee];return _0xe57ee7;};'use strict';var EventEmitter=require(_0x1e48('0x0'));var OpenchannelInteraction=require(_0x1e48('0x1'))['db'][_0x1e48('0x2')];var OpenchannelMessage=require(_0x1e48('0x1'))['db'][_0x1e48('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x1e48('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1e48('0x5'),'afterDestroy':_0x1e48('0x6')};function emitEvent(_0x2d4a2a){return function(_0x592672,_0x3e5a75,_0x2aad3c){_0x592672['getUsers']({'attributes':['id'],'raw':!![]})[_0x1e48('0x7')](function(_0x53618c){_0x592672['setDataValue'](_0x1e48('0x8'),_0x53618c[_0x1e48('0x9')](function(_0x53fb2f){return{'id':_0x53fb2f['id']};}));return OpenchannelMessage[_0x1e48('0xa')]({'where':{'OpenchannelInteractionId':_0x592672['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1e48('0x7')](function(_0x21eb21){_0x592672[_0x1e48('0xb')](_0x1e48('0xc'),_0x21eb21[_0x1e48('0xd')]);OpenchannelInteractionEvents[_0x1e48('0xe')](_0x2d4a2a+':'+_0x592672['id'],_0x592672);OpenchannelInteractionEvents[_0x1e48('0xe')](_0x2d4a2a,_0x592672);_0x2aad3c(null);})[_0x1e48('0xf')](_0x2aad3c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x1e48('0x10')](e,emitEvent(event));}}module[_0x1e48('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 012e718..875fc9e 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 _0x5cb8=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','format'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x5cb8,0xef));var _0x85cb=function(_0x51c3aa,_0x4480ef){_0x51c3aa=_0x51c3aa-0x0;var _0x512699=_0x5cb8[_0x51c3aa];return _0x512699;};'use strict';var _=require('lodash');var util=require(_0x85cb('0x0'));var logger=require(_0x85cb('0x1'))(_0x85cb('0x2'));var moment=require(_0x85cb('0x3'));var BPromise=require(_0x85cb('0x4'));var rp=require(_0x85cb('0x5'));var fs=require('fs');var path=require(_0x85cb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x85cb('0x7'));module[_0x85cb('0x8')]=function(_0x1913a7,_0x4b40d9){return _0x1913a7[_0x85cb('0x9')](_0x85cb('0xa'),attributes,{'tableName':_0x85cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x85cb('0xc'),'collate':_0x85cb('0xd'),'hooks':{'beforeUpdate':function(_0x9d9fc7,_0x10d19f,_0x63bb30){if(_0x9d9fc7[_0x85cb('0xe')]('closed')){_0x9d9fc7['closedAt']=moment()[_0x85cb('0xf')](_0x85cb('0x10'));}_0x63bb30(null,_0x9d9fc7);}}});}; \ No newline at end of file +var _0xeb39=['path','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird'];(function(_0x20f060,_0xe160c9){var _0x46077c=function(_0x3c615a){while(--_0x3c615a){_0x20f060['push'](_0x20f060['shift']());}};_0x46077c(++_0xe160c9);}(_0xeb39,0x1a4));var _0x9eb3=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0xeb39[_0xcfd89f];return _0x59acd4;};'use strict';var _=require(_0x9eb3('0x0'));var util=require(_0x9eb3('0x1'));var logger=require(_0x9eb3('0x2'))('api');var moment=require(_0x9eb3('0x3'));var BPromise=require(_0x9eb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9eb3('0x5'));var rimraf=require('rimraf');var config=require(_0x9eb3('0x6'));var attributes=require(_0x9eb3('0x7'));module[_0x9eb3('0x8')]=function(_0x55dd5e,_0x2ff8b6){return _0x55dd5e[_0x9eb3('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0x9eb3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9eb3('0xb'),'collate':_0x9eb3('0xc'),'hooks':{'beforeUpdate':function(_0x287fde,_0x1182d0,_0x3cce64){if(_0x287fde['changed'](_0x9eb3('0xd'))){_0x287fde[_0x9eb3('0xe')]=moment()[_0x9eb3('0xf')](_0x9eb3('0x10'));}_0x3cce64(null,_0x287fde);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 72fdb10..4aa9712 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 _0xa515=['result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','localhost','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4ae621,_0x7fecd4){var _0x3fc9ff=function(_0x3e97e0){while(--_0x3e97e0){_0x4ae621['push'](_0x4ae621['shift']());}};_0x3fc9ff(++_0x7fecd4);}(_0xa515,0xf9));var _0x5a51=function(_0x161c81,_0x310971){_0x161c81=_0x161c81-0x0;var _0x25a6c6=_0xa515[_0x161c81];return _0x25a6c6;};'use strict';var _=require(_0x5a51('0x0'));var util=require(_0x5a51('0x1'));var moment=require(_0x5a51('0x2'));var BPromise=require(_0x5a51('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a51('0x4'));var db=require(_0x5a51('0x5'))['db'];var utils=require(_0x5a51('0x6'));var logger=require('../../config/logger')(_0x5a51('0x7'));var config=require('../../config/environment');var jayson=require(_0x5a51('0x8'));var client=jayson[_0x5a51('0x9')]['http']({'port':0x232a});config[_0x5a51('0xa')]=_['defaults'](config[_0x5a51('0xa')],{'host':_0x5a51('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a51('0xa')]));require(_0x5a51('0xc'))[_0x5a51('0xd')](socket);function respondWithRpcPromise(_0x445388,_0xb9f988,_0x387f41){return new BPromise(function(_0x51016d,_0xd7a0bb){return client[_0x5a51('0xe')](_0x445388,_0x387f41)[_0x5a51('0xf')](function(_0x3cb780){logger[_0x5a51('0x10')](_0x5a51('0x11'),_0xb9f988,_0x5a51('0x12'));logger[_0x5a51('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0xb9f988,_0x5a51('0x12'),JSON[_0x5a51('0x14')](_0x3cb780));if(_0x3cb780[_0x5a51('0x15')]){if(_0x3cb780['error'][_0x5a51('0x16')]===0x1f4){logger['error'](_0x5a51('0x11'),_0xb9f988,_0x3cb780[_0x5a51('0x15')][_0x5a51('0x17')]);return _0xd7a0bb(_0x3cb780[_0x5a51('0x15')][_0x5a51('0x17')]);}logger[_0x5a51('0x15')](_0x5a51('0x11'),_0xb9f988,_0x3cb780[_0x5a51('0x15')]['message']);return _0x51016d(_0x3cb780[_0x5a51('0x15')][_0x5a51('0x17')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0xb9f988,_0x5a51('0x12'));_0x51016d(_0x3cb780[_0x5a51('0x18')]['message']);}})[_0x5a51('0x19')](function(_0x46ecba){logger[_0x5a51('0x15')](_0x5a51('0x11'),_0xb9f988,_0x46ecba);_0xd7a0bb(_0x46ecba);});});}exports[_0x5a51('0x1a')]=function(_0x3bd226){var _0x287321=this;return new Promise(function(_0x545924,_0xe32753){return db[_0x5a51('0x1b')]['update'](_0x3bd226[_0x5a51('0x1c')],{'raw':_0x3bd226[_0x5a51('0x1d')]?_0x3bd226[_0x5a51('0x1d')][_0x5a51('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bd226['options']?_0x3bd226[_0x5a51('0x1d')][_0x5a51('0x1f')]||null:null,'attributes':_0x3bd226[_0x5a51('0x1d')]?_0x3bd226[_0x5a51('0x1d')][_0x5a51('0x20')]||null:null,'limit':_0x3bd226['options']?_0x3bd226[_0x5a51('0x1d')][_0x5a51('0x21')]||null:null})['then'](function(_0x53ad0d){logger[_0x5a51('0x10')]('UpdateOpenchannelInteraction',_0x3bd226);logger['debug']('UpdateOpenchannelInteraction',_0x3bd226,JSON[_0x5a51('0x14')](_0x53ad0d));_0x545924(_0x53ad0d);})[_0x5a51('0x19')](function(_0x2acb6e){logger['error']('UpdateOpenchannelInteraction',_0x2acb6e['message'],_0x3bd226);_0xe32753(_0x287321['error'](0x1f4,_0x2acb6e[_0x5a51('0x17')]));});});};exports[_0x5a51('0x22')]=function(_0x373237){return new Promise(function(_0x38389d,_0x575f18){return db[_0x5a51('0x1b')]['find']({'where':_0x373237[_0x5a51('0x1d')]?_0x373237['options']['where']||null:null})[_0x5a51('0xf')](function(_0xac177e){if(_0xac177e){return _0xac177e[_0x5a51('0x23')](_0x373237['body'][_0x5a51('0x24')],_[_0x5a51('0x25')](_0x373237['body'],[_0x5a51('0x24'),'id'])||{});}})['spread'](function(_0x48e66d){logger[_0x5a51('0x10')]('AddTags',_0x373237);logger[_0x5a51('0x13')](_0x5a51('0x26'),_0x373237,JSON[_0x5a51('0x14')](_0x48e66d));_0x38389d(_0x48e66d);})[_0x5a51('0x19')](function(_0x47c092){logger[_0x5a51('0x15')](_0x5a51('0x26'),_0x47c092[_0x5a51('0x17')],_0x373237);_0x575f18(_this[_0x5a51('0x15')](0x1f4,_0x47c092[_0x5a51('0x17')]));});});}; \ No newline at end of file +var _0x625c=['UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x2bf9ae,_0x270fda){var _0x23c251=function(_0x3be086){while(--_0x3be086){_0x2bf9ae['push'](_0x2bf9ae['shift']());}};_0x23c251(++_0x270fda);}(_0x625c,0x19c));var _0xc625=function(_0x37ad24,_0x20a62f){_0x37ad24=_0x37ad24-0x0;var _0x49335b=_0x625c[_0x37ad24];return _0x49335b;};'use strict';var _=require(_0xc625('0x0'));var util=require(_0xc625('0x1'));var moment=require(_0xc625('0x2'));var BPromise=require(_0xc625('0x3'));var rs=require(_0xc625('0x4'));var fs=require('fs');var Redis=require(_0xc625('0x5'));var db=require(_0xc625('0x6'))['db'];var utils=require(_0xc625('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc625('0x8'));var client=jayson[_0xc625('0x9')][_0xc625('0xa')]({'port':0x232a});config[_0xc625('0xb')]=_[_0xc625('0xc')](config['redis'],{'host':_0xc625('0xd'),'port':0x18eb});var socket=require(_0xc625('0xe'))(new Redis(config[_0xc625('0xb')]));require(_0xc625('0xf'))[_0xc625('0x10')](socket);function respondWithRpcPromise(_0x1b3906,_0x1f5806,_0x554b19){return new BPromise(function(_0xb3d76,_0x492858){return client[_0xc625('0x11')](_0x1b3906,_0x554b19)[_0xc625('0x12')](function(_0x3e8ce5){logger[_0xc625('0x13')](_0xc625('0x14'),_0x1f5806,_0xc625('0x15'));logger['debug'](_0xc625('0x16'),_0x1f5806,_0xc625('0x15'),JSON[_0xc625('0x17')](_0x3e8ce5));if(_0x3e8ce5[_0xc625('0x18')]){if(_0x3e8ce5[_0xc625('0x18')][_0xc625('0x19')]===0x1f4){logger[_0xc625('0x18')](_0xc625('0x14'),_0x1f5806,_0x3e8ce5[_0xc625('0x18')][_0xc625('0x1a')]);return _0x492858(_0x3e8ce5['error'][_0xc625('0x1a')]);}logger[_0xc625('0x18')](_0xc625('0x14'),_0x1f5806,_0x3e8ce5['error'][_0xc625('0x1a')]);return _0xb3d76(_0x3e8ce5[_0xc625('0x18')][_0xc625('0x1a')]);}else{logger['info'](_0xc625('0x14'),_0x1f5806,_0xc625('0x15'));_0xb3d76(_0x3e8ce5['result'][_0xc625('0x1a')]);}})[_0xc625('0x1b')](function(_0x42bbfe){logger[_0xc625('0x18')](_0xc625('0x14'),_0x1f5806,_0x42bbfe);_0x492858(_0x42bbfe);});});}exports[_0xc625('0x1c')]=function(_0x2c7422){var _0x422e4f=this;return new Promise(function(_0x522855,_0x352235){return db[_0xc625('0x1d')][_0xc625('0x1e')](_0x2c7422[_0xc625('0x1f')],{'raw':_0x2c7422[_0xc625('0x20')]?_0x2c7422[_0xc625('0x20')][_0xc625('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c7422['options']?_0x2c7422[_0xc625('0x20')][_0xc625('0x22')]||null:null,'attributes':_0x2c7422[_0xc625('0x20')]?_0x2c7422[_0xc625('0x20')][_0xc625('0x23')]||null:null,'limit':_0x2c7422['options']?_0x2c7422['options'][_0xc625('0x24')]||null:null})[_0xc625('0x12')](function(_0x6f3f67){logger[_0xc625('0x13')]('UpdateOpenchannelInteraction',_0x2c7422);logger['debug']('UpdateOpenchannelInteraction',_0x2c7422,JSON[_0xc625('0x17')](_0x6f3f67));_0x522855(_0x6f3f67);})[_0xc625('0x1b')](function(_0x1086e6){logger['error'](_0xc625('0x1c'),_0x1086e6[_0xc625('0x1a')],_0x2c7422);_0x352235(_0x422e4f[_0xc625('0x18')](0x1f4,_0x1086e6[_0xc625('0x1a')]));});});};exports[_0xc625('0x25')]=function(_0x57b94a){return new Promise(function(_0x9b1ccd,_0x34a1f2){return db[_0xc625('0x1d')]['find']({'where':_0x57b94a[_0xc625('0x20')]?_0x57b94a[_0xc625('0x20')][_0xc625('0x22')]||null:null})[_0xc625('0x12')](function(_0x2a9402){if(_0x2a9402){return _0x2a9402[_0xc625('0x26')](_0x57b94a[_0xc625('0x1f')][_0xc625('0x27')],_[_0xc625('0x28')](_0x57b94a[_0xc625('0x1f')],[_0xc625('0x27'),'id'])||{});}})[_0xc625('0x29')](function(_0x8d6dd4){logger[_0xc625('0x13')](_0xc625('0x2a'),_0x57b94a);logger[_0xc625('0x2b')](_0xc625('0x2a'),_0x57b94a,JSON[_0xc625('0x17')](_0x8d6dd4));_0x9b1ccd(_0x8d6dd4);})[_0xc625('0x1b')](function(_0xde71bc){logger['error'](_0xc625('0x2a'),_0xde71bc[_0xc625('0x1a')],_0x57b94a);_0x34a1f2(_this[_0xc625('0x18')](0x1f4,_0xde71bc[_0xc625('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 8555e45..3f9a530 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 _0xf8c2=['removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xf8c2,0x1c3));var _0x2f8c=function(_0x4e0f32,_0x5b4b18){_0x4e0f32=_0x4e0f32-0x0;var _0x63290f=_0xf8c2[_0x4e0f32];return _0x63290f;};'use strict';var OpenchannelInteractionEvents=require(_0x2f8c('0x0'));var events=[_0x2f8c('0x1'),_0x2f8c('0x2'),_0x2f8c('0x3')];function createListener(_0x3f65de,_0x36d29a){return function(_0x1f85bb){_0x36d29a[_0x2f8c('0x4')](_0x3f65de,_0x1f85bb);};}function removeListener(_0xcd94b5,_0x326108){return function(){OpenchannelInteractionEvents[_0x2f8c('0x5')](_0xcd94b5,_0x326108);};}exports[_0x2f8c('0x6')]=function(_0x5decf9){for(var _0x211954=0x0,_0x130a8b=events['length'];_0x211954<_0x130a8b;_0x211954++){var _0x536fe6=events[_0x211954];var _0x2ad83f=createListener(_0x2f8c('0x7')+_0x536fe6,_0x5decf9);OpenchannelInteractionEvents['on'](_0x536fe6,_0x2ad83f);}}; \ No newline at end of file +var _0x0029=['remove','update','emit','removeListener','register','length','openchannelInteraction:','save'];(function(_0x21dbe7,_0x22f166){var _0x195133=function(_0x386076){while(--_0x386076){_0x21dbe7['push'](_0x21dbe7['shift']());}};_0x195133(++_0x22f166);}(_0x0029,0xcf));var _0x9002=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x0029[_0x20c9b2];return _0x2c6030;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x9002('0x0'),_0x9002('0x1'),_0x9002('0x2')];function createListener(_0x47014b,_0x22e8fd){return function(_0x6ff2bf){_0x22e8fd[_0x9002('0x3')](_0x47014b,_0x6ff2bf);};}function removeListener(_0x4a7669,_0x5742f4){return function(){OpenchannelInteractionEvents[_0x9002('0x4')](_0x4a7669,_0x5742f4);};}exports[_0x9002('0x5')]=function(_0x4522d1){for(var _0x40f171=0x0,_0xf71c=events[_0x9002('0x6')];_0x40f171<_0xf71c;_0x40f171++){var _0x14dc5b=events[_0x40f171];var _0x54d708=createListener(_0x9002('0x7')+_0x14dc5b,_0x4522d1);OpenchannelInteractionEvents['on'](_0x14dc5b,_0x54d708);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 0c624de..8656078 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x131eb1,_0x55b270){var _0x3a3b7a=function(_0xab2165){while(--_0xab2165){_0x131eb1['push'](_0x131eb1['shift']());}};_0x3a3b7a(++_0x55b270);}(_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('./openchannelMessage.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')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file +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(_0x7efe31,_0x1b42d3){var _0x59ea5a=function(_0x299f73){while(--_0x299f73){_0x7efe31['push'](_0x7efe31['shift']());}};_0x59ea5a(++_0x1b42d3);}(_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');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 diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index d519e42..3916f51 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 _0x6947=['STRING','TEXT','exports','medium','BOOLEAN','ENUM','DATE'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x6947,0x72));var _0x7694=function(_0x4bc600,_0x1780d){_0x4bc600=_0x4bc600-0x0;var _0x1e2383=_0x6947[_0x4bc600];return _0x1e2383;};'use strict';var Sequelize=require('sequelize');module[_0x7694('0x0')]={'body':{'type':Sequelize['TEXT'](_0x7694('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7694('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7694('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7694('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7694('0x4')]},'providerName':{'type':Sequelize[_0x7694('0x5')]},'providerResponse':{'type':Sequelize[_0x7694('0x6')]}}; \ No newline at end of file +var _0x0b0e=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x15797a,_0x16274f){var _0x3e2618=function(_0x2b6e99){while(--_0x2b6e99){_0x15797a['push'](_0x15797a['shift']());}};_0x3e2618(++_0x16274f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x92d580,_0x4928fb){_0x92d580=_0x92d580-0x0;var _0x4ee344=_0x0b0e[_0x92d580];return _0x4ee344;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe0b0('0x3')]('in',_0xe0b0('0x4')),'defaultValue':_0xe0b0('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe0b0('0x5')]},'providerName':{'type':Sequelize[_0xe0b0('0x6')]},'providerResponse':{'type':Sequelize[_0xe0b0('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 3e3e515..ac71a2c 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 _0xe3db=['readAt','format','user','agent','UserId','get','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','fullname','email','internal','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','reject','openchannel','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','QueryTypes','SIP/%s','rejectmessage','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./openchannelMessage.socket','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','openchannel-interactions'];(function(_0x5a0e1d,_0x261edc){var _0x320dc0=function(_0x2fef8a){while(--_0x2fef8a){_0x5a0e1d['push'](_0x5a0e1d['shift']());}};_0x320dc0(++_0x261edc);}(_0xe3db,0xa5));var _0xbe3d=function(_0x5728ac,_0x2bd794){_0x5728ac=_0x5728ac-0x0;var _0xef9203=_0xe3db[_0x5728ac];return _0xef9203;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbe3d('0x0'));var jsonpatch=require(_0xbe3d('0x1'));var rp=require('request-promise');var moment=require(_0xbe3d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbe3d('0x3'));var util=require(_0xbe3d('0x4'));var path=require('path');var sox=require(_0xbe3d('0x5'));var csv=require(_0xbe3d('0x6'));var ejs=require(_0xbe3d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbe3d('0x8'));var crypto=require(_0xbe3d('0x9'));var jsforce=require(_0xbe3d('0xa'));var deskjs=require(_0xbe3d('0xb'));var toCsv=require(_0xbe3d('0x6'));var querystring=require(_0xbe3d('0xc'));var Papa=require('papaparse');var Redis=require(_0xbe3d('0xd'));var authService=require(_0xbe3d('0xe'));var qs=require(_0xbe3d('0xf'));var as=require(_0xbe3d('0x10'));var hardwareService=require(_0xbe3d('0x11'));var logger=require(_0xbe3d('0x12'))(_0xbe3d('0x13'));var utils=require('../../config/utils');var config=require(_0xbe3d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbe3d('0x15'))['db'];config[_0xbe3d('0x16')]=_['defaults'](config['redis'],{'host':_0xbe3d('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe3d('0x16')]));require(_0xbe3d('0x18'))['register'](socket);var jayson=require(_0xbe3d('0x19'));var client=jayson[_0xbe3d('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0xbe3d('0x1a')][_0xbe3d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5a5d79,_0x15d7f5,_0xad757a,_0x2392cf){return new BPromise(function(_0x555914,_0x2625e9){var _0x43e77b=_0x2392cf||client;return _0x43e77b['request'](_0x5a5d79,_0xad757a)[_0xbe3d('0x1c')](function(_0x3d50e1){logger[_0xbe3d('0x1d')](_0xbe3d('0x1e'),_0x15d7f5,_0xbe3d('0x1f'));logger['debug'](_0xbe3d('0x20'),_0x15d7f5,_0xbe3d('0x1f'),JSON['stringify'](_0x3d50e1));if(_0x3d50e1[_0xbe3d('0x21')]){if(_0x3d50e1[_0xbe3d('0x21')][_0xbe3d('0x22')]===0x1f4){logger['error'](_0xbe3d('0x1e'),_0x15d7f5,_0x3d50e1['error'][_0xbe3d('0x23')]);return _0x2625e9(_0x3d50e1['error'][_0xbe3d('0x23')]);}logger[_0xbe3d('0x21')](_0xbe3d('0x1e'),_0x15d7f5,_0x3d50e1[_0xbe3d('0x21')]['message']);return _0x555914(_0x3d50e1['error'][_0xbe3d('0x23')]);}else{logger[_0xbe3d('0x1d')](_0xbe3d('0x1e'),_0x15d7f5,'request\x20sent');_0x555914(_0x3d50e1[_0xbe3d('0x24')][_0xbe3d('0x23')]);}})[_0xbe3d('0x25')](function(_0x56376f){logger[_0xbe3d('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x15d7f5,_0x56376f);_0x2625e9(_0x56376f);});});}function respondWithStatusCode(_0x3de0b3,_0x31fb28){_0x31fb28=_0x31fb28||0xcc;return function(_0x3dc795){if(_0x3dc795){return _0x3de0b3[_0xbe3d('0x26')](_0x31fb28);}return _0x3de0b3[_0xbe3d('0x27')](_0x31fb28)[_0xbe3d('0x28')]();};}function respondWithResult(_0x2eaadf,_0x597368){_0x597368=_0x597368||0xc8;return function(_0x4cc8ed){if(_0x4cc8ed){return _0x2eaadf[_0xbe3d('0x27')](_0x597368)['json'](_0x4cc8ed);}};}function respondWithFilteredResult(_0x3d9adb,_0x11a58e){return function(_0x597a51){if(_0x597a51){var _0x12e9db=typeof _0x11a58e[_0xbe3d('0x29')]===_0xbe3d('0x2a')&&typeof _0x11a58e['limit']===_0xbe3d('0x2a');var _0x214dab=_0x597a51[_0xbe3d('0x2b')];var _0x495ab4=_0x12e9db?0x0:_0x11a58e[_0xbe3d('0x29')];var _0x15cc4f=_0x12e9db?_0x597a51[_0xbe3d('0x2b')]:_0x11a58e[_0xbe3d('0x29')]+_0x11a58e[_0xbe3d('0x2c')];var _0x2f371f;if(_0x15cc4f>=_0x214dab){_0x15cc4f=_0x214dab;_0x2f371f=0xc8;}else{_0x2f371f=0xce;}_0x3d9adb[_0xbe3d('0x27')](_0x2f371f);return _0x3d9adb[_0xbe3d('0x2d')](_0xbe3d('0x2e'),_0x495ab4+'-'+_0x15cc4f+'/'+_0x214dab)['json'](_0x597a51);}return null;};}function patchUpdates(_0x3240f1){return function(_0x41d335){try{jsonpatch[_0xbe3d('0x2f')](_0x41d335,_0x3240f1,!![]);}catch(_0x18b797){return BPromise['reject'](_0x18b797);}return _0x41d335['save']();};}function saveUpdates(_0x20248c,_0x4ae0ec){return function(_0x9b4d13){if(_0x9b4d13){return _0x9b4d13[_0xbe3d('0x30')](_0x20248c)[_0xbe3d('0x1c')](function(_0x4d505d){return _0x4d505d;});}return null;};}function removeEntity(_0x4b6aa2,_0x2ed7a5){return function(_0x1a45c3){if(_0x1a45c3){return _0x1a45c3[_0xbe3d('0x31')]()[_0xbe3d('0x1c')](function(){_0x4b6aa2[_0xbe3d('0x27')](0xcc)[_0xbe3d('0x28')]();});}};}function handleEntityNotFound(_0x1020bf,_0x2129fc){return function(_0x1b5952){if(!_0x1b5952){_0x1020bf[_0xbe3d('0x26')](0x194);}return _0x1b5952;};}function handleError(_0x53a8dd,_0x2725fc){_0x2725fc=_0x2725fc||0x1f4;return function(_0xd1f6d1){logger[_0xbe3d('0x21')](_0xd1f6d1[_0xbe3d('0x32')]);if(_0xd1f6d1[_0xbe3d('0x33')]){delete _0xd1f6d1['name'];}_0x53a8dd[_0xbe3d('0x27')](_0x2725fc)[_0xbe3d('0x34')](_0xd1f6d1);};}exports[_0xbe3d('0x35')]=function(_0x144cee,_0x57e316){var _0x3c3866={},_0x389c66={},_0x41b8f8={'count':0x0,'rows':[]};var _0x25e5be=_[_0xbe3d('0x36')](db[_0xbe3d('0x37')][_0xbe3d('0x38')],function(_0x71437d){return{'name':_0x71437d[_0xbe3d('0x39')],'type':_0x71437d[_0xbe3d('0x3a')][_0xbe3d('0x3b')]};});_0x389c66[_0xbe3d('0x3c')]=_['map'](_0x25e5be,'name');_0x389c66[_0xbe3d('0x3d')]=_[_0xbe3d('0x3e')](_0x144cee[_0xbe3d('0x3d')]);_0x389c66[_0xbe3d('0x3f')]=_[_0xbe3d('0x40')](_0x389c66[_0xbe3d('0x3c')],_0x389c66[_0xbe3d('0x3d')]);_0x3c3866['attributes']=_[_0xbe3d('0x40')](_0x389c66[_0xbe3d('0x3c')],qs['fields'](_0x144cee[_0xbe3d('0x3d')][_0xbe3d('0x41')]));_0x3c3866['attributes']=_0x3c3866['attributes'][_0xbe3d('0x42')]?_0x3c3866[_0xbe3d('0x43')]:_0x389c66[_0xbe3d('0x3c')];if(!_0x144cee[_0xbe3d('0x3d')][_0xbe3d('0x44')]('nolimit')){_0x3c3866[_0xbe3d('0x2c')]=qs[_0xbe3d('0x2c')](_0x144cee['query'][_0xbe3d('0x2c')]);_0x3c3866[_0xbe3d('0x29')]=qs['offset'](_0x144cee[_0xbe3d('0x3d')][_0xbe3d('0x29')]);}_0x3c3866[_0xbe3d('0x45')]=qs[_0xbe3d('0x46')](_0x144cee[_0xbe3d('0x3d')][_0xbe3d('0x46')]);_0x3c3866['where']=qs['filters'](_[_0xbe3d('0x47')](_0x144cee['query'],_0x389c66['filters']),_0x25e5be);if(_0x144cee[_0xbe3d('0x3d')][_0xbe3d('0x48')]){_0x3c3866[_0xbe3d('0x49')]=_['merge'](_0x3c3866[_0xbe3d('0x49')],{'$or':_[_0xbe3d('0x36')](_0x25e5be,function(_0x195c34){if(_0x195c34[_0xbe3d('0x3a')]!=='VIRTUAL'){var _0x1eea09={};_0x1eea09[_0x195c34[_0xbe3d('0x33')]]={'$like':'%'+_0x144cee['query'][_0xbe3d('0x48')]+'%'};return _0x1eea09;}})});}_0x3c3866=_[_0xbe3d('0x4a')]({},_0x3c3866,_0x144cee[_0xbe3d('0x4b')]);var _0x56f548={'where':_0x3c3866['where']};return db[_0xbe3d('0x37')][_0xbe3d('0x2b')](_0x56f548)['then'](function(_0x16076a){_0x41b8f8[_0xbe3d('0x2b')]=_0x16076a;if(_0x144cee[_0xbe3d('0x3d')][_0xbe3d('0x4c')]){_0x3c3866[_0xbe3d('0x4d')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xbe3d('0x4e')](_0x3c3866);})[_0xbe3d('0x1c')](function(_0x29b5d1){_0x41b8f8[_0xbe3d('0x4f')]=_0x29b5d1;return _0x41b8f8;})[_0xbe3d('0x1c')](respondWithFilteredResult(_0x57e316,_0x3c3866))[_0xbe3d('0x25')](handleError(_0x57e316,null));};exports[_0xbe3d('0x50')]=function(_0x29055a,_0x26cbfc){var _0x1ee89d={'raw':!![],'where':{'id':_0x29055a[_0xbe3d('0x51')]['id']}},_0xd01618={};_0xd01618[_0xbe3d('0x3c')]=_[_0xbe3d('0x3e')](db[_0xbe3d('0x37')][_0xbe3d('0x38')]);_0xd01618[_0xbe3d('0x3d')]=_['keys'](_0x29055a[_0xbe3d('0x3d')]);_0xd01618[_0xbe3d('0x3f')]=_[_0xbe3d('0x40')](_0xd01618['model'],_0xd01618[_0xbe3d('0x3d')]);_0x1ee89d[_0xbe3d('0x43')]=_[_0xbe3d('0x40')](_0xd01618[_0xbe3d('0x3c')],qs['fields'](_0x29055a['query'][_0xbe3d('0x41')]));_0x1ee89d['attributes']=_0x1ee89d['attributes'][_0xbe3d('0x42')]?_0x1ee89d[_0xbe3d('0x43')]:_0xd01618[_0xbe3d('0x3c')];if(_0x29055a[_0xbe3d('0x3d')]['includeAll']){_0x1ee89d['include']=[{'all':!![]}];}_0x1ee89d=_['merge']({},_0x1ee89d,_0x29055a['options']);return db[_0xbe3d('0x37')]['find'](_0x1ee89d)[_0xbe3d('0x1c')](handleEntityNotFound(_0x26cbfc,null))['then'](respondWithResult(_0x26cbfc,null))[_0xbe3d('0x25')](handleError(_0x26cbfc,null));};exports[_0xbe3d('0x52')]=function(_0x4aeaf5,_0x12378){return db['OpenchannelMessage'][_0xbe3d('0x52')](_0x4aeaf5[_0xbe3d('0x53')],{})[_0xbe3d('0x1c')](respondWithResult(_0x12378,0xc9))['catch'](handleError(_0x12378,null));};exports[_0xbe3d('0x30')]=function(_0x24323a,_0x8c19a){if(_0x24323a[_0xbe3d('0x53')]['id']){delete _0x24323a[_0xbe3d('0x53')]['id'];}return db[_0xbe3d('0x37')][_0xbe3d('0x54')]({'where':{'id':_0x24323a[_0xbe3d('0x51')]['id']}})[_0xbe3d('0x1c')](handleEntityNotFound(_0x8c19a,null))[_0xbe3d('0x1c')](saveUpdates(_0x24323a['body'],null))['then'](respondWithResult(_0x8c19a,null))[_0xbe3d('0x25')](handleError(_0x8c19a,null));};exports[_0xbe3d('0x31')]=function(_0x3bdc36,_0x279159){return db[_0xbe3d('0x37')][_0xbe3d('0x54')]({'where':{'id':_0x3bdc36['params']['id']}})['then'](handleEntityNotFound(_0x279159,null))['then'](removeEntity(_0x279159,null))[_0xbe3d('0x25')](handleError(_0x279159,null));};exports[_0xbe3d('0x55')]=function(_0x59e98b,_0x2b4fd2){return db[_0xbe3d('0x37')]['describe']()[_0xbe3d('0x1c')](respondWithResult(_0x2b4fd2,null))[_0xbe3d('0x25')](handleError(_0x2b4fd2,null));};var interaction_log=require(_0xbe3d('0x12'))(_0xbe3d('0x56'));exports['accept']=function(_0x451558,_0x149ac7,_0x46610c){var _0x3643af={'agent':{},'channel':'openchannel'};if(_0x451558[_0xbe3d('0x53')]['id']){delete _0x451558[_0xbe3d('0x53')]['id'];}_0x451558[_0xbe3d('0x53')]['read']=!![];_0x451558['body'][_0xbe3d('0x57')]=moment()[_0xbe3d('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x451558[_0xbe3d('0x53')]['UserId']=_0x451558['body']['UserId']||_0x451558[_0xbe3d('0x59')]['id'];_0x3643af[_0xbe3d('0x5a')]['id']=_0x451558[_0xbe3d('0x53')][_0xbe3d('0x5b')];return db['OpenchannelMessage'][_0xbe3d('0x54')]({'where':{'id':_0x451558[_0xbe3d('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x149ac7,null))[_0xbe3d('0x1c')](saveUpdates(_0x451558[_0xbe3d('0x53')],null))[_0xbe3d('0x1c')](function(_0x28f120){if(_0x28f120){_0x3643af[_0xbe3d('0x23')]=_0x28f120[_0xbe3d('0x5c')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x28f120[_0xbe3d('0x5d')]}});}return null;})[_0xbe3d('0x1c')](handleEntityNotFound(_0x149ac7,null))['then'](function(_0x19c0a0){if(_0x19c0a0){return _0x19c0a0['update']({'UserId':_0x451558[_0xbe3d('0x53')][_0xbe3d('0x5b')],'read1stAt':_[_0xbe3d('0x5e')](_0x19c0a0[_0xbe3d('0x5f')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x4ed605){if(_0x4ed605){_0x3643af[_0xbe3d('0x60')]=_0x4ed605[_0xbe3d('0x5c')]({'plain':!![]});interaction_log['info'](_0xbe3d('0x61'),_0x451558[_0xbe3d('0x59')]['id'],_0x451558[_0xbe3d('0x59')][_0xbe3d('0x33')],_0x451558[_0xbe3d('0x59')][_0xbe3d('0x62')],_0x3643af[_0xbe3d('0x60')]['id'],_0x451558[_0xbe3d('0x53')]?JSON[_0xbe3d('0x63')](_0x451558['body']):_0xbe3d('0x64'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3643af);}return null;})[_0xbe3d('0x1c')](function(_0x562262){var _0x391beb=_0xbe3d('0x65')+_0x562262['message']['ContactId'];return db[_0xbe3d('0x66')]['query'](_0x391beb,{'type':db['Sequelize']['QueryTypes'][_0xbe3d('0x67')],'raw':!![]})[_0xbe3d('0x1c')](function(_0x6eeb98){return _0x6eeb98;});})[_0xbe3d('0x1c')](function(_0x4d1966){if(_0x4d1966){_0x3643af[_0xbe3d('0x23')][_0xbe3d('0x68')]=_0x4d1966[0x0];if(!_0x451558[_0xbe3d('0x53')][_0xbe3d('0x5b')])return;return db['User'][_0xbe3d('0x54')]({'where':{'id':_0x451558[_0xbe3d('0x53')]['UserId'],'role':'agent'},'attributes':['id','name',_0xbe3d('0x69'),_0xbe3d('0x6a'),_0xbe3d('0x6b')],'raw':!![]});}return null;})[_0xbe3d('0x1c')](function(_0x574554){if(!_0x574554)return null;_0x3643af[_0xbe3d('0x23')]['agent']=_0x574554;return _0x3643af;})[_0xbe3d('0x1c')](function(_0x148afd){if(_0x148afd){if(_0x451558[_0xbe3d('0x53')][_0xbe3d('0x6c')]){_0x3643af['message'][_0xbe3d('0x6d')]=util[_0xbe3d('0x58')]('SIP/%s',_0x451558[_0xbe3d('0x59')][_0xbe3d('0x33')]);_0x3643af[_0xbe3d('0x23')][_0xbe3d('0x6e')]=_0x3643af['channel'];_0x3643af['message'][_0xbe3d('0x6f')]=_0x3643af['channel'];_0x3643af['message'][_0xbe3d('0x70')]=_0xbe3d('0x71');return respondWithRpcPromise(_0xbe3d('0x72'),'EventManager',{'event':_0xbe3d('0x73'),'message':_0x3643af[_0xbe3d('0x23')]},client9002)['then'](function(){return _0x3643af;});}return _0x3643af;}return null;})['then'](respondWithResult(_0x149ac7,null))[_0xbe3d('0x25')](handleError(_0x149ac7,null));};var interaction_log=require(_0xbe3d('0x12'))(_0xbe3d('0x56'));exports[_0xbe3d('0x74')]=function(_0x5c981d,_0x2938d2,_0x3cdd85){var _0x34ab85={'agent':{},'channel':_0xbe3d('0x75')};if(_0x5c981d['body']['id']){delete _0x5c981d[_0xbe3d('0x53')]['id'];}_0x5c981d[_0xbe3d('0x53')][_0xbe3d('0x5b')]=_0x5c981d['body'][_0xbe3d('0x5b')]||_0x5c981d[_0xbe3d('0x59')]['id'];_0x34ab85[_0xbe3d('0x5a')]['id']=_0x5c981d[_0xbe3d('0x53')][_0xbe3d('0x5b')];return db[_0xbe3d('0x37')][_0xbe3d('0x54')]({'where':{'id':_0x5c981d[_0xbe3d('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2938d2,null))['then'](function(_0x30d694){if(_0x30d694){_0x34ab85[_0xbe3d('0x23')]=_0x30d694[_0xbe3d('0x5c')]({'plain':!![]});return db[_0xbe3d('0x76')][_0xbe3d('0x54')]({'where':{'id':_0x30d694[_0xbe3d('0x5d')]}});}return null;})[_0xbe3d('0x1c')](handleEntityNotFound(_0x2938d2,null))[_0xbe3d('0x1c')](function(_0x344e7a){if(_0x344e7a){_0x34ab85[_0xbe3d('0x60')]=_0x344e7a['get']({'plain':!![]});interaction_log[_0xbe3d('0x1d')](_0xbe3d('0x77'),_0x5c981d[_0xbe3d('0x59')]['id'],_0x5c981d['user'][_0xbe3d('0x33')],_0x5c981d[_0xbe3d('0x59')][_0xbe3d('0x62')],_0x34ab85[_0xbe3d('0x60')]['id'],_0x5c981d[_0xbe3d('0x53')]?JSON[_0xbe3d('0x63')](_0x5c981d[_0xbe3d('0x53')]):'null');return respondWithRpcPromise(_0xbe3d('0x78'),_0xbe3d('0x79'),_0x34ab85);}return null;})[_0xbe3d('0x1c')](function(_0x588212){var _0x28d3d6=_0xbe3d('0x65')+_0x588212[_0xbe3d('0x23')][_0xbe3d('0x7a')];return db[_0xbe3d('0x66')]['query'](_0x28d3d6,{'type':db['Sequelize'][_0xbe3d('0x7b')][_0xbe3d('0x67')],'raw':!![]})[_0xbe3d('0x1c')](function(_0x510097){return _0x510097;});})[_0xbe3d('0x1c')](function(_0x57c0a3){if(_0x57c0a3){_0x34ab85[_0xbe3d('0x23')][_0xbe3d('0x68')]=_0x57c0a3[0x0];if(!_0x5c981d[_0xbe3d('0x53')]['UserId'])return;return db['User'][_0xbe3d('0x54')]({'where':{'id':_0x5c981d[_0xbe3d('0x53')][_0xbe3d('0x5b')],'role':_0xbe3d('0x5a')},'attributes':['id','name','fullname',_0xbe3d('0x6a'),_0xbe3d('0x6b')],'raw':!![]});}return null;})[_0xbe3d('0x1c')](function(_0x5c733e){if(!_0x5c733e)return null;_0x34ab85['message']['agent']=_0x5c733e;return _0x34ab85;})[_0xbe3d('0x1c')](function(_0x388edf){if(_0x388edf){_0x388edf[_0xbe3d('0x23')][_0xbe3d('0x6d')]=util[_0xbe3d('0x58')](_0xbe3d('0x7c'),_0x5c981d['user']['name']);_0x388edf[_0xbe3d('0x23')]['channel']=_0x34ab85['channel'];_0x388edf[_0xbe3d('0x23')]['motionChannel']=_0x34ab85[_0xbe3d('0x6e')];_0x388edf[_0xbe3d('0x23')][_0xbe3d('0x70')]=_0xbe3d('0x74');respondWithRpcPromise('EventManager',_0xbe3d('0x72'),{'event':_0xbe3d('0x7d'),'message':_0x388edf[_0xbe3d('0x23')]},client9002);return _0x34ab85;}return null;})[_0xbe3d('0x1c')](respondWithResult(_0x2938d2,null))[_0xbe3d('0x25')](handleError(_0x2938d2,null));}; \ No newline at end of file +var _0x282f=['send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','OpenchannelMessage','rows','catch','show','params','keys','fields','create','body','find','destroy','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectMessage','ContactId','QueryTypes','rejectmessage','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','json','undefined','offset','count','limit','set','reject','save','update','then','stack','name'];(function(_0x1c5950,_0x49e128){var _0x2b720a=function(_0x4454f1){while(--_0x4454f1){_0x1c5950['push'](_0x1c5950['shift']());}};_0x2b720a(++_0x49e128);}(_0x282f,0x153));var _0xf282=function(_0x41f99d,_0x4659fe){_0x41f99d=_0x41f99d-0x0;var _0x33d65a=_0x282f[_0x41f99d];return _0x33d65a;};'use strict';var emlformat=require(_0xf282('0x0'));var rimraf=require(_0xf282('0x1'));var zipdir=require(_0xf282('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf282('0x3'));var moment=require('moment');var BPromise=require(_0xf282('0x4'));var Mustache=require(_0xf282('0x5'));var util=require(_0xf282('0x6'));var path=require(_0xf282('0x7'));var sox=require('sox');var csv=require(_0xf282('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf282('0x9'));var _=require(_0xf282('0xa'));var squel=require(_0xf282('0xb'));var crypto=require(_0xf282('0xc'));var jsforce=require(_0xf282('0xd'));var deskjs=require(_0xf282('0xe'));var toCsv=require(_0xf282('0x8'));var querystring=require(_0xf282('0xf'));var Papa=require('papaparse');var Redis=require(_0xf282('0x10'));var authService=require(_0xf282('0x11'));var qs=require(_0xf282('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf282('0x13'));var logger=require(_0xf282('0x14'))(_0xf282('0x15'));var utils=require(_0xf282('0x16'));var config=require(_0xf282('0x17'));var licenseUtil=require(_0xf282('0x18'));var db=require(_0xf282('0x19'))['db'];config[_0xf282('0x1a')]=_[_0xf282('0x1b')](config[_0xf282('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xf282('0x1c'))(new Redis(config['redis']));require('./openchannelMessage.socket')[_0xf282('0x1d')](socket);var jayson=require(_0xf282('0x1e'));var client=jayson[_0xf282('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xf282('0x1f')][_0xf282('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5afb51,_0x161d7c,_0x1c6628,_0x4065f0){return new BPromise(function(_0x5054be,_0x3c9710){var _0x3c44d3=_0x4065f0||client;return _0x3c44d3[_0xf282('0x21')](_0x5afb51,_0x1c6628)['then'](function(_0x209931){logger[_0xf282('0x22')](_0xf282('0x23'),_0x161d7c,_0xf282('0x24'));logger[_0xf282('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x161d7c,'request\x20sent',JSON['stringify'](_0x209931));if(_0x209931[_0xf282('0x26')]){if(_0x209931[_0xf282('0x26')][_0xf282('0x27')]===0x1f4){logger['error'](_0xf282('0x23'),_0x161d7c,_0x209931[_0xf282('0x26')][_0xf282('0x28')]);return _0x3c9710(_0x209931[_0xf282('0x26')][_0xf282('0x28')]);}logger[_0xf282('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x161d7c,_0x209931[_0xf282('0x26')]['message']);return _0x5054be(_0x209931[_0xf282('0x26')][_0xf282('0x28')]);}else{logger[_0xf282('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x161d7c,_0xf282('0x24'));_0x5054be(_0x209931[_0xf282('0x29')][_0xf282('0x28')]);}})['catch'](function(_0x590dd9){logger[_0xf282('0x26')](_0xf282('0x23'),_0x161d7c,_0x590dd9);_0x3c9710(_0x590dd9);});});}function respondWithStatusCode(_0x4823c5,_0xc55e6d){_0xc55e6d=_0xc55e6d||0xcc;return function(_0x2ea486){if(_0x2ea486){return _0x4823c5[_0xf282('0x2a')](_0xc55e6d);}return _0x4823c5[_0xf282('0x2b')](_0xc55e6d)[_0xf282('0x2c')]();};}function respondWithResult(_0x1d31d1,_0x538808){_0x538808=_0x538808||0xc8;return function(_0x3c99aa){if(_0x3c99aa){return _0x1d31d1['status'](_0x538808)[_0xf282('0x2d')](_0x3c99aa);}};}function respondWithFilteredResult(_0x30e4dc,_0x231424){return function(_0x69b2db){if(_0x69b2db){var _0x195c7c=typeof _0x231424['offset']===_0xf282('0x2e')&&typeof _0x231424['limit']===_0xf282('0x2e');var _0x2b1c6f=_0x69b2db['count'];var _0x219d75=_0x195c7c?0x0:_0x231424[_0xf282('0x2f')];var _0x4aee21=_0x195c7c?_0x69b2db[_0xf282('0x30')]:_0x231424[_0xf282('0x2f')]+_0x231424[_0xf282('0x31')];var _0x18bf47;if(_0x4aee21>=_0x2b1c6f){_0x4aee21=_0x2b1c6f;_0x18bf47=0xc8;}else{_0x18bf47=0xce;}_0x30e4dc[_0xf282('0x2b')](_0x18bf47);return _0x30e4dc[_0xf282('0x32')]('Content-Range',_0x219d75+'-'+_0x4aee21+'/'+_0x2b1c6f)[_0xf282('0x2d')](_0x69b2db);}return null;};}function patchUpdates(_0x39b6d3){return function(_0x462102){try{jsonpatch['apply'](_0x462102,_0x39b6d3,!![]);}catch(_0x12a96e){return BPromise[_0xf282('0x33')](_0x12a96e);}return _0x462102[_0xf282('0x34')]();};}function saveUpdates(_0x4ac378,_0x44ff35){return function(_0x11f432){if(_0x11f432){return _0x11f432[_0xf282('0x35')](_0x4ac378)[_0xf282('0x36')](function(_0x443cf4){return _0x443cf4;});}return null;};}function removeEntity(_0x179554,_0x51160a){return function(_0x5065be){if(_0x5065be){return _0x5065be['destroy']()['then'](function(){_0x179554[_0xf282('0x2b')](0xcc)[_0xf282('0x2c')]();});}};}function handleEntityNotFound(_0x5f508e,_0x852122){return function(_0xb3a69c){if(!_0xb3a69c){_0x5f508e[_0xf282('0x2a')](0x194);}return _0xb3a69c;};}function handleError(_0x306e31,_0xf6af28){_0xf6af28=_0xf6af28||0x1f4;return function(_0x42ca93){logger[_0xf282('0x26')](_0x42ca93[_0xf282('0x37')]);if(_0x42ca93[_0xf282('0x38')]){delete _0x42ca93[_0xf282('0x38')];}_0x306e31['status'](_0xf6af28)[_0xf282('0x39')](_0x42ca93);};}exports[_0xf282('0x3a')]=function(_0x167981,_0x1aaa77){var _0x4e8540={},_0x463bcd={},_0x5818be={'count':0x0,'rows':[]};var _0x1f370f=_[_0xf282('0x3b')](db['OpenchannelMessage']['rawAttributes'],function(_0x59424d){return{'name':_0x59424d[_0xf282('0x3c')],'type':_0x59424d[_0xf282('0x3d')][_0xf282('0x3e')]};});_0x463bcd[_0xf282('0x3f')]=_[_0xf282('0x3b')](_0x1f370f,_0xf282('0x38'));_0x463bcd[_0xf282('0x40')]=_['keys'](_0x167981[_0xf282('0x40')]);_0x463bcd[_0xf282('0x41')]=_['intersection'](_0x463bcd[_0xf282('0x3f')],_0x463bcd['query']);_0x4e8540['attributes']=_[_0xf282('0x42')](_0x463bcd[_0xf282('0x3f')],qs['fields'](_0x167981[_0xf282('0x40')]['fields']));_0x4e8540[_0xf282('0x43')]=_0x4e8540['attributes'][_0xf282('0x44')]?_0x4e8540['attributes']:_0x463bcd[_0xf282('0x3f')];if(!_0x167981[_0xf282('0x40')]['hasOwnProperty'](_0xf282('0x45'))){_0x4e8540[_0xf282('0x31')]=qs[_0xf282('0x31')](_0x167981[_0xf282('0x40')][_0xf282('0x31')]);_0x4e8540[_0xf282('0x2f')]=qs['offset'](_0x167981[_0xf282('0x40')][_0xf282('0x2f')]);}_0x4e8540[_0xf282('0x46')]=qs[_0xf282('0x47')](_0x167981[_0xf282('0x40')]['sort']);_0x4e8540[_0xf282('0x48')]=qs['filters'](_[_0xf282('0x49')](_0x167981[_0xf282('0x40')],_0x463bcd['filters']),_0x1f370f);if(_0x167981['query'][_0xf282('0x4a')]){_0x4e8540[_0xf282('0x48')]=_[_0xf282('0x4b')](_0x4e8540[_0xf282('0x48')],{'$or':_[_0xf282('0x3b')](_0x1f370f,function(_0x37d30b){if(_0x37d30b[_0xf282('0x3d')]!==_0xf282('0x4c')){var _0x385635={};_0x385635[_0x37d30b[_0xf282('0x38')]]={'$like':'%'+_0x167981[_0xf282('0x40')]['filter']+'%'};return _0x385635;}})});}_0x4e8540=_['merge']({},_0x4e8540,_0x167981[_0xf282('0x4d')]);var _0x577b36={'where':_0x4e8540['where']};return db['OpenchannelMessage'][_0xf282('0x30')](_0x577b36)[_0xf282('0x36')](function(_0x51df64){_0x5818be[_0xf282('0x30')]=_0x51df64;if(_0x167981[_0xf282('0x40')][_0xf282('0x4e')]){_0x4e8540[_0xf282('0x4f')]=[{'all':!![]}];}return db[_0xf282('0x50')]['findAll'](_0x4e8540);})[_0xf282('0x36')](function(_0x310c02){_0x5818be[_0xf282('0x51')]=_0x310c02;return _0x5818be;})['then'](respondWithFilteredResult(_0x1aaa77,_0x4e8540))[_0xf282('0x52')](handleError(_0x1aaa77,null));};exports[_0xf282('0x53')]=function(_0x2ac0ce,_0x46f035){var _0x422a55={'raw':!![],'where':{'id':_0x2ac0ce[_0xf282('0x54')]['id']}},_0x595230={};_0x595230[_0xf282('0x3f')]=_['keys'](db[_0xf282('0x50')]['rawAttributes']);_0x595230['query']=_[_0xf282('0x55')](_0x2ac0ce[_0xf282('0x40')]);_0x595230[_0xf282('0x41')]=_[_0xf282('0x42')](_0x595230[_0xf282('0x3f')],_0x595230['query']);_0x422a55['attributes']=_[_0xf282('0x42')](_0x595230[_0xf282('0x3f')],qs[_0xf282('0x56')](_0x2ac0ce[_0xf282('0x40')][_0xf282('0x56')]));_0x422a55[_0xf282('0x43')]=_0x422a55[_0xf282('0x43')][_0xf282('0x44')]?_0x422a55[_0xf282('0x43')]:_0x595230['model'];if(_0x2ac0ce['query'][_0xf282('0x4e')]){_0x422a55[_0xf282('0x4f')]=[{'all':!![]}];}_0x422a55=_['merge']({},_0x422a55,_0x2ac0ce[_0xf282('0x4d')]);return db[_0xf282('0x50')]['find'](_0x422a55)['then'](handleEntityNotFound(_0x46f035,null))[_0xf282('0x36')](respondWithResult(_0x46f035,null))[_0xf282('0x52')](handleError(_0x46f035,null));};exports[_0xf282('0x57')]=function(_0x253751,_0x5ee46c){return db[_0xf282('0x50')]['create'](_0x253751[_0xf282('0x58')],{})[_0xf282('0x36')](respondWithResult(_0x5ee46c,0xc9))['catch'](handleError(_0x5ee46c,null));};exports[_0xf282('0x35')]=function(_0x534716,_0x237fe0){if(_0x534716[_0xf282('0x58')]['id']){delete _0x534716[_0xf282('0x58')]['id'];}return db[_0xf282('0x50')][_0xf282('0x59')]({'where':{'id':_0x534716['params']['id']}})[_0xf282('0x36')](handleEntityNotFound(_0x237fe0,null))[_0xf282('0x36')](saveUpdates(_0x534716[_0xf282('0x58')],null))['then'](respondWithResult(_0x237fe0,null))[_0xf282('0x52')](handleError(_0x237fe0,null));};exports[_0xf282('0x5a')]=function(_0x30711c,_0x1982f8){return db[_0xf282('0x50')][_0xf282('0x59')]({'where':{'id':_0x30711c[_0xf282('0x54')]['id']}})['then'](handleEntityNotFound(_0x1982f8,null))[_0xf282('0x36')](removeEntity(_0x1982f8,null))[_0xf282('0x52')](handleError(_0x1982f8,null));};exports['describe']=function(_0x5bacb0,_0x1377d7){return db['OpenchannelMessage']['describe']()['then'](respondWithResult(_0x1377d7,null))[_0xf282('0x52')](handleError(_0x1377d7,null));};var interaction_log=require(_0xf282('0x14'))(_0xf282('0x5b'));exports[_0xf282('0x5c')]=function(_0x5d28cc,_0x5bad22,_0x21c596){var _0x30c7a5={'agent':{},'channel':_0xf282('0x5d')};if(_0x5d28cc[_0xf282('0x58')]['id']){delete _0x5d28cc['body']['id'];}_0x5d28cc['body'][_0xf282('0x5e')]=!![];_0x5d28cc[_0xf282('0x58')][_0xf282('0x5f')]=moment()['format'](_0xf282('0x60'));_0x5d28cc['body'][_0xf282('0x61')]=_0x5d28cc[_0xf282('0x58')][_0xf282('0x61')]||_0x5d28cc[_0xf282('0x62')]['id'];_0x30c7a5[_0xf282('0x63')]['id']=_0x5d28cc['body'][_0xf282('0x61')];return db[_0xf282('0x50')][_0xf282('0x59')]({'where':{'id':_0x5d28cc[_0xf282('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5bad22,null))[_0xf282('0x36')](saveUpdates(_0x5d28cc[_0xf282('0x58')],null))[_0xf282('0x36')](function(_0x5f55d9){if(_0x5f55d9){_0x30c7a5[_0xf282('0x28')]=_0x5f55d9[_0xf282('0x64')]({'plain':!![]});return db['OpenchannelInteraction'][_0xf282('0x59')]({'where':{'id':_0x5f55d9['OpenchannelInteractionId']}});}return null;})[_0xf282('0x36')](handleEntityNotFound(_0x5bad22,null))[_0xf282('0x36')](function(_0x358f20){if(_0x358f20){return _0x358f20[_0xf282('0x35')]({'UserId':_0x5d28cc['body'][_0xf282('0x61')],'read1stAt':_[_0xf282('0x65')](_0x358f20[_0xf282('0x66')])?moment()['format'](_0xf282('0x60')):undefined});}return null;})[_0xf282('0x36')](function(_0x3021b9){if(_0x3021b9){_0x30c7a5[_0xf282('0x67')]=_0x3021b9[_0xf282('0x64')]({'plain':!![]});interaction_log[_0xf282('0x22')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d28cc['user']['id'],_0x5d28cc[_0xf282('0x62')][_0xf282('0x38')],_0x5d28cc[_0xf282('0x62')][_0xf282('0x68')],_0x30c7a5[_0xf282('0x67')]['id'],_0x5d28cc[_0xf282('0x58')]?JSON['stringify'](_0x5d28cc[_0xf282('0x58')]):_0xf282('0x69'));return respondWithRpcPromise(_0xf282('0x6a'),_0xf282('0x6b'),_0x30c7a5);}return null;})[_0xf282('0x36')](function(_0x22f2f6){var _0x33a92e=_0xf282('0x6c')+_0x22f2f6[_0xf282('0x28')]['ContactId'];return db[_0xf282('0x6d')][_0xf282('0x40')](_0x33a92e,{'type':db[_0xf282('0x6e')]['QueryTypes'][_0xf282('0x6f')],'raw':!![]})[_0xf282('0x36')](function(_0x1ce78b){return _0x1ce78b;});})[_0xf282('0x36')](function(_0xf5bca){if(_0xf5bca){_0x30c7a5[_0xf282('0x28')][_0xf282('0x70')]=_0xf5bca[0x0];if(!_0x5d28cc[_0xf282('0x58')][_0xf282('0x61')])return;return db[_0xf282('0x71')]['find']({'where':{'id':_0x5d28cc['body'][_0xf282('0x61')],'role':_0xf282('0x63')},'attributes':['id',_0xf282('0x38'),_0xf282('0x72'),_0xf282('0x73'),_0xf282('0x74')],'raw':!![]});}return null;})[_0xf282('0x36')](function(_0x3f874a){if(!_0x3f874a)return null;_0x30c7a5[_0xf282('0x28')]['agent']=_0x3f874a;return _0x30c7a5;})['then'](function(_0xd1796f){if(_0xd1796f){if(_0x5d28cc[_0xf282('0x58')]['manual']){_0x30c7a5[_0xf282('0x28')][_0xf282('0x75')]=util[_0xf282('0x76')](_0xf282('0x77'),_0x5d28cc[_0xf282('0x62')][_0xf282('0x38')]);_0x30c7a5['message'][_0xf282('0x78')]=_0x30c7a5[_0xf282('0x78')];_0x30c7a5[_0xf282('0x28')][_0xf282('0x79')]=_0x30c7a5[_0xf282('0x78')];_0x30c7a5[_0xf282('0x28')][_0xf282('0x7a')]=_0xf282('0x5c');return respondWithRpcPromise(_0xf282('0x7b'),_0xf282('0x7b'),{'event':_0xf282('0x7c'),'message':_0x30c7a5[_0xf282('0x28')]},client9002)[_0xf282('0x36')](function(){return _0x30c7a5;});}return _0x30c7a5;}return null;})[_0xf282('0x36')](respondWithResult(_0x5bad22,null))[_0xf282('0x52')](handleError(_0x5bad22,null));};var interaction_log=require('../../config/logger')(_0xf282('0x5b'));exports[_0xf282('0x33')]=function(_0xc7a03b,_0x2f9a8c,_0x4043d5){var _0x39e03a={'agent':{},'channel':_0xf282('0x5d')};if(_0xc7a03b[_0xf282('0x58')]['id']){delete _0xc7a03b[_0xf282('0x58')]['id'];}_0xc7a03b['body'][_0xf282('0x61')]=_0xc7a03b[_0xf282('0x58')][_0xf282('0x61')]||_0xc7a03b[_0xf282('0x62')]['id'];_0x39e03a[_0xf282('0x63')]['id']=_0xc7a03b[_0xf282('0x58')][_0xf282('0x61')];return db[_0xf282('0x50')][_0xf282('0x59')]({'where':{'id':_0xc7a03b[_0xf282('0x54')]['id'],'UserId':null}})[_0xf282('0x36')](handleEntityNotFound(_0x2f9a8c,null))[_0xf282('0x36')](function(_0x7ffd84){if(_0x7ffd84){_0x39e03a[_0xf282('0x28')]=_0x7ffd84[_0xf282('0x64')]({'plain':!![]});return db[_0xf282('0x7d')]['find']({'where':{'id':_0x7ffd84['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2f9a8c,null))[_0xf282('0x36')](function(_0x48790e){if(_0x48790e){_0x39e03a['interaction']=_0x48790e[_0xf282('0x64')]({'plain':!![]});interaction_log[_0xf282('0x22')](_0xf282('0x7e'),_0xc7a03b['user']['id'],_0xc7a03b[_0xf282('0x62')][_0xf282('0x38')],_0xc7a03b[_0xf282('0x62')][_0xf282('0x68')],_0x39e03a['interaction']['id'],_0xc7a03b['body']?JSON[_0xf282('0x7f')](_0xc7a03b['body']):_0xf282('0x69'));return respondWithRpcPromise('RejectMessage',_0xf282('0x80'),_0x39e03a);}return null;})[_0xf282('0x36')](function(_0x5d1016){var _0x19683f=_0xf282('0x6c')+_0x5d1016[_0xf282('0x28')][_0xf282('0x81')];return db['sequelize'][_0xf282('0x40')](_0x19683f,{'type':db[_0xf282('0x6e')][_0xf282('0x82')][_0xf282('0x6f')],'raw':!![]})['then'](function(_0x28acb5){return _0x28acb5;});})[_0xf282('0x36')](function(_0xadf06f){if(_0xadf06f){_0x39e03a['message']['contact']=_0xadf06f[0x0];if(!_0xc7a03b[_0xf282('0x58')][_0xf282('0x61')])return;return db[_0xf282('0x71')][_0xf282('0x59')]({'where':{'id':_0xc7a03b[_0xf282('0x58')][_0xf282('0x61')],'role':_0xf282('0x63')},'attributes':['id',_0xf282('0x38'),_0xf282('0x72'),_0xf282('0x73'),_0xf282('0x74')],'raw':!![]});}return null;})['then'](function(_0x5249af){if(!_0x5249af)return null;_0x39e03a[_0xf282('0x28')]['agent']=_0x5249af;return _0x39e03a;})['then'](function(_0x365111){if(_0x365111){_0x365111['message'][_0xf282('0x75')]=util[_0xf282('0x76')]('SIP/%s',_0xc7a03b[_0xf282('0x62')]['name']);_0x365111[_0xf282('0x28')][_0xf282('0x78')]=_0x39e03a[_0xf282('0x78')];_0x365111[_0xf282('0x28')][_0xf282('0x79')]=_0x39e03a[_0xf282('0x78')];_0x365111[_0xf282('0x28')][_0xf282('0x7a')]=_0xf282('0x33');respondWithRpcPromise(_0xf282('0x7b'),_0xf282('0x7b'),{'event':_0xf282('0x83'),'message':_0x365111[_0xf282('0x28')]},client9002);return _0x39e03a;}return null;})[_0xf282('0x36')](respondWithResult(_0x2f9a8c,null))[_0xf282('0x52')](handleError(_0x2f9a8c,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 6c6583a..474f857 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 _0xfe80=['setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x160bd7,_0x4b9a11){var _0x319116=function(_0x3517c5){while(--_0x3517c5){_0x160bd7['push'](_0x160bd7['shift']());}};_0x319116(++_0x4b9a11);}(_0xfe80,0x1a3));var _0x0fe8=function(_0x141ed8,_0x5cfe0f){_0x141ed8=_0x141ed8-0x0;var _0x3a648c=_0xfe80[_0x141ed8];return _0x3a648c;};'use strict';var EventEmitter=require(_0x0fe8('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x0fe8('0x1')](0x0);var events={'afterCreate':_0x0fe8('0x2'),'afterUpdate':_0x0fe8('0x3'),'afterDestroy':_0x0fe8('0x4')};function emitEvent(_0x20a66c){return function(_0x3c0dc0,_0x273387,_0x5e061a){OpenchannelMessageEvents[_0x0fe8('0x5')](_0x20a66c+':'+_0x3c0dc0['id'],_0x3c0dc0);OpenchannelMessageEvents[_0x0fe8('0x5')](_0x20a66c,_0x3c0dc0);_0x5e061a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x0fe8('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x8f39=['OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x41a60a,_0x3c6c89){var _0x3b7964=function(_0x2fcd0c){while(--_0x2fcd0c){_0x41a60a['push'](_0x41a60a['shift']());}};_0x3b7964(++_0x3c6c89);}(_0x8f39,0x1cb));var _0x98f3=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x8f39[_0x32f7d7];return _0x133d09;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x98f3('0x0'))['db'][_0x98f3('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x98f3('0x2')](0x0);var events={'afterCreate':_0x98f3('0x3'),'afterUpdate':_0x98f3('0x4'),'afterDestroy':_0x98f3('0x5')};function emitEvent(_0x275647){return function(_0x39a3af,_0xd52d51,_0x5f1469){OpenchannelMessageEvents['emit'](_0x275647+':'+_0x39a3af['id'],_0x39a3af);OpenchannelMessageEvents[_0x98f3('0x6')](_0x275647,_0x39a3af);_0x5f1469(null);};}for(var e in events){if(events[_0x98f3('0x7')](e)){var event=events[e];OpenchannelMessage[_0x98f3('0x8')](e,emitEvent(event));}}module[_0x98f3('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 2f39a83..4246bec 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 _0x7e5d=['GET','POST','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','utf8mb4','utf8mb4_unicode_ci','lodash','moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','UserId','findOne','OpenchannelInteractionId','then','createdAt','catch','error','secret','describe','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','Contact','method'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x7e5d,0x128));var _0xd7e5=function(_0x24d683,_0x1ac495){_0x24d683=_0x24d683-0x0;var _0x156b11=_0x7e5d[_0x24d683];return _0x156b11;};'use strict';var _=require(_0xd7e5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd7e5('0x1'));var BPromise=require('bluebird');var rp=require(_0xd7e5('0x2'));var fs=require('fs');var path=require(_0xd7e5('0x3'));var rimraf=require(_0xd7e5('0x4'));var config=require(_0xd7e5('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0xd7e5('0x6')]=function(_0x5dd706,_0x38eb60){return _0x5dd706[_0xd7e5('0x7')](_0xd7e5('0x8'),attributes,{'tableName':_0xd7e5('0x9'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xd7e5('0xa')],'type':_0xd7e5('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f640e,_0x147d0b,_0x24c49e){var _0x326fdc=_0x5dd706[_0xd7e5('0xc')];var _0x1f04de=_0x4f640e[_0xd7e5('0xd')]({'plain':!![]});if(_0x1f04de[_0xd7e5('0xe')][_0xd7e5('0xf')]()==='in'||_0x1f04de[_0xd7e5('0xe')]['toLowerCase']()===_0xd7e5('0x10')&&!_0x1f04de['secret']&&!_['isNil'](_0x1f04de[_0xd7e5('0x11')])){_0x326fdc['OpenchannelInteraction'][_0xd7e5('0x12')]({'where':{'id':_0x1f04de[_0xd7e5('0x13')]}})[_0xd7e5('0x14')](function(_0x335c48){if(_0x335c48){_0x335c48['update']({'lastMsgAt':_0x1f04de[_0xd7e5('0x15')],'lastMsgDirection':_0x1f04de[_0xd7e5('0xe')][_0xd7e5('0xf')]()});}})[_0xd7e5('0x16')](function(_0x4a86b9){console[_0xd7e5('0x17')](_0x4a86b9);});}if(_0x1f04de['direction']==='out'&&!_0x1f04de[_0xd7e5('0x18')]){var _0x606af5;_0x326fdc['CmContact'][_0xd7e5('0x19')]()[_0xd7e5('0x14')](function(_0x25ffe4){return _0x326fdc['OpenchannelAccount']['find']({'where':{'id':_0x1f04de[_0xd7e5('0x1a')]},'include':[{'model':_0x326fdc[_0xd7e5('0x1b')],'as':_0xd7e5('0x1c'),'where':{'id':_0x1f04de[_0xd7e5('0x13')]},'limit':0x1,'include':[{'model':_0x326fdc[_0xd7e5('0x1d')],'as':'Contact','attributes':_['keys'](_0x25ffe4)}]}]});})[_0xd7e5('0x14')](function(_0x3f0275){_0x606af5=_0x3f0275['get']({'plain':!![]});if(_0x606af5&&_0x606af5['replyUri']){logger[_0xd7e5('0x1e')]('OpenchannelMessage,\x20%s,\x20%s',_0xd7e5('0x1f'),util[_0xd7e5('0x20')](_0xd7e5('0x21'),_0x1f04de['id'],_0x606af5[_0xd7e5('0x22')]));if(_0x606af5[_0xd7e5('0x1c')]&&_0x606af5[_0xd7e5('0x1c')][_0xd7e5('0x23')]){_0x1f04de[_0xd7e5('0x24')]=_[_0xd7e5('0x25')](_0x606af5[_0xd7e5('0x1c')][0x0],_0xd7e5('0x26'));_0x1f04de[_0xd7e5('0x26')]=_0x606af5[_0xd7e5('0x1c')][0x0][_0xd7e5('0x26')];}var _0x147d0b={'method':'POST','uri':encodeURI(_0x606af5[_0xd7e5('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x147d0b[_0xd7e5('0x27')]){case _0xd7e5('0x28'):_0x147d0b['qs']=_0x1f04de;break;case _0xd7e5('0x29'):_0x147d0b[_0xd7e5('0xa')]=_0x1f04de;break;}return rp(_0x147d0b)['then'](function(_0xa1fc37){logger[_0xd7e5('0x1e')](_0xd7e5('0x2a'),'afterCreate',util['format'](_0xd7e5('0x2b'),_0x1f04de['id'],_0x606af5[_0xd7e5('0x22')]));if(_0xa1fc37['body'][_0xd7e5('0x2c')]&&_0xa1fc37[_0xd7e5('0xa')][_0xd7e5('0x2c')]!=_0x1f04de[_0xd7e5('0x24')]['threadId']){return _0x326fdc[_0xd7e5('0x1b')][_0xd7e5('0x2d')]({'threadId':_0xa1fc37[_0xd7e5('0xa')]['threadId']},{'where':{'id':_0x1f04de[_0xd7e5('0x24')]['id']}});}else{return;}})[_0xd7e5('0x14')](function(){return _0x4f640e[_0xd7e5('0x2d')]({'read':!![]});})[_0xd7e5('0x16')](function(_0x2bde22){logger[_0xd7e5('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0xd7e5('0x1f'),util['inspect'](_0x2bde22,{'showHidden':![],'depth':null}));_0x24c49e();});}else{_0x24c49e();}})['finally'](function(){_0x24c49e();});}else{_0x24c49e();}}},'charset':_0xd7e5('0x2e'),'collate':_0xd7e5('0x2f')});}; \ No newline at end of file +var _0xc132=['CmContact','describe','find','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','replyUri','Interaction','omit','POST','method','GET','body','format','threadId','OpenchannelInteraction','catch','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','error'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xc132,0x1d9));var _0x2c13=function(_0x1fa8e8,_0x40ba7f){_0x1fa8e8=_0x1fa8e8-0x0;var _0x11b333=_0xc132[_0x1fa8e8];return _0x11b333;};'use strict';var _=require(_0x2c13('0x0'));var util=require(_0x2c13('0x1'));var logger=require(_0x2c13('0x2'))(_0x2c13('0x3'));var moment=require(_0x2c13('0x4'));var BPromise=require(_0x2c13('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c13('0x6'));var rimraf=require(_0x2c13('0x7'));var config=require(_0x2c13('0x8'));var attributes=require(_0x2c13('0x9'));module[_0x2c13('0xa')]=function(_0x2a0547,_0x4f1b21){return _0x2a0547['define'](_0x2c13('0xb'),attributes,{'tableName':_0x2c13('0xc'),'paranoid':![],'indexes':[{'name':_0x2c13('0xd'),'fields':['body'],'type':_0x2c13('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x21c4d0,_0x558cbb,_0x4a91bf){var _0x514fcd=_0x2a0547['models'];var _0x1e7df3=_0x21c4d0[_0x2c13('0xf')]({'plain':!![]});if(_0x1e7df3[_0x2c13('0x10')][_0x2c13('0x11')]()==='in'||_0x1e7df3[_0x2c13('0x10')][_0x2c13('0x11')]()===_0x2c13('0x12')&&!_0x1e7df3['secret']&&!_[_0x2c13('0x13')](_0x1e7df3[_0x2c13('0x14')])){_0x514fcd['OpenchannelInteraction'][_0x2c13('0x15')]({'where':{'id':_0x1e7df3[_0x2c13('0x16')]}})[_0x2c13('0x17')](function(_0x1d5b1f){if(_0x1d5b1f){_0x1d5b1f[_0x2c13('0x18')]({'lastMsgAt':_0x1e7df3[_0x2c13('0x19')],'lastMsgDirection':_0x1e7df3['direction']['toLowerCase']()});}})['catch'](function(_0x2a1ac7){console[_0x2c13('0x1a')](_0x2a1ac7);});}if(_0x1e7df3['direction']===_0x2c13('0x12')&&!_0x1e7df3['secret']){var _0x52fbd2;_0x514fcd[_0x2c13('0x1b')][_0x2c13('0x1c')]()[_0x2c13('0x17')](function(_0x565243){return _0x514fcd['OpenchannelAccount'][_0x2c13('0x1d')]({'where':{'id':_0x1e7df3['OpenchannelAccountId']},'include':[{'model':_0x514fcd['OpenchannelInteraction'],'as':_0x2c13('0x1e'),'where':{'id':_0x1e7df3['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x514fcd[_0x2c13('0x1b')],'as':_0x2c13('0x1f'),'attributes':_[_0x2c13('0x20')](_0x565243)}]}]});})[_0x2c13('0x17')](function(_0x4bd863){_0x52fbd2=_0x4bd863[_0x2c13('0xf')]({'plain':!![]});if(_0x52fbd2&&_0x52fbd2['replyUri']){logger[_0x2c13('0x21')](_0x2c13('0x22'),_0x2c13('0x23'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x1e7df3['id'],_0x52fbd2[_0x2c13('0x24')]));if(_0x52fbd2['Interactions']&&_0x52fbd2[_0x2c13('0x1e')]['length']){_0x1e7df3[_0x2c13('0x25')]=_[_0x2c13('0x26')](_0x52fbd2[_0x2c13('0x1e')][0x0],'Contact');_0x1e7df3[_0x2c13('0x1f')]=_0x52fbd2[_0x2c13('0x1e')][0x0][_0x2c13('0x1f')];}var _0x558cbb={'method':_0x2c13('0x27'),'uri':encodeURI(_0x52fbd2['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x558cbb[_0x2c13('0x28')]){case _0x2c13('0x29'):_0x558cbb['qs']=_0x1e7df3;break;case _0x2c13('0x27'):_0x558cbb[_0x2c13('0x2a')]=_0x1e7df3;break;}return rp(_0x558cbb)[_0x2c13('0x17')](function(_0x3dea00){logger[_0x2c13('0x21')](_0x2c13('0x22'),_0x2c13('0x23'),util[_0x2c13('0x2b')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x1e7df3['id'],_0x52fbd2[_0x2c13('0x24')]));if(_0x3dea00[_0x2c13('0x2a')][_0x2c13('0x2c')]&&_0x3dea00['body'][_0x2c13('0x2c')]!=_0x1e7df3['Interaction'][_0x2c13('0x2c')]){return _0x514fcd[_0x2c13('0x2d')][_0x2c13('0x18')]({'threadId':_0x3dea00[_0x2c13('0x2a')][_0x2c13('0x2c')]},{'where':{'id':_0x1e7df3[_0x2c13('0x25')]['id']}});}else{return;}})[_0x2c13('0x17')](function(){return _0x21c4d0[_0x2c13('0x18')]({'read':!![]});})[_0x2c13('0x2e')](function(_0x31282e){logger[_0x2c13('0x1a')](_0x2c13('0x22'),_0x2c13('0x23'),util[_0x2c13('0x2f')](_0x31282e,{'showHidden':![],'depth':null}));_0x4a91bf();});}else{_0x4a91bf();}})['finally'](function(){_0x4a91bf();});}else{_0x4a91bf();}}},'charset':_0x2c13('0x30'),'collate':_0x2c13('0x31')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 0261371..c3ab91a 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(_0x2e6fe5,_0x30c233){var _0x231909=function(_0x441d93){while(--_0x441d93){_0x2e6fe5['push'](_0x2e6fe5['shift']());}};_0x231909(++_0x30c233);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'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(_0x37c0f6,_0x2ca911){var _0x533eb1=function(_0x4921c9){while(--_0x4921c9){_0x37c0f6['push'](_0x37c0f6['shift']());}};_0x533eb1(++_0x2ca911);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'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 8796a2f..a624507 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 _0xe132=['remove','update','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x7ab2dc,_0x176ed4){var _0x534aad=function(_0x2eebb1){while(--_0x2eebb1){_0x7ab2dc['push'](_0x7ab2dc['shift']());}};_0x534aad(++_0x176ed4);}(_0xe132,0x162));var _0x2e13=function(_0x399fcf,_0x2e2bbb){_0x399fcf=_0x399fcf-0x0;var _0x4dfcc1=_0xe132[_0x399fcf];return _0x4dfcc1;};'use strict';var OpenchannelMessageEvents=require(_0x2e13('0x0'));var events=['save',_0x2e13('0x1'),_0x2e13('0x2')];function createListener(_0x21dfef,_0x2c2bdd){return function(_0x2a5250){_0x2c2bdd['emit'](_0x21dfef,_0x2a5250);};}function removeListener(_0x1ae6a9,_0x3f01fe){return function(){OpenchannelMessageEvents['removeListener'](_0x1ae6a9,_0x3f01fe);};}exports['register']=function(_0x260dc1){for(var _0x2f9d00=0x0,_0x1c670b=events[_0x2e13('0x3')];_0x2f9d00<_0x1c670b;_0x2f9d00++){var _0x3be5dc=events[_0x2f9d00];var _0x2d9487=createListener(_0x2e13('0x4')+_0x3be5dc,_0x260dc1);OpenchannelMessageEvents['on'](_0x3be5dc,_0x2d9487);}}; \ No newline at end of file +var _0xaa9d=['length','openchannelMessage:','./openchannelMessage.events','save','remove','update','removeListener','register'];(function(_0xa0ed9f,_0x4f90f7){var _0x50c7b2=function(_0x235d29){while(--_0x235d29){_0xa0ed9f['push'](_0xa0ed9f['shift']());}};_0x50c7b2(++_0x4f90f7);}(_0xaa9d,0x1aa));var _0xdaa9=function(_0x458310,_0x1b3e42){_0x458310=_0x458310-0x0;var _0x167665=_0xaa9d[_0x458310];return _0x167665;};'use strict';var OpenchannelMessageEvents=require(_0xdaa9('0x0'));var events=[_0xdaa9('0x1'),_0xdaa9('0x2'),_0xdaa9('0x3')];function createListener(_0x1672d7,_0x47edb9){return function(_0x5de669){_0x47edb9['emit'](_0x1672d7,_0x5de669);};}function removeListener(_0x5cd202,_0x3579e6){return function(){OpenchannelMessageEvents[_0xdaa9('0x4')](_0x5cd202,_0x3579e6);};}exports[_0xdaa9('0x5')]=function(_0x1472da){for(var _0x49ff8d=0x0,_0x548aee=events[_0xdaa9('0x6')];_0x49ff8d<_0x548aee;_0x49ff8d++){var _0x389004=events[_0x49ff8d];var _0x394817=createListener(_0xdaa9('0x7')+_0x389004,_0x1472da);OpenchannelMessageEvents['on'](_0x389004,_0x394817);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 8950c48..67e5358 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 _0x9450=['update','delete','/:id/users','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','show','getMembers','/:id/teams','getAgents','post','create','addTeams','addAgents','put','/:id'];(function(_0x207bcc,_0x23b059){var _0x236f9e=function(_0x48bac8){while(--_0x48bac8){_0x207bcc['push'](_0x207bcc['shift']());}};_0x236f9e(++_0x23b059);}(_0x9450,0x6f));var _0x0945=function(_0x4126b9,_0x5087cd){_0x4126b9=_0x4126b9-0x0;var _0x4ff625=_0x9450[_0x4126b9];return _0x4ff625;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0945('0x0'));var timeout=require(_0x0945('0x1'));var express=require(_0x0945('0x2'));var router=express[_0x0945('0x3')]();var fs_extra=require(_0x0945('0x4'));var auth=require(_0x0945('0x5'));var interaction=require(_0x0945('0x6'));var config=require(_0x0945('0x7'));var controller=require(_0x0945('0x8'));router[_0x0945('0x9')]('/',auth[_0x0945('0xa')](),controller[_0x0945('0xb')]);router[_0x0945('0x9')](_0x0945('0xc'),auth[_0x0945('0xa')](),controller[_0x0945('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0945('0xe')]);router[_0x0945('0x9')]('/:id/members',auth[_0x0945('0xa')](),controller[_0x0945('0xf')]);router[_0x0945('0x9')](_0x0945('0x10'),auth[_0x0945('0xa')](),controller['getTeams']);router['get']('/:id/users',auth[_0x0945('0xa')](),controller[_0x0945('0x11')]);router[_0x0945('0x12')]('/',auth[_0x0945('0xa')](),controller[_0x0945('0x13')]);router[_0x0945('0x12')](_0x0945('0x10'),auth[_0x0945('0xa')](),controller[_0x0945('0x14')]);router[_0x0945('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x0945('0x15')]);router[_0x0945('0x16')](_0x0945('0x17'),auth[_0x0945('0xa')](),controller[_0x0945('0x18')]);router[_0x0945('0x19')](_0x0945('0x17'),auth['isAuthenticated'](),controller['destroy']);router[_0x0945('0x19')](_0x0945('0x10'),auth[_0x0945('0xa')](),controller['removeTeams']);router[_0x0945('0x19')](_0x0945('0x1a'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x5462=['isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','getTeams','getAgents','post','create','addTeams','addAgents','put','delete','/:id/teams','removeTeams','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get'];(function(_0x399bbc,_0x41010d){var _0x491c8a=function(_0x246f8b){while(--_0x246f8b){_0x399bbc['push'](_0x399bbc['shift']());}};_0x491c8a(++_0x41010d);}(_0x5462,0x19a));var _0x2546=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0x5462[_0x5ef905];return _0x367808;};'use strict';var multer=require(_0x2546('0x0'));var util=require(_0x2546('0x1'));var path=require(_0x2546('0x2'));var timeout=require(_0x2546('0x3'));var express=require('express');var router=express[_0x2546('0x4')]();var fs_extra=require(_0x2546('0x5'));var auth=require(_0x2546('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2546('0x7'));var controller=require(_0x2546('0x8'));router[_0x2546('0x9')]('/',auth[_0x2546('0xa')](),controller[_0x2546('0xb')]);router[_0x2546('0x9')](_0x2546('0xc'),auth[_0x2546('0xa')](),controller[_0x2546('0xd')]);router[_0x2546('0x9')](_0x2546('0xe'),auth[_0x2546('0xa')](),controller['show']);router[_0x2546('0x9')](_0x2546('0xf'),auth[_0x2546('0xa')](),controller[_0x2546('0x10')]);router['get']('/:id/teams',auth[_0x2546('0xa')](),controller[_0x2546('0x11')]);router[_0x2546('0x9')]('/:id/users',auth[_0x2546('0xa')](),controller[_0x2546('0x12')]);router[_0x2546('0x13')]('/',auth[_0x2546('0xa')](),controller[_0x2546('0x14')]);router['post']('/:id/teams',auth[_0x2546('0xa')](),controller[_0x2546('0x15')]);router[_0x2546('0x13')]('/:id/users',auth[_0x2546('0xa')](),controller[_0x2546('0x16')]);router[_0x2546('0x17')](_0x2546('0xe'),auth[_0x2546('0xa')](),controller['update']);router[_0x2546('0x18')](_0x2546('0xe'),auth[_0x2546('0xa')](),controller['destroy']);router['delete'](_0x2546('0x19'),auth[_0x2546('0xa')](),controller[_0x2546('0x1a')]);router[_0x2546('0x18')](_0x2546('0x1b'),auth['isAuthenticated'](),controller[_0x2546('0x1c')]);module[_0x2546('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index c111be7..1e9093a 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 _0xfbf7=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0xfbf7,0xff));var _0x7fbf=function(_0x59b159,_0x38ebb1){_0x59b159=_0x59b159-0x0;var _0x425692=_0xfbf7[_0x59b159];return _0x425692;};'use strict';var Sequelize=require(_0x7fbf('0x0'));module[_0x7fbf('0x1')]={'name':{'type':Sequelize[_0x7fbf('0x2')],'unique':_0x7fbf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7fbf('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7fbf('0x5')](_0x7fbf('0x6'),_0x7fbf('0x7'),_0x7fbf('0x8'))}}; \ No newline at end of file +var _0x35bc=['name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x35bc,0x139));var _0xc35b=function(_0x1a51db,_0x2eecdc){_0x1a51db=_0x1a51db-0x0;var _0xea0473=_0x35bc[_0x1a51db];return _0xea0473;};'use strict';var Sequelize=require(_0xc35b('0x0'));module[_0xc35b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc35b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc35b('0x3')](_0xc35b('0x4'),_0xc35b('0x5'),_0xc35b('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index d2d5bee..041d556 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 _0xdeaa=['update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','catch','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','nolimit','sort','filter','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','order','pick','addTeams','ids','Team','Agents','voicePause','flatMap','transaction','each','UserOpenchannelQueue','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x1dcb69,_0x314902){var _0x1ae3b6=function(_0x5e4013){while(--_0x5e4013){_0x1dcb69['push'](_0x1dcb69['shift']());}};_0x1ae3b6(++_0x314902);}(_0xdeaa,0x150));var _0xadea=function(_0xe5844a,_0x3a9180){_0xe5844a=_0xe5844a-0x0;var _0x3bbf18=_0xdeaa[_0xe5844a];return _0x3bbf18;};'use strict';var BPromise=require(_0xadea('0x0'));var util=require(_0xadea('0x1'));var _=require(_0xadea('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0xadea('0x3'));var logger=require('../../config/logger')(_0xadea('0x4'));var config=require(_0xadea('0x5'));var db=require(_0xadea('0x6'))['db'];config['redis']=_['defaults'](config[_0xadea('0x7')],{'host':_0xadea('0x8'),'port':0x18eb});var socket=require(_0xadea('0x9'))(new Redis(config[_0xadea('0x7')]));require(_0xadea('0xa'))[_0xadea('0xb')](socket);function respondWithStatusCode(_0x1701c4,_0x423764){_0x423764=_0x423764||0xcc;return function(_0x15408){if(_0x15408){return _0x1701c4[_0xadea('0xc')](_0x423764);}return _0x1701c4['status'](_0x423764)[_0xadea('0xd')]();};}function respondWithResult(_0x60a304,_0x1a7904){_0x1a7904=_0x1a7904||0xc8;return function(_0x44ba75){if(_0x44ba75){return _0x60a304[_0xadea('0xe')](_0x1a7904)[_0xadea('0xf')](_0x44ba75);}};}function respondWithFilteredResult(_0x40c0f8,_0x5f9245){return function(_0x2f0af4){if(_0x2f0af4){var _0x33eedc=typeof _0x5f9245[_0xadea('0x10')]===_0xadea('0x11')&&typeof _0x5f9245[_0xadea('0x12')]===_0xadea('0x11');var _0x2e837b=_0x2f0af4['count'];var _0x27435b=_0x33eedc?0x0:_0x5f9245['offset'];var _0x359a5e=_0x33eedc?_0x2f0af4[_0xadea('0x13')]:_0x5f9245[_0xadea('0x10')]+_0x5f9245[_0xadea('0x12')];var _0x4c4a6f;if(_0x359a5e>=_0x2e837b){_0x359a5e=_0x2e837b;_0x4c4a6f=0xc8;}else{_0x4c4a6f=0xce;}_0x40c0f8[_0xadea('0xe')](_0x4c4a6f);return _0x40c0f8[_0xadea('0x14')]('Content-Range',_0x27435b+'-'+_0x359a5e+'/'+_0x2e837b)[_0xadea('0xf')](_0x2f0af4);}return null;};}function saveUpdates(_0x85ee8a){return function(_0x555bdd){if(_0x555bdd){return _0x555bdd[_0xadea('0x15')](_0x85ee8a)[_0xadea('0x16')](function(_0x3e5e2d){return _0x3e5e2d;});}return null;};}function removeEntity(_0x1e1057){return function(_0x5a0d7b){if(_0x5a0d7b){return _0x5a0d7b['destroy']()[_0xadea('0x16')](function(){var _0x470769=_0x5a0d7b[_0xadea('0x17')]({'plain':!![]});var _0x5238b3='OpenchannelQueues';return db[_0xadea('0x18')][_0xadea('0x19')]({'where':{'type':_0x5238b3,'resourceId':_0x470769['id']}})[_0xadea('0x16')](function(){return _0x5a0d7b;});})['then'](function(){_0x1e1057[_0xadea('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x152b0c){return function(_0x14ceb9){if(!_0x14ceb9){_0x152b0c[_0xadea('0xc')](0x194);}return _0x14ceb9;};}function handleError(_0x1838d2,_0x8e0a9a){_0x8e0a9a=_0x8e0a9a||0x1f4;return function(_0x468ec4){logger[_0xadea('0x1a')](_0x468ec4[_0xadea('0x1b')]);if(_0x468ec4['name']){delete _0x468ec4[_0xadea('0x1c')];}_0x1838d2[_0xadea('0xe')](_0x8e0a9a)[_0xadea('0x1d')](_0x468ec4);};}exports[_0xadea('0x1e')]=function(_0x52c476,_0x20f32c){var _0x4c6bb6={};var _0x26cf12={'count':0x0,'rows':[]};var _0x50195e=_[_0xadea('0x1f')](db[_0xadea('0x20')][_0xadea('0x21')],function(_0x2648dd){return{'name':_0x2648dd[_0xadea('0x22')],'type':_0x2648dd[_0xadea('0x23')][_0xadea('0x24')]};});_0x4c6bb6=qs[_0xadea('0x25')](_0x50195e,_0x52c476);var _0x20d081={'where':_0x4c6bb6[_0xadea('0x26')]};return db['OpenchannelQueue'][_0xadea('0x13')](_0x20d081)['then'](function(_0x26e599){_0x26cf12[_0xadea('0x13')]=_0x26e599;_0x4c6bb6[_0xadea('0x27')]=qs['include'](_0x52c476[_0xadea('0x28')]);return db[_0xadea('0x20')][_0xadea('0x29')](_0x4c6bb6);})[_0xadea('0x16')](function(_0x1f5798){_0x26cf12['rows']=_0x1f5798;return _0x26cf12;})[_0xadea('0x16')](respondWithFilteredResult(_0x20f32c,_0x4c6bb6))[_0xadea('0x2a')](handleError(_0x20f32c,null));};exports['show']=function(_0x1a3477,_0x38056b){var _0x37e65b={'raw':!![],'where':{'id':_0x1a3477['params']['id']}},_0x5d7cb9={};_0x5d7cb9[_0xadea('0x2b')]=_[_0xadea('0x2c')](db['OpenchannelQueue'][_0xadea('0x21')]);_0x5d7cb9[_0xadea('0x28')]=_[_0xadea('0x2c')](_0x1a3477['query']);_0x5d7cb9[_0xadea('0x2d')]=_[_0xadea('0x2e')](_0x5d7cb9['model'],_0x5d7cb9[_0xadea('0x28')]);_0x37e65b['attributes']=_[_0xadea('0x2e')](_0x5d7cb9['model'],qs[_0xadea('0x2f')](_0x1a3477['query'][_0xadea('0x2f')]));_0x37e65b[_0xadea('0x30')]=_0x37e65b['attributes'][_0xadea('0x31')]?_0x37e65b[_0xadea('0x30')]:_0x5d7cb9[_0xadea('0x2b')];if(_0x1a3477[_0xadea('0x28')][_0xadea('0x32')]){_0x37e65b['include']=[{'all':!![]}];}_0x37e65b=_[_0xadea('0x33')]({},_0x37e65b,_0x1a3477[_0xadea('0x34')]);return db['OpenchannelQueue'][_0xadea('0x35')](_0x37e65b)[_0xadea('0x16')](handleEntityNotFound(_0x38056b,null))['then'](respondWithResult(_0x38056b,null))[_0xadea('0x2a')](handleError(_0x38056b,null));};exports['create']=function(_0x1a8739,_0x269e09){return db[_0xadea('0x20')][_0xadea('0x36')](_0x1a8739[_0xadea('0x37')],{})[_0xadea('0x16')](function(_0x1878b2){var _0x8a9027=_0x1a8739[_0xadea('0x38')][_0xadea('0x17')]({'plain':!![]});if(!_0x8a9027)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8a9027[_0xadea('0x39')]===_0xadea('0x38')){var _0x5e6cac=_0x1878b2[_0xadea('0x17')]({'plain':!![]});var _0x2590e4='OpenchannelQueues';return db[_0xadea('0x3a')][_0xadea('0x35')]({'where':{'name':_0x2590e4,'userProfileId':_0x8a9027['userProfileId']},'raw':!![]})[_0xadea('0x16')](function(_0x90deec){if(_0x90deec&&_0x90deec[_0xadea('0x3b')]===0x0){return db['UserProfileResource'][_0xadea('0x36')]({'name':_0x5e6cac['name'],'resourceId':_0x5e6cac['id'],'type':_0x90deec['name'],'sectionId':_0x90deec['id']},{})['then'](function(){return _0x1878b2;});}else{return _0x1878b2;}})[_0xadea('0x2a')](function(_0x2a1f9c){logger[_0xadea('0x1a')](_0xadea('0x3c'),_0x2a1f9c);throw _0x2a1f9c;});}return _0x1878b2;})[_0xadea('0x16')](respondWithResult(_0x269e09,0xc9))[_0xadea('0x2a')](handleError(_0x269e09,null));};exports[_0xadea('0x15')]=function(_0x2cf382,_0x35d642){if(_0x2cf382[_0xadea('0x37')]['id']){delete _0x2cf382[_0xadea('0x37')]['id'];}return db[_0xadea('0x20')]['find']({'where':{'id':_0x2cf382[_0xadea('0x3d')]['id']}})[_0xadea('0x16')](handleEntityNotFound(_0x35d642,null))[_0xadea('0x16')](saveUpdates(_0x2cf382[_0xadea('0x37')],null))[_0xadea('0x16')](respondWithResult(_0x35d642,null))['catch'](handleError(_0x35d642,null));};exports[_0xadea('0x19')]=function(_0x54a4d0,_0x4791db){return db[_0xadea('0x20')][_0xadea('0x35')]({'where':{'id':_0x54a4d0[_0xadea('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4791db,null))['then'](removeEntity(_0x4791db,null))[_0xadea('0x2a')](handleError(_0x4791db,null));};exports[_0xadea('0x3e')]=function(_0x5f1da8,_0x37cfa4){return db['OpenchannelQueue']['describe']()['then'](respondWithResult(_0x37cfa4,null))[_0xadea('0x2a')](handleError(_0x37cfa4,null));};exports['getMembers']=function(_0x3a20ca,_0x326171){var _0x2d0dfd={'raw':!![],'where':{}},_0x488525={},_0x2e4070;return db[_0xadea('0x20')][_0xadea('0x3f')]({'where':{'id':_0x3a20ca[_0xadea('0x3d')]['id']}})[_0xadea('0x16')](handleEntityNotFound(_0x326171,null))['then'](function(_0x291769){if(_0x291769){_0x2e4070=_0x291769[_0xadea('0x17')]({'plain':!![]});_0x488525[_0xadea('0x2b')]=_[_0xadea('0x2c')](db['UserOpenchannelQueue'][_0xadea('0x21')]);_0x488525[_0xadea('0x28')]=_[_0xadea('0x2c')](_0x3a20ca['query']);_0x488525[_0xadea('0x2d')]=_[_0xadea('0x2e')](_0x488525[_0xadea('0x2b')],_0x488525['query']);_0x2d0dfd[_0xadea('0x30')]=_['intersection'](_0x488525['model'],qs['fields'](_0x3a20ca[_0xadea('0x28')][_0xadea('0x2f')]));_0x2d0dfd[_0xadea('0x30')]=_0x2d0dfd[_0xadea('0x30')][_0xadea('0x31')]?_0x2d0dfd[_0xadea('0x30')]:_0x488525[_0xadea('0x2b')];if(!_0x3a20ca[_0xadea('0x28')]['hasOwnProperty'](_0xadea('0x40'))){_0x2d0dfd['limit']=qs[_0xadea('0x12')](_0x3a20ca[_0xadea('0x28')][_0xadea('0x12')]);_0x2d0dfd['offset']=qs['offset'](_0x3a20ca[_0xadea('0x28')][_0xadea('0x10')]);}_0x2d0dfd['order']=qs[_0xadea('0x41')](_0x3a20ca[_0xadea('0x28')][_0xadea('0x41')]);_0x2d0dfd[_0xadea('0x26')]=qs[_0xadea('0x2d')](_['pick'](_0x3a20ca[_0xadea('0x28')],_0x488525['filters']));_0x2d0dfd['where']['OpenchannelQueueId']=_0x291769['id'];if(_0x3a20ca['query'][_0xadea('0x42')]){_0x2d0dfd[_0xadea('0x26')]=_[_0xadea('0x33')](_0x2d0dfd['where'],{'$or':_[_0xadea('0x1f')](_0x2d0dfd[_0xadea('0x30')],function(_0xe0e995){var _0x1c8a81={};_0x1c8a81[_0xe0e995]={'$like':'%'+_0x3a20ca[_0xadea('0x28')]['filter']+'%'};return _0x1c8a81;})});}_0x2d0dfd=_['merge']({},_0x2d0dfd,_0x3a20ca['options']);return db['UserOpenchannelQueue'][_0xadea('0x29')](_0x2d0dfd);}})['then'](function(_0x5c7e8d){if(_0x5c7e8d){return db[_0xadea('0x43')][_0xadea('0x44')]({'where':{'id':_['map'](_0x5c7e8d,_0xadea('0x45')),'role':'agent'},'attributes':['id','name',_0xadea('0x46'),_0xadea('0x47'),_0xadea('0x48')]});}})[_0xadea('0x16')](function(_0x2d1aaa){if(_0x2d1aaa){return{'count':_0x2d1aaa[_0xadea('0x13')],'rows':_[_0xadea('0x1f')](_0x2d1aaa[_0xadea('0x49')],function(_0x37d2df){return{'membername':_0x37d2df[_0xadea('0x1c')],'UserId':_0x37d2df['id'],'queue_name':_0x2e4070[_0xadea('0x1c')],'OpenchannelQueueId':_0x2e4070['id'],'interface':util[_0xadea('0x4a')](_0xadea('0x4b'),_0xadea('0x4c'),_0x37d2df[_0xadea('0x1c')]),'penalty':0x0,'paused':_0x37d2df[_0xadea('0x46')],'createdAt':_0x37d2df[_0xadea('0x48')],'updatedAt':_0x37d2df[_0xadea('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xadea('0x16')](respondWithFilteredResult(_0x326171,_0x2d0dfd))[_0xadea('0x2a')](handleError(_0x326171,null));};exports[_0xadea('0x4d')]=function(_0x3c45e3,_0x3f6498){var _0x45422d={};var _0x26d44c={};var _0xbfdf06;var _0x45a2dd;return db[_0xadea('0x20')][_0xadea('0x3f')]({'where':{'id':_0x3c45e3['params']['id']}})[_0xadea('0x16')](handleEntityNotFound(_0x3f6498,null))[_0xadea('0x16')](function(_0x5dcd91){if(_0x5dcd91){_0xbfdf06=_0x5dcd91;_0x26d44c[_0xadea('0x2b')]=_[_0xadea('0x2c')](db['Team'][_0xadea('0x21')]);_0x26d44c[_0xadea('0x28')]=_['keys'](_0x3c45e3['query']);_0x26d44c[_0xadea('0x2d')]=_['intersection'](_0x26d44c['model'],_0x26d44c[_0xadea('0x28')]);_0x45422d[_0xadea('0x30')]=_['intersection'](_0x26d44c[_0xadea('0x2b')],qs[_0xadea('0x2f')](_0x3c45e3[_0xadea('0x28')]['fields']));_0x45422d['attributes']=_0x45422d[_0xadea('0x30')]['length']?_0x45422d['attributes']:_0x26d44c[_0xadea('0x2b')];_0x45422d[_0xadea('0x4e')]=qs[_0xadea('0x41')](_0x3c45e3[_0xadea('0x28')][_0xadea('0x41')]);_0x45422d[_0xadea('0x26')]=qs[_0xadea('0x2d')](_[_0xadea('0x4f')](_0x3c45e3[_0xadea('0x28')],_0x26d44c[_0xadea('0x2d')]));if(_0x3c45e3['query']['filter']){_0x45422d[_0xadea('0x26')]=_[_0xadea('0x33')](_0x45422d[_0xadea('0x26')],{'$or':_['map'](_0x45422d[_0xadea('0x30')],function(_0x1639b9){var _0x50f314={};_0x50f314[_0x1639b9]={'$like':'%'+_0x3c45e3[_0xadea('0x28')][_0xadea('0x42')]+'%'};return _0x50f314;})});}_0x45422d=_[_0xadea('0x33')]({},_0x45422d,_0x3c45e3['options']);return _0xbfdf06[_0xadea('0x4d')](_0x45422d);}})[_0xadea('0x16')](function(_0x5c0f60){if(_0x5c0f60){_0x45a2dd=_0x5c0f60[_0xadea('0x31')];if(!_0x3c45e3[_0xadea('0x28')]['hasOwnProperty'](_0xadea('0x40'))){_0x45422d[_0xadea('0x12')]=qs['limit'](_0x3c45e3['query'][_0xadea('0x12')]);_0x45422d['offset']=qs[_0xadea('0x10')](_0x3c45e3[_0xadea('0x28')][_0xadea('0x10')]);}return _0xbfdf06[_0xadea('0x4d')](_0x45422d);}})[_0xadea('0x16')](function(_0x9f3f45){if(_0x9f3f45){return _0x9f3f45?{'count':_0x45a2dd,'rows':_0x9f3f45}:null;}})[_0xadea('0x16')](respondWithResult(_0x3f6498,null))['catch'](handleError(_0x3f6498,null));};exports[_0xadea('0x50')]=function(_0x5515f6,_0x39b4b2){var _0xcbd5ec=_0x5515f6[_0xadea('0x37')][_0xadea('0x51')];return db[_0xadea('0x52')]['findAll']({'where':{'id':_0xcbd5ec},'attributes':['id'],'include':[{'model':db[_0xadea('0x43')],'as':_0xadea('0x53'),'attributes':['id','name','online',_0xadea('0x54'),'interface'],'raw':!![]}]})[_0xadea('0x16')](function(_0x5d585b){if(_0x5d585b){var _0x2288f7=_[_0xadea('0x55')](_0x5d585b,function(_0x2469b3){var _0x37d953=_0x2469b3[_0xadea('0x17')]({'plain':!![]});return _0x37d953[_0xadea('0x53')];});return db[_0xadea('0x20')][_0xadea('0x35')]({'where':{'id':_0x5515f6['params']['id']}})['then'](function(_0x14cd6a){return db['sequelize'][_0xadea('0x56')](function(_0xa2e5af){return _0x14cd6a[_0xadea('0x50')](_0xcbd5ec,{'transaction':_0xa2e5af})[_0xadea('0x16')](function(){return BPromise[_0xadea('0x57')](_0x2288f7,function(_0x3160b6){return db[_0xadea('0x58')][_0xadea('0x59')]({'where':{'UserId':_0x3160b6['id'],'OpenchannelQueueId':_0x5515f6[_0xadea('0x3d')]['id']},'transaction':_0xa2e5af});});})[_0xadea('0x16')](function(){_0x2288f7[_0xadea('0x5a')](function(_0x2e8b67){socket[_0xadea('0x5b')](_0xadea('0x5c'),{'UserId':_0x2e8b67['id'],'OpenchannelQueueId':_0x14cd6a['id']});});});});});}})[_0xadea('0x16')](respondWithStatusCode(_0x39b4b2,null))[_0xadea('0x2a')](handleError(_0x39b4b2,null));};exports[_0xadea('0x5d')]=function(_0x1dcbc8,_0x198cb2){return db['Team'][_0xadea('0x29')]({'where':{'id':_0x1dcbc8[_0xadea('0x28')][_0xadea('0x51')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xadea('0x53'),'attributes':['id'],'raw':!![]}]})[_0xadea('0x16')](handleEntityNotFound(_0x198cb2,null))[_0xadea('0x16')](function(_0xce11cc){var _0x308fa9=_[_0xadea('0x1f')](_0xce11cc,'id');var _0x2ca09b=[];var _0x275ab8=[];var _0x29ce55=squel['select']();_0x29ce55[_0xadea('0x5e')](_0xadea('0x5f'))[_0xadea('0x60')](_0xadea('0x61'),'tq')[_0xadea('0x62')](_0xadea('0x63'),'ut',_0xadea('0x64'))[_0xadea('0x26')]('OpenchannelQueueId\x20=\x20?',_0x1dcbc8[_0xadea('0x3d')]['id']);for(var _0x133849=0x0;_0x133849<_0xce11cc[_0xadea('0x31')];_0x133849+=0x1){let _0x503196=_0xce11cc[_0x133849];for(var _0x4284d2=0x0;_0x4284d2<_0x503196[_0xadea('0x53')][_0xadea('0x31')];_0x4284d2+=0x1){let _0x3c6f3a=_0x503196['Agents'][_0x4284d2];var _0x142463=_0x29ce55['clone']();_0x142463[_0xadea('0x26')](_0xadea('0x65'),_0x3c6f3a['id']);_0x275ab8[_0xadea('0x66')](db[_0xadea('0x67')][_0xadea('0x28')](_0x142463[_0xadea('0x68')](),{'type':db[_0xadea('0x67')]['QueryTypes'][_0xadea('0x69')]})['then'](function(_0x3554d7){if(_0x3554d7[_0xadea('0x31')]===0x1){return _0x3c6f3a['id'];}else{var _0x2435d6=_[_0xadea('0x6a')](_[_0xadea('0x1f')](_0x3554d7,_0xadea('0x6b')),function(_0x2e36f6){return _[_0xadea('0x6c')](_0x308fa9,_0x2e36f6);});if(_0x2435d6){return _0x3c6f3a['id'];}}}));}}return BPromise['all'](_0x275ab8)[_0xadea('0x16')](function(_0x216333){_0x2ca09b=_(_0x2ca09b)[_0xadea('0x6d')](_0x216333)[_0xadea('0x6e')]()[_0xadea('0x6f')]();return db[_0xadea('0x20')][_0xadea('0x35')]({'where':{'id':_0x1dcbc8[_0xadea('0x3d')]['id']}})[_0xadea('0x16')](function(_0x477595){return db[_0xadea('0x67')][_0xadea('0x56')](function(_0xc2e8ce){return _0x477595[_0xadea('0x5d')](_0x1dcbc8[_0xadea('0x28')][_0xadea('0x51')],{'transaction':_0xc2e8ce})[_0xadea('0x16')](function(){if(!_[_0xadea('0x70')](_0x2ca09b)){return _0x477595['removeAgents'](_0x2ca09b,{'transaction':_0xc2e8ce});}})[_0xadea('0x16')](function(){_0x2ca09b[_0xadea('0x5a')](function(_0xba1b44){socket[_0xadea('0x5b')](_0xadea('0x71'),{'UserId':_0xba1b44,'OpenchannelQueueId':_0x477595['id']});});});});});});})[_0xadea('0x16')](respondWithStatusCode(_0x198cb2,null))['catch'](handleError(_0x198cb2,null));};exports[_0xadea('0x72')]=function(_0xfe410d,_0x4a29e3){return db[_0xadea('0x20')][_0xadea('0x35')]({'where':{'id':_0xfe410d[_0xadea('0x3d')]['id']}})[_0xadea('0x16')](handleEntityNotFound(_0x4a29e3,null))['then'](function(_0x251e8f){if(_0x251e8f){return _0x251e8f[_0xadea('0x72')](_0xfe410d['body'][_0xadea('0x51')],_[_0xadea('0x73')](_0xfe410d['body'],['ids','id'])||{})[_0xadea('0x74')](function(_0x300097){for(var _0x406aa5=0x0;_0x406aa5<_0xfe410d[_0xadea('0x37')][_0xadea('0x51')][_0xadea('0x31')];_0x406aa5+=0x1){socket[_0xadea('0x5b')](_0xadea('0x5c'),{'UserId':Number(_0xfe410d[_0xadea('0x37')]['ids'][_0x406aa5]),'OpenchannelQueueId':Number(_0xfe410d[_0xadea('0x3d')]['id'])});}return _0x300097;});}})[_0xadea('0x16')](respondWithResult(_0x4a29e3,null))[_0xadea('0x2a')](handleError(_0x4a29e3,null));};exports['removeAgents']=function(_0x3511a4,_0x5c0720){return db[_0xadea('0x20')][_0xadea('0x35')]({'where':{'id':_0x3511a4[_0xadea('0x3d')]['id']}})[_0xadea('0x16')](handleEntityNotFound(_0x5c0720,null))[_0xadea('0x16')](function(_0xeb7fdd){if(_0xeb7fdd){return _0xeb7fdd['removeAgents'](_0x3511a4[_0xadea('0x28')][_0xadea('0x51')])['then'](function(){if(_[_0xadea('0x75')](_0x3511a4[_0xadea('0x28')][_0xadea('0x51')])){for(var _0x2e7417=0x0;_0x2e7417<_0x3511a4[_0xadea('0x28')]['ids'][_0xadea('0x31')];_0x2e7417+=0x1){socket[_0xadea('0x5b')](_0xadea('0x71'),{'UserId':Number(_0x3511a4['query'][_0xadea('0x51')][_0x2e7417]),'OpenchannelQueueId':Number(_0x3511a4[_0xadea('0x3d')]['id'])});}}else{socket['emit'](_0xadea('0x71'),{'UserId':Number(_0x3511a4['query'][_0xadea('0x51')]),'OpenchannelQueueId':Number(_0x3511a4['params']['id'])});}});}})[_0xadea('0x16')](respondWithStatusCode(_0x5c0720,null))['catch'](handleError(_0x5c0720,null));};exports['getAgents']=function(_0x371b26,_0x3bf8fa){var _0x2df3ca={};var _0xeb652a={};var _0x45208b;var _0x42c96b;return db['OpenchannelQueue'][_0xadea('0x3f')]({'where':{'id':_0x371b26[_0xadea('0x3d')]['id']}})[_0xadea('0x16')](handleEntityNotFound(_0x3bf8fa,null))[_0xadea('0x16')](function(_0x1ea91c){if(_0x1ea91c){_0x45208b=_0x1ea91c;_0xeb652a[_0xadea('0x2b')]=_['keys'](db[_0xadea('0x43')][_0xadea('0x21')]);_0xeb652a['query']=_['keys'](_0x371b26[_0xadea('0x28')]);_0xeb652a[_0xadea('0x2d')]=_[_0xadea('0x2e')](_0xeb652a[_0xadea('0x2b')],_0xeb652a[_0xadea('0x28')]);_0x2df3ca[_0xadea('0x30')]=_[_0xadea('0x2e')](_0xeb652a[_0xadea('0x2b')],qs[_0xadea('0x2f')](_0x371b26['query'][_0xadea('0x2f')]));_0x2df3ca[_0xadea('0x30')]=_0x2df3ca[_0xadea('0x30')][_0xadea('0x31')]?_0x2df3ca[_0xadea('0x30')]:_0xeb652a[_0xadea('0x2b')];_0x2df3ca[_0xadea('0x4e')]=qs[_0xadea('0x41')](_0x371b26[_0xadea('0x28')]['sort']);_0x2df3ca[_0xadea('0x26')]=qs[_0xadea('0x2d')](_[_0xadea('0x4f')](_0x371b26[_0xadea('0x28')],_0xeb652a[_0xadea('0x2d')]));if(_0x371b26[_0xadea('0x28')][_0xadea('0x42')]){_0x2df3ca[_0xadea('0x26')]=_[_0xadea('0x33')](_0x2df3ca[_0xadea('0x26')],{'$or':_[_0xadea('0x1f')](_0x2df3ca[_0xadea('0x30')],function(_0x41860c){var _0xc0446c={};_0xc0446c[_0x41860c]={'$like':'%'+_0x371b26[_0xadea('0x28')]['filter']+'%'};return _0xc0446c;})});}_0x2df3ca=_[_0xadea('0x33')]({},_0x2df3ca,_0x371b26[_0xadea('0x34')]);return _0x45208b[_0xadea('0x76')](_0x2df3ca);}})[_0xadea('0x16')](function(_0x4b5400){if(_0x4b5400){_0x42c96b=_0x4b5400['length'];if(!_0x371b26[_0xadea('0x28')]['hasOwnProperty'](_0xadea('0x40'))){_0x2df3ca['limit']=qs[_0xadea('0x12')](_0x371b26['query'][_0xadea('0x12')]);_0x2df3ca[_0xadea('0x10')]=qs[_0xadea('0x10')](_0x371b26[_0xadea('0x28')]['offset']);}return _0x45208b['getAgents'](_0x2df3ca);}})[_0xadea('0x16')](function(_0x53deb0){if(_0x53deb0){return _0x53deb0?{'count':_0x42c96b,'rows':_0x53deb0}:null;}})[_0xadea('0x16')](respondWithResult(_0x3bf8fa,null))[_0xadea('0x2a')](handleError(_0x3bf8fa,null));}; \ No newline at end of file +var _0xe2cd=['Content-Range','update','then','destroy','OpenchannelQueues','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','key','getOptions','where','OpenchannelQueue','include','findAll','show','params','keys','query','intersection','attributes','model','fields','length','includeAll','merge','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','hasOwnProperty','nolimit','order','sort','pick','filters','OpenchannelQueueId','filter','options','User','findAndCountAll','UserId','agent','openchannelPause','rows','format','%s/%s','createdAt','updatedAt','findOne','Team','getTeams','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','squel','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','json','undefined','limit','count','offset'];(function(_0x300bcb,_0x59a0f2){var _0x50fdca=function(_0xe91b21){while(--_0xe91b21){_0x300bcb['push'](_0x300bcb['shift']());}};_0x50fdca(++_0x59a0f2);}(_0xe2cd,0x158));var _0xde2c=function(_0x2e7666,_0x55d9b3){_0x2e7666=_0x2e7666-0x0;var _0x4c11bd=_0xe2cd[_0x2e7666];return _0x4c11bd;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var squel=require(_0xde2c('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xde2c('0x1'))('api');var config=require(_0xde2c('0x2'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xde2c('0x3')](config[_0xde2c('0x4')],{'host':_0xde2c('0x5'),'port':0x18eb});var socket=require(_0xde2c('0x6'))(new Redis(config[_0xde2c('0x4')]));require(_0xde2c('0x7'))['register'](socket);function respondWithStatusCode(_0x3c68c9,_0x416a15){_0x416a15=_0x416a15||0xcc;return function(_0x20e274){if(_0x20e274){return _0x3c68c9[_0xde2c('0x8')](_0x416a15);}return _0x3c68c9[_0xde2c('0x9')](_0x416a15)[_0xde2c('0xa')]();};}function respondWithResult(_0x198567,_0x2e711e){_0x2e711e=_0x2e711e||0xc8;return function(_0x280f12){if(_0x280f12){return _0x198567['status'](_0x2e711e)[_0xde2c('0xb')](_0x280f12);}};}function respondWithFilteredResult(_0x2b23d8,_0x55850a){return function(_0x184c2f){if(_0x184c2f){var _0xb854e=typeof _0x55850a['offset']===_0xde2c('0xc')&&typeof _0x55850a[_0xde2c('0xd')]===_0xde2c('0xc');var _0x5a339b=_0x184c2f['count'];var _0x80e455=_0xb854e?0x0:_0x55850a['offset'];var _0x291e30=_0xb854e?_0x184c2f[_0xde2c('0xe')]:_0x55850a[_0xde2c('0xf')]+_0x55850a['limit'];var _0x1ba52d;if(_0x291e30>=_0x5a339b){_0x291e30=_0x5a339b;_0x1ba52d=0xc8;}else{_0x1ba52d=0xce;}_0x2b23d8[_0xde2c('0x9')](_0x1ba52d);return _0x2b23d8['set'](_0xde2c('0x10'),_0x80e455+'-'+_0x291e30+'/'+_0x5a339b)[_0xde2c('0xb')](_0x184c2f);}return null;};}function saveUpdates(_0xbecd12){return function(_0x1add8c){if(_0x1add8c){return _0x1add8c[_0xde2c('0x11')](_0xbecd12)[_0xde2c('0x12')](function(_0x310d43){return _0x310d43;});}return null;};}function removeEntity(_0x4121a5){return function(_0x1b0f84){if(_0x1b0f84){return _0x1b0f84[_0xde2c('0x13')]()[_0xde2c('0x12')](function(){var _0x1b1ecc=_0x1b0f84['get']({'plain':!![]});var _0x3ed379=_0xde2c('0x14');return db[_0xde2c('0x15')][_0xde2c('0x13')]({'where':{'type':_0x3ed379,'resourceId':_0x1b1ecc['id']}})[_0xde2c('0x12')](function(){return _0x1b0f84;});})['then'](function(){_0x4121a5[_0xde2c('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8f0f9){return function(_0x3f8068){if(!_0x3f8068){_0xe8f0f9['sendStatus'](0x194);}return _0x3f8068;};}function handleError(_0x51f505,_0x6f0f01){_0x6f0f01=_0x6f0f01||0x1f4;return function(_0x371cfe){logger[_0xde2c('0x16')](_0x371cfe[_0xde2c('0x17')]);if(_0x371cfe[_0xde2c('0x18')]){delete _0x371cfe[_0xde2c('0x18')];}_0x51f505['status'](_0x6f0f01)[_0xde2c('0x19')](_0x371cfe);};}exports['index']=function(_0x2d15b5,_0x47cd3e){var _0x14b00c={};var _0x2e5ac4={'count':0x0,'rows':[]};var _0x2544ed=_[_0xde2c('0x1a')](db['OpenchannelQueue'][_0xde2c('0x1b')],function(_0x35b376){return{'name':_0x35b376[_0xde2c('0x1c')],'type':_0x35b376['type'][_0xde2c('0x1d')]};});_0x14b00c=qs[_0xde2c('0x1e')](_0x2544ed,_0x2d15b5);var _0x3b1b89={'where':_0x14b00c[_0xde2c('0x1f')]};return db[_0xde2c('0x20')][_0xde2c('0xe')](_0x3b1b89)[_0xde2c('0x12')](function(_0x523f4b){_0x2e5ac4['count']=_0x523f4b;_0x14b00c[_0xde2c('0x21')]=qs[_0xde2c('0x21')](_0x2d15b5['query']);return db['OpenchannelQueue'][_0xde2c('0x22')](_0x14b00c);})[_0xde2c('0x12')](function(_0x18ec7a){_0x2e5ac4['rows']=_0x18ec7a;return _0x2e5ac4;})[_0xde2c('0x12')](respondWithFilteredResult(_0x47cd3e,_0x14b00c))['catch'](handleError(_0x47cd3e,null));};exports[_0xde2c('0x23')]=function(_0x120afe,_0x134d9b){var _0x439ed2={'raw':!![],'where':{'id':_0x120afe[_0xde2c('0x24')]['id']}},_0x492415={};_0x492415['model']=_[_0xde2c('0x25')](db[_0xde2c('0x20')][_0xde2c('0x1b')]);_0x492415[_0xde2c('0x26')]=_['keys'](_0x120afe['query']);_0x492415['filters']=_[_0xde2c('0x27')](_0x492415['model'],_0x492415[_0xde2c('0x26')]);_0x439ed2[_0xde2c('0x28')]=_['intersection'](_0x492415[_0xde2c('0x29')],qs['fields'](_0x120afe[_0xde2c('0x26')][_0xde2c('0x2a')]));_0x439ed2[_0xde2c('0x28')]=_0x439ed2[_0xde2c('0x28')][_0xde2c('0x2b')]?_0x439ed2[_0xde2c('0x28')]:_0x492415['model'];if(_0x120afe['query'][_0xde2c('0x2c')]){_0x439ed2[_0xde2c('0x21')]=[{'all':!![]}];}_0x439ed2=_[_0xde2c('0x2d')]({},_0x439ed2,_0x120afe['options']);return db[_0xde2c('0x20')][_0xde2c('0x2e')](_0x439ed2)[_0xde2c('0x12')](handleEntityNotFound(_0x134d9b,null))[_0xde2c('0x12')](respondWithResult(_0x134d9b,null))[_0xde2c('0x2f')](handleError(_0x134d9b,null));};exports[_0xde2c('0x30')]=function(_0x9d7d53,_0x530451){return db[_0xde2c('0x20')][_0xde2c('0x30')](_0x9d7d53[_0xde2c('0x31')],{})[_0xde2c('0x12')](function(_0x5a8754){var _0x19da6e=_0x9d7d53[_0xde2c('0x32')][_0xde2c('0x33')]({'plain':!![]});if(!_0x19da6e)throw new Error(_0xde2c('0x34'));if(_0x19da6e['role']===_0xde2c('0x32')){var _0x29c15d=_0x5a8754['get']({'plain':!![]});var _0x3abd29=_0xde2c('0x14');return db[_0xde2c('0x35')]['find']({'where':{'name':_0x3abd29,'userProfileId':_0x19da6e['userProfileId']},'raw':!![]})['then'](function(_0x146e02){if(_0x146e02&&_0x146e02[_0xde2c('0x36')]===0x0){return db['UserProfileResource']['create']({'name':_0x29c15d[_0xde2c('0x18')],'resourceId':_0x29c15d['id'],'type':_0x146e02[_0xde2c('0x18')],'sectionId':_0x146e02['id']},{})[_0xde2c('0x12')](function(){return _0x5a8754;});}else{return _0x5a8754;}})[_0xde2c('0x2f')](function(_0x4c5e3b){logger['error'](_0xde2c('0x37'),_0x4c5e3b);throw _0x4c5e3b;});}return _0x5a8754;})[_0xde2c('0x12')](respondWithResult(_0x530451,0xc9))[_0xde2c('0x2f')](handleError(_0x530451,null));};exports[_0xde2c('0x11')]=function(_0x270c2f,_0x3737b1){if(_0x270c2f['body']['id']){delete _0x270c2f['body']['id'];}return db[_0xde2c('0x20')][_0xde2c('0x2e')]({'where':{'id':_0x270c2f['params']['id']}})[_0xde2c('0x12')](handleEntityNotFound(_0x3737b1,null))[_0xde2c('0x12')](saveUpdates(_0x270c2f[_0xde2c('0x31')],null))[_0xde2c('0x12')](respondWithResult(_0x3737b1,null))[_0xde2c('0x2f')](handleError(_0x3737b1,null));};exports['destroy']=function(_0x4b26c9,_0x5f2762){return db[_0xde2c('0x20')][_0xde2c('0x2e')]({'where':{'id':_0x4b26c9[_0xde2c('0x24')]['id']}})[_0xde2c('0x12')](handleEntityNotFound(_0x5f2762,null))[_0xde2c('0x12')](removeEntity(_0x5f2762,null))[_0xde2c('0x2f')](handleError(_0x5f2762,null));};exports[_0xde2c('0x38')]=function(_0x46f284,_0x16589c){return db[_0xde2c('0x20')][_0xde2c('0x38')]()['then'](respondWithResult(_0x16589c,null))[_0xde2c('0x2f')](handleError(_0x16589c,null));};exports[_0xde2c('0x39')]=function(_0x4c0976,_0x507ed5){var _0x5be9ef={'raw':!![],'where':{}},_0x41dce3={},_0x237f34;return db[_0xde2c('0x20')]['findOne']({'where':{'id':_0x4c0976[_0xde2c('0x24')]['id']}})[_0xde2c('0x12')](handleEntityNotFound(_0x507ed5,null))[_0xde2c('0x12')](function(_0x1f1fc7){if(_0x1f1fc7){_0x237f34=_0x1f1fc7[_0xde2c('0x33')]({'plain':!![]});_0x41dce3['model']=_[_0xde2c('0x25')](db[_0xde2c('0x3a')][_0xde2c('0x1b')]);_0x41dce3[_0xde2c('0x26')]=_[_0xde2c('0x25')](_0x4c0976[_0xde2c('0x26')]);_0x41dce3['filters']=_[_0xde2c('0x27')](_0x41dce3[_0xde2c('0x29')],_0x41dce3[_0xde2c('0x26')]);_0x5be9ef[_0xde2c('0x28')]=_['intersection'](_0x41dce3[_0xde2c('0x29')],qs[_0xde2c('0x2a')](_0x4c0976[_0xde2c('0x26')][_0xde2c('0x2a')]));_0x5be9ef[_0xde2c('0x28')]=_0x5be9ef[_0xde2c('0x28')]['length']?_0x5be9ef[_0xde2c('0x28')]:_0x41dce3['model'];if(!_0x4c0976[_0xde2c('0x26')][_0xde2c('0x3b')](_0xde2c('0x3c'))){_0x5be9ef['limit']=qs[_0xde2c('0xd')](_0x4c0976[_0xde2c('0x26')]['limit']);_0x5be9ef['offset']=qs['offset'](_0x4c0976['query']['offset']);}_0x5be9ef[_0xde2c('0x3d')]=qs[_0xde2c('0x3e')](_0x4c0976['query'][_0xde2c('0x3e')]);_0x5be9ef['where']=qs['filters'](_[_0xde2c('0x3f')](_0x4c0976[_0xde2c('0x26')],_0x41dce3[_0xde2c('0x40')]));_0x5be9ef[_0xde2c('0x1f')][_0xde2c('0x41')]=_0x1f1fc7['id'];if(_0x4c0976[_0xde2c('0x26')][_0xde2c('0x42')]){_0x5be9ef[_0xde2c('0x1f')]=_[_0xde2c('0x2d')](_0x5be9ef[_0xde2c('0x1f')],{'$or':_[_0xde2c('0x1a')](_0x5be9ef[_0xde2c('0x28')],function(_0x7e43e4){var _0xf62d61={};_0xf62d61[_0x7e43e4]={'$like':'%'+_0x4c0976[_0xde2c('0x26')][_0xde2c('0x42')]+'%'};return _0xf62d61;})});}_0x5be9ef=_[_0xde2c('0x2d')]({},_0x5be9ef,_0x4c0976[_0xde2c('0x43')]);return db[_0xde2c('0x3a')][_0xde2c('0x22')](_0x5be9ef);}})[_0xde2c('0x12')](function(_0x7da61c){if(_0x7da61c){return db[_0xde2c('0x44')][_0xde2c('0x45')]({'where':{'id':_[_0xde2c('0x1a')](_0x7da61c,_0xde2c('0x46')),'role':_0xde2c('0x47')},'attributes':['id',_0xde2c('0x18'),_0xde2c('0x48'),'updatedAt','createdAt']});}})[_0xde2c('0x12')](function(_0x120e6d){if(_0x120e6d){return{'count':_0x120e6d[_0xde2c('0xe')],'rows':_[_0xde2c('0x1a')](_0x120e6d[_0xde2c('0x49')],function(_0x1582b2){return{'membername':_0x1582b2[_0xde2c('0x18')],'UserId':_0x1582b2['id'],'queue_name':_0x237f34[_0xde2c('0x18')],'OpenchannelQueueId':_0x237f34['id'],'interface':util[_0xde2c('0x4a')](_0xde2c('0x4b'),'SIP',_0x1582b2[_0xde2c('0x18')]),'penalty':0x0,'paused':_0x1582b2['openchannelPause'],'createdAt':_0x1582b2[_0xde2c('0x4c')],'updatedAt':_0x1582b2[_0xde2c('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xde2c('0x12')](respondWithFilteredResult(_0x507ed5,_0x5be9ef))[_0xde2c('0x2f')](handleError(_0x507ed5,null));};exports['getTeams']=function(_0x3ba0f6,_0x56430e){var _0xae3514={};var _0x1d670b={};var _0x5e649c;var _0x4b5c4d;return db[_0xde2c('0x20')][_0xde2c('0x4e')]({'where':{'id':_0x3ba0f6[_0xde2c('0x24')]['id']}})[_0xde2c('0x12')](handleEntityNotFound(_0x56430e,null))[_0xde2c('0x12')](function(_0x5245c3){if(_0x5245c3){_0x5e649c=_0x5245c3;_0x1d670b[_0xde2c('0x29')]=_['keys'](db[_0xde2c('0x4f')][_0xde2c('0x1b')]);_0x1d670b[_0xde2c('0x26')]=_['keys'](_0x3ba0f6['query']);_0x1d670b[_0xde2c('0x40')]=_[_0xde2c('0x27')](_0x1d670b[_0xde2c('0x29')],_0x1d670b['query']);_0xae3514[_0xde2c('0x28')]=_[_0xde2c('0x27')](_0x1d670b['model'],qs['fields'](_0x3ba0f6[_0xde2c('0x26')]['fields']));_0xae3514[_0xde2c('0x28')]=_0xae3514[_0xde2c('0x28')][_0xde2c('0x2b')]?_0xae3514[_0xde2c('0x28')]:_0x1d670b['model'];_0xae3514['order']=qs[_0xde2c('0x3e')](_0x3ba0f6[_0xde2c('0x26')][_0xde2c('0x3e')]);_0xae3514['where']=qs[_0xde2c('0x40')](_[_0xde2c('0x3f')](_0x3ba0f6[_0xde2c('0x26')],_0x1d670b[_0xde2c('0x40')]));if(_0x3ba0f6[_0xde2c('0x26')][_0xde2c('0x42')]){_0xae3514[_0xde2c('0x1f')]=_[_0xde2c('0x2d')](_0xae3514[_0xde2c('0x1f')],{'$or':_[_0xde2c('0x1a')](_0xae3514['attributes'],function(_0x5e3a9a){var _0x5bb698={};_0x5bb698[_0x5e3a9a]={'$like':'%'+_0x3ba0f6[_0xde2c('0x26')][_0xde2c('0x42')]+'%'};return _0x5bb698;})});}_0xae3514=_[_0xde2c('0x2d')]({},_0xae3514,_0x3ba0f6[_0xde2c('0x43')]);return _0x5e649c[_0xde2c('0x50')](_0xae3514);}})[_0xde2c('0x12')](function(_0x471c8e){if(_0x471c8e){_0x4b5c4d=_0x471c8e[_0xde2c('0x2b')];if(!_0x3ba0f6[_0xde2c('0x26')][_0xde2c('0x3b')](_0xde2c('0x3c'))){_0xae3514[_0xde2c('0xd')]=qs[_0xde2c('0xd')](_0x3ba0f6[_0xde2c('0x26')][_0xde2c('0xd')]);_0xae3514['offset']=qs['offset'](_0x3ba0f6[_0xde2c('0x26')][_0xde2c('0xf')]);}return _0x5e649c[_0xde2c('0x50')](_0xae3514);}})[_0xde2c('0x12')](function(_0x1299e4){if(_0x1299e4){return _0x1299e4?{'count':_0x4b5c4d,'rows':_0x1299e4}:null;}})[_0xde2c('0x12')](respondWithResult(_0x56430e,null))[_0xde2c('0x2f')](handleError(_0x56430e,null));};exports[_0xde2c('0x51')]=function(_0x3e11a3,_0x55858c){var _0xdbf200=_0x3e11a3[_0xde2c('0x31')][_0xde2c('0x52')];return db[_0xde2c('0x4f')][_0xde2c('0x22')]({'where':{'id':_0xdbf200},'attributes':['id'],'include':[{'model':db[_0xde2c('0x44')],'as':_0xde2c('0x53'),'attributes':['id',_0xde2c('0x18'),_0xde2c('0x54'),'voicePause',_0xde2c('0x55')],'raw':!![]}]})[_0xde2c('0x12')](function(_0x226f4d){if(_0x226f4d){var _0x4ac5b6=_[_0xde2c('0x56')](_0x226f4d,function(_0x170f93){var _0x101d94=_0x170f93[_0xde2c('0x33')]({'plain':!![]});return _0x101d94[_0xde2c('0x53')];});return db[_0xde2c('0x20')][_0xde2c('0x2e')]({'where':{'id':_0x3e11a3[_0xde2c('0x24')]['id']}})[_0xde2c('0x12')](function(_0x13d948){return db[_0xde2c('0x57')][_0xde2c('0x58')](function(_0x52c0a7){return _0x13d948['addTeams'](_0xdbf200,{'transaction':_0x52c0a7})[_0xde2c('0x12')](function(){return BPromise[_0xde2c('0x59')](_0x4ac5b6,function(_0x420c9b){return db[_0xde2c('0x3a')][_0xde2c('0x5a')]({'where':{'UserId':_0x420c9b['id'],'OpenchannelQueueId':_0x3e11a3[_0xde2c('0x24')]['id']},'transaction':_0x52c0a7});});})[_0xde2c('0x12')](function(){_0x4ac5b6[_0xde2c('0x5b')](function(_0x524969){socket['emit'](_0xde2c('0x5c'),{'UserId':_0x524969['id'],'OpenchannelQueueId':_0x13d948['id']});});});});});}})[_0xde2c('0x12')](respondWithStatusCode(_0x55858c,null))[_0xde2c('0x2f')](handleError(_0x55858c,null));};exports[_0xde2c('0x5d')]=function(_0x11a9ba,_0xadf70d){return db[_0xde2c('0x4f')]['findAll']({'where':{'id':_0x11a9ba[_0xde2c('0x26')][_0xde2c('0x52')]},'attributes':['id'],'include':[{'model':db[_0xde2c('0x44')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xde2c('0x12')](handleEntityNotFound(_0xadf70d,null))[_0xde2c('0x12')](function(_0x41f5c8){var _0x1a02be=_[_0xde2c('0x1a')](_0x41f5c8,'id');var _0x32789e=[];var _0x45b2e9=[];var _0x52353c=squel[_0xde2c('0x5e')]();_0x52353c[_0xde2c('0x5f')](_0xde2c('0x60'))['from'](_0xde2c('0x61'),'tq')[_0xde2c('0x62')](_0xde2c('0x63'),'ut',_0xde2c('0x64'))[_0xde2c('0x1f')](_0xde2c('0x65'),_0x11a9ba[_0xde2c('0x24')]['id']);for(var _0x4522a2=0x0;_0x4522a2<_0x41f5c8['length'];_0x4522a2+=0x1){let _0x56d11f=_0x41f5c8[_0x4522a2];for(var _0x31063d=0x0;_0x31063d<_0x56d11f[_0xde2c('0x53')][_0xde2c('0x2b')];_0x31063d+=0x1){let _0xdab3d4=_0x56d11f['Agents'][_0x31063d];var _0x4c6543=_0x52353c['clone']();_0x4c6543[_0xde2c('0x1f')](_0xde2c('0x66'),_0xdab3d4['id']);_0x45b2e9[_0xde2c('0x67')](db['sequelize'][_0xde2c('0x26')](_0x4c6543[_0xde2c('0x68')](),{'type':db['sequelize'][_0xde2c('0x69')]['SELECT']})[_0xde2c('0x12')](function(_0x195e38){if(_0x195e38['length']===0x1){return _0xdab3d4['id'];}else{var _0x42c052=_[_0xde2c('0x6a')](_[_0xde2c('0x1a')](_0x195e38,_0xde2c('0x6b')),function(_0x4fe09b){return _[_0xde2c('0x6c')](_0x1a02be,_0x4fe09b);});if(_0x42c052){return _0xdab3d4['id'];}}}));}}return BPromise[_0xde2c('0x6d')](_0x45b2e9)[_0xde2c('0x12')](function(_0x18ce2f){_0x32789e=_(_0x32789e)['union'](_0x18ce2f)['compact']()[_0xde2c('0x6e')]();return db[_0xde2c('0x20')][_0xde2c('0x2e')]({'where':{'id':_0x11a9ba[_0xde2c('0x24')]['id']}})[_0xde2c('0x12')](function(_0x3b2e6a){return db['sequelize']['transaction'](function(_0x4b77b1){return _0x3b2e6a[_0xde2c('0x5d')](_0x11a9ba[_0xde2c('0x26')][_0xde2c('0x52')],{'transaction':_0x4b77b1})[_0xde2c('0x12')](function(){if(!_[_0xde2c('0x6f')](_0x32789e)){return _0x3b2e6a[_0xde2c('0x70')](_0x32789e,{'transaction':_0x4b77b1});}})[_0xde2c('0x12')](function(){_0x32789e[_0xde2c('0x5b')](function(_0xa1f518){socket[_0xde2c('0x71')](_0xde2c('0x72'),{'UserId':_0xa1f518,'OpenchannelQueueId':_0x3b2e6a['id']});});});});});});})['then'](respondWithStatusCode(_0xadf70d,null))[_0xde2c('0x2f')](handleError(_0xadf70d,null));};exports[_0xde2c('0x73')]=function(_0x376bb4,_0x11a7a1){return db[_0xde2c('0x20')][_0xde2c('0x2e')]({'where':{'id':_0x376bb4[_0xde2c('0x24')]['id']}})['then'](handleEntityNotFound(_0x11a7a1,null))[_0xde2c('0x12')](function(_0xffd3b2){if(_0xffd3b2){return _0xffd3b2[_0xde2c('0x73')](_0x376bb4[_0xde2c('0x31')][_0xde2c('0x52')],_[_0xde2c('0x74')](_0x376bb4[_0xde2c('0x31')],['ids','id'])||{})[_0xde2c('0x75')](function(_0x4bfcd6){for(var _0x1e225d=0x0;_0x1e225d<_0x376bb4['body'][_0xde2c('0x52')]['length'];_0x1e225d+=0x1){socket[_0xde2c('0x71')](_0xde2c('0x5c'),{'UserId':Number(_0x376bb4[_0xde2c('0x31')][_0xde2c('0x52')][_0x1e225d]),'OpenchannelQueueId':Number(_0x376bb4[_0xde2c('0x24')]['id'])});}return _0x4bfcd6;});}})[_0xde2c('0x12')](respondWithResult(_0x11a7a1,null))['catch'](handleError(_0x11a7a1,null));};exports[_0xde2c('0x70')]=function(_0x4e4b76,_0x210307){return db[_0xde2c('0x20')]['find']({'where':{'id':_0x4e4b76[_0xde2c('0x24')]['id']}})[_0xde2c('0x12')](handleEntityNotFound(_0x210307,null))[_0xde2c('0x12')](function(_0x556dcd){if(_0x556dcd){return _0x556dcd[_0xde2c('0x70')](_0x4e4b76['query']['ids'])[_0xde2c('0x12')](function(){if(_[_0xde2c('0x76')](_0x4e4b76[_0xde2c('0x26')][_0xde2c('0x52')])){for(var _0x35fd4b=0x0;_0x35fd4b<_0x4e4b76['query'][_0xde2c('0x52')]['length'];_0x35fd4b+=0x1){socket[_0xde2c('0x71')](_0xde2c('0x72'),{'UserId':Number(_0x4e4b76['query'][_0xde2c('0x52')][_0x35fd4b]),'OpenchannelQueueId':Number(_0x4e4b76['params']['id'])});}}else{socket[_0xde2c('0x71')](_0xde2c('0x72'),{'UserId':Number(_0x4e4b76['query'][_0xde2c('0x52')]),'OpenchannelQueueId':Number(_0x4e4b76['params']['id'])});}});}})[_0xde2c('0x12')](respondWithStatusCode(_0x210307,null))[_0xde2c('0x2f')](handleError(_0x210307,null));};exports[_0xde2c('0x77')]=function(_0x119622,_0x14892d){var _0x5ec44c={};var _0x2e6c3e={};var _0xc47dbe;var _0xac71fd;return db[_0xde2c('0x20')]['findOne']({'where':{'id':_0x119622[_0xde2c('0x24')]['id']}})['then'](handleEntityNotFound(_0x14892d,null))[_0xde2c('0x12')](function(_0x4b0d93){if(_0x4b0d93){_0xc47dbe=_0x4b0d93;_0x2e6c3e[_0xde2c('0x29')]=_[_0xde2c('0x25')](db[_0xde2c('0x44')][_0xde2c('0x1b')]);_0x2e6c3e[_0xde2c('0x26')]=_[_0xde2c('0x25')](_0x119622[_0xde2c('0x26')]);_0x2e6c3e[_0xde2c('0x40')]=_[_0xde2c('0x27')](_0x2e6c3e[_0xde2c('0x29')],_0x2e6c3e[_0xde2c('0x26')]);_0x5ec44c['attributes']=_[_0xde2c('0x27')](_0x2e6c3e[_0xde2c('0x29')],qs['fields'](_0x119622['query'][_0xde2c('0x2a')]));_0x5ec44c[_0xde2c('0x28')]=_0x5ec44c['attributes'][_0xde2c('0x2b')]?_0x5ec44c['attributes']:_0x2e6c3e[_0xde2c('0x29')];_0x5ec44c[_0xde2c('0x3d')]=qs[_0xde2c('0x3e')](_0x119622['query'][_0xde2c('0x3e')]);_0x5ec44c[_0xde2c('0x1f')]=qs[_0xde2c('0x40')](_['pick'](_0x119622['query'],_0x2e6c3e['filters']));if(_0x119622[_0xde2c('0x26')][_0xde2c('0x42')]){_0x5ec44c[_0xde2c('0x1f')]=_[_0xde2c('0x2d')](_0x5ec44c['where'],{'$or':_[_0xde2c('0x1a')](_0x5ec44c['attributes'],function(_0x54f66){var _0x27b2d3={};_0x27b2d3[_0x54f66]={'$like':'%'+_0x119622['query']['filter']+'%'};return _0x27b2d3;})});}_0x5ec44c=_[_0xde2c('0x2d')]({},_0x5ec44c,_0x119622[_0xde2c('0x43')]);return _0xc47dbe['getAgents'](_0x5ec44c);}})[_0xde2c('0x12')](function(_0x413504){if(_0x413504){_0xac71fd=_0x413504[_0xde2c('0x2b')];if(!_0x119622['query']['hasOwnProperty']('nolimit')){_0x5ec44c[_0xde2c('0xd')]=qs[_0xde2c('0xd')](_0x119622['query'][_0xde2c('0xd')]);_0x5ec44c[_0xde2c('0xf')]=qs['offset'](_0x119622[_0xde2c('0x26')][_0xde2c('0xf')]);}return _0xc47dbe[_0xde2c('0x77')](_0x5ec44c);}})[_0xde2c('0x12')](function(_0x27d1b1){if(_0x27d1b1){return _0x27d1b1?{'count':_0xac71fd,'rows':_0x27d1b1}:null;}})[_0xde2c('0x12')](respondWithResult(_0x14892d,null))['catch'](handleError(_0x14892d,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 39ba7b8..9d2ca35 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 _0x700b=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x3ef4ce,_0x5b4e3e){var _0x414d9d=function(_0x28e388){while(--_0x28e388){_0x3ef4ce['push'](_0x3ef4ce['shift']());}};_0x414d9d(++_0x5b4e3e);}(_0x700b,0xde));var _0xb700=function(_0x2e37c0,_0x174b1c){_0x2e37c0=_0x2e37c0-0x0;var _0x3588e7=_0x700b[_0x2e37c0];return _0x3588e7;};'use strict';var EventEmitter=require(_0xb700('0x0'));var OpenchannelQueue=require(_0xb700('0x1'))['db'][_0xb700('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb700('0x3'),'afterUpdate':'update','afterDestroy':_0xb700('0x4')};function emitEvent(_0x4ff54c){return function(_0x3d9c68,_0x29058f,_0x2d7f97){OpenchannelQueueEvents[_0xb700('0x5')](_0x4ff54c+':'+_0x3d9c68['id'],_0x3d9c68);OpenchannelQueueEvents['emit'](_0x4ff54c,_0x3d9c68);_0x2d7f97(null);};}for(var e in events){if(events[_0xb700('0x6')](e)){var event=events[e];OpenchannelQueue[_0xb700('0x7')](e,emitEvent(event));}}module[_0xb700('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x4b8b=['events','save','update','remove','emit'];(function(_0xc67084,_0x3e2efc){var _0x4d06c6=function(_0x2eb951){while(--_0x2eb951){_0xc67084['push'](_0xc67084['shift']());}};_0x4d06c6(++_0x3e2efc);}(_0x4b8b,0x14a));var _0xb4b8=function(_0x28cda9,_0x52e9d1){_0x28cda9=_0x28cda9-0x0;var _0x5019fb=_0x4b8b[_0x28cda9];return _0x5019fb;};'use strict';var EventEmitter=require(_0xb4b8('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb4b8('0x1'),'afterUpdate':_0xb4b8('0x2'),'afterDestroy':_0xb4b8('0x3')};function emitEvent(_0x5a90bb){return function(_0x4bf320,_0x592cf8,_0x1bc335){OpenchannelQueueEvents[_0xb4b8('0x4')](_0x5a90bb+':'+_0x4bf320['id'],_0x4bf320);OpenchannelQueueEvents['emit'](_0x5a90bb,_0x4bf320);_0x1bc335(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](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 40f9ce0..cafe3a5 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 _0xea7b=['exports','define','openchannel_queues','util','../../config/logger','bluebird','request-promise','rimraf','./openchannelQueue.attributes'];(function(_0x4575fb,_0x415909){var _0x22d065=function(_0x6a911e){while(--_0x6a911e){_0x4575fb['push'](_0x4575fb['shift']());}};_0x22d065(++_0x415909);}(_0xea7b,0x1b3));var _0xbea7=function(_0x379a66,_0x5c3446){_0x379a66=_0x379a66-0x0;var _0x3e96ba=_0xea7b[_0x379a66];return _0x3e96ba;};'use strict';var _=require('lodash');var util=require(_0xbea7('0x0'));var logger=require(_0xbea7('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbea7('0x2'));var rp=require(_0xbea7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbea7('0x4'));var config=require('../../config/environment');var attributes=require(_0xbea7('0x5'));module[_0xbea7('0x6')]=function(_0x5381f9,_0x3e7e78){return _0x5381f9[_0xbea7('0x7')]('OpenchannelQueue',attributes,{'tableName':_0xbea7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54d8=['openchannel_queues','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue'];(function(_0x5c468f,_0x2e5c25){var _0x2136b0=function(_0x56b8a4){while(--_0x56b8a4){_0x5c468f['push'](_0x5c468f['shift']());}};_0x2136b0(++_0x2e5c25);}(_0x54d8,0xd2));var _0x854d=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x54d8[_0x17406a];return _0x1501ff;};'use strict';var _=require('lodash');var util=require(_0x854d('0x0'));var logger=require(_0x854d('0x1'))(_0x854d('0x2'));var moment=require(_0x854d('0x3'));var BPromise=require(_0x854d('0x4'));var rp=require(_0x854d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x854d('0x6'));var attributes=require(_0x854d('0x7'));module[_0x854d('0x8')]=function(_0x3eb13d,_0x305fc4){return _0x3eb13d['define'](_0x854d('0x9'),attributes,{'tableName':_0x854d('0xa'),'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 ffaffc9..8446e49 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 _0x3045=['code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x10801d,_0x3b037e){var _0x204f57=function(_0x565206){while(--_0x565206){_0x10801d['push'](_0x10801d['shift']());}};_0x204f57(++_0x3b037e);}(_0x3045,0x90));var _0x5304=function(_0x2482a8,_0x51a04a){_0x2482a8=_0x2482a8-0x0;var _0x3d80fe=_0x3045[_0x2482a8];return _0x3d80fe;};'use strict';var _=require(_0x5304('0x0'));var util=require(_0x5304('0x1'));var moment=require(_0x5304('0x2'));var BPromise=require(_0x5304('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5304('0x4'))['db'];var utils=require(_0x5304('0x5'));var logger=require(_0x5304('0x6'))(_0x5304('0x7'));var config=require(_0x5304('0x8'));var jayson=require(_0x5304('0x9'));var client=jayson[_0x5304('0xa')]['http']({'port':0x232a});config[_0x5304('0xb')]=_[_0x5304('0xc')](config[_0x5304('0xb')],{'host':_0x5304('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5304('0xb')]));require(_0x5304('0xe'))[_0x5304('0xf')](socket);function respondWithRpcPromise(_0x5da3d6,_0x447e6d,_0xf489b3){return new BPromise(function(_0x1f75ba,_0x110f1e){return client[_0x5304('0x10')](_0x5da3d6,_0xf489b3)[_0x5304('0x11')](function(_0x4f3050){logger[_0x5304('0x12')](_0x5304('0x13'),_0x447e6d,_0x5304('0x14'));logger[_0x5304('0x15')](_0x5304('0x16'),_0x447e6d,_0x5304('0x14'),JSON['stringify'](_0x4f3050));if(_0x4f3050[_0x5304('0x17')]){if(_0x4f3050['error'][_0x5304('0x18')]===0x1f4){logger[_0x5304('0x17')](_0x5304('0x13'),_0x447e6d,_0x4f3050[_0x5304('0x17')][_0x5304('0x19')]);return _0x110f1e(_0x4f3050[_0x5304('0x17')][_0x5304('0x19')]);}logger[_0x5304('0x17')](_0x5304('0x13'),_0x447e6d,_0x4f3050[_0x5304('0x17')]['message']);return _0x1f75ba(_0x4f3050[_0x5304('0x17')]['message']);}else{logger[_0x5304('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x447e6d,_0x5304('0x14'));_0x1f75ba(_0x4f3050[_0x5304('0x1a')][_0x5304('0x19')]);}})[_0x5304('0x1b')](function(_0xee89dc){logger[_0x5304('0x17')](_0x5304('0x13'),_0x447e6d,_0xee89dc);_0x110f1e(_0xee89dc);});});}exports[_0x5304('0x1c')]=function(_0x54283a){var _0x16054b=this;return new Promise(function(_0x241cf2,_0x351442){return db[_0x5304('0x1d')][_0x5304('0x1e')]({'raw':_0x54283a['options']?_0x54283a[_0x5304('0x1f')][_0x5304('0x20')]===undefined?!![]:![]:!![],'where':_0x54283a['options']?_0x54283a['options'][_0x5304('0x21')]||null:null,'attributes':_0x54283a[_0x5304('0x1f')]?_0x54283a[_0x5304('0x1f')]['attributes']||null:null,'limit':_0x54283a['options']?_0x54283a[_0x5304('0x1f')][_0x5304('0x22')]||null:null,'include':_0x54283a[_0x5304('0x1f')]?_0x54283a[_0x5304('0x1f')][_0x5304('0x23')]?_[_0x5304('0x24')](_0x54283a['options']['include'],function(_0x15625e){return{'model':db[_0x15625e[_0x5304('0x25')]],'as':_0x15625e['as'],'attributes':_0x15625e[_0x5304('0x26')],'include':_0x15625e['include']?_['map'](_0x15625e[_0x5304('0x23')],function(_0x5b9881){return{'model':db[_0x5b9881['model']],'as':_0x5b9881['as'],'attributes':_0x5b9881[_0x5304('0x26')],'include':_0x5b9881[_0x5304('0x23')]?_[_0x5304('0x24')](_0x5b9881['include'],function(_0x39b4d9){return{'model':db[_0x39b4d9[_0x5304('0x25')]],'as':_0x39b4d9['as'],'attributes':_0x39b4d9[_0x5304('0x26')]};}):[]};}):[]};}):[]:[]})[_0x5304('0x11')](function(_0x1382f0){logger[_0x5304('0x12')](_0x5304('0x1c'),_0x54283a);logger['debug'](_0x5304('0x1c'),_0x54283a,JSON[_0x5304('0x27')](_0x1382f0));_0x241cf2(_0x1382f0);})[_0x5304('0x1b')](function(_0x15d878){logger[_0x5304('0x17')](_0x5304('0x1c'),_0x15d878['message'],_0x54283a);_0x351442(_0x16054b['error'](0x1f4,_0x15d878[_0x5304('0x19')]));});});};exports[_0x5304('0x28')]=function(_0x2b0fcf){var _0x435ee6=this;return new Promise(function(_0x556f93,_0x52791a){return db[_0x5304('0x1d')][_0x5304('0x29')]({'raw':_0x2b0fcf[_0x5304('0x1f')]?_0x2b0fcf['options']['raw']===undefined?!![]:![]:!![],'where':_0x2b0fcf['options']?_0x2b0fcf[_0x5304('0x1f')][_0x5304('0x21')]||null:null,'attributes':_0x2b0fcf[_0x5304('0x1f')]?_0x2b0fcf[_0x5304('0x1f')][_0x5304('0x26')]||null:null,'include':_0x2b0fcf[_0x5304('0x1f')]?_0x2b0fcf['options'][_0x5304('0x23')]?_[_0x5304('0x24')](_0x2b0fcf['options'][_0x5304('0x23')],function(_0x6019c){return{'model':db[_0x6019c[_0x5304('0x25')]],'as':_0x6019c['as'],'attributes':_0x6019c[_0x5304('0x26')],'include':_0x6019c[_0x5304('0x23')]?_[_0x5304('0x24')](_0x6019c[_0x5304('0x23')],function(_0x1409cc){return{'model':db[_0x1409cc[_0x5304('0x25')]],'as':_0x1409cc['as'],'attributes':_0x1409cc['attributes'],'include':_0x1409cc[_0x5304('0x23')]?_['map'](_0x1409cc[_0x5304('0x23')],function(_0x2c6e73){return{'model':db[_0x2c6e73[_0x5304('0x25')]],'as':_0x2c6e73['as'],'attributes':_0x2c6e73[_0x5304('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ac38d){logger['info'](_0x5304('0x28'),_0x2b0fcf);logger[_0x5304('0x15')](_0x5304('0x28'),_0x2b0fcf,JSON[_0x5304('0x27')](_0x4ac38d));_0x556f93(_0x4ac38d);})[_0x5304('0x1b')](function(_0x429a1a){logger[_0x5304('0x17')](_0x5304('0x28'),_0x429a1a[_0x5304('0x19')],_0x2b0fcf);_0x52791a(_0x435ee6[_0x5304('0x17')](0x1f4,_0x429a1a[_0x5304('0x19')]));});});}; \ No newline at end of file +var _0x6ab7=['defaults','localhost','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','ShowOpenchannelQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis'];(function(_0x2e3545,_0x20a6ec){var _0xcf18f=function(_0x3c85dd){while(--_0x3c85dd){_0x2e3545['push'](_0x2e3545['shift']());}};_0xcf18f(++_0x20a6ec);}(_0x6ab7,0x95));var _0x76ab=function(_0x579953,_0x524d25){_0x579953=_0x579953-0x0;var _0xe81976=_0x6ab7[_0x579953];return _0xe81976;};'use strict';var _=require(_0x76ab('0x0'));var util=require('util');var moment=require(_0x76ab('0x1'));var BPromise=require(_0x76ab('0x2'));var rs=require(_0x76ab('0x3'));var fs=require('fs');var Redis=require(_0x76ab('0x4'));var db=require(_0x76ab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x76ab('0x6'))(_0x76ab('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76ab('0x8')][_0x76ab('0x9')]({'port':0x232a});config[_0x76ab('0xa')]=_[_0x76ab('0xb')](config[_0x76ab('0xa')],{'host':_0x76ab('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x76ab('0xa')]));require(_0x76ab('0xd'))[_0x76ab('0xe')](socket);function respondWithRpcPromise(_0x5b63e9,_0x4134c9,_0x15a245){return new BPromise(function(_0x288162,_0x31e4b0){return client[_0x76ab('0xf')](_0x5b63e9,_0x15a245)['then'](function(_0x3fc108){logger['info'](_0x76ab('0x10'),_0x4134c9,'request\x20sent');logger[_0x76ab('0x11')](_0x76ab('0x12'),_0x4134c9,_0x76ab('0x13'),JSON[_0x76ab('0x14')](_0x3fc108));if(_0x3fc108[_0x76ab('0x15')]){if(_0x3fc108['error']['code']===0x1f4){logger[_0x76ab('0x15')](_0x76ab('0x10'),_0x4134c9,_0x3fc108[_0x76ab('0x15')][_0x76ab('0x16')]);return _0x31e4b0(_0x3fc108['error'][_0x76ab('0x16')]);}logger['error'](_0x76ab('0x10'),_0x4134c9,_0x3fc108[_0x76ab('0x15')][_0x76ab('0x16')]);return _0x288162(_0x3fc108[_0x76ab('0x15')]['message']);}else{logger[_0x76ab('0x17')](_0x76ab('0x10'),_0x4134c9,_0x76ab('0x13'));_0x288162(_0x3fc108[_0x76ab('0x18')]['message']);}})['catch'](function(_0x358de9){logger[_0x76ab('0x15')](_0x76ab('0x10'),_0x4134c9,_0x358de9);_0x31e4b0(_0x358de9);});});}exports[_0x76ab('0x19')]=function(_0x3c1e7c){var _0x422783=this;return new Promise(function(_0x52e799,_0x550cbd){return db[_0x76ab('0x1a')][_0x76ab('0x1b')]({'raw':_0x3c1e7c[_0x76ab('0x1c')]?_0x3c1e7c[_0x76ab('0x1c')][_0x76ab('0x1d')]===undefined?!![]:![]:!![],'where':_0x3c1e7c[_0x76ab('0x1c')]?_0x3c1e7c[_0x76ab('0x1c')][_0x76ab('0x1e')]||null:null,'attributes':_0x3c1e7c[_0x76ab('0x1c')]?_0x3c1e7c[_0x76ab('0x1c')][_0x76ab('0x1f')]||null:null,'limit':_0x3c1e7c[_0x76ab('0x1c')]?_0x3c1e7c[_0x76ab('0x1c')][_0x76ab('0x20')]||null:null,'include':_0x3c1e7c[_0x76ab('0x1c')]?_0x3c1e7c[_0x76ab('0x1c')][_0x76ab('0x21')]?_[_0x76ab('0x22')](_0x3c1e7c[_0x76ab('0x1c')][_0x76ab('0x21')],function(_0x107afc){return{'model':db[_0x107afc[_0x76ab('0x23')]],'as':_0x107afc['as'],'attributes':_0x107afc[_0x76ab('0x1f')],'include':_0x107afc['include']?_[_0x76ab('0x22')](_0x107afc[_0x76ab('0x21')],function(_0x12643e){return{'model':db[_0x12643e[_0x76ab('0x23')]],'as':_0x12643e['as'],'attributes':_0x12643e[_0x76ab('0x1f')],'include':_0x12643e['include']?_[_0x76ab('0x22')](_0x12643e[_0x76ab('0x21')],function(_0x255dc5){return{'model':db[_0x255dc5['model']],'as':_0x255dc5['as'],'attributes':_0x255dc5['attributes']};}):[]};}):[]};}):[]:[]})[_0x76ab('0x24')](function(_0x2cfebe){logger[_0x76ab('0x17')](_0x76ab('0x19'),_0x3c1e7c);logger[_0x76ab('0x11')](_0x76ab('0x19'),_0x3c1e7c,JSON[_0x76ab('0x14')](_0x2cfebe));_0x52e799(_0x2cfebe);})[_0x76ab('0x25')](function(_0x2d31e1){logger['error'](_0x76ab('0x19'),_0x2d31e1['message'],_0x3c1e7c);_0x550cbd(_0x422783[_0x76ab('0x15')](0x1f4,_0x2d31e1['message']));});});};exports[_0x76ab('0x26')]=function(_0x253b34){var _0x139963=this;return new Promise(function(_0x371ef0,_0x1035e9){return db['OpenchannelQueue'][_0x76ab('0x27')]({'raw':_0x253b34[_0x76ab('0x1c')]?_0x253b34[_0x76ab('0x1c')][_0x76ab('0x1d')]===undefined?!![]:![]:!![],'where':_0x253b34[_0x76ab('0x1c')]?_0x253b34['options'][_0x76ab('0x1e')]||null:null,'attributes':_0x253b34['options']?_0x253b34['options'][_0x76ab('0x1f')]||null:null,'include':_0x253b34[_0x76ab('0x1c')]?_0x253b34[_0x76ab('0x1c')]['include']?_[_0x76ab('0x22')](_0x253b34['options'][_0x76ab('0x21')],function(_0x967f27){return{'model':db[_0x967f27['model']],'as':_0x967f27['as'],'attributes':_0x967f27[_0x76ab('0x1f')],'include':_0x967f27[_0x76ab('0x21')]?_['map'](_0x967f27[_0x76ab('0x21')],function(_0x5cc148){return{'model':db[_0x5cc148['model']],'as':_0x5cc148['as'],'attributes':_0x5cc148[_0x76ab('0x1f')],'include':_0x5cc148[_0x76ab('0x21')]?_[_0x76ab('0x22')](_0x5cc148[_0x76ab('0x21')],function(_0x26f873){return{'model':db[_0x26f873[_0x76ab('0x23')]],'as':_0x26f873['as'],'attributes':_0x26f873[_0x76ab('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x370261){logger['info'](_0x76ab('0x26'),_0x253b34);logger[_0x76ab('0x11')](_0x76ab('0x26'),_0x253b34,JSON['stringify'](_0x370261));_0x371ef0(_0x370261);})[_0x76ab('0x25')](function(_0xc464e1){logger[_0x76ab('0x15')](_0x76ab('0x26'),_0xc464e1[_0x76ab('0x16')],_0x253b34);_0x1035e9(_0x139963[_0x76ab('0x15')](0x1f4,_0xc464e1[_0x76ab('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index ac8d168..e572be0 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 _0x098f=['openchannelQueue:','remove','update','emit','length'];(function(_0x4b69f2,_0x243719){var _0x5beec8=function(_0x332c00){while(--_0x332c00){_0x4b69f2['push'](_0x4b69f2['shift']());}};_0x5beec8(++_0x243719);}(_0x098f,0x1c8));var _0xf098=function(_0x56a944,_0x50361a){_0x56a944=_0x56a944-0x0;var _0x1c9794=_0x098f[_0x56a944];return _0x1c9794;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0xf098('0x0'),_0xf098('0x1')];function createListener(_0x154a2e,_0x5de1f5){return function(_0x1f3831){_0x5de1f5[_0xf098('0x2')](_0x154a2e,_0x1f3831);};}function removeListener(_0x5ddf70,_0x5f027c){return function(){OpenchannelQueueEvents['removeListener'](_0x5ddf70,_0x5f027c);};}exports['register']=function(_0x15eb0c){for(var _0x44fe6f=0x0,_0x377066=events[_0xf098('0x3')];_0x44fe6f<_0x377066;_0x44fe6f++){var _0x37595c=events[_0x44fe6f];var _0x1e6a2a=createListener(_0xf098('0x4')+_0x37595c,_0x15eb0c);OpenchannelQueueEvents['on'](_0x37595c,_0x1e6a2a);}}; \ No newline at end of file +var _0x38fb=['update','emit','removeListener','openchannelQueue:','./openchannelQueue.events','save','remove'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x38fb,0x74));var _0xb38f=function(_0x3d5db9,_0x2dbe0a){_0x3d5db9=_0x3d5db9-0x0;var _0x3c114c=_0x38fb[_0x3d5db9];return _0x3c114c;};'use strict';var OpenchannelQueueEvents=require(_0xb38f('0x0'));var events=[_0xb38f('0x1'),_0xb38f('0x2'),_0xb38f('0x3')];function createListener(_0x2ef691,_0x349c4d){return function(_0x4d5608){_0x349c4d[_0xb38f('0x4')](_0x2ef691,_0x4d5608);};}function removeListener(_0x4a40e8,_0x56c968){return function(){OpenchannelQueueEvents[_0xb38f('0x5')](_0x4a40e8,_0x56c968);};}exports['register']=function(_0xd8d792){for(var _0x387c03=0x0,_0x50ab33=events['length'];_0x387c03<_0x50ab33;_0x387c03++){var _0x4f5164=events[_0x387c03];var _0x158bad=createListener(_0xb38f('0x6')+_0x4f5164,_0xd8d792);OpenchannelQueueEvents['on'](_0x4f5164,_0x158bad);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 0050f9f..68e2c86 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 _0x32a7=['../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x32a7,0xcd));var _0x732a=function(_0x2c646c,_0x166dd4){_0x2c646c=_0x2c646c-0x0;var _0x14c3f2=_0x32a7[_0x2c646c];return _0x14c3f2;};'use strict';var multer=require('multer');var util=require(_0x732a('0x0'));var path=require(_0x732a('0x1'));var timeout=require(_0x732a('0x2'));var express=require(_0x732a('0x3'));var router=express[_0x732a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x732a('0x5'));var config=require(_0x732a('0x6'));var controller=require(_0x732a('0x7'));router[_0x732a('0x8')]('/',auth[_0x732a('0x9')](),controller[_0x732a('0xa')]);router['get'](_0x732a('0xb'),auth[_0x732a('0x9')](),controller[_0x732a('0xc')]);router[_0x732a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x732a('0xd')]);router[_0x732a('0xe')]('/',auth[_0x732a('0x9')](),controller[_0x732a('0xf')]);router['put'](_0x732a('0x10'),auth[_0x732a('0x9')](),controller[_0x732a('0x11')]);router[_0x732a('0x12')](_0x732a('0x10'),auth[_0x732a('0x9')](),controller[_0x732a('0x13')]);module[_0x732a('0x14')]=router; \ No newline at end of file +var _0x6f02=['../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x29a377,_0x811d72){var _0x65568d=function(_0x525823){while(--_0x525823){_0x29a377['push'](_0x29a377['shift']());}};_0x65568d(++_0x811d72);}(_0x6f02,0x1f3));var _0x26f0=function(_0x1987f8,_0x5adaac){_0x1987f8=_0x1987f8-0x0;var _0x5545b1=_0x6f02[_0x1987f8];return _0x5545b1;};'use strict';var multer=require(_0x26f0('0x0'));var util=require(_0x26f0('0x1'));var path=require(_0x26f0('0x2'));var timeout=require('connect-timeout');var express=require(_0x26f0('0x3'));var router=express[_0x26f0('0x4')]();var fs_extra=require(_0x26f0('0x5'));var auth=require(_0x26f0('0x6'));var interaction=require(_0x26f0('0x7'));var config=require(_0x26f0('0x8'));var controller=require(_0x26f0('0x9'));router['get']('/',auth[_0x26f0('0xa')](),controller[_0x26f0('0xb')]);router[_0x26f0('0xc')]('/describe',auth[_0x26f0('0xa')](),controller[_0x26f0('0xd')]);router['get'](_0x26f0('0xe'),auth['isAuthenticated'](),controller[_0x26f0('0xf')]);router[_0x26f0('0x10')]('/',auth[_0x26f0('0xa')](),controller[_0x26f0('0x11')]);router[_0x26f0('0x12')]('/:id',auth[_0x26f0('0xa')](),controller[_0x26f0('0x13')]);router['delete'](_0x26f0('0xe'),auth[_0x26f0('0xa')](),controller[_0x26f0('0x14')]);module[_0x26f0('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 9767a06..f9cdd7e 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 _0xbb6b=['DATE','moment','sequelize','STRING'];(function(_0x1d7e08,_0x220bae){var _0x4e1f6a=function(_0x5b9e9f){while(--_0x5b9e9f){_0x1d7e08['push'](_0x1d7e08['shift']());}};_0x4e1f6a(++_0x220bae);}(_0xbb6b,0x1ed));var _0xbbb6=function(_0xd535bc,_0x54c2b4){_0xd535bc=_0xd535bc-0x0;var _0x530e6d=_0xbb6b[_0xd535bc];return _0x530e6d;};'use strict';var moment=require(_0xbbb6('0x0'));var Sequelize=require(_0xbbb6('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbbb6('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbbb6('0x2')]},'joinAt':{'type':Sequelize[_0xbbb6('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbbb6('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xbbb6('0x2')]}}; \ No newline at end of file +var _0xbdb1=['exports','STRING','DATE','moment','sequelize'];(function(_0x2b0245,_0x9270b1){var _0x50c5e8=function(_0x62bca){while(--_0x62bca){_0x2b0245['push'](_0x2b0245['shift']());}};_0x50c5e8(++_0x9270b1);}(_0xbdb1,0x12a));var _0x1bdb=function(_0x379799,_0x4ccf16){_0x379799=_0x379799-0x0;var _0x46e431=_0xbdb1[_0x379799];return _0x46e431;};'use strict';var moment=require(_0x1bdb('0x0'));var Sequelize=require(_0x1bdb('0x1'));module[_0x1bdb('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x1bdb('0x3')]},'joinAt':{'type':Sequelize[_0x1bdb('0x4')]},'leaveAt':{'type':Sequelize[_0x1bdb('0x4')]},'acceptAt':{'type':Sequelize[_0x1bdb('0x4')]},'exitAt':{'type':Sequelize[_0x1bdb('0x4')]},'reason':{'type':Sequelize[_0x1bdb('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 1349931..76ec403 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 _0x81cd=['where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','attributes','create','body','catch','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','nolimit','order','sort'];(function(_0x166414,_0x36bd02){var _0x3c24ea=function(_0x3ab4d2){while(--_0x3ab4d2){_0x166414['push'](_0x166414['shift']());}};_0x3c24ea(++_0x36bd02);}(_0x81cd,0x100));var _0xd81c=function(_0x11ae20,_0x257ec6){_0x11ae20=_0x11ae20-0x0;var _0xc8800f=_0x81cd[_0x11ae20];return _0xc8800f;};'use strict';var emlformat=require(_0xd81c('0x0'));var rimraf=require(_0xd81c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd81c('0x2'));var moment=require(_0xd81c('0x3'));var BPromise=require(_0xd81c('0x4'));var Mustache=require(_0xd81c('0x5'));var util=require(_0xd81c('0x6'));var path=require(_0xd81c('0x7'));var sox=require(_0xd81c('0x8'));var csv=require(_0xd81c('0x9'));var ejs=require(_0xd81c('0xa'));var fs=require('fs');var fs_extra=require(_0xd81c('0xb'));var _=require('lodash');var squel=require(_0xd81c('0xc'));var crypto=require(_0xd81c('0xd'));var jsforce=require(_0xd81c('0xe'));var deskjs=require(_0xd81c('0xf'));var toCsv=require(_0xd81c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd81c('0x10'));var authService=require(_0xd81c('0x11'));var qs=require(_0xd81c('0x12'));var as=require(_0xd81c('0x13'));var hardwareService=require(_0xd81c('0x14'));var logger=require(_0xd81c('0x15'))(_0xd81c('0x16'));var utils=require(_0xd81c('0x17'));var config=require(_0xd81c('0x18'));var licenseUtil=require(_0xd81c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d09fb,_0x87f703){_0x87f703=_0x87f703||0xcc;return function(_0xb20a7){if(_0xb20a7){return _0x5d09fb['sendStatus'](_0x87f703);}return _0x5d09fb[_0xd81c('0x1a')](_0x87f703)['end']();};}function respondWithResult(_0x38fdeb,_0x1269b0){_0x1269b0=_0x1269b0||0xc8;return function(_0x2bcd89){if(_0x2bcd89){return _0x38fdeb[_0xd81c('0x1a')](_0x1269b0)['json'](_0x2bcd89);}};}function respondWithFilteredResult(_0x260706,_0x9c5a43){return function(_0x1a2d94){if(_0x1a2d94){var _0x3d28d=typeof _0x9c5a43[_0xd81c('0x1b')]===_0xd81c('0x1c')&&typeof _0x9c5a43[_0xd81c('0x1d')]==='undefined';var _0x102afa=_0x1a2d94[_0xd81c('0x1e')];var _0x68230e=_0x3d28d?0x0:_0x9c5a43[_0xd81c('0x1b')];var _0x5d5401=_0x3d28d?_0x1a2d94[_0xd81c('0x1e')]:_0x9c5a43[_0xd81c('0x1b')]+_0x9c5a43[_0xd81c('0x1d')];var _0x2bf4a4;if(_0x5d5401>=_0x102afa){_0x5d5401=_0x102afa;_0x2bf4a4=0xc8;}else{_0x2bf4a4=0xce;}_0x260706['status'](_0x2bf4a4);return _0x260706['set'](_0xd81c('0x1f'),_0x68230e+'-'+_0x5d5401+'/'+_0x102afa)[_0xd81c('0x20')](_0x1a2d94);}return null;};}function patchUpdates(_0x5aad6a){return function(_0x11e9d9){try{jsonpatch[_0xd81c('0x21')](_0x11e9d9,_0x5aad6a,!![]);}catch(_0x29280c){return BPromise[_0xd81c('0x22')](_0x29280c);}return _0x11e9d9[_0xd81c('0x23')]();};}function saveUpdates(_0xfd6664,_0x4d0ccc){return function(_0x3dc088){if(_0x3dc088){return _0x3dc088[_0xd81c('0x24')](_0xfd6664)[_0xd81c('0x25')](function(_0x711a36){return _0x711a36;});}return null;};}function removeEntity(_0x2fba63,_0x38d18b){return function(_0x24b15c){if(_0x24b15c){return _0x24b15c[_0xd81c('0x26')]()[_0xd81c('0x25')](function(){_0x2fba63['status'](0xcc)[_0xd81c('0x27')]();});}};}function handleEntityNotFound(_0x335d4e,_0x45e144){return function(_0x5bb34e){if(!_0x5bb34e){_0x335d4e[_0xd81c('0x28')](0x194);}return _0x5bb34e;};}function handleError(_0x97eb28,_0x791220){_0x791220=_0x791220||0x1f4;return function(_0x160459){logger[_0xd81c('0x29')](_0x160459['stack']);if(_0x160459['name']){delete _0x160459[_0xd81c('0x2a')];}_0x97eb28[_0xd81c('0x1a')](_0x791220)[_0xd81c('0x2b')](_0x160459);};}exports[_0xd81c('0x2c')]=function(_0x154661,_0xeb6aed){var _0x493902={},_0x2414cd={},_0x380ed5={'count':0x0,'rows':[]};var _0xd04da6=_[_0xd81c('0x2d')](db[_0xd81c('0x2e')][_0xd81c('0x2f')],function(_0x5b593d){return{'name':_0x5b593d[_0xd81c('0x30')],'type':_0x5b593d[_0xd81c('0x31')][_0xd81c('0x32')]};});_0x2414cd[_0xd81c('0x33')]=_[_0xd81c('0x2d')](_0xd04da6,'name');_0x2414cd[_0xd81c('0x34')]=_[_0xd81c('0x35')](_0x154661[_0xd81c('0x34')]);_0x2414cd['filters']=_[_0xd81c('0x36')](_0x2414cd['model'],_0x2414cd[_0xd81c('0x34')]);_0x493902['attributes']=_[_0xd81c('0x36')](_0x2414cd[_0xd81c('0x33')],qs[_0xd81c('0x37')](_0x154661[_0xd81c('0x34')]['fields']));_0x493902['attributes']=_0x493902['attributes'][_0xd81c('0x38')]?_0x493902['attributes']:_0x2414cd[_0xd81c('0x33')];if(!_0x154661[_0xd81c('0x34')]['hasOwnProperty'](_0xd81c('0x39'))){_0x493902[_0xd81c('0x1d')]=qs[_0xd81c('0x1d')](_0x154661['query']['limit']);_0x493902['offset']=qs[_0xd81c('0x1b')](_0x154661['query']['offset']);}_0x493902[_0xd81c('0x3a')]=qs[_0xd81c('0x3b')](_0x154661[_0xd81c('0x34')][_0xd81c('0x3b')]);_0x493902[_0xd81c('0x3c')]=qs[_0xd81c('0x3d')](_[_0xd81c('0x3e')](_0x154661[_0xd81c('0x34')],_0x2414cd[_0xd81c('0x3d')]),_0xd04da6);if(_0x154661[_0xd81c('0x34')][_0xd81c('0x3f')]){_0x493902['where']=_[_0xd81c('0x40')](_0x493902[_0xd81c('0x3c')],{'$or':_['map'](_0xd04da6,function(_0x42adc9){if(_0x42adc9['type']!==_0xd81c('0x41')){var _0x15980c={};_0x15980c[_0x42adc9[_0xd81c('0x2a')]]={'$like':'%'+_0x154661[_0xd81c('0x34')]['filter']+'%'};return _0x15980c;}})});}_0x493902=_[_0xd81c('0x40')]({},_0x493902,_0x154661[_0xd81c('0x42')]);var _0x15a080={'where':_0x493902[_0xd81c('0x3c')]};return db[_0xd81c('0x2e')][_0xd81c('0x1e')](_0x15a080)[_0xd81c('0x25')](function(_0x21373f){_0x380ed5[_0xd81c('0x1e')]=_0x21373f;if(_0x154661[_0xd81c('0x34')][_0xd81c('0x43')]){_0x493902[_0xd81c('0x44')]=[{'all':!![]}];}return db[_0xd81c('0x2e')][_0xd81c('0x45')](_0x493902);})['then'](function(_0xb9ab9c){_0x380ed5[_0xd81c('0x46')]=_0xb9ab9c;return _0x380ed5;})[_0xd81c('0x25')](respondWithFilteredResult(_0xeb6aed,_0x493902))['catch'](handleError(_0xeb6aed,null));};exports[_0xd81c('0x47')]=function(_0x37872e,_0x5a487f){var _0x11400b={'raw':!![],'where':{'id':_0x37872e[_0xd81c('0x48')]['id']}},_0x285cba={};_0x285cba[_0xd81c('0x33')]=_[_0xd81c('0x35')](db[_0xd81c('0x2e')][_0xd81c('0x2f')]);_0x285cba[_0xd81c('0x34')]=_[_0xd81c('0x35')](_0x37872e['query']);_0x285cba['filters']=_[_0xd81c('0x36')](_0x285cba[_0xd81c('0x33')],_0x285cba[_0xd81c('0x34')]);_0x11400b[_0xd81c('0x49')]=_['intersection'](_0x285cba[_0xd81c('0x33')],qs[_0xd81c('0x37')](_0x37872e[_0xd81c('0x34')][_0xd81c('0x37')]));_0x11400b[_0xd81c('0x49')]=_0x11400b[_0xd81c('0x49')][_0xd81c('0x38')]?_0x11400b['attributes']:_0x285cba[_0xd81c('0x33')];if(_0x37872e[_0xd81c('0x34')][_0xd81c('0x43')]){_0x11400b['include']=[{'all':!![]}];}_0x11400b=_[_0xd81c('0x40')]({},_0x11400b,_0x37872e[_0xd81c('0x42')]);return db[_0xd81c('0x2e')]['find'](_0x11400b)['then'](handleEntityNotFound(_0x5a487f,null))[_0xd81c('0x25')](respondWithResult(_0x5a487f,null))['catch'](handleError(_0x5a487f,null));};exports[_0xd81c('0x4a')]=function(_0x51d51c,_0x175941){return db['OpenchannelQueueReport']['create'](_0x51d51c[_0xd81c('0x4b')],{})[_0xd81c('0x25')](respondWithResult(_0x175941,0xc9))['catch'](handleError(_0x175941,null));};exports[_0xd81c('0x24')]=function(_0x61a09a,_0x2196c7){if(_0x61a09a['body']['id']){delete _0x61a09a[_0xd81c('0x4b')]['id'];}return db[_0xd81c('0x2e')]['find']({'where':{'id':_0x61a09a['params']['id']}})['then'](handleEntityNotFound(_0x2196c7,null))[_0xd81c('0x25')](saveUpdates(_0x61a09a['body'],null))['then'](respondWithResult(_0x2196c7,null))[_0xd81c('0x4c')](handleError(_0x2196c7,null));};exports['destroy']=function(_0x514ff5,_0x241f18){return db[_0xd81c('0x2e')][_0xd81c('0x4d')]({'where':{'id':_0x514ff5[_0xd81c('0x48')]['id']}})['then'](handleEntityNotFound(_0x241f18,null))[_0xd81c('0x25')](removeEntity(_0x241f18,null))[_0xd81c('0x4c')](handleError(_0x241f18,null));};exports['describe']=function(_0x2400c0,_0x1f0223){return db[_0xd81c('0x2e')][_0xd81c('0x4e')]()[_0xd81c('0x25')](respondWithResult(_0x1f0223,null))['catch'](handleError(_0x1f0223,null));}; \ No newline at end of file +var _0x321c=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3e84d8,_0x4049ec){var _0xd0cab3=function(_0x76b341){while(--_0x76b341){_0x3e84d8['push'](_0x3e84d8['shift']());}};_0xd0cab3(++_0x4049ec);}(_0x321c,0x1a5));var _0xc321=function(_0x2b39e4,_0x104d9b){_0x2b39e4=_0x2b39e4-0x0;var _0x28bf8c=_0x321c[_0x2b39e4];return _0x28bf8c;};'use strict';var emlformat=require(_0xc321('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc321('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc321('0x2'));var moment=require(_0xc321('0x3'));var BPromise=require(_0xc321('0x4'));var Mustache=require('mustache');var util=require(_0xc321('0x5'));var path=require(_0xc321('0x6'));var sox=require(_0xc321('0x7'));var csv=require('to-csv');var ejs=require(_0xc321('0x8'));var fs=require('fs');var fs_extra=require(_0xc321('0x9'));var _=require('lodash');var squel=require(_0xc321('0xa'));var crypto=require(_0xc321('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc321('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc321('0xd'));var Papa=require(_0xc321('0xe'));var Redis=require(_0xc321('0xf'));var authService=require(_0xc321('0x10'));var qs=require(_0xc321('0x11'));var as=require(_0xc321('0x12'));var hardwareService=require(_0xc321('0x13'));var logger=require(_0xc321('0x14'))('api');var utils=require(_0xc321('0x15'));var config=require(_0xc321('0x16'));var licenseUtil=require(_0xc321('0x17'));var db=require(_0xc321('0x18'))['db'];function respondWithStatusCode(_0x39a30d,_0x1a9f96){_0x1a9f96=_0x1a9f96||0xcc;return function(_0x3a3b96){if(_0x3a3b96){return _0x39a30d[_0xc321('0x19')](_0x1a9f96);}return _0x39a30d[_0xc321('0x1a')](_0x1a9f96)[_0xc321('0x1b')]();};}function respondWithResult(_0x34f979,_0x1056e4){_0x1056e4=_0x1056e4||0xc8;return function(_0x1c98d1){if(_0x1c98d1){return _0x34f979[_0xc321('0x1a')](_0x1056e4)[_0xc321('0x1c')](_0x1c98d1);}};}function respondWithFilteredResult(_0x52b6f0,_0x2b9b94){return function(_0x32c2fd){if(_0x32c2fd){var _0x4a6b9c=typeof _0x2b9b94['offset']===_0xc321('0x1d')&&typeof _0x2b9b94['limit']===_0xc321('0x1d');var _0x4e7be6=_0x32c2fd[_0xc321('0x1e')];var _0x31739a=_0x4a6b9c?0x0:_0x2b9b94[_0xc321('0x1f')];var _0x385c37=_0x4a6b9c?_0x32c2fd[_0xc321('0x1e')]:_0x2b9b94[_0xc321('0x1f')]+_0x2b9b94[_0xc321('0x20')];var _0x176715;if(_0x385c37>=_0x4e7be6){_0x385c37=_0x4e7be6;_0x176715=0xc8;}else{_0x176715=0xce;}_0x52b6f0['status'](_0x176715);return _0x52b6f0[_0xc321('0x21')](_0xc321('0x22'),_0x31739a+'-'+_0x385c37+'/'+_0x4e7be6)[_0xc321('0x1c')](_0x32c2fd);}return null;};}function patchUpdates(_0x5611c7){return function(_0x1600ca){try{jsonpatch['apply'](_0x1600ca,_0x5611c7,!![]);}catch(_0x40b5a7){return BPromise[_0xc321('0x23')](_0x40b5a7);}return _0x1600ca[_0xc321('0x24')]();};}function saveUpdates(_0x360eab,_0x52df88){return function(_0x2426c3){if(_0x2426c3){return _0x2426c3[_0xc321('0x25')](_0x360eab)[_0xc321('0x26')](function(_0x3af2a4){return _0x3af2a4;});}return null;};}function removeEntity(_0xa7d6fc,_0x5a7e0f){return function(_0x1b5125){if(_0x1b5125){return _0x1b5125[_0xc321('0x27')]()[_0xc321('0x26')](function(){_0xa7d6fc[_0xc321('0x1a')](0xcc)[_0xc321('0x1b')]();});}};}function handleEntityNotFound(_0x5ddec6,_0x2f89db){return function(_0x3f98c8){if(!_0x3f98c8){_0x5ddec6['sendStatus'](0x194);}return _0x3f98c8;};}function handleError(_0x3beb40,_0x3a3291){_0x3a3291=_0x3a3291||0x1f4;return function(_0x1f01d3){logger['error'](_0x1f01d3[_0xc321('0x28')]);if(_0x1f01d3[_0xc321('0x29')]){delete _0x1f01d3[_0xc321('0x29')];}_0x3beb40['status'](_0x3a3291)['send'](_0x1f01d3);};}exports['index']=function(_0xdc8444,_0x3e8771){var _0x380982={},_0x1d744e={},_0x2314b4={'count':0x0,'rows':[]};var _0xefde12=_[_0xc321('0x2a')](db[_0xc321('0x2b')][_0xc321('0x2c')],function(_0x2eb97f){return{'name':_0x2eb97f[_0xc321('0x2d')],'type':_0x2eb97f[_0xc321('0x2e')][_0xc321('0x2f')]};});_0x1d744e['model']=_[_0xc321('0x2a')](_0xefde12,'name');_0x1d744e[_0xc321('0x30')]=_[_0xc321('0x31')](_0xdc8444[_0xc321('0x30')]);_0x1d744e[_0xc321('0x32')]=_['intersection'](_0x1d744e[_0xc321('0x33')],_0x1d744e[_0xc321('0x30')]);_0x380982[_0xc321('0x34')]=_[_0xc321('0x35')](_0x1d744e['model'],qs[_0xc321('0x36')](_0xdc8444[_0xc321('0x30')][_0xc321('0x36')]));_0x380982[_0xc321('0x34')]=_0x380982[_0xc321('0x34')][_0xc321('0x37')]?_0x380982['attributes']:_0x1d744e[_0xc321('0x33')];if(!_0xdc8444[_0xc321('0x30')]['hasOwnProperty'](_0xc321('0x38'))){_0x380982['limit']=qs['limit'](_0xdc8444[_0xc321('0x30')][_0xc321('0x20')]);_0x380982['offset']=qs[_0xc321('0x1f')](_0xdc8444[_0xc321('0x30')][_0xc321('0x1f')]);}_0x380982[_0xc321('0x39')]=qs[_0xc321('0x3a')](_0xdc8444['query'][_0xc321('0x3a')]);_0x380982[_0xc321('0x3b')]=qs[_0xc321('0x32')](_['pick'](_0xdc8444['query'],_0x1d744e[_0xc321('0x32')]),_0xefde12);if(_0xdc8444['query'][_0xc321('0x3c')]){_0x380982[_0xc321('0x3b')]=_['merge'](_0x380982[_0xc321('0x3b')],{'$or':_[_0xc321('0x2a')](_0xefde12,function(_0x5d04c3){if(_0x5d04c3[_0xc321('0x2e')]!==_0xc321('0x3d')){var _0x9b3c9={};_0x9b3c9[_0x5d04c3['name']]={'$like':'%'+_0xdc8444[_0xc321('0x30')]['filter']+'%'};return _0x9b3c9;}})});}_0x380982=_[_0xc321('0x3e')]({},_0x380982,_0xdc8444[_0xc321('0x3f')]);var _0x886d7b={'where':_0x380982['where']};return db[_0xc321('0x2b')][_0xc321('0x1e')](_0x886d7b)['then'](function(_0x5a30cf){_0x2314b4['count']=_0x5a30cf;if(_0xdc8444['query'][_0xc321('0x40')]){_0x380982['include']=[{'all':!![]}];}return db[_0xc321('0x2b')][_0xc321('0x41')](_0x380982);})['then'](function(_0x150b79){_0x2314b4[_0xc321('0x42')]=_0x150b79;return _0x2314b4;})[_0xc321('0x26')](respondWithFilteredResult(_0x3e8771,_0x380982))[_0xc321('0x43')](handleError(_0x3e8771,null));};exports['show']=function(_0x5736cb,_0x1d0e4f){var _0x122e77={'raw':!![],'where':{'id':_0x5736cb[_0xc321('0x44')]['id']}},_0x4119d2={};_0x4119d2[_0xc321('0x33')]=_['keys'](db[_0xc321('0x2b')]['rawAttributes']);_0x4119d2[_0xc321('0x30')]=_[_0xc321('0x31')](_0x5736cb[_0xc321('0x30')]);_0x4119d2[_0xc321('0x32')]=_['intersection'](_0x4119d2[_0xc321('0x33')],_0x4119d2[_0xc321('0x30')]);_0x122e77[_0xc321('0x34')]=_[_0xc321('0x35')](_0x4119d2[_0xc321('0x33')],qs[_0xc321('0x36')](_0x5736cb[_0xc321('0x30')]['fields']));_0x122e77[_0xc321('0x34')]=_0x122e77[_0xc321('0x34')][_0xc321('0x37')]?_0x122e77['attributes']:_0x4119d2[_0xc321('0x33')];if(_0x5736cb[_0xc321('0x30')][_0xc321('0x40')]){_0x122e77['include']=[{'all':!![]}];}_0x122e77=_[_0xc321('0x3e')]({},_0x122e77,_0x5736cb[_0xc321('0x3f')]);return db['OpenchannelQueueReport'][_0xc321('0x45')](_0x122e77)[_0xc321('0x26')](handleEntityNotFound(_0x1d0e4f,null))['then'](respondWithResult(_0x1d0e4f,null))[_0xc321('0x43')](handleError(_0x1d0e4f,null));};exports[_0xc321('0x46')]=function(_0x6f8f90,_0x2c6d18){return db[_0xc321('0x2b')][_0xc321('0x46')](_0x6f8f90[_0xc321('0x47')],{})[_0xc321('0x26')](respondWithResult(_0x2c6d18,0xc9))[_0xc321('0x43')](handleError(_0x2c6d18,null));};exports['update']=function(_0x462a65,_0xa65e7){if(_0x462a65['body']['id']){delete _0x462a65['body']['id'];}return db[_0xc321('0x2b')]['find']({'where':{'id':_0x462a65[_0xc321('0x44')]['id']}})[_0xc321('0x26')](handleEntityNotFound(_0xa65e7,null))['then'](saveUpdates(_0x462a65[_0xc321('0x47')],null))[_0xc321('0x26')](respondWithResult(_0xa65e7,null))[_0xc321('0x43')](handleError(_0xa65e7,null));};exports[_0xc321('0x27')]=function(_0x2f06df,_0x3dfdb0){return db[_0xc321('0x2b')][_0xc321('0x45')]({'where':{'id':_0x2f06df['params']['id']}})['then'](handleEntityNotFound(_0x3dfdb0,null))['then'](removeEntity(_0x3dfdb0,null))[_0xc321('0x43')](handleError(_0x3dfdb0,null));};exports[_0xc321('0x48')]=function(_0x194774,_0x221be5){return db[_0xc321('0x2b')][_0xc321('0x48')]()[_0xc321('0x26')](respondWithResult(_0x221be5,null))[_0xc321('0x43')](handleError(_0x221be5,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 2e1d0c2..a1f60d0 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x2acc70,_0x198b20){var _0x1d1e9e=function(_0x38bf48){while(--_0x38bf48){_0x2acc70['push'](_0x2acc70['shift']());}};_0x1d1e9e(++_0x198b20);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x46c134,_0x1ce3a8){var _0x1f2e9b=function(_0x3e688f){while(--_0x3e688f){_0x46c134['push'](_0x46c134['shift']());}};_0x1f2e9b(++_0x1ce3a8);}(_0x1261,0x144));var _0x1126=function(_0x5c1930,_0x1b15e7){_0x5c1930=_0x5c1930-0x0;var _0x163a34=_0x1261[_0x5c1930];return _0x163a34;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index d19f92e..9b27391 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 _0xeb3b=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','raw','debug','stringify','UpdateOpenchannelQueueReport','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x541095,_0x582b30){_0x541095=_0x541095-0x0;var _0x5a2c40=_0xeb3b[_0x541095];return _0x5a2c40;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));var BPromise=require(_0xbeb3('0x3'));var rs=require(_0xbeb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeb3('0x5'));var logger=require('../../config/logger')(_0xbeb3('0x6'));var config=require('../../config/environment');var jayson=require(_0xbeb3('0x7'));var client=jayson[_0xbeb3('0x8')][_0xbeb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x294cc9,_0x406927,_0x143255){return new BPromise(function(_0x5a6a06,_0x241dbb){return client[_0xbeb3('0xa')](_0x294cc9,_0x143255)[_0xbeb3('0xb')](function(_0x3b61ac){logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,_0xbeb3('0xe'));logger['debug'](_0xbeb3('0xf'),_0x406927,_0xbeb3('0xe'),JSON['stringify'](_0x3b61ac));if(_0x3b61ac[_0xbeb3('0x10')]){if(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x11')]===0x1f4){logger[_0xbeb3('0x10')](_0xbeb3('0xd'),_0x406927,_0x3b61ac[_0xbeb3('0x10')]['message']);return _0x241dbb(_0x3b61ac['error'][_0xbeb3('0x12')]);}logger[_0xbeb3('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x406927,_0x3b61ac['error'][_0xbeb3('0x12')]);return _0x5a6a06(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x12')]);}else{logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,'request\x20sent');_0x5a6a06(_0x3b61ac[_0xbeb3('0x13')]['message']);}})[_0xbeb3('0x14')](function(_0x4e7d99){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x406927,_0x4e7d99);_0x241dbb(_0x4e7d99);});});}exports[_0xbeb3('0x15')]=function(_0x44a4bb){var _0x32275b=this;return new Promise(function(_0x10b15d,_0x5d0689){return db[_0xbeb3('0x16')][_0xbeb3('0x17')](_0x44a4bb[_0xbeb3('0x18')],{'raw':_0x44a4bb['options']?_0x44a4bb['options'][_0xbeb3('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1d917b){logger['info']('CreateOpenchannelQueueReport',_0x44a4bb);logger[_0xbeb3('0x1a')](_0xbeb3('0x15'),_0x44a4bb,JSON[_0xbeb3('0x1b')](_0x1d917b));_0x10b15d(_0x1d917b);})['catch'](function(_0x301899){logger[_0xbeb3('0x10')]('CreateOpenchannelQueueReport',_0x301899[_0xbeb3('0x12')],_0x44a4bb);_0x5d0689(_0x32275b[_0xbeb3('0x10')](0x1f4,_0x301899['message']));});});};exports[_0xbeb3('0x1c')]=function(_0x278fe4){var _0x16b079=this;return new Promise(function(_0x42c6c3,_0x2bc188){return db[_0xbeb3('0x16')][_0xbeb3('0x1d')](_0x278fe4[_0xbeb3('0x18')],{'raw':_0x278fe4[_0xbeb3('0x1e')]?_0x278fe4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x278fe4[_0xbeb3('0x1e')]?_0x278fe4['options'][_0xbeb3('0x1f')]||null:null,'attributes':_0x278fe4[_0xbeb3('0x1e')]?_0x278fe4[_0xbeb3('0x1e')][_0xbeb3('0x20')]||null:null,'limit':_0x278fe4['options']?_0x278fe4[_0xbeb3('0x1e')]['limit']||null:null})[_0xbeb3('0xb')](function(_0xab301c){logger['info']('UpdateOpenchannelQueueReport',_0x278fe4);logger[_0xbeb3('0x1a')]('UpdateOpenchannelQueueReport',_0x278fe4,JSON['stringify'](_0xab301c));_0x42c6c3(_0xab301c);})['catch'](function(_0x5bfef7){logger[_0xbeb3('0x10')]('UpdateOpenchannelQueueReport',_0x5bfef7[_0xbeb3('0x12')],_0x278fe4);_0x2bc188(_0x16b079[_0xbeb3('0x10')](0x1f4,_0x5bfef7[_0xbeb3('0x12')]));});});}; \ No newline at end of file +var _0x8cda=['catch','create','body','options','raw','then','CreateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','limit','UpdateOpenchannelQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent'];(function(_0x282916,_0x29c453){var _0x317b39=function(_0x52a106){while(--_0x52a106){_0x282916['push'](_0x282916['shift']());}};_0x317b39(++_0x29c453);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa8cd('0x0'));var moment=require(_0xa8cd('0x1'));var BPromise=require(_0xa8cd('0x2'));var rs=require(_0xa8cd('0x3'));var fs=require('fs');var Redis=require(_0xa8cd('0x4'));var db=require(_0xa8cd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8cd('0x6'))(_0xa8cd('0x7'));var config=require(_0xa8cd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8cd('0x9')][_0xa8cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1362c3,_0x273d2f,_0x2b9b51){return new BPromise(function(_0x2481ba,_0x13f394){return client[_0xa8cd('0xb')](_0x1362c3,_0x2b9b51)['then'](function(_0x50b8ee){logger['info'](_0xa8cd('0xc'),_0x273d2f,'request\x20sent');logger[_0xa8cd('0xd')](_0xa8cd('0xe'),_0x273d2f,'request\x20sent',JSON[_0xa8cd('0xf')](_0x50b8ee));if(_0x50b8ee[_0xa8cd('0x10')]){if(_0x50b8ee['error']['code']===0x1f4){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x50b8ee[_0xa8cd('0x10')][_0xa8cd('0x11')]);return _0x13f394(_0x50b8ee[_0xa8cd('0x10')]['message']);}logger[_0xa8cd('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x273d2f,_0x50b8ee[_0xa8cd('0x10')]['message']);return _0x2481ba(_0x50b8ee[_0xa8cd('0x10')]['message']);}else{logger[_0xa8cd('0x12')](_0xa8cd('0xc'),_0x273d2f,_0xa8cd('0x13'));_0x2481ba(_0x50b8ee['result']['message']);}})[_0xa8cd('0x14')](function(_0x6d5f40){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x6d5f40);_0x13f394(_0x6d5f40);});});}exports['CreateOpenchannelQueueReport']=function(_0x128a90){var _0x52252b=this;return new Promise(function(_0x1cacd5,_0x2ef224){return db['OpenchannelQueueReport'][_0xa8cd('0x15')](_0x128a90[_0xa8cd('0x16')],{'raw':_0x128a90['options']?_0x128a90[_0xa8cd('0x17')][_0xa8cd('0x18')]===undefined?!![]:![]:!![]})[_0xa8cd('0x19')](function(_0x289cb6){logger[_0xa8cd('0x12')]('CreateOpenchannelQueueReport',_0x128a90);logger[_0xa8cd('0xd')](_0xa8cd('0x1a'),_0x128a90,JSON[_0xa8cd('0xf')](_0x289cb6));_0x1cacd5(_0x289cb6);})[_0xa8cd('0x14')](function(_0x4f4093){logger[_0xa8cd('0x10')]('CreateOpenchannelQueueReport',_0x4f4093['message'],_0x128a90);_0x2ef224(_0x52252b[_0xa8cd('0x10')](0x1f4,_0x4f4093[_0xa8cd('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1c7b31){var _0x26d35a=this;return new Promise(function(_0xfd170,_0x43462d){return db[_0xa8cd('0x1b')][_0xa8cd('0x1c')](_0x1c7b31[_0xa8cd('0x16')],{'raw':_0x1c7b31['options']?_0x1c7b31[_0xa8cd('0x17')][_0xa8cd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c7b31[_0xa8cd('0x17')]?_0x1c7b31[_0xa8cd('0x17')][_0xa8cd('0x1d')]||null:null,'attributes':_0x1c7b31[_0xa8cd('0x17')]?_0x1c7b31['options'][_0xa8cd('0x1e')]||null:null,'limit':_0x1c7b31[_0xa8cd('0x17')]?_0x1c7b31[_0xa8cd('0x17')][_0xa8cd('0x1f')]||null:null})[_0xa8cd('0x19')](function(_0x2241f8){logger[_0xa8cd('0x12')](_0xa8cd('0x20'),_0x1c7b31);logger[_0xa8cd('0xd')](_0xa8cd('0x20'),_0x1c7b31,JSON[_0xa8cd('0xf')](_0x2241f8));_0xfd170(_0x2241f8);})[_0xa8cd('0x14')](function(_0x471052){logger[_0xa8cd('0x10')](_0xa8cd('0x20'),_0x471052[_0xa8cd('0x11')],_0x1c7b31);_0x43462d(_0x26d35a['error'](0x1f4,_0x471052['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 335c7a1..c720c7d 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 _0x55aa=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x475687,_0x782d14){var _0x4fc3b5=function(_0x8ef69e){while(--_0x8ef69e){_0x475687['push'](_0x475687['shift']());}};_0x4fc3b5(++_0x782d14);}(_0x55aa,0x111));var _0xa55a=function(_0x3c0645,_0xde815e){_0x3c0645=_0x3c0645-0x0;var _0x2c5e49=_0x55aa[_0x3c0645];return _0x2c5e49;};'use strict';var multer=require(_0xa55a('0x0'));var util=require(_0xa55a('0x1'));var path=require(_0xa55a('0x2'));var timeout=require(_0xa55a('0x3'));var express=require(_0xa55a('0x4'));var router=express[_0xa55a('0x5')]();var fs_extra=require(_0xa55a('0x6'));var auth=require(_0xa55a('0x7'));var interaction=require(_0xa55a('0x8'));var config=require(_0xa55a('0x9'));var controller=require('./openchannelTransferReport.controller');router[_0xa55a('0xa')]('/',auth['isAuthenticated'](),controller[_0xa55a('0xb')]);router[_0xa55a('0xa')](_0xa55a('0xc'),auth[_0xa55a('0xd')](),controller['describe']);router[_0xa55a('0xa')](_0xa55a('0xe'),auth[_0xa55a('0xd')](),controller[_0xa55a('0xf')]);router[_0xa55a('0x10')]('/',auth['isAuthenticated'](),controller[_0xa55a('0x11')]);router[_0xa55a('0x12')]('/:id',auth[_0xa55a('0xd')](),controller[_0xa55a('0x13')]);router[_0xa55a('0x14')]('/:id',auth[_0xa55a('0xd')](),controller[_0xa55a('0x15')]);module[_0xa55a('0x16')]=router; \ No newline at end of file +var _0x1958=['util','path','express','Router','fs-extra','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer'];(function(_0x23c6f4,_0x12a43d){var _0x4de71b=function(_0x24ff3d){while(--_0x24ff3d){_0x23c6f4['push'](_0x23c6f4['shift']());}};_0x4de71b(++_0x12a43d);}(_0x1958,0xfb));var _0x8195=function(_0x4d453c,_0x311b8c){_0x4d453c=_0x4d453c-0x0;var _0x4c80ac=_0x1958[_0x4d453c];return _0x4c80ac;};'use strict';var multer=require(_0x8195('0x0'));var util=require(_0x8195('0x1'));var path=require(_0x8195('0x2'));var timeout=require('connect-timeout');var express=require(_0x8195('0x3'));var router=express[_0x8195('0x4')]();var fs_extra=require(_0x8195('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8195('0x6'));var controller=require(_0x8195('0x7'));router[_0x8195('0x8')]('/',auth['isAuthenticated'](),controller[_0x8195('0x9')]);router[_0x8195('0x8')](_0x8195('0xa'),auth[_0x8195('0xb')](),controller[_0x8195('0xc')]);router['get'](_0x8195('0xd'),auth[_0x8195('0xb')](),controller[_0x8195('0xe')]);router[_0x8195('0xf')]('/',auth[_0x8195('0xb')](),controller[_0x8195('0x10')]);router[_0x8195('0x11')]('/:id',auth[_0x8195('0xb')](),controller['update']);router[_0x8195('0x12')](_0x8195('0xd'),auth['isAuthenticated'](),controller[_0x8195('0x13')]);module[_0x8195('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index e4297bf..c4c7cd0 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(_0x543bf6,_0x763bd7){var _0x4187b3=function(_0x2e44c7){while(--_0x2e44c7){_0x543bf6['push'](_0x543bf6['shift']());}};_0x4187b3(++_0x763bd7);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3eefc4,_0x13da29){var _0x390870=function(_0x3236fe){while(--_0x3236fe){_0x3eefc4['push'](_0x3eefc4['shift']());}};_0x390870(++_0x13da29);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index a4fa81e..f06feed 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 _0x948d=['limit','count','offset','set','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','OpenchannelTransferReport','rawAttributes','type','key','model','query','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','intersection','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','status','end','undefined'];(function(_0x2695a7,_0x510601){var _0x3715fa=function(_0x5abf19){while(--_0x5abf19){_0x2695a7['push'](_0x2695a7['shift']());}};_0x3715fa(++_0x510601);}(_0x948d,0x1e5));var _0xd948=function(_0x357313,_0x8c348f){_0x357313=_0x357313-0x0;var _0x2042e7=_0x948d[_0x357313];return _0x2042e7;};'use strict';var emlformat=require(_0xd948('0x0'));var rimraf=require(_0xd948('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd948('0x2'));var rp=require(_0xd948('0x3'));var moment=require(_0xd948('0x4'));var BPromise=require(_0xd948('0x5'));var Mustache=require('mustache');var util=require(_0xd948('0x6'));var path=require(_0xd948('0x7'));var sox=require(_0xd948('0x8'));var csv=require('to-csv');var ejs=require(_0xd948('0x9'));var fs=require('fs');var fs_extra=require(_0xd948('0xa'));var _=require('lodash');var squel=require(_0xd948('0xb'));var crypto=require(_0xd948('0xc'));var jsforce=require(_0xd948('0xd'));var deskjs=require(_0xd948('0xe'));var toCsv=require(_0xd948('0xf'));var querystring=require(_0xd948('0x10'));var Papa=require('papaparse');var Redis=require(_0xd948('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd948('0x12'));var as=require(_0xd948('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd948('0x14'))('api');var utils=require(_0xd948('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd948('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4039f8,_0x314eaa){_0x314eaa=_0x314eaa||0xcc;return function(_0x2773af){if(_0x2773af){return _0x4039f8['sendStatus'](_0x314eaa);}return _0x4039f8[_0xd948('0x17')](_0x314eaa)[_0xd948('0x18')]();};}function respondWithResult(_0x4f0029,_0x51c338){_0x51c338=_0x51c338||0xc8;return function(_0x21270a){if(_0x21270a){return _0x4f0029['status'](_0x51c338)['json'](_0x21270a);}};}function respondWithFilteredResult(_0x28ec1b,_0x4a745d){return function(_0x3dc6b0){if(_0x3dc6b0){var _0x142101=typeof _0x4a745d['offset']===_0xd948('0x19')&&typeof _0x4a745d[_0xd948('0x1a')]===_0xd948('0x19');var _0x5e5e6e=_0x3dc6b0[_0xd948('0x1b')];var _0x19ff4c=_0x142101?0x0:_0x4a745d[_0xd948('0x1c')];var _0x2d9af2=_0x142101?_0x3dc6b0['count']:_0x4a745d[_0xd948('0x1c')]+_0x4a745d[_0xd948('0x1a')];var _0x110af5;if(_0x2d9af2>=_0x5e5e6e){_0x2d9af2=_0x5e5e6e;_0x110af5=0xc8;}else{_0x110af5=0xce;}_0x28ec1b[_0xd948('0x17')](_0x110af5);return _0x28ec1b[_0xd948('0x1d')]('Content-Range',_0x19ff4c+'-'+_0x2d9af2+'/'+_0x5e5e6e)[_0xd948('0x1e')](_0x3dc6b0);}return null;};}function patchUpdates(_0x14d8f4){return function(_0x24b31e){try{jsonpatch[_0xd948('0x1f')](_0x24b31e,_0x14d8f4,!![]);}catch(_0x4d5b42){return BPromise[_0xd948('0x20')](_0x4d5b42);}return _0x24b31e[_0xd948('0x21')]();};}function saveUpdates(_0x137880,_0x590c3e){return function(_0x425556){if(_0x425556){return _0x425556[_0xd948('0x22')](_0x137880)[_0xd948('0x23')](function(_0x43f468){return _0x43f468;});}return null;};}function removeEntity(_0x3e8722,_0x2dd070){return function(_0x233490){if(_0x233490){return _0x233490[_0xd948('0x24')]()[_0xd948('0x23')](function(){_0x3e8722['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a80f,_0x562989){return function(_0x545678){if(!_0x545678){_0x54a80f[_0xd948('0x25')](0x194);}return _0x545678;};}function handleError(_0x52fa00,_0x13c7bb){_0x13c7bb=_0x13c7bb||0x1f4;return function(_0x28ae42){logger[_0xd948('0x26')](_0x28ae42['stack']);if(_0x28ae42[_0xd948('0x27')]){delete _0x28ae42[_0xd948('0x27')];}_0x52fa00[_0xd948('0x17')](_0x13c7bb)[_0xd948('0x28')](_0x28ae42);};}exports['index']=function(_0x3d7331,_0x1fecee){var _0x47c660={},_0x38484f={},_0x575e07={'count':0x0,'rows':[]};var _0x2dfb93=_['map'](db[_0xd948('0x29')][_0xd948('0x2a')],function(_0x99d453){return{'name':_0x99d453['fieldName'],'type':_0x99d453[_0xd948('0x2b')][_0xd948('0x2c')]};});_0x38484f[_0xd948('0x2d')]=_['map'](_0x2dfb93,_0xd948('0x27'));_0x38484f['query']=_['keys'](_0x3d7331[_0xd948('0x2e')]);_0x38484f['filters']=_['intersection'](_0x38484f[_0xd948('0x2d')],_0x38484f[_0xd948('0x2e')]);_0x47c660[_0xd948('0x2f')]=_['intersection'](_0x38484f[_0xd948('0x2d')],qs['fields'](_0x3d7331[_0xd948('0x2e')][_0xd948('0x30')]));_0x47c660['attributes']=_0x47c660[_0xd948('0x2f')]['length']?_0x47c660['attributes']:_0x38484f['model'];if(!_0x3d7331['query']['hasOwnProperty'](_0xd948('0x31'))){_0x47c660[_0xd948('0x1a')]=qs['limit'](_0x3d7331['query']['limit']);_0x47c660['offset']=qs[_0xd948('0x1c')](_0x3d7331[_0xd948('0x2e')][_0xd948('0x1c')]);}_0x47c660[_0xd948('0x32')]=qs[_0xd948('0x33')](_0x3d7331[_0xd948('0x2e')]['sort']);_0x47c660[_0xd948('0x34')]=qs[_0xd948('0x35')](_[_0xd948('0x36')](_0x3d7331[_0xd948('0x2e')],_0x38484f['filters']),_0x2dfb93);if(_0x3d7331[_0xd948('0x2e')][_0xd948('0x37')]){_0x47c660['where']=_[_0xd948('0x38')](_0x47c660[_0xd948('0x34')],{'$or':_[_0xd948('0x39')](_0x2dfb93,function(_0x3c0c0a){if(_0x3c0c0a[_0xd948('0x2b')]!==_0xd948('0x3a')){var _0x41f2c5={};_0x41f2c5[_0x3c0c0a[_0xd948('0x27')]]={'$like':'%'+_0x3d7331[_0xd948('0x2e')][_0xd948('0x37')]+'%'};return _0x41f2c5;}})});}_0x47c660=_[_0xd948('0x38')]({},_0x47c660,_0x3d7331[_0xd948('0x3b')]);var _0x97bf24={'where':_0x47c660['where']};return db[_0xd948('0x29')]['count'](_0x97bf24)[_0xd948('0x23')](function(_0x580c81){_0x575e07[_0xd948('0x1b')]=_0x580c81;if(_0x3d7331[_0xd948('0x2e')]['includeAll']){_0x47c660[_0xd948('0x3c')]=[{'all':!![]}];}return db[_0xd948('0x29')][_0xd948('0x3d')](_0x47c660);})[_0xd948('0x23')](function(_0x23854e){_0x575e07[_0xd948('0x3e')]=_0x23854e;return _0x575e07;})['then'](respondWithFilteredResult(_0x1fecee,_0x47c660))[_0xd948('0x3f')](handleError(_0x1fecee,null));};exports[_0xd948('0x40')]=function(_0x63c343,_0x2b6a9d){var _0x164ff8={'raw':!![],'where':{'id':_0x63c343[_0xd948('0x41')]['id']}},_0x16e9de={};_0x16e9de['model']=_[_0xd948('0x42')](db[_0xd948('0x29')]['rawAttributes']);_0x16e9de[_0xd948('0x2e')]=_[_0xd948('0x42')](_0x63c343[_0xd948('0x2e')]);_0x16e9de[_0xd948('0x35')]=_[_0xd948('0x43')](_0x16e9de[_0xd948('0x2d')],_0x16e9de[_0xd948('0x2e')]);_0x164ff8[_0xd948('0x2f')]=_[_0xd948('0x43')](_0x16e9de[_0xd948('0x2d')],qs[_0xd948('0x30')](_0x63c343['query'][_0xd948('0x30')]));_0x164ff8['attributes']=_0x164ff8[_0xd948('0x2f')]['length']?_0x164ff8[_0xd948('0x2f')]:_0x16e9de[_0xd948('0x2d')];if(_0x63c343['query'][_0xd948('0x44')]){_0x164ff8['include']=[{'all':!![]}];}_0x164ff8=_[_0xd948('0x38')]({},_0x164ff8,_0x63c343['options']);return db[_0xd948('0x29')][_0xd948('0x45')](_0x164ff8)[_0xd948('0x23')](handleEntityNotFound(_0x2b6a9d,null))[_0xd948('0x23')](respondWithResult(_0x2b6a9d,null))[_0xd948('0x3f')](handleError(_0x2b6a9d,null));};exports[_0xd948('0x46')]=function(_0x1df8b7,_0xc296f5){return db[_0xd948('0x29')][_0xd948('0x46')](_0x1df8b7[_0xd948('0x47')],{})['then'](respondWithResult(_0xc296f5,0xc9))[_0xd948('0x3f')](handleError(_0xc296f5,null));};exports[_0xd948('0x22')]=function(_0x28a94e,_0x5b8694){if(_0x28a94e[_0xd948('0x47')]['id']){delete _0x28a94e[_0xd948('0x47')]['id'];}return db[_0xd948('0x29')]['find']({'where':{'id':_0x28a94e[_0xd948('0x41')]['id']}})[_0xd948('0x23')](handleEntityNotFound(_0x5b8694,null))[_0xd948('0x23')](saveUpdates(_0x28a94e[_0xd948('0x47')],null))[_0xd948('0x23')](respondWithResult(_0x5b8694,null))[_0xd948('0x3f')](handleError(_0x5b8694,null));};exports[_0xd948('0x24')]=function(_0x4f22eb,_0xa6c2e6){return db[_0xd948('0x29')][_0xd948('0x45')]({'where':{'id':_0x4f22eb[_0xd948('0x41')]['id']}})[_0xd948('0x23')](handleEntityNotFound(_0xa6c2e6,null))['then'](removeEntity(_0xa6c2e6,null))[_0xd948('0x3f')](handleError(_0xa6c2e6,null));};exports[_0xd948('0x48')]=function(_0x13a824,_0x54f7da){return db[_0xd948('0x29')]['describe']()['then'](respondWithResult(_0x54f7da,null))['catch'](handleError(_0x54f7da,null));}; \ No newline at end of file +var _0x6ddb=['json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ddb,0x16b));var _0xb6dd=function(_0x35318e,_0x518d31){_0x35318e=_0x35318e-0x0;var _0x1ad6ed=_0x6ddb[_0x35318e];return _0x1ad6ed;};'use strict';var emlformat=require(_0xb6dd('0x0'));var rimraf=require(_0xb6dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb6dd('0x2'));var rp=require(_0xb6dd('0x3'));var moment=require(_0xb6dd('0x4'));var BPromise=require(_0xb6dd('0x5'));var Mustache=require(_0xb6dd('0x6'));var util=require(_0xb6dd('0x7'));var path=require(_0xb6dd('0x8'));var sox=require(_0xb6dd('0x9'));var csv=require(_0xb6dd('0xa'));var ejs=require(_0xb6dd('0xb'));var fs=require('fs');var fs_extra=require(_0xb6dd('0xc'));var _=require(_0xb6dd('0xd'));var squel=require(_0xb6dd('0xe'));var crypto=require(_0xb6dd('0xf'));var jsforce=require(_0xb6dd('0x10'));var deskjs=require(_0xb6dd('0x11'));var toCsv=require(_0xb6dd('0xa'));var querystring=require(_0xb6dd('0x12'));var Papa=require(_0xb6dd('0x13'));var Redis=require(_0xb6dd('0x14'));var authService=require(_0xb6dd('0x15'));var qs=require(_0xb6dd('0x16'));var as=require(_0xb6dd('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6dd('0x18'))(_0xb6dd('0x19'));var utils=require(_0xb6dd('0x1a'));var config=require(_0xb6dd('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xb6dd('0x1c'))['db'];function respondWithStatusCode(_0x2c9b09,_0x405388){_0x405388=_0x405388||0xcc;return function(_0x242fde){if(_0x242fde){return _0x2c9b09['sendStatus'](_0x405388);}return _0x2c9b09[_0xb6dd('0x1d')](_0x405388)[_0xb6dd('0x1e')]();};}function respondWithResult(_0x47bcea,_0x361060){_0x361060=_0x361060||0xc8;return function(_0x527502){if(_0x527502){return _0x47bcea[_0xb6dd('0x1d')](_0x361060)['json'](_0x527502);}};}function respondWithFilteredResult(_0x571f06,_0x149474){return function(_0x25a9b0){if(_0x25a9b0){var _0x113a1d=typeof _0x149474['offset']===_0xb6dd('0x1f')&&typeof _0x149474[_0xb6dd('0x20')]===_0xb6dd('0x1f');var _0x33bfd7=_0x25a9b0[_0xb6dd('0x21')];var _0x594e50=_0x113a1d?0x0:_0x149474[_0xb6dd('0x22')];var _0x3395dd=_0x113a1d?_0x25a9b0[_0xb6dd('0x21')]:_0x149474[_0xb6dd('0x22')]+_0x149474[_0xb6dd('0x20')];var _0x3487f9;if(_0x3395dd>=_0x33bfd7){_0x3395dd=_0x33bfd7;_0x3487f9=0xc8;}else{_0x3487f9=0xce;}_0x571f06[_0xb6dd('0x1d')](_0x3487f9);return _0x571f06[_0xb6dd('0x23')](_0xb6dd('0x24'),_0x594e50+'-'+_0x3395dd+'/'+_0x33bfd7)[_0xb6dd('0x25')](_0x25a9b0);}return null;};}function patchUpdates(_0x93a122){return function(_0x1ff421){try{jsonpatch[_0xb6dd('0x26')](_0x1ff421,_0x93a122,!![]);}catch(_0x3008a0){return BPromise[_0xb6dd('0x27')](_0x3008a0);}return _0x1ff421[_0xb6dd('0x28')]();};}function saveUpdates(_0x36994d,_0x209ac0){return function(_0x171ed2){if(_0x171ed2){return _0x171ed2[_0xb6dd('0x29')](_0x36994d)[_0xb6dd('0x2a')](function(_0x4355dc){return _0x4355dc;});}return null;};}function removeEntity(_0x55c3ee,_0x5e8e7d){return function(_0x40e615){if(_0x40e615){return _0x40e615[_0xb6dd('0x2b')]()[_0xb6dd('0x2a')](function(){_0x55c3ee[_0xb6dd('0x1d')](0xcc)[_0xb6dd('0x1e')]();});}};}function handleEntityNotFound(_0x58ab2a,_0x402249){return function(_0x495ac8){if(!_0x495ac8){_0x58ab2a[_0xb6dd('0x2c')](0x194);}return _0x495ac8;};}function handleError(_0x38c606,_0x48c75f){_0x48c75f=_0x48c75f||0x1f4;return function(_0x3968ef){logger[_0xb6dd('0x2d')](_0x3968ef[_0xb6dd('0x2e')]);if(_0x3968ef[_0xb6dd('0x2f')]){delete _0x3968ef[_0xb6dd('0x2f')];}_0x38c606[_0xb6dd('0x1d')](_0x48c75f)[_0xb6dd('0x30')](_0x3968ef);};}exports[_0xb6dd('0x31')]=function(_0x54fb89,_0x223a73){var _0x37ed9c={},_0x1101c1={},_0x340f8a={'count':0x0,'rows':[]};var _0x2feddf=_[_0xb6dd('0x32')](db[_0xb6dd('0x33')]['rawAttributes'],function(_0x1422ec){return{'name':_0x1422ec[_0xb6dd('0x34')],'type':_0x1422ec['type'][_0xb6dd('0x35')]};});_0x1101c1[_0xb6dd('0x36')]=_[_0xb6dd('0x32')](_0x2feddf,_0xb6dd('0x2f'));_0x1101c1[_0xb6dd('0x37')]=_[_0xb6dd('0x38')](_0x54fb89[_0xb6dd('0x37')]);_0x1101c1[_0xb6dd('0x39')]=_[_0xb6dd('0x3a')](_0x1101c1[_0xb6dd('0x36')],_0x1101c1[_0xb6dd('0x37')]);_0x37ed9c[_0xb6dd('0x3b')]=_[_0xb6dd('0x3a')](_0x1101c1[_0xb6dd('0x36')],qs['fields'](_0x54fb89[_0xb6dd('0x37')][_0xb6dd('0x3c')]));_0x37ed9c[_0xb6dd('0x3b')]=_0x37ed9c['attributes'][_0xb6dd('0x3d')]?_0x37ed9c[_0xb6dd('0x3b')]:_0x1101c1[_0xb6dd('0x36')];if(!_0x54fb89['query'][_0xb6dd('0x3e')]('nolimit')){_0x37ed9c[_0xb6dd('0x20')]=qs[_0xb6dd('0x20')](_0x54fb89[_0xb6dd('0x37')][_0xb6dd('0x20')]);_0x37ed9c[_0xb6dd('0x22')]=qs[_0xb6dd('0x22')](_0x54fb89[_0xb6dd('0x37')][_0xb6dd('0x22')]);}_0x37ed9c[_0xb6dd('0x3f')]=qs[_0xb6dd('0x40')](_0x54fb89[_0xb6dd('0x37')]['sort']);_0x37ed9c[_0xb6dd('0x41')]=qs['filters'](_[_0xb6dd('0x42')](_0x54fb89[_0xb6dd('0x37')],_0x1101c1['filters']),_0x2feddf);if(_0x54fb89[_0xb6dd('0x37')][_0xb6dd('0x43')]){_0x37ed9c[_0xb6dd('0x41')]=_[_0xb6dd('0x44')](_0x37ed9c[_0xb6dd('0x41')],{'$or':_[_0xb6dd('0x32')](_0x2feddf,function(_0x10036f){if(_0x10036f['type']!=='VIRTUAL'){var _0x4a9181={};_0x4a9181[_0x10036f[_0xb6dd('0x2f')]]={'$like':'%'+_0x54fb89[_0xb6dd('0x37')][_0xb6dd('0x43')]+'%'};return _0x4a9181;}})});}_0x37ed9c=_[_0xb6dd('0x44')]({},_0x37ed9c,_0x54fb89[_0xb6dd('0x45')]);var _0x1794c9={'where':_0x37ed9c[_0xb6dd('0x41')]};return db['OpenchannelTransferReport'][_0xb6dd('0x21')](_0x1794c9)[_0xb6dd('0x2a')](function(_0x3c5249){_0x340f8a[_0xb6dd('0x21')]=_0x3c5249;if(_0x54fb89['query'][_0xb6dd('0x46')]){_0x37ed9c[_0xb6dd('0x47')]=[{'all':!![]}];}return db[_0xb6dd('0x33')][_0xb6dd('0x48')](_0x37ed9c);})[_0xb6dd('0x2a')](function(_0x3b3751){_0x340f8a[_0xb6dd('0x49')]=_0x3b3751;return _0x340f8a;})['then'](respondWithFilteredResult(_0x223a73,_0x37ed9c))[_0xb6dd('0x4a')](handleError(_0x223a73,null));};exports['show']=function(_0x3470be,_0x58b967){var _0x296c0b={'raw':!![],'where':{'id':_0x3470be['params']['id']}},_0x3cc114={};_0x3cc114[_0xb6dd('0x36')]=_[_0xb6dd('0x38')](db['OpenchannelTransferReport']['rawAttributes']);_0x3cc114[_0xb6dd('0x37')]=_[_0xb6dd('0x38')](_0x3470be[_0xb6dd('0x37')]);_0x3cc114[_0xb6dd('0x39')]=_[_0xb6dd('0x3a')](_0x3cc114[_0xb6dd('0x36')],_0x3cc114[_0xb6dd('0x37')]);_0x296c0b[_0xb6dd('0x3b')]=_[_0xb6dd('0x3a')](_0x3cc114[_0xb6dd('0x36')],qs[_0xb6dd('0x3c')](_0x3470be[_0xb6dd('0x37')]['fields']));_0x296c0b['attributes']=_0x296c0b['attributes'][_0xb6dd('0x3d')]?_0x296c0b['attributes']:_0x3cc114['model'];if(_0x3470be[_0xb6dd('0x37')][_0xb6dd('0x46')]){_0x296c0b['include']=[{'all':!![]}];}_0x296c0b=_[_0xb6dd('0x44')]({},_0x296c0b,_0x3470be[_0xb6dd('0x45')]);return db[_0xb6dd('0x33')][_0xb6dd('0x4b')](_0x296c0b)[_0xb6dd('0x2a')](handleEntityNotFound(_0x58b967,null))[_0xb6dd('0x2a')](respondWithResult(_0x58b967,null))[_0xb6dd('0x4a')](handleError(_0x58b967,null));};exports[_0xb6dd('0x4c')]=function(_0x98cb7e,_0x3cc77f){return db['OpenchannelTransferReport'][_0xb6dd('0x4c')](_0x98cb7e[_0xb6dd('0x4d')],{})[_0xb6dd('0x2a')](respondWithResult(_0x3cc77f,0xc9))[_0xb6dd('0x4a')](handleError(_0x3cc77f,null));};exports['update']=function(_0x3baf13,_0x16b5fa){if(_0x3baf13['body']['id']){delete _0x3baf13[_0xb6dd('0x4d')]['id'];}return db[_0xb6dd('0x33')]['find']({'where':{'id':_0x3baf13[_0xb6dd('0x4e')]['id']}})[_0xb6dd('0x2a')](handleEntityNotFound(_0x16b5fa,null))[_0xb6dd('0x2a')](saveUpdates(_0x3baf13[_0xb6dd('0x4d')],null))[_0xb6dd('0x2a')](respondWithResult(_0x16b5fa,null))['catch'](handleError(_0x16b5fa,null));};exports[_0xb6dd('0x2b')]=function(_0x3e1448,_0x157371){return db[_0xb6dd('0x33')][_0xb6dd('0x4b')]({'where':{'id':_0x3e1448['params']['id']}})[_0xb6dd('0x2a')](handleEntityNotFound(_0x157371,null))[_0xb6dd('0x2a')](removeEntity(_0x157371,null))[_0xb6dd('0x4a')](handleError(_0x157371,null));};exports[_0xb6dd('0x4f')]=function(_0x4b1140,_0x102bb5){return db[_0xb6dd('0x33')][_0xb6dd('0x4f')]()[_0xb6dd('0x2a')](respondWithResult(_0x102bb5,null))[_0xb6dd('0x4a')](handleError(_0x102bb5,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 77d30d3..e7a71c0 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 _0x543a=['util','../../config/logger','bluebird','../../config/environment','./openchannelTransferReport.attributes','exports','report_openchannel_transfer','uniqueid','lodash'];(function(_0x41bdd4,_0x3d5c76){var _0x5c03a6=function(_0x59634a){while(--_0x59634a){_0x41bdd4['push'](_0x41bdd4['shift']());}};_0x5c03a6(++_0x3d5c76);}(_0x543a,0xa1));var _0xa543=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x543a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa543('0x0'));var util=require(_0xa543('0x1'));var logger=require(_0xa543('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa543('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa543('0x4'));var attributes=require(_0xa543('0x5'));module[_0xa543('0x6')]=function(_0x191182,_0x1e70a4){return _0x191182['define']('OpenchannelTransferReport',attributes,{'tableName':_0xa543('0x7'),'paranoid':![],'indexes':[{'name':_0xa543('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd5b1=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0x3650e0,_0xda0f52){var _0x6841fb=function(_0x1e7cc0){while(--_0x1e7cc0){_0x3650e0['push'](_0x3650e0['shift']());}};_0x6841fb(++_0xda0f52);}(_0xd5b1,0x1eb));var _0x1d5b=function(_0x4acfb9,_0x157698){_0x4acfb9=_0x4acfb9-0x0;var _0x23554d=_0xd5b1[_0x4acfb9];return _0x23554d;};'use strict';var _=require(_0x1d5b('0x0'));var util=require(_0x1d5b('0x1'));var logger=require(_0x1d5b('0x2'))(_0x1d5b('0x3'));var moment=require(_0x1d5b('0x4'));var BPromise=require(_0x1d5b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d5b('0x6'));var rimraf=require(_0x1d5b('0x7'));var config=require(_0x1d5b('0x8'));var attributes=require(_0x1d5b('0x9'));module['exports']=function(_0x369d48,_0x2f1a3e){return _0x369d48[_0x1d5b('0xa')](_0x1d5b('0xb'),attributes,{'tableName':_0x1d5b('0xc'),'paranoid':![],'indexes':[{'name':_0x1d5b('0xd'),'fields':[_0x1d5b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 13b1e88..3399271 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 _0x0734=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1c2831,_0x5111a1){var _0x44a44e=function(_0x163adb){while(--_0x163adb){_0x1c2831['push'](_0x1c2831['shift']());}};_0x44a44e(++_0x5111a1);}(_0x0734,0xba));var _0x4073=function(_0x4459a6,_0x288e03){_0x4459a6=_0x4459a6-0x0;var _0x31a0c0=_0x0734[_0x4459a6];return _0x31a0c0;};'use strict';var _=require(_0x4073('0x0'));var util=require(_0x4073('0x1'));var moment=require(_0x4073('0x2'));var BPromise=require(_0x4073('0x3'));var rs=require(_0x4073('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4073('0x5'))['db'];var utils=require(_0x4073('0x6'));var logger=require(_0x4073('0x7'))(_0x4073('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4073('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c3c14,_0x2195e0,_0x1251bd){return new BPromise(function(_0x22a33d,_0x51515d){return client[_0x4073('0xa')](_0x2c3c14,_0x1251bd)['then'](function(_0x5432c4){logger[_0x4073('0xb')](_0x4073('0xc'),_0x2195e0,_0x4073('0xd'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2195e0,_0x4073('0xd'),JSON[_0x4073('0xe')](_0x5432c4));if(_0x5432c4['error']){if(_0x5432c4[_0x4073('0xf')]['code']===0x1f4){logger[_0x4073('0xf')](_0x4073('0xc'),_0x2195e0,_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);return _0x51515d(_0x5432c4['error'][_0x4073('0x10')]);}logger[_0x4073('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2195e0,_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);return _0x22a33d(_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);}else{logger[_0x4073('0xb')](_0x4073('0xc'),_0x2195e0,'request\x20sent');_0x22a33d(_0x5432c4[_0x4073('0x11')]['message']);}})[_0x4073('0x12')](function(_0x38ea09){logger['error'](_0x4073('0xc'),_0x2195e0,_0x38ea09);_0x51515d(_0x38ea09);});});} \ No newline at end of file +var _0x9589=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x4c6373,_0x47cb5d){var _0x8ed848=function(_0x23d513){while(--_0x23d513){_0x4c6373['push'](_0x4c6373['shift']());}};_0x8ed848(++_0x47cb5d);}(_0x9589,0xbc));var _0x9958=function(_0x53a260,_0x4004c2){_0x53a260=_0x53a260-0x0;var _0x23606c=_0x9589[_0x53a260];return _0x23606c;};'use strict';var _=require(_0x9958('0x0'));var util=require(_0x9958('0x1'));var moment=require(_0x9958('0x2'));var BPromise=require(_0x9958('0x3'));var rs=require(_0x9958('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9958('0x5'))['db'];var utils=require(_0x9958('0x6'));var logger=require(_0x9958('0x7'))('rpc');var config=require(_0x9958('0x8'));var jayson=require(_0x9958('0x9'));var client=jayson[_0x9958('0xa')][_0x9958('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4225da,_0x2c3eaf,_0x5750c5){return new BPromise(function(_0x2ac795,_0x19f3b3){return client[_0x9958('0xc')](_0x4225da,_0x5750c5)[_0x9958('0xd')](function(_0x21f35c){logger[_0x9958('0xe')](_0x9958('0xf'),_0x2c3eaf,_0x9958('0x10'));logger[_0x9958('0x11')](_0x9958('0x12'),_0x2c3eaf,_0x9958('0x10'),JSON[_0x9958('0x13')](_0x21f35c));if(_0x21f35c[_0x9958('0x14')]){if(_0x21f35c[_0x9958('0x14')][_0x9958('0x15')]===0x1f4){logger[_0x9958('0x14')](_0x9958('0xf'),_0x2c3eaf,_0x21f35c[_0x9958('0x14')]['message']);return _0x19f3b3(_0x21f35c[_0x9958('0x14')]['message']);}logger[_0x9958('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3eaf,_0x21f35c[_0x9958('0x14')][_0x9958('0x16')]);return _0x2ac795(_0x21f35c[_0x9958('0x14')][_0x9958('0x16')]);}else{logger['info'](_0x9958('0xf'),_0x2c3eaf,_0x9958('0x10'));_0x2ac795(_0x21f35c['result']['message']);}})[_0x9958('0x17')](function(_0x4a27cf){logger[_0x9958('0x14')](_0x9958('0xf'),_0x2c3eaf,_0x4a27cf);_0x19f3b3(_0x4a27cf);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 0a63c34..7d4d63e 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 _0xabb2=['put','/:id','update','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','show','post','create'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xabb2,0x82));var _0x2abb=function(_0x4c3070,_0xc2fb4c){_0x4c3070=_0x4c3070-0x0;var _0x536a44=_0xabb2[_0x4c3070];return _0x536a44;};'use strict';var multer=require('multer');var util=require(_0x2abb('0x0'));var path=require(_0x2abb('0x1'));var timeout=require('connect-timeout');var express=require(_0x2abb('0x2'));var router=express[_0x2abb('0x3')]();var fs_extra=require(_0x2abb('0x4'));var auth=require(_0x2abb('0x5'));var interaction=require(_0x2abb('0x6'));var config=require(_0x2abb('0x7'));var controller=require(_0x2abb('0x8'));router[_0x2abb('0x9')]('/',auth[_0x2abb('0xa')](),controller['index']);router[_0x2abb('0x9')]('/:id',auth[_0x2abb('0xa')](),controller[_0x2abb('0xb')]);router[_0x2abb('0xc')]('/',auth['isAuthenticated'](),controller[_0x2abb('0xd')]);router[_0x2abb('0xe')](_0x2abb('0xf'),auth[_0x2abb('0xa')](),controller[_0x2abb('0x10')]);router['delete'](_0x2abb('0xf'),auth[_0x2abb('0xa')](),controller['destroy']);module[_0x2abb('0x11')]=router; \ No newline at end of file +var _0xf4cd=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','util','path','express'];(function(_0x5dd69b,_0x118e05){var _0x1bc678=function(_0x4ff184){while(--_0x4ff184){_0x5dd69b['push'](_0x5dd69b['shift']());}};_0x1bc678(++_0x118e05);}(_0xf4cd,0x18c));var _0xdf4c=function(_0x2da70c,_0x200031){_0x2da70c=_0x2da70c-0x0;var _0xae1ed7=_0xf4cd[_0x2da70c];return _0xae1ed7;};'use strict';var multer=require(_0xdf4c('0x0'));var util=require(_0xdf4c('0x1'));var path=require(_0xdf4c('0x2'));var timeout=require('connect-timeout');var express=require(_0xdf4c('0x3'));var router=express[_0xdf4c('0x4')]();var fs_extra=require(_0xdf4c('0x5'));var auth=require(_0xdf4c('0x6'));var interaction=require(_0xdf4c('0x7'));var config=require(_0xdf4c('0x8'));var controller=require(_0xdf4c('0x9'));router[_0xdf4c('0xa')]('/',auth[_0xdf4c('0xb')](),controller[_0xdf4c('0xc')]);router[_0xdf4c('0xa')](_0xdf4c('0xd'),auth[_0xdf4c('0xb')](),controller[_0xdf4c('0xe')]);router[_0xdf4c('0xf')]('/',auth['isAuthenticated'](),controller[_0xdf4c('0x10')]);router[_0xdf4c('0x11')]('/:id',auth[_0xdf4c('0xb')](),controller[_0xdf4c('0x12')]);router['delete'](_0xdf4c('0xd'),auth[_0xdf4c('0xb')](),controller[_0xdf4c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 8f63fc0..fd0eb22 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 _0x5fc1=['name','sequelize','STRING'];(function(_0x355611,_0x417818){var _0x1cf2d9=function(_0x32b808){while(--_0x32b808){_0x355611['push'](_0x355611['shift']());}};_0x1cf2d9(++_0x417818);}(_0x5fc1,0x148));var _0x15fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5fc1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x15fc('0x0'));module['exports']={'name':{'type':Sequelize[_0x15fc('0x1')],'unique':_0x15fc('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf782=['exports','name','sequelize'];(function(_0x54ae13,_0x4f4751){var _0x2814ee=function(_0x1ed0ed){while(--_0x1ed0ed){_0x54ae13['push'](_0x54ae13['shift']());}};_0x2814ee(++_0x4f4751);}(_0xf782,0x71));var _0x2f78=function(_0x3fab8d,_0x3a43e0){_0x3fab8d=_0x3fab8d-0x0;var _0x652a13=_0xf782[_0x3fab8d];return _0x652a13;};'use strict';var Sequelize=require(_0x2f78('0x0'));module[_0x2f78('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2f78('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 8cbffea..58ef847 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 _0x4c21=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','sendStatus','error','stack','name','index','map','Pause','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','userProfileId','autoAssociation','params','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0x4c21,0x9a));var _0x14c2=function(_0x68a0b0,_0x2bba91){_0x68a0b0=_0x68a0b0-0x0;var _0x4b4ee6=_0x4c21[_0x68a0b0];return _0x4b4ee6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x14c2('0x0'));var zipdir=require(_0x14c2('0x1'));var jsonpatch=require(_0x14c2('0x2'));var rp=require('request-promise');var moment=require(_0x14c2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x14c2('0x4'));var util=require('util');var path=require(_0x14c2('0x5'));var sox=require('sox');var csv=require(_0x14c2('0x6'));var ejs=require(_0x14c2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14c2('0x8'));var squel=require(_0x14c2('0x9'));var crypto=require(_0x14c2('0xa'));var jsforce=require(_0x14c2('0xb'));var deskjs=require(_0x14c2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x14c2('0xd'));var Papa=require(_0x14c2('0xe'));var Redis=require(_0x14c2('0xf'));var authService=require(_0x14c2('0x10'));var qs=require(_0x14c2('0x11'));var as=require(_0x14c2('0x12'));var hardwareService=require(_0x14c2('0x13'));var logger=require(_0x14c2('0x14'))(_0x14c2('0x15'));var utils=require(_0x14c2('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31bdbb,_0x3fdfe1){_0x3fdfe1=_0x3fdfe1||0xcc;return function(_0x24dc41){if(_0x24dc41){return _0x31bdbb['sendStatus'](_0x3fdfe1);}return _0x31bdbb[_0x14c2('0x17')](_0x3fdfe1)[_0x14c2('0x18')]();};}function respondWithResult(_0x10bfdd,_0x55641f){_0x55641f=_0x55641f||0xc8;return function(_0x5c8179){if(_0x5c8179){return _0x10bfdd[_0x14c2('0x17')](_0x55641f)[_0x14c2('0x19')](_0x5c8179);}};}function respondWithFilteredResult(_0x266c41,_0x18f608){return function(_0x5843ea){if(_0x5843ea){var _0x1df7c7=typeof _0x18f608[_0x14c2('0x1a')]===_0x14c2('0x1b')&&typeof _0x18f608[_0x14c2('0x1c')]===_0x14c2('0x1b');var _0x17897a=_0x5843ea[_0x14c2('0x1d')];var _0xd1ac45=_0x1df7c7?0x0:_0x18f608[_0x14c2('0x1a')];var _0x103490=_0x1df7c7?_0x5843ea[_0x14c2('0x1d')]:_0x18f608[_0x14c2('0x1a')]+_0x18f608[_0x14c2('0x1c')];var _0x4701a6;if(_0x103490>=_0x17897a){_0x103490=_0x17897a;_0x4701a6=0xc8;}else{_0x4701a6=0xce;}_0x266c41[_0x14c2('0x17')](_0x4701a6);return _0x266c41[_0x14c2('0x1e')](_0x14c2('0x1f'),_0xd1ac45+'-'+_0x103490+'/'+_0x17897a)[_0x14c2('0x19')](_0x5843ea);}return null;};}function patchUpdates(_0x226ae1){return function(_0x2d6f4c){try{jsonpatch[_0x14c2('0x20')](_0x2d6f4c,_0x226ae1,!![]);}catch(_0x37b59e){return BPromise[_0x14c2('0x21')](_0x37b59e);}return _0x2d6f4c[_0x14c2('0x22')]();};}function saveUpdates(_0x2ad2cf,_0x980668){return function(_0x3aba1e){if(_0x3aba1e){return _0x3aba1e[_0x14c2('0x23')](_0x2ad2cf)['then'](function(_0x53e0cb){return _0x53e0cb;});}return null;};}function removeEntity(_0x10d3d3,_0x33b72a){return function(_0x4e2a71){if(_0x4e2a71){return _0x4e2a71[_0x14c2('0x24')]()['then'](function(){var _0x484813=_0x4e2a71[_0x14c2('0x25')]({'plain':!![]});var _0x3dc613='Pauses';return db[_0x14c2('0x26')][_0x14c2('0x24')]({'where':{'type':_0x3dc613,'resourceId':_0x484813['id']}})[_0x14c2('0x27')](function(){return _0x4e2a71;});})[_0x14c2('0x27')](function(){_0x10d3d3[_0x14c2('0x17')](0xcc)[_0x14c2('0x18')]();});}};}function handleEntityNotFound(_0x27f400,_0x3e7b19){return function(_0x51b2fe){if(!_0x51b2fe){_0x27f400[_0x14c2('0x28')](0x194);}return _0x51b2fe;};}function handleError(_0x3b8a42,_0x2fa971){_0x2fa971=_0x2fa971||0x1f4;return function(_0x4d04ff){logger[_0x14c2('0x29')](_0x4d04ff[_0x14c2('0x2a')]);if(_0x4d04ff[_0x14c2('0x2b')]){delete _0x4d04ff[_0x14c2('0x2b')];}_0x3b8a42['status'](_0x2fa971)['send'](_0x4d04ff);};}exports[_0x14c2('0x2c')]=function(_0x4705cf,_0x53c351){var _0x4e04d2={},_0x3e62c2={},_0x1badab={'count':0x0,'rows':[]};var _0x31d9b9=_[_0x14c2('0x2d')](db[_0x14c2('0x2e')][_0x14c2('0x2f')],function(_0x27107e){return{'name':_0x27107e[_0x14c2('0x30')],'type':_0x27107e[_0x14c2('0x31')][_0x14c2('0x32')]};});_0x3e62c2[_0x14c2('0x33')]=_['map'](_0x31d9b9,_0x14c2('0x2b'));_0x3e62c2['query']=_['keys'](_0x4705cf['query']);_0x3e62c2[_0x14c2('0x34')]=_[_0x14c2('0x35')](_0x3e62c2['model'],_0x3e62c2[_0x14c2('0x36')]);_0x4e04d2[_0x14c2('0x37')]=_[_0x14c2('0x35')](_0x3e62c2[_0x14c2('0x33')],qs[_0x14c2('0x38')](_0x4705cf[_0x14c2('0x36')][_0x14c2('0x38')]));_0x4e04d2[_0x14c2('0x37')]=_0x4e04d2[_0x14c2('0x37')]['length']?_0x4e04d2[_0x14c2('0x37')]:_0x3e62c2[_0x14c2('0x33')];if(!_0x4705cf['query'][_0x14c2('0x39')](_0x14c2('0x3a'))){_0x4e04d2['limit']=qs[_0x14c2('0x1c')](_0x4705cf[_0x14c2('0x36')]['limit']);_0x4e04d2[_0x14c2('0x1a')]=qs[_0x14c2('0x1a')](_0x4705cf['query'][_0x14c2('0x1a')]);}_0x4e04d2['order']=qs[_0x14c2('0x3b')](_0x4705cf[_0x14c2('0x36')][_0x14c2('0x3b')]);_0x4e04d2[_0x14c2('0x3c')]=qs[_0x14c2('0x34')](_['pick'](_0x4705cf['query'],_0x3e62c2[_0x14c2('0x34')]),_0x31d9b9);if(_0x4705cf[_0x14c2('0x36')][_0x14c2('0x3d')]){_0x4e04d2[_0x14c2('0x3c')]=_[_0x14c2('0x3e')](_0x4e04d2[_0x14c2('0x3c')],{'$or':_[_0x14c2('0x2d')](_0x31d9b9,function(_0x5c975e){if(_0x5c975e[_0x14c2('0x31')]!==_0x14c2('0x3f')){var _0x5b80eb={};_0x5b80eb[_0x5c975e[_0x14c2('0x2b')]]={'$like':'%'+_0x4705cf[_0x14c2('0x36')][_0x14c2('0x3d')]+'%'};return _0x5b80eb;}})});}_0x4e04d2=_[_0x14c2('0x3e')]({},_0x4e04d2,_0x4705cf[_0x14c2('0x40')]);var _0x25d25a={'where':_0x4e04d2[_0x14c2('0x3c')]};return db[_0x14c2('0x2e')][_0x14c2('0x1d')](_0x25d25a)[_0x14c2('0x27')](function(_0xbbdf9f){_0x1badab[_0x14c2('0x1d')]=_0xbbdf9f;if(_0x4705cf[_0x14c2('0x36')][_0x14c2('0x41')]){_0x4e04d2[_0x14c2('0x42')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x4e04d2);})[_0x14c2('0x27')](function(_0x2e00b7){_0x1badab['rows']=_0x2e00b7;return _0x1badab;})[_0x14c2('0x27')](respondWithFilteredResult(_0x53c351,_0x4e04d2))[_0x14c2('0x43')](handleError(_0x53c351,null));};exports[_0x14c2('0x44')]=function(_0x57b799,_0x11bdd2){var _0x394831={'raw':!![],'where':{'id':_0x57b799['params']['id']}},_0x93aa7={};_0x93aa7['model']=_[_0x14c2('0x45')](db[_0x14c2('0x2e')][_0x14c2('0x2f')]);_0x93aa7[_0x14c2('0x36')]=_[_0x14c2('0x45')](_0x57b799[_0x14c2('0x36')]);_0x93aa7[_0x14c2('0x34')]=_[_0x14c2('0x35')](_0x93aa7['model'],_0x93aa7['query']);_0x394831[_0x14c2('0x37')]=_[_0x14c2('0x35')](_0x93aa7[_0x14c2('0x33')],qs[_0x14c2('0x38')](_0x57b799[_0x14c2('0x36')][_0x14c2('0x38')]));_0x394831[_0x14c2('0x37')]=_0x394831['attributes'][_0x14c2('0x46')]?_0x394831[_0x14c2('0x37')]:_0x93aa7[_0x14c2('0x33')];if(_0x57b799[_0x14c2('0x36')][_0x14c2('0x41')]){_0x394831[_0x14c2('0x42')]=[{'all':!![]}];}_0x394831=_[_0x14c2('0x3e')]({},_0x394831,_0x57b799[_0x14c2('0x40')]);return db[_0x14c2('0x2e')][_0x14c2('0x47')](_0x394831)[_0x14c2('0x27')](handleEntityNotFound(_0x11bdd2,null))['then'](respondWithResult(_0x11bdd2,null))['catch'](handleError(_0x11bdd2,null));};exports[_0x14c2('0x48')]=function(_0x5d4d8d,_0x23470d){return db[_0x14c2('0x2e')]['create'](_0x5d4d8d[_0x14c2('0x49')],{})[_0x14c2('0x27')](function(_0x158c92){var _0x45c50b=_0x5d4d8d[_0x14c2('0x4a')][_0x14c2('0x25')]({'plain':!![]});if(!_0x45c50b)throw new Error(_0x14c2('0x4b'));if(_0x45c50b[_0x14c2('0x4c')]===_0x14c2('0x4a')){var _0x5b5a93=_0x158c92[_0x14c2('0x25')]({'plain':!![]});var _0x4db205=_0x14c2('0x4d');return db[_0x14c2('0x4e')][_0x14c2('0x47')]({'where':{'name':_0x4db205,'userProfileId':_0x45c50b[_0x14c2('0x4f')]},'raw':!![]})[_0x14c2('0x27')](function(_0x340044){if(_0x340044&&_0x340044[_0x14c2('0x50')]===0x0){return db[_0x14c2('0x26')][_0x14c2('0x48')]({'name':_0x5b5a93[_0x14c2('0x2b')],'resourceId':_0x5b5a93['id'],'type':_0x340044[_0x14c2('0x2b')],'sectionId':_0x340044['id']},{})[_0x14c2('0x27')](function(){return _0x158c92;});}else{return _0x158c92;}})[_0x14c2('0x43')](function(_0x1c4093){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c4093);throw _0x1c4093;});}return _0x158c92;})[_0x14c2('0x27')](respondWithResult(_0x23470d,0xc9))[_0x14c2('0x43')](handleError(_0x23470d,null));};exports[_0x14c2('0x23')]=function(_0x5e4987,_0x2d3159){if(_0x5e4987[_0x14c2('0x49')]['id']){delete _0x5e4987[_0x14c2('0x49')]['id'];}return db[_0x14c2('0x2e')][_0x14c2('0x47')]({'where':{'id':_0x5e4987[_0x14c2('0x51')]['id']}})['then'](handleEntityNotFound(_0x2d3159,null))[_0x14c2('0x27')](saveUpdates(_0x5e4987['body'],null))[_0x14c2('0x27')](respondWithResult(_0x2d3159,null))['catch'](handleError(_0x2d3159,null));};exports[_0x14c2('0x24')]=function(_0x301edd,_0x54a1a0){return db['Pause'][_0x14c2('0x47')]({'where':{'id':_0x301edd[_0x14c2('0x51')]['id']}})[_0x14c2('0x27')](handleEntityNotFound(_0x54a1a0,null))['then'](removeEntity(_0x54a1a0,null))[_0x14c2('0x43')](handleError(_0x54a1a0,null));}; \ No newline at end of file +var _0x8d43=['offset','count','apply','save','then','get','Pauses','UserProfileResource','stack','send','map','Pause','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit'];(function(_0x1165fb,_0x2f0e59){var _0x19f8d6=function(_0x4f6187){while(--_0x4f6187){_0x1165fb['push'](_0x1165fb['shift']());}};_0x19f8d6(++_0x2f0e59);}(_0x8d43,0xd9));var _0x38d4=function(_0x4d9ff2,_0x426e18){_0x4d9ff2=_0x4d9ff2-0x0;var _0xaca268=_0x8d43[_0x4d9ff2];return _0xaca268;};'use strict';var emlformat=require(_0x38d4('0x0'));var rimraf=require(_0x38d4('0x1'));var zipdir=require(_0x38d4('0x2'));var jsonpatch=require(_0x38d4('0x3'));var rp=require(_0x38d4('0x4'));var moment=require(_0x38d4('0x5'));var BPromise=require(_0x38d4('0x6'));var Mustache=require(_0x38d4('0x7'));var util=require(_0x38d4('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x38d4('0x9'));var fs=require('fs');var fs_extra=require(_0x38d4('0xa'));var _=require(_0x38d4('0xb'));var squel=require(_0x38d4('0xc'));var crypto=require(_0x38d4('0xd'));var jsforce=require(_0x38d4('0xe'));var deskjs=require(_0x38d4('0xf'));var toCsv=require(_0x38d4('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x38d4('0x11'));var authService=require(_0x38d4('0x12'));var qs=require(_0x38d4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x38d4('0x14'))(_0x38d4('0x15'));var utils=require(_0x38d4('0x16'));var config=require(_0x38d4('0x17'));var licenseUtil=require(_0x38d4('0x18'));var db=require(_0x38d4('0x19'))['db'];function respondWithStatusCode(_0xddf0f9,_0x5276a0){_0x5276a0=_0x5276a0||0xcc;return function(_0x2a08d1){if(_0x2a08d1){return _0xddf0f9[_0x38d4('0x1a')](_0x5276a0);}return _0xddf0f9['status'](_0x5276a0)[_0x38d4('0x1b')]();};}function respondWithResult(_0x416fda,_0x9019c5){_0x9019c5=_0x9019c5||0xc8;return function(_0x590f36){if(_0x590f36){return _0x416fda[_0x38d4('0x1c')](_0x9019c5)[_0x38d4('0x1d')](_0x590f36);}};}function respondWithFilteredResult(_0x39b963,_0x31b251){return function(_0x28be31){if(_0x28be31){var _0x21acd1=typeof _0x31b251['offset']===_0x38d4('0x1e')&&typeof _0x31b251[_0x38d4('0x1f')]==='undefined';var _0x45ee1d=_0x28be31['count'];var _0xb70e8f=_0x21acd1?0x0:_0x31b251[_0x38d4('0x20')];var _0x2e5190=_0x21acd1?_0x28be31[_0x38d4('0x21')]:_0x31b251[_0x38d4('0x20')]+_0x31b251[_0x38d4('0x1f')];var _0x381212;if(_0x2e5190>=_0x45ee1d){_0x2e5190=_0x45ee1d;_0x381212=0xc8;}else{_0x381212=0xce;}_0x39b963['status'](_0x381212);return _0x39b963['set']('Content-Range',_0xb70e8f+'-'+_0x2e5190+'/'+_0x45ee1d)[_0x38d4('0x1d')](_0x28be31);}return null;};}function patchUpdates(_0x121fd0){return function(_0x39ca0f){try{jsonpatch[_0x38d4('0x22')](_0x39ca0f,_0x121fd0,!![]);}catch(_0x2344af){return BPromise['reject'](_0x2344af);}return _0x39ca0f[_0x38d4('0x23')]();};}function saveUpdates(_0x186330,_0x5da42c){return function(_0x358a25){if(_0x358a25){return _0x358a25['update'](_0x186330)[_0x38d4('0x24')](function(_0x53a9d2){return _0x53a9d2;});}return null;};}function removeEntity(_0x57b571,_0x3e8e00){return function(_0x26dc0f){if(_0x26dc0f){return _0x26dc0f['destroy']()[_0x38d4('0x24')](function(){var _0x4fcf4f=_0x26dc0f[_0x38d4('0x25')]({'plain':!![]});var _0x30891d=_0x38d4('0x26');return db[_0x38d4('0x27')]['destroy']({'where':{'type':_0x30891d,'resourceId':_0x4fcf4f['id']}})[_0x38d4('0x24')](function(){return _0x26dc0f;});})[_0x38d4('0x24')](function(){_0x57b571['status'](0xcc)[_0x38d4('0x1b')]();});}};}function handleEntityNotFound(_0x338fd7,_0x2b8921){return function(_0x1e7e0a){if(!_0x1e7e0a){_0x338fd7[_0x38d4('0x1a')](0x194);}return _0x1e7e0a;};}function handleError(_0x53b8b7,_0x37a2e3){_0x37a2e3=_0x37a2e3||0x1f4;return function(_0x561613){logger['error'](_0x561613[_0x38d4('0x28')]);if(_0x561613['name']){delete _0x561613['name'];}_0x53b8b7[_0x38d4('0x1c')](_0x37a2e3)[_0x38d4('0x29')](_0x561613);};}exports['index']=function(_0x53d59a,_0x5638f7){var _0xa69ed0={},_0x2fab4c={},_0x4d4cf6={'count':0x0,'rows':[]};var _0x365786=_[_0x38d4('0x2a')](db[_0x38d4('0x2b')]['rawAttributes'],function(_0x427053){return{'name':_0x427053['fieldName'],'type':_0x427053[_0x38d4('0x2c')][_0x38d4('0x2d')]};});_0x2fab4c[_0x38d4('0x2e')]=_['map'](_0x365786,'name');_0x2fab4c[_0x38d4('0x2f')]=_[_0x38d4('0x30')](_0x53d59a[_0x38d4('0x2f')]);_0x2fab4c[_0x38d4('0x31')]=_[_0x38d4('0x32')](_0x2fab4c[_0x38d4('0x2e')],_0x2fab4c[_0x38d4('0x2f')]);_0xa69ed0['attributes']=_[_0x38d4('0x32')](_0x2fab4c[_0x38d4('0x2e')],qs['fields'](_0x53d59a[_0x38d4('0x2f')][_0x38d4('0x33')]));_0xa69ed0[_0x38d4('0x34')]=_0xa69ed0['attributes'][_0x38d4('0x35')]?_0xa69ed0['attributes']:_0x2fab4c[_0x38d4('0x2e')];if(!_0x53d59a[_0x38d4('0x2f')][_0x38d4('0x36')](_0x38d4('0x37'))){_0xa69ed0['limit']=qs[_0x38d4('0x1f')](_0x53d59a['query'][_0x38d4('0x1f')]);_0xa69ed0[_0x38d4('0x20')]=qs[_0x38d4('0x20')](_0x53d59a[_0x38d4('0x2f')][_0x38d4('0x20')]);}_0xa69ed0['order']=qs[_0x38d4('0x38')](_0x53d59a[_0x38d4('0x2f')][_0x38d4('0x38')]);_0xa69ed0['where']=qs[_0x38d4('0x31')](_[_0x38d4('0x39')](_0x53d59a[_0x38d4('0x2f')],_0x2fab4c['filters']),_0x365786);if(_0x53d59a[_0x38d4('0x2f')][_0x38d4('0x3a')]){_0xa69ed0[_0x38d4('0x3b')]=_[_0x38d4('0x3c')](_0xa69ed0[_0x38d4('0x3b')],{'$or':_[_0x38d4('0x2a')](_0x365786,function(_0x4f1674){if(_0x4f1674['type']!==_0x38d4('0x3d')){var _0x3dcc5d={};_0x3dcc5d[_0x4f1674[_0x38d4('0x3e')]]={'$like':'%'+_0x53d59a['query'][_0x38d4('0x3a')]+'%'};return _0x3dcc5d;}})});}_0xa69ed0=_[_0x38d4('0x3c')]({},_0xa69ed0,_0x53d59a[_0x38d4('0x3f')]);var _0x14829={'where':_0xa69ed0[_0x38d4('0x3b')]};return db[_0x38d4('0x2b')][_0x38d4('0x21')](_0x14829)[_0x38d4('0x24')](function(_0x9f0ebb){_0x4d4cf6[_0x38d4('0x21')]=_0x9f0ebb;if(_0x53d59a[_0x38d4('0x2f')][_0x38d4('0x40')]){_0xa69ed0[_0x38d4('0x41')]=[{'all':!![]}];}return db[_0x38d4('0x2b')][_0x38d4('0x42')](_0xa69ed0);})[_0x38d4('0x24')](function(_0x2639c3){_0x4d4cf6[_0x38d4('0x43')]=_0x2639c3;return _0x4d4cf6;})[_0x38d4('0x24')](respondWithFilteredResult(_0x5638f7,_0xa69ed0))[_0x38d4('0x44')](handleError(_0x5638f7,null));};exports[_0x38d4('0x45')]=function(_0x7e200b,_0x469d2a){var _0x52d205={'raw':!![],'where':{'id':_0x7e200b['params']['id']}},_0x4ef7e7={};_0x4ef7e7[_0x38d4('0x2e')]=_[_0x38d4('0x30')](db[_0x38d4('0x2b')][_0x38d4('0x46')]);_0x4ef7e7[_0x38d4('0x2f')]=_['keys'](_0x7e200b['query']);_0x4ef7e7['filters']=_[_0x38d4('0x32')](_0x4ef7e7[_0x38d4('0x2e')],_0x4ef7e7['query']);_0x52d205[_0x38d4('0x34')]=_[_0x38d4('0x32')](_0x4ef7e7[_0x38d4('0x2e')],qs[_0x38d4('0x33')](_0x7e200b['query'][_0x38d4('0x33')]));_0x52d205[_0x38d4('0x34')]=_0x52d205[_0x38d4('0x34')]['length']?_0x52d205[_0x38d4('0x34')]:_0x4ef7e7[_0x38d4('0x2e')];if(_0x7e200b[_0x38d4('0x2f')][_0x38d4('0x40')]){_0x52d205[_0x38d4('0x41')]=[{'all':!![]}];}_0x52d205=_[_0x38d4('0x3c')]({},_0x52d205,_0x7e200b[_0x38d4('0x3f')]);return db[_0x38d4('0x2b')][_0x38d4('0x47')](_0x52d205)['then'](handleEntityNotFound(_0x469d2a,null))[_0x38d4('0x24')](respondWithResult(_0x469d2a,null))['catch'](handleError(_0x469d2a,null));};exports['create']=function(_0xc841f9,_0x273ef8){return db[_0x38d4('0x2b')][_0x38d4('0x48')](_0xc841f9[_0x38d4('0x49')],{})[_0x38d4('0x24')](function(_0x1bacea){var _0x3bc01f=_0xc841f9[_0x38d4('0x4a')][_0x38d4('0x25')]({'plain':!![]});if(!_0x3bc01f)throw new Error(_0x38d4('0x4b'));if(_0x3bc01f[_0x38d4('0x4c')]===_0x38d4('0x4a')){var _0x1f418c=_0x1bacea['get']({'plain':!![]});var _0x5a5a52=_0x38d4('0x26');return db[_0x38d4('0x4d')]['find']({'where':{'name':_0x5a5a52,'userProfileId':_0x3bc01f[_0x38d4('0x4e')]},'raw':!![]})[_0x38d4('0x24')](function(_0x31f58d){if(_0x31f58d&&_0x31f58d[_0x38d4('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x1f418c[_0x38d4('0x3e')],'resourceId':_0x1f418c['id'],'type':_0x31f58d[_0x38d4('0x3e')],'sectionId':_0x31f58d['id']},{})['then'](function(){return _0x1bacea;});}else{return _0x1bacea;}})[_0x38d4('0x44')](function(_0x1efac6){logger[_0x38d4('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1efac6);throw _0x1efac6;});}return _0x1bacea;})[_0x38d4('0x24')](respondWithResult(_0x273ef8,0xc9))[_0x38d4('0x44')](handleError(_0x273ef8,null));};exports[_0x38d4('0x51')]=function(_0x5257cc,_0x5cb3f5){if(_0x5257cc[_0x38d4('0x49')]['id']){delete _0x5257cc[_0x38d4('0x49')]['id'];}return db[_0x38d4('0x2b')][_0x38d4('0x47')]({'where':{'id':_0x5257cc[_0x38d4('0x52')]['id']}})[_0x38d4('0x24')](handleEntityNotFound(_0x5cb3f5,null))[_0x38d4('0x24')](saveUpdates(_0x5257cc[_0x38d4('0x49')],null))[_0x38d4('0x24')](respondWithResult(_0x5cb3f5,null))['catch'](handleError(_0x5cb3f5,null));};exports['destroy']=function(_0x446090,_0x457dc0){return db[_0x38d4('0x2b')][_0x38d4('0x47')]({'where':{'id':_0x446090[_0x38d4('0x52')]['id']}})[_0x38d4('0x24')](handleEntityNotFound(_0x457dc0,null))['then'](removeEntity(_0x457dc0,null))[_0x38d4('0x44')](handleError(_0x457dc0,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index e301f35..6404cc4 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 _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x1239a7,_0x944a3e){var _0x318e98=function(_0x3215d2){while(--_0x3215d2){_0x1239a7['push'](_0x1239a7['shift']());}};_0x318e98(++_0x944a3e);}(_0x814b,0x1a2));var _0xb814=function(_0x262323,_0x4a81f1){_0x262323=_0x262323-0x0;var _0xa963c3=_0x814b[_0x262323];return _0xa963c3;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc4aa[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 95ddfac..822078c 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(_0x5205af,_0x1f88a4){var _0x1265df=function(_0x56733c){while(--_0x56733c){_0x5205af['push'](_0x5205af['shift']());}};_0x1265df(++_0x1f88a4);}(_0xb10b,0x12a));var _0xbb10=function(_0x27c25f,_0x4ff5fe){_0x27c25f=_0x27c25f-0x0;var _0x2da4c4=_0xb10b[_0x27c25f];return _0x2da4c4;};'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(_0x387c53,_0x424209){var _0xe3780b=function(_0x5ec6ed){while(--_0x5ec6ed){_0x387c53['push'](_0x387c53['shift']());}};_0xe3780b(++_0x424209);}(_0xb10b,0x12a));var _0xbb10=function(_0x2bf1fb,_0x10022d){_0x2bf1fb=_0x2bf1fb-0x0;var _0x5e7e68=_0xb10b[_0x2bf1fb];return _0x5e7e68;};'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 74c255d..df180d5 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 _0xbec5=['get','index','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','upload','webhookPost','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller'];(function(_0x41ebe2,_0x4c7ab9){var _0x2fc8dc=function(_0x44424c){while(--_0x44424c){_0x41ebe2['push'](_0x41ebe2['shift']());}};_0x2fc8dc(++_0x4c7ab9);}(_0xbec5,0xe5));var _0x5bec=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0xbec5[_0x27bcf5];return _0x4ce4cf;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),controller[_0x5bec('0xc')]);router[_0x5bec('0x9')](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0xf')]);router['get'](_0x5bec('0x10'),auth['isAuthenticated'](),controller[_0x5bec('0x11')]);var upload=multer({'storage':multer[_0x5bec('0x12')]({'destination':function(_0x117162,_0x4a5482,_0x288d1b){_0x288d1b(null,path[_0x5bec('0x13')](config[_0x5bec('0x14')],'server/files/plugins'));},'filename':function(_0x6bee21,_0x1c888f,_0x589d14){_0x1c888f[_0x5bec('0x15')]=_0x1c888f[_0x5bec('0x15')][_0x5bec('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x589d14(null,util[_0x5bec('0x17')](_0x5bec('0x18'),path[_0x5bec('0x19')](_0x1c888f[_0x5bec('0x15')],path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])),Date[_0x5bec('0x1b')](),path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])));}})});router[_0x5bec('0x1c')]('/',upload['single']('file'),controller[_0x5bec('0x1d')]);router[_0x5bec('0x1c')](_0x5bec('0xb'),controller[_0x5bec('0x1e')]);router['put']('/:id',auth[_0x5bec('0xe')](),controller[_0x5bec('0x1f')]);router['delete'](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0x20')]);module[_0x5bec('0x21')]=router; \ No newline at end of file +var _0xadb8=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet','/:id','/:id/download','join','root','server/files/plugins','originalname','%s-%s%s','extname','post','single','file','upload','webhookPost','update','delete','exports'];(function(_0x584726,_0x5bb8e5){var _0x449aa8=function(_0x2c2767){while(--_0x2c2767){_0x584726['push'](_0x584726['shift']());}};_0x449aa8(++_0x5bb8e5);}(_0xadb8,0x1d0));var _0x8adb=function(_0x12aba8,_0x40a036){_0x12aba8=_0x12aba8-0x0;var _0x2aac66=_0xadb8[_0x12aba8];return _0x2aac66;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8adb('0x0'));var timeout=require('connect-timeout');var express=require(_0x8adb('0x1'));var router=express[_0x8adb('0x2')]();var fs_extra=require(_0x8adb('0x3'));var auth=require(_0x8adb('0x4'));var interaction=require(_0x8adb('0x5'));var config=require(_0x8adb('0x6'));var controller=require(_0x8adb('0x7'));router['get']('/',auth[_0x8adb('0x8')](),controller[_0x8adb('0x9')]);router[_0x8adb('0xa')](_0x8adb('0xb'),controller[_0x8adb('0xc')]);router[_0x8adb('0xa')](_0x8adb('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8adb('0xe'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa095e1,_0x628c45,_0x46c6fb){_0x46c6fb(null,path[_0x8adb('0xf')](config[_0x8adb('0x10')],_0x8adb('0x11')));},'filename':function(_0x2a6574,_0x2828f1,_0x2d6b55){_0x2828f1[_0x8adb('0x12')]=_0x2828f1['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2d6b55(null,util['format'](_0x8adb('0x13'),path['basename'](_0x2828f1[_0x8adb('0x12')],path[_0x8adb('0x14')](_0x2828f1[_0x8adb('0x12')])),Date['now'](),path[_0x8adb('0x14')](_0x2828f1[_0x8adb('0x12')])));}})});router[_0x8adb('0x15')]('/',upload[_0x8adb('0x16')](_0x8adb('0x17')),controller[_0x8adb('0x18')]);router['post'](_0x8adb('0xb'),controller[_0x8adb('0x19')]);router['put']('/:id',auth[_0x8adb('0x8')](),controller[_0x8adb('0x1a')]);router[_0x8adb('0x1b')](_0x8adb('0xd'),auth[_0x8adb('0x8')](),controller[_0x8adb('0x1b')]);module[_0x8adb('0x1c')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 3a961df..bd08133 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 _0x1a64=['ENUM','html','script','TEXT','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0x181728,_0x471cc4){var _0x3525db=function(_0x59c05c){while(--_0x59c05c){_0x181728['push'](_0x181728['shift']());}};_0x3525db(++_0x471cc4);}(_0x1a64,0x1d6));var _0x41a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a64[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x41a6('0x0'));module[_0x41a6('0x1')]={'name':{'type':Sequelize[_0x41a6('0x2')]},'type':{'type':Sequelize[_0x41a6('0x3')](_0x41a6('0x4'),_0x41a6('0x5'))},'description':{'type':Sequelize[_0x41a6('0x6')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0x41a6('0x7'),_0x41a6('0x8'),_0x41a6('0x9'),'never'),'defaultValue':_0x41a6('0x9'),'comment':_0x41a6('0xa')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x41a6('0x2')]},'agentUrl':{'type':Sequelize[_0x41a6('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x11df=['sequelize','exports','STRING','ENUM','html','script','TEXT','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x11df,0x12c));var _0xf11d=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x11df[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0xf11d('0x0'));module[_0xf11d('0x1')]={'name':{'type':Sequelize[_0xf11d('0x2')]},'type':{'type':Sequelize[_0xf11d('0x3')](_0xf11d('0x4'),_0xf11d('0x5'))},'description':{'type':Sequelize[_0xf11d('0x6')]},'version':{'type':Sequelize[_0xf11d('0x6')]},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf11d('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0xf11d('0x8'),'agentOnly',_0xf11d('0x9'),_0xf11d('0xa')),'defaultValue':_0xf11d('0x9'),'comment':_0xf11d('0xb')},'icon':{'type':Sequelize[_0xf11d('0x2')]},'adminUrl':{'type':Sequelize[_0xf11d('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xf11d('0x2')]},'scriptPath':{'type':Sequelize[_0xf11d('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 8f9859e..a40765c 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 _0xef13=['Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','parameters','admin','agent','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','test','plugins','create','body','role','userProfileId','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','headers','content-length','content-type','endsWith','statusCode','method','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','name','send','index','map','Plugin','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','show','length','includeAll','catch','download','find','root','server/files/plugins','format','basename','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','dirname','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified'];(function(_0x5e0963,_0x3ff898){var _0x15dfd6=function(_0x286fab){while(--_0x286fab){_0x5e0963['push'](_0x5e0963['shift']());}};_0x15dfd6(++_0x3ff898);}(_0xef13,0x17d));var _0x3ef1=function(_0x12628b,_0x155dc7){_0x12628b=_0x12628b-0x0;var _0x17d4ec=_0xef13[_0x12628b];return _0x17d4ec;};'use strict';var emlformat=require(_0x3ef1('0x0'));var rimraf=require(_0x3ef1('0x1'));var zipdir=require(_0x3ef1('0x2'));var jsonpatch=require(_0x3ef1('0x3'));var rp=require(_0x3ef1('0x4'));var moment=require(_0x3ef1('0x5'));var BPromise=require(_0x3ef1('0x6'));var Mustache=require('mustache');var util=require(_0x3ef1('0x7'));var path=require(_0x3ef1('0x8'));var sox=require(_0x3ef1('0x9'));var csv=require('to-csv');var ejs=require(_0x3ef1('0xa'));var fs=require('fs');var fs_extra=require(_0x3ef1('0xb'));var _=require(_0x3ef1('0xc'));var squel=require(_0x3ef1('0xd'));var crypto=require(_0x3ef1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3ef1('0xf'));var toCsv=require(_0x3ef1('0x10'));var querystring=require(_0x3ef1('0x11'));var Papa=require(_0x3ef1('0x12'));var extract=require(_0x3ef1('0x13'));var rimraf=require('rimraf');var archiver=require(_0x3ef1('0x14'));var Redis=require(_0x3ef1('0x15'));var authService=require(_0x3ef1('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0x3ef1('0x17'));var hardwareService=require(_0x3ef1('0x18'));var logger=require(_0x3ef1('0x19'))(_0x3ef1('0x1a'));var utils=require(_0x3ef1('0x1b'));var config=require(_0x3ef1('0x1c'));var licenseUtil=require(_0x3ef1('0x1d'));var db=require(_0x3ef1('0x1e'))['db'];config[_0x3ef1('0x1f')]=_[_0x3ef1('0x20')](config['redis'],{'host':_0x3ef1('0x21'),'port':0x18eb});var socket=require(_0x3ef1('0x22'))(new Redis(config['redis']));require('./plugin.socket')[_0x3ef1('0x23')](socket);function respondWithStatusCode(_0x17ce66,_0x32c00d){_0x32c00d=_0x32c00d||0xcc;return function(_0x5a4779){if(_0x5a4779){return _0x17ce66[_0x3ef1('0x24')](_0x32c00d);}return _0x17ce66['status'](_0x32c00d)[_0x3ef1('0x25')]();};}function respondWithResult(_0x3d5bee,_0x81349c){_0x81349c=_0x81349c||0xc8;return function(_0x5954c0){if(_0x5954c0){return _0x3d5bee[_0x3ef1('0x26')](_0x81349c)[_0x3ef1('0x27')](_0x5954c0);}};}function respondWithFilteredResult(_0xa63e06,_0x56fd1c){return function(_0x3818d3){if(_0x3818d3){var _0x5746d3=typeof _0x56fd1c[_0x3ef1('0x28')]===_0x3ef1('0x29')&&typeof _0x56fd1c[_0x3ef1('0x2a')]===_0x3ef1('0x29');var _0x77d39e=_0x3818d3['count'];var _0x15fc5b=_0x5746d3?0x0:_0x56fd1c[_0x3ef1('0x28')];var _0x1d7709=_0x5746d3?_0x3818d3[_0x3ef1('0x2b')]:_0x56fd1c[_0x3ef1('0x28')]+_0x56fd1c['limit'];var _0x1bdaf6;if(_0x1d7709>=_0x77d39e){_0x1d7709=_0x77d39e;_0x1bdaf6=0xc8;}else{_0x1bdaf6=0xce;}_0xa63e06[_0x3ef1('0x26')](_0x1bdaf6);return _0xa63e06[_0x3ef1('0x2c')](_0x3ef1('0x2d'),_0x15fc5b+'-'+_0x1d7709+'/'+_0x77d39e)[_0x3ef1('0x27')](_0x3818d3);}return null;};}function patchUpdates(_0x297c15){return function(_0x40cb31){try{jsonpatch[_0x3ef1('0x2e')](_0x40cb31,_0x297c15,!![]);}catch(_0x447b8a){return BPromise[_0x3ef1('0x2f')](_0x447b8a);}return _0x40cb31[_0x3ef1('0x30')]();};}function saveUpdates(_0xa179c4,_0x2379ab){return function(_0x13dd32){if(_0x13dd32){return _0x13dd32[_0x3ef1('0x31')](_0xa179c4)[_0x3ef1('0x32')](function(_0x1673d0){return _0x1673d0;});}return null;};}function removeEntity(_0x2b7f65,_0x136fea){return function(_0x3bc081){if(_0x3bc081){return _0x3bc081[_0x3ef1('0x33')]()[_0x3ef1('0x32')](function(){var _0x2fe191=_0x3bc081[_0x3ef1('0x34')]({'plain':!![]});var _0x53a12a=_0x3ef1('0x35');return db[_0x3ef1('0x36')]['destroy']({'where':{'type':_0x53a12a,'resourceId':_0x2fe191['id']}})[_0x3ef1('0x32')](function(){return _0x3bc081;});})[_0x3ef1('0x32')](function(){_0x2b7f65[_0x3ef1('0x26')](0xcc)[_0x3ef1('0x25')]();});}};}function handleEntityNotFound(_0x44588c,_0x2c43c6){return function(_0x57d7c5){if(!_0x57d7c5){_0x44588c[_0x3ef1('0x24')](0x194);}return _0x57d7c5;};}function handleError(_0x51ec62,_0x2ad275){_0x2ad275=_0x2ad275||0x1f4;return function(_0x1b1e4b){logger[_0x3ef1('0x37')](_0x1b1e4b['stack']);if(_0x1b1e4b[_0x3ef1('0x38')]){delete _0x1b1e4b[_0x3ef1('0x38')];}_0x51ec62[_0x3ef1('0x26')](_0x2ad275)[_0x3ef1('0x39')](_0x1b1e4b);};}exports[_0x3ef1('0x3a')]=function(_0x36beb6,_0xd1c8a8){var _0x4df840={},_0x45b134={},_0x2155d5={'count':0x0,'rows':[]};var _0x561590=_[_0x3ef1('0x3b')](db[_0x3ef1('0x3c')][_0x3ef1('0x3d')],function(_0x393cdd){return{'name':_0x393cdd[_0x3ef1('0x3e')],'type':_0x393cdd[_0x3ef1('0x3f')]['key']};});_0x45b134[_0x3ef1('0x40')]=_['map'](_0x561590,'name');_0x45b134[_0x3ef1('0x41')]=_[_0x3ef1('0x42')](_0x36beb6[_0x3ef1('0x41')]);_0x45b134[_0x3ef1('0x43')]=_[_0x3ef1('0x44')](_0x45b134['model'],_0x45b134['query']);_0x4df840['attributes']=_[_0x3ef1('0x44')](_0x45b134[_0x3ef1('0x40')],qs['fields'](_0x36beb6['query'][_0x3ef1('0x45')]));_0x4df840[_0x3ef1('0x46')]=_0x4df840[_0x3ef1('0x46')]['length']?_0x4df840[_0x3ef1('0x46')]:_0x45b134[_0x3ef1('0x40')];if(!_0x36beb6[_0x3ef1('0x41')][_0x3ef1('0x47')](_0x3ef1('0x48'))){_0x4df840[_0x3ef1('0x2a')]=qs[_0x3ef1('0x2a')](_0x36beb6[_0x3ef1('0x41')][_0x3ef1('0x2a')]);_0x4df840[_0x3ef1('0x28')]=qs[_0x3ef1('0x28')](_0x36beb6['query'][_0x3ef1('0x28')]);}_0x4df840[_0x3ef1('0x49')]=qs['sort'](_0x36beb6[_0x3ef1('0x41')][_0x3ef1('0x4a')]);_0x4df840[_0x3ef1('0x4b')]=qs[_0x3ef1('0x43')](_[_0x3ef1('0x4c')](_0x36beb6['query'],_0x45b134['filters']),_0x561590);if(_0x36beb6[_0x3ef1('0x41')][_0x3ef1('0x4d')]){_0x4df840[_0x3ef1('0x4b')]=_['merge'](_0x4df840['where'],{'$or':_[_0x3ef1('0x3b')](_0x561590,function(_0x176968){if(_0x176968[_0x3ef1('0x3f')]!=='VIRTUAL'){var _0x4b38de={};_0x4b38de[_0x176968['name']]={'$like':'%'+_0x36beb6[_0x3ef1('0x41')][_0x3ef1('0x4d')]+'%'};return _0x4b38de;}})});}_0x4df840=_[_0x3ef1('0x4e')]({},_0x4df840,_0x36beb6[_0x3ef1('0x4f')]);var _0x4bd4fc={'where':_0x4df840['where']};return db[_0x3ef1('0x3c')][_0x3ef1('0x2b')](_0x4bd4fc)[_0x3ef1('0x32')](function(_0x30aad4){_0x2155d5[_0x3ef1('0x2b')]=_0x30aad4;if(_0x36beb6[_0x3ef1('0x41')]['includeAll']){_0x4df840[_0x3ef1('0x50')]=[{'all':!![]}];}return db[_0x3ef1('0x3c')]['findAll'](_0x4df840);})['then'](function(_0x12b37e){_0x2155d5['rows']=_0x12b37e;return _0x2155d5;})[_0x3ef1('0x32')](respondWithFilteredResult(_0xd1c8a8,_0x4df840))['catch'](handleError(_0xd1c8a8,null));};exports[_0x3ef1('0x51')]=function(_0x56138b,_0x57dd81){var _0x1451d6={'raw':!![],'where':{'id':_0x56138b['params']['id']}},_0x2b5f3b={};_0x2b5f3b['model']=_[_0x3ef1('0x42')](db[_0x3ef1('0x3c')][_0x3ef1('0x3d')]);_0x2b5f3b[_0x3ef1('0x41')]=_[_0x3ef1('0x42')](_0x56138b[_0x3ef1('0x41')]);_0x2b5f3b[_0x3ef1('0x43')]=_[_0x3ef1('0x44')](_0x2b5f3b['model'],_0x2b5f3b[_0x3ef1('0x41')]);_0x1451d6[_0x3ef1('0x46')]=_[_0x3ef1('0x44')](_0x2b5f3b[_0x3ef1('0x40')],qs[_0x3ef1('0x45')](_0x56138b[_0x3ef1('0x41')][_0x3ef1('0x45')]));_0x1451d6['attributes']=_0x1451d6['attributes'][_0x3ef1('0x52')]?_0x1451d6[_0x3ef1('0x46')]:_0x2b5f3b[_0x3ef1('0x40')];if(_0x56138b[_0x3ef1('0x41')][_0x3ef1('0x53')]){_0x1451d6[_0x3ef1('0x50')]=[{'all':!![]}];}_0x1451d6=_[_0x3ef1('0x4e')]({},_0x1451d6,_0x56138b[_0x3ef1('0x4f')]);return db[_0x3ef1('0x3c')]['find'](_0x1451d6)[_0x3ef1('0x32')](handleEntityNotFound(_0x57dd81,null))['then'](respondWithResult(_0x57dd81,null))[_0x3ef1('0x54')](handleError(_0x57dd81,null));};exports[_0x3ef1('0x55')]=function(_0x3c0933,_0x5b6cf5,_0x11f112){return db['Plugin'][_0x3ef1('0x56')]({'where':{'id':_0x3c0933['params']['id']},'attributes':[_0x3ef1('0x38'),_0x3ef1('0x8')],'raw':!![]})[_0x3ef1('0x32')](handleEntityNotFound(_0x5b6cf5,null))[_0x3ef1('0x32')](function(_0x46fe3f){if(_0x46fe3f){var _0x3082f1=path['join'](config[_0x3ef1('0x57')],_0x3ef1('0x58'),util[_0x3ef1('0x59')]('%s.zip',path[_0x3ef1('0x5a')](_0x46fe3f['path'])));var _0x1b835d=fs['createWriteStream'](_0x3082f1);var _0x2556f0=archiver('zip',{'zlib':{'level':0x9}});_0x2556f0['on'](_0x3ef1('0x5b'),function(_0x16e8b0){if(_0x16e8b0[_0x3ef1('0x5c')]===_0x3ef1('0x5d')){logger[_0x3ef1('0x37')](_0x16e8b0);}else{throw new db[(_0x3ef1('0x5e'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x2556f0['on'](_0x3ef1('0x37'),function(_0x1d321d){throw new db[(_0x3ef1('0x5e'))][(_0x3ef1('0x5f'))](_0x3ef1('0x60'));});_0x2556f0[_0x3ef1('0x61')](_0x1b835d);_0x2556f0[_0x3ef1('0x62')](_0x3ef1('0x63'),{'cwd':path[_0x3ef1('0x64')](config[_0x3ef1('0x57')],_0x3ef1('0x58'),path[_0x3ef1('0x65')](_0x46fe3f[_0x3ef1('0x8')])),'ignore':[path['join'](path[_0x3ef1('0x5a')](_0x46fe3f[_0x3ef1('0x8')]),_0x3ef1('0x66')),path['join'](path[_0x3ef1('0x5a')](_0x46fe3f[_0x3ef1('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x3ef1('0x67')]();_0x1b835d['on'](_0x3ef1('0x68'),function(){if(!fs[_0x3ef1('0x69')](_0x3082f1)){throw new db[(_0x3ef1('0x5e'))][(_0x3ef1('0x5f'))](_0x3ef1('0x6a'));}return _0x5b6cf5[_0x3ef1('0x55')](_0x3082f1,util[_0x3ef1('0x59')]('%s.zip',path[_0x3ef1('0x5a')](_0x46fe3f[_0x3ef1('0x8')])),function(_0x282b2b){if(_0x282b2b){throw new db['Sequelize'][(_0x3ef1('0x5f'))](_0x3ef1('0x6b'));}fs[_0x3ef1('0x6c')](_0x3082f1);logger[_0x3ef1('0x6d')](_0x3ef1('0x6e'));logger['info'](_0x3ef1('0x6f'));});});}return null;})['catch'](handleError(_0x5b6cf5,null));};exports['upload']=function(_0x3eaa2f,_0x3d428c,_0x53c7a5){var _0x17798c=path['basename'](_0x3eaa2f[_0x3ef1('0x70')][_0x3ef1('0x71')],path[_0x3ef1('0x72')](_0x3eaa2f[_0x3ef1('0x70')][_0x3ef1('0x71')]));var _0x1329ab=path[_0x3ef1('0x64')](config['root'],_0x3ef1('0x58'),_0x3eaa2f[_0x3ef1('0x70')][_0x3ef1('0x71')]);var _0x482016=path[_0x3ef1('0x64')](config[_0x3ef1('0x57')],_0x3ef1('0x58'),_0x17798c);logger[_0x3ef1('0x6d')](_0x3ef1('0x73'),_0x1329ab);logger[_0x3ef1('0x6d')](_0x3ef1('0x74'),_0x482016);try{fs[_0x3ef1('0x75')](_0x1329ab,parseInt(_0x3ef1('0x76'),0x8));extract(_0x1329ab,{'dir':_0x482016},function(_0x2ae025){if(_0x2ae025){logger[_0x3ef1('0x37')](_0x2ae025);handleError(_0x2ae025,!![]);};var _0x405688=fs[_0x3ef1('0x77')](_0x482016);if(_0x405688['length']>0x1){removeReferences(_0x1329ab,_0x482016);logger['error'](_0x3ef1('0x78'));return _0x53c7a5(new Error(_0x3ef1('0x78')));}var _0x2cf5d3=fs[_0x3ef1('0x79')](path[_0x3ef1('0x64')](_0x482016,_0x405688[0x0]));if(_0x2cf5d3[_0x3ef1('0x7a')]()){removeReferences(_0x1329ab,_0x482016);logger[_0x3ef1('0x37')](_0x3ef1('0x78'));return _0x53c7a5(new Error(_0x3ef1('0x78')));}if(_0x2cf5d3['isDirectory']()){var _0x39a7a9=fs[_0x3ef1('0x77')](path[_0x3ef1('0x64')](_0x482016,_0x405688[0x0]));if(_0x39a7a9['length']===0x0){removeReferences(_0x1329ab,_0x482016);logger['error'](_0x3ef1('0x78'));return _0x53c7a5(new Error(_0x3ef1('0x78')));}var _0xf55113=_0x39a7a9[_0x3ef1('0x7b')](function(_0x34df8d){return _0x34df8d===_0x3ef1('0x7c');});if(!_0xf55113){return _0x53c7a5(new Error(_0x3ef1('0x7d')));}var _0x18ab5e=fs[_0x3ef1('0x7e')](path[_0x3ef1('0x64')](_0x482016,_0x405688[0x0],'manifest.json'));var _0x549185=JSON[_0x3ef1('0x7f')](_0x18ab5e);if('undefined'==typeof _0x549185[_0x3ef1('0x38')]){return _0x53c7a5(new Error(_0x3ef1('0x80')));}if(_0x3ef1('0x29')==typeof _0x549185[_0x3ef1('0x3f')]){return _0x53c7a5(new Error(_0x3ef1('0x81')));}if(_0x3ef1('0x29')==typeof _0x549185[_0x3ef1('0x82')]){return _0x53c7a5(new Error(_0x3ef1('0x83')));}if('undefined'==typeof _0x549185['parameters']){return _0x53c7a5(new Error(_0x3ef1('0x84')));}if(_0x549185[_0x3ef1('0x3f')]===_0x3ef1('0x85')){if(_0x3ef1('0x29')==typeof _0x549185['parameters'][_0x3ef1('0x86')]){return _0x53c7a5(new Error(_0x3ef1('0x87')));}if('undefined'==typeof _0x549185[_0x3ef1('0x88')]['views'][_0x3ef1('0x89')]&&'undefined'==typeof _0x549185['parameters'][_0x3ef1('0x86')][_0x3ef1('0x8a')]){return _0x53c7a5(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x549185[_0x3ef1('0x3f')]===_0x3ef1('0x8b')){if('undefined'==typeof _0x549185[_0x3ef1('0x88')][_0x3ef1('0x8c')]){return _0x53c7a5(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x3ef1('0x29')==typeof _0x549185[_0x3ef1('0x88')][_0x3ef1('0x8d')]){return _0x53c7a5(new Error(_0x3ef1('0x8e')));}}else{return _0x53c7a5(new Error(_0x3ef1('0x8f')));}var _0x1a22e6=_0x549185[_0x3ef1('0x38')];var _0x129a0a=_0x549185[_0x3ef1('0x90')];var _0x780821=_0x549185[_0x3ef1('0x3f')];var _0x120fc7=_0x549185[_0x3ef1('0x91')]?_0x549185[_0x3ef1('0x91')]:_0x3ef1('0x92');var _0x33b669=_0x549185[_0x3ef1('0x93')]?_0x549185['icon']:'icon-apps';var _0x383cff='';var _0x58484e='';var _0x1cebac='';var _0x117568='';var _0x131301=_0x549185['version'];if(_0x780821===_0x3ef1('0x85')){if('undefined'!=typeof _0x549185['parameters'][_0x3ef1('0x86')][_0x3ef1('0x89')]){var _0x5609ab=_0x549185['parameters'][_0x3ef1('0x86')][_0x3ef1('0x89')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5609ab)){_0x383cff=path['join']('plugins',_0x17798c,_0x405688[0x0],_0x5609ab);}else{_0x383cff=_0x5609ab;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x549185['parameters']['views'][_0x3ef1('0x8a')]){var _0x5b4000=_0x549185['parameters']['views'][_0x3ef1('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x3ef1('0x94')](_0x5b4000)){_0x58484e=path[_0x3ef1('0x64')](_0x3ef1('0x95'),_0x17798c,_0x405688[0x0],_0x5b4000);}else{_0x58484e=_0x5b4000;}}else{logger[_0x3ef1('0x6d')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x780821===_0x3ef1('0x8b')){_0x1cebac=_0x549185[_0x3ef1('0x88')]['scriptName'];_0x117568=_0x549185['parameters'][_0x3ef1('0x8d')];if('undefined'!=typeof _0x549185[_0x3ef1('0x88')][_0x3ef1('0x86')]){if(_0x3ef1('0x29')!=typeof _0x549185[_0x3ef1('0x88')]['views'][_0x3ef1('0x89')]){var _0x5609ab=_0x549185[_0x3ef1('0x88')]['views'][_0x3ef1('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x3ef1('0x94')](_0x5609ab)){_0x383cff=path[_0x3ef1('0x64')](_0x3ef1('0x95'),_0x17798c,_0x405688[0x0],_0x5609ab);}else{_0x383cff=_0x5609ab;}}if(_0x3ef1('0x29')!=typeof _0x549185['parameters']['views'][_0x3ef1('0x8a')]){var _0x5b4000=_0x549185['parameters'][_0x3ef1('0x86')][_0x3ef1('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x3ef1('0x94')](_0x5b4000)){_0x58484e=path[_0x3ef1('0x64')]('plugins',_0x17798c,_0x405688[0x0],_0x5b4000);}else{_0x58484e=_0x5b4000;}}}}var _0x29b19b={'name':_0x1a22e6,'description':_0x129a0a,'path':path[_0x3ef1('0x64')](_0x17798c,_0x405688[0x0]),'type':_0x780821,'sidebar':_0x120fc7,'icon':_0x33b669,'adminUrl':_0x383cff,'agentUrl':_0x58484e,'scriptName':_0x1cebac,'scriptPath':_0x117568,'version':_0x131301};removeReferences(_0x1329ab,null);return db[_0x3ef1('0x3c')][_0x3ef1('0x96')](_0x29b19b)['then'](function(_0x6de535){var _0x31bcd9={'role':_0x3eaa2f[_0x3ef1('0x97')][_0x3ef1('0x98')],'userProfileId':_0x3eaa2f[_0x3ef1('0x97')][_0x3ef1('0x99')]};if(!_0x31bcd9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31bcd9[_0x3ef1('0x98')]==='user'){var _0x29a760=_0x6de535[_0x3ef1('0x34')]({'plain':!![]});return db[_0x3ef1('0x9a')][_0x3ef1('0x56')]({'where':{'name':_0x3ef1('0x35'),'userProfileId':_0x31bcd9[_0x3ef1('0x99')]},'raw':!![]})[_0x3ef1('0x32')](function(_0x1c1b34){if(_0x1c1b34&&_0x1c1b34['autoAssociation']===0x0){return db['UserProfileResource'][_0x3ef1('0x96')]({'name':_0x29a760[_0x3ef1('0x38')],'resourceId':_0x29a760['id'],'type':_0x1c1b34[_0x3ef1('0x38')],'sectionId':_0x1c1b34['id']},{})[_0x3ef1('0x32')](function(){return _0x6de535;});}else{return _0x6de535;}})[_0x3ef1('0x54')](function(_0x38e234){logger['error'](_0x3ef1('0x9b'),_0x38e234);throw _0x38e234;});}return _0x6de535;})['then'](respondWithResult(_0x3d428c,null))[_0x3ef1('0x54')](handleError(_0x3d428c,null));}});}catch(_0x5d0c8b){_0x3d428c[_0x3ef1('0x26')](0x1f4)[_0x3ef1('0x39')](_0x5d0c8b);}};function removeReferences(_0x26384f,_0x5542ee){try{if(_0x26384f){fs['unlinkSync'](_0x26384f);logger['info']('Zip\x20archive\x20removed');}if(_0x5542ee){rimraf(_0x5542ee,function(){});logger[_0x3ef1('0x6d')]('Extracted\x20folder\x20removed');}}catch(_0x5a85ef){logger['error'](_0x5a85ef);}}exports['update']=function(_0x5bff52,_0x3ca4bd,_0x3219e5){return db[_0x3ef1('0x3c')][_0x3ef1('0x56')]({'where':{'id':_0x5bff52[_0x3ef1('0x9c')]['id']}})[_0x3ef1('0x32')](handleEntityNotFound(_0x3ca4bd,null))[_0x3ef1('0x32')](saveUpdates(_0x5bff52[_0x3ef1('0x97')],null))[_0x3ef1('0x32')](respondWithResult(_0x3ca4bd,null))['catch'](handleError(_0x3ca4bd,null));};exports['delete']=function(_0x87cf28,_0x4fb83a,_0x50213f){return db[_0x3ef1('0x3c')][_0x3ef1('0x56')]({'where':{'id':_0x87cf28[_0x3ef1('0x9c')]['id']}})[_0x3ef1('0x32')](function(_0x5af013){if(_0x5af013){return _0x5af013[_0x3ef1('0x33')]();}})['then'](function(_0x509352){rimraf(path[_0x3ef1('0x64')](config[_0x3ef1('0x57')],_0x3ef1('0x58'),path[_0x3ef1('0x65')](_0x509352[_0x3ef1('0x8')])),function(){});return _0x509352;})['then'](handleEntityNotFound(_0x4fb83a,null))['then'](respondWithStatusCode(_0x4fb83a,null))[_0x3ef1('0x54')](handleError(_0x4fb83a,null));};exports[_0x3ef1('0x9d')]=function(_0x339c1f,_0x8b8690,_0x44eb6e){return BPromise[_0x3ef1('0x9e')]()[_0x3ef1('0x32')](function(){if(!_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x9f')]){throw new Error(_0x3ef1('0xa0'));}var _0x135700=_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0xa1')]?_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0xa1')]+':'+_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x9f')]:_0x3ef1('0xa2')+_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x9f')];var _0x182910=_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x27')]?_0x339c1f['query'][_0x3ef1('0x27')]:!![];var _0x5d91da=_0x339c1f['query'][_0x3ef1('0xa3')]?_0x339c1f[_0x3ef1('0x41')]['encoding']:null;var _0x3a13dd={'method':_0x339c1f['method'],'uri':util[_0x3ef1('0x59')]('%s%s',_0x135700,_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x8')]),'json':_0x182910,'resolveWithFullResponse':!![],'encoding':_0x5d91da,'qs':_0x339c1f[_0x3ef1('0x41')]};if(_0x339c1f['headers']){_0x3a13dd['headers']=_0x339c1f[_0x3ef1('0xa4')];if(_0x3a13dd[_0x3ef1('0xa4')][_0x3ef1('0xa5')]){delete _0x3a13dd[_0x3ef1('0xa4')]['content-length'];}}if(_0x3a13dd['headers'][_0x3ef1('0xa6')]){delete _0x3a13dd[_0x3ef1('0xa4')][_0x3ef1('0xa6')];}return rp(_0x3a13dd);})[_0x3ef1('0x32')](function(_0x429f6c){if(_0x429f6c){_0x8b8690[_0x3ef1('0x2c')](_0x429f6c[_0x3ef1('0xa4')]);logger[_0x3ef1('0x6d')](_0x429f6c['body']);if(_[_0x3ef1('0xa7')](_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x8')],_0x3ef1('0x55'))&&_0x429f6c[_0x3ef1('0xa8')]==0x1f4){return _0x8b8690[_0x3ef1('0x24')](_0x429f6c[_0x3ef1('0xa8')]);}else{return _0x8b8690[_0x3ef1('0x26')](_0x429f6c[_0x3ef1('0xa8')])[_0x3ef1('0x39')](_0x429f6c[_0x3ef1('0x97')]);}}else{return _0x8b8690['sendStatus'](0xc8);}})['catch'](handleError(_0x8b8690,null));};exports['webhookPost']=function(_0xdc3284,_0x578729,_0x2d2297){return BPromise[_0x3ef1('0x9e')]()[_0x3ef1('0x32')](function(){if(!_0xdc3284[_0x3ef1('0x41')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0x9f')]){throw new Error(_0x3ef1('0xa0'));}var _0x353ac3=_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0xa1')]?_0xdc3284['query'][_0x3ef1('0xa1')]+':'+_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0x9f')]:_0x3ef1('0xa2')+_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0x9f')];var _0xdedce8=_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0x27')]?_0xdc3284['query'][_0x3ef1('0x27')]:!![];var _0x15d08b=_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0xa3')]?_0xdc3284[_0x3ef1('0x41')]['encoding']:null;var _0x34fec9={'method':_0xdc3284[_0x3ef1('0xa9')],'uri':util[_0x3ef1('0x59')](_0x3ef1('0xaa'),_0x353ac3,_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0x8')]),'json':_0xdedce8,'resolveWithFullResponse':!![],'encoding':_0x15d08b,'body':_0xdc3284[_0x3ef1('0x97')]};if(_0xdc3284[_0x3ef1('0xa4')]){_0x34fec9[_0x3ef1('0xa4')]=_0xdc3284[_0x3ef1('0xa4')];if(_0x34fec9[_0x3ef1('0xa4')]['content-length']){delete _0x34fec9[_0x3ef1('0xa4')][_0x3ef1('0xa5')];}}if(_0x34fec9[_0x3ef1('0xa4')][_0x3ef1('0xa6')]){delete _0x34fec9['headers'][_0x3ef1('0xa6')];}return rp(_0x34fec9);})[_0x3ef1('0x32')](function(_0x52bafc){if(_0x52bafc){_0x578729[_0x3ef1('0x2c')](_0x52bafc[_0x3ef1('0xa4')]);logger[_0x3ef1('0x6d')](_0x52bafc[_0x3ef1('0x97')]);return _0x578729[_0x3ef1('0x26')](_0x52bafc[_0x3ef1('0xa8')])['send'](_0x52bafc[_0x3ef1('0x97')]);}else{return _0x578729[_0x3ef1('0x24')](0xc8);}})['catch'](handleError(_0x578729,null));}; \ No newline at end of file +var _0x357a=['role','user','get','autoAssociation','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','encoding','headers','content-length','content-type','endsWith','statusCode','webhookPost','hostname','http://localhost:','method','%s%s','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./plugin.socket','status','limit','undefined','count','offset','set','Content-Range','json','reject','then','destroy','Plugins','UserProfileResource','end','sendStatus','error','stack','name','send','rawAttributes','fieldName','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','catch','show','params','keys','find','download','join','root','%s.zip','basename','zip','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','parse','type','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x6fc7bf,_0x57b7ad){var _0x97def1=function(_0x27560b){while(--_0x27560b){_0x6fc7bf['push'](_0x6fc7bf['shift']());}};_0x97def1(++_0x57b7ad);}(_0x357a,0x171));var _0xa357=function(_0x54820e,_0x3ffcb5){_0x54820e=_0x54820e-0x0;var _0xd69551=_0x357a[_0x54820e];return _0xd69551;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa357('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa357('0x1'));var rp=require(_0xa357('0x2'));var moment=require('moment');var BPromise=require(_0xa357('0x3'));var Mustache=require('mustache');var util=require(_0xa357('0x4'));var path=require(_0xa357('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa357('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa357('0x7'));var squel=require(_0xa357('0x8'));var crypto=require(_0xa357('0x9'));var jsforce=require(_0xa357('0xa'));var deskjs=require(_0xa357('0xb'));var toCsv=require(_0xa357('0xc'));var querystring=require(_0xa357('0xd'));var Papa=require(_0xa357('0xe'));var extract=require('extract-zip');var rimraf=require(_0xa357('0x0'));var archiver=require(_0xa357('0xf'));var Redis=require(_0xa357('0x10'));var authService=require(_0xa357('0x11'));var qs=require(_0xa357('0x12'));var as=require(_0xa357('0x13'));var hardwareService=require(_0xa357('0x14'));var logger=require(_0xa357('0x15'))(_0xa357('0x16'));var utils=require(_0xa357('0x17'));var config=require(_0xa357('0x18'));var licenseUtil=require(_0xa357('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa357('0x1a')](config['redis'],{'host':_0xa357('0x1b'),'port':0x18eb});var socket=require(_0xa357('0x1c'))(new Redis(config[_0xa357('0x1d')]));require(_0xa357('0x1e'))['register'](socket);function respondWithStatusCode(_0x90c61f,_0x90df93){_0x90df93=_0x90df93||0xcc;return function(_0x5d8465){if(_0x5d8465){return _0x90c61f['sendStatus'](_0x90df93);}return _0x90c61f[_0xa357('0x1f')](_0x90df93)['end']();};}function respondWithResult(_0x5e4523,_0x1730e2){_0x1730e2=_0x1730e2||0xc8;return function(_0xf3555b){if(_0xf3555b){return _0x5e4523[_0xa357('0x1f')](_0x1730e2)['json'](_0xf3555b);}};}function respondWithFilteredResult(_0x148717,_0xf076f7){return function(_0x5e2370){if(_0x5e2370){var _0x5e5504=typeof _0xf076f7['offset']==='undefined'&&typeof _0xf076f7[_0xa357('0x20')]===_0xa357('0x21');var _0x3c92d6=_0x5e2370[_0xa357('0x22')];var _0x3edd14=_0x5e5504?0x0:_0xf076f7[_0xa357('0x23')];var _0x1234d6=_0x5e5504?_0x5e2370[_0xa357('0x22')]:_0xf076f7[_0xa357('0x23')]+_0xf076f7[_0xa357('0x20')];var _0xdd7091;if(_0x1234d6>=_0x3c92d6){_0x1234d6=_0x3c92d6;_0xdd7091=0xc8;}else{_0xdd7091=0xce;}_0x148717['status'](_0xdd7091);return _0x148717[_0xa357('0x24')](_0xa357('0x25'),_0x3edd14+'-'+_0x1234d6+'/'+_0x3c92d6)[_0xa357('0x26')](_0x5e2370);}return null;};}function patchUpdates(_0x41893a){return function(_0x2fdc14){try{jsonpatch['apply'](_0x2fdc14,_0x41893a,!![]);}catch(_0x42e318){return BPromise[_0xa357('0x27')](_0x42e318);}return _0x2fdc14['save']();};}function saveUpdates(_0x499f2d,_0x1e2803){return function(_0x253741){if(_0x253741){return _0x253741['update'](_0x499f2d)[_0xa357('0x28')](function(_0x1b17a6){return _0x1b17a6;});}return null;};}function removeEntity(_0x3fd3c6,_0x24b5f8){return function(_0x2e05e5){if(_0x2e05e5){return _0x2e05e5[_0xa357('0x29')]()[_0xa357('0x28')](function(){var _0x559367=_0x2e05e5['get']({'plain':!![]});var _0x24a723=_0xa357('0x2a');return db[_0xa357('0x2b')][_0xa357('0x29')]({'where':{'type':_0x24a723,'resourceId':_0x559367['id']}})['then'](function(){return _0x2e05e5;});})['then'](function(){_0x3fd3c6[_0xa357('0x1f')](0xcc)[_0xa357('0x2c')]();});}};}function handleEntityNotFound(_0x2f9cbc,_0x155d41){return function(_0x4600f4){if(!_0x4600f4){_0x2f9cbc[_0xa357('0x2d')](0x194);}return _0x4600f4;};}function handleError(_0x304d57,_0x5b17f4){_0x5b17f4=_0x5b17f4||0x1f4;return function(_0x5b87e1){logger[_0xa357('0x2e')](_0x5b87e1[_0xa357('0x2f')]);if(_0x5b87e1[_0xa357('0x30')]){delete _0x5b87e1[_0xa357('0x30')];}_0x304d57[_0xa357('0x1f')](_0x5b17f4)[_0xa357('0x31')](_0x5b87e1);};}exports['index']=function(_0x4751ee,_0x2c398b){var _0x13ee91={},_0x5a2b19={},_0x2da020={'count':0x0,'rows':[]};var _0x6e0d4c=_['map'](db['Plugin'][_0xa357('0x32')],function(_0x1bf212){return{'name':_0x1bf212[_0xa357('0x33')],'type':_0x1bf212['type'][_0xa357('0x34')]};});_0x5a2b19['model']=_[_0xa357('0x35')](_0x6e0d4c,_0xa357('0x30'));_0x5a2b19[_0xa357('0x36')]=_['keys'](_0x4751ee['query']);_0x5a2b19['filters']=_[_0xa357('0x37')](_0x5a2b19[_0xa357('0x38')],_0x5a2b19[_0xa357('0x36')]);_0x13ee91[_0xa357('0x39')]=_[_0xa357('0x37')](_0x5a2b19[_0xa357('0x38')],qs[_0xa357('0x3a')](_0x4751ee[_0xa357('0x36')][_0xa357('0x3a')]));_0x13ee91[_0xa357('0x39')]=_0x13ee91['attributes'][_0xa357('0x3b')]?_0x13ee91[_0xa357('0x39')]:_0x5a2b19[_0xa357('0x38')];if(!_0x4751ee[_0xa357('0x36')][_0xa357('0x3c')](_0xa357('0x3d'))){_0x13ee91['limit']=qs['limit'](_0x4751ee['query']['limit']);_0x13ee91[_0xa357('0x23')]=qs[_0xa357('0x23')](_0x4751ee[_0xa357('0x36')][_0xa357('0x23')]);}_0x13ee91['order']=qs[_0xa357('0x3e')](_0x4751ee[_0xa357('0x36')][_0xa357('0x3e')]);_0x13ee91[_0xa357('0x3f')]=qs['filters'](_[_0xa357('0x40')](_0x4751ee['query'],_0x5a2b19[_0xa357('0x41')]),_0x6e0d4c);if(_0x4751ee['query'][_0xa357('0x42')]){_0x13ee91[_0xa357('0x3f')]=_[_0xa357('0x43')](_0x13ee91[_0xa357('0x3f')],{'$or':_['map'](_0x6e0d4c,function(_0x3a7874){if(_0x3a7874['type']!==_0xa357('0x44')){var _0x35d17c={};_0x35d17c[_0x3a7874[_0xa357('0x30')]]={'$like':'%'+_0x4751ee['query'][_0xa357('0x42')]+'%'};return _0x35d17c;}})});}_0x13ee91=_[_0xa357('0x43')]({},_0x13ee91,_0x4751ee[_0xa357('0x45')]);var _0x3d2fd2={'where':_0x13ee91[_0xa357('0x3f')]};return db[_0xa357('0x46')][_0xa357('0x22')](_0x3d2fd2)[_0xa357('0x28')](function(_0x427aa6){_0x2da020[_0xa357('0x22')]=_0x427aa6;if(_0x4751ee[_0xa357('0x36')][_0xa357('0x47')]){_0x13ee91[_0xa357('0x48')]=[{'all':!![]}];}return db['Plugin'][_0xa357('0x49')](_0x13ee91);})[_0xa357('0x28')](function(_0x140c52){_0x2da020[_0xa357('0x4a')]=_0x140c52;return _0x2da020;})[_0xa357('0x28')](respondWithFilteredResult(_0x2c398b,_0x13ee91))[_0xa357('0x4b')](handleError(_0x2c398b,null));};exports[_0xa357('0x4c')]=function(_0x1ad1fc,_0x5c13f3){var _0x1c01de={'raw':!![],'where':{'id':_0x1ad1fc[_0xa357('0x4d')]['id']}},_0x211b3d={};_0x211b3d['model']=_[_0xa357('0x4e')](db[_0xa357('0x46')][_0xa357('0x32')]);_0x211b3d['query']=_['keys'](_0x1ad1fc['query']);_0x211b3d[_0xa357('0x41')]=_[_0xa357('0x37')](_0x211b3d[_0xa357('0x38')],_0x211b3d[_0xa357('0x36')]);_0x1c01de['attributes']=_[_0xa357('0x37')](_0x211b3d[_0xa357('0x38')],qs['fields'](_0x1ad1fc[_0xa357('0x36')]['fields']));_0x1c01de[_0xa357('0x39')]=_0x1c01de['attributes'][_0xa357('0x3b')]?_0x1c01de['attributes']:_0x211b3d[_0xa357('0x38')];if(_0x1ad1fc[_0xa357('0x36')]['includeAll']){_0x1c01de[_0xa357('0x48')]=[{'all':!![]}];}_0x1c01de=_[_0xa357('0x43')]({},_0x1c01de,_0x1ad1fc[_0xa357('0x45')]);return db[_0xa357('0x46')][_0xa357('0x4f')](_0x1c01de)['then'](handleEntityNotFound(_0x5c13f3,null))['then'](respondWithResult(_0x5c13f3,null))[_0xa357('0x4b')](handleError(_0x5c13f3,null));};exports[_0xa357('0x50')]=function(_0x31f65b,_0x3574a6,_0x3ea7e2){return db['Plugin'][_0xa357('0x4f')]({'where':{'id':_0x31f65b['params']['id']},'attributes':['name',_0xa357('0x5')],'raw':!![]})[_0xa357('0x28')](handleEntityNotFound(_0x3574a6,null))[_0xa357('0x28')](function(_0x10455e){if(_0x10455e){var _0x432260=path[_0xa357('0x51')](config[_0xa357('0x52')],'server/files/plugins',util['format'](_0xa357('0x53'),path[_0xa357('0x54')](_0x10455e[_0xa357('0x5')])));var _0x307b05=fs['createWriteStream'](_0x432260);var _0x5e7596=archiver(_0xa357('0x55'),{'zlib':{'level':0x9}});_0x5e7596['on']('warning',function(_0x2d018e){if(_0x2d018e[_0xa357('0x56')]==='ENOENT'){logger[_0xa357('0x2e')](_0x2d018e);}else{throw new db[(_0xa357('0x57'))][(_0xa357('0x58'))](_0xa357('0x59'));}});_0x5e7596['on'](_0xa357('0x2e'),function(_0x4b5953){throw new db[(_0xa357('0x57'))][(_0xa357('0x58'))](_0xa357('0x59'));});_0x5e7596[_0xa357('0x5a')](_0x307b05);_0x5e7596[_0xa357('0x5b')]('**/*',{'cwd':path[_0xa357('0x51')](config[_0xa357('0x52')],_0xa357('0x5c'),path[_0xa357('0x5d')](_0x10455e[_0xa357('0x5')])),'ignore':[path[_0xa357('0x51')](path[_0xa357('0x54')](_0x10455e[_0xa357('0x5')]),_0xa357('0x5e')),path[_0xa357('0x51')](path[_0xa357('0x54')](_0x10455e[_0xa357('0x5')]),_0xa357('0x5f'))],'nodir':!![]})[_0xa357('0x60')]();_0x307b05['on'](_0xa357('0x61'),function(){if(!fs['existsSync'](_0x432260)){throw new db[(_0xa357('0x57'))]['Error'](_0xa357('0x62'));}return _0x3574a6[_0xa357('0x50')](_0x432260,util[_0xa357('0x63')](_0xa357('0x53'),path[_0xa357('0x54')](_0x10455e[_0xa357('0x5')])),function(_0x14a696){if(_0x14a696){throw new db['Sequelize'][(_0xa357('0x58'))](_0xa357('0x64'));}fs[_0xa357('0x65')](_0x432260);logger[_0xa357('0x66')]('Download\x20completed');logger['info'](_0xa357('0x67'));});});}return null;})[_0xa357('0x4b')](handleError(_0x3574a6,null));};exports[_0xa357('0x68')]=function(_0x4ef075,_0x336e09,_0x324673){var _0x4029cc=path[_0xa357('0x54')](_0x4ef075[_0xa357('0x69')]['filename'],path[_0xa357('0x6a')](_0x4ef075['file'][_0xa357('0x6b')]));var _0x39da0a=path[_0xa357('0x51')](config[_0xa357('0x52')],_0xa357('0x5c'),_0x4ef075[_0xa357('0x69')][_0xa357('0x6b')]);var _0x6a245=path[_0xa357('0x51')](config[_0xa357('0x52')],_0xa357('0x5c'),_0x4029cc);logger[_0xa357('0x66')](_0xa357('0x6c'),_0x39da0a);logger[_0xa357('0x66')](_0xa357('0x6d'),_0x6a245);try{fs[_0xa357('0x6e')](_0x39da0a,parseInt('0777',0x8));extract(_0x39da0a,{'dir':_0x6a245},function(_0x22941a){if(_0x22941a){logger[_0xa357('0x2e')](_0x22941a);handleError(_0x22941a,!![]);};var _0x4dee88=fs[_0xa357('0x6f')](_0x6a245);if(_0x4dee88[_0xa357('0x3b')]>0x1){removeReferences(_0x39da0a,_0x6a245);logger[_0xa357('0x2e')]('Invalid\x20plugin\x20structure');return _0x324673(new Error(_0xa357('0x70')));}var _0x3cea87=fs[_0xa357('0x71')](path[_0xa357('0x51')](_0x6a245,_0x4dee88[0x0]));if(_0x3cea87[_0xa357('0x72')]()){removeReferences(_0x39da0a,_0x6a245);logger[_0xa357('0x2e')](_0xa357('0x70'));return _0x324673(new Error(_0xa357('0x70')));}if(_0x3cea87[_0xa357('0x73')]()){var _0x2665b3=fs[_0xa357('0x6f')](path[_0xa357('0x51')](_0x6a245,_0x4dee88[0x0]));if(_0x2665b3['length']===0x0){removeReferences(_0x39da0a,_0x6a245);logger['error'](_0xa357('0x70'));return _0x324673(new Error(_0xa357('0x70')));}var _0x19b117=_0x2665b3['some'](function(_0xf99ce3){return _0xf99ce3===_0xa357('0x74');});if(!_0x19b117){return _0x324673(new Error(_0xa357('0x75')));}var _0x290aee=fs['readFileSync'](path[_0xa357('0x51')](_0x6a245,_0x4dee88[0x0],_0xa357('0x74')));var _0x12df05=JSON[_0xa357('0x76')](_0x290aee);if('undefined'==typeof _0x12df05[_0xa357('0x30')]){return _0x324673(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x12df05[_0xa357('0x77')]){return _0x324673(new Error(_0xa357('0x78')));}if(_0xa357('0x21')==typeof _0x12df05[_0xa357('0x79')]){return _0x324673(new Error(_0xa357('0x7a')));}if(_0xa357('0x21')==typeof _0x12df05['parameters']){return _0x324673(new Error(_0xa357('0x7b')));}if(_0x12df05[_0xa357('0x77')]===_0xa357('0x7c')){if(_0xa357('0x21')==typeof _0x12df05[_0xa357('0x7d')][_0xa357('0x7e')]){return _0x324673(new Error(_0xa357('0x7f')));}if(_0xa357('0x21')==typeof _0x12df05[_0xa357('0x7d')][_0xa357('0x7e')][_0xa357('0x80')]&&_0xa357('0x21')==typeof _0x12df05[_0xa357('0x7d')][_0xa357('0x7e')]['agent']){return _0x324673(new Error(_0xa357('0x81')));}}else if(_0x12df05['type']===_0xa357('0x82')){if(_0xa357('0x21')==typeof _0x12df05[_0xa357('0x7d')][_0xa357('0x83')]){return _0x324673(new Error(_0xa357('0x84')));}if(_0xa357('0x21')==typeof _0x12df05[_0xa357('0x7d')][_0xa357('0x85')]){return _0x324673(new Error(_0xa357('0x86')));}}else{return _0x324673(new Error(_0xa357('0x87')));}var _0x31765d=_0x12df05[_0xa357('0x30')];var _0x116015=_0x12df05[_0xa357('0x88')];var _0x9fe3a4=_0x12df05['type'];var _0x3ef0d7=_0x12df05['sidebar']?_0x12df05['sidebar']:'always';var _0x303a88=_0x12df05[_0xa357('0x89')]?_0x12df05['icon']:_0xa357('0x8a');var _0x3d0db9='';var _0x31700d='';var _0x1f1ac1='';var _0x4387b2='';var _0x4802df=_0x12df05[_0xa357('0x79')];if(_0x9fe3a4===_0xa357('0x7c')){if(_0xa357('0x21')!=typeof _0x12df05[_0xa357('0x7d')][_0xa357('0x7e')][_0xa357('0x80')]){var _0x304dde=_0x12df05['parameters'][_0xa357('0x7e')][_0xa357('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x304dde)){_0x3d0db9=path['join'](_0xa357('0x8b'),_0x4029cc,_0x4dee88[0x0],_0x304dde);}else{_0x3d0db9=_0x304dde;}}else{logger[_0xa357('0x66')](_0xa357('0x8c'));}if(_0xa357('0x21')!=typeof _0x12df05[_0xa357('0x7d')]['views'][_0xa357('0x8d')]){var _0x35daaf=_0x12df05[_0xa357('0x7d')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0xa357('0x8e')](_0x35daaf)){_0x31700d=path[_0xa357('0x51')](_0xa357('0x8b'),_0x4029cc,_0x4dee88[0x0],_0x35daaf);}else{_0x31700d=_0x35daaf;}}else{logger['info'](_0xa357('0x8f'));}}else if(_0x9fe3a4===_0xa357('0x82')){_0x1f1ac1=_0x12df05[_0xa357('0x7d')][_0xa357('0x83')];_0x4387b2=_0x12df05[_0xa357('0x7d')][_0xa357('0x85')];if(_0xa357('0x21')!=typeof _0x12df05[_0xa357('0x7d')]['views']){if(_0xa357('0x21')!=typeof _0x12df05[_0xa357('0x7d')]['views'][_0xa357('0x80')]){var _0x304dde=_0x12df05['parameters'][_0xa357('0x7e')][_0xa357('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xa357('0x8e')](_0x304dde)){_0x3d0db9=path['join'](_0xa357('0x8b'),_0x4029cc,_0x4dee88[0x0],_0x304dde);}else{_0x3d0db9=_0x304dde;}}if(_0xa357('0x21')!=typeof _0x12df05['parameters']['views']['agent']){var _0x35daaf=_0x12df05['parameters'][_0xa357('0x7e')][_0xa357('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xa357('0x8e')](_0x35daaf)){_0x31700d=path[_0xa357('0x51')](_0xa357('0x8b'),_0x4029cc,_0x4dee88[0x0],_0x35daaf);}else{_0x31700d=_0x35daaf;}}}}var _0x28ee8c={'name':_0x31765d,'description':_0x116015,'path':path['join'](_0x4029cc,_0x4dee88[0x0]),'type':_0x9fe3a4,'sidebar':_0x3ef0d7,'icon':_0x303a88,'adminUrl':_0x3d0db9,'agentUrl':_0x31700d,'scriptName':_0x1f1ac1,'scriptPath':_0x4387b2,'version':_0x4802df};removeReferences(_0x39da0a,null);return db['Plugin'][_0xa357('0x90')](_0x28ee8c)['then'](function(_0x16c6d2){var _0x3fa5c2={'role':_0x4ef075[_0xa357('0x91')]['role'],'userProfileId':_0x4ef075[_0xa357('0x91')]['userProfileId']};if(!_0x3fa5c2)throw new Error(_0xa357('0x92'));if(_0x3fa5c2[_0xa357('0x93')]===_0xa357('0x94')){var _0x5ad40a=_0x16c6d2[_0xa357('0x95')]({'plain':!![]});return db['UserProfileSection'][_0xa357('0x4f')]({'where':{'name':_0xa357('0x2a'),'userProfileId':_0x3fa5c2['userProfileId']},'raw':!![]})['then'](function(_0x1b1541){if(_0x1b1541&&_0x1b1541[_0xa357('0x96')]===0x0){return db[_0xa357('0x2b')][_0xa357('0x90')]({'name':_0x5ad40a[_0xa357('0x30')],'resourceId':_0x5ad40a['id'],'type':_0x1b1541[_0xa357('0x30')],'sectionId':_0x1b1541['id']},{})[_0xa357('0x28')](function(){return _0x16c6d2;});}else{return _0x16c6d2;}})[_0xa357('0x4b')](function(_0x29bc4e){logger[_0xa357('0x2e')](_0xa357('0x97'),_0x29bc4e);throw _0x29bc4e;});}return _0x16c6d2;})[_0xa357('0x28')](respondWithResult(_0x336e09,null))[_0xa357('0x4b')](handleError(_0x336e09,null));}});}catch(_0x4bdbd1){_0x336e09[_0xa357('0x1f')](0x1f4)[_0xa357('0x31')](_0x4bdbd1);}};function removeReferences(_0x4dcdd3,_0x508759){try{if(_0x4dcdd3){fs['unlinkSync'](_0x4dcdd3);logger[_0xa357('0x66')](_0xa357('0x98'));}if(_0x508759){rimraf(_0x508759,function(){});logger[_0xa357('0x66')](_0xa357('0x99'));}}catch(_0x18efe3){logger[_0xa357('0x2e')](_0x18efe3);}}exports[_0xa357('0x9a')]=function(_0x98831a,_0x4d503c,_0x33355c){return db['Plugin'][_0xa357('0x4f')]({'where':{'id':_0x98831a[_0xa357('0x4d')]['id']}})[_0xa357('0x28')](handleEntityNotFound(_0x4d503c,null))['then'](saveUpdates(_0x98831a[_0xa357('0x91')],null))[_0xa357('0x28')](respondWithResult(_0x4d503c,null))[_0xa357('0x4b')](handleError(_0x4d503c,null));};exports[_0xa357('0x9b')]=function(_0x493009,_0x116daf,_0x4b87b5){return db[_0xa357('0x46')]['find']({'where':{'id':_0x493009[_0xa357('0x4d')]['id']}})[_0xa357('0x28')](function(_0x490886){if(_0x490886){return _0x490886[_0xa357('0x29')]();}})[_0xa357('0x28')](function(_0x5f7627){rimraf(path[_0xa357('0x51')](config['root'],_0xa357('0x5c'),path['dirname'](_0x5f7627['path'])),function(){});return _0x5f7627;})[_0xa357('0x28')](handleEntityNotFound(_0x116daf,null))[_0xa357('0x28')](respondWithStatusCode(_0x116daf,null))[_0xa357('0x4b')](handleError(_0x116daf,null));};exports[_0xa357('0x9c')]=function(_0xfbceb0,_0x1f5609,_0x238886){return BPromise[_0xa357('0x9d')]()[_0xa357('0x28')](function(){if(!_0xfbceb0[_0xa357('0x36')][_0xa357('0x5')]){throw new Error(_0xa357('0x9e'));}if(!_0xfbceb0['query'][_0xa357('0x9f')]){throw new Error(_0xa357('0xa0'));}var _0x4e9010=_0xfbceb0['query']['hostname']?_0xfbceb0[_0xa357('0x36')]['hostname']+':'+_0xfbceb0[_0xa357('0x36')][_0xa357('0x9f')]:'http://localhost:'+_0xfbceb0['query'][_0xa357('0x9f')];var _0x5baaae=_0xfbceb0['query'][_0xa357('0x26')]?_0xfbceb0[_0xa357('0x36')][_0xa357('0x26')]:!![];var _0x3090f3=_0xfbceb0[_0xa357('0x36')][_0xa357('0xa1')]?_0xfbceb0[_0xa357('0x36')][_0xa357('0xa1')]:null;var _0x2919b9={'method':_0xfbceb0['method'],'uri':util[_0xa357('0x63')]('%s%s',_0x4e9010,_0xfbceb0['query']['path']),'json':_0x5baaae,'resolveWithFullResponse':!![],'encoding':_0x3090f3,'qs':_0xfbceb0['query']};if(_0xfbceb0[_0xa357('0xa2')]){_0x2919b9[_0xa357('0xa2')]=_0xfbceb0[_0xa357('0xa2')];if(_0x2919b9[_0xa357('0xa2')][_0xa357('0xa3')]){delete _0x2919b9[_0xa357('0xa2')][_0xa357('0xa3')];}}if(_0x2919b9[_0xa357('0xa2')]['content-type']){delete _0x2919b9[_0xa357('0xa2')][_0xa357('0xa4')];}return rp(_0x2919b9);})[_0xa357('0x28')](function(_0x16aeb8){if(_0x16aeb8){_0x1f5609['set'](_0x16aeb8[_0xa357('0xa2')]);logger['info'](_0x16aeb8['body']);if(_[_0xa357('0xa5')](_0xfbceb0[_0xa357('0x36')][_0xa357('0x5')],_0xa357('0x50'))&&_0x16aeb8[_0xa357('0xa6')]==0x1f4){return _0x1f5609['sendStatus'](_0x16aeb8[_0xa357('0xa6')]);}else{return _0x1f5609[_0xa357('0x1f')](_0x16aeb8['statusCode'])[_0xa357('0x31')](_0x16aeb8[_0xa357('0x91')]);}}else{return _0x1f5609[_0xa357('0x2d')](0xc8);}})['catch'](handleError(_0x1f5609,null));};exports[_0xa357('0xa7')]=function(_0x3d41e4,_0x58ec55,_0x51de7a){return BPromise[_0xa357('0x9d')]()[_0xa357('0x28')](function(){if(!_0x3d41e4[_0xa357('0x36')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x3d41e4[_0xa357('0x36')]['port']){throw new Error(_0xa357('0xa0'));}var _0xa697c8=_0x3d41e4[_0xa357('0x36')][_0xa357('0xa8')]?_0x3d41e4[_0xa357('0x36')][_0xa357('0xa8')]+':'+_0x3d41e4[_0xa357('0x36')][_0xa357('0x9f')]:_0xa357('0xa9')+_0x3d41e4[_0xa357('0x36')][_0xa357('0x9f')];var _0x15403d=_0x3d41e4[_0xa357('0x36')]['json']?_0x3d41e4[_0xa357('0x36')][_0xa357('0x26')]:!![];var _0x37b2b9=_0x3d41e4[_0xa357('0x36')]['encoding']?_0x3d41e4['query'][_0xa357('0xa1')]:null;var _0xd3c342={'method':_0x3d41e4[_0xa357('0xaa')],'uri':util[_0xa357('0x63')](_0xa357('0xab'),_0xa697c8,_0x3d41e4[_0xa357('0x36')][_0xa357('0x5')]),'json':_0x15403d,'resolveWithFullResponse':!![],'encoding':_0x37b2b9,'body':_0x3d41e4[_0xa357('0x91')]};if(_0x3d41e4['headers']){_0xd3c342[_0xa357('0xa2')]=_0x3d41e4['headers'];if(_0xd3c342[_0xa357('0xa2')][_0xa357('0xa3')]){delete _0xd3c342[_0xa357('0xa2')]['content-length'];}}if(_0xd3c342['headers'][_0xa357('0xa4')]){delete _0xd3c342[_0xa357('0xa2')][_0xa357('0xa4')];}return rp(_0xd3c342);})[_0xa357('0x28')](function(_0x1b4357){if(_0x1b4357){_0x58ec55[_0xa357('0x24')](_0x1b4357[_0xa357('0xa2')]);logger['info'](_0x1b4357['body']);return _0x58ec55[_0xa357('0x1f')](_0x1b4357[_0xa357('0xa6')])[_0xa357('0x31')](_0x1b4357[_0xa357('0x91')]);}else{return _0x58ec55[_0xa357('0x2d')](0xc8);}})[_0xa357('0x4b')](handleError(_0x58ec55,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 7259073..b30289b 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 _0xecb2=['exports','events','setMaxListeners','remove','emit'];(function(_0x2d2793,_0x295ee3){var _0x21c1a8=function(_0x1377dc){while(--_0x1377dc){_0x2d2793['push'](_0x2d2793['shift']());}};_0x21c1a8(++_0x295ee3);}(_0xecb2,0xf6));var _0x2ecb=function(_0x29ecc0,_0x191222){_0x29ecc0=_0x29ecc0-0x0;var _0x17d553=_0xecb2[_0x29ecc0];return _0x17d553;};'use strict';var EventEmitter=require(_0x2ecb('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x2ecb('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2ecb('0x2')};function emitEvent(_0x2f3639){return function(_0x393e7c,_0x2a4fe5,_0x1d007c){PluginEvents[_0x2ecb('0x3')](_0x2f3639+':'+_0x393e7c['id'],_0x393e7c);PluginEvents['emit'](_0x2f3639,_0x393e7c);_0x1d007c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x2ecb('0x4')]=PluginEvents; \ No newline at end of file +var _0x022a=['hasOwnProperty','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit'];(function(_0x53945a,_0xbcedf3){var _0x21f8e1=function(_0x25ff60){while(--_0x25ff60){_0x53945a['push'](_0x53945a['shift']());}};_0x21f8e1(++_0xbcedf3);}(_0x022a,0x1f0));var _0xa022=function(_0x12d121,_0x1ef59d){_0x12d121=_0x12d121-0x0;var _0x1af836=_0x022a[_0x12d121];return _0x1af836;};'use strict';var EventEmitter=require(_0xa022('0x0'));var Plugin=require(_0xa022('0x1'))['db'][_0xa022('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xa022('0x3')](0x0);var events={'afterCreate':_0xa022('0x4'),'afterUpdate':_0xa022('0x5'),'afterDestroy':_0xa022('0x6')};function emitEvent(_0x23dd57){return function(_0x16516a,_0x233c8d,_0x395b24){PluginEvents[_0xa022('0x7')](_0x23dd57+':'+_0x16516a['id'],_0x16516a);PluginEvents['emit'](_0x23dd57,_0x16516a);_0x395b24(null);};}for(var e in events){if(events[_0xa022('0x8')](e)){var event=events[e];Plugin['hook'](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 c4b2d77..45b323a 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 _0x3e06=['define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./plugin.attributes','exports'];(function(_0x5071c0,_0x29a4bf){var _0x2c5d5d=function(_0x45dde1){while(--_0x45dde1){_0x5071c0['push'](_0x5071c0['shift']());}};_0x2c5d5d(++_0x29a4bf);}(_0x3e06,0x153));var _0x63e0=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3e06[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x63e0('0x0'));var util=require(_0x63e0('0x1'));var logger=require(_0x63e0('0x2'))(_0x63e0('0x3'));var moment=require(_0x63e0('0x4'));var BPromise=require(_0x63e0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63e0('0x6'));var rimraf=require(_0x63e0('0x7'));var config=require(_0x63e0('0x8'));var attributes=require(_0x63e0('0x9'));module[_0x63e0('0xa')]=function(_0x562ed8,_0x2630e0){return _0x562ed8[_0x63e0('0xb')](_0x63e0('0xc'),attributes,{'tableName':_0x63e0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0e1=['./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b496f,_0x1682d4){var _0x4fab34=function(_0x12c608){while(--_0x12c608){_0x2b496f['push'](_0x2b496f['shift']());}};_0x4fab34(++_0x1682d4);}(_0xc0e1,0x147));var _0x1c0e=function(_0x3cf4d3,_0x48065e){_0x3cf4d3=_0x3cf4d3-0x0;var _0x4e547b=_0xc0e1[_0x3cf4d3];return _0x4e547b;};'use strict';var _=require(_0x1c0e('0x0'));var util=require(_0x1c0e('0x1'));var logger=require(_0x1c0e('0x2'))('api');var moment=require(_0x1c0e('0x3'));var BPromise=require(_0x1c0e('0x4'));var rp=require(_0x1c0e('0x5'));var fs=require('fs');var path=require(_0x1c0e('0x6'));var rimraf=require(_0x1c0e('0x7'));var config=require(_0x1c0e('0x8'));var attributes=require(_0x1c0e('0x9'));module[_0x1c0e('0xa')]=function(_0xa392c3,_0xd121a0){return _0xa392c3[_0x1c0e('0xb')](_0x1c0e('0xc'),attributes,{'tableName':_0x1c0e('0xd'),'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 d8c8ce5..a728994 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 _0x969e=['lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreatePlugin','Plugin','body','raw','then'];(function(_0x5a3273,_0x2092ef){var _0x2a0a17=function(_0x238c66){while(--_0x238c66){_0x5a3273['push'](_0x5a3273['shift']());}};_0x2a0a17(++_0x2092ef);}(_0x969e,0x136));var _0xe969=function(_0x4baa7d,_0x5382e7){_0x4baa7d=_0x4baa7d-0x0;var _0x5353ef=_0x969e[_0x4baa7d];return _0x5353ef;};'use strict';var _=require(_0xe969('0x0'));var util=require(_0xe969('0x1'));var moment=require('moment');var BPromise=require(_0xe969('0x2'));var rs=require(_0xe969('0x3'));var fs=require('fs');var Redis=require(_0xe969('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe969('0x5'));var config=require(_0xe969('0x6'));var jayson=require(_0xe969('0x7'));var client=jayson[_0xe969('0x8')]['http']({'port':0x232a});config[_0xe969('0x9')]=_[_0xe969('0xa')](config[_0xe969('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe969('0xb'))(new Redis(config['redis']));require(_0xe969('0xc'))[_0xe969('0xd')](socket);function respondWithRpcPromise(_0x5d9841,_0x431f1c,_0x4ced4b){return new BPromise(function(_0x32d427,_0x2991d6){return client[_0xe969('0xe')](_0x5d9841,_0x4ced4b)['then'](function(_0x80b852){logger[_0xe969('0xf')](_0xe969('0x10'),_0x431f1c,_0xe969('0x11'));logger[_0xe969('0x12')](_0xe969('0x13'),_0x431f1c,'request\x20sent',JSON[_0xe969('0x14')](_0x80b852));if(_0x80b852['error']){if(_0x80b852['error'][_0xe969('0x15')]===0x1f4){logger[_0xe969('0x16')](_0xe969('0x10'),_0x431f1c,_0x80b852[_0xe969('0x16')]['message']);return _0x2991d6(_0x80b852[_0xe969('0x16')][_0xe969('0x17')]);}logger[_0xe969('0x16')](_0xe969('0x10'),_0x431f1c,_0x80b852[_0xe969('0x16')][_0xe969('0x17')]);return _0x32d427(_0x80b852['error']['message']);}else{logger[_0xe969('0xf')](_0xe969('0x10'),_0x431f1c,_0xe969('0x11'));_0x32d427(_0x80b852[_0xe969('0x18')][_0xe969('0x17')]);}})[_0xe969('0x19')](function(_0x5aa68c){logger['error'](_0xe969('0x10'),_0x431f1c,_0x5aa68c);_0x2991d6(_0x5aa68c);});});}exports[_0xe969('0x1a')]=function(_0x295b44){var _0x5dd070=this;return new Promise(function(_0x1f6e31,_0x524542){return db[_0xe969('0x1b')]['create'](_0x295b44[_0xe969('0x1c')],{'raw':_0x295b44['options']?_0x295b44['options'][_0xe969('0x1d')]===undefined?!![]:![]:!![]})[_0xe969('0x1e')](function(_0x58da99){logger[_0xe969('0xf')](_0xe969('0x1a'),_0x295b44);logger[_0xe969('0x12')](_0xe969('0x1a'),_0x295b44,JSON[_0xe969('0x14')](_0x58da99));_0x1f6e31(_0x58da99);})[_0xe969('0x19')](function(_0x3d1358){logger[_0xe969('0x16')](_0xe969('0x1a'),_0x3d1358[_0xe969('0x17')],_0x295b44);_0x524542(_0x5dd070['error'](0x1f4,_0x3d1358['message']));});});}; \ No newline at end of file +var _0xe516=['catch','CreatePlugin','Plugin','create','body','options','raw','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe516,0x17a));var _0x6e51=function(_0x39f9f2,_0x37fc06){_0x39f9f2=_0x39f9f2-0x0;var _0x3febf8=_0xe516[_0x39f9f2];return _0x3febf8;};'use strict';var _=require(_0x6e51('0x0'));var util=require(_0x6e51('0x1'));var moment=require(_0x6e51('0x2'));var BPromise=require(_0x6e51('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e51('0x4'));var db=require(_0x6e51('0x5'))['db'];var utils=require(_0x6e51('0x6'));var logger=require(_0x6e51('0x7'))(_0x6e51('0x8'));var config=require(_0x6e51('0x9'));var jayson=require(_0x6e51('0xa'));var client=jayson[_0x6e51('0xb')][_0x6e51('0xc')]({'port':0x232a});config[_0x6e51('0xd')]=_[_0x6e51('0xe')](config[_0x6e51('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6e51('0xf'))(new Redis(config[_0x6e51('0xd')]));require(_0x6e51('0x10'))[_0x6e51('0x11')](socket);function respondWithRpcPromise(_0x29387e,_0x5f4373,_0x537ec0){return new BPromise(function(_0x3c8cf1,_0x46ac5c){return client[_0x6e51('0x12')](_0x29387e,_0x537ec0)[_0x6e51('0x13')](function(_0x178ac9){logger[_0x6e51('0x14')](_0x6e51('0x15'),_0x5f4373,_0x6e51('0x16'));logger['debug'](_0x6e51('0x17'),_0x5f4373,_0x6e51('0x16'),JSON[_0x6e51('0x18')](_0x178ac9));if(_0x178ac9[_0x6e51('0x19')]){if(_0x178ac9[_0x6e51('0x19')][_0x6e51('0x1a')]===0x1f4){logger[_0x6e51('0x19')](_0x6e51('0x15'),_0x5f4373,_0x178ac9['error'][_0x6e51('0x1b')]);return _0x46ac5c(_0x178ac9[_0x6e51('0x19')][_0x6e51('0x1b')]);}logger[_0x6e51('0x19')]('Plugin,\x20%s,\x20%s',_0x5f4373,_0x178ac9['error'][_0x6e51('0x1b')]);return _0x3c8cf1(_0x178ac9[_0x6e51('0x19')]['message']);}else{logger['info'](_0x6e51('0x15'),_0x5f4373,_0x6e51('0x16'));_0x3c8cf1(_0x178ac9[_0x6e51('0x1c')][_0x6e51('0x1b')]);}})[_0x6e51('0x1d')](function(_0x21578a){logger[_0x6e51('0x19')](_0x6e51('0x15'),_0x5f4373,_0x21578a);_0x46ac5c(_0x21578a);});});}exports[_0x6e51('0x1e')]=function(_0x36f4ef){var _0x5cd74f=this;return new Promise(function(_0x5cdc4d,_0x35cfcb){return db[_0x6e51('0x1f')][_0x6e51('0x20')](_0x36f4ef[_0x6e51('0x21')],{'raw':_0x36f4ef[_0x6e51('0x22')]?_0x36f4ef[_0x6e51('0x22')][_0x6e51('0x23')]===undefined?!![]:![]:!![]})[_0x6e51('0x13')](function(_0x4b8f9f){logger['info'](_0x6e51('0x1e'),_0x36f4ef);logger[_0x6e51('0x24')](_0x6e51('0x1e'),_0x36f4ef,JSON[_0x6e51('0x18')](_0x4b8f9f));_0x5cdc4d(_0x4b8f9f);})['catch'](function(_0x39e892){logger['error'](_0x6e51('0x1e'),_0x39e892[_0x6e51('0x1b')],_0x36f4ef);_0x35cfcb(_0x5cd74f[_0x6e51('0x19')](0x1f4,_0x39e892[_0x6e51('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index cad1687..e80ac1a 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 _0x5d41=['./plugin.events','save','remove','update','emit','removeListener','register','plugin:'];(function(_0x521863,_0x52bb0f){var _0x3f0072=function(_0x1763b4){while(--_0x1763b4){_0x521863['push'](_0x521863['shift']());}};_0x3f0072(++_0x52bb0f);}(_0x5d41,0x150));var _0x15d4=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x5d41[_0x30faec];return _0x29484f;};'use strict';var PluginEvents=require(_0x15d4('0x0'));var events=[_0x15d4('0x1'),_0x15d4('0x2'),_0x15d4('0x3')];function createListener(_0x4c8a9c,_0x530d39){return function(_0x4d596b){_0x530d39[_0x15d4('0x4')](_0x4c8a9c,_0x4d596b);};}function removeListener(_0x4cda9c,_0x535f91){return function(){PluginEvents[_0x15d4('0x5')](_0x4cda9c,_0x535f91);};}exports[_0x15d4('0x6')]=function(_0x31a994){for(var _0x49a5e2=0x0,_0xe9adcf=events['length'];_0x49a5e2<_0xe9adcf;_0x49a5e2++){var _0x25f0fa=events[_0x49a5e2];var _0x534b7f=createListener(_0x15d4('0x7')+_0x25f0fa,_0x31a994);PluginEvents['on'](_0x25f0fa,_0x534b7f);}}; \ No newline at end of file +var _0x191d=['register','plugin:','./plugin.events','save','remove','update','emit','removeListener'];(function(_0x33c979,_0x228c90){var _0x9ef6=function(_0x2189e5){while(--_0x2189e5){_0x33c979['push'](_0x33c979['shift']());}};_0x9ef6(++_0x228c90);}(_0x191d,0x15a));var _0xd191=function(_0x3a5413,_0x203d1c){_0x3a5413=_0x3a5413-0x0;var _0x2fad3a=_0x191d[_0x3a5413];return _0x2fad3a;};'use strict';var PluginEvents=require(_0xd191('0x0'));var events=[_0xd191('0x1'),_0xd191('0x2'),_0xd191('0x3')];function createListener(_0x48912a,_0x268a7b){return function(_0x52a810){_0x268a7b[_0xd191('0x4')](_0x48912a,_0x52a810);};}function removeListener(_0xa00889,_0x36c3de){return function(){PluginEvents[_0xd191('0x5')](_0xa00889,_0x36c3de);};}exports[_0xd191('0x6')]=function(_0xf29640){for(var _0x1793da=0x0,_0x32a203=events['length'];_0x1793da<_0x32a203;_0x1793da++){var _0x19865d=events[_0x1793da];var _0x2b29e6=createListener(_0xd191('0x7')+_0x19865d,_0xf29640);PluginEvents['on'](_0x19865d,_0x2b29e6);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index dc2f08a..8cef398 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(_0x4a008e,_0x2ffe82){var _0x16550e=function(_0x354027){while(--_0x354027){_0x4a008e['push'](_0x4a008e['shift']());}};_0x16550e(++_0x2ffe82);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0xc17317,_0x34b637){var _0x47fd11=function(_0x2c2412){while(--_0x2c2412){_0xc17317['push'](_0xc17317['shift']());}};_0x47fd11(++_0x34b637);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 326099e..599a9cc 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 _0x5db8=['Unknown\x20status','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','exec','sendStatus','status','json','error','name','send','info','index','list','then','reject','express','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update','restart','params'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0x5db8,0xbb));var _0x85db=function(_0x4a1ec0,_0x26287b){_0x4a1ec0=_0x4a1ec0-0x0;var _0x49ab91=_0x5db8[_0x4a1ec0];return _0x49ab91;};'use strict';var _=require(_0x85db('0x0'));var pm2=require(_0x85db('0x1'));var logger=require(_0x85db('0x2'))('api');var path=require(_0x85db('0x3'));var exec=require(_0x85db('0x4'))[_0x85db('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x5b7426,_0x13c216){return function(_0x1182c0){if(!_0x1182c0){_0x5b7426[_0x85db('0x6')](0x194);;}return _0x1182c0;};}function respondWithResult(_0x34d71f,_0x48bf16){_0x48bf16=_0x48bf16||0xc8;return function(_0x489b13){if(_0x489b13){return _0x34d71f[_0x85db('0x7')](_0x48bf16)[_0x85db('0x8')](_0x489b13);}return null;};}function handleError(_0xc6fd00,_0x308988){_0x308988=_0x308988||0x1f4;return function(_0x59a522){logger[_0x85db('0x9')](_0x59a522['stack']);if(_0x59a522[_0x85db('0xa')]){delete _0x59a522[_0x85db('0xa')];}_0xc6fd00[_0x85db('0x7')](_0x308988)[_0x85db('0xb')](_0x59a522);};}function execChildProcess(){return new BPromise(function(_0x5491fa,_0x54feb2){exec('npm\x20install',function(_0x14f838,_0x458b2b,_0x4de057){logger[_0x85db('0xc')](_0x458b2b);logger['info'](_0x4de057);if(_0x14f838){logger[_0x85db('0x9')](_0x14f838);return _0x54feb2(_0x14f838);}return _0x5491fa(_0x458b2b);});});}exports[_0x85db('0xd')]=function(_0x382c43,_0x216a41){return pm2[_0x85db('0xe')]()[_0x85db('0xf')](function(_0x2b7507){if(_0x2b7507){var _0x25ec64=_[_0x85db('0x10')](_0x2b7507,function(_0x415281){return _0x415281[_0x85db('0xa')]===_0x85db('0x11')||_0x415281[_0x85db('0xa')]==='motion2';});return{'rows':_0x25ec64,'count':_0x25ec64[_0x85db('0x12')]};}return null;})[_0x85db('0xf')](respondWithResult(_0x216a41,null))[_0x85db('0x13')](handleError(_0x216a41,null));};exports[_0x85db('0x14')]=function(_0x2ecd71,_0x396afa){return pm2[_0x85db('0x15')](_0x2ecd71['params']['id'])[_0x85db('0xf')](respondWithResult(_0x396afa,null))[_0x85db('0xf')](handleEntityNotFound(_0x396afa,null))[_0x85db('0x13')](handleError(_0x396afa,null));};exports[_0x85db('0x16')]=function(_0x4d976d,_0x2bc9a4){if(_0x4d976d[_0x85db('0x17')][_0x85db('0xa')]&&_0x4d976d[_0x85db('0x17')][_0x85db('0x18')]){var _0x5c37d7=path[_0x85db('0x19')](__dirname,_0x85db('0x1a'),_0x4d976d[_0x85db('0x17')][_0x85db('0x18')]);var _0x44c122=process[_0x85db('0x1b')]();process[_0x85db('0x1c')](path[_0x85db('0x1d')](_0x5c37d7));return execChildProcess()['then'](function(_0xfffea2){process[_0x85db('0x1c')](_0x44c122);return pm2[_0x85db('0x1e')]({'name':_0x4d976d[_0x85db('0x17')][_0x85db('0xa')],'script':_0x5c37d7});})[_0x85db('0xf')](function(_0x51c948){pm2[_0x85db('0x1f')]();return _0x51c948[0x0];})[_0x85db('0xf')](respondWithResult(_0x2bc9a4,0xc9))[_0x85db('0x13')](handleError(_0x2bc9a4,null));}else{return _0x2bc9a4['status'](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x85db('0x20')]=function(_0x105bb9,_0x33448e){if(_0x105bb9['body']['id']){delete _0x105bb9[_0x85db('0x17')]['id'];}var _0xc2abb8={'online':_0x85db('0x21'),'stopped':'stop'};if(_0xc2abb8['hasOwnProperty'](_0x105bb9[_0x85db('0x17')][_0x85db('0x7')])){return pm2[_0xc2abb8[_0x105bb9[_0x85db('0x17')][_0x85db('0x7')]]](_0x105bb9[_0x85db('0x22')]['id'])[_0x85db('0xf')](respondWithResult(_0x33448e,0xc8))[_0x85db('0x13')](handleError(_0x33448e,null));}else{return _0x33448e[_0x85db('0x7')](0x1f4)[_0x85db('0xb')]({'message':_0x85db('0x23')});}};exports['destroy']=function(_0x4a15b9,_0x13ad98){if(_0x4a15b9['body']['id']){delete _0x4a15b9[_0x85db('0x17')]['id'];}if(_0x4a15b9[_0x85db('0x22')]['id']){return pm2['delete'](_0x4a15b9[_0x85db('0x22')]['id'])[_0x85db('0xf')](function(_0x38369f){pm2[_0x85db('0x1f')]();return _0x38369f[0x0];})['then'](respondWithResult(_0x13ad98,null))[_0x85db('0x13')](handleError(_0x13ad98,null));}else{return _0x13ad98[_0x85db('0x7')](0x1f4)[_0x85db('0xb')]({'message':_0x85db('0x24')});}}; \ No newline at end of file +var _0x1be1=['stop','hasOwnProperty','status','destroy','delete','Unknown\x20id','../../config/logger','api','child_process','exec','bluebird','sendStatus','json','error','name','send','npm\x20install','info','index','express','motion2','length','then','catch','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update','restart'];(function(_0x22aaa2,_0x1034d7){var _0x364fe7=function(_0xf48c41){while(--_0xf48c41){_0x22aaa2['push'](_0x22aaa2['shift']());}};_0x364fe7(++_0x1034d7);}(_0x1be1,0x192));var _0x11be=function(_0x2024bf,_0x5e1f78){_0x2024bf=_0x2024bf-0x0;var _0x5ea24e=_0x1be1[_0x2024bf];return _0x5ea24e;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x11be('0x0'))(_0x11be('0x1'));var path=require('path');var exec=require(_0x11be('0x2'))[_0x11be('0x3')];var BPromise=require(_0x11be('0x4'));function handleEntityNotFound(_0x318d41,_0x504d3a){return function(_0x3ce56d){if(!_0x3ce56d){_0x318d41[_0x11be('0x5')](0x194);;}return _0x3ce56d;};}function respondWithResult(_0x11f793,_0x479719){_0x479719=_0x479719||0xc8;return function(_0xfe8c62){if(_0xfe8c62){return _0x11f793['status'](_0x479719)[_0x11be('0x6')](_0xfe8c62);}return null;};}function handleError(_0x11fc15,_0x246772){_0x246772=_0x246772||0x1f4;return function(_0x461e17){logger[_0x11be('0x7')](_0x461e17['stack']);if(_0x461e17[_0x11be('0x8')]){delete _0x461e17[_0x11be('0x8')];}_0x11fc15['status'](_0x246772)[_0x11be('0x9')](_0x461e17);};}function execChildProcess(){return new BPromise(function(_0x2cd786,_0x40f0d1){exec(_0x11be('0xa'),function(_0x4e013c,_0x447e88,_0xcb8120){logger[_0x11be('0xb')](_0x447e88);logger['info'](_0xcb8120);if(_0x4e013c){logger[_0x11be('0x7')](_0x4e013c);return _0x40f0d1(_0x4e013c);}return _0x2cd786(_0x447e88);});});}exports[_0x11be('0xc')]=function(_0x4ce3ae,_0x44eff2){return pm2['list']()['then'](function(_0x569842){if(_0x569842){var _0x4b6e7e=_['reject'](_0x569842,function(_0x5aa444){return _0x5aa444['name']===_0x11be('0xd')||_0x5aa444['name']===_0x11be('0xe');});return{'rows':_0x4b6e7e,'count':_0x4b6e7e[_0x11be('0xf')]};}return null;})[_0x11be('0x10')](respondWithResult(_0x44eff2,null))[_0x11be('0x11')](handleError(_0x44eff2,null));};exports['show']=function(_0x2ed725,_0x403d7a){return pm2['describe'](_0x2ed725[_0x11be('0x12')]['id'])[_0x11be('0x10')](respondWithResult(_0x403d7a,null))[_0x11be('0x10')](handleEntityNotFound(_0x403d7a,null))['catch'](handleError(_0x403d7a,null));};exports['create']=function(_0x141391,_0x976e51){if(_0x141391[_0x11be('0x13')][_0x11be('0x8')]&&_0x141391['body'][_0x11be('0x14')]){var _0x45136f=path[_0x11be('0x15')](__dirname,_0x11be('0x16'),_0x141391[_0x11be('0x13')][_0x11be('0x14')]);var _0xa944ac=process[_0x11be('0x17')]();process[_0x11be('0x18')](path[_0x11be('0x19')](_0x45136f));return execChildProcess()['then'](function(_0xfe3737){process[_0x11be('0x18')](_0xa944ac);return pm2[_0x11be('0x1a')]({'name':_0x141391['body']['name'],'script':_0x45136f});})[_0x11be('0x10')](function(_0x10ce04){pm2[_0x11be('0x1b')]();return _0x10ce04[0x0];})['then'](respondWithResult(_0x976e51,0xc9))[_0x11be('0x11')](handleError(_0x976e51,null));}else{return _0x976e51['status'](0x1f4)[_0x11be('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x11be('0x1c')]=function(_0xb11f3d,_0x5002d7){if(_0xb11f3d[_0x11be('0x13')]['id']){delete _0xb11f3d[_0x11be('0x13')]['id'];}var _0x1d3b5c={'online':_0x11be('0x1d'),'stopped':_0x11be('0x1e')};if(_0x1d3b5c[_0x11be('0x1f')](_0xb11f3d[_0x11be('0x13')][_0x11be('0x20')])){return pm2[_0x1d3b5c[_0xb11f3d[_0x11be('0x13')]['status']]](_0xb11f3d[_0x11be('0x12')]['id'])['then'](respondWithResult(_0x5002d7,0xc8))[_0x11be('0x11')](handleError(_0x5002d7,null));}else{return _0x5002d7[_0x11be('0x20')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0x11be('0x21')]=function(_0x265fc9,_0x5e8f9a){if(_0x265fc9[_0x11be('0x13')]['id']){delete _0x265fc9[_0x11be('0x13')]['id'];}if(_0x265fc9[_0x11be('0x12')]['id']){return pm2[_0x11be('0x22')](_0x265fc9[_0x11be('0x12')]['id'])[_0x11be('0x10')](function(_0x4b527e){pm2[_0x11be('0x1b')]();return _0x4b527e[0x0];})[_0x11be('0x10')](respondWithResult(_0x5e8f9a,null))[_0x11be('0x11')](handleError(_0x5e8f9a,null));}else{return _0x5e8f9a[_0x11be('0x20')](0x1f4)[_0x11be('0x9')]({'message':_0x11be('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index fb5ed16..4291657 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 _0x3335=['getAgents','/queues','getQueues','Router','get','/agents'];(function(_0x40f99e,_0x4c3287){var _0x1f85ae=function(_0x4f835c){while(--_0x4f835c){_0x40f99e['push'](_0x40f99e['shift']());}};_0x1f85ae(++_0x4c3287);}(_0x3335,0x10b));var _0x5333=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x3335[_0x3de8a4];return _0x4635cf;};'use strict';var express=require('express');var router=express[_0x5333('0x0')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0x5333('0x1')](_0x5333('0x2'),auth['isAuthenticated'](),controller[_0x5333('0x3')]);router[_0x5333('0x1')](_0x5333('0x4'),auth['isAuthenticated'](),controller[_0x5333('0x5')]);module['exports']=router; \ No newline at end of file +var _0xbfde=['getQueues','exports','Router','./realtime.controller','/agents','isAuthenticated','getAgents','get','/queues'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xbfde,0x1c4));var _0xebfd=function(_0x362b3f,_0x2edbdb){_0x362b3f=_0x362b3f-0x0;var _0x111108=_0xbfde[_0x362b3f];return _0x111108;};'use strict';var express=require('express');var router=express[_0xebfd('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xebfd('0x1'));router['get'](_0xebfd('0x2'),auth[_0xebfd('0x3')](),controller[_0xebfd('0x4')]);router[_0xebfd('0x5')](_0xebfd('0x6'),auth[_0xebfd('0x3')](),controller[_0xebfd('0x7')]);module[_0xebfd('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 371400a..924ffda 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 _0xa9e0=['pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','push','literal','FIELD(id,','forEach','*pause','Pause','merge','user','userProfileId','Agents','extraQueryConditions','assign','getResources','findAndCountAll','filterAgentAttributes','voice','talking','voiceStatus','Status','sortAgentsByStatus','pick','catch','getQueues','startCase','Queue','name','outbound','Queues','filter','UserProfile','lodash','util','../../components/realtime/agents','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter'];(function(_0x3f111a,_0x1d3d7e){var _0x3be0e7=function(_0x1a0a5d){while(--_0x1a0a5d){_0x3f111a['push'](_0x3f111a['shift']());}};_0x3be0e7(++_0x1d3d7e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var rta=require(_0x0a9e('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var APIHandleError=require(_0x0a9e('0x4'))[_0x0a9e('0x6')];function respondWithFilteredResult(_0x981158,_0x57b080){return function(_0x219af0){if(_0x219af0){var _0x441e3a=typeof _0x57b080[_0x0a9e('0x7')]==='undefined'&&typeof _0x57b080['limit']===_0x0a9e('0x8');var _0x56465b=_0x219af0['count'];var _0x39753a=_0x441e3a?0x0:_0x57b080[_0x0a9e('0x7')];var _0x307b3e=_0x441e3a?_0x219af0[_0x0a9e('0x9')]:_0x57b080[_0x0a9e('0x7')]+_0x57b080[_0x0a9e('0xa')];var _0x4a4c56;if(_0x307b3e>=_0x56465b){_0x307b3e=_0x56465b;_0x4a4c56=0xc8;}else{_0x4a4c56=0xce;}_0x981158['status'](_0x4a4c56);return _0x981158['set']('Content-Range',_0x39753a+'-'+_0x307b3e+'/'+_0x56465b)[_0x0a9e('0xb')](_0x219af0);}return null;};}exports[_0x0a9e('0xc')]=function(_0xd5b662,_0x26d672){var _0x32d742={'count':0x0,'rows':[]};var _0x69aeb7={};var _0x5db4b0;var _0x4283ce=utils[_0x0a9e('0xd')]();var _0x2b4227;var _0x281129;var _0x44dcfd=_0xd5b662[_0x0a9e('0xe')]['globalQueueFilter'];var _0x22dccb=_0xd5b662['query'][_0x0a9e('0xf')];var _0x519dfd=_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x10')];var _0x48f32d=_0x22dccb===_0x0a9e('0x11')||_0x22dccb==='*pause'?!![]:![];var _0x459eb1=[];var _0x478723;var _0x106033;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util[_0x0a9e('0x16')](_0x0a9e('0x17'),_0xd5b662['query'][_0x0a9e('0x14')]));}_0x5db4b0=_0xd5b662[_0x0a9e('0xe')]['channel'][_0x0a9e('0x18')]();}if(!_0xd5b662['query']['sort']||!_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')][_0x0a9e('0x1a')](_0x0a9e('0x1b'))){_0xd5b662['query'][_0x0a9e('0x19')]=rta[_0x0a9e('0x1c')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')]);return;}var _0x370d86=rta[_0x0a9e('0x1d')](_0xd5b662[_0x0a9e('0xe')]['sort']);_0xd5b662['query'][_0x0a9e('0x19')]=_0x370d86[_0x0a9e('0x1e')][_0x0a9e('0x1f')](',');_0x478723=_0x370d86[_0x0a9e('0x20')];})['then'](function(){if(!_0x44dcfd){return[];}return rta[_0x0a9e('0x21')](_0x44dcfd,_0x5db4b0);})['then'](function(_0x45a1e7){_0x459eb1=_0x45a1e7;return rta['getRealtimeAgents']();})[_0x0a9e('0x13')](function(_0x34dc65){_0x281129=_0x34dc65[_0x0a9e('0x22')];if((!_0x22dccb||_0x48f32d)&&!_0x478723){return _0x459eb1;}if(_0x478723&&!_0x22dccb){return rta[_0x0a9e('0x23')](_0x281129,_0x459eb1,_0x478723);}else{return rta[_0x0a9e('0x24')](_0x281129,_0x459eb1,_0x22dccb);}})[_0x0a9e('0x13')](function(_0x11c3b6){_0x459eb1=_0x11c3b6;var _0x14de77=![];if(_0x459eb1['length']===0x0){if(_0x44dcfd||_0x22dccb){_0x14de77=!![];}if(_0x48f32d){_0x14de77=![];}}if(_0x14de77){return _0x32d742;}var _0x3652a7=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x28')],'type':_0x5c877d[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x2b')]=_0x0a9e('0x2c');_0x69aeb7=qs[_0x0a9e('0x2d')](_0x3652a7,_0xd5b662);_0x69aeb7[_0x0a9e('0x2e')]=!![];var _0x1dbde2=[];if(_0x459eb1['length']>0x0){_0x1dbde2[_0x0a9e('0x2f')]({'id':{'$in':_0x459eb1}});if(_0x478723&&!_0x22dccb){_0x106033=[db['sequelize'][_0x0a9e('0x30')](_0x0a9e('0x31')+_0x459eb1+')')];_0x69aeb7[_0x0a9e('0x20')]=_0x106033;}}if(_0x48f32d){_0x4283ce[_0x0a9e('0x32')](function(_0x25ce3a){var _0x5180f1=!![];if(_0x22dccb===_0x0a9e('0x33')&&_0x5db4b0!==_0x25ce3a){_0x5180f1=![];}_0x1dbde2[_0x0a9e('0x2f')]({[_0x25ce3a+_0x0a9e('0x34')]:_0x5180f1});});if(_0x519dfd){_0x1dbde2[_0x0a9e('0x2f')]({'pauseType':_0x519dfd});}}else if(_0x22dccb){_0x4283ce[_0x0a9e('0x32')](function(_0x409319){_0x1dbde2[_0x0a9e('0x2f')]({[_0x409319+_0x0a9e('0x34')]:![]});});}_0x69aeb7['where']=_[_0x0a9e('0x35')](_0x69aeb7['where'],{'$and':_0x1dbde2});if(_0xd5b662[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x3f3d41={'params':{'id':_0xd5b662['user'][_0x0a9e('0x37')]},'query':{'section':_0x0a9e('0x38'),'role':_0x0a9e('0x2c'),'online':_0xd5b662[_0x0a9e('0xe')]['online']===!![]?!![]:![],'raw':!![],'ids':_0x459eb1,'customSorting':_0x106033}};if(_0x48f32d){_0x3f3d41['query'][_0x0a9e('0x39')]=_0x1dbde2;}_0x3f3d41['query']=Object[_0x0a9e('0x3a')](_0x3f3d41[_0x0a9e('0xe')],_0xd5b662[_0x0a9e('0xe')]);delete _0x3f3d41[_0x0a9e('0xe')]['id'];return db['UserProfile'][_0x0a9e('0x3b')](_0x3f3d41);}return db[_0x0a9e('0x26')][_0x0a9e('0x3c')](_0x69aeb7);})['then'](function(_0x1dbf74){_0x32d742[_0x0a9e('0x9')]=_0x1dbf74[_0x0a9e('0x9')];_0x2b4227=_0x1dbf74['rows'];return _0x2b4227['map'](function(_0x11b61d){var _0x40d766=_['find'](_0x281129,['id',_0x11b61d['id']]);if(_0x40d766){var _0x2b814e=rta[_0x0a9e('0x3d')](_0x40d766);_[_0x0a9e('0x35')](_0x11b61d,_0x2b814e);}_0x11b61d[_0x0a9e('0x1b')]=rta['getAgentStatus'](_0x11b61d);if(_0x11b61d['globalStatus'][_0x0a9e('0x1a')](_0x0a9e('0x11'))){_0x4283ce['forEach'](function(_0x183991){if(_0x11b61d[_0x183991+_0x0a9e('0x34')]){if(_0x183991===_0x0a9e('0x3e')){if(_0x11b61d['voiceStatus']!==_0x0a9e('0x3f')){_0x11b61d[_0x0a9e('0x40')]=_0x0a9e('0x11');}}else{_0x11b61d[_0x183991+_0x0a9e('0x41')]=_0x0a9e('0x11');}}});}return _0x11b61d;});})[_0x0a9e('0x13')](function(_0x2881b3){if(!_0x478723||_0x106033){return _0x2881b3;}return rta[_0x0a9e('0x42')](_0x2881b3,_0x478723);})[_0x0a9e('0x13')](function(_0x3da2cd){var _0x2c3711=null;if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x11ca30=_0xd5b662[_0x0a9e('0xe')]['fields']['split'](',');_0x2c3711=_0x3da2cd[_0x0a9e('0x25')](function(_0xb3795a){return _[_0x0a9e('0x43')](_0xb3795a,_0x11ca30);});}_0x32d742[_0x0a9e('0x22')]=_0x2c3711||_0x3da2cd;return _0x32d742;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x26d672,_0x69aeb7))[_0x0a9e('0x44')](APIHandleError(_0x26d672));};exports[_0x0a9e('0x45')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'count':0x0,'rows':[]};var _0x2c2cb0={};var _0x35ed4a;var _0x5026aa;var _0x117c99;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util['format'](_0x0a9e('0x17'),_0x445e25['query'][_0x0a9e('0x14')]));}_0x35ed4a=_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]['toLowerCase']();}var _0x14bec2=_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x47');var _0x34aa5a=_[_0x0a9e('0x25')](db[_0x14bec2][_0x0a9e('0x27')],function(_0x45bf7f){return{'name':_0x45bf7f['fieldName'],'type':_0x45bf7f[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});if(!_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x409789=['id',_0x0a9e('0x48')];if(_0x35ed4a===_0x0a9e('0x3e')){_0x409789[_0x0a9e('0x2f')](_0x0a9e('0x29'));if(_0x445e25['query'][_0x0a9e('0x29')]===_0x0a9e('0x49')){_0x409789['push'](['dialActive','dialMethod']);}}_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]=_0x409789[_0x0a9e('0x1f')](',');}_0x2c2cb0=qs[_0x0a9e('0x2d')](_0x34aa5a,_0x445e25);if(_0x445e25[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x375c18={'params':{'id':_0x445e25['user']['userProfileId']},'query':{'section':_0x35ed4a==='voice'&&_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x29')]===_0x0a9e('0x49')?'QueueCampaigns':_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x4a'),'type':_0x445e25['query']['type'],'nolimit':!![],'sort':_0x0a9e('0x48'),'filter':_0x445e25['query'][_0x0a9e('0x4b')]}};_0x375c18['query']=Object[_0x0a9e('0x3a')](_0x375c18[_0x0a9e('0xe')],_0x445e25[_0x0a9e('0xe')]);delete _0x375c18['query']['id'];return db[_0x0a9e('0x4c')][_0x0a9e('0x3b')](_0x375c18);}return db[_0x14bec2]['findAndCountAll'](_0x2c2cb0);})['then'](function(_0x128aa6){_0x25c6e6[_0x0a9e('0x9')]=_0x128aa6['count'];_0x5026aa=_0x128aa6[_0x0a9e('0x22')];return rtq['getRealtimeQueues'](_0x445e25,_0x35ed4a);})[_0x0a9e('0x13')](function(_0x523cd2){_0x117c99=_0x523cd2[_0x0a9e('0x22')];return rtq['initializeQueues'](_0x5026aa,_0x117c99,_0x35ed4a,_0x445e25['query']['type']);})[_0x0a9e('0x13')](function(_0x47de4c){_0x25c6e6[_0x0a9e('0x22')]=_0x47de4c;return _0x25c6e6;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x432fcc,_0x2c2cb0))[_0x0a9e('0x44')](APIHandleError(_0x432fcc));}; \ No newline at end of file +var _0xa9e0=['pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','push','literal','FIELD(id,','forEach','*pause','Pause','merge','user','userProfileId','Agents','extraQueryConditions','assign','getResources','findAndCountAll','filterAgentAttributes','voice','talking','voiceStatus','Status','sortAgentsByStatus','pick','catch','getQueues','startCase','Queue','name','outbound','Queues','filter','UserProfile','lodash','util','../../components/realtime/agents','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter'];(function(_0x49edf3,_0xc5f778){var _0xcb0f17=function(_0x3c81e1){while(--_0x3c81e1){_0x49edf3['push'](_0x49edf3['shift']());}};_0xcb0f17(++_0xc5f778);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var rta=require(_0x0a9e('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var APIHandleError=require(_0x0a9e('0x4'))[_0x0a9e('0x6')];function respondWithFilteredResult(_0x981158,_0x57b080){return function(_0x219af0){if(_0x219af0){var _0x441e3a=typeof _0x57b080[_0x0a9e('0x7')]==='undefined'&&typeof _0x57b080['limit']===_0x0a9e('0x8');var _0x56465b=_0x219af0['count'];var _0x39753a=_0x441e3a?0x0:_0x57b080[_0x0a9e('0x7')];var _0x307b3e=_0x441e3a?_0x219af0[_0x0a9e('0x9')]:_0x57b080[_0x0a9e('0x7')]+_0x57b080[_0x0a9e('0xa')];var _0x4a4c56;if(_0x307b3e>=_0x56465b){_0x307b3e=_0x56465b;_0x4a4c56=0xc8;}else{_0x4a4c56=0xce;}_0x981158['status'](_0x4a4c56);return _0x981158['set']('Content-Range',_0x39753a+'-'+_0x307b3e+'/'+_0x56465b)[_0x0a9e('0xb')](_0x219af0);}return null;};}exports[_0x0a9e('0xc')]=function(_0xd5b662,_0x26d672){var _0x32d742={'count':0x0,'rows':[]};var _0x69aeb7={};var _0x5db4b0;var _0x4283ce=utils[_0x0a9e('0xd')]();var _0x2b4227;var _0x281129;var _0x44dcfd=_0xd5b662[_0x0a9e('0xe')]['globalQueueFilter'];var _0x22dccb=_0xd5b662['query'][_0x0a9e('0xf')];var _0x519dfd=_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x10')];var _0x48f32d=_0x22dccb===_0x0a9e('0x11')||_0x22dccb==='*pause'?!![]:![];var _0x459eb1=[];var _0x478723;var _0x106033;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util[_0x0a9e('0x16')](_0x0a9e('0x17'),_0xd5b662['query'][_0x0a9e('0x14')]));}_0x5db4b0=_0xd5b662[_0x0a9e('0xe')]['channel'][_0x0a9e('0x18')]();}if(!_0xd5b662['query']['sort']||!_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')][_0x0a9e('0x1a')](_0x0a9e('0x1b'))){_0xd5b662['query'][_0x0a9e('0x19')]=rta[_0x0a9e('0x1c')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')]);return;}var _0x370d86=rta[_0x0a9e('0x1d')](_0xd5b662[_0x0a9e('0xe')]['sort']);_0xd5b662['query'][_0x0a9e('0x19')]=_0x370d86[_0x0a9e('0x1e')][_0x0a9e('0x1f')](',');_0x478723=_0x370d86[_0x0a9e('0x20')];})['then'](function(){if(!_0x44dcfd){return[];}return rta[_0x0a9e('0x21')](_0x44dcfd,_0x5db4b0);})['then'](function(_0x45a1e7){_0x459eb1=_0x45a1e7;return rta['getRealtimeAgents']();})[_0x0a9e('0x13')](function(_0x34dc65){_0x281129=_0x34dc65[_0x0a9e('0x22')];if((!_0x22dccb||_0x48f32d)&&!_0x478723){return _0x459eb1;}if(_0x478723&&!_0x22dccb){return rta[_0x0a9e('0x23')](_0x281129,_0x459eb1,_0x478723);}else{return rta[_0x0a9e('0x24')](_0x281129,_0x459eb1,_0x22dccb);}})[_0x0a9e('0x13')](function(_0x11c3b6){_0x459eb1=_0x11c3b6;var _0x14de77=![];if(_0x459eb1['length']===0x0){if(_0x44dcfd||_0x22dccb){_0x14de77=!![];}if(_0x48f32d){_0x14de77=![];}}if(_0x14de77){return _0x32d742;}var _0x3652a7=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x28')],'type':_0x5c877d[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x2b')]=_0x0a9e('0x2c');_0x69aeb7=qs[_0x0a9e('0x2d')](_0x3652a7,_0xd5b662);_0x69aeb7[_0x0a9e('0x2e')]=!![];var _0x1dbde2=[];if(_0x459eb1['length']>0x0){_0x1dbde2[_0x0a9e('0x2f')]({'id':{'$in':_0x459eb1}});if(_0x478723&&!_0x22dccb){_0x106033=[db['sequelize'][_0x0a9e('0x30')](_0x0a9e('0x31')+_0x459eb1+')')];_0x69aeb7[_0x0a9e('0x20')]=_0x106033;}}if(_0x48f32d){_0x4283ce[_0x0a9e('0x32')](function(_0x25ce3a){var _0x5180f1=!![];if(_0x22dccb===_0x0a9e('0x33')&&_0x5db4b0!==_0x25ce3a){_0x5180f1=![];}_0x1dbde2[_0x0a9e('0x2f')]({[_0x25ce3a+_0x0a9e('0x34')]:_0x5180f1});});if(_0x519dfd){_0x1dbde2[_0x0a9e('0x2f')]({'pauseType':_0x519dfd});}}else if(_0x22dccb){_0x4283ce[_0x0a9e('0x32')](function(_0x409319){_0x1dbde2[_0x0a9e('0x2f')]({[_0x409319+_0x0a9e('0x34')]:![]});});}_0x69aeb7['where']=_[_0x0a9e('0x35')](_0x69aeb7['where'],{'$and':_0x1dbde2});if(_0xd5b662[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x3f3d41={'params':{'id':_0xd5b662['user'][_0x0a9e('0x37')]},'query':{'section':_0x0a9e('0x38'),'role':_0x0a9e('0x2c'),'online':_0xd5b662[_0x0a9e('0xe')]['online']===!![]?!![]:![],'raw':!![],'ids':_0x459eb1,'customSorting':_0x106033}};if(_0x48f32d){_0x3f3d41['query'][_0x0a9e('0x39')]=_0x1dbde2;}_0x3f3d41['query']=Object[_0x0a9e('0x3a')](_0x3f3d41[_0x0a9e('0xe')],_0xd5b662[_0x0a9e('0xe')]);delete _0x3f3d41[_0x0a9e('0xe')]['id'];return db['UserProfile'][_0x0a9e('0x3b')](_0x3f3d41);}return db[_0x0a9e('0x26')][_0x0a9e('0x3c')](_0x69aeb7);})['then'](function(_0x1dbf74){_0x32d742[_0x0a9e('0x9')]=_0x1dbf74[_0x0a9e('0x9')];_0x2b4227=_0x1dbf74['rows'];return _0x2b4227['map'](function(_0x11b61d){var _0x40d766=_['find'](_0x281129,['id',_0x11b61d['id']]);if(_0x40d766){var _0x2b814e=rta[_0x0a9e('0x3d')](_0x40d766);_[_0x0a9e('0x35')](_0x11b61d,_0x2b814e);}_0x11b61d[_0x0a9e('0x1b')]=rta['getAgentStatus'](_0x11b61d);if(_0x11b61d['globalStatus'][_0x0a9e('0x1a')](_0x0a9e('0x11'))){_0x4283ce['forEach'](function(_0x183991){if(_0x11b61d[_0x183991+_0x0a9e('0x34')]){if(_0x183991===_0x0a9e('0x3e')){if(_0x11b61d['voiceStatus']!==_0x0a9e('0x3f')){_0x11b61d[_0x0a9e('0x40')]=_0x0a9e('0x11');}}else{_0x11b61d[_0x183991+_0x0a9e('0x41')]=_0x0a9e('0x11');}}});}return _0x11b61d;});})[_0x0a9e('0x13')](function(_0x2881b3){if(!_0x478723||_0x106033){return _0x2881b3;}return rta[_0x0a9e('0x42')](_0x2881b3,_0x478723);})[_0x0a9e('0x13')](function(_0x3da2cd){var _0x2c3711=null;if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x11ca30=_0xd5b662[_0x0a9e('0xe')]['fields']['split'](',');_0x2c3711=_0x3da2cd[_0x0a9e('0x25')](function(_0xb3795a){return _[_0x0a9e('0x43')](_0xb3795a,_0x11ca30);});}_0x32d742[_0x0a9e('0x22')]=_0x2c3711||_0x3da2cd;return _0x32d742;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x26d672,_0x69aeb7))[_0x0a9e('0x44')](APIHandleError(_0x26d672));};exports[_0x0a9e('0x45')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'count':0x0,'rows':[]};var _0x2c2cb0={};var _0x35ed4a;var _0x5026aa;var _0x117c99;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util['format'](_0x0a9e('0x17'),_0x445e25['query'][_0x0a9e('0x14')]));}_0x35ed4a=_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]['toLowerCase']();}var _0x14bec2=_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x47');var _0x34aa5a=_[_0x0a9e('0x25')](db[_0x14bec2][_0x0a9e('0x27')],function(_0x45bf7f){return{'name':_0x45bf7f['fieldName'],'type':_0x45bf7f[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});if(!_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x409789=['id',_0x0a9e('0x48')];if(_0x35ed4a===_0x0a9e('0x3e')){_0x409789[_0x0a9e('0x2f')](_0x0a9e('0x29'));if(_0x445e25['query'][_0x0a9e('0x29')]===_0x0a9e('0x49')){_0x409789['push'](['dialActive','dialMethod']);}}_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]=_0x409789[_0x0a9e('0x1f')](',');}_0x2c2cb0=qs[_0x0a9e('0x2d')](_0x34aa5a,_0x445e25);if(_0x445e25[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x375c18={'params':{'id':_0x445e25['user']['userProfileId']},'query':{'section':_0x35ed4a==='voice'&&_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x29')]===_0x0a9e('0x49')?'QueueCampaigns':_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x4a'),'type':_0x445e25['query']['type'],'nolimit':!![],'sort':_0x0a9e('0x48'),'filter':_0x445e25['query'][_0x0a9e('0x4b')]}};_0x375c18['query']=Object[_0x0a9e('0x3a')](_0x375c18[_0x0a9e('0xe')],_0x445e25[_0x0a9e('0xe')]);delete _0x375c18['query']['id'];return db[_0x0a9e('0x4c')][_0x0a9e('0x3b')](_0x375c18);}return db[_0x14bec2]['findAndCountAll'](_0x2c2cb0);})['then'](function(_0x128aa6){_0x25c6e6[_0x0a9e('0x9')]=_0x128aa6['count'];_0x5026aa=_0x128aa6[_0x0a9e('0x22')];return rtq['getRealtimeQueues'](_0x445e25,_0x35ed4a);})[_0x0a9e('0x13')](function(_0x523cd2){_0x117c99=_0x523cd2[_0x0a9e('0x22')];return rtq['initializeQueues'](_0x5026aa,_0x117c99,_0x35ed4a,_0x445e25['query']['type']);})[_0x0a9e('0x13')](function(_0x47de4c){_0x25c6e6[_0x0a9e('0x22')]=_0x47de4c;return _0x25c6e6;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x432fcc,_0x2c2cb0))[_0x0a9e('0x44')](APIHandleError(_0x432fcc));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 89562c7..b2a9d7e 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x12b8d2,_0x10b159){var _0x404bd5=function(_0x22b3fb){while(--_0x22b3fb){_0x12b8d2['push'](_0x12b8d2['shift']());}};_0x404bd5(++_0x10b159);}(_0xe706,0xa3));var _0x6e70=function(_0x145eae,_0x2fc6a5){_0x145eae=_0x145eae-0x0;var _0x4c6a1f=_0xe706[_0x145eae];return _0x4c6a1f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x206b7,_0x1ef444){var _0x3e9d63=function(_0x1225f6){while(--_0x1225f6){_0x206b7['push'](_0x206b7['shift']());}};_0x3e9d63(++_0x1ef444);}(_0x70e0,0x17b));var _0x070e=function(_0x872a88,_0x4a3a74){_0x872a88=_0x872a88-0x0;var _0xaacdfb=_0x70e0[_0x872a88];return _0xaacdfb;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index bfa2077..5e58e5e 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 _0x6596=['DATE','INTEGER','sequelize','exports','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6596,0x1d3));var _0x6659=function(_0x242282,_0x431f68){_0x242282=_0x242282-0x0;var _0x33c912=_0x6596[_0x242282];return _0x33c912;};'use strict';var Sequelize=require(_0x6659('0x0'));module[_0x6659('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x6659('0x2')]},'scheduledat':{'type':Sequelize[_0x6659('0x3')]},'uniqueid':{'type':Sequelize[_0x6659('0x2')]},'starttime':{'type':Sequelize[_0x6659('0x3')]},'responsetime':{'type':Sequelize[_0x6659('0x3')]},'ringtime':{'type':Sequelize[_0x6659('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6659('0x2')]}}; \ No newline at end of file +var _0x2706=['INTEGER','STRING','DATE','exports'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x2706,0x107));var _0x6270=function(_0x26979c,_0x5daeda){_0x26979c=_0x26979c-0x0;var _0x460ffb=_0x2706[_0x26979c];return _0x460ffb;};'use strict';var Sequelize=require('sequelize');module[_0x6270('0x0')]={'state':{'type':Sequelize[_0x6270('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x6270('0x2')]},'scheduledat':{'type':Sequelize[_0x6270('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6270('0x3')]},'responsetime':{'type':Sequelize[_0x6270('0x3')]},'ringtime':{'type':Sequelize[_0x6270('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x6270('0x2')]},'campaigntype':{'type':Sequelize[_0x6270('0x2')]},'membername':{'type':Sequelize[_0x6270('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 36c1b77..2b03dbb 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 _0xe871=['moment','bluebird','path','../../config/environment','./reportAgentPreview.attributes','define','util','../../config/logger'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe871,0x86));var _0x1e87=function(_0x73060b,_0x33c24f){_0x73060b=_0x73060b-0x0;var _0x5e5275=_0xe871[_0x73060b];return _0x5e5275;};'use strict';var _=require('lodash');var util=require(_0x1e87('0x0'));var logger=require(_0x1e87('0x1'))('api');var moment=require(_0x1e87('0x2'));var BPromise=require(_0x1e87('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e87('0x4'));var rimraf=require('rimraf');var config=require(_0x1e87('0x5'));var attributes=require(_0x1e87('0x6'));module['exports']=function(_0x26a877,_0x19795e){return _0x26a877[_0x1e87('0x7')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5449=['../../config/logger','api','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0x5449,0x170));var _0x9544=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x5449[_0xbd08b4];return _0x314f1e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9544('0x0'))(_0x9544('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9544('0x2'));var config=require(_0x9544('0x3'));var attributes=require(_0x9544('0x4'));module[_0x9544('0x5')]=function(_0x331586,_0x16f12d){return _0x331586['define'](_0x9544('0x6'),attributes,{'tableName':_0x9544('0x7'),'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 3d52f2e..55e37cb 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 _0xf96d=['then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ReportAgentPreview','body','options','CreateReportAgentPreview','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x2818b9,_0x2c1043){var _0x1f1462=function(_0xc728c){while(--_0xc728c){_0x2818b9['push'](_0x2818b9['shift']());}};_0x1f1462(++_0x2c1043);}(_0xf96d,0x1c9));var _0xdf96=function(_0x1c7092,_0x46063a){_0x1c7092=_0x1c7092-0x0;var _0x40e78e=_0xf96d[_0x1c7092];return _0x40e78e;};'use strict';var _=require(_0xdf96('0x0'));var util=require(_0xdf96('0x1'));var moment=require(_0xdf96('0x2'));var BPromise=require('bluebird');var rs=require(_0xdf96('0x3'));var fs=require('fs');var Redis=require(_0xdf96('0x4'));var db=require(_0xdf96('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf96('0x6'))(_0xdf96('0x7'));var config=require('../../config/environment');var jayson=require(_0xdf96('0x8'));var client=jayson[_0xdf96('0x9')][_0xdf96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x222a46,_0x3fde5d,_0x166474){return new BPromise(function(_0x167441,_0x5d2547){return client['request'](_0x222a46,_0x166474)[_0xdf96('0xb')](function(_0x66c0a9){logger[_0xdf96('0xc')](_0xdf96('0xd'),_0x3fde5d,_0xdf96('0xe'));logger[_0xdf96('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x3fde5d,'request\x20sent',JSON[_0xdf96('0x10')](_0x66c0a9));if(_0x66c0a9[_0xdf96('0x11')]){if(_0x66c0a9[_0xdf96('0x11')][_0xdf96('0x12')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x3fde5d,_0x66c0a9[_0xdf96('0x11')][_0xdf96('0x13')]);return _0x5d2547(_0x66c0a9[_0xdf96('0x11')][_0xdf96('0x13')]);}logger[_0xdf96('0x11')](_0xdf96('0xd'),_0x3fde5d,_0x66c0a9[_0xdf96('0x11')][_0xdf96('0x13')]);return _0x167441(_0x66c0a9['error']['message']);}else{logger[_0xdf96('0xc')](_0xdf96('0xd'),_0x3fde5d,_0xdf96('0xe'));_0x167441(_0x66c0a9[_0xdf96('0x14')][_0xdf96('0x13')]);}})['catch'](function(_0x39c1ee){logger[_0xdf96('0x11')](_0xdf96('0xd'),_0x3fde5d,_0x39c1ee);_0x5d2547(_0x39c1ee);});});}exports['CreateReportAgentPreview']=function(_0x47a60){var _0x391fd9=this;return new Promise(function(_0x374043,_0x2a0b69){return db[_0xdf96('0x15')]['create'](_0x47a60[_0xdf96('0x16')],{'raw':_0x47a60[_0xdf96('0x17')]?_0x47a60['options']['raw']===undefined?!![]:![]:!![]})[_0xdf96('0xb')](function(_0x32fd50){logger[_0xdf96('0xc')]('CreateReportAgentPreview',_0x47a60);logger[_0xdf96('0xf')](_0xdf96('0x18'),_0x47a60,JSON[_0xdf96('0x10')](_0x32fd50));_0x374043(_0x32fd50);})[_0xdf96('0x19')](function(_0x58b8a8){logger[_0xdf96('0x11')](_0xdf96('0x18'),_0x58b8a8[_0xdf96('0x13')],_0x47a60);_0x2a0b69(_0x391fd9[_0xdf96('0x11')](0x1f4,_0x58b8a8[_0xdf96('0x13')]));});});}; \ No newline at end of file +var _0xcbb6=['moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','util'];(function(_0x194f6d,_0x6f6222){var _0x572280=function(_0x5d1af9){while(--_0x5d1af9){_0x194f6d['push'](_0x194f6d['shift']());}};_0x572280(++_0x6f6222);}(_0xcbb6,0x18f));var _0x6cbb=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xcbb6[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x6cbb('0x0'));var moment=require(_0x6cbb('0x1'));var BPromise=require('bluebird');var rs=require(_0x6cbb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6cbb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6cbb('0x4'))(_0x6cbb('0x5'));var config=require('../../config/environment');var jayson=require(_0x6cbb('0x6'));var client=jayson[_0x6cbb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x338ed7,_0x2c3bf9,_0x55f962){return new BPromise(function(_0x42fc65,_0x3e538f){return client[_0x6cbb('0x8')](_0x338ed7,_0x55f962)[_0x6cbb('0x9')](function(_0x346c61){logger[_0x6cbb('0xa')](_0x6cbb('0xb'),_0x2c3bf9,'request\x20sent');logger[_0x6cbb('0xc')](_0x6cbb('0xd'),_0x2c3bf9,'request\x20sent',JSON[_0x6cbb('0xe')](_0x346c61));if(_0x346c61[_0x6cbb('0xf')]){if(_0x346c61[_0x6cbb('0xf')][_0x6cbb('0x10')]===0x1f4){logger['error'](_0x6cbb('0xb'),_0x2c3bf9,_0x346c61[_0x6cbb('0xf')][_0x6cbb('0x11')]);return _0x3e538f(_0x346c61[_0x6cbb('0xf')]['message']);}logger[_0x6cbb('0xf')](_0x6cbb('0xb'),_0x2c3bf9,_0x346c61[_0x6cbb('0xf')][_0x6cbb('0x11')]);return _0x42fc65(_0x346c61[_0x6cbb('0xf')]['message']);}else{logger[_0x6cbb('0xa')](_0x6cbb('0xb'),_0x2c3bf9,'request\x20sent');_0x42fc65(_0x346c61[_0x6cbb('0x12')][_0x6cbb('0x11')]);}})[_0x6cbb('0x13')](function(_0x547228){logger[_0x6cbb('0xf')](_0x6cbb('0xb'),_0x2c3bf9,_0x547228);_0x3e538f(_0x547228);});});}exports[_0x6cbb('0x14')]=function(_0x1c7d08){var _0x3482f9=this;return new Promise(function(_0x2072b4,_0x3e8928){return db[_0x6cbb('0x15')][_0x6cbb('0x16')](_0x1c7d08['body'],{'raw':_0x1c7d08[_0x6cbb('0x17')]?_0x1c7d08[_0x6cbb('0x17')][_0x6cbb('0x18')]===undefined?!![]:![]:!![]})[_0x6cbb('0x9')](function(_0x515799){logger[_0x6cbb('0xa')](_0x6cbb('0x14'),_0x1c7d08);logger[_0x6cbb('0xc')](_0x6cbb('0x14'),_0x1c7d08,JSON[_0x6cbb('0xe')](_0x515799));_0x2072b4(_0x515799);})[_0x6cbb('0x13')](function(_0x539106){logger['error'](_0x6cbb('0x14'),_0x539106[_0x6cbb('0x11')],_0x1c7d08);_0x3e8928(_0x3482f9[_0x6cbb('0xf')](0x1f4,_0x539106[_0x6cbb('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 62a8737..9d62e2a 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 _0x51a6=['/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','post','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms'];(function(_0x163742,_0x467e36){var _0x1152ac=function(_0x40a83d){while(--_0x40a83d){_0x163742['push'](_0x163742['shift']());}};_0x1152ac(++_0x467e36);}(_0x51a6,0x1ad));var _0x651a=function(_0x34c26b,_0x5e279b){_0x34c26b=_0x34c26b-0x0;var _0x2f9f58=_0x51a6[_0x34c26b];return _0x2f9f58;};'use strict';var multer=require(_0x651a('0x0'));var util=require(_0x651a('0x1'));var path=require(_0x651a('0x2'));var express=require(_0x651a('0x3'));var router=express[_0x651a('0x4')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x651a('0x5')](_0x651a('0x6'),auth[_0x651a('0x7')](),controller[_0x651a('0x8')]);router[_0x651a('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x651a('0x7')](),controller['voiceChannelMixMonitor']);router[_0x651a('0x5')](_0x651a('0x9'),auth['isAuthenticated'](),controller[_0x651a('0xa')]);router['get'](_0x651a('0xb'),auth[_0x651a('0x7')](),controller[_0x651a('0xc')]);router[_0x651a('0x5')](_0x651a('0xd'),auth[_0x651a('0x7')](),controller['chatQueues']);router[_0x651a('0x5')](_0x651a('0xe'),auth['isAuthenticated'](),controller[_0x651a('0xf')]);router['get'](_0x651a('0x10'),auth[_0x651a('0x7')](),controller[_0x651a('0x11')]);router[_0x651a('0x5')](_0x651a('0x12'),auth[_0x651a('0x7')](),controller['openchannelQueues']);router[_0x651a('0x5')](_0x651a('0x13'),auth[_0x651a('0x7')](),controller[_0x651a('0x14')]);router[_0x651a('0x5')](_0x651a('0x15'),auth['isAuthenticated'](),controller[_0x651a('0x16')]);router[_0x651a('0x5')]('/fax/queues',auth[_0x651a('0x7')](),controller[_0x651a('0x17')]);router[_0x651a('0x5')](_0x651a('0x18'),auth['isAuthenticated'](),controller[_0x651a('0x19')]);router[_0x651a('0x5')](_0x651a('0x1a'),auth[_0x651a('0x7')](),controller[_0x651a('0x1b')]);router['get']('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x651a('0x1c')]);router[_0x651a('0x5')](_0x651a('0x1d'),auth[_0x651a('0x7')](),controller['voiceQueuesChannelHangup']);router['get'](_0x651a('0x1e'),auth[_0x651a('0x7')](),controller[_0x651a('0x1f')]);router[_0x651a('0x5')](_0x651a('0x20'),auth[_0x651a('0x7')](),controller[_0x651a('0x21')]);router[_0x651a('0x22')](_0x651a('0x20'),auth[_0x651a('0x7')](),controller[_0x651a('0x23')]);router[_0x651a('0x5')](_0x651a('0x24'),auth[_0x651a('0x7')](),controller[_0x651a('0x25')]);router['get'](_0x651a('0x26'),auth['isAuthenticated'](),controller[_0x651a('0x27')]);router[_0x651a('0x5')](_0x651a('0x28'),auth[_0x651a('0x7')](),controller[_0x651a('0x29')]);router[_0x651a('0x22')](_0x651a('0x2a'),auth[_0x651a('0x7')](),controller[_0x651a('0x2b')]);router[_0x651a('0x5')](_0x651a('0x2c'),auth[_0x651a('0x7')](),controller[_0x651a('0x2d')]);router[_0x651a('0x5')](_0x651a('0x2e'),auth[_0x651a('0x7')](),controller['trunks']);router['get'](_0x651a('0x2f'),auth[_0x651a('0x7')](),controller[_0x651a('0x30')]);router[_0x651a('0x5')](_0x651a('0x31'),auth[_0x651a('0x7')](),controller[_0x651a('0x32')]);router[_0x651a('0x5')](_0x651a('0x33'),auth[_0x651a('0x7')](),controller[_0x651a('0x34')]);router[_0x651a('0x5')](_0x651a('0x35'),auth[_0x651a('0x7')](),controller[_0x651a('0x36')]);router[_0x651a('0x5')](_0x651a('0x37'),auth[_0x651a('0x7')](),controller[_0x651a('0x38')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0x651a('0x7')](),controller[_0x651a('0x39')]);router['get'](_0x651a('0x3a'),auth['isAuthenticated'](),controller[_0x651a('0x3b')]);router[_0x651a('0x5')](_0x651a('0x3c'),auth[_0x651a('0x7')](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0x651a('0x3d'),auth[_0x651a('0x7')](),controller[_0x651a('0x3e')]);router['post'](_0x651a('0x3f'),auth[_0x651a('0x7')](),controller[_0x651a('0x40')](_0x651a('0x41')));router['get']('/mail/queues/:id',auth[_0x651a('0x7')](),controller[_0x651a('0x42')]);router['post'](_0x651a('0x43'),auth['isAuthenticated'](),controller[_0x651a('0x40')]('chat'));router['get']('/chat/queues/:id',auth[_0x651a('0x7')](),controller['showChatQueues']);router[_0x651a('0x44')]('/fax/queues/:id/notify',auth[_0x651a('0x7')](),controller[_0x651a('0x40')]('fax'));router['get'](_0x651a('0x45'),auth[_0x651a('0x7')](),controller[_0x651a('0x46')]);router['post']('/openchannel/queues/:id/notify',auth[_0x651a('0x7')](),controller[_0x651a('0x40')](_0x651a('0x47')));router[_0x651a('0x5')](_0x651a('0x48'),auth[_0x651a('0x7')](),controller[_0x651a('0x49')]);router[_0x651a('0x44')]('/sms/queues/:id/notify',auth[_0x651a('0x7')](),controller[_0x651a('0x40')](_0x651a('0x4a')));router['post'](_0x651a('0x4b'),auth[_0x651a('0x7')](),controller[_0x651a('0x40')](_0x651a('0x4c')));router[_0x651a('0x5')](_0x651a('0x4d'),auth['isAuthenticated'](),controller[_0x651a('0x4e')]);router[_0x651a('0x5')](_0x651a('0x4f'),auth[_0x651a('0x7')](),controller[_0x651a('0x50')]);router[_0x651a('0x44')](_0x651a('0x51'),auth[_0x651a('0x7')](),controller[_0x651a('0x52')]);module[_0x651a('0x53')]=router; \ No newline at end of file +var _0x95f6=['/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','util','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','smsQueues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/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/channels','outboundChannels','agents','/agents/:id/capacity','agentCapacity','/trunks','trunks','/campaigns','campaigns','/fax/accounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post'];(function(_0x56a265,_0x4bc181){var _0xd42e80=function(_0x2c8a87){while(--_0x2c8a87){_0x56a265['push'](_0x56a265['shift']());}};_0xd42e80(++_0x4bc181);}(_0x95f6,0xb8));var _0x695f=function(_0x32814c,_0x2a68f5){_0x32814c=_0x32814c-0x0;var _0x394c8d=_0x95f6[_0x32814c];return _0x394c8d;};'use strict';var multer=require(_0x695f('0x0'));var util=require(_0x695f('0x1'));var path=require(_0x695f('0x2'));var express=require('express');var router=express[_0x695f('0x3')]();var auth=require(_0x695f('0x4'));var controller=require(_0x695f('0x5'));router[_0x695f('0x6')](_0x695f('0x7'),auth[_0x695f('0x8')](),controller[_0x695f('0x9')]);router[_0x695f('0x6')](_0x695f('0xa'),auth[_0x695f('0x8')](),controller[_0x695f('0xb')]);router[_0x695f('0x6')](_0x695f('0xc'),auth[_0x695f('0x8')](),controller['voiceChannelStopMixMonitor']);router[_0x695f('0x6')](_0x695f('0xd'),auth[_0x695f('0x8')](),controller[_0x695f('0xe')]);router[_0x695f('0x6')](_0x695f('0xf'),auth[_0x695f('0x8')](),controller[_0x695f('0x10')]);router[_0x695f('0x6')](_0x695f('0x11'),auth[_0x695f('0x8')](),controller[_0x695f('0x12')]);router[_0x695f('0x6')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x695f('0x13')]);router[_0x695f('0x6')](_0x695f('0x14'),auth[_0x695f('0x8')](),controller['openchannelQueues']);router[_0x695f('0x6')]('/sms/queues',auth[_0x695f('0x8')](),controller[_0x695f('0x15')]);router['get']('/whatsapp/queues',auth[_0x695f('0x8')](),controller[_0x695f('0x16')]);router[_0x695f('0x6')]('/fax/queues',auth[_0x695f('0x8')](),controller[_0x695f('0x17')]);router[_0x695f('0x6')](_0x695f('0x18'),auth[_0x695f('0x8')](),controller[_0x695f('0x19')]);router[_0x695f('0x6')](_0x695f('0x1a'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0x695f('0x6')](_0x695f('0x1b'),auth[_0x695f('0x8')](),controller[_0x695f('0x1c')]);router['get'](_0x695f('0x1d'),auth[_0x695f('0x8')](),controller[_0x695f('0x1e')]);router[_0x695f('0x6')](_0x695f('0x1f'),auth[_0x695f('0x8')](),controller[_0x695f('0x20')]);router[_0x695f('0x6')](_0x695f('0x21'),auth[_0x695f('0x8')](),controller[_0x695f('0x22')]);router[_0x695f('0x23')]('/voice/queues/:id',auth[_0x695f('0x8')](),controller[_0x695f('0x24')]);router[_0x695f('0x6')](_0x695f('0x25'),auth[_0x695f('0x8')](),controller['outbound']);router['get'](_0x695f('0x26'),auth[_0x695f('0x8')](),controller[_0x695f('0x27')]);router[_0x695f('0x6')]('/agents',auth[_0x695f('0x8')](),controller[_0x695f('0x28')]);router[_0x695f('0x23')](_0x695f('0x29'),auth[_0x695f('0x8')](),controller[_0x695f('0x2a')]);router[_0x695f('0x6')]('/telephones',auth[_0x695f('0x8')](),controller['telephones']);router['get'](_0x695f('0x2b'),auth[_0x695f('0x8')](),controller[_0x695f('0x2c')]);router[_0x695f('0x6')](_0x695f('0x2d'),auth[_0x695f('0x8')](),controller[_0x695f('0x2e')]);router['get'](_0x695f('0x2f'),auth[_0x695f('0x8')](),controller['faxAccounts']);router[_0x695f('0x6')]('/chat/queues/waitinginteractions',auth[_0x695f('0x8')](),controller[_0x695f('0x30')]);router[_0x695f('0x6')](_0x695f('0x31'),auth['isAuthenticated'](),controller[_0x695f('0x32')]);router['get'](_0x695f('0x33'),auth[_0x695f('0x8')](),controller[_0x695f('0x34')]);router[_0x695f('0x6')]('/openchannel/queues/:id/waitinginteractions',auth[_0x695f('0x8')](),controller[_0x695f('0x35')]);router[_0x695f('0x6')](_0x695f('0x36'),auth[_0x695f('0x8')](),controller['smsQueuesWaitingInteractions']);router[_0x695f('0x6')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x695f('0x37')]);router[_0x695f('0x6')](_0x695f('0x38'),auth[_0x695f('0x8')](),controller[_0x695f('0x39')]);router[_0x695f('0x3a')](_0x695f('0x3b'),auth[_0x695f('0x8')](),controller[_0x695f('0x3c')](_0x695f('0x3d')));router[_0x695f('0x6')](_0x695f('0x3e'),auth[_0x695f('0x8')](),controller['showMailQueues']);router[_0x695f('0x3a')](_0x695f('0x3f'),auth['isAuthenticated'](),controller[_0x695f('0x3c')](_0x695f('0x40')));router[_0x695f('0x6')](_0x695f('0x41'),auth[_0x695f('0x8')](),controller['showChatQueues']);router[_0x695f('0x3a')]('/fax/queues/:id/notify',auth[_0x695f('0x8')](),controller[_0x695f('0x3c')](_0x695f('0x42')));router['get'](_0x695f('0x43'),auth[_0x695f('0x8')](),controller[_0x695f('0x44')]);router[_0x695f('0x3a')]('/openchannel/queues/:id/notify',auth[_0x695f('0x8')](),controller[_0x695f('0x3c')](_0x695f('0x45')));router[_0x695f('0x6')](_0x695f('0x46'),auth[_0x695f('0x8')](),controller[_0x695f('0x47')]);router['post'](_0x695f('0x48'),auth['isAuthenticated'](),controller[_0x695f('0x3c')](_0x695f('0x49')));router[_0x695f('0x3a')](_0x695f('0x4a'),auth[_0x695f('0x8')](),controller[_0x695f('0x3c')](_0x695f('0x4b')));router['get']('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x695f('0x4c')]);router[_0x695f('0x6')](_0x695f('0x4d'),auth['isAuthenticated'](),controller[_0x695f('0x4e')]);router[_0x695f('0x3a')](_0x695f('0x4f'),auth[_0x695f('0x8')](),controller['agentNotify']);module[_0x695f('0x50')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 9501958..91821fa 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 _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x53019e,_0x10c61f){var _0x3dbc44=function(_0x449884){while(--_0x449884){_0x53019e['push'](_0x53019e['shift']());}};_0x3dbc44(++_0x10c61f);}(_0xe706,0xa3));var _0x6e70=function(_0x2aaec6,_0x291a6f){_0x2aaec6=_0x2aaec6-0x0;var _0x179e5b=_0xe706[_0x2aaec6];return _0x179e5b;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file +var _0xee50=['jayson/promise','http','client','request','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','length','updateAttributes','MemberReport','findOrCreate','interface','format','SIP/%s','capacity','telephones','Telephones','trunks','Trunks','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','value','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','*,*,*,*','agentNotify','channel','User','agent','Agent\x20not\x20found','MessageId','Start','bluebird','util','../../mysqldb','../../config/logger','api'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xee50,0xff));var _0x0ee5=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xee50[_0x21549c];return _0x426cbd;};'use strict';var BPromise=require(_0x0ee5('0x0'));var moment=require('moment');var _=require('lodash');var util=require(_0x0ee5('0x1'));var db=require(_0x0ee5('0x2'))['db'];var logger=require(_0x0ee5('0x3'))(_0x0ee5('0x4'));var jayson=require(_0x0ee5('0x5'));var amiClient=jayson['client'][_0x0ee5('0x6')]({'port':0x232a});var mailClient=jayson[_0x0ee5('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x0ee5('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1ca27f,_0x511583,_0x13f02a){return new BPromise(function(_0x45f084,_0x27827e){var _0x439ff7=_0x13f02a?_0x13f02a:amiClient;return _0x439ff7[_0x0ee5('0x8')](_0x1ca27f,_0x511583)['then'](function(_0x541cd3){if(_0x541cd3[_0x0ee5('0x9')]){if(_0x541cd3[_0x0ee5('0x9')][_0x0ee5('0xa')]===0x1f4){return _0x27827e(_0x541cd3['error']['message']);}return _0x45f084(_0x541cd3[_0x0ee5('0x9')][_0x0ee5('0xb')]);}else{_0x45f084(_0x541cd3[_0x0ee5('0xc')]);}})[_0x0ee5('0xd')](function(_0x53662c){_0x27827e(_0x53662c);});});}function respondWithResult(_0x166413,_0x3f3aa8){_0x3f3aa8=_0x3f3aa8||0xc8;return function(_0x501006){if(_0x501006){return _0x166413[_0x0ee5('0xe')](_0x3f3aa8)[_0x0ee5('0xf')](_0x501006);}return _0x166413[_0x0ee5('0x10')](0x194);};}function handleError(_0xbe6363,_0x19418d){_0x19418d=_0x19418d||0x1f4;return function(_0x24983c){logger[_0x0ee5('0x9')](_0x24983c[_0x0ee5('0x11')]);if(_0x24983c[_0x0ee5('0x12')]){delete _0x24983c[_0x0ee5('0x12')];}_0xbe6363[_0x0ee5('0xe')](_0x19418d)[_0x0ee5('0x13')](_0x24983c);};}function findById(_0x5e2e73){return function(_0x3cb6d9){if(!_[_0x0ee5('0x14')](_0x5e2e73)&&!_[_0x0ee5('0x14')](_0x3cb6d9)&&!_[_0x0ee5('0x14')](_0x3cb6d9[_0x0ee5('0x15')])){return _[_0x0ee5('0x16')](_0x3cb6d9[_0x0ee5('0x15')],function(_0x80c231){return _0x80c231['id']==_0x5e2e73;});}return null;};}exports[_0x0ee5('0x17')]=function(_0x4acf47,_0x2a5430){return respondWithRpcPromise(_0x0ee5('0x18'),_0x4acf47['query'])[_0x0ee5('0x19')](respondWithResult(_0x2a5430,null))[_0x0ee5('0xd')](handleError(_0x2a5430,null));};exports[_0x0ee5('0x1a')]=function(_0x34637e,_0x181226){return respondWithRpcPromise(_0x0ee5('0x1b'),_[_0x0ee5('0x1c')](_0x34637e[_0x0ee5('0x1d')],_0x34637e[_0x0ee5('0x1e')]))['then'](respondWithResult(_0x181226,null))[_0x0ee5('0xd')](handleError(_0x181226,null));};exports[_0x0ee5('0x1f')]=function(_0x314a9a,_0x358e31){return respondWithRpcPromise(_0x0ee5('0x20'),_[_0x0ee5('0x1c')](_0x314a9a['query'],_0x314a9a[_0x0ee5('0x1e')]))[_0x0ee5('0x19')](respondWithResult(_0x358e31,null))[_0x0ee5('0xd')](handleError(_0x358e31,null));};exports['voiceQueues']=function(_0xef38db,_0x1c9413){return respondWithRpcPromise('VoiceQueues',_0xef38db[_0x0ee5('0x1d')])[_0x0ee5('0x19')](respondWithResult(_0x1c9413,null))['catch'](handleError(_0x1c9413,null));};exports['showVoiceQueues']=function(_0x4bfdba,_0x2cfe94){return respondWithRpcPromise(_0x0ee5('0x21'),_0x4bfdba[_0x0ee5('0x1d')])['then'](findById(_0x4bfdba[_0x0ee5('0x1e')]['id']))[_0x0ee5('0x19')](respondWithResult(_0x2cfe94,null))[_0x0ee5('0xd')](handleError(_0x2cfe94,null));};exports[_0x0ee5('0x22')]=function(_0x1b27ff,_0x5e22f0){return respondWithRpcPromise(_0x0ee5('0x23'),_[_0x0ee5('0x1c')](_0x1b27ff[_0x0ee5('0x24')],_0x1b27ff['params']))[_0x0ee5('0x19')](respondWithResult(_0x5e22f0,null))['catch'](handleError(_0x5e22f0,null));};exports[_0x0ee5('0x25')]=function(_0x2c4f7b,_0x30fd00){return respondWithRpcPromise(_0x0ee5('0x26'),_[_0x0ee5('0x1c')](_0x2c4f7b['query'],_0x2c4f7b['params']))[_0x0ee5('0x19')](respondWithResult(_0x30fd00,null))[_0x0ee5('0xd')](handleError(_0x30fd00,null));};exports['voiceQueuesChannels']=function(_0x3b65d6,_0x20c56b){return respondWithRpcPromise(_0x0ee5('0x27'),_0x3b65d6[_0x0ee5('0x1d')])['then'](respondWithResult(_0x20c56b,null))[_0x0ee5('0xd')](handleError(_0x20c56b,null));};exports[_0x0ee5('0x28')]=function(_0x552239,_0x521861){return respondWithRpcPromise(_0x0ee5('0x29'),_[_0x0ee5('0x1c')](_0x552239['query'],_0x552239[_0x0ee5('0x1e')]))[_0x0ee5('0x19')](respondWithResult(_0x521861,null))[_0x0ee5('0xd')](handleError(_0x521861,null));};exports[_0x0ee5('0x2a')]=function(_0x2349a3,_0x2d2433){return respondWithRpcPromise(_0x0ee5('0x2b'),_['merge'](_0x2349a3[_0x0ee5('0x1d')],_0x2349a3[_0x0ee5('0x1e')]))[_0x0ee5('0x19')](respondWithResult(_0x2d2433,null))[_0x0ee5('0xd')](handleError(_0x2d2433,null));};exports[_0x0ee5('0x2c')]=function(_0x4b0a60,_0x2e2772){return respondWithRpcPromise(_0x0ee5('0x2d'),_[_0x0ee5('0x1c')](_0x4b0a60[_0x0ee5('0x1d')],_0x4b0a60[_0x0ee5('0x1e')]))['then'](respondWithResult(_0x2e2772,null))['catch'](handleError(_0x2e2772,null));};exports[_0x0ee5('0x2e')]=function(_0x579662,_0x4b2f35){return respondWithRpcPromise(_0x0ee5('0x2f'),_0x579662['query'])[_0x0ee5('0x19')](respondWithResult(_0x4b2f35,null))[_0x0ee5('0xd')](handleError(_0x4b2f35,null));};exports[_0x0ee5('0x30')]=function(_0x5b927b,_0x213d50){return respondWithRpcPromise(_0x0ee5('0x31'),_0x5b927b['query'])[_0x0ee5('0x19')](respondWithResult(_0x213d50,null))[_0x0ee5('0xd')](handleError(_0x213d50,null));};exports['agents']=function(_0x553043,_0x4f6980){var _0x41a9e5;return respondWithRpcPromise(_0x0ee5('0x32'),_0x553043[_0x0ee5('0x1d')])[_0x0ee5('0x19')](function(_0x335291){_0x41a9e5=_0x335291;return respondWithRpcPromise('Agents',_0x553043[_0x0ee5('0x1d')],routingClient);})['then'](function(_0x590e6a){return _[_0x0ee5('0x1c')]({},_0x590e6a,_0x41a9e5);})[_0x0ee5('0x19')](respondWithResult(_0x4f6980,null))[_0x0ee5('0xd')](handleError(_0x4f6980,null));};exports[_0x0ee5('0x33')]=function(_0x3476e2,_0x173cd5){if(_0x3476e2[_0x0ee5('0x24')]&&_0x3476e2[_0x0ee5('0x24')][_0x0ee5('0x34')]&&_0x3476e2[_0x0ee5('0x35')]&&_0x3476e2[_0x0ee5('0x35')][_0x0ee5('0x12')]){for(var _0x3394f7 in _0x3476e2[_0x0ee5('0x24')][_0x0ee5('0x34')]){if(_0x3476e2[_0x0ee5('0x24')]['interaction'][_0x0ee5('0x36')](_0x3394f7)){db['MemberReport'][_0x0ee5('0x37')]({'where':{'channel':_0x3394f7,'membername':_0x3476e2[_0x0ee5('0x35')][_0x0ee5('0x12')],'type':_0x0ee5('0x38'),'exitAt':null,'uniqueid':_0x3476e2['body'][_0x0ee5('0x34')][_0x3394f7]&&_0x3476e2[_0x0ee5('0x24')]['interaction'][_0x3394f7][_0x0ee5('0x39')]?{'$notIn':_0x3476e2['body']['interaction'][_0x3394f7]}:{'$ne':null}}})[_0x0ee5('0x19')](function(_0x28d6e3){var _0x18f278=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x1111ac=0x0,_0x410429=_0x28d6e3[_0x0ee5('0x39')];_0x1111ac<_0x410429;_0x1111ac+=0x1){_0x28d6e3[_0x1111ac][_0x0ee5('0x3a')]({'exitAt':_0x18f278});}});for(var _0x38f1ec=0x0;_0x38f1ec<_0x3476e2[_0x0ee5('0x24')][_0x0ee5('0x34')][_0x3394f7]['length'];_0x38f1ec+=0x1){db[_0x0ee5('0x3b')][_0x0ee5('0x3c')]({'where':{'channel':_0x3394f7,'membername':_0x3476e2['user'][_0x0ee5('0x12')],'type':_0x0ee5('0x38'),'uniqueid':_0x3476e2[_0x0ee5('0x24')][_0x0ee5('0x34')][_0x3394f7][_0x38f1ec],'exitAt':null},'defaults':{'channel':_0x3394f7,'membername':_0x3476e2[_0x0ee5('0x35')][_0x0ee5('0x12')],'interface':_[_0x0ee5('0x14')](_0x3476e2[_0x0ee5('0x35')][_0x0ee5('0x3d')])?util[_0x0ee5('0x3e')](_0x0ee5('0x3f'),_0x3476e2[_0x0ee5('0x35')]['name']):_0x3476e2[_0x0ee5('0x35')][_0x0ee5('0x3d')],'type':_0x0ee5('0x38'),'enterAt':moment()[_0x0ee5('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3476e2[_0x0ee5('0x35')]['internal'],'uniqueid':_0x3476e2['body'][_0x0ee5('0x34')][_0x3394f7][_0x38f1ec]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3476e2[_0x0ee5('0x1e')]['id'],'capacity':_0x3476e2[_0x0ee5('0x24')][_0x0ee5('0x40')]},routingClient)[_0x0ee5('0x19')](respondWithResult(_0x173cd5,null))[_0x0ee5('0xd')](handleError(_0x173cd5,null));};exports[_0x0ee5('0x41')]=function(_0x317eb5,_0x3359a4){return respondWithRpcPromise(_0x0ee5('0x42'),_0x317eb5[_0x0ee5('0x1d')])[_0x0ee5('0x19')](respondWithResult(_0x3359a4,null))['catch'](handleError(_0x3359a4,null));};exports[_0x0ee5('0x43')]=function(_0x4402ac,_0x20577f){return respondWithRpcPromise(_0x0ee5('0x44'),_0x4402ac[_0x0ee5('0x1d')])['then'](respondWithResult(_0x20577f,null))[_0x0ee5('0xd')](handleError(_0x20577f,null));};exports['campaigns']=function(_0x3a2713,_0xe3749c){return respondWithRpcPromise(_0x0ee5('0x45'),_0x3a2713['query'])['then'](respondWithResult(_0xe3749c,null))[_0x0ee5('0xd')](handleError(_0xe3749c,null));};exports[_0x0ee5('0x46')]=function(_0x146120,_0x195d62){return respondWithRpcPromise(_0x0ee5('0x47'),_0x146120[_0x0ee5('0x1d')],routingClient)['then'](respondWithResult(_0x195d62,null))[_0x0ee5('0xd')](handleError(_0x195d62,null));};exports['showChatQueues']=function(_0x34d78e,_0x3104a9){return respondWithRpcPromise('ChatQueues',_0x34d78e[_0x0ee5('0x1d')],routingClient)['then'](findById(_0x34d78e[_0x0ee5('0x1e')]['id']))[_0x0ee5('0x19')](respondWithResult(_0x3104a9,null))['catch'](handleError(_0x3104a9,null));};exports[_0x0ee5('0x48')]=function(_0x4cfab5,_0x3404f9){return respondWithRpcPromise(_0x0ee5('0x49'),_0x4cfab5['query'],routingClient)[_0x0ee5('0x19')](respondWithResult(_0x3404f9,null))[_0x0ee5('0xd')](handleError(_0x3404f9,null));};exports['showMailQueues']=function(_0x44a1fd,_0x27e1c5){return respondWithRpcPromise(_0x0ee5('0x49'),_0x44a1fd[_0x0ee5('0x1d')],routingClient)[_0x0ee5('0x19')](findById(_0x44a1fd[_0x0ee5('0x1e')]['id']))[_0x0ee5('0x19')](respondWithResult(_0x27e1c5,null))[_0x0ee5('0xd')](handleError(_0x27e1c5,null));};exports[_0x0ee5('0x4a')]=function(_0x1f5eaf,_0x2ec966){return respondWithRpcPromise('MailAccounts',_0x1f5eaf[_0x0ee5('0x1d')],mailClient)['then'](respondWithResult(_0x2ec966,null))['catch'](handleError(_0x2ec966,null));};exports[_0x0ee5('0x4b')]=function(_0x3c7292,_0xdecc95){return respondWithRpcPromise(_0x0ee5('0x4c'),_0x3c7292[_0x0ee5('0x1d')],routingClient)['then'](respondWithResult(_0xdecc95,null))[_0x0ee5('0xd')](handleError(_0xdecc95,null));};exports[_0x0ee5('0x4d')]=function(_0x35e20a,_0x13bb6e){return respondWithRpcPromise(_0x0ee5('0x4c'),_0x35e20a['query'],routingClient)[_0x0ee5('0x19')](findById(_0x35e20a[_0x0ee5('0x1e')]['id']))[_0x0ee5('0x19')](respondWithResult(_0x13bb6e,null))['catch'](handleError(_0x13bb6e,null));};exports['smsQueues']=function(_0x3308df,_0x3adfee){return respondWithRpcPromise(_0x0ee5('0x4e'),_0x3308df[_0x0ee5('0x1d')],routingClient)[_0x0ee5('0x19')](respondWithResult(_0x3adfee,null))[_0x0ee5('0xd')](handleError(_0x3adfee,null));};exports[_0x0ee5('0x4f')]=function(_0x2d1c6a,_0x3d24ac){return respondWithRpcPromise(_0x0ee5('0x4e'),_0x2d1c6a['query'],routingClient)['then'](findById(_0x2d1c6a['params']['id']))[_0x0ee5('0x19')](respondWithResult(_0x3d24ac,null))[_0x0ee5('0xd')](handleError(_0x3d24ac,null));};exports[_0x0ee5('0x50')]=function(_0x2409c6,_0xaa0cd1){return respondWithRpcPromise(_0x0ee5('0x51'),_0x2409c6['query'],routingClient)['then'](respondWithResult(_0xaa0cd1,null))[_0x0ee5('0xd')](handleError(_0xaa0cd1,null));};exports[_0x0ee5('0x52')]=function(_0x2ad8a1,_0x4f7d2c){return respondWithRpcPromise(_0x0ee5('0x51'),_0x2ad8a1[_0x0ee5('0x1d')],routingClient)[_0x0ee5('0x19')](findById(_0x2ad8a1[_0x0ee5('0x1e')]['id']))[_0x0ee5('0x19')](respondWithResult(_0x4f7d2c,null))[_0x0ee5('0xd')](handleError(_0x4f7d2c,null));};exports[_0x0ee5('0x53')]=function(_0x3e9ae6,_0x564b89){return respondWithRpcPromise(_0x0ee5('0x54'),_0x3e9ae6[_0x0ee5('0x1d')],routingClient)['then'](respondWithResult(_0x564b89,null))[_0x0ee5('0xd')](handleError(_0x564b89,null));};exports[_0x0ee5('0x55')]=function(_0x473483,_0x440833){return respondWithRpcPromise(_0x0ee5('0x54'),_0x473483[_0x0ee5('0x1d')],routingClient)[_0x0ee5('0x19')](findById(_0x473483[_0x0ee5('0x1e')]['id']))['then'](respondWithResult(_0x440833,null))[_0x0ee5('0xd')](handleError(_0x440833,null));};exports[_0x0ee5('0x56')]=function(_0x1b7ab4,_0x5078a8){return respondWithRpcPromise(_0x0ee5('0x57'),_0x1b7ab4['query'])[_0x0ee5('0x19')](respondWithResult(_0x5078a8,null))[_0x0ee5('0xd')](handleError(_0x5078a8,null));};exports[_0x0ee5('0x58')]=function(_0x233f3b,_0x3fb342){return respondWithRpcPromise(_0x0ee5('0x59'),_0x233f3b[_0x0ee5('0x1d')],routingClient)[_0x0ee5('0x19')](respondWithResult(_0x3fb342,null))[_0x0ee5('0xd')](handleError(_0x3fb342,null));};exports[_0x0ee5('0x5a')]=function(_0x29241b,_0x435a9c){return respondWithRpcPromise(_0x0ee5('0x5b'),_0x29241b[_0x0ee5('0x1d')],routingClient)[_0x0ee5('0x19')](respondWithResult(_0x435a9c,null))[_0x0ee5('0xd')](handleError(_0x435a9c,null));};exports[_0x0ee5('0x5c')]=function(_0x22cba3,_0x3a51d1){return respondWithRpcPromise(_0x0ee5('0x5d'),_0x22cba3[_0x0ee5('0x1d')],routingClient)['then'](respondWithResult(_0x3a51d1,null))['catch'](handleError(_0x3a51d1,null));};exports[_0x0ee5('0x5e')]=function(_0x384984,_0x52b525){return respondWithRpcPromise(_0x0ee5('0x5d'),_0x384984[_0x0ee5('0x1d')],routingClient)[_0x0ee5('0x19')](function(_0x55ab4c){if(_0x384984[_0x0ee5('0x1d')][_0x0ee5('0x5f')]!==undefined){var _0x3850b6=_(_0x55ab4c[_0x0ee5('0x15')])[_0x0ee5('0x60')]([_0x384984['query'][_0x0ee5('0x5f')],_0x384984[_0x0ee5('0x1e')]['id']])['map'](_0x0ee5('0x61'))['uniq']()[_0x0ee5('0x62')]();return _0x55ab4c['rows'][_0x0ee5('0x60')](function(_0x594039){return _0x3850b6['indexOf'](_0x594039[_0x0ee5('0x61')])>-0x1;});}else{return _0x55ab4c[_0x0ee5('0x15')][_0x0ee5('0x60')](function(_0x5d3eaa){return _0x5d3eaa[_0x0ee5('0x61')]===parseInt(_0x384984[_0x0ee5('0x1e')]['id']);});}})[_0x0ee5('0x19')](respondWithResult(_0x52b525,null))[_0x0ee5('0xd')](handleError(_0x52b525,null));};exports[_0x0ee5('0x63')]=function(_0x5ec531,_0x1449b4){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x5ec531[_0x0ee5('0x1d')],routingClient)[_0x0ee5('0x19')](respondWithResult(_0x1449b4,null))[_0x0ee5('0xd')](handleError(_0x1449b4,null));};exports[_0x0ee5('0x64')]=function(_0xab76e4,_0xca032c){return respondWithRpcPromise(_0x0ee5('0x65'),_0xab76e4[_0x0ee5('0x1d')],routingClient)[_0x0ee5('0x19')](respondWithResult(_0xca032c,null))[_0x0ee5('0xd')](handleError(_0xca032c,null));};exports[_0x0ee5('0x66')]=function(_0x21c41a,_0x44da48){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x21c41a[_0x0ee5('0x1d')],routingClient)['then'](respondWithResult(_0x44da48,null))[_0x0ee5('0xd')](handleError(_0x44da48,null));};exports[_0x0ee5('0x67')]=function(_0x102c91){return function(_0x2cbbe1,_0x50cf00){var _0x8caa80,_0x399838;var _0x50caea=_[_0x0ee5('0x68')](_0x102c91);var _0x2e1d7d=_0x102c91===_0x0ee5('0x69')?_0x0ee5('0x6a'):'Account';return db[_0x50caea+_0x0ee5('0x6b')][_0x0ee5('0x6c')]({'raw':!![],'where':{'id':_0x2cbbe1[_0x0ee5('0x1e')]['id']}})[_0x0ee5('0x19')](function(_0x5a0a0b){if(_['isNil'](_0x5a0a0b)){throw new Error(_0x50caea+_0x0ee5('0x6d'));}_0x8caa80=_0x5a0a0b;return db[_0x50caea+_0x0ee5('0x6e')][_0x0ee5('0x6c')]({'where':{'id':_0x2cbbe1[_0x0ee5('0x24')][_0x0ee5('0x6f')]},'include':[{'model':db[_0x50caea+_0x0ee5('0x70')],'as':'Interaction'},{'model':db[_0x50caea+_0x2e1d7d],'as':_0x0ee5('0x71')}]});})[_0x0ee5('0x19')](function(_0x4bcb21){if(_[_0x0ee5('0x14')](_0x4bcb21)){throw new Error(_0x50caea+_0x0ee5('0x72'));}_0x399838=_0x4bcb21;return _0x4bcb21[_0x0ee5('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0ee5('0x19')](function(){var _0x2e9d25={'uniqueid':_0x102c91+'.'+_0x399838['id']+'.'+_0x399838[_0x0ee5('0x70')]['id'],'FromUserId':_0x2cbbe1[_0x0ee5('0x35')]['id'],'type':_0x0ee5('0x74')};_0x2e9d25[_0x50caea+'MessageId']=_0x399838['id'];_0x2e9d25[_0x50caea+_0x0ee5('0x75')]=_0x399838[_0x0ee5('0x70')]['id'];_0x2e9d25[_0x0ee5('0x76')+_0x50caea+_0x2e1d7d+'Id']=_0x399838['Account']['id'];_0x2e9d25['To'+_0x50caea+_0x0ee5('0x77')]=_0x8caa80['id'];return db[_0x50caea+_0x0ee5('0x78')][_0x0ee5('0x79')](_0x2e9d25);})[_0x0ee5('0x19')](function(){return respondWithRpcPromise('Start',{'channel':_0x102c91,'interaction':_0x399838[_0x0ee5('0x70')],'message':_0x399838,'account':_0x399838['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x0ee5('0x74'),'appdata':_0x8caa80['name']+','+(_0x399838[_0x0ee5('0x71')]['queueTransferTimeout']||0x12c),'interval':_0x0ee5('0x7a')}]},routingClient);})[_0x0ee5('0x19')](respondWithResult(_0x50cf00,null))['catch'](handleError(_0x50cf00,null));};};exports[_0x0ee5('0x7b')]=function(_0x2bd4b0,_0x1faf71){var _0x4dcc9f,_0x18fd82;if(_['isNil'](_0x2bd4b0[_0x0ee5('0x24')][_0x0ee5('0x7c')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x220e2b=_0x2bd4b0['body'][_0x0ee5('0x7c')];var _0x178ec1=_[_0x0ee5('0x68')](_0x220e2b);var _0x26dfc7=_0x220e2b===_0x0ee5('0x69')?_0x0ee5('0x6a'):_0x0ee5('0x71');return db[_0x0ee5('0x7d')][_0x0ee5('0x6c')]({'raw':!![],'where':{'id':_0x2bd4b0[_0x0ee5('0x1e')]['id'],'role':_0x0ee5('0x7e')}})[_0x0ee5('0x19')](function(_0x4ed95c){if(_['isNil'](_0x4ed95c)){throw new Error(_0x0ee5('0x7f'));}_0x4dcc9f=_0x4ed95c;return db[_0x178ec1+_0x0ee5('0x6e')][_0x0ee5('0x6c')]({'where':{'id':_0x2bd4b0[_0x0ee5('0x24')]['messageId']},'include':[{'model':db[_0x178ec1+_0x0ee5('0x70')],'as':'Interaction'},{'model':db[_0x178ec1+_0x26dfc7],'as':_0x0ee5('0x71')}]});})[_0x0ee5('0x19')](function(_0x1d8b4b){if(_['isNil'](_0x1d8b4b)){throw new Error(_0x178ec1+_0x0ee5('0x72'));}_0x18fd82=_0x1d8b4b;return _0x1d8b4b['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x0ee5('0x19')](function(){var _0xff56cd={'uniqueid':_0x220e2b+'.'+_0x18fd82['id']+'.'+_0x18fd82[_0x0ee5('0x70')]['id'],'FromUserId':_0x2bd4b0[_0x0ee5('0x35')]['id'],'type':_0x0ee5('0x7e'),'ToUserId':_0x4dcc9f['id']};_0xff56cd[_0x178ec1+_0x0ee5('0x80')]=_0x18fd82['id'];_0xff56cd[_0x178ec1+_0x0ee5('0x75')]=_0x18fd82[_0x0ee5('0x70')]['id'];_0xff56cd[_0x0ee5('0x76')+_0x178ec1+_0x26dfc7+'Id']=_0x18fd82[_0x0ee5('0x71')]['id'];return db[_0x178ec1+'TransferReport']['create'](_0xff56cd);})[_0x0ee5('0x19')](function(){return respondWithRpcPromise(_0x0ee5('0x81'),{'channel':_0x220e2b,'interaction':_0x18fd82['Interaction'],'message':_0x18fd82,'account':_0x18fd82[_0x0ee5('0x71')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0ee5('0x7e'),'appdata':_0x4dcc9f[_0x0ee5('0x12')]+','+(_0x18fd82[_0x0ee5('0x71')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x0ee5('0x19')](respondWithResult(_0x1faf71,null))[_0x0ee5('0xd')](handleError(_0x1faf71,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 759fd22..47bcbfd 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 _0xb6fe=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','/:id','isAuthenticated','show','run','post','put'];(function(_0x1e6bdf,_0x2b8e95){var _0x327d8e=function(_0x95af53){while(--_0x95af53){_0x1e6bdf['push'](_0x1e6bdf['shift']());}};_0x327d8e(++_0x2b8e95);}(_0xb6fe,0x1dc));var _0xeb6f=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xb6fe[_0x382e89];return _0x3a1318;};'use strict';var multer=require(_0xeb6f('0x0'));var util=require(_0xeb6f('0x1'));var path=require(_0xeb6f('0x2'));var timeout=require(_0xeb6f('0x3'));var express=require(_0xeb6f('0x4'));var router=express[_0xeb6f('0x5')]();var fs_extra=require(_0xeb6f('0x6'));var auth=require(_0xeb6f('0x7'));var interaction=require(_0xeb6f('0x8'));var config=require(_0xeb6f('0x9'));var controller=require(_0xeb6f('0xa'));router[_0xeb6f('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeb6f('0xb')](_0xeb6f('0xc'),auth[_0xeb6f('0xd')](),controller[_0xeb6f('0xe')]);router['get']('/:id/run',auth[_0xeb6f('0xd')](),controller[_0xeb6f('0xf')]);router[_0xeb6f('0x10')]('/',auth[_0xeb6f('0xd')](),controller['create']);router[_0xeb6f('0x11')](_0xeb6f('0xc'),auth[_0xeb6f('0xd')](),controller['update']);router['delete'](_0xeb6f('0xc'),auth[_0xeb6f('0xd')](),controller[_0xeb6f('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc0e2=['index','/:id','/:id/run','post','create','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated'];(function(_0x20e1e0,_0x418bb5){var _0x21954d=function(_0x3ea7f0){while(--_0x3ea7f0){_0x20e1e0['push'](_0x20e1e0['shift']());}};_0x21954d(++_0x418bb5);}(_0xc0e2,0x15c));var _0x2c0e=function(_0x335175,_0x2349bd){_0x335175=_0x335175-0x0;var _0x199fdc=_0xc0e2[_0x335175];return _0x199fdc;};'use strict';var multer=require(_0x2c0e('0x0'));var util=require('util');var path=require(_0x2c0e('0x1'));var timeout=require(_0x2c0e('0x2'));var express=require(_0x2c0e('0x3'));var router=express[_0x2c0e('0x4')]();var fs_extra=require(_0x2c0e('0x5'));var auth=require(_0x2c0e('0x6'));var interaction=require(_0x2c0e('0x7'));var config=require(_0x2c0e('0x8'));var controller=require(_0x2c0e('0x9'));router[_0x2c0e('0xa')]('/',auth[_0x2c0e('0xb')](),controller[_0x2c0e('0xc')]);router[_0x2c0e('0xa')](_0x2c0e('0xd'),auth[_0x2c0e('0xb')](),controller['show']);router[_0x2c0e('0xa')](_0x2c0e('0xe'),auth[_0x2c0e('0xb')](),controller['run']);router[_0x2c0e('0xf')]('/',auth[_0x2c0e('0xb')](),controller[_0x2c0e('0x10')]);router[_0x2c0e('0x11')](_0x2c0e('0xd'),auth['isAuthenticated'](),controller[_0x2c0e('0x12')]);router['delete']('/:id',auth[_0x2c0e('0xb')](),controller['destroy']);module[_0x2c0e('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 31e02f1..106abc7 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 _0x8535=['pdf','custom','BOOLEAN','TEXT','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','weeks','days','hours','csv'];(function(_0x58772f,_0x1df712){var _0x296f87=function(_0x7ac19a){while(--_0x7ac19a){_0x58772f['push'](_0x58772f['shift']());}};_0x296f87(++_0x1df712);}(_0x8535,0x114));var _0x5853=function(_0x36f4f0,_0x3a822f){_0x36f4f0=_0x36f4f0-0x0;var _0x3066df=_0x8535[_0x36f4f0];return _0x3066df;};'use strict';var Sequelize=require('sequelize');module[_0x5853('0x0')]={'name':{'type':Sequelize[_0x5853('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5853('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5853('0x1')],'allowNull':![],'defaultValue':_0x5853('0x2')},'startAt':{'type':Sequelize[_0x5853('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x5853('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x5853('0x5')]('years',_0x5853('0x6'),_0x5853('0x7'),_0x5853('0x8'),_0x5853('0x9'),_0x5853('0xa'),'minutes'),'allowNull':![],'defaultValue':_0x5853('0x9')},'output':{'type':Sequelize[_0x5853('0x5')](_0x5853('0xb'),_0x5853('0xc'),'xlsx'),'allowNull':![],'defaultValue':_0x5853('0xb')},'type':{'type':Sequelize[_0x5853('0x5')](_0x5853('0xd'),'default'),'allowNull':![],'defaultValue':_0x5853('0xd')},'sendMail':{'type':Sequelize[_0x5853('0xe')],'defaultValue':![]},'email':{'type':Sequelize[_0x5853('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x5853('0xf')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xbd00=['ENUM','years','months','weeks','days','minutes','csv','pdf','xlsx','custom','TEXT','sequelize','exports','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE'];(function(_0x4cff28,_0x39ea1f){var _0xa08e9c=function(_0x3f1fb6){while(--_0x3f1fb6){_0x4cff28['push'](_0x4cff28['shift']());}};_0xa08e9c(++_0x39ea1f);}(_0xbd00,0x1e7));var _0x0bd0=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0xbd00[_0x1ccbcc];return _0x1e873f;};'use strict';var Sequelize=require(_0x0bd0('0x0'));module[_0x0bd0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0bd0('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x0bd0('0x3')],'allowNull':![],'defaultValue':_0x0bd0('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x0bd0('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x0bd0('0x6')](_0x0bd0('0x7'),'quarters',_0x0bd0('0x8'),_0x0bd0('0x9'),_0x0bd0('0xa'),'hours',_0x0bd0('0xb')),'allowNull':![],'defaultValue':_0x0bd0('0xa')},'output':{'type':Sequelize[_0x0bd0('0x6')](_0x0bd0('0xc'),_0x0bd0('0xd'),_0x0bd0('0xe')),'allowNull':![],'defaultValue':_0x0bd0('0xc')},'type':{'type':Sequelize[_0x0bd0('0x6')](_0x0bd0('0xf'),'default'),'allowNull':![],'defaultValue':_0x0bd0('0xf')},'sendMail':{'type':Sequelize[_0x0bd0('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x0bd0('0x3')]},'cc':{'type':Sequelize[_0x0bd0('0x10')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x0bd0('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index d720d78..dc6ea6b 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 _0xcf76=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','get','Scheduler','UserProfileResource','then','stack','name','index','Schedule','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId'];(function(_0x3ee6d4,_0x44243f){var _0x377e7c=function(_0x51deb3){while(--_0x51deb3){_0x3ee6d4['push'](_0x3ee6d4['shift']());}};_0x377e7c(++_0x44243f);}(_0xcf76,0xff));var _0x6cf7=function(_0x4d8734,_0x4817bb){_0x4d8734=_0x4d8734-0x0;var _0x4a9e6d=_0xcf76[_0x4d8734];return _0x4a9e6d;};'use strict';var emlformat=require(_0x6cf7('0x0'));var rimraf=require(_0x6cf7('0x1'));var zipdir=require(_0x6cf7('0x2'));var jsonpatch=require(_0x6cf7('0x3'));var rp=require('request-promise');var moment=require(_0x6cf7('0x4'));var BPromise=require(_0x6cf7('0x5'));var Mustache=require(_0x6cf7('0x6'));var util=require(_0x6cf7('0x7'));var path=require(_0x6cf7('0x8'));var sox=require(_0x6cf7('0x9'));var csv=require(_0x6cf7('0xa'));var ejs=require(_0x6cf7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cf7('0xc'));var squel=require(_0x6cf7('0xd'));var crypto=require('crypto');var jsforce=require(_0x6cf7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6cf7('0xa'));var querystring=require(_0x6cf7('0xf'));var Papa=require(_0x6cf7('0x10'));var Redis=require('ioredis');var authService=require(_0x6cf7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6cf7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6cf7('0x13'));var utils=require(_0x6cf7('0x14'));var config=require(_0x6cf7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6cf7('0x16'))['db'];function respondWithStatusCode(_0x49f316,_0x1d21f9){_0x1d21f9=_0x1d21f9||0xcc;return function(_0x101f97){if(_0x101f97){return _0x49f316[_0x6cf7('0x17')](_0x1d21f9);}return _0x49f316[_0x6cf7('0x18')](_0x1d21f9)[_0x6cf7('0x19')]();};}function respondWithResult(_0x5bad31,_0x4382e2){_0x4382e2=_0x4382e2||0xc8;return function(_0x296477){if(_0x296477){return _0x5bad31['status'](_0x4382e2)[_0x6cf7('0x1a')](_0x296477);}};}function respondWithFilteredResult(_0x3e5607,_0x3dda46){return function(_0x5c2e50){if(_0x5c2e50){var _0x227dc8=typeof _0x3dda46[_0x6cf7('0x1b')]===_0x6cf7('0x1c')&&typeof _0x3dda46[_0x6cf7('0x1d')]===_0x6cf7('0x1c');var _0x225b51=_0x5c2e50[_0x6cf7('0x1e')];var _0x27e3c8=_0x227dc8?0x0:_0x3dda46[_0x6cf7('0x1b')];var _0x527d5a=_0x227dc8?_0x5c2e50[_0x6cf7('0x1e')]:_0x3dda46['offset']+_0x3dda46[_0x6cf7('0x1d')];var _0x9429c0;if(_0x527d5a>=_0x225b51){_0x527d5a=_0x225b51;_0x9429c0=0xc8;}else{_0x9429c0=0xce;}_0x3e5607['status'](_0x9429c0);return _0x3e5607['set']('Content-Range',_0x27e3c8+'-'+_0x527d5a+'/'+_0x225b51)['json'](_0x5c2e50);}return null;};}function patchUpdates(_0x5df7e0){return function(_0x9b3b17){try{jsonpatch[_0x6cf7('0x1f')](_0x9b3b17,_0x5df7e0,!![]);}catch(_0xcfb5ce){return BPromise[_0x6cf7('0x20')](_0xcfb5ce);}return _0x9b3b17[_0x6cf7('0x21')]();};}function saveUpdates(_0x2d6328,_0x3ffa3b){return function(_0x1819a1){if(_0x1819a1){return _0x1819a1[_0x6cf7('0x22')](_0x2d6328)['then'](function(_0x2761cd){return _0x2761cd;});}return null;};}function removeEntity(_0x23c8cc,_0x19015f){return function(_0x17ad12){if(_0x17ad12){return _0x17ad12['destroy']()['then'](function(){var _0x1bd215=_0x17ad12[_0x6cf7('0x23')]({'plain':!![]});var _0x46eee1=_0x6cf7('0x24');return db[_0x6cf7('0x25')]['destroy']({'where':{'type':_0x46eee1,'resourceId':_0x1bd215['id']}})['then'](function(){return _0x17ad12;});})[_0x6cf7('0x26')](function(){_0x23c8cc['status'](0xcc)[_0x6cf7('0x19')]();});}};}function handleEntityNotFound(_0x3718ff,_0x28dcff){return function(_0x447e62){if(!_0x447e62){_0x3718ff[_0x6cf7('0x17')](0x194);}return _0x447e62;};}function handleError(_0x11615d,_0x205f9f){_0x205f9f=_0x205f9f||0x1f4;return function(_0x28717e){logger['error'](_0x28717e[_0x6cf7('0x27')]);if(_0x28717e[_0x6cf7('0x28')]){delete _0x28717e[_0x6cf7('0x28')];}_0x11615d['status'](_0x205f9f)['send'](_0x28717e);};}exports[_0x6cf7('0x29')]=function(_0x5e685d,_0xfbd1fc){var _0x188132={},_0x343bc6={},_0x1f8d8e={'count':0x0,'rows':[]};var _0x353f9b=_['map'](db[_0x6cf7('0x2a')]['rawAttributes'],function(_0x8df79c){return{'name':_0x8df79c[_0x6cf7('0x2b')],'type':_0x8df79c[_0x6cf7('0x2c')][_0x6cf7('0x2d')]};});_0x343bc6[_0x6cf7('0x2e')]=_[_0x6cf7('0x2f')](_0x353f9b,_0x6cf7('0x28'));_0x343bc6[_0x6cf7('0x30')]=_[_0x6cf7('0x31')](_0x5e685d[_0x6cf7('0x30')]);_0x343bc6[_0x6cf7('0x32')]=_[_0x6cf7('0x33')](_0x343bc6[_0x6cf7('0x2e')],_0x343bc6[_0x6cf7('0x30')]);_0x188132[_0x6cf7('0x34')]=_[_0x6cf7('0x33')](_0x343bc6[_0x6cf7('0x2e')],qs[_0x6cf7('0x35')](_0x5e685d[_0x6cf7('0x30')][_0x6cf7('0x35')]));_0x188132[_0x6cf7('0x34')]=_0x188132[_0x6cf7('0x34')][_0x6cf7('0x36')]?_0x188132['attributes']:_0x343bc6[_0x6cf7('0x2e')];if(!_0x5e685d[_0x6cf7('0x30')][_0x6cf7('0x37')](_0x6cf7('0x38'))){_0x188132[_0x6cf7('0x1d')]=qs[_0x6cf7('0x1d')](_0x5e685d[_0x6cf7('0x30')][_0x6cf7('0x1d')]);_0x188132['offset']=qs[_0x6cf7('0x1b')](_0x5e685d['query']['offset']);}_0x188132[_0x6cf7('0x39')]=qs[_0x6cf7('0x3a')](_0x5e685d[_0x6cf7('0x30')]['sort']);_0x188132[_0x6cf7('0x3b')]=qs[_0x6cf7('0x32')](_['pick'](_0x5e685d[_0x6cf7('0x30')],_0x343bc6[_0x6cf7('0x32')]),_0x353f9b);if(_0x5e685d[_0x6cf7('0x30')][_0x6cf7('0x3c')]){_0x188132[_0x6cf7('0x3b')]=_['merge'](_0x188132[_0x6cf7('0x3b')],{'$or':_[_0x6cf7('0x2f')](_0x353f9b,function(_0x479cac){if(_0x479cac[_0x6cf7('0x2c')]!==_0x6cf7('0x3d')){var _0x439b7c={};_0x439b7c[_0x479cac[_0x6cf7('0x28')]]={'$like':'%'+_0x5e685d[_0x6cf7('0x30')][_0x6cf7('0x3c')]+'%'};return _0x439b7c;}})});}_0x188132=_[_0x6cf7('0x3e')]({},_0x188132,_0x5e685d['options']);var _0x2a76f1={'where':_0x188132[_0x6cf7('0x3b')]};return db[_0x6cf7('0x2a')]['count'](_0x2a76f1)[_0x6cf7('0x26')](function(_0x58e812){_0x1f8d8e[_0x6cf7('0x1e')]=_0x58e812;if(_0x5e685d[_0x6cf7('0x30')][_0x6cf7('0x3f')]){_0x188132[_0x6cf7('0x40')]=[{'all':!![]}];}return db[_0x6cf7('0x2a')][_0x6cf7('0x41')](_0x188132);})[_0x6cf7('0x26')](function(_0xe970b4){_0x1f8d8e[_0x6cf7('0x42')]=_0xe970b4;return _0x1f8d8e;})[_0x6cf7('0x26')](respondWithFilteredResult(_0xfbd1fc,_0x188132))[_0x6cf7('0x43')](handleError(_0xfbd1fc,null));};exports['show']=function(_0x5d152e,_0x394062){var _0x4df61e={'raw':![],'where':{'id':_0x5d152e[_0x6cf7('0x44')]['id']}},_0x25633e={};_0x25633e[_0x6cf7('0x2e')]=_['keys'](db[_0x6cf7('0x2a')][_0x6cf7('0x45')]);_0x25633e[_0x6cf7('0x30')]=_[_0x6cf7('0x31')](_0x5d152e[_0x6cf7('0x30')]);_0x25633e[_0x6cf7('0x32')]=_[_0x6cf7('0x33')](_0x25633e[_0x6cf7('0x2e')],_0x25633e[_0x6cf7('0x30')]);_0x4df61e[_0x6cf7('0x34')]=_[_0x6cf7('0x33')](_0x25633e[_0x6cf7('0x2e')],qs['fields'](_0x5d152e['query'][_0x6cf7('0x35')]));_0x4df61e[_0x6cf7('0x34')]=_0x4df61e[_0x6cf7('0x34')]['length']?_0x4df61e[_0x6cf7('0x34')]:_0x25633e[_0x6cf7('0x2e')];if(_0x5d152e[_0x6cf7('0x30')][_0x6cf7('0x3f')]){_0x4df61e['include']=[{'all':!![]}];}_0x4df61e=_[_0x6cf7('0x3e')]({},_0x4df61e,_0x5d152e[_0x6cf7('0x46')]);return db[_0x6cf7('0x2a')][_0x6cf7('0x47')](_0x4df61e)[_0x6cf7('0x26')](handleEntityNotFound(_0x394062,null))['then'](respondWithResult(_0x394062,null))[_0x6cf7('0x43')](handleError(_0x394062,null));};exports[_0x6cf7('0x48')]=function(_0x4b5388,_0x2a2e83){return db[_0x6cf7('0x2a')][_0x6cf7('0x48')](_0x4b5388['body'],{})[_0x6cf7('0x26')](function(_0x101dce){var _0x4de190=_0x4b5388[_0x6cf7('0x49')][_0x6cf7('0x23')]({'plain':!![]});if(!_0x4de190)throw new Error(_0x6cf7('0x4a'));if(_0x4de190['role']==='user'){var _0x3b0a84=_0x101dce[_0x6cf7('0x23')]({'plain':!![]});var _0x6eb9cd=_0x6cf7('0x24');return db[_0x6cf7('0x4b')][_0x6cf7('0x47')]({'where':{'name':_0x6eb9cd,'userProfileId':_0x4de190[_0x6cf7('0x4c')]},'raw':!![]})[_0x6cf7('0x26')](function(_0x2008d2){if(_0x2008d2&&_0x2008d2['autoAssociation']===0x0){return db['UserProfileResource'][_0x6cf7('0x48')]({'name':_0x3b0a84['name'],'resourceId':_0x3b0a84['id'],'type':_0x2008d2[_0x6cf7('0x28')],'sectionId':_0x2008d2['id']},{})[_0x6cf7('0x26')](function(){return _0x101dce;});}else{return _0x101dce;}})['catch'](function(_0x58f986){logger[_0x6cf7('0x4d')](_0x6cf7('0x4e'),_0x58f986);throw _0x58f986;});}return _0x101dce;})[_0x6cf7('0x26')](respondWithResult(_0x2a2e83,0xc9))[_0x6cf7('0x43')](handleError(_0x2a2e83,null));};exports[_0x6cf7('0x22')]=function(_0x127275,_0x268f54){if(_0x127275[_0x6cf7('0x4f')]['id']){delete _0x127275[_0x6cf7('0x4f')]['id'];}return db[_0x6cf7('0x2a')][_0x6cf7('0x47')]({'where':{'id':_0x127275[_0x6cf7('0x44')]['id']}})[_0x6cf7('0x26')](handleEntityNotFound(_0x268f54,null))[_0x6cf7('0x26')](saveUpdates(_0x127275[_0x6cf7('0x4f')],null))[_0x6cf7('0x26')](respondWithResult(_0x268f54,null))[_0x6cf7('0x43')](handleError(_0x268f54,null));};exports[_0x6cf7('0x50')]=function(_0x2665a5,_0x17468d){return db[_0x6cf7('0x2a')][_0x6cf7('0x47')]({'where':{'id':_0x2665a5['params']['id']}})[_0x6cf7('0x26')](handleEntityNotFound(_0x17468d,null))[_0x6cf7('0x26')](removeEntity(_0x17468d,null))['catch'](handleError(_0x17468d,null));};exports[_0x6cf7('0x51')]=function(_0x29a0ca,_0x5494e1,_0x31b67c){var _0x5d1810=require(_0x6cf7('0x52'));return db[_0x6cf7('0x2a')][_0x6cf7('0x47')]({'where':{'id':_0x29a0ca[_0x6cf7('0x44')]['id']},'raw':!![]})[_0x6cf7('0x26')](handleEntityNotFound(_0x5494e1,null))[_0x6cf7('0x26')](function(){_0x5d1810[_0x6cf7('0x51')](_0x29a0ca[_0x6cf7('0x44')]['id']);})[_0x6cf7('0x26')](respondWithStatusCode(_0x5494e1,null))[_0x6cf7('0x43')](handleError(_0x5494e1,null));}; \ No newline at end of file +var _0x2e68=['mustache','util','path','sox','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','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','update','then','destroy','get','error','stack','name','send','Schedule','rawAttributes','fieldName','model','map','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3f7074,_0x44cd21){var _0x416965=function(_0x38cffe){while(--_0x38cffe){_0x3f7074['push'](_0x3f7074['shift']());}};_0x416965(++_0x44cd21);}(_0x2e68,0xfe));var _0x82e6=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x2e68[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0x82e6('0x0'));var rimraf=require(_0x82e6('0x1'));var zipdir=require(_0x82e6('0x2'));var jsonpatch=require(_0x82e6('0x3'));var rp=require(_0x82e6('0x4'));var moment=require(_0x82e6('0x5'));var BPromise=require(_0x82e6('0x6'));var Mustache=require(_0x82e6('0x7'));var util=require(_0x82e6('0x8'));var path=require(_0x82e6('0x9'));var sox=require(_0x82e6('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82e6('0xb'));var _=require(_0x82e6('0xc'));var squel=require(_0x82e6('0xd'));var crypto=require(_0x82e6('0xe'));var jsforce=require(_0x82e6('0xf'));var deskjs=require(_0x82e6('0x10'));var toCsv=require('to-csv');var querystring=require(_0x82e6('0x11'));var Papa=require(_0x82e6('0x12'));var Redis=require(_0x82e6('0x13'));var authService=require(_0x82e6('0x14'));var qs=require(_0x82e6('0x15'));var as=require(_0x82e6('0x16'));var hardwareService=require(_0x82e6('0x17'));var logger=require(_0x82e6('0x18'))(_0x82e6('0x19'));var utils=require(_0x82e6('0x1a'));var config=require(_0x82e6('0x1b'));var licenseUtil=require(_0x82e6('0x1c'));var db=require(_0x82e6('0x1d'))['db'];function respondWithStatusCode(_0x316868,_0x55136b){_0x55136b=_0x55136b||0xcc;return function(_0x35dc57){if(_0x35dc57){return _0x316868[_0x82e6('0x1e')](_0x55136b);}return _0x316868['status'](_0x55136b)[_0x82e6('0x1f')]();};}function respondWithResult(_0x3c4322,_0x534113){_0x534113=_0x534113||0xc8;return function(_0x21613a){if(_0x21613a){return _0x3c4322['status'](_0x534113)['json'](_0x21613a);}};}function respondWithFilteredResult(_0x250206,_0x10dc5a){return function(_0x38bff9){if(_0x38bff9){var _0x1e94f0=typeof _0x10dc5a[_0x82e6('0x20')]===_0x82e6('0x21')&&typeof _0x10dc5a[_0x82e6('0x22')]==='undefined';var _0x531b38=_0x38bff9[_0x82e6('0x23')];var _0x5cc071=_0x1e94f0?0x0:_0x10dc5a[_0x82e6('0x20')];var _0x368814=_0x1e94f0?_0x38bff9['count']:_0x10dc5a[_0x82e6('0x20')]+_0x10dc5a['limit'];var _0x2712be;if(_0x368814>=_0x531b38){_0x368814=_0x531b38;_0x2712be=0xc8;}else{_0x2712be=0xce;}_0x250206[_0x82e6('0x24')](_0x2712be);return _0x250206[_0x82e6('0x25')](_0x82e6('0x26'),_0x5cc071+'-'+_0x368814+'/'+_0x531b38)[_0x82e6('0x27')](_0x38bff9);}return null;};}function patchUpdates(_0x271b6f){return function(_0x44500d){try{jsonpatch[_0x82e6('0x28')](_0x44500d,_0x271b6f,!![]);}catch(_0x9ccc2e){return BPromise[_0x82e6('0x29')](_0x9ccc2e);}return _0x44500d['save']();};}function saveUpdates(_0x286d46,_0x140f47){return function(_0x233886){if(_0x233886){return _0x233886[_0x82e6('0x2a')](_0x286d46)[_0x82e6('0x2b')](function(_0x49d692){return _0x49d692;});}return null;};}function removeEntity(_0x39c482,_0x45d157){return function(_0x23661a){if(_0x23661a){return _0x23661a[_0x82e6('0x2c')]()['then'](function(){var _0x41f859=_0x23661a[_0x82e6('0x2d')]({'plain':!![]});var _0x2a6438='Scheduler';return db['UserProfileResource'][_0x82e6('0x2c')]({'where':{'type':_0x2a6438,'resourceId':_0x41f859['id']}})[_0x82e6('0x2b')](function(){return _0x23661a;});})[_0x82e6('0x2b')](function(){_0x39c482['status'](0xcc)[_0x82e6('0x1f')]();});}};}function handleEntityNotFound(_0x45675f,_0x59e778){return function(_0x1c6feb){if(!_0x1c6feb){_0x45675f['sendStatus'](0x194);}return _0x1c6feb;};}function handleError(_0x19f4cd,_0x30710d){_0x30710d=_0x30710d||0x1f4;return function(_0x14c0e5){logger[_0x82e6('0x2e')](_0x14c0e5[_0x82e6('0x2f')]);if(_0x14c0e5[_0x82e6('0x30')]){delete _0x14c0e5[_0x82e6('0x30')];}_0x19f4cd[_0x82e6('0x24')](_0x30710d)[_0x82e6('0x31')](_0x14c0e5);};}exports['index']=function(_0x537255,_0x5d3668){var _0x50f4d3={},_0x29756c={},_0x3b633c={'count':0x0,'rows':[]};var _0x55a5dd=_['map'](db[_0x82e6('0x32')][_0x82e6('0x33')],function(_0x22b13e){return{'name':_0x22b13e[_0x82e6('0x34')],'type':_0x22b13e['type']['key']};});_0x29756c[_0x82e6('0x35')]=_[_0x82e6('0x36')](_0x55a5dd,_0x82e6('0x30'));_0x29756c[_0x82e6('0x37')]=_[_0x82e6('0x38')](_0x537255[_0x82e6('0x37')]);_0x29756c[_0x82e6('0x39')]=_[_0x82e6('0x3a')](_0x29756c[_0x82e6('0x35')],_0x29756c[_0x82e6('0x37')]);_0x50f4d3['attributes']=_[_0x82e6('0x3a')](_0x29756c[_0x82e6('0x35')],qs['fields'](_0x537255[_0x82e6('0x37')][_0x82e6('0x3b')]));_0x50f4d3[_0x82e6('0x3c')]=_0x50f4d3[_0x82e6('0x3c')][_0x82e6('0x3d')]?_0x50f4d3[_0x82e6('0x3c')]:_0x29756c[_0x82e6('0x35')];if(!_0x537255[_0x82e6('0x37')]['hasOwnProperty']('nolimit')){_0x50f4d3[_0x82e6('0x22')]=qs[_0x82e6('0x22')](_0x537255[_0x82e6('0x37')][_0x82e6('0x22')]);_0x50f4d3[_0x82e6('0x20')]=qs['offset'](_0x537255[_0x82e6('0x37')][_0x82e6('0x20')]);}_0x50f4d3['order']=qs[_0x82e6('0x3e')](_0x537255[_0x82e6('0x37')][_0x82e6('0x3e')]);_0x50f4d3[_0x82e6('0x3f')]=qs[_0x82e6('0x39')](_[_0x82e6('0x40')](_0x537255[_0x82e6('0x37')],_0x29756c[_0x82e6('0x39')]),_0x55a5dd);if(_0x537255[_0x82e6('0x37')][_0x82e6('0x41')]){_0x50f4d3['where']=_[_0x82e6('0x42')](_0x50f4d3['where'],{'$or':_[_0x82e6('0x36')](_0x55a5dd,function(_0x49d8f4){if(_0x49d8f4[_0x82e6('0x43')]!==_0x82e6('0x44')){var _0x5152a5={};_0x5152a5[_0x49d8f4[_0x82e6('0x30')]]={'$like':'%'+_0x537255['query'][_0x82e6('0x41')]+'%'};return _0x5152a5;}})});}_0x50f4d3=_[_0x82e6('0x42')]({},_0x50f4d3,_0x537255['options']);var _0x46f7cd={'where':_0x50f4d3['where']};return db[_0x82e6('0x32')]['count'](_0x46f7cd)[_0x82e6('0x2b')](function(_0x2a33b0){_0x3b633c['count']=_0x2a33b0;if(_0x537255[_0x82e6('0x37')][_0x82e6('0x45')]){_0x50f4d3[_0x82e6('0x46')]=[{'all':!![]}];}return db['Schedule'][_0x82e6('0x47')](_0x50f4d3);})[_0x82e6('0x2b')](function(_0xbcd933){_0x3b633c['rows']=_0xbcd933;return _0x3b633c;})[_0x82e6('0x2b')](respondWithFilteredResult(_0x5d3668,_0x50f4d3))[_0x82e6('0x48')](handleError(_0x5d3668,null));};exports[_0x82e6('0x49')]=function(_0x4b08c8,_0x4b6192){var _0x4098b4={'raw':![],'where':{'id':_0x4b08c8[_0x82e6('0x4a')]['id']}},_0x291927={};_0x291927[_0x82e6('0x35')]=_[_0x82e6('0x38')](db['Schedule']['rawAttributes']);_0x291927[_0x82e6('0x37')]=_[_0x82e6('0x38')](_0x4b08c8[_0x82e6('0x37')]);_0x291927[_0x82e6('0x39')]=_[_0x82e6('0x3a')](_0x291927['model'],_0x291927['query']);_0x4098b4[_0x82e6('0x3c')]=_[_0x82e6('0x3a')](_0x291927['model'],qs[_0x82e6('0x3b')](_0x4b08c8[_0x82e6('0x37')][_0x82e6('0x3b')]));_0x4098b4[_0x82e6('0x3c')]=_0x4098b4[_0x82e6('0x3c')][_0x82e6('0x3d')]?_0x4098b4['attributes']:_0x291927[_0x82e6('0x35')];if(_0x4b08c8[_0x82e6('0x37')][_0x82e6('0x45')]){_0x4098b4[_0x82e6('0x46')]=[{'all':!![]}];}_0x4098b4=_[_0x82e6('0x42')]({},_0x4098b4,_0x4b08c8['options']);return db[_0x82e6('0x32')][_0x82e6('0x4b')](_0x4098b4)[_0x82e6('0x2b')](handleEntityNotFound(_0x4b6192,null))[_0x82e6('0x2b')](respondWithResult(_0x4b6192,null))[_0x82e6('0x48')](handleError(_0x4b6192,null));};exports['create']=function(_0x5af1ff,_0x5bb698){return db[_0x82e6('0x32')][_0x82e6('0x4c')](_0x5af1ff['body'],{})['then'](function(_0x4d7076){var _0x840b52=_0x5af1ff[_0x82e6('0x4d')][_0x82e6('0x2d')]({'plain':!![]});if(!_0x840b52)throw new Error(_0x82e6('0x4e'));if(_0x840b52[_0x82e6('0x4f')]==='user'){var _0x308009=_0x4d7076[_0x82e6('0x2d')]({'plain':!![]});var _0x442685=_0x82e6('0x50');return db[_0x82e6('0x51')][_0x82e6('0x4b')]({'where':{'name':_0x442685,'userProfileId':_0x840b52[_0x82e6('0x52')]},'raw':!![]})[_0x82e6('0x2b')](function(_0x1e4485){if(_0x1e4485&&_0x1e4485['autoAssociation']===0x0){return db[_0x82e6('0x53')]['create']({'name':_0x308009[_0x82e6('0x30')],'resourceId':_0x308009['id'],'type':_0x1e4485[_0x82e6('0x30')],'sectionId':_0x1e4485['id']},{})[_0x82e6('0x2b')](function(){return _0x4d7076;});}else{return _0x4d7076;}})[_0x82e6('0x48')](function(_0x5ecc21){logger['error'](_0x82e6('0x54'),_0x5ecc21);throw _0x5ecc21;});}return _0x4d7076;})[_0x82e6('0x2b')](respondWithResult(_0x5bb698,0xc9))[_0x82e6('0x48')](handleError(_0x5bb698,null));};exports[_0x82e6('0x2a')]=function(_0x2f114c,_0x2abbbe){if(_0x2f114c['body']['id']){delete _0x2f114c['body']['id'];}return db[_0x82e6('0x32')][_0x82e6('0x4b')]({'where':{'id':_0x2f114c['params']['id']}})[_0x82e6('0x2b')](handleEntityNotFound(_0x2abbbe,null))[_0x82e6('0x2b')](saveUpdates(_0x2f114c[_0x82e6('0x55')],null))[_0x82e6('0x2b')](respondWithResult(_0x2abbbe,null))['catch'](handleError(_0x2abbbe,null));};exports[_0x82e6('0x2c')]=function(_0x49bdee,_0x5ee8){return db[_0x82e6('0x32')][_0x82e6('0x4b')]({'where':{'id':_0x49bdee[_0x82e6('0x4a')]['id']}})[_0x82e6('0x2b')](handleEntityNotFound(_0x5ee8,null))[_0x82e6('0x2b')](removeEntity(_0x5ee8,null))['catch'](handleError(_0x5ee8,null));};exports[_0x82e6('0x56')]=function(_0x22e391,_0x566761,_0x1fd373){var _0x5000cd=require('../../config/schedule');return db[_0x82e6('0x32')][_0x82e6('0x4b')]({'where':{'id':_0x22e391[_0x82e6('0x4a')]['id']},'raw':!![]})[_0x82e6('0x2b')](handleEntityNotFound(_0x566761,null))[_0x82e6('0x2b')](function(){_0x5000cd[_0x82e6('0x56')](_0x22e391[_0x82e6('0x4a')]['id']);})[_0x82e6('0x2b')](respondWithStatusCode(_0x566761,null))[_0x82e6('0x48')](handleError(_0x566761,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index c32283d..42ae305 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 _0x5e70=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5e70,0x1df));var _0x05e7=function(_0x18afd7,_0x2bb7c3){_0x18afd7=_0x18afd7-0x0;var _0x4d212a=_0x5e70[_0x18afd7];return _0x4d212a;};'use strict';var _=require(_0x05e7('0x0'));var util=require(_0x05e7('0x1'));var logger=require(_0x05e7('0x2'))('api');var moment=require(_0x05e7('0x3'));var BPromise=require(_0x05e7('0x4'));var rp=require(_0x05e7('0x5'));var fs=require('fs');var path=require(_0x05e7('0x6'));var rimraf=require('rimraf');var config=require(_0x05e7('0x7'));var attributes=require(_0x05e7('0x8'));module['exports']=function(_0x5eecf1,_0x5cd47f){return _0x5eecf1[_0x05e7('0x9')](_0x05e7('0xa'),attributes,{'tableName':_0x05e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x172f=['moment','request-promise','rimraf','./schedule.attributes','define','Schedule','lodash','util','../../config/logger','api'];(function(_0x3990c2,_0x216dc6){var _0x9fd09=function(_0xc2bb07){while(--_0xc2bb07){_0x3990c2['push'](_0x3990c2['shift']());}};_0x9fd09(++_0x216dc6);}(_0x172f,0x1d2));var _0xf172=function(_0x12123b,_0x562b58){_0x12123b=_0x12123b-0x0;var _0x1b2a48=_0x172f[_0x12123b];return _0x1b2a48;};'use strict';var _=require(_0xf172('0x0'));var util=require(_0xf172('0x1'));var logger=require(_0xf172('0x2'))(_0xf172('0x3'));var moment=require(_0xf172('0x4'));var BPromise=require('bluebird');var rp=require(_0xf172('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf172('0x6'));var config=require('../../config/environment');var attributes=require(_0xf172('0x7'));module['exports']=function(_0x104620,_0x2e9e64){return _0x104620[_0xf172('0x8')](_0xf172('0x9'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 8919076..221d91f 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 _0xb01a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x462bff,_0x151a16){var _0x27229a=function(_0x223b61){while(--_0x223b61){_0x462bff['push'](_0x462bff['shift']());}};_0x27229a(++_0x151a16);}(_0xb01a,0x1a4));var _0xab01=function(_0x56e64f,_0x4b7c63){_0x56e64f=_0x56e64f-0x0;var _0x88e7d0=_0xb01a[_0x56e64f];return _0x88e7d0;};'use strict';var _=require('lodash');var util=require(_0xab01('0x0'));var moment=require(_0xab01('0x1'));var BPromise=require(_0xab01('0x2'));var rs=require(_0xab01('0x3'));var fs=require('fs');var Redis=require(_0xab01('0x4'));var db=require(_0xab01('0x5'))['db'];var utils=require(_0xab01('0x6'));var logger=require(_0xab01('0x7'))(_0xab01('0x8'));var config=require(_0xab01('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15578d,_0x5cb2a4,_0x296f90){return new BPromise(function(_0x4b8622,_0x15cf60){return client[_0xab01('0xa')](_0x15578d,_0x296f90)[_0xab01('0xb')](function(_0x2bfdf3){logger[_0xab01('0xc')](_0xab01('0xd'),_0x5cb2a4,_0xab01('0xe'));logger['debug'](_0xab01('0xf'),_0x5cb2a4,_0xab01('0xe'),JSON[_0xab01('0x10')](_0x2bfdf3));if(_0x2bfdf3[_0xab01('0x11')]){if(_0x2bfdf3[_0xab01('0x11')][_0xab01('0x12')]===0x1f4){logger[_0xab01('0x11')]('Schedule,\x20%s,\x20%s',_0x5cb2a4,_0x2bfdf3[_0xab01('0x11')][_0xab01('0x13')]);return _0x15cf60(_0x2bfdf3[_0xab01('0x11')][_0xab01('0x13')]);}logger[_0xab01('0x11')]('Schedule,\x20%s,\x20%s',_0x5cb2a4,_0x2bfdf3['error'][_0xab01('0x13')]);return _0x4b8622(_0x2bfdf3[_0xab01('0x11')][_0xab01('0x13')]);}else{logger[_0xab01('0xc')]('Schedule,\x20%s,\x20%s',_0x5cb2a4,'request\x20sent');_0x4b8622(_0x2bfdf3[_0xab01('0x14')][_0xab01('0x13')]);}})['catch'](function(_0x22cb98){logger[_0xab01('0x11')](_0xab01('0xd'),_0x5cb2a4,_0x22cb98);_0x15cf60(_0x22cb98);});});} \ No newline at end of file +var _0x3625=['../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1d6118,_0x203620){var _0xf062c7=function(_0x2b3a90){while(--_0x2b3a90){_0x1d6118['push'](_0x1d6118['shift']());}};_0xf062c7(++_0x203620);}(_0x3625,0x17f));var _0x5362=function(_0x62ea04,_0x5ac9ec){_0x62ea04=_0x62ea04-0x0;var _0x10c30d=_0x3625[_0x62ea04];return _0x10c30d;};'use strict';var _=require(_0x5362('0x0'));var util=require(_0x5362('0x1'));var moment=require('moment');var BPromise=require(_0x5362('0x2'));var rs=require(_0x5362('0x3'));var fs=require('fs');var Redis=require(_0x5362('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5362('0x5'));var logger=require(_0x5362('0x6'))(_0x5362('0x7'));var config=require(_0x5362('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5362('0x9')][_0x5362('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1697b5,_0x505433,_0x264d35){return new BPromise(function(_0x4034e1,_0x576c65){return client[_0x5362('0xb')](_0x1697b5,_0x264d35)[_0x5362('0xc')](function(_0x180c40){logger[_0x5362('0xd')](_0x5362('0xe'),_0x505433,_0x5362('0xf'));logger[_0x5362('0x10')](_0x5362('0x11'),_0x505433,'request\x20sent',JSON[_0x5362('0x12')](_0x180c40));if(_0x180c40['error']){if(_0x180c40[_0x5362('0x13')]['code']===0x1f4){logger[_0x5362('0x13')]('Schedule,\x20%s,\x20%s',_0x505433,_0x180c40[_0x5362('0x13')][_0x5362('0x14')]);return _0x576c65(_0x180c40['error'][_0x5362('0x14')]);}logger[_0x5362('0x13')]('Schedule,\x20%s,\x20%s',_0x505433,_0x180c40[_0x5362('0x13')][_0x5362('0x14')]);return _0x4034e1(_0x180c40[_0x5362('0x13')][_0x5362('0x14')]);}else{logger[_0x5362('0xd')](_0x5362('0xe'),_0x505433,_0x5362('0xf'));_0x4034e1(_0x180c40[_0x5362('0x15')][_0x5362('0x14')]);}})[_0x5362('0x16')](function(_0x11ebe8){logger[_0x5362('0x13')]('Schedule,\x20%s,\x20%s',_0x505433,_0x11ebe8);_0x576c65(_0x11ebe8);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index a498e24..49d364b 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 _0x93bf=['describe','/:id','show','download','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','/describe'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x93bf,0xa4));var _0xf93b=function(_0x275f00,_0x4dba79){_0x275f00=_0x275f00-0x0;var _0x5eb78d=_0x93bf[_0x275f00];return _0x5eb78d;};'use strict';var multer=require(_0xf93b('0x0'));var util=require(_0xf93b('0x1'));var path=require(_0xf93b('0x2'));var timeout=require(_0xf93b('0x3'));var express=require('express');var router=express[_0xf93b('0x4')]();var fs_extra=require(_0xf93b('0x5'));var auth=require(_0xf93b('0x6'));var interaction=require(_0xf93b('0x7'));var config=require('../../config/environment');var controller=require(_0xf93b('0x8'));router[_0xf93b('0x9')]('/',auth[_0xf93b('0xa')](),controller['index']);router[_0xf93b('0x9')](_0xf93b('0xb'),auth[_0xf93b('0xa')](),controller[_0xf93b('0xc')]);router['get'](_0xf93b('0xd'),auth[_0xf93b('0xa')](),controller[_0xf93b('0xe')]);router[_0xf93b('0x9')]('/:id/download',auth[_0xf93b('0xa')](),controller[_0xf93b('0xf')]);router[_0xf93b('0x10')]('/',auth[_0xf93b('0xa')](),controller[_0xf93b('0x11')]);router['put']('/:id',auth[_0xf93b('0xa')](),controller[_0xf93b('0x12')]);router[_0xf93b('0x13')](_0xf93b('0xd'),auth['isAuthenticated'](),controller[_0xf93b('0x14')]);module[_0xf93b('0x15')]=router; \ No newline at end of file +var _0x2b3b=['isAuthenticated','index','/describe','describe','/:id','show','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get'];(function(_0x331110,_0x4392ce){var _0x1681da=function(_0x1e1e41){while(--_0x1e1e41){_0x331110['push'](_0x331110['shift']());}};_0x1681da(++_0x4392ce);}(_0x2b3b,0x86));var _0xb2b3=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x2b3b[_0x1b2ff7];return _0x31656a;};'use strict';var multer=require(_0xb2b3('0x0'));var util=require(_0xb2b3('0x1'));var path=require(_0xb2b3('0x2'));var timeout=require(_0xb2b3('0x3'));var express=require(_0xb2b3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb2b3('0x5'));var interaction=require(_0xb2b3('0x6'));var config=require(_0xb2b3('0x7'));var controller=require(_0xb2b3('0x8'));router[_0xb2b3('0x9')]('/',auth[_0xb2b3('0xa')](),controller[_0xb2b3('0xb')]);router[_0xb2b3('0x9')](_0xb2b3('0xc'),auth[_0xb2b3('0xa')](),controller[_0xb2b3('0xd')]);router[_0xb2b3('0x9')](_0xb2b3('0xe'),auth[_0xb2b3('0xa')](),controller[_0xb2b3('0xf')]);router[_0xb2b3('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0xb2b3('0x10')]);router[_0xb2b3('0x11')]('/',auth[_0xb2b3('0xa')](),controller[_0xb2b3('0x12')]);router[_0xb2b3('0x13')](_0xb2b3('0xe'),auth['isAuthenticated'](),controller[_0xb2b3('0x14')]);router[_0xb2b3('0x15')](_0xb2b3('0xe'),auth['isAuthenticated'](),controller[_0xb2b3('0x16')]);module[_0xb2b3('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 8deccab..4b84229 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 _0x86c0=['STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','startedAt','format','MM-DD-YYYY\x20HH:mm','DATE','createdAt','toString','sequelize','path','../../config/environment','exports','VIRTUAL','value','extname','getDataValue'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x86c0,0x133));var _0x086c=function(_0x1e6516,_0x204efd){_0x1e6516=_0x1e6516-0x0;var _0x4036f8=_0x86c0[_0x1e6516];return _0x4036f8;};'use strict';var Sequelize=require(_0x086c('0x0'));var moment=require('moment');var path=require(_0x086c('0x1'));var config=require(_0x086c('0x2'));module[_0x086c('0x3')]={'format':{'type':Sequelize[_0x086c('0x4')],'get':function(){return this['getDataValue'](_0x086c('0x5'))?path[_0x086c('0x6')](this[_0x086c('0x7')](_0x086c('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x086c('0x8')]},'value':{'type':Sequelize[_0x086c('0x8')],'set':function(_0x2e27a8){var _0x387428=_0x2e27a8[_0x086c('0x9')](/\\/g,'/');this[_0x086c('0xa')]('value',_0x387428);}},'rating':{'type':Sequelize[_0x086c('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x086c('0xb')],'set':function(_0xa1b79a){this['setDataValue']('startedAt',moment()[_0x086c('0xc')](_0xa1b79a,'ms'));this[_0x086c('0xa')](_0x086c('0xd'),moment());this[_0x086c('0xa')](_0x086c('0xe'),_0xa1b79a);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x086c('0x7')](_0x086c('0xf')))[_0x086c('0x10')](_0x086c('0x11'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x086c('0x7')]('closedAt'))[_0x086c('0x10')](_0x086c('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0x086c('0x12')],'get':function(){return moment(this[_0x086c('0x7')](_0x086c('0x13')))[_0x086c('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x086c('0x14')]();}},'updatedAt':{'type':Sequelize[_0x086c('0x12')],'get':function(){return moment(this[_0x086c('0x7')]('updatedAt'))[_0x086c('0x10')](_0x086c('0x11'))[_0x086c('0x14')]();}}}; \ No newline at end of file +var _0xb4e2=['replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','DATE','toString','updatedAt','sequelize','../../config/environment','value','extname','getDataValue','STRING'];(function(_0xfb8681,_0x4386ab){var _0x2d2d88=function(_0x1117cb){while(--_0x1117cb){_0xfb8681['push'](_0xfb8681['shift']());}};_0x2d2d88(++_0x4386ab);}(_0xb4e2,0x1aa));var _0x2b4e=function(_0x30c605,_0x1a3b7b){_0x30c605=_0x30c605-0x0;var _0x2c74f5=_0xb4e2[_0x30c605];return _0x2c74f5;};'use strict';var Sequelize=require(_0x2b4e('0x0'));var moment=require('moment');var path=require('path');var config=require(_0x2b4e('0x1'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x2b4e('0x2'))?path[_0x2b4e('0x3')](this[_0x2b4e('0x4')](_0x2b4e('0x2'))):undefined;}},'interactionid':{'type':Sequelize[_0x2b4e('0x5')]},'channel':{'type':Sequelize[_0x2b4e('0x5')]},'value':{'type':Sequelize[_0x2b4e('0x5')],'set':function(_0x4a84a9){var _0xc18f62=_0x4a84a9[_0x2b4e('0x6')](/\\/g,'/');this[_0x2b4e('0x7')](_0x2b4e('0x2'),_0xc18f62);}},'rating':{'type':Sequelize[_0x2b4e('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x2b4e('0x8')],'set':function(_0x3fd14e){this[_0x2b4e('0x7')](_0x2b4e('0x9'),moment()[_0x2b4e('0xa')](_0x3fd14e,'ms'));this[_0x2b4e('0x7')](_0x2b4e('0xb'),moment());this[_0x2b4e('0x7')](_0x2b4e('0xc'),_0x3fd14e);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2b4e('0x4')](_0x2b4e('0x9')))[_0x2b4e('0xd')](_0x2b4e('0xe'))['toString']();}},'closedAt':{'type':Sequelize[_0x2b4e('0xf')],'get':function(){return moment(this['getDataValue'](_0x2b4e('0xb')))[_0x2b4e('0xd')](_0x2b4e('0xe'))[_0x2b4e('0x10')]();}},'createdAt':{'type':Sequelize[_0x2b4e('0xf')],'get':function(){return moment(this[_0x2b4e('0x4')]('createdAt'))[_0x2b4e('0xd')](_0x2b4e('0xe'))[_0x2b4e('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2b4e('0x4')](_0x2b4e('0x11')))['format'](_0x2b4e('0xe'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 3908e17..6f735ac 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 _0x425d=['include','findAll','rows','catch','show','params','length','includeAll','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','root','server/files/screen_recordings','value','%s.cypher','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x425d,0x1e0));var _0xd425=function(_0x39bf21,_0x5c2e3f){_0x39bf21=_0x39bf21-0x0;var _0x19c6e9=_0x425d[_0x39bf21];return _0x19c6e9;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x1908a5,_0x2afcdb){return function(_0x400dd7){if(!_0x400dd7){_0x1908a5[_0xd425('0x1d')](0x194);}return _0x400dd7;};}function handleError(_0x577e4b,_0x12f951){_0x12f951=_0x12f951||0x1f4;return function(_0x177de2){logger[_0xd425('0x2b')](_0x177de2['stack']);if(_0x177de2[_0xd425('0x2c')]){delete _0x177de2[_0xd425('0x2c')];}_0x577e4b[_0xd425('0x1f')](_0x12f951)[_0xd425('0x2d')](_0x177de2);};}exports[_0xd425('0x2e')]=function(_0x185d7e,_0x2fd17a){var _0x37b63c={},_0x24da23={},_0x1cac61={'count':0x0,'rows':[]};var _0x482ba6=_[_0xd425('0x2f')](db[_0xd425('0x30')][_0xd425('0x31')],function(_0x3695dd){return{'name':_0x3695dd[_0xd425('0x32')],'type':_0x3695dd[_0xd425('0x33')][_0xd425('0x34')]};});_0x24da23[_0xd425('0x35')]=_[_0xd425('0x36')](_[_0xd425('0x2f')](_0x482ba6,_0xd425('0x2c')),['format']);_0x24da23[_0xd425('0x37')]=_[_0xd425('0x38')](_0x185d7e[_0xd425('0x37')]);_0x24da23[_0xd425('0x39')]=_[_0xd425('0x3a')](_0x24da23['model'],_0x24da23[_0xd425('0x37')]);_0x37b63c[_0xd425('0x3b')]=_['intersection'](_0x24da23['model'],qs['fields'](_0x185d7e[_0xd425('0x37')][_0xd425('0x3c')]));_0x37b63c[_0xd425('0x3b')]=_0x37b63c[_0xd425('0x3b')]['length']?_0x37b63c[_0xd425('0x3b')]:_0x24da23[_0xd425('0x35')];if(!_0x185d7e[_0xd425('0x37')][_0xd425('0x3d')](_0xd425('0x3e'))){_0x37b63c[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x185d7e['query'][_0xd425('0x23')]);_0x37b63c['offset']=qs[_0xd425('0x21')](_0x185d7e[_0xd425('0x37')][_0xd425('0x21')]);}_0x37b63c['order']=qs[_0xd425('0x3f')](_0x185d7e[_0xd425('0x37')][_0xd425('0x3f')]);_0x37b63c[_0xd425('0x40')]=qs['filters'](_[_0xd425('0x41')](_0x185d7e[_0xd425('0x37')],_0x24da23['filters']),_0x482ba6);if(_0x185d7e['query']['filter']){_0x37b63c[_0xd425('0x40')]=_[_0xd425('0x42')](_0x37b63c[_0xd425('0x40')],{'$or':_['map'](_0x482ba6,function(_0x4f8323){if(_0x4f8323['type']!==_0xd425('0x43')){var _0x3f9090={};_0x3f9090[_0x4f8323[_0xd425('0x2c')]]={'$like':'%'+_0x185d7e[_0xd425('0x37')][_0xd425('0x44')]+'%'};return _0x3f9090;}})});}_0x37b63c=_[_0xd425('0x42')]({},_0x37b63c,_0x185d7e[_0xd425('0x45')]);var _0x4b922f={'where':_0x37b63c[_0xd425('0x40')]};return db[_0xd425('0x30')][_0xd425('0x24')](_0x4b922f)['then'](function(_0x3adc67){_0x1cac61[_0xd425('0x24')]=_0x3adc67;if(_0x185d7e[_0xd425('0x37')]['includeAll']){_0x37b63c[_0xd425('0x46')]=[{'all':!![]}];}return db[_0xd425('0x30')][_0xd425('0x47')](_0x37b63c);})[_0xd425('0x2a')](function(_0x5afd62){_0x1cac61[_0xd425('0x48')]=_0x5afd62;return _0x1cac61;})[_0xd425('0x2a')](respondWithFilteredResult(_0x2fd17a,_0x37b63c))[_0xd425('0x49')](handleError(_0x2fd17a,null));};exports[_0xd425('0x4a')]=function(_0x3f24fb,_0x2f6bf7){var _0x2d799b={'raw':![],'where':{'id':_0x3f24fb[_0xd425('0x4b')]['id']}},_0x524fad={};_0x524fad[_0xd425('0x35')]=_['keys'](db[_0xd425('0x30')]['rawAttributes']);_0x524fad['query']=_[_0xd425('0x38')](_0x3f24fb['query']);_0x524fad[_0xd425('0x39')]=_['intersection'](_0x524fad[_0xd425('0x35')],_0x524fad[_0xd425('0x37')]);_0x2d799b[_0xd425('0x3b')]=_[_0xd425('0x3a')](_0x524fad[_0xd425('0x35')],qs['fields'](_0x3f24fb[_0xd425('0x37')]['fields']));_0x2d799b[_0xd425('0x3b')]=_0x2d799b['attributes'][_0xd425('0x4c')]?_0x2d799b[_0xd425('0x3b')]:_0x524fad[_0xd425('0x35')];if(_0x3f24fb[_0xd425('0x37')][_0xd425('0x4d')]){_0x2d799b['include']=[{'all':!![]}];}_0x2d799b=_[_0xd425('0x42')]({},_0x2d799b,_0x3f24fb[_0xd425('0x45')]);return db[_0xd425('0x30')][_0xd425('0x4e')](_0x2d799b)[_0xd425('0x2a')](handleEntityNotFound(_0x2f6bf7,null))['then'](respondWithResult(_0x2f6bf7,null))[_0xd425('0x49')](handleError(_0x2f6bf7,null));};exports[_0xd425('0x4f')]=function(_0x1450f2,_0x2a2ab4){return db[_0xd425('0x30')][_0xd425('0x4f')](_0x1450f2['body'],{})[_0xd425('0x2a')](respondWithResult(_0x2a2ab4,0xc9))[_0xd425('0x49')](handleError(_0x2a2ab4,null));};exports['update']=function(_0x3f305,_0x42c084){if(_0x3f305[_0xd425('0x50')]['id']){delete _0x3f305[_0xd425('0x50')]['id'];}delete _0x3f305['body'][_0xd425('0x51')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x52')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x53')];delete _0x3f305['body']['value'];return db[_0xd425('0x30')]['find']({'where':{'id':_0x3f305[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x42c084,null))['then'](saveUpdates(_0x3f305[_0xd425('0x50')],null))['then'](respondWithResult(_0x42c084,null))['catch'](handleError(_0x42c084,null));};exports[_0xd425('0x54')]=function(_0x111905,_0xe6451f){return db[_0xd425('0x30')][_0xd425('0x54')]()[_0xd425('0x2a')](respondWithResult(_0xe6451f,null))[_0xd425('0x49')](handleError(_0xe6451f,null));};exports[_0xd425('0x55')]=function(_0x54d437,_0x11ed71,_0x1c6141){var _0x1be9bb=require(_0xd425('0x56'));var _0x7b1080=![];var _0x1c80c2={};if(_0x54d437[_0xd425('0x37')][_0xd425('0x33')]&&_0x54d437['query']['type']==='uniqueid'){_0x1c80c2[_0xd425('0x57')]=_0x54d437[_0xd425('0x4b')]['id'];}else{_0x1c80c2['id']=_0x54d437[_0xd425('0x4b')]['id'];}return db[_0xd425('0x30')]['find']({'where':_0x1c80c2,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x11ed71,null))['then'](function(_0x254b8b){if(_0x254b8b){var _0x44c5e4=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x254b8b[_0xd425('0x5a')]);var _0x57e23e=util['format'](_0xd425('0x5b'),_0x44c5e4);if(fs['existsSync'](_0x57e23e)){_0x7b1080=!![];return _0x1be9bb['decryptFile'](_0x57e23e,_0x44c5e4,config['secrets'][_0xd425('0x5c')])[_0xd425('0x2a')](function(){return _0x254b8b;});}return _0x254b8b;}})[_0xd425('0x2a')](function(_0x5b2323){if(_0x5b2323){var _0x3395d8=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x5b2323[_0xd425('0x5a')]);if(!fs[_0xd425('0x5d')](_0x3395d8)){throw new db[(_0xd425('0x5e'))][(_0xd425('0x5f'))](_0xd425('0x60'));}if(_0x5b2323[_0xd425('0x61')]){return _0x11ed71[_0xd425('0x55')](_0x3395d8,_0x5b2323['filename']+path[_0xd425('0x62')](_0x3395d8),function(){if(_0x7b1080){fs[_0xd425('0x63')](_0x3395d8);}});}else{return _0x11ed71[_0xd425('0x55')](_0x3395d8,function(_0xf22906){if(_0x7b1080){fs['unlink'](_0x3395d8);}});}}})['catch'](function(_0x307e9a){if(_0x307e9a[_0xd425('0x64')]===_0xd425('0x60')){_0x11ed71[_0xd425('0x1f')](0x194)[_0xd425('0x2d')](_0xd425('0x65'));}else{return handleError(_0x11ed71,null);}});};exports[_0xd425('0x66')]=function(_0x44782a,_0x1fcde4){return db[_0xd425('0x30')][_0xd425('0x4e')]({'where':{'id':_0x44782a[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](function(_0x28979e){if(_['isNil'](_0x28979e)){throw new ReferenceError(_0xd425('0x67'));}return _0x28979e;})[_0xd425('0x2a')](function(_0xd2f2e8){var _0x4fd793=path['join'](config['root'],_0xd425('0x59'),_0xd2f2e8[_0xd425('0x5a')]);logger[_0xd425('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x4fd793);if(!_[_0xd425('0x69')](_0xd2f2e8['value'])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd425('0x6b')](_0x4fd793);}_0x4fd793=_0x4fd793+_0xd425('0x6c');if(!_[_0xd425('0x69')](_0xd2f2e8[_0xd425('0x5a')])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+_0xd425('0x6d'));fs[_0xd425('0x6b')](_0x4fd793);}return _0xd2f2e8;})[_0xd425('0x2a')](function(_0x2ba77b){if(!_0x2ba77b)throw new InternalError();return _0x2ba77b[_0xd425('0x66')]();})[_0xd425('0x2a')](function(){_0x1fcde4[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();})[_0xd425('0x49')](handleError(_0x1fcde4,null));}; \ No newline at end of file +var _0x032e=['status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','rawAttributes','fieldName','type','model','differenceBy','map','format','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ScreenRecording','rows','catch','show','find','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','destroy','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x1980f6,_0x49a8ff){var _0xe98f57=function(_0x6411a2){while(--_0x6411a2){_0x1980f6['push'](_0x1980f6['shift']());}};_0xe98f57(++_0x49a8ff);}(_0x032e,0x124));var _0xe032=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x032e[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['index']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={},_0x469290={},_0xae116e={'count':0x0,'rows':[]};var _0x4e8b72=_['map'](db['ScreenRecording'][_0xe032('0x2b')],function(_0x1dd34f){return{'name':_0x1dd34f[_0xe032('0x2c')],'type':_0x1dd34f[_0xe032('0x2d')]['key']};});_0x469290[_0xe032('0x2e')]=_[_0xe032('0x2f')](_[_0xe032('0x30')](_0x4e8b72,_0xe032('0x29')),[_0xe032('0x31')]);_0x469290['query']=_[_0xe032('0x32')](_0x5573e4[_0xe032('0x33')]);_0x469290[_0xe032('0x34')]=_[_0xe032('0x35')](_0x469290['model'],_0x469290[_0xe032('0x33')]);_0x38e7ea['attributes']=_[_0xe032('0x35')](_0x469290['model'],qs[_0xe032('0x36')](_0x5573e4['query'][_0xe032('0x36')]));_0x38e7ea['attributes']=_0x38e7ea[_0xe032('0x37')][_0xe032('0x38')]?_0x38e7ea['attributes']:_0x469290[_0xe032('0x2e')];if(!_0x5573e4[_0xe032('0x33')][_0xe032('0x39')](_0xe032('0x3a'))){_0x38e7ea['limit']=qs[_0xe032('0x21')](_0x5573e4['query'][_0xe032('0x21')]);_0x38e7ea[_0xe032('0x1f')]=qs['offset'](_0x5573e4[_0xe032('0x33')][_0xe032('0x1f')]);}_0x38e7ea['order']=qs[_0xe032('0x3b')](_0x5573e4[_0xe032('0x33')][_0xe032('0x3b')]);_0x38e7ea[_0xe032('0x3c')]=qs[_0xe032('0x34')](_[_0xe032('0x3d')](_0x5573e4[_0xe032('0x33')],_0x469290[_0xe032('0x34')]),_0x4e8b72);if(_0x5573e4[_0xe032('0x33')][_0xe032('0x3e')]){_0x38e7ea[_0xe032('0x3c')]=_[_0xe032('0x3f')](_0x38e7ea[_0xe032('0x3c')],{'$or':_[_0xe032('0x30')](_0x4e8b72,function(_0x39af44){if(_0x39af44[_0xe032('0x2d')]!==_0xe032('0x40')){var _0x555914={};_0x555914[_0x39af44[_0xe032('0x29')]]={'$like':'%'+_0x5573e4['query'][_0xe032('0x3e')]+'%'};return _0x555914;}})});}_0x38e7ea=_[_0xe032('0x3f')]({},_0x38e7ea,_0x5573e4[_0xe032('0x41')]);var _0x119790={'where':_0x38e7ea[_0xe032('0x3c')]};return db['ScreenRecording'][_0xe032('0x22')](_0x119790)['then'](function(_0x46ea84){_0xae116e['count']=_0x46ea84;if(_0x5573e4[_0xe032('0x33')][_0xe032('0x42')]){_0x38e7ea[_0xe032('0x43')]=[{'all':!![]}];}return db[_0xe032('0x44')]['findAll'](_0x38e7ea);})[_0xe032('0x27')](function(_0x5a6450){_0xae116e[_0xe032('0x45')]=_0x5a6450;return _0xae116e;})[_0xe032('0x27')](respondWithFilteredResult(_0x3e2575,_0x38e7ea))[_0xe032('0x46')](handleError(_0x3e2575,null));};exports[_0xe032('0x47')]=function(_0x4b58eb,_0x513b0c){var _0x45345d={'raw':![],'where':{'id':_0x4b58eb['params']['id']}},_0x203021={};_0x203021[_0xe032('0x2e')]=_[_0xe032('0x32')](db[_0xe032('0x44')][_0xe032('0x2b')]);_0x203021[_0xe032('0x33')]=_['keys'](_0x4b58eb[_0xe032('0x33')]);_0x203021[_0xe032('0x34')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],_0x203021[_0xe032('0x33')]);_0x45345d[_0xe032('0x37')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],qs['fields'](_0x4b58eb['query'][_0xe032('0x36')]));_0x45345d['attributes']=_0x45345d[_0xe032('0x37')][_0xe032('0x38')]?_0x45345d[_0xe032('0x37')]:_0x203021[_0xe032('0x2e')];if(_0x4b58eb[_0xe032('0x33')][_0xe032('0x42')]){_0x45345d[_0xe032('0x43')]=[{'all':!![]}];}_0x45345d=_[_0xe032('0x3f')]({},_0x45345d,_0x4b58eb[_0xe032('0x41')]);return db['ScreenRecording'][_0xe032('0x48')](_0x45345d)['then'](handleEntityNotFound(_0x513b0c,null))['then'](respondWithResult(_0x513b0c,null))[_0xe032('0x46')](handleError(_0x513b0c,null));};exports[_0xe032('0x49')]=function(_0x62bfc8,_0x1e54d3){return db['ScreenRecording'][_0xe032('0x49')](_0x62bfc8[_0xe032('0x4a')],{})[_0xe032('0x27')](respondWithResult(_0x1e54d3,0xc9))[_0xe032('0x46')](handleError(_0x1e54d3,null));};exports[_0xe032('0x26')]=function(_0x233d9e,_0x3774bc){if(_0x233d9e['body']['id']){delete _0x233d9e[_0xe032('0x4a')]['id'];}delete _0x233d9e[_0xe032('0x4a')]['duration'];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4b')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4c')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4d')];return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x233d9e[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x3774bc,null))[_0xe032('0x27')](saveUpdates(_0x233d9e[_0xe032('0x4a')],null))[_0xe032('0x27')](respondWithResult(_0x3774bc,null))[_0xe032('0x46')](handleError(_0x3774bc,null));};exports['describe']=function(_0x1c8b32,_0x53c8b2){return db[_0xe032('0x44')][_0xe032('0x4f')]()[_0xe032('0x27')](respondWithResult(_0x53c8b2,null))[_0xe032('0x46')](handleError(_0x53c8b2,null));};exports[_0xe032('0x50')]=function(_0x1b7a91,_0x2e29d3,_0xa98ee6){var _0x16c91e=require(_0xe032('0x51'));var _0x1b9012=![];var _0x564fe0={};if(_0x1b7a91[_0xe032('0x33')][_0xe032('0x2d')]&&_0x1b7a91['query'][_0xe032('0x2d')]==='uniqueid'){_0x564fe0[_0xe032('0x52')]=_0x1b7a91[_0xe032('0x4e')]['id'];}else{_0x564fe0['id']=_0x1b7a91[_0xe032('0x4e')]['id'];}return db[_0xe032('0x44')][_0xe032('0x48')]({'where':_0x564fe0,'attributes':['id','value'],'raw':!![]})[_0xe032('0x27')](handleEntityNotFound(_0x2e29d3,null))[_0xe032('0x27')](function(_0x1e1277){if(_0x1e1277){var _0x21a32f=path[_0xe032('0x53')](config[_0xe032('0x54')],_0xe032('0x55'),_0x1e1277['value']);var _0x3f46c0=util[_0xe032('0x31')](_0xe032('0x56'),_0x21a32f);if(fs[_0xe032('0x57')](_0x3f46c0)){_0x1b9012=!![];return _0x16c91e[_0xe032('0x58')](_0x3f46c0,_0x21a32f,config[_0xe032('0x59')][_0xe032('0x5a')])[_0xe032('0x27')](function(){return _0x1e1277;});}return _0x1e1277;}})[_0xe032('0x27')](function(_0x54c0b0){if(_0x54c0b0){var _0x795a58=path[_0xe032('0x53')](config[_0xe032('0x54')],'server/files/screen_recordings',_0x54c0b0[_0xe032('0x4d')]);if(!fs[_0xe032('0x57')](_0x795a58)){throw new db['Sequelize'][(_0xe032('0x5b'))](_0xe032('0x5c'));}if(_0x54c0b0[_0xe032('0x5d')]){return _0x2e29d3[_0xe032('0x50')](_0x795a58,_0x54c0b0[_0xe032('0x5d')]+path[_0xe032('0x5e')](_0x795a58),function(){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}else{return _0x2e29d3[_0xe032('0x50')](_0x795a58,function(_0x1aa18e){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}}})[_0xe032('0x46')](function(_0x505986){if(_0x505986[_0xe032('0x60')]===_0xe032('0x5c')){_0x2e29d3[_0xe032('0x1d')](0x194)[_0xe032('0x2a')](_0xe032('0x61'));}else{return handleError(_0x2e29d3,null);}});};exports['destroy']=function(_0x2b6ef8,_0x55e6b0){return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x2b6ef8[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](function(_0x3c5eb8){if(_[_0xe032('0x62')](_0x3c5eb8)){throw new ReferenceError(_0xe032('0x63'));}return _0x3c5eb8;})[_0xe032('0x27')](function(_0x22fd01){var _0x536510=path['join'](config['root'],_0xe032('0x55'),_0x22fd01[_0xe032('0x4d')]);logger[_0xe032('0x64')](_0xe032('0x65'),_0x536510);if(!_[_0xe032('0x62')](_0x22fd01[_0xe032('0x4d')])&&fs['existsSync'](_0x536510)){logger[_0xe032('0x64')](_0xe032('0x66')+_0x536510+_0xe032('0x67'));fs['unlinkSync'](_0x536510);}_0x536510=_0x536510+_0xe032('0x68');if(!_['isNil'](_0x22fd01[_0xe032('0x4d')])&&fs[_0xe032('0x57')](_0x536510)){logger['info']('File:\x20\x22'+_0x536510+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe032('0x69')](_0x536510);}return _0x22fd01;})['then'](function(_0x5157f7){if(!_0x5157f7)throw new InternalError();return _0x5157f7[_0xe032('0x6a')]();})[_0xe032('0x27')](function(){_0x55e6b0[_0xe032('0x1d')](0xcc)['end']();})[_0xe032('0x46')](handleError(_0x55e6b0,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index a3beb21..087aca7 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 _0x20f6=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','ScreenRecording','screen_recordings','interactionid'];(function(_0x3bdde1,_0x1122e9){var _0x3cc806=function(_0x14178f){while(--_0x14178f){_0x3bdde1['push'](_0x3bdde1['shift']());}};_0x3cc806(++_0x1122e9);}(_0x20f6,0x15f));var _0x620f=function(_0x5810e9,_0x5a69b8){_0x5810e9=_0x5810e9-0x0;var _0x544d3=_0x20f6[_0x5810e9];return _0x544d3;};'use strict';var _=require(_0x620f('0x0'));var util=require(_0x620f('0x1'));var logger=require(_0x620f('0x2'))(_0x620f('0x3'));var moment=require('moment');var BPromise=require(_0x620f('0x4'));var rp=require(_0x620f('0x5'));var fs=require('fs');var path=require(_0x620f('0x6'));var rimraf=require(_0x620f('0x7'));var config=require(_0x620f('0x8'));var attributes=require(_0x620f('0x9'));module['exports']=function(_0x3da7a5,_0x51c04c){return _0x3da7a5['define'](_0x620f('0xa'),attributes,{'tableName':_0x620f('0xb'),'paranoid':![],'indexes':[{'name':_0x620f('0xc'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf65=['request-promise','path','../../config/environment','./screenRecording.attributes','exports','screen_recordings','interactionid','lodash','../../config/logger'];(function(_0x2f1be0,_0x4d5903){var _0x438719=function(_0x18c726){while(--_0x18c726){_0x2f1be0['push'](_0x2f1be0['shift']());}};_0x438719(++_0x4d5903);}(_0xcf65,0xfa));var _0x5cf6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xcf65[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x5cf6('0x0'));var util=require('util');var logger=require(_0x5cf6('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5cf6('0x2'));var fs=require('fs');var path=require(_0x5cf6('0x3'));var rimraf=require('rimraf');var config=require(_0x5cf6('0x4'));var attributes=require(_0x5cf6('0x5'));module[_0x5cf6('0x6')]=function(_0x417503,_0x4a7aac){return _0x417503['define']('ScreenRecording',attributes,{'tableName':_0x5cf6('0x7'),'paranoid':![],'indexes':[{'name':_0x5cf6('0x8'),'fields':[_0x5cf6('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index f8441af..e3e8b94 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 _0x5a76=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','util'];(function(_0x3d3016,_0x4e9cef){var _0x5d606f=function(_0x54167e){while(--_0x54167e){_0x3d3016['push'](_0x3d3016['shift']());}};_0x5d606f(++_0x4e9cef);}(_0x5a76,0x71));var _0x65a7=function(_0x2a6252,_0x7b6f66){_0x2a6252=_0x2a6252-0x0;var _0x50bb13=_0x5a76[_0x2a6252];return _0x50bb13;};'use strict';var _=require('lodash');var util=require(_0x65a7('0x0'));var moment=require(_0x65a7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65a7('0x2'));var db=require(_0x65a7('0x3'))['db'];var utils=require(_0x65a7('0x4'));var logger=require(_0x65a7('0x5'))(_0x65a7('0x6'));var config=require('../../config/environment');var jayson=require(_0x65a7('0x7'));var client=jayson[_0x65a7('0x8')][_0x65a7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57e6a5,_0x4556e3,_0x38f612){return new BPromise(function(_0x2c049e,_0x543246){return client[_0x65a7('0xa')](_0x57e6a5,_0x38f612)[_0x65a7('0xb')](function(_0x12d003){logger[_0x65a7('0xc')](_0x65a7('0xd'),_0x4556e3,'request\x20sent');logger['debug'](_0x65a7('0xe'),_0x4556e3,_0x65a7('0xf'),JSON['stringify'](_0x12d003));if(_0x12d003['error']){if(_0x12d003['error'][_0x65a7('0x10')]===0x1f4){logger[_0x65a7('0x11')](_0x65a7('0xd'),_0x4556e3,_0x12d003[_0x65a7('0x11')]['message']);return _0x543246(_0x12d003[_0x65a7('0x11')]['message']);}logger[_0x65a7('0x11')](_0x65a7('0xd'),_0x4556e3,_0x12d003[_0x65a7('0x11')][_0x65a7('0x12')]);return _0x2c049e(_0x12d003['error']['message']);}else{logger[_0x65a7('0xc')](_0x65a7('0xd'),_0x4556e3,'request\x20sent');_0x2c049e(_0x12d003['result']['message']);}})['catch'](function(_0x34e40c){logger['error'](_0x65a7('0xd'),_0x4556e3,_0x34e40c);_0x543246(_0x34e40c);});});} \ No newline at end of file +var _0x544a=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug'];(function(_0x475734,_0xf9e523){var _0x5280ae=function(_0x491184){while(--_0x491184){_0x475734['push'](_0x475734['shift']());}};_0x5280ae(++_0xf9e523);}(_0x544a,0xb0));var _0xa544=function(_0x2af011,_0x4e5395){_0x2af011=_0x2af011-0x0;var _0x5df10e=_0x544a[_0x2af011];return _0x5df10e;};'use strict';var _=require('lodash');var util=require(_0xa544('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa544('0x1'));var fs=require('fs');var Redis=require(_0xa544('0x2'));var db=require(_0xa544('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa544('0x4'))('rpc');var config=require(_0xa544('0x5'));var jayson=require(_0xa544('0x6'));var client=jayson[_0xa544('0x7')][_0xa544('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x431ba0,_0x3e6fbf,_0x5d86e0){return new BPromise(function(_0x31a186,_0x42ac7f){return client['request'](_0x431ba0,_0x5d86e0)[_0xa544('0x9')](function(_0x440134){logger[_0xa544('0xa')]('ScreenRecording,\x20%s,\x20%s',_0x3e6fbf,_0xa544('0xb'));logger[_0xa544('0xc')](_0xa544('0xd'),_0x3e6fbf,_0xa544('0xb'),JSON[_0xa544('0xe')](_0x440134));if(_0x440134[_0xa544('0xf')]){if(_0x440134[_0xa544('0xf')][_0xa544('0x10')]===0x1f4){logger[_0xa544('0xf')](_0xa544('0x11'),_0x3e6fbf,_0x440134[_0xa544('0xf')][_0xa544('0x12')]);return _0x42ac7f(_0x440134[_0xa544('0xf')][_0xa544('0x12')]);}logger[_0xa544('0xf')](_0xa544('0x11'),_0x3e6fbf,_0x440134[_0xa544('0xf')]['message']);return _0x31a186(_0x440134['error'][_0xa544('0x12')]);}else{logger[_0xa544('0xa')](_0xa544('0x11'),_0x3e6fbf,_0xa544('0xb'));_0x31a186(_0x440134[_0xa544('0x13')][_0xa544('0x12')]);}})[_0xa544('0x14')](function(_0x2af7ef){logger[_0xa544('0xf')](_0xa544('0x11'),_0x3e6fbf,_0x2af7ef);_0x42ac7f(_0x2af7ef);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index cfa2bc1..ce1ca8c 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 _0x1fa2=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','getDate','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','logologin','addLogoLogin','diskStorage','preferred','addPreferred','join','/:id/favicon','put','/:id','isAuthenticated','update','exports'];(function(_0x38f1e3,_0x51c609){var _0x4885c8=function(_0x4cd225){while(--_0x4cd225){_0x38f1e3['push'](_0x38f1e3['shift']());}};_0x4885c8(++_0x51c609);}(_0x1fa2,0xfc));var _0x21fa=function(_0x1d776c,_0x4e9a86){_0x1d776c=_0x1d776c-0x0;var _0x1c6d06=_0x1fa2[_0x1d776c];return _0x1c6d06;};'use strict';var multer=require(_0x21fa('0x0'));var util=require('util');var path=require(_0x21fa('0x1'));var timeout=require(_0x21fa('0x2'));var express=require(_0x21fa('0x3'));var router=express[_0x21fa('0x4')]();var fs_extra=require(_0x21fa('0x5'));var auth=require(_0x21fa('0x6'));var interaction=require(_0x21fa('0x7'));var config=require(_0x21fa('0x8'));var controller=require(_0x21fa('0x9'));router[_0x21fa('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x21fa('0xa')]('/now',controller[_0x21fa('0xb')]);router[_0x21fa('0xa')]('/:id',controller['show']);router['get']('/:id/logo',controller[_0x21fa('0xc')]);router['get'](_0x21fa('0xd'),controller[_0x21fa('0xe')]);router[_0x21fa('0xa')](_0x21fa('0xf'),controller[_0x21fa('0x10')]);router['get'](_0x21fa('0x11'),controller[_0x21fa('0x12')]);router[_0x21fa('0xa')]('/:id/favicon',controller[_0x21fa('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x31b6f2,_0x454f7e,_0x59ede8){_0x59ede8(null,path['join'](config[_0x21fa('0x14')],_0x21fa('0x15')));},'filename':function(_0x31e502,_0x59d6d7,_0x2c8e23){_0x2c8e23(null,util[_0x21fa('0x16')](_0x21fa('0x17'),_0x21fa('0x18'),path[_0x21fa('0x19')](_0x59d6d7[_0x21fa('0x1a')])));}})});router[_0x21fa('0x1b')]('/:id/logo',upload[_0x21fa('0x1c')](_0x21fa('0x1d')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x364685,_0x4dc223,_0x39d58d){_0x39d58d(null,path['join'](config[_0x21fa('0x14')],_0x21fa('0x15')));},'filename':function(_0x258bb3,_0x3d681a,_0x545938){_0x545938(null,util[_0x21fa('0x16')](_0x21fa('0x17'),_0x21fa('0x1e'),path['extname'](_0x3d681a['originalname'])));}})});router[_0x21fa('0x1b')]('/:id/logo_login',upload[_0x21fa('0x1c')](_0x21fa('0x1d')),controller[_0x21fa('0x1f')]);var upload=multer({'storage':multer[_0x21fa('0x20')]({'destination':function(_0x4b5f20,_0x4abd87,_0x27c724){_0x27c724(null,path['join'](config['root'],_0x21fa('0x15')));},'filename':function(_0x5c65e3,_0xaf1e53,_0x599ace){_0x599ace(null,util['format']('%s%s',_0x21fa('0x21'),path[_0x21fa('0x19')](_0xaf1e53[_0x21fa('0x1a')])));}})});router['post']('/:id/preferred',upload[_0x21fa('0x1c')](_0x21fa('0x1d')),controller[_0x21fa('0x22')]);var upload=multer({'storage':multer[_0x21fa('0x20')]({'destination':function(_0x59b77e,_0x3b0b3b,_0x1d17da){_0x1d17da(null,path[_0x21fa('0x23')](config['root'],_0x21fa('0x15')));},'filename':function(_0xfc7358,_0x345c24,_0x4317b8){_0x4317b8(null,util[_0x21fa('0x16')]('%s%s','favicon',path[_0x21fa('0x19')](_0x345c24['originalname'])));}})});router[_0x21fa('0x1b')](_0x21fa('0x24'),upload[_0x21fa('0x1c')](_0x21fa('0x1d')),controller['addFavicon']);router[_0x21fa('0x25')](_0x21fa('0x26'),auth[_0x21fa('0x27')](),controller[_0x21fa('0x28')]);module[_0x21fa('0x29')]=router; \ No newline at end of file +var _0xae25=['logologin','post','/:id/logo_login','addLogoLogin','server/files/images/logos/','%s%s','preferred','single','addPreferred','/:id/favicon','addFavicon','put','update','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','show','/:id/logo','getLogoLogin','/:id/gdpr','/:id/preferred','getFavicon','diskStorage','join','format','logo','extname','originalname','file','addLogo','root'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xae25,0xe0));var _0x5ae2=function(_0x2e83ac,_0x48ec7f){_0x2e83ac=_0x2e83ac-0x0;var _0x11d9b1=_0xae25[_0x2e83ac];return _0x11d9b1;};'use strict';var multer=require(_0x5ae2('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5ae2('0x1'));var router=express[_0x5ae2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5ae2('0x3'));var interaction=require(_0x5ae2('0x4'));var config=require(_0x5ae2('0x5'));var controller=require(_0x5ae2('0x6'));router['get']('/',auth[_0x5ae2('0x7')](),controller[_0x5ae2('0x8')]);router[_0x5ae2('0x9')](_0x5ae2('0xa'),controller[_0x5ae2('0xb')]);router['get'](_0x5ae2('0xc'),controller[_0x5ae2('0xd')]);router[_0x5ae2('0x9')](_0x5ae2('0xe'),controller['getLogo']);router[_0x5ae2('0x9')]('/:id/logo_login',controller[_0x5ae2('0xf')]);router[_0x5ae2('0x9')](_0x5ae2('0x10'),controller['gdpr']);router['get'](_0x5ae2('0x11'),controller['getPreferred']);router[_0x5ae2('0x9')]('/:id/favicon',controller[_0x5ae2('0x12')]);var upload=multer({'storage':multer[_0x5ae2('0x13')]({'destination':function(_0x2f456e,_0x27768b,_0x4e3489){_0x4e3489(null,path[_0x5ae2('0x14')](config['root'],'server/files/images/logos/'));},'filename':function(_0x2fa4ab,_0x270734,_0x5891b4){_0x5891b4(null,util[_0x5ae2('0x15')]('%s%s',_0x5ae2('0x16'),path[_0x5ae2('0x17')](_0x270734[_0x5ae2('0x18')])));}})});router['post'](_0x5ae2('0xe'),upload['single'](_0x5ae2('0x19')),controller[_0x5ae2('0x1a')]);var upload=multer({'storage':multer[_0x5ae2('0x13')]({'destination':function(_0x4fbc0b,_0x26b857,_0x139a96){_0x139a96(null,path[_0x5ae2('0x14')](config[_0x5ae2('0x1b')],'server/files/images/logos/'));},'filename':function(_0x3c1747,_0x55a82b,_0x35f1bb){_0x35f1bb(null,util[_0x5ae2('0x15')]('%s%s',_0x5ae2('0x1c'),path[_0x5ae2('0x17')](_0x55a82b['originalname'])));}})});router[_0x5ae2('0x1d')](_0x5ae2('0x1e'),upload['single']('file'),controller[_0x5ae2('0x1f')]);var upload=multer({'storage':multer[_0x5ae2('0x13')]({'destination':function(_0x540a7b,_0x486180,_0x217def){_0x217def(null,path[_0x5ae2('0x14')](config[_0x5ae2('0x1b')],_0x5ae2('0x20')));},'filename':function(_0x1a34c7,_0x3b7eef,_0x1fc2c8){_0x1fc2c8(null,util['format'](_0x5ae2('0x21'),_0x5ae2('0x22'),path[_0x5ae2('0x17')](_0x3b7eef[_0x5ae2('0x18')])));}})});router[_0x5ae2('0x1d')](_0x5ae2('0x11'),upload[_0x5ae2('0x23')](_0x5ae2('0x19')),controller[_0x5ae2('0x24')]);var upload=multer({'storage':multer[_0x5ae2('0x13')]({'destination':function(_0x417db0,_0x15ae9c,_0x44a8dc){_0x44a8dc(null,path[_0x5ae2('0x14')](config[_0x5ae2('0x1b')],'server/files/images/logos/'));},'filename':function(_0x20e8ce,_0x2bff2c,_0x315b66){_0x315b66(null,util[_0x5ae2('0x15')](_0x5ae2('0x21'),'favicon',path['extname'](_0x2bff2c[_0x5ae2('0x18')])));}})});router[_0x5ae2('0x1d')](_0x5ae2('0x25'),upload[_0x5ae2('0x23')](_0x5ae2('0x19')),controller[_0x5ae2('0x26')]);router[_0x5ae2('0x27')](_0x5ae2('0xc'),auth[_0x5ae2('0x7')](),controller[_0x5ae2('0x28')]);module[_0x5ae2('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index c02ca6b..c5541b8 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x589d65,_0x34e693){var _0x3d4925=function(_0x20683d){while(--_0x20683d){_0x589d65['push'](_0x589d65['shift']());}};_0x3d4925(++_0x34e693);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x3b7087,_0x471e7d){var _0x475ab8=function(_0x2415db){while(--_0x2415db){_0x3b7087['push'](_0x3b7087['shift']());}};_0x475ab8(++_0x471e7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 14caf5e..0b40c8a 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 _0x2cd3=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','Setting','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','body','file','logo','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','preferred','default_loginLogo.svg','Sequelize','gdpr','securePassword','getPreferred','default','custom','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2cd3,0xf1));var _0x32cd=function(_0x229d7e,_0x5bc489){_0x229d7e=_0x229d7e-0x0;var _0xa78280=_0x2cd3[_0x229d7e];return _0xa78280;};'use strict';var emlformat=require(_0x32cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32cd('0x1'));var jsonpatch=require(_0x32cd('0x2'));var rp=require(_0x32cd('0x3'));var moment=require(_0x32cd('0x4'));var BPromise=require(_0x32cd('0x5'));var Mustache=require(_0x32cd('0x6'));var util=require('util');var path=require('path');var sox=require(_0x32cd('0x7'));var csv=require(_0x32cd('0x8'));var ejs=require(_0x32cd('0x9'));var fs=require('fs');var fs_extra=require(_0x32cd('0xa'));var _=require(_0x32cd('0xb'));var squel=require(_0x32cd('0xc'));var crypto=require(_0x32cd('0xd'));var jsforce=require(_0x32cd('0xe'));var deskjs=require(_0x32cd('0xf'));var toCsv=require(_0x32cd('0x8'));var querystring=require(_0x32cd('0x10'));var Papa=require(_0x32cd('0x11'));var Redis=require(_0x32cd('0x12'));var authService=require(_0x32cd('0x13'));var qs=require(_0x32cd('0x14'));var as=require(_0x32cd('0x15'));var hardwareService=require(_0x32cd('0x16'));var logger=require(_0x32cd('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x32cd('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x32cd('0x19'));var client=jayson[_0x32cd('0x1a')][_0x32cd('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x28f99e,_0x1a80b7,_0x32c699,_0x3ce589){return new BPromise(function(_0x542a02,_0x51b452){var _0x4f35ec=_0x3ce589||client;return _0x4f35ec[_0x32cd('0x1c')](_0x28f99e,_0x32c699)[_0x32cd('0x1d')](function(_0x440984){logger['info'](_0x32cd('0x1e'),_0x1a80b7,'request\x20sent');logger['debug'](_0x32cd('0x1f'),_0x1a80b7,_0x32cd('0x20'),JSON[_0x32cd('0x21')](_0x440984));if(_0x440984[_0x32cd('0x22')]){if(_0x440984[_0x32cd('0x22')][_0x32cd('0x23')]===0x1f4){logger['error'](_0x32cd('0x1e'),_0x1a80b7,_0x440984[_0x32cd('0x22')][_0x32cd('0x24')]);return _0x51b452(_0x440984['error']['message']);}logger[_0x32cd('0x22')](_0x32cd('0x1e'),_0x1a80b7,_0x440984[_0x32cd('0x22')][_0x32cd('0x24')]);return _0x542a02(_0x440984[_0x32cd('0x22')]['message']);}else{logger[_0x32cd('0x25')](_0x32cd('0x1e'),_0x1a80b7,_0x32cd('0x20'));_0x542a02(_0x440984[_0x32cd('0x26')][_0x32cd('0x24')]);}})[_0x32cd('0x27')](function(_0x22e5e9){logger[_0x32cd('0x22')]('Setting,\x20%s,\x20%s',_0x1a80b7,_0x22e5e9);_0x51b452(_0x22e5e9);});});}function respondWithStatusCode(_0x3eb73c,_0x5ddfaa){_0x5ddfaa=_0x5ddfaa||0xcc;return function(_0x4c7f55){if(_0x4c7f55){return _0x3eb73c[_0x32cd('0x28')](_0x5ddfaa);}return _0x3eb73c['status'](_0x5ddfaa)['end']();};}function respondWithResult(_0x22de50,_0x57782c){_0x57782c=_0x57782c||0xc8;return function(_0x54be38){if(_0x54be38){return _0x22de50['status'](_0x57782c)[_0x32cd('0x29')](_0x54be38);}};}function respondWithFilteredResult(_0x1abddd,_0x25d9be){return function(_0x1af82f){if(_0x1af82f){var _0x57bda5=typeof _0x25d9be['offset']==='undefined'&&typeof _0x25d9be[_0x32cd('0x2a')]===_0x32cd('0x2b');var _0x5ef889=_0x1af82f[_0x32cd('0x2c')];var _0x35f798=_0x57bda5?0x0:_0x25d9be[_0x32cd('0x2d')];var _0x241424=_0x57bda5?_0x1af82f[_0x32cd('0x2c')]:_0x25d9be[_0x32cd('0x2d')]+_0x25d9be['limit'];var _0x38f998;if(_0x241424>=_0x5ef889){_0x241424=_0x5ef889;_0x38f998=0xc8;}else{_0x38f998=0xce;}_0x1abddd[_0x32cd('0x2e')](_0x38f998);return _0x1abddd[_0x32cd('0x2f')](_0x32cd('0x30'),_0x35f798+'-'+_0x241424+'/'+_0x5ef889)[_0x32cd('0x29')](_0x1af82f);}return null;};}function patchUpdates(_0x1232f1){return function(_0x5053ff){try{jsonpatch[_0x32cd('0x31')](_0x5053ff,_0x1232f1,!![]);}catch(_0x3dbd6b){return BPromise[_0x32cd('0x32')](_0x3dbd6b);}return _0x5053ff[_0x32cd('0x33')]();};}function saveUpdates(_0x42385a,_0x2ed13e){return function(_0x49da33){if(_0x49da33){return _0x49da33[_0x32cd('0x34')](_0x42385a)[_0x32cd('0x1d')](function(_0x49abf0){return _0x49abf0;});}return null;};}function removeEntity(_0x4321be,_0x1fd665){return function(_0x441824){if(_0x441824){return _0x441824[_0x32cd('0x35')]()[_0x32cd('0x1d')](function(){_0x4321be[_0x32cd('0x2e')](0xcc)[_0x32cd('0x36')]();});}};}function handleEntityNotFound(_0x24a1ef,_0x11aa2e){return function(_0x1241f3){if(!_0x1241f3){_0x24a1ef[_0x32cd('0x28')](0x194);}return _0x1241f3;};}function handleError(_0xd46797,_0x2ff2cf){_0x2ff2cf=_0x2ff2cf||0x1f4;return function(_0x4cce47){logger[_0x32cd('0x22')](_0x4cce47[_0x32cd('0x37')]);if(_0x4cce47[_0x32cd('0x38')]){delete _0x4cce47[_0x32cd('0x38')];}_0xd46797['status'](_0x2ff2cf)['send'](_0x4cce47);};}exports[_0x32cd('0x39')]=function(_0x417663,_0x3b10ec){var _0x481e23={},_0x3a4f49={},_0x330e77={'count':0x0,'rows':[]};var _0x10aefd=_[_0x32cd('0x3a')](db[_0x32cd('0x3b')][_0x32cd('0x3c')],function(_0x100b3c){return{'name':_0x100b3c[_0x32cd('0x3d')],'type':_0x100b3c[_0x32cd('0x3e')]['key']};});_0x3a4f49[_0x32cd('0x3f')]=_['map'](_0x10aefd,_0x32cd('0x38'));_0x3a4f49[_0x32cd('0x40')]=_[_0x32cd('0x41')](_0x417663[_0x32cd('0x40')]);_0x3a4f49['filters']=_[_0x32cd('0x42')](_0x3a4f49[_0x32cd('0x3f')],_0x3a4f49[_0x32cd('0x40')]);_0x481e23[_0x32cd('0x43')]=_[_0x32cd('0x42')](_0x3a4f49[_0x32cd('0x3f')],qs[_0x32cd('0x44')](_0x417663[_0x32cd('0x40')][_0x32cd('0x44')]));_0x481e23[_0x32cd('0x43')]=_0x481e23[_0x32cd('0x43')][_0x32cd('0x45')]?_0x481e23[_0x32cd('0x43')]:_0x3a4f49[_0x32cd('0x3f')];if(!_0x417663[_0x32cd('0x40')][_0x32cd('0x46')](_0x32cd('0x47'))){_0x481e23['limit']=qs[_0x32cd('0x2a')](_0x417663[_0x32cd('0x40')]['limit']);_0x481e23[_0x32cd('0x2d')]=qs[_0x32cd('0x2d')](_0x417663[_0x32cd('0x40')]['offset']);}_0x481e23['order']=qs[_0x32cd('0x48')](_0x417663[_0x32cd('0x40')][_0x32cd('0x48')]);_0x481e23[_0x32cd('0x49')]=qs['filters'](_[_0x32cd('0x4a')](_0x417663[_0x32cd('0x40')],_0x3a4f49[_0x32cd('0x4b')]),_0x10aefd);if(_0x417663[_0x32cd('0x40')][_0x32cd('0x4c')]){_0x481e23[_0x32cd('0x49')]=_[_0x32cd('0x4d')](_0x481e23['where'],{'$or':_[_0x32cd('0x3a')](_0x10aefd,function(_0x9826e){if(_0x9826e['type']!==_0x32cd('0x4e')){var _0x13b579={};_0x13b579[_0x9826e['name']]={'$like':'%'+_0x417663[_0x32cd('0x40')][_0x32cd('0x4c')]+'%'};return _0x13b579;}})});}_0x481e23=_['merge']({},_0x481e23,_0x417663[_0x32cd('0x4f')]);var _0xffd6df={'where':_0x481e23[_0x32cd('0x49')]};return db['Setting'][_0x32cd('0x2c')](_0xffd6df)[_0x32cd('0x1d')](function(_0xac75b0){_0x330e77['count']=_0xac75b0;if(_0x417663[_0x32cd('0x40')][_0x32cd('0x50')]){_0x481e23[_0x32cd('0x51')]=[{'all':!![]}];}return db[_0x32cd('0x3b')][_0x32cd('0x52')](_0x481e23);})[_0x32cd('0x1d')](function(_0xd1d4){_0x330e77['rows']=_0xd1d4;return _0x330e77;})[_0x32cd('0x1d')](respondWithFilteredResult(_0x3b10ec,_0x481e23))['catch'](handleError(_0x3b10ec,null));};exports[_0x32cd('0x53')]=function(_0x3e7de8,_0x492320){var _0x88b34b={'raw':![],'where':{'id':_0x3e7de8[_0x32cd('0x54')]['id']}},_0x27aabc={};_0x27aabc[_0x32cd('0x3f')]=_[_0x32cd('0x41')](db[_0x32cd('0x3b')][_0x32cd('0x3c')]);_0x27aabc[_0x32cd('0x40')]=_['keys'](_0x3e7de8[_0x32cd('0x40')]);_0x27aabc['filters']=_[_0x32cd('0x42')](_0x27aabc[_0x32cd('0x3f')],_0x27aabc[_0x32cd('0x40')]);_0x88b34b[_0x32cd('0x43')]=_[_0x32cd('0x42')](_0x27aabc[_0x32cd('0x3f')],qs[_0x32cd('0x44')](_0x3e7de8[_0x32cd('0x40')]['fields']));_0x88b34b[_0x32cd('0x43')]=_0x88b34b[_0x32cd('0x43')][_0x32cd('0x45')]?_0x88b34b['attributes']:_0x27aabc[_0x32cd('0x3f')];if(_0x3e7de8[_0x32cd('0x40')][_0x32cd('0x50')]){_0x88b34b['include']=[{'all':!![]}];}_0x88b34b=_['merge']({},_0x88b34b,_0x3e7de8[_0x32cd('0x4f')]);return db['Setting'][_0x32cd('0x55')](_0x88b34b)[_0x32cd('0x1d')](handleEntityNotFound(_0x492320,null))['then'](respondWithResult(_0x492320,null))['catch'](handleError(_0x492320,null));};exports['update']=function(_0x1c7b25,_0x583f01){if(_0x1c7b25['body']['id']){delete _0x1c7b25[_0x32cd('0x56')]['id'];}return db[_0x32cd('0x3b')][_0x32cd('0x55')]({'where':{'id':_0x1c7b25[_0x32cd('0x54')]['id']}})[_0x32cd('0x1d')](handleEntityNotFound(_0x583f01,null))[_0x32cd('0x1d')](saveUpdates(_0x1c7b25[_0x32cd('0x56')],null))[_0x32cd('0x1d')](respondWithResult(_0x583f01,null))['catch'](handleError(_0x583f01,null));};exports['addLogo']=function(_0x3bccbf,_0x39c7be,_0x54ea80){if(_0x3bccbf[_0x32cd('0x57')]&&_0x3bccbf[_0x32cd('0x57')]['filename']){_0x3bccbf[_0x32cd('0x56')][_0x32cd('0x58')]=_0x3bccbf[_0x32cd('0x57')][_0x32cd('0x59')];}return db[_0x32cd('0x3b')][_0x32cd('0x55')]({'where':{'id':_0x3bccbf['params']['id']}})['then'](handleEntityNotFound(_0x39c7be,null))[_0x32cd('0x1d')](saveUpdates(_0x3bccbf[_0x32cd('0x56')],null))[_0x32cd('0x1d')](respondWithResult(_0x39c7be,null))[_0x32cd('0x27')](handleError(_0x39c7be,null));};exports[_0x32cd('0x5a')]=function(_0x498cff,_0x67b566,_0x380213){if(_0x498cff[_0x32cd('0x57')]&&_0x498cff[_0x32cd('0x57')]['filename']){_0x498cff[_0x32cd('0x56')][_0x32cd('0x5b')]=_0x498cff[_0x32cd('0x57')][_0x32cd('0x59')];}return db['Setting'][_0x32cd('0x55')]({'where':{'id':_0x498cff['params']['id']}})[_0x32cd('0x1d')](handleEntityNotFound(_0x67b566,null))[_0x32cd('0x1d')](saveUpdates(_0x498cff[_0x32cd('0x56')],null))[_0x32cd('0x1d')](respondWithResult(_0x67b566,null))['catch'](handleError(_0x67b566,null));};var utilLicense=require(_0x32cd('0x5c'));exports[_0x32cd('0x5d')]=function(_0x1e313d,_0x10a420,_0x1ba647){var _0x4ea13b=_0x32cd('0x5e');var _0x529c1a={'custom':![]};return utilLicense['getLicense']()[_0x32cd('0x1d')](function(_0x1e0875){if(_0x1e0875){_0x529c1a=_0x1e0875;}return db[_0x32cd('0x3b')]['find']({'where':{'id':_0x1e313d[_0x32cd('0x54')]['id']},'attributes':[_0x32cd('0x58'),_0x32cd('0x5b'),'preferred',_0x32cd('0x5f'),_0x32cd('0x60'),_0x32cd('0x61'),_0x32cd('0x62'),_0x32cd('0x63')],'raw':!![]});})[_0x32cd('0x1d')](handleEntityNotFound(_0x10a420,null))[_0x32cd('0x1d')](function(_0x27be15){if(_0x27be15){var _0x32b0fd=_0x27be15[_0x32cd('0x58')]&&fs[_0x32cd('0x64')](path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x4ea13b,_[_0x32cd('0x67')](_0x27be15[_0x32cd('0x58')])))?path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x4ea13b,_[_0x32cd('0x67')](_0x27be15[_0x32cd('0x58')])):path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x4ea13b,_[_0x32cd('0x67')](_0x32cd('0x68')));var _0x5ab5ad='default'+_[_0x32cd('0x69')]('logo');if(_0x27be15[_0x5ab5ad]||!_0x529c1a['custom']){_0x32b0fd=path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x4ea13b,_['toLower']('default_logo.svg'));}if(!fs[_0x32cd('0x64')](_0x32b0fd)){throw new db['Sequelize'][(_0x32cd('0x6a'))](_['upperFirst'](_0x32cd('0x58'))+_0x32cd('0x6b'));}return _0x10a420[_0x32cd('0x6c')](_0x32b0fd);}})['catch'](handleError(_0x10a420,null));};var utilLicense=require(_0x32cd('0x5c'));exports[_0x32cd('0x6d')]=function(_0xda0bc0,_0x4afbdc,_0x1a5ea8){var _0x94b72a=_0x32cd('0x5e');var _0x33bbec={'custom':![]};return utilLicense[_0x32cd('0x6e')]()[_0x32cd('0x1d')](function(_0xadf8a5){if(_0xadf8a5){_0x33bbec=_0xadf8a5;}return db[_0x32cd('0x3b')]['find']({'where':{'id':_0xda0bc0[_0x32cd('0x54')]['id']},'attributes':[_0x32cd('0x58'),'loginLogo',_0x32cd('0x6f'),_0x32cd('0x5f'),_0x32cd('0x60'),_0x32cd('0x61'),_0x32cd('0x62'),'defaultFavicon'],'raw':!![]});})[_0x32cd('0x1d')](handleEntityNotFound(_0x4afbdc,null))[_0x32cd('0x1d')](function(_0x2be08e){if(_0x2be08e){var _0x42a238=_0x2be08e[_0x32cd('0x5b')]&&fs['existsSync'](path['join'](config[_0x32cd('0x66')],_0x94b72a,_['toLower'](_0x2be08e[_0x32cd('0x5b')])))?path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x94b72a,_[_0x32cd('0x67')](_0x2be08e[_0x32cd('0x5b')])):path['join'](config['root'],_0x94b72a,_[_0x32cd('0x67')](_0x32cd('0x70')));var _0x60fc80='default'+_['upperFirst']('loginLogo');if(_0x2be08e[_0x60fc80]||!_0x33bbec['custom']){_0x42a238=path['join'](config[_0x32cd('0x66')],_0x94b72a,_['toLower'](_0x32cd('0x70')));}if(!fs['existsSync'](_0x42a238)){throw new db[(_0x32cd('0x71'))][(_0x32cd('0x6a'))](_[_0x32cd('0x69')]('loginLogo')+_0x32cd('0x6b'));}return _0x4afbdc[_0x32cd('0x6c')](_0x42a238);}})['catch'](handleError(_0x4afbdc,null));};exports[_0x32cd('0x72')]=function(_0x59d99a,_0x378f85){return db[_0x32cd('0x3b')][_0x32cd('0x55')]({'where':{'id':_0x59d99a[_0x32cd('0x54')]['id']},'attributes':[_0x32cd('0x73')]})[_0x32cd('0x1d')](respondWithResult(_0x378f85,null))['catch'](handleError(_0x378f85,null));};exports['addPreferred']=function(_0xd8d7f0,_0x37921b,_0x2f378b){if(_0xd8d7f0[_0x32cd('0x57')]&&_0xd8d7f0[_0x32cd('0x57')][_0x32cd('0x59')]){_0xd8d7f0[_0x32cd('0x56')][_0x32cd('0x6f')]=_0xd8d7f0['file'][_0x32cd('0x59')];}return db[_0x32cd('0x3b')][_0x32cd('0x55')]({'where':{'id':_0xd8d7f0[_0x32cd('0x54')]['id']}})['then'](handleEntityNotFound(_0x37921b,null))['then'](saveUpdates(_0xd8d7f0[_0x32cd('0x56')],null))['then'](respondWithResult(_0x37921b,null))[_0x32cd('0x27')](handleError(_0x37921b,null));};var utilLicense=require(_0x32cd('0x5c'));exports[_0x32cd('0x74')]=function(_0x550a0d,_0x35d50c,_0x557c0){var _0x1eccb1=_0x32cd('0x5e');var _0x49c467={'custom':![]};return utilLicense[_0x32cd('0x6e')]()['then'](function(_0x1d4c39){if(_0x1d4c39){_0x49c467=_0x1d4c39;}return db[_0x32cd('0x3b')]['find']({'where':{'id':_0x550a0d['params']['id']},'attributes':['logo','loginLogo',_0x32cd('0x6f'),_0x32cd('0x5f'),'defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x32cd('0x1d')](handleEntityNotFound(_0x35d50c,null))['then'](function(_0x135a80){if(_0x135a80){var _0x40149f=_0x135a80[_0x32cd('0x6f')]&&fs[_0x32cd('0x64')](path['join'](config['root'],_0x1eccb1,_['toLower'](_0x135a80[_0x32cd('0x6f')])))?path[_0x32cd('0x65')](config['root'],_0x1eccb1,_[_0x32cd('0x67')](_0x135a80[_0x32cd('0x6f')])):path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x1eccb1,_[_0x32cd('0x67')]('default_preferred.png'));var _0x301269=_0x32cd('0x75')+_[_0x32cd('0x69')](_0x32cd('0x6f'));if(_0x135a80[_0x301269]||!_0x49c467[_0x32cd('0x76')]||!_0x49c467[_0x32cd('0x6f')]){_0x40149f=path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x1eccb1,_[_0x32cd('0x67')]('default_preferred.png'));}if(!fs[_0x32cd('0x64')](_0x40149f)){throw new db[(_0x32cd('0x71'))][(_0x32cd('0x6a'))](_[_0x32cd('0x69')](_0x32cd('0x6f'))+_0x32cd('0x6b'));}return _0x35d50c[_0x32cd('0x6c')](_0x40149f);}})[_0x32cd('0x27')](handleError(_0x35d50c,null));};exports[_0x32cd('0x77')]=function(_0x1feb72,_0x27da52,_0x1b6b57){if(_0x1feb72['file']&&_0x1feb72[_0x32cd('0x57')][_0x32cd('0x59')]){_0x1feb72[_0x32cd('0x56')][_0x32cd('0x5f')]=_0x1feb72[_0x32cd('0x57')][_0x32cd('0x59')];}return db['Setting'][_0x32cd('0x55')]({'where':{'id':_0x1feb72[_0x32cd('0x54')]['id']}})[_0x32cd('0x1d')](handleEntityNotFound(_0x27da52,null))['then'](saveUpdates(_0x1feb72[_0x32cd('0x56')],null))['then'](respondWithResult(_0x27da52,null))[_0x32cd('0x27')](handleError(_0x27da52,null));};var utilLicense=require(_0x32cd('0x5c'));exports[_0x32cd('0x78')]=function(_0x2d9104,_0x2aa21c,_0x653d){var _0x111f12=_0x32cd('0x5e');var _0x2cc6b4={'custom':![]};return utilLicense[_0x32cd('0x6e')]()[_0x32cd('0x1d')](function(_0xca921a){if(_0xca921a){_0x2cc6b4=_0xca921a;}return db['Setting'][_0x32cd('0x55')]({'where':{'id':_0x2d9104[_0x32cd('0x54')]['id']},'attributes':[_0x32cd('0x58'),'loginLogo','preferred',_0x32cd('0x5f'),_0x32cd('0x60'),'defaultLoginLogo','defaultPreferred',_0x32cd('0x63')],'raw':!![]});})[_0x32cd('0x1d')](handleEntityNotFound(_0x2aa21c,null))[_0x32cd('0x1d')](function(_0x1ca490){if(_0x1ca490){var _0x2a9293=_0x1ca490[_0x32cd('0x5f')]&&fs['existsSync'](path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x111f12,_[_0x32cd('0x67')](_0x1ca490['favicon'])))?path['join'](config[_0x32cd('0x66')],_0x111f12,_[_0x32cd('0x67')](_0x1ca490[_0x32cd('0x5f')])):path[_0x32cd('0x65')](config['root'],_0x111f12,_[_0x32cd('0x67')](_0x32cd('0x79')));var _0x48fbb6='default'+_[_0x32cd('0x69')](_0x32cd('0x5f'));if(_0x1ca490[_0x48fbb6]||!_0x2cc6b4[_0x32cd('0x76')]){_0x2a9293=path['join'](config['root'],_0x111f12,_[_0x32cd('0x67')](_0x32cd('0x79')));}if(!fs[_0x32cd('0x64')](_0x2a9293)){throw new db['Sequelize'][(_0x32cd('0x6a'))](_[_0x32cd('0x69')](_0x32cd('0x5f'))+_0x32cd('0x6b'));}return _0x2aa21c[_0x32cd('0x6c')](_0x2a9293);}})[_0x32cd('0x27')](handleError(_0x2aa21c,null));};exports[_0x32cd('0x7a')]=function(_0x24ea8a,_0x3e62fe){var _0x2f829f={'offset':moment()['utcOffset']()};_0x2f829f['now']=moment()[_0x32cd('0x7b')](_0x2f829f['offset'])[_0x32cd('0x7c')](_0x32cd('0x7d'));return _0x3e62fe[_0x32cd('0x2e')](0xc8)['send'](_0x2f829f);}; \ No newline at end of file +var _0x707d=['index','map','Setting','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','../../config/license/util','getLogoLogin','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','defaultLogo','default_preferred.png','addFavicon','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','message','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','end','stack','name','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x707d,0x12d));var _0xd707=function(_0x284084,_0x5119f3){_0x284084=_0x284084-0x0;var _0x5c5f11=_0x707d[_0x284084];return _0x5c5f11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd707('0x0'));var zipdir=require(_0xd707('0x1'));var jsonpatch=require(_0xd707('0x2'));var rp=require(_0xd707('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd707('0x4'));var path=require(_0xd707('0x5'));var sox=require('sox');var csv=require(_0xd707('0x6'));var ejs=require(_0xd707('0x7'));var fs=require('fs');var fs_extra=require(_0xd707('0x8'));var _=require('lodash');var squel=require(_0xd707('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd707('0xa'));var toCsv=require(_0xd707('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd707('0xb'));var authService=require(_0xd707('0xc'));var qs=require(_0xd707('0xd'));var as=require(_0xd707('0xe'));var hardwareService=require(_0xd707('0xf'));var logger=require(_0xd707('0x10'))(_0xd707('0x11'));var utils=require(_0xd707('0x12'));var config=require(_0xd707('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd707('0x14'))['db'];var jayson=require(_0xd707('0x15'));var client=jayson[_0xd707('0x16')][_0xd707('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x2c542b,_0x1dd032,_0x43c099,_0x10d387){return new BPromise(function(_0x2f5095,_0x1a6cf3){var _0x1e1555=_0x10d387||client;return _0x1e1555[_0xd707('0x18')](_0x2c542b,_0x43c099)[_0xd707('0x19')](function(_0x45315a){logger[_0xd707('0x1a')](_0xd707('0x1b'),_0x1dd032,_0xd707('0x1c'));logger['debug'](_0xd707('0x1d'),_0x1dd032,_0xd707('0x1c'),JSON['stringify'](_0x45315a));if(_0x45315a[_0xd707('0x1e')]){if(_0x45315a[_0xd707('0x1e')]['code']===0x1f4){logger['error'](_0xd707('0x1b'),_0x1dd032,_0x45315a[_0xd707('0x1e')][_0xd707('0x1f')]);return _0x1a6cf3(_0x45315a['error']['message']);}logger['error'](_0xd707('0x1b'),_0x1dd032,_0x45315a[_0xd707('0x1e')][_0xd707('0x1f')]);return _0x2f5095(_0x45315a[_0xd707('0x1e')][_0xd707('0x1f')]);}else{logger[_0xd707('0x1a')](_0xd707('0x1b'),_0x1dd032,_0xd707('0x1c'));_0x2f5095(_0x45315a['result'][_0xd707('0x1f')]);}})['catch'](function(_0x2c565f){logger['error'](_0xd707('0x1b'),_0x1dd032,_0x2c565f);_0x1a6cf3(_0x2c565f);});});}function respondWithStatusCode(_0x1ebe0d,_0x359afb){_0x359afb=_0x359afb||0xcc;return function(_0x3b5a58){if(_0x3b5a58){return _0x1ebe0d[_0xd707('0x20')](_0x359afb);}return _0x1ebe0d[_0xd707('0x21')](_0x359afb)['end']();};}function respondWithResult(_0x4dba8d,_0x39ece1){_0x39ece1=_0x39ece1||0xc8;return function(_0x77f544){if(_0x77f544){return _0x4dba8d[_0xd707('0x21')](_0x39ece1)[_0xd707('0x22')](_0x77f544);}};}function respondWithFilteredResult(_0x34003a,_0x1d6a0e){return function(_0x2374c9){if(_0x2374c9){var _0x21db2a=typeof _0x1d6a0e[_0xd707('0x23')]===_0xd707('0x24')&&typeof _0x1d6a0e[_0xd707('0x25')]===_0xd707('0x24');var _0x27819f=_0x2374c9[_0xd707('0x26')];var _0x1b34da=_0x21db2a?0x0:_0x1d6a0e[_0xd707('0x23')];var _0x20a594=_0x21db2a?_0x2374c9[_0xd707('0x26')]:_0x1d6a0e[_0xd707('0x23')]+_0x1d6a0e[_0xd707('0x25')];var _0x4f063f;if(_0x20a594>=_0x27819f){_0x20a594=_0x27819f;_0x4f063f=0xc8;}else{_0x4f063f=0xce;}_0x34003a['status'](_0x4f063f);return _0x34003a['set'](_0xd707('0x27'),_0x1b34da+'-'+_0x20a594+'/'+_0x27819f)[_0xd707('0x22')](_0x2374c9);}return null;};}function patchUpdates(_0x36f883){return function(_0x554ff1){try{jsonpatch[_0xd707('0x28')](_0x554ff1,_0x36f883,!![]);}catch(_0x206def){return BPromise[_0xd707('0x29')](_0x206def);}return _0x554ff1[_0xd707('0x2a')]();};}function saveUpdates(_0xb1884b,_0x2be803){return function(_0x144728){if(_0x144728){return _0x144728['update'](_0xb1884b)[_0xd707('0x19')](function(_0x31406f){return _0x31406f;});}return null;};}function removeEntity(_0x55d73f,_0xf6ff08){return function(_0x3371e0){if(_0x3371e0){return _0x3371e0['destroy']()[_0xd707('0x19')](function(){_0x55d73f[_0xd707('0x21')](0xcc)[_0xd707('0x2b')]();});}};}function handleEntityNotFound(_0x1dc7af,_0x4d6ef4){return function(_0x37b0b0){if(!_0x37b0b0){_0x1dc7af[_0xd707('0x20')](0x194);}return _0x37b0b0;};}function handleError(_0x1773af,_0x1a0eda){_0x1a0eda=_0x1a0eda||0x1f4;return function(_0x43d6b9){logger['error'](_0x43d6b9[_0xd707('0x2c')]);if(_0x43d6b9[_0xd707('0x2d')]){delete _0x43d6b9[_0xd707('0x2d')];}_0x1773af['status'](_0x1a0eda)[_0xd707('0x2e')](_0x43d6b9);};}exports[_0xd707('0x2f')]=function(_0x3399cc,_0x4d27d6){var _0x5fe867={},_0x4f115e={},_0x1965d9={'count':0x0,'rows':[]};var _0x238f7c=_[_0xd707('0x30')](db[_0xd707('0x31')][_0xd707('0x32')],function(_0x2a0312){return{'name':_0x2a0312[_0xd707('0x33')],'type':_0x2a0312[_0xd707('0x34')]['key']};});_0x4f115e[_0xd707('0x35')]=_[_0xd707('0x30')](_0x238f7c,_0xd707('0x2d'));_0x4f115e['query']=_[_0xd707('0x36')](_0x3399cc[_0xd707('0x37')]);_0x4f115e[_0xd707('0x38')]=_['intersection'](_0x4f115e[_0xd707('0x35')],_0x4f115e[_0xd707('0x37')]);_0x5fe867[_0xd707('0x39')]=_[_0xd707('0x3a')](_0x4f115e[_0xd707('0x35')],qs['fields'](_0x3399cc[_0xd707('0x37')][_0xd707('0x3b')]));_0x5fe867['attributes']=_0x5fe867[_0xd707('0x39')][_0xd707('0x3c')]?_0x5fe867[_0xd707('0x39')]:_0x4f115e[_0xd707('0x35')];if(!_0x3399cc['query']['hasOwnProperty'](_0xd707('0x3d'))){_0x5fe867[_0xd707('0x25')]=qs[_0xd707('0x25')](_0x3399cc[_0xd707('0x37')][_0xd707('0x25')]);_0x5fe867[_0xd707('0x23')]=qs[_0xd707('0x23')](_0x3399cc[_0xd707('0x37')]['offset']);}_0x5fe867['order']=qs['sort'](_0x3399cc['query'][_0xd707('0x3e')]);_0x5fe867[_0xd707('0x3f')]=qs[_0xd707('0x38')](_[_0xd707('0x40')](_0x3399cc[_0xd707('0x37')],_0x4f115e[_0xd707('0x38')]),_0x238f7c);if(_0x3399cc[_0xd707('0x37')][_0xd707('0x41')]){_0x5fe867[_0xd707('0x3f')]=_[_0xd707('0x42')](_0x5fe867['where'],{'$or':_[_0xd707('0x30')](_0x238f7c,function(_0x50f592){if(_0x50f592[_0xd707('0x34')]!==_0xd707('0x43')){var _0x2ce558={};_0x2ce558[_0x50f592[_0xd707('0x2d')]]={'$like':'%'+_0x3399cc['query'][_0xd707('0x41')]+'%'};return _0x2ce558;}})});}_0x5fe867=_[_0xd707('0x42')]({},_0x5fe867,_0x3399cc[_0xd707('0x44')]);var _0x1cc8d9={'where':_0x5fe867['where']};return db[_0xd707('0x31')][_0xd707('0x26')](_0x1cc8d9)[_0xd707('0x19')](function(_0x1cda4c){_0x1965d9[_0xd707('0x26')]=_0x1cda4c;if(_0x3399cc[_0xd707('0x37')][_0xd707('0x45')]){_0x5fe867['include']=[{'all':!![]}];}return db[_0xd707('0x31')][_0xd707('0x46')](_0x5fe867);})[_0xd707('0x19')](function(_0x410160){_0x1965d9[_0xd707('0x47')]=_0x410160;return _0x1965d9;})[_0xd707('0x19')](respondWithFilteredResult(_0x4d27d6,_0x5fe867))[_0xd707('0x48')](handleError(_0x4d27d6,null));};exports['show']=function(_0x156c88,_0x2a3b7e){var _0x33c575={'raw':![],'where':{'id':_0x156c88[_0xd707('0x49')]['id']}},_0x1a8cd4={};_0x1a8cd4['model']=_[_0xd707('0x36')](db['Setting'][_0xd707('0x32')]);_0x1a8cd4[_0xd707('0x37')]=_[_0xd707('0x36')](_0x156c88[_0xd707('0x37')]);_0x1a8cd4[_0xd707('0x38')]=_[_0xd707('0x3a')](_0x1a8cd4[_0xd707('0x35')],_0x1a8cd4[_0xd707('0x37')]);_0x33c575[_0xd707('0x39')]=_[_0xd707('0x3a')](_0x1a8cd4[_0xd707('0x35')],qs[_0xd707('0x3b')](_0x156c88['query'][_0xd707('0x3b')]));_0x33c575[_0xd707('0x39')]=_0x33c575['attributes']['length']?_0x33c575[_0xd707('0x39')]:_0x1a8cd4['model'];if(_0x156c88[_0xd707('0x37')][_0xd707('0x45')]){_0x33c575[_0xd707('0x4a')]=[{'all':!![]}];}_0x33c575=_[_0xd707('0x42')]({},_0x33c575,_0x156c88[_0xd707('0x44')]);return db[_0xd707('0x31')][_0xd707('0x4b')](_0x33c575)[_0xd707('0x19')](handleEntityNotFound(_0x2a3b7e,null))['then'](respondWithResult(_0x2a3b7e,null))[_0xd707('0x48')](handleError(_0x2a3b7e,null));};exports['update']=function(_0x3b7c29,_0x2f812c){if(_0x3b7c29[_0xd707('0x4c')]['id']){delete _0x3b7c29[_0xd707('0x4c')]['id'];}return db['Setting'][_0xd707('0x4b')]({'where':{'id':_0x3b7c29[_0xd707('0x49')]['id']}})[_0xd707('0x19')](handleEntityNotFound(_0x2f812c,null))[_0xd707('0x19')](saveUpdates(_0x3b7c29[_0xd707('0x4c')],null))['then'](respondWithResult(_0x2f812c,null))[_0xd707('0x48')](handleError(_0x2f812c,null));};exports[_0xd707('0x4d')]=function(_0x35e46c,_0x45a23a,_0x2eafdf){if(_0x35e46c['file']&&_0x35e46c[_0xd707('0x4e')][_0xd707('0x4f')]){_0x35e46c[_0xd707('0x4c')][_0xd707('0x50')]=_0x35e46c['file'][_0xd707('0x4f')];}return db[_0xd707('0x31')][_0xd707('0x4b')]({'where':{'id':_0x35e46c[_0xd707('0x49')]['id']}})['then'](handleEntityNotFound(_0x45a23a,null))['then'](saveUpdates(_0x35e46c['body'],null))[_0xd707('0x19')](respondWithResult(_0x45a23a,null))[_0xd707('0x48')](handleError(_0x45a23a,null));};exports[_0xd707('0x51')]=function(_0x151c95,_0x1acdbf,_0x54bcb0){if(_0x151c95[_0xd707('0x4e')]&&_0x151c95[_0xd707('0x4e')][_0xd707('0x4f')]){_0x151c95[_0xd707('0x4c')][_0xd707('0x52')]=_0x151c95[_0xd707('0x4e')][_0xd707('0x4f')];}return db['Setting'][_0xd707('0x4b')]({'where':{'id':_0x151c95[_0xd707('0x49')]['id']}})[_0xd707('0x19')](handleEntityNotFound(_0x1acdbf,null))[_0xd707('0x19')](saveUpdates(_0x151c95[_0xd707('0x4c')],null))[_0xd707('0x19')](respondWithResult(_0x1acdbf,null))['catch'](handleError(_0x1acdbf,null));};var utilLicense=require('../../config/license/util');exports[_0xd707('0x53')]=function(_0x5cdc74,_0x5d570b,_0x36c974){var _0x29df18=_0xd707('0x54');var _0x120660={'custom':![]};return utilLicense[_0xd707('0x55')]()[_0xd707('0x19')](function(_0x1dbffa){if(_0x1dbffa){_0x120660=_0x1dbffa;}return db[_0xd707('0x31')][_0xd707('0x4b')]({'where':{'id':_0x5cdc74[_0xd707('0x49')]['id']},'attributes':[_0xd707('0x50'),_0xd707('0x52'),_0xd707('0x56'),_0xd707('0x57'),'defaultLogo',_0xd707('0x58'),_0xd707('0x59'),_0xd707('0x5a')],'raw':!![]});})[_0xd707('0x19')](handleEntityNotFound(_0x5d570b,null))[_0xd707('0x19')](function(_0x4c4f68){if(_0x4c4f68){var _0x44e3e0=_0x4c4f68['logo']&&fs[_0xd707('0x5b')](path[_0xd707('0x5c')](config['root'],_0x29df18,_[_0xd707('0x5d')](_0x4c4f68[_0xd707('0x50')])))?path[_0xd707('0x5c')](config[_0xd707('0x5e')],_0x29df18,_[_0xd707('0x5d')](_0x4c4f68[_0xd707('0x50')])):path['join'](config['root'],_0x29df18,_[_0xd707('0x5d')](_0xd707('0x5f')));var _0x4fcb39='default'+_[_0xd707('0x60')]('logo');if(_0x4c4f68[_0x4fcb39]||!_0x120660[_0xd707('0x61')]){_0x44e3e0=path['join'](config[_0xd707('0x5e')],_0x29df18,_[_0xd707('0x5d')](_0xd707('0x5f')));}if(!fs[_0xd707('0x5b')](_0x44e3e0)){throw new db[(_0xd707('0x62'))][(_0xd707('0x63'))](_[_0xd707('0x60')](_0xd707('0x50'))+_0xd707('0x64'));}return _0x5d570b[_0xd707('0x65')](_0x44e3e0);}})[_0xd707('0x48')](handleError(_0x5d570b,null));};var utilLicense=require(_0xd707('0x66'));exports[_0xd707('0x67')]=function(_0x45a95f,_0x54f7b0,_0x4e0fa6){var _0x49e1de=_0xd707('0x54');var _0x5f02dc={'custom':![]};return utilLicense[_0xd707('0x55')]()[_0xd707('0x19')](function(_0xb3d4a9){if(_0xb3d4a9){_0x5f02dc=_0xb3d4a9;}return db[_0xd707('0x31')][_0xd707('0x4b')]({'where':{'id':_0x45a95f[_0xd707('0x49')]['id']},'attributes':[_0xd707('0x50'),_0xd707('0x52'),_0xd707('0x56'),_0xd707('0x57'),'defaultLogo',_0xd707('0x58'),_0xd707('0x59'),_0xd707('0x5a')],'raw':!![]});})[_0xd707('0x19')](handleEntityNotFound(_0x54f7b0,null))[_0xd707('0x19')](function(_0x526d95){if(_0x526d95){var _0x2d9bae=_0x526d95[_0xd707('0x52')]&&fs['existsSync'](path['join'](config[_0xd707('0x5e')],_0x49e1de,_[_0xd707('0x5d')](_0x526d95[_0xd707('0x52')])))?path[_0xd707('0x5c')](config[_0xd707('0x5e')],_0x49e1de,_[_0xd707('0x5d')](_0x526d95[_0xd707('0x52')])):path[_0xd707('0x5c')](config[_0xd707('0x5e')],_0x49e1de,_[_0xd707('0x5d')](_0xd707('0x68')));var _0x1d3d31='default'+_[_0xd707('0x60')](_0xd707('0x52'));if(_0x526d95[_0x1d3d31]||!_0x5f02dc[_0xd707('0x61')]){_0x2d9bae=path['join'](config['root'],_0x49e1de,_[_0xd707('0x5d')](_0xd707('0x68')));}if(!fs[_0xd707('0x5b')](_0x2d9bae)){throw new db[(_0xd707('0x62'))][(_0xd707('0x63'))](_['upperFirst'](_0xd707('0x52'))+_0xd707('0x64'));}return _0x54f7b0[_0xd707('0x65')](_0x2d9bae);}})[_0xd707('0x48')](handleError(_0x54f7b0,null));};exports[_0xd707('0x69')]=function(_0x471a12,_0x449de){return db[_0xd707('0x31')]['find']({'where':{'id':_0x471a12['params']['id']},'attributes':[_0xd707('0x6a')]})[_0xd707('0x19')](respondWithResult(_0x449de,null))[_0xd707('0x48')](handleError(_0x449de,null));};exports[_0xd707('0x6b')]=function(_0x3fe6b6,_0x11e583,_0x520061){if(_0x3fe6b6[_0xd707('0x4e')]&&_0x3fe6b6[_0xd707('0x4e')][_0xd707('0x4f')]){_0x3fe6b6['body'][_0xd707('0x56')]=_0x3fe6b6[_0xd707('0x4e')][_0xd707('0x4f')];}return db[_0xd707('0x31')][_0xd707('0x4b')]({'where':{'id':_0x3fe6b6[_0xd707('0x49')]['id']}})[_0xd707('0x19')](handleEntityNotFound(_0x11e583,null))[_0xd707('0x19')](saveUpdates(_0x3fe6b6[_0xd707('0x4c')],null))['then'](respondWithResult(_0x11e583,null))[_0xd707('0x48')](handleError(_0x11e583,null));};var utilLicense=require(_0xd707('0x66'));exports[_0xd707('0x6c')]=function(_0xfa868b,_0xb9e5f2,_0x447461){var _0x588963='server/files/images/logos';var _0xfcfd41={'custom':![]};return utilLicense[_0xd707('0x55')]()[_0xd707('0x19')](function(_0x4b36ac){if(_0x4b36ac){_0xfcfd41=_0x4b36ac;}return db[_0xd707('0x31')][_0xd707('0x4b')]({'where':{'id':_0xfa868b[_0xd707('0x49')]['id']},'attributes':['logo','loginLogo',_0xd707('0x56'),_0xd707('0x57'),_0xd707('0x6d'),_0xd707('0x58'),_0xd707('0x59'),_0xd707('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0xb9e5f2,null))[_0xd707('0x19')](function(_0x58b527){if(_0x58b527){var _0x31f483=_0x58b527[_0xd707('0x56')]&&fs[_0xd707('0x5b')](path[_0xd707('0x5c')](config['root'],_0x588963,_[_0xd707('0x5d')](_0x58b527[_0xd707('0x56')])))?path[_0xd707('0x5c')](config['root'],_0x588963,_[_0xd707('0x5d')](_0x58b527['preferred'])):path['join'](config[_0xd707('0x5e')],_0x588963,_[_0xd707('0x5d')](_0xd707('0x6e')));var _0x10efa5='default'+_[_0xd707('0x60')](_0xd707('0x56'));if(_0x58b527[_0x10efa5]||!_0xfcfd41[_0xd707('0x61')]||!_0xfcfd41['preferred']){_0x31f483=path[_0xd707('0x5c')](config[_0xd707('0x5e')],_0x588963,_['toLower'](_0xd707('0x6e')));}if(!fs[_0xd707('0x5b')](_0x31f483)){throw new db['Sequelize']['ValidationError'](_[_0xd707('0x60')](_0xd707('0x56'))+'\x20not\x20found');}return _0xb9e5f2[_0xd707('0x65')](_0x31f483);}})[_0xd707('0x48')](handleError(_0xb9e5f2,null));};exports[_0xd707('0x6f')]=function(_0x4b3176,_0x52c06e,_0x33f6fa){if(_0x4b3176[_0xd707('0x4e')]&&_0x4b3176[_0xd707('0x4e')][_0xd707('0x4f')]){_0x4b3176['body'][_0xd707('0x57')]=_0x4b3176[_0xd707('0x4e')][_0xd707('0x4f')];}return db[_0xd707('0x31')]['find']({'where':{'id':_0x4b3176['params']['id']}})['then'](handleEntityNotFound(_0x52c06e,null))[_0xd707('0x19')](saveUpdates(_0x4b3176[_0xd707('0x4c')],null))[_0xd707('0x19')](respondWithResult(_0x52c06e,null))[_0xd707('0x48')](handleError(_0x52c06e,null));};var utilLicense=require(_0xd707('0x66'));exports['getFavicon']=function(_0x4c7444,_0x29b2b1,_0x18df55){var _0x4e6dab=_0xd707('0x54');var _0x5dc1fc={'custom':![]};return utilLicense['getLicense']()[_0xd707('0x19')](function(_0x501ee1){if(_0x501ee1){_0x5dc1fc=_0x501ee1;}return db[_0xd707('0x31')][_0xd707('0x4b')]({'where':{'id':_0x4c7444[_0xd707('0x49')]['id']},'attributes':[_0xd707('0x50'),_0xd707('0x52'),_0xd707('0x56'),_0xd707('0x57'),_0xd707('0x6d'),_0xd707('0x58'),_0xd707('0x59'),'defaultFavicon'],'raw':!![]});})[_0xd707('0x19')](handleEntityNotFound(_0x29b2b1,null))['then'](function(_0x54fbc9){if(_0x54fbc9){var _0x20c5e7=_0x54fbc9[_0xd707('0x57')]&&fs[_0xd707('0x5b')](path['join'](config[_0xd707('0x5e')],_0x4e6dab,_[_0xd707('0x5d')](_0x54fbc9[_0xd707('0x57')])))?path[_0xd707('0x5c')](config[_0xd707('0x5e')],_0x4e6dab,_[_0xd707('0x5d')](_0x54fbc9[_0xd707('0x57')])):path[_0xd707('0x5c')](config[_0xd707('0x5e')],_0x4e6dab,_[_0xd707('0x5d')]('default_favicon.ico'));var _0x1c357d='default'+_[_0xd707('0x60')](_0xd707('0x57'));if(_0x54fbc9[_0x1c357d]||!_0x5dc1fc['custom']){_0x20c5e7=path['join'](config[_0xd707('0x5e')],_0x4e6dab,_[_0xd707('0x5d')]('default_favicon.ico'));}if(!fs[_0xd707('0x5b')](_0x20c5e7)){throw new db[(_0xd707('0x62'))][(_0xd707('0x63'))](_[_0xd707('0x60')](_0xd707('0x57'))+_0xd707('0x64'));}return _0x29b2b1[_0xd707('0x65')](_0x20c5e7);}})[_0xd707('0x48')](handleError(_0x29b2b1,null));};exports[_0xd707('0x70')]=function(_0x26455d,_0x414a09){var _0x1fd286={'offset':moment()[_0xd707('0x71')]()};_0x1fd286['now']=moment()[_0xd707('0x71')](_0x1fd286[_0xd707('0x23')])[_0xd707('0x72')](_0xd707('0x73'));return _0x414a09[_0xd707('0x21')](0xc8)[_0xd707('0x2e')](_0x1fd286);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 657e35b..fe07298 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 _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x21a168,_0x1d8335){var _0x2053f1=function(_0x528523){while(--_0x528523){_0x21a168['push'](_0x21a168['shift']());}};_0x2053f1(++_0x1d8335);}(_0x34e8,0x12c));var _0x834e=function(_0x30aaba,_0x16f943){_0x30aaba=_0x30aaba-0x0;var _0x4724ec=_0x34e8[_0x30aaba];return _0x4724ec;};'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 _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x120123,_0x4eff59){var _0x3bec4c=function(_0x182818){while(--_0x182818){_0x120123['push'](_0x120123['shift']());}};_0x3bec4c(++_0x4eff59);}(_0x008c,0x188));var _0xc008=function(_0x581bc7,_0x2ce3c5){_0x581bc7=_0x581bc7-0x0;var _0x2d951d=_0x008c[_0x581bc7];return _0x2d951d;};'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 diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index f419a16..f7c9569 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 _0x88dc=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','ShowSetting','find','raw','options','where','attributes','include','model','map','catch','lodash'];(function(_0x51d410,_0x57e15d){var _0x4aa03c=function(_0x431fcb){while(--_0x431fcb){_0x51d410['push'](_0x51d410['shift']());}};_0x4aa03c(++_0x57e15d);}(_0x88dc,0x9f));var _0xc88d=function(_0x3c6dfe,_0x2c0656){_0x3c6dfe=_0x3c6dfe-0x0;var _0x22aa48=_0x88dc[_0x3c6dfe];return _0x22aa48;};'use strict';var _=require(_0xc88d('0x0'));var util=require(_0xc88d('0x1'));var moment=require(_0xc88d('0x2'));var BPromise=require(_0xc88d('0x3'));var rs=require(_0xc88d('0x4'));var fs=require('fs');var Redis=require(_0xc88d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc88d('0x6'))(_0xc88d('0x7'));var config=require(_0xc88d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc88d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ff463,_0x58b159,_0x8afb12){return new BPromise(function(_0x4d5796,_0x28ce19){return client[_0xc88d('0xa')](_0x3ff463,_0x8afb12)[_0xc88d('0xb')](function(_0x5c54f5){logger[_0xc88d('0xc')]('Setting,\x20%s,\x20%s',_0x58b159,_0xc88d('0xd'));logger[_0xc88d('0xe')](_0xc88d('0xf'),_0x58b159,_0xc88d('0xd'),JSON[_0xc88d('0x10')](_0x5c54f5));if(_0x5c54f5[_0xc88d('0x11')]){if(_0x5c54f5[_0xc88d('0x11')][_0xc88d('0x12')]===0x1f4){logger[_0xc88d('0x11')](_0xc88d('0x13'),_0x58b159,_0x5c54f5['error'][_0xc88d('0x14')]);return _0x28ce19(_0x5c54f5['error'][_0xc88d('0x14')]);}logger[_0xc88d('0x11')](_0xc88d('0x13'),_0x58b159,_0x5c54f5['error'][_0xc88d('0x14')]);return _0x4d5796(_0x5c54f5[_0xc88d('0x11')][_0xc88d('0x14')]);}else{logger['info'](_0xc88d('0x13'),_0x58b159,'request\x20sent');_0x4d5796(_0x5c54f5[_0xc88d('0x15')]['message']);}})['catch'](function(_0x2d84fd){logger[_0xc88d('0x11')](_0xc88d('0x13'),_0x58b159,_0x2d84fd);_0x28ce19(_0x2d84fd);});});}exports[_0xc88d('0x16')]=function(_0x3fca09){var _0x149a8e=this;return new Promise(function(_0x310b21,_0xc343e5){return db['Setting'][_0xc88d('0x17')]({'raw':_0x3fca09['options']?_0x3fca09['options'][_0xc88d('0x18')]===undefined?!![]:![]:!![],'where':_0x3fca09[_0xc88d('0x19')]?_0x3fca09[_0xc88d('0x19')][_0xc88d('0x1a')]||null:null,'attributes':_0x3fca09[_0xc88d('0x19')]?_0x3fca09[_0xc88d('0x19')][_0xc88d('0x1b')]||null:null,'include':_0x3fca09[_0xc88d('0x19')]?_0x3fca09[_0xc88d('0x19')][_0xc88d('0x1c')]?_['map'](_0x3fca09[_0xc88d('0x19')][_0xc88d('0x1c')],function(_0x1be5e3){return{'model':db[_0x1be5e3[_0xc88d('0x1d')]],'as':_0x1be5e3['as'],'attributes':_0x1be5e3[_0xc88d('0x1b')],'include':_0x1be5e3[_0xc88d('0x1c')]?_[_0xc88d('0x1e')](_0x1be5e3[_0xc88d('0x1c')],function(_0x1dc43e){return{'model':db[_0x1dc43e['model']],'as':_0x1dc43e['as'],'attributes':_0x1dc43e[_0xc88d('0x1b')],'include':_0x1dc43e[_0xc88d('0x1c')]?_[_0xc88d('0x1e')](_0x1dc43e[_0xc88d('0x1c')],function(_0x479dfc){return{'model':db[_0x479dfc[_0xc88d('0x1d')]],'as':_0x479dfc['as'],'attributes':_0x479dfc['attributes']};}):[]};}):[]};}):[]:[]})[_0xc88d('0xb')](function(_0x39ce4b){logger[_0xc88d('0xc')]('ShowSetting',_0x3fca09);logger['debug'](_0xc88d('0x16'),_0x3fca09,JSON['stringify'](_0x39ce4b));_0x310b21(_0x39ce4b);})[_0xc88d('0x1f')](function(_0x37a204){logger[_0xc88d('0x11')](_0xc88d('0x16'),_0x37a204['message'],_0x3fca09);_0xc343e5(_0x149a8e[_0xc88d('0x11')](0x1f4,_0x37a204[_0xc88d('0x14')]));});});}; \ No newline at end of file +var _0x8467=['model','then','info','lodash','util','randomstring','ioredis','rpc','../../config/environment','client','http','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ShowSetting','Setting','options','where','attributes','include','map'];(function(_0xd06d7d,_0x2b0dc2){var _0x31db07=function(_0x286ec8){while(--_0x286ec8){_0xd06d7d['push'](_0xd06d7d['shift']());}};_0x31db07(++_0x2b0dc2);}(_0x8467,0x9f));var _0x7846=function(_0x2a7b8e,_0x50ffce){_0x2a7b8e=_0x2a7b8e-0x0;var _0x29b5c8=_0x8467[_0x2a7b8e];return _0x29b5c8;};'use strict';var _=require(_0x7846('0x0'));var util=require(_0x7846('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7846('0x2'));var fs=require('fs');var Redis=require(_0x7846('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7846('0x4'));var config=require(_0x7846('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7846('0x6')][_0x7846('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17b210,_0x24eb59,_0x442537){return new BPromise(function(_0x307526,_0x37e4f5){return client['request'](_0x17b210,_0x442537)['then'](function(_0x4cb3c7){logger['info'](_0x7846('0x8'),_0x24eb59,_0x7846('0x9'));logger[_0x7846('0xa')]('Setting,\x20%s,\x20%s,\x20%s',_0x24eb59,_0x7846('0x9'),JSON[_0x7846('0xb')](_0x4cb3c7));if(_0x4cb3c7[_0x7846('0xc')]){if(_0x4cb3c7[_0x7846('0xc')][_0x7846('0xd')]===0x1f4){logger[_0x7846('0xc')](_0x7846('0x8'),_0x24eb59,_0x4cb3c7[_0x7846('0xc')][_0x7846('0xe')]);return _0x37e4f5(_0x4cb3c7[_0x7846('0xc')]['message']);}logger[_0x7846('0xc')](_0x7846('0x8'),_0x24eb59,_0x4cb3c7[_0x7846('0xc')][_0x7846('0xe')]);return _0x307526(_0x4cb3c7['error'][_0x7846('0xe')]);}else{logger['info'](_0x7846('0x8'),_0x24eb59,_0x7846('0x9'));_0x307526(_0x4cb3c7[_0x7846('0xf')][_0x7846('0xe')]);}})['catch'](function(_0x4f4992){logger[_0x7846('0xc')](_0x7846('0x8'),_0x24eb59,_0x4f4992);_0x37e4f5(_0x4f4992);});});}exports[_0x7846('0x10')]=function(_0x59b64d){var _0x4e6376=this;return new Promise(function(_0x537b46,_0x4de60f){return db[_0x7846('0x11')]['find']({'raw':_0x59b64d[_0x7846('0x12')]?_0x59b64d['options']['raw']===undefined?!![]:![]:!![],'where':_0x59b64d['options']?_0x59b64d['options'][_0x7846('0x13')]||null:null,'attributes':_0x59b64d[_0x7846('0x12')]?_0x59b64d['options'][_0x7846('0x14')]||null:null,'include':_0x59b64d[_0x7846('0x12')]?_0x59b64d[_0x7846('0x12')][_0x7846('0x15')]?_[_0x7846('0x16')](_0x59b64d['options'][_0x7846('0x15')],function(_0x13976d){return{'model':db[_0x13976d['model']],'as':_0x13976d['as'],'attributes':_0x13976d[_0x7846('0x14')],'include':_0x13976d[_0x7846('0x15')]?_[_0x7846('0x16')](_0x13976d['include'],function(_0x35f657){return{'model':db[_0x35f657[_0x7846('0x17')]],'as':_0x35f657['as'],'attributes':_0x35f657['attributes'],'include':_0x35f657[_0x7846('0x15')]?_[_0x7846('0x16')](_0x35f657[_0x7846('0x15')],function(_0x51735c){return{'model':db[_0x51735c[_0x7846('0x17')]],'as':_0x51735c['as'],'attributes':_0x51735c[_0x7846('0x14')]};}):[]};}):[]};}):[]:[]})[_0x7846('0x18')](function(_0x117fe5){logger[_0x7846('0x19')](_0x7846('0x10'),_0x59b64d);logger[_0x7846('0xa')](_0x7846('0x10'),_0x59b64d,JSON[_0x7846('0xb')](_0x117fe5));_0x537b46(_0x117fe5);})['catch'](function(_0x387f73){logger['error'](_0x7846('0x10'),_0x387f73[_0x7846('0xe')],_0x59b64d);_0x4de60f(_0x4e6376[_0x7846('0xc')](0x1f4,_0x387f73[_0x7846('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 95c9f6a..0793ea5 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 _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x3c0765,_0x28c42f){var _0xd83b55=function(_0x1e6325){while(--_0x1e6325){_0x3c0765['push'](_0x3c0765['shift']());}};_0xd83b55(++_0x28c42f);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x6bf4d9,_0x39f6a0){var _0x47bc5c=function(_0x55b37e){while(--_0x55b37e){_0x6bf4d9['push'](_0x6bf4d9['shift']());}};_0x47bc5c(++_0x39f6a0);}(_0x7a54,0x106));var _0x47a5=function(_0x18d999,_0x49c3f7){_0x18d999=_0x18d999-0x0;var _0x162838=_0x7a54[_0x18d999];return _0x162838;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 02d2754..7007504 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 _0x73dd=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name','STRING','generate','ENUM','clicksend','plivo','clickatell','bandwidth','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x2b8bbe,_0x37eb6a){var _0x1bb210=function(_0x116173){while(--_0x116173){_0x2b8bbe['push'](_0x2b8bbe['shift']());}};_0x1bb210(++_0x37eb6a);}(_0x73dd,0x130));var _0xd73d=function(_0x5722b7,_0x276f63){_0x5722b7=_0x5722b7-0x0;var _0x38ad54=_0x73dd[_0x5722b7];return _0x38ad54;};'use strict';var Sequelize=require(_0xd73d('0x0'));var rs=require(_0xd73d('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xd73d('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xd73d('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xd73d('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xd73d('0x3')],'defaultValue':function(){return rs[_0xd73d('0x4')]();}},'phone':{'type':Sequelize[_0xd73d('0x3')]},'type':{'type':Sequelize[_0xd73d('0x5')]('twilio','skebby','connectel',_0xd73d('0x6'),_0xd73d('0x7'),_0xd73d('0x8'),_0xd73d('0x9'),'csc',_0xd73d('0xa'),_0xd73d('0xb'))},'accountSid':{'type':Sequelize[_0xd73d('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xd73d('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xd73d('0x3')]},'password':{'type':Sequelize[_0xd73d('0x3')]},'apiKey':{'type':Sequelize[_0xd73d('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xd73d('0x3')]},'senderString':{'type':Sequelize[_0xd73d('0x3')]},'deliveryReport':{'type':Sequelize[_0xd73d('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0xd73d('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd73d('0xd')],'defaultValue':function(){return _0xd73d('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd73d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd73d('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd73d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd73d('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd73d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd73d('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xd73d('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xd73d('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1a5c08){if(!_0x1a5c08)this[_0xd73d('0x11')](_0xd73d('0x12'),null);this[_0xd73d('0x11')](_0xd73d('0x13'),_0x1a5c08);}}}; \ No newline at end of file +var _0x7662=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','clicksend','plivo','clickatell','bandwidth','csc','intelepeer','BOOLEAN','TEXT'];(function(_0x5138ac,_0x5dd557){var _0x4d91e1=function(_0x4f4d9e){while(--_0x4f4d9e){_0x5138ac['push'](_0x5138ac['shift']());}};_0x4d91e1(++_0x5dd557);}(_0x7662,0xec));var _0x2766=function(_0xa205c,_0x2693af){_0xa205c=_0xa205c-0x0;var _0x1ab019=_0x7662[_0xa205c];return _0x1ab019;};'use strict';var Sequelize=require(_0x2766('0x0'));var rs=require(_0x2766('0x1'));module[_0x2766('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x2766('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x2766('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x2766('0x4')],'defaultValue':function(){return rs[_0x2766('0x5')]();}},'phone':{'type':Sequelize[_0x2766('0x4')]},'type':{'type':Sequelize[_0x2766('0x6')](_0x2766('0x7'),'skebby','connectel',_0x2766('0x8'),_0x2766('0x9'),_0x2766('0xa'),_0x2766('0xb'),_0x2766('0xc'),'infobip',_0x2766('0xd'))},'accountSid':{'type':Sequelize[_0x2766('0x4')]},'authId':{'type':Sequelize[_0x2766('0x4')]},'authToken':{'type':Sequelize[_0x2766('0x4')]},'smsMethod':{'type':Sequelize[_0x2766('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x2766('0x4')]},'password':{'type':Sequelize[_0x2766('0x4')]},'apiKey':{'type':Sequelize[_0x2766('0x4')]},'applicationId':{'type':Sequelize[_0x2766('0x4')]},'accountId':{'type':Sequelize[_0x2766('0x4')]},'senderString':{'type':Sequelize[_0x2766('0x4')]},'deliveryReport':{'type':Sequelize[_0x2766('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x2766('0x4')]},'notificationTemplate':{'type':Sequelize[_0x2766('0xf')],'defaultValue':function(){return _0x2766('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2766('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2766('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2766('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2766('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2766('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2766('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2766('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x2766('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2766('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x38af13){if(!_0x38af13)this[_0x2766('0x12')](_0x2766('0x13'),null);this['setDataValue'](_0x2766('0x14'),_0x38af13);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 477e7e2..bda651b 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 _0x8b1b=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','client','http','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','json','limit','undefined','offset','count','Content-Range','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','end','stack','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','show','params','Pause','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','getDispositions','findOne','hasOwnProperty','pick','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','sms','SmsApplication','Applications','applications','orderBy','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','messageId','text','connectel','message_id','plivo','From','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','SmsInteraction','spread','interaction','created','autoclose','push','unmanaged','SmsMessage','AttachmentId','UserId','User','unshift','*,*,*,*','queue','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','send','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','Contact','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','redif','DELIVERED','error_code','infobip','DELIVERED_TO_GATEWAY','bandwidth','message-delivered','intelepeer','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','emit','userSmsAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','querystring','ioredis','../../components/auth/service'];(function(_0x24cc72,_0x4dc73a){var _0xd49f1e=function(_0x39f581){while(--_0x39f581){_0x24cc72['push'](_0x24cc72['shift']());}};_0xd49f1e(++_0x4dc73a);}(_0x8b1b,0x1bc));var _0xb8b1=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8b1b[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb8b1('0x0'));var jsonpatch=require(_0xb8b1('0x1'));var rp=require(_0xb8b1('0x2'));var moment=require(_0xb8b1('0x3'));var BPromise=require(_0xb8b1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb8b1('0x5'));var sox=require(_0xb8b1('0x6'));var csv=require(_0xb8b1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8b1('0x8'));var squel=require(_0xb8b1('0x9'));var crypto=require(_0xb8b1('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb8b1('0x7'));var querystring=require(_0xb8b1('0xb'));var Papa=require('papaparse');var Redis=require(_0xb8b1('0xc'));var authService=require(_0xb8b1('0xd'));var qs=require(_0xb8b1('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb8b1('0xf'));var logger=require(_0xb8b1('0x10'))(_0xb8b1('0x11'));var utils=require(_0xb8b1('0x12'));var config=require(_0xb8b1('0x13'));var licenseUtil=require(_0xb8b1('0x14'));var db=require(_0xb8b1('0x15'))['db'];config[_0xb8b1('0x16')]=_[_0xb8b1('0x17')](config[_0xb8b1('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xb8b1('0x18'))(new Redis(config[_0xb8b1('0x16')]));require(_0xb8b1('0x19'))[_0xb8b1('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb8b1('0x1b')][_0xb8b1('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x268fc3,_0x387e8e,_0x405e25,_0x1abb70){return new BPromise(function(_0x2ed2c7,_0x369013){var _0x680e1c=_0x1abb70||client;return _0x680e1c['request'](_0x268fc3,_0x405e25)[_0xb8b1('0x1d')](function(_0x16fb1f){logger['info'](_0xb8b1('0x1e'),_0x387e8e,_0xb8b1('0x1f'));logger[_0xb8b1('0x20')](_0xb8b1('0x21'),_0x387e8e,'request\x20sent',JSON[_0xb8b1('0x22')](_0x16fb1f));if(_0x16fb1f['error']){if(_0x16fb1f['error'][_0xb8b1('0x23')]===0x1f4){logger[_0xb8b1('0x24')](_0xb8b1('0x1e'),_0x387e8e,_0x16fb1f[_0xb8b1('0x24')][_0xb8b1('0x25')]);return _0x369013(_0x16fb1f[_0xb8b1('0x24')][_0xb8b1('0x25')]);}logger[_0xb8b1('0x24')](_0xb8b1('0x1e'),_0x387e8e,_0x16fb1f[_0xb8b1('0x24')][_0xb8b1('0x25')]);return _0x2ed2c7(_0x16fb1f[_0xb8b1('0x24')]['message']);}else{logger[_0xb8b1('0x26')](_0xb8b1('0x1e'),_0x387e8e,_0xb8b1('0x1f'));_0x2ed2c7(_0x16fb1f[_0xb8b1('0x27')][_0xb8b1('0x25')]);}})[_0xb8b1('0x28')](function(_0x5a26cc){logger[_0xb8b1('0x24')]('SmsAccount,\x20%s,\x20%s',_0x387e8e,_0x5a26cc);_0x369013(_0x5a26cc);});});}function respondWithStatusCode(_0x501584,_0x3047d1){_0x3047d1=_0x3047d1||0xcc;return function(_0x260887){if(_0x260887){return _0x501584[_0xb8b1('0x29')](_0x3047d1);}return _0x501584[_0xb8b1('0x2a')](_0x3047d1)['end']();};}function respondWithResult(_0x50571e,_0x3c031c){_0x3c031c=_0x3c031c||0xc8;return function(_0x4444f2){if(_0x4444f2){return _0x50571e[_0xb8b1('0x2a')](_0x3c031c)[_0xb8b1('0x2b')](_0x4444f2);}};}function respondWithFilteredResult(_0x498087,_0x58d77c){return function(_0x32edd1){if(_0x32edd1){var _0x11f9a3=typeof _0x58d77c['offset']==='undefined'&&typeof _0x58d77c[_0xb8b1('0x2c')]===_0xb8b1('0x2d');var _0x5684b9=_0x32edd1['count'];var _0x316f33=_0x11f9a3?0x0:_0x58d77c[_0xb8b1('0x2e')];var _0x2f9b1a=_0x11f9a3?_0x32edd1[_0xb8b1('0x2f')]:_0x58d77c[_0xb8b1('0x2e')]+_0x58d77c[_0xb8b1('0x2c')];var _0x45b339;if(_0x2f9b1a>=_0x5684b9){_0x2f9b1a=_0x5684b9;_0x45b339=0xc8;}else{_0x45b339=0xce;}_0x498087[_0xb8b1('0x2a')](_0x45b339);return _0x498087['set'](_0xb8b1('0x30'),_0x316f33+'-'+_0x2f9b1a+'/'+_0x5684b9)['json'](_0x32edd1);}return null;};}function patchUpdates(_0x10e6b0){return function(_0x501e46){try{jsonpatch[_0xb8b1('0x31')](_0x501e46,_0x10e6b0,!![]);}catch(_0x1a6c5d){return BPromise[_0xb8b1('0x32')](_0x1a6c5d);}return _0x501e46[_0xb8b1('0x33')]();};}function saveUpdates(_0x3f6a6e,_0x1ba67){return function(_0x279b72){if(_0x279b72){return _0x279b72['update'](_0x3f6a6e)['then'](function(_0x43f999){return _0x43f999;});}return null;};}function removeEntity(_0x5bddd2,_0x4a5843){return function(_0x336ef1){if(_0x336ef1){return _0x336ef1[_0xb8b1('0x34')]()[_0xb8b1('0x1d')](function(){var _0x185bb9=_0x336ef1[_0xb8b1('0x35')]({'plain':!![]});var _0x5c4d19=_0xb8b1('0x36');return db[_0xb8b1('0x37')]['destroy']({'where':{'type':_0x5c4d19,'resourceId':_0x185bb9['id']}})[_0xb8b1('0x1d')](function(){return _0x336ef1;});})['then'](function(){_0x5bddd2[_0xb8b1('0x2a')](0xcc)[_0xb8b1('0x38')]();});}};}function handleEntityNotFound(_0x598b14,_0x6c5acf){return function(_0xff36ce){if(!_0xff36ce){_0x598b14[_0xb8b1('0x29')](0x194);}return _0xff36ce;};}function handleError(_0x5181d1,_0x352c02){_0x352c02=_0x352c02||0x1f4;return function(_0x4100c3){logger[_0xb8b1('0x24')](_0x4100c3[_0xb8b1('0x39')]);if(_0x4100c3['name']){delete _0x4100c3['name'];}_0x5181d1['status'](_0x352c02)['send'](_0x4100c3);};}exports[_0xb8b1('0x3a')]=function(_0x3a1a18,_0x5bd1b1){var _0x43b941={'include':[{'model':db['Pause'],'as':_0xb8b1('0x3b')}]},_0x383f62={},_0x43b368={'count':0x0,'rows':[]};var _0x27aa17=_[_0xb8b1('0x3c')](db[_0xb8b1('0x3d')][_0xb8b1('0x3e')],function(_0x386229){return{'name':_0x386229[_0xb8b1('0x3f')],'type':_0x386229['type'][_0xb8b1('0x40')]};});_0x383f62[_0xb8b1('0x41')]=_[_0xb8b1('0x3c')](_0x27aa17,_0xb8b1('0x42'));_0x383f62[_0xb8b1('0x43')]=_[_0xb8b1('0x44')](_0x3a1a18['query']);_0x383f62[_0xb8b1('0x45')]=_[_0xb8b1('0x46')](_0x383f62['model'],_0x383f62[_0xb8b1('0x43')]);_0x43b941[_0xb8b1('0x47')]=_[_0xb8b1('0x46')](_0x383f62[_0xb8b1('0x41')],qs[_0xb8b1('0x48')](_0x3a1a18[_0xb8b1('0x43')][_0xb8b1('0x48')]));_0x43b941['attributes']=_0x43b941[_0xb8b1('0x47')][_0xb8b1('0x49')]?_0x43b941[_0xb8b1('0x47')]:_0x383f62['model'];if(!_0x3a1a18[_0xb8b1('0x43')]['hasOwnProperty'](_0xb8b1('0x4a'))){_0x43b941[_0xb8b1('0x2c')]=qs[_0xb8b1('0x2c')](_0x3a1a18[_0xb8b1('0x43')][_0xb8b1('0x2c')]);_0x43b941[_0xb8b1('0x2e')]=qs[_0xb8b1('0x2e')](_0x3a1a18[_0xb8b1('0x43')]['offset']);}_0x43b941[_0xb8b1('0x4b')]=qs[_0xb8b1('0x4c')](_0x3a1a18[_0xb8b1('0x43')][_0xb8b1('0x4c')]);_0x43b941[_0xb8b1('0x4d')]=qs[_0xb8b1('0x45')](_['pick'](_0x3a1a18[_0xb8b1('0x43')],_0x383f62[_0xb8b1('0x45')]),_0x27aa17);if(_0x3a1a18['query'][_0xb8b1('0x4e')]){_0x43b941[_0xb8b1('0x4d')]=_[_0xb8b1('0x4f')](_0x43b941['where'],{'$or':_['map'](_0x27aa17,function(_0x59011e){if(_0x59011e[_0xb8b1('0x50')]!=='VIRTUAL'){var _0x5109fd={};_0x5109fd[_0x59011e['name']]={'$like':'%'+_0x3a1a18[_0xb8b1('0x43')][_0xb8b1('0x4e')]+'%'};return _0x5109fd;}})});}_0x43b941=_[_0xb8b1('0x4f')]({},_0x43b941,_0x3a1a18[_0xb8b1('0x51')]);var _0x55b86c={'where':_0x43b941[_0xb8b1('0x4d')]};return db[_0xb8b1('0x3d')]['count'](_0x55b86c)[_0xb8b1('0x1d')](function(_0x31a461){_0x43b368[_0xb8b1('0x2f')]=_0x31a461;if(_0x3a1a18[_0xb8b1('0x43')][_0xb8b1('0x52')]){_0x43b941[_0xb8b1('0x53')]=[{'all':!![]}];}return db['SmsAccount'][_0xb8b1('0x54')](_0x43b941);})[_0xb8b1('0x1d')](function(_0x1bead6){_0x43b368[_0xb8b1('0x55')]=_0x1bead6;return _0x43b368;})[_0xb8b1('0x1d')](respondWithFilteredResult(_0x5bd1b1,_0x43b941))[_0xb8b1('0x28')](handleError(_0x5bd1b1,null));};exports[_0xb8b1('0x56')]=function(_0x39ee3e,_0x18f031){var _0x49520f={'raw':![],'where':{'id':_0x39ee3e[_0xb8b1('0x57')]['id']},'include':[{'model':db[_0xb8b1('0x58')],'as':'mandatoryDispositionPause'}]},_0x19144a={};_0x19144a[_0xb8b1('0x41')]=_[_0xb8b1('0x44')](db[_0xb8b1('0x3d')][_0xb8b1('0x3e')]);_0x19144a[_0xb8b1('0x43')]=_[_0xb8b1('0x44')](_0x39ee3e[_0xb8b1('0x43')]);_0x19144a[_0xb8b1('0x45')]=_['intersection'](_0x19144a[_0xb8b1('0x41')],_0x19144a[_0xb8b1('0x43')]);_0x49520f[_0xb8b1('0x47')]=_[_0xb8b1('0x46')](_0x19144a[_0xb8b1('0x41')],qs[_0xb8b1('0x48')](_0x39ee3e[_0xb8b1('0x43')]['fields']));_0x49520f[_0xb8b1('0x47')]=_0x49520f[_0xb8b1('0x47')]['length']?_0x49520f[_0xb8b1('0x47')]:_0x19144a[_0xb8b1('0x41')];if(_0x39ee3e[_0xb8b1('0x43')][_0xb8b1('0x52')]){_0x49520f[_0xb8b1('0x53')]=[{'all':!![]}];}_0x49520f=_['merge']({},_0x49520f,_0x39ee3e[_0xb8b1('0x51')]);return db['SmsAccount'][_0xb8b1('0x59')](_0x49520f)[_0xb8b1('0x1d')](handleEntityNotFound(_0x18f031,null))[_0xb8b1('0x1d')](respondWithResult(_0x18f031,null))[_0xb8b1('0x28')](handleError(_0x18f031,null));};exports[_0xb8b1('0x5a')]=function(_0x3dca68,_0x298e5c){return db[_0xb8b1('0x3d')][_0xb8b1('0x5a')](_0x3dca68[_0xb8b1('0x5b')],{})[_0xb8b1('0x1d')](function(_0x9634c3){var _0x529e96=_0x3dca68[_0xb8b1('0x5c')][_0xb8b1('0x35')]({'plain':!![]});if(!_0x529e96)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x529e96[_0xb8b1('0x5d')]===_0xb8b1('0x5c')){var _0x3a992e=_0x9634c3[_0xb8b1('0x35')]({'plain':!![]});var _0x540700='SmsAccounts';return db[_0xb8b1('0x5e')][_0xb8b1('0x59')]({'where':{'name':_0x540700,'userProfileId':_0x529e96[_0xb8b1('0x5f')]},'raw':!![]})[_0xb8b1('0x1d')](function(_0x55e007){if(_0x55e007&&_0x55e007[_0xb8b1('0x60')]===0x0){return db[_0xb8b1('0x37')]['create']({'name':_0x3a992e[_0xb8b1('0x42')],'resourceId':_0x3a992e['id'],'type':_0x55e007[_0xb8b1('0x42')],'sectionId':_0x55e007['id']},{})['then'](function(){return _0x9634c3;});}else{return _0x9634c3;}})[_0xb8b1('0x28')](function(_0x2126b5){logger[_0xb8b1('0x24')](_0xb8b1('0x61'),_0x2126b5);throw _0x2126b5;});}return _0x9634c3;})[_0xb8b1('0x1d')](respondWithResult(_0x298e5c,0xc9))[_0xb8b1('0x28')](handleError(_0x298e5c,null));};exports[_0xb8b1('0x62')]=function(_0x1f61d7,_0x2a3944){if(_0x1f61d7['body']['id']){delete _0x1f61d7[_0xb8b1('0x5b')]['id'];}return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x1f61d7['params']['id']},'include':[{'model':db[_0xb8b1('0x58')],'as':_0xb8b1('0x3b')}]})[_0xb8b1('0x1d')](handleEntityNotFound(_0x2a3944,null))['then'](saveUpdates(_0x1f61d7[_0xb8b1('0x5b')],null))[_0xb8b1('0x1d')](respondWithResult(_0x2a3944,null))['catch'](handleError(_0x2a3944,null));};exports[_0xb8b1('0x34')]=function(_0x7a439b,_0x530b11){return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x7a439b[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x530b11,null))[_0xb8b1('0x1d')](removeEntity(_0x530b11,null))[_0xb8b1('0x28')](handleError(_0x530b11,null));};exports['describe']=function(_0x587a83,_0xd858cf){return db[_0xb8b1('0x3d')][_0xb8b1('0x63')]()[_0xb8b1('0x1d')](respondWithResult(_0xd858cf,null))[_0xb8b1('0x28')](handleError(_0xd858cf,null));};exports[_0xb8b1('0x64')]=function(_0x1d9c1a,_0x546542,_0x481f22){if(_0x1d9c1a[_0xb8b1('0x5b')]['id']){delete _0x1d9c1a['body']['id'];}return db[_0xb8b1('0x3d')]['find']({'where':{'id':_0x1d9c1a[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x546542,null))[_0xb8b1('0x1d')](function(_0x7741fa){if(_0x7741fa){_0x1d9c1a[_0xb8b1('0x5b')][_0xb8b1('0x65')]=_0x7741fa['id'];return db['Disposition'][_0xb8b1('0x5a')](_0x1d9c1a[_0xb8b1('0x5b')]);}})[_0xb8b1('0x1d')](respondWithResult(_0x546542,null))[_0xb8b1('0x28')](handleError(_0x546542,null));};exports[_0xb8b1('0x66')]=function(_0x4445e7,_0x4c02df,_0xa3faca){var _0x3078cd={'raw':![],'where':{}};var _0x4082e7={};var _0x1c2f96={'count':0x0,'rows':[]};return db[_0xb8b1('0x3d')][_0xb8b1('0x67')]({'where':{'id':_0x4445e7['params']['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x4c02df,null))[_0xb8b1('0x1d')](function(_0x4844f2){if(_0x4844f2){_0x4082e7[_0xb8b1('0x41')]=_[_0xb8b1('0x44')](db['Disposition'][_0xb8b1('0x3e')]);_0x4082e7[_0xb8b1('0x43')]=_[_0xb8b1('0x44')](_0x4445e7[_0xb8b1('0x43')]);_0x4082e7[_0xb8b1('0x45')]=_[_0xb8b1('0x46')](_0x4082e7[_0xb8b1('0x41')],_0x4082e7[_0xb8b1('0x43')]);_0x3078cd[_0xb8b1('0x47')]=_[_0xb8b1('0x46')](_0x4082e7[_0xb8b1('0x41')],qs[_0xb8b1('0x48')](_0x4445e7[_0xb8b1('0x43')]['fields']));_0x3078cd[_0xb8b1('0x47')]=_0x3078cd[_0xb8b1('0x47')][_0xb8b1('0x49')]?_0x3078cd['attributes']:_0x4082e7[_0xb8b1('0x41')];if(!_0x4445e7['query'][_0xb8b1('0x68')]('nolimit')){_0x3078cd[_0xb8b1('0x2c')]=qs[_0xb8b1('0x2c')](_0x4445e7['query'][_0xb8b1('0x2c')]);_0x3078cd['offset']=qs[_0xb8b1('0x2e')](_0x4445e7[_0xb8b1('0x43')]['offset']);}_0x3078cd[_0xb8b1('0x4b')]=qs[_0xb8b1('0x4c')](_0x4445e7[_0xb8b1('0x43')][_0xb8b1('0x4c')]);_0x3078cd[_0xb8b1('0x4d')]=qs[_0xb8b1('0x45')](_[_0xb8b1('0x69')](_0x4445e7['query'],_0x4082e7[_0xb8b1('0x45')]));_0x3078cd[_0xb8b1('0x4d')][_0xb8b1('0x65')]=_0x4844f2['id'];if(_0x4445e7['query'][_0xb8b1('0x4e')]){_0x3078cd[_0xb8b1('0x4d')]=_['merge'](_0x3078cd['where'],{'$or':_['map'](_0x3078cd[_0xb8b1('0x47')],function(_0x6822cf){var _0xcf06ac={};_0xcf06ac[_0x6822cf]={'$like':'%'+_0x4445e7[_0xb8b1('0x43')][_0xb8b1('0x4e')]+'%'};return _0xcf06ac;})});}_0x3078cd=_[_0xb8b1('0x4f')]({},_0x3078cd,_0x4445e7['options']);return db[_0xb8b1('0x6a')][_0xb8b1('0x2f')]({'where':_0x3078cd[_0xb8b1('0x4d')]})['then'](function(_0x27e3fb){_0x1c2f96[_0xb8b1('0x2f')]=_0x27e3fb;if(_0x4445e7[_0xb8b1('0x43')][_0xb8b1('0x52')]){_0x3078cd[_0xb8b1('0x53')]=[{'all':!![]}];}return db['Disposition'][_0xb8b1('0x54')](_0x3078cd);})['then'](function(_0x55ac15){_0x1c2f96[_0xb8b1('0x55')]=_0x55ac15;return _0x1c2f96;});}})[_0xb8b1('0x1d')](respondWithFilteredResult(_0x4c02df,_0x3078cd))[_0xb8b1('0x28')](handleError(_0x4c02df,null));};exports[_0xb8b1('0x6b')]=function(_0x2cffef,_0x3b93aa,_0x4628fb){return db['SmsAccount'][_0xb8b1('0x59')]({'where':{'id':_0x2cffef[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x3b93aa,null))[_0xb8b1('0x1d')](function(_0x476ab4){if(_0x476ab4){return _0x476ab4['removeDispositions'](_0x2cffef[_0xb8b1('0x43')][_0xb8b1('0x6c')]);}})[_0xb8b1('0x1d')](respondWithStatusCode(_0x3b93aa,null))[_0xb8b1('0x28')](handleError(_0x3b93aa,null));};exports[_0xb8b1('0x6d')]=function(_0x1db9f3,_0x549019,_0x5a3c1d){if(_0x1db9f3[_0xb8b1('0x5b')]['id']){delete _0x1db9f3[_0xb8b1('0x5b')]['id'];}return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x1db9f3['params']['id']}})['then'](handleEntityNotFound(_0x549019,null))[_0xb8b1('0x1d')](function(_0x198130){if(_0x198130){_0x1db9f3['body'][_0xb8b1('0x65')]=_0x198130['id'];return db[_0xb8b1('0x6e')][_0xb8b1('0x5a')](_0x1db9f3[_0xb8b1('0x5b')]);}})[_0xb8b1('0x1d')](respondWithResult(_0x549019,null))[_0xb8b1('0x28')](handleError(_0x549019,null));};exports['getAnswers']=function(_0x5689ae,_0x326bf4,_0x48bd70){var _0x54a9db={'raw':![],'where':{}};var _0xd9b3d1={};var _0x1649bc={'count':0x0,'rows':[]};return db[_0xb8b1('0x3d')][_0xb8b1('0x67')]({'where':{'id':_0x5689ae[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x326bf4,null))[_0xb8b1('0x1d')](function(_0x3dbc05){if(_0x3dbc05){_0xd9b3d1['model']=_[_0xb8b1('0x44')](db[_0xb8b1('0x6e')][_0xb8b1('0x3e')]);_0xd9b3d1[_0xb8b1('0x43')]=_[_0xb8b1('0x44')](_0x5689ae[_0xb8b1('0x43')]);_0xd9b3d1[_0xb8b1('0x45')]=_[_0xb8b1('0x46')](_0xd9b3d1['model'],_0xd9b3d1[_0xb8b1('0x43')]);_0x54a9db[_0xb8b1('0x47')]=_[_0xb8b1('0x46')](_0xd9b3d1[_0xb8b1('0x41')],qs[_0xb8b1('0x48')](_0x5689ae['query'][_0xb8b1('0x48')]));_0x54a9db[_0xb8b1('0x47')]=_0x54a9db[_0xb8b1('0x47')]['length']?_0x54a9db['attributes']:_0xd9b3d1[_0xb8b1('0x41')];if(!_0x5689ae[_0xb8b1('0x43')][_0xb8b1('0x68')]('nolimit')){_0x54a9db['limit']=qs[_0xb8b1('0x2c')](_0x5689ae['query'][_0xb8b1('0x2c')]);_0x54a9db[_0xb8b1('0x2e')]=qs['offset'](_0x5689ae[_0xb8b1('0x43')][_0xb8b1('0x2e')]);}_0x54a9db[_0xb8b1('0x4b')]=qs['sort'](_0x5689ae[_0xb8b1('0x43')][_0xb8b1('0x4c')]);_0x54a9db[_0xb8b1('0x4d')]=qs[_0xb8b1('0x45')](_[_0xb8b1('0x69')](_0x5689ae[_0xb8b1('0x43')],_0xd9b3d1[_0xb8b1('0x45')]));_0x54a9db[_0xb8b1('0x4d')]['SmsAccountId']=_0x3dbc05['id'];if(_0x5689ae[_0xb8b1('0x43')][_0xb8b1('0x4e')]){_0x54a9db['where']=_[_0xb8b1('0x4f')](_0x54a9db[_0xb8b1('0x4d')],{'$or':_[_0xb8b1('0x3c')](_0x54a9db[_0xb8b1('0x47')],function(_0xb50e51){var _0x29d06d={};_0x29d06d[_0xb50e51]={'$like':'%'+_0x5689ae[_0xb8b1('0x43')]['filter']+'%'};return _0x29d06d;})});}_0x54a9db=_[_0xb8b1('0x4f')]({},_0x54a9db,_0x5689ae[_0xb8b1('0x51')]);return db[_0xb8b1('0x6e')]['count']({'where':_0x54a9db[_0xb8b1('0x4d')]})[_0xb8b1('0x1d')](function(_0xffa2af){_0x1649bc[_0xb8b1('0x2f')]=_0xffa2af;if(_0x5689ae['query'][_0xb8b1('0x52')]){_0x54a9db[_0xb8b1('0x53')]=[{'all':!![]}];}return db[_0xb8b1('0x6e')][_0xb8b1('0x54')](_0x54a9db);})[_0xb8b1('0x1d')](function(_0x5f05b6){_0x1649bc['rows']=_0x5f05b6;return _0x1649bc;});}})['then'](respondWithFilteredResult(_0x326bf4,_0x54a9db))['catch'](handleError(_0x326bf4,null));};exports['removeAnswers']=function(_0x16091d,_0x13ce5a,_0x4ce1bd){return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x16091d['params']['id']}})['then'](handleEntityNotFound(_0x13ce5a,null))[_0xb8b1('0x1d')](function(_0x4e455d){if(_0x4e455d){return _0x4e455d[_0xb8b1('0x6f')](_0x16091d['query'][_0xb8b1('0x6c')]);}})[_0xb8b1('0x1d')](respondWithStatusCode(_0x13ce5a,null))['catch'](handleError(_0x13ce5a,null));};exports['notify']=function(_0x18a9a6,_0x5bfaa2,_0x351707){var _0x57bd31={'channel':_0xb8b1('0x70')};var _0x332f76=[];var _0x162052=[];var _0x353be8={};return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x18a9a6[_0xb8b1('0x57')]['id']},'include':[{'model':db[_0xb8b1('0x71')],'as':_0xb8b1('0x72')}]})[_0xb8b1('0x1d')](handleEntityNotFound(_0x5bfaa2,null))[_0xb8b1('0x1d')](function(_0x1ba639){_0x57bd31['account']=_0x1ba639;_0x57bd31[_0xb8b1('0x73')]=_[_0xb8b1('0x74')](_0x1ba639[_0xb8b1('0x72')],['priority'],[_0xb8b1('0x75')]);if(_0x57bd31['account'][_0xb8b1('0x72')]){delete _0x57bd31[_0xb8b1('0x76')]['Applications'];}return db[_0xb8b1('0x77')][_0xb8b1('0x63')]();})['then'](function(_0x1b2d1d){if(!_0x1b2d1d){throw new db[(_0xb8b1('0x78'))][(_0xb8b1('0x79'))](_0xb8b1('0x7a'));}_0x332f76=_[_0xb8b1('0x7b')](_[_0xb8b1('0x44')](_0x1b2d1d),[_0xb8b1('0x7c'),_0xb8b1('0x7d')]);_0x162052=_['difference'](_[_0xb8b1('0x44')](_0x1b2d1d),[_0xb8b1('0x7c'),_0xb8b1('0x7d'),'CompanyId',_0xb8b1('0x7e')]);_0x57bd31[_0xb8b1('0x5b')]={'mapKey':_0xb8b1('0x7f')};if(_0x57bd31['account'][_0xb8b1('0x50')]){switch(_0x57bd31[_0xb8b1('0x76')][_0xb8b1('0x50')]){case _0xb8b1('0x80'):_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')]=_0x18a9a6[_0xb8b1('0x5b')]['From'];_0x57bd31[_0xb8b1('0x5b')]['body']=_0x18a9a6['body']['Body'];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x82')]=_0x18a9a6['body']['MessageSid'];break;case'skebby':_0x57bd31[_0xb8b1('0x5b')]['from']='+'+_0x18a9a6[_0xb8b1('0x5b')]['sender'];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x5b')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x83')];break;case _0xb8b1('0x84'):_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x81')];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x5b')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x25')];break;case'clicksend':_0x57bd31['body']['from']=_0x18a9a6['body'][_0xb8b1('0x81')];_0x57bd31[_0xb8b1('0x5b')]['body']=_0x18a9a6['body'][_0xb8b1('0x5b')];_0x57bd31[_0xb8b1('0x5b')]['messageId']=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x85')];break;case _0xb8b1('0x86'):_0x57bd31['body'][_0xb8b1('0x81')]=_0x18a9a6['body'][_0xb8b1('0x87')];_0x57bd31[_0xb8b1('0x5b')]['body']=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x88')];_0x57bd31[_0xb8b1('0x5b')]['messageId']=_0x18a9a6['body'][_0xb8b1('0x89')];break;case'infobip':_0x57bd31[_0xb8b1('0x5b')]['from']='+'+_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x8a')][0x0][_0xb8b1('0x81')];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x5b')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x8a')][0x0][_0xb8b1('0x83')];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x82')]=_0x18a9a6[_0xb8b1('0x5b')]['results'][0x0]['messageId'];break;case _0xb8b1('0x8b'):_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x8c')];_0x57bd31['body'][_0xb8b1('0x5b')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x8d')][_0xb8b1('0x25')];break;case _0xb8b1('0x8e'):_0x57bd31['body'][_0xb8b1('0x81')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x8f')];_0x57bd31[_0xb8b1('0x5b')]['body']=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x83')];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x82')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x90')];break;case'bandwidth':_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x82')]=_0x18a9a6[_0xb8b1('0x5b')][0x0][_0xb8b1('0x25')]['id'];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')]=_0x18a9a6['body'][0x0][_0xb8b1('0x25')]['from'];_0x57bd31[_0xb8b1('0x5b')]['body']=_0x18a9a6['body'][0x0][_0xb8b1('0x25')][_0xb8b1('0x83')];break;case'intelepeer':_0x57bd31['body'][_0xb8b1('0x81')]=_0x18a9a6[_0xb8b1('0x5b')]['from'];_0x57bd31[_0xb8b1('0x5b')]['body']=_0x18a9a6[_0xb8b1('0x5b')]['message'];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x82')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x91')];break;}}if(_0x57bd31[_0xb8b1('0x5b')]['id']){delete _0x57bd31['body']['id'];}if(_['isNil'](_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')])){throw new db[(_0xb8b1('0x78'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xb8b1('0x92')](_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x5b')])||_0x57bd31['body'][_0xb8b1('0x5b')]===''){throw new db[(_0xb8b1('0x78'))]['ValidationError'](_0xb8b1('0x93'));}if(_['isNil'](_0x57bd31[_0xb8b1('0x5b')]['mapKey'])){throw new db[(_0xb8b1('0x78'))][(_0xb8b1('0x79'))](_0xb8b1('0x94')+_0x162052);}if(!_['includes'](_0x162052,_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x95')])){throw new db['Sequelize'][(_0xb8b1('0x79'))](_0xb8b1('0x96')+_0x162052);}_0x353be8[_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x95')]]=_0x57bd31['body']['from'];return db[_0xb8b1('0x97')][_0xb8b1('0x59')]({'where':{'id':_0x57bd31['account'][_0xb8b1('0x7e')]},'include':[{'model':db[_0xb8b1('0x77')],'as':_0xb8b1('0x98'),'where':_0x353be8,'limit':0x1,'order':[[_0xb8b1('0x7d'),'DESC']]}]});})[_0xb8b1('0x1d')](handleEntityNotFound(_0x5bfaa2,null))[_0xb8b1('0x1d')](function(_0x52523d){if(_0x52523d){_0x57bd31[_0xb8b1('0x99')]=_[_0xb8b1('0x9a')](_0x52523d,[_0xb8b1('0x98')]);if(_0x52523d['Contacts'][_0xb8b1('0x49')]){return _0x52523d[_0xb8b1('0x98')][0x0];}var _0x1bcfc9=_[_0xb8b1('0x17')](_0x57bd31['body'],{'firstName':_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')],'ListId':_0x52523d['id']});_0x1bcfc9[_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x95')]]=_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')];return db[_0xb8b1('0x77')][_0xb8b1('0x5a')](_0x1bcfc9,{'fields':_0x332f76,'raw':!![]});}})['then'](handleEntityNotFound(_0x5bfaa2,null))[_0xb8b1('0x1d')](function(_0x23b2a0){if(_0x23b2a0){_0x57bd31['contact']=_0x23b2a0;var _0x4f3781={'ContactId':_0x23b2a0['id'],'phone':_0x57bd31[_0xb8b1('0x5b')]['from'],'SmsAccountId':_0x18a9a6[_0xb8b1('0x57')]['id']};var _0x4dc646={'ContactId':_0x23b2a0['id'],'SmsAccountId':_0x18a9a6[_0xb8b1('0x57')]['id'],'closed':![]};return db[_0xb8b1('0x9b')][_0xb8b1('0x59')]({'where':_0x4dc646})[_0xb8b1('0x1d')](function(_0x39ba8e){if(_0x39ba8e){return[_0x39ba8e,![]];}return db[_0xb8b1('0x9b')]['create'](_0x4f3781)['then'](function(_0x34cc47){return[_0x34cc47,!![]];});});}})[_0xb8b1('0x9c')](function(_0x2a23a1,_0x314a59){_0x57bd31[_0xb8b1('0x9d')]=_0x2a23a1[_0xb8b1('0x35')]({'plain':!![]});_0x57bd31[_0xb8b1('0x9d')][_0xb8b1('0x9e')]=![];if(_0x314a59){if(_0x57bd31[_0xb8b1('0x76')][_0xb8b1('0x9f')]){_0x57bd31[_0xb8b1('0x73')][_0xb8b1('0xa0')]({'id':0x0,'priority':_0x57bd31[_0xb8b1('0x73')]['length']+0x1,'app':'close','appdata':_0xb8b1('0xa1'),'interval':'*,*,*,*'});}_0x57bd31['interaction']['created']=!![];}return db[_0xb8b1('0xa2')][_0xb8b1('0x5a')]({'phone':_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')],'messageId':_0x57bd31[_0xb8b1('0x5b')]['messageId'],'body':_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x5b')],'SmsAccountId':_0x18a9a6[_0xb8b1('0x57')]['id'],'SmsInteractionId':_0x2a23a1['id'],'direction':'in','ContactId':_0x2a23a1['ContactId'],'AttachmentId':_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0xa3')]});})[_0xb8b1('0x1d')](function(_0x1b07b7){_0x57bd31['message']=_0x1b07b7;if(!_0x57bd31['interaction'][_0xb8b1('0xa4')])return;return db[_0xb8b1('0xa5')][_0xb8b1('0x59')]({'attributes':['id',_0xb8b1('0x42')],'where':{'id':_0x57bd31[_0xb8b1('0x9d')]['UserId']}});})[_0xb8b1('0x1d')](function(_0x411cd7){if(_0x411cd7){_0x57bd31['applications'][_0xb8b1('0xa6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x411cd7[_0xb8b1('0x42')]+','+(_0x57bd31[_0xb8b1('0x76')]['waitForTheAssignedAgent']||0xa),'interval':_0xb8b1('0xa7')});}if(!_0x57bd31[_0xb8b1('0x9d')]['queueId'])return;return db['SmsQueue']['find']({'attributes':['id',_0xb8b1('0x42')],'where':{'id':_0x57bd31[_0xb8b1('0x9d')]['queueId']}});})[_0xb8b1('0x1d')](function(_0x150e55){if(_0x150e55){_0x57bd31[_0xb8b1('0x73')][_0xb8b1('0xa6')]({'id':0x0,'priority':0x1,'app':_0xb8b1('0xa8'),'appdata':_0x150e55[_0xb8b1('0x42')]+','+(_0x57bd31[_0xb8b1('0x76')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb8b1('0xa9'),_0xb8b1('0xaa'),_0x57bd31);})[_0xb8b1('0x1d')](function(_0x4d22ff){if(_0x4d22ff){var _0xc71b25=0xc8;var _0x4bbfe5='receiveMessage';logger[_0xb8b1('0x26')](_0xb8b1('0x21'),_0x4bbfe5,_0xc71b25,_0xb8b1('0xab'));logger[_0xb8b1('0x20')](_0xb8b1('0xac'),_0x4bbfe5,_0xc71b25,_0xb8b1('0xab'),JSON[_0xb8b1('0x22')](_0x4d22ff));if(_0x57bd31[_0xb8b1('0x76')]['type']===_0xb8b1('0x80')){return _0x5bfaa2['status'](_0xc71b25)[_0xb8b1('0xad')](_0xb8b1('0xae'),_0xb8b1('0xaf'))[_0xb8b1('0xb0')]('\x0a');}else{return _0x5bfaa2['status'](_0xc71b25)[_0xb8b1('0x2b')](_0x4d22ff);}}})['catch'](handleError(_0x5bfaa2,null));};exports[_0xb8b1('0xb1')]=function(_0x29d351,_0x5a73df){var _0x41e65c=_0x29d351[_0xb8b1('0x57')]['id'];var _0x2d40ea=_0x29d351['body'];var _0x49e617=0xc8;var _0x3f1556=null;return db['sequelize'][_0xb8b1('0xb2')]({'isolationLevel':db[_0xb8b1('0xb3')][_0xb8b1('0xb4')][_0xb8b1('0xb5')][_0xb8b1('0xb6')]},function(_0x4e3594){return db['SmsAccount'][_0xb8b1('0x67')]({'where':{'id':_0x41e65c},'transaction':_0x4e3594})['then'](function(_0x239081){if(_0x239081){return db[_0xb8b1('0x71')][_0xb8b1('0x34')]({'where':{'SmsAccountId':_0x41e65c},'transaction':_0x4e3594})['then'](function(){var _0x276252=_[_0xb8b1('0x3c')](_0x2d40ea,function(_0x2ead65){_0x2ead65['SmsAccountId']=_0x41e65c;return _0x2ead65;});return db[_0xb8b1('0x71')][_0xb8b1('0xb7')](_0x276252,{'transaction':_0x4e3594});});}else{_0x49e617=0x194;_0x3f1556=[];}});})[_0xb8b1('0x1d')](function(){if(_0x49e617!==0x194){return db[_0xb8b1('0x71')][_0xb8b1('0xb8')]({'where':{'SmsAccountId':_0x41e65c},'order':_0xb8b1('0xb9')})[_0xb8b1('0x1d')](function(_0x233846){_0x3f1556=_0x233846;});}})[_0xb8b1('0x28')](function(_0xd2027c){_0x49e617=0x1f4;logger[_0xb8b1('0x24')](_0xd2027c[_0xb8b1('0x39')]);if(_0xd2027c[_0xb8b1('0x42')]){delete _0xd2027c['name'];}_0x3f1556=_0xd2027c;})[_0xb8b1('0xba')](function(){if(_0x3f1556===null){_0x5a73df[_0xb8b1('0x29')](_0x49e617);}else{if(_0x49e617===0x1f4){_0x5a73df['status'](_0x49e617)[_0xb8b1('0xb0')](_0x3f1556);}else{_0x5a73df[_0xb8b1('0x2a')](_0x49e617)['json'](_0x3f1556);}}});};exports['getApplications']=function(_0x3d4ee8,_0x400b31,_0x259c86){var _0xc08bc4={};var _0x59e00b={};var _0x43d82e;var _0x2cecee;return db[_0xb8b1('0x3d')]['findOne']({'where':{'id':_0x3d4ee8[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x400b31,null))[_0xb8b1('0x1d')](function(_0x29e25f){if(_0x29e25f){_0x43d82e=_0x29e25f;_0x59e00b['model']=_[_0xb8b1('0x44')](db['SmsApplication'][_0xb8b1('0x3e')]);_0x59e00b[_0xb8b1('0x43')]=_[_0xb8b1('0x44')](_0x3d4ee8['query']);_0x59e00b[_0xb8b1('0x45')]=_['intersection'](_0x59e00b['model'],_0x59e00b['query']);_0xc08bc4[_0xb8b1('0x47')]=_[_0xb8b1('0x46')](_0x59e00b[_0xb8b1('0x41')],qs['fields'](_0x3d4ee8['query'][_0xb8b1('0x48')]));_0xc08bc4[_0xb8b1('0x47')]=_0xc08bc4['attributes']['length']?_0xc08bc4[_0xb8b1('0x47')]:_0x59e00b['model'];_0xc08bc4[_0xb8b1('0x4b')]=qs[_0xb8b1('0x4c')](_0x3d4ee8[_0xb8b1('0x43')][_0xb8b1('0x4c')]);_0xc08bc4[_0xb8b1('0x4d')]=qs[_0xb8b1('0x45')](_[_0xb8b1('0x69')](_0x3d4ee8['query'],_0x59e00b[_0xb8b1('0x45')]));if(_0x3d4ee8[_0xb8b1('0x43')][_0xb8b1('0x4e')]){_0xc08bc4[_0xb8b1('0x4d')]=_[_0xb8b1('0x4f')](_0xc08bc4['where'],{'$or':_[_0xb8b1('0x3c')](_0xc08bc4[_0xb8b1('0x47')],function(_0x4dee80){var _0x583fab={};_0x583fab[_0x4dee80]={'$like':'%'+_0x3d4ee8[_0xb8b1('0x43')][_0xb8b1('0x4e')]+'%'};return _0x583fab;})});}_0xc08bc4=_[_0xb8b1('0x4f')]({},_0xc08bc4,_0x3d4ee8[_0xb8b1('0x51')]);return _0x43d82e[_0xb8b1('0xbb')](_0xc08bc4);}})[_0xb8b1('0x1d')](function(_0x1e0d0e){if(_0x1e0d0e){_0x2cecee=_0x1e0d0e[_0xb8b1('0x49')];if(!_0x3d4ee8['query']['hasOwnProperty']('nolimit')){_0xc08bc4[_0xb8b1('0x2c')]=qs[_0xb8b1('0x2c')](_0x3d4ee8['query'][_0xb8b1('0x2c')]);_0xc08bc4[_0xb8b1('0x2e')]=qs[_0xb8b1('0x2e')](_0x3d4ee8['query'][_0xb8b1('0x2e')]);}return _0x43d82e['getApplications'](_0xc08bc4);}})[_0xb8b1('0x1d')](function(_0x357f5c){if(_0x357f5c){return _0x357f5c?{'count':_0x2cecee,'rows':_0x357f5c}:null;}})[_0xb8b1('0x1d')](respondWithResult(_0x400b31,null))[_0xb8b1('0x28')](handleError(_0x400b31,null));};exports[_0xb8b1('0xbc')]=function(_0x412224,_0x3b748a,_0x1a9182){var _0x486b09={'raw':![],'where':{}};var _0x3ffe26={};var _0x217e1c={'count':0x0,'rows':[]};return db[_0xb8b1('0x3d')][_0xb8b1('0x67')]({'where':{'id':_0x412224[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x3b748a,null))[_0xb8b1('0x1d')](function(_0x3d2d25){if(_0x3d2d25){_0x3ffe26['model']=_[_0xb8b1('0x44')](db['SmsInteraction'][_0xb8b1('0x3e')]);_0x3ffe26[_0xb8b1('0x43')]=_['keys'](_0x412224[_0xb8b1('0x43')]);_0x3ffe26['filters']=_[_0xb8b1('0x46')](_0x3ffe26[_0xb8b1('0x41')],_0x3ffe26[_0xb8b1('0x43')]);_0x486b09[_0xb8b1('0x47')]=_['intersection'](_0x3ffe26[_0xb8b1('0x41')],qs[_0xb8b1('0x48')](_0x412224['query'][_0xb8b1('0x48')]));_0x486b09['attributes']=_0x486b09[_0xb8b1('0x47')][_0xb8b1('0x49')]?_0x486b09[_0xb8b1('0x47')]:_0x3ffe26[_0xb8b1('0x41')];if(!_0x412224[_0xb8b1('0x43')][_0xb8b1('0x68')](_0xb8b1('0x4a'))){_0x486b09[_0xb8b1('0x2c')]=qs[_0xb8b1('0x2c')](_0x412224[_0xb8b1('0x43')]['limit']);_0x486b09['offset']=qs[_0xb8b1('0x2e')](_0x412224[_0xb8b1('0x43')][_0xb8b1('0x2e')]);}_0x486b09[_0xb8b1('0x4b')]=qs[_0xb8b1('0x4c')](_0x412224[_0xb8b1('0x43')][_0xb8b1('0x4c')]);_0x486b09['where']=qs['filters'](_[_0xb8b1('0x69')](_0x412224['query'],_0x3ffe26[_0xb8b1('0x45')]));_0x486b09[_0xb8b1('0x4d')][_0xb8b1('0x65')]=_0x3d2d25['id'];if(_0x412224[_0xb8b1('0x43')]['filter']){_0x486b09[_0xb8b1('0x4d')]=_[_0xb8b1('0x4f')](_0x486b09['where'],{'$or':_['map'](_0x486b09['attributes'],function(_0x14e36d){var _0x2ff192={};_0x2ff192[_0x14e36d]={'$like':'%'+_0x412224[_0xb8b1('0x43')][_0xb8b1('0x4e')]+'%'};return _0x2ff192;})});}_0x486b09=_[_0xb8b1('0x4f')]({},_0x486b09,_0x412224[_0xb8b1('0x51')]);return db['SmsInteraction'][_0xb8b1('0x2f')]({'where':_0x486b09[_0xb8b1('0x4d')]})[_0xb8b1('0x1d')](function(_0x899d96){_0x217e1c[_0xb8b1('0x2f')]=_0x899d96;if(_0x412224[_0xb8b1('0x43')]['includeAll']){_0x486b09[_0xb8b1('0x53')]=[{'model':db[_0xb8b1('0x77')],'as':_0xb8b1('0xbd'),'required':![]},{'model':db[_0xb8b1('0xa5')],'as':'Owner','attributes':[_0xb8b1('0x42'),'fullname',_0xb8b1('0xbe')],'required':![]},{'model':db[_0xb8b1('0xbf')],'as':_0xb8b1('0xc0'),'attributes':['id',_0xb8b1('0x42'),_0xb8b1('0xc1')],'where':_0x412224[_0xb8b1('0x43')]['tag']?{'id':_0x412224['query'][_0xb8b1('0xc2')]}:undefined,'required':_0x412224[_0xb8b1('0x43')]['tag']?!![]:![]}];}return db[_0xb8b1('0x9b')][_0xb8b1('0x54')](_0x486b09);})[_0xb8b1('0x1d')](function(_0x5e8567){_0x217e1c[_0xb8b1('0x55')]=_0x5e8567;return _0x217e1c;});}})[_0xb8b1('0x1d')](respondWithFilteredResult(_0x3b748a,_0x486b09))[_0xb8b1('0x28')](handleError(_0x3b748a,null));};exports[_0xb8b1('0xb0')]=function(_0x345201,_0x393889,_0x210abb){var _0x1777cb,_0x20b77a,_0xf7a78;if(_[_0xb8b1('0x92')](_0x345201[_0xb8b1('0x5b')][_0xb8b1('0x5b')])||_0x345201['body'][_0xb8b1('0x5b')]===''){throw new db['Sequelize'][(_0xb8b1('0x79'))](_0xb8b1('0x93'));}if(_[_0xb8b1('0x92')](_0x345201[_0xb8b1('0x5b')]['to'])){throw new db[(_0xb8b1('0x78'))]['ValidationError'](_0xb8b1('0xc3'));}_0x1777cb=_0x345201[_0xb8b1('0x5b')]['to'];return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x345201[_0xb8b1('0x57')]['id']},'include':[{'model':db[_0xb8b1('0x97')],'as':_0xb8b1('0xc4'),'include':[{'model':db['CmContact'],'as':_0xb8b1('0x98'),'where':{'mobile':_0x1777cb},'limit':0x1,'order':[[_0xb8b1('0x7d'),_0xb8b1('0xc5')]]}]}]})[_0xb8b1('0x1d')](handleEntityNotFound(_0x393889,null))['then'](function(_0x33d74e){if(_0x33d74e&&_0x33d74e[_0xb8b1('0xc4')]){_0x20b77a=_0x33d74e[_0xb8b1('0x35')]({'plain':!![]});if(_0x20b77a[_0xb8b1('0xc4')]&&_0x20b77a[_0xb8b1('0xc4')][_0xb8b1('0x98')][_0xb8b1('0x49')]){return _0x20b77a[_0xb8b1('0xc4')][_0xb8b1('0x98')][0x0];}return db[_0xb8b1('0x77')][_0xb8b1('0x5a')](_[_0xb8b1('0x17')](_0x345201['body'],{'firstName':_0x1777cb,'mobile':_0x1777cb,'phone':_0x1777cb,'ListId':_0x20b77a[_0xb8b1('0x7e')]}));}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x393889,null))[_0xb8b1('0x1d')](function(_0x32e9c2){if(_0x32e9c2){_0xf7a78=_0x32e9c2;return db[_0xb8b1('0x9b')]['find']({'where':{'ContactId':_0xf7a78['id'],'closed':![],'SmsAccountId':_0x20b77a['id']}})[_0xb8b1('0x1d')](function(_0x3830d1){if(_0x3830d1){return[_0x3830d1,![]];}return db[_0xb8b1('0x9b')]['create']({'UserId':_0x345201[_0xb8b1('0x5c')]['id'],'ContactId':_0xf7a78['id'],'SmsAccountId':_0x20b77a['id'],'phone':_0x1777cb,'firstMsgDirection':_0xb8b1('0xc6'),'Messages':[_['merge'](_0x345201[_0xb8b1('0x5b')],{'read':![],'body':_0x345201[_0xb8b1('0x5b')][_0xb8b1('0x5b')],'phone':_0x1777cb,'SmsAccountId':_0x20b77a['id'],'UserId':_0x345201[_0xb8b1('0x5c')]['id'],'ContactId':_0xf7a78['id']})]},{'include':[{'model':db[_0xb8b1('0xa2')],'as':_0xb8b1('0xc7')}]})[_0xb8b1('0x1d')](function(_0x462235){return[_0x462235,!![]];});});}})[_0xb8b1('0x9c')](function(_0x31b8f9,_0x282fea){if(_0x282fea){return _0x31b8f9;}return db['SmsMessage'][_0xb8b1('0x5a')](_[_0xb8b1('0x4f')](_0x345201[_0xb8b1('0x5b')],{'read':![],'body':_0x345201[_0xb8b1('0x5b')][_0xb8b1('0x5b')],'phone':_0x1777cb,'SmsAccountId':_0x20b77a['id'],'SmsInteractionId':_0x31b8f9['id'],'UserId':_0x345201[_0xb8b1('0x5c')]['id'],'ContactId':_0xf7a78['id']}))[_0xb8b1('0x1d')](function(_0x9c5c4f){_0x31b8f9[_0xb8b1('0xc8')][_0xb8b1('0xc7')]=[];_0x31b8f9['dataValues']['Messages'][_0xb8b1('0xa0')](_0x9c5c4f['dataValues']);return _0x31b8f9;});})[_0xb8b1('0x1d')](respondWithResult(_0x393889,null))['catch'](handleError(_0x393889,null));};exports[_0xb8b1('0x2a')]=function(_0x5b0e74,_0x35674f,_0x3ce5ad){if(_0x5b0e74[_0xb8b1('0x5b')]['id']){delete _0x5b0e74['body']['id'];}var _0x456662,_0x250e6b,_0x56eb5f;return db['SmsAccount'][_0xb8b1('0x59')]({'where':{'id':_0x5b0e74[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x35674f,null))['then'](function(_0x955a60){if(_0x955a60){_0x56eb5f=_0x955a60;logger[_0xb8b1('0x20')](_0xb8b1('0x21'),_0xb8b1('0x2a'),_0xb8b1('0xc9'),_0x955a60[_0xb8b1('0x50')],util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));switch(_0x955a60['type']){case _0xb8b1('0xcb'):if(_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0xcc')]&&_0x5b0e74['body'][_0xb8b1('0x2a')]){_0x250e6b=_0x5b0e74[_0xb8b1('0x5b')]['status'];return db[_0xb8b1('0xa2')][_0xb8b1('0x59')]({'where':{'messageId':_0x5b0e74['body'][_0xb8b1('0xcc')]}});}break;case _0xb8b1('0x84'):if(_0x5b0e74['body'][_0xb8b1('0xcd')]&&_0x5b0e74[_0xb8b1('0x5b')]['statusInt']){_0x250e6b=_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0xce')];return db[_0xb8b1('0xa2')][_0xb8b1('0x59')]({'where':{'messageId':_0x5b0e74['body']['requestid']}});}break;case _0xb8b1('0xcf'):if(_0x5b0e74['body'][_0xb8b1('0x85')]&&_0x5b0e74['body'][_0xb8b1('0xd0')]){_0x250e6b=_0x5b0e74[_0xb8b1('0x5b')]['status_code'];return db[_0xb8b1('0xa2')][_0xb8b1('0x59')]({'where':{'messageId':_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x85')]}});}break;case'infobip':var _0x4241c=_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x8a')][0x0];if(_0x4241c[_0xb8b1('0x82')]&&_0x4241c[_0xb8b1('0x2a')][_0xb8b1('0xd1')]==='DELIVERED'){_0x250e6b=_0x4241c['status']['groupName'];return db[_0xb8b1('0xa2')][_0xb8b1('0x59')]({'where':{'messageId':_0x4241c[_0xb8b1('0x82')]}});}break;case _0xb8b1('0x8e'):if(_0x5b0e74['body']['messageId']&&_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x2a')]){_0x250e6b=_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x2a')];return db[_0xb8b1('0xa2')][_0xb8b1('0x59')]({'where':{'messageId':_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x82')]}});}break;case'bandwidth':if(_0x5b0e74[_0xb8b1('0x5b')][0x0][_0xb8b1('0x25')]['id']){_0x250e6b=_0x5b0e74[_0xb8b1('0x5b')][0x0][_0xb8b1('0x50')];return db['SmsMessage'][_0xb8b1('0x59')]({'where':{'messageId':_0x5b0e74[_0xb8b1('0x5b')][0x0][_0xb8b1('0x25')]['id']}});}break;case'intelepeer':if(_0x5b0e74['body'][_0xb8b1('0xd2')]&&_0x5b0e74[_0xb8b1('0x5b')]['status']){_0x250e6b=_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x2a')];return db[_0xb8b1('0xa2')][_0xb8b1('0x59')]({'where':{'messageId':_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0xd2')]}});}break;}}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x35674f,null))[_0xb8b1('0x1d')](function(_0x136759){if(_0x136759){_0x456662=_0x136759;switch(_0x56eb5f[_0xb8b1('0x50')]){case _0xb8b1('0xcb'):if(_0x250e6b===_0xb8b1('0xd3')){return _0x456662[_0xb8b1('0x62')]({'read':!![]});}else{logger['error'](_0xb8b1('0x21'),_0xb8b1('0x2a'),_0xb8b1('0xcb'),util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xb8b1('0x84'):if(_0x250e6b==='1'){return _0x456662[_0xb8b1('0x62')]({'read':!![]});}else{logger[_0xb8b1('0x24')](_0xb8b1('0x21'),'status','skebby',util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xb8b1('0xcf'):if(!_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0xd4')]&&_0x250e6b>=0xc8&&_0x250e6b<=0xce){return _0x456662['update']({'read':!![]});}else{logger[_0xb8b1('0x24')](_0xb8b1('0x21'),'status',_0xb8b1('0xcf'),util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x161327=_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x8a')][0x0];if(_0x161327['status'][_0xb8b1('0xd1')]==='DELIVERED'){return _0x456662[_0xb8b1('0x62')]({'read':!![]});}else{logger['error'](_0xb8b1('0x21'),_0xb8b1('0x2a'),_0xb8b1('0xd5'),util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xb8b1('0x8e'):if(_0x250e6b==_0xb8b1('0xd6')||_0x250e6b=='RECEIVED_BY_RECIPIENT'){return _0x456662['update']({'read':!![]});}else{logger[_0xb8b1('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb8b1('0x2a'),_0xb8b1('0x8e'),util[_0xb8b1('0xca')](_0x5b0e74['body'],{'showHidden':![],'depth':null}));}break;case _0xb8b1('0xd7'):if(_0x250e6b==_0xb8b1('0xd8')){return _0x456662['update']({'read':!![]});}else{logger[_0xb8b1('0x24')](_0xb8b1('0x21'),_0xb8b1('0x2a'),_0xb8b1('0xd7'),util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xb8b1('0xd9'):if(_0x250e6b===_0xb8b1('0xda')||_0x250e6b===_0xb8b1('0xdb')){return _0x456662['update']({'read':!![]});}else{logger[_0xb8b1('0x24')](_0xb8b1('0x21'),_0xb8b1('0x2a'),_0xb8b1('0xd9'),util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x456662;}})['then'](respondWithResult(_0x35674f,null))['catch'](handleError(_0x35674f,null));};exports[_0xb8b1('0xdc')]=function(_0x42090c,_0x5d163e,_0x4b107f){var _0x522f33,_0x392db6,_0x7d6afd;return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x42090c[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x5d163e,null))[_0xb8b1('0x1d')](function(_0x22de2a){if(_0x22de2a){_0x7d6afd=_0x22de2a;logger[_0xb8b1('0x20')](_0xb8b1('0x21'),_0xb8b1('0x2a'),_0xb8b1('0xc9'),_0x22de2a[_0xb8b1('0x50')],util[_0xb8b1('0xca')](_0x42090c[_0xb8b1('0x43')],{'showHidden':![],'depth':null}));switch(_0x22de2a['type']){case'csc':if(_0x42090c[_0xb8b1('0x43')][_0xb8b1('0xdd')]&&_0x42090c['query'][_0xb8b1('0xde')]){_0x392db6=_0x42090c[_0xb8b1('0x43')][_0xb8b1('0xde')];return db['SmsMessage'][_0xb8b1('0x59')]({'where':{'messageId':_0x42090c[_0xb8b1('0x43')][_0xb8b1('0xdd')]}});}break;}}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x5d163e,null))[_0xb8b1('0x1d')](function(_0x27efd6){if(_0x27efd6){_0x522f33=_0x27efd6;switch(_0x7d6afd[_0xb8b1('0x50')]){case _0xb8b1('0x8b'):if(_0x392db6==='2'||_0x392db6==='6'){return _0x522f33[_0xb8b1('0x62')]({'read':!![]});}else{logger[_0xb8b1('0x24')](_0xb8b1('0x21'),_0xb8b1('0x2a'),'csc',util[_0xb8b1('0xca')](_0x42090c[_0xb8b1('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x522f33;}})[_0xb8b1('0x1d')](respondWithResult(_0x5d163e,null))[_0xb8b1('0x28')](handleError(_0x5d163e,null));};exports[_0xb8b1('0xdf')]=function(_0x2b532f,_0x22686d,_0x34f61b){return db[_0xb8b1('0x3d')]['find']({'where':{'id':_0x2b532f[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x22686d,null))[_0xb8b1('0x1d')](function(_0x480f2e){if(_0x480f2e){return _0x480f2e[_0xb8b1('0xdf')](_0x2b532f[_0xb8b1('0x5b')][_0xb8b1('0x6c')],_[_0xb8b1('0x9a')](_0x2b532f[_0xb8b1('0x5b')],[_0xb8b1('0x6c'),'id'])||{})[_0xb8b1('0x9c')](function(_0x31213a){for(var _0x47897d=0x0;_0x47897d<_0x2b532f[_0xb8b1('0x5b')]['ids']['length'];_0x47897d+=0x1){socket['emit'](_0xb8b1('0xe0'),{'UserId':Number(_0x2b532f[_0xb8b1('0x5b')][_0xb8b1('0x6c')][_0x47897d]),'SmsAccountId':Number(_0x2b532f[_0xb8b1('0x57')]['id'])});}return _0x31213a;});}})[_0xb8b1('0x1d')](respondWithResult(_0x22686d,null))[_0xb8b1('0x28')](handleError(_0x22686d,null));};exports[_0xb8b1('0xe1')]=function(_0x1b8fb5,_0x29ba35,_0x320fb0){return db[_0xb8b1('0x3d')]['find']({'where':{'id':_0x1b8fb5['params']['id']}})['then'](handleEntityNotFound(_0x29ba35,null))['then'](function(_0x26b183){if(_0x26b183){return _0x26b183['removeAgents'](_0x1b8fb5['query'][_0xb8b1('0x6c')])[_0xb8b1('0x1d')](function(){if(_['isArray'](_0x1b8fb5['query'][_0xb8b1('0x6c')])){for(var _0x27c510=0x0;_0x27c510<_0x1b8fb5['query'][_0xb8b1('0x6c')]['length'];_0x27c510+=0x1){socket[_0xb8b1('0xe2')](_0xb8b1('0xe3'),{'UserId':Number(_0x1b8fb5[_0xb8b1('0x43')][_0xb8b1('0x6c')][_0x27c510]),'SmsAccountId':Number(_0x1b8fb5[_0xb8b1('0x57')]['id'])});}}else{socket[_0xb8b1('0xe2')](_0xb8b1('0xe3'),{'UserId':Number(_0x1b8fb5[_0xb8b1('0x43')][_0xb8b1('0x6c')]),'SmsAccountId':Number(_0x1b8fb5[_0xb8b1('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x29ba35,null))[_0xb8b1('0x28')](handleError(_0x29ba35,null));};exports[_0xb8b1('0xe4')]=function(_0x5cfe26,_0x571f9d,_0xc77fd5){var _0x4df3b7={};var _0x2bc154={};var _0x48e18e;var _0x473f0a;return db['SmsAccount'][_0xb8b1('0x67')]({'where':{'id':_0x5cfe26[_0xb8b1('0x57')]['id']}})['then'](handleEntityNotFound(_0x571f9d,null))[_0xb8b1('0x1d')](function(_0x5d725c){if(_0x5d725c){_0x48e18e=_0x5d725c;_0x2bc154[_0xb8b1('0x41')]=_['keys'](db['User'][_0xb8b1('0x3e')]);_0x2bc154[_0xb8b1('0x43')]=_['keys'](_0x5cfe26[_0xb8b1('0x43')]);_0x2bc154[_0xb8b1('0x45')]=_['intersection'](_0x2bc154[_0xb8b1('0x41')],_0x2bc154[_0xb8b1('0x43')]);_0x4df3b7['attributes']=_[_0xb8b1('0x46')](_0x2bc154[_0xb8b1('0x41')],qs['fields'](_0x5cfe26['query'][_0xb8b1('0x48')]));_0x4df3b7[_0xb8b1('0x47')]=_0x4df3b7[_0xb8b1('0x47')]['length']?_0x4df3b7[_0xb8b1('0x47')]:_0x2bc154[_0xb8b1('0x41')];_0x4df3b7[_0xb8b1('0x4b')]=qs[_0xb8b1('0x4c')](_0x5cfe26['query'][_0xb8b1('0x4c')]);_0x4df3b7[_0xb8b1('0x4d')]=qs[_0xb8b1('0x45')](_[_0xb8b1('0x69')](_0x5cfe26[_0xb8b1('0x43')],_0x2bc154[_0xb8b1('0x45')]));if(_0x5cfe26[_0xb8b1('0x43')][_0xb8b1('0x4e')]){_0x4df3b7[_0xb8b1('0x4d')]=_['merge'](_0x4df3b7['where'],{'$or':_['map'](_0x4df3b7['attributes'],function(_0x2ee69b){var _0x3bb6ba={};_0x3bb6ba[_0x2ee69b]={'$like':'%'+_0x5cfe26[_0xb8b1('0x43')][_0xb8b1('0x4e')]+'%'};return _0x3bb6ba;})});}_0x4df3b7=_[_0xb8b1('0x4f')]({},_0x4df3b7,_0x5cfe26[_0xb8b1('0x51')]);return _0x48e18e[_0xb8b1('0xe4')](_0x4df3b7);}})[_0xb8b1('0x1d')](function(_0x29cce6){if(_0x29cce6){_0x473f0a=_0x29cce6[_0xb8b1('0x49')];if(!_0x5cfe26[_0xb8b1('0x43')][_0xb8b1('0x68')]('nolimit')){_0x4df3b7['limit']=qs[_0xb8b1('0x2c')](_0x5cfe26['query'][_0xb8b1('0x2c')]);_0x4df3b7[_0xb8b1('0x2e')]=qs[_0xb8b1('0x2e')](_0x5cfe26[_0xb8b1('0x43')]['offset']);}return _0x48e18e[_0xb8b1('0xe4')](_0x4df3b7);}})[_0xb8b1('0x1d')](function(_0x480fea){if(_0x480fea){return _0x480fea?{'count':_0x473f0a,'rows':_0x480fea}:null;}})[_0xb8b1('0x1d')](respondWithResult(_0x571f9d,null))[_0xb8b1('0x28')](handleError(_0x571f9d,null));}; \ No newline at end of file +var _0xd722=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','then','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','code','error','SmsAccount,\x20%s,\x20%s','message','info','result','sendStatus','status','offset','undefined','limit','count','json','apply','reject','save','update','SmsAccounts','UserProfileResource','destroy','end','name','send','Pause','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','SmsAccount','findAll','catch','show','params','keys','include','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','length','pick','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','SmsApplication','Applications','account','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','connectel','clicksend','message_id','plivo','Text','MessageUUID','results','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','DESC','list','omit','Contacts','contact','SmsInteraction','interaction','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','set','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','User','Owner','fullname','Tag','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','push','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','redif','DELIVERED','inspect','infobip','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','received\x20delivery\x20report\x20from','csc','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0xd722,0xe4));var _0x2d72=function(_0xe47cfd,_0x3e5333){_0xe47cfd=_0xe47cfd-0x0;var _0xd866e4=_0xd722[_0xe47cfd];return _0xd866e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d72('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d72('0x1'));var rp=require(_0x2d72('0x2'));var moment=require(_0x2d72('0x3'));var BPromise=require(_0x2d72('0x4'));var Mustache=require(_0x2d72('0x5'));var util=require(_0x2d72('0x6'));var path=require('path');var sox=require(_0x2d72('0x7'));var csv=require(_0x2d72('0x8'));var ejs=require(_0x2d72('0x9'));var fs=require('fs');var fs_extra=require(_0x2d72('0xa'));var _=require(_0x2d72('0xb'));var squel=require(_0x2d72('0xc'));var crypto=require(_0x2d72('0xd'));var jsforce=require(_0x2d72('0xe'));var deskjs=require(_0x2d72('0xf'));var toCsv=require(_0x2d72('0x8'));var querystring=require(_0x2d72('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2d72('0x11'));var qs=require(_0x2d72('0x12'));var as=require(_0x2d72('0x13'));var hardwareService=require(_0x2d72('0x14'));var logger=require(_0x2d72('0x15'))('api');var utils=require(_0x2d72('0x16'));var config=require(_0x2d72('0x17'));var licenseUtil=require(_0x2d72('0x18'));var db=require(_0x2d72('0x19'))['db'];config[_0x2d72('0x1a')]=_[_0x2d72('0x1b')](config[_0x2d72('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x2d72('0x1c'))(new Redis(config[_0x2d72('0x1a')]));require(_0x2d72('0x1d'))[_0x2d72('0x1e')](socket);var jayson=require(_0x2d72('0x1f'));var client=jayson[_0x2d72('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2144ad,_0x166ca1,_0x54c371,_0x5e84fc){return new BPromise(function(_0xe57d,_0x4a595e){var _0xf4eb7a=_0x5e84fc||client;return _0xf4eb7a[_0x2d72('0x21')](_0x2144ad,_0x54c371)[_0x2d72('0x22')](function(_0x35d44d){logger['info']('SmsAccount,\x20%s,\x20%s',_0x166ca1,_0x2d72('0x23'));logger['debug'](_0x2d72('0x24'),_0x166ca1,_0x2d72('0x23'),JSON['stringify'](_0x35d44d));if(_0x35d44d['error']){if(_0x35d44d['error'][_0x2d72('0x25')]===0x1f4){logger[_0x2d72('0x26')](_0x2d72('0x27'),_0x166ca1,_0x35d44d['error'][_0x2d72('0x28')]);return _0x4a595e(_0x35d44d['error']['message']);}logger[_0x2d72('0x26')](_0x2d72('0x27'),_0x166ca1,_0x35d44d[_0x2d72('0x26')][_0x2d72('0x28')]);return _0xe57d(_0x35d44d['error'][_0x2d72('0x28')]);}else{logger[_0x2d72('0x29')](_0x2d72('0x27'),_0x166ca1,_0x2d72('0x23'));_0xe57d(_0x35d44d[_0x2d72('0x2a')][_0x2d72('0x28')]);}})['catch'](function(_0x4e1161){logger['error'](_0x2d72('0x27'),_0x166ca1,_0x4e1161);_0x4a595e(_0x4e1161);});});}function respondWithStatusCode(_0x5bee96,_0x5bd5a4){_0x5bd5a4=_0x5bd5a4||0xcc;return function(_0x3743c5){if(_0x3743c5){return _0x5bee96[_0x2d72('0x2b')](_0x5bd5a4);}return _0x5bee96[_0x2d72('0x2c')](_0x5bd5a4)['end']();};}function respondWithResult(_0x4a6010,_0x5ac865){_0x5ac865=_0x5ac865||0xc8;return function(_0x109ff7){if(_0x109ff7){return _0x4a6010['status'](_0x5ac865)['json'](_0x109ff7);}};}function respondWithFilteredResult(_0x9ac378,_0x20cbcb){return function(_0xda9fc5){if(_0xda9fc5){var _0x4b9ddd=typeof _0x20cbcb[_0x2d72('0x2d')]===_0x2d72('0x2e')&&typeof _0x20cbcb[_0x2d72('0x2f')]===_0x2d72('0x2e');var _0x3f3d84=_0xda9fc5['count'];var _0x87cd89=_0x4b9ddd?0x0:_0x20cbcb['offset'];var _0x4eae52=_0x4b9ddd?_0xda9fc5[_0x2d72('0x30')]:_0x20cbcb[_0x2d72('0x2d')]+_0x20cbcb[_0x2d72('0x2f')];var _0x51fe1a;if(_0x4eae52>=_0x3f3d84){_0x4eae52=_0x3f3d84;_0x51fe1a=0xc8;}else{_0x51fe1a=0xce;}_0x9ac378[_0x2d72('0x2c')](_0x51fe1a);return _0x9ac378['set']('Content-Range',_0x87cd89+'-'+_0x4eae52+'/'+_0x3f3d84)[_0x2d72('0x31')](_0xda9fc5);}return null;};}function patchUpdates(_0x948d64){return function(_0x4bf2c3){try{jsonpatch[_0x2d72('0x32')](_0x4bf2c3,_0x948d64,!![]);}catch(_0x27390f){return BPromise[_0x2d72('0x33')](_0x27390f);}return _0x4bf2c3[_0x2d72('0x34')]();};}function saveUpdates(_0x292519,_0x243e3a){return function(_0x5e5f27){if(_0x5e5f27){return _0x5e5f27[_0x2d72('0x35')](_0x292519)[_0x2d72('0x22')](function(_0x24bb0c){return _0x24bb0c;});}return null;};}function removeEntity(_0xb56e13,_0x42b5e7){return function(_0x3df0ff){if(_0x3df0ff){return _0x3df0ff['destroy']()[_0x2d72('0x22')](function(){var _0x118082=_0x3df0ff['get']({'plain':!![]});var _0x2c1e47=_0x2d72('0x36');return db[_0x2d72('0x37')][_0x2d72('0x38')]({'where':{'type':_0x2c1e47,'resourceId':_0x118082['id']}})['then'](function(){return _0x3df0ff;});})['then'](function(){_0xb56e13[_0x2d72('0x2c')](0xcc)[_0x2d72('0x39')]();});}};}function handleEntityNotFound(_0x1cc840,_0x4dc0f7){return function(_0x504939){if(!_0x504939){_0x1cc840[_0x2d72('0x2b')](0x194);}return _0x504939;};}function handleError(_0xb7b6d7,_0x5c6a05){_0x5c6a05=_0x5c6a05||0x1f4;return function(_0x468f53){logger[_0x2d72('0x26')](_0x468f53['stack']);if(_0x468f53[_0x2d72('0x3a')]){delete _0x468f53[_0x2d72('0x3a')];}_0xb7b6d7[_0x2d72('0x2c')](_0x5c6a05)[_0x2d72('0x3b')](_0x468f53);};}exports['index']=function(_0x484b1a,_0xcd6e){var _0x210c4f={'include':[{'model':db[_0x2d72('0x3c')],'as':'mandatoryDispositionPause'}]},_0x1ac933={},_0x514180={'count':0x0,'rows':[]};var _0x473a18=_[_0x2d72('0x3d')](db['SmsAccount'][_0x2d72('0x3e')],function(_0xdcf09e){return{'name':_0xdcf09e[_0x2d72('0x3f')],'type':_0xdcf09e['type']['key']};});_0x1ac933[_0x2d72('0x40')]=_['map'](_0x473a18,_0x2d72('0x3a'));_0x1ac933[_0x2d72('0x41')]=_['keys'](_0x484b1a[_0x2d72('0x41')]);_0x1ac933[_0x2d72('0x42')]=_[_0x2d72('0x43')](_0x1ac933[_0x2d72('0x40')],_0x1ac933[_0x2d72('0x41')]);_0x210c4f[_0x2d72('0x44')]=_[_0x2d72('0x43')](_0x1ac933[_0x2d72('0x40')],qs[_0x2d72('0x45')](_0x484b1a[_0x2d72('0x41')]['fields']));_0x210c4f[_0x2d72('0x44')]=_0x210c4f['attributes']['length']?_0x210c4f[_0x2d72('0x44')]:_0x1ac933['model'];if(!_0x484b1a[_0x2d72('0x41')][_0x2d72('0x46')](_0x2d72('0x47'))){_0x210c4f[_0x2d72('0x2f')]=qs[_0x2d72('0x2f')](_0x484b1a[_0x2d72('0x41')][_0x2d72('0x2f')]);_0x210c4f[_0x2d72('0x2d')]=qs[_0x2d72('0x2d')](_0x484b1a[_0x2d72('0x41')][_0x2d72('0x2d')]);}_0x210c4f[_0x2d72('0x48')]=qs[_0x2d72('0x49')](_0x484b1a[_0x2d72('0x41')][_0x2d72('0x49')]);_0x210c4f[_0x2d72('0x4a')]=qs['filters'](_['pick'](_0x484b1a[_0x2d72('0x41')],_0x1ac933[_0x2d72('0x42')]),_0x473a18);if(_0x484b1a['query'][_0x2d72('0x4b')]){_0x210c4f['where']=_[_0x2d72('0x4c')](_0x210c4f[_0x2d72('0x4a')],{'$or':_[_0x2d72('0x3d')](_0x473a18,function(_0x4ec351){if(_0x4ec351[_0x2d72('0x4d')]!==_0x2d72('0x4e')){var _0x527a26={};_0x527a26[_0x4ec351[_0x2d72('0x3a')]]={'$like':'%'+_0x484b1a[_0x2d72('0x41')][_0x2d72('0x4b')]+'%'};return _0x527a26;}})});}_0x210c4f=_[_0x2d72('0x4c')]({},_0x210c4f,_0x484b1a['options']);var _0xbe60ec={'where':_0x210c4f[_0x2d72('0x4a')]};return db['SmsAccount'][_0x2d72('0x30')](_0xbe60ec)['then'](function(_0x2198d8){_0x514180[_0x2d72('0x30')]=_0x2198d8;if(_0x484b1a['query'][_0x2d72('0x4f')]){_0x210c4f['include']=[{'all':!![]}];}return db[_0x2d72('0x50')][_0x2d72('0x51')](_0x210c4f);})[_0x2d72('0x22')](function(_0x41f7f5){_0x514180['rows']=_0x41f7f5;return _0x514180;})[_0x2d72('0x22')](respondWithFilteredResult(_0xcd6e,_0x210c4f))[_0x2d72('0x52')](handleError(_0xcd6e,null));};exports[_0x2d72('0x53')]=function(_0x5de805,_0x4135f9){var _0x14763d={'raw':![],'where':{'id':_0x5de805[_0x2d72('0x54')]['id']},'include':[{'model':db[_0x2d72('0x3c')],'as':'mandatoryDispositionPause'}]},_0x168a64={};_0x168a64[_0x2d72('0x40')]=_['keys'](db['SmsAccount'][_0x2d72('0x3e')]);_0x168a64[_0x2d72('0x41')]=_[_0x2d72('0x55')](_0x5de805[_0x2d72('0x41')]);_0x168a64['filters']=_['intersection'](_0x168a64[_0x2d72('0x40')],_0x168a64[_0x2d72('0x41')]);_0x14763d['attributes']=_[_0x2d72('0x43')](_0x168a64[_0x2d72('0x40')],qs['fields'](_0x5de805['query']['fields']));_0x14763d[_0x2d72('0x44')]=_0x14763d[_0x2d72('0x44')]['length']?_0x14763d[_0x2d72('0x44')]:_0x168a64[_0x2d72('0x40')];if(_0x5de805[_0x2d72('0x41')]['includeAll']){_0x14763d[_0x2d72('0x56')]=[{'all':!![]}];}_0x14763d=_[_0x2d72('0x4c')]({},_0x14763d,_0x5de805[_0x2d72('0x57')]);return db[_0x2d72('0x50')][_0x2d72('0x58')](_0x14763d)[_0x2d72('0x22')](handleEntityNotFound(_0x4135f9,null))[_0x2d72('0x22')](respondWithResult(_0x4135f9,null))['catch'](handleError(_0x4135f9,null));};exports[_0x2d72('0x59')]=function(_0x8bd547,_0x349582){return db[_0x2d72('0x50')][_0x2d72('0x59')](_0x8bd547['body'],{})[_0x2d72('0x22')](function(_0x5e4791){var _0x571852=_0x8bd547[_0x2d72('0x5a')][_0x2d72('0x5b')]({'plain':!![]});if(!_0x571852)throw new Error(_0x2d72('0x5c'));if(_0x571852['role']==='user'){var _0x571800=_0x5e4791[_0x2d72('0x5b')]({'plain':!![]});var _0x5589fc=_0x2d72('0x36');return db[_0x2d72('0x5d')][_0x2d72('0x58')]({'where':{'name':_0x5589fc,'userProfileId':_0x571852[_0x2d72('0x5e')]},'raw':!![]})[_0x2d72('0x22')](function(_0x5f33f9){if(_0x5f33f9&&_0x5f33f9['autoAssociation']===0x0){return db[_0x2d72('0x37')][_0x2d72('0x59')]({'name':_0x571800[_0x2d72('0x3a')],'resourceId':_0x571800['id'],'type':_0x5f33f9[_0x2d72('0x3a')],'sectionId':_0x5f33f9['id']},{})['then'](function(){return _0x5e4791;});}else{return _0x5e4791;}})['catch'](function(_0x3b7831){logger[_0x2d72('0x26')](_0x2d72('0x5f'),_0x3b7831);throw _0x3b7831;});}return _0x5e4791;})['then'](respondWithResult(_0x349582,0xc9))[_0x2d72('0x52')](handleError(_0x349582,null));};exports[_0x2d72('0x35')]=function(_0x1c78b3,_0x2e31e7){if(_0x1c78b3[_0x2d72('0x60')]['id']){delete _0x1c78b3[_0x2d72('0x60')]['id'];}return db[_0x2d72('0x50')]['find']({'where':{'id':_0x1c78b3[_0x2d72('0x54')]['id']},'include':[{'model':db[_0x2d72('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x2d72('0x22')](handleEntityNotFound(_0x2e31e7,null))[_0x2d72('0x22')](saveUpdates(_0x1c78b3['body'],null))['then'](respondWithResult(_0x2e31e7,null))[_0x2d72('0x52')](handleError(_0x2e31e7,null));};exports[_0x2d72('0x38')]=function(_0x192c51,_0x125587){return db['SmsAccount'][_0x2d72('0x58')]({'where':{'id':_0x192c51[_0x2d72('0x54')]['id']}})[_0x2d72('0x22')](handleEntityNotFound(_0x125587,null))[_0x2d72('0x22')](removeEntity(_0x125587,null))[_0x2d72('0x52')](handleError(_0x125587,null));};exports[_0x2d72('0x61')]=function(_0x42ea3d,_0x57d53a){return db[_0x2d72('0x50')]['describe']()[_0x2d72('0x22')](respondWithResult(_0x57d53a,null))[_0x2d72('0x52')](handleError(_0x57d53a,null));};exports[_0x2d72('0x62')]=function(_0x203e46,_0x9c3e21,_0x4a6161){if(_0x203e46[_0x2d72('0x60')]['id']){delete _0x203e46[_0x2d72('0x60')]['id'];}return db[_0x2d72('0x50')][_0x2d72('0x58')]({'where':{'id':_0x203e46['params']['id']}})['then'](handleEntityNotFound(_0x9c3e21,null))['then'](function(_0x3584ed){if(_0x3584ed){_0x203e46['body'][_0x2d72('0x63')]=_0x3584ed['id'];return db[_0x2d72('0x64')][_0x2d72('0x59')](_0x203e46['body']);}})[_0x2d72('0x22')](respondWithResult(_0x9c3e21,null))[_0x2d72('0x52')](handleError(_0x9c3e21,null));};exports[_0x2d72('0x65')]=function(_0x50f7ca,_0x281f83,_0x57c2ba){var _0x1cdab7={'raw':![],'where':{}};var _0x41a176={};var _0x7a2a6e={'count':0x0,'rows':[]};return db[_0x2d72('0x50')][_0x2d72('0x66')]({'where':{'id':_0x50f7ca[_0x2d72('0x54')]['id']}})[_0x2d72('0x22')](handleEntityNotFound(_0x281f83,null))[_0x2d72('0x22')](function(_0x2ff7a0){if(_0x2ff7a0){_0x41a176['model']=_[_0x2d72('0x55')](db[_0x2d72('0x64')][_0x2d72('0x3e')]);_0x41a176[_0x2d72('0x41')]=_[_0x2d72('0x55')](_0x50f7ca[_0x2d72('0x41')]);_0x41a176[_0x2d72('0x42')]=_['intersection'](_0x41a176[_0x2d72('0x40')],_0x41a176[_0x2d72('0x41')]);_0x1cdab7[_0x2d72('0x44')]=_[_0x2d72('0x43')](_0x41a176[_0x2d72('0x40')],qs[_0x2d72('0x45')](_0x50f7ca[_0x2d72('0x41')][_0x2d72('0x45')]));_0x1cdab7['attributes']=_0x1cdab7[_0x2d72('0x44')][_0x2d72('0x67')]?_0x1cdab7[_0x2d72('0x44')]:_0x41a176[_0x2d72('0x40')];if(!_0x50f7ca[_0x2d72('0x41')][_0x2d72('0x46')](_0x2d72('0x47'))){_0x1cdab7[_0x2d72('0x2f')]=qs[_0x2d72('0x2f')](_0x50f7ca[_0x2d72('0x41')]['limit']);_0x1cdab7[_0x2d72('0x2d')]=qs[_0x2d72('0x2d')](_0x50f7ca[_0x2d72('0x41')][_0x2d72('0x2d')]);}_0x1cdab7['order']=qs['sort'](_0x50f7ca[_0x2d72('0x41')][_0x2d72('0x49')]);_0x1cdab7[_0x2d72('0x4a')]=qs[_0x2d72('0x42')](_[_0x2d72('0x68')](_0x50f7ca[_0x2d72('0x41')],_0x41a176[_0x2d72('0x42')]));_0x1cdab7['where']['SmsAccountId']=_0x2ff7a0['id'];if(_0x50f7ca[_0x2d72('0x41')][_0x2d72('0x4b')]){_0x1cdab7[_0x2d72('0x4a')]=_[_0x2d72('0x4c')](_0x1cdab7[_0x2d72('0x4a')],{'$or':_['map'](_0x1cdab7['attributes'],function(_0x3bb1ab){var _0x4e6969={};_0x4e6969[_0x3bb1ab]={'$like':'%'+_0x50f7ca['query']['filter']+'%'};return _0x4e6969;})});}_0x1cdab7=_[_0x2d72('0x4c')]({},_0x1cdab7,_0x50f7ca[_0x2d72('0x57')]);return db[_0x2d72('0x64')][_0x2d72('0x30')]({'where':_0x1cdab7['where']})[_0x2d72('0x22')](function(_0x2ec3c7){_0x7a2a6e[_0x2d72('0x30')]=_0x2ec3c7;if(_0x50f7ca['query'][_0x2d72('0x4f')]){_0x1cdab7[_0x2d72('0x56')]=[{'all':!![]}];}return db['Disposition'][_0x2d72('0x51')](_0x1cdab7);})[_0x2d72('0x22')](function(_0x51966f){_0x7a2a6e[_0x2d72('0x69')]=_0x51966f;return _0x7a2a6e;});}})[_0x2d72('0x22')](respondWithFilteredResult(_0x281f83,_0x1cdab7))[_0x2d72('0x52')](handleError(_0x281f83,null));};exports[_0x2d72('0x6a')]=function(_0x1f5bc6,_0x31797b,_0x65efaa){return db[_0x2d72('0x50')][_0x2d72('0x58')]({'where':{'id':_0x1f5bc6[_0x2d72('0x54')]['id']}})[_0x2d72('0x22')](handleEntityNotFound(_0x31797b,null))[_0x2d72('0x22')](function(_0x494977){if(_0x494977){return _0x494977['removeDispositions'](_0x1f5bc6[_0x2d72('0x41')][_0x2d72('0x6b')]);}})[_0x2d72('0x22')](respondWithStatusCode(_0x31797b,null))[_0x2d72('0x52')](handleError(_0x31797b,null));};exports[_0x2d72('0x6c')]=function(_0x29b3ec,_0x438a4f,_0xbfaadb){if(_0x29b3ec[_0x2d72('0x60')]['id']){delete _0x29b3ec[_0x2d72('0x60')]['id'];}return db['SmsAccount'][_0x2d72('0x58')]({'where':{'id':_0x29b3ec['params']['id']}})[_0x2d72('0x22')](handleEntityNotFound(_0x438a4f,null))['then'](function(_0x11feba){if(_0x11feba){_0x29b3ec['body'][_0x2d72('0x63')]=_0x11feba['id'];return db['CannedAnswer'][_0x2d72('0x59')](_0x29b3ec[_0x2d72('0x60')]);}})[_0x2d72('0x22')](respondWithResult(_0x438a4f,null))[_0x2d72('0x52')](handleError(_0x438a4f,null));};exports[_0x2d72('0x6d')]=function(_0x31e784,_0x5f2adf,_0x1bfd2b){var _0x463e87={'raw':![],'where':{}};var _0x44b978={};var _0x4a6494={'count':0x0,'rows':[]};return db[_0x2d72('0x50')]['findOne']({'where':{'id':_0x31e784[_0x2d72('0x54')]['id']}})[_0x2d72('0x22')](handleEntityNotFound(_0x5f2adf,null))[_0x2d72('0x22')](function(_0x409874){if(_0x409874){_0x44b978[_0x2d72('0x40')]=_['keys'](db[_0x2d72('0x6e')]['rawAttributes']);_0x44b978['query']=_[_0x2d72('0x55')](_0x31e784[_0x2d72('0x41')]);_0x44b978['filters']=_[_0x2d72('0x43')](_0x44b978[_0x2d72('0x40')],_0x44b978['query']);_0x463e87[_0x2d72('0x44')]=_[_0x2d72('0x43')](_0x44b978[_0x2d72('0x40')],qs[_0x2d72('0x45')](_0x31e784[_0x2d72('0x41')]['fields']));_0x463e87[_0x2d72('0x44')]=_0x463e87['attributes'][_0x2d72('0x67')]?_0x463e87[_0x2d72('0x44')]:_0x44b978[_0x2d72('0x40')];if(!_0x31e784[_0x2d72('0x41')][_0x2d72('0x46')](_0x2d72('0x47'))){_0x463e87[_0x2d72('0x2f')]=qs[_0x2d72('0x2f')](_0x31e784['query']['limit']);_0x463e87[_0x2d72('0x2d')]=qs['offset'](_0x31e784[_0x2d72('0x41')]['offset']);}_0x463e87['order']=qs[_0x2d72('0x49')](_0x31e784['query'][_0x2d72('0x49')]);_0x463e87[_0x2d72('0x4a')]=qs[_0x2d72('0x42')](_['pick'](_0x31e784[_0x2d72('0x41')],_0x44b978[_0x2d72('0x42')]));_0x463e87[_0x2d72('0x4a')][_0x2d72('0x63')]=_0x409874['id'];if(_0x31e784['query'][_0x2d72('0x4b')]){_0x463e87['where']=_['merge'](_0x463e87['where'],{'$or':_[_0x2d72('0x3d')](_0x463e87['attributes'],function(_0x543e9a){var _0x16d939={};_0x16d939[_0x543e9a]={'$like':'%'+_0x31e784['query']['filter']+'%'};return _0x16d939;})});}_0x463e87=_[_0x2d72('0x4c')]({},_0x463e87,_0x31e784['options']);return db[_0x2d72('0x6e')]['count']({'where':_0x463e87[_0x2d72('0x4a')]})['then'](function(_0x2721fa){_0x4a6494[_0x2d72('0x30')]=_0x2721fa;if(_0x31e784['query'][_0x2d72('0x4f')]){_0x463e87[_0x2d72('0x56')]=[{'all':!![]}];}return db[_0x2d72('0x6e')]['findAll'](_0x463e87);})[_0x2d72('0x22')](function(_0x3f07c2){_0x4a6494[_0x2d72('0x69')]=_0x3f07c2;return _0x4a6494;});}})['then'](respondWithFilteredResult(_0x5f2adf,_0x463e87))[_0x2d72('0x52')](handleError(_0x5f2adf,null));};exports[_0x2d72('0x6f')]=function(_0x40ae3b,_0x2025fc,_0x43c3b7){return db[_0x2d72('0x50')][_0x2d72('0x58')]({'where':{'id':_0x40ae3b[_0x2d72('0x54')]['id']}})['then'](handleEntityNotFound(_0x2025fc,null))[_0x2d72('0x22')](function(_0x39984c){if(_0x39984c){return _0x39984c[_0x2d72('0x6f')](_0x40ae3b[_0x2d72('0x41')][_0x2d72('0x6b')]);}})[_0x2d72('0x22')](respondWithStatusCode(_0x2025fc,null))['catch'](handleError(_0x2025fc,null));};exports[_0x2d72('0x70')]=function(_0x6d84d,_0x3cf6e5,_0xfb2b3f){var _0x389f02={'channel':'sms'};var _0x2f46d4=[];var _0x3f2d75=[];var _0x1d7ce2={};return db[_0x2d72('0x50')][_0x2d72('0x58')]({'where':{'id':_0x6d84d[_0x2d72('0x54')]['id']},'include':[{'model':db[_0x2d72('0x71')],'as':_0x2d72('0x72')}]})['then'](handleEntityNotFound(_0x3cf6e5,null))['then'](function(_0x26616d){_0x389f02[_0x2d72('0x73')]=_0x26616d;_0x389f02[_0x2d72('0x74')]=_['orderBy'](_0x26616d[_0x2d72('0x72')],['priority'],[_0x2d72('0x75')]);if(_0x389f02[_0x2d72('0x73')][_0x2d72('0x72')]){delete _0x389f02[_0x2d72('0x73')]['Applications'];}return db[_0x2d72('0x76')][_0x2d72('0x61')]();})[_0x2d72('0x22')](function(_0x2711ac){if(!_0x2711ac){throw new db[(_0x2d72('0x77'))][(_0x2d72('0x78'))](_0x2d72('0x79'));}_0x2f46d4=_[_0x2d72('0x7a')](_[_0x2d72('0x55')](_0x2711ac),[_0x2d72('0x7b'),'updatedAt']);_0x3f2d75=_[_0x2d72('0x7a')](_[_0x2d72('0x55')](_0x2711ac),[_0x2d72('0x7b'),_0x2d72('0x7c'),_0x2d72('0x7d'),'ListId']);_0x389f02['body']={'mapKey':_0x2d72('0x7e')};if(_0x389f02[_0x2d72('0x73')][_0x2d72('0x4d')]){switch(_0x389f02[_0x2d72('0x73')][_0x2d72('0x4d')]){case _0x2d72('0x7f'):_0x389f02[_0x2d72('0x60')][_0x2d72('0x80')]=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x81')];_0x389f02[_0x2d72('0x60')][_0x2d72('0x60')]=_0x6d84d['body'][_0x2d72('0x82')];_0x389f02[_0x2d72('0x60')][_0x2d72('0x83')]=_0x6d84d['body']['MessageSid'];break;case'skebby':_0x389f02[_0x2d72('0x60')][_0x2d72('0x80')]='+'+_0x6d84d[_0x2d72('0x60')]['sender'];_0x389f02[_0x2d72('0x60')][_0x2d72('0x60')]=_0x6d84d[_0x2d72('0x60')]['text'];break;case _0x2d72('0x84'):_0x389f02[_0x2d72('0x60')][_0x2d72('0x80')]=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x80')];_0x389f02[_0x2d72('0x60')][_0x2d72('0x60')]=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x28')];break;case _0x2d72('0x85'):_0x389f02['body'][_0x2d72('0x80')]=_0x6d84d[_0x2d72('0x60')]['from'];_0x389f02[_0x2d72('0x60')]['body']=_0x6d84d['body'][_0x2d72('0x60')];_0x389f02['body']['messageId']=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x86')];break;case _0x2d72('0x87'):_0x389f02[_0x2d72('0x60')][_0x2d72('0x80')]=_0x6d84d['body'][_0x2d72('0x81')];_0x389f02[_0x2d72('0x60')][_0x2d72('0x60')]=_0x6d84d['body'][_0x2d72('0x88')];_0x389f02['body'][_0x2d72('0x83')]=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x89')];break;case'infobip':_0x389f02[_0x2d72('0x60')][_0x2d72('0x80')]='+'+_0x6d84d[_0x2d72('0x60')][_0x2d72('0x8a')][0x0][_0x2d72('0x80')];_0x389f02[_0x2d72('0x60')][_0x2d72('0x60')]=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x8a')][0x0]['text'];_0x389f02[_0x2d72('0x60')][_0x2d72('0x83')]=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x8a')][0x0][_0x2d72('0x83')];break;case'csc':_0x389f02['body'][_0x2d72('0x80')]=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x8b')];_0x389f02['body'][_0x2d72('0x60')]=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x8c')][_0x2d72('0x28')];break;case _0x2d72('0x8d'):_0x389f02[_0x2d72('0x60')][_0x2d72('0x80')]=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x8e')];_0x389f02[_0x2d72('0x60')][_0x2d72('0x60')]=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x8f')];_0x389f02['body']['messageId']=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x90')];break;case _0x2d72('0x91'):_0x389f02[_0x2d72('0x60')][_0x2d72('0x83')]=_0x6d84d['body'][0x0][_0x2d72('0x28')]['id'];_0x389f02[_0x2d72('0x60')][_0x2d72('0x80')]=_0x6d84d[_0x2d72('0x60')][0x0][_0x2d72('0x28')][_0x2d72('0x80')];_0x389f02[_0x2d72('0x60')]['body']=_0x6d84d[_0x2d72('0x60')][0x0][_0x2d72('0x28')][_0x2d72('0x8f')];break;case _0x2d72('0x92'):_0x389f02['body'][_0x2d72('0x80')]=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x80')];_0x389f02['body'][_0x2d72('0x60')]=_0x6d84d[_0x2d72('0x60')][_0x2d72('0x28')];_0x389f02[_0x2d72('0x60')][_0x2d72('0x83')]=_0x6d84d['body'][_0x2d72('0x93')];break;}}if(_0x389f02[_0x2d72('0x60')]['id']){delete _0x389f02[_0x2d72('0x60')]['id'];}if(_[_0x2d72('0x94')](_0x389f02[_0x2d72('0x60')][_0x2d72('0x80')])){throw new db[(_0x2d72('0x77'))][(_0x2d72('0x78'))]('from\x20is\x20mandatory');}if(_[_0x2d72('0x94')](_0x389f02[_0x2d72('0x60')]['body'])||_0x389f02['body']['body']===''){throw new db['Sequelize']['ValidationError'](_0x2d72('0x95'));}if(_[_0x2d72('0x94')](_0x389f02[_0x2d72('0x60')][_0x2d72('0x96')])){throw new db[(_0x2d72('0x77'))]['ValidationError'](_0x2d72('0x97')+_0x3f2d75);}if(!_[_0x2d72('0x98')](_0x3f2d75,_0x389f02['body'][_0x2d72('0x96')])){throw new db[(_0x2d72('0x77'))][(_0x2d72('0x78'))](_0x2d72('0x99')+_0x3f2d75);}_0x1d7ce2[_0x389f02[_0x2d72('0x60')][_0x2d72('0x96')]]=_0x389f02['body'][_0x2d72('0x80')];return db[_0x2d72('0x9a')][_0x2d72('0x58')]({'where':{'id':_0x389f02[_0x2d72('0x73')][_0x2d72('0x9b')]},'include':[{'model':db[_0x2d72('0x76')],'as':'Contacts','where':_0x1d7ce2,'limit':0x1,'order':[['updatedAt',_0x2d72('0x9c')]]}]});})['then'](handleEntityNotFound(_0x3cf6e5,null))[_0x2d72('0x22')](function(_0x58b865){if(_0x58b865){_0x389f02[_0x2d72('0x9d')]=_[_0x2d72('0x9e')](_0x58b865,[_0x2d72('0x9f')]);if(_0x58b865[_0x2d72('0x9f')]['length']){return _0x58b865[_0x2d72('0x9f')][0x0];}var _0x2d07c9=_['defaults'](_0x389f02['body'],{'firstName':_0x389f02['body'][_0x2d72('0x80')],'ListId':_0x58b865['id']});_0x2d07c9[_0x389f02['body']['mapKey']]=_0x389f02['body'][_0x2d72('0x80')];return db[_0x2d72('0x76')][_0x2d72('0x59')](_0x2d07c9,{'fields':_0x2f46d4,'raw':!![]});}})[_0x2d72('0x22')](handleEntityNotFound(_0x3cf6e5,null))[_0x2d72('0x22')](function(_0x51c987){if(_0x51c987){_0x389f02[_0x2d72('0xa0')]=_0x51c987;var _0xa3206={'ContactId':_0x51c987['id'],'phone':_0x389f02['body'][_0x2d72('0x80')],'SmsAccountId':_0x6d84d[_0x2d72('0x54')]['id']};var _0x2e58e={'ContactId':_0x51c987['id'],'SmsAccountId':_0x6d84d[_0x2d72('0x54')]['id'],'closed':![]};return db['SmsInteraction'][_0x2d72('0x58')]({'where':_0x2e58e})[_0x2d72('0x22')](function(_0x1f8896){if(_0x1f8896){return[_0x1f8896,![]];}return db[_0x2d72('0xa1')][_0x2d72('0x59')](_0xa3206)[_0x2d72('0x22')](function(_0xa4145d){return[_0xa4145d,!![]];});});}})['spread'](function(_0x5bc891,_0x237ea3){_0x389f02[_0x2d72('0xa2')]=_0x5bc891[_0x2d72('0x5b')]({'plain':!![]});_0x389f02[_0x2d72('0xa2')]['created']=![];if(_0x237ea3){if(_0x389f02[_0x2d72('0x73')]['autoclose']){_0x389f02[_0x2d72('0x74')]['push']({'id':0x0,'priority':_0x389f02[_0x2d72('0x74')]['length']+0x1,'app':_0x2d72('0xa3'),'appdata':_0x2d72('0xa4'),'interval':_0x2d72('0xa5')});}_0x389f02[_0x2d72('0xa2')][_0x2d72('0xa6')]=!![];}return db[_0x2d72('0xa7')][_0x2d72('0x59')]({'phone':_0x389f02[_0x2d72('0x60')][_0x2d72('0x80')],'messageId':_0x389f02[_0x2d72('0x60')][_0x2d72('0x83')],'body':_0x389f02[_0x2d72('0x60')][_0x2d72('0x60')],'SmsAccountId':_0x6d84d[_0x2d72('0x54')]['id'],'SmsInteractionId':_0x5bc891['id'],'direction':'in','ContactId':_0x5bc891[_0x2d72('0xa8')],'AttachmentId':_0x389f02[_0x2d72('0x60')][_0x2d72('0xa9')]});})[_0x2d72('0x22')](function(_0x483c3f){_0x389f02[_0x2d72('0x28')]=_0x483c3f;if(!_0x389f02[_0x2d72('0xa2')][_0x2d72('0xaa')])return;return db['User'][_0x2d72('0x58')]({'attributes':['id',_0x2d72('0x3a')],'where':{'id':_0x389f02['interaction']['UserId']}});})['then'](function(_0x467754){if(_0x467754){_0x389f02[_0x2d72('0x74')][_0x2d72('0xab')]({'id':0x0,'priority':0x0,'app':_0x2d72('0xac'),'appdata':_0x467754[_0x2d72('0x3a')]+','+(_0x389f02[_0x2d72('0x73')][_0x2d72('0xad')]||0xa),'interval':_0x2d72('0xa5')});}if(!_0x389f02[_0x2d72('0xa2')][_0x2d72('0xae')])return;return db[_0x2d72('0xaf')][_0x2d72('0x58')]({'attributes':['id',_0x2d72('0x3a')],'where':{'id':_0x389f02[_0x2d72('0xa2')]['queueId']}});})[_0x2d72('0x22')](function(_0x2a6a79){if(_0x2a6a79){_0x389f02['applications'][_0x2d72('0xab')]({'id':0x0,'priority':0x1,'app':_0x2d72('0xb0'),'appdata':_0x2a6a79[_0x2d72('0x3a')]+','+(_0x389f02['account'][_0x2d72('0xb1')]||0x12c),'interval':_0x2d72('0xa5')});}return respondWithRpcPromise(_0x2d72('0xb2'),_0x2d72('0xb3'),_0x389f02);})['then'](function(_0x53aff6){if(_0x53aff6){var _0x1b1322=0xc8;var _0x25c241=_0x2d72('0xb4');logger[_0x2d72('0x29')](_0x2d72('0x24'),_0x25c241,_0x1b1322,_0x2d72('0xb5'));logger[_0x2d72('0xb6')](_0x2d72('0xb7'),_0x25c241,_0x1b1322,_0x2d72('0xb5'),JSON[_0x2d72('0xb8')](_0x53aff6));if(_0x389f02[_0x2d72('0x73')][_0x2d72('0x4d')]==='twilio'){return _0x3cf6e5[_0x2d72('0x2c')](_0x1b1322)[_0x2d72('0xb9')](_0x2d72('0xba'),_0x2d72('0xbb'))[_0x2d72('0x3b')](_0x2d72('0xbc'));}else{return _0x3cf6e5[_0x2d72('0x2c')](_0x1b1322)[_0x2d72('0x31')](_0x53aff6);}}})[_0x2d72('0x52')](handleError(_0x3cf6e5,null));};exports[_0x2d72('0xbd')]=function(_0x489c7f,_0x6c37f){var _0x567973=_0x489c7f[_0x2d72('0x54')]['id'];var _0x417141=_0x489c7f['body'];var _0x288f8e=0xc8;var _0x494b64=null;return db[_0x2d72('0xbe')][_0x2d72('0xbf')]({'isolationLevel':db[_0x2d72('0xbe')]['Transaction'][_0x2d72('0xc0')][_0x2d72('0xc1')]},function(_0x55b547){return db[_0x2d72('0x50')][_0x2d72('0x66')]({'where':{'id':_0x567973},'transaction':_0x55b547})[_0x2d72('0x22')](function(_0x383ab2){if(_0x383ab2){return db['SmsApplication'][_0x2d72('0x38')]({'where':{'SmsAccountId':_0x567973},'transaction':_0x55b547})[_0x2d72('0x22')](function(){var _0x4ab1bb=_[_0x2d72('0x3d')](_0x417141,function(_0x1afc5b){_0x1afc5b[_0x2d72('0x63')]=_0x567973;return _0x1afc5b;});return db[_0x2d72('0x71')]['bulkCreate'](_0x4ab1bb,{'transaction':_0x55b547});});}else{_0x288f8e=0x194;_0x494b64=[];}});})['then'](function(){if(_0x288f8e!==0x194){return db[_0x2d72('0x71')][_0x2d72('0xc2')]({'where':{'SmsAccountId':_0x567973},'order':'priority'})['then'](function(_0x576222){_0x494b64=_0x576222;});}})[_0x2d72('0x52')](function(_0x28ff0e){_0x288f8e=0x1f4;logger[_0x2d72('0x26')](_0x28ff0e[_0x2d72('0xc3')]);if(_0x28ff0e[_0x2d72('0x3a')]){delete _0x28ff0e[_0x2d72('0x3a')];}_0x494b64=_0x28ff0e;})[_0x2d72('0xc4')](function(){if(_0x494b64===null){_0x6c37f[_0x2d72('0x2b')](_0x288f8e);}else{if(_0x288f8e===0x1f4){_0x6c37f['status'](_0x288f8e)[_0x2d72('0x3b')](_0x494b64);}else{_0x6c37f['status'](_0x288f8e)[_0x2d72('0x31')](_0x494b64);}}});};exports[_0x2d72('0xc5')]=function(_0x143291,_0x450fe7,_0x26d7c3){var _0x25a2c2={};var _0x1bf0c2={};var _0x3e9466;var _0x5ed459;return db['SmsAccount'][_0x2d72('0x66')]({'where':{'id':_0x143291[_0x2d72('0x54')]['id']}})[_0x2d72('0x22')](handleEntityNotFound(_0x450fe7,null))['then'](function(_0x57a60d){if(_0x57a60d){_0x3e9466=_0x57a60d;_0x1bf0c2[_0x2d72('0x40')]=_[_0x2d72('0x55')](db[_0x2d72('0x71')][_0x2d72('0x3e')]);_0x1bf0c2['query']=_[_0x2d72('0x55')](_0x143291[_0x2d72('0x41')]);_0x1bf0c2[_0x2d72('0x42')]=_[_0x2d72('0x43')](_0x1bf0c2[_0x2d72('0x40')],_0x1bf0c2[_0x2d72('0x41')]);_0x25a2c2['attributes']=_['intersection'](_0x1bf0c2[_0x2d72('0x40')],qs[_0x2d72('0x45')](_0x143291['query'][_0x2d72('0x45')]));_0x25a2c2[_0x2d72('0x44')]=_0x25a2c2[_0x2d72('0x44')][_0x2d72('0x67')]?_0x25a2c2[_0x2d72('0x44')]:_0x1bf0c2[_0x2d72('0x40')];_0x25a2c2['order']=qs[_0x2d72('0x49')](_0x143291[_0x2d72('0x41')][_0x2d72('0x49')]);_0x25a2c2['where']=qs[_0x2d72('0x42')](_['pick'](_0x143291[_0x2d72('0x41')],_0x1bf0c2[_0x2d72('0x42')]));if(_0x143291[_0x2d72('0x41')][_0x2d72('0x4b')]){_0x25a2c2['where']=_[_0x2d72('0x4c')](_0x25a2c2[_0x2d72('0x4a')],{'$or':_[_0x2d72('0x3d')](_0x25a2c2[_0x2d72('0x44')],function(_0xe03ae4){var _0x3d145a={};_0x3d145a[_0xe03ae4]={'$like':'%'+_0x143291[_0x2d72('0x41')][_0x2d72('0x4b')]+'%'};return _0x3d145a;})});}_0x25a2c2=_[_0x2d72('0x4c')]({},_0x25a2c2,_0x143291[_0x2d72('0x57')]);return _0x3e9466[_0x2d72('0xc5')](_0x25a2c2);}})[_0x2d72('0x22')](function(_0x5358a4){if(_0x5358a4){_0x5ed459=_0x5358a4[_0x2d72('0x67')];if(!_0x143291[_0x2d72('0x41')][_0x2d72('0x46')](_0x2d72('0x47'))){_0x25a2c2[_0x2d72('0x2f')]=qs[_0x2d72('0x2f')](_0x143291[_0x2d72('0x41')][_0x2d72('0x2f')]);_0x25a2c2[_0x2d72('0x2d')]=qs[_0x2d72('0x2d')](_0x143291['query'][_0x2d72('0x2d')]);}return _0x3e9466[_0x2d72('0xc5')](_0x25a2c2);}})[_0x2d72('0x22')](function(_0x58561d){if(_0x58561d){return _0x58561d?{'count':_0x5ed459,'rows':_0x58561d}:null;}})[_0x2d72('0x22')](respondWithResult(_0x450fe7,null))[_0x2d72('0x52')](handleError(_0x450fe7,null));};exports[_0x2d72('0xc6')]=function(_0x2065b3,_0x33f527,_0x1e9995){var _0x3016ae={'raw':![],'where':{}};var _0x5f65e6={};var _0x2fae0d={'count':0x0,'rows':[]};return db['SmsAccount'][_0x2d72('0x66')]({'where':{'id':_0x2065b3[_0x2d72('0x54')]['id']}})[_0x2d72('0x22')](handleEntityNotFound(_0x33f527,null))[_0x2d72('0x22')](function(_0x33f893){if(_0x33f893){_0x5f65e6[_0x2d72('0x40')]=_[_0x2d72('0x55')](db['SmsInteraction']['rawAttributes']);_0x5f65e6[_0x2d72('0x41')]=_[_0x2d72('0x55')](_0x2065b3[_0x2d72('0x41')]);_0x5f65e6['filters']=_[_0x2d72('0x43')](_0x5f65e6[_0x2d72('0x40')],_0x5f65e6[_0x2d72('0x41')]);_0x3016ae['attributes']=_[_0x2d72('0x43')](_0x5f65e6[_0x2d72('0x40')],qs[_0x2d72('0x45')](_0x2065b3[_0x2d72('0x41')][_0x2d72('0x45')]));_0x3016ae['attributes']=_0x3016ae[_0x2d72('0x44')][_0x2d72('0x67')]?_0x3016ae[_0x2d72('0x44')]:_0x5f65e6['model'];if(!_0x2065b3['query'][_0x2d72('0x46')](_0x2d72('0x47'))){_0x3016ae[_0x2d72('0x2f')]=qs['limit'](_0x2065b3[_0x2d72('0x41')][_0x2d72('0x2f')]);_0x3016ae[_0x2d72('0x2d')]=qs[_0x2d72('0x2d')](_0x2065b3['query'][_0x2d72('0x2d')]);}_0x3016ae[_0x2d72('0x48')]=qs[_0x2d72('0x49')](_0x2065b3[_0x2d72('0x41')][_0x2d72('0x49')]);_0x3016ae[_0x2d72('0x4a')]=qs['filters'](_[_0x2d72('0x68')](_0x2065b3['query'],_0x5f65e6[_0x2d72('0x42')]));_0x3016ae[_0x2d72('0x4a')][_0x2d72('0x63')]=_0x33f893['id'];if(_0x2065b3[_0x2d72('0x41')]['filter']){_0x3016ae['where']=_[_0x2d72('0x4c')](_0x3016ae[_0x2d72('0x4a')],{'$or':_[_0x2d72('0x3d')](_0x3016ae['attributes'],function(_0x5750ce){var _0x46d98d={};_0x46d98d[_0x5750ce]={'$like':'%'+_0x2065b3[_0x2d72('0x41')][_0x2d72('0x4b')]+'%'};return _0x46d98d;})});}_0x3016ae=_[_0x2d72('0x4c')]({},_0x3016ae,_0x2065b3['options']);return db['SmsInteraction'][_0x2d72('0x30')]({'where':_0x3016ae[_0x2d72('0x4a')]})[_0x2d72('0x22')](function(_0x3b0b07){_0x2fae0d[_0x2d72('0x30')]=_0x3b0b07;if(_0x2065b3['query'][_0x2d72('0x4f')]){_0x3016ae[_0x2d72('0x56')]=[{'model':db[_0x2d72('0x76')],'as':_0x2d72('0xc7'),'required':![]},{'model':db[_0x2d72('0xc8')],'as':_0x2d72('0xc9'),'attributes':[_0x2d72('0x3a'),_0x2d72('0xca'),'internal'],'required':![]},{'model':db[_0x2d72('0xcb')],'as':'Tags','attributes':['id','name',_0x2d72('0xcc')],'where':_0x2065b3[_0x2d72('0x41')][_0x2d72('0xcd')]?{'id':_0x2065b3[_0x2d72('0x41')]['tag']}:undefined,'required':_0x2065b3[_0x2d72('0x41')][_0x2d72('0xcd')]?!![]:![]}];}return db[_0x2d72('0xa1')][_0x2d72('0x51')](_0x3016ae);})['then'](function(_0x4e95d9){_0x2fae0d[_0x2d72('0x69')]=_0x4e95d9;return _0x2fae0d;});}})[_0x2d72('0x22')](respondWithFilteredResult(_0x33f527,_0x3016ae))[_0x2d72('0x52')](handleError(_0x33f527,null));};exports[_0x2d72('0x3b')]=function(_0x4cb00f,_0x1a2268,_0x5da758){var _0x338ae7,_0x3f36e5,_0x1b3c07;if(_['isNil'](_0x4cb00f['body'][_0x2d72('0x60')])||_0x4cb00f[_0x2d72('0x60')][_0x2d72('0x60')]===''){throw new db[(_0x2d72('0x77'))][(_0x2d72('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2d72('0x94')](_0x4cb00f[_0x2d72('0x60')]['to'])){throw new db[(_0x2d72('0x77'))][(_0x2d72('0x78'))](_0x2d72('0xce'));}_0x338ae7=_0x4cb00f['body']['to'];return db[_0x2d72('0x50')]['find']({'where':{'id':_0x4cb00f[_0x2d72('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0x2d72('0xcf'),'include':[{'model':db[_0x2d72('0x76')],'as':'Contacts','where':{'mobile':_0x338ae7},'limit':0x1,'order':[[_0x2d72('0x7c'),_0x2d72('0x9c')]]}]}]})[_0x2d72('0x22')](handleEntityNotFound(_0x1a2268,null))[_0x2d72('0x22')](function(_0x224934){if(_0x224934&&_0x224934[_0x2d72('0xcf')]){_0x3f36e5=_0x224934[_0x2d72('0x5b')]({'plain':!![]});if(_0x3f36e5[_0x2d72('0xcf')]&&_0x3f36e5['List']['Contacts']['length']){return _0x3f36e5[_0x2d72('0xcf')][_0x2d72('0x9f')][0x0];}return db[_0x2d72('0x76')][_0x2d72('0x59')](_['defaults'](_0x4cb00f[_0x2d72('0x60')],{'firstName':_0x338ae7,'mobile':_0x338ae7,'phone':_0x338ae7,'ListId':_0x3f36e5[_0x2d72('0x9b')]}));}})[_0x2d72('0x22')](handleEntityNotFound(_0x1a2268,null))[_0x2d72('0x22')](function(_0x3dc3f2){if(_0x3dc3f2){_0x1b3c07=_0x3dc3f2;return db[_0x2d72('0xa1')][_0x2d72('0x58')]({'where':{'ContactId':_0x1b3c07['id'],'closed':![],'SmsAccountId':_0x3f36e5['id']}})[_0x2d72('0x22')](function(_0x3fd144){if(_0x3fd144){return[_0x3fd144,![]];}return db[_0x2d72('0xa1')][_0x2d72('0x59')]({'UserId':_0x4cb00f[_0x2d72('0x5a')]['id'],'ContactId':_0x1b3c07['id'],'SmsAccountId':_0x3f36e5['id'],'phone':_0x338ae7,'firstMsgDirection':_0x2d72('0xd0'),'Messages':[_[_0x2d72('0x4c')](_0x4cb00f['body'],{'read':![],'body':_0x4cb00f[_0x2d72('0x60')][_0x2d72('0x60')],'phone':_0x338ae7,'SmsAccountId':_0x3f36e5['id'],'UserId':_0x4cb00f['user']['id'],'ContactId':_0x1b3c07['id']})]},{'include':[{'model':db[_0x2d72('0xa7')],'as':_0x2d72('0xd1')}]})[_0x2d72('0x22')](function(_0x66c80a){return[_0x66c80a,!![]];});});}})['spread'](function(_0x29ceae,_0x4c5de2){if(_0x4c5de2){return _0x29ceae;}return db[_0x2d72('0xa7')][_0x2d72('0x59')](_[_0x2d72('0x4c')](_0x4cb00f[_0x2d72('0x60')],{'read':![],'body':_0x4cb00f[_0x2d72('0x60')][_0x2d72('0x60')],'phone':_0x338ae7,'SmsAccountId':_0x3f36e5['id'],'SmsInteractionId':_0x29ceae['id'],'UserId':_0x4cb00f[_0x2d72('0x5a')]['id'],'ContactId':_0x1b3c07['id']}))[_0x2d72('0x22')](function(_0x458ff7){_0x29ceae[_0x2d72('0xd2')]['Messages']=[];_0x29ceae[_0x2d72('0xd2')][_0x2d72('0xd1')][_0x2d72('0xd3')](_0x458ff7['dataValues']);return _0x29ceae;});})[_0x2d72('0x22')](respondWithResult(_0x1a2268,null))[_0x2d72('0x52')](handleError(_0x1a2268,null));};exports[_0x2d72('0x2c')]=function(_0x48c285,_0x5876f9,_0xa10d6c){if(_0x48c285[_0x2d72('0x60')]['id']){delete _0x48c285[_0x2d72('0x60')]['id'];}var _0x38a608,_0x1256db,_0x4335dc;return db[_0x2d72('0x50')]['find']({'where':{'id':_0x48c285['params']['id']}})[_0x2d72('0x22')](handleEntityNotFound(_0x5876f9,null))['then'](function(_0x1981a5){if(_0x1981a5){_0x4335dc=_0x1981a5;logger[_0x2d72('0xb6')](_0x2d72('0x24'),_0x2d72('0x2c'),'received\x20delivery\x20report\x20from',_0x1981a5[_0x2d72('0x4d')],util['inspect'](_0x48c285['body'],{'showHidden':![],'depth':null}));switch(_0x1981a5[_0x2d72('0x4d')]){case _0x2d72('0xd4'):if(_0x48c285['body'][_0x2d72('0xd5')]&&_0x48c285[_0x2d72('0x60')][_0x2d72('0x2c')]){_0x1256db=_0x48c285[_0x2d72('0x60')][_0x2d72('0x2c')];return db[_0x2d72('0xa7')][_0x2d72('0x58')]({'where':{'messageId':_0x48c285['body'][_0x2d72('0xd5')]}});}break;case _0x2d72('0x84'):if(_0x48c285[_0x2d72('0x60')][_0x2d72('0xd6')]&&_0x48c285['body'][_0x2d72('0xd7')]){_0x1256db=_0x48c285['body']['statusInt'];return db[_0x2d72('0xa7')][_0x2d72('0x58')]({'where':{'messageId':_0x48c285[_0x2d72('0x60')]['requestid']}});}break;case _0x2d72('0x85'):if(_0x48c285[_0x2d72('0x60')][_0x2d72('0x86')]&&_0x48c285[_0x2d72('0x60')][_0x2d72('0xd8')]){_0x1256db=_0x48c285[_0x2d72('0x60')][_0x2d72('0xd8')];return db[_0x2d72('0xa7')]['find']({'where':{'messageId':_0x48c285[_0x2d72('0x60')][_0x2d72('0x86')]}});}break;case'infobip':var _0x1be37c=_0x48c285[_0x2d72('0x60')][_0x2d72('0x8a')][0x0];if(_0x1be37c['messageId']&&_0x1be37c[_0x2d72('0x2c')][_0x2d72('0xd9')]==='DELIVERED'){_0x1256db=_0x1be37c[_0x2d72('0x2c')][_0x2d72('0xd9')];return db[_0x2d72('0xa7')]['find']({'where':{'messageId':_0x1be37c['messageId']}});}break;case'clickatell':if(_0x48c285[_0x2d72('0x60')][_0x2d72('0x83')]&&_0x48c285['body']['status']){_0x1256db=_0x48c285[_0x2d72('0x60')][_0x2d72('0x2c')];return db[_0x2d72('0xa7')][_0x2d72('0x58')]({'where':{'messageId':_0x48c285[_0x2d72('0x60')][_0x2d72('0x83')]}});}break;case'bandwidth':if(_0x48c285[_0x2d72('0x60')][0x0][_0x2d72('0x28')]['id']){_0x1256db=_0x48c285[_0x2d72('0x60')][0x0][_0x2d72('0x4d')];return db[_0x2d72('0xa7')][_0x2d72('0x58')]({'where':{'messageId':_0x48c285[_0x2d72('0x60')][0x0]['message']['id']}});}break;case'intelepeer':if(_0x48c285[_0x2d72('0x60')][_0x2d72('0xda')]&&_0x48c285[_0x2d72('0x60')][_0x2d72('0x2c')]){_0x1256db=_0x48c285['body'][_0x2d72('0x2c')];return db[_0x2d72('0xa7')][_0x2d72('0x58')]({'where':{'messageId':_0x48c285[_0x2d72('0x60')][_0x2d72('0xda')]}});}break;}}})['then'](handleEntityNotFound(_0x5876f9,null))[_0x2d72('0x22')](function(_0x17cc06){if(_0x17cc06){_0x38a608=_0x17cc06;switch(_0x4335dc[_0x2d72('0x4d')]){case'skebby':if(_0x1256db===_0x2d72('0xdb')){return _0x38a608[_0x2d72('0x35')]({'read':!![]});}else{logger[_0x2d72('0x26')](_0x2d72('0x24'),'status',_0x2d72('0xd4'),util[_0x2d72('0xdc')](_0x48c285['body'],{'showHidden':![],'depth':null}));}break;case _0x2d72('0x84'):if(_0x1256db==='1'){return _0x38a608[_0x2d72('0x35')]({'read':!![]});}else{logger[_0x2d72('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2d72('0x2c'),_0x2d72('0xd4'),util[_0x2d72('0xdc')](_0x48c285['body'],{'showHidden':![],'depth':null}));}break;case _0x2d72('0x85'):if(!_0x48c285['body']['error_code']&&_0x1256db>=0xc8&&_0x1256db<=0xce){return _0x38a608[_0x2d72('0x35')]({'read':!![]});}else{logger[_0x2d72('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2d72('0x2c'),_0x2d72('0x85'),util[_0x2d72('0xdc')](_0x48c285[_0x2d72('0x60')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x15a024=_0x48c285[_0x2d72('0x60')]['results'][0x0];if(_0x15a024['status'][_0x2d72('0xd9')]==='DELIVERED'){return _0x38a608[_0x2d72('0x35')]({'read':!![]});}else{logger[_0x2d72('0x26')](_0x2d72('0x24'),_0x2d72('0x2c'),_0x2d72('0xdd'),util[_0x2d72('0xdc')](_0x48c285[_0x2d72('0x60')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x1256db=='DELIVERED_TO_GATEWAY'||_0x1256db==_0x2d72('0xde')){return _0x38a608[_0x2d72('0x35')]({'read':!![]});}else{logger[_0x2d72('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','clickatell',util[_0x2d72('0xdc')](_0x48c285['body'],{'showHidden':![],'depth':null}));}break;case _0x2d72('0x91'):if(_0x1256db=='message-delivered'){return _0x38a608[_0x2d72('0x35')]({'read':!![]});}else{logger[_0x2d72('0x26')](_0x2d72('0x24'),_0x2d72('0x2c'),_0x2d72('0x91'),util[_0x2d72('0xdc')](_0x48c285[_0x2d72('0x60')],{'showHidden':![],'depth':null}));}break;case _0x2d72('0x92'):if(_0x1256db===_0x2d72('0xdf')||_0x1256db===_0x2d72('0xe0')){return _0x38a608[_0x2d72('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2d72('0x2c'),_0x2d72('0x92'),util[_0x2d72('0xdc')](_0x48c285[_0x2d72('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x38a608;}})[_0x2d72('0x22')](respondWithResult(_0x5876f9,null))[_0x2d72('0x52')](handleError(_0x5876f9,null));};exports['statusGet']=function(_0x4c9a6b,_0x1f5f84,_0x385eba){var _0xc23768,_0x16ba1a,_0x347ef6;return db['SmsAccount']['find']({'where':{'id':_0x4c9a6b[_0x2d72('0x54')]['id']}})['then'](handleEntityNotFound(_0x1f5f84,null))[_0x2d72('0x22')](function(_0x157aa1){if(_0x157aa1){_0x347ef6=_0x157aa1;logger['debug'](_0x2d72('0x24'),'status',_0x2d72('0xe1'),_0x157aa1[_0x2d72('0x4d')],util[_0x2d72('0xdc')](_0x4c9a6b[_0x2d72('0x41')],{'showHidden':![],'depth':null}));switch(_0x157aa1[_0x2d72('0x4d')]){case _0x2d72('0xe2'):if(_0x4c9a6b[_0x2d72('0x41')]['message-id']&&_0x4c9a6b[_0x2d72('0x41')][_0x2d72('0xe3')]){_0x16ba1a=_0x4c9a6b[_0x2d72('0x41')][_0x2d72('0xe3')];return db[_0x2d72('0xa7')]['find']({'where':{'messageId':_0x4c9a6b[_0x2d72('0x41')][_0x2d72('0xe4')]}});}break;}}})[_0x2d72('0x22')](handleEntityNotFound(_0x1f5f84,null))['then'](function(_0x5b0626){if(_0x5b0626){_0xc23768=_0x5b0626;switch(_0x347ef6['type']){case _0x2d72('0xe2'):if(_0x16ba1a==='2'||_0x16ba1a==='6'){return _0xc23768[_0x2d72('0x35')]({'read':!![]});}else{logger[_0x2d72('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2d72('0x2c'),_0x2d72('0xe2'),util[_0x2d72('0xdc')](_0x4c9a6b[_0x2d72('0x41')],{'showHidden':![],'depth':null}));};break;}return _0xc23768;}})[_0x2d72('0x22')](respondWithResult(_0x1f5f84,null))[_0x2d72('0x52')](handleError(_0x1f5f84,null));};exports[_0x2d72('0xe5')]=function(_0x3710f0,_0x31f081,_0x3457e9){return db[_0x2d72('0x50')][_0x2d72('0x58')]({'where':{'id':_0x3710f0['params']['id']}})[_0x2d72('0x22')](handleEntityNotFound(_0x31f081,null))['then'](function(_0x3cf9af){if(_0x3cf9af){return _0x3cf9af['addAgents'](_0x3710f0[_0x2d72('0x60')]['ids'],_[_0x2d72('0x9e')](_0x3710f0['body'],[_0x2d72('0x6b'),'id'])||{})['spread'](function(_0x13a42f){for(var _0x4c4cbd=0x0;_0x4c4cbd<_0x3710f0[_0x2d72('0x60')][_0x2d72('0x6b')][_0x2d72('0x67')];_0x4c4cbd+=0x1){socket[_0x2d72('0xe6')](_0x2d72('0xe7'),{'UserId':Number(_0x3710f0['body']['ids'][_0x4c4cbd]),'SmsAccountId':Number(_0x3710f0['params']['id'])});}return _0x13a42f;});}})[_0x2d72('0x22')](respondWithResult(_0x31f081,null))['catch'](handleError(_0x31f081,null));};exports['removeAgents']=function(_0x3db6f3,_0x4d567e,_0x581f9d){return db['SmsAccount'][_0x2d72('0x58')]({'where':{'id':_0x3db6f3['params']['id']}})[_0x2d72('0x22')](handleEntityNotFound(_0x4d567e,null))[_0x2d72('0x22')](function(_0x3bc545){if(_0x3bc545){return _0x3bc545[_0x2d72('0xe8')](_0x3db6f3[_0x2d72('0x41')][_0x2d72('0x6b')])['then'](function(){if(_[_0x2d72('0xe9')](_0x3db6f3[_0x2d72('0x41')][_0x2d72('0x6b')])){for(var _0x431c0f=0x0;_0x431c0f<_0x3db6f3[_0x2d72('0x41')][_0x2d72('0x6b')][_0x2d72('0x67')];_0x431c0f+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x3db6f3[_0x2d72('0x41')][_0x2d72('0x6b')][_0x431c0f]),'SmsAccountId':Number(_0x3db6f3['params']['id'])});}}else{socket[_0x2d72('0xe6')](_0x2d72('0xea'),{'UserId':Number(_0x3db6f3['query']['ids']),'SmsAccountId':Number(_0x3db6f3[_0x2d72('0x54')]['id'])});}});}})[_0x2d72('0x22')](respondWithStatusCode(_0x4d567e,null))[_0x2d72('0x52')](handleError(_0x4d567e,null));};exports[_0x2d72('0xeb')]=function(_0x21acf2,_0xb107d1,_0x215f2c){var _0x2824a5={};var _0x138359={};var _0xf324c2;var _0x1f730f;return db['SmsAccount'][_0x2d72('0x66')]({'where':{'id':_0x21acf2[_0x2d72('0x54')]['id']}})[_0x2d72('0x22')](handleEntityNotFound(_0xb107d1,null))[_0x2d72('0x22')](function(_0x5162c3){if(_0x5162c3){_0xf324c2=_0x5162c3;_0x138359['model']=_[_0x2d72('0x55')](db[_0x2d72('0xc8')][_0x2d72('0x3e')]);_0x138359['query']=_[_0x2d72('0x55')](_0x21acf2['query']);_0x138359[_0x2d72('0x42')]=_[_0x2d72('0x43')](_0x138359[_0x2d72('0x40')],_0x138359[_0x2d72('0x41')]);_0x2824a5[_0x2d72('0x44')]=_[_0x2d72('0x43')](_0x138359[_0x2d72('0x40')],qs[_0x2d72('0x45')](_0x21acf2[_0x2d72('0x41')][_0x2d72('0x45')]));_0x2824a5[_0x2d72('0x44')]=_0x2824a5[_0x2d72('0x44')]['length']?_0x2824a5[_0x2d72('0x44')]:_0x138359['model'];_0x2824a5[_0x2d72('0x48')]=qs[_0x2d72('0x49')](_0x21acf2[_0x2d72('0x41')][_0x2d72('0x49')]);_0x2824a5[_0x2d72('0x4a')]=qs[_0x2d72('0x42')](_[_0x2d72('0x68')](_0x21acf2[_0x2d72('0x41')],_0x138359[_0x2d72('0x42')]));if(_0x21acf2[_0x2d72('0x41')][_0x2d72('0x4b')]){_0x2824a5[_0x2d72('0x4a')]=_[_0x2d72('0x4c')](_0x2824a5[_0x2d72('0x4a')],{'$or':_[_0x2d72('0x3d')](_0x2824a5[_0x2d72('0x44')],function(_0x42bd1c){var _0x5906cd={};_0x5906cd[_0x42bd1c]={'$like':'%'+_0x21acf2['query']['filter']+'%'};return _0x5906cd;})});}_0x2824a5=_[_0x2d72('0x4c')]({},_0x2824a5,_0x21acf2['options']);return _0xf324c2[_0x2d72('0xeb')](_0x2824a5);}})[_0x2d72('0x22')](function(_0x2297dc){if(_0x2297dc){_0x1f730f=_0x2297dc[_0x2d72('0x67')];if(!_0x21acf2[_0x2d72('0x41')][_0x2d72('0x46')](_0x2d72('0x47'))){_0x2824a5[_0x2d72('0x2f')]=qs[_0x2d72('0x2f')](_0x21acf2[_0x2d72('0x41')][_0x2d72('0x2f')]);_0x2824a5[_0x2d72('0x2d')]=qs[_0x2d72('0x2d')](_0x21acf2['query'][_0x2d72('0x2d')]);}return _0xf324c2[_0x2d72('0xeb')](_0x2824a5);}})['then'](function(_0x2da8ae){if(_0x2da8ae){return _0x2da8ae?{'count':_0x1f730f,'rows':_0x2da8ae}:null;}})[_0x2d72('0x22')](respondWithResult(_0xb107d1,null))[_0x2d72('0x52')](handleError(_0xb107d1,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index af4046c..190ec69 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 _0x2383=['SmsAccount','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x3ce221,_0x22d678){var _0x3995b8=function(_0x4f0a97){while(--_0x4f0a97){_0x3ce221['push'](_0x3ce221['shift']());}};_0x3995b8(++_0x22d678);}(_0x2383,0xf6));var _0x3238=function(_0xfc7be9,_0x133ec3){_0xfc7be9=_0xfc7be9-0x0;var _0x39b641=_0x2383[_0xfc7be9];return _0x39b641;};'use strict';var EventEmitter=require(_0x3238('0x0'));var SmsAccount=require(_0x3238('0x1'))['db'][_0x3238('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3238('0x3'),'afterUpdate':_0x3238('0x4'),'afterDestroy':_0x3238('0x5')};function emitEvent(_0x349e2c){return function(_0x303c98,_0xf88a03,_0x139359){SmsAccountEvents[_0x3238('0x6')](_0x349e2c+':'+_0x303c98['id'],_0x303c98);SmsAccountEvents[_0x3238('0x6')](_0x349e2c,_0x303c98);_0x139359(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x3238('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x827d=['remove','emit','hasOwnProperty','exports','events','SmsAccount','save'];(function(_0x14032f,_0x5bf7b4){var _0x54a14d=function(_0x2752ad){while(--_0x2752ad){_0x14032f['push'](_0x14032f['shift']());}};_0x54a14d(++_0x5bf7b4);}(_0x827d,0x100));var _0xd827=function(_0x5e9155,_0x42b68b){_0x5e9155=_0x5e9155-0x0;var _0x5d7b6f=_0x827d[_0x5e9155];return _0x5d7b6f;};'use strict';var EventEmitter=require(_0xd827('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xd827('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd827('0x2'),'afterUpdate':'update','afterDestroy':_0xd827('0x3')};function emitEvent(_0x3a273c){return function(_0x347a4a,_0x339a96,_0x4545f1){SmsAccountEvents[_0xd827('0x4')](_0x3a273c+':'+_0x347a4a['id'],_0x347a4a);SmsAccountEvents[_0xd827('0x4')](_0x3a273c,_0x347a4a);_0x4545f1(null);};}for(var e in events){if(events[_0xd827('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xd827('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index a8254e0..3638441 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 _0x258f=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','SmsAccount','sms_accounts','util'];(function(_0x198ed6,_0x383c04){var _0x47ddc5=function(_0xa3dddf){while(--_0xa3dddf){_0x198ed6['push'](_0x198ed6['shift']());}};_0x47ddc5(++_0x383c04);}(_0x258f,0x1d5));var _0xf258=function(_0x35a13d,_0x17a149){_0x35a13d=_0x35a13d-0x0;var _0x28031c=_0x258f[_0x35a13d];return _0x28031c;};'use strict';var _=require('lodash');var util=require(_0xf258('0x0'));var logger=require(_0xf258('0x1'))(_0xf258('0x2'));var moment=require(_0xf258('0x3'));var BPromise=require('bluebird');var rp=require(_0xf258('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf258('0x5'));var config=require(_0xf258('0x6'));var attributes=require('./smsAccount.attributes');module['exports']=function(_0x36d740,_0x1d5e07){return _0x36d740[_0xf258('0x7')](_0xf258('0x8'),attributes,{'tableName':_0xf258('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77bd=['SmsAccount','sms_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x588eb8,_0x312f67){var _0x418413=function(_0x1f586b){while(--_0x1f586b){_0x588eb8['push'](_0x588eb8['shift']());}};_0x418413(++_0x312f67);}(_0x77bd,0x19a));var _0xd77b=function(_0x4ddfe1,_0x35939d){_0x4ddfe1=_0x4ddfe1-0x0;var _0x4aaf51=_0x77bd[_0x4ddfe1];return _0x4aaf51;};'use strict';var _=require(_0xd77b('0x0'));var util=require('util');var logger=require(_0xd77b('0x1'))(_0xd77b('0x2'));var moment=require('moment');var BPromise=require(_0xd77b('0x3'));var rp=require(_0xd77b('0x4'));var fs=require('fs');var path=require(_0xd77b('0x5'));var rimraf=require(_0xd77b('0x6'));var config=require(_0xd77b('0x7'));var attributes=require('./smsAccount.attributes');module[_0xd77b('0x8')]=function(_0x52ad27,_0x51ac71){return _0x52ad27[_0xd77b('0x9')](_0xd77b('0xa'),attributes,{'tableName':_0xd77b('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 5e84dd4..395e488 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 _0x5687=['ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','SmsAccount','options','raw','where','attributes','include','map','model','ShowSmsAccount','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x59f464,_0x4339ec){var _0x413943=function(_0x2db4a3){while(--_0x2db4a3){_0x59f464['push'](_0x59f464['shift']());}};_0x413943(++_0x4339ec);}(_0x5687,0xa0));var _0x7568=function(_0x53e2b6,_0x543857){_0x53e2b6=_0x53e2b6-0x0;var _0x721cc4=_0x5687[_0x53e2b6];return _0x721cc4;};'use strict';var _=require(_0x7568('0x0'));var util=require(_0x7568('0x1'));var moment=require(_0x7568('0x2'));var BPromise=require(_0x7568('0x3'));var rs=require(_0x7568('0x4'));var fs=require('fs');var Redis=require(_0x7568('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7568('0x6'))(_0x7568('0x7'));var config=require(_0x7568('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x7568('0x9')]=_[_0x7568('0xa')](config[_0x7568('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7568('0x9')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x12ca38,_0x5877c3,_0x2b33ff){return new BPromise(function(_0x56a6c0,_0x4fad72){return client[_0x7568('0xb')](_0x12ca38,_0x2b33ff)[_0x7568('0xc')](function(_0x52f4cd){logger[_0x7568('0xd')]('SmsAccount,\x20%s,\x20%s',_0x5877c3,_0x7568('0xe'));logger[_0x7568('0xf')](_0x7568('0x10'),_0x5877c3,'request\x20sent',JSON[_0x7568('0x11')](_0x52f4cd));if(_0x52f4cd[_0x7568('0x12')]){if(_0x52f4cd[_0x7568('0x12')][_0x7568('0x13')]===0x1f4){logger[_0x7568('0x12')]('SmsAccount,\x20%s,\x20%s',_0x5877c3,_0x52f4cd[_0x7568('0x12')]['message']);return _0x4fad72(_0x52f4cd['error'][_0x7568('0x14')]);}logger[_0x7568('0x12')]('SmsAccount,\x20%s,\x20%s',_0x5877c3,_0x52f4cd[_0x7568('0x12')]['message']);return _0x56a6c0(_0x52f4cd['error']['message']);}else{logger[_0x7568('0xd')](_0x7568('0x15'),_0x5877c3,_0x7568('0xe'));_0x56a6c0(_0x52f4cd[_0x7568('0x16')][_0x7568('0x14')]);}})['catch'](function(_0x5b5866){logger['error'](_0x7568('0x15'),_0x5877c3,_0x5b5866);_0x4fad72(_0x5b5866);});});}exports['ShowSmsAccount']=function(_0x16af7c){var _0x134d7a=this;return new Promise(function(_0x49f41d,_0x112871){return db[_0x7568('0x17')]['find']({'raw':_0x16af7c[_0x7568('0x18')]?_0x16af7c['options'][_0x7568('0x19')]===undefined?!![]:![]:!![],'where':_0x16af7c[_0x7568('0x18')]?_0x16af7c[_0x7568('0x18')][_0x7568('0x1a')]||null:null,'attributes':_0x16af7c[_0x7568('0x18')]?_0x16af7c['options'][_0x7568('0x1b')]||null:null,'include':_0x16af7c[_0x7568('0x18')]?_0x16af7c[_0x7568('0x18')][_0x7568('0x1c')]?_[_0x7568('0x1d')](_0x16af7c[_0x7568('0x18')][_0x7568('0x1c')],function(_0x3bf4c0){return{'model':db[_0x3bf4c0[_0x7568('0x1e')]],'as':_0x3bf4c0['as'],'attributes':_0x3bf4c0[_0x7568('0x1b')],'include':_0x3bf4c0['include']?_['map'](_0x3bf4c0[_0x7568('0x1c')],function(_0xcf864a){return{'model':db[_0xcf864a[_0x7568('0x1e')]],'as':_0xcf864a['as'],'attributes':_0xcf864a[_0x7568('0x1b')],'include':_0xcf864a[_0x7568('0x1c')]?_[_0x7568('0x1d')](_0xcf864a['include'],function(_0x5275a6){return{'model':db[_0x5275a6[_0x7568('0x1e')]],'as':_0x5275a6['as'],'attributes':_0x5275a6[_0x7568('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7568('0xc')](function(_0x108369){logger[_0x7568('0xd')](_0x7568('0x1f'),_0x16af7c);logger[_0x7568('0xf')](_0x7568('0x1f'),_0x16af7c,JSON[_0x7568('0x11')](_0x108369));_0x49f41d(_0x108369);})[_0x7568('0x20')](function(_0x4a5fd7){logger[_0x7568('0x12')](_0x7568('0x1f'),_0x4a5fd7[_0x7568('0x14')],_0x16af7c);_0x112871(_0x134d7a[_0x7568('0x12')](0x1f4,_0x4a5fd7[_0x7568('0x14')]));});});}; \ No newline at end of file +var _0xa558=['code','message','result','catch','ShowSmsAccount','find','options','raw','where','attributes','include','model','map','debug','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0xa558,0xc7));var _0x8a55=function(_0x464e08,_0x5dc896){_0x464e08=_0x464e08-0x0;var _0x4c180f=_0xa558[_0x464e08];return _0x4c180f;};'use strict';var _=require(_0x8a55('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8a55('0x1'));var rs=require(_0x8a55('0x2'));var fs=require('fs');var Redis=require(_0x8a55('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a55('0x4'));var logger=require(_0x8a55('0x5'))(_0x8a55('0x6'));var config=require(_0x8a55('0x7'));var jayson=require(_0x8a55('0x8'));var client=jayson['client'][_0x8a55('0x9')]({'port':0x232a});config[_0x8a55('0xa')]=_[_0x8a55('0xb')](config[_0x8a55('0xa')],{'host':_0x8a55('0xc'),'port':0x18eb});var socket=require(_0x8a55('0xd'))(new Redis(config[_0x8a55('0xa')]));require(_0x8a55('0xe'))[_0x8a55('0xf')](socket);function respondWithRpcPromise(_0x320253,_0x5e8a58,_0x47b27a){return new BPromise(function(_0x531ca2,_0x1848f5){return client['request'](_0x320253,_0x47b27a)[_0x8a55('0x10')](function(_0x4a69e2){logger[_0x8a55('0x11')](_0x8a55('0x12'),_0x5e8a58,_0x8a55('0x13'));logger['debug'](_0x8a55('0x14'),_0x5e8a58,'request\x20sent',JSON[_0x8a55('0x15')](_0x4a69e2));if(_0x4a69e2[_0x8a55('0x16')]){if(_0x4a69e2['error'][_0x8a55('0x17')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x5e8a58,_0x4a69e2[_0x8a55('0x16')][_0x8a55('0x18')]);return _0x1848f5(_0x4a69e2[_0x8a55('0x16')]['message']);}logger[_0x8a55('0x16')](_0x8a55('0x12'),_0x5e8a58,_0x4a69e2[_0x8a55('0x16')][_0x8a55('0x18')]);return _0x531ca2(_0x4a69e2[_0x8a55('0x16')]['message']);}else{logger[_0x8a55('0x11')](_0x8a55('0x12'),_0x5e8a58,_0x8a55('0x13'));_0x531ca2(_0x4a69e2[_0x8a55('0x19')][_0x8a55('0x18')]);}})[_0x8a55('0x1a')](function(_0x1a3f5f){logger[_0x8a55('0x16')](_0x8a55('0x12'),_0x5e8a58,_0x1a3f5f);_0x1848f5(_0x1a3f5f);});});}exports[_0x8a55('0x1b')]=function(_0x5fc830){var _0x454dc5=this;return new Promise(function(_0x448256,_0x44a170){return db['SmsAccount'][_0x8a55('0x1c')]({'raw':_0x5fc830[_0x8a55('0x1d')]?_0x5fc830['options'][_0x8a55('0x1e')]===undefined?!![]:![]:!![],'where':_0x5fc830[_0x8a55('0x1d')]?_0x5fc830[_0x8a55('0x1d')][_0x8a55('0x1f')]||null:null,'attributes':_0x5fc830[_0x8a55('0x1d')]?_0x5fc830[_0x8a55('0x1d')][_0x8a55('0x20')]||null:null,'include':_0x5fc830['options']?_0x5fc830[_0x8a55('0x1d')][_0x8a55('0x21')]?_['map'](_0x5fc830[_0x8a55('0x1d')][_0x8a55('0x21')],function(_0x42a890){return{'model':db[_0x42a890[_0x8a55('0x22')]],'as':_0x42a890['as'],'attributes':_0x42a890[_0x8a55('0x20')],'include':_0x42a890[_0x8a55('0x21')]?_[_0x8a55('0x23')](_0x42a890[_0x8a55('0x21')],function(_0x50361a){return{'model':db[_0x50361a['model']],'as':_0x50361a['as'],'attributes':_0x50361a[_0x8a55('0x20')],'include':_0x50361a[_0x8a55('0x21')]?_['map'](_0x50361a[_0x8a55('0x21')],function(_0x108971){return{'model':db[_0x108971[_0x8a55('0x22')]],'as':_0x108971['as'],'attributes':_0x108971['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a55('0x10')](function(_0x5b3d05){logger[_0x8a55('0x11')]('ShowSmsAccount',_0x5fc830);logger[_0x8a55('0x24')](_0x8a55('0x1b'),_0x5fc830,JSON['stringify'](_0x5b3d05));_0x448256(_0x5b3d05);})['catch'](function(_0x35930e){logger[_0x8a55('0x16')](_0x8a55('0x1b'),_0x35930e[_0x8a55('0x18')],_0x5fc830);_0x44a170(_0x454dc5[_0x8a55('0x16')](0x1f4,_0x35930e['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 5840cc4..88f8b7d 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(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 9ab8b82..da3f63f 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 _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x85087d,_0x5d221f){var _0x38474a=function(_0x4cf251){while(--_0x4cf251){_0x85087d['push'](_0x85087d['shift']());}};_0x38474a(++_0x5d221f);}(_0x3e74,0x175));var _0x43e7=function(_0xe07fbc,_0x9ba5fa){_0xe07fbc=_0xe07fbc-0x0;var _0x57acbf=_0x3e74[_0xe07fbc];return _0x57acbf;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('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(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_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('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 5b1615f..3755823 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 _0x8f13=['noop','STRING','sequelize','INTEGER'];(function(_0x293de0,_0x3a4643){var _0x10129e=function(_0x368dab){while(--_0x368dab){_0x293de0['push'](_0x293de0['shift']());}};_0x10129e(++_0x3a4643);}(_0x8f13,0x1ca));var _0x38f1=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x8f13[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x38f1('0x0'));module['exports']={'priority':{'type':Sequelize[_0x38f1('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x38f1('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x38f1('0x3')]},'interval':{'type':Sequelize[_0x38f1('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x649b=['noop','TEXT','*,*,*,*','sequelize','STRING'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x649b,0xe4));var _0xb649=function(_0x10b9ab,_0x5c57f3){_0x10b9ab=_0x10b9ab-0x0;var _0x29c947=_0x649b[_0x10b9ab];return _0x29c947;};'use strict';var Sequelize=require(_0xb649('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb649('0x1')],'allowNull':![],'defaultValue':_0xb649('0x2')},'appdata':{'type':Sequelize[_0xb649('0x3')]()},'description':{'type':Sequelize[_0xb649('0x1')]},'interval':{'type':Sequelize[_0xb649('0x1')],'defaultValue':_0xb649('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 22e7734..84ab668 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 _0x364e=['type','VIRTUAL','options','SmsApplication','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','set','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge'];(function(_0x4f9afc,_0x4fb145){var _0x324836=function(_0x10ab20){while(--_0x10ab20){_0x4f9afc['push'](_0x4f9afc['shift']());}};_0x324836(++_0x4fb145);}(_0x364e,0x1e3));var _0xe364=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x364e[_0x5416db];return _0x243e35;};'use strict';var emlformat=require(_0xe364('0x0'));var rimraf=require(_0xe364('0x1'));var zipdir=require(_0xe364('0x2'));var jsonpatch=require(_0xe364('0x3'));var rp=require(_0xe364('0x4'));var moment=require('moment');var BPromise=require(_0xe364('0x5'));var Mustache=require(_0xe364('0x6'));var util=require(_0xe364('0x7'));var path=require(_0xe364('0x8'));var sox=require(_0xe364('0x9'));var csv=require(_0xe364('0xa'));var ejs=require(_0xe364('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe364('0xc'));var squel=require(_0xe364('0xd'));var crypto=require(_0xe364('0xe'));var jsforce=require(_0xe364('0xf'));var deskjs=require(_0xe364('0x10'));var toCsv=require(_0xe364('0xa'));var querystring=require(_0xe364('0x11'));var Papa=require(_0xe364('0x12'));var Redis=require(_0xe364('0x13'));var authService=require(_0xe364('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe364('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe364('0x16'))(_0xe364('0x17'));var utils=require(_0xe364('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe364('0x19'));var db=require(_0xe364('0x1a'))['db'];function respondWithStatusCode(_0x308e37,_0x3a67b9){_0x3a67b9=_0x3a67b9||0xcc;return function(_0x4c08b7){if(_0x4c08b7){return _0x308e37[_0xe364('0x1b')](_0x3a67b9);}return _0x308e37['status'](_0x3a67b9)[_0xe364('0x1c')]();};}function respondWithResult(_0x5d49f3,_0x3a2c50){_0x3a2c50=_0x3a2c50||0xc8;return function(_0x112cde){if(_0x112cde){return _0x5d49f3['status'](_0x3a2c50)[_0xe364('0x1d')](_0x112cde);}};}function respondWithFilteredResult(_0x29d9ee,_0x3e584b){return function(_0x265b96){if(_0x265b96){var _0xa3ba58=typeof _0x3e584b['offset']==='undefined'&&typeof _0x3e584b[_0xe364('0x1e')]===_0xe364('0x1f');var _0x1c0d1e=_0x265b96[_0xe364('0x20')];var _0x1c259c=_0xa3ba58?0x0:_0x3e584b[_0xe364('0x21')];var _0x3270a9=_0xa3ba58?_0x265b96['count']:_0x3e584b[_0xe364('0x21')]+_0x3e584b[_0xe364('0x1e')];var _0x38f3b3;if(_0x3270a9>=_0x1c0d1e){_0x3270a9=_0x1c0d1e;_0x38f3b3=0xc8;}else{_0x38f3b3=0xce;}_0x29d9ee[_0xe364('0x22')](_0x38f3b3);return _0x29d9ee[_0xe364('0x23')]('Content-Range',_0x1c259c+'-'+_0x3270a9+'/'+_0x1c0d1e)[_0xe364('0x1d')](_0x265b96);}return null;};}function patchUpdates(_0x5f4573){return function(_0x638a66){try{jsonpatch['apply'](_0x638a66,_0x5f4573,!![]);}catch(_0x14cffc){return BPromise[_0xe364('0x24')](_0x14cffc);}return _0x638a66[_0xe364('0x25')]();};}function saveUpdates(_0x2a41b6,_0x3b8840){return function(_0x1914d5){if(_0x1914d5){return _0x1914d5['update'](_0x2a41b6)[_0xe364('0x26')](function(_0x5a826d){return _0x5a826d;});}return null;};}function removeEntity(_0x14225b,_0x1c1e3d){return function(_0x3c33ce){if(_0x3c33ce){return _0x3c33ce[_0xe364('0x27')]()[_0xe364('0x26')](function(){_0x14225b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x525662,_0x10fb65){return function(_0x129c92){if(!_0x129c92){_0x525662['sendStatus'](0x194);}return _0x129c92;};}function handleError(_0x37fc89,_0x5e29aa){_0x5e29aa=_0x5e29aa||0x1f4;return function(_0x645256){logger[_0xe364('0x28')](_0x645256[_0xe364('0x29')]);if(_0x645256[_0xe364('0x2a')]){delete _0x645256['name'];}_0x37fc89[_0xe364('0x22')](_0x5e29aa)[_0xe364('0x2b')](_0x645256);};}exports[_0xe364('0x2c')]=function(_0x38a331,_0x1a2add){var _0x133f4c={},_0x2a370d={},_0x18ff74={'count':0x0,'rows':[]};var _0x55b542=_[_0xe364('0x2d')](db['SmsApplication'][_0xe364('0x2e')],function(_0x71a76d){return{'name':_0x71a76d[_0xe364('0x2f')],'type':_0x71a76d['type'][_0xe364('0x30')]};});_0x2a370d['model']=_[_0xe364('0x2d')](_0x55b542,'name');_0x2a370d[_0xe364('0x31')]=_[_0xe364('0x32')](_0x38a331[_0xe364('0x31')]);_0x2a370d['filters']=_[_0xe364('0x33')](_0x2a370d[_0xe364('0x34')],_0x2a370d[_0xe364('0x31')]);_0x133f4c[_0xe364('0x35')]=_[_0xe364('0x33')](_0x2a370d['model'],qs[_0xe364('0x36')](_0x38a331[_0xe364('0x31')]['fields']));_0x133f4c[_0xe364('0x35')]=_0x133f4c['attributes'][_0xe364('0x37')]?_0x133f4c['attributes']:_0x2a370d['model'];if(!_0x38a331[_0xe364('0x31')][_0xe364('0x38')](_0xe364('0x39'))){_0x133f4c[_0xe364('0x1e')]=qs[_0xe364('0x1e')](_0x38a331[_0xe364('0x31')]['limit']);_0x133f4c['offset']=qs[_0xe364('0x21')](_0x38a331[_0xe364('0x31')][_0xe364('0x21')]);}_0x133f4c['order']=qs[_0xe364('0x3a')](_0x38a331[_0xe364('0x31')]['sort']);_0x133f4c[_0xe364('0x3b')]=qs[_0xe364('0x3c')](_['pick'](_0x38a331['query'],_0x2a370d[_0xe364('0x3c')]),_0x55b542);if(_0x38a331['query'][_0xe364('0x3d')]){_0x133f4c['where']=_[_0xe364('0x3e')](_0x133f4c[_0xe364('0x3b')],{'$or':_[_0xe364('0x2d')](_0x55b542,function(_0x1b9dbb){if(_0x1b9dbb[_0xe364('0x3f')]!==_0xe364('0x40')){var _0x764f44={};_0x764f44[_0x1b9dbb[_0xe364('0x2a')]]={'$like':'%'+_0x38a331[_0xe364('0x31')][_0xe364('0x3d')]+'%'};return _0x764f44;}})});}_0x133f4c=_[_0xe364('0x3e')]({},_0x133f4c,_0x38a331[_0xe364('0x41')]);var _0x1e4ec3={'where':_0x133f4c[_0xe364('0x3b')]};return db[_0xe364('0x42')]['count'](_0x1e4ec3)[_0xe364('0x26')](function(_0x4a0dca){_0x18ff74[_0xe364('0x20')]=_0x4a0dca;if(_0x38a331['query'][_0xe364('0x43')]){_0x133f4c[_0xe364('0x44')]=[{'all':!![]}];}return db[_0xe364('0x42')][_0xe364('0x45')](_0x133f4c);})[_0xe364('0x26')](function(_0x29679e){_0x18ff74[_0xe364('0x46')]=_0x29679e;return _0x18ff74;})[_0xe364('0x26')](respondWithFilteredResult(_0x1a2add,_0x133f4c))['catch'](handleError(_0x1a2add,null));};exports[_0xe364('0x47')]=function(_0x377fde,_0x31b6e6){var _0x59988e={'raw':!![],'where':{'id':_0x377fde['params']['id']}},_0x1fff62={};_0x1fff62[_0xe364('0x34')]=_[_0xe364('0x32')](db[_0xe364('0x42')][_0xe364('0x2e')]);_0x1fff62[_0xe364('0x31')]=_[_0xe364('0x32')](_0x377fde[_0xe364('0x31')]);_0x1fff62['filters']=_[_0xe364('0x33')](_0x1fff62[_0xe364('0x34')],_0x1fff62[_0xe364('0x31')]);_0x59988e[_0xe364('0x35')]=_[_0xe364('0x33')](_0x1fff62['model'],qs[_0xe364('0x36')](_0x377fde['query'][_0xe364('0x36')]));_0x59988e[_0xe364('0x35')]=_0x59988e[_0xe364('0x35')]['length']?_0x59988e['attributes']:_0x1fff62[_0xe364('0x34')];if(_0x377fde[_0xe364('0x31')][_0xe364('0x43')]){_0x59988e[_0xe364('0x44')]=[{'all':!![]}];}_0x59988e=_[_0xe364('0x3e')]({},_0x59988e,_0x377fde['options']);return db[_0xe364('0x42')][_0xe364('0x48')](_0x59988e)[_0xe364('0x26')](handleEntityNotFound(_0x31b6e6,null))[_0xe364('0x26')](respondWithResult(_0x31b6e6,null))[_0xe364('0x49')](handleError(_0x31b6e6,null));};exports[_0xe364('0x4a')]=function(_0x1f94e8,_0xd0e421){return db[_0xe364('0x42')][_0xe364('0x4a')](_0x1f94e8[_0xe364('0x4b')],{})[_0xe364('0x26')](respondWithResult(_0xd0e421,0xc9))[_0xe364('0x49')](handleError(_0xd0e421,null));};exports[_0xe364('0x4c')]=function(_0x21f5e3,_0x2158d0){if(_0x21f5e3[_0xe364('0x4b')]['id']){delete _0x21f5e3[_0xe364('0x4b')]['id'];}return db[_0xe364('0x42')][_0xe364('0x48')]({'where':{'id':_0x21f5e3[_0xe364('0x4d')]['id']}})[_0xe364('0x26')](handleEntityNotFound(_0x2158d0,null))[_0xe364('0x26')](saveUpdates(_0x21f5e3[_0xe364('0x4b')],null))['then'](respondWithResult(_0x2158d0,null))[_0xe364('0x49')](handleError(_0x2158d0,null));};exports[_0xe364('0x27')]=function(_0x230e4f,_0x15c90d){return db['SmsApplication'][_0xe364('0x48')]({'where':{'id':_0x230e4f['params']['id']}})[_0xe364('0x26')](handleEntityNotFound(_0x15c90d,null))[_0xe364('0x26')](removeEntity(_0x15c90d,null))['catch'](handleError(_0x15c90d,null));}; \ No newline at end of file +var _0xd46b=['length','find','create','body','update','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','SmsApplication','includeAll','include','findAll','catch','show'];(function(_0x27eda0,_0x42a3cf){var _0x2b63a5=function(_0x431084){while(--_0x431084){_0x27eda0['push'](_0x27eda0['shift']());}};_0x2b63a5(++_0x42a3cf);}(_0xd46b,0x147));var _0xbd46=function(_0x14eac5,_0x5d7549){_0x14eac5=_0x14eac5-0x0;var _0x223eb6=_0xd46b[_0x14eac5];return _0x223eb6;};'use strict';var emlformat=require(_0xbd46('0x0'));var rimraf=require(_0xbd46('0x1'));var zipdir=require(_0xbd46('0x2'));var jsonpatch=require(_0xbd46('0x3'));var rp=require(_0xbd46('0x4'));var moment=require(_0xbd46('0x5'));var BPromise=require(_0xbd46('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbd46('0x7'));var sox=require(_0xbd46('0x8'));var csv=require(_0xbd46('0x9'));var ejs=require(_0xbd46('0xa'));var fs=require('fs');var fs_extra=require(_0xbd46('0xb'));var _=require(_0xbd46('0xc'));var squel=require(_0xbd46('0xd'));var crypto=require(_0xbd46('0xe'));var jsforce=require(_0xbd46('0xf'));var deskjs=require(_0xbd46('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbd46('0x11'));var Papa=require('papaparse');var Redis=require(_0xbd46('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbd46('0x13'));var as=require(_0xbd46('0x14'));var hardwareService=require(_0xbd46('0x15'));var logger=require(_0xbd46('0x16'))(_0xbd46('0x17'));var utils=require(_0xbd46('0x18'));var config=require(_0xbd46('0x19'));var licenseUtil=require(_0xbd46('0x1a'));var db=require(_0xbd46('0x1b'))['db'];function respondWithStatusCode(_0x493b8f,_0x2557a0){_0x2557a0=_0x2557a0||0xcc;return function(_0x1a2fbb){if(_0x1a2fbb){return _0x493b8f['sendStatus'](_0x2557a0);}return _0x493b8f[_0xbd46('0x1c')](_0x2557a0)[_0xbd46('0x1d')]();};}function respondWithResult(_0x268a75,_0x1b22a3){_0x1b22a3=_0x1b22a3||0xc8;return function(_0x9d08a4){if(_0x9d08a4){return _0x268a75[_0xbd46('0x1c')](_0x1b22a3)[_0xbd46('0x1e')](_0x9d08a4);}};}function respondWithFilteredResult(_0x257a32,_0x2a2d4f){return function(_0x480a60){if(_0x480a60){var _0x574b28=typeof _0x2a2d4f[_0xbd46('0x1f')]===_0xbd46('0x20')&&typeof _0x2a2d4f['limit']===_0xbd46('0x20');var _0x37bbc6=_0x480a60['count'];var _0x26a8fa=_0x574b28?0x0:_0x2a2d4f[_0xbd46('0x1f')];var _0x515395=_0x574b28?_0x480a60[_0xbd46('0x21')]:_0x2a2d4f[_0xbd46('0x1f')]+_0x2a2d4f[_0xbd46('0x22')];var _0x3a1bdf;if(_0x515395>=_0x37bbc6){_0x515395=_0x37bbc6;_0x3a1bdf=0xc8;}else{_0x3a1bdf=0xce;}_0x257a32[_0xbd46('0x1c')](_0x3a1bdf);return _0x257a32[_0xbd46('0x23')](_0xbd46('0x24'),_0x26a8fa+'-'+_0x515395+'/'+_0x37bbc6)[_0xbd46('0x1e')](_0x480a60);}return null;};}function patchUpdates(_0x26dc0e){return function(_0x26fe53){try{jsonpatch[_0xbd46('0x25')](_0x26fe53,_0x26dc0e,!![]);}catch(_0x2c5add){return BPromise[_0xbd46('0x26')](_0x2c5add);}return _0x26fe53[_0xbd46('0x27')]();};}function saveUpdates(_0x376e54,_0x27220f){return function(_0x4c6f1d){if(_0x4c6f1d){return _0x4c6f1d['update'](_0x376e54)[_0xbd46('0x28')](function(_0x536f63){return _0x536f63;});}return null;};}function removeEntity(_0x21610c,_0x517f9d){return function(_0x366174){if(_0x366174){return _0x366174['destroy']()[_0xbd46('0x28')](function(){_0x21610c[_0xbd46('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e88e1,_0x1ceba1){return function(_0xbb39d3){if(!_0xbb39d3){_0x5e88e1[_0xbd46('0x29')](0x194);}return _0xbb39d3;};}function handleError(_0x4e75f5,_0x220cd9){_0x220cd9=_0x220cd9||0x1f4;return function(_0x55d053){logger[_0xbd46('0x2a')](_0x55d053[_0xbd46('0x2b')]);if(_0x55d053['name']){delete _0x55d053[_0xbd46('0x2c')];}_0x4e75f5[_0xbd46('0x1c')](_0x220cd9)['send'](_0x55d053);};}exports[_0xbd46('0x2d')]=function(_0x22e2d9,_0x4b4774){var _0x515382={},_0x1bb50f={},_0x53d8ee={'count':0x0,'rows':[]};var _0x3bed3f=_[_0xbd46('0x2e')](db['SmsApplication'][_0xbd46('0x2f')],function(_0x20ae13){return{'name':_0x20ae13[_0xbd46('0x30')],'type':_0x20ae13[_0xbd46('0x31')]['key']};});_0x1bb50f[_0xbd46('0x32')]=_[_0xbd46('0x2e')](_0x3bed3f,_0xbd46('0x2c'));_0x1bb50f['query']=_[_0xbd46('0x33')](_0x22e2d9[_0xbd46('0x34')]);_0x1bb50f['filters']=_[_0xbd46('0x35')](_0x1bb50f['model'],_0x1bb50f[_0xbd46('0x34')]);_0x515382['attributes']=_[_0xbd46('0x35')](_0x1bb50f[_0xbd46('0x32')],qs[_0xbd46('0x36')](_0x22e2d9['query'][_0xbd46('0x36')]));_0x515382['attributes']=_0x515382[_0xbd46('0x37')]['length']?_0x515382[_0xbd46('0x37')]:_0x1bb50f[_0xbd46('0x32')];if(!_0x22e2d9['query'][_0xbd46('0x38')](_0xbd46('0x39'))){_0x515382[_0xbd46('0x22')]=qs[_0xbd46('0x22')](_0x22e2d9[_0xbd46('0x34')][_0xbd46('0x22')]);_0x515382[_0xbd46('0x1f')]=qs['offset'](_0x22e2d9['query'][_0xbd46('0x1f')]);}_0x515382[_0xbd46('0x3a')]=qs[_0xbd46('0x3b')](_0x22e2d9[_0xbd46('0x34')]['sort']);_0x515382[_0xbd46('0x3c')]=qs[_0xbd46('0x3d')](_[_0xbd46('0x3e')](_0x22e2d9['query'],_0x1bb50f[_0xbd46('0x3d')]),_0x3bed3f);if(_0x22e2d9[_0xbd46('0x34')][_0xbd46('0x3f')]){_0x515382['where']=_['merge'](_0x515382['where'],{'$or':_[_0xbd46('0x2e')](_0x3bed3f,function(_0x33a872){if(_0x33a872['type']!==_0xbd46('0x40')){var _0x507b74={};_0x507b74[_0x33a872['name']]={'$like':'%'+_0x22e2d9[_0xbd46('0x34')]['filter']+'%'};return _0x507b74;}})});}_0x515382=_[_0xbd46('0x41')]({},_0x515382,_0x22e2d9[_0xbd46('0x42')]);var _0x27d08a={'where':_0x515382[_0xbd46('0x3c')]};return db[_0xbd46('0x43')][_0xbd46('0x21')](_0x27d08a)['then'](function(_0x179091){_0x53d8ee[_0xbd46('0x21')]=_0x179091;if(_0x22e2d9['query'][_0xbd46('0x44')]){_0x515382[_0xbd46('0x45')]=[{'all':!![]}];}return db[_0xbd46('0x43')][_0xbd46('0x46')](_0x515382);})[_0xbd46('0x28')](function(_0x13fddc){_0x53d8ee['rows']=_0x13fddc;return _0x53d8ee;})[_0xbd46('0x28')](respondWithFilteredResult(_0x4b4774,_0x515382))[_0xbd46('0x47')](handleError(_0x4b4774,null));};exports[_0xbd46('0x48')]=function(_0xe2fda0,_0x380c19){var _0x5201b6={'raw':!![],'where':{'id':_0xe2fda0['params']['id']}},_0x3957ad={};_0x3957ad['model']=_[_0xbd46('0x33')](db[_0xbd46('0x43')][_0xbd46('0x2f')]);_0x3957ad[_0xbd46('0x34')]=_[_0xbd46('0x33')](_0xe2fda0[_0xbd46('0x34')]);_0x3957ad[_0xbd46('0x3d')]=_[_0xbd46('0x35')](_0x3957ad[_0xbd46('0x32')],_0x3957ad[_0xbd46('0x34')]);_0x5201b6[_0xbd46('0x37')]=_[_0xbd46('0x35')](_0x3957ad[_0xbd46('0x32')],qs[_0xbd46('0x36')](_0xe2fda0[_0xbd46('0x34')][_0xbd46('0x36')]));_0x5201b6[_0xbd46('0x37')]=_0x5201b6[_0xbd46('0x37')][_0xbd46('0x49')]?_0x5201b6['attributes']:_0x3957ad[_0xbd46('0x32')];if(_0xe2fda0[_0xbd46('0x34')][_0xbd46('0x44')]){_0x5201b6[_0xbd46('0x45')]=[{'all':!![]}];}_0x5201b6=_[_0xbd46('0x41')]({},_0x5201b6,_0xe2fda0[_0xbd46('0x42')]);return db[_0xbd46('0x43')][_0xbd46('0x4a')](_0x5201b6)[_0xbd46('0x28')](handleEntityNotFound(_0x380c19,null))[_0xbd46('0x28')](respondWithResult(_0x380c19,null))[_0xbd46('0x47')](handleError(_0x380c19,null));};exports[_0xbd46('0x4b')]=function(_0x338136,_0x31431f){return db[_0xbd46('0x43')][_0xbd46('0x4b')](_0x338136[_0xbd46('0x4c')],{})['then'](respondWithResult(_0x31431f,0xc9))[_0xbd46('0x47')](handleError(_0x31431f,null));};exports[_0xbd46('0x4d')]=function(_0x43cefc,_0x28d854){if(_0x43cefc[_0xbd46('0x4c')]['id']){delete _0x43cefc[_0xbd46('0x4c')]['id'];}return db[_0xbd46('0x43')][_0xbd46('0x4a')]({'where':{'id':_0x43cefc[_0xbd46('0x4e')]['id']}})[_0xbd46('0x28')](handleEntityNotFound(_0x28d854,null))['then'](saveUpdates(_0x43cefc[_0xbd46('0x4c')],null))[_0xbd46('0x28')](respondWithResult(_0x28d854,null))[_0xbd46('0x47')](handleError(_0x28d854,null));};exports[_0xbd46('0x4f')]=function(_0x2525d3,_0x53ffbc){return db[_0xbd46('0x43')][_0xbd46('0x4a')]({'where':{'id':_0x2525d3[_0xbd46('0x4e')]['id']}})[_0xbd46('0x28')](handleEntityNotFound(_0x53ffbc,null))[_0xbd46('0x28')](removeEntity(_0x53ffbc,null))[_0xbd46('0x47')](handleError(_0x53ffbc,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 7e3a2a7..445fdf4 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 _0x61c6=['exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf','./smsApplication.attributes'];(function(_0x479523,_0x1a6a9b){var _0x28ffee=function(_0x41ca12){while(--_0x41ca12){_0x479523['push'](_0x479523['shift']());}};_0x28ffee(++_0x1a6a9b);}(_0x61c6,0x199));var _0x661c=function(_0x212d0a,_0x39affb){_0x212d0a=_0x212d0a-0x0;var _0x3f61d9=_0x61c6[_0x212d0a];return _0x3f61d9;};'use strict';var _=require(_0x661c('0x0'));var util=require(_0x661c('0x1'));var logger=require(_0x661c('0x2'))(_0x661c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x661c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x661c('0x5'));var config=require('../../config/environment');var attributes=require(_0x661c('0x6'));module[_0x661c('0x7')]=function(_0x531865,_0x4936a9){return _0x531865[_0x661c('0x8')](_0x661c('0x9'),attributes,{'tableName':_0x661c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x661c('0xb'),'collate':_0x661c('0xc')});}; \ No newline at end of file +var _0x9800=['rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3a1a67,_0x4a9542){var _0x207c53=function(_0x2276c7){while(--_0x2276c7){_0x3a1a67['push'](_0x3a1a67['shift']());}};_0x207c53(++_0x4a9542);}(_0x9800,0x18e));var _0x0980=function(_0x825cbd,_0x3de63d){_0x825cbd=_0x825cbd-0x0;var _0x2a10b3=_0x9800[_0x825cbd];return _0x2a10b3;};'use strict';var _=require(_0x0980('0x0'));var util=require('util');var logger=require(_0x0980('0x1'))(_0x0980('0x2'));var moment=require(_0x0980('0x3'));var BPromise=require(_0x0980('0x4'));var rp=require(_0x0980('0x5'));var fs=require('fs');var path=require(_0x0980('0x6'));var rimraf=require(_0x0980('0x7'));var config=require(_0x0980('0x8'));var attributes=require(_0x0980('0x9'));module[_0x0980('0xa')]=function(_0x359a4c,_0x1e83f2){return _0x359a4c[_0x0980('0xb')](_0x0980('0xc'),attributes,{'tableName':_0x0980('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0980('0xe'),'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 e75d01a..1275bba 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 _0x4bd3=['request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4155ba,_0x443f76){var _0xe3f2e2=function(_0x4ab529){while(--_0x4ab529){_0x4155ba['push'](_0x4155ba['shift']());}};_0xe3f2e2(++_0x443f76);}(_0x4bd3,0x174));var _0x34bd=function(_0x1477d1,_0x442a29){_0x1477d1=_0x1477d1-0x0;var _0x152e87=_0x4bd3[_0x1477d1];return _0x152e87;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var moment=require(_0x34bd('0x1'));var BPromise=require(_0x34bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34bd('0x3'));var logger=require(_0x34bd('0x4'))(_0x34bd('0x5'));var config=require('../../config/environment');var jayson=require(_0x34bd('0x6'));var client=jayson[_0x34bd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e8744,_0x213716,_0x51a4d7){return new BPromise(function(_0xd600e1,_0x76de8d){return client[_0x34bd('0x8')](_0x3e8744,_0x51a4d7)[_0x34bd('0x9')](function(_0x1ac77f){logger[_0x34bd('0xa')]('SmsApplication,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));logger[_0x34bd('0xc')](_0x34bd('0xd'),_0x213716,_0x34bd('0xb'),JSON['stringify'](_0x1ac77f));if(_0x1ac77f['error']){if(_0x1ac77f[_0x34bd('0xe')]['code']===0x1f4){logger['error'](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0x76de8d(_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);}logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0xd600e1(_0x1ac77f['error'][_0x34bd('0x10')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));_0xd600e1(_0x1ac77f[_0x34bd('0x11')][_0x34bd('0x10')]);}})[_0x34bd('0x12')](function(_0x34b91b){logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x34b91b);_0x76de8d(_0x34b91b);});});} \ No newline at end of file +var _0xabad=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xabad,0x150));var _0xdaba=function(_0x3feec6,_0x4db012){_0x3feec6=_0x3feec6-0x0;var _0x56d5e2=_0xabad[_0x3feec6];return _0x56d5e2;};'use strict';var _=require(_0xdaba('0x0'));var util=require('util');var moment=require(_0xdaba('0x1'));var BPromise=require(_0xdaba('0x2'));var rs=require(_0xdaba('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaba('0x4'))['db'];var utils=require(_0xdaba('0x5'));var logger=require('../../config/logger')(_0xdaba('0x6'));var config=require(_0xdaba('0x7'));var jayson=require(_0xdaba('0x8'));var client=jayson[_0xdaba('0x9')][_0xdaba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23ae0f,_0x4045f5,_0x352a74){return new BPromise(function(_0x5214dc,_0x2344d1){return client[_0xdaba('0xb')](_0x23ae0f,_0x352a74)[_0xdaba('0xc')](function(_0x1e22ba){logger['info'](_0xdaba('0xd'),_0x4045f5,_0xdaba('0xe'));logger[_0xdaba('0xf')](_0xdaba('0x10'),_0x4045f5,_0xdaba('0xe'),JSON[_0xdaba('0x11')](_0x1e22ba));if(_0x1e22ba[_0xdaba('0x12')]){if(_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x13')]===0x1f4){logger['error'](_0xdaba('0xd'),_0x4045f5,_0x1e22ba['error'][_0xdaba('0x14')]);return _0x2344d1(_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x14')]);}logger[_0xdaba('0x12')](_0xdaba('0xd'),_0x4045f5,_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x14')]);return _0x5214dc(_0x1e22ba['error'][_0xdaba('0x14')]);}else{logger[_0xdaba('0x15')](_0xdaba('0xd'),_0x4045f5,_0xdaba('0xe'));_0x5214dc(_0x1e22ba[_0xdaba('0x16')][_0xdaba('0x14')]);}})[_0xdaba('0x17')](function(_0x5c4ec1){logger[_0xdaba('0x12')](_0xdaba('0xd'),_0x4045f5,_0x5c4ec1);_0x2344d1(_0x5c4ec1);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index ce43fd7..0cb4528 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 _0x4024=['addTags','put','smsinteraction:update','update','delete','destroy','removeTags','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x4024,0x89));var _0x4402=function(_0x50cc5c,_0x4afd90){_0x50cc5c=_0x50cc5c-0x0;var _0x4e6835=_0x4024[_0x50cc5c];return _0x4e6835;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./smsInteraction.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/describe',auth[_0x4402('0x7')](),controller['describe']);router['get'](_0x4402('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4402('0x9')]('/:id/messages',auth[_0x4402('0x7')](),controller['getMessages']);router[_0x4402('0x9')]('/:id/download',auth[_0x4402('0x7')](),controller[_0x4402('0xb')]);router['post']('/',auth[_0x4402('0x7')](),controller[_0x4402('0xc')]);router[_0x4402('0xd')]('/:id/messages',auth[_0x4402('0x7')](),controller[_0x4402('0xe')]);router[_0x4402('0xd')](_0x4402('0xf'),auth[_0x4402('0x7')](),interaction[_0x4402('0x10')](_0x4402('0x11'),_0x4402('0x12')),controller[_0x4402('0x13')]);router[_0x4402('0x14')](_0x4402('0xa'),auth[_0x4402('0x7')](),interaction[_0x4402('0x10')](_0x4402('0x11'),_0x4402('0x15')),controller[_0x4402('0x16')]);router[_0x4402('0x17')](_0x4402('0xa'),auth[_0x4402('0x7')](),interaction[_0x4402('0x10')]('sms','smsinteraction:destroy'),controller[_0x4402('0x18')]);router[_0x4402('0x17')]('/:id/tags',auth[_0x4402('0x7')](),controller[_0x4402('0x19')]);module['exports']=router; \ No newline at end of file +var _0x4483=['isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','addTags','put','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4483,0x1a3));var _0x3448=function(_0x3cea2d,_0x5133e4){_0x3cea2d=_0x3cea2d-0x0;var _0x550e57=_0x4483[_0x3cea2d];return _0x550e57;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3448('0x13')](_0x3448('0xf'),auth['isAuthenticated'](),controller[_0x3448('0x14')]);router[_0x3448('0x13')](_0x3448('0x15'),auth['isAuthenticated'](),interaction[_0x3448('0x16')](_0x3448('0x17'),'smsinteraction:addtags'),controller[_0x3448('0x18')]);router[_0x3448('0x19')](_0x3448('0x1a'),auth['isAuthenticated'](),interaction[_0x3448('0x16')](_0x3448('0x17'),_0x3448('0x1b')),controller[_0x3448('0x1c')]);router[_0x3448('0x1d')](_0x3448('0x1a'),auth[_0x3448('0xa')](),interaction[_0x3448('0x16')]('sms',_0x3448('0x1e')),controller['destroy']);router['delete']('/:id/tags',auth[_0x3448('0xa')](),controller[_0x3448('0x1f')]);module[_0x3448('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 082ac5f..050d2e1 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 _0xabad=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x212960,_0x520f14){var _0x4f5a8a=function(_0x5e40c5){while(--_0x5e40c5){_0x212960['push'](_0x212960['shift']());}};_0x4f5a8a(++_0x520f14);}(_0xabad,0x150));var _0xdaba=function(_0xfa716b,_0x1fa236){_0xfa716b=_0xfa716b-0x0;var _0xe946ab=_0xabad[_0xfa716b];return _0xe946ab;};'use strict';var Sequelize=require(_0xdaba('0x0'));var moment=require('moment');module[_0xdaba('0x1')]={'closed':{'type':Sequelize[_0xdaba('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdaba('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdaba('0x4')]},'thirdDisposition':{'type':Sequelize[_0xdaba('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xdaba('0x4')]},'read1stAt':{'type':Sequelize[_0xdaba('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xdaba('0x5')]('in',_0xdaba('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdaba('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xdaba('0x5')]('in',_0xdaba('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xdaba('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6df9=['moment','BOOLEAN','STRING','DATE','out','INTEGER','sequelize'];(function(_0x35a85c,_0x48fb57){var _0x194713=function(_0x1f0fe9){while(--_0x1f0fe9){_0x35a85c['push'](_0x35a85c['shift']());}};_0x194713(++_0x48fb57);}(_0x6df9,0x84));var _0x96df=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6df9[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x96df('0x0'));var moment=require(_0x96df('0x1'));module['exports']={'closed':{'type':Sequelize[_0x96df('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x96df('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x96df('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x96df('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x96df('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x96df('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x96df('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x96df('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x96df('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 5ae5652..2f289df 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 _0x21ee=['secret','read','Account','mkdirSync','Sms','Owner','N.A.','toString','closed','closedAt','disposition','Messages','createdAt','YYYY-MM-DD\x20HH:mm:ss','direction','out','System','value','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','update','then','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','findAll','sms','query','user','catch','show','params','model','keys','fields','attributes','length','includeAll','include','merge','options','find','create','body','destroy','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','filters','nolimit','order','sort','where','pick','SmsInteractionId','filter','$gte','rows','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','root','tmp','join','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName'];(function(_0x1afd7d,_0x430d12){var _0x2a7fa4=function(_0x8b5dbd){while(--_0x8b5dbd){_0x1afd7d['push'](_0x1afd7d['shift']());}};_0x2a7fa4(++_0x430d12);}(_0x21ee,0x18d));var _0xe21e=function(_0xdfd829,_0x46ff2b){_0xdfd829=_0xdfd829-0x0;var _0x68903=_0x21ee[_0xdfd829];return _0x68903;};'use strict';var rimraf=require(_0xe21e('0x0'));var zipdir=require(_0xe21e('0x1'));var moment=require(_0xe21e('0x2'));var BPromise=require(_0xe21e('0x3'));var util=require(_0xe21e('0x4'));var path=require(_0xe21e('0x5'));var ejs=require(_0xe21e('0x6'));var fs=require('fs');var _=require(_0xe21e('0x7'));var Redis=require(_0xe21e('0x8'));var interaction=require(_0xe21e('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0xe21e('0xa'));var logger=require(_0xe21e('0xb'))('api');var config=require('../../config/environment');var db=require(_0xe21e('0xc'))['db'];config[_0xe21e('0xd')]=_[_0xe21e('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe21e('0xf'))(new Redis(config[_0xe21e('0xd')]));require(_0xe21e('0x10'))[_0xe21e('0x11')](socket);function respondWithStatusCode(_0x3b2558,_0x236f6b){_0x236f6b=_0x236f6b||0xcc;return function(_0x1da3ec){if(_0x1da3ec){return _0x3b2558[_0xe21e('0x12')](_0x236f6b);}return _0x3b2558[_0xe21e('0x13')](_0x236f6b)['end']();};}function respondWithResult(_0x12678,_0x118bda){_0x118bda=_0x118bda||0xc8;return function(_0x80e487){if(_0x80e487){return _0x12678['status'](_0x118bda)[_0xe21e('0x14')](_0x80e487);}};}function respondWithFilteredResult(_0x108637,_0x33b651){return function(_0xceb261){if(_0xceb261){var _0x43e101=typeof _0x33b651[_0xe21e('0x15')]==='undefined'&&typeof _0x33b651[_0xe21e('0x16')]===_0xe21e('0x17');var _0x454894=_0xceb261[_0xe21e('0x18')];var _0x5e0639=_0x43e101?0x0:_0x33b651[_0xe21e('0x15')];var _0x5e86da=_0x43e101?_0xceb261['count']:_0x33b651[_0xe21e('0x15')]+_0x33b651[_0xe21e('0x16')];var _0x5ece7c;if(_0x5e86da>=_0x454894){_0x5e86da=_0x454894;_0x5ece7c=0xc8;}else{_0x5ece7c=0xce;}_0x108637['status'](_0x5ece7c);return _0x108637[_0xe21e('0x19')]('Content-Range',_0x5e0639+'-'+_0x5e86da+'/'+_0x454894)[_0xe21e('0x14')](_0xceb261);}return null;};}function saveUpdates(_0x12d5c4){return function(_0x33b1ec){if(_0x33b1ec){return _0x33b1ec[_0xe21e('0x1a')](_0x12d5c4)[_0xe21e('0x1b')](function(_0x14664a){return _0x14664a;});}return null;};}function removeEntity(_0x47e889){return function(_0x177f8d){if(_0x177f8d){return _0x177f8d['destroy']()[_0xe21e('0x1b')](function(){_0x47e889[_0xe21e('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41a657){return function(_0x117658){if(!_0x117658){_0x41a657[_0xe21e('0x12')](0x194);}return _0x117658;};}function handleError(_0x42da50,_0x3a649a){_0x3a649a=_0x3a649a||0x1f4;return function(_0x323253){logger[_0xe21e('0x1c')](_0x323253[_0xe21e('0x1d')]);if(_0x323253['name']){delete _0x323253[_0xe21e('0x1e')];}_0x42da50[_0xe21e('0x13')](_0x3a649a)[_0xe21e('0x1f')](_0x323253);};}exports[_0xe21e('0x20')]=function(_0x22dd8c,_0x4fdb43){var _0x117726={};var _0x591447=_[_0xe21e('0x21')](db[_0xe21e('0x22')][_0xe21e('0x23')],function(_0x50b38d){return{'name':_0x50b38d[_0xe21e('0x24')],'type':_0x50b38d[_0xe21e('0x25')]['key']};});_0x117726=qs['getOptions'](_0x591447,_0x22dd8c);return interaction[_0xe21e('0x26')](_0xe21e('0x27'),_0x22dd8c[_0xe21e('0x28')],_0x22dd8c[_0xe21e('0x29')],_0x117726,_0x591447)[_0xe21e('0x1b')](respondWithFilteredResult(_0x4fdb43,_0x117726))[_0xe21e('0x2a')](handleError(_0x4fdb43,null));};exports[_0xe21e('0x2b')]=function(_0x1087d6,_0x5288f3){var _0x229c07={'raw':![],'where':{'id':_0x1087d6[_0xe21e('0x2c')]['id']}},_0x464415={};_0x464415[_0xe21e('0x2d')]=_[_0xe21e('0x2e')](db[_0xe21e('0x22')][_0xe21e('0x23')]);_0x464415[_0xe21e('0x28')]=_['keys'](_0x1087d6[_0xe21e('0x28')]);_0x464415['filters']=_['intersection'](_0x464415[_0xe21e('0x2d')],_0x464415[_0xe21e('0x28')]);_0x229c07['attributes']=_['intersection'](_0x464415[_0xe21e('0x2d')],qs[_0xe21e('0x2f')](_0x1087d6[_0xe21e('0x28')][_0xe21e('0x2f')]));_0x229c07[_0xe21e('0x30')]=_0x229c07[_0xe21e('0x30')][_0xe21e('0x31')]?_0x229c07['attributes']:_0x464415[_0xe21e('0x2d')];if(_0x1087d6[_0xe21e('0x28')][_0xe21e('0x32')]){_0x229c07[_0xe21e('0x33')]=[{'all':!![]}];}_0x229c07=_[_0xe21e('0x34')]({},_0x229c07,_0x1087d6[_0xe21e('0x35')]);return db[_0xe21e('0x22')][_0xe21e('0x36')](_0x229c07)[_0xe21e('0x1b')](handleEntityNotFound(_0x5288f3,null))['then'](respondWithResult(_0x5288f3,null))[_0xe21e('0x2a')](handleError(_0x5288f3,null));};exports[_0xe21e('0x37')]=function(_0x56a31c,_0x23efe2){return db[_0xe21e('0x22')][_0xe21e('0x37')](_0x56a31c['body'],{})['then'](respondWithResult(_0x23efe2,0xc9))[_0xe21e('0x2a')](handleError(_0x23efe2,null));};exports[_0xe21e('0x1a')]=function(_0x1e568a,_0x1f08ca){if(_0x1e568a[_0xe21e('0x38')]['id']){delete _0x1e568a[_0xe21e('0x38')]['id'];}return db[_0xe21e('0x22')][_0xe21e('0x36')]({'where':{'id':_0x1e568a[_0xe21e('0x2c')]['id']}})[_0xe21e('0x1b')](handleEntityNotFound(_0x1f08ca,null))[_0xe21e('0x1b')](saveUpdates(_0x1e568a['body'],null))['then'](respondWithResult(_0x1f08ca,null))['catch'](handleError(_0x1f08ca,null));};exports[_0xe21e('0x39')]=function(_0xabd050,_0x5214a4){return db[_0xe21e('0x22')][_0xe21e('0x36')]({'where':{'id':_0xabd050['params']['id']}})[_0xe21e('0x1b')](handleEntityNotFound(_0x5214a4,null))[_0xe21e('0x1b')](removeEntity(_0x5214a4,null))[_0xe21e('0x2a')](handleError(_0x5214a4,null));};exports[_0xe21e('0x3a')]=function(_0x1dd64,_0x210b5b){return db[_0xe21e('0x22')][_0xe21e('0x3a')]()[_0xe21e('0x1b')](respondWithResult(_0x210b5b,null))[_0xe21e('0x2a')](handleError(_0x210b5b,null));};exports['addMessage']=function(_0x40d300,_0x43399c){return db[_0xe21e('0x3b')][_0xe21e('0x36')]({'where':{'id':_0x40d300['params']['id']}})[_0xe21e('0x1b')](handleEntityNotFound(_0x43399c,null))[_0xe21e('0x1b')](function(_0xb4180){if(_0xb4180){return _0xb4180[_0xe21e('0x3c')](_0x40d300[_0xe21e('0x38')][_0xe21e('0x3d')],_[_0xe21e('0x3e')](_0x40d300[_0xe21e('0x38')],['ids','id'])||{});}})[_0xe21e('0x1b')](respondWithResult(_0x43399c,null))[_0xe21e('0x2a')](handleError(_0x43399c,null));};exports[_0xe21e('0x3f')]=function(_0x41d43b,_0x34bdff){var _0x418b48={'raw':![],'where':{}};var _0x46415d={};var _0x9c8d9b={'count':0x0,'rows':[]};return db[_0xe21e('0x22')][_0xe21e('0x40')]({'where':{'id':_0x41d43b[_0xe21e('0x2c')]['id']}})[_0xe21e('0x1b')](handleEntityNotFound(_0x34bdff,null))[_0xe21e('0x1b')](function(_0x55c8e0){if(_0x55c8e0){_0x46415d[_0xe21e('0x2d')]=_['keys'](db[_0xe21e('0x3b')][_0xe21e('0x23')]);_0x46415d[_0xe21e('0x28')]=_[_0xe21e('0x2e')](_0x41d43b['query']);_0x46415d[_0xe21e('0x41')]=_['intersection'](_0x46415d['model'],_0x46415d[_0xe21e('0x28')]);_0x418b48[_0xe21e('0x30')]=_['intersection'](_0x46415d[_0xe21e('0x2d')],qs['fields'](_0x41d43b['query'][_0xe21e('0x2f')]));_0x418b48[_0xe21e('0x30')]=_0x418b48[_0xe21e('0x30')]['length']?_0x418b48[_0xe21e('0x30')]:_0x46415d[_0xe21e('0x2d')];if(!_0x41d43b[_0xe21e('0x28')]['hasOwnProperty'](_0xe21e('0x42'))){_0x418b48['limit']=qs['limit'](_0x41d43b['query'][_0xe21e('0x16')]);_0x418b48['offset']=qs[_0xe21e('0x15')](_0x41d43b[_0xe21e('0x28')]['offset']);}_0x418b48[_0xe21e('0x43')]=qs[_0xe21e('0x44')](_0x41d43b[_0xe21e('0x28')][_0xe21e('0x44')]);_0x418b48[_0xe21e('0x45')]=qs['filters'](_[_0xe21e('0x46')](_0x41d43b[_0xe21e('0x28')],_0x46415d['filters']));_0x418b48['where'][_0xe21e('0x47')]=_0x55c8e0['id'];if(_0x41d43b[_0xe21e('0x28')][_0xe21e('0x48')]){_0x418b48[_0xe21e('0x45')]=_[_0xe21e('0x34')](_0x418b48[_0xe21e('0x45')],{'$or':_['map'](_0x418b48[_0xe21e('0x30')],function(_0xd079bd){var _0x1f76d2={};_0x1f76d2[_0xd079bd]={'$like':'%'+_0x41d43b[_0xe21e('0x28')][_0xe21e('0x48')]+'%'};return _0x1f76d2;})});}if(_0x41d43b[_0xe21e('0x28')][_0xe21e('0x49')]){var _0x47ab3a=_0x41d43b[_0xe21e('0x28')][_0xe21e('0x49')]['split'](',');var _0xd43e05={};_0xd43e05[_0x47ab3a[0x0]]={'$gte':moment(_0x47ab3a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x418b48[_0xe21e('0x45')]=_['merge'](_0x418b48[_0xe21e('0x45')],_0xd43e05);}_0x418b48=_[_0xe21e('0x34')]({},_0x418b48,_0x41d43b[_0xe21e('0x35')]);return db[_0xe21e('0x3b')][_0xe21e('0x18')]({'where':_0x418b48[_0xe21e('0x45')]})[_0xe21e('0x1b')](function(_0x12bfa2){_0x9c8d9b[_0xe21e('0x18')]=_0x12bfa2;if(_0x41d43b[_0xe21e('0x28')][_0xe21e('0x32')]){_0x418b48[_0xe21e('0x33')]=[{'all':!![]}];}return db[_0xe21e('0x3b')]['findAll'](_0x418b48);})['then'](function(_0x233202){_0x9c8d9b[_0xe21e('0x4a')]=_0x233202;return _0x9c8d9b;});}})[_0xe21e('0x1b')](respondWithFilteredResult(_0x34bdff,_0x418b48))[_0xe21e('0x2a')](handleError(_0x34bdff,null));};exports[_0xe21e('0x4b')]=function(_0x383b7b,_0x5e6d55){return db[_0xe21e('0x22')][_0xe21e('0x36')]({'where':{'id':_0x383b7b['params']['id']}})['then'](handleEntityNotFound(_0x5e6d55,null))[_0xe21e('0x1b')](function(_0x43daef){if(_0x43daef){return _0x43daef[_0xe21e('0x4c')](_0x383b7b['body']['ids'],_['omit'](_0x383b7b['body'],[_0xe21e('0x3d'),'id'])||{})[_0xe21e('0x4d')](function(){return db[_0xe21e('0x4e')][_0xe21e('0x26')]({'attributes':['id',_0xe21e('0x1e'),_0xe21e('0x4f')],'where':{'id':_0x383b7b[_0xe21e('0x38')]['ids']}});})['then'](function(_0x3a3d69){socket[_0xe21e('0x50')](_0xe21e('0x51'),{'id':Number(_0x383b7b[_0xe21e('0x2c')]['id']),'tags':_0x3a3d69||[]});return{'id':Number(_0x383b7b['params']['id']),'tags':_0x3a3d69||[]};});}})[_0xe21e('0x1b')](respondWithResult(_0x5e6d55,null))['catch'](handleError(_0x5e6d55,null));};exports[_0xe21e('0x52')]=function(_0x1d8073,_0x1d7453){return db['SmsInteraction']['find']({'where':{'id':_0x1d8073['params']['id']}})[_0xe21e('0x1b')](handleEntityNotFound(_0x1d7453,null))[_0xe21e('0x1b')](function(_0xf6fe86){if(_0xf6fe86){return _0xf6fe86['removeTags'](_0x1d8073[_0xe21e('0x28')]['ids']);}})[_0xe21e('0x1b')](respondWithStatusCode(_0x1d7453,null))[_0xe21e('0x2a')](handleError(_0x1d7453,null));};exports[_0xe21e('0x53')]=function(_0x1d2a63,_0x955b44){var _0xdbbe59=moment()['unix']()['toString']();var _0x2ecb4f=path['join'](config[_0xe21e('0x54')],'server','files',_0xe21e('0x55'));var _0x43338b=path[_0xe21e('0x56')](_0x2ecb4f,_0xdbbe59);var _0x63f4b3=util[_0xe21e('0x57')](_0xe21e('0x58'),_0x1d2a63[_0xe21e('0x2c')]['id'],_0xdbbe59);var _0x14b805=path[_0xe21e('0x56')](_0x2ecb4f,_0x63f4b3);var _0x5963f0=[];_0x5963f0[_0xe21e('0x59')]({'model':db[_0xe21e('0x5a')],'as':'User','attributes':['id',_0xe21e('0x5b')],'raw':!![]});_0x5963f0[_0xe21e('0x59')]({'model':db[_0xe21e('0x5c')],'as':_0xe21e('0x5d'),'attributes':['id','firstName',_0xe21e('0x5e')],'raw':!![]});var _0x1659ca=[{'model':db[_0xe21e('0x3b')],'as':'Messages','attributes':['id',_0xe21e('0x38'),'createdAt','direction',_0xe21e('0x5f'),_0xe21e('0x60')],'include':_0x5963f0}];_0x1659ca[_0xe21e('0x59')]({'model':db['SmsAccount'],'as':_0xe21e('0x61'),'attributes':['id',_0xe21e('0x1e')]});_0x1659ca[_0xe21e('0x59')]({'model':db[_0xe21e('0x5a')],'as':'Owner','attributes':['id',_0xe21e('0x5b')]});return db['SmsInteraction'][_0xe21e('0x36')]({'where':{'id':_0x1d2a63[_0xe21e('0x2c')]['id']},'include':_0x1659ca})['then'](handleEntityNotFound(_0x955b44,null))[_0xe21e('0x1b')](function(_0x487e9f){if(_0x487e9f){var _0x402f1f=_0x487e9f['get']({'plain':!![]});fs[_0xe21e('0x62')](_0x43338b);var _0x3ff43c={'channel':_0xe21e('0x63'),'account':_0x402f1f['Account'][_0xe21e('0x1e')],'agent':_0x402f1f['Owner']?_0x402f1f[_0xe21e('0x64')]['fullname']:_0xe21e('0x65'),'createdAt':moment(_0x402f1f['createdAt'])[_0xe21e('0x57')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe21e('0x66')](),'closedAt':_0x402f1f[_0xe21e('0x67')]?moment(_0x402f1f[_0xe21e('0x68')])[_0xe21e('0x57')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x402f1f[_0xe21e('0x69')],'messages':_(_0x402f1f[_0xe21e('0x6a')])[_0xe21e('0x48')]({'secret':![]})[_0xe21e('0x21')](function(_0x1fc6b4){return{'date':moment(_0x1fc6b4[_0xe21e('0x6b')])[_0xe21e('0x57')](_0xe21e('0x6c'))[_0xe21e('0x66')](),'sender':_0x1fc6b4[_0xe21e('0x6d')]===_0xe21e('0x6e')?_0x1fc6b4[_0xe21e('0x5a')]?_0x1fc6b4[_0xe21e('0x5a')][_0xe21e('0x5b')]:_0xe21e('0x6f'):_0x1fc6b4['Contact']['firstName']+(_0x1fc6b4['Contact'][_0xe21e('0x5e')]?'\x20'+_0x1fc6b4[_0xe21e('0x5d')][_0xe21e('0x5e')]:''),'body':_0x1fc6b4[_0xe21e('0x38')],'direction':_0x1fc6b4[_0xe21e('0x6d')]===_0xe21e('0x6e')?'A':'C','secret':_0x1fc6b4[_0xe21e('0x5f')],'read':_0x1fc6b4[_0xe21e('0x60')]};})[_0xe21e('0x70')]()};return ejs[_0xe21e('0x71')](path[_0xe21e('0x56')](config['root'],_0xe21e('0x72'),_0xe21e('0x73'),_0xe21e('0x74')),{'interaction':_0x3ff43c})[_0xe21e('0x1b')](function(_0x37d57d){var _0x58d361=path['join'](_0x43338b,_0xe21e('0x75')+_0x402f1f['id']+'-'+_0xdbbe59+_0xe21e('0x76'));var _0x2456c2={'path':_0x58d361,'channel':_0xe21e('0x63'),'interactionId':_0x402f1f['id']};return pdf[_0xe21e('0x77')](_0x37d57d,_0x2456c2);})[_0xe21e('0x1b')](function(){return new BPromise(function(_0x3725ba,_0x4e1ecb){zipdir(_0x43338b,{'saveTo':_0x14b805},function(_0xb91d91,_0x1c46bb){if(_0xb91d91)return _0x4e1ecb(_0xb91d91);return _0x3725ba(_0x1c46bb);});})[_0xe21e('0x1b')](function(){return new BPromise(function(_0x4cc9b7,_0x1195d2){rimraf(_0x43338b,function(_0x42b4ba){if(_0x42b4ba)_0x1195d2(_0x42b4ba);return _0x4cc9b7();});});})[_0xe21e('0x1b')](function(){return _0x955b44[_0xe21e('0x53')](_0x14b805,_0x63f4b3,function(_0x136245){if(_0x136245){console[_0xe21e('0x78')](_0xe21e('0x79'),_0x136245);}else{fs[_0xe21e('0x7a')](_0x14b805);}});});});}else{return _0x955b44['sendStatus'](0xc8);}})[_0xe21e('0x2a')](handleError(_0x955b44,null));}; \ No newline at end of file +var _0x4718=['firstName','lastName','Messages','secret','read','SmsAccount','Account','Owner','fullname','get','mkdirSync','N.A.','toString','closedAt','disposition','createdAt','direction','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','download','err','unlinkSync','sendStatus','rimraf','zip-dir','moment','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','name','index','map','SmsInteraction','type','key','getOptions','findAll','sms','user','catch','show','params','keys','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','SmsMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','where','SmsInteractionId','filter','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','Tag','color','emit','smsInteractionTags:save','root','server','files','tmp','join','User','push','Contact'];(function(_0x1572ad,_0x258d46){var _0xd8eb80=function(_0x4bd2c3){while(--_0x4bd2c3){_0x1572ad['push'](_0x1572ad['shift']());}};_0xd8eb80(++_0x258d46);}(_0x4718,0x18d));var _0x8471=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4718[_0xfae23b];return _0x200640;};'use strict';var rimraf=require(_0x8471('0x0'));var zipdir=require(_0x8471('0x1'));var moment=require(_0x8471('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x8471('0x3'));var ejs=require(_0x8471('0x4'));var fs=require('fs');var _=require(_0x8471('0x5'));var Redis=require(_0x8471('0x6'));var interaction=require(_0x8471('0x7'));var qs=require(_0x8471('0x8'));var pdf=require(_0x8471('0x9'));var logger=require(_0x8471('0xa'))(_0x8471('0xb'));var config=require('../../config/environment');var db=require(_0x8471('0xc'))['db'];config[_0x8471('0xd')]=_[_0x8471('0xe')](config[_0x8471('0xd')],{'host':_0x8471('0xf'),'port':0x18eb});var socket=require(_0x8471('0x10'))(new Redis(config[_0x8471('0xd')]));require(_0x8471('0x11'))[_0x8471('0x12')](socket);function respondWithStatusCode(_0x194b7e,_0x8a4af6){_0x8a4af6=_0x8a4af6||0xcc;return function(_0x367cc3){if(_0x367cc3){return _0x194b7e['sendStatus'](_0x8a4af6);}return _0x194b7e[_0x8471('0x13')](_0x8a4af6)[_0x8471('0x14')]();};}function respondWithResult(_0x158b39,_0x22d9a7){_0x22d9a7=_0x22d9a7||0xc8;return function(_0x4edc01){if(_0x4edc01){return _0x158b39['status'](_0x22d9a7)[_0x8471('0x15')](_0x4edc01);}};}function respondWithFilteredResult(_0xb08f7e,_0x20af6c){return function(_0x371432){if(_0x371432){var _0x30e13e=typeof _0x20af6c[_0x8471('0x16')]===_0x8471('0x17')&&typeof _0x20af6c[_0x8471('0x18')]==='undefined';var _0x140155=_0x371432[_0x8471('0x19')];var _0x28edfc=_0x30e13e?0x0:_0x20af6c[_0x8471('0x16')];var _0x5d5a87=_0x30e13e?_0x371432[_0x8471('0x19')]:_0x20af6c[_0x8471('0x16')]+_0x20af6c[_0x8471('0x18')];var _0x1ad655;if(_0x5d5a87>=_0x140155){_0x5d5a87=_0x140155;_0x1ad655=0xc8;}else{_0x1ad655=0xce;}_0xb08f7e[_0x8471('0x13')](_0x1ad655);return _0xb08f7e[_0x8471('0x1a')](_0x8471('0x1b'),_0x28edfc+'-'+_0x5d5a87+'/'+_0x140155)[_0x8471('0x15')](_0x371432);}return null;};}function saveUpdates(_0x6024c2){return function(_0x2b2391){if(_0x2b2391){return _0x2b2391['update'](_0x6024c2)[_0x8471('0x1c')](function(_0x4d5347){return _0x4d5347;});}return null;};}function removeEntity(_0x1d587a){return function(_0x29470b){if(_0x29470b){return _0x29470b[_0x8471('0x1d')]()[_0x8471('0x1c')](function(){_0x1d587a['status'](0xcc)[_0x8471('0x14')]();});}};}function handleEntityNotFound(_0x3da7f7){return function(_0x4da0e0){if(!_0x4da0e0){_0x3da7f7['sendStatus'](0x194);}return _0x4da0e0;};}function handleError(_0x216668,_0x36e702){_0x36e702=_0x36e702||0x1f4;return function(_0x1cc676){logger[_0x8471('0x1e')](_0x1cc676['stack']);if(_0x1cc676[_0x8471('0x1f')]){delete _0x1cc676[_0x8471('0x1f')];}_0x216668[_0x8471('0x13')](_0x36e702)['send'](_0x1cc676);};}exports[_0x8471('0x20')]=function(_0x45bb53,_0x2e9a5e){var _0x46eb7c={};var _0x26ede7=_[_0x8471('0x21')](db[_0x8471('0x22')]['rawAttributes'],function(_0x1ff0a8){return{'name':_0x1ff0a8['fieldName'],'type':_0x1ff0a8[_0x8471('0x23')][_0x8471('0x24')]};});_0x46eb7c=qs[_0x8471('0x25')](_0x26ede7,_0x45bb53);return interaction[_0x8471('0x26')](_0x8471('0x27'),_0x45bb53['query'],_0x45bb53[_0x8471('0x28')],_0x46eb7c,_0x26ede7)[_0x8471('0x1c')](respondWithFilteredResult(_0x2e9a5e,_0x46eb7c))[_0x8471('0x29')](handleError(_0x2e9a5e,null));};exports[_0x8471('0x2a')]=function(_0xd3e6a9,_0x4be426){var _0x266266={'raw':![],'where':{'id':_0xd3e6a9[_0x8471('0x2b')]['id']}},_0x430798={};_0x430798['model']=_[_0x8471('0x2c')](db[_0x8471('0x22')][_0x8471('0x2d')]);_0x430798['query']=_[_0x8471('0x2c')](_0xd3e6a9[_0x8471('0x2e')]);_0x430798[_0x8471('0x2f')]=_[_0x8471('0x30')](_0x430798['model'],_0x430798[_0x8471('0x2e')]);_0x266266[_0x8471('0x31')]=_['intersection'](_0x430798[_0x8471('0x32')],qs['fields'](_0xd3e6a9[_0x8471('0x2e')][_0x8471('0x33')]));_0x266266[_0x8471('0x31')]=_0x266266[_0x8471('0x31')][_0x8471('0x34')]?_0x266266[_0x8471('0x31')]:_0x430798['model'];if(_0xd3e6a9[_0x8471('0x2e')][_0x8471('0x35')]){_0x266266[_0x8471('0x36')]=[{'all':!![]}];}_0x266266=_[_0x8471('0x37')]({},_0x266266,_0xd3e6a9[_0x8471('0x38')]);return db[_0x8471('0x22')][_0x8471('0x39')](_0x266266)[_0x8471('0x1c')](handleEntityNotFound(_0x4be426,null))['then'](respondWithResult(_0x4be426,null))[_0x8471('0x29')](handleError(_0x4be426,null));};exports[_0x8471('0x3a')]=function(_0x1b8043,_0x41c0e8){return db[_0x8471('0x22')][_0x8471('0x3a')](_0x1b8043['body'],{})[_0x8471('0x1c')](respondWithResult(_0x41c0e8,0xc9))['catch'](handleError(_0x41c0e8,null));};exports['update']=function(_0x389f15,_0x1785e9){if(_0x389f15['body']['id']){delete _0x389f15[_0x8471('0x3b')]['id'];}return db['SmsInteraction'][_0x8471('0x39')]({'where':{'id':_0x389f15['params']['id']}})[_0x8471('0x1c')](handleEntityNotFound(_0x1785e9,null))[_0x8471('0x1c')](saveUpdates(_0x389f15[_0x8471('0x3b')],null))['then'](respondWithResult(_0x1785e9,null))[_0x8471('0x29')](handleError(_0x1785e9,null));};exports[_0x8471('0x1d')]=function(_0x437044,_0x122915){return db[_0x8471('0x22')]['find']({'where':{'id':_0x437044[_0x8471('0x2b')]['id']}})['then'](handleEntityNotFound(_0x122915,null))[_0x8471('0x1c')](removeEntity(_0x122915,null))[_0x8471('0x29')](handleError(_0x122915,null));};exports[_0x8471('0x3c')]=function(_0x489c22,_0x57d69c){return db['SmsInteraction'][_0x8471('0x3c')]()['then'](respondWithResult(_0x57d69c,null))[_0x8471('0x29')](handleError(_0x57d69c,null));};exports[_0x8471('0x3d')]=function(_0x2da16a,_0x4cb3a5){return db[_0x8471('0x3e')]['find']({'where':{'id':_0x2da16a['params']['id']}})[_0x8471('0x1c')](handleEntityNotFound(_0x4cb3a5,null))[_0x8471('0x1c')](function(_0x2acd60){if(_0x2acd60){return _0x2acd60['addMessage'](_0x2da16a[_0x8471('0x3b')]['ids'],_['omit'](_0x2da16a['body'],[_0x8471('0x3f'),'id'])||{});}})[_0x8471('0x1c')](respondWithResult(_0x4cb3a5,null))[_0x8471('0x29')](handleError(_0x4cb3a5,null));};exports[_0x8471('0x40')]=function(_0x47242c,_0x115e2c){var _0x540220={'raw':![],'where':{}};var _0x6fbc1c={};var _0x34df0d={'count':0x0,'rows':[]};return db[_0x8471('0x22')][_0x8471('0x41')]({'where':{'id':_0x47242c[_0x8471('0x2b')]['id']}})['then'](handleEntityNotFound(_0x115e2c,null))['then'](function(_0x3fbd7b){if(_0x3fbd7b){_0x6fbc1c['model']=_['keys'](db[_0x8471('0x3e')][_0x8471('0x2d')]);_0x6fbc1c[_0x8471('0x2e')]=_[_0x8471('0x2c')](_0x47242c[_0x8471('0x2e')]);_0x6fbc1c[_0x8471('0x2f')]=_[_0x8471('0x30')](_0x6fbc1c[_0x8471('0x32')],_0x6fbc1c[_0x8471('0x2e')]);_0x540220[_0x8471('0x31')]=_['intersection'](_0x6fbc1c[_0x8471('0x32')],qs['fields'](_0x47242c['query']['fields']));_0x540220[_0x8471('0x31')]=_0x540220[_0x8471('0x31')][_0x8471('0x34')]?_0x540220[_0x8471('0x31')]:_0x6fbc1c[_0x8471('0x32')];if(!_0x47242c[_0x8471('0x2e')][_0x8471('0x42')](_0x8471('0x43'))){_0x540220['limit']=qs['limit'](_0x47242c[_0x8471('0x2e')]['limit']);_0x540220[_0x8471('0x16')]=qs['offset'](_0x47242c[_0x8471('0x2e')]['offset']);}_0x540220['order']=qs['sort'](_0x47242c[_0x8471('0x2e')]['sort']);_0x540220[_0x8471('0x44')]=qs[_0x8471('0x2f')](_['pick'](_0x47242c[_0x8471('0x2e')],_0x6fbc1c[_0x8471('0x2f')]));_0x540220['where'][_0x8471('0x45')]=_0x3fbd7b['id'];if(_0x47242c[_0x8471('0x2e')][_0x8471('0x46')]){_0x540220['where']=_['merge'](_0x540220[_0x8471('0x44')],{'$or':_[_0x8471('0x21')](_0x540220[_0x8471('0x31')],function(_0x2e1079){var _0x2be6a6={};_0x2be6a6[_0x2e1079]={'$like':'%'+_0x47242c[_0x8471('0x2e')][_0x8471('0x46')]+'%'};return _0x2be6a6;})});}if(_0x47242c['query']['$gte']){var _0x49c511=_0x47242c[_0x8471('0x2e')]['$gte'][_0x8471('0x47')](',');var _0x383bcf={};_0x383bcf[_0x49c511[0x0]]={'$gte':moment(_0x49c511[0x1])[_0x8471('0x48')](_0x8471('0x49'))};_0x540220[_0x8471('0x44')]=_[_0x8471('0x37')](_0x540220[_0x8471('0x44')],_0x383bcf);}_0x540220=_[_0x8471('0x37')]({},_0x540220,_0x47242c[_0x8471('0x38')]);return db[_0x8471('0x3e')][_0x8471('0x19')]({'where':_0x540220[_0x8471('0x44')]})[_0x8471('0x1c')](function(_0x132e49){_0x34df0d[_0x8471('0x19')]=_0x132e49;if(_0x47242c[_0x8471('0x2e')][_0x8471('0x35')]){_0x540220[_0x8471('0x36')]=[{'all':!![]}];}return db[_0x8471('0x3e')][_0x8471('0x26')](_0x540220);})[_0x8471('0x1c')](function(_0x2cb4a1){_0x34df0d[_0x8471('0x4a')]=_0x2cb4a1;return _0x34df0d;});}})[_0x8471('0x1c')](respondWithFilteredResult(_0x115e2c,_0x540220))[_0x8471('0x29')](handleError(_0x115e2c,null));};exports[_0x8471('0x4b')]=function(_0x30be15,_0x23bbb3){return db[_0x8471('0x22')][_0x8471('0x39')]({'where':{'id':_0x30be15[_0x8471('0x2b')]['id']}})[_0x8471('0x1c')](handleEntityNotFound(_0x23bbb3,null))[_0x8471('0x1c')](function(_0x2915bb){if(_0x2915bb){return _0x2915bb[_0x8471('0x4c')](_0x30be15['body']['ids'],_[_0x8471('0x4d')](_0x30be15[_0x8471('0x3b')],[_0x8471('0x3f'),'id'])||{})[_0x8471('0x4e')](function(){return db[_0x8471('0x4f')][_0x8471('0x26')]({'attributes':['id','name',_0x8471('0x50')],'where':{'id':_0x30be15[_0x8471('0x3b')][_0x8471('0x3f')]}});})[_0x8471('0x1c')](function(_0x562c9f){socket[_0x8471('0x51')](_0x8471('0x52'),{'id':Number(_0x30be15['params']['id']),'tags':_0x562c9f||[]});return{'id':Number(_0x30be15[_0x8471('0x2b')]['id']),'tags':_0x562c9f||[]};});}})[_0x8471('0x1c')](respondWithResult(_0x23bbb3,null))[_0x8471('0x29')](handleError(_0x23bbb3,null));};exports['removeTags']=function(_0x37c811,_0x3a4280){return db[_0x8471('0x22')][_0x8471('0x39')]({'where':{'id':_0x37c811[_0x8471('0x2b')]['id']}})[_0x8471('0x1c')](handleEntityNotFound(_0x3a4280,null))[_0x8471('0x1c')](function(_0x432682){if(_0x432682){return _0x432682['removeTags'](_0x37c811[_0x8471('0x2e')][_0x8471('0x3f')]);}})[_0x8471('0x1c')](respondWithStatusCode(_0x3a4280,null))['catch'](handleError(_0x3a4280,null));};exports['download']=function(_0x18fc5c,_0x1e298d){var _0x954b97=moment()['unix']()['toString']();var _0x29b39d=path['join'](config[_0x8471('0x53')],_0x8471('0x54'),_0x8471('0x55'),_0x8471('0x56'));var _0x265512=path[_0x8471('0x57')](_0x29b39d,_0x954b97);var _0x5f54f1=util[_0x8471('0x48')]('transcript-%d-%s.zip',_0x18fc5c['params']['id'],_0x954b97);var _0x24dd2d=path[_0x8471('0x57')](_0x29b39d,_0x5f54f1);var _0x10a2e4=[];_0x10a2e4['push']({'model':db[_0x8471('0x58')],'as':_0x8471('0x58'),'attributes':['id','fullname'],'raw':!![]});_0x10a2e4[_0x8471('0x59')]({'model':db['CmContact'],'as':_0x8471('0x5a'),'attributes':['id',_0x8471('0x5b'),_0x8471('0x5c')],'raw':!![]});var _0x2fa7f4=[{'model':db[_0x8471('0x3e')],'as':_0x8471('0x5d'),'attributes':['id',_0x8471('0x3b'),'createdAt','direction',_0x8471('0x5e'),_0x8471('0x5f')],'include':_0x10a2e4}];_0x2fa7f4[_0x8471('0x59')]({'model':db[_0x8471('0x60')],'as':_0x8471('0x61'),'attributes':['id','name']});_0x2fa7f4[_0x8471('0x59')]({'model':db['User'],'as':_0x8471('0x62'),'attributes':['id',_0x8471('0x63')]});return db[_0x8471('0x22')][_0x8471('0x39')]({'where':{'id':_0x18fc5c[_0x8471('0x2b')]['id']},'include':_0x2fa7f4})[_0x8471('0x1c')](handleEntityNotFound(_0x1e298d,null))['then'](function(_0x2d12a6){if(_0x2d12a6){var _0x2d7756=_0x2d12a6[_0x8471('0x64')]({'plain':!![]});fs[_0x8471('0x65')](_0x265512);var _0x44f847={'channel':'Sms','account':_0x2d7756['Account'][_0x8471('0x1f')],'agent':_0x2d7756[_0x8471('0x62')]?_0x2d7756[_0x8471('0x62')][_0x8471('0x63')]:_0x8471('0x66'),'createdAt':moment(_0x2d7756['createdAt'])['format'](_0x8471('0x49'))[_0x8471('0x67')](),'closedAt':_0x2d7756['closed']?moment(_0x2d7756[_0x8471('0x68')])[_0x8471('0x48')](_0x8471('0x49'))[_0x8471('0x67')]():'','disposition':_0x2d7756[_0x8471('0x69')],'messages':_(_0x2d7756[_0x8471('0x5d')])['filter']({'secret':![]})['map'](function(_0x5892ce){return{'date':moment(_0x5892ce[_0x8471('0x6a')])['format'](_0x8471('0x49'))['toString'](),'sender':_0x5892ce[_0x8471('0x6b')]===_0x8471('0x6c')?_0x5892ce[_0x8471('0x58')]?_0x5892ce[_0x8471('0x58')]['fullname']:_0x8471('0x6d'):_0x5892ce['Contact'][_0x8471('0x5b')]+(_0x5892ce[_0x8471('0x5a')][_0x8471('0x5c')]?'\x20'+_0x5892ce[_0x8471('0x5a')]['lastName']:''),'body':_0x5892ce[_0x8471('0x3b')],'direction':_0x5892ce['direction']===_0x8471('0x6c')?'A':'C','secret':_0x5892ce[_0x8471('0x5e')],'read':_0x5892ce[_0x8471('0x5f')]};})[_0x8471('0x6e')]()};return ejs[_0x8471('0x6f')](path['join'](config['root'],_0x8471('0x54'),_0x8471('0x70'),_0x8471('0x71')),{'interaction':_0x44f847})[_0x8471('0x1c')](function(_0x357631){var _0x125fd8=path[_0x8471('0x57')](_0x265512,_0x8471('0x72')+_0x2d7756['id']+'-'+_0x954b97+_0x8471('0x73'));var _0x2f9842={'path':_0x125fd8,'channel':_0x8471('0x74'),'interactionId':_0x2d7756['id']};return pdf[_0x8471('0x75')](_0x357631,_0x2f9842);})[_0x8471('0x1c')](function(){return new BPromise(function(_0x1fea14,_0x407413){zipdir(_0x265512,{'saveTo':_0x24dd2d},function(_0x900541,_0x30ee00){if(_0x900541)return _0x407413(_0x900541);return _0x1fea14(_0x30ee00);});})[_0x8471('0x1c')](function(){return new BPromise(function(_0x2d0afd,_0x856edd){rimraf(_0x265512,function(_0x166399){if(_0x166399)_0x856edd(_0x166399);return _0x2d0afd();});});})[_0x8471('0x1c')](function(){return _0x1e298d[_0x8471('0x76')](_0x24dd2d,_0x5f54f1,function(_0xbce051){if(_0xbce051){console['log'](_0x8471('0x77'),_0xbce051);}else{fs[_0x8471('0x78')](_0x24dd2d);}});});});}else{return _0x1e298d[_0x8471('0x79')](0xc8);}})[_0x8471('0x29')](handleError(_0x1e298d,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index c826539..9165959 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 _0x236c=['length','emit','catch','hasOwnProperty','exports','events','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','remove','getUsers','setDataValue','findAll','unreadMessages'];(function(_0x5a4dde,_0x5327fa){var _0x52bfba=function(_0x421c4e){while(--_0x421c4e){_0x5a4dde['push'](_0x5a4dde['shift']());}};_0x52bfba(++_0x5327fa);}(_0x236c,0x155));var _0xc236=function(_0x5f044d,_0xd31e46){_0x5f044d=_0x5f044d-0x0;var _0x4e5f84=_0x236c[_0x5f044d];return _0x4e5f84;};'use strict';var EventEmitter=require(_0xc236('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xc236('0x1')];var SmsMessage=require(_0xc236('0x2'))['db'][_0xc236('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc236('0x4')](0x0);var events={'afterCreate':_0xc236('0x5'),'afterUpdate':'update','afterDestroy':_0xc236('0x6')};function emitEvent(_0x36e87d){return function(_0x33bc57,_0xd582f6,_0x23d3cc){_0x33bc57[_0xc236('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xd612c6){_0x33bc57[_0xc236('0x8')]('Users',_0xd612c6['map'](function(_0x5cdee5){return{'id':_0x5cdee5['id']};}));return SmsMessage[_0xc236('0x9')]({'where':{'SmsInteractionId':_0x33bc57['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x30a28d){_0x33bc57[_0xc236('0x8')](_0xc236('0xa'),_0x30a28d[_0xc236('0xb')]);SmsInteractionEvents[_0xc236('0xc')](_0x36e87d+':'+_0x33bc57['id'],_0x33bc57);SmsInteractionEvents['emit'](_0x36e87d,_0x33bc57);_0x23d3cc(null);})[_0xc236('0xd')](_0x23d3cc(null));};}for(var e in events){if(events[_0xc236('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc236('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0xfef3=['setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','SmsInteraction','SmsMessage','setMaxListeners','update','remove','getUsers','then'];(function(_0xe4a8c1,_0x40ca36){var _0x359e24=function(_0x4e8569){while(--_0x4e8569){_0xe4a8c1['push'](_0xe4a8c1['shift']());}};_0x359e24(++_0x40ca36);}(_0xfef3,0x118));var _0x3fef=function(_0x3d754d,_0x71aad){_0x3d754d=_0x3d754d-0x0;var _0x59f912=_0xfef3[_0x3d754d];return _0x59f912;};'use strict';var EventEmitter=require(_0x3fef('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x3fef('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x3fef('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x3fef('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3fef('0x4'),'afterDestroy':_0x3fef('0x5')};function emitEvent(_0x538f28){return function(_0x2f88b8,_0x1351b1,_0x5dd9fb){_0x2f88b8[_0x3fef('0x6')]({'attributes':['id'],'raw':!![]})[_0x3fef('0x7')](function(_0x800850){_0x2f88b8[_0x3fef('0x8')](_0x3fef('0x9'),_0x800850[_0x3fef('0xa')](function(_0x356ad8){return{'id':_0x356ad8['id']};}));return SmsMessage[_0x3fef('0xb')]({'where':{'SmsInteractionId':_0x2f88b8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3fef('0x7')](function(_0x307586){_0x2f88b8[_0x3fef('0x8')](_0x3fef('0xc'),_0x307586[_0x3fef('0xd')]);SmsInteractionEvents[_0x3fef('0xe')](_0x538f28+':'+_0x2f88b8['id'],_0x2f88b8);SmsInteractionEvents['emit'](_0x538f28,_0x2f88b8);_0x5dd9fb(null);})[_0x3fef('0xf')](_0x5dd9fb(null));};}for(var e in events){if(events[_0x3fef('0x10')](e)){var event=events[e];SmsInteraction[_0x3fef('0x11')](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 b615a0f..95f7e0e 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 _0x233a=['path','../../config/environment','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x19478d,_0x649afe){var _0x44bf69=function(_0x466667){while(--_0x466667){_0x19478d['push'](_0x19478d['shift']());}};_0x44bf69(++_0x649afe);}(_0x233a,0x17a));var _0xa233=function(_0x1ef0ee,_0x2b260a){_0x1ef0ee=_0x1ef0ee-0x0;var _0x1af4e8=_0x233a[_0x1ef0ee];return _0x1af4e8;};'use strict';var _=require(_0xa233('0x0'));var util=require(_0xa233('0x1'));var logger=require(_0xa233('0x2'))('api');var moment=require(_0xa233('0x3'));var BPromise=require(_0xa233('0x4'));var rp=require(_0xa233('0x5'));var fs=require('fs');var path=require(_0xa233('0x6'));var rimraf=require('rimraf');var config=require(_0xa233('0x7'));var attributes=require('./smsInteraction.attributes');module[_0xa233('0x8')]=function(_0x267a5d,_0x4338f8){return _0x267a5d[_0xa233('0x9')](_0xa233('0xa'),attributes,{'tableName':_0xa233('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45be72,_0x5c1677,_0x8cb410){if(_0x45be72[_0xa233('0xc')](_0xa233('0xd'))){_0x45be72[_0xa233('0xe')]=moment()['format'](_0xa233('0xf'));}_0x8cb410(null,_0x45be72);}}});}; \ No newline at end of file +var _0x4df3=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','SmsInteraction','sms_interactions','closedAt','format'];(function(_0x5b4f98,_0x4e2213){var _0x1f5022=function(_0x32b3f5){while(--_0x32b3f5){_0x5b4f98['push'](_0x5b4f98['shift']());}};_0x1f5022(++_0x4e2213);}(_0x4df3,0x155));var _0x34df=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0x4df3[_0x40df5f];return _0x1573f1;};'use strict';var _=require(_0x34df('0x0'));var util=require(_0x34df('0x1'));var logger=require(_0x34df('0x2'))('api');var moment=require('moment');var BPromise=require(_0x34df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34df('0x4'));var rimraf=require(_0x34df('0x5'));var config=require(_0x34df('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x3fe842,_0x1e4daf){return _0x3fe842['define'](_0x34df('0x7'),attributes,{'tableName':_0x34df('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3814b0,_0x5ce58d,_0x5628d2){if(_0x3814b0['changed']('closed')){_0x3814b0[_0x34df('0x9')]=moment()[_0x34df('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5628d2(null,_0x3814b0);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 71dc102..2a2397e 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 _0x2de5=['client','redis','defaults','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','raw','options','where','limit','find','addTags','body','omit','ids','spread','AddTags','stringify','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x2de5,0x13f));var _0x52de=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x2de5[_0xf2628e];return _0x13863a;};'use strict';var _=require(_0x52de('0x0'));var util=require('util');var moment=require(_0x52de('0x1'));var BPromise=require(_0x52de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52de('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x52de('0x4'));var logger=require(_0x52de('0x5'))(_0x52de('0x6'));var config=require(_0x52de('0x7'));var jayson=require(_0x52de('0x8'));var client=jayson[_0x52de('0x9')]['http']({'port':0x232a});config[_0x52de('0xa')]=_[_0x52de('0xb')](config[_0x52de('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x52de('0xc'))[_0x52de('0xd')](socket);function respondWithRpcPromise(_0x314781,_0x113d8b,_0x3a20cc){return new BPromise(function(_0x1b36e1,_0x46d552){return client[_0x52de('0xe')](_0x314781,_0x3a20cc)[_0x52de('0xf')](function(_0x1fda12){logger[_0x52de('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x113d8b,_0x52de('0x11'));logger[_0x52de('0x12')](_0x52de('0x13'),_0x113d8b,_0x52de('0x11'),JSON['stringify'](_0x1fda12));if(_0x1fda12['error']){if(_0x1fda12[_0x52de('0x14')][_0x52de('0x15')]===0x1f4){logger[_0x52de('0x14')](_0x52de('0x16'),_0x113d8b,_0x1fda12['error'][_0x52de('0x17')]);return _0x46d552(_0x1fda12[_0x52de('0x14')][_0x52de('0x17')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x113d8b,_0x1fda12[_0x52de('0x14')][_0x52de('0x17')]);return _0x1b36e1(_0x1fda12[_0x52de('0x14')][_0x52de('0x17')]);}else{logger[_0x52de('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x113d8b,_0x52de('0x11'));_0x1b36e1(_0x1fda12[_0x52de('0x18')][_0x52de('0x17')]);}})[_0x52de('0x19')](function(_0x25ed90){logger[_0x52de('0x14')](_0x52de('0x16'),_0x113d8b,_0x25ed90);_0x46d552(_0x25ed90);});});}exports[_0x52de('0x1a')]=function(_0x2ea061){var _0x471f4a=this;return new Promise(function(_0x326a11,_0x2d8642){return db[_0x52de('0x1b')][_0x52de('0x1c')](_0x2ea061['body'],{'raw':_0x2ea061['options']?_0x2ea061['options'][_0x52de('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ea061['options']?_0x2ea061[_0x52de('0x1e')][_0x52de('0x1f')]||null:null,'attributes':_0x2ea061['options']?_0x2ea061[_0x52de('0x1e')]['attributes']||null:null,'limit':_0x2ea061[_0x52de('0x1e')]?_0x2ea061[_0x52de('0x1e')][_0x52de('0x20')]||null:null})[_0x52de('0xf')](function(_0x2050c4){logger[_0x52de('0x10')](_0x52de('0x1a'),_0x2ea061);logger['debug'](_0x52de('0x1a'),_0x2ea061,JSON['stringify'](_0x2050c4));_0x326a11(_0x2050c4);})[_0x52de('0x19')](function(_0x3eea8b){logger['error'](_0x52de('0x1a'),_0x3eea8b[_0x52de('0x17')],_0x2ea061);_0x2d8642(_0x471f4a[_0x52de('0x14')](0x1f4,_0x3eea8b[_0x52de('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x3493f3){return new Promise(function(_0x3ddacf,_0x22cd62){return db[_0x52de('0x1b')][_0x52de('0x21')]({'where':_0x3493f3[_0x52de('0x1e')]?_0x3493f3[_0x52de('0x1e')]['where']||null:null})[_0x52de('0xf')](function(_0x38c226){if(_0x38c226){return _0x38c226[_0x52de('0x22')](_0x3493f3[_0x52de('0x23')]['ids'],_[_0x52de('0x24')](_0x3493f3['body'],[_0x52de('0x25'),'id'])||{});}})[_0x52de('0x26')](function(_0x235b1c){logger['info'](_0x52de('0x27'),_0x3493f3);logger['debug'](_0x52de('0x27'),_0x3493f3,JSON[_0x52de('0x28')](_0x235b1c));_0x3ddacf(_0x235b1c);})[_0x52de('0x19')](function(_0x180f24){logger['error'](_0x52de('0x27'),_0x180f24['message'],_0x3493f3);_0x22cd62(_this[_0x52de('0x14')](0x1f4,_0x180f24[_0x52de('0x17')]));});});}; \ No newline at end of file +var _0x0ff9=['catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0x0ff9,0x182));var _0x90ff=function(_0x4fa07d,_0x3e23c8){_0x4fa07d=_0x4fa07d-0x0;var _0x582c26=_0x0ff9[_0x4fa07d];return _0x582c26;};'use strict';var _=require('lodash');var util=require(_0x90ff('0x0'));var moment=require('moment');var BPromise=require(_0x90ff('0x1'));var rs=require(_0x90ff('0x2'));var fs=require('fs');var Redis=require(_0x90ff('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x90ff('0x4'));var logger=require(_0x90ff('0x5'))(_0x90ff('0x6'));var config=require(_0x90ff('0x7'));var jayson=require(_0x90ff('0x8'));var client=jayson[_0x90ff('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x90ff('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x90ff('0xb'))(new Redis(config[_0x90ff('0xa')]));require(_0x90ff('0xc'))['register'](socket);function respondWithRpcPromise(_0x2dfa20,_0x28e197,_0x3929a6){return new BPromise(function(_0x1b7678,_0x4745b9){return client[_0x90ff('0xd')](_0x2dfa20,_0x3929a6)[_0x90ff('0xe')](function(_0x2d713a){logger[_0x90ff('0xf')](_0x90ff('0x10'),_0x28e197,_0x90ff('0x11'));logger[_0x90ff('0x12')](_0x90ff('0x13'),_0x28e197,_0x90ff('0x11'),JSON['stringify'](_0x2d713a));if(_0x2d713a[_0x90ff('0x14')]){if(_0x2d713a[_0x90ff('0x14')][_0x90ff('0x15')]===0x1f4){logger['error'](_0x90ff('0x10'),_0x28e197,_0x2d713a[_0x90ff('0x14')]['message']);return _0x4745b9(_0x2d713a[_0x90ff('0x14')][_0x90ff('0x16')]);}logger[_0x90ff('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x28e197,_0x2d713a[_0x90ff('0x14')][_0x90ff('0x16')]);return _0x1b7678(_0x2d713a[_0x90ff('0x14')][_0x90ff('0x16')]);}else{logger['info'](_0x90ff('0x10'),_0x28e197,_0x90ff('0x11'));_0x1b7678(_0x2d713a[_0x90ff('0x17')]['message']);}})[_0x90ff('0x18')](function(_0x5cc98f){logger[_0x90ff('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x28e197,_0x5cc98f);_0x4745b9(_0x5cc98f);});});}exports[_0x90ff('0x19')]=function(_0x1e82af){var _0x3a20e1=this;return new Promise(function(_0x397ba6,_0x38669d){return db[_0x90ff('0x1a')][_0x90ff('0x1b')](_0x1e82af['body'],{'raw':_0x1e82af[_0x90ff('0x1c')]?_0x1e82af[_0x90ff('0x1c')][_0x90ff('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e82af[_0x90ff('0x1c')]?_0x1e82af[_0x90ff('0x1c')][_0x90ff('0x1e')]||null:null,'attributes':_0x1e82af[_0x90ff('0x1c')]?_0x1e82af[_0x90ff('0x1c')][_0x90ff('0x1f')]||null:null,'limit':_0x1e82af[_0x90ff('0x1c')]?_0x1e82af['options'][_0x90ff('0x20')]||null:null})[_0x90ff('0xe')](function(_0x236f77){logger['info'](_0x90ff('0x19'),_0x1e82af);logger[_0x90ff('0x12')](_0x90ff('0x19'),_0x1e82af,JSON['stringify'](_0x236f77));_0x397ba6(_0x236f77);})[_0x90ff('0x18')](function(_0x34709a){logger[_0x90ff('0x14')](_0x90ff('0x19'),_0x34709a[_0x90ff('0x16')],_0x1e82af);_0x38669d(_0x3a20e1['error'](0x1f4,_0x34709a[_0x90ff('0x16')]));});});};exports[_0x90ff('0x21')]=function(_0x54d672){return new Promise(function(_0x23550c,_0x27b956){return db[_0x90ff('0x1a')][_0x90ff('0x22')]({'where':_0x54d672[_0x90ff('0x1c')]?_0x54d672[_0x90ff('0x1c')][_0x90ff('0x1e')]||null:null})[_0x90ff('0xe')](function(_0x3a0a28){if(_0x3a0a28){return _0x3a0a28[_0x90ff('0x23')](_0x54d672[_0x90ff('0x24')][_0x90ff('0x25')],_[_0x90ff('0x26')](_0x54d672[_0x90ff('0x24')],[_0x90ff('0x25'),'id'])||{});}})[_0x90ff('0x27')](function(_0x4901b0){logger['info'](_0x90ff('0x28'),_0x54d672);logger[_0x90ff('0x12')]('AddTags',_0x54d672,JSON['stringify'](_0x4901b0));_0x23550c(_0x4901b0);})[_0x90ff('0x18')](function(_0x29faf1){logger['error'](_0x90ff('0x28'),_0x29faf1[_0x90ff('0x16')],_0x54d672);_0x27b956(_this[_0x90ff('0x14')](0x1f4,_0x29faf1['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 9602bc2..c7c03f8 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 _0x88aa=['removeListener','register','length','smsInteraction:','./smsInteraction.events','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88aa,0x66));var _0xa88a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x88aa[_0x4565bf];return _0x5610ba;};'use strict';var SmsInteractionEvents=require(_0xa88a('0x0'));var events=['save',_0xa88a('0x1'),_0xa88a('0x2')];function createListener(_0x1448d6,_0x3c40f1){return function(_0x33136f){_0x3c40f1['emit'](_0x1448d6,_0x33136f);};}function removeListener(_0x31ce88,_0x2913ff){return function(){SmsInteractionEvents[_0xa88a('0x3')](_0x31ce88,_0x2913ff);};}exports[_0xa88a('0x4')]=function(_0x3a38f4){for(var _0x47732b=0x0,_0x321d49=events[_0xa88a('0x5')];_0x47732b<_0x321d49;_0x47732b++){var _0x1263c4=events[_0x47732b];var _0x47b370=createListener(_0xa88a('0x6')+_0x1263c4,_0x3a38f4);SmsInteractionEvents['on'](_0x1263c4,_0x47b370);}}; \ No newline at end of file +var _0x8293=['update','removeListener','register','./smsInteraction.events','save'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x8293,0xd0));var _0x3829=function(_0x121239,_0x172a47){_0x121239=_0x121239-0x0;var _0x5c2485=_0x8293[_0x121239];return _0x5c2485;};'use strict';var SmsInteractionEvents=require(_0x3829('0x0'));var events=[_0x3829('0x1'),'remove',_0x3829('0x2')];function createListener(_0x3c7710,_0x48fa94){return function(_0x2bdcfc){_0x48fa94['emit'](_0x3c7710,_0x2bdcfc);};}function removeListener(_0x3a5f27,_0x58f9fe){return function(){SmsInteractionEvents[_0x3829('0x3')](_0x3a5f27,_0x58f9fe);};}exports[_0x3829('0x4')]=function(_0x37d9e5){for(var _0x30ced4=0x0,_0x151b0f=events['length'];_0x30ced4<_0x151b0f;_0x30ced4++){var _0x3891d8=events[_0x30ced4];var _0x5bd9f2=createListener('smsInteraction:'+_0x3891d8,_0x37d9e5);SmsInteractionEvents['on'](_0x3891d8,_0x5bd9f2);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 7de29f3..88335b8 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 _0x1ef8=['multer','util','connect-timeout','express','Router','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms','create','/:id/status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x2eb74e,_0x5f5b95){var _0x1807ec=function(_0x247e97){while(--_0x247e97){_0x2eb74e['push'](_0x2eb74e['shift']());}};_0x1807ec(++_0x5f5b95);}(_0x1ef8,0xa2));var _0x81ef=function(_0x3a60d8,_0x1e2ea2){_0x3a60d8=_0x3a60d8-0x0;var _0x20cd35=_0x1ef8[_0x3a60d8];return _0x20cd35;};'use strict';var multer=require(_0x81ef('0x0'));var util=require(_0x81ef('0x1'));var path=require('path');var timeout=require(_0x81ef('0x2'));var express=require(_0x81ef('0x3'));var router=express[_0x81ef('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x81ef('0x5'));var config=require('../../config/environment');var controller=require(_0x81ef('0x6'));router[_0x81ef('0x7')]('/',auth[_0x81ef('0x8')](),controller[_0x81ef('0x9')]);router['get'](_0x81ef('0xa'),auth[_0x81ef('0x8')](),controller[_0x81ef('0xb')]);router[_0x81ef('0x7')](_0x81ef('0xc'),auth['isAuthenticated'](),controller[_0x81ef('0xd')]);router[_0x81ef('0xe')]('/',auth[_0x81ef('0x8')](),interaction[_0x81ef('0xf')](_0x81ef('0x10'),'smsmessage:create'),controller[_0x81ef('0x11')]);router[_0x81ef('0xe')](_0x81ef('0x12'),controller['status']);router[_0x81ef('0x13')](_0x81ef('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x81ef('0x13')](_0x81ef('0x14'),auth[_0x81ef('0x8')](),controller[_0x81ef('0x15')]);router[_0x81ef('0x13')](_0x81ef('0x16'),auth[_0x81ef('0x8')](),controller[_0x81ef('0x17')]);router[_0x81ef('0x18')]('/:id',auth[_0x81ef('0x8')](),controller[_0x81ef('0x19')]);module[_0x81ef('0x1a')]=router; \ No newline at end of file +var _0x74e0=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','/:id','update','/:id/accept','accept','delete','destroy','exports','util'];(function(_0x167153,_0x4e651c){var _0x329f71=function(_0x5b7327){while(--_0x5b7327){_0x167153['push'](_0x167153['shift']());}};_0x329f71(++_0x4e651c);}(_0x74e0,0x15e));var _0x074e=function(_0x31ab11,_0x59a7ee){_0x31ab11=_0x31ab11-0x0;var _0x2ecf7f=_0x74e0[_0x31ab11];return _0x2ecf7f;};'use strict';var multer=require('multer');var util=require(_0x074e('0x0'));var path=require('path');var timeout=require(_0x074e('0x1'));var express=require('express');var router=express[_0x074e('0x2')]();var fs_extra=require(_0x074e('0x3'));var auth=require(_0x074e('0x4'));var interaction=require(_0x074e('0x5'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router['get']('/',auth[_0x074e('0x6')](),controller[_0x074e('0x7')]);router[_0x074e('0x8')](_0x074e('0x9'),auth[_0x074e('0x6')](),controller[_0x074e('0xa')]);router[_0x074e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x074e('0xb')]);router[_0x074e('0xc')]('/',auth['isAuthenticated'](),interaction[_0x074e('0xd')](_0x074e('0xe'),_0x074e('0xf')),controller[_0x074e('0x10')]);router[_0x074e('0xc')](_0x074e('0x11'),controller[_0x074e('0x12')]);router[_0x074e('0x13')](_0x074e('0x14'),auth[_0x074e('0x6')](),controller[_0x074e('0x15')]);router[_0x074e('0x13')](_0x074e('0x16'),auth[_0x074e('0x6')](),controller[_0x074e('0x17')]);router[_0x074e('0x13')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x074e('0x18')](_0x074e('0x14'),auth[_0x074e('0x6')](),controller[_0x074e('0x19')]);module[_0x074e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 85e8625..f8ec44a 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 _0xf4b9=['TEXT','BOOLEAN','out','STRING','DATE'];(function(_0x18862b,_0x12a226){var _0x1f0981=function(_0xc6a2e5){while(--_0xc6a2e5){_0x18862b['push'](_0x18862b['shift']());}};_0x1f0981(++_0x12a226);}(_0xf4b9,0x14f));var _0x9f4b=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xf4b9[_0x231e16];return _0x570a7c;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x9f4b('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9f4b('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9f4b('0x2')),'defaultValue':_0x9f4b('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9f4b('0x3')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x9f4b('0x4')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9f4b('0x3')]},'providerResponse':{'type':Sequelize[_0x9f4b('0x0')]}}; \ No newline at end of file +var _0x30bc=['DATE','sequelize','exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x30bc,0x149));var _0xc30b=function(_0x5a43b8,_0x2e0eb2){_0x5a43b8=_0x5a43b8-0x0;var _0x26eeef=_0x30bc[_0x5a43b8];return _0x26eeef;};'use strict';var Sequelize=require(_0xc30b('0x0'));module[_0xc30b('0x1')]={'body':{'type':Sequelize[_0xc30b('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc30b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc30b('0x4')]('in',_0xc30b('0x5')),'defaultValue':_0xc30b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc30b('0x6')](0xbe)},'phone':{'type':Sequelize[_0xc30b('0x6')]},'readAt':{'type':Sequelize[_0xc30b('0x7')]},'secret':{'type':Sequelize[_0xc30b('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc30b('0x6')]},'providerResponse':{'type':Sequelize[_0xc30b('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 74958e1..753a8f0 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 _0x8aad=['acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','Sequelize','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','inspect','MessageSid','twilio','plivo','MessageUUID','indexOf','sent','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','groupName','eml-format','rimraf','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','merge','where','VIRTUAL','filter','options','includeAll','SmsMessage','findAll','rows','show','params','include','find','create','body','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','SmsInteraction','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager'];(function(_0x300a4d,_0x30dd6f){var _0x291ef5=function(_0x287fcf){while(--_0x287fcf){_0x300a4d['push'](_0x300a4d['shift']());}};_0x291ef5(++_0x30dd6f);}(_0x8aad,0x146));var _0xd8aa=function(_0x17cc1d,_0x83d64b){_0x17cc1d=_0x17cc1d-0x0;var _0x239435=_0x8aad[_0x17cc1d];return _0x239435;};'use strict';var emlformat=require(_0xd8aa('0x0'));var rimraf=require(_0xd8aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8aa('0x2'));var rp=require('request-promise');var moment=require(_0xd8aa('0x3'));var BPromise=require(_0xd8aa('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd8aa('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd8aa('0x6'));var fs=require('fs');var fs_extra=require(_0xd8aa('0x7'));var _=require(_0xd8aa('0x8'));var squel=require('squel');var crypto=require(_0xd8aa('0x9'));var jsforce=require(_0xd8aa('0xa'));var deskjs=require(_0xd8aa('0xb'));var toCsv=require(_0xd8aa('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8aa('0xd'));var authService=require(_0xd8aa('0xe'));var qs=require(_0xd8aa('0xf'));var as=require(_0xd8aa('0x10'));var hardwareService=require(_0xd8aa('0x11'));var logger=require('../../config/logger')(_0xd8aa('0x12'));var utils=require(_0xd8aa('0x13'));var config=require(_0xd8aa('0x14'));var licenseUtil=require(_0xd8aa('0x15'));var db=require(_0xd8aa('0x16'))['db'];config[_0xd8aa('0x17')]=_[_0xd8aa('0x18')](config[_0xd8aa('0x17')],{'host':_0xd8aa('0x19'),'port':0x18eb});var socket=require(_0xd8aa('0x1a'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xd8aa('0x1b')](socket);var jayson=require(_0xd8aa('0x1c'));var client=jayson[_0xd8aa('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xd8aa('0x1d')][_0xd8aa('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x39b5bc,_0x404ed6,_0x47a0e3,_0x476930){return new BPromise(function(_0xa9ba1b,_0x5652b7){var _0x16d5c6=_0x476930||client;return _0x16d5c6[_0xd8aa('0x1f')](_0x39b5bc,_0x47a0e3)[_0xd8aa('0x20')](function(_0x3a29ca){logger[_0xd8aa('0x21')]('SmsMessage,\x20%s,\x20%s',_0x404ed6,_0xd8aa('0x22'));logger[_0xd8aa('0x23')](_0xd8aa('0x24'),_0x404ed6,_0xd8aa('0x22'),JSON['stringify'](_0x3a29ca));if(_0x3a29ca[_0xd8aa('0x25')]){if(_0x3a29ca[_0xd8aa('0x25')][_0xd8aa('0x26')]===0x1f4){logger[_0xd8aa('0x25')](_0xd8aa('0x27'),_0x404ed6,_0x3a29ca['error'][_0xd8aa('0x28')]);return _0x5652b7(_0x3a29ca[_0xd8aa('0x25')][_0xd8aa('0x28')]);}logger['error'](_0xd8aa('0x27'),_0x404ed6,_0x3a29ca[_0xd8aa('0x25')][_0xd8aa('0x28')]);return _0xa9ba1b(_0x3a29ca[_0xd8aa('0x25')][_0xd8aa('0x28')]);}else{logger[_0xd8aa('0x21')](_0xd8aa('0x27'),_0x404ed6,_0xd8aa('0x22'));_0xa9ba1b(_0x3a29ca[_0xd8aa('0x29')][_0xd8aa('0x28')]);}})[_0xd8aa('0x2a')](function(_0x370d6f){logger[_0xd8aa('0x25')]('SmsMessage,\x20%s,\x20%s',_0x404ed6,_0x370d6f);_0x5652b7(_0x370d6f);});});}function respondWithStatusCode(_0x1f066a,_0x59eb3f){_0x59eb3f=_0x59eb3f||0xcc;return function(_0xd4d204){if(_0xd4d204){return _0x1f066a[_0xd8aa('0x2b')](_0x59eb3f);}return _0x1f066a[_0xd8aa('0x2c')](_0x59eb3f)[_0xd8aa('0x2d')]();};}function respondWithResult(_0x26ab06,_0x19edee){_0x19edee=_0x19edee||0xc8;return function(_0x3bba1d){if(_0x3bba1d){return _0x26ab06[_0xd8aa('0x2c')](_0x19edee)['json'](_0x3bba1d);}};}function respondWithFilteredResult(_0x1f2a28,_0x34b792){return function(_0x214393){if(_0x214393){var _0x49a7c8=typeof _0x34b792[_0xd8aa('0x2e')]==='undefined'&&typeof _0x34b792[_0xd8aa('0x2f')]===_0xd8aa('0x30');var _0x37902c=_0x214393[_0xd8aa('0x31')];var _0x44f783=_0x49a7c8?0x0:_0x34b792[_0xd8aa('0x2e')];var _0xd8d3b3=_0x49a7c8?_0x214393[_0xd8aa('0x31')]:_0x34b792['offset']+_0x34b792[_0xd8aa('0x2f')];var _0x1c6fe6;if(_0xd8d3b3>=_0x37902c){_0xd8d3b3=_0x37902c;_0x1c6fe6=0xc8;}else{_0x1c6fe6=0xce;}_0x1f2a28[_0xd8aa('0x2c')](_0x1c6fe6);return _0x1f2a28[_0xd8aa('0x32')](_0xd8aa('0x33'),_0x44f783+'-'+_0xd8d3b3+'/'+_0x37902c)[_0xd8aa('0x34')](_0x214393);}return null;};}function patchUpdates(_0x271230){return function(_0x3133fb){try{jsonpatch['apply'](_0x3133fb,_0x271230,!![]);}catch(_0x265217){return BPromise[_0xd8aa('0x35')](_0x265217);}return _0x3133fb[_0xd8aa('0x36')]();};}function saveUpdates(_0x511b4a,_0x1d16d6){return function(_0x3c8941){if(_0x3c8941){return _0x3c8941[_0xd8aa('0x37')](_0x511b4a)[_0xd8aa('0x20')](function(_0x249564){return _0x249564;});}return null;};}function removeEntity(_0x25672a,_0x400bdf){return function(_0x3bb8e4){if(_0x3bb8e4){return _0x3bb8e4[_0xd8aa('0x38')]()['then'](function(){_0x25672a[_0xd8aa('0x2c')](0xcc)[_0xd8aa('0x2d')]();});}};}function handleEntityNotFound(_0x41cd24,_0x221f41){return function(_0x3e23fd){if(!_0x3e23fd){_0x41cd24[_0xd8aa('0x2b')](0x194);}return _0x3e23fd;};}function handleError(_0xd0bc2b,_0x30b0c4){_0x30b0c4=_0x30b0c4||0x1f4;return function(_0xb8bfe6){logger['error'](_0xb8bfe6[_0xd8aa('0x39')]);if(_0xb8bfe6['name']){delete _0xb8bfe6[_0xd8aa('0x3a')];}_0xd0bc2b[_0xd8aa('0x2c')](_0x30b0c4)['send'](_0xb8bfe6);};}exports[_0xd8aa('0x3b')]=function(_0x1a4f2c,_0xb503cc){var _0x18da91={},_0x7cd3a9={},_0x567b24={'count':0x0,'rows':[]};var _0x56ab19=_[_0xd8aa('0x3c')](db['SmsMessage'][_0xd8aa('0x3d')],function(_0x7a6df2){return{'name':_0x7a6df2[_0xd8aa('0x3e')],'type':_0x7a6df2[_0xd8aa('0x3f')][_0xd8aa('0x40')]};});_0x7cd3a9[_0xd8aa('0x41')]=_[_0xd8aa('0x3c')](_0x56ab19,_0xd8aa('0x3a'));_0x7cd3a9[_0xd8aa('0x42')]=_[_0xd8aa('0x43')](_0x1a4f2c[_0xd8aa('0x42')]);_0x7cd3a9['filters']=_[_0xd8aa('0x44')](_0x7cd3a9[_0xd8aa('0x41')],_0x7cd3a9[_0xd8aa('0x42')]);_0x18da91['attributes']=_[_0xd8aa('0x44')](_0x7cd3a9[_0xd8aa('0x41')],qs[_0xd8aa('0x45')](_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x45')]));_0x18da91[_0xd8aa('0x46')]=_0x18da91[_0xd8aa('0x46')][_0xd8aa('0x47')]?_0x18da91[_0xd8aa('0x46')]:_0x7cd3a9[_0xd8aa('0x41')];if(!_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x48')](_0xd8aa('0x49'))){_0x18da91[_0xd8aa('0x2f')]=qs[_0xd8aa('0x2f')](_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x2f')]);_0x18da91[_0xd8aa('0x2e')]=qs['offset'](_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x2e')]);}_0x18da91[_0xd8aa('0x4a')]=qs[_0xd8aa('0x4b')](_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x4b')]);_0x18da91['where']=qs[_0xd8aa('0x4c')](_['pick'](_0x1a4f2c[_0xd8aa('0x42')],_0x7cd3a9['filters']),_0x56ab19);if(_0x1a4f2c[_0xd8aa('0x42')]['filter']){_0x18da91['where']=_[_0xd8aa('0x4d')](_0x18da91[_0xd8aa('0x4e')],{'$or':_[_0xd8aa('0x3c')](_0x56ab19,function(_0xfa6cbf){if(_0xfa6cbf[_0xd8aa('0x3f')]!==_0xd8aa('0x4f')){var _0x4c7eec={};_0x4c7eec[_0xfa6cbf[_0xd8aa('0x3a')]]={'$like':'%'+_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x50')]+'%'};return _0x4c7eec;}})});}_0x18da91=_[_0xd8aa('0x4d')]({},_0x18da91,_0x1a4f2c[_0xd8aa('0x51')]);var _0x581f57={'where':_0x18da91['where']};return db['SmsMessage'][_0xd8aa('0x31')](_0x581f57)[_0xd8aa('0x20')](function(_0x131012){_0x567b24[_0xd8aa('0x31')]=_0x131012;if(_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x52')]){_0x18da91['include']=[{'all':!![]}];}return db[_0xd8aa('0x53')][_0xd8aa('0x54')](_0x18da91);})['then'](function(_0x2ad21f){_0x567b24[_0xd8aa('0x55')]=_0x2ad21f;return _0x567b24;})[_0xd8aa('0x20')](respondWithFilteredResult(_0xb503cc,_0x18da91))['catch'](handleError(_0xb503cc,null));};exports[_0xd8aa('0x56')]=function(_0x625df9,_0x3b93b1){var _0x1f3ed6={'raw':!![],'where':{'id':_0x625df9[_0xd8aa('0x57')]['id']}},_0x1c6a21={};_0x1c6a21['model']=_['keys'](db[_0xd8aa('0x53')][_0xd8aa('0x3d')]);_0x1c6a21[_0xd8aa('0x42')]=_[_0xd8aa('0x43')](_0x625df9[_0xd8aa('0x42')]);_0x1c6a21[_0xd8aa('0x4c')]=_[_0xd8aa('0x44')](_0x1c6a21['model'],_0x1c6a21[_0xd8aa('0x42')]);_0x1f3ed6[_0xd8aa('0x46')]=_['intersection'](_0x1c6a21[_0xd8aa('0x41')],qs['fields'](_0x625df9[_0xd8aa('0x42')][_0xd8aa('0x45')]));_0x1f3ed6[_0xd8aa('0x46')]=_0x1f3ed6['attributes']['length']?_0x1f3ed6['attributes']:_0x1c6a21['model'];if(_0x625df9[_0xd8aa('0x42')][_0xd8aa('0x52')]){_0x1f3ed6[_0xd8aa('0x58')]=[{'all':!![]}];}_0x1f3ed6=_['merge']({},_0x1f3ed6,_0x625df9['options']);return db['SmsMessage'][_0xd8aa('0x59')](_0x1f3ed6)[_0xd8aa('0x20')](handleEntityNotFound(_0x3b93b1,null))[_0xd8aa('0x20')](respondWithResult(_0x3b93b1,null))[_0xd8aa('0x2a')](handleError(_0x3b93b1,null));};exports[_0xd8aa('0x5a')]=function(_0x19e97d,_0x1d7d7d){return db[_0xd8aa('0x53')][_0xd8aa('0x5a')](_0x19e97d[_0xd8aa('0x5b')],{})[_0xd8aa('0x20')](respondWithResult(_0x1d7d7d,0xc9))[_0xd8aa('0x2a')](handleError(_0x1d7d7d,null));};exports[_0xd8aa('0x37')]=function(_0x5da09b,_0x56f4b0){if(_0x5da09b[_0xd8aa('0x5b')]['id']){delete _0x5da09b[_0xd8aa('0x5b')]['id'];}return db[_0xd8aa('0x53')][_0xd8aa('0x59')]({'where':{'id':_0x5da09b['params']['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x56f4b0,null))[_0xd8aa('0x20')](saveUpdates(_0x5da09b['body'],null))['then'](respondWithResult(_0x56f4b0,null))[_0xd8aa('0x2a')](handleError(_0x56f4b0,null));};exports[_0xd8aa('0x38')]=function(_0x157b97,_0x410436){return db['SmsMessage']['find']({'where':{'id':_0x157b97[_0xd8aa('0x57')]['id']}})['then'](handleEntityNotFound(_0x410436,null))[_0xd8aa('0x20')](removeEntity(_0x410436,null))[_0xd8aa('0x2a')](handleError(_0x410436,null));};exports[_0xd8aa('0x5c')]=function(_0x2d41c9,_0x158eee){return db[_0xd8aa('0x53')]['describe']()[_0xd8aa('0x20')](respondWithResult(_0x158eee,null))[_0xd8aa('0x2a')](handleError(_0x158eee,null));};var interaction_log=require(_0xd8aa('0x5d'))(_0xd8aa('0x5e'));exports[_0xd8aa('0x5f')]=function(_0x170954,_0x3368ce,_0x33706c){var _0x3fba51={'agent':{},'channel':_0xd8aa('0x60')};if(_0x170954[_0xd8aa('0x5b')]['id']){delete _0x170954[_0xd8aa('0x5b')]['id'];}_0x170954[_0xd8aa('0x5b')][_0xd8aa('0x61')]=!![];_0x170954[_0xd8aa('0x5b')][_0xd8aa('0x62')]=moment()[_0xd8aa('0x63')](_0xd8aa('0x64'));_0x170954[_0xd8aa('0x5b')][_0xd8aa('0x65')]=_0x170954[_0xd8aa('0x5b')]['UserId']||_0x170954['user']['id'];_0x3fba51['agent']['id']=_0x170954[_0xd8aa('0x5b')]['UserId'];return db[_0xd8aa('0x53')][_0xd8aa('0x59')]({'where':{'id':_0x170954[_0xd8aa('0x57')]['id'],'UserId':null}})[_0xd8aa('0x20')](handleEntityNotFound(_0x3368ce,null))[_0xd8aa('0x20')](saveUpdates(_0x170954[_0xd8aa('0x5b')],null))[_0xd8aa('0x20')](function(_0x26bf3f){if(_0x26bf3f){_0x3fba51[_0xd8aa('0x28')]=_0x26bf3f[_0xd8aa('0x66')]({'plain':!![]});return db[_0xd8aa('0x67')]['find']({'where':{'id':_0x26bf3f['SmsInteractionId']}});}return null;})[_0xd8aa('0x20')](handleEntityNotFound(_0x3368ce,null))['then'](function(_0x384f5d){if(_0x384f5d){return _0x384f5d['update']({'UserId':_0x170954['body'][_0xd8aa('0x65')],'read1stAt':_[_0xd8aa('0x68')](_0x384f5d[_0xd8aa('0x69')])?moment()[_0xd8aa('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xd8aa('0x20')](function(_0x332179){if(_0x332179){_0x3fba51[_0xd8aa('0x6a')]=_0x332179[_0xd8aa('0x66')]({'plain':!![]});interaction_log[_0xd8aa('0x21')](_0xd8aa('0x6b'),_0x170954[_0xd8aa('0x6c')]['id'],_0x170954[_0xd8aa('0x6c')][_0xd8aa('0x3a')],_0x170954[_0xd8aa('0x6c')]['role'],_0x3fba51[_0xd8aa('0x6a')]['id'],_0x170954[_0xd8aa('0x5b')]?JSON[_0xd8aa('0x6d')](_0x170954['body']):'null');return respondWithRpcPromise(_0xd8aa('0x6e'),_0xd8aa('0x6f'),_0x3fba51);}return null;})['then'](function(_0x2c869e){var _0x36c155=_0xd8aa('0x70')+_0x2c869e[_0xd8aa('0x28')][_0xd8aa('0x71')];return db[_0xd8aa('0x72')][_0xd8aa('0x42')](_0x36c155,{'type':db['Sequelize'][_0xd8aa('0x73')][_0xd8aa('0x74')],'raw':!![]})[_0xd8aa('0x20')](function(_0x1fac92){return _0x1fac92;});})[_0xd8aa('0x20')](function(_0x3ede08){if(_0x3ede08){_0x3fba51[_0xd8aa('0x28')][_0xd8aa('0x75')]=_0x3ede08[0x0];if(!_0x170954['body'][_0xd8aa('0x65')])return;return db[_0xd8aa('0x76')][_0xd8aa('0x59')]({'where':{'id':_0x170954['body'][_0xd8aa('0x65')],'role':_0xd8aa('0x77')},'attributes':['id',_0xd8aa('0x3a'),_0xd8aa('0x78'),_0xd8aa('0x79'),_0xd8aa('0x7a')],'raw':!![]});}return null;})[_0xd8aa('0x20')](function(_0x2c6083){if(!_0x2c6083)return null;_0x3fba51[_0xd8aa('0x28')][_0xd8aa('0x77')]=_0x2c6083;return _0x3fba51;})[_0xd8aa('0x20')](function(_0x373194){if(_0x373194){if(_0x170954[_0xd8aa('0x5b')][_0xd8aa('0x7b')]){_0x3fba51[_0xd8aa('0x28')][_0xd8aa('0x7c')]=util[_0xd8aa('0x63')](_0xd8aa('0x7d'),_0x170954['user'][_0xd8aa('0x3a')]);_0x3fba51[_0xd8aa('0x28')][_0xd8aa('0x7e')]=_0x3fba51[_0xd8aa('0x7e')];_0x3fba51['message'][_0xd8aa('0x7f')]=_0x3fba51[_0xd8aa('0x7e')];_0x3fba51[_0xd8aa('0x28')][_0xd8aa('0x80')]='accept';return respondWithRpcPromise(_0xd8aa('0x81'),'EventManager',{'event':_0xd8aa('0x82'),'message':_0x3fba51[_0xd8aa('0x28')]},client9002)[_0xd8aa('0x20')](function(){return _0x3fba51;});}return _0x3fba51;}return null;})[_0xd8aa('0x20')](respondWithResult(_0x3368ce,null))[_0xd8aa('0x2a')](handleError(_0x3368ce,null));};var interaction_log=require(_0xd8aa('0x5d'))(_0xd8aa('0x5e'));exports['reject']=function(_0x512c32,_0x2b2222,_0x4299c4){var _0xbcc774={'agent':{},'channel':'sms'};if(_0x512c32[_0xd8aa('0x5b')]['id']){delete _0x512c32[_0xd8aa('0x5b')]['id'];}_0x512c32[_0xd8aa('0x5b')][_0xd8aa('0x65')]=_0x512c32[_0xd8aa('0x5b')]['UserId']||_0x512c32['user']['id'];_0xbcc774[_0xd8aa('0x77')]['id']=_0x512c32['body'][_0xd8aa('0x65')];return db[_0xd8aa('0x53')][_0xd8aa('0x59')]({'where':{'id':_0x512c32[_0xd8aa('0x57')]['id'],'UserId':null}})[_0xd8aa('0x20')](handleEntityNotFound(_0x2b2222,null))[_0xd8aa('0x20')](function(_0x49d5ab){if(_0x49d5ab){_0xbcc774[_0xd8aa('0x28')]=_0x49d5ab[_0xd8aa('0x66')]({'plain':!![]});return db[_0xd8aa('0x67')]['find']({'where':{'id':_0x49d5ab['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2b2222,null))['then'](function(_0x38e8d3){if(_0x38e8d3){_0xbcc774[_0xd8aa('0x6a')]=_0x38e8d3['get']({'plain':!![]});interaction_log['info'](_0xd8aa('0x83'),_0x512c32[_0xd8aa('0x6c')]['id'],_0x512c32['user']['name'],_0x512c32[_0xd8aa('0x6c')][_0xd8aa('0x84')],_0xbcc774[_0xd8aa('0x6a')]['id'],_0x512c32['body']?JSON['stringify'](_0x512c32[_0xd8aa('0x5b')]):_0xd8aa('0x85'));return respondWithRpcPromise(_0xd8aa('0x86'),_0xd8aa('0x87'),_0xbcc774);}return null;})[_0xd8aa('0x20')](function(_0x41d5a9){var _0x3f7a70=_0xd8aa('0x70')+_0x41d5a9[_0xd8aa('0x28')][_0xd8aa('0x71')];return db[_0xd8aa('0x72')][_0xd8aa('0x42')](_0x3f7a70,{'type':db[_0xd8aa('0x88')][_0xd8aa('0x73')][_0xd8aa('0x74')],'raw':!![]})[_0xd8aa('0x20')](function(_0x522d5c){return _0x522d5c;});})[_0xd8aa('0x20')](function(_0x3f4aff){if(_0x3f4aff){_0xbcc774['message'][_0xd8aa('0x75')]=_0x3f4aff[0x0];if(!_0x512c32[_0xd8aa('0x5b')][_0xd8aa('0x65')])return;return db[_0xd8aa('0x76')][_0xd8aa('0x59')]({'where':{'id':_0x512c32['body'][_0xd8aa('0x65')],'role':_0xd8aa('0x77')},'attributes':['id','name',_0xd8aa('0x78'),_0xd8aa('0x79'),'internal'],'raw':!![]});}return null;})[_0xd8aa('0x20')](function(_0x2b95de){if(!_0x2b95de)return null;_0xbcc774[_0xd8aa('0x28')][_0xd8aa('0x77')]=_0x2b95de;return _0xbcc774;})[_0xd8aa('0x20')](function(_0x2bfbaa){if(_0x2bfbaa){_0x2bfbaa['message'][_0xd8aa('0x7c')]=util[_0xd8aa('0x63')](_0xd8aa('0x7d'),_0x512c32[_0xd8aa('0x6c')][_0xd8aa('0x3a')]);_0x2bfbaa['message'][_0xd8aa('0x7e')]=_0xbcc774['channel'];_0x2bfbaa[_0xd8aa('0x28')][_0xd8aa('0x7f')]=_0xbcc774[_0xd8aa('0x7e')];_0x2bfbaa[_0xd8aa('0x28')]['event']=_0xd8aa('0x35');respondWithRpcPromise(_0xd8aa('0x81'),_0xd8aa('0x81'),{'event':_0xd8aa('0x89'),'message':_0x2bfbaa['message']},client9002);return _0xbcc774;}return null;})[_0xd8aa('0x20')](respondWithResult(_0x2b2222,null))[_0xd8aa('0x2a')](handleError(_0x2b2222,null));};exports[_0xd8aa('0x2c')]=function(_0x36d479,_0x3cfcb9,_0x5e4bca){if(_0x36d479['body']['id']){delete _0x36d479[_0xd8aa('0x5b')]['id'];}var _0x28052a;return db[_0xd8aa('0x53')][_0xd8aa('0x59')]({'where':{'id':_0x36d479[_0xd8aa('0x57')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x3cfcb9,null))[_0xd8aa('0x20')](function(_0x553fa6){if(_0x553fa6){_0x28052a=_0x553fa6;return db[_0xd8aa('0x8a')][_0xd8aa('0x59')]({'where':{'id':_0x553fa6['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x3cfcb9,null))[_0xd8aa('0x20')](function(_0x53035e){if(_0x53035e){logger[_0xd8aa('0x23')](_0xd8aa('0x24'),_0xd8aa('0x2c'),_0xd8aa('0x8b'),_0x53035e[_0xd8aa('0x3f')],util[_0xd8aa('0x8c')](_0x36d479['body'],{'showHidden':![],'depth':null}));switch(_0x53035e['type']){case'twilio':if(_0x36d479[_0xd8aa('0x5b')][_0xd8aa('0x8d')]&&_0x36d479[_0xd8aa('0x5b')][_0xd8aa('0x8d')]===_0x28052a['messageId']){return _0x28052a[_0xd8aa('0x37')]({'read':!![]});}else{logger[_0xd8aa('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd8aa('0x2c'),_0xd8aa('0x8e'),util[_0xd8aa('0x8c')](_0x36d479[_0xd8aa('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xd8aa('0x8f'):if(_0x36d479[_0xd8aa('0x5b')][_0xd8aa('0x90')]&&_0x36d479['body'][_0xd8aa('0x90')]===_0x28052a['messageId']&&_[_0xd8aa('0x91')]([_0xd8aa('0x92'),'delivered'],_0x36d479[_0xd8aa('0x5b')][_0xd8aa('0x93')])>=0x0){return _0x28052a[_0xd8aa('0x37')]({'read':!![]});}else{logger[_0xd8aa('0x25')](_0xd8aa('0x94'),_0xd8aa('0x2c'),_0xd8aa('0x95'),util['inspect'](_0x36d479[_0xd8aa('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xd8aa('0x96'):var _0x2b4fac=_0x36d479[_0xd8aa('0x5b')]['results'][0x0];if(_0x2b4fac[_0xd8aa('0x2c')][_0xd8aa('0x97')]==='DELIVERED'){return _0x28052a['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd8aa('0x2c'),_0xd8aa('0x96'),util[_0xd8aa('0x8c')](_0x36d479['body'],{'showHidden':![],'depth':null}));}break;}return _0x28052a;}})[_0xd8aa('0x20')](respondWithResult(_0x3cfcb9,null))['catch'](handleError(_0x3cfcb9,null));}; \ No newline at end of file +var _0xa81d=['../../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','./smsMessage.socket','jayson/promise','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','map','SmsMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','find','create','body','update','describe','sms-interactions','sms','read','user','agent','UserId','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','motionChannel','SmsAccount','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','delivered','Status','infobip','results','groupName','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x2d727d,_0x4e7f6c){var _0x4fa2f0=function(_0x128269){while(--_0x128269){_0x2d727d['push'](_0x2d727d['shift']());}};_0x4fa2f0(++_0x4e7f6c);}(_0xa81d,0x11e));var _0xda81=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0xa81d[_0x476c7];return _0x47ae56;};'use strict';var emlformat=require(_0xda81('0x0'));var rimraf=require(_0xda81('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xda81('0x2'));var rp=require('request-promise');var moment=require(_0xda81('0x3'));var BPromise=require(_0xda81('0x4'));var Mustache=require(_0xda81('0x5'));var util=require(_0xda81('0x6'));var path=require(_0xda81('0x7'));var sox=require(_0xda81('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda81('0x9'));var _=require('lodash');var squel=require(_0xda81('0xa'));var crypto=require(_0xda81('0xb'));var jsforce=require(_0xda81('0xc'));var deskjs=require(_0xda81('0xd'));var toCsv=require(_0xda81('0xe'));var querystring=require(_0xda81('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xda81('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xda81('0x11'));var hardwareService=require(_0xda81('0x12'));var logger=require(_0xda81('0x13'))(_0xda81('0x14'));var utils=require(_0xda81('0x15'));var config=require(_0xda81('0x16'));var licenseUtil=require(_0xda81('0x17'));var db=require(_0xda81('0x18'))['db'];config[_0xda81('0x19')]=_[_0xda81('0x1a')](config['redis'],{'host':_0xda81('0x1b'),'port':0x18eb});var socket=require(_0xda81('0x1c'))(new Redis(config['redis']));require(_0xda81('0x1d'))['register'](socket);var jayson=require(_0xda81('0x1e'));var client=jayson['client'][_0xda81('0x1f')]({'port':0x232c});var client9002=jayson[_0xda81('0x20')][_0xda81('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x27facb,_0xe2adb4,_0x1d3e0d,_0x57bab1){return new BPromise(function(_0x28ffff,_0x2425a6){var _0x46b4a0=_0x57bab1||client;return _0x46b4a0[_0xda81('0x21')](_0x27facb,_0x1d3e0d)[_0xda81('0x22')](function(_0x34d4c9){logger[_0xda81('0x23')](_0xda81('0x24'),_0xe2adb4,_0xda81('0x25'));logger[_0xda81('0x26')](_0xda81('0x27'),_0xe2adb4,'request\x20sent',JSON[_0xda81('0x28')](_0x34d4c9));if(_0x34d4c9['error']){if(_0x34d4c9[_0xda81('0x29')][_0xda81('0x2a')]===0x1f4){logger[_0xda81('0x29')](_0xda81('0x24'),_0xe2adb4,_0x34d4c9[_0xda81('0x29')][_0xda81('0x2b')]);return _0x2425a6(_0x34d4c9[_0xda81('0x29')][_0xda81('0x2b')]);}logger[_0xda81('0x29')](_0xda81('0x24'),_0xe2adb4,_0x34d4c9[_0xda81('0x29')][_0xda81('0x2b')]);return _0x28ffff(_0x34d4c9[_0xda81('0x29')][_0xda81('0x2b')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0xe2adb4,_0xda81('0x25'));_0x28ffff(_0x34d4c9[_0xda81('0x2c')][_0xda81('0x2b')]);}})[_0xda81('0x2d')](function(_0x431774){logger['error'](_0xda81('0x24'),_0xe2adb4,_0x431774);_0x2425a6(_0x431774);});});}function respondWithStatusCode(_0x8b7849,_0x283293){_0x283293=_0x283293||0xcc;return function(_0x4789b){if(_0x4789b){return _0x8b7849[_0xda81('0x2e')](_0x283293);}return _0x8b7849[_0xda81('0x2f')](_0x283293)[_0xda81('0x30')]();};}function respondWithResult(_0x1fef87,_0x472621){_0x472621=_0x472621||0xc8;return function(_0x1dae09){if(_0x1dae09){return _0x1fef87[_0xda81('0x2f')](_0x472621)['json'](_0x1dae09);}};}function respondWithFilteredResult(_0x3948af,_0x1e4492){return function(_0x369abf){if(_0x369abf){var _0x41ba8f=typeof _0x1e4492[_0xda81('0x31')]===_0xda81('0x32')&&typeof _0x1e4492[_0xda81('0x33')]===_0xda81('0x32');var _0x20c9ca=_0x369abf[_0xda81('0x34')];var _0x103322=_0x41ba8f?0x0:_0x1e4492[_0xda81('0x31')];var _0x36ef88=_0x41ba8f?_0x369abf[_0xda81('0x34')]:_0x1e4492['offset']+_0x1e4492[_0xda81('0x33')];var _0x2b2ce5;if(_0x36ef88>=_0x20c9ca){_0x36ef88=_0x20c9ca;_0x2b2ce5=0xc8;}else{_0x2b2ce5=0xce;}_0x3948af[_0xda81('0x2f')](_0x2b2ce5);return _0x3948af[_0xda81('0x35')](_0xda81('0x36'),_0x103322+'-'+_0x36ef88+'/'+_0x20c9ca)[_0xda81('0x37')](_0x369abf);}return null;};}function patchUpdates(_0x3d656c){return function(_0x34fa64){try{jsonpatch[_0xda81('0x38')](_0x34fa64,_0x3d656c,!![]);}catch(_0x1e51e1){return BPromise[_0xda81('0x39')](_0x1e51e1);}return _0x34fa64[_0xda81('0x3a')]();};}function saveUpdates(_0x5af239,_0x3c2805){return function(_0x33fa48){if(_0x33fa48){return _0x33fa48['update'](_0x5af239)['then'](function(_0x2e646f){return _0x2e646f;});}return null;};}function removeEntity(_0x4cdb53,_0x3951fd){return function(_0x2564ae){if(_0x2564ae){return _0x2564ae[_0xda81('0x3b')]()[_0xda81('0x22')](function(){_0x4cdb53[_0xda81('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf7dfd3,_0x3e40f0){return function(_0x4a6733){if(!_0x4a6733){_0xf7dfd3['sendStatus'](0x194);}return _0x4a6733;};}function handleError(_0x1d3ce2,_0x46b8b3){_0x46b8b3=_0x46b8b3||0x1f4;return function(_0x40f9f9){logger[_0xda81('0x29')](_0x40f9f9[_0xda81('0x3c')]);if(_0x40f9f9[_0xda81('0x3d')]){delete _0x40f9f9['name'];}_0x1d3ce2['status'](_0x46b8b3)[_0xda81('0x3e')](_0x40f9f9);};}exports['index']=function(_0xccad25,_0x3c8648){var _0x52ef88={},_0x188ff3={},_0x54fc3e={'count':0x0,'rows':[]};var _0x1b90c3=_[_0xda81('0x3f')](db[_0xda81('0x40')][_0xda81('0x41')],function(_0x10acb7){return{'name':_0x10acb7[_0xda81('0x42')],'type':_0x10acb7['type'][_0xda81('0x43')]};});_0x188ff3[_0xda81('0x44')]=_[_0xda81('0x3f')](_0x1b90c3,_0xda81('0x3d'));_0x188ff3[_0xda81('0x45')]=_[_0xda81('0x46')](_0xccad25[_0xda81('0x45')]);_0x188ff3[_0xda81('0x47')]=_[_0xda81('0x48')](_0x188ff3[_0xda81('0x44')],_0x188ff3[_0xda81('0x45')]);_0x52ef88[_0xda81('0x49')]=_['intersection'](_0x188ff3[_0xda81('0x44')],qs[_0xda81('0x4a')](_0xccad25[_0xda81('0x45')][_0xda81('0x4a')]));_0x52ef88[_0xda81('0x49')]=_0x52ef88[_0xda81('0x49')][_0xda81('0x4b')]?_0x52ef88['attributes']:_0x188ff3[_0xda81('0x44')];if(!_0xccad25['query'][_0xda81('0x4c')](_0xda81('0x4d'))){_0x52ef88[_0xda81('0x33')]=qs[_0xda81('0x33')](_0xccad25[_0xda81('0x45')]['limit']);_0x52ef88[_0xda81('0x31')]=qs[_0xda81('0x31')](_0xccad25['query'][_0xda81('0x31')]);}_0x52ef88['order']=qs[_0xda81('0x4e')](_0xccad25[_0xda81('0x45')][_0xda81('0x4e')]);_0x52ef88[_0xda81('0x4f')]=qs['filters'](_[_0xda81('0x50')](_0xccad25['query'],_0x188ff3['filters']),_0x1b90c3);if(_0xccad25[_0xda81('0x45')]['filter']){_0x52ef88[_0xda81('0x4f')]=_['merge'](_0x52ef88[_0xda81('0x4f')],{'$or':_[_0xda81('0x3f')](_0x1b90c3,function(_0x47d420){if(_0x47d420['type']!==_0xda81('0x51')){var _0x3d967b={};_0x3d967b[_0x47d420[_0xda81('0x3d')]]={'$like':'%'+_0xccad25[_0xda81('0x45')][_0xda81('0x52')]+'%'};return _0x3d967b;}})});}_0x52ef88=_[_0xda81('0x53')]({},_0x52ef88,_0xccad25[_0xda81('0x54')]);var _0x2ebab8={'where':_0x52ef88['where']};return db['SmsMessage']['count'](_0x2ebab8)[_0xda81('0x22')](function(_0x5437e4){_0x54fc3e[_0xda81('0x34')]=_0x5437e4;if(_0xccad25[_0xda81('0x45')][_0xda81('0x55')]){_0x52ef88[_0xda81('0x56')]=[{'all':!![]}];}return db[_0xda81('0x40')][_0xda81('0x57')](_0x52ef88);})['then'](function(_0x3531ed){_0x54fc3e[_0xda81('0x58')]=_0x3531ed;return _0x54fc3e;})['then'](respondWithFilteredResult(_0x3c8648,_0x52ef88))[_0xda81('0x2d')](handleError(_0x3c8648,null));};exports['show']=function(_0x1ac89c,_0x3a6a56){var _0x1be080={'raw':!![],'where':{'id':_0x1ac89c[_0xda81('0x59')]['id']}},_0x288d33={};_0x288d33[_0xda81('0x44')]=_['keys'](db[_0xda81('0x40')][_0xda81('0x41')]);_0x288d33[_0xda81('0x45')]=_[_0xda81('0x46')](_0x1ac89c[_0xda81('0x45')]);_0x288d33[_0xda81('0x47')]=_[_0xda81('0x48')](_0x288d33[_0xda81('0x44')],_0x288d33[_0xda81('0x45')]);_0x1be080[_0xda81('0x49')]=_[_0xda81('0x48')](_0x288d33[_0xda81('0x44')],qs[_0xda81('0x4a')](_0x1ac89c['query'][_0xda81('0x4a')]));_0x1be080[_0xda81('0x49')]=_0x1be080[_0xda81('0x49')][_0xda81('0x4b')]?_0x1be080['attributes']:_0x288d33[_0xda81('0x44')];if(_0x1ac89c[_0xda81('0x45')][_0xda81('0x55')]){_0x1be080[_0xda81('0x56')]=[{'all':!![]}];}_0x1be080=_['merge']({},_0x1be080,_0x1ac89c[_0xda81('0x54')]);return db['SmsMessage'][_0xda81('0x5a')](_0x1be080)[_0xda81('0x22')](handleEntityNotFound(_0x3a6a56,null))[_0xda81('0x22')](respondWithResult(_0x3a6a56,null))[_0xda81('0x2d')](handleError(_0x3a6a56,null));};exports[_0xda81('0x5b')]=function(_0x3709cc,_0x64bc75){return db[_0xda81('0x40')]['create'](_0x3709cc[_0xda81('0x5c')],{})[_0xda81('0x22')](respondWithResult(_0x64bc75,0xc9))[_0xda81('0x2d')](handleError(_0x64bc75,null));};exports[_0xda81('0x5d')]=function(_0x1a90cf,_0x463d86){if(_0x1a90cf[_0xda81('0x5c')]['id']){delete _0x1a90cf[_0xda81('0x5c')]['id'];}return db['SmsMessage'][_0xda81('0x5a')]({'where':{'id':_0x1a90cf[_0xda81('0x59')]['id']}})[_0xda81('0x22')](handleEntityNotFound(_0x463d86,null))['then'](saveUpdates(_0x1a90cf[_0xda81('0x5c')],null))['then'](respondWithResult(_0x463d86,null))[_0xda81('0x2d')](handleError(_0x463d86,null));};exports['destroy']=function(_0x159617,_0x58c76e){return db[_0xda81('0x40')]['find']({'where':{'id':_0x159617[_0xda81('0x59')]['id']}})[_0xda81('0x22')](handleEntityNotFound(_0x58c76e,null))[_0xda81('0x22')](removeEntity(_0x58c76e,null))['catch'](handleError(_0x58c76e,null));};exports[_0xda81('0x5e')]=function(_0x14c486,_0x2097f8){return db['SmsMessage']['describe']()[_0xda81('0x22')](respondWithResult(_0x2097f8,null))[_0xda81('0x2d')](handleError(_0x2097f8,null));};var interaction_log=require(_0xda81('0x13'))(_0xda81('0x5f'));exports['accept']=function(_0x239250,_0x588d1e,_0x1f18ff){var _0x942897={'agent':{},'channel':_0xda81('0x60')};if(_0x239250[_0xda81('0x5c')]['id']){delete _0x239250[_0xda81('0x5c')]['id'];}_0x239250[_0xda81('0x5c')][_0xda81('0x61')]=!![];_0x239250[_0xda81('0x5c')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x239250['body']['UserId']=_0x239250[_0xda81('0x5c')]['UserId']||_0x239250[_0xda81('0x62')]['id'];_0x942897[_0xda81('0x63')]['id']=_0x239250[_0xda81('0x5c')][_0xda81('0x64')];return db[_0xda81('0x40')][_0xda81('0x5a')]({'where':{'id':_0x239250['params']['id'],'UserId':null}})[_0xda81('0x22')](handleEntityNotFound(_0x588d1e,null))[_0xda81('0x22')](saveUpdates(_0x239250['body'],null))['then'](function(_0x3ee13b){if(_0x3ee13b){_0x942897['message']=_0x3ee13b[_0xda81('0x65')]({'plain':!![]});return db[_0xda81('0x66')][_0xda81('0x5a')]({'where':{'id':_0x3ee13b[_0xda81('0x67')]}});}return null;})[_0xda81('0x22')](handleEntityNotFound(_0x588d1e,null))[_0xda81('0x22')](function(_0x981a6d){if(_0x981a6d){return _0x981a6d[_0xda81('0x5d')]({'UserId':_0x239250[_0xda81('0x5c')][_0xda81('0x64')],'read1stAt':_[_0xda81('0x68')](_0x981a6d[_0xda81('0x69')])?moment()[_0xda81('0x6a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xda81('0x22')](function(_0xf8e37a){if(_0xf8e37a){_0x942897['interaction']=_0xf8e37a[_0xda81('0x65')]({'plain':!![]});interaction_log[_0xda81('0x23')](_0xda81('0x6b'),_0x239250[_0xda81('0x62')]['id'],_0x239250['user'][_0xda81('0x3d')],_0x239250[_0xda81('0x62')][_0xda81('0x6c')],_0x942897[_0xda81('0x6d')]['id'],_0x239250['body']?JSON[_0xda81('0x28')](_0x239250[_0xda81('0x5c')]):_0xda81('0x6e'));return respondWithRpcPromise(_0xda81('0x6f'),_0xda81('0x70'),_0x942897);}return null;})[_0xda81('0x22')](function(_0x1180ac){var _0x5e27c8=_0xda81('0x71')+_0x1180ac[_0xda81('0x2b')]['ContactId'];return db[_0xda81('0x72')][_0xda81('0x45')](_0x5e27c8,{'type':db[_0xda81('0x73')][_0xda81('0x74')][_0xda81('0x75')],'raw':!![]})['then'](function(_0x55c6ba){return _0x55c6ba;});})[_0xda81('0x22')](function(_0x599627){if(_0x599627){_0x942897[_0xda81('0x2b')][_0xda81('0x76')]=_0x599627[0x0];if(!_0x239250[_0xda81('0x5c')][_0xda81('0x64')])return;return db[_0xda81('0x77')][_0xda81('0x5a')]({'where':{'id':_0x239250[_0xda81('0x5c')]['UserId'],'role':_0xda81('0x63')},'attributes':['id',_0xda81('0x3d'),_0xda81('0x78'),_0xda81('0x79'),_0xda81('0x7a')],'raw':!![]});}return null;})['then'](function(_0x55a654){if(!_0x55a654)return null;_0x942897[_0xda81('0x2b')]['agent']=_0x55a654;return _0x942897;})[_0xda81('0x22')](function(_0x438ad5){if(_0x438ad5){if(_0x239250['body'][_0xda81('0x7b')]){_0x942897[_0xda81('0x2b')][_0xda81('0x7c')]=util[_0xda81('0x6a')](_0xda81('0x7d'),_0x239250[_0xda81('0x62')][_0xda81('0x3d')]);_0x942897[_0xda81('0x2b')]['channel']=_0x942897[_0xda81('0x7e')];_0x942897[_0xda81('0x2b')]['motionChannel']=_0x942897['channel'];_0x942897[_0xda81('0x2b')][_0xda81('0x7f')]=_0xda81('0x80');return respondWithRpcPromise(_0xda81('0x81'),'EventManager',{'event':_0xda81('0x82'),'message':_0x942897['message']},client9002)[_0xda81('0x22')](function(){return _0x942897;});}return _0x942897;}return null;})[_0xda81('0x22')](respondWithResult(_0x588d1e,null))['catch'](handleError(_0x588d1e,null));};var interaction_log=require(_0xda81('0x13'))(_0xda81('0x5f'));exports[_0xda81('0x39')]=function(_0x1aba8c,_0x3a1c5f,_0xc1ae0){var _0x487c6e={'agent':{},'channel':_0xda81('0x60')};if(_0x1aba8c[_0xda81('0x5c')]['id']){delete _0x1aba8c[_0xda81('0x5c')]['id'];}_0x1aba8c[_0xda81('0x5c')][_0xda81('0x64')]=_0x1aba8c[_0xda81('0x5c')]['UserId']||_0x1aba8c[_0xda81('0x62')]['id'];_0x487c6e[_0xda81('0x63')]['id']=_0x1aba8c['body'][_0xda81('0x64')];return db[_0xda81('0x40')][_0xda81('0x5a')]({'where':{'id':_0x1aba8c[_0xda81('0x59')]['id'],'UserId':null}})[_0xda81('0x22')](handleEntityNotFound(_0x3a1c5f,null))[_0xda81('0x22')](function(_0x14379e){if(_0x14379e){_0x487c6e['message']=_0x14379e[_0xda81('0x65')]({'plain':!![]});return db['SmsInteraction'][_0xda81('0x5a')]({'where':{'id':_0x14379e[_0xda81('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x3a1c5f,null))[_0xda81('0x22')](function(_0x3a96dc){if(_0x3a96dc){_0x487c6e[_0xda81('0x6d')]=_0x3a96dc[_0xda81('0x65')]({'plain':!![]});interaction_log['info'](_0xda81('0x83'),_0x1aba8c[_0xda81('0x62')]['id'],_0x1aba8c[_0xda81('0x62')]['name'],_0x1aba8c[_0xda81('0x62')][_0xda81('0x6c')],_0x487c6e['interaction']['id'],_0x1aba8c[_0xda81('0x5c')]?JSON[_0xda81('0x28')](_0x1aba8c['body']):'null');return respondWithRpcPromise(_0xda81('0x84'),_0xda81('0x85'),_0x487c6e);}return null;})[_0xda81('0x22')](function(_0x274184){var _0x3d7509=_0xda81('0x71')+_0x274184[_0xda81('0x2b')][_0xda81('0x86')];return db[_0xda81('0x72')][_0xda81('0x45')](_0x3d7509,{'type':db['Sequelize'][_0xda81('0x74')][_0xda81('0x75')],'raw':!![]})[_0xda81('0x22')](function(_0x5ab6a){return _0x5ab6a;});})[_0xda81('0x22')](function(_0x115cfd){if(_0x115cfd){_0x487c6e[_0xda81('0x2b')][_0xda81('0x76')]=_0x115cfd[0x0];if(!_0x1aba8c[_0xda81('0x5c')]['UserId'])return;return db[_0xda81('0x77')]['find']({'where':{'id':_0x1aba8c['body'][_0xda81('0x64')],'role':'agent'},'attributes':['id',_0xda81('0x3d'),'fullname',_0xda81('0x79'),'internal'],'raw':!![]});}return null;})[_0xda81('0x22')](function(_0x243306){if(!_0x243306)return null;_0x487c6e[_0xda81('0x2b')][_0xda81('0x63')]=_0x243306;return _0x487c6e;})['then'](function(_0x45152e){if(_0x45152e){_0x45152e[_0xda81('0x2b')][_0xda81('0x7c')]=util[_0xda81('0x6a')]('SIP/%s',_0x1aba8c[_0xda81('0x62')][_0xda81('0x3d')]);_0x45152e[_0xda81('0x2b')][_0xda81('0x7e')]=_0x487c6e['channel'];_0x45152e[_0xda81('0x2b')][_0xda81('0x87')]=_0x487c6e[_0xda81('0x7e')];_0x45152e[_0xda81('0x2b')][_0xda81('0x7f')]=_0xda81('0x39');respondWithRpcPromise(_0xda81('0x81'),_0xda81('0x81'),{'event':'rejectmessage','message':_0x45152e[_0xda81('0x2b')]},client9002);return _0x487c6e;}return null;})[_0xda81('0x22')](respondWithResult(_0x3a1c5f,null))[_0xda81('0x2d')](handleError(_0x3a1c5f,null));};exports['status']=function(_0x50c115,_0x292df2,_0x2b31d0){if(_0x50c115[_0xda81('0x5c')]['id']){delete _0x50c115[_0xda81('0x5c')]['id'];}var _0x25da1b;return db['SmsMessage'][_0xda81('0x5a')]({'where':{'id':_0x50c115[_0xda81('0x59')]['id']}})[_0xda81('0x22')](handleEntityNotFound(_0x292df2,null))[_0xda81('0x22')](function(_0x56cfe6){if(_0x56cfe6){_0x25da1b=_0x56cfe6;return db[_0xda81('0x88')]['find']({'where':{'id':_0x56cfe6['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x292df2,null))['then'](function(_0x250a73){if(_0x250a73){logger['debug'](_0xda81('0x27'),_0xda81('0x2f'),_0xda81('0x89'),_0x250a73[_0xda81('0x8a')],util[_0xda81('0x8b')](_0x50c115[_0xda81('0x5c')],{'showHidden':![],'depth':null}));switch(_0x250a73['type']){case _0xda81('0x8c'):if(_0x50c115[_0xda81('0x5c')][_0xda81('0x8d')]&&_0x50c115[_0xda81('0x5c')]['MessageSid']===_0x25da1b['messageId']){return _0x25da1b[_0xda81('0x5d')]({'read':!![]});}else{logger[_0xda81('0x29')](_0xda81('0x8e'),'status','twilio',util[_0xda81('0x8b')](_0x50c115[_0xda81('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xda81('0x8f'):if(_0x50c115[_0xda81('0x5c')][_0xda81('0x90')]&&_0x50c115[_0xda81('0x5c')][_0xda81('0x90')]===_0x25da1b['messageId']&&_[_0xda81('0x91')](['sent',_0xda81('0x92')],_0x50c115[_0xda81('0x5c')][_0xda81('0x93')])>=0x0){return _0x25da1b['update']({'read':!![]});}else{logger[_0xda81('0x29')](_0xda81('0x8e'),_0xda81('0x2f'),'plivio',util[_0xda81('0x8b')](_0x50c115[_0xda81('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xda81('0x94'):var _0x277d39=_0x50c115[_0xda81('0x5c')][_0xda81('0x95')][0x0];if(_0x277d39[_0xda81('0x2f')][_0xda81('0x96')]==='DELIVERED'){return _0x25da1b[_0xda81('0x5d')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xda81('0x2f'),_0xda81('0x94'),util[_0xda81('0x8b')](_0x50c115[_0xda81('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x25da1b;}})[_0xda81('0x22')](respondWithResult(_0x292df2,null))[_0xda81('0x2d')](handleError(_0x292df2,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index d4f79d6..2340928 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 _0xb676=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb676,0xcc));var _0x6b67=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xb676[_0x409353];return _0x4f4b59;};'use strict';var EventEmitter=require(_0x6b67('0x0'));var SmsMessage=require(_0x6b67('0x1'))['db'][_0x6b67('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6b67('0x3')](0x0);var events={'afterCreate':_0x6b67('0x4'),'afterUpdate':_0x6b67('0x5'),'afterDestroy':_0x6b67('0x6')};function emitEvent(_0x38bb3b){return function(_0x597ad8,_0x12de17,_0x477384){SmsMessageEvents[_0x6b67('0x7')](_0x38bb3b+':'+_0x597ad8['id'],_0x597ad8);SmsMessageEvents[_0x6b67('0x7')](_0x38bb3b,_0x597ad8);_0x477384(null);};}for(var e in events){if(events[_0x6b67('0x8')](e)){var event=events[e];SmsMessage[_0x6b67('0x9')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xf1b7=['SmsMessage','save','update','remove','emit','hook','exports','events'];(function(_0x1d3577,_0x17a32e){var _0x277d9a=function(_0x4b4144){while(--_0x4b4144){_0x1d3577['push'](_0x1d3577['shift']());}};_0x277d9a(++_0x17a32e);}(_0xf1b7,0x127));var _0x7f1b=function(_0x56bff7,_0x10d3a6){_0x56bff7=_0x56bff7-0x0;var _0x3e396e=_0xf1b7[_0x56bff7];return _0x3e396e;};'use strict';var EventEmitter=require(_0x7f1b('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x7f1b('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7f1b('0x2'),'afterUpdate':_0x7f1b('0x3'),'afterDestroy':_0x7f1b('0x4')};function emitEvent(_0x33ccdb){return function(_0x436388,_0x2477c5,_0x2e6af3){SmsMessageEvents[_0x7f1b('0x5')](_0x33ccdb+':'+_0x436388['id'],_0x436388);SmsMessageEvents['emit'](_0x33ccdb,_0x436388);_0x2e6af3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x7f1b('0x6')](e,emitEvent(event));}}module[_0x7f1b('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 06cf1ea..60485ea 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 _0xdfcd=['messages','create','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','error','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','smsMethod','sender','login?username=','&password=','password','split','POST','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','xCALLY\x20Motion','senderString','format','%s:%s','Basic\x20%s','base64','http_code','data','queued_count','message_id','clickSend','plivo','remote','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','keys','sort','length','createHash','md5','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','status','refid','Token\x20not\x20received','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','findOne','SmsInteractionId','then','update','createdAt','catch','SmsAccount','type','twilio','accountSid','phone','authToken'];(function(_0x568ae7,_0x2b5fa3){var _0x257050=function(_0x43e8df){while(--_0x43e8df){_0x568ae7['push'](_0x568ae7['shift']());}};_0x257050(++_0x2b5fa3);}(_0xdfcd,0xcd));var _0xddfc=function(_0x3cdff3,_0x4ff364){_0x3cdff3=_0x3cdff3-0x0;var _0x6e0e6=_0xdfcd[_0x3cdff3];return _0x6e0e6;};'use strict';var _=require(_0xddfc('0x0'));var util=require(_0xddfc('0x1'));var logger=require('../../config/logger')(_0xddfc('0x2'));var moment=require(_0xddfc('0x3'));var BPromise=require(_0xddfc('0x4'));var rp=require(_0xddfc('0x5'));var fs=require('fs');var path=require(_0xddfc('0x6'));var rimraf=require(_0xddfc('0x7'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0xddfc('0x8')]=function(_0x339e3d,_0x2df7cf){return _0x339e3d['define'](_0xddfc('0x9'),attributes,{'tableName':_0xddfc('0xa'),'paranoid':![],'indexes':[{'name':_0xddfc('0xb'),'fields':[_0xddfc('0xb')]},{'name':_0xddfc('0xc'),'fields':[_0xddfc('0xd')],'type':_0xddfc('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x15fcb6,_0x127fef,_0x3ddb78){var _0x4b8924=_0x339e3d[_0xddfc('0xf')];var _0x1b3192=_0x15fcb6[_0xddfc('0x10')]({'plain':!![]});if(_0x1b3192[_0xddfc('0x11')]['toLowerCase']()==='in'||_0x1b3192['direction'][_0xddfc('0x12')]()===_0xddfc('0x13')&&!_0x1b3192['secret']&&!_[_0xddfc('0x14')](_0x1b3192['UserId'])&&!_[_0xddfc('0x14')](_0x1b3192['SmsInteractionId'])){_0x4b8924['SmsInteraction'][_0xddfc('0x15')]({'where':{'id':_0x1b3192[_0xddfc('0x16')]}})[_0xddfc('0x17')](function(_0x20a887){if(_0x20a887){_0x20a887[_0xddfc('0x18')]({'lastMsgAt':_0x1b3192[_0xddfc('0x19')],'lastMsgDirection':_0x1b3192[_0xddfc('0x11')]['toLowerCase']()});}})[_0xddfc('0x1a')](function(_0x2bf605){console['error'](_0x2bf605);});}if(_0x1b3192['direction']===_0xddfc('0x13')&&!_0x1b3192['secret']){var _0x200c66;_0x4b8924[_0xddfc('0x1b')]['find']({'where':{'id':_0x1b3192['SmsAccountId']},'raw':!![]})[_0xddfc('0x17')](function(_0x14dbb9){_0x200c66=_0x14dbb9;if(_0x200c66&&_0x200c66[_0xddfc('0x1c')]){switch(_0x200c66[_0xddfc('0x1c')]){case _0xddfc('0x1d'):var _0xc8720b=require(_0xddfc('0x1d'));if(_0x200c66[_0xddfc('0x1e')]&&_0x200c66['authToken']&&_0x200c66[_0xddfc('0x1f')]){var _0x48d0e9=new _0xc8720b(_0x200c66[_0xddfc('0x1e')],_0x200c66[_0xddfc('0x20')]);_0x48d0e9[_0xddfc('0x21')][_0xddfc('0x22')]({'body':_0x1b3192[_0xddfc('0xd')],'to':_0x1b3192[_0xddfc('0x1f')],'from':_0x200c66[_0xddfc('0x1f')],'statusCallback':_0x200c66['remote']+_0xddfc('0x23')+_0x1b3192['id']+_0xddfc('0x24')+_0x200c66[_0xddfc('0x25')]})['then'](function(_0x3b6167){if(_0x3b6167[_0xddfc('0x26')]){return _0x15fcb6[_0xddfc('0x18')]({'messageId':_0x3b6167[_0xddfc('0x26')]});}})['catch'](function(_0x1559ea){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xddfc('0x27'),_0xddfc('0x1d'),util[_0xddfc('0x28')](_0x1559ea,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x1d'),_0xddfc('0x2b'));}break;case _0xddfc('0x2c'):var _0x54954c='https://api.skebby.it/API/v1.0/REST/';if(_0x200c66[_0xddfc('0x2d')]&&_0x200c66['password']){var _0x57c474={'recipient':[_0x1b3192[_0xddfc('0x1f')]],'message':_0x1b3192[_0xddfc('0xd')],'message_type':_0x200c66[_0xddfc('0x2e')]};if(_0x200c66[_0xddfc('0x2e')]&&_0x200c66[_0xddfc('0x2e')]!=='SI'){_0x57c474[_0xddfc('0x2f')]=_0x200c66['phone'];}var _0xd09c84={'url':_0x54954c+_0xddfc('0x30')+_0x200c66['username']+_0xddfc('0x31')+_0x200c66[_0xddfc('0x32')],'method':'GET'};rp(_0xd09c84)[_0xddfc('0x17')](function(_0x5d7494){var _0x57afae=_0x5d7494[_0xddfc('0x33')](';');var _0xa7b72d={'user_key':_0x57afae[0x0],'session_key':_0x57afae[0x1]};_0xd09c84={'url':_0x54954c+'sms','method':_0xddfc('0x34'),'headers':{'user_key':_0xa7b72d['user_key'],'Session_key':_0xa7b72d[_0xddfc('0x35')]},'json':!![],'body':_0x57c474};return rp(_0xd09c84);})['then'](function(_0x23edeb){if(_0x23edeb[_0xddfc('0x36')]>=0x1){var _0x334691={'messageId':_0x23edeb[_0xddfc('0x37')]};if(_0x200c66[_0xddfc('0x2e')]!=='GP'||!_0x200c66[_0xddfc('0x38')]){_0x334691[_0xddfc('0x39')]=!![];}return _0x15fcb6[_0xddfc('0x18')](_0x334691);}else{return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x2c'),util[_0xddfc('0x28')](_0x23edeb,{'showHidden':![],'depth':null}));}})[_0xddfc('0x1a')](function(_0x368519){return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x2c'),util['inspect'](_0x368519,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xddfc('0x27'),'skebby',_0xddfc('0x3a'));}break;case _0xddfc('0x3b'):if(_0x200c66['authToken']){var _0x1062f1={'recipient':_0x1b3192[_0xddfc('0x1f')],'message':_0x1b3192['body'],'sender':_0x200c66['senderString']||_0x200c66[_0xddfc('0x1f')],'authorization':_0x200c66[_0xddfc('0x20')]};var _0x127fef={'method':_0xddfc('0x34'),'uri':_0xddfc('0x3c'),'body':_0x1062f1,'json':!![]};rp(_0x127fef)[_0xddfc('0x17')](function(_0x586cef){var _0x4d52e8={'messageId':_0x586cef[_0xddfc('0x3d')]};if(!_0x200c66[_0xddfc('0x38')]){_0x4d52e8[_0xddfc('0x39')]=!![];}return _0x15fcb6[_0xddfc('0x18')](_0x4d52e8);})[_0xddfc('0x1a')](function(_0x1783f0){logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x3b'),util[_0xddfc('0x28')](_0x1783f0,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),'connectel','Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x200c66[_0xddfc('0x2d')]&&_0x200c66[_0xddfc('0x32')]){var _0x1062f1={'messages':[{'source':_0xddfc('0x3e'),'to':_0x1b3192[_0xddfc('0x1f')],'body':_0x1b3192['body'],'from':_0x200c66[_0xddfc('0x3f')]||_0x200c66[_0xddfc('0x1f')]}]};var _0x4f6c10=util[_0xddfc('0x40')](_0xddfc('0x41'),_0x200c66['username'],_0x200c66[_0xddfc('0x32')]);var _0x127fef={'method':_0xddfc('0x34'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x1062f1,'headers':{'Authorization':util[_0xddfc('0x40')](_0xddfc('0x42'),new Buffer(_0x4f6c10)['toString'](_0xddfc('0x43')))},'json':!![]};rp(_0x127fef)['then'](function(_0x4d91c4){if(_0x4d91c4['http_code']>=0xc8&&_0x4d91c4[_0xddfc('0x44')]<=0xce){if(_0x4d91c4['data']&&_0x4d91c4[_0xddfc('0x45')][_0xddfc('0x46')]>0x0){var _0xe81882=_['head'](_0x4d91c4[_0xddfc('0x45')][_0xddfc('0x21')]);var _0x50b623={'messageId':_0xe81882[_0xddfc('0x47')]};if(!_0x200c66[_0xddfc('0x38')]){_0x50b623[_0xddfc('0x39')]=!![];}return _0x15fcb6[_0xddfc('0x18')](_0x50b623);}else{logger['error'](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x48'),util[_0xddfc('0x28')](_0x4d91c4,{'showHidden':![],'depth':null}));}}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x48'),util[_0xddfc('0x28')](_0x4d91c4,{'showHidden':![],'depth':null}));}})[_0xddfc('0x1a')](function(_0x6f0d01){logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x48'),util[_0xddfc('0x28')](_0x6f0d01,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),'afterCreate',_0xddfc('0x48'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xddfc('0x49'):if(_0x200c66['authId']&&_0x200c66[_0xddfc('0x20')]){var _0x1062f1={'dst':_0x1b3192[_0xddfc('0x1f')],'text':_0x1b3192[_0xddfc('0xd')],'src':_0x200c66[_0xddfc('0x3f')]||_0x200c66[_0xddfc('0x1f')],'url':_0x200c66[_0xddfc('0x4a')]+_0xddfc('0x23')+_0x1b3192['id']+_0xddfc('0x24')+_0x200c66['token']};var _0x4f6c10=util[_0xddfc('0x40')]('%s:%s',_0x200c66[_0xddfc('0x4b')],_0x200c66[_0xddfc('0x20')]);var _0x127fef={'method':_0xddfc('0x34'),'uri':util[_0xddfc('0x40')](_0xddfc('0x4c'),_0x200c66[_0xddfc('0x4b')]),'body':_0x1062f1,'headers':{'Authorization':util[_0xddfc('0x40')](_0xddfc('0x42'),new Buffer(_0x4f6c10)[_0xddfc('0x4d')](_0xddfc('0x43')))},'json':!![]};rp(_0x127fef)[_0xddfc('0x17')](function(_0x16b0c3){var _0xa2b3f8={'messageId':_0x16b0c3[_0xddfc('0x4e')][0x0]};return _0x15fcb6[_0xddfc('0x18')](_0xa2b3f8);})[_0xddfc('0x1a')](function(_0xca37b9){logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x49'),util[_0xddfc('0x28')](_0xca37b9,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),'afterCreate',_0xddfc('0x49'),_0xddfc('0x4f'));}break;case _0xddfc('0x50'):if(_0x200c66[_0xddfc('0x2d')]&&_0x200c66[_0xddfc('0x32')]){if(_0x200c66[_0xddfc('0x51')]){var _0x180a93={'method':_0xddfc('0x34'),'uri':_0x200c66[_0xddfc('0x51')]+'/auth/1/session','body':{'username':_0x200c66[_0xddfc('0x2d')],'password':_0x200c66[_0xddfc('0x32')]},'json':!![]};return rp(_0x180a93)['then'](function(_0x4d817f){var _0x2238be={'method':'POST','uri':_0x200c66[_0xddfc('0x51')]+_0xddfc('0x52'),'body':{'messages':[{'from':_0x200c66['phone'],'destinations':[{'to':_0x1b3192[_0xddfc('0x1f')]}],'text':_0x1b3192[_0xddfc('0xd')],'notifyUrl':_0x200c66[_0xddfc('0x4a')]+_0xddfc('0x23')+_0x1b3192['id']+_0xddfc('0x24')+_0x200c66['token'],'notifyContentType':_0xddfc('0x53'),'callbackData':_0x200c66[_0xddfc('0x1f')]+';'+_0x1b3192[_0xddfc('0xd')]}]},'headers':{'Authorization':_0xddfc('0x54')+_0x4d817f['token']},'json':!![]};return rp(_0x2238be)[_0xddfc('0x17')](function(_0x46a852){if(_0x46a852['messages']){var _0x36d98e={'messageId':_0x46a852['messages'][0x0][_0xddfc('0xb')]};if(!_0x200c66[_0xddfc('0x38')]){_0x36d98e[_0xddfc('0x39')]=!![];}return _0x15fcb6[_0xddfc('0x18')](_0x36d98e);}else{return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),'infobip',util[_0xddfc('0x28')](_0x46a852,{'showHidden':![],'depth':null}));}});})[_0xddfc('0x1a')](function(_0x36d6ad){return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),'infobip',util['inspect'](_0x36d6ad,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),'infobip',_0xddfc('0x55'));}}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x50'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xddfc('0x56'):var _0x45a57d=require(_0xddfc('0x57'));if(_0x200c66[_0xddfc('0x58')]){var _0x25b1f7={};_0x25b1f7['login']=_0x200c66[_0xddfc('0x2d')];_0x25b1f7[_0xddfc('0x1f')]=_0x1b3192[_0xddfc('0x1f')];_0x25b1f7[_0xddfc('0x2f')]=_0x200c66['phone'];_0x25b1f7[_0xddfc('0x59')]=_0x1b3192[_0xddfc('0xd')];_0x25b1f7[_0xddfc('0x5a')]=+new Date();var _0xffb416='';var _0x238621='';var _0x1d6d17=Object[_0xddfc('0x5b')](_0x25b1f7);_0x1d6d17[_0xddfc('0x5c')]();for(var _0x3ad5c2=0x0;_0x3ad5c2<_0x1d6d17[_0xddfc('0x5d')];_0x3ad5c2++){if(_0xffb416!=''){_0xffb416+='&';}_0xffb416+=_0x1d6d17[_0x3ad5c2]+'='+encodeURIComponent(_0x25b1f7[_0x1d6d17[_0x3ad5c2]]);_0x238621+=_0x25b1f7[_0x1d6d17[_0x3ad5c2]];}_0x238621+=_0x200c66[_0xddfc('0x58')];_0x238621=_0x45a57d[_0xddfc('0x5e')](_0xddfc('0x5f'))[_0xddfc('0x18')](_0x238621)['digest']('hex');if(_0xffb416!==''){_0xffb416+='&';}_0xffb416+=_0xddfc('0x60')+_0x238621;var _0xd09c84={'method':_0xddfc('0x61'),'uri':_0x200c66[_0xddfc('0x51')]+_0xddfc('0x62')+_0xffb416,'json':!![]};return rp(_0xd09c84)['then'](function(_0x1e2fe6){var _0x56653a=Object[_0xddfc('0x5b')](_0x1e2fe6);if(_0x1e2fe6[_0x56653a[0x0]]['error']&&parseInt(_0x1e2fe6[_0x56653a[0x0]]['error'])===0x0){var _0x5d8fba={'messageId':_0x1e2fe6[_0x56653a[0x0]][_0xddfc('0x63')]};if(!_0x200c66[_0xddfc('0x38')]){_0x5d8fba[_0xddfc('0x39')]=!![];}return _0x15fcb6[_0xddfc('0x18')](_0x5d8fba);}else{return logger[_0xddfc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util['inspect'](_0x1e2fe6[_0xddfc('0x29')],{'showHidden':![],'depth':null}));}})[_0xddfc('0x1a')](function(_0x2149f1){return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x56'),util['inspect'](_0x2149f1,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xddfc('0x27'),'csc',_0xddfc('0x64'));}break;case _0xddfc('0x65'):if(_0x200c66[_0xddfc('0x58')]){var _0x296961={'method':_0xddfc('0x34'),'uri':_0xddfc('0x66'),'headers':{'Authorization':_0x200c66[_0xddfc('0x58')]},'body':{'content':_0x1b3192[_0xddfc('0xd')],'to':[_0x1b3192[_0xddfc('0x1f')]],'from':_0x200c66[_0xddfc('0x1f')],'binary':![],'clientMessageId':_0xddfc('0x67'),'charset':'UTF-8'},'json':!![]};rp(_0x296961)['then'](function(_0x548fe4){if(!_0x548fe4['error']){var _0x88f53={'messageId':_0x548fe4['messages'][0x0][_0xddfc('0x68')]};if(!_0x200c66[_0xddfc('0x38')]){_0x88f53[_0xddfc('0x39')]=!![];}return _0x15fcb6[_0xddfc('0x18')](_0x88f53);}else{return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),'clickatell',util[_0xddfc('0x28')](_0x548fe4[_0xddfc('0x29')],{'showHidden':![],'depth':null}));}})[_0xddfc('0x1a')](function(_0x4adc3d){return logger[_0xddfc('0x29')](_0xddfc('0x2a'),'afterCreate',_0xddfc('0x65'),util[_0xddfc('0x28')](_0x4adc3d,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),'clickatell',_0xddfc('0x64'));}break;case _0xddfc('0x69'):if(_0x200c66[_0xddfc('0x2d')]&&_0x200c66[_0xddfc('0x32')]){var _0x4f6c10=util['format'](_0xddfc('0x41'),_0x200c66[_0xddfc('0x2d')],_0x200c66[_0xddfc('0x32')]);var _0x127fef={'method':_0xddfc('0x34'),'uri':_0xddfc('0x6a')+_0x200c66[_0xddfc('0x6b')]+_0xddfc('0x6c'),'body':{'to':[_0x1b3192[_0xddfc('0x1f')]],'text':_0x1b3192['body'],'from':_0x200c66[_0xddfc('0x1f')],'applicationId':_0x200c66[_0xddfc('0x6d')]},'headers':{'Authorization':util[_0xddfc('0x40')](_0xddfc('0x42'),new Buffer(_0x4f6c10)[_0xddfc('0x4d')](_0xddfc('0x43')))},'json':!![]};rp(_0x127fef)['then'](function(_0x2e845e){if(_0x2e845e['id']){var _0x21897f={'messageId':_0x2e845e['id']};return _0x15fcb6[_0xddfc('0x18')](_0x21897f);}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x69'),util[_0xddfc('0x28')](_0x2e845e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x123074){logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x69'),util[_0xddfc('0x28')](_0x123074,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x69'),_0xddfc('0x3a'));}break;case _0xddfc('0x6e'):if(_0x200c66[_0xddfc('0x58')]){var _0x276ac4={};var _0xd09c84={'method':_0xddfc('0x34'),'uri':_0xddfc('0x6f'),'headers':{'Authorization':_0xddfc('0x70')+_0x200c66[_0xddfc('0x58')],'Content-Type':_0xddfc('0x53')},'body':{'from':_0x200c66[_0xddfc('0x1f')],'to':_0x1b3192[_0xddfc('0x1f')],'text':_0x1b3192['body']},'json':!![]};return rp(_0xd09c84)[_0xddfc('0x17')](function(_0x4caba3){if(_0x4caba3[_0xddfc('0x71')]==0xca){_0x276ac4[_0xddfc('0x72')]=_0x4caba3;var _0x1a1e23={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xddfc('0x70')+_0x200c66['apiKey'],'Content-Type':_0xddfc('0x53')},'body':{'refid':_0x276ac4[_0xddfc('0x72')]['refid']},'json':!![]};return rp(_0x1a1e23)[_0xddfc('0x17')](function(_0x38787e){_0x276ac4[_0xddfc('0x73')]=_0x38787e;var _0x5acf77={'messageId':_0x276ac4[_0xddfc('0x72')][_0xddfc('0x74')],'read':!![]};return _0x15fcb6[_0xddfc('0x18')](_0x5acf77);});}else{return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x6e'),util[_0xddfc('0x28')](_0x4caba3,{'showHidden':![],'depth':null}));}})[_0xddfc('0x1a')](function(_0x5cb8a1){return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x6e'),util['inspect'](_0x5cb8a1,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xddfc('0x2a'),_0xddfc('0x27'),'intelepeer',_0xddfc('0x75'));}break;}}})['finally'](function(){_0x3ddb78();});}else{_0x3ddb78();}}},'charset':'utf8mb4','collate':_0xddfc('0x76')});}; \ No newline at end of file +var _0xadc1=['Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','find','type','twilio','authToken','phone','accountSid','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','catch','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','&password=','GET','split','POST','user_key','session_key','internal_order_id','deliveryReport','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','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','message_id','read','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','login','text','timestamp','keys','sort','length','apiKey','createHash','md5','hex','id_sms'];(function(_0x4499e9,_0x3255fa){var _0x6e3ce8=function(_0x5d331f){while(--_0x5d331f){_0x4499e9['push'](_0x4499e9['shift']());}};_0x6e3ce8(++_0x3255fa);}(_0xadc1,0x17f));var _0x1adc=function(_0xed5f9c,_0x5a25cd){_0xed5f9c=_0xed5f9c-0x0;var _0x3a1c43=_0xadc1[_0xed5f9c];return _0x3a1c43;};'use strict';var _=require('lodash');var util=require(_0x1adc('0x0'));var logger=require(_0x1adc('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1adc('0x2'));var rp=require(_0x1adc('0x3'));var fs=require('fs');var path=require(_0x1adc('0x4'));var rimraf=require(_0x1adc('0x5'));var config=require(_0x1adc('0x6'));var attributes=require(_0x1adc('0x7'));module[_0x1adc('0x8')]=function(_0x7ca90e,_0x31e124){return _0x7ca90e[_0x1adc('0x9')](_0x1adc('0xa'),attributes,{'tableName':_0x1adc('0xb'),'paranoid':![],'indexes':[{'name':_0x1adc('0xc'),'fields':[_0x1adc('0xc')]},{'name':_0x1adc('0xd'),'fields':[_0x1adc('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc2f9d0,_0x49a809,_0x30ea13){var _0x31b95d=_0x7ca90e[_0x1adc('0xf')];var _0x409733=_0xc2f9d0['get']({'plain':!![]});if(_0x409733[_0x1adc('0x10')]['toLowerCase']()==='in'||_0x409733[_0x1adc('0x10')][_0x1adc('0x11')]()===_0x1adc('0x12')&&!_0x409733[_0x1adc('0x13')]&&!_[_0x1adc('0x14')](_0x409733[_0x1adc('0x15')])&&!_[_0x1adc('0x14')](_0x409733['SmsInteractionId'])){_0x31b95d[_0x1adc('0x16')][_0x1adc('0x17')]({'where':{'id':_0x409733[_0x1adc('0x18')]}})[_0x1adc('0x19')](function(_0x14a94a){if(_0x14a94a){_0x14a94a[_0x1adc('0x1a')]({'lastMsgAt':_0x409733[_0x1adc('0x1b')],'lastMsgDirection':_0x409733[_0x1adc('0x10')]['toLowerCase']()});}})['catch'](function(_0x3d5897){console['error'](_0x3d5897);});}if(_0x409733['direction']===_0x1adc('0x12')&&!_0x409733['secret']){var _0x31442d;_0x31b95d['SmsAccount'][_0x1adc('0x1c')]({'where':{'id':_0x409733['SmsAccountId']},'raw':!![]})[_0x1adc('0x19')](function(_0x222055){_0x31442d=_0x222055;if(_0x31442d&&_0x31442d[_0x1adc('0x1d')]){switch(_0x31442d[_0x1adc('0x1d')]){case _0x1adc('0x1e'):var _0x45ccd3=require(_0x1adc('0x1e'));if(_0x31442d['accountSid']&&_0x31442d[_0x1adc('0x1f')]&&_0x31442d[_0x1adc('0x20')]){var _0x3913b5=new _0x45ccd3(_0x31442d[_0x1adc('0x21')],_0x31442d[_0x1adc('0x1f')]);_0x3913b5[_0x1adc('0x22')][_0x1adc('0x23')]({'body':_0x409733[_0x1adc('0xe')],'to':_0x409733[_0x1adc('0x20')],'from':_0x31442d[_0x1adc('0x20')],'statusCallback':_0x31442d[_0x1adc('0x24')]+_0x1adc('0x25')+_0x409733['id']+_0x1adc('0x26')+_0x31442d[_0x1adc('0x27')]})[_0x1adc('0x19')](function(_0x4e8c6b){if(_0x4e8c6b[_0x1adc('0x28')]){return _0xc2f9d0['update']({'messageId':_0x4e8c6b[_0x1adc('0x28')]});}})[_0x1adc('0x29')](function(_0x5f1374){logger[_0x1adc('0x2a')](_0x1adc('0x2b'),'afterCreate','twilio',util['inspect'](_0x5f1374,{'showHidden':![],'depth':null}));});}else{logger[_0x1adc('0x2a')](_0x1adc('0x2b'),_0x1adc('0x2c'),'twilio',_0x1adc('0x2d'));}break;case _0x1adc('0x2e'):var _0x35d301='https://api.skebby.it/API/v1.0/REST/';if(_0x31442d[_0x1adc('0x2f')]&&_0x31442d[_0x1adc('0x30')]){var _0x34c4ac={'recipient':[_0x409733[_0x1adc('0x20')]],'message':_0x409733['body'],'message_type':_0x31442d[_0x1adc('0x31')]};if(_0x31442d[_0x1adc('0x31')]&&_0x31442d['smsMethod']!=='SI'){_0x34c4ac[_0x1adc('0x32')]=_0x31442d[_0x1adc('0x20')];}var _0x4c1d97={'url':_0x35d301+'login?username='+_0x31442d[_0x1adc('0x2f')]+_0x1adc('0x33')+_0x31442d[_0x1adc('0x30')],'method':_0x1adc('0x34')};rp(_0x4c1d97)[_0x1adc('0x19')](function(_0x169067){var _0x1040e8=_0x169067[_0x1adc('0x35')](';');var _0x16cafe={'user_key':_0x1040e8[0x0],'session_key':_0x1040e8[0x1]};_0x4c1d97={'url':_0x35d301+'sms','method':_0x1adc('0x36'),'headers':{'user_key':_0x16cafe[_0x1adc('0x37')],'Session_key':_0x16cafe[_0x1adc('0x38')]},'json':!![],'body':_0x34c4ac};return rp(_0x4c1d97);})[_0x1adc('0x19')](function(_0x1f5d24){if(_0x1f5d24['total_sent']>=0x1){var _0x4345d2={'messageId':_0x1f5d24[_0x1adc('0x39')]};if(_0x31442d[_0x1adc('0x31')]!=='GP'||!_0x31442d[_0x1adc('0x3a')]){_0x4345d2['read']=!![];}return _0xc2f9d0[_0x1adc('0x1a')](_0x4345d2);}else{return logger[_0x1adc('0x2a')](_0x1adc('0x2b'),_0x1adc('0x2c'),'skebby',util[_0x1adc('0x3b')](_0x1f5d24,{'showHidden':![],'depth':null}));}})[_0x1adc('0x29')](function(_0x41599f){return logger[_0x1adc('0x2a')](_0x1adc('0x2b'),_0x1adc('0x2c'),_0x1adc('0x2e'),util[_0x1adc('0x3b')](_0x41599f,{'showHidden':![],'depth':null}));});}else{logger[_0x1adc('0x2a')](_0x1adc('0x2b'),'afterCreate',_0x1adc('0x2e'),_0x1adc('0x3c'));}break;case _0x1adc('0x3d'):if(_0x31442d['authToken']){var _0x554c7b={'recipient':_0x409733[_0x1adc('0x20')],'message':_0x409733[_0x1adc('0xe')],'sender':_0x31442d[_0x1adc('0x3e')]||_0x31442d[_0x1adc('0x20')],'authorization':_0x31442d[_0x1adc('0x1f')]};var _0x49a809={'method':_0x1adc('0x36'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x554c7b,'json':!![]};rp(_0x49a809)[_0x1adc('0x19')](function(_0x14d7f8){var _0x56d5f9={'messageId':_0x14d7f8[_0x1adc('0x3f')]};if(!_0x31442d[_0x1adc('0x3a')]){_0x56d5f9['read']=!![];}return _0xc2f9d0[_0x1adc('0x1a')](_0x56d5f9);})[_0x1adc('0x29')](function(_0xfac5ac){logger[_0x1adc('0x2a')](_0x1adc('0x2b'),'afterCreate',_0x1adc('0x3d'),util[_0x1adc('0x3b')](_0xfac5ac,{'showHidden':![],'depth':null}));});}else{logger[_0x1adc('0x2a')](_0x1adc('0x2b'),_0x1adc('0x2c'),_0x1adc('0x3d'),_0x1adc('0x40'));}break;case _0x1adc('0x41'):if(_0x31442d[_0x1adc('0x2f')]&&_0x31442d[_0x1adc('0x30')]){var _0x554c7b={'messages':[{'source':_0x1adc('0x42'),'to':_0x409733[_0x1adc('0x20')],'body':_0x409733[_0x1adc('0xe')],'from':_0x31442d['senderString']||_0x31442d[_0x1adc('0x20')]}]};var _0x23a3cb=util[_0x1adc('0x43')](_0x1adc('0x44'),_0x31442d[_0x1adc('0x2f')],_0x31442d[_0x1adc('0x30')]);var _0x49a809={'method':_0x1adc('0x36'),'uri':_0x1adc('0x45'),'body':_0x554c7b,'headers':{'Authorization':util['format'](_0x1adc('0x46'),new Buffer(_0x23a3cb)[_0x1adc('0x47')](_0x1adc('0x48')))},'json':!![]};rp(_0x49a809)[_0x1adc('0x19')](function(_0x2e9ae9){if(_0x2e9ae9[_0x1adc('0x49')]>=0xc8&&_0x2e9ae9['http_code']<=0xce){if(_0x2e9ae9[_0x1adc('0x4a')]&&_0x2e9ae9['data'][_0x1adc('0x4b')]>0x0){var _0x97cc7b=_['head'](_0x2e9ae9[_0x1adc('0x4a')][_0x1adc('0x22')]);var _0x4dc9f4={'messageId':_0x97cc7b[_0x1adc('0x4c')]};if(!_0x31442d[_0x1adc('0x3a')]){_0x4dc9f4[_0x1adc('0x4d')]=!![];}return _0xc2f9d0[_0x1adc('0x1a')](_0x4dc9f4);}else{logger[_0x1adc('0x2a')](_0x1adc('0x2b'),_0x1adc('0x2c'),'clickSend',util[_0x1adc('0x3b')](_0x2e9ae9,{'showHidden':![],'depth':null}));}}else{logger[_0x1adc('0x2a')](_0x1adc('0x2b'),'afterCreate','clickSend',util['inspect'](_0x2e9ae9,{'showHidden':![],'depth':null}));}})[_0x1adc('0x29')](function(_0x1aa789){logger['error'](_0x1adc('0x2b'),_0x1adc('0x2c'),'clickSend',util[_0x1adc('0x3b')](_0x1aa789,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1adc('0x2b'),_0x1adc('0x2c'),'clickSend',_0x1adc('0x3c'));}break;case _0x1adc('0x4e'):if(_0x31442d[_0x1adc('0x4f')]&&_0x31442d[_0x1adc('0x1f')]){var _0x554c7b={'dst':_0x409733[_0x1adc('0x20')],'text':_0x409733['body'],'src':_0x31442d[_0x1adc('0x3e')]||_0x31442d['phone'],'url':_0x31442d[_0x1adc('0x24')]+_0x1adc('0x25')+_0x409733['id']+_0x1adc('0x26')+_0x31442d[_0x1adc('0x27')]};var _0x23a3cb=util[_0x1adc('0x43')](_0x1adc('0x44'),_0x31442d[_0x1adc('0x4f')],_0x31442d['authToken']);var _0x49a809={'method':_0x1adc('0x36'),'uri':util[_0x1adc('0x43')](_0x1adc('0x50'),_0x31442d[_0x1adc('0x4f')]),'body':_0x554c7b,'headers':{'Authorization':util[_0x1adc('0x43')]('Basic\x20%s',new Buffer(_0x23a3cb)['toString'](_0x1adc('0x48')))},'json':!![]};rp(_0x49a809)[_0x1adc('0x19')](function(_0x554a74){var _0x4da3a1={'messageId':_0x554a74[_0x1adc('0x51')][0x0]};return _0xc2f9d0['update'](_0x4da3a1);})[_0x1adc('0x29')](function(_0x1f1809){logger[_0x1adc('0x2a')](_0x1adc('0x2b'),_0x1adc('0x2c'),'plivo',util['inspect'](_0x1f1809,{'showHidden':![],'depth':null}));});}else{logger[_0x1adc('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1adc('0x2c'),_0x1adc('0x4e'),_0x1adc('0x52'));}break;case _0x1adc('0x53'):if(_0x31442d['username']&&_0x31442d[_0x1adc('0x30')]){if(_0x31442d[_0x1adc('0x54')]){var _0x43360b={'method':_0x1adc('0x36'),'uri':_0x31442d[_0x1adc('0x54')]+_0x1adc('0x55'),'body':{'username':_0x31442d[_0x1adc('0x2f')],'password':_0x31442d[_0x1adc('0x30')]},'json':!![]};return rp(_0x43360b)[_0x1adc('0x19')](function(_0x3d64f3){var _0x14fac5={'method':_0x1adc('0x36'),'uri':_0x31442d[_0x1adc('0x54')]+_0x1adc('0x56'),'body':{'messages':[{'from':_0x31442d['phone'],'destinations':[{'to':_0x409733[_0x1adc('0x20')]}],'text':_0x409733[_0x1adc('0xe')],'notifyUrl':_0x31442d[_0x1adc('0x24')]+'/api/sms/messages/'+_0x409733['id']+_0x1adc('0x26')+_0x31442d[_0x1adc('0x27')],'notifyContentType':_0x1adc('0x57'),'callbackData':_0x31442d[_0x1adc('0x20')]+';'+_0x409733[_0x1adc('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x3d64f3[_0x1adc('0x27')]},'json':!![]};return rp(_0x14fac5)[_0x1adc('0x19')](function(_0x3e1c53){if(_0x3e1c53['messages']){var _0x37212b={'messageId':_0x3e1c53['messages'][0x0][_0x1adc('0xc')]};if(!_0x31442d['deliveryReport']){_0x37212b['read']=!![];}return _0xc2f9d0[_0x1adc('0x1a')](_0x37212b);}else{return logger['error'](_0x1adc('0x2b'),_0x1adc('0x2c'),_0x1adc('0x53'),util[_0x1adc('0x3b')](_0x3e1c53,{'showHidden':![],'depth':null}));}});})[_0x1adc('0x29')](function(_0x55ab32){return logger[_0x1adc('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1adc('0x53'),util[_0x1adc('0x3b')](_0x55ab32,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1adc('0x2b'),_0x1adc('0x2c'),_0x1adc('0x53'),_0x1adc('0x58'));}}else{logger[_0x1adc('0x2a')](_0x1adc('0x2b'),_0x1adc('0x2c'),_0x1adc('0x53'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x1adc('0x59'):var _0x17132d=require('crypto');if(_0x31442d['apiKey']){var _0x4a3280={};_0x4a3280[_0x1adc('0x5a')]=_0x31442d[_0x1adc('0x2f')];_0x4a3280[_0x1adc('0x20')]=_0x409733[_0x1adc('0x20')];_0x4a3280[_0x1adc('0x32')]=_0x31442d['phone'];_0x4a3280[_0x1adc('0x5b')]=_0x409733['body'];_0x4a3280[_0x1adc('0x5c')]=+new Date();var _0x2bf402='';var _0x5537cc='';var _0x2e0e3d=Object[_0x1adc('0x5d')](_0x4a3280);_0x2e0e3d[_0x1adc('0x5e')]();for(var _0x55d796=0x0;_0x55d796<_0x2e0e3d[_0x1adc('0x5f')];_0x55d796++){if(_0x2bf402!=''){_0x2bf402+='&';}_0x2bf402+=_0x2e0e3d[_0x55d796]+'='+encodeURIComponent(_0x4a3280[_0x2e0e3d[_0x55d796]]);_0x5537cc+=_0x4a3280[_0x2e0e3d[_0x55d796]];}_0x5537cc+=_0x31442d[_0x1adc('0x60')];_0x5537cc=_0x17132d[_0x1adc('0x61')](_0x1adc('0x62'))[_0x1adc('0x1a')](_0x5537cc)['digest'](_0x1adc('0x63'));if(_0x2bf402!==''){_0x2bf402+='&';}_0x2bf402+='signature='+_0x5537cc;var _0x4c1d97={'method':'GET','uri':_0x31442d[_0x1adc('0x54')]+'/external/get/send.php?'+_0x2bf402,'json':!![]};return rp(_0x4c1d97)[_0x1adc('0x19')](function(_0x4e1c16){var _0x5846b4=Object[_0x1adc('0x5d')](_0x4e1c16);if(_0x4e1c16[_0x5846b4[0x0]][_0x1adc('0x2a')]&&parseInt(_0x4e1c16[_0x5846b4[0x0]][_0x1adc('0x2a')])===0x0){var _0xc06a4={'messageId':_0x4e1c16[_0x5846b4[0x0]][_0x1adc('0x64')]};if(!_0x31442d[_0x1adc('0x3a')]){_0xc06a4[_0x1adc('0x4d')]=!![];}return _0xc2f9d0[_0x1adc('0x1a')](_0xc06a4);}else{return logger[_0x1adc('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1adc('0x2c'),'csc',util['inspect'](_0x4e1c16[_0x1adc('0x2a')],{'showHidden':![],'depth':null}));}})[_0x1adc('0x29')](function(_0x1f0449){return logger[_0x1adc('0x2a')](_0x1adc('0x2b'),_0x1adc('0x2c'),_0x1adc('0x59'),util[_0x1adc('0x3b')](_0x1f0449,{'showHidden':![],'depth':null}));});}else{logger[_0x1adc('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1adc('0x2c'),'csc',_0x1adc('0x65'));}break;case _0x1adc('0x66'):if(_0x31442d[_0x1adc('0x60')]){var _0x58a71d={'method':_0x1adc('0x36'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x31442d[_0x1adc('0x60')]},'body':{'content':_0x409733[_0x1adc('0xe')],'to':[_0x409733[_0x1adc('0x20')]],'from':_0x31442d['phone'],'binary':![],'clientMessageId':_0x1adc('0x67'),'charset':_0x1adc('0x68')},'json':!![]};rp(_0x58a71d)['then'](function(_0xac1989){if(!_0xac1989[_0x1adc('0x2a')]){var _0x30d25a={'messageId':_0xac1989[_0x1adc('0x22')][0x0][_0x1adc('0x69')]};if(!_0x31442d[_0x1adc('0x3a')]){_0x30d25a['read']=!![];}return _0xc2f9d0[_0x1adc('0x1a')](_0x30d25a);}else{return logger[_0x1adc('0x2a')](_0x1adc('0x2b'),'afterCreate',_0x1adc('0x66'),util['inspect'](_0xac1989['error'],{'showHidden':![],'depth':null}));}})[_0x1adc('0x29')](function(_0x61d7b5){return logger['error'](_0x1adc('0x2b'),_0x1adc('0x2c'),_0x1adc('0x66'),util[_0x1adc('0x3b')](_0x61d7b5,{'showHidden':![],'depth':null}));});}else{logger[_0x1adc('0x2a')](_0x1adc('0x2b'),'afterCreate','clickatell','Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x31442d[_0x1adc('0x2f')]&&_0x31442d[_0x1adc('0x30')]){var _0x23a3cb=util[_0x1adc('0x43')](_0x1adc('0x44'),_0x31442d[_0x1adc('0x2f')],_0x31442d[_0x1adc('0x30')]);var _0x49a809={'method':'POST','uri':_0x1adc('0x6a')+_0x31442d[_0x1adc('0x6b')]+_0x1adc('0x6c'),'body':{'to':[_0x409733[_0x1adc('0x20')]],'text':_0x409733[_0x1adc('0xe')],'from':_0x31442d[_0x1adc('0x20')],'applicationId':_0x31442d[_0x1adc('0x6d')]},'headers':{'Authorization':util[_0x1adc('0x43')](_0x1adc('0x46'),new Buffer(_0x23a3cb)['toString'](_0x1adc('0x48')))},'json':!![]};rp(_0x49a809)[_0x1adc('0x19')](function(_0x3da42d){if(_0x3da42d['id']){var _0x2c0822={'messageId':_0x3da42d['id']};return _0xc2f9d0[_0x1adc('0x1a')](_0x2c0822);}else{logger[_0x1adc('0x2a')](_0x1adc('0x2b'),'afterCreate',_0x1adc('0x6e'),util[_0x1adc('0x3b')](_0x3da42d,{'showHidden':![],'depth':null}));}})['catch'](function(_0x554dfe){logger[_0x1adc('0x2a')](_0x1adc('0x2b'),_0x1adc('0x2c'),'bandwidth',util[_0x1adc('0x3b')](_0x554dfe,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1adc('0x2b'),'afterCreate',_0x1adc('0x6e'),_0x1adc('0x3c'));}break;case _0x1adc('0x6f'):if(_0x31442d[_0x1adc('0x60')]){var _0x5af345={};var _0x4c1d97={'method':_0x1adc('0x36'),'uri':_0x1adc('0x70'),'headers':{'Authorization':_0x1adc('0x71')+_0x31442d['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x31442d[_0x1adc('0x20')],'to':_0x409733[_0x1adc('0x20')],'text':_0x409733[_0x1adc('0xe')]},'json':!![]};return rp(_0x4c1d97)[_0x1adc('0x19')](function(_0x579d27){if(_0x579d27[_0x1adc('0x72')]==0xca){_0x5af345[_0x1adc('0x73')]=_0x579d27;var _0x43d1f6={'method':_0x1adc('0x36'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x1adc('0x71')+_0x31442d[_0x1adc('0x60')],'Content-Type':_0x1adc('0x57')},'body':{'refid':_0x5af345[_0x1adc('0x73')][_0x1adc('0x74')]},'json':!![]};return rp(_0x43d1f6)[_0x1adc('0x19')](function(_0x5988fa){_0x5af345['status']=_0x5988fa;var _0x1d6fec={'messageId':_0x5af345['message'][_0x1adc('0x74')],'read':!![]};return _0xc2f9d0[_0x1adc('0x1a')](_0x1d6fec);});}else{return logger[_0x1adc('0x2a')](_0x1adc('0x2b'),_0x1adc('0x2c'),_0x1adc('0x6f'),util['inspect'](_0x579d27,{'showHidden':![],'depth':null}));}})[_0x1adc('0x29')](function(_0x52e8a4){return logger[_0x1adc('0x2a')](_0x1adc('0x2b'),_0x1adc('0x2c'),'intelepeer',util[_0x1adc('0x3b')](_0x52e8a4,{'showHidden':![],'depth':null}));});}else{return logger[_0x1adc('0x2a')](_0x1adc('0x2b'),'afterCreate',_0x1adc('0x6f'),_0x1adc('0x75'));}break;}}})[_0x1adc('0x76')](function(){_0x30ea13();});}else{_0x30ea13();}}},'charset':_0x1adc('0x77'),'collate':_0x1adc('0x78')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 273d61e..005992c 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 _0xb254=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','CreateSmsMessage','create','options','raw','debug'];(function(_0x20cc0d,_0x40def4){var _0xbb3b0f=function(_0x77da03){while(--_0x77da03){_0x20cc0d['push'](_0x20cc0d['shift']());}};_0xbb3b0f(++_0x40def4);}(_0xb254,0x182));var _0x4b25=function(_0x5f392a,_0x4374e1){_0x5f392a=_0x5f392a-0x0;var _0x18d0fb=_0xb254[_0x5f392a];return _0x18d0fb;};'use strict';var _=require(_0x4b25('0x0'));var util=require(_0x4b25('0x1'));var moment=require(_0x4b25('0x2'));var BPromise=require(_0x4b25('0x3'));var rs=require(_0x4b25('0x4'));var fs=require('fs');var Redis=require(_0x4b25('0x5'));var db=require(_0x4b25('0x6'))['db'];var utils=require(_0x4b25('0x7'));var logger=require('../../config/logger')(_0x4b25('0x8'));var config=require(_0x4b25('0x9'));var jayson=require(_0x4b25('0xa'));var client=jayson[_0x4b25('0xb')][_0x4b25('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4b25('0xd')],{'host':_0x4b25('0xe'),'port':0x18eb});var socket=require(_0x4b25('0xf'))(new Redis(config[_0x4b25('0xd')]));require(_0x4b25('0x10'))[_0x4b25('0x11')](socket);function respondWithRpcPromise(_0x9e2fae,_0xb87327,_0x2d4889){return new BPromise(function(_0x47054d,_0x125788){return client[_0x4b25('0x12')](_0x9e2fae,_0x2d4889)[_0x4b25('0x13')](function(_0x511378){logger[_0x4b25('0x14')]('SmsMessage,\x20%s,\x20%s',_0xb87327,_0x4b25('0x15'));logger['debug'](_0x4b25('0x16'),_0xb87327,_0x4b25('0x15'),JSON[_0x4b25('0x17')](_0x511378));if(_0x511378['error']){if(_0x511378[_0x4b25('0x18')][_0x4b25('0x19')]===0x1f4){logger[_0x4b25('0x18')]('SmsMessage,\x20%s,\x20%s',_0xb87327,_0x511378[_0x4b25('0x18')][_0x4b25('0x1a')]);return _0x125788(_0x511378[_0x4b25('0x18')][_0x4b25('0x1a')]);}logger[_0x4b25('0x18')](_0x4b25('0x1b'),_0xb87327,_0x511378[_0x4b25('0x18')][_0x4b25('0x1a')]);return _0x47054d(_0x511378[_0x4b25('0x18')][_0x4b25('0x1a')]);}else{logger[_0x4b25('0x14')](_0x4b25('0x1b'),_0xb87327,_0x4b25('0x15'));_0x47054d(_0x511378[_0x4b25('0x1c')][_0x4b25('0x1a')]);}})['catch'](function(_0x3b67e7){logger[_0x4b25('0x18')](_0x4b25('0x1b'),_0xb87327,_0x3b67e7);_0x125788(_0x3b67e7);});});}exports[_0x4b25('0x1d')]=function(_0x392298){var _0x385f54=this;return new Promise(function(_0x37e03b,_0x42a6a5){return db['SmsMessage'][_0x4b25('0x1e')](_0x392298['body'],{'raw':_0x392298['options']?_0x392298[_0x4b25('0x1f')][_0x4b25('0x20')]===undefined?!![]:![]:!![]})[_0x4b25('0x13')](function(_0x2c56fc){logger[_0x4b25('0x14')](_0x4b25('0x1d'),_0x392298);logger[_0x4b25('0x21')](_0x4b25('0x1d'),_0x392298,JSON[_0x4b25('0x17')](_0x2c56fc));_0x37e03b(_0x2c56fc);})[_0x4b25('0x22')](function(_0x792e67){logger[_0x4b25('0x18')](_0x4b25('0x1d'),_0x792e67['message'],_0x392298);_0x42a6a5(_0x385f54[_0x4b25('0x18')](0x1f4,_0x792e67[_0x4b25('0x1a')]));});});}; \ No newline at end of file +var _0x8e8a=['error','code','message','info','catch','CreateSmsMessage','SmsMessage','create','options','raw','then','stringify','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','./smsMessage.socket','register','request','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x1bcd2a,_0x1f4f0e){var _0x4a14db=function(_0x2e0870){while(--_0x2e0870){_0x1bcd2a['push'](_0x1bcd2a['shift']());}};_0x4a14db(++_0x1f4f0e);}(_0x8e8a,0x88));var _0xa8e8=function(_0x31c536,_0x21a315){_0x31c536=_0x31c536-0x0;var _0x3b1e6e=_0x8e8a[_0x31c536];return _0x3b1e6e;};'use strict';var _=require(_0xa8e8('0x0'));var util=require(_0xa8e8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa8e8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa8e8('0x3'))['db'];var utils=require(_0xa8e8('0x4'));var logger=require(_0xa8e8('0x5'))(_0xa8e8('0x6'));var config=require('../../config/environment');var jayson=require(_0xa8e8('0x7'));var client=jayson[_0xa8e8('0x8')][_0xa8e8('0x9')]({'port':0x232a});config['redis']=_[_0xa8e8('0xa')](config[_0xa8e8('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa8e8('0xb')]));require(_0xa8e8('0xc'))[_0xa8e8('0xd')](socket);function respondWithRpcPromise(_0x2a920f,_0x2dc1b2,_0xc1d998){return new BPromise(function(_0x486f48,_0x37bcdf){return client[_0xa8e8('0xe')](_0x2a920f,_0xc1d998)['then'](function(_0x3211d6){logger['info'](_0xa8e8('0xf'),_0x2dc1b2,_0xa8e8('0x10'));logger[_0xa8e8('0x11')](_0xa8e8('0x12'),_0x2dc1b2,'request\x20sent',JSON['stringify'](_0x3211d6));if(_0x3211d6['error']){if(_0x3211d6[_0xa8e8('0x13')][_0xa8e8('0x14')]===0x1f4){logger['error'](_0xa8e8('0xf'),_0x2dc1b2,_0x3211d6['error']['message']);return _0x37bcdf(_0x3211d6['error'][_0xa8e8('0x15')]);}logger[_0xa8e8('0x13')]('SmsMessage,\x20%s,\x20%s',_0x2dc1b2,_0x3211d6[_0xa8e8('0x13')]['message']);return _0x486f48(_0x3211d6[_0xa8e8('0x13')]['message']);}else{logger[_0xa8e8('0x16')](_0xa8e8('0xf'),_0x2dc1b2,_0xa8e8('0x10'));_0x486f48(_0x3211d6['result']['message']);}})[_0xa8e8('0x17')](function(_0x419f3e){logger['error'](_0xa8e8('0xf'),_0x2dc1b2,_0x419f3e);_0x37bcdf(_0x419f3e);});});}exports[_0xa8e8('0x18')]=function(_0x27242e){var _0x49297b=this;return new Promise(function(_0x643d94,_0x109058){return db[_0xa8e8('0x19')][_0xa8e8('0x1a')](_0x27242e['body'],{'raw':_0x27242e[_0xa8e8('0x1b')]?_0x27242e[_0xa8e8('0x1b')][_0xa8e8('0x1c')]===undefined?!![]:![]:!![]})[_0xa8e8('0x1d')](function(_0x23f754){logger[_0xa8e8('0x16')](_0xa8e8('0x18'),_0x27242e);logger[_0xa8e8('0x11')]('CreateSmsMessage',_0x27242e,JSON[_0xa8e8('0x1e')](_0x23f754));_0x643d94(_0x23f754);})[_0xa8e8('0x17')](function(_0x406474){logger[_0xa8e8('0x13')](_0xa8e8('0x18'),_0x406474[_0xa8e8('0x15')],_0x27242e);_0x109058(_0x49297b['error'](0x1f4,_0x406474[_0xa8e8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index c641e6b..2493ec3 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 _0xccd9=['length','remove','update','emit'];(function(_0x51888b,_0x1fb992){var _0x43ad21=function(_0x2b68e9){while(--_0x2b68e9){_0x51888b['push'](_0x51888b['shift']());}};_0x43ad21(++_0x1fb992);}(_0xccd9,0x191));var _0x9ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd9[_0x3dd15e];return _0x231fd0;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0x9ccd('0x0'),_0x9ccd('0x1')];function createListener(_0x39343b,_0x5e863d){return function(_0x174ac9){_0x5e863d[_0x9ccd('0x2')](_0x39343b,_0x174ac9);};}function removeListener(_0x3ab764,_0x33ee86){return function(){SmsMessageEvents['removeListener'](_0x3ab764,_0x33ee86);};}exports['register']=function(_0xb86921){for(var _0x125e33=0x0,_0x7d6b20=events[_0x9ccd('0x3')];_0x125e33<_0x7d6b20;_0x125e33++){var _0x79f9fa=events[_0x125e33];var _0x284adf=createListener('smsMessage:'+_0x79f9fa,_0xb86921);SmsMessageEvents['on'](_0x79f9fa,_0x284adf);}}; \ No newline at end of file +var _0x8584=['save','remove','update','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x56e86f,_0x91eb2d){var _0x30df16=function(_0x216ac0){while(--_0x216ac0){_0x56e86f['push'](_0x56e86f['shift']());}};_0x30df16(++_0x91eb2d);}(_0x8584,0xbc));var _0x4858=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x8584[_0x2f5ac5];return _0x37c9a8;};'use strict';var SmsMessageEvents=require(_0x4858('0x0'));var events=[_0x4858('0x1'),_0x4858('0x2'),_0x4858('0x3')];function createListener(_0x20c646,_0x10a541){return function(_0x123113){_0x10a541[_0x4858('0x4')](_0x20c646,_0x123113);};}function removeListener(_0x1add97,_0x595042){return function(){SmsMessageEvents[_0x4858('0x5')](_0x1add97,_0x595042);};}exports[_0x4858('0x6')]=function(_0x295cc8){for(var _0x1293e8=0x0,_0x40ca26=events[_0x4858('0x7')];_0x1293e8<_0x40ca26;_0x1293e8++){var _0x4d03de=events[_0x1293e8];var _0x56b574=createListener(_0x4858('0x8')+_0x4d03de,_0x295cc8);SmsMessageEvents['on'](_0x4d03de,_0x56b574);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index e5174d7..5149857 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 _0xf072=['update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','post','/:id/teams','put'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0xf072,0xb3));var _0x2f07=function(_0x23e5a8,_0x1a32d0){_0x23e5a8=_0x23e5a8-0x0;var _0x39df93=_0xf072[_0x23e5a8];return _0x39df93;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require(_0x2f07('0x3'));var express=require(_0x2f07('0x4'));var router=express['Router']();var fs_extra=require(_0x2f07('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2f07('0x6'));var config=require(_0x2f07('0x7'));var controller=require(_0x2f07('0x8'));router[_0x2f07('0x9')]('/',auth[_0x2f07('0xa')](),controller['index']);router['get'](_0x2f07('0xb'),auth[_0x2f07('0xa')](),controller[_0x2f07('0xc')]);router[_0x2f07('0x9')](_0x2f07('0xd'),auth['isAuthenticated'](),controller[_0x2f07('0xe')]);router[_0x2f07('0x9')](_0x2f07('0xf'),auth[_0x2f07('0xa')](),controller[_0x2f07('0x10')]);router[_0x2f07('0x9')]('/:id/teams',auth[_0x2f07('0xa')](),controller[_0x2f07('0x11')]);router['get'](_0x2f07('0x12'),auth[_0x2f07('0xa')](),controller[_0x2f07('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2f07('0x14')]);router[_0x2f07('0x15')](_0x2f07('0x16'),auth['isAuthenticated'](),controller['addTeams']);router[_0x2f07('0x15')](_0x2f07('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x2f07('0x17')](_0x2f07('0xd'),auth[_0x2f07('0xa')](),controller[_0x2f07('0x18')]);router[_0x2f07('0x19')]('/:id',auth[_0x2f07('0xa')](),controller[_0x2f07('0x1a')]);router[_0x2f07('0x19')](_0x2f07('0x16'),auth[_0x2f07('0xa')](),controller[_0x2f07('0x1b')]);router[_0x2f07('0x19')](_0x2f07('0x12'),auth[_0x2f07('0xa')](),controller['removeAgents']);module[_0x2f07('0x1c')]=router; \ No newline at end of file +var _0x41eb=['./smsQueue.controller','get','index','/describe','describe','/:id','isAuthenticated','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','path','Router','fs-extra','../../components/interaction/service'];(function(_0x3bbbdf,_0x22159c){var _0x133799=function(_0x5f5280){while(--_0x5f5280){_0x3bbbdf['push'](_0x3bbbdf['shift']());}};_0x133799(++_0x22159c);}(_0x41eb,0x7d));var _0xb41e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41eb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb41e('0x0'));var util=require('util');var path=require(_0xb41e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb41e('0x2')]();var fs_extra=require(_0xb41e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb41e('0x4'));var config=require('../../config/environment');var controller=require(_0xb41e('0x5'));router[_0xb41e('0x6')]('/',auth['isAuthenticated'](),controller[_0xb41e('0x7')]);router[_0xb41e('0x6')](_0xb41e('0x8'),auth['isAuthenticated'](),controller[_0xb41e('0x9')]);router[_0xb41e('0x6')](_0xb41e('0xa'),auth[_0xb41e('0xb')](),controller['show']);router['get'](_0xb41e('0xc'),auth['isAuthenticated'](),controller[_0xb41e('0xd')]);router[_0xb41e('0x6')](_0xb41e('0xe'),auth[_0xb41e('0xb')](),controller[_0xb41e('0xf')]);router[_0xb41e('0x6')](_0xb41e('0x10'),auth[_0xb41e('0xb')](),controller['getAgents']);router[_0xb41e('0x11')]('/',auth[_0xb41e('0xb')](),controller[_0xb41e('0x12')]);router['post'](_0xb41e('0xe'),auth[_0xb41e('0xb')](),controller[_0xb41e('0x13')]);router[_0xb41e('0x11')]('/:id/users',auth[_0xb41e('0xb')](),controller[_0xb41e('0x14')]);router[_0xb41e('0x15')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb41e('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xb41e('0x16')](_0xb41e('0xe'),auth[_0xb41e('0xb')](),controller[_0xb41e('0x17')]);router[_0xb41e('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0xb41e('0x18')]);module[_0xb41e('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index f853cf2..e023a26 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 _0x14b8=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x11c0cb,_0x4476aa){var _0x3dbf20=function(_0x58f366){while(--_0x58f366){_0x11c0cb['push'](_0x11c0cb['shift']());}};_0x3dbf20(++_0x4476aa);}(_0x14b8,0xe2));var _0x814b=function(_0x5e4f2f,_0x163926){_0x5e4f2f=_0x5e4f2f-0x0;var _0x58137d=_0x14b8[_0x5e4f2f];return _0x58137d;};'use strict';var Sequelize=require(_0x814b('0x0'));module[_0x814b('0x1')]={'name':{'type':Sequelize[_0x814b('0x2')],'unique':_0x814b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x814b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x814b('0x5')](_0x814b('0x6'),_0x814b('0x7'),_0x814b('0x8'))}}; \ No newline at end of file +var _0x7780=['rrmemory','beepall','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x5b1a59,_0x1901da){var _0x49eade=function(_0x1f92bc){while(--_0x1f92bc){_0x5b1a59['push'](_0x5b1a59['shift']());}};_0x49eade(++_0x1901da);}(_0x7780,0xc6));var _0x0778=function(_0x5d3306,_0x6e1379){_0x5d3306=_0x5d3306-0x0;var _0x6968f7=_0x7780[_0x5d3306];return _0x6968f7;};'use strict';var Sequelize=require(_0x0778('0x0'));module[_0x0778('0x1')]={'name':{'type':Sequelize[_0x0778('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0778('0x2')]},'timeout':{'type':Sequelize[_0x0778('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0778('0x4')](_0x0778('0x5'),_0x0778('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 2662e50..368b9dd 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 _0x5f66=['show','params','model','keys','intersection','attributes','fields','includeAll','merge','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','rawAttributes','filters','hasOwnProperty','order','sort','pick','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','length','filter','nolimit','ids','Team','Agents','interface','flatMap','sequelize','transaction','addTeams','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','isArray','findOne','getAgents','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','./smsQueue.socket','register','end','json','offset','limit','undefined','count','status','update','then','UserProfileResource','destroy','sendStatus','stack','name','send','index','fieldName','key','getOptions','where','SmsQueue','include','query','findAll','catch'];(function(_0x4ca1b8,_0x9faad5){var _0x49b9e4=function(_0x360bcd){while(--_0x360bcd){_0x4ca1b8['push'](_0x4ca1b8['shift']());}};_0x49b9e4(++_0x9faad5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var BPromise=require('bluebird');var util=require(_0x65f6('0x0'));var _=require('lodash');var squel=require(_0x65f6('0x1'));var Redis=require(_0x65f6('0x2'));var qs=require(_0x65f6('0x3'));var logger=require(_0x65f6('0x4'))(_0x65f6('0x5'));var config=require('../../config/environment');var db=require(_0x65f6('0x6'))['db'];config['redis']=_[_0x65f6('0x7')](config[_0x65f6('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65f6('0x8')]));require(_0x65f6('0x9'))[_0x65f6('0xa')](socket);function respondWithStatusCode(_0x8f6451,_0xc44c70){_0xc44c70=_0xc44c70||0xcc;return function(_0x14f4c7){if(_0x14f4c7){return _0x8f6451['sendStatus'](_0xc44c70);}return _0x8f6451['status'](_0xc44c70)[_0x65f6('0xb')]();};}function respondWithResult(_0x2f6d5b,_0x264647){_0x264647=_0x264647||0xc8;return function(_0x25c416){if(_0x25c416){return _0x2f6d5b['status'](_0x264647)[_0x65f6('0xc')](_0x25c416);}};}function respondWithFilteredResult(_0x571436,_0x497cf3){return function(_0x2d2dfa){if(_0x2d2dfa){var _0x576875=typeof _0x497cf3[_0x65f6('0xd')]==='undefined'&&typeof _0x497cf3[_0x65f6('0xe')]===_0x65f6('0xf');var _0x2c4ee5=_0x2d2dfa[_0x65f6('0x10')];var _0x369f96=_0x576875?0x0:_0x497cf3[_0x65f6('0xd')];var _0x44144b=_0x576875?_0x2d2dfa[_0x65f6('0x10')]:_0x497cf3[_0x65f6('0xd')]+_0x497cf3[_0x65f6('0xe')];var _0x59154e;if(_0x44144b>=_0x2c4ee5){_0x44144b=_0x2c4ee5;_0x59154e=0xc8;}else{_0x59154e=0xce;}_0x571436[_0x65f6('0x11')](_0x59154e);return _0x571436['set']('Content-Range',_0x369f96+'-'+_0x44144b+'/'+_0x2c4ee5)[_0x65f6('0xc')](_0x2d2dfa);}return null;};}function saveUpdates(_0x5c69f8){return function(_0x37330d){if(_0x37330d){return _0x37330d[_0x65f6('0x12')](_0x5c69f8)[_0x65f6('0x13')](function(_0x1f974c){return _0x1f974c;});}return null;};}function removeEntity(_0xc8660c){return function(_0x18380e){if(_0x18380e){return _0x18380e['destroy']()['then'](function(){var _0x2d538c=_0x18380e['get']({'plain':!![]});var _0x4c81f3='SmsQueues';return db[_0x65f6('0x14')][_0x65f6('0x15')]({'where':{'type':_0x4c81f3,'resourceId':_0x2d538c['id']}})['then'](function(){return _0x18380e;});})[_0x65f6('0x13')](function(){_0xc8660c[_0x65f6('0x11')](0xcc)[_0x65f6('0xb')]();});}};}function handleEntityNotFound(_0x3876ed){return function(_0x219ab2){if(!_0x219ab2){_0x3876ed[_0x65f6('0x16')](0x194);}return _0x219ab2;};}function handleError(_0x581374,_0x197a49){_0x197a49=_0x197a49||0x1f4;return function(_0x4bb39e){logger['error'](_0x4bb39e[_0x65f6('0x17')]);if(_0x4bb39e[_0x65f6('0x18')]){delete _0x4bb39e['name'];}_0x581374[_0x65f6('0x11')](_0x197a49)[_0x65f6('0x19')](_0x4bb39e);};}exports[_0x65f6('0x1a')]=function(_0x2774a1,_0x4f5a69){var _0x9d7bb0={};var _0x59ea32={'count':0x0,'rows':[]};var _0x20a161=_['map'](db['SmsQueue']['rawAttributes'],function(_0x29abdb){return{'name':_0x29abdb[_0x65f6('0x1b')],'type':_0x29abdb['type'][_0x65f6('0x1c')]};});_0x9d7bb0=qs[_0x65f6('0x1d')](_0x20a161,_0x2774a1);var _0x52277c={'where':_0x9d7bb0[_0x65f6('0x1e')]};return db[_0x65f6('0x1f')][_0x65f6('0x10')](_0x52277c)['then'](function(_0x4ac04b){_0x59ea32['count']=_0x4ac04b;_0x9d7bb0[_0x65f6('0x20')]=qs[_0x65f6('0x20')](_0x2774a1[_0x65f6('0x21')]);return db[_0x65f6('0x1f')][_0x65f6('0x22')](_0x9d7bb0);})[_0x65f6('0x13')](function(_0x144e55){_0x59ea32['rows']=_0x144e55;return _0x59ea32;})['then'](respondWithFilteredResult(_0x4f5a69,_0x9d7bb0))[_0x65f6('0x23')](handleError(_0x4f5a69,null));};exports[_0x65f6('0x24')]=function(_0x5878bc,_0x4e50c0){var _0x10b368={'raw':!![],'where':{'id':_0x5878bc[_0x65f6('0x25')]['id']}},_0x1ce43c={};_0x1ce43c[_0x65f6('0x26')]=_[_0x65f6('0x27')](db[_0x65f6('0x1f')]['rawAttributes']);_0x1ce43c[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x5878bc[_0x65f6('0x21')]);_0x1ce43c['filters']=_[_0x65f6('0x28')](_0x1ce43c[_0x65f6('0x26')],_0x1ce43c[_0x65f6('0x21')]);_0x10b368[_0x65f6('0x29')]=_[_0x65f6('0x28')](_0x1ce43c[_0x65f6('0x26')],qs['fields'](_0x5878bc[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x10b368['attributes']=_0x10b368[_0x65f6('0x29')]['length']?_0x10b368[_0x65f6('0x29')]:_0x1ce43c['model'];if(_0x5878bc[_0x65f6('0x21')][_0x65f6('0x2b')]){_0x10b368['include']=[{'all':!![]}];}_0x10b368=_[_0x65f6('0x2c')]({},_0x10b368,_0x5878bc[_0x65f6('0x2d')]);return db[_0x65f6('0x1f')]['find'](_0x10b368)['then'](handleEntityNotFound(_0x4e50c0,null))[_0x65f6('0x13')](respondWithResult(_0x4e50c0,null))['catch'](handleError(_0x4e50c0,null));};exports[_0x65f6('0x2e')]=function(_0x4e6653,_0x22d760){return db[_0x65f6('0x1f')]['create'](_0x4e6653[_0x65f6('0x2f')],{})['then'](function(_0x5edd04){var _0x71b16b=_0x4e6653[_0x65f6('0x30')][_0x65f6('0x31')]({'plain':!![]});if(!_0x71b16b)throw new Error(_0x65f6('0x32'));if(_0x71b16b[_0x65f6('0x33')]===_0x65f6('0x30')){var _0x1a55da=_0x5edd04[_0x65f6('0x31')]({'plain':!![]});var _0x4f933b=_0x65f6('0x34');return db['UserProfileSection'][_0x65f6('0x35')]({'where':{'name':_0x4f933b,'userProfileId':_0x71b16b[_0x65f6('0x36')]},'raw':!![]})[_0x65f6('0x13')](function(_0x2ea7f7){if(_0x2ea7f7&&_0x2ea7f7['autoAssociation']===0x0){return db[_0x65f6('0x14')][_0x65f6('0x2e')]({'name':_0x1a55da[_0x65f6('0x18')],'resourceId':_0x1a55da['id'],'type':_0x2ea7f7[_0x65f6('0x18')],'sectionId':_0x2ea7f7['id']},{})[_0x65f6('0x13')](function(){return _0x5edd04;});}else{return _0x5edd04;}})[_0x65f6('0x23')](function(_0xed4c96){logger[_0x65f6('0x37')](_0x65f6('0x38'),_0xed4c96);throw _0xed4c96;});}return _0x5edd04;})['then'](respondWithResult(_0x22d760,0xc9))[_0x65f6('0x23')](handleError(_0x22d760,null));};exports[_0x65f6('0x12')]=function(_0x377ae5,_0x181798){if(_0x377ae5[_0x65f6('0x2f')]['id']){delete _0x377ae5[_0x65f6('0x2f')]['id'];}return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x377ae5[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x181798,null))[_0x65f6('0x13')](saveUpdates(_0x377ae5[_0x65f6('0x2f')],null))[_0x65f6('0x13')](respondWithResult(_0x181798,null))[_0x65f6('0x23')](handleError(_0x181798,null));};exports[_0x65f6('0x15')]=function(_0x2cb38d,_0x5119ee){return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x2cb38d[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x5119ee,null))['then'](removeEntity(_0x5119ee,null))[_0x65f6('0x23')](handleError(_0x5119ee,null));};exports[_0x65f6('0x39')]=function(_0x2b01eb,_0x5e69b4){return db[_0x65f6('0x1f')][_0x65f6('0x39')]()[_0x65f6('0x13')](respondWithResult(_0x5e69b4,null))[_0x65f6('0x23')](handleError(_0x5e69b4,null));};exports['getMembers']=function(_0x2ec114,_0x512527){var _0x3f1baa={'raw':!![],'where':{}},_0x6968b={},_0x577c93;return db[_0x65f6('0x1f')]['findOne']({'where':{'id':_0x2ec114[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x512527,null))[_0x65f6('0x13')](function(_0xc0db01){if(_0xc0db01){_0x577c93=_0xc0db01[_0x65f6('0x31')]({'plain':!![]});_0x6968b[_0x65f6('0x26')]=_['keys'](db['UserSmsQueue'][_0x65f6('0x3a')]);_0x6968b[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x2ec114[_0x65f6('0x21')]);_0x6968b[_0x65f6('0x3b')]=_[_0x65f6('0x28')](_0x6968b[_0x65f6('0x26')],_0x6968b[_0x65f6('0x21')]);_0x3f1baa[_0x65f6('0x29')]=_['intersection'](_0x6968b[_0x65f6('0x26')],qs[_0x65f6('0x2a')](_0x2ec114[_0x65f6('0x21')]['fields']));_0x3f1baa[_0x65f6('0x29')]=_0x3f1baa[_0x65f6('0x29')]['length']?_0x3f1baa[_0x65f6('0x29')]:_0x6968b[_0x65f6('0x26')];if(!_0x2ec114['query'][_0x65f6('0x3c')]('nolimit')){_0x3f1baa[_0x65f6('0xe')]=qs[_0x65f6('0xe')](_0x2ec114[_0x65f6('0x21')]['limit']);_0x3f1baa[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x2ec114['query'][_0x65f6('0xd')]);}_0x3f1baa[_0x65f6('0x3d')]=qs['sort'](_0x2ec114[_0x65f6('0x21')][_0x65f6('0x3e')]);_0x3f1baa[_0x65f6('0x1e')]=qs[_0x65f6('0x3b')](_[_0x65f6('0x3f')](_0x2ec114[_0x65f6('0x21')],_0x6968b[_0x65f6('0x3b')]));_0x3f1baa[_0x65f6('0x1e')]['SmsQueueId']=_0xc0db01['id'];if(_0x2ec114['query']['filter']){_0x3f1baa[_0x65f6('0x1e')]=_[_0x65f6('0x2c')](_0x3f1baa[_0x65f6('0x1e')],{'$or':_[_0x65f6('0x40')](_0x3f1baa['attributes'],function(_0x183c08){var _0x2032b9={};_0x2032b9[_0x183c08]={'$like':'%'+_0x2ec114[_0x65f6('0x21')]['filter']+'%'};return _0x2032b9;})});}_0x3f1baa=_[_0x65f6('0x2c')]({},_0x3f1baa,_0x2ec114[_0x65f6('0x2d')]);return db[_0x65f6('0x41')]['findAll'](_0x3f1baa);}})['then'](function(_0x1d337d){if(_0x1d337d){return db[_0x65f6('0x42')][_0x65f6('0x43')]({'where':{'id':_[_0x65f6('0x40')](_0x1d337d,_0x65f6('0x44')),'role':_0x65f6('0x45')},'attributes':['id',_0x65f6('0x18'),_0x65f6('0x46'),_0x65f6('0x47'),_0x65f6('0x48')]});}})[_0x65f6('0x13')](function(_0x141fcc){if(_0x141fcc){return{'count':_0x141fcc[_0x65f6('0x10')],'rows':_[_0x65f6('0x40')](_0x141fcc['rows'],function(_0x47610a){return{'membername':_0x47610a[_0x65f6('0x18')],'UserId':_0x47610a['id'],'queue_name':_0x577c93[_0x65f6('0x18')],'SmsQueueId':_0x577c93['id'],'interface':util['format'](_0x65f6('0x49'),_0x65f6('0x4a'),_0x47610a[_0x65f6('0x18')]),'penalty':0x0,'paused':_0x47610a[_0x65f6('0x46')],'createdAt':_0x47610a['createdAt'],'updatedAt':_0x47610a[_0x65f6('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x65f6('0x13')](respondWithFilteredResult(_0x512527,_0x3f1baa))[_0x65f6('0x23')](handleError(_0x512527,null));};exports[_0x65f6('0x4b')]=function(_0x553ff0,_0x2923ff){var _0x2fc20f={};var _0x5c55e4={};var _0x28682b;var _0x26481e;return db[_0x65f6('0x1f')]['findOne']({'where':{'id':_0x553ff0[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x2923ff,null))[_0x65f6('0x13')](function(_0x3c23e3){if(_0x3c23e3){_0x28682b=_0x3c23e3;_0x5c55e4[_0x65f6('0x26')]=_[_0x65f6('0x27')](db['Team']['rawAttributes']);_0x5c55e4['query']=_[_0x65f6('0x27')](_0x553ff0[_0x65f6('0x21')]);_0x5c55e4[_0x65f6('0x3b')]=_[_0x65f6('0x28')](_0x5c55e4[_0x65f6('0x26')],_0x5c55e4[_0x65f6('0x21')]);_0x2fc20f['attributes']=_[_0x65f6('0x28')](_0x5c55e4[_0x65f6('0x26')],qs['fields'](_0x553ff0[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x2fc20f[_0x65f6('0x29')]=_0x2fc20f['attributes'][_0x65f6('0x4c')]?_0x2fc20f[_0x65f6('0x29')]:_0x5c55e4['model'];_0x2fc20f[_0x65f6('0x3d')]=qs[_0x65f6('0x3e')](_0x553ff0[_0x65f6('0x21')][_0x65f6('0x3e')]);_0x2fc20f[_0x65f6('0x1e')]=qs[_0x65f6('0x3b')](_[_0x65f6('0x3f')](_0x553ff0['query'],_0x5c55e4['filters']));if(_0x553ff0[_0x65f6('0x21')][_0x65f6('0x4d')]){_0x2fc20f['where']=_[_0x65f6('0x2c')](_0x2fc20f['where'],{'$or':_[_0x65f6('0x40')](_0x2fc20f['attributes'],function(_0x440df1){var _0xdc8989={};_0xdc8989[_0x440df1]={'$like':'%'+_0x553ff0[_0x65f6('0x21')][_0x65f6('0x4d')]+'%'};return _0xdc8989;})});}_0x2fc20f=_[_0x65f6('0x2c')]({},_0x2fc20f,_0x553ff0[_0x65f6('0x2d')]);return _0x28682b[_0x65f6('0x4b')](_0x2fc20f);}})[_0x65f6('0x13')](function(_0x2405a7){if(_0x2405a7){_0x26481e=_0x2405a7['length'];if(!_0x553ff0['query'][_0x65f6('0x3c')](_0x65f6('0x4e'))){_0x2fc20f[_0x65f6('0xe')]=qs['limit'](_0x553ff0['query'][_0x65f6('0xe')]);_0x2fc20f[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x553ff0[_0x65f6('0x21')][_0x65f6('0xd')]);}return _0x28682b[_0x65f6('0x4b')](_0x2fc20f);}})['then'](function(_0x4f42ae){if(_0x4f42ae){return _0x4f42ae?{'count':_0x26481e,'rows':_0x4f42ae}:null;}})[_0x65f6('0x13')](respondWithResult(_0x2923ff,null))[_0x65f6('0x23')](handleError(_0x2923ff,null));};exports['addTeams']=function(_0x219bf8,_0x4a8b60){var _0x254e9f=_0x219bf8[_0x65f6('0x2f')][_0x65f6('0x4f')];return db[_0x65f6('0x50')]['findAll']({'where':{'id':_0x254e9f},'attributes':['id'],'include':[{'model':db[_0x65f6('0x42')],'as':_0x65f6('0x51'),'attributes':['id',_0x65f6('0x18'),'online','voicePause',_0x65f6('0x52')],'raw':!![]}]})['then'](function(_0x305967){if(_0x305967){var _0xf6de=_[_0x65f6('0x53')](_0x305967,function(_0x354b90){var _0x512776=_0x354b90['get']({'plain':!![]});return _0x512776['Agents'];});return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x219bf8[_0x65f6('0x25')]['id']}})['then'](function(_0x46cbde){return db[_0x65f6('0x54')][_0x65f6('0x55')](function(_0x49cee2){return _0x46cbde[_0x65f6('0x56')](_0x254e9f,{'transaction':_0x49cee2})[_0x65f6('0x13')](function(){return BPromise['each'](_0xf6de,function(_0x758e80){return db[_0x65f6('0x41')]['findOrCreate']({'where':{'UserId':_0x758e80['id'],'SmsQueueId':_0x219bf8[_0x65f6('0x25')]['id']},'transaction':_0x49cee2});});})['then'](function(){_0xf6de[_0x65f6('0x57')](function(_0x55ea91){socket[_0x65f6('0x58')](_0x65f6('0x59'),{'UserId':_0x55ea91['id'],'SmsQueueId':_0x46cbde['id']});});});});});}})['then'](respondWithStatusCode(_0x4a8b60,null))[_0x65f6('0x23')](handleError(_0x4a8b60,null));};exports[_0x65f6('0x5a')]=function(_0x2a700b,_0x299b85){return db[_0x65f6('0x50')][_0x65f6('0x22')]({'where':{'id':_0x2a700b[_0x65f6('0x21')][_0x65f6('0x4f')]},'attributes':['id'],'include':[{'model':db[_0x65f6('0x42')],'as':_0x65f6('0x51'),'attributes':['id'],'raw':!![]}]})[_0x65f6('0x13')](handleEntityNotFound(_0x299b85,null))['then'](function(_0x10a661){var _0x1cf1bd=_[_0x65f6('0x40')](_0x10a661,'id');var _0x219e42=[];var _0x5694f9=[];var _0x453080=squel[_0x65f6('0x5b')]();_0x453080['field'](_0x65f6('0x5c'))['from'](_0x65f6('0x5d'),'tq')['join'](_0x65f6('0x5e'),'ut',_0x65f6('0x5f'))['where']('SmsQueueId\x20=\x20?',_0x2a700b[_0x65f6('0x25')]['id']);for(var _0x413c21=0x0;_0x413c21<_0x10a661['length'];_0x413c21+=0x1){let _0x2d86c8=_0x10a661[_0x413c21];for(var _0x3b3bd5=0x0;_0x3b3bd5<_0x2d86c8[_0x65f6('0x51')]['length'];_0x3b3bd5+=0x1){let _0x1348ec=_0x2d86c8[_0x65f6('0x51')][_0x3b3bd5];var _0x5889dc=_0x453080[_0x65f6('0x60')]();_0x5889dc['where'](_0x65f6('0x61'),_0x1348ec['id']);_0x5694f9['push'](db['sequelize'][_0x65f6('0x21')](_0x5889dc[_0x65f6('0x62')](),{'type':db[_0x65f6('0x54')][_0x65f6('0x63')][_0x65f6('0x64')]})[_0x65f6('0x13')](function(_0x1ac46f){if(_0x1ac46f[_0x65f6('0x4c')]===0x1){return _0x1348ec['id'];}else{var _0x4d66fe=_['every'](_[_0x65f6('0x40')](_0x1ac46f,'TeamId'),function(_0x1ee28a){return _[_0x65f6('0x65')](_0x1cf1bd,_0x1ee28a);});if(_0x4d66fe){return _0x1348ec['id'];}}}));}}return BPromise[_0x65f6('0x66')](_0x5694f9)[_0x65f6('0x13')](function(_0x43127b){_0x219e42=_(_0x219e42)['union'](_0x43127b)[_0x65f6('0x67')]()[_0x65f6('0x68')]();return db[_0x65f6('0x1f')]['find']({'where':{'id':_0x2a700b[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](function(_0x4254c2){return db[_0x65f6('0x54')][_0x65f6('0x55')](function(_0x16bf93){return _0x4254c2['removeTeams'](_0x2a700b['query'][_0x65f6('0x4f')],{'transaction':_0x16bf93})[_0x65f6('0x13')](function(){if(!_[_0x65f6('0x69')](_0x219e42)){return _0x4254c2[_0x65f6('0x6a')](_0x219e42,{'transaction':_0x16bf93});}})['then'](function(){_0x219e42['forEach'](function(_0x336076){socket[_0x65f6('0x58')](_0x65f6('0x6b'),{'UserId':_0x336076,'SmsQueueId':_0x4254c2['id']});});});});});});})[_0x65f6('0x13')](respondWithStatusCode(_0x299b85,null))[_0x65f6('0x23')](handleError(_0x299b85,null));};exports[_0x65f6('0x6c')]=function(_0x5daaf4,_0x4d607a){return db['SmsQueue'][_0x65f6('0x35')]({'where':{'id':_0x5daaf4[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x4d607a,null))[_0x65f6('0x13')](function(_0x53b11c){if(_0x53b11c){return _0x53b11c['addAgents'](_0x5daaf4[_0x65f6('0x2f')][_0x65f6('0x4f')],_['omit'](_0x5daaf4[_0x65f6('0x2f')],['ids','id'])||{})[_0x65f6('0x6d')](function(_0x4f3ef8){for(var _0x3a30ed=0x0;_0x3a30ed<_0x5daaf4[_0x65f6('0x2f')]['ids'][_0x65f6('0x4c')];_0x3a30ed+=0x1){socket[_0x65f6('0x58')](_0x65f6('0x59'),{'UserId':Number(_0x5daaf4[_0x65f6('0x2f')][_0x65f6('0x4f')][_0x3a30ed]),'SmsQueueId':Number(_0x5daaf4[_0x65f6('0x25')]['id'])});}return _0x4f3ef8;});}})['then'](respondWithResult(_0x4d607a,null))[_0x65f6('0x23')](handleError(_0x4d607a,null));};exports['removeAgents']=function(_0x24495c,_0x56336a){return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x24495c[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x56336a,null))['then'](function(_0x2b6f98){if(_0x2b6f98){return _0x2b6f98[_0x65f6('0x6a')](_0x24495c[_0x65f6('0x21')]['ids'])['then'](function(){if(_[_0x65f6('0x6e')](_0x24495c[_0x65f6('0x21')]['ids'])){for(var _0x180cde=0x0;_0x180cde<_0x24495c[_0x65f6('0x21')][_0x65f6('0x4f')]['length'];_0x180cde+=0x1){socket[_0x65f6('0x58')](_0x65f6('0x6b'),{'UserId':Number(_0x24495c['query'][_0x65f6('0x4f')][_0x180cde]),'SmsQueueId':Number(_0x24495c[_0x65f6('0x25')]['id'])});}}else{socket[_0x65f6('0x58')]('userSmsQueue:remove',{'UserId':Number(_0x24495c[_0x65f6('0x21')][_0x65f6('0x4f')]),'SmsQueueId':Number(_0x24495c[_0x65f6('0x25')]['id'])});}});}})['then'](respondWithStatusCode(_0x56336a,null))[_0x65f6('0x23')](handleError(_0x56336a,null));};exports['getAgents']=function(_0x1beaa7,_0x87a9e4){var _0x31ec61={};var _0x22be6e={};var _0x29b2de;var _0x430fb8;return db['SmsQueue'][_0x65f6('0x6f')]({'where':{'id':_0x1beaa7[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x87a9e4,null))[_0x65f6('0x13')](function(_0x207d15){if(_0x207d15){_0x29b2de=_0x207d15;_0x22be6e['model']=_['keys'](db['User'][_0x65f6('0x3a')]);_0x22be6e[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x1beaa7['query']);_0x22be6e[_0x65f6('0x3b')]=_['intersection'](_0x22be6e['model'],_0x22be6e[_0x65f6('0x21')]);_0x31ec61[_0x65f6('0x29')]=_['intersection'](_0x22be6e[_0x65f6('0x26')],qs[_0x65f6('0x2a')](_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x31ec61[_0x65f6('0x29')]=_0x31ec61[_0x65f6('0x29')][_0x65f6('0x4c')]?_0x31ec61[_0x65f6('0x29')]:_0x22be6e[_0x65f6('0x26')];_0x31ec61[_0x65f6('0x3d')]=qs[_0x65f6('0x3e')](_0x1beaa7[_0x65f6('0x21')]['sort']);_0x31ec61[_0x65f6('0x1e')]=qs['filters'](_['pick'](_0x1beaa7[_0x65f6('0x21')],_0x22be6e[_0x65f6('0x3b')]));if(_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x4d')]){_0x31ec61['where']=_[_0x65f6('0x2c')](_0x31ec61['where'],{'$or':_['map'](_0x31ec61[_0x65f6('0x29')],function(_0x99fe6e){var _0x1a7e52={};_0x1a7e52[_0x99fe6e]={'$like':'%'+_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x4d')]+'%'};return _0x1a7e52;})});}_0x31ec61=_[_0x65f6('0x2c')]({},_0x31ec61,_0x1beaa7['options']);return _0x29b2de[_0x65f6('0x70')](_0x31ec61);}})['then'](function(_0x1ef2a0){if(_0x1ef2a0){_0x430fb8=_0x1ef2a0[_0x65f6('0x4c')];if(!_0x1beaa7[_0x65f6('0x21')]['hasOwnProperty'](_0x65f6('0x4e'))){_0x31ec61['limit']=qs['limit'](_0x1beaa7[_0x65f6('0x21')][_0x65f6('0xe')]);_0x31ec61[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x1beaa7[_0x65f6('0x21')]['offset']);}return _0x29b2de[_0x65f6('0x70')](_0x31ec61);}})[_0x65f6('0x13')](function(_0x3bebe3){if(_0x3bebe3){return _0x3bebe3?{'count':_0x430fb8,'rows':_0x3bebe3}:null;}})[_0x65f6('0x13')](respondWithResult(_0x87a9e4,null))['catch'](handleError(_0x87a9e4,null));}; \ No newline at end of file +var _0x0b0e=['userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','union','value','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','update','SmsQueues','destroy','then','error','stack','name','send','SmsQueue','fieldName','type','key','getOptions','include','query','findAll','rows','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','params','nolimit','order','sort','where','SmsQueueId','filter','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','findOne','Team','pick','getTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1c7b4c,_0x5b85b2){_0x1c7b4c=_0x1c7b4c-0x0;var _0x18daf6=_0x0b0e[_0x1c7b4c];return _0x18daf6;};'use strict';var BPromise=require(_0xe0b0('0x0'));var util=require('util');var _=require(_0xe0b0('0x1'));var squel=require('squel');var Redis=require(_0xe0b0('0x2'));var qs=require(_0xe0b0('0x3'));var logger=require(_0xe0b0('0x4'))(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var db=require(_0xe0b0('0x7'))['db'];config[_0xe0b0('0x8')]=_[_0xe0b0('0x9')](config[_0xe0b0('0x8')],{'host':_0xe0b0('0xa'),'port':0x18eb});var socket=require(_0xe0b0('0xb'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xe0b0('0xc')](socket);function respondWithStatusCode(_0x435060,_0xc4a085){_0xc4a085=_0xc4a085||0xcc;return function(_0x2ac27e){if(_0x2ac27e){return _0x435060['sendStatus'](_0xc4a085);}return _0x435060[_0xe0b0('0xd')](_0xc4a085)[_0xe0b0('0xe')]();};}function respondWithResult(_0x553d4f,_0x1fef28){_0x1fef28=_0x1fef28||0xc8;return function(_0x2f32b6){if(_0x2f32b6){return _0x553d4f['status'](_0x1fef28)[_0xe0b0('0xf')](_0x2f32b6);}};}function respondWithFilteredResult(_0x2cdad2,_0x39b1c2){return function(_0x585615){if(_0x585615){var _0x3068c0=typeof _0x39b1c2[_0xe0b0('0x10')]===_0xe0b0('0x11')&&typeof _0x39b1c2[_0xe0b0('0x12')]===_0xe0b0('0x11');var _0x4d2bf7=_0x585615[_0xe0b0('0x13')];var _0x154de6=_0x3068c0?0x0:_0x39b1c2[_0xe0b0('0x10')];var _0x24babd=_0x3068c0?_0x585615[_0xe0b0('0x13')]:_0x39b1c2['offset']+_0x39b1c2[_0xe0b0('0x12')];var _0x5adb01;if(_0x24babd>=_0x4d2bf7){_0x24babd=_0x4d2bf7;_0x5adb01=0xc8;}else{_0x5adb01=0xce;}_0x2cdad2[_0xe0b0('0xd')](_0x5adb01);return _0x2cdad2[_0xe0b0('0x14')]('Content-Range',_0x154de6+'-'+_0x24babd+'/'+_0x4d2bf7)[_0xe0b0('0xf')](_0x585615);}return null;};}function saveUpdates(_0x4a4cc0){return function(_0x2d6fb6){if(_0x2d6fb6){return _0x2d6fb6[_0xe0b0('0x15')](_0x4a4cc0)['then'](function(_0x54a3eb){return _0x54a3eb;});}return null;};}function removeEntity(_0x46bb44){return function(_0x50a441){if(_0x50a441){return _0x50a441['destroy']()['then'](function(){var _0x1920ee=_0x50a441['get']({'plain':!![]});var _0x52598b=_0xe0b0('0x16');return db['UserProfileResource'][_0xe0b0('0x17')]({'where':{'type':_0x52598b,'resourceId':_0x1920ee['id']}})['then'](function(){return _0x50a441;});})[_0xe0b0('0x18')](function(){_0x46bb44[_0xe0b0('0xd')](0xcc)[_0xe0b0('0xe')]();});}};}function handleEntityNotFound(_0x310a6d){return function(_0x2cf6a1){if(!_0x2cf6a1){_0x310a6d['sendStatus'](0x194);}return _0x2cf6a1;};}function handleError(_0x4cae54,_0x2fa820){_0x2fa820=_0x2fa820||0x1f4;return function(_0x5512bb){logger[_0xe0b0('0x19')](_0x5512bb[_0xe0b0('0x1a')]);if(_0x5512bb['name']){delete _0x5512bb[_0xe0b0('0x1b')];}_0x4cae54['status'](_0x2fa820)[_0xe0b0('0x1c')](_0x5512bb);};}exports['index']=function(_0x28586d,_0x576352){var _0x3e5c88={};var _0x4de537={'count':0x0,'rows':[]};var _0x4700cc=_['map'](db[_0xe0b0('0x1d')]['rawAttributes'],function(_0x362aba){return{'name':_0x362aba[_0xe0b0('0x1e')],'type':_0x362aba[_0xe0b0('0x1f')][_0xe0b0('0x20')]};});_0x3e5c88=qs[_0xe0b0('0x21')](_0x4700cc,_0x28586d);var _0x10745d={'where':_0x3e5c88['where']};return db[_0xe0b0('0x1d')][_0xe0b0('0x13')](_0x10745d)['then'](function(_0x15e13b){_0x4de537[_0xe0b0('0x13')]=_0x15e13b;_0x3e5c88[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x28586d[_0xe0b0('0x23')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x24')](_0x3e5c88);})['then'](function(_0x1854b8){_0x4de537[_0xe0b0('0x25')]=_0x1854b8;return _0x4de537;})['then'](respondWithFilteredResult(_0x576352,_0x3e5c88))['catch'](handleError(_0x576352,null));};exports[_0xe0b0('0x26')]=function(_0x33e672,_0x422575){var _0x3f81d5={'raw':!![],'where':{'id':_0x33e672['params']['id']}},_0x2ab1b1={};_0x2ab1b1[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db[_0xe0b0('0x1d')][_0xe0b0('0x29')]);_0x2ab1b1[_0xe0b0('0x23')]=_['keys'](_0x33e672[_0xe0b0('0x23')]);_0x2ab1b1[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],_0x2ab1b1[_0xe0b0('0x23')]);_0x3f81d5[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3f81d5[_0xe0b0('0x2c')]=_0x3f81d5[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x3f81d5[_0xe0b0('0x2c')]:_0x2ab1b1['model'];if(_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2f')]){_0x3f81d5[_0xe0b0('0x22')]=[{'all':!![]}];}_0x3f81d5=_[_0xe0b0('0x30')]({},_0x3f81d5,_0x33e672[_0xe0b0('0x31')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x32')](_0x3f81d5)['then'](handleEntityNotFound(_0x422575,null))['then'](respondWithResult(_0x422575,null))['catch'](handleError(_0x422575,null));};exports['create']=function(_0x26137c,_0xc3d967){return db[_0xe0b0('0x1d')]['create'](_0x26137c[_0xe0b0('0x33')],{})[_0xe0b0('0x18')](function(_0x1cd705){var _0x297c64=_0x26137c['user'][_0xe0b0('0x34')]({'plain':!![]});if(!_0x297c64)throw new Error(_0xe0b0('0x35'));if(_0x297c64[_0xe0b0('0x36')]===_0xe0b0('0x37')){var _0x4265e3=_0x1cd705[_0xe0b0('0x34')]({'plain':!![]});var _0x8b745=_0xe0b0('0x16');return db[_0xe0b0('0x38')]['find']({'where':{'name':_0x8b745,'userProfileId':_0x297c64[_0xe0b0('0x39')]},'raw':!![]})['then'](function(_0x34178d){if(_0x34178d&&_0x34178d[_0xe0b0('0x3a')]===0x0){return db[_0xe0b0('0x3b')][_0xe0b0('0x3c')]({'name':_0x4265e3['name'],'resourceId':_0x4265e3['id'],'type':_0x34178d[_0xe0b0('0x1b')],'sectionId':_0x34178d['id']},{})[_0xe0b0('0x18')](function(){return _0x1cd705;});}else{return _0x1cd705;}})[_0xe0b0('0x3d')](function(_0x402a0e){logger[_0xe0b0('0x19')](_0xe0b0('0x3e'),_0x402a0e);throw _0x402a0e;});}return _0x1cd705;})[_0xe0b0('0x18')](respondWithResult(_0xc3d967,0xc9))[_0xe0b0('0x3d')](handleError(_0xc3d967,null));};exports['update']=function(_0x2aad80,_0x309bbf){if(_0x2aad80['body']['id']){delete _0x2aad80['body']['id'];}return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x2aad80['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x309bbf,null))[_0xe0b0('0x18')](saveUpdates(_0x2aad80[_0xe0b0('0x33')],null))[_0xe0b0('0x18')](respondWithResult(_0x309bbf,null))[_0xe0b0('0x3d')](handleError(_0x309bbf,null));};exports['destroy']=function(_0x5d2fa2,_0x51c580){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x5d2fa2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x51c580,null))[_0xe0b0('0x18')](removeEntity(_0x51c580,null))[_0xe0b0('0x3d')](handleError(_0x51c580,null));};exports[_0xe0b0('0x3f')]=function(_0x16ccca,_0x5c6f94){return db['SmsQueue'][_0xe0b0('0x3f')]()[_0xe0b0('0x18')](respondWithResult(_0x5c6f94,null))[_0xe0b0('0x3d')](handleError(_0x5c6f94,null));};exports[_0xe0b0('0x40')]=function(_0x1bf77d,_0x575c7d){var _0x3b1474={'raw':!![],'where':{}},_0x11d4fd={},_0x534340;return db['SmsQueue']['findOne']({'where':{'id':_0x1bf77d[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x575c7d,null))[_0xe0b0('0x18')](function(_0x364877){if(_0x364877){_0x534340=_0x364877['get']({'plain':!![]});_0x11d4fd[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db['UserSmsQueue']['rawAttributes']);_0x11d4fd[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x1bf77d['query']);_0x11d4fd[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x11d4fd['model'],_0x11d4fd['query']);_0x3b1474[_0xe0b0('0x2c')]=_['intersection'](_0x11d4fd[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3b1474[_0xe0b0('0x2c')]=_0x3b1474[_0xe0b0('0x2c')]['length']?_0x3b1474['attributes']:_0x11d4fd[_0xe0b0('0x27')];if(!_0x1bf77d['query']['hasOwnProperty'](_0xe0b0('0x42'))){_0x3b1474[_0xe0b0('0x12')]=qs['limit'](_0x1bf77d['query'][_0xe0b0('0x12')]);_0x3b1474[_0xe0b0('0x10')]=qs[_0xe0b0('0x10')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x10')]);}_0x3b1474[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x1bf77d['query'][_0xe0b0('0x44')]);_0x3b1474['where']=qs[_0xe0b0('0x2a')](_['pick'](_0x1bf77d['query'],_0x11d4fd[_0xe0b0('0x2a')]));_0x3b1474[_0xe0b0('0x45')][_0xe0b0('0x46')]=_0x364877['id'];if(_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x3b1474[_0xe0b0('0x45')]=_[_0xe0b0('0x30')](_0x3b1474[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x3b1474['attributes'],function(_0x253ab0){var _0x57ccc9={};_0x57ccc9[_0x253ab0]={'$like':'%'+_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x57ccc9;})});}_0x3b1474=_[_0xe0b0('0x30')]({},_0x3b1474,_0x1bf77d[_0xe0b0('0x31')]);return db[_0xe0b0('0x49')][_0xe0b0('0x24')](_0x3b1474);}})['then'](function(_0x1a057c){if(_0x1a057c){return db[_0xe0b0('0x4a')][_0xe0b0('0x4b')]({'where':{'id':_[_0xe0b0('0x48')](_0x1a057c,_0xe0b0('0x4c')),'role':_0xe0b0('0x4d')},'attributes':['id',_0xe0b0('0x1b'),_0xe0b0('0x4e'),_0xe0b0('0x4f'),_0xe0b0('0x50')]});}})[_0xe0b0('0x18')](function(_0x18ab99){if(_0x18ab99){return{'count':_0x18ab99[_0xe0b0('0x13')],'rows':_[_0xe0b0('0x48')](_0x18ab99[_0xe0b0('0x25')],function(_0x34c642){return{'membername':_0x34c642[_0xe0b0('0x1b')],'UserId':_0x34c642['id'],'queue_name':_0x534340[_0xe0b0('0x1b')],'SmsQueueId':_0x534340['id'],'interface':util['format'](_0xe0b0('0x51'),_0xe0b0('0x52'),_0x34c642[_0xe0b0('0x1b')]),'penalty':0x0,'paused':_0x34c642[_0xe0b0('0x4e')],'createdAt':_0x34c642[_0xe0b0('0x50')],'updatedAt':_0x34c642[_0xe0b0('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe0b0('0x18')](respondWithFilteredResult(_0x575c7d,_0x3b1474))['catch'](handleError(_0x575c7d,null));};exports['getTeams']=function(_0x139014,_0x2a0415){var _0x157556={};var _0x47ecc1={};var _0x117d20;var _0x13fb4b;return db[_0xe0b0('0x1d')][_0xe0b0('0x53')]({'where':{'id':_0x139014[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a0415,null))[_0xe0b0('0x18')](function(_0x242120){if(_0x242120){_0x117d20=_0x242120;_0x47ecc1[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x54')][_0xe0b0('0x29')]);_0x47ecc1['query']=_[_0xe0b0('0x28')](_0x139014['query']);_0x47ecc1['filters']=_[_0xe0b0('0x2b')](_0x47ecc1['model'],_0x47ecc1['query']);_0x157556[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x47ecc1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x139014['query'][_0xe0b0('0x2d')]));_0x157556[_0xe0b0('0x2c')]=_0x157556[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x157556[_0xe0b0('0x2c')]:_0x47ecc1[_0xe0b0('0x27')];_0x157556[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x139014['query']['sort']);_0x157556[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x139014['query'],_0x47ecc1['filters']));if(_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x157556['where']=_['merge'](_0x157556[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x157556[_0xe0b0('0x2c')],function(_0x29175a){var _0x3b263f={};_0x3b263f[_0x29175a]={'$like':'%'+_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3b263f;})});}_0x157556=_[_0xe0b0('0x30')]({},_0x157556,_0x139014['options']);return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0x1673bc){if(_0x1673bc){_0x13fb4b=_0x1673bc['length'];if(!_0x139014['query']['hasOwnProperty']('nolimit')){_0x157556['limit']=qs['limit'](_0x139014[_0xe0b0('0x23')]['limit']);_0x157556['offset']=qs[_0xe0b0('0x10')](_0x139014[_0xe0b0('0x23')][_0xe0b0('0x10')]);}return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0xd0629e){if(_0xd0629e){return _0xd0629e?{'count':_0x13fb4b,'rows':_0xd0629e}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x2a0415,null))[_0xe0b0('0x3d')](handleError(_0x2a0415,null));};exports['addTeams']=function(_0x3097fb,_0x5da8fd){var _0x86e90=_0x3097fb[_0xe0b0('0x33')][_0xe0b0('0x57')];return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x86e90},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x58'),'attributes':['id','name',_0xe0b0('0x59'),_0xe0b0('0x5a'),_0xe0b0('0x5b')],'raw':!![]}]})[_0xe0b0('0x18')](function(_0x4a78f8){if(_0x4a78f8){var _0x311f79=_[_0xe0b0('0x5c')](_0x4a78f8,function(_0x49deef){var _0x4cf60a=_0x49deef[_0xe0b0('0x34')]({'plain':!![]});return _0x4cf60a[_0xe0b0('0x58')];});return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x3097fb[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](function(_0x34f4ff){return db[_0xe0b0('0x5d')][_0xe0b0('0x5e')](function(_0x24571b){return _0x34f4ff['addTeams'](_0x86e90,{'transaction':_0x24571b})['then'](function(){return BPromise[_0xe0b0('0x5f')](_0x311f79,function(_0x4880d5){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4880d5['id'],'SmsQueueId':_0x3097fb['params']['id']},'transaction':_0x24571b});});})[_0xe0b0('0x18')](function(){_0x311f79['forEach'](function(_0x654d2b){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':_0x654d2b['id'],'SmsQueueId':_0x34f4ff['id']});});});});});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x5da8fd,null))['catch'](handleError(_0x5da8fd,null));};exports[_0xe0b0('0x62')]=function(_0x948708,_0x5a0817){return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')]},'attributes':['id'],'include':[{'model':db[_0xe0b0('0x4a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5a0817,null))['then'](function(_0x545694){var _0x5c258b=_[_0xe0b0('0x48')](_0x545694,'id');var _0x567e1a=[];var _0x3c09af=[];var _0x5f4aaf=squel[_0xe0b0('0x63')]();_0x5f4aaf[_0xe0b0('0x64')](_0xe0b0('0x65'))[_0xe0b0('0x66')](_0xe0b0('0x67'),'tq')[_0xe0b0('0x68')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('SmsQueueId\x20=\x20?',_0x948708[_0xe0b0('0x41')]['id']);for(var _0x261381=0x0;_0x261381<_0x545694[_0xe0b0('0x2e')];_0x261381+=0x1){let _0x4377f7=_0x545694[_0x261381];for(var _0x2c1149=0x0;_0x2c1149<_0x4377f7['Agents'][_0xe0b0('0x2e')];_0x2c1149+=0x1){let _0x39a07b=_0x4377f7[_0xe0b0('0x58')][_0x2c1149];var _0xc6090e=_0x5f4aaf[_0xe0b0('0x69')]();_0xc6090e[_0xe0b0('0x45')](_0xe0b0('0x6a'),_0x39a07b['id']);_0x3c09af[_0xe0b0('0x6b')](db[_0xe0b0('0x5d')]['query'](_0xc6090e['toString'](),{'type':db[_0xe0b0('0x5d')][_0xe0b0('0x6c')]['SELECT']})[_0xe0b0('0x18')](function(_0x4593f1){if(_0x4593f1[_0xe0b0('0x2e')]===0x1){return _0x39a07b['id'];}else{var _0x3fcffd=_[_0xe0b0('0x6d')](_[_0xe0b0('0x48')](_0x4593f1,_0xe0b0('0x6e')),function(_0xc8eba3){return _['includes'](_0x5c258b,_0xc8eba3);});if(_0x3fcffd){return _0x39a07b['id'];}}}));}}return BPromise['all'](_0x3c09af)['then'](function(_0xc19743){_0x567e1a=_(_0x567e1a)[_0xe0b0('0x6f')](_0xc19743)['compact']()[_0xe0b0('0x70')]();return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x948708[_0xe0b0('0x41')]['id']}})['then'](function(_0x56c4b9){return db['sequelize'][_0xe0b0('0x5e')](function(_0x266835){return _0x56c4b9['removeTeams'](_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')],{'transaction':_0x266835})['then'](function(){if(!_['isEmpty'](_0x567e1a)){return _0x56c4b9[_0xe0b0('0x71')](_0x567e1a,{'transaction':_0x266835});}})['then'](function(){_0x567e1a[_0xe0b0('0x72')](function(_0x5f06c0){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':_0x5f06c0,'SmsQueueId':_0x56c4b9['id']});});});});});});})[_0xe0b0('0x18')](respondWithStatusCode(_0x5a0817,null))[_0xe0b0('0x3d')](handleError(_0x5a0817,null));};exports[_0xe0b0('0x74')]=function(_0x1ec7c2,_0x434dfa){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x1ec7c2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x434dfa,null))[_0xe0b0('0x18')](function(_0x2b40eb){if(_0x2b40eb){return _0x2b40eb['addAgents'](_0x1ec7c2[_0xe0b0('0x33')]['ids'],_[_0xe0b0('0x75')](_0x1ec7c2[_0xe0b0('0x33')],['ids','id'])||{})[_0xe0b0('0x76')](function(_0x4e4b45){for(var _0x528932=0x0;_0x528932<_0x1ec7c2[_0xe0b0('0x33')]['ids']['length'];_0x528932+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':Number(_0x1ec7c2[_0xe0b0('0x33')][_0xe0b0('0x57')][_0x528932]),'SmsQueueId':Number(_0x1ec7c2[_0xe0b0('0x41')]['id'])});}return _0x4e4b45;});}})[_0xe0b0('0x18')](respondWithResult(_0x434dfa,null))['catch'](handleError(_0x434dfa,null));};exports[_0xe0b0('0x71')]=function(_0x4609d5,_0x421b3b){return db['SmsQueue'][_0xe0b0('0x32')]({'where':{'id':_0x4609d5[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x421b3b,null))['then'](function(_0x33f89a){if(_0x33f89a){return _0x33f89a['removeAgents'](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])[_0xe0b0('0x18')](function(){if(_[_0xe0b0('0x77')](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])){for(var _0x3d70d7=0x0;_0x3d70d7<_0x4609d5['query'][_0xe0b0('0x57')][_0xe0b0('0x2e')];_0x3d70d7+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')]['ids'][_0x3d70d7]),'SmsQueueId':Number(_0x4609d5['params']['id'])});}}else{socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')]),'SmsQueueId':Number(_0x4609d5[_0xe0b0('0x41')]['id'])});}});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x421b3b,null))[_0xe0b0('0x3d')](handleError(_0x421b3b,null));};exports[_0xe0b0('0x78')]=function(_0x932e,_0x1b3f4d){var _0x4fe048={};var _0xac45e6={};var _0x401c4b;var _0x3e18a3;return db[_0xe0b0('0x1d')]['findOne']({'where':{'id':_0x932e[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x1b3f4d,null))[_0xe0b0('0x18')](function(_0x116c16){if(_0x116c16){_0x401c4b=_0x116c16;_0xac45e6[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x4a')]['rawAttributes']);_0xac45e6[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x932e[_0xe0b0('0x23')]);_0xac45e6[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0xac45e6['model'],_0xac45e6['query']);_0x4fe048[_0xe0b0('0x2c')]=_['intersection'](_0xac45e6[_0xe0b0('0x27')],qs['fields'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x4fe048[_0xe0b0('0x2c')]=_0x4fe048[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x4fe048[_0xe0b0('0x2c')]:_0xac45e6[_0xe0b0('0x27')];_0x4fe048['order']=qs['sort'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x44')]);_0x4fe048[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x932e[_0xe0b0('0x23')],_0xac45e6[_0xe0b0('0x2a')]));if(_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x4fe048[_0xe0b0('0x45')]=_['merge'](_0x4fe048['where'],{'$or':_[_0xe0b0('0x48')](_0x4fe048[_0xe0b0('0x2c')],function(_0x187465){var _0x3f9e6b={};_0x3f9e6b[_0x187465]={'$like':'%'+_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3f9e6b;})});}_0x4fe048=_[_0xe0b0('0x30')]({},_0x4fe048,_0x932e['options']);return _0x401c4b['getAgents'](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x1ea4d5){if(_0x1ea4d5){_0x3e18a3=_0x1ea4d5[_0xe0b0('0x2e')];if(!_0x932e[_0xe0b0('0x23')][_0xe0b0('0x79')](_0xe0b0('0x42'))){_0x4fe048[_0xe0b0('0x12')]=qs[_0xe0b0('0x12')](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x12')]);_0x4fe048['offset']=qs[_0xe0b0('0x10')](_0x932e[_0xe0b0('0x23')]['offset']);}return _0x401c4b[_0xe0b0('0x78')](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x3615f9){if(_0x3615f9){return _0x3615f9?{'count':_0x3e18a3,'rows':_0x3615f9}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x1b3f4d,null))[_0xe0b0('0x3d')](handleError(_0x1b3f4d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 374b86f..4d76fc3 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 _0x6669=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x50e1cf,_0x5b8361){var _0x39104f=function(_0x342287){while(--_0x342287){_0x50e1cf['push'](_0x50e1cf['shift']());}};_0x39104f(++_0x5b8361);}(_0x6669,0xd9));var _0x9666=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x6669[_0x403c20];return _0x2b271a;};'use strict';var EventEmitter=require(_0x9666('0x0'));var SmsQueue=require(_0x9666('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9666('0x2')](0x0);var events={'afterCreate':_0x9666('0x3'),'afterUpdate':_0x9666('0x4'),'afterDestroy':_0x9666('0x5')};function emitEvent(_0x4030ef){return function(_0x54a128,_0x125107,_0x1eeba4){SmsQueueEvents[_0x9666('0x6')](_0x4030ef+':'+_0x54a128['id'],_0x54a128);SmsQueueEvents[_0x9666('0x6')](_0x4030ef,_0x54a128);_0x1eeba4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x9666('0x7')](e,emitEvent(event));}}module[_0x9666('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x5217=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','save'];(function(_0x510b24,_0xbe3c5b){var _0x310de4=function(_0x2b95ef){while(--_0x2b95ef){_0x510b24['push'](_0x510b24['shift']());}};_0x310de4(++_0xbe3c5b);}(_0x5217,0x1ad));var _0x7521=function(_0x35d1bc,_0x38e666){_0x35d1bc=_0x35d1bc-0x0;var _0x4376fc=_0x5217[_0x35d1bc];return _0x4376fc;};'use strict';var EventEmitter=require(_0x7521('0x0'));var SmsQueue=require(_0x7521('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7521('0x2'),'afterUpdate':_0x7521('0x3'),'afterDestroy':'remove'};function emitEvent(_0x458745){return function(_0x21662f,_0x4ba85b,_0x5a78f7){SmsQueueEvents[_0x7521('0x4')](_0x458745+':'+_0x21662f['id'],_0x21662f);SmsQueueEvents['emit'](_0x458745,_0x21662f);_0x5a78f7(null);};}for(var e in events){if(events[_0x7521('0x5')](e)){var event=events[e];SmsQueue[_0x7521('0x6')](e,emitEvent(event));}}module[_0x7521('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index b665d58..a1ca5b7 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 _0xef05=['rimraf','../../config/environment','./smsQueue.attributes','define','sms_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x60e7fc,_0xae4e2a){var _0x19c8be=function(_0x472eb7){while(--_0x472eb7){_0x60e7fc['push'](_0x60e7fc['shift']());}};_0x19c8be(++_0xae4e2a);}(_0xef05,0x1c8));var _0x5ef0=function(_0x1b2d48,_0x4a48f5){_0x1b2d48=_0x1b2d48-0x0;var _0x369d9b=_0xef05[_0x1b2d48];return _0x369d9b;};'use strict';var _=require(_0x5ef0('0x0'));var util=require(_0x5ef0('0x1'));var logger=require(_0x5ef0('0x2'))(_0x5ef0('0x3'));var moment=require(_0x5ef0('0x4'));var BPromise=require('bluebird');var rp=require(_0x5ef0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ef0('0x6'));var config=require(_0x5ef0('0x7'));var attributes=require(_0x5ef0('0x8'));module['exports']=function(_0xe036a1,_0x2cb95e){return _0xe036a1[_0x5ef0('0x9')]('SmsQueue',attributes,{'tableName':_0x5ef0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c34=['path','rimraf','../../config/environment','exports','define','SmsQueue','sms_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x58176b,_0x1b4a62){var _0x2a89cd=function(_0x28e7ea){while(--_0x28e7ea){_0x58176b['push'](_0x58176b['shift']());}};_0x2a89cd(++_0x1b4a62);}(_0x6c34,0x10b));var _0x46c3=function(_0x3bf759,_0x4fad7d){_0x3bf759=_0x3bf759-0x0;var _0x24dd5b=_0x6c34[_0x3bf759];return _0x24dd5b;};'use strict';var _=require('lodash');var util=require(_0x46c3('0x0'));var logger=require(_0x46c3('0x1'))(_0x46c3('0x2'));var moment=require(_0x46c3('0x3'));var BPromise=require(_0x46c3('0x4'));var rp=require(_0x46c3('0x5'));var fs=require('fs');var path=require(_0x46c3('0x6'));var rimraf=require(_0x46c3('0x7'));var config=require(_0x46c3('0x8'));var attributes=require('./smsQueue.attributes');module[_0x46c3('0x9')]=function(_0x1dd932,_0x179369){return _0x1dd932[_0x46c3('0xa')](_0x46c3('0xb'),attributes,{'tableName':_0x46c3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 2a4ecb0..26eb81a 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 _0x3769=['GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','model','map','find','ShowSmsQueue','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','debug','request\x20sent','stringify','error','code','message','SmsQueue,\x20%s,\x20%s','result','catch'];(function(_0x595afe,_0x422419){var _0x4947ae=function(_0x49cf9e){while(--_0x49cf9e){_0x595afe['push'](_0x595afe['shift']());}};_0x4947ae(++_0x422419);}(_0x3769,0x125));var _0x9376=function(_0x1f6f8f,_0x185111){_0x1f6f8f=_0x1f6f8f-0x0;var _0x2e958e=_0x3769[_0x1f6f8f];return _0x2e958e;};'use strict';var _=require(_0x9376('0x0'));var util=require(_0x9376('0x1'));var moment=require(_0x9376('0x2'));var BPromise=require(_0x9376('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9376('0x4'))['db'];var utils=require(_0x9376('0x5'));var logger=require(_0x9376('0x6'))(_0x9376('0x7'));var config=require(_0x9376('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9376('0x9')]({'port':0x232a});config['redis']=_[_0x9376('0xa')](config['redis'],{'host':_0x9376('0xb'),'port':0x18eb});var socket=require(_0x9376('0xc'))(new Redis(config[_0x9376('0xd')]));require('./smsQueue.socket')[_0x9376('0xe')](socket);function respondWithRpcPromise(_0x5a6276,_0x2e2fb4,_0x3010b3){return new BPromise(function(_0x2187e6,_0x266bfe){return client[_0x9376('0xf')](_0x5a6276,_0x3010b3)[_0x9376('0x10')](function(_0x3e9627){logger[_0x9376('0x11')]('SmsQueue,\x20%s,\x20%s',_0x2e2fb4,'request\x20sent');logger[_0x9376('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x2e2fb4,_0x9376('0x13'),JSON[_0x9376('0x14')](_0x3e9627));if(_0x3e9627[_0x9376('0x15')]){if(_0x3e9627[_0x9376('0x15')][_0x9376('0x16')]===0x1f4){logger[_0x9376('0x15')]('SmsQueue,\x20%s,\x20%s',_0x2e2fb4,_0x3e9627['error']['message']);return _0x266bfe(_0x3e9627[_0x9376('0x15')][_0x9376('0x17')]);}logger['error'](_0x9376('0x18'),_0x2e2fb4,_0x3e9627[_0x9376('0x15')]['message']);return _0x2187e6(_0x3e9627[_0x9376('0x15')][_0x9376('0x17')]);}else{logger[_0x9376('0x11')](_0x9376('0x18'),_0x2e2fb4,_0x9376('0x13'));_0x2187e6(_0x3e9627[_0x9376('0x19')][_0x9376('0x17')]);}})[_0x9376('0x1a')](function(_0x278c65){logger[_0x9376('0x15')](_0x9376('0x18'),_0x2e2fb4,_0x278c65);_0x266bfe(_0x278c65);});});}exports[_0x9376('0x1b')]=function(_0x90d7fc){var _0x403950=this;return new Promise(function(_0x4c20de,_0x34d59f){return db[_0x9376('0x1c')][_0x9376('0x1d')]({'raw':_0x90d7fc[_0x9376('0x1e')]?_0x90d7fc[_0x9376('0x1e')][_0x9376('0x1f')]===undefined?!![]:![]:!![],'where':_0x90d7fc[_0x9376('0x1e')]?_0x90d7fc['options'][_0x9376('0x20')]||null:null,'attributes':_0x90d7fc['options']?_0x90d7fc[_0x9376('0x1e')][_0x9376('0x21')]||null:null,'limit':_0x90d7fc['options']?_0x90d7fc[_0x9376('0x1e')][_0x9376('0x22')]||null:null,'include':_0x90d7fc[_0x9376('0x1e')]?_0x90d7fc['options'][_0x9376('0x23')]?_['map'](_0x90d7fc[_0x9376('0x1e')][_0x9376('0x23')],function(_0x131e80){return{'model':db[_0x131e80[_0x9376('0x24')]],'as':_0x131e80['as'],'attributes':_0x131e80[_0x9376('0x21')],'include':_0x131e80[_0x9376('0x23')]?_[_0x9376('0x25')](_0x131e80[_0x9376('0x23')],function(_0x28b7d0){return{'model':db[_0x28b7d0[_0x9376('0x24')]],'as':_0x28b7d0['as'],'attributes':_0x28b7d0[_0x9376('0x21')],'include':_0x28b7d0[_0x9376('0x23')]?_[_0x9376('0x25')](_0x28b7d0[_0x9376('0x23')],function(_0x48d5f1){return{'model':db[_0x48d5f1[_0x9376('0x24')]],'as':_0x48d5f1['as'],'attributes':_0x48d5f1[_0x9376('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9376('0x10')](function(_0x3484c8){logger['info'](_0x9376('0x1b'),_0x90d7fc);logger[_0x9376('0x12')]('GetSmsQueue',_0x90d7fc,JSON['stringify'](_0x3484c8));_0x4c20de(_0x3484c8);})[_0x9376('0x1a')](function(_0x46c70d){logger[_0x9376('0x15')](_0x9376('0x1b'),_0x46c70d[_0x9376('0x17')],_0x90d7fc);_0x34d59f(_0x403950[_0x9376('0x15')](0x1f4,_0x46c70d[_0x9376('0x17')]));});});};exports['ShowSmsQueue']=function(_0xbb32f4){var _0x41db6d=this;return new Promise(function(_0x3f2dc1,_0x5d534b){return db[_0x9376('0x1c')][_0x9376('0x26')]({'raw':_0xbb32f4['options']?_0xbb32f4[_0x9376('0x1e')][_0x9376('0x1f')]===undefined?!![]:![]:!![],'where':_0xbb32f4[_0x9376('0x1e')]?_0xbb32f4['options'][_0x9376('0x20')]||null:null,'attributes':_0xbb32f4[_0x9376('0x1e')]?_0xbb32f4[_0x9376('0x1e')]['attributes']||null:null,'include':_0xbb32f4[_0x9376('0x1e')]?_0xbb32f4[_0x9376('0x1e')][_0x9376('0x23')]?_['map'](_0xbb32f4[_0x9376('0x1e')][_0x9376('0x23')],function(_0x3891c2){return{'model':db[_0x3891c2[_0x9376('0x24')]],'as':_0x3891c2['as'],'attributes':_0x3891c2[_0x9376('0x21')],'include':_0x3891c2[_0x9376('0x23')]?_[_0x9376('0x25')](_0x3891c2['include'],function(_0x20c600){return{'model':db[_0x20c600[_0x9376('0x24')]],'as':_0x20c600['as'],'attributes':_0x20c600['attributes'],'include':_0x20c600['include']?_[_0x9376('0x25')](_0x20c600[_0x9376('0x23')],function(_0x5733ce){return{'model':db[_0x5733ce[_0x9376('0x24')]],'as':_0x5733ce['as'],'attributes':_0x5733ce['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5508e7){logger[_0x9376('0x11')]('ShowSmsQueue',_0xbb32f4);logger[_0x9376('0x12')](_0x9376('0x27'),_0xbb32f4,JSON[_0x9376('0x14')](_0x5508e7));_0x3f2dc1(_0x5508e7);})[_0x9376('0x1a')](function(_0x457ff8){logger[_0x9376('0x15')](_0x9376('0x27'),_0x457ff8[_0x9376('0x17')],_0xbb32f4);_0x5d534b(_0x41db6d['error'](0x1f4,_0x457ff8[_0x9376('0x17')]));});});}; \ No newline at end of file +var _0xc724=['include','map','model','info','catch','ShowSmsQueue','find','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./smsQueue.socket','register','request','then','request\x20sent','debug','stringify','error','code','message','SmsQueue,\x20%s,\x20%s','result','GetSmsQueue','SmsQueue','findAll','options','raw','attributes'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xc724,0x1c3));var _0x4c72=function(_0xff7b4,_0x3b7c59){_0xff7b4=_0xff7b4-0x0;var _0x211e69=_0xc724[_0xff7b4];return _0x211e69;};'use strict';var _=require(_0x4c72('0x0'));var util=require('util');var moment=require(_0x4c72('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c72('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c72('0x3'))['db'];var utils=require(_0x4c72('0x4'));var logger=require(_0x4c72('0x5'))(_0x4c72('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c72('0x7'));var client=jayson[_0x4c72('0x8')]['http']({'port':0x232a});config[_0x4c72('0x9')]=_[_0x4c72('0xa')](config[_0x4c72('0x9')],{'host':_0x4c72('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c72('0x9')]));require(_0x4c72('0xc'))[_0x4c72('0xd')](socket);function respondWithRpcPromise(_0x41f106,_0x145b62,_0x45b72c){return new BPromise(function(_0x487cbc,_0x147354){return client[_0x4c72('0xe')](_0x41f106,_0x45b72c)[_0x4c72('0xf')](function(_0x1aac4b){logger['info']('SmsQueue,\x20%s,\x20%s',_0x145b62,_0x4c72('0x10'));logger[_0x4c72('0x11')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x145b62,_0x4c72('0x10'),JSON[_0x4c72('0x12')](_0x1aac4b));if(_0x1aac4b[_0x4c72('0x13')]){if(_0x1aac4b[_0x4c72('0x13')][_0x4c72('0x14')]===0x1f4){logger[_0x4c72('0x13')]('SmsQueue,\x20%s,\x20%s',_0x145b62,_0x1aac4b[_0x4c72('0x13')][_0x4c72('0x15')]);return _0x147354(_0x1aac4b[_0x4c72('0x13')][_0x4c72('0x15')]);}logger[_0x4c72('0x13')](_0x4c72('0x16'),_0x145b62,_0x1aac4b[_0x4c72('0x13')][_0x4c72('0x15')]);return _0x487cbc(_0x1aac4b['error'][_0x4c72('0x15')]);}else{logger['info'](_0x4c72('0x16'),_0x145b62,_0x4c72('0x10'));_0x487cbc(_0x1aac4b[_0x4c72('0x17')][_0x4c72('0x15')]);}})['catch'](function(_0x5a9772){logger[_0x4c72('0x13')](_0x4c72('0x16'),_0x145b62,_0x5a9772);_0x147354(_0x5a9772);});});}exports[_0x4c72('0x18')]=function(_0x28865d){var _0x344e65=this;return new Promise(function(_0x1adb7d,_0x23886e){return db[_0x4c72('0x19')][_0x4c72('0x1a')]({'raw':_0x28865d[_0x4c72('0x1b')]?_0x28865d[_0x4c72('0x1b')][_0x4c72('0x1c')]===undefined?!![]:![]:!![],'where':_0x28865d[_0x4c72('0x1b')]?_0x28865d['options']['where']||null:null,'attributes':_0x28865d[_0x4c72('0x1b')]?_0x28865d[_0x4c72('0x1b')][_0x4c72('0x1d')]||null:null,'limit':_0x28865d[_0x4c72('0x1b')]?_0x28865d[_0x4c72('0x1b')]['limit']||null:null,'include':_0x28865d['options']?_0x28865d['options'][_0x4c72('0x1e')]?_[_0x4c72('0x1f')](_0x28865d[_0x4c72('0x1b')][_0x4c72('0x1e')],function(_0x2d4f3c){return{'model':db[_0x2d4f3c[_0x4c72('0x20')]],'as':_0x2d4f3c['as'],'attributes':_0x2d4f3c[_0x4c72('0x1d')],'include':_0x2d4f3c['include']?_[_0x4c72('0x1f')](_0x2d4f3c[_0x4c72('0x1e')],function(_0x447d6b){return{'model':db[_0x447d6b['model']],'as':_0x447d6b['as'],'attributes':_0x447d6b[_0x4c72('0x1d')],'include':_0x447d6b['include']?_[_0x4c72('0x1f')](_0x447d6b['include'],function(_0x21d75a){return{'model':db[_0x21d75a[_0x4c72('0x20')]],'as':_0x21d75a['as'],'attributes':_0x21d75a[_0x4c72('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x477f72){logger[_0x4c72('0x21')](_0x4c72('0x18'),_0x28865d);logger[_0x4c72('0x11')](_0x4c72('0x18'),_0x28865d,JSON[_0x4c72('0x12')](_0x477f72));_0x1adb7d(_0x477f72);})[_0x4c72('0x22')](function(_0x10b278){logger['error'](_0x4c72('0x18'),_0x10b278[_0x4c72('0x15')],_0x28865d);_0x23886e(_0x344e65[_0x4c72('0x13')](0x1f4,_0x10b278[_0x4c72('0x15')]));});});};exports[_0x4c72('0x23')]=function(_0x3f3e1e){var _0x30cbb0=this;return new Promise(function(_0x1f29ef,_0x4b89a7){return db['SmsQueue'][_0x4c72('0x24')]({'raw':_0x3f3e1e[_0x4c72('0x1b')]?_0x3f3e1e[_0x4c72('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3f3e1e[_0x4c72('0x1b')]?_0x3f3e1e[_0x4c72('0x1b')]['where']||null:null,'attributes':_0x3f3e1e[_0x4c72('0x1b')]?_0x3f3e1e['options']['attributes']||null:null,'include':_0x3f3e1e[_0x4c72('0x1b')]?_0x3f3e1e[_0x4c72('0x1b')]['include']?_[_0x4c72('0x1f')](_0x3f3e1e['options'][_0x4c72('0x1e')],function(_0x5e5439){return{'model':db[_0x5e5439[_0x4c72('0x20')]],'as':_0x5e5439['as'],'attributes':_0x5e5439['attributes'],'include':_0x5e5439[_0x4c72('0x1e')]?_['map'](_0x5e5439[_0x4c72('0x1e')],function(_0x309be5){return{'model':db[_0x309be5[_0x4c72('0x20')]],'as':_0x309be5['as'],'attributes':_0x309be5[_0x4c72('0x1d')],'include':_0x309be5[_0x4c72('0x1e')]?_[_0x4c72('0x1f')](_0x309be5[_0x4c72('0x1e')],function(_0x5b2cd6){return{'model':db[_0x5b2cd6[_0x4c72('0x20')]],'as':_0x5b2cd6['as'],'attributes':_0x5b2cd6[_0x4c72('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4c72('0xf')](function(_0x16cb93){logger[_0x4c72('0x21')]('ShowSmsQueue',_0x3f3e1e);logger[_0x4c72('0x11')](_0x4c72('0x23'),_0x3f3e1e,JSON['stringify'](_0x16cb93));_0x1f29ef(_0x16cb93);})[_0x4c72('0x22')](function(_0x2abdad){logger[_0x4c72('0x13')](_0x4c72('0x23'),_0x2abdad['message'],_0x3f3e1e);_0x4b89a7(_0x30cbb0['error'](0x1f4,_0x2abdad[_0x4c72('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 3d9de74..266f070 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 _0xf4e6=['length','smsQueue:','./smsQueue.events','save','remove','emit','removeListener','register'];(function(_0x20701e,_0x5ce88f){var _0x395493=function(_0x45106d){while(--_0x45106d){_0x20701e['push'](_0x20701e['shift']());}};_0x395493(++_0x5ce88f);}(_0xf4e6,0x132));var _0x6f4e=function(_0xc69f39,_0x2ce0cf){_0xc69f39=_0xc69f39-0x0;var _0x93be41=_0xf4e6[_0xc69f39];return _0x93be41;};'use strict';var SmsQueueEvents=require(_0x6f4e('0x0'));var events=[_0x6f4e('0x1'),_0x6f4e('0x2'),'update'];function createListener(_0x3e3bf9,_0x24f50a){return function(_0x20e638){_0x24f50a[_0x6f4e('0x3')](_0x3e3bf9,_0x20e638);};}function removeListener(_0x5ebf6a,_0x5cfd48){return function(){SmsQueueEvents[_0x6f4e('0x4')](_0x5ebf6a,_0x5cfd48);};}exports[_0x6f4e('0x5')]=function(_0x17f494){for(var _0x474fdc=0x0,_0x4b2bd1=events[_0x6f4e('0x6')];_0x474fdc<_0x4b2bd1;_0x474fdc++){var _0x317af3=events[_0x474fdc];var _0x8da5c4=createListener(_0x6f4e('0x7')+_0x317af3,_0x17f494);SmsQueueEvents['on'](_0x317af3,_0x8da5c4);}}; \ No newline at end of file +var _0x55b3=['remove','emit','register','smsQueue:','save'];(function(_0x134905,_0x4b1116){var _0x4a0e61=function(_0x361aca){while(--_0x361aca){_0x134905['push'](_0x134905['shift']());}};_0x4a0e61(++_0x4b1116);}(_0x55b3,0x1c1));var _0x355b=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x55b3[_0x2e4e19];return _0x9ba20b;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x355b('0x0'),_0x355b('0x1'),'update'];function createListener(_0x11e7c9,_0x46f32d){return function(_0xa06e41){_0x46f32d[_0x355b('0x2')](_0x11e7c9,_0xa06e41);};}function removeListener(_0xc69d6f,_0x6d29bd){return function(){SmsQueueEvents['removeListener'](_0xc69d6f,_0x6d29bd);};}exports[_0x355b('0x3')]=function(_0x589962){for(var _0x1fa071=0x0,_0x451f04=events['length'];_0x1fa071<_0x451f04;_0x1fa071++){var _0x2071bb=events[_0x1fa071];var _0x32376f=createListener(_0x355b('0x4')+_0x2071bb,_0x589962);SmsQueueEvents['on'](_0x2071bb,_0x32376f);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 7f3c908..1dded03 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 _0x174d=['show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','/describe','/:id'];(function(_0x62d53d,_0x1ece01){var _0x3d65d1=function(_0x44ffc3){while(--_0x44ffc3){_0x62d53d['push'](_0x62d53d['shift']());}};_0x3d65d1(++_0x1ece01);}(_0x174d,0x1ca));var _0xd174=function(_0x4d77d5,_0xf3c18){_0x4d77d5=_0x4d77d5-0x0;var _0x4d590d=_0x174d[_0x4d77d5];return _0x4d590d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd174('0x0'));var timeout=require(_0xd174('0x1'));var express=require(_0xd174('0x2'));var router=express['Router']();var fs_extra=require(_0xd174('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd174('0x4'));var config=require('../../config/environment');var controller=require(_0xd174('0x5'));router[_0xd174('0x6')]('/',auth[_0xd174('0x7')](),controller['index']);router[_0xd174('0x6')](_0xd174('0x8'),auth[_0xd174('0x7')](),controller['describe']);router[_0xd174('0x6')](_0xd174('0x9'),auth['isAuthenticated'](),controller[_0xd174('0xa')]);router[_0xd174('0xb')]('/',auth[_0xd174('0x7')](),controller[_0xd174('0xc')]);router[_0xd174('0xd')](_0xd174('0x9'),auth[_0xd174('0x7')](),controller[_0xd174('0xe')]);router[_0xd174('0xf')](_0xd174('0x9'),auth[_0xd174('0x7')](),controller[_0xd174('0x10')]);module[_0xd174('0x11')]=router; \ No newline at end of file +var _0xcff4=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create'];(function(_0x1889fa,_0x18c84c){var _0x220c64=function(_0x53ae6d){while(--_0x53ae6d){_0x1889fa['push'](_0x1889fa['shift']());}};_0x220c64(++_0x18c84c);}(_0xcff4,0x6d));var _0x4cff=function(_0xe361ae,_0x4ed0f1){_0xe361ae=_0xe361ae-0x0;var _0x1c985f=_0xcff4[_0xe361ae];return _0x1c985f;};'use strict';var multer=require(_0x4cff('0x0'));var util=require(_0x4cff('0x1'));var path=require(_0x4cff('0x2'));var timeout=require(_0x4cff('0x3'));var express=require(_0x4cff('0x4'));var router=express[_0x4cff('0x5')]();var fs_extra=require(_0x4cff('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4cff('0x7'));var controller=require(_0x4cff('0x8'));router[_0x4cff('0x9')]('/',auth[_0x4cff('0xa')](),controller[_0x4cff('0xb')]);router[_0x4cff('0x9')]('/describe',auth[_0x4cff('0xa')](),controller[_0x4cff('0xc')]);router[_0x4cff('0x9')](_0x4cff('0xd'),auth[_0x4cff('0xa')](),controller[_0x4cff('0xe')]);router[_0x4cff('0xf')]('/',auth[_0x4cff('0xa')](),controller[_0x4cff('0x10')]);router[_0x4cff('0x11')]('/:id',auth[_0x4cff('0xa')](),controller[_0x4cff('0x12')]);router[_0x4cff('0x13')](_0x4cff('0xd'),auth['isAuthenticated'](),controller[_0x4cff('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 6537e30..bd64658 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 _0xa296=['exports','STRING','DATE','moment','sequelize'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa296,0x1d4));var _0x6a29=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0xa296[_0x4c9380];return _0x49a523;};'use strict';var moment=require(_0x6a29('0x0'));var Sequelize=require(_0x6a29('0x1'));module[_0x6a29('0x2')]={'uniqueid':{'type':Sequelize[_0x6a29('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6a29('0x4')]},'leaveAt':{'type':Sequelize[_0x6a29('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6a29('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7073=['moment','sequelize','STRING','DATE'];(function(_0x4bffa3,_0x13cbf6){var _0xc8032d=function(_0x2b51cc){while(--_0x2b51cc){_0x4bffa3['push'](_0x4bffa3['shift']());}};_0xc8032d(++_0x13cbf6);}(_0x7073,0x114));var _0x3707=function(_0x1abbe8,_0x331df0){_0x1abbe8=_0x1abbe8-0x0;var _0x4a819d=_0x7073[_0x1abbe8];return _0x4a819d;};'use strict';var moment=require(_0x3707('0x0'));var Sequelize=require(_0x3707('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3707('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3707('0x2')]},'joinAt':{'type':Sequelize[_0x3707('0x3')]},'leaveAt':{'type':Sequelize[_0x3707('0x3')]},'acceptAt':{'type':Sequelize[_0x3707('0x3')]},'exitAt':{'type':Sequelize[_0x3707('0x3')]},'reason':{'type':Sequelize[_0x3707('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index af1bba1..6c243b3 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 _0xab8f=['type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','find','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','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter'];(function(_0x45b6f3,_0x298dab){var _0x585127=function(_0x30fb36){while(--_0x30fb36){_0x45b6f3['push'](_0x45b6f3['shift']());}};_0x585127(++_0x298dab);}(_0xab8f,0xb0));var _0xfab8=function(_0x28b89f,_0x4a97db){_0x28b89f=_0x28b89f-0x0;var _0x9f9abf=_0xab8f[_0x28b89f];return _0x9f9abf;};'use strict';var emlformat=require(_0xfab8('0x0'));var rimraf=require(_0xfab8('0x1'));var zipdir=require(_0xfab8('0x2'));var jsonpatch=require(_0xfab8('0x3'));var rp=require(_0xfab8('0x4'));var moment=require(_0xfab8('0x5'));var BPromise=require(_0xfab8('0x6'));var Mustache=require(_0xfab8('0x7'));var util=require(_0xfab8('0x8'));var path=require(_0xfab8('0x9'));var sox=require(_0xfab8('0xa'));var csv=require(_0xfab8('0xb'));var ejs=require(_0xfab8('0xc'));var fs=require('fs');var fs_extra=require(_0xfab8('0xd'));var _=require(_0xfab8('0xe'));var squel=require(_0xfab8('0xf'));var crypto=require(_0xfab8('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfab8('0xb'));var querystring=require('querystring');var Papa=require(_0xfab8('0x11'));var Redis=require(_0xfab8('0x12'));var authService=require(_0xfab8('0x13'));var qs=require(_0xfab8('0x14'));var as=require(_0xfab8('0x15'));var hardwareService=require(_0xfab8('0x16'));var logger=require(_0xfab8('0x17'))(_0xfab8('0x18'));var utils=require(_0xfab8('0x19'));var config=require(_0xfab8('0x1a'));var licenseUtil=require(_0xfab8('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28dd2c,_0x14e028){_0x14e028=_0x14e028||0xcc;return function(_0x2d0959){if(_0x2d0959){return _0x28dd2c['sendStatus'](_0x14e028);}return _0x28dd2c[_0xfab8('0x1c')](_0x14e028)[_0xfab8('0x1d')]();};}function respondWithResult(_0x139e69,_0x1061e8){_0x1061e8=_0x1061e8||0xc8;return function(_0x1515e9){if(_0x1515e9){return _0x139e69[_0xfab8('0x1c')](_0x1061e8)[_0xfab8('0x1e')](_0x1515e9);}};}function respondWithFilteredResult(_0x23bda8,_0x151c7c){return function(_0x1d5c64){if(_0x1d5c64){var _0x1d8f25=typeof _0x151c7c[_0xfab8('0x1f')]===_0xfab8('0x20')&&typeof _0x151c7c[_0xfab8('0x21')]===_0xfab8('0x20');var _0x150e4e=_0x1d5c64[_0xfab8('0x22')];var _0x4c191e=_0x1d8f25?0x0:_0x151c7c[_0xfab8('0x1f')];var _0x143f7c=_0x1d8f25?_0x1d5c64[_0xfab8('0x22')]:_0x151c7c['offset']+_0x151c7c[_0xfab8('0x21')];var _0x13c5a6;if(_0x143f7c>=_0x150e4e){_0x143f7c=_0x150e4e;_0x13c5a6=0xc8;}else{_0x13c5a6=0xce;}_0x23bda8['status'](_0x13c5a6);return _0x23bda8[_0xfab8('0x23')](_0xfab8('0x24'),_0x4c191e+'-'+_0x143f7c+'/'+_0x150e4e)[_0xfab8('0x1e')](_0x1d5c64);}return null;};}function patchUpdates(_0x172244){return function(_0xf095ef){try{jsonpatch[_0xfab8('0x25')](_0xf095ef,_0x172244,!![]);}catch(_0x534f10){return BPromise[_0xfab8('0x26')](_0x534f10);}return _0xf095ef[_0xfab8('0x27')]();};}function saveUpdates(_0x91615a,_0x5b5560){return function(_0x1faa34){if(_0x1faa34){return _0x1faa34[_0xfab8('0x28')](_0x91615a)[_0xfab8('0x29')](function(_0x2b4cd7){return _0x2b4cd7;});}return null;};}function removeEntity(_0x58cdee,_0x5b4218){return function(_0x2ee4ee){if(_0x2ee4ee){return _0x2ee4ee[_0xfab8('0x2a')]()[_0xfab8('0x29')](function(){_0x58cdee[_0xfab8('0x1c')](0xcc)[_0xfab8('0x1d')]();});}};}function handleEntityNotFound(_0x56e225,_0x8a8ec6){return function(_0x220daf){if(!_0x220daf){_0x56e225[_0xfab8('0x2b')](0x194);}return _0x220daf;};}function handleError(_0x3d9545,_0xbab5c9){_0xbab5c9=_0xbab5c9||0x1f4;return function(_0x3ef8b4){logger[_0xfab8('0x2c')](_0x3ef8b4[_0xfab8('0x2d')]);if(_0x3ef8b4['name']){delete _0x3ef8b4[_0xfab8('0x2e')];}_0x3d9545[_0xfab8('0x1c')](_0xbab5c9)[_0xfab8('0x2f')](_0x3ef8b4);};}exports[_0xfab8('0x30')]=function(_0x3e69a5,_0x18ae3f){var _0x1e8c50={},_0x42a70c={},_0x3e16e9={'count':0x0,'rows':[]};var _0x257141=_['map'](db[_0xfab8('0x31')][_0xfab8('0x32')],function(_0x7f08b9){return{'name':_0x7f08b9[_0xfab8('0x33')],'type':_0x7f08b9['type'][_0xfab8('0x34')]};});_0x42a70c[_0xfab8('0x35')]=_[_0xfab8('0x36')](_0x257141,_0xfab8('0x2e'));_0x42a70c[_0xfab8('0x37')]=_['keys'](_0x3e69a5['query']);_0x42a70c['filters']=_[_0xfab8('0x38')](_0x42a70c[_0xfab8('0x35')],_0x42a70c[_0xfab8('0x37')]);_0x1e8c50[_0xfab8('0x39')]=_[_0xfab8('0x38')](_0x42a70c['model'],qs[_0xfab8('0x3a')](_0x3e69a5['query'][_0xfab8('0x3a')]));_0x1e8c50[_0xfab8('0x39')]=_0x1e8c50['attributes'][_0xfab8('0x3b')]?_0x1e8c50[_0xfab8('0x39')]:_0x42a70c[_0xfab8('0x35')];if(!_0x3e69a5[_0xfab8('0x37')][_0xfab8('0x3c')]('nolimit')){_0x1e8c50[_0xfab8('0x21')]=qs['limit'](_0x3e69a5[_0xfab8('0x37')][_0xfab8('0x21')]);_0x1e8c50[_0xfab8('0x1f')]=qs['offset'](_0x3e69a5[_0xfab8('0x37')][_0xfab8('0x1f')]);}_0x1e8c50[_0xfab8('0x3d')]=qs[_0xfab8('0x3e')](_0x3e69a5['query']['sort']);_0x1e8c50[_0xfab8('0x3f')]=qs['filters'](_[_0xfab8('0x40')](_0x3e69a5['query'],_0x42a70c[_0xfab8('0x41')]),_0x257141);if(_0x3e69a5['query'][_0xfab8('0x42')]){_0x1e8c50[_0xfab8('0x3f')]=_['merge'](_0x1e8c50[_0xfab8('0x3f')],{'$or':_[_0xfab8('0x36')](_0x257141,function(_0x4c2ffd){if(_0x4c2ffd[_0xfab8('0x43')]!==_0xfab8('0x44')){var _0x26a723={};_0x26a723[_0x4c2ffd[_0xfab8('0x2e')]]={'$like':'%'+_0x3e69a5[_0xfab8('0x37')][_0xfab8('0x42')]+'%'};return _0x26a723;}})});}_0x1e8c50=_[_0xfab8('0x45')]({},_0x1e8c50,_0x3e69a5[_0xfab8('0x46')]);var _0x1f2239={'where':_0x1e8c50[_0xfab8('0x3f')]};return db[_0xfab8('0x31')][_0xfab8('0x22')](_0x1f2239)[_0xfab8('0x29')](function(_0x5ec917){_0x3e16e9[_0xfab8('0x22')]=_0x5ec917;if(_0x3e69a5[_0xfab8('0x37')][_0xfab8('0x47')]){_0x1e8c50[_0xfab8('0x48')]=[{'all':!![]}];}return db[_0xfab8('0x31')][_0xfab8('0x49')](_0x1e8c50);})['then'](function(_0x4829d3){_0x3e16e9['rows']=_0x4829d3;return _0x3e16e9;})[_0xfab8('0x29')](respondWithFilteredResult(_0x18ae3f,_0x1e8c50))[_0xfab8('0x4a')](handleError(_0x18ae3f,null));};exports[_0xfab8('0x4b')]=function(_0x501ccd,_0x208e59){var _0x45d4de={'raw':!![],'where':{'id':_0x501ccd[_0xfab8('0x4c')]['id']}},_0x10e6a3={};_0x10e6a3[_0xfab8('0x35')]=_[_0xfab8('0x4d')](db[_0xfab8('0x31')][_0xfab8('0x32')]);_0x10e6a3[_0xfab8('0x37')]=_[_0xfab8('0x4d')](_0x501ccd[_0xfab8('0x37')]);_0x10e6a3['filters']=_[_0xfab8('0x38')](_0x10e6a3[_0xfab8('0x35')],_0x10e6a3[_0xfab8('0x37')]);_0x45d4de['attributes']=_['intersection'](_0x10e6a3['model'],qs[_0xfab8('0x3a')](_0x501ccd['query']['fields']));_0x45d4de[_0xfab8('0x39')]=_0x45d4de[_0xfab8('0x39')][_0xfab8('0x3b')]?_0x45d4de[_0xfab8('0x39')]:_0x10e6a3[_0xfab8('0x35')];if(_0x501ccd['query'][_0xfab8('0x47')]){_0x45d4de[_0xfab8('0x48')]=[{'all':!![]}];}_0x45d4de=_['merge']({},_0x45d4de,_0x501ccd[_0xfab8('0x46')]);return db['SmsQueueReport'][_0xfab8('0x4e')](_0x45d4de)[_0xfab8('0x29')](handleEntityNotFound(_0x208e59,null))[_0xfab8('0x29')](respondWithResult(_0x208e59,null))[_0xfab8('0x4a')](handleError(_0x208e59,null));};exports['create']=function(_0x3d4e0c,_0x2b3eb4){return db[_0xfab8('0x31')]['create'](_0x3d4e0c['body'],{})[_0xfab8('0x29')](respondWithResult(_0x2b3eb4,0xc9))[_0xfab8('0x4a')](handleError(_0x2b3eb4,null));};exports[_0xfab8('0x28')]=function(_0x37baf1,_0x833150){if(_0x37baf1['body']['id']){delete _0x37baf1[_0xfab8('0x4f')]['id'];}return db[_0xfab8('0x31')][_0xfab8('0x4e')]({'where':{'id':_0x37baf1['params']['id']}})[_0xfab8('0x29')](handleEntityNotFound(_0x833150,null))['then'](saveUpdates(_0x37baf1[_0xfab8('0x4f')],null))[_0xfab8('0x29')](respondWithResult(_0x833150,null))[_0xfab8('0x4a')](handleError(_0x833150,null));};exports[_0xfab8('0x2a')]=function(_0x4a2a92,_0x45b8bf){return db[_0xfab8('0x31')][_0xfab8('0x4e')]({'where':{'id':_0x4a2a92['params']['id']}})[_0xfab8('0x29')](handleEntityNotFound(_0x45b8bf,null))[_0xfab8('0x29')](removeEntity(_0x45b8bf,null))['catch'](handleError(_0x45b8bf,null));};exports[_0xfab8('0x50')]=function(_0x2515d5,_0x4d4c18){return db['SmsQueueReport'][_0xfab8('0x50')]()[_0xfab8('0x29')](respondWithResult(_0x4d4c18,null))[_0xfab8('0x4a')](handleError(_0x4d4c18,null));}; \ No newline at end of file +var _0x6621=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','rawAttributes','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','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','stack','name','send','index','map','SmsQueueReport','key','model'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x6621,0xb2));var _0x1662=function(_0x2dab23,_0x11db5f){_0x2dab23=_0x2dab23-0x0;var _0x509868=_0x6621[_0x2dab23];return _0x509868;};'use strict';var emlformat=require(_0x1662('0x0'));var rimraf=require(_0x1662('0x1'));var zipdir=require(_0x1662('0x2'));var jsonpatch=require(_0x1662('0x3'));var rp=require(_0x1662('0x4'));var moment=require(_0x1662('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1662('0x6'));var util=require(_0x1662('0x7'));var path=require(_0x1662('0x8'));var sox=require('sox');var csv=require(_0x1662('0x9'));var ejs=require(_0x1662('0xa'));var fs=require('fs');var fs_extra=require(_0x1662('0xb'));var _=require(_0x1662('0xc'));var squel=require(_0x1662('0xd'));var crypto=require(_0x1662('0xe'));var jsforce=require(_0x1662('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1662('0x9'));var querystring=require(_0x1662('0x10'));var Papa=require(_0x1662('0x11'));var Redis=require(_0x1662('0x12'));var authService=require(_0x1662('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1662('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1662('0x15'))(_0x1662('0x16'));var utils=require(_0x1662('0x17'));var config=require(_0x1662('0x18'));var licenseUtil=require(_0x1662('0x19'));var db=require(_0x1662('0x1a'))['db'];function respondWithStatusCode(_0x4d4f20,_0x241e7f){_0x241e7f=_0x241e7f||0xcc;return function(_0x183876){if(_0x183876){return _0x4d4f20[_0x1662('0x1b')](_0x241e7f);}return _0x4d4f20[_0x1662('0x1c')](_0x241e7f)[_0x1662('0x1d')]();};}function respondWithResult(_0x5ed901,_0x5d0b29){_0x5d0b29=_0x5d0b29||0xc8;return function(_0x41f8bf){if(_0x41f8bf){return _0x5ed901[_0x1662('0x1c')](_0x5d0b29)[_0x1662('0x1e')](_0x41f8bf);}};}function respondWithFilteredResult(_0x3f71d7,_0x556c46){return function(_0x53dd41){if(_0x53dd41){var _0x2ec2ef=typeof _0x556c46[_0x1662('0x1f')]==='undefined'&&typeof _0x556c46['limit']===_0x1662('0x20');var _0x3f6d07=_0x53dd41[_0x1662('0x21')];var _0x24eb22=_0x2ec2ef?0x0:_0x556c46['offset'];var _0x20775c=_0x2ec2ef?_0x53dd41[_0x1662('0x21')]:_0x556c46[_0x1662('0x1f')]+_0x556c46[_0x1662('0x22')];var _0x43bad2;if(_0x20775c>=_0x3f6d07){_0x20775c=_0x3f6d07;_0x43bad2=0xc8;}else{_0x43bad2=0xce;}_0x3f71d7[_0x1662('0x1c')](_0x43bad2);return _0x3f71d7[_0x1662('0x23')](_0x1662('0x24'),_0x24eb22+'-'+_0x20775c+'/'+_0x3f6d07)[_0x1662('0x1e')](_0x53dd41);}return null;};}function patchUpdates(_0x14ae03){return function(_0x4545a7){try{jsonpatch['apply'](_0x4545a7,_0x14ae03,!![]);}catch(_0x396dde){return BPromise[_0x1662('0x25')](_0x396dde);}return _0x4545a7[_0x1662('0x26')]();};}function saveUpdates(_0x472a1c,_0xdafd98){return function(_0x357eb9){if(_0x357eb9){return _0x357eb9[_0x1662('0x27')](_0x472a1c)[_0x1662('0x28')](function(_0x1d5422){return _0x1d5422;});}return null;};}function removeEntity(_0x57ac57,_0x596cf2){return function(_0x4d3345){if(_0x4d3345){return _0x4d3345[_0x1662('0x29')]()[_0x1662('0x28')](function(){_0x57ac57[_0x1662('0x1c')](0xcc)[_0x1662('0x1d')]();});}};}function handleEntityNotFound(_0x3060ca,_0x1ae961){return function(_0xbb849b){if(!_0xbb849b){_0x3060ca[_0x1662('0x1b')](0x194);}return _0xbb849b;};}function handleError(_0x305f5d,_0x4415bd){_0x4415bd=_0x4415bd||0x1f4;return function(_0x52ba1b){logger['error'](_0x52ba1b[_0x1662('0x2a')]);if(_0x52ba1b[_0x1662('0x2b')]){delete _0x52ba1b['name'];}_0x305f5d['status'](_0x4415bd)[_0x1662('0x2c')](_0x52ba1b);};}exports[_0x1662('0x2d')]=function(_0x21e2ce,_0x3a4141){var _0x47c6fe={},_0x3f65e2={},_0x261fcd={'count':0x0,'rows':[]};var _0x2e40db=_[_0x1662('0x2e')](db[_0x1662('0x2f')]['rawAttributes'],function(_0x216e33){return{'name':_0x216e33['fieldName'],'type':_0x216e33['type'][_0x1662('0x30')]};});_0x3f65e2[_0x1662('0x31')]=_[_0x1662('0x2e')](_0x2e40db,_0x1662('0x2b'));_0x3f65e2[_0x1662('0x32')]=_[_0x1662('0x33')](_0x21e2ce[_0x1662('0x32')]);_0x3f65e2[_0x1662('0x34')]=_['intersection'](_0x3f65e2['model'],_0x3f65e2[_0x1662('0x32')]);_0x47c6fe['attributes']=_[_0x1662('0x35')](_0x3f65e2[_0x1662('0x31')],qs[_0x1662('0x36')](_0x21e2ce[_0x1662('0x32')]['fields']));_0x47c6fe['attributes']=_0x47c6fe[_0x1662('0x37')][_0x1662('0x38')]?_0x47c6fe[_0x1662('0x37')]:_0x3f65e2['model'];if(!_0x21e2ce[_0x1662('0x32')][_0x1662('0x39')]('nolimit')){_0x47c6fe[_0x1662('0x22')]=qs[_0x1662('0x22')](_0x21e2ce[_0x1662('0x32')][_0x1662('0x22')]);_0x47c6fe[_0x1662('0x1f')]=qs['offset'](_0x21e2ce[_0x1662('0x32')][_0x1662('0x1f')]);}_0x47c6fe[_0x1662('0x3a')]=qs[_0x1662('0x3b')](_0x21e2ce[_0x1662('0x32')]['sort']);_0x47c6fe[_0x1662('0x3c')]=qs['filters'](_[_0x1662('0x3d')](_0x21e2ce[_0x1662('0x32')],_0x3f65e2[_0x1662('0x34')]),_0x2e40db);if(_0x21e2ce[_0x1662('0x32')][_0x1662('0x3e')]){_0x47c6fe[_0x1662('0x3c')]=_[_0x1662('0x3f')](_0x47c6fe[_0x1662('0x3c')],{'$or':_[_0x1662('0x2e')](_0x2e40db,function(_0xb1127b){if(_0xb1127b['type']!=='VIRTUAL'){var _0x2ce72b={};_0x2ce72b[_0xb1127b['name']]={'$like':'%'+_0x21e2ce['query'][_0x1662('0x3e')]+'%'};return _0x2ce72b;}})});}_0x47c6fe=_[_0x1662('0x3f')]({},_0x47c6fe,_0x21e2ce[_0x1662('0x40')]);var _0x38acff={'where':_0x47c6fe[_0x1662('0x3c')]};return db['SmsQueueReport']['count'](_0x38acff)[_0x1662('0x28')](function(_0x31d08b){_0x261fcd[_0x1662('0x21')]=_0x31d08b;if(_0x21e2ce[_0x1662('0x32')]['includeAll']){_0x47c6fe[_0x1662('0x41')]=[{'all':!![]}];}return db[_0x1662('0x2f')][_0x1662('0x42')](_0x47c6fe);})[_0x1662('0x28')](function(_0x4e26c6){_0x261fcd[_0x1662('0x43')]=_0x4e26c6;return _0x261fcd;})[_0x1662('0x28')](respondWithFilteredResult(_0x3a4141,_0x47c6fe))[_0x1662('0x44')](handleError(_0x3a4141,null));};exports['show']=function(_0x2c3f0a,_0x1df133){var _0x233c8c={'raw':!![],'where':{'id':_0x2c3f0a['params']['id']}},_0x57be20={};_0x57be20[_0x1662('0x31')]=_[_0x1662('0x33')](db[_0x1662('0x2f')][_0x1662('0x45')]);_0x57be20[_0x1662('0x32')]=_[_0x1662('0x33')](_0x2c3f0a[_0x1662('0x32')]);_0x57be20['filters']=_[_0x1662('0x35')](_0x57be20[_0x1662('0x31')],_0x57be20[_0x1662('0x32')]);_0x233c8c['attributes']=_[_0x1662('0x35')](_0x57be20[_0x1662('0x31')],qs[_0x1662('0x36')](_0x2c3f0a['query']['fields']));_0x233c8c[_0x1662('0x37')]=_0x233c8c[_0x1662('0x37')]['length']?_0x233c8c[_0x1662('0x37')]:_0x57be20[_0x1662('0x31')];if(_0x2c3f0a[_0x1662('0x32')][_0x1662('0x46')]){_0x233c8c['include']=[{'all':!![]}];}_0x233c8c=_[_0x1662('0x3f')]({},_0x233c8c,_0x2c3f0a[_0x1662('0x40')]);return db['SmsQueueReport'][_0x1662('0x47')](_0x233c8c)[_0x1662('0x28')](handleEntityNotFound(_0x1df133,null))['then'](respondWithResult(_0x1df133,null))[_0x1662('0x44')](handleError(_0x1df133,null));};exports['create']=function(_0x32c721,_0x1d3863){return db[_0x1662('0x2f')][_0x1662('0x48')](_0x32c721[_0x1662('0x49')],{})[_0x1662('0x28')](respondWithResult(_0x1d3863,0xc9))[_0x1662('0x44')](handleError(_0x1d3863,null));};exports[_0x1662('0x27')]=function(_0x160c96,_0x1debd3){if(_0x160c96[_0x1662('0x49')]['id']){delete _0x160c96[_0x1662('0x49')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x160c96[_0x1662('0x4a')]['id']}})[_0x1662('0x28')](handleEntityNotFound(_0x1debd3,null))['then'](saveUpdates(_0x160c96[_0x1662('0x49')],null))[_0x1662('0x28')](respondWithResult(_0x1debd3,null))['catch'](handleError(_0x1debd3,null));};exports[_0x1662('0x29')]=function(_0x233a3f,_0xf634cb){return db[_0x1662('0x2f')]['find']({'where':{'id':_0x233a3f['params']['id']}})[_0x1662('0x28')](handleEntityNotFound(_0xf634cb,null))['then'](removeEntity(_0xf634cb,null))[_0x1662('0x44')](handleError(_0xf634cb,null));};exports[_0x1662('0x4b')]=function(_0x11b957,_0x25c118){return db['SmsQueueReport'][_0x1662('0x4b')]()[_0x1662('0x28')](respondWithResult(_0x25c118,null))[_0x1662('0x44')](handleError(_0x25c118,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 434e66a..dba1685 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 _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x24b9ea,_0x5b8e19){var _0x3c0d85=function(_0x190b46){while(--_0x190b46){_0x24b9ea['push'](_0x24b9ea['shift']());}};_0x3c0d85(++_0x5b8e19);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x62235,_0x14001c){var _0x5650ab=function(_0x101d49){while(--_0x101d49){_0x62235['push'](_0x62235['shift']());}};_0x5650ab(++_0x14001c);}(_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('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 6cf081f..4926a51 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 _0xfacf=['info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','debug','stringify','catch','UpdateSmsQueueReport','update','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xfacf,0x181));var _0xffac=function(_0x2306d4,_0x4b800c){_0x2306d4=_0x2306d4-0x0;var _0x30a24a=_0xfacf[_0x2306d4];return _0x30a24a;};'use strict';var _=require('lodash');var util=require(_0xffac('0x0'));var moment=require(_0xffac('0x1'));var BPromise=require(_0xffac('0x2'));var rs=require(_0xffac('0x3'));var fs=require('fs');var Redis=require(_0xffac('0x4'));var db=require(_0xffac('0x5'))['db'];var utils=require(_0xffac('0x6'));var logger=require(_0xffac('0x7'))('rpc');var config=require(_0xffac('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e3619,_0x2bffd3,_0x4273ec){return new BPromise(function(_0x1f73a5,_0x4cb0ea){return client[_0xffac('0x9')](_0x2e3619,_0x4273ec)[_0xffac('0xa')](function(_0x1cd455){logger[_0xffac('0xb')](_0xffac('0xc'),_0x2bffd3,'request\x20sent');logger['debug'](_0xffac('0xd'),_0x2bffd3,'request\x20sent',JSON['stringify'](_0x1cd455));if(_0x1cd455[_0xffac('0xe')]){if(_0x1cd455[_0xffac('0xe')][_0xffac('0xf')]===0x1f4){logger[_0xffac('0xe')](_0xffac('0xc'),_0x2bffd3,_0x1cd455[_0xffac('0xe')]['message']);return _0x4cb0ea(_0x1cd455[_0xffac('0xe')][_0xffac('0x10')]);}logger[_0xffac('0xe')](_0xffac('0xc'),_0x2bffd3,_0x1cd455[_0xffac('0xe')][_0xffac('0x10')]);return _0x1f73a5(_0x1cd455[_0xffac('0xe')]['message']);}else{logger[_0xffac('0xb')](_0xffac('0xc'),_0x2bffd3,_0xffac('0x11'));_0x1f73a5(_0x1cd455[_0xffac('0x12')][_0xffac('0x10')]);}})['catch'](function(_0x598860){logger[_0xffac('0xe')](_0xffac('0xc'),_0x2bffd3,_0x598860);_0x4cb0ea(_0x598860);});});}exports[_0xffac('0x13')]=function(_0x3334a3){var _0x2a43ea=this;return new Promise(function(_0xcb7deb,_0x5175a1){return db[_0xffac('0x14')][_0xffac('0x15')](_0x3334a3[_0xffac('0x16')],{'raw':_0x3334a3[_0xffac('0x17')]?_0x3334a3[_0xffac('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xffac('0xa')](function(_0x5cc0f4){logger['info'](_0xffac('0x13'),_0x3334a3);logger[_0xffac('0x18')]('CreateSmsQueueReport',_0x3334a3,JSON[_0xffac('0x19')](_0x5cc0f4));_0xcb7deb(_0x5cc0f4);})[_0xffac('0x1a')](function(_0x34c072){logger[_0xffac('0xe')](_0xffac('0x13'),_0x34c072['message'],_0x3334a3);_0x5175a1(_0x2a43ea[_0xffac('0xe')](0x1f4,_0x34c072['message']));});});};exports[_0xffac('0x1b')]=function(_0x1a89af){var _0x310281=this;return new Promise(function(_0xaba343,_0x3082e3){return db[_0xffac('0x14')][_0xffac('0x1c')](_0x1a89af[_0xffac('0x16')],{'raw':_0x1a89af[_0xffac('0x17')]?_0x1a89af[_0xffac('0x17')][_0xffac('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a89af['options']?_0x1a89af['options'][_0xffac('0x1e')]||null:null,'attributes':_0x1a89af[_0xffac('0x17')]?_0x1a89af[_0xffac('0x17')][_0xffac('0x1f')]||null:null,'limit':_0x1a89af[_0xffac('0x17')]?_0x1a89af[_0xffac('0x17')][_0xffac('0x20')]||null:null})[_0xffac('0xa')](function(_0x22436c){logger[_0xffac('0xb')]('UpdateSmsQueueReport',_0x1a89af);logger[_0xffac('0x18')](_0xffac('0x1b'),_0x1a89af,JSON['stringify'](_0x22436c));_0xaba343(_0x22436c);})[_0xffac('0x1a')](function(_0x3031ef){logger[_0xffac('0xe')](_0xffac('0x1b'),_0x3031ef['message'],_0x1a89af);_0x3082e3(_0x310281[_0xffac('0xe')](0x1f4,_0x3031ef['message']));});});}; \ No newline at end of file +var _0xf954=['limit','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','stringify','UpdateSmsQueueReport','update','where'];(function(_0x1da007,_0xe7342f){var _0x81aa59=function(_0x162262){while(--_0x162262){_0x1da007['push'](_0x1da007['shift']());}};_0x81aa59(++_0xe7342f);}(_0xf954,0x141));var _0x4f95=function(_0x1e9827,_0x4c26e6){_0x1e9827=_0x1e9827-0x0;var _0x84e342=_0xf954[_0x1e9827];return _0x84e342;};'use strict';var _=require(_0x4f95('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4f95('0x1'));var fs=require('fs');var Redis=require(_0x4f95('0x2'));var db=require(_0x4f95('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f95('0x4'))(_0x4f95('0x5'));var config=require(_0x4f95('0x6'));var jayson=require(_0x4f95('0x7'));var client=jayson[_0x4f95('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b3fe4,_0x147e85,_0x39c029){return new BPromise(function(_0x426079,_0x46afa2){return client[_0x4f95('0x9')](_0x3b3fe4,_0x39c029)[_0x4f95('0xa')](function(_0x2f7884){logger[_0x4f95('0xb')](_0x4f95('0xc'),_0x147e85,_0x4f95('0xd'));logger[_0x4f95('0xe')](_0x4f95('0xf'),_0x147e85,_0x4f95('0xd'),JSON['stringify'](_0x2f7884));if(_0x2f7884[_0x4f95('0x10')]){if(_0x2f7884[_0x4f95('0x10')][_0x4f95('0x11')]===0x1f4){logger[_0x4f95('0x10')](_0x4f95('0xc'),_0x147e85,_0x2f7884[_0x4f95('0x10')][_0x4f95('0x12')]);return _0x46afa2(_0x2f7884[_0x4f95('0x10')][_0x4f95('0x12')]);}logger[_0x4f95('0x10')](_0x4f95('0xc'),_0x147e85,_0x2f7884[_0x4f95('0x10')][_0x4f95('0x12')]);return _0x426079(_0x2f7884[_0x4f95('0x10')][_0x4f95('0x12')]);}else{logger[_0x4f95('0xb')](_0x4f95('0xc'),_0x147e85,_0x4f95('0xd'));_0x426079(_0x2f7884[_0x4f95('0x13')][_0x4f95('0x12')]);}})[_0x4f95('0x14')](function(_0xedb83e){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x147e85,_0xedb83e);_0x46afa2(_0xedb83e);});});}exports[_0x4f95('0x15')]=function(_0xfe3b){var _0x4e5e7e=this;return new Promise(function(_0x4fd74a,_0x21128c){return db[_0x4f95('0x16')][_0x4f95('0x17')](_0xfe3b[_0x4f95('0x18')],{'raw':_0xfe3b[_0x4f95('0x19')]?_0xfe3b[_0x4f95('0x19')][_0x4f95('0x1a')]===undefined?!![]:![]:!![]})[_0x4f95('0xa')](function(_0xb40409){logger['info'](_0x4f95('0x15'),_0xfe3b);logger[_0x4f95('0xe')](_0x4f95('0x15'),_0xfe3b,JSON[_0x4f95('0x1b')](_0xb40409));_0x4fd74a(_0xb40409);})[_0x4f95('0x14')](function(_0x5b8fd2){logger[_0x4f95('0x10')](_0x4f95('0x15'),_0x5b8fd2[_0x4f95('0x12')],_0xfe3b);_0x21128c(_0x4e5e7e[_0x4f95('0x10')](0x1f4,_0x5b8fd2[_0x4f95('0x12')]));});});};exports[_0x4f95('0x1c')]=function(_0x2f50d4){var _0xd8ed1a=this;return new Promise(function(_0x14481a,_0x473680){return db[_0x4f95('0x16')][_0x4f95('0x1d')](_0x2f50d4['body'],{'raw':_0x2f50d4['options']?_0x2f50d4['options'][_0x4f95('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f50d4[_0x4f95('0x19')]?_0x2f50d4[_0x4f95('0x19')][_0x4f95('0x1e')]||null:null,'attributes':_0x2f50d4[_0x4f95('0x19')]?_0x2f50d4[_0x4f95('0x19')]['attributes']||null:null,'limit':_0x2f50d4['options']?_0x2f50d4[_0x4f95('0x19')][_0x4f95('0x1f')]||null:null})[_0x4f95('0xa')](function(_0x1eb2a1){logger[_0x4f95('0xb')](_0x4f95('0x1c'),_0x2f50d4);logger[_0x4f95('0xe')](_0x4f95('0x1c'),_0x2f50d4,JSON[_0x4f95('0x1b')](_0x1eb2a1));_0x14481a(_0x1eb2a1);})[_0x4f95('0x14')](function(_0x4c4208){logger['error'](_0x4f95('0x1c'),_0x4c4208[_0x4f95('0x12')],_0x2f50d4);_0x473680(_0xd8ed1a[_0x4f95('0x10')](0x1f4,_0x4c4208[_0x4f95('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index f0956e7..f948958 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 _0xe0c3=['update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x245134,_0x596efb){var _0x56671d=function(_0x3b67db){while(--_0x3b67db){_0x245134['push'](_0x245134['shift']());}};_0x56671d(++_0x596efb);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3e0c('0x0'));var util=require('util');var path=require(_0x3e0c('0x1'));var timeout=require(_0x3e0c('0x2'));var express=require(_0x3e0c('0x3'));var router=express[_0x3e0c('0x4')]();var fs_extra=require(_0x3e0c('0x5'));var auth=require(_0x3e0c('0x6'));var interaction=require(_0x3e0c('0x7'));var config=require(_0x3e0c('0x8'));var controller=require(_0x3e0c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e0c('0xa')]);router[_0x3e0c('0xb')](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0xe')]);router[_0x3e0c('0xb')](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x10')]);router[_0x3e0c('0x11')]('/',auth[_0x3e0c('0xd')](),controller['create']);router['put'](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x12')]);router[_0x3e0c('0x13')](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3c94=['get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller'];(function(_0xb3d956,_0x23895e){var _0x1eb227=function(_0x8420e0){while(--_0x8420e0){_0xb3d956['push'](_0xb3d956['shift']());}};_0x1eb227(++_0x23895e);}(_0x3c94,0xcd));var _0x43c9=function(_0x5da048,_0xca5c85){_0x5da048=_0x5da048-0x0;var _0x13dfc5=_0x3c94[_0x5da048];return _0x13dfc5;};'use strict';var multer=require(_0x43c9('0x0'));var util=require(_0x43c9('0x1'));var path=require(_0x43c9('0x2'));var timeout=require(_0x43c9('0x3'));var express=require(_0x43c9('0x4'));var router=express[_0x43c9('0x5')]();var fs_extra=require(_0x43c9('0x6'));var auth=require(_0x43c9('0x7'));var interaction=require(_0x43c9('0x8'));var config=require(_0x43c9('0x9'));var controller=require(_0x43c9('0xa'));router[_0x43c9('0xb')]('/',auth['isAuthenticated'](),controller[_0x43c9('0xc')]);router[_0x43c9('0xb')](_0x43c9('0xd'),auth[_0x43c9('0xe')](),controller[_0x43c9('0xf')]);router[_0x43c9('0xb')](_0x43c9('0x10'),auth[_0x43c9('0xe')](),controller[_0x43c9('0x11')]);router['post']('/',auth[_0x43c9('0xe')](),controller[_0x43c9('0x12')]);router[_0x43c9('0x13')](_0x43c9('0x10'),auth[_0x43c9('0xe')](),controller[_0x43c9('0x14')]);router[_0x43c9('0x15')](_0x43c9('0x10'),auth[_0x43c9('0xe')](),controller[_0x43c9('0x16')]);module[_0x43c9('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index b4bcec6..1b0e961 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3351ce,_0x384a86){var _0x5818f7=function(_0x57c0e6){while(--_0x57c0e6){_0x3351ce['push'](_0x3351ce['shift']());}};_0x5818f7(++_0x384a86);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x404cde,_0x27b51c){_0x404cde=_0x404cde-0x0;var _0x139882=_0xf3cd[_0x404cde];return _0x139882;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x34e8,0x12c));var _0x834e=function(_0x485518,_0x339e09){_0x485518=_0x485518-0x0;var _0x514bb8=_0x34e8[_0x485518];return _0x514bb8;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 4f033a8..0e9408a 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 _0x4a15=['stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','end','json','undefined','offset','limit','set','Content-Range','reject','update','then','destroy','error'];(function(_0x438912,_0x3f7f74){var _0x18112f=function(_0x1b8ac9){while(--_0x1b8ac9){_0x438912['push'](_0x438912['shift']());}};_0x18112f(++_0x3f7f74);}(_0x4a15,0x110));var _0x54a1=function(_0x25fa5c,_0x421141){_0x25fa5c=_0x25fa5c-0x0;var _0x1bade2=_0x4a15[_0x25fa5c];return _0x1bade2;};'use strict';var emlformat=require(_0x54a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x54a1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x54a1('0x2'));var moment=require(_0x54a1('0x3'));var BPromise=require(_0x54a1('0x4'));var Mustache=require(_0x54a1('0x5'));var util=require(_0x54a1('0x6'));var path=require(_0x54a1('0x7'));var sox=require(_0x54a1('0x8'));var csv=require(_0x54a1('0x9'));var ejs=require(_0x54a1('0xa'));var fs=require('fs');var fs_extra=require(_0x54a1('0xb'));var _=require(_0x54a1('0xc'));var squel=require('squel');var crypto=require(_0x54a1('0xd'));var jsforce=require(_0x54a1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x54a1('0x9'));var querystring=require(_0x54a1('0xf'));var Papa=require(_0x54a1('0x10'));var Redis=require('ioredis');var authService=require(_0x54a1('0x11'));var qs=require(_0x54a1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54a1('0x13'));var logger=require(_0x54a1('0x14'))(_0x54a1('0x15'));var utils=require(_0x54a1('0x16'));var config=require(_0x54a1('0x17'));var licenseUtil=require(_0x54a1('0x18'));var db=require(_0x54a1('0x19'))['db'];function respondWithStatusCode(_0x2d6038,_0x426a4f){_0x426a4f=_0x426a4f||0xcc;return function(_0x2e7d65){if(_0x2e7d65){return _0x2d6038[_0x54a1('0x1a')](_0x426a4f);}return _0x2d6038[_0x54a1('0x1b')](_0x426a4f)[_0x54a1('0x1c')]();};}function respondWithResult(_0x263859,_0x1ad1d3){_0x1ad1d3=_0x1ad1d3||0xc8;return function(_0x560d9d){if(_0x560d9d){return _0x263859[_0x54a1('0x1b')](_0x1ad1d3)[_0x54a1('0x1d')](_0x560d9d);}};}function respondWithFilteredResult(_0x5801df,_0x4d1cd3){return function(_0x3a4e5a){if(_0x3a4e5a){var _0x3cfda0=typeof _0x4d1cd3['offset']===_0x54a1('0x1e')&&typeof _0x4d1cd3['limit']===_0x54a1('0x1e');var _0x407860=_0x3a4e5a['count'];var _0x249448=_0x3cfda0?0x0:_0x4d1cd3[_0x54a1('0x1f')];var _0x4ede76=_0x3cfda0?_0x3a4e5a['count']:_0x4d1cd3['offset']+_0x4d1cd3[_0x54a1('0x20')];var _0x50f901;if(_0x4ede76>=_0x407860){_0x4ede76=_0x407860;_0x50f901=0xc8;}else{_0x50f901=0xce;}_0x5801df[_0x54a1('0x1b')](_0x50f901);return _0x5801df[_0x54a1('0x21')](_0x54a1('0x22'),_0x249448+'-'+_0x4ede76+'/'+_0x407860)[_0x54a1('0x1d')](_0x3a4e5a);}return null;};}function patchUpdates(_0x44a851){return function(_0x1cfe86){try{jsonpatch['apply'](_0x1cfe86,_0x44a851,!![]);}catch(_0xfb106a){return BPromise[_0x54a1('0x23')](_0xfb106a);}return _0x1cfe86['save']();};}function saveUpdates(_0x1c349a,_0x217994){return function(_0xc4723c){if(_0xc4723c){return _0xc4723c[_0x54a1('0x24')](_0x1c349a)[_0x54a1('0x25')](function(_0x4d7b9a){return _0x4d7b9a;});}return null;};}function removeEntity(_0x1884fc,_0x2ba033){return function(_0x250858){if(_0x250858){return _0x250858[_0x54a1('0x26')]()[_0x54a1('0x25')](function(){_0x1884fc[_0x54a1('0x1b')](0xcc)[_0x54a1('0x1c')]();});}};}function handleEntityNotFound(_0x1ab043,_0x4eb483){return function(_0x4da413){if(!_0x4da413){_0x1ab043[_0x54a1('0x1a')](0x194);}return _0x4da413;};}function handleError(_0x43b8e2,_0x529029){_0x529029=_0x529029||0x1f4;return function(_0x453319){logger[_0x54a1('0x27')](_0x453319[_0x54a1('0x28')]);if(_0x453319[_0x54a1('0x29')]){delete _0x453319[_0x54a1('0x29')];}_0x43b8e2['status'](_0x529029)['send'](_0x453319);};}exports['index']=function(_0x6cb8ca,_0x446a90){var _0x10d962={},_0x2b5c95={},_0x4665fb={'count':0x0,'rows':[]};var _0x2ed243=_[_0x54a1('0x2a')](db[_0x54a1('0x2b')][_0x54a1('0x2c')],function(_0x6b03e2){return{'name':_0x6b03e2[_0x54a1('0x2d')],'type':_0x6b03e2[_0x54a1('0x2e')][_0x54a1('0x2f')]};});_0x2b5c95['model']=_[_0x54a1('0x2a')](_0x2ed243,_0x54a1('0x29'));_0x2b5c95['query']=_[_0x54a1('0x30')](_0x6cb8ca[_0x54a1('0x31')]);_0x2b5c95['filters']=_[_0x54a1('0x32')](_0x2b5c95[_0x54a1('0x33')],_0x2b5c95[_0x54a1('0x31')]);_0x10d962[_0x54a1('0x34')]=_['intersection'](_0x2b5c95[_0x54a1('0x33')],qs[_0x54a1('0x35')](_0x6cb8ca['query'][_0x54a1('0x35')]));_0x10d962[_0x54a1('0x34')]=_0x10d962[_0x54a1('0x34')][_0x54a1('0x36')]?_0x10d962[_0x54a1('0x34')]:_0x2b5c95['model'];if(!_0x6cb8ca[_0x54a1('0x31')][_0x54a1('0x37')](_0x54a1('0x38'))){_0x10d962[_0x54a1('0x20')]=qs['limit'](_0x6cb8ca[_0x54a1('0x31')][_0x54a1('0x20')]);_0x10d962[_0x54a1('0x1f')]=qs[_0x54a1('0x1f')](_0x6cb8ca[_0x54a1('0x31')][_0x54a1('0x1f')]);}_0x10d962[_0x54a1('0x39')]=qs[_0x54a1('0x3a')](_0x6cb8ca[_0x54a1('0x31')]['sort']);_0x10d962['where']=qs[_0x54a1('0x3b')](_[_0x54a1('0x3c')](_0x6cb8ca[_0x54a1('0x31')],_0x2b5c95[_0x54a1('0x3b')]),_0x2ed243);if(_0x6cb8ca[_0x54a1('0x31')][_0x54a1('0x3d')]){_0x10d962[_0x54a1('0x3e')]=_[_0x54a1('0x3f')](_0x10d962['where'],{'$or':_[_0x54a1('0x2a')](_0x2ed243,function(_0x1d01e1){if(_0x1d01e1[_0x54a1('0x2e')]!==_0x54a1('0x40')){var _0x57a727={};_0x57a727[_0x1d01e1[_0x54a1('0x29')]]={'$like':'%'+_0x6cb8ca[_0x54a1('0x31')][_0x54a1('0x3d')]+'%'};return _0x57a727;}})});}_0x10d962=_[_0x54a1('0x3f')]({},_0x10d962,_0x6cb8ca[_0x54a1('0x41')]);var _0x466506={'where':_0x10d962[_0x54a1('0x3e')]};return db['SmsTransferReport'][_0x54a1('0x42')](_0x466506)[_0x54a1('0x25')](function(_0x22b1ca){_0x4665fb[_0x54a1('0x42')]=_0x22b1ca;if(_0x6cb8ca[_0x54a1('0x31')][_0x54a1('0x43')]){_0x10d962['include']=[{'all':!![]}];}return db[_0x54a1('0x2b')][_0x54a1('0x44')](_0x10d962);})[_0x54a1('0x25')](function(_0x31b818){_0x4665fb[_0x54a1('0x45')]=_0x31b818;return _0x4665fb;})[_0x54a1('0x25')](respondWithFilteredResult(_0x446a90,_0x10d962))['catch'](handleError(_0x446a90,null));};exports[_0x54a1('0x46')]=function(_0x28ea84,_0x15a294){var _0x58a908={'raw':!![],'where':{'id':_0x28ea84[_0x54a1('0x47')]['id']}},_0x5bc590={};_0x5bc590[_0x54a1('0x33')]=_['keys'](db[_0x54a1('0x2b')][_0x54a1('0x2c')]);_0x5bc590[_0x54a1('0x31')]=_['keys'](_0x28ea84['query']);_0x5bc590['filters']=_[_0x54a1('0x32')](_0x5bc590[_0x54a1('0x33')],_0x5bc590[_0x54a1('0x31')]);_0x58a908[_0x54a1('0x34')]=_[_0x54a1('0x32')](_0x5bc590[_0x54a1('0x33')],qs[_0x54a1('0x35')](_0x28ea84[_0x54a1('0x31')]['fields']));_0x58a908['attributes']=_0x58a908[_0x54a1('0x34')][_0x54a1('0x36')]?_0x58a908[_0x54a1('0x34')]:_0x5bc590[_0x54a1('0x33')];if(_0x28ea84[_0x54a1('0x31')][_0x54a1('0x43')]){_0x58a908[_0x54a1('0x48')]=[{'all':!![]}];}_0x58a908=_['merge']({},_0x58a908,_0x28ea84['options']);return db[_0x54a1('0x2b')][_0x54a1('0x49')](_0x58a908)['then'](handleEntityNotFound(_0x15a294,null))['then'](respondWithResult(_0x15a294,null))[_0x54a1('0x4a')](handleError(_0x15a294,null));};exports[_0x54a1('0x4b')]=function(_0x855e9b,_0x55c5be){return db['SmsTransferReport']['create'](_0x855e9b['body'],{})[_0x54a1('0x25')](respondWithResult(_0x55c5be,0xc9))[_0x54a1('0x4a')](handleError(_0x55c5be,null));};exports[_0x54a1('0x24')]=function(_0x493041,_0x214a82){if(_0x493041[_0x54a1('0x4c')]['id']){delete _0x493041[_0x54a1('0x4c')]['id'];}return db[_0x54a1('0x2b')][_0x54a1('0x49')]({'where':{'id':_0x493041[_0x54a1('0x47')]['id']}})[_0x54a1('0x25')](handleEntityNotFound(_0x214a82,null))[_0x54a1('0x25')](saveUpdates(_0x493041[_0x54a1('0x4c')],null))[_0x54a1('0x25')](respondWithResult(_0x214a82,null))[_0x54a1('0x4a')](handleError(_0x214a82,null));};exports[_0x54a1('0x26')]=function(_0x496663,_0x3101ee){return db['SmsTransferReport']['find']({'where':{'id':_0x496663[_0x54a1('0x47')]['id']}})[_0x54a1('0x25')](handleEntityNotFound(_0x3101ee,null))['then'](removeEntity(_0x3101ee,null))[_0x54a1('0x4a')](handleError(_0x3101ee,null));};exports[_0x54a1('0x4d')]=function(_0x384494,_0xaa999e){return db[_0x54a1('0x2b')][_0x54a1('0x4d')]()['then'](respondWithResult(_0xaa999e,null))[_0x54a1('0x4a')](handleError(_0xaa999e,null));}; \ No newline at end of file +var _0x29c6=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','save','update','destroy','then','end','error','stack','name','index','SmsTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','length','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x405a31,_0x25b33c){var _0x3bd8fe=function(_0x41b73f){while(--_0x41b73f){_0x405a31['push'](_0x405a31['shift']());}};_0x3bd8fe(++_0x25b33c);}(_0x29c6,0x1c0));var _0x629c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x29c6[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x629c('0x0'));var rimraf=require(_0x629c('0x1'));var zipdir=require(_0x629c('0x2'));var jsonpatch=require(_0x629c('0x3'));var rp=require(_0x629c('0x4'));var moment=require(_0x629c('0x5'));var BPromise=require(_0x629c('0x6'));var Mustache=require(_0x629c('0x7'));var util=require(_0x629c('0x8'));var path=require(_0x629c('0x9'));var sox=require(_0x629c('0xa'));var csv=require(_0x629c('0xb'));var ejs=require(_0x629c('0xc'));var fs=require('fs');var fs_extra=require(_0x629c('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x629c('0xe'));var jsforce=require(_0x629c('0xf'));var deskjs=require(_0x629c('0x10'));var toCsv=require(_0x629c('0xb'));var querystring=require(_0x629c('0x11'));var Papa=require(_0x629c('0x12'));var Redis=require(_0x629c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x629c('0x14'));var as=require(_0x629c('0x15'));var hardwareService=require(_0x629c('0x16'));var logger=require(_0x629c('0x17'))(_0x629c('0x18'));var utils=require(_0x629c('0x19'));var config=require(_0x629c('0x1a'));var licenseUtil=require(_0x629c('0x1b'));var db=require(_0x629c('0x1c'))['db'];function respondWithStatusCode(_0xf58cc6,_0x473c3f){_0x473c3f=_0x473c3f||0xcc;return function(_0x31da06){if(_0x31da06){return _0xf58cc6[_0x629c('0x1d')](_0x473c3f);}return _0xf58cc6[_0x629c('0x1e')](_0x473c3f)['end']();};}function respondWithResult(_0x1316f5,_0x1ddba6){_0x1ddba6=_0x1ddba6||0xc8;return function(_0x520a1c){if(_0x520a1c){return _0x1316f5[_0x629c('0x1e')](_0x1ddba6)[_0x629c('0x1f')](_0x520a1c);}};}function respondWithFilteredResult(_0x5f547d,_0x52d1e2){return function(_0xda1712){if(_0xda1712){var _0xb064f9=typeof _0x52d1e2[_0x629c('0x20')]==='undefined'&&typeof _0x52d1e2[_0x629c('0x21')]==='undefined';var _0x9affdd=_0xda1712[_0x629c('0x22')];var _0x5a9e6a=_0xb064f9?0x0:_0x52d1e2[_0x629c('0x20')];var _0xfcaa84=_0xb064f9?_0xda1712[_0x629c('0x22')]:_0x52d1e2[_0x629c('0x20')]+_0x52d1e2[_0x629c('0x21')];var _0x255adc;if(_0xfcaa84>=_0x9affdd){_0xfcaa84=_0x9affdd;_0x255adc=0xc8;}else{_0x255adc=0xce;}_0x5f547d[_0x629c('0x1e')](_0x255adc);return _0x5f547d[_0x629c('0x23')]('Content-Range',_0x5a9e6a+'-'+_0xfcaa84+'/'+_0x9affdd)['json'](_0xda1712);}return null;};}function patchUpdates(_0x5dac32){return function(_0xe1e8ab){try{jsonpatch['apply'](_0xe1e8ab,_0x5dac32,!![]);}catch(_0x163dc5){return BPromise['reject'](_0x163dc5);}return _0xe1e8ab[_0x629c('0x24')]();};}function saveUpdates(_0x2b63f9,_0x3840b5){return function(_0x543a37){if(_0x543a37){return _0x543a37[_0x629c('0x25')](_0x2b63f9)['then'](function(_0x35d9b7){return _0x35d9b7;});}return null;};}function removeEntity(_0x128d53,_0xb5d6fa){return function(_0x545382){if(_0x545382){return _0x545382[_0x629c('0x26')]()[_0x629c('0x27')](function(){_0x128d53[_0x629c('0x1e')](0xcc)[_0x629c('0x28')]();});}};}function handleEntityNotFound(_0x47c3c4,_0x19d93a){return function(_0x4d4877){if(!_0x4d4877){_0x47c3c4['sendStatus'](0x194);}return _0x4d4877;};}function handleError(_0x24ef57,_0x5cf6fb){_0x5cf6fb=_0x5cf6fb||0x1f4;return function(_0x3d9397){logger[_0x629c('0x29')](_0x3d9397[_0x629c('0x2a')]);if(_0x3d9397['name']){delete _0x3d9397[_0x629c('0x2b')];}_0x24ef57[_0x629c('0x1e')](_0x5cf6fb)['send'](_0x3d9397);};}exports[_0x629c('0x2c')]=function(_0x3a48fe,_0x5c0d86){var _0x21d5a9={},_0x475f5a={},_0x274c7a={'count':0x0,'rows':[]};var _0x7605ac=_['map'](db[_0x629c('0x2d')][_0x629c('0x2e')],function(_0x2a9cfd){return{'name':_0x2a9cfd[_0x629c('0x2f')],'type':_0x2a9cfd[_0x629c('0x30')][_0x629c('0x31')]};});_0x475f5a[_0x629c('0x32')]=_[_0x629c('0x33')](_0x7605ac,_0x629c('0x2b'));_0x475f5a[_0x629c('0x34')]=_['keys'](_0x3a48fe[_0x629c('0x34')]);_0x475f5a[_0x629c('0x35')]=_[_0x629c('0x36')](_0x475f5a[_0x629c('0x32')],_0x475f5a[_0x629c('0x34')]);_0x21d5a9['attributes']=_[_0x629c('0x36')](_0x475f5a['model'],qs[_0x629c('0x37')](_0x3a48fe[_0x629c('0x34')][_0x629c('0x37')]));_0x21d5a9[_0x629c('0x38')]=_0x21d5a9[_0x629c('0x38')]['length']?_0x21d5a9[_0x629c('0x38')]:_0x475f5a['model'];if(!_0x3a48fe[_0x629c('0x34')][_0x629c('0x39')](_0x629c('0x3a'))){_0x21d5a9[_0x629c('0x21')]=qs[_0x629c('0x21')](_0x3a48fe['query'][_0x629c('0x21')]);_0x21d5a9[_0x629c('0x20')]=qs[_0x629c('0x20')](_0x3a48fe[_0x629c('0x34')]['offset']);}_0x21d5a9['order']=qs[_0x629c('0x3b')](_0x3a48fe[_0x629c('0x34')][_0x629c('0x3b')]);_0x21d5a9[_0x629c('0x3c')]=qs['filters'](_[_0x629c('0x3d')](_0x3a48fe['query'],_0x475f5a[_0x629c('0x35')]),_0x7605ac);if(_0x3a48fe['query'][_0x629c('0x3e')]){_0x21d5a9['where']=_[_0x629c('0x3f')](_0x21d5a9[_0x629c('0x3c')],{'$or':_[_0x629c('0x33')](_0x7605ac,function(_0x3a0330){if(_0x3a0330['type']!=='VIRTUAL'){var _0x1f8631={};_0x1f8631[_0x3a0330[_0x629c('0x2b')]]={'$like':'%'+_0x3a48fe['query']['filter']+'%'};return _0x1f8631;}})});}_0x21d5a9=_['merge']({},_0x21d5a9,_0x3a48fe[_0x629c('0x40')]);var _0x1c4fad={'where':_0x21d5a9['where']};return db[_0x629c('0x2d')]['count'](_0x1c4fad)[_0x629c('0x27')](function(_0x4463b6){_0x274c7a[_0x629c('0x22')]=_0x4463b6;if(_0x3a48fe[_0x629c('0x34')][_0x629c('0x41')]){_0x21d5a9['include']=[{'all':!![]}];}return db[_0x629c('0x2d')][_0x629c('0x42')](_0x21d5a9);})[_0x629c('0x27')](function(_0x1da06d){_0x274c7a[_0x629c('0x43')]=_0x1da06d;return _0x274c7a;})[_0x629c('0x27')](respondWithFilteredResult(_0x5c0d86,_0x21d5a9))[_0x629c('0x44')](handleError(_0x5c0d86,null));};exports[_0x629c('0x45')]=function(_0x2e347e,_0x18f0a3){var _0x4a1d38={'raw':!![],'where':{'id':_0x2e347e[_0x629c('0x46')]['id']}},_0x32b26c={};_0x32b26c['model']=_[_0x629c('0x47')](db['SmsTransferReport'][_0x629c('0x2e')]);_0x32b26c[_0x629c('0x34')]=_[_0x629c('0x47')](_0x2e347e[_0x629c('0x34')]);_0x32b26c['filters']=_[_0x629c('0x36')](_0x32b26c['model'],_0x32b26c[_0x629c('0x34')]);_0x4a1d38[_0x629c('0x38')]=_[_0x629c('0x36')](_0x32b26c[_0x629c('0x32')],qs[_0x629c('0x37')](_0x2e347e[_0x629c('0x34')][_0x629c('0x37')]));_0x4a1d38[_0x629c('0x38')]=_0x4a1d38[_0x629c('0x38')][_0x629c('0x48')]?_0x4a1d38['attributes']:_0x32b26c[_0x629c('0x32')];if(_0x2e347e[_0x629c('0x34')][_0x629c('0x41')]){_0x4a1d38[_0x629c('0x49')]=[{'all':!![]}];}_0x4a1d38=_['merge']({},_0x4a1d38,_0x2e347e[_0x629c('0x40')]);return db['SmsTransferReport']['find'](_0x4a1d38)[_0x629c('0x27')](handleEntityNotFound(_0x18f0a3,null))[_0x629c('0x27')](respondWithResult(_0x18f0a3,null))[_0x629c('0x44')](handleError(_0x18f0a3,null));};exports[_0x629c('0x4a')]=function(_0x199c31,_0x2f85ef){return db[_0x629c('0x2d')]['create'](_0x199c31[_0x629c('0x4b')],{})[_0x629c('0x27')](respondWithResult(_0x2f85ef,0xc9))[_0x629c('0x44')](handleError(_0x2f85ef,null));};exports[_0x629c('0x25')]=function(_0x3a98ed,_0x1aa27e){if(_0x3a98ed['body']['id']){delete _0x3a98ed[_0x629c('0x4b')]['id'];}return db[_0x629c('0x2d')]['find']({'where':{'id':_0x3a98ed[_0x629c('0x46')]['id']}})['then'](handleEntityNotFound(_0x1aa27e,null))[_0x629c('0x27')](saveUpdates(_0x3a98ed[_0x629c('0x4b')],null))[_0x629c('0x27')](respondWithResult(_0x1aa27e,null))[_0x629c('0x44')](handleError(_0x1aa27e,null));};exports['destroy']=function(_0x5ac2e1,_0x232c43){return db[_0x629c('0x2d')][_0x629c('0x4c')]({'where':{'id':_0x5ac2e1[_0x629c('0x46')]['id']}})[_0x629c('0x27')](handleEntityNotFound(_0x232c43,null))['then'](removeEntity(_0x232c43,null))['catch'](handleError(_0x232c43,null));};exports[_0x629c('0x4d')]=function(_0x1cf9d3,_0x4f729c){return db['SmsTransferReport'][_0x629c('0x4d')]()['then'](respondWithResult(_0x4f729c,null))[_0x629c('0x44')](handleError(_0x4f729c,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 17812dc..e3ed4f3 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 _0x9e69=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x4ab8fc,_0x27e5bd){var _0x4b30fb=function(_0x481755){while(--_0x481755){_0x4ab8fc['push'](_0x4ab8fc['shift']());}};_0x4b30fb(++_0x27e5bd);}(_0x9e69,0xcf));var _0x99e6=function(_0x3729bd,_0x16d623){_0x3729bd=_0x3729bd-0x0;var _0x1ffe50=_0x9e69[_0x3729bd];return _0x1ffe50;};'use strict';var _=require(_0x99e6('0x0'));var util=require('util');var logger=require(_0x99e6('0x1'))(_0x99e6('0x2'));var moment=require(_0x99e6('0x3'));var BPromise=require(_0x99e6('0x4'));var rp=require(_0x99e6('0x5'));var fs=require('fs');var path=require(_0x99e6('0x6'));var rimraf=require(_0x99e6('0x7'));var config=require('../../config/environment');var attributes=require(_0x99e6('0x8'));module[_0x99e6('0x9')]=function(_0x1c115d,_0x5f5d85){return _0x1c115d['define'](_0x99e6('0xa'),attributes,{'tableName':_0x99e6('0xb'),'paranoid':![],'indexes':[{'name':_0x99e6('0xc'),'fields':[_0x99e6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb620=['api','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','report_sms_transfer','uniqueid','lodash','../../config/logger'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb620,0x1a0));var _0x0b62=function(_0x2ca110,_0x570b30){_0x2ca110=_0x2ca110-0x0;var _0x2fab1f=_0xb620[_0x2ca110];return _0x2fab1f;};'use strict';var _=require(_0x0b62('0x0'));var util=require('util');var logger=require(_0x0b62('0x1'))(_0x0b62('0x2'));var moment=require('moment');var BPromise=require(_0x0b62('0x3'));var rp=require(_0x0b62('0x4'));var fs=require('fs');var path=require(_0x0b62('0x5'));var rimraf=require(_0x0b62('0x6'));var config=require(_0x0b62('0x7'));var attributes=require(_0x0b62('0x8'));module['exports']=function(_0x4334b9,_0xee4338){return _0x4334b9['define']('SmsTransferReport',attributes,{'tableName':_0x0b62('0x9'),'paranoid':![],'indexes':[{'name':_0x0b62('0xa'),'fields':[_0x0b62('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 17a2666..3f0f4a1 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 _0xae53=['../../config/environment','client','request','then','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x434577,_0x18d180){var _0x46f066=function(_0x5158c3){while(--_0x5158c3){_0x434577['push'](_0x434577['shift']());}};_0x46f066(++_0x18d180);}(_0xae53,0x16e));var _0x3ae5=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xae53[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x3ae5('0x0'));var util=require('util');var moment=require(_0x3ae5('0x1'));var BPromise=require(_0x3ae5('0x2'));var rs=require(_0x3ae5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ae5('0x4'))['db'];var utils=require(_0x3ae5('0x5'));var logger=require(_0x3ae5('0x6'))(_0x3ae5('0x7'));var config=require(_0x3ae5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3ae5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2664cd,_0x2205f7,_0x29174e){return new BPromise(function(_0x3fdf89,_0x246603){return client[_0x3ae5('0xa')](_0x2664cd,_0x29174e)[_0x3ae5('0xb')](function(_0x223594){logger['info'](_0x3ae5('0xc'),_0x2205f7,'request\x20sent');logger[_0x3ae5('0xd')](_0x3ae5('0xe'),_0x2205f7,_0x3ae5('0xf'),JSON[_0x3ae5('0x10')](_0x223594));if(_0x223594[_0x3ae5('0x11')]){if(_0x223594['error'][_0x3ae5('0x12')]===0x1f4){logger[_0x3ae5('0x11')](_0x3ae5('0xc'),_0x2205f7,_0x223594['error']['message']);return _0x246603(_0x223594[_0x3ae5('0x11')]['message']);}logger[_0x3ae5('0x11')](_0x3ae5('0xc'),_0x2205f7,_0x223594[_0x3ae5('0x11')][_0x3ae5('0x13')]);return _0x3fdf89(_0x223594[_0x3ae5('0x11')]['message']);}else{logger[_0x3ae5('0x14')](_0x3ae5('0xc'),_0x2205f7,_0x3ae5('0xf'));_0x3fdf89(_0x223594['result']['message']);}})[_0x3ae5('0x15')](function(_0x1e5e0b){logger[_0x3ae5('0x11')](_0x3ae5('0xc'),_0x2205f7,_0x1e5e0b);_0x246603(_0x1e5e0b);});});} \ No newline at end of file +var _0x29d4=['request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s'];(function(_0x42b768,_0x3f1862){var _0x4ccda8=function(_0x2d1250){while(--_0x2d1250){_0x42b768['push'](_0x42b768['shift']());}};_0x4ccda8(++_0x3f1862);}(_0x29d4,0x1a1));var _0x429d=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x29d4[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x429d('0x0'));var util=require('util');var moment=require(_0x429d('0x1'));var BPromise=require(_0x429d('0x2'));var rs=require(_0x429d('0x3'));var fs=require('fs');var Redis=require(_0x429d('0x4'));var db=require(_0x429d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x429d('0x6'))(_0x429d('0x7'));var config=require(_0x429d('0x8'));var jayson=require(_0x429d('0x9'));var client=jayson[_0x429d('0xa')][_0x429d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56aa2f,_0x1ede3f,_0x4befb9){return new BPromise(function(_0x9fc337,_0x47cb29){return client[_0x429d('0xc')](_0x56aa2f,_0x4befb9)[_0x429d('0xd')](function(_0xe6f5b4){logger['info'](_0x429d('0xe'),_0x1ede3f,_0x429d('0xf'));logger['debug'](_0x429d('0x10'),_0x1ede3f,_0x429d('0xf'),JSON[_0x429d('0x11')](_0xe6f5b4));if(_0xe6f5b4['error']){if(_0xe6f5b4[_0x429d('0x12')][_0x429d('0x13')]===0x1f4){logger[_0x429d('0x12')](_0x429d('0xe'),_0x1ede3f,_0xe6f5b4['error'][_0x429d('0x14')]);return _0x47cb29(_0xe6f5b4[_0x429d('0x12')][_0x429d('0x14')]);}logger['error'](_0x429d('0xe'),_0x1ede3f,_0xe6f5b4[_0x429d('0x12')]['message']);return _0x9fc337(_0xe6f5b4[_0x429d('0x12')][_0x429d('0x14')]);}else{logger[_0x429d('0x15')](_0x429d('0xe'),_0x1ede3f,_0x429d('0xf'));_0x9fc337(_0xe6f5b4[_0x429d('0x16')]['message']);}})[_0x429d('0x17')](function(_0x53d19d){logger[_0x429d('0x12')](_0x429d('0xe'),_0x1ede3f,_0x53d19d);_0x47cb29(_0x53d19d);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 27e2f41..7a56639 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 _0xb64b=['join','root','server/files/sounds/original/','originalname','replace','format','basename','now','single','file','create','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','/:id','show','get','/:id/download','diskStorage'];(function(_0xc5b6f,_0x171456){var _0x340076=function(_0x1fce4a){while(--_0x1fce4a){_0xc5b6f['push'](_0xc5b6f['shift']());}};_0x340076(++_0x171456);}(_0xb64b,0x11d));var _0xbb64=function(_0x48b66e,_0x461edb){_0x48b66e=_0x48b66e-0x0;var _0x151723=_0xb64b[_0x48b66e];return _0x151723;};'use strict';var multer=require(_0xbb64('0x0'));var util=require(_0xbb64('0x1'));var path=require(_0xbb64('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbb64('0x3')]();var fs_extra=require(_0xbb64('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb64('0x5'));var config=require(_0xbb64('0x6'));var controller=require(_0xbb64('0x7'));router['get']('/',auth[_0xbb64('0x8')](),controller[_0xbb64('0x9')]);router['get'](_0xbb64('0xa'),auth[_0xbb64('0x8')](),controller[_0xbb64('0xb')]);router[_0xbb64('0xc')](_0xbb64('0xd'),auth[_0xbb64('0x8')](),controller['download']);var upload=multer({'storage':multer[_0xbb64('0xe')]({'destination':function(_0x58554b,_0x434c56,_0x1a751d){_0x1a751d(null,path[_0xbb64('0xf')](config[_0xbb64('0x10')],_0xbb64('0x11')));},'filename':function(_0x141842,_0x2978f0,_0x16f08f){_0x2978f0[_0xbb64('0x12')]=_0x2978f0[_0xbb64('0x12')][_0xbb64('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x16f08f(null,util[_0xbb64('0x14')]('%s-%s%s',path[_0xbb64('0x15')](_0x2978f0[_0xbb64('0x12')],path['extname'](_0x2978f0[_0xbb64('0x12')])),Date[_0xbb64('0x16')](),path['extname'](_0x2978f0[_0xbb64('0x12')])));}})});router['post']('/',upload[_0xbb64('0x17')](_0xbb64('0x18')),controller[_0xbb64('0x19')]);router[_0xbb64('0x1a')](_0xbb64('0xa'),auth['isAuthenticated'](),controller[_0xbb64('0x1b')]);router[_0xbb64('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0xbb64('0x1c')]);module[_0xbb64('0x1d')]=router; \ No newline at end of file +var _0x5ca0=['isAuthenticated','/:id','show','get','download','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller'];(function(_0x4195bc,_0x573a6c){var _0x14a2fd=function(_0xea1055){while(--_0xea1055){_0x4195bc['push'](_0x4195bc['shift']());}};_0x14a2fd(++_0x573a6c);}(_0x5ca0,0x148));var _0x05ca=function(_0x19e3b8,_0x4aa99b){_0x19e3b8=_0x19e3b8-0x0;var _0x31477a=_0x5ca0[_0x19e3b8];return _0x31477a;};'use strict';var multer=require('multer');var util=require(_0x05ca('0x0'));var path=require(_0x05ca('0x1'));var timeout=require('connect-timeout');var express=require(_0x05ca('0x2'));var router=express[_0x05ca('0x3')]();var fs_extra=require(_0x05ca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x05ca('0x5'));var config=require(_0x05ca('0x6'));var controller=require(_0x05ca('0x7'));router['get']('/',auth[_0x05ca('0x8')](),controller['index']);router['get'](_0x05ca('0x9'),auth['isAuthenticated'](),controller[_0x05ca('0xa')]);router[_0x05ca('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0x05ca('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3bf7d7,_0x140ffb,_0x1b50eb){_0x1b50eb(null,path['join'](config['root'],_0x05ca('0xd')));},'filename':function(_0x2047b5,_0x2b9c54,_0x2429b5){_0x2b9c54[_0x05ca('0xe')]=_0x2b9c54[_0x05ca('0xe')][_0x05ca('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2429b5(null,util['format'](_0x05ca('0x10'),path[_0x05ca('0x11')](_0x2b9c54[_0x05ca('0xe')],path[_0x05ca('0x12')](_0x2b9c54[_0x05ca('0xe')])),Date[_0x05ca('0x13')](),path[_0x05ca('0x12')](_0x2b9c54[_0x05ca('0xe')])));}})});router[_0x05ca('0x14')]('/',upload[_0x05ca('0x15')](_0x05ca('0x16')),controller[_0x05ca('0x17')]);router[_0x05ca('0x18')](_0x05ca('0x9'),auth[_0x05ca('0x8')](),controller[_0x05ca('0x19')]);router[_0x05ca('0x1a')](_0x05ca('0x9'),auth[_0x05ca('0x8')](),controller['delete']);module[_0x05ca('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index e9583ea..06a68f7 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 _0x8445=['FLOAT','INTEGER','BIGINT','sequelize','name','STRING'];(function(_0x27d350,_0x58eada){var _0x396a0c=function(_0x23f4fb){while(--_0x23f4fb){_0x27d350['push'](_0x27d350['shift']());}};_0x396a0c(++_0x58eada);}(_0x8445,0x1a7));var _0x5844=function(_0x392284,_0x3c44c6){_0x392284=_0x392284-0x0;var _0x1738c5=_0x8445[_0x392284];return _0x1738c5;};'use strict';var Sequelize=require(_0x5844('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5844('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x5844('0x2')]},'display_name':{'type':Sequelize[_0x5844('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x5844('0x2')]},'original_format':{'type':Sequelize[_0x5844('0x2')]},'original_duration':{'type':Sequelize[_0x5844('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x5844('0x4')]},'original_bitRate':{'type':Sequelize[_0x5844('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x5844('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x5844('0x4')]},'converted_bitRate':{'type':Sequelize[_0x5844('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x50d0=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x50d0,0x101));var _0x050d=function(_0x32afa0,_0x5d1041){_0x32afa0=_0x32afa0-0x0;var _0x1b7c19=_0x50d0[_0x32afa0];return _0x1b7c19;};'use strict';var Sequelize=require(_0x050d('0x0'));module['exports']={'name':{'type':Sequelize[_0x050d('0x1')],'unique':_0x050d('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x050d('0x1')]},'display_name':{'type':Sequelize[_0x050d('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x050d('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x050d('0x3')]},'original_sampleCount':{'type':Sequelize[_0x050d('0x4')]},'original_channelCount':{'type':Sequelize[_0x050d('0x5')]},'original_bitRate':{'type':Sequelize[_0x050d('0x4')]},'original_sampleRate':{'type':Sequelize[_0x050d('0x5')]},'converted_format':{'type':Sequelize[_0x050d('0x1')]},'converted_duration':{'type':Sequelize[_0x050d('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x050d('0x4')]},'converted_channelCount':{'type':Sequelize[_0x050d('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x050d('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 9f5fb11..fb3938d 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 _0x5581=['nolimit','pick','filter','merge','where','VIRTUAL','options','includeAll','Sound','findAll','catch','show','params','download','find','save_name','converted_format','join','root','server/files/sounds/converted','%s.%s','format','create','basename','file','originalname','extname','filename','substring','wav','info','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','chmodSync','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','server/files/sounds/original','original_format','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','sendStatus','error','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2f6881,_0x4a308f){var _0x1b7e86=function(_0x398a8d){while(--_0x398a8d){_0x2f6881['push'](_0x2f6881['shift']());}};_0x1b7e86(++_0x4a308f);}(_0x5581,0xb4));var _0x1558=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x5581[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x1558('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1558('0x1'));var jsonpatch=require(_0x1558('0x2'));var rp=require('request-promise');var moment=require(_0x1558('0x3'));var BPromise=require(_0x1558('0x4'));var Mustache=require(_0x1558('0x5'));var util=require(_0x1558('0x6'));var path=require(_0x1558('0x7'));var sox=require('sox');var csv=require(_0x1558('0x8'));var ejs=require(_0x1558('0x9'));var fs=require('fs');var fs_extra=require(_0x1558('0xa'));var _=require('lodash');var squel=require(_0x1558('0xb'));var crypto=require(_0x1558('0xc'));var jsforce=require(_0x1558('0xd'));var deskjs=require(_0x1558('0xe'));var toCsv=require(_0x1558('0x8'));var querystring=require(_0x1558('0xf'));var Papa=require(_0x1558('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1558('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1558('0x12'))(_0x1558('0x13'));var utils=require('../../config/utils');var config=require(_0x1558('0x14'));var licenseUtil=require(_0x1558('0x15'));var db=require(_0x1558('0x16'))['db'];function respondWithStatusCode(_0x175658,_0x28445a){_0x28445a=_0x28445a||0xcc;return function(_0x5cd301){if(_0x5cd301){return _0x175658['sendStatus'](_0x28445a);}return _0x175658[_0x1558('0x17')](_0x28445a)[_0x1558('0x18')]();};}function respondWithResult(_0x307c91,_0x42fa6b){_0x42fa6b=_0x42fa6b||0xc8;return function(_0x5c297d){if(_0x5c297d){return _0x307c91[_0x1558('0x17')](_0x42fa6b)[_0x1558('0x19')](_0x5c297d);}};}function respondWithFilteredResult(_0x49e634,_0x4309ee){return function(_0x4e4998){if(_0x4e4998){var _0x118aad=typeof _0x4309ee[_0x1558('0x1a')]===_0x1558('0x1b')&&typeof _0x4309ee['limit']==='undefined';var _0x5a12ca=_0x4e4998[_0x1558('0x1c')];var _0x509500=_0x118aad?0x0:_0x4309ee[_0x1558('0x1a')];var _0x32bb43=_0x118aad?_0x4e4998[_0x1558('0x1c')]:_0x4309ee['offset']+_0x4309ee[_0x1558('0x1d')];var _0x4d0e39;if(_0x32bb43>=_0x5a12ca){_0x32bb43=_0x5a12ca;_0x4d0e39=0xc8;}else{_0x4d0e39=0xce;}_0x49e634[_0x1558('0x17')](_0x4d0e39);return _0x49e634[_0x1558('0x1e')](_0x1558('0x1f'),_0x509500+'-'+_0x32bb43+'/'+_0x5a12ca)[_0x1558('0x19')](_0x4e4998);}return null;};}function patchUpdates(_0xb7e1a0){return function(_0x1c18d5){try{jsonpatch[_0x1558('0x20')](_0x1c18d5,_0xb7e1a0,!![]);}catch(_0x191f08){return BPromise[_0x1558('0x21')](_0x191f08);}return _0x1c18d5[_0x1558('0x22')]();};}function saveUpdates(_0x4561bb,_0x6f1689){return function(_0x43286a){if(_0x43286a){return _0x43286a[_0x1558('0x23')](_0x4561bb)[_0x1558('0x24')](function(_0x4f649b){return _0x4f649b;});}return null;};}function removeEntity(_0x14e123,_0x30e10f){return function(_0x505d8d){if(_0x505d8d){return _0x505d8d[_0x1558('0x25')]()[_0x1558('0x24')](function(){var _0x5d84a8=_0x505d8d[_0x1558('0x26')]({'plain':!![]});var _0x4a214e=_0x1558('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x4a214e,'resourceId':_0x5d84a8['id']}})[_0x1558('0x24')](function(){return _0x505d8d;});})[_0x1558('0x24')](function(){_0x14e123[_0x1558('0x17')](0xcc)[_0x1558('0x18')]();});}};}function handleEntityNotFound(_0x211a06,_0x16e7a1){return function(_0x36f6d7){if(!_0x36f6d7){_0x211a06[_0x1558('0x28')](0x194);}return _0x36f6d7;};}function handleError(_0x5455ec,_0x3e662c){_0x3e662c=_0x3e662c||0x1f4;return function(_0x1fb7b7){logger[_0x1558('0x29')](_0x1fb7b7[_0x1558('0x2a')]);if(_0x1fb7b7[_0x1558('0x2b')]){delete _0x1fb7b7['name'];}_0x5455ec['status'](_0x3e662c)[_0x1558('0x2c')](_0x1fb7b7);};}exports['index']=function(_0x317712,_0x68bad5){var _0x1b9617={},_0x2939ae={},_0x293106={'count':0x0,'rows':[]};var _0x492c47=_[_0x1558('0x2d')](db['Sound']['rawAttributes'],function(_0x5954f1){return{'name':_0x5954f1[_0x1558('0x2e')],'type':_0x5954f1['type'][_0x1558('0x2f')]};});_0x2939ae[_0x1558('0x30')]=_['map'](_0x492c47,_0x1558('0x2b'));_0x2939ae[_0x1558('0x31')]=_[_0x1558('0x32')](_0x317712['query']);_0x2939ae[_0x1558('0x33')]=_[_0x1558('0x34')](_0x2939ae[_0x1558('0x30')],_0x2939ae[_0x1558('0x31')]);_0x1b9617[_0x1558('0x35')]=_['intersection'](_0x2939ae[_0x1558('0x30')],qs[_0x1558('0x36')](_0x317712[_0x1558('0x31')][_0x1558('0x36')]));_0x1b9617[_0x1558('0x35')]=_0x1b9617['attributes'][_0x1558('0x37')]?_0x1b9617[_0x1558('0x35')]:_0x2939ae[_0x1558('0x30')];if(!_0x317712[_0x1558('0x31')]['hasOwnProperty'](_0x1558('0x38'))){_0x1b9617[_0x1558('0x1d')]=qs[_0x1558('0x1d')](_0x317712[_0x1558('0x31')]['limit']);_0x1b9617[_0x1558('0x1a')]=qs['offset'](_0x317712['query'][_0x1558('0x1a')]);}_0x1b9617['order']=qs['sort'](_0x317712['query']['sort']);_0x1b9617['where']=qs['filters'](_[_0x1558('0x39')](_0x317712[_0x1558('0x31')],_0x2939ae[_0x1558('0x33')]),_0x492c47);if(_0x317712[_0x1558('0x31')][_0x1558('0x3a')]){_0x1b9617['where']=_[_0x1558('0x3b')](_0x1b9617[_0x1558('0x3c')],{'$or':_[_0x1558('0x2d')](_0x492c47,function(_0x1f4414){if(_0x1f4414['type']!==_0x1558('0x3d')){var _0x35fd={};_0x35fd[_0x1f4414['name']]={'$like':'%'+_0x317712['query']['filter']+'%'};return _0x35fd;}})});}_0x1b9617=_[_0x1558('0x3b')]({},_0x1b9617,_0x317712[_0x1558('0x3e')]);var _0x210330={'where':_0x1b9617['where']};return db['Sound'][_0x1558('0x1c')](_0x210330)[_0x1558('0x24')](function(_0xd3c77f){_0x293106[_0x1558('0x1c')]=_0xd3c77f;if(_0x317712[_0x1558('0x31')][_0x1558('0x3f')]){_0x1b9617['include']=[{'all':!![]}];}return db[_0x1558('0x40')][_0x1558('0x41')](_0x1b9617);})[_0x1558('0x24')](function(_0x7f375b){_0x293106['rows']=_0x7f375b;return _0x293106;})['then'](respondWithFilteredResult(_0x68bad5,_0x1b9617))[_0x1558('0x42')](handleError(_0x68bad5,null));};exports[_0x1558('0x43')]=function(_0x26a4c8,_0x300a6b){var _0x3b4a15={'raw':!![],'where':{'id':_0x26a4c8[_0x1558('0x44')]['id']}},_0x17d01f={};_0x17d01f['model']=_[_0x1558('0x32')](db[_0x1558('0x40')]['rawAttributes']);_0x17d01f[_0x1558('0x31')]=_[_0x1558('0x32')](_0x26a4c8[_0x1558('0x31')]);_0x17d01f['filters']=_[_0x1558('0x34')](_0x17d01f['model'],_0x17d01f[_0x1558('0x31')]);_0x3b4a15[_0x1558('0x35')]=_[_0x1558('0x34')](_0x17d01f[_0x1558('0x30')],qs['fields'](_0x26a4c8[_0x1558('0x31')][_0x1558('0x36')]));_0x3b4a15[_0x1558('0x35')]=_0x3b4a15['attributes'][_0x1558('0x37')]?_0x3b4a15[_0x1558('0x35')]:_0x17d01f[_0x1558('0x30')];if(_0x26a4c8[_0x1558('0x31')][_0x1558('0x3f')]){_0x3b4a15['include']=[{'all':!![]}];}_0x3b4a15=_[_0x1558('0x3b')]({},_0x3b4a15,_0x26a4c8[_0x1558('0x3e')]);return db[_0x1558('0x40')]['find'](_0x3b4a15)[_0x1558('0x24')](handleEntityNotFound(_0x300a6b,null))[_0x1558('0x24')](respondWithResult(_0x300a6b,null))[_0x1558('0x42')](handleError(_0x300a6b,null));};exports[_0x1558('0x45')]=function(_0x14c556,_0x4768cd,_0x2201c0){return db[_0x1558('0x40')][_0x1558('0x46')]({'where':{'id':_0x14c556[_0x1558('0x44')]['id']},'attributes':[_0x1558('0x2b'),_0x1558('0x47'),_0x1558('0x48')],'raw':!![]})[_0x1558('0x24')](handleEntityNotFound(_0x4768cd,null))[_0x1558('0x24')](function(_0x43b670){if(_0x43b670){if(!fs['existsSync'](path[_0x1558('0x49')](config[_0x1558('0x4a')],_0x1558('0x4b'),_0x43b670[_0x1558('0x47')]+'.'+_0x43b670[_0x1558('0x48')]))){throw new db['Sequelize']['ValidationError']('Sound\x20not\x20found');}return _0x4768cd[_0x1558('0x45')](path[_0x1558('0x49')](config[_0x1558('0x4a')],_0x1558('0x4b'),util['format'](_0x1558('0x4c'),_0x43b670[_0x1558('0x47')],_0x43b670[_0x1558('0x48')])),util[_0x1558('0x4d')](_0x1558('0x4c'),_0x43b670[_0x1558('0x2b')],_0x43b670[_0x1558('0x48')]));}return null;})[_0x1558('0x42')](handleError(_0x4768cd,null));};exports[_0x1558('0x4e')]=function(_0x1e1ad1,_0x1816c0,_0x323484){var _0x1b2baa={'name':path[_0x1558('0x4f')](_0x1e1ad1[_0x1558('0x50')][_0x1558('0x51')],path[_0x1558('0x52')](_0x1e1ad1[_0x1558('0x50')][_0x1558('0x51')])),'save_name':path[_0x1558('0x4f')](_0x1e1ad1[_0x1558('0x50')]['filename'],path['extname'](_0x1e1ad1[_0x1558('0x50')][_0x1558('0x53')])),'original_format':path[_0x1558('0x52')](_0x1e1ad1[_0x1558('0x50')][_0x1558('0x51')])[_0x1558('0x54')](0x1),'converted_format':_0x1558('0x55')};var _0x5e8b38=path['join'](config['root'],'server/files/sounds/original',_0x1e1ad1[_0x1558('0x50')][_0x1558('0x53')]);var _0x1360fd=path[_0x1558('0x49')](config[_0x1558('0x4a')],_0x1558('0x4b'),util[_0x1558('0x4d')](_0x1558('0x4c'),path[_0x1558('0x4f')](_0x1e1ad1['file']['filename'],path[_0x1558('0x52')](_0x1e1ad1['file']['filename'])),_0x1b2baa[_0x1558('0x48')]));logger[_0x1558('0x56')]('Sound\x20upload\x20filepath:\x20%s',_0x5e8b38);logger[_0x1558('0x56')](_0x1558('0x57'),_0x1360fd);try{fs['chmodSync'](_0x5e8b38,parseInt(_0x1558('0x58'),0x8));var _0x2d9cd3=sox[_0x1558('0x59')](_0x5e8b38,_0x1360fd,{'sampleRate':0x1f40,'format':_0x1558('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2d9cd3['on'](_0x1558('0x29'),function(_0x4e02af){fs[_0x1558('0x5a')](_0x5e8b38);_0x1816c0[_0x1558('0x17')](0x1f4)[_0x1558('0x2c')](_0x4e02af);});_0x2d9cd3['on'](_0x1558('0x5b'),function(_0x7f266a){_0x1b2baa['original_duration']=isNaN(_0x7f266a[_0x1558('0x5c')])?null:_0x7f266a[_0x1558('0x5c')]*0x3e8;_0x1b2baa[_0x1558('0x5d')]=isNaN(_0x7f266a[_0x1558('0x5e')])?null:_0x7f266a[_0x1558('0x5e')];_0x1b2baa[_0x1558('0x5f')]=isNaN(_0x7f266a['channelCount'])?null:_0x7f266a[_0x1558('0x60')];_0x1b2baa['original_bitRate']=isNaN(_0x7f266a[_0x1558('0x61')])?null:_0x7f266a[_0x1558('0x61')];_0x1b2baa[_0x1558('0x62')]=isNaN(_0x7f266a[_0x1558('0x63')])?null:_0x7f266a[_0x1558('0x63')];});_0x2d9cd3['on'](_0x1558('0x64'),function(_0x3a1144){_0x1b2baa[_0x1558('0x65')]=isNaN(_0x3a1144['duration'])?null:_0x3a1144[_0x1558('0x5c')]*0x3e8;_0x1b2baa[_0x1558('0x66')]=isNaN(_0x3a1144[_0x1558('0x5e')])?null:_0x3a1144[_0x1558('0x5e')];_0x1b2baa[_0x1558('0x67')]=isNaN(_0x3a1144[_0x1558('0x60')])?null:_0x3a1144[_0x1558('0x60')];_0x1b2baa[_0x1558('0x68')]=isNaN(_0x3a1144[_0x1558('0x61')])?null:_0x3a1144[_0x1558('0x61')];_0x1b2baa['converted_sampleRate']=isNaN(_0x3a1144['sampleRate'])?null:_0x3a1144[_0x1558('0x63')];});_0x2d9cd3['on'](_0x1558('0x18'),function(){fs[_0x1558('0x69')](_0x1360fd,parseInt('0777',0x8));return db['Sound']['create'](_0x1b2baa)[_0x1558('0x24')](function(_0x3fae94){var _0x15c46e={'role':_0x1e1ad1['body'][_0x1558('0x6a')],'userProfileId':_0x1e1ad1[_0x1558('0x6b')][_0x1558('0x6c')]};if(!_0x15c46e)throw new Error(_0x1558('0x6d'));if(_0x15c46e[_0x1558('0x6a')]===_0x1558('0x6e')){var _0x2cfdda=_0x3fae94['get']({'plain':!![]});return db[_0x1558('0x6f')]['find']({'where':{'name':_0x1558('0x27'),'userProfileId':_0x15c46e[_0x1558('0x6c')]},'raw':!![]})[_0x1558('0x24')](function(_0x184abd){if(_0x184abd&&_0x184abd['autoAssociation']===0x0){return db[_0x1558('0x70')][_0x1558('0x4e')]({'name':_0x2cfdda['name'],'resourceId':_0x2cfdda['id'],'type':_0x184abd['name'],'sectionId':_0x184abd['id']},{})[_0x1558('0x24')](function(){return _0x3fae94;});}else{return _0x3fae94;}})[_0x1558('0x42')](function(_0x22ddd2){logger[_0x1558('0x29')](_0x1558('0x71'),_0x22ddd2);throw _0x22ddd2;});}return _0x3fae94;})[_0x1558('0x24')](respondWithResult(_0x1816c0,null))[_0x1558('0x42')](handleError(_0x1816c0,null));});_0x2d9cd3['start']();}catch(_0xa3482a){_0x1816c0[_0x1558('0x17')](0x1f4)[_0x1558('0x2c')](_0xa3482a);}};exports[_0x1558('0x23')]=function(_0x500ccd,_0x148f6e,_0x54b9b6){return db[_0x1558('0x40')][_0x1558('0x46')]({'where':{'id':_0x500ccd[_0x1558('0x44')]['id']}})[_0x1558('0x24')](handleEntityNotFound(_0x148f6e,null))['then'](saveUpdates(_[_0x1558('0x39')](_0x500ccd[_0x1558('0x6b')],[_0x1558('0x2b'),_0x1558('0x72')]),null))[_0x1558('0x24')](respondWithResult(_0x148f6e,null))[_0x1558('0x42')](handleError(_0x148f6e,null));};exports[_0x1558('0x73')]=function(_0x51c24d,_0x259133,_0x2ecfad){return db[_0x1558('0x40')][_0x1558('0x46')]({'where':{'id':_0x51c24d['params']['id']}})[_0x1558('0x24')](function(_0x358311){if(_0x358311){return _0x358311[_0x1558('0x25')]();}})['then'](function(_0x99e26b){var _0x5b1af0=path[_0x1558('0x49')](config[_0x1558('0x4a')],_0x1558('0x74'),util[_0x1558('0x4d')]('%s.%s',_0x99e26b[_0x1558('0x47')],_0x99e26b[_0x1558('0x75')]));var _0x3c4679=path['join'](config[_0x1558('0x4a')],_0x1558('0x4b'),util['format'](_0x1558('0x4c'),_0x99e26b[_0x1558('0x47')],_0x99e26b['converted_format']));fs[_0x1558('0x5a')](_0x5b1af0);fs['unlinkSync'](_0x3c4679);return _0x99e26b;})[_0x1558('0x24')](function(_0xb9ae96){if(_0xb9ae96){return _0x259133[_0x1558('0x17')](0xcc)[_0x1558('0x18')]();}})[_0x1558('0x24')](handleEntityNotFound(_0x259133,null))['catch'](handleError(_0x259133,null));}; \ No newline at end of file +var _0x438b=['set','Content-Range','json','apply','reject','save','update','then','get','Sounds','UserProfileResource','destroy','error','name','send','index','map','Sound','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','start','delete','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count'];(function(_0x3051d9,_0x3de423){var _0xcc0a87=function(_0x588cee){while(--_0x588cee){_0x3051d9['push'](_0x3051d9['shift']());}};_0xcc0a87(++_0x3de423);}(_0x438b,0xe4));var _0xb438=function(_0x183e3f,_0x2380da){_0x183e3f=_0x183e3f-0x0;var _0x4da0e1=_0x438b[_0x183e3f];return _0x4da0e1;};'use strict';var emlformat=require(_0xb438('0x0'));var rimraf=require(_0xb438('0x1'));var zipdir=require(_0xb438('0x2'));var jsonpatch=require(_0xb438('0x3'));var rp=require(_0xb438('0x4'));var moment=require(_0xb438('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb438('0x6'));var util=require(_0xb438('0x7'));var path=require('path');var sox=require(_0xb438('0x8'));var csv=require(_0xb438('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb438('0xa'));var _=require(_0xb438('0xb'));var squel=require(_0xb438('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb438('0xd'));var toCsv=require(_0xb438('0x9'));var querystring=require('querystring');var Papa=require(_0xb438('0xe'));var Redis=require(_0xb438('0xf'));var authService=require(_0xb438('0x10'));var qs=require(_0xb438('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb438('0x12'));var logger=require(_0xb438('0x13'))(_0xb438('0x14'));var utils=require(_0xb438('0x15'));var config=require(_0xb438('0x16'));var licenseUtil=require(_0xb438('0x17'));var db=require(_0xb438('0x18'))['db'];function respondWithStatusCode(_0x2fcf6f,_0x10784e){_0x10784e=_0x10784e||0xcc;return function(_0xc8c4c2){if(_0xc8c4c2){return _0x2fcf6f[_0xb438('0x19')](_0x10784e);}return _0x2fcf6f[_0xb438('0x1a')](_0x10784e)[_0xb438('0x1b')]();};}function respondWithResult(_0x105784,_0x12708c){_0x12708c=_0x12708c||0xc8;return function(_0x565d07){if(_0x565d07){return _0x105784[_0xb438('0x1a')](_0x12708c)['json'](_0x565d07);}};}function respondWithFilteredResult(_0x4f0208,_0xbd8ae3){return function(_0x39ae33){if(_0x39ae33){var _0x59d77e=typeof _0xbd8ae3[_0xb438('0x1c')]==='undefined'&&typeof _0xbd8ae3[_0xb438('0x1d')]===_0xb438('0x1e');var _0x1d2558=_0x39ae33[_0xb438('0x1f')];var _0x573e56=_0x59d77e?0x0:_0xbd8ae3[_0xb438('0x1c')];var _0x411042=_0x59d77e?_0x39ae33['count']:_0xbd8ae3[_0xb438('0x1c')]+_0xbd8ae3[_0xb438('0x1d')];var _0xe1d4c0;if(_0x411042>=_0x1d2558){_0x411042=_0x1d2558;_0xe1d4c0=0xc8;}else{_0xe1d4c0=0xce;}_0x4f0208['status'](_0xe1d4c0);return _0x4f0208[_0xb438('0x20')](_0xb438('0x21'),_0x573e56+'-'+_0x411042+'/'+_0x1d2558)[_0xb438('0x22')](_0x39ae33);}return null;};}function patchUpdates(_0x5c7e1f){return function(_0x26562f){try{jsonpatch[_0xb438('0x23')](_0x26562f,_0x5c7e1f,!![]);}catch(_0x50e7be){return BPromise[_0xb438('0x24')](_0x50e7be);}return _0x26562f[_0xb438('0x25')]();};}function saveUpdates(_0x3472cb,_0x2c04aa){return function(_0x536f51){if(_0x536f51){return _0x536f51[_0xb438('0x26')](_0x3472cb)[_0xb438('0x27')](function(_0x5f5d0b){return _0x5f5d0b;});}return null;};}function removeEntity(_0x376cd2,_0x1bf34b){return function(_0x395e30){if(_0x395e30){return _0x395e30['destroy']()[_0xb438('0x27')](function(){var _0x533e3e=_0x395e30[_0xb438('0x28')]({'plain':!![]});var _0x13759c=_0xb438('0x29');return db[_0xb438('0x2a')][_0xb438('0x2b')]({'where':{'type':_0x13759c,'resourceId':_0x533e3e['id']}})[_0xb438('0x27')](function(){return _0x395e30;});})[_0xb438('0x27')](function(){_0x376cd2[_0xb438('0x1a')](0xcc)[_0xb438('0x1b')]();});}};}function handleEntityNotFound(_0x48ef55,_0x3519f1){return function(_0x580580){if(!_0x580580){_0x48ef55['sendStatus'](0x194);}return _0x580580;};}function handleError(_0x4c8d35,_0x22e2b7){_0x22e2b7=_0x22e2b7||0x1f4;return function(_0x19df0d){logger[_0xb438('0x2c')](_0x19df0d['stack']);if(_0x19df0d[_0xb438('0x2d')]){delete _0x19df0d[_0xb438('0x2d')];}_0x4c8d35['status'](_0x22e2b7)[_0xb438('0x2e')](_0x19df0d);};}exports[_0xb438('0x2f')]=function(_0x28da69,_0xb2fdde){var _0x13b291={},_0x4d8a2b={},_0x32d5f5={'count':0x0,'rows':[]};var _0x21a4b8=_[_0xb438('0x30')](db[_0xb438('0x31')]['rawAttributes'],function(_0x4beffc){return{'name':_0x4beffc[_0xb438('0x32')],'type':_0x4beffc[_0xb438('0x33')][_0xb438('0x34')]};});_0x4d8a2b[_0xb438('0x35')]=_[_0xb438('0x30')](_0x21a4b8,'name');_0x4d8a2b[_0xb438('0x36')]=_[_0xb438('0x37')](_0x28da69[_0xb438('0x36')]);_0x4d8a2b[_0xb438('0x38')]=_[_0xb438('0x39')](_0x4d8a2b['model'],_0x4d8a2b['query']);_0x13b291['attributes']=_[_0xb438('0x39')](_0x4d8a2b['model'],qs[_0xb438('0x3a')](_0x28da69[_0xb438('0x36')][_0xb438('0x3a')]));_0x13b291[_0xb438('0x3b')]=_0x13b291[_0xb438('0x3b')][_0xb438('0x3c')]?_0x13b291['attributes']:_0x4d8a2b[_0xb438('0x35')];if(!_0x28da69[_0xb438('0x36')][_0xb438('0x3d')](_0xb438('0x3e'))){_0x13b291[_0xb438('0x1d')]=qs[_0xb438('0x1d')](_0x28da69[_0xb438('0x36')]['limit']);_0x13b291[_0xb438('0x1c')]=qs[_0xb438('0x1c')](_0x28da69[_0xb438('0x36')][_0xb438('0x1c')]);}_0x13b291[_0xb438('0x3f')]=qs[_0xb438('0x40')](_0x28da69['query'][_0xb438('0x40')]);_0x13b291[_0xb438('0x41')]=qs['filters'](_[_0xb438('0x42')](_0x28da69[_0xb438('0x36')],_0x4d8a2b[_0xb438('0x38')]),_0x21a4b8);if(_0x28da69[_0xb438('0x36')][_0xb438('0x43')]){_0x13b291['where']=_[_0xb438('0x44')](_0x13b291['where'],{'$or':_['map'](_0x21a4b8,function(_0x19647b){if(_0x19647b[_0xb438('0x33')]!==_0xb438('0x45')){var _0x1253ce={};_0x1253ce[_0x19647b[_0xb438('0x2d')]]={'$like':'%'+_0x28da69[_0xb438('0x36')][_0xb438('0x43')]+'%'};return _0x1253ce;}})});}_0x13b291=_[_0xb438('0x44')]({},_0x13b291,_0x28da69[_0xb438('0x46')]);var _0x72909={'where':_0x13b291[_0xb438('0x41')]};return db['Sound'][_0xb438('0x1f')](_0x72909)[_0xb438('0x27')](function(_0x451b43){_0x32d5f5['count']=_0x451b43;if(_0x28da69[_0xb438('0x36')][_0xb438('0x47')]){_0x13b291['include']=[{'all':!![]}];}return db[_0xb438('0x31')][_0xb438('0x48')](_0x13b291);})['then'](function(_0x48b9f9){_0x32d5f5[_0xb438('0x49')]=_0x48b9f9;return _0x32d5f5;})[_0xb438('0x27')](respondWithFilteredResult(_0xb2fdde,_0x13b291))[_0xb438('0x4a')](handleError(_0xb2fdde,null));};exports[_0xb438('0x4b')]=function(_0x202815,_0x20a42d){var _0x49b511={'raw':!![],'where':{'id':_0x202815[_0xb438('0x4c')]['id']}},_0x5677f5={};_0x5677f5[_0xb438('0x35')]=_[_0xb438('0x37')](db[_0xb438('0x31')][_0xb438('0x4d')]);_0x5677f5[_0xb438('0x36')]=_[_0xb438('0x37')](_0x202815['query']);_0x5677f5[_0xb438('0x38')]=_[_0xb438('0x39')](_0x5677f5[_0xb438('0x35')],_0x5677f5['query']);_0x49b511[_0xb438('0x3b')]=_[_0xb438('0x39')](_0x5677f5['model'],qs['fields'](_0x202815['query'][_0xb438('0x3a')]));_0x49b511[_0xb438('0x3b')]=_0x49b511['attributes']['length']?_0x49b511[_0xb438('0x3b')]:_0x5677f5['model'];if(_0x202815[_0xb438('0x36')]['includeAll']){_0x49b511[_0xb438('0x4e')]=[{'all':!![]}];}_0x49b511=_[_0xb438('0x44')]({},_0x49b511,_0x202815[_0xb438('0x46')]);return db[_0xb438('0x31')][_0xb438('0x4f')](_0x49b511)[_0xb438('0x27')](handleEntityNotFound(_0x20a42d,null))[_0xb438('0x27')](respondWithResult(_0x20a42d,null))[_0xb438('0x4a')](handleError(_0x20a42d,null));};exports[_0xb438('0x50')]=function(_0x4a3b50,_0x4dc6ca,_0x153e28){return db[_0xb438('0x31')][_0xb438('0x4f')]({'where':{'id':_0x4a3b50[_0xb438('0x4c')]['id']},'attributes':[_0xb438('0x2d'),_0xb438('0x51'),'converted_format'],'raw':!![]})[_0xb438('0x27')](handleEntityNotFound(_0x4dc6ca,null))['then'](function(_0x22eb68){if(_0x22eb68){if(!fs[_0xb438('0x52')](path[_0xb438('0x53')](config[_0xb438('0x54')],_0xb438('0x55'),_0x22eb68['save_name']+'.'+_0x22eb68[_0xb438('0x56')]))){throw new db[(_0xb438('0x57'))][(_0xb438('0x58'))](_0xb438('0x59'));}return _0x4dc6ca[_0xb438('0x50')](path[_0xb438('0x53')](config[_0xb438('0x54')],_0xb438('0x55'),util[_0xb438('0x5a')](_0xb438('0x5b'),_0x22eb68[_0xb438('0x51')],_0x22eb68['converted_format'])),util[_0xb438('0x5a')](_0xb438('0x5b'),_0x22eb68[_0xb438('0x2d')],_0x22eb68[_0xb438('0x56')]));}return null;})[_0xb438('0x4a')](handleError(_0x4dc6ca,null));};exports[_0xb438('0x5c')]=function(_0x18448d,_0x7384a9,_0x3587e2){var _0x1926c8={'name':path[_0xb438('0x5d')](_0x18448d[_0xb438('0x5e')][_0xb438('0x5f')],path['extname'](_0x18448d[_0xb438('0x5e')][_0xb438('0x5f')])),'save_name':path[_0xb438('0x5d')](_0x18448d[_0xb438('0x5e')]['filename'],path[_0xb438('0x60')](_0x18448d['file'][_0xb438('0x61')])),'original_format':path['extname'](_0x18448d[_0xb438('0x5e')][_0xb438('0x5f')])[_0xb438('0x62')](0x1),'converted_format':_0xb438('0x63')};var _0xa2a820=path['join'](config[_0xb438('0x54')],_0xb438('0x64'),_0x18448d[_0xb438('0x5e')][_0xb438('0x61')]);var _0x1c6fa6=path[_0xb438('0x53')](config[_0xb438('0x54')],_0xb438('0x55'),util[_0xb438('0x5a')](_0xb438('0x5b'),path[_0xb438('0x5d')](_0x18448d['file'][_0xb438('0x61')],path[_0xb438('0x60')](_0x18448d[_0xb438('0x5e')]['filename'])),_0x1926c8['converted_format']));logger[_0xb438('0x65')](_0xb438('0x66'),_0xa2a820);logger['info'](_0xb438('0x67'),_0x1c6fa6);try{fs[_0xb438('0x68')](_0xa2a820,parseInt('0777',0x8));var _0xfca2ce=sox[_0xb438('0x69')](_0xa2a820,_0x1c6fa6,{'sampleRate':0x1f40,'format':_0xb438('0x63'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xfca2ce['on'](_0xb438('0x2c'),function(_0x30e2a0){fs[_0xb438('0x6a')](_0xa2a820);_0x7384a9[_0xb438('0x1a')](0x1f4)['send'](_0x30e2a0);});_0xfca2ce['on'](_0xb438('0x6b'),function(_0x1a954b){_0x1926c8[_0xb438('0x6c')]=isNaN(_0x1a954b[_0xb438('0x6d')])?null:_0x1a954b['duration']*0x3e8;_0x1926c8['original_sampleCount']=isNaN(_0x1a954b[_0xb438('0x6e')])?null:_0x1a954b['sampleCount'];_0x1926c8[_0xb438('0x6f')]=isNaN(_0x1a954b['channelCount'])?null:_0x1a954b[_0xb438('0x70')];_0x1926c8[_0xb438('0x71')]=isNaN(_0x1a954b['bitRate'])?null:_0x1a954b[_0xb438('0x72')];_0x1926c8[_0xb438('0x73')]=isNaN(_0x1a954b[_0xb438('0x74')])?null:_0x1a954b[_0xb438('0x74')];});_0xfca2ce['on'](_0xb438('0x75'),function(_0x3396b7){_0x1926c8[_0xb438('0x76')]=isNaN(_0x3396b7[_0xb438('0x6d')])?null:_0x3396b7['duration']*0x3e8;_0x1926c8['converted_sampleCount']=isNaN(_0x3396b7['sampleCount'])?null:_0x3396b7['sampleCount'];_0x1926c8[_0xb438('0x77')]=isNaN(_0x3396b7['channelCount'])?null:_0x3396b7['channelCount'];_0x1926c8[_0xb438('0x78')]=isNaN(_0x3396b7[_0xb438('0x72')])?null:_0x3396b7[_0xb438('0x72')];_0x1926c8['converted_sampleRate']=isNaN(_0x3396b7[_0xb438('0x74')])?null:_0x3396b7[_0xb438('0x74')];});_0xfca2ce['on'](_0xb438('0x1b'),function(){fs[_0xb438('0x68')](_0x1c6fa6,parseInt(_0xb438('0x79'),0x8));return db[_0xb438('0x31')]['create'](_0x1926c8)[_0xb438('0x27')](function(_0x1d9797){var _0x13e4e9={'role':_0x18448d[_0xb438('0x7a')][_0xb438('0x7b')],'userProfileId':_0x18448d[_0xb438('0x7a')][_0xb438('0x7c')]};if(!_0x13e4e9)throw new Error(_0xb438('0x7d'));if(_0x13e4e9['role']===_0xb438('0x7e')){var _0x657a45=_0x1d9797[_0xb438('0x28')]({'plain':!![]});return db['UserProfileSection'][_0xb438('0x4f')]({'where':{'name':'Sounds','userProfileId':_0x13e4e9[_0xb438('0x7c')]},'raw':!![]})[_0xb438('0x27')](function(_0x9ad300){if(_0x9ad300&&_0x9ad300[_0xb438('0x7f')]===0x0){return db[_0xb438('0x2a')][_0xb438('0x5c')]({'name':_0x657a45[_0xb438('0x2d')],'resourceId':_0x657a45['id'],'type':_0x9ad300['name'],'sectionId':_0x9ad300['id']},{})['then'](function(){return _0x1d9797;});}else{return _0x1d9797;}})['catch'](function(_0x520df8){logger[_0xb438('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x520df8);throw _0x520df8;});}return _0x1d9797;})[_0xb438('0x27')](respondWithResult(_0x7384a9,null))[_0xb438('0x4a')](handleError(_0x7384a9,null));});_0xfca2ce[_0xb438('0x80')]();}catch(_0x266bf4){_0x7384a9[_0xb438('0x1a')](0x1f4)[_0xb438('0x2e')](_0x266bf4);}};exports[_0xb438('0x26')]=function(_0x11a895,_0x386d26,_0x1aa36d){return db['Sound'][_0xb438('0x4f')]({'where':{'id':_0x11a895[_0xb438('0x4c')]['id']}})[_0xb438('0x27')](handleEntityNotFound(_0x386d26,null))[_0xb438('0x27')](saveUpdates(_[_0xb438('0x42')](_0x11a895[_0xb438('0x7a')],[_0xb438('0x2d'),'description']),null))[_0xb438('0x27')](respondWithResult(_0x386d26,null))[_0xb438('0x4a')](handleError(_0x386d26,null));};exports[_0xb438('0x81')]=function(_0x282fe0,_0x5987e5,_0xa44b87){return db[_0xb438('0x31')][_0xb438('0x4f')]({'where':{'id':_0x282fe0[_0xb438('0x4c')]['id']}})[_0xb438('0x27')](function(_0x23bd55){if(_0x23bd55){return _0x23bd55[_0xb438('0x2b')]();}})[_0xb438('0x27')](function(_0x4ebe31){var _0x4b3c25=path[_0xb438('0x53')](config[_0xb438('0x54')],'server/files/sounds/original',util[_0xb438('0x5a')](_0xb438('0x5b'),_0x4ebe31[_0xb438('0x51')],_0x4ebe31['original_format']));var _0x24ef5e=path[_0xb438('0x53')](config[_0xb438('0x54')],'server/files/sounds/converted',util[_0xb438('0x5a')](_0xb438('0x5b'),_0x4ebe31[_0xb438('0x51')],_0x4ebe31[_0xb438('0x56')]));fs[_0xb438('0x6a')](_0x4b3c25);fs[_0xb438('0x6a')](_0x24ef5e);return _0x4ebe31;})[_0xb438('0x27')](function(_0x25a986){if(_0x25a986){return _0x5987e5[_0xb438('0x1a')](0xcc)['end']();}})[_0xb438('0x27')](handleEntityNotFound(_0x5987e5,null))['catch'](handleError(_0x5987e5,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index d08d04c..1731bbe 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 _0xe57b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','Sound','tools_sounds','util'];(function(_0x307012,_0xbd06b9){var _0x31703e=function(_0x15fce8){while(--_0x15fce8){_0x307012['push'](_0x307012['shift']());}};_0x31703e(++_0xbd06b9);}(_0xe57b,0x11f));var _0xbe57=function(_0x5368a1,_0x493055){_0x5368a1=_0x5368a1-0x0;var _0x326125=_0xe57b[_0x5368a1];return _0x326125;};'use strict';var _=require('lodash');var util=require(_0xbe57('0x0'));var logger=require(_0xbe57('0x1'))(_0xbe57('0x2'));var moment=require(_0xbe57('0x3'));var BPromise=require(_0xbe57('0x4'));var rp=require(_0xbe57('0x5'));var fs=require('fs');var path=require(_0xbe57('0x6'));var rimraf=require(_0xbe57('0x7'));var config=require(_0xbe57('0x8'));var attributes=require(_0xbe57('0x9'));module['exports']=function(_0x5bdc25,_0x4c687b){return _0x5bdc25['define'](_0xbe57('0xa'),attributes,{'tableName':_0xbe57('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe171=['define','Sound','tools_sounds','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports'];(function(_0x53102b,_0xeb1d6e){var _0x4d7fae=function(_0x41efa5){while(--_0x41efa5){_0x53102b['push'](_0x53102b['shift']());}};_0x4d7fae(++_0xeb1d6e);}(_0xe171,0xd3));var _0x1e17=function(_0x1c2552,_0x573b75){_0x1c2552=_0x1c2552-0x0;var _0x2e9c08=_0xe171[_0x1c2552];return _0x2e9c08;};'use strict';var _=require('lodash');var util=require(_0x1e17('0x0'));var logger=require(_0x1e17('0x1'))(_0x1e17('0x2'));var moment=require(_0x1e17('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e17('0x4'));var fs=require('fs');var path=require(_0x1e17('0x5'));var rimraf=require(_0x1e17('0x6'));var config=require(_0x1e17('0x7'));var attributes=require(_0x1e17('0x8'));module[_0x1e17('0x9')]=function(_0x4521a4,_0x507d9b){return _0x4521a4[_0x1e17('0xa')](_0x1e17('0xb'),attributes,{'tableName':_0x1e17('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 3813f3c..7088208 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 _0x1b37=['model','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','map'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1b37,0x16d));var _0x71b3=function(_0x5f0e14,_0x373cbb){_0x5f0e14=_0x5f0e14-0x0;var _0x3ed494=_0x1b37[_0x5f0e14];return _0x3ed494;};'use strict';var _=require(_0x71b3('0x0'));var util=require(_0x71b3('0x1'));var moment=require(_0x71b3('0x2'));var BPromise=require(_0x71b3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71b3('0x4'));var db=require(_0x71b3('0x5'))['db'];var utils=require(_0x71b3('0x6'));var logger=require('../../config/logger')(_0x71b3('0x7'));var config=require(_0x71b3('0x8'));var jayson=require(_0x71b3('0x9'));var client=jayson[_0x71b3('0xa')][_0x71b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x317636,_0x2a958b,_0x302136){return new BPromise(function(_0x490ae4,_0x599192){return client['request'](_0x317636,_0x302136)[_0x71b3('0xc')](function(_0x34e9ed){logger[_0x71b3('0xd')](_0x71b3('0xe'),_0x2a958b,_0x71b3('0xf'));logger[_0x71b3('0x10')](_0x71b3('0x11'),_0x2a958b,_0x71b3('0xf'),JSON[_0x71b3('0x12')](_0x34e9ed));if(_0x34e9ed[_0x71b3('0x13')]){if(_0x34e9ed[_0x71b3('0x13')][_0x71b3('0x14')]===0x1f4){logger[_0x71b3('0x13')](_0x71b3('0xe'),_0x2a958b,_0x34e9ed['error'][_0x71b3('0x15')]);return _0x599192(_0x34e9ed[_0x71b3('0x13')][_0x71b3('0x15')]);}logger[_0x71b3('0x13')](_0x71b3('0xe'),_0x2a958b,_0x34e9ed[_0x71b3('0x13')][_0x71b3('0x15')]);return _0x490ae4(_0x34e9ed[_0x71b3('0x13')][_0x71b3('0x15')]);}else{logger[_0x71b3('0xd')](_0x71b3('0xe'),_0x2a958b,_0x71b3('0xf'));_0x490ae4(_0x34e9ed[_0x71b3('0x16')]['message']);}})[_0x71b3('0x17')](function(_0x1dd464){logger['error'](_0x71b3('0xe'),_0x2a958b,_0x1dd464);_0x599192(_0x1dd464);});});}exports[_0x71b3('0x18')]=function(_0x5c9511){var _0x2e16eb=this;return new Promise(function(_0x1efb81,_0x45c059){return db[_0x71b3('0x19')]['find']({'raw':_0x5c9511[_0x71b3('0x1a')]?_0x5c9511['options'][_0x71b3('0x1b')]===undefined?!![]:![]:!![],'where':_0x5c9511[_0x71b3('0x1a')]?_0x5c9511[_0x71b3('0x1a')][_0x71b3('0x1c')]||null:null,'attributes':_0x5c9511[_0x71b3('0x1a')]?_0x5c9511[_0x71b3('0x1a')]['attributes']||null:null,'include':_0x5c9511[_0x71b3('0x1a')]?_0x5c9511['options'][_0x71b3('0x1d')]?_[_0x71b3('0x1e')](_0x5c9511[_0x71b3('0x1a')][_0x71b3('0x1d')],function(_0x51f4b0){return{'model':db[_0x51f4b0[_0x71b3('0x1f')]],'as':_0x51f4b0['as'],'attributes':_0x51f4b0[_0x71b3('0x20')],'include':_0x51f4b0[_0x71b3('0x1d')]?_[_0x71b3('0x1e')](_0x51f4b0[_0x71b3('0x1d')],function(_0x5a2c92){return{'model':db[_0x5a2c92[_0x71b3('0x1f')]],'as':_0x5a2c92['as'],'attributes':_0x5a2c92[_0x71b3('0x20')],'include':_0x5a2c92[_0x71b3('0x1d')]?_[_0x71b3('0x1e')](_0x5a2c92[_0x71b3('0x1d')],function(_0x11551b){return{'model':db[_0x11551b[_0x71b3('0x1f')]],'as':_0x11551b['as'],'attributes':_0x11551b[_0x71b3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ac1d0){logger[_0x71b3('0xd')]('ShowSound',_0x5c9511);logger[_0x71b3('0x10')](_0x71b3('0x18'),_0x5c9511,JSON[_0x71b3('0x12')](_0x4ac1d0));_0x1efb81(_0x4ac1d0);})['catch'](function(_0x490e1c){logger[_0x71b3('0x13')]('ShowSound',_0x490e1c[_0x71b3('0x15')],_0x5c9511);_0x45c059(_0x2e16eb[_0x71b3('0x13')](0x1f4,_0x490e1c[_0x71b3('0x15')]));});});}; \ No newline at end of file +var _0xae6c=['then','info','Sound,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSound','Sound','options','raw','where','attributes','include','model','map','debug','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2a56ce,_0x448f12){var _0x1f9977=function(_0x1feb57){while(--_0x1feb57){_0x2a56ce['push'](_0x2a56ce['shift']());}};_0x1f9977(++_0x448f12);}(_0xae6c,0x154));var _0xcae6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xae6c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xcae6('0x0'));var moment=require(_0xcae6('0x1'));var BPromise=require(_0xcae6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcae6('0x3'));var db=require(_0xcae6('0x4'))['db'];var utils=require(_0xcae6('0x5'));var logger=require('../../config/logger')(_0xcae6('0x6'));var config=require(_0xcae6('0x7'));var jayson=require(_0xcae6('0x8'));var client=jayson[_0xcae6('0x9')][_0xcae6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46c5cf,_0x1ae411,_0x12c3e9){return new BPromise(function(_0x1d19f2,_0x20c1e2){return client[_0xcae6('0xb')](_0x46c5cf,_0x12c3e9)[_0xcae6('0xc')](function(_0x20f4f5){logger[_0xcae6('0xd')](_0xcae6('0xe'),_0x1ae411,_0xcae6('0xf'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x1ae411,_0xcae6('0xf'),JSON[_0xcae6('0x10')](_0x20f4f5));if(_0x20f4f5[_0xcae6('0x11')]){if(_0x20f4f5[_0xcae6('0x11')][_0xcae6('0x12')]===0x1f4){logger[_0xcae6('0x11')](_0xcae6('0xe'),_0x1ae411,_0x20f4f5[_0xcae6('0x11')][_0xcae6('0x13')]);return _0x20c1e2(_0x20f4f5['error'][_0xcae6('0x13')]);}logger[_0xcae6('0x11')]('Sound,\x20%s,\x20%s',_0x1ae411,_0x20f4f5[_0xcae6('0x11')]['message']);return _0x1d19f2(_0x20f4f5[_0xcae6('0x11')][_0xcae6('0x13')]);}else{logger[_0xcae6('0xd')](_0xcae6('0xe'),_0x1ae411,'request\x20sent');_0x1d19f2(_0x20f4f5[_0xcae6('0x14')][_0xcae6('0x13')]);}})['catch'](function(_0x380ccf){logger['error'](_0xcae6('0xe'),_0x1ae411,_0x380ccf);_0x20c1e2(_0x380ccf);});});}exports[_0xcae6('0x15')]=function(_0x133eb7){var _0x292bd7=this;return new Promise(function(_0x584a99,_0x59d1d6){return db[_0xcae6('0x16')]['find']({'raw':_0x133eb7[_0xcae6('0x17')]?_0x133eb7[_0xcae6('0x17')][_0xcae6('0x18')]===undefined?!![]:![]:!![],'where':_0x133eb7[_0xcae6('0x17')]?_0x133eb7['options'][_0xcae6('0x19')]||null:null,'attributes':_0x133eb7['options']?_0x133eb7[_0xcae6('0x17')][_0xcae6('0x1a')]||null:null,'include':_0x133eb7[_0xcae6('0x17')]?_0x133eb7[_0xcae6('0x17')][_0xcae6('0x1b')]?_['map'](_0x133eb7['options'][_0xcae6('0x1b')],function(_0x1d707d){return{'model':db[_0x1d707d[_0xcae6('0x1c')]],'as':_0x1d707d['as'],'attributes':_0x1d707d[_0xcae6('0x1a')],'include':_0x1d707d[_0xcae6('0x1b')]?_[_0xcae6('0x1d')](_0x1d707d[_0xcae6('0x1b')],function(_0x43fd9b){return{'model':db[_0x43fd9b[_0xcae6('0x1c')]],'as':_0x43fd9b['as'],'attributes':_0x43fd9b[_0xcae6('0x1a')],'include':_0x43fd9b['include']?_[_0xcae6('0x1d')](_0x43fd9b[_0xcae6('0x1b')],function(_0x33a6d9){return{'model':db[_0x33a6d9[_0xcae6('0x1c')]],'as':_0x33a6d9['as'],'attributes':_0x33a6d9[_0xcae6('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ebe87){logger[_0xcae6('0xd')](_0xcae6('0x15'),_0x133eb7);logger[_0xcae6('0x1e')]('ShowSound',_0x133eb7,JSON[_0xcae6('0x10')](_0x4ebe87));_0x584a99(_0x4ebe87);})[_0xcae6('0x1f')](function(_0x23c248){logger[_0xcae6('0x11')](_0xcae6('0x15'),_0x23c248[_0xcae6('0x13')],_0x133eb7);_0x59d1d6(_0x292bd7[_0xcae6('0x11')](0x1f4,_0x23c248[_0xcae6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index a9f62ae..e9d5a32 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 _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x5a852b,_0x1694c2){var _0xd74d84=function(_0x170a6d){while(--_0x170a6d){_0x5a852b['push'](_0x5a852b['shift']());}};_0xd74d84(++_0x1694c2);}(_0x5eb8,0xb0));var _0x85eb=function(_0x257a28,_0x2cd00d){_0x257a28=_0x257a28-0x0;var _0x13bccc=_0x5eb8[_0x257a28];return _0x13bccc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file +var _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x253761,_0x314fc3){var _0x1f6202=function(_0x3d3f6c){while(--_0x3d3f6c){_0x253761['push'](_0x253761['shift']());}};_0x1f6202(++_0x314fc3);}(_0x5eb8,0xb0));var _0x85eb=function(_0x335a62,_0xfafea4){_0x335a62=_0x335a62-0x0;var _0x249a9a=_0x5eb8[_0x335a62];return _0x249a9a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('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 b4a5c31..fa20c69 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 _0x4667=['medium','ENUM','out','sequelize','STRING','TEXT'];(function(_0x5671c6,_0x3a0619){var _0x4e86c8=function(_0x109ce7){while(--_0x109ce7){_0x5671c6['push'](_0x5671c6['shift']());}};_0x4e86c8(++_0x3a0619);}(_0x4667,0x13b));var _0x7466=function(_0x1b6617,_0x312ff5){_0x1b6617=_0x1b6617-0x0;var _0x5d02d1=_0x4667[_0x1b6617];return _0x5d02d1;};'use strict';var Sequelize=require(_0x7466('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7466('0x1')]},'body':{'type':Sequelize[_0x7466('0x2')](_0x7466('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x7466('0x4')]('in',_0x7466('0x5')),'defaultValue':_0x7466('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x7466('0x2')]}}; \ No newline at end of file +var _0x4249=['ENUM','out','sequelize','exports','STRING','TEXT','medium'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x4249,0x1c2));var _0x9424=function(_0x2fdbbb,_0xd2977b){_0x2fdbbb=_0x2fdbbb-0x0;var _0x47664f=_0x4249[_0x2fdbbb];return _0x47664f;};'use strict';var Sequelize=require(_0x9424('0x0'));module[_0x9424('0x1')]={'uniqueid':{'type':Sequelize[_0x9424('0x2')]},'body':{'type':Sequelize[_0x9424('0x3')](_0x9424('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x9424('0x5')]('in',_0x9424('0x6')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9424('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index a761671..5074fcf 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 _0x1aab=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','query','keys','filters','model','fields','attributes','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis'];(function(_0x45595c,_0x35641d){var _0x37c5c3=function(_0x3948df){while(--_0x3948df){_0x45595c['push'](_0x45595c['shift']());}};_0x37c5c3(++_0x35641d);}(_0x1aab,0x122));var _0xb1aa=function(_0x50c108,_0x463625){_0x50c108=_0x50c108-0x0;var _0x1570c5=_0x1aab[_0x50c108];return _0x1570c5;};'use strict';var emlformat=require(_0xb1aa('0x0'));var rimraf=require(_0xb1aa('0x1'));var zipdir=require(_0xb1aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1aa('0x3'));var moment=require('moment');var BPromise=require(_0xb1aa('0x4'));var Mustache=require(_0xb1aa('0x5'));var util=require(_0xb1aa('0x6'));var path=require(_0xb1aa('0x7'));var sox=require(_0xb1aa('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1aa('0x9'));var _=require(_0xb1aa('0xa'));var squel=require(_0xb1aa('0xb'));var crypto=require(_0xb1aa('0xc'));var jsforce=require(_0xb1aa('0xd'));var deskjs=require(_0xb1aa('0xe'));var toCsv=require(_0xb1aa('0xf'));var querystring=require('querystring');var Papa=require(_0xb1aa('0x10'));var Redis=require(_0xb1aa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb1aa('0x12'));var as=require(_0xb1aa('0x13'));var hardwareService=require(_0xb1aa('0x14'));var logger=require(_0xb1aa('0x15'))(_0xb1aa('0x16'));var utils=require(_0xb1aa('0x17'));var config=require(_0xb1aa('0x18'));var licenseUtil=require(_0xb1aa('0x19'));var db=require(_0xb1aa('0x1a'))['db'];function respondWithStatusCode(_0x330c54,_0x46d422){_0x46d422=_0x46d422||0xcc;return function(_0x419c79){if(_0x419c79){return _0x330c54[_0xb1aa('0x1b')](_0x46d422);}return _0x330c54[_0xb1aa('0x1c')](_0x46d422)[_0xb1aa('0x1d')]();};}function respondWithResult(_0x48543b,_0x4d9ad5){_0x4d9ad5=_0x4d9ad5||0xc8;return function(_0xc75972){if(_0xc75972){return _0x48543b['status'](_0x4d9ad5)[_0xb1aa('0x1e')](_0xc75972);}};}function respondWithFilteredResult(_0x47bdde,_0x7a3b6a){return function(_0x49bf6b){if(_0x49bf6b){var _0x24b12d=typeof _0x7a3b6a['offset']===_0xb1aa('0x1f')&&typeof _0x7a3b6a[_0xb1aa('0x20')]==='undefined';var _0x2531f2=_0x49bf6b[_0xb1aa('0x21')];var _0x1d1450=_0x24b12d?0x0:_0x7a3b6a[_0xb1aa('0x22')];var _0x2c67f3=_0x24b12d?_0x49bf6b[_0xb1aa('0x21')]:_0x7a3b6a[_0xb1aa('0x22')]+_0x7a3b6a[_0xb1aa('0x20')];var _0x36dc82;if(_0x2c67f3>=_0x2531f2){_0x2c67f3=_0x2531f2;_0x36dc82=0xc8;}else{_0x36dc82=0xce;}_0x47bdde[_0xb1aa('0x1c')](_0x36dc82);return _0x47bdde[_0xb1aa('0x23')](_0xb1aa('0x24'),_0x1d1450+'-'+_0x2c67f3+'/'+_0x2531f2)[_0xb1aa('0x1e')](_0x49bf6b);}return null;};}function patchUpdates(_0x5ca191){return function(_0x5a3ec5){try{jsonpatch[_0xb1aa('0x25')](_0x5a3ec5,_0x5ca191,!![]);}catch(_0x2e6725){return BPromise[_0xb1aa('0x26')](_0x2e6725);}return _0x5a3ec5[_0xb1aa('0x27')]();};}function saveUpdates(_0x5b9a93,_0x465630){return function(_0x143e99){if(_0x143e99){return _0x143e99['update'](_0x5b9a93)[_0xb1aa('0x28')](function(_0x17298c){return _0x17298c;});}return null;};}function removeEntity(_0x2be697,_0x5f2aa7){return function(_0x5bb543){if(_0x5bb543){return _0x5bb543[_0xb1aa('0x29')]()[_0xb1aa('0x28')](function(){_0x2be697[_0xb1aa('0x1c')](0xcc)[_0xb1aa('0x1d')]();});}};}function handleEntityNotFound(_0x3a9c9e,_0x2f1db9){return function(_0x26ec21){if(!_0x26ec21){_0x3a9c9e[_0xb1aa('0x1b')](0x194);}return _0x26ec21;};}function handleError(_0x1ba189,_0x470705){_0x470705=_0x470705||0x1f4;return function(_0x1cd714){logger[_0xb1aa('0x2a')](_0x1cd714[_0xb1aa('0x2b')]);if(_0x1cd714[_0xb1aa('0x2c')]){delete _0x1cd714[_0xb1aa('0x2c')];}_0x1ba189['status'](_0x470705)[_0xb1aa('0x2d')](_0x1cd714);};}exports[_0xb1aa('0x2e')]=function(_0x3c1b92,_0x13f92d){var _0x4b2c43={},_0xa4a319={},_0x44ac69={'count':0x0,'rows':[]};var _0x5b2cde=_[_0xb1aa('0x2f')](db[_0xb1aa('0x30')][_0xb1aa('0x31')],function(_0x505542){return{'name':_0x505542[_0xb1aa('0x32')],'type':_0x505542[_0xb1aa('0x33')]['key']};});_0xa4a319['model']=_[_0xb1aa('0x2f')](_0x5b2cde,_0xb1aa('0x2c'));_0xa4a319[_0xb1aa('0x34')]=_[_0xb1aa('0x35')](_0x3c1b92[_0xb1aa('0x34')]);_0xa4a319[_0xb1aa('0x36')]=_['intersection'](_0xa4a319[_0xb1aa('0x37')],_0xa4a319['query']);_0x4b2c43['attributes']=_['intersection'](_0xa4a319[_0xb1aa('0x37')],qs[_0xb1aa('0x38')](_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x38')]));_0x4b2c43[_0xb1aa('0x39')]=_0x4b2c43['attributes'][_0xb1aa('0x3a')]?_0x4b2c43[_0xb1aa('0x39')]:_0xa4a319[_0xb1aa('0x37')];if(!_0x3c1b92['query']['hasOwnProperty']('nolimit')){_0x4b2c43[_0xb1aa('0x20')]=qs[_0xb1aa('0x20')](_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x20')]);_0x4b2c43['offset']=qs[_0xb1aa('0x22')](_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x22')]);}_0x4b2c43[_0xb1aa('0x3b')]=qs['sort'](_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x3c')]);_0x4b2c43[_0xb1aa('0x3d')]=qs['filters'](_[_0xb1aa('0x3e')](_0x3c1b92[_0xb1aa('0x34')],_0xa4a319[_0xb1aa('0x36')]),_0x5b2cde);if(_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x3f')]){_0x4b2c43[_0xb1aa('0x3d')]=_[_0xb1aa('0x40')](_0x4b2c43[_0xb1aa('0x3d')],{'$or':_[_0xb1aa('0x2f')](_0x5b2cde,function(_0x5069c6){if(_0x5069c6[_0xb1aa('0x33')]!=='VIRTUAL'){var _0xa79749={};_0xa79749[_0x5069c6[_0xb1aa('0x2c')]]={'$like':'%'+_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x3f')]+'%'};return _0xa79749;}})});}_0x4b2c43=_['merge']({},_0x4b2c43,_0x3c1b92[_0xb1aa('0x41')]);var _0x125f45={'where':_0x4b2c43[_0xb1aa('0x3d')]};return db['SquareMessage'][_0xb1aa('0x21')](_0x125f45)[_0xb1aa('0x28')](function(_0x56cb5b){_0x44ac69['count']=_0x56cb5b;if(_0x3c1b92['query'][_0xb1aa('0x42')]){_0x4b2c43[_0xb1aa('0x43')]=[{'all':!![]}];}return db[_0xb1aa('0x30')][_0xb1aa('0x44')](_0x4b2c43);})['then'](function(_0xcf3f4f){_0x44ac69[_0xb1aa('0x45')]=_0xcf3f4f;return _0x44ac69;})[_0xb1aa('0x28')](respondWithFilteredResult(_0x13f92d,_0x4b2c43))[_0xb1aa('0x46')](handleError(_0x13f92d,null));};exports[_0xb1aa('0x47')]=function(_0x581ca5,_0x25da68){var _0x1f2817={'raw':!![],'where':{'id':_0x581ca5[_0xb1aa('0x48')]['id']}},_0xe5be48={};_0xe5be48[_0xb1aa('0x37')]=_[_0xb1aa('0x35')](db[_0xb1aa('0x30')][_0xb1aa('0x31')]);_0xe5be48['query']=_[_0xb1aa('0x35')](_0x581ca5[_0xb1aa('0x34')]);_0xe5be48['filters']=_[_0xb1aa('0x49')](_0xe5be48[_0xb1aa('0x37')],_0xe5be48[_0xb1aa('0x34')]);_0x1f2817[_0xb1aa('0x39')]=_['intersection'](_0xe5be48['model'],qs[_0xb1aa('0x38')](_0x581ca5[_0xb1aa('0x34')]['fields']));_0x1f2817[_0xb1aa('0x39')]=_0x1f2817[_0xb1aa('0x39')][_0xb1aa('0x3a')]?_0x1f2817['attributes']:_0xe5be48[_0xb1aa('0x37')];if(_0x581ca5[_0xb1aa('0x34')]['includeAll']){_0x1f2817['include']=[{'all':!![]}];}_0x1f2817=_[_0xb1aa('0x40')]({},_0x1f2817,_0x581ca5[_0xb1aa('0x41')]);return db[_0xb1aa('0x30')]['find'](_0x1f2817)[_0xb1aa('0x28')](handleEntityNotFound(_0x25da68,null))[_0xb1aa('0x28')](respondWithResult(_0x25da68,null))[_0xb1aa('0x46')](handleError(_0x25da68,null));};exports[_0xb1aa('0x4a')]=function(_0x12baec,_0x54d7c1){return db[_0xb1aa('0x30')][_0xb1aa('0x4a')](_0x12baec[_0xb1aa('0x4b')],{})[_0xb1aa('0x28')](respondWithResult(_0x54d7c1,0xc9))['catch'](handleError(_0x54d7c1,null));};exports['update']=function(_0x213ab2,_0xfd9d9e){if(_0x213ab2['body']['id']){delete _0x213ab2[_0xb1aa('0x4b')]['id'];}return db[_0xb1aa('0x30')][_0xb1aa('0x4c')]({'where':{'id':_0x213ab2['params']['id']}})[_0xb1aa('0x28')](handleEntityNotFound(_0xfd9d9e,null))[_0xb1aa('0x28')](saveUpdates(_0x213ab2[_0xb1aa('0x4b')],null))[_0xb1aa('0x28')](respondWithResult(_0xfd9d9e,null))[_0xb1aa('0x46')](handleError(_0xfd9d9e,null));};exports[_0xb1aa('0x29')]=function(_0x764e3a,_0x278a56){return db[_0xb1aa('0x30')]['find']({'where':{'id':_0x764e3a['params']['id']}})[_0xb1aa('0x28')](handleEntityNotFound(_0x278a56,null))[_0xb1aa('0x28')](removeEntity(_0x278a56,null))[_0xb1aa('0x46')](handleError(_0x278a56,null));}; \ No newline at end of file +var _0xbd9f=['filters','filter','merge','VIRTUAL','options','SquareMessage','includeAll','include','findAll','rows','show','find','catch','create','body','params','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','where'];(function(_0x11c6cd,_0x54ed63){var _0x2c7387=function(_0xda038d){while(--_0xda038d){_0x11c6cd['push'](_0x11c6cd['shift']());}};_0x2c7387(++_0x54ed63);}(_0xbd9f,0x98));var _0xfbd9=function(_0x3b469e,_0x5ac045){_0x3b469e=_0x3b469e-0x0;var _0x597136=_0xbd9f[_0x3b469e];return _0x597136;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfbd9('0x0'));var rp=require('request-promise');var moment=require(_0xfbd9('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xfbd9('0x2'));var util=require('util');var path=require(_0xfbd9('0x3'));var sox=require(_0xfbd9('0x4'));var csv=require(_0xfbd9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfbd9('0x6'));var _=require('lodash');var squel=require(_0xfbd9('0x7'));var crypto=require(_0xfbd9('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xfbd9('0x9'));var toCsv=require(_0xfbd9('0x5'));var querystring=require(_0xfbd9('0xa'));var Papa=require('papaparse');var Redis=require(_0xfbd9('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xfbd9('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbd9('0xd'));var logger=require(_0xfbd9('0xe'))('api');var utils=require(_0xfbd9('0xf'));var config=require(_0xfbd9('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xfbd9('0x11'))['db'];function respondWithStatusCode(_0x301770,_0x1a4a0e){_0x1a4a0e=_0x1a4a0e||0xcc;return function(_0x527707){if(_0x527707){return _0x301770[_0xfbd9('0x12')](_0x1a4a0e);}return _0x301770['status'](_0x1a4a0e)['end']();};}function respondWithResult(_0x36113b,_0x35adb1){_0x35adb1=_0x35adb1||0xc8;return function(_0x159743){if(_0x159743){return _0x36113b[_0xfbd9('0x13')](_0x35adb1)['json'](_0x159743);}};}function respondWithFilteredResult(_0x2fef54,_0x9f8390){return function(_0x2b9553){if(_0x2b9553){var _0x58d553=typeof _0x9f8390[_0xfbd9('0x14')]===_0xfbd9('0x15')&&typeof _0x9f8390['limit']===_0xfbd9('0x15');var _0x516dcf=_0x2b9553[_0xfbd9('0x16')];var _0x13918f=_0x58d553?0x0:_0x9f8390['offset'];var _0x3ed394=_0x58d553?_0x2b9553[_0xfbd9('0x16')]:_0x9f8390[_0xfbd9('0x14')]+_0x9f8390[_0xfbd9('0x17')];var _0x35bf78;if(_0x3ed394>=_0x516dcf){_0x3ed394=_0x516dcf;_0x35bf78=0xc8;}else{_0x35bf78=0xce;}_0x2fef54[_0xfbd9('0x13')](_0x35bf78);return _0x2fef54[_0xfbd9('0x18')](_0xfbd9('0x19'),_0x13918f+'-'+_0x3ed394+'/'+_0x516dcf)[_0xfbd9('0x1a')](_0x2b9553);}return null;};}function patchUpdates(_0x1b1eea){return function(_0x2d2c6e){try{jsonpatch[_0xfbd9('0x1b')](_0x2d2c6e,_0x1b1eea,!![]);}catch(_0x2fc10b){return BPromise[_0xfbd9('0x1c')](_0x2fc10b);}return _0x2d2c6e[_0xfbd9('0x1d')]();};}function saveUpdates(_0x32f9bb,_0x12140b){return function(_0x4d3020){if(_0x4d3020){return _0x4d3020[_0xfbd9('0x1e')](_0x32f9bb)[_0xfbd9('0x1f')](function(_0x175373){return _0x175373;});}return null;};}function removeEntity(_0x299dd2,_0x237313){return function(_0x39da76){if(_0x39da76){return _0x39da76[_0xfbd9('0x20')]()[_0xfbd9('0x1f')](function(){_0x299dd2[_0xfbd9('0x13')](0xcc)[_0xfbd9('0x21')]();});}};}function handleEntityNotFound(_0x1b0cc5,_0x4deb2e){return function(_0x1de422){if(!_0x1de422){_0x1b0cc5[_0xfbd9('0x12')](0x194);}return _0x1de422;};}function handleError(_0x33be84,_0x5c8857){_0x5c8857=_0x5c8857||0x1f4;return function(_0x4f2368){logger[_0xfbd9('0x22')](_0x4f2368['stack']);if(_0x4f2368[_0xfbd9('0x23')]){delete _0x4f2368['name'];}_0x33be84['status'](_0x5c8857)[_0xfbd9('0x24')](_0x4f2368);};}exports['index']=function(_0x303257,_0x1c920d){var _0xb06e9={},_0x3ad635={},_0x12f42a={'count':0x0,'rows':[]};var _0x3a8d39=_[_0xfbd9('0x25')](db['SquareMessage'][_0xfbd9('0x26')],function(_0x179b8e){return{'name':_0x179b8e[_0xfbd9('0x27')],'type':_0x179b8e[_0xfbd9('0x28')][_0xfbd9('0x29')]};});_0x3ad635[_0xfbd9('0x2a')]=_[_0xfbd9('0x25')](_0x3a8d39,_0xfbd9('0x23'));_0x3ad635[_0xfbd9('0x2b')]=_[_0xfbd9('0x2c')](_0x303257['query']);_0x3ad635['filters']=_[_0xfbd9('0x2d')](_0x3ad635[_0xfbd9('0x2a')],_0x3ad635[_0xfbd9('0x2b')]);_0xb06e9[_0xfbd9('0x2e')]=_[_0xfbd9('0x2d')](_0x3ad635['model'],qs[_0xfbd9('0x2f')](_0x303257[_0xfbd9('0x2b')][_0xfbd9('0x2f')]));_0xb06e9[_0xfbd9('0x2e')]=_0xb06e9[_0xfbd9('0x2e')][_0xfbd9('0x30')]?_0xb06e9[_0xfbd9('0x2e')]:_0x3ad635[_0xfbd9('0x2a')];if(!_0x303257['query'][_0xfbd9('0x31')]('nolimit')){_0xb06e9[_0xfbd9('0x17')]=qs['limit'](_0x303257['query'][_0xfbd9('0x17')]);_0xb06e9[_0xfbd9('0x14')]=qs['offset'](_0x303257[_0xfbd9('0x2b')][_0xfbd9('0x14')]);}_0xb06e9[_0xfbd9('0x32')]=qs['sort'](_0x303257[_0xfbd9('0x2b')]['sort']);_0xb06e9[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_['pick'](_0x303257[_0xfbd9('0x2b')],_0x3ad635[_0xfbd9('0x34')]),_0x3a8d39);if(_0x303257[_0xfbd9('0x2b')][_0xfbd9('0x35')]){_0xb06e9[_0xfbd9('0x33')]=_[_0xfbd9('0x36')](_0xb06e9[_0xfbd9('0x33')],{'$or':_[_0xfbd9('0x25')](_0x3a8d39,function(_0x5376e5){if(_0x5376e5[_0xfbd9('0x28')]!==_0xfbd9('0x37')){var _0x7cedd7={};_0x7cedd7[_0x5376e5[_0xfbd9('0x23')]]={'$like':'%'+_0x303257[_0xfbd9('0x2b')]['filter']+'%'};return _0x7cedd7;}})});}_0xb06e9=_[_0xfbd9('0x36')]({},_0xb06e9,_0x303257[_0xfbd9('0x38')]);var _0x1041e1={'where':_0xb06e9['where']};return db[_0xfbd9('0x39')][_0xfbd9('0x16')](_0x1041e1)[_0xfbd9('0x1f')](function(_0x521da4){_0x12f42a[_0xfbd9('0x16')]=_0x521da4;if(_0x303257[_0xfbd9('0x2b')][_0xfbd9('0x3a')]){_0xb06e9[_0xfbd9('0x3b')]=[{'all':!![]}];}return db[_0xfbd9('0x39')][_0xfbd9('0x3c')](_0xb06e9);})[_0xfbd9('0x1f')](function(_0x55f3dc){_0x12f42a[_0xfbd9('0x3d')]=_0x55f3dc;return _0x12f42a;})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x1c920d,_0xb06e9))['catch'](handleError(_0x1c920d,null));};exports[_0xfbd9('0x3e')]=function(_0x3b80a8,_0x294ddd){var _0x1d2a7a={'raw':!![],'where':{'id':_0x3b80a8['params']['id']}},_0x2eaa5d={};_0x2eaa5d[_0xfbd9('0x2a')]=_['keys'](db['SquareMessage'][_0xfbd9('0x26')]);_0x2eaa5d['query']=_[_0xfbd9('0x2c')](_0x3b80a8[_0xfbd9('0x2b')]);_0x2eaa5d[_0xfbd9('0x34')]=_[_0xfbd9('0x2d')](_0x2eaa5d[_0xfbd9('0x2a')],_0x2eaa5d[_0xfbd9('0x2b')]);_0x1d2a7a[_0xfbd9('0x2e')]=_['intersection'](_0x2eaa5d[_0xfbd9('0x2a')],qs[_0xfbd9('0x2f')](_0x3b80a8['query'][_0xfbd9('0x2f')]));_0x1d2a7a[_0xfbd9('0x2e')]=_0x1d2a7a[_0xfbd9('0x2e')][_0xfbd9('0x30')]?_0x1d2a7a['attributes']:_0x2eaa5d[_0xfbd9('0x2a')];if(_0x3b80a8[_0xfbd9('0x2b')][_0xfbd9('0x3a')]){_0x1d2a7a['include']=[{'all':!![]}];}_0x1d2a7a=_['merge']({},_0x1d2a7a,_0x3b80a8[_0xfbd9('0x38')]);return db[_0xfbd9('0x39')][_0xfbd9('0x3f')](_0x1d2a7a)[_0xfbd9('0x1f')](handleEntityNotFound(_0x294ddd,null))[_0xfbd9('0x1f')](respondWithResult(_0x294ddd,null))[_0xfbd9('0x40')](handleError(_0x294ddd,null));};exports[_0xfbd9('0x41')]=function(_0x275797,_0xfd06d4){return db[_0xfbd9('0x39')]['create'](_0x275797[_0xfbd9('0x42')],{})[_0xfbd9('0x1f')](respondWithResult(_0xfd06d4,0xc9))[_0xfbd9('0x40')](handleError(_0xfd06d4,null));};exports[_0xfbd9('0x1e')]=function(_0x4add02,_0x5d2576){if(_0x4add02['body']['id']){delete _0x4add02[_0xfbd9('0x42')]['id'];}return db[_0xfbd9('0x39')][_0xfbd9('0x3f')]({'where':{'id':_0x4add02[_0xfbd9('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d2576,null))['then'](saveUpdates(_0x4add02[_0xfbd9('0x42')],null))[_0xfbd9('0x1f')](respondWithResult(_0x5d2576,null))[_0xfbd9('0x40')](handleError(_0x5d2576,null));};exports['destroy']=function(_0x3e3d94,_0x1c2154){return db['SquareMessage'][_0xfbd9('0x3f')]({'where':{'id':_0x3e3d94[_0xfbd9('0x43')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x1c2154,null))[_0xfbd9('0x1f')](removeEntity(_0x1c2154,null))[_0xfbd9('0x40')](handleError(_0x1c2154,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index d184bf3..75028f1 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 _0xdb97=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','define','square_messages'];(function(_0x436f80,_0x439354){var _0x428681=function(_0x46fd20){while(--_0x46fd20){_0x436f80['push'](_0x436f80['shift']());}};_0x428681(++_0x439354);}(_0xdb97,0xd8));var _0x7db9=function(_0x33c6da,_0x43909f){_0x33c6da=_0x33c6da-0x0;var _0xbea0f7=_0xdb97[_0x33c6da];return _0xbea0f7;};'use strict';var _=require(_0x7db9('0x0'));var util=require('util');var logger=require(_0x7db9('0x1'))(_0x7db9('0x2'));var moment=require(_0x7db9('0x3'));var BPromise=require(_0x7db9('0x4'));var rp=require(_0x7db9('0x5'));var fs=require('fs');var path=require(_0x7db9('0x6'));var rimraf=require(_0x7db9('0x7'));var config=require(_0x7db9('0x8'));var attributes=require(_0x7db9('0x9'));module['exports']=function(_0x48a0a2,_0x10cdc7){return _0x48a0a2[_0x7db9('0xa')]('SquareMessage',attributes,{'tableName':_0x7db9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddaa=['rimraf','../../config/environment','./squareMessage.attributes','SquareMessage','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x6905f6,_0x239244){var _0xe43aa=function(_0x4bcd30){while(--_0x4bcd30){_0x6905f6['push'](_0x6905f6['shift']());}};_0xe43aa(++_0x239244);}(_0xddaa,0x101));var _0xadda=function(_0x46b78f,_0x7e0898){_0x46b78f=_0x46b78f-0x0;var _0x4d1702=_0xddaa[_0x46b78f];return _0x4d1702;};'use strict';var _=require(_0xadda('0x0'));var util=require(_0xadda('0x1'));var logger=require(_0xadda('0x2'))('api');var moment=require(_0xadda('0x3'));var BPromise=require(_0xadda('0x4'));var rp=require(_0xadda('0x5'));var fs=require('fs');var path=require(_0xadda('0x6'));var rimraf=require(_0xadda('0x7'));var config=require(_0xadda('0x8'));var attributes=require(_0xadda('0x9'));module['exports']=function(_0x4aada1,_0x5dae82){return _0x4aada1['define'](_0xadda('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index d232027..11c1649 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 _0x4a13=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','SquareMessage,\x20%s,\x20%s','message','result','CreateSquareMessage','SquareMessage','create','options','then','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4a13,0x7d));var _0x34a1=function(_0x477b13,_0x183f6d){_0x477b13=_0x477b13-0x0;var _0x4986a4=_0x4a13[_0x477b13];return _0x4986a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x34a1('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34a1('0x1'));var db=require(_0x34a1('0x2'))['db'];var utils=require(_0x34a1('0x3'));var logger=require(_0x34a1('0x4'))(_0x34a1('0x5'));var config=require(_0x34a1('0x6'));var jayson=require(_0x34a1('0x7'));var client=jayson[_0x34a1('0x8')][_0x34a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ddf90,_0x5d5864,_0x2c606c){return new BPromise(function(_0x22ad59,_0x165752){return client[_0x34a1('0xa')](_0x4ddf90,_0x2c606c)['then'](function(_0x49c953){logger[_0x34a1('0xb')]('SquareMessage,\x20%s,\x20%s',_0x5d5864,_0x34a1('0xc'));logger[_0x34a1('0xd')](_0x34a1('0xe'),_0x5d5864,_0x34a1('0xc'),JSON[_0x34a1('0xf')](_0x49c953));if(_0x49c953[_0x34a1('0x10')]){if(_0x49c953['error']['code']===0x1f4){logger[_0x34a1('0x10')](_0x34a1('0x11'),_0x5d5864,_0x49c953[_0x34a1('0x10')][_0x34a1('0x12')]);return _0x165752(_0x49c953[_0x34a1('0x10')][_0x34a1('0x12')]);}logger[_0x34a1('0x10')](_0x34a1('0x11'),_0x5d5864,_0x49c953['error'][_0x34a1('0x12')]);return _0x22ad59(_0x49c953[_0x34a1('0x10')][_0x34a1('0x12')]);}else{logger[_0x34a1('0xb')](_0x34a1('0x11'),_0x5d5864,_0x34a1('0xc'));_0x22ad59(_0x49c953[_0x34a1('0x13')][_0x34a1('0x12')]);}})['catch'](function(_0x16384a){logger[_0x34a1('0x10')](_0x34a1('0x11'),_0x5d5864,_0x16384a);_0x165752(_0x16384a);});});}exports[_0x34a1('0x14')]=function(_0x5eecef){var _0x25a248=this;return new Promise(function(_0x1328c1,_0x172d95){return db[_0x34a1('0x15')][_0x34a1('0x16')](_0x5eecef['body'],{'raw':_0x5eecef[_0x34a1('0x17')]?_0x5eecef[_0x34a1('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x34a1('0x18')](function(_0x1a5976){logger[_0x34a1('0xb')](_0x34a1('0x14'),_0x5eecef);logger['debug']('CreateSquareMessage',_0x5eecef,JSON[_0x34a1('0xf')](_0x1a5976));_0x1328c1(_0x1a5976);})[_0x34a1('0x19')](function(_0x290d1b){logger['error']('CreateSquareMessage',_0x290d1b[_0x34a1('0x12')],_0x5eecef);_0x172d95(_0x25a248[_0x34a1('0x10')](0x1f4,_0x290d1b[_0x34a1('0x12')]));});});}; \ No newline at end of file +var _0x82b0=['http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x5b083b,_0x145a9b){var _0x6c2225=function(_0xcc6435){while(--_0xcc6435){_0x5b083b['push'](_0x5b083b['shift']());}};_0x6c2225(++_0x145a9b);}(_0x82b0,0x18c));var _0x082b=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0x82b0[_0x235482];return _0x5f5bea;};'use strict';var _=require(_0x082b('0x0'));var util=require('util');var moment=require(_0x082b('0x1'));var BPromise=require(_0x082b('0x2'));var rs=require(_0x082b('0x3'));var fs=require('fs');var Redis=require(_0x082b('0x4'));var db=require(_0x082b('0x5'))['db'];var utils=require(_0x082b('0x6'));var logger=require(_0x082b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x082b('0x8'));var client=jayson[_0x082b('0x9')][_0x082b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44b485,_0x42b5a0,_0x15bb3a){return new BPromise(function(_0x4866d0,_0x3da81e){return client[_0x082b('0xb')](_0x44b485,_0x15bb3a)[_0x082b('0xc')](function(_0x18f9cf){logger[_0x082b('0xd')](_0x082b('0xe'),_0x42b5a0,_0x082b('0xf'));logger[_0x082b('0x10')](_0x082b('0x11'),_0x42b5a0,_0x082b('0xf'),JSON['stringify'](_0x18f9cf));if(_0x18f9cf[_0x082b('0x12')]){if(_0x18f9cf[_0x082b('0x12')]['code']===0x1f4){logger[_0x082b('0x12')]('SquareMessage,\x20%s,\x20%s',_0x42b5a0,_0x18f9cf[_0x082b('0x12')][_0x082b('0x13')]);return _0x3da81e(_0x18f9cf[_0x082b('0x12')]['message']);}logger[_0x082b('0x12')]('SquareMessage,\x20%s,\x20%s',_0x42b5a0,_0x18f9cf[_0x082b('0x12')][_0x082b('0x13')]);return _0x4866d0(_0x18f9cf['error'][_0x082b('0x13')]);}else{logger[_0x082b('0xd')](_0x082b('0xe'),_0x42b5a0,_0x082b('0xf'));_0x4866d0(_0x18f9cf[_0x082b('0x14')][_0x082b('0x13')]);}})[_0x082b('0x15')](function(_0x225d91){logger[_0x082b('0x12')](_0x082b('0xe'),_0x42b5a0,_0x225d91);_0x3da81e(_0x225d91);});});}exports[_0x082b('0x16')]=function(_0x302c8b){var _0x1eab1b=this;return new Promise(function(_0x485afa,_0x598729){return db[_0x082b('0x17')][_0x082b('0x18')](_0x302c8b[_0x082b('0x19')],{'raw':_0x302c8b[_0x082b('0x1a')]?_0x302c8b[_0x082b('0x1a')][_0x082b('0x1b')]===undefined?!![]:![]:!![]})[_0x082b('0xc')](function(_0x149563){logger[_0x082b('0xd')](_0x082b('0x16'),_0x302c8b);logger[_0x082b('0x10')](_0x082b('0x16'),_0x302c8b,JSON[_0x082b('0x1c')](_0x149563));_0x485afa(_0x149563);})[_0x082b('0x15')](function(_0x27ebfd){logger['error'](_0x082b('0x16'),_0x27ebfd[_0x082b('0x13')],_0x302c8b);_0x598729(_0x1eab1b[_0x082b('0x12')](0x1f4,_0x27ebfd['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 432944b..c808302 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 _0x97af=['fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','test','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x23a74a,_0x5bd56d){var _0x4617ac=function(_0x16c677){while(--_0x16c677){_0x23a74a['push'](_0x23a74a['shift']());}};_0x4617ac(++_0x5bd56d);}(_0x97af,0x1df));var _0xf97a=function(_0xba49ca,_0x440a90){_0xba49ca=_0xba49ca-0x0;var _0x3700aa=_0x97af[_0xba49ca];return _0x3700aa;};'use strict';var multer=require(_0xf97a('0x0'));var util=require(_0xf97a('0x1'));var path=require(_0xf97a('0x2'));var timeout=require(_0xf97a('0x3'));var express=require(_0xf97a('0x4'));var router=express['Router']();var fs_extra=require(_0xf97a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf97a('0x6'));var config=require(_0xf97a('0x7'));var controller=require(_0xf97a('0x8'));router[_0xf97a('0x9')]('/',auth[_0xf97a('0xa')](),controller[_0xf97a('0xb')]);router['get'](_0xf97a('0xc'),auth[_0xf97a('0xa')](),controller['show']);router[_0xf97a('0x9')](_0xf97a('0xd'),auth[_0xf97a('0xa')](),timeout(_0xf97a('0xe')),controller[_0xf97a('0xf')]);router[_0xf97a('0x10')]('/',auth[_0xf97a('0xa')](),controller[_0xf97a('0x11')]);router[_0xf97a('0x12')](_0xf97a('0xc'),auth['isAuthenticated'](),controller[_0xf97a('0x13')]);router[_0xf97a('0x14')](_0xf97a('0xc'),auth[_0xf97a('0xa')](),controller[_0xf97a('0x15')]);module['exports']=router; \ No newline at end of file +var _0x1c7f=['update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id','show','15s','test','post','create'];(function(_0x5e2aef,_0x73e9c2){var _0x21e98d=function(_0x3c02cd){while(--_0x3c02cd){_0x5e2aef['push'](_0x5e2aef['shift']());}};_0x21e98d(++_0x73e9c2);}(_0x1c7f,0x97));var _0xf1c7=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x1c7f[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require('multer');var util=require(_0xf1c7('0x0'));var path=require(_0xf1c7('0x1'));var timeout=require('connect-timeout');var express=require(_0xf1c7('0x2'));var router=express['Router']();var fs_extra=require(_0xf1c7('0x3'));var auth=require(_0xf1c7('0x4'));var interaction=require(_0xf1c7('0x5'));var config=require(_0xf1c7('0x6'));var controller=require(_0xf1c7('0x7'));router['get']('/',auth[_0xf1c7('0x8')](),controller[_0xf1c7('0x9')]);router[_0xf1c7('0xa')](_0xf1c7('0xb'),auth[_0xf1c7('0x8')](),controller[_0xf1c7('0xc')]);router['get']('/:id/test',auth[_0xf1c7('0x8')](),timeout(_0xf1c7('0xd')),controller[_0xf1c7('0xe')]);router[_0xf1c7('0xf')]('/',auth[_0xf1c7('0x8')](),controller[_0xf1c7('0x10')]);router['put'](_0xf1c7('0xb'),auth['isAuthenticated'](),controller[_0xf1c7('0x11')]);router[_0xf1c7('0x12')]('/:id',auth[_0xf1c7('0x8')](),controller[_0xf1c7('0x13')]);module[_0xf1c7('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 506a007..f880299 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 _0x8bc4=['exports','name','STRING','sequelize'];(function(_0x3ffb6a,_0x21114){var _0xd082a0=function(_0x1d0d50){while(--_0x1d0d50){_0x3ffb6a['push'](_0x3ffb6a['shift']());}};_0xd082a0(++_0x21114);}(_0x8bc4,0x6f));var _0x48bc=function(_0x42a21d,_0x5daf52){_0x42a21d=_0x42a21d-0x0;var _0x2d523d=_0x8bc4[_0x42a21d];return _0x2d523d;};'use strict';var Sequelize=require(_0x48bc('0x0'));module[_0x48bc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x48bc('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x48bc('0x3')]},'description':{'type':Sequelize[_0x48bc('0x3')]}}; \ No newline at end of file +var _0xb9b2=['sequelize','STRING'];(function(_0xd2e2ab,_0x2440cf){var _0x1703a2=function(_0x23deba){while(--_0x23deba){_0xd2e2ab['push'](_0xd2e2ab['shift']());}};_0x1703a2(++_0x2440cf);}(_0xb9b2,0x13c));var _0x2b9b=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xb9b2[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require(_0x2b9b('0x0'));module['exports']={'name':{'type':Sequelize[_0x2b9b('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x2b9b('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index b264700..e044d64 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 _0x68ee=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','stack','send','index','SquareOdbc','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','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','update','body','test','odbc','openSync','dsn','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x29abca,_0x4ee067){var _0x1d6828=function(_0x4deb4a){while(--_0x4deb4a){_0x29abca['push'](_0x29abca['shift']());}};_0x1d6828(++_0x4ee067);}(_0x68ee,0xb2));var _0xe68e=function(_0x2ab16a,_0x5307aa){_0x2ab16a=_0x2ab16a-0x0;var _0x5ec6c2=_0x68ee[_0x2ab16a];return _0x5ec6c2;};'use strict';var emlformat=require(_0xe68e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe68e('0x1'));var jsonpatch=require(_0xe68e('0x2'));var rp=require(_0xe68e('0x3'));var moment=require(_0xe68e('0x4'));var BPromise=require(_0xe68e('0x5'));var Mustache=require(_0xe68e('0x6'));var util=require(_0xe68e('0x7'));var path=require('path');var sox=require(_0xe68e('0x8'));var csv=require(_0xe68e('0x9'));var ejs=require(_0xe68e('0xa'));var fs=require('fs');var fs_extra=require(_0xe68e('0xb'));var _=require(_0xe68e('0xc'));var squel=require(_0xe68e('0xd'));var crypto=require(_0xe68e('0xe'));var jsforce=require(_0xe68e('0xf'));var deskjs=require(_0xe68e('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe68e('0x11'));var authService=require(_0xe68e('0x12'));var qs=require(_0xe68e('0x13'));var as=require(_0xe68e('0x14'));var hardwareService=require(_0xe68e('0x15'));var logger=require(_0xe68e('0x16'))(_0xe68e('0x17'));var utils=require(_0xe68e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe68e('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13fcc3,_0x53b1af){_0x53b1af=_0x53b1af||0xcc;return function(_0x4f04e3){if(_0x4f04e3){return _0x13fcc3['sendStatus'](_0x53b1af);}return _0x13fcc3[_0xe68e('0x1a')](_0x53b1af)[_0xe68e('0x1b')]();};}function respondWithResult(_0x1507e1,_0xe0eae0){_0xe0eae0=_0xe0eae0||0xc8;return function(_0x24e8b0){if(_0x24e8b0){return _0x1507e1[_0xe68e('0x1a')](_0xe0eae0)['json'](_0x24e8b0);}};}function respondWithFilteredResult(_0x20123d,_0x371ea0){return function(_0x332239){if(_0x332239){var _0x6ffa9a=typeof _0x371ea0[_0xe68e('0x1c')]===_0xe68e('0x1d')&&typeof _0x371ea0['limit']==='undefined';var _0x116b68=_0x332239['count'];var _0x29ad41=_0x6ffa9a?0x0:_0x371ea0['offset'];var _0x517c61=_0x6ffa9a?_0x332239[_0xe68e('0x1e')]:_0x371ea0[_0xe68e('0x1c')]+_0x371ea0[_0xe68e('0x1f')];var _0x57caed;if(_0x517c61>=_0x116b68){_0x517c61=_0x116b68;_0x57caed=0xc8;}else{_0x57caed=0xce;}_0x20123d[_0xe68e('0x1a')](_0x57caed);return _0x20123d[_0xe68e('0x20')](_0xe68e('0x21'),_0x29ad41+'-'+_0x517c61+'/'+_0x116b68)[_0xe68e('0x22')](_0x332239);}return null;};}function patchUpdates(_0x5f33c9){return function(_0x52182d){try{jsonpatch['apply'](_0x52182d,_0x5f33c9,!![]);}catch(_0x55f65e){return BPromise[_0xe68e('0x23')](_0x55f65e);}return _0x52182d[_0xe68e('0x24')]();};}function saveUpdates(_0x188ec4,_0x3e2a3d){return function(_0x35255a){if(_0x35255a){return _0x35255a['update'](_0x188ec4)[_0xe68e('0x25')](function(_0x47c8c9){return _0x47c8c9;});}return null;};}function removeEntity(_0x3f3830,_0x35025c){return function(_0xf1c3e1){if(_0xf1c3e1){return _0xf1c3e1[_0xe68e('0x26')]()['then'](function(){var _0x3c0ed9=_0xf1c3e1[_0xe68e('0x27')]({'plain':!![]});var _0xc2200c=_0xe68e('0x28');return db[_0xe68e('0x29')][_0xe68e('0x26')]({'where':{'type':_0xc2200c,'resourceId':_0x3c0ed9['id']}})[_0xe68e('0x25')](function(){return _0xf1c3e1;});})[_0xe68e('0x25')](function(){_0x3f3830[_0xe68e('0x1a')](0xcc)[_0xe68e('0x1b')]();});}};}function handleEntityNotFound(_0x17ce95,_0x43edc1){return function(_0x316e6a){if(!_0x316e6a){_0x17ce95[_0xe68e('0x2a')](0x194);}return _0x316e6a;};}function handleError(_0x3993e1,_0x22fddf){_0x22fddf=_0x22fddf||0x1f4;return function(_0x2f9732){logger[_0xe68e('0x2b')](_0x2f9732[_0xe68e('0x2c')]);if(_0x2f9732['name']){delete _0x2f9732['name'];}_0x3993e1[_0xe68e('0x1a')](_0x22fddf)[_0xe68e('0x2d')](_0x2f9732);};}exports[_0xe68e('0x2e')]=function(_0x4d2cb3,_0x2ee98a){var _0x27cffb={},_0x5928a7={},_0x1d7351={'count':0x0,'rows':[]};var _0x5f51e1=_['map'](db[_0xe68e('0x2f')][_0xe68e('0x30')],function(_0x1f4f98){return{'name':_0x1f4f98['fieldName'],'type':_0x1f4f98[_0xe68e('0x31')][_0xe68e('0x32')]};});_0x5928a7[_0xe68e('0x33')]=_[_0xe68e('0x34')](_0x5f51e1,_0xe68e('0x35'));_0x5928a7[_0xe68e('0x36')]=_[_0xe68e('0x37')](_0x4d2cb3[_0xe68e('0x36')]);_0x5928a7[_0xe68e('0x38')]=_[_0xe68e('0x39')](_0x5928a7['model'],_0x5928a7[_0xe68e('0x36')]);_0x27cffb[_0xe68e('0x3a')]=_[_0xe68e('0x39')](_0x5928a7[_0xe68e('0x33')],qs[_0xe68e('0x3b')](_0x4d2cb3[_0xe68e('0x36')][_0xe68e('0x3b')]));_0x27cffb[_0xe68e('0x3a')]=_0x27cffb[_0xe68e('0x3a')][_0xe68e('0x3c')]?_0x27cffb['attributes']:_0x5928a7[_0xe68e('0x33')];if(!_0x4d2cb3[_0xe68e('0x36')][_0xe68e('0x3d')]('nolimit')){_0x27cffb[_0xe68e('0x1f')]=qs[_0xe68e('0x1f')](_0x4d2cb3[_0xe68e('0x36')]['limit']);_0x27cffb['offset']=qs[_0xe68e('0x1c')](_0x4d2cb3[_0xe68e('0x36')]['offset']);}_0x27cffb[_0xe68e('0x3e')]=qs[_0xe68e('0x3f')](_0x4d2cb3[_0xe68e('0x36')][_0xe68e('0x3f')]);_0x27cffb[_0xe68e('0x40')]=qs[_0xe68e('0x38')](_[_0xe68e('0x41')](_0x4d2cb3[_0xe68e('0x36')],_0x5928a7[_0xe68e('0x38')]),_0x5f51e1);if(_0x4d2cb3[_0xe68e('0x36')]['filter']){_0x27cffb['where']=_[_0xe68e('0x42')](_0x27cffb[_0xe68e('0x40')],{'$or':_[_0xe68e('0x34')](_0x5f51e1,function(_0x4a992d){if(_0x4a992d['type']!==_0xe68e('0x43')){var _0x17e73e={};_0x17e73e[_0x4a992d[_0xe68e('0x35')]]={'$like':'%'+_0x4d2cb3[_0xe68e('0x36')][_0xe68e('0x44')]+'%'};return _0x17e73e;}})});}_0x27cffb=_[_0xe68e('0x42')]({},_0x27cffb,_0x4d2cb3[_0xe68e('0x45')]);var _0x421458={'where':_0x27cffb[_0xe68e('0x40')]};return db['SquareOdbc'][_0xe68e('0x1e')](_0x421458)[_0xe68e('0x25')](function(_0x5dc309){_0x1d7351[_0xe68e('0x1e')]=_0x5dc309;if(_0x4d2cb3['query'][_0xe68e('0x46')]){_0x27cffb[_0xe68e('0x47')]=[{'all':!![]}];}return db['SquareOdbc'][_0xe68e('0x48')](_0x27cffb);})['then'](function(_0x816593){_0x1d7351[_0xe68e('0x49')]=_0x816593;return _0x1d7351;})[_0xe68e('0x25')](respondWithFilteredResult(_0x2ee98a,_0x27cffb))[_0xe68e('0x4a')](handleError(_0x2ee98a,null));};exports[_0xe68e('0x4b')]=function(_0x4aeb72,_0x5ce3f0){var _0x53e3b5={'raw':!![],'where':{'id':_0x4aeb72[_0xe68e('0x4c')]['id']}},_0x562824={};_0x562824[_0xe68e('0x33')]=_[_0xe68e('0x37')](db[_0xe68e('0x2f')][_0xe68e('0x30')]);_0x562824[_0xe68e('0x36')]=_[_0xe68e('0x37')](_0x4aeb72[_0xe68e('0x36')]);_0x562824['filters']=_['intersection'](_0x562824[_0xe68e('0x33')],_0x562824[_0xe68e('0x36')]);_0x53e3b5[_0xe68e('0x3a')]=_['intersection'](_0x562824[_0xe68e('0x33')],qs['fields'](_0x4aeb72[_0xe68e('0x36')][_0xe68e('0x3b')]));_0x53e3b5[_0xe68e('0x3a')]=_0x53e3b5[_0xe68e('0x3a')]['length']?_0x53e3b5[_0xe68e('0x3a')]:_0x562824[_0xe68e('0x33')];if(_0x4aeb72['query'][_0xe68e('0x46')]){_0x53e3b5[_0xe68e('0x47')]=[{'all':!![]}];}_0x53e3b5=_[_0xe68e('0x42')]({},_0x53e3b5,_0x4aeb72['options']);return db[_0xe68e('0x2f')][_0xe68e('0x4d')](_0x53e3b5)[_0xe68e('0x25')](handleEntityNotFound(_0x5ce3f0,null))['then'](respondWithResult(_0x5ce3f0,null))[_0xe68e('0x4a')](handleError(_0x5ce3f0,null));};exports[_0xe68e('0x4e')]=function(_0x489414,_0x35b08c){return db[_0xe68e('0x2f')][_0xe68e('0x4e')](_0x489414['body'],{})[_0xe68e('0x25')](function(_0x134900){var _0x2f1096=_0x489414[_0xe68e('0x4f')]['get']({'plain':!![]});if(!_0x2f1096)throw new Error(_0xe68e('0x50'));if(_0x2f1096[_0xe68e('0x51')]===_0xe68e('0x4f')){var _0x13daad=_0x134900['get']({'plain':!![]});var _0x3f20bb=_0xe68e('0x28');return db[_0xe68e('0x52')][_0xe68e('0x4d')]({'where':{'name':_0x3f20bb,'userProfileId':_0x2f1096[_0xe68e('0x53')]},'raw':!![]})[_0xe68e('0x25')](function(_0xc64202){if(_0xc64202&&_0xc64202[_0xe68e('0x54')]===0x0){return db['UserProfileResource'][_0xe68e('0x4e')]({'name':_0x13daad[_0xe68e('0x35')],'resourceId':_0x13daad['id'],'type':_0xc64202[_0xe68e('0x35')],'sectionId':_0xc64202['id']},{})['then'](function(){return _0x134900;});}else{return _0x134900;}})[_0xe68e('0x4a')](function(_0x9897e9){logger[_0xe68e('0x2b')](_0xe68e('0x55'),_0x9897e9);throw _0x9897e9;});}return _0x134900;})[_0xe68e('0x25')](respondWithResult(_0x35b08c,0xc9))[_0xe68e('0x4a')](handleError(_0x35b08c,null));};exports[_0xe68e('0x56')]=function(_0x1f5109,_0x5ac9f1){if(_0x1f5109[_0xe68e('0x57')]['id']){delete _0x1f5109[_0xe68e('0x57')]['id'];}return db['SquareOdbc'][_0xe68e('0x4d')]({'where':{'id':_0x1f5109['params']['id']}})[_0xe68e('0x25')](handleEntityNotFound(_0x5ac9f1,null))['then'](saveUpdates(_0x1f5109['body'],null))['then'](respondWithResult(_0x5ac9f1,null))[_0xe68e('0x4a')](handleError(_0x5ac9f1,null));};exports['destroy']=function(_0x16cedf,_0x13b837){return db['SquareOdbc'][_0xe68e('0x4d')]({'where':{'id':_0x16cedf[_0xe68e('0x4c')]['id']}})[_0xe68e('0x25')](handleEntityNotFound(_0x13b837,null))[_0xe68e('0x25')](removeEntity(_0x13b837,null))[_0xe68e('0x4a')](handleError(_0x13b837,null));};exports[_0xe68e('0x58')]=function(_0x19cc92,_0x509dde,_0xd5c67){var _0x260e36;return db[_0xe68e('0x2f')][_0xe68e('0x4d')]({'where':{'id':_0x19cc92[_0xe68e('0x4c')]['id']},'attributes':['id','dsn']})[_0xe68e('0x25')](handleEntityNotFound(_0x509dde,null))[_0xe68e('0x25')](function(_0x453abd){if(_0x453abd){var _0x28ae8d=require(_0xe68e('0x59'))();_0x28ae8d[_0xe68e('0x5a')](_0x453abd[_0xe68e('0x5b')]);_0x28ae8d[_0xe68e('0x5c')]();return _0x453abd;}})[_0xe68e('0x25')](respondWithResult(_0x509dde,null))[_0xe68e('0x4a')](handleError(_0x509dde,null));}; \ No newline at end of file +var _0x29ea=['mustache','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/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','destroy','ODBC','UserProfileResource','then','end','stack','rawAttributes','fieldName','key','map','name','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareOdbc','includeAll','findAll','rows','catch','show','params','keys','intersection','include','find','create','body','user','get','role','UserProfileSection','autoAssociation','error','test','dsn','closeSync','fast-json-patch','bluebird'];(function(_0x5676d3,_0x582062){var _0x573736=function(_0x3760bc){while(--_0x3760bc){_0x5676d3['push'](_0x5676d3['shift']());}};_0x573736(++_0x582062);}(_0x29ea,0x14a));var _0xa29e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x29ea[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa29e('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa29e('0x1'));var Mustache=require(_0xa29e('0x2'));var util=require('util');var path=require(_0xa29e('0x3'));var sox=require(_0xa29e('0x4'));var csv=require(_0xa29e('0x5'));var ejs=require(_0xa29e('0x6'));var fs=require('fs');var fs_extra=require(_0xa29e('0x7'));var _=require(_0xa29e('0x8'));var squel=require(_0xa29e('0x9'));var crypto=require('crypto');var jsforce=require(_0xa29e('0xa'));var deskjs=require(_0xa29e('0xb'));var toCsv=require(_0xa29e('0x5'));var querystring=require(_0xa29e('0xc'));var Papa=require(_0xa29e('0xd'));var Redis=require(_0xa29e('0xe'));var authService=require(_0xa29e('0xf'));var qs=require(_0xa29e('0x10'));var as=require(_0xa29e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa29e('0x12'))(_0xa29e('0x13'));var utils=require(_0xa29e('0x14'));var config=require(_0xa29e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2752cb,_0x1625e1){_0x1625e1=_0x1625e1||0xcc;return function(_0x9346de){if(_0x9346de){return _0x2752cb[_0xa29e('0x16')](_0x1625e1);}return _0x2752cb[_0xa29e('0x17')](_0x1625e1)['end']();};}function respondWithResult(_0x489e00,_0x3f4cb0){_0x3f4cb0=_0x3f4cb0||0xc8;return function(_0xce4f77){if(_0xce4f77){return _0x489e00['status'](_0x3f4cb0)['json'](_0xce4f77);}};}function respondWithFilteredResult(_0x311a69,_0x742958){return function(_0x4265c7){if(_0x4265c7){var _0x1a8b07=typeof _0x742958[_0xa29e('0x18')]===_0xa29e('0x19')&&typeof _0x742958['limit']===_0xa29e('0x19');var _0x645be9=_0x4265c7[_0xa29e('0x1a')];var _0x1dbb81=_0x1a8b07?0x0:_0x742958[_0xa29e('0x18')];var _0x69372e=_0x1a8b07?_0x4265c7[_0xa29e('0x1a')]:_0x742958['offset']+_0x742958[_0xa29e('0x1b')];var _0x1b3377;if(_0x69372e>=_0x645be9){_0x69372e=_0x645be9;_0x1b3377=0xc8;}else{_0x1b3377=0xce;}_0x311a69[_0xa29e('0x17')](_0x1b3377);return _0x311a69[_0xa29e('0x1c')](_0xa29e('0x1d'),_0x1dbb81+'-'+_0x69372e+'/'+_0x645be9)[_0xa29e('0x1e')](_0x4265c7);}return null;};}function patchUpdates(_0x1f86d4){return function(_0x397b4e){try{jsonpatch[_0xa29e('0x1f')](_0x397b4e,_0x1f86d4,!![]);}catch(_0x3a15be){return BPromise[_0xa29e('0x20')](_0x3a15be);}return _0x397b4e['save']();};}function saveUpdates(_0x1ce2c0,_0x464a29){return function(_0x5e0c97){if(_0x5e0c97){return _0x5e0c97[_0xa29e('0x21')](_0x1ce2c0)['then'](function(_0x2995cf){return _0x2995cf;});}return null;};}function removeEntity(_0x25c074,_0x426ecd){return function(_0x4f5c37){if(_0x4f5c37){return _0x4f5c37[_0xa29e('0x22')]()['then'](function(){var _0x440da7=_0x4f5c37['get']({'plain':!![]});var _0x992cd0=_0xa29e('0x23');return db[_0xa29e('0x24')]['destroy']({'where':{'type':_0x992cd0,'resourceId':_0x440da7['id']}})[_0xa29e('0x25')](function(){return _0x4f5c37;});})[_0xa29e('0x25')](function(){_0x25c074['status'](0xcc)[_0xa29e('0x26')]();});}};}function handleEntityNotFound(_0xf9119a,_0x58638b){return function(_0x326abe){if(!_0x326abe){_0xf9119a['sendStatus'](0x194);}return _0x326abe;};}function handleError(_0x560696,_0x45fb84){_0x45fb84=_0x45fb84||0x1f4;return function(_0x54fc04){logger['error'](_0x54fc04[_0xa29e('0x27')]);if(_0x54fc04['name']){delete _0x54fc04['name'];}_0x560696['status'](_0x45fb84)['send'](_0x54fc04);};}exports['index']=function(_0xababe7,_0x51c3da){var _0x84f420={},_0x573dba={},_0x3ddeed={'count':0x0,'rows':[]};var _0x2cd25a=_['map'](db['SquareOdbc'][_0xa29e('0x28')],function(_0x5bd398){return{'name':_0x5bd398[_0xa29e('0x29')],'type':_0x5bd398['type'][_0xa29e('0x2a')]};});_0x573dba['model']=_[_0xa29e('0x2b')](_0x2cd25a,_0xa29e('0x2c'));_0x573dba[_0xa29e('0x2d')]=_['keys'](_0xababe7[_0xa29e('0x2d')]);_0x573dba[_0xa29e('0x2e')]=_['intersection'](_0x573dba[_0xa29e('0x2f')],_0x573dba[_0xa29e('0x2d')]);_0x84f420[_0xa29e('0x30')]=_['intersection'](_0x573dba[_0xa29e('0x2f')],qs[_0xa29e('0x31')](_0xababe7[_0xa29e('0x2d')][_0xa29e('0x31')]));_0x84f420[_0xa29e('0x30')]=_0x84f420[_0xa29e('0x30')][_0xa29e('0x32')]?_0x84f420[_0xa29e('0x30')]:_0x573dba['model'];if(!_0xababe7[_0xa29e('0x2d')][_0xa29e('0x33')](_0xa29e('0x34'))){_0x84f420['limit']=qs[_0xa29e('0x1b')](_0xababe7[_0xa29e('0x2d')][_0xa29e('0x1b')]);_0x84f420[_0xa29e('0x18')]=qs[_0xa29e('0x18')](_0xababe7['query'][_0xa29e('0x18')]);}_0x84f420[_0xa29e('0x35')]=qs['sort'](_0xababe7[_0xa29e('0x2d')][_0xa29e('0x36')]);_0x84f420[_0xa29e('0x37')]=qs[_0xa29e('0x2e')](_[_0xa29e('0x38')](_0xababe7['query'],_0x573dba['filters']),_0x2cd25a);if(_0xababe7['query'][_0xa29e('0x39')]){_0x84f420[_0xa29e('0x37')]=_[_0xa29e('0x3a')](_0x84f420[_0xa29e('0x37')],{'$or':_['map'](_0x2cd25a,function(_0x53e1e9){if(_0x53e1e9['type']!==_0xa29e('0x3b')){var _0x3af61b={};_0x3af61b[_0x53e1e9['name']]={'$like':'%'+_0xababe7[_0xa29e('0x2d')][_0xa29e('0x39')]+'%'};return _0x3af61b;}})});}_0x84f420=_[_0xa29e('0x3a')]({},_0x84f420,_0xababe7[_0xa29e('0x3c')]);var _0x33ad8e={'where':_0x84f420[_0xa29e('0x37')]};return db[_0xa29e('0x3d')][_0xa29e('0x1a')](_0x33ad8e)['then'](function(_0x4b14fc){_0x3ddeed['count']=_0x4b14fc;if(_0xababe7[_0xa29e('0x2d')][_0xa29e('0x3e')]){_0x84f420['include']=[{'all':!![]}];}return db[_0xa29e('0x3d')][_0xa29e('0x3f')](_0x84f420);})[_0xa29e('0x25')](function(_0x13ceb5){_0x3ddeed[_0xa29e('0x40')]=_0x13ceb5;return _0x3ddeed;})[_0xa29e('0x25')](respondWithFilteredResult(_0x51c3da,_0x84f420))[_0xa29e('0x41')](handleError(_0x51c3da,null));};exports[_0xa29e('0x42')]=function(_0x17c310,_0x4a575f){var _0x42e217={'raw':!![],'where':{'id':_0x17c310[_0xa29e('0x43')]['id']}},_0x117f88={};_0x117f88[_0xa29e('0x2f')]=_[_0xa29e('0x44')](db[_0xa29e('0x3d')][_0xa29e('0x28')]);_0x117f88[_0xa29e('0x2d')]=_[_0xa29e('0x44')](_0x17c310[_0xa29e('0x2d')]);_0x117f88['filters']=_[_0xa29e('0x45')](_0x117f88[_0xa29e('0x2f')],_0x117f88[_0xa29e('0x2d')]);_0x42e217['attributes']=_[_0xa29e('0x45')](_0x117f88[_0xa29e('0x2f')],qs['fields'](_0x17c310[_0xa29e('0x2d')][_0xa29e('0x31')]));_0x42e217['attributes']=_0x42e217[_0xa29e('0x30')]['length']?_0x42e217['attributes']:_0x117f88[_0xa29e('0x2f')];if(_0x17c310[_0xa29e('0x2d')][_0xa29e('0x3e')]){_0x42e217[_0xa29e('0x46')]=[{'all':!![]}];}_0x42e217=_['merge']({},_0x42e217,_0x17c310[_0xa29e('0x3c')]);return db['SquareOdbc'][_0xa29e('0x47')](_0x42e217)[_0xa29e('0x25')](handleEntityNotFound(_0x4a575f,null))[_0xa29e('0x25')](respondWithResult(_0x4a575f,null))[_0xa29e('0x41')](handleError(_0x4a575f,null));};exports[_0xa29e('0x48')]=function(_0x53cf87,_0x76122c){return db['SquareOdbc'][_0xa29e('0x48')](_0x53cf87[_0xa29e('0x49')],{})[_0xa29e('0x25')](function(_0x2cb7b6){var _0x2cddc0=_0x53cf87[_0xa29e('0x4a')][_0xa29e('0x4b')]({'plain':!![]});if(!_0x2cddc0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cddc0[_0xa29e('0x4c')]===_0xa29e('0x4a')){var _0x1ab7fa=_0x2cb7b6[_0xa29e('0x4b')]({'plain':!![]});var _0xf30f40='ODBC';return db[_0xa29e('0x4d')][_0xa29e('0x47')]({'where':{'name':_0xf30f40,'userProfileId':_0x2cddc0['userProfileId']},'raw':!![]})[_0xa29e('0x25')](function(_0x5422cc){if(_0x5422cc&&_0x5422cc[_0xa29e('0x4e')]===0x0){return db[_0xa29e('0x24')][_0xa29e('0x48')]({'name':_0x1ab7fa[_0xa29e('0x2c')],'resourceId':_0x1ab7fa['id'],'type':_0x5422cc[_0xa29e('0x2c')],'sectionId':_0x5422cc['id']},{})[_0xa29e('0x25')](function(){return _0x2cb7b6;});}else{return _0x2cb7b6;}})[_0xa29e('0x41')](function(_0x97dba7){logger[_0xa29e('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x97dba7);throw _0x97dba7;});}return _0x2cb7b6;})[_0xa29e('0x25')](respondWithResult(_0x76122c,0xc9))[_0xa29e('0x41')](handleError(_0x76122c,null));};exports[_0xa29e('0x21')]=function(_0x36d0c2,_0x35b491){if(_0x36d0c2['body']['id']){delete _0x36d0c2[_0xa29e('0x49')]['id'];}return db[_0xa29e('0x3d')][_0xa29e('0x47')]({'where':{'id':_0x36d0c2[_0xa29e('0x43')]['id']}})[_0xa29e('0x25')](handleEntityNotFound(_0x35b491,null))['then'](saveUpdates(_0x36d0c2[_0xa29e('0x49')],null))[_0xa29e('0x25')](respondWithResult(_0x35b491,null))[_0xa29e('0x41')](handleError(_0x35b491,null));};exports[_0xa29e('0x22')]=function(_0x127130,_0x30e3a8){return db['SquareOdbc'][_0xa29e('0x47')]({'where':{'id':_0x127130[_0xa29e('0x43')]['id']}})[_0xa29e('0x25')](handleEntityNotFound(_0x30e3a8,null))['then'](removeEntity(_0x30e3a8,null))[_0xa29e('0x41')](handleError(_0x30e3a8,null));};exports[_0xa29e('0x50')]=function(_0x28c9c0,_0x240732,_0x3cf85d){var _0x57af62;return db['SquareOdbc']['find']({'where':{'id':_0x28c9c0[_0xa29e('0x43')]['id']},'attributes':['id',_0xa29e('0x51')]})[_0xa29e('0x25')](handleEntityNotFound(_0x240732,null))[_0xa29e('0x25')](function(_0x2338f8){if(_0x2338f8){var _0x6fc15e=require('odbc')();_0x6fc15e['openSync'](_0x2338f8[_0xa29e('0x51')]);_0x6fc15e[_0xa29e('0x52')]();return _0x2338f8;}})[_0xa29e('0x25')](respondWithResult(_0x240732,null))['catch'](handleError(_0x240732,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index c46d534..f3da6eb 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 _0xc6aa=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','SquareOdbc','square_odbc'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xc6aa,0x1f4));var _0xac6a=function(_0x3a856b,_0x5343c1){_0x3a856b=_0x3a856b-0x0;var _0x31692e=_0xc6aa[_0x3a856b];return _0x31692e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xac6a('0x0'))(_0xac6a('0x1'));var moment=require(_0xac6a('0x2'));var BPromise=require(_0xac6a('0x3'));var rp=require(_0xac6a('0x4'));var fs=require('fs');var path=require(_0xac6a('0x5'));var rimraf=require('rimraf');var config=require(_0xac6a('0x6'));var attributes=require('./squareOdbc.attributes');module[_0xac6a('0x7')]=function(_0x3dc0a8,_0x4d8530){return _0x3dc0a8['define'](_0xac6a('0x8'),attributes,{'tableName':_0xac6a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55e5=['moment','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','util','../../config/logger','api'];(function(_0x30bb57,_0x4ed3d8){var _0x5ad26c=function(_0x1ede46){while(--_0x1ede46){_0x30bb57['push'](_0x30bb57['shift']());}};_0x5ad26c(++_0x4ed3d8);}(_0x55e5,0x81));var _0x555e=function(_0x545e52,_0x46a243){_0x545e52=_0x545e52-0x0;var _0x24a6a0=_0x55e5[_0x545e52];return _0x24a6a0;};'use strict';var _=require('lodash');var util=require(_0x555e('0x0'));var logger=require(_0x555e('0x1'))(_0x555e('0x2'));var moment=require(_0x555e('0x3'));var BPromise=require('bluebird');var rp=require(_0x555e('0x4'));var fs=require('fs');var path=require(_0x555e('0x5'));var rimraf=require(_0x555e('0x6'));var config=require(_0x555e('0x7'));var attributes=require(_0x555e('0x8'));module['exports']=function(_0x18d449,_0x10a16c){return _0x18d449[_0x555e('0x9')](_0x555e('0xa'),attributes,{'tableName':_0x555e('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 6a7d679..c6b81d3 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 _0x287c=['request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','SquareOdbc','find','options','where','attributes','include','model','map','ShowSquareOdbc','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x287c,0x1d2));var _0xc287=function(_0x26bec6,_0x20d092){_0x26bec6=_0x26bec6-0x0;var _0x152140=_0x287c[_0x26bec6];return _0x152140;};'use strict';var _=require(_0xc287('0x0'));var util=require(_0xc287('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc287('0x2'));var fs=require('fs');var Redis=require(_0xc287('0x3'));var db=require(_0xc287('0x4'))['db'];var utils=require(_0xc287('0x5'));var logger=require('../../config/logger')(_0xc287('0x6'));var config=require('../../config/environment');var jayson=require(_0xc287('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49061d,_0x1c8c6c,_0x4027d8){return new BPromise(function(_0x53c41d,_0x123a51){return client['request'](_0x49061d,_0x4027d8)[_0xc287('0x8')](function(_0x485a96){logger[_0xc287('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x1c8c6c,_0xc287('0xa'));logger['debug'](_0xc287('0xb'),_0x1c8c6c,_0xc287('0xa'),JSON[_0xc287('0xc')](_0x485a96));if(_0x485a96['error']){if(_0x485a96[_0xc287('0xd')][_0xc287('0xe')]===0x1f4){logger[_0xc287('0xd')](_0xc287('0xf'),_0x1c8c6c,_0x485a96[_0xc287('0xd')]['message']);return _0x123a51(_0x485a96[_0xc287('0xd')][_0xc287('0x10')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x1c8c6c,_0x485a96['error'][_0xc287('0x10')]);return _0x53c41d(_0x485a96['error']['message']);}else{logger[_0xc287('0x9')](_0xc287('0xf'),_0x1c8c6c,'request\x20sent');_0x53c41d(_0x485a96[_0xc287('0x11')]['message']);}})['catch'](function(_0x56ae7b){logger['error'](_0xc287('0xf'),_0x1c8c6c,_0x56ae7b);_0x123a51(_0x56ae7b);});});}exports['ShowSquareOdbc']=function(_0x29e641){var _0x2f2263=this;return new Promise(function(_0x1a0a0a,_0x296a3c){return db[_0xc287('0x12')][_0xc287('0x13')]({'raw':_0x29e641['options']?_0x29e641['options']['raw']===undefined?!![]:![]:!![],'where':_0x29e641[_0xc287('0x14')]?_0x29e641[_0xc287('0x14')][_0xc287('0x15')]||null:null,'attributes':_0x29e641[_0xc287('0x14')]?_0x29e641[_0xc287('0x14')][_0xc287('0x16')]||null:null,'include':_0x29e641['options']?_0x29e641[_0xc287('0x14')]['include']?_['map'](_0x29e641[_0xc287('0x14')][_0xc287('0x17')],function(_0x5772f4){return{'model':db[_0x5772f4[_0xc287('0x18')]],'as':_0x5772f4['as'],'attributes':_0x5772f4['attributes'],'include':_0x5772f4[_0xc287('0x17')]?_[_0xc287('0x19')](_0x5772f4[_0xc287('0x17')],function(_0x4ccf47){return{'model':db[_0x4ccf47[_0xc287('0x18')]],'as':_0x4ccf47['as'],'attributes':_0x4ccf47['attributes'],'include':_0x4ccf47[_0xc287('0x17')]?_['map'](_0x4ccf47[_0xc287('0x17')],function(_0x55e191){return{'model':db[_0x55e191['model']],'as':_0x55e191['as'],'attributes':_0x55e191[_0xc287('0x16')]};}):[]};}):[]};}):[]:[]})[_0xc287('0x8')](function(_0x5e9a93){logger[_0xc287('0x9')](_0xc287('0x1a'),_0x29e641);logger[_0xc287('0x1b')]('ShowSquareOdbc',_0x29e641,JSON[_0xc287('0xc')](_0x5e9a93));_0x1a0a0a(_0x5e9a93);})['catch'](function(_0x377aa0){logger[_0xc287('0xd')]('ShowSquareOdbc',_0x377aa0[_0xc287('0x10')],_0x29e641);_0x296a3c(_0x2f2263[_0xc287('0xd')](0x1f4,_0x377aa0[_0xc287('0x10')]));});});}; \ No newline at end of file +var _0xa759=['SquareOdbc,\x20%s,\x20%s,\x20%s','error','message','SquareOdbc,\x20%s,\x20%s','catch','ShowSquareOdbc','SquareOdbc','options','where','attributes','include','model','map','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent'];(function(_0x3354d7,_0x5d00d7){var _0x1d548a=function(_0x52e89d){while(--_0x52e89d){_0x3354d7['push'](_0x3354d7['shift']());}};_0x1d548a(++_0x5d00d7);}(_0xa759,0x65));var _0x9a75=function(_0xb17208,_0x16f568){_0xb17208=_0xb17208-0x0;var _0x160444=_0xa759[_0xb17208];return _0x160444;};'use strict';var _=require(_0x9a75('0x0'));var util=require(_0x9a75('0x1'));var moment=require(_0x9a75('0x2'));var BPromise=require(_0x9a75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a75('0x4'));var db=require(_0x9a75('0x5'))['db'];var utils=require(_0x9a75('0x6'));var logger=require(_0x9a75('0x7'))(_0x9a75('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9a75('0x9')][_0x9a75('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x580ec5,_0x35e969,_0x2d36d3){return new BPromise(function(_0x3ca580,_0x2171ee){return client[_0x9a75('0xb')](_0x580ec5,_0x2d36d3)[_0x9a75('0xc')](function(_0x1f382e){logger[_0x9a75('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x35e969,_0x9a75('0xe'));logger['debug'](_0x9a75('0xf'),_0x35e969,'request\x20sent',JSON['stringify'](_0x1f382e));if(_0x1f382e['error']){if(_0x1f382e[_0x9a75('0x10')]['code']===0x1f4){logger[_0x9a75('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x35e969,_0x1f382e[_0x9a75('0x10')][_0x9a75('0x11')]);return _0x2171ee(_0x1f382e[_0x9a75('0x10')][_0x9a75('0x11')]);}logger[_0x9a75('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x35e969,_0x1f382e[_0x9a75('0x10')][_0x9a75('0x11')]);return _0x3ca580(_0x1f382e[_0x9a75('0x10')]['message']);}else{logger[_0x9a75('0xd')](_0x9a75('0x12'),_0x35e969,_0x9a75('0xe'));_0x3ca580(_0x1f382e['result'][_0x9a75('0x11')]);}})[_0x9a75('0x13')](function(_0x320459){logger[_0x9a75('0x10')](_0x9a75('0x12'),_0x35e969,_0x320459);_0x2171ee(_0x320459);});});}exports[_0x9a75('0x14')]=function(_0x331562){var _0x4a7319=this;return new Promise(function(_0xaaabe5,_0x3aaf50){return db[_0x9a75('0x15')]['find']({'raw':_0x331562[_0x9a75('0x16')]?_0x331562['options']['raw']===undefined?!![]:![]:!![],'where':_0x331562[_0x9a75('0x16')]?_0x331562['options'][_0x9a75('0x17')]||null:null,'attributes':_0x331562[_0x9a75('0x16')]?_0x331562[_0x9a75('0x16')][_0x9a75('0x18')]||null:null,'include':_0x331562[_0x9a75('0x16')]?_0x331562[_0x9a75('0x16')][_0x9a75('0x19')]?_['map'](_0x331562['options'][_0x9a75('0x19')],function(_0x539e0f){return{'model':db[_0x539e0f[_0x9a75('0x1a')]],'as':_0x539e0f['as'],'attributes':_0x539e0f[_0x9a75('0x18')],'include':_0x539e0f[_0x9a75('0x19')]?_[_0x9a75('0x1b')](_0x539e0f[_0x9a75('0x19')],function(_0x45461e){return{'model':db[_0x45461e[_0x9a75('0x1a')]],'as':_0x45461e['as'],'attributes':_0x45461e[_0x9a75('0x18')],'include':_0x45461e[_0x9a75('0x19')]?_[_0x9a75('0x1b')](_0x45461e['include'],function(_0xe9696d){return{'model':db[_0xe9696d['model']],'as':_0xe9696d['as'],'attributes':_0xe9696d[_0x9a75('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9a75('0xc')](function(_0xd5b154){logger[_0x9a75('0xd')]('ShowSquareOdbc',_0x331562);logger['debug'](_0x9a75('0x14'),_0x331562,JSON[_0x9a75('0x1c')](_0xd5b154));_0xaaabe5(_0xd5b154);})[_0x9a75('0x13')](function(_0x23117a){logger['error'](_0x9a75('0x14'),_0x23117a[_0x9a75('0x11')],_0x331562);_0x3aaf50(_0x4a7319['error'](0x1f4,_0x23117a[_0x9a75('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 8deff7a..79426a4 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 _0x082f=['isAuthenticated','show','post','create','put','/:id','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0x112038,_0x5cc1cf){var _0x5413ae=function(_0x2d1d55){while(--_0x2d1d55){_0x112038['push'](_0x112038['shift']());}};_0x5413ae(++_0x5cc1cf);}(_0x082f,0x17e));var _0xf082=function(_0xe52657,_0x374354){_0xe52657=_0xe52657-0x0;var _0x4f14ea=_0x082f[_0xe52657];return _0x4f14ea;};'use strict';var multer=require('multer');var util=require(_0xf082('0x0'));var path=require('path');var timeout=require(_0xf082('0x1'));var express=require(_0xf082('0x2'));var router=express['Router']();var fs_extra=require(_0xf082('0x3'));var auth=require(_0xf082('0x4'));var interaction=require(_0xf082('0x5'));var config=require(_0xf082('0x6'));var controller=require(_0xf082('0x7'));router[_0xf082('0x8')]('/',auth[_0xf082('0x9')](),controller['index']);router[_0xf082('0x8')]('/:id',auth[_0xf082('0x9')](),controller[_0xf082('0xa')]);router[_0xf082('0xb')]('/',auth[_0xf082('0x9')](),controller[_0xf082('0xc')]);router[_0xf082('0xd')]('/:id',auth[_0xf082('0x9')](),controller['update']);router['delete'](_0xf082('0xe'),auth[_0xf082('0x9')](),controller[_0xf082('0xf')]);module[_0xf082('0x10')]=router; \ No newline at end of file +var _0xa401=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','post','create','put','/:id','update','delete'];(function(_0x2a7bd0,_0x444e77){var _0x436597=function(_0x50056e){while(--_0x50056e){_0x2a7bd0['push'](_0x2a7bd0['shift']());}};_0x436597(++_0x444e77);}(_0xa401,0x142));var _0x1a40=function(_0x538bdc,_0x2f0281){_0x538bdc=_0x538bdc-0x0;var _0x2c0f2a=_0xa401[_0x538bdc];return _0x2c0f2a;};'use strict';var multer=require(_0x1a40('0x0'));var util=require(_0x1a40('0x1'));var path=require(_0x1a40('0x2'));var timeout=require(_0x1a40('0x3'));var express=require(_0x1a40('0x4'));var router=express[_0x1a40('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1a40('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1a40('0x7'));var controller=require(_0x1a40('0x8'));router['get']('/',auth[_0x1a40('0x9')](),controller[_0x1a40('0xa')]);router[_0x1a40('0xb')]('/:id',auth[_0x1a40('0x9')](),controller['show']);router[_0x1a40('0xc')]('/',auth[_0x1a40('0x9')](),controller[_0x1a40('0xd')]);router[_0x1a40('0xe')](_0x1a40('0xf'),auth[_0x1a40('0x9')](),controller[_0x1a40('0x10')]);router[_0x1a40('0x11')](_0x1a40('0xf'),auth[_0x1a40('0x9')](),controller[_0x1a40('0x12')]);module[_0x1a40('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 53604ad..b1f9727 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 _0x83ff=['BLOB','production','DATE','sequelize','exports','STRING','long','getDataValue','preproduction','toString','utf8'];(function(_0x2561eb,_0x329fb1){var _0x3f2463=function(_0x362443){while(--_0x362443){_0x2561eb['push'](_0x2561eb['shift']());}};_0x3f2463(++_0x329fb1);}(_0x83ff,0x7c));var _0xf83f=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x83ff[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0xf83f('0x0'));module[_0xf83f('0x1')]={'name':{'type':Sequelize[_0xf83f('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0xf83f('0x3')),'get':function(){if(this[_0xf83f('0x4')]('preproduction')){return this[_0xf83f('0x4')](_0xf83f('0x5'))[_0xf83f('0x6')](_0xf83f('0x7'));}}},'production':{'type':Sequelize[_0xf83f('0x8')]('long'),'get':function(){if(this[_0xf83f('0x4')]('production')){return this['getDataValue'](_0xf83f('0x9'))[_0xf83f('0x6')](_0xf83f('0x7'));}}},'savedAt':{'type':Sequelize[_0xf83f('0xa')]},'publishedAt':{'type':Sequelize[_0xf83f('0xa')]}}; \ No newline at end of file +var _0x7847=['toString','utf8','production','DATE','sequelize','exports','name','BLOB','long','preproduction','getDataValue'];(function(_0x136648,_0x2aef53){var _0x5b3352=function(_0x2b41a6){while(--_0x2b41a6){_0x136648['push'](_0x136648['shift']());}};_0x5b3352(++_0x2aef53);}(_0x7847,0xca));var _0x7784=function(_0x20e764,_0x19811d){_0x20e764=_0x20e764-0x0;var _0x4ebc22=_0x7847[_0x20e764];return _0x4ebc22;};'use strict';var Sequelize=require(_0x7784('0x0'));module[_0x7784('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7784('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x7784('0x3')](_0x7784('0x4')),'get':function(){if(this['getDataValue'](_0x7784('0x5'))){return this[_0x7784('0x6')](_0x7784('0x5'))[_0x7784('0x7')](_0x7784('0x8'));}}},'production':{'type':Sequelize[_0x7784('0x3')](_0x7784('0x4')),'get':function(){if(this['getDataValue'](_0x7784('0x9'))){return this[_0x7784('0x6')](_0x7784('0x9'))[_0x7784('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0x7784('0xa')]},'publishedAt':{'type':Sequelize[_0x7784('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 3fd29a3..4347dc2 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 _0xab4e=['sort','where','pick','filter','merge','type','VIRTUAL','SquareProject','include','rows','catch','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','stringify','production','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','localhost','redis','./squareProject.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','get','SquareProjects','UserProfileResource','destroy','then','publish','agi','end','sendStatus','send','rawAttributes','fieldName','key','model','map','name','keys','query','filters','intersection','attributes','fields','nolimit','order'];(function(_0x1b15f5,_0xeb25e7){var _0x63f8f6=function(_0x4e0fab){while(--_0x4e0fab){_0x1b15f5['push'](_0x1b15f5['shift']());}};_0x63f8f6(++_0xeb25e7);}(_0xab4e,0x1ef));var _0xeab4=function(_0x28d09d,_0x17d668){_0x28d09d=_0x28d09d-0x0;var _0x336674=_0xab4e[_0x28d09d];return _0x336674;};'use strict';var _=require('lodash');var Redis=require(_0xeab4('0x0'));var qs=require(_0xeab4('0x1'));var logger=require(_0xeab4('0x2'))('api');var config=require(_0xeab4('0x3'));var db=require(_0xeab4('0x4'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xeab4('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeab4('0x6')]));require(_0xeab4('0x7'))[_0xeab4('0x8')](socket);function respondWithResult(_0x2360d6,_0x2f696c){_0x2f696c=_0x2f696c||0xc8;return function(_0x45a25e){if(_0x45a25e){return _0x2360d6[_0xeab4('0x9')](_0x2f696c)[_0xeab4('0xa')](_0x45a25e);}};}function respondWithFilteredResult(_0x4e45b5,_0x3f1e5a){return function(_0x1a7104){if(_0x1a7104){var _0x404d92=typeof _0x3f1e5a[_0xeab4('0xb')]===_0xeab4('0xc')&&typeof _0x3f1e5a[_0xeab4('0xd')]==='undefined';var _0x13f93b=_0x1a7104[_0xeab4('0xe')];var _0x4a4868=_0x404d92?0x0:_0x3f1e5a[_0xeab4('0xb')];var _0x4633e4=_0x404d92?_0x1a7104[_0xeab4('0xe')]:_0x3f1e5a[_0xeab4('0xb')]+_0x3f1e5a['limit'];var _0xdec4e9;if(_0x4633e4>=_0x13f93b){_0x4633e4=_0x13f93b;_0xdec4e9=0xc8;}else{_0xdec4e9=0xce;}_0x4e45b5[_0xeab4('0x9')](_0xdec4e9);return _0x4e45b5[_0xeab4('0xf')](_0xeab4('0x10'),_0x4a4868+'-'+_0x4633e4+'/'+_0x13f93b)[_0xeab4('0xa')](_0x1a7104);}return null;};}function saveUpdates(_0x256ef7){return function(_0x202363){if(_0x202363){return _0x202363['update'](_0x256ef7)['then'](function(_0x5a6ba9){return _0x5a6ba9;});}return null;};}function removeEntity(_0x1c75c7){return function(_0x371765){if(_0x371765){return _0x371765['destroy']()['then'](function(){var _0xe65a93=_0x371765[_0xeab4('0x11')]({'plain':!![]});var _0x44a2bf=_0xeab4('0x12');return db[_0xeab4('0x13')][_0xeab4('0x14')]({'where':{'type':_0x44a2bf,'resourceId':_0xe65a93['id']}})[_0xeab4('0x15')](function(){return _0x371765;});})[_0xeab4('0x15')](function(){var _0x3a6f7a=new Redis(config['redis']);_0x3a6f7a[_0xeab4('0x16')](_0xeab4('0x17'),JSON['stringify']({'id':_0x371765['id'],'deleted':!![]}));})['then'](function(){_0x1c75c7[_0xeab4('0x9')](0xcc)[_0xeab4('0x18')]();});}};}function handleEntityNotFound(_0x36d07e){return function(_0x36fc35){if(!_0x36fc35){_0x36d07e[_0xeab4('0x19')](0x194);}return _0x36fc35;};}function handleError(_0x38762f,_0x27b0cf){_0x27b0cf=_0x27b0cf||0x1f4;return function(_0x5d7dd5){logger['error'](_0x5d7dd5['stack']);if(_0x5d7dd5['name']){delete _0x5d7dd5['name'];}_0x38762f[_0xeab4('0x9')](_0x27b0cf)[_0xeab4('0x1a')](_0x5d7dd5);};}exports['index']=function(_0x5aef45,_0x145fac){var _0x4337d7={},_0x2ffbe4={},_0x24c75a={'count':0x0,'rows':[]};var _0x5377ae=_['map'](db['SquareProject'][_0xeab4('0x1b')],function(_0x2af0c6){return{'name':_0x2af0c6[_0xeab4('0x1c')],'type':_0x2af0c6['type'][_0xeab4('0x1d')]};});_0x2ffbe4[_0xeab4('0x1e')]=_[_0xeab4('0x1f')](_0x5377ae,_0xeab4('0x20'));_0x2ffbe4['query']=_[_0xeab4('0x21')](_0x5aef45[_0xeab4('0x22')]);_0x2ffbe4[_0xeab4('0x23')]=_[_0xeab4('0x24')](_0x2ffbe4['model'],_0x2ffbe4[_0xeab4('0x22')]);_0x4337d7[_0xeab4('0x25')]=_[_0xeab4('0x24')](_0x2ffbe4['model'],qs[_0xeab4('0x26')](_0x5aef45['query']['fields']));_0x4337d7['attributes']=_0x4337d7[_0xeab4('0x25')]['length']?_0x4337d7[_0xeab4('0x25')]:_0x2ffbe4[_0xeab4('0x1e')];if(!_0x5aef45[_0xeab4('0x22')]['hasOwnProperty'](_0xeab4('0x27'))){_0x4337d7[_0xeab4('0xd')]=qs['limit'](_0x5aef45[_0xeab4('0x22')]['limit']);_0x4337d7[_0xeab4('0xb')]=qs[_0xeab4('0xb')](_0x5aef45['query'][_0xeab4('0xb')]);}_0x4337d7[_0xeab4('0x28')]=qs[_0xeab4('0x29')](_0x5aef45['query'][_0xeab4('0x29')]);_0x4337d7[_0xeab4('0x2a')]=qs['filters'](_[_0xeab4('0x2b')](_0x5aef45['query'],_0x2ffbe4['filters']),_0x5377ae);if(_0x5aef45[_0xeab4('0x22')][_0xeab4('0x2c')]){_0x4337d7['where']=_[_0xeab4('0x2d')](_0x4337d7[_0xeab4('0x2a')],{'$or':_[_0xeab4('0x1f')](_0x5377ae,function(_0x3ffc1a){if(_0x3ffc1a[_0xeab4('0x2e')]!==_0xeab4('0x2f')){var _0x1fc513={};_0x1fc513[_0x3ffc1a[_0xeab4('0x20')]]={'$like':'%'+_0x5aef45['query'][_0xeab4('0x2c')]+'%'};return _0x1fc513;}})});}_0x4337d7=_[_0xeab4('0x2d')]({},_0x4337d7,_0x5aef45['options']);var _0x46b5ba={'where':_0x4337d7[_0xeab4('0x2a')]};return db[_0xeab4('0x30')][_0xeab4('0xe')](_0x46b5ba)[_0xeab4('0x15')](function(_0x39ec39){_0x24c75a[_0xeab4('0xe')]=_0x39ec39;if(_0x5aef45['query']['includeAll']){_0x4337d7[_0xeab4('0x31')]=[{'all':!![]}];}return db[_0xeab4('0x30')]['findAll'](_0x4337d7);})[_0xeab4('0x15')](function(_0x460a2d){_0x24c75a[_0xeab4('0x32')]=_0x460a2d;return _0x24c75a;})[_0xeab4('0x15')](respondWithFilteredResult(_0x145fac,_0x4337d7))[_0xeab4('0x33')](handleError(_0x145fac,null));};exports['show']=function(_0x4dace3,_0x1b01c2){var _0x4f2e78={'raw':![],'where':{'id':_0x4dace3['params']['id']}},_0x37de97={};_0x37de97[_0xeab4('0x1e')]=_[_0xeab4('0x21')](db[_0xeab4('0x30')][_0xeab4('0x1b')]);_0x37de97[_0xeab4('0x22')]=_['keys'](_0x4dace3['query']);_0x37de97[_0xeab4('0x23')]=_[_0xeab4('0x24')](_0x37de97[_0xeab4('0x1e')],_0x37de97['query']);_0x4f2e78[_0xeab4('0x25')]=_[_0xeab4('0x24')](_0x37de97[_0xeab4('0x1e')],qs[_0xeab4('0x26')](_0x4dace3[_0xeab4('0x22')]['fields']));_0x4f2e78[_0xeab4('0x25')]=_0x4f2e78['attributes'][_0xeab4('0x34')]?_0x4f2e78['attributes']:_0x37de97['model'];if(_0x4dace3[_0xeab4('0x22')]['includeAll']){_0x4f2e78[_0xeab4('0x31')]=[{'all':!![]}];}_0x4f2e78=_[_0xeab4('0x2d')]({},_0x4f2e78,_0x4dace3[_0xeab4('0x35')]);return db[_0xeab4('0x30')][_0xeab4('0x36')](_0x4f2e78)[_0xeab4('0x15')](handleEntityNotFound(_0x1b01c2,null))[_0xeab4('0x15')](respondWithResult(_0x1b01c2,null))['catch'](handleError(_0x1b01c2,null));};exports[_0xeab4('0x37')]=function(_0x568422,_0x15c6bc){return db[_0xeab4('0x30')][_0xeab4('0x37')](_0x568422[_0xeab4('0x38')],{})['then'](function(_0x3d1ea9){var _0x2d09af=_0x568422[_0xeab4('0x39')][_0xeab4('0x11')]({'plain':!![]});if(!_0x2d09af)throw new Error(_0xeab4('0x3a'));if(_0x2d09af['role']===_0xeab4('0x39')){var _0x436230=_0x3d1ea9[_0xeab4('0x11')]({'plain':!![]});var _0x144225=_0xeab4('0x12');return db[_0xeab4('0x3b')][_0xeab4('0x36')]({'where':{'name':_0x144225,'userProfileId':_0x2d09af[_0xeab4('0x3c')]},'raw':!![]})[_0xeab4('0x15')](function(_0x4871ce){if(_0x4871ce&&_0x4871ce['autoAssociation']===0x0){return db[_0xeab4('0x13')][_0xeab4('0x37')]({'name':_0x436230[_0xeab4('0x20')],'resourceId':_0x436230['id'],'type':_0x4871ce[_0xeab4('0x20')],'sectionId':_0x4871ce['id']},{})[_0xeab4('0x15')](function(){return _0x3d1ea9;});}else{return _0x3d1ea9;}})[_0xeab4('0x33')](function(_0x37efba){logger[_0xeab4('0x3d')](_0xeab4('0x3e'),_0x37efba);throw _0x37efba;});}return _0x3d1ea9;})[_0xeab4('0x15')](respondWithResult(_0x15c6bc,0xc9))[_0xeab4('0x33')](handleError(_0x15c6bc,null));};exports[_0xeab4('0x3f')]=function(_0x5e1446,_0x42e529){if(_0x5e1446[_0xeab4('0x38')]['id']){delete _0x5e1446[_0xeab4('0x38')]['id'];}return db['SquareProject'][_0xeab4('0x36')]({'where':{'id':_0x5e1446[_0xeab4('0x40')]['id']}})[_0xeab4('0x15')](handleEntityNotFound(_0x42e529,null))[_0xeab4('0x15')](saveUpdates(_0x5e1446[_0xeab4('0x38')],null))[_0xeab4('0x15')](function(_0x10c210){if(!_0x10c210)return;var _0x5b4293=_0x10c210[_0xeab4('0x11')]({'plain':!![]});return _0x5b4293;})[_0xeab4('0x15')](function(_0x3d7358){var _0xac156d=new Redis(config[_0xeab4('0x6')]);_0xac156d[_0xeab4('0x16')](_0xeab4('0x17'),JSON[_0xeab4('0x41')](_[_0xeab4('0x2b')](_0x3d7358,['id','name',_0xeab4('0x42')])));return _0x3d7358;})[_0xeab4('0x15')](respondWithResult(_0x42e529,null))[_0xeab4('0x33')](handleError(_0x42e529,null));};exports[_0xeab4('0x14')]=function(_0x19d21b,_0x4028db){return db[_0xeab4('0x30')][_0xeab4('0x36')]({'where':{'id':_0x19d21b['params']['id']}})[_0xeab4('0x15')](handleEntityNotFound(_0x4028db,null))[_0xeab4('0x15')](removeEntity(_0x4028db,null))[_0xeab4('0x33')](handleError(_0x4028db,null));}; \ No newline at end of file +var _0x752f=['offset','update','destroy','then','SquareProjects','UserProfileResource','publish','stringify','end','sendStatus','error','stack','name','send','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','rows','catch','params','options','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','body','pick','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','json','undefined','limit','count'];(function(_0x2b4ae1,_0x5caafe){var _0x10fe1a=function(_0x251ec4){while(--_0x251ec4){_0x2b4ae1['push'](_0x2b4ae1['shift']());}};_0x10fe1a(++_0x5caafe);}(_0x752f,0x140));var _0xf752=function(_0x11d5a5,_0x425fe5){_0x11d5a5=_0x11d5a5-0x0;var _0x1ad4e8=_0x752f[_0x11d5a5];return _0x1ad4e8;};'use strict';var _=require(_0xf752('0x0'));var Redis=require(_0xf752('0x1'));var qs=require(_0xf752('0x2'));var logger=require(_0xf752('0x3'))('api');var config=require('../../config/environment');var db=require(_0xf752('0x4'))['db'];config['redis']=_['defaults'](config[_0xf752('0x5')],{'host':_0xf752('0x6'),'port':0x18eb});var socket=require(_0xf752('0x7'))(new Redis(config[_0xf752('0x5')]));require(_0xf752('0x8'))[_0xf752('0x9')](socket);function respondWithResult(_0x598126,_0x14d39f){_0x14d39f=_0x14d39f||0xc8;return function(_0x4e3b96){if(_0x4e3b96){return _0x598126[_0xf752('0xa')](_0x14d39f)[_0xf752('0xb')](_0x4e3b96);}};}function respondWithFilteredResult(_0x1a44f1,_0x52c063){return function(_0x54d285){if(_0x54d285){var _0x48302e=typeof _0x52c063['offset']===_0xf752('0xc')&&typeof _0x52c063[_0xf752('0xd')]===_0xf752('0xc');var _0x5295ab=_0x54d285[_0xf752('0xe')];var _0x35d678=_0x48302e?0x0:_0x52c063[_0xf752('0xf')];var _0x329560=_0x48302e?_0x54d285[_0xf752('0xe')]:_0x52c063[_0xf752('0xf')]+_0x52c063['limit'];var _0xaaa4b9;if(_0x329560>=_0x5295ab){_0x329560=_0x5295ab;_0xaaa4b9=0xc8;}else{_0xaaa4b9=0xce;}_0x1a44f1[_0xf752('0xa')](_0xaaa4b9);return _0x1a44f1['set']('Content-Range',_0x35d678+'-'+_0x329560+'/'+_0x5295ab)['json'](_0x54d285);}return null;};}function saveUpdates(_0x468b2d){return function(_0x422da6){if(_0x422da6){return _0x422da6[_0xf752('0x10')](_0x468b2d)['then'](function(_0x284662){return _0x284662;});}return null;};}function removeEntity(_0x7846a8){return function(_0x2aab89){if(_0x2aab89){return _0x2aab89[_0xf752('0x11')]()[_0xf752('0x12')](function(){var _0x258e14=_0x2aab89['get']({'plain':!![]});var _0x597f4e=_0xf752('0x13');return db[_0xf752('0x14')][_0xf752('0x11')]({'where':{'type':_0x597f4e,'resourceId':_0x258e14['id']}})[_0xf752('0x12')](function(){return _0x2aab89;});})[_0xf752('0x12')](function(){var _0x2d0ff9=new Redis(config[_0xf752('0x5')]);_0x2d0ff9[_0xf752('0x15')]('agi',JSON[_0xf752('0x16')]({'id':_0x2aab89['id'],'deleted':!![]}));})['then'](function(){_0x7846a8[_0xf752('0xa')](0xcc)[_0xf752('0x17')]();});}};}function handleEntityNotFound(_0x1944d8){return function(_0xb11041){if(!_0xb11041){_0x1944d8[_0xf752('0x18')](0x194);}return _0xb11041;};}function handleError(_0x3c22e7,_0x280539){_0x280539=_0x280539||0x1f4;return function(_0x5d02cc){logger[_0xf752('0x19')](_0x5d02cc[_0xf752('0x1a')]);if(_0x5d02cc[_0xf752('0x1b')]){delete _0x5d02cc[_0xf752('0x1b')];}_0x3c22e7[_0xf752('0xa')](_0x280539)[_0xf752('0x1c')](_0x5d02cc);};}exports['index']=function(_0x1f632c,_0x2b2d93){var _0x384d4c={},_0x1dbca4={},_0x11f4e5={'count':0x0,'rows':[]};var _0xbb5d5a=_[_0xf752('0x1d')](db[_0xf752('0x1e')][_0xf752('0x1f')],function(_0x22a478){return{'name':_0x22a478[_0xf752('0x20')],'type':_0x22a478[_0xf752('0x21')][_0xf752('0x22')]};});_0x1dbca4[_0xf752('0x23')]=_[_0xf752('0x1d')](_0xbb5d5a,_0xf752('0x1b'));_0x1dbca4[_0xf752('0x24')]=_[_0xf752('0x25')](_0x1f632c[_0xf752('0x24')]);_0x1dbca4[_0xf752('0x26')]=_[_0xf752('0x27')](_0x1dbca4[_0xf752('0x23')],_0x1dbca4[_0xf752('0x24')]);_0x384d4c['attributes']=_['intersection'](_0x1dbca4[_0xf752('0x23')],qs[_0xf752('0x28')](_0x1f632c[_0xf752('0x24')]['fields']));_0x384d4c[_0xf752('0x29')]=_0x384d4c[_0xf752('0x29')][_0xf752('0x2a')]?_0x384d4c[_0xf752('0x29')]:_0x1dbca4[_0xf752('0x23')];if(!_0x1f632c[_0xf752('0x24')][_0xf752('0x2b')](_0xf752('0x2c'))){_0x384d4c['limit']=qs[_0xf752('0xd')](_0x1f632c['query']['limit']);_0x384d4c[_0xf752('0xf')]=qs[_0xf752('0xf')](_0x1f632c['query'][_0xf752('0xf')]);}_0x384d4c[_0xf752('0x2d')]=qs[_0xf752('0x2e')](_0x1f632c[_0xf752('0x24')][_0xf752('0x2e')]);_0x384d4c[_0xf752('0x2f')]=qs['filters'](_['pick'](_0x1f632c['query'],_0x1dbca4['filters']),_0xbb5d5a);if(_0x1f632c[_0xf752('0x24')][_0xf752('0x30')]){_0x384d4c[_0xf752('0x2f')]=_[_0xf752('0x31')](_0x384d4c[_0xf752('0x2f')],{'$or':_[_0xf752('0x1d')](_0xbb5d5a,function(_0x10d238){if(_0x10d238[_0xf752('0x21')]!==_0xf752('0x32')){var _0x3d018d={};_0x3d018d[_0x10d238['name']]={'$like':'%'+_0x1f632c[_0xf752('0x24')]['filter']+'%'};return _0x3d018d;}})});}_0x384d4c=_[_0xf752('0x31')]({},_0x384d4c,_0x1f632c['options']);var _0x1da063={'where':_0x384d4c['where']};return db[_0xf752('0x1e')][_0xf752('0xe')](_0x1da063)[_0xf752('0x12')](function(_0x20d146){_0x11f4e5['count']=_0x20d146;if(_0x1f632c[_0xf752('0x24')]['includeAll']){_0x384d4c[_0xf752('0x33')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x384d4c);})[_0xf752('0x12')](function(_0x5e6a9b){_0x11f4e5[_0xf752('0x34')]=_0x5e6a9b;return _0x11f4e5;})[_0xf752('0x12')](respondWithFilteredResult(_0x2b2d93,_0x384d4c))[_0xf752('0x35')](handleError(_0x2b2d93,null));};exports['show']=function(_0x52c213,_0x60577e){var _0x3d8d1e={'raw':![],'where':{'id':_0x52c213[_0xf752('0x36')]['id']}},_0x146d82={};_0x146d82[_0xf752('0x23')]=_[_0xf752('0x25')](db[_0xf752('0x1e')]['rawAttributes']);_0x146d82[_0xf752('0x24')]=_[_0xf752('0x25')](_0x52c213['query']);_0x146d82['filters']=_[_0xf752('0x27')](_0x146d82['model'],_0x146d82['query']);_0x3d8d1e[_0xf752('0x29')]=_[_0xf752('0x27')](_0x146d82['model'],qs[_0xf752('0x28')](_0x52c213[_0xf752('0x24')][_0xf752('0x28')]));_0x3d8d1e['attributes']=_0x3d8d1e[_0xf752('0x29')][_0xf752('0x2a')]?_0x3d8d1e[_0xf752('0x29')]:_0x146d82[_0xf752('0x23')];if(_0x52c213[_0xf752('0x24')]['includeAll']){_0x3d8d1e['include']=[{'all':!![]}];}_0x3d8d1e=_[_0xf752('0x31')]({},_0x3d8d1e,_0x52c213[_0xf752('0x37')]);return db[_0xf752('0x1e')][_0xf752('0x38')](_0x3d8d1e)[_0xf752('0x12')](handleEntityNotFound(_0x60577e,null))[_0xf752('0x12')](respondWithResult(_0x60577e,null))[_0xf752('0x35')](handleError(_0x60577e,null));};exports['create']=function(_0x42a739,_0x91dac5){return db['SquareProject']['create'](_0x42a739['body'],{})['then'](function(_0x211751){var _0x770578=_0x42a739[_0xf752('0x39')][_0xf752('0x3a')]({'plain':!![]});if(!_0x770578)throw new Error(_0xf752('0x3b'));if(_0x770578[_0xf752('0x3c')]===_0xf752('0x39')){var _0x3a2235=_0x211751['get']({'plain':!![]});var _0x2fbfbd=_0xf752('0x13');return db[_0xf752('0x3d')][_0xf752('0x38')]({'where':{'name':_0x2fbfbd,'userProfileId':_0x770578[_0xf752('0x3e')]},'raw':!![]})[_0xf752('0x12')](function(_0x5cb652){if(_0x5cb652&&_0x5cb652['autoAssociation']===0x0){return db[_0xf752('0x14')][_0xf752('0x3f')]({'name':_0x3a2235[_0xf752('0x1b')],'resourceId':_0x3a2235['id'],'type':_0x5cb652[_0xf752('0x1b')],'sectionId':_0x5cb652['id']},{})[_0xf752('0x12')](function(){return _0x211751;});}else{return _0x211751;}})[_0xf752('0x35')](function(_0x4c9439){logger[_0xf752('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c9439);throw _0x4c9439;});}return _0x211751;})['then'](respondWithResult(_0x91dac5,0xc9))['catch'](handleError(_0x91dac5,null));};exports[_0xf752('0x10')]=function(_0x3b4f72,_0x41d849){if(_0x3b4f72[_0xf752('0x40')]['id']){delete _0x3b4f72[_0xf752('0x40')]['id'];}return db[_0xf752('0x1e')][_0xf752('0x38')]({'where':{'id':_0x3b4f72['params']['id']}})[_0xf752('0x12')](handleEntityNotFound(_0x41d849,null))[_0xf752('0x12')](saveUpdates(_0x3b4f72['body'],null))[_0xf752('0x12')](function(_0x204979){if(!_0x204979)return;var _0x2af0f0=_0x204979[_0xf752('0x3a')]({'plain':!![]});return _0x2af0f0;})[_0xf752('0x12')](function(_0x2b1598){var _0x14e5f5=new Redis(config[_0xf752('0x5')]);_0x14e5f5[_0xf752('0x15')]('agi',JSON[_0xf752('0x16')](_[_0xf752('0x41')](_0x2b1598,['id',_0xf752('0x1b'),_0xf752('0x42')])));return _0x2b1598;})[_0xf752('0x12')](respondWithResult(_0x41d849,null))[_0xf752('0x35')](handleError(_0x41d849,null));};exports[_0xf752('0x11')]=function(_0x35c309,_0x325bd8){return db[_0xf752('0x1e')][_0xf752('0x38')]({'where':{'id':_0x35c309[_0xf752('0x36')]['id']}})[_0xf752('0x12')](handleEntityNotFound(_0x325bd8,null))[_0xf752('0x12')](removeEntity(_0x325bd8,null))[_0xf752('0x35')](handleError(_0x325bd8,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 0284374..dd00dcb 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 _0xb63b=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x43daa3,_0x1d286d){var _0x3f3c8f=function(_0x481ea8){while(--_0x481ea8){_0x43daa3['push'](_0x43daa3['shift']());}};_0x3f3c8f(++_0x1d286d);}(_0xb63b,0x1bf));var _0xbb63=function(_0x43381d,_0x46eeb2){_0x43381d=_0x43381d-0x0;var _0x25690e=_0xb63b[_0x43381d];return _0x25690e;};'use strict';var EventEmitter=require(_0xbb63('0x0'));var SquareProject=require(_0xbb63('0x1'))['db'][_0xbb63('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xbb63('0x3')](0x0);var events={'afterCreate':_0xbb63('0x4'),'afterUpdate':_0xbb63('0x5'),'afterDestroy':_0xbb63('0x6')};function emitEvent(_0xe2d320){return function(_0x565d21,_0x491a45,_0x23583e){SquareProjectEvents[_0xbb63('0x7')](_0xe2d320+':'+_0x565d21['id'],_0x565d21);SquareProjectEvents[_0xbb63('0x7')](_0xe2d320,_0x565d21);_0x23583e(null);};}for(var e in events){if(events[_0xbb63('0x8')](e)){var event=events[e];SquareProject[_0xbb63('0x9')](e,emitEvent(event));}}module[_0xbb63('0xa')]=SquareProjectEvents; \ No newline at end of file +var _0xe890=['events','../../mysqldb','SquareProject','save','update','emit','hook','exports'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0xe890,0x188));var _0x0e89=function(_0x2466c9,_0x5e872c){_0x2466c9=_0x2466c9-0x0;var _0x503c9d=_0xe890[_0x2466c9];return _0x503c9d;};'use strict';var EventEmitter=require(_0x0e89('0x0'));var SquareProject=require(_0x0e89('0x1'))['db'][_0x0e89('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0e89('0x3'),'afterUpdate':_0x0e89('0x4'),'afterDestroy':'remove'};function emitEvent(_0x17e169){return function(_0xe1a148,_0x24a0c8,_0x5aa3f0){SquareProjectEvents[_0x0e89('0x5')](_0x17e169+':'+_0xe1a148['id'],_0xe1a148);SquareProjectEvents[_0x0e89('0x5')](_0x17e169,_0xe1a148);_0x5aa3f0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x0e89('0x6')](e,emitEvent(event));}}module[_0x0e89('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index dbe01b8..a6f6c1c 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 _0x7b09=['SquareProject','changed','preproduction','savedAt','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x7b09,0x1c2));var _0x97b0=function(_0x44edd2,_0x378887){_0x44edd2=_0x44edd2-0x0;var _0x255ee3=_0x7b09[_0x44edd2];return _0x255ee3;};'use strict';var _=require(_0x97b0('0x0'));var util=require(_0x97b0('0x1'));var logger=require(_0x97b0('0x2'))(_0x97b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x97b0('0x4'));var rimraf=require(_0x97b0('0x5'));var config=require(_0x97b0('0x6'));var attributes=require('./squareProject.attributes');module[_0x97b0('0x7')]=function(_0x4b0423,_0x406bff){return _0x4b0423[_0x97b0('0x8')](_0x97b0('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29d4c1,_0x2a01a9,_0x55e97b){if(_0x29d4c1[_0x97b0('0xa')](_0x97b0('0xb'))){_0x29d4c1[_0x97b0('0xc')]=moment()[_0x97b0('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x29d4c1[_0x97b0('0xa')](_0x97b0('0xe'))){_0x29d4c1[_0x97b0('0xf')]=moment()['format'](_0x97b0('0x10'));}_0x55e97b(null,_0x29d4c1);}}});}; \ No newline at end of file +var _0x212e=['square_projects','changed','preproduction','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./squareProject.attributes','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x212e,0x97));var _0xe212=function(_0x3db7ac,_0x4b9b9c){_0x3db7ac=_0x3db7ac-0x0;var _0x390337=_0x212e[_0x3db7ac];return _0x390337;};'use strict';var _=require(_0xe212('0x0'));var util=require(_0xe212('0x1'));var logger=require(_0xe212('0x2'))('api');var moment=require(_0xe212('0x3'));var BPromise=require(_0xe212('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe212('0x5'));var config=require(_0xe212('0x6'));var attributes=require(_0xe212('0x7'));module['exports']=function(_0x268b85,_0x595e1d){return _0x268b85[_0xe212('0x8')]('SquareProject',attributes,{'tableName':_0xe212('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x12683e,_0x2a7a39,_0x47bf22){if(_0x12683e[_0xe212('0xa')](_0xe212('0xb'))){_0x12683e['savedAt']=moment()[_0xe212('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x12683e['changed'](_0xe212('0xd'))){_0x12683e[_0xe212('0xe')]=moment()[_0xe212('0xc')](_0xe212('0xf'));}_0x47bf22(null,_0x12683e);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 8526d5c..38374b6 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 _0x50f8=['info','stringify','catch','error','message','ShowSquareProject','debug','ioredis','../../mysqldb','../../config/logger','rpc','defaults','localhost','socket.io-emitter','redis','./squareProject.socket','register','GetSquareProjects','findAll','options','raw','where','attributes','map','model','include','then'];(function(_0x11e2f9,_0x45c816){var _0x53310f=function(_0x460cd8){while(--_0x460cd8){_0x11e2f9['push'](_0x11e2f9['shift']());}};_0x53310f(++_0x45c816);}(_0x50f8,0x8e));var _0x850f=function(_0x5a84f8,_0x245cbe){_0x5a84f8=_0x5a84f8-0x0;var _0x247d73=_0x50f8[_0x5a84f8];return _0x247d73;};'use strict';var _=require('lodash');var Redis=require(_0x850f('0x0'));var db=require(_0x850f('0x1'))['db'];var logger=require(_0x850f('0x2'))(_0x850f('0x3'));var config=require('../../config/environment');config['redis']=_[_0x850f('0x4')](config['redis'],{'host':_0x850f('0x5'),'port':0x18eb});var socket=require(_0x850f('0x6'))(new Redis(config[_0x850f('0x7')]));require(_0x850f('0x8'))[_0x850f('0x9')](socket);exports[_0x850f('0xa')]=function(_0x5bdbf0){var _0x515fb4=this;return new Promise(function(_0x3ef8ea,_0x1b72de){return db['SquareProject'][_0x850f('0xb')]({'raw':_0x5bdbf0[_0x850f('0xc')]?_0x5bdbf0['options'][_0x850f('0xd')]===undefined?!![]:![]:!![],'where':_0x5bdbf0['options']?_0x5bdbf0['options'][_0x850f('0xe')]||null:null,'attributes':_0x5bdbf0[_0x850f('0xc')]?_0x5bdbf0[_0x850f('0xc')][_0x850f('0xf')]||null:null,'limit':_0x5bdbf0[_0x850f('0xc')]?_0x5bdbf0['options']['limit']||null:null,'include':_0x5bdbf0[_0x850f('0xc')]?_0x5bdbf0[_0x850f('0xc')]['include']?_[_0x850f('0x10')](_0x5bdbf0[_0x850f('0xc')]['include'],function(_0x100a36){return{'model':db[_0x100a36[_0x850f('0x11')]],'as':_0x100a36['as'],'attributes':_0x100a36['attributes'],'include':_0x100a36[_0x850f('0x12')]?_['map'](_0x100a36[_0x850f('0x12')],function(_0x47f91a){return{'model':db[_0x47f91a[_0x850f('0x11')]],'as':_0x47f91a['as'],'attributes':_0x47f91a['attributes'],'include':_0x47f91a[_0x850f('0x12')]?_[_0x850f('0x10')](_0x47f91a[_0x850f('0x12')],function(_0x2bf7f9){return{'model':db[_0x2bf7f9[_0x850f('0x11')]],'as':_0x2bf7f9['as'],'attributes':_0x2bf7f9[_0x850f('0xf')]};}):[]};}):[]};}):[]:[]})[_0x850f('0x13')](function(_0x44b311){logger[_0x850f('0x14')](_0x850f('0xa'),_0x5bdbf0);logger['debug']('GetSquareProjects',_0x5bdbf0,JSON[_0x850f('0x15')](_0x44b311));_0x3ef8ea(_0x44b311);})[_0x850f('0x16')](function(_0x41c891){logger[_0x850f('0x17')](_0x850f('0xa'),_0x41c891[_0x850f('0x18')],_0x5bdbf0);_0x1b72de(_0x515fb4[_0x850f('0x17')](0x1f4,_0x41c891['message']));});});};exports['ShowSquareProject']=function(_0xbcce04){var _0x234754=this;return new Promise(function(_0x3c8cc0,_0x4f0c92){return db['SquareProject']['find']({'raw':_0xbcce04[_0x850f('0xc')]?_0xbcce04[_0x850f('0xc')][_0x850f('0xd')]===undefined?!![]:![]:!![],'where':_0xbcce04[_0x850f('0xc')]?_0xbcce04[_0x850f('0xc')][_0x850f('0xe')]||null:null,'attributes':_0xbcce04[_0x850f('0xc')]?_0xbcce04[_0x850f('0xc')][_0x850f('0xf')]||null:null,'include':_0xbcce04[_0x850f('0xc')]?_0xbcce04[_0x850f('0xc')]['include']?_['map'](_0xbcce04['options'][_0x850f('0x12')],function(_0x4b6fcd){return{'model':db[_0x4b6fcd[_0x850f('0x11')]],'as':_0x4b6fcd['as'],'attributes':_0x4b6fcd[_0x850f('0xf')],'include':_0x4b6fcd[_0x850f('0x12')]?_[_0x850f('0x10')](_0x4b6fcd[_0x850f('0x12')],function(_0x52195c){return{'model':db[_0x52195c[_0x850f('0x11')]],'as':_0x52195c['as'],'attributes':_0x52195c[_0x850f('0xf')],'include':_0x52195c[_0x850f('0x12')]?_[_0x850f('0x10')](_0x52195c[_0x850f('0x12')],function(_0x20b1c7){return{'model':db[_0x20b1c7[_0x850f('0x11')]],'as':_0x20b1c7['as'],'attributes':_0x20b1c7[_0x850f('0xf')]};}):[]};}):[]};}):[]:[]})[_0x850f('0x13')](function(_0x4b72ec){logger['info'](_0x850f('0x19'),_0xbcce04);logger[_0x850f('0x1a')](_0x850f('0x19'),_0xbcce04,JSON[_0x850f('0x15')](_0x4b72ec));_0x3c8cc0(_0x4b72ec);})[_0x850f('0x16')](function(_0x171876){logger[_0x850f('0x17')]('ShowSquareProject',_0x171876['message'],_0xbcce04);_0x4f0c92(_0x234754['error'](0x1f4,_0x171876[_0x850f('0x18')]));});});}; \ No newline at end of file +var _0x3a08=['find','debug','stringify','lodash','../../mysqldb','rpc','redis','defaults','socket.io-emitter','./squareProject.socket','register','SquareProject','findAll','options','raw','where','attributes','limit','include','map','model','then','info','GetSquareProjects','catch','error','message','ShowSquareProject'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3a08,0xe3));var _0x83a0=function(_0x3d3b0a,_0x409c4b){_0x3d3b0a=_0x3d3b0a-0x0;var _0x16dff1=_0x3a08[_0x3d3b0a];return _0x16dff1;};'use strict';var _=require(_0x83a0('0x0'));var Redis=require('ioredis');var db=require(_0x83a0('0x1'))['db'];var logger=require('../../config/logger')(_0x83a0('0x2'));var config=require('../../config/environment');config[_0x83a0('0x3')]=_[_0x83a0('0x4')](config[_0x83a0('0x3')],{'host':'localhost','port':0x18eb});var socket=require(_0x83a0('0x5'))(new Redis(config[_0x83a0('0x3')]));require(_0x83a0('0x6'))[_0x83a0('0x7')](socket);exports['GetSquareProjects']=function(_0x3d26b9){var _0x880821=this;return new Promise(function(_0x386853,_0x409947){return db[_0x83a0('0x8')][_0x83a0('0x9')]({'raw':_0x3d26b9[_0x83a0('0xa')]?_0x3d26b9[_0x83a0('0xa')][_0x83a0('0xb')]===undefined?!![]:![]:!![],'where':_0x3d26b9[_0x83a0('0xa')]?_0x3d26b9['options'][_0x83a0('0xc')]||null:null,'attributes':_0x3d26b9[_0x83a0('0xa')]?_0x3d26b9[_0x83a0('0xa')][_0x83a0('0xd')]||null:null,'limit':_0x3d26b9['options']?_0x3d26b9[_0x83a0('0xa')][_0x83a0('0xe')]||null:null,'include':_0x3d26b9['options']?_0x3d26b9['options'][_0x83a0('0xf')]?_[_0x83a0('0x10')](_0x3d26b9[_0x83a0('0xa')][_0x83a0('0xf')],function(_0x19b913){return{'model':db[_0x19b913['model']],'as':_0x19b913['as'],'attributes':_0x19b913['attributes'],'include':_0x19b913['include']?_['map'](_0x19b913[_0x83a0('0xf')],function(_0x2d43cf){return{'model':db[_0x2d43cf['model']],'as':_0x2d43cf['as'],'attributes':_0x2d43cf[_0x83a0('0xd')],'include':_0x2d43cf[_0x83a0('0xf')]?_[_0x83a0('0x10')](_0x2d43cf['include'],function(_0x3083c1){return{'model':db[_0x3083c1[_0x83a0('0x11')]],'as':_0x3083c1['as'],'attributes':_0x3083c1[_0x83a0('0xd')]};}):[]};}):[]};}):[]:[]})[_0x83a0('0x12')](function(_0x19fced){logger[_0x83a0('0x13')]('GetSquareProjects',_0x3d26b9);logger['debug'](_0x83a0('0x14'),_0x3d26b9,JSON['stringify'](_0x19fced));_0x386853(_0x19fced);})[_0x83a0('0x15')](function(_0x5622c8){logger[_0x83a0('0x16')]('GetSquareProjects',_0x5622c8[_0x83a0('0x17')],_0x3d26b9);_0x409947(_0x880821[_0x83a0('0x16')](0x1f4,_0x5622c8[_0x83a0('0x17')]));});});};exports[_0x83a0('0x18')]=function(_0x864de0){var _0x1106b8=this;return new Promise(function(_0x21cf7e,_0x295256){return db['SquareProject'][_0x83a0('0x19')]({'raw':_0x864de0[_0x83a0('0xa')]?_0x864de0[_0x83a0('0xa')][_0x83a0('0xb')]===undefined?!![]:![]:!![],'where':_0x864de0[_0x83a0('0xa')]?_0x864de0['options'][_0x83a0('0xc')]||null:null,'attributes':_0x864de0['options']?_0x864de0[_0x83a0('0xa')][_0x83a0('0xd')]||null:null,'include':_0x864de0[_0x83a0('0xa')]?_0x864de0[_0x83a0('0xa')][_0x83a0('0xf')]?_['map'](_0x864de0[_0x83a0('0xa')]['include'],function(_0x3cf537){return{'model':db[_0x3cf537['model']],'as':_0x3cf537['as'],'attributes':_0x3cf537['attributes'],'include':_0x3cf537[_0x83a0('0xf')]?_[_0x83a0('0x10')](_0x3cf537[_0x83a0('0xf')],function(_0x1627f6){return{'model':db[_0x1627f6[_0x83a0('0x11')]],'as':_0x1627f6['as'],'attributes':_0x1627f6[_0x83a0('0xd')],'include':_0x1627f6[_0x83a0('0xf')]?_[_0x83a0('0x10')](_0x1627f6['include'],function(_0x372724){return{'model':db[_0x372724[_0x83a0('0x11')]],'as':_0x372724['as'],'attributes':_0x372724['attributes']};}):[]};}):[]};}):[]:[]})[_0x83a0('0x12')](function(_0x49b711){logger[_0x83a0('0x13')]('ShowSquareProject',_0x864de0);logger[_0x83a0('0x1a')](_0x83a0('0x18'),_0x864de0,JSON[_0x83a0('0x1b')](_0x49b711));_0x21cf7e(_0x49b711);})[_0x83a0('0x15')](function(_0x6c211c){logger['error'](_0x83a0('0x18'),_0x6c211c[_0x83a0('0x17')],_0x864de0);_0x295256(_0x1106b8[_0x83a0('0x16')](0x1f4,_0x6c211c['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index a005269..521e124 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 _0xef93=['length','squareProject:','update','emit'];(function(_0x1f81cc,_0x2cfcfd){var _0x4484d8=function(_0x3ea88e){while(--_0x3ea88e){_0x1f81cc['push'](_0x1f81cc['shift']());}};_0x4484d8(++_0x2cfcfd);}(_0xef93,0x8a));var _0x3ef9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xef93[_0x20a584];return _0x4b41a8;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0x3ef9('0x0')];function createListener(_0xf411e3,_0x151497){return function(_0x245399){_0x151497[_0x3ef9('0x1')](_0xf411e3,_0x245399);};}function removeListener(_0x4cd1f7,_0x3a8de5){return function(){SquareProjectEvents['removeListener'](_0x4cd1f7,_0x3a8de5);};}exports['register']=function(_0x1604d0){for(var _0x18eb82=0x0,_0x6602b2=events[_0x3ef9('0x2')];_0x18eb82<_0x6602b2;_0x18eb82++){var _0x2b427e=events[_0x18eb82];var _0x57c3b7=createListener(_0x3ef9('0x3')+_0x2b427e,_0x1604d0);SquareProjectEvents['on'](_0x2b427e,_0x57c3b7);}}; \ No newline at end of file +var _0xd38a=['squareProject:','./squareProject.events','remove','removeListener','register','length'];(function(_0x11160e,_0x9ec802){var _0x36c71c=function(_0x19c2e0){while(--_0x19c2e0){_0x11160e['push'](_0x11160e['shift']());}};_0x36c71c(++_0x9ec802);}(_0xd38a,0x18d));var _0xad38=function(_0x218e1e,_0x3a8521){_0x218e1e=_0x218e1e-0x0;var _0x75b79b=_0xd38a[_0x218e1e];return _0x75b79b;};'use strict';var SquareProjectEvents=require(_0xad38('0x0'));var events=['save',_0xad38('0x1'),'update'];function createListener(_0x21521e,_0xa39690){return function(_0x59e0ce){_0xa39690['emit'](_0x21521e,_0x59e0ce);};}function removeListener(_0x509f59,_0x5f59d1){return function(){SquareProjectEvents[_0xad38('0x2')](_0x509f59,_0x5f59d1);};}exports[_0xad38('0x3')]=function(_0x40e63f){for(var _0x31beb6=0x0,_0x293c0f=events[_0xad38('0x4')];_0x31beb6<_0x293c0f;_0x31beb6++){var _0xbf7f6e=events[_0x31beb6];var _0x343196=createListener(_0xad38('0x5')+_0xbf7f6e,_0x40e63f);SquareProjectEvents['on'](_0xbf7f6e,_0x343196);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index e4d42cd..7e951b1 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 _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x575c40,_0x15d596){var _0x527cc4=function(_0x3b2ca1){while(--_0x3b2ca1){_0x575c40['push'](_0x575c40['shift']());}};_0x527cc4(++_0x15d596);}(_0x5fab,0x177));var _0xb5fa=function(_0x23e3b0,_0x5f2901){_0x23e3b0=_0x23e3b0-0x0;var _0x13c675=_0x5fab[_0x23e3b0];return _0x13c675;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x1d3888,_0x2226ac){var _0x18304b=function(_0xed80bc){while(--_0xed80bc){_0x1d3888['push'](_0x1d3888['shift']());}};_0x18304b(++_0x2226ac);}(_0x7a54,0x106));var _0x47a5=function(_0x2d87a2,_0x43c3af){_0x2d87a2=_0x2d87a2-0x0;var _0x3c3693=_0x7a54[_0x2d87a2];return _0x3c3693;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 75c67b4..375cb29 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 _0xeda8=['substring','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xeda8,0x104));var _0x8eda=function(_0x4c012f,_0x2e6efb){_0x4c012f=_0x4c012f-0x0;var _0x1f9829=_0xeda8[_0x4c012f];return _0x1f9829;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8eda('0x2')]},'calleridname':{'type':Sequelize[_0x8eda('0x2')]},'context':{'type':Sequelize[_0x8eda('0x2')]},'extension':{'type':Sequelize[_0x8eda('0x2')]},'priority':{'type':Sequelize[_0x8eda('0x2')]},'accountcode':{'type':Sequelize[_0x8eda('0x2')]},'dnid':{'type':Sequelize[_0x8eda('0x2')]},'projectName':{'type':Sequelize[_0x8eda('0x2')]},'saveName':{'type':Sequelize[_0x8eda('0x2')]},'filename':{'type':Sequelize[_0x8eda('0x2')]},'savePath':{'type':Sequelize[_0x8eda('0x2')]},'format':{'type':Sequelize[_0x8eda('0x3')],'get':function(){var _0x4e2ebb='';var _0x28b721=this[_0x8eda('0x4')](_0x8eda('0x5'));if(_0x28b721){_0x4e2ebb=_0x28b721[_0x8eda('0x6')](_0x28b721['lastIndexOf']('.'));}return _0x4e2ebb;}}}; \ No newline at end of file +var _0x6aa7=['VIRTUAL','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x445510,_0x171042){var _0x5043a3=function(_0x3f88b0){while(--_0x3f88b0){_0x445510['push'](_0x445510['shift']());}};_0x5043a3(++_0x171042);}(_0x6aa7,0x178));var _0x76aa=function(_0x1e38e0,_0x30fc7b){_0x1e38e0=_0x1e38e0-0x0;var _0x3c8bf2=_0x6aa7[_0x1e38e0];return _0x3c8bf2;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'callerid':{'type':Sequelize[_0x76aa('0x1')]},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'context':{'type':Sequelize[_0x76aa('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x1')]},'accountcode':{'type':Sequelize[_0x76aa('0x1')]},'dnid':{'type':Sequelize[_0x76aa('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x76aa('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x76aa('0x2')],'get':function(){var _0x36d12b='';var _0xa9b695=this['getDataValue'](_0x76aa('0x3'));if(_0xa9b695){_0x36d12b=_0xa9b695[_0x76aa('0x4')](_0xa9b695[_0x76aa('0x5')]('.'));}return _0x36d12b;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 4a9e40d..dbf4709 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 _0x2eb6=['Content-Range','apply','save','then','error','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','update','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','message','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','unlinkSync','.cypher','File:\x20\x22','rimraf','fast-json-patch','mustache','path','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','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set'];(function(_0x598007,_0x4de368){var _0x11e08f=function(_0x5e19b8){while(--_0x5e19b8){_0x598007['push'](_0x598007['shift']());}};_0x11e08f(++_0x4de368);}(_0x2eb6,0x15e));var _0x62eb=function(_0x4f2d15,_0x3a90de){_0x4f2d15=_0x4f2d15-0x0;var _0x143282=_0x2eb6[_0x4f2d15];return _0x143282;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x62eb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x62eb('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x62eb('0x2'));var util=require('util');var path=require(_0x62eb('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x62eb('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x62eb('0x5'));var squel=require(_0x62eb('0x6'));var crypto=require(_0x62eb('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x62eb('0x8'));var toCsv=require(_0x62eb('0x9'));var querystring=require(_0x62eb('0xa'));var Papa=require(_0x62eb('0xb'));var Redis=require(_0x62eb('0xc'));var authService=require(_0x62eb('0xd'));var qs=require(_0x62eb('0xe'));var as=require(_0x62eb('0xf'));var hardwareService=require(_0x62eb('0x10'));var logger=require(_0x62eb('0x11'))(_0x62eb('0x12'));var utils=require(_0x62eb('0x13'));var config=require(_0x62eb('0x14'));var licenseUtil=require(_0x62eb('0x15'));var db=require(_0x62eb('0x16'))['db'];function respondWithStatusCode(_0x92aecd,_0x4dcd32){_0x4dcd32=_0x4dcd32||0xcc;return function(_0x4983cc){if(_0x4983cc){return _0x92aecd['sendStatus'](_0x4dcd32);}return _0x92aecd[_0x62eb('0x17')](_0x4dcd32)[_0x62eb('0x18')]();};}function respondWithResult(_0x1864ca,_0x4f3e25){_0x4f3e25=_0x4f3e25||0xc8;return function(_0x449434){if(_0x449434){return _0x1864ca[_0x62eb('0x17')](_0x4f3e25)[_0x62eb('0x19')](_0x449434);}};}function respondWithFilteredResult(_0x391c99,_0x5ebde9){return function(_0x5b6d38){if(_0x5b6d38){var _0x3ae957=typeof _0x5ebde9[_0x62eb('0x1a')]==='undefined'&&typeof _0x5ebde9[_0x62eb('0x1b')]==='undefined';var _0x5aac2e=_0x5b6d38[_0x62eb('0x1c')];var _0x3a4745=_0x3ae957?0x0:_0x5ebde9[_0x62eb('0x1a')];var _0x2aa536=_0x3ae957?_0x5b6d38['count']:_0x5ebde9['offset']+_0x5ebde9[_0x62eb('0x1b')];var _0x4a15f8;if(_0x2aa536>=_0x5aac2e){_0x2aa536=_0x5aac2e;_0x4a15f8=0xc8;}else{_0x4a15f8=0xce;}_0x391c99[_0x62eb('0x17')](_0x4a15f8);return _0x391c99[_0x62eb('0x1d')](_0x62eb('0x1e'),_0x3a4745+'-'+_0x2aa536+'/'+_0x5aac2e)[_0x62eb('0x19')](_0x5b6d38);}return null;};}function patchUpdates(_0xaa1966){return function(_0x1bdf72){try{jsonpatch[_0x62eb('0x1f')](_0x1bdf72,_0xaa1966,!![]);}catch(_0x203c89){return BPromise['reject'](_0x203c89);}return _0x1bdf72[_0x62eb('0x20')]();};}function saveUpdates(_0x556dde,_0x2d457f){return function(_0x15d4c7){if(_0x15d4c7){return _0x15d4c7['update'](_0x556dde)[_0x62eb('0x21')](function(_0x2984d3){return _0x2984d3;});}return null;};}function removeEntity(_0x4e12d9,_0xeadfdd){return function(_0x4507b1){if(_0x4507b1){return _0x4507b1['destroy']()[_0x62eb('0x21')](function(){_0x4e12d9[_0x62eb('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x396c21,_0x50cbde){return function(_0x50e3f5){if(!_0x50e3f5){_0x396c21['sendStatus'](0x194);}return _0x50e3f5;};}function handleError(_0x230ad1,_0x351dc9){_0x351dc9=_0x351dc9||0x1f4;return function(_0x18429d){logger[_0x62eb('0x22')](_0x18429d[_0x62eb('0x23')]);if(_0x18429d[_0x62eb('0x24')]){delete _0x18429d[_0x62eb('0x24')];}_0x230ad1[_0x62eb('0x17')](_0x351dc9)[_0x62eb('0x25')](_0x18429d);};}exports[_0x62eb('0x26')]=function(_0x32d871,_0x2ce0d8){var _0x15a0fc={},_0x4f1090={},_0x1f16f3={'count':0x0,'rows':[]};var _0x3a8bd0=_[_0x62eb('0x27')](db[_0x62eb('0x28')][_0x62eb('0x29')],function(_0xe047ba){return{'name':_0xe047ba['fieldName'],'type':_0xe047ba[_0x62eb('0x2a')][_0x62eb('0x2b')]};});_0x4f1090[_0x62eb('0x2c')]=_[_0x62eb('0x27')](_0x3a8bd0,_0x62eb('0x24'));_0x4f1090[_0x62eb('0x2d')]=_['keys'](_0x32d871[_0x62eb('0x2d')]);_0x4f1090[_0x62eb('0x2e')]=_[_0x62eb('0x2f')](_0x4f1090[_0x62eb('0x2c')],_0x4f1090[_0x62eb('0x2d')]);_0x15a0fc[_0x62eb('0x30')]=_[_0x62eb('0x2f')](_0x4f1090[_0x62eb('0x2c')],qs[_0x62eb('0x31')](_0x32d871[_0x62eb('0x2d')][_0x62eb('0x31')]));_0x15a0fc['attributes']=_0x15a0fc['attributes']['length']?_0x15a0fc[_0x62eb('0x30')]:_0x4f1090[_0x62eb('0x2c')];if(!_0x32d871['query'][_0x62eb('0x32')](_0x62eb('0x33'))){_0x15a0fc[_0x62eb('0x1b')]=qs['limit'](_0x32d871['query']['limit']);_0x15a0fc['offset']=qs[_0x62eb('0x1a')](_0x32d871[_0x62eb('0x2d')][_0x62eb('0x1a')]);}_0x15a0fc[_0x62eb('0x34')]=qs[_0x62eb('0x35')](_0x32d871[_0x62eb('0x2d')][_0x62eb('0x35')]);_0x15a0fc[_0x62eb('0x36')]=qs[_0x62eb('0x2e')](_[_0x62eb('0x37')](_0x32d871[_0x62eb('0x2d')],_0x4f1090[_0x62eb('0x2e')]),_0x3a8bd0);if(_0x32d871[_0x62eb('0x2d')][_0x62eb('0x38')]){_0x15a0fc['where']=_[_0x62eb('0x39')](_0x15a0fc[_0x62eb('0x36')],{'$or':_[_0x62eb('0x27')](_0x3a8bd0,function(_0x5b7ad0){if(_0x5b7ad0[_0x62eb('0x2a')]!=='VIRTUAL'){var _0x275b17={};_0x275b17[_0x5b7ad0[_0x62eb('0x24')]]={'$like':'%'+_0x32d871[_0x62eb('0x2d')]['filter']+'%'};return _0x275b17;}})});}_0x15a0fc=_[_0x62eb('0x39')]({},_0x15a0fc,_0x32d871[_0x62eb('0x3a')]);var _0x2e518b={'where':_0x15a0fc[_0x62eb('0x36')]};return db['SquareRecording'][_0x62eb('0x1c')](_0x2e518b)['then'](function(_0x4b913b){_0x1f16f3['count']=_0x4b913b;if(_0x32d871['query']['includeAll']){_0x15a0fc[_0x62eb('0x3b')]=[{'all':!![]}];}return db['SquareRecording'][_0x62eb('0x3c')](_0x15a0fc);})[_0x62eb('0x21')](function(_0x3ebf78){_0x1f16f3[_0x62eb('0x3d')]=_0x3ebf78;return _0x1f16f3;})[_0x62eb('0x21')](respondWithFilteredResult(_0x2ce0d8,_0x15a0fc))[_0x62eb('0x3e')](handleError(_0x2ce0d8,null));};exports[_0x62eb('0x3f')]=function(_0xca61ae,_0x4304e4){var _0x10c6c5={'raw':!![],'where':{'id':_0xca61ae[_0x62eb('0x40')]['id']}},_0xba8436={};_0xba8436['model']=_[_0x62eb('0x41')](db[_0x62eb('0x28')][_0x62eb('0x29')]);_0xba8436['query']=_[_0x62eb('0x41')](_0xca61ae[_0x62eb('0x2d')]);_0xba8436['filters']=_[_0x62eb('0x2f')](_0xba8436[_0x62eb('0x2c')],_0xba8436[_0x62eb('0x2d')]);_0x10c6c5[_0x62eb('0x30')]=_[_0x62eb('0x2f')](_0xba8436[_0x62eb('0x2c')],qs[_0x62eb('0x31')](_0xca61ae[_0x62eb('0x2d')][_0x62eb('0x31')]));_0x10c6c5[_0x62eb('0x30')]=_0x10c6c5['attributes'][_0x62eb('0x42')]?_0x10c6c5[_0x62eb('0x30')]:_0xba8436['model'];if(_0xca61ae[_0x62eb('0x2d')][_0x62eb('0x43')]){_0x10c6c5[_0x62eb('0x3b')]=[{'all':!![]}];}_0x10c6c5=_[_0x62eb('0x39')]({},_0x10c6c5,_0xca61ae['options']);return db[_0x62eb('0x28')][_0x62eb('0x44')](_0x10c6c5)[_0x62eb('0x21')](handleEntityNotFound(_0x4304e4,null))['then'](respondWithResult(_0x4304e4,null))[_0x62eb('0x3e')](handleError(_0x4304e4,null));};exports['create']=function(_0x4b2dcc,_0x2147bf){return db[_0x62eb('0x28')][_0x62eb('0x45')](_0x4b2dcc[_0x62eb('0x46')],{})[_0x62eb('0x21')](respondWithResult(_0x2147bf,0xc9))[_0x62eb('0x3e')](handleError(_0x2147bf,null));};exports[_0x62eb('0x47')]=function(_0x584848,_0xfe6226){if(_0x584848['body']['id']){delete _0x584848[_0x62eb('0x46')]['id'];}return db[_0x62eb('0x28')][_0x62eb('0x44')]({'where':{'id':_0x584848[_0x62eb('0x40')]['id']}})['then'](handleEntityNotFound(_0xfe6226,null))[_0x62eb('0x21')](saveUpdates(_0x584848['body'],null))[_0x62eb('0x21')](respondWithResult(_0xfe6226,null))[_0x62eb('0x3e')](handleError(_0xfe6226,null));};exports[_0x62eb('0x48')]=function(_0x47b049,_0x45e9c0,_0xe7847a){var _0x24a65c=require(_0x62eb('0x49'));var _0xdb26f5=![];var _0x4ee64c={};if(_0x47b049[_0x62eb('0x2d')][_0x62eb('0x2a')]&&_0x47b049[_0x62eb('0x2d')]['type']===_0x62eb('0x4a')){_0x4ee64c[_0x62eb('0x4a')]=_0x47b049[_0x62eb('0x40')]['id'];}else{_0x4ee64c['id']=_0x47b049['params']['id'];}return db['SquareRecording'][_0x62eb('0x44')]({'where':_0x4ee64c,'attributes':['id',_0x62eb('0x4b'),_0x62eb('0x4c')],'raw':!![]})[_0x62eb('0x21')](handleEntityNotFound(_0x45e9c0,null))[_0x62eb('0x21')](function(_0x52675b){if(_0x52675b){var _0x3bb965=_0x52675b[_0x62eb('0x4b')];var _0x3fb65d=util[_0x62eb('0x4d')]('%s.cypher',_0x3bb965);if(fs[_0x62eb('0x4e')](_0x3fb65d)){_0xdb26f5=!![];return _0x24a65c[_0x62eb('0x4f')](_0x3fb65d,_0x3bb965,config[_0x62eb('0x50')]['recording'])['then'](function(){return _0x52675b;});}return _0x52675b;}})[_0x62eb('0x21')](function(_0xc42b50){if(_0xc42b50){var _0x2e5525=_0xc42b50['savePath'];if(!fs[_0x62eb('0x4e')](_0x2e5525)){throw new db[(_0x62eb('0x51'))][(_0x62eb('0x52'))](_0x62eb('0x53'));}if(_0xc42b50['filename']){return _0x45e9c0[_0x62eb('0x48')](_0x2e5525,_0xc42b50['filename']+path[_0x62eb('0x54')](_0x2e5525),function(){if(_0xdb26f5){fs['unlink'](_0x2e5525);}});}else{return _0x45e9c0[_0x62eb('0x48')](_0x2e5525,function(_0x1e647b){if(_0xdb26f5){fs['unlink'](_0x2e5525);}});}}})[_0x62eb('0x3e')](function(_0x27cb39){if(_0x27cb39[_0x62eb('0x55')]==='SquareRecording\x20not\x20found'){_0x45e9c0[_0x62eb('0x17')](0x194)[_0x62eb('0x25')](_0x62eb('0x56'));}else{return handleError(_0x45e9c0,null);}});};exports[_0x62eb('0x57')]=function(_0x473f15,_0x3c9526){return db[_0x62eb('0x28')]['find']({'where':{'id':_0x473f15[_0x62eb('0x40')]['id']}})[_0x62eb('0x21')](function(_0x68f84b){if(_['isNil'](_0x68f84b)){throw new ReferenceError(_0x62eb('0x58'));}return _0x68f84b;})[_0x62eb('0x21')](function(_0x2a13c8){var _0x3d15bf=_0x2a13c8[_0x62eb('0x4b')];logger[_0x62eb('0x59')](_0x62eb('0x5a'),_0x3d15bf);if(!_[_0x62eb('0x5b')](_0x2a13c8[_0x62eb('0x4b')])&&fs[_0x62eb('0x4e')](_0x3d15bf)){logger[_0x62eb('0x59')]('File:\x20\x22'+_0x3d15bf+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x62eb('0x5c')](_0x3d15bf);}_0x3d15bf=_0x3d15bf+_0x62eb('0x5d');if(!_[_0x62eb('0x5b')](_0x2a13c8['savePath'])&&fs[_0x62eb('0x4e')](_0x3d15bf)){logger[_0x62eb('0x59')](_0x62eb('0x5e')+_0x3d15bf+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x62eb('0x5c')](_0x3d15bf);}return _0x2a13c8;})['then'](function(_0x337170){if(!_0x337170)throw new InternalError();return _0x337170[_0x62eb('0x57')]();})[_0x62eb('0x21')](function(){_0x3c9526[_0x62eb('0x17')](0xcc)[_0x62eb('0x18')]();})[_0x62eb('0x3e')](handleError(_0x3c9526,null));}; \ No newline at end of file +var _0xc116=['SquareRecording','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','decryptFile','secrets','recording','Sequelize','ValidationError','unlink','message','destroy','isNil','Entity\x20not\x20found','info','existsSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','error','name','send','map'];(function(_0x49d25b,_0x3c51d8){var _0x3b10b4=function(_0x53ca0b){while(--_0x53ca0b){_0x49d25b['push'](_0x49d25b['shift']());}};_0x3b10b4(++_0x3c51d8);}(_0xc116,0x159));var _0x6c11=function(_0x4b4a75,_0x2ddf5e){_0x4b4a75=_0x4b4a75-0x0;var _0x308f7e=_0xc116[_0x4b4a75];return _0x308f7e;};'use strict';var emlformat=require(_0x6c11('0x0'));var rimraf=require(_0x6c11('0x1'));var zipdir=require(_0x6c11('0x2'));var jsonpatch=require(_0x6c11('0x3'));var rp=require(_0x6c11('0x4'));var moment=require(_0x6c11('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6c11('0x6'));var util=require('util');var path=require(_0x6c11('0x7'));var sox=require(_0x6c11('0x8'));var csv=require(_0x6c11('0x9'));var ejs=require(_0x6c11('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c11('0xb'));var squel=require(_0x6c11('0xc'));var crypto=require('crypto');var jsforce=require(_0x6c11('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6c11('0x9'));var querystring=require(_0x6c11('0xe'));var Papa=require(_0x6c11('0xf'));var Redis=require(_0x6c11('0x10'));var authService=require(_0x6c11('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6c11('0x12'));var hardwareService=require(_0x6c11('0x13'));var logger=require('../../config/logger')(_0x6c11('0x14'));var utils=require(_0x6c11('0x15'));var config=require(_0x6c11('0x16'));var licenseUtil=require(_0x6c11('0x17'));var db=require(_0x6c11('0x18'))['db'];function respondWithStatusCode(_0x261572,_0x2df6fd){_0x2df6fd=_0x2df6fd||0xcc;return function(_0x53f93b){if(_0x53f93b){return _0x261572[_0x6c11('0x19')](_0x2df6fd);}return _0x261572[_0x6c11('0x1a')](_0x2df6fd)[_0x6c11('0x1b')]();};}function respondWithResult(_0x5d0840,_0x438839){_0x438839=_0x438839||0xc8;return function(_0x455041){if(_0x455041){return _0x5d0840[_0x6c11('0x1a')](_0x438839)['json'](_0x455041);}};}function respondWithFilteredResult(_0x5ef4b8,_0xa34eee){return function(_0xe93c8f){if(_0xe93c8f){var _0x119fb1=typeof _0xa34eee[_0x6c11('0x1c')]===_0x6c11('0x1d')&&typeof _0xa34eee[_0x6c11('0x1e')]===_0x6c11('0x1d');var _0x1e454d=_0xe93c8f['count'];var _0x5f446b=_0x119fb1?0x0:_0xa34eee['offset'];var _0x4ef8e9=_0x119fb1?_0xe93c8f[_0x6c11('0x1f')]:_0xa34eee['offset']+_0xa34eee[_0x6c11('0x1e')];var _0x2b7255;if(_0x4ef8e9>=_0x1e454d){_0x4ef8e9=_0x1e454d;_0x2b7255=0xc8;}else{_0x2b7255=0xce;}_0x5ef4b8[_0x6c11('0x1a')](_0x2b7255);return _0x5ef4b8[_0x6c11('0x20')](_0x6c11('0x21'),_0x5f446b+'-'+_0x4ef8e9+'/'+_0x1e454d)[_0x6c11('0x22')](_0xe93c8f);}return null;};}function patchUpdates(_0x45d282){return function(_0x86827){try{jsonpatch[_0x6c11('0x23')](_0x86827,_0x45d282,!![]);}catch(_0x1378a4){return BPromise[_0x6c11('0x24')](_0x1378a4);}return _0x86827[_0x6c11('0x25')]();};}function saveUpdates(_0x61e659,_0xb70d76){return function(_0x1f3aac){if(_0x1f3aac){return _0x1f3aac[_0x6c11('0x26')](_0x61e659)['then'](function(_0x4c746a){return _0x4c746a;});}return null;};}function removeEntity(_0x304556,_0x47e22f){return function(_0x39707c){if(_0x39707c){return _0x39707c['destroy']()['then'](function(){_0x304556[_0x6c11('0x1a')](0xcc)[_0x6c11('0x1b')]();});}};}function handleEntityNotFound(_0x2c3c7e,_0x369929){return function(_0x442d32){if(!_0x442d32){_0x2c3c7e[_0x6c11('0x19')](0x194);}return _0x442d32;};}function handleError(_0x40e3bc,_0x5e8e7f){_0x5e8e7f=_0x5e8e7f||0x1f4;return function(_0x508849){logger[_0x6c11('0x27')](_0x508849['stack']);if(_0x508849[_0x6c11('0x28')]){delete _0x508849[_0x6c11('0x28')];}_0x40e3bc[_0x6c11('0x1a')](_0x5e8e7f)[_0x6c11('0x29')](_0x508849);};}exports['index']=function(_0x5da038,_0x43ca66){var _0x10f404={},_0x48899c={},_0x25a699={'count':0x0,'rows':[]};var _0x22b60c=_[_0x6c11('0x2a')](db[_0x6c11('0x2b')]['rawAttributes'],function(_0x3b0a43){return{'name':_0x3b0a43[_0x6c11('0x2c')],'type':_0x3b0a43[_0x6c11('0x2d')]['key']};});_0x48899c[_0x6c11('0x2e')]=_[_0x6c11('0x2a')](_0x22b60c,'name');_0x48899c[_0x6c11('0x2f')]=_[_0x6c11('0x30')](_0x5da038['query']);_0x48899c[_0x6c11('0x31')]=_['intersection'](_0x48899c[_0x6c11('0x2e')],_0x48899c[_0x6c11('0x2f')]);_0x10f404[_0x6c11('0x32')]=_[_0x6c11('0x33')](_0x48899c[_0x6c11('0x2e')],qs[_0x6c11('0x34')](_0x5da038[_0x6c11('0x2f')][_0x6c11('0x34')]));_0x10f404[_0x6c11('0x32')]=_0x10f404[_0x6c11('0x32')][_0x6c11('0x35')]?_0x10f404['attributes']:_0x48899c[_0x6c11('0x2e')];if(!_0x5da038[_0x6c11('0x2f')][_0x6c11('0x36')]('nolimit')){_0x10f404[_0x6c11('0x1e')]=qs[_0x6c11('0x1e')](_0x5da038['query']['limit']);_0x10f404[_0x6c11('0x1c')]=qs[_0x6c11('0x1c')](_0x5da038['query']['offset']);}_0x10f404[_0x6c11('0x37')]=qs[_0x6c11('0x38')](_0x5da038[_0x6c11('0x2f')][_0x6c11('0x38')]);_0x10f404[_0x6c11('0x39')]=qs[_0x6c11('0x31')](_[_0x6c11('0x3a')](_0x5da038[_0x6c11('0x2f')],_0x48899c['filters']),_0x22b60c);if(_0x5da038[_0x6c11('0x2f')][_0x6c11('0x3b')]){_0x10f404[_0x6c11('0x39')]=_['merge'](_0x10f404[_0x6c11('0x39')],{'$or':_[_0x6c11('0x2a')](_0x22b60c,function(_0x2253c9){if(_0x2253c9[_0x6c11('0x2d')]!==_0x6c11('0x3c')){var _0x10cbcc={};_0x10cbcc[_0x2253c9['name']]={'$like':'%'+_0x5da038[_0x6c11('0x2f')]['filter']+'%'};return _0x10cbcc;}})});}_0x10f404=_[_0x6c11('0x3d')]({},_0x10f404,_0x5da038[_0x6c11('0x3e')]);var _0x3618d3={'where':_0x10f404[_0x6c11('0x39')]};return db[_0x6c11('0x2b')][_0x6c11('0x1f')](_0x3618d3)[_0x6c11('0x3f')](function(_0x81b323){_0x25a699[_0x6c11('0x1f')]=_0x81b323;if(_0x5da038[_0x6c11('0x2f')][_0x6c11('0x40')]){_0x10f404[_0x6c11('0x41')]=[{'all':!![]}];}return db[_0x6c11('0x2b')][_0x6c11('0x42')](_0x10f404);})[_0x6c11('0x3f')](function(_0x3136b6){_0x25a699[_0x6c11('0x43')]=_0x3136b6;return _0x25a699;})[_0x6c11('0x3f')](respondWithFilteredResult(_0x43ca66,_0x10f404))[_0x6c11('0x44')](handleError(_0x43ca66,null));};exports[_0x6c11('0x45')]=function(_0x33b203,_0x339f4c){var _0x598fa7={'raw':!![],'where':{'id':_0x33b203['params']['id']}},_0xdcf933={};_0xdcf933[_0x6c11('0x2e')]=_[_0x6c11('0x30')](db['SquareRecording'][_0x6c11('0x46')]);_0xdcf933[_0x6c11('0x2f')]=_[_0x6c11('0x30')](_0x33b203['query']);_0xdcf933[_0x6c11('0x31')]=_[_0x6c11('0x33')](_0xdcf933[_0x6c11('0x2e')],_0xdcf933[_0x6c11('0x2f')]);_0x598fa7[_0x6c11('0x32')]=_[_0x6c11('0x33')](_0xdcf933[_0x6c11('0x2e')],qs[_0x6c11('0x34')](_0x33b203[_0x6c11('0x2f')][_0x6c11('0x34')]));_0x598fa7[_0x6c11('0x32')]=_0x598fa7[_0x6c11('0x32')][_0x6c11('0x35')]?_0x598fa7['attributes']:_0xdcf933[_0x6c11('0x2e')];if(_0x33b203[_0x6c11('0x2f')]['includeAll']){_0x598fa7['include']=[{'all':!![]}];}_0x598fa7=_[_0x6c11('0x3d')]({},_0x598fa7,_0x33b203[_0x6c11('0x3e')]);return db['SquareRecording'][_0x6c11('0x47')](_0x598fa7)[_0x6c11('0x3f')](handleEntityNotFound(_0x339f4c,null))[_0x6c11('0x3f')](respondWithResult(_0x339f4c,null))[_0x6c11('0x44')](handleError(_0x339f4c,null));};exports[_0x6c11('0x48')]=function(_0x1661e2,_0x334eff){return db[_0x6c11('0x2b')][_0x6c11('0x48')](_0x1661e2['body'],{})[_0x6c11('0x3f')](respondWithResult(_0x334eff,0xc9))['catch'](handleError(_0x334eff,null));};exports[_0x6c11('0x26')]=function(_0x40cb0d,_0x16bace){if(_0x40cb0d['body']['id']){delete _0x40cb0d[_0x6c11('0x49')]['id'];}return db[_0x6c11('0x2b')][_0x6c11('0x47')]({'where':{'id':_0x40cb0d[_0x6c11('0x4a')]['id']}})[_0x6c11('0x3f')](handleEntityNotFound(_0x16bace,null))['then'](saveUpdates(_0x40cb0d[_0x6c11('0x49')],null))[_0x6c11('0x3f')](respondWithResult(_0x16bace,null))[_0x6c11('0x44')](handleError(_0x16bace,null));};exports[_0x6c11('0x4b')]=function(_0x26c560,_0x514c10,_0xfb11c6){var _0x4968d9=require(_0x6c11('0x4c'));var _0xfcd624=![];var _0x3d68c6={};if(_0x26c560['query'][_0x6c11('0x2d')]&&_0x26c560[_0x6c11('0x2f')][_0x6c11('0x2d')]===_0x6c11('0x4d')){_0x3d68c6[_0x6c11('0x4d')]=_0x26c560[_0x6c11('0x4a')]['id'];}else{_0x3d68c6['id']=_0x26c560[_0x6c11('0x4a')]['id'];}return db[_0x6c11('0x2b')][_0x6c11('0x47')]({'where':_0x3d68c6,'attributes':['id','savePath',_0x6c11('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x514c10,null))['then'](function(_0x434553){if(_0x434553){var _0x1a7559=_0x434553[_0x6c11('0x4f')];var _0x39a919=util[_0x6c11('0x50')](_0x6c11('0x51'),_0x1a7559);if(fs['existsSync'](_0x39a919)){_0xfcd624=!![];return _0x4968d9[_0x6c11('0x52')](_0x39a919,_0x1a7559,config[_0x6c11('0x53')][_0x6c11('0x54')])['then'](function(){return _0x434553;});}return _0x434553;}})[_0x6c11('0x3f')](function(_0x12bbff){if(_0x12bbff){var _0x5f533b=_0x12bbff[_0x6c11('0x4f')];if(!fs['existsSync'](_0x5f533b)){throw new db[(_0x6c11('0x55'))][(_0x6c11('0x56'))]('SquareRecording\x20not\x20found');}if(_0x12bbff[_0x6c11('0x4e')]){return _0x514c10[_0x6c11('0x4b')](_0x5f533b,_0x12bbff[_0x6c11('0x4e')]+path['extname'](_0x5f533b),function(){if(_0xfcd624){fs[_0x6c11('0x57')](_0x5f533b);}});}else{return _0x514c10[_0x6c11('0x4b')](_0x5f533b,function(_0x2bf2bc){if(_0xfcd624){fs[_0x6c11('0x57')](_0x5f533b);}});}}})[_0x6c11('0x44')](function(_0x446147){if(_0x446147[_0x6c11('0x58')]==='SquareRecording\x20not\x20found'){_0x514c10[_0x6c11('0x1a')](0x194)[_0x6c11('0x29')]('Not\x20found');}else{return handleError(_0x514c10,null);}});};exports[_0x6c11('0x59')]=function(_0x511738,_0x26a491){return db['SquareRecording'][_0x6c11('0x47')]({'where':{'id':_0x511738['params']['id']}})[_0x6c11('0x3f')](function(_0x36d703){if(_[_0x6c11('0x5a')](_0x36d703)){throw new ReferenceError(_0x6c11('0x5b'));}return _0x36d703;})[_0x6c11('0x3f')](function(_0x173471){var _0xb85115=_0x173471['savePath'];logger[_0x6c11('0x5c')]('cancellazione\x20fisica\x20documento\x20%s',_0xb85115);if(!_['isNil'](_0x173471[_0x6c11('0x4f')])&&fs[_0x6c11('0x5d')](_0xb85115)){logger[_0x6c11('0x5c')]('File:\x20\x22'+_0xb85115+_0x6c11('0x5e'));fs[_0x6c11('0x5f')](_0xb85115);}_0xb85115=_0xb85115+_0x6c11('0x60');if(!_[_0x6c11('0x5a')](_0x173471[_0x6c11('0x4f')])&&fs[_0x6c11('0x5d')](_0xb85115)){logger[_0x6c11('0x5c')]('File:\x20\x22'+_0xb85115+_0x6c11('0x5e'));fs[_0x6c11('0x5f')](_0xb85115);}return _0x173471;})[_0x6c11('0x3f')](function(_0x274e7d){if(!_0x274e7d)throw new InternalError();return _0x274e7d['destroy']();})[_0x6c11('0x3f')](function(){_0x26a491[_0x6c11('0x1a')](0xcc)[_0x6c11('0x1b')]();})[_0x6c11('0x44')](handleError(_0x26a491,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 4e1edd7..ea30db7 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 _0xb7f0=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','lodash'];(function(_0x58e7cd,_0x5da97b){var _0x5f41b0=function(_0x134d27){while(--_0x134d27){_0x58e7cd['push'](_0x58e7cd['shift']());}};_0x5f41b0(++_0x5da97b);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x1798cb,_0xafe39f){_0x1798cb=_0x1798cb-0x0;var _0x4a68ed=_0xb7f0[_0x1798cb];return _0x4a68ed;};'use strict';var _=require(_0x0b7f('0x0'));var util=require(_0x0b7f('0x1'));var logger=require(_0x0b7f('0x2'))(_0x0b7f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0b7f('0x4'));var fs=require('fs');var path=require(_0x0b7f('0x5'));var rimraf=require(_0x0b7f('0x6'));var config=require(_0x0b7f('0x7'));var attributes=require(_0x0b7f('0x8'));module[_0x0b7f('0x9')]=function(_0x1c3c26,_0x1ba1e8){return _0x1c3c26[_0x0b7f('0xa')](_0x0b7f('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6e9=['define','square_recordings','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareRecording.attributes','exports'];(function(_0xe33b12,_0x2a9761){var _0x30699d=function(_0x209952){while(--_0x209952){_0xe33b12['push'](_0xe33b12['shift']());}};_0x30699d(++_0x2a9761);}(_0xe6e9,0x182));var _0x9e6e=function(_0x4c11a9,_0x2056d2){_0x4c11a9=_0x4c11a9-0x0;var _0x326b30=_0xe6e9[_0x4c11a9];return _0x326b30;};'use strict';var _=require(_0x9e6e('0x0'));var util=require(_0x9e6e('0x1'));var logger=require(_0x9e6e('0x2'))('api');var moment=require(_0x9e6e('0x3'));var BPromise=require(_0x9e6e('0x4'));var rp=require(_0x9e6e('0x5'));var fs=require('fs');var path=require(_0x9e6e('0x6'));var rimraf=require(_0x9e6e('0x7'));var config=require('../../config/environment');var attributes=require(_0x9e6e('0x8'));module[_0x9e6e('0x9')]=function(_0x206572,_0x1e8e5e){return _0x206572[_0x9e6e('0xa')]('SquareRecording',attributes,{'tableName':_0x9e6e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index a5679b4..3fb8cfb 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 _0x3516=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','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','SquareRecording','create','body','options','raw','CreateSquareRecording','util','moment','bluebird','randomstring'];(function(_0x4c9316,_0x5c7f6f){var _0x146aad=function(_0x4fa179){while(--_0x4fa179){_0x4c9316['push'](_0x4c9316['shift']());}};_0x146aad(++_0x5c7f6f);}(_0x3516,0x128));var _0x6351=function(_0xd99840,_0x1734cf){_0xd99840=_0xd99840-0x0;var _0x34a786=_0x3516[_0xd99840];return _0x34a786;};'use strict';var _=require('lodash');var util=require(_0x6351('0x0'));var moment=require(_0x6351('0x1'));var BPromise=require(_0x6351('0x2'));var rs=require(_0x6351('0x3'));var fs=require('fs');var Redis=require(_0x6351('0x4'));var db=require(_0x6351('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6351('0x6'))(_0x6351('0x7'));var config=require(_0x6351('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6351('0x9')][_0x6351('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51b10e,_0x3e2696,_0x114fd3){return new BPromise(function(_0x26cefd,_0x912e5a){return client[_0x6351('0xb')](_0x51b10e,_0x114fd3)[_0x6351('0xc')](function(_0x3669b0){logger[_0x6351('0xd')](_0x6351('0xe'),_0x3e2696,_0x6351('0xf'));logger[_0x6351('0x10')](_0x6351('0x11'),_0x3e2696,_0x6351('0xf'),JSON[_0x6351('0x12')](_0x3669b0));if(_0x3669b0[_0x6351('0x13')]){if(_0x3669b0[_0x6351('0x13')][_0x6351('0x14')]===0x1f4){logger[_0x6351('0x13')](_0x6351('0xe'),_0x3e2696,_0x3669b0[_0x6351('0x13')][_0x6351('0x15')]);return _0x912e5a(_0x3669b0[_0x6351('0x13')]['message']);}logger[_0x6351('0x13')](_0x6351('0xe'),_0x3e2696,_0x3669b0[_0x6351('0x13')][_0x6351('0x15')]);return _0x26cefd(_0x3669b0['error'][_0x6351('0x15')]);}else{logger[_0x6351('0xd')](_0x6351('0xe'),_0x3e2696,_0x6351('0xf'));_0x26cefd(_0x3669b0[_0x6351('0x16')][_0x6351('0x15')]);}})[_0x6351('0x17')](function(_0x5ea20a){logger[_0x6351('0x13')](_0x6351('0xe'),_0x3e2696,_0x5ea20a);_0x912e5a(_0x5ea20a);});});}exports['CreateSquareRecording']=function(_0x33baa4){var _0x3bfd86=this;return new Promise(function(_0x2af3e4,_0x37f76e){return db[_0x6351('0x18')][_0x6351('0x19')](_0x33baa4[_0x6351('0x1a')],{'raw':_0x33baa4[_0x6351('0x1b')]?_0x33baa4[_0x6351('0x1b')][_0x6351('0x1c')]===undefined?!![]:![]:!![]})[_0x6351('0xc')](function(_0x3f14d7){logger[_0x6351('0xd')](_0x6351('0x1d'),_0x33baa4);logger['debug'](_0x6351('0x1d'),_0x33baa4,JSON[_0x6351('0x12')](_0x3f14d7));_0x2af3e4(_0x3f14d7);})['catch'](function(_0x3c099f){logger[_0x6351('0x13')](_0x6351('0x1d'),_0x3c099f[_0x6351('0x15')],_0x33baa4);_0x37f76e(_0x3bfd86[_0x6351('0x13')](0x1f4,_0x3c099f[_0x6351('0x15')]));});});}; \ No newline at end of file +var _0x1517=['error','code','message','SquareRecording,\x20%s,\x20%s','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1517,0xd6));var _0x7151=function(_0x55c947,_0x5e20a8){_0x55c947=_0x55c947-0x0;var _0x2556b3=_0x1517[_0x55c947];return _0x2556b3;};'use strict';var _=require(_0x7151('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7151('0x1'));var rs=require(_0x7151('0x2'));var fs=require('fs');var Redis=require(_0x7151('0x3'));var db=require(_0x7151('0x4'))['db'];var utils=require(_0x7151('0x5'));var logger=require(_0x7151('0x6'))(_0x7151('0x7'));var config=require(_0x7151('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7151('0x9')][_0x7151('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3232b7,_0x288725,_0x28f2c3){return new BPromise(function(_0x4caf48,_0x430924){return client[_0x7151('0xb')](_0x3232b7,_0x28f2c3)[_0x7151('0xc')](function(_0x483187){logger[_0x7151('0xd')]('SquareRecording,\x20%s,\x20%s',_0x288725,_0x7151('0xe'));logger[_0x7151('0xf')](_0x7151('0x10'),_0x288725,'request\x20sent',JSON[_0x7151('0x11')](_0x483187));if(_0x483187['error']){if(_0x483187[_0x7151('0x12')][_0x7151('0x13')]===0x1f4){logger[_0x7151('0x12')]('SquareRecording,\x20%s,\x20%s',_0x288725,_0x483187[_0x7151('0x12')][_0x7151('0x14')]);return _0x430924(_0x483187['error'][_0x7151('0x14')]);}logger[_0x7151('0x12')]('SquareRecording,\x20%s,\x20%s',_0x288725,_0x483187[_0x7151('0x12')][_0x7151('0x14')]);return _0x4caf48(_0x483187[_0x7151('0x12')][_0x7151('0x14')]);}else{logger[_0x7151('0xd')](_0x7151('0x15'),_0x288725,_0x7151('0xe'));_0x4caf48(_0x483187['result'][_0x7151('0x14')]);}})[_0x7151('0x16')](function(_0x49b0e3){logger[_0x7151('0x12')](_0x7151('0x15'),_0x288725,_0x49b0e3);_0x430924(_0x49b0e3);});});}exports['CreateSquareRecording']=function(_0x5ed8c9){var _0xea214b=this;return new Promise(function(_0x185e1f,_0x1c0f72){return db[_0x7151('0x17')][_0x7151('0x18')](_0x5ed8c9[_0x7151('0x19')],{'raw':_0x5ed8c9[_0x7151('0x1a')]?_0x5ed8c9[_0x7151('0x1a')][_0x7151('0x1b')]===undefined?!![]:![]:!![]})[_0x7151('0xc')](function(_0x390ee8){logger[_0x7151('0xd')]('CreateSquareRecording',_0x5ed8c9);logger[_0x7151('0xf')](_0x7151('0x1c'),_0x5ed8c9,JSON[_0x7151('0x11')](_0x390ee8));_0x185e1f(_0x390ee8);})[_0x7151('0x16')](function(_0x40a8b0){logger[_0x7151('0x12')](_0x7151('0x1c'),_0x40a8b0[_0x7151('0x14')],_0x5ed8c9);_0x1c0f72(_0xea214b[_0x7151('0x12')](0x1f4,_0x40a8b0['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 2d38e66..8e30739 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x269816,_0x3046b9){var _0x72af28=function(_0x3d6631){while(--_0x3d6631){_0x269816['push'](_0x269816['shift']());}};_0x72af28(++_0x3046b9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0xe0c78,_0x163b0d){var _0xfec776=function(_0x22d42f){while(--_0x22d42f){_0xe0c78['push'](_0xe0c78['shift']());}};_0xfec776(++_0x163b0d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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 258142f..6dfcdfa 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 _0x0427=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x52c8e8,_0x5ee20d){var _0x31bb1a=function(_0x47233a){while(--_0x47233a){_0x52c8e8['push'](_0x52c8e8['shift']());}};_0x31bb1a(++_0x5ee20d);}(_0x0427,0x16a));var _0x7042=function(_0x57fbc6,_0x30720a){_0x57fbc6=_0x57fbc6-0x0;var _0x4a807b=_0x0427[_0x57fbc6];return _0x4a807b;};'use strict';var Sequelize=require(_0x7042('0x0'));module[_0x7042('0x1')]={'network':{'type':Sequelize[_0x7042('0x2')]},'network_script':{'type':Sequelize[_0x7042('0x2')]},'request':{'type':Sequelize[_0x7042('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7042('0x2')]},'type':{'type':Sequelize[_0x7042('0x2')]},'uniqueid':{'type':Sequelize[_0x7042('0x2')]},'version':{'type':Sequelize[_0x7042('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7042('0x2')]},'callingpres':{'type':Sequelize[_0x7042('0x2')]},'callingani2':{'type':Sequelize[_0x7042('0x2')]},'callington':{'type':Sequelize[_0x7042('0x2')]},'callingtns':{'type':Sequelize[_0x7042('0x2')]},'dnid':{'type':Sequelize[_0x7042('0x2')]},'rdnis':{'type':Sequelize[_0x7042('0x2')]},'context':{'type':Sequelize[_0x7042('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x7042('0x2')]},'enhanced':{'type':Sequelize[_0x7042('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x7042('0x2')]},'project_name':{'type':Sequelize[_0x7042('0x2')]},'joinAt':{'type':Sequelize[_0x7042('0x3')]},'leaveAt':{'type':Sequelize[_0x7042('0x3')]},'bot':{'type':Sequelize[_0x7042('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x8b6f=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x2e1419,_0x17a7cf){var _0x114b36=function(_0x306713){while(--_0x306713){_0x2e1419['push'](_0x2e1419['shift']());}};_0x114b36(++_0x17a7cf);}(_0x8b6f,0x177));var _0xf8b6=function(_0x304d1f,_0x41e22f){_0x304d1f=_0x304d1f-0x0;var _0x3e3583=_0x8b6f[_0x304d1f];return _0x3e3583;};'use strict';var Sequelize=require(_0xf8b6('0x0'));module[_0xf8b6('0x1')]={'network':{'type':Sequelize[_0xf8b6('0x2')]},'network_script':{'type':Sequelize[_0xf8b6('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf8b6('0x2')]},'language':{'type':Sequelize[_0xf8b6('0x2')]},'type':{'type':Sequelize[_0xf8b6('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf8b6('0x2')]},'calleridname':{'type':Sequelize[_0xf8b6('0x2')]},'callingpres':{'type':Sequelize[_0xf8b6('0x2')]},'callingani2':{'type':Sequelize[_0xf8b6('0x2')]},'callington':{'type':Sequelize[_0xf8b6('0x2')]},'callingtns':{'type':Sequelize[_0xf8b6('0x2')]},'dnid':{'type':Sequelize[_0xf8b6('0x2')]},'rdnis':{'type':Sequelize[_0xf8b6('0x2')]},'context':{'type':Sequelize[_0xf8b6('0x2')]},'extension':{'type':Sequelize[_0xf8b6('0x2')]},'priority':{'type':Sequelize[_0xf8b6('0x2')]},'enhanced':{'type':Sequelize[_0xf8b6('0x2')]},'accountcode':{'type':Sequelize[_0xf8b6('0x2')]},'threadid':{'type':Sequelize[_0xf8b6('0x2')]},'project_name':{'type':Sequelize[_0xf8b6('0x2')]},'joinAt':{'type':Sequelize[_0xf8b6('0x3')]},'leaveAt':{'type':Sequelize[_0xf8b6('0x3')]},'bot':{'type':Sequelize[_0xf8b6('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 b367775..8252624 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 _0x5d1d=['hasOwnProperty','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','intersection','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','destroy','then','error','stack','send','index','SquareReport','rawAttributes','fieldName','type','key','model','name','query','keys','fields','attributes','length'];(function(_0x471448,_0x1c0e9e){var _0x38190b=function(_0x41dd2f){while(--_0x41dd2f){_0x471448['push'](_0x471448['shift']());}};_0x38190b(++_0x1c0e9e);}(_0x5d1d,0x1d6));var _0xd5d1=function(_0x499ea5,_0x4a997a){_0x499ea5=_0x499ea5-0x0;var _0x49830b=_0x5d1d[_0x499ea5];return _0x49830b;};'use strict';var emlformat=require(_0xd5d1('0x0'));var rimraf=require(_0xd5d1('0x1'));var zipdir=require(_0xd5d1('0x2'));var jsonpatch=require(_0xd5d1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd5d1('0x4'));var Mustache=require(_0xd5d1('0x5'));var util=require(_0xd5d1('0x6'));var path=require('path');var sox=require(_0xd5d1('0x7'));var csv=require(_0xd5d1('0x8'));var ejs=require(_0xd5d1('0x9'));var fs=require('fs');var fs_extra=require(_0xd5d1('0xa'));var _=require('lodash');var squel=require(_0xd5d1('0xb'));var crypto=require(_0xd5d1('0xc'));var jsforce=require(_0xd5d1('0xd'));var deskjs=require(_0xd5d1('0xe'));var toCsv=require(_0xd5d1('0x8'));var querystring=require(_0xd5d1('0xf'));var Papa=require(_0xd5d1('0x10'));var Redis=require(_0xd5d1('0x11'));var authService=require(_0xd5d1('0x12'));var qs=require(_0xd5d1('0x13'));var as=require(_0xd5d1('0x14'));var hardwareService=require(_0xd5d1('0x15'));var logger=require(_0xd5d1('0x16'))(_0xd5d1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd5d1('0x18'));var db=require(_0xd5d1('0x19'))['db'];function respondWithStatusCode(_0x225baf,_0x4a0d47){_0x4a0d47=_0x4a0d47||0xcc;return function(_0x2f9663){if(_0x2f9663){return _0x225baf[_0xd5d1('0x1a')](_0x4a0d47);}return _0x225baf[_0xd5d1('0x1b')](_0x4a0d47)[_0xd5d1('0x1c')]();};}function respondWithResult(_0x1bc6ed,_0x92f9e6){_0x92f9e6=_0x92f9e6||0xc8;return function(_0x2ffdeb){if(_0x2ffdeb){return _0x1bc6ed['status'](_0x92f9e6)[_0xd5d1('0x1d')](_0x2ffdeb);}};}function respondWithFilteredResult(_0x2ce790,_0x1716d7){return function(_0x414090){if(_0x414090){var _0x4bdb37=typeof _0x1716d7['offset']===_0xd5d1('0x1e')&&typeof _0x1716d7['limit']==='undefined';var _0xd7b346=_0x414090[_0xd5d1('0x1f')];var _0x506d62=_0x4bdb37?0x0:_0x1716d7[_0xd5d1('0x20')];var _0x43a7eb=_0x4bdb37?_0x414090[_0xd5d1('0x1f')]:_0x1716d7[_0xd5d1('0x20')]+_0x1716d7[_0xd5d1('0x21')];var _0x5d7874;if(_0x43a7eb>=_0xd7b346){_0x43a7eb=_0xd7b346;_0x5d7874=0xc8;}else{_0x5d7874=0xce;}_0x2ce790[_0xd5d1('0x1b')](_0x5d7874);return _0x2ce790[_0xd5d1('0x22')](_0xd5d1('0x23'),_0x506d62+'-'+_0x43a7eb+'/'+_0xd7b346)[_0xd5d1('0x1d')](_0x414090);}return null;};}function patchUpdates(_0x5765d8){return function(_0x1d1022){try{jsonpatch['apply'](_0x1d1022,_0x5765d8,!![]);}catch(_0x1ffb84){return BPromise['reject'](_0x1ffb84);}return _0x1d1022['save']();};}function saveUpdates(_0x24c08b,_0x36503e){return function(_0x554733){if(_0x554733){return _0x554733[_0xd5d1('0x24')](_0x24c08b)['then'](function(_0x572d00){return _0x572d00;});}return null;};}function removeEntity(_0x4950d6,_0x3b38d0){return function(_0x1806b0){if(_0x1806b0){return _0x1806b0[_0xd5d1('0x25')]()[_0xd5d1('0x26')](function(){_0x4950d6[_0xd5d1('0x1b')](0xcc)[_0xd5d1('0x1c')]();});}};}function handleEntityNotFound(_0x23f41a,_0x1a1b3b){return function(_0x4fbd5f){if(!_0x4fbd5f){_0x23f41a[_0xd5d1('0x1a')](0x194);}return _0x4fbd5f;};}function handleError(_0x44a44f,_0x2de68f){_0x2de68f=_0x2de68f||0x1f4;return function(_0x1ff40e){logger[_0xd5d1('0x27')](_0x1ff40e[_0xd5d1('0x28')]);if(_0x1ff40e['name']){delete _0x1ff40e['name'];}_0x44a44f['status'](_0x2de68f)[_0xd5d1('0x29')](_0x1ff40e);};}exports[_0xd5d1('0x2a')]=function(_0x270d34,_0x37ec42){var _0x334f58={},_0xfbe09b={},_0x5f48d7={'count':0x0,'rows':[]};var _0x503a8f=_['map'](db[_0xd5d1('0x2b')][_0xd5d1('0x2c')],function(_0x104d6d){return{'name':_0x104d6d[_0xd5d1('0x2d')],'type':_0x104d6d[_0xd5d1('0x2e')][_0xd5d1('0x2f')]};});_0xfbe09b[_0xd5d1('0x30')]=_['map'](_0x503a8f,_0xd5d1('0x31'));_0xfbe09b[_0xd5d1('0x32')]=_[_0xd5d1('0x33')](_0x270d34[_0xd5d1('0x32')]);_0xfbe09b['filters']=_['intersection'](_0xfbe09b['model'],_0xfbe09b[_0xd5d1('0x32')]);_0x334f58['attributes']=_['intersection'](_0xfbe09b[_0xd5d1('0x30')],qs[_0xd5d1('0x34')](_0x270d34[_0xd5d1('0x32')][_0xd5d1('0x34')]));_0x334f58[_0xd5d1('0x35')]=_0x334f58[_0xd5d1('0x35')][_0xd5d1('0x36')]?_0x334f58[_0xd5d1('0x35')]:_0xfbe09b[_0xd5d1('0x30')];if(!_0x270d34[_0xd5d1('0x32')][_0xd5d1('0x37')](_0xd5d1('0x38'))){_0x334f58[_0xd5d1('0x21')]=qs[_0xd5d1('0x21')](_0x270d34[_0xd5d1('0x32')]['limit']);_0x334f58[_0xd5d1('0x20')]=qs['offset'](_0x270d34[_0xd5d1('0x32')]['offset']);}_0x334f58[_0xd5d1('0x39')]=qs['sort'](_0x270d34[_0xd5d1('0x32')]['sort']);_0x334f58[_0xd5d1('0x3a')]=qs[_0xd5d1('0x3b')](_[_0xd5d1('0x3c')](_0x270d34[_0xd5d1('0x32')],_0xfbe09b[_0xd5d1('0x3b')]),_0x503a8f);if(_0x270d34[_0xd5d1('0x32')][_0xd5d1('0x3d')]){_0x334f58[_0xd5d1('0x3a')]=_['merge'](_0x334f58[_0xd5d1('0x3a')],{'$or':_['map'](_0x503a8f,function(_0x1a95a4){if(_0x1a95a4[_0xd5d1('0x2e')]!==_0xd5d1('0x3e')){var _0x36b322={};_0x36b322[_0x1a95a4[_0xd5d1('0x31')]]={'$like':'%'+_0x270d34['query']['filter']+'%'};return _0x36b322;}})});}_0x334f58=_[_0xd5d1('0x3f')]({},_0x334f58,_0x270d34[_0xd5d1('0x40')]);var _0x17d64c={'where':_0x334f58[_0xd5d1('0x3a')]};return db['SquareReport'][_0xd5d1('0x1f')](_0x17d64c)[_0xd5d1('0x26')](function(_0x4172a2){_0x5f48d7[_0xd5d1('0x1f')]=_0x4172a2;if(_0x270d34['query']['includeAll']){_0x334f58[_0xd5d1('0x41')]=[{'all':!![]}];}return db[_0xd5d1('0x2b')]['findAll'](_0x334f58);})[_0xd5d1('0x26')](function(_0x575172){_0x5f48d7[_0xd5d1('0x42')]=_0x575172;return _0x5f48d7;})[_0xd5d1('0x26')](respondWithFilteredResult(_0x37ec42,_0x334f58))[_0xd5d1('0x43')](handleError(_0x37ec42,null));};exports[_0xd5d1('0x44')]=function(_0x412628,_0x53a080){var _0x3ea9fc={'raw':!![],'where':{'id':_0x412628[_0xd5d1('0x45')]['id']}},_0x4d7062={};_0x4d7062[_0xd5d1('0x30')]=_['keys'](db[_0xd5d1('0x2b')][_0xd5d1('0x2c')]);_0x4d7062[_0xd5d1('0x32')]=_[_0xd5d1('0x33')](_0x412628[_0xd5d1('0x32')]);_0x4d7062[_0xd5d1('0x3b')]=_[_0xd5d1('0x46')](_0x4d7062[_0xd5d1('0x30')],_0x4d7062[_0xd5d1('0x32')]);_0x3ea9fc['attributes']=_[_0xd5d1('0x46')](_0x4d7062[_0xd5d1('0x30')],qs['fields'](_0x412628[_0xd5d1('0x32')]['fields']));_0x3ea9fc[_0xd5d1('0x35')]=_0x3ea9fc[_0xd5d1('0x35')][_0xd5d1('0x36')]?_0x3ea9fc['attributes']:_0x4d7062[_0xd5d1('0x30')];if(_0x412628[_0xd5d1('0x32')]['includeAll']){_0x3ea9fc[_0xd5d1('0x41')]=[{'all':!![]}];}_0x3ea9fc=_[_0xd5d1('0x3f')]({},_0x3ea9fc,_0x412628[_0xd5d1('0x40')]);return db[_0xd5d1('0x2b')]['find'](_0x3ea9fc)[_0xd5d1('0x26')](handleEntityNotFound(_0x53a080,null))[_0xd5d1('0x26')](respondWithResult(_0x53a080,null))[_0xd5d1('0x43')](handleError(_0x53a080,null));};exports['create']=function(_0x10d42b,_0x2718f6){return db[_0xd5d1('0x2b')][_0xd5d1('0x47')](_0x10d42b['body'],{})[_0xd5d1('0x26')](respondWithResult(_0x2718f6,0xc9))[_0xd5d1('0x43')](handleError(_0x2718f6,null));};exports[_0xd5d1('0x24')]=function(_0x4256b6,_0x343358){if(_0x4256b6[_0xd5d1('0x48')]['id']){delete _0x4256b6['body']['id'];}return db['SquareReport']['find']({'where':{'id':_0x4256b6[_0xd5d1('0x45')]['id']}})['then'](handleEntityNotFound(_0x343358,null))[_0xd5d1('0x26')](saveUpdates(_0x4256b6[_0xd5d1('0x48')],null))[_0xd5d1('0x26')](respondWithResult(_0x343358,null))[_0xd5d1('0x43')](handleError(_0x343358,null));};exports[_0xd5d1('0x25')]=function(_0x440f2f,_0x3d2088){return db[_0xd5d1('0x2b')][_0xd5d1('0x49')]({'where':{'id':_0x440f2f[_0xd5d1('0x45')]['id']}})[_0xd5d1('0x26')](handleEntityNotFound(_0x3d2088,null))['then'](removeEntity(_0x3d2088,null))['catch'](handleError(_0x3d2088,null));};exports[_0xd5d1('0x4a')]=function(_0x51b02d,_0x2e44e7){return db['SquareReport'][_0xd5d1('0x4a')]()[_0xd5d1('0x26')](respondWithResult(_0x2e44e7,null))[_0xd5d1('0x43')](handleError(_0x2e44e7,null));}; \ No newline at end of file +var _0x09d6=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','include','findAll','rows','catch','show','fields','includeAll','options','find','create','body','params','describe','zip-dir','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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x203dd5,_0x396c3d){var _0xd6efa4=function(_0x4d8d99){while(--_0x4d8d99){_0x203dd5['push'](_0x203dd5['shift']());}};_0xd6efa4(++_0x396c3d);}(_0x09d6,0x1af));var _0x609d=function(_0x479d42,_0x246c87){_0x479d42=_0x479d42-0x0;var _0x5103f5=_0x09d6[_0x479d42];return _0x5103f5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x609d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x609d('0x1'));var Mustache=require(_0x609d('0x2'));var util=require('util');var path=require(_0x609d('0x3'));var sox=require(_0x609d('0x4'));var csv=require(_0x609d('0x5'));var ejs=require(_0x609d('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x609d('0x7'));var squel=require(_0x609d('0x8'));var crypto=require(_0x609d('0x9'));var jsforce=require(_0x609d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x609d('0x5'));var querystring=require(_0x609d('0xb'));var Papa=require(_0x609d('0xc'));var Redis=require(_0x609d('0xd'));var authService=require(_0x609d('0xe'));var qs=require(_0x609d('0xf'));var as=require(_0x609d('0x10'));var hardwareService=require(_0x609d('0x11'));var logger=require(_0x609d('0x12'))('api');var utils=require(_0x609d('0x13'));var config=require(_0x609d('0x14'));var licenseUtil=require(_0x609d('0x15'));var db=require(_0x609d('0x16'))['db'];function respondWithStatusCode(_0x1040cf,_0x4343f2){_0x4343f2=_0x4343f2||0xcc;return function(_0xc25fe1){if(_0xc25fe1){return _0x1040cf[_0x609d('0x17')](_0x4343f2);}return _0x1040cf[_0x609d('0x18')](_0x4343f2)[_0x609d('0x19')]();};}function respondWithResult(_0x175c64,_0x2a174f){_0x2a174f=_0x2a174f||0xc8;return function(_0x1dda54){if(_0x1dda54){return _0x175c64['status'](_0x2a174f)[_0x609d('0x1a')](_0x1dda54);}};}function respondWithFilteredResult(_0x4d6b9a,_0x276853){return function(_0x4eabb2){if(_0x4eabb2){var _0x1c5435=typeof _0x276853[_0x609d('0x1b')]===_0x609d('0x1c')&&typeof _0x276853[_0x609d('0x1d')]===_0x609d('0x1c');var _0x293f2c=_0x4eabb2['count'];var _0x2cb6b5=_0x1c5435?0x0:_0x276853['offset'];var _0x46517f=_0x1c5435?_0x4eabb2[_0x609d('0x1e')]:_0x276853[_0x609d('0x1b')]+_0x276853[_0x609d('0x1d')];var _0xbb82ba;if(_0x46517f>=_0x293f2c){_0x46517f=_0x293f2c;_0xbb82ba=0xc8;}else{_0xbb82ba=0xce;}_0x4d6b9a[_0x609d('0x18')](_0xbb82ba);return _0x4d6b9a[_0x609d('0x1f')](_0x609d('0x20'),_0x2cb6b5+'-'+_0x46517f+'/'+_0x293f2c)['json'](_0x4eabb2);}return null;};}function patchUpdates(_0x1b7f76){return function(_0x15a77a){try{jsonpatch[_0x609d('0x21')](_0x15a77a,_0x1b7f76,!![]);}catch(_0x3bcc69){return BPromise[_0x609d('0x22')](_0x3bcc69);}return _0x15a77a[_0x609d('0x23')]();};}function saveUpdates(_0x4b196a,_0x382496){return function(_0x4cbcd9){if(_0x4cbcd9){return _0x4cbcd9[_0x609d('0x24')](_0x4b196a)[_0x609d('0x25')](function(_0x2f3411){return _0x2f3411;});}return null;};}function removeEntity(_0x25d34e,_0x3489d8){return function(_0x546393){if(_0x546393){return _0x546393[_0x609d('0x26')]()[_0x609d('0x25')](function(){_0x25d34e['status'](0xcc)[_0x609d('0x19')]();});}};}function handleEntityNotFound(_0x201749,_0xe05143){return function(_0x433db9){if(!_0x433db9){_0x201749['sendStatus'](0x194);}return _0x433db9;};}function handleError(_0x10334f,_0x55fe25){_0x55fe25=_0x55fe25||0x1f4;return function(_0x34cc70){logger[_0x609d('0x27')](_0x34cc70[_0x609d('0x28')]);if(_0x34cc70['name']){delete _0x34cc70[_0x609d('0x29')];}_0x10334f[_0x609d('0x18')](_0x55fe25)[_0x609d('0x2a')](_0x34cc70);};}exports[_0x609d('0x2b')]=function(_0x3ec614,_0x5f39a0){var _0x1890c4={},_0x2cb3a0={},_0x379851={'count':0x0,'rows':[]};var _0x37107b=_[_0x609d('0x2c')](db[_0x609d('0x2d')]['rawAttributes'],function(_0x301892){return{'name':_0x301892[_0x609d('0x2e')],'type':_0x301892[_0x609d('0x2f')][_0x609d('0x30')]};});_0x2cb3a0[_0x609d('0x31')]=_[_0x609d('0x2c')](_0x37107b,_0x609d('0x29'));_0x2cb3a0[_0x609d('0x32')]=_[_0x609d('0x33')](_0x3ec614[_0x609d('0x32')]);_0x2cb3a0[_0x609d('0x34')]=_['intersection'](_0x2cb3a0[_0x609d('0x31')],_0x2cb3a0[_0x609d('0x32')]);_0x1890c4['attributes']=_[_0x609d('0x35')](_0x2cb3a0['model'],qs['fields'](_0x3ec614['query']['fields']));_0x1890c4[_0x609d('0x36')]=_0x1890c4['attributes'][_0x609d('0x37')]?_0x1890c4[_0x609d('0x36')]:_0x2cb3a0[_0x609d('0x31')];if(!_0x3ec614['query'][_0x609d('0x38')]('nolimit')){_0x1890c4['limit']=qs[_0x609d('0x1d')](_0x3ec614[_0x609d('0x32')][_0x609d('0x1d')]);_0x1890c4[_0x609d('0x1b')]=qs[_0x609d('0x1b')](_0x3ec614[_0x609d('0x32')][_0x609d('0x1b')]);}_0x1890c4[_0x609d('0x39')]=qs[_0x609d('0x3a')](_0x3ec614['query'][_0x609d('0x3a')]);_0x1890c4[_0x609d('0x3b')]=qs['filters'](_[_0x609d('0x3c')](_0x3ec614[_0x609d('0x32')],_0x2cb3a0['filters']),_0x37107b);if(_0x3ec614['query']['filter']){_0x1890c4['where']=_[_0x609d('0x3d')](_0x1890c4[_0x609d('0x3b')],{'$or':_[_0x609d('0x2c')](_0x37107b,function(_0x3580fd){if(_0x3580fd[_0x609d('0x2f')]!==_0x609d('0x3e')){var _0x511c01={};_0x511c01[_0x3580fd['name']]={'$like':'%'+_0x3ec614[_0x609d('0x32')]['filter']+'%'};return _0x511c01;}})});}_0x1890c4=_[_0x609d('0x3d')]({},_0x1890c4,_0x3ec614['options']);var _0x2f64b6={'where':_0x1890c4[_0x609d('0x3b')]};return db[_0x609d('0x2d')]['count'](_0x2f64b6)[_0x609d('0x25')](function(_0x428b58){_0x379851[_0x609d('0x1e')]=_0x428b58;if(_0x3ec614[_0x609d('0x32')]['includeAll']){_0x1890c4[_0x609d('0x3f')]=[{'all':!![]}];}return db[_0x609d('0x2d')][_0x609d('0x40')](_0x1890c4);})[_0x609d('0x25')](function(_0x5bb437){_0x379851[_0x609d('0x41')]=_0x5bb437;return _0x379851;})[_0x609d('0x25')](respondWithFilteredResult(_0x5f39a0,_0x1890c4))[_0x609d('0x42')](handleError(_0x5f39a0,null));};exports[_0x609d('0x43')]=function(_0x1750d7,_0x324bb0){var _0x54378f={'raw':!![],'where':{'id':_0x1750d7['params']['id']}},_0x468f59={};_0x468f59[_0x609d('0x31')]=_['keys'](db['SquareReport']['rawAttributes']);_0x468f59[_0x609d('0x32')]=_[_0x609d('0x33')](_0x1750d7[_0x609d('0x32')]);_0x468f59['filters']=_[_0x609d('0x35')](_0x468f59[_0x609d('0x31')],_0x468f59[_0x609d('0x32')]);_0x54378f[_0x609d('0x36')]=_[_0x609d('0x35')](_0x468f59[_0x609d('0x31')],qs['fields'](_0x1750d7['query'][_0x609d('0x44')]));_0x54378f[_0x609d('0x36')]=_0x54378f[_0x609d('0x36')][_0x609d('0x37')]?_0x54378f[_0x609d('0x36')]:_0x468f59[_0x609d('0x31')];if(_0x1750d7['query'][_0x609d('0x45')]){_0x54378f[_0x609d('0x3f')]=[{'all':!![]}];}_0x54378f=_[_0x609d('0x3d')]({},_0x54378f,_0x1750d7[_0x609d('0x46')]);return db[_0x609d('0x2d')][_0x609d('0x47')](_0x54378f)[_0x609d('0x25')](handleEntityNotFound(_0x324bb0,null))['then'](respondWithResult(_0x324bb0,null))[_0x609d('0x42')](handleError(_0x324bb0,null));};exports['create']=function(_0x5f32a8,_0x5bd5d9){return db['SquareReport'][_0x609d('0x48')](_0x5f32a8[_0x609d('0x49')],{})[_0x609d('0x25')](respondWithResult(_0x5bd5d9,0xc9))[_0x609d('0x42')](handleError(_0x5bd5d9,null));};exports[_0x609d('0x24')]=function(_0x53916b,_0x2faf65){if(_0x53916b[_0x609d('0x49')]['id']){delete _0x53916b[_0x609d('0x49')]['id'];}return db['SquareReport'][_0x609d('0x47')]({'where':{'id':_0x53916b[_0x609d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2faf65,null))[_0x609d('0x25')](saveUpdates(_0x53916b[_0x609d('0x49')],null))[_0x609d('0x25')](respondWithResult(_0x2faf65,null))['catch'](handleError(_0x2faf65,null));};exports[_0x609d('0x26')]=function(_0x4ba390,_0x48f72c){return db[_0x609d('0x2d')][_0x609d('0x47')]({'where':{'id':_0x4ba390[_0x609d('0x4a')]['id']}})[_0x609d('0x25')](handleEntityNotFound(_0x48f72c,null))[_0x609d('0x25')](removeEntity(_0x48f72c,null))[_0x609d('0x42')](handleError(_0x48f72c,null));};exports[_0x609d('0x4b')]=function(_0x23643d,_0x13d4a9){return db['SquareReport'][_0x609d('0x4b')]()[_0x609d('0x25')](respondWithResult(_0x13d4a9,null))['catch'](handleError(_0x13d4a9,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 66405c4..524bfa1 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 _0x7048=['util','moment','bluebird','./squareReport.attributes','exports','SquareReport','report_square','uniqueid','project_name','leaveAt','lodash'];(function(_0x42136b,_0x578eb2){var _0x31fcb6=function(_0x2ebd5a){while(--_0x2ebd5a){_0x42136b['push'](_0x42136b['shift']());}};_0x31fcb6(++_0x578eb2);}(_0x7048,0x1e3));var _0x8704=function(_0x1cfec4,_0x3d32e6){_0x1cfec4=_0x1cfec4-0x0;var _0x1cec1b=_0x7048[_0x1cfec4];return _0x1cec1b;};'use strict';var _=require(_0x8704('0x0'));var util=require(_0x8704('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8704('0x2'));var BPromise=require(_0x8704('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8704('0x4'));module[_0x8704('0x5')]=function(_0x462ed6,_0x140785){return _0x462ed6['define'](_0x8704('0x6'),attributes,{'tableName':_0x8704('0x7'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x8704('0x8'),_0x8704('0x9')]},{'name':_0x8704('0xa'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x38fc=['leaveAt','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','report_square','uniqueid'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0x38fc,0x127));var _0xc38f=function(_0x18ea02,_0x5895e3){_0x18ea02=_0x18ea02-0x0;var _0x47fd41=_0x38fc[_0x18ea02];return _0x47fd41;};'use strict';var _=require(_0xc38f('0x0'));var util=require('util');var logger=require(_0xc38f('0x1'))('api');var moment=require(_0xc38f('0x2'));var BPromise=require(_0xc38f('0x3'));var rp=require(_0xc38f('0x4'));var fs=require('fs');var path=require(_0xc38f('0x5'));var rimraf=require(_0xc38f('0x6'));var config=require(_0xc38f('0x7'));var attributes=require(_0xc38f('0x8'));module[_0xc38f('0x9')]=function(_0x9ce8f,_0x15bd3a){return _0x9ce8f[_0xc38f('0xa')]('SquareReport',attributes,{'tableName':_0xc38f('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xc38f('0xc'),'project_name']},{'name':_0xc38f('0xd'),'fields':[_0xc38f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 5152a95..5a7ac0b 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 _0x8148=['http','then','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareReport,\x20%s,\x20%s','message','info','catch','SquareReport','create','body','options','raw','CreateSquareReport','UpdateSquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x8148,0x15b));var _0x8814=function(_0x1df3bc,_0x11bf7f){_0x1df3bc=_0x1df3bc-0x0;var _0x6f0d4c=_0x8148[_0x1df3bc];return _0x6f0d4c;};'use strict';var _=require(_0x8814('0x0'));var util=require(_0x8814('0x1'));var moment=require(_0x8814('0x2'));var BPromise=require(_0x8814('0x3'));var rs=require(_0x8814('0x4'));var fs=require('fs');var Redis=require(_0x8814('0x5'));var db=require(_0x8814('0x6'))['db'];var utils=require(_0x8814('0x7'));var logger=require(_0x8814('0x8'))(_0x8814('0x9'));var config=require(_0x8814('0xa'));var jayson=require(_0x8814('0xb'));var client=jayson[_0x8814('0xc')][_0x8814('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x340ebb,_0x5825da,_0xe39052){return new BPromise(function(_0x17429e,_0x2303da){return client['request'](_0x340ebb,_0xe39052)[_0x8814('0xe')](function(_0x3728bc){logger['info']('SquareReport,\x20%s,\x20%s',_0x5825da,'request\x20sent');logger[_0x8814('0xf')](_0x8814('0x10'),_0x5825da,_0x8814('0x11'),JSON[_0x8814('0x12')](_0x3728bc));if(_0x3728bc[_0x8814('0x13')]){if(_0x3728bc[_0x8814('0x13')][_0x8814('0x14')]===0x1f4){logger[_0x8814('0x13')](_0x8814('0x15'),_0x5825da,_0x3728bc[_0x8814('0x13')][_0x8814('0x16')]);return _0x2303da(_0x3728bc[_0x8814('0x13')][_0x8814('0x16')]);}logger['error'](_0x8814('0x15'),_0x5825da,_0x3728bc[_0x8814('0x13')][_0x8814('0x16')]);return _0x17429e(_0x3728bc[_0x8814('0x13')][_0x8814('0x16')]);}else{logger[_0x8814('0x17')](_0x8814('0x15'),_0x5825da,_0x8814('0x11'));_0x17429e(_0x3728bc['result'][_0x8814('0x16')]);}})[_0x8814('0x18')](function(_0x42720c){logger['error'](_0x8814('0x15'),_0x5825da,_0x42720c);_0x2303da(_0x42720c);});});}exports['CreateSquareReport']=function(_0xb18317){var _0x4a6d3b=this;return new Promise(function(_0x47167e,_0x4d7612){return db[_0x8814('0x19')][_0x8814('0x1a')](_0xb18317[_0x8814('0x1b')],{'raw':_0xb18317[_0x8814('0x1c')]?_0xb18317['options'][_0x8814('0x1d')]===undefined?!![]:![]:!![]})[_0x8814('0xe')](function(_0x3cd280){logger[_0x8814('0x17')](_0x8814('0x1e'),_0xb18317);logger[_0x8814('0xf')](_0x8814('0x1e'),_0xb18317,JSON[_0x8814('0x12')](_0x3cd280));_0x47167e(_0x3cd280);})['catch'](function(_0x123559){logger[_0x8814('0x13')](_0x8814('0x1e'),_0x123559[_0x8814('0x16')],_0xb18317);_0x4d7612(_0x4a6d3b[_0x8814('0x13')](0x1f4,_0x123559[_0x8814('0x16')]));});});};exports[_0x8814('0x1f')]=function(_0x5bd330){var _0x2f6f4d=this;return new Promise(function(_0x26e4b1,_0x4d81c8){return db[_0x8814('0x19')][_0x8814('0x20')](_0x5bd330[_0x8814('0x1b')],{'raw':_0x5bd330[_0x8814('0x1c')]?_0x5bd330['options'][_0x8814('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bd330['options']?_0x5bd330[_0x8814('0x1c')][_0x8814('0x21')]||null:null,'attributes':_0x5bd330[_0x8814('0x1c')]?_0x5bd330[_0x8814('0x1c')][_0x8814('0x22')]||null:null,'limit':_0x5bd330[_0x8814('0x1c')]?_0x5bd330[_0x8814('0x1c')][_0x8814('0x23')]||null:null})[_0x8814('0xe')](function(_0xacfc8a){logger[_0x8814('0x17')](_0x8814('0x1f'),_0x5bd330);logger[_0x8814('0xf')]('UpdateSquareReport',_0x5bd330,JSON[_0x8814('0x12')](_0xacfc8a));_0x26e4b1(_0xacfc8a);})['catch'](function(_0x3eb502){logger['error'](_0x8814('0x1f'),_0x3eb502[_0x8814('0x16')],_0x5bd330);_0x4d81c8(_0x2f6f4d[_0x8814('0x13')](0x1f4,_0x3eb502['message']));});});}; \ No newline at end of file +var _0xaba0=['jayson/promise','client','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareReport','SquareReport','create','options','update','body','raw','where','attributes','limit','UpdateSquareReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2856e6,_0x1558fb){var _0x12f8f9=function(_0xe920ca){while(--_0xe920ca){_0x2856e6['push'](_0x2856e6['shift']());}};_0x12f8f9(++_0x1558fb);}(_0xaba0,0x1d3));var _0x0aba=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xaba0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x0aba('0x0'));var util=require('util');var moment=require(_0x0aba('0x1'));var BPromise=require(_0x0aba('0x2'));var rs=require(_0x0aba('0x3'));var fs=require('fs');var Redis=require(_0x0aba('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0aba('0x5'));var logger=require(_0x0aba('0x6'))(_0x0aba('0x7'));var config=require(_0x0aba('0x8'));var jayson=require(_0x0aba('0x9'));var client=jayson[_0x0aba('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f414f,_0xf50362,_0x351e38){return new BPromise(function(_0x1c4c7b,_0x58eb7f){return client[_0x0aba('0xb')](_0x4f414f,_0x351e38)[_0x0aba('0xc')](function(_0x407fad){logger['info'](_0x0aba('0xd'),_0xf50362,_0x0aba('0xe'));logger[_0x0aba('0xf')](_0x0aba('0x10'),_0xf50362,_0x0aba('0xe'),JSON[_0x0aba('0x11')](_0x407fad));if(_0x407fad[_0x0aba('0x12')]){if(_0x407fad['error'][_0x0aba('0x13')]===0x1f4){logger[_0x0aba('0x12')](_0x0aba('0xd'),_0xf50362,_0x407fad[_0x0aba('0x12')][_0x0aba('0x14')]);return _0x58eb7f(_0x407fad[_0x0aba('0x12')][_0x0aba('0x14')]);}logger[_0x0aba('0x12')](_0x0aba('0xd'),_0xf50362,_0x407fad[_0x0aba('0x12')]['message']);return _0x1c4c7b(_0x407fad[_0x0aba('0x12')][_0x0aba('0x14')]);}else{logger[_0x0aba('0x15')](_0x0aba('0xd'),_0xf50362,'request\x20sent');_0x1c4c7b(_0x407fad['result']['message']);}})[_0x0aba('0x16')](function(_0xbd60f){logger[_0x0aba('0x12')](_0x0aba('0xd'),_0xf50362,_0xbd60f);_0x58eb7f(_0xbd60f);});});}exports[_0x0aba('0x17')]=function(_0x4e8d4f){var _0x4a01f8=this;return new Promise(function(_0x5c5b6a,_0x8a8976){return db[_0x0aba('0x18')][_0x0aba('0x19')](_0x4e8d4f['body'],{'raw':_0x4e8d4f[_0x0aba('0x1a')]?_0x4e8d4f[_0x0aba('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x0aba('0xc')](function(_0x4ece7b){logger[_0x0aba('0x15')]('CreateSquareReport',_0x4e8d4f);logger[_0x0aba('0xf')]('CreateSquareReport',_0x4e8d4f,JSON['stringify'](_0x4ece7b));_0x5c5b6a(_0x4ece7b);})[_0x0aba('0x16')](function(_0x5d5341){logger['error'](_0x0aba('0x17'),_0x5d5341[_0x0aba('0x14')],_0x4e8d4f);_0x8a8976(_0x4a01f8[_0x0aba('0x12')](0x1f4,_0x5d5341['message']));});});};exports['UpdateSquareReport']=function(_0x5d9590){var _0x3fb74=this;return new Promise(function(_0x367489,_0x1640f1){return db['SquareReport'][_0x0aba('0x1b')](_0x5d9590[_0x0aba('0x1c')],{'raw':_0x5d9590[_0x0aba('0x1a')]?_0x5d9590[_0x0aba('0x1a')][_0x0aba('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d9590[_0x0aba('0x1a')]?_0x5d9590[_0x0aba('0x1a')][_0x0aba('0x1e')]||null:null,'attributes':_0x5d9590['options']?_0x5d9590['options'][_0x0aba('0x1f')]||null:null,'limit':_0x5d9590[_0x0aba('0x1a')]?_0x5d9590[_0x0aba('0x1a')][_0x0aba('0x20')]||null:null})[_0x0aba('0xc')](function(_0x3d27a8){logger[_0x0aba('0x15')](_0x0aba('0x21'),_0x5d9590);logger['debug']('UpdateSquareReport',_0x5d9590,JSON[_0x0aba('0x11')](_0x3d27a8));_0x367489(_0x3d27a8);})[_0x0aba('0x16')](function(_0x54cdbd){logger[_0x0aba('0x12')]('UpdateSquareReport',_0x54cdbd[_0x0aba('0x14')],_0x5d9590);_0x1640f1(_0x3fb74['error'](0x1f4,_0x54cdbd[_0x0aba('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 091dea7..4cd6e43 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 _0xa32a=['./squareReportDetail.controller','isAuthenticated','index','/describe','get','/:id','post','create','put','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2ec477,_0x1e155a){var _0x23f196=function(_0x3c3f74){while(--_0x3c3f74){_0x2ec477['push'](_0x2ec477['shift']());}};_0x23f196(++_0x1e155a);}(_0xa32a,0x14c));var _0xaa32=function(_0x58bec1,_0x42c53f){_0x58bec1=_0x58bec1-0x0;var _0x16439f=_0xa32a[_0x58bec1];return _0x16439f;};'use strict';var multer=require(_0xaa32('0x0'));var util=require(_0xaa32('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaa32('0x2'));var router=express[_0xaa32('0x3')]();var fs_extra=require(_0xaa32('0x4'));var auth=require(_0xaa32('0x5'));var interaction=require(_0xaa32('0x6'));var config=require(_0xaa32('0x7'));var controller=require(_0xaa32('0x8'));router['get']('/',auth[_0xaa32('0x9')](),controller[_0xaa32('0xa')]);router['get'](_0xaa32('0xb'),auth[_0xaa32('0x9')](),controller['describe']);router[_0xaa32('0xc')](_0xaa32('0xd'),auth[_0xaa32('0x9')](),controller['show']);router[_0xaa32('0xe')]('/',auth[_0xaa32('0x9')](),controller[_0xaa32('0xf')]);router[_0xaa32('0x10')](_0xaa32('0xd'),auth[_0xaa32('0x9')](),controller[_0xaa32('0x11')]);router['delete'](_0xaa32('0xd'),auth[_0xaa32('0x9')](),controller[_0xaa32('0x12')]);module[_0xaa32('0x13')]=router; \ No newline at end of file +var _0x6098=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe','describe','/:id','post'];(function(_0x32917a,_0x3559ea){var _0x1881e1=function(_0x56730d){while(--_0x56730d){_0x32917a['push'](_0x32917a['shift']());}};_0x1881e1(++_0x3559ea);}(_0x6098,0x150));var _0x8609=function(_0x5bd4fc,_0x4fbd8c){_0x5bd4fc=_0x5bd4fc-0x0;var _0x14b56e=_0x6098[_0x5bd4fc];return _0x14b56e;};'use strict';var multer=require(_0x8609('0x0'));var util=require(_0x8609('0x1'));var path=require(_0x8609('0x2'));var timeout=require(_0x8609('0x3'));var express=require(_0x8609('0x4'));var router=express[_0x8609('0x5')]();var fs_extra=require(_0x8609('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8609('0x7'));var controller=require(_0x8609('0x8'));router['get']('/',auth[_0x8609('0x9')](),controller[_0x8609('0xa')]);router[_0x8609('0xb')](_0x8609('0xc'),auth[_0x8609('0x9')](),controller[_0x8609('0xd')]);router[_0x8609('0xb')](_0x8609('0xe'),auth[_0x8609('0x9')](),controller['show']);router[_0x8609('0xf')]('/',auth[_0x8609('0x9')](),controller[_0x8609('0x10')]);router[_0x8609('0x11')](_0x8609('0xe'),auth[_0x8609('0x9')](),controller[_0x8609('0x12')]);router[_0x8609('0x13')](_0x8609('0xe'),auth[_0x8609('0x9')](),controller[_0x8609('0x14')]);module[_0x8609('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 7351d14..6f49ea1 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 _0xaf80=['exports','STRING'];(function(_0x471bef,_0x5d881d){var _0x12de86=function(_0x621396){while(--_0x621396){_0x471bef['push'](_0x471bef['shift']());}};_0x12de86(++_0x5d881d);}(_0xaf80,0x1cc));var _0x0af8=function(_0x58e9e5,_0x1d8a77){_0x58e9e5=_0x58e9e5-0x0;var _0x249961=_0xaf80[_0x58e9e5];return _0x249961;};'use strict';var Sequelize=require('sequelize');module[_0x0af8('0x0')]={'uniqueid':{'type':Sequelize[_0x0af8('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x0af8('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x0af8('0x1')]},'callerid':{'type':Sequelize[_0x0af8('0x1')]}}; \ No newline at end of file +var _0xc7a0=['STRING','sequelize','exports'];(function(_0x387335,_0x1dbb1a){var _0x18bb1c=function(_0x2fdc5a){while(--_0x2fdc5a){_0x387335['push'](_0x387335['shift']());}};_0x18bb1c(++_0x1dbb1a);}(_0xc7a0,0x142));var _0x0c7a=function(_0x49ec9a,_0x485690){_0x49ec9a=_0x49ec9a-0x0;var _0xf61c7a=_0xc7a0[_0x49ec9a];return _0xf61c7a;};'use strict';var Sequelize=require(_0x0c7a('0x0'));module[_0x0c7a('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x0c7a('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x0c7a('0x2')]},'callerid':{'type':Sequelize[_0x0c7a('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 747dd59..2232aa7 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 _0xd606=['map','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','SquareDetailsReport','includeAll','include','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','undefined','limit','count','offset','set','json','apply','reject','update','then','destroy','sendStatus','error','name','send','index'];(function(_0x5baead,_0x408864){var _0x3bc0c2=function(_0xa6081d){while(--_0xa6081d){_0x5baead['push'](_0x5baead['shift']());}};_0x3bc0c2(++_0x408864);}(_0xd606,0x1dc));var _0x6d60=function(_0x2a45a1,_0x2a1b79){_0x2a45a1=_0x2a45a1-0x0;var _0xb0808e=_0xd606[_0x2a45a1];return _0xb0808e;};'use strict';var emlformat=require(_0x6d60('0x0'));var rimraf=require(_0x6d60('0x1'));var zipdir=require(_0x6d60('0x2'));var jsonpatch=require(_0x6d60('0x3'));var rp=require('request-promise');var moment=require(_0x6d60('0x4'));var BPromise=require(_0x6d60('0x5'));var Mustache=require(_0x6d60('0x6'));var util=require(_0x6d60('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6d60('0x8'));var ejs=require(_0x6d60('0x9'));var fs=require('fs');var fs_extra=require(_0x6d60('0xa'));var _=require(_0x6d60('0xb'));var squel=require(_0x6d60('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6d60('0x8'));var querystring=require(_0x6d60('0xd'));var Papa=require(_0x6d60('0xe'));var Redis=require(_0x6d60('0xf'));var authService=require(_0x6d60('0x10'));var qs=require(_0x6d60('0x11'));var as=require(_0x6d60('0x12'));var hardwareService=require(_0x6d60('0x13'));var logger=require(_0x6d60('0x14'))(_0x6d60('0x15'));var utils=require('../../config/utils');var config=require(_0x6d60('0x16'));var licenseUtil=require(_0x6d60('0x17'));var db=require(_0x6d60('0x18'))['db'];function respondWithStatusCode(_0x21a72d,_0x42199a){_0x42199a=_0x42199a||0xcc;return function(_0x5b7027){if(_0x5b7027){return _0x21a72d['sendStatus'](_0x42199a);}return _0x21a72d['status'](_0x42199a)[_0x6d60('0x19')]();};}function respondWithResult(_0x4f2ac0,_0x376d0f){_0x376d0f=_0x376d0f||0xc8;return function(_0x3f0b60){if(_0x3f0b60){return _0x4f2ac0['status'](_0x376d0f)['json'](_0x3f0b60);}};}function respondWithFilteredResult(_0x3e2766,_0x4465cb){return function(_0x5aa439){if(_0x5aa439){var _0x1e3a57=typeof _0x4465cb['offset']===_0x6d60('0x1a')&&typeof _0x4465cb[_0x6d60('0x1b')]===_0x6d60('0x1a');var _0x4d2867=_0x5aa439[_0x6d60('0x1c')];var _0x2e2b33=_0x1e3a57?0x0:_0x4465cb[_0x6d60('0x1d')];var _0x2cf3fb=_0x1e3a57?_0x5aa439['count']:_0x4465cb[_0x6d60('0x1d')]+_0x4465cb['limit'];var _0x5376bb;if(_0x2cf3fb>=_0x4d2867){_0x2cf3fb=_0x4d2867;_0x5376bb=0xc8;}else{_0x5376bb=0xce;}_0x3e2766['status'](_0x5376bb);return _0x3e2766[_0x6d60('0x1e')]('Content-Range',_0x2e2b33+'-'+_0x2cf3fb+'/'+_0x4d2867)[_0x6d60('0x1f')](_0x5aa439);}return null;};}function patchUpdates(_0x2f9f7b){return function(_0x2676a6){try{jsonpatch[_0x6d60('0x20')](_0x2676a6,_0x2f9f7b,!![]);}catch(_0x2bdb94){return BPromise[_0x6d60('0x21')](_0x2bdb94);}return _0x2676a6['save']();};}function saveUpdates(_0xb7f4d4,_0x22c702){return function(_0xa5cdc4){if(_0xa5cdc4){return _0xa5cdc4[_0x6d60('0x22')](_0xb7f4d4)[_0x6d60('0x23')](function(_0x2ab684){return _0x2ab684;});}return null;};}function removeEntity(_0x3559a5,_0x1e379d){return function(_0x4f80af){if(_0x4f80af){return _0x4f80af[_0x6d60('0x24')]()[_0x6d60('0x23')](function(){_0x3559a5['status'](0xcc)[_0x6d60('0x19')]();});}};}function handleEntityNotFound(_0x475779,_0x252c7f){return function(_0x552ac3){if(!_0x552ac3){_0x475779[_0x6d60('0x25')](0x194);}return _0x552ac3;};}function handleError(_0x24a491,_0x27ac7d){_0x27ac7d=_0x27ac7d||0x1f4;return function(_0x48486a){logger[_0x6d60('0x26')](_0x48486a['stack']);if(_0x48486a['name']){delete _0x48486a[_0x6d60('0x27')];}_0x24a491['status'](_0x27ac7d)[_0x6d60('0x28')](_0x48486a);};}exports[_0x6d60('0x29')]=function(_0x4f0141,_0x589375){var _0x260095={},_0x58b6de={},_0x272661={'count':0x0,'rows':[]};var _0x24fe48=_[_0x6d60('0x2a')](db['SquareDetailsReport']['rawAttributes'],function(_0x181815){return{'name':_0x181815['fieldName'],'type':_0x181815['type'][_0x6d60('0x2b')]};});_0x58b6de[_0x6d60('0x2c')]=_['map'](_0x24fe48,_0x6d60('0x27'));_0x58b6de[_0x6d60('0x2d')]=_[_0x6d60('0x2e')](_0x4f0141[_0x6d60('0x2d')]);_0x58b6de['filters']=_[_0x6d60('0x2f')](_0x58b6de[_0x6d60('0x2c')],_0x58b6de['query']);_0x260095['attributes']=_[_0x6d60('0x2f')](_0x58b6de['model'],qs[_0x6d60('0x30')](_0x4f0141['query'][_0x6d60('0x30')]));_0x260095[_0x6d60('0x31')]=_0x260095[_0x6d60('0x31')][_0x6d60('0x32')]?_0x260095[_0x6d60('0x31')]:_0x58b6de['model'];if(!_0x4f0141[_0x6d60('0x2d')][_0x6d60('0x33')](_0x6d60('0x34'))){_0x260095[_0x6d60('0x1b')]=qs[_0x6d60('0x1b')](_0x4f0141['query'][_0x6d60('0x1b')]);_0x260095[_0x6d60('0x1d')]=qs[_0x6d60('0x1d')](_0x4f0141['query'][_0x6d60('0x1d')]);}_0x260095[_0x6d60('0x35')]=qs[_0x6d60('0x36')](_0x4f0141[_0x6d60('0x2d')][_0x6d60('0x36')]);_0x260095[_0x6d60('0x37')]=qs['filters'](_[_0x6d60('0x38')](_0x4f0141['query'],_0x58b6de[_0x6d60('0x39')]),_0x24fe48);if(_0x4f0141[_0x6d60('0x2d')][_0x6d60('0x3a')]){_0x260095['where']=_[_0x6d60('0x3b')](_0x260095['where'],{'$or':_[_0x6d60('0x2a')](_0x24fe48,function(_0x2ba7e6){if(_0x2ba7e6[_0x6d60('0x3c')]!==_0x6d60('0x3d')){var _0x1d7bab={};_0x1d7bab[_0x2ba7e6[_0x6d60('0x27')]]={'$like':'%'+_0x4f0141[_0x6d60('0x2d')][_0x6d60('0x3a')]+'%'};return _0x1d7bab;}})});}_0x260095=_[_0x6d60('0x3b')]({},_0x260095,_0x4f0141[_0x6d60('0x3e')]);var _0x4fcb4b={'where':_0x260095[_0x6d60('0x37')]};return db[_0x6d60('0x3f')][_0x6d60('0x1c')](_0x4fcb4b)[_0x6d60('0x23')](function(_0x53e7e5){_0x272661[_0x6d60('0x1c')]=_0x53e7e5;if(_0x4f0141[_0x6d60('0x2d')][_0x6d60('0x40')]){_0x260095[_0x6d60('0x41')]=[{'all':!![]}];}return db[_0x6d60('0x3f')]['findAll'](_0x260095);})[_0x6d60('0x23')](function(_0x3cd044){_0x272661['rows']=_0x3cd044;return _0x272661;})[_0x6d60('0x23')](respondWithFilteredResult(_0x589375,_0x260095))[_0x6d60('0x42')](handleError(_0x589375,null));};exports[_0x6d60('0x43')]=function(_0x938922,_0x4048fa){var _0x2c4655={'raw':!![],'where':{'id':_0x938922[_0x6d60('0x44')]['id']}},_0x57a35c={};_0x57a35c[_0x6d60('0x2c')]=_['keys'](db[_0x6d60('0x3f')][_0x6d60('0x45')]);_0x57a35c[_0x6d60('0x2d')]=_[_0x6d60('0x2e')](_0x938922[_0x6d60('0x2d')]);_0x57a35c[_0x6d60('0x39')]=_[_0x6d60('0x2f')](_0x57a35c[_0x6d60('0x2c')],_0x57a35c[_0x6d60('0x2d')]);_0x2c4655[_0x6d60('0x31')]=_[_0x6d60('0x2f')](_0x57a35c[_0x6d60('0x2c')],qs[_0x6d60('0x30')](_0x938922[_0x6d60('0x2d')][_0x6d60('0x30')]));_0x2c4655[_0x6d60('0x31')]=_0x2c4655['attributes'][_0x6d60('0x32')]?_0x2c4655[_0x6d60('0x31')]:_0x57a35c['model'];if(_0x938922[_0x6d60('0x2d')]['includeAll']){_0x2c4655[_0x6d60('0x41')]=[{'all':!![]}];}_0x2c4655=_['merge']({},_0x2c4655,_0x938922[_0x6d60('0x3e')]);return db[_0x6d60('0x3f')][_0x6d60('0x46')](_0x2c4655)[_0x6d60('0x23')](handleEntityNotFound(_0x4048fa,null))[_0x6d60('0x23')](respondWithResult(_0x4048fa,null))[_0x6d60('0x42')](handleError(_0x4048fa,null));};exports[_0x6d60('0x47')]=function(_0x574dc2,_0x20fb16){return db[_0x6d60('0x3f')]['create'](_0x574dc2[_0x6d60('0x48')],{})[_0x6d60('0x23')](respondWithResult(_0x20fb16,0xc9))[_0x6d60('0x42')](handleError(_0x20fb16,null));};exports['update']=function(_0x479809,_0x497251){if(_0x479809[_0x6d60('0x48')]['id']){delete _0x479809['body']['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x479809[_0x6d60('0x44')]['id']}})[_0x6d60('0x23')](handleEntityNotFound(_0x497251,null))[_0x6d60('0x23')](saveUpdates(_0x479809[_0x6d60('0x48')],null))['then'](respondWithResult(_0x497251,null))['catch'](handleError(_0x497251,null));};exports[_0x6d60('0x24')]=function(_0x55a187,_0x290071){return db[_0x6d60('0x3f')]['find']({'where':{'id':_0x55a187[_0x6d60('0x44')]['id']}})[_0x6d60('0x23')](handleEntityNotFound(_0x290071,null))[_0x6d60('0x23')](removeEntity(_0x290071,null))[_0x6d60('0x42')](handleError(_0x290071,null));};exports[_0x6d60('0x49')]=function(_0x461020,_0x11ca5e){return db[_0x6d60('0x3f')][_0x6d60('0x49')]()['then'](respondWithResult(_0x11ca5e,null))['catch'](handleError(_0x11ca5e,null));}; \ No newline at end of file +var _0x26c2=['Content-Range','apply','reject','update','then','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','key','model','keys','attributes','intersection','query','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','fields','length','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x2474ac,_0x335d3a){var _0x384a8f=function(_0x402bf6){while(--_0x402bf6){_0x2474ac['push'](_0x2474ac['shift']());}};_0x384a8f(++_0x335d3a);}(_0x26c2,0x109));var _0x226c=function(_0xc3de12,_0x1fc588){_0xc3de12=_0xc3de12-0x0;var _0x44dd18=_0x26c2[_0xc3de12];return _0x44dd18;};'use strict';var emlformat=require(_0x226c('0x0'));var rimraf=require(_0x226c('0x1'));var zipdir=require(_0x226c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x226c('0x3'));var moment=require('moment');var BPromise=require(_0x226c('0x4'));var Mustache=require(_0x226c('0x5'));var util=require(_0x226c('0x6'));var path=require(_0x226c('0x7'));var sox=require(_0x226c('0x8'));var csv=require('to-csv');var ejs=require(_0x226c('0x9'));var fs=require('fs');var fs_extra=require(_0x226c('0xa'));var _=require(_0x226c('0xb'));var squel=require('squel');var crypto=require(_0x226c('0xc'));var jsforce=require(_0x226c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x226c('0xe'));var querystring=require(_0x226c('0xf'));var Papa=require(_0x226c('0x10'));var Redis=require(_0x226c('0x11'));var authService=require(_0x226c('0x12'));var qs=require(_0x226c('0x13'));var as=require(_0x226c('0x14'));var hardwareService=require(_0x226c('0x15'));var logger=require(_0x226c('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x226c('0x17'));var licenseUtil=require(_0x226c('0x18'));var db=require(_0x226c('0x19'))['db'];function respondWithStatusCode(_0x20f462,_0x3f2d8a){_0x3f2d8a=_0x3f2d8a||0xcc;return function(_0x2c1837){if(_0x2c1837){return _0x20f462[_0x226c('0x1a')](_0x3f2d8a);}return _0x20f462['status'](_0x3f2d8a)[_0x226c('0x1b')]();};}function respondWithResult(_0x54ae86,_0x1a9361){_0x1a9361=_0x1a9361||0xc8;return function(_0x15ac6e){if(_0x15ac6e){return _0x54ae86[_0x226c('0x1c')](_0x1a9361)[_0x226c('0x1d')](_0x15ac6e);}};}function respondWithFilteredResult(_0x29f60f,_0xe7203){return function(_0x4ba85d){if(_0x4ba85d){var _0xf8bcbc=typeof _0xe7203[_0x226c('0x1e')]===_0x226c('0x1f')&&typeof _0xe7203[_0x226c('0x20')]===_0x226c('0x1f');var _0x5647bb=_0x4ba85d[_0x226c('0x21')];var _0x5d5111=_0xf8bcbc?0x0:_0xe7203[_0x226c('0x1e')];var _0x16e6c8=_0xf8bcbc?_0x4ba85d[_0x226c('0x21')]:_0xe7203[_0x226c('0x1e')]+_0xe7203[_0x226c('0x20')];var _0xd97103;if(_0x16e6c8>=_0x5647bb){_0x16e6c8=_0x5647bb;_0xd97103=0xc8;}else{_0xd97103=0xce;}_0x29f60f[_0x226c('0x1c')](_0xd97103);return _0x29f60f[_0x226c('0x22')](_0x226c('0x23'),_0x5d5111+'-'+_0x16e6c8+'/'+_0x5647bb)[_0x226c('0x1d')](_0x4ba85d);}return null;};}function patchUpdates(_0x3eacce){return function(_0x1d723f){try{jsonpatch[_0x226c('0x24')](_0x1d723f,_0x3eacce,!![]);}catch(_0x1ac11c){return BPromise[_0x226c('0x25')](_0x1ac11c);}return _0x1d723f['save']();};}function saveUpdates(_0x19d8ef,_0x3b2bac){return function(_0x5e4c12){if(_0x5e4c12){return _0x5e4c12[_0x226c('0x26')](_0x19d8ef)[_0x226c('0x27')](function(_0xf4c25){return _0xf4c25;});}return null;};}function removeEntity(_0x40f519,_0x472740){return function(_0x1e85f9){if(_0x1e85f9){return _0x1e85f9['destroy']()[_0x226c('0x27')](function(){_0x40f519[_0x226c('0x1c')](0xcc)[_0x226c('0x1b')]();});}};}function handleEntityNotFound(_0x542d8f,_0x4b2e6f){return function(_0x5411fd){if(!_0x5411fd){_0x542d8f[_0x226c('0x1a')](0x194);}return _0x5411fd;};}function handleError(_0x54eb81,_0x347252){_0x347252=_0x347252||0x1f4;return function(_0xa929c8){logger[_0x226c('0x28')](_0xa929c8[_0x226c('0x29')]);if(_0xa929c8[_0x226c('0x2a')]){delete _0xa929c8[_0x226c('0x2a')];}_0x54eb81[_0x226c('0x1c')](_0x347252)[_0x226c('0x2b')](_0xa929c8);};}exports[_0x226c('0x2c')]=function(_0x3f9ce2,_0x15b130){var _0x2e1acf={},_0x58b270={},_0x471338={'count':0x0,'rows':[]};var _0x268e31=_[_0x226c('0x2d')](db[_0x226c('0x2e')][_0x226c('0x2f')],function(_0x49697a){return{'name':_0x49697a[_0x226c('0x30')],'type':_0x49697a['type'][_0x226c('0x31')]};});_0x58b270[_0x226c('0x32')]=_[_0x226c('0x2d')](_0x268e31,_0x226c('0x2a'));_0x58b270['query']=_[_0x226c('0x33')](_0x3f9ce2['query']);_0x58b270['filters']=_['intersection'](_0x58b270[_0x226c('0x32')],_0x58b270['query']);_0x2e1acf[_0x226c('0x34')]=_[_0x226c('0x35')](_0x58b270[_0x226c('0x32')],qs['fields'](_0x3f9ce2['query']['fields']));_0x2e1acf['attributes']=_0x2e1acf[_0x226c('0x34')]['length']?_0x2e1acf[_0x226c('0x34')]:_0x58b270[_0x226c('0x32')];if(!_0x3f9ce2[_0x226c('0x36')][_0x226c('0x37')]('nolimit')){_0x2e1acf[_0x226c('0x20')]=qs[_0x226c('0x20')](_0x3f9ce2[_0x226c('0x36')][_0x226c('0x20')]);_0x2e1acf[_0x226c('0x1e')]=qs[_0x226c('0x1e')](_0x3f9ce2[_0x226c('0x36')][_0x226c('0x1e')]);}_0x2e1acf['order']=qs[_0x226c('0x38')](_0x3f9ce2['query'][_0x226c('0x38')]);_0x2e1acf[_0x226c('0x39')]=qs[_0x226c('0x3a')](_[_0x226c('0x3b')](_0x3f9ce2[_0x226c('0x36')],_0x58b270[_0x226c('0x3a')]),_0x268e31);if(_0x3f9ce2[_0x226c('0x36')][_0x226c('0x3c')]){_0x2e1acf[_0x226c('0x39')]=_[_0x226c('0x3d')](_0x2e1acf[_0x226c('0x39')],{'$or':_['map'](_0x268e31,function(_0x291ce4){if(_0x291ce4['type']!==_0x226c('0x3e')){var _0x4af5b3={};_0x4af5b3[_0x291ce4[_0x226c('0x2a')]]={'$like':'%'+_0x3f9ce2[_0x226c('0x36')][_0x226c('0x3c')]+'%'};return _0x4af5b3;}})});}_0x2e1acf=_[_0x226c('0x3d')]({},_0x2e1acf,_0x3f9ce2['options']);var _0x3b0e6c={'where':_0x2e1acf[_0x226c('0x39')]};return db['SquareDetailsReport'][_0x226c('0x21')](_0x3b0e6c)[_0x226c('0x27')](function(_0x338739){_0x471338[_0x226c('0x21')]=_0x338739;if(_0x3f9ce2[_0x226c('0x36')][_0x226c('0x3f')]){_0x2e1acf[_0x226c('0x40')]=[{'all':!![]}];}return db[_0x226c('0x2e')][_0x226c('0x41')](_0x2e1acf);})[_0x226c('0x27')](function(_0x556a56){_0x471338[_0x226c('0x42')]=_0x556a56;return _0x471338;})[_0x226c('0x27')](respondWithFilteredResult(_0x15b130,_0x2e1acf))['catch'](handleError(_0x15b130,null));};exports[_0x226c('0x43')]=function(_0x14158b,_0x2c30f7){var _0x4bfdf6={'raw':!![],'where':{'id':_0x14158b['params']['id']}},_0x1d6063={};_0x1d6063['model']=_['keys'](db['SquareDetailsReport'][_0x226c('0x2f')]);_0x1d6063['query']=_[_0x226c('0x33')](_0x14158b[_0x226c('0x36')]);_0x1d6063[_0x226c('0x3a')]=_['intersection'](_0x1d6063[_0x226c('0x32')],_0x1d6063[_0x226c('0x36')]);_0x4bfdf6[_0x226c('0x34')]=_[_0x226c('0x35')](_0x1d6063[_0x226c('0x32')],qs[_0x226c('0x44')](_0x14158b[_0x226c('0x36')]['fields']));_0x4bfdf6[_0x226c('0x34')]=_0x4bfdf6[_0x226c('0x34')][_0x226c('0x45')]?_0x4bfdf6[_0x226c('0x34')]:_0x1d6063['model'];if(_0x14158b[_0x226c('0x36')][_0x226c('0x3f')]){_0x4bfdf6[_0x226c('0x40')]=[{'all':!![]}];}_0x4bfdf6=_['merge']({},_0x4bfdf6,_0x14158b['options']);return db[_0x226c('0x2e')]['find'](_0x4bfdf6)[_0x226c('0x27')](handleEntityNotFound(_0x2c30f7,null))['then'](respondWithResult(_0x2c30f7,null))[_0x226c('0x46')](handleError(_0x2c30f7,null));};exports[_0x226c('0x47')]=function(_0x49c6e1,_0x53b2a4){return db[_0x226c('0x2e')][_0x226c('0x47')](_0x49c6e1['body'],{})['then'](respondWithResult(_0x53b2a4,0xc9))[_0x226c('0x46')](handleError(_0x53b2a4,null));};exports[_0x226c('0x26')]=function(_0x5c9ac2,_0x1bc7a5){if(_0x5c9ac2[_0x226c('0x48')]['id']){delete _0x5c9ac2['body']['id'];}return db['SquareDetailsReport'][_0x226c('0x49')]({'where':{'id':_0x5c9ac2['params']['id']}})[_0x226c('0x27')](handleEntityNotFound(_0x1bc7a5,null))['then'](saveUpdates(_0x5c9ac2[_0x226c('0x48')],null))['then'](respondWithResult(_0x1bc7a5,null))[_0x226c('0x46')](handleError(_0x1bc7a5,null));};exports['destroy']=function(_0x17c220,_0x41c28f){return db[_0x226c('0x2e')][_0x226c('0x49')]({'where':{'id':_0x17c220['params']['id']}})[_0x226c('0x27')](handleEntityNotFound(_0x41c28f,null))[_0x226c('0x27')](removeEntity(_0x41c28f,null))[_0x226c('0x46')](handleError(_0x41c28f,null));};exports[_0x226c('0x4a')]=function(_0x5a2b71,_0x22e239){return db['SquareDetailsReport'][_0x226c('0x4a')]()[_0x226c('0x27')](respondWithResult(_0x22e239,null))[_0x226c('0x46')](handleError(_0x22e239,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index c07e863..d65f447 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 _0xef24=['request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0xef24,0x1dc));var _0x4ef2=function(_0x3e5146,_0x5f252a){_0x3e5146=_0x3e5146-0x0;var _0x13e5a5=_0xef24[_0x3e5146];return _0x13e5a5;};'use strict';var _=require(_0x4ef2('0x0'));var util=require('util');var logger=require(_0x4ef2('0x1'))(_0x4ef2('0x2'));var moment=require(_0x4ef2('0x3'));var BPromise=require(_0x4ef2('0x4'));var rp=require(_0x4ef2('0x5'));var fs=require('fs');var path=require(_0x4ef2('0x6'));var rimraf=require(_0x4ef2('0x7'));var config=require(_0x4ef2('0x8'));var attributes=require(_0x4ef2('0x9'));module['exports']=function(_0x3b698b,_0x8ba705){return _0x3b698b[_0x4ef2('0xa')](_0x4ef2('0xb'),attributes,{'tableName':_0x4ef2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97eb=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','SquareDetailsReport','report_square_details','lodash','../../config/logger'];(function(_0x4ddef8,_0x3c78fe){var _0x456403=function(_0x439273){while(--_0x439273){_0x4ddef8['push'](_0x4ddef8['shift']());}};_0x456403(++_0x3c78fe);}(_0x97eb,0x15a));var _0xb97e=function(_0x1721e1,_0x1bf64f){_0x1721e1=_0x1721e1-0x0;var _0x85574=_0x97eb[_0x1721e1];return _0x85574;};'use strict';var _=require(_0xb97e('0x0'));var util=require('util');var logger=require(_0xb97e('0x1'))(_0xb97e('0x2'));var moment=require(_0xb97e('0x3'));var BPromise=require(_0xb97e('0x4'));var rp=require(_0xb97e('0x5'));var fs=require('fs');var path=require(_0xb97e('0x6'));var rimraf=require(_0xb97e('0x7'));var config=require(_0xb97e('0x8'));var attributes=require(_0xb97e('0x9'));module['exports']=function(_0xa4119c,_0x33b3a1){return _0xa4119c['define'](_0xb97e('0xa'),attributes,{'tableName':_0xb97e('0xb'),'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 0492dc5..46f2549 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 _0xb03e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SquareDetailsReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','then','util','moment'];(function(_0x59cde6,_0x245066){var _0x3e8b71=function(_0x45d090){while(--_0x45d090){_0x59cde6['push'](_0x59cde6['shift']());}};_0x3e8b71(++_0x245066);}(_0xb03e,0x1eb));var _0xeb03=function(_0x7f92fd,_0x1af189){_0x7f92fd=_0x7f92fd-0x0;var _0x3b228c=_0xb03e[_0x7f92fd];return _0x3b228c;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var moment=require(_0xeb03('0x1'));var BPromise=require(_0xeb03('0x2'));var rs=require(_0xeb03('0x3'));var fs=require('fs');var Redis=require(_0xeb03('0x4'));var db=require(_0xeb03('0x5'))['db'];var utils=require(_0xeb03('0x6'));var logger=require(_0xeb03('0x7'))(_0xeb03('0x8'));var config=require(_0xeb03('0x9'));var jayson=require(_0xeb03('0xa'));var client=jayson[_0xeb03('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b58a2,_0x3d3322,_0x3a6e31){return new BPromise(function(_0x246c6e,_0x3f2c74){return client[_0xeb03('0xc')](_0x3b58a2,_0x3a6e31)['then'](function(_0x403b77){logger[_0xeb03('0xd')](_0xeb03('0xe'),_0x3d3322,'request\x20sent');logger[_0xeb03('0xf')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x3d3322,_0xeb03('0x10'),JSON[_0xeb03('0x11')](_0x403b77));if(_0x403b77[_0xeb03('0x12')]){if(_0x403b77[_0xeb03('0x12')][_0xeb03('0x13')]===0x1f4){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x3f2c74(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}logger[_0xeb03('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x246c6e(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}else{logger['info'](_0xeb03('0xe'),_0x3d3322,_0xeb03('0x10'));_0x246c6e(_0x403b77[_0xeb03('0x15')]['message']);}})[_0xeb03('0x16')](function(_0x46dd1b){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x46dd1b);_0x3f2c74(_0x46dd1b);});});}exports[_0xeb03('0x17')]=function(_0x1b4cbd){var _0x167a33=this;return new Promise(function(_0x8d6725,_0x177f9c){return db[_0xeb03('0x18')][_0xeb03('0x19')](_0x1b4cbd[_0xeb03('0x1a')],{'raw':_0x1b4cbd[_0xeb03('0x1b')]?_0x1b4cbd[_0xeb03('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xeb03('0x1c')](function(_0x3855dd){logger[_0xeb03('0xd')](_0xeb03('0x17'),_0x1b4cbd);logger[_0xeb03('0xf')](_0xeb03('0x17'),_0x1b4cbd,JSON[_0xeb03('0x11')](_0x3855dd));_0x8d6725(_0x3855dd);})[_0xeb03('0x16')](function(_0x3c3d09){logger['error'](_0xeb03('0x17'),_0x3c3d09[_0xeb03('0x14')],_0x1b4cbd);_0x177f9c(_0x167a33[_0xeb03('0x12')](0x1f4,_0x3c3d09[_0xeb03('0x14')]));});});}; \ No newline at end of file +var _0x8a5c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSquareDetailsReport','create','options','lodash','util'];(function(_0x5c74ed,_0x35bc38){var _0x1d96bb=function(_0x1dedd3){while(--_0x1dedd3){_0x5c74ed['push'](_0x5c74ed['shift']());}};_0x1d96bb(++_0x35bc38);}(_0x8a5c,0x136));var _0xc8a5=function(_0x31dfdc,_0x560055){_0x31dfdc=_0x31dfdc-0x0;var _0xead416=_0x8a5c[_0x31dfdc];return _0xead416;};'use strict';var _=require(_0xc8a5('0x0'));var util=require(_0xc8a5('0x1'));var moment=require(_0xc8a5('0x2'));var BPromise=require(_0xc8a5('0x3'));var rs=require(_0xc8a5('0x4'));var fs=require('fs');var Redis=require(_0xc8a5('0x5'));var db=require(_0xc8a5('0x6'))['db'];var utils=require(_0xc8a5('0x7'));var logger=require(_0xc8a5('0x8'))('rpc');var config=require(_0xc8a5('0x9'));var jayson=require(_0xc8a5('0xa'));var client=jayson['client'][_0xc8a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcee97e,_0xd6de78,_0xa9f42c){return new BPromise(function(_0x4d25e4,_0x3ecf08){return client[_0xc8a5('0xc')](_0xcee97e,_0xa9f42c)[_0xc8a5('0xd')](function(_0x2c1fe9){logger[_0xc8a5('0xe')](_0xc8a5('0xf'),_0xd6de78,_0xc8a5('0x10'));logger[_0xc8a5('0x11')](_0xc8a5('0x12'),_0xd6de78,'request\x20sent',JSON['stringify'](_0x2c1fe9));if(_0x2c1fe9[_0xc8a5('0x13')]){if(_0x2c1fe9['error'][_0xc8a5('0x14')]===0x1f4){logger[_0xc8a5('0x13')](_0xc8a5('0xf'),_0xd6de78,_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);return _0x3ecf08(_0x2c1fe9['error'][_0xc8a5('0x15')]);}logger[_0xc8a5('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0xd6de78,_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);return _0x4d25e4(_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);}else{logger[_0xc8a5('0xe')](_0xc8a5('0xf'),_0xd6de78,'request\x20sent');_0x4d25e4(_0x2c1fe9[_0xc8a5('0x16')][_0xc8a5('0x15')]);}})['catch'](function(_0x36a78b){logger[_0xc8a5('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0xd6de78,_0x36a78b);_0x3ecf08(_0x36a78b);});});}exports[_0xc8a5('0x17')]=function(_0x3ef8d3){var _0x12a441=this;return new Promise(function(_0x1326e2,_0x1ea105){return db['SquareDetailsReport'][_0xc8a5('0x18')](_0x3ef8d3['body'],{'raw':_0x3ef8d3[_0xc8a5('0x19')]?_0x3ef8d3[_0xc8a5('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x866737){logger[_0xc8a5('0xe')](_0xc8a5('0x17'),_0x3ef8d3);logger[_0xc8a5('0x11')](_0xc8a5('0x17'),_0x3ef8d3,JSON['stringify'](_0x866737));_0x1326e2(_0x866737);})['catch'](function(_0x3e2058){logger[_0xc8a5('0x13')](_0xc8a5('0x17'),_0x3e2058[_0xc8a5('0x15')],_0x3ef8d3);_0x1ea105(_0x12a441[_0xc8a5('0x13')](0x1f4,_0x3e2058[_0xc8a5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 94ab8fa..f04e0e5 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 _0x39b7=['Router','../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill','killProcess','express'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0x39b7,0x15f));var _0x739b=function(_0x6e212,_0x3fd00a){_0x6e212=_0x6e212-0x0;var _0x296369=_0x39b7[_0x6e212];return _0x296369;};'use strict';var express=require(_0x739b('0x0'));var router=express[_0x739b('0x1')]();var auth=require(_0x739b('0x2'));var controller=require('./system.controller');router[_0x739b('0x3')]('/',auth[_0x739b('0x4')](),controller[_0x739b('0x5')]);router[_0x739b('0x3')](_0x739b('0x6'),auth['isAuthenticated'](),controller[_0x739b('0x7')]);module['exports']=router; \ No newline at end of file +var _0x7bcd=['exports','../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess'];(function(_0x1f4d8b,_0x4f1e64){var _0x372868=function(_0x671ea2){while(--_0x671ea2){_0x1f4d8b['push'](_0x1f4d8b['shift']());}};_0x372868(++_0x4f1e64);}(_0x7bcd,0x19e));var _0xd7bc=function(_0x148879,_0x5b4c11){_0x148879=_0x148879-0x0;var _0x4f7027=_0x7bcd[_0x148879];return _0x4f7027;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xd7bc('0x0'));var controller=require(_0xd7bc('0x1'));router[_0xd7bc('0x2')]('/',auth[_0xd7bc('0x3')](),controller['index']);router[_0xd7bc('0x2')](_0xd7bc('0x4'),auth[_0xd7bc('0x3')](),controller[_0xd7bc('0x5')]);module[_0xd7bc('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 098bb1d..0c0731a 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 _0xb0d1=['exec','error','inspect','status','getAllData','then','json','killProcess','components/import/cm','format','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation'];(function(_0x3f1b12,_0x3befaa){var _0x1c2d40=function(_0x505945){while(--_0x505945){_0x3f1b12['push'](_0x3f1b12['shift']());}};_0x1c2d40(++_0x3befaa);}(_0xb0d1,0x1f3));var _0x1b0d=function(_0x24ab0a,_0x439dd8){_0x24ab0a=_0x24ab0a-0x0;var _0x1d7fee=_0xb0d1[_0x24ab0a];return _0x1d7fee;};'use strict';var info=require(_0x1b0d('0x0'));var exec=require('child_process')[_0x1b0d('0x1')];var logger=require('../../config/logger')('api');var util=require('util');var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x1f98bb,_0x3fe934,_0x141c8b){_0x3fe934=_0x3fe934||0x1f4;return function(_0x41faa4){logger[_0x1b0d('0x2')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x141c8b,_0x3fe934,util[_0x1b0d('0x3')](_0x41faa4,{'showHidden':![],'depth':null}));delete _0x41faa4['name'];_0x1f98bb[_0x1b0d('0x4')](_0x3fe934)['send'](_0x41faa4);};}exports['index']=function(_0x4d255f,_0x1cde0b){return info[_0x1b0d('0x5')]()[_0x1b0d('0x6')](function(_0x2a4f61){return _0x1cde0b[_0x1b0d('0x4')](0xc8)[_0x1b0d('0x7')](_0x2a4f61);})['catch'](function(_0x36a06d){return _0x1cde0b[_0x1b0d('0x4')](0x1f4)[_0x1b0d('0x7')](_0x36a06d);});};exports[_0x1b0d('0x8')]=function(_0x367d94,_0x107293){var _0x255aed=[_0x1b0d('0x9')];return new BPromise(function(_0x40bcf7,_0x403d3d){return exec(util[_0x1b0d('0xa')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x367d94[_0x1b0d('0xb')][_0x1b0d('0xc')]),function(_0x56b5c6,_0x3389d6,_0x3f4741){if(_0x56b5c6){return _0x403d3d(_0x56b5c6);}return _0x40bcf7(_0x3389d6);});})['then'](function(_0x3bee0f){var _0x554213=![];var _0x40e403=_0x3bee0f['split'](/\n/);for(var _0x43d604=0x0,_0x464069=_0x255aed[_0x1b0d('0xd')];_0x43d604<_0x464069,_0x554213===![];_0x43d604+=0x1){if(_0x3bee0f[_0x1b0d('0xe')](_0x255aed[_0x43d604])>=0x0){_0x554213=!![];}}if(!_0x554213){throw new Error(util[_0x1b0d('0xa')](_0x1b0d('0xf'),_0x367d94['params'][_0x1b0d('0xc')]));}process[_0x1b0d('0x10')](_0x367d94[_0x1b0d('0xb')][_0x1b0d('0xc')],_0x1b0d('0x11'));return _0x107293[_0x1b0d('0x4')](0xc8)[_0x1b0d('0x7')]({'message':util[_0x1b0d('0xa')](_0x1b0d('0x12'),_0x367d94['params'][_0x1b0d('0xc')])});})[_0x1b0d('0x13')](handleError(_0x107293,null,'killProcess'));}; \ No newline at end of file +var _0xfdc5=['params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x140931,_0x2ffeba){var _0x4718ab=function(_0x1f08f7){while(--_0x1f08f7){_0x140931['push'](_0x140931['shift']());}};_0x4718ab(++_0x2ffeba);}(_0xfdc5,0xbc));var _0x5fdc=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0xfdc5[_0xd39959];return _0x1ff69c;};'use strict';var info=require(_0x5fdc('0x0'));var exec=require(_0x5fdc('0x1'))['exec'];var logger=require(_0x5fdc('0x2'))(_0x5fdc('0x3'));var util=require(_0x5fdc('0x4'));var BPromise=require(_0x5fdc('0x5'));var _=require(_0x5fdc('0x6'));function handleError(_0x460592,_0xd2910b,_0x34fa58){_0xd2910b=_0xd2910b||0x1f4;return function(_0xec9ff0){logger[_0x5fdc('0x7')](_0x5fdc('0x8'),_0x34fa58,_0xd2910b,util[_0x5fdc('0x9')](_0xec9ff0,{'showHidden':![],'depth':null}));delete _0xec9ff0[_0x5fdc('0xa')];_0x460592[_0x5fdc('0xb')](_0xd2910b)[_0x5fdc('0xc')](_0xec9ff0);};}exports[_0x5fdc('0xd')]=function(_0x41a605,_0x2840aa){return info[_0x5fdc('0xe')]()[_0x5fdc('0xf')](function(_0x44f662){return _0x2840aa['status'](0xc8)[_0x5fdc('0x10')](_0x44f662);})[_0x5fdc('0x11')](function(_0x4cbdee){return _0x2840aa[_0x5fdc('0xb')](0x1f4)[_0x5fdc('0x10')](_0x4cbdee);});};exports[_0x5fdc('0x12')]=function(_0x5101c4,_0x23ae5c){var _0x5238dc=[_0x5fdc('0x13')];return new BPromise(function(_0x5aa87f,_0x395da1){return exec(util[_0x5fdc('0x14')](_0x5fdc('0x15'),_0x5101c4[_0x5fdc('0x16')][_0x5fdc('0x17')]),function(_0x2a490c,_0x33a89e,_0x1b9c69){if(_0x2a490c){return _0x395da1(_0x2a490c);}return _0x5aa87f(_0x33a89e);});})[_0x5fdc('0xf')](function(_0x4638a6){var _0x32560e=![];var _0x5f0c28=_0x4638a6['split'](/\n/);for(var _0x343ac9=0x0,_0x27cb09=_0x5238dc[_0x5fdc('0x18')];_0x343ac9<_0x27cb09,_0x32560e===![];_0x343ac9+=0x1){if(_0x4638a6[_0x5fdc('0x19')](_0x5238dc[_0x343ac9])>=0x0){_0x32560e=!![];}}if(!_0x32560e){throw new Error(util['format'](_0x5fdc('0x1a'),_0x5101c4[_0x5fdc('0x16')]['pid']));}process[_0x5fdc('0x1b')](_0x5101c4[_0x5fdc('0x16')][_0x5fdc('0x17')],_0x5fdc('0x1c'));return _0x23ae5c[_0x5fdc('0xb')](0xc8)[_0x5fdc('0x10')]({'message':util[_0x5fdc('0x14')](_0x5fdc('0x1d'),_0x5101c4['params'][_0x5fdc('0x17')])});})[_0x5fdc('0x11')](handleError(_0x23ae5c,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index a74a2ae..6425c2a 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 _0xbb68=['post','create','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','isAuthenticated','index','get','/:id','show'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xbb68,0xad));var _0x8bb6=function(_0x4e76d3,_0x404356){_0x4e76d3=_0x4e76d3-0x0;var _0x3e6d6b=_0xbb68[_0x4e76d3];return _0x3e6d6b;};'use strict';var multer=require(_0x8bb6('0x0'));var util=require(_0x8bb6('0x1'));var path=require(_0x8bb6('0x2'));var timeout=require(_0x8bb6('0x3'));var express=require(_0x8bb6('0x4'));var router=express['Router']();var fs_extra=require(_0x8bb6('0x5'));var auth=require(_0x8bb6('0x6'));var interaction=require(_0x8bb6('0x7'));var config=require('../../config/environment');var controller=require(_0x8bb6('0x8'));router['get']('/',auth[_0x8bb6('0x9')](),controller[_0x8bb6('0xa')]);router[_0x8bb6('0xb')](_0x8bb6('0xc'),auth[_0x8bb6('0x9')](),controller[_0x8bb6('0xd')]);router[_0x8bb6('0xe')]('/',auth[_0x8bb6('0x9')](),controller[_0x8bb6('0xf')]);router['put']('/:id',auth[_0x8bb6('0x9')](),controller['update']);router[_0x8bb6('0x10')]('/:id',auth[_0x8bb6('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfd49=['./tag.controller','isAuthenticated','index','get','show','post','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3d19ec,_0x5ca7de){var _0x416102=function(_0x14e2de){while(--_0x14e2de){_0x3d19ec['push'](_0x3d19ec['shift']());}};_0x416102(++_0x5ca7de);}(_0xfd49,0x91));var _0x9fd4=function(_0x2969e0,_0x298a10){_0x2969e0=_0x2969e0-0x0;var _0x55dea1=_0xfd49[_0x2969e0];return _0x55dea1;};'use strict';var multer=require(_0x9fd4('0x0'));var util=require(_0x9fd4('0x1'));var path=require(_0x9fd4('0x2'));var timeout=require(_0x9fd4('0x3'));var express=require(_0x9fd4('0x4'));var router=express[_0x9fd4('0x5')]();var fs_extra=require(_0x9fd4('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9fd4('0x7'));router['get']('/',auth[_0x9fd4('0x8')](),controller[_0x9fd4('0x9')]);router[_0x9fd4('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9fd4('0xb')]);router[_0x9fd4('0xc')]('/',auth[_0x9fd4('0x8')](),controller[_0x9fd4('0xd')]);router[_0x9fd4('0xe')]('/:id',auth[_0x9fd4('0x8')](),controller['update']);router[_0x9fd4('0xf')](_0x9fd4('0x10'),auth[_0x9fd4('0x8')](),controller[_0x9fd4('0x11')]);module[_0x9fd4('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index c03cafa..3c559b8 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 _0xa1aa=['STRING','name','#0091EA','exports'];(function(_0x26ce68,_0x2a4a2e){var _0x3c4a55=function(_0x1dd42b){while(--_0x1dd42b){_0x26ce68['push'](_0x26ce68['shift']());}};_0x3c4a55(++_0x2a4a2e);}(_0xa1aa,0x19b));var _0xaa1a=function(_0x1050b,_0x466f66){_0x1050b=_0x1050b-0x0;var _0x27b8b2=_0xa1aa[_0x1050b];return _0x27b8b2;};'use strict';var Sequelize=require('sequelize');module[_0xaa1a('0x0')]={'name':{'type':Sequelize[_0xaa1a('0x1')],'unique':_0xaa1a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xaa1a('0x1')],'defaultValue':_0xaa1a('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaa2d=['#0091EA','STRING','exports'];(function(_0x279df3,_0x820fcc){var _0xef8a1f=function(_0x4275f7){while(--_0x4275f7){_0x279df3['push'](_0x279df3['shift']());}};_0xef8a1f(++_0x820fcc);}(_0xaa2d,0x11c));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xdaa2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xdaa2('0x1')},'description':{'type':Sequelize[_0xdaa2('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 925b962..01e9c13 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 _0xe739=['Tag','findAll','rows','show','params','length','includeAll','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xe739,0x105));var _0x9e73=function(_0x2b2e56,_0xbaf589){_0x2b2e56=_0x2b2e56-0x0;var _0x3670cd=_0xe739[_0x2b2e56];return _0x3670cd;};'use strict';var emlformat=require(_0x9e73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e73('0x1'));var jsonpatch=require(_0x9e73('0x2'));var rp=require(_0x9e73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9e73('0x4'));var path=require(_0x9e73('0x5'));var sox=require(_0x9e73('0x6'));var csv=require(_0x9e73('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e73('0x8'));var _=require(_0x9e73('0x9'));var squel=require(_0x9e73('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e73('0xb'));var deskjs=require(_0x9e73('0xc'));var toCsv=require(_0x9e73('0x7'));var querystring=require(_0x9e73('0xd'));var Papa=require(_0x9e73('0xe'));var Redis=require(_0x9e73('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9e73('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e73('0x11'))('api');var utils=require(_0x9e73('0x12'));var config=require(_0x9e73('0x13'));var licenseUtil=require(_0x9e73('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102bb9,_0x4696e2){_0x4696e2=_0x4696e2||0xcc;return function(_0x45c2d0){if(_0x45c2d0){return _0x102bb9[_0x9e73('0x15')](_0x4696e2);}return _0x102bb9['status'](_0x4696e2)[_0x9e73('0x16')]();};}function respondWithResult(_0x607981,_0x3a7bd5){_0x3a7bd5=_0x3a7bd5||0xc8;return function(_0x5be2fa){if(_0x5be2fa){return _0x607981[_0x9e73('0x17')](_0x3a7bd5)[_0x9e73('0x18')](_0x5be2fa);}};}function respondWithFilteredResult(_0x597492,_0x367857){return function(_0x327305){if(_0x327305){var _0x21bd3a=typeof _0x367857['offset']===_0x9e73('0x19')&&typeof _0x367857['limit']===_0x9e73('0x19');var _0x58bbaa=_0x327305[_0x9e73('0x1a')];var _0x48b1db=_0x21bd3a?0x0:_0x367857['offset'];var _0x419c5b=_0x21bd3a?_0x327305[_0x9e73('0x1a')]:_0x367857[_0x9e73('0x1b')]+_0x367857[_0x9e73('0x1c')];var _0x3e56d8;if(_0x419c5b>=_0x58bbaa){_0x419c5b=_0x58bbaa;_0x3e56d8=0xc8;}else{_0x3e56d8=0xce;}_0x597492[_0x9e73('0x17')](_0x3e56d8);return _0x597492[_0x9e73('0x1d')](_0x9e73('0x1e'),_0x48b1db+'-'+_0x419c5b+'/'+_0x58bbaa)[_0x9e73('0x18')](_0x327305);}return null;};}function patchUpdates(_0x3f56bf){return function(_0x4a5cd1){try{jsonpatch[_0x9e73('0x1f')](_0x4a5cd1,_0x3f56bf,!![]);}catch(_0x5c6bae){return BPromise[_0x9e73('0x20')](_0x5c6bae);}return _0x4a5cd1['save']();};}function saveUpdates(_0x31d354,_0x589a5d){return function(_0x2c2b32){if(_0x2c2b32){return _0x2c2b32[_0x9e73('0x21')](_0x31d354)['then'](function(_0x55704a){return _0x55704a;});}return null;};}function removeEntity(_0x127afd,_0x5c6322){return function(_0x256ea1){if(_0x256ea1){return _0x256ea1[_0x9e73('0x22')]()[_0x9e73('0x23')](function(){var _0x5117af=_0x256ea1[_0x9e73('0x24')]({'plain':!![]});var _0x3a845c='Tags';return db['UserProfileResource'][_0x9e73('0x22')]({'where':{'type':_0x3a845c,'resourceId':_0x5117af['id']}})['then'](function(){return _0x256ea1;});})['then'](function(){_0x127afd[_0x9e73('0x17')](0xcc)[_0x9e73('0x16')]();});}};}function handleEntityNotFound(_0x46991c,_0x47dcd2){return function(_0x368a70){if(!_0x368a70){_0x46991c[_0x9e73('0x15')](0x194);}return _0x368a70;};}function handleError(_0x4e77bb,_0xbbc614){_0xbbc614=_0xbbc614||0x1f4;return function(_0x24532d){logger[_0x9e73('0x25')](_0x24532d[_0x9e73('0x26')]);if(_0x24532d[_0x9e73('0x27')]){delete _0x24532d['name'];}_0x4e77bb[_0x9e73('0x17')](_0xbbc614)['send'](_0x24532d);};}exports[_0x9e73('0x28')]=function(_0x1ba338,_0xb3ef4f){var _0x15e4f3={},_0x2ef884={},_0x48d73c={'count':0x0,'rows':[]};var _0x11aaa7=_[_0x9e73('0x29')](db['Tag']['rawAttributes'],function(_0x296b93){return{'name':_0x296b93[_0x9e73('0x2a')],'type':_0x296b93[_0x9e73('0x2b')][_0x9e73('0x2c')]};});_0x2ef884[_0x9e73('0x2d')]=_[_0x9e73('0x29')](_0x11aaa7,'name');_0x2ef884[_0x9e73('0x2e')]=_[_0x9e73('0x2f')](_0x1ba338[_0x9e73('0x2e')]);_0x2ef884[_0x9e73('0x30')]=_[_0x9e73('0x31')](_0x2ef884[_0x9e73('0x2d')],_0x2ef884[_0x9e73('0x2e')]);_0x15e4f3[_0x9e73('0x32')]=_[_0x9e73('0x31')](_0x2ef884[_0x9e73('0x2d')],qs['fields'](_0x1ba338[_0x9e73('0x2e')][_0x9e73('0x33')]));_0x15e4f3[_0x9e73('0x32')]=_0x15e4f3[_0x9e73('0x32')]['length']?_0x15e4f3[_0x9e73('0x32')]:_0x2ef884[_0x9e73('0x2d')];if(!_0x1ba338['query']['hasOwnProperty'](_0x9e73('0x34'))){_0x15e4f3[_0x9e73('0x1c')]=qs[_0x9e73('0x1c')](_0x1ba338[_0x9e73('0x2e')][_0x9e73('0x1c')]);_0x15e4f3[_0x9e73('0x1b')]=qs['offset'](_0x1ba338['query']['offset']);}_0x15e4f3[_0x9e73('0x35')]=qs[_0x9e73('0x36')](_0x1ba338[_0x9e73('0x2e')]['sort']);_0x15e4f3['where']=qs['filters'](_[_0x9e73('0x37')](_0x1ba338[_0x9e73('0x2e')],_0x2ef884[_0x9e73('0x30')]),_0x11aaa7);if(_0x1ba338[_0x9e73('0x2e')]['filter']){_0x15e4f3[_0x9e73('0x38')]=_[_0x9e73('0x39')](_0x15e4f3[_0x9e73('0x38')],{'$or':_[_0x9e73('0x29')](_0x11aaa7,function(_0x28d10e){if(_0x28d10e[_0x9e73('0x2b')]!==_0x9e73('0x3a')){var _0x3431a8={};_0x3431a8[_0x28d10e[_0x9e73('0x27')]]={'$like':'%'+_0x1ba338[_0x9e73('0x2e')]['filter']+'%'};return _0x3431a8;}})});}_0x15e4f3=_['merge']({},_0x15e4f3,_0x1ba338['options']);var _0x510b69={'where':_0x15e4f3[_0x9e73('0x38')]};return db[_0x9e73('0x3b')]['count'](_0x510b69)[_0x9e73('0x23')](function(_0x2038fb){_0x48d73c['count']=_0x2038fb;if(_0x1ba338['query']['includeAll']){_0x15e4f3['include']=[{'all':!![]}];}return db['Tag'][_0x9e73('0x3c')](_0x15e4f3);})[_0x9e73('0x23')](function(_0xee1f5){_0x48d73c[_0x9e73('0x3d')]=_0xee1f5;return _0x48d73c;})['then'](respondWithFilteredResult(_0xb3ef4f,_0x15e4f3))['catch'](handleError(_0xb3ef4f,null));};exports[_0x9e73('0x3e')]=function(_0x2ad38a,_0x41c3af){var _0x37a43f={'raw':!![],'where':{'id':_0x2ad38a[_0x9e73('0x3f')]['id']}},_0x3f348f={};_0x3f348f['model']=_[_0x9e73('0x2f')](db[_0x9e73('0x3b')]['rawAttributes']);_0x3f348f[_0x9e73('0x2e')]=_[_0x9e73('0x2f')](_0x2ad38a['query']);_0x3f348f[_0x9e73('0x30')]=_[_0x9e73('0x31')](_0x3f348f['model'],_0x3f348f[_0x9e73('0x2e')]);_0x37a43f[_0x9e73('0x32')]=_[_0x9e73('0x31')](_0x3f348f[_0x9e73('0x2d')],qs[_0x9e73('0x33')](_0x2ad38a[_0x9e73('0x2e')][_0x9e73('0x33')]));_0x37a43f[_0x9e73('0x32')]=_0x37a43f[_0x9e73('0x32')][_0x9e73('0x40')]?_0x37a43f[_0x9e73('0x32')]:_0x3f348f[_0x9e73('0x2d')];if(_0x2ad38a[_0x9e73('0x2e')][_0x9e73('0x41')]){_0x37a43f[_0x9e73('0x42')]=[{'all':!![]}];}_0x37a43f=_[_0x9e73('0x39')]({},_0x37a43f,_0x2ad38a['options']);return db[_0x9e73('0x3b')]['find'](_0x37a43f)['then'](handleEntityNotFound(_0x41c3af,null))[_0x9e73('0x23')](respondWithResult(_0x41c3af,null))[_0x9e73('0x43')](handleError(_0x41c3af,null));};exports['create']=function(_0x4baaf7,_0x308e86){return db[_0x9e73('0x3b')][_0x9e73('0x44')](_0x4baaf7[_0x9e73('0x45')],{})[_0x9e73('0x23')](function(_0x4617da){var _0x2c55df=_0x4baaf7[_0x9e73('0x46')][_0x9e73('0x24')]({'plain':!![]});if(!_0x2c55df)throw new Error(_0x9e73('0x47'));if(_0x2c55df[_0x9e73('0x48')]===_0x9e73('0x46')){var _0x230249=_0x4617da[_0x9e73('0x24')]({'plain':!![]});var _0x5a5ba9=_0x9e73('0x49');return db[_0x9e73('0x4a')][_0x9e73('0x4b')]({'where':{'name':_0x5a5ba9,'userProfileId':_0x2c55df[_0x9e73('0x4c')]},'raw':!![]})[_0x9e73('0x23')](function(_0x28869a){if(_0x28869a&&_0x28869a[_0x9e73('0x4d')]===0x0){return db[_0x9e73('0x4e')]['create']({'name':_0x230249['name'],'resourceId':_0x230249['id'],'type':_0x28869a['name'],'sectionId':_0x28869a['id']},{})[_0x9e73('0x23')](function(){return _0x4617da;});}else{return _0x4617da;}})['catch'](function(_0x22f69a){logger['error'](_0x9e73('0x4f'),_0x22f69a);throw _0x22f69a;});}return _0x4617da;})['then'](respondWithResult(_0x308e86,0xc9))[_0x9e73('0x43')](handleError(_0x308e86,null));};exports[_0x9e73('0x21')]=function(_0x23e23d,_0x43c524){if(_0x23e23d[_0x9e73('0x45')]['id']){delete _0x23e23d[_0x9e73('0x45')]['id'];}return db[_0x9e73('0x3b')]['find']({'where':{'id':_0x23e23d[_0x9e73('0x3f')]['id']}})['then'](handleEntityNotFound(_0x43c524,null))[_0x9e73('0x23')](saveUpdates(_0x23e23d[_0x9e73('0x45')],null))[_0x9e73('0x23')](respondWithResult(_0x43c524,null))['catch'](handleError(_0x43c524,null));};exports[_0x9e73('0x22')]=function(_0x2e61eb,_0x50737d){return db[_0x9e73('0x3b')][_0x9e73('0x4b')]({'where':{'id':_0x2e61eb[_0x9e73('0x3f')]['id']}})[_0x9e73('0x23')](handleEntityNotFound(_0x50737d,null))[_0x9e73('0x23')](removeEntity(_0x50737d,null))['catch'](handleError(_0x50737d,null));}; \ No newline at end of file +var _0xa588=['apply','reject','save','update','then','destroy','get','Tags','sendStatus','error','index','map','Tag','rawAttributes','fieldName','type','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x2fb045,_0x5631b2){var _0x3ecb22=function(_0x3f72f5){while(--_0x3f72f5){_0x2fb045['push'](_0x2fb045['shift']());}};_0x3ecb22(++_0x5631b2);}(_0xa588,0xe1));var _0x8a58=function(_0x4b2b5a,_0x3f7555){_0x4b2b5a=_0x4b2b5a-0x0;var _0x47f812=_0xa588[_0x4b2b5a];return _0x47f812;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a58('0x0'));var zipdir=require(_0x8a58('0x1'));var jsonpatch=require(_0x8a58('0x2'));var rp=require(_0x8a58('0x3'));var moment=require(_0x8a58('0x4'));var BPromise=require(_0x8a58('0x5'));var Mustache=require(_0x8a58('0x6'));var util=require(_0x8a58('0x7'));var path=require(_0x8a58('0x8'));var sox=require('sox');var csv=require(_0x8a58('0x9'));var ejs=require(_0x8a58('0xa'));var fs=require('fs');var fs_extra=require(_0x8a58('0xb'));var _=require(_0x8a58('0xc'));var squel=require(_0x8a58('0xd'));var crypto=require(_0x8a58('0xe'));var jsforce=require(_0x8a58('0xf'));var deskjs=require(_0x8a58('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a58('0x11'));var Papa=require(_0x8a58('0x12'));var Redis=require(_0x8a58('0x13'));var authService=require(_0x8a58('0x14'));var qs=require(_0x8a58('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a58('0x16'));var logger=require(_0x8a58('0x17'))(_0x8a58('0x18'));var utils=require(_0x8a58('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8a58('0x1a'))['db'];function respondWithStatusCode(_0x5ec103,_0x21208d){_0x21208d=_0x21208d||0xcc;return function(_0xc5d2fa){if(_0xc5d2fa){return _0x5ec103['sendStatus'](_0x21208d);}return _0x5ec103[_0x8a58('0x1b')](_0x21208d)[_0x8a58('0x1c')]();};}function respondWithResult(_0x56a61d,_0x3d40a5){_0x3d40a5=_0x3d40a5||0xc8;return function(_0x268506){if(_0x268506){return _0x56a61d['status'](_0x3d40a5)[_0x8a58('0x1d')](_0x268506);}};}function respondWithFilteredResult(_0x18a33c,_0x3010ae){return function(_0x3ff39e){if(_0x3ff39e){var _0x26e3a8=typeof _0x3010ae[_0x8a58('0x1e')]===_0x8a58('0x1f')&&typeof _0x3010ae['limit']==='undefined';var _0x31de8d=_0x3ff39e[_0x8a58('0x20')];var _0x18a14d=_0x26e3a8?0x0:_0x3010ae['offset'];var _0x282f2d=_0x26e3a8?_0x3ff39e[_0x8a58('0x20')]:_0x3010ae['offset']+_0x3010ae[_0x8a58('0x21')];var _0x15b527;if(_0x282f2d>=_0x31de8d){_0x282f2d=_0x31de8d;_0x15b527=0xc8;}else{_0x15b527=0xce;}_0x18a33c[_0x8a58('0x1b')](_0x15b527);return _0x18a33c[_0x8a58('0x22')](_0x8a58('0x23'),_0x18a14d+'-'+_0x282f2d+'/'+_0x31de8d)[_0x8a58('0x1d')](_0x3ff39e);}return null;};}function patchUpdates(_0x284bb8){return function(_0x115e19){try{jsonpatch[_0x8a58('0x24')](_0x115e19,_0x284bb8,!![]);}catch(_0xbf556a){return BPromise[_0x8a58('0x25')](_0xbf556a);}return _0x115e19[_0x8a58('0x26')]();};}function saveUpdates(_0x3758fa,_0x34adb8){return function(_0x561a9a){if(_0x561a9a){return _0x561a9a[_0x8a58('0x27')](_0x3758fa)[_0x8a58('0x28')](function(_0x20a6c5){return _0x20a6c5;});}return null;};}function removeEntity(_0x3f07ab,_0x22c898){return function(_0x415946){if(_0x415946){return _0x415946[_0x8a58('0x29')]()['then'](function(){var _0x1ff181=_0x415946[_0x8a58('0x2a')]({'plain':!![]});var _0x30c96b=_0x8a58('0x2b');return db['UserProfileResource'][_0x8a58('0x29')]({'where':{'type':_0x30c96b,'resourceId':_0x1ff181['id']}})[_0x8a58('0x28')](function(){return _0x415946;});})[_0x8a58('0x28')](function(){_0x3f07ab['status'](0xcc)[_0x8a58('0x1c')]();});}};}function handleEntityNotFound(_0x31abcc,_0x4426ff){return function(_0x27d7c8){if(!_0x27d7c8){_0x31abcc[_0x8a58('0x2c')](0x194);}return _0x27d7c8;};}function handleError(_0x3e317f,_0x1a411a){_0x1a411a=_0x1a411a||0x1f4;return function(_0x4d5041){logger[_0x8a58('0x2d')](_0x4d5041['stack']);if(_0x4d5041['name']){delete _0x4d5041['name'];}_0x3e317f['status'](_0x1a411a)['send'](_0x4d5041);};}exports[_0x8a58('0x2e')]=function(_0x175235,_0x1b2d9e){var _0x205b41={},_0x5dc010={},_0x261096={'count':0x0,'rows':[]};var _0x2a20ad=_[_0x8a58('0x2f')](db[_0x8a58('0x30')][_0x8a58('0x31')],function(_0x8ab99c){return{'name':_0x8ab99c[_0x8a58('0x32')],'type':_0x8ab99c[_0x8a58('0x33')]['key']};});_0x5dc010[_0x8a58('0x34')]=_[_0x8a58('0x2f')](_0x2a20ad,_0x8a58('0x35'));_0x5dc010[_0x8a58('0x36')]=_[_0x8a58('0x37')](_0x175235[_0x8a58('0x36')]);_0x5dc010['filters']=_[_0x8a58('0x38')](_0x5dc010[_0x8a58('0x34')],_0x5dc010[_0x8a58('0x36')]);_0x205b41[_0x8a58('0x39')]=_[_0x8a58('0x38')](_0x5dc010[_0x8a58('0x34')],qs[_0x8a58('0x3a')](_0x175235['query'][_0x8a58('0x3a')]));_0x205b41[_0x8a58('0x39')]=_0x205b41[_0x8a58('0x39')]['length']?_0x205b41['attributes']:_0x5dc010['model'];if(!_0x175235[_0x8a58('0x36')][_0x8a58('0x3b')](_0x8a58('0x3c'))){_0x205b41[_0x8a58('0x21')]=qs['limit'](_0x175235[_0x8a58('0x36')][_0x8a58('0x21')]);_0x205b41[_0x8a58('0x1e')]=qs[_0x8a58('0x1e')](_0x175235['query'][_0x8a58('0x1e')]);}_0x205b41[_0x8a58('0x3d')]=qs['sort'](_0x175235[_0x8a58('0x36')][_0x8a58('0x3e')]);_0x205b41[_0x8a58('0x3f')]=qs[_0x8a58('0x40')](_[_0x8a58('0x41')](_0x175235[_0x8a58('0x36')],_0x5dc010['filters']),_0x2a20ad);if(_0x175235['query'][_0x8a58('0x42')]){_0x205b41[_0x8a58('0x3f')]=_['merge'](_0x205b41[_0x8a58('0x3f')],{'$or':_[_0x8a58('0x2f')](_0x2a20ad,function(_0x478454){if(_0x478454[_0x8a58('0x33')]!==_0x8a58('0x43')){var _0x4e9e04={};_0x4e9e04[_0x478454[_0x8a58('0x35')]]={'$like':'%'+_0x175235['query'][_0x8a58('0x42')]+'%'};return _0x4e9e04;}})});}_0x205b41=_[_0x8a58('0x44')]({},_0x205b41,_0x175235[_0x8a58('0x45')]);var _0x40ca09={'where':_0x205b41[_0x8a58('0x3f')]};return db[_0x8a58('0x30')][_0x8a58('0x20')](_0x40ca09)['then'](function(_0x5cd9d8){_0x261096[_0x8a58('0x20')]=_0x5cd9d8;if(_0x175235['query']['includeAll']){_0x205b41[_0x8a58('0x46')]=[{'all':!![]}];}return db[_0x8a58('0x30')][_0x8a58('0x47')](_0x205b41);})['then'](function(_0x56a410){_0x261096[_0x8a58('0x48')]=_0x56a410;return _0x261096;})['then'](respondWithFilteredResult(_0x1b2d9e,_0x205b41))[_0x8a58('0x49')](handleError(_0x1b2d9e,null));};exports[_0x8a58('0x4a')]=function(_0x3feec0,_0x3faae2){var _0x4c9c56={'raw':!![],'where':{'id':_0x3feec0[_0x8a58('0x4b')]['id']}},_0x417951={};_0x417951['model']=_[_0x8a58('0x37')](db[_0x8a58('0x30')][_0x8a58('0x31')]);_0x417951[_0x8a58('0x36')]=_['keys'](_0x3feec0[_0x8a58('0x36')]);_0x417951['filters']=_[_0x8a58('0x38')](_0x417951[_0x8a58('0x34')],_0x417951['query']);_0x4c9c56[_0x8a58('0x39')]=_['intersection'](_0x417951['model'],qs[_0x8a58('0x3a')](_0x3feec0[_0x8a58('0x36')][_0x8a58('0x3a')]));_0x4c9c56[_0x8a58('0x39')]=_0x4c9c56[_0x8a58('0x39')][_0x8a58('0x4c')]?_0x4c9c56['attributes']:_0x417951['model'];if(_0x3feec0[_0x8a58('0x36')][_0x8a58('0x4d')]){_0x4c9c56[_0x8a58('0x46')]=[{'all':!![]}];}_0x4c9c56=_[_0x8a58('0x44')]({},_0x4c9c56,_0x3feec0[_0x8a58('0x45')]);return db[_0x8a58('0x30')][_0x8a58('0x4e')](_0x4c9c56)[_0x8a58('0x28')](handleEntityNotFound(_0x3faae2,null))[_0x8a58('0x28')](respondWithResult(_0x3faae2,null))[_0x8a58('0x49')](handleError(_0x3faae2,null));};exports[_0x8a58('0x4f')]=function(_0x392c32,_0x1ea824){return db[_0x8a58('0x30')]['create'](_0x392c32[_0x8a58('0x50')],{})[_0x8a58('0x28')](function(_0xeb5231){var _0x409f9e=_0x392c32[_0x8a58('0x51')][_0x8a58('0x2a')]({'plain':!![]});if(!_0x409f9e)throw new Error(_0x8a58('0x52'));if(_0x409f9e['role']==='user'){var _0x5ab682=_0xeb5231[_0x8a58('0x2a')]({'plain':!![]});var _0xe0ed75=_0x8a58('0x2b');return db['UserProfileSection'][_0x8a58('0x4e')]({'where':{'name':_0xe0ed75,'userProfileId':_0x409f9e[_0x8a58('0x53')]},'raw':!![]})[_0x8a58('0x28')](function(_0x3ad78c){if(_0x3ad78c&&_0x3ad78c[_0x8a58('0x54')]===0x0){return db[_0x8a58('0x55')][_0x8a58('0x4f')]({'name':_0x5ab682[_0x8a58('0x35')],'resourceId':_0x5ab682['id'],'type':_0x3ad78c[_0x8a58('0x35')],'sectionId':_0x3ad78c['id']},{})[_0x8a58('0x28')](function(){return _0xeb5231;});}else{return _0xeb5231;}})[_0x8a58('0x49')](function(_0x130406){logger['error'](_0x8a58('0x56'),_0x130406);throw _0x130406;});}return _0xeb5231;})[_0x8a58('0x28')](respondWithResult(_0x1ea824,0xc9))['catch'](handleError(_0x1ea824,null));};exports[_0x8a58('0x27')]=function(_0xfab1e4,_0x1ce5e0){if(_0xfab1e4['body']['id']){delete _0xfab1e4[_0x8a58('0x50')]['id'];}return db['Tag'][_0x8a58('0x4e')]({'where':{'id':_0xfab1e4[_0x8a58('0x4b')]['id']}})[_0x8a58('0x28')](handleEntityNotFound(_0x1ce5e0,null))[_0x8a58('0x28')](saveUpdates(_0xfab1e4[_0x8a58('0x50')],null))[_0x8a58('0x28')](respondWithResult(_0x1ce5e0,null))[_0x8a58('0x49')](handleError(_0x1ce5e0,null));};exports[_0x8a58('0x29')]=function(_0x2c4a18,_0x53fbde){return db[_0x8a58('0x30')][_0x8a58('0x4e')]({'where':{'id':_0x2c4a18[_0x8a58('0x4b')]['id']}})[_0x8a58('0x28')](handleEntityNotFound(_0x53fbde,null))[_0x8a58('0x28')](removeEntity(_0x53fbde,null))['catch'](handleError(_0x53fbde,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 532992f..3181042 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 _0xaa9c=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util'];(function(_0x41bd4a,_0x133151){var _0x4dc9f0=function(_0x5d5f9d){while(--_0x5d5f9d){_0x41bd4a['push'](_0x41bd4a['shift']());}};_0x4dc9f0(++_0x133151);}(_0xaa9c,0x8d));var _0xcaa9=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xaa9c[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xcaa9('0x0'));var util=require(_0xcaa9('0x1'));var logger=require(_0xcaa9('0x2'))(_0xcaa9('0x3'));var moment=require('moment');var BPromise=require(_0xcaa9('0x4'));var rp=require(_0xcaa9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaa9('0x6'));var config=require(_0xcaa9('0x7'));var attributes=require(_0xcaa9('0x8'));module[_0xcaa9('0x9')]=function(_0xe4b71,_0x2d6e50){return _0xe4b71[_0xcaa9('0xa')](_0xcaa9('0xb'),attributes,{'tableName':_0xcaa9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65c2=['define','Tag','lodash','util','../../config/logger','api','rimraf','exports'];(function(_0x16e78c,_0x5088fa){var _0xbd7e=function(_0x1cefde){while(--_0x1cefde){_0x16e78c['push'](_0x16e78c['shift']());}};_0xbd7e(++_0x5088fa);}(_0x65c2,0x92));var _0x265c=function(_0x4b70a2,_0x5d0fbd){_0x4b70a2=_0x4b70a2-0x0;var _0x2170fa=_0x65c2[_0x4b70a2];return _0x2170fa;};'use strict';var _=require(_0x265c('0x0'));var util=require(_0x265c('0x1'));var logger=require(_0x265c('0x2'))(_0x265c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x265c('0x4'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0x265c('0x5')]=function(_0x5f29d5,_0x3eaebd){return _0x5f29d5[_0x265c('0x6')](_0x265c('0x7'),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 123f3b9..ec31939 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 _0xfa2b=['jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x548ce0,_0x4baf45){var _0x40401a=function(_0x2abfa2){while(--_0x2abfa2){_0x548ce0['push'](_0x548ce0['shift']());}};_0x40401a(++_0x4baf45);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x2dd3b9,_0x58eb32){_0x2dd3b9=_0x2dd3b9-0x0;var _0x3f5771=_0xfa2b[_0x2dd3b9];return _0x3f5771;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var moment=require(_0xbfa2('0x2'));var BPromise=require(_0xbfa2('0x3'));var rs=require(_0xbfa2('0x4'));var fs=require('fs');var Redis=require(_0xbfa2('0x5'));var db=require(_0xbfa2('0x6'))['db'];var utils=require(_0xbfa2('0x7'));var logger=require(_0xbfa2('0x8'))(_0xbfa2('0x9'));var config=require(_0xbfa2('0xa'));var jayson=require(_0xbfa2('0xb'));var client=jayson[_0xbfa2('0xc')][_0xbfa2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x26ed93,_0x26e9bf,_0x4cd9ae){return new BPromise(function(_0x46a151,_0x4f17e6){return client[_0xbfa2('0xe')](_0x26ed93,_0x4cd9ae)[_0xbfa2('0xf')](function(_0x1b1c13){logger[_0xbfa2('0x10')](_0xbfa2('0x11'),_0x26e9bf,_0xbfa2('0x12'));logger[_0xbfa2('0x13')](_0xbfa2('0x14'),_0x26e9bf,_0xbfa2('0x12'),JSON['stringify'](_0x1b1c13));if(_0x1b1c13['error']){if(_0x1b1c13['error'][_0xbfa2('0x15')]===0x1f4){logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x4f17e6(_0x1b1c13[_0xbfa2('0x16')]['message']);}logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x46a151(_0x1b1c13[_0xbfa2('0x16')]['message']);}else{logger[_0xbfa2('0x10')]('Tag,\x20%s,\x20%s',_0x26e9bf,'request\x20sent');_0x46a151(_0x1b1c13[_0xbfa2('0x18')]['message']);}})['catch'](function(_0xab2c91){logger[_0xbfa2('0x16')]('Tag,\x20%s,\x20%s',_0x26e9bf,_0xab2c91);_0x4f17e6(_0xab2c91);});});} \ No newline at end of file +var _0x0c6d=['code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x1f6fb0,_0x17555b){_0x1f6fb0=_0x1f6fb0-0x0;var _0x1e2464=_0x0c6d[_0x1f6fb0];return _0x1e2464;};'use strict';var _=require('lodash');var util=require(_0xd0c6('0x0'));var moment=require(_0xd0c6('0x1'));var BPromise=require(_0xd0c6('0x2'));var rs=require(_0xd0c6('0x3'));var fs=require('fs');var Redis=require(_0xd0c6('0x4'));var db=require(_0xd0c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0c6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd0c6('0x7')][_0xd0c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d4a64,_0x5de1cd,_0x16c6da){return new BPromise(function(_0x534412,_0x2a14f1){return client[_0xd0c6('0x9')](_0x2d4a64,_0x16c6da)[_0xd0c6('0xa')](function(_0x184f65){logger[_0xd0c6('0xb')](_0xd0c6('0xc'),_0x5de1cd,_0xd0c6('0xd'));logger[_0xd0c6('0xe')](_0xd0c6('0xf'),_0x5de1cd,'request\x20sent',JSON[_0xd0c6('0x10')](_0x184f65));if(_0x184f65['error']){if(_0x184f65['error'][_0xd0c6('0x11')]===0x1f4){logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);return _0x2a14f1(_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);}logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);return _0x534412(_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);}else{logger[_0xd0c6('0xb')](_0xd0c6('0xc'),_0x5de1cd,_0xd0c6('0xd'));_0x534412(_0x184f65[_0xd0c6('0x14')][_0xd0c6('0x13')]);}})[_0xd0c6('0x15')](function(_0x19dd14){logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x19dd14);_0x2a14f1(_0x19dd14);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 9b27676..9dfb065 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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_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['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 e814a24..34e325a 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 _0xbaf0=['name','exports','STRING'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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 +var _0xb7e7=['STRING','sequelize'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xb7e7[_0x9fd887];return _0x1a54ab;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index edf9c82..64021c6 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 _0xffb5=['fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','error','stack','name','send','map','Team','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','model','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','getQueues','isValidChannel','channel','Unknown\x20channel','capitalize','toLowerCase','Queue','sort','pick','Queues','addQueues','findOne','ValidationError','ids','removeQueues','addAgents','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','transaction','penalty','QueueId','User','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','isNil','format','TeamVoiceQueue','all','Mail','removeAgents','Queue:remove','TeamVoicePrefix','getAgents','rimraf','zip-dir'];(function(_0x3d8ecb,_0x3adc6b){var _0x3c8701=function(_0x281ee0){while(--_0x281ee0){_0x3d8ecb['push'](_0x3d8ecb['shift']());}};_0x3c8701(++_0x3adc6b);}(_0xffb5,0x9a));var _0x5ffb=function(_0x4fbf46,_0x38c34d){_0x4fbf46=_0x4fbf46-0x0;var _0x21bc72=_0xffb5[_0x4fbf46];return _0x21bc72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ffb('0x0'));var zipdir=require(_0x5ffb('0x1'));var jsonpatch=require(_0x5ffb('0x2'));var rp=require('request-promise');var moment=require(_0x5ffb('0x3'));var BPromise=require(_0x5ffb('0x4'));var Mustache=require(_0x5ffb('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5ffb('0x6'));var csv=require(_0x5ffb('0x7'));var ejs=require(_0x5ffb('0x8'));var fs=require('fs');var fs_extra=require(_0x5ffb('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5ffb('0xa'));var jsforce=require(_0x5ffb('0xb'));var deskjs=require(_0x5ffb('0xc'));var toCsv=require(_0x5ffb('0x7'));var querystring=require(_0x5ffb('0xd'));var Papa=require(_0x5ffb('0xe'));var Redis=require(_0x5ffb('0xf'));var authService=require(_0x5ffb('0x10'));var qs=require(_0x5ffb('0x11'));var as=require(_0x5ffb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ffb('0x13'))(_0x5ffb('0x14'));var utils=require(_0x5ffb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5ffb('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5ffb('0x17')](config[_0x5ffb('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ffb('0x19'))(new Redis(config[_0x5ffb('0x18')]));require('./team.socket')[_0x5ffb('0x1a')](socket);function respondWithStatusCode(_0x259c79,_0x44a5b7){_0x44a5b7=_0x44a5b7||0xcc;return function(_0x315d10){if(_0x315d10){return _0x259c79[_0x5ffb('0x1b')](_0x44a5b7);}return _0x259c79['status'](_0x44a5b7)[_0x5ffb('0x1c')]();};}function respondWithResult(_0x8a6736,_0x53599e){_0x53599e=_0x53599e||0xc8;return function(_0x3e3145){if(_0x3e3145){return _0x8a6736[_0x5ffb('0x1d')](_0x53599e)[_0x5ffb('0x1e')](_0x3e3145);}};}function respondWithFilteredResult(_0x3e542a,_0x1857d3){return function(_0x1b8c9e){if(_0x1b8c9e){var _0x28a825=typeof _0x1857d3[_0x5ffb('0x1f')]===_0x5ffb('0x20')&&typeof _0x1857d3[_0x5ffb('0x21')]===_0x5ffb('0x20');var _0x40db57=_0x1b8c9e[_0x5ffb('0x22')];var _0x3fca1b=_0x28a825?0x0:_0x1857d3['offset'];var _0x5728d5=_0x28a825?_0x1b8c9e[_0x5ffb('0x22')]:_0x1857d3[_0x5ffb('0x1f')]+_0x1857d3[_0x5ffb('0x21')];var _0xcae4e8;if(_0x5728d5>=_0x40db57){_0x5728d5=_0x40db57;_0xcae4e8=0xc8;}else{_0xcae4e8=0xce;}_0x3e542a[_0x5ffb('0x1d')](_0xcae4e8);return _0x3e542a['set'](_0x5ffb('0x23'),_0x3fca1b+'-'+_0x5728d5+'/'+_0x40db57)[_0x5ffb('0x1e')](_0x1b8c9e);}return null;};}function patchUpdates(_0x1242f8){return function(_0xecd455){try{jsonpatch[_0x5ffb('0x24')](_0xecd455,_0x1242f8,!![]);}catch(_0x2e4ca3){return BPromise[_0x5ffb('0x25')](_0x2e4ca3);}return _0xecd455[_0x5ffb('0x26')]();};}function saveUpdates(_0x150644,_0x17e771){return function(_0x24b5ae){if(_0x24b5ae){return _0x24b5ae[_0x5ffb('0x27')](_0x150644)['then'](function(_0x49d051){return _0x49d051;});}return null;};}function handleEntityNotFound(_0x156cd0,_0x5a1b87){return function(_0xdc3dda){if(!_0xdc3dda){_0x156cd0['sendStatus'](0x194);}return _0xdc3dda;};}function handleError(_0x1a420f,_0x540031){_0x540031=_0x540031||0x1f4;return function(_0x44d656){logger[_0x5ffb('0x28')](_0x44d656[_0x5ffb('0x29')]);if(_0x44d656[_0x5ffb('0x2a')]){delete _0x44d656['name'];}_0x1a420f[_0x5ffb('0x1d')](_0x540031)[_0x5ffb('0x2b')](_0x44d656);};}exports['index']=function(_0x60dac8,_0x21b9ec){var _0x46cbaa={},_0x3554d6={},_0x43e1f2={'count':0x0,'rows':[]};var _0x442c1a=_[_0x5ffb('0x2c')](db[_0x5ffb('0x2d')][_0x5ffb('0x2e')],function(_0x3957e){return{'name':_0x3957e[_0x5ffb('0x2f')],'type':_0x3957e[_0x5ffb('0x30')][_0x5ffb('0x31')]};});_0x3554d6['model']=_[_0x5ffb('0x2c')](_0x442c1a,_0x5ffb('0x2a'));_0x3554d6[_0x5ffb('0x32')]=_[_0x5ffb('0x33')](_0x60dac8[_0x5ffb('0x32')]);_0x3554d6[_0x5ffb('0x34')]=_[_0x5ffb('0x35')](_0x3554d6['model'],_0x3554d6[_0x5ffb('0x32')]);_0x46cbaa[_0x5ffb('0x36')]=_[_0x5ffb('0x35')](_0x3554d6['model'],qs[_0x5ffb('0x37')](_0x60dac8['query'][_0x5ffb('0x37')]));_0x46cbaa[_0x5ffb('0x36')]=_0x46cbaa[_0x5ffb('0x36')][_0x5ffb('0x38')]?_0x46cbaa['attributes']:_0x3554d6['model'];if(!_0x60dac8['query'][_0x5ffb('0x39')](_0x5ffb('0x3a'))){_0x46cbaa[_0x5ffb('0x21')]=qs[_0x5ffb('0x21')](_0x60dac8['query']['limit']);_0x46cbaa['offset']=qs[_0x5ffb('0x1f')](_0x60dac8[_0x5ffb('0x32')][_0x5ffb('0x1f')]);}_0x46cbaa[_0x5ffb('0x3b')]=qs['sort'](_0x60dac8[_0x5ffb('0x32')]['sort']);_0x46cbaa[_0x5ffb('0x3c')]=qs[_0x5ffb('0x34')](_['pick'](_0x60dac8[_0x5ffb('0x32')],_0x3554d6[_0x5ffb('0x34')]),_0x442c1a);if(_0x60dac8[_0x5ffb('0x32')][_0x5ffb('0x3d')]){_0x46cbaa[_0x5ffb('0x3c')]=_[_0x5ffb('0x3e')](_0x46cbaa[_0x5ffb('0x3c')],{'$or':_[_0x5ffb('0x2c')](_0x442c1a,function(_0xa7a098){if(_0xa7a098[_0x5ffb('0x30')]!==_0x5ffb('0x3f')){var _0x28db31={};_0x28db31[_0xa7a098[_0x5ffb('0x2a')]]={'$like':'%'+_0x60dac8[_0x5ffb('0x32')]['filter']+'%'};return _0x28db31;}})});}_0x46cbaa=_['merge']({},_0x46cbaa,_0x60dac8[_0x5ffb('0x40')]);var _0x50659e={'where':_0x46cbaa[_0x5ffb('0x3c')]};return db['Team'][_0x5ffb('0x22')](_0x50659e)[_0x5ffb('0x41')](function(_0x40c61f){_0x43e1f2['count']=_0x40c61f;if(_0x60dac8[_0x5ffb('0x32')][_0x5ffb('0x42')]){_0x46cbaa['include']=[{'all':!![]}];}return db[_0x5ffb('0x2d')][_0x5ffb('0x43')](_0x46cbaa);})[_0x5ffb('0x41')](function(_0x472aa1){_0x43e1f2[_0x5ffb('0x44')]=_0x472aa1;return _0x43e1f2;})[_0x5ffb('0x41')](respondWithFilteredResult(_0x21b9ec,_0x46cbaa))[_0x5ffb('0x45')](handleError(_0x21b9ec,null));};exports[_0x5ffb('0x46')]=function(_0x1f1532,_0x4e915b){var _0x611fcd={'raw':![],'where':{'id':_0x1f1532[_0x5ffb('0x47')]['id']}},_0x4e1fa2={};_0x4e1fa2['model']=_['keys'](db[_0x5ffb('0x2d')][_0x5ffb('0x2e')]);_0x4e1fa2[_0x5ffb('0x32')]=_[_0x5ffb('0x33')](_0x1f1532[_0x5ffb('0x32')]);_0x4e1fa2[_0x5ffb('0x34')]=_[_0x5ffb('0x35')](_0x4e1fa2[_0x5ffb('0x48')],_0x4e1fa2['query']);_0x611fcd['attributes']=_[_0x5ffb('0x35')](_0x4e1fa2['model'],qs[_0x5ffb('0x37')](_0x1f1532[_0x5ffb('0x32')][_0x5ffb('0x37')]));_0x611fcd[_0x5ffb('0x36')]=_0x611fcd[_0x5ffb('0x36')][_0x5ffb('0x38')]?_0x611fcd['attributes']:_0x4e1fa2['model'];if(_0x1f1532[_0x5ffb('0x32')][_0x5ffb('0x42')]){_0x611fcd[_0x5ffb('0x49')]=[{'all':!![]}];}_0x611fcd=_[_0x5ffb('0x3e')]({},_0x611fcd,_0x1f1532[_0x5ffb('0x40')]);return db['Team'][_0x5ffb('0x4a')](_0x611fcd)['then'](handleEntityNotFound(_0x4e915b,null))[_0x5ffb('0x41')](respondWithResult(_0x4e915b,null))[_0x5ffb('0x45')](handleError(_0x4e915b,null));};exports[_0x5ffb('0x4b')]=function(_0x243b1e,_0x33f1c7){return db['Team']['create'](_0x243b1e[_0x5ffb('0x4c')],{})['then'](function(_0x15daf2){var _0x4a7b13=_0x243b1e[_0x5ffb('0x4d')][_0x5ffb('0x4e')]({'plain':!![]});if(!_0x4a7b13)throw new Error(_0x5ffb('0x4f'));if(_0x4a7b13[_0x5ffb('0x50')]===_0x5ffb('0x4d')){var _0xec6f31=_0x15daf2[_0x5ffb('0x4e')]({'plain':!![]});var _0x38ef4b='Teams';return db[_0x5ffb('0x51')]['find']({'where':{'name':_0x38ef4b,'userProfileId':_0x4a7b13[_0x5ffb('0x52')]},'raw':!![]})[_0x5ffb('0x41')](function(_0x2b71d6){if(_0x2b71d6&&_0x2b71d6[_0x5ffb('0x53')]===0x0){return db[_0x5ffb('0x54')][_0x5ffb('0x4b')]({'name':_0xec6f31[_0x5ffb('0x2a')],'resourceId':_0xec6f31['id'],'type':_0x2b71d6[_0x5ffb('0x2a')],'sectionId':_0x2b71d6['id']},{})[_0x5ffb('0x41')](function(){return _0x15daf2;});}else{return _0x15daf2;}})[_0x5ffb('0x45')](function(_0x13e5d6){logger[_0x5ffb('0x28')](_0x5ffb('0x55'),_0x13e5d6);throw _0x13e5d6;});}return _0x15daf2;})['then'](respondWithResult(_0x33f1c7,0xc9))['catch'](handleError(_0x33f1c7,null));};exports['update']=function(_0x3190b7,_0x1ad767){if(_0x3190b7['body']['id']){delete _0x3190b7[_0x5ffb('0x4c')]['id'];}return db[_0x5ffb('0x2d')][_0x5ffb('0x4a')]({'where':{'id':_0x3190b7[_0x5ffb('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ad767,null))[_0x5ffb('0x41')](saveUpdates(_0x3190b7[_0x5ffb('0x4c')],null))['then'](respondWithResult(_0x1ad767,null))[_0x5ffb('0x45')](handleError(_0x1ad767,null));};exports['destroy']=function(_0x543122,_0x45bc95){var _0x76e87f=_0x543122[_0x5ffb('0x47')]['id'];var _0x723ceb=[];return db[_0x5ffb('0x56')]['transaction'](function(_0x2fd67b){var _0x502f91=_0x5ffb('0x57')+_0x76e87f;return db['sequelize'][_0x5ffb('0x32')](_0x502f91,{'type':db['Sequelize'][_0x5ffb('0x58')][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b})['then'](function(_0x399a2a){_0x723ceb=_[_0x5ffb('0x2c')](_0x399a2a,function(_0x12622b){return Number(_0x12622b[_0x5ffb('0x5a')]);});})[_0x5ffb('0x41')](function(){var _0x4e16e8=_0x5ffb('0x5b')+_0x76e87f;return db[_0x5ffb('0x56')][_0x5ffb('0x32')](_0x4e16e8,{'type':db[_0x5ffb('0x5c')][_0x5ffb('0x58')][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0x3d4d92){var _0x906a87=_[_0x5ffb('0x2c')](_0x3d4d92,function(_0x56a0ae){return Number(_0x56a0ae[_0x5ffb('0x5d')]);});return db[_0x5ffb('0x5e')][_0x5ffb('0x5f')]({'where':{'UserId':{'$in':_0x723ceb},'VoiceQueueId':{'$in':_0x906a87}},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){var _0x281c5f=_0x5ffb('0x60')+_0x76e87f;return db[_0x5ffb('0x56')]['query'](_0x281c5f,{'type':db[_0x5ffb('0x5c')][_0x5ffb('0x58')][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0xb8a947){var _0x2fbf95=_[_0x5ffb('0x2c')](_0xb8a947,function(_0x20fd3e){return Number(_0x20fd3e[_0x5ffb('0x61')]);});return db[_0x5ffb('0x62')][_0x5ffb('0x5f')]({'where':{'UserId':{'$in':_0x723ceb},'MailQueueId':{'$in':_0x2fbf95}},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){var _0x51fdb9=_0x5ffb('0x63')+_0x76e87f;return db['sequelize']['query'](_0x51fdb9,{'type':db[_0x5ffb('0x5c')][_0x5ffb('0x58')][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0x34bb62){var _0x586ae6=_[_0x5ffb('0x2c')](_0x34bb62,function(_0x2b1500){return Number(_0x2b1500[_0x5ffb('0x64')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x723ceb},'SmsQueueId':{'$in':_0x586ae6}},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){var _0x39ed92='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x76e87f;return db['sequelize'][_0x5ffb('0x32')](_0x39ed92,{'type':db['Sequelize']['QueryTypes'][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0x5772f0){var _0x1d0b5e=_[_0x5ffb('0x2c')](_0x5772f0,function(_0x1251ce){return Number(_0x1251ce[_0x5ffb('0x65')]);});return db[_0x5ffb('0x66')][_0x5ffb('0x5f')]({'where':{'UserId':{'$in':_0x723ceb},'ChatQueueId':{'$in':_0x1d0b5e}},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){var _0x4681e9=_0x5ffb('0x67')+_0x76e87f;return db['sequelize'][_0x5ffb('0x32')](_0x4681e9,{'type':db['Sequelize'][_0x5ffb('0x58')][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b});})['then'](function(_0x86bd65){var _0x4051e3=_[_0x5ffb('0x2c')](_0x86bd65,function(_0x58085e){return Number(_0x58085e[_0x5ffb('0x68')]);});return db[_0x5ffb('0x69')][_0x5ffb('0x5f')]({'where':{'UserId':{'$in':_0x723ceb},'FaxQueueId':{'$in':_0x4051e3}},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){var _0x4d86b5=_0x5ffb('0x6a')+_0x76e87f;return db[_0x5ffb('0x56')][_0x5ffb('0x32')](_0x4d86b5,{'type':db[_0x5ffb('0x5c')]['QueryTypes'][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0x5ab5b8){var _0x5833ac=_[_0x5ffb('0x2c')](_0x5ab5b8,function(_0x584c73){return Number(_0x584c73[_0x5ffb('0x6b')]);});return db[_0x5ffb('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x723ceb},'OpenchannelQueueId':{'$in':_0x5833ac}},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){var _0x34e5ce=_0x5ffb('0x6d')+_0x76e87f;return db['sequelize']['query'](_0x34e5ce,{'type':db[_0x5ffb('0x5c')][_0x5ffb('0x58')]['SELECT'],'raw':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0x28f315){var _0x5b3488=_[_0x5ffb('0x2c')](_0x28f315,function(_0x536beb){return Number(_0x536beb[_0x5ffb('0x6e')]);});return db[_0x5ffb('0x6f')]['destroy']({'where':{'UserId':{'$in':_0x723ceb},'WhatsappQueueId':{'$in':_0x5b3488}},'transaction':_0x2fd67b});})['then'](function(){return db['TeamVoicePrefix'][_0x5ffb('0x4a')]({'where':{'TeamId':_0x76e87f}});})[_0x5ffb('0x41')](function(_0x40d0dc){if(_0x40d0dc===null){return;}return db[_0x5ffb('0x70')][_0x5ffb('0x5f')]({'where':{'UserId':{'$in':_0x723ceb},'VoicePrefixId':_0x40d0dc[_0x5ffb('0x71')]},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){return db['Team'][_0x5ffb('0x5f')]({'where':{'id':_0x76e87f},'cascade':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0x5e11d1){if(_0x5e11d1===0x0){_0x45bc95[_0x5ffb('0x1b')](0x194);}else{return db[_0x5ffb('0x54')][_0x5ffb('0x5f')]({'where':{'type':'Teams','resourceId':_0x76e87f},'cascade':!![],'transaction':_0x2fd67b})[_0x5ffb('0x41')](function(){_0x45bc95[_0x5ffb('0x1d')](0xcc)[_0x5ffb('0x1c')]();});}})[_0x5ffb('0x45')](function(_0x26f299){_0x45bc95[_0x5ffb('0x1d')](0x1f4)[_0x5ffb('0x2b')](_0x26f299);});});};exports[_0x5ffb('0x72')]=function(_0x23b37d,_0x453199,_0x41154e){return db[_0x5ffb('0x2d')]['findOne']({'where':{'id':_0x23b37d[_0x5ffb('0x47')]['id']}})['then'](handleEntityNotFound(_0x453199,null))['then'](function(_0x9c321c){if(!_0x23b37d[_0x5ffb('0x32')]['channel']||!utils[_0x5ffb('0x73')](_0x23b37d['query'][_0x5ffb('0x74')])){throw new db['Sequelize']['ValidationError'](_0x5ffb('0x75'));}var _0x2c5dbd={};var _0x177318={};_0x177318[_0x5ffb('0x48')]=_[_0x5ffb('0x33')](db[_[_0x5ffb('0x76')](_0x23b37d[_0x5ffb('0x32')][_0x5ffb('0x74')][_0x5ffb('0x77')]())+_0x5ffb('0x78')]['rawAttributes']);_0x177318[_0x5ffb('0x32')]=_[_0x5ffb('0x33')](_0x23b37d['query']);_0x177318['filters']=_['intersection'](_0x177318[_0x5ffb('0x48')],_0x177318['query']);_0x2c5dbd[_0x5ffb('0x36')]=_[_0x5ffb('0x35')](_0x177318['model'],qs[_0x5ffb('0x37')](_0x23b37d['query'][_0x5ffb('0x37')]));_0x2c5dbd[_0x5ffb('0x36')]=_0x2c5dbd[_0x5ffb('0x36')][_0x5ffb('0x38')]?_0x2c5dbd[_0x5ffb('0x36')]:_0x177318[_0x5ffb('0x48')];_0x2c5dbd['limit']=qs[_0x5ffb('0x21')](_0x23b37d[_0x5ffb('0x32')][_0x5ffb('0x21')]);_0x2c5dbd[_0x5ffb('0x1f')]=qs['offset'](_0x23b37d[_0x5ffb('0x32')][_0x5ffb('0x1f')]);_0x2c5dbd[_0x5ffb('0x3b')]=qs[_0x5ffb('0x79')](_0x23b37d[_0x5ffb('0x32')][_0x5ffb('0x79')]);_0x2c5dbd[_0x5ffb('0x3c')]=qs[_0x5ffb('0x34')](_[_0x5ffb('0x7a')](_0x23b37d[_0x5ffb('0x32')],_0x177318[_0x5ffb('0x34')]));_0x2c5dbd=_['merge']({},_0x2c5dbd,_0x23b37d[_0x5ffb('0x40')]);return _0x9c321c[_0x5ffb('0x4e')+_[_0x5ffb('0x76')](_0x23b37d['query'][_0x5ffb('0x74')][_0x5ffb('0x77')]())+_0x5ffb('0x7b')](_0x2c5dbd);})[_0x5ffb('0x41')](respondWithResult(_0x453199,null))[_0x5ffb('0x45')](handleError(_0x453199,null));};exports[_0x5ffb('0x7c')]=function(_0x15af76,_0x5177b2,_0x2a7a11){return db['Team'][_0x5ffb('0x7d')]({'where':{'id':_0x15af76[_0x5ffb('0x47')]['id']}})[_0x5ffb('0x41')](function(_0x1049af){if(_0x1049af){if(!_0x15af76[_0x5ffb('0x4c')][_0x5ffb('0x74')]||!utils[_0x5ffb('0x73')](_0x15af76[_0x5ffb('0x4c')][_0x5ffb('0x74')])){throw new db['Sequelize'][(_0x5ffb('0x7e'))](_0x5ffb('0x75'));}return _0x1049af['add'+_[_0x5ffb('0x76')](_0x15af76[_0x5ffb('0x4c')][_0x5ffb('0x74')][_0x5ffb('0x77')]())+_0x5ffb('0x7b')](_0x15af76[_0x5ffb('0x4c')][_0x5ffb('0x7f')]);}return null;})[_0x5ffb('0x41')](handleEntityNotFound(_0x5177b2,null))[_0x5ffb('0x41')](respondWithStatusCode(_0x5177b2,null))[_0x5ffb('0x45')](handleError(_0x5177b2,null));};exports[_0x5ffb('0x80')]=function(_0x412fee,_0x4e8660,_0x3e509e){return db[_0x5ffb('0x2d')][_0x5ffb('0x7d')]({'where':{'id':_0x412fee['params']['id']}})['then'](function(_0xfb33de){if(_0xfb33de){if(!_0x412fee[_0x5ffb('0x32')][_0x5ffb('0x74')]||!utils['isValidChannel'](_0x412fee['query'][_0x5ffb('0x74')])){throw new db['Sequelize']['ValidationError'](_0x5ffb('0x75'));}return _0xfb33de['remove'+_[_0x5ffb('0x76')](_0x412fee[_0x5ffb('0x32')][_0x5ffb('0x74')]['toLowerCase']())+_0x5ffb('0x7b')](_0x412fee[_0x5ffb('0x32')][_0x5ffb('0x7f')]);}return null;})[_0x5ffb('0x41')](handleEntityNotFound(_0x4e8660,null))['then'](respondWithStatusCode(_0x4e8660,null))[_0x5ffb('0x45')](handleError(_0x4e8660,null));};exports[_0x5ffb('0x81')]=function(_0x10f208,_0x4b1ef7){var _0x48d6d6=_[_0x5ffb('0x82')](_0x10f208['body'][_0x5ffb('0x7f')])?_0x10f208[_0x5ffb('0x4c')][_0x5ffb('0x7f')]:[_0x10f208[_0x5ffb('0x4c')][_0x5ffb('0x7f')]];var _0xa44d1e=_0x10f208[_0x5ffb('0x47')]['id'];return db[_0x5ffb('0x2d')]['find']({'where':{'id':_0xa44d1e}})[_0x5ffb('0x41')](handleEntityNotFound(_0x4b1ef7,null))[_0x5ffb('0x41')](function(_0x4c1a5f){if(_0x4c1a5f){var _0x4c17fd=[_0x5ffb('0x83'),_0x5ffb('0x84'),'Mail',_0x5ffb('0x85'),_0x5ffb('0x86'),_0x5ffb('0x87'),_0x5ffb('0x88')];return db[_0x5ffb('0x56')][_0x5ffb('0x89')](function(_0x482340){var _0x5c344d=_['map'](_0x4c17fd,function(_0x2d9486){var _0x51aa6b={'attributes':['id','name']};if(_0x2d9486===_0x5ffb('0x83')){_0x51aa6b['through']={'attributes':[_0x5ffb('0x8a')]};}return _0x4c1a5f['get'+_0x2d9486+'Queues'](_0x51aa6b)[_0x5ffb('0x41')](function(_0x2c328a){var _0x10376c=_['map'](_0x2c328a,function(_0x88ae07){var _0x4dce55=_['map'](_0x48d6d6,function(_0x5cacad){var _0x5d0804={'where':{'UserId':_0x5cacad,[_0x2d9486+_0x5ffb('0x8b')]:_0x88ae07['id']},'transaction':_0x482340};if(_0x2d9486==='Voice'){_0x5d0804[_0x5ffb('0x17')]={'penalty':_0x88ae07['TeamVoiceQueue'][_0x5ffb('0x8a')]};}return db[_0x5ffb('0x8c')+_0x2d9486+'Queue']['findOrCreate'](_0x5d0804)[_0x5ffb('0x41')](function(){socket[_0x5ffb('0x8d')]('user'+_0x2d9486+_0x5ffb('0x8e'),{'UserId':_0x5cacad,[_0x2d9486+_0x5ffb('0x8b')]:_0x88ae07['id']});if(_0x2d9486!==_0x5ffb('0x83')){return;}return db[_0x5ffb('0x8c')]['findAll']({'where':{'id':_0x48d6d6,'online':0x1},'attributes':['id','name',_0x5ffb('0x8f'),_0x5ffb('0x90'),_0x5ffb('0x91')],'raw':!![]})['then'](function(_0x45924a){var _0x22ced6=_[_0x5ffb('0x2c')](_0x45924a,function(_0x39e3a6){return db[_0x5ffb('0x92')]['upsert']({'membername':_0x39e3a6[_0x5ffb('0x2a')],'UserId':_0x39e3a6['id'],'queue_name':_0x88ae07[_0x5ffb('0x2a')],'VoiceQueueId':_0x88ae07['id'],'interface':_[_0x5ffb('0x93')](_0x39e3a6[_0x5ffb('0x91')])?util[_0x5ffb('0x94')]('SIP/%s',_0x39e3a6[_0x5ffb('0x2a')]):_0x39e3a6[_0x5ffb('0x91')],'paused':_0x39e3a6[_0x5ffb('0x90')]||![],'penalty':_0x88ae07[_0x5ffb('0x95')][_0x5ffb('0x8a')]},{'transaction':_0x482340});});return Promise[_0x5ffb('0x96')](_0x22ced6);});});});return Promise[_0x5ffb('0x96')](_0x4dce55);});return Promise['all'](_0x10376c);})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0xa44d1e}})[_0x5ffb('0x41')](function(_0x4e58cf){if(_0x4e58cf){var _0x4585d5=_[_0x5ffb('0x2c')](_0x48d6d6,function(_0x463a15){db[_0x5ffb('0x70')]['upsert']({'UserId':_0x463a15,'VoicePrefixId':_0x4e58cf[_0x5ffb('0x71')]});});return Promise[_0x5ffb('0x96')](_0x4585d5);}});});});return Promise[_0x5ffb('0x96')](_0x5c344d)[_0x5ffb('0x41')](function(){return _0x4c1a5f['addAgents'](_0x48d6d6,{'transaction':_0x482340})['spread'](function(_0x2b0351){return _0x2b0351;});});});}})[_0x5ffb('0x41')](respondWithResult(_0x4b1ef7,null))[_0x5ffb('0x45')](handleError(_0x4b1ef7,null));};exports['removeAgents']=function(_0x54f346,_0x157114){var _0x5f1735=_[_0x5ffb('0x82')](_0x54f346[_0x5ffb('0x32')][_0x5ffb('0x7f')])?_0x54f346[_0x5ffb('0x32')][_0x5ffb('0x7f')]:[_0x54f346[_0x5ffb('0x32')]['ids']];var _0x272fcb=_0x54f346[_0x5ffb('0x47')]['id'];return db[_0x5ffb('0x2d')][_0x5ffb('0x4a')]({'where':{'id':_0x272fcb}})[_0x5ffb('0x41')](handleEntityNotFound(_0x157114,null))[_0x5ffb('0x41')](function(_0x65c5d2){if(_0x65c5d2){var _0x378aeb=[_0x5ffb('0x83'),_0x5ffb('0x84'),_0x5ffb('0x97'),'Sms',_0x5ffb('0x86'),'Openchannel',_0x5ffb('0x88')];return db[_0x5ffb('0x56')][_0x5ffb('0x89')](function(_0x12dda6){var _0x13376a=_['map'](_0x378aeb,function(_0x4114bd){var _0x5d9caf={'attributes':['id',_0x5ffb('0x2a')]};return _0x65c5d2[_0x5ffb('0x4e')+_0x4114bd+_0x5ffb('0x7b')](_0x5d9caf)['then'](function(_0x17e2f3){var _0x139db2=_['map'](_0x17e2f3,function(_0x2eaf9d){return _0x2eaf9d[_0x5ffb('0x98')](_0x5f1735,{'transaction':_0x12dda6})[_0x5ffb('0x41')](function(){var _0x4278b7=_[_0x5ffb('0x2c')](_0x5f1735,function(_0x376131){socket['emit'](_0x5ffb('0x4d')+_0x4114bd+_0x5ffb('0x99'),{'UserId':Number(_0x376131),[_0x4114bd+_0x5ffb('0x8b')]:_0x2eaf9d['id']});if(_0x4114bd!==_0x5ffb('0x83')){return;}return db[_0x5ffb('0x92')][_0x5ffb('0x5f')]({'where':{'VoiceQueueId':_0x2eaf9d['id'],'UserId':_0x376131},'transaction':_0x12dda6});});return Promise['all'](_0x4278b7);});});return Promise['all'](_0x139db2);});});return Promise[_0x5ffb('0x96')](_0x13376a)[_0x5ffb('0x41')](function(){return _0x65c5d2[_0x5ffb('0x98')](_0x5f1735,{'transaction':_0x12dda6});})[_0x5ffb('0x41')](function(){return db[_0x5ffb('0x9a')][_0x5ffb('0x7d')]({'where':{'teamId':_0x272fcb}})[_0x5ffb('0x41')](function(_0x3d009c){if(_0x3d009c){var _0x2e7ab9=_[_0x5ffb('0x2c')](_0x5f1735,function(_0x536929){db['UserVoicePrefix'][_0x5ffb('0x5f')]({'where':{'UserId':_0x536929,'VoicePrefixId':_0x3d009c[_0x5ffb('0x71')]}});});return Promise[_0x5ffb('0x96')](_0x2e7ab9);}});});});}})[_0x5ffb('0x41')](respondWithStatusCode(_0x157114,null))[_0x5ffb('0x45')](handleError(_0x157114,null));};exports[_0x5ffb('0x9b')]=function(_0x4e3019,_0x170f31,_0x29e0e9){var _0x43e0eb={};var _0x546441={};var _0xa8b9f4;var _0x461634;return db['Team']['findOne']({'where':{'id':_0x4e3019['params']['id']}})[_0x5ffb('0x41')](handleEntityNotFound(_0x170f31,null))[_0x5ffb('0x41')](function(_0x278982){if(_0x278982){_0xa8b9f4=_0x278982;_0x546441[_0x5ffb('0x48')]=_['keys'](db[_0x5ffb('0x8c')][_0x5ffb('0x2e')]);_0x546441[_0x5ffb('0x32')]=_[_0x5ffb('0x33')](_0x4e3019[_0x5ffb('0x32')]);_0x546441[_0x5ffb('0x34')]=_[_0x5ffb('0x35')](_0x546441[_0x5ffb('0x48')],_0x546441[_0x5ffb('0x32')]);_0x43e0eb[_0x5ffb('0x36')]=_[_0x5ffb('0x35')](_0x546441[_0x5ffb('0x48')],qs[_0x5ffb('0x37')](_0x4e3019[_0x5ffb('0x32')][_0x5ffb('0x37')]));_0x43e0eb['attributes']=_0x43e0eb[_0x5ffb('0x36')][_0x5ffb('0x38')]?_0x43e0eb[_0x5ffb('0x36')]:_0x546441[_0x5ffb('0x48')];_0x43e0eb['order']=qs[_0x5ffb('0x79')](_0x4e3019[_0x5ffb('0x32')][_0x5ffb('0x79')]);_0x43e0eb[_0x5ffb('0x3c')]=qs[_0x5ffb('0x34')](_[_0x5ffb('0x7a')](_0x4e3019['query'],_0x546441['filters']));if(_0x4e3019['query'][_0x5ffb('0x3d')]){_0x43e0eb[_0x5ffb('0x3c')]=_['merge'](_0x43e0eb[_0x5ffb('0x3c')],{'$or':_[_0x5ffb('0x2c')](_0x43e0eb['attributes'],function(_0x2be429){var _0xff6617={};_0xff6617[_0x2be429]={'$like':'%'+_0x4e3019[_0x5ffb('0x32')][_0x5ffb('0x3d')]+'%'};return _0xff6617;})});}_0x43e0eb=_[_0x5ffb('0x3e')]({},_0x43e0eb,_0x4e3019[_0x5ffb('0x40')]);return _0xa8b9f4[_0x5ffb('0x9b')](_0x43e0eb);}})['then'](function(_0x50b750){if(_0x50b750){_0x461634=_0x50b750['length'];if(!_0x4e3019[_0x5ffb('0x32')]['hasOwnProperty'](_0x5ffb('0x3a'))){_0x43e0eb['limit']=qs[_0x5ffb('0x21')](_0x4e3019[_0x5ffb('0x32')]['limit']);_0x43e0eb['offset']=qs[_0x5ffb('0x1f')](_0x4e3019['query'][_0x5ffb('0x1f')]);}return _0xa8b9f4[_0x5ffb('0x9b')](_0x43e0eb);}})[_0x5ffb('0x41')](function(_0x3ecfaa){if(_0x3ecfaa){return _0x3ecfaa?{'count':_0x461634,'rows':_0x3ecfaa}:null;}})[_0x5ffb('0x41')](respondWithResult(_0x170f31,null))[_0x5ffb('0x45')](handleError(_0x170f31,null));}; \ No newline at end of file +var _0x2196=['sequelize','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','destroy','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','TeamVoicePrefix','UserVoicePrefix','send','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','add','ids','removeQueues','remove','Voice','Chat','Mail','Sms','Fax','Whatsapp','transaction','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','interface','upsert','isNil','format','SIP/%s','all','VoicePrefixId','addAgents','spread','removeAgents','isArray','UserVoiceQueueRt','getAgents','nolimit','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','Team','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','userProfileId','autoAssociation','UserProfileResource'];(function(_0x560166,_0x509bcd){var _0x3fad6d=function(_0x2c6343){while(--_0x2c6343){_0x560166['push'](_0x560166['shift']());}};_0x3fad6d(++_0x509bcd);}(_0x2196,0x177));var _0x6219=function(_0xde4b85,_0x10c94e){_0xde4b85=_0xde4b85-0x0;var _0xf25b34=_0x2196[_0xde4b85];return _0xf25b34;};'use strict';var emlformat=require(_0x6219('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6219('0x1'));var jsonpatch=require(_0x6219('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6219('0x3'));var Mustache=require(_0x6219('0x4'));var util=require(_0x6219('0x5'));var path=require('path');var sox=require(_0x6219('0x6'));var csv=require(_0x6219('0x7'));var ejs=require(_0x6219('0x8'));var fs=require('fs');var fs_extra=require(_0x6219('0x9'));var _=require(_0x6219('0xa'));var squel=require(_0x6219('0xb'));var crypto=require(_0x6219('0xc'));var jsforce=require(_0x6219('0xd'));var deskjs=require(_0x6219('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6219('0xf'));var Redis=require(_0x6219('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6219('0x11'));var as=require(_0x6219('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6219('0x13'))(_0x6219('0x14'));var utils=require(_0x6219('0x15'));var config=require(_0x6219('0x16'));var licenseUtil=require(_0x6219('0x17'));var db=require(_0x6219('0x18'))['db'];config['redis']=_[_0x6219('0x19')](config[_0x6219('0x1a')],{'host':_0x6219('0x1b'),'port':0x18eb});var socket=require(_0x6219('0x1c'))(new Redis(config[_0x6219('0x1a')]));require(_0x6219('0x1d'))[_0x6219('0x1e')](socket);function respondWithStatusCode(_0x53378c,_0x5a49e5){_0x5a49e5=_0x5a49e5||0xcc;return function(_0x4326d6){if(_0x4326d6){return _0x53378c[_0x6219('0x1f')](_0x5a49e5);}return _0x53378c[_0x6219('0x20')](_0x5a49e5)[_0x6219('0x21')]();};}function respondWithResult(_0x457d5,_0x2911b5){_0x2911b5=_0x2911b5||0xc8;return function(_0x2d5523){if(_0x2d5523){return _0x457d5['status'](_0x2911b5)[_0x6219('0x22')](_0x2d5523);}};}function respondWithFilteredResult(_0x1349fa,_0x1f77ac){return function(_0x1a6a6f){if(_0x1a6a6f){var _0x565f05=typeof _0x1f77ac[_0x6219('0x23')]==='undefined'&&typeof _0x1f77ac[_0x6219('0x24')]===_0x6219('0x25');var _0x4ba026=_0x1a6a6f[_0x6219('0x26')];var _0x5be973=_0x565f05?0x0:_0x1f77ac['offset'];var _0x44308b=_0x565f05?_0x1a6a6f[_0x6219('0x26')]:_0x1f77ac[_0x6219('0x23')]+_0x1f77ac[_0x6219('0x24')];var _0x31a05f;if(_0x44308b>=_0x4ba026){_0x44308b=_0x4ba026;_0x31a05f=0xc8;}else{_0x31a05f=0xce;}_0x1349fa[_0x6219('0x20')](_0x31a05f);return _0x1349fa[_0x6219('0x27')](_0x6219('0x28'),_0x5be973+'-'+_0x44308b+'/'+_0x4ba026)['json'](_0x1a6a6f);}return null;};}function patchUpdates(_0x4049e9){return function(_0x4807a1){try{jsonpatch[_0x6219('0x29')](_0x4807a1,_0x4049e9,!![]);}catch(_0xd69342){return BPromise['reject'](_0xd69342);}return _0x4807a1['save']();};}function saveUpdates(_0x1665ef,_0x552be4){return function(_0x75ddf8){if(_0x75ddf8){return _0x75ddf8[_0x6219('0x2a')](_0x1665ef)[_0x6219('0x2b')](function(_0x4ae346){return _0x4ae346;});}return null;};}function handleEntityNotFound(_0x27051a,_0x17eb6a){return function(_0x39f491){if(!_0x39f491){_0x27051a[_0x6219('0x1f')](0x194);}return _0x39f491;};}function handleError(_0xb26f0c,_0x421ef3){_0x421ef3=_0x421ef3||0x1f4;return function(_0x429722){logger[_0x6219('0x2c')](_0x429722[_0x6219('0x2d')]);if(_0x429722[_0x6219('0x2e')]){delete _0x429722[_0x6219('0x2e')];}_0xb26f0c['status'](_0x421ef3)['send'](_0x429722);};}exports['index']=function(_0x299daf,_0x1dd39b){var _0x33101d={},_0x1819c8={},_0x47e2c0={'count':0x0,'rows':[]};var _0x9fe17f=_['map'](db[_0x6219('0x2f')]['rawAttributes'],function(_0x2a4264){return{'name':_0x2a4264[_0x6219('0x30')],'type':_0x2a4264[_0x6219('0x31')]['key']};});_0x1819c8[_0x6219('0x32')]=_[_0x6219('0x33')](_0x9fe17f,_0x6219('0x2e'));_0x1819c8['query']=_['keys'](_0x299daf[_0x6219('0x34')]);_0x1819c8[_0x6219('0x35')]=_[_0x6219('0x36')](_0x1819c8[_0x6219('0x32')],_0x1819c8['query']);_0x33101d[_0x6219('0x37')]=_['intersection'](_0x1819c8[_0x6219('0x32')],qs[_0x6219('0x38')](_0x299daf[_0x6219('0x34')][_0x6219('0x38')]));_0x33101d['attributes']=_0x33101d[_0x6219('0x37')][_0x6219('0x39')]?_0x33101d[_0x6219('0x37')]:_0x1819c8[_0x6219('0x32')];if(!_0x299daf['query']['hasOwnProperty']('nolimit')){_0x33101d['limit']=qs[_0x6219('0x24')](_0x299daf['query'][_0x6219('0x24')]);_0x33101d[_0x6219('0x23')]=qs[_0x6219('0x23')](_0x299daf[_0x6219('0x34')][_0x6219('0x23')]);}_0x33101d[_0x6219('0x3a')]=qs[_0x6219('0x3b')](_0x299daf[_0x6219('0x34')][_0x6219('0x3b')]);_0x33101d[_0x6219('0x3c')]=qs[_0x6219('0x35')](_[_0x6219('0x3d')](_0x299daf[_0x6219('0x34')],_0x1819c8[_0x6219('0x35')]),_0x9fe17f);if(_0x299daf[_0x6219('0x34')][_0x6219('0x3e')]){_0x33101d[_0x6219('0x3c')]=_[_0x6219('0x3f')](_0x33101d[_0x6219('0x3c')],{'$or':_['map'](_0x9fe17f,function(_0x47b1fa){if(_0x47b1fa[_0x6219('0x31')]!==_0x6219('0x40')){var _0x322134={};_0x322134[_0x47b1fa[_0x6219('0x2e')]]={'$like':'%'+_0x299daf[_0x6219('0x34')][_0x6219('0x3e')]+'%'};return _0x322134;}})});}_0x33101d=_[_0x6219('0x3f')]({},_0x33101d,_0x299daf[_0x6219('0x41')]);var _0x53a9f4={'where':_0x33101d['where']};return db[_0x6219('0x2f')][_0x6219('0x26')](_0x53a9f4)['then'](function(_0x457607){_0x47e2c0[_0x6219('0x26')]=_0x457607;if(_0x299daf['query'][_0x6219('0x42')]){_0x33101d['include']=[{'all':!![]}];}return db[_0x6219('0x2f')][_0x6219('0x43')](_0x33101d);})[_0x6219('0x2b')](function(_0x1f00af){_0x47e2c0[_0x6219('0x44')]=_0x1f00af;return _0x47e2c0;})[_0x6219('0x2b')](respondWithFilteredResult(_0x1dd39b,_0x33101d))[_0x6219('0x45')](handleError(_0x1dd39b,null));};exports['show']=function(_0x5dffba,_0xf1b34a){var _0x3fa7de={'raw':![],'where':{'id':_0x5dffba[_0x6219('0x46')]['id']}},_0x412036={};_0x412036[_0x6219('0x32')]=_[_0x6219('0x47')](db[_0x6219('0x2f')][_0x6219('0x48')]);_0x412036[_0x6219('0x34')]=_[_0x6219('0x47')](_0x5dffba[_0x6219('0x34')]);_0x412036[_0x6219('0x35')]=_['intersection'](_0x412036[_0x6219('0x32')],_0x412036[_0x6219('0x34')]);_0x3fa7de['attributes']=_[_0x6219('0x36')](_0x412036[_0x6219('0x32')],qs[_0x6219('0x38')](_0x5dffba['query'][_0x6219('0x38')]));_0x3fa7de[_0x6219('0x37')]=_0x3fa7de[_0x6219('0x37')]['length']?_0x3fa7de[_0x6219('0x37')]:_0x412036[_0x6219('0x32')];if(_0x5dffba['query'][_0x6219('0x42')]){_0x3fa7de['include']=[{'all':!![]}];}_0x3fa7de=_[_0x6219('0x3f')]({},_0x3fa7de,_0x5dffba[_0x6219('0x41')]);return db[_0x6219('0x2f')][_0x6219('0x49')](_0x3fa7de)['then'](handleEntityNotFound(_0xf1b34a,null))[_0x6219('0x2b')](respondWithResult(_0xf1b34a,null))[_0x6219('0x45')](handleError(_0xf1b34a,null));};exports['create']=function(_0x586e15,_0x471b2e){return db[_0x6219('0x2f')][_0x6219('0x4a')](_0x586e15[_0x6219('0x4b')],{})[_0x6219('0x2b')](function(_0x175f64){var _0x6251e3=_0x586e15[_0x6219('0x4c')]['get']({'plain':!![]});if(!_0x6251e3)throw new Error(_0x6219('0x4d'));if(_0x6251e3[_0x6219('0x4e')]===_0x6219('0x4c')){var _0xf4fd05=_0x175f64[_0x6219('0x4f')]({'plain':!![]});var _0x4e18df=_0x6219('0x50');return db['UserProfileSection']['find']({'where':{'name':_0x4e18df,'userProfileId':_0x6251e3[_0x6219('0x51')]},'raw':!![]})[_0x6219('0x2b')](function(_0x454485){if(_0x454485&&_0x454485[_0x6219('0x52')]===0x0){return db[_0x6219('0x53')][_0x6219('0x4a')]({'name':_0xf4fd05[_0x6219('0x2e')],'resourceId':_0xf4fd05['id'],'type':_0x454485[_0x6219('0x2e')],'sectionId':_0x454485['id']},{})[_0x6219('0x2b')](function(){return _0x175f64;});}else{return _0x175f64;}})[_0x6219('0x45')](function(_0x1e5264){logger[_0x6219('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e5264);throw _0x1e5264;});}return _0x175f64;})[_0x6219('0x2b')](respondWithResult(_0x471b2e,0xc9))[_0x6219('0x45')](handleError(_0x471b2e,null));};exports[_0x6219('0x2a')]=function(_0x347309,_0x37d073){if(_0x347309[_0x6219('0x4b')]['id']){delete _0x347309[_0x6219('0x4b')]['id'];}return db[_0x6219('0x2f')]['find']({'where':{'id':_0x347309[_0x6219('0x46')]['id']}})[_0x6219('0x2b')](handleEntityNotFound(_0x37d073,null))['then'](saveUpdates(_0x347309[_0x6219('0x4b')],null))['then'](respondWithResult(_0x37d073,null))[_0x6219('0x45')](handleError(_0x37d073,null));};exports['destroy']=function(_0x7e7a0a,_0x4e5558){var _0x5631e4=_0x7e7a0a[_0x6219('0x46')]['id'];var _0x2a1b0f=[];return db[_0x6219('0x54')]['transaction'](function(_0x243a57){var _0x456b5f='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x5631e4;return db[_0x6219('0x54')][_0x6219('0x34')](_0x456b5f,{'type':db[_0x6219('0x55')]['QueryTypes'][_0x6219('0x56')],'raw':!![],'transaction':_0x243a57})[_0x6219('0x2b')](function(_0x3dafe8){_0x2a1b0f=_['map'](_0x3dafe8,function(_0x370287){return Number(_0x370287[_0x6219('0x57')]);});})[_0x6219('0x2b')](function(){var _0x219e85=_0x6219('0x58')+_0x5631e4;return db['sequelize'][_0x6219('0x34')](_0x219e85,{'type':db[_0x6219('0x55')][_0x6219('0x59')]['SELECT'],'raw':!![],'transaction':_0x243a57});})['then'](function(_0x2df06a){var _0x42703d=_[_0x6219('0x33')](_0x2df06a,function(_0x26ad6b){return Number(_0x26ad6b['VoiceQueueId']);});return db[_0x6219('0x5a')]['destroy']({'where':{'UserId':{'$in':_0x2a1b0f},'VoiceQueueId':{'$in':_0x42703d}},'transaction':_0x243a57});})[_0x6219('0x2b')](function(){var _0x15e675=_0x6219('0x5b')+_0x5631e4;return db[_0x6219('0x54')]['query'](_0x15e675,{'type':db[_0x6219('0x55')][_0x6219('0x59')]['SELECT'],'raw':!![],'transaction':_0x243a57});})['then'](function(_0x47e963){var _0x598fe8=_[_0x6219('0x33')](_0x47e963,function(_0x125805){return Number(_0x125805[_0x6219('0x5c')]);});return db[_0x6219('0x5d')][_0x6219('0x5e')]({'where':{'UserId':{'$in':_0x2a1b0f},'MailQueueId':{'$in':_0x598fe8}},'transaction':_0x243a57});})[_0x6219('0x2b')](function(){var _0x3a51de=_0x6219('0x5f')+_0x5631e4;return db[_0x6219('0x54')][_0x6219('0x34')](_0x3a51de,{'type':db[_0x6219('0x55')]['QueryTypes'][_0x6219('0x56')],'raw':!![],'transaction':_0x243a57});})['then'](function(_0xc6402f){var _0x5d99ae=_[_0x6219('0x33')](_0xc6402f,function(_0x216420){return Number(_0x216420[_0x6219('0x60')]);});return db[_0x6219('0x61')][_0x6219('0x5e')]({'where':{'UserId':{'$in':_0x2a1b0f},'SmsQueueId':{'$in':_0x5d99ae}},'transaction':_0x243a57});})[_0x6219('0x2b')](function(){var _0x31001d=_0x6219('0x62')+_0x5631e4;return db[_0x6219('0x54')][_0x6219('0x34')](_0x31001d,{'type':db[_0x6219('0x55')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x243a57});})[_0x6219('0x2b')](function(_0x15f864){var _0x4206e6=_[_0x6219('0x33')](_0x15f864,function(_0x3fa68e){return Number(_0x3fa68e[_0x6219('0x63')]);});return db['UserChatQueue'][_0x6219('0x5e')]({'where':{'UserId':{'$in':_0x2a1b0f},'ChatQueueId':{'$in':_0x4206e6}},'transaction':_0x243a57});})[_0x6219('0x2b')](function(){var _0x11193d=_0x6219('0x64')+_0x5631e4;return db[_0x6219('0x54')]['query'](_0x11193d,{'type':db[_0x6219('0x55')][_0x6219('0x59')][_0x6219('0x56')],'raw':!![],'transaction':_0x243a57});})[_0x6219('0x2b')](function(_0x2de3ba){var _0x529e9a=_[_0x6219('0x33')](_0x2de3ba,function(_0x18be74){return Number(_0x18be74[_0x6219('0x65')]);});return db[_0x6219('0x66')][_0x6219('0x5e')]({'where':{'UserId':{'$in':_0x2a1b0f},'FaxQueueId':{'$in':_0x529e9a}},'transaction':_0x243a57});})[_0x6219('0x2b')](function(){var _0x760c43='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5631e4;return db['sequelize'][_0x6219('0x34')](_0x760c43,{'type':db[_0x6219('0x55')]['QueryTypes'][_0x6219('0x56')],'raw':!![],'transaction':_0x243a57});})[_0x6219('0x2b')](function(_0x337e6a){var _0x18bdb6=_[_0x6219('0x33')](_0x337e6a,function(_0xa341e7){return Number(_0xa341e7[_0x6219('0x67')]);});return db[_0x6219('0x68')][_0x6219('0x5e')]({'where':{'UserId':{'$in':_0x2a1b0f},'OpenchannelQueueId':{'$in':_0x18bdb6}},'transaction':_0x243a57});})[_0x6219('0x2b')](function(){var _0xb334b=_0x6219('0x69')+_0x5631e4;return db['sequelize'][_0x6219('0x34')](_0xb334b,{'type':db[_0x6219('0x55')][_0x6219('0x59')][_0x6219('0x56')],'raw':!![],'transaction':_0x243a57});})['then'](function(_0x396a1e){var _0xc887de=_[_0x6219('0x33')](_0x396a1e,function(_0x2393c1){return Number(_0x2393c1['WhatsappQueueId']);});return db['UserWhatsappQueue']['destroy']({'where':{'UserId':{'$in':_0x2a1b0f},'WhatsappQueueId':{'$in':_0xc887de}},'transaction':_0x243a57});})['then'](function(){return db[_0x6219('0x6a')][_0x6219('0x49')]({'where':{'TeamId':_0x5631e4}});})[_0x6219('0x2b')](function(_0x337e43){if(_0x337e43===null){return;}return db[_0x6219('0x6b')][_0x6219('0x5e')]({'where':{'UserId':{'$in':_0x2a1b0f},'VoicePrefixId':_0x337e43['VoicePrefixId']},'transaction':_0x243a57});})['then'](function(){return db['Team'][_0x6219('0x5e')]({'where':{'id':_0x5631e4},'cascade':!![],'transaction':_0x243a57});})[_0x6219('0x2b')](function(_0xf97215){if(_0xf97215===0x0){_0x4e5558[_0x6219('0x1f')](0x194);}else{return db['UserProfileResource'][_0x6219('0x5e')]({'where':{'type':_0x6219('0x50'),'resourceId':_0x5631e4},'cascade':!![],'transaction':_0x243a57})['then'](function(){_0x4e5558['status'](0xcc)[_0x6219('0x21')]();});}})[_0x6219('0x45')](function(_0x219a80){_0x4e5558[_0x6219('0x20')](0x1f4)[_0x6219('0x6c')](_0x219a80);});});};exports['getQueues']=function(_0x52c89b,_0x245eb7,_0x1f572b){return db['Team'][_0x6219('0x6d')]({'where':{'id':_0x52c89b[_0x6219('0x46')]['id']}})[_0x6219('0x2b')](handleEntityNotFound(_0x245eb7,null))[_0x6219('0x2b')](function(_0x86e6e9){if(!_0x52c89b[_0x6219('0x34')]['channel']||!utils[_0x6219('0x6e')](_0x52c89b['query'][_0x6219('0x6f')])){throw new db[(_0x6219('0x55'))][(_0x6219('0x70'))](_0x6219('0x71'));}var _0x29d236={};var _0x3cebf0={};_0x3cebf0[_0x6219('0x32')]=_[_0x6219('0x47')](db[_[_0x6219('0x72')](_0x52c89b[_0x6219('0x34')][_0x6219('0x6f')][_0x6219('0x73')]())+_0x6219('0x74')]['rawAttributes']);_0x3cebf0['query']=_[_0x6219('0x47')](_0x52c89b['query']);_0x3cebf0[_0x6219('0x35')]=_[_0x6219('0x36')](_0x3cebf0[_0x6219('0x32')],_0x3cebf0[_0x6219('0x34')]);_0x29d236[_0x6219('0x37')]=_['intersection'](_0x3cebf0[_0x6219('0x32')],qs[_0x6219('0x38')](_0x52c89b[_0x6219('0x34')][_0x6219('0x38')]));_0x29d236[_0x6219('0x37')]=_0x29d236[_0x6219('0x37')][_0x6219('0x39')]?_0x29d236[_0x6219('0x37')]:_0x3cebf0['model'];_0x29d236['limit']=qs['limit'](_0x52c89b[_0x6219('0x34')][_0x6219('0x24')]);_0x29d236['offset']=qs['offset'](_0x52c89b['query'][_0x6219('0x23')]);_0x29d236[_0x6219('0x3a')]=qs['sort'](_0x52c89b[_0x6219('0x34')][_0x6219('0x3b')]);_0x29d236['where']=qs[_0x6219('0x35')](_[_0x6219('0x3d')](_0x52c89b[_0x6219('0x34')],_0x3cebf0['filters']));_0x29d236=_['merge']({},_0x29d236,_0x52c89b[_0x6219('0x41')]);return _0x86e6e9[_0x6219('0x4f')+_[_0x6219('0x72')](_0x52c89b['query']['channel']['toLowerCase']())+_0x6219('0x75')](_0x29d236);})[_0x6219('0x2b')](respondWithResult(_0x245eb7,null))['catch'](handleError(_0x245eb7,null));};exports['addQueues']=function(_0x48fdd5,_0x5ca815,_0x206fb8){return db[_0x6219('0x2f')][_0x6219('0x6d')]({'where':{'id':_0x48fdd5[_0x6219('0x46')]['id']}})['then'](function(_0x8ec4c0){if(_0x8ec4c0){if(!_0x48fdd5['body'][_0x6219('0x6f')]||!utils[_0x6219('0x6e')](_0x48fdd5[_0x6219('0x4b')][_0x6219('0x6f')])){throw new db[(_0x6219('0x55'))]['ValidationError']('Unknown\x20channel');}return _0x8ec4c0[_0x6219('0x76')+_[_0x6219('0x72')](_0x48fdd5[_0x6219('0x4b')][_0x6219('0x6f')][_0x6219('0x73')]())+_0x6219('0x75')](_0x48fdd5[_0x6219('0x4b')][_0x6219('0x77')]);}return null;})[_0x6219('0x2b')](handleEntityNotFound(_0x5ca815,null))[_0x6219('0x2b')](respondWithStatusCode(_0x5ca815,null))[_0x6219('0x45')](handleError(_0x5ca815,null));};exports[_0x6219('0x78')]=function(_0x33304a,_0x5e2bf1,_0x430817){return db['Team'][_0x6219('0x6d')]({'where':{'id':_0x33304a[_0x6219('0x46')]['id']}})[_0x6219('0x2b')](function(_0x1d3fc3){if(_0x1d3fc3){if(!_0x33304a[_0x6219('0x34')][_0x6219('0x6f')]||!utils[_0x6219('0x6e')](_0x33304a[_0x6219('0x34')][_0x6219('0x6f')])){throw new db[(_0x6219('0x55'))]['ValidationError'](_0x6219('0x71'));}return _0x1d3fc3[_0x6219('0x79')+_[_0x6219('0x72')](_0x33304a[_0x6219('0x34')]['channel'][_0x6219('0x73')]())+_0x6219('0x75')](_0x33304a[_0x6219('0x34')]['ids']);}return null;})[_0x6219('0x2b')](handleEntityNotFound(_0x5e2bf1,null))['then'](respondWithStatusCode(_0x5e2bf1,null))[_0x6219('0x45')](handleError(_0x5e2bf1,null));};exports['addAgents']=function(_0x4572d7,_0x7f63b4){var _0x137cd8=_['isArray'](_0x4572d7['body'][_0x6219('0x77')])?_0x4572d7['body']['ids']:[_0x4572d7[_0x6219('0x4b')][_0x6219('0x77')]];var _0x53a305=_0x4572d7[_0x6219('0x46')]['id'];return db[_0x6219('0x2f')][_0x6219('0x49')]({'where':{'id':_0x53a305}})[_0x6219('0x2b')](handleEntityNotFound(_0x7f63b4,null))[_0x6219('0x2b')](function(_0x3c7e75){if(_0x3c7e75){var _0x3a60f1=[_0x6219('0x7a'),_0x6219('0x7b'),_0x6219('0x7c'),_0x6219('0x7d'),_0x6219('0x7e'),'Openchannel',_0x6219('0x7f')];return db['sequelize'][_0x6219('0x80')](function(_0x1ff72c){var _0x2ce84a=_[_0x6219('0x33')](_0x3a60f1,function(_0x490798){var _0x4d7b4c={'attributes':['id','name']};if(_0x490798===_0x6219('0x7a')){_0x4d7b4c[_0x6219('0x81')]={'attributes':['penalty']};}return _0x3c7e75[_0x6219('0x4f')+_0x490798+_0x6219('0x75')](_0x4d7b4c)[_0x6219('0x2b')](function(_0x58518b){var _0x4e9480=_[_0x6219('0x33')](_0x58518b,function(_0x28382a){var _0x1e7ad5=_['map'](_0x137cd8,function(_0x2816e6){var _0x32e9e2={'where':{'UserId':_0x2816e6,[_0x490798+_0x6219('0x82')]:_0x28382a['id']},'transaction':_0x1ff72c};if(_0x490798===_0x6219('0x7a')){_0x32e9e2[_0x6219('0x19')]={'penalty':_0x28382a[_0x6219('0x83')][_0x6219('0x84')]};}return db[_0x6219('0x85')+_0x490798+_0x6219('0x74')][_0x6219('0x86')](_0x32e9e2)[_0x6219('0x2b')](function(){socket[_0x6219('0x87')]('user'+_0x490798+_0x6219('0x88'),{'UserId':_0x2816e6,[_0x490798+_0x6219('0x82')]:_0x28382a['id']});if(_0x490798!==_0x6219('0x7a')){return;}return db[_0x6219('0x85')][_0x6219('0x43')]({'where':{'id':_0x137cd8,'online':0x1},'attributes':['id',_0x6219('0x2e'),_0x6219('0x89'),_0x6219('0x8a'),_0x6219('0x8b')],'raw':!![]})[_0x6219('0x2b')](function(_0x2b6abd){var _0x311f4d=_[_0x6219('0x33')](_0x2b6abd,function(_0x2d4fe0){return db['UserVoiceQueueRt'][_0x6219('0x8c')]({'membername':_0x2d4fe0['name'],'UserId':_0x2d4fe0['id'],'queue_name':_0x28382a[_0x6219('0x2e')],'VoiceQueueId':_0x28382a['id'],'interface':_[_0x6219('0x8d')](_0x2d4fe0[_0x6219('0x8b')])?util[_0x6219('0x8e')](_0x6219('0x8f'),_0x2d4fe0['name']):_0x2d4fe0[_0x6219('0x8b')],'paused':_0x2d4fe0['voicePause']||![],'penalty':_0x28382a[_0x6219('0x83')][_0x6219('0x84')]},{'transaction':_0x1ff72c});});return Promise['all'](_0x311f4d);});});});return Promise['all'](_0x1e7ad5);});return Promise[_0x6219('0x90')](_0x4e9480);})[_0x6219('0x2b')](function(){return db[_0x6219('0x6a')][_0x6219('0x6d')]({'where':{'teamId':_0x53a305}})[_0x6219('0x2b')](function(_0x13c0af){if(_0x13c0af){var _0x5b9949=_[_0x6219('0x33')](_0x137cd8,function(_0x14bdbf){db['UserVoicePrefix'][_0x6219('0x8c')]({'UserId':_0x14bdbf,'VoicePrefixId':_0x13c0af[_0x6219('0x91')]});});return Promise['all'](_0x5b9949);}});});});return Promise[_0x6219('0x90')](_0x2ce84a)[_0x6219('0x2b')](function(){return _0x3c7e75[_0x6219('0x92')](_0x137cd8,{'transaction':_0x1ff72c})[_0x6219('0x93')](function(_0x5017a3){return _0x5017a3;});});});}})['then'](respondWithResult(_0x7f63b4,null))['catch'](handleError(_0x7f63b4,null));};exports[_0x6219('0x94')]=function(_0x47f728,_0x369351){var _0x53107d=_[_0x6219('0x95')](_0x47f728[_0x6219('0x34')]['ids'])?_0x47f728[_0x6219('0x34')][_0x6219('0x77')]:[_0x47f728['query'][_0x6219('0x77')]];var _0x264414=_0x47f728[_0x6219('0x46')]['id'];return db[_0x6219('0x2f')]['find']({'where':{'id':_0x264414}})[_0x6219('0x2b')](handleEntityNotFound(_0x369351,null))[_0x6219('0x2b')](function(_0x581311){if(_0x581311){var _0x3412e0=[_0x6219('0x7a'),_0x6219('0x7b'),_0x6219('0x7c'),_0x6219('0x7d'),_0x6219('0x7e'),'Openchannel',_0x6219('0x7f')];return db[_0x6219('0x54')][_0x6219('0x80')](function(_0x463dd2){var _0x5c0ec2=_[_0x6219('0x33')](_0x3412e0,function(_0x3ef410){var _0x5e4d77={'attributes':['id',_0x6219('0x2e')]};return _0x581311[_0x6219('0x4f')+_0x3ef410+'Queues'](_0x5e4d77)[_0x6219('0x2b')](function(_0x39ec47){var _0x5cd041=_[_0x6219('0x33')](_0x39ec47,function(_0x27a364){return _0x27a364[_0x6219('0x94')](_0x53107d,{'transaction':_0x463dd2})['then'](function(){var _0x3f7a66=_[_0x6219('0x33')](_0x53107d,function(_0x50184d){socket[_0x6219('0x87')](_0x6219('0x4c')+_0x3ef410+'Queue:remove',{'UserId':Number(_0x50184d),[_0x3ef410+'QueueId']:_0x27a364['id']});if(_0x3ef410!=='Voice'){return;}return db[_0x6219('0x96')]['destroy']({'where':{'VoiceQueueId':_0x27a364['id'],'UserId':_0x50184d},'transaction':_0x463dd2});});return Promise['all'](_0x3f7a66);});});return Promise['all'](_0x5cd041);});});return Promise['all'](_0x5c0ec2)[_0x6219('0x2b')](function(){return _0x581311['removeAgents'](_0x53107d,{'transaction':_0x463dd2});})[_0x6219('0x2b')](function(){return db[_0x6219('0x6a')][_0x6219('0x6d')]({'where':{'teamId':_0x264414}})[_0x6219('0x2b')](function(_0x353aba){if(_0x353aba){var _0x4b3ca8=_[_0x6219('0x33')](_0x53107d,function(_0x1ced7a){db[_0x6219('0x6b')][_0x6219('0x5e')]({'where':{'UserId':_0x1ced7a,'VoicePrefixId':_0x353aba[_0x6219('0x91')]}});});return Promise[_0x6219('0x90')](_0x4b3ca8);}});});});}})[_0x6219('0x2b')](respondWithStatusCode(_0x369351,null))[_0x6219('0x45')](handleError(_0x369351,null));};exports[_0x6219('0x97')]=function(_0x42e912,_0x14e08b,_0x19c467){var _0x585576={};var _0x1f8d6b={};var _0x3e7794;var _0x2a7530;return db[_0x6219('0x2f')][_0x6219('0x6d')]({'where':{'id':_0x42e912[_0x6219('0x46')]['id']}})['then'](handleEntityNotFound(_0x14e08b,null))[_0x6219('0x2b')](function(_0x5d0db2){if(_0x5d0db2){_0x3e7794=_0x5d0db2;_0x1f8d6b[_0x6219('0x32')]=_[_0x6219('0x47')](db['User'][_0x6219('0x48')]);_0x1f8d6b[_0x6219('0x34')]=_[_0x6219('0x47')](_0x42e912[_0x6219('0x34')]);_0x1f8d6b[_0x6219('0x35')]=_[_0x6219('0x36')](_0x1f8d6b['model'],_0x1f8d6b[_0x6219('0x34')]);_0x585576['attributes']=_[_0x6219('0x36')](_0x1f8d6b[_0x6219('0x32')],qs[_0x6219('0x38')](_0x42e912['query'][_0x6219('0x38')]));_0x585576[_0x6219('0x37')]=_0x585576['attributes'][_0x6219('0x39')]?_0x585576[_0x6219('0x37')]:_0x1f8d6b[_0x6219('0x32')];_0x585576['order']=qs[_0x6219('0x3b')](_0x42e912[_0x6219('0x34')][_0x6219('0x3b')]);_0x585576[_0x6219('0x3c')]=qs[_0x6219('0x35')](_[_0x6219('0x3d')](_0x42e912[_0x6219('0x34')],_0x1f8d6b['filters']));if(_0x42e912[_0x6219('0x34')][_0x6219('0x3e')]){_0x585576['where']=_['merge'](_0x585576['where'],{'$or':_[_0x6219('0x33')](_0x585576[_0x6219('0x37')],function(_0x55b403){var _0xac520={};_0xac520[_0x55b403]={'$like':'%'+_0x42e912[_0x6219('0x34')][_0x6219('0x3e')]+'%'};return _0xac520;})});}_0x585576=_[_0x6219('0x3f')]({},_0x585576,_0x42e912[_0x6219('0x41')]);return _0x3e7794[_0x6219('0x97')](_0x585576);}})[_0x6219('0x2b')](function(_0x6ac347){if(_0x6ac347){_0x2a7530=_0x6ac347[_0x6219('0x39')];if(!_0x42e912[_0x6219('0x34')]['hasOwnProperty'](_0x6219('0x98'))){_0x585576[_0x6219('0x24')]=qs['limit'](_0x42e912[_0x6219('0x34')][_0x6219('0x24')]);_0x585576[_0x6219('0x23')]=qs[_0x6219('0x23')](_0x42e912[_0x6219('0x34')][_0x6219('0x23')]);}return _0x3e7794[_0x6219('0x97')](_0x585576);}})[_0x6219('0x2b')](function(_0xa1bc52){if(_0xa1bc52){return _0xa1bc52?{'count':_0x2a7530,'rows':_0xa1bc52}:null;}})['then'](respondWithResult(_0x14e08b,null))[_0x6219('0x45')](handleError(_0x14e08b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 0b9bc82..8578e0e 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 _0x26a7=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','Team','setMaxListeners'];(function(_0x2bd635,_0x3a8ae8){var _0x3008fa=function(_0x186b35){while(--_0x186b35){_0x2bd635['push'](_0x2bd635['shift']());}};_0x3008fa(++_0x3a8ae8);}(_0x26a7,0x191));var _0x726a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x26a7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x726a('0x0'));var Team=require(_0x726a('0x1'))['db'][_0x726a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x726a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x726a('0x4'),'afterDestroy':_0x726a('0x5')};function emitEvent(_0x4922cb){return function(_0x2077a6,_0x344ceb,_0x41006b){TeamEvents['emit'](_0x4922cb+':'+_0x2077a6['id'],_0x2077a6);TeamEvents[_0x726a('0x6')](_0x4922cb,_0x2077a6);_0x41006b(null);};}for(var e in events){if(events[_0x726a('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x726a('0x8')]=TeamEvents; \ No newline at end of file +var _0xbb19=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update'];(function(_0x2ec65e,_0x19d9b8){var _0x3e4620=function(_0x1e817e){while(--_0x1e817e){_0x2ec65e['push'](_0x2ec65e['shift']());}};_0x3e4620(++_0x19d9b8);}(_0xbb19,0x1a3));var _0x9bb1=function(_0x10e888,_0x39a586){_0x10e888=_0x10e888-0x0;var _0x52c367=_0xbb19[_0x10e888];return _0x52c367;};'use strict';var EventEmitter=require(_0x9bb1('0x0'));var Team=require(_0x9bb1('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9bb1('0x2'),'afterUpdate':_0x9bb1('0x3'),'afterDestroy':_0x9bb1('0x4')};function emitEvent(_0x3814ea){return function(_0x170993,_0x284f15,_0x545828){TeamEvents['emit'](_0x3814ea+':'+_0x170993['id'],_0x170993);TeamEvents[_0x9bb1('0x5')](_0x3814ea,_0x170993);_0x545828(null);};}for(var e in events){if(events[_0x9bb1('0x6')](e)){var event=events[e];Team[_0x9bb1('0x7')](e,emitEvent(event));}}module[_0x9bb1('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index eabb00c..165d7a9 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 _0x5465=['setDataValue','channel','exports','define','Team','teams','Chat','Fax','Mail','Sms','Voice','Whatsapp','resolve','lodash','get','then','map'];(function(_0x7447fe,_0x108b42){var _0x289734=function(_0x321dc6){while(--_0x321dc6){_0x7447fe['push'](_0x7447fe['shift']());}};_0x289734(++_0x108b42);}(_0x5465,0x73));var _0x5546=function(_0x578300,_0x1f3103){_0x578300=_0x578300-0x0;var _0x1b2682=_0x5465[_0x578300];return _0x1b2682;};'use strict';var _=require(_0x5546('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x43e7f8,_0x1e7bbb){var _0x114dde=_0x5546('0x1')+_0x1e7bbb+'Queues';return _0x43e7f8[_0x114dde]()[_0x5546('0x2')](function(_0x258a4b){return _[_0x5546('0x3')](_0x258a4b,function(_0x1afb88){_0x1afb88[_0x5546('0x4')](_0x5546('0x5'),_0x1e7bbb);return _0x1afb88;});})['catch'](function(_0x40509e){throw _0x40509e;});}module[_0x5546('0x6')]=function(_0x49f345){return _0x49f345[_0x5546('0x7')](_0x5546('0x8'),attributes,{'tableName':_0x5546('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x54311c=this;var _0x1ccf2d=[_0x5546('0xa'),_0x5546('0xb'),_0x5546('0xc'),'Openchannel',_0x5546('0xd'),_0x5546('0xe'),_0x5546('0xf')];return Promise[_0x5546('0x10')]()[_0x5546('0x2')](function(){var _0x455ec3=_['map'](_0x1ccf2d,function(_0x1bf4fd){return getQueuesByChannel(_0x54311c,_0x1bf4fd);});return Promise['all'](_0x455ec3);})['catch'](function(_0x120a1f){throw _0x120a1f;});}}});}; \ No newline at end of file +var _0x007c=['setDataValue','channel','catch','exports','Team','Chat','Fax','Mail','Sms','Whatsapp','map','all','get','Queues','then'];(function(_0x3ca7a9,_0x4fc0c7){var _0x399428=function(_0x3f30b2){while(--_0x3f30b2){_0x3ca7a9['push'](_0x3ca7a9['shift']());}};_0x399428(++_0x4fc0c7);}(_0x007c,0x1bf));var _0xc007=function(_0x2be0ba,_0x32c3ec){_0x2be0ba=_0x2be0ba-0x0;var _0x49a175=_0x007c[_0x2be0ba];return _0x49a175;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0x3c158b,_0x3afb14){var _0x4f4c29=_0xc007('0x0')+_0x3afb14+_0xc007('0x1');return _0x3c158b[_0x4f4c29]()[_0xc007('0x2')](function(_0x1d65b8){return _['map'](_0x1d65b8,function(_0x9eaa73){_0x9eaa73[_0xc007('0x3')](_0xc007('0x4'),_0x3afb14);return _0x9eaa73;});})[_0xc007('0x5')](function(_0x103bcf){throw _0x103bcf;});}module[_0xc007('0x6')]=function(_0x2596b5){return _0x2596b5['define'](_0xc007('0x7'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x9604de=this;var _0xb149d8=[_0xc007('0x8'),_0xc007('0x9'),_0xc007('0xa'),'Openchannel',_0xc007('0xb'),'Voice',_0xc007('0xc')];return Promise['resolve']()[_0xc007('0x2')](function(){var _0x13ed85=_[_0xc007('0xd')](_0xb149d8,function(_0x4f28f3){return getQueuesByChannel(_0x9604de,_0x4f28f3);});return Promise[_0xc007('0xe')](_0x13ed85);})[_0xc007('0x5')](function(_0x3f3d72){throw _0x3f3d72;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 473590c..e779cd7 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 _0x82ad=['Team,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82ad,0x164));var _0xd82a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x82ad[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd82a('0x0'));var util=require('util');var moment=require(_0xd82a('0x1'));var BPromise=require(_0xd82a('0x2'));var rs=require(_0xd82a('0x3'));var fs=require('fs');var Redis=require(_0xd82a('0x4'));var db=require(_0xd82a('0x5'))['db'];var utils=require(_0xd82a('0x6'));var logger=require(_0xd82a('0x7'))('rpc');var config=require(_0xd82a('0x8'));var jayson=require(_0xd82a('0x9'));var client=jayson[_0xd82a('0xa')]['http']({'port':0x232a});config[_0xd82a('0xb')]=_[_0xd82a('0xc')](config[_0xd82a('0xb')],{'host':_0xd82a('0xd'),'port':0x18eb});var socket=require(_0xd82a('0xe'))(new Redis(config['redis']));require(_0xd82a('0xf'))[_0xd82a('0x10')](socket);function respondWithRpcPromise(_0x55d4a5,_0x92e71,_0x33bda8){return new BPromise(function(_0x9731d8,_0x37ab54){return client['request'](_0x55d4a5,_0x33bda8)['then'](function(_0x25355a){logger['info']('Team,\x20%s,\x20%s',_0x92e71,_0xd82a('0x11'));logger[_0xd82a('0x12')](_0xd82a('0x13'),_0x92e71,'request\x20sent',JSON['stringify'](_0x25355a));if(_0x25355a[_0xd82a('0x14')]){if(_0x25355a[_0xd82a('0x14')][_0xd82a('0x15')]===0x1f4){logger[_0xd82a('0x14')](_0xd82a('0x16'),_0x92e71,_0x25355a[_0xd82a('0x14')]['message']);return _0x37ab54(_0x25355a['error']['message']);}logger[_0xd82a('0x14')](_0xd82a('0x16'),_0x92e71,_0x25355a['error'][_0xd82a('0x17')]);return _0x9731d8(_0x25355a[_0xd82a('0x14')][_0xd82a('0x17')]);}else{logger[_0xd82a('0x18')]('Team,\x20%s,\x20%s',_0x92e71,_0xd82a('0x11'));_0x9731d8(_0x25355a[_0xd82a('0x19')][_0xd82a('0x17')]);}})[_0xd82a('0x1a')](function(_0x5c8cc9){logger[_0xd82a('0x14')]('Team,\x20%s,\x20%s',_0x92e71,_0x5c8cc9);_0x37ab54(_0x5c8cc9);});});} \ No newline at end of file +var _0x5770=['redis','localhost','socket.io-emitter','./team.socket','register','request','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x57aa39,_0x5b7dd9){var _0x1d9f2e=function(_0xda8d8a){while(--_0xda8d8a){_0x57aa39['push'](_0x57aa39['shift']());}};_0x1d9f2e(++_0x5b7dd9);}(_0x5770,0x15f));var _0x0577=function(_0x18fd0b,_0xe0f9ed){_0x18fd0b=_0x18fd0b-0x0;var _0x3b19a3=_0x5770[_0x18fd0b];return _0x3b19a3;};'use strict';var _=require(_0x0577('0x0'));var util=require(_0x0577('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0577('0x2'));var fs=require('fs');var Redis=require(_0x0577('0x3'));var db=require(_0x0577('0x4'))['db'];var utils=require(_0x0577('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0577('0x6'));var jayson=require(_0x0577('0x7'));var client=jayson[_0x0577('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x0577('0x9')],{'host':_0x0577('0xa'),'port':0x18eb});var socket=require(_0x0577('0xb'))(new Redis(config[_0x0577('0x9')]));require(_0x0577('0xc'))[_0x0577('0xd')](socket);function respondWithRpcPromise(_0x180da0,_0x295afb,_0x1f0201){return new BPromise(function(_0x2528bd,_0x21c0ce){return client[_0x0577('0xe')](_0x180da0,_0x1f0201)['then'](function(_0x541915){logger['info'](_0x0577('0xf'),_0x295afb,_0x0577('0x10'));logger[_0x0577('0x11')](_0x0577('0x12'),_0x295afb,_0x0577('0x10'),JSON['stringify'](_0x541915));if(_0x541915[_0x0577('0x13')]){if(_0x541915[_0x0577('0x13')]['code']===0x1f4){logger[_0x0577('0x13')]('Team,\x20%s,\x20%s',_0x295afb,_0x541915['error'][_0x0577('0x14')]);return _0x21c0ce(_0x541915['error'][_0x0577('0x14')]);}logger['error'](_0x0577('0xf'),_0x295afb,_0x541915[_0x0577('0x13')][_0x0577('0x14')]);return _0x2528bd(_0x541915[_0x0577('0x13')][_0x0577('0x14')]);}else{logger[_0x0577('0x15')](_0x0577('0xf'),_0x295afb,_0x0577('0x10'));_0x2528bd(_0x541915[_0x0577('0x16')][_0x0577('0x14')]);}})[_0x0577('0x17')](function(_0x3cb13d){logger[_0x0577('0x13')](_0x0577('0xf'),_0x295afb,_0x3cb13d);_0x21c0ce(_0x3cb13d);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 8cb9a5a..150335e 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 _0x9a67=['./team.events','save','remove','update','emit','removeListener','register','length','team:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9a67,0x117));var _0x79a6=function(_0x35467b,_0x36613c){_0x35467b=_0x35467b-0x0;var _0x2daf9f=_0x9a67[_0x35467b];return _0x2daf9f;};'use strict';var TeamEvents=require(_0x79a6('0x0'));var events=[_0x79a6('0x1'),_0x79a6('0x2'),_0x79a6('0x3')];function createListener(_0x426417,_0x3eb5cb){return function(_0x5c33ee){_0x3eb5cb[_0x79a6('0x4')](_0x426417,_0x5c33ee);};}function removeListener(_0x5777dd,_0x277b55){return function(){TeamEvents[_0x79a6('0x5')](_0x5777dd,_0x277b55);};}exports[_0x79a6('0x6')]=function(_0x2ad64e){for(var _0x38b7a6=0x0,_0x29ca9f=events[_0x79a6('0x7')];_0x38b7a6<_0x29ca9f;_0x38b7a6++){var _0x282473=events[_0x38b7a6];var _0x17af8b=createListener(_0x79a6('0x8')+_0x282473,_0x2ad64e);TeamEvents['on'](_0x282473,_0x17af8b);}}; \ No newline at end of file +var _0xe181=['./team.events','save','remove','update','emit','removeListener','register','length','team:'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xe181,0x17a));var _0x1e18=function(_0xf97eb0,_0x1578b7){_0xf97eb0=_0xf97eb0-0x0;var _0xea70f4=_0xe181[_0xf97eb0];return _0xea70f4;};'use strict';var TeamEvents=require(_0x1e18('0x0'));var events=[_0x1e18('0x1'),_0x1e18('0x2'),_0x1e18('0x3')];function createListener(_0x25dc7d,_0x839cff){return function(_0x9bd9e0){_0x839cff[_0x1e18('0x4')](_0x25dc7d,_0x9bd9e0);};}function removeListener(_0x277333,_0x4122ed){return function(){TeamEvents[_0x1e18('0x5')](_0x277333,_0x4122ed);};}exports[_0x1e18('0x6')]=function(_0x34f9c4){for(var _0x2bafc4=0x0,_0x57f607=events[_0x1e18('0x7')];_0x2bafc4<_0x57f607;_0x2bafc4++){var _0x1c5fe5=events[_0x2bafc4];var _0x5a6ebc=createListener(_0x1e18('0x8')+_0x1c5fe5,_0x34f9c4);TeamEvents['on'](_0x1c5fe5,_0x5a6ebc);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 369af1e..4049b6b 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 _0x8ff9=['exports','INTEGER','sequelize'];(function(_0x58803c,_0x4a34df){var _0xf95b9b=function(_0x597eb8){while(--_0x597eb8){_0x58803c['push'](_0x58803c['shift']());}};_0xf95b9b(++_0x4a34df);}(_0x8ff9,0x188));var _0x98ff=function(_0x3fb67c,_0x529baf){_0x3fb67c=_0x3fb67c-0x0;var _0x435ed4=_0x8ff9[_0x3fb67c];return _0x435ed4;};'use strict';var Sequelize=require(_0x98ff('0x0'));module[_0x98ff('0x1')]={'TeamId':{'type':Sequelize[_0x98ff('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xfac4=['INTEGER'];(function(_0x2861d0,_0x5a9d6a){var _0x3e987a=function(_0x4094a6){while(--_0x4094a6){_0x2861d0['push'](_0x2861d0['shift']());}};_0x3e987a(++_0x5a9d6a);}(_0xfac4,0xb1));var _0x4fac=function(_0x4eac0c,_0x422cdc){_0x4eac0c=_0x4eac0c-0x0;var _0x2ed205=_0xfac4[_0x4eac0c];return _0x2ed205;};'use strict';var Sequelize=require('sequelize');module['exports']={'TeamId':{'type':Sequelize[_0x4fac('0x0')]},'VoicePrefixId':{'type':Sequelize[_0x4fac('0x0')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 283d466..1c14e38 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 _0xc4e6=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x1a2581,_0x44dab6){var _0x21ef3e=function(_0x26839e){while(--_0x26839e){_0x1a2581['push'](_0x1a2581['shift']());}};_0x21ef3e(++_0x44dab6);}(_0xc4e6,0x1d9));var _0x6c4e=function(_0xb83ec2,_0x18e73b){_0xb83ec2=_0xb83ec2-0x0;var _0x4d2fbf=_0xc4e6[_0xb83ec2];return _0x4d2fbf;};'use strict';var _=require(_0x6c4e('0x0'));var util=require(_0x6c4e('0x1'));var logger=require('../../config/logger')(_0x6c4e('0x2'));var moment=require(_0x6c4e('0x3'));var BPromise=require(_0x6c4e('0x4'));var rp=require(_0x6c4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c4e('0x6'));var config=require(_0x6c4e('0x7'));var attributes=require(_0x6c4e('0x8'));module['exports']=function(_0x266061,_0x587927){return _0x266061['define'](_0x6c4e('0x9'),attributes,{'tableName':_0x6c4e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06ef=['path','rimraf','../../config/environment','exports','../../config/logger'];(function(_0x45dfc7,_0x32bfb8){var _0x27f020=function(_0x2d5480){while(--_0x2d5480){_0x45dfc7['push'](_0x45dfc7['shift']());}};_0x27f020(++_0x32bfb8);}(_0x06ef,0x185));var _0xf06e=function(_0x2af981,_0x59d094){_0x2af981=_0x2af981-0x0;var _0x5d30b9=_0x06ef[_0x2af981];return _0x5d30b9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf06e('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf06e('0x1'));var rimraf=require(_0xf06e('0x2'));var config=require(_0xf06e('0x3'));var attributes=require('./teamVoicePrefix.attributes');module[_0xf06e('0x4')]=function(_0x71a36,_0x4be428){return _0x71a36['define']('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 3a578ef..d83d34c 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x20bede,_0x571e5a){var _0x3e8140=function(_0x55bd76){while(--_0x55bd76){_0x20bede['push'](_0x20bede['shift']());}};_0x3e8140(++_0x571e5a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x48ba26,_0x122ff3){var _0x1cb457=function(_0x294316){while(--_0x294316){_0x48ba26['push'](_0x48ba26['shift']());}};_0x1cb457(++_0x122ff3);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index fc1cbbb..ece3677 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 _0xa7d0=['exports','INTEGER','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa7d0,0x68));var _0x0a7d=function(_0x29d728,_0x388df8){_0x29d728=_0x29d728-0x0;var _0x97326b=_0xa7d0[_0x29d728];return _0x97326b;};'use strict';var Sequelize=require(_0x0a7d('0x0'));module[_0x0a7d('0x1')]={'penalty':{'type':Sequelize[_0x0a7d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4bb6=['sequelize','exports'];(function(_0x555755,_0x37ac4a){var _0x342ab4=function(_0x2cb6d3){while(--_0x2cb6d3){_0x555755['push'](_0x555755['shift']());}};_0x342ab4(++_0x37ac4a);}(_0x4bb6,0x1f4));var _0x64bb=function(_0x5aa9bf,_0x343e9f){_0x5aa9bf=_0x5aa9bf-0x0;var _0x1feeb0=_0x4bb6[_0x5aa9bf];return _0x1feeb0;};'use strict';var Sequelize=require(_0x64bb('0x0'));module[_0x64bb('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index a9b85fb..dd26863 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 _0x1cc7=['rimraf','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','request-promise','path'];(function(_0x15bc35,_0x4f4631){var _0x3973cb=function(_0xcf27a8){while(--_0xcf27a8){_0x15bc35['push'](_0x15bc35['shift']());}};_0x3973cb(++_0x4f4631);}(_0x1cc7,0x15a));var _0x71cc=function(_0x5ac69f,_0xf73ffe){_0x5ac69f=_0x5ac69f-0x0;var _0x240d10=_0x1cc7[_0x5ac69f];return _0x240d10;};'use strict';var _=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var logger=require(_0x71cc('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x71cc('0x3'));var fs=require('fs');var path=require(_0x71cc('0x4'));var rimraf=require(_0x71cc('0x5'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x27a175,_0x4ecf81){return _0x27a175[_0x71cc('0x6')](_0x71cc('0x7'),attributes,{'tableName':_0x71cc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x534d=['team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x534d,0x79));var _0xd534=function(_0x57dc45,_0x1eca2a){_0x57dc45=_0x57dc45-0x0;var _0x333680=_0x534d[_0x57dc45];return _0x333680;};'use strict';var _=require(_0xd534('0x0'));var util=require(_0xd534('0x1'));var logger=require(_0xd534('0x2'))(_0xd534('0x3'));var moment=require(_0xd534('0x4'));var BPromise=require(_0xd534('0x5'));var rp=require(_0xd534('0x6'));var fs=require('fs');var path=require(_0xd534('0x7'));var rimraf=require(_0xd534('0x8'));var config=require(_0xd534('0x9'));var attributes=require(_0xd534('0xa'));module[_0xd534('0xb')]=function(_0x2e9c44,_0x2ebe36){return _0x2e9c44[_0xd534('0xc')](_0xd534('0xd'),attributes,{'tableName':_0xd534('0xe'),'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 5533528..caaa6de 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 _0x8ca7=['rpc','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0x8ca7,0x9b));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x78ca('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x78ca('0x1'));var fs=require('fs');var Redis=require(_0x78ca('0x2'));var db=require(_0x78ca('0x3'))['db'];var utils=require(_0x78ca('0x4'));var logger=require(_0x78ca('0x5'))(_0x78ca('0x6'));var config=require('../../config/environment');var jayson=require(_0x78ca('0x7'));var client=jayson[_0x78ca('0x8')][_0x78ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46d126,_0x2d36ca,_0x11440e){return new BPromise(function(_0x1972a7,_0x101302){return client[_0x78ca('0xa')](_0x46d126,_0x11440e)[_0x78ca('0xb')](function(_0x7e4f57){logger[_0x78ca('0xc')](_0x78ca('0xd'),_0x2d36ca,_0x78ca('0xe'));logger[_0x78ca('0xf')](_0x78ca('0x10'),_0x2d36ca,_0x78ca('0xe'),JSON[_0x78ca('0x11')](_0x7e4f57));if(_0x7e4f57['error']){if(_0x7e4f57['error'][_0x78ca('0x12')]===0x1f4){logger[_0x78ca('0x13')](_0x78ca('0xd'),_0x2d36ca,_0x7e4f57[_0x78ca('0x13')][_0x78ca('0x14')]);return _0x101302(_0x7e4f57[_0x78ca('0x13')][_0x78ca('0x14')]);}logger[_0x78ca('0x13')](_0x78ca('0xd'),_0x2d36ca,_0x7e4f57[_0x78ca('0x13')][_0x78ca('0x14')]);return _0x1972a7(_0x7e4f57['error']['message']);}else{logger[_0x78ca('0xc')](_0x78ca('0xd'),_0x2d36ca,_0x78ca('0xe'));_0x1972a7(_0x7e4f57[_0x78ca('0x15')][_0x78ca('0x14')]);}})[_0x78ca('0x16')](function(_0x52bea9){logger[_0x78ca('0x13')](_0x78ca('0xd'),_0x2d36ca,_0x52bea9);_0x101302(_0x52bea9);});});} \ No newline at end of file +var _0xf4e5=['../../config/environment','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x1604b0,_0x48d196){var _0xf7ee7e=function(_0x368052){while(--_0x368052){_0x1604b0['push'](_0x1604b0['shift']());}};_0xf7ee7e(++_0x48d196);}(_0xf4e5,0xd4));var _0x5f4e=function(_0x117805,_0x5238e8){_0x117805=_0x117805-0x0;var _0x666b7=_0xf4e5[_0x117805];return _0x666b7;};'use strict';var _=require(_0x5f4e('0x0'));var util=require(_0x5f4e('0x1'));var moment=require(_0x5f4e('0x2'));var BPromise=require(_0x5f4e('0x3'));var rs=require(_0x5f4e('0x4'));var fs=require('fs');var Redis=require(_0x5f4e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5f4e('0x6'))(_0x5f4e('0x7'));var config=require(_0x5f4e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5f4e('0x9')][_0x5f4e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3307df,_0xbb7fcc,_0x29199a){return new BPromise(function(_0x223ef1,_0x627bd9){return client[_0x5f4e('0xb')](_0x3307df,_0x29199a)[_0x5f4e('0xc')](function(_0x50767b){logger['info'](_0x5f4e('0xd'),_0xbb7fcc,_0x5f4e('0xe'));logger[_0x5f4e('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0xbb7fcc,_0x5f4e('0xe'),JSON[_0x5f4e('0x10')](_0x50767b));if(_0x50767b[_0x5f4e('0x11')]){if(_0x50767b[_0x5f4e('0x11')][_0x5f4e('0x12')]===0x1f4){logger[_0x5f4e('0x11')](_0x5f4e('0xd'),_0xbb7fcc,_0x50767b[_0x5f4e('0x11')][_0x5f4e('0x13')]);return _0x627bd9(_0x50767b[_0x5f4e('0x11')][_0x5f4e('0x13')]);}logger['error'](_0x5f4e('0xd'),_0xbb7fcc,_0x50767b[_0x5f4e('0x11')]['message']);return _0x223ef1(_0x50767b[_0x5f4e('0x11')][_0x5f4e('0x13')]);}else{logger[_0x5f4e('0x14')]('TeamVoiceQueue,\x20%s,\x20%s',_0xbb7fcc,_0x5f4e('0xe'));_0x223ef1(_0x50767b[_0x5f4e('0x15')][_0x5f4e('0x13')]);}})['catch'](function(_0x1e62e5){logger[_0x5f4e('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0xbb7fcc,_0x1e62e5);_0x627bd9(_0x1e62e5);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index ecea668..676b198 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 _0xd2f5=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x4b2e12,_0x4d6a24){var _0x473d85=function(_0x2d0e30){while(--_0x2d0e30){_0x4b2e12['push'](_0x4b2e12['shift']());}};_0x473d85(++_0x4d6a24);}(_0xd2f5,0x12e));var _0x5d2f=function(_0x1dfea6,_0x4a041f){_0x1dfea6=_0x1dfea6-0x0;var _0x2570c6=_0xd2f5[_0x1dfea6];return _0x2570c6;};'use strict';var multer=require(_0x5d2f('0x0'));var util=require(_0x5d2f('0x1'));var path=require(_0x5d2f('0x2'));var timeout=require(_0x5d2f('0x3'));var express=require('express');var router=express[_0x5d2f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5d2f('0x5'));var config=require(_0x5d2f('0x6'));var controller=require(_0x5d2f('0x7'));router['get']('/',auth[_0x5d2f('0x8')](),controller[_0x5d2f('0x9')]);router[_0x5d2f('0xa')]('/:id',auth[_0x5d2f('0x8')](),controller[_0x5d2f('0xb')]);router[_0x5d2f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5d2f('0xd')](_0x5d2f('0xe'),auth['isAuthenticated'](),controller[_0x5d2f('0xf')]);router[_0x5d2f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5d2f('0x11')]);module[_0x5d2f('0x12')]=router; \ No newline at end of file +var _0x5c3c=['post','create','put','update','/:id','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','show'];(function(_0x348e46,_0x5187dc){var _0x58b74f=function(_0x5e2f00){while(--_0x5e2f00){_0x348e46['push'](_0x348e46['shift']());}};_0x58b74f(++_0x5187dc);}(_0x5c3c,0x132));var _0xc5c3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5c3c[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var path=require(_0xc5c3('0x2'));var timeout=require(_0xc5c3('0x3'));var express=require('express');var router=express[_0xc5c3('0x4')]();var fs_extra=require(_0xc5c3('0x5'));var auth=require(_0xc5c3('0x6'));var interaction=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var controller=require(_0xc5c3('0x9'));router[_0xc5c3('0xa')]('/',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc5c3('0xd')]);router[_0xc5c3('0xe')]('/',auth['isAuthenticated'](),controller[_0xc5c3('0xf')]);router[_0xc5c3('0x10')]('/:id',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x11')]);router['delete'](_0xc5c3('0x12'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x13')]);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 2ddd420..d486c97 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 _0xa79d=['sequelize','exports','STRING','TEXT'];(function(_0xd04dbd,_0x3d8cbd){var _0x144995=function(_0x4aff7f){while(--_0x4aff7f){_0xd04dbd['push'](_0xd04dbd['shift']());}};_0x144995(++_0x3d8cbd);}(_0xa79d,0x120));var _0xda79=function(_0x1cacdc,_0x44cb57){_0x1cacdc=_0x1cacdc-0x0;var _0x2cb433=_0xa79d[_0x1cacdc];return _0x2cb433;};'use strict';var Sequelize=require(_0xda79('0x0'));module[_0xda79('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xda79('0x2')]},'html':{'type':Sequelize[_0xda79('0x3')]}}; \ No newline at end of file +var _0x1b82=['sequelize','STRING','TEXT'];(function(_0x5d1631,_0x46e357){var _0x2c9872=function(_0x4530a1){while(--_0x4530a1){_0x5d1631['push'](_0x5d1631['shift']());}};_0x2c9872(++_0x46e357);}(_0x1b82,0x156));var _0x21b8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1b82[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x21b8('0x0'));module['exports']={'name':{'type':Sequelize[_0x21b8('0x1')]},'description':{'type':Sequelize[_0x21b8('0x1')]},'html':{'type':Sequelize[_0x21b8('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index b1d1a9b..009e8a9 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 _0xb8db=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','Templates','stack','name','send','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','fields','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir'];(function(_0x2024ab,_0xd9e809){var _0x26e1e1=function(_0x263ea0){while(--_0x263ea0){_0x2024ab['push'](_0x2024ab['shift']());}};_0x26e1e1(++_0xd9e809);}(_0xb8db,0xa3));var _0xbb8d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb8db[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xbb8d('0x0'));var rimraf=require(_0xbb8d('0x1'));var zipdir=require(_0xbb8d('0x2'));var jsonpatch=require(_0xbb8d('0x3'));var rp=require(_0xbb8d('0x4'));var moment=require(_0xbb8d('0x5'));var BPromise=require(_0xbb8d('0x6'));var Mustache=require(_0xbb8d('0x7'));var util=require(_0xbb8d('0x8'));var path=require(_0xbb8d('0x9'));var sox=require('sox');var csv=require(_0xbb8d('0xa'));var ejs=require(_0xbb8d('0xb'));var fs=require('fs');var fs_extra=require(_0xbb8d('0xc'));var _=require('lodash');var squel=require(_0xbb8d('0xd'));var crypto=require(_0xbb8d('0xe'));var jsforce=require(_0xbb8d('0xf'));var deskjs=require(_0xbb8d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbb8d('0x11'));var Papa=require('papaparse');var Redis=require(_0xbb8d('0x12'));var authService=require(_0xbb8d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xbb8d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb8d('0x15'))('api');var utils=require(_0xbb8d('0x16'));var config=require(_0xbb8d('0x17'));var licenseUtil=require(_0xbb8d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcb7cd4,_0x5104da){_0x5104da=_0x5104da||0xcc;return function(_0x20b69a){if(_0x20b69a){return _0xcb7cd4[_0xbb8d('0x19')](_0x5104da);}return _0xcb7cd4['status'](_0x5104da)[_0xbb8d('0x1a')]();};}function respondWithResult(_0x263f9e,_0x295dec){_0x295dec=_0x295dec||0xc8;return function(_0xc04c5a){if(_0xc04c5a){return _0x263f9e[_0xbb8d('0x1b')](_0x295dec)[_0xbb8d('0x1c')](_0xc04c5a);}};}function respondWithFilteredResult(_0x23b19a,_0x453734){return function(_0x1b7562){if(_0x1b7562){var _0x4e33b6=typeof _0x453734[_0xbb8d('0x1d')]===_0xbb8d('0x1e')&&typeof _0x453734[_0xbb8d('0x1f')]==='undefined';var _0x380dd0=_0x1b7562[_0xbb8d('0x20')];var _0x116b7b=_0x4e33b6?0x0:_0x453734[_0xbb8d('0x1d')];var _0x501d0a=_0x4e33b6?_0x1b7562[_0xbb8d('0x20')]:_0x453734[_0xbb8d('0x1d')]+_0x453734[_0xbb8d('0x1f')];var _0x41690e;if(_0x501d0a>=_0x380dd0){_0x501d0a=_0x380dd0;_0x41690e=0xc8;}else{_0x41690e=0xce;}_0x23b19a['status'](_0x41690e);return _0x23b19a[_0xbb8d('0x21')](_0xbb8d('0x22'),_0x116b7b+'-'+_0x501d0a+'/'+_0x380dd0)[_0xbb8d('0x1c')](_0x1b7562);}return null;};}function patchUpdates(_0x4d2f71){return function(_0x2a6dfe){try{jsonpatch['apply'](_0x2a6dfe,_0x4d2f71,!![]);}catch(_0xfd3ffe){return BPromise['reject'](_0xfd3ffe);}return _0x2a6dfe[_0xbb8d('0x23')]();};}function saveUpdates(_0x425fa9,_0x18da33){return function(_0x368bfe){if(_0x368bfe){return _0x368bfe[_0xbb8d('0x24')](_0x425fa9)[_0xbb8d('0x25')](function(_0x6c186f){return _0x6c186f;});}return null;};}function removeEntity(_0x5ba0b0,_0x358bce){return function(_0x339beb){if(_0x339beb){return _0x339beb[_0xbb8d('0x26')]()[_0xbb8d('0x25')](function(){var _0x37178f=_0x339beb['get']({'plain':!![]});var _0x369bcc=_0xbb8d('0x27');return db['UserProfileResource'][_0xbb8d('0x26')]({'where':{'type':_0x369bcc,'resourceId':_0x37178f['id']}})[_0xbb8d('0x25')](function(){return _0x339beb;});})[_0xbb8d('0x25')](function(){_0x5ba0b0['status'](0xcc)[_0xbb8d('0x1a')]();});}};}function handleEntityNotFound(_0x5344e8,_0x4e1c41){return function(_0x2e6a97){if(!_0x2e6a97){_0x5344e8[_0xbb8d('0x19')](0x194);}return _0x2e6a97;};}function handleError(_0x30b874,_0x56beb1){_0x56beb1=_0x56beb1||0x1f4;return function(_0x577613){logger['error'](_0x577613[_0xbb8d('0x28')]);if(_0x577613[_0xbb8d('0x29')]){delete _0x577613[_0xbb8d('0x29')];}_0x30b874[_0xbb8d('0x1b')](_0x56beb1)[_0xbb8d('0x2a')](_0x577613);};}exports['index']=function(_0x1b6345,_0x5d8e90){var _0xcba6e1={},_0x5c2549={},_0x32e28b={'count':0x0,'rows':[]};var _0x4b43d6=_[_0xbb8d('0x2b')](db[_0xbb8d('0x2c')][_0xbb8d('0x2d')],function(_0x4fd2dc){return{'name':_0x4fd2dc[_0xbb8d('0x2e')],'type':_0x4fd2dc[_0xbb8d('0x2f')][_0xbb8d('0x30')]};});_0x5c2549[_0xbb8d('0x31')]=_[_0xbb8d('0x2b')](_0x4b43d6,_0xbb8d('0x29'));_0x5c2549[_0xbb8d('0x32')]=_[_0xbb8d('0x33')](_0x1b6345[_0xbb8d('0x32')]);_0x5c2549[_0xbb8d('0x34')]=_[_0xbb8d('0x35')](_0x5c2549['model'],_0x5c2549[_0xbb8d('0x32')]);_0xcba6e1[_0xbb8d('0x36')]=_[_0xbb8d('0x35')](_0x5c2549[_0xbb8d('0x31')],qs['fields'](_0x1b6345['query']['fields']));_0xcba6e1[_0xbb8d('0x36')]=_0xcba6e1[_0xbb8d('0x36')]['length']?_0xcba6e1[_0xbb8d('0x36')]:_0x5c2549[_0xbb8d('0x31')];if(!_0x1b6345[_0xbb8d('0x32')][_0xbb8d('0x37')](_0xbb8d('0x38'))){_0xcba6e1[_0xbb8d('0x1f')]=qs[_0xbb8d('0x1f')](_0x1b6345[_0xbb8d('0x32')][_0xbb8d('0x1f')]);_0xcba6e1[_0xbb8d('0x1d')]=qs['offset'](_0x1b6345[_0xbb8d('0x32')][_0xbb8d('0x1d')]);}_0xcba6e1[_0xbb8d('0x39')]=qs[_0xbb8d('0x3a')](_0x1b6345[_0xbb8d('0x32')][_0xbb8d('0x3a')]);_0xcba6e1[_0xbb8d('0x3b')]=qs[_0xbb8d('0x34')](_[_0xbb8d('0x3c')](_0x1b6345['query'],_0x5c2549[_0xbb8d('0x34')]),_0x4b43d6);if(_0x1b6345['query'][_0xbb8d('0x3d')]){_0xcba6e1[_0xbb8d('0x3b')]=_[_0xbb8d('0x3e')](_0xcba6e1[_0xbb8d('0x3b')],{'$or':_[_0xbb8d('0x2b')](_0x4b43d6,function(_0x5e9147){if(_0x5e9147[_0xbb8d('0x2f')]!==_0xbb8d('0x3f')){var _0x4f6e5a={};_0x4f6e5a[_0x5e9147[_0xbb8d('0x29')]]={'$like':'%'+_0x1b6345[_0xbb8d('0x32')][_0xbb8d('0x3d')]+'%'};return _0x4f6e5a;}})});}_0xcba6e1=_[_0xbb8d('0x3e')]({},_0xcba6e1,_0x1b6345[_0xbb8d('0x40')]);var _0x114755={'where':_0xcba6e1[_0xbb8d('0x3b')]};return db[_0xbb8d('0x2c')][_0xbb8d('0x20')](_0x114755)[_0xbb8d('0x25')](function(_0x867731){_0x32e28b[_0xbb8d('0x20')]=_0x867731;if(_0x1b6345[_0xbb8d('0x32')][_0xbb8d('0x41')]){_0xcba6e1['include']=[{'all':!![]}];}return db[_0xbb8d('0x2c')][_0xbb8d('0x42')](_0xcba6e1);})[_0xbb8d('0x25')](function(_0x3a3f1b){_0x32e28b['rows']=_0x3a3f1b;return _0x32e28b;})[_0xbb8d('0x25')](respondWithFilteredResult(_0x5d8e90,_0xcba6e1))[_0xbb8d('0x43')](handleError(_0x5d8e90,null));};exports[_0xbb8d('0x44')]=function(_0x30695b,_0x13cd07){var _0x54b8a9={'raw':!![],'where':{'id':_0x30695b[_0xbb8d('0x45')]['id']}},_0x4c09b1={};_0x4c09b1['model']=_[_0xbb8d('0x33')](db[_0xbb8d('0x2c')]['rawAttributes']);_0x4c09b1[_0xbb8d('0x32')]=_[_0xbb8d('0x33')](_0x30695b[_0xbb8d('0x32')]);_0x4c09b1[_0xbb8d('0x34')]=_[_0xbb8d('0x35')](_0x4c09b1['model'],_0x4c09b1[_0xbb8d('0x32')]);_0x54b8a9[_0xbb8d('0x36')]=_['intersection'](_0x4c09b1[_0xbb8d('0x31')],qs[_0xbb8d('0x46')](_0x30695b['query'][_0xbb8d('0x46')]));_0x54b8a9[_0xbb8d('0x36')]=_0x54b8a9['attributes'][_0xbb8d('0x47')]?_0x54b8a9['attributes']:_0x4c09b1[_0xbb8d('0x31')];if(_0x30695b['query'][_0xbb8d('0x41')]){_0x54b8a9[_0xbb8d('0x48')]=[{'all':!![]}];}_0x54b8a9=_[_0xbb8d('0x3e')]({},_0x54b8a9,_0x30695b[_0xbb8d('0x40')]);return db[_0xbb8d('0x2c')][_0xbb8d('0x49')](_0x54b8a9)['then'](handleEntityNotFound(_0x13cd07,null))[_0xbb8d('0x25')](respondWithResult(_0x13cd07,null))[_0xbb8d('0x43')](handleError(_0x13cd07,null));};exports[_0xbb8d('0x4a')]=function(_0x74dd9b,_0x47dad1){return db[_0xbb8d('0x2c')][_0xbb8d('0x4a')](_0x74dd9b[_0xbb8d('0x4b')],{})[_0xbb8d('0x25')](function(_0x3723c4){var _0x235b52=_0x74dd9b[_0xbb8d('0x4c')][_0xbb8d('0x4d')]({'plain':!![]});if(!_0x235b52)throw new Error(_0xbb8d('0x4e'));if(_0x235b52['role']===_0xbb8d('0x4c')){var _0x43540c=_0x3723c4[_0xbb8d('0x4d')]({'plain':!![]});var _0x3d2440=_0xbb8d('0x27');return db['UserProfileSection'][_0xbb8d('0x49')]({'where':{'name':_0x3d2440,'userProfileId':_0x235b52[_0xbb8d('0x4f')]},'raw':!![]})[_0xbb8d('0x25')](function(_0x3d1638){if(_0x3d1638&&_0x3d1638[_0xbb8d('0x50')]===0x0){return db[_0xbb8d('0x51')][_0xbb8d('0x4a')]({'name':_0x43540c[_0xbb8d('0x29')],'resourceId':_0x43540c['id'],'type':_0x3d1638['name'],'sectionId':_0x3d1638['id']},{})[_0xbb8d('0x25')](function(){return _0x3723c4;});}else{return _0x3723c4;}})['catch'](function(_0x689fe6){logger['error'](_0xbb8d('0x52'),_0x689fe6);throw _0x689fe6;});}return _0x3723c4;})[_0xbb8d('0x25')](respondWithResult(_0x47dad1,0xc9))['catch'](handleError(_0x47dad1,null));};exports[_0xbb8d('0x24')]=function(_0x2e40d8,_0x706feb){if(_0x2e40d8[_0xbb8d('0x4b')]['id']){delete _0x2e40d8[_0xbb8d('0x4b')]['id'];}return db[_0xbb8d('0x2c')][_0xbb8d('0x49')]({'where':{'id':_0x2e40d8['params']['id']}})[_0xbb8d('0x25')](handleEntityNotFound(_0x706feb,null))[_0xbb8d('0x25')](saveUpdates(_0x2e40d8['body'],null))[_0xbb8d('0x25')](respondWithResult(_0x706feb,null))[_0xbb8d('0x43')](handleError(_0x706feb,null));};exports[_0xbb8d('0x26')]=function(_0x5e04f9,_0x10fa08){return db['Template'][_0xbb8d('0x49')]({'where':{'id':_0x5e04f9['params']['id']}})[_0xbb8d('0x25')](handleEntityNotFound(_0x10fa08,null))[_0xbb8d('0x25')](removeEntity(_0x10fa08,null))[_0xbb8d('0x43')](handleError(_0x10fa08,null));}; \ No newline at end of file +var _0x39aa=['model','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','Template','findAll','rows','catch','show','params','include','merge','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','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','map','rawAttributes','key','keys','query','filters','intersection'];(function(_0xea8509,_0x512cbc){var _0x39e573=function(_0x4fa97f){while(--_0x4fa97f){_0xea8509['push'](_0xea8509['shift']());}};_0x39e573(++_0x512cbc);}(_0x39aa,0x11b));var _0xa39a=function(_0x1aa6c4,_0x1ecfc7){_0x1aa6c4=_0x1aa6c4-0x0;var _0x3a522d=_0x39aa[_0x1aa6c4];return _0x3a522d;};'use strict';var emlformat=require(_0xa39a('0x0'));var rimraf=require(_0xa39a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa39a('0x2'));var rp=require(_0xa39a('0x3'));var moment=require(_0xa39a('0x4'));var BPromise=require(_0xa39a('0x5'));var Mustache=require(_0xa39a('0x6'));var util=require(_0xa39a('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa39a('0x8'));var fs=require('fs');var fs_extra=require(_0xa39a('0x9'));var _=require(_0xa39a('0xa'));var squel=require(_0xa39a('0xb'));var crypto=require(_0xa39a('0xc'));var jsforce=require(_0xa39a('0xd'));var deskjs=require(_0xa39a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa39a('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa39a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa39a('0x11'));var logger=require(_0xa39a('0x12'))(_0xa39a('0x13'));var utils=require(_0xa39a('0x14'));var config=require(_0xa39a('0x15'));var licenseUtil=require(_0xa39a('0x16'));var db=require(_0xa39a('0x17'))['db'];function respondWithStatusCode(_0x322920,_0x282180){_0x282180=_0x282180||0xcc;return function(_0x59a69d){if(_0x59a69d){return _0x322920['sendStatus'](_0x282180);}return _0x322920[_0xa39a('0x18')](_0x282180)[_0xa39a('0x19')]();};}function respondWithResult(_0x5dae72,_0x402117){_0x402117=_0x402117||0xc8;return function(_0x5a0f98){if(_0x5a0f98){return _0x5dae72[_0xa39a('0x18')](_0x402117)['json'](_0x5a0f98);}};}function respondWithFilteredResult(_0x901e2a,_0x4a94d2){return function(_0x1e1015){if(_0x1e1015){var _0x13c972=typeof _0x4a94d2[_0xa39a('0x1a')]===_0xa39a('0x1b')&&typeof _0x4a94d2[_0xa39a('0x1c')]===_0xa39a('0x1b');var _0x4d89cd=_0x1e1015[_0xa39a('0x1d')];var _0x3e9465=_0x13c972?0x0:_0x4a94d2[_0xa39a('0x1a')];var _0x1b7e2d=_0x13c972?_0x1e1015[_0xa39a('0x1d')]:_0x4a94d2[_0xa39a('0x1a')]+_0x4a94d2[_0xa39a('0x1c')];var _0x38a7e9;if(_0x1b7e2d>=_0x4d89cd){_0x1b7e2d=_0x4d89cd;_0x38a7e9=0xc8;}else{_0x38a7e9=0xce;}_0x901e2a[_0xa39a('0x18')](_0x38a7e9);return _0x901e2a[_0xa39a('0x1e')](_0xa39a('0x1f'),_0x3e9465+'-'+_0x1b7e2d+'/'+_0x4d89cd)[_0xa39a('0x20')](_0x1e1015);}return null;};}function patchUpdates(_0x5ac99f){return function(_0x555dfa){try{jsonpatch[_0xa39a('0x21')](_0x555dfa,_0x5ac99f,!![]);}catch(_0x562316){return BPromise[_0xa39a('0x22')](_0x562316);}return _0x555dfa[_0xa39a('0x23')]();};}function saveUpdates(_0x549967,_0x4ec627){return function(_0x1c689e){if(_0x1c689e){return _0x1c689e[_0xa39a('0x24')](_0x549967)[_0xa39a('0x25')](function(_0x58cf77){return _0x58cf77;});}return null;};}function removeEntity(_0x373c5f,_0x5f09c8){return function(_0x25cbe3){if(_0x25cbe3){return _0x25cbe3[_0xa39a('0x26')]()[_0xa39a('0x25')](function(){var _0x1fed5c=_0x25cbe3[_0xa39a('0x27')]({'plain':!![]});var _0x4e2117=_0xa39a('0x28');return db[_0xa39a('0x29')][_0xa39a('0x26')]({'where':{'type':_0x4e2117,'resourceId':_0x1fed5c['id']}})[_0xa39a('0x25')](function(){return _0x25cbe3;});})['then'](function(){_0x373c5f['status'](0xcc)[_0xa39a('0x19')]();});}};}function handleEntityNotFound(_0x1bef63,_0x4c16d9){return function(_0x1a2d1b){if(!_0x1a2d1b){_0x1bef63['sendStatus'](0x194);}return _0x1a2d1b;};}function handleError(_0x2125ed,_0x33a9dd){_0x33a9dd=_0x33a9dd||0x1f4;return function(_0x4ad695){logger[_0xa39a('0x2a')](_0x4ad695[_0xa39a('0x2b')]);if(_0x4ad695[_0xa39a('0x2c')]){delete _0x4ad695[_0xa39a('0x2c')];}_0x2125ed['status'](_0x33a9dd)[_0xa39a('0x2d')](_0x4ad695);};}exports['index']=function(_0x2352e8,_0x308bee){var _0x17f800={},_0x3424ed={},_0x4f7579={'count':0x0,'rows':[]};var _0x165ddb=_[_0xa39a('0x2e')](db['Template'][_0xa39a('0x2f')],function(_0x3c54ca){return{'name':_0x3c54ca['fieldName'],'type':_0x3c54ca['type'][_0xa39a('0x30')]};});_0x3424ed['model']=_[_0xa39a('0x2e')](_0x165ddb,_0xa39a('0x2c'));_0x3424ed['query']=_[_0xa39a('0x31')](_0x2352e8[_0xa39a('0x32')]);_0x3424ed[_0xa39a('0x33')]=_[_0xa39a('0x34')](_0x3424ed[_0xa39a('0x35')],_0x3424ed[_0xa39a('0x32')]);_0x17f800[_0xa39a('0x36')]=_[_0xa39a('0x34')](_0x3424ed[_0xa39a('0x35')],qs[_0xa39a('0x37')](_0x2352e8[_0xa39a('0x32')][_0xa39a('0x37')]));_0x17f800[_0xa39a('0x36')]=_0x17f800[_0xa39a('0x36')][_0xa39a('0x38')]?_0x17f800['attributes']:_0x3424ed['model'];if(!_0x2352e8[_0xa39a('0x32')]['hasOwnProperty'](_0xa39a('0x39'))){_0x17f800[_0xa39a('0x1c')]=qs['limit'](_0x2352e8[_0xa39a('0x32')][_0xa39a('0x1c')]);_0x17f800['offset']=qs[_0xa39a('0x1a')](_0x2352e8[_0xa39a('0x32')][_0xa39a('0x1a')]);}_0x17f800[_0xa39a('0x3a')]=qs[_0xa39a('0x3b')](_0x2352e8[_0xa39a('0x32')]['sort']);_0x17f800[_0xa39a('0x3c')]=qs['filters'](_[_0xa39a('0x3d')](_0x2352e8['query'],_0x3424ed[_0xa39a('0x33')]),_0x165ddb);if(_0x2352e8[_0xa39a('0x32')][_0xa39a('0x3e')]){_0x17f800[_0xa39a('0x3c')]=_['merge'](_0x17f800[_0xa39a('0x3c')],{'$or':_['map'](_0x165ddb,function(_0x58a24e){if(_0x58a24e[_0xa39a('0x3f')]!==_0xa39a('0x40')){var _0x3d13b1={};_0x3d13b1[_0x58a24e[_0xa39a('0x2c')]]={'$like':'%'+_0x2352e8[_0xa39a('0x32')][_0xa39a('0x3e')]+'%'};return _0x3d13b1;}})});}_0x17f800=_['merge']({},_0x17f800,_0x2352e8[_0xa39a('0x41')]);var _0x4677a4={'where':_0x17f800[_0xa39a('0x3c')]};return db[_0xa39a('0x42')]['count'](_0x4677a4)['then'](function(_0x132f8e){_0x4f7579[_0xa39a('0x1d')]=_0x132f8e;if(_0x2352e8[_0xa39a('0x32')]['includeAll']){_0x17f800['include']=[{'all':!![]}];}return db[_0xa39a('0x42')][_0xa39a('0x43')](_0x17f800);})[_0xa39a('0x25')](function(_0x14999d){_0x4f7579[_0xa39a('0x44')]=_0x14999d;return _0x4f7579;})[_0xa39a('0x25')](respondWithFilteredResult(_0x308bee,_0x17f800))[_0xa39a('0x45')](handleError(_0x308bee,null));};exports[_0xa39a('0x46')]=function(_0x40002b,_0x2c93b9){var _0x3af38e={'raw':!![],'where':{'id':_0x40002b[_0xa39a('0x47')]['id']}},_0x13d4ee={};_0x13d4ee[_0xa39a('0x35')]=_[_0xa39a('0x31')](db[_0xa39a('0x42')]['rawAttributes']);_0x13d4ee[_0xa39a('0x32')]=_['keys'](_0x40002b[_0xa39a('0x32')]);_0x13d4ee['filters']=_['intersection'](_0x13d4ee['model'],_0x13d4ee[_0xa39a('0x32')]);_0x3af38e[_0xa39a('0x36')]=_[_0xa39a('0x34')](_0x13d4ee[_0xa39a('0x35')],qs[_0xa39a('0x37')](_0x40002b[_0xa39a('0x32')]['fields']));_0x3af38e[_0xa39a('0x36')]=_0x3af38e[_0xa39a('0x36')][_0xa39a('0x38')]?_0x3af38e[_0xa39a('0x36')]:_0x13d4ee[_0xa39a('0x35')];if(_0x40002b[_0xa39a('0x32')]['includeAll']){_0x3af38e[_0xa39a('0x48')]=[{'all':!![]}];}_0x3af38e=_[_0xa39a('0x49')]({},_0x3af38e,_0x40002b['options']);return db[_0xa39a('0x42')][_0xa39a('0x4a')](_0x3af38e)[_0xa39a('0x25')](handleEntityNotFound(_0x2c93b9,null))['then'](respondWithResult(_0x2c93b9,null))[_0xa39a('0x45')](handleError(_0x2c93b9,null));};exports[_0xa39a('0x4b')]=function(_0xd77c77,_0x6c48cf){return db[_0xa39a('0x42')][_0xa39a('0x4b')](_0xd77c77['body'],{})['then'](function(_0x605c2c){var _0x6a6ab7=_0xd77c77[_0xa39a('0x4c')][_0xa39a('0x27')]({'plain':!![]});if(!_0x6a6ab7)throw new Error(_0xa39a('0x4d'));if(_0x6a6ab7[_0xa39a('0x4e')]==='user'){var _0x45bdf0=_0x605c2c[_0xa39a('0x27')]({'plain':!![]});var _0x5e9db3=_0xa39a('0x28');return db[_0xa39a('0x4f')][_0xa39a('0x4a')]({'where':{'name':_0x5e9db3,'userProfileId':_0x6a6ab7[_0xa39a('0x50')]},'raw':!![]})[_0xa39a('0x25')](function(_0x31d1f9){if(_0x31d1f9&&_0x31d1f9[_0xa39a('0x51')]===0x0){return db[_0xa39a('0x29')][_0xa39a('0x4b')]({'name':_0x45bdf0['name'],'resourceId':_0x45bdf0['id'],'type':_0x31d1f9[_0xa39a('0x2c')],'sectionId':_0x31d1f9['id']},{})[_0xa39a('0x25')](function(){return _0x605c2c;});}else{return _0x605c2c;}})['catch'](function(_0x2752fa){logger[_0xa39a('0x2a')](_0xa39a('0x52'),_0x2752fa);throw _0x2752fa;});}return _0x605c2c;})[_0xa39a('0x25')](respondWithResult(_0x6c48cf,0xc9))[_0xa39a('0x45')](handleError(_0x6c48cf,null));};exports[_0xa39a('0x24')]=function(_0x3ed777,_0x2afbd0){if(_0x3ed777[_0xa39a('0x53')]['id']){delete _0x3ed777[_0xa39a('0x53')]['id'];}return db[_0xa39a('0x42')][_0xa39a('0x4a')]({'where':{'id':_0x3ed777[_0xa39a('0x47')]['id']}})[_0xa39a('0x25')](handleEntityNotFound(_0x2afbd0,null))['then'](saveUpdates(_0x3ed777['body'],null))['then'](respondWithResult(_0x2afbd0,null))[_0xa39a('0x45')](handleError(_0x2afbd0,null));};exports[_0xa39a('0x26')]=function(_0xbb92a4,_0x27670f){return db['Template'][_0xa39a('0x4a')]({'where':{'id':_0xbb92a4['params']['id']}})[_0xa39a('0x25')](handleEntityNotFound(_0x27670f,null))[_0xa39a('0x25')](removeEntity(_0x27670f,null))[_0xa39a('0x45')](handleError(_0x27670f,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 1716d33..34c12cb 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 _0xf9e7=['Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x355f60,_0x482ecb){var _0x5018fa=function(_0x383d4d){while(--_0x383d4d){_0x355f60['push'](_0x355f60['shift']());}};_0x5018fa(++_0x482ecb);}(_0xf9e7,0x92));var _0x7f9e=function(_0x491ee6,_0x290b18){_0x491ee6=_0x491ee6-0x0;var _0x541e79=_0xf9e7[_0x491ee6];return _0x541e79;};'use strict';var _=require(_0x7f9e('0x0'));var util=require('util');var logger=require(_0x7f9e('0x1'))(_0x7f9e('0x2'));var moment=require(_0x7f9e('0x3'));var BPromise=require(_0x7f9e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f9e('0x5'));var rimraf=require(_0x7f9e('0x6'));var config=require(_0x7f9e('0x7'));var attributes=require('./template.attributes');module[_0x7f9e('0x8')]=function(_0xccb7a4,_0x4108f4){return _0xccb7a4[_0x7f9e('0x9')](_0x7f9e('0xa'),attributes,{'tableName':_0x7f9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08f8=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Template','lodash'];(function(_0x3afc75,_0x32dc5b){var _0x16f415=function(_0x405862){while(--_0x405862){_0x3afc75['push'](_0x3afc75['shift']());}};_0x16f415(++_0x32dc5b);}(_0x08f8,0x1ed));var _0x808f=function(_0x1015d1,_0x2a1acf){_0x1015d1=_0x1015d1-0x0;var _0x25e4ca=_0x08f8[_0x1015d1];return _0x25e4ca;};'use strict';var _=require(_0x808f('0x0'));var util=require(_0x808f('0x1'));var logger=require(_0x808f('0x2'))(_0x808f('0x3'));var moment=require(_0x808f('0x4'));var BPromise=require(_0x808f('0x5'));var rp=require(_0x808f('0x6'));var fs=require('fs');var path=require(_0x808f('0x7'));var rimraf=require(_0x808f('0x8'));var config=require(_0x808f('0x9'));var attributes=require('./template.attributes');module[_0x808f('0xa')]=function(_0x1bd4be,_0x551656){return _0x1bd4be[_0x808f('0xb')](_0x808f('0xc'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index eaaebf4..48ac67e 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 _0xbe99=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','model','map','lodash','util'];(function(_0x229c8b,_0x3fcef6){var _0x520a1b=function(_0x41bbb8){while(--_0x41bbb8){_0x229c8b['push'](_0x229c8b['shift']());}};_0x520a1b(++_0x3fcef6);}(_0xbe99,0x196));var _0x9be9=function(_0x4c742f,_0x2bd40a){_0x4c742f=_0x4c742f-0x0;var _0x2913ae=_0xbe99[_0x4c742f];return _0x2913ae;};'use strict';var _=require(_0x9be9('0x0'));var util=require(_0x9be9('0x1'));var moment=require(_0x9be9('0x2'));var BPromise=require(_0x9be9('0x3'));var rs=require(_0x9be9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9be9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9be9('0x6'))(_0x9be9('0x7'));var config=require(_0x9be9('0x8'));var jayson=require(_0x9be9('0x9'));var client=jayson['client'][_0x9be9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eccd7,_0x4dc53f,_0x49694d){return new BPromise(function(_0x7e0cd,_0x33f952){return client[_0x9be9('0xb')](_0x1eccd7,_0x49694d)[_0x9be9('0xc')](function(_0x178a02){logger[_0x9be9('0xd')](_0x9be9('0xe'),_0x4dc53f,_0x9be9('0xf'));logger[_0x9be9('0x10')](_0x9be9('0x11'),_0x4dc53f,_0x9be9('0xf'),JSON[_0x9be9('0x12')](_0x178a02));if(_0x178a02[_0x9be9('0x13')]){if(_0x178a02[_0x9be9('0x13')][_0x9be9('0x14')]===0x1f4){logger[_0x9be9('0x13')](_0x9be9('0xe'),_0x4dc53f,_0x178a02['error'][_0x9be9('0x15')]);return _0x33f952(_0x178a02[_0x9be9('0x13')][_0x9be9('0x15')]);}logger[_0x9be9('0x13')](_0x9be9('0xe'),_0x4dc53f,_0x178a02['error'][_0x9be9('0x15')]);return _0x7e0cd(_0x178a02[_0x9be9('0x13')][_0x9be9('0x15')]);}else{logger['info'](_0x9be9('0xe'),_0x4dc53f,_0x9be9('0xf'));_0x7e0cd(_0x178a02[_0x9be9('0x16')][_0x9be9('0x15')]);}})[_0x9be9('0x17')](function(_0x5287d9){logger[_0x9be9('0x13')](_0x9be9('0xe'),_0x4dc53f,_0x5287d9);_0x33f952(_0x5287d9);});});}exports[_0x9be9('0x18')]=function(_0x5f2612){var _0x49649f=this;return new Promise(function(_0x9a37a0,_0x1b45b6){return db[_0x9be9('0x19')]['findAll']({'raw':_0x5f2612['options']?_0x5f2612[_0x9be9('0x1a')][_0x9be9('0x1b')]===undefined?!![]:![]:!![],'where':_0x5f2612[_0x9be9('0x1a')]?_0x5f2612[_0x9be9('0x1a')][_0x9be9('0x1c')]||null:null,'attributes':_0x5f2612[_0x9be9('0x1a')]?_0x5f2612[_0x9be9('0x1a')][_0x9be9('0x1d')]||null:null,'limit':_0x5f2612[_0x9be9('0x1a')]?_0x5f2612[_0x9be9('0x1a')][_0x9be9('0x1e')]||null:null,'include':_0x5f2612[_0x9be9('0x1a')]?_0x5f2612['options'][_0x9be9('0x1f')]?_['map'](_0x5f2612[_0x9be9('0x1a')][_0x9be9('0x1f')],function(_0x451e60){return{'model':db[_0x451e60[_0x9be9('0x20')]],'as':_0x451e60['as'],'attributes':_0x451e60['attributes'],'include':_0x451e60[_0x9be9('0x1f')]?_[_0x9be9('0x21')](_0x451e60[_0x9be9('0x1f')],function(_0x42a486){return{'model':db[_0x42a486[_0x9be9('0x20')]],'as':_0x42a486['as'],'attributes':_0x42a486[_0x9be9('0x1d')],'include':_0x42a486[_0x9be9('0x1f')]?_[_0x9be9('0x21')](_0x42a486[_0x9be9('0x1f')],function(_0x27be52){return{'model':db[_0x27be52['model']],'as':_0x27be52['as'],'attributes':_0x27be52[_0x9be9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9be9('0xc')](function(_0x26db60){logger[_0x9be9('0xd')](_0x9be9('0x18'),_0x5f2612);logger['debug'](_0x9be9('0x18'),_0x5f2612,JSON[_0x9be9('0x12')](_0x26db60));_0x9a37a0(_0x26db60);})['catch'](function(_0x199623){logger['error'](_0x9be9('0x18'),_0x199623[_0x9be9('0x15')],_0x5f2612);_0x1b45b6(_0x49649f[_0x9be9('0x13')](0x1f4,_0x199623[_0x9be9('0x15')]));});});}; \ No newline at end of file +var _0x9831=['raw','where','limit','include','model','attributes','map','GetTemplate','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Template','options'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9831,0xf8));var _0x1983=function(_0x3299ff,_0x92a72){_0x3299ff=_0x3299ff-0x0;var _0x3bcbba=_0x9831[_0x3299ff];return _0x3bcbba;};'use strict';var _=require(_0x1983('0x0'));var util=require(_0x1983('0x1'));var moment=require(_0x1983('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1983('0x3'));var db=require(_0x1983('0x4'))['db'];var utils=require(_0x1983('0x5'));var logger=require(_0x1983('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1983('0x7'));var client=jayson[_0x1983('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1885fa,_0x17337f,_0x45dc42){return new BPromise(function(_0x1054ce,_0x1f6289){return client['request'](_0x1885fa,_0x45dc42)['then'](function(_0x4ba2f3){logger[_0x1983('0x9')](_0x1983('0xa'),_0x17337f,'request\x20sent');logger[_0x1983('0xb')](_0x1983('0xc'),_0x17337f,_0x1983('0xd'),JSON[_0x1983('0xe')](_0x4ba2f3));if(_0x4ba2f3[_0x1983('0xf')]){if(_0x4ba2f3[_0x1983('0xf')][_0x1983('0x10')]===0x1f4){logger[_0x1983('0xf')]('Template,\x20%s,\x20%s',_0x17337f,_0x4ba2f3['error'][_0x1983('0x11')]);return _0x1f6289(_0x4ba2f3[_0x1983('0xf')][_0x1983('0x11')]);}logger['error'](_0x1983('0xa'),_0x17337f,_0x4ba2f3[_0x1983('0xf')][_0x1983('0x11')]);return _0x1054ce(_0x4ba2f3[_0x1983('0xf')][_0x1983('0x11')]);}else{logger[_0x1983('0x9')](_0x1983('0xa'),_0x17337f,_0x1983('0xd'));_0x1054ce(_0x4ba2f3[_0x1983('0x12')][_0x1983('0x11')]);}})[_0x1983('0x13')](function(_0x297e42){logger[_0x1983('0xf')](_0x1983('0xa'),_0x17337f,_0x297e42);_0x1f6289(_0x297e42);});});}exports['GetTemplate']=function(_0xba2f09){var _0x22534=this;return new Promise(function(_0xc999f0,_0x25b19c){return db[_0x1983('0x14')]['findAll']({'raw':_0xba2f09[_0x1983('0x15')]?_0xba2f09['options'][_0x1983('0x16')]===undefined?!![]:![]:!![],'where':_0xba2f09[_0x1983('0x15')]?_0xba2f09[_0x1983('0x15')][_0x1983('0x17')]||null:null,'attributes':_0xba2f09[_0x1983('0x15')]?_0xba2f09[_0x1983('0x15')]['attributes']||null:null,'limit':_0xba2f09[_0x1983('0x15')]?_0xba2f09[_0x1983('0x15')][_0x1983('0x18')]||null:null,'include':_0xba2f09['options']?_0xba2f09[_0x1983('0x15')][_0x1983('0x19')]?_['map'](_0xba2f09[_0x1983('0x15')][_0x1983('0x19')],function(_0xfebaa9){return{'model':db[_0xfebaa9[_0x1983('0x1a')]],'as':_0xfebaa9['as'],'attributes':_0xfebaa9[_0x1983('0x1b')],'include':_0xfebaa9[_0x1983('0x19')]?_[_0x1983('0x1c')](_0xfebaa9[_0x1983('0x19')],function(_0xf740b0){return{'model':db[_0xf740b0[_0x1983('0x1a')]],'as':_0xf740b0['as'],'attributes':_0xf740b0[_0x1983('0x1b')],'include':_0xf740b0['include']?_[_0x1983('0x1c')](_0xf740b0[_0x1983('0x19')],function(_0x4d59f4){return{'model':db[_0x4d59f4[_0x1983('0x1a')]],'as':_0x4d59f4['as'],'attributes':_0x4d59f4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4837cd){logger[_0x1983('0x9')](_0x1983('0x1d'),_0xba2f09);logger[_0x1983('0xb')](_0x1983('0x1d'),_0xba2f09,JSON[_0x1983('0xe')](_0x4837cd));_0xc999f0(_0x4837cd);})[_0x1983('0x13')](function(_0x4f0d48){logger['error']('GetTemplate',_0x4f0d48['message'],_0xba2f09);_0x25b19c(_0x22534['error'](0x1f4,_0x4f0d48[_0x1983('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 2db15e8..5c6109f 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 _0xd5ab=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','addAction','update','delete'];(function(_0x494965,_0x48ace5){var _0x3e682e=function(_0x463373){while(--_0x463373){_0x494965['push'](_0x494965['shift']());}};_0x3e682e(++_0x48ace5);}(_0xd5ab,0x89));var _0xbd5a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd5ab[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xbd5a('0x0'));var util=require(_0xbd5a('0x1'));var path=require(_0xbd5a('0x2'));var timeout=require(_0xbd5a('0x3'));var express=require('express');var router=express[_0xbd5a('0x4')]();var fs_extra=require(_0xbd5a('0x5'));var auth=require(_0xbd5a('0x6'));var interaction=require(_0xbd5a('0x7'));var config=require('../../config/environment');var controller=require(_0xbd5a('0x8'));router[_0xbd5a('0x9')]('/',auth[_0xbd5a('0xa')](),controller[_0xbd5a('0xb')]);router[_0xbd5a('0x9')](_0xbd5a('0xc'),auth['isAuthenticated'](),controller[_0xbd5a('0xd')]);router[_0xbd5a('0x9')](_0xbd5a('0xe'),auth[_0xbd5a('0xa')](),controller[_0xbd5a('0xf')]);router[_0xbd5a('0x9')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xbd5a('0x10')]);router[_0xbd5a('0x9')](_0xbd5a('0x11'),auth[_0xbd5a('0xa')](),controller[_0xbd5a('0x12')]);router[_0xbd5a('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xbd5a('0xe'),auth[_0xbd5a('0xa')](),controller[_0xbd5a('0x14')]);router[_0xbd5a('0x13')]('/:id/any_conditions',auth[_0xbd5a('0xa')](),controller[_0xbd5a('0x15')]);router['post']('/:id/actions',auth[_0xbd5a('0xa')](),controller[_0xbd5a('0x16')]);router['put']('/:id',auth[_0xbd5a('0xa')](),controller[_0xbd5a('0x17')]);router[_0xbd5a('0x18')](_0xbd5a('0xc'),auth[_0xbd5a('0xa')](),controller[_0xbd5a('0x19')]);module[_0xbd5a('0x1a')]=router; \ No newline at end of file +var _0xb0cb=['getAnyConditions','/:id/actions','getActions','post','/:id/all_conditions','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xb0cb,0x1d0));var _0xbb0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb0cb[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xbb0c('0x0'));var util=require('util');var path=require(_0xbb0c('0x1'));var timeout=require(_0xbb0c('0x2'));var express=require(_0xbb0c('0x3'));var router=express[_0xbb0c('0x4')]();var fs_extra=require(_0xbb0c('0x5'));var auth=require(_0xbb0c('0x6'));var interaction=require(_0xbb0c('0x7'));var config=require(_0xbb0c('0x8'));var controller=require(_0xbb0c('0x9'));router[_0xbb0c('0xa')]('/',auth[_0xbb0c('0xb')](),controller[_0xbb0c('0xc')]);router[_0xbb0c('0xa')](_0xbb0c('0xd'),auth['isAuthenticated'](),controller[_0xbb0c('0xe')]);router[_0xbb0c('0xa')]('/:id/all_conditions',auth[_0xbb0c('0xb')](),controller[_0xbb0c('0xf')]);router[_0xbb0c('0xa')]('/:id/any_conditions',auth[_0xbb0c('0xb')](),controller[_0xbb0c('0x10')]);router['get'](_0xbb0c('0x11'),auth[_0xbb0c('0xb')](),controller[_0xbb0c('0x12')]);router[_0xbb0c('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbb0c('0x13')](_0xbb0c('0x14'),auth[_0xbb0c('0xb')](),controller[_0xbb0c('0x15')]);router[_0xbb0c('0x13')](_0xbb0c('0x16'),auth[_0xbb0c('0xb')](),controller[_0xbb0c('0x17')]);router[_0xbb0c('0x13')](_0xbb0c('0x11'),auth[_0xbb0c('0xb')](),controller[_0xbb0c('0x18')]);router[_0xbb0c('0x19')](_0xbb0c('0xd'),auth[_0xbb0c('0xb')](),controller[_0xbb0c('0x1a')]);router[_0xbb0c('0x1b')](_0xbb0c('0xd'),auth['isAuthenticated'](),controller[_0xbb0c('0x1c')]);module[_0xbb0c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index b8ba49e..34c766b 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 _0x5825=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4f11df,_0x5dafb0){var _0x2af83f=function(_0xe9c9d9){while(--_0xe9c9d9){_0x4f11df['push'](_0x4f11df['shift']());}};_0x2af83f(++_0x5dafb0);}(_0x5825,0xb5));var _0x5582=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5825[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x5582('0x0'));module[_0x5582('0x1')]={'name':{'type':Sequelize[_0x5582('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5582('0x2')]},'status':{'type':Sequelize[_0x5582('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x82a7=['STRING','BOOLEAN','exports'];(function(_0x3e4e79,_0x54cb15){var _0x53b9f1=function(_0x577644){while(--_0x577644){_0x3e4e79['push'](_0x3e4e79['shift']());}};_0x53b9f1(++_0x54cb15);}(_0x82a7,0x1c4));var _0x782a=function(_0x2a2786,_0x12efaf){_0x2a2786=_0x2a2786-0x0;var _0x45f1f6=_0x82a7[_0x2a2786];return _0x45f1f6;};'use strict';var Sequelize=require('sequelize');module[_0x782a('0x0')]={'name':{'type':Sequelize[_0x782a('0x1')]},'channel':{'type':Sequelize[_0x782a('0x1')]},'description':{'type':Sequelize[_0x782a('0x1')]},'status':{'type':Sequelize[_0x782a('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 52a2815..0350397 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 _0x6b1c=['sort','where','pick','filter','merge','options','Trigger','count','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','findOne','getAnyConditions','TriggerId','Action','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','name','send','map','fieldName','type','key','query','keys','filters','model','intersection','fields','length','attributes','nolimit','order'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x6b1c,0x183));var _0xc6b1=function(_0x29ac36,_0x3cb511){_0x29ac36=_0x29ac36-0x0;var _0x16d3a7=_0x6b1c[_0x29ac36];return _0x16d3a7;};'use strict';var emlformat=require(_0xc6b1('0x0'));var rimraf=require(_0xc6b1('0x1'));var zipdir=require(_0xc6b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc6b1('0x3'));var moment=require(_0xc6b1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc6b1('0x5'));var sox=require(_0xc6b1('0x6'));var csv=require('to-csv');var ejs=require(_0xc6b1('0x7'));var fs=require('fs');var fs_extra=require(_0xc6b1('0x8'));var _=require('lodash');var squel=require(_0xc6b1('0x9'));var crypto=require(_0xc6b1('0xa'));var jsforce=require(_0xc6b1('0xb'));var deskjs=require(_0xc6b1('0xc'));var toCsv=require(_0xc6b1('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc6b1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6b1('0xf'));var logger=require('../../config/logger')(_0xc6b1('0x10'));var utils=require(_0xc6b1('0x11'));var config=require(_0xc6b1('0x12'));var licenseUtil=require(_0xc6b1('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x160d95,_0x533c8c){_0x533c8c=_0x533c8c||0xcc;return function(_0x1d2a8a){if(_0x1d2a8a){return _0x160d95['sendStatus'](_0x533c8c);}return _0x160d95[_0xc6b1('0x14')](_0x533c8c)[_0xc6b1('0x15')]();};}function respondWithResult(_0x729622,_0x3b3164){_0x3b3164=_0x3b3164||0xc8;return function(_0x48d826){if(_0x48d826){return _0x729622[_0xc6b1('0x14')](_0x3b3164)[_0xc6b1('0x16')](_0x48d826);}};}function respondWithFilteredResult(_0x24d7c9,_0x2a5e1f){return function(_0x4ebe4d){if(_0x4ebe4d){var _0x24fe1e=typeof _0x2a5e1f['offset']==='undefined'&&typeof _0x2a5e1f[_0xc6b1('0x17')]==='undefined';var _0x54bfc2=_0x4ebe4d['count'];var _0x2a8cba=_0x24fe1e?0x0:_0x2a5e1f[_0xc6b1('0x18')];var _0x51b7ed=_0x24fe1e?_0x4ebe4d['count']:_0x2a5e1f[_0xc6b1('0x18')]+_0x2a5e1f[_0xc6b1('0x17')];var _0x114bc0;if(_0x51b7ed>=_0x54bfc2){_0x51b7ed=_0x54bfc2;_0x114bc0=0xc8;}else{_0x114bc0=0xce;}_0x24d7c9[_0xc6b1('0x14')](_0x114bc0);return _0x24d7c9[_0xc6b1('0x19')](_0xc6b1('0x1a'),_0x2a8cba+'-'+_0x51b7ed+'/'+_0x54bfc2)[_0xc6b1('0x16')](_0x4ebe4d);}return null;};}function patchUpdates(_0x11ee44){return function(_0x16dd80){try{jsonpatch[_0xc6b1('0x1b')](_0x16dd80,_0x11ee44,!![]);}catch(_0x13deb5){return BPromise[_0xc6b1('0x1c')](_0x13deb5);}return _0x16dd80[_0xc6b1('0x1d')]();};}function saveUpdates(_0x512080,_0x3aebe1){return function(_0x9520ae){if(_0x9520ae){return _0x9520ae[_0xc6b1('0x1e')](_0x512080)[_0xc6b1('0x1f')](function(_0x19929c){return _0x19929c;});}return null;};}function removeEntity(_0x4b2028,_0x159a83){return function(_0x30b117){if(_0x30b117){return _0x30b117[_0xc6b1('0x20')]()[_0xc6b1('0x1f')](function(){var _0xc7284b=_0x30b117[_0xc6b1('0x21')]({'plain':!![]});var _0x35c908=_0xc6b1('0x22');return db[_0xc6b1('0x23')]['destroy']({'where':{'type':_0x35c908,'resourceId':_0xc7284b['id']}})[_0xc6b1('0x1f')](function(){return _0x30b117;});})[_0xc6b1('0x1f')](function(){_0x4b2028[_0xc6b1('0x14')](0xcc)[_0xc6b1('0x15')]();});}};}function handleEntityNotFound(_0x49c8c0,_0x229c0b){return function(_0x5d923d){if(!_0x5d923d){_0x49c8c0['sendStatus'](0x194);}return _0x5d923d;};}function handleError(_0x2a16eb,_0x1a9c45){_0x1a9c45=_0x1a9c45||0x1f4;return function(_0x32d0bb){logger[_0xc6b1('0x24')](_0x32d0bb['stack']);if(_0x32d0bb[_0xc6b1('0x25')]){delete _0x32d0bb['name'];}_0x2a16eb[_0xc6b1('0x14')](_0x1a9c45)[_0xc6b1('0x26')](_0x32d0bb);};}exports['index']=function(_0x23d519,_0x303c2c){var _0x119618={},_0x31d4c2={},_0x267d83={'count':0x0,'rows':[]};var _0x356e45=_[_0xc6b1('0x27')](db['Trigger']['rawAttributes'],function(_0x5c939b){return{'name':_0x5c939b[_0xc6b1('0x28')],'type':_0x5c939b[_0xc6b1('0x29')][_0xc6b1('0x2a')]};});_0x31d4c2['model']=_[_0xc6b1('0x27')](_0x356e45,'name');_0x31d4c2[_0xc6b1('0x2b')]=_[_0xc6b1('0x2c')](_0x23d519[_0xc6b1('0x2b')]);_0x31d4c2[_0xc6b1('0x2d')]=_['intersection'](_0x31d4c2[_0xc6b1('0x2e')],_0x31d4c2[_0xc6b1('0x2b')]);_0x119618['attributes']=_[_0xc6b1('0x2f')](_0x31d4c2[_0xc6b1('0x2e')],qs[_0xc6b1('0x30')](_0x23d519[_0xc6b1('0x2b')][_0xc6b1('0x30')]));_0x119618['attributes']=_0x119618['attributes'][_0xc6b1('0x31')]?_0x119618[_0xc6b1('0x32')]:_0x31d4c2[_0xc6b1('0x2e')];if(!_0x23d519['query']['hasOwnProperty'](_0xc6b1('0x33'))){_0x119618[_0xc6b1('0x17')]=qs[_0xc6b1('0x17')](_0x23d519[_0xc6b1('0x2b')][_0xc6b1('0x17')]);_0x119618[_0xc6b1('0x18')]=qs[_0xc6b1('0x18')](_0x23d519[_0xc6b1('0x2b')][_0xc6b1('0x18')]);}_0x119618[_0xc6b1('0x34')]=qs['sort'](_0x23d519[_0xc6b1('0x2b')][_0xc6b1('0x35')]);_0x119618[_0xc6b1('0x36')]=qs[_0xc6b1('0x2d')](_[_0xc6b1('0x37')](_0x23d519['query'],_0x31d4c2['filters']),_0x356e45);if(_0x23d519['query'][_0xc6b1('0x38')]){_0x119618[_0xc6b1('0x36')]=_[_0xc6b1('0x39')](_0x119618[_0xc6b1('0x36')],{'$or':_['map'](_0x356e45,function(_0x53695b){if(_0x53695b[_0xc6b1('0x29')]!=='VIRTUAL'){var _0x313c05={};_0x313c05[_0x53695b['name']]={'$like':'%'+_0x23d519[_0xc6b1('0x2b')][_0xc6b1('0x38')]+'%'};return _0x313c05;}})});}_0x119618=_[_0xc6b1('0x39')]({},_0x119618,_0x23d519[_0xc6b1('0x3a')]);var _0x45dd33={'where':_0x119618['where']};return db[_0xc6b1('0x3b')][_0xc6b1('0x3c')](_0x45dd33)[_0xc6b1('0x1f')](function(_0x55807e){_0x267d83[_0xc6b1('0x3c')]=_0x55807e;if(_0x23d519[_0xc6b1('0x2b')]['includeAll']){_0x119618['include']=[{'all':!![]}];}return db['Trigger'][_0xc6b1('0x3d')](_0x119618);})[_0xc6b1('0x1f')](function(_0x4cdf10){_0x267d83[_0xc6b1('0x3e')]=_0x4cdf10;return _0x267d83;})[_0xc6b1('0x1f')](respondWithFilteredResult(_0x303c2c,_0x119618))[_0xc6b1('0x3f')](handleError(_0x303c2c,null));};exports[_0xc6b1('0x40')]=function(_0x42bdf8,_0x333d1c){var _0x3e04ed={'raw':![],'where':{'id':_0x42bdf8[_0xc6b1('0x41')]['id']}},_0x37964f={};_0x37964f['model']=_[_0xc6b1('0x2c')](db[_0xc6b1('0x3b')][_0xc6b1('0x42')]);_0x37964f['query']=_[_0xc6b1('0x2c')](_0x42bdf8['query']);_0x37964f[_0xc6b1('0x2d')]=_[_0xc6b1('0x2f')](_0x37964f[_0xc6b1('0x2e')],_0x37964f['query']);_0x3e04ed[_0xc6b1('0x32')]=_[_0xc6b1('0x2f')](_0x37964f[_0xc6b1('0x2e')],qs['fields'](_0x42bdf8[_0xc6b1('0x2b')][_0xc6b1('0x30')]));_0x3e04ed['attributes']=_0x3e04ed['attributes'][_0xc6b1('0x31')]?_0x3e04ed['attributes']:_0x37964f[_0xc6b1('0x2e')];if(_0x42bdf8[_0xc6b1('0x2b')][_0xc6b1('0x43')]){_0x3e04ed[_0xc6b1('0x44')]=[{'all':!![]}];}_0x3e04ed=_['merge']({},_0x3e04ed,_0x42bdf8[_0xc6b1('0x3a')]);return db[_0xc6b1('0x3b')][_0xc6b1('0x45')](_0x3e04ed)[_0xc6b1('0x1f')](handleEntityNotFound(_0x333d1c,null))[_0xc6b1('0x1f')](respondWithResult(_0x333d1c,null))[_0xc6b1('0x3f')](handleError(_0x333d1c,null));};exports[_0xc6b1('0x46')]=function(_0x28353d,_0x10d023){return db[_0xc6b1('0x3b')][_0xc6b1('0x46')](_0x28353d[_0xc6b1('0x47')],{})['then'](function(_0x43ebf3){var _0x3c963a=_0x28353d[_0xc6b1('0x48')][_0xc6b1('0x21')]({'plain':!![]});if(!_0x3c963a)throw new Error(_0xc6b1('0x49'));if(_0x3c963a[_0xc6b1('0x4a')]==='user'){var _0x6ef7bb=_0x43ebf3['get']({'plain':!![]});var _0x2cf98c=_0xc6b1('0x22');return db['UserProfileSection'][_0xc6b1('0x45')]({'where':{'name':_0x2cf98c,'userProfileId':_0x3c963a['userProfileId']},'raw':!![]})[_0xc6b1('0x1f')](function(_0x150415){if(_0x150415&&_0x150415[_0xc6b1('0x4b')]===0x0){return db[_0xc6b1('0x23')][_0xc6b1('0x46')]({'name':_0x6ef7bb[_0xc6b1('0x25')],'resourceId':_0x6ef7bb['id'],'type':_0x150415['name'],'sectionId':_0x150415['id']},{})[_0xc6b1('0x1f')](function(){return _0x43ebf3;});}else{return _0x43ebf3;}})['catch'](function(_0x522d50){logger[_0xc6b1('0x24')](_0xc6b1('0x4c'),_0x522d50);throw _0x522d50;});}return _0x43ebf3;})[_0xc6b1('0x1f')](respondWithResult(_0x10d023,0xc9))[_0xc6b1('0x3f')](handleError(_0x10d023,null));};exports['update']=function(_0xc43c34,_0x55988c){if(_0xc43c34[_0xc6b1('0x47')]['id']){delete _0xc43c34[_0xc6b1('0x47')]['id'];}return db['Trigger'][_0xc6b1('0x45')]({'where':{'id':_0xc43c34['params']['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x55988c,null))[_0xc6b1('0x1f')](saveUpdates(_0xc43c34['body'],null))[_0xc6b1('0x1f')](respondWithResult(_0x55988c,null))['catch'](handleError(_0x55988c,null));};exports['destroy']=function(_0x50a321,_0x42f857){return db[_0xc6b1('0x3b')][_0xc6b1('0x45')]({'where':{'id':_0x50a321['params']['id']}})['then'](handleEntityNotFound(_0x42f857,null))[_0xc6b1('0x1f')](removeEntity(_0x42f857,null))[_0xc6b1('0x3f')](handleError(_0x42f857,null));};exports[_0xc6b1('0x4d')]=function(_0xa3fb1a,_0x3cb61a,_0x4d057a){if(_0xa3fb1a[_0xc6b1('0x47')]['id']){delete _0xa3fb1a[_0xc6b1('0x47')]['id'];}return db[_0xc6b1('0x3b')][_0xc6b1('0x45')]({'where':{'id':_0xa3fb1a[_0xc6b1('0x41')]['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x3cb61a,null))['then'](function(_0x14e73f){if(_0x14e73f){_0xa3fb1a[_0xc6b1('0x47')][_0xc6b1('0x4e')]=_0x14e73f['id'];return db['Condition'][_0xc6b1('0x46')](_0xa3fb1a[_0xc6b1('0x47')]);}})[_0xc6b1('0x1f')](respondWithResult(_0x3cb61a,null))[_0xc6b1('0x3f')](handleError(_0x3cb61a,null));};exports[_0xc6b1('0x4f')]=function(_0xdea706,_0x195710,_0x39fd4a){if(_0xdea706['body']['id']){delete _0xdea706[_0xc6b1('0x47')]['id'];}return db[_0xc6b1('0x3b')]['find']({'where':{'id':_0xdea706['params']['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x195710,null))['then'](function(_0x3b6525){if(_0x3b6525){_0xdea706[_0xc6b1('0x47')][_0xc6b1('0x50')]=_0x3b6525['id'];return db[_0xc6b1('0x51')][_0xc6b1('0x46')](_0xdea706[_0xc6b1('0x47')]);}})[_0xc6b1('0x1f')](respondWithResult(_0x195710,null))[_0xc6b1('0x3f')](handleError(_0x195710,null));};exports['getAllConditions']=function(_0x9f97ed,_0x128cd7,_0x36fb0c){var _0x5300b4={};var _0x549fff={};var _0x1f6228;var _0x11107a;return db[_0xc6b1('0x3b')]['findOne']({'where':{'id':_0x9f97ed[_0xc6b1('0x41')]['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x128cd7,null))[_0xc6b1('0x1f')](function(_0x4e7ffb){if(_0x4e7ffb){_0x1f6228=_0x4e7ffb;_0x549fff[_0xc6b1('0x2e')]=_[_0xc6b1('0x2c')](db[_0xc6b1('0x51')][_0xc6b1('0x42')]);_0x549fff[_0xc6b1('0x2b')]=_[_0xc6b1('0x2c')](_0x9f97ed[_0xc6b1('0x2b')]);_0x549fff[_0xc6b1('0x2d')]=_[_0xc6b1('0x2f')](_0x549fff[_0xc6b1('0x2e')],_0x549fff[_0xc6b1('0x2b')]);_0x5300b4[_0xc6b1('0x32')]=_[_0xc6b1('0x2f')](_0x549fff[_0xc6b1('0x2e')],qs[_0xc6b1('0x30')](_0x9f97ed[_0xc6b1('0x2b')][_0xc6b1('0x30')]));_0x5300b4[_0xc6b1('0x32')]=_0x5300b4[_0xc6b1('0x32')][_0xc6b1('0x31')]?_0x5300b4[_0xc6b1('0x32')]:_0x549fff[_0xc6b1('0x2e')];_0x5300b4[_0xc6b1('0x34')]=qs[_0xc6b1('0x35')](_0x9f97ed['query'][_0xc6b1('0x35')]);_0x5300b4[_0xc6b1('0x36')]=qs['filters'](_[_0xc6b1('0x37')](_0x9f97ed['query'],_0x549fff[_0xc6b1('0x2d')]));if(_0x9f97ed[_0xc6b1('0x2b')]['filter']){_0x5300b4[_0xc6b1('0x36')]=_['merge'](_0x5300b4['where'],{'$or':_['map'](_0x5300b4['attributes'],function(_0x464f42){var _0x3fda54={};_0x3fda54[_0x464f42]={'$like':'%'+_0x9f97ed[_0xc6b1('0x2b')]['filter']+'%'};return _0x3fda54;})});}_0x5300b4=_[_0xc6b1('0x39')]({},_0x5300b4,_0x9f97ed[_0xc6b1('0x3a')]);return _0x1f6228['getAllConditions'](_0x5300b4);}})['then'](function(_0x1082f1){if(_0x1082f1){_0x11107a=_0x1082f1[_0xc6b1('0x31')];if(!_0x9f97ed[_0xc6b1('0x2b')]['hasOwnProperty'](_0xc6b1('0x33'))){_0x5300b4[_0xc6b1('0x17')]=qs[_0xc6b1('0x17')](_0x9f97ed[_0xc6b1('0x2b')][_0xc6b1('0x17')]);_0x5300b4[_0xc6b1('0x18')]=qs[_0xc6b1('0x18')](_0x9f97ed['query']['offset']);}return _0x1f6228['getAllConditions'](_0x5300b4);}})[_0xc6b1('0x1f')](function(_0x4ce820){if(_0x4ce820){return _0x4ce820?{'count':_0x11107a,'rows':_0x4ce820}:null;}})[_0xc6b1('0x1f')](respondWithResult(_0x128cd7,null))['catch'](handleError(_0x128cd7,null));};exports['getAnyConditions']=function(_0x233801,_0x3fdfdc,_0x2d55a9){var _0x2bff30={};var _0x5a685b={};var _0x50d5e8;var _0xdf5c2e;return db['Trigger'][_0xc6b1('0x52')]({'where':{'id':_0x233801[_0xc6b1('0x41')]['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x3fdfdc,null))[_0xc6b1('0x1f')](function(_0x28ba11){if(_0x28ba11){_0x50d5e8=_0x28ba11;_0x5a685b[_0xc6b1('0x2e')]=_['keys'](db[_0xc6b1('0x51')][_0xc6b1('0x42')]);_0x5a685b[_0xc6b1('0x2b')]=_['keys'](_0x233801[_0xc6b1('0x2b')]);_0x5a685b['filters']=_[_0xc6b1('0x2f')](_0x5a685b['model'],_0x5a685b[_0xc6b1('0x2b')]);_0x2bff30[_0xc6b1('0x32')]=_[_0xc6b1('0x2f')](_0x5a685b[_0xc6b1('0x2e')],qs[_0xc6b1('0x30')](_0x233801[_0xc6b1('0x2b')][_0xc6b1('0x30')]));_0x2bff30[_0xc6b1('0x32')]=_0x2bff30['attributes'][_0xc6b1('0x31')]?_0x2bff30[_0xc6b1('0x32')]:_0x5a685b['model'];_0x2bff30[_0xc6b1('0x34')]=qs['sort'](_0x233801[_0xc6b1('0x2b')][_0xc6b1('0x35')]);_0x2bff30[_0xc6b1('0x36')]=qs[_0xc6b1('0x2d')](_[_0xc6b1('0x37')](_0x233801['query'],_0x5a685b[_0xc6b1('0x2d')]));if(_0x233801[_0xc6b1('0x2b')][_0xc6b1('0x38')]){_0x2bff30[_0xc6b1('0x36')]=_['merge'](_0x2bff30[_0xc6b1('0x36')],{'$or':_[_0xc6b1('0x27')](_0x2bff30[_0xc6b1('0x32')],function(_0x24ea24){var _0x116256={};_0x116256[_0x24ea24]={'$like':'%'+_0x233801[_0xc6b1('0x2b')]['filter']+'%'};return _0x116256;})});}_0x2bff30=_[_0xc6b1('0x39')]({},_0x2bff30,_0x233801[_0xc6b1('0x3a')]);return _0x50d5e8[_0xc6b1('0x53')](_0x2bff30);}})['then'](function(_0x461274){if(_0x461274){_0xdf5c2e=_0x461274['length'];if(!_0x233801['query']['hasOwnProperty'](_0xc6b1('0x33'))){_0x2bff30[_0xc6b1('0x17')]=qs[_0xc6b1('0x17')](_0x233801[_0xc6b1('0x2b')][_0xc6b1('0x17')]);_0x2bff30[_0xc6b1('0x18')]=qs[_0xc6b1('0x18')](_0x233801[_0xc6b1('0x2b')]['offset']);}return _0x50d5e8[_0xc6b1('0x53')](_0x2bff30);}})[_0xc6b1('0x1f')](function(_0x274f13){if(_0x274f13){return _0x274f13?{'count':_0xdf5c2e,'rows':_0x274f13}:null;}})[_0xc6b1('0x1f')](respondWithResult(_0x3fdfdc,null))[_0xc6b1('0x3f')](handleError(_0x3fdfdc,null));};exports['addAction']=function(_0xa1c994,_0x2922c6,_0x391bff){if(_0xa1c994[_0xc6b1('0x47')]['id']){delete _0xa1c994['body']['id'];}return db[_0xc6b1('0x3b')][_0xc6b1('0x45')]({'where':{'id':_0xa1c994[_0xc6b1('0x41')]['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x2922c6,null))[_0xc6b1('0x1f')](function(_0x494b4f){if(_0x494b4f){_0xa1c994['body'][_0xc6b1('0x54')]=_0x494b4f['id'];return db[_0xc6b1('0x55')][_0xc6b1('0x46')](_0xa1c994['body']);}})[_0xc6b1('0x1f')](respondWithResult(_0x2922c6,null))[_0xc6b1('0x3f')](handleError(_0x2922c6,null));};exports[_0xc6b1('0x56')]=function(_0x59aded,_0x4e3962,_0x4fbf38){var _0x4e6110={};var _0x519065={};var _0x2fda7e;var _0x43716e;return db[_0xc6b1('0x3b')][_0xc6b1('0x52')]({'where':{'id':_0x59aded[_0xc6b1('0x41')]['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x4e3962,null))[_0xc6b1('0x1f')](function(_0x29828c){if(_0x29828c){_0x2fda7e=_0x29828c;_0x519065['model']=_['keys'](db[_0xc6b1('0x55')][_0xc6b1('0x42')]);_0x519065['query']=_[_0xc6b1('0x2c')](_0x59aded[_0xc6b1('0x2b')]);_0x519065['filters']=_['intersection'](_0x519065[_0xc6b1('0x2e')],_0x519065[_0xc6b1('0x2b')]);_0x4e6110['attributes']=_['intersection'](_0x519065[_0xc6b1('0x2e')],qs['fields'](_0x59aded[_0xc6b1('0x2b')][_0xc6b1('0x30')]));_0x4e6110[_0xc6b1('0x32')]=_0x4e6110[_0xc6b1('0x32')][_0xc6b1('0x31')]?_0x4e6110[_0xc6b1('0x32')]:_0x519065[_0xc6b1('0x2e')];_0x4e6110[_0xc6b1('0x34')]=qs[_0xc6b1('0x35')](_0x59aded[_0xc6b1('0x2b')][_0xc6b1('0x35')]);_0x4e6110[_0xc6b1('0x36')]=qs[_0xc6b1('0x2d')](_[_0xc6b1('0x37')](_0x59aded[_0xc6b1('0x2b')],_0x519065[_0xc6b1('0x2d')]));if(_0x59aded[_0xc6b1('0x2b')]['filter']){_0x4e6110[_0xc6b1('0x36')]=_[_0xc6b1('0x39')](_0x4e6110['where'],{'$or':_['map'](_0x4e6110[_0xc6b1('0x32')],function(_0x9f36f6){var _0x4f8768={};_0x4f8768[_0x9f36f6]={'$like':'%'+_0x59aded[_0xc6b1('0x2b')]['filter']+'%'};return _0x4f8768;})});}_0x4e6110=_[_0xc6b1('0x39')]({},_0x4e6110,_0x59aded['options']);return _0x2fda7e[_0xc6b1('0x56')](_0x4e6110);}})['then'](function(_0x23579c){if(_0x23579c){_0x43716e=_0x23579c[_0xc6b1('0x31')];if(!_0x59aded[_0xc6b1('0x2b')][_0xc6b1('0x57')]('nolimit')){_0x4e6110['limit']=qs[_0xc6b1('0x17')](_0x59aded[_0xc6b1('0x2b')]['limit']);_0x4e6110[_0xc6b1('0x18')]=qs[_0xc6b1('0x18')](_0x59aded[_0xc6b1('0x2b')][_0xc6b1('0x18')]);}return _0x2fda7e[_0xc6b1('0x56')](_0x4e6110);}})[_0xc6b1('0x1f')](function(_0x341073){if(_0x341073){return _0x341073?{'count':_0x43716e,'rows':_0x341073}:null;}})['then'](respondWithResult(_0x4e3962,null))['catch'](handleError(_0x4e3962,null));}; \ No newline at end of file +var _0x744a=['includeAll','findAll','rows','catch','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','params','addAllCondition','TriggerAllId','TriggerAnyId','Condition','findOne','getAllConditions','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','Triggers','sendStatus','error','stack','name','send','index','map','Trigger','rawAttributes','key','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options'];(function(_0x1df26e,_0x5488e2){var _0x2c22e4=function(_0x503360){while(--_0x503360){_0x1df26e['push'](_0x1df26e['shift']());}};_0x2c22e4(++_0x5488e2);}(_0x744a,0xd0));var _0xa744=function(_0x5ddaca,_0x10d42f){_0x5ddaca=_0x5ddaca-0x0;var _0x2ed8e0=_0x744a[_0x5ddaca];return _0x2ed8e0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa744('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa744('0x1'));var rp=require(_0xa744('0x2'));var moment=require(_0xa744('0x3'));var BPromise=require(_0xa744('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa744('0x5'));var sox=require(_0xa744('0x6'));var csv=require(_0xa744('0x7'));var ejs=require(_0xa744('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa744('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa744('0xa'));var deskjs=require(_0xa744('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa744('0xc'));var authService=require(_0xa744('0xd'));var qs=require(_0xa744('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa744('0xf'));var logger=require(_0xa744('0x10'))(_0xa744('0x11'));var utils=require(_0xa744('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa744('0x13'));var db=require(_0xa744('0x14'))['db'];function respondWithStatusCode(_0x2726ff,_0xb4d11d){_0xb4d11d=_0xb4d11d||0xcc;return function(_0x5c7096){if(_0x5c7096){return _0x2726ff['sendStatus'](_0xb4d11d);}return _0x2726ff['status'](_0xb4d11d)['end']();};}function respondWithResult(_0xd3b93d,_0x37e74b){_0x37e74b=_0x37e74b||0xc8;return function(_0x38876d){if(_0x38876d){return _0xd3b93d[_0xa744('0x15')](_0x37e74b)['json'](_0x38876d);}};}function respondWithFilteredResult(_0x366075,_0x3c0ee0){return function(_0x2a347f){if(_0x2a347f){var _0x3c1679=typeof _0x3c0ee0[_0xa744('0x16')]===_0xa744('0x17')&&typeof _0x3c0ee0[_0xa744('0x18')]===_0xa744('0x17');var _0x2c6115=_0x2a347f[_0xa744('0x19')];var _0x4a0721=_0x3c1679?0x0:_0x3c0ee0[_0xa744('0x16')];var _0x1b2636=_0x3c1679?_0x2a347f[_0xa744('0x19')]:_0x3c0ee0[_0xa744('0x16')]+_0x3c0ee0[_0xa744('0x18')];var _0x3ec9db;if(_0x1b2636>=_0x2c6115){_0x1b2636=_0x2c6115;_0x3ec9db=0xc8;}else{_0x3ec9db=0xce;}_0x366075[_0xa744('0x15')](_0x3ec9db);return _0x366075[_0xa744('0x1a')](_0xa744('0x1b'),_0x4a0721+'-'+_0x1b2636+'/'+_0x2c6115)[_0xa744('0x1c')](_0x2a347f);}return null;};}function patchUpdates(_0x3666a9){return function(_0x49c577){try{jsonpatch[_0xa744('0x1d')](_0x49c577,_0x3666a9,!![]);}catch(_0x41e658){return BPromise['reject'](_0x41e658);}return _0x49c577[_0xa744('0x1e')]();};}function saveUpdates(_0x6d9258,_0x2108a7){return function(_0x132009){if(_0x132009){return _0x132009[_0xa744('0x1f')](_0x6d9258)[_0xa744('0x20')](function(_0x1b7c56){return _0x1b7c56;});}return null;};}function removeEntity(_0xfc52da,_0x24bc10){return function(_0x269143){if(_0x269143){return _0x269143[_0xa744('0x21')]()['then'](function(){var _0x4125e9=_0x269143['get']({'plain':!![]});var _0x1d3870=_0xa744('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x1d3870,'resourceId':_0x4125e9['id']}})[_0xa744('0x20')](function(){return _0x269143;});})[_0xa744('0x20')](function(){_0xfc52da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e2be2,_0x249317){return function(_0x1eb53e){if(!_0x1eb53e){_0x4e2be2[_0xa744('0x23')](0x194);}return _0x1eb53e;};}function handleError(_0x46cae9,_0x118c1e){_0x118c1e=_0x118c1e||0x1f4;return function(_0x204348){logger[_0xa744('0x24')](_0x204348[_0xa744('0x25')]);if(_0x204348[_0xa744('0x26')]){delete _0x204348[_0xa744('0x26')];}_0x46cae9['status'](_0x118c1e)[_0xa744('0x27')](_0x204348);};}exports[_0xa744('0x28')]=function(_0x4ef1d5,_0x5ae926){var _0x3a38b8={},_0x5d7376={},_0x22ef46={'count':0x0,'rows':[]};var _0x2ec34c=_[_0xa744('0x29')](db[_0xa744('0x2a')][_0xa744('0x2b')],function(_0x20baba){return{'name':_0x20baba['fieldName'],'type':_0x20baba['type'][_0xa744('0x2c')]};});_0x5d7376['model']=_[_0xa744('0x29')](_0x2ec34c,'name');_0x5d7376['query']=_[_0xa744('0x2d')](_0x4ef1d5[_0xa744('0x2e')]);_0x5d7376[_0xa744('0x2f')]=_['intersection'](_0x5d7376[_0xa744('0x30')],_0x5d7376[_0xa744('0x2e')]);_0x3a38b8[_0xa744('0x31')]=_[_0xa744('0x32')](_0x5d7376[_0xa744('0x30')],qs['fields'](_0x4ef1d5[_0xa744('0x2e')][_0xa744('0x33')]));_0x3a38b8[_0xa744('0x31')]=_0x3a38b8[_0xa744('0x31')][_0xa744('0x34')]?_0x3a38b8[_0xa744('0x31')]:_0x5d7376['model'];if(!_0x4ef1d5['query']['hasOwnProperty'](_0xa744('0x35'))){_0x3a38b8[_0xa744('0x18')]=qs['limit'](_0x4ef1d5[_0xa744('0x2e')]['limit']);_0x3a38b8[_0xa744('0x16')]=qs[_0xa744('0x16')](_0x4ef1d5[_0xa744('0x2e')][_0xa744('0x16')]);}_0x3a38b8[_0xa744('0x36')]=qs[_0xa744('0x37')](_0x4ef1d5[_0xa744('0x2e')][_0xa744('0x37')]);_0x3a38b8[_0xa744('0x38')]=qs[_0xa744('0x2f')](_[_0xa744('0x39')](_0x4ef1d5[_0xa744('0x2e')],_0x5d7376['filters']),_0x2ec34c);if(_0x4ef1d5[_0xa744('0x2e')][_0xa744('0x3a')]){_0x3a38b8[_0xa744('0x38')]=_['merge'](_0x3a38b8[_0xa744('0x38')],{'$or':_[_0xa744('0x29')](_0x2ec34c,function(_0x9dbaad){if(_0x9dbaad[_0xa744('0x3b')]!==_0xa744('0x3c')){var _0x50f8d1={};_0x50f8d1[_0x9dbaad[_0xa744('0x26')]]={'$like':'%'+_0x4ef1d5[_0xa744('0x2e')][_0xa744('0x3a')]+'%'};return _0x50f8d1;}})});}_0x3a38b8=_['merge']({},_0x3a38b8,_0x4ef1d5[_0xa744('0x3d')]);var _0x12fc69={'where':_0x3a38b8[_0xa744('0x38')]};return db[_0xa744('0x2a')][_0xa744('0x19')](_0x12fc69)['then'](function(_0x36128d){_0x22ef46[_0xa744('0x19')]=_0x36128d;if(_0x4ef1d5['query'][_0xa744('0x3e')]){_0x3a38b8['include']=[{'all':!![]}];}return db[_0xa744('0x2a')][_0xa744('0x3f')](_0x3a38b8);})[_0xa744('0x20')](function(_0x145e71){_0x22ef46[_0xa744('0x40')]=_0x145e71;return _0x22ef46;})[_0xa744('0x20')](respondWithFilteredResult(_0x5ae926,_0x3a38b8))[_0xa744('0x41')](handleError(_0x5ae926,null));};exports['show']=function(_0xd892c9,_0x2bc5de){var _0x23a030={'raw':![],'where':{'id':_0xd892c9['params']['id']}},_0xbf16ea={};_0xbf16ea[_0xa744('0x30')]=_[_0xa744('0x2d')](db[_0xa744('0x2a')][_0xa744('0x2b')]);_0xbf16ea[_0xa744('0x2e')]=_[_0xa744('0x2d')](_0xd892c9['query']);_0xbf16ea[_0xa744('0x2f')]=_[_0xa744('0x32')](_0xbf16ea[_0xa744('0x30')],_0xbf16ea[_0xa744('0x2e')]);_0x23a030['attributes']=_[_0xa744('0x32')](_0xbf16ea[_0xa744('0x30')],qs[_0xa744('0x33')](_0xd892c9[_0xa744('0x2e')][_0xa744('0x33')]));_0x23a030[_0xa744('0x31')]=_0x23a030[_0xa744('0x31')]['length']?_0x23a030[_0xa744('0x31')]:_0xbf16ea[_0xa744('0x30')];if(_0xd892c9[_0xa744('0x2e')][_0xa744('0x3e')]){_0x23a030['include']=[{'all':!![]}];}_0x23a030=_[_0xa744('0x42')]({},_0x23a030,_0xd892c9[_0xa744('0x3d')]);return db[_0xa744('0x2a')][_0xa744('0x43')](_0x23a030)[_0xa744('0x20')](handleEntityNotFound(_0x2bc5de,null))['then'](respondWithResult(_0x2bc5de,null))[_0xa744('0x41')](handleError(_0x2bc5de,null));};exports[_0xa744('0x44')]=function(_0x2dfbb1,_0x348773){return db[_0xa744('0x2a')][_0xa744('0x44')](_0x2dfbb1[_0xa744('0x45')],{})[_0xa744('0x20')](function(_0x2c1ecf){var _0x512ae2=_0x2dfbb1[_0xa744('0x46')][_0xa744('0x47')]({'plain':!![]});if(!_0x512ae2)throw new Error(_0xa744('0x48'));if(_0x512ae2[_0xa744('0x49')]===_0xa744('0x46')){var _0x1c6745=_0x2c1ecf[_0xa744('0x47')]({'plain':!![]});var _0xbb5db3='Triggers';return db[_0xa744('0x4a')][_0xa744('0x43')]({'where':{'name':_0xbb5db3,'userProfileId':_0x512ae2[_0xa744('0x4b')]},'raw':!![]})[_0xa744('0x20')](function(_0x5c103b){if(_0x5c103b&&_0x5c103b['autoAssociation']===0x0){return db[_0xa744('0x4c')][_0xa744('0x44')]({'name':_0x1c6745[_0xa744('0x26')],'resourceId':_0x1c6745['id'],'type':_0x5c103b[_0xa744('0x26')],'sectionId':_0x5c103b['id']},{})[_0xa744('0x20')](function(){return _0x2c1ecf;});}else{return _0x2c1ecf;}})[_0xa744('0x41')](function(_0x20e44d){logger[_0xa744('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20e44d);throw _0x20e44d;});}return _0x2c1ecf;})[_0xa744('0x20')](respondWithResult(_0x348773,0xc9))[_0xa744('0x41')](handleError(_0x348773,null));};exports[_0xa744('0x1f')]=function(_0x2fa988,_0x3b68fd){if(_0x2fa988[_0xa744('0x45')]['id']){delete _0x2fa988[_0xa744('0x45')]['id'];}return db[_0xa744('0x2a')]['find']({'where':{'id':_0x2fa988[_0xa744('0x4d')]['id']}})[_0xa744('0x20')](handleEntityNotFound(_0x3b68fd,null))['then'](saveUpdates(_0x2fa988[_0xa744('0x45')],null))['then'](respondWithResult(_0x3b68fd,null))[_0xa744('0x41')](handleError(_0x3b68fd,null));};exports[_0xa744('0x21')]=function(_0x54a07c,_0xc34eb5){return db[_0xa744('0x2a')][_0xa744('0x43')]({'where':{'id':_0x54a07c[_0xa744('0x4d')]['id']}})[_0xa744('0x20')](handleEntityNotFound(_0xc34eb5,null))[_0xa744('0x20')](removeEntity(_0xc34eb5,null))[_0xa744('0x41')](handleError(_0xc34eb5,null));};exports[_0xa744('0x4e')]=function(_0x3ec9fb,_0xc17e3b,_0x40920a){if(_0x3ec9fb['body']['id']){delete _0x3ec9fb[_0xa744('0x45')]['id'];}return db[_0xa744('0x2a')][_0xa744('0x43')]({'where':{'id':_0x3ec9fb[_0xa744('0x4d')]['id']}})[_0xa744('0x20')](handleEntityNotFound(_0xc17e3b,null))['then'](function(_0xc73c4e){if(_0xc73c4e){_0x3ec9fb[_0xa744('0x45')][_0xa744('0x4f')]=_0xc73c4e['id'];return db['Condition'][_0xa744('0x44')](_0x3ec9fb[_0xa744('0x45')]);}})[_0xa744('0x20')](respondWithResult(_0xc17e3b,null))[_0xa744('0x41')](handleError(_0xc17e3b,null));};exports['addAnyCondition']=function(_0x1843f3,_0x3db3c2,_0x52c4ce){if(_0x1843f3[_0xa744('0x45')]['id']){delete _0x1843f3[_0xa744('0x45')]['id'];}return db[_0xa744('0x2a')][_0xa744('0x43')]({'where':{'id':_0x1843f3[_0xa744('0x4d')]['id']}})[_0xa744('0x20')](handleEntityNotFound(_0x3db3c2,null))[_0xa744('0x20')](function(_0x4576c8){if(_0x4576c8){_0x1843f3[_0xa744('0x45')][_0xa744('0x50')]=_0x4576c8['id'];return db[_0xa744('0x51')][_0xa744('0x44')](_0x1843f3[_0xa744('0x45')]);}})[_0xa744('0x20')](respondWithResult(_0x3db3c2,null))[_0xa744('0x41')](handleError(_0x3db3c2,null));};exports['getAllConditions']=function(_0x817245,_0x16744e,_0x537fec){var _0x320fbc={};var _0x26b140={};var _0x4e6854;var _0x2e3330;return db[_0xa744('0x2a')][_0xa744('0x52')]({'where':{'id':_0x817245[_0xa744('0x4d')]['id']}})['then'](handleEntityNotFound(_0x16744e,null))['then'](function(_0x1b6051){if(_0x1b6051){_0x4e6854=_0x1b6051;_0x26b140[_0xa744('0x30')]=_[_0xa744('0x2d')](db[_0xa744('0x51')][_0xa744('0x2b')]);_0x26b140[_0xa744('0x2e')]=_[_0xa744('0x2d')](_0x817245[_0xa744('0x2e')]);_0x26b140[_0xa744('0x2f')]=_['intersection'](_0x26b140['model'],_0x26b140[_0xa744('0x2e')]);_0x320fbc['attributes']=_[_0xa744('0x32')](_0x26b140[_0xa744('0x30')],qs[_0xa744('0x33')](_0x817245['query'][_0xa744('0x33')]));_0x320fbc[_0xa744('0x31')]=_0x320fbc['attributes'][_0xa744('0x34')]?_0x320fbc['attributes']:_0x26b140[_0xa744('0x30')];_0x320fbc['order']=qs[_0xa744('0x37')](_0x817245[_0xa744('0x2e')][_0xa744('0x37')]);_0x320fbc[_0xa744('0x38')]=qs['filters'](_['pick'](_0x817245[_0xa744('0x2e')],_0x26b140[_0xa744('0x2f')]));if(_0x817245[_0xa744('0x2e')][_0xa744('0x3a')]){_0x320fbc[_0xa744('0x38')]=_['merge'](_0x320fbc[_0xa744('0x38')],{'$or':_[_0xa744('0x29')](_0x320fbc[_0xa744('0x31')],function(_0xe456ec){var _0x33033f={};_0x33033f[_0xe456ec]={'$like':'%'+_0x817245[_0xa744('0x2e')][_0xa744('0x3a')]+'%'};return _0x33033f;})});}_0x320fbc=_[_0xa744('0x42')]({},_0x320fbc,_0x817245[_0xa744('0x3d')]);return _0x4e6854[_0xa744('0x53')](_0x320fbc);}})['then'](function(_0x10bd98){if(_0x10bd98){_0x2e3330=_0x10bd98[_0xa744('0x34')];if(!_0x817245[_0xa744('0x2e')][_0xa744('0x54')](_0xa744('0x35'))){_0x320fbc[_0xa744('0x18')]=qs[_0xa744('0x18')](_0x817245[_0xa744('0x2e')][_0xa744('0x18')]);_0x320fbc[_0xa744('0x16')]=qs['offset'](_0x817245['query'][_0xa744('0x16')]);}return _0x4e6854[_0xa744('0x53')](_0x320fbc);}})[_0xa744('0x20')](function(_0x1a3e8a){if(_0x1a3e8a){return _0x1a3e8a?{'count':_0x2e3330,'rows':_0x1a3e8a}:null;}})[_0xa744('0x20')](respondWithResult(_0x16744e,null))[_0xa744('0x41')](handleError(_0x16744e,null));};exports[_0xa744('0x55')]=function(_0x4e5584,_0xe9e9f9,_0x52d8f0){var _0xf90ce9={};var _0x22ed2c={};var _0x442309;var _0x467250;return db[_0xa744('0x2a')][_0xa744('0x52')]({'where':{'id':_0x4e5584['params']['id']}})[_0xa744('0x20')](handleEntityNotFound(_0xe9e9f9,null))[_0xa744('0x20')](function(_0x2b5cd8){if(_0x2b5cd8){_0x442309=_0x2b5cd8;_0x22ed2c['model']=_[_0xa744('0x2d')](db['Condition'][_0xa744('0x2b')]);_0x22ed2c['query']=_[_0xa744('0x2d')](_0x4e5584[_0xa744('0x2e')]);_0x22ed2c['filters']=_[_0xa744('0x32')](_0x22ed2c[_0xa744('0x30')],_0x22ed2c['query']);_0xf90ce9['attributes']=_[_0xa744('0x32')](_0x22ed2c['model'],qs[_0xa744('0x33')](_0x4e5584['query'][_0xa744('0x33')]));_0xf90ce9[_0xa744('0x31')]=_0xf90ce9['attributes'][_0xa744('0x34')]?_0xf90ce9[_0xa744('0x31')]:_0x22ed2c[_0xa744('0x30')];_0xf90ce9[_0xa744('0x36')]=qs[_0xa744('0x37')](_0x4e5584[_0xa744('0x2e')]['sort']);_0xf90ce9[_0xa744('0x38')]=qs[_0xa744('0x2f')](_[_0xa744('0x39')](_0x4e5584[_0xa744('0x2e')],_0x22ed2c[_0xa744('0x2f')]));if(_0x4e5584[_0xa744('0x2e')][_0xa744('0x3a')]){_0xf90ce9[_0xa744('0x38')]=_[_0xa744('0x42')](_0xf90ce9[_0xa744('0x38')],{'$or':_['map'](_0xf90ce9[_0xa744('0x31')],function(_0x5cd45d){var _0x56d02c={};_0x56d02c[_0x5cd45d]={'$like':'%'+_0x4e5584['query']['filter']+'%'};return _0x56d02c;})});}_0xf90ce9=_[_0xa744('0x42')]({},_0xf90ce9,_0x4e5584[_0xa744('0x3d')]);return _0x442309[_0xa744('0x55')](_0xf90ce9);}})[_0xa744('0x20')](function(_0x382e40){if(_0x382e40){_0x467250=_0x382e40[_0xa744('0x34')];if(!_0x4e5584[_0xa744('0x2e')][_0xa744('0x54')](_0xa744('0x35'))){_0xf90ce9[_0xa744('0x18')]=qs[_0xa744('0x18')](_0x4e5584[_0xa744('0x2e')]['limit']);_0xf90ce9[_0xa744('0x16')]=qs[_0xa744('0x16')](_0x4e5584[_0xa744('0x2e')][_0xa744('0x16')]);}return _0x442309[_0xa744('0x55')](_0xf90ce9);}})[_0xa744('0x20')](function(_0x419faa){if(_0x419faa){return _0x419faa?{'count':_0x467250,'rows':_0x419faa}:null;}})[_0xa744('0x20')](respondWithResult(_0xe9e9f9,null))[_0xa744('0x41')](handleError(_0xe9e9f9,null));};exports[_0xa744('0x56')]=function(_0x4405e5,_0x2f54f9,_0x711c1e){if(_0x4405e5['body']['id']){delete _0x4405e5[_0xa744('0x45')]['id'];}return db['Trigger'][_0xa744('0x43')]({'where':{'id':_0x4405e5['params']['id']}})[_0xa744('0x20')](handleEntityNotFound(_0x2f54f9,null))[_0xa744('0x20')](function(_0x7c6fbd){if(_0x7c6fbd){_0x4405e5[_0xa744('0x45')][_0xa744('0x57')]=_0x7c6fbd['id'];return db[_0xa744('0x58')]['create'](_0x4405e5[_0xa744('0x45')]);}})[_0xa744('0x20')](respondWithResult(_0x2f54f9,null))[_0xa744('0x41')](handleError(_0x2f54f9,null));};exports[_0xa744('0x59')]=function(_0x417511,_0xcb50a7,_0x4cb13f){var _0x37a43e={};var _0x282344={};var _0x4a9b03;var _0x3d4206;return db[_0xa744('0x2a')]['findOne']({'where':{'id':_0x417511['params']['id']}})[_0xa744('0x20')](handleEntityNotFound(_0xcb50a7,null))['then'](function(_0x46671d){if(_0x46671d){_0x4a9b03=_0x46671d;_0x282344[_0xa744('0x30')]=_[_0xa744('0x2d')](db[_0xa744('0x58')][_0xa744('0x2b')]);_0x282344[_0xa744('0x2e')]=_[_0xa744('0x2d')](_0x417511[_0xa744('0x2e')]);_0x282344[_0xa744('0x2f')]=_['intersection'](_0x282344[_0xa744('0x30')],_0x282344[_0xa744('0x2e')]);_0x37a43e[_0xa744('0x31')]=_[_0xa744('0x32')](_0x282344['model'],qs['fields'](_0x417511[_0xa744('0x2e')][_0xa744('0x33')]));_0x37a43e['attributes']=_0x37a43e[_0xa744('0x31')][_0xa744('0x34')]?_0x37a43e[_0xa744('0x31')]:_0x282344[_0xa744('0x30')];_0x37a43e[_0xa744('0x36')]=qs[_0xa744('0x37')](_0x417511['query'][_0xa744('0x37')]);_0x37a43e[_0xa744('0x38')]=qs['filters'](_[_0xa744('0x39')](_0x417511[_0xa744('0x2e')],_0x282344[_0xa744('0x2f')]));if(_0x417511[_0xa744('0x2e')][_0xa744('0x3a')]){_0x37a43e[_0xa744('0x38')]=_[_0xa744('0x42')](_0x37a43e[_0xa744('0x38')],{'$or':_['map'](_0x37a43e['attributes'],function(_0x35afd3){var _0x25dd1e={};_0x25dd1e[_0x35afd3]={'$like':'%'+_0x417511['query']['filter']+'%'};return _0x25dd1e;})});}_0x37a43e=_['merge']({},_0x37a43e,_0x417511[_0xa744('0x3d')]);return _0x4a9b03[_0xa744('0x59')](_0x37a43e);}})[_0xa744('0x20')](function(_0x43b940){if(_0x43b940){_0x3d4206=_0x43b940[_0xa744('0x34')];if(!_0x417511[_0xa744('0x2e')][_0xa744('0x54')]('nolimit')){_0x37a43e[_0xa744('0x18')]=qs[_0xa744('0x18')](_0x417511['query'][_0xa744('0x18')]);_0x37a43e[_0xa744('0x16')]=qs[_0xa744('0x16')](_0x417511[_0xa744('0x2e')][_0xa744('0x16')]);}return _0x4a9b03[_0xa744('0x59')](_0x37a43e);}})['then'](function(_0x129467){if(_0x129467){return _0x129467?{'count':_0x3d4206,'rows':_0x129467}:null;}})[_0xa744('0x20')](respondWithResult(_0xcb50a7,null))[_0xa744('0x41')](handleError(_0xcb50a7,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 330b948..c1d319d 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 _0xeb5d=['util','../../config/logger','api','moment','path','rimraf','./trigger.attributes','exports','define','Trigger','tools_triggers'];(function(_0x50ba18,_0x4f8c2c){var _0x51883d=function(_0x3c9812){while(--_0x3c9812){_0x50ba18['push'](_0x50ba18['shift']());}};_0x51883d(++_0x4f8c2c);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xeb5d[_0x46698a];return _0x356db0;};'use strict';var _=require('lodash');var util=require(_0xdeb5('0x0'));var logger=require(_0xdeb5('0x1'))(_0xdeb5('0x2'));var moment=require(_0xdeb5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdeb5('0x4'));var rimraf=require(_0xdeb5('0x5'));var config=require('../../config/environment');var attributes=require(_0xdeb5('0x6'));module[_0xdeb5('0x7')]=function(_0x164ecb,_0x33af72){return _0x164ecb[_0xdeb5('0x8')](_0xdeb5('0x9'),attributes,{'tableName':_0xdeb5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c2b=['lodash','util','moment','request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers'];(function(_0x34f756,_0x1ea7ab){var _0x26e745=function(_0x165a65){while(--_0x165a65){_0x34f756['push'](_0x34f756['shift']());}};_0x26e745(++_0x1ea7ab);}(_0x0c2b,0x134));var _0xb0c2=function(_0x9d10b2,_0x32555e){_0x9d10b2=_0x9d10b2-0x0;var _0x1274e8=_0x0c2b[_0x9d10b2];return _0x1274e8;};'use strict';var _=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb0c2('0x2'));var BPromise=require('bluebird');var rp=require(_0xb0c2('0x3'));var fs=require('fs');var path=require(_0xb0c2('0x4'));var rimraf=require(_0xb0c2('0x5'));var config=require(_0xb0c2('0x6'));var attributes=require(_0xb0c2('0x7'));module['exports']=function(_0x514b10,_0x1f0b7e){return _0x514b10[_0xb0c2('0x8')](_0xb0c2('0x9'),attributes,{'tableName':_0xb0c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 1c2e4f8..252f504 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 _0x7c1f=['http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetTrigger','Trigger','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowTrigger','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3c0769,_0xdc3d3b){var _0x31ee62=function(_0x1ad801){while(--_0x1ad801){_0x3c0769['push'](_0x3c0769['shift']());}};_0x31ee62(++_0xdc3d3b);}(_0x7c1f,0x1e7));var _0xf7c1=function(_0x3b0dbe,_0x378ffc){_0x3b0dbe=_0x3b0dbe-0x0;var _0x2ade04=_0x7c1f[_0x3b0dbe];return _0x2ade04;};'use strict';var _=require(_0xf7c1('0x0'));var util=require(_0xf7c1('0x1'));var moment=require(_0xf7c1('0x2'));var BPromise=require('bluebird');var rs=require(_0xf7c1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7c1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7c1('0x5'))('rpc');var config=require(_0xf7c1('0x6'));var jayson=require(_0xf7c1('0x7'));var client=jayson['client'][_0xf7c1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c610f,_0x5ec99a,_0x2a2d37){return new BPromise(function(_0x14e849,_0x3683e5){return client[_0xf7c1('0x9')](_0x1c610f,_0x2a2d37)[_0xf7c1('0xa')](function(_0x4dbcb0){logger[_0xf7c1('0xb')](_0xf7c1('0xc'),_0x5ec99a,_0xf7c1('0xd'));logger[_0xf7c1('0xe')](_0xf7c1('0xf'),_0x5ec99a,'request\x20sent',JSON['stringify'](_0x4dbcb0));if(_0x4dbcb0[_0xf7c1('0x10')]){if(_0x4dbcb0[_0xf7c1('0x10')][_0xf7c1('0x11')]===0x1f4){logger[_0xf7c1('0x10')]('Trigger,\x20%s,\x20%s',_0x5ec99a,_0x4dbcb0[_0xf7c1('0x10')][_0xf7c1('0x12')]);return _0x3683e5(_0x4dbcb0['error'][_0xf7c1('0x12')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x5ec99a,_0x4dbcb0['error']['message']);return _0x14e849(_0x4dbcb0[_0xf7c1('0x10')][_0xf7c1('0x12')]);}else{logger[_0xf7c1('0xb')](_0xf7c1('0xc'),_0x5ec99a,'request\x20sent');_0x14e849(_0x4dbcb0['result']['message']);}})[_0xf7c1('0x13')](function(_0x1eee15){logger['error']('Trigger,\x20%s,\x20%s',_0x5ec99a,_0x1eee15);_0x3683e5(_0x1eee15);});});}exports[_0xf7c1('0x14')]=function(_0x46174d){var _0x1970c7=this;return new Promise(function(_0x10386d,_0x2ecebc){return db[_0xf7c1('0x15')]['findAll']({'raw':_0x46174d[_0xf7c1('0x16')]?_0x46174d[_0xf7c1('0x16')][_0xf7c1('0x17')]===undefined?!![]:![]:!![],'where':_0x46174d[_0xf7c1('0x16')]?_0x46174d[_0xf7c1('0x16')][_0xf7c1('0x18')]||null:null,'attributes':_0x46174d[_0xf7c1('0x16')]?_0x46174d[_0xf7c1('0x16')][_0xf7c1('0x19')]||null:null,'limit':_0x46174d[_0xf7c1('0x16')]?_0x46174d[_0xf7c1('0x16')][_0xf7c1('0x1a')]||null:null,'include':_0x46174d[_0xf7c1('0x16')]?_0x46174d[_0xf7c1('0x16')][_0xf7c1('0x1b')]?_[_0xf7c1('0x1c')](_0x46174d['options'][_0xf7c1('0x1b')],function(_0x4b90f5){return{'model':db[_0x4b90f5[_0xf7c1('0x1d')]],'as':_0x4b90f5['as'],'attributes':_0x4b90f5[_0xf7c1('0x19')],'include':_0x4b90f5[_0xf7c1('0x1b')]?_[_0xf7c1('0x1c')](_0x4b90f5['include'],function(_0x7209b4){return{'model':db[_0x7209b4[_0xf7c1('0x1d')]],'as':_0x7209b4['as'],'attributes':_0x7209b4[_0xf7c1('0x19')],'include':_0x7209b4[_0xf7c1('0x1b')]?_['map'](_0x7209b4['include'],function(_0x3140fd){return{'model':db[_0x3140fd['model']],'as':_0x3140fd['as'],'attributes':_0x3140fd[_0xf7c1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf7c1('0xa')](function(_0x53c3ad){logger[_0xf7c1('0xb')](_0xf7c1('0x14'),_0x46174d);logger['debug'](_0xf7c1('0x14'),_0x46174d,JSON[_0xf7c1('0x1e')](_0x53c3ad));_0x10386d(_0x53c3ad);})[_0xf7c1('0x13')](function(_0x2386d9){logger[_0xf7c1('0x10')](_0xf7c1('0x14'),_0x2386d9[_0xf7c1('0x12')],_0x46174d);_0x2ecebc(_0x1970c7[_0xf7c1('0x10')](0x1f4,_0x2386d9[_0xf7c1('0x12')]));});});};exports['ShowTrigger']=function(_0x162fbd){var _0x1f4ad6=this;return new Promise(function(_0x5d07cc,_0x12f3aa){return db['Trigger'][_0xf7c1('0x1f')]({'raw':_0x162fbd[_0xf7c1('0x16')]?_0x162fbd['options'][_0xf7c1('0x17')]===undefined?!![]:![]:!![],'where':_0x162fbd[_0xf7c1('0x16')]?_0x162fbd['options'][_0xf7c1('0x18')]||null:null,'attributes':_0x162fbd[_0xf7c1('0x16')]?_0x162fbd[_0xf7c1('0x16')]['attributes']||null:null,'include':_0x162fbd['options']?_0x162fbd[_0xf7c1('0x16')]['include']?_[_0xf7c1('0x1c')](_0x162fbd[_0xf7c1('0x16')][_0xf7c1('0x1b')],function(_0x5020f4){return{'model':db[_0x5020f4['model']],'as':_0x5020f4['as'],'attributes':_0x5020f4[_0xf7c1('0x19')],'include':_0x5020f4[_0xf7c1('0x1b')]?_[_0xf7c1('0x1c')](_0x5020f4[_0xf7c1('0x1b')],function(_0x1d9fb5){return{'model':db[_0x1d9fb5[_0xf7c1('0x1d')]],'as':_0x1d9fb5['as'],'attributes':_0x1d9fb5[_0xf7c1('0x19')],'include':_0x1d9fb5[_0xf7c1('0x1b')]?_[_0xf7c1('0x1c')](_0x1d9fb5[_0xf7c1('0x1b')],function(_0x213f9e){return{'model':db[_0x213f9e[_0xf7c1('0x1d')]],'as':_0x213f9e['as'],'attributes':_0x213f9e[_0xf7c1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf7c1('0xa')](function(_0x4ec390){logger['info']('ShowTrigger',_0x162fbd);logger['debug']('ShowTrigger',_0x162fbd,JSON[_0xf7c1('0x1e')](_0x4ec390));_0x5d07cc(_0x4ec390);})[_0xf7c1('0x13')](function(_0x502e91){logger['error'](_0xf7c1('0x20'),_0x502e91[_0xf7c1('0x12')],_0x162fbd);_0x12f3aa(_0x1f4ad6[_0xf7c1('0x10')](0x1f4,_0x502e91['message']));});});}; \ No newline at end of file +var _0x9e34=['debug','stringify','error','code','message','result','GetTrigger','Trigger','findAll','options','where','limit','include','attributes','model','map','then','catch','find','raw','ShowTrigger','lodash','util','moment','bluebird','../../mysqldb','../../config/environment','jayson/promise','http','info','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x9e34,0xf5));var _0x49e3=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x9e34[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x49e3('0x0'));var util=require(_0x49e3('0x1'));var moment=require(_0x49e3('0x2'));var BPromise=require(_0x49e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49e3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x49e3('0x5'));var jayson=require(_0x49e3('0x6'));var client=jayson['client'][_0x49e3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xbb466a,_0x4297ae,_0x2d07fb){return new BPromise(function(_0x5e51e8,_0x1ef7a8){return client['request'](_0xbb466a,_0x2d07fb)['then'](function(_0xb1dc09){logger[_0x49e3('0x8')](_0x49e3('0x9'),_0x4297ae,_0x49e3('0xa'));logger[_0x49e3('0xb')]('Trigger,\x20%s,\x20%s,\x20%s',_0x4297ae,_0x49e3('0xa'),JSON[_0x49e3('0xc')](_0xb1dc09));if(_0xb1dc09[_0x49e3('0xd')]){if(_0xb1dc09[_0x49e3('0xd')][_0x49e3('0xe')]===0x1f4){logger['error'](_0x49e3('0x9'),_0x4297ae,_0xb1dc09[_0x49e3('0xd')][_0x49e3('0xf')]);return _0x1ef7a8(_0xb1dc09[_0x49e3('0xd')]['message']);}logger[_0x49e3('0xd')]('Trigger,\x20%s,\x20%s',_0x4297ae,_0xb1dc09[_0x49e3('0xd')][_0x49e3('0xf')]);return _0x5e51e8(_0xb1dc09[_0x49e3('0xd')][_0x49e3('0xf')]);}else{logger[_0x49e3('0x8')](_0x49e3('0x9'),_0x4297ae,_0x49e3('0xa'));_0x5e51e8(_0xb1dc09[_0x49e3('0x10')][_0x49e3('0xf')]);}})['catch'](function(_0x5a2a04){logger[_0x49e3('0xd')](_0x49e3('0x9'),_0x4297ae,_0x5a2a04);_0x1ef7a8(_0x5a2a04);});});}exports[_0x49e3('0x11')]=function(_0x139534){var _0xe89688=this;return new Promise(function(_0x665cd4,_0x30482c){return db[_0x49e3('0x12')][_0x49e3('0x13')]({'raw':_0x139534[_0x49e3('0x14')]?_0x139534[_0x49e3('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x139534['options']?_0x139534[_0x49e3('0x14')][_0x49e3('0x15')]||null:null,'attributes':_0x139534['options']?_0x139534[_0x49e3('0x14')]['attributes']||null:null,'limit':_0x139534[_0x49e3('0x14')]?_0x139534[_0x49e3('0x14')][_0x49e3('0x16')]||null:null,'include':_0x139534[_0x49e3('0x14')]?_0x139534[_0x49e3('0x14')][_0x49e3('0x17')]?_['map'](_0x139534[_0x49e3('0x14')][_0x49e3('0x17')],function(_0x30ab40){return{'model':db[_0x30ab40['model']],'as':_0x30ab40['as'],'attributes':_0x30ab40[_0x49e3('0x18')],'include':_0x30ab40[_0x49e3('0x17')]?_['map'](_0x30ab40[_0x49e3('0x17')],function(_0x77376b){return{'model':db[_0x77376b[_0x49e3('0x19')]],'as':_0x77376b['as'],'attributes':_0x77376b['attributes'],'include':_0x77376b[_0x49e3('0x17')]?_[_0x49e3('0x1a')](_0x77376b[_0x49e3('0x17')],function(_0xfff92d){return{'model':db[_0xfff92d[_0x49e3('0x19')]],'as':_0xfff92d['as'],'attributes':_0xfff92d[_0x49e3('0x18')]};}):[]};}):[]};}):[]:[]})[_0x49e3('0x1b')](function(_0x54504b){logger[_0x49e3('0x8')]('GetTrigger',_0x139534);logger[_0x49e3('0xb')](_0x49e3('0x11'),_0x139534,JSON['stringify'](_0x54504b));_0x665cd4(_0x54504b);})[_0x49e3('0x1c')](function(_0x2491db){logger[_0x49e3('0xd')](_0x49e3('0x11'),_0x2491db[_0x49e3('0xf')],_0x139534);_0x30482c(_0xe89688['error'](0x1f4,_0x2491db[_0x49e3('0xf')]));});});};exports['ShowTrigger']=function(_0x433dcc){var _0x58bcbe=this;return new Promise(function(_0x150f82,_0x288616){return db[_0x49e3('0x12')][_0x49e3('0x1d')]({'raw':_0x433dcc[_0x49e3('0x14')]?_0x433dcc[_0x49e3('0x14')][_0x49e3('0x1e')]===undefined?!![]:![]:!![],'where':_0x433dcc[_0x49e3('0x14')]?_0x433dcc[_0x49e3('0x14')]['where']||null:null,'attributes':_0x433dcc[_0x49e3('0x14')]?_0x433dcc[_0x49e3('0x14')][_0x49e3('0x18')]||null:null,'include':_0x433dcc[_0x49e3('0x14')]?_0x433dcc['options'][_0x49e3('0x17')]?_[_0x49e3('0x1a')](_0x433dcc[_0x49e3('0x14')]['include'],function(_0x49230e){return{'model':db[_0x49230e[_0x49e3('0x19')]],'as':_0x49230e['as'],'attributes':_0x49230e[_0x49e3('0x18')],'include':_0x49230e['include']?_[_0x49e3('0x1a')](_0x49230e['include'],function(_0x4fdb80){return{'model':db[_0x4fdb80['model']],'as':_0x4fdb80['as'],'attributes':_0x4fdb80[_0x49e3('0x18')],'include':_0x4fdb80[_0x49e3('0x17')]?_['map'](_0x4fdb80['include'],function(_0x147419){return{'model':db[_0x147419['model']],'as':_0x147419['as'],'attributes':_0x147419[_0x49e3('0x18')]};}):[]};}):[]};}):[]:[]})[_0x49e3('0x1b')](function(_0x4b9f3f){logger['info']('ShowTrigger',_0x433dcc);logger['debug'](_0x49e3('0x1f'),_0x433dcc,JSON[_0x49e3('0xc')](_0x4b9f3f));_0x150f82(_0x4b9f3f);})[_0x49e3('0x1c')](function(_0x6d140){logger[_0x49e3('0xd')](_0x49e3('0x1f'),_0x6d140[_0x49e3('0xf')],_0x433dcc);_0x288616(_0x58bcbe[_0x49e3('0xd')](0x1f4,_0x6d140[_0x49e3('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 5944da7..1447e44 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 _0xb06b=['post','/:id/clone','clone','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','/:id','show'];(function(_0x20985a,_0x325008){var _0x49a57d=function(_0x44f6b7){while(--_0x44f6b7){_0x20985a['push'](_0x20985a['shift']());}};_0x49a57d(++_0x325008);}(_0xb06b,0xb0));var _0xbb06=function(_0xa3aafd,_0xbb1a89){_0xa3aafd=_0xa3aafd-0x0;var _0x1d8aa8=_0xb06b[_0xa3aafd];return _0x1d8aa8;};'use strict';var multer=require(_0xbb06('0x0'));var util=require('util');var path=require(_0xbb06('0x1'));var timeout=require(_0xbb06('0x2'));var express=require(_0xbb06('0x3'));var router=express[_0xbb06('0x4')]();var fs_extra=require(_0xbb06('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbb06('0x6'));var config=require(_0xbb06('0x7'));var controller=require(_0xbb06('0x8'));router[_0xbb06('0x9')]('/',auth[_0xbb06('0xa')](),controller['index']);router['get'](_0xbb06('0xb'),auth['isAuthenticated'](),controller[_0xbb06('0xc')]);router[_0xbb06('0xd')](_0xbb06('0xe'),auth[_0xbb06('0xa')](),controller[_0xbb06('0xf')]);router[_0xbb06('0xd')]('/',auth['isAuthenticated'](),controller[_0xbb06('0x10')]);router[_0xbb06('0x11')]('/:id',auth[_0xbb06('0xa')](),controller[_0xbb06('0x12')]);router['delete'](_0xbb06('0xb'),auth[_0xbb06('0xa')](),controller[_0xbb06('0x13')]);module[_0xbb06('0x14')]=router; \ No newline at end of file +var _0x7a38=['create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/:id','show','post','/:id/clone','clone'];(function(_0x374954,_0x18dc36){var _0x42073e=function(_0x1cb45f){while(--_0x1cb45f){_0x374954['push'](_0x374954['shift']());}};_0x42073e(++_0x18dc36);}(_0x7a38,0x1f3));var _0x87a3=function(_0x3c66e6,_0x23433a){_0x3c66e6=_0x3c66e6-0x0;var _0x22f564=_0x7a38[_0x3c66e6];return _0x22f564;};'use strict';var multer=require('multer');var util=require(_0x87a3('0x0'));var path=require(_0x87a3('0x1'));var timeout=require(_0x87a3('0x2'));var express=require(_0x87a3('0x3'));var router=express[_0x87a3('0x4')]();var fs_extra=require(_0x87a3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x87a3('0x6'));var controller=require('./trunk.controller');router[_0x87a3('0x7')]('/',auth[_0x87a3('0x8')](),controller['index']);router[_0x87a3('0x7')](_0x87a3('0x9'),auth[_0x87a3('0x8')](),controller[_0x87a3('0xa')]);router[_0x87a3('0xb')](_0x87a3('0xc'),auth[_0x87a3('0x8')](),controller[_0x87a3('0xd')]);router[_0x87a3('0xb')]('/',auth[_0x87a3('0x8')](),controller[_0x87a3('0xe')]);router[_0x87a3('0xf')]('/:id',auth[_0x87a3('0x8')](),controller['update']);router[_0x87a3('0x10')](_0x87a3('0x9'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x11')]);module[_0x87a3('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 1c81443..39ea421 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 _0x46e1=['outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','pai','passive','actpass','dynamic','sequelize','exports','STRING','name','friend','peer','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','update'];(function(_0x917d9f,_0x143cfe){var _0x26b828=function(_0x376f53){while(--_0x376f53){_0x917d9f['push'](_0x917d9f['shift']());}};_0x26b828(++_0x143cfe);}(_0x46e1,0x1d8));var _0x146e=function(_0x35eb76,_0x5ba493){_0x35eb76=_0x35eb76-0x0;var _0x137d63=_0x46e1[_0x35eb76];return _0x137d63;};'use strict';var Sequelize=require(_0x146e('0x0'));module[_0x146e('0x1')]={'name':{'type':Sequelize[_0x146e('0x2')],'allowNull':![],'unique':_0x146e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x146e('0x4'),'user',_0x146e('0x5')),'allowNull':![],'defaultValue':_0x146e('0x4')},'context':{'type':Sequelize[_0x146e('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x7'),_0x146e('0x8'),_0x146e('0x9'),_0x146e('0xa'),_0x146e('0xb'),'PROHIB_PASSED_SCREEN',_0x146e('0xc'),_0x146e('0xd'))},'deny':{'type':Sequelize[_0x146e('0x2')]},'permit':{'type':Sequelize[_0x146e('0x2')]},'secret':{'type':Sequelize[_0x146e('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x146e('0x2')]},'transport':{'type':Sequelize[_0x146e('0x2')],'defaultValue':_0x146e('0xe'),'set':function(_0x4b39a2){this[_0x146e('0xf')](_0x146e('0x10'),_0x4b39a2?_0x4b39a2[_0x146e('0x11')](','):null);},'get':function(){return this[_0x146e('0x12')](_0x146e('0x10'))?this[_0x146e('0x12')]('transport')[_0x146e('0x13')](','):null;},'comment':_0x146e('0x14')},'dtmfmode':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x15'),_0x146e('0x16'),'shortinfo',_0x146e('0x17'),_0x146e('0x18')),'defaultValue':_0x146e('0x15')},'directmedia':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no',_0x146e('0x1a'),_0x146e('0x1b'),_0x146e('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x146e('0x2')]},'nat':{'type':Sequelize[_0x146e('0x2')],'defaultValue':_0x146e('0x1d'),'set':function(_0x2bda31){this[_0x146e('0xf')](_0x146e('0x1e'),_0x2bda31?_0x2bda31['join'](','):null);},'get':function(){return this[_0x146e('0x12')](_0x146e('0x1e'))?this[_0x146e('0x12')](_0x146e('0x1e'))[_0x146e('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x146e('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x146e('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x146e('0x2')]},'language':{'type':Sequelize[_0x146e('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x146e('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x146e('0x2')],'defaultValue':_0x146e('0x1f')},'allow':{'type':Sequelize[_0x146e('0x2')],'allowNull':![],'defaultValue':_0x146e('0x20'),'set':function(_0x32adbf){this[_0x146e('0xf')](_0x146e('0x21'),_0x32adbf?_0x32adbf['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x146e('0x12')](_0x146e('0x21'))?this[_0x146e('0x12')]('allow')[_0x146e('0x13')](';'):null;},'comment':_0x146e('0x22')},'autoframing':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x146e('0x23'),'set':function(_0x407f4e){this[_0x146e('0xf')](_0x146e('0x24'),_0x407f4e?_0x407f4e['join'](','):null);},'get':function(){return this['getDataValue'](_0x146e('0x24'))?this[_0x146e('0x12')](_0x146e('0x24'))['split'](','):null;},'comment':_0x146e('0x25')},'trustrpid':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no',_0x146e('0x26'))},'promiscredir':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no')},'accountcode':{'type':Sequelize[_0x146e('0x27')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x146e('0x2')],'defaultValue':_0x146e('0x28')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no'),'defaultValue':_0x146e('0x19')},'busylevel':{'type':Sequelize[_0x146e('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x146e('0x6')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x146e('0x2')]},'template':{'type':Sequelize[_0x146e('0x2')]},'videosupport':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no',_0x146e('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x146e('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x2a'),'refuse',_0x146e('0x2b'))},'session_expires':{'type':Sequelize[_0x146e('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x146e('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x2c'),_0x146e('0x2d')),'defaultValue':_0x146e('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0x146e('0x2')]},'regexten':{'type':Sequelize[_0x146e('0x2')]},'fromdomain':{'type':Sequelize[_0x146e('0x2')]},'fromuser':{'type':Sequelize[_0x146e('0x2')]},'port':{'type':Sequelize[_0x146e('0x27')](0x5)},'qualify':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x146e('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x146e('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x146e('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x146e('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x146e('0x6')]('yes','no',_0x146e('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x146e('0x2')]},'callbackextension':{'type':Sequelize[_0x146e('0x2')]},'timert1':{'type':Sequelize[_0x146e('0x27')](0xb)},'timerb':{'type':Sequelize[_0x146e('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x146e('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x146e('0x2')]},'contactdeny':{'type':Sequelize[_0x146e('0x2')]},'contactacl':{'type':Sequelize[_0x146e('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x146e('0x2')]},'use_q850_reason':{'type':Sequelize[_0x146e('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x146e('0x6')]('yes','no')},'force_avp':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'icesupport':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0x146e('0x27')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x146e('0x2')]},'dtlscipher':{'type':Sequelize[_0x146e('0x2')]},'dtlscafile':{'type':Sequelize[_0x146e('0x2')]},'dtlscapath':{'type':Sequelize[_0x146e('0x2')]},'dtlssetup':{'type':Sequelize[_0x146e('0x6')]('active',_0x146e('0x2f'),_0x146e('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x146e('0x2')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x146e('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x146e('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no')},'vmexten':{'type':Sequelize[_0x146e('0x2')]},'mohinterpret':{'type':Sequelize[_0x146e('0x2')]},'mohsuggest':{'type':Sequelize[_0x146e('0x2')]},'parkinglot':{'type':Sequelize[_0x146e('0x2')]},'description':{'type':Sequelize[_0x146e('0x2')]},'host':{'type':Sequelize[_0x146e('0x2')],'defaultValue':_0x146e('0x31')},'canreinvite':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no','nonat',_0x146e('0x1b'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x146e('0x2')]},'otherFields':{'type':Sequelize[_0x146e('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x146e('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x11f7=['getDataValue','info','shortinfo','auto','yes','nonat','update','outgoing','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','sequelize','exports','name','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','STRING','udp','setDataValue','transport'];(function(_0x2f4412,_0x86e2e9){var _0x7272b1=function(_0x3209b7){while(--_0x3209b7){_0x2f4412['push'](_0x2f4412['shift']());}};_0x7272b1(++_0x86e2e9);}(_0x11f7,0x1da));var _0x711f=function(_0x15a717,_0x22a830){_0x15a717=_0x15a717-0x0;var _0x158eaf=_0x11f7[_0x15a717];return _0x158eaf;};'use strict';var Sequelize=require(_0x711f('0x0'));module[_0x711f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x711f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x4'),_0x711f('0x5'),_0x711f('0x6')),'allowNull':![],'defaultValue':_0x711f('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x7'),_0x711f('0x8'),_0x711f('0x9'),'ALLOWED',_0x711f('0xa'),_0x711f('0xb'),'PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0x711f('0xc')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x711f('0xc')]},'md5secret':{'type':Sequelize[_0x711f('0xc')]},'remotesecret':{'type':Sequelize[_0x711f('0xc')]},'transport':{'type':Sequelize[_0x711f('0xc')],'defaultValue':_0x711f('0xd'),'set':function(_0xe836ef){this[_0x711f('0xe')](_0x711f('0xf'),_0xe836ef?_0xe836ef['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x711f('0x10')](_0x711f('0xf'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x711f('0x11'),_0x711f('0x12'),'inband',_0x711f('0x13')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x14'),'no',_0x711f('0x15'),_0x711f('0x16'),_0x711f('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x711f('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x711f('0xc')]},'directmediadeny':{'type':Sequelize[_0x711f('0xc')]},'nat':{'type':Sequelize[_0x711f('0xc')],'defaultValue':'force_rport,comedia','set':function(_0x2ecaa9){this['setDataValue'](_0x711f('0x18'),_0x2ecaa9?_0x2ecaa9[_0x711f('0x19')](','):null);},'get':function(){return this[_0x711f('0x10')](_0x711f('0x18'))?this[_0x711f('0x10')](_0x711f('0x18'))['split'](','):null;},'comment':_0x711f('0x1a')},'callgroup':{'type':Sequelize[_0x711f('0xc')]},'namedcallgroup':{'type':Sequelize[_0x711f('0xc')]},'pickupgroup':{'type':Sequelize[_0x711f('0xc')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x711f('0xc')],'defaultValue':_0x711f('0x1b')},'allow':{'type':Sequelize[_0x711f('0xc')],'allowNull':![],'defaultValue':_0x711f('0x1c'),'set':function(_0x38c11d){this['setDataValue']('allow',_0x38c11d?_0x38c11d['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x711f('0x10')](_0x711f('0x1d'))?this[_0x711f('0x10')](_0x711f('0x1d'))[_0x711f('0x1e')](';'):null;},'comment':_0x711f('0x1f')},'autoframing':{'type':Sequelize[_0x711f('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x711f('0xc')],'defaultValue':_0x711f('0x20'),'set':function(_0xcf6ad0){this['setDataValue'](_0x711f('0x21'),_0xcf6ad0?_0xcf6ad0['join'](','):null);},'get':function(){return this[_0x711f('0x10')](_0x711f('0x21'))?this[_0x711f('0x10')]('insecure')[_0x711f('0x1e')](','):null;},'comment':_0x711f('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x711f('0x14'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x711f('0x14'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x711f('0x3')]('yes','no',_0x711f('0x23'))},'promiscredir':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x14'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0x711f('0x24')](0xb)},'setvar':{'type':Sequelize[_0x711f('0xc')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x711f('0x25')},'amaflags':{'type':Sequelize[_0x711f('0xc')]},'callcounter':{'type':Sequelize['ENUM'](_0x711f('0x14'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x711f('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x14'),'no')},'allowsubscribe':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x14'),'no')},'allowtransfer':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x14'),'no')},'ignoresdpversion':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0x711f('0xc')]},'template':{'type':Sequelize[_0x711f('0xc')]},'videosupport':{'type':Sequelize[_0x711f('0x3')]('yes','no',_0x711f('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x711f('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x14'),'no')},'mailbox':{'type':Sequelize[_0x711f('0xc')]},'session_timers':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x27'),_0x711f('0x28'),_0x711f('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x711f('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x2a'),'uas'),'defaultValue':_0x711f('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x711f('0xc')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x711f('0xc')]},'fromuser':{'type':Sequelize[_0x711f('0xc')]},'port':{'type':Sequelize[_0x711f('0x24')](0x5)},'qualify':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x14'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x711f('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x711f('0xc')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x711f('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x711f('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x711f('0x3')]('yes','no',_0x711f('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x711f('0xc')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x711f('0x24')](0xb)},'timerb':{'type':Sequelize[_0x711f('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x711f('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x711f('0xc')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x711f('0xc')]},'unsolicited_mailbox':{'type':Sequelize[_0x711f('0xc')]},'use_q850_reason':{'type':Sequelize[_0x711f('0xc')]},'maxforwards':{'type':Sequelize[_0x711f('0x24')](0xb)},'encryption':{'type':Sequelize[_0x711f('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x14'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x14'),'no')},'dtlsenable':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x14'),'no')},'dtlsverify':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x14'),'no',_0x711f('0x2d'),_0x711f('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x711f('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x711f('0xc')]},'dtlsprivatekey':{'type':Sequelize[_0x711f('0xc')]},'dtlscipher':{'type':Sequelize[_0x711f('0xc')]},'dtlscafile':{'type':Sequelize[_0x711f('0xc')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0x711f('0x2f'),_0x711f('0x30'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x711f('0xc')]},'usereqphone':{'type':Sequelize[_0x711f('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x711f('0xc')]},'recordofffeature':{'type':Sequelize[_0x711f('0xc')]},'call_limit':{'type':Sequelize[_0x711f('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x711f('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x711f('0x3')](_0x711f('0x14'),'no')},'vmexten':{'type':Sequelize[_0x711f('0xc')]},'mohinterpret':{'type':Sequelize[_0x711f('0xc')]},'mohsuggest':{'type':Sequelize[_0x711f('0xc')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x711f('0xc')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x711f('0x3')]('yes','no',_0x711f('0x15'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x711f('0xc')]},'otherFields':{'type':Sequelize[_0x711f('0xc')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x711f('0xc')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 5945b02..87d77ed 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 _0x54ef=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','get','updatedAt','omit','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','root','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','UserProfileResource','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x372f0a,_0xa4cbb6){var _0x1877a5=function(_0x28785a){while(--_0x28785a){_0x372f0a['push'](_0x372f0a['shift']());}};_0x1877a5(++_0xa4cbb6);}(_0x54ef,0x112));var _0xf54e=function(_0x3205e9,_0x1cb7b8){_0x3205e9=_0x3205e9-0x0;var _0xc0fb17=_0x54ef[_0x3205e9];return _0xc0fb17;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2033e9,_0x28f776,_0x380f26,_0x5644aa){return new BPromise(function(_0x331732,_0x1bbeaa){var _0x1855fe=_0x5644aa||client;return _0x1855fe[_0xf54e('0x1a')](_0x2033e9,_0x380f26)['then'](function(_0x2366ee){logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,'request\x20sent');logger['debug'](_0xf54e('0x1d'),_0x28f776,_0xf54e('0x1e'),JSON[_0xf54e('0x1f')](_0x2366ee));if(_0x2366ee[_0xf54e('0x20')]){if(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x21')]===0x1f4){logger[_0xf54e('0x20')](_0xf54e('0x1c'),_0x28f776,_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);return _0x1bbeaa(_0x2366ee[_0xf54e('0x20')]['message']);}logger['error'](_0xf54e('0x1c'),_0x28f776,_0x2366ee['error'][_0xf54e('0x22')]);return _0x331732(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);}else{logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,_0xf54e('0x1e'));_0x331732(_0x2366ee[_0xf54e('0x23')][_0xf54e('0x22')]);}})[_0xf54e('0x24')](function(_0x5f9eea){logger[_0xf54e('0x20')]('Trunk,\x20%s,\x20%s',_0x28f776,_0x5f9eea);_0x1bbeaa(_0x5f9eea);});});}function respondWithStatusCode(_0x6f6d29,_0x54f914){_0x54f914=_0x54f914||0xcc;return function(_0x264a8f){if(_0x264a8f){return _0x6f6d29[_0xf54e('0x25')](_0x54f914);}return _0x6f6d29[_0xf54e('0x26')](_0x54f914)[_0xf54e('0x27')]();};}function respondWithResult(_0x3805a7,_0x160160){_0x160160=_0x160160||0xc8;return function(_0x1e08d1){if(_0x1e08d1){return _0x3805a7[_0xf54e('0x26')](_0x160160)[_0xf54e('0x28')](_0x1e08d1);}};}function respondWithFilteredResult(_0x33457f,_0xf6cdd7){return function(_0x39c0ae){if(_0x39c0ae){var _0x2ea001=typeof _0xf6cdd7['offset']===_0xf54e('0x29')&&typeof _0xf6cdd7['limit']===_0xf54e('0x29');var _0x5e63f4=_0x39c0ae[_0xf54e('0x2a')];var _0x269f47=_0x2ea001?0x0:_0xf6cdd7[_0xf54e('0x2b')];var _0xa13cd0=_0x2ea001?_0x39c0ae[_0xf54e('0x2a')]:_0xf6cdd7[_0xf54e('0x2b')]+_0xf6cdd7[_0xf54e('0x2c')];var _0x54bd8f;if(_0xa13cd0>=_0x5e63f4){_0xa13cd0=_0x5e63f4;_0x54bd8f=0xc8;}else{_0x54bd8f=0xce;}_0x33457f['status'](_0x54bd8f);return _0x33457f[_0xf54e('0x2d')](_0xf54e('0x2e'),_0x269f47+'-'+_0xa13cd0+'/'+_0x5e63f4)[_0xf54e('0x28')](_0x39c0ae);}return null;};}function patchUpdates(_0x16d00f){return function(_0xb2d4c4){try{jsonpatch[_0xf54e('0x2f')](_0xb2d4c4,_0x16d00f,!![]);}catch(_0x2b5408){return BPromise[_0xf54e('0x30')](_0x2b5408);}return _0xb2d4c4[_0xf54e('0x31')]();};}function saveUpdates(_0x12edc3,_0x5ea0cc){return function(_0x5f29d3){if(_0x5f29d3){return _0x5f29d3[_0xf54e('0x32')](_0x12edc3)[_0xf54e('0x33')](function(_0x4d8fdd){return _0x4d8fdd;});}return null;};}function removeEntity(_0x3e319c,_0x82e313){return function(_0x379110){if(_0x379110){return _0x379110[_0xf54e('0x34')]()['then'](function(){var _0x54bea4=_0x379110['get']({'plain':!![]});var _0x3c0cca=_0xf54e('0x35');return db[_0xf54e('0x36')][_0xf54e('0x34')]({'where':{'type':_0x3c0cca,'resourceId':_0x54bea4['id']}})[_0xf54e('0x33')](function(){return _0x379110;});})[_0xf54e('0x33')](function(){_0x3e319c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x530cee,_0xc04e04){return function(_0x734187){if(!_0x734187){_0x530cee['sendStatus'](0x194);}return _0x734187;};}function handleError(_0x4d9b06,_0xda1d10){_0xda1d10=_0xda1d10||0x1f4;return function(_0x2c0d30){logger[_0xf54e('0x20')](_0x2c0d30['stack']);if(_0x2c0d30[_0xf54e('0x37')]){delete _0x2c0d30[_0xf54e('0x37')];}_0x4d9b06['status'](_0xda1d10)[_0xf54e('0x38')](_0x2c0d30);};}exports[_0xf54e('0x39')]=function(_0x5af03,_0x1eeeb4){var _0x12ef97={},_0x199056={},_0x4e00b7={'count':0x0,'rows':[]};var _0x5d45cf=_[_0xf54e('0x3a')](db[_0xf54e('0x3b')][_0xf54e('0x3c')],function(_0x4b1f84){return{'name':_0x4b1f84[_0xf54e('0x3d')],'type':_0x4b1f84[_0xf54e('0x3e')][_0xf54e('0x3f')]};});_0x199056[_0xf54e('0x40')]=_[_0xf54e('0x3a')](_0x5d45cf,_0xf54e('0x37'));_0x199056[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x5af03[_0xf54e('0x41')]);_0x199056[_0xf54e('0x43')]=_[_0xf54e('0x44')](_0x199056[_0xf54e('0x40')],_0x199056[_0xf54e('0x41')]);_0x12ef97[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x199056['model'],qs['fields'](_0x5af03['query'][_0xf54e('0x46')]));_0x12ef97[_0xf54e('0x45')]=_0x12ef97['attributes'][_0xf54e('0x47')]?_0x12ef97[_0xf54e('0x45')]:_0x199056[_0xf54e('0x40')];if(!_0x5af03['query'][_0xf54e('0x48')](_0xf54e('0x49'))){_0x12ef97[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x2c')]);_0x12ef97[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x5af03[_0xf54e('0x41')]['offset']);}_0x12ef97[_0xf54e('0x4a')]=qs[_0xf54e('0x4b')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x4b')]);_0x12ef97[_0xf54e('0x4c')]=qs[_0xf54e('0x43')](_['pick'](_0x5af03[_0xf54e('0x41')],_0x199056['filters']),_0x5d45cf);if(_0x5af03[_0xf54e('0x41')]['filter']){_0x12ef97[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_0x12ef97[_0xf54e('0x4c')],{'$or':_['map'](_0x5d45cf,function(_0x1af35d){if(_0x1af35d[_0xf54e('0x3e')]!==_0xf54e('0x4e')){var _0x32fb46={};_0x32fb46[_0x1af35d[_0xf54e('0x37')]]={'$like':'%'+_0x5af03['query'][_0xf54e('0x4f')]+'%'};return _0x32fb46;}})});}_0x12ef97=_[_0xf54e('0x4d')]({},_0x12ef97,_0x5af03[_0xf54e('0x50')]);var _0x45592b={'where':_0x12ef97['where']};return db[_0xf54e('0x3b')][_0xf54e('0x2a')](_0x45592b)['then'](function(_0x22c842){_0x4e00b7[_0xf54e('0x2a')]=_0x22c842;if(_0x5af03[_0xf54e('0x41')][_0xf54e('0x51')]){_0x12ef97['include']=[{'all':!![]}];}return db[_0xf54e('0x3b')][_0xf54e('0x52')](_0x12ef97);})[_0xf54e('0x33')](function(_0xb4654f){_0x4e00b7[_0xf54e('0x53')]=_0xb4654f;return _0x4e00b7;})[_0xf54e('0x33')](respondWithFilteredResult(_0x1eeeb4,_0x12ef97))[_0xf54e('0x24')](handleError(_0x1eeeb4,null));};exports[_0xf54e('0x54')]=function(_0x15bfef,_0x21f2f8){var _0xaf9bf0={'raw':![],'where':{'id':_0x15bfef[_0xf54e('0x55')]['id']}},_0x1f4cf8={};_0x1f4cf8[_0xf54e('0x40')]=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x1f4cf8[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x15bfef[_0xf54e('0x41')]);_0x1f4cf8['filters']=_['intersection'](_0x1f4cf8[_0xf54e('0x40')],_0x1f4cf8[_0xf54e('0x41')]);_0xaf9bf0[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x1f4cf8[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x15bfef[_0xf54e('0x41')][_0xf54e('0x46')]));_0xaf9bf0[_0xf54e('0x45')]=_0xaf9bf0[_0xf54e('0x45')][_0xf54e('0x47')]?_0xaf9bf0['attributes']:_0x1f4cf8[_0xf54e('0x40')];if(_0x15bfef[_0xf54e('0x41')][_0xf54e('0x51')]){_0xaf9bf0[_0xf54e('0x56')]=[{'all':!![]}];}_0xaf9bf0=_[_0xf54e('0x4d')]({},_0xaf9bf0,_0x15bfef[_0xf54e('0x50')]);return db[_0xf54e('0x3b')]['find'](_0xaf9bf0)[_0xf54e('0x33')](handleEntityNotFound(_0x21f2f8,null))[_0xf54e('0x33')](respondWithResult(_0x21f2f8,null))[_0xf54e('0x24')](handleError(_0x21f2f8,null));};exports['clone']=function(_0x3ce832,_0x54ac1a){var _0x465a0f={'where':{'id':_0x3ce832[_0xf54e('0x55')]['id']}},_0x400ee0={};_0x400ee0['model']=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x465a0f[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x400ee0[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x3ce832['query']['fields']));_0x465a0f[_0xf54e('0x45')]=_0x465a0f[_0xf54e('0x45')]['length']?_0x465a0f[_0xf54e('0x45')]:_0x400ee0['model'];if(_0x3ce832[_0xf54e('0x41')]['includeAll']){_0x465a0f[_0xf54e('0x56')]=[{'all':!![]}];}_0x465a0f=_[_0xf54e('0x4d')]({},_0x465a0f,_0x3ce832[_0xf54e('0x50')]);return db[_0xf54e('0x3b')][_0xf54e('0x57')](_0x465a0f)[_0xf54e('0x33')](handleEntityNotFound(_0x54ac1a,null))['then'](function(_0x479572){if(_0x479572){var _0x79345=_0x479572[_0xf54e('0x58')]({'plain':!![]});_0x79345=qs['omit'](_0x79345,['id','createdAt',_0xf54e('0x59')]);_0x3ce832['body']=_[_0xf54e('0x5a')](_0x3ce832[_0xf54e('0x5b')],['id',_0xf54e('0x5c'),_0xf54e('0x59')]);return db[_0xf54e('0x3b')][_0xf54e('0x5d')](_[_0xf54e('0x4d')](_0x79345,_0x3ce832[_0xf54e('0x5b')]),{'include':_0x3ce832[_0xf54e('0x41')][_0xf54e('0x51')]?[{'all':!![]}]:undefined})[_0xf54e('0x33')](function(_0x2c6d0e){var _0x65bdf2=_0x3ce832[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x65bdf2)throw new Error(_0xf54e('0x5f'));if(_0x65bdf2[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x11908b=_0x2c6d0e[_0xf54e('0x58')]({'plain':!![]});var _0x494629=_0xf54e('0x35');return db[_0xf54e('0x61')]['find']({'where':{'name':_0x494629,'userProfileId':_0x65bdf2['userProfileId']},'raw':!![]})[_0xf54e('0x33')](function(_0x4b4a2f){if(_0x4b4a2f&&_0x4b4a2f[_0xf54e('0x62')]===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x11908b[_0xf54e('0x37')],'resourceId':_0x11908b['id'],'type':_0x4b4a2f['name'],'sectionId':_0x4b4a2f['id']},{})[_0xf54e('0x33')](function(){return _0x2c6d0e;});}else{return _0x2c6d0e;}})['catch'](function(_0x3800d4){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x3800d4);throw _0x3800d4;});}return _0x2c6d0e;});}})['then'](respondWithResult(_0x54ac1a,0xc9))[_0xf54e('0x24')](handleError(_0x54ac1a,null));};exports['create']=function(_0x3f7224,_0x3e2101,_0x5500d7){var _0x380b4f;return db['Trunk'][_0xf54e('0x5d')](_0x3f7224[_0xf54e('0x5b')],{'raw':!![]})[_0xf54e('0x33')](function(_0x38405c){_0x380b4f=_0x38405c;return db[_0xf54e('0x3b')]['findAll']({'raw':!![]});})[_0xf54e('0x33')](function(_0x1d18d3){var _0x57db6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x309895=fs['readFileSync'](path[_0xf54e('0x65')](config['root'],_0xf54e('0x68')),_0xf54e('0x67'));var _0x5e45e7=ejs[_0xf54e('0x69')](_0x57db6f,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x5e45e7);if(_0x380b4f[_0xf54e('0x6c')]){var _0x38bf71=ejs[_0xf54e('0x69')](_0x309895,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x38bf71);}})[_0xf54e('0x33')](function(){return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x5d'),{'module':'chan_sip.so'});})[_0xf54e('0x33')](function(){var _0x2c20b5=_0x3f7224[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x2c20b5)throw new Error(_0xf54e('0x5f'));if(_0x2c20b5[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x13db3e=_0x380b4f[_0xf54e('0x58')]({'plain':!![]});return db[_0xf54e('0x61')][_0xf54e('0x57')]({'where':{'name':'Trunks','userProfileId':_0x2c20b5[_0xf54e('0x6f')]},'raw':!![]})[_0xf54e('0x33')](function(_0x261c39){if(_0x261c39&&_0x261c39['autoAssociation']===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x13db3e[_0xf54e('0x37')],'resourceId':_0x13db3e['id'],'type':_0x261c39[_0xf54e('0x37')],'sectionId':_0x261c39['id']},{})['then'](function(){return _0x380b4f;});}else{return _0x380b4f;}})['catch'](function(_0x25d05e){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x25d05e);throw _0x25d05e;});}return _0x380b4f;})[_0xf54e('0x33')](respondWithResult(_0x3e2101,0xc9))[_0xf54e('0x24')](handleError(_0x3e2101,null));};exports[_0xf54e('0x32')]=function(_0x35b5a4,_0x3b2a3e,_0xf5108b){var _0x205b47;return db['Trunk'][_0xf54e('0x57')]({'where':{'id':_0x35b5a4[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x3b2a3e,null))[_0xf54e('0x33')](saveUpdates(_0x35b5a4['body'],null))[_0xf54e('0x33')](function(_0x1de6dd){if(_0x1de6dd){_0x205b47=_0x1de6dd;return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});}})['then'](function(_0x394862){if(_0x394862){var _0x4876b5=fs[_0xf54e('0x64')](path['join'](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x1e2834=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config[_0xf54e('0x70')],_0xf54e('0x68')),_0xf54e('0x67'));var _0x8093bc=ejs['render'](_0x4876b5,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x8093bc);var _0x4ce10=ejs[_0xf54e('0x69')](_0x1e2834,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x4ce10);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x32'),{'module':_0xf54e('0x71')});}return null;})[_0xf54e('0x33')](function(_0x11dec2){if(_0x11dec2){return _0x205b47;}})[_0xf54e('0x33')](respondWithResult(_0x3b2a3e,null))['catch'](handleError(_0x3b2a3e,null));};exports[_0xf54e('0x34')]=function(_0x1cfa09,_0x59acbc,_0x4a0614){var _0x85b108;return db[_0xf54e('0x3b')][_0xf54e('0x57')]({'where':{'id':_0x1cfa09[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x59acbc,null))[_0xf54e('0x33')](removeEntity(_0x59acbc,null))[_0xf54e('0x33')](function(){return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});})['then'](function(_0x2bb31f){var _0x3c222a=fs[_0xf54e('0x64')](path['join'](config[_0xf54e('0x70')],'server/files/templates/trunk.ejs'),_0xf54e('0x67'));var _0x57bc6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],'server/files/templates/registry.ejs'),_0xf54e('0x67'));var _0x632240=ejs[_0xf54e('0x69')](_0x3c222a,{'trunks':_0x2bb31f});var _0x406261=ejs[_0xf54e('0x69')](_0x57bc6f,{'trunks':_0x2bb31f});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x632240);fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x406261);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x34'),{'module':_0xf54e('0x71')});})[_0xf54e('0x24')](handleError(_0x59acbc,null));}; \ No newline at end of file +var _0xf3cd=['length','limit','sort','where','filter','merge','options','Trunk','includeAll','include','findAll','show','find','clone','createdAt','updatedAt','omit','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','undefined','offset','count','json','reject','save','update','get','UserProfileResource','destroy','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x1af2ee,_0xe68160){var _0x3c076f=function(_0x5bd903){while(--_0x5bd903){_0x1af2ee['push'](_0x1af2ee['shift']());}};_0x3c076f(++_0xe68160);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5df25b,_0x1bc928){_0x5df25b=_0x5df25b-0x0;var _0x19f252=_0xf3cd[_0x5df25b];return _0x19f252;};'use strict';var emlformat=require(_0xdf3c('0x0'));var rimraf=require(_0xdf3c('0x1'));var zipdir=require(_0xdf3c('0x2'));var jsonpatch=require(_0xdf3c('0x3'));var rp=require(_0xdf3c('0x4'));var moment=require(_0xdf3c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf3c('0x6'));var util=require(_0xdf3c('0x7'));var path=require(_0xdf3c('0x8'));var sox=require('sox');var csv=require(_0xdf3c('0x9'));var ejs=require(_0xdf3c('0xa'));var fs=require('fs');var fs_extra=require(_0xdf3c('0xb'));var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var as=require(_0xdf3c('0x13'));var hardwareService=require(_0xdf3c('0x14'));var logger=require(_0xdf3c('0x15'))(_0xdf3c('0x16'));var utils=require(_0xdf3c('0x17'));var config=require(_0xdf3c('0x18'));var licenseUtil=require(_0xdf3c('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdf3c('0x1a'));var client=jayson[_0xdf3c('0x1b')][_0xdf3c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x17319c,_0x59e431,_0x2ae4ad,_0x461079){return new BPromise(function(_0x13ea5f,_0x5e0047){var _0x18aafa=_0x461079||client;return _0x18aafa[_0xdf3c('0x1d')](_0x17319c,_0x2ae4ad)[_0xdf3c('0x1e')](function(_0x4274fd){logger[_0xdf3c('0x1f')](_0xdf3c('0x20'),_0x59e431,_0xdf3c('0x21'));logger[_0xdf3c('0x22')](_0xdf3c('0x23'),_0x59e431,_0xdf3c('0x21'),JSON['stringify'](_0x4274fd));if(_0x4274fd[_0xdf3c('0x24')]){if(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x25')]===0x1f4){logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x5e0047(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);}logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x13ea5f(_0x4274fd['error']['message']);}else{logger[_0xdf3c('0x1f')]('Trunk,\x20%s,\x20%s',_0x59e431,_0xdf3c('0x21'));_0x13ea5f(_0x4274fd[_0xdf3c('0x27')][_0xdf3c('0x26')]);}})[_0xdf3c('0x28')](function(_0x33652f){logger[_0xdf3c('0x24')]('Trunk,\x20%s,\x20%s',_0x59e431,_0x33652f);_0x5e0047(_0x33652f);});});}function respondWithStatusCode(_0x22a164,_0x213d75){_0x213d75=_0x213d75||0xcc;return function(_0x13e3ca){if(_0x13e3ca){return _0x22a164[_0xdf3c('0x29')](_0x213d75);}return _0x22a164[_0xdf3c('0x2a')](_0x213d75)[_0xdf3c('0x2b')]();};}function respondWithResult(_0xef54cb,_0x155f54){_0x155f54=_0x155f54||0xc8;return function(_0x18cb46){if(_0x18cb46){return _0xef54cb[_0xdf3c('0x2a')](_0x155f54)['json'](_0x18cb46);}};}function respondWithFilteredResult(_0xd284d7,_0x153daa){return function(_0x4b57a4){if(_0x4b57a4){var _0xdc8962=typeof _0x153daa['offset']==='undefined'&&typeof _0x153daa['limit']===_0xdf3c('0x2c');var _0x186bba=_0x4b57a4['count'];var _0x5c3b5a=_0xdc8962?0x0:_0x153daa[_0xdf3c('0x2d')];var _0x1f2ce4=_0xdc8962?_0x4b57a4[_0xdf3c('0x2e')]:_0x153daa[_0xdf3c('0x2d')]+_0x153daa['limit'];var _0x43ce06;if(_0x1f2ce4>=_0x186bba){_0x1f2ce4=_0x186bba;_0x43ce06=0xc8;}else{_0x43ce06=0xce;}_0xd284d7[_0xdf3c('0x2a')](_0x43ce06);return _0xd284d7['set']('Content-Range',_0x5c3b5a+'-'+_0x1f2ce4+'/'+_0x186bba)[_0xdf3c('0x2f')](_0x4b57a4);}return null;};}function patchUpdates(_0x46f0e3){return function(_0x36937e){try{jsonpatch['apply'](_0x36937e,_0x46f0e3,!![]);}catch(_0x2355f6){return BPromise[_0xdf3c('0x30')](_0x2355f6);}return _0x36937e[_0xdf3c('0x31')]();};}function saveUpdates(_0x10099e,_0x575ae1){return function(_0xda0de0){if(_0xda0de0){return _0xda0de0[_0xdf3c('0x32')](_0x10099e)['then'](function(_0x40ae3d){return _0x40ae3d;});}return null;};}function removeEntity(_0x3daeda,_0x217a65){return function(_0x2287f){if(_0x2287f){return _0x2287f['destroy']()[_0xdf3c('0x1e')](function(){var _0x360d5c=_0x2287f[_0xdf3c('0x33')]({'plain':!![]});var _0x3b9ce8='Trunks';return db[_0xdf3c('0x34')][_0xdf3c('0x35')]({'where':{'type':_0x3b9ce8,'resourceId':_0x360d5c['id']}})['then'](function(){return _0x2287f;});})['then'](function(){_0x3daeda[_0xdf3c('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216115,_0x5e8130){return function(_0x57faba){if(!_0x57faba){_0x216115['sendStatus'](0x194);}return _0x57faba;};}function handleError(_0x44a478,_0x2ee9ad){_0x2ee9ad=_0x2ee9ad||0x1f4;return function(_0x1d0b8a){logger[_0xdf3c('0x24')](_0x1d0b8a['stack']);if(_0x1d0b8a['name']){delete _0x1d0b8a[_0xdf3c('0x36')];}_0x44a478['status'](_0x2ee9ad)[_0xdf3c('0x37')](_0x1d0b8a);};}exports[_0xdf3c('0x38')]=function(_0x3628ae,_0xcdd731){var _0x1004e9={},_0x1e0cf2={},_0x1c7335={'count':0x0,'rows':[]};var _0x809f3d=_[_0xdf3c('0x39')](db['Trunk'][_0xdf3c('0x3a')],function(_0x54e689){return{'name':_0x54e689['fieldName'],'type':_0x54e689[_0xdf3c('0x3b')]['key']};});_0x1e0cf2[_0xdf3c('0x3c')]=_['map'](_0x809f3d,_0xdf3c('0x36'));_0x1e0cf2[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x3628ae[_0xdf3c('0x3d')]);_0x1e0cf2[_0xdf3c('0x3f')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],_0x1e0cf2[_0xdf3c('0x3d')]);_0x1004e9[_0xdf3c('0x41')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x3628ae['query']['fields']));_0x1004e9[_0xdf3c('0x41')]=_0x1004e9['attributes'][_0xdf3c('0x43')]?_0x1004e9[_0xdf3c('0x41')]:_0x1e0cf2[_0xdf3c('0x3c')];if(!_0x3628ae[_0xdf3c('0x3d')]['hasOwnProperty']('nolimit')){_0x1004e9[_0xdf3c('0x44')]=qs[_0xdf3c('0x44')](_0x3628ae[_0xdf3c('0x3d')]['limit']);_0x1004e9[_0xdf3c('0x2d')]=qs[_0xdf3c('0x2d')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x2d')]);}_0x1004e9['order']=qs[_0xdf3c('0x45')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x45')]);_0x1004e9[_0xdf3c('0x46')]=qs[_0xdf3c('0x3f')](_['pick'](_0x3628ae[_0xdf3c('0x3d')],_0x1e0cf2[_0xdf3c('0x3f')]),_0x809f3d);if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]){_0x1004e9[_0xdf3c('0x46')]=_[_0xdf3c('0x48')](_0x1004e9['where'],{'$or':_['map'](_0x809f3d,function(_0x2c6c6d){if(_0x2c6c6d[_0xdf3c('0x3b')]!=='VIRTUAL'){var _0x5c9885={};_0x5c9885[_0x2c6c6d[_0xdf3c('0x36')]]={'$like':'%'+_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]+'%'};return _0x5c9885;}})});}_0x1004e9=_[_0xdf3c('0x48')]({},_0x1004e9,_0x3628ae[_0xdf3c('0x49')]);var _0x2dbf54={'where':_0x1004e9[_0xdf3c('0x46')]};return db[_0xdf3c('0x4a')][_0xdf3c('0x2e')](_0x2dbf54)['then'](function(_0x129c2a){_0x1c7335[_0xdf3c('0x2e')]=_0x129c2a;if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x1004e9[_0xdf3c('0x4c')]=[{'all':!![]}];}return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')](_0x1004e9);})['then'](function(_0x1751a8){_0x1c7335['rows']=_0x1751a8;return _0x1c7335;})[_0xdf3c('0x1e')](respondWithFilteredResult(_0xcdd731,_0x1004e9))['catch'](handleError(_0xcdd731,null));};exports[_0xdf3c('0x4e')]=function(_0x28144f,_0x2ec575){var _0x94c5b9={'raw':![],'where':{'id':_0x28144f['params']['id']}},_0x5eef94={};_0x5eef94['model']=_[_0xdf3c('0x3e')](db['Trunk'][_0xdf3c('0x3a')]);_0x5eef94[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x28144f[_0xdf3c('0x3d')]);_0x5eef94[_0xdf3c('0x3f')]=_['intersection'](_0x5eef94['model'],_0x5eef94[_0xdf3c('0x3d')]);_0x94c5b9[_0xdf3c('0x41')]=_['intersection'](_0x5eef94[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x94c5b9[_0xdf3c('0x41')]=_0x94c5b9[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x94c5b9['attributes']:_0x5eef94['model'];if(_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x94c5b9[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x94c5b9=_[_0xdf3c('0x48')]({},_0x94c5b9,_0x28144f[_0xdf3c('0x49')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x94c5b9)[_0xdf3c('0x1e')](handleEntityNotFound(_0x2ec575,null))[_0xdf3c('0x1e')](respondWithResult(_0x2ec575,null))[_0xdf3c('0x28')](handleError(_0x2ec575,null));};exports[_0xdf3c('0x50')]=function(_0x4cb28f,_0x1eebcf){var _0x47cb74={'where':{'id':_0x4cb28f['params']['id']}},_0x5e7247={};_0x5e7247['model']=_['keys'](db[_0xdf3c('0x4a')][_0xdf3c('0x3a')]);_0x47cb74['attributes']=_[_0xdf3c('0x40')](_0x5e7247[_0xdf3c('0x3c')],qs['fields'](_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x47cb74[_0xdf3c('0x41')]=_0x47cb74[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x47cb74[_0xdf3c('0x41')]:_0x5e7247[_0xdf3c('0x3c')];if(_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x47cb74[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x47cb74=_[_0xdf3c('0x48')]({},_0x47cb74,_0x4cb28f['options']);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x47cb74)[_0xdf3c('0x1e')](handleEntityNotFound(_0x1eebcf,null))['then'](function(_0x245c68){if(_0x245c68){var _0x3e327e=_0x245c68[_0xdf3c('0x33')]({'plain':!![]});_0x3e327e=qs['omit'](_0x3e327e,['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);_0x4cb28f['body']=_[_0xdf3c('0x53')](_0x4cb28f['body'],['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_[_0xdf3c('0x48')](_0x3e327e,_0x4cb28f[_0xdf3c('0x55')]),{'include':_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]?[{'all':!![]}]:undefined})[_0xdf3c('0x1e')](function(_0x330730){var _0x283be2=_0x4cb28f[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x283be2)throw new Error(_0xdf3c('0x57'));if(_0x283be2[_0xdf3c('0x58')]===_0xdf3c('0x56')){var _0xd7fb2d=_0x330730['get']({'plain':!![]});var _0x4dade5=_0xdf3c('0x59');return db[_0xdf3c('0x5a')][_0xdf3c('0x4f')]({'where':{'name':_0x4dade5,'userProfileId':_0x283be2['userProfileId']},'raw':!![]})[_0xdf3c('0x1e')](function(_0x5f2765){if(_0x5f2765&&_0x5f2765['autoAssociation']===0x0){return db[_0xdf3c('0x34')][_0xdf3c('0x54')]({'name':_0xd7fb2d[_0xdf3c('0x36')],'resourceId':_0xd7fb2d['id'],'type':_0x5f2765[_0xdf3c('0x36')],'sectionId':_0x5f2765['id']},{})[_0xdf3c('0x1e')](function(){return _0x330730;});}else{return _0x330730;}})[_0xdf3c('0x28')](function(_0x1a31d7){logger[_0xdf3c('0x24')](_0xdf3c('0x5b'),_0x1a31d7);throw _0x1a31d7;});}return _0x330730;});}})[_0xdf3c('0x1e')](respondWithResult(_0x1eebcf,0xc9))[_0xdf3c('0x28')](handleError(_0x1eebcf,null));};exports[_0xdf3c('0x54')]=function(_0x34000c,_0x4be79a,_0x3febac){var _0x2cb0f5;return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_0x34000c[_0xdf3c('0x55')],{'raw':!![]})['then'](function(_0x18bf4f){_0x2cb0f5=_0x18bf4f;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x1efa9c){var _0x50805c=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x5f')),'utf8');var _0xb867a1=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x19c851=ejs['render'](_0x50805c,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x19c851);if(_0x2cb0f5['registry']){var _0x52a2e1=ejs[_0xdf3c('0x64')](_0xb867a1,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x52a2e1);}})[_0xdf3c('0x1e')](function(){return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x54'),{'module':_0xdf3c('0x67')});})[_0xdf3c('0x1e')](function(){var _0x5e6606=_0x34000c[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x5e6606)throw new Error(_0xdf3c('0x57'));if(_0x5e6606['role']===_0xdf3c('0x56')){var _0x354ff4=_0x2cb0f5[_0xdf3c('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xdf3c('0x4f')]({'where':{'name':_0xdf3c('0x59'),'userProfileId':_0x5e6606[_0xdf3c('0x68')]},'raw':!![]})[_0xdf3c('0x1e')](function(_0xe01538){if(_0xe01538&&_0xe01538[_0xdf3c('0x69')]===0x0){return db['UserProfileResource']['create']({'name':_0x354ff4['name'],'resourceId':_0x354ff4['id'],'type':_0xe01538['name'],'sectionId':_0xe01538['id']},{})['then'](function(){return _0x2cb0f5;});}else{return _0x2cb0f5;}})[_0xdf3c('0x28')](function(_0x3f43a0){logger[_0xdf3c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f43a0);throw _0x3f43a0;});}return _0x2cb0f5;})[_0xdf3c('0x1e')](respondWithResult(_0x4be79a,0xc9))[_0xdf3c('0x28')](handleError(_0x4be79a,null));};exports[_0xdf3c('0x32')]=function(_0x51e8c6,_0x591936,_0x233718){var _0x4e3517;return db[_0xdf3c('0x4a')]['find']({'where':{'id':_0x51e8c6[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x591936,null))[_0xdf3c('0x1e')](saveUpdates(_0x51e8c6[_0xdf3c('0x55')],null))['then'](function(_0x5148f6){if(_0x5148f6){_0x4e3517=_0x5148f6;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});}})[_0xdf3c('0x1e')](function(_0x12a7b0){if(_0x12a7b0){var _0x39d9f0=fs[_0xdf3c('0x5c')](path['join'](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x9c761a=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/registry.ejs'),_0xdf3c('0x61'));var _0x5c27cc=ejs[_0xdf3c('0x64')](_0x39d9f0,{'trunks':_0x12a7b0||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x5c27cc);var _0x53b0c3=ejs['render'](_0x9c761a,{'trunks':_0x12a7b0||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x53b0c3);return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x32'),{'module':_0xdf3c('0x67')});}return null;})[_0xdf3c('0x1e')](function(_0x5c8e5e){if(_0x5c8e5e){return _0x4e3517;}})[_0xdf3c('0x1e')](respondWithResult(_0x591936,null))['catch'](handleError(_0x591936,null));};exports[_0xdf3c('0x35')]=function(_0x389708,_0x2e5f82,_0x15a057){var _0x320452;return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')]({'where':{'id':_0x389708[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x2e5f82,null))[_0xdf3c('0x1e')](removeEntity(_0x2e5f82,null))[_0xdf3c('0x1e')](function(){return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x55fd73){var _0x118ab5=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x1c8fe4=fs['readFileSync'](path['join'](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x1aaf8b=ejs[_0xdf3c('0x64')](_0x118ab5,{'trunks':_0x55fd73});var _0x56fc77=ejs[_0xdf3c('0x64')](_0x1c8fe4,{'trunks':_0x55fd73});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x1aaf8b);fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x56fc77);return respondWithRpcPromise(_0xdf3c('0x66'),'destroy',{'module':_0xdf3c('0x67')});})[_0xdf3c('0x28')](handleError(_0x2e5f82,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 3345862..202b5ec 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 _0x1f8c=['Trunk','tools_trunks','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1f8c,0x12e));var _0xc1f8=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0x1f8c[_0x149ca0];return _0x56b6b9;};'use strict';var _=require(_0xc1f8('0x0'));var util=require(_0xc1f8('0x1'));var logger=require('../../config/logger')(_0xc1f8('0x2'));var moment=require(_0xc1f8('0x3'));var BPromise=require(_0xc1f8('0x4'));var rp=require(_0xc1f8('0x5'));var fs=require('fs');var path=require(_0xc1f8('0x6'));var rimraf=require('rimraf');var config=require(_0xc1f8('0x7'));var attributes=require('./trunk.attributes');module[_0xc1f8('0x8')]=function(_0x2af2dc,_0xba8076){return _0x2af2dc[_0xc1f8('0x9')](_0xc1f8('0xa'),attributes,{'tableName':_0xc1f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91e0=['request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash','util','api','bluebird'];(function(_0x60c95d,_0x5474c7){var _0x482950=function(_0x36068a){while(--_0x36068a){_0x60c95d['push'](_0x60c95d['shift']());}};_0x482950(++_0x5474c7);}(_0x91e0,0x68));var _0x091e=function(_0x34dab7,_0xc4d698){_0x34dab7=_0x34dab7-0x0;var _0x39f93f=_0x91e0[_0x34dab7];return _0x39f93f;};'use strict';var _=require(_0x091e('0x0'));var util=require(_0x091e('0x1'));var logger=require('../../config/logger')(_0x091e('0x2'));var moment=require('moment');var BPromise=require(_0x091e('0x3'));var rp=require(_0x091e('0x4'));var fs=require('fs');var path=require(_0x091e('0x5'));var rimraf=require(_0x091e('0x6'));var config=require(_0x091e('0x7'));var attributes=require(_0x091e('0x8'));module[_0x091e('0x9')]=function(_0x169a03,_0x1b55a4){return _0x169a03[_0x091e('0xa')](_0x091e('0xb'),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 28c0514..ced1716 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 _0xa85b=['GetTrunk','Trunk','options','raw','where','attributes','include','map','model','ShowTrunk','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','debug','request\x20sent','stringify','error','message','Trunk,\x20%s,\x20%s','info','result','catch'];(function(_0x11b541,_0x3cf0b6){var _0x5e7a62=function(_0x125b29){while(--_0x125b29){_0x11b541['push'](_0x11b541['shift']());}};_0x5e7a62(++_0x3cf0b6);}(_0xa85b,0x68));var _0xba85=function(_0x25b203,_0x416550){_0x25b203=_0x25b203-0x0;var _0x267fde=_0xa85b[_0x25b203];return _0x267fde;};'use strict';var _=require('lodash');var util=require(_0xba85('0x0'));var moment=require(_0xba85('0x1'));var BPromise=require(_0xba85('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba85('0x3'));var db=require(_0xba85('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xba85('0x5'))(_0xba85('0x6'));var config=require(_0xba85('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba85('0x8')][_0xba85('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d8bc7,_0x261203,_0x4909bd){return new BPromise(function(_0x475d48,_0x4cb050){return client['request'](_0x3d8bc7,_0x4909bd)[_0xba85('0xa')](function(_0x4feddd){logger['info']('Trunk,\x20%s,\x20%s',_0x261203,'request\x20sent');logger[_0xba85('0xb')]('Trunk,\x20%s,\x20%s,\x20%s',_0x261203,_0xba85('0xc'),JSON[_0xba85('0xd')](_0x4feddd));if(_0x4feddd['error']){if(_0x4feddd[_0xba85('0xe')]['code']===0x1f4){logger[_0xba85('0xe')]('Trunk,\x20%s,\x20%s',_0x261203,_0x4feddd['error'][_0xba85('0xf')]);return _0x4cb050(_0x4feddd['error'][_0xba85('0xf')]);}logger['error'](_0xba85('0x10'),_0x261203,_0x4feddd[_0xba85('0xe')][_0xba85('0xf')]);return _0x475d48(_0x4feddd['error']['message']);}else{logger[_0xba85('0x11')](_0xba85('0x10'),_0x261203,_0xba85('0xc'));_0x475d48(_0x4feddd[_0xba85('0x12')][_0xba85('0xf')]);}})[_0xba85('0x13')](function(_0x3282cb){logger[_0xba85('0xe')](_0xba85('0x10'),_0x261203,_0x3282cb);_0x4cb050(_0x3282cb);});});}exports[_0xba85('0x14')]=function(_0x49d24f){var _0x44b7a=this;return new Promise(function(_0x1cc6c0,_0x5f4d34){return db[_0xba85('0x15')]['findAll']({'raw':_0x49d24f['options']?_0x49d24f[_0xba85('0x16')][_0xba85('0x17')]===undefined?!![]:![]:!![],'where':_0x49d24f[_0xba85('0x16')]?_0x49d24f['options'][_0xba85('0x18')]||null:null,'attributes':_0x49d24f['options']?_0x49d24f[_0xba85('0x16')][_0xba85('0x19')]||null:null,'limit':_0x49d24f[_0xba85('0x16')]?_0x49d24f[_0xba85('0x16')]['limit']||null:null,'include':_0x49d24f[_0xba85('0x16')]?_0x49d24f[_0xba85('0x16')][_0xba85('0x1a')]?_[_0xba85('0x1b')](_0x49d24f[_0xba85('0x16')][_0xba85('0x1a')],function(_0x1a3bd5){return{'model':db[_0x1a3bd5[_0xba85('0x1c')]],'as':_0x1a3bd5['as'],'attributes':_0x1a3bd5[_0xba85('0x19')],'include':_0x1a3bd5[_0xba85('0x1a')]?_[_0xba85('0x1b')](_0x1a3bd5[_0xba85('0x1a')],function(_0x1fead6){return{'model':db[_0x1fead6[_0xba85('0x1c')]],'as':_0x1fead6['as'],'attributes':_0x1fead6[_0xba85('0x19')],'include':_0x1fead6[_0xba85('0x1a')]?_[_0xba85('0x1b')](_0x1fead6[_0xba85('0x1a')],function(_0x1cd0d6){return{'model':db[_0x1cd0d6[_0xba85('0x1c')]],'as':_0x1cd0d6['as'],'attributes':_0x1cd0d6[_0xba85('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5721c6){logger[_0xba85('0x11')](_0xba85('0x14'),_0x49d24f);logger[_0xba85('0xb')](_0xba85('0x14'),_0x49d24f,JSON[_0xba85('0xd')](_0x5721c6));_0x1cc6c0(_0x5721c6);})[_0xba85('0x13')](function(_0x4f6e8b){logger[_0xba85('0xe')]('GetTrunk',_0x4f6e8b[_0xba85('0xf')],_0x49d24f);_0x5f4d34(_0x44b7a[_0xba85('0xe')](0x1f4,_0x4f6e8b[_0xba85('0xf')]));});});};exports[_0xba85('0x1d')]=function(_0xae2c3a){var _0x3e70be=this;return new Promise(function(_0x502de4,_0x183f1d){return db[_0xba85('0x15')][_0xba85('0x1e')]({'raw':_0xae2c3a[_0xba85('0x16')]?_0xae2c3a[_0xba85('0x16')][_0xba85('0x17')]===undefined?!![]:![]:!![],'where':_0xae2c3a[_0xba85('0x16')]?_0xae2c3a['options'][_0xba85('0x18')]||null:null,'attributes':_0xae2c3a[_0xba85('0x16')]?_0xae2c3a[_0xba85('0x16')]['attributes']||null:null,'include':_0xae2c3a[_0xba85('0x16')]?_0xae2c3a['options']['include']?_[_0xba85('0x1b')](_0xae2c3a[_0xba85('0x16')][_0xba85('0x1a')],function(_0x459133){return{'model':db[_0x459133['model']],'as':_0x459133['as'],'attributes':_0x459133[_0xba85('0x19')],'include':_0x459133['include']?_[_0xba85('0x1b')](_0x459133[_0xba85('0x1a')],function(_0x1e8cd3){return{'model':db[_0x1e8cd3[_0xba85('0x1c')]],'as':_0x1e8cd3['as'],'attributes':_0x1e8cd3[_0xba85('0x19')],'include':_0x1e8cd3['include']?_[_0xba85('0x1b')](_0x1e8cd3[_0xba85('0x1a')],function(_0x3353c2){return{'model':db[_0x3353c2[_0xba85('0x1c')]],'as':_0x3353c2['as'],'attributes':_0x3353c2[_0xba85('0x19')]};}):[]};}):[]};}):[]:[]})[_0xba85('0xa')](function(_0x4dee32){logger[_0xba85('0x11')](_0xba85('0x1d'),_0xae2c3a);logger[_0xba85('0xb')](_0xba85('0x1d'),_0xae2c3a,JSON[_0xba85('0xd')](_0x4dee32));_0x502de4(_0x4dee32);})[_0xba85('0x13')](function(_0x3ad1ed){logger[_0xba85('0xe')](_0xba85('0x1d'),_0x3ad1ed[_0xba85('0xf')],_0xae2c3a);_0x183f1d(_0x3e70be[_0xba85('0xe')](0x1f4,_0x3ad1ed[_0xba85('0xf')]));});});}; \ No newline at end of file +var _0xb6f0=['debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','attributes','include','map','model','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s'];(function(_0x2285be,_0x39728b){var _0x59ce16=function(_0x24abea){while(--_0x24abea){_0x2285be['push'](_0x2285be['shift']());}};_0x59ce16(++_0x39728b);}(_0xb6f0,0xc2));var _0x0b6f=function(_0x1c4951,_0x2038ee){_0x1c4951=_0x1c4951-0x0;var _0x345e1b=_0xb6f0[_0x1c4951];return _0x345e1b;};'use strict';var _=require(_0x0b6f('0x0'));var util=require(_0x0b6f('0x1'));var moment=require(_0x0b6f('0x2'));var BPromise=require(_0x0b6f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b6f('0x4'));var db=require(_0x0b6f('0x5'))['db'];var utils=require(_0x0b6f('0x6'));var logger=require(_0x0b6f('0x7'))('rpc');var config=require(_0x0b6f('0x8'));var jayson=require(_0x0b6f('0x9'));var client=jayson[_0x0b6f('0xa')][_0x0b6f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2db134,_0x690bcc,_0x41c1ba){return new BPromise(function(_0xf3f869,_0x4f2df8){return client[_0x0b6f('0xc')](_0x2db134,_0x41c1ba)[_0x0b6f('0xd')](function(_0x4a3841){logger[_0x0b6f('0xe')](_0x0b6f('0xf'),_0x690bcc,'request\x20sent');logger[_0x0b6f('0x10')](_0x0b6f('0x11'),_0x690bcc,_0x0b6f('0x12'),JSON[_0x0b6f('0x13')](_0x4a3841));if(_0x4a3841[_0x0b6f('0x14')]){if(_0x4a3841[_0x0b6f('0x14')][_0x0b6f('0x15')]===0x1f4){logger[_0x0b6f('0x14')](_0x0b6f('0xf'),_0x690bcc,_0x4a3841['error'][_0x0b6f('0x16')]);return _0x4f2df8(_0x4a3841[_0x0b6f('0x14')]['message']);}logger[_0x0b6f('0x14')](_0x0b6f('0xf'),_0x690bcc,_0x4a3841[_0x0b6f('0x14')][_0x0b6f('0x16')]);return _0xf3f869(_0x4a3841[_0x0b6f('0x14')][_0x0b6f('0x16')]);}else{logger[_0x0b6f('0xe')](_0x0b6f('0xf'),_0x690bcc,_0x0b6f('0x12'));_0xf3f869(_0x4a3841[_0x0b6f('0x17')][_0x0b6f('0x16')]);}})[_0x0b6f('0x18')](function(_0x44aad8){logger[_0x0b6f('0x14')](_0x0b6f('0xf'),_0x690bcc,_0x44aad8);_0x4f2df8(_0x44aad8);});});}exports[_0x0b6f('0x19')]=function(_0x4bb043){var _0x13dfce=this;return new Promise(function(_0x3c84d9,_0x6c9b6d){return db[_0x0b6f('0x1a')][_0x0b6f('0x1b')]({'raw':_0x4bb043[_0x0b6f('0x1c')]?_0x4bb043['options']['raw']===undefined?!![]:![]:!![],'where':_0x4bb043[_0x0b6f('0x1c')]?_0x4bb043[_0x0b6f('0x1c')]['where']||null:null,'attributes':_0x4bb043[_0x0b6f('0x1c')]?_0x4bb043[_0x0b6f('0x1c')][_0x0b6f('0x1d')]||null:null,'limit':_0x4bb043[_0x0b6f('0x1c')]?_0x4bb043['options']['limit']||null:null,'include':_0x4bb043[_0x0b6f('0x1c')]?_0x4bb043[_0x0b6f('0x1c')][_0x0b6f('0x1e')]?_[_0x0b6f('0x1f')](_0x4bb043[_0x0b6f('0x1c')][_0x0b6f('0x1e')],function(_0x575fbf){return{'model':db[_0x575fbf[_0x0b6f('0x20')]],'as':_0x575fbf['as'],'attributes':_0x575fbf[_0x0b6f('0x1d')],'include':_0x575fbf[_0x0b6f('0x1e')]?_[_0x0b6f('0x1f')](_0x575fbf[_0x0b6f('0x1e')],function(_0x10d811){return{'model':db[_0x10d811[_0x0b6f('0x20')]],'as':_0x10d811['as'],'attributes':_0x10d811[_0x0b6f('0x1d')],'include':_0x10d811[_0x0b6f('0x1e')]?_[_0x0b6f('0x1f')](_0x10d811[_0x0b6f('0x1e')],function(_0x32e62b){return{'model':db[_0x32e62b[_0x0b6f('0x20')]],'as':_0x32e62b['as'],'attributes':_0x32e62b[_0x0b6f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0b6f('0xd')](function(_0x8a1f2c){logger[_0x0b6f('0xe')](_0x0b6f('0x19'),_0x4bb043);logger['debug'](_0x0b6f('0x19'),_0x4bb043,JSON[_0x0b6f('0x13')](_0x8a1f2c));_0x3c84d9(_0x8a1f2c);})[_0x0b6f('0x18')](function(_0x2dc00e){logger[_0x0b6f('0x14')]('GetTrunk',_0x2dc00e[_0x0b6f('0x16')],_0x4bb043);_0x6c9b6d(_0x13dfce[_0x0b6f('0x14')](0x1f4,_0x2dc00e[_0x0b6f('0x16')]));});});};exports['ShowTrunk']=function(_0x18e849){var _0x276dd6=this;return new Promise(function(_0xcaf23f,_0x21ef99){return db[_0x0b6f('0x1a')][_0x0b6f('0x21')]({'raw':_0x18e849[_0x0b6f('0x1c')]?_0x18e849[_0x0b6f('0x1c')][_0x0b6f('0x22')]===undefined?!![]:![]:!![],'where':_0x18e849[_0x0b6f('0x1c')]?_0x18e849[_0x0b6f('0x1c')]['where']||null:null,'attributes':_0x18e849['options']?_0x18e849[_0x0b6f('0x1c')]['attributes']||null:null,'include':_0x18e849[_0x0b6f('0x1c')]?_0x18e849['options'][_0x0b6f('0x1e')]?_['map'](_0x18e849[_0x0b6f('0x1c')][_0x0b6f('0x1e')],function(_0x24c0dd){return{'model':db[_0x24c0dd[_0x0b6f('0x20')]],'as':_0x24c0dd['as'],'attributes':_0x24c0dd[_0x0b6f('0x1d')],'include':_0x24c0dd[_0x0b6f('0x1e')]?_[_0x0b6f('0x1f')](_0x24c0dd[_0x0b6f('0x1e')],function(_0x44d662){return{'model':db[_0x44d662[_0x0b6f('0x20')]],'as':_0x44d662['as'],'attributes':_0x44d662[_0x0b6f('0x1d')],'include':_0x44d662[_0x0b6f('0x1e')]?_[_0x0b6f('0x1f')](_0x44d662[_0x0b6f('0x1e')],function(_0x343a4f){return{'model':db[_0x343a4f[_0x0b6f('0x20')]],'as':_0x343a4f['as'],'attributes':_0x343a4f[_0x0b6f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xad3be7){logger['info']('ShowTrunk',_0x18e849);logger[_0x0b6f('0x10')]('ShowTrunk',_0x18e849,JSON['stringify'](_0xad3be7));_0xcaf23f(_0xad3be7);})['catch'](function(_0x1afacc){logger[_0x0b6f('0x14')]('ShowTrunk',_0x1afacc[_0x0b6f('0x16')],_0x18e849);_0x21ef99(_0x276dd6[_0x0b6f('0x14')](0x1f4,_0x1afacc[_0x0b6f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 7697935..d1a0ca1 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa500=['../../components/auth/service','put','/:id','isAuthenticated','exports','express'];(function(_0x834ebb,_0x2c0032){var _0x41b166=function(_0x1ae6a5){while(--_0x1ae6a5){_0x834ebb['push'](_0x834ebb['shift']());}};_0x41b166(++_0x2c0032);}(_0xa500,0xcb));var _0x0a50=function(_0x23cda2,_0x2f8889){_0x23cda2=_0x23cda2-0x0;var _0x1cb723=_0xa500[_0x23cda2];return _0x1cb723;};'use strict';var express=require(_0x0a50('0x0'));var router=express['Router']();var auth=require(_0x0a50('0x1'));var controller=require('./user-setting.controller');router[_0x0a50('0x2')](_0x0a50('0x3'),auth[_0x0a50('0x4')](),controller['update']);module[_0x0a50('0x5')]=router; \ No newline at end of file +var _0x9c78=['exports','express','Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','update'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x9c78,0xac));var _0x89c7=function(_0x18c9dc,_0x22ca4d){_0x18c9dc=_0x18c9dc-0x0;var _0x2ce3c0=_0x9c78[_0x18c9dc];return _0x2ce3c0;};'use strict';var express=require(_0x89c7('0x0'));var router=express[_0x89c7('0x1')]();var auth=require(_0x89c7('0x2'));var controller=require(_0x89c7('0x3'));router[_0x89c7('0x4')](_0x89c7('0x5'),auth[_0x89c7('0x6')](),controller[_0x89c7('0x7')]);module[_0x89c7('0x8')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index a00de69..35d4f95 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5c2=['error','warning','debug','ENUM','BOOLEAN','DATE','INTEGER','UserId','sequelize'];(function(_0x186d8e,_0x3ad293){var _0x14aa2f=function(_0x2e2a12){while(--_0x2e2a12){_0x186d8e['push'](_0x186d8e['shift']());}};_0x14aa2f(++_0x3ad293);}(_0xa5c2,0x1b8));var _0x2a5c=function(_0x1f1511,_0x4ea911){_0x1f1511=_0x1f1511-0x0;var _0x1d9ab8=_0xa5c2[_0x1f1511];return _0x1d9ab8;};'use strict';var Sequelize=require(_0x2a5c('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x2a5c('0x1'),_0x2a5c('0x2'),'info',_0x2a5c('0x3')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x2a5c('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x2a5c('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x2a5c('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x2a5c('0x7')],'unique':_0x2a5c('0x8')}}; \ No newline at end of file +var _0x0fed=['exports','BOOLEAN','DATE','INTEGER','UserId','sequelize','error','info'];(function(_0x33ee4d,_0x14c274){var _0x1a2de6=function(_0xda37){while(--_0xda37){_0x33ee4d['push'](_0x33ee4d['shift']());}};_0x1a2de6(++_0x14c274);}(_0x0fed,0xad));var _0xd0fe=function(_0x29dd82,_0x3f45c3){_0x29dd82=_0x29dd82-0x0;var _0x272a06=_0x0fed[_0x29dd82];return _0x272a06;};'use strict';var Sequelize=require(_0xd0fe('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xd0fe('0x1'),'warning',_0xd0fe('0x2'),'debug'];module[_0xd0fe('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xd0fe('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd0fe('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd0fe('0x5')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xd0fe('0x6')],'unique':_0xd0fe('0x7')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 775bd41..faa6c3f 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeea0=['catch','lodash','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter','redis','./user-setting.socket','register','defaults','status','json','update','then','sendStatus','error','name','user','role','Invalid\x20user\x20setting\x20id','UserSetting','find','params'];(function(_0x1d6657,_0x20aec2){var _0x134587=function(_0x3fc079){while(--_0x3fc079){_0x1d6657['push'](_0x1d6657['shift']());}};_0x134587(++_0x20aec2);}(_0xeea0,0x91));var _0x0eea=function(_0xc8bec8,_0x1f1632){_0xc8bec8=_0xc8bec8-0x0;var _0x1657d6=_0xeea0[_0xc8bec8];return _0x1657d6;};'use strict';var _=require(_0x0eea('0x0'));var Redis=require(_0x0eea('0x1'));var logger=require(_0x0eea('0x2'))(_0x0eea('0x3'));var config=require(_0x0eea('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0x0eea('0x5'))(new Redis(config[_0x0eea('0x6')]));require(_0x0eea('0x7'))[_0x0eea('0x8')](socket);config[_0x0eea('0x6')]=_[_0x0eea('0x9')](config[_0x0eea('0x6')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x1f8bc9,_0x470ef5){_0x470ef5=_0x470ef5||0xc8;return function(_0x121ab1){if(_0x121ab1){return _0x1f8bc9[_0x0eea('0xa')](_0x470ef5)[_0x0eea('0xb')](_0x121ab1);}};}function saveUpdates(_0x501d00){return function(_0x186884){if(_0x186884){return _0x186884[_0x0eea('0xc')](_0x501d00)[_0x0eea('0xd')](function(_0x14d008){return _0x14d008;});}return null;};}function handleEntityNotFound(_0x550cc0){return function(_0x4fd6b1){if(!_0x4fd6b1){_0x550cc0[_0x0eea('0xe')](0x194);}return _0x4fd6b1;};}function handleError(_0x51bb8c,_0x5ab324){_0x5ab324=_0x5ab324||0x1f4;return function(_0x18e98a){logger[_0x0eea('0xf')](_0x18e98a['stack']);if(_0x18e98a[_0x0eea('0x10')]){delete _0x18e98a['name'];}_0x51bb8c[_0x0eea('0xa')](_0x5ab324)['send'](_0x18e98a);};}exports[_0x0eea('0xc')]=function(_0x56a41d,_0x4cf5a5){if(_0x56a41d[_0x0eea('0x11')][_0x0eea('0x12')]!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x56a41d['params']['id'])))throw new Error(_0x0eea('0x13'));return db[_0x0eea('0x14')][_0x0eea('0x15')]({'where':{'id':_0x56a41d[_0x0eea('0x16')]['id']}})[_0x0eea('0xd')](handleEntityNotFound(_0x4cf5a5,null))[_0x0eea('0xd')](saveUpdates(_0x56a41d['body'],null))[_0x0eea('0xd')](respondWithResult(_0x4cf5a5,null))[_0x0eea('0x17')](handleError(_0x4cf5a5,null));}; \ No newline at end of file +var _0x7daf=['body','catch','ioredis','api','../../config/environment','socket.io-emitter','redis','./user-setting.socket','register','localhost','status','update','then','sendStatus','stack','name','send','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x7daf,0xaa));var _0xf7da=function(_0x20f3a3,_0xe879a){_0x20f3a3=_0x20f3a3-0x0;var _0x4ecd05=_0x7daf[_0x20f3a3];return _0x4ecd05;};'use strict';var _=require('lodash');var Redis=require(_0xf7da('0x0'));var logger=require('../../config/logger')(_0xf7da('0x1'));var config=require(_0xf7da('0x2'));var db=require('../../mysqldb')['db'];var socket=require(_0xf7da('0x3'))(new Redis(config[_0xf7da('0x4')]));require(_0xf7da('0x5'))[_0xf7da('0x6')](socket);config[_0xf7da('0x4')]=_['defaults'](config[_0xf7da('0x4')],{'host':_0xf7da('0x7'),'port':0x18eb});function respondWithResult(_0x1b35ec,_0x110cad){_0x110cad=_0x110cad||0xc8;return function(_0x2c70ad){if(_0x2c70ad){return _0x1b35ec[_0xf7da('0x8')](_0x110cad)['json'](_0x2c70ad);}};}function saveUpdates(_0x3f0f80){return function(_0x3e00f1){if(_0x3e00f1){return _0x3e00f1[_0xf7da('0x9')](_0x3f0f80)[_0xf7da('0xa')](function(_0x305873){return _0x305873;});}return null;};}function handleEntityNotFound(_0x4667b6){return function(_0x209f37){if(!_0x209f37){_0x4667b6[_0xf7da('0xb')](0x194);}return _0x209f37;};}function handleError(_0x363233,_0x2ad574){_0x2ad574=_0x2ad574||0x1f4;return function(_0x514c1e){logger['error'](_0x514c1e[_0xf7da('0xc')]);if(_0x514c1e[_0xf7da('0xd')]){delete _0x514c1e[_0xf7da('0xd')];}_0x363233[_0xf7da('0x8')](_0x2ad574)[_0xf7da('0xe')](_0x514c1e);};}exports[_0xf7da('0x9')]=function(_0x5a1357,_0x2f3841){if(_0x5a1357[_0xf7da('0xf')]['role']!==_0xf7da('0x10'))throw new Error(_0xf7da('0x11'));if(isNaN(Number(_0x5a1357[_0xf7da('0x12')]['id'])))throw new Error(_0xf7da('0x13'));return db[_0xf7da('0x14')][_0xf7da('0x15')]({'where':{'id':_0x5a1357['params']['id']}})['then'](handleEntityNotFound(_0x2f3841,null))['then'](saveUpdates(_0x5a1357[_0xf7da('0x16')],null))[_0xf7da('0xa')](respondWithResult(_0x2f3841,null))[_0xf7da('0x17')](handleError(_0x2f3841,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 6a8a4a4..bc3c352 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc555=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1551af,_0x5223c3){var _0xd8eb82=function(_0x4b133a){while(--_0x4b133a){_0x1551af['push'](_0x1551af['shift']());}};_0xd8eb82(++_0x5223c3);}(_0xc555,0x143));var _0x5c55=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xc555[_0x36eaaa];return _0x461349;};'use strict';var EventEmitter=require(_0x5c55('0x0'));var UserSetting=require('../../mysqldb')['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x5c55('0x1')](0x0);var events={'afterCreate':_0x5c55('0x2'),'afterUpdate':_0x5c55('0x3'),'afterDestroy':_0x5c55('0x4')};function emitEvent(_0x3f0336){return function(_0x1d5077,_0x1e348f,_0x1afb26){UserSettingEvents['emit'](_0x3f0336+':'+_0x1d5077['id'],_0x1d5077);UserSettingEvents[_0x5c55('0x5')](_0x3f0336,_0x1d5077);_0x1afb26(null);};}for(var e in events){if(events[_0x5c55('0x6')](e)){var event=events[e];UserSetting[_0x5c55('0x7')](e,emitEvent(event));}}module[_0x5c55('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x3701=['update','emit','hasOwnProperty','exports','events','../../mysqldb','UserSetting','setMaxListeners'];(function(_0x560f77,_0x3de47c){var _0x2a05e7=function(_0x1c8e5f){while(--_0x1c8e5f){_0x560f77['push'](_0x560f77['shift']());}};_0x2a05e7(++_0x3de47c);}(_0x3701,0x144));var _0x1370=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3701[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x1370('0x0'));var UserSetting=require(_0x1370('0x1'))['db'][_0x1370('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x1370('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1370('0x4'),'afterDestroy':'remove'};function emitEvent(_0x531913){return function(_0x1a595f,_0x12d128,_0x1b33e2){UserSettingEvents[_0x1370('0x5')](_0x531913+':'+_0x1a595f['id'],_0x1a595f);UserSettingEvents[_0x1370('0x5')](_0x531913,_0x1a595f);_0x1b33e2(null);};}for(var e in events){if(events[_0x1370('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x1370('0x7')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 1bcf6d6..3650a25 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf53d=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','UserSetting'];(function(_0x382acd,_0x2d880e){var _0x3c3a76=function(_0x189904){while(--_0x189904){_0x382acd['push'](_0x382acd['shift']());}};_0x3c3a76(++_0x2d880e);}(_0xf53d,0x199));var _0xdf53=function(_0x55648b,_0x3e50e9){_0x55648b=_0x55648b-0x0;var _0x483646=_0xf53d[_0x55648b];return _0x483646;};'use strict';var attributes=require(_0xdf53('0x0'));module[_0xdf53('0x1')]=function(_0x4ee8c2){return _0x4ee8c2[_0xdf53('0x2')](_0xdf53('0x3'),attributes,{'tableName':_0xdf53('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x489d77){if(!_0x489d77[_0xdf53('0x5')])_0x489d77['clientSideLoggingEnabledSince']=null;else if(_0x489d77[_0xdf53('0x6')]===null)_0x489d77['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0xe0c0=['define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x2410c1,_0x42f52d){_0x2410c1=_0x2410c1-0x0;var _0x1a4f5a=_0xe0c0[_0x2410c1];return _0x1a4f5a;};'use strict';var attributes=require(_0x0e0c('0x0'));module['exports']=function(_0x22d512){return _0x22d512[_0x0e0c('0x1')](_0x0e0c('0x2'),attributes,{'tableName':_0x0e0c('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x491fc7){if(!_0x491fc7[_0x0e0c('0x4')])_0x491fc7[_0x0e0c('0x5')]=null;else if(_0x491fc7[_0x0e0c('0x5')]===null)_0x491fc7['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index d0d45de..cce041d 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd82e=['user-setting:update:user-','register','length','user-setting:','save','remove','update','emit'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xd82e,0x10c));var _0xed82=function(_0x4abaee,_0x4218e1){_0x4abaee=_0x4abaee-0x0;var _0x251d10=_0xd82e[_0x4abaee];return _0x251d10;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0xed82('0x0'),_0xed82('0x1'),_0xed82('0x2')];function createListener(_0x4670cb,_0x3cc2d4){return function(_0x4f9af0){_0x3cc2d4['emit'](_0x4670cb,_0x4f9af0);if(_0x4670cb==='user-setting:update'){_0x3cc2d4[_0xed82('0x3')](_0xed82('0x4')+_0x4f9af0['UserId'],_0x4f9af0);}};}exports[_0xed82('0x5')]=function(_0x8f105){for(var _0x4bbd62=0x0,_0x494aba=events[_0xed82('0x6')];_0x4bbd62<_0x494aba;_0x4bbd62++){var _0x2dd32b=events[_0x4bbd62];var _0x50c68a=createListener(_0xed82('0x7')+_0x2dd32b,_0x8f105);UserSettingEvents['on'](_0x2dd32b,_0x50c68a);}}; \ No newline at end of file +var _0x315d=['register','length','remove','update','emit','user-setting:update','UserId'];(function(_0x3a78aa,_0x1f48cb){var _0x492af6=function(_0x1bdbdd){while(--_0x1bdbdd){_0x3a78aa['push'](_0x3a78aa['shift']());}};_0x492af6(++_0x1f48cb);}(_0x315d,0xb1));var _0xd315=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x315d[_0x3dd15e];return _0x231fd0;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=['save',_0xd315('0x0'),_0xd315('0x1')];function createListener(_0x3606d7,_0x14a877){return function(_0x5c308e){_0x14a877[_0xd315('0x2')](_0x3606d7,_0x5c308e);if(_0x3606d7===_0xd315('0x3')){_0x14a877[_0xd315('0x2')]('user-setting:update:user-'+_0x5c308e[_0xd315('0x4')],_0x5c308e);}};}exports[_0xd315('0x5')]=function(_0x51b3cc){for(var _0x40354e=0x0,_0x4a5a2f=events[_0xd315('0x6')];_0x40354e<_0x4a5a2f;_0x40354e++){var _0x391ff6=events[_0x40354e];var _0x4754b1=createListener('user-setting:'+_0x391ff6,_0x51b3cc);UserSettingEvents['on'](_0x391ff6,_0x4754b1);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index c49bf1c..ae836dc 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 _0xd827=['logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','put','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/sms_interactions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout'];(function(_0x510866,_0x3d7247){var _0x2a494a=function(_0x133231){while(--_0x133231){_0x510866['push'](_0x510866['shift']());}};_0x2a494a(++_0x3d7247);}(_0xd827,0x1d6));var _0x7d82=function(_0x354e9d,_0x297682){_0x354e9d=_0x354e9d-0x0;var _0x56711d=_0xd827[_0x354e9d];return _0x56711d;};'use strict';var multer=require(_0x7d82('0x0'));var util=require('util');var path=require(_0x7d82('0x1'));var timeout=require(_0x7d82('0x2'));var express=require('express');var router=express[_0x7d82('0x3')]();var fs_extra=require(_0x7d82('0x4'));var auth=require(_0x7d82('0x5'));var interaction=require(_0x7d82('0x6'));var config=require(_0x7d82('0x7'));var controller=require(_0x7d82('0x8'));router[_0x7d82('0x9')]('/',auth[_0x7d82('0xa')](),controller[_0x7d82('0xb')]);router[_0x7d82('0x9')](_0x7d82('0xc'),auth[_0x7d82('0xa')](),controller[_0x7d82('0xd')]);router['get'](_0x7d82('0xe'),auth[_0x7d82('0xa')](),controller['whoami']);router[_0x7d82('0x9')](_0x7d82('0xf'),auth[_0x7d82('0xa')](),controller['getPresence']);router[_0x7d82('0x9')](_0x7d82('0x10'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x11')]);router['get'](_0x7d82('0x12'),controller[_0x7d82('0x13')]);router[_0x7d82('0x9')](_0x7d82('0x14'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x15')]);router['get'](_0x7d82('0x16'),auth[_0x7d82('0xa')](),controller['getContacts']);router['get'](_0x7d82('0x17'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x18')]);router[_0x7d82('0x9')]('/:id/queues_rt',auth[_0x7d82('0xa')](),controller[_0x7d82('0x19')]);router[_0x7d82('0x9')](_0x7d82('0x1a'),auth[_0x7d82('0xa')](),controller['getGroups']);router['get'](_0x7d82('0x1b'),auth['isAuthenticated'](),controller['getRecordings']);router[_0x7d82('0x9')]('/:id/screen_recordings',auth[_0x7d82('0xa')](),controller[_0x7d82('0x1c')]);router['get'](_0x7d82('0x1d'),auth['isAuthenticated'](),controller['getChatInteractions']);router['get'](_0x7d82('0x1e'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x1f')]);router['get'](_0x7d82('0x20'),auth['isAuthenticated'](),controller[_0x7d82('0x21')]);router[_0x7d82('0x9')](_0x7d82('0x22'),auth['isAuthenticated'](),controller[_0x7d82('0x23')]);router['get'](_0x7d82('0x24'),auth[_0x7d82('0xa')](),controller['getFaxInteractions']);router['get'](_0x7d82('0x25'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x26')]);router[_0x7d82('0x9')](_0x7d82('0x27'),auth[_0x7d82('0xa')](),controller['getTeams']);router[_0x7d82('0x9')](_0x7d82('0x28'),auth[_0x7d82('0xa')](),controller['getLists']);router[_0x7d82('0x9')]('/:id/agents',auth[_0x7d82('0xa')](),controller['getAgents']);router['get'](_0x7d82('0x29'),auth['isAuthenticated'](),controller[_0x7d82('0x2a')]);router[_0x7d82('0x9')](_0x7d82('0x2b'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x2c')]);router['get'](_0x7d82('0x2d'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x2e')]);router[_0x7d82('0x9')](_0x7d82('0x2f'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x30')]);router[_0x7d82('0x9')](_0x7d82('0x31'),auth[_0x7d82('0xa')](),controller['getSmsAccounts']);router[_0x7d82('0x9')](_0x7d82('0x32'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x33')]);router['get'](_0x7d82('0x34'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router['get'](_0x7d82('0x35'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x36')]);router[_0x7d82('0x9')](_0x7d82('0x37'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x38')]);router[_0x7d82('0x39')](_0x7d82('0x16'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x3a')]);router[_0x7d82('0x39')]('/',auth[_0x7d82('0xa')](),controller[_0x7d82('0x3b')]);router['post'](_0x7d82('0x3c'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x3d')]);router['post'](_0x7d82('0x17'),auth[_0x7d82('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0x7d82('0x3e')]({'destination':function(_0x2605ff,_0x49673e,_0x112a96){_0x112a96(null,path[_0x7d82('0x3f')](config[_0x7d82('0x40')],_0x7d82('0x41')));},'filename':function(_0x3e4cf0,_0x38af31,_0x29f670){_0x29f670(null,util[_0x7d82('0x42')](_0x7d82('0x43'),Date[_0x7d82('0x44')](),_0x38af31[_0x7d82('0x45')]));}})});router[_0x7d82('0x39')](_0x7d82('0x12'),upload[_0x7d82('0x46')](_0x7d82('0x47')),controller[_0x7d82('0x48')]);router['post'](_0x7d82('0x49'),auth['isAuthenticated'](),controller['login']);router[_0x7d82('0x39')](_0x7d82('0x4a'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x4b')]);router[_0x7d82('0x39')]('/:id/pause',auth[_0x7d82('0xa')](),controller[_0x7d82('0x4c')]);router['post'](_0x7d82('0x4d'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x4e')]);router[_0x7d82('0x39')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7d82('0x4f')]);router['post'](_0x7d82('0x50'),auth['isAuthenticated'](),controller['addChatInteractions']);router['post'](_0x7d82('0x51'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x52')]);router[_0x7d82('0x39')](_0x7d82('0x53'),auth[_0x7d82('0xa')](),controller['addFaxInteractions']);router[_0x7d82('0x39')]('/:id/sms_interactions',auth[_0x7d82('0xa')](),controller['addSmsInteractions']);router[_0x7d82('0x39')](_0x7d82('0x54'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x55')]);router[_0x7d82('0x39')](_0x7d82('0x56'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x57')]);router[_0x7d82('0x39')](_0x7d82('0x2b'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x58')]);router[_0x7d82('0x39')](_0x7d82('0x2d'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x59')]);router['post'](_0x7d82('0x2f'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x5a')]);router[_0x7d82('0x39')](_0x7d82('0x31'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x5b')]);router[_0x7d82('0x39')](_0x7d82('0x32'),auth['isAuthenticated'](),controller[_0x7d82('0x5c')]);router[_0x7d82('0x39')](_0x7d82('0x34'),auth[_0x7d82('0xa')](),controller['addWhatsappAccounts']);router[_0x7d82('0x39')](_0x7d82('0x37'),auth[_0x7d82('0xa')](),controller['createApiKey']);router[_0x7d82('0x5d')]('/:id',auth[_0x7d82('0xa')](),controller['update']);router[_0x7d82('0x5d')]('/:id/password',auth['isAuthenticated'](),controller[_0x7d82('0x5e')]);router[_0x7d82('0x5f')]('/:id/queues',auth[_0x7d82('0xa')](),controller[_0x7d82('0x60')]);router[_0x7d82('0x5f')](_0x7d82('0x27'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x61')]);router[_0x7d82('0x5f')](_0x7d82('0x10'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x62')]);router[_0x7d82('0x5f')]('/:id/chat_interactions',auth[_0x7d82('0xa')](),controller[_0x7d82('0x63')]);router[_0x7d82('0x5f')](_0x7d82('0x51'),auth[_0x7d82('0xa')](),controller['removeMailInteractions']);router[_0x7d82('0x5f')](_0x7d82('0x53'),auth[_0x7d82('0xa')](),controller['removeFaxInteractions']);router[_0x7d82('0x5f')](_0x7d82('0x64'),auth['isAuthenticated'](),controller[_0x7d82('0x65')]);router[_0x7d82('0x5f')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0x7d82('0x5f')](_0x7d82('0x56'),auth['isAuthenticated'](),controller[_0x7d82('0x66')]);router['delete'](_0x7d82('0x2b'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x67')]);router[_0x7d82('0x5f')]('/:id/mail_accounts',auth[_0x7d82('0xa')](),controller['removeMailAccounts']);router[_0x7d82('0x5f')](_0x7d82('0x2f'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x68')]);router[_0x7d82('0x5f')](_0x7d82('0x31'),auth['isAuthenticated'](),controller[_0x7d82('0x69')]);router[_0x7d82('0x5f')](_0x7d82('0x32'),auth['isAuthenticated'](),controller[_0x7d82('0x6a')]);router[_0x7d82('0x5f')](_0x7d82('0x34'),auth[_0x7d82('0xa')](),controller['removeWhatsappAccounts']);router[_0x7d82('0x5f')]('/:id/api_key',auth[_0x7d82('0xa')](),controller[_0x7d82('0x6b')]);router[_0x7d82('0x39')]('/:id/messengerSoundNotification',auth[_0x7d82('0xa')](),controller['messengerSoundNotification']);module[_0x7d82('0x6c')]=router; \ No newline at end of file +var _0x1186=['removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','/:id/messengerSoundNotification','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','/:id/avatar','getAvatar','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','getLists','getAgents','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','/:id/contacts','addContacts','bulkCreate','/:id/queues','addQueues','join','root','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','/:id/unpause','unpause','/:id/teams','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','put','/:id','update','/:id/password','removeQueues','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x1186,0x75));var _0x6118=function(_0x65931d,_0xfc99da){_0x65931d=_0x65931d-0x0;var _0x1c305f=_0x1186[_0x65931d];return _0x1c305f;};'use strict';var multer=require(_0x6118('0x0'));var util=require(_0x6118('0x1'));var path=require('path');var timeout=require(_0x6118('0x2'));var express=require(_0x6118('0x3'));var router=express['Router']();var fs_extra=require(_0x6118('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6118('0x5'));var config=require('../../config/environment');var controller=require(_0x6118('0x6'));router[_0x6118('0x7')]('/',auth[_0x6118('0x8')](),controller[_0x6118('0x9')]);router['get'](_0x6118('0xa'),auth[_0x6118('0x8')](),controller[_0x6118('0xb')]);router['get']('/whoami',auth[_0x6118('0x8')](),controller[_0x6118('0xc')]);router[_0x6118('0x7')](_0x6118('0xd'),auth[_0x6118('0x8')](),controller['getPresence']);router[_0x6118('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6118('0x7')](_0x6118('0xe'),controller[_0x6118('0xf')]);router['get']('/:id/open_tabs',auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x6118('0x7')]('/:id/contacts',auth[_0x6118('0x8')](),controller['getContacts']);router[_0x6118('0x7')]('/:id/queues',auth[_0x6118('0x8')](),controller[_0x6118('0x10')]);router[_0x6118('0x7')](_0x6118('0x11'),auth[_0x6118('0x8')](),controller[_0x6118('0x12')]);router[_0x6118('0x7')](_0x6118('0x13'),auth[_0x6118('0x8')](),controller[_0x6118('0x14')]);router[_0x6118('0x7')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x6118('0x15')]);router['get'](_0x6118('0x16'),auth['isAuthenticated'](),controller[_0x6118('0x17')]);router[_0x6118('0x7')](_0x6118('0x18'),auth[_0x6118('0x8')](),controller[_0x6118('0x19')]);router[_0x6118('0x7')](_0x6118('0x1a'),auth[_0x6118('0x8')](),controller[_0x6118('0x1b')]);router[_0x6118('0x7')](_0x6118('0x1c'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x6118('0x7')]('/:id/sms/interactions',auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x6118('0x7')]('/:id/fax/interactions',auth[_0x6118('0x8')](),controller[_0x6118('0x1d')]);router[_0x6118('0x7')](_0x6118('0x1e'),auth['isAuthenticated'](),controller[_0x6118('0x1f')]);router[_0x6118('0x7')]('/:id/teams',auth['isAuthenticated'](),controller[_0x6118('0x20')]);router['get']('/:id/lists',auth[_0x6118('0x8')](),controller[_0x6118('0x21')]);router[_0x6118('0x7')]('/:id/agents',auth[_0x6118('0x8')](),controller[_0x6118('0x22')]);router[_0x6118('0x7')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x6118('0x23')]);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x6118('0x24')]);router[_0x6118('0x7')](_0x6118('0x25'),auth[_0x6118('0x8')](),controller['getMailAccounts']);router[_0x6118('0x7')](_0x6118('0x26'),auth[_0x6118('0x8')](),controller[_0x6118('0x27')]);router['get'](_0x6118('0x28'),auth[_0x6118('0x8')](),controller[_0x6118('0x29')]);router[_0x6118('0x7')](_0x6118('0x2a'),auth[_0x6118('0x8')](),controller[_0x6118('0x2b')]);router['get']('/:id/whatsapp_accounts',auth[_0x6118('0x8')](),controller[_0x6118('0x2c')]);router[_0x6118('0x7')](_0x6118('0x2d'),auth['isAuthenticated'](),controller[_0x6118('0x2e')]);router[_0x6118('0x7')](_0x6118('0x2f'),auth[_0x6118('0x8')](),controller['getApiKey']);router[_0x6118('0x30')](_0x6118('0x31'),auth[_0x6118('0x8')](),controller[_0x6118('0x32')]);router[_0x6118('0x30')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6118('0x30')]('/create_many',auth['isAuthenticated'](),controller[_0x6118('0x33')]);router['post'](_0x6118('0x34'),auth[_0x6118('0x8')](),controller[_0x6118('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c49ae,_0x57527b,_0x102de5){_0x102de5(null,path[_0x6118('0x36')](config[_0x6118('0x37')],'server/files/images/'));},'filename':function(_0x3bc816,_0x4b73a4,_0x4e6e60){_0x4e6e60(null,util[_0x6118('0x38')](_0x6118('0x39'),Date[_0x6118('0x3a')](),_0x4b73a4[_0x6118('0x3b')]));}})});router[_0x6118('0x30')]('/:id/avatar',upload[_0x6118('0x3c')](_0x6118('0x3d')),controller[_0x6118('0x3e')]);router['post'](_0x6118('0x3f'),auth[_0x6118('0x8')](),controller['login']);router[_0x6118('0x30')](_0x6118('0x40'),auth['isAuthenticated'](),controller[_0x6118('0x41')]);router[_0x6118('0x30')](_0x6118('0x42'),auth[_0x6118('0x8')](),controller['pause']);router['post'](_0x6118('0x43'),auth[_0x6118('0x8')](),controller[_0x6118('0x44')]);router[_0x6118('0x30')](_0x6118('0x45'),auth['isAuthenticated'](),controller[_0x6118('0x46')]);router[_0x6118('0x30')]('/:id/chat_interactions',auth[_0x6118('0x8')](),controller[_0x6118('0x47')]);router[_0x6118('0x30')](_0x6118('0x48'),auth[_0x6118('0x8')](),controller[_0x6118('0x49')]);router['post'](_0x6118('0x4a'),auth[_0x6118('0x8')](),controller['addFaxInteractions']);router[_0x6118('0x30')](_0x6118('0x4b'),auth[_0x6118('0x8')](),controller[_0x6118('0x4c')]);router[_0x6118('0x30')](_0x6118('0x4d'),auth[_0x6118('0x8')](),controller['addOpenchannelInteractions']);router['post'](_0x6118('0x4e'),auth[_0x6118('0x8')](),controller[_0x6118('0x4f')]);router[_0x6118('0x30')](_0x6118('0x50'),auth[_0x6118('0x8')](),controller[_0x6118('0x51')]);router[_0x6118('0x30')]('/:id/mail_accounts',auth[_0x6118('0x8')](),controller[_0x6118('0x52')]);router[_0x6118('0x30')](_0x6118('0x26'),auth[_0x6118('0x8')](),controller[_0x6118('0x53')]);router['post'](_0x6118('0x28'),auth[_0x6118('0x8')](),controller[_0x6118('0x54')]);router[_0x6118('0x30')](_0x6118('0x2a'),auth[_0x6118('0x8')](),controller[_0x6118('0x55')]);router[_0x6118('0x30')](_0x6118('0x56'),auth['isAuthenticated'](),controller[_0x6118('0x57')]);router['post'](_0x6118('0x2f'),auth['isAuthenticated'](),controller[_0x6118('0x58')]);router[_0x6118('0x59')](_0x6118('0x5a'),auth['isAuthenticated'](),controller[_0x6118('0x5b')]);router[_0x6118('0x59')](_0x6118('0x5c'),auth[_0x6118('0x8')](),controller['changePassword']);router['delete'](_0x6118('0x34'),auth[_0x6118('0x8')](),controller[_0x6118('0x5d')]);router[_0x6118('0x5e')]('/:id/teams',auth[_0x6118('0x8')](),controller[_0x6118('0x5f')]);router[_0x6118('0x5e')](_0x6118('0x5a'),auth['isAuthenticated'](),controller[_0x6118('0x60')]);router[_0x6118('0x5e')](_0x6118('0x61'),auth['isAuthenticated'](),controller[_0x6118('0x62')]);router['delete'](_0x6118('0x48'),auth[_0x6118('0x8')](),controller['removeMailInteractions']);router[_0x6118('0x5e')](_0x6118('0x4a'),auth['isAuthenticated'](),controller[_0x6118('0x63')]);router[_0x6118('0x5e')](_0x6118('0x4b'),auth[_0x6118('0x8')](),controller[_0x6118('0x64')]);router[_0x6118('0x5e')]('/:id/openchannel_interactions',auth[_0x6118('0x8')](),controller[_0x6118('0x65')]);router[_0x6118('0x5e')](_0x6118('0x4e'),auth[_0x6118('0x8')](),controller[_0x6118('0x66')]);router[_0x6118('0x5e')](_0x6118('0x50'),auth[_0x6118('0x8')](),controller[_0x6118('0x67')]);router['delete'](_0x6118('0x25'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x6118('0x5e')](_0x6118('0x26'),auth['isAuthenticated'](),controller[_0x6118('0x68')]);router[_0x6118('0x5e')](_0x6118('0x28'),auth[_0x6118('0x8')](),controller[_0x6118('0x69')]);router[_0x6118('0x5e')](_0x6118('0x2a'),auth[_0x6118('0x8')](),controller[_0x6118('0x6a')]);router[_0x6118('0x5e')](_0x6118('0x56'),auth[_0x6118('0x8')](),controller[_0x6118('0x6b')]);router[_0x6118('0x5e')](_0x6118('0x2f'),auth[_0x6118('0x8')](),controller['removeApiKey']);router[_0x6118('0x30')](_0x6118('0x6c'),auth[_0x6118('0x8')](),controller['messengerSoundNotification']);module[_0x6118('0x6d')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index c35f08e..0579149 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 _0x18da=['uas','fingerprint','active','actpass','nonat','update','TEXT','showWebBar','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlssetup','dtlsprivatekey','icesupport','dtlsverify','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','true','false','screenrecording','blockedAt','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','getDataValue','email','toLowerCase','admin','telephone','local','INTEGER','internal','accountcode','\x22%s\x22\x20<%s>','fullname','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','rfc2833','info','shortinfo','inband','auto','yes','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','accept','refuse','uac'];(function(_0x545842,_0x511093){var _0x5a5410=function(_0xee4e34){while(--_0xee4e34){_0x545842['push'](_0x545842['shift']());}};_0x5a5410(++_0x511093);}(_0x18da,0x128));var _0xa18d=function(_0x4064e6,_0x595ecd){_0x4064e6=_0x4064e6-0x0;var _0x179152=_0x18da[_0x4064e6];return _0x179152;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa18d('0x0'));var util=require(_0xa18d('0x1'));var _=require(_0xa18d('0x2'));module[_0xa18d('0x3')]={'name':{'type':Sequelize[_0xa18d('0x4')],'allowNull':![],'unique':_0xa18d('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x426895){this[_0xa18d('0x6')](_0xa18d('0x5'),_0x426895);this['setDataValue'](_0xa18d('0x7'),_0x426895);},'comment':_0xa18d('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x45a4b8){this['setDataValue']('fullname',_0x45a4b8);this[_0xa18d('0x6')](_0xa18d('0x9'),util[_0xa18d('0xa')]('\x22%s\x22\x20<%s>',_0x45a4b8,this[_0xa18d('0xb')]('internal')));}},'alias':{'type':Sequelize[_0xa18d('0x4')]},'email':{'type':Sequelize[_0xa18d('0x4')],'allowNull':![],'unique':_0xa18d('0xc'),'validate':{'isEmail':!![]},'set':function(_0x223327){if(_0x223327){this[_0xa18d('0x6')](_0xa18d('0xc'),_0x223327[_0xa18d('0xd')]());}}},'role':{'type':Sequelize['ENUM'](_0xa18d('0xe'),'user','agent',_0xa18d('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0xa18d('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xa18d('0x4')],'defaultValue':_0xa18d('0x10')},'internal':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':![],'unique':_0xa18d('0x12'),'set':function(_0x4fd417){this[_0xa18d('0x6')](_0xa18d('0x12'),_0x4fd417);this[_0xa18d('0x6')](_0xa18d('0x13'),_0x4fd417);this['setDataValue'](_0xa18d('0x9'),util[_0xa18d('0xa')](_0xa18d('0x14'),this[_0xa18d('0xb')](_0xa18d('0x15')),_0x4fd417));}},'salt':{'type':Sequelize[_0xa18d('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xa18d('0x4')]},'address':{'type':Sequelize[_0xa18d('0x4')]},'zipcode':{'type':Sequelize[_0xa18d('0x4')]},'userpic':{'type':Sequelize[_0xa18d('0x4')]},'city':{'type':Sequelize[_0xa18d('0x4')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xa18d('0x4')],'defaultValue':_0xa18d('0x17')},'lastPauseAt':{'type':Sequelize[_0xa18d('0x18')]},'chatCapacity':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xa18d('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![],'defaultValue':_0xa18d('0x19')},'ipaddr':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x1b'),_0xa18d('0x1c'),_0xa18d('0x1d')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x1e'),_0xa18d('0x1f'),_0xa18d('0x20'),_0xa18d('0x21'),'PROHIB_NOT_SCREENED',_0xa18d('0x22'),_0xa18d('0x23'),_0xa18d('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![],'defaultValue':_0xa18d('0x25'),'set':function(_0x29b6a8){this[_0xa18d('0x6')](_0xa18d('0x26'),_0x29b6a8?_0x29b6a8[_0xa18d('0x27')](','):null);},'get':function(){return this[_0xa18d('0xb')](_0xa18d('0x26'))?this[_0xa18d('0xb')](_0xa18d('0x26'))[_0xa18d('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x29'),_0xa18d('0x2a'),_0xa18d('0x2b'),_0xa18d('0x2c'),_0xa18d('0x2d')),'allowNull':!![],'defaultValue':_0xa18d('0x29')},'directmedia':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no','nonat','update',_0xa18d('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa18d('0x30'),'set':function(_0x1185df){this[_0xa18d('0x6')](_0xa18d('0x31'),_0x1185df?_0x1185df['join'](','):null);},'get':function(){return this['getDataValue'](_0xa18d('0x31'))?this[_0xa18d('0xb')](_0xa18d('0x31'))[_0xa18d('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xa18d('0x4')]},'namedcallgroup':{'type':Sequelize[_0xa18d('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa18d('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xa18d('0x4')],'allowNull':![],'defaultValue':_0xa18d('0x32')},'allow':{'type':Sequelize[_0xa18d('0x4')],'allowNull':![],'defaultValue':_0xa18d('0x33'),'set':function(_0xd81729){this['setDataValue'](_0xa18d('0x34'),_0xd81729?_0xd81729[_0xa18d('0x27')](';'):_0xa18d('0x33'));},'get':function(){return this['getDataValue']('allow')?this['getDataValue']('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![],'set':function(_0x45f046){this[_0xa18d('0x6')](_0xa18d('0x35'),_0x45f046?_0x45f046['join'](','):null);},'get':function(){return this[_0xa18d('0xb')](_0xa18d('0x35'))?this[_0xa18d('0xb')]('insecure')['split'](','):null;},'comment':_0xa18d('0x36')},'trustrpid':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xa18d('0x2e'),'no',_0xa18d('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa18d('0x38')},'amaflags':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![],'defaultValue':_0xa18d('0x2e')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x39'),_0xa18d('0x3a'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x3b'),_0xa18d('0x3c')),'allowNull':!![],'defaultValue':_0xa18d('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xa18d('0x2e'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no',_0xa18d('0x3d'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xa18d('0x3e'),'passive',_0xa18d('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xa18d('0x2e'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no',_0xa18d('0x40'),_0xa18d('0x41'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xa18d('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xa18d('0x18')]},'passwordResetAt':{'type':Sequelize[_0xa18d('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xa18d('0x42')]},'showWebBar':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0,'set':function(_0x1a44e0){this[_0xa18d('0x6')](_0xa18d('0x43'),_0x1a44e0);var _0xf57689=this['get']({'plain':!![]});switch(_0x1a44e0){case 0x0:case 0x1:var _0x2e824b=_0xf57689[_0xa18d('0x26')]?_[_0xa18d('0x44')](_0xf57689[_0xa18d('0x26')])?_0xf57689[_0xa18d('0x26')][_0xa18d('0x27')]():_0xf57689['transport']:_0xa18d('0x25');if(_0x2e824b===_0xa18d('0x45')){_0x2e824b=_0xa18d('0x25');}this[_0xa18d('0x6')](_0xa18d('0x26'),_0x2e824b);this[_0xa18d('0x6')](_0xa18d('0x46'),'no');this[_0xa18d('0x6')](_0xa18d('0x47'),null);this['setDataValue'](_0xa18d('0x48'),null);this[_0xa18d('0x6')]('icesupport',null);this[_0xa18d('0x6')](_0xa18d('0x49'),null);this[_0xa18d('0x6')]('dtlsverify',null);this[_0xa18d('0x6')](_0xa18d('0x4a'),null);this['setDataValue']('dtlscertfile',null);this[_0xa18d('0x6')](_0xa18d('0x4b'),null);this[_0xa18d('0x6')]('rtcp_mux','no');break;case 0x2:this[_0xa18d('0x6')](_0xa18d('0x26'),_0xa18d('0x45'));this[_0xa18d('0x6')](_0xa18d('0x46'),_0xa18d('0x2e'));this[_0xa18d('0x6')](_0xa18d('0x47'),_0xa18d('0x2e'));this[_0xa18d('0x6')](_0xa18d('0x48'),_0xa18d('0x2e'));this['setDataValue'](_0xa18d('0x4c'),_0xa18d('0x2e'));this['setDataValue'](_0xa18d('0x49'),_0xa18d('0x2e'));this[_0xa18d('0x6')](_0xa18d('0x4d'),'no');this['setDataValue'](_0xa18d('0x4a'),_0xa18d('0x3f'));this['setDataValue'](_0xa18d('0x4e'),_0xf57689[_0xa18d('0x4e')]||_0xa18d('0x4f'));this['setDataValue'](_0xa18d('0x4b'),_0xf57689[_0xa18d('0x4b')]||_0xa18d('0x50'));this[_0xa18d('0x6')](_0xa18d('0x51'),_0xa18d('0x2e'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x45aed1){this['setDataValue'](_0xa18d('0x52'),_0x45aed1?_0x45aed1[_0xa18d('0x27')](','):[]);},'get':function(){return this[_0xa18d('0xb')]('permissions')?_[_0xa18d('0x53')](this[_0xa18d('0xb')](_0xa18d('0x52'))[_0xa18d('0x28')](','),function(_0x1ed6dd){return parseInt(_0x1ed6dd,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xa18d('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xa18d('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xa18d('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xa18d('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xa18d('0x54')],'get':function(){return this[_0xa18d('0xb')]('phoneBarEnableScreenRecordingByAgent')?this[_0xa18d('0xb')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xa18d('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![],'set':function(_0x377e57){if(typeof _0x377e57==='string'){var _0x4ea515=_0x377e57==='1'?!![]:_0x377e57==='0'?![]:_0x377e57===_0xa18d('0x55')?!![]:_0x377e57===_0xa18d('0x56')?![]:![];this[_0xa18d('0x6')](_0xa18d('0x57'),_0x4ea515);}else{this[_0xa18d('0x6')](_0xa18d('0x57'),_0x377e57);}}},'blocked':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![],'set':function(_0x3a332c){this[_0xa18d('0x6')]('blocked',_0x3a332c);if(_0x3a332c===!![]){this['setDataValue'](_0xa18d('0x58'),moment());this[_0xa18d('0x6')]('loginAttempts',0x0);}else{this['setDataValue'](_0xa18d('0x58'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0x4e07=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept','refuse','uac','uas','fingerprint','certificate','active','actpass','update,nonat','showWebBar','wss','avpf','force_avp','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','icesupport','dtlssetup','/etc/pki/tls/certs/motion.crt','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','format','\x22%s\x22\x20<%s>','DATE','BOOLEAN','friend','peer','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','nat'];(function(_0x3b4b1d,_0x15029e){var _0x488c36=function(_0x56c8b3){while(--_0x56c8b3){_0x3b4b1d['push'](_0x3b4b1d['shift']());}};_0x488c36(++_0x15029e);}(_0x4e07,0x12d));var _0x74e0=function(_0x1509d4,_0x22863c){_0x1509d4=_0x1509d4-0x0;var _0x5edbbf=_0x4e07[_0x1509d4];return _0x5edbbf;};'use strict';var Sequelize=require(_0x74e0('0x0'));var moment=require(_0x74e0('0x1'));var util=require(_0x74e0('0x2'));var _=require(_0x74e0('0x3'));module[_0x74e0('0x4')]={'name':{'type':Sequelize[_0x74e0('0x5')],'allowNull':![],'unique':_0x74e0('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3e4b20){this[_0x74e0('0x7')](_0x74e0('0x6'),_0x3e4b20);this[_0x74e0('0x7')]('defaultuser',_0x3e4b20);},'comment':_0x74e0('0x8')},'fullname':{'type':Sequelize[_0x74e0('0x5')],'allowNull':![],'set':function(_0x540c9f){this[_0x74e0('0x7')](_0x74e0('0x9'),_0x540c9f);this[_0x74e0('0x7')](_0x74e0('0xa'),util['format']('\x22%s\x22\x20<%s>',_0x540c9f,this[_0x74e0('0xb')](_0x74e0('0xc'))));}},'alias':{'type':Sequelize[_0x74e0('0x5')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x74e0('0xd'),'validate':{'isEmail':!![]},'set':function(_0x32ad70){if(_0x32ad70){this[_0x74e0('0x7')]('email',_0x32ad70[_0x74e0('0xe')]());}}},'role':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x10'),_0x74e0('0x11'),_0x74e0('0x12'),_0x74e0('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x74e0('0x14')},'internal':{'type':Sequelize[_0x74e0('0x15')](0xb),'allowNull':![],'unique':_0x74e0('0xc'),'set':function(_0x56b3e9){this[_0x74e0('0x7')](_0x74e0('0xc'),_0x56b3e9);this['setDataValue'](_0x74e0('0x16'),_0x56b3e9);this[_0x74e0('0x7')](_0x74e0('0xa'),util[_0x74e0('0x17')](_0x74e0('0x18'),this['getDataValue'](_0x74e0('0x9')),_0x56b3e9));}},'salt':{'type':Sequelize[_0x74e0('0x5')]},'phone':{'type':Sequelize[_0x74e0('0x5')]},'mobile':{'type':Sequelize[_0x74e0('0x5')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x74e0('0x5')]},'userpic':{'type':Sequelize[_0x74e0('0x5')]},'city':{'type':Sequelize[_0x74e0('0x5')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x74e0('0x19')]},'voicePause':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x74e0('0x5')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x74e0('0x19')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x74e0('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x74e0('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x74e0('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x74e0('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x74e0('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'description':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x74e0('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x74e0('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x1b'),_0x74e0('0x11'),_0x74e0('0x1c')),'allowNull':!![],'defaultValue':_0x74e0('0x1b')},'context':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x74e0('0x1d'),_0x74e0('0x1e'),'PROHIB_NOT_SCREENED',_0x74e0('0x1f'),_0x74e0('0x20'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x74e0('0x21'),'set':function(_0x5c447a){this[_0x74e0('0x7')](_0x74e0('0x22'),_0x5c447a?_0x5c447a[_0x74e0('0x23')](','):null);},'get':function(){return this['getDataValue'](_0x74e0('0x22'))?this[_0x74e0('0xb')](_0x74e0('0x22'))[_0x74e0('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x25'),_0x74e0('0x26'),_0x74e0('0x27'),_0x74e0('0x28'),_0x74e0('0x29')),'allowNull':!![],'defaultValue':_0x74e0('0x25')},'directmedia':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no',_0x74e0('0x2b'),_0x74e0('0x2c'),_0x74e0('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x74e0('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x45fa63){this[_0x74e0('0x7')](_0x74e0('0x2e'),_0x45fa63?_0x45fa63[_0x74e0('0x23')](','):null);},'get':function(){return this[_0x74e0('0xb')](_0x74e0('0x2e'))?this['getDataValue']('nat')[_0x74e0('0x24')](','):null;},'comment':_0x74e0('0x2f')},'callgroup':{'type':Sequelize[_0x74e0('0x5')]},'namedcallgroup':{'type':Sequelize[_0x74e0('0x5')]},'pickupgroup':{'type':Sequelize[_0x74e0('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x74e0('0x5')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x74e0('0x5')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x74e0('0x5')],'allowNull':![],'defaultValue':_0x74e0('0x30'),'set':function(_0x1db478){this[_0x74e0('0x7')](_0x74e0('0x31'),_0x1db478?_0x1db478[_0x74e0('0x23')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x74e0('0x31'))?this[_0x74e0('0xb')]('allow')[_0x74e0('0x24')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x74e0('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![],'set':function(_0x29be47){this[_0x74e0('0x7')]('insecure',_0x29be47?_0x29be47[_0x74e0('0x23')](','):null);},'get':function(){return this[_0x74e0('0xb')](_0x74e0('0x32'))?this['getDataValue']('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x74e0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x74e0('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x74e0('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![],'defaultValue':_0x74e0('0x33')},'amaflags':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x74e0('0x2a')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x74e0('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no',_0x74e0('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x74e0('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x74e0('0xf')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x35'),_0x74e0('0x36'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x74e0('0x37'),_0x74e0('0x38')),'allowNull':!![],'defaultValue':_0x74e0('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x74e0('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x74e0('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x74e0('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x74e0('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x74e0('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x74e0('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no',_0x74e0('0x39'),_0x74e0('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x3b'),'passive',_0x74e0('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x74e0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x74e0('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x74e0('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x74e0('0x2a'),'no',_0x74e0('0x2b'),_0x74e0('0x2c'),_0x74e0('0x3d')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x74e0('0x5')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x74e0('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x74e0('0x15')],'defaultValue':0x0,'set':function(_0x2e4f62){this[_0x74e0('0x7')](_0x74e0('0x3e'),_0x2e4f62);var _0x2367b2=this['get']({'plain':!![]});switch(_0x2e4f62){case 0x0:case 0x1:var _0x22d30e=_0x2367b2[_0x74e0('0x22')]?_['isArray'](_0x2367b2[_0x74e0('0x22')])?_0x2367b2[_0x74e0('0x22')]['join']():_0x2367b2[_0x74e0('0x22')]:_0x74e0('0x21');if(_0x22d30e===_0x74e0('0x3f')){_0x22d30e='udp';}this[_0x74e0('0x7')](_0x74e0('0x22'),_0x22d30e);this['setDataValue']('encryption','no');this[_0x74e0('0x7')](_0x74e0('0x40'),null);this[_0x74e0('0x7')](_0x74e0('0x41'),null);this[_0x74e0('0x7')]('icesupport',null);this[_0x74e0('0x7')](_0x74e0('0x42'),null);this[_0x74e0('0x7')](_0x74e0('0x43'),null);this[_0x74e0('0x7')]('dtlssetup',null);this['setDataValue'](_0x74e0('0x44'),null);this[_0x74e0('0x7')](_0x74e0('0x45'),null);this[_0x74e0('0x7')](_0x74e0('0x46'),'no');break;case 0x2:this[_0x74e0('0x7')](_0x74e0('0x22'),_0x74e0('0x3f'));this['setDataValue'](_0x74e0('0x47'),_0x74e0('0x2a'));this[_0x74e0('0x7')](_0x74e0('0x40'),_0x74e0('0x2a'));this[_0x74e0('0x7')](_0x74e0('0x41'),_0x74e0('0x2a'));this['setDataValue'](_0x74e0('0x48'),_0x74e0('0x2a'));this[_0x74e0('0x7')](_0x74e0('0x42'),_0x74e0('0x2a'));this[_0x74e0('0x7')](_0x74e0('0x43'),'no');this[_0x74e0('0x7')](_0x74e0('0x49'),_0x74e0('0x3c'));this[_0x74e0('0x7')]('dtlscertfile',_0x2367b2[_0x74e0('0x44')]||_0x74e0('0x4a'));this['setDataValue'](_0x74e0('0x45'),_0x2367b2['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x74e0('0x46'),_0x74e0('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x74e0('0x4b')],'set':function(_0x25c4e0){this[_0x74e0('0x7')](_0x74e0('0x4c'),_0x25c4e0?_0x25c4e0['join'](','):[]);},'get':function(){return this[_0x74e0('0xb')](_0x74e0('0x4c'))?_[_0x74e0('0x4d')](this['getDataValue']('permissions')['split'](','),function(_0x589a40){return parseInt(_0x589a40,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x74e0('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x74e0('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0x74e0('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x74e0('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x74e0('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x74e0('0xf')](_0x74e0('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x74e0('0x5')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x74e0('0x4e')],'get':function(){return this[_0x74e0('0xb')](_0x74e0('0x4f'))?this[_0x74e0('0xb')](_0x74e0('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'interface':{'type':Sequelize[_0x74e0('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x74e0('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![],'set':function(_0x7561c0){if(typeof _0x7561c0===_0x74e0('0x50')){var _0x28e18e=_0x7561c0==='1'?!![]:_0x7561c0==='0'?![]:_0x7561c0==='true'?!![]:_0x7561c0===_0x74e0('0x51')?![]:![];this[_0x74e0('0x7')](_0x74e0('0x52'),_0x28e18e);}else{this['setDataValue'](_0x74e0('0x52'),_0x7561c0);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x5f0524){this[_0x74e0('0x7')](_0x74e0('0x53'),_0x5f0524);if(_0x5f0524===!![]){this[_0x74e0('0x7')](_0x74e0('0x54'),moment());this[_0x74e0('0x7')](_0x74e0('0x55'),0x0);}else{this[_0x74e0('0x7')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x74e0('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x74e0('0x15')](0x5)[_0x74e0('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x74e0('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x74e0('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x74e0('0x15')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x74e0('0x15')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x74e0('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x74e0('0x15')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x74e0('0x1a')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 623cc22..2615dff 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 _0x4f5a=['fax','update','body','describe','addContacts','omit','ids','Setting','validatePasswordPattern','max','internal','min_internal','isNil','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','mailbox','VoiceMail','101','102','103','113','110','104','105','107','108','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','UserProfileSection','Telephones','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','isEmpty','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','addQueues','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','penalty','capitalize','QueueId','VoiceQueue','get','voice','format','SIP/%s','upsert','removeQueues','channel','remove','isArray','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','file','filename','getAvatar','root','server/files/images/logos/default_profile.png','download','existsSync','join','server/files/images/','getOpenTabs','CHAT','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MAIL','SMS','WHATSAPP','concat','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','Tags','color','tag','getQueues','keys','filters','intersection','model','fields','order','sort','where','pick','nolimit','Queue','getVoiceQueuesRt','filter','getGroups','ChatGroup','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','logout','pause','updateAttributes','type','DEFAULT\x20PAUSE','bulkCreate','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','faxPause','smsPause','whatsappPause','pauseType','lastPauseAt','Team','getTeams','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','Queue:save','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeTeams','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$or','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','lastName','CmContact','Contact','dialActive','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','token','removeApiKey','apiKeyNonce','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','unknown','ringing','queues','inbound','toString','lower','col','desc','asc','substring','uniqBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','enabled','moment','util','lodash','ioredis','../../components/auth/service','../../components/contacts','../../config/logger','api','../../config/utils','../../config/environment','APIBadRequestError','../../errors/api','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','end','json','limit','undefined','count','offset','status','set','Content-Range','then','role','agent','emit','userNotification:recalc:','admin','Users','user','Agents','telephone','value','includes','find','name','UserProfileResource','destroy','sendStatus','error','send','User','rawAttributes','map','key','password','salt','previousPasswords','resetPasswordToken','md5secret','index','getOptions','query','include','userSetting','true','UserSetting','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','mail','openchannel','whatsapp','all','catch','show','params','includeAll','merge','options'];(function(_0x327cd6,_0x529f15){var _0xd2e50d=function(_0x11bf92){while(--_0x11bf92){_0x327cd6['push'](_0x327cd6['shift']());}};_0xd2e50d(++_0x529f15);}(_0x4f5a,0x12a));var _0xa4f5=function(_0x8ddb62,_0x205f89){_0x8ddb62=_0x8ddb62-0x0;var _0x32b519=_0x4f5a[_0x8ddb62];return _0x32b519;};'use strict';var moment=require(_0xa4f5('0x0'));var util=require(_0xa4f5('0x1'));var path=require('path');var fs=require('fs');var _=require(_0xa4f5('0x2'));var squel=require('squel');var Redis=require(_0xa4f5('0x3'));var authService=require(_0xa4f5('0x4'));var contacts=require(_0xa4f5('0x5'));var qs=require('../../components/parsers/qs');var rta=require('../../components/realtime/agents');var logger=require(_0xa4f5('0x6'))(_0xa4f5('0x7'));var utils=require(_0xa4f5('0x8'));var config=require(_0xa4f5('0x9'));var licenseUtil=require('../../config/license/util');var APIBadRequestError=require('../../errors/api')[_0xa4f5('0xa')];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIHandleError=require(_0xa4f5('0xb'))['handleError'];var db=require(_0xa4f5('0xc'))['db'];var socket=require(_0xa4f5('0xd'))(new Redis(config[_0xa4f5('0xe')]));require(_0xa4f5('0xf'))[_0xa4f5('0x10')](socket);config[_0xa4f5('0xe')]=_[_0xa4f5('0x11')](config[_0xa4f5('0xe')],{'host':_0xa4f5('0x12'),'port':0x18eb});var values;function respondWithStatusCode(_0x267ff6,_0x92fceb){_0x92fceb=_0x92fceb||0xcc;return function(_0x430193){if(_0x430193){return _0x267ff6['sendStatus'](_0x92fceb);}return _0x267ff6['status'](_0x92fceb)[_0xa4f5('0x13')]();};}function respondWithResult(_0x1fccad,_0x541c87){_0x541c87=_0x541c87||0xc8;return function(_0xf343ea){if(_0xf343ea){return _0x1fccad['status'](_0x541c87)[_0xa4f5('0x14')](_0xf343ea);}};}function respondWithFilteredResult(_0x539903,_0x5dead1){return function(_0x54ac8a){if(_0x54ac8a){var _0x4c2906=typeof _0x5dead1['offset']==='undefined'&&typeof _0x5dead1[_0xa4f5('0x15')]===_0xa4f5('0x16');var _0x141c72=_0x54ac8a[_0xa4f5('0x17')];var _0x2ffaac=_0x4c2906?0x0:_0x5dead1['offset'];var _0x5c9cd4=_0x4c2906?_0x54ac8a['count']:_0x5dead1[_0xa4f5('0x18')]+_0x5dead1['limit'];var _0x53f99e;if(_0x5c9cd4>=_0x141c72){_0x5c9cd4=_0x141c72;_0x53f99e=0xc8;}else{_0x53f99e=0xce;}_0x539903[_0xa4f5('0x19')](_0x53f99e);return _0x539903[_0xa4f5('0x1a')](_0xa4f5('0x1b'),_0x2ffaac+'-'+_0x5c9cd4+'/'+_0x141c72)[_0xa4f5('0x14')](_0x54ac8a);}return null;};}function saveUpdates(_0xbca1f7){return function(_0x232780){if(_0x232780){return _0x232780['update'](_0xbca1f7)[_0xa4f5('0x1c')](function(_0x3de8b0){if(_0x3de8b0[_0xa4f5('0x1d')]===_0xa4f5('0x1e')){socket[_0xa4f5('0x1f')](_0xa4f5('0x20')+_0x3de8b0['id'],_0x3de8b0);}return _0x3de8b0;});}return null;};}function removeEntity(_0x1d43c6){return function(_0xaad0e5){if(_0xaad0e5){return _0xaad0e5['destroy']()['then'](function(){var _0x4ebebc=_0xaad0e5['get']({'plain':!![]});if(_0x4ebebc[_0xa4f5('0x1d')]===_0xa4f5('0x21'))return;var _0xebd12e=[{'name':_0xa4f5('0x22'),'value':_0xa4f5('0x23'),'ignore':!![]},{'name':_0xa4f5('0x24'),'value':_0xa4f5('0x1e'),'ignore':![]},{'name':'Telephones','value':_0xa4f5('0x25'),'ignore':![]}];var _0x5e9720=_(_0xebd12e)['filter']('ignore')['map'](_0xa4f5('0x26'))[_0xa4f5('0x26')]();if(_[_0xa4f5('0x27')](_0x5e9720,_0x4ebebc['role'])){return;}var _0x400f03=_[_0xa4f5('0x28')](_0xebd12e,[_0xa4f5('0x26'),_0x4ebebc['role']])[_0xa4f5('0x29')];return db[_0xa4f5('0x2a')][_0xa4f5('0x2b')]({'where':{'type':_0x400f03,'resourceId':_0x4ebebc['id']}})[_0xa4f5('0x1c')](function(){return _0xaad0e5;});})[_0xa4f5('0x1c')](function(){_0x1d43c6[_0xa4f5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e8cf9){return function(_0x21ed37){if(!_0x21ed37){_0x2e8cf9[_0xa4f5('0x2c')](0x194);}return _0x21ed37;};}function handleError(_0x3f8393,_0x206b0a){_0x206b0a=_0x206b0a||0x1f4;return function(_0x22dc21){logger[_0xa4f5('0x2d')](_0x22dc21['stack']);if(_0x22dc21[_0xa4f5('0x29')]){delete _0x22dc21['name'];}_0x3f8393[_0xa4f5('0x19')](_0x206b0a)[_0xa4f5('0x2e')](_0x22dc21);};}function getUserAttributes(){return _(db[_0xa4f5('0x2f')][_0xa4f5('0x30')])[_0xa4f5('0x31')](function(_0x2aa4c2){return{'name':_0x2aa4c2['fieldName'],'type':_0x2aa4c2['type'][_0xa4f5('0x32')]};})['filter'](function(_0x408a7b){return![_0xa4f5('0x33'),_0xa4f5('0x34'),_0xa4f5('0x35'),_0xa4f5('0x36'),'resetPasswordExpires',_0xa4f5('0x37')]['includes'](_0x408a7b[_0xa4f5('0x29')]);})['value']();}exports[_0xa4f5('0x38')]=function(_0x2464ac,_0x2afd7c){var _0x17d935={},_0x9a760b={'count':0x0,'rows':[]};var _0x17ca38=getUserAttributes();_0x17d935=qs[_0xa4f5('0x39')](_0x17ca38,_0x2464ac);var _0x1092f6={'where':_0x17d935['where']};return db[_0xa4f5('0x2f')][_0xa4f5('0x17')](_0x1092f6)['then'](function(_0x4f7780){_0x9a760b[_0xa4f5('0x17')]=_0x4f7780;if(_0x2464ac[_0xa4f5('0x3a')]['includeAll']){_0x17d935[_0xa4f5('0x3b')]=[{'all':!![]}];}if(_0x2464ac[_0xa4f5('0x3a')][_0xa4f5('0x3c')]===_0xa4f5('0x3d')){_0x17d935[_0xa4f5('0x3b')]=[{'model':db[_0xa4f5('0x3e')],'as':'userSetting'}];}if(!_[_0xa4f5('0x27')](_0x17d935[_0xa4f5('0x3f')],'id')){_0x17d935['attributes'][_0xa4f5('0x40')]('id');}return db['User'][_0xa4f5('0x41')](_0x17d935);})[_0xa4f5('0x1c')](function(_0x27ca0){_0x9a760b[_0xa4f5('0x42')]=_0x27ca0;if(_0x2464ac[_0xa4f5('0x3a')][_0xa4f5('0x43')]===_0xa4f5('0x3d')){var _0x27912b=[];for(var _0x2843e5=0x0;_0x2843e5<_0x9a760b['rows'][_0xa4f5('0x44')];_0x2843e5++){_0x27912b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x45'),_0x9a760b[_0xa4f5('0x42')][_0x2843e5][_0xa4f5('0x46')]));_0x27912b['push'](get_open_tabs(_0xa4f5('0x47'),_0x9a760b[_0xa4f5('0x42')][_0x2843e5][_0xa4f5('0x46')]));_0x27912b[_0xa4f5('0x40')](get_open_tabs('fax',_0x9a760b[_0xa4f5('0x42')][_0x2843e5][_0xa4f5('0x46')]));_0x27912b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x48'),_0x9a760b[_0xa4f5('0x42')][_0x2843e5]['dataValues']));_0x27912b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x49'),_0x9a760b[_0xa4f5('0x42')][_0x2843e5][_0xa4f5('0x46')]));_0x27912b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x4a'),_0x9a760b['rows'][_0x2843e5][_0xa4f5('0x46')]));}return Promise[_0xa4f5('0x4b')](_0x27912b)[_0xa4f5('0x1c')](function(){return _0x9a760b;});}else{return _0x9a760b;}})[_0xa4f5('0x1c')](respondWithFilteredResult(_0x2afd7c,_0x17d935))[_0xa4f5('0x4c')](handleError(_0x2afd7c,null));};exports[_0xa4f5('0x4d')]=function(_0x444ef8,_0x1f8e47){var _0x3d8255=getUserAttributes();_0x444ef8[_0xa4f5('0x3a')]['id']=_0x444ef8[_0xa4f5('0x4e')]['id'];var _0x157ecf=qs[_0xa4f5('0x39')](_0x3d8255,_0x444ef8);if(_0x444ef8[_0xa4f5('0x3a')][_0xa4f5('0x4f')]){_0x157ecf[_0xa4f5('0x3b')]=[{'all':!![]}];}if(_0x444ef8[_0xa4f5('0x3a')][_0xa4f5('0x3c')]===_0xa4f5('0x3d')){_0x157ecf[_0xa4f5('0x3b')]=[{'model':db['UserSetting'],'as':'userSetting'}];}_0x157ecf=_[_0xa4f5('0x50')]({},_0x157ecf,_0x444ef8[_0xa4f5('0x51')]);if(!_[_0xa4f5('0x27')](_0x157ecf[_0xa4f5('0x3f')],'id')){_0x157ecf[_0xa4f5('0x3f')][_0xa4f5('0x40')]('id');}return db['User'][_0xa4f5('0x28')](_0x157ecf)['then'](handleEntityNotFound(_0x1f8e47,null))['then'](function(_0x36af2c){var _0x58b7c4=[];values=_0x36af2c;if(_0x444ef8['query'][_0xa4f5('0x43')]===_0xa4f5('0x3d')){_0x58b7c4[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x45'),_0x36af2c[_0xa4f5('0x46')]));_0x58b7c4['push'](get_open_tabs(_0xa4f5('0x47'),_0x36af2c[_0xa4f5('0x46')]));_0x58b7c4[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x49'),_0x36af2c[_0xa4f5('0x46')]));_0x58b7c4[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x4a'),_0x36af2c[_0xa4f5('0x46')]));_0x58b7c4[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x52'),_0x36af2c[_0xa4f5('0x46')]));_0x58b7c4[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x48'),_0x36af2c[_0xa4f5('0x46')]));return Promise[_0xa4f5('0x4b')](_0x58b7c4);}else{return values;}})['then'](function(){return values;})[_0xa4f5('0x1c')](respondWithResult(_0x1f8e47,null))['catch'](handleError(_0x1f8e47,null));};exports[_0xa4f5('0x53')]=function(_0x5970f4,_0x570aea){if(_0x5970f4[_0xa4f5('0x54')]['id']){delete _0x5970f4[_0xa4f5('0x54')]['id'];}delete _0x5970f4[_0xa4f5('0x54')][_0xa4f5('0x1d')];return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x5970f4[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x570aea,null))['then'](saveUpdates(_0x5970f4[_0xa4f5('0x54')],null))[_0xa4f5('0x1c')](respondWithResult(_0x570aea,null))[_0xa4f5('0x4c')](handleError(_0x570aea,null));};exports[_0xa4f5('0x55')]=function(_0x445961,_0x12c103){return db['User'][_0xa4f5('0x55')]()[_0xa4f5('0x1c')](respondWithResult(_0x12c103,null))[_0xa4f5('0x4c')](handleError(_0x12c103,null));};exports[_0xa4f5('0x56')]=function(_0x2125a8,_0x209149){return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x2125a8[_0xa4f5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x209149,null))[_0xa4f5('0x1c')](function(_0x43fa9d){if(_0x43fa9d){return _0x43fa9d[_0xa4f5('0x56')](_0x2125a8['body']['ids'],_[_0xa4f5('0x57')](_0x2125a8['body'],[_0xa4f5('0x58'),'id'])||{});}})[_0xa4f5('0x1c')](respondWithResult(_0x209149,null))[_0xa4f5('0x4c')](handleError(_0x209149,null));};function validateUser(_0x42a42e){return new Promise(function(_0x40a605,_0x52ae8e){if(_0x42a42e['internal'])return _0x40a605(_0x42a42e);return db[_0xa4f5('0x59')]['findById'](0x1)[_0xa4f5('0x1c')](function(_0x36b3a7){if(_0x36b3a7['securePassword'])authService[_0xa4f5('0x5a')](_0x42a42e[_0xa4f5('0x33')]);db[_0xa4f5('0x2f')][_0xa4f5('0x5b')](_0xa4f5('0x5c'))[_0xa4f5('0x1c')](function(_0x26a86b){if(_['isNil'](_0x26a86b)){_0x42a42e['internal']=_0x36b3a7[_0xa4f5('0x5d')]||0x1;return;}if(_[_0xa4f5('0x5e')](_0x36b3a7[_0xa4f5('0x5d')])||_0x36b3a7[_0xa4f5('0x5d')]===_0x26a86b){_0x42a42e[_0xa4f5('0x5c')]=_0x26a86b+0x1;return;}if(_0x36b3a7[_0xa4f5('0x5d')]>_0x26a86b){_0x42a42e['internal']=_0x36b3a7[_0xa4f5('0x5d')];return;}return db[_0xa4f5('0x5f')][_0xa4f5('0x3a')](_0xa4f5('0x60'),{'type':db[_0xa4f5('0x5f')][_0xa4f5('0x61')]['SELECT']})['then'](function(_0x39ae23){if(_0x39ae23&&_0x39ae23[_0xa4f5('0x44')]){for(var _0x225794=0x0,_0x683bf0=_0x39ae23['length'];_0x225794<_0x683bf0&&_['isNil'](_0x42a42e[_0xa4f5('0x5c')]);_0x225794++){if(_0x36b3a7['min_internal']<=_0x39ae23[_0x225794][_0xa4f5('0x62')]){_0x42a42e['internal']=_0x39ae23[_0x225794][_0xa4f5('0x62')];}else if(_0x36b3a7[_0xa4f5('0x5d')]>_0x39ae23[_0x225794][_0xa4f5('0x62')]&&_0x36b3a7[_0xa4f5('0x5d')]<=_0x39ae23[_0x225794]['to']){_0x42a42e[_0xa4f5('0x5c')]=_0x36b3a7[_0xa4f5('0x5d')];}}}if(_[_0xa4f5('0x5e')](_0x42a42e['internal'])){_0x42a42e['internal']=_0x26a86b+0x1;}return _0x40a605(_0x42a42e);});});})['catch'](function(_0x438150){_0x52ae8e(_0x438150);});});}function updateUser(_0x23a55e){return new Promise(function(_0x3f828c,_0x2b611d){try{if(_0x23a55e[_0xa4f5('0x63')]){_0x23a55e[_0xa4f5('0x64')]=_0x23a55e[_0xa4f5('0x5c')];_0x23a55e[_0xa4f5('0x65')]={'mailbox':_0x23a55e['internal'],'password':_0x23a55e[_0xa4f5('0x33')],'fullname':_0x23a55e['fullname'],'email':_0x23a55e['email']};}if(_0x23a55e[_0xa4f5('0x1d')]===_0xa4f5('0x1e')){if(!_0x23a55e['permissions'])_0x23a55e['permissions']=[_0xa4f5('0x66'),_0xa4f5('0x67'),_0xa4f5('0x68'),_0xa4f5('0x69'),_0xa4f5('0x6a'),_0xa4f5('0x6b'),_0xa4f5('0x6c'),'106',_0xa4f5('0x6d'),_0xa4f5('0x6e'),'109',_0xa4f5('0x6f'),_0xa4f5('0x70'),_0xa4f5('0x71'),_0xa4f5('0x72')];}_0x3f828c(_0x23a55e);}catch(_0x43db48){_0x2b611d(_0x43db48);}});}exports[_0xa4f5('0x73')]=function(_0x74cd9f,_0x1a4595){if(_0x74cd9f[_0xa4f5('0x23')]['role']===_0xa4f5('0x1e'))throw new Error(_0xa4f5('0x74'));if(_0x74cd9f[_0xa4f5('0x54')][_0xa4f5('0x1d')]===_0xa4f5('0x23')&&_0x74cd9f['user'][_0xa4f5('0x1d')]!==_0xa4f5('0x21')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x74cd9f['body'][_0xa4f5('0x1d')]===_0xa4f5('0x21')&&_0x74cd9f[_0xa4f5('0x23')][_0xa4f5('0x1d')]!==_0xa4f5('0x21')){throw new Error(_0xa4f5('0x75'));}return licenseUtil[_0xa4f5('0x76')]([_0x74cd9f[_0xa4f5('0x54')]])[_0xa4f5('0x1c')](function(){return validateUser(_0x74cd9f[_0xa4f5('0x54')]);})[_0xa4f5('0x1c')](function(_0x4dff83){return updateUser(_0x4dff83)[_0xa4f5('0x1c')](function(_0x13eaac){if(_0x13eaac[_0xa4f5('0x1d')]===_0xa4f5('0x21')){_0x13eaac['settingsEnabled']=_0x74cd9f[_0xa4f5('0x23')]['settingsEnabled'];delete _0x13eaac['userProfileId'];}return _0x13eaac;});})[_0xa4f5('0x1c')](function(_0x33a2f2){return db['User'][_0xa4f5('0x73')](_0x33a2f2,{'include':[{'model':db[_0xa4f5('0x65')],'as':_0xa4f5('0x65')}]});})['then'](function(_0x2fdb83){if(_0x74cd9f[_0xa4f5('0x54')][_0xa4f5('0x1d')]==='user')return _0x2fdb83;if(_0x74cd9f[_0xa4f5('0x23')]['role']!==_0xa4f5('0x23'))return _0x2fdb83;return db[_0xa4f5('0x77')][_0xa4f5('0x28')]({'where':{'name':_0x2fdb83[_0xa4f5('0x1d')]===_0xa4f5('0x1e')?_0xa4f5('0x24'):_0xa4f5('0x78'),'userProfileId':_0x74cd9f[_0xa4f5('0x23')][_0xa4f5('0x79')]},'raw':!![]})[_0xa4f5('0x1c')](function(_0x1c7a80){if(!_0x1c7a80||_0x1c7a80[_0xa4f5('0x7a')]!=0x0)return _0x2fdb83;return db[_0xa4f5('0x2a')][_0xa4f5('0x73')]({'name':_0x2fdb83[_0xa4f5('0x29')],'resourceId':_0x2fdb83['id'],'type':_0x1c7a80[_0xa4f5('0x29')],'sectionId':_0x1c7a80['id']},{})['then'](function(){return _0x2fdb83;});})[_0xa4f5('0x4c')](function(_0x1b88c0){logger[_0xa4f5('0x2d')](_0xa4f5('0x7b'),_0x1b88c0);throw _0x1b88c0;});})[_0xa4f5('0x1c')](respondWithResult(_0x1a4595,0xc9))['catch'](handleError(_0x1a4595,null));};exports['bulkCreate']=function(_0xef06c5,_0x44664f){var _0x5476ad=_0xef06c5[_0xa4f5('0x54')];var _0x5f49b7=[];if(_0xef06c5[_0xa4f5('0x23')]['role']===_0xa4f5('0x1e'))throw new Error(_0xa4f5('0x74'));if(_[_0xa4f5('0x7c')](_0x5476ad,[_0xa4f5('0x1d'),_0xa4f5('0x23')])&&_0xef06c5[_0xa4f5('0x23')][_0xa4f5('0x1d')]!==_0xa4f5('0x21')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x5476ad,[_0xa4f5('0x1d'),_0xa4f5('0x21')])&&_0xef06c5[_0xa4f5('0x23')][_0xa4f5('0x1d')]!==_0xa4f5('0x21')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xa4f5('0x76')](_0x5476ad)[_0xa4f5('0x1c')](function(){return validateUser(_0x5476ad[0x0]);})[_0xa4f5('0x1c')](function(){for(var _0x22c503=0x1;_0x22c503<_0x5476ad[_0xa4f5('0x44')];_0x22c503++){var _0x284cc7=_0x5476ad[_0x22c503-0x1][_0xa4f5('0x5c')];if(!_0x5476ad[_0x22c503]['internal'])_0x5476ad[_0x22c503][_0xa4f5('0x5c')]=_0x284cc7+0x1;_0x5f49b7[_0xa4f5('0x40')](validateUser(_0x5476ad[_0x22c503]));}return Promise[_0xa4f5('0x4b')](_0x5f49b7);})[_0xa4f5('0x1c')](function(){_0x5f49b7=[];for(var _0x2fce37=0x0;_0x2fce37<_0x5476ad['length'];_0x2fce37++){_0x5f49b7[_0xa4f5('0x40')](updateUser(_0x5476ad[_0x2fce37]));}return Promise[_0xa4f5('0x4b')](_0x5f49b7);})[_0xa4f5('0x1c')](function(){_0x5f49b7=_0x5476ad[_0xa4f5('0x31')](function(_0x18e52c){return db['User'][_0xa4f5('0x73')](_0x18e52c,{'include':[{'model':db[_0xa4f5('0x65')],'as':_0xa4f5('0x65')}]})['then'](function(_0x28e08c){_0x18e52c['id']=_0x28e08c['id'];return _0x18e52c;});});return Promise[_0xa4f5('0x4b')](_0x5f49b7);})[_0xa4f5('0x1c')](function(_0x457037){if(_0xef06c5['body'][_0xa4f5('0x1d')]==='user')return _0x457037;if(_0xef06c5[_0xa4f5('0x23')][_0xa4f5('0x1d')]!==_0xa4f5('0x23'))return _0x457037;var _0x4bf2e6=_['some'](_0x457037,function(_0x146a87){return _0x146a87[_0xa4f5('0x1d')]===_0xa4f5('0x1e')||_0x146a87[_0xa4f5('0x1d')]==='telephone';});if(!_0x4bf2e6)return _0x457037;return db[_0xa4f5('0x77')]['findAll']({'where':{'name':{'$or':[_0xa4f5('0x24'),_0xa4f5('0x78')]},'userProfileId':_0xef06c5[_0xa4f5('0x23')]['userProfileId']},'raw':!![]})[_0xa4f5('0x1c')](function(_0x5cee2d){if(_[_0xa4f5('0x7d')](_0x5cee2d)||!_['some'](_0x5cee2d,[_0xa4f5('0x7a'),0x0]))return _0x457037;_0x5f49b7=[];var _0x456d79=_(_0x5cee2d)[_0xa4f5('0x31')](function(_0x205578){if(_0x205578[_0xa4f5('0x7a')]===0x1)return;return _0x205578[_0xa4f5('0x29')]===_0xa4f5('0x24')?_0xa4f5('0x1e'):'telephone';})[_0xa4f5('0x7e')]()[_0xa4f5('0x26')]();for(var _0x14c488=0x0;_0x14c488<_0x457037[_0xa4f5('0x44')];_0x14c488++){if(!_[_0xa4f5('0x27')](_0x456d79,_0x457037[_0x14c488][_0xa4f5('0x1d')]))return;var _0x10a135=_0x457037[_0x14c488][_0xa4f5('0x1d')]===_0xa4f5('0x1e')?_0xa4f5('0x24'):_0xa4f5('0x78');_0x5f49b7['push'](db[_0xa4f5('0x2a')][_0xa4f5('0x73')]({'name':_0x457037[_0x14c488][_0xa4f5('0x29')],'resourceId':_0x457037[_0x14c488]['id'],'type':_0x10a135,'sectionId':_[_0xa4f5('0x28')](_0x5cee2d,[_0xa4f5('0x29'),_0x10a135])['id']},{}));}return Promise[_0xa4f5('0x4b')](_0x5f49b7);});})[_0xa4f5('0x1c')](respondWithResult(_0x44664f,0xc9))[_0xa4f5('0x4c')](handleError(_0x44664f,null));};exports[_0xa4f5('0x7f')]=function(_0x172251,_0x1378a7){if(_0x172251[_0xa4f5('0x54')]['id']){delete _0x172251[_0xa4f5('0x54')]['id'];}return db['User']['find']({'where':{'id':_0x172251['params']['id']}})[_0xa4f5('0x1c')](function(_0x306a32){if(!_0x306a32)return null;if(_0x306a32['id']===_0x172251[_0xa4f5('0x23')]['id']){if(!_0x172251['body'][_0xa4f5('0x80')]||!_0x172251[_0xa4f5('0x54')][_0xa4f5('0x81')]){throw new db[(_0xa4f5('0x82'))][(_0xa4f5('0x83'))](_0xa4f5('0x84'));}if(!_0x306a32[_0xa4f5('0x85')](_0x172251[_0xa4f5('0x54')][_0xa4f5('0x80')])){throw new db['Sequelize'][(_0xa4f5('0x83'))](_0xa4f5('0x86'));}if(_0x172251[_0xa4f5('0x54')][_0xa4f5('0x80')]===_0x172251['body'][_0xa4f5('0x81')]){throw new db[(_0xa4f5('0x82'))][(_0xa4f5('0x83'))](_0xa4f5('0x87'));}}else if(_0x172251[_0xa4f5('0x23')]['role']===_0xa4f5('0x21')){if(!_0x172251[_0xa4f5('0x54')]['newPassword']){throw new db['Sequelize'][(_0xa4f5('0x83'))](_0xa4f5('0x88'));}}else if(_0x172251['user']['role']==='user'){if(!_0x172251['body'][_0xa4f5('0x81')]){throw new db[(_0xa4f5('0x82'))][(_0xa4f5('0x83'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x306a32[_0xa4f5('0x1d')]!=='agent'){throw new db['Sequelize'][(_0xa4f5('0x83'))]('Unauthorized');}}else{throw new db[(_0xa4f5('0x82'))]['ValidationError'](_0xa4f5('0x74'));}return _0x306a32;})[_0xa4f5('0x1c')](handleEntityNotFound(_0x1378a7,null))['then'](function(_0x4d6ee0){return db[_0xa4f5('0x59')][_0xa4f5('0x89')]({'attributes':['id',_0xa4f5('0x8a'),_0xa4f5('0x8b'),'passwordHistoryLimit']})[_0xa4f5('0x1c')](function(_0x1aba9a){if(_0x1aba9a[_0xa4f5('0x8a')])authService[_0xa4f5('0x5a')](_0x172251[_0xa4f5('0x54')][_0xa4f5('0x81')]);if(!_0x1aba9a[_0xa4f5('0x8b')]||!_0x4d6ee0[_0xa4f5('0x35')])return _0x4d6ee0;authService['validatePasswordHistory'](_0x172251['body']['newPassword'],_0x4d6ee0[_0xa4f5('0x35')],_0x1aba9a[_0xa4f5('0x8c')]);return _0x4d6ee0;})['then'](saveUpdates({'password':_0x172251[_0xa4f5('0x54')]['newPassword'],'passwordResetAt':_0x172251['user']['id']==_0x172251['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x172251[_0xa4f5('0x54')]['newPassword'],_0x4d6ee0['previousPasswords'])},null));})[_0xa4f5('0x1c')](respondWithResult(_0x1378a7,null))[_0xa4f5('0x4c')](handleError(_0x1378a7,null));};exports[_0xa4f5('0x8d')]=function(_0xc10065,_0x10890e){var _0x33bd2f=_0xc10065[_0xa4f5('0x54')]['channel'];return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0xc10065[_0xa4f5('0x4e')]['id']},'attributes':['id',_0xa4f5('0x29'),_0xa4f5('0x1d'),_0xa4f5('0x8e'),_0xa4f5('0x8f'),_0xa4f5('0x90'),_0xa4f5('0x91')]})['then'](handleEntityNotFound(_0x10890e,null))[_0xa4f5('0x1c')](function(_0x41d274){if(_0x41d274){if(!utils[_0xa4f5('0x92')](_0x33bd2f)){throw new db['Sequelize'][(_0xa4f5('0x83'))](_0xa4f5('0x93'));}return _0x41d274[_0xa4f5('0x94')+_['capitalize'](_0x33bd2f[_0xa4f5('0x95')]())+_0xa4f5('0x96')](_0xc10065[_0xa4f5('0x54')][_0xa4f5('0x58')],{'penalty':_0xc10065['body'][_0xa4f5('0x97')]||0x0})['spread'](function(_0x25ea38){for(var _0x3ceb38=0x0;_0x3ceb38<_0xc10065[_0xa4f5('0x54')]['ids']['length'];_0x3ceb38+=0x1){var _0x445c82={'UserId':Number(_0xc10065[_0xa4f5('0x4e')]['id'])};_0x445c82[_[_0xa4f5('0x98')](_0x33bd2f['toLowerCase']())+_0xa4f5('0x99')]=Number(_0xc10065[_0xa4f5('0x54')][_0xa4f5('0x58')][_0x3ceb38]);socket[_0xa4f5('0x1f')]('user'+_[_0xa4f5('0x98')](_0x33bd2f['toLowerCase']())+'Queue:save',_0x445c82);}return _0x25ea38;})[_0xa4f5('0x1c')](function(){if(_0x33bd2f==='voice'){return db[_0xa4f5('0x9a')][_0xa4f5('0x41')]({'where':{'id':_0xc10065[_0xa4f5('0x54')][_0xa4f5('0x58')]||[]},'raw':!![],'attributes':['id',_0xa4f5('0x29')]});}})[_0xa4f5('0x1c')](function(_0x1caa2d){var _0xdff0b9=_0x41d274[_0xa4f5('0x9b')]({'plain':!![]});var _0x249306=[];if(_0x33bd2f===_0xa4f5('0x9c')&&_0xdff0b9[_0xa4f5('0x1d')]===_0xa4f5('0x1e')&&_0xdff0b9[_0xa4f5('0x8e')]){for(let _0x1a343f=0x0;_0x1a343f<_0x1caa2d['length'];_0x1a343f+=0x1){_0x249306[_0xa4f5('0x40')]({'membername':_0xdff0b9['name'],'UserId':_0xdff0b9['id'],'queue_name':_0x1caa2d[_0x1a343f][_0xa4f5('0x29')],'VoiceQueueId':_0x1caa2d[_0x1a343f]['id'],'interface':_[_0xa4f5('0x5e')](_0xdff0b9[_0xa4f5('0x91')])?util[_0xa4f5('0x9d')](_0xa4f5('0x9e'),_0xdff0b9['name']):_0xdff0b9['interface'],'paused':_0xdff0b9[_0xa4f5('0x90')]||![],'penalty':_0xc10065[_0xa4f5('0x54')][_0xa4f5('0x97')]||0x0});}return Promise[_0xa4f5('0x4b')](_0x249306['map'](function(_0x1f1cc7){return db['UserVoiceQueueRt'][_0xa4f5('0x9f')](_0x1f1cc7);}));}return _0x41d274;});}})[_0xa4f5('0x1c')](respondWithStatusCode(_0x10890e,null))[_0xa4f5('0x4c')](handleError(_0x10890e,null));};exports[_0xa4f5('0xa0')]=function(_0x2434dc,_0x30df6e){var _0x2f7f79,_0x5ac260;return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x2434dc[_0xa4f5('0x4e')]['id']},'attributes':['id','name',_0xa4f5('0x1d')]})['then'](handleEntityNotFound(_0x30df6e,null))[_0xa4f5('0x1c')](function(_0x2d374c){if(_0x2d374c){_0x2f7f79=_0x2d374c;if(!_0x2434dc[_0xa4f5('0x3a')]['channel']||!utils[_0xa4f5('0x92')](_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0xa1')])){throw new db['Sequelize'][(_0xa4f5('0x83'))](_0xa4f5('0x93'));}return _0x2d374c[_0xa4f5('0xa2')+_[_0xa4f5('0x98')](_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0xa1')][_0xa4f5('0x95')]())+_0xa4f5('0x96')](_0x2434dc['query'][_0xa4f5('0x58')]);}})[_0xa4f5('0x1c')](function(_0x4ba30b){if(_[_0xa4f5('0xa3')](_0x2434dc['query'][_0xa4f5('0x58')])){for(var _0x40ac07=0x0;_0x40ac07<_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0x58')][_0xa4f5('0x44')];_0x40ac07+=0x1){_0x5ac260={'UserId':Number(_0x2434dc[_0xa4f5('0x4e')]['id'])};_0x5ac260[_[_0xa4f5('0x98')](_0x2434dc[_0xa4f5('0x3a')]['channel'][_0xa4f5('0x95')]())+_0xa4f5('0x99')]=Number(_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0x58')][_0x40ac07]);socket[_0xa4f5('0x1f')](_0xa4f5('0x23')+_[_0xa4f5('0x98')](_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0xa1')][_0xa4f5('0x95')]())+_0xa4f5('0xa4'),_0x5ac260);}}else{_0x5ac260={'UserId':Number(_0x2434dc[_0xa4f5('0x4e')]['id'])};_0x5ac260[_['capitalize'](_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0xa1')][_0xa4f5('0x95')]())+_0xa4f5('0x99')]=Number(_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0x58')]);socket[_0xa4f5('0x1f')](_0xa4f5('0x23')+_[_0xa4f5('0x98')](_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0xa1')][_0xa4f5('0x95')]())+_0xa4f5('0xa4'),_0x5ac260);}return _0x4ba30b;})['then'](function(){if(_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0xa1')]===_0xa4f5('0x9c')){return db[_0xa4f5('0xa5')]['destroy']({'where':{'UserId':_0x2434dc[_0xa4f5('0x4e')]['id'],'VoiceQueueId':_0x2434dc['query'][_0xa4f5('0x58')]},'individualHooks':!![]})[_0xa4f5('0x1c')](function(){return _0x2f7f79;});}return _0x2f7f79;})['then'](respondWithStatusCode(_0x30df6e,null))[_0xa4f5('0x4c')](handleError(_0x30df6e,null));};exports[_0xa4f5('0xa6')]=function(_0x4515f7,_0x532fd9){_0x4515f7[_0xa4f5('0x54')][_0xa4f5('0xa7')]=_0x4515f7[_0xa4f5('0xa8')][_0xa4f5('0xa9')];return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x4515f7[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x532fd9,null))[_0xa4f5('0x1c')](saveUpdates(_0x4515f7[_0xa4f5('0x54')],null))[_0xa4f5('0x1c')](respondWithResult(_0x532fd9,null))[_0xa4f5('0x4c')](handleError(_0x532fd9,null));};exports[_0xa4f5('0xaa')]=function(_0x582322,_0x248c84){var _0x60aea0=path['join'](config[_0xa4f5('0xab')],_0xa4f5('0xac'));return db['User'][_0xa4f5('0x28')]({'where':{'id':_0x582322[_0xa4f5('0x4e')]['id']},'attributes':['id',_0xa4f5('0xa7')],'raw':!![]})['then'](handleEntityNotFound(_0x248c84,null))[_0xa4f5('0x1c')](function(_0x2af19b){if(_0x2af19b){if(_[_0xa4f5('0x5e')](_0x2af19b[_0xa4f5('0xa7')])){return _0x248c84[_0xa4f5('0xad')](_0x60aea0);}else{if(!fs[_0xa4f5('0xae')](path[_0xa4f5('0xaf')](config[_0xa4f5('0xab')],_0xa4f5('0xb0'),_0x2af19b[_0xa4f5('0xa7')]))){return _0x248c84[_0xa4f5('0xad')](_0x60aea0);}return _0x248c84[_0xa4f5('0xad')](path['join'](config[_0xa4f5('0xab')],_0xa4f5('0xb0'),_0x2af19b[_0xa4f5('0xa7')]));}}})['catch'](handleError(_0x248c84,null));};exports[_0xa4f5('0xb1')]=function(_0x50d3d1,_0x43952e){return db['User'][_0xa4f5('0x28')]({'where':{'id':_0x50d3d1[_0xa4f5('0x4e')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x43952e,null))[_0xa4f5('0x1c')](function(_0x341239){var _0x510d0b=[];values=_0x341239[_0xa4f5('0x46')];_0x510d0b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x45'),_0x341239[_0xa4f5('0x46')]));_0x510d0b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x47'),_0x341239['dataValues']));_0x510d0b['push'](get_open_tabs('openchannel',_0x341239[_0xa4f5('0x46')]));_0x510d0b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x4a'),_0x341239[_0xa4f5('0x46')]));_0x510d0b[_0xa4f5('0x40')](get_open_tabs('fax',_0x341239[_0xa4f5('0x46')]));_0x510d0b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x48'),_0x341239['dataValues']));return Promise[_0xa4f5('0x4b')](_0x510d0b);})[_0xa4f5('0x1c')](function(_0x34fa9f){if(_0x34fa9f){var _0x30b3f9=_['map'](values['ChatOpenTabs'],function(_0x13fa49){return{'channel':_0xa4f5('0xb2'),'id':_0x13fa49['id'],'createdAt':_0x13fa49[_0xa4f5('0xb3')]};});var _0x3f45bc=_[_0xa4f5('0x31')](values['FaxOpenTabs'],function(_0x57e3e5){return{'channel':'FAX','id':_0x57e3e5['id'],'createdAt':_0x57e3e5[_0xa4f5('0xb3')]};});var _0x4da081=_['map'](values[_0xa4f5('0xb4')],function(_0x5aeaef){return{'channel':_0xa4f5('0xb5'),'id':_0x5aeaef['id'],'createdAt':_0x5aeaef['createdAt']};});var _0x525c0e=_[_0xa4f5('0x31')](values['MailOpenTabs'],function(_0x41233b){return{'channel':_0xa4f5('0xb6'),'id':_0x41233b['id'],'createdAt':_0x41233b['createdAt']};});var _0x4bf931=_[_0xa4f5('0x31')](values['SmsOpenTabs'],function(_0x3daec2){return{'channel':_0xa4f5('0xb7'),'id':_0x3daec2['id'],'createdAt':_0x3daec2[_0xa4f5('0xb3')]};});var _0x3ef976=_[_0xa4f5('0x31')](values['WhatsappOpenTabs'],function(_0x5dfd9d){return{'channel':_0xa4f5('0xb8'),'id':_0x5dfd9d['id'],'createdAt':_0x5dfd9d[_0xa4f5('0xb3')]};});var _0x29252c=_[_0xa4f5('0xb9')](_0x30b3f9,_0x3f45bc,_0x4da081,_0x525c0e,_0x4bf931,_0x3ef976);var _0x889c68={'count':_0x29252c[_0xa4f5('0x44')],'rows':_0x29252c};return _0x889c68;}else return null;})[_0xa4f5('0x1c')](respondWithResult(_0x43952e,null))[_0xa4f5('0x4c')](handleError(_0x43952e,null));};exports['getContacts']=function(_0x33ef08,_0xe8f0b6){var _0x372a40={};return db[_0xa4f5('0x2f')]['findOne']({'where':{'id':_0x33ef08[_0xa4f5('0x4e')]['id']}})['then'](function(_0x4e9fe0){if(!_0x4e9fe0){throw new APINotFoundError(util[_0xa4f5('0x9d')](_0xa4f5('0xba'),_0x33ef08[_0xa4f5('0x4e')]['id']));}return contacts[_0xa4f5('0x55')]();})[_0xa4f5('0x1c')](function(_0x424749){_0x33ef08[_0xa4f5('0x3a')][_0xa4f5('0x2f')]=_0x33ef08[_0xa4f5('0x4e')]['id'];_0x372a40=qs[_0xa4f5('0x39')](_0x424749,_0x33ef08);if(_0x33ef08[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0x4f'))){_0x372a40[_0xa4f5('0x3b')]=[{'model':db[_0xa4f5('0xbc')],'as':'List','required':![]},{'model':db['Tag'],'as':_0xa4f5('0xbd'),'attributes':['id',_0xa4f5('0x29'),_0xa4f5('0xbe')],'where':_0x33ef08[_0xa4f5('0x3a')][_0xa4f5('0xbf')]?{'id':_0x33ef08[_0xa4f5('0x3a')]['tag']}:undefined,'required':_0x33ef08['query']['tag']?!![]:![]}];}return contacts[_0xa4f5('0x41')](_0x33ef08['query'],_0x33ef08[_0xa4f5('0x23')],_0x372a40,_0x424749);})[_0xa4f5('0x1c')](respondWithFilteredResult(_0xe8f0b6,_0x372a40))[_0xa4f5('0x4c')](APIHandleError(_0xe8f0b6));};exports[_0xa4f5('0xc0')]=function(_0x4953af,_0x4b609f){var _0x41e1e6;var _0x205cc6={};var _0x442935;return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x4953af[_0xa4f5('0x4e')]['id']},'attributes':['id',_0xa4f5('0x29'),_0xa4f5('0x1d')]})[_0xa4f5('0x1c')](handleEntityNotFound(_0x4b609f,null))[_0xa4f5('0x1c')](function(_0x1a9262){if(!utils[_0xa4f5('0x92')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xa1')])){throw new db[(_0xa4f5('0x82'))][(_0xa4f5('0x83'))](_0xa4f5('0x93'));}_0x41e1e6=_0x1a9262;var _0x2926ad={};_0x2926ad['model']=_[_0xa4f5('0xc1')](db[_[_0xa4f5('0x98')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xa1')])+'Queue'][_0xa4f5('0x30')]);_0x2926ad[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x4953af[_0xa4f5('0x3a')]);_0x2926ad[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0x2926ad['model'],_0x2926ad['query']);_0x205cc6['attributes']=_['intersection'](_0x2926ad[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x205cc6['attributes']=_0x205cc6[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x205cc6[_0xa4f5('0x3f')]:_0x2926ad[_0xa4f5('0xc4')];_0x205cc6[_0xa4f5('0xc6')]=qs[_0xa4f5('0xc7')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x205cc6[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_[_0xa4f5('0xc9')](_0x4953af[_0xa4f5('0x3a')],_0x2926ad[_0xa4f5('0xc2')]));if(_0x4953af[_0xa4f5('0x3a')]['filter']){_0x205cc6['where']=_[_0xa4f5('0x50')](_0x205cc6[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x205cc6['attributes'],function(_0x4142d8){var _0x49f55b={};_0x49f55b[_0x4142d8]={'$like':'%'+_0x4953af[_0xa4f5('0x3a')]['filter']+'%'};return _0x49f55b;})});}_0x205cc6=_['merge']({},_0x205cc6,_0x4953af[_0xa4f5('0x51')]);switch(_0x41e1e6[_0xa4f5('0x1d')]){case _0xa4f5('0x21'):return db[_['capitalize'](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xa1')])+'Queue'][_0xa4f5('0x41')](_0x205cc6);case _0xa4f5('0x23'):case _0xa4f5('0x1e'):return _0x41e1e6[_0xa4f5('0x9b')+_[_0xa4f5('0x98')](_0x4953af['query'][_0xa4f5('0xa1')])+'Queues'](_0x205cc6);default:throw new db[(_0xa4f5('0x82'))]['ValidationError']('Unknown\x20role');}})[_0xa4f5('0x1c')](function(_0x247b99){_0x442935=_0x247b99[_0xa4f5('0x44')];if(!_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0x205cc6[_0xa4f5('0x15')]=qs[_0xa4f5('0x15')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x205cc6['offset']=qs['offset'](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}switch(_0x41e1e6[_0xa4f5('0x1d')]){case _0xa4f5('0x21'):return db[_[_0xa4f5('0x98')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xa1')])+_0xa4f5('0xcb')][_0xa4f5('0x41')](_0x205cc6);case'user':case'agent':return _0x41e1e6[_0xa4f5('0x9b')+_[_0xa4f5('0x98')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xa1')])+_0xa4f5('0x96')](_0x205cc6);}})['then'](function(_0x5cf667){return{'count':_0x442935,'rows':_0x5cf667};})[_0xa4f5('0x1c')](respondWithResult(_0x4b609f,null))[_0xa4f5('0x4c')](handleError(_0x4b609f,null));};exports[_0xa4f5('0xcc')]=function(_0x8df049,_0x5e66c6){var _0xde0ea7={};var _0x2fc2bf={};var _0x415240;var _0x200dd6;return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x8df049[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x5e66c6,null))[_0xa4f5('0x1c')](function(_0x1f5117){if(_0x1f5117){_0x415240=_0x1f5117;_0x2fc2bf[_0xa4f5('0xc4')]=_[_0xa4f5('0xc1')](db['UserVoiceQueueRt'][_0xa4f5('0x30')]);_0x2fc2bf[_0xa4f5('0x3a')]=_['keys'](_0x8df049[_0xa4f5('0x3a')]);_0x2fc2bf[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0x2fc2bf['model'],_0x2fc2bf[_0xa4f5('0x3a')]);_0xde0ea7[_0xa4f5('0x3f')]=_['intersection'](_0x2fc2bf['model'],qs[_0xa4f5('0xc5')](_0x8df049[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0xde0ea7[_0xa4f5('0x3f')]=_0xde0ea7[_0xa4f5('0x3f')]['length']?_0xde0ea7[_0xa4f5('0x3f')]:_0x2fc2bf[_0xa4f5('0xc4')];_0xde0ea7[_0xa4f5('0xc6')]=qs['sort'](_0x8df049[_0xa4f5('0x3a')]['sort']);_0xde0ea7[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_[_0xa4f5('0xc9')](_0x8df049[_0xa4f5('0x3a')],_0x2fc2bf[_0xa4f5('0xc2')]));if(_0x8df049[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0xde0ea7[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0xde0ea7[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0xde0ea7['attributes'],function(_0x4d24fe){var _0x1e0b29={};_0x1e0b29[_0x4d24fe]={'$like':'%'+_0x8df049[_0xa4f5('0x3a')]['filter']+'%'};return _0x1e0b29;})});}_0xde0ea7=_[_0xa4f5('0x50')]({},_0xde0ea7,_0x8df049['options']);return _0x415240[_0xa4f5('0xcc')](_0xde0ea7);}})[_0xa4f5('0x1c')](function(_0x2f9196){if(_0x2f9196){_0x200dd6=_0x2f9196[_0xa4f5('0x44')];if(!_0x8df049[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0xde0ea7[_0xa4f5('0x15')]=qs['limit'](_0x8df049[_0xa4f5('0x3a')]['limit']);_0xde0ea7[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x8df049[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x415240[_0xa4f5('0xcc')](_0xde0ea7);}})[_0xa4f5('0x1c')](function(_0x38449f){if(_0x38449f){return _0x38449f?{'count':_0x200dd6,'rows':_0x38449f}:null;}})['then'](respondWithResult(_0x5e66c6,null))[_0xa4f5('0x4c')](handleError(_0x5e66c6,null));};exports[_0xa4f5('0xce')]=function(_0xa6b1c3,_0x4a05ec){var _0x54747a={};var _0x24ddc8={};var _0x3a7063;var _0x356b7c;return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0xa6b1c3['params']['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x4a05ec,null))['then'](function(_0x892ae0){if(_0x892ae0){_0x3a7063=_0x892ae0;_0x24ddc8['model']=_[_0xa4f5('0xc1')](db[_0xa4f5('0xcf')][_0xa4f5('0x30')]);_0x24ddc8[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0xa6b1c3[_0xa4f5('0x3a')]);_0x24ddc8[_0xa4f5('0xc2')]=_['intersection'](_0x24ddc8[_0xa4f5('0xc4')],_0x24ddc8['query']);_0x54747a[_0xa4f5('0x3f')]=_[_0xa4f5('0xc3')](_0x24ddc8[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0xa6b1c3[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x54747a[_0xa4f5('0x3f')]=_0x54747a['attributes'][_0xa4f5('0x44')]?_0x54747a['attributes']:_0x24ddc8[_0xa4f5('0xc4')];_0x54747a[_0xa4f5('0xc6')]=qs['sort'](_0xa6b1c3[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x54747a[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_['pick'](_0xa6b1c3['query'],_0x24ddc8['filters']));if(_0xa6b1c3['query'][_0xa4f5('0xcd')]){_0x54747a['where']=_['merge'](_0x54747a[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x54747a['attributes'],function(_0x1d39da){var _0x5e039e={};_0x5e039e[_0x1d39da]={'$like':'%'+_0xa6b1c3[_0xa4f5('0x3a')][_0xa4f5('0xcd')]+'%'};return _0x5e039e;})});}_0x54747a=_[_0xa4f5('0x50')]({},_0x54747a,_0xa6b1c3[_0xa4f5('0x51')]);return _0x3a7063[_0xa4f5('0xce')](_0x54747a);}})['then'](function(_0x1c9621){if(_0x1c9621){_0x356b7c=_0x1c9621['length'];if(!_0xa6b1c3[_0xa4f5('0x3a')]['hasOwnProperty']('nolimit')){_0x54747a[_0xa4f5('0x15')]=qs['limit'](_0xa6b1c3['query'][_0xa4f5('0x15')]);_0x54747a['offset']=qs[_0xa4f5('0x18')](_0xa6b1c3[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x3a7063[_0xa4f5('0xce')](_0x54747a);}})[_0xa4f5('0x1c')](function(_0x1fade8){if(_0x1fade8){return _0x1fade8?{'count':_0x356b7c,'rows':_0x1fade8}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x4a05ec,null))[_0xa4f5('0x4c')](handleError(_0x4a05ec,null));};exports['getRecordings']=function(_0x771fb5,_0x170154){var _0x4daa22={'raw':!![],'where':{}};var _0x47ca08={};var _0x1136c6={'count':0x0,'rows':[]};return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x771fb5[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x170154,null))['then'](function(_0x3527c4){if(_0x3527c4){_0x47ca08[_0xa4f5('0xc4')]=_['keys'](db[_0xa4f5('0xd0')][_0xa4f5('0x30')]);_0x47ca08[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x771fb5[_0xa4f5('0x3a')]);_0x47ca08['filters']=_[_0xa4f5('0xc3')](_0x47ca08[_0xa4f5('0xc4')],_0x47ca08[_0xa4f5('0x3a')]);_0x4daa22[_0xa4f5('0x3f')]=_[_0xa4f5('0xc3')](_0x47ca08[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0x771fb5['query'][_0xa4f5('0xc5')]));_0x4daa22[_0xa4f5('0x3f')]=_0x4daa22[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x4daa22['attributes']:_0x47ca08[_0xa4f5('0xc4')];if(!_0x771fb5['query'][_0xa4f5('0xbb')]('nolimit')){_0x4daa22[_0xa4f5('0x15')]=qs['limit'](_0x771fb5[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x4daa22[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x771fb5['query']['offset']);}_0x4daa22[_0xa4f5('0xc6')]=qs[_0xa4f5('0xc7')](_0x771fb5[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x4daa22['where']=qs[_0xa4f5('0xc2')](_['pick'](_0x771fb5[_0xa4f5('0x3a')],_0x47ca08[_0xa4f5('0xc2')]));_0x4daa22[_0xa4f5('0xc8')][_0xa4f5('0xd1')]=_0x3527c4['id'];if(_0x771fb5['query']['filter']){_0x4daa22['where']=_[_0xa4f5('0x50')](_0x4daa22[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x4daa22[_0xa4f5('0x3f')],function(_0x4c2dbc){var _0x448d2d={};_0x448d2d[_0x4c2dbc]={'$like':'%'+_0x771fb5['query']['filter']+'%'};return _0x448d2d;})});}_0x4daa22=_[_0xa4f5('0x50')]({},_0x4daa22,_0x771fb5['options']);return db[_0xa4f5('0xd0')]['count']({'where':_0x4daa22[_0xa4f5('0xc8')]})[_0xa4f5('0x1c')](function(_0x5bf23e){_0x1136c6[_0xa4f5('0x17')]=_0x5bf23e;if(_0x771fb5[_0xa4f5('0x3a')][_0xa4f5('0x4f')]){_0x4daa22['include']=[{'all':!![]}];}return db[_0xa4f5('0xd0')][_0xa4f5('0x41')](_0x4daa22);})[_0xa4f5('0x1c')](function(_0x4d5690){_0x1136c6[_0xa4f5('0x42')]=_0x4d5690;return _0x1136c6;});}})[_0xa4f5('0x1c')](respondWithFilteredResult(_0x170154,_0x4daa22))[_0xa4f5('0x4c')](handleError(_0x170154,null));};exports['getScreenRecordings']=function(_0x3c24be,_0x50b650){var _0x327841={'raw':!![],'where':{}};var _0x2e8b6d={};var _0x471d89={'count':0x0,'rows':[]};return db[_0xa4f5('0x2f')]['findOne']({'where':{'id':_0x3c24be[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x50b650,null))[_0xa4f5('0x1c')](function(_0x3e385f){if(_0x3e385f){_0x2e8b6d[_0xa4f5('0xc4')]=_[_0xa4f5('0xc1')](db[_0xa4f5('0xd2')][_0xa4f5('0x30')]);_0x2e8b6d[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x3c24be['query']);_0x2e8b6d[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0x2e8b6d['model'],_0x2e8b6d['query']);_0x327841['attributes']=_[_0xa4f5('0xc3')](_0x2e8b6d[_0xa4f5('0xc4')],qs['fields'](_0x3c24be[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x327841[_0xa4f5('0x3f')]=_0x327841[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x327841[_0xa4f5('0x3f')]:_0x2e8b6d[_0xa4f5('0xc4')];if(!_0x3c24be[_0xa4f5('0x3a')][_0xa4f5('0xbb')]('nolimit')){_0x327841[_0xa4f5('0x15')]=qs[_0xa4f5('0x15')](_0x3c24be[_0xa4f5('0x3a')]['limit']);_0x327841[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x3c24be['query']['offset']);}_0x327841[_0xa4f5('0xc6')]=qs['sort'](_0x3c24be[_0xa4f5('0x3a')]['sort']);_0x327841[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_[_0xa4f5('0xc9')](_0x3c24be[_0xa4f5('0x3a')],_0x2e8b6d[_0xa4f5('0xc2')]));_0x327841[_0xa4f5('0xc8')][_0xa4f5('0xd1')]=_0x3e385f['id'];if(_0x3c24be[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x327841[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0x327841[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x327841['attributes'],function(_0x3b444b){var _0x33f47a={};_0x33f47a[_0x3b444b]={'$like':'%'+_0x3c24be[_0xa4f5('0x3a')]['filter']+'%'};return _0x33f47a;})});}_0x327841=_['merge']({},_0x327841,_0x3c24be[_0xa4f5('0x51')]);return db[_0xa4f5('0xd2')][_0xa4f5('0x17')]({'where':_0x327841[_0xa4f5('0xc8')]})[_0xa4f5('0x1c')](function(_0x22fa7f){_0x471d89[_0xa4f5('0x17')]=_0x22fa7f;if(_0x3c24be[_0xa4f5('0x3a')][_0xa4f5('0x4f')]){_0x327841[_0xa4f5('0x3b')]=[{'all':!![]}];}return db[_0xa4f5('0xd2')][_0xa4f5('0x41')](_0x327841);})[_0xa4f5('0x1c')](function(_0x1bbdc4){_0x471d89['rows']=_0x1bbdc4;return _0x471d89;});}})['then'](respondWithFilteredResult(_0x50b650,_0x327841))[_0xa4f5('0x4c')](handleError(_0x50b650,null));};exports[_0xa4f5('0xd3')]=function(_0x741b4b,_0x2888a1){var _0xdbe535={};var _0x18bf01={};var _0x2141ea;var _0x9fec4e;return db[_0xa4f5('0x2f')]['findOne']({'where':{'id':_0x741b4b[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x2888a1,null))[_0xa4f5('0x1c')](function(_0x552448){if(_0x552448){_0x2141ea=_0x552448;_0x18bf01[_0xa4f5('0xc4')]=_[_0xa4f5('0xc1')](db[_0xa4f5('0xd4')][_0xa4f5('0x30')]);_0x18bf01[_0xa4f5('0x3a')]=_['keys'](_0x741b4b[_0xa4f5('0x3a')]);_0x18bf01[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0x18bf01[_0xa4f5('0xc4')],_0x18bf01[_0xa4f5('0x3a')]);_0xdbe535[_0xa4f5('0x3f')]=_[_0xa4f5('0xc3')](_0x18bf01[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0x741b4b[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0xdbe535['attributes']=_0xdbe535[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0xdbe535['attributes']:_0x18bf01['model'];_0xdbe535[_0xa4f5('0xc6')]=qs[_0xa4f5('0xc7')](_0x741b4b[_0xa4f5('0x3a')]['sort']);_0xdbe535[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_[_0xa4f5('0xc9')](_0x741b4b[_0xa4f5('0x3a')],_0x18bf01[_0xa4f5('0xc2')]));if(_0x741b4b[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0xdbe535[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0xdbe535[_0xa4f5('0xc8')],{'$or':_['map'](_0xdbe535['attributes'],function(_0x34be42){var _0x283f31={};_0x283f31[_0x34be42]={'$like':'%'+_0x741b4b[_0xa4f5('0x3a')]['filter']+'%'};return _0x283f31;})});}_0xdbe535=_[_0xa4f5('0x50')]({},_0xdbe535,_0x741b4b[_0xa4f5('0x51')]);return _0x2141ea[_0xa4f5('0xd3')](_0xdbe535);}})['then'](function(_0x38b5e8){if(_0x38b5e8){_0x9fec4e=_0x38b5e8[_0xa4f5('0x44')];if(!_0x741b4b[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0xdbe535[_0xa4f5('0x15')]=qs[_0xa4f5('0x15')](_0x741b4b[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0xdbe535[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x741b4b[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x2141ea[_0xa4f5('0xd3')](_0xdbe535);}})[_0xa4f5('0x1c')](function(_0x58cfd1){if(_0x58cfd1){return _0x58cfd1?{'count':_0x9fec4e,'rows':_0x58cfd1}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x2888a1,null))[_0xa4f5('0x4c')](handleError(_0x2888a1,null));};exports[_0xa4f5('0xd5')]=function(_0x3fd302,_0x4be537){var _0x18957f={};var _0x2e4fbe={};var _0x5930a7;var _0x2cd166;return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x3fd302['params']['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x4be537,null))[_0xa4f5('0x1c')](function(_0x568ac5){if(_0x568ac5){_0x5930a7=_0x568ac5;_0x2e4fbe['model']=_[_0xa4f5('0xc1')](db['OpenchannelInteraction'][_0xa4f5('0x30')]);_0x2e4fbe[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x3fd302['query']);_0x2e4fbe['filters']=_[_0xa4f5('0xc3')](_0x2e4fbe[_0xa4f5('0xc4')],_0x2e4fbe[_0xa4f5('0x3a')]);_0x18957f[_0xa4f5('0x3f')]=_[_0xa4f5('0xc3')](_0x2e4fbe['model'],qs[_0xa4f5('0xc5')](_0x3fd302[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x18957f[_0xa4f5('0x3f')]=_0x18957f[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x18957f[_0xa4f5('0x3f')]:_0x2e4fbe[_0xa4f5('0xc4')];_0x18957f[_0xa4f5('0xc6')]=qs[_0xa4f5('0xc7')](_0x3fd302[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x18957f[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_['pick'](_0x3fd302['query'],_0x2e4fbe['filters']));if(_0x3fd302[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x18957f[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0x18957f['where'],{'$or':_[_0xa4f5('0x31')](_0x18957f[_0xa4f5('0x3f')],function(_0x53caa3){var _0x437b77={};_0x437b77[_0x53caa3]={'$like':'%'+_0x3fd302['query'][_0xa4f5('0xcd')]+'%'};return _0x437b77;})});}_0x18957f=_[_0xa4f5('0x50')]({},_0x18957f,_0x3fd302[_0xa4f5('0x51')]);return _0x5930a7[_0xa4f5('0xd5')](_0x18957f);}})[_0xa4f5('0x1c')](function(_0x484058){if(_0x484058){_0x2cd166=_0x484058[_0xa4f5('0x44')];if(!_0x3fd302['query'][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0x18957f[_0xa4f5('0x15')]=qs[_0xa4f5('0x15')](_0x3fd302[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x18957f[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x3fd302[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x5930a7[_0xa4f5('0xd5')](_0x18957f);}})[_0xa4f5('0x1c')](function(_0x36eadc){if(_0x36eadc){return _0x36eadc?{'count':_0x2cd166,'rows':_0x36eadc}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x4be537,null))['catch'](handleError(_0x4be537,null));};exports['getMailInteractions']=function(_0x57d302,_0x3b79ce){var _0x450fd9={'raw':!![],'where':{}};var _0x5e7e37={};var _0x9d9d94={'count':0x0,'rows':[]};return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x57d302['params']['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x3b79ce,null))['then'](function(_0x131d71){if(_0x131d71){_0x5e7e37[_0xa4f5('0xc4')]=_[_0xa4f5('0xc1')](db[_0xa4f5('0xd6')][_0xa4f5('0x30')]);_0x5e7e37[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x57d302['query']);_0x5e7e37[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0x5e7e37[_0xa4f5('0xc4')],_0x5e7e37[_0xa4f5('0x3a')]);_0x450fd9[_0xa4f5('0x3f')]=_[_0xa4f5('0xc3')](_0x5e7e37[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0x57d302[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x450fd9[_0xa4f5('0x3f')]=_0x450fd9[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x450fd9[_0xa4f5('0x3f')]:_0x5e7e37[_0xa4f5('0xc4')];if(!_0x57d302[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0x450fd9[_0xa4f5('0x15')]=qs[_0xa4f5('0x15')](_0x57d302[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x450fd9[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x57d302['query']['offset']);}_0x450fd9['order']=qs[_0xa4f5('0xc7')](_0x57d302['query']['sort']);_0x450fd9['where']=qs['filters'](_['pick'](_0x57d302['query'],_0x5e7e37[_0xa4f5('0xc2')]));_0x450fd9[_0xa4f5('0xc8')]['UserId']=_0x131d71['id'];if(_0x57d302['query'][_0xa4f5('0xcd')]){_0x450fd9[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0x450fd9['where'],{'$or':_[_0xa4f5('0x31')](_0x450fd9[_0xa4f5('0x3f')],function(_0x51edd6){var _0x342ff8={};_0x342ff8[_0x51edd6]={'$like':'%'+_0x57d302['query'][_0xa4f5('0xcd')]+'%'};return _0x342ff8;})});}_0x450fd9=_[_0xa4f5('0x50')]({},_0x450fd9,_0x57d302[_0xa4f5('0x51')]);return db[_0xa4f5('0xd6')][_0xa4f5('0x17')]({'where':_0x450fd9[_0xa4f5('0xc8')]})[_0xa4f5('0x1c')](function(_0x2f28e8){_0x9d9d94['count']=_0x2f28e8;if(_0x57d302[_0xa4f5('0x3a')][_0xa4f5('0x4f')]){_0x450fd9[_0xa4f5('0x3b')]=[{'all':!![]}];}return db[_0xa4f5('0xd6')][_0xa4f5('0x41')](_0x450fd9);})[_0xa4f5('0x1c')](function(_0x194df1){_0x9d9d94['rows']=_0x194df1;return _0x9d9d94;});}})['then'](respondWithFilteredResult(_0x3b79ce,_0x450fd9))[_0xa4f5('0x4c')](handleError(_0x3b79ce,null));};exports[_0xa4f5('0xd7')]=function(_0x178b43,_0x525c4e){var _0x391643={};var _0x3d5239={};var _0x332085;var _0x3905fd;return db['User'][_0xa4f5('0x89')]({'where':{'id':_0x178b43['params']['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x525c4e,null))[_0xa4f5('0x1c')](function(_0x49d98a){if(_0x49d98a){_0x332085=_0x49d98a;_0x3d5239[_0xa4f5('0xc4')]=_[_0xa4f5('0xc1')](db[_0xa4f5('0xd8')][_0xa4f5('0x30')]);_0x3d5239['query']=_[_0xa4f5('0xc1')](_0x178b43[_0xa4f5('0x3a')]);_0x3d5239['filters']=_[_0xa4f5('0xc3')](_0x3d5239[_0xa4f5('0xc4')],_0x3d5239['query']);_0x391643[_0xa4f5('0x3f')]=_['intersection'](_0x3d5239[_0xa4f5('0xc4')],qs['fields'](_0x178b43['query'][_0xa4f5('0xc5')]));_0x391643[_0xa4f5('0x3f')]=_0x391643[_0xa4f5('0x3f')]['length']?_0x391643[_0xa4f5('0x3f')]:_0x3d5239[_0xa4f5('0xc4')];_0x391643['order']=qs[_0xa4f5('0xc7')](_0x178b43[_0xa4f5('0x3a')]['sort']);_0x391643[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_['pick'](_0x178b43[_0xa4f5('0x3a')],_0x3d5239['filters']));if(_0x178b43[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x391643[_0xa4f5('0xc8')]=_['merge'](_0x391643['where'],{'$or':_['map'](_0x391643[_0xa4f5('0x3f')],function(_0x4185da){var _0x3dbf73={};_0x3dbf73[_0x4185da]={'$like':'%'+_0x178b43[_0xa4f5('0x3a')][_0xa4f5('0xcd')]+'%'};return _0x3dbf73;})});}_0x391643=_[_0xa4f5('0x50')]({},_0x391643,_0x178b43[_0xa4f5('0x51')]);return _0x332085[_0xa4f5('0xd7')](_0x391643);}})[_0xa4f5('0x1c')](function(_0x341ee9){if(_0x341ee9){_0x3905fd=_0x341ee9['length'];if(!_0x178b43[_0xa4f5('0x3a')]['hasOwnProperty'](_0xa4f5('0xca'))){_0x391643[_0xa4f5('0x15')]=qs['limit'](_0x178b43['query'][_0xa4f5('0x15')]);_0x391643[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x178b43[_0xa4f5('0x3a')]['offset']);}return _0x332085[_0xa4f5('0xd7')](_0x391643);}})[_0xa4f5('0x1c')](function(_0x36d0cb){if(_0x36d0cb){return _0x36d0cb?{'count':_0x3905fd,'rows':_0x36d0cb}:null;}})['then'](respondWithResult(_0x525c4e,null))[_0xa4f5('0x4c')](handleError(_0x525c4e,null));};exports[_0xa4f5('0xd9')]=function(_0x3177b4,_0x5a437b){var _0x514b72={};var _0x3dfec5={};var _0x3f345e;var _0x277cac;return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x3177b4[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x5a437b,null))[_0xa4f5('0x1c')](function(_0x59e5f7){if(_0x59e5f7){_0x3f345e=_0x59e5f7;_0x3dfec5['model']=_[_0xa4f5('0xc1')](db[_0xa4f5('0xda')][_0xa4f5('0x30')]);_0x3dfec5[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x3177b4[_0xa4f5('0x3a')]);_0x3dfec5[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0x3dfec5[_0xa4f5('0xc4')],_0x3dfec5[_0xa4f5('0x3a')]);_0x514b72['attributes']=_[_0xa4f5('0xc3')](_0x3dfec5[_0xa4f5('0xc4')],qs['fields'](_0x3177b4[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x514b72[_0xa4f5('0x3f')]=_0x514b72[_0xa4f5('0x3f')]['length']?_0x514b72['attributes']:_0x3dfec5[_0xa4f5('0xc4')];_0x514b72[_0xa4f5('0xc6')]=qs['sort'](_0x3177b4[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x514b72[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_['pick'](_0x3177b4[_0xa4f5('0x3a')],_0x3dfec5['filters']));if(_0x3177b4[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x514b72[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0x514b72['where'],{'$or':_[_0xa4f5('0x31')](_0x514b72[_0xa4f5('0x3f')],function(_0x3c5717){var _0xfdee59={};_0xfdee59[_0x3c5717]={'$like':'%'+_0x3177b4[_0xa4f5('0x3a')][_0xa4f5('0xcd')]+'%'};return _0xfdee59;})});}_0x514b72=_[_0xa4f5('0x50')]({},_0x514b72,_0x3177b4[_0xa4f5('0x51')]);return _0x3f345e['getFaxInteractions'](_0x514b72);}})['then'](function(_0x50c7ff){if(_0x50c7ff){_0x277cac=_0x50c7ff[_0xa4f5('0x44')];if(!_0x3177b4[_0xa4f5('0x3a')]['hasOwnProperty'](_0xa4f5('0xca'))){_0x514b72['limit']=qs[_0xa4f5('0x15')](_0x3177b4[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x514b72[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x3177b4[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x3f345e['getFaxInteractions'](_0x514b72);}})[_0xa4f5('0x1c')](function(_0x9c8ec3){if(_0x9c8ec3){return _0x9c8ec3?{'count':_0x277cac,'rows':_0x9c8ec3}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x5a437b,null))[_0xa4f5('0x4c')](handleError(_0x5a437b,null));};exports[_0xa4f5('0xdb')]=function(_0x277003,_0x19725a){var _0x8e8077={};var _0x1142fb={};var _0x1edf56;var _0x36d6a4;return db[_0xa4f5('0x2f')]['findOne']({'where':{'id':_0x277003['params']['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x19725a,null))[_0xa4f5('0x1c')](function(_0x19ac3c){if(_0x19ac3c){_0x1edf56=_0x19ac3c;_0x1142fb[_0xa4f5('0xc4')]=_[_0xa4f5('0xc1')](db[_0xa4f5('0xdc')][_0xa4f5('0x30')]);_0x1142fb[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x277003[_0xa4f5('0x3a')]);_0x1142fb[_0xa4f5('0xc2')]=_['intersection'](_0x1142fb[_0xa4f5('0xc4')],_0x1142fb[_0xa4f5('0x3a')]);_0x8e8077['attributes']=_['intersection'](_0x1142fb[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0x277003[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x8e8077[_0xa4f5('0x3f')]=_0x8e8077['attributes']['length']?_0x8e8077[_0xa4f5('0x3f')]:_0x1142fb[_0xa4f5('0xc4')];_0x8e8077[_0xa4f5('0xc6')]=qs[_0xa4f5('0xc7')](_0x277003[_0xa4f5('0x3a')]['sort']);_0x8e8077[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_[_0xa4f5('0xc9')](_0x277003[_0xa4f5('0x3a')],_0x1142fb[_0xa4f5('0xc2')]));if(_0x277003[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x8e8077[_0xa4f5('0xc8')]=_['merge'](_0x8e8077[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x8e8077['attributes'],function(_0x5e4bb9){var _0x3fbffa={};_0x3fbffa[_0x5e4bb9]={'$like':'%'+_0x277003[_0xa4f5('0x3a')][_0xa4f5('0xcd')]+'%'};return _0x3fbffa;})});}_0x8e8077=_[_0xa4f5('0x50')]({},_0x8e8077,_0x277003[_0xa4f5('0x51')]);return _0x1edf56['getWhatsappInteractions'](_0x8e8077);}})[_0xa4f5('0x1c')](function(_0x5e8a78){if(_0x5e8a78){_0x36d6a4=_0x5e8a78[_0xa4f5('0x44')];if(!_0x277003[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0x8e8077['limit']=qs[_0xa4f5('0x15')](_0x277003[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x8e8077[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x277003[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x1edf56[_0xa4f5('0xdb')](_0x8e8077);}})[_0xa4f5('0x1c')](function(_0x50fb26){if(_0x50fb26){return _0x50fb26?{'count':_0x36d6a4,'rows':_0x50fb26}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x19725a,null))[_0xa4f5('0x4c')](handleError(_0x19725a,null));};exports[_0xa4f5('0xdd')]=function(_0x9d62ec,_0x49a994,_0x51732d){var _0x374394;var _0x5058ee;var _0x11cb93;var _0x8bd602=!_[_0xa4f5('0x5e')](_0x9d62ec[_0xa4f5('0x4e')]['id'])?_0x9d62ec[_0xa4f5('0x4e')]['id']:!_[_0xa4f5('0x5e')](_0x9d62ec[_0xa4f5('0x23')]['id'])?_0x9d62ec['user']['id']:null;return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x8bd602,'role':{'$or':[_0xa4f5('0x21'),_0xa4f5('0x23'),_0xa4f5('0x1e')]}},'attributes':['id',_0xa4f5('0x29'),_0xa4f5('0xde'),_0xa4f5('0xdf'),_0xa4f5('0x1d'),_0xa4f5('0x5c'),_0xa4f5('0x8f')]})[_0xa4f5('0x1c')](function(_0x47364e){if(_0x47364e){if(_0x47364e[_0xa4f5('0x1d')]==='agent'){_0x374394=_0x47364e;if(_0x9d62ec[_0xa4f5('0x54')][_0xa4f5('0x91')]){_0x11cb93=util[_0xa4f5('0x9d')]('LOCAL/%s@from-sip/n',_0x374394[_0x9d62ec[_0xa4f5('0x54')]['interface']]);}else if(_0x9d62ec[_0xa4f5('0x54')][_0xa4f5('0xe0')]){_0x11cb93=util['format']('SIP/%s',_0x9d62ec[_0xa4f5('0x54')][_0xa4f5('0xe0')]);}else{_0x11cb93=util['format'](_0xa4f5('0x9e'),_0x374394[_0xa4f5('0x29')]);}socket['to'](util[_0xa4f5('0x9d')]('user:%s',_0x374394[_0xa4f5('0x29')]))[_0xa4f5('0x1f')](_0xa4f5('0xe1'),{'user':{'id':_0x374394['id'],'name':_0x374394[_0xa4f5('0x29')]},'ip':_0x9d62ec[_0xa4f5('0xe2')][_0xa4f5('0xe3')]||_0x9d62ec[_0xa4f5('0xe4')][_0xa4f5('0xe5')]||_0x9d62ec[_0xa4f5('0xe6')][_0xa4f5('0xe5')]||_0x9d62ec[_0xa4f5('0xe4')][_0xa4f5('0xe6')][_0xa4f5('0xe5')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x374394[_0xa4f5('0x29')]},'individualHooks':!![]});}}else{throw new db[(_0xa4f5('0x82'))]['ValidationError'](_0xa4f5('0xe7'));}})[_0xa4f5('0x1c')](function(){if(_0x374394){return _0x374394[_0xa4f5('0xe8')]({'raw':!![]});}})[_0xa4f5('0x1c')](function(_0x2a779b){if(_0x374394){if(_0x2a779b){_0x5058ee=_0x2a779b;if(_0x5058ee['length']){var _0x450cec=_0x5058ee[_0xa4f5('0x31')](function(_0xf6fe02){var _0x5ce1ac={'membername':_0x374394['name'],'UserId':_0x374394['id'],'queue_name':_0xf6fe02['name'],'VoiceQueueId':_0xf6fe02['id'],'interface':_0x11cb93,'paused':_0x374394[_0xa4f5('0x8f')]||![],'penalty':_0xf6fe02[_0xa4f5('0xe9')]||0x0};return db['UserVoiceQueueRt'][_0xa4f5('0x9f')](_0x5ce1ac);});return Promise['all'](_0x450cec);}}}})[_0xa4f5('0x1c')](function(){if(_0x374394){return db[_0xa4f5('0xea')][_0xa4f5('0x41')]({'where':{'membername':_0x374394[_0xa4f5('0x29')],'exitAt':null}});}})[_0xa4f5('0x1c')](function(_0x158010){if(_0x374394){var _0x2526cc=[];_0x158010['forEach'](function(_0x4c8822){_0x2526cc[_0xa4f5('0x40')](_0x4c8822[_0xa4f5('0x53')]({'exitAt':moment()['format'](_0xa4f5('0xeb'))}));});return Promise[_0xa4f5('0x4b')](_0x2526cc);}})['then'](function(){if(_0x374394){var _0x54a30f=[];var _0x18f285=[];var _0x37a74a=utils[_0xa4f5('0xec')]();var _0x394b21={'membername':_0x374394[_0xa4f5('0x29')],'interface':_0x11cb93,'enterAt':moment()[_0xa4f5('0x9d')](_0xa4f5('0xeb')),'role':_0x374394[_0xa4f5('0x1d')],'internal':_0x374394[_0xa4f5('0x5c')]};_0x37a74a[_0xa4f5('0xed')](function(_0x275054){_0x54a30f[_0xa4f5('0x40')](_[_0xa4f5('0x50')]({'channel':_0x275054,'type':_0xa4f5('0xee'),'data1':_0x9d62ec['body'][_0xa4f5('0xef')],'data2':_0x11cb93},_0x394b21));if(_0x374394[_0xa4f5('0x8f')]){_0x18f285[_0xa4f5('0x40')](_['merge']({'channel':_0x275054,'type':_0xa4f5('0xf0'),'data1':_0xa4f5('0xf1')},_0x394b21));}});return db[_0xa4f5('0xea')]['bulkCreate'](_0x54a30f[_0xa4f5('0xb9')](_0x18f285),{'individualHooks':!![]});}})[_0xa4f5('0x1c')](function(){if(_0x374394){return _0x374394[_0xa4f5('0x53')]({'online':!![],'lastLoginAt':moment()[_0xa4f5('0x9d')](_0xa4f5('0xeb')),'voicePause':_0x374394['loginInPause']||![],'mailPause':_0x374394[_0xa4f5('0x8f')]||![],'chatPause':_0x374394['loginInPause']||![],'faxPause':_0x374394[_0xa4f5('0x8f')]||![],'smsPause':_0x374394[_0xa4f5('0x8f')]||![],'openchannelPause':_0x374394[_0xa4f5('0x8f')]||![],'whatsappPause':_0x374394[_0xa4f5('0x8f')]||![],'pauseType':_0x374394[_0xa4f5('0x8f')]?_0xa4f5('0xf1'):null,'interface':_0x11cb93,'lastPauseAt':moment()['format'](_0xa4f5('0xeb'))});}})[_0xa4f5('0x1c')](function(_0x44f0d4){if(_0x9d62ec[_0xa4f5('0xf2')]){return _0x51732d();}else{return Promise['resolve'](_0x44f0d4)[_0xa4f5('0x1c')](respondWithResult(_0x49a994,null));}})[_0xa4f5('0x4c')](handleError(_0x49a994,null));};exports[_0xa4f5('0xf3')]=function(_0x59c925,_0x29bc9a){var _0x147d8c;return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x59c925[_0xa4f5('0x4e')]['id'],'role':_0xa4f5('0x1e')},'attributes':['id',_0xa4f5('0x29'),'role']})[_0xa4f5('0x1c')](handleEntityNotFound(_0x29bc9a,null))[_0xa4f5('0x1c')](function(_0x3f1029){if(_0x3f1029){_0x147d8c=_0x3f1029;return db[_0xa4f5('0xa5')][_0xa4f5('0x2b')]({'where':{'membername':_0x147d8c['name']},'individualHooks':!![]});}})[_0xa4f5('0x1c')](function(){return db[_0xa4f5('0xea')][_0xa4f5('0x41')]({'where':{'membername':_0x147d8c[_0xa4f5('0x29')],'exitAt':null}});})[_0xa4f5('0x1c')](function(_0x6c4910){var _0x3c2bc2=[];_0x6c4910[_0xa4f5('0xed')](function(_0xcc13cd){_0x3c2bc2[_0xa4f5('0x40')](_0xcc13cd[_0xa4f5('0x53')]({'exitAt':moment()['format'](_0xa4f5('0xeb'))}));});return Promise[_0xa4f5('0x4b')](_0x3c2bc2);})[_0xa4f5('0x1c')](function(){return _0x147d8c[_0xa4f5('0x53')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xa4f5('0x1c')](respondWithResult(_0x29bc9a,null))[_0xa4f5('0x4c')](handleError(_0x29bc9a,null));};exports[_0xa4f5('0xf4')]=function(_0x3f7534,_0x4606fa){var _0xba6316;return db[_0xa4f5('0xa5')]['update']({'paused':0x1},{'where':{'UserId':_0x3f7534['params']['id']},'individualHooks':!![]})[_0xa4f5('0x1c')](function(){return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x3f7534[_0xa4f5('0x4e')]['id'],'role':_0xa4f5('0x1e')},'attributes':['id',_0xa4f5('0x29'),_0xa4f5('0x1d'),_0xa4f5('0x5c'),'interface',_0xa4f5('0x8e')]});})[_0xa4f5('0x1c')](handleEntityNotFound(_0x4606fa,null))[_0xa4f5('0x1c')](function(_0xf4ada3){if(_0xf4ada3){_0xba6316=_0xf4ada3;return db[_0xa4f5('0xea')][_0xa4f5('0x41')]({'where':{'membername':_0xba6316[_0xa4f5('0x29')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x3a0a63){if(_0x3a0a63[_0xa4f5('0x44')]){var _0xdf50d2=moment()[_0xa4f5('0x9d')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2234ca=0x0,_0x172da5=_0x3a0a63[_0xa4f5('0x44')];_0x2234ca<_0x172da5;_0x2234ca++){_0x3a0a63[_0x2234ca][_0xa4f5('0xf5')]({'exitAt':_0xdf50d2});}}})[_0xa4f5('0x1c')](function(){var _0x5e0818=[];var _0x2e4f1d=utils[_0xa4f5('0xec')]();_0x2e4f1d['forEach'](function(_0x3cc173){_0x5e0818[_0xa4f5('0x40')]({'channel':_0x3cc173,'membername':_0xba6316[_0xa4f5('0x29')],'interface':_['isNil'](_0xba6316[_0xa4f5('0x91')])?util[_0xa4f5('0x9d')](_0xa4f5('0x9e'),_0xba6316[_0xa4f5('0x29')]):_0xba6316['interface'],'type':_0xa4f5('0xf0'),'enterAt':moment()[_0xa4f5('0x9d')](_0xa4f5('0xeb')),'data1':_0x3f7534[_0xa4f5('0x54')][_0xa4f5('0xf6')]||_0xa4f5('0xf7'),'role':_0xba6316[_0xa4f5('0x1d')],'internal':_0xba6316[_0xa4f5('0x5c')]});});return db[_0xa4f5('0xea')][_0xa4f5('0xf8')](_0x5e0818,{'individualHooks':!![]});})[_0xa4f5('0x1c')](function(){return _0xba6316[_0xa4f5('0x53')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3f7534[_0xa4f5('0x54')][_0xa4f5('0xf6')]||_0xa4f5('0xf7'),'lastPauseAt':moment()[_0xa4f5('0x9d')](_0xa4f5('0xeb'))});})[_0xa4f5('0x1c')](respondWithResult(_0x4606fa,null))['catch'](handleError(_0x4606fa,null));};exports[_0xa4f5('0xf9')]=function(_0x495678,_0x4e4a58){if(_0x495678[_0xa4f5('0x54')][_0xa4f5('0xa1')]&&!utils[_0xa4f5('0x92')](_0x495678['body']['channel'])){throw new APIBadRequestError(util[_0xa4f5('0x9d')](_0xa4f5('0xfa'),_0x495678[_0xa4f5('0x54')]['channel']));}return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x495678[_0xa4f5('0x4e')]['id']},'attributes':['id','name',_0xa4f5('0x1d'),_0xa4f5('0x5c'),_0xa4f5('0x91'),_0xa4f5('0x8e'),'voicePause',_0xa4f5('0xfb'),'chatPause',_0xa4f5('0xfc'),'openchannelPause',_0xa4f5('0xfd'),_0xa4f5('0xfe'),_0xa4f5('0xff'),_0xa4f5('0x100')]})[_0xa4f5('0x1c')](function(_0x2fda4b){if(!_0x2fda4b){throw new APINotFoundError(util[_0xa4f5('0x9d')](_0xa4f5('0xba'),_0x495678[_0xa4f5('0x4e')]['id']));}return _0x2fda4b[_0xa4f5('0xf9')](_0x495678[_0xa4f5('0x54')]['channel']);})[_0xa4f5('0x1c')](respondWithResult(_0x4e4a58,null))[_0xa4f5('0x4c')](APIHandleError(_0x4e4a58));};exports['getTeams']=function(_0x31eb25,_0x3214f1){var _0x94f253={};var _0x293505={};var _0x67ce1e;var _0x4dbd41;return db['User'][_0xa4f5('0x89')]({'where':{'id':_0x31eb25[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x3214f1,null))[_0xa4f5('0x1c')](function(_0x1a4e98){if(_0x1a4e98){_0x67ce1e=_0x1a4e98;_0x293505['model']=_['keys'](db[_0xa4f5('0x101')]['rawAttributes']);_0x293505[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x31eb25[_0xa4f5('0x3a')]);_0x293505['filters']=_[_0xa4f5('0xc3')](_0x293505[_0xa4f5('0xc4')],_0x293505[_0xa4f5('0x3a')]);_0x94f253[_0xa4f5('0x3f')]=_[_0xa4f5('0xc3')](_0x293505['model'],qs[_0xa4f5('0xc5')](_0x31eb25[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x94f253[_0xa4f5('0x3f')]=_0x94f253[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x94f253['attributes']:_0x293505['model'];_0x94f253['order']=qs['sort'](_0x31eb25[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x94f253[_0xa4f5('0xc8')]=qs['filters'](_[_0xa4f5('0xc9')](_0x31eb25[_0xa4f5('0x3a')],_0x293505[_0xa4f5('0xc2')]));if(_0x31eb25[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x94f253['where']=_[_0xa4f5('0x50')](_0x94f253[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x94f253['attributes'],function(_0x306365){var _0x5ad7b4={};_0x5ad7b4[_0x306365]={'$like':'%'+_0x31eb25[_0xa4f5('0x3a')][_0xa4f5('0xcd')]+'%'};return _0x5ad7b4;})});}_0x94f253=_[_0xa4f5('0x50')]({},_0x94f253,_0x31eb25[_0xa4f5('0x51')]);return _0x67ce1e[_0xa4f5('0x102')](_0x94f253);}})['then'](function(_0x496a08){if(_0x496a08){_0x4dbd41=_0x496a08['length'];if(!_0x31eb25[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0x94f253['limit']=qs['limit'](_0x31eb25['query'][_0xa4f5('0x15')]);_0x94f253[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x31eb25[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x67ce1e[_0xa4f5('0x102')](_0x94f253);}})[_0xa4f5('0x1c')](function(_0x33541f){if(_0x33541f){return _0x33541f?{'count':_0x4dbd41,'rows':_0x33541f}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x3214f1,null))[_0xa4f5('0x4c')](handleError(_0x3214f1,null));};exports['addTeams']=function(_0x120971,_0x3c2942){var _0x368450=_0x120971[_0xa4f5('0x4e')]['id'];var _0x2ada33=_0x120971[_0xa4f5('0x54')]?_0x120971['body'][_0xa4f5('0x58')]:null;var _0x43e28f=[];return Promise[_0xa4f5('0x103')]()[_0xa4f5('0x1c')](function(){if(!_0x2ada33)throw new APIBadRequestError(_0xa4f5('0x104'));})['then'](function(){return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x368450}});})['then'](function(_0x48967d){if(!_0x48967d)throw new APINotFoundError(util[_0xa4f5('0x9d')](_0xa4f5('0xba'),_0x120971[_0xa4f5('0x4e')]['id']));return db['sequelize'][_0xa4f5('0x105')](function(_0x5bf983){return _0x48967d['addTeams'](_0x2ada33,{'transaction':_0x5bf983})[_0xa4f5('0x1c')](function(){return db['Team'][_0xa4f5('0x41')]({'where':{'id':{'$in':_0x2ada33}}});})['then'](function(_0x541254){var _0x348c0a=_[_0xa4f5('0x31')](_0x541254,function(_0x4bde8d){return _0x4bde8d[_0xa4f5('0x106')]();});return Promise['all'](_0x348c0a);})[_0xa4f5('0x1c')](function(_0x3d91ea){_0x43e28f=_[_0xa4f5('0x107')](_0x3d91ea);var _0x573971=_['map'](_0x43e28f,function(_0x5c7d95){return _0x5c7d95[_0xa4f5('0x108')](_0x48967d['id'],{'transaction':_0x5bf983});});return Promise[_0xa4f5('0x4b')](_0x573971);})[_0xa4f5('0x1c')](function(){if(!_0x48967d[_0xa4f5('0x8e')])return;var _0x243edf=_[_0xa4f5('0xcd')](_0x43e28f,function(_0xde8ed1){return _0xde8ed1[_0xa4f5('0x109')](_0xa4f5('0xa1'))===_0xa4f5('0x10a');});var _0x1ca004=_[_0xa4f5('0x31')](_0x243edf,function(_0xcae710){return db['UserVoiceQueueRt'][_0xa4f5('0x9f')]({'membername':_0x48967d['name'],'UserId':_0x48967d['id'],'queue_name':_0xcae710[_0xa4f5('0x29')],'VoiceQueueId':_0xcae710['id'],'interface':_[_0xa4f5('0x5e')](_0x48967d['interface'])?util[_0xa4f5('0x9d')](_0xa4f5('0x9e'),_0x48967d['name']):_0x48967d[_0xa4f5('0x91')],'paused':_0x48967d['voicePause']||![],'penalty':_0x48967d[_0xa4f5('0x97')]},{'transaction':_0x5bf983});});return Promise[_0xa4f5('0x4b')](_0x1ca004);})['then'](function(){return db[_0xa4f5('0x10b')][_0xa4f5('0x41')]({'where':{'teamId':{'$in':_0x2ada33}}});})[_0xa4f5('0x1c')](function(_0x9d7f73){var _0x1b03e8=_['map'](_0x9d7f73,function(_0xe07819){return db[_0xa4f5('0x10c')][_0xa4f5('0x73')]({'UserId':_0x48967d['id'],'VoicePrefixId':_0xe07819['VoicePrefixId']},{'transaction':_0x5bf983});});return Promise[_0xa4f5('0x4b')](_0x1b03e8);});});})[_0xa4f5('0x1c')](function(){for(var _0x1bc065=0x0;_0x1bc065<_0x43e28f['length'];_0x1bc065++){var _0x258d51=_0x43e28f[_0x1bc065][_0xa4f5('0x109')](_0xa4f5('0xa1'));var _0x1a633f=_0x258d51+_0xa4f5('0x99');socket[_0xa4f5('0x1f')](_0xa4f5('0x23')+_0x258d51+_0xa4f5('0x10d'),{'UserId':_0x368450,['queueField']:_0x43e28f[_0x1bc065]['id']});}})[_0xa4f5('0x1c')](respondWithStatusCode(_0x3c2942,null))[_0xa4f5('0x4c')](APIHandleError(_0x3c2942));};exports['removeTeams']=function(_0xff26d6,_0x3c8da1){var _0x4fe45e=_0xff26d6['params']['id'];var _0x4c11a1=null;if(_0xff26d6[_0xa4f5('0x3a')][_0xa4f5('0x58')]){_0x4c11a1=_['isArray'](_0xff26d6[_0xa4f5('0x3a')][_0xa4f5('0x58')])?_0xff26d6[_0xa4f5('0x3a')][_0xa4f5('0x58')]:[_0xff26d6[_0xa4f5('0x3a')]['ids']];}var _0x5dd67f=[];return Promise[_0xa4f5('0x103')]()['then'](function(){if(!_0x4c11a1)throw new APIBadRequestError(_0xa4f5('0x10e'));})[_0xa4f5('0x1c')](function(){return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x4fe45e}});})['then'](function(_0x545c54){if(!_0x545c54)throw new APINotFoundError(util[_0xa4f5('0x9d')]('User\x20with\x20id\x20%s\x20not\x20found',_0xff26d6['params']['id']));return db[_0xa4f5('0x5f')][_0xa4f5('0x105')](function(_0x2aa79e){return _0x545c54[_0xa4f5('0x10f')](_0x4c11a1,{'transaction':_0x2aa79e})[_0xa4f5('0x1c')](function(){return db['Team'][_0xa4f5('0x41')]({'where':{'id':{'$in':_0x4c11a1}}});})[_0xa4f5('0x1c')](function(_0x57e133){var _0x445a3b=_[_0xa4f5('0x31')](_0x57e133,function(_0x30c93e){return _0x30c93e[_0xa4f5('0x106')]();});return Promise[_0xa4f5('0x4b')](_0x445a3b);})[_0xa4f5('0x1c')](function(_0x46b915){_0x5dd67f=_['flattenDeep'](_0x46b915);var _0x49087c=_[_0xa4f5('0x31')](_0x5dd67f,function(_0x1beb5e){return _0x1beb5e[_0xa4f5('0x110')](_0x545c54['id'],{'transaction':_0x2aa79e});});return Promise[_0xa4f5('0x4b')](_0x49087c);})[_0xa4f5('0x1c')](function(){if(!_0x545c54[_0xa4f5('0x8e')])return;var _0x14b0a5=_[_0xa4f5('0xcd')](_0x5dd67f,function(_0x4b01b9){return _0x4b01b9[_0xa4f5('0x109')]('channel')===_0xa4f5('0x10a');});var _0x28c302=_[_0xa4f5('0x31')](_0x14b0a5,function(_0x55509e){return db[_0xa4f5('0xa5')]['destroy']({'where':{'VoiceQueueId':_0x55509e['id'],'UserId':_0x545c54['id']},'transaction':_0x2aa79e});});return Promise['all'](_0x28c302);})[_0xa4f5('0x1c')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x4c11a1}}});})[_0xa4f5('0x1c')](function(_0x391a0e){var _0x6dedeb=_[_0xa4f5('0x31')](_0x391a0e,function(_0x1207b2){return db['UserVoicePrefix'][_0xa4f5('0x2b')]({'where':{'UserId':_0x545c54['id'],'VoicePrefixId':_0x1207b2['VoicePrefixId']}},{'transaction':_0x2aa79e});});return Promise[_0xa4f5('0x4b')](_0x6dedeb);});});})[_0xa4f5('0x1c')](function(){for(var _0x20d777=0x0;_0x20d777<_0x5dd67f[_0xa4f5('0x44')];_0x20d777++){var _0x13dca1=_0x5dd67f[_0x20d777]['getDataValue'](_0xa4f5('0xa1'));var _0x2a9dbd=_0x13dca1+_0xa4f5('0x99');socket[_0xa4f5('0x1f')](_0xa4f5('0x23')+_0x13dca1+_0xa4f5('0xa4'),{'UserId':_0x4fe45e,['queueField']:_0x5dd67f[_0x20d777]['id']});}})[_0xa4f5('0x1c')](respondWithStatusCode(_0x3c8da1,null))[_0xa4f5('0x4c')](APIHandleError(_0x3c8da1));};exports[_0xa4f5('0x111')]=function(_0x5e9bc9,_0x11f6a8){var _0x8c62bd={};var _0x34fbeb={};var _0x2ad3ff;var _0x139d1d;return db['User'][_0xa4f5('0x89')]({'where':{'id':_0x5e9bc9[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x11f6a8,null))[_0xa4f5('0x1c')](function(_0x2f947c){if(_0x2f947c){_0x2ad3ff=_0x2f947c;_0x34fbeb[_0xa4f5('0xc4')]=_['keys'](db[_0xa4f5('0xbc')][_0xa4f5('0x30')]);_0x34fbeb[_0xa4f5('0x3a')]=_['keys'](_0x5e9bc9[_0xa4f5('0x3a')]);_0x34fbeb[_0xa4f5('0xc2')]=_['intersection'](_0x34fbeb[_0xa4f5('0xc4')],_0x34fbeb[_0xa4f5('0x3a')]);_0x8c62bd[_0xa4f5('0x3f')]=_['intersection'](_0x34fbeb['model'],qs[_0xa4f5('0xc5')](_0x5e9bc9[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x8c62bd['attributes']=_0x8c62bd[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x8c62bd[_0xa4f5('0x3f')]:_0x34fbeb[_0xa4f5('0xc4')];_0x8c62bd['order']=qs[_0xa4f5('0xc7')](_0x5e9bc9[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x8c62bd['where']=qs[_0xa4f5('0xc2')](_[_0xa4f5('0xc9')](_0x5e9bc9['query'],_0x34fbeb[_0xa4f5('0xc2')]));if(_0x5e9bc9[_0xa4f5('0x3a')]['filter']){_0x8c62bd[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0x8c62bd[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x8c62bd['attributes'],function(_0x326107){var _0x263499={};_0x263499[_0x326107]={'$like':'%'+_0x5e9bc9[_0xa4f5('0x3a')]['filter']+'%'};return _0x263499;})});}_0x8c62bd=_[_0xa4f5('0x50')]({},_0x8c62bd,_0x5e9bc9['options']);return _0x2ad3ff[_0xa4f5('0x111')](_0x8c62bd);}})['then'](function(_0xa9f9b1){if(_0xa9f9b1){_0x139d1d=_0xa9f9b1['length'];if(!_0x5e9bc9['query'][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0x8c62bd[_0xa4f5('0x15')]=qs[_0xa4f5('0x15')](_0x5e9bc9[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x8c62bd[_0xa4f5('0x18')]=qs['offset'](_0x5e9bc9['query'][_0xa4f5('0x18')]);}return _0x2ad3ff[_0xa4f5('0x111')](_0x8c62bd);}})[_0xa4f5('0x1c')](function(_0x5a1f60){if(_0x5a1f60){return _0x5a1f60?{'count':_0x139d1d,'rows':_0x5a1f60}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x11f6a8,null))[_0xa4f5('0x4c')](handleError(_0x11f6a8,null));};exports[_0xa4f5('0x112')]=function(_0x3cbafd,_0x3ff4ff){var _0x34c834={};var _0xbd6194={};var _0x9e1d97;return db[_0xa4f5('0x2f')]['findOne']({'where':{'id':_0x3cbafd['params']['id']}})['then'](handleEntityNotFound(_0x3ff4ff,null))[_0xa4f5('0x1c')](function(_0x592bb6){if(_0x592bb6){_0x9e1d97=_0x592bb6;_0xbd6194['model']=_[_0xa4f5('0xc1')](db['User']['rawAttributes']);_0xbd6194[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x3cbafd[_0xa4f5('0x3a')]);_0xbd6194[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0xbd6194['model'],_0xbd6194[_0xa4f5('0x3a')]);_0x34c834['attributes']=_[_0xa4f5('0xc3')](_0xbd6194[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0x3cbafd[_0xa4f5('0x3a')]['fields']));_0x34c834['attributes']=_0x34c834[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x34c834[_0xa4f5('0x3f')]:_0xbd6194[_0xa4f5('0xc4')];_0x34c834[_0xa4f5('0xc6')]=qs[_0xa4f5('0xc7')](_0x3cbafd[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x34c834[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_['pick'](_0x3cbafd[_0xa4f5('0x3a')],_0xbd6194[_0xa4f5('0xc2')]));if(_0x3cbafd[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x34c834[_0xa4f5('0xc8')]=_['merge'](_0x34c834[_0xa4f5('0xc8')],{'$or':_['map'](_0x34c834[_0xa4f5('0x3f')],function(_0x14aa91){var _0x23b3ba={};_0x23b3ba[_0x14aa91]={'$like':'%'+_0x3cbafd[_0xa4f5('0x3a')][_0xa4f5('0xcd')]+'%'};return _0x23b3ba;})});}_0x34c834[_0xa4f5('0xc4')]=db['User'];_0x34c834['as']='Agents';_0x34c834=_[_0xa4f5('0x50')]({},_0x34c834,_0x3cbafd[_0xa4f5('0x51')]);return _0x9e1d97[_0xa4f5('0xe8')]({'include':[_0x34c834]});}})[_0xa4f5('0x1c')](function(_0x1f1648){if(_0x1f1648){var _0x5ddc13={},_0x27ceaf=[];for(var _0x23e490=0x0;_0x23e490<_0x1f1648[_0xa4f5('0x44')];_0x23e490+=0x1){for(var _0x39dd62=0x0,_0x228b7f;_0x39dd62<_0x1f1648[_0x23e490]['Agents']['length'];_0x39dd62+=0x1){_0x228b7f=_0x1f1648[_0x23e490][_0xa4f5('0x24')][_0x39dd62][_0xa4f5('0x9b')]({'plain':!![]});_0x5ddc13[_0x228b7f['id']]=_0x228b7f;}}_0x5ddc13=_[_0xa4f5('0x113')](_0x5ddc13);for(var _0xc9975c=qs[_0xa4f5('0x18')](_0x3cbafd['query']['offset']);_0xc9975c<_0x5ddc13['length']&&_0x27ceaf[_0xa4f5('0x44')]=_0xd02f4e){_0x3c71c7=_0xd02f4e;_0x518021=0xc8;}else{_0x518021=0xce;}_0x106444[_0xd5bf('0x12')](_0x518021);return _0x106444['set'](_0xd5bf('0x19'),_0x3dcc21+'-'+_0x3c71c7+'/'+_0xd02f4e)['json'](_0x22ea33);}return null;};}function saveUpdates(_0x5f47c5){return function(_0xd0a5d){if(_0xd0a5d){return _0xd0a5d[_0xd5bf('0x1a')](_0x5f47c5)['then'](function(_0x436e36){if(_0x436e36[_0xd5bf('0x1b')]===_0xd5bf('0x1c')){socket[_0xd5bf('0x1d')]('userNotification:recalc:'+_0x436e36['id'],_0x436e36);}return _0x436e36;});}return null;};}function removeEntity(_0x327599){return function(_0x432ca1){if(_0x432ca1){return _0x432ca1[_0xd5bf('0x1e')]()[_0xd5bf('0x1f')](function(){var _0x2a60d3=_0x432ca1[_0xd5bf('0x20')]({'plain':!![]});if(_0x2a60d3[_0xd5bf('0x1b')]===_0xd5bf('0x21'))return;var _0x1f1e0c=[{'name':_0xd5bf('0x22'),'value':_0xd5bf('0x23'),'ignore':!![]},{'name':_0xd5bf('0x24'),'value':_0xd5bf('0x1c'),'ignore':![]},{'name':_0xd5bf('0x25'),'value':_0xd5bf('0x26'),'ignore':![]}];var _0x4f26b4=_(_0x1f1e0c)['filter'](_0xd5bf('0x27'))['map']('value')[_0xd5bf('0x28')]();if(_[_0xd5bf('0x29')](_0x4f26b4,_0x2a60d3['role'])){return;}var _0x15ed18=_[_0xd5bf('0x2a')](_0x1f1e0c,['value',_0x2a60d3['role']])[_0xd5bf('0x2b')];return db['UserProfileResource'][_0xd5bf('0x1e')]({'where':{'type':_0x15ed18,'resourceId':_0x2a60d3['id']}})[_0xd5bf('0x1f')](function(){return _0x432ca1;});})[_0xd5bf('0x1f')](function(){_0x327599[_0xd5bf('0x12')](0xcc)[_0xd5bf('0x13')]();});}};}function handleEntityNotFound(_0x448b7e){return function(_0x3b5196){if(!_0x3b5196){_0x448b7e[_0xd5bf('0x11')](0x194);}return _0x3b5196;};}function handleError(_0x217383,_0x4dde54){_0x4dde54=_0x4dde54||0x1f4;return function(_0x33fe67){logger[_0xd5bf('0x2c')](_0x33fe67[_0xd5bf('0x2d')]);if(_0x33fe67[_0xd5bf('0x2b')]){delete _0x33fe67[_0xd5bf('0x2b')];}_0x217383[_0xd5bf('0x12')](_0x4dde54)['send'](_0x33fe67);};}function getUserAttributes(){return _(db[_0xd5bf('0x2e')]['rawAttributes'])[_0xd5bf('0x2f')](function(_0x335e64){return{'name':_0x335e64[_0xd5bf('0x30')],'type':_0x335e64[_0xd5bf('0x31')][_0xd5bf('0x32')]};})[_0xd5bf('0x33')](function(_0x3751bc){return![_0xd5bf('0x34'),'salt','previousPasswords','resetPasswordToken',_0xd5bf('0x35'),_0xd5bf('0x36')][_0xd5bf('0x29')](_0x3751bc[_0xd5bf('0x2b')]);})['value']();}exports[_0xd5bf('0x37')]=function(_0x107d61,_0x341325){var _0x256886={},_0x3b23a7={'count':0x0,'rows':[]};var _0x4b1004=getUserAttributes();_0x256886=qs[_0xd5bf('0x38')](_0x4b1004,_0x107d61);var _0x8a6406={'where':_0x256886['where']};return db['User'][_0xd5bf('0x18')](_0x8a6406)[_0xd5bf('0x1f')](function(_0x5f14b2){_0x3b23a7[_0xd5bf('0x18')]=_0x5f14b2;if(_0x107d61[_0xd5bf('0x39')][_0xd5bf('0x3a')]){_0x256886[_0xd5bf('0x3b')]=[{'all':!![]}];}if(_0x107d61[_0xd5bf('0x39')]['userSetting']===_0xd5bf('0x3c')){_0x256886[_0xd5bf('0x3b')]=[{'model':db[_0xd5bf('0x3d')],'as':_0xd5bf('0x3e')}];}if(!_[_0xd5bf('0x29')](_0x256886[_0xd5bf('0x3f')],'id')){_0x256886[_0xd5bf('0x3f')][_0xd5bf('0x40')]('id');}return db['User'][_0xd5bf('0x41')](_0x256886);})['then'](function(_0x178dea){_0x3b23a7[_0xd5bf('0x42')]=_0x178dea;if(_0x107d61[_0xd5bf('0x39')][_0xd5bf('0x43')]===_0xd5bf('0x3c')){var _0x9874aa=[];for(var _0x35893b=0x0;_0x35893b<_0x3b23a7[_0xd5bf('0x42')][_0xd5bf('0x44')];_0x35893b++){_0x9874aa[_0xd5bf('0x40')](get_open_tabs('chat',_0x3b23a7[_0xd5bf('0x42')][_0x35893b][_0xd5bf('0x45')]));_0x9874aa['push'](get_open_tabs('sms',_0x3b23a7[_0xd5bf('0x42')][_0x35893b][_0xd5bf('0x45')]));_0x9874aa[_0xd5bf('0x40')](get_open_tabs(_0xd5bf('0x46'),_0x3b23a7[_0xd5bf('0x42')][_0x35893b][_0xd5bf('0x45')]));_0x9874aa[_0xd5bf('0x40')](get_open_tabs(_0xd5bf('0x47'),_0x3b23a7[_0xd5bf('0x42')][_0x35893b][_0xd5bf('0x45')]));_0x9874aa[_0xd5bf('0x40')](get_open_tabs(_0xd5bf('0x48'),_0x3b23a7[_0xd5bf('0x42')][_0x35893b][_0xd5bf('0x45')]));_0x9874aa[_0xd5bf('0x40')](get_open_tabs(_0xd5bf('0x49'),_0x3b23a7[_0xd5bf('0x42')][_0x35893b][_0xd5bf('0x45')]));}return Promise[_0xd5bf('0x4a')](_0x9874aa)[_0xd5bf('0x1f')](function(){return _0x3b23a7;});}else{return _0x3b23a7;}})[_0xd5bf('0x1f')](respondWithFilteredResult(_0x341325,_0x256886))[_0xd5bf('0x4b')](handleError(_0x341325,null));};exports[_0xd5bf('0x4c')]=function(_0x4001a7,_0x4fe3ed){var _0x47d02c=getUserAttributes();_0x4001a7[_0xd5bf('0x39')]['id']=_0x4001a7[_0xd5bf('0x4d')]['id'];var _0x5cd61f=qs['getOptions'](_0x47d02c,_0x4001a7);if(_0x4001a7[_0xd5bf('0x39')][_0xd5bf('0x3a')]){_0x5cd61f[_0xd5bf('0x3b')]=[{'all':!![]}];}if(_0x4001a7['query'][_0xd5bf('0x3e')]===_0xd5bf('0x3c')){_0x5cd61f[_0xd5bf('0x3b')]=[{'model':db[_0xd5bf('0x3d')],'as':_0xd5bf('0x3e')}];}_0x5cd61f=_['merge']({},_0x5cd61f,_0x4001a7[_0xd5bf('0x4e')]);if(!_[_0xd5bf('0x29')](_0x5cd61f[_0xd5bf('0x3f')],'id')){_0x5cd61f['attributes'][_0xd5bf('0x40')]('id');}return db[_0xd5bf('0x2e')][_0xd5bf('0x2a')](_0x5cd61f)['then'](handleEntityNotFound(_0x4fe3ed,null))['then'](function(_0x5c1878){var _0x5a286b=[];values=_0x5c1878;if(_0x4001a7['query'][_0xd5bf('0x43')]===_0xd5bf('0x3c')){_0x5a286b['push'](get_open_tabs('chat',_0x5c1878['dataValues']));_0x5a286b[_0xd5bf('0x40')](get_open_tabs('sms',_0x5c1878[_0xd5bf('0x45')]));_0x5a286b['push'](get_open_tabs(_0xd5bf('0x48'),_0x5c1878[_0xd5bf('0x45')]));_0x5a286b[_0xd5bf('0x40')](get_open_tabs(_0xd5bf('0x49'),_0x5c1878['dataValues']));_0x5a286b[_0xd5bf('0x40')](get_open_tabs(_0xd5bf('0x46'),_0x5c1878[_0xd5bf('0x45')]));_0x5a286b[_0xd5bf('0x40')](get_open_tabs(_0xd5bf('0x47'),_0x5c1878['dataValues']));return Promise[_0xd5bf('0x4a')](_0x5a286b);}else{return values;}})[_0xd5bf('0x1f')](function(){return values;})[_0xd5bf('0x1f')](respondWithResult(_0x4fe3ed,null))['catch'](handleError(_0x4fe3ed,null));};exports[_0xd5bf('0x1a')]=function(_0x47c831,_0x546de4){if(_0x47c831[_0xd5bf('0x4f')]['id']){delete _0x47c831[_0xd5bf('0x4f')]['id'];}delete _0x47c831[_0xd5bf('0x4f')][_0xd5bf('0x1b')];return db[_0xd5bf('0x2e')][_0xd5bf('0x2a')]({'where':{'id':_0x47c831['params']['id']}})[_0xd5bf('0x1f')](handleEntityNotFound(_0x546de4,null))[_0xd5bf('0x1f')](saveUpdates(_0x47c831[_0xd5bf('0x4f')],null))[_0xd5bf('0x1f')](respondWithResult(_0x546de4,null))[_0xd5bf('0x4b')](handleError(_0x546de4,null));};exports[_0xd5bf('0x50')]=function(_0x4aa9cd,_0x21284b){return db[_0xd5bf('0x2e')]['describe']()[_0xd5bf('0x1f')](respondWithResult(_0x21284b,null))[_0xd5bf('0x4b')](handleError(_0x21284b,null));};exports['addContacts']=function(_0x94caa4,_0x179bc3){return db[_0xd5bf('0x2e')][_0xd5bf('0x2a')]({'where':{'id':_0x94caa4[_0xd5bf('0x4d')]['id']}})[_0xd5bf('0x1f')](handleEntityNotFound(_0x179bc3,null))['then'](function(_0x525c21){if(_0x525c21){return _0x525c21[_0xd5bf('0x51')](_0x94caa4[_0xd5bf('0x4f')][_0xd5bf('0x52')],_[_0xd5bf('0x53')](_0x94caa4[_0xd5bf('0x4f')],[_0xd5bf('0x52'),'id'])||{});}})['then'](respondWithResult(_0x179bc3,null))['catch'](handleError(_0x179bc3,null));};function validateUser(_0x1c5405){return new Promise(function(_0x264751,_0x549f9b){if(_0x1c5405[_0xd5bf('0x54')])return _0x264751(_0x1c5405);return db[_0xd5bf('0x55')]['findById'](0x1)[_0xd5bf('0x1f')](function(_0x55a114){if(_0x55a114[_0xd5bf('0x56')])authService[_0xd5bf('0x57')](_0x1c5405[_0xd5bf('0x34')]);db['User'][_0xd5bf('0x58')](_0xd5bf('0x54'))[_0xd5bf('0x1f')](function(_0x1252dc){if(_[_0xd5bf('0x59')](_0x1252dc)){_0x1c5405[_0xd5bf('0x54')]=_0x55a114[_0xd5bf('0x5a')]||0x1;return;}if(_['isNil'](_0x55a114[_0xd5bf('0x5a')])||_0x55a114[_0xd5bf('0x5a')]===_0x1252dc){_0x1c5405[_0xd5bf('0x54')]=_0x1252dc+0x1;return;}if(_0x55a114['min_internal']>_0x1252dc){_0x1c5405['internal']=_0x55a114[_0xd5bf('0x5a')];return;}return db[_0xd5bf('0x5b')][_0xd5bf('0x39')](_0xd5bf('0x5c'),{'type':db[_0xd5bf('0x5b')][_0xd5bf('0x5d')][_0xd5bf('0x5e')]})[_0xd5bf('0x1f')](function(_0x42d40b){if(_0x42d40b&&_0x42d40b[_0xd5bf('0x44')]){for(var _0x55f81e=0x0,_0x4d0b60=_0x42d40b[_0xd5bf('0x44')];_0x55f81e<_0x4d0b60&&_[_0xd5bf('0x59')](_0x1c5405[_0xd5bf('0x54')]);_0x55f81e++){if(_0x55a114[_0xd5bf('0x5a')]<=_0x42d40b[_0x55f81e][_0xd5bf('0x5f')]){_0x1c5405['internal']=_0x42d40b[_0x55f81e][_0xd5bf('0x5f')];}else if(_0x55a114[_0xd5bf('0x5a')]>_0x42d40b[_0x55f81e]['from']&&_0x55a114['min_internal']<=_0x42d40b[_0x55f81e]['to']){_0x1c5405[_0xd5bf('0x54')]=_0x55a114[_0xd5bf('0x5a')];}}}if(_[_0xd5bf('0x59')](_0x1c5405['internal'])){_0x1c5405['internal']=_0x1252dc+0x1;}return _0x264751(_0x1c5405);});});})['catch'](function(_0xaa38f7){_0x549f9b(_0xaa38f7);});});}function updateUser(_0x4b51dc){return new Promise(function(_0xc598c,_0x525ca9){try{if(_0x4b51dc[_0xd5bf('0x60')]){_0x4b51dc['mailbox']=_0x4b51dc['internal'];_0x4b51dc[_0xd5bf('0x61')]={'mailbox':_0x4b51dc[_0xd5bf('0x54')],'password':_0x4b51dc[_0xd5bf('0x34')],'fullname':_0x4b51dc[_0xd5bf('0x62')],'email':_0x4b51dc['email']};}if(_0x4b51dc[_0xd5bf('0x1b')]===_0xd5bf('0x1c')){if(!_0x4b51dc[_0xd5bf('0x63')])_0x4b51dc['permissions']=['101',_0xd5bf('0x64'),'103',_0xd5bf('0x65'),_0xd5bf('0x66'),'104',_0xd5bf('0x67'),_0xd5bf('0x68'),_0xd5bf('0x69'),_0xd5bf('0x6a'),_0xd5bf('0x6b'),_0xd5bf('0x6c'),_0xd5bf('0x6d'),_0xd5bf('0x6e'),_0xd5bf('0x6f')];}_0xc598c(_0x4b51dc);}catch(_0x51a576){_0x525ca9(_0x51a576);}});}exports[_0xd5bf('0x70')]=function(_0x21e7d9,_0x447c5a){if(_0x21e7d9[_0xd5bf('0x23')][_0xd5bf('0x1b')]===_0xd5bf('0x1c'))throw new Error('Unauthorized');if(_0x21e7d9[_0xd5bf('0x4f')][_0xd5bf('0x1b')]===_0xd5bf('0x23')&&_0x21e7d9['user'][_0xd5bf('0x1b')]!==_0xd5bf('0x21')){throw new Error(_0xd5bf('0x71'));}if(_0x21e7d9[_0xd5bf('0x4f')][_0xd5bf('0x1b')]===_0xd5bf('0x21')&&_0x21e7d9[_0xd5bf('0x23')][_0xd5bf('0x1b')]!==_0xd5bf('0x21')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x21e7d9[_0xd5bf('0x4f')]])['then'](function(){return validateUser(_0x21e7d9[_0xd5bf('0x4f')]);})[_0xd5bf('0x1f')](function(_0x47fb43){return updateUser(_0x47fb43)[_0xd5bf('0x1f')](function(_0x43107f){if(_0x43107f[_0xd5bf('0x1b')]===_0xd5bf('0x21')){_0x43107f[_0xd5bf('0x72')]=_0x21e7d9[_0xd5bf('0x23')][_0xd5bf('0x72')];delete _0x43107f[_0xd5bf('0x73')];}return _0x43107f;});})['then'](function(_0x5cf1af){return db[_0xd5bf('0x2e')][_0xd5bf('0x70')](_0x5cf1af,{'include':[{'model':db[_0xd5bf('0x61')],'as':_0xd5bf('0x61')}]});})[_0xd5bf('0x1f')](function(_0x41e0bb){if(_0x21e7d9[_0xd5bf('0x4f')][_0xd5bf('0x1b')]==='user')return _0x41e0bb;if(_0x21e7d9[_0xd5bf('0x23')][_0xd5bf('0x1b')]!==_0xd5bf('0x23'))return _0x41e0bb;return db[_0xd5bf('0x74')][_0xd5bf('0x2a')]({'where':{'name':_0x41e0bb[_0xd5bf('0x1b')]===_0xd5bf('0x1c')?_0xd5bf('0x24'):_0xd5bf('0x25'),'userProfileId':_0x21e7d9[_0xd5bf('0x23')][_0xd5bf('0x73')]},'raw':!![]})[_0xd5bf('0x1f')](function(_0xd08fd3){if(!_0xd08fd3||_0xd08fd3['autoAssociation']!=0x0)return _0x41e0bb;return db[_0xd5bf('0x75')]['create']({'name':_0x41e0bb[_0xd5bf('0x2b')],'resourceId':_0x41e0bb['id'],'type':_0xd08fd3['name'],'sectionId':_0xd08fd3['id']},{})['then'](function(){return _0x41e0bb;});})[_0xd5bf('0x4b')](function(_0xc9e002){logger[_0xd5bf('0x2c')](_0xd5bf('0x76'),_0xc9e002);throw _0xc9e002;});})['then'](respondWithResult(_0x447c5a,0xc9))[_0xd5bf('0x4b')](handleError(_0x447c5a,null));};exports['bulkCreate']=function(_0x2903db,_0x478f45){var _0x39abad=_0x2903db['body'];var _0x316f30=[];if(_0x2903db[_0xd5bf('0x23')]['role']==='agent')throw new Error(_0xd5bf('0x77'));if(_['some'](_0x39abad,[_0xd5bf('0x1b'),_0xd5bf('0x23')])&&_0x2903db[_0xd5bf('0x23')][_0xd5bf('0x1b')]!==_0xd5bf('0x21')){throw new Error(_0xd5bf('0x71'));}if(_[_0xd5bf('0x78')](_0x39abad,[_0xd5bf('0x1b'),_0xd5bf('0x21')])&&_0x2903db['user'][_0xd5bf('0x1b')]!==_0xd5bf('0x21')){throw new Error(_0xd5bf('0x79'));}return licenseUtil[_0xd5bf('0x7a')](_0x39abad)[_0xd5bf('0x1f')](function(){return validateUser(_0x39abad[0x0]);})[_0xd5bf('0x1f')](function(){for(var _0x5346a6=0x1;_0x5346a6<_0x39abad[_0xd5bf('0x44')];_0x5346a6++){var _0x3321b7=_0x39abad[_0x5346a6-0x1][_0xd5bf('0x54')];if(!_0x39abad[_0x5346a6]['internal'])_0x39abad[_0x5346a6]['internal']=_0x3321b7+0x1;_0x316f30[_0xd5bf('0x40')](validateUser(_0x39abad[_0x5346a6]));}return Promise[_0xd5bf('0x4a')](_0x316f30);})[_0xd5bf('0x1f')](function(){_0x316f30=[];for(var _0x4b9627=0x0;_0x4b9627<_0x39abad[_0xd5bf('0x44')];_0x4b9627++){_0x316f30[_0xd5bf('0x40')](updateUser(_0x39abad[_0x4b9627]));}return Promise[_0xd5bf('0x4a')](_0x316f30);})[_0xd5bf('0x1f')](function(){_0x316f30=_0x39abad[_0xd5bf('0x2f')](function(_0x2bba5a){return db[_0xd5bf('0x2e')][_0xd5bf('0x70')](_0x2bba5a,{'include':[{'model':db[_0xd5bf('0x61')],'as':'VoiceMail'}]})[_0xd5bf('0x1f')](function(_0x42ac6d){_0x2bba5a['id']=_0x42ac6d['id'];return _0x2bba5a;});});return Promise[_0xd5bf('0x4a')](_0x316f30);})[_0xd5bf('0x1f')](function(_0x493654){if(_0x2903db[_0xd5bf('0x4f')][_0xd5bf('0x1b')]===_0xd5bf('0x23'))return _0x493654;if(_0x2903db['user'][_0xd5bf('0x1b')]!=='user')return _0x493654;var _0x2ec0f2=_[_0xd5bf('0x78')](_0x493654,function(_0x397470){return _0x397470[_0xd5bf('0x1b')]==='agent'||_0x397470[_0xd5bf('0x1b')]===_0xd5bf('0x26');});if(!_0x2ec0f2)return _0x493654;return db[_0xd5bf('0x74')][_0xd5bf('0x41')]({'where':{'name':{'$or':[_0xd5bf('0x24'),_0xd5bf('0x25')]},'userProfileId':_0x2903db[_0xd5bf('0x23')]['userProfileId']},'raw':!![]})['then'](function(_0x308f5a){if(_[_0xd5bf('0x7b')](_0x308f5a)||!_[_0xd5bf('0x78')](_0x308f5a,[_0xd5bf('0x7c'),0x0]))return _0x493654;_0x316f30=[];var _0x7d14ed=_(_0x308f5a)[_0xd5bf('0x2f')](function(_0x56b6df){if(_0x56b6df[_0xd5bf('0x7c')]===0x1)return;return _0x56b6df[_0xd5bf('0x2b')]===_0xd5bf('0x24')?'agent':'telephone';})[_0xd5bf('0x7d')]()[_0xd5bf('0x28')]();for(var _0x45d360=0x0;_0x45d360<_0x493654['length'];_0x45d360++){if(!_[_0xd5bf('0x29')](_0x7d14ed,_0x493654[_0x45d360][_0xd5bf('0x1b')]))return;var _0x47ce89=_0x493654[_0x45d360]['role']===_0xd5bf('0x1c')?_0xd5bf('0x24'):'Telephones';_0x316f30[_0xd5bf('0x40')](db[_0xd5bf('0x75')][_0xd5bf('0x70')]({'name':_0x493654[_0x45d360][_0xd5bf('0x2b')],'resourceId':_0x493654[_0x45d360]['id'],'type':_0x47ce89,'sectionId':_[_0xd5bf('0x2a')](_0x308f5a,['name',_0x47ce89])['id']},{}));}return Promise[_0xd5bf('0x4a')](_0x316f30);});})[_0xd5bf('0x1f')](respondWithResult(_0x478f45,0xc9))[_0xd5bf('0x4b')](handleError(_0x478f45,null));};exports[_0xd5bf('0x7e')]=function(_0x14cc8b,_0x429d23){if(_0x14cc8b['body']['id']){delete _0x14cc8b['body']['id'];}return db[_0xd5bf('0x2e')]['find']({'where':{'id':_0x14cc8b[_0xd5bf('0x4d')]['id']}})[_0xd5bf('0x1f')](function(_0x160ad2){if(!_0x160ad2)return null;if(_0x160ad2['id']===_0x14cc8b[_0xd5bf('0x23')]['id']){if(!_0x14cc8b[_0xd5bf('0x4f')][_0xd5bf('0x7f')]||!_0x14cc8b['body']['newPassword']){throw new db[(_0xd5bf('0x80'))][(_0xd5bf('0x81'))](_0xd5bf('0x82'));}if(!_0x160ad2[_0xd5bf('0x83')](_0x14cc8b[_0xd5bf('0x4f')][_0xd5bf('0x7f')])){throw new db[(_0xd5bf('0x80'))]['ValidationError'](_0xd5bf('0x84'));}if(_0x14cc8b['body'][_0xd5bf('0x7f')]===_0x14cc8b['body']['newPassword']){throw new db[(_0xd5bf('0x80'))][(_0xd5bf('0x81'))](_0xd5bf('0x85'));}}else if(_0x14cc8b[_0xd5bf('0x23')]['role']==='admin'){if(!_0x14cc8b[_0xd5bf('0x4f')][_0xd5bf('0x86')]){throw new db[(_0xd5bf('0x80'))][(_0xd5bf('0x81'))](_0xd5bf('0x87'));}}else if(_0x14cc8b[_0xd5bf('0x23')][_0xd5bf('0x1b')]===_0xd5bf('0x23')){if(!_0x14cc8b[_0xd5bf('0x4f')][_0xd5bf('0x86')]){throw new db['Sequelize'][(_0xd5bf('0x81'))](_0xd5bf('0x87'));}if(_0x160ad2['role']!=='agent'){throw new db[(_0xd5bf('0x80'))][(_0xd5bf('0x81'))](_0xd5bf('0x77'));}}else{throw new db[(_0xd5bf('0x80'))][(_0xd5bf('0x81'))]('Unauthorized');}return _0x160ad2;})[_0xd5bf('0x1f')](handleEntityNotFound(_0x429d23,null))['then'](function(_0x537bab){return db[_0xd5bf('0x55')][_0xd5bf('0x88')]({'attributes':['id','securePassword',_0xd5bf('0x89'),_0xd5bf('0x8a')]})[_0xd5bf('0x1f')](function(_0x5ccc1f){if(_0x5ccc1f['securePassword'])authService[_0xd5bf('0x57')](_0x14cc8b[_0xd5bf('0x4f')][_0xd5bf('0x86')]);if(!_0x5ccc1f[_0xd5bf('0x89')]||!_0x537bab['previousPasswords'])return _0x537bab;authService[_0xd5bf('0x8b')](_0x14cc8b[_0xd5bf('0x4f')][_0xd5bf('0x86')],_0x537bab[_0xd5bf('0x8c')],_0x5ccc1f[_0xd5bf('0x8a')]);return _0x537bab;})['then'](saveUpdates({'password':_0x14cc8b['body'][_0xd5bf('0x86')],'passwordResetAt':_0x14cc8b[_0xd5bf('0x23')]['id']==_0x14cc8b[_0xd5bf('0x4d')]['id']?moment():null,'previousPasswords':authService[_0xd5bf('0x8d')](_0x14cc8b['body'][_0xd5bf('0x86')],_0x537bab[_0xd5bf('0x8c')])},null));})[_0xd5bf('0x1f')](respondWithResult(_0x429d23,null))[_0xd5bf('0x4b')](handleError(_0x429d23,null));};exports[_0xd5bf('0x8e')]=function(_0x12663e,_0x2de1f7){var _0x369827=_0x12663e['body'][_0xd5bf('0x8f')];return db['User']['find']({'where':{'id':_0x12663e[_0xd5bf('0x4d')]['id']},'attributes':['id',_0xd5bf('0x2b'),'role',_0xd5bf('0x90'),_0xd5bf('0x91'),_0xd5bf('0x92'),_0xd5bf('0x93')]})[_0xd5bf('0x1f')](handleEntityNotFound(_0x2de1f7,null))[_0xd5bf('0x1f')](function(_0x39c194){if(_0x39c194){if(!utils[_0xd5bf('0x94')](_0x369827)){throw new db[(_0xd5bf('0x80'))]['ValidationError']('Unknown\x20channel');}return _0x39c194[_0xd5bf('0x95')+_[_0xd5bf('0x96')](_0x369827[_0xd5bf('0x97')]())+'Queues'](_0x12663e[_0xd5bf('0x4f')][_0xd5bf('0x52')],{'penalty':_0x12663e['body']['penalty']||0x0})[_0xd5bf('0x98')](function(_0x5b7b27){for(var _0x520335=0x0;_0x520335<_0x12663e[_0xd5bf('0x4f')][_0xd5bf('0x52')][_0xd5bf('0x44')];_0x520335+=0x1){var _0x1a30a6={'UserId':Number(_0x12663e[_0xd5bf('0x4d')]['id'])};_0x1a30a6[_[_0xd5bf('0x96')](_0x369827[_0xd5bf('0x97')]())+_0xd5bf('0x99')]=Number(_0x12663e['body'][_0xd5bf('0x52')][_0x520335]);socket[_0xd5bf('0x1d')](_0xd5bf('0x23')+_[_0xd5bf('0x96')](_0x369827[_0xd5bf('0x97')]())+'Queue:save',_0x1a30a6);}return _0x5b7b27;})[_0xd5bf('0x1f')](function(){if(_0x369827===_0xd5bf('0x9a')){return db[_0xd5bf('0x9b')][_0xd5bf('0x41')]({'where':{'id':_0x12663e[_0xd5bf('0x4f')][_0xd5bf('0x52')]||[]},'raw':!![],'attributes':['id',_0xd5bf('0x2b')]});}})['then'](function(_0x2349ce){var _0x1f79ec=_0x39c194[_0xd5bf('0x20')]({'plain':!![]});var _0x136883=[];if(_0x369827===_0xd5bf('0x9a')&&_0x1f79ec[_0xd5bf('0x1b')]===_0xd5bf('0x1c')&&_0x1f79ec[_0xd5bf('0x90')]){for(let _0x178e71=0x0;_0x178e71<_0x2349ce[_0xd5bf('0x44')];_0x178e71+=0x1){_0x136883['push']({'membername':_0x1f79ec['name'],'UserId':_0x1f79ec['id'],'queue_name':_0x2349ce[_0x178e71][_0xd5bf('0x2b')],'VoiceQueueId':_0x2349ce[_0x178e71]['id'],'interface':_[_0xd5bf('0x59')](_0x1f79ec[_0xd5bf('0x93')])?util[_0xd5bf('0x9c')](_0xd5bf('0x9d'),_0x1f79ec[_0xd5bf('0x2b')]):_0x1f79ec[_0xd5bf('0x93')],'paused':_0x1f79ec[_0xd5bf('0x92')]||![],'penalty':_0x12663e['body'][_0xd5bf('0x9e')]||0x0});}return Promise['all'](_0x136883['map'](function(_0x325d53){return db['UserVoiceQueueRt'][_0xd5bf('0x9f')](_0x325d53);}));}return _0x39c194;});}})['then'](respondWithStatusCode(_0x2de1f7,null))[_0xd5bf('0x4b')](handleError(_0x2de1f7,null));};exports['removeQueues']=function(_0x11621c,_0x2f7b25){var _0xea7125,_0x3c77bf;return db[_0xd5bf('0x2e')][_0xd5bf('0x2a')]({'where':{'id':_0x11621c[_0xd5bf('0x4d')]['id']},'attributes':['id',_0xd5bf('0x2b'),_0xd5bf('0x1b')]})[_0xd5bf('0x1f')](handleEntityNotFound(_0x2f7b25,null))[_0xd5bf('0x1f')](function(_0x42a316){if(_0x42a316){_0xea7125=_0x42a316;if(!_0x11621c[_0xd5bf('0x39')][_0xd5bf('0x8f')]||!utils[_0xd5bf('0x94')](_0x11621c['query']['channel'])){throw new db[(_0xd5bf('0x80'))]['ValidationError']('Unknown\x20channel');}return _0x42a316[_0xd5bf('0xa0')+_['capitalize'](_0x11621c[_0xd5bf('0x39')][_0xd5bf('0x8f')][_0xd5bf('0x97')]())+_0xd5bf('0xa1')](_0x11621c['query']['ids']);}})[_0xd5bf('0x1f')](function(_0x4f5459){if(_[_0xd5bf('0xa2')](_0x11621c[_0xd5bf('0x39')]['ids'])){for(var _0x10afcb=0x0;_0x10afcb<_0x11621c[_0xd5bf('0x39')]['ids']['length'];_0x10afcb+=0x1){_0x3c77bf={'UserId':Number(_0x11621c[_0xd5bf('0x4d')]['id'])};_0x3c77bf[_[_0xd5bf('0x96')](_0x11621c['query'][_0xd5bf('0x8f')][_0xd5bf('0x97')]())+_0xd5bf('0x99')]=Number(_0x11621c[_0xd5bf('0x39')]['ids'][_0x10afcb]);socket[_0xd5bf('0x1d')](_0xd5bf('0x23')+_['capitalize'](_0x11621c['query'][_0xd5bf('0x8f')]['toLowerCase']())+_0xd5bf('0xa3'),_0x3c77bf);}}else{_0x3c77bf={'UserId':Number(_0x11621c[_0xd5bf('0x4d')]['id'])};_0x3c77bf[_['capitalize'](_0x11621c[_0xd5bf('0x39')][_0xd5bf('0x8f')][_0xd5bf('0x97')]())+_0xd5bf('0x99')]=Number(_0x11621c[_0xd5bf('0x39')][_0xd5bf('0x52')]);socket['emit']('user'+_[_0xd5bf('0x96')](_0x11621c[_0xd5bf('0x39')][_0xd5bf('0x8f')][_0xd5bf('0x97')]())+'Queue:remove',_0x3c77bf);}return _0x4f5459;})[_0xd5bf('0x1f')](function(){if(_0x11621c[_0xd5bf('0x39')][_0xd5bf('0x8f')]===_0xd5bf('0x9a')){return db[_0xd5bf('0xa4')][_0xd5bf('0x1e')]({'where':{'UserId':_0x11621c['params']['id'],'VoiceQueueId':_0x11621c[_0xd5bf('0x39')]['ids']},'individualHooks':!![]})[_0xd5bf('0x1f')](function(){return _0xea7125;});}return _0xea7125;})['then'](respondWithStatusCode(_0x2f7b25,null))[_0xd5bf('0x4b')](handleError(_0x2f7b25,null));};exports['addAvatar']=function(_0x422ef5,_0x3b2cc5){_0x422ef5[_0xd5bf('0x4f')][_0xd5bf('0xa5')]=_0x422ef5[_0xd5bf('0xa6')]['filename'];return db[_0xd5bf('0x2e')]['find']({'where':{'id':_0x422ef5['params']['id']}})['then'](handleEntityNotFound(_0x3b2cc5,null))['then'](saveUpdates(_0x422ef5['body'],null))[_0xd5bf('0x1f')](respondWithResult(_0x3b2cc5,null))[_0xd5bf('0x4b')](handleError(_0x3b2cc5,null));};exports[_0xd5bf('0xa7')]=function(_0x59483e,_0x207ddf){var _0x46b7be=path[_0xd5bf('0xa8')](config[_0xd5bf('0xa9')],_0xd5bf('0xaa'));return db['User'][_0xd5bf('0x2a')]({'where':{'id':_0x59483e[_0xd5bf('0x4d')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xd5bf('0x1f')](handleEntityNotFound(_0x207ddf,null))['then'](function(_0x45a2d1){if(_0x45a2d1){if(_[_0xd5bf('0x59')](_0x45a2d1[_0xd5bf('0xa5')])){return _0x207ddf['download'](_0x46b7be);}else{if(!fs[_0xd5bf('0xab')](path['join'](config[_0xd5bf('0xa9')],'server/files/images/',_0x45a2d1[_0xd5bf('0xa5')]))){return _0x207ddf[_0xd5bf('0xac')](_0x46b7be);}return _0x207ddf['download'](path[_0xd5bf('0xa8')](config[_0xd5bf('0xa9')],_0xd5bf('0xad'),_0x45a2d1[_0xd5bf('0xa5')]));}}})[_0xd5bf('0x4b')](handleError(_0x207ddf,null));};exports[_0xd5bf('0xae')]=function(_0x282bf2,_0x25926f){return db[_0xd5bf('0x2e')][_0xd5bf('0x2a')]({'where':{'id':_0x282bf2[_0xd5bf('0x4d')]['id']},'attributes':['id']})[_0xd5bf('0x1f')](handleEntityNotFound(_0x25926f,null))[_0xd5bf('0x1f')](function(_0x5a8428){var _0x4a7781=[];values=_0x5a8428[_0xd5bf('0x45')];_0x4a7781[_0xd5bf('0x40')](get_open_tabs('chat',_0x5a8428['dataValues']));_0x4a7781[_0xd5bf('0x40')](get_open_tabs(_0xd5bf('0xaf'),_0x5a8428[_0xd5bf('0x45')]));_0x4a7781[_0xd5bf('0x40')](get_open_tabs(_0xd5bf('0x48'),_0x5a8428['dataValues']));_0x4a7781[_0xd5bf('0x40')](get_open_tabs(_0xd5bf('0x49'),_0x5a8428[_0xd5bf('0x45')]));_0x4a7781[_0xd5bf('0x40')](get_open_tabs(_0xd5bf('0x46'),_0x5a8428[_0xd5bf('0x45')]));_0x4a7781['push'](get_open_tabs(_0xd5bf('0x47'),_0x5a8428[_0xd5bf('0x45')]));return Promise['all'](_0x4a7781);})[_0xd5bf('0x1f')](function(_0x2e998a){if(_0x2e998a){var _0x4b6b68=_[_0xd5bf('0x2f')](values[_0xd5bf('0xb0')],function(_0x28ecdd){return{'channel':_0xd5bf('0xb1'),'id':_0x28ecdd['id'],'createdAt':_0x28ecdd[_0xd5bf('0xb2')]};});var _0x200c20=_[_0xd5bf('0x2f')](values['FaxOpenTabs'],function(_0x318498){return{'channel':'FAX','id':_0x318498['id'],'createdAt':_0x318498[_0xd5bf('0xb2')]};});var _0x274bb4=_[_0xd5bf('0x2f')](values[_0xd5bf('0xb3')],function(_0x5a9187){return{'channel':_0xd5bf('0xb4'),'id':_0x5a9187['id'],'createdAt':_0x5a9187[_0xd5bf('0xb2')]};});var _0xad8df2=_[_0xd5bf('0x2f')](values[_0xd5bf('0xb5')],function(_0x13fb97){return{'channel':_0xd5bf('0xb6'),'id':_0x13fb97['id'],'createdAt':_0x13fb97[_0xd5bf('0xb2')]};});var _0x1f5835=_[_0xd5bf('0x2f')](values['SmsOpenTabs'],function(_0xa8a901){return{'channel':_0xd5bf('0xb7'),'id':_0xa8a901['id'],'createdAt':_0xa8a901[_0xd5bf('0xb2')]};});var _0x472ae8=_[_0xd5bf('0x2f')](values[_0xd5bf('0xb8')],function(_0x5609b2){return{'channel':_0xd5bf('0xb9'),'id':_0x5609b2['id'],'createdAt':_0x5609b2[_0xd5bf('0xb2')]};});var _0x32ba2d=_[_0xd5bf('0xba')](_0x4b6b68,_0x200c20,_0x274bb4,_0xad8df2,_0x1f5835,_0x472ae8);var _0x3af0a8={'count':_0x32ba2d[_0xd5bf('0x44')],'rows':_0x32ba2d};return _0x3af0a8;}else return null;})['then'](respondWithResult(_0x25926f,null))[_0xd5bf('0x4b')](handleError(_0x25926f,null));};exports['getContacts']=function(_0x2b8275,_0x37e5a9){var _0x513857={};return db[_0xd5bf('0x2e')][_0xd5bf('0x88')]({'where':{'id':_0x2b8275[_0xd5bf('0x4d')]['id']}})['then'](function(_0x30ce0e){if(!_0x30ce0e){throw new APINotFoundError(util[_0xd5bf('0x9c')](_0xd5bf('0xbb'),_0x2b8275['params']['id']));}return contacts['describe']();})[_0xd5bf('0x1f')](function(_0x2e74f2){_0x2b8275[_0xd5bf('0x39')][_0xd5bf('0x2e')]=_0x2b8275['params']['id'];_0x513857=qs[_0xd5bf('0x38')](_0x2e74f2,_0x2b8275);if(_0x2b8275['query'][_0xd5bf('0xbc')](_0xd5bf('0x3a'))){_0x513857[_0xd5bf('0x3b')]=[{'model':db[_0xd5bf('0xbd')],'as':_0xd5bf('0xbe'),'required':![]},{'model':db[_0xd5bf('0xbf')],'as':_0xd5bf('0xc0'),'attributes':['id',_0xd5bf('0x2b'),_0xd5bf('0xc1')],'where':_0x2b8275['query'][_0xd5bf('0xc2')]?{'id':_0x2b8275[_0xd5bf('0x39')]['tag']}:undefined,'required':_0x2b8275[_0xd5bf('0x39')]['tag']?!![]:![]}];}return contacts[_0xd5bf('0x41')](_0x2b8275['query'],_0x2b8275[_0xd5bf('0x23')],_0x513857,_0x2e74f2);})['then'](respondWithFilteredResult(_0x37e5a9,_0x513857))['catch'](APIHandleError(_0x37e5a9));};exports[_0xd5bf('0xc3')]=function(_0x499de6,_0x41026c){var _0x2e74bd;var _0x1641f2={};var _0x2ccfec;return db[_0xd5bf('0x2e')][_0xd5bf('0x88')]({'where':{'id':_0x499de6[_0xd5bf('0x4d')]['id']},'attributes':['id',_0xd5bf('0x2b'),_0xd5bf('0x1b')]})[_0xd5bf('0x1f')](handleEntityNotFound(_0x41026c,null))[_0xd5bf('0x1f')](function(_0x5f0b2c){if(!utils[_0xd5bf('0x94')](_0x499de6[_0xd5bf('0x39')][_0xd5bf('0x8f')])){throw new db[(_0xd5bf('0x80'))][(_0xd5bf('0x81'))](_0xd5bf('0xc4'));}_0x2e74bd=_0x5f0b2c;var _0x45304f={};_0x45304f[_0xd5bf('0xc5')]=_[_0xd5bf('0xc6')](db[_[_0xd5bf('0x96')](_0x499de6[_0xd5bf('0x39')][_0xd5bf('0x8f')])+_0xd5bf('0xc7')][_0xd5bf('0xc8')]);_0x45304f[_0xd5bf('0x39')]=_[_0xd5bf('0xc6')](_0x499de6['query']);_0x45304f['filters']=_['intersection'](_0x45304f[_0xd5bf('0xc5')],_0x45304f[_0xd5bf('0x39')]);_0x1641f2[_0xd5bf('0x3f')]=_[_0xd5bf('0xc9')](_0x45304f[_0xd5bf('0xc5')],qs['fields'](_0x499de6[_0xd5bf('0x39')]['fields']));_0x1641f2[_0xd5bf('0x3f')]=_0x1641f2[_0xd5bf('0x3f')][_0xd5bf('0x44')]?_0x1641f2[_0xd5bf('0x3f')]:_0x45304f[_0xd5bf('0xc5')];_0x1641f2[_0xd5bf('0xca')]=qs[_0xd5bf('0xcb')](_0x499de6[_0xd5bf('0x39')][_0xd5bf('0xcb')]);_0x1641f2[_0xd5bf('0xcc')]=qs[_0xd5bf('0xcd')](_[_0xd5bf('0xce')](_0x499de6[_0xd5bf('0x39')],_0x45304f[_0xd5bf('0xcd')]));if(_0x499de6[_0xd5bf('0x39')][_0xd5bf('0x33')]){_0x1641f2[_0xd5bf('0xcc')]=_['merge'](_0x1641f2[_0xd5bf('0xcc')],{'$or':_[_0xd5bf('0x2f')](_0x1641f2[_0xd5bf('0x3f')],function(_0x45b140){var _0x9e8d61={};_0x9e8d61[_0x45b140]={'$like':'%'+_0x499de6[_0xd5bf('0x39')][_0xd5bf('0x33')]+'%'};return _0x9e8d61;})});}_0x1641f2=_[_0xd5bf('0xcf')]({},_0x1641f2,_0x499de6[_0xd5bf('0x4e')]);switch(_0x2e74bd[_0xd5bf('0x1b')]){case _0xd5bf('0x21'):return db[_[_0xd5bf('0x96')](_0x499de6[_0xd5bf('0x39')]['channel'])+_0xd5bf('0xc7')][_0xd5bf('0x41')](_0x1641f2);case _0xd5bf('0x23'):case _0xd5bf('0x1c'):return _0x2e74bd[_0xd5bf('0x20')+_[_0xd5bf('0x96')](_0x499de6[_0xd5bf('0x39')][_0xd5bf('0x8f')])+_0xd5bf('0xa1')](_0x1641f2);default:throw new db[(_0xd5bf('0x80'))][(_0xd5bf('0x81'))](_0xd5bf('0xd0'));}})['then'](function(_0x14df7b){_0x2ccfec=_0x14df7b[_0xd5bf('0x44')];if(!_0x499de6[_0xd5bf('0x39')][_0xd5bf('0xbc')](_0xd5bf('0xd1'))){_0x1641f2[_0xd5bf('0x17')]=qs[_0xd5bf('0x17')](_0x499de6['query'][_0xd5bf('0x17')]);_0x1641f2[_0xd5bf('0x15')]=qs[_0xd5bf('0x15')](_0x499de6[_0xd5bf('0x39')][_0xd5bf('0x15')]);}switch(_0x2e74bd[_0xd5bf('0x1b')]){case _0xd5bf('0x21'):return db[_[_0xd5bf('0x96')](_0x499de6[_0xd5bf('0x39')]['channel'])+_0xd5bf('0xc7')][_0xd5bf('0x41')](_0x1641f2);case _0xd5bf('0x23'):case _0xd5bf('0x1c'):return _0x2e74bd[_0xd5bf('0x20')+_[_0xd5bf('0x96')](_0x499de6[_0xd5bf('0x39')][_0xd5bf('0x8f')])+_0xd5bf('0xa1')](_0x1641f2);}})[_0xd5bf('0x1f')](function(_0x5adf09){return{'count':_0x2ccfec,'rows':_0x5adf09};})[_0xd5bf('0x1f')](respondWithResult(_0x41026c,null))[_0xd5bf('0x4b')](handleError(_0x41026c,null));};exports['getVoiceQueuesRt']=function(_0x56d2e6,_0xa95341){var _0x304519={};var _0x5afeed={};var _0x5d2c8f;var _0x270042;return db[_0xd5bf('0x2e')][_0xd5bf('0x88')]({'where':{'id':_0x56d2e6[_0xd5bf('0x4d')]['id']}})[_0xd5bf('0x1f')](handleEntityNotFound(_0xa95341,null))[_0xd5bf('0x1f')](function(_0x17fc5e){if(_0x17fc5e){_0x5d2c8f=_0x17fc5e;_0x5afeed[_0xd5bf('0xc5')]=_[_0xd5bf('0xc6')](db['UserVoiceQueueRt'][_0xd5bf('0xc8')]);_0x5afeed['query']=_[_0xd5bf('0xc6')](_0x56d2e6[_0xd5bf('0x39')]);_0x5afeed[_0xd5bf('0xcd')]=_[_0xd5bf('0xc9')](_0x5afeed[_0xd5bf('0xc5')],_0x5afeed[_0xd5bf('0x39')]);_0x304519[_0xd5bf('0x3f')]=_[_0xd5bf('0xc9')](_0x5afeed[_0xd5bf('0xc5')],qs['fields'](_0x56d2e6[_0xd5bf('0x39')]['fields']));_0x304519[_0xd5bf('0x3f')]=_0x304519[_0xd5bf('0x3f')]['length']?_0x304519[_0xd5bf('0x3f')]:_0x5afeed[_0xd5bf('0xc5')];_0x304519['order']=qs[_0xd5bf('0xcb')](_0x56d2e6['query'][_0xd5bf('0xcb')]);_0x304519[_0xd5bf('0xcc')]=qs['filters'](_['pick'](_0x56d2e6['query'],_0x5afeed[_0xd5bf('0xcd')]));if(_0x56d2e6[_0xd5bf('0x39')][_0xd5bf('0x33')]){_0x304519['where']=_[_0xd5bf('0xcf')](_0x304519[_0xd5bf('0xcc')],{'$or':_[_0xd5bf('0x2f')](_0x304519[_0xd5bf('0x3f')],function(_0x3d5850){var _0x486a82={};_0x486a82[_0x3d5850]={'$like':'%'+_0x56d2e6['query'][_0xd5bf('0x33')]+'%'};return _0x486a82;})});}_0x304519=_[_0xd5bf('0xcf')]({},_0x304519,_0x56d2e6['options']);return _0x5d2c8f[_0xd5bf('0xd2')](_0x304519);}})[_0xd5bf('0x1f')](function(_0x3ab84c){if(_0x3ab84c){_0x270042=_0x3ab84c[_0xd5bf('0x44')];if(!_0x56d2e6[_0xd5bf('0x39')][_0xd5bf('0xbc')](_0xd5bf('0xd1'))){_0x304519[_0xd5bf('0x17')]=qs[_0xd5bf('0x17')](_0x56d2e6[_0xd5bf('0x39')][_0xd5bf('0x17')]);_0x304519[_0xd5bf('0x15')]=qs['offset'](_0x56d2e6[_0xd5bf('0x39')][_0xd5bf('0x15')]);}return _0x5d2c8f[_0xd5bf('0xd2')](_0x304519);}})['then'](function(_0x4e5c4d){if(_0x4e5c4d){return _0x4e5c4d?{'count':_0x270042,'rows':_0x4e5c4d}:null;}})['then'](respondWithResult(_0xa95341,null))[_0xd5bf('0x4b')](handleError(_0xa95341,null));};exports[_0xd5bf('0xd3')]=function(_0x103189,_0x23a1a1){var _0x49827d={};var _0x3dfa48={};var _0x59933c;var _0x20552a;return db['User']['findOne']({'where':{'id':_0x103189[_0xd5bf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x23a1a1,null))[_0xd5bf('0x1f')](function(_0x4f51dd){if(_0x4f51dd){_0x59933c=_0x4f51dd;_0x3dfa48[_0xd5bf('0xc5')]=_[_0xd5bf('0xc6')](db[_0xd5bf('0xd4')][_0xd5bf('0xc8')]);_0x3dfa48[_0xd5bf('0x39')]=_[_0xd5bf('0xc6')](_0x103189[_0xd5bf('0x39')]);_0x3dfa48[_0xd5bf('0xcd')]=_['intersection'](_0x3dfa48[_0xd5bf('0xc5')],_0x3dfa48['query']);_0x49827d[_0xd5bf('0x3f')]=_['intersection'](_0x3dfa48['model'],qs[_0xd5bf('0xd5')](_0x103189[_0xd5bf('0x39')]['fields']));_0x49827d[_0xd5bf('0x3f')]=_0x49827d[_0xd5bf('0x3f')]['length']?_0x49827d['attributes']:_0x3dfa48[_0xd5bf('0xc5')];_0x49827d[_0xd5bf('0xca')]=qs[_0xd5bf('0xcb')](_0x103189['query'][_0xd5bf('0xcb')]);_0x49827d[_0xd5bf('0xcc')]=qs[_0xd5bf('0xcd')](_[_0xd5bf('0xce')](_0x103189['query'],_0x3dfa48[_0xd5bf('0xcd')]));if(_0x103189['query'][_0xd5bf('0x33')]){_0x49827d[_0xd5bf('0xcc')]=_[_0xd5bf('0xcf')](_0x49827d['where'],{'$or':_[_0xd5bf('0x2f')](_0x49827d[_0xd5bf('0x3f')],function(_0x946c80){var _0x55e164={};_0x55e164[_0x946c80]={'$like':'%'+_0x103189[_0xd5bf('0x39')][_0xd5bf('0x33')]+'%'};return _0x55e164;})});}_0x49827d=_[_0xd5bf('0xcf')]({},_0x49827d,_0x103189[_0xd5bf('0x4e')]);return _0x59933c[_0xd5bf('0xd3')](_0x49827d);}})['then'](function(_0x2e8bd6){if(_0x2e8bd6){_0x20552a=_0x2e8bd6['length'];if(!_0x103189[_0xd5bf('0x39')][_0xd5bf('0xbc')](_0xd5bf('0xd1'))){_0x49827d[_0xd5bf('0x17')]=qs['limit'](_0x103189[_0xd5bf('0x39')][_0xd5bf('0x17')]);_0x49827d['offset']=qs[_0xd5bf('0x15')](_0x103189['query'][_0xd5bf('0x15')]);}return _0x59933c[_0xd5bf('0xd3')](_0x49827d);}})[_0xd5bf('0x1f')](function(_0x127d0a){if(_0x127d0a){return _0x127d0a?{'count':_0x20552a,'rows':_0x127d0a}:null;}})[_0xd5bf('0x1f')](respondWithResult(_0x23a1a1,null))[_0xd5bf('0x4b')](handleError(_0x23a1a1,null));};exports[_0xd5bf('0xd6')]=function(_0x488239,_0x4ac42d){var _0x21ccb5={'raw':!![],'where':{}};var _0x56b11e={};var _0x24a098={'count':0x0,'rows':[]};return db[_0xd5bf('0x2e')][_0xd5bf('0x88')]({'where':{'id':_0x488239[_0xd5bf('0x4d')]['id']}})[_0xd5bf('0x1f')](handleEntityNotFound(_0x4ac42d,null))[_0xd5bf('0x1f')](function(_0x2b06a9){if(_0x2b06a9){_0x56b11e[_0xd5bf('0xc5')]=_[_0xd5bf('0xc6')](db[_0xd5bf('0xd7')][_0xd5bf('0xc8')]);_0x56b11e[_0xd5bf('0x39')]=_[_0xd5bf('0xc6')](_0x488239[_0xd5bf('0x39')]);_0x56b11e[_0xd5bf('0xcd')]=_[_0xd5bf('0xc9')](_0x56b11e[_0xd5bf('0xc5')],_0x56b11e['query']);_0x21ccb5[_0xd5bf('0x3f')]=_[_0xd5bf('0xc9')](_0x56b11e[_0xd5bf('0xc5')],qs[_0xd5bf('0xd5')](_0x488239[_0xd5bf('0x39')]['fields']));_0x21ccb5['attributes']=_0x21ccb5['attributes']['length']?_0x21ccb5[_0xd5bf('0x3f')]:_0x56b11e[_0xd5bf('0xc5')];if(!_0x488239[_0xd5bf('0x39')][_0xd5bf('0xbc')](_0xd5bf('0xd1'))){_0x21ccb5[_0xd5bf('0x17')]=qs[_0xd5bf('0x17')](_0x488239[_0xd5bf('0x39')][_0xd5bf('0x17')]);_0x21ccb5[_0xd5bf('0x15')]=qs['offset'](_0x488239[_0xd5bf('0x39')][_0xd5bf('0x15')]);}_0x21ccb5[_0xd5bf('0xca')]=qs['sort'](_0x488239[_0xd5bf('0x39')][_0xd5bf('0xcb')]);_0x21ccb5['where']=qs[_0xd5bf('0xcd')](_[_0xd5bf('0xce')](_0x488239[_0xd5bf('0x39')],_0x56b11e[_0xd5bf('0xcd')]));_0x21ccb5[_0xd5bf('0xcc')][_0xd5bf('0xd8')]=_0x2b06a9['id'];if(_0x488239['query'][_0xd5bf('0x33')]){_0x21ccb5[_0xd5bf('0xcc')]=_[_0xd5bf('0xcf')](_0x21ccb5['where'],{'$or':_['map'](_0x21ccb5[_0xd5bf('0x3f')],function(_0x46050b){var _0x1d1867={};_0x1d1867[_0x46050b]={'$like':'%'+_0x488239[_0xd5bf('0x39')]['filter']+'%'};return _0x1d1867;})});}_0x21ccb5=_[_0xd5bf('0xcf')]({},_0x21ccb5,_0x488239[_0xd5bf('0x4e')]);return db[_0xd5bf('0xd7')][_0xd5bf('0x18')]({'where':_0x21ccb5[_0xd5bf('0xcc')]})[_0xd5bf('0x1f')](function(_0x148a2f){_0x24a098[_0xd5bf('0x18')]=_0x148a2f;if(_0x488239[_0xd5bf('0x39')][_0xd5bf('0x3a')]){_0x21ccb5[_0xd5bf('0x3b')]=[{'all':!![]}];}return db['VoiceRecording'][_0xd5bf('0x41')](_0x21ccb5);})['then'](function(_0x404b32){_0x24a098[_0xd5bf('0x42')]=_0x404b32;return _0x24a098;});}})['then'](respondWithFilteredResult(_0x4ac42d,_0x21ccb5))[_0xd5bf('0x4b')](handleError(_0x4ac42d,null));};exports[_0xd5bf('0xd9')]=function(_0x55711a,_0x2eec24){var _0x5ec6d3={'raw':!![],'where':{}};var _0x4ab6af={};var _0xcc328a={'count':0x0,'rows':[]};return db[_0xd5bf('0x2e')][_0xd5bf('0x88')]({'where':{'id':_0x55711a[_0xd5bf('0x4d')]['id']}})[_0xd5bf('0x1f')](handleEntityNotFound(_0x2eec24,null))[_0xd5bf('0x1f')](function(_0xba9f1d){if(_0xba9f1d){_0x4ab6af['model']=_[_0xd5bf('0xc6')](db[_0xd5bf('0xda')][_0xd5bf('0xc8')]);_0x4ab6af['query']=_[_0xd5bf('0xc6')](_0x55711a[_0xd5bf('0x39')]);_0x4ab6af[_0xd5bf('0xcd')]=_[_0xd5bf('0xc9')](_0x4ab6af[_0xd5bf('0xc5')],_0x4ab6af[_0xd5bf('0x39')]);_0x5ec6d3[_0xd5bf('0x3f')]=_[_0xd5bf('0xc9')](_0x4ab6af[_0xd5bf('0xc5')],qs[_0xd5bf('0xd5')](_0x55711a[_0xd5bf('0x39')][_0xd5bf('0xd5')]));_0x5ec6d3['attributes']=_0x5ec6d3[_0xd5bf('0x3f')][_0xd5bf('0x44')]?_0x5ec6d3['attributes']:_0x4ab6af[_0xd5bf('0xc5')];if(!_0x55711a['query'][_0xd5bf('0xbc')](_0xd5bf('0xd1'))){_0x5ec6d3['limit']=qs[_0xd5bf('0x17')](_0x55711a[_0xd5bf('0x39')][_0xd5bf('0x17')]);_0x5ec6d3[_0xd5bf('0x15')]=qs[_0xd5bf('0x15')](_0x55711a[_0xd5bf('0x39')]['offset']);}_0x5ec6d3[_0xd5bf('0xca')]=qs[_0xd5bf('0xcb')](_0x55711a[_0xd5bf('0x39')]['sort']);_0x5ec6d3[_0xd5bf('0xcc')]=qs[_0xd5bf('0xcd')](_[_0xd5bf('0xce')](_0x55711a[_0xd5bf('0x39')],_0x4ab6af[_0xd5bf('0xcd')]));_0x5ec6d3[_0xd5bf('0xcc')][_0xd5bf('0xd8')]=_0xba9f1d['id'];if(_0x55711a['query'][_0xd5bf('0x33')]){_0x5ec6d3[_0xd5bf('0xcc')]=_[_0xd5bf('0xcf')](_0x5ec6d3[_0xd5bf('0xcc')],{'$or':_[_0xd5bf('0x2f')](_0x5ec6d3[_0xd5bf('0x3f')],function(_0x54fd1d){var _0x46398a={};_0x46398a[_0x54fd1d]={'$like':'%'+_0x55711a['query'][_0xd5bf('0x33')]+'%'};return _0x46398a;})});}_0x5ec6d3=_[_0xd5bf('0xcf')]({},_0x5ec6d3,_0x55711a[_0xd5bf('0x4e')]);return db['ScreenRecording'][_0xd5bf('0x18')]({'where':_0x5ec6d3[_0xd5bf('0xcc')]})[_0xd5bf('0x1f')](function(_0x265bca){_0xcc328a[_0xd5bf('0x18')]=_0x265bca;if(_0x55711a[_0xd5bf('0x39')][_0xd5bf('0x3a')]){_0x5ec6d3[_0xd5bf('0x3b')]=[{'all':!![]}];}return db[_0xd5bf('0xda')]['findAll'](_0x5ec6d3);})[_0xd5bf('0x1f')](function(_0x46588b){_0xcc328a[_0xd5bf('0x42')]=_0x46588b;return _0xcc328a;});}})[_0xd5bf('0x1f')](respondWithFilteredResult(_0x2eec24,_0x5ec6d3))[_0xd5bf('0x4b')](handleError(_0x2eec24,null));};exports['getChatInteractions']=function(_0x31c6a3,_0x25f9b2){var _0x300268={};var _0x4e85ce={};var _0x40c025;var _0x190ed0;return db['User']['findOne']({'where':{'id':_0x31c6a3['params']['id']}})[_0xd5bf('0x1f')](handleEntityNotFound(_0x25f9b2,null))[_0xd5bf('0x1f')](function(_0x512be9){if(_0x512be9){_0x40c025=_0x512be9;_0x4e85ce[_0xd5bf('0xc5')]=_[_0xd5bf('0xc6')](db[_0xd5bf('0xdb')]['rawAttributes']);_0x4e85ce['query']=_[_0xd5bf('0xc6')](_0x31c6a3[_0xd5bf('0x39')]);_0x4e85ce['filters']=_['intersection'](_0x4e85ce[_0xd5bf('0xc5')],_0x4e85ce[_0xd5bf('0x39')]);_0x300268[_0xd5bf('0x3f')]=_[_0xd5bf('0xc9')](_0x4e85ce['model'],qs[_0xd5bf('0xd5')](_0x31c6a3['query'][_0xd5bf('0xd5')]));_0x300268['attributes']=_0x300268['attributes'][_0xd5bf('0x44')]?_0x300268[_0xd5bf('0x3f')]:_0x4e85ce[_0xd5bf('0xc5')];_0x300268[_0xd5bf('0xca')]=qs[_0xd5bf('0xcb')](_0x31c6a3['query']['sort']);_0x300268[_0xd5bf('0xcc')]=qs[_0xd5bf('0xcd')](_[_0xd5bf('0xce')](_0x31c6a3[_0xd5bf('0x39')],_0x4e85ce[_0xd5bf('0xcd')]));if(_0x31c6a3[_0xd5bf('0x39')]['filter']){_0x300268[_0xd5bf('0xcc')]=_[_0xd5bf('0xcf')](_0x300268[_0xd5bf('0xcc')],{'$or':_['map'](_0x300268['attributes'],function(_0x3486ee){var _0x2be74d={};_0x2be74d[_0x3486ee]={'$like':'%'+_0x31c6a3[_0xd5bf('0x39')][_0xd5bf('0x33')]+'%'};return _0x2be74d;})});}_0x300268=_[_0xd5bf('0xcf')]({},_0x300268,_0x31c6a3[_0xd5bf('0x4e')]);return _0x40c025[_0xd5bf('0xdc')](_0x300268);}})[_0xd5bf('0x1f')](function(_0x41a438){if(_0x41a438){_0x190ed0=_0x41a438[_0xd5bf('0x44')];if(!_0x31c6a3['query'][_0xd5bf('0xbc')]('nolimit')){_0x300268['limit']=qs[_0xd5bf('0x17')](_0x31c6a3[_0xd5bf('0x39')][_0xd5bf('0x17')]);_0x300268['offset']=qs['offset'](_0x31c6a3[_0xd5bf('0x39')][_0xd5bf('0x15')]);}return _0x40c025[_0xd5bf('0xdc')](_0x300268);}})[_0xd5bf('0x1f')](function(_0x1d0108){if(_0x1d0108){return _0x1d0108?{'count':_0x190ed0,'rows':_0x1d0108}:null;}})['then'](respondWithResult(_0x25f9b2,null))[_0xd5bf('0x4b')](handleError(_0x25f9b2,null));};exports[_0xd5bf('0xdd')]=function(_0x1bf9f0,_0x172c30){var _0x176b55={};var _0x51e3ae={};var _0x46f97c;var _0x587757;return db[_0xd5bf('0x2e')][_0xd5bf('0x88')]({'where':{'id':_0x1bf9f0[_0xd5bf('0x4d')]['id']}})[_0xd5bf('0x1f')](handleEntityNotFound(_0x172c30,null))['then'](function(_0x126c6b){if(_0x126c6b){_0x46f97c=_0x126c6b;_0x51e3ae[_0xd5bf('0xc5')]=_[_0xd5bf('0xc6')](db[_0xd5bf('0xde')][_0xd5bf('0xc8')]);_0x51e3ae[_0xd5bf('0x39')]=_[_0xd5bf('0xc6')](_0x1bf9f0[_0xd5bf('0x39')]);_0x51e3ae['filters']=_[_0xd5bf('0xc9')](_0x51e3ae[_0xd5bf('0xc5')],_0x51e3ae['query']);_0x176b55['attributes']=_[_0xd5bf('0xc9')](_0x51e3ae[_0xd5bf('0xc5')],qs[_0xd5bf('0xd5')](_0x1bf9f0['query'][_0xd5bf('0xd5')]));_0x176b55[_0xd5bf('0x3f')]=_0x176b55[_0xd5bf('0x3f')][_0xd5bf('0x44')]?_0x176b55['attributes']:_0x51e3ae[_0xd5bf('0xc5')];_0x176b55[_0xd5bf('0xca')]=qs['sort'](_0x1bf9f0['query'][_0xd5bf('0xcb')]);_0x176b55[_0xd5bf('0xcc')]=qs['filters'](_[_0xd5bf('0xce')](_0x1bf9f0[_0xd5bf('0x39')],_0x51e3ae['filters']));if(_0x1bf9f0[_0xd5bf('0x39')][_0xd5bf('0x33')]){_0x176b55['where']=_[_0xd5bf('0xcf')](_0x176b55[_0xd5bf('0xcc')],{'$or':_['map'](_0x176b55['attributes'],function(_0x45b7a8){var _0x15400e={};_0x15400e[_0x45b7a8]={'$like':'%'+_0x1bf9f0[_0xd5bf('0x39')][_0xd5bf('0x33')]+'%'};return _0x15400e;})});}_0x176b55=_['merge']({},_0x176b55,_0x1bf9f0[_0xd5bf('0x4e')]);return _0x46f97c[_0xd5bf('0xdd')](_0x176b55);}})['then'](function(_0x334d62){if(_0x334d62){_0x587757=_0x334d62[_0xd5bf('0x44')];if(!_0x1bf9f0[_0xd5bf('0x39')]['hasOwnProperty'](_0xd5bf('0xd1'))){_0x176b55[_0xd5bf('0x17')]=qs[_0xd5bf('0x17')](_0x1bf9f0['query'][_0xd5bf('0x17')]);_0x176b55['offset']=qs[_0xd5bf('0x15')](_0x1bf9f0[_0xd5bf('0x39')][_0xd5bf('0x15')]);}return _0x46f97c[_0xd5bf('0xdd')](_0x176b55);}})[_0xd5bf('0x1f')](function(_0x321448){if(_0x321448){return _0x321448?{'count':_0x587757,'rows':_0x321448}:null;}})[_0xd5bf('0x1f')](respondWithResult(_0x172c30,null))[_0xd5bf('0x4b')](handleError(_0x172c30,null));};exports['getMailInteractions']=function(_0x26dcc3,_0x4cffab){var _0x1d4fbd={'raw':!![],'where':{}};var _0x519edd={};var _0x40cd57={'count':0x0,'rows':[]};return db[_0xd5bf('0x2e')]['findOne']({'where':{'id':_0x26dcc3[_0xd5bf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4cffab,null))[_0xd5bf('0x1f')](function(_0x348afc){if(_0x348afc){_0x519edd[_0xd5bf('0xc5')]=_[_0xd5bf('0xc6')](db[_0xd5bf('0xdf')][_0xd5bf('0xc8')]);_0x519edd[_0xd5bf('0x39')]=_[_0xd5bf('0xc6')](_0x26dcc3['query']);_0x519edd[_0xd5bf('0xcd')]=_[_0xd5bf('0xc9')](_0x519edd[_0xd5bf('0xc5')],_0x519edd[_0xd5bf('0x39')]);_0x1d4fbd[_0xd5bf('0x3f')]=_[_0xd5bf('0xc9')](_0x519edd[_0xd5bf('0xc5')],qs[_0xd5bf('0xd5')](_0x26dcc3['query'][_0xd5bf('0xd5')]));_0x1d4fbd['attributes']=_0x1d4fbd[_0xd5bf('0x3f')][_0xd5bf('0x44')]?_0x1d4fbd[_0xd5bf('0x3f')]:_0x519edd['model'];if(!_0x26dcc3['query'][_0xd5bf('0xbc')](_0xd5bf('0xd1'))){_0x1d4fbd[_0xd5bf('0x17')]=qs[_0xd5bf('0x17')](_0x26dcc3[_0xd5bf('0x39')][_0xd5bf('0x17')]);_0x1d4fbd[_0xd5bf('0x15')]=qs['offset'](_0x26dcc3[_0xd5bf('0x39')][_0xd5bf('0x15')]);}_0x1d4fbd['order']=qs[_0xd5bf('0xcb')](_0x26dcc3[_0xd5bf('0x39')][_0xd5bf('0xcb')]);_0x1d4fbd[_0xd5bf('0xcc')]=qs[_0xd5bf('0xcd')](_[_0xd5bf('0xce')](_0x26dcc3[_0xd5bf('0x39')],_0x519edd['filters']));_0x1d4fbd[_0xd5bf('0xcc')][_0xd5bf('0xd8')]=_0x348afc['id'];if(_0x26dcc3[_0xd5bf('0x39')][_0xd5bf('0x33')]){_0x1d4fbd[_0xd5bf('0xcc')]=_[_0xd5bf('0xcf')](_0x1d4fbd[_0xd5bf('0xcc')],{'$or':_['map'](_0x1d4fbd[_0xd5bf('0x3f')],function(_0x3080f5){var _0x8c12c1={};_0x8c12c1[_0x3080f5]={'$like':'%'+_0x26dcc3['query'][_0xd5bf('0x33')]+'%'};return _0x8c12c1;})});}_0x1d4fbd=_[_0xd5bf('0xcf')]({},_0x1d4fbd,_0x26dcc3['options']);return db['MailInteraction'][_0xd5bf('0x18')]({'where':_0x1d4fbd[_0xd5bf('0xcc')]})[_0xd5bf('0x1f')](function(_0x3cdab4){_0x40cd57[_0xd5bf('0x18')]=_0x3cdab4;if(_0x26dcc3['query']['includeAll']){_0x1d4fbd[_0xd5bf('0x3b')]=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x1d4fbd);})[_0xd5bf('0x1f')](function(_0x3dd62f){_0x40cd57[_0xd5bf('0x42')]=_0x3dd62f;return _0x40cd57;});}})[_0xd5bf('0x1f')](respondWithFilteredResult(_0x4cffab,_0x1d4fbd))[_0xd5bf('0x4b')](handleError(_0x4cffab,null));};exports[_0xd5bf('0xe0')]=function(_0x588151,_0x2f239c){var _0x3e57c5={};var _0x3688e6={};var _0x4fb4d7;var _0x29451b;return db[_0xd5bf('0x2e')][_0xd5bf('0x88')]({'where':{'id':_0x588151[_0xd5bf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2f239c,null))['then'](function(_0x2a9736){if(_0x2a9736){_0x4fb4d7=_0x2a9736;_0x3688e6['model']=_[_0xd5bf('0xc6')](db[_0xd5bf('0xe1')][_0xd5bf('0xc8')]);_0x3688e6[_0xd5bf('0x39')]=_[_0xd5bf('0xc6')](_0x588151[_0xd5bf('0x39')]);_0x3688e6['filters']=_['intersection'](_0x3688e6['model'],_0x3688e6[_0xd5bf('0x39')]);_0x3e57c5[_0xd5bf('0x3f')]=_[_0xd5bf('0xc9')](_0x3688e6['model'],qs[_0xd5bf('0xd5')](_0x588151[_0xd5bf('0x39')][_0xd5bf('0xd5')]));_0x3e57c5[_0xd5bf('0x3f')]=_0x3e57c5[_0xd5bf('0x3f')][_0xd5bf('0x44')]?_0x3e57c5['attributes']:_0x3688e6[_0xd5bf('0xc5')];_0x3e57c5[_0xd5bf('0xca')]=qs['sort'](_0x588151[_0xd5bf('0x39')][_0xd5bf('0xcb')]);_0x3e57c5['where']=qs[_0xd5bf('0xcd')](_[_0xd5bf('0xce')](_0x588151[_0xd5bf('0x39')],_0x3688e6[_0xd5bf('0xcd')]));if(_0x588151[_0xd5bf('0x39')][_0xd5bf('0x33')]){_0x3e57c5[_0xd5bf('0xcc')]=_[_0xd5bf('0xcf')](_0x3e57c5['where'],{'$or':_[_0xd5bf('0x2f')](_0x3e57c5[_0xd5bf('0x3f')],function(_0x75effc){var _0x16f70e={};_0x16f70e[_0x75effc]={'$like':'%'+_0x588151[_0xd5bf('0x39')][_0xd5bf('0x33')]+'%'};return _0x16f70e;})});}_0x3e57c5=_[_0xd5bf('0xcf')]({},_0x3e57c5,_0x588151[_0xd5bf('0x4e')]);return _0x4fb4d7['getSmsInteractions'](_0x3e57c5);}})[_0xd5bf('0x1f')](function(_0x3e81a0){if(_0x3e81a0){_0x29451b=_0x3e81a0['length'];if(!_0x588151['query'][_0xd5bf('0xbc')](_0xd5bf('0xd1'))){_0x3e57c5['limit']=qs[_0xd5bf('0x17')](_0x588151[_0xd5bf('0x39')][_0xd5bf('0x17')]);_0x3e57c5[_0xd5bf('0x15')]=qs[_0xd5bf('0x15')](_0x588151[_0xd5bf('0x39')][_0xd5bf('0x15')]);}return _0x4fb4d7['getSmsInteractions'](_0x3e57c5);}})[_0xd5bf('0x1f')](function(_0xdcd97e){if(_0xdcd97e){return _0xdcd97e?{'count':_0x29451b,'rows':_0xdcd97e}:null;}})[_0xd5bf('0x1f')](respondWithResult(_0x2f239c,null))[_0xd5bf('0x4b')](handleError(_0x2f239c,null));};exports[_0xd5bf('0xe2')]=function(_0x31ed73,_0x7ec485){var _0x589e16={};var _0x28b6b3={};var _0x210215;var _0x3da0fc;return db['User']['findOne']({'where':{'id':_0x31ed73['params']['id']}})[_0xd5bf('0x1f')](handleEntityNotFound(_0x7ec485,null))['then'](function(_0x4a7c58){if(_0x4a7c58){_0x210215=_0x4a7c58;_0x28b6b3[_0xd5bf('0xc5')]=_[_0xd5bf('0xc6')](db['FaxInteraction'][_0xd5bf('0xc8')]);_0x28b6b3[_0xd5bf('0x39')]=_[_0xd5bf('0xc6')](_0x31ed73[_0xd5bf('0x39')]);_0x28b6b3[_0xd5bf('0xcd')]=_['intersection'](_0x28b6b3[_0xd5bf('0xc5')],_0x28b6b3[_0xd5bf('0x39')]);_0x589e16[_0xd5bf('0x3f')]=_['intersection'](_0x28b6b3[_0xd5bf('0xc5')],qs[_0xd5bf('0xd5')](_0x31ed73[_0xd5bf('0x39')][_0xd5bf('0xd5')]));_0x589e16[_0xd5bf('0x3f')]=_0x589e16[_0xd5bf('0x3f')]['length']?_0x589e16[_0xd5bf('0x3f')]:_0x28b6b3[_0xd5bf('0xc5')];_0x589e16['order']=qs[_0xd5bf('0xcb')](_0x31ed73[_0xd5bf('0x39')]['sort']);_0x589e16[_0xd5bf('0xcc')]=qs[_0xd5bf('0xcd')](_['pick'](_0x31ed73[_0xd5bf('0x39')],_0x28b6b3[_0xd5bf('0xcd')]));if(_0x31ed73['query'][_0xd5bf('0x33')]){_0x589e16[_0xd5bf('0xcc')]=_[_0xd5bf('0xcf')](_0x589e16[_0xd5bf('0xcc')],{'$or':_[_0xd5bf('0x2f')](_0x589e16[_0xd5bf('0x3f')],function(_0x47429b){var _0x11b279={};_0x11b279[_0x47429b]={'$like':'%'+_0x31ed73[_0xd5bf('0x39')]['filter']+'%'};return _0x11b279;})});}_0x589e16=_[_0xd5bf('0xcf')]({},_0x589e16,_0x31ed73['options']);return _0x210215[_0xd5bf('0xe2')](_0x589e16);}})[_0xd5bf('0x1f')](function(_0x2e8b11){if(_0x2e8b11){_0x3da0fc=_0x2e8b11['length'];if(!_0x31ed73['query'][_0xd5bf('0xbc')]('nolimit')){_0x589e16[_0xd5bf('0x17')]=qs[_0xd5bf('0x17')](_0x31ed73[_0xd5bf('0x39')][_0xd5bf('0x17')]);_0x589e16['offset']=qs['offset'](_0x31ed73[_0xd5bf('0x39')][_0xd5bf('0x15')]);}return _0x210215[_0xd5bf('0xe2')](_0x589e16);}})['then'](function(_0x399e71){if(_0x399e71){return _0x399e71?{'count':_0x3da0fc,'rows':_0x399e71}:null;}})[_0xd5bf('0x1f')](respondWithResult(_0x7ec485,null))[_0xd5bf('0x4b')](handleError(_0x7ec485,null));};exports[_0xd5bf('0xe3')]=function(_0x1d56b4,_0x240bb8){var _0x4ac881={};var _0x1131e2={};var _0x1fb68a;var _0x3efbce;return db['User']['findOne']({'where':{'id':_0x1d56b4['params']['id']}})['then'](handleEntityNotFound(_0x240bb8,null))['then'](function(_0x28aa7e){if(_0x28aa7e){_0x1fb68a=_0x28aa7e;_0x1131e2[_0xd5bf('0xc5')]=_['keys'](db[_0xd5bf('0xe4')][_0xd5bf('0xc8')]);_0x1131e2[_0xd5bf('0x39')]=_[_0xd5bf('0xc6')](_0x1d56b4['query']);_0x1131e2[_0xd5bf('0xcd')]=_[_0xd5bf('0xc9')](_0x1131e2['model'],_0x1131e2[_0xd5bf('0x39')]);_0x4ac881[_0xd5bf('0x3f')]=_[_0xd5bf('0xc9')](_0x1131e2[_0xd5bf('0xc5')],qs[_0xd5bf('0xd5')](_0x1d56b4['query'][_0xd5bf('0xd5')]));_0x4ac881['attributes']=_0x4ac881[_0xd5bf('0x3f')][_0xd5bf('0x44')]?_0x4ac881['attributes']:_0x1131e2[_0xd5bf('0xc5')];_0x4ac881[_0xd5bf('0xca')]=qs['sort'](_0x1d56b4[_0xd5bf('0x39')]['sort']);_0x4ac881['where']=qs[_0xd5bf('0xcd')](_[_0xd5bf('0xce')](_0x1d56b4[_0xd5bf('0x39')],_0x1131e2[_0xd5bf('0xcd')]));if(_0x1d56b4[_0xd5bf('0x39')]['filter']){_0x4ac881[_0xd5bf('0xcc')]=_[_0xd5bf('0xcf')](_0x4ac881[_0xd5bf('0xcc')],{'$or':_[_0xd5bf('0x2f')](_0x4ac881[_0xd5bf('0x3f')],function(_0xc9125b){var _0x863b42={};_0x863b42[_0xc9125b]={'$like':'%'+_0x1d56b4[_0xd5bf('0x39')]['filter']+'%'};return _0x863b42;})});}_0x4ac881=_[_0xd5bf('0xcf')]({},_0x4ac881,_0x1d56b4['options']);return _0x1fb68a[_0xd5bf('0xe3')](_0x4ac881);}})['then'](function(_0x47de74){if(_0x47de74){_0x3efbce=_0x47de74[_0xd5bf('0x44')];if(!_0x1d56b4['query'][_0xd5bf('0xbc')](_0xd5bf('0xd1'))){_0x4ac881['limit']=qs['limit'](_0x1d56b4[_0xd5bf('0x39')]['limit']);_0x4ac881[_0xd5bf('0x15')]=qs[_0xd5bf('0x15')](_0x1d56b4['query'][_0xd5bf('0x15')]);}return _0x1fb68a[_0xd5bf('0xe3')](_0x4ac881);}})[_0xd5bf('0x1f')](function(_0x302e12){if(_0x302e12){return _0x302e12?{'count':_0x3efbce,'rows':_0x302e12}:null;}})[_0xd5bf('0x1f')](respondWithResult(_0x240bb8,null))[_0xd5bf('0x4b')](handleError(_0x240bb8,null));};exports[_0xd5bf('0xe5')]=function(_0x2d1a99,_0x18dd49,_0x12b856){var _0xc36324;var _0x24f7e0;var _0x174cce;var _0x530c0a=!_[_0xd5bf('0x59')](_0x2d1a99[_0xd5bf('0x4d')]['id'])?_0x2d1a99['params']['id']:!_[_0xd5bf('0x59')](_0x2d1a99[_0xd5bf('0x23')]['id'])?_0x2d1a99[_0xd5bf('0x23')]['id']:null;return db[_0xd5bf('0x2e')][_0xd5bf('0x2a')]({'where':{'id':_0x530c0a,'role':{'$or':[_0xd5bf('0x21'),_0xd5bf('0x23'),_0xd5bf('0x1c')]}},'attributes':['id',_0xd5bf('0x2b'),_0xd5bf('0xe6'),_0xd5bf('0xe7'),_0xd5bf('0x1b'),_0xd5bf('0x54'),_0xd5bf('0x91')]})[_0xd5bf('0x1f')](function(_0x4a7e7d){if(_0x4a7e7d){if(_0x4a7e7d[_0xd5bf('0x1b')]===_0xd5bf('0x1c')){_0xc36324=_0x4a7e7d;if(_0x2d1a99[_0xd5bf('0x4f')]['interface']){_0x174cce=util[_0xd5bf('0x9c')](_0xd5bf('0xe8'),_0xc36324[_0x2d1a99[_0xd5bf('0x4f')][_0xd5bf('0x93')]]);}else if(_0x2d1a99[_0xd5bf('0x4f')][_0xd5bf('0xe9')]){_0x174cce=util[_0xd5bf('0x9c')](_0xd5bf('0x9d'),_0x2d1a99['body'][_0xd5bf('0xe9')]);}else{_0x174cce=util[_0xd5bf('0x9c')](_0xd5bf('0x9d'),_0xc36324[_0xd5bf('0x2b')]);}socket['to'](util['format'](_0xd5bf('0xea'),_0xc36324['name']))['emit'](_0xd5bf('0xeb'),{'user':{'id':_0xc36324['id'],'name':_0xc36324['name']},'ip':_0x2d1a99[_0xd5bf('0xec')][_0xd5bf('0xed')]||_0x2d1a99[_0xd5bf('0xee')]['remoteAddress']||_0x2d1a99[_0xd5bf('0xef')]['remoteAddress']||_0x2d1a99[_0xd5bf('0xee')][_0xd5bf('0xef')]['remoteAddress']});return db[_0xd5bf('0xa4')][_0xd5bf('0x1e')]({'where':{'membername':_0xc36324[_0xd5bf('0x2b')]},'individualHooks':!![]});}}else{throw new db[(_0xd5bf('0x80'))]['ValidationError'](_0xd5bf('0xf0'));}})[_0xd5bf('0x1f')](function(){if(_0xc36324){return _0xc36324['getVoiceQueues']({'raw':!![]});}})[_0xd5bf('0x1f')](function(_0x4082a4){if(_0xc36324){if(_0x4082a4){_0x24f7e0=_0x4082a4;if(_0x24f7e0['length']){var _0xb8d0e1=_0x24f7e0[_0xd5bf('0x2f')](function(_0x4101d7){var _0x6d5bd7={'membername':_0xc36324[_0xd5bf('0x2b')],'UserId':_0xc36324['id'],'queue_name':_0x4101d7[_0xd5bf('0x2b')],'VoiceQueueId':_0x4101d7['id'],'interface':_0x174cce,'paused':_0xc36324[_0xd5bf('0x91')]||![],'penalty':_0x4101d7['UserVoiceQueue.penalty']||0x0};return db['UserVoiceQueueRt'][_0xd5bf('0x9f')](_0x6d5bd7);});return Promise[_0xd5bf('0x4a')](_0xb8d0e1);}}}})[_0xd5bf('0x1f')](function(){if(_0xc36324){return db[_0xd5bf('0xf1')][_0xd5bf('0x41')]({'where':{'membername':_0xc36324[_0xd5bf('0x2b')],'exitAt':null}});}})[_0xd5bf('0x1f')](function(_0x4650da){if(_0xc36324){var _0x23f948=[];_0x4650da[_0xd5bf('0xf2')](function(_0xbd2ec3){_0x23f948['push'](_0xbd2ec3[_0xd5bf('0x1a')]({'exitAt':moment()[_0xd5bf('0x9c')](_0xd5bf('0xf3'))}));});return Promise[_0xd5bf('0x4a')](_0x23f948);}})[_0xd5bf('0x1f')](function(){if(_0xc36324){var _0x472aa7=[];var _0xb09f19=[];var _0x49b264=utils[_0xd5bf('0xf4')]();var _0x5b0aae={'membername':_0xc36324[_0xd5bf('0x2b')],'interface':_0x174cce,'enterAt':moment()[_0xd5bf('0x9c')](_0xd5bf('0xf3')),'role':_0xc36324['role'],'internal':_0xc36324[_0xd5bf('0x54')]};_0x49b264[_0xd5bf('0xf2')](function(_0x23842a){_0x472aa7['push'](_[_0xd5bf('0xcf')]({'channel':_0x23842a,'type':'LOGIN','data1':_0x2d1a99[_0xd5bf('0x4f')][_0xd5bf('0xf5')],'data2':_0x174cce},_0x5b0aae));if(_0xc36324[_0xd5bf('0x91')]){_0xb09f19[_0xd5bf('0x40')](_['merge']({'channel':_0x23842a,'type':_0xd5bf('0xf6'),'data1':_0xd5bf('0xf7')},_0x5b0aae));}});return db[_0xd5bf('0xf1')][_0xd5bf('0xf8')](_0x472aa7['concat'](_0xb09f19),{'individualHooks':!![]});}})['then'](function(){if(_0xc36324){return _0xc36324[_0xd5bf('0x1a')]({'online':!![],'lastLoginAt':moment()['format'](_0xd5bf('0xf3')),'voicePause':_0xc36324[_0xd5bf('0x91')]||![],'mailPause':_0xc36324[_0xd5bf('0x91')]||![],'chatPause':_0xc36324[_0xd5bf('0x91')]||![],'faxPause':_0xc36324['loginInPause']||![],'smsPause':_0xc36324[_0xd5bf('0x91')]||![],'openchannelPause':_0xc36324[_0xd5bf('0x91')]||![],'whatsappPause':_0xc36324['loginInPause']||![],'pauseType':_0xc36324[_0xd5bf('0x91')]?_0xd5bf('0xf7'):null,'interface':_0x174cce,'lastPauseAt':moment()[_0xd5bf('0x9c')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xd5bf('0x1f')](function(_0x5927a8){if(_0x2d1a99[_0xd5bf('0xf9')]){return _0x12b856();}else{return Promise[_0xd5bf('0xfa')](_0x5927a8)[_0xd5bf('0x1f')](respondWithResult(_0x18dd49,null));}})[_0xd5bf('0x4b')](handleError(_0x18dd49,null));};exports[_0xd5bf('0xfb')]=function(_0x55b9c3,_0x148dd5){var _0x1a04d7;return db[_0xd5bf('0x2e')]['find']({'where':{'id':_0x55b9c3['params']['id'],'role':_0xd5bf('0x1c')},'attributes':['id',_0xd5bf('0x2b'),_0xd5bf('0x1b')]})[_0xd5bf('0x1f')](handleEntityNotFound(_0x148dd5,null))['then'](function(_0x59e543){if(_0x59e543){_0x1a04d7=_0x59e543;return db[_0xd5bf('0xa4')][_0xd5bf('0x1e')]({'where':{'membername':_0x1a04d7[_0xd5bf('0x2b')]},'individualHooks':!![]});}})[_0xd5bf('0x1f')](function(){return db[_0xd5bf('0xf1')][_0xd5bf('0x41')]({'where':{'membername':_0x1a04d7[_0xd5bf('0x2b')],'exitAt':null}});})[_0xd5bf('0x1f')](function(_0x2ce2f0){var _0xc1145f=[];_0x2ce2f0[_0xd5bf('0xf2')](function(_0x379531){_0xc1145f[_0xd5bf('0x40')](_0x379531[_0xd5bf('0x1a')]({'exitAt':moment()[_0xd5bf('0x9c')](_0xd5bf('0xf3'))}));});return Promise['all'](_0xc1145f);})[_0xd5bf('0x1f')](function(){return _0x1a04d7[_0xd5bf('0x1a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xd5bf('0x1f')](respondWithResult(_0x148dd5,null))[_0xd5bf('0x4b')](handleError(_0x148dd5,null));};exports[_0xd5bf('0xfc')]=function(_0x526415,_0x121864){var _0x1422fb;return db[_0xd5bf('0xa4')]['update']({'paused':0x1},{'where':{'UserId':_0x526415['params']['id']},'individualHooks':!![]})['then'](function(){return db[_0xd5bf('0x2e')][_0xd5bf('0x2a')]({'where':{'id':_0x526415[_0xd5bf('0x4d')]['id'],'role':'agent'},'attributes':['id',_0xd5bf('0x2b'),'role','internal',_0xd5bf('0x93'),_0xd5bf('0x90')]});})[_0xd5bf('0x1f')](handleEntityNotFound(_0x121864,null))[_0xd5bf('0x1f')](function(_0x6bc705){if(_0x6bc705){_0x1422fb=_0x6bc705;return db[_0xd5bf('0xf1')][_0xd5bf('0x41')]({'where':{'membername':_0x1422fb[_0xd5bf('0x2b')],'type':_0xd5bf('0xf6'),'exitAt':null}});}})['then'](function(_0x5ed87f){if(_0x5ed87f[_0xd5bf('0x44')]){var _0x2c3177=moment()[_0xd5bf('0x9c')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x10b06b=0x0,_0x393f56=_0x5ed87f[_0xd5bf('0x44')];_0x10b06b<_0x393f56;_0x10b06b++){_0x5ed87f[_0x10b06b][_0xd5bf('0xfd')]({'exitAt':_0x2c3177});}}})[_0xd5bf('0x1f')](function(){var _0x336dc7=[];var _0x48a013=utils['getChannels']();_0x48a013[_0xd5bf('0xf2')](function(_0x1fee00){_0x336dc7[_0xd5bf('0x40')]({'channel':_0x1fee00,'membername':_0x1422fb[_0xd5bf('0x2b')],'interface':_[_0xd5bf('0x59')](_0x1422fb[_0xd5bf('0x93')])?util[_0xd5bf('0x9c')](_0xd5bf('0x9d'),_0x1422fb['name']):_0x1422fb[_0xd5bf('0x93')],'type':'PAUSE','enterAt':moment()['format'](_0xd5bf('0xf3')),'data1':_0x526415[_0xd5bf('0x4f')]['type']||_0xd5bf('0xfe'),'role':_0x1422fb['role'],'internal':_0x1422fb[_0xd5bf('0x54')]});});return db[_0xd5bf('0xf1')][_0xd5bf('0xf8')](_0x336dc7,{'individualHooks':!![]});})[_0xd5bf('0x1f')](function(){return _0x1422fb[_0xd5bf('0x1a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x526415[_0xd5bf('0x4f')][_0xd5bf('0x31')]||_0xd5bf('0xfe'),'lastPauseAt':moment()[_0xd5bf('0x9c')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x121864,null))[_0xd5bf('0x4b')](handleError(_0x121864,null));};exports[_0xd5bf('0xff')]=function(_0xbb5b8d,_0x1d0fe2){if(_0xbb5b8d[_0xd5bf('0x4f')][_0xd5bf('0x8f')]&&!utils['isValidChannel'](_0xbb5b8d[_0xd5bf('0x4f')][_0xd5bf('0x8f')])){throw new APIBadRequestError(util[_0xd5bf('0x9c')](_0xd5bf('0x100'),_0xbb5b8d['body'][_0xd5bf('0x8f')]));}return db[_0xd5bf('0x2e')][_0xd5bf('0x2a')]({'where':{'id':_0xbb5b8d[_0xd5bf('0x4d')]['id']},'attributes':['id','name','role',_0xd5bf('0x54'),_0xd5bf('0x93'),_0xd5bf('0x90'),_0xd5bf('0x92'),'mailPause',_0xd5bf('0x101'),_0xd5bf('0x102'),'openchannelPause',_0xd5bf('0x103'),_0xd5bf('0x104'),_0xd5bf('0x105'),_0xd5bf('0x106')]})['then'](function(_0x2321c1){if(!_0x2321c1){throw new APINotFoundError(util['format'](_0xd5bf('0xbb'),_0xbb5b8d['params']['id']));}return _0x2321c1[_0xd5bf('0xff')](_0xbb5b8d['body'][_0xd5bf('0x8f')]);})[_0xd5bf('0x1f')](respondWithResult(_0x1d0fe2,null))[_0xd5bf('0x4b')](APIHandleError(_0x1d0fe2));};exports['getTeams']=function(_0xc15887,_0xb9bc61){var _0xcb834b={};var _0x241b43={};var _0x3d21c4;var _0x989ddf;return db[_0xd5bf('0x2e')]['findOne']({'where':{'id':_0xc15887[_0xd5bf('0x4d')]['id']}})[_0xd5bf('0x1f')](handleEntityNotFound(_0xb9bc61,null))['then'](function(_0x5f50cf){if(_0x5f50cf){_0x3d21c4=_0x5f50cf;_0x241b43[_0xd5bf('0xc5')]=_[_0xd5bf('0xc6')](db[_0xd5bf('0x107')][_0xd5bf('0xc8')]);_0x241b43[_0xd5bf('0x39')]=_[_0xd5bf('0xc6')](_0xc15887['query']);_0x241b43['filters']=_[_0xd5bf('0xc9')](_0x241b43[_0xd5bf('0xc5')],_0x241b43[_0xd5bf('0x39')]);_0xcb834b['attributes']=_['intersection'](_0x241b43[_0xd5bf('0xc5')],qs[_0xd5bf('0xd5')](_0xc15887[_0xd5bf('0x39')][_0xd5bf('0xd5')]));_0xcb834b[_0xd5bf('0x3f')]=_0xcb834b['attributes'][_0xd5bf('0x44')]?_0xcb834b['attributes']:_0x241b43[_0xd5bf('0xc5')];_0xcb834b[_0xd5bf('0xca')]=qs[_0xd5bf('0xcb')](_0xc15887['query'][_0xd5bf('0xcb')]);_0xcb834b[_0xd5bf('0xcc')]=qs[_0xd5bf('0xcd')](_[_0xd5bf('0xce')](_0xc15887[_0xd5bf('0x39')],_0x241b43[_0xd5bf('0xcd')]));if(_0xc15887[_0xd5bf('0x39')][_0xd5bf('0x33')]){_0xcb834b[_0xd5bf('0xcc')]=_[_0xd5bf('0xcf')](_0xcb834b[_0xd5bf('0xcc')],{'$or':_['map'](_0xcb834b[_0xd5bf('0x3f')],function(_0x2ccd11){var _0x49bd3f={};_0x49bd3f[_0x2ccd11]={'$like':'%'+_0xc15887[_0xd5bf('0x39')][_0xd5bf('0x33')]+'%'};return _0x49bd3f;})});}_0xcb834b=_['merge']({},_0xcb834b,_0xc15887[_0xd5bf('0x4e')]);return _0x3d21c4[_0xd5bf('0x108')](_0xcb834b);}})[_0xd5bf('0x1f')](function(_0x39afa1){if(_0x39afa1){_0x989ddf=_0x39afa1[_0xd5bf('0x44')];if(!_0xc15887[_0xd5bf('0x39')][_0xd5bf('0xbc')](_0xd5bf('0xd1'))){_0xcb834b[_0xd5bf('0x17')]=qs[_0xd5bf('0x17')](_0xc15887['query']['limit']);_0xcb834b['offset']=qs[_0xd5bf('0x15')](_0xc15887['query'][_0xd5bf('0x15')]);}return _0x3d21c4[_0xd5bf('0x108')](_0xcb834b);}})[_0xd5bf('0x1f')](function(_0x4bd39e){if(_0x4bd39e){return _0x4bd39e?{'count':_0x989ddf,'rows':_0x4bd39e}:null;}})['then'](respondWithResult(_0xb9bc61,null))['catch'](handleError(_0xb9bc61,null));};exports[_0xd5bf('0x109')]=function(_0x4f20dd,_0x28a61a){var _0x56a958=_0x4f20dd[_0xd5bf('0x4d')]['id'];var _0xbc255d=_0x4f20dd['body']?_0x4f20dd[_0xd5bf('0x4f')][_0xd5bf('0x52')]:null;var _0x56fa89=[];return Promise[_0xd5bf('0xfa')]()[_0xd5bf('0x1f')](function(){if(!_0xbc255d)throw new APIBadRequestError(_0xd5bf('0x10a'));})[_0xd5bf('0x1f')](function(){return db[_0xd5bf('0x2e')][_0xd5bf('0x88')]({'where':{'id':_0x56a958}});})[_0xd5bf('0x1f')](function(_0x1e97c0){if(!_0x1e97c0)throw new APINotFoundError(util[_0xd5bf('0x9c')]('User\x20with\x20id\x20%s\x20not\x20found',_0x4f20dd[_0xd5bf('0x4d')]['id']));return db[_0xd5bf('0x5b')][_0xd5bf('0x10b')](function(_0x15f57e){return _0x1e97c0[_0xd5bf('0x109')](_0xbc255d,{'transaction':_0x15f57e})[_0xd5bf('0x1f')](function(){return db[_0xd5bf('0x107')][_0xd5bf('0x41')]({'where':{'id':{'$in':_0xbc255d}}});})[_0xd5bf('0x1f')](function(_0x266b93){var _0x1760e4=_['map'](_0x266b93,function(_0x236d43){return _0x236d43[_0xd5bf('0x10c')]();});return Promise[_0xd5bf('0x4a')](_0x1760e4);})['then'](function(_0x24d6b3){_0x56fa89=_['flattenDeep'](_0x24d6b3);var _0x2e3aca=_[_0xd5bf('0x2f')](_0x56fa89,function(_0x3ebb3e){return _0x3ebb3e[_0xd5bf('0x10d')](_0x1e97c0['id'],{'transaction':_0x15f57e});});return Promise['all'](_0x2e3aca);})[_0xd5bf('0x1f')](function(){if(!_0x1e97c0['online'])return;var _0x2c09f0=_[_0xd5bf('0x33')](_0x56fa89,function(_0x4d48ce){return _0x4d48ce['getDataValue'](_0xd5bf('0x8f'))===_0xd5bf('0x10e');});var _0x4d8fee=_[_0xd5bf('0x2f')](_0x2c09f0,function(_0x4e11c6){return db[_0xd5bf('0xa4')][_0xd5bf('0x9f')]({'membername':_0x1e97c0['name'],'UserId':_0x1e97c0['id'],'queue_name':_0x4e11c6['name'],'VoiceQueueId':_0x4e11c6['id'],'interface':_['isNil'](_0x1e97c0[_0xd5bf('0x93')])?util['format'](_0xd5bf('0x9d'),_0x1e97c0[_0xd5bf('0x2b')]):_0x1e97c0[_0xd5bf('0x93')],'paused':_0x1e97c0[_0xd5bf('0x92')]||![],'penalty':_0x1e97c0[_0xd5bf('0x9e')]},{'transaction':_0x15f57e});});return Promise[_0xd5bf('0x4a')](_0x4d8fee);})[_0xd5bf('0x1f')](function(){return db[_0xd5bf('0x10f')][_0xd5bf('0x41')]({'where':{'teamId':{'$in':_0xbc255d}}});})[_0xd5bf('0x1f')](function(_0x3ab4e3){var _0x430840=_[_0xd5bf('0x2f')](_0x3ab4e3,function(_0x44b3ee){return db[_0xd5bf('0x110')][_0xd5bf('0x70')]({'UserId':_0x1e97c0['id'],'VoicePrefixId':_0x44b3ee[_0xd5bf('0x111')]},{'transaction':_0x15f57e});});return Promise[_0xd5bf('0x4a')](_0x430840);});});})['then'](function(){for(var _0x1f651f=0x0;_0x1f651f<_0x56fa89[_0xd5bf('0x44')];_0x1f651f++){var _0x2eff6c=_0x56fa89[_0x1f651f][_0xd5bf('0x112')](_0xd5bf('0x8f'));var _0x184a89=_0x2eff6c+_0xd5bf('0x99');socket[_0xd5bf('0x1d')]('user'+_0x2eff6c+_0xd5bf('0x113'),{'UserId':_0x56a958,['queueField']:_0x56fa89[_0x1f651f]['id']});}})['then'](respondWithStatusCode(_0x28a61a,null))[_0xd5bf('0x4b')](APIHandleError(_0x28a61a));};exports[_0xd5bf('0x114')]=function(_0x403719,_0x5745e7){var _0x35eef4=_0x403719['params']['id'];var _0x5bc847=null;if(_0x403719[_0xd5bf('0x39')][_0xd5bf('0x52')]){_0x5bc847=_[_0xd5bf('0xa2')](_0x403719[_0xd5bf('0x39')]['ids'])?_0x403719['query'][_0xd5bf('0x52')]:[_0x403719[_0xd5bf('0x39')][_0xd5bf('0x52')]];}var _0x31154d=[];return Promise['resolve']()['then'](function(){if(!_0x5bc847)throw new APIBadRequestError(_0xd5bf('0x115'));})[_0xd5bf('0x1f')](function(){return db[_0xd5bf('0x2e')][_0xd5bf('0x88')]({'where':{'id':_0x35eef4}});})['then'](function(_0x620ded){if(!_0x620ded)throw new APINotFoundError(util[_0xd5bf('0x9c')](_0xd5bf('0xbb'),_0x403719['params']['id']));return db[_0xd5bf('0x5b')][_0xd5bf('0x10b')](function(_0x2ab1bc){return _0x620ded['removeTeams'](_0x5bc847,{'transaction':_0x2ab1bc})['then'](function(){return db[_0xd5bf('0x107')][_0xd5bf('0x41')]({'where':{'id':{'$in':_0x5bc847}}});})['then'](function(_0x484872){var _0x3f7566=_[_0xd5bf('0x2f')](_0x484872,function(_0x1f0f11){return _0x1f0f11[_0xd5bf('0x10c')]();});return Promise[_0xd5bf('0x4a')](_0x3f7566);})['then'](function(_0x57646a){_0x31154d=_[_0xd5bf('0x116')](_0x57646a);var _0xab1f1c=_[_0xd5bf('0x2f')](_0x31154d,function(_0x1ce6d5){return _0x1ce6d5['removeAgent'](_0x620ded['id'],{'transaction':_0x2ab1bc});});return Promise['all'](_0xab1f1c);})[_0xd5bf('0x1f')](function(){if(!_0x620ded[_0xd5bf('0x90')])return;var _0x2be202=_['filter'](_0x31154d,function(_0x2ce840){return _0x2ce840['getDataValue'](_0xd5bf('0x8f'))==='Voice';});var _0x378844=_[_0xd5bf('0x2f')](_0x2be202,function(_0x49c06c){return db[_0xd5bf('0xa4')][_0xd5bf('0x1e')]({'where':{'VoiceQueueId':_0x49c06c['id'],'UserId':_0x620ded['id']},'transaction':_0x2ab1bc});});return Promise[_0xd5bf('0x4a')](_0x378844);})[_0xd5bf('0x1f')](function(){return db[_0xd5bf('0x10f')][_0xd5bf('0x41')]({'where':{'teamId':{'$in':_0x5bc847}}});})[_0xd5bf('0x1f')](function(_0x527fde){var _0x1c7178=_[_0xd5bf('0x2f')](_0x527fde,function(_0x1a85b6){return db[_0xd5bf('0x110')][_0xd5bf('0x1e')]({'where':{'UserId':_0x620ded['id'],'VoicePrefixId':_0x1a85b6[_0xd5bf('0x111')]}},{'transaction':_0x2ab1bc});});return Promise['all'](_0x1c7178);});});})[_0xd5bf('0x1f')](function(){for(var _0x4432be=0x0;_0x4432be<_0x31154d[_0xd5bf('0x44')];_0x4432be++){var _0x2cf833=_0x31154d[_0x4432be][_0xd5bf('0x112')](_0xd5bf('0x8f'));var _0x2652b2=_0x2cf833+_0xd5bf('0x99');socket[_0xd5bf('0x1d')](_0xd5bf('0x23')+_0x2cf833+_0xd5bf('0xa3'),{'UserId':_0x35eef4,['queueField']:_0x31154d[_0x4432be]['id']});}})['then'](respondWithStatusCode(_0x5745e7,null))[_0xd5bf('0x4b')](APIHandleError(_0x5745e7));};exports[_0xd5bf('0x117')]=function(_0x30e977,_0x42f5a7){var _0xbd1703={};var _0x4982bf={};var _0x25c50b;var _0x577950;return db[_0xd5bf('0x2e')][_0xd5bf('0x88')]({'where':{'id':_0x30e977[_0xd5bf('0x4d')]['id']}})[_0xd5bf('0x1f')](handleEntityNotFound(_0x42f5a7,null))[_0xd5bf('0x1f')](function(_0x837532){if(_0x837532){_0x25c50b=_0x837532;_0x4982bf[_0xd5bf('0xc5')]=_[_0xd5bf('0xc6')](db[_0xd5bf('0xbd')]['rawAttributes']);_0x4982bf[_0xd5bf('0x39')]=_[_0xd5bf('0xc6')](_0x30e977[_0xd5bf('0x39')]);_0x4982bf[_0xd5bf('0xcd')]=_['intersection'](_0x4982bf[_0xd5bf('0xc5')],_0x4982bf[_0xd5bf('0x39')]);_0xbd1703['attributes']=_[_0xd5bf('0xc9')](_0x4982bf[_0xd5bf('0xc5')],qs[_0xd5bf('0xd5')](_0x30e977[_0xd5bf('0x39')][_0xd5bf('0xd5')]));_0xbd1703['attributes']=_0xbd1703['attributes'][_0xd5bf('0x44')]?_0xbd1703[_0xd5bf('0x3f')]:_0x4982bf[_0xd5bf('0xc5')];_0xbd1703[_0xd5bf('0xca')]=qs[_0xd5bf('0xcb')](_0x30e977[_0xd5bf('0x39')][_0xd5bf('0xcb')]);_0xbd1703['where']=qs['filters'](_[_0xd5bf('0xce')](_0x30e977['query'],_0x4982bf[_0xd5bf('0xcd')]));if(_0x30e977['query'][_0xd5bf('0x33')]){_0xbd1703[_0xd5bf('0xcc')]=_[_0xd5bf('0xcf')](_0xbd1703[_0xd5bf('0xcc')],{'$or':_[_0xd5bf('0x2f')](_0xbd1703['attributes'],function(_0x371e7e){var _0x21af48={};_0x21af48[_0x371e7e]={'$like':'%'+_0x30e977[_0xd5bf('0x39')][_0xd5bf('0x33')]+'%'};return _0x21af48;})});}_0xbd1703=_[_0xd5bf('0xcf')]({},_0xbd1703,_0x30e977[_0xd5bf('0x4e')]);return _0x25c50b['getLists'](_0xbd1703);}})[_0xd5bf('0x1f')](function(_0xddc260){if(_0xddc260){_0x577950=_0xddc260['length'];if(!_0x30e977[_0xd5bf('0x39')][_0xd5bf('0xbc')]('nolimit')){_0xbd1703[_0xd5bf('0x17')]=qs[_0xd5bf('0x17')](_0x30e977['query'][_0xd5bf('0x17')]);_0xbd1703['offset']=qs[_0xd5bf('0x15')](_0x30e977[_0xd5bf('0x39')]['offset']);}return _0x25c50b[_0xd5bf('0x117')](_0xbd1703);}})[_0xd5bf('0x1f')](function(_0x4d3ceb){if(_0x4d3ceb){return _0x4d3ceb?{'count':_0x577950,'rows':_0x4d3ceb}:null;}})[_0xd5bf('0x1f')](respondWithResult(_0x42f5a7,null))[_0xd5bf('0x4b')](handleError(_0x42f5a7,null));};exports[_0xd5bf('0x118')]=function(_0x520e98,_0x33f40c){var _0x4d5e02={};var _0x293208={};var _0x1a8c8f;return db['User']['findOne']({'where':{'id':_0x520e98[_0xd5bf('0x4d')]['id']}})[_0xd5bf('0x1f')](handleEntityNotFound(_0x33f40c,null))[_0xd5bf('0x1f')](function(_0x2b017b){if(_0x2b017b){_0x1a8c8f=_0x2b017b;_0x293208[_0xd5bf('0xc5')]=_[_0xd5bf('0xc6')](db[_0xd5bf('0x2e')][_0xd5bf('0xc8')]);_0x293208[_0xd5bf('0x39')]=_[_0xd5bf('0xc6')](_0x520e98[_0xd5bf('0x39')]);_0x293208[_0xd5bf('0xcd')]=_['intersection'](_0x293208['model'],_0x293208[_0xd5bf('0x39')]);_0x4d5e02['attributes']=_['intersection'](_0x293208['model'],qs[_0xd5bf('0xd5')](_0x520e98[_0xd5bf('0x39')][_0xd5bf('0xd5')]));_0x4d5e02[_0xd5bf('0x3f')]=_0x4d5e02[_0xd5bf('0x3f')][_0xd5bf('0x44')]?_0x4d5e02[_0xd5bf('0x3f')]:_0x293208[_0xd5bf('0xc5')];_0x4d5e02[_0xd5bf('0xca')]=qs['sort'](_0x520e98[_0xd5bf('0x39')][_0xd5bf('0xcb')]);_0x4d5e02[_0xd5bf('0xcc')]=qs[_0xd5bf('0xcd')](_[_0xd5bf('0xce')](_0x520e98['query'],_0x293208[_0xd5bf('0xcd')]));if(_0x520e98[_0xd5bf('0x39')][_0xd5bf('0x33')]){_0x4d5e02[_0xd5bf('0xcc')]=_[_0xd5bf('0xcf')](_0x4d5e02[_0xd5bf('0xcc')],{'$or':_[_0xd5bf('0x2f')](_0x4d5e02[_0xd5bf('0x3f')],function(_0x1e5c02){var _0x1f2938={};_0x1f2938[_0x1e5c02]={'$like':'%'+_0x520e98[_0xd5bf('0x39')][_0xd5bf('0x33')]+'%'};return _0x1f2938;})});}_0x4d5e02[_0xd5bf('0xc5')]=db[_0xd5bf('0x2e')];_0x4d5e02['as']=_0xd5bf('0x24');_0x4d5e02=_[_0xd5bf('0xcf')]({},_0x4d5e02,_0x520e98[_0xd5bf('0x4e')]);return _0x1a8c8f[_0xd5bf('0x119')]({'include':[_0x4d5e02]});}})['then'](function(_0x4afab5){if(_0x4afab5){var _0x2f9c87={},_0x16bdd0=[];for(var _0x72ef50=0x0;_0x72ef50<_0x4afab5[_0xd5bf('0x44')];_0x72ef50+=0x1){for(var _0x520e2a=0x0,_0x36ef91;_0x520e2a<_0x4afab5[_0x72ef50][_0xd5bf('0x24')]['length'];_0x520e2a+=0x1){_0x36ef91=_0x4afab5[_0x72ef50][_0xd5bf('0x24')][_0x520e2a][_0xd5bf('0x20')]({'plain':!![]});_0x2f9c87[_0x36ef91['id']]=_0x36ef91;}}_0x2f9c87=_[_0xd5bf('0x11a')](_0x2f9c87);for(var _0x178d63=qs[_0xd5bf('0x15')](_0x520e98[_0xd5bf('0x39')][_0xd5bf('0x15')]);_0x178d63<_0x2f9c87[_0xd5bf('0x44')]&&_0x16bdd0[_0xd5bf('0x44')]=_0x39d145[_0x0c03('0x4a')]){throw new Error(_0x0c03('0x4b'));}})['then'](function(){if(_0x3366a6){return db[_0x0c03('0x27')][_0x0c03('0x4c')]({'where':{'membername':_0x3366a6[_0x0c03('0x21')]},'individualHooks':!![]});}})['then'](function(){if(_0x3366a6){return _0x3366a6[_0x0c03('0x4d')]({'raw':!![]});}})[_0x0c03('0x18')](function(_0x2e2313){if(_0x3366a6){if(_0x2e2313){var _0x9acb6a=[];_0x11c0c3=_0x2e2313;if(_0x11c0c3['length']){for(var _0x37cdb0=0x0;_0x37cdb0<_0x11c0c3[_0x0c03('0x2a')];_0x37cdb0++){_0x9acb6a[_0x0c03('0x2d')](db[_0x0c03('0x27')][_0x0c03('0x4e')]({'membername':_0x3366a6[_0x0c03('0x21')],'UserId':_0x3366a6['id'],'queue_name':_0x11c0c3[_0x37cdb0][_0x0c03('0x21')],'VoiceQueueId':_0x11c0c3[_0x37cdb0]['id'],'interface':_0x19a250,'paused':_0x3366a6[_0x0c03('0x45')]||![],'penalty':_0x11c0c3[_0x37cdb0][_0x0c03('0x4f')]||0x0}));}return BPromise[_0x0c03('0x50')](_0x9acb6a);}}}})[_0x0c03('0x18')](function(){if(_0x3366a6){return db[_0x0c03('0x33')]['findAll']({'where':{'membername':_0x3366a6[_0x0c03('0x21')],'exitAt':null}});}})[_0x0c03('0x18')](function(_0xbff9d2){if(_0x3366a6){if(_0xbff9d2&&_0xbff9d2[_0x0c03('0x2a')]){var _0x4e0dd9=[];_0xbff9d2[_0x0c03('0x51')](function(_0x221ab4){_0x4e0dd9[_0x0c03('0x2d')](_0x221ab4[_0x0c03('0x28')]({'exitAt':moment()[_0x0c03('0x24')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x0c03('0x50')](_0x4e0dd9);}}})[_0x0c03('0x18')](function(){if(_0x3366a6){var _0x2af560=[];var _0x2a729c=[];var _0x13f4aa=utils[_0x0c03('0x2c')]();var _0x19761a={'membername':_0x3366a6[_0x0c03('0x21')],'interface':_0x19a250,'enterAt':moment()[_0x0c03('0x24')](_0x0c03('0x2b')),'role':_0x3366a6[_0x0c03('0x31')],'internal':_0x3366a6[_0x0c03('0x22')]};_0x13f4aa['forEach'](function(_0x5c4d13){_0x2af560[_0x0c03('0x2d')](_['merge']({'channel':_0x5c4d13,'type':_0x0c03('0x52'),'data1':_0x0c03('0x53'),'data2':_0x19a250},_0x19761a));if(_0x3366a6[_0x0c03('0x45')]){_0x2a729c[_0x0c03('0x2d')](_[_0x0c03('0x54')]({'channel':_0x5c4d13,'type':_0x0c03('0x29'),'data1':_0x0c03('0x55')},_0x19761a));}});return db[_0x0c03('0x33')][_0x0c03('0x34')](_0x2af560[_0x0c03('0x56')](_0x2a729c),{'individualHooks':!![]});}})[_0x0c03('0x18')](function(){if(_0x3366a6){return _0x3366a6['update']({'online':!![],'lastLoginAt':moment()[_0x0c03('0x24')](_0x0c03('0x2b')),'voicePause':_0x3366a6[_0x0c03('0x45')]||![],'mailPause':_0x3366a6[_0x0c03('0x45')]||![],'chatPause':_0x3366a6[_0x0c03('0x45')]||![],'faxPause':_0x3366a6[_0x0c03('0x45')]||![],'smsPause':_0x3366a6[_0x0c03('0x45')]||![],'openchannelPause':_0x3366a6['loginInPause']||![],'pauseType':_0x3366a6[_0x0c03('0x45')]?_0x0c03('0x55'):null,'lastPauseAt':moment()[_0x0c03('0x24')](_0x0c03('0x2b')),'interface':_0x19a250});}})[_0x0c03('0x18')](function(_0x28fe56){_0x4c7903(_0x28fe56);})['catch'](function(_0x4b4214){_0x5e09e3(_0xedf41b[_0x0c03('0x1d')](0x1f4,_0x4b4214[_0x0c03('0x1e')]));});});}; \ No newline at end of file +var _0xe86a=['params','UserVoiceQueueRt','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','push','isNil','format','SIP/%s','body','type','role','bulkCreate','resolve','channel','isValidChannel','findOne','online','voicePause','mailPause','faxPause','openchannelPause','whatsappPause','lastPauseAt','unpause','system','LogoutUser','destroy','all','LoginUser','phone','loginInPause','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','forEach','merge','callysquare','LOGININPAUSE','concat','ioredis','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','GetUser','User','findAll','options','raw','attributes','include','map','model','then','stringify','catch','error','message','find','where','info','ShowUser','debug','PauseUser','name','internal','interface','User\x20with\x20id\x20%s\x20not\x20found'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xe86a,0x1c6));var _0xae86=function(_0xcaab47,_0xfc5b48){_0xcaab47=_0xcaab47-0x0;var _0x4a36bf=_0xe86a[_0xcaab47];return _0x4a36bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var Redis=require(_0xae86('0x0'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xae86('0x1'));var config=require(_0xae86('0x2'));config[_0xae86('0x3')]=_[_0xae86('0x4')](config[_0xae86('0x3')],{'host':_0xae86('0x5'),'port':0x18eb});var socket=require(_0xae86('0x6'))(new Redis(config[_0xae86('0x3')]));require('./user.socket')[_0xae86('0x7')](socket);exports[_0xae86('0x8')]=function(_0x312498){var _0x426c9e=this;return new Promise(function(_0x190d0e,_0x2bec5c){return db[_0xae86('0x9')][_0xae86('0xa')]({'raw':_0x312498[_0xae86('0xb')]?_0x312498[_0xae86('0xb')][_0xae86('0xc')]===undefined?!![]:![]:!![],'where':_0x312498[_0xae86('0xb')]?_0x312498[_0xae86('0xb')]['where']||null:null,'attributes':_0x312498['options']?_0x312498['options'][_0xae86('0xd')]||null:null,'limit':_0x312498[_0xae86('0xb')]?_0x312498[_0xae86('0xb')]['limit']||null:null,'include':_0x312498[_0xae86('0xb')]?_0x312498[_0xae86('0xb')]['include']?_['map'](_0x312498[_0xae86('0xb')]['include'],function(_0x2f8b98){return{'model':db[_0x2f8b98['model']],'as':_0x2f8b98['as'],'attributes':_0x2f8b98[_0xae86('0xd')],'include':_0x2f8b98[_0xae86('0xe')]?_[_0xae86('0xf')](_0x2f8b98['include'],function(_0x48007a){return{'model':db[_0x48007a[_0xae86('0x10')]],'as':_0x48007a['as'],'attributes':_0x48007a['attributes'],'include':_0x48007a[_0xae86('0xe')]?_['map'](_0x48007a[_0xae86('0xe')],function(_0x11e96a){return{'model':db[_0x11e96a[_0xae86('0x10')]],'as':_0x11e96a['as'],'attributes':_0x11e96a[_0xae86('0xd')]};}):[]};}):[]};}):[]:[]})[_0xae86('0x11')](function(_0x32287d){logger['info'](_0xae86('0x8'),_0x312498);logger['debug'](_0xae86('0x8'),_0x312498,JSON[_0xae86('0x12')](_0x32287d));_0x190d0e(_0x32287d);})[_0xae86('0x13')](function(_0x5ea2a0){logger[_0xae86('0x14')](_0xae86('0x8'),_0x5ea2a0[_0xae86('0x15')],_0x312498);_0x2bec5c(_0x426c9e['error'](0x1f4,_0x5ea2a0['message']));});});};exports['ShowUser']=function(_0x21eb27){var _0x24e65d=this;return new Promise(function(_0x54d66d,_0x2a740b){return db[_0xae86('0x9')][_0xae86('0x16')]({'raw':_0x21eb27[_0xae86('0xb')]?_0x21eb27[_0xae86('0xb')][_0xae86('0xc')]===undefined?!![]:![]:!![],'where':_0x21eb27[_0xae86('0xb')]?_0x21eb27[_0xae86('0xb')][_0xae86('0x17')]||null:null,'attributes':_0x21eb27[_0xae86('0xb')]?_0x21eb27[_0xae86('0xb')][_0xae86('0xd')]||null:null,'include':_0x21eb27['options']?_0x21eb27[_0xae86('0xb')][_0xae86('0xe')]?_[_0xae86('0xf')](_0x21eb27['options'][_0xae86('0xe')],function(_0x51b890){return{'model':db[_0x51b890[_0xae86('0x10')]],'as':_0x51b890['as'],'attributes':_0x51b890['attributes'],'include':_0x51b890[_0xae86('0xe')]?_[_0xae86('0xf')](_0x51b890['include'],function(_0x22b10e){return{'model':db[_0x22b10e[_0xae86('0x10')]],'as':_0x22b10e['as'],'attributes':_0x22b10e[_0xae86('0xd')],'include':_0x22b10e[_0xae86('0xe')]?_[_0xae86('0xf')](_0x22b10e['include'],function(_0x9efdd1){return{'model':db[_0x9efdd1[_0xae86('0x10')]],'as':_0x9efdd1['as'],'attributes':_0x9efdd1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e7a6c){logger[_0xae86('0x18')](_0xae86('0x19'),_0x21eb27);logger[_0xae86('0x1a')](_0xae86('0x19'),_0x21eb27,JSON['stringify'](_0x4e7a6c));_0x54d66d(_0x4e7a6c);})[_0xae86('0x13')](function(_0x239910){logger[_0xae86('0x14')](_0xae86('0x19'),_0x239910[_0xae86('0x15')],_0x21eb27);_0x2a740b(_0x24e65d[_0xae86('0x14')](0x1f4,_0x239910[_0xae86('0x15')]));});});};exports[_0xae86('0x1b')]=function(_0x23a010){var _0x55aa0f;return db[_0xae86('0x9')][_0xae86('0x16')]({'where':_0x23a010[_0xae86('0xb')][_0xae86('0x17')]||{},'attributes':['id',_0xae86('0x1c'),'role',_0xae86('0x1d'),_0xae86('0x1e')]})[_0xae86('0x11')](function(_0x13942f){if(!_0x13942f){throw new Error(util['format'](_0xae86('0x1f'),_0x23a010[_0xae86('0x20')]['id']));}_0x55aa0f=_0x13942f;return db[_0xae86('0x21')][_0xae86('0x22')]({'paused':0x1},{'where':{'UserId':_0x55aa0f['id']},'individualHooks':!![]});})['then'](function(){return db[_0xae86('0x23')]['findAll']({'where':{'membername':_0x55aa0f[_0xae86('0x1c')],'type':_0xae86('0x24'),'exitAt':null}});})[_0xae86('0x11')](function(_0x183305){if(_0x183305&&_0x183305[_0xae86('0x25')]){var _0x4f75f2=moment()['format'](_0xae86('0x26'));for(var _0x2d438c=0x0,_0x3a43f3=_0x183305[_0xae86('0x25')];_0x2d438c<_0x3a43f3;_0x2d438c++){_0x183305[_0x2d438c][_0xae86('0x27')]({'exitAt':_0x4f75f2});}}})['then'](function(){var _0x4eef42=[];var _0x71a45e=utils[_0xae86('0x28')]();_0x71a45e['forEach'](function(_0x38b1c7){_0x4eef42[_0xae86('0x29')]({'channel':_0x38b1c7,'membername':_0x55aa0f[_0xae86('0x1c')],'interface':_[_0xae86('0x2a')](_0x55aa0f['interface'])?util[_0xae86('0x2b')](_0xae86('0x2c'),_0x55aa0f[_0xae86('0x1c')]):_0x55aa0f[_0xae86('0x1e')],'type':_0xae86('0x24'),'enterAt':moment()[_0xae86('0x2b')](_0xae86('0x26')),'data1':_0x23a010[_0xae86('0x2d')][_0xae86('0x2e')]||'DEFAULT\x20PAUSE','role':_0x55aa0f[_0xae86('0x2f')],'internal':_0x55aa0f[_0xae86('0x1d')],'uniqueid':_0x23a010[_0xae86('0x2d')]['uniqueid']||null});});return db[_0xae86('0x23')][_0xae86('0x30')](_0x4eef42,{'individualHooks':!![]});})[_0xae86('0x11')](function(){return _0x55aa0f[_0xae86('0x22')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x23a010[_0xae86('0x2d')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xae86('0x26'))});})['catch'](function(_0x42077c){throw _0x42077c;});};exports['UnpauseUser']=function(_0x22da45){return Promise[_0xae86('0x31')]()[_0xae86('0x11')](function(){if(_0x22da45[_0xae86('0x2d')][_0xae86('0x32')]&&!utils[_0xae86('0x33')](_0x22da45[_0xae86('0x2d')]['channel'])){throw new Error(util[_0xae86('0x2b')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x22da45[_0xae86('0x2d')][_0xae86('0x32')]));}return db[_0xae86('0x9')][_0xae86('0x34')]({'where':_0x22da45[_0xae86('0xb')][_0xae86('0x17')]||{},'attributes':['id',_0xae86('0x1c'),_0xae86('0x2f'),_0xae86('0x1d'),_0xae86('0x1e'),_0xae86('0x35'),_0xae86('0x36'),_0xae86('0x37'),'chatPause',_0xae86('0x38'),_0xae86('0x39'),'smsPause',_0xae86('0x3a'),'pauseType',_0xae86('0x3b')]});})[_0xae86('0x11')](function(_0x96886b){if(!_0x96886b){throw new Error(util[_0xae86('0x2b')](_0xae86('0x1f'),_0x22da45[_0xae86('0x20')]['id']));}return _0x96886b[_0xae86('0x3c')](_0x22da45[_0xae86('0x2d')][_0xae86('0x32')],_0xae86('0x3d'));})[_0xae86('0x13')](function(_0x4ae279){throw _0x4ae279;});};exports[_0xae86('0x3e')]=function(_0x565a17){var _0x5e5e8b=this;return new Promise(function(_0x1d587a,_0x48853b){var _0x6b31d8;return db['User'][_0xae86('0x34')]({'where':_0x565a17['options'][_0xae86('0x17')]||{},'attributes':['id',_0xae86('0x1c')]})[_0xae86('0x11')](function(_0x1cd0f6){if(_0x1cd0f6){_0x6b31d8=_0x1cd0f6;return db['UserVoiceQueueRt'][_0xae86('0x3f')]({'where':{'membername':_0x6b31d8['name']},'individualHooks':!![]});}})['then'](function(){if(_0x6b31d8){return db[_0xae86('0x23')][_0xae86('0xa')]({'where':{'membername':_0x6b31d8['name'],'exitAt':null}});}})[_0xae86('0x11')](function(_0x403dc3){if(_0x6b31d8){if(_0x403dc3&&_0x403dc3['length']){var _0x4fe7c2=[];_0x403dc3['forEach'](function(_0x1e7b3c){_0x4fe7c2['push'](_0x1e7b3c['update']({'exitAt':moment()[_0xae86('0x2b')](_0xae86('0x26'))}));});return BPromise[_0xae86('0x40')](_0x4fe7c2);}}})['then'](function(){if(_0x6b31d8){return _0x6b31d8[_0xae86('0x22')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xae86('0x11')](function(_0x21bbdf){_0x1d587a(_0x21bbdf);})['catch'](function(_0x9120c0){_0x48853b(_0x5e5e8b['error'](0x1f4,_0x9120c0[_0xae86('0x15')]));});});};exports[_0xae86('0x41')]=function(_0x3c317d){var _0x35a3b2=this;return new Promise(function(_0x3cec78,_0x8de8e6){var _0x123b4f;var _0x2c6357;var _0x55cb3c;var _0x106e28;return db[_0xae86('0x9')][_0xae86('0x34')]({'where':_0x3c317d[_0xae86('0xb')]['where']||{},'attributes':['id',_0xae86('0x1c'),_0xae86('0x2f'),'mobile',_0xae86('0x42'),_0xae86('0x1d'),_0xae86('0x43'),_0xae86('0x1e')]})[_0xae86('0x11')](function(_0x2d1720){if(_0x2d1720){_0x123b4f=_0x2d1720;_0x106e28=_0x3c317d[_0xae86('0x2d')]['interface']?_0x3c317d['body']['interface']:util[_0xae86('0x2b')](_0xae86('0x2c'),_0x123b4f[_0xae86('0x1c')]);return db[_0xae86('0x9')][_0xae86('0x44')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x123b4f['id']}}});}})[_0xae86('0x11')](function(_0x472649){if(_0x472649){_0x55cb3c=_0x472649;return require(_0xae86('0x45'))[_0xae86('0x46')]();}})[_0xae86('0x11')](function(_0x31da08){if(_0x31da08&&_0x31da08['agents']&&_0x55cb3c>=_0x31da08[_0xae86('0x47')]){throw new Error(_0xae86('0x48'));}})['then'](function(){if(_0x123b4f){return db['UserVoiceQueueRt'][_0xae86('0x3f')]({'where':{'membername':_0x123b4f[_0xae86('0x1c')]},'individualHooks':!![]});}})[_0xae86('0x11')](function(){if(_0x123b4f){return _0x123b4f[_0xae86('0x49')]({'raw':!![]});}})['then'](function(_0x544df8){if(_0x123b4f){if(_0x544df8){var _0x506aff=[];_0x2c6357=_0x544df8;if(_0x2c6357[_0xae86('0x25')]){for(var _0x49f46f=0x0;_0x49f46f<_0x2c6357[_0xae86('0x25')];_0x49f46f++){_0x506aff[_0xae86('0x29')](db['UserVoiceQueueRt'][_0xae86('0x4a')]({'membername':_0x123b4f['name'],'UserId':_0x123b4f['id'],'queue_name':_0x2c6357[_0x49f46f][_0xae86('0x1c')],'VoiceQueueId':_0x2c6357[_0x49f46f]['id'],'interface':_0x106e28,'paused':_0x123b4f[_0xae86('0x43')]||![],'penalty':_0x2c6357[_0x49f46f][_0xae86('0x4b')]||0x0}));}return BPromise['all'](_0x506aff);}}}})[_0xae86('0x11')](function(){if(_0x123b4f){return db['MemberReport'][_0xae86('0xa')]({'where':{'membername':_0x123b4f[_0xae86('0x1c')],'exitAt':null}});}})['then'](function(_0x53103d){if(_0x123b4f){if(_0x53103d&&_0x53103d['length']){var _0x3feb94=[];_0x53103d[_0xae86('0x4c')](function(_0x210828){_0x3feb94[_0xae86('0x29')](_0x210828[_0xae86('0x22')]({'exitAt':moment()[_0xae86('0x2b')](_0xae86('0x26'))}));});return BPromise['all'](_0x3feb94);}}})[_0xae86('0x11')](function(){if(_0x123b4f){var _0x5881c7=[];var _0x22c38c=[];var _0x55b64d=utils['getChannels']();var _0xd57d0f={'membername':_0x123b4f['name'],'interface':_0x106e28,'enterAt':moment()[_0xae86('0x2b')](_0xae86('0x26')),'role':_0x123b4f[_0xae86('0x2f')],'internal':_0x123b4f[_0xae86('0x1d')]};_0x55b64d['forEach'](function(_0x509096){_0x5881c7[_0xae86('0x29')](_[_0xae86('0x4d')]({'channel':_0x509096,'type':'LOGIN','data1':_0xae86('0x4e'),'data2':_0x106e28},_0xd57d0f));if(_0x123b4f['loginInPause']){_0x22c38c[_0xae86('0x29')](_['merge']({'channel':_0x509096,'type':'PAUSE','data1':_0xae86('0x4f')},_0xd57d0f));}});return db['MemberReport'][_0xae86('0x30')](_0x5881c7[_0xae86('0x50')](_0x22c38c),{'individualHooks':!![]});}})[_0xae86('0x11')](function(){if(_0x123b4f){return _0x123b4f['update']({'online':!![],'lastLoginAt':moment()[_0xae86('0x2b')](_0xae86('0x26')),'voicePause':_0x123b4f[_0xae86('0x43')]||![],'mailPause':_0x123b4f[_0xae86('0x43')]||![],'chatPause':_0x123b4f['loginInPause']||![],'faxPause':_0x123b4f[_0xae86('0x43')]||![],'smsPause':_0x123b4f[_0xae86('0x43')]||![],'openchannelPause':_0x123b4f['loginInPause']||![],'pauseType':_0x123b4f[_0xae86('0x43')]?_0xae86('0x4f'):null,'lastPauseAt':moment()['format'](_0xae86('0x26')),'interface':_0x106e28});}})[_0xae86('0x11')](function(_0x1fe737){_0x3cec78(_0x1fe737);})[_0xae86('0x13')](function(_0x5bc228){_0x8de8e6(_0x35a3b2[_0xae86('0x14')](0x1f4,_0x5bc228[_0xae86('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 7ea689b..c8eca4d 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 _0x1410=['./user.events','save','update','user:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1410,0x1bc));var _0x0141=function(_0x114218,_0x1c2f74){_0x114218=_0x114218-0x0;var _0x545e6c=_0x1410[_0x114218];return _0x545e6c;};'use strict';var UserEvents=require(_0x0141('0x0'));var events=[_0x0141('0x1'),'remove',_0x0141('0x2')];function createListener(_0x595b4a,_0x5e9b69){return function(_0xba0cc3){_0x5e9b69['emit'](_0x595b4a,_0xba0cc3);};}function removeListener(_0x30352e,_0x482bb0){return function(){UserEvents['removeListener'](_0x30352e,_0x482bb0);};}exports['register']=function(_0x4516da){for(var _0x130d14=0x0,_0x355658=events['length'];_0x130d14<_0x355658;_0x130d14++){var _0x484d24=events[_0x130d14];var _0x2b9208=createListener(_0x0141('0x3')+_0x484d24,_0x4516da);UserEvents['on'](_0x484d24,_0x2b9208);}}; \ No newline at end of file +var _0x58fd=['save','update','removeListener','register','user:','./user.events'];(function(_0x5ed788,_0x1a6cd7){var _0x33c82f=function(_0x512cb9){while(--_0x512cb9){_0x5ed788['push'](_0x5ed788['shift']());}};_0x33c82f(++_0x1a6cd7);}(_0x58fd,0xe3));var _0xd58f=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x58fd[_0x29b609];return _0x54c952;};'use strict';var UserEvents=require(_0xd58f('0x0'));var events=[_0xd58f('0x1'),'remove',_0xd58f('0x2')];function createListener(_0x37d255,_0x3977ec){return function(_0x51f4e9){_0x3977ec['emit'](_0x37d255,_0x51f4e9);};}function removeListener(_0x479e2d,_0x17cd1e){return function(){UserEvents[_0xd58f('0x3')](_0x479e2d,_0x17cd1e);};}exports[_0xd58f('0x4')]=function(_0x458d85){for(var _0x4e9af8=0x0,_0x418999=events['length'];_0x4e9af8<_0x418999;_0x4e9af8++){var _0x201842=events[_0x4e9af8];var _0x13e108=createListener(_0xd58f('0x5')+_0x201842,_0x458d85);UserEvents['on'](_0x201842,_0x13e108);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 81d425c..39e6d4c 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3a0633,_0x120c59){var _0x58341e=function(_0x1ecb29){while(--_0x1ecb29){_0x3a0633['push'](_0x3a0633['shift']());}};_0x58341e(++_0x120c59);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x585cdf,_0x4481a9){var _0x121702=function(_0x12e6ad){while(--_0x12e6ad){_0x585cdf['push'](_0x585cdf['shift']());}};_0x121702(++_0x4481a9);}(_0x70e0,0x17b));var _0x070e=function(_0x39ba9d,_0x491034){_0x39ba9d=_0x39ba9d-0x0;var _0x5e80ea=_0x70e0[_0x39ba9d];return _0x5e80ea;};'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 148be77..dae8149 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 _0x2c53=['sequelize','exports','INTEGER'];(function(_0x2945bf,_0x4b9ab4){var _0x1c78bb=function(_0xff0f4){while(--_0xff0f4){_0x2945bf['push'](_0x2945bf['shift']());}};_0x1c78bb(++_0x4b9ab4);}(_0x2c53,0x17a));var _0x32c5=function(_0x4ae58a,_0x72bd08){_0x4ae58a=_0x4ae58a-0x0;var _0x3c0445=_0x2c53[_0x4ae58a];return _0x3c0445;};'use strict';var Sequelize=require(_0x32c5('0x0'));module[_0x32c5('0x1')]={'penalty':{'type':Sequelize[_0x32c5('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4bc2=['sequelize','exports'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x4bc2,0xe4));var _0x24bc=function(_0x385ac9,_0x504a83){_0x385ac9=_0x385ac9-0x0;var _0x24710a=_0x4bc2[_0x385ac9];return _0x24710a;};'use strict';var Sequelize=require(_0x24bc('0x0'));module[_0x24bc('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index b43c3ef..7a20758 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 _0xc086=['api','moment','bluebird','request-promise','path','rimraf','./userChatQueue.attributes','user_has_chat_queues','lodash','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc086,0x116));var _0x6c08=function(_0x1df236,_0x58557a){_0x1df236=_0x1df236-0x0;var _0x5d8aa1=_0xc086[_0x1df236];return _0x5d8aa1;};'use strict';var _=require(_0x6c08('0x0'));var util=require(_0x6c08('0x1'));var logger=require('../../config/logger')(_0x6c08('0x2'));var moment=require(_0x6c08('0x3'));var BPromise=require(_0x6c08('0x4'));var rp=require(_0x6c08('0x5'));var fs=require('fs');var path=require(_0x6c08('0x6'));var rimraf=require(_0x6c08('0x7'));var config=require('../../config/environment');var attributes=require(_0x6c08('0x8'));module['exports']=function(_0x2a8475,_0x559ec4){return _0x2a8475['define']('UserChatQueue',attributes,{'tableName':_0x6c08('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa281=['moment','bluebird','request-promise','path','exports','define','UserChatQueue','lodash','util','../../config/logger','api'];(function(_0x3afc2a,_0x55d741){var _0x23116c=function(_0x3602f1){while(--_0x3602f1){_0x3afc2a['push'](_0x3afc2a['shift']());}};_0x23116c(++_0x55d741);}(_0xa281,0xf9));var _0x1a28=function(_0x1e4954,_0x12e65f){_0x1e4954=_0x1e4954-0x0;var _0x3d2953=_0xa281[_0x1e4954];return _0x3d2953;};'use strict';var _=require(_0x1a28('0x0'));var util=require(_0x1a28('0x1'));var logger=require(_0x1a28('0x2'))(_0x1a28('0x3'));var moment=require(_0x1a28('0x4'));var BPromise=require(_0x1a28('0x5'));var rp=require(_0x1a28('0x6'));var fs=require('fs');var path=require(_0x1a28('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0x1a28('0x8')]=function(_0x9979a,_0x41484e){return _0x9979a[_0x1a28('0x9')](_0x1a28('0xa'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 71d4d07..b94aeee 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 _0x69ae=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x69ae,0xc1));var _0xe69a=function(_0x412a1b,_0x20d145){_0x412a1b=_0x412a1b-0x0;var _0x16926c=_0x69ae[_0x412a1b];return _0x16926c;};'use strict';var _=require(_0xe69a('0x0'));var util=require(_0xe69a('0x1'));var moment=require(_0xe69a('0x2'));var BPromise=require(_0xe69a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe69a('0x4'));var db=require(_0xe69a('0x5'))['db'];var utils=require(_0xe69a('0x6'));var logger=require(_0xe69a('0x7'))(_0xe69a('0x8'));var config=require(_0xe69a('0x9'));var jayson=require(_0xe69a('0xa'));var client=jayson[_0xe69a('0xb')][_0xe69a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf642b4,_0x53752f,_0xdcc6de){return new BPromise(function(_0x49f1c3,_0x480389){return client[_0xe69a('0xd')](_0xf642b4,_0xdcc6de)['then'](function(_0x4cd15c){logger[_0xe69a('0xe')](_0xe69a('0xf'),_0x53752f,_0xe69a('0x10'));logger[_0xe69a('0x11')](_0xe69a('0x12'),_0x53752f,_0xe69a('0x10'),JSON[_0xe69a('0x13')](_0x4cd15c));if(_0x4cd15c['error']){if(_0x4cd15c[_0xe69a('0x14')]['code']===0x1f4){logger[_0xe69a('0x14')](_0xe69a('0xf'),_0x53752f,_0x4cd15c['error'][_0xe69a('0x15')]);return _0x480389(_0x4cd15c[_0xe69a('0x14')][_0xe69a('0x15')]);}logger['error'](_0xe69a('0xf'),_0x53752f,_0x4cd15c['error'][_0xe69a('0x15')]);return _0x49f1c3(_0x4cd15c[_0xe69a('0x14')][_0xe69a('0x15')]);}else{logger[_0xe69a('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x53752f,_0xe69a('0x10'));_0x49f1c3(_0x4cd15c[_0xe69a('0x16')][_0xe69a('0x15')]);}})[_0xe69a('0x17')](function(_0x930563){logger['error'](_0xe69a('0xf'),_0x53752f,_0x930563);_0x480389(_0x930563);});});} \ No newline at end of file +var _0xa836=['jayson/promise','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x13f5a1,_0x4b49b4){var _0x11c25b=function(_0x5d4e13){while(--_0x5d4e13){_0x13f5a1['push'](_0x13f5a1['shift']());}};_0x11c25b(++_0x4b49b4);}(_0xa836,0xdd));var _0x6a83=function(_0x46f5ac,_0x2722a4){_0x46f5ac=_0x46f5ac-0x0;var _0x5a17db=_0xa836[_0x46f5ac];return _0x5a17db;};'use strict';var _=require(_0x6a83('0x0'));var util=require(_0x6a83('0x1'));var moment=require(_0x6a83('0x2'));var BPromise=require(_0x6a83('0x3'));var rs=require(_0x6a83('0x4'));var fs=require('fs');var Redis=require(_0x6a83('0x5'));var db=require(_0x6a83('0x6'))['db'];var utils=require(_0x6a83('0x7'));var logger=require(_0x6a83('0x8'))('rpc');var config=require(_0x6a83('0x9'));var jayson=require(_0x6a83('0xa'));var client=jayson['client'][_0x6a83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5999da,_0x35472c,_0x50c231){return new BPromise(function(_0x5a62be,_0x27f6e1){return client[_0x6a83('0xc')](_0x5999da,_0x50c231)['then'](function(_0x5b0871){logger[_0x6a83('0xd')](_0x6a83('0xe'),_0x35472c,'request\x20sent');logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x35472c,_0x6a83('0xf'),JSON[_0x6a83('0x10')](_0x5b0871));if(_0x5b0871[_0x6a83('0x11')]){if(_0x5b0871[_0x6a83('0x11')]['code']===0x1f4){logger['error'](_0x6a83('0xe'),_0x35472c,_0x5b0871[_0x6a83('0x11')]['message']);return _0x27f6e1(_0x5b0871['error'][_0x6a83('0x12')]);}logger[_0x6a83('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x35472c,_0x5b0871['error'][_0x6a83('0x12')]);return _0x5a62be(_0x5b0871[_0x6a83('0x11')][_0x6a83('0x12')]);}else{logger[_0x6a83('0xd')](_0x6a83('0xe'),_0x35472c,_0x6a83('0xf'));_0x5a62be(_0x5b0871[_0x6a83('0x13')][_0x6a83('0x12')]);}})[_0x6a83('0x14')](function(_0x25142a){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x35472c,_0x25142a);_0x27f6e1(_0x25142a);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 7037145..95de652 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1dcc5e,_0x500eb7){var _0x1cc7c8=function(_0x366247){while(--_0x366247){_0x1dcc5e['push'](_0x1dcc5e['shift']());}};_0x1cc7c8(++_0x500eb7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0xcb91[_0x872b02];return _0x1a6b24;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5b9e58,_0x51f4e1){var _0x5f1012=function(_0x3d066a){while(--_0x3d066a){_0x5b9e58['push'](_0x5b9e58['shift']());}};_0x5f1012(++_0x51f4e1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index cbdf6b7..c6db880 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 _0x4ab5=['INTEGER','STRING','exports'];(function(_0x28edda,_0xbd447a){var _0x21f4a4=function(_0x5ae05e){while(--_0x5ae05e){_0x28edda['push'](_0x28edda['shift']());}};_0x21f4a4(++_0xbd447a);}(_0x4ab5,0x95));var _0x54ab=function(_0x9ab282,_0x224526){_0x9ab282=_0x9ab282-0x0;var _0x3ae406=_0x4ab5[_0x9ab282];return _0x3ae406;};'use strict';var Sequelize=require('sequelize');module[_0x54ab('0x0')]={'penalty':{'type':Sequelize[_0x54ab('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x54ab('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x54ab('0x2')]}}; \ No newline at end of file +var _0xf827=['INTEGER','sequelize'];(function(_0x52df53,_0x28d727){var _0x313eab=function(_0x189a88){while(--_0x189a88){_0x52df53['push'](_0x52df53['shift']());}};_0x313eab(++_0x28d727);}(_0xf827,0x7f));var _0x7f82=function(_0x1331ba,_0x3f5772){_0x1331ba=_0x1331ba-0x0;var _0x2a2f6b=_0xf827[_0x1331ba];return _0x2a2f6b;};'use strict';var Sequelize=require(_0x7f82('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7f82('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7f82('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 54a53b5..f5bf3e0 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 _0xf708=['../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0xf708,0x1b1));var _0x8f70=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf708[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8f70('0x0'));var util=require(_0x8f70('0x1'));var logger=require(_0x8f70('0x2'))(_0x8f70('0x3'));var moment=require(_0x8f70('0x4'));var BPromise=require(_0x8f70('0x5'));var rp=require(_0x8f70('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8f70('0x7'));var attributes=require(_0x8f70('0x8'));module['exports']=function(_0x194d16,_0x41b30d){return _0x194d16['define'](_0x8f70('0x9'),attributes,{'tableName':_0x8f70('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92da=['path','rimraf','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','moment','bluebird'];(function(_0x2a3e04,_0x1c9bc9){var _0x5d3fd2=function(_0x51de9e){while(--_0x51de9e){_0x2a3e04['push'](_0x2a3e04['shift']());}};_0x5d3fd2(++_0x1c9bc9);}(_0x92da,0x1dc));var _0xa92d=function(_0x10e6d9,_0x4c91fc){_0x10e6d9=_0x10e6d9-0x0;var _0x39171d=_0x92da[_0x10e6d9];return _0x39171d;};'use strict';var _=require(_0xa92d('0x0'));var util=require('util');var logger=require(_0xa92d('0x1'))('api');var moment=require(_0xa92d('0x2'));var BPromise=require(_0xa92d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa92d('0x4'));var rimraf=require(_0xa92d('0x5'));var config=require('../../config/environment');var attributes=require(_0xa92d('0x6'));module[_0xa92d('0x7')]=function(_0x1887a7,_0x24bc1e){return _0x1887a7['define'](_0xa92d('0x8'),attributes,{'tableName':_0xa92d('0x9'),'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 920d534..414cbbd 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 _0xebdc=['../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserFaxQueue,\x20%s,\x20%s','message','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4843cf,_0x480cb5){var _0x52ad78=function(_0xc6def3){while(--_0xc6def3){_0x4843cf['push'](_0x4843cf['shift']());}};_0x52ad78(++_0x480cb5);}(_0xebdc,0x163));var _0xcebd=function(_0x39591a,_0x30c9f4){_0x39591a=_0x39591a-0x0;var _0x4becc2=_0xebdc[_0x39591a];return _0x4becc2;};'use strict';var _=require(_0xcebd('0x0'));var util=require('util');var moment=require(_0xcebd('0x1'));var BPromise=require('bluebird');var rs=require(_0xcebd('0x2'));var fs=require('fs');var Redis=require(_0xcebd('0x3'));var db=require(_0xcebd('0x4'))['db'];var utils=require(_0xcebd('0x5'));var logger=require(_0xcebd('0x6'))(_0xcebd('0x7'));var config=require('../../config/environment');var jayson=require(_0xcebd('0x8'));var client=jayson[_0xcebd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fa197,_0x2dd635,_0x51721f){return new BPromise(function(_0x163a27,_0x2c9b28){return client['request'](_0x1fa197,_0x51721f)[_0xcebd('0xa')](function(_0x605225){logger[_0xcebd('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x2dd635,_0xcebd('0xc'));logger[_0xcebd('0xd')](_0xcebd('0xe'),_0x2dd635,_0xcebd('0xc'),JSON[_0xcebd('0xf')](_0x605225));if(_0x605225[_0xcebd('0x10')]){if(_0x605225['error']['code']===0x1f4){logger[_0xcebd('0x10')](_0xcebd('0x11'),_0x2dd635,_0x605225[_0xcebd('0x10')][_0xcebd('0x12')]);return _0x2c9b28(_0x605225[_0xcebd('0x10')]['message']);}logger[_0xcebd('0x10')](_0xcebd('0x11'),_0x2dd635,_0x605225[_0xcebd('0x10')][_0xcebd('0x12')]);return _0x163a27(_0x605225[_0xcebd('0x10')][_0xcebd('0x12')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x2dd635,_0xcebd('0xc'));_0x163a27(_0x605225['result']['message']);}})['catch'](function(_0xa4d8fb){logger['error'](_0xcebd('0x11'),_0x2dd635,_0xa4d8fb);_0x2c9b28(_0xa4d8fb);});});} \ No newline at end of file +var _0xb0e5=['debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserFaxQueue,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','info','request\x20sent'];(function(_0x47aa5e,_0x5a65bc){var _0xbaa4ef=function(_0x2528d2){while(--_0x2528d2){_0x47aa5e['push'](_0x47aa5e['shift']());}};_0xbaa4ef(++_0x5a65bc);}(_0xb0e5,0x15c));var _0x5b0e=function(_0x5c027f,_0xa40135){_0x5c027f=_0x5c027f-0x0;var _0x5392f3=_0xb0e5[_0x5c027f];return _0x5392f3;};'use strict';var _=require(_0x5b0e('0x0'));var util=require(_0x5b0e('0x1'));var moment=require('moment');var BPromise=require(_0x5b0e('0x2'));var rs=require(_0x5b0e('0x3'));var fs=require('fs');var Redis=require(_0x5b0e('0x4'));var db=require(_0x5b0e('0x5'))['db'];var utils=require(_0x5b0e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5b0e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5b0e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4cc948,_0x162662,_0x62720d){return new BPromise(function(_0x176155,_0x4c6cc1){return client[_0x5b0e('0x9')](_0x4cc948,_0x62720d)['then'](function(_0x9e570f){logger[_0x5b0e('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x162662,_0x5b0e('0xb'));logger[_0x5b0e('0xc')](_0x5b0e('0xd'),_0x162662,'request\x20sent',JSON[_0x5b0e('0xe')](_0x9e570f));if(_0x9e570f[_0x5b0e('0xf')]){if(_0x9e570f['error'][_0x5b0e('0x10')]===0x1f4){logger[_0x5b0e('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x162662,_0x9e570f[_0x5b0e('0xf')]['message']);return _0x4c6cc1(_0x9e570f[_0x5b0e('0xf')]['message']);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x162662,_0x9e570f[_0x5b0e('0xf')][_0x5b0e('0x11')]);return _0x176155(_0x9e570f[_0x5b0e('0xf')][_0x5b0e('0x11')]);}else{logger[_0x5b0e('0xa')](_0x5b0e('0x12'),_0x162662,'request\x20sent');_0x176155(_0x9e570f['result']['message']);}})[_0x5b0e('0x13')](function(_0x141d0b){logger[_0x5b0e('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x162662,_0x141d0b);_0x4c6cc1(_0x141d0b);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 69452ae..d49ba92 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4a7125,_0x247ae8){var _0x1032ad=function(_0x5b57c9){while(--_0x5b57c9){_0x4a7125['push'](_0x4a7125['shift']());}};_0x1032ad(++_0x247ae8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2c3255,_0x4e00ae){_0x2c3255=_0x2c3255-0x0;var _0x282aba=_0xcb91[_0x2c3255];return _0x282aba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x752005,_0x14dc74){var _0x40629c=function(_0x189e3d){while(--_0x189e3d){_0x752005['push'](_0x752005['shift']());}};_0x40629c(++_0x14dc74);}(_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 diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index e9a8a3a..d5f7412 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 _0xeb74=['exports','INTEGER','sequelize'];(function(_0x1dd975,_0x153134){var _0xb0d8f2=function(_0x2e0567){while(--_0x2e0567){_0x1dd975['push'](_0x1dd975['shift']());}};_0xb0d8f2(++_0x153134);}(_0xeb74,0x143));var _0x4eb7=function(_0x27f42e,_0x208c57){_0x27f42e=_0x27f42e-0x0;var _0x497e27=_0xeb74[_0x27f42e];return _0x497e27;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'penalty':{'type':Sequelize[_0x4eb7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6df5=['INTEGER','sequelize','exports'];(function(_0x1717f5,_0x17ec76){var _0x2ba043=function(_0x76acac){while(--_0x76acac){_0x1717f5['push'](_0x1717f5['shift']());}};_0x2ba043(++_0x17ec76);}(_0x6df5,0x154));var _0x56df=function(_0xf80b3,_0x25d5f3){_0xf80b3=_0xf80b3-0x0;var _0x10c489=_0x6df5[_0xf80b3];return _0x10c489;};'use strict';var Sequelize=require(_0x56df('0x0'));module[_0x56df('0x1')]={'penalty':{'type':Sequelize[_0x56df('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 6b27117..be37398 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 _0x6fa8=['exports','UserMailQueue','user_has_mail_queues','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes'];(function(_0x228893,_0x344ba8){var _0x401e54=function(_0x56b6e2){while(--_0x56b6e2){_0x228893['push'](_0x228893['shift']());}};_0x401e54(++_0x344ba8);}(_0x6fa8,0x193));var _0x86fa=function(_0x17a329,_0x5d2f43){_0x17a329=_0x17a329-0x0;var _0x761387=_0x6fa8[_0x17a329];return _0x761387;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x86fa('0x0'));var rp=require(_0x86fa('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86fa('0x2'));var config=require(_0x86fa('0x3'));var attributes=require(_0x86fa('0x4'));module[_0x86fa('0x5')]=function(_0x43c913,_0x4d4209){return _0x43c913['define'](_0x86fa('0x6'),attributes,{'tableName':_0x86fa('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbdc=['api','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger'];(function(_0x352be4,_0x180a93){var _0x17a2df=function(_0x3984ab){while(--_0x3984ab){_0x352be4['push'](_0x352be4['shift']());}};_0x17a2df(++_0x180a93);}(_0xbbdc,0x171));var _0xcbbd=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0xbbdc[_0x51cc1d];return _0x2eb9f2;};'use strict';var _=require(_0xcbbd('0x0'));var util=require(_0xcbbd('0x1'));var logger=require(_0xcbbd('0x2'))(_0xcbbd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbbd('0x4'));var rimraf=require(_0xcbbd('0x5'));var config=require(_0xcbbd('0x6'));var attributes=require(_0xcbbd('0x7'));module[_0xcbbd('0x8')]=function(_0x584d64,_0x40e2c8){return _0x584d64[_0xcbbd('0x9')](_0xcbbd('0xa'),attributes,{'tableName':_0xcbbd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index ba3701b..6bd2eca 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3fd43a,_0xc996b){_0x3fd43a=_0x3fd43a-0x0;var _0xcdfbbe=_0x1cb9[_0x3fd43a];return _0xcdfbbe;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x140ade,_0x531b68){var _0x5de3e3=function(_0x390838){while(--_0x390838){_0x140ade['push'](_0x140ade['shift']());}};_0x5de3e3(++_0x531b68);}(_0xe14b,0x93));var _0xbe14=function(_0x1273bb,_0x193a23){_0x1273bb=_0x1273bb-0x0;var _0x107662=_0xe14b[_0x1273bb];return _0x107662;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 26efa50..ccd8fda 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 _0xa1bb=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','util'];(function(_0x425755,_0x16e311){var _0x38c60b=function(_0x22a7fa){while(--_0x22a7fa){_0x425755['push'](_0x425755['shift']());}};_0x38c60b(++_0x16e311);}(_0xa1bb,0x133));var _0xba1b=function(_0x3e2dcc,_0x1d1bbc){_0x3e2dcc=_0x3e2dcc-0x0;var _0x2a512c=_0xa1bb[_0x3e2dcc];return _0x2a512c;};'use strict';var multer=require('multer');var util=require(_0xba1b('0x0'));var path=require('path');var timeout=require(_0xba1b('0x1'));var express=require(_0xba1b('0x2'));var router=express[_0xba1b('0x3')]();var fs_extra=require(_0xba1b('0x4'));var auth=require(_0xba1b('0x5'));var interaction=require(_0xba1b('0x6'));var config=require(_0xba1b('0x7'));var controller=require(_0xba1b('0x8'));router['post']('/',auth[_0xba1b('0x9')](),controller[_0xba1b('0xa')]);module['exports']=router; \ No newline at end of file +var _0xbcfa=['../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x40f7e1,_0x4cf5bf){var _0xd1a133=function(_0x1174c5){while(--_0x1174c5){_0x40f7e1['push'](_0x40f7e1['shift']());}};_0xd1a133(++_0x4cf5bf);}(_0xbcfa,0x170));var _0xabcf=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xbcfa[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xabcf('0x0'));var util=require(_0xabcf('0x1'));var path=require(_0xabcf('0x2'));var timeout=require(_0xabcf('0x3'));var express=require('express');var router=express[_0xabcf('0x4')]();var fs_extra=require(_0xabcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xabcf('0x6'));var config=require(_0xabcf('0x7'));var controller=require(_0xabcf('0x8'));router['post']('/',auth[_0xabcf('0x9')](),controller['sendUserNotification']);module[_0xabcf('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 6d86856..3b1c325 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 _0x779d=['STRING','sequelize','exports','TEXT'];(function(_0x24afaa,_0x19e02c){var _0x2dda49=function(_0x2ae629){while(--_0x2ae629){_0x24afaa['push'](_0x24afaa['shift']());}};_0x2dda49(++_0x19e02c);}(_0x779d,0xd1));var _0xd779=function(_0x65f242,_0x1abc83){_0x65f242=_0x65f242-0x0;var _0x2cd082=_0x779d[_0x65f242];return _0x2cd082;};'use strict';var Sequelize=require(_0xd779('0x0'));module[_0xd779('0x1')]={'body':{'type':Sequelize[_0xd779('0x2')]},'senderName':{'type':Sequelize[_0xd779('0x3')]},'recipientsId':{'type':Sequelize[_0xd779('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x18fa=['sequelize','exports','STRING','TEXT','BOOLEAN'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x18fa,0x12c));var _0xa18f=function(_0x148d3a,_0x110475){_0x148d3a=_0x148d3a-0x0;var _0x4d96ec=_0x18fa[_0x148d3a];return _0x4d96ec;};'use strict';var Sequelize=require(_0xa18f('0x0'));module[_0xa18f('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xa18f('0x2')]},'recipientsId':{'type':Sequelize[_0xa18f('0x3')]},'recipientsDescription':{'type':Sequelize[_0xa18f('0x2')]},'beep':{'type':Sequelize[_0xa18f('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index a7bd5a9..7b8dc4f 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 _0x8342=['catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','toLowerCase','User','union','queue','replace','Queue','ids','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy','end','stack','name','send','hasOwnProperty','text','body','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','then','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send'];(function(_0x199455,_0x3a30c0){var _0x1a68a4=function(_0xb704eb){while(--_0xb704eb){_0x199455['push'](_0x199455['shift']());}};_0x1a68a4(++_0x3a30c0);}(_0x8342,0x1b9));var _0x2834=function(_0x46f7f0,_0x4ef418){_0x46f7f0=_0x46f7f0-0x0;var _0x783786=_0x8342[_0x46f7f0];return _0x783786;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2834('0x0'));var zipdir=require(_0x2834('0x1'));var jsonpatch=require(_0x2834('0x2'));var rp=require(_0x2834('0x3'));var moment=require(_0x2834('0x4'));var BPromise=require(_0x2834('0x5'));var Mustache=require(_0x2834('0x6'));var util=require(_0x2834('0x7'));var path=require(_0x2834('0x8'));var sox=require(_0x2834('0x9'));var csv=require(_0x2834('0xa'));var ejs=require(_0x2834('0xb'));var fs=require('fs');var fs_extra=require(_0x2834('0xc'));var _=require(_0x2834('0xd'));var squel=require('squel');var crypto=require(_0x2834('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2834('0xf'));var toCsv=require(_0x2834('0xa'));var querystring=require(_0x2834('0x10'));var Papa=require(_0x2834('0x11'));var Redis=require(_0x2834('0x12'));var authService=require(_0x2834('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2834('0x14'));var hardwareService=require(_0x2834('0x15'));var logger=require(_0x2834('0x16'))(_0x2834('0x17'));var utils=require('../../config/utils');var config=require(_0x2834('0x18'));var licenseUtil=require(_0x2834('0x19'));var db=require(_0x2834('0x1a'))['db'];config[_0x2834('0x1b')]=_[_0x2834('0x1c')](config[_0x2834('0x1b')],{'host':_0x2834('0x1d'),'port':0x18eb});var socket=require(_0x2834('0x1e'))(new Redis(config['redis']));require(_0x2834('0x1f'))[_0x2834('0x20')](socket);function respondWithStatusCode(_0x331a01,_0x53f820){_0x53f820=_0x53f820||0xcc;return function(_0x1ec17a){if(_0x1ec17a){return _0x331a01[_0x2834('0x21')](_0x53f820);}return _0x331a01[_0x2834('0x22')](_0x53f820)['end']();};}function respondWithResult(_0x143924,_0x384fb0){_0x384fb0=_0x384fb0||0xc8;return function(_0x1c8e41){if(_0x1c8e41){return _0x143924[_0x2834('0x22')](_0x384fb0)[_0x2834('0x23')](_0x1c8e41);}};}function respondWithFilteredResult(_0x506d06,_0x474df1){return function(_0x185b90){if(_0x185b90){var _0x39d85b=typeof _0x474df1[_0x2834('0x24')]==='undefined'&&typeof _0x474df1[_0x2834('0x25')]===_0x2834('0x26');var _0x1ee55b=_0x185b90[_0x2834('0x27')];var _0x19a400=_0x39d85b?0x0:_0x474df1['offset'];var _0x2e5797=_0x39d85b?_0x185b90[_0x2834('0x27')]:_0x474df1[_0x2834('0x24')]+_0x474df1[_0x2834('0x25')];var _0xce1b51;if(_0x2e5797>=_0x1ee55b){_0x2e5797=_0x1ee55b;_0xce1b51=0xc8;}else{_0xce1b51=0xce;}_0x506d06[_0x2834('0x22')](_0xce1b51);return _0x506d06['set'](_0x2834('0x28'),_0x19a400+'-'+_0x2e5797+'/'+_0x1ee55b)[_0x2834('0x23')](_0x185b90);}return null;};}function patchUpdates(_0x4125c0){return function(_0x6fb3e7){try{jsonpatch[_0x2834('0x29')](_0x6fb3e7,_0x4125c0,!![]);}catch(_0x11745e){return BPromise[_0x2834('0x2a')](_0x11745e);}return _0x6fb3e7[_0x2834('0x2b')]();};}function saveUpdates(_0x142e34,_0x43272a){return function(_0x3d5993){if(_0x3d5993){return _0x3d5993['update'](_0x142e34)['then'](function(_0x2a68ca){return _0x2a68ca;});}return null;};}function removeEntity(_0x15975d,_0x2ce899){return function(_0x29d809){if(_0x29d809){return _0x29d809[_0x2834('0x2c')]()['then'](function(){_0x15975d[_0x2834('0x22')](0xcc)[_0x2834('0x2d')]();});}};}function handleEntityNotFound(_0x584c78,_0x1656de){return function(_0x1a1ae4){if(!_0x1a1ae4){_0x584c78[_0x2834('0x21')](0x194);}return _0x1a1ae4;};}function handleError(_0x505f1e,_0x31341d){_0x31341d=_0x31341d||0x1f4;return function(_0x39ce6f){logger['error'](_0x39ce6f[_0x2834('0x2e')]);if(_0x39ce6f[_0x2834('0x2f')]){delete _0x39ce6f[_0x2834('0x2f')];}_0x505f1e[_0x2834('0x22')](_0x31341d)[_0x2834('0x30')](_0x39ce6f);};}exports['sendUserNotification']=function(_0x222f19,_0x19c253,_0x5993cf){if(!_0x222f19['body'][_0x2834('0x31')](_0x2834('0x32'))&&!_0x222f19[_0x2834('0x33')][_0x2834('0x31')](_0x2834('0x34'))){throw new db[(_0x2834('0x35'))][(_0x2834('0x36'))](_0x2834('0x37'));}else{if(_0x222f19[_0x2834('0x33')]['hasOwnProperty'](_0x2834('0x34'))&&!_0x222f19[_0x2834('0x33')][_0x2834('0x31')](_0x2834('0x38'))){throw new db[(_0x2834('0x35'))]['ValidationError'](_0x2834('0x39'));}if(!_0x222f19[_0x2834('0x33')][_0x2834('0x31')](_0x2834('0x3a'))){throw new db[(_0x2834('0x35'))][(_0x2834('0x36'))](_0x2834('0x3b'));}else{try{var _0x30bf10=JSON['parse'](_0x222f19['body'][_0x2834('0x3a')]);}catch(_0x4c47e6){logger[_0x2834('0x3c')](_0x4c47e6);throw new db[(_0x2834('0x35'))][(_0x2834('0x36'))](_0x2834('0x3d'));}var _0x361ac6=[_0x2834('0x3e'),'faxqueue',_0x2834('0x3f'),_0x2834('0x40'),_0x2834('0x41'),_0x2834('0x42'),_0x2834('0x43'),_0x2834('0x44'),_0x2834('0x45')];if(_[_0x2834('0x46')](_0x30bf10,function(_0x2b815c){return!_[_0x2834('0x47')](_0x361ac6,_0x2b815c[_0x2834('0x48')]['toLowerCase']());})){throw new db['Sequelize'][(_0x2834('0x36'))](_0x2834('0x49'));}}}var _0x52296a={};_0x52296a['senderName']=_0x222f19[_0x2834('0x33')][_0x2834('0x31')](_0x2834('0x4a'))?_0x222f19[_0x2834('0x33')][_0x2834('0x4a')]:_0x222f19[_0x2834('0x45')][_0x2834('0x4b')];_0x52296a[_0x2834('0x4c')]=_['isEmpty'](_0x222f19[_0x2834('0x33')]['recipientsDescription'])?null:_0x222f19[_0x2834('0x33')]['recipientsDescription'];_0x52296a[_0x2834('0x4d')]=_0x222f19[_0x2834('0x33')][_0x2834('0x4d')]||![];_0x52296a[_0x2834('0x4e')]=_0x222f19[_0x2834('0x45')]['id'];return getContent(_0x222f19[_0x2834('0x33')])[_0x2834('0x4f')](function(_0x519b11){_0x52296a[_0x2834('0x33')]=_0x519b11;return getRecipients(_0x30bf10);})['then'](function(_0x1717af){_0x52296a[_0x2834('0x50')]=_[_0x2834('0x51')](_0x1717af)['join'](',');return db[_0x2834('0x52')][_0x2834('0x53')](function(_0x392bf5){return db[_0x2834('0x54')][_0x2834('0x55')](_0x52296a,{'raw':!![],'transaction':_0x392bf5})[_0x2834('0x4f')](function(_0x8d403e){var _0x27223b={'sender':_0x52296a[_0x2834('0x4a')],'description':_0x52296a[_0x2834('0x4c')],'content':_0x52296a['body'],'beep':_0x52296a[_0x2834('0x4d')]};_0x1717af[_0x2834('0x56')](function(_0x5c01b2){_0x27223b['recipient']=_0x5c01b2;socket[_0x2834('0x57')](_0x2834('0x58'),_0x27223b);});return _0x8d403e;});});})[_0x2834('0x4f')](respondWithResult(_0x19c253,0xc9))[_0x2834('0x59')](handleError(_0x19c253,null));};function getContent(_0x4fd557){return new BPromise(function(_0x296e2a,_0x539413){if(_0x4fd557[_0x2834('0x32')]){_0x296e2a(_0x4fd557[_0x2834('0x32')]);return;}return db[_0x2834('0x5a')]['findOne']({'attributes':[_0x2834('0x5b')],'where':{'id':_0x4fd557[_0x2834('0x34')]},'raw':!![]})['then'](function(_0x1a344b){if(!_0x1a344b)throw new db[(_0x2834('0x35'))]['ValidationError'](_0x2834('0x5c'));var _0x532d4a=Mustache[_0x2834('0x5d')](_0x1a344b['html'],_0x4fd557[_0x2834('0x38')]);_0x296e2a(_0x532d4a);})[_0x2834('0x59')](function(_0x5c09e8){_0x539413(_0x5c09e8);});});}function getRecipients(_0x4e52cf){return new BPromise(function(_0x3f8670,_0x47d8c8){var _0x2c444d=[];var _0x201e8b=[];_0x4e52cf['forEach'](function(_0x110c14){var _0x3f2891=_[_0x2834('0x5e')](_0x110c14[_0x2834('0x48')][_0x2834('0x5f')]());if(_0x3f2891===_0x2834('0x60')){_0x2c444d=_[_0x2834('0x61')](_0x2c444d,_0x110c14['ids']);}else{if(_[_0x2834('0x47')](_0x3f2891,_0x2834('0x62')))_0x3f2891=_0x3f2891[_0x2834('0x63')](_0x2834('0x62'),_0x2834('0x64'));_0x110c14[_0x2834('0x65')][_0x2834('0x56')](function(_0x4a01ae){_0x201e8b['push'](getAgents(_0x3f2891,_0x4a01ae));});}});return BPromise[_0x2834('0x66')](_0x201e8b)['then'](function(_0x3a9bbe){_0x2c444d=_[_0x2834('0x61')](_0x2c444d,_[_0x2834('0x67')](_0x3a9bbe));_0x3f8670(_0x2c444d);})['catch'](function(_0x562dfb){_0x47d8c8(_0x562dfb);});});}function getAgents(_0x5b066d,_0xcbf174){return new BPromise(function(_0x11fe3c,_0x50f823){return db[_0x5b066d]['findOne']({'where':{'id':_0xcbf174}})[_0x2834('0x4f')](function(_0x392f94){return _0x392f94[_0x2834('0x68')]({'attributes':['id'],'raw':!![]})[_0x2834('0x4f')](function(_0x1951ee){var _0xb221ec=_[_0x2834('0x69')](_0x1951ee,'id');_0x11fe3c(_0xb221ec);});})[_0x2834('0x59')](function(_0x295593){_0x50f823(_0x295593);});});} \ No newline at end of file +var _0xa33b=['../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','faxqueue','mailqueue','openchannelqueue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','User','union','ids','queue','replace','Queue','push','all','findOne','getAgents','map','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa33b,0x11a));var _0xba33=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xa33b[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xba33('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba33('0x1'));var jsonpatch=require(_0xba33('0x2'));var rp=require(_0xba33('0x3'));var moment=require(_0xba33('0x4'));var BPromise=require(_0xba33('0x5'));var Mustache=require(_0xba33('0x6'));var util=require(_0xba33('0x7'));var path=require('path');var sox=require(_0xba33('0x8'));var csv=require(_0xba33('0x9'));var ejs=require(_0xba33('0xa'));var fs=require('fs');var fs_extra=require(_0xba33('0xb'));var _=require(_0xba33('0xc'));var squel=require(_0xba33('0xd'));var crypto=require('crypto');var jsforce=require(_0xba33('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xba33('0x9'));var querystring=require('querystring');var Papa=require(_0xba33('0xf'));var Redis=require('ioredis');var authService=require(_0xba33('0x10'));var qs=require(_0xba33('0x11'));var as=require(_0xba33('0x12'));var hardwareService=require(_0xba33('0x13'));var logger=require(_0xba33('0x14'))(_0xba33('0x15'));var utils=require(_0xba33('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xba33('0x17'));var db=require(_0xba33('0x18'))['db'];config['redis']=_['defaults'](config[_0xba33('0x19')],{'host':_0xba33('0x1a'),'port':0x18eb});var socket=require(_0xba33('0x1b'))(new Redis(config[_0xba33('0x19')]));require(_0xba33('0x1c'))[_0xba33('0x1d')](socket);function respondWithStatusCode(_0xc3d73d,_0x5228d7){_0x5228d7=_0x5228d7||0xcc;return function(_0x40386b){if(_0x40386b){return _0xc3d73d[_0xba33('0x1e')](_0x5228d7);}return _0xc3d73d['status'](_0x5228d7)[_0xba33('0x1f')]();};}function respondWithResult(_0x4427ce,_0x3aabb2){_0x3aabb2=_0x3aabb2||0xc8;return function(_0x5406fe){if(_0x5406fe){return _0x4427ce[_0xba33('0x20')](_0x3aabb2)[_0xba33('0x21')](_0x5406fe);}};}function respondWithFilteredResult(_0x59e015,_0x3d7fee){return function(_0x57c37b){if(_0x57c37b){var _0x5fdb2f=typeof _0x3d7fee[_0xba33('0x22')]===_0xba33('0x23')&&typeof _0x3d7fee['limit']===_0xba33('0x23');var _0x468bbd=_0x57c37b[_0xba33('0x24')];var _0x416d59=_0x5fdb2f?0x0:_0x3d7fee[_0xba33('0x22')];var _0x54f1c5=_0x5fdb2f?_0x57c37b[_0xba33('0x24')]:_0x3d7fee[_0xba33('0x22')]+_0x3d7fee[_0xba33('0x25')];var _0x2619db;if(_0x54f1c5>=_0x468bbd){_0x54f1c5=_0x468bbd;_0x2619db=0xc8;}else{_0x2619db=0xce;}_0x59e015[_0xba33('0x20')](_0x2619db);return _0x59e015[_0xba33('0x26')](_0xba33('0x27'),_0x416d59+'-'+_0x54f1c5+'/'+_0x468bbd)[_0xba33('0x21')](_0x57c37b);}return null;};}function patchUpdates(_0x3b04b2){return function(_0x35f8b1){try{jsonpatch[_0xba33('0x28')](_0x35f8b1,_0x3b04b2,!![]);}catch(_0x14fe2e){return BPromise[_0xba33('0x29')](_0x14fe2e);}return _0x35f8b1[_0xba33('0x2a')]();};}function saveUpdates(_0x4a3d91,_0x5a09d3){return function(_0x5a28b1){if(_0x5a28b1){return _0x5a28b1['update'](_0x4a3d91)[_0xba33('0x2b')](function(_0x127e4a){return _0x127e4a;});}return null;};}function removeEntity(_0x2c2b80,_0x1dfd87){return function(_0x3b8c78){if(_0x3b8c78){return _0x3b8c78['destroy']()[_0xba33('0x2b')](function(){_0x2c2b80['status'](0xcc)[_0xba33('0x1f')]();});}};}function handleEntityNotFound(_0xc53858,_0x26f470){return function(_0x26059f){if(!_0x26059f){_0xc53858['sendStatus'](0x194);}return _0x26059f;};}function handleError(_0x3b4d0a,_0x58dfe8){_0x58dfe8=_0x58dfe8||0x1f4;return function(_0x5be7ed){logger[_0xba33('0x2c')](_0x5be7ed['stack']);if(_0x5be7ed['name']){delete _0x5be7ed[_0xba33('0x2d')];}_0x3b4d0a[_0xba33('0x20')](_0x58dfe8)[_0xba33('0x2e')](_0x5be7ed);};}exports[_0xba33('0x2f')]=function(_0x35f48e,_0xb791c0,_0x4502ec){if(!_0x35f48e[_0xba33('0x30')][_0xba33('0x31')](_0xba33('0x32'))&&!_0x35f48e[_0xba33('0x30')][_0xba33('0x31')](_0xba33('0x33'))){throw new db[(_0xba33('0x34'))][(_0xba33('0x35'))](_0xba33('0x36'));}else{if(_0x35f48e[_0xba33('0x30')][_0xba33('0x31')](_0xba33('0x33'))&&!_0x35f48e['body'][_0xba33('0x31')](_0xba33('0x37'))){throw new db['Sequelize'][(_0xba33('0x35'))](_0xba33('0x38'));}if(!_0x35f48e[_0xba33('0x30')][_0xba33('0x31')](_0xba33('0x39'))){throw new db[(_0xba33('0x34'))]['ValidationError'](_0xba33('0x3a'));}else{try{var _0x1b9d90=JSON[_0xba33('0x3b')](_0x35f48e['body'][_0xba33('0x39')]);}catch(_0x2dd81f){logger[_0xba33('0x2c')](_0x2dd81f);throw new db[(_0xba33('0x34'))][(_0xba33('0x35'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x3966e7=['chatqueue',_0xba33('0x3c'),_0xba33('0x3d'),_0xba33('0x3e'),'smsqueue','voicequeue',_0xba33('0x3f'),_0xba33('0x40'),_0xba33('0x41')];if(_[_0xba33('0x42')](_0x1b9d90,function(_0x59d21a){return!_[_0xba33('0x43')](_0x3966e7,_0x59d21a[_0xba33('0x44')]['toLowerCase']());})){throw new db[(_0xba33('0x34'))][(_0xba33('0x35'))](_0xba33('0x45'));}}}var _0x22164b={};_0x22164b['senderName']=_0x35f48e['body'][_0xba33('0x31')]('senderName')?_0x35f48e[_0xba33('0x30')][_0xba33('0x46')]:_0x35f48e[_0xba33('0x41')][_0xba33('0x47')];_0x22164b[_0xba33('0x48')]=_[_0xba33('0x49')](_0x35f48e[_0xba33('0x30')][_0xba33('0x48')])?null:_0x35f48e[_0xba33('0x30')][_0xba33('0x48')];_0x22164b['beep']=_0x35f48e[_0xba33('0x30')][_0xba33('0x4a')]||![];_0x22164b[_0xba33('0x4b')]=_0x35f48e['user']['id'];return getContent(_0x35f48e[_0xba33('0x30')])['then'](function(_0x16b5c7){_0x22164b['body']=_0x16b5c7;return getRecipients(_0x1b9d90);})[_0xba33('0x2b')](function(_0x38cb95){_0x22164b[_0xba33('0x4c')]=_[_0xba33('0x4d')](_0x38cb95)['join'](',');return db[_0xba33('0x4e')][_0xba33('0x4f')](function(_0x133f08){return db[_0xba33('0x50')][_0xba33('0x51')](_0x22164b,{'raw':!![],'transaction':_0x133f08})[_0xba33('0x2b')](function(_0xddfa09){var _0x5685f4={'sender':_0x22164b[_0xba33('0x46')],'description':_0x22164b[_0xba33('0x48')],'content':_0x22164b[_0xba33('0x30')],'beep':_0x22164b['beep']};_0x38cb95[_0xba33('0x52')](function(_0x485320){_0x5685f4[_0xba33('0x53')]=_0x485320;socket[_0xba33('0x54')](_0xba33('0x55'),_0x5685f4);});return _0xddfa09;});});})[_0xba33('0x2b')](respondWithResult(_0xb791c0,0xc9))[_0xba33('0x56')](handleError(_0xb791c0,null));};function getContent(_0x4ce7ca){return new BPromise(function(_0x40306c,_0x4f0466){if(_0x4ce7ca[_0xba33('0x32')]){_0x40306c(_0x4ce7ca[_0xba33('0x32')]);return;}return db[_0xba33('0x57')]['findOne']({'attributes':[_0xba33('0x58')],'where':{'id':_0x4ce7ca['TemplateId']},'raw':!![]})['then'](function(_0x28c4d0){if(!_0x28c4d0)throw new db[(_0xba33('0x34'))]['ValidationError'](_0xba33('0x59'));var _0x246b0f=Mustache['render'](_0x28c4d0[_0xba33('0x58')],_0x4ce7ca[_0xba33('0x37')]);_0x40306c(_0x246b0f);})[_0xba33('0x56')](function(_0x223315){_0x4f0466(_0x223315);});});}function getRecipients(_0x21dcf1){return new BPromise(function(_0x3b787c,_0x58e171){var _0x408a7c=[];var _0x4dad15=[];_0x21dcf1['forEach'](function(_0x3f12a6){var _0x55fb42=_[_0xba33('0x5a')](_0x3f12a6['model']['toLowerCase']());if(_0x55fb42===_0xba33('0x5b')){_0x408a7c=_[_0xba33('0x5c')](_0x408a7c,_0x3f12a6[_0xba33('0x5d')]);}else{if(_['includes'](_0x55fb42,_0xba33('0x5e')))_0x55fb42=_0x55fb42[_0xba33('0x5f')](_0xba33('0x5e'),_0xba33('0x60'));_0x3f12a6['ids']['forEach'](function(_0x1b8590){_0x4dad15[_0xba33('0x61')](getAgents(_0x55fb42,_0x1b8590));});}});return BPromise[_0xba33('0x62')](_0x4dad15)[_0xba33('0x2b')](function(_0x1f7124){_0x408a7c=_[_0xba33('0x5c')](_0x408a7c,_['flatten'](_0x1f7124));_0x3b787c(_0x408a7c);})['catch'](function(_0x1794ca){_0x58e171(_0x1794ca);});});}function getAgents(_0x1add66,_0x3d1cd0){return new BPromise(function(_0xcde6f0,_0x2791ef){return db[_0x1add66][_0xba33('0x63')]({'where':{'id':_0x3d1cd0}})[_0xba33('0x2b')](function(_0x3f261f){return _0x3f261f[_0xba33('0x64')]({'attributes':['id'],'raw':!![]})[_0xba33('0x2b')](function(_0x3eac57){var _0x1b8b73=_[_0xba33('0x65')](_0x3eac57,'id');_0xcde6f0(_0x1b8b73);});})[_0xba33('0x56')](function(_0x2cedc7){_0x2791ef(_0x2cedc7);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index e78577f..fb459e0 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 _0xed1e=['emit','hasOwnProperty','exports','events','../../mysqldb','save','update','remove'];(function(_0x575188,_0x1cea43){var _0x3e8fcd=function(_0x11e8a2){while(--_0x11e8a2){_0x575188['push'](_0x575188['shift']());}};_0x3e8fcd(++_0x1cea43);}(_0xed1e,0xbb));var _0xeed1=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0xed1e[_0x52666e];return _0x515330;};'use strict';var EventEmitter=require(_0xeed1('0x0'));var UserNotification=require(_0xeed1('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeed1('0x2'),'afterUpdate':_0xeed1('0x3'),'afterDestroy':_0xeed1('0x4')};function emitEvent(_0x312b78){return function(_0x2b6a85,_0x3e9f93,_0x98f950){UserNotificationEvents[_0xeed1('0x5')](_0x312b78+':'+_0x2b6a85['id'],_0x2b6a85);UserNotificationEvents[_0xeed1('0x5')](_0x312b78,_0x2b6a85);_0x98f950(null);};}for(var e in events){if(events[_0xeed1('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xeed1('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0x4611=['save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x4611,0xe7));var _0x1461=function(_0x339a66,_0x44b094){_0x339a66=_0x339a66-0x0;var _0xd2afe2=_0x4611[_0x339a66];return _0xd2afe2;};'use strict';var EventEmitter=require(_0x1461('0x0'));var UserNotification=require(_0x1461('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x1461('0x2')](0x0);var events={'afterCreate':_0x1461('0x3'),'afterUpdate':_0x1461('0x4'),'afterDestroy':_0x1461('0x5')};function emitEvent(_0x17a745){return function(_0x419593,_0x3fdb02,_0xc38bcc){UserNotificationEvents['emit'](_0x17a745+':'+_0x419593['id'],_0x419593);UserNotificationEvents['emit'](_0x17a745,_0x419593);_0xc38bcc(null);};}for(var e in events){if(events[_0x1461('0x6')](e)){var event=events[e];UserNotification[_0x1461('0x7')](e,emitEvent(event));}}module[_0x1461('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 184de14..f30eb59 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 _0xe4a4=['api','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2fec8a,_0xb58bb7){var _0x3e02ba=function(_0x5790df){while(--_0x5790df){_0x2fec8a['push'](_0x2fec8a['shift']());}};_0x3e02ba(++_0xb58bb7);}(_0xe4a4,0x11b));var _0x4e4a=function(_0x2e2e41,_0x3a7848){_0x2e2e41=_0x2e2e41-0x0;var _0x266226=_0xe4a4[_0x2e2e41];return _0x266226;};'use strict';var _=require(_0x4e4a('0x0'));var util=require(_0x4e4a('0x1'));var logger=require(_0x4e4a('0x2'))(_0x4e4a('0x3'));var moment=require('moment');var BPromise=require(_0x4e4a('0x4'));var rp=require(_0x4e4a('0x5'));var fs=require('fs');var path=require(_0x4e4a('0x6'));var rimraf=require(_0x4e4a('0x7'));var config=require(_0x4e4a('0x8'));var attributes=require(_0x4e4a('0x9'));module['exports']=function(_0x1b8115,_0x2adc15){return _0x1b8115['define']('UserNotification',attributes,{'tableName':_0x4e4a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4e4a('0xb'),'collate':_0x4e4a('0xc')});}; \ No newline at end of file +var _0x44ce=['UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','../../config/environment','./userNotification.attributes','exports'];(function(_0x2b66ed,_0x3ece7f){var _0x860fe6=function(_0x5a2ff7){while(--_0x5a2ff7){_0x2b66ed['push'](_0x2b66ed['shift']());}};_0x860fe6(++_0x3ece7f);}(_0x44ce,0x160));var _0xe44c=function(_0x2eb38f,_0x17b21e){_0x2eb38f=_0x2eb38f-0x0;var _0x179f7e=_0x44ce[_0x2eb38f];return _0x179f7e;};'use strict';var _=require(_0xe44c('0x0'));var util=require(_0xe44c('0x1'));var logger=require('../../config/logger')(_0xe44c('0x2'));var moment=require(_0xe44c('0x3'));var BPromise=require(_0xe44c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe44c('0x5'));var attributes=require(_0xe44c('0x6'));module[_0xe44c('0x7')]=function(_0x475bb6,_0x369743){return _0x475bb6['define'](_0xe44c('0x8'),attributes,{'tableName':_0xe44c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe44c('0xa'),'collate':_0xe44c('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 25d6686..9382fed 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 _0x7cde=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5be7aa,_0x5de661){var _0x215408=function(_0x353715){while(--_0x353715){_0x5be7aa['push'](_0x5be7aa['shift']());}};_0x215408(++_0x5de661);}(_0x7cde,0xff));var _0xe7cd=function(_0x54c22,_0x5e5e42){_0x54c22=_0x54c22-0x0;var _0x333ddc=_0x7cde[_0x54c22];return _0x333ddc;};'use strict';var _=require(_0xe7cd('0x0'));var util=require(_0xe7cd('0x1'));var moment=require(_0xe7cd('0x2'));var BPromise=require(_0xe7cd('0x3'));var rs=require(_0xe7cd('0x4'));var fs=require('fs');var Redis=require(_0xe7cd('0x5'));var db=require(_0xe7cd('0x6'))['db'];var utils=require(_0xe7cd('0x7'));var logger=require(_0xe7cd('0x8'))(_0xe7cd('0x9'));var config=require(_0xe7cd('0xa'));var jayson=require(_0xe7cd('0xb'));var client=jayson[_0xe7cd('0xc')][_0xe7cd('0xd')]({'port':0x232a});config[_0xe7cd('0xe')]=_[_0xe7cd('0xf')](config[_0xe7cd('0xe')],{'host':_0xe7cd('0x10'),'port':0x18eb});var socket=require(_0xe7cd('0x11'))(new Redis(config[_0xe7cd('0xe')]));require(_0xe7cd('0x12'))['register'](socket);function respondWithRpcPromise(_0xccd8cf,_0x3e7fdf,_0x1aff93){return new BPromise(function(_0x366b9d,_0xbaa1f2){return client[_0xe7cd('0x13')](_0xccd8cf,_0x1aff93)['then'](function(_0x154c01){logger[_0xe7cd('0x14')](_0xe7cd('0x15'),_0x3e7fdf,'request\x20sent');logger[_0xe7cd('0x16')](_0xe7cd('0x17'),_0x3e7fdf,'request\x20sent',JSON[_0xe7cd('0x18')](_0x154c01));if(_0x154c01[_0xe7cd('0x19')]){if(_0x154c01['error']['code']===0x1f4){logger['error'](_0xe7cd('0x15'),_0x3e7fdf,_0x154c01[_0xe7cd('0x19')][_0xe7cd('0x1a')]);return _0xbaa1f2(_0x154c01[_0xe7cd('0x19')]['message']);}logger['error'](_0xe7cd('0x15'),_0x3e7fdf,_0x154c01[_0xe7cd('0x19')][_0xe7cd('0x1a')]);return _0x366b9d(_0x154c01[_0xe7cd('0x19')]['message']);}else{logger[_0xe7cd('0x14')](_0xe7cd('0x15'),_0x3e7fdf,_0xe7cd('0x1b'));_0x366b9d(_0x154c01[_0xe7cd('0x1c')][_0xe7cd('0x1a')]);}})['catch'](function(_0x214e99){logger[_0xe7cd('0x19')](_0xe7cd('0x15'),_0x3e7fdf,_0x214e99);_0xbaa1f2(_0x214e99);});});} \ No newline at end of file +var _0xac15=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4bbaba,_0x15097c){var _0x34ff2b=function(_0x190d49){while(--_0x190d49){_0x4bbaba['push'](_0x4bbaba['shift']());}};_0x34ff2b(++_0x15097c);}(_0xac15,0x9f));var _0x5ac1=function(_0xb6817d,_0x14eb01){_0xb6817d=_0xb6817d-0x0;var _0x481233=_0xac15[_0xb6817d];return _0x481233;};'use strict';var _=require(_0x5ac1('0x0'));var util=require(_0x5ac1('0x1'));var moment=require(_0x5ac1('0x2'));var BPromise=require(_0x5ac1('0x3'));var rs=require(_0x5ac1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ac1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ac1('0x6'));var config=require('../../config/environment');var jayson=require(_0x5ac1('0x7'));var client=jayson[_0x5ac1('0x8')]['http']({'port':0x232a});config[_0x5ac1('0x9')]=_[_0x5ac1('0xa')](config['redis'],{'host':_0x5ac1('0xb'),'port':0x18eb});var socket=require(_0x5ac1('0xc'))(new Redis(config[_0x5ac1('0x9')]));require(_0x5ac1('0xd'))[_0x5ac1('0xe')](socket);function respondWithRpcPromise(_0x334256,_0x5e3637,_0x262687){return new BPromise(function(_0x2dcf7b,_0x2e4355){return client[_0x5ac1('0xf')](_0x334256,_0x262687)['then'](function(_0x3891c7){logger['info'](_0x5ac1('0x10'),_0x5e3637,'request\x20sent');logger['debug'](_0x5ac1('0x11'),_0x5e3637,_0x5ac1('0x12'),JSON[_0x5ac1('0x13')](_0x3891c7));if(_0x3891c7[_0x5ac1('0x14')]){if(_0x3891c7[_0x5ac1('0x14')][_0x5ac1('0x15')]===0x1f4){logger[_0x5ac1('0x14')]('UserNotification,\x20%s,\x20%s',_0x5e3637,_0x3891c7[_0x5ac1('0x14')][_0x5ac1('0x16')]);return _0x2e4355(_0x3891c7[_0x5ac1('0x14')][_0x5ac1('0x16')]);}logger[_0x5ac1('0x14')](_0x5ac1('0x10'),_0x5e3637,_0x3891c7[_0x5ac1('0x14')][_0x5ac1('0x16')]);return _0x2dcf7b(_0x3891c7['error'][_0x5ac1('0x16')]);}else{logger[_0x5ac1('0x17')](_0x5ac1('0x10'),_0x5e3637,_0x5ac1('0x12'));_0x2dcf7b(_0x3891c7[_0x5ac1('0x18')][_0x5ac1('0x16')]);}})[_0x5ac1('0x19')](function(_0x4b0b54){logger[_0x5ac1('0x14')]('UserNotification,\x20%s,\x20%s',_0x5e3637,_0x4b0b54);_0x2e4355(_0x4b0b54);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 6706744..6ce2478 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 _0x91ff=['save','remove','update','emit','removeListener','register','length','userNotification:','./userNotification.events'];(function(_0x455ba1,_0x50ac00){var _0xebe1c2=function(_0x40f0bc){while(--_0x40f0bc){_0x455ba1['push'](_0x455ba1['shift']());}};_0xebe1c2(++_0x50ac00);}(_0x91ff,0x1c1));var _0xf91f=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0x91ff[_0x3df223];return _0x562d11;};'use strict';var UserNotificationEvents=require(_0xf91f('0x0'));var events=[_0xf91f('0x1'),_0xf91f('0x2'),_0xf91f('0x3')];function createListener(_0x2dcc4b,_0x324564){return function(_0x56e712){_0x324564[_0xf91f('0x4')](_0x2dcc4b,_0x56e712);};}function removeListener(_0x57525c,_0x4131d7){return function(){UserNotificationEvents[_0xf91f('0x5')](_0x57525c,_0x4131d7);};}exports[_0xf91f('0x6')]=function(_0x2796f9){for(var _0x16a6b3=0x0,_0x4b0b1e=events[_0xf91f('0x7')];_0x16a6b3<_0x4b0b1e;_0x16a6b3++){var _0x13d2d=events[_0x16a6b3];var _0x306b3a=createListener(_0xf91f('0x8')+_0x13d2d,_0x2796f9);UserNotificationEvents['on'](_0x13d2d,_0x306b3a);}}; \ No newline at end of file +var _0xd1f6=['save','update','length','./userNotification.events'];(function(_0x4ac41e,_0x2d0837){var _0x1a0a13=function(_0x1341f4){while(--_0x1341f4){_0x4ac41e['push'](_0x4ac41e['shift']());}};_0x1a0a13(++_0x2d0837);}(_0xd1f6,0xcb));var _0x6d1f=function(_0x386508,_0x40d1fe){_0x386508=_0x386508-0x0;var _0xa9fc9=_0xd1f6[_0x386508];return _0xa9fc9;};'use strict';var UserNotificationEvents=require(_0x6d1f('0x0'));var events=[_0x6d1f('0x1'),'remove',_0x6d1f('0x2')];function createListener(_0x377007,_0x188334){return function(_0x184ea3){_0x188334['emit'](_0x377007,_0x184ea3);};}function removeListener(_0x3e6b62,_0x5c3b60){return function(){UserNotificationEvents['removeListener'](_0x3e6b62,_0x5c3b60);};}exports['register']=function(_0x3a4fc3){for(var _0x17e31f=0x0,_0x126e92=events[_0x6d1f('0x3')];_0x17e31f<_0x126e92;_0x17e31f++){var _0x578b19=events[_0x17e31f];var _0x3aa8c3=createListener('userNotification:'+_0x578b19,_0x3a4fc3);UserNotificationEvents['on'](_0x578b19,_0x3aa8c3);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 895cba0..23f69a4 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x39c12e,_0x585534){var _0x58dbf4=function(_0xd35390){while(--_0xd35390){_0x39c12e['push'](_0x39c12e['shift']());}};_0x58dbf4(++_0x585534);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4c384b,_0x2ee262){var _0x29ee3d=function(_0xc8c652){while(--_0xc8c652){_0x4c384b['push'](_0x4c384b['shift']());}};_0x29ee3d(++_0x2ee262);}(_0x70e0,0x17b));var _0x070e=function(_0x7461d2,_0x453d5d){_0x7461d2=_0x7461d2-0x0;var _0x487889=_0x70e0[_0x7461d2];return _0x487889;};'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 0201975..5e346cf 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 _0xc3b1=['INTEGER','sequelize'];(function(_0xa3bd04,_0x3db612){var _0x352934=function(_0x1d0dd6){while(--_0x1d0dd6){_0xa3bd04['push'](_0xa3bd04['shift']());}};_0x352934(++_0x3db612);}(_0xc3b1,0xc9));var _0x1c3b=function(_0x47e77c,_0x39e06b){_0x47e77c=_0x47e77c-0x0;var _0x11910f=_0xc3b1[_0x47e77c];return _0x11910f;};'use strict';var Sequelize=require(_0x1c3b('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1c3b('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfd8f=['sequelize','exports'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xfd8f,0xae));var _0xffd8=function(_0x69ee2b,_0x2efd11){_0x69ee2b=_0x69ee2b-0x0;var _0x551e19=_0xfd8f[_0x69ee2b];return _0x551e19;};'use strict';var Sequelize=require(_0xffd8('0x0'));module[_0xffd8('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 02c61b3..7bb212f 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 _0xc35b=['request-promise','path','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc35b,0x1b4));var _0xbc35=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xc35b[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0xbc35('0x0'));var util=require(_0xbc35('0x1'));var logger=require(_0xbc35('0x2'))('api');var moment=require(_0xbc35('0x3'));var BPromise=require('bluebird');var rp=require(_0xbc35('0x4'));var fs=require('fs');var path=require(_0xbc35('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbc35('0x6'));module[_0xbc35('0x7')]=function(_0x432c01,_0x224d09){return _0x432c01['define'](_0xbc35('0x8'),attributes,{'tableName':_0xbc35('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0868=['user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','UserOpenchannelQueue'];(function(_0x518e15,_0x568735){var _0x3bd658=function(_0x6a579f){while(--_0x6a579f){_0x518e15['push'](_0x518e15['shift']());}};_0x3bd658(++_0x568735);}(_0x0868,0x12c));var _0x8086=function(_0x13134f,_0x2263d8){_0x13134f=_0x13134f-0x0;var _0x518d79=_0x0868[_0x13134f];return _0x518d79;};'use strict';var _=require(_0x8086('0x0'));var util=require(_0x8086('0x1'));var logger=require(_0x8086('0x2'))(_0x8086('0x3'));var moment=require(_0x8086('0x4'));var BPromise=require(_0x8086('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8086('0x6'));var rimraf=require(_0x8086('0x7'));var config=require(_0x8086('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x8086('0x9')]=function(_0xd208fe,_0x42ce0e){return _0xd208fe[_0x8086('0xa')](_0x8086('0xb'),attributes,{'tableName':_0x8086('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 49543ff..5cf8b57 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 _0xf25d=['../../config/utils','rpc','jayson/promise','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','util','moment','bluebird','randomstring'];(function(_0x1aab74,_0x38a57b){var _0x396af2=function(_0x1c2e0d){while(--_0x1c2e0d){_0x1aab74['push'](_0x1aab74['shift']());}};_0x396af2(++_0x38a57b);}(_0xf25d,0xf3));var _0xdf25=function(_0x225216,_0x2cdac4){_0x225216=_0x225216-0x0;var _0x878839=_0xf25d[_0x225216];return _0x878839;};'use strict';var _=require('lodash');var util=require(_0xdf25('0x0'));var moment=require(_0xdf25('0x1'));var BPromise=require(_0xdf25('0x2'));var rs=require(_0xdf25('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdf25('0x4'));var logger=require('../../config/logger')(_0xdf25('0x5'));var config=require('../../config/environment');var jayson=require(_0xdf25('0x6'));var client=jayson[_0xdf25('0x7')][_0xdf25('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27c09d,_0x1e9ba1,_0x2b1ecf){return new BPromise(function(_0x453b64,_0x3d3d3a){return client[_0xdf25('0x9')](_0x27c09d,_0x2b1ecf)[_0xdf25('0xa')](function(_0x3bbd5c){logger['info'](_0xdf25('0xb'),_0x1e9ba1,_0xdf25('0xc'));logger[_0xdf25('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1e9ba1,_0xdf25('0xc'),JSON['stringify'](_0x3bbd5c));if(_0x3bbd5c[_0xdf25('0xe')]){if(_0x3bbd5c[_0xdf25('0xe')][_0xdf25('0xf')]===0x1f4){logger[_0xdf25('0xe')](_0xdf25('0xb'),_0x1e9ba1,_0x3bbd5c['error'][_0xdf25('0x10')]);return _0x3d3d3a(_0x3bbd5c['error'][_0xdf25('0x10')]);}logger[_0xdf25('0xe')](_0xdf25('0xb'),_0x1e9ba1,_0x3bbd5c[_0xdf25('0xe')][_0xdf25('0x10')]);return _0x453b64(_0x3bbd5c[_0xdf25('0xe')][_0xdf25('0x10')]);}else{logger[_0xdf25('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1e9ba1,_0xdf25('0xc'));_0x453b64(_0x3bbd5c['result'][_0xdf25('0x10')]);}})[_0xdf25('0x12')](function(_0x5bf565){logger[_0xdf25('0xe')](_0xdf25('0xb'),_0x1e9ba1,_0x5bf565);_0x3d3d3a(_0x5bf565);});});} \ No newline at end of file +var _0x29e6=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x51acf0,_0x4e17c0){var _0x249f8e=function(_0x59bf73){while(--_0x59bf73){_0x51acf0['push'](_0x51acf0['shift']());}};_0x249f8e(++_0x4e17c0);}(_0x29e6,0x1a4));var _0x629e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x29e6[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x629e('0x0'));var moment=require(_0x629e('0x1'));var BPromise=require('bluebird');var rs=require(_0x629e('0x2'));var fs=require('fs');var Redis=require(_0x629e('0x3'));var db=require(_0x629e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x629e('0x5'))(_0x629e('0x6'));var config=require(_0x629e('0x7'));var jayson=require(_0x629e('0x8'));var client=jayson[_0x629e('0x9')][_0x629e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ee277,_0x1cf285,_0x2b40c4){return new BPromise(function(_0x1a866b,_0x5c226d){return client[_0x629e('0xb')](_0x2ee277,_0x2b40c4)[_0x629e('0xc')](function(_0x5bdd36){logger[_0x629e('0xd')](_0x629e('0xe'),_0x1cf285,_0x629e('0xf'));logger[_0x629e('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1cf285,_0x629e('0xf'),JSON['stringify'](_0x5bdd36));if(_0x5bdd36[_0x629e('0x11')]){if(_0x5bdd36['error'][_0x629e('0x12')]===0x1f4){logger['error'](_0x629e('0xe'),_0x1cf285,_0x5bdd36['error'][_0x629e('0x13')]);return _0x5c226d(_0x5bdd36['error']['message']);}logger['error'](_0x629e('0xe'),_0x1cf285,_0x5bdd36[_0x629e('0x11')]['message']);return _0x1a866b(_0x5bdd36[_0x629e('0x11')][_0x629e('0x13')]);}else{logger[_0x629e('0xd')](_0x629e('0xe'),_0x1cf285,'request\x20sent');_0x1a866b(_0x5bdd36[_0x629e('0x14')][_0x629e('0x13')]);}})['catch'](function(_0x3947f2){logger[_0x629e('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1cf285,_0x3947f2);_0x5c226d(_0x3947f2);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 1754967..d669d63 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 _0x577c=['getResources','post','create','/:id/clone','addResources','delete','removeSections','removeResources','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','get','/describe','describe','/:id','show','/:id/sections','/:id/resources'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x577c,0xb1));var _0xc577=function(_0x261272,_0x38d320){_0x261272=_0x261272-0x0;var _0xf9d969=_0x577c[_0x261272];return _0xf9d969;};'use strict';var multer=require(_0xc577('0x0'));var util=require(_0xc577('0x1'));var path=require('path');var timeout=require(_0xc577('0x2'));var express=require(_0xc577('0x3'));var router=express[_0xc577('0x4')]();var fs_extra=require(_0xc577('0x5'));var auth=require(_0xc577('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfile.controller');router['get']('/',auth[_0xc577('0x7')](),controller['index']);router[_0xc577('0x8')](_0xc577('0x9'),auth[_0xc577('0x7')](),controller[_0xc577('0xa')]);router['get'](_0xc577('0xb'),auth['isAuthenticated'](),controller[_0xc577('0xc')]);router[_0xc577('0x8')](_0xc577('0xd'),auth[_0xc577('0x7')](),controller['getSections']);router[_0xc577('0x8')](_0xc577('0xe'),auth[_0xc577('0x7')](),controller[_0xc577('0xf')]);router[_0xc577('0x10')]('/',auth[_0xc577('0x7')](),controller[_0xc577('0x11')]);router[_0xc577('0x10')](_0xc577('0x12'),auth[_0xc577('0x7')](),controller['clone']);router[_0xc577('0x10')](_0xc577('0xd'),auth[_0xc577('0x7')](),controller['addSections']);router[_0xc577('0x10')](_0xc577('0xe'),auth[_0xc577('0x7')](),controller[_0xc577('0x13')]);router['put']('/:id',auth[_0xc577('0x7')](),controller['update']);router[_0xc577('0x14')](_0xc577('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xc577('0x14')](_0xc577('0xd'),auth[_0xc577('0x7')](),controller[_0xc577('0x15')]);router[_0xc577('0x14')](_0xc577('0xe'),auth['isAuthenticated'](),controller[_0xc577('0x16')]);module[_0xc577('0x17')]=router; \ No newline at end of file +var _0x4783=['Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone','clone','addSections','addResources','put','destroy','delete','removeSections','removeResources','exports','util','path','connect-timeout','express'];(function(_0x1b1201,_0x50f6c4){var _0x3259cf=function(_0x284f34){while(--_0x284f34){_0x1b1201['push'](_0x1b1201['shift']());}};_0x3259cf(++_0x50f6c4);}(_0x4783,0xce));var _0x3478=function(_0x267ad0,_0x3fe5fe){_0x267ad0=_0x267ad0-0x0;var _0x130d2f=_0x4783[_0x267ad0];return _0x130d2f;};'use strict';var multer=require('multer');var util=require(_0x3478('0x0'));var path=require(_0x3478('0x1'));var timeout=require(_0x3478('0x2'));var express=require(_0x3478('0x3'));var router=express[_0x3478('0x4')]();var fs_extra=require(_0x3478('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3478('0x6'));var config=require(_0x3478('0x7'));var controller=require(_0x3478('0x8'));router['get']('/',auth[_0x3478('0x9')](),controller[_0x3478('0xa')]);router[_0x3478('0xb')](_0x3478('0xc'),auth[_0x3478('0x9')](),controller['describe']);router['get'](_0x3478('0xd'),auth[_0x3478('0x9')](),controller[_0x3478('0xe')]);router[_0x3478('0xb')](_0x3478('0xf'),auth[_0x3478('0x9')](),controller[_0x3478('0x10')]);router[_0x3478('0xb')](_0x3478('0x11'),auth[_0x3478('0x9')](),controller[_0x3478('0x12')]);router['post']('/',auth[_0x3478('0x9')](),controller['create']);router[_0x3478('0x13')](_0x3478('0x14'),auth[_0x3478('0x9')](),controller[_0x3478('0x15')]);router[_0x3478('0x13')](_0x3478('0xf'),auth['isAuthenticated'](),controller[_0x3478('0x16')]);router[_0x3478('0x13')](_0x3478('0x11'),auth[_0x3478('0x9')](),controller[_0x3478('0x17')]);router[_0x3478('0x18')](_0x3478('0xd'),auth[_0x3478('0x9')](),controller['update']);router['delete']('/:id',auth[_0x3478('0x9')](),controller[_0x3478('0x19')]);router[_0x3478('0x1a')](_0x3478('0xf'),auth[_0x3478('0x9')](),controller[_0x3478('0x1b')]);router[_0x3478('0x1a')](_0x3478('0x11'),auth['isAuthenticated'](),controller[_0x3478('0x1c')]);module[_0x3478('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 35d4c9d..ef2e870 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 _0xe27d=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','crudPermissions'];(function(_0x16db81,_0x43cc11){var _0x21f185=function(_0xf06047){while(--_0xf06047){_0x16db81['push'](_0x16db81['shift']());}};_0x21f185(++_0x43cc11);}(_0xe27d,0xe5));var _0xde27=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xe27d[_0x474bc0];return _0x4b24cf;};'use strict';var Sequelize=require(_0xde27('0x0'));module[_0xde27('0x1')]={'name':{'type':Sequelize[_0xde27('0x2')],'allowNull':![],'unique':_0xde27('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4f92ff){this['setDataValue'](_0xde27('0x4'),_0x4f92ff?_0x4f92ff[_0xde27('0x5')](''):[]);},'get':function(){return this[_0xde27('0x6')](_0xde27('0x4'))?this[_0xde27('0x6')](_0xde27('0x4'))[_0xde27('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xde27('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xde27('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xde27('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xde27('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xde27('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xde27('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xde27('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4a37=['STRING','name','setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x97e10c,_0x40a60d){var _0x2032c6=function(_0x208696){while(--_0x208696){_0x97e10c['push'](_0x97e10c['shift']());}};_0x2032c6(++_0x40a60d);}(_0x4a37,0x154));var _0x74a3=function(_0x80b53b,_0x3d72be){_0x80b53b=_0x80b53b-0x0;var _0x24a9db=_0x4a37[_0x80b53b];return _0x24a9db;};'use strict';var Sequelize=require(_0x74a3('0x0'));module[_0x74a3('0x1')]={'name':{'type':Sequelize[_0x74a3('0x2')],'allowNull':![],'unique':_0x74a3('0x3')},'crudPermissions':{'type':Sequelize[_0x74a3('0x2')],'set':function(_0x5a09f4){this[_0x74a3('0x4')](_0x74a3('0x5'),_0x5a09f4?_0x5a09f4['join'](''):[]);},'get':function(){return this[_0x74a3('0x6')]('crudPermissions')?this[_0x74a3('0x6')]('crudPermissions')[_0x74a3('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x74a3('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x74a3('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x74a3('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x74a3('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x74a3('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x74a3('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x74a3('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index d4bd212..1ce6c90 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 _0x80b0=['No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create','body','clone','length','include','get','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','Resources','update','describe','sectionId','userProfileId','push','removeSections','ids','enabled','includes','subsections','concat','findOne','Dashboard','resourceId','Plugin','forEach','bulkCreate','removeResources','section'];(function(_0x40eec0,_0x12ed0c){var _0x233e50=function(_0x921eb5){while(--_0x921eb5){_0x40eec0['push'](_0x40eec0['shift']());}};_0x233e50(++_0x12ed0c);}(_0x80b0,0x152));var _0x080b=function(_0x127a10,_0x57b1be){_0x127a10=_0x127a10-0x0;var _0x2dbb6d=_0x80b0[_0x127a10];return _0x2dbb6d;};'use strict';var emlformat=require(_0x080b('0x0'));var rimraf=require(_0x080b('0x1'));var zipdir=require(_0x080b('0x2'));var jsonpatch=require(_0x080b('0x3'));var rp=require(_0x080b('0x4'));var moment=require(_0x080b('0x5'));var BPromise=require(_0x080b('0x6'));var Mustache=require('mustache');var util=require(_0x080b('0x7'));var path=require('path');var sox=require(_0x080b('0x8'));var csv=require(_0x080b('0x9'));var ejs=require(_0x080b('0xa'));var fs=require('fs');var fs_extra=require(_0x080b('0xb'));var _=require(_0x080b('0xc'));var squel=require(_0x080b('0xd'));var crypto=require('crypto');var jsforce=require(_0x080b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x080b('0x9'));var querystring=require('querystring');var Papa=require(_0x080b('0xf'));var Redis=require(_0x080b('0x10'));var authService=require(_0x080b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x080b('0x12'));var hardwareService=require(_0x080b('0x13'));var logger=require(_0x080b('0x14'))(_0x080b('0x15'));var utils=require(_0x080b('0x16'));var config=require(_0x080b('0x17'));var licenseUtil=require(_0x080b('0x18'));var db=require(_0x080b('0x19'))['db'];config[_0x080b('0x1a')]=_['defaults'](config['redis'],{'host':_0x080b('0x1b'),'port':0x18eb});var socket=require(_0x080b('0x1c'))(new Redis(config['redis']));require('./userProfile.socket')[_0x080b('0x1d')](socket);function respondWithStatusCode(_0x3f705f,_0x3aad9b){_0x3aad9b=_0x3aad9b||0xcc;return function(_0x1f04b8){if(_0x1f04b8){return _0x3f705f[_0x080b('0x1e')](_0x3aad9b);}return _0x3f705f[_0x080b('0x1f')](_0x3aad9b)[_0x080b('0x20')]();};}function respondWithResult(_0x407932,_0x28212b){_0x28212b=_0x28212b||0xc8;return function(_0x102bba){if(_0x102bba){return _0x407932[_0x080b('0x1f')](_0x28212b)[_0x080b('0x21')](_0x102bba);}};}function respondWithFilteredResult(_0x4fc7a2,_0x5f2fc3){return function(_0x2e8a0f){if(_0x2e8a0f){var _0x2e7885=typeof _0x5f2fc3[_0x080b('0x22')]===_0x080b('0x23')&&typeof _0x5f2fc3[_0x080b('0x24')]===_0x080b('0x23');var _0x2b9817=_0x2e8a0f[_0x080b('0x25')];var _0x1f77cc=_0x2e7885?0x0:_0x5f2fc3[_0x080b('0x22')];var _0x1760f9=_0x2e7885?_0x2e8a0f[_0x080b('0x25')]:_0x5f2fc3[_0x080b('0x22')]+_0x5f2fc3['limit'];var _0x297eb1;if(_0x1760f9>=_0x2b9817){_0x1760f9=_0x2b9817;_0x297eb1=0xc8;}else{_0x297eb1=0xce;}_0x4fc7a2[_0x080b('0x1f')](_0x297eb1);return _0x4fc7a2[_0x080b('0x26')](_0x080b('0x27'),_0x1f77cc+'-'+_0x1760f9+'/'+_0x2b9817)['json'](_0x2e8a0f);}return null;};}function patchUpdates(_0x78190d){return function(_0x41c248){try{jsonpatch[_0x080b('0x28')](_0x41c248,_0x78190d,!![]);}catch(_0x1b7e9a){return BPromise['reject'](_0x1b7e9a);}return _0x41c248['save']();};}function saveUpdates(_0x3ec34d,_0x14e44e){return function(_0x4dd16d){if(_0x4dd16d){return _0x4dd16d['update'](_0x3ec34d)[_0x080b('0x29')](function(_0x18f835){return _0x18f835;});}return null;};}function removeEntity(_0x23c7de,_0x3e0430){return function(_0x1d4f20){if(_0x1d4f20){return _0x1d4f20[_0x080b('0x2a')]()[_0x080b('0x29')](function(){_0x23c7de['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39fd99,_0x9d09f0){return function(_0x26cf2f){if(!_0x26cf2f){_0x39fd99['sendStatus'](0x194);}return _0x26cf2f;};}function handleError(_0x3d9360,_0x527b44){_0x527b44=_0x527b44||0x1f4;return function(_0x381806){logger[_0x080b('0x2b')](_0x381806['stack']);if(_0x381806[_0x080b('0x2c')]){delete _0x381806[_0x080b('0x2c')];}_0x3d9360[_0x080b('0x1f')](_0x527b44)[_0x080b('0x2d')](_0x381806);};}exports['index']=function(_0x29f47a,_0x27e0f8){var _0x370db3={},_0x66c124={},_0x346bd0={'count':0x0,'rows':[]};var _0x336bf0=_[_0x080b('0x2e')](db[_0x080b('0x2f')][_0x080b('0x30')],function(_0x30d6e3){return{'name':_0x30d6e3[_0x080b('0x31')],'type':_0x30d6e3[_0x080b('0x32')][_0x080b('0x33')]};});_0x66c124[_0x080b('0x34')]=_[_0x080b('0x2e')](_0x336bf0,_0x080b('0x2c'));_0x66c124[_0x080b('0x35')]=_[_0x080b('0x36')](_0x29f47a[_0x080b('0x35')]);_0x66c124[_0x080b('0x37')]=_['intersection'](_0x66c124[_0x080b('0x34')],_0x66c124['query']);_0x370db3['attributes']=_[_0x080b('0x38')](_0x66c124[_0x080b('0x34')],qs[_0x080b('0x39')](_0x29f47a[_0x080b('0x35')]['fields']));_0x370db3[_0x080b('0x3a')]=_0x370db3['attributes']['length']?_0x370db3[_0x080b('0x3a')]:_0x66c124[_0x080b('0x34')];if(!_0x29f47a[_0x080b('0x35')][_0x080b('0x3b')](_0x080b('0x3c'))){_0x370db3[_0x080b('0x24')]=qs['limit'](_0x29f47a[_0x080b('0x35')][_0x080b('0x24')]);_0x370db3['offset']=qs[_0x080b('0x22')](_0x29f47a[_0x080b('0x35')][_0x080b('0x22')]);}_0x370db3[_0x080b('0x3d')]=qs['sort'](_0x29f47a[_0x080b('0x35')][_0x080b('0x3e')]);_0x370db3[_0x080b('0x3f')]=qs[_0x080b('0x37')](_['pick'](_0x29f47a['query'],_0x66c124[_0x080b('0x37')]),_0x336bf0);if(_0x29f47a[_0x080b('0x35')][_0x080b('0x40')]){_0x370db3['where']=_[_0x080b('0x41')](_0x370db3[_0x080b('0x3f')],{'$or':_['map'](_0x336bf0,function(_0x349cef){if(_0x349cef['type']!==_0x080b('0x42')){var _0x2cf397={};_0x2cf397[_0x349cef[_0x080b('0x2c')]]={'$like':'%'+_0x29f47a[_0x080b('0x35')]['filter']+'%'};return _0x2cf397;}})});}_0x370db3=_[_0x080b('0x41')]({},_0x370db3,_0x29f47a[_0x080b('0x43')]);var _0x5a651d={'where':_0x370db3['where']};return db[_0x080b('0x2f')][_0x080b('0x25')](_0x5a651d)[_0x080b('0x29')](function(_0x238e13){_0x346bd0[_0x080b('0x25')]=_0x238e13;if(_0x29f47a['query'][_0x080b('0x44')]){_0x370db3['include']=[{'all':!![]}];}return db[_0x080b('0x2f')][_0x080b('0x45')](_0x370db3);})[_0x080b('0x29')](function(_0x2a113f){_0x346bd0['rows']=_0x2a113f;return _0x346bd0;})[_0x080b('0x29')](respondWithFilteredResult(_0x27e0f8,_0x370db3))[_0x080b('0x46')](handleError(_0x27e0f8,null));};exports[_0x080b('0x47')]=function(_0xdf2e9a,_0x18cf57){var _0x6085d5={'raw':![],'where':{'id':_0xdf2e9a[_0x080b('0x48')]['id']}},_0x45d5c0={};_0x45d5c0[_0x080b('0x34')]=_[_0x080b('0x36')](db['UserProfile'][_0x080b('0x30')]);_0x45d5c0['query']=_['keys'](_0xdf2e9a[_0x080b('0x35')]);_0x45d5c0[_0x080b('0x37')]=_[_0x080b('0x38')](_0x45d5c0[_0x080b('0x34')],_0x45d5c0[_0x080b('0x35')]);_0x6085d5['attributes']=_[_0x080b('0x38')](_0x45d5c0[_0x080b('0x34')],qs[_0x080b('0x39')](_0xdf2e9a['query'][_0x080b('0x39')]));_0x6085d5[_0x080b('0x3a')]=_0x6085d5[_0x080b('0x3a')]['length']?_0x6085d5[_0x080b('0x3a')]:_0x45d5c0[_0x080b('0x34')];if(_0xdf2e9a[_0x080b('0x35')][_0x080b('0x44')]){_0x6085d5['include']=[{'all':!![]}];}_0x6085d5=_['merge']({},_0x6085d5,_0xdf2e9a[_0x080b('0x43')]);return db[_0x080b('0x2f')][_0x080b('0x49')](_0x6085d5)[_0x080b('0x29')](handleEntityNotFound(_0x18cf57,null))[_0x080b('0x29')](respondWithResult(_0x18cf57,null))[_0x080b('0x46')](handleError(_0x18cf57,null));};exports[_0x080b('0x4a')]=function(_0x64d72e,_0x1bc5a9){return db[_0x080b('0x2f')]['create'](_0x64d72e[_0x080b('0x4b')],{})[_0x080b('0x29')](respondWithResult(_0x1bc5a9,0xc9))['catch'](handleError(_0x1bc5a9,null));};exports[_0x080b('0x4c')]=function(_0xe2c018,_0x20f725){var _0x375dd8={'where':{'id':_0xe2c018['params']['id']}},_0x2e6673={};_0x2e6673[_0x080b('0x34')]=_[_0x080b('0x36')](db[_0x080b('0x2f')][_0x080b('0x30')]);_0x375dd8[_0x080b('0x3a')]=_[_0x080b('0x38')](_0x2e6673['model'],qs[_0x080b('0x39')](_0xe2c018['query'][_0x080b('0x39')]));_0x375dd8['attributes']=_0x375dd8[_0x080b('0x3a')][_0x080b('0x4d')]?_0x375dd8[_0x080b('0x3a')]:_0x2e6673[_0x080b('0x34')];if(_0xe2c018[_0x080b('0x35')]['includeAll']){_0x375dd8[_0x080b('0x4e')]=[{'all':!![]}];}_0x375dd8=_[_0x080b('0x41')]({},_0x375dd8,_0xe2c018[_0x080b('0x43')]);return db[_0x080b('0x2f')][_0x080b('0x49')](_0x375dd8)['then'](handleEntityNotFound(_0x20f725,null))['then'](function(_0x4b09bd){if(_0x4b09bd){var _0x799f9f=_0x4b09bd[_0x080b('0x4f')]({'plain':!![]});_0x799f9f=qs['omit'](_0x799f9f,['id',_0x080b('0x50'),_0x080b('0x51'),_0x080b('0x52')]);_0xe2c018['body']=_[_0x080b('0x53')](_0xe2c018[_0x080b('0x4b')],['id','createdAt',_0x080b('0x51')]);return db[_0x080b('0x54')][_0x080b('0x55')](function(_0x370204){return db[_0x080b('0x2f')][_0x080b('0x4a')](_[_0x080b('0x41')](_0x799f9f,_0xe2c018[_0x080b('0x4b')]),{'include':_0xe2c018[_0x080b('0x35')][_0x080b('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x370204})[_0x080b('0x29')](function(_0x48222c){var _0x45bae6=_0x48222c[_0x080b('0x4f')]({'plain':!![]});return db[_0x080b('0x56')][_0x080b('0x45')]({'where':{'userProfileId':_0xe2c018['params']['id']},'raw':!![]})[_0x080b('0x29')](function(_0x36cfb4){if(_0x36cfb4){return BPromise[_0x080b('0x57')](_0x36cfb4,function(_0x1fa792){return new BPromise(function(_0x6e43eb,_0x2658ca){if(_0x1fa792[_0x080b('0x58')]===null||_0x1fa792[_0x080b('0x58')]===0x1)_0x6e43eb(null);return db[_0x080b('0x59')]['findAll']({'where':{'sectionId':_0x1fa792['id']},'raw':!![]})[_0x080b('0x29')](function(_0x3be5ee){var _0x2ceac3=_['map'](_0x3be5ee,function(_0xbb3c81){return qs[_0x080b('0x53')](_0xbb3c81,['id',_0x080b('0x50'),_0x080b('0x51'),'sectionId']);});_0x6e43eb(_0x2ceac3);})[_0x080b('0x46')](function(_0x5bb6ca){_0x2658ca(_0x5bb6ca);});})[_0x080b('0x29')](function(_0x5afd20){var _0x467a67=qs[_0x080b('0x53')](_0x1fa792,['id',_0x080b('0x50'),'updatedAt']);_0x467a67['userProfileId']=_0x45bae6['id'];if(_0x5afd20)_0x467a67[_0x080b('0x5a')]=_0x5afd20;return _0x467a67;})[_0x080b('0x29')](function(_0x169817){return db['UserProfileSection'][_0x080b('0x4a')](_0x169817,{'include':[{'model':db[_0x080b('0x59')],'as':_0x080b('0x5a')}],'raw':!![],'transaction':_0x370204});});})['then'](function(){return _0x45bae6;});}});});});}})[_0x080b('0x29')](respondWithResult(_0x20f725,0xc9))[_0x080b('0x46')](handleError(_0x20f725,null));};exports[_0x080b('0x5b')]=function(_0x1b2a53,_0x19e460){if(_0x1b2a53['body']['id']){delete _0x1b2a53[_0x080b('0x4b')]['id'];}return db[_0x080b('0x2f')]['find']({'where':{'id':_0x1b2a53['params']['id']}})['then'](handleEntityNotFound(_0x19e460,null))[_0x080b('0x29')](saveUpdates(_0x1b2a53[_0x080b('0x4b')],null))[_0x080b('0x29')](respondWithResult(_0x19e460,null))[_0x080b('0x46')](handleError(_0x19e460,null));};exports['destroy']=function(_0x9f6c1d,_0x355680){return db[_0x080b('0x2f')][_0x080b('0x49')]({'where':{'id':_0x9f6c1d[_0x080b('0x48')]['id']}})[_0x080b('0x29')](handleEntityNotFound(_0x355680,null))[_0x080b('0x29')](removeEntity(_0x355680,null))[_0x080b('0x46')](handleError(_0x355680,null));};exports[_0x080b('0x5c')]=function(_0xd96c2d,_0x480b1b){return db['UserProfile'][_0x080b('0x5c')]()[_0x080b('0x29')](respondWithResult(_0x480b1b,null))['catch'](handleError(_0x480b1b,null));};exports['addSections']=function(_0x20f98c,_0x4d272b){var _0x15b763=_0x20f98c[_0x080b('0x4b')];return db[_0x080b('0x2f')][_0x080b('0x49')]({'where':{'id':_0x20f98c['params']['id']}})[_0x080b('0x29')](handleEntityNotFound(_0x4d272b,null))[_0x080b('0x29')](function(_0x370958){if(_0x370958){return db['sequelize']['transaction'](function(_0xdb64b7){return db[_0x080b('0x56')][_0x080b('0x2a')]({'where':{'userProfileId':_0x20f98c['params']['id'],'sectionId':_['map'](_0x15b763,function(_0x333436){return _0x333436[_0x080b('0x5d')];})},'transaction':_0xdb64b7})[_0x080b('0x29')](function(){var _0x413229=_[_0x080b('0x2e')](_0x15b763,function(_0x445b0b){_0x445b0b[_0x080b('0x5e')]=_0x20f98c[_0x080b('0x48')]['id'];return _0x445b0b;});var _0x259a6b=[];return BPromise[_0x080b('0x57')](_0x413229,function(_0xd49c5c){return db['UserProfileSection']['create'](_0xd49c5c,{'include':[{'model':db['UserProfileResource'],'as':_0x080b('0x5a')}],'raw':!![],'transaction':_0xdb64b7})[_0x080b('0x29')](function(_0x3459a7){_0x259a6b[_0x080b('0x5f')](_0x3459a7[_0x080b('0x4f')]({'plain':!![]}));});})[_0x080b('0x29')](function(){return _0x259a6b;});});});}})[_0x080b('0x29')](function(_0x40339d){return _0x40339d;})['then'](respondWithResult(_0x4d272b,null))[_0x080b('0x46')](handleError(_0x4d272b,null));};exports[_0x080b('0x60')]=function(_0xa52c4,_0xbd0db2){var _0x2d195f;return db[_0x080b('0x2f')][_0x080b('0x49')]({'where':{'id':_0xa52c4['params']['id']},'attributes':['id',_0x080b('0x2c')]})[_0x080b('0x29')](handleEntityNotFound(_0xbd0db2,null))[_0x080b('0x29')](function(_0x59dfe6){if(_0x59dfe6){_0x2d195f=_0x59dfe6;return db[_0x080b('0x56')]['destroy']({'where':{'userProfileId':_0xa52c4[_0x080b('0x48')]['id'],'sectionId':_0xa52c4[_0x080b('0x35')][_0x080b('0x61')]}});}})[_0x080b('0x29')](function(){return _0x2d195f;})[_0x080b('0x29')](respondWithStatusCode(_0xbd0db2,null))[_0x080b('0x46')](handleError(_0xbd0db2,null));};exports['getSections']=function(_0x473e6f,_0x2eee65){var _0x32046f=[];var _0x24b782=[];return db[_0x080b('0x56')][_0x080b('0x45')]({'where':{'userProfileId':_0x473e6f[_0x080b('0x48')]['id']},'raw':!![]})[_0x080b('0x29')](function(_0x4addfc){_0x32046f=_[_0x080b('0x40')](_0x4addfc,function(_0xe0f70f){return _0xe0f70f[_0x080b('0x62')]===0x1||_[_0x080b('0x63')]([0x3eb,0x709],_0xe0f70f[_0x080b('0x5d')]);});if(!_['isEmpty'](_0x32046f)){return _[_0x080b('0x2e')](_0x32046f,function(_0x1eb0c4){return _0x1eb0c4[_0x080b('0x5d')];});}else{return;}})[_0x080b('0x29')](function(_0x2dbe75){if(_0x2dbe75)_0x24b782=_0x2dbe75;if(_[_0x080b('0x63')](_0x24b782,0x64)){var _0x5c88cd=_[_0x080b('0x49')](_0x32046f,{'sectionId':0x64});return hasDefaultDashboard(_0x5c88cd)[_0x080b('0x29')](function(_0x56f7f5){return _[_0x080b('0x2e')](_0x32046f,function(_0x36d029){if(_0x36d029[_0x080b('0x5d')]===0x64){_0x36d029['subsections']=_0x56f7f5;}return _0x36d029;});});}else{return;}})[_0x080b('0x29')](function(_0x2977aa){if(_0x2977aa)_0x32046f=_0x2977aa;if(_[_0x080b('0x63')](_0x24b782,0x3eb)){var _0x299f2b=_[_0x080b('0x49')](_0x32046f,{'sectionId':0x3eb});return getCustomDashboards(_0x299f2b)['then'](function(_0xc7a7af){return _[_0x080b('0x2e')](_0x32046f,function(_0x5f18bc){if(_0x299f2b[_0x080b('0x62')]){if(_0x5f18bc[_0x080b('0x5d')]===0x3eb){_0x5f18bc['subsections']=_0xc7a7af;}}else{if(_0x5f18bc[_0x080b('0x5d')]===0x64){if(!_0x5f18bc[_0x080b('0x64')]){_0x5f18bc['subsections']=[];}_0x5f18bc['subsections']=_0x5f18bc[_0x080b('0x64')][_0x080b('0x65')](_0xc7a7af);}}return _0x5f18bc;});});}else{return;}})[_0x080b('0x29')](function(_0x4b6097){if(_0x4b6097)_0x32046f=_0x4b6097;if(_[_0x080b('0x63')](_0x24b782,0x709)){var _0x4b01f5=_[_0x080b('0x49')](_0x32046f,{'sectionId':0x709});return getPlugins(_0x4b01f5)['then'](function(_0x3f83a0){if(_0x4b01f5[_0x080b('0x62')]){return _['map'](_0x32046f,function(_0x55119c){if(_0x55119c[_0x080b('0x5d')]===0x709){_0x55119c['subsections']=_0x3f83a0;}return _0x55119c;});}else{var _0x92395b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3f83a0};var _0x4938ee=_['map'](_0x32046f);_0x4938ee[_0x080b('0x5f')](_0x92395b);return _0x4938ee;}});}else{return;}})[_0x080b('0x29')](function(_0xe3900a){if(_0xe3900a)_0x32046f=_0xe3900a;return _[_0x080b('0x40')](_0x32046f,[_0x080b('0x62'),0x1]);})[_0x080b('0x29')](respondWithResult(_0x2eee65,null))['catch'](handleError(_0x2eee65,null));};function hasDefaultDashboard(_0x9e83ea){var _0xc84df6=[0x65];return new BPromise(function(_0x80b47a,_0x8e8935){try{if(_0x9e83ea['autoAssociation']){_0x80b47a(_0xc84df6);}else{return db[_0x080b('0x59')][_0x080b('0x66')]({'where':{'sectionId':_0x9e83ea['id']},'raw':!![]})[_0x080b('0x29')](function(_0x5dd0ac){_0x5dd0ac?_0x80b47a(_0xc84df6):_0x80b47a();});}}catch(_0x187e8a){_0x8e8935(_0x187e8a);}});}function getCustomDashboards(_0x23375e){var _0x2b5e69=[];return new BPromise(function(_0x1d0149,_0x23c287){try{if(_0x23375e[_0x080b('0x58')]){return db[_0x080b('0x67')][_0x080b('0x45')]({'raw':!![]})[_0x080b('0x29')](function(_0x43f42a){_0x43f42a['forEach'](function(_0x65086e){_0x2b5e69[_0x080b('0x5f')](_0x65086e['id']+0x1869f);});_0x1d0149(_0x2b5e69);});}else{return db[_0x080b('0x59')][_0x080b('0x45')]({'where':{'sectionId':_0x23375e['id']},'raw':!![]})['then'](function(_0x330793){_0x330793['forEach'](function(_0x3a259a){_0x2b5e69[_0x080b('0x5f')](_0x3a259a[_0x080b('0x68')]+0x1869f);});_0x1d0149(_0x2b5e69);});}}catch(_0xdebf34){_0x23c287(_0xdebf34);}});}function getPlugins(_0x440491){var _0x504f70=[];return new BPromise(function(_0x4ba795,_0x255b40){try{if(_0x440491[_0x080b('0x58')]){return db[_0x080b('0x69')][_0x080b('0x45')]({'raw':!![]})[_0x080b('0x29')](function(_0x1be58e){_0x1be58e[_0x080b('0x6a')](function(_0x466b01){_0x504f70['push'](_0x466b01['id']+0x15b38);});_0x4ba795(_0x504f70);});}else{return db[_0x080b('0x59')][_0x080b('0x45')]({'where':{'sectionId':_0x440491['id']},'raw':!![]})['then'](function(_0x203046){_0x203046[_0x080b('0x6a')](function(_0x12a547){_0x504f70[_0x080b('0x5f')](_0x12a547['resourceId']+0x15b38);});_0x4ba795(_0x504f70);});}}catch(_0x1fb507){_0x255b40(_0x1fb507);}});}exports['addResources']=function(_0x1c3b6f,_0xb892dd){return db[_0x080b('0x2f')][_0x080b('0x49')]({'where':{'id':_0x1c3b6f[_0x080b('0x48')]['id']}})[_0x080b('0x29')](handleEntityNotFound(_0xb892dd,null))[_0x080b('0x29')](function(_0x52c3ce){if(_0x52c3ce){return db['sequelize'][_0x080b('0x55')](function(_0x57d7df){return db[_0x080b('0x56')][_0x080b('0x45')]({'where':{'userProfileId':_0x1c3b6f[_0x080b('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0x080b('0x29')](function(_0x1f383f){if(_0x1f383f){return db[_0x080b('0x56')]['destroy']({'where':{'userProfileId':_0x1c3b6f[_0x080b('0x48')]['id'],'id':_[_0x080b('0x2e')](_0x1f383f,function(_0x388e32){return _0x388e32['id'];})},'transaction':_0x57d7df});}})[_0x080b('0x29')](function(_0x184c03){var _0x40afc0=_[_0x080b('0x2e')](_0x1c3b6f[_0x080b('0x4b')],function(_0x2dabdb){_0x2dabdb[_0x080b('0x5e')]=_0x1c3b6f[_0x080b('0x48')]['id'];return _0x2dabdb;});return db[_0x080b('0x56')]['bulkCreate'](_0x40afc0,{'raw':!![],'transaction':_0x57d7df});})[_0x080b('0x29')](function(_0x57a016){var _0x15bfb4=_[_0x080b('0x40')](_['map'](_0x57a016,function(_0x4e9f27){return _0x4e9f27[_0x080b('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x15bfb4){return db[_0x080b('0x56')]['findAll']({'where':{'userProfileId':_0x1c3b6f[_0x080b('0x48')]['id'],'sectionId':_[_0x080b('0x2e')](_0x15bfb4,function(_0x2a0cdd){return _0x2a0cdd[_0x080b('0x5d')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x080b('0x29')](function(_0x394587){var _0x1f5f22=_[_0x080b('0x2e')](_0x1c3b6f[_0x080b('0x4b')],function(_0x561ba3){_0x561ba3[_0x080b('0x5e')]=_0x1c3b6f[_0x080b('0x48')]['id'];return _0x561ba3;});return db[_0x080b('0x59')][_0x080b('0x6b')](_0x1f5f22,{'raw':!![],'transaction':_0x57d7df});});}})[_0x080b('0x46')](handleError(_0xb892dd,null));});}})[_0x080b('0x29')](function(_0x425b7b){var _0x1b990f=_[_0x080b('0x2e')](_0x425b7b,function(_0x33395d){return _0x33395d[_0x080b('0x4f')]({'plain':!![]});});})['then'](respondWithResult(_0xb892dd,null))[_0x080b('0x46')](handleError(_0xb892dd,null));};exports[_0x080b('0x6c')]=function(_0x169e7f,_0x32890e,_0x3f36a7){return db[_0x080b('0x2f')]['find']({'where':{'id':_0x169e7f[_0x080b('0x48')]['id']}})[_0x080b('0x29')](handleEntityNotFound(_0x32890e,null))['then'](function(_0x484be6){if(_0x484be6){return _0x484be6[_0x080b('0x6c')](_0x169e7f[_0x080b('0x35')][_0x080b('0x61')]);}})[_0x080b('0x29')](respondWithStatusCode(_0x32890e,null))['catch'](handleError(_0x32890e,null));};exports['getResources']=function(_0x1ecf52,_0x11b48a){var _0x545f5={};if(!_0x1ecf52[_0x080b('0x35')][_0x080b('0x6d')])throw new Error('Missing\x20section\x20parameter');if(!_0x1ecf52[_0x080b('0x35')][_0x080b('0x3b')](_0x080b('0x3c'))){_0x545f5[_0x080b('0x24')]=qs[_0x080b('0x24')](_0x1ecf52[_0x080b('0x35')]['limit']);_0x545f5[_0x080b('0x22')]=qs[_0x080b('0x22')](_0x1ecf52[_0x080b('0x35')][_0x080b('0x22')]);}return db['UserProfile']['find']({'where':{'id':_0x1ecf52['params']['id']}})[_0x080b('0x29')](function(_0x4aa9f5){if(!_0x4aa9f5)throw new Error(_0x080b('0x6e')+_0x1ecf52['params']['id']);return db['UserProfile'][_0x080b('0x6f')](_0x1ecf52);})[_0x080b('0x29')](respondWithFilteredResult(_0x11b48a,_0x545f5))[_0x080b('0x46')](handleError(_0x11b48a,null));}; \ No newline at end of file +var _0x4017=['clone','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','get','each','autoAssociation','UserProfileResource','sectionId','userProfileId','UserProfileSection','describe','addSections','Resources','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','concat','filter','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','UserProfile','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body'];(function(_0x2b68fc,_0x10362e){var _0x2e3490=function(_0x13052e){while(--_0x13052e){_0x2b68fc['push'](_0x2b68fc['shift']());}};_0x2e3490(++_0x10362e);}(_0x4017,0xa0));var _0x7401=function(_0xa5a680,_0x34a410){_0xa5a680=_0xa5a680-0x0;var _0x3d3866=_0x4017[_0xa5a680];return _0x3d3866;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7401('0x0'));var zipdir=require(_0x7401('0x1'));var jsonpatch=require(_0x7401('0x2'));var rp=require(_0x7401('0x3'));var moment=require(_0x7401('0x4'));var BPromise=require(_0x7401('0x5'));var Mustache=require(_0x7401('0x6'));var util=require(_0x7401('0x7'));var path=require(_0x7401('0x8'));var sox=require(_0x7401('0x9'));var csv=require('to-csv');var ejs=require(_0x7401('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7401('0xb'));var squel=require(_0x7401('0xc'));var crypto=require('crypto');var jsforce=require(_0x7401('0xd'));var deskjs=require(_0x7401('0xe'));var toCsv=require(_0x7401('0xf'));var querystring=require(_0x7401('0x10'));var Papa=require(_0x7401('0x11'));var Redis=require(_0x7401('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7401('0x13'));var as=require(_0x7401('0x14'));var hardwareService=require(_0x7401('0x15'));var logger=require(_0x7401('0x16'))(_0x7401('0x17'));var utils=require(_0x7401('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7401('0x19'));var db=require(_0x7401('0x1a'))['db'];config[_0x7401('0x1b')]=_['defaults'](config[_0x7401('0x1b')],{'host':_0x7401('0x1c'),'port':0x18eb});var socket=require(_0x7401('0x1d'))(new Redis(config[_0x7401('0x1b')]));require(_0x7401('0x1e'))[_0x7401('0x1f')](socket);function respondWithStatusCode(_0x70476c,_0x41a5c7){_0x41a5c7=_0x41a5c7||0xcc;return function(_0x39130d){if(_0x39130d){return _0x70476c[_0x7401('0x20')](_0x41a5c7);}return _0x70476c[_0x7401('0x21')](_0x41a5c7)[_0x7401('0x22')]();};}function respondWithResult(_0x104b79,_0x3c4ffc){_0x3c4ffc=_0x3c4ffc||0xc8;return function(_0x40dde2){if(_0x40dde2){return _0x104b79[_0x7401('0x21')](_0x3c4ffc)[_0x7401('0x23')](_0x40dde2);}};}function respondWithFilteredResult(_0x47ebf0,_0x34c5d){return function(_0x443fc2){if(_0x443fc2){var _0x1b155c=typeof _0x34c5d['offset']===_0x7401('0x24')&&typeof _0x34c5d[_0x7401('0x25')]===_0x7401('0x24');var _0x47cf51=_0x443fc2['count'];var _0x31443e=_0x1b155c?0x0:_0x34c5d[_0x7401('0x26')];var _0x3c5f7d=_0x1b155c?_0x443fc2[_0x7401('0x27')]:_0x34c5d[_0x7401('0x26')]+_0x34c5d['limit'];var _0x229168;if(_0x3c5f7d>=_0x47cf51){_0x3c5f7d=_0x47cf51;_0x229168=0xc8;}else{_0x229168=0xce;}_0x47ebf0[_0x7401('0x21')](_0x229168);return _0x47ebf0[_0x7401('0x28')](_0x7401('0x29'),_0x31443e+'-'+_0x3c5f7d+'/'+_0x47cf51)[_0x7401('0x23')](_0x443fc2);}return null;};}function patchUpdates(_0xfa6d9b){return function(_0xbe16b1){try{jsonpatch[_0x7401('0x2a')](_0xbe16b1,_0xfa6d9b,!![]);}catch(_0x368814){return BPromise[_0x7401('0x2b')](_0x368814);}return _0xbe16b1[_0x7401('0x2c')]();};}function saveUpdates(_0x4de5f8,_0x5be95e){return function(_0x2eebb5){if(_0x2eebb5){return _0x2eebb5[_0x7401('0x2d')](_0x4de5f8)[_0x7401('0x2e')](function(_0x586b5d){return _0x586b5d;});}return null;};}function removeEntity(_0x25f114,_0x165541){return function(_0x3b0689){if(_0x3b0689){return _0x3b0689[_0x7401('0x2f')]()['then'](function(){_0x25f114[_0x7401('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d4795,_0xc7e47f){return function(_0x8da301){if(!_0x8da301){_0x2d4795[_0x7401('0x20')](0x194);}return _0x8da301;};}function handleError(_0x3d62d0,_0x1ab57f){_0x1ab57f=_0x1ab57f||0x1f4;return function(_0x4800df){logger['error'](_0x4800df[_0x7401('0x30')]);if(_0x4800df[_0x7401('0x31')]){delete _0x4800df[_0x7401('0x31')];}_0x3d62d0[_0x7401('0x21')](_0x1ab57f)[_0x7401('0x32')](_0x4800df);};}exports[_0x7401('0x33')]=function(_0x2e0591,_0x188c1a){var _0x311822={},_0x1ade1e={},_0x11387e={'count':0x0,'rows':[]};var _0x1b3d7d=_[_0x7401('0x34')](db[_0x7401('0x35')]['rawAttributes'],function(_0x8b4be4){return{'name':_0x8b4be4['fieldName'],'type':_0x8b4be4[_0x7401('0x36')]['key']};});_0x1ade1e[_0x7401('0x37')]=_['map'](_0x1b3d7d,_0x7401('0x31'));_0x1ade1e[_0x7401('0x38')]=_[_0x7401('0x39')](_0x2e0591[_0x7401('0x38')]);_0x1ade1e[_0x7401('0x3a')]=_[_0x7401('0x3b')](_0x1ade1e[_0x7401('0x37')],_0x1ade1e['query']);_0x311822['attributes']=_[_0x7401('0x3b')](_0x1ade1e[_0x7401('0x37')],qs[_0x7401('0x3c')](_0x2e0591[_0x7401('0x38')][_0x7401('0x3c')]));_0x311822['attributes']=_0x311822[_0x7401('0x3d')][_0x7401('0x3e')]?_0x311822[_0x7401('0x3d')]:_0x1ade1e['model'];if(!_0x2e0591[_0x7401('0x38')][_0x7401('0x3f')](_0x7401('0x40'))){_0x311822['limit']=qs[_0x7401('0x25')](_0x2e0591[_0x7401('0x38')][_0x7401('0x25')]);_0x311822[_0x7401('0x26')]=qs[_0x7401('0x26')](_0x2e0591['query']['offset']);}_0x311822[_0x7401('0x41')]=qs[_0x7401('0x42')](_0x2e0591[_0x7401('0x38')][_0x7401('0x42')]);_0x311822[_0x7401('0x43')]=qs[_0x7401('0x3a')](_[_0x7401('0x44')](_0x2e0591[_0x7401('0x38')],_0x1ade1e[_0x7401('0x3a')]),_0x1b3d7d);if(_0x2e0591[_0x7401('0x38')]['filter']){_0x311822['where']=_[_0x7401('0x45')](_0x311822['where'],{'$or':_[_0x7401('0x34')](_0x1b3d7d,function(_0x30b162){if(_0x30b162[_0x7401('0x36')]!==_0x7401('0x46')){var _0x2c6626={};_0x2c6626[_0x30b162[_0x7401('0x31')]]={'$like':'%'+_0x2e0591[_0x7401('0x38')]['filter']+'%'};return _0x2c6626;}})});}_0x311822=_[_0x7401('0x45')]({},_0x311822,_0x2e0591[_0x7401('0x47')]);var _0x4d6afe={'where':_0x311822[_0x7401('0x43')]};return db['UserProfile']['count'](_0x4d6afe)[_0x7401('0x2e')](function(_0x5ef545){_0x11387e[_0x7401('0x27')]=_0x5ef545;if(_0x2e0591[_0x7401('0x38')][_0x7401('0x48')]){_0x311822[_0x7401('0x49')]=[{'all':!![]}];}return db[_0x7401('0x35')][_0x7401('0x4a')](_0x311822);})[_0x7401('0x2e')](function(_0x43fe98){_0x11387e['rows']=_0x43fe98;return _0x11387e;})[_0x7401('0x2e')](respondWithFilteredResult(_0x188c1a,_0x311822))[_0x7401('0x4b')](handleError(_0x188c1a,null));};exports[_0x7401('0x4c')]=function(_0x27374d,_0x56163a){var _0x42b9ec={'raw':![],'where':{'id':_0x27374d[_0x7401('0x4d')]['id']}},_0x1966ba={};_0x1966ba[_0x7401('0x37')]=_[_0x7401('0x39')](db['UserProfile'][_0x7401('0x4e')]);_0x1966ba[_0x7401('0x38')]=_['keys'](_0x27374d['query']);_0x1966ba['filters']=_[_0x7401('0x3b')](_0x1966ba[_0x7401('0x37')],_0x1966ba[_0x7401('0x38')]);_0x42b9ec[_0x7401('0x3d')]=_['intersection'](_0x1966ba[_0x7401('0x37')],qs[_0x7401('0x3c')](_0x27374d[_0x7401('0x38')][_0x7401('0x3c')]));_0x42b9ec[_0x7401('0x3d')]=_0x42b9ec[_0x7401('0x3d')]['length']?_0x42b9ec[_0x7401('0x3d')]:_0x1966ba['model'];if(_0x27374d['query'][_0x7401('0x48')]){_0x42b9ec[_0x7401('0x49')]=[{'all':!![]}];}_0x42b9ec=_[_0x7401('0x45')]({},_0x42b9ec,_0x27374d['options']);return db['UserProfile'][_0x7401('0x4f')](_0x42b9ec)['then'](handleEntityNotFound(_0x56163a,null))[_0x7401('0x2e')](respondWithResult(_0x56163a,null))[_0x7401('0x4b')](handleError(_0x56163a,null));};exports['create']=function(_0x1f9498,_0xd2cd18){return db[_0x7401('0x35')][_0x7401('0x50')](_0x1f9498[_0x7401('0x51')],{})[_0x7401('0x2e')](respondWithResult(_0xd2cd18,0xc9))[_0x7401('0x4b')](handleError(_0xd2cd18,null));};exports[_0x7401('0x52')]=function(_0x2b4ee4,_0x44abd4){var _0x3bc05b={'where':{'id':_0x2b4ee4[_0x7401('0x4d')]['id']}},_0x50945b={};_0x50945b[_0x7401('0x37')]=_[_0x7401('0x39')](db['UserProfile'][_0x7401('0x4e')]);_0x3bc05b[_0x7401('0x3d')]=_['intersection'](_0x50945b[_0x7401('0x37')],qs[_0x7401('0x3c')](_0x2b4ee4[_0x7401('0x38')][_0x7401('0x3c')]));_0x3bc05b[_0x7401('0x3d')]=_0x3bc05b[_0x7401('0x3d')][_0x7401('0x3e')]?_0x3bc05b[_0x7401('0x3d')]:_0x50945b['model'];if(_0x2b4ee4[_0x7401('0x38')][_0x7401('0x48')]){_0x3bc05b[_0x7401('0x49')]=[{'all':!![]}];}_0x3bc05b=_[_0x7401('0x45')]({},_0x3bc05b,_0x2b4ee4[_0x7401('0x47')]);return db['UserProfile'][_0x7401('0x4f')](_0x3bc05b)['then'](handleEntityNotFound(_0x44abd4,null))[_0x7401('0x2e')](function(_0x51c75f){if(_0x51c75f){var _0xe4edda=_0x51c75f['get']({'plain':!![]});_0xe4edda=qs[_0x7401('0x53')](_0xe4edda,['id',_0x7401('0x54'),_0x7401('0x55'),_0x7401('0x56')]);_0x2b4ee4[_0x7401('0x51')]=_['omit'](_0x2b4ee4[_0x7401('0x51')],['id','createdAt',_0x7401('0x55')]);return db[_0x7401('0x57')][_0x7401('0x58')](function(_0x49468d){return db[_0x7401('0x35')][_0x7401('0x50')](_[_0x7401('0x45')](_0xe4edda,_0x2b4ee4[_0x7401('0x51')]),{'include':_0x2b4ee4['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x49468d})[_0x7401('0x2e')](function(_0x379a84){var _0x4eaf91=_0x379a84[_0x7401('0x59')]({'plain':!![]});return db['UserProfileSection'][_0x7401('0x4a')]({'where':{'userProfileId':_0x2b4ee4['params']['id']},'raw':!![]})[_0x7401('0x2e')](function(_0x173c84){if(_0x173c84){return BPromise[_0x7401('0x5a')](_0x173c84,function(_0x340004){return new BPromise(function(_0x10059d,_0x5b79f1){if(_0x340004[_0x7401('0x5b')]===null||_0x340004['autoAssociation']===0x1)_0x10059d(null);return db[_0x7401('0x5c')][_0x7401('0x4a')]({'where':{'sectionId':_0x340004['id']},'raw':!![]})[_0x7401('0x2e')](function(_0xa967ec){var _0x5572ab=_['map'](_0xa967ec,function(_0x138e3f){return qs['omit'](_0x138e3f,['id',_0x7401('0x54'),_0x7401('0x55'),_0x7401('0x5d')]);});_0x10059d(_0x5572ab);})[_0x7401('0x4b')](function(_0xced0fb){_0x5b79f1(_0xced0fb);});})[_0x7401('0x2e')](function(_0x2cede2){var _0x148581=qs['omit'](_0x340004,['id',_0x7401('0x54'),_0x7401('0x55')]);_0x148581[_0x7401('0x5e')]=_0x4eaf91['id'];if(_0x2cede2)_0x148581['Resources']=_0x2cede2;return _0x148581;})['then'](function(_0x5e044c){return db[_0x7401('0x5f')]['create'](_0x5e044c,{'include':[{'model':db[_0x7401('0x5c')],'as':'Resources'}],'raw':!![],'transaction':_0x49468d});});})[_0x7401('0x2e')](function(){return _0x4eaf91;});}});});});}})[_0x7401('0x2e')](respondWithResult(_0x44abd4,0xc9))[_0x7401('0x4b')](handleError(_0x44abd4,null));};exports['update']=function(_0x1c9e25,_0x562724){if(_0x1c9e25[_0x7401('0x51')]['id']){delete _0x1c9e25[_0x7401('0x51')]['id'];}return db[_0x7401('0x35')][_0x7401('0x4f')]({'where':{'id':_0x1c9e25[_0x7401('0x4d')]['id']}})['then'](handleEntityNotFound(_0x562724,null))['then'](saveUpdates(_0x1c9e25[_0x7401('0x51')],null))['then'](respondWithResult(_0x562724,null))[_0x7401('0x4b')](handleError(_0x562724,null));};exports[_0x7401('0x2f')]=function(_0x2cc315,_0x2b3f2d){return db[_0x7401('0x35')][_0x7401('0x4f')]({'where':{'id':_0x2cc315[_0x7401('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2b3f2d,null))['then'](removeEntity(_0x2b3f2d,null))[_0x7401('0x4b')](handleError(_0x2b3f2d,null));};exports[_0x7401('0x60')]=function(_0x38e6a7,_0x2abf38){return db['UserProfile'][_0x7401('0x60')]()[_0x7401('0x2e')](respondWithResult(_0x2abf38,null))[_0x7401('0x4b')](handleError(_0x2abf38,null));};exports[_0x7401('0x61')]=function(_0x5b9537,_0x21d059){var _0x578098=_0x5b9537['body'];return db['UserProfile'][_0x7401('0x4f')]({'where':{'id':_0x5b9537['params']['id']}})[_0x7401('0x2e')](handleEntityNotFound(_0x21d059,null))['then'](function(_0x84dff7){if(_0x84dff7){return db['sequelize'][_0x7401('0x58')](function(_0x207821){return db[_0x7401('0x5f')][_0x7401('0x2f')]({'where':{'userProfileId':_0x5b9537[_0x7401('0x4d')]['id'],'sectionId':_[_0x7401('0x34')](_0x578098,function(_0x340dd5){return _0x340dd5['sectionId'];})},'transaction':_0x207821})[_0x7401('0x2e')](function(){var _0x537d99=_['map'](_0x578098,function(_0x229abe){_0x229abe[_0x7401('0x5e')]=_0x5b9537[_0x7401('0x4d')]['id'];return _0x229abe;});var _0x449ad5=[];return BPromise[_0x7401('0x5a')](_0x537d99,function(_0x144e29){return db[_0x7401('0x5f')][_0x7401('0x50')](_0x144e29,{'include':[{'model':db[_0x7401('0x5c')],'as':_0x7401('0x62')}],'raw':!![],'transaction':_0x207821})[_0x7401('0x2e')](function(_0x379f0a){_0x449ad5[_0x7401('0x63')](_0x379f0a[_0x7401('0x59')]({'plain':!![]}));});})['then'](function(){return _0x449ad5;});});});}})['then'](function(_0x186467){return _0x186467;})['then'](respondWithResult(_0x21d059,null))['catch'](handleError(_0x21d059,null));};exports[_0x7401('0x64')]=function(_0x137dd7,_0x48562e){var _0x8f7bb9;return db[_0x7401('0x35')][_0x7401('0x4f')]({'where':{'id':_0x137dd7['params']['id']},'attributes':['id',_0x7401('0x31')]})[_0x7401('0x2e')](handleEntityNotFound(_0x48562e,null))['then'](function(_0x5aa85c){if(_0x5aa85c){_0x8f7bb9=_0x5aa85c;return db[_0x7401('0x5f')][_0x7401('0x2f')]({'where':{'userProfileId':_0x137dd7[_0x7401('0x4d')]['id'],'sectionId':_0x137dd7[_0x7401('0x38')][_0x7401('0x65')]}});}})['then'](function(){return _0x8f7bb9;})[_0x7401('0x2e')](respondWithStatusCode(_0x48562e,null))[_0x7401('0x4b')](handleError(_0x48562e,null));};exports[_0x7401('0x66')]=function(_0x1ee8c9,_0x1d0506){var _0x3e2005=[];var _0x5ced7a=[];return db[_0x7401('0x5f')][_0x7401('0x4a')]({'where':{'userProfileId':_0x1ee8c9[_0x7401('0x4d')]['id']},'raw':!![]})[_0x7401('0x2e')](function(_0x5b28be){_0x3e2005=_['filter'](_0x5b28be,function(_0x52f447){return _0x52f447[_0x7401('0x67')]===0x1||_['includes']([0x3eb,0x709],_0x52f447[_0x7401('0x5d')]);});if(!_[_0x7401('0x68')](_0x3e2005)){return _[_0x7401('0x34')](_0x3e2005,function(_0x4c6c44){return _0x4c6c44['sectionId'];});}else{return;}})['then'](function(_0x300701){if(_0x300701)_0x5ced7a=_0x300701;if(_[_0x7401('0x69')](_0x5ced7a,0x64)){var _0x1c4ae0=_['find'](_0x3e2005,{'sectionId':0x64});return hasDefaultDashboard(_0x1c4ae0)['then'](function(_0xd17b38){return _[_0x7401('0x34')](_0x3e2005,function(_0x1ce855){if(_0x1ce855[_0x7401('0x5d')]===0x64){_0x1ce855['subsections']=_0xd17b38;}return _0x1ce855;});});}else{return;}})[_0x7401('0x2e')](function(_0x330654){if(_0x330654)_0x3e2005=_0x330654;if(_[_0x7401('0x69')](_0x5ced7a,0x3eb)){var _0x103da0=_[_0x7401('0x4f')](_0x3e2005,{'sectionId':0x3eb});return getCustomDashboards(_0x103da0)[_0x7401('0x2e')](function(_0x229030){return _[_0x7401('0x34')](_0x3e2005,function(_0x539924){if(_0x103da0[_0x7401('0x67')]){if(_0x539924[_0x7401('0x5d')]===0x3eb){_0x539924[_0x7401('0x6a')]=_0x229030;}}else{if(_0x539924[_0x7401('0x5d')]===0x64){if(!_0x539924[_0x7401('0x6a')]){_0x539924[_0x7401('0x6a')]=[];}_0x539924[_0x7401('0x6a')]=_0x539924[_0x7401('0x6a')][_0x7401('0x6b')](_0x229030);}}return _0x539924;});});}else{return;}})[_0x7401('0x2e')](function(_0x1a0287){if(_0x1a0287)_0x3e2005=_0x1a0287;if(_[_0x7401('0x69')](_0x5ced7a,0x709)){var _0x573f8f=_[_0x7401('0x4f')](_0x3e2005,{'sectionId':0x709});return getPlugins(_0x573f8f)['then'](function(_0x4c8943){if(_0x573f8f[_0x7401('0x67')]){return _[_0x7401('0x34')](_0x3e2005,function(_0x4fe0c0){if(_0x4fe0c0['sectionId']===0x709){_0x4fe0c0[_0x7401('0x6a')]=_0x4c8943;}return _0x4fe0c0;});}else{var _0x48afb6={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4c8943};var _0x4c766e=_[_0x7401('0x34')](_0x3e2005);_0x4c766e['push'](_0x48afb6);return _0x4c766e;}});}else{return;}})['then'](function(_0x3f48de){if(_0x3f48de)_0x3e2005=_0x3f48de;return _[_0x7401('0x6c')](_0x3e2005,[_0x7401('0x67'),0x1]);})[_0x7401('0x2e')](respondWithResult(_0x1d0506,null))[_0x7401('0x4b')](handleError(_0x1d0506,null));};function hasDefaultDashboard(_0x5e221d){var _0x40e9ca=[0x65];return new BPromise(function(_0xb13cdf,_0x233384){try{if(_0x5e221d[_0x7401('0x5b')]){_0xb13cdf(_0x40e9ca);}else{return db[_0x7401('0x5c')][_0x7401('0x6d')]({'where':{'sectionId':_0x5e221d['id']},'raw':!![]})[_0x7401('0x2e')](function(_0x4db1d9){_0x4db1d9?_0xb13cdf(_0x40e9ca):_0xb13cdf();});}}catch(_0x5bd3e1){_0x233384(_0x5bd3e1);}});}function getCustomDashboards(_0x3a3cdf){var _0x21b348=[];return new BPromise(function(_0x2452e2,_0x4dbad5){try{if(_0x3a3cdf[_0x7401('0x5b')]){return db[_0x7401('0x6e')][_0x7401('0x4a')]({'raw':!![]})['then'](function(_0x2c746c){_0x2c746c[_0x7401('0x6f')](function(_0x1a8c5d){_0x21b348[_0x7401('0x63')](_0x1a8c5d['id']+0x1869f);});_0x2452e2(_0x21b348);});}else{return db[_0x7401('0x5c')]['findAll']({'where':{'sectionId':_0x3a3cdf['id']},'raw':!![]})[_0x7401('0x2e')](function(_0x3b644e){_0x3b644e[_0x7401('0x6f')](function(_0xd6050){_0x21b348[_0x7401('0x63')](_0xd6050[_0x7401('0x70')]+0x1869f);});_0x2452e2(_0x21b348);});}}catch(_0x2e0fef){_0x4dbad5(_0x2e0fef);}});}function getPlugins(_0x2988f3){var _0x344062=[];return new BPromise(function(_0x3e075c,_0x27932f){try{if(_0x2988f3[_0x7401('0x5b')]){return db[_0x7401('0x71')][_0x7401('0x4a')]({'raw':!![]})[_0x7401('0x2e')](function(_0x3bb379){_0x3bb379[_0x7401('0x6f')](function(_0x4886a8){_0x344062[_0x7401('0x63')](_0x4886a8['id']+0x15b38);});_0x3e075c(_0x344062);});}else{return db['UserProfileResource'][_0x7401('0x4a')]({'where':{'sectionId':_0x2988f3['id']},'raw':!![]})[_0x7401('0x2e')](function(_0x4d58e9){_0x4d58e9['forEach'](function(_0xacea39){_0x344062[_0x7401('0x63')](_0xacea39[_0x7401('0x70')]+0x15b38);});_0x3e075c(_0x344062);});}}catch(_0x5a1673){_0x27932f(_0x5a1673);}});}exports[_0x7401('0x72')]=function(_0x404653,_0x26bc40){return db['UserProfile']['find']({'where':{'id':_0x404653[_0x7401('0x4d')]['id']}})['then'](handleEntityNotFound(_0x26bc40,null))[_0x7401('0x2e')](function(_0x43fb69){if(_0x43fb69){return db[_0x7401('0x57')][_0x7401('0x58')](function(_0x59fd6d){return db[_0x7401('0x5f')][_0x7401('0x4a')]({'where':{'userProfileId':_0x404653[_0x7401('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0x7401('0x2e')](function(_0x5666f7){if(_0x5666f7){return db[_0x7401('0x5f')][_0x7401('0x2f')]({'where':{'userProfileId':_0x404653['params']['id'],'id':_[_0x7401('0x34')](_0x5666f7,function(_0x4c2090){return _0x4c2090['id'];})},'transaction':_0x59fd6d});}})[_0x7401('0x2e')](function(_0x54821f){var _0x5e9f36=_['map'](_0x404653[_0x7401('0x51')],function(_0x161b48){_0x161b48[_0x7401('0x5e')]=_0x404653['params']['id'];return _0x161b48;});return db[_0x7401('0x5f')][_0x7401('0x73')](_0x5e9f36,{'raw':!![],'transaction':_0x59fd6d});})[_0x7401('0x2e')](function(_0x5ca5d7){var _0x3af8aa=_['filter'](_['map'](_0x5ca5d7,function(_0x1d1f75){return _0x1d1f75[_0x7401('0x59')]({'plain':!![]});}),{'includeAll':![]});if(_0x3af8aa){return db[_0x7401('0x5f')][_0x7401('0x4a')]({'where':{'userProfileId':_0x404653['params']['id'],'sectionId':_[_0x7401('0x34')](_0x3af8aa,function(_0x2662a3){return _0x2662a3[_0x7401('0x5d')];})},'attributes':['id',_0x7401('0x5d')],'raw':!![]})[_0x7401('0x2e')](function(_0xae12d){var _0x336ac9=_[_0x7401('0x34')](_0x404653[_0x7401('0x51')],function(_0x3967cf){_0x3967cf[_0x7401('0x5e')]=_0x404653[_0x7401('0x4d')]['id'];return _0x3967cf;});return db['UserProfileResource'][_0x7401('0x73')](_0x336ac9,{'raw':!![],'transaction':_0x59fd6d});});}})[_0x7401('0x4b')](handleError(_0x26bc40,null));});}})['then'](function(_0x5945a1){var _0x48720b=_[_0x7401('0x34')](_0x5945a1,function(_0x3b40e1){return _0x3b40e1[_0x7401('0x59')]({'plain':!![]});});})[_0x7401('0x2e')](respondWithResult(_0x26bc40,null))[_0x7401('0x4b')](handleError(_0x26bc40,null));};exports[_0x7401('0x74')]=function(_0x258f10,_0x19204b,_0x171574){return db[_0x7401('0x35')][_0x7401('0x4f')]({'where':{'id':_0x258f10[_0x7401('0x4d')]['id']}})[_0x7401('0x2e')](handleEntityNotFound(_0x19204b,null))[_0x7401('0x2e')](function(_0x50589d){if(_0x50589d){return _0x50589d['removeResources'](_0x258f10[_0x7401('0x38')][_0x7401('0x65')]);}})[_0x7401('0x2e')](respondWithStatusCode(_0x19204b,null))[_0x7401('0x4b')](handleError(_0x19204b,null));};exports['getResources']=function(_0x55da0b,_0x528523){var _0x46a90e={};if(!_0x55da0b[_0x7401('0x38')][_0x7401('0x75')])throw new Error(_0x7401('0x76'));if(!_0x55da0b['query'][_0x7401('0x3f')](_0x7401('0x40'))){_0x46a90e['limit']=qs[_0x7401('0x25')](_0x55da0b[_0x7401('0x38')]['limit']);_0x46a90e[_0x7401('0x26')]=qs['offset'](_0x55da0b[_0x7401('0x38')][_0x7401('0x26')]);}return db[_0x7401('0x35')][_0x7401('0x4f')]({'where':{'id':_0x55da0b[_0x7401('0x4d')]['id']}})[_0x7401('0x2e')](function(_0x393fa2){if(!_0x393fa2)throw new Error(_0x7401('0x77')+_0x55da0b[_0x7401('0x4d')]['id']);return db['UserProfile'][_0x7401('0x78')](_0x55da0b);})['then'](respondWithFilteredResult(_0x528523,_0x46a90e))['catch'](handleError(_0x528523,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 25d588a..a327b94 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 _0xb7f0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x1fa3e2,_0x58020c){var _0x1261fc=function(_0x439e3b){while(--_0x439e3b){_0x1fa3e2['push'](_0x1fa3e2['shift']());}};_0x1261fc(++_0x58020c);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x4635e5,_0x5590a9){_0x4635e5=_0x4635e5-0x0;var _0x5a187b=_0xb7f0[_0x4635e5];return _0x5a187b;};'use strict';var EventEmitter=require(_0x0b7f('0x0'));var UserProfile=require(_0x0b7f('0x1'))['db'][_0x0b7f('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0b7f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0b7f('0x4')};function emitEvent(_0xa1285e){return function(_0x228377,_0x188ea8,_0x34e188){UserProfileEvents[_0x0b7f('0x5')](_0xa1285e+':'+_0x228377['id'],_0x228377);UserProfileEvents[_0x0b7f('0x5')](_0xa1285e,_0x228377);_0x34e188(null);};}for(var e in events){if(events[_0x0b7f('0x6')](e)){var event=events[e];UserProfile[_0x0b7f('0x7')](e,emitEvent(event));}}module[_0x0b7f('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x5353=['save','update','remove','emit','hasOwnProperty','exports','events','UserProfile','setMaxListeners'];(function(_0x3836ae,_0x33dcdb){var _0x4d4a64=function(_0x58810e){while(--_0x58810e){_0x3836ae['push'](_0x3836ae['shift']());}};_0x4d4a64(++_0x33dcdb);}(_0x5353,0x12f));var _0x3535=function(_0x167b21,_0x5b817b){_0x167b21=_0x167b21-0x0;var _0x584f01=_0x5353[_0x167b21];return _0x584f01;};'use strict';var EventEmitter=require(_0x3535('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x3535('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3535('0x2')](0x0);var events={'afterCreate':_0x3535('0x3'),'afterUpdate':_0x3535('0x4'),'afterDestroy':_0x3535('0x5')};function emitEvent(_0x2b65db){return function(_0x21ad15,_0xd6adad,_0x24286e){UserProfileEvents[_0x3535('0x6')](_0x2b65db+':'+_0x21ad15['id'],_0x21ad15);UserProfileEvents['emit'](_0x2b65db,_0x21ad15);_0x24286e(null);};}for(var e in events){if(events[_0x3535('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x3535('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 52bf921..45c7648 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 _0xba46=['mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','then','associatedResources','map','catch','model','findAll','resolve','UserProfileResource','AnalyticExtractedReport','type','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','JscriptyProject','contacts','parentSections','ListId','lists','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','name','User','role','agent','Telephones','membername','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','MailQueue','mailaccounts','mailsubstatuses','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','telephones','Users','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','trunks','variables','Variable','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','query','raw','section','Invalid\x20section\x20\x27','isEmpty','length','push','find','ignore','union','autoAssociation','all','keys','filters','intersection','fields','attributes','nolimit','limit','offset','order','sort','merge','VIRTUAL','foreignKey','forEach','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','count','CmContact','Tags','color','tag','Tag','ThroughTags','true','chat','dataValues','sms','fax'];(function(_0x1f17e6,_0xe766b6){var _0x491087=function(_0x11436e){while(--_0x11436e){_0x1f17e6['push'](_0x1f17e6['shift']());}};_0x491087(++_0xe766b6);}(_0xba46,0xc4));var _0x6ba4=function(_0x35df86,_0xb254ce){_0x35df86=_0x35df86-0x0;var _0x25d40e=_0xba46[_0x35df86];return _0x25d40e;};'use strict';var _=require(_0x6ba4('0x0'));var attributes=require(_0x6ba4('0x1'));var squel=require(_0x6ba4('0x2'));module[_0x6ba4('0x3')]=function(_0x5bae3f){var _0x4eb155=_0x5bae3f[_0x6ba4('0x4')];function _0x379d75(_0x40aaa8,_0x4922eb){return new Promise(function(_0x1f33b4,_0x30cb7b){if(!_0x4922eb)return _0x1f33b4(null);var _0x39e76a=_0x4922eb[_0x6ba4('0x5')]?{[_0x4922eb[_0x6ba4('0x5')][_0x6ba4('0x6')]]:_0x4922eb['filter'][_0x6ba4('0x7')]}:undefined;return _0x4eb155[_0x40aaa8]['findAll']({'where':_0x39e76a,'raw':!![]})[_0x6ba4('0x8')](function(_0x327fa4){_0x4922eb[_0x6ba4('0x9')]=_[_0x6ba4('0xa')](_0x327fa4,'id');_0x1f33b4(_0x4922eb);})[_0x6ba4('0xb')](function(_0xa3487b){_0x30cb7b(_0xa3487b);});});}function _0x41aaef(_0xa543bd,_0x4f6e86){return new Promise(function(_0x391e4a,_0x35f517){var _0x1d51d3=_0xa543bd[_0x6ba4('0x5')]?{[_0xa543bd['filter'][_0x6ba4('0x6')]]:_0xa543bd[_0x6ba4('0x5')][_0x6ba4('0x7')]}:undefined;return _0x4eb155[_0xa543bd[_0x6ba4('0xc')]][_0x6ba4('0xd')]({'where':_0x1d51d3,'raw':!![]})[_0x6ba4('0x8')](function(_0x5c70d2){_0x4f6e86[_0x6ba4('0x9')]=_[_0x6ba4('0xa')](_0x5c70d2,function(_0x255c86){return _0x255c86['name'];});_0x391e4a(_0x4f6e86);})[_0x6ba4('0xb')](function(_0x5c8a4f){_0x35f517(_0x5c8a4f);});});}function _0x171c5a(_0x5b5bb2,_0x4b08df,_0x590bb9){if(!_0x4b08df)return Promise[_0x6ba4('0xe')](null);return new Promise(function(_0x18adc6,_0x41fc0a){return _0x4eb155[_0x6ba4('0xf')]['findAll']({'where':{'sectionId':_0x4b08df['id']},'raw':!![]})[_0x6ba4('0x8')](function(_0x1f2138){if(_0x5b5bb2['field']&&_0x5b5bb2[_0x6ba4('0x6')]!=='id'){_0x4b08df['associatedResources']=_[_0x6ba4('0xa')](_0x1f2138,function(_0x393174){return _0x393174[_0x5b5bb2[_0x6ba4('0x6')]];});}else{if(_0x590bb9===_0x6ba4('0x10')){_0x4b08df[_0x6ba4('0x9')]=_[_0x6ba4('0xa')](_0x1f2138,function(_0x343fbd){return{'id':_0x343fbd['resourceId'],'type':_0x343fbd[_0x6ba4('0x11')]};});}else{_0x4b08df['associatedResources']=_['map'](_0x1f2138,function(_0x503897){return _0x503897['resourceId'];});}}_0x18adc6(_0x4b08df);})[_0x6ba4('0xb')](function(_0xfceac3){_0x41fc0a(_0xfceac3);});});}function _0xd805de(_0x5b0a85,_0x1021da){var _0x14ce7c={'parentSections':[]};switch(_0x5b0a85[_0x6ba4('0x12')]()){case _0x6ba4('0x13'):_0x14ce7c['childModel']=_0x6ba4('0x14');break;case _0x6ba4('0x15'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x17');break;case _0x6ba4('0x18'):_0x14ce7c['childModel']=_0x6ba4('0x19');_0x14ce7c['parentSections']=[{'name':_0x6ba4('0x1a'),'field':'name','foreignKey':'projectName'}];break;case'projects':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x1b');break;case _0x6ba4('0x1c'):_0x14ce7c[_0x6ba4('0x16')]='CmContact';_0x14ce7c[_0x6ba4('0x1d')]=[{'name':'Lists','field':'id','foreignKey':_0x6ba4('0x1e')}];break;case _0x6ba4('0x1f'):_0x14ce7c['childModel']='CmList';break;case'companies':_0x14ce7c['childModel']=_0x6ba4('0x20');break;case _0x6ba4('0x21'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x22');break;case _0x6ba4('0x23'):_0x14ce7c[_0x6ba4('0x16')]='ChatQueue';break;case'chatwebsites':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x24');break;case _0x6ba4('0x25'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x26');break;case _0x6ba4('0x27'):_0x14ce7c['childModel']='FaxAccount';break;case _0x6ba4('0x28'):case _0x6ba4('0x29'):case'outboundroutes':_0x14ce7c['childModel']=_0x6ba4('0x2a');break;case _0x6ba4('0x2b'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x2c');break;case _0x6ba4('0x2d'):_0x14ce7c['childModel']='VoiceMail';break;case _0x6ba4('0x2e'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x2f');_0x14ce7c[_0x6ba4('0x1d')]=[{'name':_0x6ba4('0x30'),'field':_0x6ba4('0x31'),'foreignKey':'membername','model':_0x6ba4('0x32'),'filter':{'field':_0x6ba4('0x33'),'value':[_0x6ba4('0x34')]}},{'name':_0x6ba4('0x35'),'field':_0x6ba4('0x31'),'foreignKey':_0x6ba4('0x36'),'model':_0x6ba4('0x32'),'filter':{'field':_0x6ba4('0x33'),'value':[_0x6ba4('0x37')]}},{'name':_0x6ba4('0x38'),'field':'name','foreignKey':'queue','model':_0x6ba4('0x39'),'filter':{'field':'type','value':[_0x6ba4('0x3a')]}},{'name':_0x6ba4('0x3b'),'field':_0x6ba4('0x31'),'foreignKey':_0x6ba4('0x3c'),'model':_0x6ba4('0x39'),'filter':{'field':_0x6ba4('0x11'),'value':['outbound']}}];break;case _0x6ba4('0x3d'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x3e');break;case _0x6ba4('0x3f'):_0x14ce7c['childModel']=_0x6ba4('0x40');break;case'voiceprefixes':_0x14ce7c['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x14ce7c[_0x6ba4('0x16')]='Campaign';break;case'mailqueues':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x41');break;case _0x6ba4('0x42'):_0x14ce7c[_0x6ba4('0x16')]='MailAccount';break;case _0x6ba4('0x43'):_0x14ce7c[_0x6ba4('0x16')]='MailSubstatus';break;case'openchannelqueues':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x44');break;case'openchannelaccounts':_0x14ce7c['childModel']=_0x6ba4('0x45');break;case _0x6ba4('0x46'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x47');break;case _0x6ba4('0x48'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x49');break;case'whatsappqueues':_0x14ce7c['childModel']=_0x6ba4('0x4a');break;case _0x6ba4('0x4b'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x4c');break;case _0x6ba4('0x4d'):_0x14ce7c['childModel']='Team';break;case _0x6ba4('0x4e'):case _0x6ba4('0x4f'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x39');if(_0x1021da){_0x14ce7c['parentSections']=[{'name':_0x6ba4('0x38')},{'name':'QueueCampaigns'}];}break;case _0x6ba4('0x50'):case _0x6ba4('0x51'):case _0x6ba4('0x52'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x32');if(_0x1021da){_0x14ce7c[_0x6ba4('0x1d')]=[{'name':_0x6ba4('0x53'),'filter':{'field':_0x6ba4('0x33'),'value':['admin',_0x6ba4('0x54')]},'ignore':!![]},{'name':_0x6ba4('0x30')},{'name':_0x6ba4('0x35')}];}break;case'zendeskaccounts':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x55');break;case _0x6ba4('0x56'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x57');break;case _0x6ba4('0x58'):_0x14ce7c['childModel']='FreshdeskAccount';break;case _0x6ba4('0x59'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x5a');break;case _0x6ba4('0x5b'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x5c');break;case'zohoaccounts':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x5d');break;case _0x6ba4('0x5e'):_0x14ce7c['childModel']=_0x6ba4('0x32');break;case _0x6ba4('0x5f'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x60');break;case _0x6ba4('0x61'):_0x14ce7c['childModel']=_0x6ba4('0x62');break;case'customdashboards':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x63');break;case _0x6ba4('0x64'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x65');break;case _0x6ba4('0x66'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x67');break;case _0x6ba4('0x68'):_0x14ce7c['childModel']=_0x6ba4('0x69');break;case _0x6ba4('0x6a'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x6b');break;case _0x6ba4('0x6c'):_0x14ce7c[_0x6ba4('0x16')]='Tag';break;case _0x6ba4('0x6d'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x6e');break;case _0x6ba4('0x6f'):_0x14ce7c['childModel']='Trigger';break;case _0x6ba4('0x70'):_0x14ce7c[_0x6ba4('0x16')]='Trunk';break;case _0x6ba4('0x71'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x72');break;case'plugins':_0x14ce7c[_0x6ba4('0x16')]='Plugin';break;case _0x6ba4('0x73'):_0x14ce7c['childModel']='AnalyticExtractedReport';_0x14ce7c[_0x6ba4('0x1d')]=[{'name':_0x6ba4('0x74'),'field':'id','foreignKey':_0x6ba4('0x75')}];break;case'metrics':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x76');break;}return _0x14ce7c;}function _0x358c7c(_0x47fe71,_0x50cb79){var _0x398414=_0x47fe71[_0x6ba4('0x77')](0x0)[_0x6ba4('0x78')]()+_0x47fe71[_0x6ba4('0x79')](0x1);var _0x1e9bf3={'type':_0x4eb155[_0x6ba4('0x7a')][_0x6ba4('0x7b')][_0x6ba4('0x7c')],'raw':!![]};return new Promise(function(_0x25c2de,_0x22d478){var _0x19bde3=squel[_0x6ba4('0x7d')]()[_0x6ba4('0x6')](_0x6ba4('0x7e')+_0x398414+_0x6ba4('0x7f'),'id')[_0x6ba4('0x6')](_0x6ba4('0x80'))[_0x6ba4('0x81')](_0x6ba4('0x82')+_0x47fe71+_0x6ba4('0x83'),'ui')[_0x6ba4('0x84')](_0x6ba4('0x85'),_0x50cb79['id']);return _0x4eb155[_0x6ba4('0x86')]['query'](_0x19bde3[_0x6ba4('0x87')](),_0x1e9bf3)[_0x6ba4('0x8')](function(_0x836019){_0x50cb79[_0x398414+_0x6ba4('0x88')]=_0x836019;_0x25c2de(_0x836019);})[_0x6ba4('0xb')](function(_0x521286){_0x22d478(_0x521286);});});}return _0x5bae3f[_0x6ba4('0x89')](_0x6ba4('0x8a'),attributes,{'tableName':_0x6ba4('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x63b181){var _0x2ba4eb=require(_0x6ba4('0x8c'));var _0x35d77f={'raw':_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0x8e')],'where':{}};var _0x136d71={};var _0x50b463={'count':0x0,'rows':[]};var _0x28b36b=_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0x8f')];var _0x35d6ab=_0x63b181['query']['mergeResources']||![];var _0x5e1525=_0xd805de(_0x28b36b,_0x35d6ab);if(!_0x5e1525['childModel'])throw new Error(_0x6ba4('0x90')+_0x28b36b+'\x27');var _0xd0d799=[{'name':_0x28b36b}];if(!_[_0x6ba4('0x91')](_0x5e1525[_0x6ba4('0x1d')]))_0xd0d799=_0x5e1525[_0x6ba4('0x1d')];var _0x4b9226=[];for(var _0x13d933=0x0;_0x13d933<_0xd0d799[_0x6ba4('0x92')];_0x13d933++){_0x4b9226[_0x6ba4('0x93')](_0x4eb155['UserProfileSection'][_0x6ba4('0x94')]({'where':{'userProfileId':_0x63b181['params']['id'],'name':_0xd0d799[_0x13d933][_0x6ba4('0x31')]},'raw':!![]}));}return Promise['all'](_0x4b9226)[_0x6ba4('0x8')](function(_0x30c82e){var _0x3c3214=_['filter'](_0x30c82e,function(_0x58883b){return _0x58883b?_0x58883b:undefined;});var _0x1430ef=_[_0x6ba4('0x5')](_0xd0d799,[_0x6ba4('0x95'),!![]]);var _0xa5a7c3=_[_0x6ba4('0x91')](_0x3c3214)&&_[_0x6ba4('0x91')](_0x1430ef)?null:_[_0x6ba4('0x96')](_0x1430ef,_0x3c3214);if(!_0xa5a7c3)return null;var _0x4c7a10=[];for(var _0x4cef5c=0x0;_0x4cef5c<_0xa5a7c3[_0x6ba4('0x92')];_0x4cef5c++){var _0xc5ac6b=_[_0x6ba4('0x94')](_0xd0d799,function(_0x2bd48e){return _0xa5a7c3[_0x4cef5c]?_0x2bd48e[_0x6ba4('0x31')]===_0xa5a7c3[_0x4cef5c][_0x6ba4('0x31')]:null;});if(_0xc5ac6b){if(_0xa5a7c3[_0x4cef5c][_0x6ba4('0x95')]){_0x4c7a10[_0x6ba4('0x93')](_0x379d75(_0x5e1525[_0x6ba4('0x16')],_0xa5a7c3[_0x4cef5c]));}else{if(!_0xa5a7c3[_0x4cef5c][_0x6ba4('0x97')]){_0x4c7a10[_0x6ba4('0x93')](_0x171c5a(_0xc5ac6b,_0xa5a7c3[_0x4cef5c],_0x5e1525['childModel']));}else{if(_0xc5ac6b[_0x6ba4('0xc')]){_0x4c7a10[_0x6ba4('0x93')](_0x41aaef(_0xc5ac6b,_0xa5a7c3[_0x4cef5c]));}}}}}return Promise[_0x6ba4('0x98')](_0x4c7a10);})['then'](function(_0x5b0550){var _0x375d20=_0x5b0550;var _0x4c2b71=null;if(_0x375d20){_0x4c2b71=_0x375d20[_0x6ba4('0x92')]===0x1?_0x375d20[0x0]:null;}if(!_0x4c2b71&&!_0x375d20)return _0x50b463;var _0xc71a3a=_0x4eb155[_0x5e1525[_0x6ba4('0x16')]]['rawAttributes'];_0x136d71['model']=_[_0x6ba4('0x99')](_0xc71a3a);_0x136d71[_0x6ba4('0x8d')]=_[_0x6ba4('0x99')](_0x63b181[_0x6ba4('0x8d')]);_0x136d71[_0x6ba4('0x9a')]=_[_0x6ba4('0x9b')](_0x136d71[_0x6ba4('0xc')],_0x136d71[_0x6ba4('0x8d')]);_0x35d77f['attributes']=_[_0x6ba4('0x9b')](_0x136d71[_0x6ba4('0xc')],_0x2ba4eb[_0x6ba4('0x9c')](_0x63b181['query']['fields']));_0x35d77f[_0x6ba4('0x9d')]=_0x35d77f[_0x6ba4('0x9d')][_0x6ba4('0x92')]?_0x35d77f['attributes']:_0x136d71[_0x6ba4('0xc')];if(!_0x63b181[_0x6ba4('0x8d')]['hasOwnProperty'](_0x6ba4('0x9e'))){_0x35d77f[_0x6ba4('0x9f')]=_0x2ba4eb[_0x6ba4('0x9f')](_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0x9f')]);_0x35d77f[_0x6ba4('0xa0')]=_0x2ba4eb[_0x6ba4('0xa0')](_0x63b181[_0x6ba4('0x8d')]['offset']);}_0x35d77f[_0x6ba4('0xa1')]=_0x2ba4eb[_0x6ba4('0xa2')](_0x63b181['query'][_0x6ba4('0xa2')]);_0x35d77f[_0x6ba4('0x84')]=_0x2ba4eb['filters'](_['pick'](_0x63b181[_0x6ba4('0x8d')],_0x136d71[_0x6ba4('0x9a')]));if(_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0x5')]){_0x35d77f['where']=_[_0x6ba4('0xa3')](_0x35d77f[_0x6ba4('0x84')],{'$or':_[_0x6ba4('0xa')](_0xc71a3a,function(_0x2e740a){if(_0x2e740a[_0x6ba4('0x11')]['key']!==_0x6ba4('0xa4')){var _0x158662={};_0x158662[_0x2e740a[_0x6ba4('0x6')]]={'$like':'%'+_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0x5')]+'%'};return _0x158662;}})});}var _0x4af2d8=[];var _0x212dee=null;var _0x3c4cdc={};if(_0x4c2b71){_0x212dee=_[_0x6ba4('0x94')](_0xd0d799,[_0x6ba4('0x31'),_0x4c2b71[_0x6ba4('0x31')]]);if(_0x212dee[_0x6ba4('0x6')]){_0x3c4cdc={};if(_0x5e1525['childModel']==='AnalyticExtractedReport'){_0x3c4cdc[_0x212dee[_0x6ba4('0xa5')]]=_[_0x6ba4('0xa')](_0x4c2b71[_0x6ba4('0x9')],'id');}else{_0x3c4cdc[_0x212dee[_0x6ba4('0xa5')]]=_0x4c2b71[_0x6ba4('0x9')];}_0x4af2d8[_0x6ba4('0x93')](_0x3c4cdc);}else{_0x35d77f['where']['id']=_0x4c2b71[_0x6ba4('0x9')];}}else{for(var _0x35c9e4=0x0;_0x35c9e4<_0x375d20[_0x6ba4('0x92')];_0x35c9e4++){_0x212dee=_['find'](_0xd0d799,[_0x6ba4('0x31'),_0x375d20[_0x35c9e4][_0x6ba4('0x31')]]);if(_0x212dee[_0x6ba4('0x6')]){_0x3c4cdc={};_0x3c4cdc[_0x212dee[_0x6ba4('0xa5')]]=_0x375d20[_0x35c9e4][_0x6ba4('0x9')];_0x4af2d8['push'](_0x3c4cdc);}else{if(!_0x35d77f[_0x6ba4('0x84')]['id'])_0x35d77f[_0x6ba4('0x84')]['id']=[];_0x375d20[_0x35c9e4][_0x6ba4('0x9')][_0x6ba4('0xa6')](function(_0x134d7b){_0x35d77f['where']['id'][_0x6ba4('0x93')](_0x134d7b);});}}}if(!_[_0x6ba4('0x91')](_0x4af2d8)){_0x35d77f['where']=_[_0x6ba4('0xa3')](_0x35d77f[_0x6ba4('0x84')],{'$and':{'$or':_0x4af2d8}});}_0x35d77f=_[_0x6ba4('0xa3')]({},_0x35d77f,_0x63b181['options']);if(_0x4c2b71&&!_0x4c2b71[_0x6ba4('0x97')]&&_0x5e1525[_0x6ba4('0x16')]===_0x6ba4('0x10')){if(_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xa7')]){_0x35d77f[_0x6ba4('0xa8')]=[{'all':!![]}];}return _0x4eb155[_0x5e1525['childModel']][_0x6ba4('0xd')](_0x35d77f)[_0x6ba4('0x8')](function(_0x56ac18){var _0x127ee9=[];_0x56ac18[_0x6ba4('0xa6')](function(_0x4d069d){var _0xbfd479;switch(_0x4d069d[_0x6ba4('0xa9')]){case _0x6ba4('0xaa'):_0xbfd479=_[_0x6ba4('0x94')](_0x4c2b71[_0x6ba4('0x9')],function(_0x30c389){return _0x30c389['id']===_0x4d069d['reportId']&&_0x30c389[_0x6ba4('0x11')]===_0x6ba4('0xab');});break;case _0x6ba4('0xac'):_0xbfd479=_[_0x6ba4('0x94')](_0x4c2b71[_0x6ba4('0x9')],function(_0x4e6dc4){return _0x4e6dc4['id']===_0x4d069d[_0x6ba4('0x75')]&&_0x4e6dc4[_0x6ba4('0x11')]===_0x6ba4('0xad');});break;}if(_0xbfd479)_0x127ee9[_0x6ba4('0x93')](_0x4d069d);});_0x50b463['count']=_0x127ee9[_0x6ba4('0x92')];_0x50b463[_0x6ba4('0xae')]=_0x127ee9;return _0x50b463;});}else{if(!_[_0x6ba4('0x91')](_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xaf')])){_0x35d77f[_0x6ba4('0x84')]['id']=_0x35d77f['where']['id']?_[_0x6ba4('0x9b')](_0x35d77f[_0x6ba4('0x84')]['id'],_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xaf')]):_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xaf')];if(_0x63b181[_0x6ba4('0x8d')]['customSorting']){_0x35d77f[_0x6ba4('0xa1')]=_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xb0')];}}if(_0x63b181['query'][_0x6ba4('0xb1')]){_0x35d77f['where']=_[_0x6ba4('0xa3')](_0x35d77f[_0x6ba4('0x84')],{'$and':_0x63b181['query'][_0x6ba4('0xb1')]});}return _0x4eb155[_0x5e1525[_0x6ba4('0x16')]]['count']({'where':_0x35d77f[_0x6ba4('0x84')]})[_0x6ba4('0x8')](function(_0x2c9a8e){_0x50b463[_0x6ba4('0xb2')]=_0x2c9a8e;if(_0x63b181['query'][_0x6ba4('0xa7')]){if(_0x5e1525[_0x6ba4('0x16')]===_0x6ba4('0xb3')){_0x35d77f[_0x6ba4('0xa8')]=[{'model':_0x4eb155['Tag'],'as':_0x6ba4('0xb4'),'attributes':['id',_0x6ba4('0x31'),_0x6ba4('0xb5')],'required':_0x63b181['query'][_0x6ba4('0xb6')]?!![]:![]},{'model':_0x4eb155[_0x6ba4('0xb7')],'as':_0x6ba4('0xb8'),'attributes':['id','name',_0x6ba4('0xb5')],'through':_0x63b181[_0x6ba4('0x8d')]['tag']?{'attributes':[],'where':{'TagId':_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xb6')]||undefined}}:{},'required':_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xb6')]?!![]:![]}];}else{_0x35d77f['include']=[{'all':!![]}];}}return _0x4eb155[_0x5e1525[_0x6ba4('0x16')]][_0x6ba4('0xd')](_0x35d77f);})[_0x6ba4('0x8')](function(_0x5422ed){_0x50b463['rows']=_0x5422ed;if(_0x28b36b==='Agents'&&_0x63b181[_0x6ba4('0x8d')]['openTabs']===_0x6ba4('0xb9')){var _0x5de9f8=[];for(var _0x30dbfd=0x0;_0x30dbfd<_0x50b463[_0x6ba4('0xae')][_0x6ba4('0x92')];_0x30dbfd++){_0x5de9f8['push'](_0x358c7c(_0x6ba4('0xba'),_0x50b463[_0x6ba4('0xae')][_0x30dbfd][_0x6ba4('0xbb')]));_0x5de9f8['push'](_0x358c7c(_0x6ba4('0xbc'),_0x50b463['rows'][_0x30dbfd]['dataValues']));_0x5de9f8[_0x6ba4('0x93')](_0x358c7c(_0x6ba4('0xbd'),_0x50b463[_0x6ba4('0xae')][_0x30dbfd][_0x6ba4('0xbb')]));_0x5de9f8['push'](_0x358c7c(_0x6ba4('0xbe'),_0x50b463[_0x6ba4('0xae')][_0x30dbfd]['dataValues']));_0x5de9f8['push'](_0x358c7c(_0x6ba4('0xbf'),_0x50b463['rows'][_0x30dbfd][_0x6ba4('0xbb')]));_0x5de9f8[_0x6ba4('0x93')](_0x358c7c(_0x6ba4('0xc0'),_0x50b463[_0x6ba4('0xae')][_0x30dbfd][_0x6ba4('0xbb')]));}return Promise[_0x6ba4('0x98')](_0x5de9f8)[_0x6ba4('0x8')](function(){return _0x50b463;});}return _0x50b463;});}});}}});}; \ No newline at end of file +var _0x3e05=['union','ignore','autoAssociation','keys','filters','intersection','fields','attributes','limit','offset','order','sort','pick','merge','key','VIRTUAL','find','foreignKey','forEach','options','includeAll','include','reportType','default','reportId','DefaultReports','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tags','tag','ThroughTags','color','true','chat','dataValues','sms','fax','mail','openchannel','./userProfile.attributes','squel','exports','models','filter','value','findAll','then','associatedResources','map','catch','field','model','name','resolve','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','ChatQueue','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','Telephones','telephone','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','ivrcampaigns','Campaign','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','queuecampaigns','VoiceQueues','agents','telephones','Users','admin','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','Sound','tags','Tag','Template','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','all'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x3e05,0xed));var _0x53e0=function(_0x4a284d,_0x49925e){_0x4a284d=_0x4a284d-0x0;var _0x1483a0=_0x3e05[_0x4a284d];return _0x1483a0;};'use strict';var _=require('lodash');var attributes=require(_0x53e0('0x0'));var squel=require(_0x53e0('0x1'));module[_0x53e0('0x2')]=function(_0x386360){var _0x1c1a62=_0x386360[_0x53e0('0x3')];function _0xe92b77(_0xc1461e,_0x39f6c7){return new Promise(function(_0x2f363f,_0x22583a){if(!_0x39f6c7)return _0x2f363f(null);var _0x44f00e=_0x39f6c7[_0x53e0('0x4')]?{[_0x39f6c7['filter']['field']]:_0x39f6c7[_0x53e0('0x4')][_0x53e0('0x5')]}:undefined;return _0x1c1a62[_0xc1461e][_0x53e0('0x6')]({'where':_0x44f00e,'raw':!![]})[_0x53e0('0x7')](function(_0x20c7e4){_0x39f6c7[_0x53e0('0x8')]=_[_0x53e0('0x9')](_0x20c7e4,'id');_0x2f363f(_0x39f6c7);})[_0x53e0('0xa')](function(_0x134ec3){_0x22583a(_0x134ec3);});});}function _0x376d97(_0x15b993,_0x159529){return new Promise(function(_0x1487f3,_0x1da251){var _0x3dec32=_0x15b993[_0x53e0('0x4')]?{[_0x15b993[_0x53e0('0x4')][_0x53e0('0xb')]]:_0x15b993['filter'][_0x53e0('0x5')]}:undefined;return _0x1c1a62[_0x15b993[_0x53e0('0xc')]]['findAll']({'where':_0x3dec32,'raw':!![]})[_0x53e0('0x7')](function(_0x2e6474){_0x159529['associatedResources']=_['map'](_0x2e6474,function(_0x2a75ac){return _0x2a75ac[_0x53e0('0xd')];});_0x1487f3(_0x159529);})['catch'](function(_0x3391f8){_0x1da251(_0x3391f8);});});}function _0x8ac25(_0x3e5717,_0x3861cd,_0x58f8ac){if(!_0x3861cd)return Promise[_0x53e0('0xe')](null);return new Promise(function(_0x130a5f,_0x5a3b10){return _0x1c1a62['UserProfileResource'][_0x53e0('0x6')]({'where':{'sectionId':_0x3861cd['id']},'raw':!![]})['then'](function(_0x45be31){if(_0x3e5717[_0x53e0('0xb')]&&_0x3e5717[_0x53e0('0xb')]!=='id'){_0x3861cd['associatedResources']=_[_0x53e0('0x9')](_0x45be31,function(_0x10c422){return _0x10c422[_0x3e5717[_0x53e0('0xb')]];});}else{if(_0x58f8ac==='AnalyticExtractedReport'){_0x3861cd[_0x53e0('0x8')]=_[_0x53e0('0x9')](_0x45be31,function(_0x35a060){return{'id':_0x35a060[_0x53e0('0xf')],'type':_0x35a060[_0x53e0('0x10')]};});}else{_0x3861cd[_0x53e0('0x8')]=_['map'](_0x45be31,function(_0x35269c){return _0x35269c[_0x53e0('0xf')];});}}_0x130a5f(_0x3861cd);})[_0x53e0('0xa')](function(_0x5d612e){_0x5a3b10(_0x5d612e);});});}function _0x15c32f(_0x402dc0,_0x1343cf){var _0x91fadf={'parentSections':[]};switch(_0x402dc0[_0x53e0('0x11')]()){case _0x53e0('0x12'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x14');break;case _0x53e0('0x15'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x16');break;case _0x53e0('0x17'):_0x91fadf['childModel']=_0x53e0('0x18');_0x91fadf[_0x53e0('0x19')]=[{'name':_0x53e0('0x1a'),'field':_0x53e0('0xd'),'foreignKey':_0x53e0('0x1b')}];break;case _0x53e0('0x1c'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x1d');break;case _0x53e0('0x1e'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x1f');_0x91fadf[_0x53e0('0x19')]=[{'name':_0x53e0('0x20'),'field':'id','foreignKey':_0x53e0('0x21')}];break;case _0x53e0('0x22'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x23');break;case _0x53e0('0x24'):_0x91fadf['childModel']=_0x53e0('0x25');break;case _0x53e0('0x26'):_0x91fadf['childModel']='CmCustomField';break;case'chatqueues':_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x27');break;case'chatwebsites':_0x91fadf['childModel']=_0x53e0('0x28');break;case _0x53e0('0x29'):_0x91fadf['childModel']=_0x53e0('0x2a');break;case'faxaccounts':_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x2b');break;case _0x53e0('0x2c'):case _0x53e0('0x2d'):case _0x53e0('0x2e'):_0x91fadf['childModel']='VoiceExtension';break;case'contexts':_0x91fadf[_0x53e0('0x13')]='VoiceContext';break;case _0x53e0('0x2f'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x30');break;case _0x53e0('0x31'):_0x91fadf['childModel']=_0x53e0('0x32');_0x91fadf[_0x53e0('0x19')]=[{'name':_0x53e0('0x33'),'field':'name','foreignKey':_0x53e0('0x34'),'model':_0x53e0('0x35'),'filter':{'field':_0x53e0('0x36'),'value':['agent']}},{'name':_0x53e0('0x37'),'field':_0x53e0('0xd'),'foreignKey':_0x53e0('0x34'),'model':_0x53e0('0x35'),'filter':{'field':'role','value':[_0x53e0('0x38')]}},{'name':'VoiceQueues','field':_0x53e0('0xd'),'foreignKey':_0x53e0('0x39'),'model':_0x53e0('0x3a'),'filter':{'field':_0x53e0('0x10'),'value':[_0x53e0('0x3b')]}},{'name':_0x53e0('0x3c'),'field':'name','foreignKey':_0x53e0('0x39'),'model':_0x53e0('0x3a'),'filter':{'field':_0x53e0('0x10'),'value':[_0x53e0('0x3d')]}}];break;case _0x53e0('0x3e'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x3f');break;case _0x53e0('0x40'):_0x91fadf[_0x53e0('0x13')]='VoiceChanSpy';break;case'voiceprefixes':_0x91fadf[_0x53e0('0x13')]='VoicePrefix';break;case _0x53e0('0x41'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x42');break;case'mailqueues':_0x91fadf[_0x53e0('0x13')]='MailQueue';break;case _0x53e0('0x43'):_0x91fadf['childModel']=_0x53e0('0x44');break;case _0x53e0('0x45'):_0x91fadf[_0x53e0('0x13')]='MailSubstatus';break;case _0x53e0('0x46'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x47');break;case'openchannelaccounts':_0x91fadf[_0x53e0('0x13')]='OpenchannelAccount';break;case _0x53e0('0x48'):_0x91fadf['childModel']=_0x53e0('0x49');break;case _0x53e0('0x4a'):_0x91fadf[_0x53e0('0x13')]='SmsAccount';break;case _0x53e0('0x4b'):_0x91fadf['childModel']=_0x53e0('0x4c');break;case _0x53e0('0x4d'):_0x91fadf['childModel']='WhatsappAccount';break;case _0x53e0('0x4e'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x4f');break;case'voicequeues':case _0x53e0('0x50'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x3a');if(_0x1343cf){_0x91fadf[_0x53e0('0x19')]=[{'name':_0x53e0('0x51')},{'name':'QueueCampaigns'}];}break;case'users':case _0x53e0('0x52'):case _0x53e0('0x53'):_0x91fadf[_0x53e0('0x13')]='User';if(_0x1343cf){_0x91fadf[_0x53e0('0x19')]=[{'name':_0x53e0('0x54'),'filter':{'field':_0x53e0('0x36'),'value':[_0x53e0('0x55'),_0x53e0('0x56')]},'ignore':!![]},{'name':_0x53e0('0x33')},{'name':_0x53e0('0x37')}];}break;case'zendeskaccounts':_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x57');break;case _0x53e0('0x58'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x59');break;case _0x53e0('0x5a'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x5b');break;case'sugarcrmaccounts':_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x5c');break;case _0x53e0('0x5d'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x5e');break;case _0x53e0('0x5f'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x60');break;case'vtigeraccounts':_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x35');break;case _0x53e0('0x61'):_0x91fadf['childModel']=_0x53e0('0x62');break;case _0x53e0('0x63'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x64');break;case _0x53e0('0x65'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x66');break;case _0x53e0('0x67'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x68');break;case _0x53e0('0x69'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x6a');break;case _0x53e0('0x6b'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x6c');break;case'sounds':_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x6d');break;case _0x53e0('0x6e'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x6f');break;case'templates':_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x70');break;case _0x53e0('0x71'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x72');break;case _0x53e0('0x73'):_0x91fadf[_0x53e0('0x13')]='Trunk';break;case _0x53e0('0x74'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x75');break;case _0x53e0('0x76'):_0x91fadf[_0x53e0('0x13')]=_0x53e0('0x77');break;case _0x53e0('0x78'):_0x91fadf['childModel']=_0x53e0('0x79');_0x91fadf['parentSections']=[{'name':_0x53e0('0x7a'),'field':'id','foreignKey':'reportId'}];break;case _0x53e0('0x7b'):_0x91fadf['childModel']=_0x53e0('0x7c');break;}return _0x91fadf;}function _0x157ab6(_0x3d0fe4,_0x2966b6){var _0x27d6e7=_0x3d0fe4['charAt'](0x0)[_0x53e0('0x7d')]()+_0x3d0fe4[_0x53e0('0x7e')](0x1);var _0x225aa6={'type':_0x1c1a62[_0x53e0('0x7f')][_0x53e0('0x80')][_0x53e0('0x81')],'raw':!![]};return new Promise(function(_0x9ab1fe,_0x5c7dc2){var _0x338691=squel[_0x53e0('0x82')]()[_0x53e0('0xb')](_0x53e0('0x83')+_0x27d6e7+_0x53e0('0x84'),'id')[_0x53e0('0xb')](_0x53e0('0x85'))['from'](_0x53e0('0x86')+_0x3d0fe4+_0x53e0('0x87'),'ui')[_0x53e0('0x88')](_0x53e0('0x89'),_0x2966b6['id']);return _0x1c1a62['sequelize'][_0x53e0('0x8a')](_0x338691['toString'](),_0x225aa6)[_0x53e0('0x7')](function(_0xca48d8){_0x2966b6[_0x27d6e7+'OpenTabs']=_0xca48d8;_0x9ab1fe(_0xca48d8);})[_0x53e0('0xa')](function(_0xb6ca18){_0x5c7dc2(_0xb6ca18);});});}return _0x386360[_0x53e0('0x8b')](_0x53e0('0x8c'),attributes,{'tableName':_0x53e0('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x34319d){var _0x513386=require('../../components/parsers/qs');var _0x24a327={'raw':_0x34319d[_0x53e0('0x8a')][_0x53e0('0x8e')],'where':{}};var _0x3882aa={};var _0x4300a9={'count':0x0,'rows':[]};var _0xc054ba=_0x34319d[_0x53e0('0x8a')][_0x53e0('0x8f')];var _0x275d63=_0x34319d['query'][_0x53e0('0x90')]||![];var _0x571dd1=_0x15c32f(_0xc054ba,_0x275d63);if(!_0x571dd1[_0x53e0('0x13')])throw new Error(_0x53e0('0x91')+_0xc054ba+'\x27');var _0x1c6ec3=[{'name':_0xc054ba}];if(!_[_0x53e0('0x92')](_0x571dd1[_0x53e0('0x19')]))_0x1c6ec3=_0x571dd1[_0x53e0('0x19')];var _0x498ea6=[];for(var _0x33b163=0x0;_0x33b163<_0x1c6ec3[_0x53e0('0x93')];_0x33b163++){_0x498ea6[_0x53e0('0x94')](_0x1c1a62[_0x53e0('0x95')]['find']({'where':{'userProfileId':_0x34319d['params']['id'],'name':_0x1c6ec3[_0x33b163][_0x53e0('0xd')]},'raw':!![]}));}return Promise[_0x53e0('0x96')](_0x498ea6)['then'](function(_0x5a590f){var _0x5580b0=_[_0x53e0('0x4')](_0x5a590f,function(_0x5e8fca){return _0x5e8fca?_0x5e8fca:undefined;});var _0x2ed224=_[_0x53e0('0x4')](_0x1c6ec3,['ignore',!![]]);var _0x3334f3=_['isEmpty'](_0x5580b0)&&_[_0x53e0('0x92')](_0x2ed224)?null:_[_0x53e0('0x97')](_0x2ed224,_0x5580b0);if(!_0x3334f3)return null;var _0x9c29f9=[];for(var _0x11e868=0x0;_0x11e868<_0x3334f3[_0x53e0('0x93')];_0x11e868++){var _0x57d14a=_['find'](_0x1c6ec3,function(_0xf9bd63){return _0x3334f3[_0x11e868]?_0xf9bd63[_0x53e0('0xd')]===_0x3334f3[_0x11e868][_0x53e0('0xd')]:null;});if(_0x57d14a){if(_0x3334f3[_0x11e868][_0x53e0('0x98')]){_0x9c29f9[_0x53e0('0x94')](_0xe92b77(_0x571dd1[_0x53e0('0x13')],_0x3334f3[_0x11e868]));}else{if(!_0x3334f3[_0x11e868][_0x53e0('0x99')]){_0x9c29f9[_0x53e0('0x94')](_0x8ac25(_0x57d14a,_0x3334f3[_0x11e868],_0x571dd1[_0x53e0('0x13')]));}else{if(_0x57d14a[_0x53e0('0xc')]){_0x9c29f9['push'](_0x376d97(_0x57d14a,_0x3334f3[_0x11e868]));}}}}}return Promise[_0x53e0('0x96')](_0x9c29f9);})[_0x53e0('0x7')](function(_0xcc5679){var _0x3e5294=_0xcc5679;var _0x2381a=null;if(_0x3e5294){_0x2381a=_0x3e5294[_0x53e0('0x93')]===0x1?_0x3e5294[0x0]:null;}if(!_0x2381a&&!_0x3e5294)return _0x4300a9;var _0x2ab846=_0x1c1a62[_0x571dd1[_0x53e0('0x13')]]['rawAttributes'];_0x3882aa['model']=_[_0x53e0('0x9a')](_0x2ab846);_0x3882aa[_0x53e0('0x8a')]=_[_0x53e0('0x9a')](_0x34319d[_0x53e0('0x8a')]);_0x3882aa[_0x53e0('0x9b')]=_[_0x53e0('0x9c')](_0x3882aa[_0x53e0('0xc')],_0x3882aa[_0x53e0('0x8a')]);_0x24a327['attributes']=_['intersection'](_0x3882aa[_0x53e0('0xc')],_0x513386[_0x53e0('0x9d')](_0x34319d[_0x53e0('0x8a')][_0x53e0('0x9d')]));_0x24a327[_0x53e0('0x9e')]=_0x24a327['attributes'][_0x53e0('0x93')]?_0x24a327[_0x53e0('0x9e')]:_0x3882aa[_0x53e0('0xc')];if(!_0x34319d['query']['hasOwnProperty']('nolimit')){_0x24a327[_0x53e0('0x9f')]=_0x513386[_0x53e0('0x9f')](_0x34319d['query'][_0x53e0('0x9f')]);_0x24a327[_0x53e0('0xa0')]=_0x513386[_0x53e0('0xa0')](_0x34319d['query'][_0x53e0('0xa0')]);}_0x24a327[_0x53e0('0xa1')]=_0x513386[_0x53e0('0xa2')](_0x34319d[_0x53e0('0x8a')][_0x53e0('0xa2')]);_0x24a327['where']=_0x513386[_0x53e0('0x9b')](_[_0x53e0('0xa3')](_0x34319d[_0x53e0('0x8a')],_0x3882aa[_0x53e0('0x9b')]));if(_0x34319d[_0x53e0('0x8a')][_0x53e0('0x4')]){_0x24a327[_0x53e0('0x88')]=_[_0x53e0('0xa4')](_0x24a327[_0x53e0('0x88')],{'$or':_['map'](_0x2ab846,function(_0x2cf2d0){if(_0x2cf2d0[_0x53e0('0x10')][_0x53e0('0xa5')]!==_0x53e0('0xa6')){var _0x39692e={};_0x39692e[_0x2cf2d0[_0x53e0('0xb')]]={'$like':'%'+_0x34319d[_0x53e0('0x8a')][_0x53e0('0x4')]+'%'};return _0x39692e;}})});}var _0x52882d=[];var _0x5ee069=null;var _0xed0d3d={};if(_0x2381a){_0x5ee069=_[_0x53e0('0xa7')](_0x1c6ec3,[_0x53e0('0xd'),_0x2381a[_0x53e0('0xd')]]);if(_0x5ee069['field']){_0xed0d3d={};if(_0x571dd1[_0x53e0('0x13')]==='AnalyticExtractedReport'){_0xed0d3d[_0x5ee069[_0x53e0('0xa8')]]=_['map'](_0x2381a[_0x53e0('0x8')],'id');}else{_0xed0d3d[_0x5ee069[_0x53e0('0xa8')]]=_0x2381a[_0x53e0('0x8')];}_0x52882d['push'](_0xed0d3d);}else{_0x24a327['where']['id']=_0x2381a['associatedResources'];}}else{for(var _0x342ada=0x0;_0x342ada<_0x3e5294[_0x53e0('0x93')];_0x342ada++){_0x5ee069=_[_0x53e0('0xa7')](_0x1c6ec3,[_0x53e0('0xd'),_0x3e5294[_0x342ada][_0x53e0('0xd')]]);if(_0x5ee069[_0x53e0('0xb')]){_0xed0d3d={};_0xed0d3d[_0x5ee069[_0x53e0('0xa8')]]=_0x3e5294[_0x342ada]['associatedResources'];_0x52882d['push'](_0xed0d3d);}else{if(!_0x24a327['where']['id'])_0x24a327['where']['id']=[];_0x3e5294[_0x342ada][_0x53e0('0x8')][_0x53e0('0xa9')](function(_0x58f59c){_0x24a327['where']['id'][_0x53e0('0x94')](_0x58f59c);});}}}if(!_['isEmpty'](_0x52882d)){_0x24a327[_0x53e0('0x88')]=_['merge'](_0x24a327[_0x53e0('0x88')],{'$and':{'$or':_0x52882d}});}_0x24a327=_[_0x53e0('0xa4')]({},_0x24a327,_0x34319d[_0x53e0('0xaa')]);if(_0x2381a&&!_0x2381a[_0x53e0('0x99')]&&_0x571dd1[_0x53e0('0x13')]==='AnalyticExtractedReport'){if(_0x34319d[_0x53e0('0x8a')][_0x53e0('0xab')]){_0x24a327[_0x53e0('0xac')]=[{'all':!![]}];}return _0x1c1a62[_0x571dd1[_0x53e0('0x13')]][_0x53e0('0x6')](_0x24a327)[_0x53e0('0x7')](function(_0x4b011f){var _0x56f213=[];_0x4b011f[_0x53e0('0xa9')](function(_0x188767){var _0x494448;switch(_0x188767[_0x53e0('0xad')]){case _0x53e0('0xae'):_0x494448=_[_0x53e0('0xa7')](_0x2381a[_0x53e0('0x8')],function(_0x4e5cc7){return _0x4e5cc7['id']===_0x188767[_0x53e0('0xaf')]&&_0x4e5cc7[_0x53e0('0x10')]===_0x53e0('0xb0');});break;case'custom':_0x494448=_[_0x53e0('0xa7')](_0x2381a[_0x53e0('0x8')],function(_0xa32b2b){return _0xa32b2b['id']===_0x188767[_0x53e0('0xaf')]&&_0xa32b2b[_0x53e0('0x10')]===_0x53e0('0xb1');});break;}if(_0x494448)_0x56f213[_0x53e0('0x94')](_0x188767);});_0x4300a9[_0x53e0('0xb2')]=_0x56f213[_0x53e0('0x93')];_0x4300a9[_0x53e0('0xb3')]=_0x56f213;return _0x4300a9;});}else{if(!_[_0x53e0('0x92')](_0x34319d['query']['ids'])){_0x24a327['where']['id']=_0x24a327[_0x53e0('0x88')]['id']?_[_0x53e0('0x9c')](_0x24a327[_0x53e0('0x88')]['id'],_0x34319d[_0x53e0('0x8a')][_0x53e0('0xb4')]):_0x34319d[_0x53e0('0x8a')]['ids'];if(_0x34319d[_0x53e0('0x8a')][_0x53e0('0xb5')]){_0x24a327['order']=_0x34319d['query'][_0x53e0('0xb5')];}}if(_0x34319d[_0x53e0('0x8a')]['extraQueryConditions']){_0x24a327['where']=_['merge'](_0x24a327[_0x53e0('0x88')],{'$and':_0x34319d['query'][_0x53e0('0xb6')]});}return _0x1c1a62[_0x571dd1[_0x53e0('0x13')]][_0x53e0('0xb2')]({'where':_0x24a327[_0x53e0('0x88')]})['then'](function(_0x7442d2){_0x4300a9[_0x53e0('0xb2')]=_0x7442d2;if(_0x34319d['query'][_0x53e0('0xab')]){if(_0x571dd1[_0x53e0('0x13')]===_0x53e0('0x1f')){_0x24a327['include']=[{'model':_0x1c1a62[_0x53e0('0x6f')],'as':_0x53e0('0xb7'),'attributes':['id','name','color'],'required':_0x34319d[_0x53e0('0x8a')][_0x53e0('0xb8')]?!![]:![]},{'model':_0x1c1a62[_0x53e0('0x6f')],'as':_0x53e0('0xb9'),'attributes':['id','name',_0x53e0('0xba')],'through':_0x34319d[_0x53e0('0x8a')][_0x53e0('0xb8')]?{'attributes':[],'where':{'TagId':_0x34319d['query'][_0x53e0('0xb8')]||undefined}}:{},'required':_0x34319d[_0x53e0('0x8a')][_0x53e0('0xb8')]?!![]:![]}];}else{_0x24a327[_0x53e0('0xac')]=[{'all':!![]}];}}return _0x1c1a62[_0x571dd1[_0x53e0('0x13')]][_0x53e0('0x6')](_0x24a327);})[_0x53e0('0x7')](function(_0x54290a){_0x4300a9['rows']=_0x54290a;if(_0xc054ba==='Agents'&&_0x34319d[_0x53e0('0x8a')]['openTabs']===_0x53e0('0xbb')){var _0x17a3bf=[];for(var _0xb27c1b=0x0;_0xb27c1b<_0x4300a9[_0x53e0('0xb3')][_0x53e0('0x93')];_0xb27c1b++){_0x17a3bf[_0x53e0('0x94')](_0x157ab6(_0x53e0('0xbc'),_0x4300a9[_0x53e0('0xb3')][_0xb27c1b][_0x53e0('0xbd')]));_0x17a3bf[_0x53e0('0x94')](_0x157ab6(_0x53e0('0xbe'),_0x4300a9['rows'][_0xb27c1b][_0x53e0('0xbd')]));_0x17a3bf[_0x53e0('0x94')](_0x157ab6(_0x53e0('0xbf'),_0x4300a9[_0x53e0('0xb3')][_0xb27c1b]['dataValues']));_0x17a3bf[_0x53e0('0x94')](_0x157ab6(_0x53e0('0xc0'),_0x4300a9['rows'][_0xb27c1b][_0x53e0('0xbd')]));_0x17a3bf[_0x53e0('0x94')](_0x157ab6(_0x53e0('0xc1'),_0x4300a9[_0x53e0('0xb3')][_0xb27c1b][_0x53e0('0xbd')]));_0x17a3bf[_0x53e0('0x94')](_0x157ab6('whatsapp',_0x4300a9['rows'][_0xb27c1b][_0x53e0('0xbd')]));}return Promise[_0x53e0('0x96')](_0x17a3bf)[_0x53e0('0x7')](function(){return _0x4300a9;});}return _0x4300a9;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 9612c55..ac00db8 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 _0x5a43=['moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a43,0xf1));var _0x35a4=function(_0x1e5d8e,_0x143a25){_0x1e5d8e=_0x1e5d8e-0x0;var _0x9eee2b=_0x5a43[_0x1e5d8e];return _0x9eee2b;};'use strict';var _=require(_0x35a4('0x0'));var util=require(_0x35a4('0x1'));var moment=require(_0x35a4('0x2'));var BPromise=require(_0x35a4('0x3'));var rs=require(_0x35a4('0x4'));var fs=require('fs');var Redis=require(_0x35a4('0x5'));var db=require(_0x35a4('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x35a4('0x7'));var client=jayson[_0x35a4('0x8')][_0x35a4('0x9')]({'port':0x232a});config[_0x35a4('0xa')]=_[_0x35a4('0xb')](config[_0x35a4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x35a4('0xc'))(new Redis(config[_0x35a4('0xa')]));require(_0x35a4('0xd'))[_0x35a4('0xe')](socket);function respondWithRpcPromise(_0x43df6d,_0x351402,_0x4acf73){return new BPromise(function(_0x501e7e,_0x55910f){return client[_0x35a4('0xf')](_0x43df6d,_0x4acf73)['then'](function(_0x3d777f){logger[_0x35a4('0x10')](_0x35a4('0x11'),_0x351402,'request\x20sent');logger[_0x35a4('0x12')](_0x35a4('0x13'),_0x351402,_0x35a4('0x14'),JSON[_0x35a4('0x15')](_0x3d777f));if(_0x3d777f['error']){if(_0x3d777f[_0x35a4('0x16')][_0x35a4('0x17')]===0x1f4){logger['error'](_0x35a4('0x11'),_0x351402,_0x3d777f['error'][_0x35a4('0x18')]);return _0x55910f(_0x3d777f[_0x35a4('0x16')][_0x35a4('0x18')]);}logger[_0x35a4('0x16')](_0x35a4('0x11'),_0x351402,_0x3d777f[_0x35a4('0x16')][_0x35a4('0x18')]);return _0x501e7e(_0x3d777f[_0x35a4('0x16')][_0x35a4('0x18')]);}else{logger['info'](_0x35a4('0x11'),_0x351402,_0x35a4('0x14'));_0x501e7e(_0x3d777f[_0x35a4('0x19')][_0x35a4('0x18')]);}})[_0x35a4('0x1a')](function(_0x1197b0){logger[_0x35a4('0x16')](_0x35a4('0x11'),_0x351402,_0x1197b0);_0x55910f(_0x1197b0);});});} \ No newline at end of file +var _0x6eec=['./userProfile.socket','request','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x871a5f,_0x99bb24){var _0x62b59b=function(_0x33c254){while(--_0x33c254){_0x871a5f['push'](_0x871a5f['shift']());}};_0x62b59b(++_0x99bb24);}(_0x6eec,0x1e0));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc6ee('0x0'));var util=require(_0xc6ee('0x1'));var moment=require(_0xc6ee('0x2'));var BPromise=require(_0xc6ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6ee('0x4'));var db=require(_0xc6ee('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6ee('0x6'))(_0xc6ee('0x7'));var config=require(_0xc6ee('0x8'));var jayson=require(_0xc6ee('0x9'));var client=jayson[_0xc6ee('0xa')][_0xc6ee('0xb')]({'port':0x232a});config[_0xc6ee('0xc')]=_[_0xc6ee('0xd')](config[_0xc6ee('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc6ee('0xc')]));require(_0xc6ee('0xe'))['register'](socket);function respondWithRpcPromise(_0x10a743,_0x5f57ec,_0x294274){return new BPromise(function(_0x2e999c,_0x405ce3){return client[_0xc6ee('0xf')](_0x10a743,_0x294274)['then'](function(_0x122a94){logger[_0xc6ee('0x10')](_0xc6ee('0x11'),_0x5f57ec,'request\x20sent');logger[_0xc6ee('0x12')](_0xc6ee('0x13'),_0x5f57ec,_0xc6ee('0x14'),JSON['stringify'](_0x122a94));if(_0x122a94[_0xc6ee('0x15')]){if(_0x122a94[_0xc6ee('0x15')][_0xc6ee('0x16')]===0x1f4){logger['error'](_0xc6ee('0x11'),_0x5f57ec,_0x122a94[_0xc6ee('0x15')][_0xc6ee('0x17')]);return _0x405ce3(_0x122a94['error'][_0xc6ee('0x17')]);}logger[_0xc6ee('0x15')](_0xc6ee('0x11'),_0x5f57ec,_0x122a94[_0xc6ee('0x15')][_0xc6ee('0x17')]);return _0x2e999c(_0x122a94[_0xc6ee('0x15')][_0xc6ee('0x17')]);}else{logger[_0xc6ee('0x10')](_0xc6ee('0x11'),_0x5f57ec,_0xc6ee('0x14'));_0x2e999c(_0x122a94[_0xc6ee('0x18')][_0xc6ee('0x17')]);}})[_0xc6ee('0x19')](function(_0xee8280){logger[_0xc6ee('0x15')](_0xc6ee('0x11'),_0x5f57ec,_0xee8280);_0x405ce3(_0xee8280);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 931b4eb..4a61b62 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 _0xa49e=['userProfile:','./userProfile.events','save','update','emit','length'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa49e,0x1bd));var _0xea49=function(_0x41159b,_0x18ae88){_0x41159b=_0x41159b-0x0;var _0x5bea4e=_0xa49e[_0x41159b];return _0x5bea4e;};'use strict';var UserProfileEvents=require(_0xea49('0x0'));var events=[_0xea49('0x1'),'remove',_0xea49('0x2')];function createListener(_0x4ccea0,_0x44e4e8){return function(_0x2e8093){_0x44e4e8[_0xea49('0x3')](_0x4ccea0,_0x2e8093);};}function removeListener(_0x20d82e,_0x26baea){return function(){UserProfileEvents['removeListener'](_0x20d82e,_0x26baea);};}exports['register']=function(_0x56f6b2){for(var _0x506ee4=0x0,_0x39029b=events[_0xea49('0x4')];_0x506ee4<_0x39029b;_0x506ee4++){var _0x457e67=events[_0x506ee4];var _0x357839=createListener(_0xea49('0x5')+_0x457e67,_0x56f6b2);UserProfileEvents['on'](_0x457e67,_0x357839);}}; \ No newline at end of file +var _0x9a24=['save','register','length','userProfile:','./userProfile.events'];(function(_0x26b54a,_0x499677){var _0x63654a=function(_0x321f29){while(--_0x321f29){_0x26b54a['push'](_0x26b54a['shift']());}};_0x63654a(++_0x499677);}(_0x9a24,0x16c));var _0x49a2=function(_0x75e96b,_0x4a8152){_0x75e96b=_0x75e96b-0x0;var _0x16faa8=_0x9a24[_0x75e96b];return _0x16faa8;};'use strict';var UserProfileEvents=require(_0x49a2('0x0'));var events=[_0x49a2('0x1'),'remove','update'];function createListener(_0x34faa8,_0x3dbc63){return function(_0x3be547){_0x3dbc63['emit'](_0x34faa8,_0x3be547);};}function removeListener(_0x3961d4,_0xf02773){return function(){UserProfileEvents['removeListener'](_0x3961d4,_0xf02773);};}exports[_0x49a2('0x2')]=function(_0x39c1a6){for(var _0x3efe0a=0x0,_0x3cf1b5=events[_0x49a2('0x3')];_0x3efe0a<_0x3cf1b5;_0x3efe0a++){var _0xdb393c=events[_0x3efe0a];var _0x228584=createListener(_0x49a2('0x4')+_0xdb393c,_0x39c1a6);UserProfileEvents['on'](_0xdb393c,_0x228584);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 280fd53..aedba01 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 _0x23ec=['../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','index','describe','isAuthenticated','show','post','create','put','update','/:id','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x3adbae,_0x1a6e96){var _0xcb7316=function(_0x3fb628){while(--_0x3fb628){_0x3adbae['push'](_0x3adbae['shift']());}};_0xcb7316(++_0x1a6e96);}(_0x23ec,0x19e));var _0xc23e=function(_0x23efa3,_0x2ee0ef){_0x23efa3=_0x23efa3-0x0;var _0x236df0=_0x23ec[_0x23efa3];return _0x236df0;};'use strict';var multer=require(_0xc23e('0x0'));var util=require(_0xc23e('0x1'));var path=require(_0xc23e('0x2'));var timeout=require('connect-timeout');var express=require(_0xc23e('0x3'));var router=express[_0xc23e('0x4')]();var fs_extra=require(_0xc23e('0x5'));var auth=require(_0xc23e('0x6'));var interaction=require(_0xc23e('0x7'));var config=require('../../config/environment');var controller=require(_0xc23e('0x8'));router[_0xc23e('0x9')]('/',auth['isAuthenticated'](),controller[_0xc23e('0xa')]);router[_0xc23e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xc23e('0xb')]);router[_0xc23e('0x9')]('/:id',auth[_0xc23e('0xc')](),controller[_0xc23e('0xd')]);router[_0xc23e('0xe')]('/',auth[_0xc23e('0xc')](),controller[_0xc23e('0xf')]);router[_0xc23e('0x10')]('/:id',auth[_0xc23e('0xc')](),controller[_0xc23e('0x11')]);router['delete'](_0xc23e('0x12'),auth[_0xc23e('0xc')](),controller[_0xc23e('0x13')]);module[_0xc23e('0x14')]=router; \ No newline at end of file +var _0x4bde=['destroy','exports','multer','util','connect-timeout','fs-extra','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','update','/:id'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x4bde,0x101));var _0xe4bd=function(_0x1d8238,_0x7d9d9){_0x1d8238=_0x1d8238-0x0;var _0x322544=_0x4bde[_0x1d8238];return _0x322544;};'use strict';var multer=require(_0xe4bd('0x0'));var util=require(_0xe4bd('0x1'));var path=require('path');var timeout=require(_0xe4bd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe4bd('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe4bd('0x4'));var controller=require(_0xe4bd('0x5'));router[_0xe4bd('0x6')]('/',auth[_0xe4bd('0x7')](),controller[_0xe4bd('0x8')]);router[_0xe4bd('0x6')](_0xe4bd('0x9'),auth[_0xe4bd('0x7')](),controller[_0xe4bd('0xa')]);router[_0xe4bd('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xe4bd('0x7')](),controller['create']);router['put']('/:id',auth[_0xe4bd('0x7')](),controller[_0xe4bd('0xb')]);router['delete'](_0xe4bd('0xc'),auth[_0xe4bd('0x7')](),controller[_0xe4bd('0xd')]);module[_0xe4bd('0xe')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 0c54557..e04fda9 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 _0x5675=['STRING','INTEGER','sequelize','exports'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x5675,0x1b2));var _0x5567=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x5675[_0x409353];return _0x4f4b59;};'use strict';var Sequelize=require(_0x5567('0x0'));module[_0x5567('0x1')]={'name':{'type':Sequelize[_0x5567('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x5567('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x14c7=['sequelize','exports','STRING','INTEGER'];(function(_0x4c30ca,_0x1d61f4){var _0x2fa336=function(_0x1f4df9){while(--_0x1f4df9){_0x4c30ca['push'](_0x4c30ca['shift']());}};_0x2fa336(++_0x1d61f4);}(_0x14c7,0x94));var _0x714c=function(_0x56be03,_0xae36e7){_0x56be03=_0x56be03-0x0;var _0x41f6ef=_0x14c7[_0x56be03];return _0x41f6ef;};'use strict';var Sequelize=require(_0x714c('0x0'));module[_0x714c('0x1')]={'name':{'type':Sequelize[_0x714c('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x714c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x714c('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index f99b259..ab77df4 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 _0x1261=['end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','UserProfileResource','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','create','catch','body','describe','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','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x465e84,_0x40dacc){var _0x511c5d=function(_0x477e0e){while(--_0x477e0e){_0x465e84['push'](_0x465e84['shift']());}};_0x511c5d(++_0x40dacc);}(_0x1261,0x144));var _0x1126=function(_0x30f395,_0x3629b5){_0x30f395=_0x30f395-0x0;var _0x2ea0ee=_0x1261[_0x30f395];return _0x2ea0ee;};'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);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['UserProfileResource'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['UserProfileResource']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')](_0x512f60['body'],{})[_0x1126('0x25')](respondWithResult(_0x5111d3,0xc9))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports['update']=function(_0x3e4eeb,_0xbdde58){if(_0x3e4eeb[_0x1126('0x44')]['id']){delete _0x3e4eeb['body']['id'];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x3e4eeb[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0xbdde58,null))[_0x1126('0x25')](saveUpdates(_0x3e4eeb[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0xbdde58,null))[_0x1126('0x43')](handleError(_0xbdde58,null));};exports['destroy']=function(_0x1b8b83,_0x5a2287){return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x1b8b83['params']['id']}})['then'](handleEntityNotFound(_0x5a2287,null))[_0x1126('0x25')](removeEntity(_0x5a2287,null))[_0x1126('0x43')](handleError(_0x5a2287,null));};exports[_0x1126('0x45')]=function(_0x52a9a4,_0x3cb44c){return db[_0x1126('0x29')][_0x1126('0x45')]()[_0x1126('0x25')](respondWithResult(_0x3cb44c,null))['catch'](handleError(_0x3cb44c,null));}; \ No newline at end of file +var _0x1883=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileResource','includeAll','include','findAll','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x28eb8c,_0x983a4c){var _0x492d99=function(_0x4e1f9e){while(--_0x4e1f9e){_0x28eb8c['push'](_0x28eb8c['shift']());}};_0x492d99(++_0x983a4c);}(_0x1883,0xab));var _0x3188=function(_0x2cd68b,_0x30b9a3){_0x2cd68b=_0x2cd68b-0x0;var _0x5dbc2d=_0x1883[_0x2cd68b];return _0x5dbc2d;};'use strict';var emlformat=require(_0x3188('0x0'));var rimraf=require(_0x3188('0x1'));var zipdir=require(_0x3188('0x2'));var jsonpatch=require(_0x3188('0x3'));var rp=require(_0x3188('0x4'));var moment=require(_0x3188('0x5'));var BPromise=require(_0x3188('0x6'));var Mustache=require(_0x3188('0x7'));var util=require(_0x3188('0x8'));var path=require(_0x3188('0x9'));var sox=require(_0x3188('0xa'));var csv=require(_0x3188('0xb'));var ejs=require(_0x3188('0xc'));var fs=require('fs');var fs_extra=require(_0x3188('0xd'));var _=require(_0x3188('0xe'));var squel=require(_0x3188('0xf'));var crypto=require(_0x3188('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x3188('0x11'));var toCsv=require(_0x3188('0xb'));var querystring=require('querystring');var Papa=require(_0x3188('0x12'));var Redis=require('ioredis');var authService=require(_0x3188('0x13'));var qs=require(_0x3188('0x14'));var as=require(_0x3188('0x15'));var hardwareService=require(_0x3188('0x16'));var logger=require('../../config/logger')(_0x3188('0x17'));var utils=require(_0x3188('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3188('0x19'))['db'];function respondWithStatusCode(_0x45e94e,_0x20fef6){_0x20fef6=_0x20fef6||0xcc;return function(_0x3ae228){if(_0x3ae228){return _0x45e94e[_0x3188('0x1a')](_0x20fef6);}return _0x45e94e[_0x3188('0x1b')](_0x20fef6)['end']();};}function respondWithResult(_0x276d69,_0x5e0044){_0x5e0044=_0x5e0044||0xc8;return function(_0x4a2f36){if(_0x4a2f36){return _0x276d69[_0x3188('0x1b')](_0x5e0044)['json'](_0x4a2f36);}};}function respondWithFilteredResult(_0x54a87f,_0x32c239){return function(_0x1beead){if(_0x1beead){var _0xa2269=typeof _0x32c239[_0x3188('0x1c')]===_0x3188('0x1d')&&typeof _0x32c239[_0x3188('0x1e')]==='undefined';var _0x19cc72=_0x1beead[_0x3188('0x1f')];var _0x3f5b35=_0xa2269?0x0:_0x32c239[_0x3188('0x1c')];var _0x18a71a=_0xa2269?_0x1beead[_0x3188('0x1f')]:_0x32c239[_0x3188('0x1c')]+_0x32c239[_0x3188('0x1e')];var _0x5bcbba;if(_0x18a71a>=_0x19cc72){_0x18a71a=_0x19cc72;_0x5bcbba=0xc8;}else{_0x5bcbba=0xce;}_0x54a87f[_0x3188('0x1b')](_0x5bcbba);return _0x54a87f[_0x3188('0x20')]('Content-Range',_0x3f5b35+'-'+_0x18a71a+'/'+_0x19cc72)['json'](_0x1beead);}return null;};}function patchUpdates(_0x5d8d62){return function(_0x46a318){try{jsonpatch[_0x3188('0x21')](_0x46a318,_0x5d8d62,!![]);}catch(_0xd292b5){return BPromise['reject'](_0xd292b5);}return _0x46a318['save']();};}function saveUpdates(_0x266260,_0x461286){return function(_0x375077){if(_0x375077){return _0x375077[_0x3188('0x22')](_0x266260)[_0x3188('0x23')](function(_0x4bd5ee){return _0x4bd5ee;});}return null;};}function removeEntity(_0x30cf2c,_0x33f882){return function(_0x5a2e67){if(_0x5a2e67){return _0x5a2e67[_0x3188('0x24')]()['then'](function(){_0x30cf2c['status'](0xcc)[_0x3188('0x25')]();});}};}function handleEntityNotFound(_0x129bd7,_0x87d5a3){return function(_0x1aeaba){if(!_0x1aeaba){_0x129bd7[_0x3188('0x1a')](0x194);}return _0x1aeaba;};}function handleError(_0x2cd060,_0xe57f73){_0xe57f73=_0xe57f73||0x1f4;return function(_0x11021c){logger['error'](_0x11021c[_0x3188('0x26')]);if(_0x11021c[_0x3188('0x27')]){delete _0x11021c['name'];}_0x2cd060[_0x3188('0x1b')](_0xe57f73)[_0x3188('0x28')](_0x11021c);};}exports[_0x3188('0x29')]=function(_0x44db9a,_0x20e6aa){var _0x1f1c6f={},_0x8f810f={},_0x472926={'count':0x0,'rows':[]};var _0x57c21c=_[_0x3188('0x2a')](db['UserProfileResource'][_0x3188('0x2b')],function(_0x5623f1){return{'name':_0x5623f1[_0x3188('0x2c')],'type':_0x5623f1[_0x3188('0x2d')][_0x3188('0x2e')]};});_0x8f810f[_0x3188('0x2f')]=_[_0x3188('0x2a')](_0x57c21c,_0x3188('0x27'));_0x8f810f[_0x3188('0x30')]=_[_0x3188('0x31')](_0x44db9a[_0x3188('0x30')]);_0x8f810f[_0x3188('0x32')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],_0x8f810f[_0x3188('0x30')]);_0x1f1c6f[_0x3188('0x34')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],qs[_0x3188('0x35')](_0x44db9a[_0x3188('0x30')]['fields']));_0x1f1c6f[_0x3188('0x34')]=_0x1f1c6f['attributes'][_0x3188('0x36')]?_0x1f1c6f[_0x3188('0x34')]:_0x8f810f['model'];if(!_0x44db9a[_0x3188('0x30')][_0x3188('0x37')](_0x3188('0x38'))){_0x1f1c6f[_0x3188('0x1e')]=qs[_0x3188('0x1e')](_0x44db9a[_0x3188('0x30')][_0x3188('0x1e')]);_0x1f1c6f['offset']=qs['offset'](_0x44db9a[_0x3188('0x30')][_0x3188('0x1c')]);}_0x1f1c6f[_0x3188('0x39')]=qs[_0x3188('0x3a')](_0x44db9a['query'][_0x3188('0x3a')]);_0x1f1c6f[_0x3188('0x3b')]=qs[_0x3188('0x32')](_[_0x3188('0x3c')](_0x44db9a['query'],_0x8f810f[_0x3188('0x32')]),_0x57c21c);if(_0x44db9a['query'][_0x3188('0x3d')]){_0x1f1c6f['where']=_[_0x3188('0x3e')](_0x1f1c6f[_0x3188('0x3b')],{'$or':_[_0x3188('0x2a')](_0x57c21c,function(_0x2990c4){if(_0x2990c4[_0x3188('0x2d')]!==_0x3188('0x3f')){var _0x4666b2={};_0x4666b2[_0x2990c4[_0x3188('0x27')]]={'$like':'%'+_0x44db9a[_0x3188('0x30')][_0x3188('0x3d')]+'%'};return _0x4666b2;}})});}_0x1f1c6f=_['merge']({},_0x1f1c6f,_0x44db9a[_0x3188('0x40')]);var _0x2bad0f={'where':_0x1f1c6f[_0x3188('0x3b')]};return db[_0x3188('0x41')][_0x3188('0x1f')](_0x2bad0f)[_0x3188('0x23')](function(_0x5a815d){_0x472926[_0x3188('0x1f')]=_0x5a815d;if(_0x44db9a['query'][_0x3188('0x42')]){_0x1f1c6f[_0x3188('0x43')]=[{'all':!![]}];}return db[_0x3188('0x41')][_0x3188('0x44')](_0x1f1c6f);})[_0x3188('0x23')](function(_0x549ab2){_0x472926['rows']=_0x549ab2;return _0x472926;})['then'](respondWithFilteredResult(_0x20e6aa,_0x1f1c6f))['catch'](handleError(_0x20e6aa,null));};exports['show']=function(_0x763943,_0x28c224){var _0x3e5f90={'raw':![],'where':{'id':_0x763943[_0x3188('0x45')]['id']}},_0x1b40b1={};_0x1b40b1['model']=_[_0x3188('0x31')](db['UserProfileResource'][_0x3188('0x2b')]);_0x1b40b1[_0x3188('0x30')]=_[_0x3188('0x31')](_0x763943[_0x3188('0x30')]);_0x1b40b1['filters']=_[_0x3188('0x33')](_0x1b40b1[_0x3188('0x2f')],_0x1b40b1[_0x3188('0x30')]);_0x3e5f90[_0x3188('0x34')]=_[_0x3188('0x33')](_0x1b40b1['model'],qs['fields'](_0x763943[_0x3188('0x30')][_0x3188('0x35')]));_0x3e5f90['attributes']=_0x3e5f90[_0x3188('0x34')][_0x3188('0x36')]?_0x3e5f90['attributes']:_0x1b40b1[_0x3188('0x2f')];if(_0x763943[_0x3188('0x30')][_0x3188('0x42')]){_0x3e5f90[_0x3188('0x43')]=[{'all':!![]}];}_0x3e5f90=_[_0x3188('0x3e')]({},_0x3e5f90,_0x763943['options']);return db[_0x3188('0x41')]['find'](_0x3e5f90)[_0x3188('0x23')](handleEntityNotFound(_0x28c224,null))[_0x3188('0x23')](respondWithResult(_0x28c224,null))[_0x3188('0x46')](handleError(_0x28c224,null));};exports[_0x3188('0x47')]=function(_0xe4cbb0,_0x315524){return db[_0x3188('0x41')][_0x3188('0x47')](_0xe4cbb0[_0x3188('0x48')],{})[_0x3188('0x23')](respondWithResult(_0x315524,0xc9))[_0x3188('0x46')](handleError(_0x315524,null));};exports['update']=function(_0x50fd56,_0x1b012d){if(_0x50fd56['body']['id']){delete _0x50fd56[_0x3188('0x48')]['id'];}return db[_0x3188('0x41')]['find']({'where':{'id':_0x50fd56[_0x3188('0x45')]['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x1b012d,null))[_0x3188('0x23')](saveUpdates(_0x50fd56[_0x3188('0x48')],null))[_0x3188('0x23')](respondWithResult(_0x1b012d,null))[_0x3188('0x46')](handleError(_0x1b012d,null));};exports[_0x3188('0x24')]=function(_0x1e3592,_0x59a177){return db[_0x3188('0x41')][_0x3188('0x49')]({'where':{'id':_0x1e3592['params']['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x59a177,null))['then'](removeEntity(_0x59a177,null))[_0x3188('0x46')](handleError(_0x59a177,null));};exports[_0x3188('0x4a')]=function(_0x4f8852,_0x559264){return db['UserProfileResource']['describe']()['then'](respondWithResult(_0x559264,null))['catch'](handleError(_0x559264,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 125e5b5..7be65bd 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 _0x47f7=['bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','moment'];(function(_0x3da1f4,_0x5a337c){var _0x153a99=function(_0x13a2bf){while(--_0x13a2bf){_0x3da1f4['push'](_0x3da1f4['shift']());}};_0x153a99(++_0x5a337c);}(_0x47f7,0x7a));var _0x747f=function(_0x4d04fa,_0x35ad63){_0x4d04fa=_0x4d04fa-0x0;var _0xfa49cd=_0x47f7[_0x4d04fa];return _0xfa49cd;};'use strict';var _=require(_0x747f('0x0'));var util=require(_0x747f('0x1'));var logger=require(_0x747f('0x2'))('api');var moment=require(_0x747f('0x3'));var BPromise=require(_0x747f('0x4'));var rp=require(_0x747f('0x5'));var fs=require('fs');var path=require(_0x747f('0x6'));var rimraf=require('rimraf');var config=require(_0x747f('0x7'));var attributes=require(_0x747f('0x8'));module['exports']=function(_0x4905a3,_0x4266af){return _0x4905a3[_0x747f('0x9')](_0x747f('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x747f('0xb'),'fields':[_0x747f('0xc'),_0x747f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0919=['bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','sectionId','lodash','util','../../config/logger'];(function(_0x20e213,_0x2fd9d0){var _0x169a3f=function(_0x1310f8){while(--_0x1310f8){_0x20e213['push'](_0x20e213['shift']());}};_0x169a3f(++_0x2fd9d0);}(_0x0919,0x152));var _0x9091=function(_0x5300b6,_0x4a5846){_0x5300b6=_0x5300b6-0x0;var _0x58980e=_0x0919[_0x5300b6];return _0x58980e;};'use strict';var _=require(_0x9091('0x0'));var util=require(_0x9091('0x1'));var logger=require(_0x9091('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9091('0x3'));var rp=require(_0x9091('0x4'));var fs=require('fs');var path=require(_0x9091('0x5'));var rimraf=require(_0x9091('0x6'));var config=require(_0x9091('0x7'));var attributes=require(_0x9091('0x8'));module[_0x9091('0x9')]=function(_0x210d3c,_0x3d7067){return _0x210d3c['define']('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0x9091('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 4106fcf..d8645c0 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 _0xaeb3=['message','request\x20sent','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s'];(function(_0x18cdcc,_0x52c867){var _0x497c03=function(_0x122bcf){while(--_0x122bcf){_0x18cdcc['push'](_0x18cdcc['shift']());}};_0x497c03(++_0x52c867);}(_0xaeb3,0x12e));var _0x3aeb=function(_0x1833cd,_0x369128){_0x1833cd=_0x1833cd-0x0;var _0x4360ac=_0xaeb3[_0x1833cd];return _0x4360ac;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3aeb('0x0'));var BPromise=require(_0x3aeb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3aeb('0x2'));var db=require(_0x3aeb('0x3'))['db'];var utils=require(_0x3aeb('0x4'));var logger=require(_0x3aeb('0x5'))(_0x3aeb('0x6'));var config=require(_0x3aeb('0x7'));var jayson=require(_0x3aeb('0x8'));var client=jayson[_0x3aeb('0x9')][_0x3aeb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x203405,_0x1be4d4,_0x19e17e){return new BPromise(function(_0x14f814,_0x41c14d){return client[_0x3aeb('0xb')](_0x203405,_0x19e17e)[_0x3aeb('0xc')](function(_0x2b0625){logger[_0x3aeb('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x1be4d4,'request\x20sent');logger[_0x3aeb('0xe')](_0x3aeb('0xf'),_0x1be4d4,'request\x20sent',JSON[_0x3aeb('0x10')](_0x2b0625));if(_0x2b0625[_0x3aeb('0x11')]){if(_0x2b0625[_0x3aeb('0x11')][_0x3aeb('0x12')]===0x1f4){logger[_0x3aeb('0x11')](_0x3aeb('0x13'),_0x1be4d4,_0x2b0625[_0x3aeb('0x11')][_0x3aeb('0x14')]);return _0x41c14d(_0x2b0625['error'][_0x3aeb('0x14')]);}logger[_0x3aeb('0x11')](_0x3aeb('0x13'),_0x1be4d4,_0x2b0625[_0x3aeb('0x11')][_0x3aeb('0x14')]);return _0x14f814(_0x2b0625[_0x3aeb('0x11')][_0x3aeb('0x14')]);}else{logger[_0x3aeb('0xd')](_0x3aeb('0x13'),_0x1be4d4,_0x3aeb('0x15'));_0x14f814(_0x2b0625['result'][_0x3aeb('0x14')]);}})[_0x3aeb('0x16')](function(_0x493a75){logger['error'](_0x3aeb('0x13'),_0x1be4d4,_0x493a75);_0x41c14d(_0x493a75);});});} \ No newline at end of file +var _0x96d9=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x45e709,_0x461674){var _0x3cd8e9=function(_0x50aa49){while(--_0x50aa49){_0x45e709['push'](_0x45e709['shift']());}};_0x3cd8e9(++_0x461674);}(_0x96d9,0xea));var _0x996d=function(_0x277ee2,_0x43428b){_0x277ee2=_0x277ee2-0x0;var _0xb5001c=_0x96d9[_0x277ee2];return _0xb5001c;};'use strict';var _=require(_0x996d('0x0'));var util=require(_0x996d('0x1'));var moment=require(_0x996d('0x2'));var BPromise=require(_0x996d('0x3'));var rs=require(_0x996d('0x4'));var fs=require('fs');var Redis=require(_0x996d('0x5'));var db=require(_0x996d('0x6'))['db'];var utils=require(_0x996d('0x7'));var logger=require('../../config/logger')(_0x996d('0x8'));var config=require(_0x996d('0x9'));var jayson=require(_0x996d('0xa'));var client=jayson[_0x996d('0xb')][_0x996d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x427a02,_0x327d3e,_0x4d65b5){return new BPromise(function(_0x40c142,_0x344899){return client[_0x996d('0xd')](_0x427a02,_0x4d65b5)[_0x996d('0xe')](function(_0x31694c){logger['info'](_0x996d('0xf'),_0x327d3e,_0x996d('0x10'));logger[_0x996d('0x11')](_0x996d('0x12'),_0x327d3e,'request\x20sent',JSON[_0x996d('0x13')](_0x31694c));if(_0x31694c[_0x996d('0x14')]){if(_0x31694c['error']['code']===0x1f4){logger['error'](_0x996d('0xf'),_0x327d3e,_0x31694c[_0x996d('0x14')]['message']);return _0x344899(_0x31694c[_0x996d('0x14')][_0x996d('0x15')]);}logger['error'](_0x996d('0xf'),_0x327d3e,_0x31694c[_0x996d('0x14')][_0x996d('0x15')]);return _0x40c142(_0x31694c['error'][_0x996d('0x15')]);}else{logger['info'](_0x996d('0xf'),_0x327d3e,_0x996d('0x10'));_0x40c142(_0x31694c[_0x996d('0x16')][_0x996d('0x15')]);}})[_0x996d('0x17')](function(_0x87f980){logger[_0x996d('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x327d3e,_0x87f980);_0x344899(_0x87f980);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c5c155f..ccb316a 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 _0x3f0a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','multer','util','path'];(function(_0x22f12f,_0x348375){var _0x4b5fea=function(_0x21caac){while(--_0x21caac){_0x22f12f['push'](_0x22f12f['shift']());}};_0x4b5fea(++_0x348375);}(_0x3f0a,0xbd));var _0xa3f0=function(_0x59e1de,_0x3be68d){_0x59e1de=_0x59e1de-0x0;var _0x49d797=_0x3f0a[_0x59e1de];return _0x49d797;};'use strict';var multer=require(_0xa3f0('0x0'));var util=require(_0xa3f0('0x1'));var path=require(_0xa3f0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa3f0('0x3')]();var fs_extra=require(_0xa3f0('0x4'));var auth=require(_0xa3f0('0x5'));var interaction=require(_0xa3f0('0x6'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0xa3f0('0x7')]('/',auth[_0xa3f0('0x8')](),controller['index']);router[_0xa3f0('0x7')](_0xa3f0('0x9'),auth[_0xa3f0('0x8')](),controller[_0xa3f0('0xa')]);router['get'](_0xa3f0('0xb'),auth[_0xa3f0('0x8')](),controller[_0xa3f0('0xc')]);router['post']('/',auth[_0xa3f0('0x8')](),controller[_0xa3f0('0xd')]);router[_0xa3f0('0xe')]('/:id',auth[_0xa3f0('0x8')](),controller[_0xa3f0('0xf')]);router['delete'](_0xa3f0('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5f0f=['/:id','show','post','create','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x5bf8e4,_0x1af25c){var _0x2b88e0=function(_0x3dad3d){while(--_0x3dad3d){_0x5bf8e4['push'](_0x5bf8e4['shift']());}};_0x2b88e0(++_0x1af25c);}(_0x5f0f,0xc3));var _0xf5f0=function(_0x14daaf,_0x150d41){_0x14daaf=_0x14daaf-0x0;var _0x51fe45=_0x5f0f[_0x14daaf];return _0x51fe45;};'use strict';var multer=require(_0xf5f0('0x0'));var util=require('util');var path=require(_0xf5f0('0x1'));var timeout=require(_0xf5f0('0x2'));var express=require(_0xf5f0('0x3'));var router=express[_0xf5f0('0x4')]();var fs_extra=require(_0xf5f0('0x5'));var auth=require(_0xf5f0('0x6'));var interaction=require(_0xf5f0('0x7'));var config=require(_0xf5f0('0x8'));var controller=require(_0xf5f0('0x9'));router['get']('/',auth[_0xf5f0('0xa')](),controller[_0xf5f0('0xb')]);router[_0xf5f0('0xc')](_0xf5f0('0xd'),auth[_0xf5f0('0xa')](),controller[_0xf5f0('0xe')]);router[_0xf5f0('0xc')](_0xf5f0('0xf'),auth['isAuthenticated'](),controller[_0xf5f0('0x10')]);router[_0xf5f0('0x11')]('/',auth['isAuthenticated'](),controller[_0xf5f0('0x12')]);router['put'](_0xf5f0('0xf'),auth[_0xf5f0('0xa')](),controller['update']);router['delete'](_0xf5f0('0xf'),auth['isAuthenticated'](),controller[_0xf5f0('0x13')]);module[_0xf5f0('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 1f83135..0001516 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 _0xab40=['STRING','setDataValue','getDataValue','crudPermissions','split','sequelize','exports','BOOLEAN'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_0xab40,0xcd));var _0x0ab4=function(_0x6d3304,_0x1f70e1){_0x6d3304=_0x6d3304-0x0;var _0x53ff27=_0xab40[_0x6d3304];return _0x53ff27;};'use strict';var Sequelize=require(_0x0ab4('0x0'));module[_0x0ab4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0ab4('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0ab4('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0ab4('0x3')],'set':function(_0x2bf1ba){this[_0x0ab4('0x4')]('crudPermissions',_0x2bf1ba?_0x2bf1ba['join'](''):[]);},'get':function(){return this[_0x0ab4('0x5')]('crudPermissions')?this[_0x0ab4('0x5')](_0x0ab4('0x6'))[_0x0ab4('0x7')](''):[];}}}; \ No newline at end of file +var _0x5ec6=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split','sequelize'];(function(_0x15716a,_0x3e6958){var _0x548da0=function(_0xc42439){while(--_0xc42439){_0x15716a['push'](_0x15716a['shift']());}};_0x548da0(++_0x3e6958);}(_0x5ec6,0x7f));var _0x65ec=function(_0x5b7c74,_0x4af5ae){_0x5b7c74=_0x5b7c74-0x0;var _0x8c1dd=_0x5ec6[_0x5b7c74];return _0x8c1dd;};'use strict';var Sequelize=require(_0x65ec('0x0'));module[_0x65ec('0x1')]={'name':{'type':Sequelize[_0x65ec('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x65ec('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x65ec('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x33751d){this['setDataValue'](_0x65ec('0x5'),_0x33751d?_0x33751d['join'](''):[]);},'get':function(){return this[_0x65ec('0x6')](_0x65ec('0x5'))?this['getDataValue'](_0x65ec('0x5'))[_0x65ec('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 53a22fd..bc08473 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 _0x6649=['rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','show','params','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','stack','name','index','map','UserProfileSection'];(function(_0x2a2e62,_0x54ccc3){var _0x6ae6af=function(_0x2dff19){while(--_0x2dff19){_0x2a2e62['push'](_0x2a2e62['shift']());}};_0x6ae6af(++_0x54ccc3);}(_0x6649,0xf0));var _0x9664=function(_0x31adc3,_0x3c5a5b){_0x31adc3=_0x31adc3-0x0;var _0x34bcbb=_0x6649[_0x31adc3];return _0x34bcbb;};'use strict';var emlformat=require(_0x9664('0x0'));var rimraf=require(_0x9664('0x1'));var zipdir=require(_0x9664('0x2'));var jsonpatch=require(_0x9664('0x3'));var rp=require(_0x9664('0x4'));var moment=require('moment');var BPromise=require(_0x9664('0x5'));var Mustache=require(_0x9664('0x6'));var util=require('util');var path=require(_0x9664('0x7'));var sox=require(_0x9664('0x8'));var csv=require(_0x9664('0x9'));var ejs=require(_0x9664('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9664('0xb'));var squel=require(_0x9664('0xc'));var crypto=require(_0x9664('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9664('0xe'));var toCsv=require(_0x9664('0x9'));var querystring=require(_0x9664('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9664('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9664('0x11'));var logger=require(_0x9664('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9664('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9664('0x14'))['db'];function respondWithStatusCode(_0x55b06a,_0x492299){_0x492299=_0x492299||0xcc;return function(_0x4dbcb7){if(_0x4dbcb7){return _0x55b06a[_0x9664('0x15')](_0x492299);}return _0x55b06a[_0x9664('0x16')](_0x492299)[_0x9664('0x17')]();};}function respondWithResult(_0x30a11a,_0x473db2){_0x473db2=_0x473db2||0xc8;return function(_0x328806){if(_0x328806){return _0x30a11a[_0x9664('0x16')](_0x473db2)[_0x9664('0x18')](_0x328806);}};}function respondWithFilteredResult(_0x4aa5f,_0x1b1b4f){return function(_0x465cad){if(_0x465cad){var _0x566d6f=typeof _0x1b1b4f[_0x9664('0x19')]===_0x9664('0x1a')&&typeof _0x1b1b4f[_0x9664('0x1b')]===_0x9664('0x1a');var _0x22ca95=_0x465cad[_0x9664('0x1c')];var _0x17e268=_0x566d6f?0x0:_0x1b1b4f[_0x9664('0x19')];var _0x220f2b=_0x566d6f?_0x465cad[_0x9664('0x1c')]:_0x1b1b4f[_0x9664('0x19')]+_0x1b1b4f[_0x9664('0x1b')];var _0xc86ff4;if(_0x220f2b>=_0x22ca95){_0x220f2b=_0x22ca95;_0xc86ff4=0xc8;}else{_0xc86ff4=0xce;}_0x4aa5f[_0x9664('0x16')](_0xc86ff4);return _0x4aa5f['set'](_0x9664('0x1d'),_0x17e268+'-'+_0x220f2b+'/'+_0x22ca95)[_0x9664('0x18')](_0x465cad);}return null;};}function patchUpdates(_0x4298ef){return function(_0x2c4b22){try{jsonpatch[_0x9664('0x1e')](_0x2c4b22,_0x4298ef,!![]);}catch(_0x515f7f){return BPromise[_0x9664('0x1f')](_0x515f7f);}return _0x2c4b22[_0x9664('0x20')]();};}function saveUpdates(_0x2f610b,_0x37adec){return function(_0x554f4){if(_0x554f4){return _0x554f4[_0x9664('0x21')](_0x2f610b)[_0x9664('0x22')](function(_0x45ed2e){return _0x45ed2e;});}return null;};}function removeEntity(_0xe97433,_0x383feb){return function(_0x27f2bb){if(_0x27f2bb){return _0x27f2bb['destroy']()[_0x9664('0x22')](function(){_0xe97433['status'](0xcc)[_0x9664('0x17')]();});}};}function handleEntityNotFound(_0xc9b109,_0x44ede8){return function(_0x1992b8){if(!_0x1992b8){_0xc9b109['sendStatus'](0x194);}return _0x1992b8;};}function handleError(_0x197389,_0x19c967){_0x19c967=_0x19c967||0x1f4;return function(_0x38da73){logger['error'](_0x38da73[_0x9664('0x23')]);if(_0x38da73[_0x9664('0x24')]){delete _0x38da73[_0x9664('0x24')];}_0x197389[_0x9664('0x16')](_0x19c967)['send'](_0x38da73);};}exports[_0x9664('0x25')]=function(_0x11ae2e,_0xd3b00c){var _0x4fb046={},_0x1b52b5={},_0x2e6252={'count':0x0,'rows':[]};var _0x4412b9=_[_0x9664('0x26')](db[_0x9664('0x27')][_0x9664('0x28')],function(_0x53cab4){return{'name':_0x53cab4['fieldName'],'type':_0x53cab4['type'][_0x9664('0x29')]};});_0x1b52b5[_0x9664('0x2a')]=_[_0x9664('0x26')](_0x4412b9,_0x9664('0x24'));_0x1b52b5[_0x9664('0x2b')]=_[_0x9664('0x2c')](_0x11ae2e[_0x9664('0x2b')]);_0x1b52b5[_0x9664('0x2d')]=_['intersection'](_0x1b52b5[_0x9664('0x2a')],_0x1b52b5['query']);_0x4fb046[_0x9664('0x2e')]=_[_0x9664('0x2f')](_0x1b52b5[_0x9664('0x2a')],qs[_0x9664('0x30')](_0x11ae2e['query'][_0x9664('0x30')]));_0x4fb046['attributes']=_0x4fb046[_0x9664('0x2e')]['length']?_0x4fb046[_0x9664('0x2e')]:_0x1b52b5[_0x9664('0x2a')];if(!_0x11ae2e['query'][_0x9664('0x31')](_0x9664('0x32'))){_0x4fb046[_0x9664('0x1b')]=qs[_0x9664('0x1b')](_0x11ae2e[_0x9664('0x2b')][_0x9664('0x1b')]);_0x4fb046[_0x9664('0x19')]=qs[_0x9664('0x19')](_0x11ae2e[_0x9664('0x2b')][_0x9664('0x19')]);}_0x4fb046[_0x9664('0x33')]=qs['sort'](_0x11ae2e[_0x9664('0x2b')][_0x9664('0x34')]);_0x4fb046[_0x9664('0x35')]=qs[_0x9664('0x2d')](_[_0x9664('0x36')](_0x11ae2e['query'],_0x1b52b5[_0x9664('0x2d')]),_0x4412b9);if(_0x11ae2e[_0x9664('0x2b')][_0x9664('0x37')]){_0x4fb046[_0x9664('0x35')]=_[_0x9664('0x38')](_0x4fb046[_0x9664('0x35')],{'$or':_[_0x9664('0x26')](_0x4412b9,function(_0x51e5df){if(_0x51e5df[_0x9664('0x39')]!==_0x9664('0x3a')){var _0x230639={};_0x230639[_0x51e5df[_0x9664('0x24')]]={'$like':'%'+_0x11ae2e[_0x9664('0x2b')]['filter']+'%'};return _0x230639;}})});}_0x4fb046=_[_0x9664('0x38')]({},_0x4fb046,_0x11ae2e['options']);var _0x827d78={'where':_0x4fb046[_0x9664('0x35')]};return db[_0x9664('0x27')][_0x9664('0x1c')](_0x827d78)[_0x9664('0x22')](function(_0x7d10){_0x2e6252[_0x9664('0x1c')]=_0x7d10;if(_0x11ae2e[_0x9664('0x2b')][_0x9664('0x3b')]){_0x4fb046[_0x9664('0x3c')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x4fb046);})[_0x9664('0x22')](function(_0x207dfd){_0x2e6252[_0x9664('0x3d')]=_0x207dfd;return _0x2e6252;})[_0x9664('0x22')](respondWithFilteredResult(_0xd3b00c,_0x4fb046))['catch'](handleError(_0xd3b00c,null));};exports[_0x9664('0x3e')]=function(_0x21bd23,_0x9ffbb4){var _0x5af71e={'raw':![],'where':{'id':_0x21bd23[_0x9664('0x3f')]['id']}},_0x3db683={};_0x3db683[_0x9664('0x2a')]=_['keys'](db[_0x9664('0x27')][_0x9664('0x28')]);_0x3db683[_0x9664('0x2b')]=_[_0x9664('0x2c')](_0x21bd23[_0x9664('0x2b')]);_0x3db683['filters']=_[_0x9664('0x2f')](_0x3db683[_0x9664('0x2a')],_0x3db683[_0x9664('0x2b')]);_0x5af71e[_0x9664('0x2e')]=_[_0x9664('0x2f')](_0x3db683[_0x9664('0x2a')],qs[_0x9664('0x30')](_0x21bd23[_0x9664('0x2b')]['fields']));_0x5af71e[_0x9664('0x2e')]=_0x5af71e[_0x9664('0x2e')]['length']?_0x5af71e['attributes']:_0x3db683['model'];if(_0x21bd23[_0x9664('0x2b')][_0x9664('0x3b')]){_0x5af71e[_0x9664('0x3c')]=[{'all':!![]}];}_0x5af71e=_[_0x9664('0x38')]({},_0x5af71e,_0x21bd23['options']);return db[_0x9664('0x27')][_0x9664('0x40')](_0x5af71e)[_0x9664('0x22')](handleEntityNotFound(_0x9ffbb4,null))[_0x9664('0x22')](respondWithResult(_0x9ffbb4,null))['catch'](handleError(_0x9ffbb4,null));};exports[_0x9664('0x41')]=function(_0x5a435a,_0x343fd0){return db['UserProfileSection'][_0x9664('0x41')](_0x5a435a[_0x9664('0x42')],{})['then'](respondWithResult(_0x343fd0,0xc9))[_0x9664('0x43')](handleError(_0x343fd0,null));};exports['update']=function(_0x37329e,_0x5ec009){if(_0x37329e[_0x9664('0x42')]['id']){delete _0x37329e['body']['id'];}return db[_0x9664('0x27')][_0x9664('0x40')]({'where':{'id':_0x37329e[_0x9664('0x3f')]['id']}})[_0x9664('0x22')](handleEntityNotFound(_0x5ec009,null))['then'](saveUpdates(_0x37329e[_0x9664('0x42')],null))[_0x9664('0x22')](respondWithResult(_0x5ec009,null))[_0x9664('0x43')](handleError(_0x5ec009,null));};exports[_0x9664('0x44')]=function(_0x5ef5ea,_0x568297){return db['UserProfileSection'][_0x9664('0x40')]({'where':{'id':_0x5ef5ea[_0x9664('0x3f')]['id']}})[_0x9664('0x22')](handleEntityNotFound(_0x568297,null))['then'](removeEntity(_0x568297,null))[_0x9664('0x43')](handleError(_0x568297,null));};exports[_0x9664('0x45')]=function(_0x405e46,_0x1fb1ce){return db[_0x9664('0x27')][_0x9664('0x45')]()[_0x9664('0x22')](respondWithResult(_0x1fb1ce,null))[_0x9664('0x43')](handleError(_0x1fb1ce,null));}; \ No newline at end of file +var _0x9f49=['order','sort','where','merge','VIRTUAL','filter','options','include','rows','params','fields','find','catch','create','body','describe','eml-format','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty'];(function(_0x151ac6,_0x16988d){var _0x34bfd2=function(_0x55a105){while(--_0x55a105){_0x151ac6['push'](_0x151ac6['shift']());}};_0x34bfd2(++_0x16988d);}(_0x9f49,0xa6));var _0x99f4=function(_0x925867,_0x2b426d){_0x925867=_0x925867-0x0;var _0x373455=_0x9f49[_0x925867];return _0x373455;};'use strict';var emlformat=require(_0x99f4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x99f4('0x1'));var jsonpatch=require(_0x99f4('0x2'));var rp=require(_0x99f4('0x3'));var moment=require(_0x99f4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x99f4('0x5'));var util=require(_0x99f4('0x6'));var path=require(_0x99f4('0x7'));var sox=require(_0x99f4('0x8'));var csv=require(_0x99f4('0x9'));var ejs=require(_0x99f4('0xa'));var fs=require('fs');var fs_extra=require(_0x99f4('0xb'));var _=require(_0x99f4('0xc'));var squel=require(_0x99f4('0xd'));var crypto=require(_0x99f4('0xe'));var jsforce=require(_0x99f4('0xf'));var deskjs=require(_0x99f4('0x10'));var toCsv=require(_0x99f4('0x9'));var querystring=require(_0x99f4('0x11'));var Papa=require(_0x99f4('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x99f4('0x13'));var as=require(_0x99f4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99f4('0x15'))(_0x99f4('0x16'));var utils=require('../../config/utils');var config=require(_0x99f4('0x17'));var licenseUtil=require(_0x99f4('0x18'));var db=require(_0x99f4('0x19'))['db'];function respondWithStatusCode(_0x47a9f6,_0x3f957d){_0x3f957d=_0x3f957d||0xcc;return function(_0x34d085){if(_0x34d085){return _0x47a9f6[_0x99f4('0x1a')](_0x3f957d);}return _0x47a9f6[_0x99f4('0x1b')](_0x3f957d)[_0x99f4('0x1c')]();};}function respondWithResult(_0x4d13a9,_0x78383f){_0x78383f=_0x78383f||0xc8;return function(_0x927dfd){if(_0x927dfd){return _0x4d13a9['status'](_0x78383f)[_0x99f4('0x1d')](_0x927dfd);}};}function respondWithFilteredResult(_0x413ec2,_0x3d121c){return function(_0x2c5057){if(_0x2c5057){var _0x1826e8=typeof _0x3d121c['offset']===_0x99f4('0x1e')&&typeof _0x3d121c['limit']===_0x99f4('0x1e');var _0x3104ab=_0x2c5057[_0x99f4('0x1f')];var _0x845ba1=_0x1826e8?0x0:_0x3d121c['offset'];var _0x1a0e94=_0x1826e8?_0x2c5057['count']:_0x3d121c[_0x99f4('0x20')]+_0x3d121c[_0x99f4('0x21')];var _0x2bef07;if(_0x1a0e94>=_0x3104ab){_0x1a0e94=_0x3104ab;_0x2bef07=0xc8;}else{_0x2bef07=0xce;}_0x413ec2[_0x99f4('0x1b')](_0x2bef07);return _0x413ec2[_0x99f4('0x22')](_0x99f4('0x23'),_0x845ba1+'-'+_0x1a0e94+'/'+_0x3104ab)[_0x99f4('0x1d')](_0x2c5057);}return null;};}function patchUpdates(_0x5c1149){return function(_0x5f5000){try{jsonpatch[_0x99f4('0x24')](_0x5f5000,_0x5c1149,!![]);}catch(_0x2f4ed2){return BPromise[_0x99f4('0x25')](_0x2f4ed2);}return _0x5f5000['save']();};}function saveUpdates(_0x11171d,_0x7262eb){return function(_0x272e89){if(_0x272e89){return _0x272e89[_0x99f4('0x26')](_0x11171d)[_0x99f4('0x27')](function(_0x44e26b){return _0x44e26b;});}return null;};}function removeEntity(_0x3e02d8,_0x4d435a){return function(_0x4256e3){if(_0x4256e3){return _0x4256e3[_0x99f4('0x28')]()['then'](function(){_0x3e02d8['status'](0xcc)[_0x99f4('0x1c')]();});}};}function handleEntityNotFound(_0x5e47a8,_0x4e9f98){return function(_0x3a5f03){if(!_0x3a5f03){_0x5e47a8[_0x99f4('0x1a')](0x194);}return _0x3a5f03;};}function handleError(_0x5d0d03,_0x519bd9){_0x519bd9=_0x519bd9||0x1f4;return function(_0x327cbe){logger[_0x99f4('0x29')](_0x327cbe['stack']);if(_0x327cbe[_0x99f4('0x2a')]){delete _0x327cbe[_0x99f4('0x2a')];}_0x5d0d03[_0x99f4('0x1b')](_0x519bd9)[_0x99f4('0x2b')](_0x327cbe);};}exports[_0x99f4('0x2c')]=function(_0x3532ad,_0x3a4df5){var _0x1aeda1={},_0x1beeb7={},_0x4a99ed={'count':0x0,'rows':[]};var _0x2f9302=_[_0x99f4('0x2d')](db[_0x99f4('0x2e')][_0x99f4('0x2f')],function(_0x111f00){return{'name':_0x111f00[_0x99f4('0x30')],'type':_0x111f00[_0x99f4('0x31')][_0x99f4('0x32')]};});_0x1beeb7[_0x99f4('0x33')]=_[_0x99f4('0x2d')](_0x2f9302,_0x99f4('0x2a'));_0x1beeb7[_0x99f4('0x34')]=_[_0x99f4('0x35')](_0x3532ad[_0x99f4('0x34')]);_0x1beeb7[_0x99f4('0x36')]=_[_0x99f4('0x37')](_0x1beeb7[_0x99f4('0x33')],_0x1beeb7[_0x99f4('0x34')]);_0x1aeda1[_0x99f4('0x38')]=_[_0x99f4('0x37')](_0x1beeb7['model'],qs['fields'](_0x3532ad['query']['fields']));_0x1aeda1[_0x99f4('0x38')]=_0x1aeda1[_0x99f4('0x38')][_0x99f4('0x39')]?_0x1aeda1['attributes']:_0x1beeb7[_0x99f4('0x33')];if(!_0x3532ad['query'][_0x99f4('0x3a')]('nolimit')){_0x1aeda1[_0x99f4('0x21')]=qs['limit'](_0x3532ad[_0x99f4('0x34')][_0x99f4('0x21')]);_0x1aeda1[_0x99f4('0x20')]=qs[_0x99f4('0x20')](_0x3532ad['query'][_0x99f4('0x20')]);}_0x1aeda1[_0x99f4('0x3b')]=qs['sort'](_0x3532ad[_0x99f4('0x34')][_0x99f4('0x3c')]);_0x1aeda1[_0x99f4('0x3d')]=qs[_0x99f4('0x36')](_['pick'](_0x3532ad[_0x99f4('0x34')],_0x1beeb7[_0x99f4('0x36')]),_0x2f9302);if(_0x3532ad[_0x99f4('0x34')]['filter']){_0x1aeda1['where']=_[_0x99f4('0x3e')](_0x1aeda1[_0x99f4('0x3d')],{'$or':_['map'](_0x2f9302,function(_0xe53c4d){if(_0xe53c4d[_0x99f4('0x31')]!==_0x99f4('0x3f')){var _0x9ba2b6={};_0x9ba2b6[_0xe53c4d[_0x99f4('0x2a')]]={'$like':'%'+_0x3532ad[_0x99f4('0x34')][_0x99f4('0x40')]+'%'};return _0x9ba2b6;}})});}_0x1aeda1=_[_0x99f4('0x3e')]({},_0x1aeda1,_0x3532ad[_0x99f4('0x41')]);var _0xa75fed={'where':_0x1aeda1[_0x99f4('0x3d')]};return db[_0x99f4('0x2e')][_0x99f4('0x1f')](_0xa75fed)['then'](function(_0x24d8ff){_0x4a99ed[_0x99f4('0x1f')]=_0x24d8ff;if(_0x3532ad[_0x99f4('0x34')]['includeAll']){_0x1aeda1[_0x99f4('0x42')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x1aeda1);})[_0x99f4('0x27')](function(_0xb4360a){_0x4a99ed[_0x99f4('0x43')]=_0xb4360a;return _0x4a99ed;})['then'](respondWithFilteredResult(_0x3a4df5,_0x1aeda1))['catch'](handleError(_0x3a4df5,null));};exports['show']=function(_0xde3800,_0x2a587b){var _0x269372={'raw':![],'where':{'id':_0xde3800[_0x99f4('0x44')]['id']}},_0x12a4f5={};_0x12a4f5[_0x99f4('0x33')]=_[_0x99f4('0x35')](db[_0x99f4('0x2e')]['rawAttributes']);_0x12a4f5[_0x99f4('0x34')]=_[_0x99f4('0x35')](_0xde3800['query']);_0x12a4f5[_0x99f4('0x36')]=_[_0x99f4('0x37')](_0x12a4f5['model'],_0x12a4f5[_0x99f4('0x34')]);_0x269372[_0x99f4('0x38')]=_[_0x99f4('0x37')](_0x12a4f5['model'],qs[_0x99f4('0x45')](_0xde3800[_0x99f4('0x34')]['fields']));_0x269372[_0x99f4('0x38')]=_0x269372[_0x99f4('0x38')]['length']?_0x269372['attributes']:_0x12a4f5['model'];if(_0xde3800[_0x99f4('0x34')]['includeAll']){_0x269372[_0x99f4('0x42')]=[{'all':!![]}];}_0x269372=_['merge']({},_0x269372,_0xde3800[_0x99f4('0x41')]);return db[_0x99f4('0x2e')][_0x99f4('0x46')](_0x269372)[_0x99f4('0x27')](handleEntityNotFound(_0x2a587b,null))[_0x99f4('0x27')](respondWithResult(_0x2a587b,null))[_0x99f4('0x47')](handleError(_0x2a587b,null));};exports['create']=function(_0x43f4a7,_0x595c1c){return db[_0x99f4('0x2e')][_0x99f4('0x48')](_0x43f4a7['body'],{})[_0x99f4('0x27')](respondWithResult(_0x595c1c,0xc9))['catch'](handleError(_0x595c1c,null));};exports[_0x99f4('0x26')]=function(_0x1305f5,_0xcfa83f){if(_0x1305f5[_0x99f4('0x49')]['id']){delete _0x1305f5[_0x99f4('0x49')]['id'];}return db[_0x99f4('0x2e')]['find']({'where':{'id':_0x1305f5[_0x99f4('0x44')]['id']}})[_0x99f4('0x27')](handleEntityNotFound(_0xcfa83f,null))[_0x99f4('0x27')](saveUpdates(_0x1305f5[_0x99f4('0x49')],null))[_0x99f4('0x27')](respondWithResult(_0xcfa83f,null))['catch'](handleError(_0xcfa83f,null));};exports[_0x99f4('0x28')]=function(_0x1f17bb,_0x16ab1b){return db[_0x99f4('0x2e')]['find']({'where':{'id':_0x1f17bb['params']['id']}})[_0x99f4('0x27')](handleEntityNotFound(_0x16ab1b,null))[_0x99f4('0x27')](removeEntity(_0x16ab1b,null))['catch'](handleError(_0x16ab1b,null));};exports[_0x99f4('0x4a')]=function(_0x36b040,_0xd9d2bc){return db[_0x99f4('0x2e')][_0x99f4('0x4a')]()['then'](respondWithResult(_0xd9d2bc,null))['catch'](handleError(_0xd9d2bc,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index ea467bd..19b3373 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 _0xc49e=['request-promise','path','rimraf','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash','util','../../config/logger','api','moment'];(function(_0xea937e,_0x5642f2){var _0x3a2fb4=function(_0xdc215e){while(--_0xdc215e){_0xea937e['push'](_0xea937e['shift']());}};_0x3a2fb4(++_0x5642f2);}(_0xc49e,0x1bd));var _0xec49=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xc49e[_0x1ae5ab];return _0x1ce001;};'use strict';var _=require(_0xec49('0x0'));var util=require(_0xec49('0x1'));var logger=require(_0xec49('0x2'))(_0xec49('0x3'));var moment=require(_0xec49('0x4'));var BPromise=require('bluebird');var rp=require(_0xec49('0x5'));var fs=require('fs');var path=require(_0xec49('0x6'));var rimraf=require(_0xec49('0x7'));var config=require(_0xec49('0x8'));var attributes=require('./userProfileSection.attributes');module[_0xec49('0x9')]=function(_0x29579e,_0x4b34ef){return _0x29579e[_0xec49('0xa')](_0xec49('0xb'),attributes,{'tableName':_0xec49('0xc'),'paranoid':![],'indexes':[{'name':_0xec49('0xd'),'fields':[_0xec49('0xe'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb648=['rimraf','../../config/environment','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','util','../../config/logger','api','moment','request-promise','path'];(function(_0x542c50,_0x56473f){var _0x11384f=function(_0x403418){while(--_0x403418){_0x542c50['push'](_0x542c50['shift']());}};_0x11384f(++_0x56473f);}(_0xb648,0xfe));var _0x8b64=function(_0x2b0a86,_0x2ecebd){_0x2b0a86=_0x2b0a86-0x0;var _0x955940=_0xb648[_0x2b0a86];return _0x955940;};'use strict';var _=require('lodash');var util=require(_0x8b64('0x0'));var logger=require(_0x8b64('0x1'))(_0x8b64('0x2'));var moment=require(_0x8b64('0x3'));var BPromise=require('bluebird');var rp=require(_0x8b64('0x4'));var fs=require('fs');var path=require(_0x8b64('0x5'));var rimraf=require(_0x8b64('0x6'));var config=require(_0x8b64('0x7'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x59cb25,_0x55f229){return _0x59cb25[_0x8b64('0x8')](_0x8b64('0x9'),attributes,{'tableName':_0x8b64('0xa'),'paranoid':![],'indexes':[{'name':_0x8b64('0xb'),'fields':[_0x8b64('0xc'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 17da188..72fb3fb 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 _0xba77=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xc80b70,_0x2ea72a){var _0x11679f=function(_0x244c64){while(--_0x244c64){_0xc80b70['push'](_0xc80b70['shift']());}};_0x11679f(++_0x2ea72a);}(_0xba77,0x133));var _0x7ba7=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xba77[_0x1e6db3];return _0x1de886;};'use strict';var _=require(_0x7ba7('0x0'));var util=require(_0x7ba7('0x1'));var moment=require(_0x7ba7('0x2'));var BPromise=require(_0x7ba7('0x3'));var rs=require(_0x7ba7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ba7('0x5'))['db'];var utils=require(_0x7ba7('0x6'));var logger=require(_0x7ba7('0x7'))(_0x7ba7('0x8'));var config=require(_0x7ba7('0x9'));var jayson=require(_0x7ba7('0xa'));var client=jayson[_0x7ba7('0xb')][_0x7ba7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1425d7,_0x1f6427,_0x21331f){return new BPromise(function(_0x3a47a9,_0x488e73){return client[_0x7ba7('0xd')](_0x1425d7,_0x21331f)[_0x7ba7('0xe')](function(_0x5b968d){logger[_0x7ba7('0xf')](_0x7ba7('0x10'),_0x1f6427,_0x7ba7('0x11'));logger[_0x7ba7('0x12')](_0x7ba7('0x13'),_0x1f6427,_0x7ba7('0x11'),JSON[_0x7ba7('0x14')](_0x5b968d));if(_0x5b968d[_0x7ba7('0x15')]){if(_0x5b968d[_0x7ba7('0x15')][_0x7ba7('0x16')]===0x1f4){logger[_0x7ba7('0x15')](_0x7ba7('0x10'),_0x1f6427,_0x5b968d[_0x7ba7('0x15')][_0x7ba7('0x17')]);return _0x488e73(_0x5b968d[_0x7ba7('0x15')][_0x7ba7('0x17')]);}logger[_0x7ba7('0x15')](_0x7ba7('0x10'),_0x1f6427,_0x5b968d[_0x7ba7('0x15')][_0x7ba7('0x17')]);return _0x3a47a9(_0x5b968d[_0x7ba7('0x15')][_0x7ba7('0x17')]);}else{logger[_0x7ba7('0xf')](_0x7ba7('0x10'),_0x1f6427,_0x7ba7('0x11'));_0x3a47a9(_0x5b968d[_0x7ba7('0x18')]['message']);}})[_0x7ba7('0x19')](function(_0x2e5d7e){logger[_0x7ba7('0x15')](_0x7ba7('0x10'),_0x1f6427,_0x2e5d7e);_0x488e73(_0x2e5d7e);});});} \ No newline at end of file +var _0x3c21=['../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x147c96,_0x309657){var _0x4ec711=function(_0x3cf7c9){while(--_0x3cf7c9){_0x147c96['push'](_0x147c96['shift']());}};_0x4ec711(++_0x309657);}(_0x3c21,0x19e));var _0x13c2=function(_0x3b6138,_0x11c13b){_0x3b6138=_0x3b6138-0x0;var _0x1b2023=_0x3c21[_0x3b6138];return _0x1b2023;};'use strict';var _=require('lodash');var util=require(_0x13c2('0x0'));var moment=require('moment');var BPromise=require(_0x13c2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c2('0x2'));var db=require(_0x13c2('0x3'))['db'];var utils=require(_0x13c2('0x4'));var logger=require(_0x13c2('0x5'))('rpc');var config=require(_0x13c2('0x6'));var jayson=require(_0x13c2('0x7'));var client=jayson[_0x13c2('0x8')][_0x13c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc30c80,_0x8f69,_0x31a3c9){return new BPromise(function(_0x45e9b2,_0x185f44){return client[_0x13c2('0xa')](_0xc30c80,_0x31a3c9)[_0x13c2('0xb')](function(_0x4330d0){logger[_0x13c2('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x8f69,'request\x20sent');logger[_0x13c2('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x8f69,_0x13c2('0xe'),JSON['stringify'](_0x4330d0));if(_0x4330d0[_0x13c2('0xf')]){if(_0x4330d0[_0x13c2('0xf')][_0x13c2('0x10')]===0x1f4){logger[_0x13c2('0xf')](_0x13c2('0x11'),_0x8f69,_0x4330d0[_0x13c2('0xf')][_0x13c2('0x12')]);return _0x185f44(_0x4330d0[_0x13c2('0xf')][_0x13c2('0x12')]);}logger[_0x13c2('0xf')](_0x13c2('0x11'),_0x8f69,_0x4330d0['error'][_0x13c2('0x12')]);return _0x45e9b2(_0x4330d0['error'][_0x13c2('0x12')]);}else{logger[_0x13c2('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x8f69,_0x13c2('0xe'));_0x45e9b2(_0x4330d0[_0x13c2('0x13')]['message']);}})[_0x13c2('0x14')](function(_0x506737){logger[_0x13c2('0xf')](_0x13c2('0x11'),_0x8f69,_0x506737);_0x185f44(_0x506737);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 3050a2b..a7a8152 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x516bdc,_0xd206c1){var _0x1badb5=function(_0xea4285){while(--_0xea4285){_0x516bdc['push'](_0x516bdc['shift']());}};_0x1badb5(++_0xd206c1);}(_0xe706,0xa3));var _0x6e70=function(_0x568427,_0x742280){_0x568427=_0x568427-0x0;var _0x3c2f86=_0xe706[_0x568427];return _0x3c2f86;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index baf4d77..94e1eeb 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 _0x9963=['INTEGER','sequelize','exports'];(function(_0x16e1ed,_0x177714){var _0xef3e0a=function(_0xe8e638){while(--_0xe8e638){_0x16e1ed['push'](_0x16e1ed['shift']());}};_0xef3e0a(++_0x177714);}(_0x9963,0x1c0));var _0x3996=function(_0x397bfb,_0x589665){_0x397bfb=_0x397bfb-0x0;var _0x16c9b9=_0x9963[_0x397bfb];return _0x16c9b9;};'use strict';var Sequelize=require(_0x3996('0x0'));module[_0x3996('0x1')]={'penalty':{'type':Sequelize[_0x3996('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3bd0=['sequelize','exports','INTEGER'];(function(_0x4594e2,_0x25da51){var _0x4be202=function(_0x2ca967){while(--_0x2ca967){_0x4594e2['push'](_0x4594e2['shift']());}};_0x4be202(++_0x25da51);}(_0x3bd0,0x93));var _0x03bd=function(_0x5448a9,_0x4764da){_0x5448a9=_0x5448a9-0x0;var _0x1924af=_0x3bd0[_0x5448a9];return _0x1924af;};'use strict';var Sequelize=require(_0x03bd('0x0'));module[_0x03bd('0x1')]={'penalty':{'type':Sequelize[_0x03bd('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 507b698..2dc6133 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 _0xb511=['rimraf','../../config/environment','exports','define','UserSmsQueue','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb511,0x165));var _0x1b51=function(_0x458f56,_0x3c646e){_0x458f56=_0x458f56-0x0;var _0x582c1c=_0xb511[_0x458f56];return _0x582c1c;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var logger=require(_0x1b51('0x2'))('api');var moment=require(_0x1b51('0x3'));var BPromise=require(_0x1b51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b51('0x5'));var rimraf=require(_0x1b51('0x6'));var config=require(_0x1b51('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0x1b51('0x8')]=function(_0x463bec,_0x506653){return _0x463bec[_0x1b51('0x9')](_0x1b51('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb46f=['request-promise','path','../../config/environment','exports','define','UserSmsQueue','lodash','util','api','moment','bluebird'];(function(_0x55f63a,_0x4c01c5){var _0x309b61=function(_0x5071f4){while(--_0x5071f4){_0x55f63a['push'](_0x55f63a['shift']());}};_0x309b61(++_0x4c01c5);}(_0xb46f,0xb6));var _0xfb46=function(_0x3ba40d,_0x463b68){_0x3ba40d=_0x3ba40d-0x0;var _0x190bf6=_0xb46f[_0x3ba40d];return _0x190bf6;};'use strict';var _=require(_0xfb46('0x0'));var util=require(_0xfb46('0x1'));var logger=require('../../config/logger')(_0xfb46('0x2'));var moment=require(_0xfb46('0x3'));var BPromise=require(_0xfb46('0x4'));var rp=require(_0xfb46('0x5'));var fs=require('fs');var path=require(_0xfb46('0x6'));var rimraf=require('rimraf');var config=require(_0xfb46('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xfb46('0x8')]=function(_0x3a5255,_0x186da6){return _0x3a5255[_0xfb46('0x9')](_0xfb46('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index bcbeef4..45c6578 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 _0x3cf9=['../../config/utils','../../config/logger','../../config/environment','http','then','info','UserSmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2e250f,_0x163411){var _0x3c4935=function(_0x35bfb5){while(--_0x35bfb5){_0x2e250f['push'](_0x2e250f['shift']());}};_0x3c4935(++_0x163411);}(_0x3cf9,0xea));var _0x93cf=function(_0x514c24,_0x4f0170){_0x514c24=_0x514c24-0x0;var _0x4db7e5=_0x3cf9[_0x514c24];return _0x4db7e5;};'use strict';var _=require(_0x93cf('0x0'));var util=require(_0x93cf('0x1'));var moment=require(_0x93cf('0x2'));var BPromise=require('bluebird');var rs=require(_0x93cf('0x3'));var fs=require('fs');var Redis=require(_0x93cf('0x4'));var db=require(_0x93cf('0x5'))['db'];var utils=require(_0x93cf('0x6'));var logger=require(_0x93cf('0x7'))('rpc');var config=require(_0x93cf('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x93cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50493b,_0x5b4289,_0x4dbf8b){return new BPromise(function(_0x285988,_0x5b13b4){return client['request'](_0x50493b,_0x4dbf8b)[_0x93cf('0xa')](function(_0x636574){logger[_0x93cf('0xb')](_0x93cf('0xc'),_0x5b4289,'request\x20sent');logger[_0x93cf('0xd')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x5b4289,_0x93cf('0xe'),JSON[_0x93cf('0xf')](_0x636574));if(_0x636574[_0x93cf('0x10')]){if(_0x636574[_0x93cf('0x10')][_0x93cf('0x11')]===0x1f4){logger[_0x93cf('0x10')](_0x93cf('0xc'),_0x5b4289,_0x636574[_0x93cf('0x10')][_0x93cf('0x12')]);return _0x5b13b4(_0x636574[_0x93cf('0x10')]['message']);}logger['error'](_0x93cf('0xc'),_0x5b4289,_0x636574[_0x93cf('0x10')][_0x93cf('0x12')]);return _0x285988(_0x636574[_0x93cf('0x10')][_0x93cf('0x12')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x5b4289,'request\x20sent');_0x285988(_0x636574[_0x93cf('0x13')][_0x93cf('0x12')]);}})['catch'](function(_0x149801){logger[_0x93cf('0x10')](_0x93cf('0xc'),_0x5b4289,_0x149801);_0x5b13b4(_0x149801);});});} \ No newline at end of file +var _0x0dee=['request','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','http'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x0dee,0x14d));var _0xe0de=function(_0x539189,_0xb74691){_0x539189=_0x539189-0x0;var _0x2a838a=_0x0dee[_0x539189];return _0x2a838a;};'use strict';var _=require(_0xe0de('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe0de('0x1'));var rs=require(_0xe0de('0x2'));var fs=require('fs');var Redis=require(_0xe0de('0x3'));var db=require(_0xe0de('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe0de('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe0de('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3e6dbd,_0x4c0661,_0x1abc6b){return new BPromise(function(_0x3b7a15,_0x4ac065){return client[_0xe0de('0x7')](_0x3e6dbd,_0x1abc6b)['then'](function(_0x2a908a){logger['info'](_0xe0de('0x8'),_0x4c0661,'request\x20sent');logger[_0xe0de('0x9')](_0xe0de('0xa'),_0x4c0661,_0xe0de('0xb'),JSON[_0xe0de('0xc')](_0x2a908a));if(_0x2a908a[_0xe0de('0xd')]){if(_0x2a908a[_0xe0de('0xd')][_0xe0de('0xe')]===0x1f4){logger[_0xe0de('0xd')](_0xe0de('0x8'),_0x4c0661,_0x2a908a[_0xe0de('0xd')][_0xe0de('0xf')]);return _0x4ac065(_0x2a908a[_0xe0de('0xd')]['message']);}logger['error'](_0xe0de('0x8'),_0x4c0661,_0x2a908a['error']['message']);return _0x3b7a15(_0x2a908a[_0xe0de('0xd')][_0xe0de('0xf')]);}else{logger[_0xe0de('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x4c0661,'request\x20sent');_0x3b7a15(_0x2a908a['result'][_0xe0de('0xf')]);}})['catch'](function(_0x3d04bb){logger['error'](_0xe0de('0x8'),_0x4c0661,_0x3d04bb);_0x4ac065(_0x3d04bb);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 4c6ce86..752fe2a 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 _0xc825=['exports','INTEGER','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc825,0x104));var _0x5c82=function(_0x16be84,_0x12fc54){_0x16be84=_0x16be84-0x0;var _0x228aa8=_0xc825[_0x16be84];return _0x228aa8;};'use strict';var Sequelize=require(_0x5c82('0x0'));module[_0x5c82('0x1')]={'UserId':{'type':Sequelize[_0x5c82('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x5c82('0x2')]}}; \ No newline at end of file +var _0x3bdd=['exports','INTEGER'];(function(_0x18019b,_0xe69829){var _0x3d0490=function(_0x3bec33){while(--_0x3bec33){_0x18019b['push'](_0x18019b['shift']());}};_0x3d0490(++_0xe69829);}(_0x3bdd,0x150));var _0xd3bd=function(_0x157c49,_0x465662){_0x157c49=_0x157c49-0x0;var _0x58cc81=_0x3bdd[_0x157c49];return _0x58cc81;};'use strict';var Sequelize=require('sequelize');module[_0xd3bd('0x0')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xd3bd('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 9b5b5a5..88eb9e6 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(_0x10f869,_0x4a83d5){var _0x2e9bdf=function(_0x1c5021){while(--_0x1c5021){_0x10f869['push'](_0x10f869['shift']());}};_0x2e9bdf(++_0x4a83d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x11b752,_0x145001){var _0x2992d7=function(_0x42c99d){while(--_0x42c99d){_0x11b752['push'](_0x11b752['shift']());}};_0x2992d7(++_0x145001);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 0378c2f..357ef02 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1f6a87,_0x31aa8d){var _0x4db6f0=function(_0x46321a){while(--_0x46321a){_0x1f6a87['push'](_0x1f6a87['shift']());}};_0x4db6f0(++_0x31aa8d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5ec25b,_0x1ff58e){var _0x4fe26f=function(_0x3997cf){while(--_0x3997cf){_0x5ec25b['push'](_0x5ec25b['shift']());}};_0x4fe26f(++_0x1ff58e);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index ff02120..425ab7c 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 _0xc3ec=['exports','INTEGER'];(function(_0x53f0db,_0x35c67c){var _0xae0a5c=function(_0x4bd6fb){while(--_0x4bd6fb){_0x53f0db['push'](_0x53f0db['shift']());}};_0xae0a5c(++_0x35c67c);}(_0xc3ec,0x74));var _0xcc3e=function(_0x428765,_0x57800a){_0x428765=_0x428765-0x0;var _0x4644b3=_0xc3ec[_0x428765];return _0x4644b3;};'use strict';var Sequelize=require('sequelize');module[_0xcc3e('0x0')]={'penalty':{'type':Sequelize[_0xcc3e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x38c1=['INTEGER','exports'];(function(_0x15eb7d,_0x1b1a10){var _0x459262=function(_0x2bf3cb){while(--_0x2bf3cb){_0x15eb7d['push'](_0x15eb7d['shift']());}};_0x459262(++_0x1b1a10);}(_0x38c1,0x77));var _0x138c=function(_0x21bfc8,_0x2a67d2){_0x21bfc8=_0x21bfc8-0x0;var _0x2029c0=_0x38c1[_0x21bfc8];return _0x2029c0;};'use strict';var Sequelize=require('sequelize');module[_0x138c('0x0')]={'penalty':{'type':Sequelize[_0x138c('0x1')],'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 b24b6b4..2f90e5c 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 _0x0ca5=['util','../../config/logger','api','path','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x5d2d9c,_0x56b942){var _0x25b6b8=function(_0x984a93){while(--_0x984a93){_0x5d2d9c['push'](_0x5d2d9c['shift']());}};_0x25b6b8(++_0x56b942);}(_0x0ca5,0x1a3));var _0x50ca=function(_0x278864,_0x2fffd9){_0x278864=_0x278864-0x0;var _0x3260c6=_0x0ca5[_0x278864];return _0x3260c6;};'use strict';var _=require(_0x50ca('0x0'));var util=require(_0x50ca('0x1'));var logger=require(_0x50ca('0x2'))(_0x50ca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x50ca('0x4'));var rimraf=require('rimraf');var config=require(_0x50ca('0x5'));var attributes=require(_0x50ca('0x6'));module[_0x50ca('0x7')]=function(_0x136b32,_0x16d737){return _0x136b32['define'](_0x50ca('0x8'),attributes,{'tableName':_0x50ca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e75=['path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','request-promise'];(function(_0x470b62,_0x18977d){var _0x5e9a24=function(_0x23bc09){while(--_0x23bc09){_0x470b62['push'](_0x470b62['shift']());}};_0x5e9a24(++_0x18977d);}(_0x0e75,0x94));var _0x50e7=function(_0x2ad04c,_0x242b88){_0x2ad04c=_0x2ad04c-0x0;var _0x4164a8=_0x0e75[_0x2ad04c];return _0x4164a8;};'use strict';var _=require(_0x50e7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x50e7('0x1'));var fs=require('fs');var path=require(_0x50e7('0x2'));var rimraf=require(_0x50e7('0x3'));var config=require(_0x50e7('0x4'));var attributes=require(_0x50e7('0x5'));module[_0x50e7('0x6')]=function(_0x1f911b,_0x4625a3){return _0x1f911b[_0x50e7('0x7')](_0x50e7('0x8'),attributes,{'tableName':_0x50e7('0x9'),'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 086afd2..fb3f2a6 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 _0xd1f5=['../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x3b57d2,_0x440aa9){var _0x5a133f=function(_0x1844a9){while(--_0x1844a9){_0x3b57d2['push'](_0x3b57d2['shift']());}};_0x5a133f(++_0x440aa9);}(_0xd1f5,0x6c));var _0x5d1f=function(_0x521825,_0x34b368){_0x521825=_0x521825-0x0;var _0x140d49=_0xd1f5[_0x521825];return _0x140d49;};'use strict';var _=require('lodash');var util=require(_0x5d1f('0x0'));var moment=require(_0x5d1f('0x1'));var BPromise=require(_0x5d1f('0x2'));var rs=require(_0x5d1f('0x3'));var fs=require('fs');var Redis=require(_0x5d1f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d1f('0x5'));var logger=require('../../config/logger')(_0x5d1f('0x6'));var config=require(_0x5d1f('0x7'));var jayson=require(_0x5d1f('0x8'));var client=jayson[_0x5d1f('0x9')][_0x5d1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x334317,_0x21a30,_0x5ea3d9){return new BPromise(function(_0x3c06eb,_0x4c85b4){return client[_0x5d1f('0xb')](_0x334317,_0x5ea3d9)[_0x5d1f('0xc')](function(_0x561964){logger['info'](_0x5d1f('0xd'),_0x21a30,_0x5d1f('0xe'));logger[_0x5d1f('0xf')](_0x5d1f('0x10'),_0x21a30,_0x5d1f('0xe'),JSON[_0x5d1f('0x11')](_0x561964));if(_0x561964[_0x5d1f('0x12')]){if(_0x561964['error']['code']===0x1f4){logger[_0x5d1f('0x12')](_0x5d1f('0xd'),_0x21a30,_0x561964[_0x5d1f('0x12')][_0x5d1f('0x13')]);return _0x4c85b4(_0x561964[_0x5d1f('0x12')][_0x5d1f('0x13')]);}logger['error'](_0x5d1f('0xd'),_0x21a30,_0x561964[_0x5d1f('0x12')]['message']);return _0x3c06eb(_0x561964['error'][_0x5d1f('0x13')]);}else{logger[_0x5d1f('0x14')](_0x5d1f('0xd'),_0x21a30,'request\x20sent');_0x3c06eb(_0x561964[_0x5d1f('0x15')][_0x5d1f('0x13')]);}})[_0x5d1f('0x16')](function(_0x188350){logger[_0x5d1f('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x21a30,_0x188350);_0x4c85b4(_0x188350);});});} \ No newline at end of file +var _0x499e=['code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0xb697c7,_0x42d121){var _0x308f6e=function(_0xcb724f){while(--_0xcb724f){_0xb697c7['push'](_0xb697c7['shift']());}};_0x308f6e(++_0x42d121);}(_0x499e,0x1e9));var _0xe499=function(_0x4991f0,_0x5c2269){_0x4991f0=_0x4991f0-0x0;var _0x36fc25=_0x499e[_0x4991f0];return _0x36fc25;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe499('0x0'));var BPromise=require('bluebird');var rs=require(_0xe499('0x1'));var fs=require('fs');var Redis=require(_0xe499('0x2'));var db=require(_0xe499('0x3'))['db'];var utils=require(_0xe499('0x4'));var logger=require(_0xe499('0x5'))(_0xe499('0x6'));var config=require(_0xe499('0x7'));var jayson=require(_0xe499('0x8'));var client=jayson['client'][_0xe499('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10c4c0,_0x1fd207,_0x29b690){return new BPromise(function(_0x3e7080,_0x32b64d){return client[_0xe499('0xa')](_0x10c4c0,_0x29b690)[_0xe499('0xb')](function(_0x66eeb7){logger['info'](_0xe499('0xc'),_0x1fd207,_0xe499('0xd'));logger[_0xe499('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1fd207,_0xe499('0xd'),JSON[_0xe499('0xf')](_0x66eeb7));if(_0x66eeb7['error']){if(_0x66eeb7[_0xe499('0x10')][_0xe499('0x11')]===0x1f4){logger['error'](_0xe499('0xc'),_0x1fd207,_0x66eeb7['error'][_0xe499('0x12')]);return _0x32b64d(_0x66eeb7[_0xe499('0x10')][_0xe499('0x12')]);}logger[_0xe499('0x10')](_0xe499('0xc'),_0x1fd207,_0x66eeb7[_0xe499('0x10')][_0xe499('0x12')]);return _0x3e7080(_0x66eeb7['error'][_0xe499('0x12')]);}else{logger[_0xe499('0x13')](_0xe499('0xc'),_0x1fd207,_0xe499('0xd'));_0x3e7080(_0x66eeb7[_0xe499('0x14')][_0xe499('0x12')]);}})[_0xe499('0x15')](function(_0xbd80c0){logger[_0xe499('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x1fd207,_0xbd80c0);_0x32b64d(_0xbd80c0);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 3e12dfa..e13d31a 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1fa7da,_0x82cb97){var _0x809b2f=function(_0x8fb22a){while(--_0x8fb22a){_0x1fa7da['push'](_0x1fa7da['shift']());}};_0x809b2f(++_0x82cb97);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x521a45,_0x5734bd){var _0x25dfa4=function(_0x4bc47f){while(--_0x4bc47f){_0x521a45['push'](_0x521a45['shift']());}};_0x25dfa4(++_0x5734bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 4ad08d6..3239512 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 _0x556a=['Required\x20by\x20Asterisk','queue_interface','INTEGER','STRING'];(function(_0x2fc739,_0x51e04f){var _0xb1753=function(_0x4af380){while(--_0x4af380){_0x2fc739['push'](_0x2fc739['shift']());}};_0xb1753(++_0x51e04f);}(_0x556a,0x14e));var _0xa556=function(_0x2febde,_0x3fbc16){_0x2febde=_0x2febde-0x0;var _0x41cab8=_0x556a[_0x2febde];return _0x41cab8;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xa556('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xa556('0x1')],'allowNull':![],'comment':_0xa556('0x2')},'UserId':{'type':Sequelize[_0xa556('0x0')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa556('0x1')],'allowNull':![],'unique':_0xa556('0x3'),'comment':_0xa556('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa556('0x3'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xa556('0x0')](0xb),'defaultValue':0x0,'comment':_0xa556('0x2')},'paused':{'type':Sequelize[_0xa556('0x0')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x4713=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x4b0c15,_0x47e272){var _0x5a3bcf=function(_0x5cfb9f){while(--_0x5cfb9f){_0x4b0c15['push'](_0x4b0c15['shift']());}};_0x5a3bcf(++_0x47e272);}(_0x4713,0x18d));var _0x3471=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0x4713[_0x350182];return _0x4a0892;};'use strict';var Sequelize=require(_0x3471('0x0'));module[_0x3471('0x1')]={'uniqueid':{'type':Sequelize[_0x3471('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x3471('0x3')},'membername':{'type':Sequelize[_0x3471('0x4')],'allowNull':![],'comment':_0x3471('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x3471('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x3471('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x3471('0x4')],'allowNull':![],'unique':_0x3471('0x5'),'comment':_0x3471('0x3')},'penalty':{'type':Sequelize[_0x3471('0x2')](0xb),'defaultValue':0x0,'comment':_0x3471('0x3')},'paused':{'type':Sequelize[_0x3471('0x2')](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 b36112f..f90e09e 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 _0x630a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x1be69f,_0x29e787){var _0x1d70d0=function(_0x1e6b17){while(--_0x1e6b17){_0x1be69f['push'](_0x1be69f['shift']());}};_0x1d70d0(++_0x29e787);}(_0x630a,0x147));var _0xa630=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0x630a[_0x308213];return _0x2e1619;};'use strict';var EventEmitter=require(_0xa630('0x0'));var UserVoiceQueueRt=require(_0xa630('0x1'))['db'][_0xa630('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa630('0x3')](0x0);var events={'afterCreate':_0xa630('0x4'),'afterUpdate':_0xa630('0x5'),'afterDestroy':_0xa630('0x6')};function emitEvent(_0x475dd3){return function(_0x4bae42,_0x187193,_0x5271ca){UserVoiceQueueRtEvents[_0xa630('0x7')](_0x475dd3+':'+_0x4bae42['id'],_0x4bae42);UserVoiceQueueRtEvents[_0xa630('0x7')](_0x475dd3,_0x4bae42);_0x5271ca(null);};}for(var e in events){if(events[_0xa630('0x8')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xa630('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x99cb=['emit','hasOwnProperty','hook','exports','events','UserVoiceQueueRt','setMaxListeners','update','remove'];(function(_0x138fa0,_0xdd4159){var _0x3f646a=function(_0x4b7a8d){while(--_0x4b7a8d){_0x138fa0['push'](_0x138fa0['shift']());}};_0x3f646a(++_0xdd4159);}(_0x99cb,0xca));var _0xb99c=function(_0x1e9dea,_0x409f32){_0x1e9dea=_0x1e9dea-0x0;var _0x10f0a4=_0x99cb[_0x1e9dea];return _0x10f0a4;};'use strict';var EventEmitter=require(_0xb99c('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xb99c('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb99c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb99c('0x3'),'afterDestroy':_0xb99c('0x4')};function emitEvent(_0x395578){return function(_0x36ba45,_0x5e7cab,_0x13ca8f){UserVoiceQueueRtEvents[_0xb99c('0x5')](_0x395578+':'+_0x36ba45['id'],_0x36ba45);UserVoiceQueueRtEvents[_0xb99c('0x5')](_0x395578,_0x36ba45);_0x13ca8f(null);};}for(var e in events){if(events[_0xb99c('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xb99c('0x7')](e,emitEvent(event));}}module[_0xb99c('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 84bca31..a06cb9e 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 _0x028e=['./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','util','api','bluebird','request-promise','../../config/environment'];(function(_0x361c9f,_0x22d180){var _0x4c74a4=function(_0x12d73f){while(--_0x12d73f){_0x361c9f['push'](_0x361c9f['shift']());}};_0x4c74a4(++_0x22d180);}(_0x028e,0x79));var _0xe028=function(_0x40eb86,_0x35fd71){_0x40eb86=_0x40eb86-0x0;var _0x187e1c=_0x028e[_0x40eb86];return _0x187e1c;};'use strict';var _=require('lodash');var util=require(_0xe028('0x0'));var logger=require('../../config/logger')(_0xe028('0x1'));var moment=require('moment');var BPromise=require(_0xe028('0x2'));var rp=require(_0xe028('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe028('0x4'));var attributes=require(_0xe028('0x5'));module[_0xe028('0x6')]=function(_0xb231b2,_0x5a8f53){return _0xb231b2[_0xe028('0x7')]('UserVoiceQueueRt',attributes,{'tableName':_0xe028('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57e3=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x57e3,0x131));var _0x357e=function(_0x202587,_0x57f0bd){_0x202587=_0x202587-0x0;var _0x11bbb9=_0x57e3[_0x202587];return _0x11bbb9;};'use strict';var _=require(_0x357e('0x0'));var util=require(_0x357e('0x1'));var logger=require(_0x357e('0x2'))(_0x357e('0x3'));var moment=require(_0x357e('0x4'));var BPromise=require(_0x357e('0x5'));var rp=require(_0x357e('0x6'));var fs=require('fs');var path=require(_0x357e('0x7'));var rimraf=require(_0x357e('0x8'));var config=require(_0x357e('0x9'));var attributes=require(_0x357e('0xa'));module[_0x357e('0xb')]=function(_0x67ba41,_0x50104a){return _0x67ba41['define'](_0x357e('0xc'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index f1f7bef..a4974ce 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 _0x791c=['outboundQueuePauses','info','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','register','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null'];(function(_0xef607f,_0x158ce5){var _0x12394d=function(_0x24c098){while(--_0x24c098){_0xef607f['push'](_0xef607f['shift']());}};_0x12394d(++_0x158ce5);}(_0x791c,0x1bc));var _0xc791=function(_0x3f3bad,_0x193f06){_0x3f3bad=_0x3f3bad-0x0;var _0x4f0801=_0x791c[_0x3f3bad];return _0x4f0801;};'use strict';var _=require('lodash');var util=require(_0xc791('0x0'));var moment=require(_0xc791('0x1'));var BPromise=require(_0xc791('0x2'));var rs=require(_0xc791('0x3'));var fs=require('fs');var Redis=require(_0xc791('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc791('0x5'));var logger=require(_0xc791('0x6'))(_0xc791('0x7'));var config=require(_0xc791('0x8'));var jayson=require(_0xc791('0x9'));var client=jayson[_0xc791('0xa')][_0xc791('0xb')]({'port':0x232a});config[_0xc791('0xc')]=_['defaults'](config[_0xc791('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc791('0xc')]));require('./userVoiceQueueRt.socket')[_0xc791('0xd')](socket);function respondWithRpcPromise(_0x30d66b,_0x2fb1d7,_0x5633fe){return new BPromise(function(_0x9909df,_0x1aa0f1){return client['request'](_0x30d66b,_0x5633fe)[_0xc791('0xe')](function(_0x2aa820){logger['info'](_0xc791('0xf'),_0x2fb1d7,'request\x20sent');logger[_0xc791('0x10')](_0xc791('0x11'),_0x2fb1d7,'request\x20sent',JSON[_0xc791('0x12')](_0x2aa820));if(_0x2aa820[_0xc791('0x13')]){if(_0x2aa820['error'][_0xc791('0x14')]===0x1f4){logger[_0xc791('0x13')](_0xc791('0xf'),_0x2fb1d7,_0x2aa820['error']['message']);return _0x1aa0f1(_0x2aa820[_0xc791('0x13')][_0xc791('0x15')]);}logger[_0xc791('0x13')](_0xc791('0xf'),_0x2fb1d7,_0x2aa820[_0xc791('0x13')]['message']);return _0x9909df(_0x2aa820[_0xc791('0x13')]['message']);}else{logger['info'](_0xc791('0xf'),_0x2fb1d7,'request\x20sent');_0x9909df(_0x2aa820[_0xc791('0x16')][_0xc791('0x15')]);}})[_0xc791('0x17')](function(_0xa12953){logger[_0xc791('0x13')](_0xc791('0xf'),_0x2fb1d7,_0xa12953);_0x1aa0f1(_0xa12953);});});}exports[_0xc791('0x18')]=function(_0xa5bda7){var _0x1e29f0=this;return new Promise(function(_0x4e6d4e,_0x172202){return db['UserVoiceQueueRt'][_0xc791('0x19')]({'raw':_0xa5bda7[_0xc791('0x1a')]?_0xa5bda7[_0xc791('0x1a')][_0xc791('0x1b')]===undefined?!![]:![]:!![],'where':_0xa5bda7[_0xc791('0x1a')]?_0xa5bda7[_0xc791('0x1a')][_0xc791('0x1c')]||null:null,'attributes':[[db[_0xc791('0x1d')]['fn'](_0xc791('0x1e'),db[_0xc791('0x1d')]['fn']('IF',db[_0xc791('0x1d')]['literal'](_0xc791('0x1f')))),_0xc791('0x20')]]})[_0xc791('0xe')](function(_0x404982){logger[_0xc791('0x21')](_0xc791('0x18'),_0xa5bda7);logger['debug'](_0xc791('0x18'),_0xa5bda7,JSON['stringify'](_0x404982));_0x4e6d4e(_0x404982);})['catch'](function(_0x254e0d){logger[_0xc791('0x13')](_0xc791('0x18'),_0x254e0d[_0xc791('0x15')],_0xa5bda7);_0x172202(_0x1e29f0['error'](0x1f4,_0x254e0d[_0xc791('0x15')]));});});}; \ No newline at end of file +var _0xb43a=['info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then'];(function(_0x117913,_0x4fd262){var _0xb8eacb=function(_0x1e8b58){while(--_0x1e8b58){_0x117913['push'](_0x117913['shift']());}};_0xb8eacb(++_0x4fd262);}(_0xb43a,0x1ce));var _0xab43=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0xb43a[_0x1ebce2];return _0x4a330c;};'use strict';var _=require(_0xab43('0x0'));var util=require(_0xab43('0x1'));var moment=require(_0xab43('0x2'));var BPromise=require(_0xab43('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xab43('0x5'));var logger=require(_0xab43('0x6'))(_0xab43('0x7'));var config=require(_0xab43('0x8'));var jayson=require(_0xab43('0x9'));var client=jayson[_0xab43('0xa')][_0xab43('0xb')]({'port':0x232a});config[_0xab43('0xc')]=_[_0xab43('0xd')](config[_0xab43('0xc')],{'host':_0xab43('0xe'),'port':0x18eb});var socket=require(_0xab43('0xf'))(new Redis(config[_0xab43('0xc')]));require(_0xab43('0x10'))['register'](socket);function respondWithRpcPromise(_0x3e4747,_0x55a4f1,_0x1ea7f2){return new BPromise(function(_0x4a327d,_0x90c69e){return client[_0xab43('0x11')](_0x3e4747,_0x1ea7f2)[_0xab43('0x12')](function(_0xbdda65){logger[_0xab43('0x13')](_0xab43('0x14'),_0x55a4f1,'request\x20sent');logger[_0xab43('0x15')](_0xab43('0x16'),_0x55a4f1,'request\x20sent',JSON['stringify'](_0xbdda65));if(_0xbdda65['error']){if(_0xbdda65[_0xab43('0x17')][_0xab43('0x18')]===0x1f4){logger[_0xab43('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x55a4f1,_0xbdda65[_0xab43('0x17')][_0xab43('0x19')]);return _0x90c69e(_0xbdda65[_0xab43('0x17')][_0xab43('0x19')]);}logger[_0xab43('0x17')](_0xab43('0x14'),_0x55a4f1,_0xbdda65[_0xab43('0x17')][_0xab43('0x19')]);return _0x4a327d(_0xbdda65[_0xab43('0x17')]['message']);}else{logger['info'](_0xab43('0x14'),_0x55a4f1,_0xab43('0x1a'));_0x4a327d(_0xbdda65['result']['message']);}})[_0xab43('0x1b')](function(_0x455757){logger[_0xab43('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x55a4f1,_0x455757);_0x90c69e(_0x455757);});});}exports['GetVoiceQueueRtPauses']=function(_0x5e777e){var _0x169ce3=this;return new Promise(function(_0x5034e1,_0x14c7db){return db[_0xab43('0x1c')]['findAll']({'raw':_0x5e777e[_0xab43('0x1d')]?_0x5e777e[_0xab43('0x1d')][_0xab43('0x1e')]===undefined?!![]:![]:!![],'where':_0x5e777e['options']?_0x5e777e[_0xab43('0x1d')][_0xab43('0x1f')]||null:null,'attributes':[[db[_0xab43('0x20')]['fn'](_0xab43('0x21'),db[_0xab43('0x20')]['fn']('IF',db[_0xab43('0x20')][_0xab43('0x22')]('`paused`\x20=\x201,\x201,\x20null'))),_0xab43('0x23')]]})['then'](function(_0x3fa1cb){logger[_0xab43('0x13')](_0xab43('0x24'),_0x5e777e);logger['debug'](_0xab43('0x24'),_0x5e777e,JSON['stringify'](_0x3fa1cb));_0x5034e1(_0x3fa1cb);})[_0xab43('0x1b')](function(_0x136ac6){logger[_0xab43('0x17')](_0xab43('0x24'),_0x136ac6['message'],_0x5e777e);_0x14c7db(_0x169ce3['error'](0x1f4,_0x136ac6[_0xab43('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index b6b1258..878db48 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 _0x1939=['register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update','emit'];(function(_0x1ac8d3,_0x31c1cc){var _0x2613fe=function(_0x2fbd09){while(--_0x2fbd09){_0x1ac8d3['push'](_0x1ac8d3['shift']());}};_0x2613fe(++_0x31c1cc);}(_0x1939,0x1d1));var _0x9193=function(_0x14eb9e,_0x29fe9e){_0x14eb9e=_0x14eb9e-0x0;var _0x4c59c4=_0x1939[_0x14eb9e];return _0x4c59c4;};'use strict';var UserVoiceQueueRtEvents=require(_0x9193('0x0'));var events=['save',_0x9193('0x1'),_0x9193('0x2')];function createListener(_0x3628d4,_0x538b4c){return function(_0x12643a){_0x538b4c[_0x9193('0x3')](_0x3628d4,_0x12643a);};}function removeListener(_0x31aa3c,_0x35b1c4){return function(){UserVoiceQueueRtEvents['removeListener'](_0x31aa3c,_0x35b1c4);};}exports[_0x9193('0x4')]=function(_0x20ab2b){for(var _0x5186dc=0x0,_0x5f7087=events[_0x9193('0x5')];_0x5186dc<_0x5f7087;_0x5186dc++){var _0x488d01=events[_0x5186dc];var _0x327de5=createListener(_0x9193('0x6')+_0x488d01,_0x20ab2b);UserVoiceQueueRtEvents['on'](_0x488d01,_0x327de5);}}; \ No newline at end of file +var _0x36bb=['remove','emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x4e3f18,_0x4c23e4){var _0x56831b=function(_0x3d62c1){while(--_0x3d62c1){_0x4e3f18['push'](_0x4e3f18['shift']());}};_0x56831b(++_0x4c23e4);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0xb36b('0x0'));var events=[_0xb36b('0x1'),_0xb36b('0x2'),'update'];function createListener(_0x1d6c2e,_0xa54c6){return function(_0x9267f4){_0xa54c6[_0xb36b('0x3')](_0x1d6c2e,_0x9267f4);};}function removeListener(_0x311671,_0x3d57d7){return function(){UserVoiceQueueRtEvents[_0xb36b('0x4')](_0x311671,_0x3d57d7);};}exports[_0xb36b('0x5')]=function(_0x439ccc){for(var _0x418837=0x0,_0x181f45=events[_0xb36b('0x6')];_0x418837<_0x181f45;_0x418837++){var _0x229483=events[_0x418837];var _0x30e907=createListener(_0xb36b('0x7')+_0x229483,_0x439ccc);UserVoiceQueueRtEvents['on'](_0x229483,_0x30e907);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 06b202e..0ebbc38 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x430993,_0x8c8cda){var _0x23e71f=function(_0x1c6dc6){while(--_0x1c6dc6){_0x430993['push'](_0x430993['shift']());}};_0x23e71f(++_0x8c8cda);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x40d0f7,_0x1223b4){var _0x71e975=function(_0x466aa5){while(--_0x466aa5){_0x40d0f7['push'](_0x40d0f7['shift']());}};_0x71e975(++_0x1223b4);}(_0xe706,0xa3));var _0x6e70=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0xe706[_0x25c326];return _0x762452;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 715f405..0d37002 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 _0xc0e1=['sequelize','exports','INTEGER'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xc0e1,0x147));var _0x1c0e=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0xc0e1[_0x3818c0];return _0x55ec33;};'use strict';var Sequelize=require(_0x1c0e('0x0'));module[_0x1c0e('0x1')]={'penalty':{'type':Sequelize[_0x1c0e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x36d5=['INTEGER','exports'];(function(_0x392fd7,_0x347b4d){var _0x3c168a=function(_0x8418a2){while(--_0x8418a2){_0x392fd7['push'](_0x392fd7['shift']());}};_0x3c168a(++_0x347b4d);}(_0x36d5,0x1ab));var _0x536d=function(_0x37ef22,_0x348c92){_0x37ef22=_0x37ef22-0x0;var _0x49eeb3=_0x36d5[_0x37ef22];return _0x49eeb3;};'use strict';var Sequelize=require('sequelize');module[_0x536d('0x0')]={'penalty':{'type':Sequelize[_0x536d('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 87ecca1..aa2e0ca 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 _0xfbdd=['bluebird','path','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment'];(function(_0xd31b4e,_0x3eae5d){var _0x308965=function(_0x46e200){while(--_0x46e200){_0xd31b4e['push'](_0xd31b4e['shift']());}};_0x308965(++_0x3eae5d);}(_0xfbdd,0x11b));var _0xdfbd=function(_0x2a443f,_0x198f3d){_0x2a443f=_0x2a443f-0x0;var _0x203565=_0xfbdd[_0x2a443f];return _0x203565;};'use strict';var _=require(_0xdfbd('0x0'));var util=require(_0xdfbd('0x1'));var logger=require(_0xdfbd('0x2'))(_0xdfbd('0x3'));var moment=require(_0xdfbd('0x4'));var BPromise=require(_0xdfbd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfbd('0x6'));var rimraf=require('rimraf');var config=require(_0xdfbd('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0xdfbd('0x8')]=function(_0x3b6ae5,_0x43def2){return _0x3b6ae5[_0xdfbd('0x9')](_0xdfbd('0xa'),attributes,{'tableName':_0xdfbd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8af2=['rimraf','./userWhatsappQueue.attributes','exports','define','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x592df4,_0x4e719b){var _0x3b4fe4=function(_0x5ebf53){while(--_0x5ebf53){_0x592df4['push'](_0x592df4['shift']());}};_0x3b4fe4(++_0x4e719b);}(_0x8af2,0x73));var _0x28af=function(_0x294e1e,_0x3ee80c){_0x294e1e=_0x294e1e-0x0;var _0x19e1f9=_0x8af2[_0x294e1e];return _0x19e1f9;};'use strict';var _=require(_0x28af('0x0'));var util=require(_0x28af('0x1'));var logger=require(_0x28af('0x2'))(_0x28af('0x3'));var moment=require(_0x28af('0x4'));var BPromise=require('bluebird');var rp=require(_0x28af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x28af('0x6'));var config=require('../../config/environment');var attributes=require(_0x28af('0x7'));module[_0x28af('0x8')]=function(_0x51a9b8,_0x340014){return _0x51a9b8[_0x28af('0x9')]('UserWhatsappQueue',attributes,{'tableName':_0x28af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 8c5986f..39c3912 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 _0xa1cc=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x2588b8,_0x185f45){var _0x528595=function(_0x57d1e1){while(--_0x57d1e1){_0x2588b8['push'](_0x2588b8['shift']());}};_0x528595(++_0x185f45);}(_0xa1cc,0x1d1));var _0xca1c=function(_0x367614,_0x1543ba){_0x367614=_0x367614-0x0;var _0x352f18=_0xa1cc[_0x367614];return _0x352f18;};'use strict';var _=require(_0xca1c('0x0'));var util=require(_0xca1c('0x1'));var moment=require(_0xca1c('0x2'));var BPromise=require(_0xca1c('0x3'));var rs=require(_0xca1c('0x4'));var fs=require('fs');var Redis=require(_0xca1c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xca1c('0x6'));var logger=require(_0xca1c('0x7'))(_0xca1c('0x8'));var config=require(_0xca1c('0x9'));var jayson=require(_0xca1c('0xa'));var client=jayson[_0xca1c('0xb')][_0xca1c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x596077,_0x507305,_0x4b6d07){return new BPromise(function(_0x2e9743,_0x364f75){return client[_0xca1c('0xd')](_0x596077,_0x4b6d07)[_0xca1c('0xe')](function(_0x51711a){logger[_0xca1c('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x507305,_0xca1c('0x10'));logger[_0xca1c('0x11')](_0xca1c('0x12'),_0x507305,'request\x20sent',JSON[_0xca1c('0x13')](_0x51711a));if(_0x51711a['error']){if(_0x51711a[_0xca1c('0x14')][_0xca1c('0x15')]===0x1f4){logger[_0xca1c('0x14')](_0xca1c('0x16'),_0x507305,_0x51711a[_0xca1c('0x14')][_0xca1c('0x17')]);return _0x364f75(_0x51711a[_0xca1c('0x14')][_0xca1c('0x17')]);}logger[_0xca1c('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x507305,_0x51711a['error'][_0xca1c('0x17')]);return _0x2e9743(_0x51711a[_0xca1c('0x14')]['message']);}else{logger['info'](_0xca1c('0x16'),_0x507305,_0xca1c('0x10'));_0x2e9743(_0x51711a[_0xca1c('0x18')][_0xca1c('0x17')]);}})[_0xca1c('0x19')](function(_0x431b1c){logger[_0xca1c('0x14')](_0xca1c('0x16'),_0x507305,_0x431b1c);_0x364f75(_0x431b1c);});});} \ No newline at end of file +var _0x2404=['ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring'];(function(_0x295621,_0x4286b8){var _0x36d0dd=function(_0x51d57e){while(--_0x51d57e){_0x295621['push'](_0x295621['shift']());}};_0x36d0dd(++_0x4286b8);}(_0x2404,0x100));var _0x4240=function(_0x547110,_0x577188){_0x547110=_0x547110-0x0;var _0xf9c0=_0x2404[_0x547110];return _0xf9c0;};'use strict';var _=require(_0x4240('0x0'));var util=require(_0x4240('0x1'));var moment=require('moment');var BPromise=require(_0x4240('0x2'));var rs=require(_0x4240('0x3'));var fs=require('fs');var Redis=require(_0x4240('0x4'));var db=require(_0x4240('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4240('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4240('0x7'));var client=jayson[_0x4240('0x8')][_0x4240('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2df6d5,_0xd0acbd,_0x42f566){return new BPromise(function(_0x282c63,_0x33227b){return client[_0x4240('0xa')](_0x2df6d5,_0x42f566)[_0x4240('0xb')](function(_0x2fa75e){logger[_0x4240('0xc')](_0x4240('0xd'),_0xd0acbd,_0x4240('0xe'));logger['debug'](_0x4240('0xf'),_0xd0acbd,_0x4240('0xe'),JSON[_0x4240('0x10')](_0x2fa75e));if(_0x2fa75e[_0x4240('0x11')]){if(_0x2fa75e[_0x4240('0x11')]['code']===0x1f4){logger[_0x4240('0x11')](_0x4240('0xd'),_0xd0acbd,_0x2fa75e[_0x4240('0x11')][_0x4240('0x12')]);return _0x33227b(_0x2fa75e['error'][_0x4240('0x12')]);}logger[_0x4240('0x11')](_0x4240('0xd'),_0xd0acbd,_0x2fa75e[_0x4240('0x11')][_0x4240('0x12')]);return _0x282c63(_0x2fa75e['error'][_0x4240('0x12')]);}else{logger[_0x4240('0xc')](_0x4240('0xd'),_0xd0acbd,_0x4240('0xe'));_0x282c63(_0x2fa75e['result']['message']);}})[_0x4240('0x13')](function(_0x3544f1){logger['error'](_0x4240('0xd'),_0xd0acbd,_0x3544f1);_0x33227b(_0x3544f1);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 505383c..c8536bb 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 _0x6108=['isAuthenticated','index','post','create','/:id','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get'];(function(_0x1a0032,_0x5402e5){var _0x1c3d6b=function(_0x28e0f3){while(--_0x28e0f3){_0x1a0032['push'](_0x1a0032['shift']());}};_0x1c3d6b(++_0x5402e5);}(_0x6108,0xbc));var _0x8610=function(_0x44059a,_0x55e414){_0x44059a=_0x44059a-0x0;var _0x2fe09f=_0x6108[_0x44059a];return _0x2fe09f;};'use strict';var multer=require(_0x8610('0x0'));var util=require('util');var path=require(_0x8610('0x1'));var timeout=require(_0x8610('0x2'));var express=require(_0x8610('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8610('0x4'));var interaction=require(_0x8610('0x5'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0x8610('0x6')]('/',auth[_0x8610('0x7')](),controller[_0x8610('0x8')]);router[_0x8610('0x6')]('/:id',auth[_0x8610('0x7')](),controller['show']);router[_0x8610('0x9')]('/',auth[_0x8610('0x7')](),controller[_0x8610('0xa')]);router['put'](_0x8610('0xb'),auth[_0x8610('0x7')](),controller[_0x8610('0xc')]);router[_0x8610('0xd')](_0x8610('0xb'),auth[_0x8610('0x7')](),controller['destroy']);module[_0x8610('0xe')]=router; \ No newline at end of file +var _0x207c=['fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','show','post','isAuthenticated','put','update','delete','util','path','connect-timeout','express','Router'];(function(_0x50c492,_0x5c1e67){var _0x3505a8=function(_0x2f7937){while(--_0x2f7937){_0x50c492['push'](_0x50c492['shift']());}};_0x3505a8(++_0x5c1e67);}(_0x207c,0x1e8));var _0xc207=function(_0x44c801,_0x5ad314){_0x44c801=_0x44c801-0x0;var _0x3f3468=_0x207c[_0x44c801];return _0x3f3468;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./variable.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0xc')]('/',auth[_0xc207('0xd')](),controller['create']);router[_0xc207('0xe')](_0xc207('0xa'),auth[_0xc207('0xd')](),controller[_0xc207('0xf')]);router[_0xc207('0x10')](_0xc207('0xa'),auth['isAuthenticated'](),controller['destroy']);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 4130a26..da3f6ac 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 _0xd6a8=['exports','STRING','name','sequelize'];(function(_0x24ca1f,_0x3d2164){var _0x5f4222=function(_0x37b651){while(--_0x37b651){_0x24ca1f['push'](_0x24ca1f['shift']());}};_0x5f4222(++_0x3d2164);}(_0xd6a8,0x9b));var _0x8d6a=function(_0x5caf2b,_0x2ba42f){_0x5caf2b=_0x5caf2b-0x0;var _0x217a0b=_0xd6a8[_0x5caf2b];return _0x217a0b;};'use strict';var Sequelize=require(_0x8d6a('0x0'));module[_0x8d6a('0x1')]={'name':{'type':Sequelize[_0x8d6a('0x2')],'unique':_0x8d6a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xca7d=['STRING','name'];(function(_0x1e06f1,_0x59d7e1){var _0x34f77e=function(_0x4f9f26){while(--_0x4f9f26){_0x1e06f1['push'](_0x1e06f1['shift']());}};_0x34f77e(++_0x59d7e1);}(_0xca7d,0x182));var _0xdca7=function(_0x8a8d0c,_0x329a5e){_0x8a8d0c=_0x8a8d0c-0x0;var _0x1355fb=_0xca7d[_0x8a8d0c];return _0x1355fb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdca7('0x0')],'unique':_0xdca7('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdca7('0x0')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 0bf4843..91a1570 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 _0xb563=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','index','map','Variable','rawAttributes','fieldName','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb563,0x92));var _0x3b56=function(_0x4b83fa,_0x3e9c78){_0x4b83fa=_0x4b83fa-0x0;var _0x30fe3b=_0xb563[_0x4b83fa];return _0x30fe3b;};'use strict';var emlformat=require(_0x3b56('0x0'));var rimraf=require(_0x3b56('0x1'));var zipdir=require(_0x3b56('0x2'));var jsonpatch=require(_0x3b56('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3b56('0x4'));var util=require('util');var path=require(_0x3b56('0x5'));var sox=require(_0x3b56('0x6'));var csv=require(_0x3b56('0x7'));var ejs=require(_0x3b56('0x8'));var fs=require('fs');var fs_extra=require(_0x3b56('0x9'));var _=require('lodash');var squel=require(_0x3b56('0xa'));var crypto=require(_0x3b56('0xb'));var jsforce=require(_0x3b56('0xc'));var deskjs=require(_0x3b56('0xd'));var toCsv=require(_0x3b56('0x7'));var querystring=require(_0x3b56('0xe'));var Papa=require(_0x3b56('0xf'));var Redis=require(_0x3b56('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3b56('0x11'));var as=require(_0x3b56('0x12'));var hardwareService=require(_0x3b56('0x13'));var logger=require(_0x3b56('0x14'))(_0x3b56('0x15'));var utils=require(_0x3b56('0x16'));var config=require(_0x3b56('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2dca54,_0x1ceed2){_0x1ceed2=_0x1ceed2||0xcc;return function(_0xcece75){if(_0xcece75){return _0x2dca54['sendStatus'](_0x1ceed2);}return _0x2dca54[_0x3b56('0x18')](_0x1ceed2)[_0x3b56('0x19')]();};}function respondWithResult(_0x337314,_0x37dea0){_0x37dea0=_0x37dea0||0xc8;return function(_0x334b36){if(_0x334b36){return _0x337314[_0x3b56('0x18')](_0x37dea0)[_0x3b56('0x1a')](_0x334b36);}};}function respondWithFilteredResult(_0x572718,_0x3ec131){return function(_0x3c14ef){if(_0x3c14ef){var _0x30f7f7=typeof _0x3ec131[_0x3b56('0x1b')]===_0x3b56('0x1c')&&typeof _0x3ec131['limit']===_0x3b56('0x1c');var _0x53e476=_0x3c14ef[_0x3b56('0x1d')];var _0x20c7e0=_0x30f7f7?0x0:_0x3ec131[_0x3b56('0x1b')];var _0x4bebf3=_0x30f7f7?_0x3c14ef[_0x3b56('0x1d')]:_0x3ec131[_0x3b56('0x1b')]+_0x3ec131[_0x3b56('0x1e')];var _0x2adb4;if(_0x4bebf3>=_0x53e476){_0x4bebf3=_0x53e476;_0x2adb4=0xc8;}else{_0x2adb4=0xce;}_0x572718[_0x3b56('0x18')](_0x2adb4);return _0x572718[_0x3b56('0x1f')](_0x3b56('0x20'),_0x20c7e0+'-'+_0x4bebf3+'/'+_0x53e476)['json'](_0x3c14ef);}return null;};}function patchUpdates(_0x4383b8){return function(_0x467e03){try{jsonpatch[_0x3b56('0x21')](_0x467e03,_0x4383b8,!![]);}catch(_0x5cb2b4){return BPromise['reject'](_0x5cb2b4);}return _0x467e03[_0x3b56('0x22')]();};}function saveUpdates(_0x3d9371,_0x516044){return function(_0x5d97f3){if(_0x5d97f3){return _0x5d97f3[_0x3b56('0x23')](_0x3d9371)[_0x3b56('0x24')](function(_0x49e725){return _0x49e725;});}return null;};}function removeEntity(_0x141445,_0x4a3d7f){return function(_0x57c2e9){if(_0x57c2e9){return _0x57c2e9[_0x3b56('0x25')]()[_0x3b56('0x24')](function(){var _0xbf7d5b=_0x57c2e9[_0x3b56('0x26')]({'plain':!![]});var _0x47b1ca=_0x3b56('0x27');return db[_0x3b56('0x28')][_0x3b56('0x25')]({'where':{'type':_0x47b1ca,'resourceId':_0xbf7d5b['id']}})[_0x3b56('0x24')](function(){return _0x57c2e9;});})['then'](function(){_0x141445[_0x3b56('0x18')](0xcc)[_0x3b56('0x19')]();});}};}function handleEntityNotFound(_0x49f18e,_0x2a3fe8){return function(_0x53b3c4){if(!_0x53b3c4){_0x49f18e['sendStatus'](0x194);}return _0x53b3c4;};}function handleError(_0xc419cd,_0x353ec6){_0x353ec6=_0x353ec6||0x1f4;return function(_0x40d270){logger[_0x3b56('0x29')](_0x40d270[_0x3b56('0x2a')]);if(_0x40d270[_0x3b56('0x2b')]){delete _0x40d270[_0x3b56('0x2b')];}_0xc419cd[_0x3b56('0x18')](_0x353ec6)['send'](_0x40d270);};}exports[_0x3b56('0x2c')]=function(_0x32c5dd,_0x4bcf50){var _0x37754d={},_0x2891ef={},_0x117d97={'count':0x0,'rows':[]};var _0x1f93d3=_[_0x3b56('0x2d')](db[_0x3b56('0x2e')][_0x3b56('0x2f')],function(_0x222611){return{'name':_0x222611[_0x3b56('0x30')],'type':_0x222611['type']['key']};});_0x2891ef[_0x3b56('0x31')]=_[_0x3b56('0x2d')](_0x1f93d3,_0x3b56('0x2b'));_0x2891ef['query']=_[_0x3b56('0x32')](_0x32c5dd[_0x3b56('0x33')]);_0x2891ef[_0x3b56('0x34')]=_['intersection'](_0x2891ef[_0x3b56('0x31')],_0x2891ef['query']);_0x37754d[_0x3b56('0x35')]=_[_0x3b56('0x36')](_0x2891ef[_0x3b56('0x31')],qs[_0x3b56('0x37')](_0x32c5dd[_0x3b56('0x33')]['fields']));_0x37754d[_0x3b56('0x35')]=_0x37754d['attributes'][_0x3b56('0x38')]?_0x37754d['attributes']:_0x2891ef[_0x3b56('0x31')];if(!_0x32c5dd[_0x3b56('0x33')][_0x3b56('0x39')](_0x3b56('0x3a'))){_0x37754d[_0x3b56('0x1e')]=qs[_0x3b56('0x1e')](_0x32c5dd[_0x3b56('0x33')]['limit']);_0x37754d[_0x3b56('0x1b')]=qs[_0x3b56('0x1b')](_0x32c5dd[_0x3b56('0x33')][_0x3b56('0x1b')]);}_0x37754d[_0x3b56('0x3b')]=qs['sort'](_0x32c5dd[_0x3b56('0x33')]['sort']);_0x37754d[_0x3b56('0x3c')]=qs[_0x3b56('0x34')](_[_0x3b56('0x3d')](_0x32c5dd['query'],_0x2891ef['filters']),_0x1f93d3);if(_0x32c5dd[_0x3b56('0x33')]['filter']){_0x37754d['where']=_['merge'](_0x37754d[_0x3b56('0x3c')],{'$or':_[_0x3b56('0x2d')](_0x1f93d3,function(_0x3ccef5){if(_0x3ccef5[_0x3b56('0x3e')]!==_0x3b56('0x3f')){var _0x5bcc6a={};_0x5bcc6a[_0x3ccef5[_0x3b56('0x2b')]]={'$like':'%'+_0x32c5dd[_0x3b56('0x33')][_0x3b56('0x40')]+'%'};return _0x5bcc6a;}})});}_0x37754d=_[_0x3b56('0x41')]({},_0x37754d,_0x32c5dd[_0x3b56('0x42')]);var _0x13e540={'where':_0x37754d['where']};return db['Variable'][_0x3b56('0x1d')](_0x13e540)[_0x3b56('0x24')](function(_0xa912fe){_0x117d97[_0x3b56('0x1d')]=_0xa912fe;if(_0x32c5dd[_0x3b56('0x33')][_0x3b56('0x43')]){_0x37754d[_0x3b56('0x44')]=[{'all':!![]}];}return db[_0x3b56('0x2e')][_0x3b56('0x45')](_0x37754d);})[_0x3b56('0x24')](function(_0x344ac5){_0x117d97['rows']=_0x344ac5;return _0x117d97;})[_0x3b56('0x24')](respondWithFilteredResult(_0x4bcf50,_0x37754d))[_0x3b56('0x46')](handleError(_0x4bcf50,null));};exports['show']=function(_0x5a3056,_0x30f864){var _0x2f74c9={'raw':!![],'where':{'id':_0x5a3056[_0x3b56('0x47')]['id']}},_0x48ec2e={};_0x48ec2e[_0x3b56('0x31')]=_[_0x3b56('0x32')](db[_0x3b56('0x2e')]['rawAttributes']);_0x48ec2e[_0x3b56('0x33')]=_[_0x3b56('0x32')](_0x5a3056[_0x3b56('0x33')]);_0x48ec2e['filters']=_[_0x3b56('0x36')](_0x48ec2e[_0x3b56('0x31')],_0x48ec2e['query']);_0x2f74c9[_0x3b56('0x35')]=_['intersection'](_0x48ec2e['model'],qs[_0x3b56('0x37')](_0x5a3056[_0x3b56('0x33')]['fields']));_0x2f74c9[_0x3b56('0x35')]=_0x2f74c9[_0x3b56('0x35')][_0x3b56('0x38')]?_0x2f74c9[_0x3b56('0x35')]:_0x48ec2e[_0x3b56('0x31')];if(_0x5a3056[_0x3b56('0x33')][_0x3b56('0x43')]){_0x2f74c9[_0x3b56('0x44')]=[{'all':!![]}];}_0x2f74c9=_[_0x3b56('0x41')]({},_0x2f74c9,_0x5a3056[_0x3b56('0x42')]);return db[_0x3b56('0x2e')][_0x3b56('0x48')](_0x2f74c9)[_0x3b56('0x24')](handleEntityNotFound(_0x30f864,null))[_0x3b56('0x24')](respondWithResult(_0x30f864,null))['catch'](handleError(_0x30f864,null));};exports[_0x3b56('0x49')]=function(_0x28bf09,_0x4ba0a9){return db[_0x3b56('0x2e')][_0x3b56('0x49')](_0x28bf09[_0x3b56('0x4a')],{})[_0x3b56('0x24')](function(_0x2192c3){var _0x31210b=_0x28bf09['user'][_0x3b56('0x26')]({'plain':!![]});if(!_0x31210b)throw new Error(_0x3b56('0x4b'));if(_0x31210b[_0x3b56('0x4c')]===_0x3b56('0x4d')){var _0x1a72c2=_0x2192c3[_0x3b56('0x26')]({'plain':!![]});var _0x368361=_0x3b56('0x27');return db[_0x3b56('0x4e')][_0x3b56('0x48')]({'where':{'name':_0x368361,'userProfileId':_0x31210b[_0x3b56('0x4f')]},'raw':!![]})[_0x3b56('0x24')](function(_0x863bdb){if(_0x863bdb&&_0x863bdb[_0x3b56('0x50')]===0x0){return db[_0x3b56('0x28')][_0x3b56('0x49')]({'name':_0x1a72c2[_0x3b56('0x2b')],'resourceId':_0x1a72c2['id'],'type':_0x863bdb[_0x3b56('0x2b')],'sectionId':_0x863bdb['id']},{})[_0x3b56('0x24')](function(){return _0x2192c3;});}else{return _0x2192c3;}})['catch'](function(_0x468b64){logger['error'](_0x3b56('0x51'),_0x468b64);throw _0x468b64;});}return _0x2192c3;})[_0x3b56('0x24')](respondWithResult(_0x4ba0a9,0xc9))[_0x3b56('0x46')](handleError(_0x4ba0a9,null));};exports['update']=function(_0x3ba1ac,_0x4fc699){if(_0x3ba1ac[_0x3b56('0x4a')]['id']){delete _0x3ba1ac['body']['id'];}return db[_0x3b56('0x2e')][_0x3b56('0x48')]({'where':{'id':_0x3ba1ac[_0x3b56('0x47')]['id']}})[_0x3b56('0x24')](handleEntityNotFound(_0x4fc699,null))[_0x3b56('0x24')](saveUpdates(_0x3ba1ac[_0x3b56('0x4a')],null))['then'](respondWithResult(_0x4fc699,null))[_0x3b56('0x46')](handleError(_0x4fc699,null));};exports[_0x3b56('0x25')]=function(_0x306262,_0x10054c){return db['Variable']['find']({'where':{'id':_0x306262[_0x3b56('0x47')]['id']}})[_0x3b56('0x24')](handleEntityNotFound(_0x10054c,null))[_0x3b56('0x24')](removeEntity(_0x10054c,null))[_0x3b56('0x46')](handleError(_0x10054c,null));}; \ No newline at end of file +var _0x4e31=['order','where','pick','filter','merge','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Variables','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','update','then','destroy','get','sendStatus','send','map','Variable','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3c2407,_0x3c9a47){var _0x5d2eac=function(_0xb33bf8){while(--_0xb33bf8){_0x3c2407['push'](_0x3c2407['shift']());}};_0x5d2eac(++_0x3c9a47);}(_0x4e31,0x1ad));var _0x14e3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4e31[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x14e3('0x0'));var rimraf=require(_0x14e3('0x1'));var zipdir=require(_0x14e3('0x2'));var jsonpatch=require(_0x14e3('0x3'));var rp=require(_0x14e3('0x4'));var moment=require(_0x14e3('0x5'));var BPromise=require(_0x14e3('0x6'));var Mustache=require(_0x14e3('0x7'));var util=require(_0x14e3('0x8'));var path=require(_0x14e3('0x9'));var sox=require(_0x14e3('0xa'));var csv=require(_0x14e3('0xb'));var ejs=require(_0x14e3('0xc'));var fs=require('fs');var fs_extra=require(_0x14e3('0xd'));var _=require(_0x14e3('0xe'));var squel=require(_0x14e3('0xf'));var crypto=require(_0x14e3('0x10'));var jsforce=require(_0x14e3('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x14e3('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x14e3('0x12'));var authService=require(_0x14e3('0x13'));var qs=require(_0x14e3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14e3('0x15'));var logger=require(_0x14e3('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x14e3('0x17'));var licenseUtil=require(_0x14e3('0x18'));var db=require(_0x14e3('0x19'))['db'];function respondWithStatusCode(_0x2725d9,_0x4e2780){_0x4e2780=_0x4e2780||0xcc;return function(_0x217def){if(_0x217def){return _0x2725d9['sendStatus'](_0x4e2780);}return _0x2725d9['status'](_0x4e2780)[_0x14e3('0x1a')]();};}function respondWithResult(_0xc5231e,_0x2611bb){_0x2611bb=_0x2611bb||0xc8;return function(_0x23da67){if(_0x23da67){return _0xc5231e['status'](_0x2611bb)[_0x14e3('0x1b')](_0x23da67);}};}function respondWithFilteredResult(_0x37fb13,_0x586f11){return function(_0x1ad3b1){if(_0x1ad3b1){var _0x3f9d4d=typeof _0x586f11[_0x14e3('0x1c')]==='undefined'&&typeof _0x586f11['limit']===_0x14e3('0x1d');var _0x34eb28=_0x1ad3b1[_0x14e3('0x1e')];var _0x42d2ee=_0x3f9d4d?0x0:_0x586f11[_0x14e3('0x1c')];var _0x530e19=_0x3f9d4d?_0x1ad3b1[_0x14e3('0x1e')]:_0x586f11[_0x14e3('0x1c')]+_0x586f11[_0x14e3('0x1f')];var _0x475434;if(_0x530e19>=_0x34eb28){_0x530e19=_0x34eb28;_0x475434=0xc8;}else{_0x475434=0xce;}_0x37fb13[_0x14e3('0x20')](_0x475434);return _0x37fb13[_0x14e3('0x21')](_0x14e3('0x22'),_0x42d2ee+'-'+_0x530e19+'/'+_0x34eb28)['json'](_0x1ad3b1);}return null;};}function patchUpdates(_0x467f5){return function(_0x46f08e){try{jsonpatch[_0x14e3('0x23')](_0x46f08e,_0x467f5,!![]);}catch(_0x26d27a){return BPromise['reject'](_0x26d27a);}return _0x46f08e['save']();};}function saveUpdates(_0x28b315,_0x3d8993){return function(_0x1ce7c6){if(_0x1ce7c6){return _0x1ce7c6[_0x14e3('0x24')](_0x28b315)[_0x14e3('0x25')](function(_0xdd9fe1){return _0xdd9fe1;});}return null;};}function removeEntity(_0x1c8e3a,_0x34f9a3){return function(_0x13cca1){if(_0x13cca1){return _0x13cca1[_0x14e3('0x26')]()[_0x14e3('0x25')](function(){var _0x1fbdee=_0x13cca1[_0x14e3('0x27')]({'plain':!![]});var _0x56ccf7='Variables';return db['UserProfileResource'][_0x14e3('0x26')]({'where':{'type':_0x56ccf7,'resourceId':_0x1fbdee['id']}})[_0x14e3('0x25')](function(){return _0x13cca1;});})[_0x14e3('0x25')](function(){_0x1c8e3a[_0x14e3('0x20')](0xcc)[_0x14e3('0x1a')]();});}};}function handleEntityNotFound(_0x34b7dc,_0x1ce11b){return function(_0x878078){if(!_0x878078){_0x34b7dc[_0x14e3('0x28')](0x194);}return _0x878078;};}function handleError(_0x35dc8b,_0x17ae77){_0x17ae77=_0x17ae77||0x1f4;return function(_0x53756b){logger['error'](_0x53756b['stack']);if(_0x53756b['name']){delete _0x53756b['name'];}_0x35dc8b[_0x14e3('0x20')](_0x17ae77)[_0x14e3('0x29')](_0x53756b);};}exports['index']=function(_0x40fe82,_0x2fcbd2){var _0x1ea9d6={},_0x5de90d={},_0x48bb78={'count':0x0,'rows':[]};var _0x2db238=_[_0x14e3('0x2a')](db[_0x14e3('0x2b')]['rawAttributes'],function(_0x1a555d){return{'name':_0x1a555d[_0x14e3('0x2c')],'type':_0x1a555d[_0x14e3('0x2d')]['key']};});_0x5de90d[_0x14e3('0x2e')]=_[_0x14e3('0x2a')](_0x2db238,_0x14e3('0x2f'));_0x5de90d[_0x14e3('0x30')]=_[_0x14e3('0x31')](_0x40fe82[_0x14e3('0x30')]);_0x5de90d[_0x14e3('0x32')]=_[_0x14e3('0x33')](_0x5de90d[_0x14e3('0x2e')],_0x5de90d[_0x14e3('0x30')]);_0x1ea9d6[_0x14e3('0x34')]=_[_0x14e3('0x33')](_0x5de90d['model'],qs['fields'](_0x40fe82['query'][_0x14e3('0x35')]));_0x1ea9d6['attributes']=_0x1ea9d6[_0x14e3('0x34')][_0x14e3('0x36')]?_0x1ea9d6[_0x14e3('0x34')]:_0x5de90d[_0x14e3('0x2e')];if(!_0x40fe82[_0x14e3('0x30')][_0x14e3('0x37')](_0x14e3('0x38'))){_0x1ea9d6[_0x14e3('0x1f')]=qs[_0x14e3('0x1f')](_0x40fe82['query'][_0x14e3('0x1f')]);_0x1ea9d6['offset']=qs['offset'](_0x40fe82[_0x14e3('0x30')][_0x14e3('0x1c')]);}_0x1ea9d6[_0x14e3('0x39')]=qs['sort'](_0x40fe82['query']['sort']);_0x1ea9d6[_0x14e3('0x3a')]=qs[_0x14e3('0x32')](_[_0x14e3('0x3b')](_0x40fe82['query'],_0x5de90d[_0x14e3('0x32')]),_0x2db238);if(_0x40fe82[_0x14e3('0x30')][_0x14e3('0x3c')]){_0x1ea9d6[_0x14e3('0x3a')]=_[_0x14e3('0x3d')](_0x1ea9d6[_0x14e3('0x3a')],{'$or':_['map'](_0x2db238,function(_0x5a2028){if(_0x5a2028[_0x14e3('0x2d')]!=='VIRTUAL'){var _0x3951c8={};_0x3951c8[_0x5a2028[_0x14e3('0x2f')]]={'$like':'%'+_0x40fe82['query'][_0x14e3('0x3c')]+'%'};return _0x3951c8;}})});}_0x1ea9d6=_['merge']({},_0x1ea9d6,_0x40fe82['options']);var _0x4a31de={'where':_0x1ea9d6[_0x14e3('0x3a')]};return db['Variable'][_0x14e3('0x1e')](_0x4a31de)[_0x14e3('0x25')](function(_0x4181d3){_0x48bb78['count']=_0x4181d3;if(_0x40fe82[_0x14e3('0x30')][_0x14e3('0x3e')]){_0x1ea9d6[_0x14e3('0x3f')]=[{'all':!![]}];}return db['Variable']['findAll'](_0x1ea9d6);})[_0x14e3('0x25')](function(_0x40a1c1){_0x48bb78[_0x14e3('0x40')]=_0x40a1c1;return _0x48bb78;})[_0x14e3('0x25')](respondWithFilteredResult(_0x2fcbd2,_0x1ea9d6))[_0x14e3('0x41')](handleError(_0x2fcbd2,null));};exports[_0x14e3('0x42')]=function(_0x3803f3,_0x164f61){var _0x5ef418={'raw':!![],'where':{'id':_0x3803f3[_0x14e3('0x43')]['id']}},_0x325d94={};_0x325d94['model']=_[_0x14e3('0x31')](db[_0x14e3('0x2b')][_0x14e3('0x44')]);_0x325d94[_0x14e3('0x30')]=_[_0x14e3('0x31')](_0x3803f3['query']);_0x325d94[_0x14e3('0x32')]=_['intersection'](_0x325d94[_0x14e3('0x2e')],_0x325d94['query']);_0x5ef418[_0x14e3('0x34')]=_['intersection'](_0x325d94['model'],qs[_0x14e3('0x35')](_0x3803f3[_0x14e3('0x30')][_0x14e3('0x35')]));_0x5ef418['attributes']=_0x5ef418['attributes'][_0x14e3('0x36')]?_0x5ef418[_0x14e3('0x34')]:_0x325d94[_0x14e3('0x2e')];if(_0x3803f3[_0x14e3('0x30')]['includeAll']){_0x5ef418[_0x14e3('0x3f')]=[{'all':!![]}];}_0x5ef418=_['merge']({},_0x5ef418,_0x3803f3[_0x14e3('0x45')]);return db[_0x14e3('0x2b')][_0x14e3('0x46')](_0x5ef418)['then'](handleEntityNotFound(_0x164f61,null))[_0x14e3('0x25')](respondWithResult(_0x164f61,null))[_0x14e3('0x41')](handleError(_0x164f61,null));};exports[_0x14e3('0x47')]=function(_0x3671af,_0x402c0d){return db[_0x14e3('0x2b')][_0x14e3('0x47')](_0x3671af[_0x14e3('0x48')],{})[_0x14e3('0x25')](function(_0x38ad28){var _0x1a2826=_0x3671af[_0x14e3('0x49')][_0x14e3('0x27')]({'plain':!![]});if(!_0x1a2826)throw new Error(_0x14e3('0x4a'));if(_0x1a2826['role']==='user'){var _0x5e066c=_0x38ad28[_0x14e3('0x27')]({'plain':!![]});var _0x52a4bf=_0x14e3('0x4b');return db[_0x14e3('0x4c')][_0x14e3('0x46')]({'where':{'name':_0x52a4bf,'userProfileId':_0x1a2826[_0x14e3('0x4d')]},'raw':!![]})[_0x14e3('0x25')](function(_0x183f27){if(_0x183f27&&_0x183f27[_0x14e3('0x4e')]===0x0){return db[_0x14e3('0x4f')]['create']({'name':_0x5e066c[_0x14e3('0x2f')],'resourceId':_0x5e066c['id'],'type':_0x183f27[_0x14e3('0x2f')],'sectionId':_0x183f27['id']},{})['then'](function(){return _0x38ad28;});}else{return _0x38ad28;}})[_0x14e3('0x41')](function(_0x1f4b56){logger[_0x14e3('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f4b56);throw _0x1f4b56;});}return _0x38ad28;})[_0x14e3('0x25')](respondWithResult(_0x402c0d,0xc9))[_0x14e3('0x41')](handleError(_0x402c0d,null));};exports['update']=function(_0x3aead0,_0x21fd9e){if(_0x3aead0['body']['id']){delete _0x3aead0[_0x14e3('0x48')]['id'];}return db['Variable'][_0x14e3('0x46')]({'where':{'id':_0x3aead0[_0x14e3('0x43')]['id']}})[_0x14e3('0x25')](handleEntityNotFound(_0x21fd9e,null))[_0x14e3('0x25')](saveUpdates(_0x3aead0[_0x14e3('0x48')],null))[_0x14e3('0x25')](respondWithResult(_0x21fd9e,null))[_0x14e3('0x41')](handleError(_0x21fd9e,null));};exports['destroy']=function(_0x128433,_0x3446d9){return db[_0x14e3('0x2b')][_0x14e3('0x46')]({'where':{'id':_0x128433['params']['id']}})['then'](handleEntityNotFound(_0x3446d9,null))[_0x14e3('0x25')](removeEntity(_0x3446d9,null))[_0x14e3('0x41')](handleError(_0x3446d9,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 1c719e3..47d9359 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 _0x55bf=['exports','define','Variable','tools_variables','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./variable.attributes'];(function(_0x54f844,_0x42e52a){var _0x492c33=function(_0x56bbb6){while(--_0x56bbb6){_0x54f844['push'](_0x54f844['shift']());}};_0x492c33(++_0x42e52a);}(_0x55bf,0x156));var _0xf55b=function(_0x149a14,_0x71e0f4){_0x149a14=_0x149a14-0x0;var _0x3e2d79=_0x55bf[_0x149a14];return _0x3e2d79;};'use strict';var _=require('lodash');var util=require(_0xf55b('0x0'));var logger=require(_0xf55b('0x1'))(_0xf55b('0x2'));var moment=require(_0xf55b('0x3'));var BPromise=require(_0xf55b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf55b('0x5'));var rimraf=require(_0xf55b('0x6'));var config=require(_0xf55b('0x7'));var attributes=require(_0xf55b('0x8'));module[_0xf55b('0x9')]=function(_0x80d950,_0x4c0248){return _0x80d950[_0xf55b('0xa')](_0xf55b('0xb'),attributes,{'tableName':_0xf55b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c2b=['./variable.attributes','exports','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5a36ed,_0x122618){var _0x38f259=function(_0x13c434){while(--_0x13c434){_0x5a36ed['push'](_0x5a36ed['shift']());}};_0x38f259(++_0x122618);}(_0x7c2b,0xc4));var _0xb7c2=function(_0x421317,_0x31f494){_0x421317=_0x421317-0x0;var _0x13d981=_0x7c2b[_0x421317];return _0x13d981;};'use strict';var _=require(_0xb7c2('0x0'));var util=require('util');var logger=require(_0xb7c2('0x1'))(_0xb7c2('0x2'));var moment=require(_0xb7c2('0x3'));var BPromise=require(_0xb7c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7c2('0x5'));var rimraf=require(_0xb7c2('0x6'));var config=require(_0xb7c2('0x7'));var attributes=require(_0xb7c2('0x8'));module[_0xb7c2('0x9')]=function(_0x54c707,_0x16c81c){return _0x54c707['define'](_0xb7c2('0xa'),attributes,{'tableName':_0xb7c2('0xb'),'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 6594669..a7d482f 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 _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x5141a4,_0x30ca29){var _0x6e1a6=function(_0x4fd8f1){while(--_0x4fd8f1){_0x5141a4['push'](_0x5141a4['shift']());}};_0x6e1a6(++_0x30ca29);}(_0x6aa7,0x178));var _0x76aa=function(_0x58e5b7,_0x230532){_0x58e5b7=_0x58e5b7-0x0;var _0xd74063=_0x6aa7[_0x58e5b7];return _0xd74063;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file +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(_0x39e164,_0x2cb93b){var _0x13fa6b=function(_0x511cb2){while(--_0x511cb2){_0x39e164['push'](_0x39e164['shift']());}};_0x13fa6b(++_0x2cb93b);}(_0x55ca,0x126));var _0xa55c=function(_0x5baadf,_0x1bb942){_0x5baadf=_0x5baadf-0x0;var _0x3cd985=_0x55ca[_0x5baadf];return _0x3cd985;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 70e3f9c..45035e2 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 _0xd215=['restart','migrations','exports','express','Router','../../components/auth/service','get','index','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd215,0xf3));var _0x5d21=function(_0x22fbdd,_0x4ed06a){_0x22fbdd=_0x22fbdd-0x0;var _0x56dfbf=_0xd215[_0x22fbdd];return _0x56dfbf;};'use strict';var express=require(_0x5d21('0x0'));var router=express[_0x5d21('0x1')]();var auth=require(_0x5d21('0x2'));var controller=require('./version.controller');router[_0x5d21('0x3')]('/',controller[_0x5d21('0x4')]);router['get']('/fetch',auth[_0x5d21('0x5')](),auth[_0x5d21('0x6')](),controller[_0x5d21('0x7')]);router['get'](_0x5d21('0x8'),auth[_0x5d21('0x5')](),auth['canUpdate'](),controller[_0x5d21('0x9')]);router[_0x5d21('0x3')](_0x5d21('0xa'),auth[_0x5d21('0x5')](),auth[_0x5d21('0x6')](),controller[_0x5d21('0xb')]);router[_0x5d21('0x3')](_0x5d21('0xc'),auth[_0x5d21('0x5')](),controller[_0x5d21('0xd')]);router[_0x5d21('0x3')]('/migrations',controller[_0x5d21('0xe')]);module[_0x5d21('0xf')]=router; \ No newline at end of file +var _0x19c5=['pull','/restart','restart','migrations','exports','express','Router','get','index','isAuthenticated','canUpdate','fetch','reset','/pull'];(function(_0x7262a6,_0x416d47){var _0xd3b6e1=function(_0x344784){while(--_0x344784){_0x7262a6['push'](_0x7262a6['shift']());}};_0xd3b6e1(++_0x416d47);}(_0x19c5,0xbb));var _0x519c=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0x19c5[_0x3afe18];return _0x19ed1f;};'use strict';var express=require(_0x519c('0x0'));var router=express[_0x519c('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0x519c('0x2')]('/',controller[_0x519c('0x3')]);router[_0x519c('0x2')]('/fetch',auth[_0x519c('0x4')](),auth[_0x519c('0x5')](),controller[_0x519c('0x6')]);router[_0x519c('0x2')]('/reset',auth[_0x519c('0x4')](),auth[_0x519c('0x5')](),controller[_0x519c('0x7')]);router[_0x519c('0x2')](_0x519c('0x8'),auth[_0x519c('0x4')](),auth['canUpdate'](),controller[_0x519c('0x9')]);router['get'](_0x519c('0xa'),auth['isAuthenticated'](),controller[_0x519c('0xb')]);router['get']('/migrations',controller[_0x519c('0xc')]);module[_0x519c('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index ea8078a..f90547f 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 _0x620a=['exports','query','latest','tags','json','status','fetch','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','child_process','../../mysqldb','../../config/environment','update','root','index'];(function(_0x3e550c,_0x5432e2){var _0x89e6e6=function(_0x3ca762){while(--_0x3ca762){_0x3e550c['push'](_0x3e550c['shift']());}};_0x89e6e6(++_0x5432e2);}(_0x620a,0xc2));var _0xa620=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x620a[_0x9cd4c3];return _0x4c9025;};'use strict';var Umzug=require(_0xa620('0x0'));var path=require(_0xa620('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xa620('0x2'))(module,_0xa620('0x3'));var compareVersions=require('compare-versions');var exec=require(_0xa620('0x4'))['exec'];var db=require(_0xa620('0x5'))['db'];var config=require(_0xa620('0x6'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xa620('0x7'));var git=require('simple-git')(config[_0xa620('0x8')]);exports[_0xa620('0x9')]=function(_0x1aecc9,_0x1e0fbb){var _0x2c8fce={'current':module[_0xa620('0xa')]['version'],'phonebar':0x2};if(_0x1aecc9[_0xa620('0xb')]&&_0x1aecc9[_0xa620('0xb')][_0xa620('0xc')]){return git['fetch']()[_0xa620('0xd')](function(_0x56357f,_0x2e35c9){_0x2c8fce['latest']=(_0x56357f?module[_0xa620('0xa')][_0xa620('0x3')]:_0x2e35c9[_0xa620('0xc')])||'2.0.0';return _0x1e0fbb['status'](0xc8)[_0xa620('0xe')](_0x2c8fce);});}else{return _0x1e0fbb[_0xa620('0xf')](0xc8)['json'](_0x2c8fce);}};exports[_0xa620('0x10')]=function(_0x35446e,_0x114fbf){return git[_0xa620('0x10')](['origin','master'],function(_0x1aa523){if(_0x1aa523){logger['error'](_0x1aa523);return _0x114fbf[_0xa620('0xf')](0x1f4)[_0xa620('0xe')](_0x1aa523);}logger[_0xa620('0x11')](_0xa620('0x12'));return _0x114fbf[_0xa620('0xf')](0xc8)[_0xa620('0xe')]({'output':_0xa620('0x13')});});};exports['reset']=function(_0x46f218,_0x1edb41){return git[_0xa620('0x14')]([_0xa620('0x15'),_0xa620('0x16')],function(_0xcffefb){if(_0xcffefb){logger['error'](_0xcffefb);return _0x1edb41[_0xa620('0xf')](0x1f4)[_0xa620('0xe')](_0xcffefb);}logger['info'](_0xa620('0x17'));return _0x1edb41[_0xa620('0xf')](0xc8)[_0xa620('0xe')]({'output':'git\x20reset\x20--hard'});});};exports[_0xa620('0x18')]=function(_0x1b8e6c,_0xe7d941){exec('npm\x20install\x20--production',function(_0x5ae938,_0x28b941,_0x4de207){logger['info'](_0x28b941);logger[_0xa620('0x11')](_0x4de207);if(_0x5ae938){logger[_0xa620('0x19')](_0x5ae938);return _0xe7d941[_0xa620('0xf')](0x1f4)[_0xa620('0xe')](_0x5ae938);}return _0xe7d941[_0xa620('0xf')](0xc8)[_0xa620('0xe')]({'output':_0x28b941});});};exports[_0xa620('0x1a')]=function(_0x3b2549,_0x1a7ef6){return pm2[_0xa620('0x1a')](_0xa620('0x1b'))[_0xa620('0x1c')](function(_0x27c86d){logger['info'](_0xa620('0x1d'),_0x27c86d);return _0x1a7ef6[_0xa620('0xf')](0xc8)[_0xa620('0xe')]({'output':_0xa620('0x1e')});})[_0xa620('0x1f')](function(_0x355d0a){logger['error'](_0x355d0a);return _0x1a7ef6[_0xa620('0xf')](0x1f4)[_0xa620('0xe')](_0x355d0a);});};exports[_0xa620('0x20')]=function(_0x32237f,_0x459bdd){var _0x23aad1=fs[_0xa620('0x21')](path[_0xa620('0x22')](config[_0xa620('0x8')],_0xa620('0x23'),_0xa620('0x20')));var _0x5a9f88=[];for(var _0x471d4b=0x0;_0x471d4b<_0x23aad1[_0xa620('0x24')];_0x471d4b++){var _0xabd3d5=_0x23aad1[_0x471d4b][_0xa620('0x25')](_0xa620('0x26'),'');if(compareVersions(module['exports']['version'],_0xabd3d5)===-0x1){_0x5a9f88[_0xa620('0x27')](_0xabd3d5);}}if(_0x5a9f88[_0xa620('0x24')]){var _0x1379f7=_0x5a9f88[_0xa620('0x28')](compareVersions);var _0x4d4faa=new Umzug({'storage':_0xa620('0x29'),'storageOptions':{'model':db[_0xa620('0x2a')],'modelName':_0xa620('0x2a'),'columnName':_0xa620('0x3')},'migrations':{'params':[db[_0xa620('0x29')][_0xa620('0x2b')](),db[_0xa620('0x29')][_0xa620('0x2c')],function(){throw new Error(_0xa620('0x2d'));}],'path':path[_0xa620('0x22')](config['root'],'server',_0xa620('0x20')),'pattern':/\.js$/}});_0x4d4faa['up']({'migrations':_['map'](_0x1379f7,function(_0x2878ea){return _0x2878ea+_0xa620('0x26');})})[_0xa620('0x1c')](function(){return _0x459bdd['status'](0xc8)[_0xa620('0xe')]({'output':_0xa620('0x2e')+module[_0xa620('0xa')][_0xa620('0x3')]+_0xa620('0x2f')+_[_0xa620('0x30')](_0x1379f7),'migrations':_[_0xa620('0x22')](_0x1379f7)});})['catch'](function(_0x4ef65e){if(_0x4ef65e instanceof db[_0xa620('0x29')][_0xa620('0x31')]){return _0x459bdd['status'](0xc8)[_0xa620('0xe')]({'output':_0xa620('0x32')});}else{return _0x459bdd[_0xa620('0xf')](0x1f4)[_0xa620('0xe')](_0x4ef65e);}});}else{return _0x459bdd[_0xa620('0xf')](0xc8)[_0xa620('0xe')]({'output':_0xa620('0x32')});}}; \ No newline at end of file +var _0x31f3=['git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js','push','sort','Migration','sequelize','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','update','root','index','exports','latest','tags','status','json','fetch','origin','master','error'];(function(_0x21aafd,_0x1f0fa6){var _0x9f2800=function(_0xf23734){while(--_0xf23734){_0x21aafd['push'](_0x21aafd['shift']());}};_0x9f2800(++_0x1f0fa6);}(_0x31f3,0x123));var _0x331f=function(_0xb93836,_0x2e7941){_0xb93836=_0xb93836-0x0;var _0x2b3e5b=_0x31f3[_0xb93836];return _0x2b3e5b;};'use strict';var Umzug=require(_0x331f('0x0'));var path=require(_0x331f('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x331f('0x2'))(module,_0x331f('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x331f('0x4'))[_0x331f('0x5')];var db=require(_0x331f('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x331f('0x7'));var logger=require(_0x331f('0x8'))(_0x331f('0x9'));var git=require('simple-git')(config[_0x331f('0xa')]);exports[_0x331f('0xb')]=function(_0x52194f,_0x331f32){var _0x2376d5={'current':module[_0x331f('0xc')][_0x331f('0x3')],'phonebar':0x2};if(_0x52194f['query']&&_0x52194f['query'][_0x331f('0xd')]){return git['fetch']()[_0x331f('0xe')](function(_0x2ddf2d,_0x5380d0){_0x2376d5[_0x331f('0xd')]=(_0x2ddf2d?module[_0x331f('0xc')][_0x331f('0x3')]:_0x5380d0[_0x331f('0xd')])||'2.0.0';return _0x331f32[_0x331f('0xf')](0xc8)[_0x331f('0x10')](_0x2376d5);});}else{return _0x331f32[_0x331f('0xf')](0xc8)['json'](_0x2376d5);}};exports[_0x331f('0x11')]=function(_0x4fd8b6,_0x2fef2a){return git['fetch']([_0x331f('0x12'),_0x331f('0x13')],function(_0xd65825){if(_0xd65825){logger[_0x331f('0x14')](_0xd65825);return _0x2fef2a[_0x331f('0xf')](0x1f4)['json'](_0xd65825);}logger['info'](_0x331f('0x15'));return _0x2fef2a[_0x331f('0xf')](0xc8)[_0x331f('0x10')]({'output':_0x331f('0x16')});});};exports[_0x331f('0x17')]=function(_0x888ffc,_0x1d8051){return git['reset']([_0x331f('0x18'),_0x331f('0x19')],function(_0x1dee3b){if(_0x1dee3b){logger[_0x331f('0x14')](_0x1dee3b);return _0x1d8051['status'](0x1f4)['json'](_0x1dee3b);}logger[_0x331f('0x1a')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x1d8051[_0x331f('0xf')](0xc8)[_0x331f('0x10')]({'output':_0x331f('0x1b')});});};exports[_0x331f('0x1c')]=function(_0x145cea,_0x28b901){exec(_0x331f('0x1d'),function(_0x1205da,_0x4f3f3c,_0x3960c8){logger['info'](_0x4f3f3c);logger[_0x331f('0x1a')](_0x3960c8);if(_0x1205da){logger[_0x331f('0x14')](_0x1205da);return _0x28b901[_0x331f('0xf')](0x1f4)[_0x331f('0x10')](_0x1205da);}return _0x28b901['status'](0xc8)[_0x331f('0x10')]({'output':_0x4f3f3c});});};exports['restart']=function(_0x27f964,_0x46801a){return pm2[_0x331f('0x1e')](_0x331f('0x1f'))[_0x331f('0x20')](function(_0x452494){logger[_0x331f('0x1a')](_0x331f('0x21'),_0x452494);return _0x46801a[_0x331f('0xf')](0xc8)[_0x331f('0x10')]({'output':_0x331f('0x22')});})[_0x331f('0x23')](function(_0xb119e1){logger[_0x331f('0x14')](_0xb119e1);return _0x46801a[_0x331f('0xf')](0x1f4)['json'](_0xb119e1);});};exports[_0x331f('0x24')]=function(_0xc1dd77,_0x20323c){var _0x52a547=fs[_0x331f('0x25')](path[_0x331f('0x26')](config[_0x331f('0xa')],_0x331f('0x27'),_0x331f('0x24')));var _0x55204a=[];for(var _0x217817=0x0;_0x217817<_0x52a547[_0x331f('0x28')];_0x217817++){var _0x45f29a=_0x52a547[_0x217817]['replace'](_0x331f('0x29'),'');if(compareVersions(module['exports']['version'],_0x45f29a)===-0x1){_0x55204a[_0x331f('0x2a')](_0x45f29a);}}if(_0x55204a[_0x331f('0x28')]){var _0x4da565=_0x55204a[_0x331f('0x2b')](compareVersions);var _0x240e8a=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x331f('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0x331f('0x2d')][_0x331f('0x2e')](),db['sequelize']['constructor'],function(){throw new Error(_0x331f('0x2f'));}],'path':path['join'](config[_0x331f('0xa')],'server',_0x331f('0x24')),'pattern':/\.js$/}});_0x240e8a['up']({'migrations':_[_0x331f('0x30')](_0x4da565,function(_0x12f1b9){return _0x12f1b9+_0x331f('0x29');})})[_0x331f('0x20')](function(){return _0x20323c[_0x331f('0xf')](0xc8)[_0x331f('0x10')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x331f('0xc')][_0x331f('0x3')]+'\x20to\x20'+_[_0x331f('0x31')](_0x4da565),'migrations':_[_0x331f('0x26')](_0x4da565)});})[_0x331f('0x23')](function(_0x5dbf6a){if(_0x5dbf6a instanceof db[_0x331f('0x2d')][_0x331f('0x32')]){return _0x20323c[_0x331f('0xf')](0xc8)[_0x331f('0x10')]({'output':_0x331f('0x33')});}else{return _0x20323c[_0x331f('0xf')](0x1f4)[_0x331f('0x10')](_0x5dbf6a);}});}else{return _0x20323c['status'](0xc8)['json']({'output':_0x331f('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index d833e30..1e4af5a 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 _0xa224=['update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','create','put'];(function(_0x1805c0,_0x4707b5){var _0xd2c505=function(_0x240838){while(--_0x240838){_0x1805c0['push'](_0x1805c0['shift']());}};_0xd2c505(++_0x4707b5);}(_0xa224,0x6f));var _0x4a22=function(_0x799ac4,_0x223f8e){_0x799ac4=_0x799ac4-0x0;var _0x16deae=_0xa224[_0x799ac4];return _0x16deae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4a22('0x0'));var timeout=require(_0x4a22('0x1'));var express=require('express');var router=express[_0x4a22('0x2')]();var fs_extra=require(_0x4a22('0x3'));var auth=require(_0x4a22('0x4'));var interaction=require(_0x4a22('0x5'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x4a22('0x6')]('/',auth[_0x4a22('0x7')](),controller[_0x4a22('0x8')]);router[_0x4a22('0x6')](_0x4a22('0x9'),auth[_0x4a22('0x7')](),controller[_0x4a22('0xa')]);router['get'](_0x4a22('0xb'),auth[_0x4a22('0x7')](),controller[_0x4a22('0xc')]);router['post']('/',auth[_0x4a22('0x7')](),controller[_0x4a22('0xd')]);router[_0x4a22('0xe')](_0x4a22('0xb'),auth['isAuthenticated'](),controller[_0x4a22('0xf')]);router['delete']('/:id',auth[_0x4a22('0x7')](),controller[_0x4a22('0x10')]);module[_0x4a22('0x11')]=router; \ No newline at end of file +var _0xc9c2=['/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe'];(function(_0x48d151,_0x454064){var _0x3492dd=function(_0x3c3d8b){while(--_0x3c3d8b){_0x48d151['push'](_0x48d151['shift']());}};_0x3492dd(++_0x454064);}(_0xc9c2,0x75));var _0x2c9c=function(_0x70a208,_0x5487d2){_0x70a208=_0x70a208-0x0;var _0x3a2442=_0xc9c2[_0x70a208];return _0x3a2442;};'use strict';var multer=require(_0x2c9c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2c9c('0x1'));var express=require(_0x2c9c('0x2'));var router=express[_0x2c9c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2c9c('0x4'));var interaction=require(_0x2c9c('0x5'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0x2c9c('0x6')](),controller['index']);router[_0x2c9c('0x7')](_0x2c9c('0x8'),auth[_0x2c9c('0x6')](),controller['describe']);router[_0x2c9c('0x7')](_0x2c9c('0x9'),auth[_0x2c9c('0x6')](),controller[_0x2c9c('0xa')]);router[_0x2c9c('0xb')]('/',auth[_0x2c9c('0x6')](),controller[_0x2c9c('0xc')]);router[_0x2c9c('0xd')]('/:id',auth[_0x2c9c('0x6')](),controller[_0x2c9c('0xe')]);router[_0x2c9c('0xf')](_0x2c9c('0x9'),auth[_0x2c9c('0x6')](),controller[_0x2c9c('0x10')]);module[_0x2c9c('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 513a941..5f9faa3 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 _0x01d3=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x01d3,0xa2));var _0x301d=function(_0x289f9c,_0x4fb5c9){_0x289f9c=_0x289f9c-0x0;var _0x54e021=_0x01d3[_0x289f9c];return _0x54e021;};'use strict';var Sequelize=require(_0x301d('0x0'));module[_0x301d('0x1')]={'type':{'type':Sequelize[_0x301d('0x2')]},'uniqueid':{'type':Sequelize[_0x301d('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x301d('0x2')]},'queue':{'type':Sequelize[_0x301d('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x301d('0x2')]},'agentcalledAt':{'type':Sequelize[_0x301d('0x3')]},'agentconnectAt':{'type':Sequelize[_0x301d('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x301d('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x301d('0x3')]},'holdtime':{'type':Sequelize[_0x301d('0x4')]},'agentcomplete':{'type':Sequelize[_0x301d('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x301d('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x301d('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x301d('0x4')]},'agentacw':{'type':Sequelize[_0x301d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x301d('0x4')]},'reason':{'type':Sequelize[_0x301d('0x2')]},'lastevent':{'type':Sequelize[_0x301d('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x301d('0x4')]},'channelstatedesc':{'type':Sequelize[_0x301d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x301d('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x301d('0x2')]},'accountcode':{'type':Sequelize[_0x301d('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x301d('0x2')]},'destchannelstate':{'type':Sequelize[_0x301d('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x301d('0x2')]},'destcalleridnum':{'type':Sequelize[_0x301d('0x2')]},'destcalleridname':{'type':Sequelize[_0x301d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x301d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x301d('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x301d('0x2')]},'destexten':{'type':Sequelize[_0x301d('0x2')]},'destpriority':{'type':Sequelize[_0x301d('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x301d('0x2')],'comment':_0x301d('0x6')},'transferexten':{'type':Sequelize[_0x301d('0x2')]},'transferuniqueid':{'type':Sequelize[_0x301d('0x2')]},'agententerreason':{'type':Sequelize[_0x301d('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9efc=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x4146bf,_0x25c865){var _0x5d189a=function(_0x179884){while(--_0x179884){_0x4146bf['push'](_0x4146bf['shift']());}};_0x5d189a(++_0x25c865);}(_0x9efc,0x19c));var _0xc9ef=function(_0x891c55,_0x233fe8){_0x891c55=_0x891c55-0x0;var _0x260823=_0x9efc[_0x891c55];return _0x260823;};'use strict';var Sequelize=require(_0xc9ef('0x0'));module[_0xc9ef('0x1')]={'type':{'type':Sequelize[_0xc9ef('0x2')]},'uniqueid':{'type':Sequelize[_0xc9ef('0x2')]},'calleridnum':{'type':Sequelize[_0xc9ef('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc9ef('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xc9ef('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xc9ef('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xc9ef('0x3')]},'holdtime':{'type':Sequelize[_0xc9ef('0x4')]},'agentcomplete':{'type':Sequelize[_0xc9ef('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xc9ef('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc9ef('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xc9ef('0x4')]},'agentacw':{'type':Sequelize[_0xc9ef('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc9ef('0x4')]},'reason':{'type':Sequelize[_0xc9ef('0x2')]},'lastevent':{'type':Sequelize[_0xc9ef('0x2')]},'channel':{'type':Sequelize[_0xc9ef('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xc9ef('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc9ef('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc9ef('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xc9ef('0x2')]},'destchannelstate':{'type':Sequelize[_0xc9ef('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xc9ef('0x2')]},'destcalleridnum':{'type':Sequelize[_0xc9ef('0x2')]},'destcalleridname':{'type':Sequelize[_0xc9ef('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc9ef('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc9ef('0x2')]},'destlanguage':{'type':Sequelize[_0xc9ef('0x2')]},'destaccountcode':{'type':Sequelize[_0xc9ef('0x2')]},'destcontext':{'type':Sequelize[_0xc9ef('0x2')]},'destexten':{'type':Sequelize[_0xc9ef('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xc9ef('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xc9ef('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xc9ef('0x2')]},'transfer':{'type':Sequelize[_0xc9ef('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc9ef('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xc9ef('0x2')]},'transferuniqueid':{'type':Sequelize[_0xc9ef('0x2')]},'agententerreason':{'type':Sequelize[_0xc9ef('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index b040522..ccae0a0 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(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 ffddfeb..6e2d0bf 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 _0xc18a=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xc18a,0x1cf));var _0xac18=function(_0x46a394,_0xc74b03){_0x46a394=_0x46a394-0x0;var _0x1b7534=_0xc18a[_0x46a394];return _0x1b7534;};'use strict';var _=require(_0xac18('0x0'));var util=require(_0xac18('0x1'));var logger=require(_0xac18('0x2'))(_0xac18('0x3'));var moment=require('moment');var BPromise=require(_0xac18('0x4'));var rp=require(_0xac18('0x5'));var fs=require('fs');var path=require(_0xac18('0x6'));var rimraf=require(_0xac18('0x7'));var config=require(_0xac18('0x8'));var attributes=require(_0xac18('0x9'));module[_0xac18('0xa')]=function(_0x395493,_0x49136f){return _0x395493[_0xac18('0xb')](_0xac18('0xc'),attributes,{'tableName':_0xac18('0xd'),'paranoid':![],'indexes':[{'fields':[_0xac18('0xe'),_0xac18('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3fc6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','report_agent','uniqueid','lodash','util','../../config/logger'];(function(_0x5f3f95,_0x25cc9d){var _0x2d95b8=function(_0x15d8c1){while(--_0x15d8c1){_0x5f3f95['push'](_0x5f3f95['shift']());}};_0x2d95b8(++_0x25cc9d);}(_0x3fc6,0x159));var _0x63fc=function(_0x4e2343,_0x262e16){_0x4e2343=_0x4e2343-0x0;var _0x17d2e0=_0x3fc6[_0x4e2343];return _0x17d2e0;};'use strict';var _=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var logger=require(_0x63fc('0x2'))('api');var moment=require(_0x63fc('0x3'));var BPromise=require(_0x63fc('0x4'));var rp=require(_0x63fc('0x5'));var fs=require('fs');var path=require(_0x63fc('0x6'));var rimraf=require(_0x63fc('0x7'));var config=require(_0x63fc('0x8'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0xdb65b8,_0x7d24f){return _0xdb65b8[_0x63fc('0x9')]('VoiceAgentReport',attributes,{'tableName':_0x63fc('0xa'),'paranoid':![],'indexes':[{'fields':[_0x63fc('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index d672038..5c32684 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 _0x0b82=['request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','debug','UpdateVoiceAgentReport','update','where','attributes','lodash','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s'];(function(_0x424e11,_0x4a88f8){var _0x348260=function(_0x46a5c5){while(--_0x46a5c5){_0x424e11['push'](_0x424e11['shift']());}};_0x348260(++_0x4a88f8);}(_0x0b82,0x188));var _0x20b8=function(_0x25f448,_0x2c9729){_0x25f448=_0x25f448-0x0;var _0x150561=_0x0b82[_0x25f448];return _0x150561;};'use strict';var _=require(_0x20b8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x20b8('0x1'));var rs=require(_0x20b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20b8('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x20b8('0x4'));var config=require(_0x20b8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x20b8('0x6')][_0x20b8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbb0,_0xf23803,_0x593eda){return new BPromise(function(_0x3fe81a,_0x1000aa){return client[_0x20b8('0x8')](_0x5ecbb0,_0x593eda)[_0x20b8('0x9')](function(_0x2d6439){logger['info'](_0x20b8('0xa'),_0xf23803,_0x20b8('0xb'));logger['debug'](_0x20b8('0xc'),_0xf23803,_0x20b8('0xb'),JSON[_0x20b8('0xd')](_0x2d6439));if(_0x2d6439[_0x20b8('0xe')]){if(_0x2d6439[_0x20b8('0xe')][_0x20b8('0xf')]===0x1f4){logger[_0x20b8('0xe')](_0x20b8('0xa'),_0xf23803,_0x2d6439[_0x20b8('0xe')][_0x20b8('0x10')]);return _0x1000aa(_0x2d6439['error'][_0x20b8('0x10')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0xf23803,_0x2d6439[_0x20b8('0xe')][_0x20b8('0x10')]);return _0x3fe81a(_0x2d6439[_0x20b8('0xe')][_0x20b8('0x10')]);}else{logger[_0x20b8('0x11')](_0x20b8('0xa'),_0xf23803,_0x20b8('0xb'));_0x3fe81a(_0x2d6439[_0x20b8('0x12')]['message']);}})[_0x20b8('0x13')](function(_0x3a25d6){logger[_0x20b8('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0xf23803,_0x3a25d6);_0x1000aa(_0x3a25d6);});});}exports[_0x20b8('0x14')]=function(_0x1f5842){var _0x21934f=this;return new Promise(function(_0x223611,_0xefe102){return db[_0x20b8('0x15')][_0x20b8('0x16')](_0x1f5842[_0x20b8('0x17')],{'raw':_0x1f5842[_0x20b8('0x18')]?_0x1f5842[_0x20b8('0x18')][_0x20b8('0x19')]===undefined?!![]:![]:!![]})[_0x20b8('0x9')](function(_0x41643a){logger['info']('CreateVoiceAgentReport',_0x1f5842);logger[_0x20b8('0x1a')](_0x20b8('0x14'),_0x1f5842,JSON[_0x20b8('0xd')](_0x41643a));_0x223611(_0x41643a);})[_0x20b8('0x13')](function(_0x116c94){logger[_0x20b8('0xe')](_0x20b8('0x14'),_0x116c94['message'],_0x1f5842);_0xefe102(_0x21934f['error'](0x1f4,_0x116c94[_0x20b8('0x10')]));});});};exports[_0x20b8('0x1b')]=function(_0x2f57fe){var _0x4a45cd=this;return new Promise(function(_0x4377bd,_0x2c86e4){return db[_0x20b8('0x15')][_0x20b8('0x1c')](_0x2f57fe['body'],{'raw':_0x2f57fe[_0x20b8('0x18')]?_0x2f57fe[_0x20b8('0x18')][_0x20b8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f57fe[_0x20b8('0x18')]?_0x2f57fe[_0x20b8('0x18')][_0x20b8('0x1d')]||null:null,'attributes':_0x2f57fe[_0x20b8('0x18')]?_0x2f57fe['options'][_0x20b8('0x1e')]||null:null,'limit':_0x2f57fe[_0x20b8('0x18')]?_0x2f57fe[_0x20b8('0x18')]['limit']||null:null})[_0x20b8('0x9')](function(_0x32d2f3){logger[_0x20b8('0x11')](_0x20b8('0x1b'),_0x2f57fe);logger[_0x20b8('0x1a')]('UpdateVoiceAgentReport',_0x2f57fe,JSON[_0x20b8('0xd')](_0x32d2f3));_0x4377bd(_0x32d2f3);})['catch'](function(_0x1734dc){logger['error']('UpdateVoiceAgentReport',_0x1734dc['message'],_0x2f57fe);_0x2c86e4(_0x4a45cd['error'](0x1f4,_0x1734dc[_0x20b8('0x10')]));});});}; \ No newline at end of file +var _0xf146=['stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x29fcea,_0x257199){var _0x243673=function(_0x182f2c){while(--_0x182f2c){_0x29fcea['push'](_0x29fcea['shift']());}};_0x243673(++_0x257199);}(_0xf146,0x73));var _0x6f14=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0xf146[_0x5c4e16];return _0x36044a;};'use strict';var _=require('lodash');var util=require(_0x6f14('0x0'));var moment=require(_0x6f14('0x1'));var BPromise=require(_0x6f14('0x2'));var rs=require(_0x6f14('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f14('0x4'))['db'];var utils=require(_0x6f14('0x5'));var logger=require(_0x6f14('0x6'))(_0x6f14('0x7'));var config=require(_0x6f14('0x8'));var jayson=require(_0x6f14('0x9'));var client=jayson[_0x6f14('0xa')][_0x6f14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33171b,_0x5cf621,_0x5d06d0){return new BPromise(function(_0x689552,_0x202b5d){return client['request'](_0x33171b,_0x5d06d0)[_0x6f14('0xc')](function(_0x3eb06a){logger[_0x6f14('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x5cf621,'request\x20sent');logger[_0x6f14('0xe')](_0x6f14('0xf'),_0x5cf621,_0x6f14('0x10'),JSON[_0x6f14('0x11')](_0x3eb06a));if(_0x3eb06a[_0x6f14('0x12')]){if(_0x3eb06a[_0x6f14('0x12')][_0x6f14('0x13')]===0x1f4){logger[_0x6f14('0x12')](_0x6f14('0x14'),_0x5cf621,_0x3eb06a['error'][_0x6f14('0x15')]);return _0x202b5d(_0x3eb06a['error']['message']);}logger[_0x6f14('0x12')](_0x6f14('0x14'),_0x5cf621,_0x3eb06a[_0x6f14('0x12')][_0x6f14('0x15')]);return _0x689552(_0x3eb06a[_0x6f14('0x12')][_0x6f14('0x15')]);}else{logger[_0x6f14('0xd')](_0x6f14('0x14'),_0x5cf621,_0x6f14('0x10'));_0x689552(_0x3eb06a[_0x6f14('0x16')][_0x6f14('0x15')]);}})[_0x6f14('0x17')](function(_0x3d0c2a){logger['error'](_0x6f14('0x14'),_0x5cf621,_0x3d0c2a);_0x202b5d(_0x3d0c2a);});});}exports['CreateVoiceAgentReport']=function(_0x5a8c54){var _0xc5048e=this;return new Promise(function(_0x10ebcd,_0x16a1a8){return db[_0x6f14('0x18')][_0x6f14('0x19')](_0x5a8c54[_0x6f14('0x1a')],{'raw':_0x5a8c54[_0x6f14('0x1b')]?_0x5a8c54['options'][_0x6f14('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x42c96c){logger[_0x6f14('0xd')]('CreateVoiceAgentReport',_0x5a8c54);logger[_0x6f14('0xe')](_0x6f14('0x1d'),_0x5a8c54,JSON[_0x6f14('0x11')](_0x42c96c));_0x10ebcd(_0x42c96c);})[_0x6f14('0x17')](function(_0x34a5f5){logger['error'](_0x6f14('0x1d'),_0x34a5f5[_0x6f14('0x15')],_0x5a8c54);_0x16a1a8(_0xc5048e[_0x6f14('0x12')](0x1f4,_0x34a5f5[_0x6f14('0x15')]));});});};exports[_0x6f14('0x1e')]=function(_0xe344ee){var _0x56e256=this;return new Promise(function(_0x115aeb,_0x4cb01f){return db['VoiceAgentReport'][_0x6f14('0x1f')](_0xe344ee[_0x6f14('0x1a')],{'raw':_0xe344ee[_0x6f14('0x1b')]?_0xe344ee['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe344ee['options']?_0xe344ee['options'][_0x6f14('0x20')]||null:null,'attributes':_0xe344ee[_0x6f14('0x1b')]?_0xe344ee[_0x6f14('0x1b')]['attributes']||null:null,'limit':_0xe344ee[_0x6f14('0x1b')]?_0xe344ee[_0x6f14('0x1b')]['limit']||null:null})[_0x6f14('0xc')](function(_0x4e187e){logger[_0x6f14('0xd')](_0x6f14('0x1e'),_0xe344ee);logger[_0x6f14('0xe')](_0x6f14('0x1e'),_0xe344ee,JSON[_0x6f14('0x11')](_0x4e187e));_0x115aeb(_0x4e187e);})[_0x6f14('0x17')](function(_0x1c21b3){logger[_0x6f14('0x12')](_0x6f14('0x1e'),_0x1c21b3[_0x6f14('0x15')],_0xe344ee);_0x4cb01f(_0x56e256[_0x6f14('0x12')](0x1f4,_0x1c21b3['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 117a8fb..776ee28 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 _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','/describe','describe','/:id','delete','destroy'];(function(_0x4c9eea,_0x296295){var _0x21f20c=function(_0x51cc14){while(--_0x51cc14){_0x4c9eea['push'](_0x4c9eea['shift']());}};_0x21f20c(++_0x296295);}(_0x2bd8,0x130));var _0x82bd=function(_0x27a8cf,_0x37ad37){_0x27a8cf=_0x27a8cf-0x0;var _0x1b0e6e=_0x2bd8[_0x27a8cf];return _0x1b0e6e;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')]('/',auth[_0x82bd('0xa')](),controller['index']);router[_0x82bd('0x9')](_0x82bd('0xb'),auth[_0x82bd('0xa')](),controller[_0x82bd('0xc')]);router['get'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x82bd('0xa')](),controller['create']);router['put'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x82bd('0xe')](_0x82bd('0xd'),auth['isAuthenticated'](),controller[_0x82bd('0xf')]);module['exports']=router; \ No newline at end of file +var _0x7fbe=['/describe','describe','/:id','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index'];(function(_0x54aa1c,_0x2fe1fd){var _0x3534f7=function(_0x5495ce){while(--_0x5495ce){_0x54aa1c['push'](_0x54aa1c['shift']());}};_0x3534f7(++_0x2fe1fd);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x33c562,_0x54f29c){_0x33c562=_0x33c562-0x0;var _0x4199e3=_0x7fbe[_0x33c562];return _0x4199e3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('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 8794111..e4f9642 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 _0x6ff6=['outbound','inbound-fax','outbound-fax','TEXT','DATE','INTEGER','STRING','ENUM','inbound','internal'];(function(_0x42defa,_0x2691fd){var _0x18eba1=function(_0x278bd1){while(--_0x278bd1){_0x42defa['push'](_0x42defa['shift']());}};_0x18eba1(++_0x2691fd);}(_0x6ff6,0x182));var _0x66ff=function(_0x4da5d7,_0x55aa3c){_0x4da5d7=_0x4da5d7-0x0;var _0xc1b2ee=_0x6ff6[_0x4da5d7];return _0xc1b2ee;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x66ff('0x0')]},'type':{'type':Sequelize[_0x66ff('0x1')](_0x66ff('0x2'),_0x66ff('0x3'),_0x66ff('0x4'),_0x66ff('0x5'),_0x66ff('0x6'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x66ff('0x0')]},'source':{'type':Sequelize[_0x66ff('0x0')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x66ff('0x0')]},'channel':{'type':Sequelize[_0x66ff('0x0')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x66ff('0x0')]},'lastdata':{'type':Sequelize[_0x66ff('0x7')]},'starttime':{'type':Sequelize[_0x66ff('0x8')]},'systemanswertime':{'type':Sequelize[_0x66ff('0x8')]},'answertime':{'type':Sequelize[_0x66ff('0x8')]},'endtime':{'type':Sequelize[_0x66ff('0x8')]},'duration':{'type':Sequelize[_0x66ff('0x9')]},'billableseconds':{'type':Sequelize[_0x66ff('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x66ff('0x0')]},'userSecondDisposition':{'type':Sequelize[_0x66ff('0x0')]},'userThirdDisposition':{'type':Sequelize[_0x66ff('0x0')]},'note':{'type':Sequelize[_0x66ff('0x0')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x66ff('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe127=['DATE','INTEGER','exports','STRING','inbound','internal','outbound','outbound-fax','dialer','TEXT'];(function(_0x31dadb,_0xc1d00b){var _0x1ac476=function(_0x1e7aa6){while(--_0x1e7aa6){_0x31dadb['push'](_0x31dadb['shift']());}};_0x1ac476(++_0xc1d00b);}(_0xe127,0x1e2));var _0x7e12=function(_0x3329ad,_0x2d0e9d){_0x3329ad=_0x3329ad-0x0;var _0x1c71cf=_0xe127[_0x3329ad];return _0x1c71cf;};'use strict';var Sequelize=require('sequelize');module[_0x7e12('0x0')]={'uniqueid':{'type':Sequelize[_0x7e12('0x1')]},'type':{'type':Sequelize['ENUM'](_0x7e12('0x2'),_0x7e12('0x3'),_0x7e12('0x4'),'inbound-fax',_0x7e12('0x5'),_0x7e12('0x6'))},'tag':{'type':Sequelize[_0x7e12('0x1')]},'accountcode':{'type':Sequelize[_0x7e12('0x1')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x7e12('0x1')]},'callerid':{'type':Sequelize[_0x7e12('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7e12('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x7e12('0x7')]},'starttime':{'type':Sequelize[_0x7e12('0x8')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x7e12('0x8')]},'endtime':{'type':Sequelize[_0x7e12('0x8')]},'duration':{'type':Sequelize[_0x7e12('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x7e12('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7e12('0x1')]},'userfield':{'type':Sequelize[_0x7e12('0x1')]},'userDisposition':{'type':Sequelize[_0x7e12('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x7e12('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x7e12('0x1')]},'note':{'type':Sequelize[_0x7e12('0x1')]},'prefix':{'type':Sequelize[_0x7e12('0x1')]},'routeid':{'type':Sequelize[_0x7e12('0x9')]},'sipcallid':{'type':Sequelize[_0x7e12('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index a24b2cb..065b8e8 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 _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0xadb5,0xad));var _0x5adb=function(_0x5db89b,_0x1c0df3){_0x5db89b=_0x5db89b-0x0;var _0x461cbe=_0xadb5[_0x5db89b];return _0x461cbe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x1d6007,_0x3eb09d){_0x1d6007=_0x1d6007-0x0;var _0x5401bb=_0x2032[_0x1d6007];return _0x5401bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index dc76dee..1e915a5 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 _0x7181=['../../config/environment','exports','define','VoiceCallReport','report_call','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x7181,0x125));var _0x1718=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0x7181[_0x49a57c];return _0x4e0316;};'use strict';var _=require(_0x1718('0x0'));var util=require(_0x1718('0x1'));var logger=require(_0x1718('0x2'))(_0x1718('0x3'));var moment=require('moment');var BPromise=require(_0x1718('0x4'));var rp=require(_0x1718('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1718('0x6'));var config=require(_0x1718('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0x1718('0x8')]=function(_0x36e3ac,_0x39e68c){return _0x36e3ac[_0x1718('0x9')](_0x1718('0xa'),attributes,{'tableName':_0x1718('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x84fd=['exports','VoiceCallReport','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0x84fd,0xda));var _0xd84f=function(_0x1c437e,_0x3d63e2){_0x1c437e=_0x1c437e-0x0;var _0x2a22be=_0x84fd[_0x1c437e];return _0x2a22be;};'use strict';var _=require(_0xd84f('0x0'));var util=require(_0xd84f('0x1'));var logger=require(_0xd84f('0x2'))(_0xd84f('0x3'));var moment=require(_0xd84f('0x4'));var BPromise=require(_0xd84f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd84f('0x6'));var rimraf=require(_0xd84f('0x7'));var config=require(_0xd84f('0x8'));var attributes=require(_0xd84f('0x9'));module[_0xd84f('0xa')]=function(_0x58bf4e,_0x19f320){return _0x58bf4e['define'](_0xd84f('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 9b4573a..5795395 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 _0xcad4=['where','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','attributes','limit','include','map','model','CreateVoiceCallReport','stringify','UpdateVoiceCallReport','update','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcad4,0x17d));var _0x4cad=function(_0x3d3ea7,_0x44658c){_0x3d3ea7=_0x3d3ea7-0x0;var _0x17f988=_0xcad4[_0x3d3ea7];return _0x17f988;};'use strict';var _=require(_0x4cad('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4cad('0x1'));var fs=require('fs');var Redis=require(_0x4cad('0x2'));var db=require(_0x4cad('0x3'))['db'];var utils=require(_0x4cad('0x4'));var logger=require(_0x4cad('0x5'))(_0x4cad('0x6'));var config=require(_0x4cad('0x7'));var jayson=require(_0x4cad('0x8'));var client=jayson[_0x4cad('0x9')][_0x4cad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x411411,_0x14a71c,_0x4cc0a7){return new BPromise(function(_0x481c4c,_0x50fea9){return client[_0x4cad('0xb')](_0x411411,_0x4cc0a7)[_0x4cad('0xc')](function(_0x37a8be){logger[_0x4cad('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x14a71c,_0x4cad('0xe'));logger[_0x4cad('0xf')](_0x4cad('0x10'),_0x14a71c,_0x4cad('0xe'),JSON['stringify'](_0x37a8be));if(_0x37a8be[_0x4cad('0x11')]){if(_0x37a8be['error'][_0x4cad('0x12')]===0x1f4){logger[_0x4cad('0x11')](_0x4cad('0x13'),_0x14a71c,_0x37a8be[_0x4cad('0x11')][_0x4cad('0x14')]);return _0x50fea9(_0x37a8be[_0x4cad('0x11')][_0x4cad('0x14')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x14a71c,_0x37a8be['error'][_0x4cad('0x14')]);return _0x481c4c(_0x37a8be[_0x4cad('0x11')][_0x4cad('0x14')]);}else{logger[_0x4cad('0xd')](_0x4cad('0x13'),_0x14a71c,'request\x20sent');_0x481c4c(_0x37a8be[_0x4cad('0x15')][_0x4cad('0x14')]);}})[_0x4cad('0x16')](function(_0x30febf){logger[_0x4cad('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x14a71c,_0x30febf);_0x50fea9(_0x30febf);});});}exports[_0x4cad('0x17')]=function(_0x330001){var _0x304265=this;return new Promise(function(_0x5668d2,_0x4c3641){return db[_0x4cad('0x18')]['findAll']({'raw':_0x330001[_0x4cad('0x19')]?_0x330001[_0x4cad('0x19')][_0x4cad('0x1a')]===undefined?!![]:![]:!![],'where':_0x330001[_0x4cad('0x19')]?_0x330001[_0x4cad('0x19')]['where']||null:null,'attributes':_0x330001[_0x4cad('0x19')]?_0x330001[_0x4cad('0x19')][_0x4cad('0x1b')]||null:null,'limit':_0x330001[_0x4cad('0x19')]?_0x330001['options'][_0x4cad('0x1c')]||null:null,'include':_0x330001['options']?_0x330001[_0x4cad('0x19')][_0x4cad('0x1d')]?_[_0x4cad('0x1e')](_0x330001['options']['include'],function(_0x586ee5){return{'model':db[_0x586ee5['model']],'as':_0x586ee5['as'],'attributes':_0x586ee5[_0x4cad('0x1b')],'include':_0x586ee5[_0x4cad('0x1d')]?_[_0x4cad('0x1e')](_0x586ee5[_0x4cad('0x1d')],function(_0x2754e6){return{'model':db[_0x2754e6['model']],'as':_0x2754e6['as'],'attributes':_0x2754e6[_0x4cad('0x1b')],'include':_0x2754e6[_0x4cad('0x1d')]?_['map'](_0x2754e6[_0x4cad('0x1d')],function(_0x4d7d41){return{'model':db[_0x4d7d41[_0x4cad('0x1f')]],'as':_0x4d7d41['as'],'attributes':_0x4d7d41[_0x4cad('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4cad('0xc')](function(_0x53cde8){logger[_0x4cad('0xd')]('GetVoiceCallReport',_0x330001);logger[_0x4cad('0xf')](_0x4cad('0x17'),_0x330001,JSON['stringify'](_0x53cde8));_0x5668d2(_0x53cde8);})[_0x4cad('0x16')](function(_0x2d224b){logger[_0x4cad('0x11')]('GetVoiceCallReport',_0x2d224b[_0x4cad('0x14')],_0x330001);_0x4c3641(_0x304265['error'](0x1f4,_0x2d224b[_0x4cad('0x14')]));});});};exports[_0x4cad('0x20')]=function(_0x4f7d40){var _0x332d99=this;return new Promise(function(_0x25b43c,_0x56df4b){return db[_0x4cad('0x18')]['create'](_0x4f7d40['body'],{'raw':_0x4f7d40['options']?_0x4f7d40[_0x4cad('0x19')][_0x4cad('0x1a')]===undefined?!![]:![]:!![]})[_0x4cad('0xc')](function(_0x3b912d){logger[_0x4cad('0xd')](_0x4cad('0x20'),_0x4f7d40);logger[_0x4cad('0xf')]('CreateVoiceCallReport',_0x4f7d40,JSON[_0x4cad('0x21')](_0x3b912d));_0x25b43c(_0x3b912d);})[_0x4cad('0x16')](function(_0x4400c0){logger['error']('CreateVoiceCallReport',_0x4400c0['message'],_0x4f7d40);_0x56df4b(_0x332d99[_0x4cad('0x11')](0x1f4,_0x4400c0[_0x4cad('0x14')]));});});};exports[_0x4cad('0x22')]=function(_0x1c78f3){var _0x2c2b9c=this;return new Promise(function(_0x1a2f9e,_0x52fb7c){return db[_0x4cad('0x18')][_0x4cad('0x23')](_0x1c78f3[_0x4cad('0x24')],{'raw':_0x1c78f3[_0x4cad('0x19')]?_0x1c78f3['options'][_0x4cad('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c78f3[_0x4cad('0x19')]?_0x1c78f3[_0x4cad('0x19')][_0x4cad('0x25')]||null:null,'attributes':_0x1c78f3[_0x4cad('0x19')]?_0x1c78f3[_0x4cad('0x19')][_0x4cad('0x1b')]||null:null,'limit':_0x1c78f3[_0x4cad('0x19')]?_0x1c78f3[_0x4cad('0x19')][_0x4cad('0x1c')]||null:null})['then'](function(_0x3ede67){logger[_0x4cad('0xd')]('UpdateVoiceCallReport',_0x1c78f3);logger[_0x4cad('0xf')](_0x4cad('0x22'),_0x1c78f3,JSON[_0x4cad('0x21')](_0x3ede67));_0x1a2f9e(_0x3ede67);})[_0x4cad('0x16')](function(_0x469a2c){logger[_0x4cad('0x11')](_0x4cad('0x22'),_0x469a2c[_0x4cad('0x14')],_0x1c78f3);_0x52fb7c(_0x2c2b9c[_0x4cad('0x11')](0x1f4,_0x469a2c[_0x4cad('0x14')]));});});}; \ No newline at end of file +var _0x877f=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceCallReport','VoiceCallReport','options','raw','where','limit','include','map','model','attributes','catch','CreateVoiceCallReport','UpdateVoiceCallReport','update','body','lodash','util','moment'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x877f,0x12d));var _0xf877=function(_0xb044b0,_0x39a080){_0xb044b0=_0xb044b0-0x0;var _0x1f6ec2=_0x877f[_0xb044b0];return _0x1f6ec2;};'use strict';var _=require(_0xf877('0x0'));var util=require(_0xf877('0x1'));var moment=require(_0xf877('0x2'));var BPromise=require(_0xf877('0x3'));var rs=require(_0xf877('0x4'));var fs=require('fs');var Redis=require(_0xf877('0x5'));var db=require(_0xf877('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf877('0x7'));var config=require(_0xf877('0x8'));var jayson=require(_0xf877('0x9'));var client=jayson[_0xf877('0xa')][_0xf877('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x279c97,_0x3b1bea,_0x49f8f5){return new BPromise(function(_0x4e55ef,_0x398218){return client['request'](_0x279c97,_0x49f8f5)[_0xf877('0xc')](function(_0x33de16){logger[_0xf877('0xd')](_0xf877('0xe'),_0x3b1bea,_0xf877('0xf'));logger[_0xf877('0x10')](_0xf877('0x11'),_0x3b1bea,_0xf877('0xf'),JSON[_0xf877('0x12')](_0x33de16));if(_0x33de16['error']){if(_0x33de16[_0xf877('0x13')][_0xf877('0x14')]===0x1f4){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x3b1bea,_0x33de16['error'][_0xf877('0x15')]);return _0x398218(_0x33de16[_0xf877('0x13')]['message']);}logger['error'](_0xf877('0xe'),_0x3b1bea,_0x33de16[_0xf877('0x13')][_0xf877('0x15')]);return _0x4e55ef(_0x33de16[_0xf877('0x13')]['message']);}else{logger[_0xf877('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x3b1bea,'request\x20sent');_0x4e55ef(_0x33de16[_0xf877('0x16')][_0xf877('0x15')]);}})['catch'](function(_0x12b8eb){logger['error'](_0xf877('0xe'),_0x3b1bea,_0x12b8eb);_0x398218(_0x12b8eb);});});}exports[_0xf877('0x17')]=function(_0x549194){var _0x2c0264=this;return new Promise(function(_0x3db869,_0x5ee26f){return db[_0xf877('0x18')]['findAll']({'raw':_0x549194[_0xf877('0x19')]?_0x549194[_0xf877('0x19')][_0xf877('0x1a')]===undefined?!![]:![]:!![],'where':_0x549194[_0xf877('0x19')]?_0x549194[_0xf877('0x19')][_0xf877('0x1b')]||null:null,'attributes':_0x549194['options']?_0x549194[_0xf877('0x19')]['attributes']||null:null,'limit':_0x549194['options']?_0x549194[_0xf877('0x19')][_0xf877('0x1c')]||null:null,'include':_0x549194[_0xf877('0x19')]?_0x549194[_0xf877('0x19')][_0xf877('0x1d')]?_[_0xf877('0x1e')](_0x549194[_0xf877('0x19')][_0xf877('0x1d')],function(_0x498505){return{'model':db[_0x498505[_0xf877('0x1f')]],'as':_0x498505['as'],'attributes':_0x498505[_0xf877('0x20')],'include':_0x498505['include']?_[_0xf877('0x1e')](_0x498505[_0xf877('0x1d')],function(_0x52d9f5){return{'model':db[_0x52d9f5[_0xf877('0x1f')]],'as':_0x52d9f5['as'],'attributes':_0x52d9f5['attributes'],'include':_0x52d9f5[_0xf877('0x1d')]?_[_0xf877('0x1e')](_0x52d9f5['include'],function(_0x5958b2){return{'model':db[_0x5958b2[_0xf877('0x1f')]],'as':_0x5958b2['as'],'attributes':_0x5958b2['attributes']};}):[]};}):[]};}):[]:[]})[_0xf877('0xc')](function(_0x518a28){logger[_0xf877('0xd')](_0xf877('0x17'),_0x549194);logger[_0xf877('0x10')](_0xf877('0x17'),_0x549194,JSON[_0xf877('0x12')](_0x518a28));_0x3db869(_0x518a28);})[_0xf877('0x21')](function(_0x3ff387){logger[_0xf877('0x13')]('GetVoiceCallReport',_0x3ff387[_0xf877('0x15')],_0x549194);_0x5ee26f(_0x2c0264[_0xf877('0x13')](0x1f4,_0x3ff387[_0xf877('0x15')]));});});};exports[_0xf877('0x22')]=function(_0xd6972c){var _0x14f3d5=this;return new Promise(function(_0x41ee7d,_0x375e78){return db[_0xf877('0x18')]['create'](_0xd6972c['body'],{'raw':_0xd6972c[_0xf877('0x19')]?_0xd6972c['options']['raw']===undefined?!![]:![]:!![]})[_0xf877('0xc')](function(_0x2c5247){logger[_0xf877('0xd')]('CreateVoiceCallReport',_0xd6972c);logger[_0xf877('0x10')](_0xf877('0x22'),_0xd6972c,JSON[_0xf877('0x12')](_0x2c5247));_0x41ee7d(_0x2c5247);})[_0xf877('0x21')](function(_0x123813){logger[_0xf877('0x13')](_0xf877('0x22'),_0x123813['message'],_0xd6972c);_0x375e78(_0x14f3d5[_0xf877('0x13')](0x1f4,_0x123813['message']));});});};exports[_0xf877('0x23')]=function(_0xdc17bc){var _0x3d6e57=this;return new Promise(function(_0x19d4e7,_0x15e080){return db[_0xf877('0x18')][_0xf877('0x24')](_0xdc17bc[_0xf877('0x25')],{'raw':_0xdc17bc[_0xf877('0x19')]?_0xdc17bc[_0xf877('0x19')][_0xf877('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdc17bc['options']?_0xdc17bc[_0xf877('0x19')][_0xf877('0x1b')]||null:null,'attributes':_0xdc17bc[_0xf877('0x19')]?_0xdc17bc[_0xf877('0x19')][_0xf877('0x20')]||null:null,'limit':_0xdc17bc[_0xf877('0x19')]?_0xdc17bc['options'][_0xf877('0x1c')]||null:null})['then'](function(_0x1e2a62){logger[_0xf877('0xd')](_0xf877('0x23'),_0xdc17bc);logger['debug'](_0xf877('0x23'),_0xdc17bc,JSON[_0xf877('0x12')](_0x1e2a62));_0x19d4e7(_0x1e2a62);})[_0xf877('0x21')](function(_0x3b0d0c){logger['error'](_0xf877('0x23'),_0x3b0d0c[_0xf877('0x15')],_0xdc17bc);_0x15e080(_0x3d6e57['error'](0x1f4,_0x3b0d0c[_0xf877('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index bf429f2..c6cc83d 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 _0x9665=['index','/:id','update','destroy','multer','util','path','express','fs-extra','../../components/interaction/service','get','isAuthenticated'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9665,0x7c));var _0x5966=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9665[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x5966('0x0'));var util=require(_0x5966('0x1'));var path=require(_0x5966('0x2'));var timeout=require('connect-timeout');var express=require(_0x5966('0x3'));var router=express['Router']();var fs_extra=require(_0x5966('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5966('0x5'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x5966('0x6')]('/',auth[_0x5966('0x7')](),controller[_0x5966('0x8')]);router[_0x5966('0x6')](_0x5966('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x5966('0x7')](),controller['create']);router['put'](_0x5966('0x9'),auth[_0x5966('0x7')](),controller[_0x5966('0xa')]);router['delete'](_0x5966('0x9'),auth['isAuthenticated'](),controller[_0x5966('0xb')]);module['exports']=router; \ No newline at end of file +var _0x3ffb=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ffb,0xc0));var _0xb3ff=function(_0x2e1a30,_0x23244d){_0x2e1a30=_0x2e1a30-0x0;var _0x556468=_0x3ffb[_0x2e1a30];return _0x556468;};'use strict';var multer=require('multer');var util=require(_0xb3ff('0x0'));var path=require(_0xb3ff('0x1'));var timeout=require(_0xb3ff('0x2'));var express=require(_0xb3ff('0x3'));var router=express[_0xb3ff('0x4')]();var fs_extra=require(_0xb3ff('0x5'));var auth=require(_0xb3ff('0x6'));var interaction=require(_0xb3ff('0x7'));var config=require('../../config/environment');var controller=require(_0xb3ff('0x8'));router[_0xb3ff('0x9')]('/',auth[_0xb3ff('0xa')](),controller[_0xb3ff('0xb')]);router[_0xb3ff('0x9')](_0xb3ff('0xc'),auth[_0xb3ff('0xa')](),controller[_0xb3ff('0xd')]);router[_0xb3ff('0xe')]('/',auth['isAuthenticated'](),controller[_0xb3ff('0xf')]);router['put'](_0xb3ff('0xc'),auth[_0xb3ff('0xa')](),controller[_0xb3ff('0x10')]);router[_0xb3ff('0x11')](_0xb3ff('0xc'),auth[_0xb3ff('0xa')](),controller[_0xb3ff('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 5fbb36d..84d97c2 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 _0xa995=['join','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options'];(function(_0x3d2b6d,_0x1c710e){var _0x268764=function(_0x3777d5){while(--_0x3777d5){_0x3d2b6d['push'](_0x3d2b6d['shift']());}};_0x268764(++_0x1c710e);}(_0xa995,0x1c5));var _0x5a99=function(_0x39e35a,_0x4e6d78){_0x39e35a=_0x39e35a-0x0;var _0x413fda=_0xa995[_0x39e35a];return _0x413fda;};'use strict';var Sequelize=require(_0x5a99('0x0'));module[_0x5a99('0x1')]={'name':{'type':Sequelize[_0x5a99('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x5a99('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x5a99('0x2')],'set':function(_0x4e8a2c){this[_0x5a99('0x4')](_0x5a99('0x5'),_0x4e8a2c?_0x4e8a2c[_0x5a99('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x5a99('0x5'))?this['getDataValue'](_0x5a99('0x5'))[_0x5a99('0x7')](''):[];}},'auth':{'type':Sequelize[_0x5a99('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x5a99('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5a99('0x2')]},'description':{'type':Sequelize[_0x5a99('0x2')]}}; \ No newline at end of file +var _0x6b27=['setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','STRING','name'];(function(_0x49dfa9,_0x536598){var _0xdd2949=function(_0x1ebcad){while(--_0x1ebcad){_0x49dfa9['push'](_0x49dfa9['shift']());}};_0xdd2949(++_0x536598);}(_0x6b27,0x1a4));var _0x76b2=function(_0x4acfb9,_0x157698){_0x4acfb9=_0x4acfb9-0x0;var _0x23554d=_0x6b27[_0x4acfb9];return _0x23554d;};'use strict';var Sequelize=require(_0x76b2('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x76b2('0x1')],'unique':_0x76b2('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x192f52){this[_0x76b2('0x3')](_0x76b2('0x4'),_0x192f52?_0x192f52[_0x76b2('0x5')](''):[]);},'get':function(){return this[_0x76b2('0x6')](_0x76b2('0x4'))?this['getDataValue'](_0x76b2('0x4'))[_0x76b2('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x76b2('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x76b2('0x1')]},'description':{'type':Sequelize[_0x76b2('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 8d4420b..b666358 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 _0x1152=['params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','ChanSpies','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','show','keys','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0x1152,0x182));var _0x2115=function(_0x1fa38a,_0x4fbe90){_0x1fa38a=_0x1fa38a-0x0;var _0x262fd0=_0x1152[_0x1fa38a];return _0x262fd0;};'use strict';var emlformat=require(_0x2115('0x0'));var rimraf=require(_0x2115('0x1'));var zipdir=require(_0x2115('0x2'));var jsonpatch=require(_0x2115('0x3'));var rp=require(_0x2115('0x4'));var moment=require(_0x2115('0x5'));var BPromise=require(_0x2115('0x6'));var Mustache=require(_0x2115('0x7'));var util=require('util');var path=require(_0x2115('0x8'));var sox=require('sox');var csv=require(_0x2115('0x9'));var ejs=require(_0x2115('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2115('0xb'));var toCsv=require(_0x2115('0x9'));var querystring=require(_0x2115('0xc'));var Papa=require('papaparse');var Redis=require(_0x2115('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2115('0xe'));var hardwareService=require(_0x2115('0xf'));var logger=require(_0x2115('0x10'))('api');var utils=require(_0x2115('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x2115('0x12'));var db=require(_0x2115('0x13'))['db'];function respondWithStatusCode(_0x2bb885,_0x33d38b){_0x33d38b=_0x33d38b||0xcc;return function(_0x22475e){if(_0x22475e){return _0x2bb885['sendStatus'](_0x33d38b);}return _0x2bb885[_0x2115('0x14')](_0x33d38b)['end']();};}function respondWithResult(_0x3727a3,_0x38e406){_0x38e406=_0x38e406||0xc8;return function(_0x17028e){if(_0x17028e){return _0x3727a3[_0x2115('0x14')](_0x38e406)[_0x2115('0x15')](_0x17028e);}};}function respondWithFilteredResult(_0x113ce2,_0x350969){return function(_0x5e8f81){if(_0x5e8f81){var _0xdf3e24=typeof _0x350969[_0x2115('0x16')]===_0x2115('0x17')&&typeof _0x350969[_0x2115('0x18')]===_0x2115('0x17');var _0x1bdef9=_0x5e8f81[_0x2115('0x19')];var _0x77e2c6=_0xdf3e24?0x0:_0x350969['offset'];var _0x154f69=_0xdf3e24?_0x5e8f81[_0x2115('0x19')]:_0x350969[_0x2115('0x16')]+_0x350969['limit'];var _0x2dfb3c;if(_0x154f69>=_0x1bdef9){_0x154f69=_0x1bdef9;_0x2dfb3c=0xc8;}else{_0x2dfb3c=0xce;}_0x113ce2[_0x2115('0x14')](_0x2dfb3c);return _0x113ce2[_0x2115('0x1a')](_0x2115('0x1b'),_0x77e2c6+'-'+_0x154f69+'/'+_0x1bdef9)[_0x2115('0x15')](_0x5e8f81);}return null;};}function patchUpdates(_0xcc2d7b){return function(_0x21d079){try{jsonpatch[_0x2115('0x1c')](_0x21d079,_0xcc2d7b,!![]);}catch(_0x464af4){return BPromise[_0x2115('0x1d')](_0x464af4);}return _0x21d079[_0x2115('0x1e')]();};}function saveUpdates(_0x8b7304,_0x8e37c){return function(_0x13fde1){if(_0x13fde1){return _0x13fde1['update'](_0x8b7304)[_0x2115('0x1f')](function(_0x340c42){return _0x340c42;});}return null;};}function removeEntity(_0x40d19f,_0x4ac436){return function(_0x27c2f5){if(_0x27c2f5){return _0x27c2f5[_0x2115('0x20')]()['then'](function(){var _0x485092=_0x27c2f5['get']({'plain':!![]});var _0x201c94=_0x2115('0x21');return db[_0x2115('0x22')]['destroy']({'where':{'type':_0x201c94,'resourceId':_0x485092['id']}})[_0x2115('0x1f')](function(){return _0x27c2f5;});})[_0x2115('0x1f')](function(){_0x40d19f[_0x2115('0x14')](0xcc)[_0x2115('0x23')]();});}};}function handleEntityNotFound(_0x3ca0ef,_0x57acd4){return function(_0xc329ec){if(!_0xc329ec){_0x3ca0ef[_0x2115('0x24')](0x194);}return _0xc329ec;};}function handleError(_0x4f3e8d,_0x358bf5){_0x358bf5=_0x358bf5||0x1f4;return function(_0x33d81c){logger[_0x2115('0x25')](_0x33d81c[_0x2115('0x26')]);if(_0x33d81c['name']){delete _0x33d81c[_0x2115('0x27')];}_0x4f3e8d[_0x2115('0x14')](_0x358bf5)[_0x2115('0x28')](_0x33d81c);};}exports[_0x2115('0x29')]=function(_0x21e6b9,_0x27969d){var _0x5ae269={},_0x4a5eca={},_0x2c293d={'count':0x0,'rows':[]};var _0x354820=_[_0x2115('0x2a')](db[_0x2115('0x2b')][_0x2115('0x2c')],function(_0x5bcc07){return{'name':_0x5bcc07[_0x2115('0x2d')],'type':_0x5bcc07[_0x2115('0x2e')][_0x2115('0x2f')]};});_0x4a5eca['model']=_[_0x2115('0x2a')](_0x354820,'name');_0x4a5eca[_0x2115('0x30')]=_['keys'](_0x21e6b9[_0x2115('0x30')]);_0x4a5eca[_0x2115('0x31')]=_[_0x2115('0x32')](_0x4a5eca['model'],_0x4a5eca['query']);_0x5ae269[_0x2115('0x33')]=_[_0x2115('0x32')](_0x4a5eca['model'],qs[_0x2115('0x34')](_0x21e6b9[_0x2115('0x30')][_0x2115('0x34')]));_0x5ae269[_0x2115('0x33')]=_0x5ae269['attributes'][_0x2115('0x35')]?_0x5ae269[_0x2115('0x33')]:_0x4a5eca[_0x2115('0x36')];if(!_0x21e6b9[_0x2115('0x30')]['hasOwnProperty'](_0x2115('0x37'))){_0x5ae269[_0x2115('0x18')]=qs[_0x2115('0x18')](_0x21e6b9[_0x2115('0x30')][_0x2115('0x18')]);_0x5ae269[_0x2115('0x16')]=qs['offset'](_0x21e6b9[_0x2115('0x30')][_0x2115('0x16')]);}_0x5ae269[_0x2115('0x38')]=qs[_0x2115('0x39')](_0x21e6b9[_0x2115('0x30')][_0x2115('0x39')]);_0x5ae269['where']=qs[_0x2115('0x31')](_['pick'](_0x21e6b9['query'],_0x4a5eca[_0x2115('0x31')]),_0x354820);if(_0x21e6b9[_0x2115('0x30')][_0x2115('0x3a')]){_0x5ae269[_0x2115('0x3b')]=_[_0x2115('0x3c')](_0x5ae269[_0x2115('0x3b')],{'$or':_['map'](_0x354820,function(_0xe19201){if(_0xe19201[_0x2115('0x2e')]!==_0x2115('0x3d')){var _0x19c159={};_0x19c159[_0xe19201[_0x2115('0x27')]]={'$like':'%'+_0x21e6b9[_0x2115('0x30')][_0x2115('0x3a')]+'%'};return _0x19c159;}})});}_0x5ae269=_[_0x2115('0x3c')]({},_0x5ae269,_0x21e6b9[_0x2115('0x3e')]);var _0x5e30a5={'where':_0x5ae269['where']};return db['VoiceChanSpy'][_0x2115('0x19')](_0x5e30a5)['then'](function(_0xa652de){_0x2c293d['count']=_0xa652de;if(_0x21e6b9['query']['includeAll']){_0x5ae269[_0x2115('0x3f')]=[{'all':!![]}];}return db[_0x2115('0x2b')][_0x2115('0x40')](_0x5ae269);})[_0x2115('0x1f')](function(_0x16f022){_0x2c293d['rows']=_0x16f022;return _0x2c293d;})[_0x2115('0x1f')](respondWithFilteredResult(_0x27969d,_0x5ae269))['catch'](handleError(_0x27969d,null));};exports[_0x2115('0x41')]=function(_0x459028,_0x56bae6){var _0x23711d={'raw':![],'where':{'id':_0x459028['params']['id']}},_0x309f46={};_0x309f46['model']=_[_0x2115('0x42')](db[_0x2115('0x2b')]['rawAttributes']);_0x309f46['query']=_[_0x2115('0x42')](_0x459028[_0x2115('0x30')]);_0x309f46['filters']=_['intersection'](_0x309f46[_0x2115('0x36')],_0x309f46[_0x2115('0x30')]);_0x23711d[_0x2115('0x33')]=_['intersection'](_0x309f46[_0x2115('0x36')],qs['fields'](_0x459028[_0x2115('0x30')][_0x2115('0x34')]));_0x23711d[_0x2115('0x33')]=_0x23711d[_0x2115('0x33')][_0x2115('0x35')]?_0x23711d['attributes']:_0x309f46[_0x2115('0x36')];if(_0x459028['query']['includeAll']){_0x23711d[_0x2115('0x3f')]=[{'all':!![]}];}_0x23711d=_[_0x2115('0x3c')]({},_0x23711d,_0x459028['options']);return db[_0x2115('0x2b')][_0x2115('0x43')](_0x23711d)[_0x2115('0x1f')](handleEntityNotFound(_0x56bae6,null))[_0x2115('0x1f')](respondWithResult(_0x56bae6,null))[_0x2115('0x44')](handleError(_0x56bae6,null));};exports[_0x2115('0x45')]=function(_0x41d1a4,_0x347f16){return db[_0x2115('0x2b')]['create'](_0x41d1a4[_0x2115('0x46')],{})[_0x2115('0x1f')](function(_0xdf9fa7){var _0x537ba7=_0x41d1a4[_0x2115('0x47')]['get']({'plain':!![]});if(!_0x537ba7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x537ba7['role']===_0x2115('0x47')){var _0x24d601=_0xdf9fa7['get']({'plain':!![]});var _0x4c0e49=_0x2115('0x21');return db[_0x2115('0x48')][_0x2115('0x43')]({'where':{'name':_0x4c0e49,'userProfileId':_0x537ba7[_0x2115('0x49')]},'raw':!![]})[_0x2115('0x1f')](function(_0x384b2b){if(_0x384b2b&&_0x384b2b[_0x2115('0x4a')]===0x0){return db[_0x2115('0x22')]['create']({'name':_0x24d601[_0x2115('0x27')],'resourceId':_0x24d601['id'],'type':_0x384b2b[_0x2115('0x27')],'sectionId':_0x384b2b['id']},{})['then'](function(){return _0xdf9fa7;});}else{return _0xdf9fa7;}})[_0x2115('0x44')](function(_0x6de4e7){logger[_0x2115('0x25')](_0x2115('0x4b'),_0x6de4e7);throw _0x6de4e7;});}return _0xdf9fa7;})[_0x2115('0x1f')](respondWithResult(_0x347f16,0xc9))[_0x2115('0x44')](handleError(_0x347f16,null));};exports['update']=function(_0x2a388a,_0x392132){if(_0x2a388a['body']['id']){delete _0x2a388a['body']['id'];}return db[_0x2115('0x2b')][_0x2115('0x43')]({'where':{'id':_0x2a388a[_0x2115('0x4c')]['id']}})[_0x2115('0x1f')](handleEntityNotFound(_0x392132,null))['then'](saveUpdates(_0x2a388a[_0x2115('0x46')],null))[_0x2115('0x1f')](respondWithResult(_0x392132,null))[_0x2115('0x44')](handleError(_0x392132,null));};exports[_0x2115('0x20')]=function(_0xedd07f,_0x1bd210){return db['VoiceChanSpy'][_0x2115('0x43')]({'where':{'id':_0xedd07f[_0x2115('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1bd210,null))[_0x2115('0x1f')](removeEntity(_0x1bd210,null))[_0x2115('0x44')](handleError(_0x1bd210,null));}; \ No newline at end of file +var _0x44f8=['moment','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','update','then','get','ChanSpies','UserProfileResource','destroy','end','name','index','map','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','limit','where','pick','filter','merge','VIRTUAL','options','VoiceChanSpy','includeAll','include','findAll','rows','catch','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3983ff,_0x27b229){var _0x146863=function(_0x3a9fa2){while(--_0x3a9fa2){_0x3983ff['push'](_0x3983ff['shift']());}};_0x146863(++_0x27b229);}(_0x44f8,0x1de));var _0x844f=function(_0x7c8c7d,_0x33ee0f){_0x7c8c7d=_0x7c8c7d-0x0;var _0x4773d0=_0x44f8[_0x7c8c7d];return _0x4773d0;};'use strict';var emlformat=require(_0x844f('0x0'));var rimraf=require(_0x844f('0x1'));var zipdir=require(_0x844f('0x2'));var jsonpatch=require(_0x844f('0x3'));var rp=require(_0x844f('0x4'));var moment=require(_0x844f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x844f('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x844f('0x7'));var fs=require('fs');var fs_extra=require(_0x844f('0x8'));var _=require(_0x844f('0x9'));var squel=require(_0x844f('0xa'));var crypto=require(_0x844f('0xb'));var jsforce=require(_0x844f('0xc'));var deskjs=require(_0x844f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x844f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x844f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x844f('0x10'));var config=require(_0x844f('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x844f('0x12'))['db'];function respondWithStatusCode(_0x110dc2,_0x2320fc){_0x2320fc=_0x2320fc||0xcc;return function(_0x5ea542){if(_0x5ea542){return _0x110dc2['sendStatus'](_0x2320fc);}return _0x110dc2[_0x844f('0x13')](_0x2320fc)['end']();};}function respondWithResult(_0x3137c1,_0x31a0d9){_0x31a0d9=_0x31a0d9||0xc8;return function(_0x449887){if(_0x449887){return _0x3137c1[_0x844f('0x13')](_0x31a0d9)[_0x844f('0x14')](_0x449887);}};}function respondWithFilteredResult(_0x486fa0,_0x5da4ab){return function(_0x1b04a9){if(_0x1b04a9){var _0x149f21=typeof _0x5da4ab[_0x844f('0x15')]===_0x844f('0x16')&&typeof _0x5da4ab['limit']===_0x844f('0x16');var _0x547881=_0x1b04a9['count'];var _0x1f96d0=_0x149f21?0x0:_0x5da4ab[_0x844f('0x15')];var _0x5cc55c=_0x149f21?_0x1b04a9[_0x844f('0x17')]:_0x5da4ab['offset']+_0x5da4ab['limit'];var _0x31431e;if(_0x5cc55c>=_0x547881){_0x5cc55c=_0x547881;_0x31431e=0xc8;}else{_0x31431e=0xce;}_0x486fa0['status'](_0x31431e);return _0x486fa0[_0x844f('0x18')](_0x844f('0x19'),_0x1f96d0+'-'+_0x5cc55c+'/'+_0x547881)[_0x844f('0x14')](_0x1b04a9);}return null;};}function patchUpdates(_0x38e732){return function(_0x3f5060){try{jsonpatch['apply'](_0x3f5060,_0x38e732,!![]);}catch(_0x270be6){return BPromise['reject'](_0x270be6);}return _0x3f5060['save']();};}function saveUpdates(_0x3f83cd,_0x4261b6){return function(_0x1b2037){if(_0x1b2037){return _0x1b2037[_0x844f('0x1a')](_0x3f83cd)[_0x844f('0x1b')](function(_0x523f49){return _0x523f49;});}return null;};}function removeEntity(_0x189523,_0x4bd66d){return function(_0x22c055){if(_0x22c055){return _0x22c055['destroy']()[_0x844f('0x1b')](function(){var _0x19b96a=_0x22c055[_0x844f('0x1c')]({'plain':!![]});var _0x7dc0c9=_0x844f('0x1d');return db[_0x844f('0x1e')][_0x844f('0x1f')]({'where':{'type':_0x7dc0c9,'resourceId':_0x19b96a['id']}})['then'](function(){return _0x22c055;});})[_0x844f('0x1b')](function(){_0x189523[_0x844f('0x13')](0xcc)[_0x844f('0x20')]();});}};}function handleEntityNotFound(_0x1ad3da,_0x29c4c3){return function(_0x29d224){if(!_0x29d224){_0x1ad3da['sendStatus'](0x194);}return _0x29d224;};}function handleError(_0x3d8bc1,_0xa8ca5b){_0xa8ca5b=_0xa8ca5b||0x1f4;return function(_0x3f62f1){logger['error'](_0x3f62f1['stack']);if(_0x3f62f1[_0x844f('0x21')]){delete _0x3f62f1[_0x844f('0x21')];}_0x3d8bc1[_0x844f('0x13')](_0xa8ca5b)['send'](_0x3f62f1);};}exports[_0x844f('0x22')]=function(_0x55de3e,_0x2a0dc9){var _0x259d8e={},_0x516fe7={},_0x49e801={'count':0x0,'rows':[]};var _0x24319c=_[_0x844f('0x23')](db['VoiceChanSpy']['rawAttributes'],function(_0x3382d4){return{'name':_0x3382d4[_0x844f('0x24')],'type':_0x3382d4[_0x844f('0x25')]['key']};});_0x516fe7[_0x844f('0x26')]=_[_0x844f('0x23')](_0x24319c,_0x844f('0x21'));_0x516fe7[_0x844f('0x27')]=_['keys'](_0x55de3e[_0x844f('0x27')]);_0x516fe7[_0x844f('0x28')]=_[_0x844f('0x29')](_0x516fe7[_0x844f('0x26')],_0x516fe7[_0x844f('0x27')]);_0x259d8e[_0x844f('0x2a')]=_[_0x844f('0x29')](_0x516fe7[_0x844f('0x26')],qs['fields'](_0x55de3e[_0x844f('0x27')]['fields']));_0x259d8e[_0x844f('0x2a')]=_0x259d8e[_0x844f('0x2a')][_0x844f('0x2b')]?_0x259d8e[_0x844f('0x2a')]:_0x516fe7['model'];if(!_0x55de3e[_0x844f('0x27')][_0x844f('0x2c')]('nolimit')){_0x259d8e[_0x844f('0x2d')]=qs[_0x844f('0x2d')](_0x55de3e[_0x844f('0x27')][_0x844f('0x2d')]);_0x259d8e[_0x844f('0x15')]=qs[_0x844f('0x15')](_0x55de3e['query'][_0x844f('0x15')]);}_0x259d8e['order']=qs['sort'](_0x55de3e[_0x844f('0x27')]['sort']);_0x259d8e[_0x844f('0x2e')]=qs[_0x844f('0x28')](_[_0x844f('0x2f')](_0x55de3e[_0x844f('0x27')],_0x516fe7[_0x844f('0x28')]),_0x24319c);if(_0x55de3e[_0x844f('0x27')][_0x844f('0x30')]){_0x259d8e[_0x844f('0x2e')]=_[_0x844f('0x31')](_0x259d8e[_0x844f('0x2e')],{'$or':_[_0x844f('0x23')](_0x24319c,function(_0x366ebf){if(_0x366ebf[_0x844f('0x25')]!==_0x844f('0x32')){var _0x23a721={};_0x23a721[_0x366ebf['name']]={'$like':'%'+_0x55de3e['query'][_0x844f('0x30')]+'%'};return _0x23a721;}})});}_0x259d8e=_['merge']({},_0x259d8e,_0x55de3e[_0x844f('0x33')]);var _0x2ecd23={'where':_0x259d8e['where']};return db[_0x844f('0x34')]['count'](_0x2ecd23)['then'](function(_0x2b3b4d){_0x49e801['count']=_0x2b3b4d;if(_0x55de3e['query'][_0x844f('0x35')]){_0x259d8e[_0x844f('0x36')]=[{'all':!![]}];}return db[_0x844f('0x34')][_0x844f('0x37')](_0x259d8e);})['then'](function(_0x1df697){_0x49e801[_0x844f('0x38')]=_0x1df697;return _0x49e801;})[_0x844f('0x1b')](respondWithFilteredResult(_0x2a0dc9,_0x259d8e))[_0x844f('0x39')](handleError(_0x2a0dc9,null));};exports['show']=function(_0x16da77,_0x4b4da6){var _0x5848d4={'raw':![],'where':{'id':_0x16da77[_0x844f('0x3a')]['id']}},_0xd5eab8={};_0xd5eab8[_0x844f('0x26')]=_[_0x844f('0x3b')](db[_0x844f('0x34')]['rawAttributes']);_0xd5eab8[_0x844f('0x27')]=_[_0x844f('0x3b')](_0x16da77['query']);_0xd5eab8[_0x844f('0x28')]=_[_0x844f('0x29')](_0xd5eab8[_0x844f('0x26')],_0xd5eab8[_0x844f('0x27')]);_0x5848d4[_0x844f('0x2a')]=_[_0x844f('0x29')](_0xd5eab8[_0x844f('0x26')],qs[_0x844f('0x3c')](_0x16da77[_0x844f('0x27')][_0x844f('0x3c')]));_0x5848d4[_0x844f('0x2a')]=_0x5848d4['attributes'][_0x844f('0x2b')]?_0x5848d4['attributes']:_0xd5eab8[_0x844f('0x26')];if(_0x16da77[_0x844f('0x27')]['includeAll']){_0x5848d4[_0x844f('0x36')]=[{'all':!![]}];}_0x5848d4=_[_0x844f('0x31')]({},_0x5848d4,_0x16da77[_0x844f('0x33')]);return db[_0x844f('0x34')][_0x844f('0x3d')](_0x5848d4)['then'](handleEntityNotFound(_0x4b4da6,null))[_0x844f('0x1b')](respondWithResult(_0x4b4da6,null))['catch'](handleError(_0x4b4da6,null));};exports[_0x844f('0x3e')]=function(_0xa8d0cb,_0x2c28d3){return db['VoiceChanSpy'][_0x844f('0x3e')](_0xa8d0cb[_0x844f('0x3f')],{})[_0x844f('0x1b')](function(_0x511cae){var _0x17c388=_0xa8d0cb[_0x844f('0x40')][_0x844f('0x1c')]({'plain':!![]});if(!_0x17c388)throw new Error(_0x844f('0x41'));if(_0x17c388[_0x844f('0x42')]==='user'){var _0x1518d7=_0x511cae[_0x844f('0x1c')]({'plain':!![]});var _0x368372=_0x844f('0x1d');return db['UserProfileSection'][_0x844f('0x3d')]({'where':{'name':_0x368372,'userProfileId':_0x17c388[_0x844f('0x43')]},'raw':!![]})[_0x844f('0x1b')](function(_0x32f9fa){if(_0x32f9fa&&_0x32f9fa[_0x844f('0x44')]===0x0){return db[_0x844f('0x1e')]['create']({'name':_0x1518d7['name'],'resourceId':_0x1518d7['id'],'type':_0x32f9fa[_0x844f('0x21')],'sectionId':_0x32f9fa['id']},{})[_0x844f('0x1b')](function(){return _0x511cae;});}else{return _0x511cae;}})[_0x844f('0x39')](function(_0x1efc35){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1efc35);throw _0x1efc35;});}return _0x511cae;})[_0x844f('0x1b')](respondWithResult(_0x2c28d3,0xc9))['catch'](handleError(_0x2c28d3,null));};exports[_0x844f('0x1a')]=function(_0x12e37a,_0x2d3f47){if(_0x12e37a[_0x844f('0x3f')]['id']){delete _0x12e37a['body']['id'];}return db[_0x844f('0x34')][_0x844f('0x3d')]({'where':{'id':_0x12e37a['params']['id']}})['then'](handleEntityNotFound(_0x2d3f47,null))[_0x844f('0x1b')](saveUpdates(_0x12e37a[_0x844f('0x3f')],null))[_0x844f('0x1b')](respondWithResult(_0x2d3f47,null))[_0x844f('0x39')](handleError(_0x2d3f47,null));};exports[_0x844f('0x1f')]=function(_0x3fade9,_0x47ddbf){return db['VoiceChanSpy'][_0x844f('0x3d')]({'where':{'id':_0x3fade9[_0x844f('0x3a')]['id']}})[_0x844f('0x1b')](handleEntityNotFound(_0x47ddbf,null))[_0x844f('0x1b')](removeEntity(_0x47ddbf,null))[_0x844f('0x39')](handleError(_0x47ddbf,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index aa6725e..dda0e57 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 _0x8d5c=['context','from-sip','format','%s%s','merge','CDR(type)=%s','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','SIP/%s,%s','name','options','join','length','concat','internal','findAll','then','catch','exports','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes'];(function(_0x3afd62,_0xcf0997){var _0x33091d=function(_0x498d91){while(--_0x498d91){_0x3afd62['push'](_0x3afd62['shift']());}};_0x33091d(++_0xcf0997);}(_0x8d5c,0x7c));var _0xc8d5=function(_0x9cc1d7,_0x126bd4){_0x9cc1d7=_0x9cc1d7-0x0;var _0x294e87=_0x8d5c[_0x9cc1d7];return _0x294e87;};'use strict';var _=require(_0xc8d5('0x0'));var util=require(_0xc8d5('0x1'));var BPromise=require(_0xc8d5('0x2'));var attributes=require(_0xc8d5('0x3'));var getUserApplications=function(_0x34d101,_0x16e653,_0x55d959){var _0xa502b0=0x1;var _0x517424=[];var _0x141ce0={'context':_0x16e653[_0xc8d5('0x4')]||_0xc8d5('0x5'),'exten':util[_0xc8d5('0x6')](_0xc8d5('0x7'),_0x34d101['prefix'],_0x55d959),'type':'system','isApp':![],'ChanSpyId':_0x34d101['id'],'UserId':_0x16e653['id']};_0x517424['push'](_[_0xc8d5('0x8')]({'app':'Set','appdata':util[_0xc8d5('0x6')](_0xc8d5('0x9'),'chanspy'),'priority':_0xa502b0++},_0x141ce0));if(_0x34d101[_0xc8d5('0xa')]){_0x517424[_0xc8d5('0xb')](_['merge']({'app':_0xc8d5('0xc'),'appdata':util[_0xc8d5('0x6')](_0xc8d5('0xd'),_0x34d101[_0xc8d5('0xe')]),'priority':_0xa502b0++},_0x141ce0));}if(_0x34d101['auth']){_0x517424[_0xc8d5('0xb')](_[_0xc8d5('0x8')]({'app':_0xc8d5('0xf'),'appdata':_0x34d101[_0xc8d5('0x10')],'priority':_0xa502b0++},_0x141ce0));}_0x517424[_0xc8d5('0xb')](_[_0xc8d5('0x8')]({'app':'ChanSpy','appdata':util[_0xc8d5('0x6')](_0xc8d5('0x11'),_0x16e653[_0xc8d5('0x12')],_0x34d101[_0xc8d5('0x13')]?_0x34d101[_0xc8d5('0x13')][_0xc8d5('0x14')](''):''),'priority':_0xa502b0++},_0x141ce0));if(_0x34d101[_0xc8d5('0xa')]){_0x517424[_0xc8d5('0xb')](_[_0xc8d5('0x8')]({'app':'StopMixMonitor','priority':_0xa502b0++},_0x141ce0));}return _0x517424;};var getChanSpyApplications=function(_0x3330d7,_0x59dcd5){var _0x4831c8=[];for(var _0x4de438=0x0,_0x586893=0x1;_0x4de438<_0x59dcd5[_0xc8d5('0x15')];_0x4de438++,_0x586893=0x1){_0x4831c8=_0x4831c8[_0xc8d5('0x16')](getUserApplications(_0x3330d7,_0x59dcd5[_0x4de438],_0x59dcd5[_0x4de438]['internal']));if(_0x59dcd5[_0x4de438][_0xc8d5('0x17')]!=_0x59dcd5[_0x4de438][_0xc8d5('0x12')]){_0x4831c8=_0x4831c8[_0xc8d5('0x16')](getUserApplications(_0x3330d7,_0x59dcd5[_0x4de438],_0x59dcd5[_0x4de438][_0xc8d5('0x12')]));}}return _0x4831c8;};var getChanSpyPromise=function(_0x21ab12,_0x20bbb1){return new BPromise(function(_0x2ad676,_0x536207){return _0x21ab12['User'][_0xc8d5('0x18')]({'attributes':['id','name',_0xc8d5('0x17')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xc8d5('0x19')](function(_0x37bd5a){if(_0x37bd5a){return _0x2ad676(getChanSpyApplications(_0x20bbb1,_0x37bd5a));}return _0x2ad676([]);})[_0xc8d5('0x1a')](function(_0x5cb8d9){_0x536207(_0x5cb8d9);});});};module[_0xc8d5('0x1b')]=function(_0xf34eb2,_0x1ebf8c){var _0xca3039=_0xf34eb2['models'];return _0xf34eb2['define']('VoiceChanSpy',attributes,{'tableName':_0xc8d5('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3489df,_0x2582df,_0x250049){return getChanSpyPromise(_0xca3039,_0x3489df)[_0xc8d5('0x19')](function(_0x5ca1cd){if(_0x5ca1cd&&_0x5ca1cd['length']){return _0xca3039[_0xc8d5('0x1d')][_0xc8d5('0x1e')](_0x5ca1cd);}})[_0xc8d5('0x19')](function(){_0x250049();})['catch'](function(_0x1b4c44){_0x250049(_0x1b4c44);});},'afterUpdate':function(_0x215cdf,_0x58b279,_0xfaf61d){return _0xca3039[_0xc8d5('0x1d')]['destroy']({'where':{'ChanSpyId':_0x215cdf['id']}})['then'](function(){return getChanSpyPromise(_0xca3039,_0x215cdf);})[_0xc8d5('0x19')](function(_0x1a172a){if(_0x1a172a&&_0x1a172a['length']){return _0xca3039[_0xc8d5('0x1d')][_0xc8d5('0x1e')](_0x1a172a);}})[_0xc8d5('0x19')](function(){_0xfaf61d();})[_0xc8d5('0x1a')](function(_0x388ca0){_0xfaf61d(_0x388ca0);});},'afterDestroy':function(_0x2c3654,_0x234dbf,_0x525ec8){return _0xca3039[_0xc8d5('0x1d')][_0xc8d5('0x1f')]({'where':{'ChanSpyId':_0x2c3654['id']}})['then'](function(){_0x525ec8();})[_0xc8d5('0x1a')](function(_0x99abfc){_0x525ec8(_0x99abfc);});}}});}; \ No newline at end of file +var _0x5288=['password','ChanSpy','SIP/%s,%s','name','options','join','concat','internal','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','length','bulkCreate','destroy','lodash','context','from-sip','format','%s%s','prefix','system','push','Set','CDR(type)=%s','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat'];(function(_0x4dd3ce,_0x4211c5){var _0x2a1aee=function(_0x2cf135){while(--_0x2cf135){_0x4dd3ce['push'](_0x4dd3ce['shift']());}};_0x2a1aee(++_0x4211c5);}(_0x5288,0x195));var _0x8528=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x5288[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x8528('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3be509,_0x3d3e2d,_0x1c0267){var _0x3574b9=0x1;var _0x4bcd0d=[];var _0x57f894={'context':_0x3d3e2d[_0x8528('0x1')]||_0x8528('0x2'),'exten':util[_0x8528('0x3')](_0x8528('0x4'),_0x3be509[_0x8528('0x5')],_0x1c0267),'type':_0x8528('0x6'),'isApp':![],'ChanSpyId':_0x3be509['id'],'UserId':_0x3d3e2d['id']};_0x4bcd0d[_0x8528('0x7')](_['merge']({'app':_0x8528('0x8'),'appdata':util[_0x8528('0x3')](_0x8528('0x9'),'chanspy'),'priority':_0x3574b9++},_0x57f894));if(_0x3be509[_0x8528('0xa')]){_0x4bcd0d['push'](_[_0x8528('0xb')]({'app':_0x8528('0xc'),'appdata':util[_0x8528('0x3')](_0x8528('0xd'),_0x3be509[_0x8528('0xe')]),'priority':_0x3574b9++},_0x57f894));}if(_0x3be509['auth']){_0x4bcd0d['push'](_[_0x8528('0xb')]({'app':'Authenticate','appdata':_0x3be509[_0x8528('0xf')],'priority':_0x3574b9++},_0x57f894));}_0x4bcd0d['push'](_[_0x8528('0xb')]({'app':_0x8528('0x10'),'appdata':util[_0x8528('0x3')](_0x8528('0x11'),_0x3d3e2d[_0x8528('0x12')],_0x3be509[_0x8528('0x13')]?_0x3be509[_0x8528('0x13')][_0x8528('0x14')](''):''),'priority':_0x3574b9++},_0x57f894));if(_0x3be509[_0x8528('0xa')]){_0x4bcd0d[_0x8528('0x7')](_['merge']({'app':'StopMixMonitor','priority':_0x3574b9++},_0x57f894));}return _0x4bcd0d;};var getChanSpyApplications=function(_0x200a3f,_0x59d3fa){var _0x15790e=[];for(var _0x95016e=0x0,_0x1d9d68=0x1;_0x95016e<_0x59d3fa['length'];_0x95016e++,_0x1d9d68=0x1){_0x15790e=_0x15790e[_0x8528('0x15')](getUserApplications(_0x200a3f,_0x59d3fa[_0x95016e],_0x59d3fa[_0x95016e][_0x8528('0x16')]));if(_0x59d3fa[_0x95016e][_0x8528('0x16')]!=_0x59d3fa[_0x95016e][_0x8528('0x12')]){_0x15790e=_0x15790e[_0x8528('0x15')](getUserApplications(_0x200a3f,_0x59d3fa[_0x95016e],_0x59d3fa[_0x95016e][_0x8528('0x12')]));}}return _0x15790e;};var getChanSpyPromise=function(_0x1b62a6,_0x476cfd){return new BPromise(function(_0x173a24,_0x4e8643){return _0x1b62a6['User']['findAll']({'attributes':['id',_0x8528('0x12'),'internal'],'where':{'role':_0x8528('0x17'),'chanspy':!![]},'raw':!![]})[_0x8528('0x18')](function(_0x2fa96c){if(_0x2fa96c){return _0x173a24(getChanSpyApplications(_0x476cfd,_0x2fa96c));}return _0x173a24([]);})[_0x8528('0x19')](function(_0x2cd41f){_0x4e8643(_0x2cd41f);});});};module[_0x8528('0x1a')]=function(_0x30a651,_0x10c312){var _0x190c1c=_0x30a651[_0x8528('0x1b')];return _0x30a651[_0x8528('0x1c')](_0x8528('0x1d'),attributes,{'tableName':_0x8528('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5cb4c3,_0x2fb2df,_0xe9fa8f){return getChanSpyPromise(_0x190c1c,_0x5cb4c3)[_0x8528('0x18')](function(_0x513a7f){if(_0x513a7f&&_0x513a7f['length']){return _0x190c1c['VoiceExtension']['bulkCreate'](_0x513a7f);}})[_0x8528('0x18')](function(){_0xe9fa8f();})[_0x8528('0x19')](function(_0x1ed7ad){_0xe9fa8f(_0x1ed7ad);});},'afterUpdate':function(_0x36e38a,_0xc02e82,_0x384a6f){return _0x190c1c[_0x8528('0x1f')]['destroy']({'where':{'ChanSpyId':_0x36e38a['id']}})['then'](function(){return getChanSpyPromise(_0x190c1c,_0x36e38a);})[_0x8528('0x18')](function(_0x5369ee){if(_0x5369ee&&_0x5369ee[_0x8528('0x20')]){return _0x190c1c['VoiceExtension'][_0x8528('0x21')](_0x5369ee);}})[_0x8528('0x18')](function(){_0x384a6f();})[_0x8528('0x19')](function(_0x27c93b){_0x384a6f(_0x27c93b);});},'afterDestroy':function(_0x36d847,_0x35d9b5,_0x3f2f53){return _0x190c1c['VoiceExtension'][_0x8528('0x22')]({'where':{'ChanSpyId':_0x36d847['id']}})[_0x8528('0x18')](function(){_0x3f2f53();})[_0x8528('0x19')](function(_0x30f61c){_0x3f2f53(_0x30f61c);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index ccfcbdc..2c612b9 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 _0x55e0=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x55e0,0xdc));var _0x055e=function(_0x329e18,_0x360a88){_0x329e18=_0x329e18-0x0;var _0x4f7cce=_0x55e0[_0x329e18];return _0x4f7cce;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4384ff,_0x4a442e,_0x8e7824){return new BPromise(function(_0x3c4cf,_0x376618){return client[_0x055e('0xa')](_0x4384ff,_0x8e7824)[_0x055e('0xb')](function(_0x49540c){logger[_0x055e('0xc')](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));logger[_0x055e('0xf')](_0x055e('0x10'),_0x4a442e,'request\x20sent',JSON['stringify'](_0x49540c));if(_0x49540c[_0x055e('0x11')]){if(_0x49540c['error'][_0x055e('0x12')]===0x1f4){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x376618(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}logger['error'](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x3c4cf(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}else{logger['info'](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));_0x3c4cf(_0x49540c[_0x055e('0x14')]['message']);}})[_0x055e('0x15')](function(_0x2c377c){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x2c377c);_0x376618(_0x2c377c);});});} \ No newline at end of file +var _0xad8a=['../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xda3e2c,_0x49e060){var _0x3f7139=function(_0x5de154){while(--_0x5de154){_0xda3e2c['push'](_0xda3e2c['shift']());}};_0x3f7139(++_0x49e060);}(_0xad8a,0xb0));var _0xaad8=function(_0x571b54,_0xfd95d2){_0x571b54=_0x571b54-0x0;var _0x1718a8=_0xad8a[_0x571b54];return _0x1718a8;};'use strict';var _=require(_0xaad8('0x0'));var util=require(_0xaad8('0x1'));var moment=require(_0xaad8('0x2'));var BPromise=require(_0xaad8('0x3'));var rs=require(_0xaad8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaad8('0x5'))['db'];var utils=require(_0xaad8('0x6'));var logger=require(_0xaad8('0x7'))('rpc');var config=require(_0xaad8('0x8'));var jayson=require(_0xaad8('0x9'));var client=jayson[_0xaad8('0xa')][_0xaad8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x95aef9,_0x39c599,_0x28f3a1){return new BPromise(function(_0xf3a6c7,_0x11408a){return client[_0xaad8('0xc')](_0x95aef9,_0x28f3a1)['then'](function(_0x52477f){logger[_0xaad8('0xd')](_0xaad8('0xe'),_0x39c599,_0xaad8('0xf'));logger[_0xaad8('0x10')](_0xaad8('0x11'),_0x39c599,_0xaad8('0xf'),JSON[_0xaad8('0x12')](_0x52477f));if(_0x52477f[_0xaad8('0x13')]){if(_0x52477f[_0xaad8('0x13')]['code']===0x1f4){logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);return _0x11408a(_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);}logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);return _0xf3a6c7(_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);}else{logger[_0xaad8('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x39c599,_0xaad8('0xf'));_0xf3a6c7(_0x52477f[_0xaad8('0x15')]['message']);}})[_0xaad8('0x16')](function(_0x2a8e12){logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x2a8e12);_0x11408a(_0x2a8e12);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 9a36570..53f78c2 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 _0xbcbf=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','post','isAuthenticated','put','/:id','update','delete','destroy'];(function(_0x451a7e,_0x5176d5){var _0x43ea66=function(_0x380c4b){while(--_0x380c4b){_0x451a7e['push'](_0x451a7e['shift']());}};_0x43ea66(++_0x5176d5);}(_0xbcbf,0x155));var _0xfbcb=function(_0x575435,_0x2b31c6){_0x575435=_0x575435-0x0;var _0xe5dca8=_0xbcbf[_0x575435];return _0xe5dca8;};'use strict';var multer=require('multer');var util=require(_0xfbcb('0x0'));var path=require(_0xfbcb('0x1'));var timeout=require(_0xfbcb('0x2'));var express=require(_0xfbcb('0x3'));var router=express[_0xfbcb('0x4')]();var fs_extra=require(_0xfbcb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfbcb('0x6'));var config=require(_0xfbcb('0x7'));var controller=require('./voiceContext.controller');router[_0xfbcb('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfbcb('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfbcb('0x9')]('/',auth[_0xfbcb('0xa')](),controller['create']);router[_0xfbcb('0xb')](_0xfbcb('0xc'),auth[_0xfbcb('0xa')](),controller[_0xfbcb('0xd')]);router[_0xfbcb('0xe')](_0xfbcb('0xc'),auth[_0xfbcb('0xa')](),controller[_0xfbcb('0xf')]);module[_0xfbcb('0x10')]=router; \ No newline at end of file +var _0xb1b6=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xb1b6,0x1e2));var _0x6b1b=function(_0x212d46,_0x145f5b){_0x212d46=_0x212d46-0x0;var _0xe8e8bf=_0xb1b6[_0x212d46];return _0xe8e8bf;};'use strict';var multer=require(_0x6b1b('0x0'));var util=require(_0x6b1b('0x1'));var path=require(_0x6b1b('0x2'));var timeout=require(_0x6b1b('0x3'));var express=require(_0x6b1b('0x4'));var router=express['Router']();var fs_extra=require(_0x6b1b('0x5'));var auth=require(_0x6b1b('0x6'));var interaction=require(_0x6b1b('0x7'));var config=require(_0x6b1b('0x8'));var controller=require('./voiceContext.controller');router[_0x6b1b('0x9')]('/',auth[_0x6b1b('0xa')](),controller['index']);router['get'](_0x6b1b('0xb'),auth[_0x6b1b('0xa')](),controller[_0x6b1b('0xc')]);router[_0x6b1b('0xd')]('/',auth[_0x6b1b('0xa')](),controller[_0x6b1b('0xe')]);router[_0x6b1b('0xf')](_0x6b1b('0xb'),auth[_0x6b1b('0xa')](),controller[_0x6b1b('0x10')]);router[_0x6b1b('0x11')](_0x6b1b('0xb'),auth[_0x6b1b('0xa')](),controller[_0x6b1b('0x12')]);module[_0x6b1b('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index e170e8a..c04412d 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 _0xc455=['BOOLEAN','sequelize','exports','STRING'];(function(_0x11feff,_0x3728e6){var _0x42e95d=function(_0x1eea5a){while(--_0x1eea5a){_0x11feff['push'](_0x11feff['shift']());}};_0x42e95d(++_0x3728e6);}(_0xc455,0xcd));var _0x5c45=function(_0x78b883,_0x3d4443){_0x78b883=_0x78b883-0x0;var _0x34c9f4=_0xc455[_0x78b883];return _0x34c9f4;};'use strict';var Sequelize=require(_0x5c45('0x0'));module[_0x5c45('0x1')]={'name':{'type':Sequelize[_0x5c45('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x5c45('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5c45('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc779=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4b55f3,_0x25ceb9){var _0x2b2f09=function(_0x18ee0a){while(--_0x18ee0a){_0x4b55f3['push'](_0x4b55f3['shift']());}};_0x2b2f09(++_0x25ceb9);}(_0xc779,0x138));var _0x9c77=function(_0x560bea,_0x2a1978){_0x560bea=_0x560bea-0x0;var _0x4759ee=_0xc779[_0x560bea];return _0x4759ee;};'use strict';var Sequelize=require(_0x9c77('0x0'));module[_0x9c77('0x1')]={'name':{'type':Sequelize[_0x9c77('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x9c77('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x9c77('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 9101f1c..c5758f1 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 _0x7870=['readFileSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','destroy','get','Contexts','UserProfileResource','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','include','findAll','show','params','includeAll','options','find','create','body','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','join'];(function(_0x5aa73b,_0x3f5f8b){var _0x55f11d=function(_0x112b45){while(--_0x112b45){_0x5aa73b['push'](_0x5aa73b['shift']());}};_0x55f11d(++_0x3f5f8b);}(_0x7870,0x66));var _0x0787=function(_0x2ae9fb,_0x4a727c){_0x2ae9fb=_0x2ae9fb-0x0;var _0x37aec2=_0x7870[_0x2ae9fb];return _0x37aec2;};'use strict';var emlformat=require(_0x0787('0x0'));var rimraf=require(_0x0787('0x1'));var zipdir=require(_0x0787('0x2'));var jsonpatch=require(_0x0787('0x3'));var rp=require('request-promise');var moment=require(_0x0787('0x4'));var BPromise=require(_0x0787('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0787('0x6'));var csv=require(_0x0787('0x7'));var ejs=require(_0x0787('0x8'));var fs=require('fs');var fs_extra=require(_0x0787('0x9'));var _=require(_0x0787('0xa'));var squel=require(_0x0787('0xb'));var crypto=require(_0x0787('0xc'));var jsforce=require(_0x0787('0xd'));var deskjs=require(_0x0787('0xe'));var toCsv=require(_0x0787('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0787('0xf'));var hardwareService=require(_0x0787('0x10'));var logger=require(_0x0787('0x11'))(_0x0787('0x12'));var utils=require(_0x0787('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x0787('0x14'));var client=jayson['client'][_0x0787('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x38236d,_0x19518d,_0x591ddb,_0x2e7a08){return new BPromise(function(_0x2d27f6,_0x3155a5){var _0x4c233d=_0x2e7a08||client;return _0x4c233d['request'](_0x38236d,_0x591ddb)[_0x0787('0x16')](function(_0x149e0d){logger[_0x0787('0x17')](_0x0787('0x18'),_0x19518d,_0x0787('0x19'));logger[_0x0787('0x1a')](_0x0787('0x1b'),_0x19518d,_0x0787('0x19'),JSON[_0x0787('0x1c')](_0x149e0d));if(_0x149e0d[_0x0787('0x1d')]){if(_0x149e0d[_0x0787('0x1d')][_0x0787('0x1e')]===0x1f4){logger[_0x0787('0x1d')](_0x0787('0x18'),_0x19518d,_0x149e0d[_0x0787('0x1d')]['message']);return _0x3155a5(_0x149e0d[_0x0787('0x1d')][_0x0787('0x1f')]);}logger[_0x0787('0x1d')](_0x0787('0x18'),_0x19518d,_0x149e0d[_0x0787('0x1d')]['message']);return _0x2d27f6(_0x149e0d[_0x0787('0x1d')]['message']);}else{logger[_0x0787('0x17')](_0x0787('0x18'),_0x19518d,_0x0787('0x19'));_0x2d27f6(_0x149e0d[_0x0787('0x20')]['message']);}})[_0x0787('0x21')](function(_0xdddc3e){logger[_0x0787('0x1d')](_0x0787('0x18'),_0x19518d,_0xdddc3e);_0x3155a5(_0xdddc3e);});});}function respondWithStatusCode(_0x1a8edf,_0x378c36){_0x378c36=_0x378c36||0xcc;return function(_0xc5d192){if(_0xc5d192){return _0x1a8edf[_0x0787('0x22')](_0x378c36);}return _0x1a8edf[_0x0787('0x23')](_0x378c36)[_0x0787('0x24')]();};}function respondWithResult(_0xb6f0c2,_0x858552){_0x858552=_0x858552||0xc8;return function(_0x11eb44){if(_0x11eb44){return _0xb6f0c2[_0x0787('0x23')](_0x858552)[_0x0787('0x25')](_0x11eb44);}};}function respondWithFilteredResult(_0x2561d6,_0x58df60){return function(_0x2d8d99){if(_0x2d8d99){var _0x2fba24=typeof _0x58df60['offset']===_0x0787('0x26')&&typeof _0x58df60[_0x0787('0x27')]===_0x0787('0x26');var _0x1422a6=_0x2d8d99[_0x0787('0x28')];var _0xa88e20=_0x2fba24?0x0:_0x58df60[_0x0787('0x29')];var _0x2817b7=_0x2fba24?_0x2d8d99[_0x0787('0x28')]:_0x58df60[_0x0787('0x29')]+_0x58df60[_0x0787('0x27')];var _0x11bbee;if(_0x2817b7>=_0x1422a6){_0x2817b7=_0x1422a6;_0x11bbee=0xc8;}else{_0x11bbee=0xce;}_0x2561d6[_0x0787('0x23')](_0x11bbee);return _0x2561d6[_0x0787('0x2a')]('Content-Range',_0xa88e20+'-'+_0x2817b7+'/'+_0x1422a6)[_0x0787('0x25')](_0x2d8d99);}return null;};}function patchUpdates(_0x516e03){return function(_0x449554){try{jsonpatch[_0x0787('0x2b')](_0x449554,_0x516e03,!![]);}catch(_0x3542e4){return BPromise[_0x0787('0x2c')](_0x3542e4);}return _0x449554[_0x0787('0x2d')]();};}function saveUpdates(_0x4cb237,_0x865707){return function(_0x57d825){if(_0x57d825){return _0x57d825['update'](_0x4cb237)['then'](function(_0x5996a7){return _0x5996a7;});}return null;};}function removeEntity(_0x459cce,_0x35e320){return function(_0x24a1e4){if(_0x24a1e4){return _0x24a1e4[_0x0787('0x2e')]()[_0x0787('0x16')](function(){var _0x535a32=_0x24a1e4[_0x0787('0x2f')]({'plain':!![]});var _0x30e7ec=_0x0787('0x30');return db[_0x0787('0x31')][_0x0787('0x2e')]({'where':{'type':_0x30e7ec,'resourceId':_0x535a32['id']}})['then'](function(){return _0x24a1e4;});})[_0x0787('0x16')](function(){_0x459cce[_0x0787('0x23')](0xcc)[_0x0787('0x24')]();});}};}function handleEntityNotFound(_0x26609c,_0x20cff9){return function(_0x1e2e55){if(!_0x1e2e55){_0x26609c[_0x0787('0x22')](0x194);}return _0x1e2e55;};}function handleError(_0x312c1f,_0x502ca8){_0x502ca8=_0x502ca8||0x1f4;return function(_0x382f0c){logger[_0x0787('0x1d')](_0x382f0c['stack']);if(_0x382f0c['name']){delete _0x382f0c[_0x0787('0x32')];}_0x312c1f[_0x0787('0x23')](_0x502ca8)[_0x0787('0x33')](_0x382f0c);};}exports[_0x0787('0x34')]=function(_0x13c20a,_0x465175){var _0x4b048d={},_0x3b83dc={},_0x4e7b46={'count':0x0,'rows':[]};var _0x30c711=_[_0x0787('0x35')](db[_0x0787('0x36')][_0x0787('0x37')],function(_0x448544){return{'name':_0x448544[_0x0787('0x38')],'type':_0x448544[_0x0787('0x39')]['key']};});_0x3b83dc[_0x0787('0x3a')]=_['map'](_0x30c711,'name');_0x3b83dc[_0x0787('0x3b')]=_[_0x0787('0x3c')](_0x13c20a[_0x0787('0x3b')]);_0x3b83dc['filters']=_[_0x0787('0x3d')](_0x3b83dc[_0x0787('0x3a')],_0x3b83dc['query']);_0x4b048d[_0x0787('0x3e')]=_[_0x0787('0x3d')](_0x3b83dc[_0x0787('0x3a')],qs[_0x0787('0x3f')](_0x13c20a[_0x0787('0x3b')][_0x0787('0x3f')]));_0x4b048d['attributes']=_0x4b048d[_0x0787('0x3e')]['length']?_0x4b048d[_0x0787('0x3e')]:_0x3b83dc['model'];if(!_0x13c20a['query'][_0x0787('0x40')](_0x0787('0x41'))){_0x4b048d['limit']=qs[_0x0787('0x27')](_0x13c20a[_0x0787('0x3b')][_0x0787('0x27')]);_0x4b048d[_0x0787('0x29')]=qs[_0x0787('0x29')](_0x13c20a['query'][_0x0787('0x29')]);}_0x4b048d[_0x0787('0x42')]=qs[_0x0787('0x43')](_0x13c20a[_0x0787('0x3b')][_0x0787('0x43')]);_0x4b048d[_0x0787('0x44')]=qs['filters'](_[_0x0787('0x45')](_0x13c20a['query'],_0x3b83dc[_0x0787('0x46')]),_0x30c711);if(_0x13c20a[_0x0787('0x3b')]['filter']){_0x4b048d[_0x0787('0x44')]=_[_0x0787('0x47')](_0x4b048d['where'],{'$or':_[_0x0787('0x35')](_0x30c711,function(_0x2924fe){if(_0x2924fe[_0x0787('0x39')]!==_0x0787('0x48')){var _0x42a1d3={};_0x42a1d3[_0x2924fe[_0x0787('0x32')]]={'$like':'%'+_0x13c20a['query'][_0x0787('0x49')]+'%'};return _0x42a1d3;}})});}_0x4b048d=_[_0x0787('0x47')]({},_0x4b048d,_0x13c20a['options']);var _0x11529c={'where':_0x4b048d['where']};return db[_0x0787('0x36')][_0x0787('0x28')](_0x11529c)[_0x0787('0x16')](function(_0x474224){_0x4e7b46[_0x0787('0x28')]=_0x474224;if(_0x13c20a[_0x0787('0x3b')]['includeAll']){_0x4b048d[_0x0787('0x4a')]=[{'all':!![]}];}return db['VoiceContext'][_0x0787('0x4b')](_0x4b048d);})[_0x0787('0x16')](function(_0x49e22c){_0x4e7b46['rows']=_0x49e22c;return _0x4e7b46;})['then'](respondWithFilteredResult(_0x465175,_0x4b048d))['catch'](handleError(_0x465175,null));};exports[_0x0787('0x4c')]=function(_0x399bd3,_0x5b43c4){var _0x5be243={'raw':![],'where':{'id':_0x399bd3[_0x0787('0x4d')]['id']}},_0x2956a5={};_0x2956a5[_0x0787('0x3a')]=_['keys'](db[_0x0787('0x36')][_0x0787('0x37')]);_0x2956a5[_0x0787('0x3b')]=_[_0x0787('0x3c')](_0x399bd3['query']);_0x2956a5[_0x0787('0x46')]=_[_0x0787('0x3d')](_0x2956a5['model'],_0x2956a5[_0x0787('0x3b')]);_0x5be243[_0x0787('0x3e')]=_[_0x0787('0x3d')](_0x2956a5[_0x0787('0x3a')],qs[_0x0787('0x3f')](_0x399bd3[_0x0787('0x3b')][_0x0787('0x3f')]));_0x5be243[_0x0787('0x3e')]=_0x5be243[_0x0787('0x3e')]['length']?_0x5be243[_0x0787('0x3e')]:_0x2956a5[_0x0787('0x3a')];if(_0x399bd3[_0x0787('0x3b')][_0x0787('0x4e')]){_0x5be243[_0x0787('0x4a')]=[{'all':!![]}];}_0x5be243=_['merge']({},_0x5be243,_0x399bd3[_0x0787('0x4f')]);return db[_0x0787('0x36')][_0x0787('0x50')](_0x5be243)['then'](handleEntityNotFound(_0x5b43c4,null))[_0x0787('0x16')](respondWithResult(_0x5b43c4,null))['catch'](handleError(_0x5b43c4,null));};exports['create']=function(_0x545296,_0xe79439,_0xb45433){var _0x2f4048;return db[_0x0787('0x36')][_0x0787('0x51')](_0x545296[_0x0787('0x52')],{'raw':!![]})[_0x0787('0x16')](function(_0xf24e7b){_0x2f4048=_0xf24e7b;return db[_0x0787('0x36')]['findAll']({'raw':!![]});})['then'](function(_0x39b825){var _0x2ae5ab=fs['readFileSync'](path['join'](config[_0x0787('0x53')],_0x0787('0x54')),_0x0787('0x55'));var _0x5938ca=ejs[_0x0787('0x56')](_0x2ae5ab,{'contexts':_0x39b825||[]});fs[_0x0787('0x57')](_0x0787('0x58'),_0x5938ca);})[_0x0787('0x16')](function(){return respondWithRpcPromise(_0x0787('0x59'),_0x0787('0x51'),{'module':_0x0787('0x5a')});})['then'](function(){var _0x4b965a=_0x545296['user'][_0x0787('0x2f')]({'plain':!![]});if(!_0x4b965a)throw new Error(_0x0787('0x5b'));if(_0x4b965a[_0x0787('0x5c')]===_0x0787('0x5d')){var _0x344616=_0x2f4048[_0x0787('0x2f')]({'plain':!![]});return db[_0x0787('0x5e')][_0x0787('0x50')]({'where':{'name':_0x0787('0x30'),'userProfileId':_0x4b965a[_0x0787('0x5f')]},'raw':!![]})['then'](function(_0x56e2c8){if(_0x56e2c8&&_0x56e2c8[_0x0787('0x60')]===0x0){return db[_0x0787('0x31')]['create']({'name':_0x344616['name'],'resourceId':_0x344616['id'],'type':_0x56e2c8[_0x0787('0x32')],'sectionId':_0x56e2c8['id']},{})['then'](function(){return _0x2f4048;});}else{return _0x2f4048;}})[_0x0787('0x21')](function(_0x186c1b){logger[_0x0787('0x1d')](_0x0787('0x61'),_0x186c1b);throw _0x186c1b;});}return _0x2f4048;})['then'](respondWithResult(_0xe79439,0xc9))['catch'](handleError(_0xe79439,null));};exports[_0x0787('0x62')]=function(_0x19991b,_0x156b14,_0x402c24){var _0x5d9d79;return db[_0x0787('0x36')][_0x0787('0x50')]({'where':{'id':_0x19991b[_0x0787('0x4d')]['id']}})['then'](handleEntityNotFound(_0x156b14,null))[_0x0787('0x16')](saveUpdates(_0x19991b[_0x0787('0x52')],null))[_0x0787('0x16')](function(_0x51d991){if(_0x51d991){_0x5d9d79=_0x51d991;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x0787('0x16')](function(_0x4228d2){var _0x24a232=fs['readFileSync'](path[_0x0787('0x63')](config['root'],_0x0787('0x54')),_0x0787('0x55'));var _0x2a2ee5=ejs['render'](_0x24a232,{'contexts':_0x4228d2||[]});fs[_0x0787('0x57')](_0x0787('0x58'),_0x2a2ee5);})[_0x0787('0x16')](function(){return respondWithRpcPromise(_0x0787('0x59'),'update',{'module':_0x0787('0x5a')});})['then'](function(){return _0x5d9d79;})[_0x0787('0x16')](respondWithResult(_0x156b14,null))[_0x0787('0x21')](handleError(_0x156b14,null));};exports[_0x0787('0x2e')]=function(_0x4768cd,_0x6408b4,_0x4d7dbb){var _0x41f800;return db[_0x0787('0x36')]['find']({'where':{'id':_0x4768cd[_0x0787('0x4d')]['id']}})[_0x0787('0x16')](handleEntityNotFound(_0x6408b4,null))['then'](removeEntity(_0x6408b4,null))[_0x0787('0x16')](function(){return db[_0x0787('0x36')][_0x0787('0x4b')]({'raw':!![]});})[_0x0787('0x16')](function(_0x14e7fd){var _0x36b9f7=fs[_0x0787('0x64')](path['join'](config['root'],_0x0787('0x54')),_0x0787('0x55'));var _0x37395b=ejs[_0x0787('0x56')](_0x36b9f7,{'contexts':_0x14e7fd});fs[_0x0787('0x57')](_0x0787('0x58'),_0x37395b);return respondWithRpcPromise('Reload',_0x0787('0x2e'),{'module':_0x0787('0x5a')});})[_0x0787('0x21')](handleError(_0x6408b4,null));}; \ No newline at end of file +var _0x7aa2=['index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','utf8','Reload','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','then','get','Contexts','UserProfileResource','stack','name','send'];(function(_0xf8c422,_0x2586a7){var _0x274cf4=function(_0x1d304f){while(--_0x1d304f){_0xf8c422['push'](_0xf8c422['shift']());}};_0x274cf4(++_0x2586a7);}(_0x7aa2,0x1e0));var _0x27aa=function(_0x128313,_0x50691d){_0x128313=_0x128313-0x0;var _0x77a919=_0x7aa2[_0x128313];return _0x77a919;};'use strict';var emlformat=require(_0x27aa('0x0'));var rimraf=require(_0x27aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x27aa('0x2'));var rp=require(_0x27aa('0x3'));var moment=require(_0x27aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x27aa('0x5'));var util=require(_0x27aa('0x6'));var path=require('path');var sox=require(_0x27aa('0x7'));var csv=require(_0x27aa('0x8'));var ejs=require(_0x27aa('0x9'));var fs=require('fs');var fs_extra=require(_0x27aa('0xa'));var _=require(_0x27aa('0xb'));var squel=require(_0x27aa('0xc'));var crypto=require(_0x27aa('0xd'));var jsforce=require(_0x27aa('0xe'));var deskjs=require(_0x27aa('0xf'));var toCsv=require(_0x27aa('0x8'));var querystring=require(_0x27aa('0x10'));var Papa=require('papaparse');var Redis=require(_0x27aa('0x11'));var authService=require(_0x27aa('0x12'));var qs=require(_0x27aa('0x13'));var as=require(_0x27aa('0x14'));var hardwareService=require(_0x27aa('0x15'));var logger=require(_0x27aa('0x16'))(_0x27aa('0x17'));var utils=require('../../config/utils');var config=require(_0x27aa('0x18'));var licenseUtil=require(_0x27aa('0x19'));var db=require(_0x27aa('0x1a'))['db'];var jayson=require(_0x27aa('0x1b'));var client=jayson[_0x27aa('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x327fee,_0xba935,_0x540b97,_0x48f3e2){return new BPromise(function(_0x49dc44,_0x200283){var _0x597682=_0x48f3e2||client;return _0x597682[_0x27aa('0x1d')](_0x327fee,_0x540b97)['then'](function(_0x1c1abf){logger[_0x27aa('0x1e')]('VoiceContext,\x20%s,\x20%s',_0xba935,_0x27aa('0x1f'));logger[_0x27aa('0x20')](_0x27aa('0x21'),_0xba935,_0x27aa('0x1f'),JSON[_0x27aa('0x22')](_0x1c1abf));if(_0x1c1abf['error']){if(_0x1c1abf[_0x27aa('0x23')][_0x27aa('0x24')]===0x1f4){logger[_0x27aa('0x23')](_0x27aa('0x25'),_0xba935,_0x1c1abf[_0x27aa('0x23')][_0x27aa('0x26')]);return _0x200283(_0x1c1abf[_0x27aa('0x23')][_0x27aa('0x26')]);}logger[_0x27aa('0x23')](_0x27aa('0x25'),_0xba935,_0x1c1abf[_0x27aa('0x23')]['message']);return _0x49dc44(_0x1c1abf[_0x27aa('0x23')]['message']);}else{logger[_0x27aa('0x1e')]('VoiceContext,\x20%s,\x20%s',_0xba935,_0x27aa('0x1f'));_0x49dc44(_0x1c1abf[_0x27aa('0x27')]['message']);}})['catch'](function(_0x15711e){logger[_0x27aa('0x23')](_0x27aa('0x25'),_0xba935,_0x15711e);_0x200283(_0x15711e);});});}function respondWithStatusCode(_0x5583a1,_0x344f02){_0x344f02=_0x344f02||0xcc;return function(_0x5cf600){if(_0x5cf600){return _0x5583a1[_0x27aa('0x28')](_0x344f02);}return _0x5583a1[_0x27aa('0x29')](_0x344f02)[_0x27aa('0x2a')]();};}function respondWithResult(_0x290c91,_0x43bfd2){_0x43bfd2=_0x43bfd2||0xc8;return function(_0x3e9280){if(_0x3e9280){return _0x290c91[_0x27aa('0x29')](_0x43bfd2)[_0x27aa('0x2b')](_0x3e9280);}};}function respondWithFilteredResult(_0x468f3a,_0x1e30cd){return function(_0x434fb8){if(_0x434fb8){var _0x1b3ff5=typeof _0x1e30cd['offset']===_0x27aa('0x2c')&&typeof _0x1e30cd[_0x27aa('0x2d')]===_0x27aa('0x2c');var _0x1b9725=_0x434fb8[_0x27aa('0x2e')];var _0x869c10=_0x1b3ff5?0x0:_0x1e30cd[_0x27aa('0x2f')];var _0x2c0330=_0x1b3ff5?_0x434fb8['count']:_0x1e30cd[_0x27aa('0x2f')]+_0x1e30cd[_0x27aa('0x2d')];var _0x3b7ea1;if(_0x2c0330>=_0x1b9725){_0x2c0330=_0x1b9725;_0x3b7ea1=0xc8;}else{_0x3b7ea1=0xce;}_0x468f3a['status'](_0x3b7ea1);return _0x468f3a[_0x27aa('0x30')]('Content-Range',_0x869c10+'-'+_0x2c0330+'/'+_0x1b9725)['json'](_0x434fb8);}return null;};}function patchUpdates(_0x1c16d5){return function(_0xebaa1a){try{jsonpatch['apply'](_0xebaa1a,_0x1c16d5,!![]);}catch(_0x112b58){return BPromise[_0x27aa('0x31')](_0x112b58);}return _0xebaa1a[_0x27aa('0x32')]();};}function saveUpdates(_0x3b7e75,_0x202878){return function(_0x376dd8){if(_0x376dd8){return _0x376dd8[_0x27aa('0x33')](_0x3b7e75)['then'](function(_0x20759d){return _0x20759d;});}return null;};}function removeEntity(_0x401143,_0x3374a5){return function(_0x194641){if(_0x194641){return _0x194641[_0x27aa('0x34')]()[_0x27aa('0x35')](function(){var _0x1344ce=_0x194641[_0x27aa('0x36')]({'plain':!![]});var _0x3e6ede=_0x27aa('0x37');return db[_0x27aa('0x38')][_0x27aa('0x34')]({'where':{'type':_0x3e6ede,'resourceId':_0x1344ce['id']}})[_0x27aa('0x35')](function(){return _0x194641;});})[_0x27aa('0x35')](function(){_0x401143[_0x27aa('0x29')](0xcc)[_0x27aa('0x2a')]();});}};}function handleEntityNotFound(_0x42b308,_0xe7dae6){return function(_0x11c5a5){if(!_0x11c5a5){_0x42b308[_0x27aa('0x28')](0x194);}return _0x11c5a5;};}function handleError(_0x5272a1,_0x39279a){_0x39279a=_0x39279a||0x1f4;return function(_0x3865c6){logger['error'](_0x3865c6[_0x27aa('0x39')]);if(_0x3865c6['name']){delete _0x3865c6[_0x27aa('0x3a')];}_0x5272a1[_0x27aa('0x29')](_0x39279a)[_0x27aa('0x3b')](_0x3865c6);};}exports[_0x27aa('0x3c')]=function(_0x600b38,_0x4f6366){var _0x336a45={},_0x49fa6b={},_0x5374fb={'count':0x0,'rows':[]};var _0x57d4f7=_[_0x27aa('0x3d')](db[_0x27aa('0x3e')][_0x27aa('0x3f')],function(_0x11d025){return{'name':_0x11d025[_0x27aa('0x40')],'type':_0x11d025[_0x27aa('0x41')][_0x27aa('0x42')]};});_0x49fa6b[_0x27aa('0x43')]=_['map'](_0x57d4f7,'name');_0x49fa6b[_0x27aa('0x44')]=_[_0x27aa('0x45')](_0x600b38['query']);_0x49fa6b[_0x27aa('0x46')]=_[_0x27aa('0x47')](_0x49fa6b[_0x27aa('0x43')],_0x49fa6b[_0x27aa('0x44')]);_0x336a45[_0x27aa('0x48')]=_[_0x27aa('0x47')](_0x49fa6b[_0x27aa('0x43')],qs[_0x27aa('0x49')](_0x600b38[_0x27aa('0x44')][_0x27aa('0x49')]));_0x336a45['attributes']=_0x336a45[_0x27aa('0x48')][_0x27aa('0x4a')]?_0x336a45[_0x27aa('0x48')]:_0x49fa6b[_0x27aa('0x43')];if(!_0x600b38[_0x27aa('0x44')][_0x27aa('0x4b')]('nolimit')){_0x336a45[_0x27aa('0x2d')]=qs['limit'](_0x600b38[_0x27aa('0x44')]['limit']);_0x336a45[_0x27aa('0x2f')]=qs[_0x27aa('0x2f')](_0x600b38[_0x27aa('0x44')][_0x27aa('0x2f')]);}_0x336a45[_0x27aa('0x4c')]=qs['sort'](_0x600b38['query'][_0x27aa('0x4d')]);_0x336a45['where']=qs[_0x27aa('0x46')](_[_0x27aa('0x4e')](_0x600b38[_0x27aa('0x44')],_0x49fa6b[_0x27aa('0x46')]),_0x57d4f7);if(_0x600b38[_0x27aa('0x44')]['filter']){_0x336a45[_0x27aa('0x4f')]=_[_0x27aa('0x50')](_0x336a45['where'],{'$or':_[_0x27aa('0x3d')](_0x57d4f7,function(_0x506158){if(_0x506158[_0x27aa('0x41')]!==_0x27aa('0x51')){var _0x1a3384={};_0x1a3384[_0x506158[_0x27aa('0x3a')]]={'$like':'%'+_0x600b38[_0x27aa('0x44')][_0x27aa('0x52')]+'%'};return _0x1a3384;}})});}_0x336a45=_[_0x27aa('0x50')]({},_0x336a45,_0x600b38[_0x27aa('0x53')]);var _0x1e1e9d={'where':_0x336a45[_0x27aa('0x4f')]};return db['VoiceContext']['count'](_0x1e1e9d)['then'](function(_0x3234bf){_0x5374fb[_0x27aa('0x2e')]=_0x3234bf;if(_0x600b38[_0x27aa('0x44')][_0x27aa('0x54')]){_0x336a45['include']=[{'all':!![]}];}return db[_0x27aa('0x3e')][_0x27aa('0x55')](_0x336a45);})['then'](function(_0x4747bf){_0x5374fb[_0x27aa('0x56')]=_0x4747bf;return _0x5374fb;})[_0x27aa('0x35')](respondWithFilteredResult(_0x4f6366,_0x336a45))[_0x27aa('0x57')](handleError(_0x4f6366,null));};exports[_0x27aa('0x58')]=function(_0x45ef7d,_0x1064b6){var _0x103529={'raw':![],'where':{'id':_0x45ef7d[_0x27aa('0x59')]['id']}},_0x4ec609={};_0x4ec609['model']=_['keys'](db[_0x27aa('0x3e')][_0x27aa('0x3f')]);_0x4ec609[_0x27aa('0x44')]=_['keys'](_0x45ef7d[_0x27aa('0x44')]);_0x4ec609['filters']=_[_0x27aa('0x47')](_0x4ec609['model'],_0x4ec609[_0x27aa('0x44')]);_0x103529['attributes']=_['intersection'](_0x4ec609['model'],qs['fields'](_0x45ef7d['query'][_0x27aa('0x49')]));_0x103529[_0x27aa('0x48')]=_0x103529[_0x27aa('0x48')][_0x27aa('0x4a')]?_0x103529[_0x27aa('0x48')]:_0x4ec609[_0x27aa('0x43')];if(_0x45ef7d[_0x27aa('0x44')][_0x27aa('0x54')]){_0x103529[_0x27aa('0x5a')]=[{'all':!![]}];}_0x103529=_[_0x27aa('0x50')]({},_0x103529,_0x45ef7d[_0x27aa('0x53')]);return db['VoiceContext'][_0x27aa('0x5b')](_0x103529)[_0x27aa('0x35')](handleEntityNotFound(_0x1064b6,null))[_0x27aa('0x35')](respondWithResult(_0x1064b6,null))['catch'](handleError(_0x1064b6,null));};exports[_0x27aa('0x5c')]=function(_0x5efb44,_0x2841c4,_0x35d5f6){var _0x2dd61e;return db[_0x27aa('0x3e')][_0x27aa('0x5c')](_0x5efb44[_0x27aa('0x5d')],{'raw':!![]})[_0x27aa('0x35')](function(_0x30b1ac){_0x2dd61e=_0x30b1ac;return db[_0x27aa('0x3e')][_0x27aa('0x55')]({'raw':!![]});})['then'](function(_0x350015){var _0x206693=fs[_0x27aa('0x5e')](path[_0x27aa('0x5f')](config[_0x27aa('0x60')],_0x27aa('0x61')),'utf8');var _0x52dc53=ejs[_0x27aa('0x62')](_0x206693,{'contexts':_0x350015||[]});fs[_0x27aa('0x63')](_0x27aa('0x64'),_0x52dc53);})[_0x27aa('0x35')](function(){return respondWithRpcPromise('Reload',_0x27aa('0x5c'),{'module':'chan_sip.so'});})[_0x27aa('0x35')](function(){var _0x576374=_0x5efb44['user'][_0x27aa('0x36')]({'plain':!![]});if(!_0x576374)throw new Error(_0x27aa('0x65'));if(_0x576374[_0x27aa('0x66')]===_0x27aa('0x67')){var _0x378d5b=_0x2dd61e[_0x27aa('0x36')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x27aa('0x37'),'userProfileId':_0x576374[_0x27aa('0x68')]},'raw':!![]})[_0x27aa('0x35')](function(_0x2ea339){if(_0x2ea339&&_0x2ea339['autoAssociation']===0x0){return db[_0x27aa('0x38')][_0x27aa('0x5c')]({'name':_0x378d5b['name'],'resourceId':_0x378d5b['id'],'type':_0x2ea339[_0x27aa('0x3a')],'sectionId':_0x2ea339['id']},{})['then'](function(){return _0x2dd61e;});}else{return _0x2dd61e;}})['catch'](function(_0x3cd350){logger[_0x27aa('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3cd350);throw _0x3cd350;});}return _0x2dd61e;})[_0x27aa('0x35')](respondWithResult(_0x2841c4,0xc9))[_0x27aa('0x57')](handleError(_0x2841c4,null));};exports[_0x27aa('0x33')]=function(_0x123753,_0x404e8e,_0x2ddaa8){var _0x461d0d;return db['VoiceContext'][_0x27aa('0x5b')]({'where':{'id':_0x123753['params']['id']}})[_0x27aa('0x35')](handleEntityNotFound(_0x404e8e,null))[_0x27aa('0x35')](saveUpdates(_0x123753[_0x27aa('0x5d')],null))['then'](function(_0x6e5875){if(_0x6e5875){_0x461d0d=_0x6e5875;return db[_0x27aa('0x3e')]['findAll']({'raw':!![]});}})['then'](function(_0x5ee999){var _0x3cafa1=fs['readFileSync'](path[_0x27aa('0x5f')](config[_0x27aa('0x60')],_0x27aa('0x61')),_0x27aa('0x69'));var _0x948cd4=ejs['render'](_0x3cafa1,{'contexts':_0x5ee999||[]});fs[_0x27aa('0x63')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x948cd4);})[_0x27aa('0x35')](function(){return respondWithRpcPromise(_0x27aa('0x6a'),_0x27aa('0x33'),{'module':_0x27aa('0x6b')});})['then'](function(){return _0x461d0d;})[_0x27aa('0x35')](respondWithResult(_0x404e8e,null))[_0x27aa('0x57')](handleError(_0x404e8e,null));};exports['destroy']=function(_0x41fc91,_0x5b36bd,_0x8bd6ac){var _0x4e1337;return db[_0x27aa('0x3e')]['find']({'where':{'id':_0x41fc91[_0x27aa('0x59')]['id']}})[_0x27aa('0x35')](handleEntityNotFound(_0x5b36bd,null))[_0x27aa('0x35')](removeEntity(_0x5b36bd,null))[_0x27aa('0x35')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x27aa('0x35')](function(_0x543b2e){var _0x7ec80d=fs[_0x27aa('0x5e')](path[_0x27aa('0x5f')](config[_0x27aa('0x60')],_0x27aa('0x61')),_0x27aa('0x69'));var _0xb71b30=ejs['render'](_0x7ec80d,{'contexts':_0x543b2e});fs[_0x27aa('0x63')](_0x27aa('0x64'),_0xb71b30);return respondWithRpcPromise(_0x27aa('0x6a'),_0x27aa('0x34'),{'module':_0x27aa('0x6b')});})[_0x27aa('0x57')](handleError(_0x5b36bd,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 6200179..5675011 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 _0x099b=['VoiceContext','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','define'];(function(_0x10fbc4,_0x21236d){var _0xbe4b3=function(_0x1eceec){while(--_0x1eceec){_0x10fbc4['push'](_0x10fbc4['shift']());}};_0xbe4b3(++_0x21236d);}(_0x099b,0xe8));var _0xb099=function(_0x438fd5,_0x3b3ebe){_0x438fd5=_0x438fd5-0x0;var _0x47033f=_0x099b[_0x438fd5];return _0x47033f;};'use strict';var _=require(_0xb099('0x0'));var util=require(_0xb099('0x1'));var logger=require('../../config/logger')(_0xb099('0x2'));var moment=require(_0xb099('0x3'));var BPromise=require(_0xb099('0x4'));var rp=require(_0xb099('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb099('0x6'));var config=require(_0xb099('0x7'));var attributes=require(_0xb099('0x8'));module['exports']=function(_0x3d987b,_0x1e28c2){return _0x3d987b[_0xb099('0x9')](_0xb099('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7574=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceContext.attributes','define','VoiceContext'];(function(_0x5dd06b,_0x1d95ff){var _0xca112a=function(_0x12958b){while(--_0x12958b){_0x5dd06b['push'](_0x5dd06b['shift']());}};_0xca112a(++_0x1d95ff);}(_0x7574,0x1ec));var _0x4757=function(_0x297f95,_0x4be7b2){_0x297f95=_0x297f95-0x0;var _0x2d37bc=_0x7574[_0x297f95];return _0x2d37bc;};'use strict';var _=require(_0x4757('0x0'));var util=require(_0x4757('0x1'));var logger=require(_0x4757('0x2'))(_0x4757('0x3'));var moment=require(_0x4757('0x4'));var BPromise=require(_0x4757('0x5'));var rp=require(_0x4757('0x6'));var fs=require('fs');var path=require(_0x4757('0x7'));var rimraf=require(_0x4757('0x8'));var config=require('../../config/environment');var attributes=require(_0x4757('0x9'));module['exports']=function(_0x10b400,_0x10e5b9){return _0x10b400[_0x4757('0xa')](_0x4757('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 2526eb3..b9e4534 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 _0xd5e5=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x324a52,_0x450d80){var _0x2b62e7=function(_0x6f0287){while(--_0x6f0287){_0x324a52['push'](_0x324a52['shift']());}};_0x2b62e7(++_0x450d80);}(_0xd5e5,0x187));var _0x5d5e=function(_0x549a2c,_0x13bd03){_0x549a2c=_0x549a2c-0x0;var _0x16b56b=_0xd5e5[_0x549a2c];return _0x16b56b;};'use strict';var _=require('lodash');var util=require(_0x5d5e('0x0'));var moment=require('moment');var BPromise=require(_0x5d5e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d5e('0x2'));var db=require(_0x5d5e('0x3'))['db'];var utils=require(_0x5d5e('0x4'));var logger=require(_0x5d5e('0x5'))(_0x5d5e('0x6'));var config=require(_0x5d5e('0x7'));var jayson=require(_0x5d5e('0x8'));var client=jayson['client'][_0x5d5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x82e1c0,_0x232f1b,_0x2a6202){return new BPromise(function(_0x308f82,_0x39917c){return client[_0x5d5e('0xa')](_0x82e1c0,_0x2a6202)[_0x5d5e('0xb')](function(_0x35c3f1){logger['info'](_0x5d5e('0xc'),_0x232f1b,_0x5d5e('0xd'));logger[_0x5d5e('0xe')](_0x5d5e('0xf'),_0x232f1b,_0x5d5e('0xd'),JSON[_0x5d5e('0x10')](_0x35c3f1));if(_0x35c3f1[_0x5d5e('0x11')]){if(_0x35c3f1[_0x5d5e('0x11')][_0x5d5e('0x12')]===0x1f4){logger[_0x5d5e('0x11')](_0x5d5e('0xc'),_0x232f1b,_0x35c3f1[_0x5d5e('0x11')][_0x5d5e('0x13')]);return _0x39917c(_0x35c3f1[_0x5d5e('0x11')][_0x5d5e('0x13')]);}logger[_0x5d5e('0x11')](_0x5d5e('0xc'),_0x232f1b,_0x35c3f1[_0x5d5e('0x11')][_0x5d5e('0x13')]);return _0x308f82(_0x35c3f1['error']['message']);}else{logger[_0x5d5e('0x14')]('VoiceContext,\x20%s,\x20%s',_0x232f1b,'request\x20sent');_0x308f82(_0x35c3f1[_0x5d5e('0x15')]['message']);}})['catch'](function(_0x2d2bd8){logger[_0x5d5e('0x11')](_0x5d5e('0xc'),_0x232f1b,_0x2d2bd8);_0x39917c(_0x2d2bd8);});});} \ No newline at end of file +var _0xa6ea=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','catch','lodash','util','moment','bluebird'];(function(_0x42c4cd,_0x3c8fba){var _0x4fe7c8=function(_0x19a6fd){while(--_0x19a6fd){_0x42c4cd['push'](_0x42c4cd['shift']());}};_0x4fe7c8(++_0x3c8fba);}(_0xa6ea,0x122));var _0xaa6e=function(_0x3357ab,_0x1b9cf8){_0x3357ab=_0x3357ab-0x0;var _0x5e5a27=_0xa6ea[_0x3357ab];return _0x5e5a27;};'use strict';var _=require(_0xaa6e('0x0'));var util=require(_0xaa6e('0x1'));var moment=require(_0xaa6e('0x2'));var BPromise=require(_0xaa6e('0x3'));var rs=require(_0xaa6e('0x4'));var fs=require('fs');var Redis=require(_0xaa6e('0x5'));var db=require(_0xaa6e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa6e('0x7'))(_0xaa6e('0x8'));var config=require(_0xaa6e('0x9'));var jayson=require(_0xaa6e('0xa'));var client=jayson[_0xaa6e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x543fc1,_0x582240,_0x1e3706){return new BPromise(function(_0x22d3e4,_0x2c9dcd){return client[_0xaa6e('0xc')](_0x543fc1,_0x1e3706)[_0xaa6e('0xd')](function(_0x139806){logger['info'](_0xaa6e('0xe'),_0x582240,'request\x20sent');logger['debug'](_0xaa6e('0xf'),_0x582240,'request\x20sent',JSON['stringify'](_0x139806));if(_0x139806[_0xaa6e('0x10')]){if(_0x139806[_0xaa6e('0x10')]['code']===0x1f4){logger[_0xaa6e('0x10')]('VoiceContext,\x20%s,\x20%s',_0x582240,_0x139806[_0xaa6e('0x10')][_0xaa6e('0x11')]);return _0x2c9dcd(_0x139806[_0xaa6e('0x10')][_0xaa6e('0x11')]);}logger[_0xaa6e('0x10')](_0xaa6e('0xe'),_0x582240,_0x139806[_0xaa6e('0x10')][_0xaa6e('0x11')]);return _0x22d3e4(_0x139806[_0xaa6e('0x10')]['message']);}else{logger[_0xaa6e('0x12')](_0xaa6e('0xe'),_0x582240,_0xaa6e('0x13'));_0x22d3e4(_0x139806['result'][_0xaa6e('0x11')]);}})[_0xaa6e('0x14')](function(_0x475b7d){logger[_0xaa6e('0x10')]('VoiceContext,\x20%s,\x20%s',_0x582240,_0x475b7d);_0x2c9dcd(_0x475b7d);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 6fe37f7..a1c5a65 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 _0x5a52=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','post','update','delete','destroy','multer','util','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a52,0xc3));var _0x25a5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a52[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x25a5('0x0'));var util=require(_0x25a5('0x1'));var path=require('path');var timeout=require(_0x25a5('0x2'));var express=require(_0x25a5('0x3'));var router=express[_0x25a5('0x4')]();var fs_extra=require(_0x25a5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x25a5('0x6'));var config=require(_0x25a5('0x7'));var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0x25a5('0x8')](),controller[_0x25a5('0x9')]);router['get'](_0x25a5('0xa'),auth[_0x25a5('0x8')](),controller[_0x25a5('0xb')]);router[_0x25a5('0xc')](_0x25a5('0xd'),auth[_0x25a5('0x8')](),controller['show']);router[_0x25a5('0xe')]('/',auth[_0x25a5('0x8')](),controller['create']);router['put']('/:id',auth[_0x25a5('0x8')](),controller[_0x25a5('0xf')]);router[_0x25a5('0x10')](_0x25a5('0xd'),auth[_0x25a5('0x8')](),controller[_0x25a5('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9ba9=['express','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','exports','util','path'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x9ba9,0xb2));var _0x99ba=function(_0x223c73,_0x5981b3){_0x223c73=_0x223c73-0x0;var _0x5bcf9c=_0x9ba9[_0x223c73];return _0x5bcf9c;};'use strict';var multer=require('multer');var util=require(_0x99ba('0x0'));var path=require(_0x99ba('0x1'));var timeout=require('connect-timeout');var express=require(_0x99ba('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x99ba('0x3'));var interaction=require(_0x99ba('0x4'));var config=require('../../config/environment');var controller=require(_0x99ba('0x5'));router['get']('/',auth[_0x99ba('0x6')](),controller[_0x99ba('0x7')]);router[_0x99ba('0x8')](_0x99ba('0x9'),auth[_0x99ba('0x6')](),controller[_0x99ba('0xa')]);router['get'](_0x99ba('0xb'),auth[_0x99ba('0x6')](),controller[_0x99ba('0xc')]);router[_0x99ba('0xd')]('/',auth[_0x99ba('0x6')](),controller[_0x99ba('0xe')]);router[_0x99ba('0xf')](_0x99ba('0xb'),auth[_0x99ba('0x6')](),controller[_0x99ba('0x10')]);router['delete']('/:id',auth[_0x99ba('0x6')](),controller['destroy']);module[_0x99ba('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 5741898..c6481b5 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 _0xdace=['DATE','called,connect,complete','sequelize','STRING','INTEGER'];(function(_0x3388d8,_0x256024){var _0x2bbe73=function(_0x3c0cb2){while(--_0x3c0cb2){_0x3388d8['push'](_0x3388d8['shift']());}};_0x2bbe73(++_0x256024);}(_0xdace,0xc5));var _0xedac=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xdace[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xedac('0x1')]},'channel':{'type':Sequelize[_0xedac('0x1')]},'channelstate':{'type':Sequelize[_0xedac('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xedac('0x1')]},'calleridname':{'type':Sequelize[_0xedac('0x1')]},'connectedlinenum':{'type':Sequelize[_0xedac('0x1')]},'connectedlinename':{'type':Sequelize[_0xedac('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xedac('0x1')]},'context':{'type':Sequelize[_0xedac('0x1')]},'exten':{'type':Sequelize[_0xedac('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xedac('0x1')]},'linkedid':{'type':Sequelize[_0xedac('0x1')]},'destchannel':{'type':Sequelize[_0xedac('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xedac('0x1')]},'destcalleridnum':{'type':Sequelize[_0xedac('0x1')]},'destcalleridname':{'type':Sequelize[_0xedac('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xedac('0x1')]},'destaccountcode':{'type':Sequelize[_0xedac('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xedac('0x2')]},'destuniqueid':{'type':Sequelize[_0xedac('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xedac('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xedac('0x3')]},'answertime':{'type':Sequelize[_0xedac('0x3')]},'endtime':{'type':Sequelize[_0xedac('0x3')]},'lastevent':{'type':Sequelize[_0xedac('0x1')],'comment':_0xedac('0x4')},'routeId':{'type':Sequelize[_0xedac('0x2')]},'duration':{'type':Sequelize[_0xedac('0x2')]},'holdtime':{'type':Sequelize[_0xedac('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x34e8=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x44a2fb,_0x487474){var _0x4f4dff=function(_0x59e847){while(--_0x59e847){_0x44a2fb['push'](_0x44a2fb['shift']());}};_0x4f4dff(++_0x487474);}(_0x34e8,0x12c));var _0x834e=function(_0x3aaf70,_0x46023e){_0x3aaf70=_0x3aaf70-0x0;var _0x437c40=_0x34e8[_0x3aaf70];return _0x437c40;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'privilege':{'type':Sequelize[_0x834e('0x2')]},'channel':{'type':Sequelize[_0x834e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'calleridnum':{'type':Sequelize[_0x834e('0x2')]},'calleridname':{'type':Sequelize[_0x834e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'connectedlinename':{'type':Sequelize[_0x834e('0x2')]},'language':{'type':Sequelize[_0x834e('0x2')]},'accountcode':{'type':Sequelize[_0x834e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x834e('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x834e('0x2')]},'linkedid':{'type':Sequelize[_0x834e('0x2')]},'destchannel':{'type':Sequelize[_0x834e('0x2')]},'destchannelstate':{'type':Sequelize[_0x834e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x834e('0x2')]},'destcalleridname':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x834e('0x2')]},'destlanguage':{'type':Sequelize[_0x834e('0x2')]},'destaccountcode':{'type':Sequelize[_0x834e('0x2')]},'destcontext':{'type':Sequelize[_0x834e('0x2')]},'destexten':{'type':Sequelize[_0x834e('0x2')]},'destpriority':{'type':Sequelize[_0x834e('0x3')]},'destuniqueid':{'type':Sequelize[_0x834e('0x2')]},'destlinkedid':{'type':Sequelize[_0x834e('0x2')]},'dialstring':{'type':Sequelize[_0x834e('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x834e('0x4')]},'answertime':{'type':Sequelize[_0x834e('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x834e('0x2')],'comment':_0x834e('0x5')},'routeId':{'type':Sequelize[_0x834e('0x3')]},'duration':{'type':Sequelize[_0x834e('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x834e('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 322ae8c..4c14171 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 _0xd629=['ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','VoiceDialReport','includeAll','findAll','rows','catch','params','rawAttributes','include','options','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv'];(function(_0xbeab56,_0x3b37ff){var _0x203be1=function(_0x4aadc6){while(--_0x4aadc6){_0xbeab56['push'](_0xbeab56['shift']());}};_0x203be1(++_0x3b37ff);}(_0xd629,0x11b));var _0x9d62=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xd629[_0x34843e];return _0x598f7f;};'use strict';var emlformat=require(_0x9d62('0x0'));var rimraf=require(_0x9d62('0x1'));var zipdir=require(_0x9d62('0x2'));var jsonpatch=require(_0x9d62('0x3'));var rp=require(_0x9d62('0x4'));var moment=require(_0x9d62('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9d62('0x6'));var path=require(_0x9d62('0x7'));var sox=require('sox');var csv=require(_0x9d62('0x8'));var ejs=require(_0x9d62('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d62('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9d62('0xb'));var deskjs=require(_0x9d62('0xc'));var toCsv=require(_0x9d62('0x8'));var querystring=require(_0x9d62('0xd'));var Papa=require(_0x9d62('0xe'));var Redis=require(_0x9d62('0xf'));var authService=require(_0x9d62('0x10'));var qs=require(_0x9d62('0x11'));var as=require(_0x9d62('0x12'));var hardwareService=require(_0x9d62('0x13'));var logger=require('../../config/logger')(_0x9d62('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9d62('0x15'))['db'];function respondWithStatusCode(_0x24c4c5,_0x18d539){_0x18d539=_0x18d539||0xcc;return function(_0x37f746){if(_0x37f746){return _0x24c4c5[_0x9d62('0x16')](_0x18d539);}return _0x24c4c5[_0x9d62('0x17')](_0x18d539)[_0x9d62('0x18')]();};}function respondWithResult(_0x336005,_0x1ef747){_0x1ef747=_0x1ef747||0xc8;return function(_0x51f746){if(_0x51f746){return _0x336005[_0x9d62('0x17')](_0x1ef747)['json'](_0x51f746);}};}function respondWithFilteredResult(_0x4b203b,_0x20c158){return function(_0x15615f){if(_0x15615f){var _0x4cefa0=typeof _0x20c158[_0x9d62('0x19')]===_0x9d62('0x1a')&&typeof _0x20c158[_0x9d62('0x1b')]===_0x9d62('0x1a');var _0x568a25=_0x15615f[_0x9d62('0x1c')];var _0x4b75a7=_0x4cefa0?0x0:_0x20c158[_0x9d62('0x19')];var _0x556da5=_0x4cefa0?_0x15615f[_0x9d62('0x1c')]:_0x20c158[_0x9d62('0x19')]+_0x20c158[_0x9d62('0x1b')];var _0x494c5e;if(_0x556da5>=_0x568a25){_0x556da5=_0x568a25;_0x494c5e=0xc8;}else{_0x494c5e=0xce;}_0x4b203b['status'](_0x494c5e);return _0x4b203b[_0x9d62('0x1d')](_0x9d62('0x1e'),_0x4b75a7+'-'+_0x556da5+'/'+_0x568a25)[_0x9d62('0x1f')](_0x15615f);}return null;};}function patchUpdates(_0x5a1ba9){return function(_0x4976a7){try{jsonpatch[_0x9d62('0x20')](_0x4976a7,_0x5a1ba9,!![]);}catch(_0x324bd3){return BPromise[_0x9d62('0x21')](_0x324bd3);}return _0x4976a7[_0x9d62('0x22')]();};}function saveUpdates(_0x3050bf,_0xa4926a){return function(_0x567b74){if(_0x567b74){return _0x567b74[_0x9d62('0x23')](_0x3050bf)[_0x9d62('0x24')](function(_0x477933){return _0x477933;});}return null;};}function removeEntity(_0x3be79a,_0x2c7750){return function(_0x5d8218){if(_0x5d8218){return _0x5d8218[_0x9d62('0x25')]()[_0x9d62('0x24')](function(){_0x3be79a[_0x9d62('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10134d,_0x4473e1){return function(_0x592c3c){if(!_0x592c3c){_0x10134d['sendStatus'](0x194);}return _0x592c3c;};}function handleError(_0x3aaaa4,_0x414f9f){_0x414f9f=_0x414f9f||0x1f4;return function(_0x41b26d){logger[_0x9d62('0x26')](_0x41b26d[_0x9d62('0x27')]);if(_0x41b26d[_0x9d62('0x28')]){delete _0x41b26d[_0x9d62('0x28')];}_0x3aaaa4[_0x9d62('0x17')](_0x414f9f)[_0x9d62('0x29')](_0x41b26d);};}exports[_0x9d62('0x2a')]=function(_0x295f18,_0x2efbb0){var _0x3d3bbe={},_0x3188b8={},_0x8b2116={'count':0x0,'rows':[]};var _0x381a23=_[_0x9d62('0x2b')](db['VoiceDialReport']['rawAttributes'],function(_0x3a3c52){return{'name':_0x3a3c52['fieldName'],'type':_0x3a3c52['type']['key']};});_0x3188b8['model']=_[_0x9d62('0x2b')](_0x381a23,'name');_0x3188b8['query']=_[_0x9d62('0x2c')](_0x295f18[_0x9d62('0x2d')]);_0x3188b8['filters']=_[_0x9d62('0x2e')](_0x3188b8[_0x9d62('0x2f')],_0x3188b8['query']);_0x3d3bbe[_0x9d62('0x30')]=_[_0x9d62('0x2e')](_0x3188b8['model'],qs[_0x9d62('0x31')](_0x295f18[_0x9d62('0x2d')][_0x9d62('0x31')]));_0x3d3bbe[_0x9d62('0x30')]=_0x3d3bbe[_0x9d62('0x30')][_0x9d62('0x32')]?_0x3d3bbe[_0x9d62('0x30')]:_0x3188b8[_0x9d62('0x2f')];if(!_0x295f18['query'][_0x9d62('0x33')](_0x9d62('0x34'))){_0x3d3bbe[_0x9d62('0x1b')]=qs[_0x9d62('0x1b')](_0x295f18[_0x9d62('0x2d')]['limit']);_0x3d3bbe[_0x9d62('0x19')]=qs[_0x9d62('0x19')](_0x295f18[_0x9d62('0x2d')][_0x9d62('0x19')]);}_0x3d3bbe[_0x9d62('0x35')]=qs[_0x9d62('0x36')](_0x295f18[_0x9d62('0x2d')][_0x9d62('0x36')]);_0x3d3bbe['where']=qs[_0x9d62('0x37')](_[_0x9d62('0x38')](_0x295f18[_0x9d62('0x2d')],_0x3188b8['filters']),_0x381a23);if(_0x295f18[_0x9d62('0x2d')][_0x9d62('0x39')]){_0x3d3bbe[_0x9d62('0x3a')]=_[_0x9d62('0x3b')](_0x3d3bbe['where'],{'$or':_[_0x9d62('0x2b')](_0x381a23,function(_0x2f9f57){if(_0x2f9f57['type']!==_0x9d62('0x3c')){var _0x40fbba={};_0x40fbba[_0x2f9f57[_0x9d62('0x28')]]={'$like':'%'+_0x295f18['query'][_0x9d62('0x39')]+'%'};return _0x40fbba;}})});}_0x3d3bbe=_[_0x9d62('0x3b')]({},_0x3d3bbe,_0x295f18['options']);var _0x11aec8={'where':_0x3d3bbe[_0x9d62('0x3a')]};return db[_0x9d62('0x3d')][_0x9d62('0x1c')](_0x11aec8)[_0x9d62('0x24')](function(_0x5904ee){_0x8b2116['count']=_0x5904ee;if(_0x295f18[_0x9d62('0x2d')][_0x9d62('0x3e')]){_0x3d3bbe['include']=[{'all':!![]}];}return db[_0x9d62('0x3d')][_0x9d62('0x3f')](_0x3d3bbe);})[_0x9d62('0x24')](function(_0x2d8af4){_0x8b2116[_0x9d62('0x40')]=_0x2d8af4;return _0x8b2116;})[_0x9d62('0x24')](respondWithFilteredResult(_0x2efbb0,_0x3d3bbe))[_0x9d62('0x41')](handleError(_0x2efbb0,null));};exports['show']=function(_0x17199a,_0x376e91){var _0x5640e1={'raw':!![],'where':{'id':_0x17199a[_0x9d62('0x42')]['id']}},_0x40d53d={};_0x40d53d['model']=_[_0x9d62('0x2c')](db[_0x9d62('0x3d')][_0x9d62('0x43')]);_0x40d53d[_0x9d62('0x2d')]=_[_0x9d62('0x2c')](_0x17199a[_0x9d62('0x2d')]);_0x40d53d[_0x9d62('0x37')]=_['intersection'](_0x40d53d[_0x9d62('0x2f')],_0x40d53d[_0x9d62('0x2d')]);_0x5640e1[_0x9d62('0x30')]=_[_0x9d62('0x2e')](_0x40d53d[_0x9d62('0x2f')],qs[_0x9d62('0x31')](_0x17199a[_0x9d62('0x2d')]['fields']));_0x5640e1['attributes']=_0x5640e1[_0x9d62('0x30')][_0x9d62('0x32')]?_0x5640e1['attributes']:_0x40d53d[_0x9d62('0x2f')];if(_0x17199a['query']['includeAll']){_0x5640e1[_0x9d62('0x44')]=[{'all':!![]}];}_0x5640e1=_[_0x9d62('0x3b')]({},_0x5640e1,_0x17199a[_0x9d62('0x45')]);return db[_0x9d62('0x3d')]['find'](_0x5640e1)[_0x9d62('0x24')](handleEntityNotFound(_0x376e91,null))['then'](respondWithResult(_0x376e91,null))[_0x9d62('0x41')](handleError(_0x376e91,null));};exports['create']=function(_0x7248a7,_0x193ed3){return db['VoiceDialReport']['create'](_0x7248a7[_0x9d62('0x46')],{})[_0x9d62('0x24')](respondWithResult(_0x193ed3,0xc9))['catch'](handleError(_0x193ed3,null));};exports[_0x9d62('0x23')]=function(_0x48699c,_0x298994){if(_0x48699c['body']['id']){delete _0x48699c[_0x9d62('0x46')]['id'];}return db['VoiceDialReport'][_0x9d62('0x47')]({'where':{'id':_0x48699c[_0x9d62('0x42')]['id']}})['then'](handleEntityNotFound(_0x298994,null))[_0x9d62('0x24')](saveUpdates(_0x48699c['body'],null))[_0x9d62('0x24')](respondWithResult(_0x298994,null))[_0x9d62('0x41')](handleError(_0x298994,null));};exports[_0x9d62('0x25')]=function(_0x23e5f8,_0x2cd267){return db[_0x9d62('0x3d')]['find']({'where':{'id':_0x23e5f8[_0x9d62('0x42')]['id']}})[_0x9d62('0x24')](handleEntityNotFound(_0x2cd267,null))[_0x9d62('0x24')](removeEntity(_0x2cd267,null))[_0x9d62('0x41')](handleError(_0x2cd267,null));};exports[_0x9d62('0x48')]=function(_0x336997,_0x14d88b){return db['VoiceDialReport'][_0x9d62('0x48')]()[_0x9d62('0x24')](respondWithResult(_0x14d88b,null))[_0x9d62('0x41')](handleError(_0x14d88b,null));}; \ No newline at end of file +var _0xd700=['includeAll','include','findAll','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x433795,_0x253d09){var _0x27661e=function(_0x1c4870){while(--_0x1c4870){_0x433795['push'](_0x433795['shift']());}};_0x27661e(++_0x253d09);}(_0xd700,0xe6));var _0x0d70=function(_0x39bf66,_0x35c96c){_0x39bf66=_0x39bf66-0x0;var _0x431030=_0xd700[_0x39bf66];return _0x431030;};'use strict';var emlformat=require(_0x0d70('0x0'));var rimraf=require(_0x0d70('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0d70('0x2'));var Mustache=require(_0x0d70('0x3'));var util=require(_0x0d70('0x4'));var path=require(_0x0d70('0x5'));var sox=require(_0x0d70('0x6'));var csv=require(_0x0d70('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d70('0x8'));var squel=require(_0x0d70('0x9'));var crypto=require('crypto');var jsforce=require(_0x0d70('0xa'));var deskjs=require(_0x0d70('0xb'));var toCsv=require(_0x0d70('0x7'));var querystring=require(_0x0d70('0xc'));var Papa=require(_0x0d70('0xd'));var Redis=require(_0x0d70('0xe'));var authService=require(_0x0d70('0xf'));var qs=require(_0x0d70('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d70('0x11'));var logger=require(_0x0d70('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x0d70('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d70('0x14'))['db'];function respondWithStatusCode(_0x4d7aaa,_0xf872ce){_0xf872ce=_0xf872ce||0xcc;return function(_0x47763){if(_0x47763){return _0x4d7aaa[_0x0d70('0x15')](_0xf872ce);}return _0x4d7aaa[_0x0d70('0x16')](_0xf872ce)['end']();};}function respondWithResult(_0x47a273,_0x4bd976){_0x4bd976=_0x4bd976||0xc8;return function(_0x488a52){if(_0x488a52){return _0x47a273[_0x0d70('0x16')](_0x4bd976)[_0x0d70('0x17')](_0x488a52);}};}function respondWithFilteredResult(_0x1aa77e,_0x45f241){return function(_0x38426a){if(_0x38426a){var _0x330d86=typeof _0x45f241[_0x0d70('0x18')]===_0x0d70('0x19')&&typeof _0x45f241['limit']===_0x0d70('0x19');var _0x48ae13=_0x38426a[_0x0d70('0x1a')];var _0x54286b=_0x330d86?0x0:_0x45f241[_0x0d70('0x18')];var _0x2a3169=_0x330d86?_0x38426a['count']:_0x45f241[_0x0d70('0x18')]+_0x45f241[_0x0d70('0x1b')];var _0x5186e2;if(_0x2a3169>=_0x48ae13){_0x2a3169=_0x48ae13;_0x5186e2=0xc8;}else{_0x5186e2=0xce;}_0x1aa77e[_0x0d70('0x16')](_0x5186e2);return _0x1aa77e['set']('Content-Range',_0x54286b+'-'+_0x2a3169+'/'+_0x48ae13)['json'](_0x38426a);}return null;};}function patchUpdates(_0x31c9e5){return function(_0x35e6c5){try{jsonpatch[_0x0d70('0x1c')](_0x35e6c5,_0x31c9e5,!![]);}catch(_0x4f5254){return BPromise[_0x0d70('0x1d')](_0x4f5254);}return _0x35e6c5[_0x0d70('0x1e')]();};}function saveUpdates(_0x2b9f17,_0x4a2818){return function(_0x3b3027){if(_0x3b3027){return _0x3b3027[_0x0d70('0x1f')](_0x2b9f17)[_0x0d70('0x20')](function(_0x37c1d8){return _0x37c1d8;});}return null;};}function removeEntity(_0x42e5ea,_0x4bdbcd){return function(_0x6011d7){if(_0x6011d7){return _0x6011d7[_0x0d70('0x21')]()[_0x0d70('0x20')](function(){_0x42e5ea[_0x0d70('0x16')](0xcc)[_0x0d70('0x22')]();});}};}function handleEntityNotFound(_0x50aac2,_0xcc97ce){return function(_0x158703){if(!_0x158703){_0x50aac2[_0x0d70('0x15')](0x194);}return _0x158703;};}function handleError(_0x56742b,_0x542b47){_0x542b47=_0x542b47||0x1f4;return function(_0x40482a){logger[_0x0d70('0x23')](_0x40482a[_0x0d70('0x24')]);if(_0x40482a['name']){delete _0x40482a['name'];}_0x56742b['status'](_0x542b47)[_0x0d70('0x25')](_0x40482a);};}exports[_0x0d70('0x26')]=function(_0x1848eb,_0x3d06f1){var _0x10b433={},_0x289d93={},_0x3d386f={'count':0x0,'rows':[]};var _0x80d2cd=_[_0x0d70('0x27')](db[_0x0d70('0x28')][_0x0d70('0x29')],function(_0x44bed9){return{'name':_0x44bed9[_0x0d70('0x2a')],'type':_0x44bed9[_0x0d70('0x2b')]['key']};});_0x289d93[_0x0d70('0x2c')]=_[_0x0d70('0x27')](_0x80d2cd,_0x0d70('0x2d'));_0x289d93[_0x0d70('0x2e')]=_['keys'](_0x1848eb['query']);_0x289d93[_0x0d70('0x2f')]=_['intersection'](_0x289d93[_0x0d70('0x2c')],_0x289d93[_0x0d70('0x2e')]);_0x10b433[_0x0d70('0x30')]=_[_0x0d70('0x31')](_0x289d93['model'],qs[_0x0d70('0x32')](_0x1848eb[_0x0d70('0x2e')]['fields']));_0x10b433[_0x0d70('0x30')]=_0x10b433[_0x0d70('0x30')][_0x0d70('0x33')]?_0x10b433[_0x0d70('0x30')]:_0x289d93[_0x0d70('0x2c')];if(!_0x1848eb[_0x0d70('0x2e')][_0x0d70('0x34')](_0x0d70('0x35'))){_0x10b433['limit']=qs[_0x0d70('0x1b')](_0x1848eb[_0x0d70('0x2e')]['limit']);_0x10b433['offset']=qs[_0x0d70('0x18')](_0x1848eb['query']['offset']);}_0x10b433[_0x0d70('0x36')]=qs[_0x0d70('0x37')](_0x1848eb[_0x0d70('0x2e')][_0x0d70('0x37')]);_0x10b433[_0x0d70('0x38')]=qs[_0x0d70('0x2f')](_[_0x0d70('0x39')](_0x1848eb[_0x0d70('0x2e')],_0x289d93[_0x0d70('0x2f')]),_0x80d2cd);if(_0x1848eb[_0x0d70('0x2e')][_0x0d70('0x3a')]){_0x10b433[_0x0d70('0x38')]=_[_0x0d70('0x3b')](_0x10b433['where'],{'$or':_['map'](_0x80d2cd,function(_0x421dd0){if(_0x421dd0['type']!==_0x0d70('0x3c')){var _0x287f25={};_0x287f25[_0x421dd0[_0x0d70('0x2d')]]={'$like':'%'+_0x1848eb[_0x0d70('0x2e')][_0x0d70('0x3a')]+'%'};return _0x287f25;}})});}_0x10b433=_[_0x0d70('0x3b')]({},_0x10b433,_0x1848eb[_0x0d70('0x3d')]);var _0x16dd18={'where':_0x10b433[_0x0d70('0x38')]};return db[_0x0d70('0x28')][_0x0d70('0x1a')](_0x16dd18)[_0x0d70('0x20')](function(_0x19201a){_0x3d386f['count']=_0x19201a;if(_0x1848eb['query'][_0x0d70('0x3e')]){_0x10b433[_0x0d70('0x3f')]=[{'all':!![]}];}return db[_0x0d70('0x28')][_0x0d70('0x40')](_0x10b433);})[_0x0d70('0x20')](function(_0x181aad){_0x3d386f['rows']=_0x181aad;return _0x3d386f;})[_0x0d70('0x20')](respondWithFilteredResult(_0x3d06f1,_0x10b433))[_0x0d70('0x41')](handleError(_0x3d06f1,null));};exports[_0x0d70('0x42')]=function(_0x396f55,_0x2101c9){var _0xdf9e14={'raw':!![],'where':{'id':_0x396f55[_0x0d70('0x43')]['id']}},_0x3959d4={};_0x3959d4[_0x0d70('0x2c')]=_[_0x0d70('0x44')](db[_0x0d70('0x28')][_0x0d70('0x29')]);_0x3959d4[_0x0d70('0x2e')]=_[_0x0d70('0x44')](_0x396f55[_0x0d70('0x2e')]);_0x3959d4[_0x0d70('0x2f')]=_['intersection'](_0x3959d4['model'],_0x3959d4[_0x0d70('0x2e')]);_0xdf9e14['attributes']=_[_0x0d70('0x31')](_0x3959d4[_0x0d70('0x2c')],qs[_0x0d70('0x32')](_0x396f55[_0x0d70('0x2e')][_0x0d70('0x32')]));_0xdf9e14[_0x0d70('0x30')]=_0xdf9e14[_0x0d70('0x30')][_0x0d70('0x33')]?_0xdf9e14['attributes']:_0x3959d4[_0x0d70('0x2c')];if(_0x396f55[_0x0d70('0x2e')]['includeAll']){_0xdf9e14[_0x0d70('0x3f')]=[{'all':!![]}];}_0xdf9e14=_[_0x0d70('0x3b')]({},_0xdf9e14,_0x396f55['options']);return db[_0x0d70('0x28')]['find'](_0xdf9e14)[_0x0d70('0x20')](handleEntityNotFound(_0x2101c9,null))[_0x0d70('0x20')](respondWithResult(_0x2101c9,null))[_0x0d70('0x41')](handleError(_0x2101c9,null));};exports['create']=function(_0x2a714b,_0x35c8ae){return db[_0x0d70('0x28')][_0x0d70('0x45')](_0x2a714b[_0x0d70('0x46')],{})['then'](respondWithResult(_0x35c8ae,0xc9))[_0x0d70('0x41')](handleError(_0x35c8ae,null));};exports[_0x0d70('0x1f')]=function(_0xea05a8,_0x2e8fca){if(_0xea05a8[_0x0d70('0x46')]['id']){delete _0xea05a8[_0x0d70('0x46')]['id'];}return db[_0x0d70('0x28')][_0x0d70('0x47')]({'where':{'id':_0xea05a8[_0x0d70('0x43')]['id']}})[_0x0d70('0x20')](handleEntityNotFound(_0x2e8fca,null))[_0x0d70('0x20')](saveUpdates(_0xea05a8['body'],null))[_0x0d70('0x20')](respondWithResult(_0x2e8fca,null))[_0x0d70('0x41')](handleError(_0x2e8fca,null));};exports['destroy']=function(_0x2c1a08,_0x392019){return db[_0x0d70('0x28')][_0x0d70('0x47')]({'where':{'id':_0x2c1a08[_0x0d70('0x43')]['id']}})[_0x0d70('0x20')](handleEntityNotFound(_0x392019,null))[_0x0d70('0x20')](removeEntity(_0x392019,null))['catch'](handleError(_0x392019,null));};exports[_0x0d70('0x48')]=function(_0x3e15a1,_0x203ee4){return db[_0x0d70('0x28')][_0x0d70('0x48')]()[_0x0d70('0x20')](respondWithResult(_0x203ee4,null))[_0x0d70('0x41')](handleError(_0x203ee4,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 93cee84..c44cb35 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 _0x46fe=['bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x577f71,_0x3a8951){var _0xfec7c2=function(_0x440797){while(--_0x440797){_0x577f71['push'](_0x577f71['shift']());}};_0xfec7c2(++_0x3a8951);}(_0x46fe,0x1c3));var _0xe46f=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0x46fe[_0x4a93bb];return _0x208468;};'use strict';var _=require(_0xe46f('0x0'));var util=require(_0xe46f('0x1'));var logger=require(_0xe46f('0x2'))('api');var moment=require(_0xe46f('0x3'));var BPromise=require(_0xe46f('0x4'));var rp=require(_0xe46f('0x5'));var fs=require('fs');var path=require(_0xe46f('0x6'));var rimraf=require(_0xe46f('0x7'));var config=require('../../config/environment');var attributes=require(_0xe46f('0x8'));module[_0xe46f('0x9')]=function(_0x54d3e7,_0x1a1b0c){return _0x54d3e7[_0xe46f('0xa')]('VoiceDialReport',attributes,{'tableName':_0xe46f('0xb'),'paranoid':![],'indexes':[{'fields':[_0xe46f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2954=['api','moment','bluebird','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','util','../../config/logger'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x2954,0x1de));var _0x4295=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0x2954[_0x487ab4];return _0x3bef77;};'use strict';var _=require('lodash');var util=require(_0x4295('0x0'));var logger=require(_0x4295('0x1'))(_0x4295('0x2'));var moment=require(_0x4295('0x3'));var BPromise=require(_0x4295('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4295('0x5'));var config=require(_0x4295('0x6'));var attributes=require(_0x4295('0x7'));module[_0x4295('0x8')]=function(_0x5543e4,_0x3a4390){return _0x5543e4[_0x4295('0x9')](_0x4295('0xa'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x4295('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index c73b711..3b9a2a2 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 _0x754f=['request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','attributes','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x754f,0x1d6));var _0xf754=function(_0x4d8dc7,_0x2a5575){_0x4d8dc7=_0x4d8dc7-0x0;var _0x496f2b=_0x754f[_0x4d8dc7];return _0x496f2b;};'use strict';var _=require(_0xf754('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf754('0x1'));var rs=require(_0xf754('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf754('0x3'))['db'];var utils=require(_0xf754('0x4'));var logger=require(_0xf754('0x5'))(_0xf754('0x6'));var config=require(_0xf754('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf754('0x8')][_0xf754('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fb898,_0x357a55,_0x2acfea){return new BPromise(function(_0x272ffa,_0x4af2d4){return client[_0xf754('0xa')](_0x3fb898,_0x2acfea)[_0xf754('0xb')](function(_0x50020d){logger[_0xf754('0xc')](_0xf754('0xd'),_0x357a55,'request\x20sent');logger[_0xf754('0xe')](_0xf754('0xf'),_0x357a55,_0xf754('0x10'),JSON[_0xf754('0x11')](_0x50020d));if(_0x50020d['error']){if(_0x50020d[_0xf754('0x12')]['code']===0x1f4){logger[_0xf754('0x12')](_0xf754('0xd'),_0x357a55,_0x50020d['error']['message']);return _0x4af2d4(_0x50020d[_0xf754('0x12')][_0xf754('0x13')]);}logger[_0xf754('0x12')](_0xf754('0xd'),_0x357a55,_0x50020d[_0xf754('0x12')]['message']);return _0x272ffa(_0x50020d[_0xf754('0x12')]['message']);}else{logger[_0xf754('0xc')](_0xf754('0xd'),_0x357a55,_0xf754('0x10'));_0x272ffa(_0x50020d[_0xf754('0x14')]['message']);}})['catch'](function(_0x40920a){logger[_0xf754('0x12')](_0xf754('0xd'),_0x357a55,_0x40920a);_0x4af2d4(_0x40920a);});});}exports[_0xf754('0x15')]=function(_0x11588f){var _0x4c6207=this;return new Promise(function(_0x3a038c,_0xe8c086){return db[_0xf754('0x16')][_0xf754('0x17')](_0x11588f[_0xf754('0x18')],{'raw':_0x11588f[_0xf754('0x19')]?_0x11588f[_0xf754('0x19')][_0xf754('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x14f295){logger[_0xf754('0xc')](_0xf754('0x15'),_0x11588f);logger['debug'](_0xf754('0x15'),_0x11588f,JSON[_0xf754('0x11')](_0x14f295));_0x3a038c(_0x14f295);})['catch'](function(_0x3892c8){logger[_0xf754('0x12')]('CreateVoiceDialReport',_0x3892c8[_0xf754('0x13')],_0x11588f);_0xe8c086(_0x4c6207['error'](0x1f4,_0x3892c8[_0xf754('0x13')]));});});};exports[_0xf754('0x1b')]=function(_0x19d114){var _0x3857e4=this;return new Promise(function(_0x1ae511,_0x394fda){return db[_0xf754('0x16')][_0xf754('0x1c')](_0x19d114['body'],{'raw':_0x19d114[_0xf754('0x19')]?_0x19d114[_0xf754('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19d114[_0xf754('0x19')]?_0x19d114[_0xf754('0x19')]['where']||null:null,'attributes':_0x19d114[_0xf754('0x19')]?_0x19d114[_0xf754('0x19')][_0xf754('0x1d')]||null:null,'limit':_0x19d114[_0xf754('0x19')]?_0x19d114[_0xf754('0x19')]['limit']||null:null})[_0xf754('0xb')](function(_0x2cf65d){logger[_0xf754('0xc')]('UpdateVoiceDialReport',_0x19d114);logger[_0xf754('0xe')](_0xf754('0x1b'),_0x19d114,JSON[_0xf754('0x11')](_0x2cf65d));_0x1ae511(_0x2cf65d);})['catch'](function(_0x207665){logger[_0xf754('0x12')]('UpdateVoiceDialReport',_0x207665[_0xf754('0x13')],_0x19d114);_0x394fda(_0x3857e4[_0xf754('0x12')](0x1f4,_0x207665[_0xf754('0x13')]));});});}; \ No newline at end of file +var _0x320f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','create','body','options','CreateVoiceDialReport','UpdateVoiceDialReport','VoiceDialReport','update','raw','where','attributes','limit','util','randomstring'];(function(_0xd6a568,_0x4d39e9){var _0x56e5ab=function(_0x205d9e){while(--_0x205d9e){_0xd6a568['push'](_0xd6a568['shift']());}};_0x56e5ab(++_0x4d39e9);}(_0x320f,0x115));var _0xf320=function(_0x47c516,_0x36e014){_0x47c516=_0x47c516-0x0;var _0xbc8721=_0x320f[_0x47c516];return _0xbc8721;};'use strict';var _=require('lodash');var util=require(_0xf320('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf320('0x1'));var fs=require('fs');var Redis=require(_0xf320('0x2'));var db=require(_0xf320('0x3'))['db'];var utils=require(_0xf320('0x4'));var logger=require(_0xf320('0x5'))(_0xf320('0x6'));var config=require('../../config/environment');var jayson=require(_0xf320('0x7'));var client=jayson['client'][_0xf320('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d1c0b,_0x3a98ea,_0x4f6946){return new BPromise(function(_0x24f06f,_0x39ae4b){return client[_0xf320('0x9')](_0x2d1c0b,_0x4f6946)[_0xf320('0xa')](function(_0x563343){logger[_0xf320('0xb')](_0xf320('0xc'),_0x3a98ea,_0xf320('0xd'));logger[_0xf320('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x3a98ea,_0xf320('0xd'),JSON[_0xf320('0xf')](_0x563343));if(_0x563343['error']){if(_0x563343[_0xf320('0x10')]['code']===0x1f4){logger[_0xf320('0x10')](_0xf320('0xc'),_0x3a98ea,_0x563343['error'][_0xf320('0x11')]);return _0x39ae4b(_0x563343[_0xf320('0x10')]['message']);}logger[_0xf320('0x10')](_0xf320('0xc'),_0x3a98ea,_0x563343[_0xf320('0x10')][_0xf320('0x11')]);return _0x24f06f(_0x563343[_0xf320('0x10')][_0xf320('0x11')]);}else{logger[_0xf320('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x3a98ea,_0xf320('0xd'));_0x24f06f(_0x563343[_0xf320('0x12')]['message']);}})[_0xf320('0x13')](function(_0x19718d){logger[_0xf320('0x10')](_0xf320('0xc'),_0x3a98ea,_0x19718d);_0x39ae4b(_0x19718d);});});}exports['CreateVoiceDialReport']=function(_0x20b303){var _0x34ad6b=this;return new Promise(function(_0x24c9e7,_0x4a9081){return db['VoiceDialReport'][_0xf320('0x14')](_0x20b303[_0xf320('0x15')],{'raw':_0x20b303[_0xf320('0x16')]?_0x20b303[_0xf320('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xf320('0xa')](function(_0xd7adc4){logger[_0xf320('0xb')](_0xf320('0x17'),_0x20b303);logger['debug']('CreateVoiceDialReport',_0x20b303,JSON[_0xf320('0xf')](_0xd7adc4));_0x24c9e7(_0xd7adc4);})[_0xf320('0x13')](function(_0x484468){logger[_0xf320('0x10')](_0xf320('0x17'),_0x484468['message'],_0x20b303);_0x4a9081(_0x34ad6b[_0xf320('0x10')](0x1f4,_0x484468[_0xf320('0x11')]));});});};exports[_0xf320('0x18')]=function(_0x341391){var _0x32e9d8=this;return new Promise(function(_0xa47e72,_0x36c23a){return db[_0xf320('0x19')][_0xf320('0x1a')](_0x341391['body'],{'raw':_0x341391['options']?_0x341391['options'][_0xf320('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x341391['options']?_0x341391['options'][_0xf320('0x1c')]||null:null,'attributes':_0x341391['options']?_0x341391['options'][_0xf320('0x1d')]||null:null,'limit':_0x341391[_0xf320('0x16')]?_0x341391['options'][_0xf320('0x1e')]||null:null})['then'](function(_0x27bf09){logger[_0xf320('0xb')](_0xf320('0x18'),_0x341391);logger[_0xf320('0xe')](_0xf320('0x18'),_0x341391,JSON['stringify'](_0x27bf09));_0xa47e72(_0x27bf09);})['catch'](function(_0x284e28){logger[_0xf320('0x10')](_0xf320('0x18'),_0x284e28[_0xf320('0x11')],_0x341391);_0x36c23a(_0x32e9d8[_0xf320('0x10')](0x1f4,_0x284e28['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 202c86a..1115b38 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 _0xea40=['/:id','isAuthenticated','show','post','addApplications','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get'];(function(_0x24ae68,_0x3badb5){var _0x200af9=function(_0x54c85f){while(--_0x54c85f){_0x24ae68['push'](_0x24ae68['shift']());}};_0x200af9(++_0x3badb5);}(_0xea40,0x1ad));var _0x0ea4=function(_0x1a9b87,_0x4b9987){_0x1a9b87=_0x1a9b87-0x0;var _0x3e5a50=_0xea40[_0x1a9b87];return _0x3e5a50;};'use strict';var multer=require(_0x0ea4('0x0'));var util=require(_0x0ea4('0x1'));var path=require(_0x0ea4('0x2'));var timeout=require(_0x0ea4('0x3'));var express=require(_0x0ea4('0x4'));var router=express[_0x0ea4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0ea4('0x6'));var interaction=require(_0x0ea4('0x7'));var config=require(_0x0ea4('0x8'));var controller=require('./voiceExtension.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0ea4('0x9')]);router[_0x0ea4('0xa')](_0x0ea4('0xb'),auth[_0x0ea4('0xc')](),controller[_0x0ea4('0xd')]);router[_0x0ea4('0xe')]('/',auth[_0x0ea4('0xc')](),controller['create']);router[_0x0ea4('0xe')]('/:id/applications',auth['isAuthenticated'](),controller[_0x0ea4('0xf')]);router['put'](_0x0ea4('0xb'),auth['isAuthenticated'](),controller[_0x0ea4('0x10')]);router[_0x0ea4('0x11')]('/:id',auth[_0x0ea4('0xc')](),controller[_0x0ea4('0x12')]);module[_0x0ea4('0x13')]=router; \ No newline at end of file +var _0xb953=['./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','/:id/applications','put','update','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x16e690,_0x5d4683){var _0x3beb56=function(_0x547cf5){while(--_0x547cf5){_0x16e690['push'](_0x16e690['shift']());}};_0x3beb56(++_0x5d4683);}(_0xb953,0xdc));var _0x3b95=function(_0xa4fd3f,_0x5a8318){_0xa4fd3f=_0xa4fd3f-0x0;var _0x47752d=_0xb953[_0xa4fd3f];return _0x47752d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3b95('0x0'));var express=require('express');var router=express[_0x3b95('0x1')]();var fs_extra=require(_0x3b95('0x2'));var auth=require(_0x3b95('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3b95('0x4'));var controller=require(_0x3b95('0x5'));router[_0x3b95('0x6')]('/',auth[_0x3b95('0x7')](),controller[_0x3b95('0x8')]);router['get'](_0x3b95('0x9'),auth[_0x3b95('0x7')](),controller[_0x3b95('0xa')]);router[_0x3b95('0xb')]('/',auth[_0x3b95('0x7')](),controller['create']);router['post'](_0x3b95('0xc'),auth['isAuthenticated'](),controller['addApplications']);router[_0x3b95('0xd')](_0x3b95('0x9'),auth['isAuthenticated'](),controller[_0x3b95('0xe')]);router['delete']('/:id',auth[_0x3b95('0x7')](),controller['destroy']);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 07f12a1..4f81761 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 _0xaded=['outbound-fax','any','*,*,*,*','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','compositeIndex','STRING','NoOp','outbound'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xaded,0x125));var _0xdade=function(_0x287b93,_0x435e46){_0x287b93=_0x287b93-0x0;var _0x338b28=_0xaded[_0x287b93];return _0x338b28;};'use strict';var Sequelize=require(_0xdade('0x0'));module[_0xdade('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdade('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdade('0x2')},'priority':{'type':Sequelize[_0xdade('0x3')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xdade('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xdade('0x3')],'allowNull':![],'defaultValue':_0xdade('0x4')},'appdata':{'type':Sequelize[_0xdade('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xdade('0x5'),'internal','inbound-fax',_0xdade('0x6'),'system',_0xdade('0x7')),'allowNull':![]},'description':{'type':Sequelize[_0xdade('0x3')]},'interval':{'type':Sequelize[_0xdade('0x3')],'allowNull':![],'defaultValue':_0xdade('0x8')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xdade('0x9')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xdade('0x3')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xdade('0x3')],'defaultValue':_0xdade('0xa')},'answer':{'type':Sequelize[_0xdade('0x9')],'defaultValue':!![]},'name':{'type':Sequelize[_0xdade('0xb')],'get':function(_0x195a99){return this['getDataValue'](_0xdade('0xc'));}},'alias':{'type':Sequelize[_0xdade('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0xac65=['outbound','internal','outbound-fax','system','INTEGER','BOOLEAN','VIRTUAL','exports','STRING','compositeIndex','NoOp','ENUM','inbound'];(function(_0x4cf97e,_0xd9a96c){var _0x46d0cc=function(_0xa4fdd9){while(--_0xa4fdd9){_0x4cf97e['push'](_0x4cf97e['shift']());}};_0x46d0cc(++_0xd9a96c);}(_0xac65,0x14c));var _0x5ac6=function(_0x498b2d,_0x14cd2f){_0x498b2d=_0x498b2d-0x0;var _0x4bee84=_0xac65[_0x498b2d];return _0x4bee84;};'use strict';var Sequelize=require('sequelize');module[_0x5ac6('0x0')]={'context':{'type':Sequelize[_0x5ac6('0x1')],'allowNull':![],'unique':_0x5ac6('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x5ac6('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x5ac6('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x5ac6('0x2')},'tag':{'type':Sequelize[_0x5ac6('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x5ac6('0x1')],'allowNull':![],'defaultValue':_0x5ac6('0x3')},'appdata':{'type':Sequelize[_0x5ac6('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x5ac6('0x4')](_0x5ac6('0x5'),_0x5ac6('0x6'),_0x5ac6('0x7'),'inbound-fax',_0x5ac6('0x8'),_0x5ac6('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x5ac6('0x1')]},'interval':{'type':Sequelize[_0x5ac6('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x5ac6('0xa')]},'isApp':{'type':Sequelize[_0x5ac6('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x5ac6('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x5ac6('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x5ac6('0xc')],'get':function(_0xc5d9d6){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0x5ac6('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index df0c01a..0cc7d73 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 _0x41db=['VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','startsWith','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','isApp','createRouting','bulkCreate','findAndCountAll','stack','finally','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','name','UserProfileResource','error','send','index','VoiceExtension','key','keys','query','model','intersection','fields','attributes','nolimit','order','filters','where','merge'];(function(_0x3eafe1,_0x598a6b){var _0x4f065d=function(_0x28bd2f){while(--_0x28bd2f){_0x3eafe1['push'](_0x3eafe1['shift']());}};_0x4f065d(++_0x598a6b);}(_0x41db,0x13f));var _0xb41d=function(_0x12722d,_0x38cb77){_0x12722d=_0x12722d-0x0;var _0x450224=_0x41db[_0x12722d];return _0x450224;};'use strict';var _=require('lodash');var Redis=require(_0xb41d('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xb41d('0x1'))(_0xb41d('0x2'));var config=require(_0xb41d('0x3'));var db=require(_0xb41d('0x4'))['db'];config[_0xb41d('0x5')]=_['defaults'](config[_0xb41d('0x5')],{'host':_0xb41d('0x6'),'port':0x18eb});var socket=require(_0xb41d('0x7'))(new Redis(config[_0xb41d('0x5')]));require(_0xb41d('0x8'))[_0xb41d('0x9')](socket);function respondWithStatusCode(_0x485553,_0x253d4f){_0x253d4f=_0x253d4f||0xcc;return function(_0x4a518b){if(_0x4a518b){return _0x485553[_0xb41d('0xa')](_0x253d4f);}return _0x485553[_0xb41d('0xb')](_0x253d4f)[_0xb41d('0xc')]();};}function respondWithResult(_0xc3a000,_0x54da3b){_0x54da3b=_0x54da3b||0xc8;return function(_0x17655b){if(_0x17655b){return _0xc3a000['status'](_0x54da3b)[_0xb41d('0xd')](_0x17655b);}};}function respondWithFilteredResult(_0x3e9d7b,_0x7b6366){return function(_0x5458ef){if(_0x5458ef){var _0xe754ee=typeof _0x7b6366[_0xb41d('0xe')]===_0xb41d('0xf')&&typeof _0x7b6366[_0xb41d('0x10')]===_0xb41d('0xf');var _0x31f52f=_0x5458ef[_0xb41d('0x11')];var _0x56584f=_0xe754ee?0x0:_0x7b6366[_0xb41d('0xe')];var _0x282cbc=_0xe754ee?_0x5458ef[_0xb41d('0x11')]:_0x7b6366['offset']+_0x7b6366[_0xb41d('0x10')];var _0x140400;if(_0x282cbc>=_0x31f52f){_0x282cbc=_0x31f52f;_0x140400=0xc8;}else{_0x140400=0xce;}_0x3e9d7b[_0xb41d('0xb')](_0x140400);return _0x3e9d7b[_0xb41d('0x12')](_0xb41d('0x13'),_0x56584f+'-'+_0x282cbc+'/'+_0x31f52f)['json'](_0x5458ef);}return null;};}function removeEntity(_0x23fffe){return function(_0x50881a){if(_0x50881a){return _0x50881a[_0xb41d('0x14')]()[_0xb41d('0x15')](function(){var _0x29a031=_0x50881a[_0xb41d('0x16')]({'plain':!![]});var _0x278b23=[{'name':_0xb41d('0x17'),'value':_0xb41d('0x18'),'ignore':![]},{'name':_0xb41d('0x19'),'value':_0xb41d('0x1a'),'ignore':![]},{'name':_0xb41d('0x1b'),'value':_0xb41d('0x1c'),'ignore':![]}];var _0x34e5c9=_(_0x278b23)[_0xb41d('0x1d')](_0xb41d('0x1e'))[_0xb41d('0x1f')](_0xb41d('0x20'))[_0xb41d('0x20')]();if(_[_0xb41d('0x21')](_0x34e5c9,_0x29a031[_0xb41d('0x22')])){return;}var _0x1d6f0d=_['find'](_0x278b23,[_0xb41d('0x20'),_0x29a031['type']])[_0xb41d('0x23')];return db[_0xb41d('0x24')]['destroy']({'where':{'type':_0x1d6f0d,'resourceId':_0x29a031['id']}})[_0xb41d('0x15')](function(){return _0x50881a;});})[_0xb41d('0x15')](function(){_0x23fffe['status'](0xcc)[_0xb41d('0xc')]();});}};}function handleEntityNotFound(_0x5a8b34){return function(_0x38ebdd){if(!_0x38ebdd){_0x5a8b34['sendStatus'](0x194);}return _0x38ebdd;};}function handleError(_0x5808df,_0x2e85ed){_0x2e85ed=_0x2e85ed||0x1f4;return function(_0x12b0ec){logger[_0xb41d('0x25')](_0x12b0ec['stack']);if(_0x12b0ec['name']){delete _0x12b0ec[_0xb41d('0x23')];}_0x5808df[_0xb41d('0xb')](_0x2e85ed)[_0xb41d('0x26')](_0x12b0ec);};}exports[_0xb41d('0x27')]=function(_0x51dd49,_0x1e816c){var _0x15e62b={},_0x574f08={},_0x56ed03={'count':0x0,'rows':[]};var _0x39081a=_['map'](db[_0xb41d('0x28')]['rawAttributes'],function(_0x5e36cf){return{'name':_0x5e36cf['fieldName'],'type':_0x5e36cf[_0xb41d('0x22')][_0xb41d('0x29')]};});_0x574f08['model']=_['map'](_0x39081a,_0xb41d('0x23'));_0x574f08['query']=_[_0xb41d('0x2a')](_0x51dd49[_0xb41d('0x2b')]);_0x574f08['filters']=_['intersection'](_0x574f08[_0xb41d('0x2c')],_0x574f08[_0xb41d('0x2b')]);_0x15e62b['attributes']=_[_0xb41d('0x2d')](_0x574f08[_0xb41d('0x2c')],qs[_0xb41d('0x2e')](_0x51dd49[_0xb41d('0x2b')][_0xb41d('0x2e')]));_0x15e62b[_0xb41d('0x2f')]=_0x15e62b['attributes']['length']?_0x15e62b['attributes']:_0x574f08['model'];if(!_0x51dd49[_0xb41d('0x2b')]['hasOwnProperty'](_0xb41d('0x30'))){_0x15e62b['limit']=qs['limit'](_0x51dd49[_0xb41d('0x2b')][_0xb41d('0x10')]);_0x15e62b['offset']=qs[_0xb41d('0xe')](_0x51dd49['query'][_0xb41d('0xe')]);}_0x15e62b[_0xb41d('0x31')]=qs['sort'](_0x51dd49[_0xb41d('0x2b')]['sort']);_0x15e62b['where']=qs[_0xb41d('0x32')](_['pick'](_0x51dd49[_0xb41d('0x2b')],_0x574f08[_0xb41d('0x32')]),_0x39081a);if(_0x51dd49['query'][_0xb41d('0x1d')]){_0x15e62b[_0xb41d('0x33')]=_[_0xb41d('0x34')](_0x15e62b[_0xb41d('0x33')],{'$or':_[_0xb41d('0x1f')](_0x39081a,function(_0x5ed1af){if(_0x5ed1af[_0xb41d('0x22')]!==_0xb41d('0x35')){var _0x10dde4={};_0x10dde4[_0x5ed1af[_0xb41d('0x23')]]={'$like':'%'+_0x51dd49['query'][_0xb41d('0x1d')]+'%'};return _0x10dde4;}})});}_0x15e62b=_[_0xb41d('0x34')]({},_0x15e62b,_0x51dd49[_0xb41d('0x36')]);var _0x5ac0dd={'where':_0x15e62b[_0xb41d('0x33')]};return db[_0xb41d('0x28')][_0xb41d('0x11')](_0x5ac0dd)[_0xb41d('0x15')](function(_0x20ae4a){_0x56ed03['count']=_0x20ae4a;if(_0x51dd49[_0xb41d('0x2b')][_0xb41d('0x37')]){_0x15e62b[_0xb41d('0x38')]=[{'all':!![]}];}return db[_0xb41d('0x28')][_0xb41d('0x39')](_0x15e62b);})['then'](function(_0x4fada2){_0x56ed03[_0xb41d('0x3a')]=_0x4fada2;return _0x56ed03;})[_0xb41d('0x15')](respondWithFilteredResult(_0x1e816c,_0x15e62b))['catch'](handleError(_0x1e816c,null));};exports[_0xb41d('0x3b')]=function(_0x227c7b,_0x3aecec){var _0x133c68={'raw':![],'where':{'id':_0x227c7b[_0xb41d('0x3c')]['id']}},_0x3033ba={};_0x3033ba[_0xb41d('0x2c')]=_[_0xb41d('0x2a')](db[_0xb41d('0x28')][_0xb41d('0x3d')]);_0x3033ba[_0xb41d('0x2b')]=_[_0xb41d('0x2a')](_0x227c7b[_0xb41d('0x2b')]);_0x3033ba[_0xb41d('0x32')]=_['intersection'](_0x3033ba[_0xb41d('0x2c')],_0x3033ba[_0xb41d('0x2b')]);_0x133c68[_0xb41d('0x2f')]=_[_0xb41d('0x2d')](_0x3033ba[_0xb41d('0x2c')],qs[_0xb41d('0x2e')](_0x227c7b[_0xb41d('0x2b')][_0xb41d('0x2e')]));_0x133c68[_0xb41d('0x2f')]=_0x133c68[_0xb41d('0x2f')]['length']?_0x133c68[_0xb41d('0x2f')]:_0x3033ba['model'];if(_0x227c7b[_0xb41d('0x2b')][_0xb41d('0x37')]){_0x133c68[_0xb41d('0x38')]=[{'all':!![]}];}_0x133c68=_['merge']({},_0x133c68,_0x227c7b[_0xb41d('0x36')]);return db['VoiceExtension'][_0xb41d('0x3e')](_0x133c68)[_0xb41d('0x15')](handleEntityNotFound(_0x3aecec,null))[_0xb41d('0x15')](respondWithResult(_0x3aecec,null))['catch'](handleError(_0x3aecec,null));};exports[_0xb41d('0x14')]=function(_0x59b8e2,_0x4c4e0b){return db[_0xb41d('0x28')]['find']({'where':{'id':_0x59b8e2['params']['id']}})[_0xb41d('0x15')](handleEntityNotFound(_0x4c4e0b,null))['then'](removeEntity(_0x4c4e0b,null))[_0xb41d('0x3f')](handleError(_0x4c4e0b,null));};exports[_0xb41d('0x40')]=function(_0x2d3ed6,_0x12d441){if(_0x2d3ed6['body'][_0xb41d('0x22')]==='outbound'&&!_[_0xb41d('0x41')](_0x2d3ed6[_0xb41d('0x42')][_0xb41d('0x43')],'_')){_0x2d3ed6['body'][_0xb41d('0x43')]='_'['concat'](_0x2d3ed6[_0xb41d('0x42')][_0xb41d('0x43')]);}return db[_0xb41d('0x28')]['create'](_0x2d3ed6[_0xb41d('0x42')],{'raw':![]})['then'](function(_0xcadd44){var _0x46eb8b=_0x2d3ed6[_0xb41d('0x44')][_0xb41d('0x16')]({'plain':!![]});if(!_0x46eb8b)throw new Error(_0xb41d('0x45'));if(_0x46eb8b[_0xb41d('0x46')]==='user'){var _0x4b0d9a=_0xcadd44['get']({'plain':!![]});var _0x3db9a5=[{'name':'InboundRoutes','value':'inbound'},{'name':_0xb41d('0x19'),'value':_0xb41d('0x1a')},{'name':_0xb41d('0x1b'),'value':'internal'}];var _0x54cbcc=_[_0xb41d('0x3e')](_0x3db9a5,[_0xb41d('0x20'),_0x4b0d9a['type']])[_0xb41d('0x23')];return db[_0xb41d('0x47')]['find']({'where':{'name':_0x54cbcc,'userProfileId':_0x46eb8b[_0xb41d('0x48')]},'raw':!![]})['then'](function(_0x1634a1){if(_0x1634a1&&_0x1634a1[_0xb41d('0x49')]===0x0){return db[_0xb41d('0x24')][_0xb41d('0x40')]({'name':_0x4b0d9a[_0xb41d('0x23')],'resourceId':_0x4b0d9a['id'],'type':_0x1634a1[_0xb41d('0x23')],'sectionId':_0x1634a1['id']},{})[_0xb41d('0x15')](function(){return _0xcadd44;});}else{return _0xcadd44;}})[_0xb41d('0x3f')](function(_0x119035){logger['error'](_0xb41d('0x4a'),_0x119035);throw _0x119035;});}return _0xcadd44;})[_0xb41d('0x15')](respondWithResult(_0x12d441,0xc9))[_0xb41d('0x3f')](handleError(_0x12d441,null));};exports[_0xb41d('0x4b')]=function(_0x506fb6,_0x246ef5){if(_0x506fb6[_0xb41d('0x42')]['id']){delete _0x506fb6[_0xb41d('0x42')]['id'];}return db['VoiceExtension'][_0xb41d('0x3e')]({'where':{'id':_0x506fb6[_0xb41d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x246ef5,null))[_0xb41d('0x15')](function(_0x4f4a8d){if(_0x4f4a8d){return db[_0xb41d('0x28')][_0xb41d('0x4b')](_[_0xb41d('0x4c')](_0x506fb6[_0xb41d('0x42')],['exten',_0xb41d('0x4d'),_0xb41d('0x4e'),_0xb41d('0x4f'),_0xb41d('0x50'),_0xb41d('0x51'),'alias']),{'where':{'context':_0x4f4a8d[_0xb41d('0x4d')],'exten':_0x4f4a8d[_0xb41d('0x43')]},'individualHooks':!![]})[_0xb41d('0x15')](function(_0x280ffe){return _0x280ffe;});}return null;})['then'](respondWithStatusCode(_0x246ef5,null))['catch'](handleError(_0x246ef5,null));};exports[_0xb41d('0x52')]=function(_0x59c66e,_0x2807d5){var _0x4bf45c=_0x59c66e[_0xb41d('0x3c')]['id'];var _0xfe4b02=_0x59c66e[_0xb41d('0x42')];var _0x4ebc8c=0xc8;var _0x24a8e9=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xb41d('0x53')][_0xb41d('0x54')][_0xb41d('0x55')][_0xb41d('0x56')]},function(_0x24dd3e){return db[_0xb41d('0x28')]['findOne']({'where':{'id':_0x4bf45c},'transaction':_0x24dd3e})[_0xb41d('0x15')](function(_0x6fed3a){if(_0x6fed3a){return db['VoiceExtension'][_0xb41d('0x14')]({'where':{'VoiceExtensionId':_0x4bf45c},'transaction':_0x24dd3e})['then'](function(){var _0x13807e=_[_0xb41d('0x1f')](_0xfe4b02,function(_0x1dfd13){_0x1dfd13['VoiceExtensionId']=_0x4bf45c;_0x1dfd13[_0xb41d('0x57')]=!![];return _0x1dfd13;});return _0x6fed3a[_0xb41d('0x58')](_0x13807e);})[_0xb41d('0x15')](function(_0x3bbc4e){return db['VoiceExtension'][_0xb41d('0x59')](_0x3bbc4e,{'transaction':_0x24dd3e});});}else{_0x4ebc8c=0x194;_0x24a8e9=[];}});})[_0xb41d('0x15')](function(){if(_0x4ebc8c!==0x194){return db[_0xb41d('0x28')][_0xb41d('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4bf45c},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x46bd47){_0x24a8e9=_0x46bd47;});}})[_0xb41d('0x3f')](function(_0x46cd44){_0x4ebc8c=0x1f4;logger[_0xb41d('0x25')](_0x46cd44[_0xb41d('0x5b')]);if(_0x46cd44[_0xb41d('0x23')]){delete _0x46cd44[_0xb41d('0x23')];}_0x24a8e9=_0x46cd44;})[_0xb41d('0x5c')](function(){if(_0x24a8e9===null){_0x2807d5[_0xb41d('0xa')](_0x4ebc8c);}else{if(_0x4ebc8c===0x1f4){_0x2807d5[_0xb41d('0xb')](_0x4ebc8c)[_0xb41d('0x26')](_0x24a8e9);}else{_0x2807d5['status'](_0x4ebc8c)[_0xb41d('0xd')](_0x24a8e9);}}});}; \ No newline at end of file +var _0x8bf6=['Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','createRouting','bulkCreate','findAndCountAll','finally','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','./voiceExtension.socket','register','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','destroy','then','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','value','type','find','name','UserProfileResource','stack','send','index','VoiceExtension','rawAttributes','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','pick','map','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','create','body','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','transaction'];(function(_0x175bcb,_0x1f6541){var _0x35e44f=function(_0x33d71e){while(--_0x33d71e){_0x175bcb['push'](_0x175bcb['shift']());}};_0x35e44f(++_0x1f6541);}(_0x8bf6,0xba));var _0x68bf=function(_0x475dd,_0x450b68){_0x475dd=_0x475dd-0x0;var _0x4e9d32=_0x8bf6[_0x475dd];return _0x4e9d32;};'use strict';var _=require(_0x68bf('0x0'));var Redis=require(_0x68bf('0x1'));var qs=require(_0x68bf('0x2'));var logger=require('../../config/logger')(_0x68bf('0x3'));var config=require(_0x68bf('0x4'));var db=require(_0x68bf('0x5'))['db'];config[_0x68bf('0x6')]=_['defaults'](config[_0x68bf('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x68bf('0x7'))[_0x68bf('0x8')](socket);function respondWithStatusCode(_0x11d88d,_0x332620){_0x332620=_0x332620||0xcc;return function(_0x5094c7){if(_0x5094c7){return _0x11d88d[_0x68bf('0x9')](_0x332620);}return _0x11d88d[_0x68bf('0xa')](_0x332620)[_0x68bf('0xb')]();};}function respondWithResult(_0x3de651,_0x34a289){_0x34a289=_0x34a289||0xc8;return function(_0x790c3){if(_0x790c3){return _0x3de651[_0x68bf('0xa')](_0x34a289)[_0x68bf('0xc')](_0x790c3);}};}function respondWithFilteredResult(_0x2ae11f,_0x26949e){return function(_0x1c27a8){if(_0x1c27a8){var _0x42c047=typeof _0x26949e['offset']==='undefined'&&typeof _0x26949e[_0x68bf('0xd')]===_0x68bf('0xe');var _0x101e8f=_0x1c27a8['count'];var _0x4dd9f0=_0x42c047?0x0:_0x26949e[_0x68bf('0xf')];var _0x3d68f7=_0x42c047?_0x1c27a8[_0x68bf('0x10')]:_0x26949e[_0x68bf('0xf')]+_0x26949e[_0x68bf('0xd')];var _0x2afed9;if(_0x3d68f7>=_0x101e8f){_0x3d68f7=_0x101e8f;_0x2afed9=0xc8;}else{_0x2afed9=0xce;}_0x2ae11f[_0x68bf('0xa')](_0x2afed9);return _0x2ae11f['set'](_0x68bf('0x11'),_0x4dd9f0+'-'+_0x3d68f7+'/'+_0x101e8f)[_0x68bf('0xc')](_0x1c27a8);}return null;};}function removeEntity(_0x4cf392){return function(_0x1ed4fc){if(_0x1ed4fc){return _0x1ed4fc[_0x68bf('0x12')]()[_0x68bf('0x13')](function(){var _0xaad60a=_0x1ed4fc['get']({'plain':!![]});var _0xa170d0=[{'name':_0x68bf('0x14'),'value':'inbound','ignore':![]},{'name':_0x68bf('0x15'),'value':_0x68bf('0x16'),'ignore':![]},{'name':_0x68bf('0x17'),'value':_0x68bf('0x18'),'ignore':![]}];var _0x4a44db=_(_0xa170d0)[_0x68bf('0x19')](_0x68bf('0x1a'))['map']('value')[_0x68bf('0x1b')]();if(_['includes'](_0x4a44db,_0xaad60a[_0x68bf('0x1c')])){return;}var _0x1b4fa5=_[_0x68bf('0x1d')](_0xa170d0,['value',_0xaad60a['type']])[_0x68bf('0x1e')];return db[_0x68bf('0x1f')][_0x68bf('0x12')]({'where':{'type':_0x1b4fa5,'resourceId':_0xaad60a['id']}})[_0x68bf('0x13')](function(){return _0x1ed4fc;});})[_0x68bf('0x13')](function(){_0x4cf392[_0x68bf('0xa')](0xcc)[_0x68bf('0xb')]();});}};}function handleEntityNotFound(_0x2beb8a){return function(_0x173d39){if(!_0x173d39){_0x2beb8a[_0x68bf('0x9')](0x194);}return _0x173d39;};}function handleError(_0x553ae4,_0x4a101d){_0x4a101d=_0x4a101d||0x1f4;return function(_0xfb5333){logger['error'](_0xfb5333[_0x68bf('0x20')]);if(_0xfb5333[_0x68bf('0x1e')]){delete _0xfb5333['name'];}_0x553ae4[_0x68bf('0xa')](_0x4a101d)[_0x68bf('0x21')](_0xfb5333);};}exports[_0x68bf('0x22')]=function(_0xde8234,_0x12033d){var _0x1016d8={},_0x552a1a={},_0x4d594a={'count':0x0,'rows':[]};var _0x2ea774=_['map'](db[_0x68bf('0x23')][_0x68bf('0x24')],function(_0x1cf0df){return{'name':_0x1cf0df['fieldName'],'type':_0x1cf0df[_0x68bf('0x1c')]['key']};});_0x552a1a['model']=_['map'](_0x2ea774,'name');_0x552a1a['query']=_['keys'](_0xde8234[_0x68bf('0x25')]);_0x552a1a[_0x68bf('0x26')]=_['intersection'](_0x552a1a[_0x68bf('0x27')],_0x552a1a[_0x68bf('0x25')]);_0x1016d8[_0x68bf('0x28')]=_[_0x68bf('0x29')](_0x552a1a[_0x68bf('0x27')],qs[_0x68bf('0x2a')](_0xde8234['query'][_0x68bf('0x2a')]));_0x1016d8[_0x68bf('0x28')]=_0x1016d8['attributes'][_0x68bf('0x2b')]?_0x1016d8[_0x68bf('0x28')]:_0x552a1a[_0x68bf('0x27')];if(!_0xde8234['query'][_0x68bf('0x2c')](_0x68bf('0x2d'))){_0x1016d8[_0x68bf('0xd')]=qs['limit'](_0xde8234[_0x68bf('0x25')][_0x68bf('0xd')]);_0x1016d8[_0x68bf('0xf')]=qs[_0x68bf('0xf')](_0xde8234[_0x68bf('0x25')][_0x68bf('0xf')]);}_0x1016d8['order']=qs['sort'](_0xde8234['query']['sort']);_0x1016d8[_0x68bf('0x2e')]=qs[_0x68bf('0x26')](_[_0x68bf('0x2f')](_0xde8234[_0x68bf('0x25')],_0x552a1a['filters']),_0x2ea774);if(_0xde8234['query'][_0x68bf('0x19')]){_0x1016d8['where']=_['merge'](_0x1016d8[_0x68bf('0x2e')],{'$or':_[_0x68bf('0x30')](_0x2ea774,function(_0x9a9df){if(_0x9a9df['type']!==_0x68bf('0x31')){var _0x4fb197={};_0x4fb197[_0x9a9df['name']]={'$like':'%'+_0xde8234[_0x68bf('0x25')]['filter']+'%'};return _0x4fb197;}})});}_0x1016d8=_[_0x68bf('0x32')]({},_0x1016d8,_0xde8234['options']);var _0x2f3715={'where':_0x1016d8[_0x68bf('0x2e')]};return db[_0x68bf('0x23')][_0x68bf('0x10')](_0x2f3715)['then'](function(_0x31e3ed){_0x4d594a[_0x68bf('0x10')]=_0x31e3ed;if(_0xde8234[_0x68bf('0x25')]['includeAll']){_0x1016d8[_0x68bf('0x33')]=[{'all':!![]}];}return db[_0x68bf('0x23')][_0x68bf('0x34')](_0x1016d8);})['then'](function(_0x35a1b8){_0x4d594a[_0x68bf('0x35')]=_0x35a1b8;return _0x4d594a;})[_0x68bf('0x13')](respondWithFilteredResult(_0x12033d,_0x1016d8))[_0x68bf('0x36')](handleError(_0x12033d,null));};exports[_0x68bf('0x37')]=function(_0x25b914,_0x23b5df){var _0x313401={'raw':![],'where':{'id':_0x25b914[_0x68bf('0x38')]['id']}},_0x42c0c1={};_0x42c0c1[_0x68bf('0x27')]=_[_0x68bf('0x39')](db[_0x68bf('0x23')]['rawAttributes']);_0x42c0c1[_0x68bf('0x25')]=_[_0x68bf('0x39')](_0x25b914[_0x68bf('0x25')]);_0x42c0c1[_0x68bf('0x26')]=_[_0x68bf('0x29')](_0x42c0c1['model'],_0x42c0c1['query']);_0x313401[_0x68bf('0x28')]=_[_0x68bf('0x29')](_0x42c0c1['model'],qs[_0x68bf('0x2a')](_0x25b914[_0x68bf('0x25')][_0x68bf('0x2a')]));_0x313401[_0x68bf('0x28')]=_0x313401[_0x68bf('0x28')][_0x68bf('0x2b')]?_0x313401[_0x68bf('0x28')]:_0x42c0c1[_0x68bf('0x27')];if(_0x25b914[_0x68bf('0x25')][_0x68bf('0x3a')]){_0x313401['include']=[{'all':!![]}];}_0x313401=_[_0x68bf('0x32')]({},_0x313401,_0x25b914[_0x68bf('0x3b')]);return db[_0x68bf('0x23')][_0x68bf('0x1d')](_0x313401)[_0x68bf('0x13')](handleEntityNotFound(_0x23b5df,null))[_0x68bf('0x13')](respondWithResult(_0x23b5df,null))[_0x68bf('0x36')](handleError(_0x23b5df,null));};exports[_0x68bf('0x12')]=function(_0xdb5b51,_0x462e1b){return db[_0x68bf('0x23')][_0x68bf('0x1d')]({'where':{'id':_0xdb5b51[_0x68bf('0x38')]['id']}})['then'](handleEntityNotFound(_0x462e1b,null))[_0x68bf('0x13')](removeEntity(_0x462e1b,null))['catch'](handleError(_0x462e1b,null));};exports[_0x68bf('0x3c')]=function(_0x102999,_0x524d0b){if(_0x102999['body'][_0x68bf('0x1c')]==='outbound'&&!_['startsWith'](_0x102999[_0x68bf('0x3d')][_0x68bf('0x3e')],'_')){_0x102999['body'][_0x68bf('0x3e')]='_'[_0x68bf('0x3f')](_0x102999['body'][_0x68bf('0x3e')]);}return db[_0x68bf('0x23')]['create'](_0x102999[_0x68bf('0x3d')],{'raw':![]})[_0x68bf('0x13')](function(_0x54aa3d){var _0x10f486=_0x102999[_0x68bf('0x40')][_0x68bf('0x41')]({'plain':!![]});if(!_0x10f486)throw new Error(_0x68bf('0x42'));if(_0x10f486[_0x68bf('0x43')]===_0x68bf('0x40')){var _0x580067=_0x54aa3d[_0x68bf('0x41')]({'plain':!![]});var _0x50b8bd=[{'name':_0x68bf('0x14'),'value':_0x68bf('0x44')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x68bf('0x17'),'value':_0x68bf('0x18')}];var _0x3e41f0=_[_0x68bf('0x1d')](_0x50b8bd,[_0x68bf('0x1b'),_0x580067[_0x68bf('0x1c')]])[_0x68bf('0x1e')];return db[_0x68bf('0x45')][_0x68bf('0x1d')]({'where':{'name':_0x3e41f0,'userProfileId':_0x10f486[_0x68bf('0x46')]},'raw':!![]})[_0x68bf('0x13')](function(_0x48e80c){if(_0x48e80c&&_0x48e80c[_0x68bf('0x47')]===0x0){return db['UserProfileResource'][_0x68bf('0x3c')]({'name':_0x580067[_0x68bf('0x1e')],'resourceId':_0x580067['id'],'type':_0x48e80c[_0x68bf('0x1e')],'sectionId':_0x48e80c['id']},{})[_0x68bf('0x13')](function(){return _0x54aa3d;});}else{return _0x54aa3d;}})[_0x68bf('0x36')](function(_0x3e672d){logger['error'](_0x68bf('0x48'),_0x3e672d);throw _0x3e672d;});}return _0x54aa3d;})['then'](respondWithResult(_0x524d0b,0xc9))[_0x68bf('0x36')](handleError(_0x524d0b,null));};exports[_0x68bf('0x49')]=function(_0x12b1a,_0x58d0cc){if(_0x12b1a[_0x68bf('0x3d')]['id']){delete _0x12b1a[_0x68bf('0x3d')]['id'];}return db[_0x68bf('0x23')][_0x68bf('0x1d')]({'where':{'id':_0x12b1a[_0x68bf('0x38')]['id']}})[_0x68bf('0x13')](handleEntityNotFound(_0x58d0cc,null))['then'](function(_0x184f66){if(_0x184f66){return db[_0x68bf('0x23')][_0x68bf('0x49')](_['pick'](_0x12b1a['body'],['exten',_0x68bf('0x4a'),'description',_0x68bf('0x4b'),_0x68bf('0x4c'),_0x68bf('0x4d'),'alias']),{'where':{'context':_0x184f66['context'],'exten':_0x184f66[_0x68bf('0x3e')]},'individualHooks':!![]})['then'](function(_0x59658d){return _0x59658d;});}return null;})[_0x68bf('0x13')](respondWithStatusCode(_0x58d0cc,null))['catch'](handleError(_0x58d0cc,null));};exports[_0x68bf('0x4e')]=function(_0x20a4ca,_0x1a2cbe){var _0x10f21c=_0x20a4ca[_0x68bf('0x38')]['id'];var _0x41feef=_0x20a4ca['body'];var _0x5f53c0=0xc8;var _0x1b3547=null;return db[_0x68bf('0x4f')][_0x68bf('0x50')]({'isolationLevel':db[_0x68bf('0x4f')][_0x68bf('0x51')][_0x68bf('0x52')][_0x68bf('0x53')]},function(_0x226841){return db[_0x68bf('0x23')]['findOne']({'where':{'id':_0x10f21c},'transaction':_0x226841})['then'](function(_0x5a802f){if(_0x5a802f){return db['VoiceExtension'][_0x68bf('0x12')]({'where':{'VoiceExtensionId':_0x10f21c},'transaction':_0x226841})[_0x68bf('0x13')](function(){var _0x4dfbb4=_[_0x68bf('0x30')](_0x41feef,function(_0x3eb868){_0x3eb868[_0x68bf('0x54')]=_0x10f21c;_0x3eb868['isApp']=!![];return _0x3eb868;});return _0x5a802f[_0x68bf('0x55')](_0x4dfbb4);})[_0x68bf('0x13')](function(_0x2600d4){return db[_0x68bf('0x23')][_0x68bf('0x56')](_0x2600d4,{'transaction':_0x226841});});}else{_0x5f53c0=0x194;_0x1b3547=[];}});})[_0x68bf('0x13')](function(){if(_0x5f53c0!==0x194){return db[_0x68bf('0x23')][_0x68bf('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x10f21c},'order':'cast(priority\x20as\x20unsigned)'})[_0x68bf('0x13')](function(_0x53df26){_0x1b3547=_0x53df26;});}})[_0x68bf('0x36')](function(_0x5f4eb9){_0x5f53c0=0x1f4;logger['error'](_0x5f4eb9[_0x68bf('0x20')]);if(_0x5f4eb9['name']){delete _0x5f4eb9['name'];}_0x1b3547=_0x5f4eb9;})[_0x68bf('0x58')](function(){if(_0x1b3547===null){_0x1a2cbe[_0x68bf('0x9')](_0x5f53c0);}else{if(_0x5f53c0===0x1f4){_0x1a2cbe[_0x68bf('0xa')](_0x5f53c0)['send'](_0x1b3547);}else{_0x1a2cbe[_0x68bf('0xa')](_0x5f53c0)[_0x68bf('0xc')](_0x1b3547);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 9bf69f6..ba13ccd 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 _0x2b2d=['update','remove','emit','hasOwnProperty','hook','setMaxListeners','save'];(function(_0xdc5664,_0x4eef5a){var _0xd65a92=function(_0x73d50){while(--_0x73d50){_0xdc5664['push'](_0xdc5664['shift']());}};_0xd65a92(++_0x4eef5a);}(_0x2b2d,0x19b));var _0xd2b2=function(_0x376866,_0x58b7f7){_0x376866=_0x376866-0x0;var _0x201d5b=_0x2b2d[_0x376866];return _0x201d5b;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xd2b2('0x0')](0x0);var events={'afterCreate':_0xd2b2('0x1'),'afterUpdate':_0xd2b2('0x2'),'afterDestroy':_0xd2b2('0x3')};function emitEvent(_0x549b53){return function(_0x46f698,_0x479adb,_0x346b21){VoiceExtensionEvents['emit'](_0x549b53+':'+_0x46f698['id'],_0x46f698);VoiceExtensionEvents[_0xd2b2('0x4')](_0x549b53,_0x46f698);_0x346b21(null);};}for(var e in events){if(events[_0xd2b2('0x5')](e)){var event=events[e];VoiceExtension[_0xd2b2('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0xe35a=['update','remove','emit','hasOwnProperty','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x326d35,_0x4f65b3){var _0xd3f8f3=function(_0x1fbbaf){while(--_0x1fbbaf){_0x326d35['push'](_0x326d35['shift']());}};_0xd3f8f3(++_0x4f65b3);}(_0xe35a,0x1bc));var _0xae35=function(_0x116e6f,_0x3c33cb){_0x116e6f=_0x116e6f-0x0;var _0x2ed403=_0xe35a[_0x116e6f];return _0x2ed403;};'use strict';var EventEmitter=require(_0xae35('0x0'));var VoiceExtension=require(_0xae35('0x1'))['db'][_0xae35('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xae35('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xae35('0x4'),'afterDestroy':_0xae35('0x5')};function emitEvent(_0x51ab47){return function(_0x525e23,_0x15bd37,_0x2f384e){VoiceExtensionEvents[_0xae35('0x6')](_0x51ab47+':'+_0x525e23['id'],_0x525e23);VoiceExtensionEvents['emit'](_0x51ab47,_0x525e23);_0x2f384e(null);};}for(var e in events){if(events[_0xae35('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 1d68e61..15c1419 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 _0xd53c=['CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','priority','last','catch','define','voice_extensions','get','then','Hangup','./voiceExtension.attributes','exports','CDR(type)=','type','context','exten','alias','Set','NoOp','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','MONITOR_OPTIONS=ab','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','trunk','timeout','options','url','split','length','name','param','prefix','phone','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','*,*,*,*','intervals','filter','IntervalId','hasOwnProperty','tag','toLowerCase'];(function(_0x565c4e,_0x1e77f9){var _0x4a167f=function(_0x537269){while(--_0x537269){_0x565c4e['push'](_0x565c4e['shift']());}};_0x4a167f(++_0x1e77f9);}(_0xd53c,0x6f));var _0xcd53=function(_0x556b3c,_0x222254){_0x556b3c=_0x556b3c-0x0;var _0xc599a=_0xd53c[_0x556b3c];return _0xc599a;};'use strict';var _=require('lodash');var attributes=require(_0xcd53('0x0'));module[_0xcd53('0x1')]=function(_0x3695a2){var _0x2ea8c0=_0x3695a2['models'];function _0x5ebb17(_0x331d5e){var _0xedfa37=0x2;var _0x214a49=[{'type':_0x331d5e['type'],'app':'Set','appdata':_0xcd53('0x2')+_0x331d5e[_0xcd53('0x3')],'context':_0x331d5e[_0xcd53('0x4')],'exten':_0x331d5e[_0xcd53('0x5')],'priority':_0xedfa37++,'VoiceExtensionId':_0x331d5e['id']},{'type':_0x331d5e['type'],'app':_0x331d5e[_0xcd53('0x6')]?_0xcd53('0x7'):_0xcd53('0x8'),'appdata':_0x331d5e[_0xcd53('0x6')]?'CDR(routeAlias)='+_0x331d5e[_0xcd53('0x6')]:_0xcd53('0x9'),'context':_0x331d5e[_0xcd53('0x4')],'exten':_0x331d5e['exten'],'priority':_0xedfa37++,'VoiceExtensionId':_0x331d5e['id']}];if(_0x331d5e[_0xcd53('0x3')]===_0xcd53('0xa')){_0x214a49[_0xcd53('0xb')]({'type':_0xcd53('0xa'),'app':_0xcd53('0x7'),'appdata':_0xcd53('0xc')+_0x331d5e['id'],'context':_0x331d5e[_0xcd53('0x4')],'exten':_0x331d5e['exten'],'priority':_0xedfa37++,'VoiceExtensionId':_0x331d5e['id']});}_0x214a49[_0xcd53('0xb')]({'type':_0x331d5e['type'],'app':'Set','appdata':_0xcd53('0xd'),'context':_0x331d5e[_0xcd53('0x4')],'exten':_0x331d5e[_0xcd53('0x5')],'priority':_0xedfa37++,'VoiceExtensionId':_0x331d5e['id']},{'type':_0x331d5e[_0xcd53('0x3')],'app':'Set','appdata':_0xcd53('0xe'),'context':_0x331d5e[_0xcd53('0x4')],'exten':_0x331d5e[_0xcd53('0x5')],'priority':_0xedfa37++,'VoiceExtensionId':_0x331d5e['id']},{'type':_0x331d5e[_0xcd53('0x3')],'app':_0xcd53('0x7'),'appdata':'MONITOR_OPTIONS=ab','context':_0x331d5e['context'],'exten':_0x331d5e[_0xcd53('0x5')],'priority':_0xedfa37++,'VoiceExtensionId':_0x331d5e['id']});return _0x214a49;}function _0x54c327(_0xcb25c5){var _0x2fe4f5=0x2;var _0x40e489=[{'type':_0xcd53('0xf'),'app':_0xcd53('0x7'),'appdata':_0xcd53('0x10'),'context':_0xcb25c5['context'],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':_0xcb25c5[_0xcd53('0x6')]?_0xcd53('0x7'):_0xcd53('0x8'),'appdata':_0xcb25c5[_0xcd53('0x6')]?_0xcd53('0x11')+_0xcb25c5[_0xcd53('0x6')]:_0xcd53('0x9'),'context':_0xcb25c5[_0xcd53('0x4')],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':_0xcd53('0x7'),'appdata':_0xcd53('0x12')+(_0xcb25c5[_0xcd53('0x13')]?_0xcd53('0x14')+_0xcb25c5['cutdigits']+'}':_0xcd53('0x15')),'context':_0xcb25c5['context'],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':'Set','appdata':_0xcd53('0xc')+_0xcb25c5['id'],'context':_0xcb25c5['context'],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':_0xcd53('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2fe4f5+0x2)+_0xcd53('0x17')+(_0x2fe4f5+0x1)+')','context':_0xcb25c5['context'],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':_0xcd53('0x7'),'appdata':_0xcb25c5[_0xcd53('0x13')]?_0xcd53('0x18')+_0xcb25c5[_0xcd53('0x13')]+'}':'CDR(prefix)=noprefix','context':_0xcb25c5[_0xcd53('0x4')],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':_0xcd53('0x7'),'appdata':_0xcd53('0xd'),'context':_0xcb25c5[_0xcd53('0x4')],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':_0xcd53('0x7'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0xcb25c5[_0xcd53('0x4')],'exten':_0xcb25c5['exten'],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':'outbound','app':_0xcd53('0x7'),'appdata':_0xcd53('0x19'),'context':_0xcb25c5['context'],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':'Set','appdata':_0xcd53('0x1a')+_0xcb25c5['id'],'context':_0xcb25c5[_0xcd53('0x4')],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']}];if(_0xcb25c5['hasOwnProperty'](_0xcd53('0x1b'))&&_0xcb25c5['recordingFormat']!==_0xcd53('0x1c')){_0x40e489[_0xcd53('0xb')]({'type':_0xcd53('0xf'),'app':_0xcd53('0x7'),'appdata':_0xcd53('0x1d'),'context':_0xcb25c5['context'],'exten':_0xcb25c5['exten'],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xcb25c5[_0xcd53('0x1b')]||'wav','context':_0xcb25c5['context'],'exten':_0xcb25c5['exten'],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']});}return _0x40e489;}function _0x17872f(_0x4e7947,_0x1be590){var _0x1505ca=[{'name':_0xcd53('0x1e'),'param':0x0},{'name':_0xcd53('0x1f'),'param':0x1},{'name':_0xcd53('0x20'),'param':0x2},{'name':_0xcd53('0x21'),'param':0x3}];var _0x17b9ab={};var _0xb4b7ba=_0x1be590[_0xcd53('0x22')](',');var _0x385963=[];for(var _0x1c2ab4=0x0;_0x1c2ab4<_0x1505ca[_0xcd53('0x23')];_0x1c2ab4++){switch(_0x1505ca[_0x1c2ab4][_0xcd53('0x24')]){case _0xcd53('0x1e'):_0x17b9ab[_0xcd53('0x1e')]=_0xb4b7ba[_0x1505ca[_0x1c2ab4][_0xcd53('0x25')]]['split']('/')[0x1];_0x17b9ab['phone']=_0xb4b7ba[_0x1505ca[_0x1c2ab4][_0xcd53('0x25')]][_0xcd53('0x22')]('/')[0x2];_0x17b9ab[_0xcd53('0x26')]=_0x17b9ab[_0xcd53('0x27')]?_0x17b9ab['phone'][_0xcd53('0x22')]('$')[0x0]:undefined;_0x17b9ab['phone']=_0x4e7947['cutdigits']?(_0x17b9ab[_0xcd53('0x26')]||'')+_0xcd53('0x14')+_0x4e7947[_0xcd53('0x13')]+'}':(_0x17b9ab[_0xcd53('0x26')]||'')+'${EXTEN}';_0x385963[_0x1505ca[_0x1c2ab4][_0xcd53('0x25')]]=[_0xcd53('0x28'),_0x17b9ab['trunk'],_0x17b9ab[_0xcd53('0x27')]][_0xcd53('0x29')]('/');break;case'options':_0x17b9ab[_0xcd53('0x20')]=_0xb4b7ba[_0x1505ca[_0x1c2ab4][_0xcd53('0x25')]];if(_0x4e7947[_0xcd53('0x1b')]!==_0xcd53('0x1c')){if(_0x17b9ab['options'][_0xcd53('0x2a')](_0xcd53('0x2b'))<0x0){_0x17b9ab[_0xcd53('0x20')]+=_0xcd53('0x2b');}}else{_0x17b9ab[_0xcd53('0x20')]=_0x17b9ab[_0xcd53('0x20')]['replace'](_0xcd53('0x2b'),'');}_0x385963[_0x1505ca[_0x1c2ab4][_0xcd53('0x25')]]=_0x17b9ab[_0xcd53('0x20')];break;default:_0x385963[_0x1505ca[_0x1c2ab4]['param']]=_0xb4b7ba[_0x1505ca[_0x1c2ab4]['param']];}}return _0x385963[_0xcd53('0x29')](',');}function _0x2f95f7(_0x536a02,_0x28cb67,_0x20fe13){return new Promise(function(_0x383e54,_0xf458e){var _0x52e78f=[];if(_[_0xcd53('0x2c')](_0x28cb67))return _0x383e54(_0x52e78f);_0x2ea8c0[_0xcd53('0x2d')][_0xcd53('0x2e')]({'attributes':['id',_0xcd53('0x2f'),'IntervalId'],'raw':!![]})['then'](function(_0x4d5d7b){for(var _0x4f0cf5=0x0,_0x583973=0x0;_0x4f0cf5<_0x28cb67[_0xcd53('0x23')];_0x4f0cf5++,_0x583973=0x0){var _0x44b51b=_0x28cb67[_0x4f0cf5];var _0x1cf45f=[];var _0x2e9393=[];delete _0x44b51b['id'];if(_0x44b51b[_0xcd53('0x2f')]!==_0xcd53('0x30')){_0x44b51b['intervals']=[_0x44b51b['interval']];}else{_0x44b51b[_0xcd53('0x31')]=_0x44b51b['IntervalId']?_['map'](_[_0xcd53('0x32')](_0x4d5d7b,{'IntervalId':_0x44b51b[_0xcd53('0x33')]}),_0xcd53('0x2f')):[];}_0x44b51b[_0xcd53('0x4')]=_0x536a02[_0xcd53('0x4')];_0x44b51b['exten']=_0x536a02[_0xcd53('0x5')];if(_0x44b51b[_0xcd53('0x3')])_0x44b51b['type']=_0x44b51b[_0xcd53('0x3')]['toLowerCase']();if(_0x536a02[_0xcd53('0x3')]==='outbound'){if(_0x44b51b[_0xcd53('0x34')](_0xcd53('0x35'))&&_0x44b51b['tag']&&_0x44b51b[_0xcd53('0x35')]!=='--'){_0x1cf45f['push']({'type':_0x44b51b['type'][_0xcd53('0x36')](),'app':_0xcd53('0x7'),'appdata':_0xcd53('0x37')+_0x44b51b[_0xcd53('0x35')],'context':_0x536a02['context'],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b[_0xcd53('0x31')][_0xcd53('0x23')]+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});}_0x1cf45f[_0xcd53('0xb')]({'type':_0x44b51b['type']['toLowerCase'](),'app':_0xcd53('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x44b51b[_0xcd53('0x38')]?_0xcd53('0x39')+_0x44b51b['callerID']+')':_0xcd53('0x3a')),'context':_0x536a02[_0xcd53('0x4')],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b['intervals'][_0xcd53('0x23')]+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});}else{if(_0x44b51b[_0xcd53('0x34')](_0xcd53('0x3b'))){if([_0xcd53('0x3c'),_0xcd53('0x3d')][_0xcd53('0x3e')](_0x44b51b['app'][_0xcd53('0x36')]())&&_0x44b51b[_0xcd53('0x3f')]!==_0xcd53('0x40')){if(_0x44b51b[_0xcd53('0x3b')]){_0x1cf45f[_0xcd53('0xb')]({'type':_0x44b51b[_0xcd53('0x3')][_0xcd53('0x36')](),'app':'ExecIf','appdata':_0xcd53('0x41'),'context':_0x536a02[_0xcd53('0x4')],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b[_0xcd53('0x31')][_0xcd53('0x23')]+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});_0x1cf45f[_0xcd53('0xb')]({'type':_0x44b51b[_0xcd53('0x3')][_0xcd53('0x36')](),'app':_0xcd53('0x7'),'appdata':_0xcd53('0x42'),'context':_0x536a02['context'],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b[_0xcd53('0x31')][_0xcd53('0x23')]+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});}else{_0x1cf45f[_0xcd53('0xb')]({'type':_0x44b51b[_0xcd53('0x3')]['toLowerCase'](),'app':_0xcd53('0x16'),'appdata':_0xcd53('0x43'),'context':_0x536a02['context'],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b[_0xcd53('0x31')][_0xcd53('0x23')]+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});_0x1cf45f[_0xcd53('0xb')]({'type':_0x44b51b[_0xcd53('0x3')][_0xcd53('0x36')](),'app':_0xcd53('0x7'),'appdata':_0xcd53('0x44'),'context':_0x536a02['context'],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b[_0xcd53('0x31')][_0xcd53('0x23')]+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});}}}}for(var _0x2cb371=0x0;_0x2cb371<_0x44b51b['intervals'][_0xcd53('0x23')];_0x2cb371++){var _0x4ef1f5=_0x20fe13+_0x44b51b[_0xcd53('0x31')][_0xcd53('0x23')];var _0x4b5a55=_0x2cb371===_0x44b51b['intervals'][_0xcd53('0x23')]-0x1?_0x20fe13+_0x1cf45f['length']+_0x2e9393[_0xcd53('0x23')]+0x2:_0x20fe13+_0x2cb371+0x1;_0x1cf45f[_0xcd53('0x45')](_0x2cb371,0x0,{'type':_0x536a02[_0xcd53('0x3')],'app':_0xcd53('0x46'),'appdata':_0x44b51b[_0xcd53('0x31')][_0x2cb371]+'?'+_0x536a02[_0xcd53('0x4')]+_0xcd53('0x47')+_0x4ef1f5+':'+_0x536a02[_0xcd53('0x4')]+_0xcd53('0x47')+_0x4b5a55,'exten':_0x536a02[_0xcd53('0x5')],'context':_0x536a02[_0xcd53('0x4')],'priority':_0x20fe13+_0x2cb371,'VoiceExtensionId':_0x536a02['id']});}if(_0x44b51b['appType']===_0xcd53('0x48')){_0x44b51b[_0xcd53('0x49')]=_0x17872f(_0x536a02,_0x44b51b['appdata']);}if(_0x44b51b[_0xcd53('0x3f')]===_0xcd53('0x4a')){_0x1cf45f[_0xcd53('0xb')]({'type':_0x44b51b[_0xcd53('0x3')][_0xcd53('0x36')](),'app':'Set','appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x536a02[_0xcd53('0x4')],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b[_0xcd53('0x31')]['length']+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});}_0x44b51b[_0xcd53('0x4b')]=_0x1cf45f[_0xcd53('0x23')]?_[_0xcd53('0x4c')](_0x1cf45f)[_0xcd53('0x4b')]+0x1:_0x20fe13;_0x52e78f=_['concat'](_0x52e78f,_0x1cf45f,[_0x44b51b],_0x2e9393);_0x20fe13=_[_0xcd53('0x4c')](_0x52e78f)['priority']+0x1;}return _0x383e54(_0x52e78f);})[_0xcd53('0x4d')](function(_0x35cc54){_0xf458e(_0x35cc54);});});}return _0x3695a2[_0xcd53('0x4e')]('VoiceExtension',attributes,{'tableName':_0xcd53('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x115305){var _0x5da0ad=this[_0xcd53('0x50')]({'plain':!![]});var _0x404cfb=_0x5da0ad[_0xcd53('0x3')]===_0xcd53('0xf')?_0x54c327(_0x5da0ad):_0x5ebb17(_0x5da0ad);return _0x2f95f7(_0x5da0ad,_0x115305,_[_0xcd53('0x4c')](_0x404cfb)[_0xcd53('0x4b')]+0x1)[_0xcd53('0x51')](function(_0x5f0895){var _0x2057b2=_['concat'](_0x404cfb,_0x5f0895);_0x2057b2[_0xcd53('0xb')]({'type':_0x5da0ad[_0xcd53('0x3')],'app':_0xcd53('0x52'),'exten':_0x5da0ad[_0xcd53('0x5')],'context':_0x5da0ad[_0xcd53('0x4')],'priority':_[_0xcd53('0x4c')](_0x2057b2)[_0xcd53('0x4b')]+0x1,'VoiceExtensionId':_0x5da0ad['id']});return _0x2057b2;});}}});}; \ No newline at end of file +var _0xd1e4=['interval','IntervalId','*,*,*,*','intervals','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','catch','define','VoiceExtension','voice_extensions','then','concat','Hangup','lodash','exports','models','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','options','url','length','param','phone','split','prefix','SIP','join','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll'];(function(_0x2b60ec,_0x3414f6){var _0x1e181b=function(_0xd64f80){while(--_0xd64f80){_0x2b60ec['push'](_0x2b60ec['shift']());}};_0x1e181b(++_0x3414f6);}(_0xd1e4,0xc5));var _0x4d1e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd1e4[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x4d1e('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x4d1e('0x1')]=function(_0x1dcc3d){var _0x7b312=_0x1dcc3d[_0x4d1e('0x2')];function _0x5040ff(_0x5a6acc){var _0x288112=0x2;var _0x288cae=[{'type':_0x5a6acc['type'],'app':_0x4d1e('0x3'),'appdata':_0x4d1e('0x4')+_0x5a6acc[_0x4d1e('0x5')],'context':_0x5a6acc[_0x4d1e('0x6')],'exten':_0x5a6acc[_0x4d1e('0x7')],'priority':_0x288112++,'VoiceExtensionId':_0x5a6acc['id']},{'type':_0x5a6acc[_0x4d1e('0x5')],'app':_0x5a6acc[_0x4d1e('0x8')]?_0x4d1e('0x3'):_0x4d1e('0x9'),'appdata':_0x5a6acc['alias']?_0x4d1e('0xa')+_0x5a6acc['alias']:'No\x20alias\x20set','context':_0x5a6acc[_0x4d1e('0x6')],'exten':_0x5a6acc[_0x4d1e('0x7')],'priority':_0x288112++,'VoiceExtensionId':_0x5a6acc['id']}];if(_0x5a6acc[_0x4d1e('0x5')]===_0x4d1e('0xb')){_0x288cae[_0x4d1e('0xc')]({'type':_0x4d1e('0xb'),'app':_0x4d1e('0x3'),'appdata':'CDR(routeid)='+_0x5a6acc['id'],'context':_0x5a6acc['context'],'exten':_0x5a6acc[_0x4d1e('0x7')],'priority':_0x288112++,'VoiceExtensionId':_0x5a6acc['id']});}_0x288cae['push']({'type':_0x5a6acc['type'],'app':_0x4d1e('0x3'),'appdata':_0x4d1e('0xd'),'context':_0x5a6acc[_0x4d1e('0x6')],'exten':_0x5a6acc['exten'],'priority':_0x288112++,'VoiceExtensionId':_0x5a6acc['id']},{'type':_0x5a6acc[_0x4d1e('0x5')],'app':'Set','appdata':_0x4d1e('0xe'),'context':_0x5a6acc[_0x4d1e('0x6')],'exten':_0x5a6acc[_0x4d1e('0x7')],'priority':_0x288112++,'VoiceExtensionId':_0x5a6acc['id']},{'type':_0x5a6acc[_0x4d1e('0x5')],'app':_0x4d1e('0x3'),'appdata':_0x4d1e('0xf'),'context':_0x5a6acc[_0x4d1e('0x6')],'exten':_0x5a6acc['exten'],'priority':_0x288112++,'VoiceExtensionId':_0x5a6acc['id']});return _0x288cae;}function _0x39e450(_0x58cd28){var _0x401623=0x2;var _0x5e54aa=[{'type':_0x4d1e('0x10'),'app':_0x4d1e('0x3'),'appdata':'CDR(type)=outbound','context':_0x58cd28['context'],'exten':_0x58cd28[_0x4d1e('0x7')],'priority':_0x401623++,'VoiceExtensionId':_0x58cd28['id']},{'type':_0x4d1e('0x10'),'app':_0x58cd28[_0x4d1e('0x8')]?_0x4d1e('0x3'):_0x4d1e('0x9'),'appdata':_0x58cd28[_0x4d1e('0x8')]?'CDR(routeAlias)='+_0x58cd28[_0x4d1e('0x8')]:_0x4d1e('0x11'),'context':_0x58cd28['context'],'exten':_0x58cd28['exten'],'priority':_0x401623++,'VoiceExtensionId':_0x58cd28['id']},{'type':_0x4d1e('0x10'),'app':_0x4d1e('0x3'),'appdata':_0x4d1e('0x12')+(_0x58cd28[_0x4d1e('0x13')]?_0x4d1e('0x14')+_0x58cd28['cutdigits']+'}':_0x4d1e('0x15')),'context':_0x58cd28[_0x4d1e('0x6')],'exten':_0x58cd28[_0x4d1e('0x7')],'priority':_0x401623++,'VoiceExtensionId':_0x58cd28['id']},{'type':_0x4d1e('0x10'),'app':_0x4d1e('0x3'),'appdata':_0x4d1e('0x16')+_0x58cd28['id'],'context':_0x58cd28[_0x4d1e('0x6')],'exten':_0x58cd28['exten'],'priority':_0x401623++,'VoiceExtensionId':_0x58cd28['id']},{'type':_0x4d1e('0x10'),'app':_0x4d1e('0x17'),'appdata':_0x4d1e('0x18')+(_0x401623+0x2)+_0x4d1e('0x19')+(_0x401623+0x1)+')','context':_0x58cd28[_0x4d1e('0x6')],'exten':_0x58cd28[_0x4d1e('0x7')],'priority':_0x401623++,'VoiceExtensionId':_0x58cd28['id']},{'type':_0x4d1e('0x10'),'app':_0x4d1e('0x3'),'appdata':_0x58cd28['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x58cd28[_0x4d1e('0x13')]+'}':'CDR(prefix)=noprefix','context':_0x58cd28['context'],'exten':_0x58cd28['exten'],'priority':_0x401623++,'VoiceExtensionId':_0x58cd28['id']},{'type':'outbound','app':_0x4d1e('0x3'),'appdata':_0x4d1e('0xd'),'context':_0x58cd28[_0x4d1e('0x6')],'exten':_0x58cd28[_0x4d1e('0x7')],'priority':_0x401623++,'VoiceExtensionId':_0x58cd28['id']},{'type':_0x4d1e('0x10'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x58cd28[_0x4d1e('0x6')],'exten':_0x58cd28['exten'],'priority':_0x401623++,'VoiceExtensionId':_0x58cd28['id']},{'type':_0x4d1e('0x10'),'app':_0x4d1e('0x3'),'appdata':_0x4d1e('0xf'),'context':_0x58cd28[_0x4d1e('0x6')],'exten':_0x58cd28['exten'],'priority':_0x401623++,'VoiceExtensionId':_0x58cd28['id']},{'type':_0x4d1e('0x10'),'app':'Set','appdata':_0x4d1e('0x1a')+_0x58cd28['id'],'context':_0x58cd28['context'],'exten':_0x58cd28['exten'],'priority':_0x401623++,'VoiceExtensionId':_0x58cd28['id']}];if(_0x58cd28[_0x4d1e('0x1b')]('recordingFormat')&&_0x58cd28[_0x4d1e('0x1c')]!=='none'){_0x5e54aa[_0x4d1e('0xc')]({'type':'outbound','app':_0x4d1e('0x3'),'appdata':_0x4d1e('0x1d'),'context':_0x58cd28[_0x4d1e('0x6')],'exten':_0x58cd28[_0x4d1e('0x7')],'priority':_0x401623++,'VoiceExtensionId':_0x58cd28['id']},{'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x58cd28[_0x4d1e('0x1c')]||_0x4d1e('0x1e'),'context':_0x58cd28[_0x4d1e('0x6')],'exten':_0x58cd28[_0x4d1e('0x7')],'priority':_0x401623++,'VoiceExtensionId':_0x58cd28['id']});}return _0x5e54aa;}function _0x460a26(_0x476daf,_0x271ec9){var _0x284ebb=[{'name':_0x4d1e('0x1f'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x4d1e('0x20'),'param':0x2},{'name':_0x4d1e('0x21'),'param':0x3}];var _0x148a23={};var _0x257a03=_0x271ec9['split'](',');var _0x2be700=[];for(var _0x3fd35b=0x0;_0x3fd35b<_0x284ebb[_0x4d1e('0x22')];_0x3fd35b++){switch(_0x284ebb[_0x3fd35b]['name']){case _0x4d1e('0x1f'):_0x148a23[_0x4d1e('0x1f')]=_0x257a03[_0x284ebb[_0x3fd35b][_0x4d1e('0x23')]]['split']('/')[0x1];_0x148a23[_0x4d1e('0x24')]=_0x257a03[_0x284ebb[_0x3fd35b][_0x4d1e('0x23')]][_0x4d1e('0x25')]('/')[0x2];_0x148a23[_0x4d1e('0x26')]=_0x148a23['phone']?_0x148a23[_0x4d1e('0x24')]['split']('$')[0x0]:undefined;_0x148a23[_0x4d1e('0x24')]=_0x476daf[_0x4d1e('0x13')]?(_0x148a23[_0x4d1e('0x26')]||'')+'${EXTEN:'+_0x476daf[_0x4d1e('0x13')]+'}':(_0x148a23[_0x4d1e('0x26')]||'')+_0x4d1e('0x15');_0x2be700[_0x284ebb[_0x3fd35b][_0x4d1e('0x23')]]=[_0x4d1e('0x27'),_0x148a23[_0x4d1e('0x1f')],_0x148a23[_0x4d1e('0x24')]][_0x4d1e('0x28')]('/');break;case _0x4d1e('0x20'):_0x148a23['options']=_0x257a03[_0x284ebb[_0x3fd35b][_0x4d1e('0x23')]];if(_0x476daf['recordingFormat']!=='none'){if(_0x148a23[_0x4d1e('0x20')]['indexOf'](_0x4d1e('0x29'))<0x0){_0x148a23[_0x4d1e('0x20')]+=_0x4d1e('0x29');}}else{_0x148a23[_0x4d1e('0x20')]=_0x148a23[_0x4d1e('0x20')][_0x4d1e('0x2a')](_0x4d1e('0x29'),'');}_0x2be700[_0x284ebb[_0x3fd35b]['param']]=_0x148a23[_0x4d1e('0x20')];break;default:_0x2be700[_0x284ebb[_0x3fd35b][_0x4d1e('0x23')]]=_0x257a03[_0x284ebb[_0x3fd35b][_0x4d1e('0x23')]];}}return _0x2be700[_0x4d1e('0x28')](',');}function _0x39a130(_0x3dcd53,_0x20f520,_0x1842e6){return new Promise(function(_0x1db33f,_0x51145d){var _0x4dcaad=[];if(_[_0x4d1e('0x2b')](_0x20f520))return _0x1db33f(_0x4dcaad);_0x7b312[_0x4d1e('0x2c')][_0x4d1e('0x2d')]({'attributes':['id',_0x4d1e('0x2e'),_0x4d1e('0x2f')],'raw':!![]})['then'](function(_0x146697){for(var _0x3eecbe=0x0,_0x422bc2=0x0;_0x3eecbe<_0x20f520[_0x4d1e('0x22')];_0x3eecbe++,_0x422bc2=0x0){var _0x30de70=_0x20f520[_0x3eecbe];var _0x5b29ba=[];var _0x3b826b=[];delete _0x30de70['id'];if(_0x30de70[_0x4d1e('0x2e')]!==_0x4d1e('0x30')){_0x30de70[_0x4d1e('0x31')]=[_0x30de70[_0x4d1e('0x2e')]];}else{_0x30de70[_0x4d1e('0x31')]=_0x30de70[_0x4d1e('0x2f')]?_['map'](_['filter'](_0x146697,{'IntervalId':_0x30de70[_0x4d1e('0x2f')]}),'interval'):[];}_0x30de70[_0x4d1e('0x6')]=_0x3dcd53['context'];_0x30de70[_0x4d1e('0x7')]=_0x3dcd53[_0x4d1e('0x7')];if(_0x30de70[_0x4d1e('0x5')])_0x30de70['type']=_0x30de70[_0x4d1e('0x5')]['toLowerCase']();if(_0x3dcd53[_0x4d1e('0x5')]===_0x4d1e('0x10')){if(_0x30de70[_0x4d1e('0x1b')](_0x4d1e('0x32'))&&_0x30de70[_0x4d1e('0x32')]&&_0x30de70[_0x4d1e('0x32')]!=='--'){_0x5b29ba['push']({'type':_0x30de70[_0x4d1e('0x5')][_0x4d1e('0x33')](),'app':_0x4d1e('0x3'),'appdata':_0x4d1e('0x34')+_0x30de70[_0x4d1e('0x32')],'context':_0x3dcd53[_0x4d1e('0x6')],'exten':_0x3dcd53[_0x4d1e('0x7')],'priority':_0x30de70[_0x4d1e('0x31')][_0x4d1e('0x22')]+_0x1842e6+_0x422bc2++,'VoiceExtensionId':_0x3dcd53['id']});}_0x5b29ba[_0x4d1e('0xc')]({'type':_0x30de70[_0x4d1e('0x5')][_0x4d1e('0x33')](),'app':_0x4d1e('0x17'),'appdata':_0x4d1e('0x35')+(_0x30de70[_0x4d1e('0x36')]?_0x4d1e('0x37')+_0x30de70[_0x4d1e('0x36')]+')':_0x4d1e('0x38')),'context':_0x3dcd53[_0x4d1e('0x6')],'exten':_0x3dcd53[_0x4d1e('0x7')],'priority':_0x30de70[_0x4d1e('0x31')][_0x4d1e('0x22')]+_0x1842e6+_0x422bc2++,'VoiceExtensionId':_0x3dcd53['id']});}else{if(_0x30de70[_0x4d1e('0x1b')](_0x4d1e('0x39'))){if([_0x4d1e('0x3a'),_0x4d1e('0x3b')][_0x4d1e('0x3c')](_0x30de70[_0x4d1e('0x3d')][_0x4d1e('0x33')]())&&_0x30de70[_0x4d1e('0x3e')]!==_0x4d1e('0x3f')){if(_0x30de70['answer']){_0x5b29ba['push']({'type':_0x30de70[_0x4d1e('0x5')][_0x4d1e('0x33')](),'app':_0x4d1e('0x17'),'appdata':_0x4d1e('0x40'),'context':_0x3dcd53[_0x4d1e('0x6')],'exten':_0x3dcd53['exten'],'priority':_0x30de70['intervals']['length']+_0x1842e6+_0x422bc2++,'VoiceExtensionId':_0x3dcd53['id']});_0x5b29ba['push']({'type':_0x30de70['type'][_0x4d1e('0x33')](),'app':'Set','appdata':_0x4d1e('0x41'),'context':_0x3dcd53[_0x4d1e('0x6')],'exten':_0x3dcd53['exten'],'priority':_0x30de70[_0x4d1e('0x31')][_0x4d1e('0x22')]+_0x1842e6+_0x422bc2++,'VoiceExtensionId':_0x3dcd53['id']});}else{_0x5b29ba['push']({'type':_0x30de70[_0x4d1e('0x5')]['toLowerCase'](),'app':_0x4d1e('0x17'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3dcd53[_0x4d1e('0x6')],'exten':_0x3dcd53[_0x4d1e('0x7')],'priority':_0x30de70[_0x4d1e('0x31')][_0x4d1e('0x22')]+_0x1842e6+_0x422bc2++,'VoiceExtensionId':_0x3dcd53['id']});_0x5b29ba['push']({'type':_0x30de70[_0x4d1e('0x5')][_0x4d1e('0x33')](),'app':_0x4d1e('0x3'),'appdata':_0x4d1e('0x42'),'context':_0x3dcd53[_0x4d1e('0x6')],'exten':_0x3dcd53[_0x4d1e('0x7')],'priority':_0x30de70[_0x4d1e('0x31')]['length']+_0x1842e6+_0x422bc2++,'VoiceExtensionId':_0x3dcd53['id']});}}}}for(var _0x1dc6f9=0x0;_0x1dc6f9<_0x30de70[_0x4d1e('0x31')][_0x4d1e('0x22')];_0x1dc6f9++){var _0x2c80a7=_0x1842e6+_0x30de70[_0x4d1e('0x31')][_0x4d1e('0x22')];var _0xb3718c=_0x1dc6f9===_0x30de70[_0x4d1e('0x31')][_0x4d1e('0x22')]-0x1?_0x1842e6+_0x5b29ba['length']+_0x3b826b['length']+0x2:_0x1842e6+_0x1dc6f9+0x1;_0x5b29ba[_0x4d1e('0x43')](_0x1dc6f9,0x0,{'type':_0x3dcd53['type'],'app':'GotoIfTime','appdata':_0x30de70[_0x4d1e('0x31')][_0x1dc6f9]+'?'+_0x3dcd53[_0x4d1e('0x6')]+',${EXTEN},'+_0x2c80a7+':'+_0x3dcd53[_0x4d1e('0x6')]+_0x4d1e('0x44')+_0xb3718c,'exten':_0x3dcd53['exten'],'context':_0x3dcd53[_0x4d1e('0x6')],'priority':_0x1842e6+_0x1dc6f9,'VoiceExtensionId':_0x3dcd53['id']});}if(_0x30de70[_0x4d1e('0x3e')]==='outboundDial'){_0x30de70[_0x4d1e('0x45')]=_0x460a26(_0x3dcd53,_0x30de70[_0x4d1e('0x45')]);}if(_0x30de70[_0x4d1e('0x3e')]===_0x4d1e('0x46')){_0x5b29ba[_0x4d1e('0xc')]({'type':_0x30de70['type'][_0x4d1e('0x33')](),'app':'Set','appdata':_0x4d1e('0x47'),'context':_0x3dcd53[_0x4d1e('0x6')],'exten':_0x3dcd53[_0x4d1e('0x7')],'priority':_0x30de70[_0x4d1e('0x31')][_0x4d1e('0x22')]+_0x1842e6+_0x422bc2++,'VoiceExtensionId':_0x3dcd53['id']});}_0x30de70[_0x4d1e('0x48')]=_0x5b29ba['length']?_[_0x4d1e('0x49')](_0x5b29ba)[_0x4d1e('0x48')]+0x1:_0x1842e6;_0x4dcaad=_['concat'](_0x4dcaad,_0x5b29ba,[_0x30de70],_0x3b826b);_0x1842e6=_['last'](_0x4dcaad)[_0x4d1e('0x48')]+0x1;}return _0x1db33f(_0x4dcaad);})[_0x4d1e('0x4a')](function(_0x1ffd05){_0x51145d(_0x1ffd05);});});}return _0x1dcc3d[_0x4d1e('0x4b')](_0x4d1e('0x4c'),attributes,{'tableName':_0x4d1e('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xb69d2a){var _0x5a3d4f=this['get']({'plain':!![]});var _0x4220f2=_0x5a3d4f['type']===_0x4d1e('0x10')?_0x39e450(_0x5a3d4f):_0x5040ff(_0x5a3d4f);return _0x39a130(_0x5a3d4f,_0xb69d2a,_['last'](_0x4220f2)[_0x4d1e('0x48')]+0x1)[_0x4d1e('0x4e')](function(_0x1f47e2){var _0x363640=_[_0x4d1e('0x4f')](_0x4220f2,_0x1f47e2);_0x363640[_0x4d1e('0xc')]({'type':_0x5a3d4f[_0x4d1e('0x5')],'app':_0x4d1e('0x50'),'exten':_0x5a3d4f[_0x4d1e('0x7')],'context':_0x5a3d4f['context'],'priority':_[_0x4d1e('0x49')](_0x363640)['priority']+0x1,'VoiceExtensionId':_0x5a3d4f['id']});return _0x363640;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index fa6baba..8fa5361 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 _0x36c3=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','VoiceExtension','findAll','options','where','attributes','limit','include','model','map','GetVoiceExtension','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2c0c8d,_0x4a86c7){var _0x114e7a=function(_0x5ef296){while(--_0x5ef296){_0x2c0c8d['push'](_0x2c0c8d['shift']());}};_0x114e7a(++_0x4a86c7);}(_0x36c3,0x1a6));var _0x336c=function(_0x972b32,_0x56ea80){_0x972b32=_0x972b32-0x0;var _0x6e8e75=_0x36c3[_0x972b32];return _0x6e8e75;};'use strict';var _=require(_0x336c('0x0'));var util=require(_0x336c('0x1'));var moment=require('moment');var BPromise=require(_0x336c('0x2'));var rs=require(_0x336c('0x3'));var fs=require('fs');var Redis=require(_0x336c('0x4'));var db=require(_0x336c('0x5'))['db'];var utils=require(_0x336c('0x6'));var logger=require(_0x336c('0x7'))(_0x336c('0x8'));var config=require('../../config/environment');var jayson=require(_0x336c('0x9'));var client=jayson[_0x336c('0xa')][_0x336c('0xb')]({'port':0x232a});config[_0x336c('0xc')]=_[_0x336c('0xd')](config['redis'],{'host':_0x336c('0xe'),'port':0x18eb});var socket=require(_0x336c('0xf'))(new Redis(config[_0x336c('0xc')]));require(_0x336c('0x10'))[_0x336c('0x11')](socket);function respondWithRpcPromise(_0x243984,_0x33ced0,_0x1a4503){return new BPromise(function(_0x179247,_0x31cee7){return client[_0x336c('0x12')](_0x243984,_0x1a4503)[_0x336c('0x13')](function(_0x1d896b){logger[_0x336c('0x14')](_0x336c('0x15'),_0x33ced0,_0x336c('0x16'));logger[_0x336c('0x17')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x33ced0,'request\x20sent',JSON[_0x336c('0x18')](_0x1d896b));if(_0x1d896b['error']){if(_0x1d896b[_0x336c('0x19')][_0x336c('0x1a')]===0x1f4){logger[_0x336c('0x19')](_0x336c('0x15'),_0x33ced0,_0x1d896b['error'][_0x336c('0x1b')]);return _0x31cee7(_0x1d896b[_0x336c('0x19')]['message']);}logger[_0x336c('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x33ced0,_0x1d896b[_0x336c('0x19')]['message']);return _0x179247(_0x1d896b[_0x336c('0x19')]['message']);}else{logger[_0x336c('0x14')](_0x336c('0x15'),_0x33ced0,'request\x20sent');_0x179247(_0x1d896b['result'][_0x336c('0x1b')]);}})[_0x336c('0x1c')](function(_0x1d306c){logger[_0x336c('0x19')](_0x336c('0x15'),_0x33ced0,_0x1d306c);_0x31cee7(_0x1d306c);});});}exports['GetVoiceExtension']=function(_0x327e10){var _0x532e12=this;return new Promise(function(_0x4dcdce,_0x5f401e){return db[_0x336c('0x1d')][_0x336c('0x1e')]({'raw':_0x327e10[_0x336c('0x1f')]?_0x327e10['options']['raw']===undefined?!![]:![]:!![],'where':_0x327e10[_0x336c('0x1f')]?_0x327e10[_0x336c('0x1f')][_0x336c('0x20')]||null:null,'attributes':_0x327e10['options']?_0x327e10[_0x336c('0x1f')][_0x336c('0x21')]||null:null,'limit':_0x327e10[_0x336c('0x1f')]?_0x327e10['options'][_0x336c('0x22')]||null:null,'include':_0x327e10[_0x336c('0x1f')]?_0x327e10[_0x336c('0x1f')][_0x336c('0x23')]?_['map'](_0x327e10[_0x336c('0x1f')][_0x336c('0x23')],function(_0x412a00){return{'model':db[_0x412a00[_0x336c('0x24')]],'as':_0x412a00['as'],'attributes':_0x412a00[_0x336c('0x21')],'include':_0x412a00[_0x336c('0x23')]?_['map'](_0x412a00[_0x336c('0x23')],function(_0x3d2442){return{'model':db[_0x3d2442[_0x336c('0x24')]],'as':_0x3d2442['as'],'attributes':_0x3d2442[_0x336c('0x21')],'include':_0x3d2442['include']?_[_0x336c('0x25')](_0x3d2442[_0x336c('0x23')],function(_0x54b06b){return{'model':db[_0x54b06b['model']],'as':_0x54b06b['as'],'attributes':_0x54b06b['attributes']};}):[]};}):[]};}):[]:[]})[_0x336c('0x13')](function(_0x1c7a34){logger['info']('GetVoiceExtension',_0x327e10);logger['debug'](_0x336c('0x26'),_0x327e10,JSON[_0x336c('0x18')](_0x1c7a34));_0x4dcdce(_0x1c7a34);})[_0x336c('0x1c')](function(_0x424712){logger[_0x336c('0x19')](_0x336c('0x26'),_0x424712[_0x336c('0x1b')],_0x327e10);_0x5f401e(_0x532e12['error'](0x1f4,_0x424712[_0x336c('0x1b')]));});});}; \ No newline at end of file +var _0x0d4d=['request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetVoiceExtension','findAll','raw','options','attributes','limit','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0d4d,0x132));var _0xd0d4=function(_0xbecff3,_0x3fc6ee){_0xbecff3=_0xbecff3-0x0;var _0xdd318d=_0x0d4d[_0xbecff3];return _0xdd318d;};'use strict';var _=require(_0xd0d4('0x0'));var util=require(_0xd0d4('0x1'));var moment=require(_0xd0d4('0x2'));var BPromise=require(_0xd0d4('0x3'));var rs=require(_0xd0d4('0x4'));var fs=require('fs');var Redis=require(_0xd0d4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd0d4('0x6'));var logger=require('../../config/logger')(_0xd0d4('0x7'));var config=require(_0xd0d4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd0d4('0x9')][_0xd0d4('0xa')]({'port':0x232a});config[_0xd0d4('0xb')]=_['defaults'](config[_0xd0d4('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd0d4('0xc'))(new Redis(config['redis']));require(_0xd0d4('0xd'))[_0xd0d4('0xe')](socket);function respondWithRpcPromise(_0xdfcbed,_0x5bdeab,_0x1ed4da){return new BPromise(function(_0x2014b6,_0x2a9607){return client[_0xd0d4('0xf')](_0xdfcbed,_0x1ed4da)[_0xd0d4('0x10')](function(_0xbf4c47){logger['info'](_0xd0d4('0x11'),_0x5bdeab,_0xd0d4('0x12'));logger[_0xd0d4('0x13')](_0xd0d4('0x14'),_0x5bdeab,_0xd0d4('0x12'),JSON[_0xd0d4('0x15')](_0xbf4c47));if(_0xbf4c47['error']){if(_0xbf4c47[_0xd0d4('0x16')][_0xd0d4('0x17')]===0x1f4){logger[_0xd0d4('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x5bdeab,_0xbf4c47['error'][_0xd0d4('0x18')]);return _0x2a9607(_0xbf4c47[_0xd0d4('0x16')]['message']);}logger[_0xd0d4('0x16')](_0xd0d4('0x11'),_0x5bdeab,_0xbf4c47['error']['message']);return _0x2014b6(_0xbf4c47[_0xd0d4('0x16')][_0xd0d4('0x18')]);}else{logger[_0xd0d4('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x5bdeab,'request\x20sent');_0x2014b6(_0xbf4c47['result'][_0xd0d4('0x18')]);}})[_0xd0d4('0x1a')](function(_0x1e8409){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x5bdeab,_0x1e8409);_0x2a9607(_0x1e8409);});});}exports[_0xd0d4('0x1b')]=function(_0x4b3b77){var _0x2e6bbf=this;return new Promise(function(_0x272580,_0x1dcc1b){return db['VoiceExtension'][_0xd0d4('0x1c')]({'raw':_0x4b3b77['options']?_0x4b3b77['options'][_0xd0d4('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b3b77[_0xd0d4('0x1e')]?_0x4b3b77['options']['where']||null:null,'attributes':_0x4b3b77[_0xd0d4('0x1e')]?_0x4b3b77[_0xd0d4('0x1e')][_0xd0d4('0x1f')]||null:null,'limit':_0x4b3b77[_0xd0d4('0x1e')]?_0x4b3b77[_0xd0d4('0x1e')][_0xd0d4('0x20')]||null:null,'include':_0x4b3b77['options']?_0x4b3b77[_0xd0d4('0x1e')]['include']?_[_0xd0d4('0x21')](_0x4b3b77[_0xd0d4('0x1e')][_0xd0d4('0x22')],function(_0x5380c3){return{'model':db[_0x5380c3['model']],'as':_0x5380c3['as'],'attributes':_0x5380c3[_0xd0d4('0x1f')],'include':_0x5380c3['include']?_['map'](_0x5380c3[_0xd0d4('0x22')],function(_0x29948c){return{'model':db[_0x29948c[_0xd0d4('0x23')]],'as':_0x29948c['as'],'attributes':_0x29948c[_0xd0d4('0x1f')],'include':_0x29948c['include']?_[_0xd0d4('0x21')](_0x29948c[_0xd0d4('0x22')],function(_0x45acf8){return{'model':db[_0x45acf8[_0xd0d4('0x23')]],'as':_0x45acf8['as'],'attributes':_0x45acf8[_0xd0d4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd0d4('0x10')](function(_0x1b07e8){logger[_0xd0d4('0x19')](_0xd0d4('0x1b'),_0x4b3b77);logger['debug'](_0xd0d4('0x1b'),_0x4b3b77,JSON[_0xd0d4('0x15')](_0x1b07e8));_0x272580(_0x1b07e8);})[_0xd0d4('0x1a')](function(_0x18096a){logger[_0xd0d4('0x16')](_0xd0d4('0x1b'),_0x18096a['message'],_0x4b3b77);_0x1dcc1b(_0x2e6bbf['error'](0x1f4,_0x18096a[_0xd0d4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 24c8bde..15456ae 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 _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x3d5b76,_0x55f6f8){var _0x1a1d13=function(_0x23cc2c){while(--_0x23cc2c){_0x3d5b76['push'](_0x3d5b76['shift']());}};_0x1a1d13(++_0x55f6f8);}(_0xe14b,0x93));var _0xbe14=function(_0x4262aa,_0x3b8d35){_0x4262aa=_0x4262aa-0x0;var _0x662813=_0xe14b[_0x4262aa];return _0x662813;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x5c2d58,_0x11a42f){var _0x86762a=function(_0x175406){while(--_0x175406){_0x5c2d58['push'](_0x5c2d58['shift']());}};_0x86762a(++_0x11a42f);}(_0x4975,0x86));var _0x5497=function(_0x30b025,_0x19217){_0x30b025=_0x30b025-0x0;var _0x48ae21=_0x4975[_0x30b025];return _0x48ae21;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index ccaf0ed..6408b00 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 _0x57ca=['create','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post'];(function(_0xc5878f,_0x3f5372){var _0x430039=function(_0x4ebb2f){while(--_0x4ebb2f){_0xc5878f['push'](_0xc5878f['shift']());}};_0x430039(++_0x3f5372);}(_0x57ca,0x108));var _0xa57c=function(_0x2c9e98,_0x399466){_0x2c9e98=_0x2c9e98-0x0;var _0xbe0e92=_0x57ca[_0x2c9e98];return _0xbe0e92;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0xf')]('/',auth['isAuthenticated'](),controller[_0xa57c('0x10')]);router['put'](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller['update']);router[_0xa57c('0x11')]('/:id',auth[_0xa57c('0x9')](),controller[_0xa57c('0x12')]);module[_0xa57c('0x13')]=router; \ No newline at end of file +var _0xafb9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','show','getMessages','post','create','update','delete','/:id','destroy','exports','multer'];(function(_0x26166f,_0x4ffe7d){var _0x4f0376=function(_0x8b211){while(--_0x8b211){_0x26166f['push'](_0x26166f['shift']());}};_0x4f0376(++_0x4ffe7d);}(_0xafb9,0x68));var _0x9afb=function(_0x4a3879,_0xf0a572){_0x4a3879=_0x4a3879-0x0;var _0x6813dd=_0xafb9[_0x4a3879];return _0x6813dd;};'use strict';var multer=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var path=require(_0x9afb('0x2'));var timeout=require(_0x9afb('0x3'));var express=require(_0x9afb('0x4'));var router=express[_0x9afb('0x5')]();var fs_extra=require(_0x9afb('0x6'));var auth=require(_0x9afb('0x7'));var interaction=require(_0x9afb('0x8'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x9afb('0x9')]('/',auth['isAuthenticated'](),controller[_0x9afb('0xa')]);router['get']('/:id',auth[_0x9afb('0xb')](),controller[_0x9afb('0xc')]);router[_0x9afb('0x9')]('/:id/messages',auth[_0x9afb('0xb')](),controller[_0x9afb('0xd')]);router[_0x9afb('0xe')]('/',auth[_0x9afb('0xb')](),controller[_0x9afb('0xf')]);router['put']('/:id',auth[_0x9afb('0xb')](),controller[_0x9afb('0x10')]);router[_0x9afb('0x11')](_0x9afb('0x12'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x13')]);module[_0x9afb('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 4eb2d93..11aba28 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 _0xc850=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','mailbox','sequelize','exports','from-voicemail','contest_mailbox','STRING','setDataValue','string','trim','central'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xc850,0x13b));var _0x0c85=function(_0x45938a,_0x5b590a){_0x45938a=_0x45938a-0x0;var _0x46b755=_0xc850[_0x45938a];return _0x46b755;};'use strict';var Sequelize=require(_0x0c85('0x0'));module[_0x0c85('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x0c85('0x2'),'unique':_0x0c85('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x0c85('0x3')},'password':{'type':Sequelize[_0x0c85('0x4')]},'fullname':{'type':Sequelize[_0x0c85('0x4')]},'email':{'type':Sequelize[_0x0c85('0x4')],'validate':{'isEmail':!![]},'set':function(_0x33de23){this[_0x0c85('0x5')]('email',typeof _0x33de23===_0x0c85('0x6')&&_0x33de23['trim']()?_0x33de23[_0x0c85('0x7')]():null);}},'pager':{'type':Sequelize[_0x0c85('0x4')]},'tz':{'type':Sequelize[_0x0c85('0x4')],'defaultValue':_0x0c85('0x8')},'attach':{'type':Sequelize[_0x0c85('0x9')]('yes','no'),'defaultValue':_0x0c85('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':_0x0c85('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0c85('0x4')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0c85('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':_0x0c85('0xa'),'allowNull':![]},'stamp':{'type':_0x0c85('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x0c85('0x4')]},'maxsecs':{'type':Sequelize[_0x0c85('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x0c85('0xe')],'get':function(){return this['getDataValue'](_0x0c85('0xf'))+_0x0c85('0x10')+this['getDataValue'](_0x0c85('0x11'));}}}; \ No newline at end of file +var _0xd3a4=['TINYINT(4)','INTEGER','fullname','\x20-\x20','getDataValue','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3a4,0xb0));var _0x4d3a=function(_0x4cfce3,_0x5cfba0){_0x4cfce3=_0x4cfce3-0x0;var _0xd71772=_0xd3a4[_0x4cfce3];return _0xd71772;};'use strict';var Sequelize=require('sequelize');module[_0x4d3a('0x0')]={'customer_id':{'type':Sequelize[_0x4d3a('0x1')]},'context':{'type':Sequelize[_0x4d3a('0x1')],'defaultValue':_0x4d3a('0x2'),'unique':_0x4d3a('0x3')},'mailbox':{'type':Sequelize[_0x4d3a('0x1')],'defaultValue':'','allowNull':![],'unique':_0x4d3a('0x3')},'password':{'type':Sequelize[_0x4d3a('0x1')]},'fullname':{'type':Sequelize[_0x4d3a('0x1')]},'email':{'type':Sequelize[_0x4d3a('0x1')],'validate':{'isEmail':!![]},'set':function(_0x241306){this[_0x4d3a('0x4')](_0x4d3a('0x5'),typeof _0x241306===_0x4d3a('0x6')&&_0x241306[_0x4d3a('0x7')]()?_0x241306[_0x4d3a('0x7')]():null);}},'pager':{'type':Sequelize[_0x4d3a('0x1')]},'tz':{'type':Sequelize[_0x4d3a('0x1')],'defaultValue':_0x4d3a('0x8')},'attach':{'type':Sequelize[_0x4d3a('0x9')](_0x4d3a('0xa'),'no'),'defaultValue':_0x4d3a('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x4d3a('0x9')](_0x4d3a('0xa'),'no'),'defaultValue':_0x4d3a('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x4d3a('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x4d3a('0x9')](_0x4d3a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x4d3a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4d3a('0x9')](_0x4d3a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4d3a('0x9')](_0x4d3a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4d3a('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x4d3a('0x9')](_0x4d3a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4d3a('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4d3a('0x9')](_0x4d3a('0xa'),'no'),'defaultValue':_0x4d3a('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x4d3a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4d3a('0x9')](_0x4d3a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x4d3a('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x4d3a('0x1')]},'emailbody':{'type':Sequelize[_0x4d3a('0x1')]},'maxsecs':{'type':Sequelize[_0x4d3a('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x4d3a('0xd'))+_0x4d3a('0xe')+this[_0x4d3a('0xf')](_0x4d3a('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 6a0691a..e89a621 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 _0x0bb5=['error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','hasOwnProperty','mailbox','findAndCountAll','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','Voicemails'];(function(_0x2991ea,_0x4a0231){var _0x4e1c51=function(_0x59ed64){while(--_0x59ed64){_0x2991ea['push'](_0x2991ea['shift']());}};_0x4e1c51(++_0x4a0231);}(_0x0bb5,0x148));var _0x50bb=function(_0x471b65,_0x172e62){_0x471b65=_0x471b65-0x0;var _0x41e6d1=_0x0bb5[_0x471b65];return _0x41e6d1;};'use strict';var emlformat=require(_0x50bb('0x0'));var rimraf=require(_0x50bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x50bb('0x2'));var moment=require(_0x50bb('0x3'));var BPromise=require(_0x50bb('0x4'));var Mustache=require(_0x50bb('0x5'));var util=require(_0x50bb('0x6'));var path=require(_0x50bb('0x7'));var sox=require(_0x50bb('0x8'));var csv=require(_0x50bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var licenseUtil=require(_0x50bb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226370,_0x58837d){_0x58837d=_0x58837d||0xcc;return function(_0x283f04){if(_0x283f04){return _0x226370[_0x50bb('0x19')](_0x58837d);}return _0x226370[_0x50bb('0x1a')](_0x58837d)['end']();};}function respondWithResult(_0x17007f,_0x309986){_0x309986=_0x309986||0xc8;return function(_0x3094f2){if(_0x3094f2){return _0x17007f['status'](_0x309986)[_0x50bb('0x1b')](_0x3094f2);}};}function respondWithFilteredResult(_0x5e8478,_0x21befa){return function(_0x3e1a51){if(_0x3e1a51){var _0x253073=typeof _0x21befa[_0x50bb('0x1c')]===_0x50bb('0x1d')&&typeof _0x21befa['limit']===_0x50bb('0x1d');var _0x174065=_0x3e1a51['count'];var _0x24ba19=_0x253073?0x0:_0x21befa['offset'];var _0x301f61=_0x253073?_0x3e1a51[_0x50bb('0x1e')]:_0x21befa['offset']+_0x21befa['limit'];var _0x43465b;if(_0x301f61>=_0x174065){_0x301f61=_0x174065;_0x43465b=0xc8;}else{_0x43465b=0xce;}_0x5e8478[_0x50bb('0x1a')](_0x43465b);return _0x5e8478[_0x50bb('0x1f')](_0x50bb('0x20'),_0x24ba19+'-'+_0x301f61+'/'+_0x174065)['json'](_0x3e1a51);}return null;};}function patchUpdates(_0x19dc5d){return function(_0x32bfc3){try{jsonpatch[_0x50bb('0x21')](_0x32bfc3,_0x19dc5d,!![]);}catch(_0x597e95){return BPromise[_0x50bb('0x22')](_0x597e95);}return _0x32bfc3[_0x50bb('0x23')]();};}function saveUpdates(_0x1344ec,_0x4825f8){return function(_0x1dbba2){if(_0x1dbba2){return _0x1dbba2['update'](_0x1344ec)[_0x50bb('0x24')](function(_0x3391da){return _0x3391da;});}return null;};}function removeEntity(_0x1a2a0b,_0x2ee87a){return function(_0x846311){if(_0x846311){return _0x846311[_0x50bb('0x25')]()['then'](function(){var _0xad17ac=_0x846311[_0x50bb('0x26')]({'plain':!![]});var _0x284a76=_0x50bb('0x27');return db['UserProfileResource'][_0x50bb('0x25')]({'where':{'type':_0x284a76,'resourceId':_0xad17ac['id']}})['then'](function(){return _0x846311;});})['then'](function(){_0x1a2a0b[_0x50bb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cfe4b,_0x41fd89){return function(_0x12ee2c){if(!_0x12ee2c){_0x5cfe4b[_0x50bb('0x19')](0x194);}return _0x12ee2c;};}function handleError(_0x1b74f9,_0x17c158){_0x17c158=_0x17c158||0x1f4;return function(_0x269479){logger[_0x50bb('0x28')](_0x269479[_0x50bb('0x29')]);if(_0x269479['name']){delete _0x269479[_0x50bb('0x2a')];}_0x1b74f9[_0x50bb('0x1a')](_0x17c158)[_0x50bb('0x2b')](_0x269479);};}exports[_0x50bb('0x2c')]=function(_0x560b07,_0x13dc3c){var _0x1a62fb={},_0xc38da5={},_0xb3c3ba={'count':0x0,'rows':[]};var _0x3fd5f6=_[_0x50bb('0x2d')](db[_0x50bb('0x2e')][_0x50bb('0x2f')],function(_0x5cfdd5){return{'name':_0x5cfdd5[_0x50bb('0x30')],'type':_0x5cfdd5[_0x50bb('0x31')][_0x50bb('0x32')]};});_0xc38da5['model']=_[_0x50bb('0x2d')](_0x3fd5f6,_0x50bb('0x2a'));_0xc38da5[_0x50bb('0x33')]=_[_0x50bb('0x34')](_0x560b07[_0x50bb('0x33')]);_0xc38da5[_0x50bb('0x35')]=_[_0x50bb('0x36')](_0xc38da5[_0x50bb('0x37')],_0xc38da5[_0x50bb('0x33')]);_0x1a62fb[_0x50bb('0x38')]=_[_0x50bb('0x36')](_0xc38da5['model'],qs[_0x50bb('0x39')](_0x560b07[_0x50bb('0x33')][_0x50bb('0x39')]));_0x1a62fb[_0x50bb('0x38')]=_0x1a62fb[_0x50bb('0x38')][_0x50bb('0x3a')]?_0x1a62fb['attributes']:_0xc38da5['model'];if(!_0x560b07[_0x50bb('0x33')]['hasOwnProperty'](_0x50bb('0x3b'))){_0x1a62fb[_0x50bb('0x3c')]=qs[_0x50bb('0x3c')](_0x560b07[_0x50bb('0x33')][_0x50bb('0x3c')]);_0x1a62fb['offset']=qs[_0x50bb('0x1c')](_0x560b07['query'][_0x50bb('0x1c')]);}_0x1a62fb[_0x50bb('0x3d')]=qs[_0x50bb('0x3e')](_0x560b07['query']['sort']);_0x1a62fb[_0x50bb('0x3f')]=qs[_0x50bb('0x35')](_[_0x50bb('0x40')](_0x560b07[_0x50bb('0x33')],_0xc38da5['filters']),_0x3fd5f6);if(_0x560b07[_0x50bb('0x33')]['filter']){_0x1a62fb['where']=_[_0x50bb('0x41')](_0x1a62fb['where'],{'$or':_[_0x50bb('0x2d')](_0x3fd5f6,function(_0x3d94b8){if(_0x3d94b8[_0x50bb('0x31')]!==_0x50bb('0x42')){var _0x3a9fe4={};_0x3a9fe4[_0x3d94b8[_0x50bb('0x2a')]]={'$like':'%'+_0x560b07[_0x50bb('0x33')][_0x50bb('0x43')]+'%'};return _0x3a9fe4;}})});}_0x1a62fb=_[_0x50bb('0x41')]({},_0x1a62fb,_0x560b07[_0x50bb('0x44')]);var _0x594f16={'where':_0x1a62fb['where']};return db[_0x50bb('0x2e')][_0x50bb('0x1e')](_0x594f16)[_0x50bb('0x24')](function(_0x1d929d){_0xb3c3ba['count']=_0x1d929d;if(_0x560b07[_0x50bb('0x33')]['includeAll']){_0x1a62fb[_0x50bb('0x45')]=[{'all':!![]}];}return db[_0x50bb('0x2e')][_0x50bb('0x46')](_0x1a62fb);})[_0x50bb('0x24')](function(_0x1c438b){_0xb3c3ba[_0x50bb('0x47')]=_0x1c438b;return _0xb3c3ba;})[_0x50bb('0x24')](respondWithFilteredResult(_0x13dc3c,_0x1a62fb))[_0x50bb('0x48')](handleError(_0x13dc3c,null));};exports[_0x50bb('0x49')]=function(_0x46c1c3,_0x349474){var _0x24e375={'raw':!![],'where':{'id':_0x46c1c3[_0x50bb('0x4a')]['id']}},_0x85b0ff={};_0x85b0ff[_0x50bb('0x37')]=_[_0x50bb('0x34')](db['VoiceMail'][_0x50bb('0x2f')]);_0x85b0ff['query']=_[_0x50bb('0x34')](_0x46c1c3[_0x50bb('0x33')]);_0x85b0ff[_0x50bb('0x35')]=_[_0x50bb('0x36')](_0x85b0ff[_0x50bb('0x37')],_0x85b0ff[_0x50bb('0x33')]);_0x24e375[_0x50bb('0x38')]=_[_0x50bb('0x36')](_0x85b0ff[_0x50bb('0x37')],qs[_0x50bb('0x39')](_0x46c1c3[_0x50bb('0x33')][_0x50bb('0x39')]));_0x24e375[_0x50bb('0x38')]=_0x24e375[_0x50bb('0x38')]['length']?_0x24e375[_0x50bb('0x38')]:_0x85b0ff['model'];if(_0x46c1c3[_0x50bb('0x33')][_0x50bb('0x4b')]){_0x24e375[_0x50bb('0x45')]=[{'all':!![]}];}_0x24e375=_[_0x50bb('0x41')]({},_0x24e375,_0x46c1c3[_0x50bb('0x44')]);return db[_0x50bb('0x2e')][_0x50bb('0x4c')](_0x24e375)[_0x50bb('0x24')](handleEntityNotFound(_0x349474,null))['then'](respondWithResult(_0x349474,null))[_0x50bb('0x48')](handleError(_0x349474,null));};exports[_0x50bb('0x4d')]=function(_0xf52a22,_0x13afe2){return db[_0x50bb('0x2e')]['create'](_0xf52a22[_0x50bb('0x4e')],{})[_0x50bb('0x24')](function(_0x2a411d){var _0x154ff8=_0xf52a22[_0x50bb('0x4f')]['get']({'plain':!![]});if(!_0x154ff8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x154ff8[_0x50bb('0x50')]==='user'){var _0x357d08=_0x2a411d['get']({'plain':!![]});var _0x4316e4=_0x50bb('0x27');return db[_0x50bb('0x51')]['find']({'where':{'name':_0x4316e4,'userProfileId':_0x154ff8[_0x50bb('0x52')]},'raw':!![]})[_0x50bb('0x24')](function(_0x588dfe){if(_0x588dfe&&_0x588dfe[_0x50bb('0x53')]===0x0){return db[_0x50bb('0x54')][_0x50bb('0x4d')]({'name':_0x357d08[_0x50bb('0x2a')],'resourceId':_0x357d08['id'],'type':_0x588dfe['name'],'sectionId':_0x588dfe['id']},{})[_0x50bb('0x24')](function(){return _0x2a411d;});}else{return _0x2a411d;}})[_0x50bb('0x48')](function(_0x2e0032){logger[_0x50bb('0x28')](_0x50bb('0x55'),_0x2e0032);throw _0x2e0032;});}return _0x2a411d;})['then'](respondWithResult(_0x13afe2,0xc9))[_0x50bb('0x48')](handleError(_0x13afe2,null));};exports['update']=function(_0x38a775,_0x50216f){if(_0x38a775['body']['id']){delete _0x38a775[_0x50bb('0x4e')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x38a775[_0x50bb('0x4a')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x50216f,null))[_0x50bb('0x24')](saveUpdates(_0x38a775[_0x50bb('0x4e')],null))[_0x50bb('0x24')](respondWithResult(_0x50216f,null))[_0x50bb('0x48')](handleError(_0x50216f,null));};exports[_0x50bb('0x25')]=function(_0x1408fa,_0x57d749){return db['VoiceMail'][_0x50bb('0x4c')]({'where':{'id':_0x1408fa[_0x50bb('0x4a')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x57d749,null))[_0x50bb('0x24')](removeEntity(_0x57d749,null))[_0x50bb('0x48')](handleError(_0x57d749,null));};exports[_0x50bb('0x56')]=function(_0x287bc7,_0x4bf426,_0x3be83b){return db[_0x50bb('0x2e')][_0x50bb('0x57')]({'where':{'id':_0x287bc7[_0x50bb('0x4a')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x4bf426,null))['then'](function(_0x33ebe6){var _0x1d8b85;var _0x1da5cd={},_0x507f26={};_0x507f26[_0x50bb('0x37')]=_['keys'](db[_0x50bb('0x58')]['rawAttributes']);_0x507f26['query']=_[_0x50bb('0x34')](_0x287bc7[_0x50bb('0x33')]);_0x507f26[_0x50bb('0x35')]=_[_0x50bb('0x36')](_0x507f26[_0x50bb('0x37')],_0x507f26[_0x50bb('0x33')]);_0x1da5cd[_0x50bb('0x38')]=_[_0x50bb('0x36')](_0x507f26[_0x50bb('0x37')],qs[_0x50bb('0x39')](_0x287bc7[_0x50bb('0x33')]['fields']));_0x1da5cd[_0x50bb('0x38')]=_0x1da5cd['attributes'][_0x50bb('0x3a')]?_0x1da5cd[_0x50bb('0x38')]:_0x507f26['model'];if(!_0x287bc7[_0x50bb('0x33')][_0x50bb('0x59')](_0x50bb('0x3b'))){_0x1da5cd[_0x50bb('0x3c')]=qs[_0x50bb('0x3c')](_0x287bc7[_0x50bb('0x33')][_0x50bb('0x3c')]);_0x1da5cd[_0x50bb('0x1c')]=qs['offset'](_0x287bc7[_0x50bb('0x33')][_0x50bb('0x1c')]);}_0x1da5cd[_0x50bb('0x3d')]=qs['sort'](_0x287bc7[_0x50bb('0x33')][_0x50bb('0x3e')]);_0x1da5cd[_0x50bb('0x3f')]=qs[_0x50bb('0x35')](_[_0x50bb('0x40')](_0x287bc7[_0x50bb('0x33')],_0x507f26['filters']));if(_0x287bc7[_0x50bb('0x33')][_0x50bb('0x43')]){_0x1da5cd[_0x50bb('0x3f')]=_[_0x50bb('0x41')](_0x1da5cd[_0x50bb('0x3f')],{'$or':_[_0x50bb('0x2d')](_0x1da5cd['attributes'],function(_0x40257b){var _0xa85833={};_0xa85833[_0x40257b]={'$like':'%'+_0x287bc7[_0x50bb('0x33')][_0x50bb('0x43')]+'%'};return _0xa85833;})});}_0x1da5cd[_0x50bb('0x3f')]=_[_0x50bb('0x41')](_0x1da5cd[_0x50bb('0x3f')],{'mailboxuser':_0x33ebe6[_0x50bb('0x5a')]});_0x1da5cd=_[_0x50bb('0x41')]({},_0x1da5cd,_0x287bc7['options']);return db[_0x50bb('0x58')][_0x50bb('0x5b')](_0x1da5cd)[_0x50bb('0x24')](respondWithFilteredResult(_0x4bf426,_0x1da5cd));})[_0x50bb('0x48')](handleError(_0x4bf426,null));}; \ No newline at end of file +var _0xcf66=['nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','VoiceMail','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0xcf66,0x71));var _0x6cf6=function(_0x2b8410,_0x257ebc){_0x2b8410=_0x2b8410-0x0;var _0x3dbbe2=_0xcf66[_0x2b8410];return _0x3dbbe2;};'use strict';var emlformat=require(_0x6cf6('0x0'));var rimraf=require(_0x6cf6('0x1'));var zipdir=require(_0x6cf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cf6('0x3'));var moment=require(_0x6cf6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cf6('0x5'));var path=require(_0x6cf6('0x6'));var sox=require('sox');var csv=require(_0x6cf6('0x7'));var ejs=require(_0x6cf6('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf6('0x9'));var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x7'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fdfea,_0x13b1ad){_0x13b1ad=_0x13b1ad||0xcc;return function(_0x372d12){if(_0x372d12){return _0x3fdfea[_0x6cf6('0x14')](_0x13b1ad);}return _0x3fdfea[_0x6cf6('0x15')](_0x13b1ad)[_0x6cf6('0x16')]();};}function respondWithResult(_0x57909f,_0x32fe64){_0x32fe64=_0x32fe64||0xc8;return function(_0x494ece){if(_0x494ece){return _0x57909f[_0x6cf6('0x15')](_0x32fe64)[_0x6cf6('0x17')](_0x494ece);}};}function respondWithFilteredResult(_0x4b073f,_0x40e413){return function(_0x1b40f8){if(_0x1b40f8){var _0x2d23ab=typeof _0x40e413[_0x6cf6('0x18')]===_0x6cf6('0x19')&&typeof _0x40e413[_0x6cf6('0x1a')]===_0x6cf6('0x19');var _0x39ec25=_0x1b40f8[_0x6cf6('0x1b')];var _0x2ca2b1=_0x2d23ab?0x0:_0x40e413['offset'];var _0x11d994=_0x2d23ab?_0x1b40f8[_0x6cf6('0x1b')]:_0x40e413[_0x6cf6('0x18')]+_0x40e413['limit'];var _0x18abd9;if(_0x11d994>=_0x39ec25){_0x11d994=_0x39ec25;_0x18abd9=0xc8;}else{_0x18abd9=0xce;}_0x4b073f[_0x6cf6('0x15')](_0x18abd9);return _0x4b073f[_0x6cf6('0x1c')](_0x6cf6('0x1d'),_0x2ca2b1+'-'+_0x11d994+'/'+_0x39ec25)[_0x6cf6('0x17')](_0x1b40f8);}return null;};}function patchUpdates(_0x21e903){return function(_0x123993){try{jsonpatch['apply'](_0x123993,_0x21e903,!![]);}catch(_0x19f2cd){return BPromise[_0x6cf6('0x1e')](_0x19f2cd);}return _0x123993[_0x6cf6('0x1f')]();};}function saveUpdates(_0x380a40,_0x5cba3a){return function(_0x470ea4){if(_0x470ea4){return _0x470ea4[_0x6cf6('0x20')](_0x380a40)[_0x6cf6('0x21')](function(_0x5b2767){return _0x5b2767;});}return null;};}function removeEntity(_0x5b30e0,_0x276225){return function(_0x59f838){if(_0x59f838){return _0x59f838[_0x6cf6('0x22')]()[_0x6cf6('0x21')](function(){var _0x14ae3e=_0x59f838[_0x6cf6('0x23')]({'plain':!![]});var _0x3f9871=_0x6cf6('0x24');return db[_0x6cf6('0x25')]['destroy']({'where':{'type':_0x3f9871,'resourceId':_0x14ae3e['id']}})[_0x6cf6('0x21')](function(){return _0x59f838;});})[_0x6cf6('0x21')](function(){_0x5b30e0[_0x6cf6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4eec5,_0x2e56ca){return function(_0x2224db){if(!_0x2224db){_0xf4eec5[_0x6cf6('0x14')](0x194);}return _0x2224db;};}function handleError(_0x5c9236,_0x584594){_0x584594=_0x584594||0x1f4;return function(_0x2afe84){logger[_0x6cf6('0x26')](_0x2afe84[_0x6cf6('0x27')]);if(_0x2afe84[_0x6cf6('0x28')]){delete _0x2afe84['name'];}_0x5c9236[_0x6cf6('0x15')](_0x584594)['send'](_0x2afe84);};}exports['index']=function(_0x519a70,_0x10bde5){var _0x65433={},_0x33d308={},_0x42f488={'count':0x0,'rows':[]};var _0x11c848=_['map'](db[_0x6cf6('0x29')][_0x6cf6('0x2a')],function(_0x356340){return{'name':_0x356340['fieldName'],'type':_0x356340[_0x6cf6('0x2b')][_0x6cf6('0x2c')]};});_0x33d308[_0x6cf6('0x2d')]=_[_0x6cf6('0x2e')](_0x11c848,_0x6cf6('0x28'));_0x33d308[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x519a70[_0x6cf6('0x2f')]);_0x33d308[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],_0x33d308[_0x6cf6('0x2f')]);_0x65433[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],qs[_0x6cf6('0x34')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0x65433['attributes']=_0x65433[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x65433[_0x6cf6('0x33')]:_0x33d308[_0x6cf6('0x2d')];if(!_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x36')](_0x6cf6('0x37'))){_0x65433[_0x6cf6('0x1a')]=qs[_0x6cf6('0x1a')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x65433['offset']=qs[_0x6cf6('0x18')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x18')]);}_0x65433[_0x6cf6('0x38')]=qs[_0x6cf6('0x39')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x39')]);_0x65433[_0x6cf6('0x3a')]=qs[_0x6cf6('0x31')](_['pick'](_0x519a70[_0x6cf6('0x2f')],_0x33d308[_0x6cf6('0x31')]),_0x11c848);if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x65433[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x65433[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x11c848,function(_0x3a7c3b){if(_0x3a7c3b['type']!==_0x6cf6('0x3d')){var _0x5a9727={};_0x5a9727[_0x3a7c3b[_0x6cf6('0x28')]]={'$like':'%'+_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]+'%'};return _0x5a9727;}})});}_0x65433=_[_0x6cf6('0x3c')]({},_0x65433,_0x519a70[_0x6cf6('0x3e')]);var _0x29541e={'where':_0x65433[_0x6cf6('0x3a')]};return db[_0x6cf6('0x29')]['count'](_0x29541e)[_0x6cf6('0x21')](function(_0x335dce){_0x42f488['count']=_0x335dce;if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0x65433[_0x6cf6('0x40')]=[{'all':!![]}];}return db['VoiceMail'][_0x6cf6('0x41')](_0x65433);})[_0x6cf6('0x21')](function(_0x51d915){_0x42f488[_0x6cf6('0x42')]=_0x51d915;return _0x42f488;})[_0x6cf6('0x21')](respondWithFilteredResult(_0x10bde5,_0x65433))[_0x6cf6('0x43')](handleError(_0x10bde5,null));};exports[_0x6cf6('0x44')]=function(_0x41195e,_0x20dacd){var _0xbcb6a7={'raw':!![],'where':{'id':_0x41195e[_0x6cf6('0x45')]['id']}},_0x5a2ef8={};_0x5a2ef8['model']=_[_0x6cf6('0x30')](db[_0x6cf6('0x29')]['rawAttributes']);_0x5a2ef8[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x41195e[_0x6cf6('0x2f')]);_0x5a2ef8[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],_0x5a2ef8[_0x6cf6('0x2f')]);_0xbcb6a7[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],qs[_0x6cf6('0x34')](_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0xbcb6a7['attributes']=_0xbcb6a7[_0x6cf6('0x33')]['length']?_0xbcb6a7['attributes']:_0x5a2ef8[_0x6cf6('0x2d')];if(_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0xbcb6a7[_0x6cf6('0x40')]=[{'all':!![]}];}_0xbcb6a7=_[_0x6cf6('0x3c')]({},_0xbcb6a7,_0x41195e[_0x6cf6('0x3e')]);return db[_0x6cf6('0x29')][_0x6cf6('0x46')](_0xbcb6a7)[_0x6cf6('0x21')](handleEntityNotFound(_0x20dacd,null))[_0x6cf6('0x21')](respondWithResult(_0x20dacd,null))[_0x6cf6('0x43')](handleError(_0x20dacd,null));};exports[_0x6cf6('0x47')]=function(_0x3786d1,_0x4c8ada){return db[_0x6cf6('0x29')][_0x6cf6('0x47')](_0x3786d1['body'],{})['then'](function(_0x10047a){var _0x17dd6e=_0x3786d1[_0x6cf6('0x48')][_0x6cf6('0x23')]({'plain':!![]});if(!_0x17dd6e)throw new Error(_0x6cf6('0x49'));if(_0x17dd6e[_0x6cf6('0x4a')]==='user'){var _0x115b9b=_0x10047a[_0x6cf6('0x23')]({'plain':!![]});var _0x2503dc='Voicemails';return db['UserProfileSection'][_0x6cf6('0x46')]({'where':{'name':_0x2503dc,'userProfileId':_0x17dd6e[_0x6cf6('0x4b')]},'raw':!![]})[_0x6cf6('0x21')](function(_0x255e88){if(_0x255e88&&_0x255e88[_0x6cf6('0x4c')]===0x0){return db[_0x6cf6('0x25')][_0x6cf6('0x47')]({'name':_0x115b9b[_0x6cf6('0x28')],'resourceId':_0x115b9b['id'],'type':_0x255e88[_0x6cf6('0x28')],'sectionId':_0x255e88['id']},{})[_0x6cf6('0x21')](function(){return _0x10047a;});}else{return _0x10047a;}})['catch'](function(_0x217072){logger[_0x6cf6('0x26')](_0x6cf6('0x4d'),_0x217072);throw _0x217072;});}return _0x10047a;})[_0x6cf6('0x21')](respondWithResult(_0x4c8ada,0xc9))[_0x6cf6('0x43')](handleError(_0x4c8ada,null));};exports[_0x6cf6('0x20')]=function(_0x2e1ee7,_0xce361){if(_0x2e1ee7[_0x6cf6('0x4e')]['id']){delete _0x2e1ee7[_0x6cf6('0x4e')]['id'];}return db[_0x6cf6('0x29')]['find']({'where':{'id':_0x2e1ee7[_0x6cf6('0x45')]['id']}})['then'](handleEntityNotFound(_0xce361,null))[_0x6cf6('0x21')](saveUpdates(_0x2e1ee7[_0x6cf6('0x4e')],null))['then'](respondWithResult(_0xce361,null))[_0x6cf6('0x43')](handleError(_0xce361,null));};exports[_0x6cf6('0x22')]=function(_0x4699d5,_0x1bdbc1){return db[_0x6cf6('0x29')][_0x6cf6('0x46')]({'where':{'id':_0x4699d5['params']['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x1bdbc1,null))[_0x6cf6('0x21')](removeEntity(_0x1bdbc1,null))[_0x6cf6('0x43')](handleError(_0x1bdbc1,null));};exports['getMessages']=function(_0x4f1de3,_0x2c8736,_0x140ed2){return db['VoiceMail'][_0x6cf6('0x4f')]({'where':{'id':_0x4f1de3[_0x6cf6('0x45')]['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x2c8736,null))[_0x6cf6('0x21')](function(_0x2e460a){var _0x58ec7e;var _0x3e7e5b={},_0x40b31f={};_0x40b31f['model']=_['keys'](db[_0x6cf6('0x50')][_0x6cf6('0x2a')]);_0x40b31f[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x4f1de3[_0x6cf6('0x2f')]);_0x40b31f['filters']=_['intersection'](_0x40b31f[_0x6cf6('0x2d')],_0x40b31f[_0x6cf6('0x2f')]);_0x3e7e5b[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x40b31f[_0x6cf6('0x2d')],qs['fields'](_0x4f1de3['query']['fields']));_0x3e7e5b[_0x6cf6('0x33')]=_0x3e7e5b[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x3e7e5b[_0x6cf6('0x33')]:_0x40b31f['model'];if(!_0x4f1de3[_0x6cf6('0x2f')]['hasOwnProperty'](_0x6cf6('0x37'))){_0x3e7e5b['limit']=qs[_0x6cf6('0x1a')](_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x3e7e5b[_0x6cf6('0x18')]=qs[_0x6cf6('0x18')](_0x4f1de3['query'][_0x6cf6('0x18')]);}_0x3e7e5b['order']=qs[_0x6cf6('0x39')](_0x4f1de3['query'][_0x6cf6('0x39')]);_0x3e7e5b['where']=qs[_0x6cf6('0x31')](_[_0x6cf6('0x51')](_0x4f1de3['query'],_0x40b31f[_0x6cf6('0x31')]));if(_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x3e7e5b[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x3e7e5b[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x3e7e5b['attributes'],function(_0x4ff62b){var _0x2df3ea={};_0x2df3ea[_0x4ff62b]={'$like':'%'+_0x4f1de3[_0x6cf6('0x2f')]['filter']+'%'};return _0x2df3ea;})});}_0x3e7e5b[_0x6cf6('0x3a')]=_['merge'](_0x3e7e5b['where'],{'mailboxuser':_0x2e460a[_0x6cf6('0x52')]});_0x3e7e5b=_['merge']({},_0x3e7e5b,_0x4f1de3['options']);return db[_0x6cf6('0x50')][_0x6cf6('0x53')](_0x3e7e5b)[_0x6cf6('0x21')](respondWithFilteredResult(_0x2c8736,_0x3e7e5b));})['catch'](handleError(_0x2c8736,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index fd550b4..590d08c 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 _0x86ac=['util','moment','request-promise','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0x86ac,0x78));var _0xc86a=function(_0x2e43f6,_0x5bb9db){_0x2e43f6=_0x2e43f6-0x0;var _0xff88fa=_0x86ac[_0x2e43f6];return _0xff88fa;};'use strict';var _=require(_0xc86a('0x0'));var util=require(_0xc86a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc86a('0x2'));var BPromise=require('bluebird');var rp=require(_0xc86a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc86a('0x4'));var attributes=require('./voiceMail.attributes');module[_0xc86a('0x5')]=function(_0x361713,_0x393129){return _0x361713[_0xc86a('0x6')](_0xc86a('0x7'),attributes,{'tableName':_0xc86a('0x8'),'paranoid':![],'indexes':[{'name':_0xc86a('0x9'),'fields':[_0xc86a('0xa'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1101=['mailbox','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context'];(function(_0x3e5745,_0x3e253b){var _0xd89f3a=function(_0x1be253){while(--_0x1be253){_0x3e5745['push'](_0x3e5745['shift']());}};_0xd89f3a(++_0x3e253b);}(_0x1101,0xa6));var _0x1110=function(_0xb8d02e,_0x1a97de){_0xb8d02e=_0xb8d02e-0x0;var _0x553a5d=_0x1101[_0xb8d02e];return _0x553a5d;};'use strict';var _=require(_0x1110('0x0'));var util=require(_0x1110('0x1'));var logger=require(_0x1110('0x2'))(_0x1110('0x3'));var moment=require(_0x1110('0x4'));var BPromise=require('bluebird');var rp=require(_0x1110('0x5'));var fs=require('fs');var path=require(_0x1110('0x6'));var rimraf=require(_0x1110('0x7'));var config=require(_0x1110('0x8'));var attributes=require('./voiceMail.attributes');module[_0x1110('0x9')]=function(_0x14ad82,_0x55fa2b){return _0x14ad82[_0x1110('0xa')](_0x1110('0xb'),attributes,{'tableName':_0x1110('0xc'),'paranoid':![],'indexes':[{'name':_0x1110('0xd'),'fields':[_0x1110('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 866c28c..7fe00b8 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 _0xd3c7=['../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x241ac3,_0x310f15){var _0x487476=function(_0x1131f4){while(--_0x1131f4){_0x241ac3['push'](_0x241ac3['shift']());}};_0x487476(++_0x310f15);}(_0xd3c7,0x190));var _0x7d3c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd3c7[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x7d3c('0x0'));var moment=require(_0x7d3c('0x1'));var BPromise=require(_0x7d3c('0x2'));var rs=require(_0x7d3c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d3c('0x4'))['db'];var utils=require(_0x7d3c('0x5'));var logger=require(_0x7d3c('0x6'))(_0x7d3c('0x7'));var config=require(_0x7d3c('0x8'));var jayson=require(_0x7d3c('0x9'));var client=jayson[_0x7d3c('0xa')][_0x7d3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fbde4,_0x3799f1,_0x2e97ce){return new BPromise(function(_0x4cd1e6,_0x475163){return client[_0x7d3c('0xc')](_0x4fbde4,_0x2e97ce)[_0x7d3c('0xd')](function(_0x119075){logger[_0x7d3c('0xe')](_0x7d3c('0xf'),_0x3799f1,'request\x20sent');logger[_0x7d3c('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x3799f1,'request\x20sent',JSON[_0x7d3c('0x11')](_0x119075));if(_0x119075[_0x7d3c('0x12')]){if(_0x119075[_0x7d3c('0x12')][_0x7d3c('0x13')]===0x1f4){logger[_0x7d3c('0x12')](_0x7d3c('0xf'),_0x3799f1,_0x119075[_0x7d3c('0x12')][_0x7d3c('0x14')]);return _0x475163(_0x119075[_0x7d3c('0x12')][_0x7d3c('0x14')]);}logger[_0x7d3c('0x12')]('VoiceMail,\x20%s,\x20%s',_0x3799f1,_0x119075['error'][_0x7d3c('0x14')]);return _0x4cd1e6(_0x119075[_0x7d3c('0x12')][_0x7d3c('0x14')]);}else{logger[_0x7d3c('0xe')](_0x7d3c('0xf'),_0x3799f1,_0x7d3c('0x15'));_0x4cd1e6(_0x119075[_0x7d3c('0x16')][_0x7d3c('0x14')]);}})[_0x7d3c('0x17')](function(_0x33eb58){logger[_0x7d3c('0x12')]('VoiceMail,\x20%s,\x20%s',_0x3799f1,_0x33eb58);_0x475163(_0x33eb58);});});} \ No newline at end of file +var _0x68b3=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','ioredis'];(function(_0x44b203,_0x2ebdad){var _0x16fb4f=function(_0x54d7e5){while(--_0x54d7e5){_0x44b203['push'](_0x44b203['shift']());}};_0x16fb4f(++_0x2ebdad);}(_0x68b3,0x6f));var _0x368b=function(_0x1ac8b8,_0x3e39d8){_0x1ac8b8=_0x1ac8b8-0x0;var _0x2159e0=_0x68b3[_0x1ac8b8];return _0x2159e0;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var moment=require('moment');var BPromise=require(_0x368b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x368b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x368b('0x4'));var logger=require(_0x368b('0x5'))(_0x368b('0x6'));var config=require(_0x368b('0x7'));var jayson=require(_0x368b('0x8'));var client=jayson[_0x368b('0x9')][_0x368b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45b190,_0x1e844a,_0x40aa91){return new BPromise(function(_0x26878f,_0x28b753){return client[_0x368b('0xb')](_0x45b190,_0x40aa91)[_0x368b('0xc')](function(_0x521b9c){logger['info'](_0x368b('0xd'),_0x1e844a,_0x368b('0xe'));logger['debug'](_0x368b('0xf'),_0x1e844a,_0x368b('0xe'),JSON[_0x368b('0x10')](_0x521b9c));if(_0x521b9c[_0x368b('0x11')]){if(_0x521b9c[_0x368b('0x11')][_0x368b('0x12')]===0x1f4){logger[_0x368b('0x11')](_0x368b('0xd'),_0x1e844a,_0x521b9c[_0x368b('0x11')][_0x368b('0x13')]);return _0x28b753(_0x521b9c[_0x368b('0x11')][_0x368b('0x13')]);}logger[_0x368b('0x11')](_0x368b('0xd'),_0x1e844a,_0x521b9c[_0x368b('0x11')][_0x368b('0x13')]);return _0x26878f(_0x521b9c[_0x368b('0x11')][_0x368b('0x13')]);}else{logger[_0x368b('0x14')]('VoiceMail,\x20%s,\x20%s',_0x1e844a,_0x368b('0xe'));_0x26878f(_0x521b9c[_0x368b('0x15')][_0x368b('0x13')]);}})[_0x368b('0x16')](function(_0x436ffe){logger[_0x368b('0x11')](_0x368b('0xd'),_0x1e844a,_0x436ffe);_0x28b753(_0x436ffe);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index dc1ae6d..acbfdee 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 _0xd1f9=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/download','download','post','create','put','update'];(function(_0x3fbf93,_0x297b11){var _0x5662c0=function(_0x3b789c){while(--_0x3b789c){_0x3fbf93['push'](_0x3fbf93['shift']());}};_0x5662c0(++_0x297b11);}(_0xd1f9,0xc9));var _0x9d1f=function(_0x2a8d0f,_0x42983b){_0x2a8d0f=_0x2a8d0f-0x0;var _0xf4cc50=_0xd1f9[_0x2a8d0f];return _0xf4cc50;};'use strict';var multer=require(_0x9d1f('0x0'));var util=require(_0x9d1f('0x1'));var path=require(_0x9d1f('0x2'));var timeout=require(_0x9d1f('0x3'));var express=require(_0x9d1f('0x4'));var router=express[_0x9d1f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9d1f('0x6'));var interaction=require(_0x9d1f('0x7'));var config=require(_0x9d1f('0x8'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0x9d1f('0x9')](),controller[_0x9d1f('0xa')]);router[_0x9d1f('0xb')](_0x9d1f('0xc'),auth[_0x9d1f('0x9')](),controller['show']);router[_0x9d1f('0xb')](_0x9d1f('0xd'),auth['isAuthenticated'](),controller[_0x9d1f('0xe')]);router[_0x9d1f('0xf')]('/',auth['isAuthenticated'](),controller[_0x9d1f('0x10')]);router[_0x9d1f('0x11')](_0x9d1f('0xc'),auth['isAuthenticated'](),controller[_0x9d1f('0x12')]);router[_0x9d1f('0x13')](_0x9d1f('0xc'),auth['isAuthenticated'](),controller[_0x9d1f('0x14')]);module[_0x9d1f('0x15')]=router; \ No newline at end of file +var _0x693e=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','show','/:id/download','isAuthenticated','download'];(function(_0x4927eb,_0x4ef04d){var _0xd860ba=function(_0x14734d){while(--_0x14734d){_0x4927eb['push'](_0x4927eb['shift']());}};_0xd860ba(++_0x4ef04d);}(_0x693e,0x1d1));var _0xe693=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x693e[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xe693('0x0'));var util=require(_0xe693('0x1'));var path=require(_0xe693('0x2'));var timeout=require(_0xe693('0x3'));var express=require(_0xe693('0x4'));var router=express['Router']();var fs_extra=require(_0xe693('0x5'));var auth=require(_0xe693('0x6'));var interaction=require(_0xe693('0x7'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0xe693('0x8')]('/',auth['isAuthenticated'](),controller[_0xe693('0x9')]);router[_0xe693('0x8')](_0xe693('0xa'),auth['isAuthenticated'](),controller[_0xe693('0xb')]);router[_0xe693('0x8')](_0xe693('0xc'),auth[_0xe693('0xd')](),controller[_0xe693('0xe')]);router[_0xe693('0xf')]('/',auth[_0xe693('0xd')](),controller[_0xe693('0x10')]);router['put'](_0xe693('0xa'),auth['isAuthenticated'](),controller[_0xe693('0x11')]);router[_0xe693('0x12')](_0xe693('0xa'),auth[_0xe693('0xd')](),controller[_0xe693('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 6da7c80..3139cdd 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 _0x435a=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP'];(function(_0x17f668,_0x47d4a2){var _0x3e314d=function(_0x2e0d26){while(--_0x2e0d26){_0x17f668['push'](_0x17f668['shift']());}};_0x3e314d(++_0x47d4a2);}(_0x435a,0x16a));var _0xa435=function(_0x45f8ae,_0x341d6b){_0x45f8ae=_0x45f8ae-0x0;var _0x489129=_0x435a[_0x45f8ae];return _0x489129;};'use strict';var Sequelize=require(_0xa435('0x0'));module[_0xa435('0x1')]={'name':{'type':Sequelize[_0xa435('0x2')],'get':function(_0x1528a5){return this[_0xa435('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xa435('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xa435('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xa435('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xa435('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xa435('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xa435('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xa435('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xa435('0x5')],'defaultValue':''},'stamp':{'type':_0xa435('0x7'),'defaultValue':Sequelize[_0xa435('0x8')](_0xa435('0x9'))}}; \ No newline at end of file +var _0x0b00=['VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','sequelize','exports'];(function(_0x4dbe77,_0x44ac82){var _0x143766=function(_0x1dbf33){while(--_0x1dbf33){_0x4dbe77['push'](_0x4dbe77['shift']());}};_0x143766(++_0x44ac82);}(_0x0b00,0x134));var _0x00b0=function(_0x277946,_0x317258){_0x277946=_0x277946-0x0;var _0x54c026=_0x0b00[_0x277946];return _0x54c026;};'use strict';var Sequelize=require(_0x00b0('0x0'));module[_0x00b0('0x1')]={'name':{'type':Sequelize[_0x00b0('0x2')],'get':function(_0x3c1798){return this[_0x00b0('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x00b0('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x00b0('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x00b0('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x00b0('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x00b0('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x00b0('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x00b0('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x00b0('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x00b0('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x00b0('0x6')](_0x00b0('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x00b0('0x5')],'defaultValue':''},'stamp':{'type':_0x00b0('0x8'),'defaultValue':Sequelize[_0x00b0('0x9')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 1486854..0f163c4 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 _0x3876=['include','findAll','rows','catch','show','params','find','create','body','update','download','recording','msg_id','ValidationError','attachment','attachment;\x20filename=\x22','eml-format','rimraf','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x2f2da3,_0x3d2ffd){var _0x5a973=function(_0x2d6af6){while(--_0x2d6af6){_0x2f2da3['push'](_0x2f2da3['shift']());}};_0x5a973(++_0x3d2ffd);}(_0x3876,0xb4));var _0x6387=function(_0x1e4afd,_0x17882e){_0x1e4afd=_0x1e4afd-0x0;var _0x1a7891=_0x3876[_0x1e4afd];return _0x1a7891;};'use strict';var emlformat=require(_0x6387('0x0'));var rimraf=require(_0x6387('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6387('0x2'));var moment=require(_0x6387('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6387('0x4'));var util=require('util');var path=require(_0x6387('0x5'));var sox=require('sox');var csv=require(_0x6387('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6387('0x7'));var _=require(_0x6387('0x8'));var squel=require('squel');var crypto=require(_0x6387('0x9'));var jsforce=require(_0x6387('0xa'));var deskjs=require(_0x6387('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6387('0xc'));var Papa=require(_0x6387('0xd'));var Redis=require(_0x6387('0xe'));var authService=require(_0x6387('0xf'));var qs=require(_0x6387('0x10'));var as=require(_0x6387('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6387('0x12'))('api');var utils=require(_0x6387('0x13'));var config=require(_0x6387('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6387('0x15'))['db'];function respondWithStatusCode(_0x3a5629,_0x28fe87){_0x28fe87=_0x28fe87||0xcc;return function(_0x2744b8){if(_0x2744b8){return _0x3a5629[_0x6387('0x16')](_0x28fe87);}return _0x3a5629['status'](_0x28fe87)[_0x6387('0x17')]();};}function respondWithResult(_0x31d3d9,_0x13b837){_0x13b837=_0x13b837||0xc8;return function(_0x10d1e3){if(_0x10d1e3){return _0x31d3d9[_0x6387('0x18')](_0x13b837)[_0x6387('0x19')](_0x10d1e3);}};}function respondWithFilteredResult(_0x3b22c4,_0x195c84){return function(_0x53b54c){if(_0x53b54c){var _0x1d929a=typeof _0x195c84[_0x6387('0x1a')]==='undefined'&&typeof _0x195c84[_0x6387('0x1b')]===_0x6387('0x1c');var _0x5a62a5=_0x53b54c[_0x6387('0x1d')];var _0x33c2c1=_0x1d929a?0x0:_0x195c84['offset'];var _0x588e35=_0x1d929a?_0x53b54c[_0x6387('0x1d')]:_0x195c84['offset']+_0x195c84[_0x6387('0x1b')];var _0x48f1fd;if(_0x588e35>=_0x5a62a5){_0x588e35=_0x5a62a5;_0x48f1fd=0xc8;}else{_0x48f1fd=0xce;}_0x3b22c4[_0x6387('0x18')](_0x48f1fd);return _0x3b22c4[_0x6387('0x1e')](_0x6387('0x1f'),_0x33c2c1+'-'+_0x588e35+'/'+_0x5a62a5)[_0x6387('0x19')](_0x53b54c);}return null;};}function patchUpdates(_0x48e571){return function(_0x4d839f){try{jsonpatch[_0x6387('0x20')](_0x4d839f,_0x48e571,!![]);}catch(_0xee475e){return BPromise['reject'](_0xee475e);}return _0x4d839f[_0x6387('0x21')]();};}function saveUpdates(_0x4267c4,_0x5dc4bc){return function(_0x146109){if(_0x146109){return _0x146109['update'](_0x4267c4)[_0x6387('0x22')](function(_0x530af2){return _0x530af2;});}return null;};}function removeEntity(_0x250b0d,_0x93bea1){return function(_0x31aff6){if(_0x31aff6){return _0x31aff6[_0x6387('0x23')]()[_0x6387('0x22')](function(){_0x250b0d[_0x6387('0x18')](0xcc)[_0x6387('0x17')]();});}};}function handleEntityNotFound(_0x116e6e,_0x4e405a){return function(_0x377592){if(!_0x377592){_0x116e6e[_0x6387('0x16')](0x194);}return _0x377592;};}function handleError(_0x4191a0,_0x1e901a){_0x1e901a=_0x1e901a||0x1f4;return function(_0x5ab01c){logger[_0x6387('0x24')](_0x5ab01c[_0x6387('0x25')]);if(_0x5ab01c[_0x6387('0x26')]){delete _0x5ab01c['name'];}_0x4191a0[_0x6387('0x18')](_0x1e901a)[_0x6387('0x27')](_0x5ab01c);};}exports[_0x6387('0x28')]=function(_0x40273c,_0x2cd6ee){var _0x32b697={},_0x2630b8={},_0x4af183={'count':0x0,'rows':[]};var _0x5c95ff=_[_0x6387('0x29')](db[_0x6387('0x2a')][_0x6387('0x2b')],function(_0x3daa12){return{'name':_0x3daa12[_0x6387('0x2c')],'type':_0x3daa12[_0x6387('0x2d')][_0x6387('0x2e')]};});_0x2630b8[_0x6387('0x2f')]=_[_0x6387('0x30')](_[_0x6387('0x29')](_0x5c95ff,'name'),['name']);_0x2630b8[_0x6387('0x31')]=_[_0x6387('0x32')](_0x40273c[_0x6387('0x31')]);_0x2630b8['filters']=_[_0x6387('0x33')](_0x2630b8[_0x6387('0x2f')],_0x2630b8[_0x6387('0x31')]);_0x32b697[_0x6387('0x34')]=_[_0x6387('0x33')](_0x2630b8[_0x6387('0x2f')],qs[_0x6387('0x35')](_0x40273c[_0x6387('0x31')][_0x6387('0x35')]));_0x32b697['attributes']=_0x32b697[_0x6387('0x34')][_0x6387('0x36')]?_0x32b697[_0x6387('0x34')]:_0x2630b8[_0x6387('0x2f')];if(!_0x40273c['query']['hasOwnProperty'](_0x6387('0x37'))){_0x32b697['limit']=qs['limit'](_0x40273c[_0x6387('0x31')][_0x6387('0x1b')]);_0x32b697[_0x6387('0x1a')]=qs['offset'](_0x40273c[_0x6387('0x31')][_0x6387('0x1a')]);}_0x32b697[_0x6387('0x38')]=qs[_0x6387('0x39')](_0x40273c['query'][_0x6387('0x39')]);_0x32b697['where']=qs[_0x6387('0x3a')](_[_0x6387('0x3b')](_0x40273c[_0x6387('0x31')],_0x2630b8[_0x6387('0x3a')]),_0x5c95ff);if(_0x40273c[_0x6387('0x31')][_0x6387('0x3c')]){_0x32b697[_0x6387('0x3d')]=_[_0x6387('0x3e')](_0x32b697[_0x6387('0x3d')],{'$or':_[_0x6387('0x29')](_0x5c95ff,function(_0x5c265d){if(_0x5c265d['type']!==_0x6387('0x3f')){var _0x4e5735={};_0x4e5735[_0x5c265d[_0x6387('0x26')]]={'$like':'%'+_0x40273c[_0x6387('0x31')][_0x6387('0x3c')]+'%'};return _0x4e5735;}})});}_0x32b697=_[_0x6387('0x3e')]({},_0x32b697,_0x40273c[_0x6387('0x40')]);var _0x14671a={'where':_0x32b697[_0x6387('0x3d')]};return db['VoiceMailMessage'][_0x6387('0x1d')](_0x14671a)['then'](function(_0x395e81){_0x4af183[_0x6387('0x1d')]=_0x395e81;if(_0x40273c['query'][_0x6387('0x41')]){_0x32b697[_0x6387('0x42')]=[{'all':!![]}];}return db[_0x6387('0x2a')][_0x6387('0x43')](_0x32b697);})[_0x6387('0x22')](function(_0x4ef294){_0x4af183[_0x6387('0x44')]=_0x4ef294;return _0x4af183;})['then'](respondWithFilteredResult(_0x2cd6ee,_0x32b697))[_0x6387('0x45')](handleError(_0x2cd6ee,null));};exports[_0x6387('0x46')]=function(_0x20292a,_0x2e2db5){var _0x24beea={'raw':!![],'where':{'id':_0x20292a[_0x6387('0x47')]['id']}},_0x7423f1={};_0x7423f1[_0x6387('0x2f')]=_[_0x6387('0x32')](db[_0x6387('0x2a')][_0x6387('0x2b')]);_0x7423f1[_0x6387('0x31')]=_[_0x6387('0x32')](_0x20292a[_0x6387('0x31')]);_0x7423f1[_0x6387('0x3a')]=_['intersection'](_0x7423f1[_0x6387('0x2f')],_0x7423f1['query']);_0x24beea[_0x6387('0x34')]=_[_0x6387('0x33')](_0x7423f1[_0x6387('0x2f')],qs['fields'](_0x20292a[_0x6387('0x31')]['fields']));_0x24beea['attributes']=_0x24beea['attributes'][_0x6387('0x36')]?_0x24beea[_0x6387('0x34')]:_0x7423f1[_0x6387('0x2f')];if(_0x20292a['query'][_0x6387('0x41')]){_0x24beea['include']=[{'all':!![]}];}_0x24beea=_[_0x6387('0x3e')]({},_0x24beea,_0x20292a[_0x6387('0x40')]);return db[_0x6387('0x2a')][_0x6387('0x48')](_0x24beea)[_0x6387('0x22')](handleEntityNotFound(_0x2e2db5,null))[_0x6387('0x22')](respondWithResult(_0x2e2db5,null))[_0x6387('0x45')](handleError(_0x2e2db5,null));};exports[_0x6387('0x49')]=function(_0x97692e,_0x3997af){return db[_0x6387('0x2a')]['create'](_0x97692e[_0x6387('0x4a')],{})[_0x6387('0x22')](respondWithResult(_0x3997af,0xc9))[_0x6387('0x45')](handleError(_0x3997af,null));};exports[_0x6387('0x4b')]=function(_0x1858c9,_0xe240e0){if(_0x1858c9[_0x6387('0x4a')]['id']){delete _0x1858c9[_0x6387('0x4a')]['id'];}return db[_0x6387('0x2a')][_0x6387('0x48')]({'where':{'id':_0x1858c9[_0x6387('0x47')]['id']}})[_0x6387('0x22')](handleEntityNotFound(_0xe240e0,null))['then'](saveUpdates(_0x1858c9[_0x6387('0x4a')],null))[_0x6387('0x22')](respondWithResult(_0xe240e0,null))[_0x6387('0x45')](handleError(_0xe240e0,null));};exports[_0x6387('0x23')]=function(_0x227b2e,_0x2dfc5f){return db['VoiceMailMessage'][_0x6387('0x48')]({'where':{'id':_0x227b2e[_0x6387('0x47')]['id']}})[_0x6387('0x22')](handleEntityNotFound(_0x2dfc5f,null))[_0x6387('0x22')](removeEntity(_0x2dfc5f,null))['catch'](handleError(_0x2dfc5f,null));};exports[_0x6387('0x4c')]=function(_0x4a2153,_0x2d3222,_0x30e42d){return db[_0x6387('0x2a')][_0x6387('0x48')]({'where':{'id':_0x4a2153[_0x6387('0x47')]['id']},'attributes':['id',_0x6387('0x4d'),_0x6387('0x4e')]})[_0x6387('0x22')](handleEntityNotFound(_0x2d3222,null))[_0x6387('0x22')](function(_0x595ac8){if(_0x595ac8){if(!_0x595ac8['recording']){throw new db['Sequelize'][(_0x6387('0x4f'))]('VoiceMailMessage\x20not\x20found');}var _0x54602a={'Content-Type':'audio/wav','Content-Disposition':_0x6387('0x50')};if(_0x595ac8['msg_id']){_0x54602a['Content-Disposition']=_0x6387('0x51')+_0x595ac8[_0x6387('0x4e')]+'.wav\x22';}_0x2d3222[_0x6387('0x1e')](_0x54602a);return _0x2d3222[_0x6387('0x27')](new Buffer(_0x595ac8[_0x6387('0x4d')]));}})[_0x6387('0x45')](handleError(_0x2d3222,null));}; \ No newline at end of file +var _0xdd23=['save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','type','differenceBy','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','create','body','find','download','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x28bb12,_0x35fe9a){var _0x26d1ae=function(_0x2ae352){while(--_0x2ae352){_0x28bb12['push'](_0x28bb12['shift']());}};_0x26d1ae(++_0x35fe9a);}(_0xdd23,0xdc));var _0x3dd2=function(_0x388266,_0x4520b2){_0x388266=_0x388266-0x0;var _0x58c7e5=_0xdd23[_0x388266];return _0x58c7e5;};'use strict';var emlformat=require(_0x3dd2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dd2('0x1'));var jsonpatch=require(_0x3dd2('0x2'));var rp=require('request-promise');var moment=require(_0x3dd2('0x3'));var BPromise=require(_0x3dd2('0x4'));var Mustache=require(_0x3dd2('0x5'));var util=require(_0x3dd2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3dd2('0x7'));var ejs=require(_0x3dd2('0x8'));var fs=require('fs');var fs_extra=require(_0x3dd2('0x9'));var _=require(_0x3dd2('0xa'));var squel=require(_0x3dd2('0xb'));var crypto=require(_0x3dd2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3dd2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3dd2('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3dd2('0xf'));var qs=require(_0x3dd2('0x10'));var as=require(_0x3dd2('0x11'));var hardwareService=require(_0x3dd2('0x12'));var logger=require(_0x3dd2('0x13'))(_0x3dd2('0x14'));var utils=require(_0x3dd2('0x15'));var config=require(_0x3dd2('0x16'));var licenseUtil=require(_0x3dd2('0x17'));var db=require(_0x3dd2('0x18'))['db'];function respondWithStatusCode(_0x44e5eb,_0x21ba9c){_0x21ba9c=_0x21ba9c||0xcc;return function(_0x5cad27){if(_0x5cad27){return _0x44e5eb[_0x3dd2('0x19')](_0x21ba9c);}return _0x44e5eb[_0x3dd2('0x1a')](_0x21ba9c)[_0x3dd2('0x1b')]();};}function respondWithResult(_0x2a3015,_0x46a7c5){_0x46a7c5=_0x46a7c5||0xc8;return function(_0x12acd0){if(_0x12acd0){return _0x2a3015[_0x3dd2('0x1a')](_0x46a7c5)[_0x3dd2('0x1c')](_0x12acd0);}};}function respondWithFilteredResult(_0x3c04ef,_0x2cb696){return function(_0x5e1a5e){if(_0x5e1a5e){var _0x285a7=typeof _0x2cb696[_0x3dd2('0x1d')]===_0x3dd2('0x1e')&&typeof _0x2cb696[_0x3dd2('0x1f')]==='undefined';var _0x2cf41f=_0x5e1a5e['count'];var _0x2042c4=_0x285a7?0x0:_0x2cb696['offset'];var _0x30a4b4=_0x285a7?_0x5e1a5e[_0x3dd2('0x20')]:_0x2cb696[_0x3dd2('0x1d')]+_0x2cb696['limit'];var _0x46102;if(_0x30a4b4>=_0x2cf41f){_0x30a4b4=_0x2cf41f;_0x46102=0xc8;}else{_0x46102=0xce;}_0x3c04ef[_0x3dd2('0x1a')](_0x46102);return _0x3c04ef['set'](_0x3dd2('0x21'),_0x2042c4+'-'+_0x30a4b4+'/'+_0x2cf41f)['json'](_0x5e1a5e);}return null;};}function patchUpdates(_0x253b18){return function(_0x424c71){try{jsonpatch[_0x3dd2('0x22')](_0x424c71,_0x253b18,!![]);}catch(_0x401cb7){return BPromise['reject'](_0x401cb7);}return _0x424c71[_0x3dd2('0x23')]();};}function saveUpdates(_0x1b5af4,_0x30f19b){return function(_0x468c94){if(_0x468c94){return _0x468c94[_0x3dd2('0x24')](_0x1b5af4)[_0x3dd2('0x25')](function(_0x56ba8c){return _0x56ba8c;});}return null;};}function removeEntity(_0x1e32fc,_0x249abf){return function(_0x5cd58f){if(_0x5cd58f){return _0x5cd58f[_0x3dd2('0x26')]()[_0x3dd2('0x25')](function(){_0x1e32fc['status'](0xcc)[_0x3dd2('0x1b')]();});}};}function handleEntityNotFound(_0x1a6226,_0x22c695){return function(_0xa37f68){if(!_0xa37f68){_0x1a6226[_0x3dd2('0x19')](0x194);}return _0xa37f68;};}function handleError(_0x3eaf26,_0x14a5e2){_0x14a5e2=_0x14a5e2||0x1f4;return function(_0x1092aa){logger[_0x3dd2('0x27')](_0x1092aa[_0x3dd2('0x28')]);if(_0x1092aa[_0x3dd2('0x29')]){delete _0x1092aa[_0x3dd2('0x29')];}_0x3eaf26[_0x3dd2('0x1a')](_0x14a5e2)[_0x3dd2('0x2a')](_0x1092aa);};}exports[_0x3dd2('0x2b')]=function(_0x4f1f7d,_0x2a7d96){var _0x1092e3={},_0xeb8c9f={},_0x41a843={'count':0x0,'rows':[]};var _0x4ab5c5=_[_0x3dd2('0x2c')](db[_0x3dd2('0x2d')]['rawAttributes'],function(_0x2a8297){return{'name':_0x2a8297['fieldName'],'type':_0x2a8297[_0x3dd2('0x2e')]['key']};});_0xeb8c9f['model']=_[_0x3dd2('0x2f')](_['map'](_0x4ab5c5,_0x3dd2('0x29')),[_0x3dd2('0x29')]);_0xeb8c9f[_0x3dd2('0x30')]=_[_0x3dd2('0x31')](_0x4f1f7d[_0x3dd2('0x30')]);_0xeb8c9f['filters']=_[_0x3dd2('0x32')](_0xeb8c9f[_0x3dd2('0x33')],_0xeb8c9f['query']);_0x1092e3[_0x3dd2('0x34')]=_[_0x3dd2('0x32')](_0xeb8c9f[_0x3dd2('0x33')],qs[_0x3dd2('0x35')](_0x4f1f7d[_0x3dd2('0x30')]['fields']));_0x1092e3[_0x3dd2('0x34')]=_0x1092e3[_0x3dd2('0x34')]['length']?_0x1092e3['attributes']:_0xeb8c9f['model'];if(!_0x4f1f7d[_0x3dd2('0x30')][_0x3dd2('0x36')](_0x3dd2('0x37'))){_0x1092e3[_0x3dd2('0x1f')]=qs[_0x3dd2('0x1f')](_0x4f1f7d[_0x3dd2('0x30')]['limit']);_0x1092e3['offset']=qs[_0x3dd2('0x1d')](_0x4f1f7d['query'][_0x3dd2('0x1d')]);}_0x1092e3[_0x3dd2('0x38')]=qs[_0x3dd2('0x39')](_0x4f1f7d[_0x3dd2('0x30')][_0x3dd2('0x39')]);_0x1092e3['where']=qs[_0x3dd2('0x3a')](_['pick'](_0x4f1f7d['query'],_0xeb8c9f[_0x3dd2('0x3a')]),_0x4ab5c5);if(_0x4f1f7d[_0x3dd2('0x30')][_0x3dd2('0x3b')]){_0x1092e3[_0x3dd2('0x3c')]=_[_0x3dd2('0x3d')](_0x1092e3[_0x3dd2('0x3c')],{'$or':_[_0x3dd2('0x2c')](_0x4ab5c5,function(_0x9f6dce){if(_0x9f6dce[_0x3dd2('0x2e')]!=='VIRTUAL'){var _0xd52329={};_0xd52329[_0x9f6dce[_0x3dd2('0x29')]]={'$like':'%'+_0x4f1f7d[_0x3dd2('0x30')]['filter']+'%'};return _0xd52329;}})});}_0x1092e3=_[_0x3dd2('0x3d')]({},_0x1092e3,_0x4f1f7d['options']);var _0x5f453b={'where':_0x1092e3[_0x3dd2('0x3c')]};return db[_0x3dd2('0x2d')][_0x3dd2('0x20')](_0x5f453b)[_0x3dd2('0x25')](function(_0x5c1bed){_0x41a843['count']=_0x5c1bed;if(_0x4f1f7d['query'][_0x3dd2('0x3e')]){_0x1092e3[_0x3dd2('0x3f')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x3dd2('0x40')](_0x1092e3);})[_0x3dd2('0x25')](function(_0x451afe){_0x41a843[_0x3dd2('0x41')]=_0x451afe;return _0x41a843;})[_0x3dd2('0x25')](respondWithFilteredResult(_0x2a7d96,_0x1092e3))[_0x3dd2('0x42')](handleError(_0x2a7d96,null));};exports[_0x3dd2('0x43')]=function(_0x408516,_0x35802c){var _0x1855d6={'raw':!![],'where':{'id':_0x408516[_0x3dd2('0x44')]['id']}},_0x36941b={};_0x36941b[_0x3dd2('0x33')]=_['keys'](db[_0x3dd2('0x2d')][_0x3dd2('0x45')]);_0x36941b[_0x3dd2('0x30')]=_[_0x3dd2('0x31')](_0x408516[_0x3dd2('0x30')]);_0x36941b[_0x3dd2('0x3a')]=_[_0x3dd2('0x32')](_0x36941b[_0x3dd2('0x33')],_0x36941b['query']);_0x1855d6[_0x3dd2('0x34')]=_[_0x3dd2('0x32')](_0x36941b[_0x3dd2('0x33')],qs[_0x3dd2('0x35')](_0x408516['query'][_0x3dd2('0x35')]));_0x1855d6[_0x3dd2('0x34')]=_0x1855d6[_0x3dd2('0x34')][_0x3dd2('0x46')]?_0x1855d6[_0x3dd2('0x34')]:_0x36941b['model'];if(_0x408516[_0x3dd2('0x30')][_0x3dd2('0x3e')]){_0x1855d6[_0x3dd2('0x3f')]=[{'all':!![]}];}_0x1855d6=_['merge']({},_0x1855d6,_0x408516[_0x3dd2('0x47')]);return db[_0x3dd2('0x2d')]['find'](_0x1855d6)[_0x3dd2('0x25')](handleEntityNotFound(_0x35802c,null))[_0x3dd2('0x25')](respondWithResult(_0x35802c,null))[_0x3dd2('0x42')](handleError(_0x35802c,null));};exports[_0x3dd2('0x48')]=function(_0x4db90e,_0x27f2c9){return db['VoiceMailMessage']['create'](_0x4db90e['body'],{})['then'](respondWithResult(_0x27f2c9,0xc9))[_0x3dd2('0x42')](handleError(_0x27f2c9,null));};exports['update']=function(_0x1a7a6f,_0x39a038){if(_0x1a7a6f[_0x3dd2('0x49')]['id']){delete _0x1a7a6f[_0x3dd2('0x49')]['id'];}return db[_0x3dd2('0x2d')][_0x3dd2('0x4a')]({'where':{'id':_0x1a7a6f[_0x3dd2('0x44')]['id']}})['then'](handleEntityNotFound(_0x39a038,null))['then'](saveUpdates(_0x1a7a6f[_0x3dd2('0x49')],null))[_0x3dd2('0x25')](respondWithResult(_0x39a038,null))[_0x3dd2('0x42')](handleError(_0x39a038,null));};exports['destroy']=function(_0x13385f,_0xcd32ed){return db[_0x3dd2('0x2d')][_0x3dd2('0x4a')]({'where':{'id':_0x13385f['params']['id']}})['then'](handleEntityNotFound(_0xcd32ed,null))[_0x3dd2('0x25')](removeEntity(_0xcd32ed,null))[_0x3dd2('0x42')](handleError(_0xcd32ed,null));};exports[_0x3dd2('0x4b')]=function(_0x37547b,_0x49f66c,_0x21e585){return db['VoiceMailMessage'][_0x3dd2('0x4a')]({'where':{'id':_0x37547b[_0x3dd2('0x44')]['id']},'attributes':['id',_0x3dd2('0x4c'),'msg_id']})[_0x3dd2('0x25')](handleEntityNotFound(_0x49f66c,null))[_0x3dd2('0x25')](function(_0x52bfdf){if(_0x52bfdf){if(!_0x52bfdf[_0x3dd2('0x4c')]){throw new db['Sequelize'][(_0x3dd2('0x4d'))](_0x3dd2('0x4e'));}var _0x1fb51d={'Content-Type':_0x3dd2('0x4f'),'Content-Disposition':'attachment'};if(_0x52bfdf[_0x3dd2('0x50')]){_0x1fb51d[_0x3dd2('0x51')]=_0x3dd2('0x52')+_0x52bfdf['msg_id']+_0x3dd2('0x53');}_0x49f66c[_0x3dd2('0x54')](_0x1fb51d);return _0x49f66c[_0x3dd2('0x2a')](new Buffer(_0x52bfdf[_0x3dd2('0x4c')]));}})[_0x3dd2('0x42')](handleError(_0x49f66c,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 5ace7f9..9d3dfc6 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 _0x3eeb=['voice_voicemail_messages','dir','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage'];(function(_0x421592,_0x615ee8){var _0x31efaf=function(_0x57919a){while(--_0x57919a){_0x421592['push'](_0x421592['shift']());}};_0x31efaf(++_0x615ee8);}(_0x3eeb,0x16e));var _0xb3ee=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3eeb[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xb3ee('0x0'));var logger=require('../../config/logger')(_0xb3ee('0x1'));var moment=require(_0xb3ee('0x2'));var BPromise=require(_0xb3ee('0x3'));var rp=require(_0xb3ee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb3ee('0x5'));var config=require(_0xb3ee('0x6'));var attributes=require(_0xb3ee('0x7'));module[_0xb3ee('0x8')]=function(_0x5e5464,_0x4f1194){return _0x5e5464[_0xb3ee('0x9')](_0xb3ee('0xa'),attributes,{'tableName':_0xb3ee('0xb'),'paranoid':![],'indexes':[{'name':_0xb3ee('0xc'),'fields':[_0xb3ee('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9551=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment'];(function(_0x4e9d7e,_0x3ee91d){var _0x56d7a5=function(_0x8c3157){while(--_0x8c3157){_0x4e9d7e['push'](_0x4e9d7e['shift']());}};_0x56d7a5(++_0x3ee91d);}(_0x9551,0x1db));var _0x1955=function(_0x209f9c,_0x4ea385){_0x209f9c=_0x209f9c-0x0;var _0x13c1ef=_0x9551[_0x209f9c];return _0x13c1ef;};'use strict';var _=require(_0x1955('0x0'));var util=require(_0x1955('0x1'));var logger=require(_0x1955('0x2'))(_0x1955('0x3'));var moment=require(_0x1955('0x4'));var BPromise=require(_0x1955('0x5'));var rp=require(_0x1955('0x6'));var fs=require('fs');var path=require(_0x1955('0x7'));var rimraf=require(_0x1955('0x8'));var config=require(_0x1955('0x9'));var attributes=require('./voiceMailMessage.attributes');module[_0x1955('0xa')]=function(_0x6c59de,_0x42d584){return _0x6c59de[_0x1955('0xb')](_0x1955('0xc'),attributes,{'tableName':_0x1955('0xd'),'paranoid':![],'indexes':[{'name':_0x1955('0xe'),'fields':[_0x1955('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index cf006b1..f7bb40c 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 _0x4232=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2087f7,_0x1b0ffe){var _0x309a92=function(_0x4abb26){while(--_0x4abb26){_0x2087f7['push'](_0x2087f7['shift']());}};_0x309a92(++_0x1b0ffe);}(_0x4232,0x17a));var _0x2423=function(_0x1df170,_0x5b9a15){_0x1df170=_0x1df170-0x0;var _0x38d4df=_0x4232[_0x1df170];return _0x38d4df;};'use strict';var _=require(_0x2423('0x0'));var util=require(_0x2423('0x1'));var moment=require(_0x2423('0x2'));var BPromise=require(_0x2423('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2423('0x4'));var db=require(_0x2423('0x5'))['db'];var utils=require(_0x2423('0x6'));var logger=require(_0x2423('0x7'))(_0x2423('0x8'));var config=require('../../config/environment');var jayson=require(_0x2423('0x9'));var client=jayson[_0x2423('0xa')][_0x2423('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52360d,_0x4db946,_0x5a8e52){return new BPromise(function(_0x38e4d7,_0x5e6672){return client[_0x2423('0xc')](_0x52360d,_0x5a8e52)[_0x2423('0xd')](function(_0x4b3e01){logger[_0x2423('0xe')](_0x2423('0xf'),_0x4db946,'request\x20sent');logger['debug'](_0x2423('0x10'),_0x4db946,'request\x20sent',JSON[_0x2423('0x11')](_0x4b3e01));if(_0x4b3e01[_0x2423('0x12')]){if(_0x4b3e01[_0x2423('0x12')][_0x2423('0x13')]===0x1f4){logger[_0x2423('0x12')](_0x2423('0xf'),_0x4db946,_0x4b3e01['error'][_0x2423('0x14')]);return _0x5e6672(_0x4b3e01['error'][_0x2423('0x14')]);}logger[_0x2423('0x12')](_0x2423('0xf'),_0x4db946,_0x4b3e01['error'][_0x2423('0x14')]);return _0x38e4d7(_0x4b3e01[_0x2423('0x12')]['message']);}else{logger[_0x2423('0xe')](_0x2423('0xf'),_0x4db946,_0x2423('0x15'));_0x38e4d7(_0x4b3e01[_0x2423('0x16')][_0x2423('0x14')]);}})[_0x2423('0x17')](function(_0x18f077){logger['error'](_0x2423('0xf'),_0x4db946,_0x18f077);_0x5e6672(_0x18f077);});});} \ No newline at end of file +var _0xea05=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xea05,0x102));var _0x5ea0=function(_0x3afd71,_0x25ab3f){_0x3afd71=_0x3afd71-0x0;var _0x2624b5=_0xea05[_0x3afd71];return _0x2624b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5ea0('0x0'));var BPromise=require(_0x5ea0('0x1'));var rs=require(_0x5ea0('0x2'));var fs=require('fs');var Redis=require(_0x5ea0('0x3'));var db=require(_0x5ea0('0x4'))['db'];var utils=require(_0x5ea0('0x5'));var logger=require(_0x5ea0('0x6'))(_0x5ea0('0x7'));var config=require(_0x5ea0('0x8'));var jayson=require(_0x5ea0('0x9'));var client=jayson['client'][_0x5ea0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c081a,_0xd88347,_0x2cd47d){return new BPromise(function(_0x4b97f7,_0x1cee6e){return client[_0x5ea0('0xb')](_0x3c081a,_0x2cd47d)[_0x5ea0('0xc')](function(_0x4474f7){logger[_0x5ea0('0xd')](_0x5ea0('0xe'),_0xd88347,_0x5ea0('0xf'));logger['debug'](_0x5ea0('0x10'),_0xd88347,_0x5ea0('0xf'),JSON[_0x5ea0('0x11')](_0x4474f7));if(_0x4474f7['error']){if(_0x4474f7['error']['code']===0x1f4){logger[_0x5ea0('0x12')](_0x5ea0('0xe'),_0xd88347,_0x4474f7[_0x5ea0('0x12')][_0x5ea0('0x13')]);return _0x1cee6e(_0x4474f7[_0x5ea0('0x12')][_0x5ea0('0x13')]);}logger[_0x5ea0('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0xd88347,_0x4474f7[_0x5ea0('0x12')]['message']);return _0x4b97f7(_0x4474f7[_0x5ea0('0x12')][_0x5ea0('0x13')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0xd88347,_0x5ea0('0xf'));_0x4b97f7(_0x4474f7[_0x5ea0('0x14')]['message']);}})[_0x5ea0('0x15')](function(_0x154931){logger[_0x5ea0('0x12')](_0x5ea0('0xe'),_0xd88347,_0x154931);_0x1cee6e(_0x154931);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 99eaeca..975dba3 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 _0xd5f4=['connect-timeout','express','fs-extra','../../components/auth/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','post','addSound','put','/:id','update','delete','/:id/sounds/:id2','removeSound','exports','multer','path'];(function(_0x3e1dfd,_0x3b2cf3){var _0x5e1e83=function(_0x6dc8f5){while(--_0x6dc8f5){_0x3e1dfd['push'](_0x3e1dfd['shift']());}};_0x5e1e83(++_0x3b2cf3);}(_0xd5f4,0x9e));var _0x4d5f=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xd5f4[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0x4d5f('0x0'));var util=require('util');var path=require(_0x4d5f('0x1'));var timeout=require(_0x4d5f('0x2'));var express=require(_0x4d5f('0x3'));var router=express['Router']();var fs_extra=require(_0x4d5f('0x4'));var auth=require(_0x4d5f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4d5f('0x6'));router[_0x4d5f('0x7')]('/',auth[_0x4d5f('0x8')](),controller[_0x4d5f('0x9')]);router[_0x4d5f('0x7')]('/:id',auth[_0x4d5f('0x8')](),controller[_0x4d5f('0xa')]);router['get']('/:id/sounds',auth['isAuthenticated'](),controller['getSounds']);router[_0x4d5f('0xb')]('/',auth[_0x4d5f('0x8')](),controller['create']);router[_0x4d5f('0xb')]('/:id/sounds',auth[_0x4d5f('0x8')](),controller[_0x4d5f('0xc')]);router[_0x4d5f('0xd')](_0x4d5f('0xe'),auth[_0x4d5f('0x8')](),controller[_0x4d5f('0xf')]);router[_0x4d5f('0x10')](_0x4d5f('0xe'),auth[_0x4d5f('0x8')](),controller['destroy']);router[_0x4d5f('0x10')](_0x4d5f('0x11'),auth[_0x4d5f('0x8')](),controller[_0x4d5f('0x12')]);module[_0x4d5f('0x13')]=router; \ No newline at end of file +var _0x966c=['create','addSound','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','index','get','/:id','isAuthenticated','/:id/sounds','getSounds','post'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0x966c,0x1d1));var _0xc966=function(_0x3261de,_0x3cc819){_0x3261de=_0x3261de-0x0;var _0x3d9872=_0x966c[_0x3261de];return _0x3d9872;};'use strict';var multer=require(_0xc966('0x0'));var util=require(_0xc966('0x1'));var path=require(_0xc966('0x2'));var timeout=require(_0xc966('0x3'));var express=require(_0xc966('0x4'));var router=express[_0xc966('0x5')]();var fs_extra=require(_0xc966('0x6'));var auth=require(_0xc966('0x7'));var interaction=require(_0xc966('0x8'));var config=require(_0xc966('0x9'));var controller=require(_0xc966('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xc966('0xb')]);router[_0xc966('0xc')](_0xc966('0xd'),auth[_0xc966('0xe')](),controller['show']);router[_0xc966('0xc')](_0xc966('0xf'),auth[_0xc966('0xe')](),controller[_0xc966('0x10')]);router[_0xc966('0x11')]('/',auth[_0xc966('0xe')](),controller[_0xc966('0x12')]);router[_0xc966('0x11')](_0xc966('0xf'),auth[_0xc966('0xe')](),controller[_0xc966('0x13')]);router['put'](_0xc966('0xd'),auth['isAuthenticated'](),controller[_0xc966('0x14')]);router[_0xc966('0x15')](_0xc966('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc966('0x15')]('/:id/sounds/:id2',auth[_0xc966('0xe')](),controller['removeSound']);module[_0xc966('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 e62b991..5197e80 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 _0xb358=['name','ENUM','custom','mp3nb','quietmp3nb','quietmp3','mp3','files','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x4e1bb6,_0x26f900){var _0x9a5d9b=function(_0x5df370){while(--_0x5df370){_0x4e1bb6['push'](_0x4e1bb6['shift']());}};_0x9a5d9b(++_0x26f900);}(_0xb358,0xb3));var _0x8b35=function(_0x1616f3,_0x5a277f){_0x1616f3=_0x1616f3-0x0;var _0x4abaa1=_0xb358[_0x1616f3];return _0x4abaa1;};'use strict';var Sequelize=require(_0x8b35('0x0'));module[_0x8b35('0x1')]={'name':{'type':Sequelize[_0x8b35('0x2')],'allowNull':![],'unique':_0x8b35('0x3')},'mode':{'type':Sequelize[_0x8b35('0x4')](_0x8b35('0x5'),'files',_0x8b35('0x6'),_0x8b35('0x7'),_0x8b35('0x8'),_0x8b35('0x9')),'allowNull':!![],'defaultValue':_0x8b35('0xa')},'directory':{'type':Sequelize[_0x8b35('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x8b35('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8b35('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x8b35('0x2')],'allowNull':!![],'defaultValue':_0x8b35('0xb')},'format':{'type':Sequelize[_0x8b35('0x2')],'allowNull':!![]},'stamp':{'type':_0x8b35('0xc')},'defaultEntry':{'type':Sequelize[_0x8b35('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0x54e5=['ENUM','custom','mp3nb','quietmp3nb','mp3','files','BOOLEAN','exports','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54e5,0x1d3));var _0x554e=function(_0x101d5b,_0x40cfd){_0x101d5b=_0x101d5b-0x0;var _0x382a50=_0x54e5[_0x101d5b];return _0x382a50;};'use strict';var Sequelize=require('sequelize');module[_0x554e('0x0')]={'name':{'type':Sequelize[_0x554e('0x1')],'allowNull':![],'unique':_0x554e('0x2')},'mode':{'type':Sequelize[_0x554e('0x3')](_0x554e('0x4'),'files',_0x554e('0x5'),_0x554e('0x6'),'quietmp3',_0x554e('0x7')),'allowNull':!![],'defaultValue':_0x554e('0x8')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x554e('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x554e('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x554e('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x554e('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x554e('0x9')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index c9cb939..33bc938 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 _0x3415=['directory','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','transaction','Sound','findOne','save_name','converted_format','format','basename','extname','%s.%s','symlinkSync','removeSound','id2','createdAt','getSounds','pick','hasOwnProperty','eml-format','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','MusicOnHolds','UserProfileResource','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','merge','VIRTUAL','filter','options','VoiceMusicOnHold','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body','create','sequelize','mode','files','root','server/files/moh','mkdirSync'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x3415,0x1d1));var _0x5341=function(_0x5913b9,_0x601273){_0x5913b9=_0x5913b9-0x0;var _0x48a050=_0x3415[_0x5913b9];return _0x48a050;};'use strict';var emlformat=require(_0x5341('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5341('0x1'));var moment=require('moment');var BPromise=require(_0x5341('0x2'));var Mustache=require(_0x5341('0x3'));var util=require(_0x5341('0x4'));var path=require(_0x5341('0x5'));var sox=require(_0x5341('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5341('0x7'));var _=require('lodash');var squel=require(_0x5341('0x8'));var crypto=require(_0x5341('0x9'));var jsforce=require(_0x5341('0xa'));var deskjs=require(_0x5341('0xb'));var toCsv=require(_0x5341('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5341('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x5341('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5341('0xf'))('api');var utils=require(_0x5341('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x5341('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x573c2d,_0x541064){_0x541064=_0x541064||0xcc;return function(_0x2bdd02){if(_0x2bdd02){return _0x573c2d[_0x5341('0x12')](_0x541064);}return _0x573c2d[_0x5341('0x13')](_0x541064)[_0x5341('0x14')]();};}function respondWithResult(_0x1721b8,_0x5d4a0d){_0x5d4a0d=_0x5d4a0d||0xc8;return function(_0x1b9961){if(_0x1b9961){return _0x1721b8[_0x5341('0x13')](_0x5d4a0d)[_0x5341('0x15')](_0x1b9961);}};}function respondWithFilteredResult(_0x960636,_0x32c85c){return function(_0x18fad6){if(_0x18fad6){var _0x20ef09=typeof _0x32c85c[_0x5341('0x16')]===_0x5341('0x17')&&typeof _0x32c85c[_0x5341('0x18')]===_0x5341('0x17');var _0x70900e=_0x18fad6['count'];var _0x3bd519=_0x20ef09?0x0:_0x32c85c[_0x5341('0x16')];var _0x4a89eb=_0x20ef09?_0x18fad6[_0x5341('0x19')]:_0x32c85c[_0x5341('0x16')]+_0x32c85c[_0x5341('0x18')];var _0x322d04;if(_0x4a89eb>=_0x70900e){_0x4a89eb=_0x70900e;_0x322d04=0xc8;}else{_0x322d04=0xce;}_0x960636[_0x5341('0x13')](_0x322d04);return _0x960636[_0x5341('0x1a')](_0x5341('0x1b'),_0x3bd519+'-'+_0x4a89eb+'/'+_0x70900e)['json'](_0x18fad6);}return null;};}function patchUpdates(_0x787bb){return function(_0x44f056){try{jsonpatch[_0x5341('0x1c')](_0x44f056,_0x787bb,!![]);}catch(_0x2caed1){return BPromise[_0x5341('0x1d')](_0x2caed1);}return _0x44f056['save']();};}function saveUpdates(_0x39ab50,_0xe22b38){return function(_0xc0fddd){if(_0xc0fddd){return _0xc0fddd[_0x5341('0x1e')](_0x39ab50)[_0x5341('0x1f')](function(_0xbe03de){return _0xbe03de;});}return null;};}function removeEntity(_0x440822,_0x2079a0){return function(_0x1ba7d1){if(_0x1ba7d1){return _0x1ba7d1[_0x5341('0x20')]()[_0x5341('0x1f')](function(){var _0x3dc7c1=_0x1ba7d1['get']({'plain':!![]});var _0x324078=_0x5341('0x21');return db[_0x5341('0x22')][_0x5341('0x20')]({'where':{'type':_0x324078,'resourceId':_0x3dc7c1['id']}})[_0x5341('0x1f')](function(){return _0x1ba7d1;});})[_0x5341('0x1f')](function(){_0x440822[_0x5341('0x13')](0xcc)[_0x5341('0x14')]();});}};}function handleEntityNotFound(_0x1816c9,_0x4016bc){return function(_0x29bbe8){if(!_0x29bbe8){_0x1816c9[_0x5341('0x12')](0x194);}return _0x29bbe8;};}function handleError(_0x52b1bd,_0x73b19e){_0x73b19e=_0x73b19e||0x1f4;return function(_0x2ec2d1){logger[_0x5341('0x23')](_0x2ec2d1['stack']);if(_0x2ec2d1[_0x5341('0x24')]){delete _0x2ec2d1[_0x5341('0x24')];}_0x52b1bd['status'](_0x73b19e)[_0x5341('0x25')](_0x2ec2d1);};}exports[_0x5341('0x26')]=function(_0x4060d1,_0x49448b){var _0x62e301={},_0x236103={},_0x496aac={'count':0x0,'rows':[]};var _0x484dd6=_['map'](db['VoiceMusicOnHold']['rawAttributes'],function(_0x14ed0e){return{'name':_0x14ed0e[_0x5341('0x27')],'type':_0x14ed0e[_0x5341('0x28')][_0x5341('0x29')]};});_0x236103[_0x5341('0x2a')]=_[_0x5341('0x2b')](_0x484dd6,'name');_0x236103[_0x5341('0x2c')]=_[_0x5341('0x2d')](_0x4060d1[_0x5341('0x2c')]);_0x236103[_0x5341('0x2e')]=_['intersection'](_0x236103[_0x5341('0x2a')],_0x236103[_0x5341('0x2c')]);_0x62e301[_0x5341('0x2f')]=_[_0x5341('0x30')](_0x236103['model'],qs[_0x5341('0x31')](_0x4060d1[_0x5341('0x2c')]['fields']));_0x62e301['attributes']=_0x62e301[_0x5341('0x2f')][_0x5341('0x32')]?_0x62e301['attributes']:_0x236103[_0x5341('0x2a')];if(!_0x4060d1[_0x5341('0x2c')]['hasOwnProperty']('nolimit')){_0x62e301['limit']=qs[_0x5341('0x18')](_0x4060d1[_0x5341('0x2c')][_0x5341('0x18')]);_0x62e301[_0x5341('0x16')]=qs[_0x5341('0x16')](_0x4060d1[_0x5341('0x2c')][_0x5341('0x16')]);}_0x62e301[_0x5341('0x33')]=qs[_0x5341('0x34')](_0x4060d1[_0x5341('0x2c')]['sort']);delete _0x4060d1[_0x5341('0x2c')]['sort'];_0x62e301[_0x5341('0x35')]=qs[_0x5341('0x2e')](_['pick'](_0x4060d1[_0x5341('0x2c')],_0x236103[_0x5341('0x2e')]),_0x484dd6);if(_0x4060d1[_0x5341('0x2c')]['filter']){_0x62e301[_0x5341('0x35')]=_[_0x5341('0x36')](_0x62e301[_0x5341('0x35')],{'$or':_[_0x5341('0x2b')](_0x484dd6,function(_0x15006d){if(_0x15006d[_0x5341('0x28')]!==_0x5341('0x37')){var _0x3853f9={};_0x3853f9[_0x15006d[_0x5341('0x24')]]={'$like':'%'+_0x4060d1[_0x5341('0x2c')][_0x5341('0x38')]+'%'};return _0x3853f9;}})});}_0x62e301=_[_0x5341('0x36')]({},_0x62e301,_0x4060d1[_0x5341('0x39')]);var _0x2b8847={'where':_0x62e301[_0x5341('0x35')]};return db[_0x5341('0x3a')][_0x5341('0x19')](_0x2b8847)[_0x5341('0x1f')](function(_0x47e5b0){_0x496aac['count']=_0x47e5b0;if(_0x4060d1['query']['includeAll']){_0x62e301['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x5341('0x3b')](_0x62e301);})[_0x5341('0x1f')](function(_0x13f2af){_0x496aac[_0x5341('0x3c')]=_0x13f2af;return _0x496aac;})['then'](respondWithFilteredResult(_0x49448b,_0x62e301))[_0x5341('0x3d')](handleError(_0x49448b,null));};exports[_0x5341('0x3e')]=function(_0x5f5b8d,_0xbd5649){var _0x41a961={'raw':![],'where':{'id':_0x5f5b8d[_0x5341('0x3f')]['id']}},_0x21d0b4={};_0x21d0b4[_0x5341('0x2a')]=_[_0x5341('0x2d')](db['VoiceMusicOnHold'][_0x5341('0x40')]);_0x21d0b4['query']=_['keys'](_0x5f5b8d['query']);_0x21d0b4['filters']=_['intersection'](_0x21d0b4['model'],_0x21d0b4['query']);_0x41a961[_0x5341('0x2f')]=_[_0x5341('0x30')](_0x21d0b4[_0x5341('0x2a')],qs[_0x5341('0x31')](_0x5f5b8d[_0x5341('0x2c')][_0x5341('0x31')]));_0x41a961[_0x5341('0x2f')]=_0x41a961[_0x5341('0x2f')]['length']?_0x41a961[_0x5341('0x2f')]:_0x21d0b4[_0x5341('0x2a')];if(_0x5f5b8d[_0x5341('0x2c')][_0x5341('0x41')]){_0x41a961['include']=[{'all':!![]}];}_0x41a961=_['merge']({},_0x41a961,_0x5f5b8d[_0x5341('0x39')]);return db[_0x5341('0x3a')][_0x5341('0x42')](_0x41a961)['then'](handleEntityNotFound(_0xbd5649,null))['then'](respondWithResult(_0xbd5649,null))[_0x5341('0x3d')](handleError(_0xbd5649,null));};exports[_0x5341('0x1e')]=function(_0x3ee3e1,_0x5c031a){if(_0x3ee3e1['body']['id']){delete _0x3ee3e1[_0x5341('0x43')]['id'];}return db[_0x5341('0x3a')]['find']({'where':{'id':_0x3ee3e1[_0x5341('0x3f')]['id']}})[_0x5341('0x1f')](handleEntityNotFound(_0x5c031a,null))['then'](saveUpdates(_0x3ee3e1['body'],null))[_0x5341('0x1f')](respondWithResult(_0x5c031a,null))[_0x5341('0x3d')](handleError(_0x5c031a,null));};exports[_0x5341('0x44')]=function(_0x50b578,_0x2a6e4e,_0x369021){return db[_0x5341('0x45')]['transaction'](function(_0x13e3cc){if(_0x50b578['body'][_0x5341('0x46')]===_0x5341('0x47')){_0x50b578[_0x5341('0x43')]['directory']=path['join'](config[_0x5341('0x48')],_0x5341('0x49'),_0x50b578[_0x5341('0x43')][_0x5341('0x24')]);}return db[_0x5341('0x3a')]['create'](_0x50b578[_0x5341('0x43')],{'transaction':_0x13e3cc})[_0x5341('0x1f')](function(_0x4f7bf8){if(_0x50b578[_0x5341('0x43')]['mode']===_0x5341('0x47')){fs[_0x5341('0x4a')](_0x4f7bf8[_0x5341('0x4b')],parseInt(_0x5341('0x4c'),0x8));}var _0x1f7e53=_0x50b578[_0x5341('0x4d')][_0x5341('0x4e')]({'plain':!![]});if(!_0x1f7e53)throw new Error(_0x5341('0x4f'));if(_0x1f7e53[_0x5341('0x50')]===_0x5341('0x4d')){var _0x5ced4e=_0x4f7bf8[_0x5341('0x4e')]({'plain':!![]});return db[_0x5341('0x51')]['find']({'where':{'name':_0x5341('0x21'),'userProfileId':_0x1f7e53[_0x5341('0x52')]},'raw':!![]})[_0x5341('0x1f')](function(_0x390512){if(_0x390512&&_0x390512[_0x5341('0x53')]===0x0){return db['UserProfileResource'][_0x5341('0x44')]({'name':_0x5ced4e[_0x5341('0x24')],'resourceId':_0x5ced4e['id'],'type':_0x390512[_0x5341('0x24')],'sectionId':_0x390512['id']},{})[_0x5341('0x1f')](function(){return _0x4f7bf8;});}else{return _0x4f7bf8;}})[_0x5341('0x3d')](function(_0x341ccf){logger[_0x5341('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x341ccf);});}return _0x4f7bf8;});})[_0x5341('0x1f')](respondWithResult(_0x2a6e4e,0xc9))[_0x5341('0x3d')](handleError(_0x2a6e4e,null));};exports[_0x5341('0x20')]=function(_0x101fc6,_0x40ffac,_0x4075e6){var _0x200393;return db[_0x5341('0x3a')][_0x5341('0x42')]({'where':{'id':_0x101fc6[_0x5341('0x3f')]['id']}})[_0x5341('0x1f')](function(_0x1b955d){if(_0x1b955d){return db[_0x5341('0x45')]['transaction'](function(_0x7f5f58){return _0x1b955d[_0x5341('0x20')]({'transaction':_0x7f5f58,'raw':!![]})['then'](function(_0x2cb7fc){if(_0x2cb7fc[_0x5341('0x4b')]){fs['readdirSync'](_0x2cb7fc[_0x5341('0x4b')])[_0x5341('0x54')](function(_0xdf3ae6){fs[_0x5341('0x55')](path[_0x5341('0x56')](_0x2cb7fc[_0x5341('0x4b')],_0xdf3ae6));});fs[_0x5341('0x57')](_0x2cb7fc['directory']);}return _0x2cb7fc;});})['catch'](function(_0x2d7412){throw new db[(_0x5341('0x58'))][(_0x5341('0x59'))](_0x2d7412[_0x5341('0x5a')]);});}})[_0x5341('0x1f')](handleEntityNotFound(_0x40ffac,null))[_0x5341('0x1f')](removeEntity(_0x40ffac,null))['catch'](handleError(_0x40ffac,null));};exports[_0x5341('0x5b')]=function(_0x86349b,_0x2fa377,_0x4a1845){return db['sequelize'][_0x5341('0x5c')](function(_0x42b327){var _0xd0fabd;return db[_0x5341('0x3a')][_0x5341('0x42')]({'where':{'id':_0x86349b[_0x5341('0x3f')]['id']}})[_0x5341('0x1f')](function(_0x1afccc){if(_0x1afccc){_0xd0fabd=_0x1afccc;return _0x1afccc[_0x5341('0x5b')](_0x86349b[_0x5341('0x43')]['id'],{'transaction':_0x42b327});}})[_0x5341('0x1f')](function(_0x2c1d6c){if(_0x2c1d6c){return db[_0x5341('0x5d')][_0x5341('0x5e')]({'where':{'id':_0x86349b[_0x5341('0x43')]['id']},'attributes':['id',_0x5341('0x24'),_0x5341('0x5f'),_0x5341('0x60'),'createdAt'],'raw':!![]});}})[_0x5341('0x1f')](function(_0x7d8197){if(_0x7d8197){var _0x4668e9=path[_0x5341('0x56')](config[_0x5341('0x48')],'server/files/sounds/converted',util[_0x5341('0x61')]('%s.%s',path[_0x5341('0x62')](_0x7d8197[_0x5341('0x5f')],path[_0x5341('0x63')](_0x7d8197[_0x5341('0x5f')])),_0x7d8197[_0x5341('0x60')]));var _0x5be76f=path[_0x5341('0x56')](config[_0x5341('0x48')],_0x5341('0x49'),_0xd0fabd[_0x5341('0x24')],util[_0x5341('0x61')](_0x5341('0x64'),_0x7d8197[_0x5341('0x24')],_0x7d8197['converted_format']));fs[_0x5341('0x65')](_0x4668e9,_0x5be76f);return _0x7d8197;}})['catch'](function(_0x426520){throw new db['Sequelize'][(_0x5341('0x59'))](_0x426520['message']);});})['then'](handleEntityNotFound(_0x2fa377,null))[_0x5341('0x1f')](respondWithResult(_0x2fa377,0xc9))[_0x5341('0x3d')](handleError(_0x2fa377,null));};exports['removeSound']=function(_0x55db35,_0x285344,_0x395279){return db[_0x5341('0x45')]['transaction'](function(_0x443f79){var _0x2449d7;return db[_0x5341('0x3a')][_0x5341('0x5e')]({'where':{'id':_0x55db35[_0x5341('0x3f')]['id']}})[_0x5341('0x1f')](handleEntityNotFound(_0x285344,null))[_0x5341('0x1f')](function(_0xf9d79a){if(_0xf9d79a){_0x2449d7=_0xf9d79a;return _0xf9d79a[_0x5341('0x66')](_0x55db35[_0x5341('0x3f')][_0x5341('0x67')]);}})[_0x5341('0x1f')](function(_0x584684){if(_0x584684){return db[_0x5341('0x5d')]['findOne']({'where':{'id':_0x55db35[_0x5341('0x3f')]['id2']},'attributes':['id','name',_0x5341('0x5f'),_0x5341('0x60'),_0x5341('0x68')],'raw':!![]});}})[_0x5341('0x1f')](function(_0x324d9b){if(_0x324d9b){fs[_0x5341('0x55')](path[_0x5341('0x56')](_0x2449d7[_0x5341('0x4b')],util[_0x5341('0x61')](_0x5341('0x64'),_0x324d9b[_0x5341('0x24')],_0x324d9b[_0x5341('0x60')])));return _0x324d9b;}})[_0x5341('0x3d')](function(_0x98d455){throw new db[(_0x5341('0x58'))][(_0x5341('0x59'))](_0x98d455['message']);});})[_0x5341('0x1f')](handleEntityNotFound(_0x285344,null))[_0x5341('0x1f')](respondWithStatusCode(_0x285344,0xcc))[_0x5341('0x3d')](handleError(_0x285344,null));};exports[_0x5341('0x69')]=function(_0x1e0979,_0x5c4b0a,_0x387084){var _0x477193={};var _0x479c7b={};var _0x7d21fa;var _0x5713c2;return db[_0x5341('0x3a')][_0x5341('0x5e')]({'where':{'id':_0x1e0979[_0x5341('0x3f')]['id']}})[_0x5341('0x1f')](handleEntityNotFound(_0x5c4b0a,null))[_0x5341('0x1f')](function(_0x260eb3){if(_0x260eb3){_0x7d21fa=_0x260eb3;_0x479c7b[_0x5341('0x2a')]=_[_0x5341('0x2d')](db[_0x5341('0x5d')][_0x5341('0x40')]);_0x479c7b[_0x5341('0x2c')]=_[_0x5341('0x2d')](_0x1e0979[_0x5341('0x2c')]);_0x479c7b[_0x5341('0x2e')]=_['intersection'](_0x479c7b['model'],_0x479c7b[_0x5341('0x2c')]);_0x477193[_0x5341('0x2f')]=_[_0x5341('0x30')](_0x479c7b[_0x5341('0x2a')],qs[_0x5341('0x31')](_0x1e0979[_0x5341('0x2c')][_0x5341('0x31')]));_0x477193[_0x5341('0x2f')]=_0x477193[_0x5341('0x2f')][_0x5341('0x32')]?_0x477193['attributes']:_0x479c7b[_0x5341('0x2a')];_0x477193[_0x5341('0x33')]=qs[_0x5341('0x34')](_0x1e0979['query'][_0x5341('0x34')]);_0x477193[_0x5341('0x35')]=qs[_0x5341('0x2e')](_[_0x5341('0x6a')](_0x1e0979[_0x5341('0x2c')],_0x479c7b['filters']));if(_0x1e0979[_0x5341('0x2c')][_0x5341('0x38')]){_0x477193[_0x5341('0x35')]=_['merge'](_0x477193[_0x5341('0x35')],{'$or':_['map'](_0x477193[_0x5341('0x2f')],function(_0x48c55e){var _0x42b95b={};_0x42b95b[_0x48c55e]={'$like':'%'+_0x1e0979['query']['filter']+'%'};return _0x42b95b;})});}_0x477193=_[_0x5341('0x36')]({},_0x477193,_0x1e0979[_0x5341('0x39')]);return _0x7d21fa[_0x5341('0x69')](_0x477193);}})['then'](function(_0x479595){if(_0x479595){_0x5713c2=_0x479595[_0x5341('0x32')];if(!_0x1e0979[_0x5341('0x2c')][_0x5341('0x6b')]('nolimit')){_0x477193[_0x5341('0x18')]=qs['limit'](_0x1e0979[_0x5341('0x2c')]['limit']);_0x477193[_0x5341('0x16')]=qs[_0x5341('0x16')](_0x1e0979['query'][_0x5341('0x16')]);}return _0x7d21fa['getSounds'](_0x477193);}})[_0x5341('0x1f')](function(_0x55ef9a){if(_0x55ef9a){return _0x55ef9a?{'count':_0x5713c2,'rows':_0x55ef9a}:null;}})[_0x5341('0x1f')](respondWithResult(_0x5c4b0a,null))[_0x5341('0x3d')](handleError(_0x5c4b0a,null));}; \ No newline at end of file +var _0xfca7=['message','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','ValidationError','removeSound','findOne','id2','getSounds','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','error','stack','name','index','map','VoiceMusicOnHold','rawAttributes','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','sequelize','transaction','mode','join','root','server/files/moh','create','mkdirSync','directory','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','Sequelize'];(function(_0x581e7d,_0x125495){var _0x58d2b1=function(_0xe544e3){while(--_0xe544e3){_0x581e7d['push'](_0x581e7d['shift']());}};_0x58d2b1(++_0x125495);}(_0xfca7,0x1c3));var _0x7fca=function(_0x41e45d,_0x1ee3b0){_0x41e45d=_0x41e45d-0x0;var _0x4d3aac=_0xfca7[_0x41e45d];return _0x4d3aac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7fca('0x0'));var zipdir=require(_0x7fca('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7fca('0x2'));var BPromise=require(_0x7fca('0x3'));var Mustache=require(_0x7fca('0x4'));var util=require(_0x7fca('0x5'));var path=require('path');var sox=require(_0x7fca('0x6'));var csv=require(_0x7fca('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7fca('0x8'));var _=require(_0x7fca('0x9'));var squel=require('squel');var crypto=require(_0x7fca('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7fca('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7fca('0xc'));var Redis=require(_0x7fca('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7fca('0xe'));var as=require(_0x7fca('0xf'));var hardwareService=require(_0x7fca('0x10'));var logger=require(_0x7fca('0x11'))('api');var utils=require(_0x7fca('0x12'));var config=require(_0x7fca('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x570818,_0x4016b6){_0x4016b6=_0x4016b6||0xcc;return function(_0x5791db){if(_0x5791db){return _0x570818[_0x7fca('0x14')](_0x4016b6);}return _0x570818[_0x7fca('0x15')](_0x4016b6)[_0x7fca('0x16')]();};}function respondWithResult(_0xdc0b8b,_0x55927b){_0x55927b=_0x55927b||0xc8;return function(_0x5d5361){if(_0x5d5361){return _0xdc0b8b[_0x7fca('0x15')](_0x55927b)[_0x7fca('0x17')](_0x5d5361);}};}function respondWithFilteredResult(_0x3f318e,_0x448cda){return function(_0x22c5e5){if(_0x22c5e5){var _0x4d468d=typeof _0x448cda[_0x7fca('0x18')]==='undefined'&&typeof _0x448cda[_0x7fca('0x19')]===_0x7fca('0x1a');var _0x5c616c=_0x22c5e5['count'];var _0x23f527=_0x4d468d?0x0:_0x448cda[_0x7fca('0x18')];var _0x5e4e4b=_0x4d468d?_0x22c5e5[_0x7fca('0x1b')]:_0x448cda[_0x7fca('0x18')]+_0x448cda[_0x7fca('0x19')];var _0x3a0734;if(_0x5e4e4b>=_0x5c616c){_0x5e4e4b=_0x5c616c;_0x3a0734=0xc8;}else{_0x3a0734=0xce;}_0x3f318e[_0x7fca('0x15')](_0x3a0734);return _0x3f318e[_0x7fca('0x1c')](_0x7fca('0x1d'),_0x23f527+'-'+_0x5e4e4b+'/'+_0x5c616c)[_0x7fca('0x17')](_0x22c5e5);}return null;};}function patchUpdates(_0x1de355){return function(_0x1829a0){try{jsonpatch[_0x7fca('0x1e')](_0x1829a0,_0x1de355,!![]);}catch(_0xf91803){return BPromise[_0x7fca('0x1f')](_0xf91803);}return _0x1829a0[_0x7fca('0x20')]();};}function saveUpdates(_0x4f3231,_0x18d58c){return function(_0x109e6c){if(_0x109e6c){return _0x109e6c[_0x7fca('0x21')](_0x4f3231)[_0x7fca('0x22')](function(_0x10d334){return _0x10d334;});}return null;};}function removeEntity(_0x5f3b2c,_0xb64b56){return function(_0x711cf4){if(_0x711cf4){return _0x711cf4[_0x7fca('0x23')]()[_0x7fca('0x22')](function(){var _0x1c3c24=_0x711cf4['get']({'plain':!![]});var _0x4addc5=_0x7fca('0x24');return db[_0x7fca('0x25')][_0x7fca('0x23')]({'where':{'type':_0x4addc5,'resourceId':_0x1c3c24['id']}})[_0x7fca('0x22')](function(){return _0x711cf4;});})['then'](function(){_0x5f3b2c[_0x7fca('0x15')](0xcc)[_0x7fca('0x16')]();});}};}function handleEntityNotFound(_0x3d5c6c,_0x48d090){return function(_0x4e2c64){if(!_0x4e2c64){_0x3d5c6c[_0x7fca('0x14')](0x194);}return _0x4e2c64;};}function handleError(_0x34563d,_0x5e5e03){_0x5e5e03=_0x5e5e03||0x1f4;return function(_0x2ebce2){logger[_0x7fca('0x26')](_0x2ebce2[_0x7fca('0x27')]);if(_0x2ebce2[_0x7fca('0x28')]){delete _0x2ebce2['name'];}_0x34563d['status'](_0x5e5e03)['send'](_0x2ebce2);};}exports[_0x7fca('0x29')]=function(_0x2d0503,_0x45f458){var _0x3fe356={},_0x302023={},_0x4485d9={'count':0x0,'rows':[]};var _0x2cb021=_[_0x7fca('0x2a')](db[_0x7fca('0x2b')][_0x7fca('0x2c')],function(_0x22195e){return{'name':_0x22195e['fieldName'],'type':_0x22195e[_0x7fca('0x2d')][_0x7fca('0x2e')]};});_0x302023['model']=_[_0x7fca('0x2a')](_0x2cb021,_0x7fca('0x28'));_0x302023[_0x7fca('0x2f')]=_[_0x7fca('0x30')](_0x2d0503[_0x7fca('0x2f')]);_0x302023['filters']=_[_0x7fca('0x31')](_0x302023['model'],_0x302023['query']);_0x3fe356[_0x7fca('0x32')]=_[_0x7fca('0x31')](_0x302023[_0x7fca('0x33')],qs[_0x7fca('0x34')](_0x2d0503[_0x7fca('0x2f')][_0x7fca('0x34')]));_0x3fe356['attributes']=_0x3fe356[_0x7fca('0x32')][_0x7fca('0x35')]?_0x3fe356['attributes']:_0x302023[_0x7fca('0x33')];if(!_0x2d0503[_0x7fca('0x2f')][_0x7fca('0x36')](_0x7fca('0x37'))){_0x3fe356[_0x7fca('0x19')]=qs['limit'](_0x2d0503[_0x7fca('0x2f')]['limit']);_0x3fe356['offset']=qs['offset'](_0x2d0503['query'][_0x7fca('0x18')]);}_0x3fe356[_0x7fca('0x38')]=qs[_0x7fca('0x39')](_0x2d0503[_0x7fca('0x2f')][_0x7fca('0x39')]);delete _0x2d0503[_0x7fca('0x2f')][_0x7fca('0x39')];_0x3fe356[_0x7fca('0x3a')]=qs[_0x7fca('0x3b')](_[_0x7fca('0x3c')](_0x2d0503[_0x7fca('0x2f')],_0x302023['filters']),_0x2cb021);if(_0x2d0503[_0x7fca('0x2f')][_0x7fca('0x3d')]){_0x3fe356[_0x7fca('0x3a')]=_[_0x7fca('0x3e')](_0x3fe356[_0x7fca('0x3a')],{'$or':_[_0x7fca('0x2a')](_0x2cb021,function(_0xa3c4b){if(_0xa3c4b['type']!==_0x7fca('0x3f')){var _0x463ca0={};_0x463ca0[_0xa3c4b[_0x7fca('0x28')]]={'$like':'%'+_0x2d0503[_0x7fca('0x2f')]['filter']+'%'};return _0x463ca0;}})});}_0x3fe356=_['merge']({},_0x3fe356,_0x2d0503[_0x7fca('0x40')]);var _0x3c52fe={'where':_0x3fe356[_0x7fca('0x3a')]};return db[_0x7fca('0x2b')][_0x7fca('0x1b')](_0x3c52fe)[_0x7fca('0x22')](function(_0x2354a6){_0x4485d9[_0x7fca('0x1b')]=_0x2354a6;if(_0x2d0503[_0x7fca('0x2f')][_0x7fca('0x41')]){_0x3fe356[_0x7fca('0x42')]=[{'all':!![]}];}return db[_0x7fca('0x2b')]['findAll'](_0x3fe356);})['then'](function(_0x44de09){_0x4485d9[_0x7fca('0x43')]=_0x44de09;return _0x4485d9;})[_0x7fca('0x22')](respondWithFilteredResult(_0x45f458,_0x3fe356))[_0x7fca('0x44')](handleError(_0x45f458,null));};exports[_0x7fca('0x45')]=function(_0x1c3868,_0x9d6297){var _0x202c01={'raw':![],'where':{'id':_0x1c3868[_0x7fca('0x46')]['id']}},_0x480845={};_0x480845[_0x7fca('0x33')]=_[_0x7fca('0x30')](db[_0x7fca('0x2b')][_0x7fca('0x2c')]);_0x480845[_0x7fca('0x2f')]=_[_0x7fca('0x30')](_0x1c3868['query']);_0x480845[_0x7fca('0x3b')]=_[_0x7fca('0x31')](_0x480845[_0x7fca('0x33')],_0x480845[_0x7fca('0x2f')]);_0x202c01[_0x7fca('0x32')]=_[_0x7fca('0x31')](_0x480845[_0x7fca('0x33')],qs['fields'](_0x1c3868[_0x7fca('0x2f')][_0x7fca('0x34')]));_0x202c01[_0x7fca('0x32')]=_0x202c01[_0x7fca('0x32')][_0x7fca('0x35')]?_0x202c01['attributes']:_0x480845['model'];if(_0x1c3868[_0x7fca('0x2f')]['includeAll']){_0x202c01['include']=[{'all':!![]}];}_0x202c01=_[_0x7fca('0x3e')]({},_0x202c01,_0x1c3868[_0x7fca('0x40')]);return db[_0x7fca('0x2b')][_0x7fca('0x47')](_0x202c01)[_0x7fca('0x22')](handleEntityNotFound(_0x9d6297,null))['then'](respondWithResult(_0x9d6297,null))['catch'](handleError(_0x9d6297,null));};exports[_0x7fca('0x21')]=function(_0x3eab76,_0x2d7418){if(_0x3eab76[_0x7fca('0x48')]['id']){delete _0x3eab76[_0x7fca('0x48')]['id'];}return db[_0x7fca('0x2b')][_0x7fca('0x47')]({'where':{'id':_0x3eab76[_0x7fca('0x46')]['id']}})[_0x7fca('0x22')](handleEntityNotFound(_0x2d7418,null))[_0x7fca('0x22')](saveUpdates(_0x3eab76['body'],null))[_0x7fca('0x22')](respondWithResult(_0x2d7418,null))[_0x7fca('0x44')](handleError(_0x2d7418,null));};exports['create']=function(_0x3599b0,_0x29d7dc,_0x18e3ba){return db[_0x7fca('0x49')][_0x7fca('0x4a')](function(_0xe0844d){if(_0x3599b0[_0x7fca('0x48')][_0x7fca('0x4b')]==='files'){_0x3599b0['body']['directory']=path[_0x7fca('0x4c')](config[_0x7fca('0x4d')],_0x7fca('0x4e'),_0x3599b0[_0x7fca('0x48')][_0x7fca('0x28')]);}return db['VoiceMusicOnHold'][_0x7fca('0x4f')](_0x3599b0[_0x7fca('0x48')],{'transaction':_0xe0844d})[_0x7fca('0x22')](function(_0x241da7){if(_0x3599b0[_0x7fca('0x48')][_0x7fca('0x4b')]==='files'){fs[_0x7fca('0x50')](_0x241da7[_0x7fca('0x51')],parseInt(_0x7fca('0x52'),0x8));}var _0x50d6d5=_0x3599b0[_0x7fca('0x53')][_0x7fca('0x54')]({'plain':!![]});if(!_0x50d6d5)throw new Error(_0x7fca('0x55'));if(_0x50d6d5[_0x7fca('0x56')]===_0x7fca('0x53')){var _0x52b255=_0x241da7[_0x7fca('0x54')]({'plain':!![]});return db[_0x7fca('0x57')][_0x7fca('0x47')]({'where':{'name':_0x7fca('0x24'),'userProfileId':_0x50d6d5['userProfileId']},'raw':!![]})[_0x7fca('0x22')](function(_0x2f6a17){if(_0x2f6a17&&_0x2f6a17[_0x7fca('0x58')]===0x0){return db[_0x7fca('0x25')][_0x7fca('0x4f')]({'name':_0x52b255[_0x7fca('0x28')],'resourceId':_0x52b255['id'],'type':_0x2f6a17[_0x7fca('0x28')],'sectionId':_0x2f6a17['id']},{})['then'](function(){return _0x241da7;});}else{return _0x241da7;}})[_0x7fca('0x44')](function(_0x3310d8){logger[_0x7fca('0x26')](_0x7fca('0x59'),_0x3310d8);});}return _0x241da7;});})[_0x7fca('0x22')](respondWithResult(_0x29d7dc,0xc9))[_0x7fca('0x44')](handleError(_0x29d7dc,null));};exports[_0x7fca('0x23')]=function(_0x4fb1c6,_0x40d36e,_0x571922){var _0x38f11b;return db[_0x7fca('0x2b')][_0x7fca('0x47')]({'where':{'id':_0x4fb1c6['params']['id']}})['then'](function(_0x52be56){if(_0x52be56){return db[_0x7fca('0x49')][_0x7fca('0x4a')](function(_0x41d29b){return _0x52be56['destroy']({'transaction':_0x41d29b,'raw':!![]})[_0x7fca('0x22')](function(_0x166b21){if(_0x166b21[_0x7fca('0x51')]){fs['readdirSync'](_0x166b21['directory'])[_0x7fca('0x5a')](function(_0x23405f){fs[_0x7fca('0x5b')](path[_0x7fca('0x4c')](_0x166b21[_0x7fca('0x51')],_0x23405f));});fs[_0x7fca('0x5c')](_0x166b21[_0x7fca('0x51')]);}return _0x166b21;});})[_0x7fca('0x44')](function(_0x157ed4){throw new db[(_0x7fca('0x5d'))]['ValidationError'](_0x157ed4[_0x7fca('0x5e')]);});}})[_0x7fca('0x22')](handleEntityNotFound(_0x40d36e,null))[_0x7fca('0x22')](removeEntity(_0x40d36e,null))['catch'](handleError(_0x40d36e,null));};exports[_0x7fca('0x5f')]=function(_0x1fbb43,_0x5d09cf,_0x3d7118){return db[_0x7fca('0x49')]['transaction'](function(_0x270d3e){var _0x40cf7e;return db[_0x7fca('0x2b')][_0x7fca('0x47')]({'where':{'id':_0x1fbb43['params']['id']}})[_0x7fca('0x22')](function(_0x1ddaf6){if(_0x1ddaf6){_0x40cf7e=_0x1ddaf6;return _0x1ddaf6['addSound'](_0x1fbb43[_0x7fca('0x48')]['id'],{'transaction':_0x270d3e});}})[_0x7fca('0x22')](function(_0x268626){if(_0x268626){return db[_0x7fca('0x60')]['findOne']({'where':{'id':_0x1fbb43[_0x7fca('0x48')]['id']},'attributes':['id','name',_0x7fca('0x61'),_0x7fca('0x62'),_0x7fca('0x63')],'raw':!![]});}})['then'](function(_0x1e28c4){if(_0x1e28c4){var _0x1df91c=path[_0x7fca('0x4c')](config[_0x7fca('0x4d')],_0x7fca('0x64'),util[_0x7fca('0x65')](_0x7fca('0x66'),path[_0x7fca('0x67')](_0x1e28c4[_0x7fca('0x61')],path['extname'](_0x1e28c4[_0x7fca('0x61')])),_0x1e28c4[_0x7fca('0x62')]));var _0x5acf23=path[_0x7fca('0x4c')](config[_0x7fca('0x4d')],'server/files/moh',_0x40cf7e['name'],util['format'](_0x7fca('0x66'),_0x1e28c4[_0x7fca('0x28')],_0x1e28c4[_0x7fca('0x62')]));fs['symlinkSync'](_0x1df91c,_0x5acf23);return _0x1e28c4;}})[_0x7fca('0x44')](function(_0x14c0db){throw new db[(_0x7fca('0x5d'))][(_0x7fca('0x68'))](_0x14c0db['message']);});})[_0x7fca('0x22')](handleEntityNotFound(_0x5d09cf,null))[_0x7fca('0x22')](respondWithResult(_0x5d09cf,0xc9))['catch'](handleError(_0x5d09cf,null));};exports[_0x7fca('0x69')]=function(_0x6163f,_0x2fb5f4,_0x122b60){return db[_0x7fca('0x49')][_0x7fca('0x4a')](function(_0xaddb72){var _0x30ebb5;return db['VoiceMusicOnHold'][_0x7fca('0x6a')]({'where':{'id':_0x6163f['params']['id']}})[_0x7fca('0x22')](handleEntityNotFound(_0x2fb5f4,null))['then'](function(_0x4474f1){if(_0x4474f1){_0x30ebb5=_0x4474f1;return _0x4474f1[_0x7fca('0x69')](_0x6163f[_0x7fca('0x46')][_0x7fca('0x6b')]);}})['then'](function(_0x1ebfee){if(_0x1ebfee){return db[_0x7fca('0x60')][_0x7fca('0x6a')]({'where':{'id':_0x6163f[_0x7fca('0x46')]['id2']},'attributes':['id',_0x7fca('0x28'),'save_name','converted_format','createdAt'],'raw':!![]});}})[_0x7fca('0x22')](function(_0x3a8a9f){if(_0x3a8a9f){fs[_0x7fca('0x5b')](path[_0x7fca('0x4c')](_0x30ebb5[_0x7fca('0x51')],util['format']('%s.%s',_0x3a8a9f[_0x7fca('0x28')],_0x3a8a9f['converted_format'])));return _0x3a8a9f;}})['catch'](function(_0x27f5c8){throw new db[(_0x7fca('0x5d'))][(_0x7fca('0x68'))](_0x27f5c8['message']);});})['then'](handleEntityNotFound(_0x2fb5f4,null))[_0x7fca('0x22')](respondWithStatusCode(_0x2fb5f4,0xcc))[_0x7fca('0x44')](handleError(_0x2fb5f4,null));};exports[_0x7fca('0x6c')]=function(_0x47a0a9,_0x4824dc,_0x881aa6){var _0x383e7a={};var _0x319943={};var _0x41267f;var _0x4b76fc;return db[_0x7fca('0x2b')][_0x7fca('0x6a')]({'where':{'id':_0x47a0a9[_0x7fca('0x46')]['id']}})[_0x7fca('0x22')](handleEntityNotFound(_0x4824dc,null))['then'](function(_0x12c915){if(_0x12c915){_0x41267f=_0x12c915;_0x319943[_0x7fca('0x33')]=_[_0x7fca('0x30')](db[_0x7fca('0x60')][_0x7fca('0x2c')]);_0x319943['query']=_[_0x7fca('0x30')](_0x47a0a9['query']);_0x319943[_0x7fca('0x3b')]=_[_0x7fca('0x31')](_0x319943['model'],_0x319943[_0x7fca('0x2f')]);_0x383e7a[_0x7fca('0x32')]=_[_0x7fca('0x31')](_0x319943['model'],qs[_0x7fca('0x34')](_0x47a0a9[_0x7fca('0x2f')]['fields']));_0x383e7a[_0x7fca('0x32')]=_0x383e7a[_0x7fca('0x32')][_0x7fca('0x35')]?_0x383e7a[_0x7fca('0x32')]:_0x319943[_0x7fca('0x33')];_0x383e7a[_0x7fca('0x38')]=qs[_0x7fca('0x39')](_0x47a0a9[_0x7fca('0x2f')]['sort']);_0x383e7a['where']=qs[_0x7fca('0x3b')](_[_0x7fca('0x3c')](_0x47a0a9['query'],_0x319943[_0x7fca('0x3b')]));if(_0x47a0a9[_0x7fca('0x2f')][_0x7fca('0x3d')]){_0x383e7a['where']=_[_0x7fca('0x3e')](_0x383e7a[_0x7fca('0x3a')],{'$or':_[_0x7fca('0x2a')](_0x383e7a['attributes'],function(_0x40813b){var _0x53bc4b={};_0x53bc4b[_0x40813b]={'$like':'%'+_0x47a0a9[_0x7fca('0x2f')][_0x7fca('0x3d')]+'%'};return _0x53bc4b;})});}_0x383e7a=_[_0x7fca('0x3e')]({},_0x383e7a,_0x47a0a9[_0x7fca('0x40')]);return _0x41267f['getSounds'](_0x383e7a);}})[_0x7fca('0x22')](function(_0x312c70){if(_0x312c70){_0x4b76fc=_0x312c70[_0x7fca('0x35')];if(!_0x47a0a9[_0x7fca('0x2f')][_0x7fca('0x36')]('nolimit')){_0x383e7a['limit']=qs[_0x7fca('0x19')](_0x47a0a9['query'][_0x7fca('0x19')]);_0x383e7a[_0x7fca('0x18')]=qs[_0x7fca('0x18')](_0x47a0a9[_0x7fca('0x2f')]['offset']);}return _0x41267f['getSounds'](_0x383e7a);}})[_0x7fca('0x22')](function(_0x55abc6){if(_0x55abc6){return _0x55abc6?{'count':_0x4b76fc,'rows':_0x55abc6}:null;}})['then'](respondWithResult(_0x4824dc,null))['catch'](handleError(_0x4824dc,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 9efd3fb..0a2726b 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 _0x8f68=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8f68,0xdd));var _0x88f6=function(_0x39fc11,_0x2de90b){_0x39fc11=_0x39fc11-0x0;var _0x45f1d3=_0x8f68[_0x39fc11];return _0x45f1d3;};'use strict';var _=require('lodash');var util=require(_0x88f6('0x0'));var logger=require('../../config/logger')(_0x88f6('0x1'));var moment=require(_0x88f6('0x2'));var BPromise=require(_0x88f6('0x3'));var rp=require(_0x88f6('0x4'));var fs=require('fs');var path=require(_0x88f6('0x5'));var rimraf=require('rimraf');var config=require(_0x88f6('0x6'));var attributes=require(_0x88f6('0x7'));module[_0x88f6('0x8')]=function(_0xd03dfa,_0x331fd8){return _0xd03dfa[_0x88f6('0x9')](_0x88f6('0xa'),attributes,{'tableName':_0x88f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f23=['../../config/logger','bluebird','path','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold'];(function(_0x2ddaa0,_0x5a0a7e){var _0x4e5548=function(_0x5141e9){while(--_0x5141e9){_0x2ddaa0['push'](_0x2ddaa0['shift']());}};_0x4e5548(++_0x5a0a7e);}(_0x6f23,0x7e));var _0x36f2=function(_0x57de4d,_0x4943d9){_0x57de4d=_0x57de4d-0x0;var _0x57607f=_0x6f23[_0x57de4d];return _0x57607f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x36f2('0x0'))('api');var moment=require('moment');var BPromise=require(_0x36f2('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36f2('0x2'));var rimraf=require('rimraf');var config=require(_0x36f2('0x3'));var attributes=require(_0x36f2('0x4'));module[_0x36f2('0x5')]=function(_0x3b97fe,_0x5d3220){return _0x3b97fe['define'](_0x36f2('0x6'),attributes,{'tableName':'voice_musiconhold','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 7135e1c..133e8ac 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 _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1edd2d,_0x7503d){var _0x5468a9=function(_0x3463f9){while(--_0x3463f9){_0x1edd2d['push'](_0x1edd2d['shift']());}};_0x5468a9(++_0x7503d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x52bb69,_0xa562e8){var _0x410e56=function(_0x249928){while(--_0x249928){_0x52bb69['push'](_0x52bb69['shift']());}};_0x410e56(++_0xa562e8);}(_0xedd9,0xfc));var _0x9edd=function(_0x11ca5c,_0x270dd6){_0x11ca5c=_0x11ca5c-0x0;var _0x196716=_0xedd9[_0x11ca5c];return _0x196716;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 82276ce..bc8f419 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 _0x423b=['update','delete','destroy','removeAgents','removeTeams','util','connect-timeout','Router','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getAgents','/:id/teams','post','/:id/users'];(function(_0x59043b,_0x4e60cb){var _0xb27806=function(_0x25746b){while(--_0x25746b){_0x59043b['push'](_0x59043b['shift']());}};_0xb27806(++_0x4e60cb);}(_0x423b,0x12b));var _0xb423=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x423b[_0x39e283];return _0x7de89f;};'use strict';var multer=require('multer');var util=require(_0xb423('0x0'));var path=require('path');var timeout=require(_0xb423('0x1'));var express=require('express');var router=express[_0xb423('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb423('0x3'));var controller=require(_0xb423('0x4'));router['get']('/',auth[_0xb423('0x5')](),controller[_0xb423('0x6')]);router[_0xb423('0x7')](_0xb423('0x8'),auth['isAuthenticated'](),controller[_0xb423('0x9')]);router[_0xb423('0x7')](_0xb423('0xa'),auth[_0xb423('0x5')](),controller[_0xb423('0xb')]);router['get']('/:id/users',auth[_0xb423('0x5')](),controller[_0xb423('0xc')]);router[_0xb423('0x7')](_0xb423('0xd'),auth[_0xb423('0x5')](),controller['getTeams']);router[_0xb423('0xe')]('/',auth[_0xb423('0x5')](),controller['create']);router[_0xb423('0xe')](_0xb423('0xf'),auth[_0xb423('0x5')](),controller['addAgents']);router[_0xb423('0xe')]('/:id/teams',auth[_0xb423('0x5')](),controller['addTeams']);router['put']('/:id',auth[_0xb423('0x5')](),controller[_0xb423('0x10')]);router[_0xb423('0x11')]('/:id',auth[_0xb423('0x5')](),controller[_0xb423('0x12')]);router[_0xb423('0x11')](_0xb423('0xf'),auth['isAuthenticated'](),controller[_0xb423('0x13')]);router[_0xb423('0x11')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb423('0x14')]);module['exports']=router; \ No newline at end of file +var _0x8456=['getTeams','post','addAgents','addTeams','put','update','delete','destroy','removeAgents','removeTeams','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','/:id/teams'];(function(_0xe85c5,_0x5468bf){var _0x3ad2a1=function(_0x308da5){while(--_0x308da5){_0xe85c5['push'](_0xe85c5['shift']());}};_0x3ad2a1(++_0x5468bf);}(_0x8456,0xfd));var _0x6845=function(_0xb663bd,_0xc0326f){_0xb663bd=_0xb663bd-0x0;var _0x1ab567=_0x8456[_0xb663bd];return _0x1ab567;};'use strict';var multer=require(_0x6845('0x0'));var util=require(_0x6845('0x1'));var path=require(_0x6845('0x2'));var timeout=require('connect-timeout');var express=require(_0x6845('0x3'));var router=express['Router']();var fs_extra=require(_0x6845('0x4'));var auth=require(_0x6845('0x5'));var interaction=require(_0x6845('0x6'));var config=require(_0x6845('0x7'));var controller=require(_0x6845('0x8'));router[_0x6845('0x9')]('/',auth[_0x6845('0xa')](),controller[_0x6845('0xb')]);router[_0x6845('0x9')](_0x6845('0xc'),auth['isAuthenticated'](),controller[_0x6845('0xd')]);router['get'](_0x6845('0xe'),auth[_0x6845('0xa')](),controller['show']);router[_0x6845('0x9')](_0x6845('0xf'),auth[_0x6845('0xa')](),controller['getAgents']);router[_0x6845('0x9')](_0x6845('0x10'),auth[_0x6845('0xa')](),controller[_0x6845('0x11')]);router[_0x6845('0x12')]('/',auth[_0x6845('0xa')](),controller['create']);router[_0x6845('0x12')](_0x6845('0xf'),auth[_0x6845('0xa')](),controller[_0x6845('0x13')]);router[_0x6845('0x12')]('/:id/teams',auth['isAuthenticated'](),controller[_0x6845('0x14')]);router[_0x6845('0x15')](_0x6845('0xe'),auth['isAuthenticated'](),controller[_0x6845('0x16')]);router[_0x6845('0x17')](_0x6845('0xe'),auth[_0x6845('0xa')](),controller[_0x6845('0x18')]);router[_0x6845('0x17')](_0x6845('0xf'),auth['isAuthenticated'](),controller[_0x6845('0x19')]);router['delete']('/:id/teams',auth[_0x6845('0xa')](),controller[_0x6845('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 7834af1..f8d5234 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 _0xce0f=['name','VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports','STRING'];(function(_0x4f7339,_0x1dc41e){var _0x241781=function(_0x50d5f2){while(--_0x50d5f2){_0x4f7339['push'](_0x4f7339['shift']());}};_0x241781(++_0x1dc41e);}(_0xce0f,0x1ad));var _0xfce0=function(_0x44be2a,_0x4aa94a){_0x44be2a=_0x44be2a-0x0;var _0x22de05=_0xce0f[_0x44be2a];return _0x22de05;};'use strict';var Sequelize=require(_0xfce0('0x0'));module[_0xfce0('0x1')]={'name':{'type':Sequelize[_0xfce0('0x2')],'allowNull':![],'unique':_0xfce0('0x3')},'prefix':{'type':Sequelize[_0xfce0('0x4')],'get':function(_0xc338ee){return _0xfce0('0x5')+this[_0xfce0('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0xfce0('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xfce0('0x7')]}}; \ No newline at end of file +var _0x6551=['exports','name','VIRTUAL','getDataValue','STRING','INTEGER','sequelize'];(function(_0x24e0a8,_0x49d031){var _0x1051f5=function(_0x45f365){while(--_0x45f365){_0x24e0a8['push'](_0x24e0a8['shift']());}};_0x1051f5(++_0x49d031);}(_0x6551,0xbc));var _0x1655=function(_0x15a7b1,_0x1ffc78){_0x15a7b1=_0x15a7b1-0x0;var _0x5383fa=_0x6551[_0x15a7b1];return _0x5383fa;};'use strict';var Sequelize=require(_0x1655('0x0'));module[_0x1655('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1655('0x2')},'prefix':{'type':Sequelize[_0x1655('0x3')],'get':function(_0x28d05b){return'system-'+this[_0x1655('0x4')](_0x1655('0x2'))+'-';}},'description':{'type':Sequelize[_0x1655('0x5')]},'callerIdAll':{'type':Sequelize[_0x1655('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0x1655('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 340c09b..274c1f8 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 _0x0b0e=['length','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','params','find','describe','sequelize','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','create','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','prefix','push','Set','CDR(prefix)=','callerIdAll','goto','charAt','findById','addAgents','omit','ids','spread','emit','isArray','userVoicePrefix:remove','findOne','User','order','getAgents','nolimit','Team','getTeams','addTeams','Agents','online','voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','all','compact','value','isEmpty','removeAgents','eml-format','zip-dir','request-promise','moment','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','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','end','json','undefined','offset','limit','status','set','apply','save','update','destroy','get','VoicePrefixes','UserProfileResource','then','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x59e2df,_0x34b599){var _0x913ac7=function(_0x2b2327){while(--_0x2b2327){_0x59e2df['push'](_0x59e2df['shift']());}};_0x913ac7(++_0x34b599);}(_0x0b0e,0x187));var _0xe0b0=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x0b0e[_0x199572];return _0x13cfa3;};'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'];config[_0xe0b0('0x18')]=_[_0xe0b0('0x19')](config[_0xe0b0('0x18')],{'host':_0xe0b0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe0b0('0x18')]));require(_0xe0b0('0x1b'))[_0xe0b0('0x1c')](socket);function respondWithStatusCode(_0x24babd,_0x177c24){_0x177c24=_0x177c24||0xcc;return function(_0x55d884){if(_0x55d884){return _0x24babd[_0xe0b0('0x1d')](_0x177c24);}return _0x24babd['status'](_0x177c24)[_0xe0b0('0x1e')]();};}function respondWithResult(_0xadee6e,_0x519ae8){_0x519ae8=_0x519ae8||0xc8;return function(_0x11fdca){if(_0x11fdca){return _0xadee6e['status'](_0x519ae8)[_0xe0b0('0x1f')](_0x11fdca);}};}function respondWithFilteredResult(_0x100204,_0x56bcc7){return function(_0x54a3eb){if(_0x54a3eb){var _0x46bb44=typeof _0x56bcc7['offset']==='undefined'&&typeof _0x56bcc7['limit']===_0xe0b0('0x20');var _0x50fa4a=_0x54a3eb['count'];var _0x10cde1=_0x46bb44?0x0:_0x56bcc7['offset'];var _0x472286=_0x46bb44?_0x54a3eb['count']:_0x56bcc7[_0xe0b0('0x21')]+_0x56bcc7[_0xe0b0('0x22')];var _0x3e10b3;if(_0x472286>=_0x50fa4a){_0x472286=_0x50fa4a;_0x3e10b3=0xc8;}else{_0x3e10b3=0xce;}_0x100204[_0xe0b0('0x23')](_0x3e10b3);return _0x100204[_0xe0b0('0x24')]('Content-Range',_0x10cde1+'-'+_0x472286+'/'+_0x50fa4a)['json'](_0x54a3eb);}return null;};}function patchUpdates(_0x2fa820){return function(_0x5512bb){try{jsonpatch[_0xe0b0('0x25')](_0x5512bb,_0x2fa820,!![]);}catch(_0x31b5f8){return BPromise['reject'](_0x31b5f8);}return _0x5512bb[_0xe0b0('0x26')]();};}function saveUpdates(_0x503883,_0x2208d0){return function(_0x49a727){if(_0x49a727){return _0x49a727[_0xe0b0('0x27')](_0x503883)['then'](function(_0x3e5c88){return _0x3e5c88;});}return null;};}function removeEntity(_0x4de537,_0x4700cc){return function(_0x4aafbe){if(_0x4aafbe){return _0x4aafbe[_0xe0b0('0x28')]()['then'](function(){var _0x362aba=_0x4aafbe[_0xe0b0('0x29')]({'plain':!![]});var _0x1f1ebd=_0xe0b0('0x2a');return db[_0xe0b0('0x2b')][_0xe0b0('0x28')]({'where':{'type':_0x1f1ebd,'resourceId':_0x362aba['id']}})['then'](function(){return _0x4aafbe;});})[_0xe0b0('0x2c')](function(){_0x4de537[_0xe0b0('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15e13b,_0x419b1f){return function(_0x36d137){if(!_0x36d137){_0x15e13b[_0xe0b0('0x1d')](0x194);}return _0x36d137;};}function handleError(_0x3cdbd5,_0x254cad){_0x254cad=_0x254cad||0x1f4;return function(_0x136bd4){logger['error'](_0x136bd4[_0xe0b0('0x2d')]);if(_0x136bd4[_0xe0b0('0x2e')]){delete _0x136bd4['name'];}_0x3cdbd5['status'](_0x254cad)[_0xe0b0('0x2f')](_0x136bd4);};}exports[_0xe0b0('0x30')]=function(_0x422575,_0x3f81d5){var _0x2ab1b1={},_0x5866e5={},_0x32acfe={'count':0x0,'rows':[]};var _0x3231fc=_[_0xe0b0('0x31')](db[_0xe0b0('0x32')][_0xe0b0('0x33')],function(_0x4fe835){return{'name':_0x4fe835[_0xe0b0('0x34')],'type':_0x4fe835[_0xe0b0('0x35')][_0xe0b0('0x36')]};});_0x5866e5[_0xe0b0('0x37')]=_[_0xe0b0('0x31')](_0x3231fc,_0xe0b0('0x2e'));_0x5866e5[_0xe0b0('0x38')]=_[_0xe0b0('0x39')](_0x422575[_0xe0b0('0x38')]);_0x5866e5[_0xe0b0('0x3a')]=_[_0xe0b0('0x3b')](_0x5866e5[_0xe0b0('0x37')],_0x5866e5[_0xe0b0('0x38')]);_0x2ab1b1[_0xe0b0('0x3c')]=_[_0xe0b0('0x3b')](_0x5866e5['model'],qs[_0xe0b0('0x3d')](_0x422575[_0xe0b0('0x38')][_0xe0b0('0x3d')]));_0x2ab1b1[_0xe0b0('0x3c')]=_0x2ab1b1[_0xe0b0('0x3c')][_0xe0b0('0x3e')]?_0x2ab1b1[_0xe0b0('0x3c')]:_0x5866e5['model'];if(!_0x422575['query']['hasOwnProperty']('nolimit')){_0x2ab1b1[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x422575[_0xe0b0('0x38')]['limit']);_0x2ab1b1[_0xe0b0('0x21')]=qs[_0xe0b0('0x21')](_0x422575[_0xe0b0('0x38')][_0xe0b0('0x21')]);}_0x2ab1b1['order']=qs[_0xe0b0('0x3f')](_0x422575[_0xe0b0('0x38')][_0xe0b0('0x3f')]);_0x2ab1b1[_0xe0b0('0x40')]=qs[_0xe0b0('0x3a')](_[_0xe0b0('0x41')](_0x422575[_0xe0b0('0x38')],_0x5866e5[_0xe0b0('0x3a')]),_0x3231fc);if(_0x422575[_0xe0b0('0x38')]['filter']){_0x2ab1b1[_0xe0b0('0x40')]=_['merge'](_0x2ab1b1[_0xe0b0('0x40')],{'$or':_[_0xe0b0('0x31')](_0x3231fc,function(_0x46c4ea){if(_0x46c4ea[_0xe0b0('0x35')]!=='VIRTUAL'){var _0x3e1b6b={};_0x3e1b6b[_0x46c4ea[_0xe0b0('0x2e')]]={'$like':'%'+_0x422575[_0xe0b0('0x38')][_0xe0b0('0x42')]+'%'};return _0x3e1b6b;}})});}_0x2ab1b1=_[_0xe0b0('0x43')]({},_0x2ab1b1,_0x422575[_0xe0b0('0x44')]);var _0x3ad564={'where':_0x2ab1b1[_0xe0b0('0x40')]};return db['VoicePrefix'][_0xe0b0('0x45')](_0x3ad564)[_0xe0b0('0x2c')](function(_0x528818){_0x32acfe['count']=_0x528818;if(_0x422575[_0xe0b0('0x38')][_0xe0b0('0x46')]){_0x2ab1b1['include']=[{'all':!![]}];}return db[_0xe0b0('0x32')][_0xe0b0('0x47')](_0x2ab1b1);})[_0xe0b0('0x2c')](function(_0x1c869d){_0x32acfe[_0xe0b0('0x48')]=_0x1c869d;return _0x32acfe;})['then'](respondWithFilteredResult(_0x3f81d5,_0x2ab1b1))['catch'](handleError(_0x3f81d5,null));};exports['show']=function(_0xc3235b,_0x38e715){var _0x5c2f3b={'raw':![],'where':{'id':_0xc3235b[_0xe0b0('0x49')]['id']}},_0x9f7459={};_0x9f7459[_0xe0b0('0x37')]=_[_0xe0b0('0x39')](db[_0xe0b0('0x32')]['rawAttributes']);_0x9f7459['query']=_[_0xe0b0('0x39')](_0xc3235b[_0xe0b0('0x38')]);_0x9f7459[_0xe0b0('0x3a')]=_[_0xe0b0('0x3b')](_0x9f7459[_0xe0b0('0x37')],_0x9f7459['query']);_0x5c2f3b[_0xe0b0('0x3c')]=_[_0xe0b0('0x3b')](_0x9f7459['model'],qs['fields'](_0xc3235b['query'][_0xe0b0('0x3d')]));_0x5c2f3b[_0xe0b0('0x3c')]=_0x5c2f3b[_0xe0b0('0x3c')][_0xe0b0('0x3e')]?_0x5c2f3b['attributes']:_0x9f7459[_0xe0b0('0x37')];if(_0xc3235b[_0xe0b0('0x38')]['includeAll']){_0x5c2f3b['include']=[{'all':!![]}];}_0x5c2f3b=_[_0xe0b0('0x43')]({},_0x5c2f3b,_0xc3235b[_0xe0b0('0x44')]);return db['VoicePrefix'][_0xe0b0('0x4a')](_0x5c2f3b)[_0xe0b0('0x2c')](handleEntityNotFound(_0x38e715,null))['then'](respondWithResult(_0x38e715,null))['catch'](handleError(_0x38e715,null));};exports[_0xe0b0('0x28')]=function(_0x511679,_0x165dc8){return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x511679[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0x165dc8,null))[_0xe0b0('0x2c')](removeEntity(_0x165dc8,null))['catch'](handleError(_0x165dc8,null));};exports['describe']=function(_0x2ef908,_0x5d380a){return db['VoicePrefix'][_0xe0b0('0x4b')]()[_0xe0b0('0x2c')](respondWithResult(_0x5d380a,null))['catch'](handleError(_0x5d380a,null));};exports['create']=function(_0x13adfb,_0x10b5a6){var _0x17b09f;return db[_0xe0b0('0x4c')][_0xe0b0('0x4d')](function(_0x24115f){return db[_0xe0b0('0x32')]['create'](_0x13adfb[_0xe0b0('0x4e')],{'transaction':_0x24115f})['then'](function(_0x17b3d4){_0x17b09f=_0x17b3d4['get']({'plain':!![]});return db['VoiceExtension'][_0xe0b0('0x4a')]({'where':{'id':_0x17b09f[_0xe0b0('0x4f')]},'raw':!![]})[_0xe0b0('0x2c')](function(_0x2f1712){return createVoicePrefixExtensions(_0x17b09f,_0x2f1712,_0x24115f);});});})[_0xe0b0('0x2c')](function(){var _0x2a588d=_0x13adfb[_0xe0b0('0x50')][_0xe0b0('0x29')]({'plain':!![]});if(!_0x2a588d)throw new Error(_0xe0b0('0x51'));if(_0x2a588d['role']===_0xe0b0('0x50')){var _0x57ccc9=_0x17b09f;return db[_0xe0b0('0x52')][_0xe0b0('0x4a')]({'where':{'name':_0xe0b0('0x2a'),'userProfileId':_0x2a588d[_0xe0b0('0x53')]},'raw':!![]})[_0xe0b0('0x2c')](function(_0x3bdb25){if(_0x3bdb25&&_0x3bdb25['autoAssociation']===0x0){return db[_0xe0b0('0x2b')][_0xe0b0('0x54')]({'name':_0x57ccc9[_0xe0b0('0x2e')],'resourceId':_0x57ccc9['id'],'type':_0x3bdb25[_0xe0b0('0x2e')],'sectionId':_0x3bdb25['id']},{})[_0xe0b0('0x2c')](function(){return _0x17b09f;});}else{return _0x17b09f;}})[_0xe0b0('0x55')](function(_0x234cb7){logger[_0xe0b0('0x56')](_0xe0b0('0x57'),_0x234cb7);throw _0x234cb7;});}return _0x17b09f;})[_0xe0b0('0x2c')](respondWithResult(_0x10b5a6,null))[_0xe0b0('0x55')](handleError(_0x10b5a6,null));};function Extension(_0x18ab99,_0xc719d2,_0x10eb99,_0xcdf97){this[_0xe0b0('0x58')]=_0xe0b0('0x59');this[_0xe0b0('0x5a')]=_0x18ab99;this['app']=_0x10eb99;this[_0xe0b0('0x35')]=_0xe0b0('0x5b');this[_0xe0b0('0x5c')]=_0xe0b0('0x5d');this[_0xe0b0('0x5e')]=_0xc719d2;this[_0xe0b0('0x5f')]=_0xcdf97;}function createVoicePrefixExtensions(_0x2bdb59,_0x4f818b,_0x47dcc4){return new BPromise(function(_0x139014,_0x2a0415){var _0x157556=new Extension(formatPrefixName(_0x2bdb59['prefix']),0x1,_0xe0b0('0x60'),_0xe0b0('0x61'));_0x157556[_0xe0b0('0x62')]=_0x2bdb59['id'];return db[_0xe0b0('0x63')][_0xe0b0('0x54')](_0x157556,{'transaction':_0x47dcc4})['then'](function(_0x370f8c){var _0x242120=_0x370f8c[_0xe0b0('0x29')]({'plain':!![]});var _0x54b5d6=_[_0xe0b0('0x31')](addVoicePrefixExtensions(_0x2bdb59,_0x4f818b),function(_0x30b3ae){_0x30b3ae['VoiceExtensionId']=_0x242120['id'];_0x30b3ae[_0xe0b0('0x62')]=_0x2bdb59['id'];return _0x30b3ae;});return db['VoiceExtension']['bulkCreate'](_0x54b5d6,{'transaction':_0x47dcc4})[_0xe0b0('0x2c')](function(_0x57b51e){if(!_0x57b51e){return _0x2a0415('Extensions\x20creation\x20failed');}else{return _0x139014(_0x57b51e);}})[_0xe0b0('0x55')](function(_0xd750b4){return _0x2a0415(_0xd750b4);});});;});};function addVoicePrefixExtensions(_0x2d91f1,_0x1a4fad){var _0x5a7913=[];var _0x3679e0=formatPrefixName(_0x2d91f1[_0xe0b0('0x64')]);_0x5a7913[_0xe0b0('0x65')](new Extension(_0x3679e0,0x2,_0xe0b0('0x66'),_0xe0b0('0x67')+_0x2d91f1[_0xe0b0('0x2e')]));if(_0x2d91f1[_0xe0b0('0x68')]){_0x5a7913[_0xe0b0('0x65')](new Extension(_0x3679e0,0x3,'Set','PREFIX-CALLERIDALL='+_0x2d91f1[_0xe0b0('0x68')]));}else{_0x5a7913[_0xe0b0('0x65')](new Extension(_0x3679e0,0x3,_0xe0b0('0x60'),'No\x20callerid\x20available'));}_0x5a7913['push'](new Extension(_0x3679e0,0x4,_0xe0b0('0x69'),_0x1a4fad[_0xe0b0('0x58')]+','+'${EXTEN:'+(0x8+_0x2d91f1['name'][_0xe0b0('0x3e')])+'}'+','+0x1));return _0x5a7913;}function formatPrefixName(_0x42b2d3){var _0x38eb8e='_';for(var _0x29175a=0x0;_0x29175a<_0x42b2d3[_0xe0b0('0x3e')];_0x29175a++){if(_0x42b2d3[_0xe0b0('0x6a')](_0x29175a)=='-'){_0x38eb8e+=_0x42b2d3[_0xe0b0('0x6a')](_0x29175a);}else{_0x38eb8e+='['+_0x42b2d3[_0xe0b0('0x6a')](_0x29175a)+']';}}_0x38eb8e+='.';return _0x38eb8e;}exports['update']=function(_0x1daff7,_0x12e245,_0x1673bc){var _0x494420=_0x1daff7['body'];_0x494420['prefix']='system-'+_0x494420['name']+'-';return db['sequelize'][_0xe0b0('0x4d')](function(_0x51b492){return db['VoicePrefix'][_0xe0b0('0x27')](_0x494420,{'where':{'id':_0x494420['id']},'transaction':_0x51b492})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x63')][_0xe0b0('0x28')]({'where':{'VoicePrefixId':_0x494420['id']},'transaction':_0x51b492})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x63')][_0xe0b0('0x4a')]({'where':{'id':_0x494420[_0xe0b0('0x4f')]},'raw':!![]})['then'](function(_0x3097fb){return createVoicePrefixExtensions(_0x494420,_0x3097fb,_0x51b492);});});});})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x32')][_0xe0b0('0x6b')](_0x494420['id']);})[_0xe0b0('0x2c')](respondWithResult(_0x12e245,null))[_0xe0b0('0x55')](handleError(_0x12e245,null));};exports[_0xe0b0('0x6c')]=function(_0x5e3e28,_0xaf2607,_0x5981a3){return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x5e3e28[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0xaf2607,null))['then'](function(_0x311f79){if(_0x311f79){return _0x311f79[_0xe0b0('0x6c')](_0x5e3e28['body']['ids'],_[_0xe0b0('0x6d')](_0x5e3e28[_0xe0b0('0x4e')],[_0xe0b0('0x6e'),'id'])||{})[_0xe0b0('0x6f')](function(_0x8b1390){for(var _0x31dd21=0x0;_0x31dd21<_0x5e3e28[_0xe0b0('0x4e')][_0xe0b0('0x6e')][_0xe0b0('0x3e')];_0x31dd21+=0x1){socket[_0xe0b0('0x70')]('userVoicePrefix:save',{'UserId':Number(_0x5e3e28['body'][_0xe0b0('0x6e')][_0x31dd21]),'VoicePrefixId':Number(_0x5e3e28['params']['id'])});}return _0x8b1390;});}})['then'](respondWithResult(_0xaf2607,null))['catch'](handleError(_0xaf2607,null));};exports['removeAgents']=function(_0x55f064,_0x584350,_0x654d2b){return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x55f064[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0x584350,null))[_0xe0b0('0x2c')](function(_0x948708){if(_0x948708){return _0x948708['removeAgents'](_0x55f064[_0xe0b0('0x38')][_0xe0b0('0x6e')])[_0xe0b0('0x2c')](function(){if(_[_0xe0b0('0x71')](_0x55f064[_0xe0b0('0x38')]['ids'])){for(var _0x55d3f8=0x0;_0x55d3f8<_0x55f064['query']['ids']['length'];_0x55d3f8+=0x1){socket[_0xe0b0('0x70')]('userVoicePrefix:remove',{'UserId':Number(_0x55f064[_0xe0b0('0x38')]['ids'][_0x55d3f8]),'VoicePrefixId':Number(_0x55f064[_0xe0b0('0x49')]['id'])});}}else{socket[_0xe0b0('0x70')](_0xe0b0('0x72'),{'UserId':Number(_0x55f064[_0xe0b0('0x38')][_0xe0b0('0x6e')]),'VoicePrefixId':Number(_0x55f064[_0xe0b0('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x584350,null))['catch'](handleError(_0x584350,null));};exports['getAgents']=function(_0x58e0e3,_0xc1919f,_0x261381){var _0x264363={};var _0x4377f7={};var _0x2c1149;var _0x534881;return db[_0xe0b0('0x32')][_0xe0b0('0x73')]({'where':{'id':_0x58e0e3[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0xc1919f,null))[_0xe0b0('0x2c')](function(_0x2a5082){if(_0x2a5082){_0x2c1149=_0x2a5082;_0x4377f7[_0xe0b0('0x37')]=_[_0xe0b0('0x39')](db[_0xe0b0('0x74')]['rawAttributes']);_0x4377f7['query']=_[_0xe0b0('0x39')](_0x58e0e3[_0xe0b0('0x38')]);_0x4377f7['filters']=_[_0xe0b0('0x3b')](_0x4377f7[_0xe0b0('0x37')],_0x4377f7[_0xe0b0('0x38')]);_0x264363[_0xe0b0('0x3c')]=_[_0xe0b0('0x3b')](_0x4377f7[_0xe0b0('0x37')],qs[_0xe0b0('0x3d')](_0x58e0e3[_0xe0b0('0x38')]['fields']));_0x264363['attributes']=_0x264363['attributes'][_0xe0b0('0x3e')]?_0x264363[_0xe0b0('0x3c')]:_0x4377f7['model'];_0x264363[_0xe0b0('0x75')]=qs[_0xe0b0('0x3f')](_0x58e0e3[_0xe0b0('0x38')][_0xe0b0('0x3f')]);_0x264363['where']=qs['filters'](_['pick'](_0x58e0e3[_0xe0b0('0x38')],_0x4377f7[_0xe0b0('0x3a')]));if(_0x58e0e3['query'][_0xe0b0('0x42')]){_0x264363[_0xe0b0('0x40')]=_['merge'](_0x264363['where'],{'$or':_[_0xe0b0('0x31')](_0x264363['attributes'],function(_0x251195){var _0x5f06c0={};_0x5f06c0[_0x251195]={'$like':'%'+_0x58e0e3[_0xe0b0('0x38')][_0xe0b0('0x42')]+'%'};return _0x5f06c0;})});}_0x264363=_[_0xe0b0('0x43')]({},_0x264363,_0x58e0e3[_0xe0b0('0x44')]);return _0x2c1149[_0xe0b0('0x76')](_0x264363);}})[_0xe0b0('0x2c')](function(_0x434dfa){if(_0x434dfa){_0x534881=_0x434dfa[_0xe0b0('0x3e')];if(!_0x58e0e3[_0xe0b0('0x38')]['hasOwnProperty'](_0xe0b0('0x77'))){_0x264363[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x58e0e3['query'][_0xe0b0('0x22')]);_0x264363['offset']=qs[_0xe0b0('0x21')](_0x58e0e3[_0xe0b0('0x38')]['offset']);}return _0x2c1149[_0xe0b0('0x76')](_0x264363);}})['then'](function(_0x528932){if(_0x528932){return _0x528932?{'count':_0x534881,'rows':_0x528932}:null;}})[_0xe0b0('0x2c')](respondWithResult(_0xc1919f,null))['catch'](handleError(_0xc1919f,null));};exports['getTeams']=function(_0x4f027c,_0x1e4bfb,_0x238979){var _0x9e8b9c={};var _0x42b591={};var _0x3da0ce;var _0x4e0429;return db[_0xe0b0('0x32')][_0xe0b0('0x73')]({'where':{'id':_0x4f027c[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e4bfb,null))[_0xe0b0('0x2c')](function(_0x447641){if(_0x447641){_0x3da0ce=_0x447641;_0x42b591['model']=_['keys'](db[_0xe0b0('0x78')]['rawAttributes']);_0x42b591[_0xe0b0('0x38')]=_[_0xe0b0('0x39')](_0x4f027c[_0xe0b0('0x38')]);_0x42b591[_0xe0b0('0x3a')]=_[_0xe0b0('0x3b')](_0x42b591[_0xe0b0('0x37')],_0x42b591[_0xe0b0('0x38')]);_0x9e8b9c['attributes']=_[_0xe0b0('0x3b')](_0x42b591[_0xe0b0('0x37')],qs[_0xe0b0('0x3d')](_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x3d')]));_0x9e8b9c['attributes']=_0x9e8b9c['attributes'][_0xe0b0('0x3e')]?_0x9e8b9c[_0xe0b0('0x3c')]:_0x42b591[_0xe0b0('0x37')];_0x9e8b9c[_0xe0b0('0x75')]=qs[_0xe0b0('0x3f')](_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x3f')]);_0x9e8b9c[_0xe0b0('0x40')]=qs[_0xe0b0('0x3a')](_[_0xe0b0('0x41')](_0x4f027c['query'],_0x42b591[_0xe0b0('0x3a')]));if(_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x42')]){_0x9e8b9c[_0xe0b0('0x40')]=_['merge'](_0x9e8b9c[_0xe0b0('0x40')],{'$or':_[_0xe0b0('0x31')](_0x9e8b9c[_0xe0b0('0x3c')],function(_0x116c16){var _0x476763={};_0x476763[_0x116c16]={'$like':'%'+_0x4f027c['query'][_0xe0b0('0x42')]+'%'};return _0x476763;})});}_0x9e8b9c=_['merge']({},_0x9e8b9c,_0x4f027c[_0xe0b0('0x44')]);return _0x3da0ce[_0xe0b0('0x79')](_0x9e8b9c);}})[_0xe0b0('0x2c')](function(_0x23c448){if(_0x23c448){_0x4e0429=_0x23c448[_0xe0b0('0x3e')];if(!_0x4f027c['query']['hasOwnProperty'](_0xe0b0('0x77'))){_0x9e8b9c['limit']=qs[_0xe0b0('0x22')](_0x4f027c['query'][_0xe0b0('0x22')]);_0x9e8b9c[_0xe0b0('0x21')]=qs[_0xe0b0('0x21')](_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x21')]);}return _0x3da0ce[_0xe0b0('0x79')](_0x9e8b9c);}})[_0xe0b0('0x2c')](function(_0x5d7cee){if(_0x5d7cee){return _0x5d7cee?{'count':_0x4e0429,'rows':_0x5d7cee}:null;}})['then'](respondWithResult(_0x1e4bfb,null))[_0xe0b0('0x55')](handleError(_0x1e4bfb,null));};exports[_0xe0b0('0x7a')]=function(_0x184938,_0x20d6bd,_0xd83992){var _0x2b4d49=_0x184938[_0xe0b0('0x4e')][_0xe0b0('0x6e')];var _0x1bbb0d;return db[_0xe0b0('0x78')]['findAll']({'where':{'id':_0x2b4d49},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x7b'),'attributes':['id',_0xe0b0('0x2e'),_0xe0b0('0x7c'),_0xe0b0('0x7d'),_0xe0b0('0x7e')],'raw':!![]}]})[_0xe0b0('0x2c')](function(_0x33b67a){if(_0x33b67a){_0x1bbb0d=_0x33b67a;var _0x51995b=_['flatMap'](_0x33b67a,function(_0x302f9f){var _0x1ea4d5=_0x302f9f[_0xe0b0('0x29')]({'plain':!![]});return _0x1ea4d5[_0xe0b0('0x7b')];});return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x184938[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](function(_0x6ef3b2){return db[_0xe0b0('0x4c')]['transaction'](function(_0x46b247){return _0x6ef3b2[_0xe0b0('0x7a')](_0x2b4d49,{'transaction':_0x46b247})['then'](function(){return BPromise[_0xe0b0('0x7f')](_0x1bbb0d,function(_0x4250f4){return db[_0xe0b0('0x80')][_0xe0b0('0x81')]({'TeamId':_0x4250f4['id'],'VoicePrefixId':_0x184938[_0xe0b0('0x49')]['id']},{'transaction':_0x46b247});});})['then'](function(){return BPromise[_0xe0b0('0x7f')](_0x51995b,function(_0x38f9af){return db[_0xe0b0('0x82')][_0xe0b0('0x83')]({'where':{'UserId':_0x38f9af['id'],'VoicePrefixId':_0x184938[_0xe0b0('0x49')]['id']},'transaction':_0x46b247});});})['then'](function(){_0x51995b[_0xe0b0('0x84')](function(_0x58d61b){socket[_0xe0b0('0x70')](_0xe0b0('0x85'),{'UserId':_0x58d61b['id'],'VoicePrefixId':_0x6ef3b2['id']});});});});});}})[_0xe0b0('0x2c')](respondWithStatusCode(_0x20d6bd,null))['catch'](handleError(_0x20d6bd,null));};exports['removeTeams']=function(_0x45ae1a,_0x2349df,_0x619226){return db['Team']['findAll']({'where':{'id':_0x45ae1a['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe0b0('0x2c')](handleEntityNotFound(_0x2349df,null))[_0xe0b0('0x2c')](function(_0x5ac132){var _0x121257=_[_0xe0b0('0x31')](_0x5ac132,'id');var _0xfd746a=[];var _0xd73b8a=[];var _0x437588=squel['select']();_0x437588['field'](_0xe0b0('0x86'))[_0xe0b0('0x87')](_0xe0b0('0x88'),'tq')['join'](_0xe0b0('0x89'),'ut',_0xe0b0('0x8a'))[_0xe0b0('0x40')](_0xe0b0('0x8b'),_0x45ae1a[_0xe0b0('0x49')]['id']);for(var _0x1b8d4a=0x0;_0x1b8d4a<_0x5ac132['length'];_0x1b8d4a+=0x1){let _0x581848=_0x5ac132[_0x1b8d4a];for(var _0x495635=0x0;_0x495635<_0x581848[_0xe0b0('0x7b')][_0xe0b0('0x3e')];_0x495635+=0x1){let _0x9f9d8d=_0x581848[_0xe0b0('0x7b')][_0x495635];var _0x266cb5=_0x437588[_0xe0b0('0x8c')]();_0x266cb5[_0xe0b0('0x40')](_0xe0b0('0x8d'),_0x9f9d8d['id']);_0xd73b8a['push'](db['sequelize'][_0xe0b0('0x38')](_0x266cb5[_0xe0b0('0x8e')](),{'type':db[_0xe0b0('0x4c')]['QueryTypes'][_0xe0b0('0x8f')]})[_0xe0b0('0x2c')](function(_0x9f1fb){if(_0x9f1fb['length']===0x1){return _0x9f9d8d['id'];}else{var _0x36fa1f=_['every'](_[_0xe0b0('0x31')](_0x9f1fb,_0xe0b0('0x90')),function(_0x1e74a0){return _[_0xe0b0('0x91')](_0x121257,_0x1e74a0);});if(_0x36fa1f){return _0x9f9d8d['id'];}}}));}}return BPromise[_0xe0b0('0x92')](_0xd73b8a)[_0xe0b0('0x2c')](function(_0x12e46f){_0xfd746a=_(_0xfd746a)['union'](_0x12e46f)[_0xe0b0('0x93')]()[_0xe0b0('0x94')]();return db['VoicePrefix'][_0xe0b0('0x4a')]({'where':{'id':_0x45ae1a[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](function(_0x4dbb7b){return db[_0xe0b0('0x4c')][_0xe0b0('0x4d')](function(_0x221e96){return _0x4dbb7b['removeTeams'](_0x45ae1a[_0xe0b0('0x38')][_0xe0b0('0x6e')],{'transaction':_0x221e96})[_0xe0b0('0x2c')](function(){if(!_[_0xe0b0('0x95')](_0xfd746a)){return _0x4dbb7b[_0xe0b0('0x96')](_0xfd746a,{'transaction':_0x221e96});}})[_0xe0b0('0x2c')](function(){_0xfd746a['forEach'](function(_0x44da91){socket[_0xe0b0('0x70')](_0xe0b0('0x72'),{'UserId':_0x44da91,'VoicePrefixId':_0x4dbb7b['id']});});});});});});})[_0xe0b0('0x2c')](respondWithStatusCode(_0x2349df,null))[_0xe0b0('0x55')](handleError(_0x2349df,null));}; \ No newline at end of file +var _0x34b7=['fieldName','type','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','rows','catch','fields','includeAll','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','order','getTeams','Team','addTeams','findAll','Agents','online','voicePause','interface','flatMap','TeamVoicePrefix','upsert','each','findOrCreate','forEach','removeTeams','select','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','toString','SELECT','every','TeamId','all','compact','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','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','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','send','index','map','VoicePrefix','rawAttributes'];(function(_0x56b733,_0x461486){var _0x22bf1d=function(_0x506795){while(--_0x506795){_0x56b733['push'](_0x56b733['shift']());}};_0x22bf1d(++_0x461486);}(_0x34b7,0x196));var _0x734b=function(_0x4b095c,_0x266c55){_0x4b095c=_0x4b095c-0x0;var _0x4495e2=_0x34b7[_0x4b095c];return _0x4495e2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x734b('0x0'));var jsonpatch=require(_0x734b('0x1'));var rp=require(_0x734b('0x2'));var moment=require(_0x734b('0x3'));var BPromise=require(_0x734b('0x4'));var Mustache=require(_0x734b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x734b('0x6'));var csv=require(_0x734b('0x7'));var ejs=require(_0x734b('0x8'));var fs=require('fs');var fs_extra=require(_0x734b('0x9'));var _=require(_0x734b('0xa'));var squel=require(_0x734b('0xb'));var crypto=require('crypto');var jsforce=require(_0x734b('0xc'));var deskjs=require(_0x734b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x734b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x734b('0xf'));var as=require(_0x734b('0x10'));var hardwareService=require(_0x734b('0x11'));var logger=require(_0x734b('0x12'))(_0x734b('0x13'));var utils=require(_0x734b('0x14'));var config=require(_0x734b('0x15'));var licenseUtil=require(_0x734b('0x16'));var db=require(_0x734b('0x17'))['db'];config[_0x734b('0x18')]=_[_0x734b('0x19')](config[_0x734b('0x18')],{'host':_0x734b('0x1a'),'port':0x18eb});var socket=require(_0x734b('0x1b'))(new Redis(config['redis']));require(_0x734b('0x1c'))[_0x734b('0x1d')](socket);function respondWithStatusCode(_0x47791c,_0xd1ab2a){_0xd1ab2a=_0xd1ab2a||0xcc;return function(_0x19f427){if(_0x19f427){return _0x47791c[_0x734b('0x1e')](_0xd1ab2a);}return _0x47791c[_0x734b('0x1f')](_0xd1ab2a)[_0x734b('0x20')]();};}function respondWithResult(_0xa6d111,_0x4b8c63){_0x4b8c63=_0x4b8c63||0xc8;return function(_0x42407a){if(_0x42407a){return _0xa6d111['status'](_0x4b8c63)[_0x734b('0x21')](_0x42407a);}};}function respondWithFilteredResult(_0x2ee290,_0xfb661a){return function(_0x5edbe9){if(_0x5edbe9){var _0x4d3b9c=typeof _0xfb661a['offset']===_0x734b('0x22')&&typeof _0xfb661a[_0x734b('0x23')]===_0x734b('0x22');var _0x41ba87=_0x5edbe9[_0x734b('0x24')];var _0xfe567d=_0x4d3b9c?0x0:_0xfb661a[_0x734b('0x25')];var _0x6572ee=_0x4d3b9c?_0x5edbe9[_0x734b('0x24')]:_0xfb661a[_0x734b('0x25')]+_0xfb661a[_0x734b('0x23')];var _0x3d0ffd;if(_0x6572ee>=_0x41ba87){_0x6572ee=_0x41ba87;_0x3d0ffd=0xc8;}else{_0x3d0ffd=0xce;}_0x2ee290[_0x734b('0x1f')](_0x3d0ffd);return _0x2ee290[_0x734b('0x26')]('Content-Range',_0xfe567d+'-'+_0x6572ee+'/'+_0x41ba87)[_0x734b('0x21')](_0x5edbe9);}return null;};}function patchUpdates(_0x7856d7){return function(_0x4f98a7){try{jsonpatch[_0x734b('0x27')](_0x4f98a7,_0x7856d7,!![]);}catch(_0x1f81de){return BPromise[_0x734b('0x28')](_0x1f81de);}return _0x4f98a7[_0x734b('0x29')]();};}function saveUpdates(_0x46d432,_0x26d118){return function(_0x26eccf){if(_0x26eccf){return _0x26eccf[_0x734b('0x2a')](_0x46d432)[_0x734b('0x2b')](function(_0x3abbe6){return _0x3abbe6;});}return null;};}function removeEntity(_0x44ffa9,_0x148abe){return function(_0x3bb651){if(_0x3bb651){return _0x3bb651['destroy']()['then'](function(){var _0x13cc5a=_0x3bb651[_0x734b('0x2c')]({'plain':!![]});var _0x47a0a9=_0x734b('0x2d');return db[_0x734b('0x2e')][_0x734b('0x2f')]({'where':{'type':_0x47a0a9,'resourceId':_0x13cc5a['id']}})[_0x734b('0x2b')](function(){return _0x3bb651;});})[_0x734b('0x2b')](function(){_0x44ffa9[_0x734b('0x1f')](0xcc)[_0x734b('0x20')]();});}};}function handleEntityNotFound(_0x5c6c5d,_0x1f3652){return function(_0x436efe){if(!_0x436efe){_0x5c6c5d[_0x734b('0x1e')](0x194);}return _0x436efe;};}function handleError(_0x241c89,_0x729431){_0x729431=_0x729431||0x1f4;return function(_0x427c36){logger[_0x734b('0x30')](_0x427c36[_0x734b('0x31')]);if(_0x427c36[_0x734b('0x32')]){delete _0x427c36[_0x734b('0x32')];}_0x241c89['status'](_0x729431)[_0x734b('0x33')](_0x427c36);};}exports[_0x734b('0x34')]=function(_0x57f792,_0xbbe037){var _0x3cfce2={},_0xf4ef21={},_0x2fe7d5={'count':0x0,'rows':[]};var _0x21cb04=_[_0x734b('0x35')](db[_0x734b('0x36')][_0x734b('0x37')],function(_0x1e53fb){return{'name':_0x1e53fb[_0x734b('0x38')],'type':_0x1e53fb[_0x734b('0x39')][_0x734b('0x3a')]};});_0xf4ef21[_0x734b('0x3b')]=_[_0x734b('0x35')](_0x21cb04,_0x734b('0x32'));_0xf4ef21['query']=_[_0x734b('0x3c')](_0x57f792['query']);_0xf4ef21[_0x734b('0x3d')]=_[_0x734b('0x3e')](_0xf4ef21[_0x734b('0x3b')],_0xf4ef21[_0x734b('0x3f')]);_0x3cfce2[_0x734b('0x40')]=_[_0x734b('0x3e')](_0xf4ef21['model'],qs['fields'](_0x57f792[_0x734b('0x3f')]['fields']));_0x3cfce2[_0x734b('0x40')]=_0x3cfce2['attributes'][_0x734b('0x41')]?_0x3cfce2['attributes']:_0xf4ef21[_0x734b('0x3b')];if(!_0x57f792['query'][_0x734b('0x42')](_0x734b('0x43'))){_0x3cfce2[_0x734b('0x23')]=qs[_0x734b('0x23')](_0x57f792[_0x734b('0x3f')][_0x734b('0x23')]);_0x3cfce2[_0x734b('0x25')]=qs['offset'](_0x57f792[_0x734b('0x3f')][_0x734b('0x25')]);}_0x3cfce2['order']=qs[_0x734b('0x44')](_0x57f792[_0x734b('0x3f')][_0x734b('0x44')]);_0x3cfce2[_0x734b('0x45')]=qs['filters'](_[_0x734b('0x46')](_0x57f792[_0x734b('0x3f')],_0xf4ef21['filters']),_0x21cb04);if(_0x57f792[_0x734b('0x3f')][_0x734b('0x47')]){_0x3cfce2['where']=_[_0x734b('0x48')](_0x3cfce2[_0x734b('0x45')],{'$or':_[_0x734b('0x35')](_0x21cb04,function(_0x300aaa){if(_0x300aaa['type']!=='VIRTUAL'){var _0x2f6cee={};_0x2f6cee[_0x300aaa['name']]={'$like':'%'+_0x57f792['query'][_0x734b('0x47')]+'%'};return _0x2f6cee;}})});}_0x3cfce2=_['merge']({},_0x3cfce2,_0x57f792[_0x734b('0x49')]);var _0x4d77f0={'where':_0x3cfce2[_0x734b('0x45')]};return db[_0x734b('0x36')][_0x734b('0x24')](_0x4d77f0)['then'](function(_0x5cf3a0){_0x2fe7d5[_0x734b('0x24')]=_0x5cf3a0;if(_0x57f792['query']['includeAll']){_0x3cfce2[_0x734b('0x4a')]=[{'all':!![]}];}return db[_0x734b('0x36')]['findAll'](_0x3cfce2);})[_0x734b('0x2b')](function(_0x513f07){_0x2fe7d5[_0x734b('0x4b')]=_0x513f07;return _0x2fe7d5;})[_0x734b('0x2b')](respondWithFilteredResult(_0xbbe037,_0x3cfce2))[_0x734b('0x4c')](handleError(_0xbbe037,null));};exports['show']=function(_0xe8b116,_0x2455b9){var _0x3bca7e={'raw':![],'where':{'id':_0xe8b116['params']['id']}},_0x439139={};_0x439139['model']=_['keys'](db[_0x734b('0x36')]['rawAttributes']);_0x439139['query']=_[_0x734b('0x3c')](_0xe8b116['query']);_0x439139[_0x734b('0x3d')]=_[_0x734b('0x3e')](_0x439139[_0x734b('0x3b')],_0x439139[_0x734b('0x3f')]);_0x3bca7e['attributes']=_[_0x734b('0x3e')](_0x439139['model'],qs[_0x734b('0x4d')](_0xe8b116[_0x734b('0x3f')][_0x734b('0x4d')]));_0x3bca7e['attributes']=_0x3bca7e[_0x734b('0x40')]['length']?_0x3bca7e[_0x734b('0x40')]:_0x439139[_0x734b('0x3b')];if(_0xe8b116['query'][_0x734b('0x4e')]){_0x3bca7e[_0x734b('0x4a')]=[{'all':!![]}];}_0x3bca7e=_[_0x734b('0x48')]({},_0x3bca7e,_0xe8b116[_0x734b('0x49')]);return db[_0x734b('0x36')]['find'](_0x3bca7e)[_0x734b('0x2b')](handleEntityNotFound(_0x2455b9,null))['then'](respondWithResult(_0x2455b9,null))[_0x734b('0x4c')](handleError(_0x2455b9,null));};exports['destroy']=function(_0xd3c688,_0xa2fd9d){return db[_0x734b('0x36')][_0x734b('0x4f')]({'where':{'id':_0xd3c688[_0x734b('0x50')]['id']}})['then'](handleEntityNotFound(_0xa2fd9d,null))['then'](removeEntity(_0xa2fd9d,null))['catch'](handleError(_0xa2fd9d,null));};exports[_0x734b('0x51')]=function(_0x1901a8,_0x541991){return db[_0x734b('0x36')][_0x734b('0x51')]()['then'](respondWithResult(_0x541991,null))[_0x734b('0x4c')](handleError(_0x541991,null));};exports[_0x734b('0x52')]=function(_0x44e6d2,_0x4d6501){var _0x2e95aa;return db[_0x734b('0x53')][_0x734b('0x54')](function(_0xe605be){return db['VoicePrefix'][_0x734b('0x52')](_0x44e6d2[_0x734b('0x55')],{'transaction':_0xe605be})[_0x734b('0x2b')](function(_0x432a96){_0x2e95aa=_0x432a96['get']({'plain':!![]});return db[_0x734b('0x56')]['find']({'where':{'id':_0x2e95aa[_0x734b('0x57')]},'raw':!![]})[_0x734b('0x2b')](function(_0x1f3594){return createVoicePrefixExtensions(_0x2e95aa,_0x1f3594,_0xe605be);});});})[_0x734b('0x2b')](function(){var _0x58d665=_0x44e6d2[_0x734b('0x58')][_0x734b('0x2c')]({'plain':!![]});if(!_0x58d665)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58d665['role']===_0x734b('0x58')){var _0x577735=_0x2e95aa;return db[_0x734b('0x59')][_0x734b('0x4f')]({'where':{'name':_0x734b('0x2d'),'userProfileId':_0x58d665['userProfileId']},'raw':!![]})[_0x734b('0x2b')](function(_0x588cd8){if(_0x588cd8&&_0x588cd8[_0x734b('0x5a')]===0x0){return db[_0x734b('0x2e')][_0x734b('0x52')]({'name':_0x577735[_0x734b('0x32')],'resourceId':_0x577735['id'],'type':_0x588cd8['name'],'sectionId':_0x588cd8['id']},{})[_0x734b('0x2b')](function(){return _0x2e95aa;});}else{return _0x2e95aa;}})['catch'](function(_0x6b198c){logger[_0x734b('0x30')](_0x734b('0x5b'),_0x6b198c);throw _0x6b198c;});}return _0x2e95aa;})['then'](respondWithResult(_0x4d6501,null))[_0x734b('0x4c')](handleError(_0x4d6501,null));};function Extension(_0x55c699,_0x2c81a1,_0x17a217,_0x3ec705){this[_0x734b('0x5c')]='from-sip';this[_0x734b('0x5d')]=_0x55c699;this['app']=_0x17a217;this[_0x734b('0x39')]=_0x734b('0x5e');this[_0x734b('0x5f')]='Voice\x20Prefix\x20Extension';this[_0x734b('0x60')]=_0x2c81a1;this[_0x734b('0x61')]=_0x3ec705;}function createVoicePrefixExtensions(_0x366379,_0x3b16bb,_0x228f85){return new BPromise(function(_0x262244,_0x164c81){var _0x506407=new Extension(formatPrefixName(_0x366379[_0x734b('0x62')]),0x1,_0x734b('0x63'),_0x734b('0x64'));_0x506407['VoicePrefixId']=_0x366379['id'];return db['VoiceExtension'][_0x734b('0x52')](_0x506407,{'transaction':_0x228f85})[_0x734b('0x2b')](function(_0x391c04){var _0x1eec8e=_0x391c04['get']({'plain':!![]});var _0x565a2e=_['map'](addVoicePrefixExtensions(_0x366379,_0x3b16bb),function(_0x1bd023){_0x1bd023[_0x734b('0x57')]=_0x1eec8e['id'];_0x1bd023[_0x734b('0x65')]=_0x366379['id'];return _0x1bd023;});return db[_0x734b('0x56')][_0x734b('0x66')](_0x565a2e,{'transaction':_0x228f85})[_0x734b('0x2b')](function(_0x113931){if(!_0x113931){return _0x164c81(_0x734b('0x67'));}else{return _0x262244(_0x113931);}})[_0x734b('0x4c')](function(_0x459788){return _0x164c81(_0x459788);});});;});};function addVoicePrefixExtensions(_0xc5a114,_0x69b605){var _0x43951a=[];var _0x467b1=formatPrefixName(_0xc5a114[_0x734b('0x62')]);_0x43951a[_0x734b('0x68')](new Extension(_0x467b1,0x2,_0x734b('0x69'),_0x734b('0x6a')+_0xc5a114[_0x734b('0x32')]));if(_0xc5a114[_0x734b('0x6b')]){_0x43951a[_0x734b('0x68')](new Extension(_0x467b1,0x3,'Set',_0x734b('0x6c')+_0xc5a114[_0x734b('0x6b')]));}else{_0x43951a[_0x734b('0x68')](new Extension(_0x467b1,0x3,_0x734b('0x63'),_0x734b('0x6d')));}_0x43951a['push'](new Extension(_0x467b1,0x4,_0x734b('0x6e'),_0x69b605[_0x734b('0x5c')]+','+_0x734b('0x6f')+(0x8+_0xc5a114[_0x734b('0x32')][_0x734b('0x41')])+'}'+','+0x1));return _0x43951a;}function formatPrefixName(_0x5d785d){var _0x594df0='_';for(var _0x479ee2=0x0;_0x479ee2<_0x5d785d['length'];_0x479ee2++){if(_0x5d785d['charAt'](_0x479ee2)=='-'){_0x594df0+=_0x5d785d['charAt'](_0x479ee2);}else{_0x594df0+='['+_0x5d785d[_0x734b('0x70')](_0x479ee2)+']';}}_0x594df0+='.';return _0x594df0;}exports[_0x734b('0x2a')]=function(_0x16c9d2,_0xb23b61,_0x496070){var _0x4f79a9=_0x16c9d2[_0x734b('0x55')];_0x4f79a9[_0x734b('0x62')]=_0x734b('0x71')+_0x4f79a9[_0x734b('0x32')]+'-';return db['sequelize'][_0x734b('0x54')](function(_0x24ab5c){return db[_0x734b('0x36')][_0x734b('0x2a')](_0x4f79a9,{'where':{'id':_0x4f79a9['id']},'transaction':_0x24ab5c})['then'](function(){return db[_0x734b('0x56')]['destroy']({'where':{'VoicePrefixId':_0x4f79a9['id']},'transaction':_0x24ab5c})[_0x734b('0x2b')](function(){return db[_0x734b('0x56')][_0x734b('0x4f')]({'where':{'id':_0x4f79a9[_0x734b('0x57')]},'raw':!![]})[_0x734b('0x2b')](function(_0x4e43c3){return createVoicePrefixExtensions(_0x4f79a9,_0x4e43c3,_0x24ab5c);});});});})[_0x734b('0x2b')](function(){return db[_0x734b('0x36')][_0x734b('0x72')](_0x4f79a9['id']);})[_0x734b('0x2b')](respondWithResult(_0xb23b61,null))[_0x734b('0x4c')](handleError(_0xb23b61,null));};exports['addAgents']=function(_0x475ecd,_0x2dcb30,_0x1316ae){return db[_0x734b('0x36')]['find']({'where':{'id':_0x475ecd[_0x734b('0x50')]['id']}})[_0x734b('0x2b')](handleEntityNotFound(_0x2dcb30,null))[_0x734b('0x2b')](function(_0x407006){if(_0x407006){return _0x407006[_0x734b('0x73')](_0x475ecd['body'][_0x734b('0x74')],_['omit'](_0x475ecd[_0x734b('0x55')],[_0x734b('0x74'),'id'])||{})[_0x734b('0x75')](function(_0x27fd22){for(var _0x4624c7=0x0;_0x4624c7<_0x475ecd[_0x734b('0x55')]['ids']['length'];_0x4624c7+=0x1){socket['emit'](_0x734b('0x76'),{'UserId':Number(_0x475ecd['body'][_0x734b('0x74')][_0x4624c7]),'VoicePrefixId':Number(_0x475ecd[_0x734b('0x50')]['id'])});}return _0x27fd22;});}})['then'](respondWithResult(_0x2dcb30,null))[_0x734b('0x4c')](handleError(_0x2dcb30,null));};exports[_0x734b('0x77')]=function(_0x17749f,_0x2a3c8d,_0x1d0bfb){return db[_0x734b('0x36')][_0x734b('0x4f')]({'where':{'id':_0x17749f[_0x734b('0x50')]['id']}})[_0x734b('0x2b')](handleEntityNotFound(_0x2a3c8d,null))[_0x734b('0x2b')](function(_0x5de89a){if(_0x5de89a){return _0x5de89a[_0x734b('0x77')](_0x17749f[_0x734b('0x3f')][_0x734b('0x74')])['then'](function(){if(_[_0x734b('0x78')](_0x17749f[_0x734b('0x3f')][_0x734b('0x74')])){for(var _0x13f1fd=0x0;_0x13f1fd<_0x17749f[_0x734b('0x3f')][_0x734b('0x74')][_0x734b('0x41')];_0x13f1fd+=0x1){socket[_0x734b('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x17749f[_0x734b('0x3f')][_0x734b('0x74')][_0x13f1fd]),'VoicePrefixId':Number(_0x17749f[_0x734b('0x50')]['id'])});}}else{socket[_0x734b('0x79')](_0x734b('0x7a'),{'UserId':Number(_0x17749f[_0x734b('0x3f')][_0x734b('0x74')]),'VoicePrefixId':Number(_0x17749f[_0x734b('0x50')]['id'])});}});}})[_0x734b('0x2b')](respondWithStatusCode(_0x2a3c8d,null))['catch'](handleError(_0x2a3c8d,null));};exports[_0x734b('0x7b')]=function(_0x13f4e8,_0x41eca7,_0x500ebf){var _0x31e1ec={};var _0x2fde66={};var _0x24fb9d;var _0x3f3511;return db[_0x734b('0x36')][_0x734b('0x7c')]({'where':{'id':_0x13f4e8['params']['id']}})[_0x734b('0x2b')](handleEntityNotFound(_0x41eca7,null))['then'](function(_0x504a7f){if(_0x504a7f){_0x24fb9d=_0x504a7f;_0x2fde66['model']=_['keys'](db[_0x734b('0x7d')][_0x734b('0x37')]);_0x2fde66[_0x734b('0x3f')]=_[_0x734b('0x3c')](_0x13f4e8['query']);_0x2fde66['filters']=_[_0x734b('0x3e')](_0x2fde66['model'],_0x2fde66[_0x734b('0x3f')]);_0x31e1ec[_0x734b('0x40')]=_['intersection'](_0x2fde66[_0x734b('0x3b')],qs['fields'](_0x13f4e8['query']['fields']));_0x31e1ec[_0x734b('0x40')]=_0x31e1ec[_0x734b('0x40')][_0x734b('0x41')]?_0x31e1ec[_0x734b('0x40')]:_0x2fde66['model'];_0x31e1ec[_0x734b('0x7e')]=qs[_0x734b('0x44')](_0x13f4e8['query'][_0x734b('0x44')]);_0x31e1ec[_0x734b('0x45')]=qs['filters'](_[_0x734b('0x46')](_0x13f4e8['query'],_0x2fde66[_0x734b('0x3d')]));if(_0x13f4e8[_0x734b('0x3f')][_0x734b('0x47')]){_0x31e1ec[_0x734b('0x45')]=_[_0x734b('0x48')](_0x31e1ec[_0x734b('0x45')],{'$or':_[_0x734b('0x35')](_0x31e1ec['attributes'],function(_0x5be5f2){var _0x57f20a={};_0x57f20a[_0x5be5f2]={'$like':'%'+_0x13f4e8[_0x734b('0x3f')][_0x734b('0x47')]+'%'};return _0x57f20a;})});}_0x31e1ec=_['merge']({},_0x31e1ec,_0x13f4e8[_0x734b('0x49')]);return _0x24fb9d[_0x734b('0x7b')](_0x31e1ec);}})[_0x734b('0x2b')](function(_0x48b0e1){if(_0x48b0e1){_0x3f3511=_0x48b0e1[_0x734b('0x41')];if(!_0x13f4e8[_0x734b('0x3f')][_0x734b('0x42')]('nolimit')){_0x31e1ec[_0x734b('0x23')]=qs[_0x734b('0x23')](_0x13f4e8[_0x734b('0x3f')]['limit']);_0x31e1ec['offset']=qs['offset'](_0x13f4e8[_0x734b('0x3f')]['offset']);}return _0x24fb9d[_0x734b('0x7b')](_0x31e1ec);}})[_0x734b('0x2b')](function(_0x2a5aa9){if(_0x2a5aa9){return _0x2a5aa9?{'count':_0x3f3511,'rows':_0x2a5aa9}:null;}})['then'](respondWithResult(_0x41eca7,null))['catch'](handleError(_0x41eca7,null));};exports[_0x734b('0x7f')]=function(_0xa9bb2a,_0x4f3a90,_0x72d3ad){var _0x548206={};var _0x4a809a={};var _0x52890d;var _0xbb8121;return db[_0x734b('0x36')][_0x734b('0x7c')]({'where':{'id':_0xa9bb2a[_0x734b('0x50')]['id']}})[_0x734b('0x2b')](handleEntityNotFound(_0x4f3a90,null))[_0x734b('0x2b')](function(_0x18cb9){if(_0x18cb9){_0x52890d=_0x18cb9;_0x4a809a['model']=_[_0x734b('0x3c')](db[_0x734b('0x80')][_0x734b('0x37')]);_0x4a809a[_0x734b('0x3f')]=_['keys'](_0xa9bb2a['query']);_0x4a809a['filters']=_[_0x734b('0x3e')](_0x4a809a[_0x734b('0x3b')],_0x4a809a[_0x734b('0x3f')]);_0x548206[_0x734b('0x40')]=_[_0x734b('0x3e')](_0x4a809a[_0x734b('0x3b')],qs[_0x734b('0x4d')](_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x4d')]));_0x548206[_0x734b('0x40')]=_0x548206[_0x734b('0x40')][_0x734b('0x41')]?_0x548206[_0x734b('0x40')]:_0x4a809a['model'];_0x548206['order']=qs[_0x734b('0x44')](_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x44')]);_0x548206['where']=qs[_0x734b('0x3d')](_[_0x734b('0x46')](_0xa9bb2a[_0x734b('0x3f')],_0x4a809a[_0x734b('0x3d')]));if(_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x47')]){_0x548206[_0x734b('0x45')]=_[_0x734b('0x48')](_0x548206[_0x734b('0x45')],{'$or':_[_0x734b('0x35')](_0x548206[_0x734b('0x40')],function(_0x30dff6){var _0x5ac65f={};_0x5ac65f[_0x30dff6]={'$like':'%'+_0xa9bb2a[_0x734b('0x3f')]['filter']+'%'};return _0x5ac65f;})});}_0x548206=_[_0x734b('0x48')]({},_0x548206,_0xa9bb2a[_0x734b('0x49')]);return _0x52890d[_0x734b('0x7f')](_0x548206);}})[_0x734b('0x2b')](function(_0x1bedc4){if(_0x1bedc4){_0xbb8121=_0x1bedc4['length'];if(!_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x42')]('nolimit')){_0x548206[_0x734b('0x23')]=qs[_0x734b('0x23')](_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x23')]);_0x548206['offset']=qs['offset'](_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x25')]);}return _0x52890d['getTeams'](_0x548206);}})[_0x734b('0x2b')](function(_0x19a54a){if(_0x19a54a){return _0x19a54a?{'count':_0xbb8121,'rows':_0x19a54a}:null;}})[_0x734b('0x2b')](respondWithResult(_0x4f3a90,null))[_0x734b('0x4c')](handleError(_0x4f3a90,null));};exports[_0x734b('0x81')]=function(_0x4e46a2,_0x5d0a69,_0x303257){var _0x1bac04=_0x4e46a2[_0x734b('0x55')]['ids'];var _0x200182;return db[_0x734b('0x80')][_0x734b('0x82')]({'where':{'id':_0x1bac04},'attributes':['id'],'include':[{'model':db[_0x734b('0x7d')],'as':_0x734b('0x83'),'attributes':['id',_0x734b('0x32'),_0x734b('0x84'),_0x734b('0x85'),_0x734b('0x86')],'raw':!![]}]})[_0x734b('0x2b')](function(_0x48fbb3){if(_0x48fbb3){_0x200182=_0x48fbb3;var _0x564dda=_[_0x734b('0x87')](_0x48fbb3,function(_0x26af1f){var _0x1ba633=_0x26af1f[_0x734b('0x2c')]({'plain':!![]});return _0x1ba633[_0x734b('0x83')];});return db[_0x734b('0x36')][_0x734b('0x4f')]({'where':{'id':_0x4e46a2[_0x734b('0x50')]['id']}})[_0x734b('0x2b')](function(_0xc74aeb){return db[_0x734b('0x53')]['transaction'](function(_0x288109){return _0xc74aeb[_0x734b('0x81')](_0x1bac04,{'transaction':_0x288109})['then'](function(){return BPromise['each'](_0x200182,function(_0x255fca){return db[_0x734b('0x88')][_0x734b('0x89')]({'TeamId':_0x255fca['id'],'VoicePrefixId':_0x4e46a2[_0x734b('0x50')]['id']},{'transaction':_0x288109});});})['then'](function(){return BPromise[_0x734b('0x8a')](_0x564dda,function(_0x1c9a1e){return db['UserVoicePrefix'][_0x734b('0x8b')]({'where':{'UserId':_0x1c9a1e['id'],'VoicePrefixId':_0x4e46a2[_0x734b('0x50')]['id']},'transaction':_0x288109});});})[_0x734b('0x2b')](function(){_0x564dda[_0x734b('0x8c')](function(_0x189e6d){socket[_0x734b('0x79')](_0x734b('0x76'),{'UserId':_0x189e6d['id'],'VoicePrefixId':_0xc74aeb['id']});});});});});}})[_0x734b('0x2b')](respondWithStatusCode(_0x5d0a69,null))['catch'](handleError(_0x5d0a69,null));};exports[_0x734b('0x8d')]=function(_0x31468d,_0x45a160,_0x16451a){return db[_0x734b('0x80')]['findAll']({'where':{'id':_0x31468d['query'][_0x734b('0x74')]},'attributes':['id'],'include':[{'model':db[_0x734b('0x7d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x734b('0x2b')](handleEntityNotFound(_0x45a160,null))['then'](function(_0x19cf27){var _0x1237cf=_[_0x734b('0x35')](_0x19cf27,'id');var _0x42038a=[];var _0x3e61f1=[];var _0x22e919=squel[_0x734b('0x8e')]();_0x22e919['field']('tq.TeamId')[_0x734b('0x8f')](_0x734b('0x90'),'tq')[_0x734b('0x91')]('user_has_teams','ut',_0x734b('0x92'))[_0x734b('0x45')](_0x734b('0x93'),_0x31468d['params']['id']);for(var _0x1fcc17=0x0;_0x1fcc17<_0x19cf27[_0x734b('0x41')];_0x1fcc17+=0x1){let _0x39a46e=_0x19cf27[_0x1fcc17];for(var _0x2a8f17=0x0;_0x2a8f17<_0x39a46e['Agents']['length'];_0x2a8f17+=0x1){let _0x9cfb2f=_0x39a46e[_0x734b('0x83')][_0x2a8f17];var _0x326783=_0x22e919['clone']();_0x326783[_0x734b('0x45')]('ut.UserId\x20=\x20?',_0x9cfb2f['id']);_0x3e61f1[_0x734b('0x68')](db[_0x734b('0x53')][_0x734b('0x3f')](_0x326783[_0x734b('0x94')](),{'type':db[_0x734b('0x53')]['QueryTypes'][_0x734b('0x95')]})[_0x734b('0x2b')](function(_0x5ddf23){if(_0x5ddf23['length']===0x1){return _0x9cfb2f['id'];}else{var _0x967ccc=_[_0x734b('0x96')](_['map'](_0x5ddf23,_0x734b('0x97')),function(_0x23be49){return _['includes'](_0x1237cf,_0x23be49);});if(_0x967ccc){return _0x9cfb2f['id'];}}}));}}return BPromise[_0x734b('0x98')](_0x3e61f1)['then'](function(_0x4d75bc){_0x42038a=_(_0x42038a)['union'](_0x4d75bc)[_0x734b('0x99')]()['value']();return db[_0x734b('0x36')]['find']({'where':{'id':_0x31468d[_0x734b('0x50')]['id']}})['then'](function(_0xf43253){return db[_0x734b('0x53')][_0x734b('0x54')](function(_0x483d0a){return _0xf43253[_0x734b('0x8d')](_0x31468d[_0x734b('0x3f')]['ids'],{'transaction':_0x483d0a})[_0x734b('0x2b')](function(){if(!_['isEmpty'](_0x42038a)){return _0xf43253[_0x734b('0x77')](_0x42038a,{'transaction':_0x483d0a});}})[_0x734b('0x2b')](function(){_0x42038a['forEach'](function(_0x1f00b3){socket[_0x734b('0x79')](_0x734b('0x7a'),{'UserId':_0x1f00b3,'VoicePrefixId':_0xf43253['id']});});});});});});})[_0x734b('0x2b')](respondWithStatusCode(_0x45a160,null))['catch'](handleError(_0x45a160,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 4563da5..2db989f 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 _0xd587=['save','update','remove','emit','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x444e8b,_0x3524cc){var _0x35eb37=function(_0x17e1a3){while(--_0x17e1a3){_0x444e8b['push'](_0x444e8b['shift']());}};_0x35eb37(++_0x3524cc);}(_0xd587,0x74));var _0x7d58=function(_0x567236,_0x5d46f1){_0x567236=_0x567236-0x0;var _0x353de4=_0xd587[_0x567236];return _0x353de4;};'use strict';var EventEmitter=require(_0x7d58('0x0'));var VoicePrefix=require(_0x7d58('0x1'))['db'][_0x7d58('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7d58('0x3')](0x0);var events={'afterCreate':_0x7d58('0x4'),'afterUpdate':_0x7d58('0x5'),'afterDestroy':_0x7d58('0x6')};function emitEvent(_0x1aefff){return function(_0x5d5c9b,_0x55cb1b,_0x303df5){VoicePrefixEvents[_0x7d58('0x7')](_0x1aefff+':'+_0x5d5c9b['id'],_0x5d5c9b);VoicePrefixEvents[_0x7d58('0x7')](_0x1aefff,_0x5d5c9b);_0x303df5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x7d58('0x8')](e,emitEvent(event));}}module[_0x7d58('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x9a42=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','emit','hasOwnProperty','exports','events'];(function(_0x391fc7,_0x1e2b2c){var _0x4d2630=function(_0x23feef){while(--_0x23feef){_0x391fc7['push'](_0x391fc7['shift']());}};_0x4d2630(++_0x1e2b2c);}(_0x9a42,0x18b));var _0x29a4=function(_0x1f0e84,_0x49cdf2){_0x1f0e84=_0x1f0e84-0x0;var _0x1341e0=_0x9a42[_0x1f0e84];return _0x1341e0;};'use strict';var EventEmitter=require(_0x29a4('0x0'));var VoicePrefix=require(_0x29a4('0x1'))['db'][_0x29a4('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x29a4('0x3')](0x0);var events={'afterCreate':_0x29a4('0x4'),'afterUpdate':_0x29a4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x460efa){return function(_0x583fb9,_0x317a04,_0x3c2b2c){VoicePrefixEvents[_0x29a4('0x6')](_0x460efa+':'+_0x583fb9['id'],_0x583fb9);VoicePrefixEvents['emit'](_0x460efa,_0x583fb9);_0x3c2b2c(null);};}for(var e in events){if(events[_0x29a4('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x29a4('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 1201081..eab6bc6 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 _0x7c65=['lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./voicePrefix.attributes','exports','define'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7c65,0xfa));var _0x57c6=function(_0xb521cf,_0x1adfcc){_0xb521cf=_0xb521cf-0x0;var _0x9bed9=_0x7c65[_0xb521cf];return _0x9bed9;};'use strict';var _=require(_0x57c6('0x0'));var util=require(_0x57c6('0x1'));var logger=require(_0x57c6('0x2'))('api');var moment=require(_0x57c6('0x3'));var BPromise=require(_0x57c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x57c6('0x5'));var config=require(_0x57c6('0x6'));var attributes=require(_0x57c6('0x7'));module[_0x57c6('0x8')]=function(_0x30be45,_0xd9c736){return _0x30be45[_0x57c6('0x9')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fbc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','lodash','util','../../config/logger','api'];(function(_0x2d4d68,_0x587132){var _0x887f0d=function(_0x202226){while(--_0x202226){_0x2d4d68['push'](_0x2d4d68['shift']());}};_0x887f0d(++_0x587132);}(_0x3fbc,0xb2));var _0xc3fb=function(_0x3f6b03,_0x92ad6e){_0x3f6b03=_0x3f6b03-0x0;var _0x2e9ad7=_0x3fbc[_0x3f6b03];return _0x2e9ad7;};'use strict';var _=require(_0xc3fb('0x0'));var util=require(_0xc3fb('0x1'));var logger=require(_0xc3fb('0x2'))(_0xc3fb('0x3'));var moment=require(_0xc3fb('0x4'));var BPromise=require(_0xc3fb('0x5'));var rp=require(_0xc3fb('0x6'));var fs=require('fs');var path=require(_0xc3fb('0x7'));var rimraf=require(_0xc3fb('0x8'));var config=require(_0xc3fb('0x9'));var attributes=require(_0xc3fb('0xa'));module[_0xc3fb('0xb')]=function(_0x43d604,_0x506905){return _0x43d604['define'](_0xc3fb('0xc'),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 14ba3d3..14cdb44 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 _0x1c01=['jayson/promise','client','redis','socket.io-emitter','./voicePrefix.socket','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x7ead1,_0x1652d7){var _0x4cd421=function(_0x26cbd3){while(--_0x26cbd3){_0x7ead1['push'](_0x7ead1['shift']());}};_0x4cd421(++_0x1652d7);}(_0x1c01,0x190));var _0x11c0=function(_0x114fa8,_0x648cdf){_0x114fa8=_0x114fa8-0x0;var _0x9fef6e=_0x1c01[_0x114fa8];return _0x9fef6e;};'use strict';var _=require(_0x11c0('0x0'));var util=require(_0x11c0('0x1'));var moment=require(_0x11c0('0x2'));var BPromise=require(_0x11c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x11c0('0x5'))(_0x11c0('0x6'));var config=require(_0x11c0('0x7'));var jayson=require(_0x11c0('0x8'));var client=jayson[_0x11c0('0x9')]['http']({'port':0x232a});config[_0x11c0('0xa')]=_['defaults'](config[_0x11c0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x11c0('0xb'))(new Redis(config['redis']));require(_0x11c0('0xc'))['register'](socket);function respondWithRpcPromise(_0x5de14e,_0xba38f,_0x5e8002){return new BPromise(function(_0x426122,_0x39b2ac){return client[_0x11c0('0xd')](_0x5de14e,_0x5e8002)[_0x11c0('0xe')](function(_0x3cc04b){logger['info'](_0x11c0('0xf'),_0xba38f,_0x11c0('0x10'));logger[_0x11c0('0x11')](_0x11c0('0x12'),_0xba38f,'request\x20sent',JSON['stringify'](_0x3cc04b));if(_0x3cc04b[_0x11c0('0x13')]){if(_0x3cc04b[_0x11c0('0x13')][_0x11c0('0x14')]===0x1f4){logger[_0x11c0('0x13')](_0x11c0('0xf'),_0xba38f,_0x3cc04b[_0x11c0('0x13')][_0x11c0('0x15')]);return _0x39b2ac(_0x3cc04b['error'][_0x11c0('0x15')]);}logger['error'](_0x11c0('0xf'),_0xba38f,_0x3cc04b['error'][_0x11c0('0x15')]);return _0x426122(_0x3cc04b[_0x11c0('0x13')][_0x11c0('0x15')]);}else{logger['info'](_0x11c0('0xf'),_0xba38f,_0x11c0('0x10'));_0x426122(_0x3cc04b[_0x11c0('0x16')][_0x11c0('0x15')]);}})[_0x11c0('0x17')](function(_0x3d0a2e){logger['error']('VoicePrefix,\x20%s,\x20%s',_0xba38f,_0x3d0a2e);_0x39b2ac(_0x3d0a2e);});});} \ No newline at end of file +var _0xe9ef=['http','redis','socket.io-emitter','./voicePrefix.socket','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2a0898,_0xa101ce){var _0x2ee6e9=function(_0x109070){while(--_0x109070){_0x2a0898['push'](_0x2a0898['shift']());}};_0x2ee6e9(++_0xa101ce);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x36b400,_0x277ec5){_0x36b400=_0x36b400-0x0;var _0x4d47bf=_0xe9ef[_0x36b400];return _0x4d47bf;};'use strict';var _=require(_0xfe9e('0x0'));var util=require('util');var moment=require(_0xfe9e('0x1'));var BPromise=require(_0xfe9e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe9e('0x4'));var logger=require(_0xfe9e('0x5'))(_0xfe9e('0x6'));var config=require(_0xfe9e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfe9e('0x8')][_0xfe9e('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfe9e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfe9e('0xb'))(new Redis(config[_0xfe9e('0xa')]));require(_0xfe9e('0xc'))['register'](socket);function respondWithRpcPromise(_0x165c47,_0x210da6,_0xba1c64){return new BPromise(function(_0x5ab3bd,_0x1cc515){return client['request'](_0x165c47,_0xba1c64)[_0xfe9e('0xd')](function(_0x318158){logger[_0xfe9e('0xe')](_0xfe9e('0xf'),_0x210da6,_0xfe9e('0x10'));logger[_0xfe9e('0x11')](_0xfe9e('0x12'),_0x210da6,_0xfe9e('0x10'),JSON[_0xfe9e('0x13')](_0x318158));if(_0x318158['error']){if(_0x318158[_0xfe9e('0x14')][_0xfe9e('0x15')]===0x1f4){logger['error'](_0xfe9e('0xf'),_0x210da6,_0x318158[_0xfe9e('0x14')][_0xfe9e('0x16')]);return _0x1cc515(_0x318158[_0xfe9e('0x14')]['message']);}logger['error'](_0xfe9e('0xf'),_0x210da6,_0x318158[_0xfe9e('0x14')][_0xfe9e('0x16')]);return _0x5ab3bd(_0x318158[_0xfe9e('0x14')]['message']);}else{logger[_0xfe9e('0xe')](_0xfe9e('0xf'),_0x210da6,_0xfe9e('0x10'));_0x5ab3bd(_0x318158[_0xfe9e('0x17')]['message']);}})[_0xfe9e('0x18')](function(_0x114434){logger[_0xfe9e('0x14')](_0xfe9e('0xf'),_0x210da6,_0x114434);_0x1cc515(_0x114434);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 67720f6..7af07a8 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 _0xb58b=['save','remove','update','removeListener','register','length','voicePrefix:'];(function(_0x1d04b3,_0x2dfd11){var _0x1cf900=function(_0x34a7d9){while(--_0x34a7d9){_0x1d04b3['push'](_0x1d04b3['shift']());}};_0x1cf900(++_0x2dfd11);}(_0xb58b,0x1f1));var _0xbb58=function(_0x505507,_0x43ef96){_0x505507=_0x505507-0x0;var _0x4cf336=_0xb58b[_0x505507];return _0x4cf336;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xbb58('0x0'),_0xbb58('0x1'),_0xbb58('0x2')];function createListener(_0x4f5d42,_0x340c23){return function(_0x4e6d6c){_0x340c23['emit'](_0x4f5d42,_0x4e6d6c);};}function removeListener(_0x226363,_0x546510){return function(){VoicePrefixEvents[_0xbb58('0x3')](_0x226363,_0x546510);};}exports[_0xbb58('0x4')]=function(_0x33fe85){for(var _0x5cf8b1=0x0,_0x27cbda=events[_0xbb58('0x5')];_0x5cf8b1<_0x27cbda;_0x5cf8b1++){var _0xe874f2=events[_0x5cf8b1];var _0x5d7fe8=createListener(_0xbb58('0x6')+_0xe874f2,_0x33fe85);VoicePrefixEvents['on'](_0xe874f2,_0x5d7fe8);}}; \ No newline at end of file +var _0x4876=['length','voicePrefix:','remove','emit','removeListener'];(function(_0x1c359c,_0x58f04f){var _0x15afa9=function(_0x21b63d){while(--_0x21b63d){_0x1c359c['push'](_0x1c359c['shift']());}};_0x15afa9(++_0x58f04f);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x6487('0x0'),'update'];function createListener(_0x502614,_0x236189){return function(_0x498e31){_0x236189[_0x6487('0x1')](_0x502614,_0x498e31);};}function removeListener(_0x2bace9,_0x192d3c){return function(){VoicePrefixEvents[_0x6487('0x2')](_0x2bace9,_0x192d3c);};}exports['register']=function(_0x23e50b){for(var _0x856b1c=0x0,_0x52177e=events[_0x6487('0x3')];_0x856b1c<_0x52177e;_0x856b1c++){var _0x14d6d8=events[_0x856b1c];var _0x2df3c1=createListener(_0x6487('0x4')+_0x14d6d8,_0x23e50b);VoicePrefixEvents['on'](_0x14d6d8,_0x2df3c1);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 5467234..b5d66c0 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x52cc68,_0x440163){var _0x572cd4=function(_0xdd8786){while(--_0xdd8786){_0x52cc68['push'](_0x52cc68['shift']());}};_0x572cd4(++_0x440163);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x534005,_0x62e0a2){var _0x568737=function(_0x532155){while(--_0x532155){_0x534005['push'](_0x534005['shift']());}};_0x568737(++_0x62e0a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 648106b..bb2e7ef 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 _0xe0c5=['mandatoryDisposition','STRING','name','ENUM','inbound','outbound','default','ringall','random','rrmemory','linear','wrandom','rrordered','strategy','type','dialMethod','getDataValue','preview','booked','roundrobin','INTEGER','yes','all','once','TEXT','setDataValue','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','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.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x1e2283,_0x4b2249){var _0x51c6e0=function(_0x425fe4){while(--_0x425fe4){_0x1e2283['push'](_0x1e2283['shift']());}};_0x51c6e0(++_0x4b2249);}(_0xe0c5,0x19b));var _0x5e0c=function(_0x3410f2,_0x251306){_0x3410f2=_0x3410f2-0x0;var _0x2da4cc=_0xe0c5[_0x3410f2];return _0x2da4cc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5e0c('0x0')],'allowNull':![],'unique':_0x5e0c('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x3'),_0x5e0c('0x4')),'allowNull':![],'defaultValue':_0x5e0c('0x3')},'musiconhold':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':_0x5e0c('0x5')},'announce':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0x5e0c('0x2')]('rr',_0x5e0c('0x6'),'leastrecent','fewestcalls',_0x5e0c('0x7'),_0x5e0c('0x8'),_0x5e0c('0x9'),_0x5e0c('0xa'),_0x5e0c('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0x527bcd){this['setDataValue'](_0x5e0c('0xc'),_0x527bcd?_0x527bcd:_0x5e0c('0x8'));},'get':function(){var _0x20a987=this['getDataValue'](_0x5e0c('0xd'));var _0x5bc21c=this['getDataValue'](_0x5e0c('0xe'));var _0x32be8a=this[_0x5e0c('0xf')](_0x5e0c('0xc'));if(_0x20a987===_0x5e0c('0x4')){if(_0x5bc21c===_0x5e0c('0x10')){return null;}if(_0x5bc21c===_0x5e0c('0x11')&&![_0x5e0c('0x8'),_0x5e0c('0x12')]['includes'](_0x32be8a)){this['setDataValue']('strategy','rrmemory');}}return _0x32be8a;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x5e0c('0x13')](0xb)},'timeout':{'type':Sequelize[_0x5e0c('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x5e0c('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x5e0c('0x0')]},'weight':{'type':Sequelize[_0x5e0c('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x5e0c('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x5e0c('0x14'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x5e0c('0x2')]('yes','no',_0x5e0c('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5e0c('0x13')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x5e0c('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x5e0c('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x5e0c('0x2')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x5e0c('0x2')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x5e0c('0x2')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x5e0c('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x5e0c('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5e0c('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x5e0c('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x5e0c('0x14')},'announce_holdtime':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x14'),'no',_0x5e0c('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0x5e0c('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x5e0c('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x5e0c('0x0')]},'queue_youarenext':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x5e0c('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x5e0c('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0x5e0c('0x0')]},'queue_less_than':{'type':Sequelize[_0x5e0c('0x0')]},'periodic_announce':{'type':Sequelize[_0x5e0c('0x17')],'set':function(_0x52251f){this[_0x5e0c('0x18')](_0x5e0c('0x19'),_0x52251f?_0x52251f[_0x5e0c('0x1a')](','):[]);},'get':function(){return this[_0x5e0c('0xf')](_0x5e0c('0x19'))?this[_0x5e0c('0xf')](_0x5e0c('0x19'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x5e0c('0x14'),'set':function(_0x1140ef){this['setDataValue'](_0x5e0c('0x1b'),_0x1140ef?_0x1140ef[_0x5e0c('0x1a')](','):undefined);},'get':function(){return this[_0x5e0c('0xf')](_0x5e0c('0x1b'))?this[_0x5e0c('0xf')](_0x5e0c('0x1b'))[_0x5e0c('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':'no','set':function(_0xf29bb6){this[_0x5e0c('0x18')]('leavewhenempty',_0xf29bb6?_0xf29bb6['join'](','):undefined);},'get':function(){return this[_0x5e0c('0xf')](_0x5e0c('0x1d'))?this[_0x5e0c('0xf')](_0x5e0c('0x1d'))[_0x5e0c('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x5e0c('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x5e0c('0x0')]},'description':{'type':Sequelize[_0x5e0c('0x0')]},'acw':{'type':Sequelize[_0x5e0c('0x1e')],'defaultValue':0x0,'set':function(_0x2cea3e){this[_0x5e0c('0x18')](_0x5e0c('0x1f'),_0x2cea3e);if(_0x2cea3e){if(this[_0x5e0c('0xf')](_0x5e0c('0x20'))<0x2){this[_0x5e0c('0x18')](_0x5e0c('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5e0c('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5e0c('0x21')},'dialMethod':{'type':Sequelize['ENUM'](_0x5e0c('0x10'),'progressive','power',_0x5e0c('0x22'),'booked'),'defaultValue':_0x5e0c('0x23'),'comment':_0x5e0c('0x24')},'dialLimitChannel':{'type':Sequelize[_0x5e0c('0x13')](0x4)[_0x5e0c('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5e0c('0x26')},'dialLimitQueue':{'type':Sequelize[_0x5e0c('0x13')](0x4)[_0x5e0c('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5e0c('0x27')},'dialPowerLevel':{'type':Sequelize[_0x5e0c('0x28')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x5e0c('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x2a'),'dropRate'),'defaultValue':_0x5e0c('0x2b'),'comment':_0x5e0c('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x5e0c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x5e0c('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5e0c('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5e0c('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e0c('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':_0x5e0c('0x2f'),'comment':_0x5e0c('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e0c('0x31')},'dialQueueProject':{'type':Sequelize[_0x5e0c('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5e0c('0x13')](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e0c('0x32')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e0c('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x3,'comment':_0x5e0c('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e0c('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5e0c('0x36')},'dialTimezone':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x5e0c('0x37')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x5e0c('0x2')]('always','never',_0x5e0c('0x38')),'defaultValue':_0x5e0c('0x39')},'dialAMDActive':{'type':Sequelize[_0x5e0c('0x1e')],'defaultValue':0x0,'comment':_0x5e0c('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x5e0c('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5e0c('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x5e0c('0x13')](0x9)[_0x5e0c('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5e0c('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5e0c('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5e0c('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5e0c('0x13')](0x9)[_0x5e0c('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5e0c('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x5e0c('0x13')](0x9)[_0x5e0c('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5e0c('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5e0c('0x13')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5e0c('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5e0c('0x13')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x5e0c('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5e0c('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5e0c('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5e0c('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x5e0c('0x13')](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x5e0c('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x5e0c('0x1e')],'defaultValue':0x0,'comment':_0x5e0c('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x45'),'ASC'),'defaultValue':_0x5e0c('0x45')},'dialQueueProject2':{'type':Sequelize[_0x5e0c('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x5e0c('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x5e0c('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5e0c('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e0c('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5e0c('0x13')](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e0c('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x5e0c('0x13')](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e0c('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e0c('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5e0c('0x13')](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e0c('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e0c('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e0c('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5e0c('0x13')](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5e0c('0x13')],'allowNull':!![],'comment':_0x5e0c('0x4e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5e0c('0x4f'),'set':function(_0x3d877e){if(!_0x3d877e)this[_0x5e0c('0x18')](_0x5e0c('0x50'),null);this[_0x5e0c('0x18')](_0x5e0c('0x51'),_0x3d877e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x5e0c('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x5e0c('0x1e')],'defaultValue':![]}}; \ No newline at end of file +var _0xa971=['ENUM','ringall','fewestcalls','random','rrmemory','linear','wrandom','rrordered','strategy','getDataValue','dialMethod','preview','booked','INTEGER','yes','all','once','setDataValue','periodic_announce','join','joinempty','leavewhenempty','split','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#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)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','inbound','outbound','default'];(function(_0x42bf11,_0x117f15){var _0x3510aa=function(_0x3967d9){while(--_0x3967d9){_0x42bf11['push'](_0x42bf11['shift']());}};_0x3510aa(++_0x117f15);}(_0xa971,0xed));var _0x1a97=function(_0x33e07b,_0x2ff14c){_0x33e07b=_0x33e07b-0x0;var _0x2a5ea0=_0xa971[_0x33e07b];return _0x2a5ea0;};'use strict';var Sequelize=require(_0x1a97('0x0'));module['exports']={'name':{'type':Sequelize[_0x1a97('0x1')],'allowNull':![],'unique':_0x1a97('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x1a97('0x3'),_0x1a97('0x4')),'allowNull':![],'defaultValue':_0x1a97('0x3')},'musiconhold':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':_0x1a97('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x1a97('0x6')]('rr',_0x1a97('0x7'),'leastrecent',_0x1a97('0x8'),_0x1a97('0x9'),_0x1a97('0xa'),_0x1a97('0xb'),_0x1a97('0xc'),_0x1a97('0xd')),'allowNull':![],'defaultValue':'ringall','set':function(_0x5d46b7){this['setDataValue'](_0x1a97('0xe'),_0x5d46b7?_0x5d46b7:_0x1a97('0xa'));},'get':function(){var _0x4a0fc9=this[_0x1a97('0xf')]('type');var _0x550408=this['getDataValue'](_0x1a97('0x10'));var _0xdb26df=this[_0x1a97('0xf')](_0x1a97('0xe'));if(_0x4a0fc9===_0x1a97('0x4')){if(_0x550408===_0x1a97('0x11')){return null;}if(_0x550408===_0x1a97('0x12')&&!['rrmemory','roundrobin']['includes'](_0xdb26df)){this['setDataValue'](_0x1a97('0xe'),_0x1a97('0xa'));}}return _0xdb26df;}},'servicelevel':{'type':Sequelize[_0x1a97('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1a97('0x13')](0xb)},'timeout':{'type':Sequelize[_0x1a97('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1a97('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1a97('0x1')]},'weight':{'type':Sequelize[_0x1a97('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1a97('0x6')]('yes','no'),'defaultValue':_0x1a97('0x14')},'autopause':{'type':Sequelize[_0x1a97('0x6')](_0x1a97('0x14'),'no',_0x1a97('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x1a97('0x6')](_0x1a97('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x1a97('0x6')](_0x1a97('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x1a97('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1a97('0x6')](_0x1a97('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x1a97('0x6')](_0x1a97('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x1a97('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1a97('0x6')](_0x1a97('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x1a97('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x1a97('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x1a97('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x1a97('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x1a97('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x1a97('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1a97('0x6')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x1a97('0x6')](_0x1a97('0x14'),'no',_0x1a97('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1a97('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x1a97('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x1a97('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x1a97('0x1')]},'queue_less_than':{'type':Sequelize[_0x1a97('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x4e3ad1){this[_0x1a97('0x17')](_0x1a97('0x18'),_0x4e3ad1?_0x4e3ad1[_0x1a97('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0x1a97('0x18'))?this[_0x1a97('0xf')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':'yes','set':function(_0x447c52){this[_0x1a97('0x17')](_0x1a97('0x1a'),_0x447c52?_0x447c52['join'](','):undefined);},'get':function(){return this[_0x1a97('0xf')]('joinempty')?this[_0x1a97('0xf')](_0x1a97('0x1a'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0xe3b5c1){this[_0x1a97('0x17')](_0x1a97('0x1b'),_0xe3b5c1?_0xe3b5c1[_0x1a97('0x19')](','):undefined);},'get':function(){return this[_0x1a97('0xf')](_0x1a97('0x1b'))?this[_0x1a97('0xf')](_0x1a97('0x1b'))[_0x1a97('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x1a97('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x1a97('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x1a97('0x6')](_0x1a97('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1a97('0x1')]},'acw':{'type':Sequelize[_0x1a97('0x1d')],'defaultValue':0x0,'set':function(_0x24b483){this['setDataValue'](_0x1a97('0x1e'),_0x24b483);if(_0x24b483){if(this[_0x1a97('0xf')](_0x1a97('0x1f'))<0x2){this[_0x1a97('0x17')](_0x1a97('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x1a97('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1a97('0x1d')],'defaultValue':0x0,'comment':_0x1a97('0x20')},'dialMethod':{'type':Sequelize['ENUM'](_0x1a97('0x11'),_0x1a97('0x21'),_0x1a97('0x22'),_0x1a97('0x23'),_0x1a97('0x12')),'defaultValue':'progressive','comment':_0x1a97('0x24')},'dialLimitChannel':{'type':Sequelize[_0x1a97('0x13')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x1a97('0x13')](0x4)[_0x1a97('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1a97('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x1a97('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x1a97('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x1a97('0x6')](_0x1a97('0x28'),_0x1a97('0x29')),'defaultValue':_0x1a97('0x29'),'comment':_0x1a97('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x1a97('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x1a97('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x1a97('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x1a97('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1a97('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1a97('0x13')](0x3)[_0x1a97('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a97('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':'tTxX','comment':_0x1a97('0x2e')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1a97('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a97('0x2f')},'dialQueueProject':{'type':Sequelize[_0x1a97('0x1')],'comment':_0x1a97('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1a97('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a97('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x1a97('0x13')](0x3)[_0x1a97('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a97('0x32')},'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[_0x1a97('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1a97('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1a97('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a97('0x34')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1a97('0x35')},'dialTimezone':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':_0x1a97('0x36')},'dialPrefix':{'type':Sequelize[_0x1a97('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x1a97('0x6')]('always',_0x1a97('0x37'),_0x1a97('0x38')),'defaultValue':_0x1a97('0x39')},'dialAMDActive':{'type':Sequelize[_0x1a97('0x1d')],'defaultValue':0x0,'comment':_0x1a97('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x1a97('0x13')](0x9)[_0x1a97('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1a97('0x3b')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1a97('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1a97('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1a97('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1a97('0x13')](0x9)[_0x1a97('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1a97('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1a97('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x1a97('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1a97('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1a97('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1a97('0x13')](0x9)[_0x1a97('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1a97('0x3f')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x1a97('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x1a97('0x1d')],'defaultValue':0x0,'comment':_0x1a97('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1a97('0x6')]('DESC',_0x1a97('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x1a97('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1a97('0x13')](0x3)[_0x1a97('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1a97('0x43')},'dialCutDigit':{'type':Sequelize[_0x1a97('0x13')](0x3)[_0x1a97('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1a97('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1a97('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1a97('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1a97('0x13')](0x3)[_0x1a97('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a97('0x45')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a97('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1a97('0x13')](0x3)[_0x1a97('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a97('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1a97('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a97('0x48')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1a97('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a97('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1a97('0x13')](0x5)[_0x1a97('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a97('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1a97('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a97('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1a97('0x13')](0x5)[_0x1a97('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a97('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1a97('0x13')],'allowNull':!![],'comment':_0x1a97('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x1a97('0x1d')],'defaultValue':![],'comment':_0x1a97('0x4e'),'set':function(_0x5d9873){if(!_0x5d9873)this[_0x1a97('0x17')](_0x1a97('0x4f'),null);this[_0x1a97('0x17')](_0x1a97('0x50'),_0x5d9873);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x1a97('0x13')](0x3)[_0x1a97('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x1a97('0x13')](0x3)[_0x1a97('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x1a97('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x1a97('0x13')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x1a97('0x1d')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 58286bf..288f039 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 _0x7fbe=['send','VoiceQueue','rawAttributes','fieldName','key','where','include','query','findAll','rows','catch','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','inbound','outbound','update','getHoppers','findOne','hasOwnProperty','nolimit','order','sort','VoiceQueueId','CmHopper','CmHopperHistory','pick','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','interface','format','SIP/%s','voicePause','userVoiceQueue:save','removeTeams','ids','User','select','field','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','emit','online','isNil','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','cm_contacts','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','VoiceQueues','QueueCampaigns','filter','map','value','type','name','sendStatus','error'];(function(_0x4f66c2,_0x47d4ed){var _0x447633=function(_0x3205d4){while(--_0x3205d4){_0x4f66c2['push'](_0x4f66c2['shift']());}};_0x447633(++_0x47d4ed);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2d604d,_0x51a1f5){_0x2d604d=_0x2d604d-0x0;var _0x159761=_0x7fbe[_0x2d604d];return _0x159761;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xe7fb('0x0'));var _=require(_0xe7fb('0x1'));var squel=require(_0xe7fb('0x2'));var Redis=require(_0xe7fb('0x3'));var qs=require(_0xe7fb('0x4'));var logger=require(_0xe7fb('0x5'))(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var db=require(_0xe7fb('0x8'))['db'];config[_0xe7fb('0x9')]=_[_0xe7fb('0xa')](config[_0xe7fb('0x9')],{'host':_0xe7fb('0xb'),'port':0x18eb});var socket=require(_0xe7fb('0xc'))(new Redis(config['redis']));require(_0xe7fb('0xd'))[_0xe7fb('0xe')](socket);function respondWithStatusCode(_0x1d0741,_0x190a7a){_0x190a7a=_0x190a7a||0xcc;return function(_0x4ba197){if(_0x4ba197){return _0x1d0741['sendStatus'](_0x190a7a);}return _0x1d0741[_0xe7fb('0xf')](_0x190a7a)[_0xe7fb('0x10')]();};}function respondWithResult(_0x41a514,_0x348a73){_0x348a73=_0x348a73||0xc8;return function(_0x2a2223){if(_0x2a2223){return _0x41a514[_0xe7fb('0xf')](_0x348a73)[_0xe7fb('0x11')](_0x2a2223);}};}function respondWithFilteredResult(_0x3c07f3,_0x325035){return function(_0x2fe8ab){if(_0x2fe8ab){var _0x2437d4=typeof _0x325035[_0xe7fb('0x12')]===_0xe7fb('0x13')&&typeof _0x325035[_0xe7fb('0x14')]===_0xe7fb('0x13');var _0x598729=_0x2fe8ab[_0xe7fb('0x15')];var _0x2225e5=_0x2437d4?0x0:_0x325035['offset'];var _0x30015a=_0x2437d4?_0x2fe8ab[_0xe7fb('0x15')]:_0x325035['offset']+_0x325035[_0xe7fb('0x14')];var _0x559129;if(_0x30015a>=_0x598729){_0x30015a=_0x598729;_0x559129=0xc8;}else{_0x559129=0xce;}_0x3c07f3[_0xe7fb('0xf')](_0x559129);return _0x3c07f3[_0xe7fb('0x16')](_0xe7fb('0x17'),_0x2225e5+'-'+_0x30015a+'/'+_0x598729)[_0xe7fb('0x11')](_0x2fe8ab);}return null;};}function saveUpdates(_0x562262){return function(_0x892b0f){if(_0x892b0f){return _0x892b0f['update'](_0x562262)[_0xe7fb('0x18')](function(_0x546463){return _0x546463;});}return null;};}function removeEntity(_0x1e77fd){return function(_0x4708f7){if(_0x4708f7){return _0x4708f7[_0xe7fb('0x19')]()[_0xe7fb('0x18')](function(){var _0x5df1a1=_0x4708f7[_0xe7fb('0x1a')]({'plain':!![]});var _0x5d1c87=[{'name':_0xe7fb('0x1b'),'value':'inbound','ignore':![]},{'name':_0xe7fb('0x1c'),'value':'outbound','ignore':![]}];var _0xa5af01=_(_0x5d1c87)[_0xe7fb('0x1d')]('ignore')[_0xe7fb('0x1e')](_0xe7fb('0x1f'))[_0xe7fb('0x1f')]();if(_['includes'](_0xa5af01,_0x5df1a1[_0xe7fb('0x20')])){return;}var _0x469ead=_['find'](_0x5d1c87,['value',_0x5df1a1['type']])[_0xe7fb('0x21')];return db['UserProfileResource']['destroy']({'where':{'type':_0x469ead,'resourceId':_0x5df1a1['id']}})[_0xe7fb('0x18')](function(){return _0x4708f7;});})[_0xe7fb('0x18')](function(){_0x1e77fd[_0xe7fb('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6c930){return function(_0x2b69c4){if(!_0x2b69c4){_0x6c930[_0xe7fb('0x22')](0x194);}return _0x2b69c4;};}function handleError(_0x1ceed8,_0x392d75){_0x392d75=_0x392d75||0x1f4;return function(_0x16237a){logger[_0xe7fb('0x23')](_0x16237a['stack']);if(_0x16237a['name']){delete _0x16237a[_0xe7fb('0x21')];}_0x1ceed8[_0xe7fb('0xf')](_0x392d75)[_0xe7fb('0x24')](_0x16237a);};}exports['index']=function(_0xb1f2f4,_0x251807){var _0xd3fffe={};var _0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x1e')](db[_0xe7fb('0x25')][_0xe7fb('0x26')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x27')],'type':_0x4ce993[_0xe7fb('0x20')][_0xe7fb('0x28')]};});_0xd3fffe=qs['getOptions'](_0x219554,_0xb1f2f4);var _0x517d70={'where':_0xd3fffe[_0xe7fb('0x29')]};return db['VoiceQueue'][_0xe7fb('0x15')](_0x517d70)[_0xe7fb('0x18')](function(_0xe49053){_0x5f265f[_0xe7fb('0x15')]=_0xe49053;_0xd3fffe['include']=qs[_0xe7fb('0x2a')](_0xb1f2f4[_0xe7fb('0x2b')]);return db[_0xe7fb('0x25')][_0xe7fb('0x2c')](_0xd3fffe);})[_0xe7fb('0x18')](function(_0x480819){_0x5f265f[_0xe7fb('0x2d')]=_0x480819;return _0x5f265f;})[_0xe7fb('0x18')](respondWithFilteredResult(_0x251807,_0xd3fffe))[_0xe7fb('0x2e')](handleError(_0x251807,null));};exports[_0xe7fb('0x2f')]=function(_0x46f430,_0x25e925){var _0x1bc72d={'raw':![],'where':{'id':_0x46f430[_0xe7fb('0x30')]['id']}},_0x147eb1={};_0x147eb1['model']=_[_0xe7fb('0x31')](db[_0xe7fb('0x25')][_0xe7fb('0x26')]);_0x147eb1['query']=_[_0xe7fb('0x31')](_0x46f430[_0xe7fb('0x2b')]);_0x147eb1[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x147eb1[_0xe7fb('0x34')],_0x147eb1[_0xe7fb('0x2b')]);_0x1bc72d[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x147eb1[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x46f430[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x1bc72d[_0xe7fb('0x35')]=_0x1bc72d[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x1bc72d[_0xe7fb('0x35')]:_0x147eb1[_0xe7fb('0x34')];if(_0x46f430[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x1bc72d['include']=[{'all':!![]}];}_0x1bc72d=_[_0xe7fb('0x39')]({},_0x1bc72d,_0x46f430[_0xe7fb('0x3a')]);return db[_0xe7fb('0x25')][_0xe7fb('0x3b')](_0x1bc72d)['then'](handleEntityNotFound(_0x25e925,null))[_0xe7fb('0x18')](respondWithResult(_0x25e925,null))[_0xe7fb('0x2e')](handleError(_0x25e925,null));};exports[_0xe7fb('0x3c')]=function(_0x413a13,_0x49fe9d){return db[_0xe7fb('0x25')][_0xe7fb('0x3c')](_0x413a13[_0xe7fb('0x3d')],{})[_0xe7fb('0x18')](function(_0x468d16){var _0xb729fc=_0x413a13['user'][_0xe7fb('0x1a')]({'plain':!![]});if(!_0xb729fc)throw new Error(_0xe7fb('0x3e'));if(_0xb729fc[_0xe7fb('0x3f')]==='user'){var _0x36a341=_0x468d16[_0xe7fb('0x1a')]({'plain':!![]});var _0x5d42ac=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x900d67=_[_0xe7fb('0x3b')](_0x5d42ac,[_0xe7fb('0x1f'),_0x36a341['type']])[_0xe7fb('0x21')];return db['UserProfileSection'][_0xe7fb('0x3b')]({'where':{'name':_0x900d67,'userProfileId':_0xb729fc[_0xe7fb('0x40')]},'raw':!![]})['then'](function(_0x108a16){if(_0x108a16&&_0x108a16[_0xe7fb('0x41')]===0x0){return db[_0xe7fb('0x42')][_0xe7fb('0x3c')]({'name':_0x36a341['name'],'resourceId':_0x36a341['id'],'type':_0x108a16[_0xe7fb('0x21')],'sectionId':_0x108a16['id']},{})[_0xe7fb('0x18')](function(){return _0x468d16;});}else{return _0x468d16;}})[_0xe7fb('0x2e')](function(_0x56a84f){logger[_0xe7fb('0x23')](_0xe7fb('0x43'),_0x56a84f);throw _0x56a84f;});}return _0x468d16;})[_0xe7fb('0x18')](respondWithResult(_0x49fe9d,0xc9))[_0xe7fb('0x2e')](handleError(_0x49fe9d,null));};exports[_0xe7fb('0x44')]=function(_0x5a1ce1,_0x2eb999){var _0x4df4aa={'where':{'id':_0x5a1ce1[_0xe7fb('0x30')]['id']}},_0x2c72dd={};_0x2c72dd[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x25')]['rawAttributes']);_0x4df4aa[_0xe7fb('0x35')]=_['intersection'](_0x2c72dd['model'],qs[_0xe7fb('0x36')](_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x4df4aa['attributes']=_0x4df4aa[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x4df4aa['attributes']:_0x2c72dd['model'];if(_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x4df4aa[_0xe7fb('0x2a')]=[{'all':!![]}];}_0x4df4aa=_[_0xe7fb('0x39')]({},_0x4df4aa,_0x5a1ce1[_0xe7fb('0x3a')]);return db[_0xe7fb('0x25')][_0xe7fb('0x3b')](_0x4df4aa)[_0xe7fb('0x18')](handleEntityNotFound(_0x2eb999,null))['then'](function(_0x925a5e){if(_0x925a5e){var _0x5cc28f=_0x925a5e[_0xe7fb('0x1a')]({'plain':!![]});_0x5cc28f=qs[_0xe7fb('0x45')](_0x5cc28f,['id','createdAt',_0xe7fb('0x46')]);_0x5a1ce1['body']=_[_0xe7fb('0x45')](_0x5a1ce1['body'],['id',_0xe7fb('0x47'),'updatedAt']);return db[_0xe7fb('0x25')]['create'](_[_0xe7fb('0x39')](_0x5cc28f,_0x5a1ce1[_0xe7fb('0x3d')]),{'include':_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x38')]?[{'all':!![]}]:undefined})[_0xe7fb('0x18')](function(_0x2f959d){var _0x2f4760=_0x5a1ce1['user']['get']({'plain':!![]});if(!_0x2f4760)throw new Error(_0xe7fb('0x3e'));if(_0x2f4760['role']==='user'){var _0x4c3eb7=_0x2f959d['get']({'plain':!![]});var _0x539252=[{'name':_0xe7fb('0x1b'),'value':_0xe7fb('0x48')},{'name':_0xe7fb('0x1c'),'value':_0xe7fb('0x49')}];var _0x59c92d=_[_0xe7fb('0x3b')](_0x539252,[_0xe7fb('0x1f'),_0x4c3eb7[_0xe7fb('0x20')]])['name'];return db['UserProfileSection'][_0xe7fb('0x3b')]({'where':{'name':_0x59c92d,'userProfileId':_0x2f4760[_0xe7fb('0x40')]},'raw':!![]})[_0xe7fb('0x18')](function(_0x4f4ba3){if(_0x4f4ba3&&_0x4f4ba3[_0xe7fb('0x41')]===0x0){return db[_0xe7fb('0x42')][_0xe7fb('0x3c')]({'name':_0x4c3eb7[_0xe7fb('0x21')],'resourceId':_0x4c3eb7['id'],'type':_0x4f4ba3['name'],'sectionId':_0x4f4ba3['id']},{})['then'](function(){return _0x2f959d;});}else{return _0x2f959d;}})[_0xe7fb('0x2e')](function(_0x3104c2){logger[_0xe7fb('0x23')](_0xe7fb('0x43'),_0x3104c2);throw _0x3104c2;});}return _0x2f959d;});}})[_0xe7fb('0x18')](respondWithResult(_0x2eb999,0xc9))['catch'](handleError(_0x2eb999,null));};exports[_0xe7fb('0x4a')]=function(_0x349a2a,_0x23755b){if(_0x349a2a['body']['id']){delete _0x349a2a['body']['id'];}return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x349a2a[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x23755b,null))[_0xe7fb('0x18')](saveUpdates(_0x349a2a[_0xe7fb('0x3d')],null))['then'](respondWithResult(_0x23755b,null))[_0xe7fb('0x2e')](handleError(_0x23755b,null));};exports[_0xe7fb('0x19')]=function(_0x2cd4e5,_0x1aef59){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x2cd4e5['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x1aef59,null))['then'](removeEntity(_0x1aef59,null))[_0xe7fb('0x2e')](handleError(_0x1aef59,null));};exports[_0xe7fb('0x4b')]=function(_0x116c7e,_0x1b24fd){var _0x5925e6={'raw':![],'where':{}};var _0x47ac92={};var _0x2789a4={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x116c7e[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x1b24fd,null))['then'](function(_0x4096d4){if(_0x4096d4){_0x47ac92['model']=_[_0xe7fb('0x31')](db['CmHopper']['rawAttributes']);_0x47ac92[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x116c7e[_0xe7fb('0x2b')]);_0x47ac92['filters']=_[_0xe7fb('0x33')](_0x47ac92[_0xe7fb('0x34')],_0x47ac92[_0xe7fb('0x2b')]);_0x5925e6[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x47ac92['model'],qs[_0xe7fb('0x36')](_0x116c7e[_0xe7fb('0x2b')]['fields']));_0x5925e6[_0xe7fb('0x35')]=_0x5925e6[_0xe7fb('0x35')]['length']?_0x5925e6[_0xe7fb('0x35')]:_0x47ac92['model'];if(!_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x5925e6['limit']=qs[_0xe7fb('0x14')](_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x5925e6[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}_0x5925e6[_0xe7fb('0x4f')]=qs['sort'](_0x116c7e['query'][_0xe7fb('0x50')]);_0x5925e6[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_['pick'](_0x116c7e['query'],_0x47ac92[_0xe7fb('0x32')]));_0x5925e6[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x4096d4['id'];if(_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x5925e6[_0xe7fb('0x29')]=_[_0xe7fb('0x39')](_0x5925e6[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x5925e6[_0xe7fb('0x35')],function(_0x1ff5e7){var _0xf423ab={};_0xf423ab[_0x1ff5e7]={'$like':'%'+_0x116c7e[_0xe7fb('0x2b')]['filter']+'%'};return _0xf423ab;})});}_0x5925e6=_['merge']({},_0x5925e6,_0x116c7e[_0xe7fb('0x3a')]);return db[_0xe7fb('0x52')][_0xe7fb('0x15')]({'where':_0x5925e6[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x562493){_0x2789a4[_0xe7fb('0x15')]=_0x562493;if(_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x5925e6[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x52')][_0xe7fb('0x2c')](_0x5925e6);})[_0xe7fb('0x18')](function(_0x1e6256){_0x2789a4[_0xe7fb('0x2d')]=_0x1e6256;return _0x2789a4;});}})['then'](respondWithFilteredResult(_0x1b24fd,_0x5925e6))[_0xe7fb('0x2e')](handleError(_0x1b24fd,null));};exports['getHopperHistories']=function(_0x279663,_0x2f13f2){var _0x2a2079={'raw':!![],'where':{}};var _0x31c159={};var _0x318d06={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x279663[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x2f13f2,null))[_0xe7fb('0x18')](function(_0x15d881){if(_0x15d881){_0x31c159[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x53')][_0xe7fb('0x26')]);_0x31c159[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x279663[_0xe7fb('0x2b')]);_0x31c159[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x31c159['model'],_0x31c159['query']);_0x2a2079['attributes']=_[_0xe7fb('0x33')](_0x31c159[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x279663[_0xe7fb('0x2b')]['fields']));_0x2a2079[_0xe7fb('0x35')]=_0x2a2079[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x2a2079[_0xe7fb('0x35')]:_0x31c159['model'];if(!_0x279663[_0xe7fb('0x2b')]['hasOwnProperty'](_0xe7fb('0x4e'))){_0x2a2079[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x2a2079['offset']=qs[_0xe7fb('0x12')](_0x279663['query'][_0xe7fb('0x12')]);}_0x2a2079['order']=qs[_0xe7fb('0x50')](_0x279663[_0xe7fb('0x2b')]['sort']);_0x2a2079[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x279663[_0xe7fb('0x2b')],_0x31c159['filters']));_0x2a2079[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x15d881['id'];if(_0x279663[_0xe7fb('0x2b')]['filter']){_0x2a2079[_0xe7fb('0x29')]=_['merge'](_0x2a2079['where'],{'$or':_['map'](_0x2a2079[_0xe7fb('0x35')],function(_0x27019a){var _0x4a8a65={};_0x4a8a65[_0x27019a]={'$like':'%'+_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x4a8a65;})});}_0x2a2079=_[_0xe7fb('0x39')]({},_0x2a2079,_0x279663[_0xe7fb('0x3a')]);return db[_0xe7fb('0x53')][_0xe7fb('0x15')]({'where':_0x2a2079[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x42190e){_0x318d06[_0xe7fb('0x15')]=_0x42190e;if(_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x2a2079[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x53')][_0xe7fb('0x2c')](_0x2a2079);})[_0xe7fb('0x18')](function(_0x3c5bd9){_0x318d06[_0xe7fb('0x2d')]=_0x3c5bd9;return _0x318d06;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x2f13f2,_0x2a2079))[_0xe7fb('0x2e')](handleError(_0x2f13f2,null));};exports['getHopperFinals']=function(_0x47568c,_0x185ac0){var _0xc3958f={'raw':!![],'where':{}};var _0x1b8fdb={};var _0x19fe06={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x47568c['params']['id']}})['then'](handleEntityNotFound(_0x185ac0,null))[_0xe7fb('0x18')](function(_0x4e1865){if(_0x4e1865){_0x1b8fdb[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db['CmHopperFinal'][_0xe7fb('0x26')]);_0x1b8fdb[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x47568c[_0xe7fb('0x2b')]);_0x1b8fdb[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x1b8fdb['model'],_0x1b8fdb[_0xe7fb('0x2b')]);_0xc3958f[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x1b8fdb[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x47568c[_0xe7fb('0x2b')]['fields']));_0xc3958f['attributes']=_0xc3958f['attributes'][_0xe7fb('0x37')]?_0xc3958f[_0xe7fb('0x35')]:_0x1b8fdb[_0xe7fb('0x34')];if(!_0x47568c['query'][_0xe7fb('0x4d')]('nolimit')){_0xc3958f[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0xc3958f['offset']=qs[_0xe7fb('0x12')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}_0xc3958f[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0xc3958f[_0xe7fb('0x29')]=qs['filters'](_['pick'](_0x47568c[_0xe7fb('0x2b')],_0x1b8fdb['filters']));_0xc3958f[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x4e1865['id'];if(_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0xc3958f['where']=_['merge'](_0xc3958f[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0xc3958f['attributes'],function(_0x21cb12){var _0x431d21={};_0x431d21[_0x21cb12]={'$like':'%'+_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x431d21;})});}_0xc3958f=_[_0xe7fb('0x39')]({},_0xc3958f,_0x47568c[_0xe7fb('0x3a')]);return db['CmHopperFinal'][_0xe7fb('0x15')]({'where':_0xc3958f[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x2607b9){_0x19fe06[_0xe7fb('0x15')]=_0x2607b9;if(_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0xc3958f[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x55')][_0xe7fb('0x2c')](_0xc3958f);})[_0xe7fb('0x18')](function(_0x3b1a90){_0x19fe06[_0xe7fb('0x2d')]=_0x3b1a90;return _0x19fe06;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x185ac0,_0xc3958f))[_0xe7fb('0x2e')](handleError(_0x185ac0,null));};exports[_0xe7fb('0x56')]=function(_0x27c100,_0x19e86f){var _0x4b4cf6={'raw':!![],'where':{}};var _0x173d85={};var _0xa1368a={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x27c100['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x19e86f,null))[_0xe7fb('0x18')](function(_0x4ca09c){if(_0x4ca09c){_0x173d85[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x57')]['rawAttributes']);_0x173d85[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x27c100['query']);_0x173d85['filters']=_[_0xe7fb('0x33')](_0x173d85[_0xe7fb('0x34')],_0x173d85[_0xe7fb('0x2b')]);_0x4b4cf6[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x173d85[_0xe7fb('0x34')],qs['fields'](_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x4b4cf6[_0xe7fb('0x35')]=_0x4b4cf6['attributes'][_0xe7fb('0x37')]?_0x4b4cf6[_0xe7fb('0x35')]:_0x173d85[_0xe7fb('0x34')];if(!_0x27c100[_0xe7fb('0x2b')]['hasOwnProperty'](_0xe7fb('0x4e'))){_0x4b4cf6[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x27c100['query'][_0xe7fb('0x14')]);_0x4b4cf6[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x27c100[_0xe7fb('0x2b')]['offset']);}_0x4b4cf6[_0xe7fb('0x4f')]=qs['sort'](_0x27c100[_0xe7fb('0x2b')]['sort']);_0x4b4cf6[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_['pick'](_0x27c100['query'],_0x173d85[_0xe7fb('0x32')]));_0x4b4cf6['where'][_0xe7fb('0x51')]=_0x4ca09c['id'];if(_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x4b4cf6[_0xe7fb('0x29')]=_['merge'](_0x4b4cf6[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x4b4cf6[_0xe7fb('0x35')],function(_0x27a822){var _0x5505e5={};_0x5505e5[_0x27a822]={'$like':'%'+_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x5505e5;})});}_0x4b4cf6=_[_0xe7fb('0x39')]({},_0x4b4cf6,_0x27c100[_0xe7fb('0x3a')]);return db[_0xe7fb('0x57')]['count']({'where':_0x4b4cf6[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x54233){_0xa1368a[_0xe7fb('0x15')]=_0x54233;if(_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x4b4cf6[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x57')][_0xe7fb('0x2c')](_0x4b4cf6);})['then'](function(_0x795e32){_0xa1368a[_0xe7fb('0x2d')]=_0x795e32;return _0xa1368a;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x19e86f,_0x4b4cf6))[_0xe7fb('0x2e')](handleError(_0x19e86f,null));};exports[_0xe7fb('0x58')]=function(_0x16f2b1,_0x3a8154){var _0x51335c={};var _0x4f4772={};var _0x4ef7b4;var _0x1bcee7;return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x16f2b1['params']['id']}})['then'](handleEntityNotFound(_0x3a8154,null))[_0xe7fb('0x18')](function(_0x5bd869){if(_0x5bd869){_0x4ef7b4=_0x5bd869;_0x4f4772[_0xe7fb('0x34')]=_['keys'](db[_0xe7fb('0x59')][_0xe7fb('0x26')]);_0x4f4772[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x16f2b1[_0xe7fb('0x2b')]);_0x4f4772[_0xe7fb('0x32')]=_['intersection'](_0x4f4772[_0xe7fb('0x34')],_0x4f4772[_0xe7fb('0x2b')]);_0x51335c[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x4f4772[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x16f2b1[_0xe7fb('0x2b')]['fields']));_0x51335c[_0xe7fb('0x35')]=_0x51335c[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x51335c[_0xe7fb('0x35')]:_0x4f4772['model'];_0x51335c[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x51335c[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x16f2b1['query'],_0x4f4772['filters']));if(_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x51335c['where']=_[_0xe7fb('0x39')](_0x51335c['where'],{'$or':_[_0xe7fb('0x1e')](_0x51335c[_0xe7fb('0x35')],function(_0x220d72){var _0x5ea91d={};_0x5ea91d[_0x220d72]={'$like':'%'+_0x16f2b1['query'][_0xe7fb('0x1d')]+'%'};return _0x5ea91d;})});}_0x51335c=_['merge']({},_0x51335c,_0x16f2b1['options']);return _0x4ef7b4[_0xe7fb('0x58')](_0x51335c);}})[_0xe7fb('0x18')](function(_0x3b073e){if(_0x3b073e){_0x1bcee7=_0x3b073e[_0xe7fb('0x37')];if(!_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x51335c[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x51335c[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x4ef7b4[_0xe7fb('0x58')](_0x51335c);}})[_0xe7fb('0x18')](function(_0x249d6f){if(_0x249d6f){return _0x249d6f?{'count':_0x1bcee7,'rows':_0x249d6f}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x3a8154,null))['catch'](handleError(_0x3a8154,null));};exports[_0xe7fb('0x5a')]=function(_0x19ebe2,_0x3406ed){var _0x1631cc=_0x19ebe2['body'][_0xe7fb('0x5b')];var _0x21ee89=_[_0xe7fb('0x1e')](_0x1631cc,'id');return db[_0xe7fb('0x59')][_0xe7fb('0x2c')]({'where':{'id':_0x21ee89},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe7fb('0x21'),'online','voicePause','interface'],'raw':!![]}]})[_0xe7fb('0x18')](function(_0x5a97c8){if(_0x5a97c8){var _0x503ae2=_['flatMap'](_0x5a97c8,function(_0x2ccf71){var _0x35be16=_0x2ccf71[_0xe7fb('0x1a')]({'plain':!![]});_0x35be16[_0xe7fb('0x5c')][_0xe7fb('0x5d')](function(_0x1db971){_0x1db971['penalty']=_['find'](_0x1631cc,{'id':_0x35be16['id']})[_0xe7fb('0x5e')];});return _0x35be16['Agents'];});return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x19ebe2[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(_0x3891ed){return db[_0xe7fb('0x5f')]['transaction'](function(_0x4aa499){return _0x3891ed[_0xe7fb('0x5a')](_0x21ee89,{'transaction':_0x4aa499})[_0xe7fb('0x18')](function(){return BPromise[_0xe7fb('0x60')](_0x1631cc,function(_0x7a7a6b){return db[_0xe7fb('0x61')][_0xe7fb('0x62')]({'TeamId':_0x7a7a6b['id'],'VoiceQueueId':_0x19ebe2['params']['id'],'penalty':_0x7a7a6b[_0xe7fb('0x5e')]},{'transaction':_0x4aa499});});})[_0xe7fb('0x18')](function(){return BPromise[_0xe7fb('0x60')](_0x503ae2,function(_0x33d638){return db[_0xe7fb('0x63')]['findOrCreate']({'where':{'UserId':_0x33d638['id'],'VoiceQueueId':_0x19ebe2[_0xe7fb('0x30')]['id']},'defaults':{'penalty':_0x33d638[_0xe7fb('0x5e')]},'transaction':_0x4aa499});});})[_0xe7fb('0x18')](function(){return BPromise['each'](_['filter'](_0x503ae2,{'online':!![]}),function(_0x5d30ef){return db[_0xe7fb('0x64')]['upsert']({'membername':_0x5d30ef['name'],'UserId':_0x5d30ef['id'],'queue_name':_0x3891ed[_0xe7fb('0x21')],'VoiceQueueId':_0x3891ed['id'],'interface':_['isNil'](_0x5d30ef[_0xe7fb('0x65')])?util[_0xe7fb('0x66')](_0xe7fb('0x67'),_0x5d30ef[_0xe7fb('0x21')]):_0x5d30ef[_0xe7fb('0x65')],'paused':_0x5d30ef[_0xe7fb('0x68')]||![],'penalty':_0x5d30ef[_0xe7fb('0x5e')]},{'transaction':_0x4aa499});});})['then'](function(){_0x503ae2[_0xe7fb('0x5d')](function(_0x16e9d4){socket['emit'](_0xe7fb('0x69'),{'UserId':_0x16e9d4['id'],'VoiceQueueId':_0x3891ed['id']});});});});});}})[_0xe7fb('0x18')](respondWithStatusCode(_0x3406ed,null))[_0xe7fb('0x2e')](handleError(_0x3406ed,null));};exports[_0xe7fb('0x6a')]=function(_0x366acb,_0x4d2c92){return db['Team'][_0xe7fb('0x2c')]({'where':{'id':_0x366acb[_0xe7fb('0x2b')][_0xe7fb('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xe7fb('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe7fb('0x18')](handleEntityNotFound(_0x4d2c92,null))[_0xe7fb('0x18')](function(_0x2e276c){var _0x4efcdc=_[_0xe7fb('0x1e')](_0x2e276c,'id');var _0x146fc9=[];var _0x470718=[];var _0x55048c=squel[_0xe7fb('0x6d')]();_0x55048c[_0xe7fb('0x6e')]('tq.TeamId')[_0xe7fb('0x6f')](_0xe7fb('0x70'),'tq')['join'](_0xe7fb('0x71'),'ut',_0xe7fb('0x72'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x366acb[_0xe7fb('0x30')]['id']);for(var _0x5d9b58=0x0;_0x5d9b58<_0x2e276c['length'];_0x5d9b58+=0x1){let _0x5986f1=_0x2e276c[_0x5d9b58];for(var _0x23ec12=0x0;_0x23ec12<_0x5986f1[_0xe7fb('0x5c')][_0xe7fb('0x37')];_0x23ec12+=0x1){let _0x36be03=_0x5986f1['Agents'][_0x23ec12];var _0x29de1e=_0x55048c[_0xe7fb('0x44')]();_0x29de1e['where']('ut.UserId\x20=\x20?',_0x36be03['id']);_0x470718[_0xe7fb('0x74')](db[_0xe7fb('0x5f')][_0xe7fb('0x2b')](_0x29de1e[_0xe7fb('0x75')](),{'type':db[_0xe7fb('0x5f')]['QueryTypes'][_0xe7fb('0x76')]})[_0xe7fb('0x18')](function(_0xe52155){if(_0xe52155['length']===0x1){return _0x36be03['id'];}else{var _0x20b1fc=_[_0xe7fb('0x77')](_['map'](_0xe52155,_0xe7fb('0x78')),function(_0x6ec6b6){return _[_0xe7fb('0x79')](_0x4efcdc,_0x6ec6b6);});if(_0x20b1fc){return _0x36be03['id'];}}}));}}return BPromise[_0xe7fb('0x7a')](_0x470718)['then'](function(_0x4ed327){_0x146fc9=_(_0x146fc9)[_0xe7fb('0x7b')](_0x4ed327)[_0xe7fb('0x7c')]()[_0xe7fb('0x1f')]();return db['VoiceQueue'][_0xe7fb('0x3b')]({'where':{'id':_0x366acb[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(_0x49fb4b){return db[_0xe7fb('0x5f')][_0xe7fb('0x7d')](function(_0x362fe1){return _0x49fb4b['removeTeams'](_0x366acb[_0xe7fb('0x2b')][_0xe7fb('0x6b')],{'transaction':_0x362fe1})[_0xe7fb('0x18')](function(){if(!_[_0xe7fb('0x7e')](_0x146fc9)){return _0x49fb4b[_0xe7fb('0x7f')](_0x146fc9,{'transaction':_0x362fe1})[_0xe7fb('0x18')](function(){return db[_0xe7fb('0x64')][_0xe7fb('0x19')]({'where':{'VoiceQueueId':_0x366acb['params']['id'],'UserId':_0x146fc9},'transaction':_0x362fe1});});}})[_0xe7fb('0x18')](function(){_0x146fc9[_0xe7fb('0x5d')](function(_0x5dadac){socket['emit'](_0xe7fb('0x80'),{'UserId':_0x5dadac,'VoiceQueueId':_0x49fb4b['id']});});});});});});})[_0xe7fb('0x18')](respondWithStatusCode(_0x4d2c92,null))[_0xe7fb('0x2e')](handleError(_0x4d2c92,null));};exports[_0xe7fb('0x81')]=function(_0x4b58de,_0x4386ea){var _0x41c771,_0x489c9d;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x4b58de[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x4386ea,null))[_0xe7fb('0x18')](function(_0x39fef6){if(_0x39fef6){_0x489c9d=_0x39fef6;return _0x39fef6[_0xe7fb('0x81')](_0x4b58de['body'][_0xe7fb('0x6b')],_['omit'](_0x4b58de[_0xe7fb('0x3d')],['ids','id'])||{})['spread'](function(_0x260067){for(var _0xed4af4=0x0;_0xed4af4<_0x4b58de[_0xe7fb('0x3d')][_0xe7fb('0x6b')][_0xe7fb('0x37')];_0xed4af4+=0x1){socket[_0xe7fb('0x82')](_0xe7fb('0x69'),{'UserId':Number(_0x4b58de['body'][_0xe7fb('0x6b')][_0xed4af4]),'VoiceQueueId':Number(_0x4b58de[_0xe7fb('0x30')]['id'])});}return _0x260067;});}})[_0xe7fb('0x18')](function(_0x19a7ec){_0x41c771=_0x19a7ec||[];if(_0x489c9d){return db[_0xe7fb('0x6c')][_0xe7fb('0x2c')]({'where':{'id':_0x4b58de[_0xe7fb('0x3d')]['ids']},'attributes':['id',_0xe7fb('0x21'),_0xe7fb('0x83'),_0xe7fb('0x68'),'interface'],'raw':!![]});}})[_0xe7fb('0x18')](function(_0x52c758){if(!_['isEmpty'](_0x52c758)){var _0x4930c6=[];for(var _0x1a3d44=0x0;_0x1a3d44<_0x52c758[_0xe7fb('0x37')];_0x1a3d44++){if(_0x52c758[_0x1a3d44]['online']){_0x4930c6[_0xe7fb('0x74')](db[_0xe7fb('0x64')]['upsert']({'membername':_0x52c758[_0x1a3d44]['name'],'UserId':_0x52c758[_0x1a3d44]['id'],'queue_name':_0x489c9d[_0xe7fb('0x21')],'VoiceQueueId':_0x489c9d['id'],'interface':_[_0xe7fb('0x84')](_0x52c758[_0x1a3d44][_0xe7fb('0x65')])?util['format'](_0xe7fb('0x67'),_0x52c758[_0x1a3d44][_0xe7fb('0x21')]):_0x52c758[_0x1a3d44]['interface'],'paused':_0x52c758[_0x1a3d44]['voicePause']||![],'penalty':_0x4b58de[_0xe7fb('0x3d')]['penalty']||0x0}));}}return BPromise['all'](_0x4930c6);}})['then'](function(){return _0x41c771;})[_0xe7fb('0x18')](respondWithResult(_0x4386ea,null))[_0xe7fb('0x2e')](handleError(_0x4386ea,null));};exports['removeAgents']=function(_0x35b5ad,_0x55c935){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x35b5ad[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x55c935,null))[_0xe7fb('0x18')](function(_0x4736bf){if(_0x4736bf){return _0x4736bf[_0xe7fb('0x7f')](_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')])[_0xe7fb('0x18')](function(){if(_[_0xe7fb('0x85')](_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')])){for(var _0x5744a8=0x0;_0x5744a8<_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')]['length'];_0x5744a8+=0x1){socket['emit'](_0xe7fb('0x80'),{'UserId':Number(_0x35b5ad['query'][_0xe7fb('0x6b')][_0x5744a8]),'VoiceQueueId':Number(_0x35b5ad[_0xe7fb('0x30')]['id'])});}}else{socket[_0xe7fb('0x82')](_0xe7fb('0x80'),{'UserId':Number(_0x35b5ad[_0xe7fb('0x2b')]['ids']),'VoiceQueueId':Number(_0x35b5ad['params']['id'])});}});}})[_0xe7fb('0x18')](function(_0x27b153){return db[_0xe7fb('0x64')][_0xe7fb('0x19')]({'where':{'VoiceQueueId':_0x35b5ad[_0xe7fb('0x30')]['id'],'UserId':_0x35b5ad['query'][_0xe7fb('0x6b')]}})['then'](function(){return _0x27b153;});})[_0xe7fb('0x18')](respondWithStatusCode(_0x55c935,null))[_0xe7fb('0x2e')](handleError(_0x55c935,null));};exports['getAgents']=function(_0x5d0f05,_0x519e35){var _0x16ae95={};var _0xb1a3fa={};var _0x59e676;var _0x577895;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x5d0f05['params']['id']}})['then'](handleEntityNotFound(_0x519e35,null))[_0xe7fb('0x18')](function(_0xe1613c){if(_0xe1613c){_0x59e676=_0xe1613c;_0xb1a3fa[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db['User'][_0xe7fb('0x26')]);_0xb1a3fa[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x5d0f05[_0xe7fb('0x2b')]);_0xb1a3fa[_0xe7fb('0x32')]=_['intersection'](_0xb1a3fa['model'],_0xb1a3fa[_0xe7fb('0x2b')]);_0x16ae95[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0xb1a3fa[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x5d0f05['query'][_0xe7fb('0x36')]));_0x16ae95['attributes']=_0x16ae95['attributes'][_0xe7fb('0x37')]?_0x16ae95[_0xe7fb('0x35')]:_0xb1a3fa[_0xe7fb('0x34')];_0x16ae95[_0xe7fb('0x4f')]=qs['sort'](_0x5d0f05[_0xe7fb('0x2b')]['sort']);_0x16ae95['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x5d0f05[_0xe7fb('0x2b')],_0xb1a3fa[_0xe7fb('0x32')]));if(_0x5d0f05[_0xe7fb('0x2b')]['filter']){_0x16ae95['where']=_[_0xe7fb('0x39')](_0x16ae95['where'],{'$or':_['map'](_0x16ae95[_0xe7fb('0x35')],function(_0x5763dd){var _0x4cab2f={};_0x4cab2f[_0x5763dd]={'$like':'%'+_0x5d0f05[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x4cab2f;})});}_0x16ae95=_[_0xe7fb('0x39')]({},_0x16ae95,_0x5d0f05[_0xe7fb('0x3a')]);return _0x59e676[_0xe7fb('0x86')](_0x16ae95);}})['then'](function(_0xcf6d2){if(_0xcf6d2){_0x577895=_0xcf6d2['length'];if(!_0x5d0f05['query'][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x16ae95[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x5d0f05[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x16ae95[_0xe7fb('0x12')]=qs['offset'](_0x5d0f05['query'][_0xe7fb('0x12')]);}return _0x59e676['getAgents'](_0x16ae95);}})[_0xe7fb('0x18')](function(_0x51ff1e){if(_0x51ff1e){return _0x51ff1e?{'count':_0x577895,'rows':_0x51ff1e}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x519e35,null))['catch'](handleError(_0x519e35,null));};exports[_0xe7fb('0x87')]=function(_0x4407ee,_0x56869b){var _0x2139e3={};var _0x2e0e13={};var _0x23e1db;var _0x2a2fa6;return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x4407ee[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x56869b,null))[_0xe7fb('0x18')](function(_0x454ef0){if(_0x454ef0){_0x23e1db=_0x454ef0;_0x2e0e13['model']=_[_0xe7fb('0x31')](db[_0xe7fb('0x64')][_0xe7fb('0x26')]);_0x2e0e13[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x4407ee[_0xe7fb('0x2b')]);_0x2e0e13[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x2e0e13[_0xe7fb('0x34')],_0x2e0e13[_0xe7fb('0x2b')]);_0x2139e3[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x2e0e13[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x4407ee[_0xe7fb('0x2b')]['fields']));_0x2139e3['attributes']=_0x2139e3[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x2139e3[_0xe7fb('0x35')]:_0x2e0e13[_0xe7fb('0x34')];_0x2139e3[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x2139e3['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x4407ee[_0xe7fb('0x2b')],_0x2e0e13[_0xe7fb('0x32')]));if(_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x2139e3['where']=_[_0xe7fb('0x39')](_0x2139e3[_0xe7fb('0x29')],{'$or':_['map'](_0x2139e3[_0xe7fb('0x35')],function(_0x5dde83){var _0x21d86e={};_0x21d86e[_0x5dde83]={'$like':'%'+_0x4407ee['query'][_0xe7fb('0x1d')]+'%'};return _0x21d86e;})});}_0x2139e3=_[_0xe7fb('0x39')]({},_0x2139e3,_0x4407ee['options']);return _0x23e1db[_0xe7fb('0x87')](_0x2139e3);}})[_0xe7fb('0x18')](function(_0x5892cd){if(_0x5892cd){_0x2a2fa6=_0x5892cd['length'];if(!_0x4407ee['query']['hasOwnProperty'](_0xe7fb('0x4e'))){_0x2139e3[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x2139e3[_0xe7fb('0x12')]=qs['offset'](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x23e1db[_0xe7fb('0x87')](_0x2139e3);}})['then'](function(_0x3c56ad){return _0x3c56ad?{'count':_0x2a2fa6,'rows':_0x3c56ad}:null;})['then'](respondWithResult(_0x56869b,null))[_0xe7fb('0x2e')](handleError(_0x56869b,null));};exports['getLists']=function(_0x4880a7,_0x27669f){var _0x3d8b9a={};var _0x3503ac={};var _0x413843;var _0x55ce0f;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x4880a7[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x27669f,null))[_0xe7fb('0x18')](function(_0x21d9b0){if(_0x21d9b0){_0x413843=_0x21d9b0;_0x3503ac[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x88')][_0xe7fb('0x26')]);_0x3503ac[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x4880a7[_0xe7fb('0x2b')]);_0x3503ac[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x3503ac[_0xe7fb('0x34')],_0x3503ac[_0xe7fb('0x2b')]);_0x3d8b9a['attributes']=_[_0xe7fb('0x33')](_0x3503ac[_0xe7fb('0x34')],qs['fields'](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x3d8b9a[_0xe7fb('0x35')]=_0x3d8b9a['attributes'][_0xe7fb('0x37')]?_0x3d8b9a[_0xe7fb('0x35')]:_0x3503ac[_0xe7fb('0x34')];_0x3d8b9a[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x4880a7[_0xe7fb('0x2b')]['sort']);_0x3d8b9a[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x4880a7['query'],_0x3503ac[_0xe7fb('0x32')]));if(_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x3d8b9a[_0xe7fb('0x29')]=_['merge'](_0x3d8b9a[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x3d8b9a[_0xe7fb('0x35')],function(_0x39ffed){var _0x47e833={};_0x47e833[_0x39ffed]={'$like':'%'+_0x4880a7['query'][_0xe7fb('0x1d')]+'%'};return _0x47e833;})});}_0x3d8b9a=_[_0xe7fb('0x39')]({},_0x3d8b9a,_0x4880a7[_0xe7fb('0x3a')]);return _0x413843[_0xe7fb('0x89')](_0x3d8b9a);}})['then'](function(_0x57750a){if(_0x57750a){_0x55ce0f=_0x57750a[_0xe7fb('0x37')];if(!_0x4880a7['query'][_0xe7fb('0x4d')]('nolimit')){_0x3d8b9a[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x3d8b9a[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x413843[_0xe7fb('0x89')](_0x3d8b9a);}})[_0xe7fb('0x18')](function(_0x14014d){if(_0x14014d){return _0x14014d?{'count':_0x55ce0f,'rows':_0x14014d}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x27669f,null))[_0xe7fb('0x2e')](handleError(_0x27669f,null));};exports[_0xe7fb('0x8a')]=function(_0x4d9a76,_0x23a49e){var _0x30651f=moment()[_0xe7fb('0x66')](_0xe7fb('0x8b'));var _0x582862,_0x5b6da5;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x4d9a76[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x23a49e,null))['then'](function(_0x4e09d8){if(_0x4e09d8){_0x5b6da5=_0x4e09d8;return _0x4e09d8[_0xe7fb('0x8a')](_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x6b')],_[_0xe7fb('0x45')](_0x4d9a76[_0xe7fb('0x3d')],[_0xe7fb('0x6b'),'id'])||{});}return null;})[_0xe7fb('0x8c')](function(_0x2e2167){var _0xd7f440;_0x582862=_0x2e2167||[];var _0xc8055f=[];if(_0x2e2167){for(var _0x45b449=0x0;_0x45b449<_0x2e2167['length'];_0x45b449+=0x1){var _0x366c06=_0x2e2167[_0x45b449][_0xe7fb('0x1a')]({'plain':!![]});_0x5b6da5[_0xe7fb('0x8d')]=_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x8d')]?_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x8d')]:_0x5b6da5[_0xe7fb('0x8d')];switch(_0x5b6da5['dialCheckDuplicateType']){case _0xe7fb('0x8e'):_0xd7f440=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0x91'))['fromQuery']([_0xe7fb('0x92'),_0xe7fb('0x93'),_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()['field'](_0xe7fb('0x92'),_0xe7fb('0x92'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))['field']('id',_0xe7fb('0x94'))[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))[_0xe7fb('0x6e')](_0x4d9a76[_0xe7fb('0x30')]['id']['toString'](),'VoiceQueueId')[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27','createdAt')['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')]('cm_contacts')[_0xe7fb('0x29')](_0xe7fb('0x97'))['where'](_0xe7fb('0x98'),_0x366c06['CmListId'][_0xe7fb('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe7fb('0x29')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xe7fb('0x6e')](_0xe7fb('0x99'))['from'](_0xe7fb('0x9a'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x4d9a76[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')]()))[_0xe7fb('0x29')](_0xe7fb('0x9b'),squel['select']()['field'](_0xe7fb('0x9c'))['from']('cm_hopper')[_0xe7fb('0x29')]('VoiceQueueId\x20=\x20?',_0x4d9a76['params']['id'][_0xe7fb('0x75')]())))['toString']();break;case _0xe7fb('0x9d'):_0xd7f440=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0x91'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),'scheduledAt',_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0x92'),_0xe7fb('0x92'))['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))[_0xe7fb('0x6e')]('id',_0xe7fb('0x94'))[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))['field'](_0x4d9a76['params']['id']['toString'](),_0xe7fb('0x51'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))['where'](_0xe7fb('0x97'))[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x366c06['CmListId']['toString']())[_0xe7fb('0x29')](_0xe7fb('0xa0'))[_0xe7fb('0x29')](_0xe7fb('0x9b'),squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0x9c'))['from'](_0xe7fb('0x91'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x4d9a76['params']['id'][_0xe7fb('0x75')]())))['toString']();break;default:_0xd7f440=squel[_0xe7fb('0x8f')]()['into'](_0xe7fb('0x91'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),_0xe7fb('0x93'),_0xe7fb('0x94'),'ListId',_0xe7fb('0x51'),'createdAt','updatedAt'],squel['select']()[_0xe7fb('0x6e')]('phone','phone')['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))[_0xe7fb('0x6e')]('id','ContactId')[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')]['toString'](),_0xe7fb('0x95'))['field'](_0x4d9a76[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')](),_0xe7fb('0x51'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))['where'](_0xe7fb('0x97'))[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x366c06[_0xe7fb('0x96')]['toString']())[_0xe7fb('0x29')](_0xe7fb('0xa0')))['toString']();}_0xc8055f['push'](db[_0xe7fb('0x5f')]['query'](_0xd7f440));}return BPromise[_0xe7fb('0x7a')](_0xc8055f);}})[_0xe7fb('0x18')](function(){var _0x20b22f=[];var _0x2e22c1=squel[_0xe7fb('0x8f')]()['into'](_0xe7fb('0xa1'))['fromQuery']([_0xe7fb('0xa2'),_0xe7fb('0x92'),_0xe7fb('0xa3'),'createdAt',_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0xa4'))[_0xe7fb('0x6e')]('ci.item')[_0xe7fb('0x6e')](_0xe7fb('0xa5'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0xa6'),'ci')[_0xe7fb('0xa7')]('cm_hopper','h',_0xe7fb('0xa8'))[_0xe7fb('0x29')]('h.scheduledat=?',_0x30651f)[_0xe7fb('0x29')]('ci.ItemClass=?',_0xe7fb('0xa9')))[_0xe7fb('0x75')]();_0x20b22f[_0xe7fb('0x74')](db[_0xe7fb('0x5f')][_0xe7fb('0x2b')](_0x2e22c1));return BPromise[_0xe7fb('0x7a')](_0x20b22f);})[_0xe7fb('0x18')](function(){return _0x582862;})['then'](respondWithResult(_0x23a49e,null))[_0xe7fb('0x2e')](handleError(_0x23a49e,null));};exports[_0xe7fb('0xaa')]=function(_0x3c04f4,_0x290cc3){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x3c04f4['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x290cc3,null))[_0xe7fb('0x18')](function(_0x3ed48f){if(_0x3ed48f){return _0x3ed48f['removeLists'](_0x3c04f4[_0xe7fb('0x2b')][_0xe7fb('0x6b')]);}})[_0xe7fb('0x18')](function(_0x2eeff4){if(_0x2eeff4){return db[_0xe7fb('0x52')]['destroy']({'where':{'ListId':_0x3c04f4[_0xe7fb('0x2b')][_0xe7fb('0x6b')],'VoiceQueueId':_0x3c04f4[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(){return _0x2eeff4;});}})[_0xe7fb('0x18')](respondWithStatusCode(_0x290cc3,null))[_0xe7fb('0x2e')](handleError(_0x290cc3,null));};exports[_0xe7fb('0xab')]=function(_0xcaad94,_0x5b88bd){var _0x143dbb={};var _0x715444={};var _0x92a316;var _0x30a834;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0xcaad94[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x5b88bd,null))[_0xe7fb('0x18')](function(_0x1b1818){if(_0x1b1818){_0x92a316=_0x1b1818;_0x715444[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x88')][_0xe7fb('0x26')]);_0x715444[_0xe7fb('0x2b')]=_['keys'](_0xcaad94[_0xe7fb('0x2b')]);_0x715444[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x715444[_0xe7fb('0x34')],_0x715444[_0xe7fb('0x2b')]);_0x143dbb['attributes']=_[_0xe7fb('0x33')](_0x715444[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0xcaad94['query']['fields']));_0x143dbb[_0xe7fb('0x35')]=_0x143dbb[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x143dbb[_0xe7fb('0x35')]:_0x715444['model'];_0x143dbb[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x143dbb['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0xcaad94['query'],_0x715444[_0xe7fb('0x32')]));if(_0xcaad94[_0xe7fb('0x2b')]['filter']){_0x143dbb['where']=_[_0xe7fb('0x39')](_0x143dbb[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x143dbb['attributes'],function(_0x3b2375){var _0x170347={};_0x170347[_0x3b2375]={'$like':'%'+_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x170347;})});}_0x143dbb=_['merge']({},_0x143dbb,_0xcaad94[_0xe7fb('0x3a')]);return _0x92a316[_0xe7fb('0xab')](_0x143dbb);}})[_0xe7fb('0x18')](function(_0x2a984e){if(_0x2a984e){_0x30a834=_0x2a984e[_0xe7fb('0x37')];if(!_0xcaad94[_0xe7fb('0x2b')]['hasOwnProperty']('nolimit')){_0x143dbb[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x143dbb[_0xe7fb('0x12')]=qs['offset'](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x92a316[_0xe7fb('0xab')](_0x143dbb);}})[_0xe7fb('0x18')](function(_0x286382){if(_0x286382){return _0x286382?{'count':_0x30a834,'rows':_0x286382}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x5b88bd,null))[_0xe7fb('0x2e')](handleError(_0x5b88bd,null));};exports[_0xe7fb('0xac')]=function(_0x325c7b,_0x38472b){var _0x1a33f8;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x325c7b[_0xe7fb('0x30')]['id']}})['then'](handleEntityNotFound(_0x38472b,null))[_0xe7fb('0x18')](function(_0x291a8d){if(_0x291a8d){return _0x291a8d['addBlackLists'](_0x325c7b[_0xe7fb('0x3d')]['ids'],_[_0xe7fb('0x45')](_0x325c7b[_0xe7fb('0x3d')],[_0xe7fb('0x6b'),'id'])||{});}return null;})[_0xe7fb('0x8c')](function(_0x3ade81){var _0x1b9ea2;_0x1a33f8=_0x3ade81||[];var _0x418561=[];if(_0x3ade81){for(var _0x3ec66a=0x0;_0x3ec66a<_0x3ade81[_0xe7fb('0x37')];_0x3ec66a+=0x1){var _0x1c76a1=_0x3ade81[_0x3ec66a][_0xe7fb('0x1a')]({'plain':!![]});_0x1b9ea2=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0xad'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')]('phone',_0xe7fb('0x92'))[_0xe7fb('0x6e')]('id',_0xe7fb('0x94'))['field'](_0x1c76a1[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))[_0xe7fb('0x6e')](_0x325c7b[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')](),'VoiceQueueId')[_0xe7fb('0x6e')](_0xe7fb('0xae'),_0xe7fb('0x47'))[_0xe7fb('0x6e')]('NOW()',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))[_0xe7fb('0x29')]('deletedAt\x20IS\x20NULL')[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x1c76a1[_0xe7fb('0x96')][_0xe7fb('0x75')]())[_0xe7fb('0x29')](_0xe7fb('0xa0')))['toString']();_0x418561[_0xe7fb('0x74')](db[_0xe7fb('0x5f')]['query'](_0x1b9ea2));}return BPromise[_0xe7fb('0x7a')](_0x418561);}})[_0xe7fb('0x18')](function(){return _0x1a33f8;})['then'](respondWithResult(_0x38472b,null))[_0xe7fb('0x2e')](handleError(_0x38472b,null));};exports['removeBlackLists']=function(_0x127051,_0x4d9376){return db[_0xe7fb('0x25')]['find']({'where':{'id':_0x127051['params']['id']}})['then'](handleEntityNotFound(_0x4d9376,null))['then'](function(_0x547d29){if(_0x547d29){return _0x547d29[_0xe7fb('0xaf')](_0x127051[_0xe7fb('0x2b')]['ids']);}})[_0xe7fb('0x18')](function(_0x5c0baf){if(_0x5c0baf){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x127051['query'][_0xe7fb('0x6b')],'VoiceQueueId':_0x127051[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(){return _0x5c0baf;});}})['then'](respondWithStatusCode(_0x4d9376,null))[_0xe7fb('0x2e')](handleError(_0x4d9376,null));}; \ No newline at end of file +var _0x8ef6=['select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','into','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','VoiceQueues','inbound','outbound','ignore','map','value','find','type','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','getOptions','include','query','findAll','rows','catch','show','model','keys','intersection','attributes','fields','length','merge','options','create','body','user','get','role','QueueCampaigns','UserProfileSection','userProfileId','clone','includeAll','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getHoppers','findOne','CmHopper','filters','hasOwnProperty','order','sort','where','pick','filter','getHopperHistories','CmHopperHistory','nolimit','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids'];(function(_0x5c2511,_0x38f5fd){var _0x480bab=function(_0x4749e8){while(--_0x4749e8){_0x5c2511['push'](_0x5c2511['shift']());}};_0x480bab(++_0x38f5fd);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5a8087,_0x199c47){_0x5a8087=_0x5a8087-0x0;var _0x11e86e=_0x8ef6[_0x5a8087];return _0x11e86e;};'use strict';var moment=require(_0x68ef('0x0'));var BPromise=require(_0x68ef('0x1'));var util=require(_0x68ef('0x2'));var _=require(_0x68ef('0x3'));var squel=require(_0x68ef('0x4'));var Redis=require(_0x68ef('0x5'));var qs=require(_0x68ef('0x6'));var logger=require('../../config/logger')(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var db=require(_0x68ef('0x9'))['db'];config[_0x68ef('0xa')]=_['defaults'](config['redis'],{'host':_0x68ef('0xb'),'port':0x18eb});var socket=require(_0x68ef('0xc'))(new Redis(config[_0x68ef('0xa')]));require('./voiceQueue.socket')[_0x68ef('0xd')](socket);function respondWithStatusCode(_0x31007e,_0x1bee73){_0x1bee73=_0x1bee73||0xcc;return function(_0x22ae26){if(_0x22ae26){return _0x31007e[_0x68ef('0xe')](_0x1bee73);}return _0x31007e[_0x68ef('0xf')](_0x1bee73)[_0x68ef('0x10')]();};}function respondWithResult(_0x23da00,_0x1f6747){_0x1f6747=_0x1f6747||0xc8;return function(_0x255c85){if(_0x255c85){return _0x23da00[_0x68ef('0xf')](_0x1f6747)[_0x68ef('0x11')](_0x255c85);}};}function respondWithFilteredResult(_0x582a79,_0x1aa045){return function(_0x46356f){if(_0x46356f){var _0x1e117a=typeof _0x1aa045[_0x68ef('0x12')]===_0x68ef('0x13')&&typeof _0x1aa045[_0x68ef('0x14')]==='undefined';var _0x3b48dd=_0x46356f[_0x68ef('0x15')];var _0x2657c5=_0x1e117a?0x0:_0x1aa045['offset'];var _0x22fe96=_0x1e117a?_0x46356f[_0x68ef('0x15')]:_0x1aa045[_0x68ef('0x12')]+_0x1aa045['limit'];var _0x35493d;if(_0x22fe96>=_0x3b48dd){_0x22fe96=_0x3b48dd;_0x35493d=0xc8;}else{_0x35493d=0xce;}_0x582a79[_0x68ef('0xf')](_0x35493d);return _0x582a79[_0x68ef('0x16')](_0x68ef('0x17'),_0x2657c5+'-'+_0x22fe96+'/'+_0x3b48dd)['json'](_0x46356f);}return null;};}function saveUpdates(_0x2ada1c){return function(_0x54139e){if(_0x54139e){return _0x54139e['update'](_0x2ada1c)[_0x68ef('0x18')](function(_0x404870){return _0x404870;});}return null;};}function removeEntity(_0x4ade0d){return function(_0x527870){if(_0x527870){return _0x527870[_0x68ef('0x19')]()[_0x68ef('0x18')](function(){var _0x318514=_0x527870['get']({'plain':!![]});var _0x1dc49c=[{'name':_0x68ef('0x1a'),'value':_0x68ef('0x1b'),'ignore':![]},{'name':'QueueCampaigns','value':_0x68ef('0x1c'),'ignore':![]}];var _0x3be4c0=_(_0x1dc49c)['filter'](_0x68ef('0x1d'))[_0x68ef('0x1e')](_0x68ef('0x1f'))['value']();if(_['includes'](_0x3be4c0,_0x318514['type'])){return;}var _0x26018d=_[_0x68ef('0x20')](_0x1dc49c,[_0x68ef('0x1f'),_0x318514[_0x68ef('0x21')]])[_0x68ef('0x22')];return db[_0x68ef('0x23')][_0x68ef('0x19')]({'where':{'type':_0x26018d,'resourceId':_0x318514['id']}})[_0x68ef('0x18')](function(){return _0x527870;});})[_0x68ef('0x18')](function(){_0x4ade0d[_0x68ef('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x178460){return function(_0x57f9ee){if(!_0x57f9ee){_0x178460['sendStatus'](0x194);}return _0x57f9ee;};}function handleError(_0x55d8b0,_0x1a7ce1){_0x1a7ce1=_0x1a7ce1||0x1f4;return function(_0x268f32){logger[_0x68ef('0x24')](_0x268f32[_0x68ef('0x25')]);if(_0x268f32['name']){delete _0x268f32['name'];}_0x55d8b0[_0x68ef('0xf')](_0x1a7ce1)[_0x68ef('0x26')](_0x268f32);};}exports[_0x68ef('0x27')]=function(_0x263b30,_0x22ef25){var _0x201884={};var _0x26288a={'count':0x0,'rows':[]};var _0x4579cb=_['map'](db[_0x68ef('0x28')][_0x68ef('0x29')],function(_0x132d9e){return{'name':_0x132d9e['fieldName'],'type':_0x132d9e[_0x68ef('0x21')]['key']};});_0x201884=qs[_0x68ef('0x2a')](_0x4579cb,_0x263b30);var _0x17588a={'where':_0x201884['where']};return db['VoiceQueue'][_0x68ef('0x15')](_0x17588a)[_0x68ef('0x18')](function(_0x4b8fc8){_0x26288a[_0x68ef('0x15')]=_0x4b8fc8;_0x201884[_0x68ef('0x2b')]=qs[_0x68ef('0x2b')](_0x263b30[_0x68ef('0x2c')]);return db['VoiceQueue'][_0x68ef('0x2d')](_0x201884);})[_0x68ef('0x18')](function(_0x5f137b){_0x26288a[_0x68ef('0x2e')]=_0x5f137b;return _0x26288a;})['then'](respondWithFilteredResult(_0x22ef25,_0x201884))[_0x68ef('0x2f')](handleError(_0x22ef25,null));};exports[_0x68ef('0x30')]=function(_0x4973c2,_0x24c2c9){var _0x4a0763={'raw':![],'where':{'id':_0x4973c2['params']['id']}},_0x38c2f8={};_0x38c2f8[_0x68ef('0x31')]=_[_0x68ef('0x32')](db[_0x68ef('0x28')]['rawAttributes']);_0x38c2f8[_0x68ef('0x2c')]=_['keys'](_0x4973c2[_0x68ef('0x2c')]);_0x38c2f8['filters']=_[_0x68ef('0x33')](_0x38c2f8[_0x68ef('0x31')],_0x38c2f8[_0x68ef('0x2c')]);_0x4a0763[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x38c2f8[_0x68ef('0x31')],qs['fields'](_0x4973c2[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x4a0763[_0x68ef('0x34')]=_0x4a0763['attributes'][_0x68ef('0x36')]?_0x4a0763[_0x68ef('0x34')]:_0x38c2f8[_0x68ef('0x31')];if(_0x4973c2['query']['includeAll']){_0x4a0763[_0x68ef('0x2b')]=[{'all':!![]}];}_0x4a0763=_[_0x68ef('0x37')]({},_0x4a0763,_0x4973c2[_0x68ef('0x38')]);return db[_0x68ef('0x28')][_0x68ef('0x20')](_0x4a0763)[_0x68ef('0x18')](handleEntityNotFound(_0x24c2c9,null))[_0x68ef('0x18')](respondWithResult(_0x24c2c9,null))['catch'](handleError(_0x24c2c9,null));};exports[_0x68ef('0x39')]=function(_0xd7f9ca,_0x2f6ee0){return db[_0x68ef('0x28')]['create'](_0xd7f9ca[_0x68ef('0x3a')],{})[_0x68ef('0x18')](function(_0xcf595d){var _0x410c10=_0xd7f9ca[_0x68ef('0x3b')][_0x68ef('0x3c')]({'plain':!![]});if(!_0x410c10)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x410c10[_0x68ef('0x3d')]===_0x68ef('0x3b')){var _0xf5010c=_0xcf595d[_0x68ef('0x3c')]({'plain':!![]});var _0x449f3c=[{'name':_0x68ef('0x1a'),'value':_0x68ef('0x1b')},{'name':_0x68ef('0x3e'),'value':_0x68ef('0x1c')}];var _0x531096=_[_0x68ef('0x20')](_0x449f3c,[_0x68ef('0x1f'),_0xf5010c[_0x68ef('0x21')]])[_0x68ef('0x22')];return db[_0x68ef('0x3f')][_0x68ef('0x20')]({'where':{'name':_0x531096,'userProfileId':_0x410c10[_0x68ef('0x40')]},'raw':!![]})['then'](function(_0xb3d396){if(_0xb3d396&&_0xb3d396['autoAssociation']===0x0){return db[_0x68ef('0x23')][_0x68ef('0x39')]({'name':_0xf5010c[_0x68ef('0x22')],'resourceId':_0xf5010c['id'],'type':_0xb3d396[_0x68ef('0x22')],'sectionId':_0xb3d396['id']},{})['then'](function(){return _0xcf595d;});}else{return _0xcf595d;}})[_0x68ef('0x2f')](function(_0x5a8231){logger[_0x68ef('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a8231);throw _0x5a8231;});}return _0xcf595d;})[_0x68ef('0x18')](respondWithResult(_0x2f6ee0,0xc9))[_0x68ef('0x2f')](handleError(_0x2f6ee0,null));};exports[_0x68ef('0x41')]=function(_0x5c4a66,_0x59b148){var _0x4044d5={'where':{'id':_0x5c4a66['params']['id']}},_0x399055={};_0x399055['model']=_['keys'](db[_0x68ef('0x28')][_0x68ef('0x29')]);_0x4044d5[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x399055[_0x68ef('0x31')],qs['fields'](_0x5c4a66['query'][_0x68ef('0x35')]));_0x4044d5[_0x68ef('0x34')]=_0x4044d5[_0x68ef('0x34')][_0x68ef('0x36')]?_0x4044d5['attributes']:_0x399055[_0x68ef('0x31')];if(_0x5c4a66[_0x68ef('0x2c')][_0x68ef('0x42')]){_0x4044d5[_0x68ef('0x2b')]=[{'all':!![]}];}_0x4044d5=_['merge']({},_0x4044d5,_0x5c4a66['options']);return db[_0x68ef('0x28')][_0x68ef('0x20')](_0x4044d5)['then'](handleEntityNotFound(_0x59b148,null))[_0x68ef('0x18')](function(_0x12fff3){if(_0x12fff3){var _0x3a82a0=_0x12fff3[_0x68ef('0x3c')]({'plain':!![]});_0x3a82a0=qs[_0x68ef('0x43')](_0x3a82a0,['id','createdAt',_0x68ef('0x44')]);_0x5c4a66[_0x68ef('0x3a')]=_[_0x68ef('0x43')](_0x5c4a66['body'],['id',_0x68ef('0x45'),_0x68ef('0x44')]);return db[_0x68ef('0x28')]['create'](_[_0x68ef('0x37')](_0x3a82a0,_0x5c4a66['body']),{'include':_0x5c4a66['query'][_0x68ef('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x39dd21){var _0xb33afd=_0x5c4a66[_0x68ef('0x3b')][_0x68ef('0x3c')]({'plain':!![]});if(!_0xb33afd)throw new Error(_0x68ef('0x46'));if(_0xb33afd[_0x68ef('0x3d')]===_0x68ef('0x3b')){var _0x1d1d6e=_0x39dd21[_0x68ef('0x3c')]({'plain':!![]});var _0x247915=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x68ef('0x3e'),'value':_0x68ef('0x1c')}];var _0x317b79=_[_0x68ef('0x20')](_0x247915,[_0x68ef('0x1f'),_0x1d1d6e[_0x68ef('0x21')]])[_0x68ef('0x22')];return db[_0x68ef('0x3f')][_0x68ef('0x20')]({'where':{'name':_0x317b79,'userProfileId':_0xb33afd['userProfileId']},'raw':!![]})['then'](function(_0x42a4b2){if(_0x42a4b2&&_0x42a4b2['autoAssociation']===0x0){return db[_0x68ef('0x23')]['create']({'name':_0x1d1d6e[_0x68ef('0x22')],'resourceId':_0x1d1d6e['id'],'type':_0x42a4b2[_0x68ef('0x22')],'sectionId':_0x42a4b2['id']},{})['then'](function(){return _0x39dd21;});}else{return _0x39dd21;}})[_0x68ef('0x2f')](function(_0x4e097e){logger[_0x68ef('0x24')](_0x68ef('0x47'),_0x4e097e);throw _0x4e097e;});}return _0x39dd21;});}})[_0x68ef('0x18')](respondWithResult(_0x59b148,0xc9))[_0x68ef('0x2f')](handleError(_0x59b148,null));};exports[_0x68ef('0x48')]=function(_0x3d81c8,_0x5c347c){if(_0x3d81c8[_0x68ef('0x3a')]['id']){delete _0x3d81c8[_0x68ef('0x3a')]['id'];}return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x3d81c8[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x5c347c,null))['then'](saveUpdates(_0x3d81c8[_0x68ef('0x3a')],null))[_0x68ef('0x18')](respondWithResult(_0x5c347c,null))['catch'](handleError(_0x5c347c,null));};exports[_0x68ef('0x19')]=function(_0x114d9f,_0x3d3087){return db['VoiceQueue'][_0x68ef('0x20')]({'where':{'id':_0x114d9f['params']['id']}})['then'](handleEntityNotFound(_0x3d3087,null))[_0x68ef('0x18')](removeEntity(_0x3d3087,null))['catch'](handleError(_0x3d3087,null));};exports[_0x68ef('0x4a')]=function(_0x47c1d5,_0x100a20){var _0x9e8554={'raw':![],'where':{}};var _0x304405={};var _0x3fbd39={'count':0x0,'rows':[]};return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x47c1d5['params']['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x100a20,null))['then'](function(_0x2cbd99){if(_0x2cbd99){_0x304405['model']=_[_0x68ef('0x32')](db[_0x68ef('0x4c')][_0x68ef('0x29')]);_0x304405[_0x68ef('0x2c')]=_[_0x68ef('0x32')](_0x47c1d5[_0x68ef('0x2c')]);_0x304405[_0x68ef('0x4d')]=_['intersection'](_0x304405[_0x68ef('0x31')],_0x304405[_0x68ef('0x2c')]);_0x9e8554[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x304405[_0x68ef('0x31')],qs['fields'](_0x47c1d5[_0x68ef('0x2c')]['fields']));_0x9e8554[_0x68ef('0x34')]=_0x9e8554['attributes']['length']?_0x9e8554[_0x68ef('0x34')]:_0x304405[_0x68ef('0x31')];if(!_0x47c1d5[_0x68ef('0x2c')][_0x68ef('0x4e')]('nolimit')){_0x9e8554[_0x68ef('0x14')]=qs['limit'](_0x47c1d5[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x9e8554[_0x68ef('0x12')]=qs['offset'](_0x47c1d5['query'][_0x68ef('0x12')]);}_0x9e8554[_0x68ef('0x4f')]=qs[_0x68ef('0x50')](_0x47c1d5[_0x68ef('0x2c')]['sort']);_0x9e8554[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x47c1d5[_0x68ef('0x2c')],_0x304405['filters']));_0x9e8554[_0x68ef('0x51')]['VoiceQueueId']=_0x2cbd99['id'];if(_0x47c1d5[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x9e8554[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x9e8554[_0x68ef('0x51')],{'$or':_['map'](_0x9e8554[_0x68ef('0x34')],function(_0x2caed7){var _0x147695={};_0x147695[_0x2caed7]={'$like':'%'+_0x47c1d5['query'][_0x68ef('0x53')]+'%'};return _0x147695;})});}_0x9e8554=_['merge']({},_0x9e8554,_0x47c1d5[_0x68ef('0x38')]);return db['CmHopper']['count']({'where':_0x9e8554[_0x68ef('0x51')]})[_0x68ef('0x18')](function(_0x38c117){_0x3fbd39[_0x68ef('0x15')]=_0x38c117;if(_0x47c1d5['query'][_0x68ef('0x42')]){_0x9e8554[_0x68ef('0x2b')]=[{'all':!![]}];}return db[_0x68ef('0x4c')]['findAll'](_0x9e8554);})[_0x68ef('0x18')](function(_0x2db826){_0x3fbd39[_0x68ef('0x2e')]=_0x2db826;return _0x3fbd39;});}})[_0x68ef('0x18')](respondWithFilteredResult(_0x100a20,_0x9e8554))[_0x68ef('0x2f')](handleError(_0x100a20,null));};exports[_0x68ef('0x54')]=function(_0x139557,_0xfe72dc){var _0x156ce3={'raw':!![],'where':{}};var _0x11feff={};var _0x454999={'count':0x0,'rows':[]};return db[_0x68ef('0x28')]['findOne']({'where':{'id':_0x139557[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0xfe72dc,null))['then'](function(_0x513c69){if(_0x513c69){_0x11feff[_0x68ef('0x31')]=_['keys'](db[_0x68ef('0x55')][_0x68ef('0x29')]);_0x11feff['query']=_['keys'](_0x139557[_0x68ef('0x2c')]);_0x11feff['filters']=_[_0x68ef('0x33')](_0x11feff['model'],_0x11feff[_0x68ef('0x2c')]);_0x156ce3['attributes']=_[_0x68ef('0x33')](_0x11feff[_0x68ef('0x31')],qs['fields'](_0x139557[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x156ce3[_0x68ef('0x34')]=_0x156ce3[_0x68ef('0x34')]['length']?_0x156ce3[_0x68ef('0x34')]:_0x11feff[_0x68ef('0x31')];if(!_0x139557['query'][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x156ce3[_0x68ef('0x14')]=qs['limit'](_0x139557[_0x68ef('0x2c')]['limit']);_0x156ce3[_0x68ef('0x12')]=qs[_0x68ef('0x12')](_0x139557['query']['offset']);}_0x156ce3['order']=qs['sort'](_0x139557[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x156ce3[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x139557[_0x68ef('0x2c')],_0x11feff[_0x68ef('0x4d')]));_0x156ce3[_0x68ef('0x51')][_0x68ef('0x57')]=_0x513c69['id'];if(_0x139557[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x156ce3[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x156ce3['where'],{'$or':_[_0x68ef('0x1e')](_0x156ce3['attributes'],function(_0x791181){var _0x5b39a8={};_0x5b39a8[_0x791181]={'$like':'%'+_0x139557['query'][_0x68ef('0x53')]+'%'};return _0x5b39a8;})});}_0x156ce3=_[_0x68ef('0x37')]({},_0x156ce3,_0x139557[_0x68ef('0x38')]);return db[_0x68ef('0x55')]['count']({'where':_0x156ce3['where']})[_0x68ef('0x18')](function(_0x308997){_0x454999[_0x68ef('0x15')]=_0x308997;if(_0x139557['query'][_0x68ef('0x42')]){_0x156ce3[_0x68ef('0x2b')]=[{'all':!![]}];}return db[_0x68ef('0x55')][_0x68ef('0x2d')](_0x156ce3);})['then'](function(_0x214e89){_0x454999[_0x68ef('0x2e')]=_0x214e89;return _0x454999;});}})[_0x68ef('0x18')](respondWithFilteredResult(_0xfe72dc,_0x156ce3))[_0x68ef('0x2f')](handleError(_0xfe72dc,null));};exports[_0x68ef('0x58')]=function(_0x346049,_0x489ca6){var _0x2a72e8={'raw':!![],'where':{}};var _0x49844f={};var _0xea97f4={'count':0x0,'rows':[]};return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x346049[_0x68ef('0x49')]['id']}})['then'](handleEntityNotFound(_0x489ca6,null))[_0x68ef('0x18')](function(_0x4c47ab){if(_0x4c47ab){_0x49844f[_0x68ef('0x31')]=_[_0x68ef('0x32')](db['CmHopperFinal']['rawAttributes']);_0x49844f[_0x68ef('0x2c')]=_['keys'](_0x346049[_0x68ef('0x2c')]);_0x49844f['filters']=_[_0x68ef('0x33')](_0x49844f[_0x68ef('0x31')],_0x49844f[_0x68ef('0x2c')]);_0x2a72e8[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x49844f[_0x68ef('0x31')],qs['fields'](_0x346049[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x2a72e8[_0x68ef('0x34')]=_0x2a72e8[_0x68ef('0x34')][_0x68ef('0x36')]?_0x2a72e8[_0x68ef('0x34')]:_0x49844f[_0x68ef('0x31')];if(!_0x346049['query'][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x2a72e8[_0x68ef('0x14')]=qs[_0x68ef('0x14')](_0x346049[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x2a72e8[_0x68ef('0x12')]=qs[_0x68ef('0x12')](_0x346049[_0x68ef('0x2c')]['offset']);}_0x2a72e8[_0x68ef('0x4f')]=qs['sort'](_0x346049['query']['sort']);_0x2a72e8[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x346049['query'],_0x49844f['filters']));_0x2a72e8['where'][_0x68ef('0x57')]=_0x4c47ab['id'];if(_0x346049[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x2a72e8[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x2a72e8[_0x68ef('0x51')],{'$or':_['map'](_0x2a72e8[_0x68ef('0x34')],function(_0x2c7f18){var _0x1bdacc={};_0x1bdacc[_0x2c7f18]={'$like':'%'+_0x346049[_0x68ef('0x2c')]['filter']+'%'};return _0x1bdacc;})});}_0x2a72e8=_[_0x68ef('0x37')]({},_0x2a72e8,_0x346049[_0x68ef('0x38')]);return db[_0x68ef('0x59')][_0x68ef('0x15')]({'where':_0x2a72e8[_0x68ef('0x51')]})[_0x68ef('0x18')](function(_0x6ca6f4){_0xea97f4[_0x68ef('0x15')]=_0x6ca6f4;if(_0x346049['query'][_0x68ef('0x42')]){_0x2a72e8[_0x68ef('0x2b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x68ef('0x2d')](_0x2a72e8);})[_0x68ef('0x18')](function(_0x1b9028){_0xea97f4[_0x68ef('0x2e')]=_0x1b9028;return _0xea97f4;});}})[_0x68ef('0x18')](respondWithFilteredResult(_0x489ca6,_0x2a72e8))[_0x68ef('0x2f')](handleError(_0x489ca6,null));};exports[_0x68ef('0x5a')]=function(_0x2e626c,_0x3b1781){var _0x159169={'raw':!![],'where':{}};var _0x29522c={};var _0x37bf89={'count':0x0,'rows':[]};return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x2e626c[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x3b1781,null))[_0x68ef('0x18')](function(_0x24af15){if(_0x24af15){_0x29522c['model']=_[_0x68ef('0x32')](db[_0x68ef('0x5b')][_0x68ef('0x29')]);_0x29522c[_0x68ef('0x2c')]=_[_0x68ef('0x32')](_0x2e626c['query']);_0x29522c[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x29522c['model'],_0x29522c[_0x68ef('0x2c')]);_0x159169['attributes']=_['intersection'](_0x29522c['model'],qs['fields'](_0x2e626c[_0x68ef('0x2c')]['fields']));_0x159169[_0x68ef('0x34')]=_0x159169['attributes']['length']?_0x159169['attributes']:_0x29522c[_0x68ef('0x31')];if(!_0x2e626c[_0x68ef('0x2c')][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x159169[_0x68ef('0x14')]=qs['limit'](_0x2e626c[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x159169[_0x68ef('0x12')]=qs[_0x68ef('0x12')](_0x2e626c['query'][_0x68ef('0x12')]);}_0x159169['order']=qs['sort'](_0x2e626c['query'][_0x68ef('0x50')]);_0x159169[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x2e626c[_0x68ef('0x2c')],_0x29522c[_0x68ef('0x4d')]));_0x159169[_0x68ef('0x51')][_0x68ef('0x57')]=_0x24af15['id'];if(_0x2e626c[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x159169[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x159169['where'],{'$or':_['map'](_0x159169['attributes'],function(_0x25e698){var _0x1cad59={};_0x1cad59[_0x25e698]={'$like':'%'+_0x2e626c[_0x68ef('0x2c')]['filter']+'%'};return _0x1cad59;})});}_0x159169=_[_0x68ef('0x37')]({},_0x159169,_0x2e626c['options']);return db[_0x68ef('0x5b')][_0x68ef('0x15')]({'where':_0x159169[_0x68ef('0x51')]})['then'](function(_0x304260){_0x37bf89[_0x68ef('0x15')]=_0x304260;if(_0x2e626c['query'][_0x68ef('0x42')]){_0x159169[_0x68ef('0x2b')]=[{'all':!![]}];}return db[_0x68ef('0x5b')][_0x68ef('0x2d')](_0x159169);})[_0x68ef('0x18')](function(_0x23126a){_0x37bf89[_0x68ef('0x2e')]=_0x23126a;return _0x37bf89;});}})['then'](respondWithFilteredResult(_0x3b1781,_0x159169))[_0x68ef('0x2f')](handleError(_0x3b1781,null));};exports[_0x68ef('0x5c')]=function(_0x5a262d,_0x28cad4){var _0x424e46={};var _0x46c87e={};var _0x20a131;var _0x1b8250;return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x5a262d['params']['id']}})['then'](handleEntityNotFound(_0x28cad4,null))[_0x68ef('0x18')](function(_0x4dcf9e){if(_0x4dcf9e){_0x20a131=_0x4dcf9e;_0x46c87e[_0x68ef('0x31')]=_[_0x68ef('0x32')](db[_0x68ef('0x5d')][_0x68ef('0x29')]);_0x46c87e[_0x68ef('0x2c')]=_['keys'](_0x5a262d[_0x68ef('0x2c')]);_0x46c87e[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x46c87e[_0x68ef('0x31')],_0x46c87e['query']);_0x424e46['attributes']=_[_0x68ef('0x33')](_0x46c87e[_0x68ef('0x31')],qs[_0x68ef('0x35')](_0x5a262d[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x424e46[_0x68ef('0x34')]=_0x424e46[_0x68ef('0x34')][_0x68ef('0x36')]?_0x424e46[_0x68ef('0x34')]:_0x46c87e[_0x68ef('0x31')];_0x424e46[_0x68ef('0x4f')]=qs['sort'](_0x5a262d[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x424e46[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x5a262d[_0x68ef('0x2c')],_0x46c87e[_0x68ef('0x4d')]));if(_0x5a262d[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x424e46[_0x68ef('0x51')]=_['merge'](_0x424e46['where'],{'$or':_[_0x68ef('0x1e')](_0x424e46[_0x68ef('0x34')],function(_0x3ef9e2){var _0x12ef69={};_0x12ef69[_0x3ef9e2]={'$like':'%'+_0x5a262d[_0x68ef('0x2c')][_0x68ef('0x53')]+'%'};return _0x12ef69;})});}_0x424e46=_[_0x68ef('0x37')]({},_0x424e46,_0x5a262d['options']);return _0x20a131[_0x68ef('0x5c')](_0x424e46);}})[_0x68ef('0x18')](function(_0x11c717){if(_0x11c717){_0x1b8250=_0x11c717[_0x68ef('0x36')];if(!_0x5a262d['query'][_0x68ef('0x4e')]('nolimit')){_0x424e46[_0x68ef('0x14')]=qs[_0x68ef('0x14')](_0x5a262d[_0x68ef('0x2c')]['limit']);_0x424e46['offset']=qs[_0x68ef('0x12')](_0x5a262d['query'][_0x68ef('0x12')]);}return _0x20a131['getTeams'](_0x424e46);}})[_0x68ef('0x18')](function(_0x426274){if(_0x426274){return _0x426274?{'count':_0x1b8250,'rows':_0x426274}:null;}})['then'](respondWithResult(_0x28cad4,null))['catch'](handleError(_0x28cad4,null));};exports[_0x68ef('0x5e')]=function(_0x1d429a,_0x4d96a9){var _0xf9f2c4=_0x1d429a[_0x68ef('0x3a')][_0x68ef('0x5f')];var _0x4ae311=_['map'](_0xf9f2c4,'id');return db[_0x68ef('0x5d')]['findAll']({'where':{'id':_0x4ae311},'attributes':['id'],'include':[{'model':db[_0x68ef('0x60')],'as':_0x68ef('0x61'),'attributes':['id',_0x68ef('0x22'),_0x68ef('0x62'),_0x68ef('0x63'),_0x68ef('0x64')],'raw':!![]}]})['then'](function(_0x48f3f6){if(_0x48f3f6){var _0x453f91=_[_0x68ef('0x65')](_0x48f3f6,function(_0x8eb711){var _0x39ab6a=_0x8eb711[_0x68ef('0x3c')]({'plain':!![]});_0x39ab6a['Agents'][_0x68ef('0x66')](function(_0x428fd5){_0x428fd5[_0x68ef('0x67')]=_[_0x68ef('0x20')](_0xf9f2c4,{'id':_0x39ab6a['id']})[_0x68ef('0x67')];});return _0x39ab6a[_0x68ef('0x61')];});return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x1d429a['params']['id']}})[_0x68ef('0x18')](function(_0x261ce6){return db[_0x68ef('0x68')][_0x68ef('0x69')](function(_0x2138cd){return _0x261ce6[_0x68ef('0x5e')](_0x4ae311,{'transaction':_0x2138cd})['then'](function(){return BPromise[_0x68ef('0x6a')](_0xf9f2c4,function(_0x13fae2){return db[_0x68ef('0x6b')][_0x68ef('0x6c')]({'TeamId':_0x13fae2['id'],'VoiceQueueId':_0x1d429a[_0x68ef('0x49')]['id'],'penalty':_0x13fae2['penalty']},{'transaction':_0x2138cd});});})[_0x68ef('0x18')](function(){return BPromise[_0x68ef('0x6a')](_0x453f91,function(_0x5d156e){return db['UserVoiceQueue'][_0x68ef('0x6d')]({'where':{'UserId':_0x5d156e['id'],'VoiceQueueId':_0x1d429a[_0x68ef('0x49')]['id']},'defaults':{'penalty':_0x5d156e[_0x68ef('0x67')]},'transaction':_0x2138cd});});})['then'](function(){return BPromise['each'](_[_0x68ef('0x53')](_0x453f91,{'online':!![]}),function(_0x10a3f9){return db[_0x68ef('0x6e')][_0x68ef('0x6c')]({'membername':_0x10a3f9[_0x68ef('0x22')],'UserId':_0x10a3f9['id'],'queue_name':_0x261ce6[_0x68ef('0x22')],'VoiceQueueId':_0x261ce6['id'],'interface':_[_0x68ef('0x6f')](_0x10a3f9[_0x68ef('0x64')])?util[_0x68ef('0x70')](_0x68ef('0x71'),_0x10a3f9[_0x68ef('0x22')]):_0x10a3f9[_0x68ef('0x64')],'paused':_0x10a3f9[_0x68ef('0x63')]||![],'penalty':_0x10a3f9[_0x68ef('0x67')]},{'transaction':_0x2138cd});});})['then'](function(){_0x453f91['forEach'](function(_0x503219){socket[_0x68ef('0x72')](_0x68ef('0x73'),{'UserId':_0x503219['id'],'VoiceQueueId':_0x261ce6['id']});});});});});}})[_0x68ef('0x18')](respondWithStatusCode(_0x4d96a9,null))['catch'](handleError(_0x4d96a9,null));};exports[_0x68ef('0x74')]=function(_0x3713e0,_0x5af5d0){return db['Team'][_0x68ef('0x2d')]({'where':{'id':_0x3713e0[_0x68ef('0x2c')][_0x68ef('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x68ef('0x61'),'attributes':['id'],'raw':!![]}]})[_0x68ef('0x18')](handleEntityNotFound(_0x5af5d0,null))[_0x68ef('0x18')](function(_0x48959f){var _0x1bb11f=_['map'](_0x48959f,'id');var _0x211d51=[];var _0x3e37e3=[];var _0x5168cd=squel[_0x68ef('0x76')]();_0x5168cd[_0x68ef('0x77')](_0x68ef('0x78'))[_0x68ef('0x79')](_0x68ef('0x7a'),'tq')[_0x68ef('0x7b')](_0x68ef('0x7c'),'ut',_0x68ef('0x7d'))[_0x68ef('0x51')]('VoiceQueueId\x20=\x20?',_0x3713e0[_0x68ef('0x49')]['id']);for(var _0x121a0f=0x0;_0x121a0f<_0x48959f[_0x68ef('0x36')];_0x121a0f+=0x1){let _0x465198=_0x48959f[_0x121a0f];for(var _0x3e3775=0x0;_0x3e3775<_0x465198[_0x68ef('0x61')][_0x68ef('0x36')];_0x3e3775+=0x1){let _0x4906d2=_0x465198['Agents'][_0x3e3775];var _0x1e8577=_0x5168cd['clone']();_0x1e8577[_0x68ef('0x51')](_0x68ef('0x7e'),_0x4906d2['id']);_0x3e37e3[_0x68ef('0x7f')](db[_0x68ef('0x68')]['query'](_0x1e8577[_0x68ef('0x80')](),{'type':db[_0x68ef('0x68')][_0x68ef('0x81')]['SELECT']})[_0x68ef('0x18')](function(_0xe82f3a){if(_0xe82f3a['length']===0x1){return _0x4906d2['id'];}else{var _0x3c3933=_[_0x68ef('0x82')](_['map'](_0xe82f3a,'TeamId'),function(_0x522ef7){return _[_0x68ef('0x83')](_0x1bb11f,_0x522ef7);});if(_0x3c3933){return _0x4906d2['id'];}}}));}}return BPromise[_0x68ef('0x84')](_0x3e37e3)[_0x68ef('0x18')](function(_0x3e92e0){_0x211d51=_(_0x211d51)[_0x68ef('0x85')](_0x3e92e0)[_0x68ef('0x86')]()[_0x68ef('0x1f')]();return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x3713e0['params']['id']}})[_0x68ef('0x18')](function(_0x62a830){return db['sequelize'][_0x68ef('0x69')](function(_0x2374fa){return _0x62a830[_0x68ef('0x74')](_0x3713e0['query'][_0x68ef('0x75')],{'transaction':_0x2374fa})['then'](function(){if(!_[_0x68ef('0x87')](_0x211d51)){return _0x62a830[_0x68ef('0x88')](_0x211d51,{'transaction':_0x2374fa})[_0x68ef('0x18')](function(){return db[_0x68ef('0x6e')][_0x68ef('0x19')]({'where':{'VoiceQueueId':_0x3713e0[_0x68ef('0x49')]['id'],'UserId':_0x211d51},'transaction':_0x2374fa});});}})[_0x68ef('0x18')](function(){_0x211d51[_0x68ef('0x66')](function(_0x491464){socket[_0x68ef('0x72')](_0x68ef('0x89'),{'UserId':_0x491464,'VoiceQueueId':_0x62a830['id']});});});});});});})['then'](respondWithStatusCode(_0x5af5d0,null))[_0x68ef('0x2f')](handleError(_0x5af5d0,null));};exports[_0x68ef('0x8a')]=function(_0x430ef5,_0x1d3499){var _0x2b1686,_0x51c52b;return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x430ef5[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x1d3499,null))[_0x68ef('0x18')](function(_0x5548b1){if(_0x5548b1){_0x51c52b=_0x5548b1;return _0x5548b1[_0x68ef('0x8a')](_0x430ef5['body']['ids'],_[_0x68ef('0x43')](_0x430ef5[_0x68ef('0x3a')],[_0x68ef('0x75'),'id'])||{})[_0x68ef('0x8b')](function(_0x32e1e3){for(var _0x150e0d=0x0;_0x150e0d<_0x430ef5[_0x68ef('0x3a')][_0x68ef('0x75')]['length'];_0x150e0d+=0x1){socket[_0x68ef('0x72')](_0x68ef('0x73'),{'UserId':Number(_0x430ef5[_0x68ef('0x3a')][_0x68ef('0x75')][_0x150e0d]),'VoiceQueueId':Number(_0x430ef5[_0x68ef('0x49')]['id'])});}return _0x32e1e3;});}})[_0x68ef('0x18')](function(_0x39302e){_0x2b1686=_0x39302e||[];if(_0x51c52b){return db[_0x68ef('0x60')][_0x68ef('0x2d')]({'where':{'id':_0x430ef5[_0x68ef('0x3a')][_0x68ef('0x75')]},'attributes':['id',_0x68ef('0x22'),'online',_0x68ef('0x63'),_0x68ef('0x64')],'raw':!![]});}})[_0x68ef('0x18')](function(_0xe4c314){if(!_['isEmpty'](_0xe4c314)){var _0xc5163d=[];for(var _0xb342e5=0x0;_0xb342e5<_0xe4c314[_0x68ef('0x36')];_0xb342e5++){if(_0xe4c314[_0xb342e5]['online']){_0xc5163d[_0x68ef('0x7f')](db['UserVoiceQueueRt'][_0x68ef('0x6c')]({'membername':_0xe4c314[_0xb342e5][_0x68ef('0x22')],'UserId':_0xe4c314[_0xb342e5]['id'],'queue_name':_0x51c52b[_0x68ef('0x22')],'VoiceQueueId':_0x51c52b['id'],'interface':_[_0x68ef('0x6f')](_0xe4c314[_0xb342e5][_0x68ef('0x64')])?util['format']('SIP/%s',_0xe4c314[_0xb342e5]['name']):_0xe4c314[_0xb342e5][_0x68ef('0x64')],'paused':_0xe4c314[_0xb342e5][_0x68ef('0x63')]||![],'penalty':_0x430ef5['body'][_0x68ef('0x67')]||0x0}));}}return BPromise[_0x68ef('0x84')](_0xc5163d);}})[_0x68ef('0x18')](function(){return _0x2b1686;})[_0x68ef('0x18')](respondWithResult(_0x1d3499,null))[_0x68ef('0x2f')](handleError(_0x1d3499,null));};exports[_0x68ef('0x88')]=function(_0x34edc4,_0x1576ac){return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x34edc4[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x1576ac,null))[_0x68ef('0x18')](function(_0x31b61d){if(_0x31b61d){return _0x31b61d[_0x68ef('0x88')](_0x34edc4[_0x68ef('0x2c')]['ids'])[_0x68ef('0x18')](function(){if(_[_0x68ef('0x8c')](_0x34edc4['query'][_0x68ef('0x75')])){for(var _0x1774a9=0x0;_0x1774a9<_0x34edc4[_0x68ef('0x2c')][_0x68ef('0x75')][_0x68ef('0x36')];_0x1774a9+=0x1){socket[_0x68ef('0x72')](_0x68ef('0x89'),{'UserId':Number(_0x34edc4['query']['ids'][_0x1774a9]),'VoiceQueueId':Number(_0x34edc4[_0x68ef('0x49')]['id'])});}}else{socket[_0x68ef('0x72')]('userVoiceQueue:remove',{'UserId':Number(_0x34edc4[_0x68ef('0x2c')]['ids']),'VoiceQueueId':Number(_0x34edc4[_0x68ef('0x49')]['id'])});}});}})['then'](function(_0x3054e8){return db[_0x68ef('0x6e')][_0x68ef('0x19')]({'where':{'VoiceQueueId':_0x34edc4[_0x68ef('0x49')]['id'],'UserId':_0x34edc4[_0x68ef('0x2c')][_0x68ef('0x75')]}})[_0x68ef('0x18')](function(){return _0x3054e8;});})[_0x68ef('0x18')](respondWithStatusCode(_0x1576ac,null))['catch'](handleError(_0x1576ac,null));};exports[_0x68ef('0x8d')]=function(_0x60a1e7,_0x3bd9f2){var _0x3dd5f7={};var _0x35eba3={};var _0x18e166;var _0x3a6e25;return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x60a1e7['params']['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x3bd9f2,null))[_0x68ef('0x18')](function(_0x33ec8e){if(_0x33ec8e){_0x18e166=_0x33ec8e;_0x35eba3['model']=_[_0x68ef('0x32')](db[_0x68ef('0x60')][_0x68ef('0x29')]);_0x35eba3[_0x68ef('0x2c')]=_[_0x68ef('0x32')](_0x60a1e7[_0x68ef('0x2c')]);_0x35eba3[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x35eba3[_0x68ef('0x31')],_0x35eba3[_0x68ef('0x2c')]);_0x3dd5f7[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x35eba3[_0x68ef('0x31')],qs[_0x68ef('0x35')](_0x60a1e7[_0x68ef('0x2c')]['fields']));_0x3dd5f7[_0x68ef('0x34')]=_0x3dd5f7[_0x68ef('0x34')]['length']?_0x3dd5f7[_0x68ef('0x34')]:_0x35eba3['model'];_0x3dd5f7[_0x68ef('0x4f')]=qs[_0x68ef('0x50')](_0x60a1e7[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x3dd5f7[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x60a1e7[_0x68ef('0x2c')],_0x35eba3[_0x68ef('0x4d')]));if(_0x60a1e7[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x3dd5f7[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x3dd5f7['where'],{'$or':_[_0x68ef('0x1e')](_0x3dd5f7[_0x68ef('0x34')],function(_0x2cf7d3){var _0x154c78={};_0x154c78[_0x2cf7d3]={'$like':'%'+_0x60a1e7['query'][_0x68ef('0x53')]+'%'};return _0x154c78;})});}_0x3dd5f7=_[_0x68ef('0x37')]({},_0x3dd5f7,_0x60a1e7[_0x68ef('0x38')]);return _0x18e166['getAgents'](_0x3dd5f7);}})[_0x68ef('0x18')](function(_0x225067){if(_0x225067){_0x3a6e25=_0x225067[_0x68ef('0x36')];if(!_0x60a1e7[_0x68ef('0x2c')][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x3dd5f7[_0x68ef('0x14')]=qs['limit'](_0x60a1e7['query'][_0x68ef('0x14')]);_0x3dd5f7[_0x68ef('0x12')]=qs['offset'](_0x60a1e7['query'][_0x68ef('0x12')]);}return _0x18e166[_0x68ef('0x8d')](_0x3dd5f7);}})[_0x68ef('0x18')](function(_0x1e1738){if(_0x1e1738){return _0x1e1738?{'count':_0x3a6e25,'rows':_0x1e1738}:null;}})[_0x68ef('0x18')](respondWithResult(_0x3bd9f2,null))[_0x68ef('0x2f')](handleError(_0x3bd9f2,null));};exports[_0x68ef('0x8e')]=function(_0x13db31,_0x58800b){var _0x4cc80a={};var _0x3452d1={};var _0x1c5b4a;var _0x33dd03;return db['VoiceQueue'][_0x68ef('0x4b')]({'where':{'id':_0x13db31[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x58800b,null))[_0x68ef('0x18')](function(_0x535c5c){if(_0x535c5c){_0x1c5b4a=_0x535c5c;_0x3452d1['model']=_[_0x68ef('0x32')](db[_0x68ef('0x6e')][_0x68ef('0x29')]);_0x3452d1['query']=_[_0x68ef('0x32')](_0x13db31[_0x68ef('0x2c')]);_0x3452d1[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x3452d1[_0x68ef('0x31')],_0x3452d1[_0x68ef('0x2c')]);_0x4cc80a[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x3452d1[_0x68ef('0x31')],qs['fields'](_0x13db31[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x4cc80a['attributes']=_0x4cc80a[_0x68ef('0x34')][_0x68ef('0x36')]?_0x4cc80a[_0x68ef('0x34')]:_0x3452d1[_0x68ef('0x31')];_0x4cc80a['order']=qs[_0x68ef('0x50')](_0x13db31[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x4cc80a['where']=qs[_0x68ef('0x4d')](_['pick'](_0x13db31['query'],_0x3452d1['filters']));if(_0x13db31[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x4cc80a['where']=_[_0x68ef('0x37')](_0x4cc80a['where'],{'$or':_['map'](_0x4cc80a[_0x68ef('0x34')],function(_0x103585){var _0xa28738={};_0xa28738[_0x103585]={'$like':'%'+_0x13db31[_0x68ef('0x2c')][_0x68ef('0x53')]+'%'};return _0xa28738;})});}_0x4cc80a=_[_0x68ef('0x37')]({},_0x4cc80a,_0x13db31[_0x68ef('0x38')]);return _0x1c5b4a[_0x68ef('0x8e')](_0x4cc80a);}})[_0x68ef('0x18')](function(_0xcd5609){if(_0xcd5609){_0x33dd03=_0xcd5609[_0x68ef('0x36')];if(!_0x13db31['query'][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x4cc80a['limit']=qs[_0x68ef('0x14')](_0x13db31['query'][_0x68ef('0x14')]);_0x4cc80a[_0x68ef('0x12')]=qs[_0x68ef('0x12')](_0x13db31['query'][_0x68ef('0x12')]);}return _0x1c5b4a[_0x68ef('0x8e')](_0x4cc80a);}})[_0x68ef('0x18')](function(_0x799597){return _0x799597?{'count':_0x33dd03,'rows':_0x799597}:null;})[_0x68ef('0x18')](respondWithResult(_0x58800b,null))[_0x68ef('0x2f')](handleError(_0x58800b,null));};exports['getLists']=function(_0x5e4ec4,_0x40c6ec){var _0x4a45f9={};var _0x16ba3d={};var _0x405008;var _0x3ecec3;return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x5e4ec4[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x40c6ec,null))[_0x68ef('0x18')](function(_0x4d4bfa){if(_0x4d4bfa){_0x405008=_0x4d4bfa;_0x16ba3d[_0x68ef('0x31')]=_[_0x68ef('0x32')](db[_0x68ef('0x8f')]['rawAttributes']);_0x16ba3d[_0x68ef('0x2c')]=_[_0x68ef('0x32')](_0x5e4ec4[_0x68ef('0x2c')]);_0x16ba3d[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x16ba3d[_0x68ef('0x31')],_0x16ba3d[_0x68ef('0x2c')]);_0x4a45f9[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x16ba3d['model'],qs['fields'](_0x5e4ec4[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x4a45f9['attributes']=_0x4a45f9[_0x68ef('0x34')][_0x68ef('0x36')]?_0x4a45f9['attributes']:_0x16ba3d['model'];_0x4a45f9['order']=qs['sort'](_0x5e4ec4[_0x68ef('0x2c')]['sort']);_0x4a45f9[_0x68ef('0x51')]=qs['filters'](_[_0x68ef('0x52')](_0x5e4ec4[_0x68ef('0x2c')],_0x16ba3d['filters']));if(_0x5e4ec4['query']['filter']){_0x4a45f9[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x4a45f9[_0x68ef('0x51')],{'$or':_['map'](_0x4a45f9[_0x68ef('0x34')],function(_0x4898ad){var _0x22a810={};_0x22a810[_0x4898ad]={'$like':'%'+_0x5e4ec4['query'][_0x68ef('0x53')]+'%'};return _0x22a810;})});}_0x4a45f9=_[_0x68ef('0x37')]({},_0x4a45f9,_0x5e4ec4[_0x68ef('0x38')]);return _0x405008[_0x68ef('0x90')](_0x4a45f9);}})[_0x68ef('0x18')](function(_0x3f9113){if(_0x3f9113){_0x3ecec3=_0x3f9113[_0x68ef('0x36')];if(!_0x5e4ec4['query'][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x4a45f9[_0x68ef('0x14')]=qs[_0x68ef('0x14')](_0x5e4ec4[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x4a45f9[_0x68ef('0x12')]=qs['offset'](_0x5e4ec4[_0x68ef('0x2c')][_0x68ef('0x12')]);}return _0x405008[_0x68ef('0x90')](_0x4a45f9);}})[_0x68ef('0x18')](function(_0x2a93bf){if(_0x2a93bf){return _0x2a93bf?{'count':_0x3ecec3,'rows':_0x2a93bf}:null;}})[_0x68ef('0x18')](respondWithResult(_0x40c6ec,null))[_0x68ef('0x2f')](handleError(_0x40c6ec,null));};exports[_0x68ef('0x91')]=function(_0x2d0bf5,_0x40da26){var _0x202e78=moment()[_0x68ef('0x70')]('YYYY-MM-DD\x20HH:mm:ss');var _0x253b31,_0x14b845;return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x2d0bf5['params']['id']}})['then'](handleEntityNotFound(_0x40da26,null))['then'](function(_0x2e6bcf){if(_0x2e6bcf){_0x14b845=_0x2e6bcf;return _0x2e6bcf[_0x68ef('0x91')](_0x2d0bf5[_0x68ef('0x3a')][_0x68ef('0x75')],_['omit'](_0x2d0bf5['body'],['ids','id'])||{});}return null;})[_0x68ef('0x8b')](function(_0x12dbe5){var _0x547e6d;_0x253b31=_0x12dbe5||[];var _0x575f73=[];if(_0x12dbe5){for(var _0x6dc883=0x0;_0x6dc883<_0x12dbe5[_0x68ef('0x36')];_0x6dc883+=0x1){var _0x1dcc3e=_0x12dbe5[_0x6dc883][_0x68ef('0x3c')]({'plain':!![]});_0x14b845[_0x68ef('0x92')]=_0x2d0bf5[_0x68ef('0x3a')][_0x68ef('0x92')]?_0x2d0bf5['body'][_0x68ef('0x92')]:_0x14b845[_0x68ef('0x92')];switch(_0x14b845[_0x68ef('0x92')]){case _0x68ef('0x93'):_0x547e6d=squel[_0x68ef('0x94')]()['into'](_0x68ef('0x95'))[_0x68ef('0x96')](['phone',_0x68ef('0x97'),_0x68ef('0x98'),_0x68ef('0x99'),_0x68ef('0x57'),'createdAt',_0x68ef('0x44')],squel['select']()[_0x68ef('0x77')](_0x68ef('0x9a'),_0x68ef('0x9a'))['field']('\x27'+_0x202e78+'\x27',_0x68ef('0x97'))[_0x68ef('0x77')]('id','ContactId')['field'](_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')](),'ListId')['field'](_0x2d0bf5[_0x68ef('0x49')]['id'][_0x68ef('0x80')](),_0x68ef('0x57'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x45'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x44'))['from'](_0x68ef('0x9c'))[_0x68ef('0x51')](_0x68ef('0x9d'))[_0x68ef('0x51')](_0x68ef('0x9e'),_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')]())[_0x68ef('0x51')](_0x68ef('0x9f'))[_0x68ef('0x51')](_0x68ef('0xa0'),squel[_0x68ef('0x76')]()[_0x68ef('0x77')](_0x68ef('0xa1'))[_0x68ef('0x79')]('cm_hopper_final')['where'](_0x68ef('0xa2'),_0x2d0bf5[_0x68ef('0x49')]['id'][_0x68ef('0x80')]()))[_0x68ef('0x51')]('phone\x20NOT\x20IN\x20(?)',squel[_0x68ef('0x76')]()[_0x68ef('0x77')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x68ef('0x51')](_0x68ef('0xa2'),_0x2d0bf5[_0x68ef('0x49')]['id']['toString']())))[_0x68ef('0x80')]();break;case'onlyIfOpen':_0x547e6d=squel[_0x68ef('0x94')]()[_0x68ef('0xa3')](_0x68ef('0x95'))[_0x68ef('0x96')]([_0x68ef('0x9a'),_0x68ef('0x97'),_0x68ef('0x98'),_0x68ef('0x99'),_0x68ef('0x57'),_0x68ef('0x45'),_0x68ef('0x44')],squel[_0x68ef('0x76')]()['field'](_0x68ef('0x9a'),_0x68ef('0x9a'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x97'))[_0x68ef('0x77')]('id',_0x68ef('0x98'))['field'](_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')](),_0x68ef('0x99'))[_0x68ef('0x77')](_0x2d0bf5['params']['id']['toString'](),_0x68ef('0x57'))['field']('\x27'+_0x202e78+'\x27',_0x68ef('0x45'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x44'))[_0x68ef('0x79')](_0x68ef('0x9c'))[_0x68ef('0x51')](_0x68ef('0x9d'))[_0x68ef('0x51')](_0x68ef('0x9e'),_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')]())[_0x68ef('0x51')](_0x68ef('0x9f'))[_0x68ef('0x51')](_0x68ef('0xa0'),squel[_0x68ef('0x76')]()[_0x68ef('0x77')](_0x68ef('0xa4'))[_0x68ef('0x79')]('cm_hopper')['where'](_0x68ef('0xa2'),_0x2d0bf5[_0x68ef('0x49')]['id'][_0x68ef('0x80')]())))[_0x68ef('0x80')]();break;default:_0x547e6d=squel[_0x68ef('0x94')]()[_0x68ef('0xa3')]('cm_hopper')[_0x68ef('0x96')]([_0x68ef('0x9a'),_0x68ef('0x97'),_0x68ef('0x98'),_0x68ef('0x99'),'VoiceQueueId','createdAt',_0x68ef('0x44')],squel[_0x68ef('0x76')]()[_0x68ef('0x77')](_0x68ef('0x9a'),_0x68ef('0x9a'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x97'))['field']('id','ContactId')[_0x68ef('0x77')](_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')](),'ListId')[_0x68ef('0x77')](_0x2d0bf5[_0x68ef('0x49')]['id'][_0x68ef('0x80')](),_0x68ef('0x57'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x45'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x44'))['from'](_0x68ef('0x9c'))['where'](_0x68ef('0x9d'))[_0x68ef('0x51')](_0x68ef('0x9e'),_0x1dcc3e['CmListId'][_0x68ef('0x80')]())[_0x68ef('0x51')](_0x68ef('0x9f')))[_0x68ef('0x80')]();}_0x575f73[_0x68ef('0x7f')](db[_0x68ef('0x68')][_0x68ef('0x2c')](_0x547e6d));}return BPromise[_0x68ef('0x84')](_0x575f73);}})[_0x68ef('0x18')](function(){var _0x54b4cc=[];var _0x59637f=squel[_0x68ef('0x94')]()[_0x68ef('0xa3')](_0x68ef('0xa5'))['fromQuery']([_0x68ef('0xa6'),_0x68ef('0x9a'),_0x68ef('0xa7'),'createdAt','updatedAt'],squel[_0x68ef('0x76')]()[_0x68ef('0x77')](_0x68ef('0xa8'))[_0x68ef('0x77')](_0x68ef('0xa9'))[_0x68ef('0x77')]('ci.OrderBy+1')['field']('\x27'+_0x202e78+'\x27',_0x68ef('0x45'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x44'))['from'](_0x68ef('0xaa'),'ci')[_0x68ef('0x7b')](_0x68ef('0x95'),'h',_0x68ef('0xab'))[_0x68ef('0x51')]('h.scheduledat=?',_0x202e78)[_0x68ef('0x51')](_0x68ef('0xac'),_0x68ef('0xad')))['toString']();_0x54b4cc[_0x68ef('0x7f')](db[_0x68ef('0x68')][_0x68ef('0x2c')](_0x59637f));return BPromise[_0x68ef('0x84')](_0x54b4cc);})[_0x68ef('0x18')](function(){return _0x253b31;})[_0x68ef('0x18')](respondWithResult(_0x40da26,null))[_0x68ef('0x2f')](handleError(_0x40da26,null));};exports[_0x68ef('0xae')]=function(_0x58d5da,_0x1873b5){return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x58d5da[_0x68ef('0x49')]['id']}})['then'](handleEntityNotFound(_0x1873b5,null))[_0x68ef('0x18')](function(_0x351b99){if(_0x351b99){return _0x351b99[_0x68ef('0xae')](_0x58d5da[_0x68ef('0x2c')][_0x68ef('0x75')]);}})['then'](function(_0x5b41f0){if(_0x5b41f0){return db[_0x68ef('0x4c')]['destroy']({'where':{'ListId':_0x58d5da['query'][_0x68ef('0x75')],'VoiceQueueId':_0x58d5da[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](function(){return _0x5b41f0;});}})[_0x68ef('0x18')](respondWithStatusCode(_0x1873b5,null))[_0x68ef('0x2f')](handleError(_0x1873b5,null));};exports[_0x68ef('0xaf')]=function(_0x3ee069,_0x5f49e9){var _0x40cd91={};var _0x848118={};var _0x794d1e;var _0x266f6c;return db[_0x68ef('0x28')]['findOne']({'where':{'id':_0x3ee069[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x5f49e9,null))[_0x68ef('0x18')](function(_0x2b5994){if(_0x2b5994){_0x794d1e=_0x2b5994;_0x848118[_0x68ef('0x31')]=_[_0x68ef('0x32')](db[_0x68ef('0x8f')][_0x68ef('0x29')]);_0x848118['query']=_[_0x68ef('0x32')](_0x3ee069[_0x68ef('0x2c')]);_0x848118[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x848118[_0x68ef('0x31')],_0x848118[_0x68ef('0x2c')]);_0x40cd91[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x848118['model'],qs[_0x68ef('0x35')](_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x40cd91[_0x68ef('0x34')]=_0x40cd91[_0x68ef('0x34')]['length']?_0x40cd91[_0x68ef('0x34')]:_0x848118[_0x68ef('0x31')];_0x40cd91[_0x68ef('0x4f')]=qs[_0x68ef('0x50')](_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x40cd91[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x3ee069[_0x68ef('0x2c')],_0x848118[_0x68ef('0x4d')]));if(_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x40cd91['where']=_[_0x68ef('0x37')](_0x40cd91[_0x68ef('0x51')],{'$or':_[_0x68ef('0x1e')](_0x40cd91[_0x68ef('0x34')],function(_0x124eda){var _0x4b738d={};_0x4b738d[_0x124eda]={'$like':'%'+_0x3ee069[_0x68ef('0x2c')]['filter']+'%'};return _0x4b738d;})});}_0x40cd91=_['merge']({},_0x40cd91,_0x3ee069[_0x68ef('0x38')]);return _0x794d1e['getBlackLists'](_0x40cd91);}})['then'](function(_0x4210c0){if(_0x4210c0){_0x266f6c=_0x4210c0['length'];if(!_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x40cd91[_0x68ef('0x14')]=qs[_0x68ef('0x14')](_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x40cd91[_0x68ef('0x12')]=qs['offset'](_0x3ee069['query'][_0x68ef('0x12')]);}return _0x794d1e[_0x68ef('0xaf')](_0x40cd91);}})[_0x68ef('0x18')](function(_0x23946d){if(_0x23946d){return _0x23946d?{'count':_0x266f6c,'rows':_0x23946d}:null;}})[_0x68ef('0x18')](respondWithResult(_0x5f49e9,null))[_0x68ef('0x2f')](handleError(_0x5f49e9,null));};exports[_0x68ef('0xb0')]=function(_0xcc1765,_0x29662c){var _0x1185bd;return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0xcc1765['params']['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x29662c,null))['then'](function(_0x30876d){if(_0x30876d){return _0x30876d[_0x68ef('0xb0')](_0xcc1765[_0x68ef('0x3a')][_0x68ef('0x75')],_['omit'](_0xcc1765[_0x68ef('0x3a')],[_0x68ef('0x75'),'id'])||{});}return null;})[_0x68ef('0x8b')](function(_0x295b66){var _0x3455b5;_0x1185bd=_0x295b66||[];var _0xbf2168=[];if(_0x295b66){for(var _0x4cf8b6=0x0;_0x4cf8b6<_0x295b66[_0x68ef('0x36')];_0x4cf8b6+=0x1){var _0x4e3f0a=_0x295b66[_0x4cf8b6][_0x68ef('0x3c')]({'plain':!![]});_0x3455b5=squel[_0x68ef('0x94')]()[_0x68ef('0xa3')](_0x68ef('0xb1'))[_0x68ef('0x96')]([_0x68ef('0x9a'),'ContactId','ListId','VoiceQueueId',_0x68ef('0x45'),_0x68ef('0x44')],squel['select']()[_0x68ef('0x77')](_0x68ef('0x9a'),_0x68ef('0x9a'))[_0x68ef('0x77')]('id','ContactId')[_0x68ef('0x77')](_0x4e3f0a[_0x68ef('0x9b')][_0x68ef('0x80')](),_0x68ef('0x99'))[_0x68ef('0x77')](_0xcc1765[_0x68ef('0x49')]['id'][_0x68ef('0x80')](),_0x68ef('0x57'))[_0x68ef('0x77')](_0x68ef('0xb2'),'createdAt')[_0x68ef('0x77')](_0x68ef('0xb2'),_0x68ef('0x44'))[_0x68ef('0x79')]('cm_contacts')[_0x68ef('0x51')](_0x68ef('0x9d'))[_0x68ef('0x51')](_0x68ef('0x9e'),_0x4e3f0a['CmListId'][_0x68ef('0x80')]())[_0x68ef('0x51')](_0x68ef('0x9f')))['toString']();_0xbf2168['push'](db['sequelize'][_0x68ef('0x2c')](_0x3455b5));}return BPromise['all'](_0xbf2168);}})['then'](function(){return _0x1185bd;})[_0x68ef('0x18')](respondWithResult(_0x29662c,null))['catch'](handleError(_0x29662c,null));};exports[_0x68ef('0xb3')]=function(_0x398899,_0x8dd212){return db[_0x68ef('0x28')]['find']({'where':{'id':_0x398899[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x8dd212,null))[_0x68ef('0x18')](function(_0x57d305){if(_0x57d305){return _0x57d305[_0x68ef('0xb3')](_0x398899[_0x68ef('0x2c')][_0x68ef('0x75')]);}})['then'](function(_0x4c6756){if(_0x4c6756){return db[_0x68ef('0x5b')]['destroy']({'where':{'ListId':_0x398899[_0x68ef('0x2c')]['ids'],'VoiceQueueId':_0x398899['params']['id']}})['then'](function(){return _0x4c6756;});}})[_0x68ef('0x18')](respondWithStatusCode(_0x8dd212,null))[_0x68ef('0x2f')](handleError(_0x8dd212,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 28c34cd..1c744ce 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 _0xe2a9=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x4561d8,_0x300cdc){var _0x5e3777=function(_0x49dd64){while(--_0x49dd64){_0x4561d8['push'](_0x4561d8['shift']());}};_0x5e3777(++_0x300cdc);}(_0xe2a9,0x96));var _0x9e2a=function(_0x396f85,_0x452914){_0x396f85=_0x396f85-0x0;var _0xaae33b=_0xe2a9[_0x396f85];return _0xaae33b;};'use strict';var EventEmitter=require(_0x9e2a('0x0'));var VoiceQueue=require(_0x9e2a('0x1'))['db'][_0x9e2a('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x9e2a('0x3')](0x0);var events={'afterCreate':_0x9e2a('0x4'),'afterUpdate':_0x9e2a('0x5'),'afterDestroy':_0x9e2a('0x6')};function emitEvent(_0xffc99a){return function(_0x314a53,_0x4082f9,_0x5ee37f){VoiceQueueEvents[_0x9e2a('0x7')](_0xffc99a+':'+_0x314a53['id'],_0x314a53);VoiceQueueEvents['emit'](_0xffc99a,_0x314a53);_0x5ee37f(null);};}for(var e in events){if(events[_0x9e2a('0x8')](e)){var event=events[e];VoiceQueue[_0x9e2a('0x9')](e,emitEvent(event));}}module[_0x9e2a('0xa')]=VoiceQueueEvents; \ No newline at end of file +var _0x24ca=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x183f6f,_0x53195a){var _0x1637ef=function(_0x1b228e){while(--_0x1b228e){_0x183f6f['push'](_0x183f6f['shift']());}};_0x1637ef(++_0x53195a);}(_0x24ca,0x161));var _0xa24c=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0x24ca[_0x450689];return _0x46ffb0;};'use strict';var EventEmitter=require(_0xa24c('0x0'));var VoiceQueue=require(_0xa24c('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa24c('0x2')](0x0);var events={'afterCreate':_0xa24c('0x3'),'afterUpdate':_0xa24c('0x4'),'afterDestroy':_0xa24c('0x5')};function emitEvent(_0x412c4b){return function(_0x117f64,_0x3ad9f4,_0xb40f2c){VoiceQueueEvents[_0xa24c('0x6')](_0x412c4b+':'+_0x117f64['id'],_0x117f64);VoiceQueueEvents['emit'](_0x412c4b,_0x117f64);_0xb40f2c(null);};}for(var e in events){if(events[_0xa24c('0x7')](e)){var event=events[e];VoiceQueue[_0xa24c('0x8')](e,emitEvent(event));}}module[_0xa24c('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 bf2166f..2a0f0e5 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 _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1d83db,_0x89d115){var _0x2dc1d1=function(_0x13fdc3){while(--_0x13fdc3){_0x1d83db['push'](_0x1d83db['shift']());}};_0x2dc1d1(++_0x89d115);}(_0x55ca,0x126));var _0xa55c=function(_0x365a40,_0x5c073e){_0x365a40=_0x365a40-0x0;var _0x1dd6d5=_0x55ca[_0x365a40];return _0x1dd6d5;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x170d59,_0xd5808c){var _0x2886c8=function(_0x2ebd74){while(--_0x2ebd74){_0x170d59['push'](_0x170d59['shift']());}};_0x2886c8(++_0xd5808c);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a908d,_0x56bc38){_0x3a908d=_0x3a908d-0x0;var _0xd0abde=_0xedd9[_0x3a908d];return _0xd0abde;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 79a3b7f..6ae5941 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 _0x2273=['model','attributes','debug','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','map','include'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x2273,0x195));var _0x3227=function(_0x1471ba,_0x2e95f9){_0x1471ba=_0x1471ba-0x0;var _0x48deaa=_0x2273[_0x1471ba];return _0x48deaa;};'use strict';var _=require(_0x3227('0x0'));var util=require(_0x3227('0x1'));var moment=require(_0x3227('0x2'));var BPromise=require(_0x3227('0x3'));var rs=require(_0x3227('0x4'));var fs=require('fs');var Redis=require(_0x3227('0x5'));var db=require(_0x3227('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3227('0x7'))(_0x3227('0x8'));var config=require(_0x3227('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3227('0xa')]({'port':0x232a});config[_0x3227('0xb')]=_['defaults'](config[_0x3227('0xb')],{'host':_0x3227('0xc'),'port':0x18eb});var socket=require(_0x3227('0xd'))(new Redis(config['redis']));require(_0x3227('0xe'))[_0x3227('0xf')](socket);function respondWithRpcPromise(_0x262aac,_0x1ff374,_0x587d6d){return new BPromise(function(_0x5e7e3b,_0x25067a){return client[_0x3227('0x10')](_0x262aac,_0x587d6d)[_0x3227('0x11')](function(_0x4acb4d){logger[_0x3227('0x12')](_0x3227('0x13'),_0x1ff374,'request\x20sent');logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x1ff374,_0x3227('0x14'),JSON[_0x3227('0x15')](_0x4acb4d));if(_0x4acb4d['error']){if(_0x4acb4d[_0x3227('0x16')][_0x3227('0x17')]===0x1f4){logger[_0x3227('0x16')](_0x3227('0x13'),_0x1ff374,_0x4acb4d[_0x3227('0x16')]['message']);return _0x25067a(_0x4acb4d[_0x3227('0x16')][_0x3227('0x18')]);}logger[_0x3227('0x16')](_0x3227('0x13'),_0x1ff374,_0x4acb4d[_0x3227('0x16')][_0x3227('0x18')]);return _0x5e7e3b(_0x4acb4d[_0x3227('0x16')]['message']);}else{logger[_0x3227('0x12')](_0x3227('0x13'),_0x1ff374,_0x3227('0x14'));_0x5e7e3b(_0x4acb4d[_0x3227('0x19')][_0x3227('0x18')]);}})[_0x3227('0x1a')](function(_0xfa4815){logger[_0x3227('0x16')](_0x3227('0x13'),_0x1ff374,_0xfa4815);_0x25067a(_0xfa4815);});});}exports[_0x3227('0x1b')]=function(_0x21e7f4){var _0x51aa45=this;return new Promise(function(_0x59aab7,_0x25a0a5){return db[_0x3227('0x1c')][_0x3227('0x1d')]({'raw':_0x21e7f4[_0x3227('0x1e')]?_0x21e7f4[_0x3227('0x1e')][_0x3227('0x1f')]===undefined?!![]:![]:!![],'where':_0x21e7f4['options']?_0x21e7f4[_0x3227('0x1e')][_0x3227('0x20')]||null:null,'attributes':_0x21e7f4[_0x3227('0x1e')]?_0x21e7f4[_0x3227('0x1e')]['attributes']||null:null,'limit':_0x21e7f4[_0x3227('0x1e')]?_0x21e7f4[_0x3227('0x1e')]['limit']||null:null,'include':_0x21e7f4[_0x3227('0x1e')]?_0x21e7f4[_0x3227('0x1e')]['include']?_[_0x3227('0x21')](_0x21e7f4[_0x3227('0x1e')][_0x3227('0x22')],function(_0x16a43d){return{'model':db[_0x16a43d[_0x3227('0x23')]],'as':_0x16a43d['as'],'attributes':_0x16a43d[_0x3227('0x24')],'include':_0x16a43d[_0x3227('0x22')]?_[_0x3227('0x21')](_0x16a43d[_0x3227('0x22')],function(_0x87cf8){return{'model':db[_0x87cf8[_0x3227('0x23')]],'as':_0x87cf8['as'],'attributes':_0x87cf8['attributes'],'include':_0x87cf8[_0x3227('0x22')]?_[_0x3227('0x21')](_0x87cf8['include'],function(_0x526848){return{'model':db[_0x526848['model']],'as':_0x526848['as'],'attributes':_0x526848['attributes']};}):[]};}):[]};}):[]:[]})[_0x3227('0x11')](function(_0xe1c0e9){logger[_0x3227('0x12')](_0x3227('0x1b'),_0x21e7f4);logger[_0x3227('0x25')](_0x3227('0x1b'),_0x21e7f4,JSON[_0x3227('0x15')](_0xe1c0e9));_0x59aab7(_0xe1c0e9);})['catch'](function(_0x424426){logger['error'](_0x3227('0x1b'),_0x424426['message'],_0x21e7f4);_0x25a0a5(_0x51aa45[_0x3227('0x16')](0x1f4,_0x424426[_0x3227('0x18')]));});});};exports[_0x3227('0x26')]=function(_0x40fbe1){var _0x3de37b=this;return new Promise(function(_0x1af2d8,_0x407078){return db[_0x3227('0x1c')][_0x3227('0x27')]({'raw':_0x40fbe1[_0x3227('0x1e')]?_0x40fbe1[_0x3227('0x1e')][_0x3227('0x1f')]===undefined?!![]:![]:!![],'where':_0x40fbe1[_0x3227('0x1e')]?_0x40fbe1['options']['where']||null:null,'attributes':_0x40fbe1[_0x3227('0x1e')]?_0x40fbe1['options'][_0x3227('0x24')]||null:null,'include':_0x40fbe1['options']?_0x40fbe1['options'][_0x3227('0x22')]?_[_0x3227('0x21')](_0x40fbe1[_0x3227('0x1e')][_0x3227('0x22')],function(_0x49ef86){return{'model':db[_0x49ef86[_0x3227('0x23')]],'as':_0x49ef86['as'],'attributes':_0x49ef86[_0x3227('0x24')],'include':_0x49ef86[_0x3227('0x22')]?_['map'](_0x49ef86[_0x3227('0x22')],function(_0x4001fe){return{'model':db[_0x4001fe['model']],'as':_0x4001fe['as'],'attributes':_0x4001fe[_0x3227('0x24')],'include':_0x4001fe[_0x3227('0x22')]?_['map'](_0x4001fe[_0x3227('0x22')],function(_0x5db59){return{'model':db[_0x5db59[_0x3227('0x23')]],'as':_0x5db59['as'],'attributes':_0x5db59[_0x3227('0x24')]};}):[]};}):[]};}):[]:[]})[_0x3227('0x11')](function(_0x40ca02){logger[_0x3227('0x12')](_0x3227('0x26'),_0x40fbe1);logger['debug'](_0x3227('0x26'),_0x40fbe1,JSON[_0x3227('0x15')](_0x40ca02));_0x1af2d8(_0x40ca02);})[_0x3227('0x1a')](function(_0x3ca86a){logger[_0x3227('0x16')](_0x3227('0x26'),_0x3ca86a[_0x3227('0x18')],_0x40fbe1);_0x407078(_0x3de37b['error'](0x1f4,_0x3ca86a[_0x3227('0x18')]));});});}; \ No newline at end of file +var _0xfcef=['attributes','include','map','model','then','find','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xfcef,0x7f));var _0xffce=function(_0x334dd6,_0x2025e8){_0x334dd6=_0x334dd6-0x0;var _0x3576c4=_0xfcef[_0x334dd6];return _0x3576c4;};'use strict';var _=require(_0xffce('0x0'));var util=require(_0xffce('0x1'));var moment=require(_0xffce('0x2'));var BPromise=require(_0xffce('0x3'));var rs=require(_0xffce('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffce('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xffce('0x6'))(_0xffce('0x7'));var config=require(_0xffce('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xffce('0x9')][_0xffce('0xa')]({'port':0x232a});config['redis']=_[_0xffce('0xb')](config[_0xffce('0xc')],{'host':_0xffce('0xd'),'port':0x18eb});var socket=require(_0xffce('0xe'))(new Redis(config[_0xffce('0xc')]));require(_0xffce('0xf'))[_0xffce('0x10')](socket);function respondWithRpcPromise(_0x464c97,_0x41c983,_0x25393d){return new BPromise(function(_0x4f6619,_0x2b4aaa){return client['request'](_0x464c97,_0x25393d)['then'](function(_0x5cec09){logger[_0xffce('0x11')](_0xffce('0x12'),_0x41c983,_0xffce('0x13'));logger[_0xffce('0x14')](_0xffce('0x15'),_0x41c983,_0xffce('0x13'),JSON[_0xffce('0x16')](_0x5cec09));if(_0x5cec09['error']){if(_0x5cec09['error']['code']===0x1f4){logger[_0xffce('0x17')](_0xffce('0x12'),_0x41c983,_0x5cec09[_0xffce('0x17')][_0xffce('0x18')]);return _0x2b4aaa(_0x5cec09[_0xffce('0x17')][_0xffce('0x18')]);}logger[_0xffce('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x41c983,_0x5cec09[_0xffce('0x17')][_0xffce('0x18')]);return _0x4f6619(_0x5cec09[_0xffce('0x17')]['message']);}else{logger[_0xffce('0x11')](_0xffce('0x12'),_0x41c983,_0xffce('0x13'));_0x4f6619(_0x5cec09[_0xffce('0x19')][_0xffce('0x18')]);}})[_0xffce('0x1a')](function(_0x53fbbf){logger[_0xffce('0x17')](_0xffce('0x12'),_0x41c983,_0x53fbbf);_0x2b4aaa(_0x53fbbf);});});}exports[_0xffce('0x1b')]=function(_0x164e9a){var _0x181ed9=this;return new Promise(function(_0x4abbc9,_0xef969){return db[_0xffce('0x1c')][_0xffce('0x1d')]({'raw':_0x164e9a[_0xffce('0x1e')]?_0x164e9a[_0xffce('0x1e')][_0xffce('0x1f')]===undefined?!![]:![]:!![],'where':_0x164e9a[_0xffce('0x1e')]?_0x164e9a[_0xffce('0x1e')][_0xffce('0x20')]||null:null,'attributes':_0x164e9a[_0xffce('0x1e')]?_0x164e9a['options'][_0xffce('0x21')]||null:null,'limit':_0x164e9a[_0xffce('0x1e')]?_0x164e9a[_0xffce('0x1e')]['limit']||null:null,'include':_0x164e9a[_0xffce('0x1e')]?_0x164e9a[_0xffce('0x1e')][_0xffce('0x22')]?_[_0xffce('0x23')](_0x164e9a[_0xffce('0x1e')]['include'],function(_0x2ac721){return{'model':db[_0x2ac721[_0xffce('0x24')]],'as':_0x2ac721['as'],'attributes':_0x2ac721['attributes'],'include':_0x2ac721[_0xffce('0x22')]?_[_0xffce('0x23')](_0x2ac721['include'],function(_0x12051f){return{'model':db[_0x12051f[_0xffce('0x24')]],'as':_0x12051f['as'],'attributes':_0x12051f['attributes'],'include':_0x12051f[_0xffce('0x22')]?_[_0xffce('0x23')](_0x12051f[_0xffce('0x22')],function(_0x13319a){return{'model':db[_0x13319a['model']],'as':_0x13319a['as'],'attributes':_0x13319a['attributes']};}):[]};}):[]};}):[]:[]})[_0xffce('0x25')](function(_0x150892){logger[_0xffce('0x11')]('GetVoiceQueue',_0x164e9a);logger[_0xffce('0x14')]('GetVoiceQueue',_0x164e9a,JSON['stringify'](_0x150892));_0x4abbc9(_0x150892);})[_0xffce('0x1a')](function(_0x1e6248){logger['error'](_0xffce('0x1b'),_0x1e6248[_0xffce('0x18')],_0x164e9a);_0xef969(_0x181ed9[_0xffce('0x17')](0x1f4,_0x1e6248[_0xffce('0x18')]));});});};exports['ShowVoiceQueue']=function(_0x12134){var _0x2d1315=this;return new Promise(function(_0x5bfe3f,_0x57f811){return db[_0xffce('0x1c')][_0xffce('0x26')]({'raw':_0x12134[_0xffce('0x1e')]?_0x12134[_0xffce('0x1e')][_0xffce('0x1f')]===undefined?!![]:![]:!![],'where':_0x12134['options']?_0x12134[_0xffce('0x1e')]['where']||null:null,'attributes':_0x12134[_0xffce('0x1e')]?_0x12134['options'][_0xffce('0x21')]||null:null,'include':_0x12134[_0xffce('0x1e')]?_0x12134[_0xffce('0x1e')][_0xffce('0x22')]?_['map'](_0x12134[_0xffce('0x1e')][_0xffce('0x22')],function(_0x10ad08){return{'model':db[_0x10ad08['model']],'as':_0x10ad08['as'],'attributes':_0x10ad08['attributes'],'include':_0x10ad08[_0xffce('0x22')]?_['map'](_0x10ad08[_0xffce('0x22')],function(_0x1edcff){return{'model':db[_0x1edcff[_0xffce('0x24')]],'as':_0x1edcff['as'],'attributes':_0x1edcff[_0xffce('0x21')],'include':_0x1edcff[_0xffce('0x22')]?_[_0xffce('0x23')](_0x1edcff['include'],function(_0x3fef09){return{'model':db[_0x3fef09[_0xffce('0x24')]],'as':_0x3fef09['as'],'attributes':_0x3fef09[_0xffce('0x21')]};}):[]};}):[]};}):[]:[]})[_0xffce('0x25')](function(_0x462a81){logger[_0xffce('0x11')](_0xffce('0x27'),_0x12134);logger[_0xffce('0x14')](_0xffce('0x27'),_0x12134,JSON['stringify'](_0x462a81));_0x5bfe3f(_0x462a81);})[_0xffce('0x1a')](function(_0xccb87f){logger[_0xffce('0x17')]('ShowVoiceQueue',_0xccb87f['message'],_0x12134);_0x57f811(_0x2d1315[_0xffce('0x17')](0x1f4,_0xccb87f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 44b71ce..40fe28b 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 _0xcbea=['register','length','voiceQueue:','./voiceQueue.events','update','removeListener'];(function(_0x18a7d6,_0x70da9f){var _0x484b85=function(_0x47be78){while(--_0x47be78){_0x18a7d6['push'](_0x18a7d6['shift']());}};_0x484b85(++_0x70da9f);}(_0xcbea,0xa5));var _0xacbe=function(_0x5af780,_0x58dcd2){_0x5af780=_0x5af780-0x0;var _0x37c2ad=_0xcbea[_0x5af780];return _0x37c2ad;};'use strict';var VoiceQueueEvents=require(_0xacbe('0x0'));var events=['save','remove',_0xacbe('0x1')];function createListener(_0x1c48ee,_0x15310e){return function(_0x28076a){_0x15310e['emit'](_0x1c48ee,_0x28076a);};}function removeListener(_0x427fa6,_0x331eb6){return function(){VoiceQueueEvents[_0xacbe('0x2')](_0x427fa6,_0x331eb6);};}exports[_0xacbe('0x3')]=function(_0x4582bc){for(var _0x3e66dd=0x0,_0xab7748=events[_0xacbe('0x4')];_0x3e66dd<_0xab7748;_0x3e66dd++){var _0x3d037f=events[_0x3e66dd];var _0x252c8f=createListener(_0xacbe('0x5')+_0x3d037f,_0x4582bc);VoiceQueueEvents['on'](_0x3d037f,_0x252c8f);}}; \ No newline at end of file +var _0x0940=['update','emit','removeListener','register','length','./voiceQueue.events','save'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x0940,0x1ef));var _0x0094=function(_0x3f70c9,_0x4c3ff3){_0x3f70c9=_0x3f70c9-0x0;var _0x222889=_0x0940[_0x3f70c9];return _0x222889;};'use strict';var VoiceQueueEvents=require(_0x0094('0x0'));var events=[_0x0094('0x1'),'remove',_0x0094('0x2')];function createListener(_0x10085d,_0x5e65d5){return function(_0x5ca2e9){_0x5e65d5[_0x0094('0x3')](_0x10085d,_0x5ca2e9);};}function removeListener(_0x2a3626,_0x4452c1){return function(){VoiceQueueEvents[_0x0094('0x4')](_0x2a3626,_0x4452c1);};}exports[_0x0094('0x5')]=function(_0x37a4de){for(var _0x59968a=0x0,_0x42c7b0=events[_0x0094('0x6')];_0x59968a<_0x42c7b0;_0x59968a++){var _0x2ac1f8=events[_0x59968a];var _0x17b1b7=createListener('voiceQueue:'+_0x2ac1f8,_0x37a4de);VoiceQueueEvents['on'](_0x2ac1f8,_0x17b1b7);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 585826f..c72945a 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 _0xaef7=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','put','update','delete','destroy','multer'];(function(_0x3fd373,_0x1913ca){var _0x58ff7e=function(_0x3bb091){while(--_0x3bb091){_0x3fd373['push'](_0x3fd373['shift']());}};_0x58ff7e(++_0x1913ca);}(_0xaef7,0x11d));var _0x7aef=function(_0x1648d7,_0x1a877f){_0x1648d7=_0x1648d7-0x0;var _0x8c6c7f=_0xaef7[_0x1648d7];return _0x8c6c7f;};'use strict';var multer=require(_0x7aef('0x0'));var util=require('util');var path=require(_0x7aef('0x1'));var timeout=require(_0x7aef('0x2'));var express=require(_0x7aef('0x3'));var router=express[_0x7aef('0x4')]();var fs_extra=require(_0x7aef('0x5'));var auth=require(_0x7aef('0x6'));var interaction=require(_0x7aef('0x7'));var config=require(_0x7aef('0x8'));var controller=require(_0x7aef('0x9'));router[_0x7aef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7aef('0xb'),auth[_0x7aef('0xc')](),controller[_0x7aef('0xd')]);router[_0x7aef('0xa')](_0x7aef('0xe'),auth[_0x7aef('0xc')](),controller[_0x7aef('0xf')]);router['get'](_0x7aef('0x10'),auth['isAuthenticated'](),controller[_0x7aef('0x11')]);router['post']('/',auth[_0x7aef('0xc')](),controller['create']);router[_0x7aef('0x12')](_0x7aef('0x10'),auth[_0x7aef('0xc')](),controller[_0x7aef('0x13')]);router[_0x7aef('0x14')](_0x7aef('0x10'),auth['isAuthenticated'](),controller[_0x7aef('0x15')]);module['exports']=router; \ No newline at end of file +var _0x7c51=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x482d06,_0x1c7c4a){var _0x3bdd88=function(_0x476f12){while(--_0x476f12){_0x482d06['push'](_0x482d06['shift']());}};_0x3bdd88(++_0x1c7c4a);}(_0x7c51,0xcf));var _0x17c5=function(_0x13ac60,_0x5ca661){_0x13ac60=_0x13ac60-0x0;var _0x2d55fe=_0x7c51[_0x13ac60];return _0x2d55fe;};'use strict';var multer=require(_0x17c5('0x0'));var util=require(_0x17c5('0x1'));var path=require('path');var timeout=require(_0x17c5('0x2'));var express=require(_0x17c5('0x3'));var router=express[_0x17c5('0x4')]();var fs_extra=require(_0x17c5('0x5'));var auth=require(_0x17c5('0x6'));var interaction=require(_0x17c5('0x7'));var config=require('../../config/environment');var controller=require(_0x17c5('0x8'));router[_0x17c5('0x9')]('/',auth[_0x17c5('0xa')](),controller['index']);router[_0x17c5('0x9')](_0x17c5('0xb'),auth['isAuthenticated'](),controller[_0x17c5('0xc')]);router[_0x17c5('0x9')](_0x17c5('0xd'),auth[_0x17c5('0xa')](),controller[_0x17c5('0xe')]);router[_0x17c5('0x9')](_0x17c5('0xf'),auth[_0x17c5('0xa')](),controller[_0x17c5('0x10')]);router[_0x17c5('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x17c5('0x12')](_0x17c5('0xf'),auth['isAuthenticated'](),controller[_0x17c5('0x13')]);router[_0x17c5('0x14')](_0x17c5('0xf'),auth[_0x17c5('0xa')](),controller[_0x17c5('0x15')]);module[_0x17c5('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 67ef2e0..d21528f 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 _0xa42d=['STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports'];(function(_0x5e28af,_0x54bbba){var _0x7be8f0=function(_0x45bca6){while(--_0x45bca6){_0x5e28af['push'](_0x5e28af['shift']());}};_0x7be8f0(++_0x54bbba);}(_0xa42d,0x6d));var _0xda42=function(_0x48e63e,_0x477f6d){_0x48e63e=_0x48e63e-0x0;var _0x41a1aa=_0xa42d[_0x48e63e];return _0x41a1aa;};'use strict';var Sequelize=require(_0xda42('0x0'));var moment=require(_0xda42('0x1'));module[_0xda42('0x2')]={'type':{'type':Sequelize[_0xda42('0x3')]},'uniqueid':{'type':Sequelize[_0xda42('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xda42('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xda42('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xda42('0x4')],'set':function(_0x8fbf85){var _0x18061b=moment(_0x8fbf85);var _0x3eacb8=moment(this[_0xda42('0x5')](_0xda42('0x6')))['format'](_0xda42('0x7'));var _0x1db5f1=_0x18061b[_0xda42('0x8')](_0x3eacb8,_0xda42('0x9'));this[_0xda42('0xa')](_0xda42('0xb'),_0x8fbf85);this[_0xda42('0xa')](_0xda42('0xc'),_0x1db5f1||null);}},'position':{'type':Sequelize[_0xda42('0xd')]},'count':{'type':Sequelize[_0xda42('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xda42('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xda42('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xda42('0x4')]},'queuecallerexit':{'type':Sequelize[_0xda42('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xda42('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xda42('0xd')]},'channel':{'type':Sequelize[_0xda42('0x3')]},'connectedlinenum':{'type':Sequelize[_0xda42('0x3')]},'connectedlinename':{'type':Sequelize[_0xda42('0x3')]},'accountcode':{'type':Sequelize[_0xda42('0x3')]},'context':{'type':Sequelize[_0xda42('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xda42('0x3')]},'holdtime':{'type':Sequelize[_0xda42('0xd')]},'mohtime':{'type':Sequelize[_0xda42('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xda42('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xda42('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xda42('0x3')],'comment':_0xda42('0xf')},'transferexten':{'type':Sequelize[_0xda42('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xda42('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xda42('0xd')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5e64=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime'];(function(_0x5ece50,_0x2b7411){var _0xa73f6a=function(_0x4ab5c5){while(--_0x4ab5c5){_0x5ece50['push'](_0x5ece50['shift']());}};_0xa73f6a(++_0x2b7411);}(_0x5e64,0x18b));var _0x45e6=function(_0x278748,_0xbb025f){_0x278748=_0x278748-0x0;var _0x28d33c=_0x5e64[_0x278748];return _0x28d33c;};'use strict';var Sequelize=require(_0x45e6('0x0'));var moment=require(_0x45e6('0x1'));module['exports']={'type':{'type':Sequelize[_0x45e6('0x2')]},'uniqueid':{'type':Sequelize[_0x45e6('0x2')]},'calleridnum':{'type':Sequelize[_0x45e6('0x2')]},'calleridname':{'type':Sequelize[_0x45e6('0x2')]},'queue':{'type':Sequelize[_0x45e6('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x45e6('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x36006b){var _0x2364ff=moment(_0x36006b);var _0x1daef8=moment(this[_0x45e6('0x4')](_0x45e6('0x5')))[_0x45e6('0x6')](_0x45e6('0x7'));var _0x40b72a=_0x2364ff[_0x45e6('0x8')](_0x1daef8,_0x45e6('0x9'));this[_0x45e6('0xa')](_0x45e6('0xb'),_0x36006b);this['setDataValue'](_0x45e6('0xc'),_0x40b72a||null);}},'position':{'type':Sequelize[_0x45e6('0xd')]},'count':{'type':Sequelize[_0x45e6('0xd')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x45e6('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x45e6('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x45e6('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x45e6('0xf')},'originalposition':{'type':Sequelize[_0x45e6('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x45e6('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x45e6('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x45e6('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x45e6('0xd')]},'mohtime':{'type':Sequelize[_0x45e6('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x45e6('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x45e6('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x45e6('0x2')],'comment':_0x45e6('0x10')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x45e6('0x2')]},'disposition':{'type':Sequelize[_0x45e6('0x2')]},'secondDisposition':{'type':Sequelize[_0x45e6('0x2')]},'thirdDisposition':{'type':Sequelize[_0x45e6('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 61a7320..cccf0ec 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 _0x331b=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','rows','catch','show','params','keys','includeAll','options','find','create','body','update','describe','getVoiceQueuesReport','nolimit','findAll'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x331b,0x148));var _0xb331=function(_0x45c518,_0x48d0a7){_0x45c518=_0x45c518-0x0;var _0x498809=_0x331b[_0x45c518];return _0x498809;};'use strict';var emlformat=require(_0xb331('0x0'));var rimraf=require(_0xb331('0x1'));var zipdir=require(_0xb331('0x2'));var jsonpatch=require(_0xb331('0x3'));var rp=require(_0xb331('0x4'));var moment=require(_0xb331('0x5'));var BPromise=require(_0xb331('0x6'));var Mustache=require('mustache');var util=require(_0xb331('0x7'));var path=require(_0xb331('0x8'));var sox=require(_0xb331('0x9'));var csv=require(_0xb331('0xa'));var ejs=require(_0xb331('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb331('0xc'));var squel=require(_0xb331('0xd'));var crypto=require(_0xb331('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb331('0xf'));var toCsv=require(_0xb331('0xa'));var querystring=require('querystring');var Papa=require(_0xb331('0x10'));var Redis=require('ioredis');var authService=require(_0xb331('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb331('0x12'));var hardwareService=require(_0xb331('0x13'));var logger=require('../../config/logger')(_0xb331('0x14'));var utils=require(_0xb331('0x15'));var config=require(_0xb331('0x16'));var licenseUtil=require(_0xb331('0x17'));var db=require('../../mysqldb')['db'];config[_0xb331('0x18')]=_[_0xb331('0x19')](config[_0xb331('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb331('0x1a'))(new Redis(config[_0xb331('0x18')]));require(_0xb331('0x1b'))[_0xb331('0x1c')](socket);function respondWithStatusCode(_0x5ad108,_0x25746b){_0x25746b=_0x25746b||0xcc;return function(_0x2f0347){if(_0x2f0347){return _0x5ad108[_0xb331('0x1d')](_0x25746b);}return _0x5ad108['status'](_0x25746b)[_0xb331('0x1e')]();};}function respondWithResult(_0x20a7dd,_0x6da9ca){_0x6da9ca=_0x6da9ca||0xc8;return function(_0xc77568){if(_0xc77568){return _0x20a7dd['status'](_0x6da9ca)[_0xb331('0x1f')](_0xc77568);}};}function respondWithFilteredResult(_0x274828,_0x29b956){return function(_0x1ddb20){if(_0x1ddb20){var _0x2df3e5=typeof _0x29b956[_0xb331('0x20')]===_0xb331('0x21')&&typeof _0x29b956['limit']===_0xb331('0x21');var _0x74a29f=_0x1ddb20[_0xb331('0x22')];var _0x24c7c9=_0x2df3e5?0x0:_0x29b956['offset'];var _0x12080c=_0x2df3e5?_0x1ddb20[_0xb331('0x22')]:_0x29b956[_0xb331('0x20')]+_0x29b956['limit'];var _0x42f8f7;if(_0x12080c>=_0x74a29f){_0x12080c=_0x74a29f;_0x42f8f7=0xc8;}else{_0x42f8f7=0xce;}_0x274828[_0xb331('0x23')](_0x42f8f7);return _0x274828[_0xb331('0x24')](_0xb331('0x25'),_0x24c7c9+'-'+_0x12080c+'/'+_0x74a29f)[_0xb331('0x1f')](_0x1ddb20);}return null;};}function patchUpdates(_0x239a3e){return function(_0x13cce3){try{jsonpatch[_0xb331('0x26')](_0x13cce3,_0x239a3e,!![]);}catch(_0x4af6fb){return BPromise[_0xb331('0x27')](_0x4af6fb);}return _0x13cce3['save']();};}function saveUpdates(_0x3633da,_0x4f6431){return function(_0x448506){if(_0x448506){return _0x448506['update'](_0x3633da)[_0xb331('0x28')](function(_0x64e418){return _0x64e418;});}return null;};}function removeEntity(_0x19a9d0,_0x474ce7){return function(_0x6afe5a){if(_0x6afe5a){return _0x6afe5a[_0xb331('0x29')]()[_0xb331('0x28')](function(){_0x19a9d0[_0xb331('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26af88,_0x423cfe){return function(_0xd50c16){if(!_0xd50c16){_0x26af88[_0xb331('0x1d')](0x194);}return _0xd50c16;};}function handleError(_0x55e38f,_0x2444ce){_0x2444ce=_0x2444ce||0x1f4;return function(_0x1559e7){logger[_0xb331('0x2a')](_0x1559e7['stack']);if(_0x1559e7[_0xb331('0x2b')]){delete _0x1559e7[_0xb331('0x2b')];}_0x55e38f[_0xb331('0x23')](_0x2444ce)[_0xb331('0x2c')](_0x1559e7);};}exports[_0xb331('0x2d')]=function(_0x433683,_0x52f503){var _0x552dc7={},_0x16c23d={},_0x24ccc9={'count':0x0,'rows':[]};var _0x193081=_[_0xb331('0x2e')](db[_0xb331('0x2f')][_0xb331('0x30')],function(_0x4cd5b3){return{'name':_0x4cd5b3['fieldName'],'type':_0x4cd5b3[_0xb331('0x31')][_0xb331('0x32')]};});_0x16c23d[_0xb331('0x33')]=_[_0xb331('0x2e')](_0x193081,_0xb331('0x2b'));_0x16c23d[_0xb331('0x34')]=_['keys'](_0x433683['query']);_0x16c23d[_0xb331('0x35')]=_[_0xb331('0x36')](_0x16c23d['model'],_0x16c23d[_0xb331('0x34')]);_0x552dc7[_0xb331('0x37')]=_['intersection'](_0x16c23d[_0xb331('0x33')],qs['fields'](_0x433683['query'][_0xb331('0x38')]));_0x552dc7[_0xb331('0x37')]=_0x552dc7['attributes'][_0xb331('0x39')]?_0x552dc7['attributes']:_0x16c23d[_0xb331('0x33')];if(!_0x433683[_0xb331('0x34')][_0xb331('0x3a')]('nolimit')){_0x552dc7['limit']=qs[_0xb331('0x3b')](_0x433683[_0xb331('0x34')]['limit']);_0x552dc7['offset']=qs[_0xb331('0x20')](_0x433683[_0xb331('0x34')][_0xb331('0x20')]);}_0x552dc7[_0xb331('0x3c')]=qs[_0xb331('0x3d')](_0x433683['query']['sort']);_0x552dc7['where']=qs[_0xb331('0x35')](_[_0xb331('0x3e')](_0x433683[_0xb331('0x34')],_0x16c23d[_0xb331('0x35')]),_0x193081);if(_0x433683[_0xb331('0x34')][_0xb331('0x3f')]){_0x552dc7[_0xb331('0x40')]=_[_0xb331('0x41')](_0x552dc7[_0xb331('0x40')],{'$or':_[_0xb331('0x2e')](_0x193081,function(_0x10bcd8){if(_0x10bcd8['type']!==_0xb331('0x42')){var _0x594c13={};_0x594c13[_0x10bcd8['name']]={'$like':'%'+_0x433683[_0xb331('0x34')]['filter']+'%'};return _0x594c13;}})});}_0x552dc7=_[_0xb331('0x41')]({},_0x552dc7,_0x433683['options']);var _0x22afe0={'where':_0x552dc7[_0xb331('0x40')]};return db[_0xb331('0x2f')]['count'](_0x22afe0)[_0xb331('0x28')](function(_0x16d7f8){_0x24ccc9[_0xb331('0x22')]=_0x16d7f8;if(_0x433683[_0xb331('0x34')]['includeAll']){_0x552dc7['include']=[{'all':!![]}];}return db[_0xb331('0x2f')]['findAll'](_0x552dc7);})[_0xb331('0x28')](function(_0x5dcd53){_0x24ccc9[_0xb331('0x43')]=_0x5dcd53;return _0x24ccc9;})[_0xb331('0x28')](respondWithFilteredResult(_0x52f503,_0x552dc7))[_0xb331('0x44')](handleError(_0x52f503,null));};exports[_0xb331('0x45')]=function(_0x329126,_0x951305){var _0x364ee8={'raw':![],'where':{'id':_0x329126[_0xb331('0x46')]['id']}},_0x14aa31={};_0x14aa31[_0xb331('0x33')]=_[_0xb331('0x47')](db[_0xb331('0x2f')][_0xb331('0x30')]);_0x14aa31[_0xb331('0x34')]=_[_0xb331('0x47')](_0x329126[_0xb331('0x34')]);_0x14aa31[_0xb331('0x35')]=_[_0xb331('0x36')](_0x14aa31[_0xb331('0x33')],_0x14aa31[_0xb331('0x34')]);_0x364ee8[_0xb331('0x37')]=_[_0xb331('0x36')](_0x14aa31[_0xb331('0x33')],qs[_0xb331('0x38')](_0x329126[_0xb331('0x34')][_0xb331('0x38')]));_0x364ee8[_0xb331('0x37')]=_0x364ee8['attributes'][_0xb331('0x39')]?_0x364ee8[_0xb331('0x37')]:_0x14aa31[_0xb331('0x33')];if(_0x329126[_0xb331('0x34')][_0xb331('0x48')]){_0x364ee8['include']=[{'all':!![]}];}_0x364ee8=_['merge']({},_0x364ee8,_0x329126[_0xb331('0x49')]);return db[_0xb331('0x2f')][_0xb331('0x4a')](_0x364ee8)[_0xb331('0x28')](handleEntityNotFound(_0x951305,null))[_0xb331('0x28')](respondWithResult(_0x951305,null))[_0xb331('0x44')](handleError(_0x951305,null));};exports[_0xb331('0x4b')]=function(_0x1e3208,_0x48f468){return db[_0xb331('0x2f')][_0xb331('0x4b')](_0x1e3208[_0xb331('0x4c')],{})[_0xb331('0x28')](respondWithResult(_0x48f468,0xc9))[_0xb331('0x44')](handleError(_0x48f468,null));};exports[_0xb331('0x4d')]=function(_0x5bb899,_0x1ba981){if(_0x5bb899['body']['id']){delete _0x5bb899[_0xb331('0x4c')]['id'];}return db[_0xb331('0x2f')][_0xb331('0x4a')]({'where':{'id':_0x5bb899[_0xb331('0x46')]['id']}})[_0xb331('0x28')](handleEntityNotFound(_0x1ba981,null))['then'](saveUpdates(_0x5bb899[_0xb331('0x4c')],null))[_0xb331('0x28')](respondWithResult(_0x1ba981,null))[_0xb331('0x44')](handleError(_0x1ba981,null));};exports[_0xb331('0x29')]=function(_0x2cee21,_0x5e1397){return db[_0xb331('0x2f')][_0xb331('0x4a')]({'where':{'id':_0x2cee21[_0xb331('0x46')]['id']}})[_0xb331('0x28')](handleEntityNotFound(_0x5e1397,null))[_0xb331('0x28')](removeEntity(_0x5e1397,null))[_0xb331('0x44')](handleError(_0x5e1397,null));};exports[_0xb331('0x4e')]=function(_0x454da9,_0x240630){return db[_0xb331('0x2f')][_0xb331('0x4e')]()['then'](respondWithResult(_0x240630,null))[_0xb331('0x44')](handleError(_0x240630,null));};exports[_0xb331('0x4f')]=function(_0x1d90e8,_0x318097){var _0x393589={},_0x3a8df2={},_0xf25d09={'count':0x0,'rows':[]};_0x3a8df2[_0xb331('0x33')]=_[_0xb331('0x47')](db[_0xb331('0x2f')][_0xb331('0x30')]);_0x3a8df2[_0xb331('0x34')]=_[_0xb331('0x47')](_0x1d90e8[_0xb331('0x34')]);_0x3a8df2['filters']=_[_0xb331('0x36')](_0x3a8df2[_0xb331('0x33')],_0x3a8df2[_0xb331('0x34')]);_0x393589[_0xb331('0x37')]=_[_0xb331('0x36')](_0x3a8df2[_0xb331('0x33')],qs[_0xb331('0x38')](_0x1d90e8[_0xb331('0x34')][_0xb331('0x38')]));_0x393589[_0xb331('0x37')]=_0x393589['attributes']['length']?_0x393589[_0xb331('0x37')]:_0x3a8df2[_0xb331('0x33')];if(!_0x1d90e8['query'][_0xb331('0x3a')](_0xb331('0x50'))){_0x393589['limit']=qs[_0xb331('0x3b')](_0x1d90e8[_0xb331('0x34')]['limit']);_0x393589['offset']=qs[_0xb331('0x20')](_0x1d90e8[_0xb331('0x34')][_0xb331('0x20')]);}_0x393589[_0xb331('0x3c')]=qs[_0xb331('0x3d')](_0x1d90e8['query'][_0xb331('0x3d')]);_0x393589[_0xb331('0x40')]=qs['filters'](_[_0xb331('0x3e')](_0x1d90e8[_0xb331('0x34')],_0x3a8df2['filters']));if(_0x1d90e8[_0xb331('0x34')][_0xb331('0x3f')]){_0x393589['where']=_[_0xb331('0x41')](_0x393589[_0xb331('0x40')],{'$or':_[_0xb331('0x2e')](_0x393589[_0xb331('0x37')],function(_0x1515dc){var _0x32c588={};_0x32c588[_0x1515dc]={'$like':'%'+_0x1d90e8[_0xb331('0x34')]['filter']+'%'};return _0x32c588;})});}_0x393589=_[_0xb331('0x41')]({},_0x393589,_0x1d90e8[_0xb331('0x49')]);var _0xa60597={'where':_0x393589[_0xb331('0x40')]};return db['VoiceQueueReport']['count'](_0xa60597)[_0xb331('0x28')](function(_0x50a42e){_0xf25d09['count']=_0x50a42e;if(_0x1d90e8['query']['includeAll']){_0x393589['include']=[{'all':!![]}];}return db[_0xb331('0x2f')][_0xb331('0x51')](_0x393589);})['then'](function(_0x1f159b){_0xf25d09['rows']=_0x1f159b;return _0xf25d09;})[_0xb331('0x28')](respondWithFilteredResult(_0x318097,_0x393589,_0xb331('0x4f')))[_0xb331('0x44')](handleError(_0x318097,null,_0xb331('0x4f')));}; \ No newline at end of file +var _0xc149=['end','limit','undefined','offset','count','set','json','reject','save','then','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','destroy','getVoiceQueuesReport','eml-format','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','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./voiceQueueReport.socket','register','sendStatus','status'];(function(_0x448970,_0x44b9b4){var _0x2fa420=function(_0x10a754){while(--_0x10a754){_0x448970['push'](_0x448970['shift']());}};_0x2fa420(++_0x44b9b4);}(_0xc149,0x125));var _0x9c14=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xc149[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x9c14('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c14('0x1'));var jsonpatch=require(_0x9c14('0x2'));var rp=require(_0x9c14('0x3'));var moment=require(_0x9c14('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c14('0x5'));var util=require(_0x9c14('0x6'));var path=require(_0x9c14('0x7'));var sox=require(_0x9c14('0x8'));var csv=require(_0x9c14('0x9'));var ejs=require(_0x9c14('0xa'));var fs=require('fs');var fs_extra=require(_0x9c14('0xb'));var _=require(_0x9c14('0xc'));var squel=require(_0x9c14('0xd'));var crypto=require(_0x9c14('0xe'));var jsforce=require(_0x9c14('0xf'));var deskjs=require(_0x9c14('0x10'));var toCsv=require(_0x9c14('0x9'));var querystring=require(_0x9c14('0x11'));var Papa=require(_0x9c14('0x12'));var Redis=require(_0x9c14('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c14('0x14'));var logger=require(_0x9c14('0x15'))('api');var utils=require(_0x9c14('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9c14('0x17'));var db=require(_0x9c14('0x18'))['db'];config[_0x9c14('0x19')]=_[_0x9c14('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c14('0x19')]));require(_0x9c14('0x1b'))[_0x9c14('0x1c')](socket);function respondWithStatusCode(_0x1b48f5,_0x470bf2){_0x470bf2=_0x470bf2||0xcc;return function(_0x4252bd){if(_0x4252bd){return _0x1b48f5[_0x9c14('0x1d')](_0x470bf2);}return _0x1b48f5[_0x9c14('0x1e')](_0x470bf2)[_0x9c14('0x1f')]();};}function respondWithResult(_0x5ba87b,_0x3dae4f){_0x3dae4f=_0x3dae4f||0xc8;return function(_0x439a26){if(_0x439a26){return _0x5ba87b['status'](_0x3dae4f)['json'](_0x439a26);}};}function respondWithFilteredResult(_0x31c62b,_0x26165b){return function(_0xcbae5){if(_0xcbae5){var _0x2b6140=typeof _0x26165b['offset']==='undefined'&&typeof _0x26165b[_0x9c14('0x20')]===_0x9c14('0x21');var _0x16bb60=_0xcbae5['count'];var _0x21cbe0=_0x2b6140?0x0:_0x26165b[_0x9c14('0x22')];var _0x393ba8=_0x2b6140?_0xcbae5[_0x9c14('0x23')]:_0x26165b['offset']+_0x26165b[_0x9c14('0x20')];var _0x48e3af;if(_0x393ba8>=_0x16bb60){_0x393ba8=_0x16bb60;_0x48e3af=0xc8;}else{_0x48e3af=0xce;}_0x31c62b[_0x9c14('0x1e')](_0x48e3af);return _0x31c62b[_0x9c14('0x24')]('Content-Range',_0x21cbe0+'-'+_0x393ba8+'/'+_0x16bb60)[_0x9c14('0x25')](_0xcbae5);}return null;};}function patchUpdates(_0x223c06){return function(_0x57f1e0){try{jsonpatch['apply'](_0x57f1e0,_0x223c06,!![]);}catch(_0x50eac0){return BPromise[_0x9c14('0x26')](_0x50eac0);}return _0x57f1e0[_0x9c14('0x27')]();};}function saveUpdates(_0x5c4843,_0x431b80){return function(_0x2b909a){if(_0x2b909a){return _0x2b909a['update'](_0x5c4843)['then'](function(_0x54e255){return _0x54e255;});}return null;};}function removeEntity(_0x40e1b2,_0x11abbd){return function(_0x1d57c8){if(_0x1d57c8){return _0x1d57c8['destroy']()[_0x9c14('0x28')](function(){_0x40e1b2[_0x9c14('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34e68d,_0x1052d2){return function(_0x4d4d79){if(!_0x4d4d79){_0x34e68d[_0x9c14('0x1d')](0x194);}return _0x4d4d79;};}function handleError(_0x54cc70,_0x2d800a){_0x2d800a=_0x2d800a||0x1f4;return function(_0x1a7c6f){logger[_0x9c14('0x29')](_0x1a7c6f[_0x9c14('0x2a')]);if(_0x1a7c6f[_0x9c14('0x2b')]){delete _0x1a7c6f[_0x9c14('0x2b')];}_0x54cc70['status'](_0x2d800a)[_0x9c14('0x2c')](_0x1a7c6f);};}exports[_0x9c14('0x2d')]=function(_0x5d0fd7,_0x22a737){var _0x48c64b={},_0x441d0a={},_0x3029a7={'count':0x0,'rows':[]};var _0x1bf4a7=_[_0x9c14('0x2e')](db[_0x9c14('0x2f')][_0x9c14('0x30')],function(_0x5cd0c6){return{'name':_0x5cd0c6[_0x9c14('0x31')],'type':_0x5cd0c6[_0x9c14('0x32')][_0x9c14('0x33')]};});_0x441d0a[_0x9c14('0x34')]=_['map'](_0x1bf4a7,'name');_0x441d0a[_0x9c14('0x35')]=_['keys'](_0x5d0fd7['query']);_0x441d0a['filters']=_[_0x9c14('0x36')](_0x441d0a[_0x9c14('0x34')],_0x441d0a['query']);_0x48c64b[_0x9c14('0x37')]=_[_0x9c14('0x36')](_0x441d0a['model'],qs['fields'](_0x5d0fd7[_0x9c14('0x35')][_0x9c14('0x38')]));_0x48c64b[_0x9c14('0x37')]=_0x48c64b[_0x9c14('0x37')][_0x9c14('0x39')]?_0x48c64b[_0x9c14('0x37')]:_0x441d0a['model'];if(!_0x5d0fd7[_0x9c14('0x35')]['hasOwnProperty'](_0x9c14('0x3a'))){_0x48c64b['limit']=qs[_0x9c14('0x20')](_0x5d0fd7['query'][_0x9c14('0x20')]);_0x48c64b[_0x9c14('0x22')]=qs[_0x9c14('0x22')](_0x5d0fd7['query'][_0x9c14('0x22')]);}_0x48c64b[_0x9c14('0x3b')]=qs[_0x9c14('0x3c')](_0x5d0fd7[_0x9c14('0x35')]['sort']);_0x48c64b[_0x9c14('0x3d')]=qs[_0x9c14('0x3e')](_[_0x9c14('0x3f')](_0x5d0fd7['query'],_0x441d0a[_0x9c14('0x3e')]),_0x1bf4a7);if(_0x5d0fd7[_0x9c14('0x35')][_0x9c14('0x40')]){_0x48c64b[_0x9c14('0x3d')]=_[_0x9c14('0x41')](_0x48c64b[_0x9c14('0x3d')],{'$or':_[_0x9c14('0x2e')](_0x1bf4a7,function(_0x238c78){if(_0x238c78[_0x9c14('0x32')]!=='VIRTUAL'){var _0x934428={};_0x934428[_0x238c78['name']]={'$like':'%'+_0x5d0fd7[_0x9c14('0x35')][_0x9c14('0x40')]+'%'};return _0x934428;}})});}_0x48c64b=_[_0x9c14('0x41')]({},_0x48c64b,_0x5d0fd7[_0x9c14('0x42')]);var _0x1e9353={'where':_0x48c64b[_0x9c14('0x3d')]};return db['VoiceQueueReport'][_0x9c14('0x23')](_0x1e9353)[_0x9c14('0x28')](function(_0x2e29ea){_0x3029a7[_0x9c14('0x23')]=_0x2e29ea;if(_0x5d0fd7[_0x9c14('0x35')][_0x9c14('0x43')]){_0x48c64b[_0x9c14('0x44')]=[{'all':!![]}];}return db[_0x9c14('0x2f')][_0x9c14('0x45')](_0x48c64b);})[_0x9c14('0x28')](function(_0x41d5fc){_0x3029a7[_0x9c14('0x46')]=_0x41d5fc;return _0x3029a7;})['then'](respondWithFilteredResult(_0x22a737,_0x48c64b))[_0x9c14('0x47')](handleError(_0x22a737,null));};exports[_0x9c14('0x48')]=function(_0xfb1f14,_0x4b370a){var _0x4881ba={'raw':![],'where':{'id':_0xfb1f14[_0x9c14('0x49')]['id']}},_0x439d00={};_0x439d00[_0x9c14('0x34')]=_[_0x9c14('0x4a')](db['VoiceQueueReport'][_0x9c14('0x30')]);_0x439d00[_0x9c14('0x35')]=_['keys'](_0xfb1f14[_0x9c14('0x35')]);_0x439d00[_0x9c14('0x3e')]=_['intersection'](_0x439d00[_0x9c14('0x34')],_0x439d00[_0x9c14('0x35')]);_0x4881ba['attributes']=_[_0x9c14('0x36')](_0x439d00[_0x9c14('0x34')],qs[_0x9c14('0x38')](_0xfb1f14[_0x9c14('0x35')]['fields']));_0x4881ba[_0x9c14('0x37')]=_0x4881ba[_0x9c14('0x37')][_0x9c14('0x39')]?_0x4881ba[_0x9c14('0x37')]:_0x439d00[_0x9c14('0x34')];if(_0xfb1f14[_0x9c14('0x35')][_0x9c14('0x43')]){_0x4881ba['include']=[{'all':!![]}];}_0x4881ba=_['merge']({},_0x4881ba,_0xfb1f14[_0x9c14('0x42')]);return db[_0x9c14('0x2f')][_0x9c14('0x4b')](_0x4881ba)[_0x9c14('0x28')](handleEntityNotFound(_0x4b370a,null))['then'](respondWithResult(_0x4b370a,null))[_0x9c14('0x47')](handleError(_0x4b370a,null));};exports['create']=function(_0x1ea1be,_0x4967c8){return db['VoiceQueueReport'][_0x9c14('0x4c')](_0x1ea1be[_0x9c14('0x4d')],{})[_0x9c14('0x28')](respondWithResult(_0x4967c8,0xc9))[_0x9c14('0x47')](handleError(_0x4967c8,null));};exports[_0x9c14('0x4e')]=function(_0x188dc1,_0x511d81){if(_0x188dc1[_0x9c14('0x4d')]['id']){delete _0x188dc1[_0x9c14('0x4d')]['id'];}return db[_0x9c14('0x2f')][_0x9c14('0x4b')]({'where':{'id':_0x188dc1[_0x9c14('0x49')]['id']}})['then'](handleEntityNotFound(_0x511d81,null))[_0x9c14('0x28')](saveUpdates(_0x188dc1[_0x9c14('0x4d')],null))[_0x9c14('0x28')](respondWithResult(_0x511d81,null))[_0x9c14('0x47')](handleError(_0x511d81,null));};exports[_0x9c14('0x4f')]=function(_0x5abdf2,_0x237167){return db[_0x9c14('0x2f')][_0x9c14('0x4b')]({'where':{'id':_0x5abdf2[_0x9c14('0x49')]['id']}})[_0x9c14('0x28')](handleEntityNotFound(_0x237167,null))[_0x9c14('0x28')](removeEntity(_0x237167,null))[_0x9c14('0x47')](handleError(_0x237167,null));};exports['describe']=function(_0x3e072c,_0x56ec9c){return db['VoiceQueueReport']['describe']()[_0x9c14('0x28')](respondWithResult(_0x56ec9c,null))['catch'](handleError(_0x56ec9c,null));};exports[_0x9c14('0x50')]=function(_0x3db443,_0x452d75){var _0x16dec9={},_0x32fae3={},_0x30f13f={'count':0x0,'rows':[]};_0x32fae3['model']=_[_0x9c14('0x4a')](db['VoiceQueueReport'][_0x9c14('0x30')]);_0x32fae3[_0x9c14('0x35')]=_[_0x9c14('0x4a')](_0x3db443[_0x9c14('0x35')]);_0x32fae3[_0x9c14('0x3e')]=_[_0x9c14('0x36')](_0x32fae3['model'],_0x32fae3['query']);_0x16dec9['attributes']=_[_0x9c14('0x36')](_0x32fae3[_0x9c14('0x34')],qs[_0x9c14('0x38')](_0x3db443[_0x9c14('0x35')][_0x9c14('0x38')]));_0x16dec9[_0x9c14('0x37')]=_0x16dec9[_0x9c14('0x37')][_0x9c14('0x39')]?_0x16dec9[_0x9c14('0x37')]:_0x32fae3['model'];if(!_0x3db443[_0x9c14('0x35')]['hasOwnProperty']('nolimit')){_0x16dec9[_0x9c14('0x20')]=qs[_0x9c14('0x20')](_0x3db443['query'][_0x9c14('0x20')]);_0x16dec9[_0x9c14('0x22')]=qs[_0x9c14('0x22')](_0x3db443[_0x9c14('0x35')]['offset']);}_0x16dec9[_0x9c14('0x3b')]=qs[_0x9c14('0x3c')](_0x3db443[_0x9c14('0x35')]['sort']);_0x16dec9[_0x9c14('0x3d')]=qs[_0x9c14('0x3e')](_[_0x9c14('0x3f')](_0x3db443[_0x9c14('0x35')],_0x32fae3['filters']));if(_0x3db443[_0x9c14('0x35')]['filter']){_0x16dec9[_0x9c14('0x3d')]=_[_0x9c14('0x41')](_0x16dec9[_0x9c14('0x3d')],{'$or':_[_0x9c14('0x2e')](_0x16dec9[_0x9c14('0x37')],function(_0x3aadb3){var _0x390d8b={};_0x390d8b[_0x3aadb3]={'$like':'%'+_0x3db443[_0x9c14('0x35')][_0x9c14('0x40')]+'%'};return _0x390d8b;})});}_0x16dec9=_[_0x9c14('0x41')]({},_0x16dec9,_0x3db443[_0x9c14('0x42')]);var _0x22a904={'where':_0x16dec9['where']};return db['VoiceQueueReport']['count'](_0x22a904)[_0x9c14('0x28')](function(_0x2329ec){_0x30f13f['count']=_0x2329ec;if(_0x3db443[_0x9c14('0x35')][_0x9c14('0x43')]){_0x16dec9[_0x9c14('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x16dec9);})[_0x9c14('0x28')](function(_0x203e2c){_0x30f13f[_0x9c14('0x46')]=_0x203e2c;return _0x30f13f;})[_0x9c14('0x28')](respondWithFilteredResult(_0x452d75,_0x16dec9,_0x9c14('0x50')))[_0x9c14('0x47')](handleError(_0x452d75,null,_0x9c14('0x50')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index a437180..b4a506c 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 _0x7836=['update','remove','emit','hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x4917df,_0x51bfc0){var _0x2b4568=function(_0x46fa87){while(--_0x46fa87){_0x4917df['push'](_0x4917df['shift']());}};_0x2b4568(++_0x51bfc0);}(_0x7836,0xfc));var _0x6783=function(_0x184e69,_0x39af04){_0x184e69=_0x184e69-0x0;var _0x57d8ad=_0x7836[_0x184e69];return _0x57d8ad;};'use strict';var EventEmitter=require(_0x6783('0x0'));var VoiceQueueReport=require(_0x6783('0x1'))['db'][_0x6783('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6783('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6783('0x4'),'afterDestroy':_0x6783('0x5')};function emitEvent(_0x14fc76){return function(_0x325a7b,_0x49ec5b,_0x4e37ea){VoiceQueueReportEvents['emit'](_0x14fc76+':'+_0x325a7b['id'],_0x325a7b);VoiceQueueReportEvents[_0x6783('0x6')](_0x14fc76,_0x325a7b);_0x4e37ea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x6783('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x47ad=['remove','emit','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update'];(function(_0x5760b8,_0x5f127b){var _0x1c85dd=function(_0x5de48a){while(--_0x5de48a){_0x5760b8['push'](_0x5760b8['shift']());}};_0x1c85dd(++_0x5f127b);}(_0x47ad,0xa4));var _0xd47a=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0x47ad[_0x476c7];return _0x47ae56;};'use strict';var EventEmitter=require(_0xd47a('0x0'));var VoiceQueueReport=require(_0xd47a('0x1'))['db'][_0xd47a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xd47a('0x3')](0x0);var events={'afterCreate':_0xd47a('0x4'),'afterUpdate':_0xd47a('0x5'),'afterDestroy':_0xd47a('0x6')};function emitEvent(_0x4a41b1){return function(_0x15bd38,_0x5e842b,_0xf30198){VoiceQueueReportEvents[_0xd47a('0x7')](_0x4a41b1+':'+_0x15bd38['id'],_0x15bd38);VoiceQueueReportEvents['emit'](_0x4a41b1,_0x15bd38);_0xf30198(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xd47a('0x8')](e,emitEvent(event));}}module[_0xd47a('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 9df7efe..36b94bd 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 _0x06c5=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','VoiceQueueReport','report_queue','calleridnum','lodash'];(function(_0x358e1c,_0x2c215b){var _0x3e3efb=function(_0x12f313){while(--_0x12f313){_0x358e1c['push'](_0x358e1c['shift']());}};_0x3e3efb(++_0x2c215b);}(_0x06c5,0x19f));var _0x506c=function(_0x4220d7,_0x476dd8){_0x4220d7=_0x4220d7-0x0;var _0xf54e0f=_0x06c5[_0x4220d7];return _0xf54e0f;};'use strict';var _=require(_0x506c('0x0'));var util=require(_0x506c('0x1'));var logger=require(_0x506c('0x2'))(_0x506c('0x3'));var moment=require(_0x506c('0x4'));var BPromise=require(_0x506c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x506c('0x6'));var rimraf=require('rimraf');var config=require(_0x506c('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0x506c('0x8')]=function(_0x1c5311,_0x5c7e2d){return _0x1c5311[_0x506c('0x9')](_0x506c('0xa'),attributes,{'tableName':_0x506c('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x506c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x007b=['path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x007b,0x164));var _0xb007=function(_0x58e972,_0x2667fc){_0x58e972=_0x58e972-0x0;var _0x260176=_0x007b[_0x58e972];return _0x260176;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb007('0x0'))(_0xb007('0x1'));var moment=require(_0xb007('0x2'));var BPromise=require(_0xb007('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb007('0x4'));var rimraf=require('rimraf');var config=require(_0xb007('0x5'));var attributes=require(_0xb007('0x6'));module[_0xb007('0x7')]=function(_0x5b3a87,_0x48f5ad){return _0x5b3a87[_0xb007('0x8')](_0xb007('0x9'),attributes,{'tableName':_0xb007('0xa'),'paranoid':![],'indexes':[{'fields':[_0xb007('0xb')]},{'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 ce0224f..a6d2efd 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 _0xae00=['VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','debug','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./voiceQueueReport.socket','register','request','then','info'];(function(_0x2070f5,_0x53733e){var _0x37e82c=function(_0x50afce){while(--_0x50afce){_0x2070f5['push'](_0x2070f5['shift']());}};_0x37e82c(++_0x53733e);}(_0xae00,0xc9));var _0x0ae0=function(_0x303064,_0x12f0c2){_0x303064=_0x303064-0x0;var _0x5a1d3d=_0xae00[_0x303064];return _0x5a1d3d;};'use strict';var _=require(_0x0ae0('0x0'));var util=require(_0x0ae0('0x1'));var moment=require(_0x0ae0('0x2'));var BPromise=require(_0x0ae0('0x3'));var rs=require(_0x0ae0('0x4'));var fs=require('fs');var Redis=require(_0x0ae0('0x5'));var db=require(_0x0ae0('0x6'))['db'];var utils=require(_0x0ae0('0x7'));var logger=require(_0x0ae0('0x8'))('rpc');var config=require(_0x0ae0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0ae0('0xa')][_0x0ae0('0xb')]({'port':0x232a});config[_0x0ae0('0xc')]=_[_0x0ae0('0xd')](config[_0x0ae0('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ae0('0xc')]));require(_0x0ae0('0xe'))[_0x0ae0('0xf')](socket);function respondWithRpcPromise(_0x4de532,_0x1cfa3a,_0x42e9e3){return new BPromise(function(_0x1e03c1,_0x4485f4){return client[_0x0ae0('0x10')](_0x4de532,_0x42e9e3)[_0x0ae0('0x11')](function(_0x394a7e){logger[_0x0ae0('0x12')](_0x0ae0('0x13'),_0x1cfa3a,_0x0ae0('0x14'));logger['debug'](_0x0ae0('0x15'),_0x1cfa3a,'request\x20sent',JSON[_0x0ae0('0x16')](_0x394a7e));if(_0x394a7e[_0x0ae0('0x17')]){if(_0x394a7e[_0x0ae0('0x17')][_0x0ae0('0x18')]===0x1f4){logger[_0x0ae0('0x17')](_0x0ae0('0x13'),_0x1cfa3a,_0x394a7e['error'][_0x0ae0('0x19')]);return _0x4485f4(_0x394a7e[_0x0ae0('0x17')][_0x0ae0('0x19')]);}logger[_0x0ae0('0x17')](_0x0ae0('0x13'),_0x1cfa3a,_0x394a7e['error'][_0x0ae0('0x19')]);return _0x1e03c1(_0x394a7e[_0x0ae0('0x17')][_0x0ae0('0x19')]);}else{logger[_0x0ae0('0x12')](_0x0ae0('0x13'),_0x1cfa3a,'request\x20sent');_0x1e03c1(_0x394a7e[_0x0ae0('0x1a')][_0x0ae0('0x19')]);}})[_0x0ae0('0x1b')](function(_0x2c29b9){logger[_0x0ae0('0x17')](_0x0ae0('0x13'),_0x1cfa3a,_0x2c29b9);_0x4485f4(_0x2c29b9);});});}exports['GetVoiceQueueReport']=function(_0x178e7d){var _0x5dca6b=this;return new Promise(function(_0x5cff70,_0x19e07b){return db[_0x0ae0('0x1c')][_0x0ae0('0x1d')]({'raw':_0x178e7d[_0x0ae0('0x1e')]?_0x178e7d[_0x0ae0('0x1e')][_0x0ae0('0x1f')]===undefined?!![]:![]:!![],'where':_0x178e7d[_0x0ae0('0x1e')]?_0x178e7d[_0x0ae0('0x1e')][_0x0ae0('0x20')]||null:null,'attributes':_0x178e7d['options']?_0x178e7d[_0x0ae0('0x1e')][_0x0ae0('0x21')]||null:null,'limit':_0x178e7d[_0x0ae0('0x1e')]?_0x178e7d[_0x0ae0('0x1e')][_0x0ae0('0x22')]||null:null,'include':_0x178e7d[_0x0ae0('0x1e')]?_0x178e7d[_0x0ae0('0x1e')][_0x0ae0('0x23')]?_[_0x0ae0('0x24')](_0x178e7d[_0x0ae0('0x1e')][_0x0ae0('0x23')],function(_0x385310){return{'model':db[_0x385310[_0x0ae0('0x25')]],'as':_0x385310['as'],'attributes':_0x385310['attributes'],'include':_0x385310[_0x0ae0('0x23')]?_[_0x0ae0('0x24')](_0x385310['include'],function(_0x7454b9){return{'model':db[_0x7454b9[_0x0ae0('0x25')]],'as':_0x7454b9['as'],'attributes':_0x7454b9[_0x0ae0('0x21')],'include':_0x7454b9['include']?_[_0x0ae0('0x24')](_0x7454b9['include'],function(_0x2002ae){return{'model':db[_0x2002ae['model']],'as':_0x2002ae['as'],'attributes':_0x2002ae[_0x0ae0('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0ae0('0x11')](function(_0xd9fbd){logger['info'](_0x0ae0('0x26'),_0x178e7d);logger['debug'](_0x0ae0('0x26'),_0x178e7d,JSON[_0x0ae0('0x16')](_0xd9fbd));_0x5cff70(_0xd9fbd);})[_0x0ae0('0x1b')](function(_0x1964ec){logger[_0x0ae0('0x17')](_0x0ae0('0x26'),_0x1964ec['message'],_0x178e7d);_0x19e07b(_0x5dca6b['error'](0x1f4,_0x1964ec[_0x0ae0('0x19')]));});});};exports[_0x0ae0('0x27')]=function(_0x26c873){var _0x262808=this;return new Promise(function(_0x3c8f1e,_0x2df415){return db[_0x0ae0('0x1c')][_0x0ae0('0x28')](_0x26c873[_0x0ae0('0x29')],{'raw':_0x26c873['options']?_0x26c873[_0x0ae0('0x1e')][_0x0ae0('0x1f')]===undefined?!![]:![]:!![]})[_0x0ae0('0x11')](function(_0x274718){logger[_0x0ae0('0x12')](_0x0ae0('0x27'),_0x26c873);logger[_0x0ae0('0x2a')](_0x0ae0('0x27'),_0x26c873,JSON['stringify'](_0x274718));_0x3c8f1e(_0x274718);})[_0x0ae0('0x1b')](function(_0xf84147){logger[_0x0ae0('0x17')](_0x0ae0('0x27'),_0xf84147[_0x0ae0('0x19')],_0x26c873);_0x2df415(_0x262808[_0x0ae0('0x17')](0x1f4,_0xf84147[_0x0ae0('0x19')]));});});};exports[_0x0ae0('0x2b')]=function(_0x310cb9){var _0x5d52b2=this;return new Promise(function(_0x21d8f7,_0x193637){return db[_0x0ae0('0x1c')]['update'](_0x310cb9[_0x0ae0('0x29')],{'raw':_0x310cb9[_0x0ae0('0x1e')]?_0x310cb9[_0x0ae0('0x1e')][_0x0ae0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x310cb9[_0x0ae0('0x1e')]?_0x310cb9[_0x0ae0('0x1e')][_0x0ae0('0x20')]||null:null,'attributes':_0x310cb9['options']?_0x310cb9['options']['attributes']||null:null,'limit':_0x310cb9[_0x0ae0('0x1e')]?_0x310cb9['options'][_0x0ae0('0x22')]||null:null})[_0x0ae0('0x11')](function(_0x1f576f){logger['info'](_0x0ae0('0x2b'),_0x310cb9);logger['debug'](_0x0ae0('0x2b'),_0x310cb9,JSON['stringify'](_0x1f576f));_0x21d8f7(_0x1f576f);})['catch'](function(_0x787c86){logger['error'](_0x0ae0('0x2b'),_0x787c86[_0x0ae0('0x19')],_0x310cb9);_0x193637(_0x5d52b2[_0x0ae0('0x17')](0x1f4,_0x787c86[_0x0ae0('0x19')]));});});}; \ No newline at end of file +var _0x577f=['options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','stringify','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','VoiceQueueReport','findAll'];(function(_0x8c0dda,_0x2d3a2b){var _0x5f5106=function(_0x38aa12){while(--_0x38aa12){_0x8c0dda['push'](_0x8c0dda['shift']());}};_0x5f5106(++_0x2d3a2b);}(_0x577f,0x1b3));var _0xf577=function(_0x1b0d41,_0x128699){_0x1b0d41=_0x1b0d41-0x0;var _0x2568b4=_0x577f[_0x1b0d41];return _0x2568b4;};'use strict';var _=require(_0xf577('0x0'));var util=require(_0xf577('0x1'));var moment=require(_0xf577('0x2'));var BPromise=require('bluebird');var rs=require(_0xf577('0x3'));var fs=require('fs');var Redis=require(_0xf577('0x4'));var db=require(_0xf577('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf577('0x6'))('rpc');var config=require(_0xf577('0x7'));var jayson=require(_0xf577('0x8'));var client=jayson[_0xf577('0x9')][_0xf577('0xa')]({'port':0x232a});config[_0xf577('0xb')]=_['defaults'](config[_0xf577('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf577('0xc'))(new Redis(config[_0xf577('0xb')]));require(_0xf577('0xd'))['register'](socket);function respondWithRpcPromise(_0x41efe9,_0x546b0c,_0xf3c871){return new BPromise(function(_0x58e612,_0x7eccee){return client[_0xf577('0xe')](_0x41efe9,_0xf3c871)[_0xf577('0xf')](function(_0xf79253){logger[_0xf577('0x10')](_0xf577('0x11'),_0x546b0c,_0xf577('0x12'));logger[_0xf577('0x13')](_0xf577('0x14'),_0x546b0c,'request\x20sent',JSON['stringify'](_0xf79253));if(_0xf79253[_0xf577('0x15')]){if(_0xf79253[_0xf577('0x15')]['code']===0x1f4){logger[_0xf577('0x15')](_0xf577('0x11'),_0x546b0c,_0xf79253[_0xf577('0x15')][_0xf577('0x16')]);return _0x7eccee(_0xf79253[_0xf577('0x15')][_0xf577('0x16')]);}logger['error'](_0xf577('0x11'),_0x546b0c,_0xf79253['error'][_0xf577('0x16')]);return _0x58e612(_0xf79253[_0xf577('0x15')][_0xf577('0x16')]);}else{logger['info'](_0xf577('0x11'),_0x546b0c,_0xf577('0x12'));_0x58e612(_0xf79253[_0xf577('0x17')][_0xf577('0x16')]);}})[_0xf577('0x18')](function(_0x52d716){logger[_0xf577('0x15')](_0xf577('0x11'),_0x546b0c,_0x52d716);_0x7eccee(_0x52d716);});});}exports['GetVoiceQueueReport']=function(_0x41226a){var _0x335946=this;return new Promise(function(_0x2b02b1,_0x73d221){return db[_0xf577('0x19')][_0xf577('0x1a')]({'raw':_0x41226a[_0xf577('0x1b')]?_0x41226a[_0xf577('0x1b')][_0xf577('0x1c')]===undefined?!![]:![]:!![],'where':_0x41226a[_0xf577('0x1b')]?_0x41226a[_0xf577('0x1b')][_0xf577('0x1d')]||null:null,'attributes':_0x41226a['options']?_0x41226a['options'][_0xf577('0x1e')]||null:null,'limit':_0x41226a[_0xf577('0x1b')]?_0x41226a[_0xf577('0x1b')][_0xf577('0x1f')]||null:null,'include':_0x41226a[_0xf577('0x1b')]?_0x41226a[_0xf577('0x1b')][_0xf577('0x20')]?_[_0xf577('0x21')](_0x41226a[_0xf577('0x1b')][_0xf577('0x20')],function(_0x49e548){return{'model':db[_0x49e548[_0xf577('0x22')]],'as':_0x49e548['as'],'attributes':_0x49e548[_0xf577('0x1e')],'include':_0x49e548[_0xf577('0x20')]?_[_0xf577('0x21')](_0x49e548[_0xf577('0x20')],function(_0x9a33f1){return{'model':db[_0x9a33f1[_0xf577('0x22')]],'as':_0x9a33f1['as'],'attributes':_0x9a33f1[_0xf577('0x1e')],'include':_0x9a33f1[_0xf577('0x20')]?_[_0xf577('0x21')](_0x9a33f1[_0xf577('0x20')],function(_0x578945){return{'model':db[_0x578945['model']],'as':_0x578945['as'],'attributes':_0x578945[_0xf577('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf577('0xf')](function(_0x5a9739){logger[_0xf577('0x10')](_0xf577('0x23'),_0x41226a);logger[_0xf577('0x13')](_0xf577('0x23'),_0x41226a,JSON[_0xf577('0x24')](_0x5a9739));_0x2b02b1(_0x5a9739);})[_0xf577('0x18')](function(_0x25e33e){logger[_0xf577('0x15')](_0xf577('0x23'),_0x25e33e['message'],_0x41226a);_0x73d221(_0x335946[_0xf577('0x15')](0x1f4,_0x25e33e['message']));});});};exports[_0xf577('0x25')]=function(_0x10ed9e){var _0x355c02=this;return new Promise(function(_0x33a741,_0x2aba0b){return db[_0xf577('0x19')][_0xf577('0x26')](_0x10ed9e['body'],{'raw':_0x10ed9e['options']?_0x10ed9e[_0xf577('0x1b')][_0xf577('0x1c')]===undefined?!![]:![]:!![]})[_0xf577('0xf')](function(_0x10075f){logger['info'](_0xf577('0x25'),_0x10ed9e);logger[_0xf577('0x13')]('CreateVoiceQueueReport',_0x10ed9e,JSON[_0xf577('0x24')](_0x10075f));_0x33a741(_0x10075f);})[_0xf577('0x18')](function(_0x4cf9ef){logger[_0xf577('0x15')](_0xf577('0x25'),_0x4cf9ef[_0xf577('0x16')],_0x10ed9e);_0x2aba0b(_0x355c02[_0xf577('0x15')](0x1f4,_0x4cf9ef['message']));});});};exports[_0xf577('0x27')]=function(_0x4141df){var _0x438e33=this;return new Promise(function(_0x2d6980,_0x43ea33){return db[_0xf577('0x19')][_0xf577('0x28')](_0x4141df[_0xf577('0x29')],{'raw':_0x4141df[_0xf577('0x1b')]?_0x4141df['options'][_0xf577('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4141df['options']?_0x4141df[_0xf577('0x1b')][_0xf577('0x1d')]||null:null,'attributes':_0x4141df[_0xf577('0x1b')]?_0x4141df[_0xf577('0x1b')][_0xf577('0x1e')]||null:null,'limit':_0x4141df[_0xf577('0x1b')]?_0x4141df[_0xf577('0x1b')]['limit']||null:null})[_0xf577('0xf')](function(_0x58a02b){logger[_0xf577('0x10')](_0xf577('0x27'),_0x4141df);logger[_0xf577('0x13')](_0xf577('0x27'),_0x4141df,JSON['stringify'](_0x58a02b));_0x2d6980(_0x58a02b);})['catch'](function(_0x4cba5c){logger[_0xf577('0x15')](_0xf577('0x27'),_0x4cba5c['message'],_0x4141df);_0x43ea33(_0x438e33[_0xf577('0x15')](0x1f4,_0x4cba5c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index b8cfb61..b603178 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 _0xca9e=['remove','update','emit','removeListener','register','length','./voiceQueueReport.events','save'];(function(_0x2feb53,_0x264ef7){var _0x5700ee=function(_0x700c98){while(--_0x700c98){_0x2feb53['push'](_0x2feb53['shift']());}};_0x5700ee(++_0x264ef7);}(_0xca9e,0x136));var _0xeca9=function(_0x2e7ae7,_0x1221a5){_0x2e7ae7=_0x2e7ae7-0x0;var _0x2ad99f=_0xca9e[_0x2e7ae7];return _0x2ad99f;};'use strict';var VoiceQueueReportEvents=require(_0xeca9('0x0'));var events=[_0xeca9('0x1'),_0xeca9('0x2'),_0xeca9('0x3')];function createListener(_0x2df937,_0x1443e3){return function(_0x8dbabb){_0x1443e3[_0xeca9('0x4')](_0x2df937,_0x8dbabb);};}function removeListener(_0x1b2864,_0x1e0a18){return function(){VoiceQueueReportEvents[_0xeca9('0x5')](_0x1b2864,_0x1e0a18);};}exports[_0xeca9('0x6')]=function(_0x186a47){for(var _0x305dc5=0x0,_0x483e41=events[_0xeca9('0x7')];_0x305dc5<_0x483e41;_0x305dc5++){var _0x1774f3=events[_0x305dc5];var _0x4d57ee=createListener('voiceQueueReport:'+_0x1774f3,_0x186a47);VoiceQueueReportEvents['on'](_0x1774f3,_0x4d57ee);}}; \ No newline at end of file +var _0xeb5d=['register','length','voiceQueueReport:','save','remove','update','emit','removeListener'];(function(_0x3c4140,_0x37e846){var _0x31764b=function(_0x5e5ecd){while(--_0x5e5ecd){_0x3c4140['push'](_0x3c4140['shift']());}};_0x31764b(++_0x37e846);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xeb5d[_0x2c91e9];return _0x13f0ff;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xdeb5('0x0'),_0xdeb5('0x1'),_0xdeb5('0x2')];function createListener(_0x2b0a09,_0x55bbde){return function(_0x5acd11){_0x55bbde[_0xdeb5('0x3')](_0x2b0a09,_0x5acd11);};}function removeListener(_0x16c31b,_0x546313){return function(){VoiceQueueReportEvents[_0xdeb5('0x4')](_0x16c31b,_0x546313);};}exports[_0xdeb5('0x5')]=function(_0x164ecb){for(var _0x33af72=0x0,_0x120329=events[_0xdeb5('0x6')];_0x33af72<_0x120329;_0x33af72++){var _0x328d6b=events[_0x33af72];var _0x35c086=createListener(_0xdeb5('0x7')+_0x328d6b,_0x164ecb);VoiceQueueReportEvents['on'](_0x328d6b,_0x35c086);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 5e0351f..727997e 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 _0x6523=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete'];(function(_0x43d0e6,_0x3c1489){var _0x51d841=function(_0x3e8559){while(--_0x3e8559){_0x43d0e6['push'](_0x43d0e6['shift']());}};_0x51d841(++_0x3c1489);}(_0x6523,0x1a6));var _0x3652=function(_0x2d398b,_0x5e98f8){_0x2d398b=_0x2d398b-0x0;var _0x5d8b9d=_0x6523[_0x2d398b];return _0x5d8b9d;};'use strict';var multer=require(_0x3652('0x0'));var util=require(_0x3652('0x1'));var path=require('path');var timeout=require(_0x3652('0x2'));var express=require(_0x3652('0x3'));var router=express[_0x3652('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3652('0x5'));var interaction=require(_0x3652('0x6'));var config=require(_0x3652('0x7'));var controller=require(_0x3652('0x8'));router['get']('/',auth[_0x3652('0x9')](),controller[_0x3652('0xa')]);router[_0x3652('0xb')](_0x3652('0xc'),auth[_0x3652('0x9')](),controller[_0x3652('0xd')]);router[_0x3652('0xe')]('/',auth[_0x3652('0x9')](),controller[_0x3652('0xf')]);router[_0x3652('0x10')](_0x3652('0xc'),auth[_0x3652('0x9')](),controller['update']);router[_0x3652('0x11')](_0x3652('0xc'),auth[_0x3652('0x9')](),controller[_0x3652('0x12')]);module[_0x3652('0x13')]=router; \ No newline at end of file +var _0xc698=['show','post','create','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./voiceQueuesLog.controller','get','/:id','isAuthenticated'];(function(_0x42e034,_0x5ecdef){var _0x1d3d70=function(_0x800c3c){while(--_0x800c3c){_0x42e034['push'](_0x42e034['shift']());}};_0x1d3d70(++_0x5ecdef);}(_0xc698,0x116));var _0x8c69=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0xc698[_0x1460f6];return _0x46ce94;};'use strict';var multer=require(_0x8c69('0x0'));var util=require(_0x8c69('0x1'));var path=require(_0x8c69('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c69('0x3'));var router=express[_0x8c69('0x4')]();var fs_extra=require(_0x8c69('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8c69('0x6'));var config=require('../../config/environment');var controller=require(_0x8c69('0x7'));router[_0x8c69('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8c69('0x8')](_0x8c69('0x9'),auth[_0x8c69('0xa')](),controller[_0x8c69('0xb')]);router[_0x8c69('0xc')]('/',auth[_0x8c69('0xa')](),controller[_0x8c69('0xd')]);router[_0x8c69('0xe')](_0x8c69('0x9'),auth[_0x8c69('0xa')](),controller[_0x8c69('0xf')]);router[_0x8c69('0x10')]('/:id',auth[_0x8c69('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 8f574c0..bd813e2 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 _0x5069=['DATE','sequelize','moment','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5069,0x65));var _0x9506=function(_0x3bb6b3,_0x2225dd){_0x3bb6b3=_0x3bb6b3-0x0;var _0x105626=_0x5069[_0x3bb6b3];return _0x105626;};'use strict';var Sequelize=require(_0x9506('0x0'));var moment=require(_0x9506('0x1'));module['exports']={'time':{'type':Sequelize[_0x9506('0x2')]},'callid':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x9506('0x3')],'allowNull':![],'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xe232=['moment','exports','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe232,0x1f0));var _0x2e23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe232[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2e23('0x0'));var moment=require(_0x2e23('0x1'));module[_0x2e23('0x2')]={'time':{'type':Sequelize[_0x2e23('0x3')]},'callid':{'type':Sequelize[_0x2e23('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x2e23('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x2e23('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x2e23('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x2e23('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x2e23('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x2e23('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x2e23('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x2e23('0x5')](_0x2e23('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index a621fce..c0126a4 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 _0xe8c0=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x1f47a4,_0x4c40da){var _0x5643f1=function(_0x13977d){while(--_0x13977d){_0x1f47a4['push'](_0x1f47a4['shift']());}};_0x5643f1(++_0x4c40da);}(_0xe8c0,0xcf));var _0x0e8c=function(_0x469581,_0x4e408e){_0x469581=_0x469581-0x0;var _0x506e50=_0xe8c0[_0x469581];return _0x506e50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e8c('0x0'));var zipdir=require(_0x0e8c('0x1'));var jsonpatch=require(_0x0e8c('0x2'));var rp=require('request-promise');var moment=require(_0x0e8c('0x3'));var BPromise=require(_0x0e8c('0x4'));var Mustache=require(_0x0e8c('0x5'));var util=require('util');var path=require(_0x0e8c('0x6'));var sox=require(_0x0e8c('0x7'));var csv=require(_0x0e8c('0x8'));var ejs=require(_0x0e8c('0x9'));var fs=require('fs');var fs_extra=require(_0x0e8c('0xa'));var _=require('lodash');var squel=require(_0x0e8c('0xb'));var crypto=require(_0x0e8c('0xc'));var jsforce=require(_0x0e8c('0xd'));var deskjs=require(_0x0e8c('0xe'));var toCsv=require(_0x0e8c('0x8'));var querystring=require(_0x0e8c('0xf'));var Papa=require(_0x0e8c('0x10'));var Redis=require('ioredis');var authService=require(_0x0e8c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0e8c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e8c('0x13'))(_0x0e8c('0x14'));var utils=require(_0x0e8c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0e8c('0x16'));var db=require(_0x0e8c('0x17'))['db'];function respondWithStatusCode(_0x4a86c8,_0x182af1){_0x182af1=_0x182af1||0xcc;return function(_0x138f8b){if(_0x138f8b){return _0x4a86c8[_0x0e8c('0x18')](_0x182af1);}return _0x4a86c8[_0x0e8c('0x19')](_0x182af1)[_0x0e8c('0x1a')]();};}function respondWithResult(_0x312f6b,_0x57d665){_0x57d665=_0x57d665||0xc8;return function(_0x4e7522){if(_0x4e7522){return _0x312f6b['status'](_0x57d665)['json'](_0x4e7522);}};}function respondWithFilteredResult(_0x5bac8f,_0x25dba2){return function(_0x4f7cec){if(_0x4f7cec){var _0x2161f0=typeof _0x25dba2[_0x0e8c('0x1b')]===_0x0e8c('0x1c')&&typeof _0x25dba2['limit']===_0x0e8c('0x1c');var _0x2c6924=_0x4f7cec['count'];var _0x37c5ac=_0x2161f0?0x0:_0x25dba2[_0x0e8c('0x1b')];var _0x22b284=_0x2161f0?_0x4f7cec[_0x0e8c('0x1d')]:_0x25dba2['offset']+_0x25dba2[_0x0e8c('0x1e')];var _0x355307;if(_0x22b284>=_0x2c6924){_0x22b284=_0x2c6924;_0x355307=0xc8;}else{_0x355307=0xce;}_0x5bac8f[_0x0e8c('0x19')](_0x355307);return _0x5bac8f['set'](_0x0e8c('0x1f'),_0x37c5ac+'-'+_0x22b284+'/'+_0x2c6924)['json'](_0x4f7cec);}return null;};}function patchUpdates(_0x1dcf10){return function(_0x43c7f3){try{jsonpatch['apply'](_0x43c7f3,_0x1dcf10,!![]);}catch(_0x39fa3e){return BPromise['reject'](_0x39fa3e);}return _0x43c7f3[_0x0e8c('0x20')]();};}function saveUpdates(_0x4b7f88,_0x58c33f){return function(_0x384a09){if(_0x384a09){return _0x384a09[_0x0e8c('0x21')](_0x4b7f88)[_0x0e8c('0x22')](function(_0x150a98){return _0x150a98;});}return null;};}function removeEntity(_0x326393,_0x42e420){return function(_0xfc0763){if(_0xfc0763){return _0xfc0763[_0x0e8c('0x23')]()[_0x0e8c('0x22')](function(){_0x326393[_0x0e8c('0x19')](0xcc)[_0x0e8c('0x1a')]();});}};}function handleEntityNotFound(_0x177d52,_0x2675b2){return function(_0x7022e5){if(!_0x7022e5){_0x177d52[_0x0e8c('0x18')](0x194);}return _0x7022e5;};}function handleError(_0x2c07dc,_0x15ad5e){_0x15ad5e=_0x15ad5e||0x1f4;return function(_0x1d9253){logger[_0x0e8c('0x24')](_0x1d9253[_0x0e8c('0x25')]);if(_0x1d9253[_0x0e8c('0x26')]){delete _0x1d9253[_0x0e8c('0x26')];}_0x2c07dc[_0x0e8c('0x19')](_0x15ad5e)[_0x0e8c('0x27')](_0x1d9253);};}exports[_0x0e8c('0x28')]=function(_0x121251,_0x54db50){var _0x328fbc={},_0x2184cd={},_0x3dce45={'count':0x0,'rows':[]};var _0x464bf2=_[_0x0e8c('0x29')](db[_0x0e8c('0x2a')]['rawAttributes'],function(_0x33d4d2){return{'name':_0x33d4d2[_0x0e8c('0x2b')],'type':_0x33d4d2[_0x0e8c('0x2c')][_0x0e8c('0x2d')]};});_0x2184cd[_0x0e8c('0x2e')]=_[_0x0e8c('0x29')](_0x464bf2,_0x0e8c('0x26'));_0x2184cd[_0x0e8c('0x2f')]=_[_0x0e8c('0x30')](_0x121251['query']);_0x2184cd[_0x0e8c('0x31')]=_[_0x0e8c('0x32')](_0x2184cd[_0x0e8c('0x2e')],_0x2184cd['query']);_0x328fbc[_0x0e8c('0x33')]=_[_0x0e8c('0x32')](_0x2184cd['model'],qs[_0x0e8c('0x34')](_0x121251[_0x0e8c('0x2f')][_0x0e8c('0x34')]));_0x328fbc[_0x0e8c('0x33')]=_0x328fbc[_0x0e8c('0x33')][_0x0e8c('0x35')]?_0x328fbc[_0x0e8c('0x33')]:_0x2184cd['model'];if(!_0x121251[_0x0e8c('0x2f')]['hasOwnProperty'](_0x0e8c('0x36'))){_0x328fbc['limit']=qs[_0x0e8c('0x1e')](_0x121251['query']['limit']);_0x328fbc[_0x0e8c('0x1b')]=qs[_0x0e8c('0x1b')](_0x121251['query'][_0x0e8c('0x1b')]);}_0x328fbc[_0x0e8c('0x37')]=qs[_0x0e8c('0x38')](_0x121251[_0x0e8c('0x2f')][_0x0e8c('0x38')]);_0x328fbc[_0x0e8c('0x39')]=qs['filters'](_['pick'](_0x121251[_0x0e8c('0x2f')],_0x2184cd['filters']),_0x464bf2);if(_0x121251['query'][_0x0e8c('0x3a')]){_0x328fbc[_0x0e8c('0x39')]=_[_0x0e8c('0x3b')](_0x328fbc[_0x0e8c('0x39')],{'$or':_[_0x0e8c('0x29')](_0x464bf2,function(_0x3225d7){if(_0x3225d7[_0x0e8c('0x2c')]!==_0x0e8c('0x3c')){var _0x145523={};_0x145523[_0x3225d7[_0x0e8c('0x26')]]={'$like':'%'+_0x121251[_0x0e8c('0x2f')][_0x0e8c('0x3a')]+'%'};return _0x145523;}})});}_0x328fbc=_[_0x0e8c('0x3b')]({},_0x328fbc,_0x121251[_0x0e8c('0x3d')]);var _0x32937d={'where':_0x328fbc['where']};return db['VoiceQueuesLog'][_0x0e8c('0x1d')](_0x32937d)['then'](function(_0x252b0f){_0x3dce45[_0x0e8c('0x1d')]=_0x252b0f;if(_0x121251['query'][_0x0e8c('0x3e')]){_0x328fbc[_0x0e8c('0x3f')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x0e8c('0x40')](_0x328fbc);})[_0x0e8c('0x22')](function(_0x1cf92f){_0x3dce45[_0x0e8c('0x41')]=_0x1cf92f;return _0x3dce45;})[_0x0e8c('0x22')](respondWithFilteredResult(_0x54db50,_0x328fbc))['catch'](handleError(_0x54db50,null));};exports[_0x0e8c('0x42')]=function(_0x3ba07d,_0x549042){var _0x2efe99={'raw':!![],'where':{'id':_0x3ba07d[_0x0e8c('0x43')]['id']}},_0x149c28={};_0x149c28[_0x0e8c('0x2e')]=_['keys'](db[_0x0e8c('0x2a')][_0x0e8c('0x44')]);_0x149c28['query']=_[_0x0e8c('0x30')](_0x3ba07d[_0x0e8c('0x2f')]);_0x149c28[_0x0e8c('0x31')]=_[_0x0e8c('0x32')](_0x149c28[_0x0e8c('0x2e')],_0x149c28[_0x0e8c('0x2f')]);_0x2efe99['attributes']=_[_0x0e8c('0x32')](_0x149c28[_0x0e8c('0x2e')],qs['fields'](_0x3ba07d[_0x0e8c('0x2f')]['fields']));_0x2efe99[_0x0e8c('0x33')]=_0x2efe99[_0x0e8c('0x33')]['length']?_0x2efe99['attributes']:_0x149c28[_0x0e8c('0x2e')];if(_0x3ba07d[_0x0e8c('0x2f')][_0x0e8c('0x3e')]){_0x2efe99[_0x0e8c('0x3f')]=[{'all':!![]}];}_0x2efe99=_[_0x0e8c('0x3b')]({},_0x2efe99,_0x3ba07d['options']);return db[_0x0e8c('0x2a')][_0x0e8c('0x45')](_0x2efe99)[_0x0e8c('0x22')](handleEntityNotFound(_0x549042,null))[_0x0e8c('0x22')](respondWithResult(_0x549042,null))['catch'](handleError(_0x549042,null));};exports[_0x0e8c('0x46')]=function(_0x1a046c,_0x34521a){return db[_0x0e8c('0x2a')][_0x0e8c('0x46')](_0x1a046c[_0x0e8c('0x47')],{})[_0x0e8c('0x22')](respondWithResult(_0x34521a,0xc9))[_0x0e8c('0x48')](handleError(_0x34521a,null));};exports[_0x0e8c('0x21')]=function(_0x35b01e,_0x58ec49){if(_0x35b01e[_0x0e8c('0x47')]['id']){delete _0x35b01e[_0x0e8c('0x47')]['id'];}return db[_0x0e8c('0x2a')][_0x0e8c('0x45')]({'where':{'id':_0x35b01e['params']['id']}})[_0x0e8c('0x22')](handleEntityNotFound(_0x58ec49,null))[_0x0e8c('0x22')](saveUpdates(_0x35b01e[_0x0e8c('0x47')],null))['then'](respondWithResult(_0x58ec49,null))[_0x0e8c('0x48')](handleError(_0x58ec49,null));};exports[_0x0e8c('0x23')]=function(_0x373e48,_0x3ecbd0){return db[_0x0e8c('0x2a')]['find']({'where':{'id':_0x373e48[_0x0e8c('0x43')]['id']}})[_0x0e8c('0x22')](handleEntityNotFound(_0x3ecbd0,null))[_0x0e8c('0x22')](removeEntity(_0x3ecbd0,null))[_0x0e8c('0x48')](handleError(_0x3ecbd0,null));}; \ No newline at end of file +var _0x0970=['pick','filter','merge','options','includeAll','findAll','rows','show','params','length','find','catch','create','body','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x131585,_0x1abd33){var _0x1fcca2=function(_0x8f165b){while(--_0x8f165b){_0x131585['push'](_0x131585['shift']());}};_0x1fcca2(++_0x1abd33);}(_0x0970,0x185));var _0x0097=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0970[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0097('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0097('0x1'));var rp=require(_0x0097('0x2'));var moment=require(_0x0097('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0097('0x4'));var util=require(_0x0097('0x5'));var path=require(_0x0097('0x6'));var sox=require(_0x0097('0x7'));var csv=require(_0x0097('0x8'));var ejs=require(_0x0097('0x9'));var fs=require('fs');var fs_extra=require(_0x0097('0xa'));var _=require(_0x0097('0xb'));var squel=require(_0x0097('0xc'));var crypto=require(_0x0097('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0097('0x8'));var querystring=require(_0x0097('0xe'));var Papa=require(_0x0097('0xf'));var Redis=require('ioredis');var authService=require(_0x0097('0x10'));var qs=require(_0x0097('0x11'));var as=require(_0x0097('0x12'));var hardwareService=require(_0x0097('0x13'));var logger=require(_0x0097('0x14'))(_0x0097('0x15'));var utils=require(_0x0097('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0097('0x17'));var db=require(_0x0097('0x18'))['db'];function respondWithStatusCode(_0x16a1ce,_0x52a2d2){_0x52a2d2=_0x52a2d2||0xcc;return function(_0x166253){if(_0x166253){return _0x16a1ce[_0x0097('0x19')](_0x52a2d2);}return _0x16a1ce[_0x0097('0x1a')](_0x52a2d2)[_0x0097('0x1b')]();};}function respondWithResult(_0x238713,_0x330aaa){_0x330aaa=_0x330aaa||0xc8;return function(_0x5ecc63){if(_0x5ecc63){return _0x238713[_0x0097('0x1a')](_0x330aaa)[_0x0097('0x1c')](_0x5ecc63);}};}function respondWithFilteredResult(_0x352be0,_0x2a7db6){return function(_0xb2250a){if(_0xb2250a){var _0x459a68=typeof _0x2a7db6['offset']===_0x0097('0x1d')&&typeof _0x2a7db6[_0x0097('0x1e')]===_0x0097('0x1d');var _0x4bb0d7=_0xb2250a['count'];var _0x24ac87=_0x459a68?0x0:_0x2a7db6[_0x0097('0x1f')];var _0x634743=_0x459a68?_0xb2250a[_0x0097('0x20')]:_0x2a7db6[_0x0097('0x1f')]+_0x2a7db6[_0x0097('0x1e')];var _0x17a018;if(_0x634743>=_0x4bb0d7){_0x634743=_0x4bb0d7;_0x17a018=0xc8;}else{_0x17a018=0xce;}_0x352be0[_0x0097('0x1a')](_0x17a018);return _0x352be0[_0x0097('0x21')](_0x0097('0x22'),_0x24ac87+'-'+_0x634743+'/'+_0x4bb0d7)['json'](_0xb2250a);}return null;};}function patchUpdates(_0x3496b9){return function(_0x7e82bf){try{jsonpatch[_0x0097('0x23')](_0x7e82bf,_0x3496b9,!![]);}catch(_0x3d655e){return BPromise[_0x0097('0x24')](_0x3d655e);}return _0x7e82bf[_0x0097('0x25')]();};}function saveUpdates(_0x421f43,_0x5ba452){return function(_0x5f066e){if(_0x5f066e){return _0x5f066e[_0x0097('0x26')](_0x421f43)['then'](function(_0x4a2c14){return _0x4a2c14;});}return null;};}function removeEntity(_0x51565a,_0x5484b3){return function(_0x575950){if(_0x575950){return _0x575950[_0x0097('0x27')]()[_0x0097('0x28')](function(){_0x51565a[_0x0097('0x1a')](0xcc)[_0x0097('0x1b')]();});}};}function handleEntityNotFound(_0x3a43b6,_0x34b363){return function(_0x137e91){if(!_0x137e91){_0x3a43b6[_0x0097('0x19')](0x194);}return _0x137e91;};}function handleError(_0x4f79df,_0x692619){_0x692619=_0x692619||0x1f4;return function(_0x280a3d){logger['error'](_0x280a3d['stack']);if(_0x280a3d[_0x0097('0x29')]){delete _0x280a3d[_0x0097('0x29')];}_0x4f79df['status'](_0x692619)[_0x0097('0x2a')](_0x280a3d);};}exports[_0x0097('0x2b')]=function(_0x1ec8f0,_0x57bc25){var _0x276816={},_0x824047={},_0x6581ec={'count':0x0,'rows':[]};var _0x782e79=_[_0x0097('0x2c')](db[_0x0097('0x2d')][_0x0097('0x2e')],function(_0x51b1bf){return{'name':_0x51b1bf['fieldName'],'type':_0x51b1bf[_0x0097('0x2f')][_0x0097('0x30')]};});_0x824047[_0x0097('0x31')]=_[_0x0097('0x2c')](_0x782e79,'name');_0x824047[_0x0097('0x32')]=_[_0x0097('0x33')](_0x1ec8f0['query']);_0x824047[_0x0097('0x34')]=_[_0x0097('0x35')](_0x824047[_0x0097('0x31')],_0x824047[_0x0097('0x32')]);_0x276816[_0x0097('0x36')]=_['intersection'](_0x824047[_0x0097('0x31')],qs['fields'](_0x1ec8f0['query'][_0x0097('0x37')]));_0x276816['attributes']=_0x276816[_0x0097('0x36')]['length']?_0x276816[_0x0097('0x36')]:_0x824047[_0x0097('0x31')];if(!_0x1ec8f0[_0x0097('0x32')][_0x0097('0x38')](_0x0097('0x39'))){_0x276816[_0x0097('0x1e')]=qs[_0x0097('0x1e')](_0x1ec8f0[_0x0097('0x32')][_0x0097('0x1e')]);_0x276816[_0x0097('0x1f')]=qs[_0x0097('0x1f')](_0x1ec8f0[_0x0097('0x32')]['offset']);}_0x276816[_0x0097('0x3a')]=qs[_0x0097('0x3b')](_0x1ec8f0[_0x0097('0x32')][_0x0097('0x3b')]);_0x276816[_0x0097('0x3c')]=qs[_0x0097('0x34')](_[_0x0097('0x3d')](_0x1ec8f0['query'],_0x824047[_0x0097('0x34')]),_0x782e79);if(_0x1ec8f0[_0x0097('0x32')][_0x0097('0x3e')]){_0x276816['where']=_[_0x0097('0x3f')](_0x276816[_0x0097('0x3c')],{'$or':_[_0x0097('0x2c')](_0x782e79,function(_0x58427d){if(_0x58427d[_0x0097('0x2f')]!=='VIRTUAL'){var _0x271f75={};_0x271f75[_0x58427d['name']]={'$like':'%'+_0x1ec8f0[_0x0097('0x32')][_0x0097('0x3e')]+'%'};return _0x271f75;}})});}_0x276816=_[_0x0097('0x3f')]({},_0x276816,_0x1ec8f0[_0x0097('0x40')]);var _0x41c38d={'where':_0x276816[_0x0097('0x3c')]};return db['VoiceQueuesLog'][_0x0097('0x20')](_0x41c38d)['then'](function(_0x10e115){_0x6581ec[_0x0097('0x20')]=_0x10e115;if(_0x1ec8f0[_0x0097('0x32')][_0x0097('0x41')]){_0x276816['include']=[{'all':!![]}];}return db[_0x0097('0x2d')][_0x0097('0x42')](_0x276816);})[_0x0097('0x28')](function(_0x3c316e){_0x6581ec[_0x0097('0x43')]=_0x3c316e;return _0x6581ec;})[_0x0097('0x28')](respondWithFilteredResult(_0x57bc25,_0x276816))['catch'](handleError(_0x57bc25,null));};exports[_0x0097('0x44')]=function(_0x6b3270,_0x3be84e){var _0x1567dc={'raw':!![],'where':{'id':_0x6b3270[_0x0097('0x45')]['id']}},_0x483ac5={};_0x483ac5[_0x0097('0x31')]=_[_0x0097('0x33')](db[_0x0097('0x2d')]['rawAttributes']);_0x483ac5[_0x0097('0x32')]=_[_0x0097('0x33')](_0x6b3270[_0x0097('0x32')]);_0x483ac5[_0x0097('0x34')]=_[_0x0097('0x35')](_0x483ac5[_0x0097('0x31')],_0x483ac5['query']);_0x1567dc[_0x0097('0x36')]=_[_0x0097('0x35')](_0x483ac5[_0x0097('0x31')],qs[_0x0097('0x37')](_0x6b3270['query']['fields']));_0x1567dc[_0x0097('0x36')]=_0x1567dc[_0x0097('0x36')][_0x0097('0x46')]?_0x1567dc[_0x0097('0x36')]:_0x483ac5[_0x0097('0x31')];if(_0x6b3270[_0x0097('0x32')]['includeAll']){_0x1567dc['include']=[{'all':!![]}];}_0x1567dc=_[_0x0097('0x3f')]({},_0x1567dc,_0x6b3270[_0x0097('0x40')]);return db[_0x0097('0x2d')][_0x0097('0x47')](_0x1567dc)[_0x0097('0x28')](handleEntityNotFound(_0x3be84e,null))['then'](respondWithResult(_0x3be84e,null))[_0x0097('0x48')](handleError(_0x3be84e,null));};exports[_0x0097('0x49')]=function(_0x3abd84,_0x3efbb8){return db[_0x0097('0x2d')][_0x0097('0x49')](_0x3abd84[_0x0097('0x4a')],{})[_0x0097('0x28')](respondWithResult(_0x3efbb8,0xc9))[_0x0097('0x48')](handleError(_0x3efbb8,null));};exports[_0x0097('0x26')]=function(_0x2cf064,_0x30cb65){if(_0x2cf064[_0x0097('0x4a')]['id']){delete _0x2cf064[_0x0097('0x4a')]['id'];}return db[_0x0097('0x2d')][_0x0097('0x47')]({'where':{'id':_0x2cf064[_0x0097('0x45')]['id']}})[_0x0097('0x28')](handleEntityNotFound(_0x30cb65,null))[_0x0097('0x28')](saveUpdates(_0x2cf064['body'],null))['then'](respondWithResult(_0x30cb65,null))[_0x0097('0x48')](handleError(_0x30cb65,null));};exports[_0x0097('0x27')]=function(_0x352903,_0x141fee){return db[_0x0097('0x2d')][_0x0097('0x47')]({'where':{'id':_0x352903[_0x0097('0x45')]['id']}})[_0x0097('0x28')](handleEntityNotFound(_0x141fee,null))[_0x0097('0x28')](removeEntity(_0x141fee,null))[_0x0097('0x48')](handleError(_0x141fee,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 63d6053..ebfaa7c 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 _0xac65=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm'];(function(_0x14d1b5,_0x99cfd7){var _0x1ce6e2=function(_0x4be3c1){while(--_0x4be3c1){_0x14d1b5['push'](_0x14d1b5['shift']());}};_0x1ce6e2(++_0x99cfd7);}(_0xac65,0x11d));var _0x5ac6=function(_0x35baed,_0x3c5adb){_0x35baed=_0x35baed-0x0;var _0x4b4a26=_0xac65[_0x35baed];return _0x4b4a26;};'use strict';var _=require(_0x5ac6('0x0'));var util=require(_0x5ac6('0x1'));var logger=require(_0x5ac6('0x2'))('api');var moment=require(_0x5ac6('0x3'));var BPromise=require(_0x5ac6('0x4'));var rp=require(_0x5ac6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ac6('0x6'));var config=require(_0x5ac6('0x7'));var attributes=require(_0x5ac6('0x8'));module['exports']=function(_0x2da747,_0x38711d){return _0x2da747[_0x5ac6('0x9')](_0x5ac6('0xa'),attributes,{'tableName':_0x5ac6('0xb'),'paranoid':![],'indexes':[{'name':_0x5ac6('0xc'),'fields':[_0x5ac6('0xd'),_0x5ac6('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0xdab3=['request-promise','rimraf','exports','define','VoiceQueuesLog','event_dtm','event','dtm','lodash','util','api'];(function(_0x3e29e5,_0x1cd087){var _0x37f88a=function(_0x2c6621){while(--_0x2c6621){_0x3e29e5['push'](_0x3e29e5['shift']());}};_0x37f88a(++_0x1cd087);}(_0xdab3,0x97));var _0x3dab=function(_0x386006,_0x569458){_0x386006=_0x386006-0x0;var _0x1161e3=_0xdab3[_0x386006];return _0x1161e3;};'use strict';var _=require(_0x3dab('0x0'));var util=require(_0x3dab('0x1'));var logger=require('../../config/logger')(_0x3dab('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3dab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3dab('0x4'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0x3dab('0x5')]=function(_0x1ab4b1,_0x1c00a4){return _0x1ab4b1[_0x3dab('0x6')](_0x3dab('0x7'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x3dab('0x8'),'fields':[_0x3dab('0x9'),_0x3dab('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 7be051b..af02dce 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 _0x6611=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x197e91,_0x414896){var _0x14bcb7=function(_0x2de849){while(--_0x2de849){_0x197e91['push'](_0x197e91['shift']());}};_0x14bcb7(++_0x414896);}(_0x6611,0xdd));var _0x1661=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x6611[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x1661('0x0'));var moment=require(_0x1661('0x1'));var BPromise=require(_0x1661('0x2'));var rs=require(_0x1661('0x3'));var fs=require('fs');var Redis=require(_0x1661('0x4'));var db=require(_0x1661('0x5'))['db'];var utils=require(_0x1661('0x6'));var logger=require(_0x1661('0x7'))(_0x1661('0x8'));var config=require(_0x1661('0x9'));var jayson=require(_0x1661('0xa'));var client=jayson[_0x1661('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x516d22,_0x3f32f3,_0x3be60f){return new BPromise(function(_0x57e4b8,_0x49d57a){return client[_0x1661('0xc')](_0x516d22,_0x3be60f)[_0x1661('0xd')](function(_0x28026e){logger[_0x1661('0xe')](_0x1661('0xf'),_0x3f32f3,_0x1661('0x10'));logger[_0x1661('0x11')](_0x1661('0x12'),_0x3f32f3,'request\x20sent',JSON[_0x1661('0x13')](_0x28026e));if(_0x28026e[_0x1661('0x14')]){if(_0x28026e['error'][_0x1661('0x15')]===0x1f4){logger['error'](_0x1661('0xf'),_0x3f32f3,_0x28026e[_0x1661('0x14')][_0x1661('0x16')]);return _0x49d57a(_0x28026e[_0x1661('0x14')][_0x1661('0x16')]);}logger[_0x1661('0x14')](_0x1661('0xf'),_0x3f32f3,_0x28026e[_0x1661('0x14')][_0x1661('0x16')]);return _0x57e4b8(_0x28026e[_0x1661('0x14')][_0x1661('0x16')]);}else{logger[_0x1661('0xe')](_0x1661('0xf'),_0x3f32f3,'request\x20sent');_0x57e4b8(_0x28026e['result'][_0x1661('0x16')]);}})[_0x1661('0x17')](function(_0x55ef62){logger[_0x1661('0x14')](_0x1661('0xf'),_0x3f32f3,_0x55ef62);_0x49d57a(_0x55ef62);});});} \ No newline at end of file +var _0x4787=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent'];(function(_0x1294d2,_0x3abe70){var _0x2fd128=function(_0x1fee69){while(--_0x1fee69){_0x1294d2['push'](_0x1294d2['shift']());}};_0x2fd128(++_0x3abe70);}(_0x4787,0x148));var _0x7478=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x4787[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require('lodash');var util=require(_0x7478('0x0'));var moment=require(_0x7478('0x1'));var BPromise=require(_0x7478('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7478('0x3'));var db=require(_0x7478('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7478('0x5'))(_0x7478('0x6'));var config=require(_0x7478('0x7'));var jayson=require(_0x7478('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4042a3,_0x5df7ad,_0xc88906){return new BPromise(function(_0xd7efb1,_0x135ae9){return client[_0x7478('0x9')](_0x4042a3,_0xc88906)[_0x7478('0xa')](function(_0x3a5afd){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x5df7ad,_0x7478('0xb'));logger['debug'](_0x7478('0xc'),_0x5df7ad,'request\x20sent',JSON[_0x7478('0xd')](_0x3a5afd));if(_0x3a5afd['error']){if(_0x3a5afd[_0x7478('0xe')]['code']===0x1f4){logger[_0x7478('0xe')](_0x7478('0xf'),_0x5df7ad,_0x3a5afd['error']['message']);return _0x135ae9(_0x3a5afd['error']['message']);}logger[_0x7478('0xe')](_0x7478('0xf'),_0x5df7ad,_0x3a5afd[_0x7478('0xe')][_0x7478('0x10')]);return _0xd7efb1(_0x3a5afd['error']['message']);}else{logger[_0x7478('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5df7ad,_0x7478('0xb'));_0xd7efb1(_0x3a5afd[_0x7478('0x12')]['message']);}})[_0x7478('0x13')](function(_0x3ee0fb){logger[_0x7478('0xe')](_0x7478('0xf'),_0x5df7ad,_0x3ee0fb);_0x135ae9(_0x3ee0fb);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 7f4c695..1f3c06c 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 _0x0e6e=['downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','update','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','/:id/downloads'];(function(_0x495fe9,_0x1349d3){var _0x2bd94c=function(_0xbd3590){while(--_0xbd3590){_0x495fe9['push'](_0x495fe9['shift']());}};_0x2bd94c(++_0x1349d3);}(_0x0e6e,0x170));var _0xe0e6=function(_0x36dda7,_0x2f5b03){_0x36dda7=_0x36dda7-0x0;var _0x1c1502=_0x0e6e[_0x36dda7];return _0x1c1502;};'use strict';var multer=require(_0xe0e6('0x0'));var util=require(_0xe0e6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe0e6('0x2')]();var fs_extra=require(_0xe0e6('0x3'));var auth=require(_0xe0e6('0x4'));var interaction=require(_0xe0e6('0x5'));var config=require('../../config/environment');var controller=require(_0xe0e6('0x6'));router[_0xe0e6('0x7')]('/',auth[_0xe0e6('0x8')](),controller[_0xe0e6('0x9')]);router[_0xe0e6('0x7')](_0xe0e6('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xe0e6('0x7')](_0xe0e6('0xb'),auth[_0xe0e6('0x8')](),controller[_0xe0e6('0xc')]);router[_0xe0e6('0x7')](_0xe0e6('0xd'),auth[_0xe0e6('0x8')](),controller[_0xe0e6('0xe')]);router['get'](_0xe0e6('0xf'),controller[_0xe0e6('0x10')]);router[_0xe0e6('0x7')](_0xe0e6('0x11'),auth['isAuthenticated'](),controller[_0xe0e6('0x12')]);router[_0xe0e6('0x13')]('/',auth['isAuthenticated'](),controller[_0xe0e6('0x14')]);router[_0xe0e6('0x13')](_0xe0e6('0x11'),auth[_0xe0e6('0x8')](),controller[_0xe0e6('0x15')]);router['put'](_0xe0e6('0xb'),auth[_0xe0e6('0x8')](),controller[_0xe0e6('0x16')]);router['delete'](_0xe0e6('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xe0e6('0x17')]=router; \ No newline at end of file +var _0xbfa2=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','index','get','isAuthenticated','describe','/:id','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1cd4e7,_0x5f17dd){var _0x5243eb=function(_0x827ee4){while(--_0x827ee4){_0x1cd4e7['push'](_0x1cd4e7['shift']());}};_0x5243eb(++_0x5f17dd);}(_0xbfa2,0xa4));var _0x2bfa=function(_0x2bc909,_0xaec652){_0x2bc909=_0x2bc909-0x0;var _0x54b918=_0xbfa2[_0x2bc909];return _0x54b918;};'use strict';var multer=require(_0x2bfa('0x0'));var util=require(_0x2bfa('0x1'));var path=require(_0x2bfa('0x2'));var timeout=require(_0x2bfa('0x3'));var express=require(_0x2bfa('0x4'));var router=express[_0x2bfa('0x5')]();var fs_extra=require(_0x2bfa('0x6'));var auth=require(_0x2bfa('0x7'));var interaction=require(_0x2bfa('0x8'));var config=require(_0x2bfa('0x9'));var controller=require(_0x2bfa('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x2bfa('0xb')]);router[_0x2bfa('0xc')]('/describe',auth[_0x2bfa('0xd')](),controller[_0x2bfa('0xe')]);router[_0x2bfa('0xc')](_0x2bfa('0xf'),auth[_0x2bfa('0xd')](),controller['show']);router[_0x2bfa('0xc')](_0x2bfa('0x10'),auth[_0x2bfa('0xd')](),controller[_0x2bfa('0x11')]);router[_0x2bfa('0xc')]('/:id/downloads',controller[_0x2bfa('0x12')]);router[_0x2bfa('0xc')](_0x2bfa('0x13'),auth[_0x2bfa('0xd')](),controller[_0x2bfa('0x14')]);router['post']('/',auth[_0x2bfa('0xd')](),controller['create']);router[_0x2bfa('0x15')]('/:id/transcribe',auth[_0x2bfa('0xd')](),controller[_0x2bfa('0x16')]);router[_0x2bfa('0x17')](_0x2bfa('0xf'),auth['isAuthenticated'](),controller[_0x2bfa('0x18')]);router[_0x2bfa('0x19')](_0x2bfa('0xf'),auth[_0x2bfa('0xd')](),controller[_0x2bfa('0x1a')]);module[_0x2bfa('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 75bb730..b5f2381 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(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 39189f3..6314291 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 _0x17bd=['secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','$and','push','%s.cypher','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Sequelize','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','aws-sdk','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','send','index','map','VoiceRecording','fieldName','type','model','differenceBy','format','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','findAll','catch','show','params','rawAttributes','options','update','body','find','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile'];(function(_0x43c3f9,_0x1861cb){var _0x4f4f54=function(_0x53ac81){while(--_0x53ac81){_0x43c3f9['push'](_0x43c3f9['shift']());}};_0x4f4f54(++_0x1861cb);}(_0x17bd,0xda));var _0xd17b=function(_0x287254,_0x12f7bb){_0x287254=_0x287254-0x0;var _0xe47e9c=_0x17bd[_0x287254];return _0xe47e9c;};'use strict';var emlformat=require(_0xd17b('0x0'));var rimraf=require(_0xd17b('0x1'));var zipdir=require(_0xd17b('0x2'));var jsonpatch=require(_0xd17b('0x3'));var rp=require(_0xd17b('0x4'));var moment=require(_0xd17b('0x5'));var BPromise=require(_0xd17b('0x6'));var Mustache=require(_0xd17b('0x7'));var util=require(_0xd17b('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd17b('0x9'));var fs=require('fs');var fs_extra=require(_0xd17b('0xa'));var _=require(_0xd17b('0xb'));var squel=require(_0xd17b('0xc'));var crypto=require(_0xd17b('0xd'));var jsforce=require(_0xd17b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd17b('0xf'));var querystring=require(_0xd17b('0x10'));var Papa=require(_0xd17b('0x11'));var AWS=require(_0xd17b('0x12'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0xd17b('0x13'));var qs=require(_0xd17b('0x14'));var as=require(_0xd17b('0x15'));var hardwareService=require(_0xd17b('0x16'));var logger=require(_0xd17b('0x17'))(_0xd17b('0x18'));var utils=require(_0xd17b('0x19'));var config=require(_0xd17b('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xd17b('0x1b'))['db'];function respondWithStatusCode(_0x300a10,_0x40c858){_0x40c858=_0x40c858||0xcc;return function(_0xc87805){if(_0xc87805){return _0x300a10['sendStatus'](_0x40c858);}return _0x300a10[_0xd17b('0x1c')](_0x40c858)[_0xd17b('0x1d')]();};}function respondWithResult(_0x3951f1,_0x547cba){_0x547cba=_0x547cba||0xc8;return function(_0x2ad7aa){if(_0x2ad7aa){return _0x3951f1[_0xd17b('0x1c')](_0x547cba)[_0xd17b('0x1e')](_0x2ad7aa);}};}function respondWithFilteredResult(_0x12114d,_0x3b7ed1){return function(_0x55fe9c){if(_0x55fe9c){var _0x18aeb2=typeof _0x3b7ed1[_0xd17b('0x1f')]===_0xd17b('0x20')&&typeof _0x3b7ed1[_0xd17b('0x21')]===_0xd17b('0x20');var _0x27acff=_0x55fe9c[_0xd17b('0x22')];var _0x31e932=_0x18aeb2?0x0:_0x3b7ed1[_0xd17b('0x1f')];var _0xb385fe=_0x18aeb2?_0x55fe9c[_0xd17b('0x22')]:_0x3b7ed1[_0xd17b('0x1f')]+_0x3b7ed1[_0xd17b('0x21')];var _0x5c4f8e;if(_0xb385fe>=_0x27acff){_0xb385fe=_0x27acff;_0x5c4f8e=0xc8;}else{_0x5c4f8e=0xce;}_0x12114d[_0xd17b('0x1c')](_0x5c4f8e);return _0x12114d[_0xd17b('0x23')](_0xd17b('0x24'),_0x31e932+'-'+_0xb385fe+'/'+_0x27acff)[_0xd17b('0x1e')](_0x55fe9c);}return null;};}function patchUpdates(_0xe0ec76){return function(_0x4a16d6){try{jsonpatch['apply'](_0x4a16d6,_0xe0ec76,!![]);}catch(_0x4c36a4){return BPromise[_0xd17b('0x25')](_0x4c36a4);}return _0x4a16d6[_0xd17b('0x26')]();};}function saveUpdates(_0x4b35dc,_0x4498d2){return function(_0x55bc57){if(_0x55bc57){return _0x55bc57['update'](_0x4b35dc)[_0xd17b('0x27')](function(_0x13706f){return _0x13706f;});}return null;};}function removeEntity(_0xdd02a6,_0x533709){return function(_0x4b276d){if(_0x4b276d){return _0x4b276d[_0xd17b('0x28')]()[_0xd17b('0x27')](function(){_0xdd02a6[_0xd17b('0x1c')](0xcc)[_0xd17b('0x1d')]();});}};}function handleEntityNotFound(_0x517853,_0x4f64d1){return function(_0x25a875){if(!_0x25a875){_0x517853[_0xd17b('0x29')](0x194);}return _0x25a875;};}function handleError(_0x475a03,_0x4bacb7){_0x4bacb7=_0x4bacb7||0x1f4;return function(_0x4b47b8){logger[_0xd17b('0x2a')](_0x4b47b8['stack']);if(_0x4b47b8[_0xd17b('0x2b')]){delete _0x4b47b8['name'];}_0x475a03['status'](_0x4bacb7)[_0xd17b('0x2c')](_0x4b47b8);};}exports[_0xd17b('0x2d')]=function(_0x15b297,_0x186592){var _0x4014b3={},_0x9acfa3={},_0x4de9d1={'count':0x0,'rows':[]};var _0x37edf4=_[_0xd17b('0x2e')](db[_0xd17b('0x2f')]['rawAttributes'],function(_0x246648){return{'name':_0x246648[_0xd17b('0x30')],'type':_0x246648[_0xd17b('0x31')]['key']};});_0x9acfa3[_0xd17b('0x32')]=_[_0xd17b('0x33')](_[_0xd17b('0x2e')](_0x37edf4,_0xd17b('0x2b')),[_0xd17b('0x34')]);_0x9acfa3[_0xd17b('0x35')]=_[_0xd17b('0x36')](_0x15b297[_0xd17b('0x35')]);_0x9acfa3['filters']=_['intersection'](_0x9acfa3[_0xd17b('0x32')],_0x9acfa3['query']);_0x4014b3[_0xd17b('0x37')]=_[_0xd17b('0x38')](_0x9acfa3[_0xd17b('0x32')],qs[_0xd17b('0x39')](_0x15b297[_0xd17b('0x35')][_0xd17b('0x39')]));_0x4014b3[_0xd17b('0x37')]=_0x4014b3[_0xd17b('0x37')]['length']?_0x4014b3[_0xd17b('0x37')]:_0x9acfa3[_0xd17b('0x32')];if(!_0x15b297[_0xd17b('0x35')][_0xd17b('0x3a')](_0xd17b('0x3b'))){_0x4014b3['limit']=qs[_0xd17b('0x21')](_0x15b297[_0xd17b('0x35')][_0xd17b('0x21')]);_0x4014b3[_0xd17b('0x1f')]=qs[_0xd17b('0x1f')](_0x15b297[_0xd17b('0x35')][_0xd17b('0x1f')]);}_0x4014b3['order']=qs['sort'](_0x15b297['query'][_0xd17b('0x3c')]);_0x4014b3[_0xd17b('0x3d')]=qs[_0xd17b('0x3e')](_['pick'](_0x15b297[_0xd17b('0x35')],_0x9acfa3[_0xd17b('0x3e')]),_0x37edf4);if(_0x15b297[_0xd17b('0x35')][_0xd17b('0x3f')]){_0x4014b3[_0xd17b('0x3d')]=_[_0xd17b('0x40')](_0x4014b3[_0xd17b('0x3d')],{'$or':_[_0xd17b('0x2e')](_0x37edf4,function(_0x3dbf67){if(_0x3dbf67[_0xd17b('0x31')]!==_0xd17b('0x41')){var _0x1d3302={};_0x1d3302[_0x3dbf67[_0xd17b('0x2b')]]={'$like':'%'+_0x15b297['query'][_0xd17b('0x3f')]+'%'};return _0x1d3302;}})});}_0x4014b3=_[_0xd17b('0x40')]({},_0x4014b3,_0x15b297['options']);var _0x531057={'where':_0x4014b3[_0xd17b('0x3d')]};return db[_0xd17b('0x2f')][_0xd17b('0x22')](_0x531057)['then'](function(_0x30f53b){_0x4de9d1[_0xd17b('0x22')]=_0x30f53b;if(_0x15b297[_0xd17b('0x35')]['includeAll']){_0x4014b3['include']=[{'all':!![]}];}return db[_0xd17b('0x2f')][_0xd17b('0x42')](_0x4014b3);})['then'](function(_0x5e7b46){_0x4de9d1['rows']=_0x5e7b46;return _0x4de9d1;})['then'](respondWithFilteredResult(_0x186592,_0x4014b3))[_0xd17b('0x43')](handleError(_0x186592,null));};exports[_0xd17b('0x44')]=function(_0xa6a524,_0x309b71){var _0x67b549={'raw':![],'where':{'id':_0xa6a524[_0xd17b('0x45')]['id']}},_0x2e27f5={};_0x2e27f5[_0xd17b('0x32')]=_[_0xd17b('0x36')](db[_0xd17b('0x2f')][_0xd17b('0x46')]);_0x2e27f5[_0xd17b('0x35')]=_[_0xd17b('0x36')](_0xa6a524['query']);_0x2e27f5[_0xd17b('0x3e')]=_[_0xd17b('0x38')](_0x2e27f5['model'],_0x2e27f5[_0xd17b('0x35')]);_0x67b549[_0xd17b('0x37')]=_['intersection'](_0x2e27f5['model'],qs[_0xd17b('0x39')](_0xa6a524['query'][_0xd17b('0x39')]));_0x67b549['attributes']=_0x67b549[_0xd17b('0x37')]['length']?_0x67b549[_0xd17b('0x37')]:_0x2e27f5[_0xd17b('0x32')];if(_0xa6a524['query']['includeAll']){_0x67b549['include']=[{'all':!![]}];}_0x67b549=_[_0xd17b('0x40')]({},_0x67b549,_0xa6a524[_0xd17b('0x47')]);return db['VoiceRecording']['find'](_0x67b549)['then'](handleEntityNotFound(_0x309b71,null))[_0xd17b('0x27')](respondWithResult(_0x309b71,null))[_0xd17b('0x43')](handleError(_0x309b71,null));};exports['create']=function(_0x3ffe83,_0x46165c){return db[_0xd17b('0x2f')]['create'](_0x3ffe83['body'],{})['then'](respondWithResult(_0x46165c,0xc9))[_0xd17b('0x43')](handleError(_0x46165c,null));};exports[_0xd17b('0x48')]=function(_0x1cee13,_0x549a64){if(_0x1cee13[_0xd17b('0x49')]['id']){delete _0x1cee13[_0xd17b('0x49')]['id'];}return db[_0xd17b('0x2f')][_0xd17b('0x4a')]({'where':{'id':_0x1cee13[_0xd17b('0x45')]['id']}})['then'](handleEntityNotFound(_0x549a64,null))['then'](saveUpdates(_0x1cee13['body'],null))[_0xd17b('0x27')](respondWithResult(_0x549a64,null))['catch'](handleError(_0x549a64,null));};exports[_0xd17b('0x4b')]=function(_0x3c069e,_0x306cec){return db[_0xd17b('0x2f')][_0xd17b('0x4b')]()[_0xd17b('0x27')](respondWithResult(_0x306cec,null))['catch'](handleError(_0x306cec,null));};exports[_0xd17b('0x4c')]=function(_0x40b852,_0x242fed,_0x23b763){var _0x50047a=require(_0xd17b('0x4d'));var _0x4597b6=![];var _0x25224e={};if(_0x40b852[_0xd17b('0x35')]['type']&&_0x40b852['query']['type']===_0xd17b('0x4e')){_0x25224e[_0xd17b('0x4e')]=_0x40b852[_0xd17b('0x45')]['id'];}else{_0x25224e['id']=_0x40b852[_0xd17b('0x45')]['id'];}return db[_0xd17b('0x2f')][_0xd17b('0x4a')]({'where':_0x25224e,'attributes':['id',_0xd17b('0x4f')],'raw':!![]})[_0xd17b('0x27')](handleEntityNotFound(_0x242fed,null))['then'](function(_0x2b2bcc){if(_0x2b2bcc){var _0x3153e7=_0x2b2bcc[_0xd17b('0x4f')];var _0x2569d2=util[_0xd17b('0x34')]('%s.cypher',_0x3153e7);if(fs[_0xd17b('0x50')](_0x2569d2)){_0x4597b6=!![];return _0x50047a[_0xd17b('0x51')](_0x2569d2,_0x3153e7,config[_0xd17b('0x52')][_0xd17b('0x53')])[_0xd17b('0x27')](function(){return _0x2b2bcc;});}return _0x2b2bcc;}})[_0xd17b('0x27')](function(_0x130c89){if(_0x130c89){var _0x10f5c6=_0x130c89[_0xd17b('0x4f')];if(!fs[_0xd17b('0x50')](_0x10f5c6)){throw new db['Sequelize'][(_0xd17b('0x54'))](_0xd17b('0x55'));}if(_0x130c89[_0xd17b('0x56')]){return _0x242fed[_0xd17b('0x4c')](_0x10f5c6,_0x130c89[_0xd17b('0x56')]+path[_0xd17b('0x57')](_0x10f5c6),function(){if(_0x4597b6){fs[_0xd17b('0x58')](_0x10f5c6);}});}else{return _0x242fed[_0xd17b('0x4c')](_0x10f5c6,function(_0x2105df){if(_0x4597b6){fs[_0xd17b('0x58')](_0x10f5c6);}});}}})[_0xd17b('0x43')](function(_0xd98fd7){if(_0xd98fd7[_0xd17b('0x59')]===_0xd17b('0x55')){_0x242fed['status'](0x194)[_0xd17b('0x2c')]('Not\x20found');}else{return handleError(_0x242fed,null);}});};exports[_0xd17b('0x5a')]=function(_0x4daa2e,_0x3304ac,_0x602862){var _0x41f1a2=require('../../components/encryptor');var _0x4092db=![];var _0x4953e3={'$and':[db[_0xd17b('0x5b')][_0xd17b('0x3d')](db[_0xd17b('0x5b')]['fn'](_0xd17b('0x5c'),db[_0xd17b('0x5b')]['col'](_0xd17b('0x4e'))),_0x4daa2e[_0xd17b('0x35')]['token'])]};if(_0x4daa2e[_0xd17b('0x35')][_0xd17b('0x31')]&&_0x4daa2e[_0xd17b('0x35')][_0xd17b('0x31')]===_0xd17b('0x4e')){_0x4953e3['$and']['push']({'uniqueid':_0x4daa2e['params']['id']});}else{_0x4953e3[_0xd17b('0x5d')][_0xd17b('0x5e')]({'id':_0x4daa2e[_0xd17b('0x45')]['id']});}return db[_0xd17b('0x2f')][_0xd17b('0x4a')]({'where':_0x4953e3,'attributes':['id',_0xd17b('0x4f')],'raw':!![]})[_0xd17b('0x27')](handleEntityNotFound(_0x3304ac,null))[_0xd17b('0x27')](function(_0x55f0dc){if(_0x55f0dc){var _0x2592bb=util[_0xd17b('0x34')](_0xd17b('0x5f'),_0x55f0dc['value']);if(fs[_0xd17b('0x50')](_0x2592bb)){_0x4092db=!![];return _0x41f1a2['decryptFile'](_0x2592bb,_0x55f0dc['value'],config['secrets']['recording'])[_0xd17b('0x27')](function(){return _0x55f0dc;});}return _0x55f0dc;}})[_0xd17b('0x27')](function(_0x26ba49){if(_0x26ba49){if(!fs[_0xd17b('0x50')](_0x26ba49[_0xd17b('0x4f')])){throw new db['Sequelize'][(_0xd17b('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x26ba49[_0xd17b('0x56')]){return _0x3304ac[_0xd17b('0x4c')](_0x26ba49['value'],_0x26ba49[_0xd17b('0x56')]+path[_0xd17b('0x57')](_0x26ba49[_0xd17b('0x4f')]),function(){if(_0x4092db){fs[_0xd17b('0x58')](_0x26ba49[_0xd17b('0x4f')]);}});}else{return _0x3304ac[_0xd17b('0x4c')](_0x26ba49[_0xd17b('0x4f')],function(_0x496e14){if(_0x4092db){fs[_0xd17b('0x58')](_0x26ba49[_0xd17b('0x4f')]);}});}}})[_0xd17b('0x43')](handleError(_0x3304ac,null));};exports['destroy']=function(_0x42f7f1,_0x4d8877){return db[_0xd17b('0x2f')][_0xd17b('0x4a')]({'where':{'id':_0x42f7f1['params']['id']}})[_0xd17b('0x27')](function(_0x345223){if(_[_0xd17b('0x60')](_0x345223)){throw new ReferenceError(_0xd17b('0x61'));}return _0x345223;})[_0xd17b('0x27')](function(_0x3ff1e7){var _0xdd62bc=_0x3ff1e7[_0xd17b('0x4f')];logger[_0xd17b('0x62')]('cancellazione\x20fisica\x20documento\x20%s',_0xdd62bc);if(!_['isNil'](_0x3ff1e7['value'])&&fs['existsSync'](_0xdd62bc)){logger['info'](_0xd17b('0x63')+_0xdd62bc+_0xd17b('0x64'));fs[_0xd17b('0x65')](_0xdd62bc);}_0xdd62bc=_0xdd62bc+_0xd17b('0x66');if(!_['isNil'](_0x3ff1e7[_0xd17b('0x4f')])&&fs['existsSync'](_0xdd62bc)){logger[_0xd17b('0x62')]('File:\x20\x22'+_0xdd62bc+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd17b('0x65')](_0xdd62bc);}return _0x3ff1e7;})[_0xd17b('0x27')](function(_0x2438ba){if(!_0x2438ba)throw new InternalError();return _0x2438ba[_0xd17b('0x28')]();})[_0xd17b('0x27')](function(){_0x4d8877['status'](0xcc)[_0xd17b('0x1d')]();})['catch'](handleError(_0x4d8877,null));};function getBucketslist(_0x12ca7a,_0x401315,_0x333fdd){return new Promise(function(_0x275c21,_0x23d039){var _0x45ed3b=new AWS['S3']({'accessKeyId':_0x401315,'secretAccessKey':_0x12ca7a,'region':_0x333fdd});_0x45ed3b[_0xd17b('0x67')]({},function(_0xe1694,_0x5aaf07){if(_0xe1694){return _0x23d039(_0xe1694);}else{return _0x275c21(_0x5aaf07);}});});}function createBucket(_0x51ac67,_0x3b23fd,_0x579f14,_0x4048bc){return new Promise(function(_0x27dcee,_0x5d2b06){var _0x32af1a=new AWS['S3']({'accessKeyId':_0x3b23fd,'secretAccessKey':_0x51ac67,'region':_0x579f14});_0x32af1a[_0xd17b('0x68')]({'Bucket':_0x4048bc},function(_0x2fbeee,_0x186181){if(_0x2fbeee){return _0x5d2b06(_0x2fbeee);}else{return _0x27dcee(_0x186181);}});});}function uploadFile(_0x66ccf7,_0x3f412c,_0x403277,_0x29f367,_0x42da63,_0x5e171a){return new Promise(function(_0x5b9f22,_0x150cdb){var _0x257656=new AWS['S3']({'accessKeyId':_0x3f412c,'secretAccessKey':_0x66ccf7,'region':_0x403277});_0x257656['upload']({'Bucket':_0x29f367,'Key':_0x42da63,'Body':_0x5e171a},function(_0x1103d1,_0x47b5c4){if(_0x1103d1){return _0x150cdb(_0x1103d1);}else{return _0x5b9f22(_0x47b5c4);}});});}function startTranscribe(_0x50f434,_0x2a84d5,_0x49c30d,_0x272ac0,_0x5124b2,_0x481fd6){return new Promise(function(_0x31e97f,_0x2a7a7f){var _0x390b68=new AWS['TranscribeService']({'accessKeyId':_0x2a84d5,'secretAccessKey':_0x50f434,'region':_0x49c30d});_0x390b68[_0xd17b('0x69')]({'TranscriptionJobName':_0x272ac0,'LanguageCode':_0x5124b2,'Media':{'MediaFileUri':_0x481fd6}},function(_0x53f0d1,_0x5c4be0){if(_0x53f0d1){return _0x2a7a7f(_0x53f0d1);}else{return _0x31e97f(_0x5c4be0);}});});}function transcribe(_0x15574b,_0x3fc92e,_0x227036,_0x4d21c6,_0x221956,_0x28dd50,_0x395f7a){return new Promise(function(_0x453992,_0x3f46f5){var _0xaae8ee={};logger[_0xd17b('0x62')](util[_0xd17b('0x34')](_0xd17b('0x6a'),_0x15574b,_0x221956));return uploadFile(_0x3fc92e,_0x227036,_0x4d21c6,_0x221956,path['basename'](_0x28dd50),fs[_0xd17b('0x6b')](_0x28dd50))['then'](function(_0x3214f2){logger[_0xd17b('0x62')](util[_0xd17b('0x34')](_0xd17b('0x6c'),_0x15574b,_0x221956,_0x3214f2[_0xd17b('0x6d')]));_0xaae8ee[_0xd17b('0x6e')]=_0x3214f2[_0xd17b('0x6f')];_0xaae8ee['location']=_0x3214f2[_0xd17b('0x6d')];logger[_0xd17b('0x62')](util['format'](_0xd17b('0x70'),_0x15574b));return startTranscribe(_0x3fc92e,_0x227036,_0x4d21c6,uuidv4(),_0x395f7a,_0x3214f2[_0xd17b('0x6d')]);})[_0xd17b('0x27')](function(_0x2e938d){logger[_0xd17b('0x62')](util[_0xd17b('0x34')](_0xd17b('0x71'),_0x15574b,_0x2e938d[_0xd17b('0x72')][_0xd17b('0x73')]));_0xaae8ee[_0xd17b('0x74')]=_0x2e938d[_0xd17b('0x72')][_0xd17b('0x73')];_0xaae8ee[_0xd17b('0x75')]=_0x2e938d[_0xd17b('0x72')]['TranscriptionJobStatus'];return _0x453992(_0xaae8ee);})[_0xd17b('0x43')](function(_0x493f40){return _0x3f46f5(_0x493f40);});});}exports[_0xd17b('0x76')]=function(_0x1af444,_0x2050a2,_0x34fb5f){var _0x1d1d3c;var _0xccd027;var _0x43b93e;var _0x3dac4c=require(_0xd17b('0x4d'));return db['VoiceRecording'][_0xd17b('0x77')]({'where':{'id':_0x1af444['params']['id']}})['then'](function(_0x241aa3){if(_0x241aa3){var _0x471eda=util[_0xd17b('0x34')]('%s.cypher',_0x241aa3[_0xd17b('0x4f')]);if(fs[_0xd17b('0x50')](_0x471eda)){cypher=!![];return _0x3dac4c[_0xd17b('0x51')](_0x471eda,_0x241aa3[_0xd17b('0x4f')],config['secrets'][_0xd17b('0x53')])[_0xd17b('0x27')](function(){return _0x241aa3;});}return _0x241aa3;}})[_0xd17b('0x27')](function(_0x576aaa){if(!_0x576aaa){throw new db['Sequelize'][(_0xd17b('0x54'))](_0xd17b('0x78'));}_0xccd027=_0x576aaa;return db[_0xd17b('0x79')][_0xd17b('0x77')]({'where':{'id':0x1}});})[_0xd17b('0x27')](handleEntityNotFound(_0x2050a2,null))[_0xd17b('0x27')](function(_0x9d041d){if(_0x9d041d){_0x1d1d3c=_0x9d041d;if(!_0x1d1d3c[_0xd17b('0x7a')]||!_0x1d1d3c[_0xd17b('0x7b')]||!_0x1d1d3c[_0xd17b('0x7c')]||!_0x1d1d3c[_0xd17b('0x7d')]||!_0x1d1d3c[_0xd17b('0x6e')]){throw new db[(_0xd17b('0x7e'))][(_0xd17b('0x54'))](_0xd17b('0x7f'));}if(_0x1af444[_0xd17b('0x49')]['runSentiment']&&(!_0x1d1d3c[_0xd17b('0x80')]||!_0x1d1d3c[_0xd17b('0x81')]||!_0x1d1d3c[_0xd17b('0x82')]||!_0x1d1d3c[_0xd17b('0x7d')]||!_0x1d1d3c[_0xd17b('0x6e')])){throw new db['Sequelize']['ValidationError'](_0xd17b('0x83'));}return db[_0xd17b('0x84')][_0xd17b('0x77')]({'where':{'id':_0x1d1d3c[_0xd17b('0x7b')]}});}})[_0xd17b('0x27')](function(_0x1c1072){if(!_0x1c1072){throw new db[(_0xd17b('0x7e'))][(_0xd17b('0x54'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1c1072['data1']||!_0x1c1072[_0xd17b('0x85')]){throw new db[(_0xd17b('0x7e'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x43b93e=_0x1c1072;return getBucketslist(_0x43b93e['data1'],_0x43b93e[_0xd17b('0x85')],_0x1d1d3c[_0xd17b('0x7c')]);})[_0xd17b('0x27')](function(_0x43b801){if(_0x43b801&&_0x43b801[_0xd17b('0x86')]){var _0x232776=_[_0xd17b('0x4a')](_0x43b801[_0xd17b('0x86')],function(_0x598e58){return _0x598e58[_0xd17b('0x87')]===_0x1d1d3c[_0xd17b('0x6e')];});if(!_0x232776){logger[_0xd17b('0x62')](util[_0xd17b('0x34')](_0xd17b('0x88'),_0x1af444[_0xd17b('0x45')]['id'],_0x1d1d3c[_0xd17b('0x6e')]));return createBucket(_0x43b93e[_0xd17b('0x89')],_0x43b93e['data2'],_0x1d1d3c['transcribeRegion'],_0x1d1d3c[_0xd17b('0x6e')]);}logger[_0xd17b('0x62')](util[_0xd17b('0x34')](_0xd17b('0x8a'),_0x1af444['params']['id'],_0x1d1d3c[_0xd17b('0x6e')]));return;}})[_0xd17b('0x27')](function(_0x1720c2){if(_0xccd027[_0xd17b('0x75')]===_0xd17b('0x8b')){return transcribe(_0x1af444[_0xd17b('0x45')]['id'],_0x43b93e[_0xd17b('0x89')],_0x43b93e[_0xd17b('0x85')],_0x1d1d3c[_0xd17b('0x7c')],_0x1d1d3c['bucket'],_0xccd027['value'],_0x1d1d3c['language']);}else{logger['info'](util[_0xd17b('0x34')](_0xd17b('0x8c'),_0x1af444[_0xd17b('0x45')]['id']));return{'transcribeStatus':_0xd17b('0x8d')};}})['then'](function(_0x426095){if(_0x426095){_0x426095[_0xd17b('0x8e')]=_0x1af444['body'][_0xd17b('0x8f')];return _0xccd027['updateAttributes'](_0x426095);}})['then'](respondWithResult(_0x2050a2,null))[_0xd17b('0x43')](handleError(_0x2050a2,null));};function writeFile(_0xf1e1,_0x31bf92){return new Promise(function(_0xf9a2ff,_0x3b9d03){fs[_0xd17b('0x90')](_0x31bf92,_0xf1e1,function(_0x34661b,_0x5e5b20){if(_0x34661b){return _0x3b9d03(_0x34661b);}else{return _0xf9a2ff(_0x5e5b20);}});});}exports[_0xd17b('0x91')]=function(_0x1affab,_0x2091d7,_0x4041a1){return db[_0xd17b('0x2f')]['findOne']({'where':{'id':_0x1affab['params']['id']}})[_0xd17b('0x27')](handleEntityNotFound(_0x2091d7))[_0xd17b('0x27')](function(_0x5dd83e){if(_0x5dd83e&&_0x5dd83e[_0xd17b('0x92')]){var _0x1dfcfd=_0x5dd83e[_0xd17b('0x92')];var _0xd8dcbd=config[_0xd17b('0x93')]+'/server/files/transcribes/transcribe_'+_0x5dd83e['id']+_0xd17b('0x94');if(fs[_0xd17b('0x50')](_0xd8dcbd)){return _0xd8dcbd;}return writeFile(_0x1dfcfd,_0xd8dcbd)[_0xd17b('0x27')](function(){return _0xd8dcbd;});}else{throw new db[(_0xd17b('0x7e'))][(_0xd17b('0x54'))](_0xd17b('0x95'));}})['then'](function(_0x5cdc39){return _0x2091d7[_0xd17b('0x4c')](_0x5cdc39);})[_0xd17b('0x43')](handleError(_0x2091d7));}; \ No newline at end of file +var _0x6ec6=['jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','error','stack','name','send','index','VoiceRecording','rawAttributes','type','key','model','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','options','where','includeAll','findAll','rows','show','params','find','catch','create','body','update','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','push','$and','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x528c2d,_0x14c00e){var _0x1d6563=function(_0x33e803){while(--_0x33e803){_0x528c2d['push'](_0x528c2d['shift']());}};_0x1d6563(++_0x14c00e);}(_0x6ec6,0x1ba));var _0x66ec=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0x6ec6[_0x217c2e];return _0x22b7d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x66ec('0x0'));var zipdir=require(_0x66ec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x66ec('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x66ec('0x3'));var path=require(_0x66ec('0x4'));var sox=require(_0x66ec('0x5'));var csv=require(_0x66ec('0x6'));var ejs=require(_0x66ec('0x7'));var fs=require('fs');var fs_extra=require(_0x66ec('0x8'));var _=require(_0x66ec('0x9'));var squel=require(_0x66ec('0xa'));var crypto=require('crypto');var jsforce=require(_0x66ec('0xb'));var deskjs=require(_0x66ec('0xc'));var toCsv=require(_0x66ec('0x6'));var querystring=require(_0x66ec('0xd'));var Papa=require('papaparse');var AWS=require(_0x66ec('0xe'));var uuidv4=require(_0x66ec('0xf'));var Redis=require(_0x66ec('0x10'));var authService=require(_0x66ec('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66ec('0x12'));var logger=require(_0x66ec('0x13'))(_0x66ec('0x14'));var utils=require(_0x66ec('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x66ec('0x16'));var db=require(_0x66ec('0x17'))['db'];function respondWithStatusCode(_0x218667,_0x5048a7){_0x5048a7=_0x5048a7||0xcc;return function(_0x5b6cfb){if(_0x5b6cfb){return _0x218667[_0x66ec('0x18')](_0x5048a7);}return _0x218667['status'](_0x5048a7)[_0x66ec('0x19')]();};}function respondWithResult(_0x4abf50,_0x2130ba){_0x2130ba=_0x2130ba||0xc8;return function(_0x199612){if(_0x199612){return _0x4abf50[_0x66ec('0x1a')](_0x2130ba)['json'](_0x199612);}};}function respondWithFilteredResult(_0x530465,_0x5f3d01){return function(_0x29f487){if(_0x29f487){var _0x46054f=typeof _0x5f3d01[_0x66ec('0x1b')]===_0x66ec('0x1c')&&typeof _0x5f3d01[_0x66ec('0x1d')]===_0x66ec('0x1c');var _0x113e30=_0x29f487[_0x66ec('0x1e')];var _0x3a1819=_0x46054f?0x0:_0x5f3d01['offset'];var _0x2924ee=_0x46054f?_0x29f487[_0x66ec('0x1e')]:_0x5f3d01['offset']+_0x5f3d01['limit'];var _0x2713e3;if(_0x2924ee>=_0x113e30){_0x2924ee=_0x113e30;_0x2713e3=0xc8;}else{_0x2713e3=0xce;}_0x530465[_0x66ec('0x1a')](_0x2713e3);return _0x530465[_0x66ec('0x1f')]('Content-Range',_0x3a1819+'-'+_0x2924ee+'/'+_0x113e30)[_0x66ec('0x20')](_0x29f487);}return null;};}function patchUpdates(_0x274a72){return function(_0x17c446){try{jsonpatch[_0x66ec('0x21')](_0x17c446,_0x274a72,!![]);}catch(_0x53367b){return BPromise[_0x66ec('0x22')](_0x53367b);}return _0x17c446[_0x66ec('0x23')]();};}function saveUpdates(_0x47a0f2,_0x1279e4){return function(_0x5705bd){if(_0x5705bd){return _0x5705bd['update'](_0x47a0f2)[_0x66ec('0x24')](function(_0x5820fe){return _0x5820fe;});}return null;};}function removeEntity(_0x4914d4,_0x2b9c28){return function(_0x51b792){if(_0x51b792){return _0x51b792[_0x66ec('0x25')]()[_0x66ec('0x24')](function(){_0x4914d4[_0x66ec('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29e54c,_0x30f637){return function(_0x2da5b6){if(!_0x2da5b6){_0x29e54c[_0x66ec('0x18')](0x194);}return _0x2da5b6;};}function handleError(_0x2875c7,_0x2c2022){_0x2c2022=_0x2c2022||0x1f4;return function(_0x14a28f){logger[_0x66ec('0x26')](_0x14a28f[_0x66ec('0x27')]);if(_0x14a28f[_0x66ec('0x28')]){delete _0x14a28f[_0x66ec('0x28')];}_0x2875c7['status'](_0x2c2022)[_0x66ec('0x29')](_0x14a28f);};}exports[_0x66ec('0x2a')]=function(_0x588a1f,_0x18af26){var _0xf9e8da={},_0x1d16e3={},_0x3eb64a={'count':0x0,'rows':[]};var _0x480fea=_['map'](db[_0x66ec('0x2b')][_0x66ec('0x2c')],function(_0x202439){return{'name':_0x202439['fieldName'],'type':_0x202439[_0x66ec('0x2d')][_0x66ec('0x2e')]};});_0x1d16e3[_0x66ec('0x2f')]=_['differenceBy'](_['map'](_0x480fea,_0x66ec('0x28')),[_0x66ec('0x30')]);_0x1d16e3['query']=_[_0x66ec('0x31')](_0x588a1f[_0x66ec('0x32')]);_0x1d16e3[_0x66ec('0x33')]=_[_0x66ec('0x34')](_0x1d16e3[_0x66ec('0x2f')],_0x1d16e3[_0x66ec('0x32')]);_0xf9e8da[_0x66ec('0x35')]=_['intersection'](_0x1d16e3[_0x66ec('0x2f')],qs[_0x66ec('0x36')](_0x588a1f[_0x66ec('0x32')]['fields']));_0xf9e8da[_0x66ec('0x35')]=_0xf9e8da[_0x66ec('0x35')][_0x66ec('0x37')]?_0xf9e8da[_0x66ec('0x35')]:_0x1d16e3[_0x66ec('0x2f')];if(!_0x588a1f[_0x66ec('0x32')][_0x66ec('0x38')](_0x66ec('0x39'))){_0xf9e8da[_0x66ec('0x1d')]=qs['limit'](_0x588a1f['query'][_0x66ec('0x1d')]);_0xf9e8da[_0x66ec('0x1b')]=qs[_0x66ec('0x1b')](_0x588a1f[_0x66ec('0x32')]['offset']);}_0xf9e8da[_0x66ec('0x3a')]=qs['sort'](_0x588a1f['query']['sort']);_0xf9e8da['where']=qs['filters'](_[_0x66ec('0x3b')](_0x588a1f['query'],_0x1d16e3['filters']),_0x480fea);if(_0x588a1f[_0x66ec('0x32')][_0x66ec('0x3c')]){_0xf9e8da['where']=_[_0x66ec('0x3d')](_0xf9e8da['where'],{'$or':_['map'](_0x480fea,function(_0x22b568){if(_0x22b568[_0x66ec('0x2d')]!=='VIRTUAL'){var _0x41ea15={};_0x41ea15[_0x22b568[_0x66ec('0x28')]]={'$like':'%'+_0x588a1f[_0x66ec('0x32')][_0x66ec('0x3c')]+'%'};return _0x41ea15;}})});}_0xf9e8da=_[_0x66ec('0x3d')]({},_0xf9e8da,_0x588a1f[_0x66ec('0x3e')]);var _0x4a6e2b={'where':_0xf9e8da[_0x66ec('0x3f')]};return db[_0x66ec('0x2b')]['count'](_0x4a6e2b)[_0x66ec('0x24')](function(_0x3540fc){_0x3eb64a[_0x66ec('0x1e')]=_0x3540fc;if(_0x588a1f[_0x66ec('0x32')][_0x66ec('0x40')]){_0xf9e8da['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x66ec('0x41')](_0xf9e8da);})[_0x66ec('0x24')](function(_0xe3e6b5){_0x3eb64a[_0x66ec('0x42')]=_0xe3e6b5;return _0x3eb64a;})[_0x66ec('0x24')](respondWithFilteredResult(_0x18af26,_0xf9e8da))['catch'](handleError(_0x18af26,null));};exports[_0x66ec('0x43')]=function(_0x3ea0bf,_0x3bc117){var _0x17aec9={'raw':![],'where':{'id':_0x3ea0bf[_0x66ec('0x44')]['id']}},_0xd0bf67={};_0xd0bf67[_0x66ec('0x2f')]=_[_0x66ec('0x31')](db[_0x66ec('0x2b')][_0x66ec('0x2c')]);_0xd0bf67['query']=_[_0x66ec('0x31')](_0x3ea0bf['query']);_0xd0bf67[_0x66ec('0x33')]=_['intersection'](_0xd0bf67['model'],_0xd0bf67[_0x66ec('0x32')]);_0x17aec9[_0x66ec('0x35')]=_[_0x66ec('0x34')](_0xd0bf67[_0x66ec('0x2f')],qs['fields'](_0x3ea0bf[_0x66ec('0x32')][_0x66ec('0x36')]));_0x17aec9['attributes']=_0x17aec9[_0x66ec('0x35')][_0x66ec('0x37')]?_0x17aec9['attributes']:_0xd0bf67[_0x66ec('0x2f')];if(_0x3ea0bf[_0x66ec('0x32')]['includeAll']){_0x17aec9['include']=[{'all':!![]}];}_0x17aec9=_[_0x66ec('0x3d')]({},_0x17aec9,_0x3ea0bf[_0x66ec('0x3e')]);return db[_0x66ec('0x2b')][_0x66ec('0x45')](_0x17aec9)[_0x66ec('0x24')](handleEntityNotFound(_0x3bc117,null))[_0x66ec('0x24')](respondWithResult(_0x3bc117,null))[_0x66ec('0x46')](handleError(_0x3bc117,null));};exports[_0x66ec('0x47')]=function(_0x4e792b,_0x4b2f90){return db[_0x66ec('0x2b')][_0x66ec('0x47')](_0x4e792b[_0x66ec('0x48')],{})[_0x66ec('0x24')](respondWithResult(_0x4b2f90,0xc9))[_0x66ec('0x46')](handleError(_0x4b2f90,null));};exports[_0x66ec('0x49')]=function(_0x5c3423,_0x41a2cf){if(_0x5c3423[_0x66ec('0x48')]['id']){delete _0x5c3423[_0x66ec('0x48')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x5c3423['params']['id']}})[_0x66ec('0x24')](handleEntityNotFound(_0x41a2cf,null))['then'](saveUpdates(_0x5c3423['body'],null))[_0x66ec('0x24')](respondWithResult(_0x41a2cf,null))[_0x66ec('0x46')](handleError(_0x41a2cf,null));};exports['describe']=function(_0x39575b,_0x3091e7){return db[_0x66ec('0x2b')][_0x66ec('0x4a')]()[_0x66ec('0x24')](respondWithResult(_0x3091e7,null))[_0x66ec('0x46')](handleError(_0x3091e7,null));};exports[_0x66ec('0x4b')]=function(_0xaa3c29,_0x401d74,_0x582757){var _0x38f684=require(_0x66ec('0x4c'));var _0x3cac00=![];var _0x39c8b3={};if(_0xaa3c29[_0x66ec('0x32')]['type']&&_0xaa3c29[_0x66ec('0x32')][_0x66ec('0x2d')]===_0x66ec('0x4d')){_0x39c8b3[_0x66ec('0x4d')]=_0xaa3c29[_0x66ec('0x44')]['id'];}else{_0x39c8b3['id']=_0xaa3c29[_0x66ec('0x44')]['id'];}return db[_0x66ec('0x2b')][_0x66ec('0x45')]({'where':_0x39c8b3,'attributes':['id',_0x66ec('0x4e')],'raw':!![]})[_0x66ec('0x24')](handleEntityNotFound(_0x401d74,null))[_0x66ec('0x24')](function(_0x598db5){if(_0x598db5){var _0x2ef6d6=_0x598db5['value'];var _0x1f0677=util[_0x66ec('0x30')](_0x66ec('0x4f'),_0x2ef6d6);if(fs['existsSync'](_0x1f0677)){_0x3cac00=!![];return _0x38f684[_0x66ec('0x50')](_0x1f0677,_0x2ef6d6,config[_0x66ec('0x51')][_0x66ec('0x52')])[_0x66ec('0x24')](function(){return _0x598db5;});}return _0x598db5;}})[_0x66ec('0x24')](function(_0x110738){if(_0x110738){var _0x10ea5e=_0x110738[_0x66ec('0x4e')];if(!fs[_0x66ec('0x53')](_0x10ea5e)){throw new db[(_0x66ec('0x54'))][(_0x66ec('0x55'))](_0x66ec('0x56'));}if(_0x110738[_0x66ec('0x57')]){return _0x401d74[_0x66ec('0x4b')](_0x10ea5e,_0x110738[_0x66ec('0x57')]+path[_0x66ec('0x58')](_0x10ea5e),function(){if(_0x3cac00){fs[_0x66ec('0x59')](_0x10ea5e);}});}else{return _0x401d74[_0x66ec('0x4b')](_0x10ea5e,function(_0x1a02c6){if(_0x3cac00){fs[_0x66ec('0x59')](_0x10ea5e);}});}}})[_0x66ec('0x46')](function(_0x18afd3){if(_0x18afd3[_0x66ec('0x5a')]==='VoiceRecording\x20not\x20found'){_0x401d74[_0x66ec('0x1a')](0x194)[_0x66ec('0x29')](_0x66ec('0x5b'));}else{return handleError(_0x401d74,null);}});};exports[_0x66ec('0x5c')]=function(_0x26c15b,_0xd4b0b4,_0x38292e){var _0x17c573=require(_0x66ec('0x4c'));var _0x514a7e=![];var _0x1f44bc={'$and':[db[_0x66ec('0x5d')][_0x66ec('0x3f')](db[_0x66ec('0x5d')]['fn'](_0x66ec('0x5e'),db['sequelize'][_0x66ec('0x5f')](_0x66ec('0x4d'))),_0x26c15b[_0x66ec('0x32')][_0x66ec('0x60')])]};if(_0x26c15b[_0x66ec('0x32')]['type']&&_0x26c15b['query']['type']===_0x66ec('0x4d')){_0x1f44bc['$and'][_0x66ec('0x61')]({'uniqueid':_0x26c15b[_0x66ec('0x44')]['id']});}else{_0x1f44bc[_0x66ec('0x62')][_0x66ec('0x61')]({'id':_0x26c15b[_0x66ec('0x44')]['id']});}return db['VoiceRecording'][_0x66ec('0x45')]({'where':_0x1f44bc,'attributes':['id',_0x66ec('0x4e')],'raw':!![]})[_0x66ec('0x24')](handleEntityNotFound(_0xd4b0b4,null))['then'](function(_0x51f343){if(_0x51f343){var _0x4e8592=util[_0x66ec('0x30')]('%s.cypher',_0x51f343[_0x66ec('0x4e')]);if(fs[_0x66ec('0x53')](_0x4e8592)){_0x514a7e=!![];return _0x17c573[_0x66ec('0x50')](_0x4e8592,_0x51f343[_0x66ec('0x4e')],config[_0x66ec('0x51')][_0x66ec('0x52')])['then'](function(){return _0x51f343;});}return _0x51f343;}})[_0x66ec('0x24')](function(_0x59e4f5){if(_0x59e4f5){if(!fs['existsSync'](_0x59e4f5[_0x66ec('0x4e')])){throw new db['Sequelize']['ValidationError'](_0x66ec('0x56'));}if(_0x59e4f5[_0x66ec('0x57')]){return _0xd4b0b4[_0x66ec('0x4b')](_0x59e4f5[_0x66ec('0x4e')],_0x59e4f5[_0x66ec('0x57')]+path[_0x66ec('0x58')](_0x59e4f5[_0x66ec('0x4e')]),function(){if(_0x514a7e){fs[_0x66ec('0x59')](_0x59e4f5[_0x66ec('0x4e')]);}});}else{return _0xd4b0b4['download'](_0x59e4f5[_0x66ec('0x4e')],function(_0x213fa8){if(_0x514a7e){fs[_0x66ec('0x59')](_0x59e4f5[_0x66ec('0x4e')]);}});}}})[_0x66ec('0x46')](handleError(_0xd4b0b4,null));};exports['destroy']=function(_0x5f33b7,_0x332ff4){return db[_0x66ec('0x2b')][_0x66ec('0x45')]({'where':{'id':_0x5f33b7[_0x66ec('0x44')]['id']}})['then'](function(_0x19fec3){if(_[_0x66ec('0x63')](_0x19fec3)){throw new ReferenceError(_0x66ec('0x64'));}return _0x19fec3;})[_0x66ec('0x24')](function(_0x51119f){var _0xb63c19=_0x51119f[_0x66ec('0x4e')];logger[_0x66ec('0x65')](_0x66ec('0x66'),_0xb63c19);if(!_['isNil'](_0x51119f[_0x66ec('0x4e')])&&fs['existsSync'](_0xb63c19)){logger[_0x66ec('0x65')](_0x66ec('0x67')+_0xb63c19+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x66ec('0x68')](_0xb63c19);}_0xb63c19=_0xb63c19+_0x66ec('0x69');if(!_[_0x66ec('0x63')](_0x51119f['value'])&&fs[_0x66ec('0x53')](_0xb63c19)){logger[_0x66ec('0x65')]('File:\x20\x22'+_0xb63c19+_0x66ec('0x6a'));fs['unlinkSync'](_0xb63c19);}return _0x51119f;})[_0x66ec('0x24')](function(_0x451fd1){if(!_0x451fd1)throw new InternalError();return _0x451fd1[_0x66ec('0x25')]();})[_0x66ec('0x24')](function(){_0x332ff4['status'](0xcc)[_0x66ec('0x19')]();})[_0x66ec('0x46')](handleError(_0x332ff4,null));};function getBucketslist(_0x310866,_0x4a6faa,_0x1f3128){return new Promise(function(_0x1c95b6,_0x4f14f2){var _0x3ee9d5=new AWS['S3']({'accessKeyId':_0x4a6faa,'secretAccessKey':_0x310866,'region':_0x1f3128});_0x3ee9d5[_0x66ec('0x6b')]({},function(_0x3d4085,_0x5c0691){if(_0x3d4085){return _0x4f14f2(_0x3d4085);}else{return _0x1c95b6(_0x5c0691);}});});}function createBucket(_0x5798e1,_0x45028e,_0x5f2020,_0x3bdd33){return new Promise(function(_0x185a72,_0x5e70e1){var _0x1a4865=new AWS['S3']({'accessKeyId':_0x45028e,'secretAccessKey':_0x5798e1,'region':_0x5f2020});_0x1a4865['createBucket']({'Bucket':_0x3bdd33},function(_0x55ecd1,_0x12cf17){if(_0x55ecd1){return _0x5e70e1(_0x55ecd1);}else{return _0x185a72(_0x12cf17);}});});}function uploadFile(_0x2d0263,_0x4e7cf4,_0xb505a2,_0x5c8ae9,_0x201075,_0x528954){return new Promise(function(_0x25268a,_0x4f6dd7){var _0x595e65=new AWS['S3']({'accessKeyId':_0x4e7cf4,'secretAccessKey':_0x2d0263,'region':_0xb505a2});_0x595e65[_0x66ec('0x6c')]({'Bucket':_0x5c8ae9,'Key':_0x201075,'Body':_0x528954},function(_0xa68d78,_0x3175d2){if(_0xa68d78){return _0x4f6dd7(_0xa68d78);}else{return _0x25268a(_0x3175d2);}});});}function startTranscribe(_0x2e451e,_0x32ef55,_0x317888,_0x99f9da,_0x2cfd58,_0x5903b5){return new Promise(function(_0x47be3c,_0x4cb617){var _0x2db340=new AWS[(_0x66ec('0x6d'))]({'accessKeyId':_0x32ef55,'secretAccessKey':_0x2e451e,'region':_0x317888});_0x2db340[_0x66ec('0x6e')]({'TranscriptionJobName':_0x99f9da,'LanguageCode':_0x2cfd58,'Media':{'MediaFileUri':_0x5903b5}},function(_0x271319,_0x5a84a7){if(_0x271319){return _0x4cb617(_0x271319);}else{return _0x47be3c(_0x5a84a7);}});});}function transcribe(_0x46e3ca,_0x2d47f7,_0x5d5825,_0x4e5cd8,_0x50501b,_0x5f01f3,_0x49dc4f){return new Promise(function(_0x292c44,_0x58ec02){var _0x475a2e={};logger[_0x66ec('0x65')](util['format'](_0x66ec('0x6f'),_0x46e3ca,_0x50501b));return uploadFile(_0x2d47f7,_0x5d5825,_0x4e5cd8,_0x50501b,path[_0x66ec('0x70')](_0x5f01f3),fs[_0x66ec('0x71')](_0x5f01f3))[_0x66ec('0x24')](function(_0x2c5124){logger['info'](util[_0x66ec('0x30')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x46e3ca,_0x50501b,_0x2c5124[_0x66ec('0x72')]));_0x475a2e[_0x66ec('0x73')]=_0x2c5124['Bucket'];_0x475a2e['location']=_0x2c5124[_0x66ec('0x72')];logger['info'](util['format'](_0x66ec('0x74'),_0x46e3ca));return startTranscribe(_0x2d47f7,_0x5d5825,_0x4e5cd8,uuidv4(),_0x49dc4f,_0x2c5124[_0x66ec('0x72')]);})[_0x66ec('0x24')](function(_0x215d30){logger[_0x66ec('0x65')](util[_0x66ec('0x30')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x46e3ca,_0x215d30[_0x66ec('0x75')][_0x66ec('0x76')]));_0x475a2e[_0x66ec('0x77')]=_0x215d30[_0x66ec('0x75')]['TranscriptionJobName'];_0x475a2e[_0x66ec('0x78')]=_0x215d30['TranscriptionJob'][_0x66ec('0x79')];return _0x292c44(_0x475a2e);})[_0x66ec('0x46')](function(_0x4ca84d){return _0x58ec02(_0x4ca84d);});});}exports[_0x66ec('0x7a')]=function(_0x2a25ad,_0x326428,_0x154593){var _0x48abe9;var _0x525bdf;var _0x5c4210;var _0x809407=require(_0x66ec('0x4c'));return db[_0x66ec('0x2b')][_0x66ec('0x7b')]({'where':{'id':_0x2a25ad[_0x66ec('0x44')]['id']}})[_0x66ec('0x24')](function(_0x4dd8a6){if(_0x4dd8a6){var _0x1caa44=util[_0x66ec('0x30')](_0x66ec('0x4f'),_0x4dd8a6[_0x66ec('0x4e')]);if(fs[_0x66ec('0x53')](_0x1caa44)){cypher=!![];return _0x809407[_0x66ec('0x50')](_0x1caa44,_0x4dd8a6[_0x66ec('0x4e')],config[_0x66ec('0x51')]['recording'])[_0x66ec('0x24')](function(){return _0x4dd8a6;});}return _0x4dd8a6;}})[_0x66ec('0x24')](function(_0x3e8624){if(!_0x3e8624){throw new db['Sequelize'][(_0x66ec('0x55'))](_0x66ec('0x7c'));}_0x525bdf=_0x3e8624;return db[_0x66ec('0x7d')][_0x66ec('0x7b')]({'where':{'id':0x1}});})[_0x66ec('0x24')](handleEntityNotFound(_0x326428,null))[_0x66ec('0x24')](function(_0x35372b){if(_0x35372b){_0x48abe9=_0x35372b;if(!_0x48abe9['transcribe']||!_0x48abe9[_0x66ec('0x7e')]||!_0x48abe9[_0x66ec('0x7f')]||!_0x48abe9[_0x66ec('0x80')]||!_0x48abe9[_0x66ec('0x73')]){throw new db[(_0x66ec('0x54'))]['ValidationError'](_0x66ec('0x81'));}if(_0x2a25ad[_0x66ec('0x48')][_0x66ec('0x82')]&&(!_0x48abe9[_0x66ec('0x83')]||!_0x48abe9[_0x66ec('0x84')]||!_0x48abe9[_0x66ec('0x85')]||!_0x48abe9[_0x66ec('0x80')]||!_0x48abe9['bucket'])){throw new db[(_0x66ec('0x54'))][(_0x66ec('0x55'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0x66ec('0x7b')]({'where':{'id':_0x48abe9['transcribeAccountId']}});}})[_0x66ec('0x24')](function(_0x218866){if(!_0x218866){throw new db[(_0x66ec('0x54'))]['ValidationError'](_0x66ec('0x86'));}if(!_0x218866['data1']||!_0x218866[_0x66ec('0x87')]){throw new db[(_0x66ec('0x54'))][(_0x66ec('0x55'))](_0x66ec('0x88'));}_0x5c4210=_0x218866;return getBucketslist(_0x5c4210[_0x66ec('0x89')],_0x5c4210[_0x66ec('0x87')],_0x48abe9['transcribeRegion']);})['then'](function(_0x4ad114){if(_0x4ad114&&_0x4ad114['Buckets']){var _0x265f5e=_['find'](_0x4ad114[_0x66ec('0x8a')],function(_0x3f85f3){return _0x3f85f3['Name']===_0x48abe9[_0x66ec('0x73')];});if(!_0x265f5e){logger[_0x66ec('0x65')](util[_0x66ec('0x30')](_0x66ec('0x8b'),_0x2a25ad[_0x66ec('0x44')]['id'],_0x48abe9[_0x66ec('0x73')]));return createBucket(_0x5c4210[_0x66ec('0x89')],_0x5c4210[_0x66ec('0x87')],_0x48abe9[_0x66ec('0x7f')],_0x48abe9[_0x66ec('0x73')]);}logger[_0x66ec('0x65')](util[_0x66ec('0x30')](_0x66ec('0x8c'),_0x2a25ad['params']['id'],_0x48abe9[_0x66ec('0x73')]));return;}})['then'](function(_0x3373e0){if(_0x525bdf[_0x66ec('0x78')]===_0x66ec('0x8d')){return transcribe(_0x2a25ad[_0x66ec('0x44')]['id'],_0x5c4210[_0x66ec('0x89')],_0x5c4210['data2'],_0x48abe9['transcribeRegion'],_0x48abe9[_0x66ec('0x73')],_0x525bdf[_0x66ec('0x4e')],_0x48abe9[_0x66ec('0x80')]);}else{logger[_0x66ec('0x65')](util[_0x66ec('0x30')](_0x66ec('0x8e'),_0x2a25ad[_0x66ec('0x44')]['id']));return{'transcribeStatus':_0x66ec('0x8f')};}})[_0x66ec('0x24')](function(_0xd9a00f){if(_0xd9a00f){_0xd9a00f['tempSentiment']=_0x2a25ad['body'][_0x66ec('0x82')];return _0x525bdf[_0x66ec('0x90')](_0xd9a00f);}})[_0x66ec('0x24')](respondWithResult(_0x326428,null))[_0x66ec('0x46')](handleError(_0x326428,null));};function writeFile(_0xe8c189,_0x48f445){return new Promise(function(_0x6c10e0,_0x19d63b){fs['writeFile'](_0x48f445,_0xe8c189,function(_0x5527c9,_0x2a6ec2){if(_0x5527c9){return _0x19d63b(_0x5527c9);}else{return _0x6c10e0(_0x2a6ec2);}});});}exports[_0x66ec('0x91')]=function(_0x3591a4,_0x4905e1,_0xb3a109){return db[_0x66ec('0x2b')][_0x66ec('0x7b')]({'where':{'id':_0x3591a4[_0x66ec('0x44')]['id']}})[_0x66ec('0x24')](handleEntityNotFound(_0x4905e1))['then'](function(_0x468645){if(_0x468645&&_0x468645[_0x66ec('0x92')]){var _0x1b74e9=_0x468645['fileText'];var _0x51154b=config[_0x66ec('0x93')]+_0x66ec('0x94')+_0x468645['id']+_0x66ec('0x95');if(fs[_0x66ec('0x53')](_0x51154b)){return _0x51154b;}return writeFile(_0x1b74e9,_0x51154b)[_0x66ec('0x24')](function(){return _0x51154b;});}else{throw new db[(_0x66ec('0x54'))][(_0x66ec('0x55'))](_0x66ec('0x96'));}})[_0x66ec('0x24')](function(_0x301828){return _0x4905e1[_0x66ec('0x4b')](_0x301828);})[_0x66ec('0x46')](handleError(_0x4905e1));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 01e3fd2..f13d1c3 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 _0x644a=['transcribeStatus','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid'];(function(_0x770a81,_0x1737bc){var _0x5223ad=function(_0x16c892){while(--_0x16c892){_0x770a81['push'](_0x770a81['shift']());}};_0x5223ad(++_0x1737bc);}(_0x644a,0xfd));var _0xa644=function(_0xfa716b,_0x1fa236){_0xfa716b=_0xfa716b-0x0;var _0xe946ab=_0x644a[_0xfa716b];return _0xe946ab;};'use strict';var attributes=require(_0xa644('0x0'));module[_0xa644('0x1')]=function(_0x32ada1,_0x286d20){return _0x32ada1[_0xa644('0x2')]('VoiceRecording',attributes,{'tableName':_0xa644('0x3'),'paranoid':![],'indexes':[{'name':_0xa644('0x4'),'fields':['uniqueid']},{'name':'transcribeStatus','fields':[_0xa644('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5712=['define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports'];(function(_0x2331ef,_0x141f5c){var _0x76f8bc=function(_0xbf7846){while(--_0xbf7846){_0x2331ef['push'](_0x2331ef['shift']());}};_0x76f8bc(++_0x141f5c);}(_0x5712,0x140));var _0x2571=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5712[_0x501510];return _0x1e6ee5;};'use strict';var attributes=require(_0x2571('0x0'));module[_0x2571('0x1')]=function(_0x247ab0,_0x2e56c3){return _0x247ab0[_0x2571('0x2')](_0x2571('0x3'),attributes,{'tableName':_0x2571('0x4'),'paranoid':![],'indexes':[{'name':_0x2571('0x5'),'fields':[_0x2571('0x5')]},{'name':_0x2571('0x6'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 231b3c8..e7e1e3e 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4975=['catch','VoiceRecording','update','body','options','raw','where','limit','then','UpdateVoiceRecording','CreateVoiceRecording','create','value','format','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5a7fbc,_0xa081de){var _0xcba0fc=function(_0x4f083b){while(--_0x4f083b){_0x5a7fbc['push'](_0x5a7fbc['shift']());}};_0xcba0fc(++_0xa081de);}(_0x4975,0x86));var _0x5497=function(_0x24ddec,_0x1afc7f){_0x24ddec=_0x24ddec-0x0;var _0x3caaba=_0x4975[_0x24ddec];return _0x3caaba;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}exports['UpdateVoiceRecording']=function(_0x3f4d20){var _0x1bf442=this;return new Promise(function(_0x3a47fd,_0x5d9e24){return db[_0x5497('0x17')][_0x5497('0x18')](_0x3f4d20[_0x5497('0x19')],{'raw':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1c')]||null:null,'attributes':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')]['attributes']||null:null,'limit':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20['options'][_0x5497('0x1d')]||null:null})[_0x5497('0x1e')](function(_0x44265c){logger[_0x5497('0xd')](_0x5497('0x1f'),_0x3f4d20);logger[_0x5497('0x10')]('UpdateVoiceRecording',_0x3f4d20,JSON['stringify'](_0x44265c));_0x3a47fd(_0x44265c);})[_0x5497('0x16')](function(_0x34b97f){logger[_0x5497('0x13')](_0x5497('0x1f'),_0x34b97f['message'],_0x3f4d20);_0x5d9e24(_0x1bf442[_0x5497('0x13')](0x1f4,_0x34b97f['message']));});});};exports[_0x5497('0x20')]=function(_0x16a2b4){var _0x429d36=this;return new Promise(function(_0x34a1a5,_0x163a30){var _0x31cd01=require('../../components/encryptor');var _0x4af5f4;return db['Setting']['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5497('0x1e')](function(_0x48d146){_0x4af5f4=_0x48d146;return db['VoiceRecording'][_0x5497('0x21')](_0x16a2b4[_0x5497('0x19')]);})[_0x5497('0x1e')](function(_0x4c442a){if(_0x4af5f4['callRecordingEncryption']&&fs['existsSync'](_0x4c442a[_0x5497('0x22')])){var _0x471e0b=util[_0x5497('0x23')]('%s.cypher',_0x4c442a['value']);return _0x31cd01['encryptFile'](_0x4c442a[_0x5497('0x22')],_0x471e0b,config['secrets'][_0x5497('0x24')])[_0x5497('0x1e')](function(){fs[_0x5497('0x25')](_0x4c442a['value']);logger[_0x5497('0xd')](_0x5497('0x26'));return _0x4c442a;});}return _0x4c442a;})['then'](function(_0xce7cb2){logger[_0x5497('0xd')](_0x5497('0x20'),_0x16a2b4);logger['debug'](_0x5497('0x20'),_0x16a2b4,JSON[_0x5497('0x12')](_0xce7cb2));_0x34a1a5(_0xce7cb2);})[_0x5497('0x16')](function(_0x362b96){logger[_0x5497('0x13')]('CreateVoiceRecording',_0x362b96[_0x5497('0x14')],_0x16a2b4);_0x163a30(_0x429d36[_0x5497('0x13')](0x1f4,_0x362b96['message']));});});}; \ No newline at end of file +var _0xd824=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','then','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash'];(function(_0x182373,_0xe48703){var _0x4e60d3=function(_0x255265){while(--_0x255265){_0x182373['push'](_0x182373['shift']());}};_0x4e60d3(++_0xe48703);}(_0xd824,0xc2));var _0x4d82=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd824[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b842f,_0x464caf,_0xb54db2){return new BPromise(function(_0x13d624,_0x5cccb6){return client[_0x4d82('0x9')](_0x4b842f,_0xb54db2)['then'](function(_0x5356cd){logger[_0x4d82('0xa')](_0x4d82('0xb'),_0x464caf,_0x4d82('0xc'));logger['debug'](_0x4d82('0xd'),_0x464caf,'request\x20sent',JSON[_0x4d82('0xe')](_0x5356cd));if(_0x5356cd[_0x4d82('0xf')]){if(_0x5356cd[_0x4d82('0xf')]['code']===0x1f4){logger['error'](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')][_0x4d82('0x10')]);return _0x5cccb6(_0x5356cd[_0x4d82('0xf')]['message']);}logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')]['message']);return _0x13d624(_0x5356cd[_0x4d82('0xf')]['message']);}else{logger[_0x4d82('0xa')]('VoiceRecording,\x20%s,\x20%s',_0x464caf,_0x4d82('0xc'));_0x13d624(_0x5356cd['result'][_0x4d82('0x10')]);}})[_0x4d82('0x11')](function(_0x461476){logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x461476);_0x5cccb6(_0x461476);});});}exports[_0x4d82('0x12')]=function(_0x258c59){var _0x217b72=this;return new Promise(function(_0x2f2127,_0x5ef783){return db[_0x4d82('0x13')][_0x4d82('0x14')](_0x258c59[_0x4d82('0x15')],{'raw':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')][_0x4d82('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')][_0x4d82('0x18')]||null:null,'attributes':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')]['attributes']||null:null,'limit':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')]['limit']||null:null})[_0x4d82('0x19')](function(_0x41f194){logger[_0x4d82('0xa')](_0x4d82('0x12'),_0x258c59);logger[_0x4d82('0x1a')](_0x4d82('0x12'),_0x258c59,JSON[_0x4d82('0xe')](_0x41f194));_0x2f2127(_0x41f194);})[_0x4d82('0x11')](function(_0x12feab){logger[_0x4d82('0xf')](_0x4d82('0x12'),_0x12feab[_0x4d82('0x10')],_0x258c59);_0x5ef783(_0x217b72[_0x4d82('0xf')](0x1f4,_0x12feab[_0x4d82('0x10')]));});});};exports[_0x4d82('0x1b')]=function(_0x4af6da){var _0x5e0b03=this;return new Promise(function(_0x3dcb0f,_0x2548de){var _0x2a0572=require(_0x4d82('0x1c'));var _0x5cbd7e;return db[_0x4d82('0x1d')][_0x4d82('0x1e')]({'attributes':['id',_0x4d82('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x4d82('0x19')](function(_0x5ce98b){_0x5cbd7e=_0x5ce98b;return db[_0x4d82('0x13')]['create'](_0x4af6da['body']);})['then'](function(_0x52533b){if(_0x5cbd7e[_0x4d82('0x1f')]&&fs[_0x4d82('0x20')](_0x52533b[_0x4d82('0x21')])){var _0x52e320=util[_0x4d82('0x22')](_0x4d82('0x23'),_0x52533b['value']);return _0x2a0572['encryptFile'](_0x52533b[_0x4d82('0x21')],_0x52e320,config[_0x4d82('0x24')][_0x4d82('0x25')])[_0x4d82('0x19')](function(){fs['unlink'](_0x52533b[_0x4d82('0x21')]);logger['info'](_0x4d82('0x26'));return _0x52533b;});}return _0x52533b;})[_0x4d82('0x19')](function(_0x4a2a45){logger['info'](_0x4d82('0x1b'),_0x4af6da);logger[_0x4d82('0x1a')](_0x4d82('0x1b'),_0x4af6da,JSON[_0x4d82('0xe')](_0x4a2a45));_0x3dcb0f(_0x4a2a45);})[_0x4d82('0x11')](function(_0x420b28){logger[_0x4d82('0xf')](_0x4d82('0x1b'),_0x420b28[_0x4d82('0x10')],_0x4af6da);_0x2548de(_0x5e0b03[_0x4d82('0xf')](0x1f4,_0x420b28['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index c0a84ff..fd8c624 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 _0x6b5b=['create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x1bfe2b,_0x34856e){var _0x1477d4=function(_0x1d558c){while(--_0x1d558c){_0x1bfe2b['push'](_0x1bfe2b['shift']());}};_0x1477d4(++_0x34856e);}(_0x6b5b,0x1bc));var _0xb6b5=function(_0x230754,_0x68aa94){_0x230754=_0x230754-0x0;var _0x12c3cf=_0x6b5b[_0x230754];return _0x12c3cf;};'use strict';var multer=require(_0xb6b5('0x0'));var util=require(_0xb6b5('0x1'));var path=require(_0xb6b5('0x2'));var timeout=require(_0xb6b5('0x3'));var express=require(_0xb6b5('0x4'));var router=express[_0xb6b5('0x5')]();var fs_extra=require(_0xb6b5('0x6'));var auth=require(_0xb6b5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb6b5('0x8'));var controller=require('./voiceTransferReport.controller');router[_0xb6b5('0x9')]('/',auth[_0xb6b5('0xa')](),controller[_0xb6b5('0xb')]);router[_0xb6b5('0x9')]('/describe',auth[_0xb6b5('0xa')](),controller[_0xb6b5('0xc')]);router[_0xb6b5('0x9')](_0xb6b5('0xd'),auth[_0xb6b5('0xa')](),controller[_0xb6b5('0xe')]);router[_0xb6b5('0xf')]('/',auth[_0xb6b5('0xa')](),controller[_0xb6b5('0x10')]);router[_0xb6b5('0x11')](_0xb6b5('0xd'),auth[_0xb6b5('0xa')](),controller[_0xb6b5('0x12')]);router['delete'](_0xb6b5('0xd'),auth[_0xb6b5('0xa')](),controller['destroy']);module[_0xb6b5('0x13')]=router; \ No newline at end of file +var _0x963a=['fs-extra','./voiceTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x4f5ab8,_0x5822b4){var _0x35f8e1=function(_0x4c4422){while(--_0x4c4422){_0x4f5ab8['push'](_0x4f5ab8['shift']());}};_0x35f8e1(++_0x5822b4);}(_0x963a,0x11e));var _0xa963=function(_0x9c58a1,_0x4dd391){_0x9c58a1=_0x9c58a1-0x0;var _0x1d81a4=_0x963a[_0x9c58a1];return _0x1d81a4;};'use strict';var multer=require('multer');var util=require(_0xa963('0x0'));var path=require(_0xa963('0x1'));var timeout=require(_0xa963('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa963('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa963('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xa963('0x5')]);router[_0xa963('0x6')](_0xa963('0x7'),auth[_0xa963('0x8')](),controller[_0xa963('0x9')]);router[_0xa963('0x6')](_0xa963('0xa'),auth[_0xa963('0x8')](),controller[_0xa963('0xb')]);router[_0xa963('0xc')]('/',auth[_0xa963('0x8')](),controller['create']);router[_0xa963('0xd')](_0xa963('0xa'),auth[_0xa963('0x8')](),controller[_0xa963('0xe')]);router['delete'](_0xa963('0xa'),auth[_0xa963('0x8')](),controller[_0xa963('0xf')]);module[_0xa963('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 672ce48..62ca105 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 _0xd1d1=['moment','exports','ENUM','attended','STRING','Yes','sequelize'];(function(_0x2dfb25,_0x358b90){var _0x5947a6=function(_0x412cf8){while(--_0x412cf8){_0x2dfb25['push'](_0x2dfb25['shift']());}};_0x5947a6(++_0x358b90);}(_0xd1d1,0xbc));var _0x1d1d=function(_0x1a686b,_0x5e26a5){_0x1a686b=_0x1a686b-0x0;var _0x256f01=_0xd1d1[_0x1a686b];return _0x256f01;};'use strict';var Sequelize=require(_0x1d1d('0x0'));var moment=require(_0x1d1d('0x1'));module[_0x1d1d('0x2')]={'type':{'type':Sequelize[_0x1d1d('0x3')]('blind',_0x1d1d('0x4'))},'result':{'type':Sequelize[_0x1d1d('0x5')]},'transfererchannel':{'type':Sequelize[_0x1d1d('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x1d1d('0x5')]},'transferercalleridname':{'type':Sequelize[_0x1d1d('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1d1d('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x1d1d('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x1d1d('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x1d1d('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x1d1d('0x5')]},'transfereechannel':{'type':Sequelize[_0x1d1d('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x1d1d('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x1d1d('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1d1d('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1d1d('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x1d1d('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x1d1d('0x5')]},'isexternal':{'type':Sequelize[_0x1d1d('0x3')](_0x1d1d('0x6'),'No')},'context':{'type':Sequelize[_0x1d1d('0x5')]},'extension':{'type':Sequelize[_0x1d1d('0x5')]}}; \ No newline at end of file +var _0x5162=['attended','STRING','ENUM','Yes','sequelize','exports','blind'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x5162,0x90));var _0x2516=function(_0xd948e7,_0x2f9dd1){_0xd948e7=_0xd948e7-0x0;var _0x323d00=_0x5162[_0xd948e7];return _0x323d00;};'use strict';var Sequelize=require(_0x2516('0x0'));var moment=require('moment');module[_0x2516('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2516('0x2'),_0x2516('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x2516('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x2516('0x4')]},'transferercalleridname':{'type':Sequelize[_0x2516('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x2516('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x2516('0x4')]},'transferercontext':{'type':Sequelize[_0x2516('0x4')]},'transfererexten':{'type':Sequelize[_0x2516('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x2516('0x4')]},'transfereechannel':{'type':Sequelize[_0x2516('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x2516('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x2516('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x2516('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x2516('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x2516('0x4')]},'transfereecontext':{'type':Sequelize[_0x2516('0x4')]},'transfereeexten':{'type':Sequelize[_0x2516('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x2516('0x4')]},'isexternal':{'type':Sequelize[_0x2516('0x5')](_0x2516('0x6'),'No')},'context':{'type':Sequelize[_0x2516('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 6fb50bb..9ef6ffb 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 _0x14e9=['keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x1ee0cc,_0x445f9d){var _0x1e8f71=function(_0x2246bf){while(--_0x2246bf){_0x1ee0cc['push'](_0x1ee0cc['shift']());}};_0x1e8f71(++_0x445f9d);}(_0x14e9,0xfc));var _0x914e=function(_0x41e3e5,_0x441240){_0x41e3e5=_0x41e3e5-0x0;var _0x4b5b5c=_0x14e9[_0x41e3e5];return _0x4b5b5c;};'use strict';var emlformat=require(_0x914e('0x0'));var rimraf=require(_0x914e('0x1'));var zipdir=require(_0x914e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x914e('0x3'));var moment=require(_0x914e('0x4'));var BPromise=require(_0x914e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x914e('0x6'));var sox=require('sox');var csv=require(_0x914e('0x7'));var ejs=require(_0x914e('0x8'));var fs=require('fs');var fs_extra=require(_0x914e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x914e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x914e('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x914e('0xc'));var Redis=require(_0x914e('0xd'));var authService=require(_0x914e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x914e('0xf'));var hardwareService=require(_0x914e('0x10'));var logger=require(_0x914e('0x11'))(_0x914e('0x12'));var utils=require(_0x914e('0x13'));var config=require(_0x914e('0x14'));var licenseUtil=require(_0x914e('0x15'));var db=require(_0x914e('0x16'))['db'];function respondWithStatusCode(_0xe0598e,_0x16233f){_0x16233f=_0x16233f||0xcc;return function(_0x192733){if(_0x192733){return _0xe0598e[_0x914e('0x17')](_0x16233f);}return _0xe0598e[_0x914e('0x18')](_0x16233f)[_0x914e('0x19')]();};}function respondWithResult(_0x34db77,_0x500e89){_0x500e89=_0x500e89||0xc8;return function(_0x2e96df){if(_0x2e96df){return _0x34db77[_0x914e('0x18')](_0x500e89)[_0x914e('0x1a')](_0x2e96df);}};}function respondWithFilteredResult(_0x2d1e94,_0x40c815){return function(_0xebc4c9){if(_0xebc4c9){var _0x1efb58=typeof _0x40c815[_0x914e('0x1b')]===_0x914e('0x1c')&&typeof _0x40c815['limit']===_0x914e('0x1c');var _0x4d5bd6=_0xebc4c9[_0x914e('0x1d')];var _0x4c86da=_0x1efb58?0x0:_0x40c815['offset'];var _0x12f9ae=_0x1efb58?_0xebc4c9['count']:_0x40c815[_0x914e('0x1b')]+_0x40c815['limit'];var _0x327260;if(_0x12f9ae>=_0x4d5bd6){_0x12f9ae=_0x4d5bd6;_0x327260=0xc8;}else{_0x327260=0xce;}_0x2d1e94[_0x914e('0x18')](_0x327260);return _0x2d1e94['set'](_0x914e('0x1e'),_0x4c86da+'-'+_0x12f9ae+'/'+_0x4d5bd6)[_0x914e('0x1a')](_0xebc4c9);}return null;};}function patchUpdates(_0xbdba69){return function(_0x1d5cd9){try{jsonpatch['apply'](_0x1d5cd9,_0xbdba69,!![]);}catch(_0x5425eb){return BPromise[_0x914e('0x1f')](_0x5425eb);}return _0x1d5cd9[_0x914e('0x20')]();};}function saveUpdates(_0xcee452,_0x202b6d){return function(_0x4067ac){if(_0x4067ac){return _0x4067ac[_0x914e('0x21')](_0xcee452)['then'](function(_0x1bcecd){return _0x1bcecd;});}return null;};}function removeEntity(_0x3780c6,_0x49ade5){return function(_0x1aa72e){if(_0x1aa72e){return _0x1aa72e[_0x914e('0x22')]()[_0x914e('0x23')](function(){_0x3780c6[_0x914e('0x18')](0xcc)[_0x914e('0x19')]();});}};}function handleEntityNotFound(_0xc09b7e,_0x396d51){return function(_0x2a067f){if(!_0x2a067f){_0xc09b7e[_0x914e('0x17')](0x194);}return _0x2a067f;};}function handleError(_0x4f29fe,_0x44ba78){_0x44ba78=_0x44ba78||0x1f4;return function(_0x214a7e){logger[_0x914e('0x24')](_0x214a7e[_0x914e('0x25')]);if(_0x214a7e[_0x914e('0x26')]){delete _0x214a7e[_0x914e('0x26')];}_0x4f29fe['status'](_0x44ba78)[_0x914e('0x27')](_0x214a7e);};}exports[_0x914e('0x28')]=function(_0x3bb4de,_0x2192b8){var _0x17fe34={},_0x3e6344={},_0x1b08f4={'count':0x0,'rows':[]};var _0xb1d3b9=_['map'](db[_0x914e('0x29')][_0x914e('0x2a')],function(_0xf469a2){return{'name':_0xf469a2[_0x914e('0x2b')],'type':_0xf469a2[_0x914e('0x2c')][_0x914e('0x2d')]};});_0x3e6344[_0x914e('0x2e')]=_['map'](_0xb1d3b9,_0x914e('0x26'));_0x3e6344[_0x914e('0x2f')]=_[_0x914e('0x30')](_0x3bb4de[_0x914e('0x2f')]);_0x3e6344['filters']=_['intersection'](_0x3e6344[_0x914e('0x2e')],_0x3e6344['query']);_0x17fe34[_0x914e('0x31')]=_[_0x914e('0x32')](_0x3e6344[_0x914e('0x2e')],qs[_0x914e('0x33')](_0x3bb4de[_0x914e('0x2f')]['fields']));_0x17fe34[_0x914e('0x31')]=_0x17fe34[_0x914e('0x31')][_0x914e('0x34')]?_0x17fe34['attributes']:_0x3e6344[_0x914e('0x2e')];if(!_0x3bb4de[_0x914e('0x2f')][_0x914e('0x35')](_0x914e('0x36'))){_0x17fe34[_0x914e('0x37')]=qs[_0x914e('0x37')](_0x3bb4de[_0x914e('0x2f')][_0x914e('0x37')]);_0x17fe34[_0x914e('0x1b')]=qs['offset'](_0x3bb4de[_0x914e('0x2f')][_0x914e('0x1b')]);}_0x17fe34['order']=qs[_0x914e('0x38')](_0x3bb4de[_0x914e('0x2f')][_0x914e('0x38')]);_0x17fe34[_0x914e('0x39')]=qs[_0x914e('0x3a')](_[_0x914e('0x3b')](_0x3bb4de[_0x914e('0x2f')],_0x3e6344[_0x914e('0x3a')]),_0xb1d3b9);if(_0x3bb4de[_0x914e('0x2f')][_0x914e('0x3c')]){_0x17fe34[_0x914e('0x39')]=_['merge'](_0x17fe34[_0x914e('0x39')],{'$or':_['map'](_0xb1d3b9,function(_0x3f12bf){if(_0x3f12bf[_0x914e('0x2c')]!==_0x914e('0x3d')){var _0x471212={};_0x471212[_0x3f12bf[_0x914e('0x26')]]={'$like':'%'+_0x3bb4de['query'][_0x914e('0x3c')]+'%'};return _0x471212;}})});}_0x17fe34=_[_0x914e('0x3e')]({},_0x17fe34,_0x3bb4de[_0x914e('0x3f')]);var _0x533420={'where':_0x17fe34[_0x914e('0x39')]};return db[_0x914e('0x29')][_0x914e('0x1d')](_0x533420)[_0x914e('0x23')](function(_0xadd2b7){_0x1b08f4[_0x914e('0x1d')]=_0xadd2b7;if(_0x3bb4de[_0x914e('0x2f')][_0x914e('0x40')]){_0x17fe34[_0x914e('0x41')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x914e('0x42')](_0x17fe34);})[_0x914e('0x23')](function(_0x3dcff0){_0x1b08f4[_0x914e('0x43')]=_0x3dcff0;return _0x1b08f4;})[_0x914e('0x23')](respondWithFilteredResult(_0x2192b8,_0x17fe34))[_0x914e('0x44')](handleError(_0x2192b8,null));};exports[_0x914e('0x45')]=function(_0x496cad,_0x59edb0){var _0x2f8ca3={'raw':!![],'where':{'id':_0x496cad[_0x914e('0x46')]['id']}},_0x562b00={};_0x562b00[_0x914e('0x2e')]=_[_0x914e('0x30')](db[_0x914e('0x29')]['rawAttributes']);_0x562b00['query']=_[_0x914e('0x30')](_0x496cad[_0x914e('0x2f')]);_0x562b00[_0x914e('0x3a')]=_['intersection'](_0x562b00['model'],_0x562b00[_0x914e('0x2f')]);_0x2f8ca3['attributes']=_[_0x914e('0x32')](_0x562b00['model'],qs[_0x914e('0x33')](_0x496cad[_0x914e('0x2f')][_0x914e('0x33')]));_0x2f8ca3[_0x914e('0x31')]=_0x2f8ca3[_0x914e('0x31')]['length']?_0x2f8ca3['attributes']:_0x562b00[_0x914e('0x2e')];if(_0x496cad['query'][_0x914e('0x40')]){_0x2f8ca3[_0x914e('0x41')]=[{'all':!![]}];}_0x2f8ca3=_[_0x914e('0x3e')]({},_0x2f8ca3,_0x496cad[_0x914e('0x3f')]);return db[_0x914e('0x29')][_0x914e('0x47')](_0x2f8ca3)[_0x914e('0x23')](handleEntityNotFound(_0x59edb0,null))[_0x914e('0x23')](respondWithResult(_0x59edb0,null))[_0x914e('0x44')](handleError(_0x59edb0,null));};exports['create']=function(_0x4a7b33,_0x3c6c98){return db[_0x914e('0x29')][_0x914e('0x48')](_0x4a7b33[_0x914e('0x49')],{})[_0x914e('0x23')](respondWithResult(_0x3c6c98,0xc9))[_0x914e('0x44')](handleError(_0x3c6c98,null));};exports[_0x914e('0x21')]=function(_0x6e9f11,_0x16368b){if(_0x6e9f11[_0x914e('0x49')]['id']){delete _0x6e9f11['body']['id'];}return db[_0x914e('0x29')][_0x914e('0x47')]({'where':{'id':_0x6e9f11[_0x914e('0x46')]['id']}})['then'](handleEntityNotFound(_0x16368b,null))['then'](saveUpdates(_0x6e9f11[_0x914e('0x49')],null))[_0x914e('0x23')](respondWithResult(_0x16368b,null))[_0x914e('0x44')](handleError(_0x16368b,null));};exports['destroy']=function(_0xb8bff2,_0x1e2840){return db[_0x914e('0x29')][_0x914e('0x47')]({'where':{'id':_0xb8bff2[_0x914e('0x46')]['id']}})[_0x914e('0x23')](handleEntityNotFound(_0x1e2840,null))[_0x914e('0x23')](removeEntity(_0x1e2840,null))[_0x914e('0x44')](handleError(_0x1e2840,null));};exports['describe']=function(_0x59a362,_0x2b3d2e){return db[_0x914e('0x29')][_0x914e('0x4a')]()[_0x914e('0x23')](respondWithResult(_0x2b3d2e,null))[_0x914e('0x44')](handleError(_0x2b3d2e,null));}; \ No newline at end of file +var _0xa880=['fields','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','destroy','then','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes'];(function(_0x34e602,_0x6f5cb){var _0x3c5eae=function(_0x1f43a7){while(--_0x1f43a7){_0x34e602['push'](_0x34e602['shift']());}};_0x3c5eae(++_0x6f5cb);}(_0xa880,0xb4));var _0x0a88=function(_0x50f9ab,_0x5009b4){_0x50f9ab=_0x50f9ab-0x0;var _0x58dda4=_0xa880[_0x50f9ab];return _0x58dda4;};'use strict';var emlformat=require(_0x0a88('0x0'));var rimraf=require(_0x0a88('0x1'));var zipdir=require(_0x0a88('0x2'));var jsonpatch=require(_0x0a88('0x3'));var rp=require('request-promise');var moment=require(_0x0a88('0x4'));var BPromise=require(_0x0a88('0x5'));var Mustache=require(_0x0a88('0x6'));var util=require(_0x0a88('0x7'));var path=require(_0x0a88('0x8'));var sox=require(_0x0a88('0x9'));var csv=require(_0x0a88('0xa'));var ejs=require(_0x0a88('0xb'));var fs=require('fs');var fs_extra=require(_0x0a88('0xc'));var _=require(_0x0a88('0xd'));var squel=require(_0x0a88('0xe'));var crypto=require('crypto');var jsforce=require(_0x0a88('0xf'));var deskjs=require(_0x0a88('0x10'));var toCsv=require(_0x0a88('0xa'));var querystring=require(_0x0a88('0x11'));var Papa=require(_0x0a88('0x12'));var Redis=require(_0x0a88('0x13'));var authService=require(_0x0a88('0x14'));var qs=require(_0x0a88('0x15'));var as=require(_0x0a88('0x16'));var hardwareService=require(_0x0a88('0x17'));var logger=require(_0x0a88('0x18'))(_0x0a88('0x19'));var utils=require(_0x0a88('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x0a88('0x1b'));var db=require(_0x0a88('0x1c'))['db'];function respondWithStatusCode(_0x59c0be,_0x268106){_0x268106=_0x268106||0xcc;return function(_0x139213){if(_0x139213){return _0x59c0be[_0x0a88('0x1d')](_0x268106);}return _0x59c0be[_0x0a88('0x1e')](_0x268106)[_0x0a88('0x1f')]();};}function respondWithResult(_0x51ccd3,_0x2d67d3){_0x2d67d3=_0x2d67d3||0xc8;return function(_0x30a193){if(_0x30a193){return _0x51ccd3[_0x0a88('0x1e')](_0x2d67d3)[_0x0a88('0x20')](_0x30a193);}};}function respondWithFilteredResult(_0x2e3781,_0x1cf3b1){return function(_0x35106c){if(_0x35106c){var _0xf8ea1a=typeof _0x1cf3b1[_0x0a88('0x21')]===_0x0a88('0x22')&&typeof _0x1cf3b1['limit']==='undefined';var _0x21fab7=_0x35106c[_0x0a88('0x23')];var _0x168cb2=_0xf8ea1a?0x0:_0x1cf3b1[_0x0a88('0x21')];var _0x22da6f=_0xf8ea1a?_0x35106c[_0x0a88('0x23')]:_0x1cf3b1[_0x0a88('0x21')]+_0x1cf3b1['limit'];var _0x3f112c;if(_0x22da6f>=_0x21fab7){_0x22da6f=_0x21fab7;_0x3f112c=0xc8;}else{_0x3f112c=0xce;}_0x2e3781['status'](_0x3f112c);return _0x2e3781[_0x0a88('0x24')]('Content-Range',_0x168cb2+'-'+_0x22da6f+'/'+_0x21fab7)[_0x0a88('0x20')](_0x35106c);}return null;};}function patchUpdates(_0x24e759){return function(_0x4f66f4){try{jsonpatch[_0x0a88('0x25')](_0x4f66f4,_0x24e759,!![]);}catch(_0x5f46dc){return BPromise[_0x0a88('0x26')](_0x5f46dc);}return _0x4f66f4[_0x0a88('0x27')]();};}function saveUpdates(_0x527e13,_0x570129){return function(_0x5badc5){if(_0x5badc5){return _0x5badc5[_0x0a88('0x28')](_0x527e13)['then'](function(_0x225c62){return _0x225c62;});}return null;};}function removeEntity(_0x3d5cf6,_0x40de16){return function(_0x4c4ba6){if(_0x4c4ba6){return _0x4c4ba6[_0x0a88('0x29')]()[_0x0a88('0x2a')](function(){_0x3d5cf6[_0x0a88('0x1e')](0xcc)[_0x0a88('0x1f')]();});}};}function handleEntityNotFound(_0x383e28,_0x3f1fc1){return function(_0x3dd56e){if(!_0x3dd56e){_0x383e28[_0x0a88('0x1d')](0x194);}return _0x3dd56e;};}function handleError(_0x382203,_0x39051a){_0x39051a=_0x39051a||0x1f4;return function(_0x2cb029){logger[_0x0a88('0x2b')](_0x2cb029[_0x0a88('0x2c')]);if(_0x2cb029[_0x0a88('0x2d')]){delete _0x2cb029[_0x0a88('0x2d')];}_0x382203[_0x0a88('0x1e')](_0x39051a)['send'](_0x2cb029);};}exports[_0x0a88('0x2e')]=function(_0x157f99,_0x2a34dd){var _0x146f62={},_0x1eff6f={},_0x45044a={'count':0x0,'rows':[]};var _0x352628=_[_0x0a88('0x2f')](db[_0x0a88('0x30')][_0x0a88('0x31')],function(_0x37a510){return{'name':_0x37a510[_0x0a88('0x32')],'type':_0x37a510[_0x0a88('0x33')]['key']};});_0x1eff6f[_0x0a88('0x34')]=_[_0x0a88('0x2f')](_0x352628,'name');_0x1eff6f[_0x0a88('0x35')]=_[_0x0a88('0x36')](_0x157f99['query']);_0x1eff6f['filters']=_[_0x0a88('0x37')](_0x1eff6f['model'],_0x1eff6f['query']);_0x146f62[_0x0a88('0x38')]=_[_0x0a88('0x37')](_0x1eff6f[_0x0a88('0x34')],qs[_0x0a88('0x39')](_0x157f99['query']['fields']));_0x146f62[_0x0a88('0x38')]=_0x146f62[_0x0a88('0x38')]['length']?_0x146f62[_0x0a88('0x38')]:_0x1eff6f['model'];if(!_0x157f99[_0x0a88('0x35')]['hasOwnProperty'](_0x0a88('0x3a'))){_0x146f62['limit']=qs[_0x0a88('0x3b')](_0x157f99[_0x0a88('0x35')][_0x0a88('0x3b')]);_0x146f62[_0x0a88('0x21')]=qs[_0x0a88('0x21')](_0x157f99[_0x0a88('0x35')]['offset']);}_0x146f62[_0x0a88('0x3c')]=qs[_0x0a88('0x3d')](_0x157f99[_0x0a88('0x35')][_0x0a88('0x3d')]);_0x146f62[_0x0a88('0x3e')]=qs[_0x0a88('0x3f')](_[_0x0a88('0x40')](_0x157f99[_0x0a88('0x35')],_0x1eff6f['filters']),_0x352628);if(_0x157f99[_0x0a88('0x35')][_0x0a88('0x41')]){_0x146f62[_0x0a88('0x3e')]=_['merge'](_0x146f62[_0x0a88('0x3e')],{'$or':_[_0x0a88('0x2f')](_0x352628,function(_0x5c433d){if(_0x5c433d['type']!==_0x0a88('0x42')){var _0x54b963={};_0x54b963[_0x5c433d['name']]={'$like':'%'+_0x157f99['query'][_0x0a88('0x41')]+'%'};return _0x54b963;}})});}_0x146f62=_[_0x0a88('0x43')]({},_0x146f62,_0x157f99[_0x0a88('0x44')]);var _0x569152={'where':_0x146f62[_0x0a88('0x3e')]};return db[_0x0a88('0x30')][_0x0a88('0x23')](_0x569152)[_0x0a88('0x2a')](function(_0x31e472){_0x45044a[_0x0a88('0x23')]=_0x31e472;if(_0x157f99[_0x0a88('0x35')][_0x0a88('0x45')]){_0x146f62[_0x0a88('0x46')]=[{'all':!![]}];}return db[_0x0a88('0x30')]['findAll'](_0x146f62);})[_0x0a88('0x2a')](function(_0x2f2b22){_0x45044a['rows']=_0x2f2b22;return _0x45044a;})[_0x0a88('0x2a')](respondWithFilteredResult(_0x2a34dd,_0x146f62))[_0x0a88('0x47')](handleError(_0x2a34dd,null));};exports[_0x0a88('0x48')]=function(_0x9f7f6,_0x23e64a){var _0x3e51be={'raw':!![],'where':{'id':_0x9f7f6[_0x0a88('0x49')]['id']}},_0x48b3d3={};_0x48b3d3[_0x0a88('0x34')]=_[_0x0a88('0x36')](db['VoiceTransferReport'][_0x0a88('0x31')]);_0x48b3d3[_0x0a88('0x35')]=_[_0x0a88('0x36')](_0x9f7f6['query']);_0x48b3d3['filters']=_[_0x0a88('0x37')](_0x48b3d3[_0x0a88('0x34')],_0x48b3d3['query']);_0x3e51be[_0x0a88('0x38')]=_['intersection'](_0x48b3d3['model'],qs['fields'](_0x9f7f6[_0x0a88('0x35')][_0x0a88('0x39')]));_0x3e51be[_0x0a88('0x38')]=_0x3e51be[_0x0a88('0x38')][_0x0a88('0x4a')]?_0x3e51be['attributes']:_0x48b3d3[_0x0a88('0x34')];if(_0x9f7f6[_0x0a88('0x35')][_0x0a88('0x45')]){_0x3e51be['include']=[{'all':!![]}];}_0x3e51be=_['merge']({},_0x3e51be,_0x9f7f6[_0x0a88('0x44')]);return db[_0x0a88('0x30')][_0x0a88('0x4b')](_0x3e51be)[_0x0a88('0x2a')](handleEntityNotFound(_0x23e64a,null))['then'](respondWithResult(_0x23e64a,null))[_0x0a88('0x47')](handleError(_0x23e64a,null));};exports[_0x0a88('0x4c')]=function(_0x4db128,_0x3328d6){return db[_0x0a88('0x30')][_0x0a88('0x4c')](_0x4db128[_0x0a88('0x4d')],{})[_0x0a88('0x2a')](respondWithResult(_0x3328d6,0xc9))[_0x0a88('0x47')](handleError(_0x3328d6,null));};exports[_0x0a88('0x28')]=function(_0xb6cb96,_0x5f36e1){if(_0xb6cb96['body']['id']){delete _0xb6cb96[_0x0a88('0x4d')]['id'];}return db[_0x0a88('0x30')][_0x0a88('0x4b')]({'where':{'id':_0xb6cb96[_0x0a88('0x49')]['id']}})[_0x0a88('0x2a')](handleEntityNotFound(_0x5f36e1,null))['then'](saveUpdates(_0xb6cb96[_0x0a88('0x4d')],null))[_0x0a88('0x2a')](respondWithResult(_0x5f36e1,null))['catch'](handleError(_0x5f36e1,null));};exports[_0x0a88('0x29')]=function(_0x4c662f,_0xfe2d5c){return db['VoiceTransferReport'][_0x0a88('0x4b')]({'where':{'id':_0x4c662f[_0x0a88('0x49')]['id']}})[_0x0a88('0x2a')](handleEntityNotFound(_0xfe2d5c,null))[_0x0a88('0x2a')](removeEntity(_0xfe2d5c,null))['catch'](handleError(_0xfe2d5c,null));};exports[_0x0a88('0x4e')]=function(_0x15dd35,_0x508da8){return db['VoiceTransferReport'][_0x0a88('0x4e')]()[_0x0a88('0x2a')](respondWithResult(_0x508da8,null))['catch'](handleError(_0x508da8,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index b9a9a63..6e7bd05 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 _0x75cb=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0x75cb,0x103));var _0xb75c=function(_0x5f5dd3,_0x2ce595){_0x5f5dd3=_0x5f5dd3-0x0;var _0x7ec6bf=_0x75cb[_0x5f5dd3];return _0x7ec6bf;};'use strict';var _=require(_0xb75c('0x0'));var util=require(_0xb75c('0x1'));var logger=require(_0xb75c('0x2'))(_0xb75c('0x3'));var moment=require('moment');var BPromise=require(_0xb75c('0x4'));var rp=require(_0xb75c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb75c('0x6'));var config=require(_0xb75c('0x7'));var attributes=require(_0xb75c('0x8'));module[_0xb75c('0x9')]=function(_0x1a9c7c,_0x3e8dda){return _0x1a9c7c[_0xb75c('0xa')](_0xb75c('0xb'),attributes,{'tableName':_0xb75c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4f7=['report_call_transfer','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport'];(function(_0x543ef3,_0x585b8a){var _0x5a1289=function(_0x3ba347){while(--_0x3ba347){_0x543ef3['push'](_0x543ef3['shift']());}};_0x5a1289(++_0x585b8a);}(_0xf4f7,0x194));var _0x7f4f=function(_0x430f44,_0x4ae21b){_0x430f44=_0x430f44-0x0;var _0x1f6b0f=_0xf4f7[_0x430f44];return _0x1f6b0f;};'use strict';var _=require(_0x7f4f('0x0'));var util=require('util');var logger=require(_0x7f4f('0x1'))(_0x7f4f('0x2'));var moment=require(_0x7f4f('0x3'));var BPromise=require(_0x7f4f('0x4'));var rp=require(_0x7f4f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f4f('0x6'));var config=require(_0x7f4f('0x7'));var attributes=require(_0x7f4f('0x8'));module[_0x7f4f('0x9')]=function(_0x25ef34,_0x5da557){return _0x25ef34[_0x7f4f('0xa')](_0x7f4f('0xb'),attributes,{'tableName':_0x7f4f('0xc'),'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 1b4d69a..1b30d63 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 _0x40fc=['VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceTransferReport','create','options','debug','CreateVoiceTransferReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x54fc74,_0x53bf32){var _0x4b7a5d=function(_0x262b7d){while(--_0x262b7d){_0x54fc74['push'](_0x54fc74['shift']());}};_0x4b7a5d(++_0x53bf32);}(_0x40fc,0xe5));var _0xc40f=function(_0x239786,_0x471f27){_0x239786=_0x239786-0x0;var _0x3f15e2=_0x40fc[_0x239786];return _0x3f15e2;};'use strict';var _=require('lodash');var util=require(_0xc40f('0x0'));var moment=require(_0xc40f('0x1'));var BPromise=require('bluebird');var rs=require(_0xc40f('0x2'));var fs=require('fs');var Redis=require(_0xc40f('0x3'));var db=require(_0xc40f('0x4'))['db'];var utils=require(_0xc40f('0x5'));var logger=require(_0xc40f('0x6'))(_0xc40f('0x7'));var config=require(_0xc40f('0x8'));var jayson=require(_0xc40f('0x9'));var client=jayson[_0xc40f('0xa')][_0xc40f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b7b24,_0x2b36cd,_0x49e5ca){return new BPromise(function(_0x3e85ad,_0x2655c2){return client[_0xc40f('0xc')](_0x4b7b24,_0x49e5ca)['then'](function(_0x2b8ed2){logger[_0xc40f('0xd')](_0xc40f('0xe'),_0x2b36cd,_0xc40f('0xf'));logger['debug'](_0xc40f('0x10'),_0x2b36cd,_0xc40f('0xf'),JSON[_0xc40f('0x11')](_0x2b8ed2));if(_0x2b8ed2[_0xc40f('0x12')]){if(_0x2b8ed2[_0xc40f('0x12')]['code']===0x1f4){logger[_0xc40f('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x2b36cd,_0x2b8ed2[_0xc40f('0x12')]['message']);return _0x2655c2(_0x2b8ed2['error'][_0xc40f('0x13')]);}logger[_0xc40f('0x12')](_0xc40f('0xe'),_0x2b36cd,_0x2b8ed2[_0xc40f('0x12')][_0xc40f('0x13')]);return _0x3e85ad(_0x2b8ed2[_0xc40f('0x12')][_0xc40f('0x13')]);}else{logger[_0xc40f('0xd')](_0xc40f('0xe'),_0x2b36cd,'request\x20sent');_0x3e85ad(_0x2b8ed2[_0xc40f('0x14')][_0xc40f('0x13')]);}})[_0xc40f('0x15')](function(_0x3c2e69){logger['error'](_0xc40f('0xe'),_0x2b36cd,_0x3c2e69);_0x2655c2(_0x3c2e69);});});}exports['CreateVoiceTransferReport']=function(_0x230c4c){var _0x37d551=this;return new Promise(function(_0x31737f,_0x20be11){return db[_0xc40f('0x16')][_0xc40f('0x17')](_0x230c4c['body'],{'raw':_0x230c4c[_0xc40f('0x18')]?_0x230c4c[_0xc40f('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x857169){logger[_0xc40f('0xd')]('CreateVoiceTransferReport',_0x230c4c);logger[_0xc40f('0x19')]('CreateVoiceTransferReport',_0x230c4c,JSON[_0xc40f('0x11')](_0x857169));_0x31737f(_0x857169);})[_0xc40f('0x15')](function(_0x575fab){logger['error'](_0xc40f('0x1a'),_0x575fab[_0xc40f('0x13')],_0x230c4c);_0x20be11(_0x37d551[_0xc40f('0x12')](0x1f4,_0x575fab['message']));});});}; \ No newline at end of file +var _0x042a=['../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x042a,0xa8));var _0xa042=function(_0x1faa4d,_0x8898f8){_0x1faa4d=_0x1faa4d-0x0;var _0x3f8880=_0x042a[_0x1faa4d];return _0x3f8880;};'use strict';var _=require(_0xa042('0x0'));var util=require(_0xa042('0x1'));var moment=require(_0xa042('0x2'));var BPromise=require(_0xa042('0x3'));var rs=require(_0xa042('0x4'));var fs=require('fs');var Redis=require(_0xa042('0x5'));var db=require(_0xa042('0x6'))['db'];var utils=require(_0xa042('0x7'));var logger=require('../../config/logger')(_0xa042('0x8'));var config=require('../../config/environment');var jayson=require(_0xa042('0x9'));var client=jayson['client'][_0xa042('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f4107,_0x3fdf93,_0x2da2af){return new BPromise(function(_0x560435,_0xe3a40d){return client[_0xa042('0xb')](_0x2f4107,_0x2da2af)['then'](function(_0xf98065){logger[_0xa042('0xc')](_0xa042('0xd'),_0x3fdf93,_0xa042('0xe'));logger[_0xa042('0xf')](_0xa042('0x10'),_0x3fdf93,'request\x20sent',JSON[_0xa042('0x11')](_0xf98065));if(_0xf98065[_0xa042('0x12')]){if(_0xf98065[_0xa042('0x12')][_0xa042('0x13')]===0x1f4){logger['error'](_0xa042('0xd'),_0x3fdf93,_0xf98065[_0xa042('0x12')][_0xa042('0x14')]);return _0xe3a40d(_0xf98065[_0xa042('0x12')][_0xa042('0x14')]);}logger[_0xa042('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x3fdf93,_0xf98065[_0xa042('0x12')][_0xa042('0x14')]);return _0x560435(_0xf98065[_0xa042('0x12')][_0xa042('0x14')]);}else{logger[_0xa042('0xc')](_0xa042('0xd'),_0x3fdf93,'request\x20sent');_0x560435(_0xf98065['result']['message']);}})[_0xa042('0x15')](function(_0x2dc4f2){logger['error'](_0xa042('0xd'),_0x3fdf93,_0x2dc4f2);_0xe3a40d(_0x2dc4f2);});});}exports[_0xa042('0x16')]=function(_0x241636){var _0xa9dfd=this;return new Promise(function(_0x44126e,_0x4324ab){return db[_0xa042('0x17')][_0xa042('0x18')](_0x241636[_0xa042('0x19')],{'raw':_0x241636['options']?_0x241636[_0xa042('0x1a')][_0xa042('0x1b')]===undefined?!![]:![]:!![]})[_0xa042('0x1c')](function(_0x22d36f){logger['info']('CreateVoiceTransferReport',_0x241636);logger['debug'](_0xa042('0x16'),_0x241636,JSON[_0xa042('0x11')](_0x22d36f));_0x44126e(_0x22d36f);})['catch'](function(_0x13885b){logger[_0xa042('0x12')](_0xa042('0x16'),_0x13885b[_0xa042('0x14')],_0x241636);_0x4324ab(_0xa9dfd[_0xa042('0x12')](0x1f4,_0x13885b['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index ee0ba7a..9302971 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 _0xedd9=['unhold','/calls','calls','/transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','/unhold'];(function(_0x5c5f2a,_0x324c91){var _0x3e9f1a=function(_0x3788f6){while(--_0x3788f6){_0x5c5f2a['push'](_0x5c5f2a['shift']());}};_0x3e9f1a(++_0x324c91);}(_0xedd9,0xfc));var _0x9edd=function(_0x1ddcd0,_0x35557d){_0x1ddcd0=_0x1ddcd0-0x0;var _0x23f108=_0xedd9[_0x1ddcd0];return _0x23f108;};'use strict';var express=require('express');var router=express[_0x9edd('0x0')]();var auth=require(_0x9edd('0x1'));var controller=require(_0x9edd('0x2'));router[_0x9edd('0x3')](_0x9edd('0x4'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x7')]);router['post'](_0x9edd('0x8'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x9')]);router['post'](_0x9edd('0xa'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xb')]);router[_0x9edd('0x3')](_0x9edd('0xc'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller['hold']);router[_0x9edd('0x3')](_0x9edd('0xd'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xe')]);router['post'](_0x9edd('0xf'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x10')]);router[_0x9edd('0x3')](_0x9edd('0x11'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller['transfer']);module[_0x9edd('0x12')]=router; \ No newline at end of file +var _0xbec5=['exports','express','Router','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup','/answer','answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer'];(function(_0x70f8c2,_0x3b36e5){var _0x2850b3=function(_0x546e86){while(--_0x546e86){_0x70f8c2['push'](_0x70f8c2['shift']());}};_0x2850b3(++_0x3b36e5);}(_0xbec5,0xe5));var _0x5bec=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xbec5[_0x46698a];return _0x356db0;};'use strict';var express=require(_0x5bec('0x0'));var router=express[_0x5bec('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5bec('0x2'));router[_0x5bec('0x3')](_0x5bec('0x4'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller['originate']);router[_0x5bec('0x3')](_0x5bec('0x7'),auth[_0x5bec('0x5')](),auth['isWebrtcLicence'](),controller[_0x5bec('0x8')]);router[_0x5bec('0x3')](_0x5bec('0x9'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller[_0x5bec('0xa')]);router[_0x5bec('0x3')](_0x5bec('0xb'),auth['isAuthenticated'](),auth[_0x5bec('0x6')](),controller['hold']);router[_0x5bec('0x3')](_0x5bec('0xc'),auth[_0x5bec('0x5')](),auth['isWebrtcLicence'](),controller[_0x5bec('0xd')]);router[_0x5bec('0x3')](_0x5bec('0xe'),auth['isAuthenticated'](),auth[_0x5bec('0x6')](),controller[_0x5bec('0xf')]);router['post'](_0x5bec('0x10'),auth[_0x5bec('0x5')](),auth[_0x5bec('0x6')](),controller[_0x5bec('0x11')]);module[_0x5bec('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index bf3a59e..c082a94 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 _0x1b73=['unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','VoiceChannels','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','util','jayson/promise','http','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','User','findOne','agent','all','filter','rows','UserId','sessionId','\x20not\x20found!','originate','body','length','callerId','callbackUrl','entityFound:','format','user:%s','json','originate\x20executed!','catch','hangup','hangup\x20fired:','hangup\x20executed!','answer','userId','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!'];(function(_0x357243,_0x5778f8){var _0x308fb6=function(_0x3f7e3a){while(--_0x3f7e3a){_0x357243['push'](_0x357243['shift']());}};_0x308fb6(++_0x5778f8);}(_0x1b73,0x1d5));var _0x31b7=function(_0x46a897,_0x51a2f9){_0x46a897=_0x46a897-0x0;var _0x42c2b3=_0x1b73[_0x46a897];return _0x42c2b3;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x31b7('0x0'));var db=require(_0x31b7('0x1'))['db'];var config=require(_0x31b7('0x2'));var util=require(_0x31b7('0x3'));var BPromise=require('bluebird');var jayson=require(_0x31b7('0x4'));var amiClient=jayson['client'][_0x31b7('0x5')]({'port':0x232a});var logger=require(_0x31b7('0x6'))('webbarapi');var Redis=require(_0x31b7('0x7'));config[_0x31b7('0x8')]=_[_0x31b7('0x9')](config['redis'],{'host':_0x31b7('0xa'),'port':0x18eb});var io=require(_0x31b7('0xb'))(new Redis(config[_0x31b7('0x8')]));var Schema=require(_0x31b7('0xc'));var originateValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'callNumber':{'type':_0x31b7('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x31b7('0xf')},'callbackUrl':{'type':_0x31b7('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':_0x31b7('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':_0x31b7('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':'string','required':[!![],_0x31b7('0x10')]},'transferNumber':{'type':_0x31b7('0xf'),'required':[!![],_0x31b7('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':_0x31b7('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':_0x31b7('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x31b7('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x31b7('0xe')]}});function emit(_0xf213c9,_0x48f733,_0x15df1d){logger[_0x31b7('0x12')](_0xf213c9,_0x48f733,JSON[_0x31b7('0x13')](_0x15df1d));io['to'](_0xf213c9)[_0x31b7('0x14')](_0x48f733,_0x15df1d);}function handleError(_0x3daf67){return function(_0x5f3245){console[_0x31b7('0x15')](_0x31b7('0x16'),_0x5f3245,_0x5f3245 instanceof RangeError);logger[_0x31b7('0x17')](_0x5f3245[_0x31b7('0x18')]);if(_0x5f3245 instanceof RangeError){if(_0x5f3245[_0x31b7('0x19')]){delete _0x5f3245['name'];}_0x3daf67[_0x31b7('0x1a')](0x194)[_0x31b7('0x1b')](_0x5f3245);}else{if(_0x5f3245[_0x31b7('0x19')]){delete _0x5f3245[_0x31b7('0x19')];}_0x3daf67['status'](0x1f4)[_0x31b7('0x1b')](_0x5f3245);}};}function checkError(){return function(_0x15a20c){if(!_0x15a20c){throw new RangeError(_0x31b7('0x1c'));}return _0x15a20c;};}function respondWithRpcPromise(_0x2e4a56,_0x4d4368){return new BPromise(function(_0x33dd04,_0x20cb03){var _0x250574=amiClient;return _0x250574[_0x31b7('0x1d')](_0x2e4a56,_0x4d4368)[_0x31b7('0x1e')](function(_0x2d24bf){if(_0x2d24bf[_0x31b7('0x17')]){if(_0x2d24bf[_0x31b7('0x17')][_0x31b7('0x1f')]===0x1f4){return _0x20cb03(_0x2d24bf['error'][_0x31b7('0x20')]);}return _0x33dd04(_0x2d24bf[_0x31b7('0x17')][_0x31b7('0x20')]);}else{_0x33dd04(_0x2d24bf[_0x31b7('0x21')]);}})['catch'](function(_0xb8a998){_0x20cb03(_0xb8a998);});});}function getAgent(_0x516b89){return db[_0x31b7('0x22')][_0x31b7('0x23')]({'where':{'id':_0x516b89,'role':_0x31b7('0x24')}})[_0x31b7('0x1e')](checkError());}function getAgentCheckSession(_0xffacb,_0x128865){return new BPromise(function(_0x21ab03,_0x554a66){var _0x4e58e5=respondWithRpcPromise('VoiceChannels');var _0x503549=getAgent(_0xffacb);Promise[_0x31b7('0x25')]([_0x4e58e5,_0x503549])[_0x31b7('0x1e')](function(_0x2a7c54){var _0x4f5e1d=_0x2a7c54[0x0];var _0x169238=_0x2a7c54[0x1];var _0x6ba73c=_[_0x31b7('0x26')](_0x4f5e1d[_0x31b7('0x27')],function(_0x58a87e){return _0x58a87e[_0x31b7('0x28')]==_0x169238['id']&&_0x58a87e[_0x31b7('0x29')]==_0x128865;});if(_0x6ba73c['length']==0x1){_0x21ab03(_0x169238);}else{_0x554a66(new RangeError('sessionId\x20'+_0x128865+_0x31b7('0x2a')));}});});}exports[_0x31b7('0x2b')]=function(_0xdde2de,_0x35f83c){logger['info']('originate\x20fired:',_0xdde2de[_0x31b7('0x2c')]);var _0x345393=originateValidation[_0x31b7('0xc')](_0xdde2de[_0x31b7('0x2c')]);if(_0x345393[_0x31b7('0x2d')]>0x0){return _0x35f83c['status'](0x190)['json'](_0x345393);}var _0x36fe4e=_0xdde2de[_0x31b7('0x2c')]['userId'];var _0x2cd807=_0xdde2de[_0x31b7('0x2c')]['callNumber'];var _0x267691=_0xdde2de[_0x31b7('0x2c')][_0x31b7('0x2e')];var _0x23d84b=_0xdde2de[_0x31b7('0x2c')][_0x31b7('0x2f')];return getAgent(_0x36fe4e)[_0x31b7('0x1e')](function(_0x200314){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x200314[_0x31b7('0x19')]);emit(util[_0x31b7('0x31')](_0x31b7('0x32'),_0x200314['name']),'webbar:originate',{'callNumber':_0x2cd807,'callerId':_0x267691,'callbackUrl':_0x23d84b});return _0x35f83c[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x34')});})[_0x31b7('0x35')](handleError(_0x35f83c));};exports[_0x31b7('0x36')]=function(_0x37dc32,_0x15a42b){logger[_0x31b7('0x12')](_0x31b7('0x37'),_0x37dc32[_0x31b7('0x2c')]);var _0x5849ad=hangupValidation[_0x31b7('0xc')](_0x37dc32[_0x31b7('0x2c')]);if(_0x5849ad[_0x31b7('0x2d')]>0x0){return _0x15a42b[_0x31b7('0x1a')](0x190)['json'](_0x5849ad);}var _0x20e865=_0x37dc32[_0x31b7('0x2c')]['userId'];var _0x3f8a6b=_0x37dc32['body']['sessionId'];return getAgent(_0x20e865)[_0x31b7('0x1e')](function(_0x10e82c){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x10e82c[_0x31b7('0x19')]);emit(util['format'](_0x31b7('0x32'),_0x10e82c['name']),'webbar:hangup',{'sessionId':_0x3f8a6b});return _0x15a42b['status'](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x38')});})[_0x31b7('0x35')](handleError(_0x15a42b));};exports[_0x31b7('0x39')]=function(_0x17c2d9,_0x4ccea9){logger[_0x31b7('0x12')]('answer\x20fired:',_0x17c2d9[_0x31b7('0x2c')]);var _0x3caab0=answerValidation[_0x31b7('0xc')](_0x17c2d9[_0x31b7('0x2c')]);if(_0x3caab0['length']>0x0){return _0x4ccea9[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x3caab0);}var _0x1046fb=_0x17c2d9['body'][_0x31b7('0x3a')];var _0x51918d=_0x17c2d9[_0x31b7('0x2c')][_0x31b7('0x29')];return getAgent(_0x1046fb)['then'](function(_0x152b88){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x152b88[_0x31b7('0x19')]);emit(util['format'](_0x31b7('0x32'),_0x152b88['name']),'webbar:answer',{'sessionId':_0x51918d});return _0x4ccea9[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x3b')});})[_0x31b7('0x35')](handleError(_0x4ccea9));};exports['hold']=function(_0x6014e,_0x2be7d6){logger['info'](_0x31b7('0x3c'),_0x6014e[_0x31b7('0x2c')]);var _0x2d313b=holdValidation['validate'](_0x6014e[_0x31b7('0x2c')]);if(_0x2d313b[_0x31b7('0x2d')]>0x0){return _0x2be7d6[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x2d313b);}var _0x345059=_0x6014e[_0x31b7('0x2c')][_0x31b7('0x3a')];var _0x40aead=_0x6014e['body'][_0x31b7('0x29')];return getAgent(_0x345059)['then'](function(_0x5a72ee){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x5a72ee[_0x31b7('0x19')]);emit(util[_0x31b7('0x31')]('user:%s',_0x5a72ee[_0x31b7('0x19')]),_0x31b7('0x3d'),{'sessionId':_0x40aead});return _0x2be7d6[_0x31b7('0x1a')](0xc8)['json']({'error':![],'message':_0x31b7('0x3e')});})[_0x31b7('0x35')](handleError(_0x2be7d6));};exports[_0x31b7('0x3f')]=function(_0x3b5868,_0x2bf59c){logger[_0x31b7('0x12')](_0x31b7('0x40'),_0x3b5868[_0x31b7('0x2c')]);var _0x4d1fd6=unholdValidation['validate'](_0x3b5868[_0x31b7('0x2c')]);if(_0x4d1fd6[_0x31b7('0x2d')]>0x0){return _0x2bf59c[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x4d1fd6);}var _0x4920e0=_0x3b5868['body'][_0x31b7('0x3a')];var _0x413bb0=_0x3b5868[_0x31b7('0x2c')][_0x31b7('0x29')];return getAgent(_0x4920e0)[_0x31b7('0x1e')](function(_0x12b713){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x12b713['name']);emit(util['format'](_0x31b7('0x32'),_0x12b713[_0x31b7('0x19')]),_0x31b7('0x41'),{'sessionId':_0x413bb0});return _0x2bf59c[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x42')});})[_0x31b7('0x35')](handleError(_0x2bf59c));};exports[_0x31b7('0x43')]=function(_0x1ec95f,_0x3e1c4f){logger['info']('calls\x20fired:',_0x3e1c4f[_0x31b7('0x2c')]);var _0x954c=callsValidation[_0x31b7('0xc')](_0x1ec95f[_0x31b7('0x2c')]);if(_0x954c['length']>0x0){return _0x3e1c4f[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x954c);}var _0x316175=_0x1ec95f[_0x31b7('0x2c')][_0x31b7('0x3a')];var _0x23ffad=respondWithRpcPromise(_0x31b7('0x44'));var _0x3a8b87=getAgent(_0x316175);return Promise[_0x31b7('0x25')]([_0x23ffad,_0x3a8b87])[_0x31b7('0x1e')](function(_0x29ef38){var _0x4cd34e=_0x29ef38[0x0];var _0x4c77e0=_0x29ef38[0x1];var _0x2cf8ec=_[_0x31b7('0x26')](_0x4cd34e[_0x31b7('0x27')],function(_0x3f25d7){return _0x3f25d7[_0x31b7('0x28')]==_0x4c77e0['id'];});return _0x3e1c4f[_0x31b7('0x1a')](0xc8)['json']({'count':_0x2cf8ec[_0x31b7('0x2d')],'rows':_0x2cf8ec});})['catch'](handleError(_0x3e1c4f));};exports['conference']=function(_0x531bcd,_0x3686b8){logger[_0x31b7('0x12')](_0x31b7('0x45'),_0x531bcd[_0x31b7('0x2c')]);var _0x44934f=conferenceValidation[_0x31b7('0xc')](_0x531bcd[_0x31b7('0x2c')]);if(_0x44934f[_0x31b7('0x2d')]>0x0){return _0x3686b8[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x44934f);}var _0x40d54b=_0x531bcd[_0x31b7('0x2c')][_0x31b7('0x3a')];return getAgent(_0x40d54b)[_0x31b7('0x1e')](function(_0x2598d5){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x2598d5[_0x31b7('0x19')]);emit(util[_0x31b7('0x31')](_0x31b7('0x32'),_0x2598d5[_0x31b7('0x19')]),_0x31b7('0x46'));return _0x3686b8[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':'conference\x20executed!'});})[_0x31b7('0x35')](handleError(_0x3686b8));};exports[_0x31b7('0x47')]=function(_0x47f5f7,_0x2900ff){logger['info'](_0x31b7('0x48'),_0x47f5f7[_0x31b7('0x2c')]);var _0x318746=transferValidation[_0x31b7('0xc')](_0x47f5f7['body']);if(_0x318746[_0x31b7('0x2d')]>0x0){return _0x2900ff['status'](0x190)[_0x31b7('0x33')](_0x318746);}var _0x4b368c=_0x47f5f7[_0x31b7('0x2c')][_0x31b7('0x3a')];var _0xfeb4e2=_0x47f5f7[_0x31b7('0x2c')]['sessionId'];var _0xb4be25=_0x47f5f7[_0x31b7('0x2c')][_0x31b7('0x49')];return getAgent(_0x4b368c)[_0x31b7('0x1e')](function(_0x3c0cf8){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x3c0cf8[_0x31b7('0x19')]);emit(util[_0x31b7('0x31')](_0x31b7('0x32'),_0x3c0cf8[_0x31b7('0x19')]),_0x31b7('0x4a'),{'sessionId':_0xfeb4e2,'transferNumber':_0xb4be25});return _0x2900ff[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x4b')});})[_0x31b7('0x35')](handleError(_0x2900ff));}; \ No newline at end of file +var _0xb43b=['localhost','socket.io-emitter','redis','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','emit','handleError:','stack','name','send','status','request','error','code','result','catch','User','findOne','agent','VoiceChannels','all','then','filter','rows','sessionId','originate','info','originate\x20fired:','body','length','json','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','UserId','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','client','http','../../config/logger','webbarapi','defaults'];(function(_0x503f89,_0x3b726e){var _0x44fb74=function(_0x4623b7){while(--_0x4623b7){_0x503f89['push'](_0x503f89['shift']());}};_0x44fb74(++_0x3b726e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x651c5a,_0x1bce12){_0x651c5a=_0x651c5a-0x0;var _0x510c91=_0xb43b[_0x651c5a];return _0x510c91;};'use strict';var path=require(_0xbb43('0x0'));var fs=require('fs');var _=require(_0xbb43('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xbb43('0x2'));var util=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0xbb43('0x5')][_0xbb43('0x6')]({'port':0x232a});var logger=require(_0xbb43('0x7'))(_0xbb43('0x8'));var Redis=require('ioredis');config['redis']=_[_0xbb43('0x9')](config['redis'],{'host':_0xbb43('0xa'),'port':0x18eb});var io=require(_0xbb43('0xb'))(new Redis(config[_0xbb43('0xc')]));var Schema=require(_0xbb43('0xd'));var originateValidation=new Schema({'userId':{'type':_0xbb43('0xe'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xbb43('0xf'),'required':[!![],_0xbb43('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xbb43('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xbb43('0xe'),'required':[!![],_0xbb43('0x11')]},'sessionId':{'type':_0xbb43('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xbb43('0xe'),'required':[!![],_0xbb43('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xbb43('0xe'),'required':[!![],_0xbb43('0x11')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xbb43('0xf'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xbb43('0x11')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xbb43('0xe'),'required':[!![],_0xbb43('0x11')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xbb43('0xe'),'required':[!![],_0xbb43('0x11')]}});function emit(_0x57bd1d,_0x526330,_0x202980){logger['info'](_0x57bd1d,_0x526330,JSON['stringify'](_0x202980));io['to'](_0x57bd1d)[_0xbb43('0x12')](_0x526330,_0x202980);}function handleError(_0x8242ab){return function(_0x2e3b43){console['log'](_0xbb43('0x13'),_0x2e3b43,_0x2e3b43 instanceof RangeError);logger['error'](_0x2e3b43[_0xbb43('0x14')]);if(_0x2e3b43 instanceof RangeError){if(_0x2e3b43[_0xbb43('0x15')]){delete _0x2e3b43['name'];}_0x8242ab['status'](0x194)[_0xbb43('0x16')](_0x2e3b43);}else{if(_0x2e3b43[_0xbb43('0x15')]){delete _0x2e3b43[_0xbb43('0x15')];}_0x8242ab[_0xbb43('0x17')](0x1f4)['send'](_0x2e3b43);}};}function checkError(){return function(_0x40a650){if(!_0x40a650){throw new RangeError('NotFound');}return _0x40a650;};}function respondWithRpcPromise(_0x3a257d,_0x4bfaca){return new BPromise(function(_0x2f5e31,_0x565256){var _0x3f323e=amiClient;return _0x3f323e[_0xbb43('0x18')](_0x3a257d,_0x4bfaca)['then'](function(_0x1d0768){if(_0x1d0768['error']){if(_0x1d0768[_0xbb43('0x19')][_0xbb43('0x1a')]===0x1f4){return _0x565256(_0x1d0768[_0xbb43('0x19')]['message']);}return _0x2f5e31(_0x1d0768['error']['message']);}else{_0x2f5e31(_0x1d0768[_0xbb43('0x1b')]);}})[_0xbb43('0x1c')](function(_0x5d8310){_0x565256(_0x5d8310);});});}function getAgent(_0x3b3083){return db[_0xbb43('0x1d')][_0xbb43('0x1e')]({'where':{'id':_0x3b3083,'role':_0xbb43('0x1f')}})['then'](checkError());}function getAgentCheckSession(_0x4b5342,_0x27fd7a){return new BPromise(function(_0x42800f,_0xa88db0){var _0x8b3205=respondWithRpcPromise(_0xbb43('0x20'));var _0x40b04b=getAgent(_0x4b5342);Promise[_0xbb43('0x21')]([_0x8b3205,_0x40b04b])[_0xbb43('0x22')](function(_0x539730){var _0x2ad6da=_0x539730[0x0];var _0x56fe33=_0x539730[0x1];var _0x31fbc8=_[_0xbb43('0x23')](_0x2ad6da[_0xbb43('0x24')],function(_0x1880cd){return _0x1880cd['UserId']==_0x56fe33['id']&&_0x1880cd[_0xbb43('0x25')]==_0x27fd7a;});if(_0x31fbc8['length']==0x1){_0x42800f(_0x56fe33);}else{_0xa88db0(new RangeError('sessionId\x20'+_0x27fd7a+'\x20not\x20found!'));}});});}exports[_0xbb43('0x26')]=function(_0x573a05,_0xa7e144){logger[_0xbb43('0x27')](_0xbb43('0x28'),_0x573a05['body']);var _0x205011=originateValidation[_0xbb43('0xd')](_0x573a05[_0xbb43('0x29')]);if(_0x205011[_0xbb43('0x2a')]>0x0){return _0xa7e144[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x205011);}var _0x3de482=_0x573a05[_0xbb43('0x29')]['userId'];var _0x2109aa=_0x573a05[_0xbb43('0x29')][_0xbb43('0x2c')];var _0x244d66=_0x573a05[_0xbb43('0x29')][_0xbb43('0x2d')];var _0x1eae09=_0x573a05[_0xbb43('0x29')][_0xbb43('0x2e')];return getAgent(_0x3de482)[_0xbb43('0x22')](function(_0x21346a){logger[_0xbb43('0x27')](_0xbb43('0x2f'),_0x21346a[_0xbb43('0x15')]);emit(util[_0xbb43('0x30')](_0xbb43('0x31'),_0x21346a['name']),_0xbb43('0x32'),{'callNumber':_0x2109aa,'callerId':_0x244d66,'callbackUrl':_0x1eae09});return _0xa7e144[_0xbb43('0x17')](0xc8)['json']({'error':![],'message':_0xbb43('0x33')});})[_0xbb43('0x1c')](handleError(_0xa7e144));};exports[_0xbb43('0x34')]=function(_0x5374a2,_0x5f4601){logger['info'](_0xbb43('0x35'),_0x5374a2[_0xbb43('0x29')]);var _0x4a95c3=hangupValidation['validate'](_0x5374a2[_0xbb43('0x29')]);if(_0x4a95c3[_0xbb43('0x2a')]>0x0){return _0x5f4601[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x4a95c3);}var _0x3f9e7f=_0x5374a2['body'][_0xbb43('0x36')];var _0x526cb8=_0x5374a2[_0xbb43('0x29')][_0xbb43('0x25')];return getAgent(_0x3f9e7f)[_0xbb43('0x22')](function(_0x531d96){logger[_0xbb43('0x27')]('entityFound:',_0x531d96[_0xbb43('0x15')]);emit(util[_0xbb43('0x30')]('user:%s',_0x531d96[_0xbb43('0x15')]),'webbar:hangup',{'sessionId':_0x526cb8});return _0x5f4601[_0xbb43('0x17')](0xc8)[_0xbb43('0x2b')]({'error':![],'message':_0xbb43('0x37')});})[_0xbb43('0x1c')](handleError(_0x5f4601));};exports['answer']=function(_0x3e0871,_0x136bd4){logger['info'](_0xbb43('0x38'),_0x3e0871['body']);var _0x42b965=answerValidation[_0xbb43('0xd')](_0x3e0871[_0xbb43('0x29')]);if(_0x42b965[_0xbb43('0x2a')]>0x0){return _0x136bd4[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x42b965);}var _0x4bf8ed=_0x3e0871[_0xbb43('0x29')]['userId'];var _0x307f1e=_0x3e0871[_0xbb43('0x29')][_0xbb43('0x25')];return getAgent(_0x4bf8ed)[_0xbb43('0x22')](function(_0x4970fb){logger[_0xbb43('0x27')](_0xbb43('0x2f'),_0x4970fb[_0xbb43('0x15')]);emit(util[_0xbb43('0x30')](_0xbb43('0x31'),_0x4970fb[_0xbb43('0x15')]),_0xbb43('0x39'),{'sessionId':_0x307f1e});return _0x136bd4[_0xbb43('0x17')](0xc8)['json']({'error':![],'message':_0xbb43('0x3a')});})[_0xbb43('0x1c')](handleError(_0x136bd4));};exports['hold']=function(_0x1a66f0,_0x5d4c19){logger['info']('hold\x20fired:',_0x1a66f0['body']);var _0x1c3482=holdValidation['validate'](_0x1a66f0[_0xbb43('0x29')]);if(_0x1c3482['length']>0x0){return _0x5d4c19[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x1c3482);}var _0x1f3fb4=_0x1a66f0['body'][_0xbb43('0x36')];var _0x4d9f18=_0x1a66f0[_0xbb43('0x29')][_0xbb43('0x25')];return getAgent(_0x1f3fb4)[_0xbb43('0x22')](function(_0x29840e){logger[_0xbb43('0x27')](_0xbb43('0x2f'),_0x29840e[_0xbb43('0x15')]);emit(util['format'](_0xbb43('0x31'),_0x29840e[_0xbb43('0x15')]),_0xbb43('0x3b'),{'sessionId':_0x4d9f18});return _0x5d4c19[_0xbb43('0x17')](0xc8)['json']({'error':![],'message':_0xbb43('0x3c')});})[_0xbb43('0x1c')](handleError(_0x5d4c19));};exports[_0xbb43('0x3d')]=function(_0xb1883e,_0x4b7712){logger[_0xbb43('0x27')](_0xbb43('0x3e'),_0xb1883e[_0xbb43('0x29')]);var _0x4e1959=unholdValidation[_0xbb43('0xd')](_0xb1883e[_0xbb43('0x29')]);if(_0x4e1959[_0xbb43('0x2a')]>0x0){return _0x4b7712[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x4e1959);}var _0x59c805=_0xb1883e['body'][_0xbb43('0x36')];var _0x5c75ba=_0xb1883e[_0xbb43('0x29')][_0xbb43('0x25')];return getAgent(_0x59c805)['then'](function(_0x29aea0){logger[_0xbb43('0x27')](_0xbb43('0x2f'),_0x29aea0[_0xbb43('0x15')]);emit(util[_0xbb43('0x30')]('user:%s',_0x29aea0[_0xbb43('0x15')]),'webbar:unhold',{'sessionId':_0x5c75ba});return _0x4b7712['status'](0xc8)[_0xbb43('0x2b')]({'error':![],'message':_0xbb43('0x3f')});})[_0xbb43('0x1c')](handleError(_0x4b7712));};exports[_0xbb43('0x40')]=function(_0x129ee6,_0x5db053){logger['info'](_0xbb43('0x41'),_0x5db053[_0xbb43('0x29')]);var _0x3a84ad=callsValidation[_0xbb43('0xd')](_0x129ee6[_0xbb43('0x29')]);if(_0x3a84ad[_0xbb43('0x2a')]>0x0){return _0x5db053[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x3a84ad);}var _0x1a3f98=_0x129ee6['body'][_0xbb43('0x36')];var _0xb996d7=respondWithRpcPromise(_0xbb43('0x20'));var _0x3675d9=getAgent(_0x1a3f98);return Promise[_0xbb43('0x21')]([_0xb996d7,_0x3675d9])[_0xbb43('0x22')](function(_0x3f7262){var _0x3589fd=_0x3f7262[0x0];var _0x3e01e4=_0x3f7262[0x1];var _0x49a54e=_['filter'](_0x3589fd[_0xbb43('0x24')],function(_0x2b72ae){return _0x2b72ae[_0xbb43('0x42')]==_0x3e01e4['id'];});return _0x5db053[_0xbb43('0x17')](0xc8)[_0xbb43('0x2b')]({'count':_0x49a54e[_0xbb43('0x2a')],'rows':_0x49a54e});})[_0xbb43('0x1c')](handleError(_0x5db053));};exports['conference']=function(_0x3bda63,_0x599eec){logger['info'](_0xbb43('0x43'),_0x3bda63[_0xbb43('0x29')]);var _0x3cccea=conferenceValidation[_0xbb43('0xd')](_0x3bda63[_0xbb43('0x29')]);if(_0x3cccea[_0xbb43('0x2a')]>0x0){return _0x599eec[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x3cccea);}var _0x51b076=_0x3bda63['body'][_0xbb43('0x36')];return getAgent(_0x51b076)[_0xbb43('0x22')](function(_0x137e75){logger[_0xbb43('0x27')](_0xbb43('0x2f'),_0x137e75[_0xbb43('0x15')]);emit(util[_0xbb43('0x30')](_0xbb43('0x31'),_0x137e75[_0xbb43('0x15')]),'webbar:conference');return _0x599eec[_0xbb43('0x17')](0xc8)[_0xbb43('0x2b')]({'error':![],'message':_0xbb43('0x44')});})[_0xbb43('0x1c')](handleError(_0x599eec));};exports[_0xbb43('0x45')]=function(_0x33a4db,_0x5745eb){logger[_0xbb43('0x27')](_0xbb43('0x46'),_0x33a4db[_0xbb43('0x29')]);var _0x6d3bb1=transferValidation[_0xbb43('0xd')](_0x33a4db['body']);if(_0x6d3bb1[_0xbb43('0x2a')]>0x0){return _0x5745eb[_0xbb43('0x17')](0x190)[_0xbb43('0x2b')](_0x6d3bb1);}var _0x231b11=_0x33a4db[_0xbb43('0x29')][_0xbb43('0x36')];var _0x2bd30e=_0x33a4db[_0xbb43('0x29')][_0xbb43('0x25')];var _0x3ab906=_0x33a4db['body'][_0xbb43('0x47')];return getAgent(_0x231b11)['then'](function(_0x2b9e5d){logger[_0xbb43('0x27')](_0xbb43('0x2f'),_0x2b9e5d[_0xbb43('0x15')]);emit(util[_0xbb43('0x30')]('user:%s',_0x2b9e5d['name']),_0xbb43('0x48'),{'sessionId':_0x2bd30e,'transferNumber':_0x3ab906});return _0x5745eb[_0xbb43('0x17')](0xc8)['json']({'error':![],'message':_0xbb43('0x49')});})[_0xbb43('0x1c')](handleError(_0x5745eb));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 863f723..b24640b 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 _0x92d7=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','create','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','/:id/send','update','delete','destroy','removeDispositions','removeAgents','multer'];(function(_0x193aa3,_0x43aa53){var _0x10a85d=function(_0x493c0b){while(--_0x493c0b){_0x193aa3['push'](_0x193aa3['shift']());}};_0x10a85d(++_0x43aa53);}(_0x92d7,0xdd));var _0x792d=function(_0x396e23,_0x3024eb){_0x396e23=_0x396e23-0x0;var _0x4226db=_0x92d7[_0x396e23];return _0x4226db;};'use strict';var multer=require(_0x792d('0x0'));var util=require(_0x792d('0x1'));var path=require(_0x792d('0x2'));var timeout=require(_0x792d('0x3'));var express=require(_0x792d('0x4'));var router=express[_0x792d('0x5')]();var fs_extra=require(_0x792d('0x6'));var auth=require(_0x792d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x792d('0x8'));var controller=require(_0x792d('0x9'));router[_0x792d('0xa')]('/',auth[_0x792d('0xb')](),controller[_0x792d('0xc')]);router['get'](_0x792d('0xd'),auth[_0x792d('0xb')](),controller[_0x792d('0xe')]);router['get'](_0x792d('0xf'),auth[_0x792d('0xb')](),controller[_0x792d('0x10')]);router[_0x792d('0xa')](_0x792d('0x11'),auth[_0x792d('0xb')](),controller[_0x792d('0x12')]);router[_0x792d('0xa')](_0x792d('0x13'),auth[_0x792d('0xb')](),controller[_0x792d('0x14')]);router[_0x792d('0xa')](_0x792d('0x15'),auth[_0x792d('0xb')](),controller[_0x792d('0x16')]);router[_0x792d('0xa')](_0x792d('0x17'),auth[_0x792d('0xb')](),controller['getApplications']);router['post']('/',auth[_0x792d('0xb')](),controller[_0x792d('0x18')]);router[_0x792d('0x19')](_0x792d('0x11'),auth[_0x792d('0xb')](),controller[_0x792d('0x1a')]);router[_0x792d('0x19')](_0x792d('0x13'),auth[_0x792d('0xb')](),controller[_0x792d('0x1b')]);router[_0x792d('0x19')]('/:id/users',auth[_0x792d('0xb')](),controller[_0x792d('0x1c')]);router[_0x792d('0x19')](_0x792d('0x17'),auth[_0x792d('0xb')](),controller[_0x792d('0x1d')]);router[_0x792d('0x19')](_0x792d('0x1e'),controller['notify']);router[_0x792d('0x19')](_0x792d('0x1f'),auth[_0x792d('0xb')](),controller['send']);router['put'](_0x792d('0xf'),auth[_0x792d('0xb')](),controller[_0x792d('0x20')]);router[_0x792d('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x792d('0x22')]);router[_0x792d('0x21')](_0x792d('0x11'),auth['isAuthenticated'](),controller[_0x792d('0x23')]);router[_0x792d('0x21')](_0x792d('0x13'),auth[_0x792d('0xb')](),controller['removeAnswers']);router[_0x792d('0x21')](_0x792d('0x15'),auth['isAuthenticated'](),controller[_0x792d('0x24')]);module['exports']=router; \ No newline at end of file +var _0x7af6=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','notify','/:id/send','put','update','destroy','delete','removeAgents','exports','multer','util','connect-timeout'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7af6,0xcf));var _0x67af=function(_0x39a3f4,_0x111c40){_0x39a3f4=_0x39a3f4-0x0;var _0x345121=_0x7af6[_0x39a3f4];return _0x345121;};'use strict';var multer=require(_0x67af('0x0'));var util=require(_0x67af('0x1'));var path=require('path');var timeout=require(_0x67af('0x2'));var express=require(_0x67af('0x3'));var router=express[_0x67af('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x67af('0x5'));var interaction=require(_0x67af('0x6'));var config=require(_0x67af('0x7'));var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0x67af('0x8')](),controller[_0x67af('0x9')]);router[_0x67af('0xa')](_0x67af('0xb'),auth[_0x67af('0x8')](),controller[_0x67af('0xc')]);router[_0x67af('0xa')](_0x67af('0xd'),auth[_0x67af('0x8')](),controller[_0x67af('0xe')]);router['get'](_0x67af('0xf'),auth[_0x67af('0x8')](),controller[_0x67af('0x10')]);router[_0x67af('0xa')]('/:id/canned_answers',auth[_0x67af('0x8')](),controller[_0x67af('0x11')]);router[_0x67af('0xa')](_0x67af('0x12'),auth[_0x67af('0x8')](),controller[_0x67af('0x13')]);router[_0x67af('0xa')](_0x67af('0x14'),auth[_0x67af('0x8')](),controller[_0x67af('0x15')]);router[_0x67af('0x16')]('/',auth['isAuthenticated'](),controller[_0x67af('0x17')]);router[_0x67af('0x16')]('/:id/dispositions',auth[_0x67af('0x8')](),controller[_0x67af('0x18')]);router[_0x67af('0x16')]('/:id/canned_answers',auth[_0x67af('0x8')](),controller[_0x67af('0x19')]);router['post'](_0x67af('0x12'),auth[_0x67af('0x8')](),controller['addAgents']);router[_0x67af('0x16')](_0x67af('0x14'),auth['isAuthenticated'](),controller[_0x67af('0x1a')]);router[_0x67af('0x16')]('/:id/notify',controller[_0x67af('0x1b')]);router['post'](_0x67af('0x1c'),auth[_0x67af('0x8')](),controller['send']);router[_0x67af('0x1d')](_0x67af('0xd'),auth[_0x67af('0x8')](),controller[_0x67af('0x1e')]);router['delete'](_0x67af('0xd'),auth[_0x67af('0x8')](),controller[_0x67af('0x1f')]);router[_0x67af('0x20')](_0x67af('0xf'),auth[_0x67af('0x8')](),controller['removeDispositions']);router[_0x67af('0x20')]('/:id/canned_answers',auth[_0x67af('0x8')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x67af('0x8')](),controller[_0x67af('0x21')]);module[_0x67af('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index a1a68b0..300582f 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 _0x0946=['sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x5d1d5e,_0x4ac3f8){var _0x28436c=function(_0x286ac0){while(--_0x286ac0){_0x5d1d5e['push'](_0x5d1d5e['shift']());}};_0x28436c(++_0x4ac3f8);}(_0x0946,0x130));var _0x6094=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x0946[_0x26462c];return _0x509a42;};'use strict';var Sequelize=require(_0x6094('0x0'));var rs=require(_0x6094('0x1'));module[_0x6094('0x2')]={'name':{'type':Sequelize[_0x6094('0x3')],'unique':_0x6094('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x6094('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x6094('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x6094('0x3')],'defaultValue':function(){return rs[_0x6094('0x5')]();}},'phone':{'type':Sequelize[_0x6094('0x3')]},'type':{'type':Sequelize[_0x6094('0x6')](_0x6094('0x7'),_0x6094('0x8'))},'accountSid':{'type':Sequelize[_0x6094('0x3')]},'baseUrl':{'type':Sequelize[_0x6094('0x3')]},'authToken':{'type':Sequelize[_0x6094('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6094('0x9')],'defaultValue':function(){return _0x6094('0xa');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6094('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6094('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6094('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6094('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6094('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6094('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6094('0xc')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6094('0xb')],'defaultValue':![],'comment':_0x6094('0xd'),'set':function(_0x438527){if(!_0x438527){this[_0x6094('0xe')](_0x6094('0xf'),null);}this['setDataValue']('mandatoryDisposition',_0x438527);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x65a3=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','randomstring','exports','name','STRING','generate','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x13042f,_0x2022c4){var _0x5de5a0=function(_0x565cf1){while(--_0x565cf1){_0x13042f['push'](_0x13042f['shift']());}};_0x5de5a0(++_0x2022c4);}(_0x65a3,0x8c));var _0x365a=function(_0x38270c,_0x557fe0){_0x38270c=_0x38270c-0x0;var _0x19ad30=_0x65a3[_0x38270c];return _0x19ad30;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x365a('0x0'));module[_0x365a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x365a('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x365a('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x365a('0x3')],'defaultValue':function(){return rs[_0x365a('0x4')]();}},'phone':{'type':Sequelize[_0x365a('0x3')]},'type':{'type':Sequelize['ENUM'](_0x365a('0x5'),_0x365a('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x365a('0x3')]},'authToken':{'type':Sequelize[_0x365a('0x3')]},'notificationTemplate':{'type':Sequelize[_0x365a('0x7')],'defaultValue':function(){return _0x365a('0x8');}},'notificationSound':{'type':Sequelize[_0x365a('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x365a('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x365a('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x365a('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x365a('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x365a('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x365a('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x365a('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x365a('0x9')],'defaultValue':![],'comment':_0x365a('0xb'),'set':function(_0x4694cd){if(!_0x4694cd){this['setDataValue'](_0x365a('0xc'),null);}this[_0x365a('0xd')](_0x365a('0xe'),_0x4694cd);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index b1d0c7b..21ccd73 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 _0x8101=['moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','http','request','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','account','sinch','statuses','timestamp','message_id','orderBy','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','replace','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','applications','push','close','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','WhatsappQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','entity\x20found','set','text/xml','\x0a','to\x20is\x20mandatory','List','Messages','WhatsappMessage','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x38b163,_0x483c7a){var _0x5475e0=function(_0x1b487f){while(--_0x1b487f){_0x38b163['push'](_0x38b163['shift']());}};_0x5475e0(++_0x483c7a);}(_0x8101,0xc0));var _0x1810=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x8101[_0x4fbfd9];return _0x31dc94;};'use strict';var emlformat=require(_0x1810('0x0'));var rimraf=require(_0x1810('0x1'));var zipdir=require(_0x1810('0x2'));var jsonpatch=require(_0x1810('0x3'));var rp=require(_0x1810('0x4'));var moment=require(_0x1810('0x5'));var BPromise=require(_0x1810('0x6'));var Mustache=require(_0x1810('0x7'));var util=require(_0x1810('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x1810('0x9'));var ejs=require(_0x1810('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1810('0xb'));var squel=require(_0x1810('0xc'));var crypto=require(_0x1810('0xd'));var jsforce=require(_0x1810('0xe'));var deskjs=require(_0x1810('0xf'));var toCsv=require(_0x1810('0x9'));var querystring=require(_0x1810('0x10'));var Papa=require(_0x1810('0x11'));var Redis=require(_0x1810('0x12'));var authService=require(_0x1810('0x13'));var qs=require(_0x1810('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1810('0x15'));var logger=require(_0x1810('0x16'))('api');var utils=require(_0x1810('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1810('0x18'))['db'];config[_0x1810('0x19')]=_[_0x1810('0x1a')](config[_0x1810('0x19')],{'host':_0x1810('0x1b'),'port':0x18eb});var socket=require(_0x1810('0x1c'))(new Redis(config['redis']));require(_0x1810('0x1d'))[_0x1810('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x1810('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x49d637,_0x187dca,_0xbdebf5,_0x282e1c){return new BPromise(function(_0x175025,_0x840343){var _0x2f08dd=_0x282e1c||client;return _0x2f08dd[_0x1810('0x20')](_0x49d637,_0xbdebf5)['then'](function(_0x5aea81){logger['info'](_0x1810('0x21'),_0x187dca,'request\x20sent');logger[_0x1810('0x22')](_0x1810('0x23'),_0x187dca,_0x1810('0x24'),JSON[_0x1810('0x25')](_0x5aea81));if(_0x5aea81['error']){if(_0x5aea81[_0x1810('0x26')]['code']===0x1f4){logger[_0x1810('0x26')](_0x1810('0x21'),_0x187dca,_0x5aea81['error'][_0x1810('0x27')]);return _0x840343(_0x5aea81[_0x1810('0x26')][_0x1810('0x27')]);}logger[_0x1810('0x26')](_0x1810('0x21'),_0x187dca,_0x5aea81[_0x1810('0x26')]['message']);return _0x175025(_0x5aea81[_0x1810('0x26')][_0x1810('0x27')]);}else{logger[_0x1810('0x28')](_0x1810('0x21'),_0x187dca,'request\x20sent');_0x175025(_0x5aea81[_0x1810('0x29')]['message']);}})['catch'](function(_0x788796){logger[_0x1810('0x26')](_0x1810('0x21'),_0x187dca,_0x788796);_0x840343(_0x788796);});});}function respondWithStatusCode(_0x23704c,_0x2b6da6){_0x2b6da6=_0x2b6da6||0xcc;return function(_0x543c65){if(_0x543c65){return _0x23704c[_0x1810('0x2a')](_0x2b6da6);}return _0x23704c[_0x1810('0x2b')](_0x2b6da6)[_0x1810('0x2c')]();};}function respondWithResult(_0x3b93c7,_0x523bb2){_0x523bb2=_0x523bb2||0xc8;return function(_0x4b3953){if(_0x4b3953){return _0x3b93c7[_0x1810('0x2b')](_0x523bb2)[_0x1810('0x2d')](_0x4b3953);}};}function respondWithFilteredResult(_0x302005,_0x9d0a22){return function(_0x2d387a){if(_0x2d387a){var _0xbac7da=typeof _0x9d0a22[_0x1810('0x2e')]===_0x1810('0x2f')&&typeof _0x9d0a22[_0x1810('0x30')]===_0x1810('0x2f');var _0x255c5a=_0x2d387a[_0x1810('0x31')];var _0x8f6e99=_0xbac7da?0x0:_0x9d0a22['offset'];var _0x380b00=_0xbac7da?_0x2d387a[_0x1810('0x31')]:_0x9d0a22[_0x1810('0x2e')]+_0x9d0a22[_0x1810('0x30')];var _0x2183cf;if(_0x380b00>=_0x255c5a){_0x380b00=_0x255c5a;_0x2183cf=0xc8;}else{_0x2183cf=0xce;}_0x302005[_0x1810('0x2b')](_0x2183cf);return _0x302005['set'](_0x1810('0x32'),_0x8f6e99+'-'+_0x380b00+'/'+_0x255c5a)[_0x1810('0x2d')](_0x2d387a);}return null;};}function patchUpdates(_0xb30cab){return function(_0x2958c0){try{jsonpatch[_0x1810('0x33')](_0x2958c0,_0xb30cab,!![]);}catch(_0x49ee34){return BPromise[_0x1810('0x34')](_0x49ee34);}return _0x2958c0[_0x1810('0x35')]();};}function saveUpdates(_0x440607,_0x49ad0f){return function(_0x1d2938){if(_0x1d2938){return _0x1d2938[_0x1810('0x36')](_0x440607)[_0x1810('0x37')](function(_0xb46b04){return _0xb46b04;});}return null;};}function removeEntity(_0x3c3d0a,_0x287181){return function(_0xaecd29){if(_0xaecd29){return _0xaecd29[_0x1810('0x38')]()[_0x1810('0x37')](function(){var _0x2ee69d=_0xaecd29[_0x1810('0x39')]({'plain':!![]});var _0x3b6606=_0x1810('0x3a');return db[_0x1810('0x3b')][_0x1810('0x38')]({'where':{'type':_0x3b6606,'resourceId':_0x2ee69d['id']}})['then'](function(){return _0xaecd29;});})[_0x1810('0x37')](function(){_0x3c3d0a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xbb39c2,_0x202888){return function(_0x509ea9){if(!_0x509ea9){_0xbb39c2[_0x1810('0x2a')](0x194);}return _0x509ea9;};}function handleError(_0x40ff54,_0x3f5e4c){_0x3f5e4c=_0x3f5e4c||0x1f4;return function(_0x345da0){logger[_0x1810('0x26')](_0x345da0[_0x1810('0x3c')]);if(_0x345da0[_0x1810('0x3d')]){delete _0x345da0['name'];}_0x40ff54[_0x1810('0x2b')](_0x3f5e4c)[_0x1810('0x3e')](_0x345da0);};}exports['index']=function(_0x560419,_0x2ccaad){var _0x569d55={'include':[{'model':db[_0x1810('0x3f')],'as':_0x1810('0x40')}]},_0x24e174={},_0x293d3e={'count':0x0,'rows':[]};var _0x3af7d2=_[_0x1810('0x41')](db[_0x1810('0x42')][_0x1810('0x43')],function(_0xc059d4){return{'name':_0xc059d4['fieldName'],'type':_0xc059d4[_0x1810('0x44')]['key']};});_0x24e174[_0x1810('0x45')]=_[_0x1810('0x41')](_0x3af7d2,_0x1810('0x3d'));_0x24e174[_0x1810('0x46')]=_[_0x1810('0x47')](_0x560419[_0x1810('0x46')]);_0x24e174[_0x1810('0x48')]=_[_0x1810('0x49')](_0x24e174[_0x1810('0x45')],_0x24e174[_0x1810('0x46')]);_0x569d55['attributes']=_[_0x1810('0x49')](_0x24e174[_0x1810('0x45')],qs[_0x1810('0x4a')](_0x560419['query'][_0x1810('0x4a')]));_0x569d55[_0x1810('0x4b')]=_0x569d55[_0x1810('0x4b')][_0x1810('0x4c')]?_0x569d55[_0x1810('0x4b')]:_0x24e174[_0x1810('0x45')];if(!_0x560419['query'][_0x1810('0x4d')](_0x1810('0x4e'))){_0x569d55[_0x1810('0x30')]=qs[_0x1810('0x30')](_0x560419[_0x1810('0x46')]['limit']);_0x569d55[_0x1810('0x2e')]=qs[_0x1810('0x2e')](_0x560419[_0x1810('0x46')][_0x1810('0x2e')]);}_0x569d55[_0x1810('0x4f')]=qs[_0x1810('0x50')](_0x560419[_0x1810('0x46')][_0x1810('0x50')]);_0x569d55[_0x1810('0x51')]=qs[_0x1810('0x48')](_[_0x1810('0x52')](_0x560419['query'],_0x24e174[_0x1810('0x48')]),_0x3af7d2);if(_0x560419['query'][_0x1810('0x53')]){_0x569d55['where']=_[_0x1810('0x54')](_0x569d55[_0x1810('0x51')],{'$or':_[_0x1810('0x41')](_0x3af7d2,function(_0x2f3c21){if(_0x2f3c21[_0x1810('0x44')]!==_0x1810('0x55')){var _0x40b011={};_0x40b011[_0x2f3c21[_0x1810('0x3d')]]={'$like':'%'+_0x560419[_0x1810('0x46')][_0x1810('0x53')]+'%'};return _0x40b011;}})});}_0x569d55=_[_0x1810('0x54')]({},_0x569d55,_0x560419[_0x1810('0x56')]);var _0x4bb93f={'where':_0x569d55['where']};return db[_0x1810('0x42')]['count'](_0x4bb93f)[_0x1810('0x37')](function(_0x3d6688){_0x293d3e['count']=_0x3d6688;if(_0x560419['query'][_0x1810('0x57')]){_0x569d55[_0x1810('0x58')]=[{'all':!![]}];}return db[_0x1810('0x42')][_0x1810('0x59')](_0x569d55);})[_0x1810('0x37')](function(_0x49e1f7){_0x293d3e[_0x1810('0x5a')]=_0x49e1f7;return _0x293d3e;})[_0x1810('0x37')](respondWithFilteredResult(_0x2ccaad,_0x569d55))[_0x1810('0x5b')](handleError(_0x2ccaad,null));};exports[_0x1810('0x5c')]=function(_0x425f2f,_0x3ece6d){var _0x27a8b1={'raw':![],'where':{'id':_0x425f2f[_0x1810('0x5d')]['id']},'include':[{'model':db[_0x1810('0x3f')],'as':_0x1810('0x40')}]},_0x25d609={};_0x25d609['model']=_[_0x1810('0x47')](db[_0x1810('0x42')][_0x1810('0x43')]);_0x25d609[_0x1810('0x46')]=_['keys'](_0x425f2f[_0x1810('0x46')]);_0x25d609[_0x1810('0x48')]=_['intersection'](_0x25d609[_0x1810('0x45')],_0x25d609['query']);_0x27a8b1['attributes']=_[_0x1810('0x49')](_0x25d609['model'],qs[_0x1810('0x4a')](_0x425f2f[_0x1810('0x46')][_0x1810('0x4a')]));_0x27a8b1[_0x1810('0x4b')]=_0x27a8b1[_0x1810('0x4b')][_0x1810('0x4c')]?_0x27a8b1[_0x1810('0x4b')]:_0x25d609[_0x1810('0x45')];if(_0x425f2f[_0x1810('0x46')][_0x1810('0x57')]){_0x27a8b1[_0x1810('0x58')]=[{'all':!![]}];}_0x27a8b1=_['merge']({},_0x27a8b1,_0x425f2f['options']);return db['WhatsappAccount'][_0x1810('0x5e')](_0x27a8b1)[_0x1810('0x37')](handleEntityNotFound(_0x3ece6d,null))[_0x1810('0x37')](respondWithResult(_0x3ece6d,null))['catch'](handleError(_0x3ece6d,null));};exports[_0x1810('0x5f')]=function(_0xf7b311,_0x555b5d){return db[_0x1810('0x42')][_0x1810('0x5f')](_0xf7b311[_0x1810('0x60')],{})['then'](function(_0x51873e){var _0x1450d5=_0xf7b311[_0x1810('0x61')][_0x1810('0x39')]({'plain':!![]});if(!_0x1450d5)throw new Error(_0x1810('0x62'));if(_0x1450d5[_0x1810('0x63')]==='user'){var _0x399ae2=_0x51873e['get']({'plain':!![]});var _0xa6b963='WhatsappAccounts';return db[_0x1810('0x64')][_0x1810('0x5e')]({'where':{'name':_0xa6b963,'userProfileId':_0x1450d5['userProfileId']},'raw':!![]})[_0x1810('0x37')](function(_0x59bea6){if(_0x59bea6&&_0x59bea6[_0x1810('0x65')]===0x0){return db[_0x1810('0x3b')][_0x1810('0x5f')]({'name':_0x399ae2[_0x1810('0x3d')],'resourceId':_0x399ae2['id'],'type':_0x59bea6[_0x1810('0x3d')],'sectionId':_0x59bea6['id']},{})['then'](function(){return _0x51873e;});}else{return _0x51873e;}})[_0x1810('0x5b')](function(_0x39c360){logger['error'](_0x1810('0x66'),_0x39c360);throw _0x39c360;});}return _0x51873e;})['then'](respondWithResult(_0x555b5d,0xc9))[_0x1810('0x5b')](handleError(_0x555b5d,null));};exports[_0x1810('0x36')]=function(_0x116287,_0x378a0a){if(_0x116287[_0x1810('0x60')]['id']){delete _0x116287['body']['id'];}return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0x116287['params']['id']},'include':[{'model':db[_0x1810('0x3f')],'as':_0x1810('0x40')}]})[_0x1810('0x37')](handleEntityNotFound(_0x378a0a,null))[_0x1810('0x37')](saveUpdates(_0x116287[_0x1810('0x60')],null))[_0x1810('0x37')](respondWithResult(_0x378a0a,null))[_0x1810('0x5b')](handleError(_0x378a0a,null));};exports[_0x1810('0x38')]=function(_0x29ac7e,_0x41eaef){return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0x29ac7e[_0x1810('0x5d')]['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x41eaef,null))[_0x1810('0x37')](removeEntity(_0x41eaef,null))['catch'](handleError(_0x41eaef,null));};exports[_0x1810('0x67')]=function(_0x21150c,_0x463074){return db[_0x1810('0x42')][_0x1810('0x67')]()[_0x1810('0x37')](respondWithResult(_0x463074,null))['catch'](handleError(_0x463074,null));};exports[_0x1810('0x68')]=function(_0x35c92a,_0x3f2e45,_0x5d74b8){if(_0x35c92a[_0x1810('0x60')]['id']){delete _0x35c92a['body']['id'];}return db[_0x1810('0x42')]['find']({'where':{'id':_0x35c92a[_0x1810('0x5d')]['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x3f2e45,null))['then'](function(_0x39051b){if(_0x39051b){_0x35c92a[_0x1810('0x60')][_0x1810('0x69')]=_0x39051b['id'];return db[_0x1810('0x6a')][_0x1810('0x5f')](_0x35c92a[_0x1810('0x60')]);}})[_0x1810('0x37')](respondWithResult(_0x3f2e45,null))['catch'](handleError(_0x3f2e45,null));};exports[_0x1810('0x6b')]=function(_0x4ca1ac,_0x4b7067,_0x45efe3){var _0x5c59f9={'raw':![],'where':{}};var _0x3dba05={};var _0xc86140={'count':0x0,'rows':[]};return db[_0x1810('0x42')][_0x1810('0x6c')]({'where':{'id':_0x4ca1ac[_0x1810('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4b7067,null))['then'](function(_0x3a93ec){if(_0x3a93ec){_0x3dba05[_0x1810('0x45')]=_[_0x1810('0x47')](db[_0x1810('0x6a')]['rawAttributes']);_0x3dba05[_0x1810('0x46')]=_[_0x1810('0x47')](_0x4ca1ac['query']);_0x3dba05[_0x1810('0x48')]=_['intersection'](_0x3dba05[_0x1810('0x45')],_0x3dba05[_0x1810('0x46')]);_0x5c59f9['attributes']=_['intersection'](_0x3dba05['model'],qs[_0x1810('0x4a')](_0x4ca1ac['query'][_0x1810('0x4a')]));_0x5c59f9['attributes']=_0x5c59f9['attributes'][_0x1810('0x4c')]?_0x5c59f9[_0x1810('0x4b')]:_0x3dba05[_0x1810('0x45')];if(!_0x4ca1ac[_0x1810('0x46')][_0x1810('0x4d')](_0x1810('0x4e'))){_0x5c59f9[_0x1810('0x30')]=qs[_0x1810('0x30')](_0x4ca1ac['query'][_0x1810('0x30')]);_0x5c59f9[_0x1810('0x2e')]=qs['offset'](_0x4ca1ac[_0x1810('0x46')][_0x1810('0x2e')]);}_0x5c59f9[_0x1810('0x4f')]=qs[_0x1810('0x50')](_0x4ca1ac['query'][_0x1810('0x50')]);_0x5c59f9['where']=qs[_0x1810('0x48')](_[_0x1810('0x52')](_0x4ca1ac[_0x1810('0x46')],_0x3dba05['filters']));_0x5c59f9['where'][_0x1810('0x69')]=_0x3a93ec['id'];if(_0x4ca1ac[_0x1810('0x46')][_0x1810('0x53')]){_0x5c59f9[_0x1810('0x51')]=_[_0x1810('0x54')](_0x5c59f9[_0x1810('0x51')],{'$or':_[_0x1810('0x41')](_0x5c59f9[_0x1810('0x4b')],function(_0x46062e){var _0x17e02b={};_0x17e02b[_0x46062e]={'$like':'%'+_0x4ca1ac['query'][_0x1810('0x53')]+'%'};return _0x17e02b;})});}_0x5c59f9=_['merge']({},_0x5c59f9,_0x4ca1ac[_0x1810('0x56')]);return db[_0x1810('0x6a')][_0x1810('0x31')]({'where':_0x5c59f9[_0x1810('0x51')]})[_0x1810('0x37')](function(_0x2b1abe){_0xc86140['count']=_0x2b1abe;if(_0x4ca1ac[_0x1810('0x46')][_0x1810('0x57')]){_0x5c59f9[_0x1810('0x58')]=[{'all':!![]}];}return db[_0x1810('0x6a')][_0x1810('0x59')](_0x5c59f9);})[_0x1810('0x37')](function(_0x162546){_0xc86140[_0x1810('0x5a')]=_0x162546;return _0xc86140;});}})[_0x1810('0x37')](respondWithFilteredResult(_0x4b7067,_0x5c59f9))[_0x1810('0x5b')](handleError(_0x4b7067,null));};exports[_0x1810('0x6d')]=function(_0xbb25a0,_0x29c9b6,_0x43235d){return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0xbb25a0[_0x1810('0x5d')]['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x29c9b6,null))['then'](function(_0x2b2303){if(_0x2b2303){return _0x2b2303[_0x1810('0x6d')](_0xbb25a0['query'][_0x1810('0x6e')]);}})[_0x1810('0x37')](respondWithStatusCode(_0x29c9b6,null))[_0x1810('0x5b')](handleError(_0x29c9b6,null));};exports['addAnswer']=function(_0x420869,_0x55b6b4,_0x4e63e1){if(_0x420869[_0x1810('0x60')]['id']){delete _0x420869[_0x1810('0x60')]['id'];}return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0x420869['params']['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x55b6b4,null))[_0x1810('0x37')](function(_0x336c63){if(_0x336c63){_0x420869['body']['WhatsappAccountId']=_0x336c63['id'];return db[_0x1810('0x6f')]['create'](_0x420869[_0x1810('0x60')]);}})[_0x1810('0x37')](respondWithResult(_0x55b6b4,null))['catch'](handleError(_0x55b6b4,null));};exports[_0x1810('0x70')]=function(_0x179e9d,_0x22375a,_0x3bd68f){var _0x53d358={'raw':![],'where':{}};var _0x2981b6={};var _0x5e1122={'count':0x0,'rows':[]};return db[_0x1810('0x42')][_0x1810('0x6c')]({'where':{'id':_0x179e9d[_0x1810('0x5d')]['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x22375a,null))[_0x1810('0x37')](function(_0x4595c6){if(_0x4595c6){_0x2981b6[_0x1810('0x45')]=_[_0x1810('0x47')](db[_0x1810('0x6f')][_0x1810('0x43')]);_0x2981b6[_0x1810('0x46')]=_['keys'](_0x179e9d[_0x1810('0x46')]);_0x2981b6['filters']=_['intersection'](_0x2981b6['model'],_0x2981b6[_0x1810('0x46')]);_0x53d358[_0x1810('0x4b')]=_['intersection'](_0x2981b6['model'],qs[_0x1810('0x4a')](_0x179e9d[_0x1810('0x46')]['fields']));_0x53d358[_0x1810('0x4b')]=_0x53d358[_0x1810('0x4b')][_0x1810('0x4c')]?_0x53d358['attributes']:_0x2981b6['model'];if(!_0x179e9d[_0x1810('0x46')][_0x1810('0x4d')]('nolimit')){_0x53d358[_0x1810('0x30')]=qs[_0x1810('0x30')](_0x179e9d[_0x1810('0x46')][_0x1810('0x30')]);_0x53d358[_0x1810('0x2e')]=qs[_0x1810('0x2e')](_0x179e9d[_0x1810('0x46')]['offset']);}_0x53d358[_0x1810('0x4f')]=qs[_0x1810('0x50')](_0x179e9d[_0x1810('0x46')][_0x1810('0x50')]);_0x53d358[_0x1810('0x51')]=qs[_0x1810('0x48')](_[_0x1810('0x52')](_0x179e9d['query'],_0x2981b6['filters']));_0x53d358[_0x1810('0x51')][_0x1810('0x69')]=_0x4595c6['id'];if(_0x179e9d[_0x1810('0x46')]['filter']){_0x53d358[_0x1810('0x51')]=_[_0x1810('0x54')](_0x53d358[_0x1810('0x51')],{'$or':_[_0x1810('0x41')](_0x53d358['attributes'],function(_0x3dd290){var _0x5cdad6={};_0x5cdad6[_0x3dd290]={'$like':'%'+_0x179e9d[_0x1810('0x46')][_0x1810('0x53')]+'%'};return _0x5cdad6;})});}_0x53d358=_[_0x1810('0x54')]({},_0x53d358,_0x179e9d[_0x1810('0x56')]);return db[_0x1810('0x6f')]['count']({'where':_0x53d358[_0x1810('0x51')]})[_0x1810('0x37')](function(_0x58ffcf){_0x5e1122[_0x1810('0x31')]=_0x58ffcf;if(_0x179e9d['query']['includeAll']){_0x53d358[_0x1810('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1810('0x59')](_0x53d358);})[_0x1810('0x37')](function(_0x1cfd42){_0x5e1122[_0x1810('0x5a')]=_0x1cfd42;return _0x5e1122;});}})['then'](respondWithFilteredResult(_0x22375a,_0x53d358))[_0x1810('0x5b')](handleError(_0x22375a,null));};exports[_0x1810('0x71')]=function(_0x543b0a,_0x151631,_0x19e0b8){return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0x543b0a['params']['id']}})['then'](handleEntityNotFound(_0x151631,null))[_0x1810('0x37')](function(_0x45cb84){if(_0x45cb84){return _0x45cb84[_0x1810('0x71')](_0x543b0a[_0x1810('0x46')][_0x1810('0x6e')]);}})[_0x1810('0x37')](respondWithStatusCode(_0x151631,null))[_0x1810('0x5b')](handleError(_0x151631,null));};exports[_0x1810('0x72')]=function(_0x1dc707,_0x56bc45,_0xf92cdc){return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0x1dc707['params']['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x56bc45,null))[_0x1810('0x37')](function(_0xb0e795){if(_0xb0e795){return _0xb0e795['addAgents'](_0x1dc707[_0x1810('0x60')][_0x1810('0x6e')],_[_0x1810('0x73')](_0x1dc707[_0x1810('0x60')],[_0x1810('0x6e'),'id'])||{})[_0x1810('0x74')](function(_0x5ed96a){for(var _0x4999e3=0x0;_0x4999e3<_0x1dc707[_0x1810('0x60')][_0x1810('0x6e')]['length'];_0x4999e3+=0x1){socket[_0x1810('0x75')](_0x1810('0x76'),{'UserId':Number(_0x1dc707[_0x1810('0x60')][_0x1810('0x6e')][_0x4999e3]),'WhatsappAccountId':Number(_0x1dc707[_0x1810('0x5d')]['id'])});}return _0x5ed96a;});}})[_0x1810('0x37')](respondWithResult(_0x56bc45,null))[_0x1810('0x5b')](handleError(_0x56bc45,null));};exports[_0x1810('0x77')]=function(_0x1a3297,_0x3a7b16,_0x306e66){return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0x1a3297[_0x1810('0x5d')]['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x3a7b16,null))['then'](function(_0xcc643b){if(_0xcc643b){return _0xcc643b[_0x1810('0x77')](_0x1a3297[_0x1810('0x46')][_0x1810('0x6e')])['then'](function(){if(_[_0x1810('0x78')](_0x1a3297[_0x1810('0x46')][_0x1810('0x6e')])){for(var _0x39c40b=0x0;_0x39c40b<_0x1a3297[_0x1810('0x46')]['ids'][_0x1810('0x4c')];_0x39c40b+=0x1){socket[_0x1810('0x75')](_0x1810('0x79'),{'UserId':Number(_0x1a3297['query'][_0x1810('0x6e')][_0x39c40b]),'WhatsappAccountId':Number(_0x1a3297[_0x1810('0x5d')]['id'])});}}else{socket[_0x1810('0x75')](_0x1810('0x79'),{'UserId':Number(_0x1a3297[_0x1810('0x46')][_0x1810('0x6e')]),'WhatsappAccountId':Number(_0x1a3297[_0x1810('0x5d')]['id'])});}});}})[_0x1810('0x37')](respondWithStatusCode(_0x3a7b16,null))[_0x1810('0x5b')](handleError(_0x3a7b16,null));};exports[_0x1810('0x7a')]=function(_0x409ef3,_0x483c0c,_0x2cbe0b){var _0x2e0ac2={};var _0x9c9d50={};var _0x3f4a9a;var _0x460b03;return db[_0x1810('0x42')][_0x1810('0x6c')]({'where':{'id':_0x409ef3[_0x1810('0x5d')]['id']}})['then'](handleEntityNotFound(_0x483c0c,null))[_0x1810('0x37')](function(_0x5a86a9){if(_0x5a86a9){_0x3f4a9a=_0x5a86a9;_0x9c9d50[_0x1810('0x45')]=_[_0x1810('0x47')](db[_0x1810('0x7b')][_0x1810('0x43')]);_0x9c9d50[_0x1810('0x46')]=_[_0x1810('0x47')](_0x409ef3['query']);_0x9c9d50[_0x1810('0x48')]=_[_0x1810('0x49')](_0x9c9d50['model'],_0x9c9d50[_0x1810('0x46')]);_0x2e0ac2[_0x1810('0x4b')]=_[_0x1810('0x49')](_0x9c9d50[_0x1810('0x45')],qs['fields'](_0x409ef3['query'][_0x1810('0x4a')]));_0x2e0ac2[_0x1810('0x4b')]=_0x2e0ac2[_0x1810('0x4b')]['length']?_0x2e0ac2[_0x1810('0x4b')]:_0x9c9d50[_0x1810('0x45')];_0x2e0ac2[_0x1810('0x4f')]=qs['sort'](_0x409ef3['query']['sort']);_0x2e0ac2['where']=qs[_0x1810('0x48')](_['pick'](_0x409ef3[_0x1810('0x46')],_0x9c9d50[_0x1810('0x48')]));if(_0x409ef3[_0x1810('0x46')][_0x1810('0x53')]){_0x2e0ac2['where']=_[_0x1810('0x54')](_0x2e0ac2[_0x1810('0x51')],{'$or':_[_0x1810('0x41')](_0x2e0ac2[_0x1810('0x4b')],function(_0x440ed3){var _0x1eaa3b={};_0x1eaa3b[_0x440ed3]={'$like':'%'+_0x409ef3[_0x1810('0x46')][_0x1810('0x53')]+'%'};return _0x1eaa3b;})});}_0x2e0ac2=_[_0x1810('0x54')]({},_0x2e0ac2,_0x409ef3[_0x1810('0x56')]);return _0x3f4a9a[_0x1810('0x7a')](_0x2e0ac2);}})[_0x1810('0x37')](function(_0x4c4c5d){if(_0x4c4c5d){_0x460b03=_0x4c4c5d[_0x1810('0x4c')];if(!_0x409ef3[_0x1810('0x46')][_0x1810('0x4d')](_0x1810('0x4e'))){_0x2e0ac2[_0x1810('0x30')]=qs[_0x1810('0x30')](_0x409ef3[_0x1810('0x46')][_0x1810('0x30')]);_0x2e0ac2[_0x1810('0x2e')]=qs[_0x1810('0x2e')](_0x409ef3[_0x1810('0x46')][_0x1810('0x2e')]);}return _0x3f4a9a['getAgents'](_0x2e0ac2);}})['then'](function(_0x24823b){if(_0x24823b){return _0x24823b?{'count':_0x460b03,'rows':_0x24823b}:null;}})[_0x1810('0x37')](respondWithResult(_0x483c0c,null))['catch'](handleError(_0x483c0c,null));};exports['addApplications']=function(_0x2cc979,_0x213398){var _0x443bc6=_0x2cc979[_0x1810('0x5d')]['id'];var _0x4e25d4=_0x2cc979[_0x1810('0x60')];var _0x339b72=0xc8;var _0x3fbb79=null;return db[_0x1810('0x7c')][_0x1810('0x7d')]({'isolationLevel':db[_0x1810('0x7c')][_0x1810('0x7e')][_0x1810('0x7f')][_0x1810('0x80')]},function(_0x299f6d){return db[_0x1810('0x42')][_0x1810('0x6c')]({'where':{'id':_0x443bc6},'transaction':_0x299f6d})[_0x1810('0x37')](function(_0x3a0c06){if(_0x3a0c06){return db[_0x1810('0x81')]['destroy']({'where':{'WhatsappAccountId':_0x443bc6},'transaction':_0x299f6d})[_0x1810('0x37')](function(){var _0x3f65f4=_[_0x1810('0x41')](_0x4e25d4,function(_0x234836){_0x234836['WhatsappAccountId']=_0x443bc6;return _0x234836;});return db['WhatsappApplication'][_0x1810('0x82')](_0x3f65f4,{'transaction':_0x299f6d});});}else{_0x339b72=0x194;_0x3fbb79=[];}});})[_0x1810('0x37')](function(){if(_0x339b72!==0x194){return db['WhatsappApplication'][_0x1810('0x83')]({'where':{'WhatsappAccountId':_0x443bc6},'order':_0x1810('0x84')})[_0x1810('0x37')](function(_0x489c10){_0x3fbb79=_0x489c10;});}})['catch'](function(_0x20a2e1){_0x339b72=0x1f4;logger[_0x1810('0x26')](_0x20a2e1[_0x1810('0x3c')]);if(_0x20a2e1[_0x1810('0x3d')]){delete _0x20a2e1[_0x1810('0x3d')];}_0x3fbb79=_0x20a2e1;})['finally'](function(){if(_0x3fbb79===null){_0x213398[_0x1810('0x2a')](_0x339b72);}else{if(_0x339b72===0x1f4){_0x213398[_0x1810('0x2b')](_0x339b72)[_0x1810('0x3e')](_0x3fbb79);}else{_0x213398[_0x1810('0x2b')](_0x339b72)[_0x1810('0x2d')](_0x3fbb79);}}});};exports[_0x1810('0x85')]=function(_0x1ade05,_0x1ce16a,_0x40df9d){var _0x15854a={};var _0x151e6e={};var _0x5d7d3f;var _0x4dd720;return db[_0x1810('0x42')][_0x1810('0x6c')]({'where':{'id':_0x1ade05['params']['id']}})['then'](handleEntityNotFound(_0x1ce16a,null))[_0x1810('0x37')](function(_0x26f5d2){if(_0x26f5d2){_0x5d7d3f=_0x26f5d2;_0x151e6e[_0x1810('0x45')]=_[_0x1810('0x47')](db[_0x1810('0x81')]['rawAttributes']);_0x151e6e[_0x1810('0x46')]=_[_0x1810('0x47')](_0x1ade05['query']);_0x151e6e[_0x1810('0x48')]=_['intersection'](_0x151e6e['model'],_0x151e6e[_0x1810('0x46')]);_0x15854a[_0x1810('0x4b')]=_['intersection'](_0x151e6e[_0x1810('0x45')],qs[_0x1810('0x4a')](_0x1ade05[_0x1810('0x46')][_0x1810('0x4a')]));_0x15854a[_0x1810('0x4b')]=_0x15854a[_0x1810('0x4b')][_0x1810('0x4c')]?_0x15854a[_0x1810('0x4b')]:_0x151e6e['model'];_0x15854a[_0x1810('0x4f')]=qs['sort'](_0x1ade05['query'][_0x1810('0x50')]);_0x15854a[_0x1810('0x51')]=qs['filters'](_[_0x1810('0x52')](_0x1ade05[_0x1810('0x46')],_0x151e6e[_0x1810('0x48')]));if(_0x1ade05[_0x1810('0x46')][_0x1810('0x53')]){_0x15854a[_0x1810('0x51')]=_[_0x1810('0x54')](_0x15854a[_0x1810('0x51')],{'$or':_['map'](_0x15854a[_0x1810('0x4b')],function(_0x42e871){var _0x3d95f1={};_0x3d95f1[_0x42e871]={'$like':'%'+_0x1ade05[_0x1810('0x46')][_0x1810('0x53')]+'%'};return _0x3d95f1;})});}_0x15854a=_[_0x1810('0x54')]({},_0x15854a,_0x1ade05['options']);return _0x5d7d3f['getApplications'](_0x15854a);}})[_0x1810('0x37')](function(_0x6a3c18){if(_0x6a3c18){_0x4dd720=_0x6a3c18[_0x1810('0x4c')];if(!_0x1ade05[_0x1810('0x46')]['hasOwnProperty'](_0x1810('0x4e'))){_0x15854a[_0x1810('0x30')]=qs[_0x1810('0x30')](_0x1ade05[_0x1810('0x46')]['limit']);_0x15854a['offset']=qs[_0x1810('0x2e')](_0x1ade05[_0x1810('0x46')][_0x1810('0x2e')]);}return _0x5d7d3f[_0x1810('0x85')](_0x15854a);}})[_0x1810('0x37')](function(_0x329e12){if(_0x329e12){return _0x329e12?{'count':_0x4dd720,'rows':_0x329e12}:null;}})[_0x1810('0x37')](respondWithResult(_0x1ce16a,null))[_0x1810('0x5b')](handleError(_0x1ce16a,null));};exports[_0x1810('0x86')]=function(_0xbeea65,_0x1eba46,_0x3acd4c){var _0x1e197c={'channel':'whatsapp'};var _0x1ba26d=[];var _0x62c78d=[];var _0x38999e={};return db[_0x1810('0x42')]['find']({'where':{'id':_0xbeea65[_0x1810('0x5d')]['id']},'include':[{'model':db[_0x1810('0x81')],'as':_0x1810('0x87')}]})[_0x1810('0x37')](handleEntityNotFound(_0x1eba46,null))[_0x1810('0x37')](function(_0x38752f){_0x1e197c[_0x1810('0x88')]=_0x38752f;if(_0x1e197c[_0x1810('0x88')]&&_0x1e197c[_0x1810('0x88')]['type']===_0x1810('0x89')&&_0xbeea65[_0x1810('0x60')][_0x1810('0x8a')]){if(_0xbeea65[_0x1810('0x60')][_0x1810('0x8a')]['length']===0x0)return;if(_0xbeea65[_0x1810('0x60')]['statuses'][0x0]['state']!=='read')return;return db['WhatsappMessage']['update']({'read':!![],'readAt':_0xbeea65[_0x1810('0x60')][_0x1810('0x8a')][0x0][_0x1810('0x8b')]},{'where':{'messageId':_0xbeea65[_0x1810('0x60')]['statuses'][0x0][_0x1810('0x8c')]},'individualHooks':!![]})[_0x1810('0x37')](function(_0x499bff){return _0x1eba46[_0x1810('0x2b')](0xc8)[_0x1810('0x2d')](_0x499bff);});}_0x1e197c['applications']=_[_0x1810('0x8d')](_0x38752f['Applications'],[_0x1810('0x84')],['asc']);if(_0x1e197c[_0x1810('0x88')]['Applications']){delete _0x1e197c[_0x1810('0x88')]['Applications'];}return db['CmContact'][_0x1810('0x67')]()[_0x1810('0x37')](function(_0x36d090){if(!_0x36d090){throw new db[(_0x1810('0x8e'))][(_0x1810('0x8f'))]('no\x20available\x20attributes');}_0x1ba26d=_[_0x1810('0x90')](_['keys'](_0x36d090),['createdAt',_0x1810('0x91')]);_0x62c78d=_['difference'](_['keys'](_0x36d090),[_0x1810('0x92'),_0x1810('0x91'),_0x1810('0x93'),_0x1810('0x94')]);_0x1e197c[_0x1810('0x60')]={'mapKey':_0x1810('0x95')};if(_0x1e197c['account']&&_0x1e197c[_0x1810('0x88')]['type']===_0x1810('0x96')){_0x1e197c['body'][_0x1810('0x97')]=_0xbeea65['body']['From'][_0x1810('0x98')]('whatsapp:','');_0x1e197c[_0x1810('0x60')][_0x1810('0x60')]=_0xbeea65['body']['Body'];_0x1e197c[_0x1810('0x60')][_0x1810('0x99')]=_0xbeea65[_0x1810('0x60')][_0x1810('0x9a')];}if(_0x1e197c[_0x1810('0x88')]&&_0x1e197c[_0x1810('0x88')][_0x1810('0x44')]===_0x1810('0x89')){_0x1e197c['body'][_0x1810('0x97')]=_0xbeea65[_0x1810('0x60')][_0x1810('0x9b')][0x0][_0x1810('0x97')];_0x1e197c[_0x1810('0x60')][_0x1810('0x60')]=_0xbeea65['body'][_0x1810('0x9b')][0x0][_0x1810('0x27')][_0x1810('0x60')];_0x1e197c[_0x1810('0x60')]['messageId']=_0xbeea65[_0x1810('0x60')][_0x1810('0x9b')][0x0][_0x1810('0x8c')];}if(_0x1e197c[_0x1810('0x60')]['id']){delete _0x1e197c[_0x1810('0x60')]['id'];}if(_[_0x1810('0x9c')](_0x1e197c[_0x1810('0x60')]['from'])){throw new db[(_0x1810('0x8e'))][(_0x1810('0x8f'))](_0x1810('0x9d'));}if(_['isNil'](_0x1e197c[_0x1810('0x60')][_0x1810('0x60')])||_0x1e197c[_0x1810('0x60')][_0x1810('0x60')]===''){throw new db[(_0x1810('0x8e'))][(_0x1810('0x8f'))](_0x1810('0x9e'));}if(_[_0x1810('0x9c')](_0x1e197c[_0x1810('0x60')][_0x1810('0x9f')])){throw new db['Sequelize'][(_0x1810('0x8f'))](_0x1810('0xa0')+_0x62c78d);}if(!_['includes'](_0x62c78d,_0x1e197c['body'][_0x1810('0x9f')])){throw new db[(_0x1810('0x8e'))][(_0x1810('0x8f'))](_0x1810('0xa1')+_0x62c78d);}_0x38999e[_0x1e197c['body']['mapKey']]=_0x1e197c[_0x1810('0x60')][_0x1810('0x97')];return db[_0x1810('0xa2')]['find']({'where':{'id':_0x1e197c['account'][_0x1810('0x94')]},'include':[{'model':db[_0x1810('0xa3')],'as':_0x1810('0xa4'),'where':_0x38999e,'limit':0x1,'order':[[_0x1810('0x91'),_0x1810('0xa5')]]}]});})['then'](handleEntityNotFound(_0x1eba46,null))[_0x1810('0x37')](function(_0x386eb1){if(_0x386eb1){_0x1e197c[_0x1810('0xa6')]=_[_0x1810('0x73')](_0x386eb1,[_0x1810('0xa4')]);if(_0x386eb1['Contacts'][_0x1810('0x4c')]){return _0x386eb1[_0x1810('0xa4')][0x0];}var _0x42bf2d=_['defaults'](_0x1e197c[_0x1810('0x60')],{'firstName':_0x1e197c['body'][_0x1810('0x97')],'ListId':_0x386eb1['id']});_0x42bf2d[_0x1e197c[_0x1810('0x60')]['mapKey']]=_0x1e197c[_0x1810('0x60')]['from'];return db['CmContact'][_0x1810('0x5f')](_0x42bf2d,{'fields':_0x1ba26d,'raw':!![]});}})[_0x1810('0x37')](handleEntityNotFound(_0x1eba46,null))[_0x1810('0x37')](function(_0x108d0a){if(_0x108d0a){_0x1e197c[_0x1810('0xa7')]=_0x108d0a;var _0x33e415={'ContactId':_0x108d0a['id'],'phone':_0x1e197c['body'][_0x1810('0x97')],'WhatsappAccountId':_0xbeea65[_0x1810('0x5d')]['id']};var _0x5998fd={'ContactId':_0x108d0a['id'],'WhatsappAccountId':_0xbeea65[_0x1810('0x5d')]['id'],'closed':![]};return db[_0x1810('0xa8')][_0x1810('0x5e')]({'where':_0x5998fd})[_0x1810('0x37')](function(_0x509cf5){if(_0x509cf5){return[_0x509cf5,![]];}return db['WhatsappInteraction'][_0x1810('0x5f')](_0x33e415)[_0x1810('0x37')](function(_0x5c1cf2){return[_0x5c1cf2,!![]];});});}})[_0x1810('0x74')](function(_0x2bab18,_0x3dae41){_0x1e197c['interaction']=_0x2bab18[_0x1810('0x39')]({'plain':!![]});_0x1e197c[_0x1810('0xa9')][_0x1810('0xaa')]=![];if(_0x3dae41){if(_0x1e197c[_0x1810('0x88')][_0x1810('0xab')]){_0x1e197c[_0x1810('0xac')][_0x1810('0xad')]({'id':0x0,'priority':_0x1e197c[_0x1810('0xac')][_0x1810('0x4c')]+0x1,'app':_0x1810('0xae'),'appdata':'unmanaged','interval':_0x1810('0xaf')});}_0x1e197c[_0x1810('0xa9')][_0x1810('0xaa')]=!![];}return db['WhatsappMessage'][_0x1810('0x5f')]({'phone':_0x1e197c[_0x1810('0x60')][_0x1810('0x97')],'messageId':_0x1e197c[_0x1810('0x60')][_0x1810('0x99')],'body':_0x1e197c[_0x1810('0x60')]['body'],'WhatsappAccountId':_0xbeea65[_0x1810('0x5d')]['id'],'WhatsappInteractionId':_0x2bab18['id'],'direction':'in','ContactId':_0x2bab18[_0x1810('0xb0')],'AttachmentId':_0x1e197c[_0x1810('0x60')][_0x1810('0xb1')]});})[_0x1810('0x37')](function(_0x459f36){_0x1e197c[_0x1810('0x27')]=_0x459f36;if(!_0x1e197c[_0x1810('0xa9')][_0x1810('0xb2')])return;return db[_0x1810('0x7b')][_0x1810('0x5e')]({'attributes':['id','name'],'where':{'id':_0x1e197c[_0x1810('0xa9')][_0x1810('0xb2')]}});})[_0x1810('0x37')](function(_0x337e9f){if(_0x337e9f){_0x1e197c['applications'][_0x1810('0xb3')]({'id':0x0,'priority':0x0,'app':_0x1810('0xb4'),'appdata':_0x337e9f[_0x1810('0x3d')]+','+(_0x1e197c[_0x1810('0x88')][_0x1810('0xb5')]||0xa),'interval':_0x1810('0xaf')});}if(!_0x1e197c[_0x1810('0xa9')]['queueId'])return;return db[_0x1810('0xb6')]['find']({'attributes':['id',_0x1810('0x3d')],'where':{'id':_0x1e197c['interaction'][_0x1810('0xb7')]}});})[_0x1810('0x37')](function(_0x5ed7d7){if(_0x5ed7d7){_0x1e197c[_0x1810('0xac')][_0x1810('0xb3')]({'id':0x0,'priority':0x1,'app':_0x1810('0xb8'),'appdata':_0x5ed7d7[_0x1810('0x3d')]+','+(_0x1e197c[_0x1810('0x88')][_0x1810('0xb9')]||0x12c),'interval':_0x1810('0xaf')});}return respondWithRpcPromise(_0x1810('0xba'),_0x1810('0xbb'),_0x1e197c);})['then'](function(_0x1ec7c9){if(_0x1ec7c9){var _0xf0edbd=0xc8;var _0x109672='receiveMessage';logger[_0x1810('0x28')](_0x1810('0x23'),_0x109672,_0xf0edbd,_0x1810('0xbc'));logger[_0x1810('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x109672,_0xf0edbd,_0x1810('0xbc'),JSON['stringify'](_0x1ec7c9));if(_0x1e197c[_0x1810('0x88')]['type']===_0x1810('0x96')){return _0x1eba46[_0x1810('0x2b')](_0xf0edbd)[_0x1810('0xbd')]('Content-Type',_0x1810('0xbe'))[_0x1810('0x3e')](_0x1810('0xbf'));}else{return _0x1eba46[_0x1810('0x2b')](_0xf0edbd)[_0x1810('0x2d')](_0x1ec7c9);}}});})['catch'](handleError(_0x1eba46,null));};exports[_0x1810('0x3e')]=function(_0x214e9a,_0x7ad75f,_0x8dd8c0){var _0x3c185a,_0x3263b4,_0x1d1c8e;if(_[_0x1810('0x9c')](_0x214e9a['body'][_0x1810('0x60')])||_0x214e9a[_0x1810('0x60')][_0x1810('0x60')]===''){throw new db['Sequelize'][(_0x1810('0x8f'))](_0x1810('0x9e'));}if(_[_0x1810('0x9c')](_0x214e9a['body']['to'])){throw new db[(_0x1810('0x8e'))][(_0x1810('0x8f'))](_0x1810('0xc0'));}_0x3c185a=_0x214e9a['body']['to'];return db['WhatsappAccount'][_0x1810('0x5e')]({'where':{'id':_0x214e9a[_0x1810('0x5d')]['id']},'include':[{'model':db[_0x1810('0xa2')],'as':'List','include':[{'model':db[_0x1810('0xa3')],'as':_0x1810('0xa4'),'where':{'mobile':_0x3c185a},'limit':0x1,'order':[[_0x1810('0x91'),_0x1810('0xa5')]]}]}]})[_0x1810('0x37')](handleEntityNotFound(_0x7ad75f,null))[_0x1810('0x37')](function(_0x4114fe){if(_0x4114fe&&_0x4114fe[_0x1810('0xc1')]){_0x3263b4=_0x4114fe['get']({'plain':!![]});if(_0x3263b4[_0x1810('0xc1')]&&_0x3263b4[_0x1810('0xc1')][_0x1810('0xa4')]['length']){return _0x3263b4[_0x1810('0xc1')][_0x1810('0xa4')][0x0];}return db[_0x1810('0xa3')][_0x1810('0x5f')](_[_0x1810('0x1a')](_0x214e9a[_0x1810('0x60')],{'firstName':_0x3c185a,'mobile':_0x3c185a,'phone':_0x3c185a,'ListId':_0x3263b4['ListId']}));}})['then'](handleEntityNotFound(_0x7ad75f,null))[_0x1810('0x37')](function(_0x3e79ce){if(_0x3e79ce){_0x1d1c8e=_0x3e79ce;return db['WhatsappInteraction'][_0x1810('0x5e')]({'where':{'ContactId':_0x1d1c8e['id'],'closed':![],'WhatsappAccountId':_0x3263b4['id']}})[_0x1810('0x37')](function(_0x185bd9){if(_0x185bd9){return[_0x185bd9,![]];}return db[_0x1810('0xa8')]['create']({'UserId':_0x214e9a[_0x1810('0x61')]['id'],'ContactId':_0x1d1c8e['id'],'WhatsappAccountId':_0x3263b4['id'],'phone':_0x3c185a,'firstMsgDirection':'out','Messages':[_[_0x1810('0x54')](_0x214e9a[_0x1810('0x60')],{'read':![],'body':_0x214e9a[_0x1810('0x60')][_0x1810('0x60')],'phone':_0x3c185a,'WhatsappAccountId':_0x3263b4['id'],'UserId':_0x214e9a[_0x1810('0x61')]['id'],'ContactId':_0x1d1c8e['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x1810('0xc2')}]})[_0x1810('0x37')](function(_0x4905a1){return[_0x4905a1,!![]];});});}})['spread'](function(_0x3a87ec,_0x328bd8){if(_0x328bd8){return _0x3a87ec;}return db[_0x1810('0xc3')][_0x1810('0x5f')](_[_0x1810('0x54')](_0x214e9a[_0x1810('0x60')],{'read':![],'body':_0x214e9a['body'][_0x1810('0x60')],'phone':_0x3c185a,'WhatsappAccountId':_0x3263b4['id'],'WhatsappInteractionId':_0x3a87ec['id'],'UserId':_0x214e9a[_0x1810('0x61')]['id'],'ContactId':_0x1d1c8e['id']}))['then'](function(_0x1c6da2){_0x3a87ec[_0x1810('0xc4')][_0x1810('0xc2')]=[];_0x3a87ec[_0x1810('0xc4')][_0x1810('0xc2')]['push'](_0x1c6da2[_0x1810('0xc4')]);return _0x3a87ec;});})[_0x1810('0x37')](respondWithResult(_0x7ad75f,null))[_0x1810('0x5b')](handleError(_0x7ad75f,null));}; \ No newline at end of file +var _0xbecf=['redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','status','end','json','offset','undefined','limit','count','apply','save','then','get','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','WhatsappAccount','includeAll','include','findAll','rows','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','WhatsappAccountId','Disposition','nolimit','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','pick','removeAnswers','ids','addAgents','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','sequelize','Transaction','ISOLATION_LEVELS','WhatsappApplication','priority','stack','getApplications','Applications','account','sinch','statuses','state','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','difference','updatedAt','CompanyId','ListId','mobile','twilio','from','From','whatsapp:','messageId','notifications','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','ContactId','UserId','unshift','waitForTheAssignedAgent','queueId','WhatsappQueue','waitForTheAssignedQueue','*,*,*,*','Start','startRouting','entity\x20found','stringify','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','spread','Messages','dataValues','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0xbecf,0x15c));var _0xfbec=function(_0x434400,_0x16e10e){_0x434400=_0x434400-0x0;var _0x27dd55=_0xbecf[_0x434400];return _0x27dd55;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfbec('0x0'));var jsonpatch=require(_0xfbec('0x1'));var rp=require(_0xfbec('0x2'));var moment=require(_0xfbec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfbec('0x4'));var util=require(_0xfbec('0x5'));var path=require(_0xfbec('0x6'));var sox=require(_0xfbec('0x7'));var csv=require(_0xfbec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfbec('0x9'));var _=require(_0xfbec('0xa'));var squel=require(_0xfbec('0xb'));var crypto=require(_0xfbec('0xc'));var jsforce=require(_0xfbec('0xd'));var deskjs=require(_0xfbec('0xe'));var toCsv=require(_0xfbec('0x8'));var querystring=require(_0xfbec('0xf'));var Papa=require(_0xfbec('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfbec('0x11'));var hardwareService=require(_0xfbec('0x12'));var logger=require(_0xfbec('0x13'))(_0xfbec('0x14'));var utils=require(_0xfbec('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfbec('0x16'));var db=require(_0xfbec('0x17'))['db'];config[_0xfbec('0x18')]=_[_0xfbec('0x19')](config['redis'],{'host':_0xfbec('0x1a'),'port':0x18eb});var socket=require(_0xfbec('0x1b'))(new Redis(config[_0xfbec('0x18')]));require(_0xfbec('0x1c'))['register'](socket);var jayson=require(_0xfbec('0x1d'));var client=jayson['client'][_0xfbec('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x536508,_0x2edf2c,_0x923681,_0x171721){return new BPromise(function(_0x4aa49e,_0xe91fb8){var _0x2a3329=_0x171721||client;return _0x2a3329[_0xfbec('0x1f')](_0x536508,_0x923681)['then'](function(_0x148453){logger[_0xfbec('0x20')](_0xfbec('0x21'),_0x2edf2c,_0xfbec('0x22'));logger[_0xfbec('0x23')](_0xfbec('0x24'),_0x2edf2c,_0xfbec('0x22'),JSON['stringify'](_0x148453));if(_0x148453['error']){if(_0x148453['error'][_0xfbec('0x25')]===0x1f4){logger[_0xfbec('0x26')](_0xfbec('0x21'),_0x2edf2c,_0x148453['error'][_0xfbec('0x27')]);return _0xe91fb8(_0x148453[_0xfbec('0x26')]['message']);}logger[_0xfbec('0x26')](_0xfbec('0x21'),_0x2edf2c,_0x148453['error'][_0xfbec('0x27')]);return _0x4aa49e(_0x148453[_0xfbec('0x26')][_0xfbec('0x27')]);}else{logger[_0xfbec('0x20')](_0xfbec('0x21'),_0x2edf2c,'request\x20sent');_0x4aa49e(_0x148453[_0xfbec('0x28')]['message']);}})[_0xfbec('0x29')](function(_0x1c9a07){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x2edf2c,_0x1c9a07);_0xe91fb8(_0x1c9a07);});});}function respondWithStatusCode(_0x4d8a3f,_0x10f5d3){_0x10f5d3=_0x10f5d3||0xcc;return function(_0x421535){if(_0x421535){return _0x4d8a3f['sendStatus'](_0x10f5d3);}return _0x4d8a3f[_0xfbec('0x2a')](_0x10f5d3)[_0xfbec('0x2b')]();};}function respondWithResult(_0x1613de,_0x4ac842){_0x4ac842=_0x4ac842||0xc8;return function(_0x29126f){if(_0x29126f){return _0x1613de[_0xfbec('0x2a')](_0x4ac842)[_0xfbec('0x2c')](_0x29126f);}};}function respondWithFilteredResult(_0x14aa8a,_0xe7036f){return function(_0x5b359b){if(_0x5b359b){var _0x4aff99=typeof _0xe7036f[_0xfbec('0x2d')]===_0xfbec('0x2e')&&typeof _0xe7036f[_0xfbec('0x2f')]===_0xfbec('0x2e');var _0x202e3b=_0x5b359b[_0xfbec('0x30')];var _0x41b4cf=_0x4aff99?0x0:_0xe7036f['offset'];var _0xa0084a=_0x4aff99?_0x5b359b['count']:_0xe7036f['offset']+_0xe7036f['limit'];var _0x22a487;if(_0xa0084a>=_0x202e3b){_0xa0084a=_0x202e3b;_0x22a487=0xc8;}else{_0x22a487=0xce;}_0x14aa8a[_0xfbec('0x2a')](_0x22a487);return _0x14aa8a['set']('Content-Range',_0x41b4cf+'-'+_0xa0084a+'/'+_0x202e3b)[_0xfbec('0x2c')](_0x5b359b);}return null;};}function patchUpdates(_0xab9f46){return function(_0x242a4b){try{jsonpatch[_0xfbec('0x31')](_0x242a4b,_0xab9f46,!![]);}catch(_0x140569){return BPromise['reject'](_0x140569);}return _0x242a4b[_0xfbec('0x32')]();};}function saveUpdates(_0x2376ce,_0x5e8e01){return function(_0x2c1cbf){if(_0x2c1cbf){return _0x2c1cbf['update'](_0x2376ce)['then'](function(_0x301c3b){return _0x301c3b;});}return null;};}function removeEntity(_0x390494,_0x376f1b){return function(_0x143463){if(_0x143463){return _0x143463['destroy']()[_0xfbec('0x33')](function(){var _0x702f4a=_0x143463[_0xfbec('0x34')]({'plain':!![]});var _0x4996fb='WhatsappAccounts';return db[_0xfbec('0x35')]['destroy']({'where':{'type':_0x4996fb,'resourceId':_0x702f4a['id']}})[_0xfbec('0x33')](function(){return _0x143463;});})[_0xfbec('0x33')](function(){_0x390494[_0xfbec('0x2a')](0xcc)[_0xfbec('0x2b')]();});}};}function handleEntityNotFound(_0x68de54,_0x286a07){return function(_0x5c58fd){if(!_0x5c58fd){_0x68de54['sendStatus'](0x194);}return _0x5c58fd;};}function handleError(_0x387e55,_0x39e8ab){_0x39e8ab=_0x39e8ab||0x1f4;return function(_0x173064){logger[_0xfbec('0x26')](_0x173064['stack']);if(_0x173064[_0xfbec('0x36')]){delete _0x173064['name'];}_0x387e55['status'](_0x39e8ab)[_0xfbec('0x37')](_0x173064);};}exports[_0xfbec('0x38')]=function(_0x315722,_0x2b30e7){var _0x2c6182={'include':[{'model':db[_0xfbec('0x39')],'as':_0xfbec('0x3a')}]},_0x26b6d3={},_0x2eb1e1={'count':0x0,'rows':[]};var _0x40f769=_['map'](db['WhatsappAccount'][_0xfbec('0x3b')],function(_0x2d6d9c){return{'name':_0x2d6d9c[_0xfbec('0x3c')],'type':_0x2d6d9c[_0xfbec('0x3d')]['key']};});_0x26b6d3[_0xfbec('0x3e')]=_[_0xfbec('0x3f')](_0x40f769,_0xfbec('0x36'));_0x26b6d3[_0xfbec('0x40')]=_[_0xfbec('0x41')](_0x315722[_0xfbec('0x40')]);_0x26b6d3[_0xfbec('0x42')]=_['intersection'](_0x26b6d3[_0xfbec('0x3e')],_0x26b6d3[_0xfbec('0x40')]);_0x2c6182['attributes']=_[_0xfbec('0x43')](_0x26b6d3[_0xfbec('0x3e')],qs[_0xfbec('0x44')](_0x315722[_0xfbec('0x40')][_0xfbec('0x44')]));_0x2c6182[_0xfbec('0x45')]=_0x2c6182[_0xfbec('0x45')]['length']?_0x2c6182[_0xfbec('0x45')]:_0x26b6d3[_0xfbec('0x3e')];if(!_0x315722['query'][_0xfbec('0x46')]('nolimit')){_0x2c6182[_0xfbec('0x2f')]=qs['limit'](_0x315722[_0xfbec('0x40')][_0xfbec('0x2f')]);_0x2c6182[_0xfbec('0x2d')]=qs[_0xfbec('0x2d')](_0x315722[_0xfbec('0x40')][_0xfbec('0x2d')]);}_0x2c6182[_0xfbec('0x47')]=qs['sort'](_0x315722[_0xfbec('0x40')][_0xfbec('0x48')]);_0x2c6182[_0xfbec('0x49')]=qs[_0xfbec('0x42')](_['pick'](_0x315722[_0xfbec('0x40')],_0x26b6d3[_0xfbec('0x42')]),_0x40f769);if(_0x315722[_0xfbec('0x40')][_0xfbec('0x4a')]){_0x2c6182[_0xfbec('0x49')]=_[_0xfbec('0x4b')](_0x2c6182[_0xfbec('0x49')],{'$or':_['map'](_0x40f769,function(_0x12b1aa){if(_0x12b1aa[_0xfbec('0x3d')]!=='VIRTUAL'){var _0x17dffe={};_0x17dffe[_0x12b1aa[_0xfbec('0x36')]]={'$like':'%'+_0x315722[_0xfbec('0x40')][_0xfbec('0x4a')]+'%'};return _0x17dffe;}})});}_0x2c6182=_[_0xfbec('0x4b')]({},_0x2c6182,_0x315722['options']);var _0x227411={'where':_0x2c6182[_0xfbec('0x49')]};return db[_0xfbec('0x4c')][_0xfbec('0x30')](_0x227411)[_0xfbec('0x33')](function(_0x5c05a3){_0x2eb1e1[_0xfbec('0x30')]=_0x5c05a3;if(_0x315722[_0xfbec('0x40')][_0xfbec('0x4d')]){_0x2c6182[_0xfbec('0x4e')]=[{'all':!![]}];}return db[_0xfbec('0x4c')][_0xfbec('0x4f')](_0x2c6182);})[_0xfbec('0x33')](function(_0x2cc356){_0x2eb1e1[_0xfbec('0x50')]=_0x2cc356;return _0x2eb1e1;})[_0xfbec('0x33')](respondWithFilteredResult(_0x2b30e7,_0x2c6182))[_0xfbec('0x29')](handleError(_0x2b30e7,null));};exports['show']=function(_0x86c364,_0x30fe9b){var _0x264057={'raw':![],'where':{'id':_0x86c364[_0xfbec('0x51')]['id']},'include':[{'model':db[_0xfbec('0x39')],'as':_0xfbec('0x3a')}]},_0x2c5a9a={};_0x2c5a9a[_0xfbec('0x3e')]=_[_0xfbec('0x41')](db[_0xfbec('0x4c')][_0xfbec('0x3b')]);_0x2c5a9a[_0xfbec('0x40')]=_[_0xfbec('0x41')](_0x86c364['query']);_0x2c5a9a[_0xfbec('0x42')]=_[_0xfbec('0x43')](_0x2c5a9a[_0xfbec('0x3e')],_0x2c5a9a[_0xfbec('0x40')]);_0x264057[_0xfbec('0x45')]=_[_0xfbec('0x43')](_0x2c5a9a[_0xfbec('0x3e')],qs['fields'](_0x86c364['query'][_0xfbec('0x44')]));_0x264057[_0xfbec('0x45')]=_0x264057[_0xfbec('0x45')][_0xfbec('0x52')]?_0x264057[_0xfbec('0x45')]:_0x2c5a9a[_0xfbec('0x3e')];if(_0x86c364['query'][_0xfbec('0x4d')]){_0x264057[_0xfbec('0x4e')]=[{'all':!![]}];}_0x264057=_[_0xfbec('0x4b')]({},_0x264057,_0x86c364[_0xfbec('0x53')]);return db[_0xfbec('0x4c')][_0xfbec('0x54')](_0x264057)[_0xfbec('0x33')](handleEntityNotFound(_0x30fe9b,null))['then'](respondWithResult(_0x30fe9b,null))[_0xfbec('0x29')](handleError(_0x30fe9b,null));};exports[_0xfbec('0x55')]=function(_0x5c6f1d,_0x1f233b){return db[_0xfbec('0x4c')][_0xfbec('0x55')](_0x5c6f1d[_0xfbec('0x56')],{})[_0xfbec('0x33')](function(_0x4fbf88){var _0x2b8d99=_0x5c6f1d[_0xfbec('0x57')][_0xfbec('0x34')]({'plain':!![]});if(!_0x2b8d99)throw new Error(_0xfbec('0x58'));if(_0x2b8d99[_0xfbec('0x59')]===_0xfbec('0x57')){var _0x4d7345=_0x4fbf88['get']({'plain':!![]});var _0xa9a2bc=_0xfbec('0x5a');return db[_0xfbec('0x5b')][_0xfbec('0x54')]({'where':{'name':_0xa9a2bc,'userProfileId':_0x2b8d99[_0xfbec('0x5c')]},'raw':!![]})[_0xfbec('0x33')](function(_0x3c2b99){if(_0x3c2b99&&_0x3c2b99[_0xfbec('0x5d')]===0x0){return db['UserProfileResource'][_0xfbec('0x55')]({'name':_0x4d7345[_0xfbec('0x36')],'resourceId':_0x4d7345['id'],'type':_0x3c2b99[_0xfbec('0x36')],'sectionId':_0x3c2b99['id']},{})[_0xfbec('0x33')](function(){return _0x4fbf88;});}else{return _0x4fbf88;}})[_0xfbec('0x29')](function(_0x3d3fc1){logger['error'](_0xfbec('0x5e'),_0x3d3fc1);throw _0x3d3fc1;});}return _0x4fbf88;})['then'](respondWithResult(_0x1f233b,0xc9))[_0xfbec('0x29')](handleError(_0x1f233b,null));};exports['update']=function(_0x139660,_0x4f9f11){if(_0x139660['body']['id']){delete _0x139660[_0xfbec('0x56')]['id'];}return db[_0xfbec('0x4c')]['find']({'where':{'id':_0x139660[_0xfbec('0x51')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xfbec('0x33')](handleEntityNotFound(_0x4f9f11,null))[_0xfbec('0x33')](saveUpdates(_0x139660[_0xfbec('0x56')],null))['then'](respondWithResult(_0x4f9f11,null))[_0xfbec('0x29')](handleError(_0x4f9f11,null));};exports[_0xfbec('0x5f')]=function(_0x5fe3ba,_0x45d6c2){return db[_0xfbec('0x4c')][_0xfbec('0x54')]({'where':{'id':_0x5fe3ba['params']['id']}})[_0xfbec('0x33')](handleEntityNotFound(_0x45d6c2,null))[_0xfbec('0x33')](removeEntity(_0x45d6c2,null))[_0xfbec('0x29')](handleError(_0x45d6c2,null));};exports[_0xfbec('0x60')]=function(_0x576fc6,_0x53ca19){return db[_0xfbec('0x4c')][_0xfbec('0x60')]()[_0xfbec('0x33')](respondWithResult(_0x53ca19,null))[_0xfbec('0x29')](handleError(_0x53ca19,null));};exports[_0xfbec('0x61')]=function(_0x555120,_0x2654e1,_0x5cf775){if(_0x555120[_0xfbec('0x56')]['id']){delete _0x555120[_0xfbec('0x56')]['id'];}return db[_0xfbec('0x4c')]['find']({'where':{'id':_0x555120['params']['id']}})[_0xfbec('0x33')](handleEntityNotFound(_0x2654e1,null))['then'](function(_0x37bd34){if(_0x37bd34){_0x555120[_0xfbec('0x56')][_0xfbec('0x62')]=_0x37bd34['id'];return db[_0xfbec('0x63')]['create'](_0x555120[_0xfbec('0x56')]);}})[_0xfbec('0x33')](respondWithResult(_0x2654e1,null))[_0xfbec('0x29')](handleError(_0x2654e1,null));};exports['getDispositions']=function(_0x5dcd8a,_0x5e0c94,_0x2e3295){var _0x3df279={'raw':![],'where':{}};var _0x561b90={};var _0x3c925d={'count':0x0,'rows':[]};return db[_0xfbec('0x4c')]['findOne']({'where':{'id':_0x5dcd8a[_0xfbec('0x51')]['id']}})['then'](handleEntityNotFound(_0x5e0c94,null))[_0xfbec('0x33')](function(_0x3493af){if(_0x3493af){_0x561b90['model']=_[_0xfbec('0x41')](db[_0xfbec('0x63')]['rawAttributes']);_0x561b90['query']=_[_0xfbec('0x41')](_0x5dcd8a[_0xfbec('0x40')]);_0x561b90[_0xfbec('0x42')]=_[_0xfbec('0x43')](_0x561b90[_0xfbec('0x3e')],_0x561b90[_0xfbec('0x40')]);_0x3df279[_0xfbec('0x45')]=_['intersection'](_0x561b90[_0xfbec('0x3e')],qs[_0xfbec('0x44')](_0x5dcd8a[_0xfbec('0x40')][_0xfbec('0x44')]));_0x3df279['attributes']=_0x3df279[_0xfbec('0x45')][_0xfbec('0x52')]?_0x3df279[_0xfbec('0x45')]:_0x561b90[_0xfbec('0x3e')];if(!_0x5dcd8a[_0xfbec('0x40')][_0xfbec('0x46')](_0xfbec('0x64'))){_0x3df279[_0xfbec('0x2f')]=qs['limit'](_0x5dcd8a[_0xfbec('0x40')][_0xfbec('0x2f')]);_0x3df279['offset']=qs[_0xfbec('0x2d')](_0x5dcd8a[_0xfbec('0x40')][_0xfbec('0x2d')]);}_0x3df279[_0xfbec('0x47')]=qs[_0xfbec('0x48')](_0x5dcd8a[_0xfbec('0x40')]['sort']);_0x3df279['where']=qs[_0xfbec('0x42')](_['pick'](_0x5dcd8a['query'],_0x561b90['filters']));_0x3df279[_0xfbec('0x49')]['WhatsappAccountId']=_0x3493af['id'];if(_0x5dcd8a[_0xfbec('0x40')]['filter']){_0x3df279[_0xfbec('0x49')]=_['merge'](_0x3df279[_0xfbec('0x49')],{'$or':_[_0xfbec('0x3f')](_0x3df279[_0xfbec('0x45')],function(_0x24c1dd){var _0x344fed={};_0x344fed[_0x24c1dd]={'$like':'%'+_0x5dcd8a[_0xfbec('0x40')][_0xfbec('0x4a')]+'%'};return _0x344fed;})});}_0x3df279=_['merge']({},_0x3df279,_0x5dcd8a[_0xfbec('0x53')]);return db[_0xfbec('0x63')][_0xfbec('0x30')]({'where':_0x3df279['where']})[_0xfbec('0x33')](function(_0x4bc655){_0x3c925d[_0xfbec('0x30')]=_0x4bc655;if(_0x5dcd8a[_0xfbec('0x40')]['includeAll']){_0x3df279['include']=[{'all':!![]}];}return db[_0xfbec('0x63')][_0xfbec('0x4f')](_0x3df279);})[_0xfbec('0x33')](function(_0x2fb4a6){_0x3c925d['rows']=_0x2fb4a6;return _0x3c925d;});}})[_0xfbec('0x33')](respondWithFilteredResult(_0x5e0c94,_0x3df279))[_0xfbec('0x29')](handleError(_0x5e0c94,null));};exports[_0xfbec('0x65')]=function(_0x2b77a4,_0x272196,_0x553a93){return db[_0xfbec('0x4c')][_0xfbec('0x54')]({'where':{'id':_0x2b77a4[_0xfbec('0x51')]['id']}})[_0xfbec('0x33')](handleEntityNotFound(_0x272196,null))['then'](function(_0x4fa1e9){if(_0x4fa1e9){return _0x4fa1e9[_0xfbec('0x65')](_0x2b77a4[_0xfbec('0x40')]['ids']);}})['then'](respondWithStatusCode(_0x272196,null))[_0xfbec('0x29')](handleError(_0x272196,null));};exports[_0xfbec('0x66')]=function(_0x598ab9,_0xfd4fdf,_0x35d032){if(_0x598ab9['body']['id']){delete _0x598ab9['body']['id'];}return db[_0xfbec('0x4c')]['find']({'where':{'id':_0x598ab9['params']['id']}})['then'](handleEntityNotFound(_0xfd4fdf,null))[_0xfbec('0x33')](function(_0x224751){if(_0x224751){_0x598ab9[_0xfbec('0x56')][_0xfbec('0x62')]=_0x224751['id'];return db[_0xfbec('0x67')][_0xfbec('0x55')](_0x598ab9['body']);}})[_0xfbec('0x33')](respondWithResult(_0xfd4fdf,null))[_0xfbec('0x29')](handleError(_0xfd4fdf,null));};exports[_0xfbec('0x68')]=function(_0x6acfb7,_0x56f05,_0x57424d){var _0x26da23={'raw':![],'where':{}};var _0x577d48={};var _0x2d00b8={'count':0x0,'rows':[]};return db[_0xfbec('0x4c')][_0xfbec('0x69')]({'where':{'id':_0x6acfb7[_0xfbec('0x51')]['id']}})[_0xfbec('0x33')](handleEntityNotFound(_0x56f05,null))['then'](function(_0x4bf568){if(_0x4bf568){_0x577d48[_0xfbec('0x3e')]=_[_0xfbec('0x41')](db[_0xfbec('0x67')][_0xfbec('0x3b')]);_0x577d48[_0xfbec('0x40')]=_[_0xfbec('0x41')](_0x6acfb7[_0xfbec('0x40')]);_0x577d48['filters']=_['intersection'](_0x577d48[_0xfbec('0x3e')],_0x577d48[_0xfbec('0x40')]);_0x26da23[_0xfbec('0x45')]=_['intersection'](_0x577d48[_0xfbec('0x3e')],qs[_0xfbec('0x44')](_0x6acfb7[_0xfbec('0x40')][_0xfbec('0x44')]));_0x26da23[_0xfbec('0x45')]=_0x26da23[_0xfbec('0x45')][_0xfbec('0x52')]?_0x26da23[_0xfbec('0x45')]:_0x577d48[_0xfbec('0x3e')];if(!_0x6acfb7[_0xfbec('0x40')]['hasOwnProperty']('nolimit')){_0x26da23['limit']=qs[_0xfbec('0x2f')](_0x6acfb7['query'][_0xfbec('0x2f')]);_0x26da23[_0xfbec('0x2d')]=qs['offset'](_0x6acfb7[_0xfbec('0x40')]['offset']);}_0x26da23['order']=qs[_0xfbec('0x48')](_0x6acfb7[_0xfbec('0x40')][_0xfbec('0x48')]);_0x26da23['where']=qs[_0xfbec('0x42')](_[_0xfbec('0x6a')](_0x6acfb7[_0xfbec('0x40')],_0x577d48[_0xfbec('0x42')]));_0x26da23['where'][_0xfbec('0x62')]=_0x4bf568['id'];if(_0x6acfb7['query'][_0xfbec('0x4a')]){_0x26da23['where']=_[_0xfbec('0x4b')](_0x26da23[_0xfbec('0x49')],{'$or':_[_0xfbec('0x3f')](_0x26da23['attributes'],function(_0x3495bd){var _0x32beda={};_0x32beda[_0x3495bd]={'$like':'%'+_0x6acfb7[_0xfbec('0x40')][_0xfbec('0x4a')]+'%'};return _0x32beda;})});}_0x26da23=_['merge']({},_0x26da23,_0x6acfb7[_0xfbec('0x53')]);return db[_0xfbec('0x67')]['count']({'where':_0x26da23[_0xfbec('0x49')]})[_0xfbec('0x33')](function(_0xaab033){_0x2d00b8[_0xfbec('0x30')]=_0xaab033;if(_0x6acfb7[_0xfbec('0x40')][_0xfbec('0x4d')]){_0x26da23['include']=[{'all':!![]}];}return db[_0xfbec('0x67')]['findAll'](_0x26da23);})[_0xfbec('0x33')](function(_0x4009e2){_0x2d00b8[_0xfbec('0x50')]=_0x4009e2;return _0x2d00b8;});}})['then'](respondWithFilteredResult(_0x56f05,_0x26da23))[_0xfbec('0x29')](handleError(_0x56f05,null));};exports[_0xfbec('0x6b')]=function(_0x3adb0e,_0x440995,_0xe5efdc){return db[_0xfbec('0x4c')]['find']({'where':{'id':_0x3adb0e['params']['id']}})[_0xfbec('0x33')](handleEntityNotFound(_0x440995,null))['then'](function(_0x3a355d){if(_0x3a355d){return _0x3a355d['removeAnswers'](_0x3adb0e['query'][_0xfbec('0x6c')]);}})[_0xfbec('0x33')](respondWithStatusCode(_0x440995,null))[_0xfbec('0x29')](handleError(_0x440995,null));};exports[_0xfbec('0x6d')]=function(_0x3f0cc7,_0x1016ed,_0x505edf){return db[_0xfbec('0x4c')][_0xfbec('0x54')]({'where':{'id':_0x3f0cc7['params']['id']}})['then'](handleEntityNotFound(_0x1016ed,null))['then'](function(_0x3a1179){if(_0x3a1179){return _0x3a1179[_0xfbec('0x6d')](_0x3f0cc7[_0xfbec('0x56')][_0xfbec('0x6c')],_['omit'](_0x3f0cc7['body'],['ids','id'])||{})['spread'](function(_0x34f5ab){for(var _0x53a885=0x0;_0x53a885<_0x3f0cc7[_0xfbec('0x56')][_0xfbec('0x6c')]['length'];_0x53a885+=0x1){socket[_0xfbec('0x6e')](_0xfbec('0x6f'),{'UserId':Number(_0x3f0cc7[_0xfbec('0x56')]['ids'][_0x53a885]),'WhatsappAccountId':Number(_0x3f0cc7[_0xfbec('0x51')]['id'])});}return _0x34f5ab;});}})[_0xfbec('0x33')](respondWithResult(_0x1016ed,null))[_0xfbec('0x29')](handleError(_0x1016ed,null));};exports[_0xfbec('0x70')]=function(_0xf45f62,_0x1e004a,_0x5f1c19){return db[_0xfbec('0x4c')][_0xfbec('0x54')]({'where':{'id':_0xf45f62['params']['id']}})[_0xfbec('0x33')](handleEntityNotFound(_0x1e004a,null))[_0xfbec('0x33')](function(_0x4664e7){if(_0x4664e7){return _0x4664e7['removeAgents'](_0xf45f62[_0xfbec('0x40')][_0xfbec('0x6c')])[_0xfbec('0x33')](function(){if(_['isArray'](_0xf45f62[_0xfbec('0x40')][_0xfbec('0x6c')])){for(var _0x4e5933=0x0;_0x4e5933<_0xf45f62[_0xfbec('0x40')][_0xfbec('0x6c')][_0xfbec('0x52')];_0x4e5933+=0x1){socket[_0xfbec('0x6e')](_0xfbec('0x71'),{'UserId':Number(_0xf45f62[_0xfbec('0x40')]['ids'][_0x4e5933]),'WhatsappAccountId':Number(_0xf45f62[_0xfbec('0x51')]['id'])});}}else{socket[_0xfbec('0x6e')](_0xfbec('0x71'),{'UserId':Number(_0xf45f62[_0xfbec('0x40')][_0xfbec('0x6c')]),'WhatsappAccountId':Number(_0xf45f62[_0xfbec('0x51')]['id'])});}});}})[_0xfbec('0x33')](respondWithStatusCode(_0x1e004a,null))[_0xfbec('0x29')](handleError(_0x1e004a,null));};exports['getAgents']=function(_0x493335,_0x311d71,_0x3e2788){var _0x46b2e6={};var _0x22280c={};var _0x3c3d4c;var _0xf75ced;return db[_0xfbec('0x4c')][_0xfbec('0x69')]({'where':{'id':_0x493335[_0xfbec('0x51')]['id']}})[_0xfbec('0x33')](handleEntityNotFound(_0x311d71,null))[_0xfbec('0x33')](function(_0x8de759){if(_0x8de759){_0x3c3d4c=_0x8de759;_0x22280c[_0xfbec('0x3e')]=_[_0xfbec('0x41')](db['User'][_0xfbec('0x3b')]);_0x22280c['query']=_['keys'](_0x493335[_0xfbec('0x40')]);_0x22280c[_0xfbec('0x42')]=_['intersection'](_0x22280c[_0xfbec('0x3e')],_0x22280c[_0xfbec('0x40')]);_0x46b2e6[_0xfbec('0x45')]=_[_0xfbec('0x43')](_0x22280c[_0xfbec('0x3e')],qs['fields'](_0x493335[_0xfbec('0x40')][_0xfbec('0x44')]));_0x46b2e6[_0xfbec('0x45')]=_0x46b2e6[_0xfbec('0x45')][_0xfbec('0x52')]?_0x46b2e6[_0xfbec('0x45')]:_0x22280c[_0xfbec('0x3e')];_0x46b2e6[_0xfbec('0x47')]=qs[_0xfbec('0x48')](_0x493335['query'][_0xfbec('0x48')]);_0x46b2e6[_0xfbec('0x49')]=qs[_0xfbec('0x42')](_['pick'](_0x493335[_0xfbec('0x40')],_0x22280c[_0xfbec('0x42')]));if(_0x493335['query'][_0xfbec('0x4a')]){_0x46b2e6[_0xfbec('0x49')]=_[_0xfbec('0x4b')](_0x46b2e6['where'],{'$or':_[_0xfbec('0x3f')](_0x46b2e6[_0xfbec('0x45')],function(_0x2d533f){var _0x49b2a2={};_0x49b2a2[_0x2d533f]={'$like':'%'+_0x493335[_0xfbec('0x40')]['filter']+'%'};return _0x49b2a2;})});}_0x46b2e6=_[_0xfbec('0x4b')]({},_0x46b2e6,_0x493335['options']);return _0x3c3d4c[_0xfbec('0x72')](_0x46b2e6);}})['then'](function(_0x4ffbc0){if(_0x4ffbc0){_0xf75ced=_0x4ffbc0['length'];if(!_0x493335['query'][_0xfbec('0x46')](_0xfbec('0x64'))){_0x46b2e6[_0xfbec('0x2f')]=qs[_0xfbec('0x2f')](_0x493335[_0xfbec('0x40')][_0xfbec('0x2f')]);_0x46b2e6[_0xfbec('0x2d')]=qs[_0xfbec('0x2d')](_0x493335[_0xfbec('0x40')][_0xfbec('0x2d')]);}return _0x3c3d4c[_0xfbec('0x72')](_0x46b2e6);}})[_0xfbec('0x33')](function(_0x31ef74){if(_0x31ef74){return _0x31ef74?{'count':_0xf75ced,'rows':_0x31ef74}:null;}})[_0xfbec('0x33')](respondWithResult(_0x311d71,null))['catch'](handleError(_0x311d71,null));};exports['addApplications']=function(_0x2b79db,_0x131a4e){var _0x4dc50a=_0x2b79db[_0xfbec('0x51')]['id'];var _0x37e273=_0x2b79db[_0xfbec('0x56')];var _0xb26ade=0xc8;var _0x126df9=null;return db[_0xfbec('0x73')]['transaction']({'isolationLevel':db[_0xfbec('0x73')][_0xfbec('0x74')][_0xfbec('0x75')]['READ_COMMITTED']},function(_0x52941f){return db[_0xfbec('0x4c')][_0xfbec('0x69')]({'where':{'id':_0x4dc50a},'transaction':_0x52941f})['then'](function(_0x145086){if(_0x145086){return db[_0xfbec('0x76')][_0xfbec('0x5f')]({'where':{'WhatsappAccountId':_0x4dc50a},'transaction':_0x52941f})[_0xfbec('0x33')](function(){var _0x52445c=_[_0xfbec('0x3f')](_0x37e273,function(_0x1ff9ec){_0x1ff9ec['WhatsappAccountId']=_0x4dc50a;return _0x1ff9ec;});return db['WhatsappApplication']['bulkCreate'](_0x52445c,{'transaction':_0x52941f});});}else{_0xb26ade=0x194;_0x126df9=[];}});})[_0xfbec('0x33')](function(){if(_0xb26ade!==0x194){return db[_0xfbec('0x76')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x4dc50a},'order':_0xfbec('0x77')})[_0xfbec('0x33')](function(_0x4f077c){_0x126df9=_0x4f077c;});}})[_0xfbec('0x29')](function(_0x37a870){_0xb26ade=0x1f4;logger[_0xfbec('0x26')](_0x37a870[_0xfbec('0x78')]);if(_0x37a870[_0xfbec('0x36')]){delete _0x37a870[_0xfbec('0x36')];}_0x126df9=_0x37a870;})['finally'](function(){if(_0x126df9===null){_0x131a4e['sendStatus'](_0xb26ade);}else{if(_0xb26ade===0x1f4){_0x131a4e[_0xfbec('0x2a')](_0xb26ade)[_0xfbec('0x37')](_0x126df9);}else{_0x131a4e[_0xfbec('0x2a')](_0xb26ade)[_0xfbec('0x2c')](_0x126df9);}}});};exports[_0xfbec('0x79')]=function(_0x43d0b1,_0x4b8fbf,_0x6d5935){var _0xa83034={};var _0x5ee401={};var _0x5ae370;var _0x2760dd;return db[_0xfbec('0x4c')][_0xfbec('0x69')]({'where':{'id':_0x43d0b1['params']['id']}})[_0xfbec('0x33')](handleEntityNotFound(_0x4b8fbf,null))[_0xfbec('0x33')](function(_0x11d7de){if(_0x11d7de){_0x5ae370=_0x11d7de;_0x5ee401[_0xfbec('0x3e')]=_[_0xfbec('0x41')](db['WhatsappApplication'][_0xfbec('0x3b')]);_0x5ee401['query']=_[_0xfbec('0x41')](_0x43d0b1[_0xfbec('0x40')]);_0x5ee401[_0xfbec('0x42')]=_[_0xfbec('0x43')](_0x5ee401[_0xfbec('0x3e')],_0x5ee401[_0xfbec('0x40')]);_0xa83034['attributes']=_[_0xfbec('0x43')](_0x5ee401[_0xfbec('0x3e')],qs['fields'](_0x43d0b1[_0xfbec('0x40')][_0xfbec('0x44')]));_0xa83034[_0xfbec('0x45')]=_0xa83034[_0xfbec('0x45')][_0xfbec('0x52')]?_0xa83034['attributes']:_0x5ee401[_0xfbec('0x3e')];_0xa83034[_0xfbec('0x47')]=qs[_0xfbec('0x48')](_0x43d0b1[_0xfbec('0x40')][_0xfbec('0x48')]);_0xa83034[_0xfbec('0x49')]=qs['filters'](_['pick'](_0x43d0b1['query'],_0x5ee401[_0xfbec('0x42')]));if(_0x43d0b1[_0xfbec('0x40')][_0xfbec('0x4a')]){_0xa83034[_0xfbec('0x49')]=_[_0xfbec('0x4b')](_0xa83034[_0xfbec('0x49')],{'$or':_[_0xfbec('0x3f')](_0xa83034[_0xfbec('0x45')],function(_0x4c80c6){var _0x2f9a8b={};_0x2f9a8b[_0x4c80c6]={'$like':'%'+_0x43d0b1[_0xfbec('0x40')][_0xfbec('0x4a')]+'%'};return _0x2f9a8b;})});}_0xa83034=_[_0xfbec('0x4b')]({},_0xa83034,_0x43d0b1[_0xfbec('0x53')]);return _0x5ae370['getApplications'](_0xa83034);}})[_0xfbec('0x33')](function(_0x316bea){if(_0x316bea){_0x2760dd=_0x316bea[_0xfbec('0x52')];if(!_0x43d0b1[_0xfbec('0x40')][_0xfbec('0x46')](_0xfbec('0x64'))){_0xa83034[_0xfbec('0x2f')]=qs['limit'](_0x43d0b1['query'][_0xfbec('0x2f')]);_0xa83034[_0xfbec('0x2d')]=qs['offset'](_0x43d0b1['query'][_0xfbec('0x2d')]);}return _0x5ae370[_0xfbec('0x79')](_0xa83034);}})[_0xfbec('0x33')](function(_0x394dab){if(_0x394dab){return _0x394dab?{'count':_0x2760dd,'rows':_0x394dab}:null;}})[_0xfbec('0x33')](respondWithResult(_0x4b8fbf,null))['catch'](handleError(_0x4b8fbf,null));};exports['notify']=function(_0x11defa,_0x54b486,_0x38bb9d){var _0x19f5a6={'channel':'whatsapp'};var _0x180c39=[];var _0x2030f8=[];var _0x2931fc={};return db[_0xfbec('0x4c')][_0xfbec('0x54')]({'where':{'id':_0x11defa[_0xfbec('0x51')]['id']},'include':[{'model':db[_0xfbec('0x76')],'as':_0xfbec('0x7a')}]})[_0xfbec('0x33')](handleEntityNotFound(_0x54b486,null))[_0xfbec('0x33')](function(_0x202507){_0x19f5a6[_0xfbec('0x7b')]=_0x202507;if(_0x19f5a6[_0xfbec('0x7b')]&&_0x19f5a6[_0xfbec('0x7b')]['type']===_0xfbec('0x7c')&&_0x11defa[_0xfbec('0x56')][_0xfbec('0x7d')]){if(_0x11defa[_0xfbec('0x56')][_0xfbec('0x7d')]['length']===0x0)return;if(_0x11defa[_0xfbec('0x56')][_0xfbec('0x7d')][0x0][_0xfbec('0x7e')]!=='read')return;return db[_0xfbec('0x7f')]['update']({'read':!![],'readAt':_0x11defa[_0xfbec('0x56')]['statuses'][0x0][_0xfbec('0x80')]},{'where':{'messageId':_0x11defa[_0xfbec('0x56')][_0xfbec('0x7d')][0x0][_0xfbec('0x81')]},'individualHooks':!![]})[_0xfbec('0x33')](function(_0x241147){return _0x54b486[_0xfbec('0x2a')](0xc8)['json'](_0x241147);});}_0x19f5a6[_0xfbec('0x82')]=_[_0xfbec('0x83')](_0x202507[_0xfbec('0x7a')],['priority'],[_0xfbec('0x84')]);if(_0x19f5a6['account'][_0xfbec('0x7a')]){delete _0x19f5a6[_0xfbec('0x7b')][_0xfbec('0x7a')];}return db[_0xfbec('0x85')]['describe']()[_0xfbec('0x33')](function(_0x3e8280){if(!_0x3e8280){throw new db[(_0xfbec('0x86'))]['ValidationError']('no\x20available\x20attributes');}_0x180c39=_[_0xfbec('0x87')](_[_0xfbec('0x41')](_0x3e8280),['createdAt','updatedAt']);_0x2030f8=_[_0xfbec('0x87')](_['keys'](_0x3e8280),['createdAt',_0xfbec('0x88'),_0xfbec('0x89'),_0xfbec('0x8a')]);_0x19f5a6[_0xfbec('0x56')]={'mapKey':_0xfbec('0x8b')};if(_0x19f5a6[_0xfbec('0x7b')]&&_0x19f5a6[_0xfbec('0x7b')][_0xfbec('0x3d')]===_0xfbec('0x8c')){_0x19f5a6[_0xfbec('0x56')][_0xfbec('0x8d')]=_0x11defa[_0xfbec('0x56')][_0xfbec('0x8e')]['replace'](_0xfbec('0x8f'),'');_0x19f5a6[_0xfbec('0x56')]['body']=_0x11defa[_0xfbec('0x56')]['Body'];_0x19f5a6[_0xfbec('0x56')][_0xfbec('0x90')]=_0x11defa[_0xfbec('0x56')]['MessageSid'];}if(_0x19f5a6[_0xfbec('0x7b')]&&_0x19f5a6[_0xfbec('0x7b')][_0xfbec('0x3d')]===_0xfbec('0x7c')){_0x19f5a6[_0xfbec('0x56')][_0xfbec('0x8d')]=_0x11defa[_0xfbec('0x56')][_0xfbec('0x91')][0x0][_0xfbec('0x8d')];_0x19f5a6['body'][_0xfbec('0x56')]=_0x11defa[_0xfbec('0x56')]['notifications'][0x0][_0xfbec('0x27')]['body'];_0x19f5a6[_0xfbec('0x56')][_0xfbec('0x90')]=_0x11defa['body'][_0xfbec('0x91')][0x0][_0xfbec('0x81')];}if(_0x19f5a6['body']['id']){delete _0x19f5a6[_0xfbec('0x56')]['id'];}if(_[_0xfbec('0x92')](_0x19f5a6['body'][_0xfbec('0x8d')])){throw new db['Sequelize'][(_0xfbec('0x93'))]('from\x20is\x20mandatory');}if(_[_0xfbec('0x92')](_0x19f5a6['body'][_0xfbec('0x56')])||_0x19f5a6[_0xfbec('0x56')][_0xfbec('0x56')]===''){throw new db[(_0xfbec('0x86'))][(_0xfbec('0x93'))](_0xfbec('0x94'));}if(_[_0xfbec('0x92')](_0x19f5a6[_0xfbec('0x56')][_0xfbec('0x95')])){throw new db[(_0xfbec('0x86'))][(_0xfbec('0x93'))](_0xfbec('0x96')+_0x2030f8);}if(!_[_0xfbec('0x97')](_0x2030f8,_0x19f5a6[_0xfbec('0x56')][_0xfbec('0x95')])){throw new db[(_0xfbec('0x86'))][(_0xfbec('0x93'))](_0xfbec('0x98')+_0x2030f8);}_0x2931fc[_0x19f5a6[_0xfbec('0x56')][_0xfbec('0x95')]]=_0x19f5a6['body']['from'];return db[_0xfbec('0x99')][_0xfbec('0x54')]({'where':{'id':_0x19f5a6[_0xfbec('0x7b')][_0xfbec('0x8a')]},'include':[{'model':db[_0xfbec('0x85')],'as':_0xfbec('0x9a'),'where':_0x2931fc,'limit':0x1,'order':[[_0xfbec('0x88'),_0xfbec('0x9b')]]}]});})[_0xfbec('0x33')](handleEntityNotFound(_0x54b486,null))['then'](function(_0x8c0eb7){if(_0x8c0eb7){_0x19f5a6[_0xfbec('0x9c')]=_['omit'](_0x8c0eb7,[_0xfbec('0x9a')]);if(_0x8c0eb7[_0xfbec('0x9a')][_0xfbec('0x52')]){return _0x8c0eb7['Contacts'][0x0];}var _0xae2774=_[_0xfbec('0x19')](_0x19f5a6[_0xfbec('0x56')],{'firstName':_0x19f5a6['body']['from'],'ListId':_0x8c0eb7['id']});_0xae2774[_0x19f5a6[_0xfbec('0x56')]['mapKey']]=_0x19f5a6[_0xfbec('0x56')][_0xfbec('0x8d')];return db[_0xfbec('0x85')][_0xfbec('0x55')](_0xae2774,{'fields':_0x180c39,'raw':!![]});}})['then'](handleEntityNotFound(_0x54b486,null))[_0xfbec('0x33')](function(_0x4e7e6e){if(_0x4e7e6e){_0x19f5a6[_0xfbec('0x9d')]=_0x4e7e6e;var _0x39931d={'ContactId':_0x4e7e6e['id'],'phone':_0x19f5a6[_0xfbec('0x56')][_0xfbec('0x8d')],'WhatsappAccountId':_0x11defa[_0xfbec('0x51')]['id']};var _0xb4a96b={'ContactId':_0x4e7e6e['id'],'WhatsappAccountId':_0x11defa['params']['id'],'closed':![]};return db[_0xfbec('0x9e')]['find']({'where':_0xb4a96b})[_0xfbec('0x33')](function(_0x417114){if(_0x417114){return[_0x417114,![]];}return db[_0xfbec('0x9e')][_0xfbec('0x55')](_0x39931d)[_0xfbec('0x33')](function(_0x3a8309){return[_0x3a8309,!![]];});});}})['spread'](function(_0x7043c0,_0xb090ed){_0x19f5a6[_0xfbec('0x9f')]=_0x7043c0[_0xfbec('0x34')]({'plain':!![]});_0x19f5a6[_0xfbec('0x9f')][_0xfbec('0xa0')]=![];if(_0xb090ed){if(_0x19f5a6[_0xfbec('0x7b')][_0xfbec('0xa1')]){_0x19f5a6[_0xfbec('0x82')][_0xfbec('0xa2')]({'id':0x0,'priority':_0x19f5a6[_0xfbec('0x82')][_0xfbec('0x52')]+0x1,'app':_0xfbec('0xa3'),'appdata':_0xfbec('0xa4'),'interval':'*,*,*,*'});}_0x19f5a6['interaction'][_0xfbec('0xa0')]=!![];}return db[_0xfbec('0x7f')][_0xfbec('0x55')]({'phone':_0x19f5a6[_0xfbec('0x56')][_0xfbec('0x8d')],'messageId':_0x19f5a6[_0xfbec('0x56')][_0xfbec('0x90')],'body':_0x19f5a6['body'][_0xfbec('0x56')],'WhatsappAccountId':_0x11defa[_0xfbec('0x51')]['id'],'WhatsappInteractionId':_0x7043c0['id'],'direction':'in','ContactId':_0x7043c0[_0xfbec('0xa5')],'AttachmentId':_0x19f5a6[_0xfbec('0x56')]['AttachmentId']});})[_0xfbec('0x33')](function(_0x57b0c9){_0x19f5a6[_0xfbec('0x27')]=_0x57b0c9;if(!_0x19f5a6[_0xfbec('0x9f')][_0xfbec('0xa6')])return;return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x19f5a6[_0xfbec('0x9f')][_0xfbec('0xa6')]}});})[_0xfbec('0x33')](function(_0x4c4334){if(_0x4c4334){_0x19f5a6['applications'][_0xfbec('0xa7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4c4334[_0xfbec('0x36')]+','+(_0x19f5a6[_0xfbec('0x7b')][_0xfbec('0xa8')]||0xa),'interval':'*,*,*,*'});}if(!_0x19f5a6[_0xfbec('0x9f')][_0xfbec('0xa9')])return;return db[_0xfbec('0xaa')][_0xfbec('0x54')]({'attributes':['id',_0xfbec('0x36')],'where':{'id':_0x19f5a6[_0xfbec('0x9f')][_0xfbec('0xa9')]}});})[_0xfbec('0x33')](function(_0x267296){if(_0x267296){_0x19f5a6[_0xfbec('0x82')][_0xfbec('0xa7')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x267296[_0xfbec('0x36')]+','+(_0x19f5a6[_0xfbec('0x7b')][_0xfbec('0xab')]||0x12c),'interval':_0xfbec('0xac')});}return respondWithRpcPromise(_0xfbec('0xad'),_0xfbec('0xae'),_0x19f5a6);})[_0xfbec('0x33')](function(_0xaa6a20){if(_0xaa6a20){var _0x22ddef=0xc8;var _0x1d42d8='receiveMessage';logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1d42d8,_0x22ddef,_0xfbec('0xaf'));logger[_0xfbec('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1d42d8,_0x22ddef,_0xfbec('0xaf'),JSON[_0xfbec('0xb0')](_0xaa6a20));if(_0x19f5a6['account'][_0xfbec('0x3d')]===_0xfbec('0x8c')){return _0x54b486[_0xfbec('0x2a')](_0x22ddef)['set'](_0xfbec('0xb1'),_0xfbec('0xb2'))['send'](_0xfbec('0xb3'));}else{return _0x54b486[_0xfbec('0x2a')](_0x22ddef)[_0xfbec('0x2c')](_0xaa6a20);}}});})[_0xfbec('0x29')](handleError(_0x54b486,null));};exports[_0xfbec('0x37')]=function(_0x834c77,_0x22711,_0x5e0c0f){var _0x12c142,_0xc86f57,_0x1deb4f;if(_[_0xfbec('0x92')](_0x834c77[_0xfbec('0x56')][_0xfbec('0x56')])||_0x834c77[_0xfbec('0x56')]['body']===''){throw new db[(_0xfbec('0x86'))][(_0xfbec('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x834c77['body']['to'])){throw new db[(_0xfbec('0x86'))][(_0xfbec('0x93'))](_0xfbec('0xb4'));}_0x12c142=_0x834c77[_0xfbec('0x56')]['to'];return db['WhatsappAccount'][_0xfbec('0x54')]({'where':{'id':_0x834c77[_0xfbec('0x51')]['id']},'include':[{'model':db[_0xfbec('0x99')],'as':_0xfbec('0xb5'),'include':[{'model':db[_0xfbec('0x85')],'as':_0xfbec('0x9a'),'where':{'mobile':_0x12c142},'limit':0x1,'order':[[_0xfbec('0x88'),_0xfbec('0x9b')]]}]}]})[_0xfbec('0x33')](handleEntityNotFound(_0x22711,null))[_0xfbec('0x33')](function(_0x1d38a8){if(_0x1d38a8&&_0x1d38a8[_0xfbec('0xb5')]){_0xc86f57=_0x1d38a8[_0xfbec('0x34')]({'plain':!![]});if(_0xc86f57[_0xfbec('0xb5')]&&_0xc86f57[_0xfbec('0xb5')][_0xfbec('0x9a')][_0xfbec('0x52')]){return _0xc86f57[_0xfbec('0xb5')][_0xfbec('0x9a')][0x0];}return db[_0xfbec('0x85')][_0xfbec('0x55')](_['defaults'](_0x834c77['body'],{'firstName':_0x12c142,'mobile':_0x12c142,'phone':_0x12c142,'ListId':_0xc86f57[_0xfbec('0x8a')]}));}})[_0xfbec('0x33')](handleEntityNotFound(_0x22711,null))[_0xfbec('0x33')](function(_0x3cd9a2){if(_0x3cd9a2){_0x1deb4f=_0x3cd9a2;return db[_0xfbec('0x9e')][_0xfbec('0x54')]({'where':{'ContactId':_0x1deb4f['id'],'closed':![],'WhatsappAccountId':_0xc86f57['id']}})[_0xfbec('0x33')](function(_0x4208bd){if(_0x4208bd){return[_0x4208bd,![]];}return db[_0xfbec('0x9e')]['create']({'UserId':_0x834c77['user']['id'],'ContactId':_0x1deb4f['id'],'WhatsappAccountId':_0xc86f57['id'],'phone':_0x12c142,'firstMsgDirection':_0xfbec('0xb6'),'Messages':[_[_0xfbec('0x4b')](_0x834c77[_0xfbec('0x56')],{'read':![],'body':_0x834c77['body']['body'],'phone':_0x12c142,'WhatsappAccountId':_0xc86f57['id'],'UserId':_0x834c77[_0xfbec('0x57')]['id'],'ContactId':_0x1deb4f['id']})]},{'include':[{'model':db[_0xfbec('0x7f')],'as':'Messages'}]})['then'](function(_0x271bfc){return[_0x271bfc,!![]];});});}})[_0xfbec('0xb7')](function(_0x9efdb4,_0x10fc33){if(_0x10fc33){return _0x9efdb4;}return db[_0xfbec('0x7f')][_0xfbec('0x55')](_[_0xfbec('0x4b')](_0x834c77[_0xfbec('0x56')],{'read':![],'body':_0x834c77[_0xfbec('0x56')]['body'],'phone':_0x12c142,'WhatsappAccountId':_0xc86f57['id'],'WhatsappInteractionId':_0x9efdb4['id'],'UserId':_0x834c77[_0xfbec('0x57')]['id'],'ContactId':_0x1deb4f['id']}))['then'](function(_0x1c5acc){_0x9efdb4['dataValues'][_0xfbec('0xb8')]=[];_0x9efdb4[_0xfbec('0xb9')][_0xfbec('0xb8')]['push'](_0x1c5acc[_0xfbec('0xb9')]);return _0x9efdb4;});})[_0xfbec('0x33')](respondWithResult(_0x22711,null))['catch'](handleError(_0x22711,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index b58dbaf..cc7d01d 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 _0x136f=['WhatsappAccount','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x386b1b,_0x10b035){var _0x5d0645=function(_0x2523bd){while(--_0x2523bd){_0x386b1b['push'](_0x386b1b['shift']());}};_0x5d0645(++_0x10b035);}(_0x136f,0x6f));var _0xf136=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x136f[_0x172747];return _0x509692;};'use strict';var EventEmitter=require(_0xf136('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xf136('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf136('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf136('0x3'),'afterDestroy':'remove'};function emitEvent(_0x37baea){return function(_0x54765d,_0x503935,_0x54ccfb){WhatsappAccountEvents['emit'](_0x37baea+':'+_0x54765d['id'],_0x54765d);WhatsappAccountEvents[_0xf136('0x4')](_0x37baea,_0x54765d);_0x54ccfb(null);};}for(var e in events){if(events[_0xf136('0x5')](e)){var event=events[e];WhatsappAccount[_0xf136('0x6')](e,emitEvent(event));}}module[_0xf136('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0x0882=['emit','hook','events','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x3f4bc1,_0x15ace5){var _0x46fcf6=function(_0x3a19c1){while(--_0x3a19c1){_0x3f4bc1['push'](_0x3f4bc1['shift']());}};_0x46fcf6(++_0x15ace5);}(_0x0882,0x1ad));var _0x2088=function(_0x45afc1,_0x52a029){_0x45afc1=_0x45afc1-0x0;var _0x182539=_0x0882[_0x45afc1];return _0x182539;};'use strict';var EventEmitter=require(_0x2088('0x0'));var WhatsappAccount=require(_0x2088('0x1'))['db'][_0x2088('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x2088('0x3')](0x0);var events={'afterCreate':_0x2088('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1d7bf8){return function(_0x7543a7,_0xdd12dc,_0x842cf0){WhatsappAccountEvents[_0x2088('0x5')](_0x1d7bf8+':'+_0x7543a7['id'],_0x7543a7);WhatsappAccountEvents[_0x2088('0x5')](_0x1d7bf8,_0x7543a7);_0x842cf0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x2088('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 3a780af..e35d2f7 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 _0x1bb0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','lodash','util','../../config/logger','api'];(function(_0x3e21f4,_0x43d310){var _0x40fc49=function(_0x54a8f6){while(--_0x54a8f6){_0x3e21f4['push'](_0x3e21f4['shift']());}};_0x40fc49(++_0x43d310);}(_0x1bb0,0x1d0));var _0x01bb=function(_0x11a104,_0x5d6ef1){_0x11a104=_0x11a104-0x0;var _0xea9b65=_0x1bb0[_0x11a104];return _0xea9b65;};'use strict';var _=require(_0x01bb('0x0'));var util=require(_0x01bb('0x1'));var logger=require(_0x01bb('0x2'))(_0x01bb('0x3'));var moment=require(_0x01bb('0x4'));var BPromise=require(_0x01bb('0x5'));var rp=require(_0x01bb('0x6'));var fs=require('fs');var path=require(_0x01bb('0x7'));var rimraf=require(_0x01bb('0x8'));var config=require(_0x01bb('0x9'));var attributes=require(_0x01bb('0xa'));module[_0x01bb('0xb')]=function(_0x1a1994,_0x2787eb){return _0x1a1994['define']('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61b7=['moment','bluebird','rimraf','../../config/environment','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger'];(function(_0x2a4e87,_0x132598){var _0x20acdc=function(_0x1e8132){while(--_0x1e8132){_0x2a4e87['push'](_0x2a4e87['shift']());}};_0x20acdc(++_0x132598);}(_0x61b7,0x166));var _0x761b=function(_0x1fd100,_0x5afdff){_0x1fd100=_0x1fd100-0x0;var _0x37b232=_0x61b7[_0x1fd100];return _0x37b232;};'use strict';var _=require(_0x761b('0x0'));var util=require('util');var logger=require(_0x761b('0x1'))('api');var moment=require(_0x761b('0x2'));var BPromise=require(_0x761b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x761b('0x4'));var config=require(_0x761b('0x5'));var attributes=require(_0x761b('0x6'));module['exports']=function(_0x26b809,_0x9f0ae6){return _0x26b809[_0x761b('0x7')](_0x761b('0x8'),attributes,{'tableName':_0x761b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index cb4b316..3f5b2be 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 _0xf4ad=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','include','map','model','attributes','then','stringify','util','moment','bluebird'];(function(_0x35dea7,_0x1f7e22){var _0x3ddd9f=function(_0x1cdffd){while(--_0x1cdffd){_0x35dea7['push'](_0x35dea7['shift']());}};_0x3ddd9f(++_0x1f7e22);}(_0xf4ad,0x6f));var _0xdf4a=function(_0x54f695,_0x17e578){_0x54f695=_0x54f695-0x0;var _0x5d8f73=_0xf4ad[_0x54f695];return _0x5d8f73;};'use strict';var _=require('lodash');var util=require(_0xdf4a('0x0'));var moment=require(_0xdf4a('0x1'));var BPromise=require(_0xdf4a('0x2'));var rs=require(_0xdf4a('0x3'));var fs=require('fs');var Redis=require(_0xdf4a('0x4'));var db=require(_0xdf4a('0x5'))['db'];var utils=require(_0xdf4a('0x6'));var logger=require('../../config/logger')(_0xdf4a('0x7'));var config=require('../../config/environment');var jayson=require(_0xdf4a('0x8'));var client=jayson[_0xdf4a('0x9')][_0xdf4a('0xa')]({'port':0x232a});config[_0xdf4a('0xb')]=_[_0xdf4a('0xc')](config[_0xdf4a('0xb')],{'host':_0xdf4a('0xd'),'port':0x18eb});var socket=require(_0xdf4a('0xe'))(new Redis(config['redis']));require(_0xdf4a('0xf'))['register'](socket);function respondWithRpcPromise(_0x1bd0ac,_0x5cdacc,_0xe3563b){return new BPromise(function(_0x26e319,_0x2ac901){return client[_0xdf4a('0x10')](_0x1bd0ac,_0xe3563b)['then'](function(_0x395e86){logger[_0xdf4a('0x11')](_0xdf4a('0x12'),_0x5cdacc,_0xdf4a('0x13'));logger[_0xdf4a('0x14')](_0xdf4a('0x15'),_0x5cdacc,_0xdf4a('0x13'),JSON['stringify'](_0x395e86));if(_0x395e86[_0xdf4a('0x16')]){if(_0x395e86[_0xdf4a('0x16')][_0xdf4a('0x17')]===0x1f4){logger[_0xdf4a('0x16')](_0xdf4a('0x12'),_0x5cdacc,_0x395e86[_0xdf4a('0x16')][_0xdf4a('0x18')]);return _0x2ac901(_0x395e86['error'][_0xdf4a('0x18')]);}logger[_0xdf4a('0x16')](_0xdf4a('0x12'),_0x5cdacc,_0x395e86[_0xdf4a('0x16')][_0xdf4a('0x18')]);return _0x26e319(_0x395e86['error'][_0xdf4a('0x18')]);}else{logger['info'](_0xdf4a('0x12'),_0x5cdacc,_0xdf4a('0x13'));_0x26e319(_0x395e86[_0xdf4a('0x19')][_0xdf4a('0x18')]);}})[_0xdf4a('0x1a')](function(_0x19b9df){logger[_0xdf4a('0x16')](_0xdf4a('0x12'),_0x5cdacc,_0x19b9df);_0x2ac901(_0x19b9df);});});}exports[_0xdf4a('0x1b')]=function(_0x3b2eea){var _0x5c9fe7=this;return new Promise(function(_0x3e39aa,_0x35f22a){return db[_0xdf4a('0x1c')]['find']({'raw':_0x3b2eea['options']?_0x3b2eea[_0xdf4a('0x1d')][_0xdf4a('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b2eea[_0xdf4a('0x1d')]?_0x3b2eea[_0xdf4a('0x1d')][_0xdf4a('0x1f')]||null:null,'attributes':_0x3b2eea[_0xdf4a('0x1d')]?_0x3b2eea['options']['attributes']||null:null,'include':_0x3b2eea[_0xdf4a('0x1d')]?_0x3b2eea[_0xdf4a('0x1d')][_0xdf4a('0x20')]?_[_0xdf4a('0x21')](_0x3b2eea[_0xdf4a('0x1d')][_0xdf4a('0x20')],function(_0x13b4c1){return{'model':db[_0x13b4c1[_0xdf4a('0x22')]],'as':_0x13b4c1['as'],'attributes':_0x13b4c1[_0xdf4a('0x23')],'include':_0x13b4c1[_0xdf4a('0x20')]?_[_0xdf4a('0x21')](_0x13b4c1[_0xdf4a('0x20')],function(_0x10f55c){return{'model':db[_0x10f55c[_0xdf4a('0x22')]],'as':_0x10f55c['as'],'attributes':_0x10f55c[_0xdf4a('0x23')],'include':_0x10f55c[_0xdf4a('0x20')]?_[_0xdf4a('0x21')](_0x10f55c[_0xdf4a('0x20')],function(_0x280c91){return{'model':db[_0x280c91['model']],'as':_0x280c91['as'],'attributes':_0x280c91[_0xdf4a('0x23')]};}):[]};}):[]};}):[]:[]})[_0xdf4a('0x24')](function(_0x1b3d16){logger[_0xdf4a('0x11')](_0xdf4a('0x1b'),_0x3b2eea);logger[_0xdf4a('0x14')]('ShowWhatsappAccount',_0x3b2eea,JSON[_0xdf4a('0x25')](_0x1b3d16));_0x3e39aa(_0x1b3d16);})[_0xdf4a('0x1a')](function(_0x49982f){logger[_0xdf4a('0x16')](_0xdf4a('0x1b'),_0x49982f['message'],_0x3b2eea);_0x35f22a(_0x5c9fe7[_0xdf4a('0x16')](0x1f4,_0x49982f['message']));});});}; \ No newline at end of file +var _0x2eb0=['attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0x2eb0,0x155));var _0x02eb=function(_0x5c5f14,_0x1c7f28){_0x5c5f14=_0x5c5f14-0x0;var _0x5e7378=_0x2eb0[_0x5c5f14];return _0x5e7378;};'use strict';var _=require(_0x02eb('0x0'));var util=require(_0x02eb('0x1'));var moment=require(_0x02eb('0x2'));var BPromise=require(_0x02eb('0x3'));var rs=require(_0x02eb('0x4'));var fs=require('fs');var Redis=require(_0x02eb('0x5'));var db=require(_0x02eb('0x6'))['db'];var utils=require(_0x02eb('0x7'));var logger=require(_0x02eb('0x8'))('rpc');var config=require(_0x02eb('0x9'));var jayson=require(_0x02eb('0xa'));var client=jayson[_0x02eb('0xb')][_0x02eb('0xc')]({'port':0x232a});config['redis']=_[_0x02eb('0xd')](config[_0x02eb('0xe')],{'host':_0x02eb('0xf'),'port':0x18eb});var socket=require(_0x02eb('0x10'))(new Redis(config[_0x02eb('0xe')]));require(_0x02eb('0x11'))[_0x02eb('0x12')](socket);function respondWithRpcPromise(_0x164568,_0x12e2ff,_0x2f6c31){return new BPromise(function(_0xc91846,_0x4e8fbe){return client[_0x02eb('0x13')](_0x164568,_0x2f6c31)[_0x02eb('0x14')](function(_0x594cdb){logger[_0x02eb('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x12e2ff,_0x02eb('0x16'));logger[_0x02eb('0x17')](_0x02eb('0x18'),_0x12e2ff,'request\x20sent',JSON[_0x02eb('0x19')](_0x594cdb));if(_0x594cdb['error']){if(_0x594cdb[_0x02eb('0x1a')][_0x02eb('0x1b')]===0x1f4){logger[_0x02eb('0x1a')](_0x02eb('0x1c'),_0x12e2ff,_0x594cdb[_0x02eb('0x1a')][_0x02eb('0x1d')]);return _0x4e8fbe(_0x594cdb[_0x02eb('0x1a')][_0x02eb('0x1d')]);}logger[_0x02eb('0x1a')](_0x02eb('0x1c'),_0x12e2ff,_0x594cdb[_0x02eb('0x1a')][_0x02eb('0x1d')]);return _0xc91846(_0x594cdb[_0x02eb('0x1a')]['message']);}else{logger[_0x02eb('0x15')](_0x02eb('0x1c'),_0x12e2ff,_0x02eb('0x16'));_0xc91846(_0x594cdb[_0x02eb('0x1e')][_0x02eb('0x1d')]);}})['catch'](function(_0x3ab2c9){logger[_0x02eb('0x1a')]('WhatsappAccount,\x20%s,\x20%s',_0x12e2ff,_0x3ab2c9);_0x4e8fbe(_0x3ab2c9);});});}exports[_0x02eb('0x1f')]=function(_0x5d40b5){var _0x484816=this;return new Promise(function(_0x2527ad,_0x537c84){return db[_0x02eb('0x20')][_0x02eb('0x21')]({'raw':_0x5d40b5[_0x02eb('0x22')]?_0x5d40b5[_0x02eb('0x22')][_0x02eb('0x23')]===undefined?!![]:![]:!![],'where':_0x5d40b5[_0x02eb('0x22')]?_0x5d40b5[_0x02eb('0x22')][_0x02eb('0x24')]||null:null,'attributes':_0x5d40b5[_0x02eb('0x22')]?_0x5d40b5[_0x02eb('0x22')][_0x02eb('0x25')]||null:null,'include':_0x5d40b5[_0x02eb('0x22')]?_0x5d40b5[_0x02eb('0x22')][_0x02eb('0x26')]?_[_0x02eb('0x27')](_0x5d40b5[_0x02eb('0x22')]['include'],function(_0x2c3bfb){return{'model':db[_0x2c3bfb[_0x02eb('0x28')]],'as':_0x2c3bfb['as'],'attributes':_0x2c3bfb[_0x02eb('0x25')],'include':_0x2c3bfb[_0x02eb('0x26')]?_['map'](_0x2c3bfb[_0x02eb('0x26')],function(_0x2a8ed1){return{'model':db[_0x2a8ed1['model']],'as':_0x2a8ed1['as'],'attributes':_0x2a8ed1['attributes'],'include':_0x2a8ed1['include']?_[_0x02eb('0x27')](_0x2a8ed1[_0x02eb('0x26')],function(_0x1a6ec0){return{'model':db[_0x1a6ec0['model']],'as':_0x1a6ec0['as'],'attributes':_0x1a6ec0[_0x02eb('0x25')]};}):[]};}):[]};}):[]:[]})[_0x02eb('0x14')](function(_0x5a24a9){logger[_0x02eb('0x15')](_0x02eb('0x1f'),_0x5d40b5);logger['debug'](_0x02eb('0x1f'),_0x5d40b5,JSON[_0x02eb('0x19')](_0x5a24a9));_0x2527ad(_0x5a24a9);})[_0x02eb('0x29')](function(_0x556c89){logger[_0x02eb('0x1a')](_0x02eb('0x1f'),_0x556c89['message'],_0x5d40b5);_0x537c84(_0x484816[_0x02eb('0x1a')](0x1f4,_0x556c89[_0x02eb('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 37f6e9c..634f25a 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 _0x0942=['removeListener','register','length','whatsappAccount:','save','remove','update'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x0942,0x107));var _0x2094=function(_0x59aa2d,_0xa831e1){_0x59aa2d=_0x59aa2d-0x0;var _0x589dc3=_0x0942[_0x59aa2d];return _0x589dc3;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x2094('0x0'),_0x2094('0x1'),_0x2094('0x2')];function createListener(_0x27e85e,_0xf9071f){return function(_0x20df17){_0xf9071f['emit'](_0x27e85e,_0x20df17);};}function removeListener(_0x4ba007,_0x308944){return function(){WhatsappAccountEvents[_0x2094('0x3')](_0x4ba007,_0x308944);};}exports[_0x2094('0x4')]=function(_0x11cdaa){for(var _0x4cc971=0x0,_0x5eb647=events[_0x2094('0x5')];_0x4cc971<_0x5eb647;_0x4cc971++){var _0x1b1f84=events[_0x4cc971];var _0x4d5a5d=createListener(_0x2094('0x6')+_0x1b1f84,_0x11cdaa);WhatsappAccountEvents['on'](_0x1b1f84,_0x4d5a5d);}}; \ No newline at end of file +var _0x1fb6=['update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x1fb6,0x9e));var _0x61fb=function(_0x5d75c2,_0xb96912){_0x5d75c2=_0x5d75c2-0x0;var _0x43f973=_0x1fb6[_0x5d75c2];return _0x43f973;};'use strict';var WhatsappAccountEvents=require(_0x61fb('0x0'));var events=[_0x61fb('0x1'),'remove',_0x61fb('0x2')];function createListener(_0xecc447,_0x15d0ec){return function(_0x182728){_0x15d0ec[_0x61fb('0x3')](_0xecc447,_0x182728);};}function removeListener(_0x30c1e0,_0x13a12b){return function(){WhatsappAccountEvents[_0x61fb('0x4')](_0x30c1e0,_0x13a12b);};}exports[_0x61fb('0x5')]=function(_0x4300e3){for(var _0x490532=0x0,_0xf75b81=events[_0x61fb('0x6')];_0x490532<_0xf75b81;_0x490532++){var _0x194bed=events[_0x490532];var _0x326a2a=createListener(_0x61fb('0x7')+_0x194bed,_0x4300e3);WhatsappAccountEvents['on'](_0x194bed,_0x326a2a);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 50ba70d..df20b79 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 _0xa335=['/:id','post','put','update','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index'];(function(_0x58a833,_0x16c3cb){var _0x14f27b=function(_0x217e0f){while(--_0x217e0f){_0x58a833['push'](_0x58a833['shift']());}};_0x14f27b(++_0x16c3cb);}(_0xa335,0xe3));var _0x5a33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa335[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5a33('0x0'));var express=require(_0x5a33('0x1'));var router=express[_0x5a33('0x2')]();var fs_extra=require(_0x5a33('0x3'));var auth=require(_0x5a33('0x4'));var interaction=require(_0x5a33('0x5'));var config=require(_0x5a33('0x6'));var controller=require(_0x5a33('0x7'));router[_0x5a33('0x8')]('/',auth[_0x5a33('0x9')](),controller[_0x5a33('0xa')]);router[_0x5a33('0x8')](_0x5a33('0xb'),auth[_0x5a33('0x9')](),controller['show']);router[_0x5a33('0xc')]('/',auth[_0x5a33('0x9')](),controller['create']);router[_0x5a33('0xd')]('/:id',auth[_0x5a33('0x9')](),controller[_0x5a33('0xe')]);router['delete'](_0x5a33('0xb'),auth[_0x5a33('0x9')](),controller[_0x5a33('0xf')]);module[_0x5a33('0x10')]=router; \ No newline at end of file +var _0x29de=['index','show','post','create','put','/:id','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x2641a5,_0x43b2a3){var _0x3d2409=function(_0x6ff937){while(--_0x6ff937){_0x2641a5['push'](_0x2641a5['shift']());}};_0x3d2409(++_0x43b2a3);}(_0x29de,0x1be));var _0xe29d=function(_0x263cbc,_0x77e13a){_0x263cbc=_0x263cbc-0x0;var _0x52da29=_0x29de[_0x263cbc];return _0x52da29;};'use strict';var multer=require(_0xe29d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe29d('0x1'));var express=require(_0xe29d('0x2'));var router=express[_0xe29d('0x3')]();var fs_extra=require(_0xe29d('0x4'));var auth=require(_0xe29d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe29d('0x6'));var controller=require(_0xe29d('0x7'));router[_0xe29d('0x8')]('/',auth[_0xe29d('0x9')](),controller[_0xe29d('0xa')]);router[_0xe29d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe29d('0xb')]);router[_0xe29d('0xc')]('/',auth[_0xe29d('0x9')](),controller[_0xe29d('0xd')]);router[_0xe29d('0xe')](_0xe29d('0xf'),auth['isAuthenticated'](),controller[_0xe29d('0x10')]);router[_0xe29d('0x11')](_0xe29d('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xe29d('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 8cac67e..0ca7064 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 _0x7fb5=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x5cd225,_0xa478f7){var _0x15f16a=function(_0x4a294f){while(--_0x4a294f){_0x5cd225['push'](_0x5cd225['shift']());}};_0x15f16a(++_0xa478f7);}(_0x7fb5,0x189));var _0x57fb=function(_0x36f72e,_0x1b492d){_0x36f72e=_0x36f72e-0x0;var _0x5b9b60=_0x7fb5[_0x36f72e];return _0x5b9b60;};'use strict';var Sequelize=require(_0x57fb('0x0'));module[_0x57fb('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x57fb('0x2')],'allowNull':![],'defaultValue':_0x57fb('0x3')},'appdata':{'type':Sequelize[_0x57fb('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x57fb('0x2')],'defaultValue':_0x57fb('0x5')}}; \ No newline at end of file +var _0x793f=['INTEGER','noop','STRING','*,*,*,*'];(function(_0x289fa0,_0x300ad1){var _0x53c48c=function(_0x11513c){while(--_0x11513c){_0x289fa0['push'](_0x289fa0['shift']());}};_0x53c48c(++_0x300ad1);}(_0x793f,0x1c4));var _0xf793=function(_0xcf7425,_0x2ec7b4){_0xcf7425=_0xcf7425-0x0;var _0xd76b28=_0x793f[_0xcf7425];return _0xd76b28;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xf793('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf793('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf793('0x2')],'defaultValue':_0xf793('0x3')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index bf1e295..d814e5e 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 _0x5942=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','destroy','then','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service'];(function(_0x270205,_0x4c6435){var _0x40ea04=function(_0x461a39){while(--_0x461a39){_0x270205['push'](_0x270205['shift']());}};_0x40ea04(++_0x4c6435);}(_0x5942,0x16a));var _0x2594=function(_0x2e8a4e,_0xd03324){_0x2e8a4e=_0x2e8a4e-0x0;var _0x43fb76=_0x5942[_0x2e8a4e];return _0x43fb76;};'use strict';var emlformat=require(_0x2594('0x0'));var rimraf=require(_0x2594('0x1'));var zipdir=require(_0x2594('0x2'));var jsonpatch=require(_0x2594('0x3'));var rp=require(_0x2594('0x4'));var moment=require(_0x2594('0x5'));var BPromise=require(_0x2594('0x6'));var Mustache=require(_0x2594('0x7'));var util=require(_0x2594('0x8'));var path=require(_0x2594('0x9'));var sox=require(_0x2594('0xa'));var csv=require(_0x2594('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2594('0xc'));var squel=require(_0x2594('0xd'));var crypto=require(_0x2594('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2594('0xf'));var toCsv=require(_0x2594('0xb'));var querystring=require('querystring');var Papa=require(_0x2594('0x10'));var Redis=require('ioredis');var authService=require(_0x2594('0x11'));var qs=require(_0x2594('0x12'));var as=require(_0x2594('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2594('0x14'))(_0x2594('0x15'));var utils=require(_0x2594('0x16'));var config=require(_0x2594('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2594('0x18'))['db'];function respondWithStatusCode(_0x1ba533,_0x371ff3){_0x371ff3=_0x371ff3||0xcc;return function(_0x3aa70e){if(_0x3aa70e){return _0x1ba533[_0x2594('0x19')](_0x371ff3);}return _0x1ba533[_0x2594('0x1a')](_0x371ff3)[_0x2594('0x1b')]();};}function respondWithResult(_0xa26e3a,_0x271894){_0x271894=_0x271894||0xc8;return function(_0x5da604){if(_0x5da604){return _0xa26e3a[_0x2594('0x1a')](_0x271894)[_0x2594('0x1c')](_0x5da604);}};}function respondWithFilteredResult(_0x587bad,_0x1cbb20){return function(_0x4cc124){if(_0x4cc124){var _0x192f3d=typeof _0x1cbb20[_0x2594('0x1d')]===_0x2594('0x1e')&&typeof _0x1cbb20[_0x2594('0x1f')]===_0x2594('0x1e');var _0x59a199=_0x4cc124[_0x2594('0x20')];var _0x457beb=_0x192f3d?0x0:_0x1cbb20[_0x2594('0x1d')];var _0x31f24a=_0x192f3d?_0x4cc124[_0x2594('0x20')]:_0x1cbb20[_0x2594('0x1d')]+_0x1cbb20[_0x2594('0x1f')];var _0x3f022d;if(_0x31f24a>=_0x59a199){_0x31f24a=_0x59a199;_0x3f022d=0xc8;}else{_0x3f022d=0xce;}_0x587bad[_0x2594('0x1a')](_0x3f022d);return _0x587bad['set']('Content-Range',_0x457beb+'-'+_0x31f24a+'/'+_0x59a199)[_0x2594('0x1c')](_0x4cc124);}return null;};}function patchUpdates(_0x40a1f2){return function(_0x266cb9){try{jsonpatch[_0x2594('0x21')](_0x266cb9,_0x40a1f2,!![]);}catch(_0x3b68eb){return BPromise[_0x2594('0x22')](_0x3b68eb);}return _0x266cb9['save']();};}function saveUpdates(_0x44766c,_0x3bbebd){return function(_0x121a8e){if(_0x121a8e){return _0x121a8e[_0x2594('0x23')](_0x44766c)['then'](function(_0x39fb25){return _0x39fb25;});}return null;};}function removeEntity(_0x5685fd,_0x281987){return function(_0x5eed6f){if(_0x5eed6f){return _0x5eed6f[_0x2594('0x24')]()[_0x2594('0x25')](function(){_0x5685fd['status'](0xcc)[_0x2594('0x1b')]();});}};}function handleEntityNotFound(_0x48a306,_0x2a01a9){return function(_0x12258e){if(!_0x12258e){_0x48a306[_0x2594('0x19')](0x194);}return _0x12258e;};}function handleError(_0x38feeb,_0x1b2820){_0x1b2820=_0x1b2820||0x1f4;return function(_0xf60655){logger[_0x2594('0x26')](_0xf60655[_0x2594('0x27')]);if(_0xf60655['name']){delete _0xf60655[_0x2594('0x28')];}_0x38feeb['status'](_0x1b2820)['send'](_0xf60655);};}exports[_0x2594('0x29')]=function(_0x21339d,_0x4dc1a5){var _0x36fdf4={},_0xa8ee54={},_0x590123={'count':0x0,'rows':[]};var _0x273e04=_[_0x2594('0x2a')](db[_0x2594('0x2b')][_0x2594('0x2c')],function(_0x587af2){return{'name':_0x587af2[_0x2594('0x2d')],'type':_0x587af2[_0x2594('0x2e')][_0x2594('0x2f')]};});_0xa8ee54[_0x2594('0x30')]=_[_0x2594('0x2a')](_0x273e04,'name');_0xa8ee54[_0x2594('0x31')]=_[_0x2594('0x32')](_0x21339d['query']);_0xa8ee54['filters']=_[_0x2594('0x33')](_0xa8ee54[_0x2594('0x30')],_0xa8ee54[_0x2594('0x31')]);_0x36fdf4[_0x2594('0x34')]=_['intersection'](_0xa8ee54[_0x2594('0x30')],qs[_0x2594('0x35')](_0x21339d['query']['fields']));_0x36fdf4['attributes']=_0x36fdf4['attributes']['length']?_0x36fdf4[_0x2594('0x34')]:_0xa8ee54[_0x2594('0x30')];if(!_0x21339d[_0x2594('0x31')][_0x2594('0x36')](_0x2594('0x37'))){_0x36fdf4[_0x2594('0x1f')]=qs[_0x2594('0x1f')](_0x21339d[_0x2594('0x31')][_0x2594('0x1f')]);_0x36fdf4[_0x2594('0x1d')]=qs[_0x2594('0x1d')](_0x21339d[_0x2594('0x31')][_0x2594('0x1d')]);}_0x36fdf4[_0x2594('0x38')]=qs[_0x2594('0x39')](_0x21339d['query']['sort']);_0x36fdf4[_0x2594('0x3a')]=qs[_0x2594('0x3b')](_[_0x2594('0x3c')](_0x21339d[_0x2594('0x31')],_0xa8ee54[_0x2594('0x3b')]),_0x273e04);if(_0x21339d[_0x2594('0x31')][_0x2594('0x3d')]){_0x36fdf4[_0x2594('0x3a')]=_[_0x2594('0x3e')](_0x36fdf4['where'],{'$or':_['map'](_0x273e04,function(_0x1754f5){if(_0x1754f5['type']!==_0x2594('0x3f')){var _0x2b3887={};_0x2b3887[_0x1754f5[_0x2594('0x28')]]={'$like':'%'+_0x21339d[_0x2594('0x31')]['filter']+'%'};return _0x2b3887;}})});}_0x36fdf4=_['merge']({},_0x36fdf4,_0x21339d['options']);var _0x6df7f1={'where':_0x36fdf4[_0x2594('0x3a')]};return db[_0x2594('0x2b')][_0x2594('0x20')](_0x6df7f1)[_0x2594('0x25')](function(_0xc866c2){_0x590123['count']=_0xc866c2;if(_0x21339d[_0x2594('0x31')][_0x2594('0x40')]){_0x36fdf4[_0x2594('0x41')]=[{'all':!![]}];}return db[_0x2594('0x2b')][_0x2594('0x42')](_0x36fdf4);})['then'](function(_0x5d9268){_0x590123[_0x2594('0x43')]=_0x5d9268;return _0x590123;})[_0x2594('0x25')](respondWithFilteredResult(_0x4dc1a5,_0x36fdf4))[_0x2594('0x44')](handleError(_0x4dc1a5,null));};exports[_0x2594('0x45')]=function(_0x5e6bad,_0x582e5f){var _0x5b2aa9={'raw':!![],'where':{'id':_0x5e6bad[_0x2594('0x46')]['id']}},_0x4906f8={};_0x4906f8[_0x2594('0x30')]=_['keys'](db[_0x2594('0x2b')][_0x2594('0x2c')]);_0x4906f8['query']=_[_0x2594('0x32')](_0x5e6bad['query']);_0x4906f8[_0x2594('0x3b')]=_[_0x2594('0x33')](_0x4906f8[_0x2594('0x30')],_0x4906f8[_0x2594('0x31')]);_0x5b2aa9[_0x2594('0x34')]=_[_0x2594('0x33')](_0x4906f8['model'],qs[_0x2594('0x35')](_0x5e6bad['query']['fields']));_0x5b2aa9[_0x2594('0x34')]=_0x5b2aa9['attributes'][_0x2594('0x47')]?_0x5b2aa9[_0x2594('0x34')]:_0x4906f8[_0x2594('0x30')];if(_0x5e6bad[_0x2594('0x31')][_0x2594('0x40')]){_0x5b2aa9[_0x2594('0x41')]=[{'all':!![]}];}_0x5b2aa9=_[_0x2594('0x3e')]({},_0x5b2aa9,_0x5e6bad[_0x2594('0x48')]);return db[_0x2594('0x2b')][_0x2594('0x49')](_0x5b2aa9)[_0x2594('0x25')](handleEntityNotFound(_0x582e5f,null))[_0x2594('0x25')](respondWithResult(_0x582e5f,null))['catch'](handleError(_0x582e5f,null));};exports[_0x2594('0x4a')]=function(_0x4b0ce5,_0x1a49b7){return db[_0x2594('0x2b')][_0x2594('0x4a')](_0x4b0ce5[_0x2594('0x4b')],{})['then'](respondWithResult(_0x1a49b7,0xc9))[_0x2594('0x44')](handleError(_0x1a49b7,null));};exports[_0x2594('0x23')]=function(_0x2de34e,_0x5dcbe1){if(_0x2de34e[_0x2594('0x4b')]['id']){delete _0x2de34e[_0x2594('0x4b')]['id'];}return db[_0x2594('0x2b')][_0x2594('0x49')]({'where':{'id':_0x2de34e[_0x2594('0x46')]['id']}})[_0x2594('0x25')](handleEntityNotFound(_0x5dcbe1,null))[_0x2594('0x25')](saveUpdates(_0x2de34e[_0x2594('0x4b')],null))['then'](respondWithResult(_0x5dcbe1,null))[_0x2594('0x44')](handleError(_0x5dcbe1,null));};exports[_0x2594('0x24')]=function(_0x45e1eb,_0x8719e0){return db[_0x2594('0x2b')]['find']({'where':{'id':_0x45e1eb[_0x2594('0x46')]['id']}})[_0x2594('0x25')](handleEntityNotFound(_0x8719e0,null))['then'](removeEntity(_0x8719e0,null))['catch'](handleError(_0x8719e0,null));}; \ No newline at end of file +var _0xbb8d=['then','destroy','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','update','body','params','find','eml-format','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','apply','reject','save'];(function(_0x5725dd,_0x3b17c5){var _0xf46aad=function(_0x12d82e){while(--_0x12d82e){_0x5725dd['push'](_0x5725dd['shift']());}};_0xf46aad(++_0x3b17c5);}(_0xbb8d,0x146));var _0xdbb8=function(_0x50b5e9,_0x15da7a){_0x50b5e9=_0x50b5e9-0x0;var _0x3edd59=_0xbb8d[_0x50b5e9];return _0x3edd59;};'use strict';var emlformat=require(_0xdbb8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdbb8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdbb8('0x2'));var Mustache=require(_0xdbb8('0x3'));var util=require(_0xdbb8('0x4'));var path=require(_0xdbb8('0x5'));var sox=require(_0xdbb8('0x6'));var csv=require('to-csv');var ejs=require(_0xdbb8('0x7'));var fs=require('fs');var fs_extra=require(_0xdbb8('0x8'));var _=require(_0xdbb8('0x9'));var squel=require(_0xdbb8('0xa'));var crypto=require('crypto');var jsforce=require(_0xdbb8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdbb8('0xc'));var querystring=require(_0xdbb8('0xd'));var Papa=require('papaparse');var Redis=require(_0xdbb8('0xe'));var authService=require(_0xdbb8('0xf'));var qs=require(_0xdbb8('0x10'));var as=require(_0xdbb8('0x11'));var hardwareService=require(_0xdbb8('0x12'));var logger=require(_0xdbb8('0x13'))(_0xdbb8('0x14'));var utils=require(_0xdbb8('0x15'));var config=require(_0xdbb8('0x16'));var licenseUtil=require(_0xdbb8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a7002,_0x309fa3){_0x309fa3=_0x309fa3||0xcc;return function(_0x22596c){if(_0x22596c){return _0x2a7002[_0xdbb8('0x18')](_0x309fa3);}return _0x2a7002[_0xdbb8('0x19')](_0x309fa3)[_0xdbb8('0x1a')]();};}function respondWithResult(_0x28ee7f,_0x242952){_0x242952=_0x242952||0xc8;return function(_0x519b79){if(_0x519b79){return _0x28ee7f[_0xdbb8('0x19')](_0x242952)['json'](_0x519b79);}};}function respondWithFilteredResult(_0x2c6ac,_0x2723c7){return function(_0x2f3b5f){if(_0x2f3b5f){var _0x3180a7=typeof _0x2723c7[_0xdbb8('0x1b')]==='undefined'&&typeof _0x2723c7[_0xdbb8('0x1c')]==='undefined';var _0x56532a=_0x2f3b5f[_0xdbb8('0x1d')];var _0x51ed87=_0x3180a7?0x0:_0x2723c7[_0xdbb8('0x1b')];var _0x1e6803=_0x3180a7?_0x2f3b5f[_0xdbb8('0x1d')]:_0x2723c7[_0xdbb8('0x1b')]+_0x2723c7[_0xdbb8('0x1c')];var _0x229277;if(_0x1e6803>=_0x56532a){_0x1e6803=_0x56532a;_0x229277=0xc8;}else{_0x229277=0xce;}_0x2c6ac[_0xdbb8('0x19')](_0x229277);return _0x2c6ac[_0xdbb8('0x1e')]('Content-Range',_0x51ed87+'-'+_0x1e6803+'/'+_0x56532a)['json'](_0x2f3b5f);}return null;};}function patchUpdates(_0x4b5a99){return function(_0x11be8c){try{jsonpatch[_0xdbb8('0x1f')](_0x11be8c,_0x4b5a99,!![]);}catch(_0x1634b5){return BPromise[_0xdbb8('0x20')](_0x1634b5);}return _0x11be8c[_0xdbb8('0x21')]();};}function saveUpdates(_0x42dcf4,_0x423ffb){return function(_0xe26dfa){if(_0xe26dfa){return _0xe26dfa['update'](_0x42dcf4)[_0xdbb8('0x22')](function(_0x4090e7){return _0x4090e7;});}return null;};}function removeEntity(_0x3ea771,_0x5e58df){return function(_0xa2a177){if(_0xa2a177){return _0xa2a177[_0xdbb8('0x23')]()['then'](function(){_0x3ea771[_0xdbb8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x447af4,_0x21ef2c){return function(_0x1e4bfc){if(!_0x1e4bfc){_0x447af4[_0xdbb8('0x18')](0x194);}return _0x1e4bfc;};}function handleError(_0x582916,_0x581ee5){_0x581ee5=_0x581ee5||0x1f4;return function(_0x2db294){logger['error'](_0x2db294['stack']);if(_0x2db294[_0xdbb8('0x24')]){delete _0x2db294[_0xdbb8('0x24')];}_0x582916['status'](_0x581ee5)['send'](_0x2db294);};}exports[_0xdbb8('0x25')]=function(_0x2e907b,_0x4f2276){var _0x2331e2={},_0xf7e4ee={},_0x43064d={'count':0x0,'rows':[]};var _0x2b4506=_[_0xdbb8('0x26')](db[_0xdbb8('0x27')][_0xdbb8('0x28')],function(_0x379307){return{'name':_0x379307[_0xdbb8('0x29')],'type':_0x379307[_0xdbb8('0x2a')][_0xdbb8('0x2b')]};});_0xf7e4ee[_0xdbb8('0x2c')]=_[_0xdbb8('0x26')](_0x2b4506,_0xdbb8('0x24'));_0xf7e4ee['query']=_[_0xdbb8('0x2d')](_0x2e907b[_0xdbb8('0x2e')]);_0xf7e4ee[_0xdbb8('0x2f')]=_[_0xdbb8('0x30')](_0xf7e4ee['model'],_0xf7e4ee[_0xdbb8('0x2e')]);_0x2331e2[_0xdbb8('0x31')]=_[_0xdbb8('0x30')](_0xf7e4ee[_0xdbb8('0x2c')],qs[_0xdbb8('0x32')](_0x2e907b[_0xdbb8('0x2e')][_0xdbb8('0x32')]));_0x2331e2[_0xdbb8('0x31')]=_0x2331e2[_0xdbb8('0x31')]['length']?_0x2331e2['attributes']:_0xf7e4ee['model'];if(!_0x2e907b[_0xdbb8('0x2e')][_0xdbb8('0x33')](_0xdbb8('0x34'))){_0x2331e2['limit']=qs[_0xdbb8('0x1c')](_0x2e907b[_0xdbb8('0x2e')][_0xdbb8('0x1c')]);_0x2331e2['offset']=qs[_0xdbb8('0x1b')](_0x2e907b[_0xdbb8('0x2e')][_0xdbb8('0x1b')]);}_0x2331e2[_0xdbb8('0x35')]=qs['sort'](_0x2e907b[_0xdbb8('0x2e')][_0xdbb8('0x36')]);_0x2331e2[_0xdbb8('0x37')]=qs[_0xdbb8('0x2f')](_[_0xdbb8('0x38')](_0x2e907b[_0xdbb8('0x2e')],_0xf7e4ee['filters']),_0x2b4506);if(_0x2e907b[_0xdbb8('0x2e')][_0xdbb8('0x39')]){_0x2331e2[_0xdbb8('0x37')]=_[_0xdbb8('0x3a')](_0x2331e2[_0xdbb8('0x37')],{'$or':_[_0xdbb8('0x26')](_0x2b4506,function(_0x5ba008){if(_0x5ba008['type']!==_0xdbb8('0x3b')){var _0x418909={};_0x418909[_0x5ba008['name']]={'$like':'%'+_0x2e907b[_0xdbb8('0x2e')][_0xdbb8('0x39')]+'%'};return _0x418909;}})});}_0x2331e2=_['merge']({},_0x2331e2,_0x2e907b[_0xdbb8('0x3c')]);var _0x20d400={'where':_0x2331e2[_0xdbb8('0x37')]};return db['WhatsappApplication'][_0xdbb8('0x1d')](_0x20d400)[_0xdbb8('0x22')](function(_0x411365){_0x43064d['count']=_0x411365;if(_0x2e907b[_0xdbb8('0x2e')][_0xdbb8('0x3d')]){_0x2331e2[_0xdbb8('0x3e')]=[{'all':!![]}];}return db[_0xdbb8('0x27')][_0xdbb8('0x3f')](_0x2331e2);})[_0xdbb8('0x22')](function(_0xb615ca){_0x43064d[_0xdbb8('0x40')]=_0xb615ca;return _0x43064d;})[_0xdbb8('0x22')](respondWithFilteredResult(_0x4f2276,_0x2331e2))[_0xdbb8('0x41')](handleError(_0x4f2276,null));};exports[_0xdbb8('0x42')]=function(_0x220825,_0x5995ca){var _0x432415={'raw':!![],'where':{'id':_0x220825['params']['id']}},_0x263179={};_0x263179[_0xdbb8('0x2c')]=_[_0xdbb8('0x2d')](db['WhatsappApplication'][_0xdbb8('0x28')]);_0x263179[_0xdbb8('0x2e')]=_[_0xdbb8('0x2d')](_0x220825[_0xdbb8('0x2e')]);_0x263179[_0xdbb8('0x2f')]=_[_0xdbb8('0x30')](_0x263179['model'],_0x263179[_0xdbb8('0x2e')]);_0x432415[_0xdbb8('0x31')]=_[_0xdbb8('0x30')](_0x263179[_0xdbb8('0x2c')],qs['fields'](_0x220825[_0xdbb8('0x2e')][_0xdbb8('0x32')]));_0x432415[_0xdbb8('0x31')]=_0x432415['attributes']['length']?_0x432415[_0xdbb8('0x31')]:_0x263179[_0xdbb8('0x2c')];if(_0x220825[_0xdbb8('0x2e')][_0xdbb8('0x3d')]){_0x432415[_0xdbb8('0x3e')]=[{'all':!![]}];}_0x432415=_['merge']({},_0x432415,_0x220825[_0xdbb8('0x3c')]);return db[_0xdbb8('0x27')]['find'](_0x432415)[_0xdbb8('0x22')](handleEntityNotFound(_0x5995ca,null))[_0xdbb8('0x22')](respondWithResult(_0x5995ca,null))['catch'](handleError(_0x5995ca,null));};exports[_0xdbb8('0x43')]=function(_0x425ba1,_0x4542b1){return db[_0xdbb8('0x27')]['create'](_0x425ba1['body'],{})[_0xdbb8('0x22')](respondWithResult(_0x4542b1,0xc9))['catch'](handleError(_0x4542b1,null));};exports[_0xdbb8('0x44')]=function(_0x5ec10f,_0x5b6aad){if(_0x5ec10f[_0xdbb8('0x45')]['id']){delete _0x5ec10f[_0xdbb8('0x45')]['id'];}return db[_0xdbb8('0x27')]['find']({'where':{'id':_0x5ec10f[_0xdbb8('0x46')]['id']}})['then'](handleEntityNotFound(_0x5b6aad,null))[_0xdbb8('0x22')](saveUpdates(_0x5ec10f[_0xdbb8('0x45')],null))[_0xdbb8('0x22')](respondWithResult(_0x5b6aad,null))[_0xdbb8('0x41')](handleError(_0x5b6aad,null));};exports['destroy']=function(_0xb7a59a,_0x382664){return db[_0xdbb8('0x27')][_0xdbb8('0x47')]({'where':{'id':_0xb7a59a[_0xdbb8('0x46')]['id']}})[_0xdbb8('0x22')](handleEntityNotFound(_0x382664,null))[_0xdbb8('0x22')](removeEntity(_0x382664,null))[_0xdbb8('0x41')](handleError(_0x382664,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 8d38eb2..6ad02f6 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 _0x17c4=['rimraf','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x44d36b,_0xe42dd7){var _0x942f84=function(_0x164274){while(--_0x164274){_0x44d36b['push'](_0x44d36b['shift']());}};_0x942f84(++_0xe42dd7);}(_0x17c4,0x102));var _0x417c=function(_0x282536,_0x3ba66a){_0x282536=_0x282536-0x0;var _0x76aa80=_0x17c4[_0x282536];return _0x76aa80;};'use strict';var _=require(_0x417c('0x0'));var util=require(_0x417c('0x1'));var logger=require(_0x417c('0x2'))(_0x417c('0x3'));var moment=require(_0x417c('0x4'));var BPromise=require(_0x417c('0x5'));var rp=require(_0x417c('0x6'));var fs=require('fs');var path=require(_0x417c('0x7'));var rimraf=require(_0x417c('0x8'));var config=require(_0x417c('0x9'));var attributes=require(_0x417c('0xa'));module['exports']=function(_0x24e681,_0x117c5d){return _0x24e681[_0x417c('0xb')](_0x417c('0xc'),attributes,{'tableName':_0x417c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x61a5=['../../config/environment','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x419ffd,_0x10bdfe){var _0xb0b19d=function(_0x335815){while(--_0x335815){_0x419ffd['push'](_0x419ffd['shift']());}};_0xb0b19d(++_0x10bdfe);}(_0x61a5,0xf0));var _0x561a=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0x61a5[_0x4d35f3];return _0x382fea;};'use strict';var _=require(_0x561a('0x0'));var util=require('util');var logger=require(_0x561a('0x1'))(_0x561a('0x2'));var moment=require(_0x561a('0x3'));var BPromise=require(_0x561a('0x4'));var rp=require(_0x561a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x561a('0x6'));var config=require(_0x561a('0x7'));var attributes=require('./whatsappApplication.attributes');module[_0x561a('0x8')]=function(_0x31f762,_0x24c89a){return _0x31f762[_0x561a('0x9')](_0x561a('0xa'),attributes,{'tableName':_0x561a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x561a('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index e7b2c64..417f385 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 _0x5636=['code','WhatsappApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5636,0x102));var _0x6563=function(_0x10b737,_0x47be85){_0x10b737=_0x10b737-0x0;var _0x1ec9d3=_0x5636[_0x10b737];return _0x1ec9d3;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});} \ No newline at end of file +var _0xb821=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','ioredis'];(function(_0x5d7a3d,_0x1ce20b){var _0x48afcb=function(_0x2a361f){while(--_0x2a361f){_0x5d7a3d['push'](_0x5d7a3d['shift']());}};_0x48afcb(++_0x1ce20b);}(_0xb821,0xa7));var _0x1b82=function(_0x3d0d3c,_0x8f0127){_0x3d0d3c=_0x3d0d3c-0x0;var _0x567568=_0xb821[_0x3d0d3c];return _0x567568;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x192434,_0x202a5f,_0x3632dd){return new BPromise(function(_0x18f45f,_0x7b87e8){return client[_0x1b82('0x8')](_0x192434,_0x3632dd)[_0x1b82('0x9')](function(_0x141673){logger['info'](_0x1b82('0xa'),_0x202a5f,_0x1b82('0xb'));logger[_0x1b82('0xc')](_0x1b82('0xd'),_0x202a5f,_0x1b82('0xb'),JSON[_0x1b82('0xe')](_0x141673));if(_0x141673[_0x1b82('0xf')]){if(_0x141673[_0x1b82('0xf')]['code']===0x1f4){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);return _0x7b87e8(_0x141673['error'][_0x1b82('0x10')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x202a5f,_0x141673[_0x1b82('0xf')]['message']);return _0x18f45f(_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);}else{logger['info'](_0x1b82('0xa'),_0x202a5f,'request\x20sent');_0x18f45f(_0x141673['result'][_0x1b82('0x10')]);}})['catch'](function(_0x111247){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x111247);_0x7b87e8(_0x111247);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index e08ffb6..1660d4a 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 _0xfd87=['index','/describe','describe','get','/:id','show','/:id/messages','/:id/download','download','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated'];(function(_0x249c5b,_0x5b1b7e){var _0x15bf73=function(_0xc9e1c6){while(--_0xc9e1c6){_0x249c5b['push'](_0x249c5b['shift']());}};_0x15bf73(++_0x5b1b7e);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var path=require(_0x7fd8('0x2'));var timeout=require(_0x7fd8('0x3'));var express=require(_0x7fd8('0x4'));var router=express[_0x7fd8('0x5')]();var fs_extra=require(_0x7fd8('0x6'));var auth=require(_0x7fd8('0x7'));var interaction=require(_0x7fd8('0x8'));var config=require(_0x7fd8('0x9'));var controller=require(_0x7fd8('0xa'));router['get']('/',auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xc')]);router['get'](_0x7fd8('0xd'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xe')]);router[_0x7fd8('0xf')](_0x7fd8('0x10'),auth['isAuthenticated'](),controller[_0x7fd8('0x11')]);router[_0x7fd8('0xf')](_0x7fd8('0x12'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x7fd8('0x13'),auth['isAuthenticated'](),controller[_0x7fd8('0x14')]);router[_0x7fd8('0x15')]('/',auth[_0x7fd8('0xb')](),controller['create']);router[_0x7fd8('0x15')](_0x7fd8('0x12'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0x16')]);router[_0x7fd8('0x15')]('/:id/tags',auth[_0x7fd8('0xb')](),interaction[_0x7fd8('0x17')](_0x7fd8('0x18'),_0x7fd8('0x19')),controller[_0x7fd8('0x1a')]);router[_0x7fd8('0x1b')](_0x7fd8('0x10'),auth[_0x7fd8('0xb')](),interaction[_0x7fd8('0x17')](_0x7fd8('0x18'),_0x7fd8('0x1c')),controller['update']);router['delete']('/:id',auth[_0x7fd8('0xb')](),interaction[_0x7fd8('0x17')]('whatsapp',_0x7fd8('0x1d')),controller[_0x7fd8('0x1e')]);router[_0x7fd8('0x1f')](_0x7fd8('0x20'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0x21')]);module[_0x7fd8('0x22')]=router; \ No newline at end of file +var _0x277c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','tracked','whatsapp','put','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','path'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x277c,0x153));var _0xc277=function(_0x3b609e,_0x3c21d0){_0x3b609e=_0x3b609e-0x0;var _0x3b42e2=_0x277c[_0x3b609e];return _0x3b42e2;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var fs_extra=require(_0xc277('0x5'));var auth=require(_0xc277('0x6'));var interaction=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0xc277('0x9')](),controller['index']);router[_0xc277('0xa')]('/describe',auth[_0xc277('0x9')](),controller[_0xc277('0xb')]);router['get'](_0xc277('0xc'),auth[_0xc277('0x9')](),controller[_0xc277('0xd')]);router[_0xc277('0xa')](_0xc277('0xe'),auth[_0xc277('0x9')](),controller['getMessages']);router['get'](_0xc277('0xf'),auth[_0xc277('0x9')](),controller[_0xc277('0x10')]);router[_0xc277('0x11')]('/',auth['isAuthenticated'](),controller[_0xc277('0x12')]);router['post'](_0xc277('0xe'),auth[_0xc277('0x9')](),controller[_0xc277('0x13')]);router[_0xc277('0x11')]('/:id/tags',auth[_0xc277('0x9')](),interaction[_0xc277('0x14')](_0xc277('0x15'),'whatsappinteraction:addtags'),controller['addTags']);router[_0xc277('0x16')]('/:id',auth[_0xc277('0x9')](),interaction['tracked'](_0xc277('0x15'),_0xc277('0x17')),controller[_0xc277('0x18')]);router['delete']('/:id',auth[_0xc277('0x9')](),interaction['tracked']('whatsapp',_0xc277('0x19')),controller[_0xc277('0x1a')]);router[_0xc277('0x1b')](_0xc277('0x1c'),auth[_0xc277('0x9')](),controller[_0xc277('0x1d')]);module[_0xc277('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 39e3aa3..c5a1302 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 _0x5ba3=['BOOLEAN','STRING','DATE','ENUM','out','sequelize','exports'];(function(_0x27755a,_0x307a31){var _0x11d399=function(_0x36b229){while(--_0x36b229){_0x27755a['push'](_0x27755a['shift']());}};_0x11d399(++_0x307a31);}(_0x5ba3,0x140));var _0x35ba=function(_0x3d89e0,_0x329b7d){_0x3d89e0=_0x3d89e0-0x0;var _0x5a2354=_0x5ba3[_0x3d89e0];return _0x5a2354;};'use strict';var Sequelize=require(_0x35ba('0x0'));var moment=require('moment');module[_0x35ba('0x1')]={'closed':{'type':Sequelize[_0x35ba('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x35ba('0x3')]},'secondDisposition':{'type':Sequelize[_0x35ba('0x3')]},'thirdDisposition':{'type':Sequelize[_0x35ba('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x35ba('0x3')]},'read1stAt':{'type':Sequelize[_0x35ba('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x35ba('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x35ba('0x5')]('in',_0x35ba('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x35ba('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1e24=['DATE','ENUM','out','INTEGER','sequelize','moment','exports','BOOLEAN','STRING'];(function(_0x376ddb,_0x5c43ca){var _0x4ba9fa=function(_0x3abb4c){while(--_0x3abb4c){_0x376ddb['push'](_0x376ddb['shift']());}};_0x4ba9fa(++_0x5c43ca);}(_0x1e24,0x82));var _0x41e2=function(_0x363dee,_0x4d1a44){_0x363dee=_0x363dee-0x0;var _0x31ae44=_0x1e24[_0x363dee];return _0x31ae44;};'use strict';var Sequelize=require(_0x41e2('0x0'));var moment=require(_0x41e2('0x1'));module[_0x41e2('0x2')]={'closed':{'type':Sequelize[_0x41e2('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x41e2('0x4')]},'secondDisposition':{'type':Sequelize[_0x41e2('0x4')]},'thirdDisposition':{'type':Sequelize[_0x41e2('0x4')]},'note':{'type':Sequelize[_0x41e2('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x41e2('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x41e2('0x6')]('in',_0x41e2('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x41e2('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x41e2('0x6')]('in',_0x41e2('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x41e2('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x41e2('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index b0a110d..e0d7f1e 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 _0x6a3c=['read','value','renderFile','views','transcript-','Whatsapp','createPdfFromHTML','download','log','err','zip-dir','moment','bluebird','util','path','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','error','name','send','index','rawAttributes','fieldName','key','getOptions','whatsapp','query','user','catch','model','WhatsappInteraction','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','params','describe','addMessage','WhatsappMessage','ids','getMessages','keys','hasOwnProperty','nolimit','sort','where','pick','WhatsappInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','findAll','rows','setTags','omit','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','push','User','fullname','Contact','lastName','Attachment','Messages','createdAt','direction','secret','Owner','get','mkdirSync','Account','N.A.','closedAt','toString','disposition','basename','existsSync','createReadStream','createWriteStream','out','System','firstName'];(function(_0x1d5864,_0x49fba3){var _0x205a6b=function(_0x1edb69){while(--_0x1edb69){_0x1d5864['push'](_0x1d5864['shift']());}};_0x205a6b(++_0x49fba3);}(_0x6a3c,0x106));var _0xc6a3=function(_0x12a391,_0xe75184){_0x12a391=_0x12a391-0x0;var _0x3e91cb=_0x6a3c[_0x12a391];return _0x3e91cb;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xc6a3('0x0'));var moment=require(_0xc6a3('0x1'));var BPromise=require(_0xc6a3('0x2'));var util=require(_0xc6a3('0x3'));var path=require(_0xc6a3('0x4'));var ejs=require(_0xc6a3('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xc6a3('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xc6a3('0x7'));var pdf=require(_0xc6a3('0x8'));var logger=require(_0xc6a3('0x9'))('api');var config=require(_0xc6a3('0xa'));var db=require(_0xc6a3('0xb'))['db'];config[_0xc6a3('0xc')]=_['defaults'](config[_0xc6a3('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc6a3('0xd'))(new Redis(config['redis']));require(_0xc6a3('0xe'))[_0xc6a3('0xf')](socket);function respondWithStatusCode(_0x3a7fb8,_0x2723a4){_0x2723a4=_0x2723a4||0xcc;return function(_0x3530b4){if(_0x3530b4){return _0x3a7fb8[_0xc6a3('0x10')](_0x2723a4);}return _0x3a7fb8[_0xc6a3('0x11')](_0x2723a4)[_0xc6a3('0x12')]();};}function respondWithResult(_0x185968,_0x581fce){_0x581fce=_0x581fce||0xc8;return function(_0x4f1d6d){if(_0x4f1d6d){return _0x185968['status'](_0x581fce)[_0xc6a3('0x13')](_0x4f1d6d);}};}function respondWithFilteredResult(_0x238993,_0x36c02f){return function(_0x391f52){if(_0x391f52){var _0x50fcbe=typeof _0x36c02f[_0xc6a3('0x14')]===_0xc6a3('0x15')&&typeof _0x36c02f[_0xc6a3('0x16')]==='undefined';var _0x1a2777=_0x391f52['count'];var _0x2df236=_0x50fcbe?0x0:_0x36c02f[_0xc6a3('0x14')];var _0x57ac25=_0x50fcbe?_0x391f52['count']:_0x36c02f[_0xc6a3('0x14')]+_0x36c02f['limit'];var _0x18ec05;if(_0x57ac25>=_0x1a2777){_0x57ac25=_0x1a2777;_0x18ec05=0xc8;}else{_0x18ec05=0xce;}_0x238993['status'](_0x18ec05);return _0x238993[_0xc6a3('0x17')](_0xc6a3('0x18'),_0x2df236+'-'+_0x57ac25+'/'+_0x1a2777)[_0xc6a3('0x13')](_0x391f52);}return null;};}function saveUpdates(_0x37a21a){return function(_0x317d56){if(_0x317d56){return _0x317d56[_0xc6a3('0x19')](_0x37a21a)[_0xc6a3('0x1a')](function(_0x40d6eb){return _0x40d6eb;});}return null;};}function removeEntity(_0x48634b){return function(_0xbabcd4){if(_0xbabcd4){return _0xbabcd4[_0xc6a3('0x1b')]()[_0xc6a3('0x1a')](function(){_0x48634b[_0xc6a3('0x11')](0xcc)[_0xc6a3('0x12')]();});}};}function handleEntityNotFound(_0x3c8a46){return function(_0x17bc06){if(!_0x17bc06){_0x3c8a46[_0xc6a3('0x10')](0x194);}return _0x17bc06;};}function handleError(_0x448bd5,_0x13cb57){_0x13cb57=_0x13cb57||0x1f4;return function(_0x39c22c){logger[_0xc6a3('0x1c')](_0x39c22c['stack']);if(_0x39c22c['name']){delete _0x39c22c[_0xc6a3('0x1d')];}_0x448bd5[_0xc6a3('0x11')](_0x13cb57)[_0xc6a3('0x1e')](_0x39c22c);};}exports[_0xc6a3('0x1f')]=function(_0xd6db16,_0xc2ab8a){var _0x52b184={};var _0x3cf3a7=_['map'](db['WhatsappInteraction'][_0xc6a3('0x20')],function(_0x1125b0){return{'name':_0x1125b0[_0xc6a3('0x21')],'type':_0x1125b0['type'][_0xc6a3('0x22')]};});_0x52b184=qs[_0xc6a3('0x23')](_0x3cf3a7,_0xd6db16);return interaction['findAll'](_0xc6a3('0x24'),_0xd6db16[_0xc6a3('0x25')],_0xd6db16[_0xc6a3('0x26')],_0x52b184,_0x3cf3a7)['then'](respondWithFilteredResult(_0xc2ab8a,_0x52b184))[_0xc6a3('0x27')](handleError(_0xc2ab8a,null));};exports['show']=function(_0x1e8fed,_0xba2a5b){var _0x3c8e74={'raw':![],'where':{'id':_0x1e8fed['params']['id']}},_0x24848e={};_0x24848e[_0xc6a3('0x28')]=_['keys'](db[_0xc6a3('0x29')]['rawAttributes']);_0x24848e[_0xc6a3('0x25')]=_['keys'](_0x1e8fed[_0xc6a3('0x25')]);_0x24848e[_0xc6a3('0x2a')]=_[_0xc6a3('0x2b')](_0x24848e['model'],_0x24848e['query']);_0x3c8e74[_0xc6a3('0x2c')]=_[_0xc6a3('0x2b')](_0x24848e['model'],qs[_0xc6a3('0x2d')](_0x1e8fed[_0xc6a3('0x25')][_0xc6a3('0x2d')]));_0x3c8e74['attributes']=_0x3c8e74[_0xc6a3('0x2c')][_0xc6a3('0x2e')]?_0x3c8e74[_0xc6a3('0x2c')]:_0x24848e[_0xc6a3('0x28')];if(_0x1e8fed[_0xc6a3('0x25')][_0xc6a3('0x2f')]){_0x3c8e74[_0xc6a3('0x30')]=[{'all':!![]}];}_0x3c8e74=_[_0xc6a3('0x31')]({},_0x3c8e74,_0x1e8fed[_0xc6a3('0x32')]);return db[_0xc6a3('0x29')][_0xc6a3('0x33')](_0x3c8e74)['then'](handleEntityNotFound(_0xba2a5b,null))[_0xc6a3('0x1a')](respondWithResult(_0xba2a5b,null))[_0xc6a3('0x27')](handleError(_0xba2a5b,null));};exports[_0xc6a3('0x34')]=function(_0x291eea,_0x3f8b7f){return db['WhatsappInteraction'][_0xc6a3('0x34')](_0x291eea[_0xc6a3('0x35')],{})[_0xc6a3('0x1a')](respondWithResult(_0x3f8b7f,0xc9))[_0xc6a3('0x27')](handleError(_0x3f8b7f,null));};exports['update']=function(_0x22993c,_0x4868e8){if(_0x22993c[_0xc6a3('0x35')]['id']){delete _0x22993c[_0xc6a3('0x35')]['id'];}return db[_0xc6a3('0x29')][_0xc6a3('0x33')]({'where':{'id':_0x22993c[_0xc6a3('0x36')]['id']}})[_0xc6a3('0x1a')](handleEntityNotFound(_0x4868e8,null))['then'](saveUpdates(_0x22993c[_0xc6a3('0x35')],null))['then'](respondWithResult(_0x4868e8,null))[_0xc6a3('0x27')](handleError(_0x4868e8,null));};exports[_0xc6a3('0x1b')]=function(_0x5958ac,_0x7b19ff){return db['WhatsappInteraction']['find']({'where':{'id':_0x5958ac[_0xc6a3('0x36')]['id']}})[_0xc6a3('0x1a')](handleEntityNotFound(_0x7b19ff,null))[_0xc6a3('0x1a')](removeEntity(_0x7b19ff,null))[_0xc6a3('0x27')](handleError(_0x7b19ff,null));};exports[_0xc6a3('0x37')]=function(_0x39c0a9,_0x4ab481){return db[_0xc6a3('0x29')][_0xc6a3('0x37')]()['then'](respondWithResult(_0x4ab481,null))[_0xc6a3('0x27')](handleError(_0x4ab481,null));};exports[_0xc6a3('0x38')]=function(_0x4daa6a,_0x34b4fa){return db[_0xc6a3('0x39')][_0xc6a3('0x33')]({'where':{'id':_0x4daa6a[_0xc6a3('0x36')]['id']}})[_0xc6a3('0x1a')](handleEntityNotFound(_0x34b4fa,null))[_0xc6a3('0x1a')](function(_0x34024d){if(_0x34024d){return _0x34024d[_0xc6a3('0x38')](_0x4daa6a['body'][_0xc6a3('0x3a')],_['omit'](_0x4daa6a[_0xc6a3('0x35')],[_0xc6a3('0x3a'),'id'])||{});}})[_0xc6a3('0x1a')](respondWithResult(_0x34b4fa,null))['catch'](handleError(_0x34b4fa,null));};exports[_0xc6a3('0x3b')]=function(_0x3398ca,_0x5750c9){var _0x4d5993={'raw':![],'where':{}};var _0x2ba689={};var _0x381957={'count':0x0,'rows':[]};return db[_0xc6a3('0x29')]['findOne']({'where':{'id':_0x3398ca[_0xc6a3('0x36')]['id']}})[_0xc6a3('0x1a')](handleEntityNotFound(_0x5750c9,null))[_0xc6a3('0x1a')](function(_0x433a04){if(_0x433a04){_0x2ba689[_0xc6a3('0x28')]=_[_0xc6a3('0x3c')](db['WhatsappMessage'][_0xc6a3('0x20')]);_0x2ba689[_0xc6a3('0x25')]=_[_0xc6a3('0x3c')](_0x3398ca[_0xc6a3('0x25')]);_0x2ba689[_0xc6a3('0x2a')]=_[_0xc6a3('0x2b')](_0x2ba689[_0xc6a3('0x28')],_0x2ba689[_0xc6a3('0x25')]);_0x4d5993[_0xc6a3('0x2c')]=_[_0xc6a3('0x2b')](_0x2ba689[_0xc6a3('0x28')],qs[_0xc6a3('0x2d')](_0x3398ca['query'][_0xc6a3('0x2d')]));_0x4d5993[_0xc6a3('0x2c')]=_0x4d5993[_0xc6a3('0x2c')][_0xc6a3('0x2e')]?_0x4d5993[_0xc6a3('0x2c')]:_0x2ba689[_0xc6a3('0x28')];if(!_0x3398ca[_0xc6a3('0x25')][_0xc6a3('0x3d')](_0xc6a3('0x3e'))){_0x4d5993[_0xc6a3('0x16')]=qs[_0xc6a3('0x16')](_0x3398ca['query'][_0xc6a3('0x16')]);_0x4d5993[_0xc6a3('0x14')]=qs['offset'](_0x3398ca[_0xc6a3('0x25')][_0xc6a3('0x14')]);}_0x4d5993['order']=qs[_0xc6a3('0x3f')](_0x3398ca['query'][_0xc6a3('0x3f')]);_0x4d5993[_0xc6a3('0x40')]=qs[_0xc6a3('0x2a')](_[_0xc6a3('0x41')](_0x3398ca[_0xc6a3('0x25')],_0x2ba689['filters']));_0x4d5993[_0xc6a3('0x40')][_0xc6a3('0x42')]=_0x433a04['id'];if(_0x3398ca[_0xc6a3('0x25')][_0xc6a3('0x43')]){_0x4d5993[_0xc6a3('0x40')]=_[_0xc6a3('0x31')](_0x4d5993['where'],{'$or':_[_0xc6a3('0x44')](_0x4d5993['attributes'],function(_0x562c16){var _0x1ea492={};_0x1ea492[_0x562c16]={'$like':'%'+_0x3398ca[_0xc6a3('0x25')][_0xc6a3('0x43')]+'%'};return _0x1ea492;})});}if(_0x3398ca['query'][_0xc6a3('0x45')]){var _0x37b577=_0x3398ca[_0xc6a3('0x25')][_0xc6a3('0x45')][_0xc6a3('0x46')](',');var _0x46474a={};_0x46474a[_0x37b577[0x0]]={'$gte':moment(_0x37b577[0x1])[_0xc6a3('0x47')](_0xc6a3('0x48'))};_0x4d5993[_0xc6a3('0x40')]=_[_0xc6a3('0x31')](_0x4d5993[_0xc6a3('0x40')],_0x46474a);}_0x4d5993=_[_0xc6a3('0x31')]({},_0x4d5993,_0x3398ca[_0xc6a3('0x32')]);return db[_0xc6a3('0x39')][_0xc6a3('0x49')]({'where':_0x4d5993['where']})[_0xc6a3('0x1a')](function(_0x4c1aad){_0x381957['count']=_0x4c1aad;if(_0x3398ca[_0xc6a3('0x25')][_0xc6a3('0x2f')]){_0x4d5993['include']=[{'all':!![]}];}return db[_0xc6a3('0x39')][_0xc6a3('0x4a')](_0x4d5993);})[_0xc6a3('0x1a')](function(_0x19efb8){_0x381957[_0xc6a3('0x4b')]=_0x19efb8;return _0x381957;});}})['then'](respondWithFilteredResult(_0x5750c9,_0x4d5993))[_0xc6a3('0x27')](handleError(_0x5750c9,null));};exports['addTags']=function(_0x2e17d3,_0x3a5e18){return db['WhatsappInteraction']['find']({'where':{'id':_0x2e17d3[_0xc6a3('0x36')]['id']}})[_0xc6a3('0x1a')](handleEntityNotFound(_0x3a5e18,null))['then'](function(_0x228120){if(_0x228120){return _0x228120[_0xc6a3('0x4c')](_0x2e17d3[_0xc6a3('0x35')][_0xc6a3('0x3a')],_[_0xc6a3('0x4d')](_0x2e17d3[_0xc6a3('0x35')],[_0xc6a3('0x3a'),'id'])||{})[_0xc6a3('0x4e')](function(){return db[_0xc6a3('0x4f')][_0xc6a3('0x4a')]({'attributes':['id',_0xc6a3('0x1d'),_0xc6a3('0x50')],'where':{'id':_0x2e17d3[_0xc6a3('0x35')][_0xc6a3('0x3a')]}});})['then'](function(_0x2dff81){socket[_0xc6a3('0x51')](_0xc6a3('0x52'),{'id':Number(_0x2e17d3['params']['id']),'tags':_0x2dff81||[]});return{'id':Number(_0x2e17d3[_0xc6a3('0x36')]['id']),'tags':_0x2dff81||[]};});}})['then'](respondWithResult(_0x3a5e18,null))[_0xc6a3('0x27')](handleError(_0x3a5e18,null));};exports[_0xc6a3('0x53')]=function(_0x1176ac,_0x58f291){return db[_0xc6a3('0x29')]['find']({'where':{'id':_0x1176ac['params']['id']}})[_0xc6a3('0x1a')](handleEntityNotFound(_0x58f291,null))[_0xc6a3('0x1a')](function(_0x203c3b){if(_0x203c3b){return _0x203c3b['removeTags'](_0x1176ac['query'][_0xc6a3('0x3a')]);}})[_0xc6a3('0x1a')](respondWithStatusCode(_0x58f291,null))[_0xc6a3('0x27')](handleError(_0x58f291,null));};exports['download']=function(_0x4e8ef2,_0x2f86f3){var _0x5c26c9=moment()[_0xc6a3('0x54')]()['toString']();var _0x2c8247=path[_0xc6a3('0x55')](config[_0xc6a3('0x56')],_0xc6a3('0x57'),_0xc6a3('0x58'),_0xc6a3('0x59'));var _0x43dda7=path[_0xc6a3('0x55')](config[_0xc6a3('0x56')],_0xc6a3('0x57'),_0xc6a3('0x58'),_0xc6a3('0x5a'));var _0x133cc5=path['join'](_0x2c8247,_0x5c26c9);var _0x3fd452=util[_0xc6a3('0x47')]('transcript-%d-%s.zip',_0x4e8ef2['params']['id'],_0x5c26c9);var _0xed93f5=path[_0xc6a3('0x55')](_0x2c8247,_0x3fd452);var _0x8dcd0c=[];_0x8dcd0c[_0xc6a3('0x5b')]({'model':db[_0xc6a3('0x5c')],'as':'User','attributes':['id',_0xc6a3('0x5d')],'raw':!![]});_0x8dcd0c[_0xc6a3('0x5b')]({'model':db['CmContact'],'as':_0xc6a3('0x5e'),'attributes':['id','firstName',_0xc6a3('0x5f')],'raw':!![]});if(_0x4e8ef2[_0xc6a3('0x25')][_0xc6a3('0x5a')]){_0x8dcd0c['push']({'model':db[_0xc6a3('0x60')],'as':'Attachment','raw':!![]});}var _0x2b31bd=[{'model':db[_0xc6a3('0x39')],'as':_0xc6a3('0x61'),'attributes':['id',_0xc6a3('0x35'),_0xc6a3('0x62'),_0xc6a3('0x63'),_0xc6a3('0x64'),'read'],'include':_0x8dcd0c}];_0x2b31bd[_0xc6a3('0x5b')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0xc6a3('0x1d')]});_0x2b31bd[_0xc6a3('0x5b')]({'model':db[_0xc6a3('0x5c')],'as':_0xc6a3('0x65'),'attributes':['id',_0xc6a3('0x5d')]});return db['WhatsappInteraction'][_0xc6a3('0x33')]({'where':{'id':_0x4e8ef2[_0xc6a3('0x36')]['id']},'include':_0x2b31bd})[_0xc6a3('0x1a')](handleEntityNotFound(_0x2f86f3,null))['then'](function(_0x4d1fd5){if(_0x4d1fd5){var _0x4c6ee9=_0x4d1fd5[_0xc6a3('0x66')]({'plain':!![]});fs[_0xc6a3('0x67')](_0x133cc5);var _0x23c0a2={'channel':'Whatsapp','account':_0x4c6ee9[_0xc6a3('0x68')][_0xc6a3('0x1d')],'agent':_0x4c6ee9['Owner']?_0x4c6ee9[_0xc6a3('0x65')][_0xc6a3('0x5d')]:_0xc6a3('0x69'),'createdAt':moment(_0x4c6ee9[_0xc6a3('0x62')])[_0xc6a3('0x47')](_0xc6a3('0x48'))['toString'](),'closedAt':_0x4c6ee9['closed']?moment(_0x4c6ee9[_0xc6a3('0x6a')])[_0xc6a3('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc6a3('0x6b')]():'','disposition':_0x4c6ee9[_0xc6a3('0x6c')],'messages':_(_0x4c6ee9[_0xc6a3('0x61')])[_0xc6a3('0x43')]({'secret':![]})[_0xc6a3('0x44')](function(_0x2346c4){if(_0x2346c4[_0xc6a3('0x60')]){var _0x28a627=path[_0xc6a3('0x55')](_0x43dda7,_0x2346c4[_0xc6a3('0x60')][_0xc6a3('0x6d')]);if(fs[_0xc6a3('0x6e')](_0x28a627)){fs[_0xc6a3('0x6f')](_0x28a627)['pipe'](fs[_0xc6a3('0x70')](path[_0xc6a3('0x55')](_0x133cc5,_0x2346c4[_0xc6a3('0x60')]['basename'])));}}return{'date':moment(_0x2346c4[_0xc6a3('0x62')])[_0xc6a3('0x47')](_0xc6a3('0x48'))[_0xc6a3('0x6b')](),'sender':_0x2346c4[_0xc6a3('0x63')]===_0xc6a3('0x71')?_0x2346c4[_0xc6a3('0x5c')]?_0x2346c4['User'][_0xc6a3('0x5d')]:_0xc6a3('0x72'):_0x2346c4[_0xc6a3('0x5e')][_0xc6a3('0x73')]+(_0x2346c4['Contact'][_0xc6a3('0x5f')]?'\x20'+_0x2346c4['Contact'][_0xc6a3('0x5f')]:''),'body':_0x2346c4['Attachment']?_0x2346c4[_0xc6a3('0x60')][_0xc6a3('0x6d')]:_0x2346c4['body'],'direction':_0x2346c4[_0xc6a3('0x63')]===_0xc6a3('0x71')?'A':'C','secret':_0x2346c4[_0xc6a3('0x64')],'read':_0x2346c4[_0xc6a3('0x74')],'attachment':_0x2346c4['Attachment']};})[_0xc6a3('0x75')]()};return ejs[_0xc6a3('0x76')](path['join'](config[_0xc6a3('0x56')],'server',_0xc6a3('0x77'),'downloadInteraction.ejs'),{'interaction':_0x23c0a2})['then'](function(_0x5c7a06){var _0x4e78a0=path['join'](_0x133cc5,_0xc6a3('0x78')+_0x4c6ee9['id']+'-'+_0x5c26c9+'.pdf');var _0x2c12f9={'path':_0x4e78a0,'channel':_0xc6a3('0x79'),'interactionId':_0x4c6ee9['id']};return pdf[_0xc6a3('0x7a')](_0x5c7a06,_0x2c12f9);})[_0xc6a3('0x1a')](function(){return new BPromise(function(_0x36012c,_0x3b55a1){zipdir(_0x133cc5,{'saveTo':_0xed93f5},function(_0x2db311,_0x181345){if(_0x2db311)return _0x3b55a1(_0x2db311);return _0x36012c(_0x181345);});})[_0xc6a3('0x1a')](function(){return new BPromise(function(_0x1fca2c,_0x3c07d3){rimraf(_0x133cc5,function(_0x5b7f44){if(_0x5b7f44)_0x3c07d3(_0x5b7f44);return _0x1fca2c();});});})['then'](function(){return _0x2f86f3[_0xc6a3('0x7b')](_0xed93f5,_0x3fd452,function(_0x813b73){if(_0x813b73){console[_0xc6a3('0x7c')](_0xc6a3('0x7d'),_0x813b73);}else{fs['unlinkSync'](_0xed93f5);}});});});}else{return _0x2f86f3['sendStatus'](0xc8);}})['catch'](handleError(_0x2f86f3,null));}; \ No newline at end of file +var _0xc177=['omit','spread','Tag','color','emit','removeTags','download','toString','join','root','tmp','server','files','attachments','format','transcript-%d-%s.zip','User','fullname','Contact','firstName','lastName','Attachment','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','get','Whatsapp','N.A.','closed','closedAt','disposition','Messages','basename','existsSync','pipe','createWriteStream','out','System','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','undefined','count','offset','limit','set','Content-Range','then','sendStatus','error','stack','name','send','map','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','findAll','whatsapp','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','destroy','WhatsappMessage','addMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags'];(function(_0x3db7f5,_0x5ac8b2){var _0x47d743=function(_0x68c0b9){while(--_0x68c0b9){_0x3db7f5['push'](_0x3db7f5['shift']());}};_0x47d743(++_0x5ac8b2);}(_0xc177,0x1b2));var _0x7c17=function(_0x4fbc69,_0x27a9e6){_0x4fbc69=_0x4fbc69-0x0;var _0x4fd5ae=_0xc177[_0x4fbc69];return _0x4fd5ae;};'use strict';var rimraf=require(_0x7c17('0x0'));var zipdir=require(_0x7c17('0x1'));var moment=require(_0x7c17('0x2'));var BPromise=require(_0x7c17('0x3'));var util=require(_0x7c17('0x4'));var path=require('path');var ejs=require(_0x7c17('0x5'));var fs=require('fs');var _=require(_0x7c17('0x6'));var Redis=require(_0x7c17('0x7'));var interaction=require(_0x7c17('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x7c17('0x9'));var logger=require(_0x7c17('0xa'))(_0x7c17('0xb'));var config=require('../../config/environment');var db=require(_0x7c17('0xc'))['db'];config[_0x7c17('0xd')]=_[_0x7c17('0xe')](config[_0x7c17('0xd')],{'host':_0x7c17('0xf'),'port':0x18eb});var socket=require(_0x7c17('0x10'))(new Redis(config[_0x7c17('0xd')]));require(_0x7c17('0x11'))[_0x7c17('0x12')](socket);function respondWithStatusCode(_0x39e320,_0x502793){_0x502793=_0x502793||0xcc;return function(_0x5ec150){if(_0x5ec150){return _0x39e320['sendStatus'](_0x502793);}return _0x39e320[_0x7c17('0x13')](_0x502793)[_0x7c17('0x14')]();};}function respondWithResult(_0x40cc08,_0x57a04c){_0x57a04c=_0x57a04c||0xc8;return function(_0xfcc2eb){if(_0xfcc2eb){return _0x40cc08[_0x7c17('0x13')](_0x57a04c)[_0x7c17('0x15')](_0xfcc2eb);}};}function respondWithFilteredResult(_0x5c7a1a,_0x57ae6e){return function(_0xf2412e){if(_0xf2412e){var _0x1220a8=typeof _0x57ae6e['offset']===_0x7c17('0x16')&&typeof _0x57ae6e['limit']===_0x7c17('0x16');var _0x5714b6=_0xf2412e[_0x7c17('0x17')];var _0x1e5997=_0x1220a8?0x0:_0x57ae6e[_0x7c17('0x18')];var _0x33f9cc=_0x1220a8?_0xf2412e[_0x7c17('0x17')]:_0x57ae6e[_0x7c17('0x18')]+_0x57ae6e[_0x7c17('0x19')];var _0x186812;if(_0x33f9cc>=_0x5714b6){_0x33f9cc=_0x5714b6;_0x186812=0xc8;}else{_0x186812=0xce;}_0x5c7a1a[_0x7c17('0x13')](_0x186812);return _0x5c7a1a[_0x7c17('0x1a')](_0x7c17('0x1b'),_0x1e5997+'-'+_0x33f9cc+'/'+_0x5714b6)[_0x7c17('0x15')](_0xf2412e);}return null;};}function saveUpdates(_0x2092b8){return function(_0x41440d){if(_0x41440d){return _0x41440d['update'](_0x2092b8)[_0x7c17('0x1c')](function(_0x302e4c){return _0x302e4c;});}return null;};}function removeEntity(_0x5df60d){return function(_0x291c5e){if(_0x291c5e){return _0x291c5e['destroy']()['then'](function(){_0x5df60d[_0x7c17('0x13')](0xcc)[_0x7c17('0x14')]();});}};}function handleEntityNotFound(_0x427e3a){return function(_0x5d5b75){if(!_0x5d5b75){_0x427e3a[_0x7c17('0x1d')](0x194);}return _0x5d5b75;};}function handleError(_0x26a134,_0x59c085){_0x59c085=_0x59c085||0x1f4;return function(_0x3ad6b9){logger[_0x7c17('0x1e')](_0x3ad6b9[_0x7c17('0x1f')]);if(_0x3ad6b9['name']){delete _0x3ad6b9[_0x7c17('0x20')];}_0x26a134[_0x7c17('0x13')](_0x59c085)[_0x7c17('0x21')](_0x3ad6b9);};}exports['index']=function(_0xa4f95e,_0x270130){var _0x50b041={};var _0x565e05=_[_0x7c17('0x22')](db[_0x7c17('0x23')][_0x7c17('0x24')],function(_0x36b5ed){return{'name':_0x36b5ed[_0x7c17('0x25')],'type':_0x36b5ed[_0x7c17('0x26')]['key']};});_0x50b041=qs[_0x7c17('0x27')](_0x565e05,_0xa4f95e);return interaction[_0x7c17('0x28')](_0x7c17('0x29'),_0xa4f95e[_0x7c17('0x2a')],_0xa4f95e[_0x7c17('0x2b')],_0x50b041,_0x565e05)[_0x7c17('0x1c')](respondWithFilteredResult(_0x270130,_0x50b041))[_0x7c17('0x2c')](handleError(_0x270130,null));};exports[_0x7c17('0x2d')]=function(_0x3a4a58,_0x3a2e61){var _0x4776cc={'raw':![],'where':{'id':_0x3a4a58[_0x7c17('0x2e')]['id']}},_0x4f40fb={};_0x4f40fb[_0x7c17('0x2f')]=_[_0x7c17('0x30')](db[_0x7c17('0x23')]['rawAttributes']);_0x4f40fb[_0x7c17('0x2a')]=_[_0x7c17('0x30')](_0x3a4a58['query']);_0x4f40fb[_0x7c17('0x31')]=_[_0x7c17('0x32')](_0x4f40fb[_0x7c17('0x2f')],_0x4f40fb['query']);_0x4776cc[_0x7c17('0x33')]=_['intersection'](_0x4f40fb[_0x7c17('0x2f')],qs[_0x7c17('0x34')](_0x3a4a58[_0x7c17('0x2a')][_0x7c17('0x34')]));_0x4776cc['attributes']=_0x4776cc[_0x7c17('0x33')][_0x7c17('0x35')]?_0x4776cc[_0x7c17('0x33')]:_0x4f40fb[_0x7c17('0x2f')];if(_0x3a4a58[_0x7c17('0x2a')][_0x7c17('0x36')]){_0x4776cc['include']=[{'all':!![]}];}_0x4776cc=_[_0x7c17('0x37')]({},_0x4776cc,_0x3a4a58[_0x7c17('0x38')]);return db['WhatsappInteraction'][_0x7c17('0x39')](_0x4776cc)[_0x7c17('0x1c')](handleEntityNotFound(_0x3a2e61,null))['then'](respondWithResult(_0x3a2e61,null))[_0x7c17('0x2c')](handleError(_0x3a2e61,null));};exports['create']=function(_0x423661,_0x35d249){return db[_0x7c17('0x23')]['create'](_0x423661[_0x7c17('0x3a')],{})[_0x7c17('0x1c')](respondWithResult(_0x35d249,0xc9))[_0x7c17('0x2c')](handleError(_0x35d249,null));};exports['update']=function(_0x502e36,_0x2f0afb){if(_0x502e36['body']['id']){delete _0x502e36[_0x7c17('0x3a')]['id'];}return db[_0x7c17('0x23')][_0x7c17('0x39')]({'where':{'id':_0x502e36['params']['id']}})[_0x7c17('0x1c')](handleEntityNotFound(_0x2f0afb,null))[_0x7c17('0x1c')](saveUpdates(_0x502e36[_0x7c17('0x3a')],null))[_0x7c17('0x1c')](respondWithResult(_0x2f0afb,null))[_0x7c17('0x2c')](handleError(_0x2f0afb,null));};exports[_0x7c17('0x3b')]=function(_0x47de27,_0x3fdda7){return db[_0x7c17('0x23')][_0x7c17('0x39')]({'where':{'id':_0x47de27[_0x7c17('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3fdda7,null))[_0x7c17('0x1c')](removeEntity(_0x3fdda7,null))[_0x7c17('0x2c')](handleError(_0x3fdda7,null));};exports['describe']=function(_0xf1a401,_0x563f2e){return db['WhatsappInteraction']['describe']()[_0x7c17('0x1c')](respondWithResult(_0x563f2e,null))[_0x7c17('0x2c')](handleError(_0x563f2e,null));};exports['addMessage']=function(_0x3fa415,_0x240bb7){return db[_0x7c17('0x3c')][_0x7c17('0x39')]({'where':{'id':_0x3fa415[_0x7c17('0x2e')]['id']}})[_0x7c17('0x1c')](handleEntityNotFound(_0x240bb7,null))[_0x7c17('0x1c')](function(_0x555237){if(_0x555237){return _0x555237[_0x7c17('0x3d')](_0x3fa415['body'][_0x7c17('0x3e')],_['omit'](_0x3fa415['body'],[_0x7c17('0x3e'),'id'])||{});}})['then'](respondWithResult(_0x240bb7,null))[_0x7c17('0x2c')](handleError(_0x240bb7,null));};exports[_0x7c17('0x3f')]=function(_0x185281,_0x218529){var _0x452f49={'raw':![],'where':{}};var _0x1d525a={};var _0x115c7c={'count':0x0,'rows':[]};return db[_0x7c17('0x23')][_0x7c17('0x40')]({'where':{'id':_0x185281[_0x7c17('0x2e')]['id']}})[_0x7c17('0x1c')](handleEntityNotFound(_0x218529,null))[_0x7c17('0x1c')](function(_0x45c5d9){if(_0x45c5d9){_0x1d525a[_0x7c17('0x2f')]=_[_0x7c17('0x30')](db['WhatsappMessage'][_0x7c17('0x24')]);_0x1d525a['query']=_[_0x7c17('0x30')](_0x185281[_0x7c17('0x2a')]);_0x1d525a['filters']=_['intersection'](_0x1d525a['model'],_0x1d525a[_0x7c17('0x2a')]);_0x452f49['attributes']=_['intersection'](_0x1d525a[_0x7c17('0x2f')],qs[_0x7c17('0x34')](_0x185281['query']['fields']));_0x452f49[_0x7c17('0x33')]=_0x452f49['attributes'][_0x7c17('0x35')]?_0x452f49[_0x7c17('0x33')]:_0x1d525a[_0x7c17('0x2f')];if(!_0x185281['query'][_0x7c17('0x41')](_0x7c17('0x42'))){_0x452f49[_0x7c17('0x19')]=qs['limit'](_0x185281[_0x7c17('0x2a')][_0x7c17('0x19')]);_0x452f49[_0x7c17('0x18')]=qs[_0x7c17('0x18')](_0x185281[_0x7c17('0x2a')]['offset']);}_0x452f49[_0x7c17('0x43')]=qs[_0x7c17('0x44')](_0x185281[_0x7c17('0x2a')][_0x7c17('0x44')]);_0x452f49[_0x7c17('0x45')]=qs[_0x7c17('0x31')](_[_0x7c17('0x46')](_0x185281[_0x7c17('0x2a')],_0x1d525a[_0x7c17('0x31')]));_0x452f49['where']['WhatsappInteractionId']=_0x45c5d9['id'];if(_0x185281[_0x7c17('0x2a')]['filter']){_0x452f49[_0x7c17('0x45')]=_['merge'](_0x452f49[_0x7c17('0x45')],{'$or':_[_0x7c17('0x22')](_0x452f49['attributes'],function(_0x53234f){var _0x18cab8={};_0x18cab8[_0x53234f]={'$like':'%'+_0x185281[_0x7c17('0x2a')][_0x7c17('0x47')]+'%'};return _0x18cab8;})});}if(_0x185281['query'][_0x7c17('0x48')]){var _0xcdb9de=_0x185281[_0x7c17('0x2a')][_0x7c17('0x48')][_0x7c17('0x49')](',');var _0x160d64={};_0x160d64[_0xcdb9de[0x0]]={'$gte':moment(_0xcdb9de[0x1])['format'](_0x7c17('0x4a'))};_0x452f49[_0x7c17('0x45')]=_[_0x7c17('0x37')](_0x452f49[_0x7c17('0x45')],_0x160d64);}_0x452f49=_[_0x7c17('0x37')]({},_0x452f49,_0x185281[_0x7c17('0x38')]);return db[_0x7c17('0x3c')]['count']({'where':_0x452f49[_0x7c17('0x45')]})['then'](function(_0x5d8970){_0x115c7c[_0x7c17('0x17')]=_0x5d8970;if(_0x185281[_0x7c17('0x2a')][_0x7c17('0x36')]){_0x452f49[_0x7c17('0x4b')]=[{'all':!![]}];}return db[_0x7c17('0x3c')][_0x7c17('0x28')](_0x452f49);})[_0x7c17('0x1c')](function(_0x32d3f2){_0x115c7c['rows']=_0x32d3f2;return _0x115c7c;});}})[_0x7c17('0x1c')](respondWithFilteredResult(_0x218529,_0x452f49))[_0x7c17('0x2c')](handleError(_0x218529,null));};exports[_0x7c17('0x4c')]=function(_0x495169,_0x3a8622){return db[_0x7c17('0x23')]['find']({'where':{'id':_0x495169[_0x7c17('0x2e')]['id']}})[_0x7c17('0x1c')](handleEntityNotFound(_0x3a8622,null))[_0x7c17('0x1c')](function(_0x517048){if(_0x517048){return _0x517048[_0x7c17('0x4d')](_0x495169[_0x7c17('0x3a')][_0x7c17('0x3e')],_[_0x7c17('0x4e')](_0x495169['body'],[_0x7c17('0x3e'),'id'])||{})[_0x7c17('0x4f')](function(){return db[_0x7c17('0x50')][_0x7c17('0x28')]({'attributes':['id',_0x7c17('0x20'),_0x7c17('0x51')],'where':{'id':_0x495169[_0x7c17('0x3a')][_0x7c17('0x3e')]}});})[_0x7c17('0x1c')](function(_0x322dc9){socket[_0x7c17('0x52')]('whatsappInteractionTags:save',{'id':Number(_0x495169['params']['id']),'tags':_0x322dc9||[]});return{'id':Number(_0x495169[_0x7c17('0x2e')]['id']),'tags':_0x322dc9||[]};});}})[_0x7c17('0x1c')](respondWithResult(_0x3a8622,null))['catch'](handleError(_0x3a8622,null));};exports[_0x7c17('0x53')]=function(_0x26a6d9,_0x39bfeb){return db[_0x7c17('0x23')]['find']({'where':{'id':_0x26a6d9[_0x7c17('0x2e')]['id']}})[_0x7c17('0x1c')](handleEntityNotFound(_0x39bfeb,null))[_0x7c17('0x1c')](function(_0x3b7cc6){if(_0x3b7cc6){return _0x3b7cc6['removeTags'](_0x26a6d9['query']['ids']);}})['then'](respondWithStatusCode(_0x39bfeb,null))[_0x7c17('0x2c')](handleError(_0x39bfeb,null));};exports[_0x7c17('0x54')]=function(_0x5dd1e3,_0x359028){var _0xd582d3=moment()['unix']()[_0x7c17('0x55')]();var _0x4daff5=path[_0x7c17('0x56')](config[_0x7c17('0x57')],'server','files',_0x7c17('0x58'));var _0x9d66f=path[_0x7c17('0x56')](config[_0x7c17('0x57')],_0x7c17('0x59'),_0x7c17('0x5a'),_0x7c17('0x5b'));var _0x7aec57=path[_0x7c17('0x56')](_0x4daff5,_0xd582d3);var _0x2192a6=util[_0x7c17('0x5c')](_0x7c17('0x5d'),_0x5dd1e3[_0x7c17('0x2e')]['id'],_0xd582d3);var _0x7b3bc0=path['join'](_0x4daff5,_0x2192a6);var _0x4c81f8=[];_0x4c81f8['push']({'model':db[_0x7c17('0x5e')],'as':_0x7c17('0x5e'),'attributes':['id',_0x7c17('0x5f')],'raw':!![]});_0x4c81f8['push']({'model':db['CmContact'],'as':_0x7c17('0x60'),'attributes':['id',_0x7c17('0x61'),_0x7c17('0x62')],'raw':!![]});if(_0x5dd1e3[_0x7c17('0x2a')]['attachments']){_0x4c81f8['push']({'model':db[_0x7c17('0x63')],'as':'Attachment','raw':!![]});}var _0x759546=[{'model':db[_0x7c17('0x3c')],'as':'Messages','attributes':['id',_0x7c17('0x3a'),_0x7c17('0x64'),_0x7c17('0x65'),_0x7c17('0x66'),_0x7c17('0x67')],'include':_0x4c81f8}];_0x759546['push']({'model':db[_0x7c17('0x68')],'as':_0x7c17('0x69'),'attributes':['id',_0x7c17('0x20')]});_0x759546['push']({'model':db[_0x7c17('0x5e')],'as':_0x7c17('0x6a'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0x7c17('0x39')]({'where':{'id':_0x5dd1e3['params']['id']},'include':_0x759546})[_0x7c17('0x1c')](handleEntityNotFound(_0x359028,null))[_0x7c17('0x1c')](function(_0x520086){if(_0x520086){var _0x1fb144=_0x520086[_0x7c17('0x6b')]({'plain':!![]});fs['mkdirSync'](_0x7aec57);var _0x241371={'channel':_0x7c17('0x6c'),'account':_0x1fb144[_0x7c17('0x69')]['name'],'agent':_0x1fb144[_0x7c17('0x6a')]?_0x1fb144[_0x7c17('0x6a')][_0x7c17('0x5f')]:_0x7c17('0x6d'),'createdAt':moment(_0x1fb144[_0x7c17('0x64')])['format'](_0x7c17('0x4a'))[_0x7c17('0x55')](),'closedAt':_0x1fb144[_0x7c17('0x6e')]?moment(_0x1fb144[_0x7c17('0x6f')])[_0x7c17('0x5c')](_0x7c17('0x4a'))[_0x7c17('0x55')]():'','disposition':_0x1fb144[_0x7c17('0x70')],'messages':_(_0x1fb144[_0x7c17('0x71')])[_0x7c17('0x47')]({'secret':![]})[_0x7c17('0x22')](function(_0x57312d){if(_0x57312d[_0x7c17('0x63')]){var _0x384e0f=path[_0x7c17('0x56')](_0x9d66f,_0x57312d['Attachment'][_0x7c17('0x72')]);if(fs[_0x7c17('0x73')](_0x384e0f)){fs['createReadStream'](_0x384e0f)[_0x7c17('0x74')](fs[_0x7c17('0x75')](path['join'](_0x7aec57,_0x57312d['Attachment'][_0x7c17('0x72')])));}}return{'date':moment(_0x57312d[_0x7c17('0x64')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7c17('0x55')](),'sender':_0x57312d['direction']===_0x7c17('0x76')?_0x57312d[_0x7c17('0x5e')]?_0x57312d['User'][_0x7c17('0x5f')]:_0x7c17('0x77'):_0x57312d[_0x7c17('0x60')][_0x7c17('0x61')]+(_0x57312d[_0x7c17('0x60')][_0x7c17('0x62')]?'\x20'+_0x57312d[_0x7c17('0x60')][_0x7c17('0x62')]:''),'body':_0x57312d[_0x7c17('0x63')]?_0x57312d['Attachment'][_0x7c17('0x72')]:_0x57312d['body'],'direction':_0x57312d[_0x7c17('0x65')]==='out'?'A':'C','secret':_0x57312d[_0x7c17('0x66')],'read':_0x57312d[_0x7c17('0x67')],'attachment':_0x57312d[_0x7c17('0x63')]};})['value']()};return ejs[_0x7c17('0x78')](path[_0x7c17('0x56')](config[_0x7c17('0x57')],_0x7c17('0x59'),_0x7c17('0x79'),'downloadInteraction.ejs'),{'interaction':_0x241371})['then'](function(_0x1e32b7){var _0x1177df=path[_0x7c17('0x56')](_0x7aec57,_0x7c17('0x7a')+_0x1fb144['id']+'-'+_0xd582d3+_0x7c17('0x7b'));var _0x315000={'path':_0x1177df,'channel':_0x7c17('0x6c'),'interactionId':_0x1fb144['id']};return pdf[_0x7c17('0x7c')](_0x1e32b7,_0x315000);})[_0x7c17('0x1c')](function(){return new BPromise(function(_0x25e76b,_0x10bae9){zipdir(_0x7aec57,{'saveTo':_0x7b3bc0},function(_0x13b7d4,_0x3d6a92){if(_0x13b7d4)return _0x10bae9(_0x13b7d4);return _0x25e76b(_0x3d6a92);});})[_0x7c17('0x1c')](function(){return new BPromise(function(_0x267c33,_0x25b690){rimraf(_0x7aec57,function(_0x1d6617){if(_0x1d6617)_0x25b690(_0x1d6617);return _0x267c33();});});})[_0x7c17('0x1c')](function(){return _0x359028['download'](_0x7b3bc0,_0x2192a6,function(_0x2411b1){if(_0x2411b1){console[_0x7c17('0x7d')](_0x7c17('0x7e'),_0x2411b1);}else{fs[_0x7c17('0x7f')](_0x7b3bc0);}});});});}else{return _0x359028[_0x7c17('0x1d')](0xc8);}})[_0x7c17('0x2c')](handleError(_0x359028,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index d9388a6..eeaffd4 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 _0x851d=['emit','catch','exports','events','WhatsappInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','length'];(function(_0x181dfe,_0xf84557){var _0x40c38f=function(_0x3aa818){while(--_0x3aa818){_0x181dfe['push'](_0x181dfe['shift']());}};_0x40c38f(++_0xf84557);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd851('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xd851('0x1')];var WhatsappMessage=require(_0xd851('0x2'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xd851('0x3')](0x0);var events={'afterCreate':_0xd851('0x4'),'afterUpdate':_0xd851('0x5'),'afterDestroy':_0xd851('0x6')};function emitEvent(_0x36eb20){return function(_0x456821,_0x4812ec,_0x578809){_0x456821[_0xd851('0x7')]({'attributes':['id'],'raw':!![]})[_0xd851('0x8')](function(_0x3d2383){_0x456821[_0xd851('0x9')](_0xd851('0xa'),_0x3d2383[_0xd851('0xb')](function(_0x599973){return{'id':_0x599973['id']};}));return WhatsappMessage[_0xd851('0xc')]({'where':{'WhatsappInteractionId':_0x456821['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x33e66a){_0x456821[_0xd851('0x9')]('unreadMessages',_0x33e66a[_0xd851('0xd')]);WhatsappInteractionEvents[_0xd851('0xe')](_0x36eb20+':'+_0x456821['id'],_0x456821);WhatsappInteractionEvents[_0xd851('0xe')](_0x36eb20,_0x456821);_0x578809(null);})[_0xd851('0xf')](_0x578809(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xd851('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x4ffe=['hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','remove','then','setDataValue','Users','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x422a2d,_0x39a07c){var _0x3bda42=function(_0x5ad425){while(--_0x5ad425){_0x422a2d['push'](_0x422a2d['shift']());}};_0x3bda42(++_0x39a07c);}(_0x4ffe,0x172));var _0xe4ff=function(_0x26f866,_0x1900bc){_0x26f866=_0x26f866-0x0;var _0x1abef3=_0x4ffe[_0x26f866];return _0x1abef3;};'use strict';var EventEmitter=require(_0xe4ff('0x0'));var WhatsappInteraction=require(_0xe4ff('0x1'))['db'][_0xe4ff('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0xe4ff('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xe4ff('0x4')](0x0);var events={'afterCreate':_0xe4ff('0x5'),'afterUpdate':'update','afterDestroy':_0xe4ff('0x6')};function emitEvent(_0x2621fc){return function(_0x1397e1,_0x33a19a,_0x68c0c7){_0x1397e1['getUsers']({'attributes':['id'],'raw':!![]})[_0xe4ff('0x7')](function(_0x455874){_0x1397e1[_0xe4ff('0x8')](_0xe4ff('0x9'),_0x455874['map'](function(_0x4718d9){return{'id':_0x4718d9['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x1397e1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe4ff('0x7')](function(_0x188173){_0x1397e1[_0xe4ff('0x8')](_0xe4ff('0xa'),_0x188173['length']);WhatsappInteractionEvents['emit'](_0x2621fc+':'+_0x1397e1['id'],_0x1397e1);WhatsappInteractionEvents[_0xe4ff('0xb')](_0x2621fc,_0x1397e1);_0x68c0c7(null);})[_0xe4ff('0xc')](_0x68c0c7(null));};}for(var e in events){if(events[_0xe4ff('0xd')](e)){var event=events[e];WhatsappInteraction[_0xe4ff('0xe')](e,emitEvent(event));}}module[_0xe4ff('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index c77da19..f286234 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 _0xecaa=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment'];(function(_0x7d6eb8,_0x1b15ce){var _0x523e61=function(_0x2cbe6a){while(--_0x2cbe6a){_0x7d6eb8['push'](_0x7d6eb8['shift']());}};_0x523e61(++_0x1b15ce);}(_0xecaa,0x173));var _0xaeca=function(_0x4b0fea,_0x296e0b){_0x4b0fea=_0x4b0fea-0x0;var _0x2db8b0=_0xecaa[_0x4b0fea];return _0x2db8b0;};'use strict';var _=require('lodash');var util=require(_0xaeca('0x0'));var logger=require(_0xaeca('0x1'))(_0xaeca('0x2'));var moment=require(_0xaeca('0x3'));var BPromise=require(_0xaeca('0x4'));var rp=require(_0xaeca('0x5'));var fs=require('fs');var path=require(_0xaeca('0x6'));var rimraf=require(_0xaeca('0x7'));var config=require(_0xaeca('0x8'));var attributes=require(_0xaeca('0x9'));module[_0xaeca('0xa')]=function(_0x414542,_0x2039c9){return _0x414542[_0xaeca('0xb')](_0xaeca('0xc'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a8e5c,_0x30d6fb,_0x11ee86){if(_0x5a8e5c['changed']('closed')){_0x5a8e5c[_0xaeca('0xd')]=moment()['format'](_0xaeca('0xe'));}_0x11ee86(null,_0x5a8e5c);}}});}; \ No newline at end of file +var _0xc487=['whatsapp_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction'];(function(_0xc905bf,_0x3fb45d){var _0x3ffd14=function(_0x3d3d02){while(--_0x3d3d02){_0xc905bf['push'](_0xc905bf['shift']());}};_0x3ffd14(++_0x3fb45d);}(_0xc487,0x6b));var _0x7c48=function(_0x502256,_0x19a90){_0x502256=_0x502256-0x0;var _0x2dfb66=_0xc487[_0x502256];return _0x2dfb66;};'use strict';var _=require('lodash');var util=require(_0x7c48('0x0'));var logger=require(_0x7c48('0x1'))(_0x7c48('0x2'));var moment=require(_0x7c48('0x3'));var BPromise=require(_0x7c48('0x4'));var rp=require(_0x7c48('0x5'));var fs=require('fs');var path=require(_0x7c48('0x6'));var rimraf=require(_0x7c48('0x7'));var config=require(_0x7c48('0x8'));var attributes=require(_0x7c48('0x9'));module[_0x7c48('0xa')]=function(_0x42eb60,_0x76162){return _0x42eb60['define'](_0x7c48('0xb'),attributes,{'tableName':_0x7c48('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x205cd2,_0x553e9e,_0x3ce554){if(_0x205cd2[_0x7c48('0xd')]('closed')){_0x205cd2[_0x7c48('0xe')]=moment()[_0x7c48('0xf')](_0x7c48('0x10'));}_0x3ce554(null,_0x205cd2);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index b43758f..6ca248f 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 _0x46e6=['ids','omit','spread','AddTags','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','addTags'];(function(_0x4f51b9,_0x57bffa){var _0x4127e=function(_0xc8c19){while(--_0xc8c19){_0x4f51b9['push'](_0x4f51b9['shift']());}};_0x4127e(++_0x57bffa);}(_0x46e6,0x154));var _0x646e=function(_0x23e88b,_0x17737f){_0x23e88b=_0x23e88b-0x0;var _0x35db96=_0x46e6[_0x23e88b];return _0x35db96;};'use strict';var _=require(_0x646e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x646e('0x1'));var fs=require('fs');var Redis=require(_0x646e('0x2'));var db=require(_0x646e('0x3'))['db'];var utils=require(_0x646e('0x4'));var logger=require(_0x646e('0x5'))(_0x646e('0x6'));var config=require('../../config/environment');var jayson=require(_0x646e('0x7'));var client=jayson[_0x646e('0x8')][_0x646e('0x9')]({'port':0x232a});config[_0x646e('0xa')]=_[_0x646e('0xb')](config[_0x646e('0xa')],{'host':_0x646e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x646e('0xa')]));require(_0x646e('0xd'))[_0x646e('0xe')](socket);function respondWithRpcPromise(_0xe50a8a,_0x56941b,_0x23c2a3){return new BPromise(function(_0xf282ea,_0x48871b){return client[_0x646e('0xf')](_0xe50a8a,_0x23c2a3)[_0x646e('0x10')](function(_0x139f6f){logger[_0x646e('0x11')](_0x646e('0x12'),_0x56941b,_0x646e('0x13'));logger[_0x646e('0x14')](_0x646e('0x15'),_0x56941b,_0x646e('0x13'),JSON[_0x646e('0x16')](_0x139f6f));if(_0x139f6f[_0x646e('0x17')]){if(_0x139f6f['error']['code']===0x1f4){logger['error'](_0x646e('0x12'),_0x56941b,_0x139f6f[_0x646e('0x17')]['message']);return _0x48871b(_0x139f6f[_0x646e('0x17')][_0x646e('0x18')]);}logger[_0x646e('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x56941b,_0x139f6f[_0x646e('0x17')]['message']);return _0xf282ea(_0x139f6f[_0x646e('0x17')][_0x646e('0x18')]);}else{logger['info'](_0x646e('0x12'),_0x56941b,_0x646e('0x13'));_0xf282ea(_0x139f6f[_0x646e('0x19')]['message']);}})[_0x646e('0x1a')](function(_0x70641b){logger[_0x646e('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x56941b,_0x70641b);_0x48871b(_0x70641b);});});}exports[_0x646e('0x1b')]=function(_0x35180a){var _0xd7c2be=this;return new Promise(function(_0xf8193e,_0x611eab){return db[_0x646e('0x1c')]['update'](_0x35180a[_0x646e('0x1d')],{'raw':_0x35180a[_0x646e('0x1e')]?_0x35180a['options'][_0x646e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35180a[_0x646e('0x1e')]?_0x35180a[_0x646e('0x1e')][_0x646e('0x20')]||null:null,'attributes':_0x35180a[_0x646e('0x1e')]?_0x35180a['options'][_0x646e('0x21')]||null:null,'limit':_0x35180a['options']?_0x35180a[_0x646e('0x1e')][_0x646e('0x22')]||null:null})[_0x646e('0x10')](function(_0x3ca3ac){logger['info'](_0x646e('0x1b'),_0x35180a);logger['debug'](_0x646e('0x1b'),_0x35180a,JSON[_0x646e('0x16')](_0x3ca3ac));_0xf8193e(_0x3ca3ac);})[_0x646e('0x1a')](function(_0x5648d6){logger[_0x646e('0x17')](_0x646e('0x1b'),_0x5648d6['message'],_0x35180a);_0x611eab(_0xd7c2be[_0x646e('0x17')](0x1f4,_0x5648d6['message']));});});};exports[_0x646e('0x23')]=function(_0x33ac7c){return new Promise(function(_0x4dc7d6,_0x2f5875){return db['WhatsappInteraction'][_0x646e('0x24')]({'where':_0x33ac7c[_0x646e('0x1e')]?_0x33ac7c[_0x646e('0x1e')]['where']||null:null})[_0x646e('0x10')](function(_0x28bab6){if(_0x28bab6){return _0x28bab6[_0x646e('0x25')](_0x33ac7c['body'][_0x646e('0x26')],_[_0x646e('0x27')](_0x33ac7c[_0x646e('0x1d')],[_0x646e('0x26'),'id'])||{});}})[_0x646e('0x28')](function(_0x101d64){logger['info']('AddTags',_0x33ac7c);logger[_0x646e('0x14')]('AddTags',_0x33ac7c,JSON[_0x646e('0x16')](_0x101d64));_0x4dc7d6(_0x101d64);})['catch'](function(_0x3743a9){logger[_0x646e('0x17')](_0x646e('0x29'),_0x3743a9[_0x646e('0x18')],_0x33ac7c);_0x2f5875(_this[_0x646e('0x17')](0x1f4,_0x3743a9[_0x646e('0x18')]));});});}; \ No newline at end of file +var _0xc97f=['find','body','omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappInteraction','update','options','raw','where','attributes','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction'];(function(_0x2b5c18,_0x21c121){var _0x4e546b=function(_0x53d593){while(--_0x53d593){_0x2b5c18['push'](_0x2b5c18['shift']());}};_0x4e546b(++_0x21c121);}(_0xc97f,0x107));var _0xfc97=function(_0x1d3e26,_0x468839){_0x1d3e26=_0x1d3e26-0x0;var _0x26f484=_0xc97f[_0x1d3e26];return _0x26f484;};'use strict';var _=require(_0xfc97('0x0'));var util=require(_0xfc97('0x1'));var moment=require(_0xfc97('0x2'));var BPromise=require('bluebird');var rs=require(_0xfc97('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc97('0x4'))['db'];var utils=require(_0xfc97('0x5'));var logger=require(_0xfc97('0x6'))(_0xfc97('0x7'));var config=require(_0xfc97('0x8'));var jayson=require(_0xfc97('0x9'));var client=jayson[_0xfc97('0xa')]['http']({'port':0x232a});config['redis']=_[_0xfc97('0xb')](config['redis'],{'host':_0xfc97('0xc'),'port':0x18eb});var socket=require(_0xfc97('0xd'))(new Redis(config[_0xfc97('0xe')]));require(_0xfc97('0xf'))[_0xfc97('0x10')](socket);function respondWithRpcPromise(_0x4642db,_0x3f5006,_0x5699ba){return new BPromise(function(_0x2136e3,_0x242ccd){return client[_0xfc97('0x11')](_0x4642db,_0x5699ba)[_0xfc97('0x12')](function(_0x255ede){logger[_0xfc97('0x13')](_0xfc97('0x14'),_0x3f5006,_0xfc97('0x15'));logger[_0xfc97('0x16')](_0xfc97('0x17'),_0x3f5006,'request\x20sent',JSON[_0xfc97('0x18')](_0x255ede));if(_0x255ede[_0xfc97('0x19')]){if(_0x255ede['error'][_0xfc97('0x1a')]===0x1f4){logger[_0xfc97('0x19')]('WhatsappInteraction,\x20%s,\x20%s',_0x3f5006,_0x255ede['error'][_0xfc97('0x1b')]);return _0x242ccd(_0x255ede['error'][_0xfc97('0x1b')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x3f5006,_0x255ede[_0xfc97('0x19')]['message']);return _0x2136e3(_0x255ede[_0xfc97('0x19')][_0xfc97('0x1b')]);}else{logger['info'](_0xfc97('0x14'),_0x3f5006,_0xfc97('0x15'));_0x2136e3(_0x255ede[_0xfc97('0x1c')]['message']);}})[_0xfc97('0x1d')](function(_0x3c2239){logger[_0xfc97('0x19')](_0xfc97('0x14'),_0x3f5006,_0x3c2239);_0x242ccd(_0x3c2239);});});}exports['UpdateWhatsappInteraction']=function(_0x5291ef){var _0x5f21cc=this;return new Promise(function(_0x5c32cf,_0x431016){return db[_0xfc97('0x1e')][_0xfc97('0x1f')](_0x5291ef['body'],{'raw':_0x5291ef[_0xfc97('0x20')]?_0x5291ef[_0xfc97('0x20')][_0xfc97('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5291ef[_0xfc97('0x20')]?_0x5291ef[_0xfc97('0x20')][_0xfc97('0x22')]||null:null,'attributes':_0x5291ef[_0xfc97('0x20')]?_0x5291ef[_0xfc97('0x20')][_0xfc97('0x23')]||null:null,'limit':_0x5291ef[_0xfc97('0x20')]?_0x5291ef['options']['limit']||null:null})[_0xfc97('0x12')](function(_0xce1e94){logger[_0xfc97('0x13')](_0xfc97('0x24'),_0x5291ef);logger['debug']('UpdateWhatsappInteraction',_0x5291ef,JSON['stringify'](_0xce1e94));_0x5c32cf(_0xce1e94);})[_0xfc97('0x1d')](function(_0x59c62e){logger[_0xfc97('0x19')](_0xfc97('0x24'),_0x59c62e['message'],_0x5291ef);_0x431016(_0x5f21cc[_0xfc97('0x19')](0x1f4,_0x59c62e['message']));});});};exports[_0xfc97('0x25')]=function(_0x5aec19){return new Promise(function(_0x1649ab,_0x4c8c21){return db[_0xfc97('0x1e')][_0xfc97('0x26')]({'where':_0x5aec19[_0xfc97('0x20')]?_0x5aec19[_0xfc97('0x20')][_0xfc97('0x22')]||null:null})[_0xfc97('0x12')](function(_0x19a732){if(_0x19a732){return _0x19a732['addTags'](_0x5aec19[_0xfc97('0x27')]['ids'],_[_0xfc97('0x28')](_0x5aec19['body'],['ids','id'])||{});}})[_0xfc97('0x29')](function(_0x220409){logger[_0xfc97('0x13')](_0xfc97('0x2a'),_0x5aec19);logger['debug'](_0xfc97('0x2a'),_0x5aec19,JSON[_0xfc97('0x18')](_0x220409));_0x1649ab(_0x220409);})[_0xfc97('0x1d')](function(_0x3346c5){logger['error'](_0xfc97('0x2a'),_0x3346c5[_0xfc97('0x1b')],_0x5aec19);_0x4c8c21(_this[_0xfc97('0x19')](0x1f4,_0x3346c5[_0xfc97('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 0264328..4fb4b3d 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 _0xdef0=['whatsappInteraction:','./whatsappInteraction.events','save','remove','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdef0,0xa6));var _0x0def=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdef0[_0x2dafbe];return _0x58a45a;};'use strict';var WhatsappInteractionEvents=require(_0x0def('0x0'));var events=[_0x0def('0x1'),_0x0def('0x2'),'update'];function createListener(_0x3f8928,_0x1aaa7a){return function(_0x32c324){_0x1aaa7a['emit'](_0x3f8928,_0x32c324);};}function removeListener(_0x2387a8,_0x1b160d){return function(){WhatsappInteractionEvents[_0x0def('0x3')](_0x2387a8,_0x1b160d);};}exports['register']=function(_0x76de58){for(var _0x59d2c7=0x0,_0x382b9f=events['length'];_0x59d2c7<_0x382b9f;_0x59d2c7++){var _0x2f4a66=events[_0x59d2c7];var _0x739651=createListener(_0x0def('0x4')+_0x2f4a66,_0x76de58);WhatsappInteractionEvents['on'](_0x2f4a66,_0x739651);}}; \ No newline at end of file +var _0x02da=['whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x3b4f00,_0x410318){var _0x1aa7cc=function(_0x8e60a2){while(--_0x8e60a2){_0x3b4f00['push'](_0x3b4f00['shift']());}};_0x1aa7cc(++_0x410318);}(_0x02da,0x179));var _0xa02d=function(_0x42c5db,_0x52b16a){_0x42c5db=_0x42c5db-0x0;var _0x488617=_0x02da[_0x42c5db];return _0x488617;};'use strict';var WhatsappInteractionEvents=require(_0xa02d('0x0'));var events=[_0xa02d('0x1'),_0xa02d('0x2'),_0xa02d('0x3')];function createListener(_0x963322,_0x2d6b20){return function(_0x1dee27){_0x2d6b20[_0xa02d('0x4')](_0x963322,_0x1dee27);};}function removeListener(_0x1a3211,_0x281b23){return function(){WhatsappInteractionEvents[_0xa02d('0x5')](_0x1a3211,_0x281b23);};}exports[_0xa02d('0x6')]=function(_0x5ef3c3){for(var _0x3df04a=0x0,_0x38b885=events['length'];_0x3df04a<_0x38b885;_0x3df04a++){var _0x26b34e=events[_0x3df04a];var _0x3de2d7=createListener(_0xa02d('0x7')+_0x26b34e,_0x5ef3c3);WhatsappInteractionEvents['on'](_0x26b34e,_0x3de2d7);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index f740c1b..4341c75 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 _0x9839=['whatsappmessage:create','/:id/status','status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','whatsapp'];(function(_0x33eb16,_0x59dd1d){var _0x54387a=function(_0x3ca190){while(--_0x3ca190){_0x33eb16['push'](_0x33eb16['shift']());}};_0x54387a(++_0x59dd1d);}(_0x9839,0xea));var _0x9983=function(_0x4dba8a,_0x1b7347){_0x4dba8a=_0x4dba8a-0x0;var _0x14cee4=_0x9839[_0x4dba8a];return _0x14cee4;};'use strict';var multer=require(_0x9983('0x0'));var util=require(_0x9983('0x1'));var path=require(_0x9983('0x2'));var timeout=require(_0x9983('0x3'));var express=require(_0x9983('0x4'));var router=express[_0x9983('0x5')]();var fs_extra=require(_0x9983('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9983('0x7'));var config=require('../../config/environment');var controller=require(_0x9983('0x8'));router[_0x9983('0x9')]('/',auth[_0x9983('0xa')](),controller[_0x9983('0xb')]);router[_0x9983('0x9')]('/describe',auth[_0x9983('0xa')](),controller[_0x9983('0xc')]);router[_0x9983('0x9')](_0x9983('0xd'),auth[_0x9983('0xa')](),controller[_0x9983('0xe')]);router[_0x9983('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9983('0x10')](_0x9983('0x11'),_0x9983('0x12')),controller['create']);router[_0x9983('0xf')](_0x9983('0x13'),controller[_0x9983('0x14')]);router[_0x9983('0x15')](_0x9983('0xd'),auth[_0x9983('0xa')](),controller['update']);router[_0x9983('0x15')](_0x9983('0x16'),auth[_0x9983('0xa')](),controller[_0x9983('0x17')]);router[_0x9983('0x15')](_0x9983('0x18'),auth[_0x9983('0xa')](),controller[_0x9983('0x19')]);router[_0x9983('0x1a')](_0x9983('0xd'),auth['isAuthenticated'](),controller[_0x9983('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x3055=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path'];(function(_0x35137d,_0x23348e){var _0x3dcdab=function(_0x18a124){while(--_0x18a124){_0x35137d['push'](_0x35137d['shift']());}};_0x3dcdab(++_0x23348e);}(_0x3055,0x171));var _0x5305=function(_0x57c666,_0xbde7c8){_0x57c666=_0x57c666-0x0;var _0x10ee1c=_0x3055[_0x57c666];return _0x10ee1c;};'use strict';var multer=require(_0x5305('0x0'));var util=require(_0x5305('0x1'));var path=require(_0x5305('0x2'));var timeout=require(_0x5305('0x3'));var express=require('express');var router=express[_0x5305('0x4')]();var fs_extra=require(_0x5305('0x5'));var auth=require(_0x5305('0x6'));var interaction=require(_0x5305('0x7'));var config=require(_0x5305('0x8'));var controller=require(_0x5305('0x9'));router[_0x5305('0xa')]('/',auth[_0x5305('0xb')](),controller[_0x5305('0xc')]);router[_0x5305('0xa')](_0x5305('0xd'),auth[_0x5305('0xb')](),controller[_0x5305('0xe')]);router['get'](_0x5305('0xf'),auth[_0x5305('0xb')](),controller[_0x5305('0x10')]);router[_0x5305('0x11')]('/',auth[_0x5305('0xb')](),interaction[_0x5305('0x12')]('whatsapp',_0x5305('0x13')),controller[_0x5305('0x14')]);router[_0x5305('0x11')](_0x5305('0x15'),controller[_0x5305('0x16')]);router[_0x5305('0x17')](_0x5305('0xf'),auth[_0x5305('0xb')](),controller[_0x5305('0x18')]);router[_0x5305('0x17')](_0x5305('0x19'),auth[_0x5305('0xb')](),controller[_0x5305('0x1a')]);router[_0x5305('0x17')](_0x5305('0x1b'),auth[_0x5305('0xb')](),controller[_0x5305('0x1c')]);router[_0x5305('0x1d')](_0x5305('0xf'),auth['isAuthenticated'](),controller[_0x5305('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 696c4b4..e6e103d 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 _0x9664=['BOOLEAN','ENUM','out','STRING','DATE','TEXT','sequelize','medium'];(function(_0x584291,_0x24b5b3){var _0x4e7d08=function(_0x59e0b1){while(--_0x59e0b1){_0x584291['push'](_0x584291['shift']());}};_0x4e7d08(++_0x24b5b3);}(_0x9664,0x126));var _0x4966=function(_0x5a06d9,_0x17e4ff){_0x5a06d9=_0x5a06d9-0x0;var _0x5ee5bf=_0x9664[_0x5a06d9];return _0x5ee5bf;};'use strict';var Sequelize=require(_0x4966('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x4966('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x4966('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4966('0x3')]('in',_0x4966('0x4')),'defaultValue':_0x4966('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4966('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x4966('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4966('0x5')]},'providerResponse':{'type':Sequelize[_0x4966('0x7')]}}; \ No newline at end of file +var _0x30ea=['medium','ENUM','out','STRING','DATE','BOOLEAN','TEXT'];(function(_0x8eb552,_0x4b95b3){var _0x52597a=function(_0x42a963){while(--_0x42a963){_0x8eb552['push'](_0x8eb552['shift']());}};_0x52597a(++_0x4b95b3);}(_0x30ea,0x13a));var _0xa30e=function(_0x486100,_0x2dbdef){_0x486100=_0x486100-0x0;var _0x5eb54=_0x30ea[_0x486100];return _0x5eb54;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xa30e('0x0')](_0xa30e('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa30e('0x2')]('in',_0xa30e('0x3')),'defaultValue':_0xa30e('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xa30e('0x4')]},'readAt':{'type':Sequelize[_0xa30e('0x5')]},'secret':{'type':Sequelize[_0xa30e('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa30e('0x4')]},'providerResponse':{'type':Sequelize[_0xa30e('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index ed55854..703a7fe 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 _0x61c3=['format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','[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','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','fullname','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','destroy','stack','name','send','index','map','WhatsappMessage','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','update','body','describe','accept','whatsapp','read','readAt'];(function(_0x3b2293,_0x298937){var _0x3820cd=function(_0x431035){while(--_0x431035){_0x3b2293['push'](_0x3b2293['shift']());}};_0x3820cd(++_0x298937);}(_0x61c3,0xb7));var _0x361c=function(_0x3d6c41,_0x599e83){_0x3d6c41=_0x3d6c41-0x0;var _0x9e5b0e=_0x61c3[_0x3d6c41];return _0x9e5b0e;};'use strict';var emlformat=require(_0x361c('0x0'));var rimraf=require(_0x361c('0x1'));var zipdir=require(_0x361c('0x2'));var jsonpatch=require(_0x361c('0x3'));var rp=require('request-promise');var moment=require(_0x361c('0x4'));var BPromise=require(_0x361c('0x5'));var Mustache=require('mustache');var util=require(_0x361c('0x6'));var path=require(_0x361c('0x7'));var sox=require(_0x361c('0x8'));var csv=require(_0x361c('0x9'));var ejs=require(_0x361c('0xa'));var fs=require('fs');var fs_extra=require(_0x361c('0xb'));var _=require(_0x361c('0xc'));var squel=require(_0x361c('0xd'));var crypto=require(_0x361c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x361c('0x9'));var querystring=require('querystring');var Papa=require(_0x361c('0xf'));var Redis=require('ioredis');var authService=require(_0x361c('0x10'));var qs=require(_0x361c('0x11'));var as=require(_0x361c('0x12'));var hardwareService=require(_0x361c('0x13'));var logger=require(_0x361c('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x361c('0x15'));var db=require(_0x361c('0x16'))['db'];config[_0x361c('0x17')]=_['defaults'](config[_0x361c('0x17')],{'host':_0x361c('0x18'),'port':0x18eb});var socket=require(_0x361c('0x19'))(new Redis(config[_0x361c('0x17')]));require('./whatsappMessage.socket')[_0x361c('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x361c('0x1b')][_0x361c('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x361c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x446750,_0x583547,_0x365adb,_0xf0367b){return new BPromise(function(_0x3a1482,_0x132e24){var _0x122106=_0xf0367b||client;return _0x122106['request'](_0x446750,_0x365adb)[_0x361c('0x1d')](function(_0xfe080){logger[_0x361c('0x1e')](_0x361c('0x1f'),_0x583547,_0x361c('0x20'));logger[_0x361c('0x21')](_0x361c('0x22'),_0x583547,_0x361c('0x20'),JSON[_0x361c('0x23')](_0xfe080));if(_0xfe080[_0x361c('0x24')]){if(_0xfe080[_0x361c('0x24')][_0x361c('0x25')]===0x1f4){logger['error'](_0x361c('0x1f'),_0x583547,_0xfe080[_0x361c('0x24')]['message']);return _0x132e24(_0xfe080[_0x361c('0x24')][_0x361c('0x26')]);}logger[_0x361c('0x24')](_0x361c('0x1f'),_0x583547,_0xfe080[_0x361c('0x24')]['message']);return _0x3a1482(_0xfe080[_0x361c('0x24')]['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x583547,'request\x20sent');_0x3a1482(_0xfe080[_0x361c('0x27')][_0x361c('0x26')]);}})['catch'](function(_0x4e4a8c){logger[_0x361c('0x24')](_0x361c('0x1f'),_0x583547,_0x4e4a8c);_0x132e24(_0x4e4a8c);});});}function respondWithStatusCode(_0x2f824e,_0x562f41){_0x562f41=_0x562f41||0xcc;return function(_0x45639e){if(_0x45639e){return _0x2f824e[_0x361c('0x28')](_0x562f41);}return _0x2f824e[_0x361c('0x29')](_0x562f41)[_0x361c('0x2a')]();};}function respondWithResult(_0x3a7902,_0x37dd0a){_0x37dd0a=_0x37dd0a||0xc8;return function(_0x9a4730){if(_0x9a4730){return _0x3a7902['status'](_0x37dd0a)[_0x361c('0x2b')](_0x9a4730);}};}function respondWithFilteredResult(_0x4d340c,_0x1363be){return function(_0x26f080){if(_0x26f080){var _0x18252d=typeof _0x1363be[_0x361c('0x2c')]===_0x361c('0x2d')&&typeof _0x1363be[_0x361c('0x2e')]===_0x361c('0x2d');var _0x3493fa=_0x26f080[_0x361c('0x2f')];var _0x423406=_0x18252d?0x0:_0x1363be['offset'];var _0x3afd87=_0x18252d?_0x26f080[_0x361c('0x2f')]:_0x1363be['offset']+_0x1363be[_0x361c('0x2e')];var _0x4f2ac5;if(_0x3afd87>=_0x3493fa){_0x3afd87=_0x3493fa;_0x4f2ac5=0xc8;}else{_0x4f2ac5=0xce;}_0x4d340c[_0x361c('0x29')](_0x4f2ac5);return _0x4d340c['set']('Content-Range',_0x423406+'-'+_0x3afd87+'/'+_0x3493fa)[_0x361c('0x2b')](_0x26f080);}return null;};}function patchUpdates(_0x467282){return function(_0x5580f4){try{jsonpatch['apply'](_0x5580f4,_0x467282,!![]);}catch(_0x4c186a){return BPromise[_0x361c('0x30')](_0x4c186a);}return _0x5580f4[_0x361c('0x31')]();};}function saveUpdates(_0x1ff58f,_0x1fa0e9){return function(_0x6c90e2){if(_0x6c90e2){return _0x6c90e2['update'](_0x1ff58f)[_0x361c('0x1d')](function(_0x8345a5){return _0x8345a5;});}return null;};}function removeEntity(_0x31c555,_0x1875c7){return function(_0x21656a){if(_0x21656a){return _0x21656a[_0x361c('0x32')]()[_0x361c('0x1d')](function(){_0x31c555[_0x361c('0x29')](0xcc)[_0x361c('0x2a')]();});}};}function handleEntityNotFound(_0xcaf8b0,_0x210ff4){return function(_0x3a4852){if(!_0x3a4852){_0xcaf8b0[_0x361c('0x28')](0x194);}return _0x3a4852;};}function handleError(_0x372439,_0x5f170e){_0x5f170e=_0x5f170e||0x1f4;return function(_0x2d9ff1){logger[_0x361c('0x24')](_0x2d9ff1[_0x361c('0x33')]);if(_0x2d9ff1[_0x361c('0x34')]){delete _0x2d9ff1[_0x361c('0x34')];}_0x372439['status'](_0x5f170e)[_0x361c('0x35')](_0x2d9ff1);};}exports[_0x361c('0x36')]=function(_0x41a99d,_0x3a2df5){var _0x29b196={},_0x11cbf6={},_0x1bcaf0={'count':0x0,'rows':[]};var _0xe8bcca=_[_0x361c('0x37')](db[_0x361c('0x38')]['rawAttributes'],function(_0xa24fee){return{'name':_0xa24fee[_0x361c('0x39')],'type':_0xa24fee['type'][_0x361c('0x3a')]};});_0x11cbf6[_0x361c('0x3b')]=_[_0x361c('0x37')](_0xe8bcca,_0x361c('0x34'));_0x11cbf6[_0x361c('0x3c')]=_['keys'](_0x41a99d['query']);_0x11cbf6[_0x361c('0x3d')]=_[_0x361c('0x3e')](_0x11cbf6[_0x361c('0x3b')],_0x11cbf6[_0x361c('0x3c')]);_0x29b196[_0x361c('0x3f')]=_[_0x361c('0x3e')](_0x11cbf6[_0x361c('0x3b')],qs[_0x361c('0x40')](_0x41a99d[_0x361c('0x3c')][_0x361c('0x40')]));_0x29b196[_0x361c('0x3f')]=_0x29b196[_0x361c('0x3f')][_0x361c('0x41')]?_0x29b196[_0x361c('0x3f')]:_0x11cbf6[_0x361c('0x3b')];if(!_0x41a99d['query'][_0x361c('0x42')](_0x361c('0x43'))){_0x29b196[_0x361c('0x2e')]=qs[_0x361c('0x2e')](_0x41a99d[_0x361c('0x3c')]['limit']);_0x29b196[_0x361c('0x2c')]=qs[_0x361c('0x2c')](_0x41a99d[_0x361c('0x3c')][_0x361c('0x2c')]);}_0x29b196['order']=qs[_0x361c('0x44')](_0x41a99d[_0x361c('0x3c')][_0x361c('0x44')]);_0x29b196['where']=qs[_0x361c('0x3d')](_[_0x361c('0x45')](_0x41a99d[_0x361c('0x3c')],_0x11cbf6['filters']),_0xe8bcca);if(_0x41a99d[_0x361c('0x3c')][_0x361c('0x46')]){_0x29b196['where']=_['merge'](_0x29b196[_0x361c('0x47')],{'$or':_['map'](_0xe8bcca,function(_0x56e645){if(_0x56e645[_0x361c('0x48')]!==_0x361c('0x49')){var _0x20ebdf={};_0x20ebdf[_0x56e645[_0x361c('0x34')]]={'$like':'%'+_0x41a99d[_0x361c('0x3c')]['filter']+'%'};return _0x20ebdf;}})});}_0x29b196=_['merge']({},_0x29b196,_0x41a99d[_0x361c('0x4a')]);var _0x4c9289={'where':_0x29b196[_0x361c('0x47')]};return db[_0x361c('0x38')]['count'](_0x4c9289)[_0x361c('0x1d')](function(_0x1ba2d0){_0x1bcaf0[_0x361c('0x2f')]=_0x1ba2d0;if(_0x41a99d[_0x361c('0x3c')][_0x361c('0x4b')]){_0x29b196[_0x361c('0x4c')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x361c('0x4d')](_0x29b196);})[_0x361c('0x1d')](function(_0x19ac98){_0x1bcaf0[_0x361c('0x4e')]=_0x19ac98;return _0x1bcaf0;})['then'](respondWithFilteredResult(_0x3a2df5,_0x29b196))[_0x361c('0x4f')](handleError(_0x3a2df5,null));};exports[_0x361c('0x50')]=function(_0x1c0d2c,_0x5b6acc){var _0x469335={'raw':!![],'where':{'id':_0x1c0d2c[_0x361c('0x51')]['id']}},_0x4a2939={};_0x4a2939[_0x361c('0x3b')]=_[_0x361c('0x52')](db[_0x361c('0x38')][_0x361c('0x53')]);_0x4a2939['query']=_[_0x361c('0x52')](_0x1c0d2c[_0x361c('0x3c')]);_0x4a2939[_0x361c('0x3d')]=_[_0x361c('0x3e')](_0x4a2939[_0x361c('0x3b')],_0x4a2939[_0x361c('0x3c')]);_0x469335[_0x361c('0x3f')]=_[_0x361c('0x3e')](_0x4a2939[_0x361c('0x3b')],qs[_0x361c('0x40')](_0x1c0d2c['query']['fields']));_0x469335[_0x361c('0x3f')]=_0x469335[_0x361c('0x3f')][_0x361c('0x41')]?_0x469335[_0x361c('0x3f')]:_0x4a2939[_0x361c('0x3b')];if(_0x1c0d2c['query'][_0x361c('0x4b')]){_0x469335[_0x361c('0x4c')]=[{'all':!![]}];}_0x469335=_['merge']({},_0x469335,_0x1c0d2c['options']);return db[_0x361c('0x38')][_0x361c('0x54')](_0x469335)[_0x361c('0x1d')](handleEntityNotFound(_0x5b6acc,null))[_0x361c('0x1d')](respondWithResult(_0x5b6acc,null))[_0x361c('0x4f')](handleError(_0x5b6acc,null));};exports['create']=function(_0x307703,_0x445987){return db[_0x361c('0x38')][_0x361c('0x55')](_0x307703['body'],{})[_0x361c('0x1d')](respondWithResult(_0x445987,0xc9))[_0x361c('0x4f')](handleError(_0x445987,null));};exports[_0x361c('0x56')]=function(_0x4849a0,_0x39db7a){if(_0x4849a0[_0x361c('0x57')]['id']){delete _0x4849a0['body']['id'];}return db[_0x361c('0x38')][_0x361c('0x54')]({'where':{'id':_0x4849a0[_0x361c('0x51')]['id']}})[_0x361c('0x1d')](handleEntityNotFound(_0x39db7a,null))[_0x361c('0x1d')](saveUpdates(_0x4849a0[_0x361c('0x57')],null))['then'](respondWithResult(_0x39db7a,null))[_0x361c('0x4f')](handleError(_0x39db7a,null));};exports[_0x361c('0x32')]=function(_0x5a0d77,_0x3bbf0e){return db[_0x361c('0x38')]['find']({'where':{'id':_0x5a0d77[_0x361c('0x51')]['id']}})[_0x361c('0x1d')](handleEntityNotFound(_0x3bbf0e,null))[_0x361c('0x1d')](removeEntity(_0x3bbf0e,null))[_0x361c('0x4f')](handleError(_0x3bbf0e,null));};exports[_0x361c('0x58')]=function(_0x3857a0,_0x1373d5){return db[_0x361c('0x38')]['describe']()['then'](respondWithResult(_0x1373d5,null))[_0x361c('0x4f')](handleError(_0x1373d5,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x361c('0x59')]=function(_0xf49b6,_0x35054e,_0x551e7a){var _0x10de58={'agent':{},'channel':_0x361c('0x5a')};if(_0xf49b6['body']['id']){delete _0xf49b6[_0x361c('0x57')]['id'];}_0xf49b6[_0x361c('0x57')][_0x361c('0x5b')]=!![];_0xf49b6[_0x361c('0x57')][_0x361c('0x5c')]=moment()[_0x361c('0x5d')](_0x361c('0x5e'));_0xf49b6[_0x361c('0x57')][_0x361c('0x5f')]=_0xf49b6[_0x361c('0x57')]['UserId']||_0xf49b6[_0x361c('0x60')]['id'];_0x10de58[_0x361c('0x61')]['id']=_0xf49b6[_0x361c('0x57')][_0x361c('0x5f')];return db[_0x361c('0x38')][_0x361c('0x54')]({'where':{'id':_0xf49b6['params']['id'],'UserId':null}})[_0x361c('0x1d')](handleEntityNotFound(_0x35054e,null))[_0x361c('0x1d')](saveUpdates(_0xf49b6[_0x361c('0x57')],null))[_0x361c('0x1d')](function(_0x143280){if(_0x143280){_0x10de58['message']=_0x143280[_0x361c('0x62')]({'plain':!![]});return db[_0x361c('0x63')][_0x361c('0x54')]({'where':{'id':_0x143280[_0x361c('0x64')]}});}return null;})[_0x361c('0x1d')](handleEntityNotFound(_0x35054e,null))[_0x361c('0x1d')](function(_0xb4ea16){if(_0xb4ea16){return _0xb4ea16['update']({'UserId':_0xf49b6[_0x361c('0x57')][_0x361c('0x5f')],'read1stAt':_[_0x361c('0x65')](_0xb4ea16['read1stAt'])?moment()['format'](_0x361c('0x5e')):undefined});}return null;})['then'](function(_0x5e06f0){if(_0x5e06f0){_0x10de58[_0x361c('0x66')]=_0x5e06f0[_0x361c('0x62')]({'plain':!![]});interaction_log[_0x361c('0x1e')](_0x361c('0x67'),_0xf49b6[_0x361c('0x60')]['id'],_0xf49b6[_0x361c('0x60')][_0x361c('0x34')],_0xf49b6['user'][_0x361c('0x68')],_0x10de58['interaction']['id'],_0xf49b6[_0x361c('0x57')]?JSON['stringify'](_0xf49b6[_0x361c('0x57')]):'null');return respondWithRpcPromise(_0x361c('0x69'),_0x361c('0x6a'),_0x10de58);}return null;})[_0x361c('0x1d')](function(_0x1169f7){var _0x4414bf=_0x361c('0x6b')+_0x1169f7['message'][_0x361c('0x6c')];return db[_0x361c('0x6d')][_0x361c('0x3c')](_0x4414bf,{'type':db[_0x361c('0x6e')][_0x361c('0x6f')][_0x361c('0x70')],'raw':!![]})[_0x361c('0x1d')](function(_0x19f37){return _0x19f37;});})['then'](function(_0x550da0){if(_0x550da0){_0x10de58['message'][_0x361c('0x71')]=_0x550da0[0x0];if(!_0xf49b6[_0x361c('0x57')]['UserId'])return;return db[_0x361c('0x72')][_0x361c('0x54')]({'where':{'id':_0xf49b6[_0x361c('0x57')][_0x361c('0x5f')],'role':'agent'},'attributes':['id',_0x361c('0x34'),'fullname',_0x361c('0x73'),_0x361c('0x74')],'raw':!![]});}return null;})[_0x361c('0x1d')](function(_0x2666b3){if(!_0x2666b3)return null;_0x10de58[_0x361c('0x26')][_0x361c('0x61')]=_0x2666b3;return _0x10de58;})[_0x361c('0x1d')](function(_0x31df54){if(_0x31df54){if(_0xf49b6[_0x361c('0x57')][_0x361c('0x75')]){_0x10de58[_0x361c('0x26')][_0x361c('0x76')]=util[_0x361c('0x5d')](_0x361c('0x77'),_0xf49b6[_0x361c('0x60')][_0x361c('0x34')]);_0x10de58[_0x361c('0x26')][_0x361c('0x78')]=_0x10de58[_0x361c('0x78')];_0x10de58[_0x361c('0x26')][_0x361c('0x79')]=_0x10de58[_0x361c('0x78')];_0x10de58[_0x361c('0x26')][_0x361c('0x7a')]=_0x361c('0x59');return respondWithRpcPromise('EventManager',_0x361c('0x7b'),{'event':_0x361c('0x7c'),'message':_0x10de58[_0x361c('0x26')]},client9002)[_0x361c('0x1d')](function(){return _0x10de58;});}return _0x10de58;}return null;})['then'](respondWithResult(_0x35054e,null))[_0x361c('0x4f')](handleError(_0x35054e,null));};var interaction_log=require('../../config/logger')(_0x361c('0x7d'));exports[_0x361c('0x30')]=function(_0x1c6345,_0x104595,_0x2bb429){var _0x402885={'agent':{},'channel':_0x361c('0x5a')};if(_0x1c6345[_0x361c('0x57')]['id']){delete _0x1c6345[_0x361c('0x57')]['id'];}_0x1c6345[_0x361c('0x57')][_0x361c('0x5f')]=_0x1c6345['body'][_0x361c('0x5f')]||_0x1c6345[_0x361c('0x60')]['id'];_0x402885[_0x361c('0x61')]['id']=_0x1c6345['body']['UserId'];return db[_0x361c('0x38')]['find']({'where':{'id':_0x1c6345['params']['id'],'UserId':null}})[_0x361c('0x1d')](handleEntityNotFound(_0x104595,null))['then'](function(_0x3b8e32){if(_0x3b8e32){_0x402885[_0x361c('0x26')]=_0x3b8e32[_0x361c('0x62')]({'plain':!![]});return db[_0x361c('0x63')][_0x361c('0x54')]({'where':{'id':_0x3b8e32['WhatsappInteractionId']}});}return null;})[_0x361c('0x1d')](handleEntityNotFound(_0x104595,null))[_0x361c('0x1d')](function(_0x1a811b){if(_0x1a811b){_0x402885[_0x361c('0x66')]=_0x1a811b['get']({'plain':!![]});interaction_log['info'](_0x361c('0x7e'),_0x1c6345[_0x361c('0x60')]['id'],_0x1c6345[_0x361c('0x60')][_0x361c('0x34')],_0x1c6345[_0x361c('0x60')]['role'],_0x402885[_0x361c('0x66')]['id'],_0x1c6345[_0x361c('0x57')]?JSON[_0x361c('0x23')](_0x1c6345[_0x361c('0x57')]):'null');return respondWithRpcPromise(_0x361c('0x7f'),'rejectMessage',_0x402885);}return null;})[_0x361c('0x1d')](function(_0x280368){var _0x54982c=_0x361c('0x6b')+_0x280368[_0x361c('0x26')][_0x361c('0x6c')];return db['sequelize']['query'](_0x54982c,{'type':db[_0x361c('0x6e')][_0x361c('0x6f')][_0x361c('0x70')],'raw':!![]})[_0x361c('0x1d')](function(_0x190787){return _0x190787;});})[_0x361c('0x1d')](function(_0x329f2a){if(_0x329f2a){_0x402885['message'][_0x361c('0x71')]=_0x329f2a[0x0];if(!_0x1c6345[_0x361c('0x57')][_0x361c('0x5f')])return;return db[_0x361c('0x72')][_0x361c('0x54')]({'where':{'id':_0x1c6345[_0x361c('0x57')][_0x361c('0x5f')],'role':_0x361c('0x61')},'attributes':['id',_0x361c('0x34'),_0x361c('0x80'),_0x361c('0x73'),_0x361c('0x74')],'raw':!![]});}return null;})[_0x361c('0x1d')](function(_0x256135){if(!_0x256135)return null;_0x402885[_0x361c('0x26')]['agent']=_0x256135;return _0x402885;})[_0x361c('0x1d')](function(_0x3e1692){if(_0x3e1692){_0x3e1692['message'][_0x361c('0x76')]=util[_0x361c('0x5d')](_0x361c('0x77'),_0x1c6345[_0x361c('0x60')][_0x361c('0x34')]);_0x3e1692['message'][_0x361c('0x78')]=_0x402885[_0x361c('0x78')];_0x3e1692[_0x361c('0x26')][_0x361c('0x79')]=_0x402885[_0x361c('0x78')];_0x3e1692[_0x361c('0x26')][_0x361c('0x7a')]=_0x361c('0x30');respondWithRpcPromise(_0x361c('0x7b'),_0x361c('0x7b'),{'event':'rejectmessage','message':_0x3e1692[_0x361c('0x26')]},client9002);return _0x402885;}return null;})['then'](respondWithResult(_0x104595,null))['catch'](handleError(_0x104595,null));};exports[_0x361c('0x29')]=function(_0x26f0f1,_0x533448,_0x5e83cd){if(_0x26f0f1[_0x361c('0x57')]['id']){delete _0x26f0f1['body']['id'];}var _0x22d02e;return db['WhatsappMessage'][_0x361c('0x54')]({'where':{'id':_0x26f0f1[_0x361c('0x51')]['id']}})['then'](handleEntityNotFound(_0x533448,null))['then'](function(_0x5cacf8){if(_0x5cacf8){_0x22d02e=_0x5cacf8;return db[_0x361c('0x81')][_0x361c('0x54')]({'where':{'id':_0x5cacf8[_0x361c('0x82')]}});}})['then'](handleEntityNotFound(_0x533448,null))[_0x361c('0x1d')](function(_0x2c1619){if(_0x2c1619){logger[_0x361c('0x21')](_0x361c('0x83'),_0x361c('0x29'),'received\x20delivery\x20report\x20from',_0x2c1619[_0x361c('0x48')],util[_0x361c('0x84')](_0x26f0f1[_0x361c('0x57')],{'showHidden':![],'depth':null}));switch(_0x2c1619['type']){case _0x361c('0x85'):if(_0x26f0f1['body'][_0x361c('0x86')]&&_0x26f0f1['body'][_0x361c('0x86')]===_0x22d02e[_0x361c('0x87')]&&_0x26f0f1['body'][_0x361c('0x88')]&&_0x26f0f1[_0x361c('0x57')][_0x361c('0x88')]===_0x361c('0x5b')){return _0x22d02e[_0x361c('0x56')]({'read':!![]});}else{logger[_0x361c('0x24')](_0x361c('0x89'),_0x361c('0x29'),_0x361c('0x85'),util[_0x361c('0x84')](_0x26f0f1['body'],{'showHidden':![],'depth':null}));}break;}return _0x22d02e;}})[_0x361c('0x1d')](respondWithResult(_0x533448,null))[_0x361c('0x4f')](handleError(_0x533448,null));}; \ No newline at end of file +var _0xfa78=['send','index','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','describe','whatsapp-interactions','whatsapp','read','readAt','format','UserId','user','get','WhatsappInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','agent','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','SELECT','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','mustache','path','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./whatsappMessage.socket','client','http','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name'];(function(_0x43907c,_0x4ab831){var _0x42b194=function(_0x3e6552){while(--_0x3e6552){_0x43907c['push'](_0x43907c['shift']());}};_0x42b194(++_0x4ab831);}(_0xfa78,0x163));var _0x8fa7=function(_0x152a62,_0x1359e7){_0x152a62=_0x152a62-0x0;var _0x736321=_0xfa78[_0x152a62];return _0x736321;};'use strict';var emlformat=require(_0x8fa7('0x0'));var rimraf=require(_0x8fa7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8fa7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8fa7('0x3'));var util=require('util');var path=require(_0x8fa7('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fa7('0x5'));var _=require('lodash');var squel=require(_0x8fa7('0x6'));var crypto=require(_0x8fa7('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x8fa7('0x8'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8fa7('0x9'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8fa7('0xa'));var hardwareService=require(_0x8fa7('0xb'));var logger=require(_0x8fa7('0xc'))(_0x8fa7('0xd'));var utils=require(_0x8fa7('0xe'));var config=require(_0x8fa7('0xf'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8fa7('0x10')]=_[_0x8fa7('0x11')](config[_0x8fa7('0x10')],{'host':'localhost','port':0x18eb});var socket=require(_0x8fa7('0x12'))(new Redis(config[_0x8fa7('0x10')]));require(_0x8fa7('0x13'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8fa7('0x14')][_0x8fa7('0x15')]({'port':0x232c});var client9002=jayson[_0x8fa7('0x14')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdd4238,_0x171874,_0x6d9374,_0x15c443){return new BPromise(function(_0x5ea6d7,_0x2de456){var _0x22ee57=_0x15c443||client;return _0x22ee57[_0x8fa7('0x16')](_0xdd4238,_0x6d9374)[_0x8fa7('0x17')](function(_0x2ea693){logger[_0x8fa7('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x171874,_0x8fa7('0x19'));logger[_0x8fa7('0x1a')](_0x8fa7('0x1b'),_0x171874,_0x8fa7('0x19'),JSON[_0x8fa7('0x1c')](_0x2ea693));if(_0x2ea693[_0x8fa7('0x1d')]){if(_0x2ea693[_0x8fa7('0x1d')][_0x8fa7('0x1e')]===0x1f4){logger[_0x8fa7('0x1d')](_0x8fa7('0x1f'),_0x171874,_0x2ea693[_0x8fa7('0x1d')][_0x8fa7('0x20')]);return _0x2de456(_0x2ea693['error'][_0x8fa7('0x20')]);}logger['error'](_0x8fa7('0x1f'),_0x171874,_0x2ea693['error'][_0x8fa7('0x20')]);return _0x5ea6d7(_0x2ea693['error']['message']);}else{logger[_0x8fa7('0x18')](_0x8fa7('0x1f'),_0x171874,_0x8fa7('0x19'));_0x5ea6d7(_0x2ea693['result']['message']);}})['catch'](function(_0x2cb82e){logger[_0x8fa7('0x1d')]('WhatsappMessage,\x20%s,\x20%s',_0x171874,_0x2cb82e);_0x2de456(_0x2cb82e);});});}function respondWithStatusCode(_0x3e6c6b,_0x157bde){_0x157bde=_0x157bde||0xcc;return function(_0x323784){if(_0x323784){return _0x3e6c6b[_0x8fa7('0x21')](_0x157bde);}return _0x3e6c6b[_0x8fa7('0x22')](_0x157bde)[_0x8fa7('0x23')]();};}function respondWithResult(_0x33834a,_0x20cd9e){_0x20cd9e=_0x20cd9e||0xc8;return function(_0x133aff){if(_0x133aff){return _0x33834a['status'](_0x20cd9e)[_0x8fa7('0x24')](_0x133aff);}};}function respondWithFilteredResult(_0x51e691,_0x51bee6){return function(_0x3d25e2){if(_0x3d25e2){var _0x2c3e96=typeof _0x51bee6[_0x8fa7('0x25')]==='undefined'&&typeof _0x51bee6['limit']===_0x8fa7('0x26');var _0x4dfae3=_0x3d25e2[_0x8fa7('0x27')];var _0x1ed1c6=_0x2c3e96?0x0:_0x51bee6['offset'];var _0x5f2435=_0x2c3e96?_0x3d25e2[_0x8fa7('0x27')]:_0x51bee6[_0x8fa7('0x25')]+_0x51bee6[_0x8fa7('0x28')];var _0x34aad0;if(_0x5f2435>=_0x4dfae3){_0x5f2435=_0x4dfae3;_0x34aad0=0xc8;}else{_0x34aad0=0xce;}_0x51e691['status'](_0x34aad0);return _0x51e691[_0x8fa7('0x29')](_0x8fa7('0x2a'),_0x1ed1c6+'-'+_0x5f2435+'/'+_0x4dfae3)[_0x8fa7('0x24')](_0x3d25e2);}return null;};}function patchUpdates(_0x324e67){return function(_0x59dd98){try{jsonpatch[_0x8fa7('0x2b')](_0x59dd98,_0x324e67,!![]);}catch(_0x10b0d5){return BPromise[_0x8fa7('0x2c')](_0x10b0d5);}return _0x59dd98[_0x8fa7('0x2d')]();};}function saveUpdates(_0x159981,_0x2ffeb4){return function(_0x1b6cd5){if(_0x1b6cd5){return _0x1b6cd5[_0x8fa7('0x2e')](_0x159981)['then'](function(_0x6245bb){return _0x6245bb;});}return null;};}function removeEntity(_0xf331ff,_0x4f27ca){return function(_0x17ef4a){if(_0x17ef4a){return _0x17ef4a[_0x8fa7('0x2f')]()[_0x8fa7('0x17')](function(){_0xf331ff[_0x8fa7('0x22')](0xcc)[_0x8fa7('0x23')]();});}};}function handleEntityNotFound(_0x22c911,_0x245e17){return function(_0x46f233){if(!_0x46f233){_0x22c911[_0x8fa7('0x21')](0x194);}return _0x46f233;};}function handleError(_0x4e7e4b,_0x282640){_0x282640=_0x282640||0x1f4;return function(_0x324bb9){logger['error'](_0x324bb9[_0x8fa7('0x30')]);if(_0x324bb9[_0x8fa7('0x31')]){delete _0x324bb9['name'];}_0x4e7e4b['status'](_0x282640)[_0x8fa7('0x32')](_0x324bb9);};}exports[_0x8fa7('0x33')]=function(_0x1d21ba,_0x122fcb){var _0x20e53e={},_0x91c948={},_0x32c1ca={'count':0x0,'rows':[]};var _0x3cee4b=_['map'](db[_0x8fa7('0x34')][_0x8fa7('0x35')],function(_0x149cd9){return{'name':_0x149cd9[_0x8fa7('0x36')],'type':_0x149cd9[_0x8fa7('0x37')][_0x8fa7('0x38')]};});_0x91c948[_0x8fa7('0x39')]=_['map'](_0x3cee4b,_0x8fa7('0x31'));_0x91c948[_0x8fa7('0x3a')]=_[_0x8fa7('0x3b')](_0x1d21ba[_0x8fa7('0x3a')]);_0x91c948[_0x8fa7('0x3c')]=_[_0x8fa7('0x3d')](_0x91c948[_0x8fa7('0x39')],_0x91c948['query']);_0x20e53e[_0x8fa7('0x3e')]=_[_0x8fa7('0x3d')](_0x91c948[_0x8fa7('0x39')],qs['fields'](_0x1d21ba[_0x8fa7('0x3a')][_0x8fa7('0x3f')]));_0x20e53e[_0x8fa7('0x3e')]=_0x20e53e[_0x8fa7('0x3e')]['length']?_0x20e53e['attributes']:_0x91c948['model'];if(!_0x1d21ba[_0x8fa7('0x3a')][_0x8fa7('0x40')]('nolimit')){_0x20e53e['limit']=qs[_0x8fa7('0x28')](_0x1d21ba[_0x8fa7('0x3a')][_0x8fa7('0x28')]);_0x20e53e[_0x8fa7('0x25')]=qs['offset'](_0x1d21ba['query'][_0x8fa7('0x25')]);}_0x20e53e[_0x8fa7('0x41')]=qs[_0x8fa7('0x42')](_0x1d21ba[_0x8fa7('0x3a')][_0x8fa7('0x42')]);_0x20e53e[_0x8fa7('0x43')]=qs[_0x8fa7('0x3c')](_[_0x8fa7('0x44')](_0x1d21ba[_0x8fa7('0x3a')],_0x91c948[_0x8fa7('0x3c')]),_0x3cee4b);if(_0x1d21ba['query'][_0x8fa7('0x45')]){_0x20e53e['where']=_[_0x8fa7('0x46')](_0x20e53e['where'],{'$or':_[_0x8fa7('0x47')](_0x3cee4b,function(_0x2fe905){if(_0x2fe905[_0x8fa7('0x37')]!==_0x8fa7('0x48')){var _0x1d31d3={};_0x1d31d3[_0x2fe905['name']]={'$like':'%'+_0x1d21ba[_0x8fa7('0x3a')][_0x8fa7('0x45')]+'%'};return _0x1d31d3;}})});}_0x20e53e=_['merge']({},_0x20e53e,_0x1d21ba[_0x8fa7('0x49')]);var _0x21ca39={'where':_0x20e53e[_0x8fa7('0x43')]};return db[_0x8fa7('0x34')][_0x8fa7('0x27')](_0x21ca39)['then'](function(_0x29e36e){_0x32c1ca[_0x8fa7('0x27')]=_0x29e36e;if(_0x1d21ba[_0x8fa7('0x3a')][_0x8fa7('0x4a')]){_0x20e53e['include']=[{'all':!![]}];}return db[_0x8fa7('0x34')][_0x8fa7('0x4b')](_0x20e53e);})[_0x8fa7('0x17')](function(_0xd42f6f){_0x32c1ca[_0x8fa7('0x4c')]=_0xd42f6f;return _0x32c1ca;})[_0x8fa7('0x17')](respondWithFilteredResult(_0x122fcb,_0x20e53e))[_0x8fa7('0x4d')](handleError(_0x122fcb,null));};exports[_0x8fa7('0x4e')]=function(_0x1d5188,_0x31e723){var _0x3abe09={'raw':!![],'where':{'id':_0x1d5188[_0x8fa7('0x4f')]['id']}},_0x27cfbf={};_0x27cfbf[_0x8fa7('0x39')]=_[_0x8fa7('0x3b')](db['WhatsappMessage'][_0x8fa7('0x35')]);_0x27cfbf['query']=_[_0x8fa7('0x3b')](_0x1d5188[_0x8fa7('0x3a')]);_0x27cfbf[_0x8fa7('0x3c')]=_['intersection'](_0x27cfbf[_0x8fa7('0x39')],_0x27cfbf[_0x8fa7('0x3a')]);_0x3abe09[_0x8fa7('0x3e')]=_['intersection'](_0x27cfbf['model'],qs[_0x8fa7('0x3f')](_0x1d5188['query'][_0x8fa7('0x3f')]));_0x3abe09[_0x8fa7('0x3e')]=_0x3abe09['attributes'][_0x8fa7('0x50')]?_0x3abe09['attributes']:_0x27cfbf[_0x8fa7('0x39')];if(_0x1d5188['query'][_0x8fa7('0x4a')]){_0x3abe09[_0x8fa7('0x51')]=[{'all':!![]}];}_0x3abe09=_[_0x8fa7('0x46')]({},_0x3abe09,_0x1d5188[_0x8fa7('0x49')]);return db[_0x8fa7('0x34')][_0x8fa7('0x52')](_0x3abe09)[_0x8fa7('0x17')](handleEntityNotFound(_0x31e723,null))['then'](respondWithResult(_0x31e723,null))[_0x8fa7('0x4d')](handleError(_0x31e723,null));};exports[_0x8fa7('0x53')]=function(_0x190b39,_0x4ecdb1){return db[_0x8fa7('0x34')]['create'](_0x190b39['body'],{})['then'](respondWithResult(_0x4ecdb1,0xc9))[_0x8fa7('0x4d')](handleError(_0x4ecdb1,null));};exports['update']=function(_0x5c22f6,_0x46e4de){if(_0x5c22f6[_0x8fa7('0x54')]['id']){delete _0x5c22f6[_0x8fa7('0x54')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x5c22f6[_0x8fa7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x46e4de,null))['then'](saveUpdates(_0x5c22f6[_0x8fa7('0x54')],null))[_0x8fa7('0x17')](respondWithResult(_0x46e4de,null))[_0x8fa7('0x4d')](handleError(_0x46e4de,null));};exports[_0x8fa7('0x2f')]=function(_0x2e10eb,_0x518561){return db[_0x8fa7('0x34')][_0x8fa7('0x52')]({'where':{'id':_0x2e10eb[_0x8fa7('0x4f')]['id']}})[_0x8fa7('0x17')](handleEntityNotFound(_0x518561,null))['then'](removeEntity(_0x518561,null))['catch'](handleError(_0x518561,null));};exports[_0x8fa7('0x55')]=function(_0x4255e9,_0x479bcb){return db[_0x8fa7('0x34')][_0x8fa7('0x55')]()['then'](respondWithResult(_0x479bcb,null))[_0x8fa7('0x4d')](handleError(_0x479bcb,null));};var interaction_log=require(_0x8fa7('0xc'))(_0x8fa7('0x56'));exports['accept']=function(_0x5e5848,_0x363f67,_0xe95d2a){var _0x30b8eb={'agent':{},'channel':_0x8fa7('0x57')};if(_0x5e5848[_0x8fa7('0x54')]['id']){delete _0x5e5848['body']['id'];}_0x5e5848[_0x8fa7('0x54')][_0x8fa7('0x58')]=!![];_0x5e5848[_0x8fa7('0x54')][_0x8fa7('0x59')]=moment()[_0x8fa7('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e5848[_0x8fa7('0x54')][_0x8fa7('0x5b')]=_0x5e5848[_0x8fa7('0x54')]['UserId']||_0x5e5848[_0x8fa7('0x5c')]['id'];_0x30b8eb['agent']['id']=_0x5e5848['body'][_0x8fa7('0x5b')];return db[_0x8fa7('0x34')]['find']({'where':{'id':_0x5e5848[_0x8fa7('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x363f67,null))[_0x8fa7('0x17')](saveUpdates(_0x5e5848[_0x8fa7('0x54')],null))[_0x8fa7('0x17')](function(_0x24acaa){if(_0x24acaa){_0x30b8eb[_0x8fa7('0x20')]=_0x24acaa[_0x8fa7('0x5d')]({'plain':!![]});return db[_0x8fa7('0x5e')][_0x8fa7('0x52')]({'where':{'id':_0x24acaa['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x363f67,null))[_0x8fa7('0x17')](function(_0x2800d7){if(_0x2800d7){return _0x2800d7[_0x8fa7('0x2e')]({'UserId':_0x5e5848[_0x8fa7('0x54')][_0x8fa7('0x5b')],'read1stAt':_[_0x8fa7('0x5f')](_0x2800d7[_0x8fa7('0x60')])?moment()[_0x8fa7('0x5a')](_0x8fa7('0x61')):undefined});}return null;})[_0x8fa7('0x17')](function(_0x6c2dc5){if(_0x6c2dc5){_0x30b8eb['interaction']=_0x6c2dc5['get']({'plain':!![]});interaction_log['info'](_0x8fa7('0x62'),_0x5e5848[_0x8fa7('0x5c')]['id'],_0x5e5848[_0x8fa7('0x5c')][_0x8fa7('0x31')],_0x5e5848[_0x8fa7('0x5c')][_0x8fa7('0x63')],_0x30b8eb[_0x8fa7('0x64')]['id'],_0x5e5848[_0x8fa7('0x54')]?JSON[_0x8fa7('0x1c')](_0x5e5848[_0x8fa7('0x54')]):_0x8fa7('0x65'));return respondWithRpcPromise(_0x8fa7('0x66'),'acceptMessage',_0x30b8eb);}return null;})[_0x8fa7('0x17')](function(_0x3c017a){var _0x41e7e7=_0x8fa7('0x67')+_0x3c017a[_0x8fa7('0x20')]['ContactId'];return db[_0x8fa7('0x68')][_0x8fa7('0x3a')](_0x41e7e7,{'type':db[_0x8fa7('0x69')][_0x8fa7('0x6a')]['SELECT'],'raw':!![]})[_0x8fa7('0x17')](function(_0x16ff03){return _0x16ff03;});})[_0x8fa7('0x17')](function(_0x248654){if(_0x248654){_0x30b8eb[_0x8fa7('0x20')][_0x8fa7('0x6b')]=_0x248654[0x0];if(!_0x5e5848[_0x8fa7('0x54')][_0x8fa7('0x5b')])return;return db[_0x8fa7('0x6c')]['find']({'where':{'id':_0x5e5848[_0x8fa7('0x54')][_0x8fa7('0x5b')],'role':'agent'},'attributes':['id',_0x8fa7('0x31'),'fullname',_0x8fa7('0x6d'),_0x8fa7('0x6e')],'raw':!![]});}return null;})[_0x8fa7('0x17')](function(_0x4a3e5b){if(!_0x4a3e5b)return null;_0x30b8eb['message']['agent']=_0x4a3e5b;return _0x30b8eb;})[_0x8fa7('0x17')](function(_0x50c8d6){if(_0x50c8d6){if(_0x5e5848['body'][_0x8fa7('0x6f')]){_0x30b8eb[_0x8fa7('0x20')][_0x8fa7('0x70')]=util[_0x8fa7('0x5a')](_0x8fa7('0x71'),_0x5e5848[_0x8fa7('0x5c')][_0x8fa7('0x31')]);_0x30b8eb[_0x8fa7('0x20')]['channel']=_0x30b8eb[_0x8fa7('0x72')];_0x30b8eb[_0x8fa7('0x20')][_0x8fa7('0x73')]=_0x30b8eb['channel'];_0x30b8eb[_0x8fa7('0x20')][_0x8fa7('0x74')]='accept';return respondWithRpcPromise(_0x8fa7('0x75'),_0x8fa7('0x75'),{'event':_0x8fa7('0x76'),'message':_0x30b8eb['message']},client9002)[_0x8fa7('0x17')](function(){return _0x30b8eb;});}return _0x30b8eb;}return null;})['then'](respondWithResult(_0x363f67,null))['catch'](handleError(_0x363f67,null));};var interaction_log=require(_0x8fa7('0xc'))('whatsapp-interactions');exports[_0x8fa7('0x2c')]=function(_0x17ceb4,_0x2f1dd7,_0x13855d){var _0x71ddfb={'agent':{},'channel':_0x8fa7('0x57')};if(_0x17ceb4[_0x8fa7('0x54')]['id']){delete _0x17ceb4[_0x8fa7('0x54')]['id'];}_0x17ceb4[_0x8fa7('0x54')][_0x8fa7('0x5b')]=_0x17ceb4[_0x8fa7('0x54')][_0x8fa7('0x5b')]||_0x17ceb4['user']['id'];_0x71ddfb[_0x8fa7('0x77')]['id']=_0x17ceb4[_0x8fa7('0x54')]['UserId'];return db[_0x8fa7('0x34')][_0x8fa7('0x52')]({'where':{'id':_0x17ceb4['params']['id'],'UserId':null}})[_0x8fa7('0x17')](handleEntityNotFound(_0x2f1dd7,null))[_0x8fa7('0x17')](function(_0x39cc98){if(_0x39cc98){_0x71ddfb['message']=_0x39cc98[_0x8fa7('0x5d')]({'plain':!![]});return db[_0x8fa7('0x5e')][_0x8fa7('0x52')]({'where':{'id':_0x39cc98['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2f1dd7,null))[_0x8fa7('0x17')](function(_0x25fc39){if(_0x25fc39){_0x71ddfb[_0x8fa7('0x64')]=_0x25fc39['get']({'plain':!![]});interaction_log[_0x8fa7('0x18')](_0x8fa7('0x78'),_0x17ceb4[_0x8fa7('0x5c')]['id'],_0x17ceb4[_0x8fa7('0x5c')][_0x8fa7('0x31')],_0x17ceb4[_0x8fa7('0x5c')][_0x8fa7('0x63')],_0x71ddfb[_0x8fa7('0x64')]['id'],_0x17ceb4[_0x8fa7('0x54')]?JSON[_0x8fa7('0x1c')](_0x17ceb4[_0x8fa7('0x54')]):_0x8fa7('0x65'));return respondWithRpcPromise(_0x8fa7('0x79'),'rejectMessage',_0x71ddfb);}return null;})['then'](function(_0x1a2f68){var _0x2e7335=_0x8fa7('0x67')+_0x1a2f68[_0x8fa7('0x20')][_0x8fa7('0x7a')];return db['sequelize'][_0x8fa7('0x3a')](_0x2e7335,{'type':db[_0x8fa7('0x69')]['QueryTypes'][_0x8fa7('0x7b')],'raw':!![]})['then'](function(_0x29ca4e){return _0x29ca4e;});})[_0x8fa7('0x17')](function(_0x42bb04){if(_0x42bb04){_0x71ddfb['message'][_0x8fa7('0x6b')]=_0x42bb04[0x0];if(!_0x17ceb4['body'][_0x8fa7('0x5b')])return;return db['User'][_0x8fa7('0x52')]({'where':{'id':_0x17ceb4[_0x8fa7('0x54')][_0x8fa7('0x5b')],'role':_0x8fa7('0x77')},'attributes':['id',_0x8fa7('0x31'),'fullname','email',_0x8fa7('0x6e')],'raw':!![]});}return null;})['then'](function(_0x53a8bf){if(!_0x53a8bf)return null;_0x71ddfb[_0x8fa7('0x20')][_0x8fa7('0x77')]=_0x53a8bf;return _0x71ddfb;})[_0x8fa7('0x17')](function(_0x5648dd){if(_0x5648dd){_0x5648dd[_0x8fa7('0x20')][_0x8fa7('0x70')]=util[_0x8fa7('0x5a')](_0x8fa7('0x71'),_0x17ceb4[_0x8fa7('0x5c')]['name']);_0x5648dd['message'][_0x8fa7('0x72')]=_0x71ddfb['channel'];_0x5648dd[_0x8fa7('0x20')][_0x8fa7('0x73')]=_0x71ddfb[_0x8fa7('0x72')];_0x5648dd[_0x8fa7('0x20')]['event']=_0x8fa7('0x2c');respondWithRpcPromise('EventManager',_0x8fa7('0x75'),{'event':_0x8fa7('0x7c'),'message':_0x5648dd[_0x8fa7('0x20')]},client9002);return _0x71ddfb;}return null;})[_0x8fa7('0x17')](respondWithResult(_0x2f1dd7,null))[_0x8fa7('0x4d')](handleError(_0x2f1dd7,null));};exports[_0x8fa7('0x22')]=function(_0x3d10cc,_0x369580,_0x1be66b){if(_0x3d10cc[_0x8fa7('0x54')]['id']){delete _0x3d10cc['body']['id'];}var _0x306e45;return db[_0x8fa7('0x34')]['find']({'where':{'id':_0x3d10cc[_0x8fa7('0x4f')]['id']}})[_0x8fa7('0x17')](handleEntityNotFound(_0x369580,null))[_0x8fa7('0x17')](function(_0x47da23){if(_0x47da23){_0x306e45=_0x47da23;return db[_0x8fa7('0x7d')]['find']({'where':{'id':_0x47da23[_0x8fa7('0x7e')]}});}})[_0x8fa7('0x17')](handleEntityNotFound(_0x369580,null))[_0x8fa7('0x17')](function(_0x2ec2c5){if(_0x2ec2c5){logger[_0x8fa7('0x1a')](_0x8fa7('0x7f'),'status',_0x8fa7('0x80'),_0x2ec2c5[_0x8fa7('0x37')],util[_0x8fa7('0x81')](_0x3d10cc['body'],{'showHidden':![],'depth':null}));switch(_0x2ec2c5[_0x8fa7('0x37')]){case _0x8fa7('0x82'):if(_0x3d10cc[_0x8fa7('0x54')][_0x8fa7('0x83')]&&_0x3d10cc['body'][_0x8fa7('0x83')]===_0x306e45[_0x8fa7('0x84')]&&_0x3d10cc[_0x8fa7('0x54')][_0x8fa7('0x85')]&&_0x3d10cc[_0x8fa7('0x54')][_0x8fa7('0x85')]==='read'){return _0x306e45[_0x8fa7('0x2e')]({'read':!![]});}else{logger['error'](_0x8fa7('0x86'),_0x8fa7('0x22'),_0x8fa7('0x82'),util[_0x8fa7('0x81')](_0x3d10cc[_0x8fa7('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x306e45;}})[_0x8fa7('0x17')](respondWithResult(_0x369580,null))[_0x8fa7('0x4d')](handleError(_0x369580,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 458248f..b7d663c 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 _0x657b=['../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x657b,0x131));var _0xb657=function(_0x2bf155,_0x3981f6){_0x2bf155=_0x2bf155-0x0;var _0x543850=_0x657b[_0x2bf155];return _0x543850;};'use strict';var EventEmitter=require(_0xb657('0x0'));var WhatsappMessage=require(_0xb657('0x1'))['db'][_0xb657('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xb657('0x3')](0x0);var events={'afterCreate':_0xb657('0x4'),'afterUpdate':'update','afterDestroy':_0xb657('0x5')};function emitEvent(_0xa41497){return function(_0x5da1bc,_0x175072,_0x322e57){WhatsappMessageEvents[_0xb657('0x6')](_0xa41497+':'+_0x5da1bc['id'],_0x5da1bc);WhatsappMessageEvents[_0xb657('0x6')](_0xa41497,_0x5da1bc);_0x322e57(null);};}for(var e in events){if(events[_0xb657('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xb657('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0x9c00=['emit','hook','exports','events','../../mysqldb','save','update'];(function(_0x1deafc,_0x202527){var _0xb2482e=function(_0x59644f){while(--_0x59644f){_0x1deafc['push'](_0x1deafc['shift']());}};_0xb2482e(++_0x202527);}(_0x9c00,0x1a0));var _0x09c0=function(_0x2ce4bb,_0x4bc632){_0x2ce4bb=_0x2ce4bb-0x0;var _0x19356b=_0x9c00[_0x2ce4bb];return _0x19356b;};'use strict';var EventEmitter=require(_0x09c0('0x0'));var WhatsappMessage=require(_0x09c0('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x09c0('0x2'),'afterUpdate':_0x09c0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x220c0c){return function(_0x2c702c,_0x2ed715,_0x2fd03e){WhatsappMessageEvents[_0x09c0('0x4')](_0x220c0c+':'+_0x2c702c['id'],_0x2c702c);WhatsappMessageEvents['emit'](_0x220c0c,_0x2c702c);_0x2fd03e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x09c0('0x5')](e,emitEvent(event));}}module[_0x09c0('0x6')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 5e39ff6..88f355f 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 _0xdaff=['request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','WhatsappInteractionId','then','error','WhatsappAccount','find','type','twilio','accountSid','authToken','phone','messages','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','update','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','statuses','message_id','err','finally','lodash','util','../../config/logger','api','bluebird'];(function(_0x4bd885,_0x57a6d4){var _0x6dda0a=function(_0x4a6794){while(--_0x4a6794){_0x4bd885['push'](_0x4bd885['shift']());}};_0x6dda0a(++_0x57a6d4);}(_0xdaff,0x151));var _0xfdaf=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdaff[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xfdaf('0x0'));var util=require(_0xfdaf('0x1'));var logger=require(_0xfdaf('0x2'))(_0xfdaf('0x3'));var moment=require('moment');var BPromise=require(_0xfdaf('0x4'));var rp=require(_0xfdaf('0x5'));var fetch=require(_0xfdaf('0x6'));var fs=require('fs');var path=require(_0xfdaf('0x7'));var rimraf=require(_0xfdaf('0x8'));var config=require(_0xfdaf('0x9'));var attributes=require(_0xfdaf('0xa'));module[_0xfdaf('0xb')]=function(_0x3bc9ee,_0x347c21){return _0x3bc9ee['define'](_0xfdaf('0xc'),attributes,{'tableName':_0xfdaf('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xfdaf('0xe')]},{'name':_0xfdaf('0xf'),'fields':['body'],'type':_0xfdaf('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5dc42c,_0x1ec2a6,_0x11fc0a){var _0x4d0afe=_0x3bc9ee[_0xfdaf('0x11')];var _0x5c23f6=_0x5dc42c['get']({'plain':!![]});if(_0x5c23f6[_0xfdaf('0x12')]['toLowerCase']()==='in'||_0x5c23f6[_0xfdaf('0x12')][_0xfdaf('0x13')]()===_0xfdaf('0x14')&&!_0x5c23f6[_0xfdaf('0x15')]&&!_['isNil'](_0x5c23f6[_0xfdaf('0x16')])){_0x4d0afe[_0xfdaf('0x17')]['findOne']({'where':{'id':_0x5c23f6[_0xfdaf('0x18')]}})[_0xfdaf('0x19')](function(_0x424c8f){if(_0x424c8f){_0x424c8f['update']({'lastMsgAt':_0x5c23f6['createdAt'],'lastMsgDirection':_0x5c23f6['direction'][_0xfdaf('0x13')]()});}})['catch'](function(_0x163107){console[_0xfdaf('0x1a')](_0x163107);});}if(_0x5c23f6['direction']===_0xfdaf('0x14')&&!_0x5c23f6[_0xfdaf('0x15')]){var _0x54b8e5;_0x4d0afe[_0xfdaf('0x1b')][_0xfdaf('0x1c')]({'where':{'id':_0x5c23f6['WhatsappAccountId']},'raw':!![]})[_0xfdaf('0x19')](function(_0xc63dee){_0x54b8e5=_0xc63dee;if(_0x54b8e5&&_0x54b8e5[_0xfdaf('0x1d')]){switch(_0x54b8e5[_0xfdaf('0x1d')]){case _0xfdaf('0x1e'):var _0x61a207=require('twilio');if(_0x54b8e5[_0xfdaf('0x1f')]&&_0x54b8e5[_0xfdaf('0x20')]&&_0x54b8e5[_0xfdaf('0x21')]){var _0x179ef3=new _0x61a207(_0x54b8e5[_0xfdaf('0x1f')],_0x54b8e5[_0xfdaf('0x20')]);_0x179ef3[_0xfdaf('0x22')]['create']({'body':_0x5c23f6[_0xfdaf('0x23')],'to':_0xfdaf('0x24')+_0x5c23f6[_0xfdaf('0x21')],'from':_0xfdaf('0x24')+_0x54b8e5[_0xfdaf('0x21')],'statusCallback':_0x54b8e5[_0xfdaf('0x25')]+_0xfdaf('0x26')+_0x5c23f6['id']+_0xfdaf('0x27')+_0x54b8e5['token']})[_0xfdaf('0x19')](function(_0x544363){if(_0x544363['sid']){return _0x5dc42c[_0xfdaf('0x28')]({'messageId':_0x544363[_0xfdaf('0x29')]});}})[_0xfdaf('0x2a')](function(_0x322797){logger[_0xfdaf('0x1a')](_0xfdaf('0x2b'),_0xfdaf('0x2c'),'twilio',util[_0xfdaf('0x2d')](_0x322797,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xfdaf('0x1e'),_0xfdaf('0x2e'));}break;case _0xfdaf('0x2f'):var _0x193add=_0x54b8e5['accountSid'];var _0x172d46=_0x54b8e5['authToken'];var _0x12e26d=_0x54b8e5['baseUrl']+_0xfdaf('0x30')+_0x193add+_0xfdaf('0x31');var _0x2bcfda={'to':[_0x5c23f6[_0xfdaf('0x21')]],'message':{'type':_0xfdaf('0x32'),'text':_0x5c23f6[_0xfdaf('0x23')]}};var _0x9bf9d3={'method':'POST','uri':_0x12e26d,'headers':{'Authorization':_0xfdaf('0x33')+_0x172d46,'Content-Type':_0xfdaf('0x34')},'body':_0x2bcfda,'json':!![]};rp(_0x9bf9d3)[_0xfdaf('0x19')](function(_0x6e6970){if(_0x6e6970[_0xfdaf('0x35')][0x0][_0xfdaf('0x36')]){return _0x5dc42c[_0xfdaf('0x28')]({'messageId':_0x6e6970['statuses'][0x0][_0xfdaf('0x36')]});}})['catch'](function(_0x4bd72e){logger[_0xfdaf('0x37')]('WhatsappMessage,\x20%s',_0x4bd72e);});break;}}})[_0xfdaf('0x38')](function(){_0x11fc0a();});}else{_0x11fc0a();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x990b=['../../config/logger','moment','bluebird','request-promise','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne','update','createdAt','catch','WhatsappAccount','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','error','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','statuses','message_id','err','finally','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x990b,0x1df));var _0xb990=function(_0x1bb471,_0x50059d){_0x1bb471=_0x1bb471-0x0;var _0x50684f=_0x990b[_0x1bb471];return _0x50684f;};'use strict';var _=require('lodash');var util=require(_0xb990('0x0'));var logger=require(_0xb990('0x1'))('api');var moment=require(_0xb990('0x2'));var BPromise=require(_0xb990('0x3'));var rp=require(_0xb990('0x4'));var fetch=require(_0xb990('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb990('0x6'));var config=require(_0xb990('0x7'));var attributes=require(_0xb990('0x8'));module[_0xb990('0x9')]=function(_0x4d35b5,_0x2979c2){return _0x4d35b5[_0xb990('0xa')]('WhatsappMessage',attributes,{'tableName':_0xb990('0xb'),'paranoid':![],'indexes':[{'name':_0xb990('0xc'),'fields':['messageId']},{'name':'fti_whatsapp_messages','fields':[_0xb990('0xd')],'type':_0xb990('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fbb2b,_0x3f58f6,_0x594358){var _0x2e5ba5=_0x4d35b5[_0xb990('0xf')];var _0x212e63=_0x1fbb2b[_0xb990('0x10')]({'plain':!![]});if(_0x212e63['direction'][_0xb990('0x11')]()==='in'||_0x212e63[_0xb990('0x12')][_0xb990('0x11')]()===_0xb990('0x13')&&!_0x212e63[_0xb990('0x14')]&&!_[_0xb990('0x15')](_0x212e63[_0xb990('0x16')])){_0x2e5ba5[_0xb990('0x17')][_0xb990('0x18')]({'where':{'id':_0x212e63['WhatsappInteractionId']}})['then'](function(_0x6eee58){if(_0x6eee58){_0x6eee58[_0xb990('0x19')]({'lastMsgAt':_0x212e63[_0xb990('0x1a')],'lastMsgDirection':_0x212e63[_0xb990('0x12')]['toLowerCase']()});}})[_0xb990('0x1b')](function(_0x3a651a){console['error'](_0x3a651a);});}if(_0x212e63[_0xb990('0x12')]===_0xb990('0x13')&&!_0x212e63[_0xb990('0x14')]){var _0x200e0f;_0x2e5ba5[_0xb990('0x1c')]['find']({'where':{'id':_0x212e63[_0xb990('0x1d')]},'raw':!![]})[_0xb990('0x1e')](function(_0x17b644){_0x200e0f=_0x17b644;if(_0x200e0f&&_0x200e0f[_0xb990('0x1f')]){switch(_0x200e0f[_0xb990('0x1f')]){case _0xb990('0x20'):var _0x59da85=require(_0xb990('0x20'));if(_0x200e0f[_0xb990('0x21')]&&_0x200e0f[_0xb990('0x22')]&&_0x200e0f['phone']){var _0x4b32b2=new _0x59da85(_0x200e0f['accountSid'],_0x200e0f[_0xb990('0x22')]);_0x4b32b2[_0xb990('0x23')][_0xb990('0x24')]({'body':_0x212e63['body'],'to':_0xb990('0x25')+_0x212e63[_0xb990('0x26')],'from':_0xb990('0x25')+_0x200e0f[_0xb990('0x26')],'statusCallback':_0x200e0f[_0xb990('0x27')]+_0xb990('0x28')+_0x212e63['id']+_0xb990('0x29')+_0x200e0f[_0xb990('0x2a')]})[_0xb990('0x1e')](function(_0x484cb4){if(_0x484cb4['sid']){return _0x1fbb2b[_0xb990('0x19')]({'messageId':_0x484cb4[_0xb990('0x2b')]});}})['catch'](function(_0x262f38){logger[_0xb990('0x2c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xb990('0x2d'),'twilio',util[_0xb990('0x2e')](_0x262f38,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb990('0x2f'),_0xb990('0x2d'),_0xb990('0x20'),_0xb990('0x30'));}break;case _0xb990('0x31'):var _0x5e470c=_0x200e0f[_0xb990('0x21')];var _0x542d6b=_0x200e0f['authToken'];var _0x768ce9=_0x200e0f[_0xb990('0x32')]+_0xb990('0x33')+_0x5e470c+_0xb990('0x34');var _0x8d33aa={'to':[_0x212e63[_0xb990('0x26')]],'message':{'type':'text','text':_0x212e63[_0xb990('0xd')]}};var _0x316518={'method':_0xb990('0x35'),'uri':_0x768ce9,'headers':{'Authorization':'Bearer\x20'+_0x542d6b,'Content-Type':'application/json'},'body':_0x8d33aa,'json':!![]};rp(_0x316518)[_0xb990('0x1e')](function(_0x56eb7a){if(_0x56eb7a[_0xb990('0x36')][0x0]['message_id']){return _0x1fbb2b[_0xb990('0x19')]({'messageId':_0x56eb7a[_0xb990('0x36')][0x0][_0xb990('0x37')]});}})[_0xb990('0x1b')](function(_0x11087f){logger[_0xb990('0x38')]('WhatsappMessage,\x20%s',_0x11087f);});break;}}})[_0xb990('0x39')](function(){_0x594358();});}else{_0x594358();}}},'charset':_0xb990('0x3a'),'collate':_0xb990('0x3b')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 646371b..2dec958 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 _0xb803=['result','WhatsappMessage','options','raw','then','CreateWhatsappMessage','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappMessage.socket','request','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x7afacc,_0x59a0b4){var _0x2c5b61=function(_0x4f8b27){while(--_0x4f8b27){_0x7afacc['push'](_0x7afacc['shift']());}};_0x2c5b61(++_0x59a0b4);}(_0xb803,0xdf));var _0x3b80=function(_0xd1931c,_0xb984eb){_0xd1931c=_0xd1931c-0x0;var _0x59b915=_0xb803[_0xd1931c];return _0x59b915;};'use strict';var _=require(_0x3b80('0x0'));var util=require('util');var moment=require(_0x3b80('0x1'));var BPromise=require(_0x3b80('0x2'));var rs=require(_0x3b80('0x3'));var fs=require('fs');var Redis=require(_0x3b80('0x4'));var db=require(_0x3b80('0x5'))['db'];var utils=require(_0x3b80('0x6'));var logger=require('../../config/logger')(_0x3b80('0x7'));var config=require(_0x3b80('0x8'));var jayson=require(_0x3b80('0x9'));var client=jayson[_0x3b80('0xa')][_0x3b80('0xb')]({'port':0x232a});config['redis']=_[_0x3b80('0xc')](config[_0x3b80('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b80('0xe'))(new Redis(config[_0x3b80('0xd')]));require(_0x3b80('0xf'))['register'](socket);function respondWithRpcPromise(_0x44b704,_0x3d7105,_0x15944a){return new BPromise(function(_0x1b668b,_0x369b38){return client[_0x3b80('0x10')](_0x44b704,_0x15944a)['then'](function(_0xf72ece){logger[_0x3b80('0x11')](_0x3b80('0x12'),_0x3d7105,'request\x20sent');logger[_0x3b80('0x13')](_0x3b80('0x14'),_0x3d7105,_0x3b80('0x15'),JSON[_0x3b80('0x16')](_0xf72ece));if(_0xf72ece[_0x3b80('0x17')]){if(_0xf72ece[_0x3b80('0x17')]['code']===0x1f4){logger[_0x3b80('0x17')](_0x3b80('0x12'),_0x3d7105,_0xf72ece['error']['message']);return _0x369b38(_0xf72ece[_0x3b80('0x17')][_0x3b80('0x18')]);}logger[_0x3b80('0x17')](_0x3b80('0x12'),_0x3d7105,_0xf72ece[_0x3b80('0x17')][_0x3b80('0x18')]);return _0x1b668b(_0xf72ece[_0x3b80('0x17')][_0x3b80('0x18')]);}else{logger[_0x3b80('0x11')](_0x3b80('0x12'),_0x3d7105,_0x3b80('0x15'));_0x1b668b(_0xf72ece[_0x3b80('0x19')][_0x3b80('0x18')]);}})['catch'](function(_0x5ad054){logger[_0x3b80('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x3d7105,_0x5ad054);_0x369b38(_0x5ad054);});});}exports['CreateWhatsappMessage']=function(_0x2199a3){var _0x5da86b=this;return new Promise(function(_0x198318,_0x3fbb5f){return db[_0x3b80('0x1a')]['create'](_0x2199a3['body'],{'raw':_0x2199a3[_0x3b80('0x1b')]?_0x2199a3[_0x3b80('0x1b')][_0x3b80('0x1c')]===undefined?!![]:![]:!![]})[_0x3b80('0x1d')](function(_0x46a681){logger[_0x3b80('0x11')](_0x3b80('0x1e'),_0x2199a3);logger['debug'](_0x3b80('0x1e'),_0x2199a3,JSON['stringify'](_0x46a681));_0x198318(_0x46a681);})['catch'](function(_0x49cf5c){logger[_0x3b80('0x17')](_0x3b80('0x1e'),_0x49cf5c[_0x3b80('0x18')],_0x2199a3);_0x3fbb5f(_0x5da86b['error'](0x1f4,_0x49cf5c[_0x3b80('0x18')]));});});}; \ No newline at end of file +var _0x2f88=['create','body','options','raw','CreateWhatsappMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./whatsappMessage.socket','register','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x2d1512,_0x293ac6){var _0x2fe59e=function(_0x433af8){while(--_0x433af8){_0x2d1512['push'](_0x2d1512['shift']());}};_0x2fe59e(++_0x293ac6);}(_0x2f88,0x85));var _0x82f8=function(_0x3345fe,_0x2c4041){_0x3345fe=_0x3345fe-0x0;var _0x9866b5=_0x2f88[_0x3345fe];return _0x9866b5;};'use strict';var _=require(_0x82f8('0x0'));var util=require(_0x82f8('0x1'));var moment=require(_0x82f8('0x2'));var BPromise=require(_0x82f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x82f8('0x4'));var db=require(_0x82f8('0x5'))['db'];var utils=require(_0x82f8('0x6'));var logger=require(_0x82f8('0x7'))('rpc');var config=require(_0x82f8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x82f8('0x9')][_0x82f8('0xa')]({'port':0x232a});config[_0x82f8('0xb')]=_[_0x82f8('0xc')](config[_0x82f8('0xb')],{'host':_0x82f8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x82f8('0xb')]));require(_0x82f8('0xe'))[_0x82f8('0xf')](socket);function respondWithRpcPromise(_0x3c7f96,_0x57484f,_0x59977c){return new BPromise(function(_0x642cb0,_0xcac42e){return client['request'](_0x3c7f96,_0x59977c)[_0x82f8('0x10')](function(_0x53e216){logger[_0x82f8('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x57484f,_0x82f8('0x12'));logger['debug'](_0x82f8('0x13'),_0x57484f,_0x82f8('0x12'),JSON[_0x82f8('0x14')](_0x53e216));if(_0x53e216['error']){if(_0x53e216[_0x82f8('0x15')][_0x82f8('0x16')]===0x1f4){logger[_0x82f8('0x15')](_0x82f8('0x17'),_0x57484f,_0x53e216[_0x82f8('0x15')][_0x82f8('0x18')]);return _0xcac42e(_0x53e216['error'][_0x82f8('0x18')]);}logger[_0x82f8('0x15')](_0x82f8('0x17'),_0x57484f,_0x53e216[_0x82f8('0x15')]['message']);return _0x642cb0(_0x53e216['error'][_0x82f8('0x18')]);}else{logger[_0x82f8('0x11')](_0x82f8('0x17'),_0x57484f,_0x82f8('0x12'));_0x642cb0(_0x53e216[_0x82f8('0x19')][_0x82f8('0x18')]);}})[_0x82f8('0x1a')](function(_0x4df5aa){logger[_0x82f8('0x15')](_0x82f8('0x17'),_0x57484f,_0x4df5aa);_0xcac42e(_0x4df5aa);});});}exports['CreateWhatsappMessage']=function(_0x147267){var _0x2abb8b=this;return new Promise(function(_0x467362,_0x3f385e){return db['WhatsappMessage'][_0x82f8('0x1b')](_0x147267[_0x82f8('0x1c')],{'raw':_0x147267['options']?_0x147267[_0x82f8('0x1d')][_0x82f8('0x1e')]===undefined?!![]:![]:!![]})[_0x82f8('0x10')](function(_0x226fae){logger[_0x82f8('0x11')](_0x82f8('0x1f'),_0x147267);logger['debug'](_0x82f8('0x1f'),_0x147267,JSON[_0x82f8('0x14')](_0x226fae));_0x467362(_0x226fae);})[_0x82f8('0x1a')](function(_0x2b36c9){logger[_0x82f8('0x15')](_0x82f8('0x1f'),_0x2b36c9[_0x82f8('0x18')],_0x147267);_0x3f385e(_0x2abb8b[_0x82f8('0x15')](0x1f4,_0x2b36c9['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index bca87e2..3c8a404 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 _0x0050=['whatsappMessage:','remove','update','emit','removeListener','register','length'];(function(_0x24b877,_0x40ddcd){var _0x16929d=function(_0x6c727f){while(--_0x6c727f){_0x24b877['push'](_0x24b877['shift']());}};_0x16929d(++_0x40ddcd);}(_0x0050,0x86));var _0x0005=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0050[_0x42cae2];return _0x5f256f;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0x0005('0x0'),_0x0005('0x1')];function createListener(_0x326633,_0x5e1823){return function(_0x21d13f){_0x5e1823[_0x0005('0x2')](_0x326633,_0x21d13f);};}function removeListener(_0x49fb48,_0x66f7e){return function(){WhatsappMessageEvents[_0x0005('0x3')](_0x49fb48,_0x66f7e);};}exports[_0x0005('0x4')]=function(_0x3f284e){for(var _0x244970=0x0,_0x842cce=events[_0x0005('0x5')];_0x244970<_0x842cce;_0x244970++){var _0x366c8f=events[_0x244970];var _0x1a782b=createListener(_0x0005('0x6')+_0x366c8f,_0x3f284e);WhatsappMessageEvents['on'](_0x366c8f,_0x1a782b);}}; \ No newline at end of file +var _0xa84f=['emit','register','length','./whatsappMessage.events','save','remove','update'];(function(_0x1075eb,_0x2a2d9c){var _0x200346=function(_0x17ad1b){while(--_0x17ad1b){_0x1075eb['push'](_0x1075eb['shift']());}};_0x200346(++_0x2a2d9c);}(_0xa84f,0x88));var _0xfa84=function(_0x3441e9,_0x269c8a){_0x3441e9=_0x3441e9-0x0;var _0x7f9ada=_0xa84f[_0x3441e9];return _0x7f9ada;};'use strict';var WhatsappMessageEvents=require(_0xfa84('0x0'));var events=[_0xfa84('0x1'),_0xfa84('0x2'),_0xfa84('0x3')];function createListener(_0x32ebc5,_0x3d6a50){return function(_0x58c5fd){_0x3d6a50[_0xfa84('0x4')](_0x32ebc5,_0x58c5fd);};}function removeListener(_0x58ff47,_0x18a42c){return function(){WhatsappMessageEvents['removeListener'](_0x58ff47,_0x18a42c);};}exports[_0xfa84('0x5')]=function(_0x491f0a){for(var _0x1d2828=0x0,_0x2ce315=events[_0xfa84('0x6')];_0x1d2828<_0x2ce315;_0x1d2828++){var _0x2bf04c=events[_0x1d2828];var _0x36a7dc=createListener('whatsappMessage:'+_0x2bf04c,_0x491f0a);WhatsappMessageEvents['on'](_0x2bf04c,_0x36a7dc);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 231b825..56cddbb 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 _0x43c9=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members'];(function(_0x1476ba,_0x446421){var _0x5e7bc1=function(_0x4aa99c){while(--_0x4aa99c){_0x1476ba['push'](_0x1476ba['shift']());}};_0x5e7bc1(++_0x446421);}(_0x43c9,0xfd));var _0x943c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x43c9[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x943c('0x0'));var util=require('util');var path=require(_0x943c('0x1'));var timeout=require(_0x943c('0x2'));var express=require(_0x943c('0x3'));var router=express[_0x943c('0x4')]();var fs_extra=require(_0x943c('0x5'));var auth=require(_0x943c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x943c('0x7'));var controller=require(_0x943c('0x8'));router[_0x943c('0x9')]('/',auth[_0x943c('0xa')](),controller[_0x943c('0xb')]);router[_0x943c('0x9')](_0x943c('0xc'),auth['isAuthenticated'](),controller[_0x943c('0xd')]);router['get'](_0x943c('0xe'),auth[_0x943c('0xa')](),controller[_0x943c('0xf')]);router[_0x943c('0x9')](_0x943c('0x10'),auth[_0x943c('0xa')](),controller[_0x943c('0x11')]);router[_0x943c('0x9')](_0x943c('0x12'),auth[_0x943c('0xa')](),controller[_0x943c('0x13')]);router['get'](_0x943c('0x14'),auth['isAuthenticated'](),controller[_0x943c('0x15')]);router[_0x943c('0x16')]('/',auth[_0x943c('0xa')](),controller[_0x943c('0x17')]);router['post'](_0x943c('0x12'),auth['isAuthenticated'](),controller['addTeams']);router[_0x943c('0x16')]('/:id/users',auth[_0x943c('0xa')](),controller['addAgents']);router[_0x943c('0x18')](_0x943c('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x943c('0x19')]('/:id',auth[_0x943c('0xa')](),controller[_0x943c('0x1a')]);router[_0x943c('0x19')](_0x943c('0x12'),auth[_0x943c('0xa')](),controller[_0x943c('0x1b')]);router[_0x943c('0x19')](_0x943c('0x14'),auth[_0x943c('0xa')](),controller[_0x943c('0x1c')]);module[_0x943c('0x1d')]=router; \ No newline at end of file +var _0xf65d=['./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','/:id','update','delete','destroy','/:id/teams','removeAgents','exports','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x39cc4c,_0x3349a8){var _0x22ac0a=function(_0x3698eb){while(--_0x3698eb){_0x39cc4c['push'](_0x39cc4c['shift']());}};_0x22ac0a(++_0x3349a8);}(_0xf65d,0x13a));var _0xdf65=function(_0xd467d7,_0x2f13cd){_0xd467d7=_0xd467d7-0x0;var _0x23b23d=_0xf65d[_0xd467d7];return _0x23b23d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdf65('0x0'));var express=require(_0xdf65('0x1'));var router=express[_0xdf65('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xdf65('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xdf65('0x4'));var controller=require(_0xdf65('0x5'));router[_0xdf65('0x6')]('/',auth[_0xdf65('0x7')](),controller[_0xdf65('0x8')]);router[_0xdf65('0x6')](_0xdf65('0x9'),auth[_0xdf65('0x7')](),controller[_0xdf65('0xa')]);router['get']('/:id',auth[_0xdf65('0x7')](),controller[_0xdf65('0xb')]);router[_0xdf65('0x6')](_0xdf65('0xc'),auth[_0xdf65('0x7')](),controller[_0xdf65('0xd')]);router[_0xdf65('0x6')]('/:id/teams',auth[_0xdf65('0x7')](),controller[_0xdf65('0xe')]);router[_0xdf65('0x6')]('/:id/users',auth[_0xdf65('0x7')](),controller[_0xdf65('0xf')]);router[_0xdf65('0x10')]('/',auth['isAuthenticated'](),controller[_0xdf65('0x11')]);router[_0xdf65('0x10')]('/:id/teams',auth[_0xdf65('0x7')](),controller[_0xdf65('0x12')]);router[_0xdf65('0x10')](_0xdf65('0x13'),auth['isAuthenticated'](),controller[_0xdf65('0x14')]);router[_0xdf65('0x15')](_0xdf65('0x16'),auth[_0xdf65('0x7')](),controller[_0xdf65('0x17')]);router[_0xdf65('0x18')](_0xdf65('0x16'),auth[_0xdf65('0x7')](),controller[_0xdf65('0x19')]);router[_0xdf65('0x18')](_0xdf65('0x1a'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xdf65('0x18')](_0xdf65('0x13'),auth['isAuthenticated'](),controller[_0xdf65('0x1b')]);module[_0xdf65('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index ed77c4f..f2077a3 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 _0x81a5=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x81a5,0x1c8));var _0x581a=function(_0x31635c,_0x6f9e7c){_0x31635c=_0x31635c-0x0;var _0x32e158=_0x81a5[_0x31635c];return _0x32e158;};'use strict';var Sequelize=require(_0x581a('0x0'));module[_0x581a('0x1')]={'name':{'type':Sequelize[_0x581a('0x2')],'unique':_0x581a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x581a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x581a('0x5')]('rrmemory',_0x581a('0x6'),'roundrobin')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfaa4=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x48321f,_0x153ba3){var _0x1b7637=function(_0x9b8281){while(--_0x9b8281){_0x48321f['push'](_0x48321f['shift']());}};_0x1b7637(++_0x153ba3);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x214a01,_0x3da79f){_0x214a01=_0x214a01-0x0;var _0x51771c=_0xfaa4[_0x214a01];return _0x51771c;};'use strict';var Sequelize=require(_0x4faa('0x0'));module[_0x4faa('0x1')]={'name':{'type':Sequelize[_0x4faa('0x2')],'unique':_0x4faa('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4faa('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4faa('0x5')]('rrmemory',_0x4faa('0x6'),_0x4faa('0x7'))},'description':{'type':Sequelize[_0x4faa('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index f2d5e21..8490830 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 _0xac6e=['isArray','userWhatsappQueue:remove','getAgents','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./whatsappQueue.socket','register','status','end','json','offset','undefined','limit','count','set','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','getOptions','WhatsappQueue','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappQueueId','filter','User','findAndCountAll','agent','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','ids','Agents','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','from','team_has_whatsapp_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','removeAgents','addAgents','omit','spread'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0xac6e,0x7d));var _0xeac6=function(_0x10a6c5,_0x3b8168){_0x10a6c5=_0x10a6c5-0x0;var _0x79e4b8=_0xac6e[_0x10a6c5];return _0x79e4b8;};'use strict';var BPromise=require('bluebird');var util=require(_0xeac6('0x0'));var _=require(_0xeac6('0x1'));var squel=require(_0xeac6('0x2'));var Redis=require(_0xeac6('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xeac6('0x4'))(_0xeac6('0x5'));var config=require(_0xeac6('0x6'));var db=require(_0xeac6('0x7'))['db'];config[_0xeac6('0x8')]=_[_0xeac6('0x9')](config[_0xeac6('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeac6('0x8')]));require(_0xeac6('0xa'))[_0xeac6('0xb')](socket);function respondWithStatusCode(_0x38d784,_0x3edafd){_0x3edafd=_0x3edafd||0xcc;return function(_0x12dc30){if(_0x12dc30){return _0x38d784['sendStatus'](_0x3edafd);}return _0x38d784[_0xeac6('0xc')](_0x3edafd)[_0xeac6('0xd')]();};}function respondWithResult(_0x547bec,_0x92128b){_0x92128b=_0x92128b||0xc8;return function(_0x531c4e){if(_0x531c4e){return _0x547bec[_0xeac6('0xc')](_0x92128b)[_0xeac6('0xe')](_0x531c4e);}};}function respondWithFilteredResult(_0x29e27a,_0x370f0c){return function(_0x23b8b0){if(_0x23b8b0){var _0x4b6915=typeof _0x370f0c[_0xeac6('0xf')]===_0xeac6('0x10')&&typeof _0x370f0c[_0xeac6('0x11')]===_0xeac6('0x10');var _0x52c098=_0x23b8b0[_0xeac6('0x12')];var _0x2bd2aa=_0x4b6915?0x0:_0x370f0c[_0xeac6('0xf')];var _0x1a8521=_0x4b6915?_0x23b8b0['count']:_0x370f0c[_0xeac6('0xf')]+_0x370f0c[_0xeac6('0x11')];var _0x3c5cc6;if(_0x1a8521>=_0x52c098){_0x1a8521=_0x52c098;_0x3c5cc6=0xc8;}else{_0x3c5cc6=0xce;}_0x29e27a[_0xeac6('0xc')](_0x3c5cc6);return _0x29e27a[_0xeac6('0x13')]('Content-Range',_0x2bd2aa+'-'+_0x1a8521+'/'+_0x52c098)['json'](_0x23b8b0);}return null;};}function saveUpdates(_0x3a031e){return function(_0x902a94){if(_0x902a94){return _0x902a94[_0xeac6('0x14')](_0x3a031e)[_0xeac6('0x15')](function(_0x3fb377){return _0x3fb377;});}return null;};}function removeEntity(_0x2c7b14){return function(_0x5a65ad){if(_0x5a65ad){return _0x5a65ad['destroy']()[_0xeac6('0x15')](function(){var _0x2b557c=_0x5a65ad[_0xeac6('0x16')]({'plain':!![]});var _0x205ac0='WhatsappQueues';return db[_0xeac6('0x17')][_0xeac6('0x18')]({'where':{'type':_0x205ac0,'resourceId':_0x2b557c['id']}})[_0xeac6('0x15')](function(){return _0x5a65ad;});})[_0xeac6('0x15')](function(){_0x2c7b14[_0xeac6('0xc')](0xcc)[_0xeac6('0xd')]();});}};}function handleEntityNotFound(_0x1c3888){return function(_0xd81030){if(!_0xd81030){_0x1c3888['sendStatus'](0x194);}return _0xd81030;};}function handleError(_0x2d4d12,_0x2c5194){_0x2c5194=_0x2c5194||0x1f4;return function(_0xeee94f){logger[_0xeac6('0x19')](_0xeee94f[_0xeac6('0x1a')]);if(_0xeee94f[_0xeac6('0x1b')]){delete _0xeee94f[_0xeac6('0x1b')];}_0x2d4d12[_0xeac6('0xc')](_0x2c5194)[_0xeac6('0x1c')](_0xeee94f);};}exports['index']=function(_0x4dd40,_0x16b609){var _0xaf31ed={};var _0x2929ce={'count':0x0,'rows':[]};var _0x29be3f=_[_0xeac6('0x1d')](db['WhatsappQueue'][_0xeac6('0x1e')],function(_0x1c192d){return{'name':_0x1c192d[_0xeac6('0x1f')],'type':_0x1c192d[_0xeac6('0x20')][_0xeac6('0x21')]};});_0xaf31ed=qs[_0xeac6('0x22')](_0x29be3f,_0x4dd40);var _0x3f2a73={'where':_0xaf31ed['where']};return db[_0xeac6('0x23')][_0xeac6('0x12')](_0x3f2a73)[_0xeac6('0x15')](function(_0x3f9c51){_0x2929ce['count']=_0x3f9c51;_0xaf31ed['include']=qs[_0xeac6('0x24')](_0x4dd40[_0xeac6('0x25')]);return db[_0xeac6('0x23')][_0xeac6('0x26')](_0xaf31ed);})[_0xeac6('0x15')](function(_0x14d2de){_0x2929ce[_0xeac6('0x27')]=_0x14d2de;return _0x2929ce;})[_0xeac6('0x15')](respondWithFilteredResult(_0x16b609,_0xaf31ed))[_0xeac6('0x28')](handleError(_0x16b609,null));};exports[_0xeac6('0x29')]=function(_0x49df78,_0x8f818d){var _0x515dcd={'raw':!![],'where':{'id':_0x49df78[_0xeac6('0x2a')]['id']}},_0x1af757={};_0x1af757[_0xeac6('0x2b')]=_[_0xeac6('0x2c')](db['WhatsappQueue'][_0xeac6('0x1e')]);_0x1af757['query']=_['keys'](_0x49df78[_0xeac6('0x25')]);_0x1af757[_0xeac6('0x2d')]=_[_0xeac6('0x2e')](_0x1af757[_0xeac6('0x2b')],_0x1af757[_0xeac6('0x25')]);_0x515dcd[_0xeac6('0x2f')]=_[_0xeac6('0x2e')](_0x1af757['model'],qs[_0xeac6('0x30')](_0x49df78['query'][_0xeac6('0x30')]));_0x515dcd[_0xeac6('0x2f')]=_0x515dcd[_0xeac6('0x2f')][_0xeac6('0x31')]?_0x515dcd[_0xeac6('0x2f')]:_0x1af757[_0xeac6('0x2b')];if(_0x49df78[_0xeac6('0x25')][_0xeac6('0x32')]){_0x515dcd[_0xeac6('0x24')]=[{'all':!![]}];}_0x515dcd=_[_0xeac6('0x33')]({},_0x515dcd,_0x49df78[_0xeac6('0x34')]);return db[_0xeac6('0x23')][_0xeac6('0x35')](_0x515dcd)['then'](handleEntityNotFound(_0x8f818d,null))[_0xeac6('0x15')](respondWithResult(_0x8f818d,null))[_0xeac6('0x28')](handleError(_0x8f818d,null));};exports[_0xeac6('0x36')]=function(_0xe74a48,_0x57e576){return db['WhatsappQueue']['create'](_0xe74a48[_0xeac6('0x37')],{})[_0xeac6('0x15')](function(_0x12e889){var _0x2ed434=_0xe74a48[_0xeac6('0x38')][_0xeac6('0x16')]({'plain':!![]});if(!_0x2ed434)throw new Error(_0xeac6('0x39'));if(_0x2ed434[_0xeac6('0x3a')]===_0xeac6('0x38')){var _0x1571fd=_0x12e889['get']({'plain':!![]});var _0x380e57=_0xeac6('0x3b');return db[_0xeac6('0x3c')][_0xeac6('0x35')]({'where':{'name':_0x380e57,'userProfileId':_0x2ed434[_0xeac6('0x3d')]},'raw':!![]})[_0xeac6('0x15')](function(_0x1ce9b4){if(_0x1ce9b4&&_0x1ce9b4[_0xeac6('0x3e')]===0x0){return db[_0xeac6('0x17')][_0xeac6('0x36')]({'name':_0x1571fd[_0xeac6('0x1b')],'resourceId':_0x1571fd['id'],'type':_0x1ce9b4[_0xeac6('0x1b')],'sectionId':_0x1ce9b4['id']},{})[_0xeac6('0x15')](function(){return _0x12e889;});}else{return _0x12e889;}})[_0xeac6('0x28')](function(_0x5847d0){logger[_0xeac6('0x19')](_0xeac6('0x3f'),_0x5847d0);throw _0x5847d0;});}return _0x12e889;})[_0xeac6('0x15')](respondWithResult(_0x57e576,0xc9))[_0xeac6('0x28')](handleError(_0x57e576,null));};exports[_0xeac6('0x14')]=function(_0x410492,_0x5e71b0){if(_0x410492['body']['id']){delete _0x410492[_0xeac6('0x37')]['id'];}return db[_0xeac6('0x23')]['find']({'where':{'id':_0x410492[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](handleEntityNotFound(_0x5e71b0,null))[_0xeac6('0x15')](saveUpdates(_0x410492[_0xeac6('0x37')],null))['then'](respondWithResult(_0x5e71b0,null))[_0xeac6('0x28')](handleError(_0x5e71b0,null));};exports[_0xeac6('0x18')]=function(_0x1eb68a,_0x2dc240){return db[_0xeac6('0x23')]['find']({'where':{'id':_0x1eb68a[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](handleEntityNotFound(_0x2dc240,null))[_0xeac6('0x15')](removeEntity(_0x2dc240,null))[_0xeac6('0x28')](handleError(_0x2dc240,null));};exports[_0xeac6('0x40')]=function(_0x4fc7f2,_0x1af677){return db['WhatsappQueue'][_0xeac6('0x40')]()['then'](respondWithResult(_0x1af677,null))[_0xeac6('0x28')](handleError(_0x1af677,null));};exports[_0xeac6('0x41')]=function(_0x2f0a00,_0x4809b8){var _0x88be73={'raw':!![],'where':{}},_0x136020={},_0x37592d;return db[_0xeac6('0x23')][_0xeac6('0x42')]({'where':{'id':_0x2f0a00[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](handleEntityNotFound(_0x4809b8,null))[_0xeac6('0x15')](function(_0x851d97){if(_0x851d97){_0x37592d=_0x851d97[_0xeac6('0x16')]({'plain':!![]});_0x136020[_0xeac6('0x2b')]=_[_0xeac6('0x2c')](db[_0xeac6('0x43')][_0xeac6('0x1e')]);_0x136020[_0xeac6('0x25')]=_['keys'](_0x2f0a00[_0xeac6('0x25')]);_0x136020[_0xeac6('0x2d')]=_['intersection'](_0x136020[_0xeac6('0x2b')],_0x136020['query']);_0x88be73['attributes']=_['intersection'](_0x136020[_0xeac6('0x2b')],qs[_0xeac6('0x30')](_0x2f0a00['query'][_0xeac6('0x30')]));_0x88be73[_0xeac6('0x2f')]=_0x88be73[_0xeac6('0x2f')][_0xeac6('0x31')]?_0x88be73[_0xeac6('0x2f')]:_0x136020[_0xeac6('0x2b')];if(!_0x2f0a00[_0xeac6('0x25')][_0xeac6('0x44')](_0xeac6('0x45'))){_0x88be73[_0xeac6('0x11')]=qs['limit'](_0x2f0a00[_0xeac6('0x25')][_0xeac6('0x11')]);_0x88be73[_0xeac6('0xf')]=qs[_0xeac6('0xf')](_0x2f0a00[_0xeac6('0x25')][_0xeac6('0xf')]);}_0x88be73[_0xeac6('0x46')]=qs[_0xeac6('0x47')](_0x2f0a00[_0xeac6('0x25')]['sort']);_0x88be73[_0xeac6('0x48')]=qs[_0xeac6('0x2d')](_[_0xeac6('0x49')](_0x2f0a00[_0xeac6('0x25')],_0x136020[_0xeac6('0x2d')]));_0x88be73[_0xeac6('0x48')][_0xeac6('0x4a')]=_0x851d97['id'];if(_0x2f0a00[_0xeac6('0x25')]['filter']){_0x88be73[_0xeac6('0x48')]=_[_0xeac6('0x33')](_0x88be73['where'],{'$or':_[_0xeac6('0x1d')](_0x88be73[_0xeac6('0x2f')],function(_0x56f0c7){var _0x3ec923={};_0x3ec923[_0x56f0c7]={'$like':'%'+_0x2f0a00['query'][_0xeac6('0x4b')]+'%'};return _0x3ec923;})});}_0x88be73=_[_0xeac6('0x33')]({},_0x88be73,_0x2f0a00[_0xeac6('0x34')]);return db[_0xeac6('0x43')][_0xeac6('0x26')](_0x88be73);}})['then'](function(_0x39ca99){if(_0x39ca99){return db[_0xeac6('0x4c')][_0xeac6('0x4d')]({'where':{'id':_[_0xeac6('0x1d')](_0x39ca99,'UserId'),'role':_0xeac6('0x4e')},'attributes':['id',_0xeac6('0x1b'),_0xeac6('0x4f'),'updatedAt',_0xeac6('0x50')]});}})[_0xeac6('0x15')](function(_0x3fa3cd){if(_0x3fa3cd){return{'count':_0x3fa3cd[_0xeac6('0x12')],'rows':_['map'](_0x3fa3cd[_0xeac6('0x27')],function(_0x4c06be){return{'membername':_0x4c06be[_0xeac6('0x1b')],'UserId':_0x4c06be['id'],'queue_name':_0x37592d[_0xeac6('0x1b')],'WhatsappQueueId':_0x37592d['id'],'interface':util[_0xeac6('0x51')](_0xeac6('0x52'),_0xeac6('0x53'),_0x4c06be[_0xeac6('0x1b')]),'penalty':0x0,'paused':_0x4c06be['whatsappPause'],'createdAt':_0x4c06be['createdAt'],'updatedAt':_0x4c06be[_0xeac6('0x54')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xeac6('0x15')](respondWithFilteredResult(_0x4809b8,_0x88be73))[_0xeac6('0x28')](handleError(_0x4809b8,null));};exports[_0xeac6('0x55')]=function(_0x2e4161,_0x5d65af){var _0x1671e9={};var _0x468912={};var _0x1ae17b;var _0x400cc3;return db[_0xeac6('0x23')][_0xeac6('0x42')]({'where':{'id':_0x2e4161[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](handleEntityNotFound(_0x5d65af,null))[_0xeac6('0x15')](function(_0x2b5697){if(_0x2b5697){_0x1ae17b=_0x2b5697;_0x468912[_0xeac6('0x2b')]=_[_0xeac6('0x2c')](db[_0xeac6('0x56')]['rawAttributes']);_0x468912[_0xeac6('0x25')]=_['keys'](_0x2e4161[_0xeac6('0x25')]);_0x468912['filters']=_[_0xeac6('0x2e')](_0x468912[_0xeac6('0x2b')],_0x468912[_0xeac6('0x25')]);_0x1671e9[_0xeac6('0x2f')]=_['intersection'](_0x468912[_0xeac6('0x2b')],qs['fields'](_0x2e4161[_0xeac6('0x25')][_0xeac6('0x30')]));_0x1671e9['attributes']=_0x1671e9[_0xeac6('0x2f')][_0xeac6('0x31')]?_0x1671e9['attributes']:_0x468912[_0xeac6('0x2b')];_0x1671e9[_0xeac6('0x46')]=qs['sort'](_0x2e4161[_0xeac6('0x25')][_0xeac6('0x47')]);_0x1671e9[_0xeac6('0x48')]=qs[_0xeac6('0x2d')](_[_0xeac6('0x49')](_0x2e4161[_0xeac6('0x25')],_0x468912[_0xeac6('0x2d')]));if(_0x2e4161['query'][_0xeac6('0x4b')]){_0x1671e9['where']=_[_0xeac6('0x33')](_0x1671e9[_0xeac6('0x48')],{'$or':_[_0xeac6('0x1d')](_0x1671e9[_0xeac6('0x2f')],function(_0x295e4d){var _0x4bcd3d={};_0x4bcd3d[_0x295e4d]={'$like':'%'+_0x2e4161['query'][_0xeac6('0x4b')]+'%'};return _0x4bcd3d;})});}_0x1671e9=_[_0xeac6('0x33')]({},_0x1671e9,_0x2e4161[_0xeac6('0x34')]);return _0x1ae17b[_0xeac6('0x55')](_0x1671e9);}})['then'](function(_0xc8c2b6){if(_0xc8c2b6){_0x400cc3=_0xc8c2b6['length'];if(!_0x2e4161[_0xeac6('0x25')][_0xeac6('0x44')](_0xeac6('0x45'))){_0x1671e9[_0xeac6('0x11')]=qs[_0xeac6('0x11')](_0x2e4161[_0xeac6('0x25')][_0xeac6('0x11')]);_0x1671e9[_0xeac6('0xf')]=qs[_0xeac6('0xf')](_0x2e4161[_0xeac6('0x25')][_0xeac6('0xf')]);}return _0x1ae17b['getTeams'](_0x1671e9);}})[_0xeac6('0x15')](function(_0x231bff){if(_0x231bff){return _0x231bff?{'count':_0x400cc3,'rows':_0x231bff}:null;}})['then'](respondWithResult(_0x5d65af,null))[_0xeac6('0x28')](handleError(_0x5d65af,null));};exports['addTeams']=function(_0x57c1d1,_0xece679){var _0x4685ab=_0x57c1d1[_0xeac6('0x37')][_0xeac6('0x57')];return db[_0xeac6('0x56')]['findAll']({'where':{'id':_0x4685ab},'attributes':['id'],'include':[{'model':db[_0xeac6('0x4c')],'as':_0xeac6('0x58'),'attributes':['id','name','online',_0xeac6('0x59'),'interface'],'raw':!![]}]})[_0xeac6('0x15')](function(_0x9af4fb){if(_0x9af4fb){var _0x12851a=_[_0xeac6('0x5a')](_0x9af4fb,function(_0x33e2c8){var _0x42db3c=_0x33e2c8[_0xeac6('0x16')]({'plain':!![]});return _0x42db3c['Agents'];});return db[_0xeac6('0x23')]['find']({'where':{'id':_0x57c1d1['params']['id']}})[_0xeac6('0x15')](function(_0x2d6adf){return db[_0xeac6('0x5b')][_0xeac6('0x5c')](function(_0x413b24){return _0x2d6adf[_0xeac6('0x5d')](_0x4685ab,{'transaction':_0x413b24})[_0xeac6('0x15')](function(){return BPromise[_0xeac6('0x5e')](_0x12851a,function(_0x17b49c){return db['UserWhatsappQueue'][_0xeac6('0x5f')]({'where':{'UserId':_0x17b49c['id'],'WhatsappQueueId':_0x57c1d1['params']['id']},'transaction':_0x413b24});});})[_0xeac6('0x15')](function(){_0x12851a[_0xeac6('0x60')](function(_0x40ddb0){socket[_0xeac6('0x61')]('userWhatsappQueue:save',{'UserId':_0x40ddb0['id'],'WhatsappQueueId':_0x2d6adf['id']});});});});});}})[_0xeac6('0x15')](respondWithStatusCode(_0xece679,null))[_0xeac6('0x28')](handleError(_0xece679,null));};exports[_0xeac6('0x62')]=function(_0x50cd51,_0x347845){return db[_0xeac6('0x56')][_0xeac6('0x26')]({'where':{'id':_0x50cd51['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xeac6('0x4c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xeac6('0x15')](handleEntityNotFound(_0x347845,null))['then'](function(_0x541081){var _0x124557=_[_0xeac6('0x1d')](_0x541081,'id');var _0x93353e=[];var _0x150d1=[];var _0x48f23c=squel[_0xeac6('0x63')]();_0x48f23c['field']('tq.TeamId')[_0xeac6('0x64')](_0xeac6('0x65'),'tq')[_0xeac6('0x66')](_0xeac6('0x67'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xeac6('0x48')]('WhatsappQueueId\x20=\x20?',_0x50cd51[_0xeac6('0x2a')]['id']);for(var _0x4cb04a=0x0;_0x4cb04a<_0x541081[_0xeac6('0x31')];_0x4cb04a+=0x1){let _0x2fd182=_0x541081[_0x4cb04a];for(var _0x5b98d8=0x0;_0x5b98d8<_0x2fd182['Agents'][_0xeac6('0x31')];_0x5b98d8+=0x1){let _0x42ba25=_0x2fd182['Agents'][_0x5b98d8];var _0x497f5e=_0x48f23c[_0xeac6('0x68')]();_0x497f5e[_0xeac6('0x48')](_0xeac6('0x69'),_0x42ba25['id']);_0x150d1[_0xeac6('0x6a')](db['sequelize'][_0xeac6('0x25')](_0x497f5e[_0xeac6('0x6b')](),{'type':db[_0xeac6('0x5b')][_0xeac6('0x6c')]['SELECT']})[_0xeac6('0x15')](function(_0x385561){if(_0x385561[_0xeac6('0x31')]===0x1){return _0x42ba25['id'];}else{var _0x424bb3=_[_0xeac6('0x6d')](_[_0xeac6('0x1d')](_0x385561,_0xeac6('0x6e')),function(_0x144202){return _[_0xeac6('0x6f')](_0x124557,_0x144202);});if(_0x424bb3){return _0x42ba25['id'];}}}));}}return BPromise[_0xeac6('0x70')](_0x150d1)['then'](function(_0x4e9cf1){_0x93353e=_(_0x93353e)['union'](_0x4e9cf1)[_0xeac6('0x71')]()[_0xeac6('0x72')]();return db['WhatsappQueue']['find']({'where':{'id':_0x50cd51[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](function(_0x3bffb2){return db['sequelize']['transaction'](function(_0x4b3571){return _0x3bffb2[_0xeac6('0x62')](_0x50cd51[_0xeac6('0x25')]['ids'],{'transaction':_0x4b3571})[_0xeac6('0x15')](function(){if(!_['isEmpty'](_0x93353e)){return _0x3bffb2[_0xeac6('0x73')](_0x93353e,{'transaction':_0x4b3571});}})['then'](function(){_0x93353e['forEach'](function(_0x2ed768){socket[_0xeac6('0x61')]('userWhatsappQueue:remove',{'UserId':_0x2ed768,'WhatsappQueueId':_0x3bffb2['id']});});});});});});})[_0xeac6('0x15')](respondWithStatusCode(_0x347845,null))['catch'](handleError(_0x347845,null));};exports[_0xeac6('0x74')]=function(_0x478d11,_0x4f84dc){return db[_0xeac6('0x23')][_0xeac6('0x35')]({'where':{'id':_0x478d11[_0xeac6('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4f84dc,null))[_0xeac6('0x15')](function(_0x2d65ab){if(_0x2d65ab){return _0x2d65ab[_0xeac6('0x74')](_0x478d11[_0xeac6('0x37')][_0xeac6('0x57')],_[_0xeac6('0x75')](_0x478d11[_0xeac6('0x37')],[_0xeac6('0x57'),'id'])||{})[_0xeac6('0x76')](function(_0x1a4d63){for(var _0x358ad9=0x0;_0x358ad9<_0x478d11[_0xeac6('0x37')]['ids'][_0xeac6('0x31')];_0x358ad9+=0x1){socket[_0xeac6('0x61')]('userWhatsappQueue:save',{'UserId':Number(_0x478d11[_0xeac6('0x37')][_0xeac6('0x57')][_0x358ad9]),'WhatsappQueueId':Number(_0x478d11[_0xeac6('0x2a')]['id'])});}return _0x1a4d63;});}})[_0xeac6('0x15')](respondWithResult(_0x4f84dc,null))[_0xeac6('0x28')](handleError(_0x4f84dc,null));};exports['removeAgents']=function(_0x1e9aff,_0x57d530){return db[_0xeac6('0x23')][_0xeac6('0x35')]({'where':{'id':_0x1e9aff[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](handleEntityNotFound(_0x57d530,null))[_0xeac6('0x15')](function(_0x116192){if(_0x116192){return _0x116192[_0xeac6('0x73')](_0x1e9aff['query'][_0xeac6('0x57')])[_0xeac6('0x15')](function(){if(_[_0xeac6('0x77')](_0x1e9aff[_0xeac6('0x25')]['ids'])){for(var _0x1b25f5=0x0;_0x1b25f5<_0x1e9aff[_0xeac6('0x25')]['ids'][_0xeac6('0x31')];_0x1b25f5+=0x1){socket[_0xeac6('0x61')](_0xeac6('0x78'),{'UserId':Number(_0x1e9aff[_0xeac6('0x25')][_0xeac6('0x57')][_0x1b25f5]),'WhatsappQueueId':Number(_0x1e9aff[_0xeac6('0x2a')]['id'])});}}else{socket['emit'](_0xeac6('0x78'),{'UserId':Number(_0x1e9aff['query'][_0xeac6('0x57')]),'WhatsappQueueId':Number(_0x1e9aff[_0xeac6('0x2a')]['id'])});}});}})[_0xeac6('0x15')](respondWithStatusCode(_0x57d530,null))[_0xeac6('0x28')](handleError(_0x57d530,null));};exports[_0xeac6('0x79')]=function(_0x9c05a,_0xe58d5e){var _0x13bd37={};var _0x57572f={};var _0x163b4e;var _0x11679c;return db[_0xeac6('0x23')][_0xeac6('0x42')]({'where':{'id':_0x9c05a[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](handleEntityNotFound(_0xe58d5e,null))[_0xeac6('0x15')](function(_0x5c8b43){if(_0x5c8b43){_0x163b4e=_0x5c8b43;_0x57572f[_0xeac6('0x2b')]=_['keys'](db[_0xeac6('0x4c')][_0xeac6('0x1e')]);_0x57572f['query']=_[_0xeac6('0x2c')](_0x9c05a[_0xeac6('0x25')]);_0x57572f[_0xeac6('0x2d')]=_['intersection'](_0x57572f['model'],_0x57572f[_0xeac6('0x25')]);_0x13bd37[_0xeac6('0x2f')]=_[_0xeac6('0x2e')](_0x57572f[_0xeac6('0x2b')],qs[_0xeac6('0x30')](_0x9c05a[_0xeac6('0x25')]['fields']));_0x13bd37['attributes']=_0x13bd37['attributes']['length']?_0x13bd37[_0xeac6('0x2f')]:_0x57572f[_0xeac6('0x2b')];_0x13bd37[_0xeac6('0x46')]=qs[_0xeac6('0x47')](_0x9c05a['query'][_0xeac6('0x47')]);_0x13bd37[_0xeac6('0x48')]=qs['filters'](_['pick'](_0x9c05a[_0xeac6('0x25')],_0x57572f[_0xeac6('0x2d')]));if(_0x9c05a[_0xeac6('0x25')][_0xeac6('0x4b')]){_0x13bd37[_0xeac6('0x48')]=_['merge'](_0x13bd37[_0xeac6('0x48')],{'$or':_[_0xeac6('0x1d')](_0x13bd37[_0xeac6('0x2f')],function(_0x37897d){var _0x5a1012={};_0x5a1012[_0x37897d]={'$like':'%'+_0x9c05a[_0xeac6('0x25')][_0xeac6('0x4b')]+'%'};return _0x5a1012;})});}_0x13bd37=_[_0xeac6('0x33')]({},_0x13bd37,_0x9c05a['options']);return _0x163b4e[_0xeac6('0x79')](_0x13bd37);}})['then'](function(_0x591307){if(_0x591307){_0x11679c=_0x591307[_0xeac6('0x31')];if(!_0x9c05a[_0xeac6('0x25')][_0xeac6('0x44')](_0xeac6('0x45'))){_0x13bd37[_0xeac6('0x11')]=qs[_0xeac6('0x11')](_0x9c05a['query'][_0xeac6('0x11')]);_0x13bd37['offset']=qs['offset'](_0x9c05a[_0xeac6('0x25')][_0xeac6('0xf')]);}return _0x163b4e[_0xeac6('0x79')](_0x13bd37);}})[_0xeac6('0x15')](function(_0x725d0d){if(_0x725d0d){return _0x725d0d?{'count':_0x11679c,'rows':_0x725d0d}:null;}})[_0xeac6('0x15')](respondWithResult(_0xe58d5e,null))[_0xeac6('0x28')](handleError(_0xe58d5e,null));}; \ No newline at end of file +var _0xfad0=['map','filter','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','order','pick','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','removeTeams','join','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','removeAgents','isArray','getAgents','hasOwnProperty','bluebird','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./whatsappQueue.socket','end','status','json','limit','undefined','offset','count','set','Content-Range','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','index','WhatsappQueue','rawAttributes','getOptions','where','include','findAll','rows','catch','show','model','keys','query','filters','intersection','fields','attributes','includeAll','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','params','find','describe','getMembers','findOne','UserWhatsappQueue','length','nolimit','sort','WhatsappQueueId','merge'];(function(_0x7ca506,_0x1e22f8){var _0x24f0e1=function(_0x140c99){while(--_0x140c99){_0x7ca506['push'](_0x7ca506['shift']());}};_0x24f0e1(++_0x1e22f8);}(_0xfad0,0x1a1));var _0x0fad=function(_0x5219e4,_0x4bb57b){_0x5219e4=_0x5219e4-0x0;var _0x31a319=_0xfad0[_0x5219e4];return _0x31a319;};'use strict';var BPromise=require(_0x0fad('0x0'));var util=require('util');var _=require(_0x0fad('0x1'));var squel=require(_0x0fad('0x2'));var Redis=require(_0x0fad('0x3'));var qs=require(_0x0fad('0x4'));var logger=require('../../config/logger')(_0x0fad('0x5'));var config=require(_0x0fad('0x6'));var db=require(_0x0fad('0x7'))['db'];config['redis']=_[_0x0fad('0x8')](config['redis'],{'host':_0x0fad('0x9'),'port':0x18eb});var socket=require(_0x0fad('0xa'))(new Redis(config[_0x0fad('0xb')]));require(_0x0fad('0xc'))['register'](socket);function respondWithStatusCode(_0x4d0f81,_0x518b7e){_0x518b7e=_0x518b7e||0xcc;return function(_0x1b03ce){if(_0x1b03ce){return _0x4d0f81['sendStatus'](_0x518b7e);}return _0x4d0f81['status'](_0x518b7e)[_0x0fad('0xd')]();};}function respondWithResult(_0x250b4a,_0x1e6938){_0x1e6938=_0x1e6938||0xc8;return function(_0x360564){if(_0x360564){return _0x250b4a[_0x0fad('0xe')](_0x1e6938)[_0x0fad('0xf')](_0x360564);}};}function respondWithFilteredResult(_0x17bdf2,_0x1c5b53){return function(_0x5272bb){if(_0x5272bb){var _0x57e0d5=typeof _0x1c5b53['offset']==='undefined'&&typeof _0x1c5b53[_0x0fad('0x10')]===_0x0fad('0x11');var _0x23ec1e=_0x5272bb['count'];var _0x1443c3=_0x57e0d5?0x0:_0x1c5b53[_0x0fad('0x12')];var _0x40fd95=_0x57e0d5?_0x5272bb[_0x0fad('0x13')]:_0x1c5b53[_0x0fad('0x12')]+_0x1c5b53[_0x0fad('0x10')];var _0x4ef336;if(_0x40fd95>=_0x23ec1e){_0x40fd95=_0x23ec1e;_0x4ef336=0xc8;}else{_0x4ef336=0xce;}_0x17bdf2[_0x0fad('0xe')](_0x4ef336);return _0x17bdf2[_0x0fad('0x14')](_0x0fad('0x15'),_0x1443c3+'-'+_0x40fd95+'/'+_0x23ec1e)[_0x0fad('0xf')](_0x5272bb);}return null;};}function saveUpdates(_0x3bf174){return function(_0x276e7b){if(_0x276e7b){return _0x276e7b[_0x0fad('0x16')](_0x3bf174)[_0x0fad('0x17')](function(_0x59e9ba){return _0x59e9ba;});}return null;};}function removeEntity(_0x19fc5b){return function(_0xb64277){if(_0xb64277){return _0xb64277[_0x0fad('0x18')]()[_0x0fad('0x17')](function(){var _0x4c0e3a=_0xb64277[_0x0fad('0x19')]({'plain':!![]});var _0x5c2048=_0x0fad('0x1a');return db[_0x0fad('0x1b')][_0x0fad('0x18')]({'where':{'type':_0x5c2048,'resourceId':_0x4c0e3a['id']}})['then'](function(){return _0xb64277;});})[_0x0fad('0x17')](function(){_0x19fc5b[_0x0fad('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x878d3b){return function(_0x20b2a9){if(!_0x20b2a9){_0x878d3b[_0x0fad('0x1c')](0x194);}return _0x20b2a9;};}function handleError(_0x518855,_0x2bce00){_0x2bce00=_0x2bce00||0x1f4;return function(_0x36e92a){logger[_0x0fad('0x1d')](_0x36e92a[_0x0fad('0x1e')]);if(_0x36e92a['name']){delete _0x36e92a[_0x0fad('0x1f')];}_0x518855[_0x0fad('0xe')](_0x2bce00)[_0x0fad('0x20')](_0x36e92a);};}exports[_0x0fad('0x21')]=function(_0x56bcc1,_0x3ac419){var _0xb8b05={};var _0x37b0f7={'count':0x0,'rows':[]};var _0xdd09da=_['map'](db[_0x0fad('0x22')][_0x0fad('0x23')],function(_0x4b5909){return{'name':_0x4b5909['fieldName'],'type':_0x4b5909['type']['key']};});_0xb8b05=qs[_0x0fad('0x24')](_0xdd09da,_0x56bcc1);var _0x3380b0={'where':_0xb8b05[_0x0fad('0x25')]};return db[_0x0fad('0x22')][_0x0fad('0x13')](_0x3380b0)[_0x0fad('0x17')](function(_0x125692){_0x37b0f7[_0x0fad('0x13')]=_0x125692;_0xb8b05['include']=qs[_0x0fad('0x26')](_0x56bcc1['query']);return db[_0x0fad('0x22')][_0x0fad('0x27')](_0xb8b05);})[_0x0fad('0x17')](function(_0x5056c1){_0x37b0f7[_0x0fad('0x28')]=_0x5056c1;return _0x37b0f7;})[_0x0fad('0x17')](respondWithFilteredResult(_0x3ac419,_0xb8b05))[_0x0fad('0x29')](handleError(_0x3ac419,null));};exports[_0x0fad('0x2a')]=function(_0xdb5322,_0x3124e){var _0x5bb57b={'raw':!![],'where':{'id':_0xdb5322['params']['id']}},_0x18fead={};_0x18fead[_0x0fad('0x2b')]=_[_0x0fad('0x2c')](db[_0x0fad('0x22')][_0x0fad('0x23')]);_0x18fead['query']=_[_0x0fad('0x2c')](_0xdb5322[_0x0fad('0x2d')]);_0x18fead[_0x0fad('0x2e')]=_['intersection'](_0x18fead['model'],_0x18fead[_0x0fad('0x2d')]);_0x5bb57b['attributes']=_[_0x0fad('0x2f')](_0x18fead[_0x0fad('0x2b')],qs[_0x0fad('0x30')](_0xdb5322[_0x0fad('0x2d')][_0x0fad('0x30')]));_0x5bb57b[_0x0fad('0x31')]=_0x5bb57b[_0x0fad('0x31')]['length']?_0x5bb57b[_0x0fad('0x31')]:_0x18fead['model'];if(_0xdb5322[_0x0fad('0x2d')][_0x0fad('0x32')]){_0x5bb57b[_0x0fad('0x26')]=[{'all':!![]}];}_0x5bb57b=_['merge']({},_0x5bb57b,_0xdb5322[_0x0fad('0x33')]);return db['WhatsappQueue']['find'](_0x5bb57b)['then'](handleEntityNotFound(_0x3124e,null))['then'](respondWithResult(_0x3124e,null))['catch'](handleError(_0x3124e,null));};exports[_0x0fad('0x34')]=function(_0x3af486,_0x31eac1){return db['WhatsappQueue'][_0x0fad('0x34')](_0x3af486['body'],{})[_0x0fad('0x17')](function(_0x2507ad){var _0x26cff1=_0x3af486[_0x0fad('0x35')][_0x0fad('0x19')]({'plain':!![]});if(!_0x26cff1)throw new Error(_0x0fad('0x36'));if(_0x26cff1[_0x0fad('0x37')]==='user'){var _0x251c32=_0x2507ad[_0x0fad('0x19')]({'plain':!![]});var _0x29d017=_0x0fad('0x1a');return db[_0x0fad('0x38')]['find']({'where':{'name':_0x29d017,'userProfileId':_0x26cff1[_0x0fad('0x39')]},'raw':!![]})['then'](function(_0x519d79){if(_0x519d79&&_0x519d79[_0x0fad('0x3a')]===0x0){return db[_0x0fad('0x1b')][_0x0fad('0x34')]({'name':_0x251c32[_0x0fad('0x1f')],'resourceId':_0x251c32['id'],'type':_0x519d79[_0x0fad('0x1f')],'sectionId':_0x519d79['id']},{})['then'](function(){return _0x2507ad;});}else{return _0x2507ad;}})['catch'](function(_0x3227b1){logger[_0x0fad('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3227b1);throw _0x3227b1;});}return _0x2507ad;})['then'](respondWithResult(_0x31eac1,0xc9))[_0x0fad('0x29')](handleError(_0x31eac1,null));};exports['update']=function(_0x5ba63c,_0x7b1eb0){if(_0x5ba63c[_0x0fad('0x3b')]['id']){delete _0x5ba63c[_0x0fad('0x3b')]['id'];}return db[_0x0fad('0x22')]['find']({'where':{'id':_0x5ba63c[_0x0fad('0x3c')]['id']}})[_0x0fad('0x17')](handleEntityNotFound(_0x7b1eb0,null))['then'](saveUpdates(_0x5ba63c[_0x0fad('0x3b')],null))[_0x0fad('0x17')](respondWithResult(_0x7b1eb0,null))[_0x0fad('0x29')](handleError(_0x7b1eb0,null));};exports[_0x0fad('0x18')]=function(_0x30b566,_0x370b2e){return db[_0x0fad('0x22')][_0x0fad('0x3d')]({'where':{'id':_0x30b566[_0x0fad('0x3c')]['id']}})['then'](handleEntityNotFound(_0x370b2e,null))[_0x0fad('0x17')](removeEntity(_0x370b2e,null))['catch'](handleError(_0x370b2e,null));};exports[_0x0fad('0x3e')]=function(_0x1c1ea1,_0x192582){return db['WhatsappQueue'][_0x0fad('0x3e')]()[_0x0fad('0x17')](respondWithResult(_0x192582,null))[_0x0fad('0x29')](handleError(_0x192582,null));};exports[_0x0fad('0x3f')]=function(_0x52cbb9,_0xc8ac5){var _0x14bb0c={'raw':!![],'where':{}},_0x403e37={},_0x2b046c;return db[_0x0fad('0x22')][_0x0fad('0x40')]({'where':{'id':_0x52cbb9[_0x0fad('0x3c')]['id']}})[_0x0fad('0x17')](handleEntityNotFound(_0xc8ac5,null))[_0x0fad('0x17')](function(_0x46aab1){if(_0x46aab1){_0x2b046c=_0x46aab1[_0x0fad('0x19')]({'plain':!![]});_0x403e37[_0x0fad('0x2b')]=_[_0x0fad('0x2c')](db[_0x0fad('0x41')][_0x0fad('0x23')]);_0x403e37[_0x0fad('0x2d')]=_[_0x0fad('0x2c')](_0x52cbb9[_0x0fad('0x2d')]);_0x403e37[_0x0fad('0x2e')]=_[_0x0fad('0x2f')](_0x403e37[_0x0fad('0x2b')],_0x403e37['query']);_0x14bb0c[_0x0fad('0x31')]=_['intersection'](_0x403e37[_0x0fad('0x2b')],qs[_0x0fad('0x30')](_0x52cbb9[_0x0fad('0x2d')][_0x0fad('0x30')]));_0x14bb0c[_0x0fad('0x31')]=_0x14bb0c['attributes'][_0x0fad('0x42')]?_0x14bb0c['attributes']:_0x403e37[_0x0fad('0x2b')];if(!_0x52cbb9[_0x0fad('0x2d')]['hasOwnProperty'](_0x0fad('0x43'))){_0x14bb0c[_0x0fad('0x10')]=qs[_0x0fad('0x10')](_0x52cbb9[_0x0fad('0x2d')][_0x0fad('0x10')]);_0x14bb0c['offset']=qs['offset'](_0x52cbb9[_0x0fad('0x2d')][_0x0fad('0x12')]);}_0x14bb0c['order']=qs[_0x0fad('0x44')](_0x52cbb9[_0x0fad('0x2d')]['sort']);_0x14bb0c[_0x0fad('0x25')]=qs[_0x0fad('0x2e')](_['pick'](_0x52cbb9[_0x0fad('0x2d')],_0x403e37[_0x0fad('0x2e')]));_0x14bb0c[_0x0fad('0x25')][_0x0fad('0x45')]=_0x46aab1['id'];if(_0x52cbb9[_0x0fad('0x2d')]['filter']){_0x14bb0c['where']=_[_0x0fad('0x46')](_0x14bb0c[_0x0fad('0x25')],{'$or':_[_0x0fad('0x47')](_0x14bb0c[_0x0fad('0x31')],function(_0x1c6a47){var _0x3fb514={};_0x3fb514[_0x1c6a47]={'$like':'%'+_0x52cbb9[_0x0fad('0x2d')][_0x0fad('0x48')]+'%'};return _0x3fb514;})});}_0x14bb0c=_[_0x0fad('0x46')]({},_0x14bb0c,_0x52cbb9[_0x0fad('0x33')]);return db['UserWhatsappQueue'][_0x0fad('0x27')](_0x14bb0c);}})[_0x0fad('0x17')](function(_0x2810a8){if(_0x2810a8){return db['User']['findAndCountAll']({'where':{'id':_[_0x0fad('0x47')](_0x2810a8,_0x0fad('0x49')),'role':_0x0fad('0x4a')},'attributes':['id',_0x0fad('0x1f'),_0x0fad('0x4b'),_0x0fad('0x4c'),_0x0fad('0x4d')]});}})[_0x0fad('0x17')](function(_0x1af9a5){if(_0x1af9a5){return{'count':_0x1af9a5[_0x0fad('0x13')],'rows':_['map'](_0x1af9a5[_0x0fad('0x28')],function(_0x5828d5){return{'membername':_0x5828d5[_0x0fad('0x1f')],'UserId':_0x5828d5['id'],'queue_name':_0x2b046c[_0x0fad('0x1f')],'WhatsappQueueId':_0x2b046c['id'],'interface':util[_0x0fad('0x4e')](_0x0fad('0x4f'),_0x0fad('0x50'),_0x5828d5[_0x0fad('0x1f')]),'penalty':0x0,'paused':_0x5828d5['whatsappPause'],'createdAt':_0x5828d5['createdAt'],'updatedAt':_0x5828d5[_0x0fad('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0fad('0x17')](respondWithFilteredResult(_0xc8ac5,_0x14bb0c))['catch'](handleError(_0xc8ac5,null));};exports[_0x0fad('0x51')]=function(_0x2b5bbf,_0x4b6b9d){var _0x7019bd={};var _0x5adbdc={};var _0x24480d;var _0x45385b;return db[_0x0fad('0x22')][_0x0fad('0x40')]({'where':{'id':_0x2b5bbf[_0x0fad('0x3c')]['id']}})[_0x0fad('0x17')](handleEntityNotFound(_0x4b6b9d,null))[_0x0fad('0x17')](function(_0x4a1c12){if(_0x4a1c12){_0x24480d=_0x4a1c12;_0x5adbdc['model']=_[_0x0fad('0x2c')](db[_0x0fad('0x52')][_0x0fad('0x23')]);_0x5adbdc[_0x0fad('0x2d')]=_[_0x0fad('0x2c')](_0x2b5bbf[_0x0fad('0x2d')]);_0x5adbdc[_0x0fad('0x2e')]=_['intersection'](_0x5adbdc[_0x0fad('0x2b')],_0x5adbdc[_0x0fad('0x2d')]);_0x7019bd['attributes']=_[_0x0fad('0x2f')](_0x5adbdc[_0x0fad('0x2b')],qs[_0x0fad('0x30')](_0x2b5bbf[_0x0fad('0x2d')]['fields']));_0x7019bd[_0x0fad('0x31')]=_0x7019bd[_0x0fad('0x31')]['length']?_0x7019bd[_0x0fad('0x31')]:_0x5adbdc[_0x0fad('0x2b')];_0x7019bd[_0x0fad('0x53')]=qs['sort'](_0x2b5bbf[_0x0fad('0x2d')][_0x0fad('0x44')]);_0x7019bd[_0x0fad('0x25')]=qs[_0x0fad('0x2e')](_[_0x0fad('0x54')](_0x2b5bbf[_0x0fad('0x2d')],_0x5adbdc[_0x0fad('0x2e')]));if(_0x2b5bbf['query']['filter']){_0x7019bd[_0x0fad('0x25')]=_[_0x0fad('0x46')](_0x7019bd[_0x0fad('0x25')],{'$or':_['map'](_0x7019bd[_0x0fad('0x31')],function(_0x2c1a89){var _0x1635f2={};_0x1635f2[_0x2c1a89]={'$like':'%'+_0x2b5bbf[_0x0fad('0x2d')][_0x0fad('0x48')]+'%'};return _0x1635f2;})});}_0x7019bd=_[_0x0fad('0x46')]({},_0x7019bd,_0x2b5bbf[_0x0fad('0x33')]);return _0x24480d[_0x0fad('0x51')](_0x7019bd);}})[_0x0fad('0x17')](function(_0xb26c6f){if(_0xb26c6f){_0x45385b=_0xb26c6f['length'];if(!_0x2b5bbf[_0x0fad('0x2d')]['hasOwnProperty'](_0x0fad('0x43'))){_0x7019bd[_0x0fad('0x10')]=qs[_0x0fad('0x10')](_0x2b5bbf[_0x0fad('0x2d')][_0x0fad('0x10')]);_0x7019bd[_0x0fad('0x12')]=qs[_0x0fad('0x12')](_0x2b5bbf['query'][_0x0fad('0x12')]);}return _0x24480d[_0x0fad('0x51')](_0x7019bd);}})[_0x0fad('0x17')](function(_0x418719){if(_0x418719){return _0x418719?{'count':_0x45385b,'rows':_0x418719}:null;}})[_0x0fad('0x17')](respondWithResult(_0x4b6b9d,null))[_0x0fad('0x29')](handleError(_0x4b6b9d,null));};exports['addTeams']=function(_0x2a0264,_0x58372){var _0xdf1b40=_0x2a0264[_0x0fad('0x3b')][_0x0fad('0x55')];return db['Team'][_0x0fad('0x27')]({'where':{'id':_0xdf1b40},'attributes':['id'],'include':[{'model':db[_0x0fad('0x56')],'as':_0x0fad('0x57'),'attributes':['id',_0x0fad('0x1f'),_0x0fad('0x58'),_0x0fad('0x59'),_0x0fad('0x5a')],'raw':!![]}]})[_0x0fad('0x17')](function(_0x262a3){if(_0x262a3){var _0x404a47=_[_0x0fad('0x5b')](_0x262a3,function(_0x4163a0){var _0x43f168=_0x4163a0[_0x0fad('0x19')]({'plain':!![]});return _0x43f168[_0x0fad('0x57')];});return db[_0x0fad('0x22')]['find']({'where':{'id':_0x2a0264[_0x0fad('0x3c')]['id']}})['then'](function(_0x330769){return db[_0x0fad('0x5c')][_0x0fad('0x5d')](function(_0x5dae9f){return _0x330769[_0x0fad('0x5e')](_0xdf1b40,{'transaction':_0x5dae9f})['then'](function(){return BPromise['each'](_0x404a47,function(_0x3d06bf){return db[_0x0fad('0x41')][_0x0fad('0x5f')]({'where':{'UserId':_0x3d06bf['id'],'WhatsappQueueId':_0x2a0264[_0x0fad('0x3c')]['id']},'transaction':_0x5dae9f});});})[_0x0fad('0x17')](function(){_0x404a47[_0x0fad('0x60')](function(_0x2f04ae){socket[_0x0fad('0x61')]('userWhatsappQueue:save',{'UserId':_0x2f04ae['id'],'WhatsappQueueId':_0x330769['id']});});});});});}})[_0x0fad('0x17')](respondWithStatusCode(_0x58372,null))[_0x0fad('0x29')](handleError(_0x58372,null));};exports[_0x0fad('0x62')]=function(_0x36927c,_0xb166ac){return db[_0x0fad('0x52')][_0x0fad('0x27')]({'where':{'id':_0x36927c[_0x0fad('0x2d')][_0x0fad('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0fad('0x57'),'attributes':['id'],'raw':!![]}]})[_0x0fad('0x17')](handleEntityNotFound(_0xb166ac,null))[_0x0fad('0x17')](function(_0x1f1021){var _0x2a3979=_[_0x0fad('0x47')](_0x1f1021,'id');var _0x1dba5a=[];var _0x308cbd=[];var _0x303278=squel['select']();_0x303278['field']('tq.TeamId')['from']('team_has_whatsapp_queues','tq')[_0x0fad('0x63')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0fad('0x25')](_0x0fad('0x64'),_0x36927c[_0x0fad('0x3c')]['id']);for(var _0x26defb=0x0;_0x26defb<_0x1f1021[_0x0fad('0x42')];_0x26defb+=0x1){let _0x2031b3=_0x1f1021[_0x26defb];for(var _0x2e2f47=0x0;_0x2e2f47<_0x2031b3[_0x0fad('0x57')][_0x0fad('0x42')];_0x2e2f47+=0x1){let _0x21d2ed=_0x2031b3[_0x0fad('0x57')][_0x2e2f47];var _0x127618=_0x303278[_0x0fad('0x65')]();_0x127618[_0x0fad('0x25')](_0x0fad('0x66'),_0x21d2ed['id']);_0x308cbd[_0x0fad('0x67')](db[_0x0fad('0x5c')][_0x0fad('0x2d')](_0x127618[_0x0fad('0x68')](),{'type':db['sequelize'][_0x0fad('0x69')]['SELECT']})[_0x0fad('0x17')](function(_0x19829f){if(_0x19829f['length']===0x1){return _0x21d2ed['id'];}else{var _0x9ba911=_[_0x0fad('0x6a')](_['map'](_0x19829f,_0x0fad('0x6b')),function(_0x1433a8){return _[_0x0fad('0x6c')](_0x2a3979,_0x1433a8);});if(_0x9ba911){return _0x21d2ed['id'];}}}));}}return BPromise[_0x0fad('0x6d')](_0x308cbd)['then'](function(_0x43d808){_0x1dba5a=_(_0x1dba5a)[_0x0fad('0x6e')](_0x43d808)[_0x0fad('0x6f')]()[_0x0fad('0x70')]();return db[_0x0fad('0x22')][_0x0fad('0x3d')]({'where':{'id':_0x36927c['params']['id']}})[_0x0fad('0x17')](function(_0x1d45a5){return db[_0x0fad('0x5c')][_0x0fad('0x5d')](function(_0x4e9a61){return _0x1d45a5['removeTeams'](_0x36927c[_0x0fad('0x2d')][_0x0fad('0x55')],{'transaction':_0x4e9a61})[_0x0fad('0x17')](function(){if(!_['isEmpty'](_0x1dba5a)){return _0x1d45a5['removeAgents'](_0x1dba5a,{'transaction':_0x4e9a61});}})[_0x0fad('0x17')](function(){_0x1dba5a[_0x0fad('0x60')](function(_0xe98388){socket[_0x0fad('0x61')](_0x0fad('0x71'),{'UserId':_0xe98388,'WhatsappQueueId':_0x1d45a5['id']});});});});});});})[_0x0fad('0x17')](respondWithStatusCode(_0xb166ac,null))[_0x0fad('0x29')](handleError(_0xb166ac,null));};exports[_0x0fad('0x72')]=function(_0x294936,_0x5a4b35){return db[_0x0fad('0x22')][_0x0fad('0x3d')]({'where':{'id':_0x294936['params']['id']}})['then'](handleEntityNotFound(_0x5a4b35,null))[_0x0fad('0x17')](function(_0x61550d){if(_0x61550d){return _0x61550d[_0x0fad('0x72')](_0x294936[_0x0fad('0x3b')][_0x0fad('0x55')],_[_0x0fad('0x73')](_0x294936[_0x0fad('0x3b')],[_0x0fad('0x55'),'id'])||{})[_0x0fad('0x74')](function(_0x1353dd){for(var _0x9d9e1=0x0;_0x9d9e1<_0x294936['body'][_0x0fad('0x55')]['length'];_0x9d9e1+=0x1){socket[_0x0fad('0x61')](_0x0fad('0x75'),{'UserId':Number(_0x294936['body'][_0x0fad('0x55')][_0x9d9e1]),'WhatsappQueueId':Number(_0x294936[_0x0fad('0x3c')]['id'])});}return _0x1353dd;});}})[_0x0fad('0x17')](respondWithResult(_0x5a4b35,null))[_0x0fad('0x29')](handleError(_0x5a4b35,null));};exports[_0x0fad('0x76')]=function(_0x22a547,_0x10be29){return db['WhatsappQueue'][_0x0fad('0x3d')]({'where':{'id':_0x22a547[_0x0fad('0x3c')]['id']}})[_0x0fad('0x17')](handleEntityNotFound(_0x10be29,null))['then'](function(_0x40de03){if(_0x40de03){return _0x40de03[_0x0fad('0x76')](_0x22a547[_0x0fad('0x2d')][_0x0fad('0x55')])['then'](function(){if(_[_0x0fad('0x77')](_0x22a547['query']['ids'])){for(var _0x3b528c=0x0;_0x3b528c<_0x22a547[_0x0fad('0x2d')][_0x0fad('0x55')][_0x0fad('0x42')];_0x3b528c+=0x1){socket['emit'](_0x0fad('0x71'),{'UserId':Number(_0x22a547[_0x0fad('0x2d')]['ids'][_0x3b528c]),'WhatsappQueueId':Number(_0x22a547['params']['id'])});}}else{socket[_0x0fad('0x61')](_0x0fad('0x71'),{'UserId':Number(_0x22a547[_0x0fad('0x2d')][_0x0fad('0x55')]),'WhatsappQueueId':Number(_0x22a547['params']['id'])});}});}})[_0x0fad('0x17')](respondWithStatusCode(_0x10be29,null))['catch'](handleError(_0x10be29,null));};exports[_0x0fad('0x78')]=function(_0x40c415,_0x1ec6a5){var _0x3fb67e={};var _0x1992a8={};var _0x5e8e43;var _0x52ee35;return db[_0x0fad('0x22')][_0x0fad('0x40')]({'where':{'id':_0x40c415[_0x0fad('0x3c')]['id']}})[_0x0fad('0x17')](handleEntityNotFound(_0x1ec6a5,null))[_0x0fad('0x17')](function(_0x1aa7c6){if(_0x1aa7c6){_0x5e8e43=_0x1aa7c6;_0x1992a8[_0x0fad('0x2b')]=_[_0x0fad('0x2c')](db['User']['rawAttributes']);_0x1992a8[_0x0fad('0x2d')]=_[_0x0fad('0x2c')](_0x40c415[_0x0fad('0x2d')]);_0x1992a8['filters']=_['intersection'](_0x1992a8['model'],_0x1992a8[_0x0fad('0x2d')]);_0x3fb67e[_0x0fad('0x31')]=_[_0x0fad('0x2f')](_0x1992a8[_0x0fad('0x2b')],qs[_0x0fad('0x30')](_0x40c415[_0x0fad('0x2d')][_0x0fad('0x30')]));_0x3fb67e[_0x0fad('0x31')]=_0x3fb67e[_0x0fad('0x31')][_0x0fad('0x42')]?_0x3fb67e[_0x0fad('0x31')]:_0x1992a8[_0x0fad('0x2b')];_0x3fb67e[_0x0fad('0x53')]=qs['sort'](_0x40c415[_0x0fad('0x2d')][_0x0fad('0x44')]);_0x3fb67e[_0x0fad('0x25')]=qs['filters'](_['pick'](_0x40c415[_0x0fad('0x2d')],_0x1992a8[_0x0fad('0x2e')]));if(_0x40c415['query']['filter']){_0x3fb67e[_0x0fad('0x25')]=_[_0x0fad('0x46')](_0x3fb67e[_0x0fad('0x25')],{'$or':_['map'](_0x3fb67e[_0x0fad('0x31')],function(_0x2396cd){var _0x28ba07={};_0x28ba07[_0x2396cd]={'$like':'%'+_0x40c415[_0x0fad('0x2d')]['filter']+'%'};return _0x28ba07;})});}_0x3fb67e=_[_0x0fad('0x46')]({},_0x3fb67e,_0x40c415[_0x0fad('0x33')]);return _0x5e8e43[_0x0fad('0x78')](_0x3fb67e);}})[_0x0fad('0x17')](function(_0xa25a3d){if(_0xa25a3d){_0x52ee35=_0xa25a3d['length'];if(!_0x40c415['query'][_0x0fad('0x79')](_0x0fad('0x43'))){_0x3fb67e[_0x0fad('0x10')]=qs[_0x0fad('0x10')](_0x40c415[_0x0fad('0x2d')][_0x0fad('0x10')]);_0x3fb67e[_0x0fad('0x12')]=qs['offset'](_0x40c415[_0x0fad('0x2d')][_0x0fad('0x12')]);}return _0x5e8e43['getAgents'](_0x3fb67e);}})[_0x0fad('0x17')](function(_0x2fc208){if(_0x2fc208){return _0x2fc208?{'count':_0x52ee35,'rows':_0x2fc208}:null;}})['then'](respondWithResult(_0x1ec6a5,null))[_0x0fad('0x29')](handleError(_0x1ec6a5,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 3c99b34..1642fce 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 _0x9bc0=['update','remove','emit','hasOwnProperty','hook','exports','events','save'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0x9bc0,0x1c6));var _0x09bc=function(_0x4bcbc9,_0x59c051){_0x4bcbc9=_0x4bcbc9-0x0;var _0xe486f1=_0x9bc0[_0x4bcbc9];return _0xe486f1;};'use strict';var EventEmitter=require(_0x09bc('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x09bc('0x1'),'afterUpdate':_0x09bc('0x2'),'afterDestroy':_0x09bc('0x3')};function emitEvent(_0x12670b){return function(_0x22dedf,_0x1ffede,_0x404f32){WhatsappQueueEvents[_0x09bc('0x4')](_0x12670b+':'+_0x22dedf['id'],_0x22dedf);WhatsappQueueEvents[_0x09bc('0x4')](_0x12670b,_0x22dedf);_0x404f32(null);};}for(var e in events){if(events[_0x09bc('0x5')](e)){var event=events[e];WhatsappQueue[_0x09bc('0x6')](e,emitEvent(event));}}module[_0x09bc('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xe887=['WhatsappQueue','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe887,0x8e));var _0x7e88=function(_0x34c825,_0x44cad4){_0x34c825=_0x34c825-0x0;var _0x2fde13=_0xe887[_0x34c825];return _0x2fde13;};'use strict';var EventEmitter=require(_0x7e88('0x0'));var WhatsappQueue=require(_0x7e88('0x1'))['db'][_0x7e88('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7e88('0x3'),'afterUpdate':_0x7e88('0x4'),'afterDestroy':_0x7e88('0x5')};function emitEvent(_0x58ef39){return function(_0x478ab7,_0x2b8007,_0x66f2b8){WhatsappQueueEvents[_0x7e88('0x6')](_0x58ef39+':'+_0x478ab7['id'],_0x478ab7);WhatsappQueueEvents[_0x7e88('0x6')](_0x58ef39,_0x478ab7);_0x66f2b8(null);};}for(var e in events){if(events[_0x7e88('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x7e88('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 3cad5f6..ac6f2c9 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 _0x8bbf=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','WhatsappQueue','lodash'];(function(_0x414f6e,_0x50f3df){var _0x1b8564=function(_0x5e14d7){while(--_0x5e14d7){_0x414f6e['push'](_0x414f6e['shift']());}};_0x1b8564(++_0x50f3df);}(_0x8bbf,0xef));var _0xf8bb=function(_0x3ce7bf,_0x73c3af){_0x3ce7bf=_0x3ce7bf-0x0;var _0x453a37=_0x8bbf[_0x3ce7bf];return _0x453a37;};'use strict';var _=require(_0xf8bb('0x0'));var util=require(_0xf8bb('0x1'));var logger=require(_0xf8bb('0x2'))(_0xf8bb('0x3'));var moment=require(_0xf8bb('0x4'));var BPromise=require(_0xf8bb('0x5'));var rp=require(_0xf8bb('0x6'));var fs=require('fs');var path=require(_0xf8bb('0x7'));var rimraf=require(_0xf8bb('0x8'));var config=require(_0xf8bb('0x9'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x493c85,_0x5f9f49){return _0x493c85[_0xf8bb('0xa')](_0xf8bb('0xb'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa375=['whatsapp_queues','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','WhatsappQueue'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa375,0x14b));var _0x5a37=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0xa375[_0x102977];return _0x15c466;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5a37('0x0'))(_0x5a37('0x1'));var moment=require(_0x5a37('0x2'));var BPromise=require(_0x5a37('0x3'));var rp=require(_0x5a37('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5a37('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module[_0x5a37('0x6')]=function(_0x19a10e,_0x44dcb6){return _0x19a10e[_0x5a37('0x7')](_0x5a37('0x8'),attributes,{'tableName':_0x5a37('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 558031b..cccd29b 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 _0x81e8=['ShowWhatsappQueue','WhatsappQueue','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','./whatsappQueue.socket','register','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetWhatsappQueue','findAll','options','where','attributes','limit','include','map','model','info','stringify'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0x81e8,0x134));var _0x881e=function(_0x30d9d1,_0x14a4f9){_0x30d9d1=_0x30d9d1-0x0;var _0x3da7be=_0x81e8[_0x30d9d1];return _0x3da7be;};'use strict';var _=require(_0x881e('0x0'));var util=require(_0x881e('0x1'));var moment=require('moment');var BPromise=require(_0x881e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x881e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x881e('0x4'));var logger=require(_0x881e('0x5'))('rpc');var config=require(_0x881e('0x6'));var jayson=require(_0x881e('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x881e('0x8')]=_[_0x881e('0x9')](config['redis'],{'host':_0x881e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x881e('0xb'))[_0x881e('0xc')](socket);function respondWithRpcPromise(_0x4db6a0,_0xd8c131,_0x23e66b){return new BPromise(function(_0x51a495,_0x23348c){return client['request'](_0x4db6a0,_0x23e66b)[_0x881e('0xd')](function(_0x315426){logger['info'](_0x881e('0xe'),_0xd8c131,_0x881e('0xf'));logger[_0x881e('0x10')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0xd8c131,'request\x20sent',JSON['stringify'](_0x315426));if(_0x315426[_0x881e('0x11')]){if(_0x315426[_0x881e('0x11')]['code']===0x1f4){logger[_0x881e('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0xd8c131,_0x315426['error'][_0x881e('0x12')]);return _0x23348c(_0x315426['error'][_0x881e('0x12')]);}logger[_0x881e('0x11')](_0x881e('0xe'),_0xd8c131,_0x315426['error']['message']);return _0x51a495(_0x315426[_0x881e('0x11')][_0x881e('0x12')]);}else{logger['info'](_0x881e('0xe'),_0xd8c131,_0x881e('0xf'));_0x51a495(_0x315426[_0x881e('0x13')][_0x881e('0x12')]);}})[_0x881e('0x14')](function(_0x2c50fc){logger[_0x881e('0x11')](_0x881e('0xe'),_0xd8c131,_0x2c50fc);_0x23348c(_0x2c50fc);});});}exports[_0x881e('0x15')]=function(_0x3e1b8a){var _0x3a70c9=this;return new Promise(function(_0x25a26a,_0x2bf7e0){return db['WhatsappQueue'][_0x881e('0x16')]({'raw':_0x3e1b8a[_0x881e('0x17')]?_0x3e1b8a[_0x881e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3e1b8a[_0x881e('0x17')]?_0x3e1b8a[_0x881e('0x17')][_0x881e('0x18')]||null:null,'attributes':_0x3e1b8a[_0x881e('0x17')]?_0x3e1b8a['options'][_0x881e('0x19')]||null:null,'limit':_0x3e1b8a['options']?_0x3e1b8a[_0x881e('0x17')][_0x881e('0x1a')]||null:null,'include':_0x3e1b8a[_0x881e('0x17')]?_0x3e1b8a[_0x881e('0x17')][_0x881e('0x1b')]?_[_0x881e('0x1c')](_0x3e1b8a['options']['include'],function(_0x54b604){return{'model':db[_0x54b604[_0x881e('0x1d')]],'as':_0x54b604['as'],'attributes':_0x54b604[_0x881e('0x19')],'include':_0x54b604['include']?_[_0x881e('0x1c')](_0x54b604['include'],function(_0x790cf9){return{'model':db[_0x790cf9['model']],'as':_0x790cf9['as'],'attributes':_0x790cf9[_0x881e('0x19')],'include':_0x790cf9[_0x881e('0x1b')]?_[_0x881e('0x1c')](_0x790cf9['include'],function(_0x1591e9){return{'model':db[_0x1591e9[_0x881e('0x1d')]],'as':_0x1591e9['as'],'attributes':_0x1591e9[_0x881e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x881e('0xd')](function(_0x4d6af0){logger[_0x881e('0x1e')](_0x881e('0x15'),_0x3e1b8a);logger[_0x881e('0x10')](_0x881e('0x15'),_0x3e1b8a,JSON[_0x881e('0x1f')](_0x4d6af0));_0x25a26a(_0x4d6af0);})[_0x881e('0x14')](function(_0xf22878){logger[_0x881e('0x11')](_0x881e('0x15'),_0xf22878[_0x881e('0x12')],_0x3e1b8a);_0x2bf7e0(_0x3a70c9[_0x881e('0x11')](0x1f4,_0xf22878[_0x881e('0x12')]));});});};exports[_0x881e('0x20')]=function(_0xa26814){var _0x2ce39f=this;return new Promise(function(_0x1e3297,_0x135945){return db[_0x881e('0x21')]['find']({'raw':_0xa26814[_0x881e('0x17')]?_0xa26814[_0x881e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xa26814[_0x881e('0x17')]?_0xa26814[_0x881e('0x17')][_0x881e('0x18')]||null:null,'attributes':_0xa26814[_0x881e('0x17')]?_0xa26814[_0x881e('0x17')][_0x881e('0x19')]||null:null,'include':_0xa26814['options']?_0xa26814[_0x881e('0x17')]['include']?_[_0x881e('0x1c')](_0xa26814[_0x881e('0x17')]['include'],function(_0x193839){return{'model':db[_0x193839[_0x881e('0x1d')]],'as':_0x193839['as'],'attributes':_0x193839[_0x881e('0x19')],'include':_0x193839['include']?_[_0x881e('0x1c')](_0x193839[_0x881e('0x1b')],function(_0x4ff1df){return{'model':db[_0x4ff1df[_0x881e('0x1d')]],'as':_0x4ff1df['as'],'attributes':_0x4ff1df[_0x881e('0x19')],'include':_0x4ff1df['include']?_[_0x881e('0x1c')](_0x4ff1df['include'],function(_0x8682d6){return{'model':db[_0x8682d6[_0x881e('0x1d')]],'as':_0x8682d6['as'],'attributes':_0x8682d6[_0x881e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x881e('0xd')](function(_0x49efc7){logger[_0x881e('0x1e')](_0x881e('0x20'),_0xa26814);logger['debug'](_0x881e('0x20'),_0xa26814,JSON[_0x881e('0x1f')](_0x49efc7));_0x1e3297(_0x49efc7);})[_0x881e('0x14')](function(_0x467b53){logger[_0x881e('0x11')](_0x881e('0x20'),_0x467b53[_0x881e('0x12')],_0xa26814);_0x135945(_0x2ce39f['error'](0x1f4,_0x467b53['message']));});});}; \ No newline at end of file +var _0xc531=['then','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','attributes','limit','include','map','model','ShowWhatsappQueue','find','raw','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./whatsappQueue.socket','register','request'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0xc531,0x6b));var _0x1c53=function(_0x31c98c,_0x4d0933){_0x31c98c=_0x31c98c-0x0;var _0x1915bb=_0xc531[_0x31c98c];return _0x1915bb;};'use strict';var _=require(_0x1c53('0x0'));var util=require(_0x1c53('0x1'));var moment=require(_0x1c53('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c53('0x3'));var db=require(_0x1c53('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c53('0x5'));var config=require(_0x1c53('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1c53('0x7')][_0x1c53('0x8')]({'port':0x232a});config['redis']=_[_0x1c53('0x9')](config['redis'],{'host':_0x1c53('0xa'),'port':0x18eb});var socket=require(_0x1c53('0xb'))(new Redis(config[_0x1c53('0xc')]));require(_0x1c53('0xd'))[_0x1c53('0xe')](socket);function respondWithRpcPromise(_0x269ed5,_0x5722bb,_0x47013c){return new BPromise(function(_0x261afa,_0x4e411a){return client[_0x1c53('0xf')](_0x269ed5,_0x47013c)[_0x1c53('0x10')](function(_0x47d559){logger['info'](_0x1c53('0x11'),_0x5722bb,'request\x20sent');logger[_0x1c53('0x12')](_0x1c53('0x13'),_0x5722bb,_0x1c53('0x14'),JSON[_0x1c53('0x15')](_0x47d559));if(_0x47d559[_0x1c53('0x16')]){if(_0x47d559[_0x1c53('0x16')][_0x1c53('0x17')]===0x1f4){logger[_0x1c53('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x5722bb,_0x47d559[_0x1c53('0x16')]['message']);return _0x4e411a(_0x47d559[_0x1c53('0x16')][_0x1c53('0x18')]);}logger[_0x1c53('0x16')](_0x1c53('0x11'),_0x5722bb,_0x47d559[_0x1c53('0x16')][_0x1c53('0x18')]);return _0x261afa(_0x47d559[_0x1c53('0x16')]['message']);}else{logger[_0x1c53('0x19')](_0x1c53('0x11'),_0x5722bb,_0x1c53('0x14'));_0x261afa(_0x47d559[_0x1c53('0x1a')][_0x1c53('0x18')]);}})[_0x1c53('0x1b')](function(_0x3274b8){logger[_0x1c53('0x16')](_0x1c53('0x11'),_0x5722bb,_0x3274b8);_0x4e411a(_0x3274b8);});});}exports[_0x1c53('0x1c')]=function(_0x192e4a){var _0x23fb3d=this;return new Promise(function(_0x2646f6,_0x10c095){return db[_0x1c53('0x1d')][_0x1c53('0x1e')]({'raw':_0x192e4a[_0x1c53('0x1f')]?_0x192e4a[_0x1c53('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x192e4a[_0x1c53('0x1f')]?_0x192e4a[_0x1c53('0x1f')][_0x1c53('0x20')]||null:null,'attributes':_0x192e4a[_0x1c53('0x1f')]?_0x192e4a[_0x1c53('0x1f')][_0x1c53('0x21')]||null:null,'limit':_0x192e4a[_0x1c53('0x1f')]?_0x192e4a[_0x1c53('0x1f')][_0x1c53('0x22')]||null:null,'include':_0x192e4a[_0x1c53('0x1f')]?_0x192e4a[_0x1c53('0x1f')][_0x1c53('0x23')]?_[_0x1c53('0x24')](_0x192e4a[_0x1c53('0x1f')][_0x1c53('0x23')],function(_0x3a4782){return{'model':db[_0x3a4782[_0x1c53('0x25')]],'as':_0x3a4782['as'],'attributes':_0x3a4782[_0x1c53('0x21')],'include':_0x3a4782[_0x1c53('0x23')]?_[_0x1c53('0x24')](_0x3a4782[_0x1c53('0x23')],function(_0x4953e3){return{'model':db[_0x4953e3[_0x1c53('0x25')]],'as':_0x4953e3['as'],'attributes':_0x4953e3[_0x1c53('0x21')],'include':_0x4953e3[_0x1c53('0x23')]?_[_0x1c53('0x24')](_0x4953e3[_0x1c53('0x23')],function(_0xea1df3){return{'model':db[_0xea1df3[_0x1c53('0x25')]],'as':_0xea1df3['as'],'attributes':_0xea1df3[_0x1c53('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1c53('0x10')](function(_0x3c495f){logger['info'](_0x1c53('0x1c'),_0x192e4a);logger['debug'](_0x1c53('0x1c'),_0x192e4a,JSON[_0x1c53('0x15')](_0x3c495f));_0x2646f6(_0x3c495f);})['catch'](function(_0x21d78e){logger[_0x1c53('0x16')]('GetWhatsappQueue',_0x21d78e[_0x1c53('0x18')],_0x192e4a);_0x10c095(_0x23fb3d[_0x1c53('0x16')](0x1f4,_0x21d78e[_0x1c53('0x18')]));});});};exports[_0x1c53('0x26')]=function(_0x3e19a8){var _0x2f54eb=this;return new Promise(function(_0x5e1dc8,_0x233f43){return db[_0x1c53('0x1d')][_0x1c53('0x27')]({'raw':_0x3e19a8[_0x1c53('0x1f')]?_0x3e19a8[_0x1c53('0x1f')][_0x1c53('0x28')]===undefined?!![]:![]:!![],'where':_0x3e19a8[_0x1c53('0x1f')]?_0x3e19a8[_0x1c53('0x1f')][_0x1c53('0x20')]||null:null,'attributes':_0x3e19a8[_0x1c53('0x1f')]?_0x3e19a8['options'][_0x1c53('0x21')]||null:null,'include':_0x3e19a8['options']?_0x3e19a8[_0x1c53('0x1f')][_0x1c53('0x23')]?_['map'](_0x3e19a8[_0x1c53('0x1f')][_0x1c53('0x23')],function(_0x2cb1a0){return{'model':db[_0x2cb1a0['model']],'as':_0x2cb1a0['as'],'attributes':_0x2cb1a0[_0x1c53('0x21')],'include':_0x2cb1a0[_0x1c53('0x23')]?_[_0x1c53('0x24')](_0x2cb1a0['include'],function(_0x3a5cc2){return{'model':db[_0x3a5cc2[_0x1c53('0x25')]],'as':_0x3a5cc2['as'],'attributes':_0x3a5cc2['attributes'],'include':_0x3a5cc2[_0x1c53('0x23')]?_[_0x1c53('0x24')](_0x3a5cc2[_0x1c53('0x23')],function(_0x113386){return{'model':db[_0x113386[_0x1c53('0x25')]],'as':_0x113386['as'],'attributes':_0x113386['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c53('0x10')](function(_0x25f06){logger[_0x1c53('0x19')](_0x1c53('0x26'),_0x3e19a8);logger[_0x1c53('0x12')]('ShowWhatsappQueue',_0x3e19a8,JSON[_0x1c53('0x15')](_0x25f06));_0x5e1dc8(_0x25f06);})[_0x1c53('0x1b')](function(_0x43c21d){logger['error']('ShowWhatsappQueue',_0x43c21d[_0x1c53('0x18')],_0x3e19a8);_0x233f43(_0x2f54eb[_0x1c53('0x16')](0x1f4,_0x43c21d['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index e256a61..35f0acb 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 _0x3170=['save','remove','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x174d8b,_0x30ed1c){var _0x2d271d=function(_0x425dac){while(--_0x425dac){_0x174d8b['push'](_0x174d8b['shift']());}};_0x2d271d(++_0x30ed1c);}(_0x3170,0x117));var _0x0317=function(_0x348eaf,_0x1d72a2){_0x348eaf=_0x348eaf-0x0;var _0x1eba1a=_0x3170[_0x348eaf];return _0x1eba1a;};'use strict';var WhatsappQueueEvents=require(_0x0317('0x0'));var events=[_0x0317('0x1'),_0x0317('0x2'),'update'];function createListener(_0x544c7,_0x27e7bd){return function(_0x205414){_0x27e7bd[_0x0317('0x3')](_0x544c7,_0x205414);};}function removeListener(_0x42021a,_0x209cd5){return function(){WhatsappQueueEvents[_0x0317('0x4')](_0x42021a,_0x209cd5);};}exports[_0x0317('0x5')]=function(_0x49e104){for(var _0x52a3d4=0x0,_0xb44946=events[_0x0317('0x6')];_0x52a3d4<_0xb44946;_0x52a3d4++){var _0x1653ce=events[_0x52a3d4];var _0x2406ac=createListener(_0x0317('0x7')+_0x1653ce,_0x49e104);WhatsappQueueEvents['on'](_0x1653ce,_0x2406ac);}}; \ No newline at end of file +var _0xba44=['register','length','whatsappQueue:','remove','update','emit','removeListener'];(function(_0x5139ec,_0x1c2e54){var _0x852db8=function(_0x20ebb7){while(--_0x20ebb7){_0x5139ec['push'](_0x5139ec['shift']());}};_0x852db8(++_0x1c2e54);}(_0xba44,0x199));var _0x4ba4=function(_0x38106a,_0x5f21db){_0x38106a=_0x38106a-0x0;var _0x365bc7=_0xba44[_0x38106a];return _0x365bc7;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0x4ba4('0x0'),_0x4ba4('0x1')];function createListener(_0x2d5b99,_0x161c1b){return function(_0x24cd9c){_0x161c1b[_0x4ba4('0x2')](_0x2d5b99,_0x24cd9c);};}function removeListener(_0x39e65c,_0x5d9962){return function(){WhatsappQueueEvents[_0x4ba4('0x3')](_0x39e65c,_0x5d9962);};}exports[_0x4ba4('0x4')]=function(_0xf12a93){for(var _0x1e9ae4=0x0,_0x26c06e=events[_0x4ba4('0x5')];_0x1e9ae4<_0x26c06e;_0x1e9ae4++){var _0x5e8e1d=events[_0x1e9ae4];var _0xfae122=createListener(_0x4ba4('0x6')+_0x5e8e1d,_0xf12a93);WhatsappQueueEvents['on'](_0x5e8e1d,_0xfae122);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 1de8ac5..c3e62b7 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 _0xe130=['/:id','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated'];(function(_0x667166,_0x3544ea){var _0x14b87d=function(_0x294ee6){while(--_0x294ee6){_0x667166['push'](_0x667166['shift']());}};_0x14b87d(++_0x3544ea);}(_0xe130,0x127));var _0x0e13=function(_0x170cca,_0x201ae7){_0x170cca=_0x170cca-0x0;var _0x34984c=_0xe130[_0x170cca];return _0x34984c;};'use strict';var multer=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var path=require('path');var timeout=require(_0x0e13('0x2'));var express=require(_0x0e13('0x3'));var router=express[_0x0e13('0x4')]();var fs_extra=require(_0x0e13('0x5'));var auth=require(_0x0e13('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0e13('0x7'));var controller=require(_0x0e13('0x8'));router[_0x0e13('0x9')]('/',auth[_0x0e13('0xa')](),controller['index']);router[_0x0e13('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x0e13('0x9')](_0x0e13('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x0e13('0xc')]('/',auth[_0x0e13('0xa')](),controller[_0x0e13('0xd')]);router[_0x0e13('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0e13('0xf')]);router[_0x0e13('0x10')](_0x0e13('0xb'),auth[_0x0e13('0xa')](),controller['destroy']);module[_0x0e13('0x11')]=router; \ No newline at end of file +var _0x1924=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','delete','destroy'];(function(_0x35140a,_0x6e06f){var _0x1c0051=function(_0xa89f7f){while(--_0xa89f7f){_0x35140a['push'](_0x35140a['shift']());}};_0x1c0051(++_0x6e06f);}(_0x1924,0x91));var _0x4192=function(_0x334dc2,_0x44f024){_0x334dc2=_0x334dc2-0x0;var _0x487011=_0x1924[_0x334dc2];return _0x487011;};'use strict';var multer=require('multer');var util=require(_0x4192('0x0'));var path=require('path');var timeout=require(_0x4192('0x1'));var express=require(_0x4192('0x2'));var router=express[_0x4192('0x3')]();var fs_extra=require(_0x4192('0x4'));var auth=require(_0x4192('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4192('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4192('0x7')](_0x4192('0x8'),auth[_0x4192('0x9')](),controller[_0x4192('0xa')]);router[_0x4192('0x7')](_0x4192('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4192('0xc')]('/',auth[_0x4192('0x9')](),controller[_0x4192('0xd')]);router[_0x4192('0xe')](_0x4192('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x4192('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4192('0x10')]);module[_0x4192('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 17e0982..db6619b 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 _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x13fa87,_0xd2ea7d){var _0x2d5a35=function(_0x1fbf2c){while(--_0x1fbf2c){_0x13fa87['push'](_0x13fa87['shift']());}};_0x2d5a35(++_0xd2ea7d);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x404d64,_0x478980){var _0x36b9c9=function(_0x5ad582){while(--_0x5ad582){_0x404d64['push'](_0x404d64['shift']());}};_0x36b9c9(++_0x478980);}(_0x7a54,0x106));var _0x47a5=function(_0x578652,_0x42dcaf){_0x578652=_0x578652-0x0;var _0x31de4a=_0x7a54[_0x578652];return _0x31de4a;};'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 403b250..8685431 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 _0x28f2=['where','pick','filter','type','VIRTUAL','options','count','includeAll','include','findAll','show','params','merge','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0x28f2,0x193));var _0x228f=function(_0x1decb9,_0x1de278){_0x1decb9=_0x1decb9-0x0;var _0xa209b3=_0x28f2[_0x1decb9];return _0xa209b3;};'use strict';var emlformat=require(_0x228f('0x0'));var rimraf=require(_0x228f('0x1'));var zipdir=require(_0x228f('0x2'));var jsonpatch=require(_0x228f('0x3'));var rp=require(_0x228f('0x4'));var moment=require('moment');var BPromise=require(_0x228f('0x5'));var Mustache=require(_0x228f('0x6'));var util=require(_0x228f('0x7'));var path=require(_0x228f('0x8'));var sox=require(_0x228f('0x9'));var csv=require(_0x228f('0xa'));var ejs=require(_0x228f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x228f('0xc'));var squel=require('squel');var crypto=require(_0x228f('0xd'));var jsforce=require(_0x228f('0xe'));var deskjs=require(_0x228f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x228f('0x10'));var Papa=require('papaparse');var Redis=require(_0x228f('0x11'));var authService=require(_0x228f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x228f('0x13'));var hardwareService=require(_0x228f('0x14'));var logger=require(_0x228f('0x15'))(_0x228f('0x16'));var utils=require(_0x228f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x228f('0x18'));var db=require(_0x228f('0x19'))['db'];function respondWithStatusCode(_0x24f69c,_0x14073a){_0x14073a=_0x14073a||0xcc;return function(_0x2e1a43){if(_0x2e1a43){return _0x24f69c[_0x228f('0x1a')](_0x14073a);}return _0x24f69c[_0x228f('0x1b')](_0x14073a)[_0x228f('0x1c')]();};}function respondWithResult(_0x572535,_0x2fab95){_0x2fab95=_0x2fab95||0xc8;return function(_0xfb6aff){if(_0xfb6aff){return _0x572535[_0x228f('0x1b')](_0x2fab95)[_0x228f('0x1d')](_0xfb6aff);}};}function respondWithFilteredResult(_0x2a4d87,_0x21a913){return function(_0x272723){if(_0x272723){var _0x5b5abb=typeof _0x21a913[_0x228f('0x1e')]==='undefined'&&typeof _0x21a913[_0x228f('0x1f')]===_0x228f('0x20');var _0x195e65=_0x272723['count'];var _0x2d4819=_0x5b5abb?0x0:_0x21a913['offset'];var _0x33e32e=_0x5b5abb?_0x272723['count']:_0x21a913[_0x228f('0x1e')]+_0x21a913['limit'];var _0x5aa203;if(_0x33e32e>=_0x195e65){_0x33e32e=_0x195e65;_0x5aa203=0xc8;}else{_0x5aa203=0xce;}_0x2a4d87[_0x228f('0x1b')](_0x5aa203);return _0x2a4d87['set'](_0x228f('0x21'),_0x2d4819+'-'+_0x33e32e+'/'+_0x195e65)[_0x228f('0x1d')](_0x272723);}return null;};}function patchUpdates(_0x1294a8){return function(_0x3a623a){try{jsonpatch[_0x228f('0x22')](_0x3a623a,_0x1294a8,!![]);}catch(_0x313cf2){return BPromise[_0x228f('0x23')](_0x313cf2);}return _0x3a623a[_0x228f('0x24')]();};}function saveUpdates(_0x15d54f,_0x4ee0c9){return function(_0x1e96d4){if(_0x1e96d4){return _0x1e96d4[_0x228f('0x25')](_0x15d54f)[_0x228f('0x26')](function(_0x3c00ad){return _0x3c00ad;});}return null;};}function removeEntity(_0x1dad27,_0x194d1a){return function(_0x33e882){if(_0x33e882){return _0x33e882[_0x228f('0x27')]()[_0x228f('0x26')](function(){_0x1dad27['status'](0xcc)[_0x228f('0x1c')]();});}};}function handleEntityNotFound(_0x306928,_0x2b3553){return function(_0x272c7d){if(!_0x272c7d){_0x306928[_0x228f('0x1a')](0x194);}return _0x272c7d;};}function handleError(_0x539faa,_0xe8aac){_0xe8aac=_0xe8aac||0x1f4;return function(_0x49efe9){logger[_0x228f('0x28')](_0x49efe9['stack']);if(_0x49efe9['name']){delete _0x49efe9[_0x228f('0x29')];}_0x539faa[_0x228f('0x1b')](_0xe8aac)[_0x228f('0x2a')](_0x49efe9);};}exports[_0x228f('0x2b')]=function(_0x34c735,_0x2c964e){var _0x2eaf4f={},_0x2511e5={},_0xe67c83={'count':0x0,'rows':[]};var _0x2f13d9=_[_0x228f('0x2c')](db[_0x228f('0x2d')][_0x228f('0x2e')],function(_0xc6921f){return{'name':_0xc6921f[_0x228f('0x2f')],'type':_0xc6921f['type'][_0x228f('0x30')]};});_0x2511e5[_0x228f('0x31')]=_[_0x228f('0x2c')](_0x2f13d9,'name');_0x2511e5[_0x228f('0x32')]=_[_0x228f('0x33')](_0x34c735['query']);_0x2511e5[_0x228f('0x34')]=_[_0x228f('0x35')](_0x2511e5[_0x228f('0x31')],_0x2511e5[_0x228f('0x32')]);_0x2eaf4f['attributes']=_[_0x228f('0x35')](_0x2511e5['model'],qs[_0x228f('0x36')](_0x34c735[_0x228f('0x32')][_0x228f('0x36')]));_0x2eaf4f[_0x228f('0x37')]=_0x2eaf4f['attributes'][_0x228f('0x38')]?_0x2eaf4f[_0x228f('0x37')]:_0x2511e5['model'];if(!_0x34c735['query']['hasOwnProperty'](_0x228f('0x39'))){_0x2eaf4f[_0x228f('0x1f')]=qs[_0x228f('0x1f')](_0x34c735[_0x228f('0x32')][_0x228f('0x1f')]);_0x2eaf4f[_0x228f('0x1e')]=qs[_0x228f('0x1e')](_0x34c735[_0x228f('0x32')][_0x228f('0x1e')]);}_0x2eaf4f['order']=qs['sort'](_0x34c735[_0x228f('0x32')][_0x228f('0x3a')]);_0x2eaf4f[_0x228f('0x3b')]=qs[_0x228f('0x34')](_[_0x228f('0x3c')](_0x34c735[_0x228f('0x32')],_0x2511e5[_0x228f('0x34')]),_0x2f13d9);if(_0x34c735[_0x228f('0x32')][_0x228f('0x3d')]){_0x2eaf4f[_0x228f('0x3b')]=_['merge'](_0x2eaf4f['where'],{'$or':_[_0x228f('0x2c')](_0x2f13d9,function(_0x29a250){if(_0x29a250[_0x228f('0x3e')]!==_0x228f('0x3f')){var _0x5b7b44={};_0x5b7b44[_0x29a250[_0x228f('0x29')]]={'$like':'%'+_0x34c735[_0x228f('0x32')]['filter']+'%'};return _0x5b7b44;}})});}_0x2eaf4f=_['merge']({},_0x2eaf4f,_0x34c735[_0x228f('0x40')]);var _0x2f6f54={'where':_0x2eaf4f['where']};return db[_0x228f('0x2d')][_0x228f('0x41')](_0x2f6f54)['then'](function(_0x536166){_0xe67c83[_0x228f('0x41')]=_0x536166;if(_0x34c735['query'][_0x228f('0x42')]){_0x2eaf4f[_0x228f('0x43')]=[{'all':!![]}];}return db[_0x228f('0x2d')][_0x228f('0x44')](_0x2eaf4f);})[_0x228f('0x26')](function(_0x20c178){_0xe67c83['rows']=_0x20c178;return _0xe67c83;})[_0x228f('0x26')](respondWithFilteredResult(_0x2c964e,_0x2eaf4f))['catch'](handleError(_0x2c964e,null));};exports[_0x228f('0x45')]=function(_0xc59d9b,_0x285af1){var _0x96126c={'raw':!![],'where':{'id':_0xc59d9b[_0x228f('0x46')]['id']}},_0x41cba5={};_0x41cba5[_0x228f('0x31')]=_[_0x228f('0x33')](db[_0x228f('0x2d')][_0x228f('0x2e')]);_0x41cba5[_0x228f('0x32')]=_[_0x228f('0x33')](_0xc59d9b[_0x228f('0x32')]);_0x41cba5['filters']=_['intersection'](_0x41cba5[_0x228f('0x31')],_0x41cba5[_0x228f('0x32')]);_0x96126c[_0x228f('0x37')]=_[_0x228f('0x35')](_0x41cba5[_0x228f('0x31')],qs[_0x228f('0x36')](_0xc59d9b[_0x228f('0x32')][_0x228f('0x36')]));_0x96126c[_0x228f('0x37')]=_0x96126c[_0x228f('0x37')]['length']?_0x96126c[_0x228f('0x37')]:_0x41cba5[_0x228f('0x31')];if(_0xc59d9b['query'][_0x228f('0x42')]){_0x96126c['include']=[{'all':!![]}];}_0x96126c=_[_0x228f('0x47')]({},_0x96126c,_0xc59d9b['options']);return db[_0x228f('0x2d')]['find'](_0x96126c)[_0x228f('0x26')](handleEntityNotFound(_0x285af1,null))[_0x228f('0x26')](respondWithResult(_0x285af1,null))[_0x228f('0x48')](handleError(_0x285af1,null));};exports[_0x228f('0x49')]=function(_0x3dea4e,_0x2e0054){return db[_0x228f('0x2d')][_0x228f('0x49')](_0x3dea4e[_0x228f('0x4a')],{})[_0x228f('0x26')](respondWithResult(_0x2e0054,0xc9))[_0x228f('0x48')](handleError(_0x2e0054,null));};exports[_0x228f('0x25')]=function(_0x4099d4,_0x250345){if(_0x4099d4[_0x228f('0x4a')]['id']){delete _0x4099d4[_0x228f('0x4a')]['id'];}return db[_0x228f('0x2d')][_0x228f('0x4b')]({'where':{'id':_0x4099d4[_0x228f('0x46')]['id']}})['then'](handleEntityNotFound(_0x250345,null))['then'](saveUpdates(_0x4099d4[_0x228f('0x4a')],null))[_0x228f('0x26')](respondWithResult(_0x250345,null))[_0x228f('0x48')](handleError(_0x250345,null));};exports['destroy']=function(_0x17bcd9,_0x9750ca){return db[_0x228f('0x2d')]['find']({'where':{'id':_0x17bcd9['params']['id']}})['then'](handleEntityNotFound(_0x9750ca,null))[_0x228f('0x26')](removeEntity(_0x9750ca,null))[_0x228f('0x48')](handleError(_0x9750ca,null));};exports[_0x228f('0x4c')]=function(_0x466a2b,_0x42036c){return db[_0x228f('0x2d')][_0x228f('0x4c')]()[_0x228f('0x26')](respondWithResult(_0x42036c,null))[_0x228f('0x48')](handleError(_0x42036c,null));}; \ No newline at end of file +var _0x0102=['filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','options','then','findAll','rows','catch','params','rawAttributes','intersection','include','find','create','update','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','sendStatus','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','key','model','query','keys'];(function(_0x11cc4d,_0x535ad8){var _0x9b5720=function(_0x37f3e4){while(--_0x37f3e4){_0x11cc4d['push'](_0x11cc4d['shift']());}};_0x9b5720(++_0x535ad8);}(_0x0102,0x186));var _0x2010=function(_0x2b393f,_0x233dbc){_0x2b393f=_0x2b393f-0x0;var _0xa9d814=_0x0102[_0x2b393f];return _0xa9d814;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2010('0x0'));var zipdir=require(_0x2010('0x1'));var jsonpatch=require(_0x2010('0x2'));var rp=require(_0x2010('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2010('0x4'));var csv=require(_0x2010('0x5'));var ejs=require(_0x2010('0x6'));var fs=require('fs');var fs_extra=require(_0x2010('0x7'));var _=require('lodash');var squel=require(_0x2010('0x8'));var crypto=require('crypto');var jsforce=require(_0x2010('0x9'));var deskjs=require(_0x2010('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2010('0xb'));var Papa=require(_0x2010('0xc'));var Redis=require(_0x2010('0xd'));var authService=require(_0x2010('0xe'));var qs=require(_0x2010('0xf'));var as=require(_0x2010('0x10'));var hardwareService=require(_0x2010('0x11'));var logger=require(_0x2010('0x12'))(_0x2010('0x13'));var utils=require(_0x2010('0x14'));var config=require(_0x2010('0x15'));var licenseUtil=require(_0x2010('0x16'));var db=require(_0x2010('0x17'))['db'];function respondWithStatusCode(_0x3f307c,_0x3e8624){_0x3e8624=_0x3e8624||0xcc;return function(_0x388991){if(_0x388991){return _0x3f307c['sendStatus'](_0x3e8624);}return _0x3f307c['status'](_0x3e8624)[_0x2010('0x18')]();};}function respondWithResult(_0x385720,_0x2e8ec2){_0x2e8ec2=_0x2e8ec2||0xc8;return function(_0x10b587){if(_0x10b587){return _0x385720[_0x2010('0x19')](_0x2e8ec2)[_0x2010('0x1a')](_0x10b587);}};}function respondWithFilteredResult(_0x517ff4,_0x3195fa){return function(_0x136418){if(_0x136418){var _0x5ad412=typeof _0x3195fa[_0x2010('0x1b')]===_0x2010('0x1c')&&typeof _0x3195fa[_0x2010('0x1d')]===_0x2010('0x1c');var _0x2d0bf2=_0x136418[_0x2010('0x1e')];var _0x83cd35=_0x5ad412?0x0:_0x3195fa[_0x2010('0x1b')];var _0x309477=_0x5ad412?_0x136418['count']:_0x3195fa['offset']+_0x3195fa[_0x2010('0x1d')];var _0x38a15a;if(_0x309477>=_0x2d0bf2){_0x309477=_0x2d0bf2;_0x38a15a=0xc8;}else{_0x38a15a=0xce;}_0x517ff4[_0x2010('0x19')](_0x38a15a);return _0x517ff4[_0x2010('0x1f')]('Content-Range',_0x83cd35+'-'+_0x309477+'/'+_0x2d0bf2)['json'](_0x136418);}return null;};}function patchUpdates(_0x22c252){return function(_0x171e45){try{jsonpatch[_0x2010('0x20')](_0x171e45,_0x22c252,!![]);}catch(_0x26facc){return BPromise[_0x2010('0x21')](_0x26facc);}return _0x171e45[_0x2010('0x22')]();};}function saveUpdates(_0x4f621c,_0x3db13d){return function(_0x1cfa57){if(_0x1cfa57){return _0x1cfa57['update'](_0x4f621c)['then'](function(_0x50aecc){return _0x50aecc;});}return null;};}function removeEntity(_0x424453,_0x574719){return function(_0x277dcc){if(_0x277dcc){return _0x277dcc['destroy']()['then'](function(){_0x424453[_0x2010('0x19')](0xcc)[_0x2010('0x18')]();});}};}function handleEntityNotFound(_0x52b4fe,_0x99ebe0){return function(_0x4cff59){if(!_0x4cff59){_0x52b4fe[_0x2010('0x23')](0x194);}return _0x4cff59;};}function handleError(_0x27b425,_0x3929d9){_0x3929d9=_0x3929d9||0x1f4;return function(_0x3dcea4){logger[_0x2010('0x24')](_0x3dcea4[_0x2010('0x25')]);if(_0x3dcea4[_0x2010('0x26')]){delete _0x3dcea4[_0x2010('0x26')];}_0x27b425[_0x2010('0x19')](_0x3929d9)[_0x2010('0x27')](_0x3dcea4);};}exports[_0x2010('0x28')]=function(_0x2ebdbb,_0x499cbe){var _0x2a4691={},_0x52fe5e={},_0x5b52fb={'count':0x0,'rows':[]};var _0x147a5a=_[_0x2010('0x29')](db[_0x2010('0x2a')]['rawAttributes'],function(_0x554f66){return{'name':_0x554f66[_0x2010('0x2b')],'type':_0x554f66['type'][_0x2010('0x2c')]};});_0x52fe5e[_0x2010('0x2d')]=_['map'](_0x147a5a,_0x2010('0x26'));_0x52fe5e[_0x2010('0x2e')]=_[_0x2010('0x2f')](_0x2ebdbb[_0x2010('0x2e')]);_0x52fe5e[_0x2010('0x30')]=_['intersection'](_0x52fe5e[_0x2010('0x2d')],_0x52fe5e[_0x2010('0x2e')]);_0x2a4691[_0x2010('0x31')]=_['intersection'](_0x52fe5e['model'],qs[_0x2010('0x32')](_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x32')]));_0x2a4691['attributes']=_0x2a4691['attributes'][_0x2010('0x33')]?_0x2a4691[_0x2010('0x31')]:_0x52fe5e[_0x2010('0x2d')];if(!_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x34')]('nolimit')){_0x2a4691['limit']=qs['limit'](_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x1d')]);_0x2a4691[_0x2010('0x1b')]=qs['offset'](_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x1b')]);}_0x2a4691[_0x2010('0x35')]=qs[_0x2010('0x36')](_0x2ebdbb['query'][_0x2010('0x36')]);_0x2a4691[_0x2010('0x37')]=qs[_0x2010('0x30')](_['pick'](_0x2ebdbb[_0x2010('0x2e')],_0x52fe5e['filters']),_0x147a5a);if(_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x38')]){_0x2a4691[_0x2010('0x37')]=_[_0x2010('0x39')](_0x2a4691[_0x2010('0x37')],{'$or':_[_0x2010('0x29')](_0x147a5a,function(_0x53c09e){if(_0x53c09e[_0x2010('0x3a')]!=='VIRTUAL'){var _0x3e5422={};_0x3e5422[_0x53c09e[_0x2010('0x26')]]={'$like':'%'+_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x38')]+'%'};return _0x3e5422;}})});}_0x2a4691=_[_0x2010('0x39')]({},_0x2a4691,_0x2ebdbb[_0x2010('0x3b')]);var _0x398f10={'where':_0x2a4691[_0x2010('0x37')]};return db[_0x2010('0x2a')][_0x2010('0x1e')](_0x398f10)[_0x2010('0x3c')](function(_0x2f37ca){_0x5b52fb[_0x2010('0x1e')]=_0x2f37ca;if(_0x2ebdbb[_0x2010('0x2e')]['includeAll']){_0x2a4691['include']=[{'all':!![]}];}return db[_0x2010('0x2a')][_0x2010('0x3d')](_0x2a4691);})[_0x2010('0x3c')](function(_0x35d631){_0x5b52fb[_0x2010('0x3e')]=_0x35d631;return _0x5b52fb;})[_0x2010('0x3c')](respondWithFilteredResult(_0x499cbe,_0x2a4691))[_0x2010('0x3f')](handleError(_0x499cbe,null));};exports['show']=function(_0x392576,_0x578645){var _0x27fd64={'raw':!![],'where':{'id':_0x392576[_0x2010('0x40')]['id']}},_0x3ff496={};_0x3ff496[_0x2010('0x2d')]=_[_0x2010('0x2f')](db['WhatsappQueueReport'][_0x2010('0x41')]);_0x3ff496[_0x2010('0x2e')]=_[_0x2010('0x2f')](_0x392576[_0x2010('0x2e')]);_0x3ff496['filters']=_[_0x2010('0x42')](_0x3ff496['model'],_0x3ff496['query']);_0x27fd64['attributes']=_[_0x2010('0x42')](_0x3ff496[_0x2010('0x2d')],qs[_0x2010('0x32')](_0x392576[_0x2010('0x2e')][_0x2010('0x32')]));_0x27fd64[_0x2010('0x31')]=_0x27fd64['attributes'][_0x2010('0x33')]?_0x27fd64[_0x2010('0x31')]:_0x3ff496[_0x2010('0x2d')];if(_0x392576['query']['includeAll']){_0x27fd64[_0x2010('0x43')]=[{'all':!![]}];}_0x27fd64=_['merge']({},_0x27fd64,_0x392576[_0x2010('0x3b')]);return db[_0x2010('0x2a')][_0x2010('0x44')](_0x27fd64)[_0x2010('0x3c')](handleEntityNotFound(_0x578645,null))['then'](respondWithResult(_0x578645,null))[_0x2010('0x3f')](handleError(_0x578645,null));};exports[_0x2010('0x45')]=function(_0x2e2703,_0x231db7){return db[_0x2010('0x2a')][_0x2010('0x45')](_0x2e2703['body'],{})[_0x2010('0x3c')](respondWithResult(_0x231db7,0xc9))[_0x2010('0x3f')](handleError(_0x231db7,null));};exports[_0x2010('0x46')]=function(_0x4dc0cf,_0x30e5d0){if(_0x4dc0cf[_0x2010('0x47')]['id']){delete _0x4dc0cf['body']['id'];}return db[_0x2010('0x2a')][_0x2010('0x44')]({'where':{'id':_0x4dc0cf[_0x2010('0x40')]['id']}})[_0x2010('0x3c')](handleEntityNotFound(_0x30e5d0,null))[_0x2010('0x3c')](saveUpdates(_0x4dc0cf[_0x2010('0x47')],null))[_0x2010('0x3c')](respondWithResult(_0x30e5d0,null))[_0x2010('0x3f')](handleError(_0x30e5d0,null));};exports['destroy']=function(_0x5258b9,_0xc9f070){return db[_0x2010('0x2a')]['find']({'where':{'id':_0x5258b9[_0x2010('0x40')]['id']}})[_0x2010('0x3c')](handleEntityNotFound(_0xc9f070,null))[_0x2010('0x3c')](removeEntity(_0xc9f070,null))[_0x2010('0x3f')](handleError(_0xc9f070,null));};exports[_0x2010('0x48')]=function(_0x506943,_0x5f4e98){return db[_0x2010('0x2a')][_0x2010('0x48')]()[_0x2010('0x3c')](respondWithResult(_0x5f4e98,null))[_0x2010('0x3f')](handleError(_0x5f4e98,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index e87c242..43b5179 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 _0x6f19=['bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','moment'];(function(_0x345126,_0xebc855){var _0x426178=function(_0x28119e){while(--_0x28119e){_0x345126['push'](_0x345126['shift']());}};_0x426178(++_0xebc855);}(_0x6f19,0x195));var _0x96f1=function(_0x32a311,_0x495aa8){_0x32a311=_0x32a311-0x0;var _0x23a7f=_0x6f19[_0x32a311];return _0x23a7f;};'use strict';var _=require(_0x96f1('0x0'));var util=require(_0x96f1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x96f1('0x2'));var BPromise=require(_0x96f1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x96f1('0x4'));var rimraf=require(_0x96f1('0x5'));var config=require(_0x96f1('0x6'));var attributes=require(_0x96f1('0x7'));module['exports']=function(_0x2cb3ce,_0x78ac18){return _0x2cb3ce[_0x96f1('0x8')](_0x96f1('0x9'),attributes,{'tableName':_0x96f1('0xa'),'paranoid':![],'indexes':[{'name':_0x96f1('0xb'),'fields':[_0x96f1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0096=['request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x9de574,_0x4ae3d7){var _0x1d3771=function(_0x129659){while(--_0x129659){_0x9de574['push'](_0x9de574['shift']());}};_0x1d3771(++_0x4ae3d7);}(_0x0096,0x79));var _0x6009=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x0096[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x6009('0x0'));var util=require(_0x6009('0x1'));var logger=require(_0x6009('0x2'))('api');var moment=require(_0x6009('0x3'));var BPromise=require(_0x6009('0x4'));var rp=require(_0x6009('0x5'));var fs=require('fs');var path=require(_0x6009('0x6'));var rimraf=require('rimraf');var config=require(_0x6009('0x7'));var attributes=require(_0x6009('0x8'));module[_0x6009('0x9')]=function(_0x215e90,_0x4d1eb5){return _0x215e90[_0x6009('0xa')](_0x6009('0xb'),attributes,{'tableName':_0x6009('0xc'),'paranoid':![],'indexes':[{'name':_0x6009('0xd'),'fields':[_0x6009('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 d3dc4e0..96cf59a 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 _0x5453=['CreateWhatsappQueueReport','create','body','options','raw','then','WhatsappQueueReport','update','where','attributes','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x5453,0x18b));var _0x3545=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5453[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x3545('0x0'));var util=require(_0x3545('0x1'));var moment=require(_0x3545('0x2'));var BPromise=require(_0x3545('0x3'));var rs=require(_0x3545('0x4'));var fs=require('fs');var Redis=require(_0x3545('0x5'));var db=require(_0x3545('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3545('0x7'));var config=require(_0x3545('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3545('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x290aa5,_0x496d6b,_0x5d5808){return new BPromise(function(_0x2974ae,_0x3cf0cc){return client[_0x3545('0xa')](_0x290aa5,_0x5d5808)['then'](function(_0x21dc51){logger[_0x3545('0xb')](_0x3545('0xc'),_0x496d6b,_0x3545('0xd'));logger[_0x3545('0xe')](_0x3545('0xf'),_0x496d6b,_0x3545('0xd'),JSON['stringify'](_0x21dc51));if(_0x21dc51['error']){if(_0x21dc51[_0x3545('0x10')][_0x3545('0x11')]===0x1f4){logger[_0x3545('0x10')](_0x3545('0xc'),_0x496d6b,_0x21dc51['error']['message']);return _0x3cf0cc(_0x21dc51['error'][_0x3545('0x12')]);}logger[_0x3545('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x496d6b,_0x21dc51[_0x3545('0x10')]['message']);return _0x2974ae(_0x21dc51['error'][_0x3545('0x12')]);}else{logger[_0x3545('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x496d6b,_0x3545('0xd'));_0x2974ae(_0x21dc51[_0x3545('0x13')]['message']);}})[_0x3545('0x14')](function(_0x51f69b){logger[_0x3545('0x10')](_0x3545('0xc'),_0x496d6b,_0x51f69b);_0x3cf0cc(_0x51f69b);});});}exports[_0x3545('0x15')]=function(_0x2c008a){var _0x4e3c95=this;return new Promise(function(_0x573970,_0x34a7f3){return db['WhatsappQueueReport'][_0x3545('0x16')](_0x2c008a[_0x3545('0x17')],{'raw':_0x2c008a[_0x3545('0x18')]?_0x2c008a[_0x3545('0x18')][_0x3545('0x19')]===undefined?!![]:![]:!![]})[_0x3545('0x1a')](function(_0x10037f){logger[_0x3545('0xb')](_0x3545('0x15'),_0x2c008a);logger[_0x3545('0xe')](_0x3545('0x15'),_0x2c008a,JSON['stringify'](_0x10037f));_0x573970(_0x10037f);})['catch'](function(_0x20800f){logger['error'](_0x3545('0x15'),_0x20800f[_0x3545('0x12')],_0x2c008a);_0x34a7f3(_0x4e3c95['error'](0x1f4,_0x20800f[_0x3545('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x5de099){var _0x447bb2=this;return new Promise(function(_0x3b421e,_0x5bb284){return db[_0x3545('0x1b')][_0x3545('0x1c')](_0x5de099[_0x3545('0x17')],{'raw':_0x5de099[_0x3545('0x18')]?_0x5de099[_0x3545('0x18')][_0x3545('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5de099['options']?_0x5de099[_0x3545('0x18')][_0x3545('0x1d')]||null:null,'attributes':_0x5de099[_0x3545('0x18')]?_0x5de099[_0x3545('0x18')][_0x3545('0x1e')]||null:null,'limit':_0x5de099[_0x3545('0x18')]?_0x5de099[_0x3545('0x18')]['limit']||null:null})[_0x3545('0x1a')](function(_0x500080){logger['info']('UpdateWhatsappQueueReport',_0x5de099);logger['debug'](_0x3545('0x1f'),_0x5de099,JSON['stringify'](_0x500080));_0x3b421e(_0x500080);})[_0x3545('0x14')](function(_0x900e88){logger[_0x3545('0x10')](_0x3545('0x1f'),_0x900e88[_0x3545('0x12')],_0x5de099);_0x5bb284(_0x447bb2[_0x3545('0x10')](0x1f4,_0x900e88[_0x3545('0x12')]));});});}; \ No newline at end of file +var _0x013f=['debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update','where','attributes','limit','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x37c219,_0x16d29c){var _0x52b594=function(_0x5d64eb){while(--_0x5d64eb){_0x37c219['push'](_0x37c219['shift']());}};_0x52b594(++_0x16d29c);}(_0x013f,0x1a0));var _0xf013=function(_0x3cd215,_0x322fe8){_0x3cd215=_0x3cd215-0x0;var _0x43452d=_0x013f[_0x3cd215];return _0x43452d;};'use strict';var _=require('lodash');var util=require(_0xf013('0x0'));var moment=require(_0xf013('0x1'));var BPromise=require(_0xf013('0x2'));var rs=require(_0xf013('0x3'));var fs=require('fs');var Redis=require(_0xf013('0x4'));var db=require(_0xf013('0x5'))['db'];var utils=require(_0xf013('0x6'));var logger=require('../../config/logger')(_0xf013('0x7'));var config=require(_0xf013('0x8'));var jayson=require(_0xf013('0x9'));var client=jayson[_0xf013('0xa')][_0xf013('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22b414,_0x2aa029,_0x1c5217){return new BPromise(function(_0x17a4e9,_0x5ca027){return client[_0xf013('0xc')](_0x22b414,_0x1c5217)[_0xf013('0xd')](function(_0x52ed10){logger['info'](_0xf013('0xe'),_0x2aa029,_0xf013('0xf'));logger[_0xf013('0x10')](_0xf013('0x11'),_0x2aa029,_0xf013('0xf'),JSON[_0xf013('0x12')](_0x52ed10));if(_0x52ed10[_0xf013('0x13')]){if(_0x52ed10[_0xf013('0x13')][_0xf013('0x14')]===0x1f4){logger[_0xf013('0x13')](_0xf013('0xe'),_0x2aa029,_0x52ed10['error'][_0xf013('0x15')]);return _0x5ca027(_0x52ed10[_0xf013('0x13')]['message']);}logger[_0xf013('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2aa029,_0x52ed10[_0xf013('0x13')][_0xf013('0x15')]);return _0x17a4e9(_0x52ed10[_0xf013('0x13')]['message']);}else{logger[_0xf013('0x16')](_0xf013('0xe'),_0x2aa029,'request\x20sent');_0x17a4e9(_0x52ed10[_0xf013('0x17')][_0xf013('0x15')]);}})['catch'](function(_0x1fa8d7){logger[_0xf013('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2aa029,_0x1fa8d7);_0x5ca027(_0x1fa8d7);});});}exports[_0xf013('0x18')]=function(_0xbe5432){var _0x5b8199=this;return new Promise(function(_0x2ffd5a,_0x31ee1f){return db[_0xf013('0x19')][_0xf013('0x1a')](_0xbe5432[_0xf013('0x1b')],{'raw':_0xbe5432[_0xf013('0x1c')]?_0xbe5432['options'][_0xf013('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x15ef7c){logger[_0xf013('0x16')](_0xf013('0x18'),_0xbe5432);logger['debug'](_0xf013('0x18'),_0xbe5432,JSON[_0xf013('0x12')](_0x15ef7c));_0x2ffd5a(_0x15ef7c);})['catch'](function(_0x3e5ea9){logger[_0xf013('0x13')]('CreateWhatsappQueueReport',_0x3e5ea9[_0xf013('0x15')],_0xbe5432);_0x31ee1f(_0x5b8199[_0xf013('0x13')](0x1f4,_0x3e5ea9[_0xf013('0x15')]));});});};exports[_0xf013('0x1e')]=function(_0x37ad38){var _0x1e3203=this;return new Promise(function(_0x5dc7cf,_0x24db20){return db[_0xf013('0x19')][_0xf013('0x1f')](_0x37ad38[_0xf013('0x1b')],{'raw':_0x37ad38[_0xf013('0x1c')]?_0x37ad38['options'][_0xf013('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37ad38['options']?_0x37ad38[_0xf013('0x1c')][_0xf013('0x20')]||null:null,'attributes':_0x37ad38[_0xf013('0x1c')]?_0x37ad38[_0xf013('0x1c')][_0xf013('0x21')]||null:null,'limit':_0x37ad38['options']?_0x37ad38[_0xf013('0x1c')][_0xf013('0x22')]||null:null})[_0xf013('0xd')](function(_0xcaa234){logger['info'](_0xf013('0x1e'),_0x37ad38);logger[_0xf013('0x10')]('UpdateWhatsappQueueReport',_0x37ad38,JSON[_0xf013('0x12')](_0xcaa234));_0x5dc7cf(_0xcaa234);})[_0xf013('0x23')](function(_0xabd253){logger[_0xf013('0x13')](_0xf013('0x1e'),_0xabd253[_0xf013('0x15')],_0x37ad38);_0x24db20(_0x1e3203['error'](0x1f4,_0xabd253['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 7630956..fe50e5a 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 _0xe6e1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','exports','multer','path'];(function(_0x5cb4f0,_0xb16665){var _0x22208=function(_0xa6ac92){while(--_0xa6ac92){_0x5cb4f0['push'](_0x5cb4f0['shift']());}};_0x22208(++_0xb16665);}(_0xe6e1,0x18d));var _0x1e6e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xe6e1[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x1e6e('0x0'));var util=require('util');var path=require(_0x1e6e('0x1'));var timeout=require(_0x1e6e('0x2'));var express=require(_0x1e6e('0x3'));var router=express[_0x1e6e('0x4')]();var fs_extra=require(_0x1e6e('0x5'));var auth=require(_0x1e6e('0x6'));var interaction=require(_0x1e6e('0x7'));var config=require(_0x1e6e('0x8'));var controller=require(_0x1e6e('0x9'));router[_0x1e6e('0xa')]('/',auth[_0x1e6e('0xb')](),controller[_0x1e6e('0xc')]);router[_0x1e6e('0xa')](_0x1e6e('0xd'),auth[_0x1e6e('0xb')](),controller['describe']);router['get'](_0x1e6e('0xe'),auth['isAuthenticated'](),controller[_0x1e6e('0xf')]);router[_0x1e6e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1e6e('0x11')](_0x1e6e('0xe'),auth[_0x1e6e('0xb')](),controller['update']);router['delete'](_0x1e6e('0xe'),auth[_0x1e6e('0xb')](),controller['destroy']);module[_0x1e6e('0x12')]=router; \ No newline at end of file +var _0x8efd=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','post','create','put'];(function(_0x32b1b4,_0x11a258){var _0x768d0d=function(_0x474d36){while(--_0x474d36){_0x32b1b4['push'](_0x32b1b4['shift']());}};_0x768d0d(++_0x11a258);}(_0x8efd,0x1bb));var _0xd8ef=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x8efd[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require(_0xd8ef('0x0'));var path=require(_0xd8ef('0x1'));var timeout=require(_0xd8ef('0x2'));var express=require(_0xd8ef('0x3'));var router=express[_0xd8ef('0x4')]();var fs_extra=require(_0xd8ef('0x5'));var auth=require(_0xd8ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd8ef('0x7'));var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0xd8ef('0x8')](),controller[_0xd8ef('0x9')]);router[_0xd8ef('0xa')](_0xd8ef('0xb'),auth[_0xd8ef('0x8')](),controller[_0xd8ef('0xc')]);router['get'](_0xd8ef('0xd'),auth[_0xd8ef('0x8')](),controller['show']);router[_0xd8ef('0xe')]('/',auth['isAuthenticated'](),controller[_0xd8ef('0xf')]);router[_0xd8ef('0x10')](_0xd8ef('0xd'),auth[_0xd8ef('0x8')](),controller[_0xd8ef('0x11')]);router['delete']('/:id',auth[_0xd8ef('0x8')](),controller[_0xd8ef('0x12')]);module[_0xd8ef('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 97f439d..ed382a3 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 _0xd26f=['exports','account','agent','queue','DATE','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd26f,0x113));var _0xfd26=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xd26f[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0xfd26('0x0'));module[_0xfd26('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfd26('0x2'),_0xfd26('0x3'),_0xfd26('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xfd26('0x5')]}}; \ No newline at end of file +var _0xbd9f=['agent','DATE','ENUM'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbd9f,0x98));var _0xfbd9=function(_0x3781b0,_0x24928b){_0x3781b0=_0x3781b0-0x0;var _0x4113c9=_0xbd9f[_0x3781b0];return _0x4113c9;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfbd9('0x0')]('account',_0xfbd9('0x1'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xfbd9('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index ffd8ce9..5401e78 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 _0xf1a2=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','save','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','options','then','includeAll','include','WhatsappTransferReport','catch','show','params','create','update','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x1a014b,_0x48acae){var _0x462258=function(_0x1473be){while(--_0x1473be){_0x1a014b['push'](_0x1a014b['shift']());}};_0x462258(++_0x48acae);}(_0xf1a2,0x1f0));var _0x2f1a=function(_0x3e00c7,_0x1f696f){_0x3e00c7=_0x3e00c7-0x0;var _0x22526a=_0xf1a2[_0x3e00c7];return _0x22526a;};'use strict';var emlformat=require(_0x2f1a('0x0'));var rimraf=require(_0x2f1a('0x1'));var zipdir=require(_0x2f1a('0x2'));var jsonpatch=require(_0x2f1a('0x3'));var rp=require(_0x2f1a('0x4'));var moment=require(_0x2f1a('0x5'));var BPromise=require(_0x2f1a('0x6'));var Mustache=require(_0x2f1a('0x7'));var util=require(_0x2f1a('0x8'));var path=require('path');var sox=require(_0x2f1a('0x9'));var csv=require(_0x2f1a('0xa'));var ejs=require(_0x2f1a('0xb'));var fs=require('fs');var fs_extra=require(_0x2f1a('0xc'));var _=require(_0x2f1a('0xd'));var squel=require(_0x2f1a('0xe'));var crypto=require('crypto');var jsforce=require(_0x2f1a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2f1a('0xa'));var querystring=require('querystring');var Papa=require(_0x2f1a('0x10'));var Redis=require(_0x2f1a('0x11'));var authService=require(_0x2f1a('0x12'));var qs=require(_0x2f1a('0x13'));var as=require(_0x2f1a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f1a('0x15'))(_0x2f1a('0x16'));var utils=require(_0x2f1a('0x17'));var config=require(_0x2f1a('0x18'));var licenseUtil=require(_0x2f1a('0x19'));var db=require(_0x2f1a('0x1a'))['db'];function respondWithStatusCode(_0x1083e9,_0xcb6ee){_0xcb6ee=_0xcb6ee||0xcc;return function(_0x51827b){if(_0x51827b){return _0x1083e9[_0x2f1a('0x1b')](_0xcb6ee);}return _0x1083e9[_0x2f1a('0x1c')](_0xcb6ee)[_0x2f1a('0x1d')]();};}function respondWithResult(_0x261db9,_0x4301cf){_0x4301cf=_0x4301cf||0xc8;return function(_0x2905e2){if(_0x2905e2){return _0x261db9[_0x2f1a('0x1c')](_0x4301cf)['json'](_0x2905e2);}};}function respondWithFilteredResult(_0x458929,_0xd9a9a){return function(_0x1b7785){if(_0x1b7785){var _0x57467e=typeof _0xd9a9a[_0x2f1a('0x1e')]===_0x2f1a('0x1f')&&typeof _0xd9a9a[_0x2f1a('0x20')]===_0x2f1a('0x1f');var _0x1d4efa=_0x1b7785[_0x2f1a('0x21')];var _0x2cb7af=_0x57467e?0x0:_0xd9a9a[_0x2f1a('0x1e')];var _0x4537f9=_0x57467e?_0x1b7785[_0x2f1a('0x21')]:_0xd9a9a['offset']+_0xd9a9a[_0x2f1a('0x20')];var _0x440f68;if(_0x4537f9>=_0x1d4efa){_0x4537f9=_0x1d4efa;_0x440f68=0xc8;}else{_0x440f68=0xce;}_0x458929[_0x2f1a('0x1c')](_0x440f68);return _0x458929['set'](_0x2f1a('0x22'),_0x2cb7af+'-'+_0x4537f9+'/'+_0x1d4efa)['json'](_0x1b7785);}return null;};}function patchUpdates(_0x1b8016){return function(_0x1c00c3){try{jsonpatch[_0x2f1a('0x23')](_0x1c00c3,_0x1b8016,!![]);}catch(_0x3da4a2){return BPromise['reject'](_0x3da4a2);}return _0x1c00c3[_0x2f1a('0x24')]();};}function saveUpdates(_0x39ddc8,_0x488b7d){return function(_0x3f7c84){if(_0x3f7c84){return _0x3f7c84['update'](_0x39ddc8)['then'](function(_0x1100b3){return _0x1100b3;});}return null;};}function removeEntity(_0x393781,_0x39f3d1){return function(_0x3c8d9b){if(_0x3c8d9b){return _0x3c8d9b['destroy']()['then'](function(){_0x393781[_0x2f1a('0x1c')](0xcc)[_0x2f1a('0x1d')]();});}};}function handleEntityNotFound(_0x2bf848,_0x37bf46){return function(_0x3bc430){if(!_0x3bc430){_0x2bf848['sendStatus'](0x194);}return _0x3bc430;};}function handleError(_0xa3311a,_0x5a3580){_0x5a3580=_0x5a3580||0x1f4;return function(_0x182357){logger['error'](_0x182357[_0x2f1a('0x25')]);if(_0x182357[_0x2f1a('0x26')]){delete _0x182357['name'];}_0xa3311a[_0x2f1a('0x1c')](_0x5a3580)[_0x2f1a('0x27')](_0x182357);};}exports['index']=function(_0x4b677a,_0x2ab0ed){var _0x24c267={},_0x22d28d={},_0x109a47={'count':0x0,'rows':[]};var _0x47dbfc=_[_0x2f1a('0x28')](db['WhatsappTransferReport'][_0x2f1a('0x29')],function(_0x3fe710){return{'name':_0x3fe710['fieldName'],'type':_0x3fe710[_0x2f1a('0x2a')][_0x2f1a('0x2b')]};});_0x22d28d[_0x2f1a('0x2c')]=_['map'](_0x47dbfc,_0x2f1a('0x26'));_0x22d28d[_0x2f1a('0x2d')]=_[_0x2f1a('0x2e')](_0x4b677a[_0x2f1a('0x2d')]);_0x22d28d[_0x2f1a('0x2f')]=_['intersection'](_0x22d28d['model'],_0x22d28d[_0x2f1a('0x2d')]);_0x24c267[_0x2f1a('0x30')]=_[_0x2f1a('0x31')](_0x22d28d[_0x2f1a('0x2c')],qs[_0x2f1a('0x32')](_0x4b677a[_0x2f1a('0x2d')]['fields']));_0x24c267['attributes']=_0x24c267[_0x2f1a('0x30')][_0x2f1a('0x33')]?_0x24c267[_0x2f1a('0x30')]:_0x22d28d[_0x2f1a('0x2c')];if(!_0x4b677a[_0x2f1a('0x2d')][_0x2f1a('0x34')](_0x2f1a('0x35'))){_0x24c267[_0x2f1a('0x20')]=qs[_0x2f1a('0x20')](_0x4b677a['query'][_0x2f1a('0x20')]);_0x24c267[_0x2f1a('0x1e')]=qs[_0x2f1a('0x1e')](_0x4b677a[_0x2f1a('0x2d')]['offset']);}_0x24c267['order']=qs[_0x2f1a('0x36')](_0x4b677a[_0x2f1a('0x2d')]['sort']);_0x24c267['where']=qs[_0x2f1a('0x2f')](_[_0x2f1a('0x37')](_0x4b677a[_0x2f1a('0x2d')],_0x22d28d['filters']),_0x47dbfc);if(_0x4b677a[_0x2f1a('0x2d')]['filter']){_0x24c267['where']=_[_0x2f1a('0x38')](_0x24c267[_0x2f1a('0x39')],{'$or':_[_0x2f1a('0x28')](_0x47dbfc,function(_0x2a6a57){if(_0x2a6a57[_0x2f1a('0x2a')]!==_0x2f1a('0x3a')){var _0x29d6d4={};_0x29d6d4[_0x2a6a57[_0x2f1a('0x26')]]={'$like':'%'+_0x4b677a[_0x2f1a('0x2d')][_0x2f1a('0x3b')]+'%'};return _0x29d6d4;}})});}_0x24c267=_[_0x2f1a('0x38')]({},_0x24c267,_0x4b677a[_0x2f1a('0x3c')]);var _0x16e66e={'where':_0x24c267[_0x2f1a('0x39')]};return db['WhatsappTransferReport'][_0x2f1a('0x21')](_0x16e66e)[_0x2f1a('0x3d')](function(_0x544695){_0x109a47[_0x2f1a('0x21')]=_0x544695;if(_0x4b677a['query'][_0x2f1a('0x3e')]){_0x24c267[_0x2f1a('0x3f')]=[{'all':!![]}];}return db[_0x2f1a('0x40')]['findAll'](_0x24c267);})[_0x2f1a('0x3d')](function(_0x237bdb){_0x109a47['rows']=_0x237bdb;return _0x109a47;})[_0x2f1a('0x3d')](respondWithFilteredResult(_0x2ab0ed,_0x24c267))[_0x2f1a('0x41')](handleError(_0x2ab0ed,null));};exports[_0x2f1a('0x42')]=function(_0x41d2c6,_0xa459da){var _0x429a7e={'raw':!![],'where':{'id':_0x41d2c6[_0x2f1a('0x43')]['id']}},_0x42146e={};_0x42146e['model']=_['keys'](db[_0x2f1a('0x40')][_0x2f1a('0x29')]);_0x42146e[_0x2f1a('0x2d')]=_[_0x2f1a('0x2e')](_0x41d2c6[_0x2f1a('0x2d')]);_0x42146e[_0x2f1a('0x2f')]=_[_0x2f1a('0x31')](_0x42146e[_0x2f1a('0x2c')],_0x42146e['query']);_0x429a7e[_0x2f1a('0x30')]=_['intersection'](_0x42146e[_0x2f1a('0x2c')],qs[_0x2f1a('0x32')](_0x41d2c6['query'][_0x2f1a('0x32')]));_0x429a7e['attributes']=_0x429a7e[_0x2f1a('0x30')][_0x2f1a('0x33')]?_0x429a7e[_0x2f1a('0x30')]:_0x42146e[_0x2f1a('0x2c')];if(_0x41d2c6[_0x2f1a('0x2d')]['includeAll']){_0x429a7e['include']=[{'all':!![]}];}_0x429a7e=_[_0x2f1a('0x38')]({},_0x429a7e,_0x41d2c6[_0x2f1a('0x3c')]);return db[_0x2f1a('0x40')]['find'](_0x429a7e)[_0x2f1a('0x3d')](handleEntityNotFound(_0xa459da,null))[_0x2f1a('0x3d')](respondWithResult(_0xa459da,null))[_0x2f1a('0x41')](handleError(_0xa459da,null));};exports[_0x2f1a('0x44')]=function(_0x319fa1,_0x1c454d){return db['WhatsappTransferReport'][_0x2f1a('0x44')](_0x319fa1['body'],{})['then'](respondWithResult(_0x1c454d,0xc9))[_0x2f1a('0x41')](handleError(_0x1c454d,null));};exports[_0x2f1a('0x45')]=function(_0x39fcd4,_0x363f02){if(_0x39fcd4[_0x2f1a('0x46')]['id']){delete _0x39fcd4[_0x2f1a('0x46')]['id'];}return db[_0x2f1a('0x40')][_0x2f1a('0x47')]({'where':{'id':_0x39fcd4[_0x2f1a('0x43')]['id']}})['then'](handleEntityNotFound(_0x363f02,null))[_0x2f1a('0x3d')](saveUpdates(_0x39fcd4[_0x2f1a('0x46')],null))[_0x2f1a('0x3d')](respondWithResult(_0x363f02,null))['catch'](handleError(_0x363f02,null));};exports[_0x2f1a('0x48')]=function(_0x4c65de,_0x47a01e){return db['WhatsappTransferReport']['find']({'where':{'id':_0x4c65de[_0x2f1a('0x43')]['id']}})['then'](handleEntityNotFound(_0x47a01e,null))['then'](removeEntity(_0x47a01e,null))[_0x2f1a('0x41')](handleError(_0x47a01e,null));};exports[_0x2f1a('0x49')]=function(_0x4cbefe,_0xbb5336){return db[_0x2f1a('0x40')]['describe']()[_0x2f1a('0x3d')](respondWithResult(_0xbb5336,null))[_0x2f1a('0x41')](handleError(_0xbb5336,null));}; \ No newline at end of file +var _0xe451=['catch','show','params','includeAll','find','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','then','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows'];(function(_0x3fb58d,_0x3d4355){var _0x171fcb=function(_0x4d7704){while(--_0x4d7704){_0x3fb58d['push'](_0x3fb58d['shift']());}};_0x171fcb(++_0x3d4355);}(_0xe451,0x12c));var _0x1e45=function(_0x1541a3,_0xec95b6){_0x1541a3=_0x1541a3-0x0;var _0x5be16c=_0xe451[_0x1541a3];return _0x5be16c;};'use strict';var emlformat=require(_0x1e45('0x0'));var rimraf=require(_0x1e45('0x1'));var zipdir=require(_0x1e45('0x2'));var jsonpatch=require(_0x1e45('0x3'));var rp=require(_0x1e45('0x4'));var moment=require(_0x1e45('0x5'));var BPromise=require(_0x1e45('0x6'));var Mustache=require(_0x1e45('0x7'));var util=require('util');var path=require(_0x1e45('0x8'));var sox=require(_0x1e45('0x9'));var csv=require(_0x1e45('0xa'));var ejs=require(_0x1e45('0xb'));var fs=require('fs');var fs_extra=require(_0x1e45('0xc'));var _=require('lodash');var squel=require(_0x1e45('0xd'));var crypto=require(_0x1e45('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1e45('0xf'));var toCsv=require(_0x1e45('0xa'));var querystring=require('querystring');var Papa=require(_0x1e45('0x10'));var Redis=require(_0x1e45('0x11'));var authService=require(_0x1e45('0x12'));var qs=require(_0x1e45('0x13'));var as=require(_0x1e45('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e45('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1e45('0x16'));var licenseUtil=require(_0x1e45('0x17'));var db=require(_0x1e45('0x18'))['db'];function respondWithStatusCode(_0x56d814,_0x169127){_0x169127=_0x169127||0xcc;return function(_0xa4388e){if(_0xa4388e){return _0x56d814[_0x1e45('0x19')](_0x169127);}return _0x56d814[_0x1e45('0x1a')](_0x169127)[_0x1e45('0x1b')]();};}function respondWithResult(_0x320edb,_0x4a155c){_0x4a155c=_0x4a155c||0xc8;return function(_0xfb0d8c){if(_0xfb0d8c){return _0x320edb['status'](_0x4a155c)[_0x1e45('0x1c')](_0xfb0d8c);}};}function respondWithFilteredResult(_0x5e994a,_0x25650e){return function(_0x5340f4){if(_0x5340f4){var _0x1793f0=typeof _0x25650e[_0x1e45('0x1d')]==='undefined'&&typeof _0x25650e[_0x1e45('0x1e')]==='undefined';var _0x3fb4ed=_0x5340f4[_0x1e45('0x1f')];var _0x51b079=_0x1793f0?0x0:_0x25650e['offset'];var _0x1f9734=_0x1793f0?_0x5340f4[_0x1e45('0x1f')]:_0x25650e['offset']+_0x25650e['limit'];var _0x4cf258;if(_0x1f9734>=_0x3fb4ed){_0x1f9734=_0x3fb4ed;_0x4cf258=0xc8;}else{_0x4cf258=0xce;}_0x5e994a[_0x1e45('0x1a')](_0x4cf258);return _0x5e994a[_0x1e45('0x20')](_0x1e45('0x21'),_0x51b079+'-'+_0x1f9734+'/'+_0x3fb4ed)['json'](_0x5340f4);}return null;};}function patchUpdates(_0x5da6b6){return function(_0x4a14f9){try{jsonpatch[_0x1e45('0x22')](_0x4a14f9,_0x5da6b6,!![]);}catch(_0x115f51){return BPromise['reject'](_0x115f51);}return _0x4a14f9[_0x1e45('0x23')]();};}function saveUpdates(_0x2962cc,_0x351cd9){return function(_0x3bd33a){if(_0x3bd33a){return _0x3bd33a['update'](_0x2962cc)[_0x1e45('0x24')](function(_0x238b81){return _0x238b81;});}return null;};}function removeEntity(_0x32dcb5,_0x4f4d4c){return function(_0x2896e4){if(_0x2896e4){return _0x2896e4['destroy']()[_0x1e45('0x24')](function(){_0x32dcb5[_0x1e45('0x1a')](0xcc)[_0x1e45('0x1b')]();});}};}function handleEntityNotFound(_0xac963,_0x100559){return function(_0x22809c){if(!_0x22809c){_0xac963[_0x1e45('0x19')](0x194);}return _0x22809c;};}function handleError(_0x2b77e9,_0x26989f){_0x26989f=_0x26989f||0x1f4;return function(_0x131d77){logger[_0x1e45('0x25')](_0x131d77[_0x1e45('0x26')]);if(_0x131d77['name']){delete _0x131d77[_0x1e45('0x27')];}_0x2b77e9['status'](_0x26989f)[_0x1e45('0x28')](_0x131d77);};}exports[_0x1e45('0x29')]=function(_0x2c64c4,_0x3cab59){var _0x4b3c37={},_0x5d6459={},_0x2f48e6={'count':0x0,'rows':[]};var _0x3ede5b=_[_0x1e45('0x2a')](db[_0x1e45('0x2b')][_0x1e45('0x2c')],function(_0x47f705){return{'name':_0x47f705[_0x1e45('0x2d')],'type':_0x47f705['type'][_0x1e45('0x2e')]};});_0x5d6459[_0x1e45('0x2f')]=_['map'](_0x3ede5b,_0x1e45('0x27'));_0x5d6459['query']=_[_0x1e45('0x30')](_0x2c64c4[_0x1e45('0x31')]);_0x5d6459[_0x1e45('0x32')]=_[_0x1e45('0x33')](_0x5d6459[_0x1e45('0x2f')],_0x5d6459['query']);_0x4b3c37[_0x1e45('0x34')]=_[_0x1e45('0x33')](_0x5d6459['model'],qs[_0x1e45('0x35')](_0x2c64c4[_0x1e45('0x31')][_0x1e45('0x35')]));_0x4b3c37['attributes']=_0x4b3c37[_0x1e45('0x34')]['length']?_0x4b3c37[_0x1e45('0x34')]:_0x5d6459[_0x1e45('0x2f')];if(!_0x2c64c4['query']['hasOwnProperty']('nolimit')){_0x4b3c37[_0x1e45('0x1e')]=qs[_0x1e45('0x1e')](_0x2c64c4[_0x1e45('0x31')]['limit']);_0x4b3c37[_0x1e45('0x1d')]=qs[_0x1e45('0x1d')](_0x2c64c4[_0x1e45('0x31')]['offset']);}_0x4b3c37['order']=qs[_0x1e45('0x36')](_0x2c64c4[_0x1e45('0x31')][_0x1e45('0x36')]);_0x4b3c37[_0x1e45('0x37')]=qs['filters'](_[_0x1e45('0x38')](_0x2c64c4[_0x1e45('0x31')],_0x5d6459[_0x1e45('0x32')]),_0x3ede5b);if(_0x2c64c4[_0x1e45('0x31')][_0x1e45('0x39')]){_0x4b3c37[_0x1e45('0x37')]=_[_0x1e45('0x3a')](_0x4b3c37[_0x1e45('0x37')],{'$or':_['map'](_0x3ede5b,function(_0x4bbf4f){if(_0x4bbf4f[_0x1e45('0x3b')]!==_0x1e45('0x3c')){var _0x291612={};_0x291612[_0x4bbf4f[_0x1e45('0x27')]]={'$like':'%'+_0x2c64c4[_0x1e45('0x31')][_0x1e45('0x39')]+'%'};return _0x291612;}})});}_0x4b3c37=_[_0x1e45('0x3a')]({},_0x4b3c37,_0x2c64c4[_0x1e45('0x3d')]);var _0x3d7381={'where':_0x4b3c37[_0x1e45('0x37')]};return db[_0x1e45('0x2b')][_0x1e45('0x1f')](_0x3d7381)['then'](function(_0x71ecb1){_0x2f48e6[_0x1e45('0x1f')]=_0x71ecb1;if(_0x2c64c4[_0x1e45('0x31')]['includeAll']){_0x4b3c37[_0x1e45('0x3e')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x1e45('0x3f')](_0x4b3c37);})[_0x1e45('0x24')](function(_0x313083){_0x2f48e6[_0x1e45('0x40')]=_0x313083;return _0x2f48e6;})[_0x1e45('0x24')](respondWithFilteredResult(_0x3cab59,_0x4b3c37))[_0x1e45('0x41')](handleError(_0x3cab59,null));};exports[_0x1e45('0x42')]=function(_0x2f2038,_0xe43e7){var _0x38c6b5={'raw':!![],'where':{'id':_0x2f2038[_0x1e45('0x43')]['id']}},_0x462123={};_0x462123[_0x1e45('0x2f')]=_[_0x1e45('0x30')](db[_0x1e45('0x2b')]['rawAttributes']);_0x462123[_0x1e45('0x31')]=_[_0x1e45('0x30')](_0x2f2038['query']);_0x462123['filters']=_[_0x1e45('0x33')](_0x462123['model'],_0x462123['query']);_0x38c6b5[_0x1e45('0x34')]=_[_0x1e45('0x33')](_0x462123[_0x1e45('0x2f')],qs[_0x1e45('0x35')](_0x2f2038[_0x1e45('0x31')]['fields']));_0x38c6b5[_0x1e45('0x34')]=_0x38c6b5['attributes']['length']?_0x38c6b5[_0x1e45('0x34')]:_0x462123['model'];if(_0x2f2038[_0x1e45('0x31')][_0x1e45('0x44')]){_0x38c6b5[_0x1e45('0x3e')]=[{'all':!![]}];}_0x38c6b5=_['merge']({},_0x38c6b5,_0x2f2038[_0x1e45('0x3d')]);return db[_0x1e45('0x2b')][_0x1e45('0x45')](_0x38c6b5)[_0x1e45('0x24')](handleEntityNotFound(_0xe43e7,null))['then'](respondWithResult(_0xe43e7,null))[_0x1e45('0x41')](handleError(_0xe43e7,null));};exports['create']=function(_0x2dc2cb,_0x14661c){return db[_0x1e45('0x2b')]['create'](_0x2dc2cb[_0x1e45('0x46')],{})['then'](respondWithResult(_0x14661c,0xc9))['catch'](handleError(_0x14661c,null));};exports['update']=function(_0x461e5d,_0x5d2af0){if(_0x461e5d[_0x1e45('0x46')]['id']){delete _0x461e5d[_0x1e45('0x46')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x461e5d[_0x1e45('0x43')]['id']}})[_0x1e45('0x24')](handleEntityNotFound(_0x5d2af0,null))['then'](saveUpdates(_0x461e5d['body'],null))['then'](respondWithResult(_0x5d2af0,null))[_0x1e45('0x41')](handleError(_0x5d2af0,null));};exports[_0x1e45('0x47')]=function(_0x5de540,_0x32feae){return db[_0x1e45('0x2b')][_0x1e45('0x45')]({'where':{'id':_0x5de540['params']['id']}})[_0x1e45('0x24')](handleEntityNotFound(_0x32feae,null))[_0x1e45('0x24')](removeEntity(_0x32feae,null))['catch'](handleError(_0x32feae,null));};exports[_0x1e45('0x48')]=function(_0x3e8df9,_0x5b9cbd){return db[_0x1e45('0x2b')]['describe']()[_0x1e45('0x24')](respondWithResult(_0x5b9cbd,null))['catch'](handleError(_0x5b9cbd,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 7c2aa6a..7a0a5ea 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 _0x01e1=['request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','bluebird'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0x01e1,0x8c));var _0x101e=function(_0x57d863,_0x4f77a1){_0x57d863=_0x57d863-0x0;var _0x1bbdb5=_0x01e1[_0x57d863];return _0x1bbdb5;};'use strict';var _=require('lodash');var util=require(_0x101e('0x0'));var logger=require(_0x101e('0x1'))(_0x101e('0x2'));var moment=require('moment');var BPromise=require(_0x101e('0x3'));var rp=require(_0x101e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x101e('0x5'));var config=require(_0x101e('0x6'));var attributes=require(_0x101e('0x7'));module['exports']=function(_0x41d720,_0x542eb0){return _0x41d720[_0x101e('0x8')](_0x101e('0x9'),attributes,{'tableName':_0x101e('0xa'),'paranoid':![],'indexes':[{'name':_0x101e('0xb'),'fields':[_0x101e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6aaa=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x6aaa,0x1b4));var _0xa6aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6aaa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa6aa('0x0'));var util=require(_0xa6aa('0x1'));var logger=require(_0xa6aa('0x2'))(_0xa6aa('0x3'));var moment=require(_0xa6aa('0x4'));var BPromise=require(_0xa6aa('0x5'));var rp=require(_0xa6aa('0x6'));var fs=require('fs');var path=require(_0xa6aa('0x7'));var rimraf=require(_0xa6aa('0x8'));var config=require(_0xa6aa('0x9'));var attributes=require('./whatsappTransferReport.attributes');module[_0xa6aa('0xa')]=function(_0x571f24,_0x476764){return _0x571f24[_0xa6aa('0xb')](_0xa6aa('0xc'),attributes,{'tableName':_0xa6aa('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa6aa('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 4a6ef92..34d7405 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 _0x275c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x20e9fe,_0x56b18d){var _0x16c8de=function(_0x1fbd12){while(--_0x1fbd12){_0x20e9fe['push'](_0x20e9fe['shift']());}};_0x16c8de(++_0x56b18d);}(_0x275c,0x7e));var _0xc275=function(_0x403c2f,_0x2f8a78){_0x403c2f=_0x403c2f-0x0;var _0x5f3be2=_0x275c[_0x403c2f];return _0x5f3be2;};'use strict';var _=require(_0xc275('0x0'));var util=require(_0xc275('0x1'));var moment=require(_0xc275('0x2'));var BPromise=require('bluebird');var rs=require(_0xc275('0x3'));var fs=require('fs');var Redis=require(_0xc275('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc275('0x5'));var logger=require(_0xc275('0x6'))(_0xc275('0x7'));var config=require(_0xc275('0x8'));var jayson=require(_0xc275('0x9'));var client=jayson[_0xc275('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28e2f4,_0x21dbef,_0x1dbfb5){return new BPromise(function(_0x516eb8,_0x58fdae){return client[_0xc275('0xb')](_0x28e2f4,_0x1dbfb5)['then'](function(_0x3e9cb3){logger[_0xc275('0xc')](_0xc275('0xd'),_0x21dbef,'request\x20sent');logger[_0xc275('0xe')](_0xc275('0xf'),_0x21dbef,_0xc275('0x10'),JSON['stringify'](_0x3e9cb3));if(_0x3e9cb3[_0xc275('0x11')]){if(_0x3e9cb3['error'][_0xc275('0x12')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x21dbef,_0x3e9cb3[_0xc275('0x11')][_0xc275('0x13')]);return _0x58fdae(_0x3e9cb3['error']['message']);}logger[_0xc275('0x11')](_0xc275('0xd'),_0x21dbef,_0x3e9cb3[_0xc275('0x11')][_0xc275('0x13')]);return _0x516eb8(_0x3e9cb3[_0xc275('0x11')][_0xc275('0x13')]);}else{logger[_0xc275('0xc')](_0xc275('0xd'),_0x21dbef,'request\x20sent');_0x516eb8(_0x3e9cb3[_0xc275('0x14')][_0xc275('0x13')]);}})[_0xc275('0x15')](function(_0x435c8c){logger[_0xc275('0x11')](_0xc275('0xd'),_0x21dbef,_0x435c8c);_0x58fdae(_0x435c8c);});});} \ No newline at end of file +var _0x125f=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','moment','randomstring'];(function(_0x1b1fd9,_0x5dcf2b){var _0x1fb351=function(_0x556e9f){while(--_0x556e9f){_0x1b1fd9['push'](_0x1b1fd9['shift']());}};_0x1fb351(++_0x5dcf2b);}(_0x125f,0x12a));var _0xf125=function(_0xff319d,_0x1dfdc0){_0xff319d=_0xff319d-0x0;var _0x4839c7=_0x125f[_0xff319d];return _0x4839c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf125('0x0'));var BPromise=require('bluebird');var rs=require(_0xf125('0x1'));var fs=require('fs');var Redis=require(_0xf125('0x2'));var db=require(_0xf125('0x3'))['db'];var utils=require(_0xf125('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf125('0x5'));var jayson=require(_0xf125('0x6'));var client=jayson[_0xf125('0x7')][_0xf125('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24e15f,_0x2ea69e,_0x14bade){return new BPromise(function(_0x1d9aa7,_0x453aca){return client[_0xf125('0x9')](_0x24e15f,_0x14bade)[_0xf125('0xa')](function(_0x74d72f){logger[_0xf125('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2ea69e,_0xf125('0xc'));logger[_0xf125('0xd')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x2ea69e,_0xf125('0xc'),JSON[_0xf125('0xe')](_0x74d72f));if(_0x74d72f[_0xf125('0xf')]){if(_0x74d72f[_0xf125('0xf')]['code']===0x1f4){logger['error'](_0xf125('0x10'),_0x2ea69e,_0x74d72f['error'][_0xf125('0x11')]);return _0x453aca(_0x74d72f['error'][_0xf125('0x11')]);}logger[_0xf125('0xf')](_0xf125('0x10'),_0x2ea69e,_0x74d72f[_0xf125('0xf')][_0xf125('0x11')]);return _0x1d9aa7(_0x74d72f['error'][_0xf125('0x11')]);}else{logger['info'](_0xf125('0x10'),_0x2ea69e,'request\x20sent');_0x1d9aa7(_0x74d72f[_0xf125('0x12')]['message']);}})[_0xf125('0x13')](function(_0x5351df){logger[_0xf125('0xf')](_0xf125('0x10'),_0x2ea69e,_0x5351df);_0x453aca(_0x5351df);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index a1c496c..699ae80 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7250=['./config/schedule/transcribe','sequelize','sync','seedDB','default','then','listen','info','start','filter','exitCode','number','length','map','Online\x20apps:','online','name','join','Offline\x20apps:','status','None','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule'];(function(_0x127d0b,_0x29299d){var _0x23577e=function(_0x46c41a){while(--_0x46c41a){_0x127d0b['push'](_0x127d0b['shift']());}};_0x23577e(++_0x29299d);}(_0x7250,0x1b1));var _0x0725=function(_0x32f105,_0x44ae06){_0x32f105=_0x32f105-0x0;var _0x10d559=_0x7250[_0x32f105];return _0x10d559;};'use strict';var _=require(_0x0725('0x0'));var db=require(_0x0725('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x0725('0x2'));var rpc=require(_0x0725('0x3'));var config=require(_0x0725('0x4'));var logger=require(_0x0725('0x5'))(_0x0725('0x6'));var pm2=require(_0x0725('0x7'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x0725('0x8'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x0725('0x9'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x0725('0xa')][_0x0725('0xb')]()['then'](function(){if(config[_0x0725('0xc')]){return seedDb[_0x0725('0xd')]();}})[_0x0725('0xe')](function(){return checkLicense[_0x0725('0xd')]();})[_0x0725('0xe')](function(){return rpc[_0x0725('0xf')]();})[_0x0725('0xe')](function(_0x4c2f6a){logger[_0x0725('0x10')](_0x4c2f6a);return chat[_0x0725('0x11')]();})[_0x0725('0xe')](function(){return whatsapp['start']();})['then'](function(){return schedule[_0x0725('0x11')]();})[_0x0725('0xe')](function(){return transcribe[_0x0725('0x11')]();})[_0x0725('0xe')](function(){return provider[_0x0725('0x11')]();})[_0x0725('0xe')](function(_0x1dc8b8){logger[_0x0725('0x10')](_0x1dc8b8);return pm2[_0x0725('0x11')](pm2Config);})['then'](function(_0x180021){var _0x685ce=_0x180021[_0x0725('0x12')](function(_0x163d77){return typeof _0x163d77[_0x0725('0x13')]===_0x0725('0x14')&&_0x163d77['exitCode']>=0x0;});if(_0x685ce['length']>0x0){throw new Error(_0x685ce[_0x0725('0x15')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x0725('0x16')](_0x685ce,function(_0x4dfc36){return'\x22'+_0x4dfc36['pm2_env']['name']+'\x22';}));}logger[_0x0725('0x10')](_0x0725('0x17'),_[_0x0725('0x16')](_[_0x0725('0x12')](_0x180021,{'status':_0x0725('0x18')}),_0x0725('0x19'))[_0x0725('0x1a')]());logger[_0x0725('0x10')](_0x0725('0x1b'),_[_0x0725('0x16')](_[_0x0725('0x12')](_0x180021,function(_0x4b04a3){return _0x4b04a3[_0x0725('0x1c')]!==_0x0725('0x18');}),_0x0725('0x19'))[_0x0725('0x1a')]()||_0x0725('0x1d'));console['log']('App\x20Ready!');})[_0x0725('0x1e')](function(_0x3167a3){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x3167a3);logger[_0x0725('0x1f')](_0x0725('0x20'),_0x3167a3);process[_0x0725('0x21')](0x1);});}main(); \ No newline at end of file +var _0x7266=['\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','join','Offline\x20apps:','status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','app','./config/pm2','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','filter','exitCode','number','length'];(function(_0x2b44f6,_0x4264e4){var _0x24a7b1=function(_0x216e9f){while(--_0x216e9f){_0x2b44f6['push'](_0x2b44f6['shift']());}};_0x24a7b1(++_0x4264e4);}(_0x7266,0xec));var _0x6726=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x7266[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x6726('0x0'));var db=require(_0x6726('0x1'))['db'];var seedDb=require(_0x6726('0x2'));var checkLicense=require(_0x6726('0x3'));var rpc=require(_0x6726('0x4'));var config=require('./config/environment');var logger=require('./config/logger')(_0x6726('0x5'));var pm2=require(_0x6726('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0x6726('0x7'));var whatsapp=require(_0x6726('0x8'));var transcribe=require(_0x6726('0x9'));var provider=require(_0x6726('0xa'));function main(){return db[_0x6726('0xb')][_0x6726('0xc')]()[_0x6726('0xd')](function(){if(config[_0x6726('0xe')]){return seedDb[_0x6726('0xf')]();}})[_0x6726('0xd')](function(){return checkLicense[_0x6726('0xf')]();})[_0x6726('0xd')](function(){return rpc[_0x6726('0x10')]();})['then'](function(_0x44ff0c){logger[_0x6726('0x11')](_0x44ff0c);return chat[_0x6726('0x12')]();})[_0x6726('0xd')](function(){return whatsapp['start']();})[_0x6726('0xd')](function(){return schedule['start']();})[_0x6726('0xd')](function(){return transcribe[_0x6726('0x12')]();})['then'](function(){return provider[_0x6726('0x12')]();})[_0x6726('0xd')](function(_0x1182b2){logger[_0x6726('0x11')](_0x1182b2);return pm2['start'](pm2Config);})[_0x6726('0xd')](function(_0x2eb2bc){var _0x4dc47d=_0x2eb2bc[_0x6726('0x13')](function(_0x5d3458){return typeof _0x5d3458[_0x6726('0x14')]===_0x6726('0x15')&&_0x5d3458[_0x6726('0x14')]>=0x0;});if(_0x4dc47d[_0x6726('0x16')]>0x0){throw new Error(_0x4dc47d['length']+_0x6726('0x17')+_[_0x6726('0x18')](_0x4dc47d,function(_0x4adb51){return'\x22'+_0x4adb51[_0x6726('0x19')]['name']+'\x22';}));}logger['info']('Online\x20apps:',_[_0x6726('0x18')](_[_0x6726('0x13')](_0x2eb2bc,{'status':'online'}),_0x6726('0x1a'))[_0x6726('0x1b')]());logger[_0x6726('0x11')](_0x6726('0x1c'),_[_0x6726('0x18')](_[_0x6726('0x13')](_0x2eb2bc,function(_0x4af165){return _0x4af165[_0x6726('0x1d')]!=='online';}),_0x6726('0x1a'))[_0x6726('0x1b')]()||_0x6726('0x1e'));console[_0x6726('0x1f')](_0x6726('0x20'));})[_0x6726('0x21')](function(_0x562058){console[_0x6726('0x1f')](_0x6726('0x22'),_0x562058);logger[_0x6726('0x23')](_0x6726('0x24'),_0x562058);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 8d136ae..89dda5d 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 _0x2032=['interface','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','Forbidden.','catch','use','headers','authorization','Basic','find','authenticate','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockedAt','add','blockDuration','minutes','Invalid\x20API\x20access\x20key','User','User\x20not\x20found.','User\x20object\x20not\x20found.','Forbidden','isWebrtcLicence','getLicense','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','retrieveApiKey','apiKeyNonce','isNil','apiKeyIat','generateApiKey','regenerateApiKey','test','ValidationError','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','length','splice','unshift','promisify','sign','secret','payload','verify','randomBytes','hex','floor','now','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','userpic','md5secret','voicePause','chatPause','faxPause','openchannelPause','showWebBar','lastLoginAt','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk'];(function(_0x56c9d3,_0x489b12){var _0x3c5cd7=function(_0x3f8bfa){while(--_0x3f8bfa){_0x56c9d3['push'](_0x56c9d3['shift']());}};_0x3c5cd7(++_0x489b12);}(_0x2032,0xd9));var _0x2203=function(_0x25e04c,_0x59201e){_0x25e04c=_0x25e04c-0x0;var _0xf61ec0=_0x2032[_0x25e04c];return _0xf61ec0;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x2203('0x0'));var hardwareConf=require(_0x2203('0x1'));var licenseUtil=require(_0x2203('0x2'));var encryptor=require('../encryptor');var _=require(_0x2203('0x3'));var jwt=require(_0x2203('0x4'));var expressJwt=require('express-jwt');var compose=require(_0x2203('0x5'));var basicAuth=require(_0x2203('0x6'));var crypto=require(_0x2203('0x7'));var BPromise=require(_0x2203('0x8'));var util=require(_0x2203('0x9'));var moment=require(_0x2203('0xa'));var validateJwt=expressJwt({'secret':config[_0x2203('0xb')][_0x2203('0xc')]});var userAttributes=['id',_0x2203('0xd'),_0x2203('0xe'),_0x2203('0xf'),'internal','email',_0x2203('0x10'),'permissions',_0x2203('0x11'),_0x2203('0x12'),_0x2203('0x13'),'mailPause',_0x2203('0x14'),'smsPause',_0x2203('0x15'),'pauseType',_0x2203('0x16'),_0x2203('0x17'),'lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias',_0x2203('0x18'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0x2203('0x19'),_0x2203('0x1a'),_0x2203('0x1b'),_0x2203('0x1c'),_0x2203('0x1d'),_0x2203('0x1e'),_0x2203('0x1f'),_0x2203('0x20'),_0x2203('0x21'),_0x2203('0x22'),'privacyEnabled',_0x2203('0x23'),_0x2203('0x24'),'downloadVoiceRecordings',_0x2203('0x25'),_0x2203('0x26'),'ignorePauseForPreviewCalls',_0x2203('0x27'),'chatAutoanswer',_0x2203('0x28'),_0x2203('0x29'),_0x2203('0x2a'),_0x2203('0x2b'),_0x2203('0x2c'),_0x2203('0x2d'),'openchannelAutoanswerDelay',_0x2203('0x2e'),'faxAutoanswerDelay','whatsappAutoanswer',_0x2203('0x2f'),'messengerSoundNotification'];exports[_0x2203('0x30')]=function(){return this[_0x2203('0x31')](!![])['use'](function(_0x3ee25b,_0x5e29cd,_0x5c8da9){if(_0x3ee25b[_0x2203('0x32')]){_0x5c8da9();}else{return db[_0x2203('0x33')][_0x2203('0x34')]({'where':{'id':_0x3ee25b[_0x2203('0x35')]['id']},'attributes':['id',_0x2203('0x36'),_0x2203('0x37')],'raw':!![]})[_0x2203('0x38')](function(_0x250349){if(_0x250349&&_0x250349['closed']){return _0x5e29cd[_0x2203('0x39')](_0x250349[_0x2203('0x37')]===_0x2203('0x3a')?0x195:0x193)['json']({'message':_0x250349[_0x2203('0x37')]===_0x2203('0x3a')?'Unmanaged.':_0x2203('0x3b')});}else{_0x5c8da9();}})[_0x2203('0x3c')](function(_0x1c6a77){_0x5c8da9(_0x1c6a77);});}});};exports[_0x2203('0x31')]=function isAuthenticated(_0x28ae02){return compose()[_0x2203('0x3d')](function(_0x9c53f,_0x5a95c1,_0x34b8ba){var _0x616ed8;if(_0x9c53f[_0x2203('0x3e')][_0x2203('0x3f')]){if(_['startsWith'](_0x9c53f[_0x2203('0x3e')][_0x2203('0x3f')],_0x2203('0x40'))){var _0xf59954=basicAuth(_0x9c53f);db['User'][_0x2203('0x41')]({'where':{'name':_0xf59954[_0x2203('0xf')]}})['then'](function(_0x5c0157){if(!_0x5c0157||!_0x5c0157[_0x2203('0x42')](_0xf59954['pass'])){return _0x5a95c1['status'](0x191)[_0x2203('0x43')]({'message':_0x2203('0x44')});}_0x9c53f[_0x2203('0x32')]={'id':_0x5c0157['id']};_0x34b8ba();})[_0x2203('0x3c')](function(_0xf2801d){_0x34b8ba(_0xf2801d);});}else if(_['startsWith'](_0x9c53f[_0x2203('0x3e')][_0x2203('0x3f')],'Bearer')){validateJwt(_0x9c53f,_0x5a95c1,_0x34b8ba);}else{if(_0x28ae02){_0x34b8ba();}else{return _0x5a95c1[_0x2203('0x39')](0x193)[_0x2203('0x43')]({'message':_0x2203('0x45')});}}}else if(_0x9c53f[_0x2203('0x46')][_0x2203('0x47')]){try{var _0x24d138={'audience':hardwareConf[_0x2203('0x48')](),'issuer':hardwareConf[_0x2203('0x48')]()};verifyJwt(_0x9c53f[_0x2203('0x46')]['apikey'],_0x24d138)[_0x2203('0x38')](function(_0x347d3e){return db['User']['find']({'where':{'id':_0x347d3e[_0x2203('0x49')]}})['then'](function(_0x25cc97){_0x616ed8=_0x25cc97;return db[_0x2203('0x4a')][_0x2203('0x34')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})[_0x2203('0x38')](function(_0x47c93a){if(!_0x616ed8||!_[_0x2203('0x4b')](_0x616ed8['apiKeyNonce'],_0x347d3e[_0x2203('0x4c')])){return _0x5a95c1['status'](0x191)[_0x2203('0x43')]({'message':_0x2203('0x4d')});}if(_0x616ed8[_0x2203('0x4e')]){return _0x5a95c1[_0x2203('0x39')](0x191)[_0x2203('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x616ed8['blocked']){if(_0x47c93a['blockDuration']>0x0){if(moment(_0x616ed8[_0x2203('0x4f')])[_0x2203('0x50')](_0x47c93a[_0x2203('0x51')],_0x2203('0x52'))>moment()){return _0x5a95c1[_0x2203('0x39')](0x191)[_0x2203('0x43')]({'message':_0x2203('0x53')});}}else{return _0x5a95c1['status'](0x191)[_0x2203('0x43')]({'message':_0x2203('0x53')});}}_0x9c53f[_0x2203('0x32')]={'id':_0x616ed8['id']};_0x34b8ba();});})[_0x2203('0x3c')](function(){return _0x5a95c1['status'](0x191)['json']({'message':_0x2203('0x53')});});}catch(_0x5494a1){_0x34b8ba(_0x5494a1);}}else if(_0x28ae02){_0x34b8ba();}else{return _0x5a95c1[_0x2203('0x39')](0x193)[_0x2203('0x43')]({'message':_0x2203('0x45')});}})['use'](function(_0x5bba52,_0x1e7ebc,_0x3739f6){if(_0x5bba52[_0x2203('0x32')]){db[_0x2203('0x54')][_0x2203('0x41')]({'where':{'id':_0x5bba52[_0x2203('0x32')]['id']},'attributes':userAttributes})['then'](function(_0x15d3b6){if(!_0x15d3b6){return _0x1e7ebc[_0x2203('0x39')](0x194)[_0x2203('0x43')]({'message':_0x2203('0x55')});}_0x5bba52[_0x2203('0x32')]=_0x15d3b6;_0x3739f6();})[_0x2203('0x3c')](function(_0x5b4842){_0x3739f6(_0x5b4842);});}else if(_0x28ae02){_0x3739f6();}else{return _0x1e7ebc[_0x2203('0x39')](0x194)[_0x2203('0x43')]({'message':_0x2203('0x56')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x2203('0x3d')](function(_0x24e773,_0x4aab80,_0x3b9981){return licenseUtil['getLicense']()['then'](function(_0x1c6661){if(_0x1c6661['update']){_0x3b9981();}else{return _0x4aab80[_0x2203('0x39')](0x193)[_0x2203('0x43')]({'message':_0x2203('0x57')});}})[_0x2203('0x3c')](function(_0x594148){_0x3b9981(_0x594148);});});};exports[_0x2203('0x58')]=function isWebrtcLicence(){return compose()[_0x2203('0x3d')](function(_0x5cd8c6,_0x29bd91,_0x381b3e){return licenseUtil[_0x2203('0x59')]()[_0x2203('0x38')](function(_0x5a71a5){if(_0x5a71a5['webrtc']){_0x381b3e();}else{return _0x29bd91[_0x2203('0x39')](0x193)['json']({'message':'Forbidden'});}})[_0x2203('0x3c')](function(_0x33b7b5){_0x381b3e(_0x33b7b5);});});};exports[_0x2203('0x5a')]=function(_0x49823a,_0x4c1496,_0x131aec){_0x49823a[_0x2203('0x5a')]=!![];return _0x131aec();};exports[_0x2203('0x5b')]=function signToken(_0x21d2d7){return signJwt(_0x21d2d7);};exports[_0x2203('0x5c')]=function(_0x21fd78,_0x4a7f4e){if(!_0x21fd78[_0x2203('0x32')]){return _0x4a7f4e['status'](0x194)[_0x2203('0x43')]({'message':_0x2203('0x5d')});}var _0x246aff={'payload':{'id':_0x21fd78[_0x2203('0x32')]['id'],'role':_0x21fd78['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x246aff)[_0x2203('0x38')](function(_0x1f772d){_0x4a7f4e[_0x2203('0x5e')](_0x2203('0x5f'),_0x1f772d);_0x4a7f4e['redirect']('/dashboards/general');})['catch'](function(_0x4064d5){return _0x4a7f4e[_0x2203('0x39')](0x1f4)['send'](_0x4064d5);});};exports[_0x2203('0x60')]=function(_0x267627){if(_['isNil'](_0x267627[_0x2203('0x61')])||_[_0x2203('0x62')](_0x267627[_0x2203('0x63')])){return null;}else{return createJwt(_0x267627);}};exports[_0x2203('0x64')]=function(_0x4bb6f1){_0x4bb6f1[_0x2203('0x61')]=generateNonce();_0x4bb6f1['apiKeyIat']=generateIssuedAt();return createJwt(_0x4bb6f1);};exports[_0x2203('0x65')]=function(_0x1de713,_0x4ee8cf){var _0x428b18=_0x1de713[_0x2203('0x46')][_0x2203('0x47')];if(_0x428b18){var _0x378132={'nonce':_0x4ee8cf[_0x2203('0x61')],'iat':_0x4ee8cf[_0x2203('0x63')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x428b18,_0x378132)[_0x2203('0x38')](function(){return generateApiKey(_0x4ee8cf);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0xfddc3b){var _0x33e5eb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x33e5eb[_0x2203('0x66')](_0xfddc3b))throw new db['Sequelize'][(_0x2203('0x67'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0xeb6b44,_0x5be4b6,_0x54ec71){var _0x5efc59=encryptor[_0x2203('0x68')](_0x5be4b6)[_0x2203('0x69')](',');for(var _0x367122=0x0;_0x367122<_0x54ec71;_0x367122++){if(!_0x5efc59[_0x367122])break;if(_0xeb6b44[_0x2203('0x6a')]()===_0x5efc59[_0x367122][_0x2203('0x6a')]()){var _0x32f593=util[_0x2203('0x6b')](_0x2203('0x6c'),_0x54ec71);if(_0x54ec71===0x1){_0x32f593=_0x2203('0x6d');}throw new db[(_0x2203('0x6e'))][(_0x2203('0x67'))](_0x32f593);}}return;};exports[_0x2203('0x6f')]=function(_0x58ff57,_0x585bde){var _0x2cd752=_0x585bde?encryptor[_0x2203('0x68')](_0x585bde)[_0x2203('0x69')](','):[];if(_0x2cd752[_0x2203('0x70')]===0x5){_0x2cd752[_0x2203('0x71')](-0x1,0x1);}_0x2cd752[_0x2203('0x72')](_0x58ff57);return encryptor['encryptString'](_0x2cd752['join'](','));};function signJwt(_0xb49120){var _0x34358e=BPromise[_0x2203('0x73')](jwt[_0x2203('0x74')],{'context':jwt});var _0xcab922=_0xb49120[_0x2203('0x75')]||config[_0x2203('0xb')][_0x2203('0xc')];return new BPromise(function(_0x2c6bcc,_0x135272){_0x34358e(_0xb49120[_0x2203('0x76')],_0xcab922,_0xb49120['options'])[_0x2203('0x38')](function(_0x3ae12e){_0x2c6bcc(_0x3ae12e);})[_0x2203('0x3c')](function(_0x407fc2){_0x135272(_0x407fc2);});});}function verifyJwt(_0x41a938,_0x44e7ab,_0x52c159){var _0x544756=BPromise[_0x2203('0x73')](jwt[_0x2203('0x77')],{'context':jwt});var _0x49e795=_0x52c159||config[_0x2203('0xb')][_0x2203('0xc')];return new BPromise(function(_0x24179a,_0xc193b7){_0x544756(_0x41a938,_0x49e795,_0x44e7ab)[_0x2203('0x38')](function(_0x1e44c){_0x24179a(_0x1e44c);})[_0x2203('0x3c')](function(_0x8a9282){_0xc193b7(_0x8a9282);});});}function generateNonce(){return crypto[_0x2203('0x78')](0x10)['toString'](_0x2203('0x79'));}function generateIssuedAt(){return Math[_0x2203('0x7a')](Date[_0x2203('0x7b')]()/0x3e8)['toString']();}function createJwt(_0x68855d){var _0x3f73e1={'payload':{'iat':_0x68855d[_0x2203('0x63')],'nonce':_0x68855d[_0x2203('0x61')]},'options':{'algorithm':_0x2203('0x7c'),'subject':_0x68855d['id']['toString'](),'issuer':hardwareConf[_0x2203('0x48')](),'audience':hardwareConf[_0x2203('0x48')]()}};return signJwt(_0x3f73e1)[_0x2203('0x38')](function(_0x4dde80){return{'iat':_0x68855d['apiKeyIat'],'nonce':_0x68855d['apiKeyNonce'],'token':_0x4dde80};});} \ No newline at end of file +var _0x14a0=['now','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','crypto','bluebird','util','session','role','fullname','email','chatPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','unmanaged','Unmanaged.','Forbidden.','isAuthenticated','headers','authorization','startsWith','Basic','User','find','name','authenticate','pass','status','Wrong\x20credentials.','catch','json','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','Unknown\x20authorization\x20format','canUpdate','getLicense','update','webrtc','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','splice','encryptString','join','promisify','sign','secret','secrets','options','verify','randomBytes','toString','hex','floor'];(function(_0x28d297,_0x40d76f){var _0x172427=function(_0x585dfb){while(--_0x585dfb){_0x28d297['push'](_0x28d297['shift']());}};_0x172427(++_0x40d76f);}(_0x14a0,0x8e));var _0x014a=function(_0x2f1e7e,_0x45b3cc){_0x2f1e7e=_0x2f1e7e-0x0;var _0x41acf8=_0x14a0[_0x2f1e7e];return _0x41acf8;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x014a('0x0'));var hardwareConf=require(_0x014a('0x1'));var licenseUtil=require(_0x014a('0x2'));var encryptor=require(_0x014a('0x3'));var _=require(_0x014a('0x4'));var jwt=require(_0x014a('0x5'));var expressJwt=require(_0x014a('0x6'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0x014a('0x7'));var BPromise=require(_0x014a('0x8'));var util=require(_0x014a('0x9'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets'][_0x014a('0xa')]});var userAttributes=['id',_0x014a('0xb'),_0x014a('0xc'),'name','internal',_0x014a('0xd'),'userpic','permissions','md5secret','voicePause',_0x014a('0xe'),'mailPause',_0x014a('0xf'),_0x014a('0x10'),'openchannelPause',_0x014a('0x11'),_0x014a('0x12'),_0x014a('0x13'),_0x014a('0x14'),_0x014a('0x15'),_0x014a('0x16'),_0x014a('0x17'),_0x014a('0x18'),_0x014a('0x19'),_0x014a('0x1a'),_0x014a('0x1b'),_0x014a('0x1c'),'phoneBarEnableDtmfTone',_0x014a('0x1d'),_0x014a('0x1e'),'phoneBarPrefixRequired',_0x014a('0x1f'),_0x014a('0x20'),'hotdesk',_0x014a('0x21'),_0x014a('0x22'),_0x014a('0x23'),_0x014a('0x24'),_0x014a('0x25'),_0x014a('0x26'),_0x014a('0x27'),_0x014a('0x28'),_0x014a('0x29'),_0x014a('0x2a'),_0x014a('0x2b'),_0x014a('0x2c'),_0x014a('0x2d'),_0x014a('0x2e'),'smsAutoanswer',_0x014a('0x2f'),_0x014a('0x30'),_0x014a('0x31'),_0x014a('0x32'),_0x014a('0x33'),_0x014a('0x34'),_0x014a('0x35'),_0x014a('0x36')];exports[_0x014a('0x37')]=function(){return this['isAuthenticated'](!![])[_0x014a('0x38')](function(_0x5f556e,_0x1a1318,_0x26718b){if(_0x5f556e[_0x014a('0x39')]){_0x26718b();}else{return db[_0x014a('0x3a')][_0x014a('0x3b')]({'where':{'id':_0x5f556e[_0x014a('0x3c')]['id']},'attributes':['id',_0x014a('0x3d'),_0x014a('0x3e')],'raw':!![]})[_0x014a('0x3f')](function(_0x4c2627){if(_0x4c2627&&_0x4c2627[_0x014a('0x3d')]){return _0x1a1318['status'](_0x4c2627[_0x014a('0x3e')]===_0x014a('0x40')?0x195:0x193)['json']({'message':_0x4c2627['disposition']===_0x014a('0x40')?_0x014a('0x41'):_0x014a('0x42')});}else{_0x26718b();}})['catch'](function(_0x183f19){_0x26718b(_0x183f19);});}});};exports[_0x014a('0x43')]=function isAuthenticated(_0x598179){return compose()[_0x014a('0x38')](function(_0x2560a6,_0x496040,_0x4f9c1c){var _0x397850;if(_0x2560a6[_0x014a('0x44')][_0x014a('0x45')]){if(_[_0x014a('0x46')](_0x2560a6['headers'][_0x014a('0x45')],_0x014a('0x47'))){var _0x15af07=basicAuth(_0x2560a6);db[_0x014a('0x48')][_0x014a('0x49')]({'where':{'name':_0x15af07[_0x014a('0x4a')]}})[_0x014a('0x3f')](function(_0x1dae8e){if(!_0x1dae8e||!_0x1dae8e[_0x014a('0x4b')](_0x15af07[_0x014a('0x4c')])){return _0x496040[_0x014a('0x4d')](0x191)['json']({'message':_0x014a('0x4e')});}_0x2560a6[_0x014a('0x39')]={'id':_0x1dae8e['id']};_0x4f9c1c();})[_0x014a('0x4f')](function(_0x457883){_0x4f9c1c(_0x457883);});}else if(_[_0x014a('0x46')](_0x2560a6[_0x014a('0x44')][_0x014a('0x45')],'Bearer')){validateJwt(_0x2560a6,_0x496040,_0x4f9c1c);}else{if(_0x598179){_0x4f9c1c();}else{return _0x496040[_0x014a('0x4d')](0x193)[_0x014a('0x50')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x2560a6[_0x014a('0x51')][_0x014a('0x52')]){try{var _0x40738f={'audience':hardwareConf[_0x014a('0x53')](),'issuer':hardwareConf[_0x014a('0x53')]()};verifyJwt(_0x2560a6[_0x014a('0x51')][_0x014a('0x52')],_0x40738f)[_0x014a('0x3f')](function(_0x5e37e4){return db[_0x014a('0x48')][_0x014a('0x49')]({'where':{'id':_0x5e37e4[_0x014a('0x54')]}})[_0x014a('0x3f')](function(_0x5127f3){_0x397850=_0x5127f3;return db[_0x014a('0x55')][_0x014a('0x3b')]({'where':{'id':0x1},'attributes':[_0x014a('0x56'),_0x014a('0x57')],'raw':!![]});})[_0x014a('0x3f')](function(_0x309925){if(!_0x397850||!_[_0x014a('0x58')](_0x397850[_0x014a('0x59')],_0x5e37e4[_0x014a('0x5a')])){return _0x496040['status'](0x191)[_0x014a('0x50')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x397850[_0x014a('0x5b')]){return _0x496040[_0x014a('0x4d')](0x191)[_0x014a('0x50')]({'message':_0x014a('0x5c')});}if(_0x397850[_0x014a('0x5d')]){if(_0x309925['blockDuration']>0x0){if(moment(_0x397850[_0x014a('0x5e')])[_0x014a('0x5f')](_0x309925['blockDuration'],_0x014a('0x60'))>moment()){return _0x496040[_0x014a('0x4d')](0x191)[_0x014a('0x50')]({'message':_0x014a('0x5c')});}}else{return _0x496040[_0x014a('0x4d')](0x191)[_0x014a('0x50')]({'message':_0x014a('0x5c')});}}_0x2560a6[_0x014a('0x39')]={'id':_0x397850['id']};_0x4f9c1c();});})[_0x014a('0x4f')](function(){return _0x496040['status'](0x191)[_0x014a('0x50')]({'message':_0x014a('0x5c')});});}catch(_0x440d82){_0x4f9c1c(_0x440d82);}}else if(_0x598179){_0x4f9c1c();}else{return _0x496040[_0x014a('0x4d')](0x193)['json']({'message':_0x014a('0x61')});}})[_0x014a('0x38')](function(_0x4cd132,_0x1355dd,_0x1dc647){if(_0x4cd132[_0x014a('0x39')]){db['User'][_0x014a('0x49')]({'where':{'id':_0x4cd132[_0x014a('0x39')]['id']},'attributes':userAttributes})['then'](function(_0xc086b3){if(!_0xc086b3){return _0x1355dd[_0x014a('0x4d')](0x194)[_0x014a('0x50')]({'message':'User\x20not\x20found.'});}_0x4cd132[_0x014a('0x39')]=_0xc086b3;_0x1dc647();})['catch'](function(_0x5ab5e8){_0x1dc647(_0x5ab5e8);});}else if(_0x598179){_0x1dc647();}else{return _0x1355dd[_0x014a('0x4d')](0x194)[_0x014a('0x50')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x014a('0x62')]=function canUpdate(){return compose()[_0x014a('0x38')](function(_0xa4b68e,_0x15c5dc,_0x382a5f){return licenseUtil[_0x014a('0x63')]()['then'](function(_0x3a6b4f){if(_0x3a6b4f[_0x014a('0x64')]){_0x382a5f();}else{return _0x15c5dc[_0x014a('0x4d')](0x193)['json']({'message':'Forbidden'});}})[_0x014a('0x4f')](function(_0x57f5f4){_0x382a5f(_0x57f5f4);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x014a('0x38')](function(_0x47aaac,_0x2a4679,_0x45caee){return licenseUtil[_0x014a('0x63')]()['then'](function(_0x395e5e){if(_0x395e5e[_0x014a('0x65')]){_0x45caee();}else{return _0x2a4679[_0x014a('0x4d')](0x193)[_0x014a('0x50')]({'message':_0x014a('0x66')});}})[_0x014a('0x4f')](function(_0x559954){_0x45caee(_0x559954);});});};exports[_0x014a('0x67')]=function(_0x1f7f40,_0x5a861c,_0x1a4df9){_0x1f7f40[_0x014a('0x67')]=!![];return _0x1a4df9();};exports[_0x014a('0x68')]=function signToken(_0x324df7){return signJwt(_0x324df7);};exports[_0x014a('0x69')]=function(_0x357ca1,_0x437f23){if(!_0x357ca1[_0x014a('0x39')]){return _0x437f23['status'](0x194)[_0x014a('0x50')]({'message':_0x014a('0x6a')});}var _0x3f286d={'payload':{'id':_0x357ca1[_0x014a('0x39')]['id'],'role':_0x357ca1[_0x014a('0x39')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3f286d)[_0x014a('0x3f')](function(_0x5bee56){_0x437f23[_0x014a('0x6b')](_0x014a('0x6c'),_0x5bee56);_0x437f23[_0x014a('0x6d')](_0x014a('0x6e'));})[_0x014a('0x4f')](function(_0x4f8547){return _0x437f23['status'](0x1f4)['send'](_0x4f8547);});};exports['retrieveApiKey']=function(_0x1c11d0){if(_['isNil'](_0x1c11d0[_0x014a('0x59')])||_['isNil'](_0x1c11d0['apiKeyIat'])){return null;}else{return createJwt(_0x1c11d0);}};exports[_0x014a('0x6f')]=function(_0x55ca2f){_0x55ca2f[_0x014a('0x59')]=generateNonce();_0x55ca2f[_0x014a('0x70')]=generateIssuedAt();return createJwt(_0x55ca2f);};exports[_0x014a('0x71')]=function(_0x3c7e06,_0x21b16c){var _0x46dde4=_0x3c7e06[_0x014a('0x51')][_0x014a('0x52')];if(_0x46dde4){var _0x133fcd={'nonce':_0x21b16c[_0x014a('0x59')],'iat':_0x21b16c['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x014a('0x53')]()};return verifyJwt(_0x46dde4,_0x133fcd)[_0x014a('0x3f')](function(){return generateApiKey(_0x21b16c);});}else{throw{'message':_0x014a('0x72')};}};exports['validatePasswordPattern']=function(_0x58aa79){var _0x4591ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4591ad['test'](_0x58aa79))throw new db[(_0x014a('0x73'))][(_0x014a('0x74'))](_0x014a('0x75'));return;};exports[_0x014a('0x76')]=function(_0x53e631,_0x861fb5,_0x2ccc2f){var _0x3d1c9d=encryptor['decryptString'](_0x861fb5)[_0x014a('0x77')](',');for(var _0x57e179=0x0;_0x57e179<_0x2ccc2f;_0x57e179++){if(!_0x3d1c9d[_0x57e179])break;if(_0x53e631[_0x014a('0x78')]()===_0x3d1c9d[_0x57e179][_0x014a('0x78')]()){var _0x34736b=util[_0x014a('0x79')](_0x014a('0x7a'),_0x2ccc2f);if(_0x2ccc2f===0x1){_0x34736b=_0x014a('0x7b');}throw new db['Sequelize'][(_0x014a('0x74'))](_0x34736b);}}return;};exports[_0x014a('0x7c')]=function(_0x29da9b,_0x52b123){var _0x1761c9=_0x52b123?encryptor[_0x014a('0x7d')](_0x52b123)[_0x014a('0x77')](','):[];if(_0x1761c9[_0x014a('0x7e')]===0x5){_0x1761c9[_0x014a('0x7f')](-0x1,0x1);}_0x1761c9['unshift'](_0x29da9b);return encryptor[_0x014a('0x80')](_0x1761c9[_0x014a('0x81')](','));};function signJwt(_0x63c341){var _0x37a7b8=BPromise[_0x014a('0x82')](jwt[_0x014a('0x83')],{'context':jwt});var _0x477946=_0x63c341[_0x014a('0x84')]||config[_0x014a('0x85')][_0x014a('0xa')];return new BPromise(function(_0x3aa8c4,_0x2d3efb){_0x37a7b8(_0x63c341['payload'],_0x477946,_0x63c341[_0x014a('0x86')])['then'](function(_0x4f6cd9){_0x3aa8c4(_0x4f6cd9);})['catch'](function(_0x4a38e0){_0x2d3efb(_0x4a38e0);});});}function verifyJwt(_0x5a38b4,_0x1716d3,_0x19be40){var _0x2613ff=BPromise['promisify'](jwt[_0x014a('0x87')],{'context':jwt});var _0x2a5007=_0x19be40||config[_0x014a('0x85')][_0x014a('0xa')];return new BPromise(function(_0x4dd210,_0x5edf80){_0x2613ff(_0x5a38b4,_0x2a5007,_0x1716d3)[_0x014a('0x3f')](function(_0x39154c){_0x4dd210(_0x39154c);})[_0x014a('0x4f')](function(_0x36807a){_0x5edf80(_0x36807a);});});}function generateNonce(){return crypto[_0x014a('0x88')](0x10)[_0x014a('0x89')](_0x014a('0x8a'));}function generateIssuedAt(){return Math[_0x014a('0x8b')](Date[_0x014a('0x8c')]()/0x3e8)[_0x014a('0x89')]();}function createJwt(_0x3126f){var _0x4b1fbf={'payload':{'iat':_0x3126f[_0x014a('0x70')],'nonce':_0x3126f[_0x014a('0x59')]},'options':{'algorithm':'HS512','subject':_0x3126f['id'][_0x014a('0x89')](),'issuer':hardwareConf[_0x014a('0x53')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x4b1fbf)[_0x014a('0x3f')](function(_0x51ddea){return{'iat':_0x3126f[_0x014a('0x70')],'nonce':_0x3126f[_0x014a('0x59')],'token':_0x51ddea};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index e0fded6..bbf0bdb 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0620=['CmContact','keys','startsWith','cf_','CmCustomField','findOne','length','type','map','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseQueryParameters','where','default','fields','filter','user','clause','tags','skip','checkListsRestrictions','ids','countFilteredContacts','count','User','buildContactsQuery','rows','describe'];(function(_0x5875a5,_0x274b05){var _0x704a70=function(_0x5bba29){while(--_0x5bba29){_0x5875a5['push'](_0x5875a5['shift']());}};_0x704a70(++_0x274b05);}(_0x0620,0x167));var _0x0062=function(_0x41fbdd,_0x271cf3){_0x41fbdd=_0x41fbdd-0x0;var _0x521d84=_0x0620[_0x41fbdd];return _0x521d84;};'use strict';var _=require(_0x0062('0x0'));var sqlUtils=require(_0x0062('0x1'));var db=require(_0x0062('0x2'))['db'];exports[_0x0062('0x3')]=function(_0x584260,_0xad98ff,_0x233ac2,_0x252686){var _0x20e856={'count':0x0,'rows':[]};var _0x2c9eed=sqlUtils[_0x0062('0x4')](_0xad98ff,_0x584260);if(_0x2c9eed){return Promise[_0x0062('0x5')](_0x20e856);}var _0x11fea7=sqlUtils[_0x0062('0x6')]();var _0x282b47={};var _0x3bceda=![];var _0x3854cf=![];return Promise[_0x0062('0x5')]()[_0x0062('0x7')](function(){if(_0x584260[_0x0062('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x584260[_0x0062('0x8')],_0x252686);}else{return sqlUtils[_0x0062('0x9')](_0x584260,_0x252686);}})['then'](function(_0x4b96ee){_0x11fea7[_0x0062('0xa')](_0x4b96ee[_0x0062('0xb')]);_0x11fea7[_0x0062('0xa')](_0x4b96ee[_0x0062('0xc')]);_0x11fea7[_0x0062('0xa')](_0x4b96ee[_0x0062('0xd')]);_0x11fea7[_0x0062('0xa')](_0x4b96ee[_0x0062('0xe')][_0x0062('0xf')]);_0x282b47=_0x4b96ee[_0x0062('0x10')];_0x3854cf=_0x4b96ee[_0x0062('0xe')][_0x0062('0x11')];return sqlUtils[_0x0062('0x12')](_0xad98ff,_0x584260,_0x3854cf);})[_0x0062('0x7')](function(_0x12cb71){_0x11fea7['where'](_0x12cb71);var _0x2c2ec2=_0x584260[_0x0062('0x8')]?_0x282b47[_0x0062('0x13')]:_0x584260['tag'];_0x3bceda=_0x2c2ec2?!![]:![];return sqlUtils[_0x0062('0x14')](_0x11fea7,_0x2c2ec2);})['then'](function(_0x1aa86c){_0x20e856['count']=_0x1aa86c;if(_0x20e856[_0x0062('0x15')]===0x0){return;}if(_0x584260[_0x0062('0x16')]){_0x3854cf=!![];}return sqlUtils[_0x0062('0x17')](_0x11fea7,_0x584260['fields'],_0x233ac2,_0x3bceda,_0x282b47[_0x0062('0xf')],_0x3854cf);})[_0x0062('0x7')](function(_0x38945c){if(!_0x38945c){return[];}return sqlUtils['getFilteredContacts'](_0x38945c,_0x584260,_0x233ac2);})[_0x0062('0x7')](function(_0x3408df){_0x20e856[_0x0062('0x18')]=_0x3408df;return _0x20e856;})['catch'](function(_0x388dfe){throw _0x388dfe;});};exports[_0x0062('0x19')]=function(){var _0x448b05={};var _0x1c40e5=[];return db[_0x0062('0x1a')][_0x0062('0x19')]()[_0x0062('0x7')](function(_0xbbfe0b){_0x448b05=_0xbbfe0b;var _0x35b9a7=Object[_0x0062('0x1b')](_0x448b05)[_0x0062('0xd')](function(_0x37aa8e){return _[_0x0062('0x1c')](_0x37aa8e,_0x0062('0x1d'))?_0x37aa8e:undefined;});var _0x71adb1=_0x35b9a7['map'](function(_0x13adde){return db[_0x0062('0x1e')][_0x0062('0x1f')]({'where':{'id':_0x13adde['slice'](0x3)},'raw':!![]});});return Promise['all'](_0x71adb1);})[_0x0062('0x7')](function(_0x40a611){for(var _0x2a3156=0x0;_0x2a3156<_0x40a611[_0x0062('0x20')];_0x2a3156++){if(_0x40a611[_0x2a3156]){var _0x447540=_0x0062('0x1d')+_0x40a611[_0x2a3156]['id'];_0x448b05[_0x447540]['fieldType']=_0x40a611[_0x2a3156][_0x0062('0x21')];}}_0x1c40e5=_[_0x0062('0x22')](Object['keys'](_0x448b05),function(_0x350ca1){return{'name':_0x350ca1,'type':_0x448b05[_0x350ca1][_0x0062('0x21')]};});return _0x1c40e5;})['catch'](function(_0x3178a1){throw _0x3178a1;});}; \ No newline at end of file +var _0x14e4=['checkListsRestrictions','tag','countFilteredContacts','count','User','getFilteredContacts','catch','CmContact','describe','keys','startsWith','cf_','map','CmCustomField','findOne','all','length','fieldType','type','lodash','./sql-utils','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseQueryParameters','where','fields','filter','user','clause','tags','skip'];(function(_0x2fb207,_0x4d0d92){var _0x3dd6be=function(_0x1b4846){while(--_0x1b4846){_0x2fb207['push'](_0x2fb207['shift']());}};_0x3dd6be(++_0x4d0d92);}(_0x14e4,0x9f));var _0x414e=function(_0x5ce1d4,_0x38c804){_0x5ce1d4=_0x5ce1d4-0x0;var _0x4a8791=_0x14e4[_0x5ce1d4];return _0x4a8791;};'use strict';var _=require(_0x414e('0x0'));var sqlUtils=require(_0x414e('0x1'));var db=require('../../mysqldb')['db'];exports[_0x414e('0x2')]=function(_0x2f39a6,_0x1534c0,_0x1d51df,_0x5c8ac1){var _0x52f041={'count':0x0,'rows':[]};var _0x21be9f=sqlUtils[_0x414e('0x3')](_0x1534c0,_0x2f39a6);if(_0x21be9f){return Promise[_0x414e('0x4')](_0x52f041);}var _0x314073=sqlUtils[_0x414e('0x5')]();var _0x241843={};var _0x1aba11=![];var _0x4effa6=![];return Promise['resolve']()[_0x414e('0x6')](function(){if(_0x2f39a6[_0x414e('0x7')]){return sqlUtils['parseAdvancedSearchFilter'](_0x2f39a6[_0x414e('0x7')],_0x5c8ac1);}else{return sqlUtils[_0x414e('0x8')](_0x2f39a6,_0x5c8ac1);}})['then'](function(_0x5b20d0){_0x314073[_0x414e('0x9')](_0x5b20d0['default']);_0x314073[_0x414e('0x9')](_0x5b20d0[_0x414e('0xa')]);_0x314073['where'](_0x5b20d0[_0x414e('0xb')]);_0x314073[_0x414e('0x9')](_0x5b20d0[_0x414e('0xc')][_0x414e('0xd')]);_0x241843=_0x5b20d0[_0x414e('0xe')];_0x4effa6=_0x5b20d0['user'][_0x414e('0xf')];return sqlUtils[_0x414e('0x10')](_0x1534c0,_0x2f39a6,_0x4effa6);})['then'](function(_0x5877c0){_0x314073['where'](_0x5877c0);var _0x4a6385=_0x2f39a6[_0x414e('0x7')]?_0x241843['ids']:_0x2f39a6[_0x414e('0x11')];_0x1aba11=_0x4a6385?!![]:![];return sqlUtils[_0x414e('0x12')](_0x314073,_0x4a6385);})['then'](function(_0x3ed431){_0x52f041[_0x414e('0x13')]=_0x3ed431;if(_0x52f041[_0x414e('0x13')]===0x0){return;}if(_0x2f39a6[_0x414e('0x14')]){_0x4effa6=!![];}return sqlUtils['buildContactsQuery'](_0x314073,_0x2f39a6['fields'],_0x1d51df,_0x1aba11,_0x241843[_0x414e('0xd')],_0x4effa6);})[_0x414e('0x6')](function(_0xa737a0){if(!_0xa737a0){return[];}return sqlUtils[_0x414e('0x15')](_0xa737a0,_0x2f39a6,_0x1d51df);})[_0x414e('0x6')](function(_0x5c8014){_0x52f041['rows']=_0x5c8014;return _0x52f041;})[_0x414e('0x16')](function(_0x265593){throw _0x265593;});};exports['describe']=function(){var _0x4261fa={};var _0x13dbf6=[];return db[_0x414e('0x17')][_0x414e('0x18')]()[_0x414e('0x6')](function(_0x4e54c0){_0x4261fa=_0x4e54c0;var _0xf2565d=Object[_0x414e('0x19')](_0x4261fa)['filter'](function(_0x3497d0){return _[_0x414e('0x1a')](_0x3497d0,_0x414e('0x1b'))?_0x3497d0:undefined;});var _0x512875=_0xf2565d[_0x414e('0x1c')](function(_0x273b1b){return db[_0x414e('0x1d')][_0x414e('0x1e')]({'where':{'id':_0x273b1b['slice'](0x3)},'raw':!![]});});return Promise[_0x414e('0x1f')](_0x512875);})['then'](function(_0x7bffb7){for(var _0x2d21c3=0x0;_0x2d21c3<_0x7bffb7[_0x414e('0x20')];_0x2d21c3++){if(_0x7bffb7[_0x2d21c3]){var _0x10dcca='cf_'+_0x7bffb7[_0x2d21c3]['id'];_0x4261fa[_0x10dcca][_0x414e('0x21')]=_0x7bffb7[_0x2d21c3][_0x414e('0x22')];}}_0x13dbf6=_[_0x414e('0x1c')](Object[_0x414e('0x19')](_0x4261fa),function(_0x524735){return{'name':_0x524735,'type':_0x4261fa[_0x524735][_0x414e('0x22')]};});return _0x13dbf6;})[_0x414e('0x16')](function(_0x3bf363){throw _0x3bf363;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index ed15db6..9e94955 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1503=['c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','find','name','fieldType','datetime','castTo','type','text','value','start','end','Tag','tags','and','User','user','clause','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','tag','filter','role','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','SELECT','CmContact','sequelize','query','toString','Tags','split','clone','group','t.id\x20IN\x20?','QueryTypes','COUNT(*)','exports','lodash','squel','../parsers/qs','../interaction/utils','../../mysqldb','agent','search','ListId','autocomplete','select','from','cm_contacts','where','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20','.id','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x1503,0xab));var _0x3150=function(_0x300159,_0x4edf8d){_0x300159=_0x300159-0x0;var _0x4af516=_0x1503[_0x300159];return _0x4af516;};'use strict';var _=require(_0x3150('0x0'));var squel=require(_0x3150('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x3150('0x2'));var utils=require(_0x3150('0x3'));var db=require(_0x3150('0x4'))['db'];function skipContactsQuery(_0x435e7e,_0x50a719){var _0x159f73=![];if(_0x435e7e['role']===_0x3150('0x5')&&!_0x50a719[_0x3150('0x6')]&&!_0x50a719[_0x3150('0x7')]&&_0x50a719[_0x3150('0x8')]!=='true'){_0x159f73=!![];}return _0x159f73;}function getContactsSubquery(){return squel[_0x3150('0x9')]()[_0x3150('0xa')](_0x3150('0xb'),'c')[_0x3150('0xc')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x2b79bf,_0x3418e1){var _0x125d88=_0x3418e1?'c':'subqry';_0x2b79bf[_0x3150('0xd')](_0x3150('0xe'),'uc','uc.CmContactId\x20=\x20'+_0x125d88+'.id')['left_join'](_0x3150('0xf'),'ct',_0x3150('0x10')+_0x125d88+_0x3150('0x11'))[_0x3150('0xd')]('tools_tags','t',_0x3150('0x12'));return _0x2b79bf;}function addFieldsToQuery(_0x1dfd2a,_0x4c7594,_0x460aa4,_0x35549b,_0x86ddce){var _0x31dca3=_0x86ddce?'c':_0x3150('0x13');if(!_0x4c7594){_0x4c7594=['id',_0x3150('0x14'),_0x3150('0x15'),'phone',_0x3150('0x16'),_0x3150('0x17'),_0x3150('0x18'),_0x3150('0x7'),_0x3150('0x19'),_0x3150('0x1a'),_0x3150('0x1b'),_0x3150('0x1c'),_0x3150('0x1d')];}else if(!_0x4c7594[_0x3150('0x1e')]('id')){_0x4c7594[_0x3150('0x1f')]('id');}var _0x5b03af=_0x460aa4&&_0x86ddce||!_0x460aa4&&!_0x86ddce;if(_0x35549b){_0x5b03af=_0x35549b&&_0x86ddce||!_0x35549b&&!_0x86ddce;}_0x4c7594[_0x3150('0x20')](function(_0x4292c5){if(_0x4292c5===_0x3150('0x1d')){if(_0x5b03af){_0x1dfd2a[_0x3150('0x21')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4292c5);}else if(_0x460aa4||_0x35549b){_0x1dfd2a[_0x3150('0x21')](_0x31dca3+'.'+_0x4292c5);}}else{_0x1dfd2a[_0x3150('0x21')](_0x31dca3+'.'+_0x4292c5);}});return _0x1dfd2a;}function getSqlClauses(){var _0x121986={'default':squel[_0x3150('0x22')](),'fields':squel[_0x3150('0x22')](),'filter':squel[_0x3150('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x3150('0x22')](),'skip':![]}};return _0x121986;}function parseTagParameter(_0x3e7795){var _0x5f1299=squel[_0x3150('0x22')]();if(_0x3e7795){var _0x3d2338=utils[_0x3150('0x23')](_0x3e7795);_0x3d2338[_0x3150('0x20')](function(_0x567650){_0x5f1299['or'](_0x3150('0x24'),'%,'+_0x567650+',%');});}return _0x5f1299;}function parseSearchFilter(_0x397620){var _0x5b9971=squel[_0x3150('0x22')]();if(_0x397620){var _0x141924=_0x397620[_0x3150('0x25')]('\x5c','\x5c\x5c')[_0x3150('0x25')](/'/g,'\x27\x27');if(_0x141924['split']('\x20')[_0x3150('0x26')]>0x1){_0x5b9971['or'](_0x3150('0x27'),qs['getFullTextValue'](_0x141924,!![]),null);}else{if(qs[_0x3150('0x28')](_0x141924)){_0x5b9971['or'](_0x3150('0x29'),_0x141924+'%');_0x5b9971['or'](_0x3150('0x2a'),_0x141924+'%');_0x5b9971['or'](_0x3150('0x2b'),_0x141924+'%');_0x5b9971['or'](_0x3150('0x2c'),_0x141924+'%');}else if(qs[_0x3150('0x2d')](_0x141924)){_0x5b9971['or'](_0x3150('0x2e'),_0x141924+'%');}else{_0x5b9971['or']('c.firstName\x20LIKE\x20?','%'+_0x141924+'%');_0x5b9971['or'](_0x3150('0x2f'),'%'+_0x141924+'%');_0x5b9971['or'](_0x3150('0x2e'),'%'+_0x141924+'%');}}}return _0x5b9971;}function parseAdvancedSearchFilter(_0x3d1ff7,_0xbc8bf5){var _0x811d47=getSqlClauses();var _0x57117e=as[_0x3150('0x30')](_0x3d1ff7);var _0x1e0158=_0x57117e['sqlOperator'];for(var _0x4338c1=0x0;_0x4338c1<_0x57117e[_0x3150('0x31')]['length'];_0x4338c1++){var _0x58a006=_0x57117e[_0x3150('0x31')][_0x4338c1];var _0x1f4815='c';var _0x3df9c5=_[_0x3150('0x32')](_0xbc8bf5,[_0x3150('0x33'),_0x58a006[_0x3150('0x21')]]);if(_0x3df9c5){if(_0x58a006[_0x3150('0x21')]==='dateOfBirth'||_0x3df9c5[_0x3150('0x34')]===_0x3150('0x35')){_0x58a006[_0x3150('0x36')]='DATE';}var _0x1481d8=as['buildExpression'](_0x1f4815,_0x3df9c5[_0x3150('0x37')],_0x58a006);_0x811d47['default'][_0x1e0158](_0x1481d8[_0x3150('0x38')],_0x1481d8[_0x3150('0x39')][_0x3150('0x3a')],_0x1481d8['value'][_0x3150('0x3b')]);}else{if(_0x58a006['field']===_0x3150('0x3c')){var _0x489530=_0x58a006[_0x3150('0x39')]['split'](',')['map'](function(_0x5993ea){return Number(_0x5993ea);});var _0x35d3d=parseTagParameter(_0x489530);_0x811d47[_0x3150('0x3d')]['clause'][_0x3150('0x3e')](_0x35d3d);_0x811d47[_0x3150('0x3d')]['ids']=_0x489530;}else if(_0x58a006[_0x3150('0x21')]===_0x3150('0x3f')){_0x811d47[_0x3150('0x40')][_0x3150('0x41')][_0x3150('0x3e')](_0x3150('0x42'),_0x58a006[_0x3150('0x39')]);_0x811d47[_0x3150('0x40')][_0x3150('0x43')]=!![];}}}return _0x811d47;}function parseModelFields(_0x2a35c3,_0x10f25b){var _0x2e8298=squel[_0x3150('0x22')]();var _0x41b370=_(_0x2a35c3)[_0x3150('0x44')]()['map'](function(_0x438c63){return _[_0x3150('0x45')](_0x10f25b,[_0x3150('0x33'),_0x438c63])?_0x438c63:undefined;})[_0x3150('0x46')]()[_0x3150('0x39')]();if(_0x2a35c3[_0x3150('0x47')]){_0x41b370[_0x3150('0x1f')]('Contact');}if(_0x2a35c3[_0x3150('0x3f')]){_0x41b370[_0x3150('0x1f')]('User');}if(_0x41b370[_0x3150('0x26')]>0x0){_0x41b370[_0x3150('0x20')](function(_0x540186){if(_0x540186==='ListId'){_0x2e8298['and']('c.ListId\x20IN\x20?',[]['concat'](_0x2a35c3[_0x540186]));}else if(_0x540186===_0x3150('0x47')){var _0x5b6e75='%'+_0x2a35c3[_0x540186]+'%';_0x2e8298[_0x3150('0x3e')](_0x3150('0x48'),_0x5b6e75);}else if(_0x540186==='User'){_0x2e8298[_0x3150('0x3e')](_0x3150('0x42'),_0x2a35c3[_0x540186]);}else{_0x2e8298[_0x3150('0x3e')]('c.'+_0x540186+_0x3150('0x49'),_0x2a35c3[_0x540186]);}});}return _0x2e8298;}function parseQueryParameters(_0x3e9c54,_0x153182){var _0x12f71a=getSqlClauses();return Promise[_0x3150('0x4a')]()[_0x3150('0x4b')](function(){return parseModelFields(_0x3e9c54,_0x153182);})['then'](function(_0x2c14ae){_0x12f71a['fields'][_0x3150('0x3e')](_0x2c14ae);return parseTagParameter(_0x3e9c54[_0x3150('0x4c')]);})['then'](function(_0x9e4836){_0x12f71a[_0x3150('0x3d')][_0x3150('0x41')][_0x3150('0x3e')](_0x9e4836);return parseSearchFilter(_0x3e9c54['filter']);})['then'](function(_0x4a734a){_0x12f71a[_0x3150('0x4d')]=_0x4a734a;return _0x12f71a;});}function checkListsRestrictions(_0x2e555c,_0x171d69,_0x358237){var _0x31ab83=squel[_0x3150('0x22')]();return Promise[_0x3150('0x4a')]()[_0x3150('0x4b')](function(){if(_0x171d69[_0x3150('0x6')]&&_0x2e555c[_0x3150('0x4e')]===_0x3150('0x5')&&!_0x358237){return _0x2e555c[_0x3150('0x4f')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x280b1b){if(_0x280b1b){if(_0x280b1b[_0x3150('0x26')]===0x0){_0x31ab83[_0x3150('0x3e')](_0x3150('0x50'));}else{_0x31ab83[_0x3150('0x3e')](_0x3150('0x51'),_['map'](_0x280b1b,'id'));}}})[_0x3150('0x4b')](function(){return _0x31ab83;});}function buildContactsQuery(_0x3d5324,_0x298587,_0xc43120,_0x376024,_0xe8d8d4,_0x2ff907){if(_0x298587){_0x298587=_0xc43120['attributes'];}_0x3d5324=addFieldsToQuery(_0x3d5324,_0x298587,_0x376024,_0x2ff907,!![]);var _0x12c5b8=squel[_0x3150('0x9')]();_0x12c5b8=addFieldsToQuery(_0x12c5b8,_0x298587,_0x376024,_0x2ff907,![]);if(_0x376024||_0x2ff907){_0x3d5324=applyJoinClauses(_0x3d5324,!![]);_0x3d5324['group'](_0x3150('0x52'));if(_0xc43120[_0x3150('0x53')]){_0x12c5b8[_0x3150('0x53')](_0xc43120[_0x3150('0x53')]);}if(_0xc43120[_0x3150('0x54')]){_0x12c5b8[_0x3150('0x54')](_0xc43120[_0x3150('0x54')]);}}else{_0x12c5b8=applyJoinClauses(_0x12c5b8,![]);_0x12c5b8['group'](_0x3150('0x55'));if(_0xc43120['limit']){_0x3d5324[_0x3150('0x53')](_0xc43120[_0x3150('0x53')]);}if(_0xc43120[_0x3150('0x54')]){_0x3d5324[_0x3150('0x54')](_0xc43120['offset']);}}_0x12c5b8[_0x3150('0x56')](_0xe8d8d4);if(_0xc43120[_0x3150('0x57')]){_0xc43120[_0x3150('0x57')]['forEach'](function(_0x3ed4ba){_0x3d5324[_0x3150('0x57')]('c.'+_0x3ed4ba[0x0],_0x3ed4ba[0x1]===_0x3150('0x58')?![]:!![]);_0x12c5b8[_0x3150('0x57')](_0x3150('0x59')+_0x3ed4ba[0x0],_0x3ed4ba[0x1]===_0x3150('0x58')?![]:!![]);});}_0x12c5b8['from'](_0x3d5324,_0x3150('0x13'));return _0x12c5b8;}function getFilteredContacts(_0x3669cd){var _0x4ed0c2=[];return db[_0x3150('0x3c')][_0x3150('0x5a')]({'attributes':['id','name',_0x3150('0x5b')],'raw':!![]})['then'](function(_0x57b4fc){_0x4ed0c2=_[_0x3150('0x5c')](_0x57b4fc,'id');var _0x3662dc={'type':db[_0x3150('0x5d')]['QueryTypes'][_0x3150('0x5e')],'model':db[_0x3150('0x5f')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x3150('0x60')][_0x3150('0x61')](_0x3669cd[_0x3150('0x62')](),_0x3662dc);})[_0x3150('0x4b')](function(_0x3a4828){_0x3a4828[_0x3150('0x20')](function(_0x5186d6){if(_0x5186d6[_0x3150('0x1d')]){_0x5186d6[_0x3150('0x63')]=[];_0x5186d6[_0x3150('0x1d')][_0x3150('0x64')](',')[_0x3150('0x20')](function(_0xadb513){_0x5186d6[_0x3150('0x63')][_0x3150('0x1f')](_0x4ed0c2[_0xadb513]);});}delete _0x5186d6['TagIds'];});return _0x3a4828;});}function countFilteredContacts(_0x55faed,_0x33b179){var _0x343248=_0x55faed[_0x3150('0x65')]();_0x343248[_0x3150('0x21')]('COUNT(*)');_0x343248=applyJoinClauses(_0x343248,!![]);_0x55faed[_0x3150('0x66')](_0x3150('0x52'));var _0x4c781a=utils[_0x3150('0x23')](_0x33b179);if(!_['isEmpty'](_0x4c781a)){_0x343248[_0x3150('0xc')](_0x3150('0x67'),_0x4c781a);}var _0xbff397={'type':db['Sequelize'][_0x3150('0x68')][_0x3150('0x5e')],'raw':!![]};return db['sequelize']['query'](_0x343248[_0x3150('0x62')](),_0xbff397)[_0x3150('0x4b')](function(_0xfc736e){return _0xfc736e[0x0][_0x3150('0x69')];});}module[_0x3150('0x6a')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x5787=['DESC','subqry.','findAll','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','Tags','clone','c.id','isEmpty','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','ListId','autocomplete','true','select','from','where','c.deletedAt\x20IS\x20NULL','left_join','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','mobile','fax','email','CompanyId','createdAt','updatedAt','TagIds','includes','push','forEach','field','expr','getSelectedTags','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','default','text','value','start','end','Tag','and','tags','ids','User','uc.UserId\x20=\x20?','user','skip','keys','some','compact','Contact','c.ListId\x20IN\x20?','concat','\x20=\x20?','resolve','then','fields','tag','clause','filter','getLists','c.ListId\x20IS\x20NULL','map','attributes','group','limit','offset','subqry.id','order'];(function(_0x5f5ac5,_0x526505){var _0x3697f2=function(_0x49cec5){while(--_0x49cec5){_0x5f5ac5['push'](_0x5f5ac5['shift']());}};_0x3697f2(++_0x526505);}(_0x5787,0x156));var _0x7578=function(_0x9774a3,_0x21c418){_0x9774a3=_0x9774a3-0x0;var _0x1e53fd=_0x5787[_0x9774a3];return _0x1e53fd;};'use strict';var _=require('lodash');var squel=require(_0x7578('0x0'));var as=require(_0x7578('0x1'));var qs=require(_0x7578('0x2'));var utils=require(_0x7578('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x1c741d,_0x11f91f){var _0x567d35=![];if(_0x1c741d[_0x7578('0x4')]===_0x7578('0x5')&&!_0x11f91f[_0x7578('0x6')]&&!_0x11f91f[_0x7578('0x7')]&&_0x11f91f[_0x7578('0x8')]!==_0x7578('0x9')){_0x567d35=!![];}return _0x567d35;}function getContactsSubquery(){return squel[_0x7578('0xa')]()[_0x7578('0xb')]('cm_contacts','c')[_0x7578('0xc')](_0x7578('0xd'));}function applyJoinClauses(_0x18f971,_0x50594a){var _0xc42dd0=_0x50594a?'c':'subqry';_0x18f971[_0x7578('0xe')]('cm_user_has_contacts','uc',_0x7578('0xf')+_0xc42dd0+_0x7578('0x10'))[_0x7578('0xe')](_0x7578('0x11'),'ct',_0x7578('0x12')+_0xc42dd0+'.id')[_0x7578('0xe')](_0x7578('0x13'),'t',_0x7578('0x14'));return _0x18f971;}function addFieldsToQuery(_0x38fc64,_0x17066a,_0x1ec692,_0x419d6f,_0x5a7c2b){var _0x555771=_0x5a7c2b?'c':_0x7578('0x15');if(!_0x17066a){_0x17066a=['id',_0x7578('0x16'),_0x7578('0x17'),'phone',_0x7578('0x18'),_0x7578('0x19'),_0x7578('0x1a'),'ListId',_0x7578('0x1b'),_0x7578('0x1c'),_0x7578('0x1d'),'deletedAt',_0x7578('0x1e')];}else if(!_0x17066a[_0x7578('0x1f')]('id')){_0x17066a[_0x7578('0x20')]('id');}var _0x118cf8=_0x1ec692&&_0x5a7c2b||!_0x1ec692&&!_0x5a7c2b;if(_0x419d6f){_0x118cf8=_0x419d6f&&_0x5a7c2b||!_0x419d6f&&!_0x5a7c2b;}_0x17066a[_0x7578('0x21')](function(_0x2ff89f){if(_0x2ff89f===_0x7578('0x1e')){if(_0x118cf8){_0x38fc64['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2ff89f);}else if(_0x1ec692||_0x419d6f){_0x38fc64[_0x7578('0x22')](_0x555771+'.'+_0x2ff89f);}}else{_0x38fc64[_0x7578('0x22')](_0x555771+'.'+_0x2ff89f);}});return _0x38fc64;}function getSqlClauses(){var _0x76b392={'default':squel['expr'](),'fields':squel[_0x7578('0x23')](),'filter':squel[_0x7578('0x23')](),'tags':{'clause':squel[_0x7578('0x23')](),'ids':null},'user':{'clause':squel[_0x7578('0x23')](),'skip':![]}};return _0x76b392;}function parseTagParameter(_0x4f5340){var _0x15be2f=squel[_0x7578('0x23')]();if(_0x4f5340){var _0x587310=utils[_0x7578('0x24')](_0x4f5340);_0x587310[_0x7578('0x21')](function(_0x447b6f){_0x15be2f['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x447b6f+',%');});}return _0x15be2f;}function parseSearchFilter(_0x38d2b3){var _0x1ec40a=squel['expr']();if(_0x38d2b3){var _0x17b661=_0x38d2b3[_0x7578('0x25')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x17b661[_0x7578('0x26')]('\x20')[_0x7578('0x27')]>0x1){_0x1ec40a['or'](_0x7578('0x28'),qs[_0x7578('0x29')](_0x17b661,!![]),null);}else{if(qs['isNumeric'](_0x17b661)){_0x1ec40a['or'](_0x7578('0x2a'),_0x17b661+'%');_0x1ec40a['or'](_0x7578('0x2b'),_0x17b661+'%');_0x1ec40a['or']('c.mobile\x20LIKE\x20?',_0x17b661+'%');_0x1ec40a['or'](_0x7578('0x2c'),_0x17b661+'%');}else if(qs[_0x7578('0x2d')](_0x17b661)){_0x1ec40a['or']('c.email\x20LIKE\x20?',_0x17b661+'%');}else{_0x1ec40a['or'](_0x7578('0x2e'),'%'+_0x17b661+'%');_0x1ec40a['or'](_0x7578('0x2f'),'%'+_0x17b661+'%');_0x1ec40a['or']('c.email\x20LIKE\x20?','%'+_0x17b661+'%');}}}return _0x1ec40a;}function parseAdvancedSearchFilter(_0x513bdc,_0x4c27f3){var _0x152fee=getSqlClauses();var _0x3eef43=as[_0x7578('0x30')](_0x513bdc);var _0x5b1877=_0x3eef43[_0x7578('0x31')];for(var _0x417994=0x0;_0x417994<_0x3eef43[_0x7578('0x32')][_0x7578('0x27')];_0x417994++){var _0x34d19c=_0x3eef43[_0x7578('0x32')][_0x417994];var _0x2e704c='c';var _0x4fc1d6=_['find'](_0x4c27f3,[_0x7578('0x33'),_0x34d19c[_0x7578('0x22')]]);if(_0x4fc1d6){if(_0x34d19c['field']===_0x7578('0x34')||_0x4fc1d6[_0x7578('0x35')]===_0x7578('0x36')){_0x34d19c[_0x7578('0x37')]=_0x7578('0x38');}var _0x683ef8=as[_0x7578('0x39')](_0x2e704c,_0x4fc1d6[_0x7578('0x3a')],_0x34d19c);_0x152fee[_0x7578('0x3b')][_0x5b1877](_0x683ef8[_0x7578('0x3c')],_0x683ef8[_0x7578('0x3d')][_0x7578('0x3e')],_0x683ef8[_0x7578('0x3d')][_0x7578('0x3f')]);}else{if(_0x34d19c[_0x7578('0x22')]===_0x7578('0x40')){var _0x19a9aa=_0x34d19c[_0x7578('0x3d')]['split'](',')['map'](function(_0x37fb7b){return Number(_0x37fb7b);});var _0xc397fe=parseTagParameter(_0x19a9aa);_0x152fee['tags']['clause'][_0x7578('0x41')](_0xc397fe);_0x152fee[_0x7578('0x42')][_0x7578('0x43')]=_0x19a9aa;}else if(_0x34d19c[_0x7578('0x22')]===_0x7578('0x44')){_0x152fee['user']['clause']['and'](_0x7578('0x45'),_0x34d19c[_0x7578('0x3d')]);_0x152fee[_0x7578('0x46')][_0x7578('0x47')]=!![];}}}return _0x152fee;}function parseModelFields(_0x9cd9cf,_0x593722){var _0x566534=squel[_0x7578('0x23')]();var _0xc06280=_(_0x9cd9cf)[_0x7578('0x48')]()['map'](function(_0x1d5aec){return _[_0x7578('0x49')](_0x593722,[_0x7578('0x33'),_0x1d5aec])?_0x1d5aec:undefined;})[_0x7578('0x4a')]()[_0x7578('0x3d')]();if(_0x9cd9cf['Contact']){_0xc06280['push'](_0x7578('0x4b'));}if(_0x9cd9cf['User']){_0xc06280[_0x7578('0x20')](_0x7578('0x44'));}if(_0xc06280[_0x7578('0x27')]>0x0){_0xc06280[_0x7578('0x21')](function(_0x7f7387){if(_0x7f7387===_0x7578('0x7')){_0x566534[_0x7578('0x41')](_0x7578('0x4c'),[][_0x7578('0x4d')](_0x9cd9cf[_0x7f7387]));}else if(_0x7f7387===_0x7578('0x4b')){var _0x57fcdb='%'+_0x9cd9cf[_0x7f7387]+'%';_0x566534[_0x7578('0x41')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x57fcdb);}else if(_0x7f7387==='User'){_0x566534[_0x7578('0x41')](_0x7578('0x45'),_0x9cd9cf[_0x7f7387]);}else{_0x566534[_0x7578('0x41')]('c.'+_0x7f7387+_0x7578('0x4e'),_0x9cd9cf[_0x7f7387]);}});}return _0x566534;}function parseQueryParameters(_0x578e18,_0x1b6c50){var _0x1cbf9c=getSqlClauses();return Promise[_0x7578('0x4f')]()[_0x7578('0x50')](function(){return parseModelFields(_0x578e18,_0x1b6c50);})['then'](function(_0x33a36c){_0x1cbf9c[_0x7578('0x51')][_0x7578('0x41')](_0x33a36c);return parseTagParameter(_0x578e18[_0x7578('0x52')]);})[_0x7578('0x50')](function(_0x4ea323){_0x1cbf9c[_0x7578('0x42')][_0x7578('0x53')][_0x7578('0x41')](_0x4ea323);return parseSearchFilter(_0x578e18[_0x7578('0x54')]);})[_0x7578('0x50')](function(_0x1cfd10){_0x1cbf9c[_0x7578('0x54')]=_0x1cfd10;return _0x1cbf9c;});}function checkListsRestrictions(_0x401c76,_0xe74943,_0x440307){var _0x4d16dc=squel[_0x7578('0x23')]();return Promise[_0x7578('0x4f')]()[_0x7578('0x50')](function(){if(_0xe74943['search']&&_0x401c76['role']===_0x7578('0x5')&&!_0x440307){return _0x401c76[_0x7578('0x55')]({'attributes':['id'],'raw':!![]});}})[_0x7578('0x50')](function(_0x3d931d){if(_0x3d931d){if(_0x3d931d[_0x7578('0x27')]===0x0){_0x4d16dc[_0x7578('0x41')](_0x7578('0x56'));}else{_0x4d16dc[_0x7578('0x41')](_0x7578('0x4c'),_[_0x7578('0x57')](_0x3d931d,'id'));}}})[_0x7578('0x50')](function(){return _0x4d16dc;});}function buildContactsQuery(_0x52277d,_0x397015,_0x15b16d,_0x2e9ebb,_0x7b7ce8,_0x2b681f){if(_0x397015){_0x397015=_0x15b16d[_0x7578('0x58')];}_0x52277d=addFieldsToQuery(_0x52277d,_0x397015,_0x2e9ebb,_0x2b681f,!![]);var _0x49730f=squel[_0x7578('0xa')]();_0x49730f=addFieldsToQuery(_0x49730f,_0x397015,_0x2e9ebb,_0x2b681f,![]);if(_0x2e9ebb||_0x2b681f){_0x52277d=applyJoinClauses(_0x52277d,!![]);_0x52277d[_0x7578('0x59')]('c.id');if(_0x15b16d[_0x7578('0x5a')]){_0x49730f[_0x7578('0x5a')](_0x15b16d[_0x7578('0x5a')]);}if(_0x15b16d['offset']){_0x49730f[_0x7578('0x5b')](_0x15b16d['offset']);}}else{_0x49730f=applyJoinClauses(_0x49730f,![]);_0x49730f[_0x7578('0x59')](_0x7578('0x5c'));if(_0x15b16d[_0x7578('0x5a')]){_0x52277d['limit'](_0x15b16d['limit']);}if(_0x15b16d[_0x7578('0x5b')]){_0x52277d['offset'](_0x15b16d[_0x7578('0x5b')]);}}_0x49730f['having'](_0x7b7ce8);if(_0x15b16d[_0x7578('0x5d')]){_0x15b16d['order'][_0x7578('0x21')](function(_0x49f126){_0x52277d['order']('c.'+_0x49f126[0x0],_0x49f126[0x1]===_0x7578('0x5e')?![]:!![]);_0x49730f['order'](_0x7578('0x5f')+_0x49f126[0x0],_0x49f126[0x1]===_0x7578('0x5e')?![]:!![]);});}_0x49730f[_0x7578('0xb')](_0x52277d,_0x7578('0x15'));return _0x49730f;}function getFilteredContacts(_0x4b3fe4){var _0x5a8092=[];return db[_0x7578('0x40')][_0x7578('0x60')]({'attributes':['id','name','color'],'raw':!![]})[_0x7578('0x50')](function(_0x458fb6){_0x5a8092=_[_0x7578('0x61')](_0x458fb6,'id');var _0x4fe30e={'type':db[_0x7578('0x62')][_0x7578('0x63')][_0x7578('0x64')],'model':db[_0x7578('0x65')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x7578('0x66')][_0x7578('0x67')](_0x4b3fe4['toString'](),_0x4fe30e);})[_0x7578('0x50')](function(_0x57a0b2){_0x57a0b2[_0x7578('0x21')](function(_0x39c116){if(_0x39c116[_0x7578('0x1e')]){_0x39c116['Tags']=[];_0x39c116['TagIds'][_0x7578('0x26')](',')['forEach'](function(_0x210698){_0x39c116[_0x7578('0x68')][_0x7578('0x20')](_0x5a8092[_0x210698]);});}delete _0x39c116[_0x7578('0x1e')];});return _0x57a0b2;});}function countFilteredContacts(_0x341a7f,_0x142b3d){var _0x537e56=_0x341a7f[_0x7578('0x69')]();_0x537e56[_0x7578('0x22')]('COUNT(*)');_0x537e56=applyJoinClauses(_0x537e56,!![]);_0x341a7f[_0x7578('0x59')](_0x7578('0x6a'));var _0x1b1b1d=utils[_0x7578('0x24')](_0x142b3d);if(!_[_0x7578('0x6b')](_0x1b1b1d)){_0x537e56[_0x7578('0xc')]('t.id\x20IN\x20?',_0x1b1b1d);}var _0x2c08f1={'type':db[_0x7578('0x62')]['QueryTypes']['SELECT'],'raw':!![]};return db['sequelize'][_0x7578('0x67')](_0x537e56['toString'](),_0x2c08f1)['then'](function(_0x47f269){return _0x47f269[0x0]['COUNT(*)'];});}module[_0x7578('0x6c')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index a43adcc..454d54d 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 _0xfad6=['lodash','../../config/environment','../../config/logger','app','secrets','aes192','encrypt','algorithm','error','test','getCiphers','indexOf','encryptFile','createWriteStream','createCipher','update','binary','write','end','final','close','unlink','decryptFile','createReadStream','data','secret','utf8','base64','decryptString','createDecipher','bluebird'];(function(_0x5986fa,_0x14f120){var _0x44a886=function(_0x54eae8){while(--_0x54eae8){_0x5986fa['push'](_0x5986fa['shift']());}};_0x44a886(++_0x14f120);}(_0xfad6,0xf7));var _0x6fad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfad6[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x6fad('0x0'));var _=require(_0x6fad('0x1'));var config=require(_0x6fad('0x2'));var logger=require(_0x6fad('0x3'))(_0x6fad('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x6fad('0x5')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x6fad('0x6')};if(config[_0x6fad('0x7')]&&config['encrypt'][_0x6fad('0x8')]){var isSupported=isAlgorithmSupported(config[_0x6fad('0x7')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0x6fad('0x7')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x6fad('0x9')](config[_0x6fad('0x7')][_0x6fad('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x3e495b){return AES_SUPPORTED_RX[_0x6fad('0xa')](_0x3e495b);}function getSupportedCiphers(){return crypto[_0x6fad('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x5bca08){return getSupportedCiphers()[_0x6fad('0xc')](_0x5bca08)>-0x1;}function combineOptions(_0x3ca791){var _0xd69c5a={};for(var _0x2bf266 in fileOptions){if(fileOptions['hasOwnProperty'](_0x2bf266)){_0xd69c5a[_0x2bf266]=fileOptions[_0x2bf266];}}if(_0x3ca791){for(var _0x5b1bf8 in _0x3ca791){if(_0x3ca791['hasOwnProperty'](_0x5b1bf8)){_0xd69c5a[_0x5b1bf8]=_0x3ca791[_0x5b1bf8];}}}return _0xd69c5a;}exports[_0x6fad('0xd')]=function(_0x155755,_0x519bc2,_0x27ec81,_0xa90b15){return new BPromise(function(_0x52d32c,_0x4e390a){_0xa90b15=combineOptions(_0xa90b15);var _0x43ca4f=new Buffer(_0x27ec81);var _0x197224=fs['createReadStream'](_0x155755);var _0x5bb1d1=fs[_0x6fad('0xe')](_0x519bc2);var _0x36b33d=crypto[_0x6fad('0xf')](_0xa90b15[_0x6fad('0x8')],_0x43ca4f);_0x197224['on']('data',function(_0x47aa24){var _0xb9831f=new Buffer(_0x36b33d[_0x6fad('0x10')](_0x47aa24),_0x6fad('0x11'));_0x5bb1d1[_0x6fad('0x12')](_0xb9831f);});_0x197224['on'](_0x6fad('0x13'),function(){try{var _0x5ecc96=new Buffer(_0x36b33d[_0x6fad('0x14')](_0x6fad('0x11')),_0x6fad('0x11'));_0x5bb1d1[_0x6fad('0x12')](_0x5ecc96);_0x5bb1d1[_0x6fad('0x13')]();_0x5bb1d1['on'](_0x6fad('0x15'),function(){return _0x52d32c(_0x519bc2);});}catch(_0x1d89ac){fs[_0x6fad('0x16')](_0x519bc2);return _0x4e390a(_0x1d89ac);}});});};exports[_0x6fad('0x17')]=function(_0x178236,_0x5e079a,_0x35bf84,_0x308f26){return new BPromise(function(_0x6e8ced,_0x48b881){_0x308f26=combineOptions(_0x308f26);var _0x384790=new Buffer(_0x35bf84);var _0xa0fe5b=fs[_0x6fad('0x18')](_0x178236);var _0x337476=fs[_0x6fad('0xe')](_0x5e079a);var _0x49c163=crypto['createDecipher'](_0x308f26['algorithm'],_0x384790);_0xa0fe5b['on'](_0x6fad('0x19'),function(_0x5e62f0){var _0x186468=new Buffer(_0x49c163[_0x6fad('0x10')](_0x5e62f0),_0x6fad('0x11'));_0x337476[_0x6fad('0x12')](_0x186468);});_0xa0fe5b['on']('end',function(){try{var _0xddbba5=new Buffer(_0x49c163[_0x6fad('0x14')](_0x6fad('0x11')),_0x6fad('0x11'));_0x337476[_0x6fad('0x12')](_0xddbba5);_0x337476[_0x6fad('0x13')]();_0x337476['on'](_0x6fad('0x15'),function(){return _0x6e8ced(_0x5e079a);});}catch(_0x3ea5b4){fs[_0x6fad('0x16')](_0x5e079a);return _0x48b881(_0x3ea5b4);}});});};exports['encryptString']=function(_0x4453f7,_0x4a668b,_0x20031f){var _0x1dd3f=_0x20031f||stringOptions[_0x6fad('0x8')];var _0x5df2f3=_0x4a668b||stringOptions[_0x6fad('0x1a')];var _0x3542f7=crypto['createCipher'](_0x1dd3f,_0x5df2f3);var _0x4ff916=_0x3542f7[_0x6fad('0x10')](_0x4453f7,_0x6fad('0x1b'),'base64');_0x4ff916+=_0x3542f7[_0x6fad('0x14')](_0x6fad('0x1c'));return _0x4ff916;};exports[_0x6fad('0x1d')]=function(_0x464fcf,_0xc62f8e,_0x302c89){var _0x525319=_0x302c89||stringOptions[_0x6fad('0x8')];var _0x289429=_0xc62f8e||stringOptions[_0x6fad('0x1a')];var _0x37b477=crypto[_0x6fad('0x1e')](_0x525319,_0x289429);var _0x16c5a9=_0x37b477[_0x6fad('0x10')](_0x464fcf,_0x6fad('0x1c'),_0x6fad('0x1b'));_0x16c5a9+=_0x37b477[_0x6fad('0x14')](_0x6fad('0x1b'));return _0x16c5a9;}; \ No newline at end of file +var _0xb434=['error','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','end','close','unlink','createDecipher','final','write','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb434,0x1f3));var _0x4b43=function(_0x257841,_0x389b4d){_0x257841=_0x257841-0x0;var _0x1b87ed=_0xb434[_0x257841];return _0x1b87ed;};'use strict';var crypto=require(_0x4b43('0x0'));var fs=require('fs');var BPromise=require(_0x4b43('0x1'));var _=require(_0x4b43('0x2'));var config=require(_0x4b43('0x3'));var logger=require('../../config/logger')(_0x4b43('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4b43('0x5')]['session'],'algorithm':_0x4b43('0x6')};const fileOptions={'algorithm':_0x4b43('0x7')};if(config[_0x4b43('0x8')]&&config[_0x4b43('0x8')][_0x4b43('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x4b43('0x9')]);if(isSupported){fileOptions[_0x4b43('0x9')]=config[_0x4b43('0x8')][_0x4b43('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x4b43('0xa')](',\x20');logger[_0x4b43('0xb')](config['encrypt'][_0x4b43('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x37e80a){return AES_SUPPORTED_RX['test'](_0x37e80a);}function getSupportedCiphers(){return crypto[_0x4b43('0xc')]()[_0x4b43('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x452ad8){return getSupportedCiphers()[_0x4b43('0xe')](_0x452ad8)>-0x1;}function combineOptions(_0x35ece4){var _0x3aec2={};for(var _0x49fe49 in fileOptions){if(fileOptions[_0x4b43('0xf')](_0x49fe49)){_0x3aec2[_0x49fe49]=fileOptions[_0x49fe49];}}if(_0x35ece4){for(var _0x1bb01a in _0x35ece4){if(_0x35ece4['hasOwnProperty'](_0x1bb01a)){_0x3aec2[_0x1bb01a]=_0x35ece4[_0x1bb01a];}}}return _0x3aec2;}exports[_0x4b43('0x10')]=function(_0x4c38f8,_0x3cc9ca,_0x2c882d,_0x58be29){return new BPromise(function(_0x3393c5,_0x5b8473){_0x58be29=combineOptions(_0x58be29);var _0xc4a4c1=new Buffer(_0x2c882d);var _0x2ac9d9=fs[_0x4b43('0x11')](_0x4c38f8);var _0x4bbdd1=fs[_0x4b43('0x12')](_0x3cc9ca);var _0x396bb4=crypto[_0x4b43('0x13')](_0x58be29[_0x4b43('0x9')],_0xc4a4c1);_0x2ac9d9['on'](_0x4b43('0x14'),function(_0x2bf580){var _0x25edb1=new Buffer(_0x396bb4[_0x4b43('0x15')](_0x2bf580),_0x4b43('0x16'));_0x4bbdd1['write'](_0x25edb1);});_0x2ac9d9['on']('end',function(){try{var _0x355643=new Buffer(_0x396bb4['final']('binary'),_0x4b43('0x16'));_0x4bbdd1['write'](_0x355643);_0x4bbdd1[_0x4b43('0x17')]();_0x4bbdd1['on'](_0x4b43('0x18'),function(){return _0x3393c5(_0x3cc9ca);});}catch(_0x32d8d5){fs[_0x4b43('0x19')](_0x3cc9ca);return _0x5b8473(_0x32d8d5);}});});};exports['decryptFile']=function(_0x486cdd,_0x7a481e,_0x3dbcc6,_0x1912e8){return new BPromise(function(_0x1ad3d0,_0x419874){_0x1912e8=combineOptions(_0x1912e8);var _0x185e6=new Buffer(_0x3dbcc6);var _0x460724=fs[_0x4b43('0x11')](_0x486cdd);var _0x3d950e=fs[_0x4b43('0x12')](_0x7a481e);var _0x1ffd5e=crypto[_0x4b43('0x1a')](_0x1912e8[_0x4b43('0x9')],_0x185e6);_0x460724['on'](_0x4b43('0x14'),function(_0x3f3704){var _0x5a64b4=new Buffer(_0x1ffd5e[_0x4b43('0x15')](_0x3f3704),_0x4b43('0x16'));_0x3d950e['write'](_0x5a64b4);});_0x460724['on']('end',function(){try{var _0x1d8f22=new Buffer(_0x1ffd5e[_0x4b43('0x1b')](_0x4b43('0x16')),_0x4b43('0x16'));_0x3d950e[_0x4b43('0x1c')](_0x1d8f22);_0x3d950e[_0x4b43('0x17')]();_0x3d950e['on'](_0x4b43('0x18'),function(){return _0x1ad3d0(_0x7a481e);});}catch(_0x2c4a3c){fs[_0x4b43('0x19')](_0x7a481e);return _0x419874(_0x2c4a3c);}});});};exports[_0x4b43('0x1d')]=function(_0x3fc169,_0x529151,_0x5b1908){var _0x41a5db=_0x5b1908||stringOptions['algorithm'];var _0x183468=_0x529151||stringOptions[_0x4b43('0x1e')];var _0x25aea2=crypto[_0x4b43('0x13')](_0x41a5db,_0x183468);var _0x48b7d6=_0x25aea2[_0x4b43('0x15')](_0x3fc169,_0x4b43('0x1f'),_0x4b43('0x20'));_0x48b7d6+=_0x25aea2[_0x4b43('0x1b')](_0x4b43('0x20'));return _0x48b7d6;};exports[_0x4b43('0x21')]=function(_0x2ed2ac,_0x53a6c7,_0x334ff4){var _0x4b8961=_0x334ff4||stringOptions[_0x4b43('0x9')];var _0x4b9410=_0x53a6c7||stringOptions[_0x4b43('0x1e')];var _0x26f9e9=crypto['createDecipher'](_0x4b8961,_0x4b9410);var _0x588a6f=_0x26f9e9[_0x4b43('0x15')](_0x2ed2ac,_0x4b43('0x20'),_0x4b43('0x1f'));_0x588a6f+=_0x26f9e9[_0x4b43('0x1b')]('utf8');return _0x588a6f;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 7487e9c..724ac6a 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 _0x9246=['range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','query','dirname','.csv','length','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','inspect','Failed','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','CSV','Setting','find','split','splitSizeCsv','then','sequelize','format','QueryTypes','num'];(function(_0x25e1a2,_0x8d3307){var _0x40a473=function(_0x5f1201){while(--_0x5f1201){_0x25e1a2['push'](_0x25e1a2['shift']());}};_0x40a473(++_0x8d3307);}(_0x9246,0x1c7));var _0x6924=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x9246[_0x5a95fa];return _0x1a61b8;};'use strict';var util=require(_0x6924('0x0'));var path=require(_0x6924('0x1'));var _=require(_0x6924('0x2'));var csv=require(_0x6924('0x3'));var fs=require('fs');var BPromise=require(_0x6924('0x4'));var zipdir=require(_0x6924('0x5'));var rimraf=require(_0x6924('0x6'));var db=require(_0x6924('0x7'))['db'];var dbH=require(_0x6924('0x7'))[_0x6924('0x8')];var logger=require(_0x6924('0x9'))(_0x6924('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x6924('0xb')][0x3];var PATH=process[_0x6924('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2d4389,_0x32edf0){var _0x20295d={'status':_0x2d4389};var _0x4b55e8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x32edf0){_0x20295d['savename']=_0x32edf0;}return db[_0x6924('0xc')][_0x6924('0xd')](_0x20295d,_0x4b55e8);}function main(){var _0x3ee282=0x1388;var _0x442c20;logger[_0x6924('0xe')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6924('0xf')));return db[_0x6924('0x10')][_0x6924('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6924('0x12'),_0x6924('0x13')]})[_0x6924('0x14')](function(_0xd4f2e6){if(_0xd4f2e6){_0x442c20=_0xd4f2e6;_0x3ee282=_0x442c20['splitSizeCsv']||0x1388;}})[_0x6924('0x14')](function(){return dbH[_0x6924('0x15')]['query'](util[_0x6924('0x16')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x6924('0x15')][_0x6924('0x17')]['SELECT']});})[_0x6924('0x14')](function(_0x5e009b){if(!_0x5e009b[0x0][_0x6924('0x18')]){return analyticExtractedReport('Empty');}var _0x484d74=[];var _0x389bd1=0x0;if(_0x442c20['split']){if(_0x5e009b&&_0x5e009b['length']){var _0x67ae0e=_[_0x6924('0x19')](_0x5e009b[0x0]['num']/_0x3ee282);var _0xe56ecd=Number['isInteger'](_0x5e009b[0x0][_0x6924('0x18')]/_0x3ee282)?_0x5e009b[0x0]['num']%_0x3ee282:0x0;_0x67ae0e[_0x6924('0x1a')](function(_0x35b4f1){if(_0x35b4f1>0x0){_0x389bd1+=_0x3ee282;}_0x484d74[_0x6924('0x1b')](dbH['sequelize']['query'](util[_0x6924('0x16')](_0x6924('0x1c'),QUERY,_0x3ee282,_0x389bd1),{'type':dbH['sequelize'][_0x6924('0x17')][_0x6924('0x1d')]}));});if(_0xe56ecd>0x0){_0x389bd1+=_0x3ee282;_0x484d74[_0x6924('0x1b')](dbH[_0x6924('0x15')]['query'](util[_0x6924('0x16')](_0x6924('0x1c'),QUERY,_0xe56ecd,_0x389bd1),{'type':dbH['sequelize'][_0x6924('0x17')][_0x6924('0x1d')]}));}}}else{_0x484d74[_0x6924('0x1b')](dbH[_0x6924('0x15')][_0x6924('0x1e')](QUERY,{'type':dbH[_0x6924('0x15')][_0x6924('0x17')][_0x6924('0x1d')]}));}var _0x51934e=path[_0x6924('0x1f')](PATH);var _0x58e456=path['basename'](PATH,_0x6924('0x20'));var _0x836ed6=_0x442c20[_0x6924('0x12')]&&_0x484d74[_0x6924('0x21')]>0x1;var _0x2f93ba=[];if(!fs[_0x6924('0x22')](path['join'](_0x51934e,_0x58e456))&&_0x836ed6){fs['mkdirSync'](path[_0x6924('0x23')](_0x51934e,_0x58e456));}return BPromise[_0x6924('0x24')](_0x484d74,function(_0x696c01){_0x2f93ba[_0x6924('0x1b')](_0x696c01);})[_0x6924('0x14')](function(){for(var _0x3600d9=0x0;_0x3600d9<_0x2f93ba[_0x6924('0x21')];_0x3600d9+=0x1){var _0x4ba58f;var _0x5a3031=_0x2f93ba[_0x3600d9];if(_0x836ed6){_0x4ba58f=path[_0x6924('0x23')](_0x51934e,_0x58e456,util[_0x6924('0x16')](_0x6924('0x25'),_0x58e456,_0x3600d9,_0x6924('0x26')));}else{_0x4ba58f=path[_0x6924('0x23')](_0x51934e,util[_0x6924('0x16')](_0x6924('0x27'),_0x58e456,_0x6924('0x26')));}fs[_0x6924('0x28')](_0x4ba58f,csv(_0x5a3031));}})['then'](function(){if(_0x836ed6){return new Promise(function(_0x42939a){zipdir(path['join'](_0x51934e,_0x58e456),{'saveTo':path[_0x6924('0x23')](_0x51934e,util[_0x6924('0x16')](_0x6924('0x27'),_0x58e456,'zip'))},function(_0x10f938,_0xd4fc26){rimraf(path['join'](_0x51934e,_0x58e456),function(){});_0x42939a(_0x6924('0x29'));});});}})[_0x6924('0x14')](function(){logger[_0x6924('0xe')](util[_0x6924('0x16')](_0x6924('0x2a'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x6924('0x2b'),_0x836ed6?util[_0x6924('0x16')](_0x6924('0x27'),_0x58e456,_0x836ed6?_0x6924('0x2c'):_0x6924('0x26')):null);});})[_0x6924('0x2d')](function(_0x27770d){logger[_0x6924('0xe')](util[_0x6924('0x16')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6924('0xf')),util[_0x6924('0x2e')](_0x27770d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6924('0x2f'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x933a=['each','%s%d.%s','%s.%s','csv','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','to-csv','bluebird','zip-dir','dbH','../../config/logger','argv','savename','update','info','format','Setting','find','split','splitSizeCsv','then','query','sequelize','QueryTypes','SELECT','Empty','length','num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','basename','.csv','existsSync','join','mkdirSync'];(function(_0x2f646a,_0x3f5ca7){var _0x1ca740=function(_0x1e2bdc){while(--_0x1e2bdc){_0x2f646a['push'](_0x2f646a['shift']());}};_0x1ca740(++_0x3f5ca7);}(_0x933a,0x1ef));var _0xa933=function(_0x21aa2a,_0x398c4a){_0x21aa2a=_0x21aa2a-0x0;var _0x229988=_0x933a[_0x21aa2a];return _0x229988;};'use strict';var util=require(_0xa933('0x0'));var path=require('path');var _=require(_0xa933('0x1'));var csv=require(_0xa933('0x2'));var fs=require('fs');var BPromise=require(_0xa933('0x3'));var zipdir=require(_0xa933('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xa933('0x5')];var logger=require(_0xa933('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xa933('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x25af0a,_0x2c69cc){var _0x1741f0={'status':_0x25af0a};var _0x31b8e9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c69cc){_0x1741f0[_0xa933('0x8')]=_0x2c69cc;}return db['AnalyticExtractedReport'][_0xa933('0x9')](_0x1741f0,_0x31b8e9);}function main(){var _0x3de5dd=0x1388;var _0x4fdcd8;logger[_0xa933('0xa')](util[_0xa933('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xa933('0xc')][_0xa933('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa933('0xe'),_0xa933('0xf')]})[_0xa933('0x10')](function(_0x1174ca){if(_0x1174ca){_0x4fdcd8=_0x1174ca;_0x3de5dd=_0x4fdcd8['splitSizeCsv']||0x1388;}})[_0xa933('0x10')](function(){return dbH['sequelize'][_0xa933('0x11')](util[_0xa933('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xa933('0x12')][_0xa933('0x13')][_0xa933('0x14')]});})[_0xa933('0x10')](function(_0x3a0265){if(!_0x3a0265[0x0]['num']){return analyticExtractedReport(_0xa933('0x15'));}var _0x5597f6=[];var _0x13bc69=0x0;if(_0x4fdcd8['split']){if(_0x3a0265&&_0x3a0265[_0xa933('0x16')]){var _0x14ea91=_['range'](_0x3a0265[0x0][_0xa933('0x17')]/_0x3de5dd);var _0xb6e4cd=Number[_0xa933('0x18')](_0x3a0265[0x0]['num']/_0x3de5dd)?_0x3a0265[0x0]['num']%_0x3de5dd:0x0;_0x14ea91[_0xa933('0x19')](function(_0x491dbe){if(_0x491dbe>0x0){_0x13bc69+=_0x3de5dd;}_0x5597f6['push'](dbH[_0xa933('0x12')][_0xa933('0x11')](util[_0xa933('0xb')](_0xa933('0x1a'),QUERY,_0x3de5dd,_0x13bc69),{'type':dbH[_0xa933('0x12')][_0xa933('0x13')]['SELECT']}));});if(_0xb6e4cd>0x0){_0x13bc69+=_0x3de5dd;_0x5597f6[_0xa933('0x1b')](dbH[_0xa933('0x12')][_0xa933('0x11')](util['format'](_0xa933('0x1a'),QUERY,_0xb6e4cd,_0x13bc69),{'type':dbH[_0xa933('0x12')]['QueryTypes'][_0xa933('0x14')]}));}}}else{_0x5597f6[_0xa933('0x1b')](dbH[_0xa933('0x12')][_0xa933('0x11')](QUERY,{'type':dbH['sequelize'][_0xa933('0x13')][_0xa933('0x14')]}));}var _0x71fc6e=path['dirname'](PATH);var _0x19c8cf=path[_0xa933('0x1c')](PATH,_0xa933('0x1d'));var _0x38ac57=_0x4fdcd8['split']&&_0x5597f6[_0xa933('0x16')]>0x1;var _0x3bfa6d=[];if(!fs[_0xa933('0x1e')](path[_0xa933('0x1f')](_0x71fc6e,_0x19c8cf))&&_0x38ac57){fs[_0xa933('0x20')](path[_0xa933('0x1f')](_0x71fc6e,_0x19c8cf));}return BPromise[_0xa933('0x21')](_0x5597f6,function(_0x59e055){_0x3bfa6d['push'](_0x59e055);})['then'](function(){for(var _0x300769=0x0;_0x300769<_0x3bfa6d[_0xa933('0x16')];_0x300769+=0x1){var _0x1fe411;var _0x402cc3=_0x3bfa6d[_0x300769];if(_0x38ac57){_0x1fe411=path[_0xa933('0x1f')](_0x71fc6e,_0x19c8cf,util['format'](_0xa933('0x22'),_0x19c8cf,_0x300769,'csv'));}else{_0x1fe411=path[_0xa933('0x1f')](_0x71fc6e,util['format'](_0xa933('0x23'),_0x19c8cf,_0xa933('0x24')));}fs[_0xa933('0x25')](_0x1fe411,csv(_0x402cc3));}})['then'](function(){if(_0x38ac57){return new Promise(function(_0x11ca3f){zipdir(path[_0xa933('0x1f')](_0x71fc6e,_0x19c8cf),{'saveTo':path[_0xa933('0x1f')](_0x71fc6e,util[_0xa933('0xb')](_0xa933('0x23'),_0x19c8cf,_0xa933('0x26')))},function(_0x3e6259,_0x393cfd){rimraf(path[_0xa933('0x1f')](_0x71fc6e,_0x19c8cf),function(){});_0x11ca3f('zip\x20finished');});});}})[_0xa933('0x10')](function(){logger['info'](util['format'](_0xa933('0x27'),EXTRACTED_REPORT_ID,_0xa933('0x28')));return analyticExtractedReport(_0xa933('0x29'),_0x38ac57?util[_0xa933('0xb')]('%s.%s',_0x19c8cf,_0x38ac57?'zip':'csv'):null);});})[_0xa933('0x2a')](function(_0x4cb114){logger[_0xa933('0xa')](util[_0xa933('0xb')](_0xa933('0x2b'),EXTRACTED_REPORT_ID,_0xa933('0x28')),util[_0xa933('0x2c')](_0x4cb114,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa933('0x2d'));})[_0xa933('0x2e')](function(){process[_0xa933('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 537f02a..17ec17c 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 _0x3d5e=['startDate','endDate','header','pageBreak','before','landscape','\x20/\x20','Arial','right','num','Empty','find','split','splitSizePdf','then','range','forEach','query','sequelize','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','existsSync','mkdirSync','join','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','createPdfFromHTML','catch','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','dbH','analytics','argv','AnalyticExtractedReport','update','map','pick','toString','value','fill','length','auto','body','concat','chunk','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name'];(function(_0x42b21d,_0x466185){var _0x444319=function(_0x2cadbf){while(--_0x2cadbf){_0x42b21d['push'](_0x42b21d['shift']());}};_0x444319(++_0x466185);}(_0x3d5e,0x90));var _0xe3d5=function(_0x34d22a,_0x441d18){_0x34d22a=_0x34d22a-0x0;var _0x1bd7d8=_0x3d5e[_0x34d22a];return _0x1bd7d8;};'use strict';var _=require(_0xe3d5('0x0'));var fs=require('fs');var util=require(_0xe3d5('0x1'));var path=require(_0xe3d5('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0xe3d5('0x3'));var PdfPrinter=require(_0xe3d5('0x4'));var zipdir=require(_0xe3d5('0x5'));var rimraf=require(_0xe3d5('0x6'));var JSDOM=require(_0xe3d5('0x7'))[_0xe3d5('0x8')];var window=new JSDOM('')[_0xe3d5('0x9')];var BPromise=require(_0xe3d5('0xa'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xe3d5('0xb')];var logger=require('../../config/logger')(_0xe3d5('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xe3d5('0xd')][0x2]);var QUERY=process[_0xe3d5('0xd')][0x3];var PATH=process[_0xe3d5('0xd')][0x4];var NAME=process[_0xe3d5('0xd')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2e0dac,_0x264e86){var _0xfa21b5={'status':_0x2e0dac};var _0x329d21={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x264e86){_0xfa21b5['savename']=_0x264e86;}return db[_0xe3d5('0xe')][_0xe3d5('0xf')](_0xfa21b5,_0x329d21);}function getHeaders(_0x1b4f0c){return _[_0xe3d5('0x10')](_0x1b4f0c,function(_0x3809e3){return{'text':_0x3809e3,'style':'tableHeader'};});}function getRows(_0x2ae808,_0x4ab6d6){return _[_0xe3d5('0x10')](_0x4ab6d6,function(_0x482b83){return _(_0x482b83)[_0xe3d5('0x11')](_0x2ae808)[_0xe3d5('0x10')](function(_0x554966){return _0x554966?_[_0xe3d5('0x12')](_0x554966):'';})[_0xe3d5('0x13')]();});}function createTable(_0x4bff1c,_0x3acc94){var _0x226cb8={'widths':_[_0xe3d5('0x14')](Array(_0x4bff1c[_0xe3d5('0x15')]),0x91),'heights':function(_0x4327d9){return _0x4327d9===0x0?_0xe3d5('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x18cff1=getHeaders(_0x4bff1c);_0x226cb8[_0xe3d5('0x17')]['push'](_0x18cff1);var _0x545d57=getRows(_0x4bff1c,_0x3acc94);_0x226cb8['body']=_0x226cb8[_0xe3d5('0x17')][_0xe3d5('0x18')](_0x545d57);return _0x226cb8;}function createTables(_0x1bd0da){var _0x101f19=[];var _0x42c1c6=_[_0xe3d5('0x19')](Object['keys'](_0x1bd0da[0x0]),0x5);_0x42c1c6['forEach'](function(_0x3dda60){_0x101f19[_0xe3d5('0x1a')](createTable(_0x3dda60,_0x1bd0da));});return _0x101f19;}function getPDFDocDefinition(_0x4473cc){var _0x54d4c4=util[_0xe3d5('0x1b')](_0xe3d5('0x1c'),NAME,EXTRACTED_REPORT[_0xe3d5('0x1d')],moment(EXTRACTED_REPORT[_0xe3d5('0x1e')])[_0xe3d5('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0xe3d5('0x1f')])[_0xe3d5('0x1b')](FORMAT));var _0x223a43=[];for(var _0x540e33=0x0;_0x540e33<_0x4473cc['length'];_0x540e33++){var _0x364a02=[];if(_0x540e33===0x0){_0x364a02['push']({'text':_0x54d4c4,'style':_0xe3d5('0x20')});}var _0x3f95cb={'table':_0x4473cc[_0x540e33]};if(_0x540e33>0x0){_0x3f95cb[_0xe3d5('0x21')]=_0xe3d5('0x22');_0x3f95cb['margin']=[0x0,0x46,0x0,0x0];}_0x364a02[_0xe3d5('0x1a')](_0x3f95cb);_0x223a43[_0xe3d5('0x1a')](_0x364a02);}return{'pageSize':'A4','pageOrientation':_0xe3d5('0x23'),'content':_0x223a43,'footer':function(_0x6ba194,_0x194d6d){return{'text':_0x6ba194[_0xe3d5('0x12')]()+_0xe3d5('0x24')+_0x194d6d,'style':'footer'};},'defaultStyle':{'font':_0xe3d5('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xe3d5('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4fa73c){var _0x18198f=0x1388;var _0x581b50;if(!_0x4fa73c[0x0][_0xe3d5('0x27')]){return analyticExtractedReport(_0xe3d5('0x28'));}return db['Setting'][_0xe3d5('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe3d5('0x2a'),_0xe3d5('0x2b')]})[_0xe3d5('0x2c')](function(_0x225e8c){if(_0x225e8c){_0x581b50=_0x225e8c;_0x18198f=_0x581b50['splitSizePdf']||0x3e8;}})[_0xe3d5('0x2c')](function(){var _0x1688d0=[];var _0x10fa74=0x0;if(_0x581b50[_0xe3d5('0x2a')]){if(_0x4fa73c&&_0x4fa73c[_0xe3d5('0x15')]){var _0x40fb98=_[_0xe3d5('0x2d')](_0x4fa73c[0x0][_0xe3d5('0x27')]/_0x18198f);var _0x107261=Number['isInteger'](_0x4fa73c[0x0]['num']/_0x18198f)?_0x4fa73c[0x0][_0xe3d5('0x27')]%_0x18198f:0x0;_0x40fb98[_0xe3d5('0x2e')](function(_0x400b9d){if(_0x400b9d>0x0){_0x10fa74+=_0x18198f;}_0x1688d0[_0xe3d5('0x1a')](dbH['sequelize'][_0xe3d5('0x2f')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x18198f,_0x10fa74),{'type':dbH[_0xe3d5('0x30')][_0xe3d5('0x31')][_0xe3d5('0x32')]}));});if(_0x107261>0x0){_0x10fa74+=_0x18198f;_0x1688d0[_0xe3d5('0x1a')](dbH['sequelize'][_0xe3d5('0x2f')](util[_0xe3d5('0x1b')](_0xe3d5('0x33'),QUERY,_0x107261,_0x10fa74),{'type':dbH[_0xe3d5('0x30')][_0xe3d5('0x31')][_0xe3d5('0x32')]}));}}}else{_0x1688d0[_0xe3d5('0x1a')](dbH[_0xe3d5('0x30')]['query'](QUERY,{'type':dbH[_0xe3d5('0x30')]['QueryTypes'][_0xe3d5('0x32')]}));}var _0x1b7f66=path[_0xe3d5('0x34')](PATH);var _0x4ec7d9=path[_0xe3d5('0x35')](PATH,_0xe3d5('0x36'));var _0x8802d1=_0x581b50['split']&&_0x1688d0['length']>0x1;var _0x57f96a=[];if(!fs[_0xe3d5('0x37')](path['join'](_0x1b7f66,_0x4ec7d9))&&_0x8802d1){fs[_0xe3d5('0x38')](path[_0xe3d5('0x39')](_0x1b7f66,_0x4ec7d9));}return BPromise['each'](_0x1688d0,function(_0x3d85b5){_0x57f96a[_0xe3d5('0x1a')](_0x3d85b5);})[_0xe3d5('0x2c')](function(){var _0x25cf68=[];for(var _0x150dc6=0x0;_0x150dc6<_0x57f96a[_0xe3d5('0x15')];_0x150dc6+=0x1){var _0x491073=_0x57f96a[_0x150dc6];var _0x41614e=createTables(_[_0xe3d5('0x3a')](_0x491073));var _0x2c4106;var _0x856b24=getPDFDocDefinition(_0x41614e);var _0x4240e8=getPDFPrinter();var _0x4c82d3=_0x4240e8[_0xe3d5('0x3b')](_0x856b24);if(_0x8802d1){_0x2c4106=path['join'](_0x1b7f66,_0x4ec7d9,util[_0xe3d5('0x1b')](_0xe3d5('0x3c'),_0x4ec7d9,_0x150dc6,'pdf'));}else{_0x2c4106=path['join'](_0x1b7f66,util['format'](_0xe3d5('0x3d'),_0x4ec7d9,_0xe3d5('0x3e')));}_0x25cf68[_0xe3d5('0x1a')](writePDFDocument(_0x4c82d3,_0x2c4106));}return Promise[_0xe3d5('0x3f')](_0x25cf68);})[_0xe3d5('0x2c')](function(){if(_0x8802d1){return new Promise(function(_0x283005){zipdir(path[_0xe3d5('0x39')](_0x1b7f66,_0x4ec7d9),{'saveTo':path[_0xe3d5('0x39')](_0x1b7f66,util['format'](_0xe3d5('0x3d'),_0x4ec7d9,_0xe3d5('0x40')))},function(){rimraf(path[_0xe3d5('0x39')](_0x1b7f66,_0x4ec7d9),function(){});_0x283005(_0xe3d5('0x41'));});});}})['then'](function(){if(!_0x8802d1)return;rimraf(path['join'](_0x1b7f66,_0x4ec7d9),function(){});})[_0xe3d5('0x2c')](function(){logger[_0xe3d5('0x42')](util[_0xe3d5('0x1b')](_0xe3d5('0x43'),EXTRACTED_REPORT_ID,_0xe3d5('0x44')));return analyticExtractedReport(_0xe3d5('0x45'),_0x8802d1?util[_0xe3d5('0x1b')](_0xe3d5('0x3d'),_0x4ec7d9,_0x8802d1?_0xe3d5('0x40'):_0xe3d5('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xe3d5('0x42')](util[_0xe3d5('0x1b')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe3d5('0x44')));return db[_0xe3d5('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xe3d5('0x2c')](function(_0x3e0927){EXTRACTED_REPORT=_0x3e0927;return dbH[_0xe3d5('0x30')][_0xe3d5('0x2f')](util[_0xe3d5('0x1b')](_0xe3d5('0x46'),QUERY),{'type':dbH[_0xe3d5('0x30')]['QueryTypes'][_0xe3d5('0x32')]});})[_0xe3d5('0x2c')](extractReport)['catch'](function(_0x1a4007){logger[_0xe3d5('0x42')](util['format'](_0xe3d5('0x47'),EXTRACTED_REPORT_ID,_0xe3d5('0x44')),util[_0xe3d5('0x48')](_0x1a4007,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xe3d5('0x49')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x312207=new PdfPrinter({'Arial':{'normal':__dirname+_0xe3d5('0x4a'),'bold':__dirname+_0xe3d5('0x4b'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xe3d5('0x4c')}});return _0x312207;}function getPDFDocDefinitionFromHTML(_0x401fa0,_0x49ef68){var _0x1628d8=util[_0xe3d5('0x1b')](_0xe3d5('0x4d'),_0x49ef68[_0xe3d5('0x4e')],_0x49ef68[_0xe3d5('0x4f')]);var _0x6b95d8=moment()[_0xe3d5('0x1b')]('YYYY-MM-DD')['toString']();var _0xc282f4=htmlToPdfmake(_0x401fa0,{'window':window,'tableAutoSize':!![]});return{'content':[_0xc282f4],'defaultStyle':{'font':_0xe3d5('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xe3d5('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x40f12e,_0x5b044e){return[{'text':util[_0xe3d5('0x1b')](_0xe3d5('0x51'),_0x1628d8,_0x40f12e,_0x5b044e,_0x6b95d8),'style':'footer'}];}};}function writePDFDocument(_0x482d77,_0x48131f){return new Promise(function(_0x577919,_0x69938d){var _0x446e12=_0x482d77[_0xe3d5('0x52')](fs['createWriteStream'](_0x48131f));_0x446e12['on'](_0xe3d5('0x53'),function(){_0x577919('finish');});_0x446e12['on'](_0xe3d5('0x54'),function(_0xa861c1){_0x69938d(_0xa861c1);});_0x482d77['end']();});}exports[_0xe3d5('0x55')]=function(_0x43bafa,_0x5f04bd){var _0x15ae35=getPDFPrinter();var _0x342d34=getPDFDocDefinitionFromHTML(_0x43bafa,_0x5f04bd);var _0x361dba=_0x15ae35[_0xe3d5('0x3b')](_0x342d34);return writePDFDocument(_0x361dba,_0x5f04bd['path'])[_0xe3d5('0x56')](function(_0x3f2837){throw _0x3f2837;});}; \ No newline at end of file +var _0x745a=['zip','zip\x20finished','info','Completed','%s.%s','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','update','map','tableHeader','toString','value','fill','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','header','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','find','split','splitSizePdf','range','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','query','basename','.pdf','existsSync','join','each','then','flatten','%s%d.%s','pdf'];(function(_0x23d6e7,_0x24a914){var _0x139d82=function(_0x15b0ca){while(--_0x15b0ca){_0x23d6e7['push'](_0x23d6e7['shift']());}};_0x139d82(++_0x24a914);}(_0x745a,0x1ed));var _0xa745=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x745a[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xa745('0x0'));var fs=require('fs');var util=require(_0xa745('0x1'));var path=require(_0xa745('0x2'));var moment=require(_0xa745('0x3'));var htmlToPdfmake=require(_0xa745('0x4'));var PdfPrinter=require(_0xa745('0x5'));var zipdir=require(_0xa745('0x6'));var rimraf=require(_0xa745('0x7'));var JSDOM=require(_0xa745('0x8'))[_0xa745('0x9')];var window=new JSDOM('')[_0xa745('0xa')];var BPromise=require(_0xa745('0xb'));var db=require(_0xa745('0xc'))['db'];var dbH=require(_0xa745('0xc'))[_0xa745('0xd')];var logger=require(_0xa745('0xe'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xa745('0xf')][0x3];var PATH=process[_0xa745('0xf')][0x4];var NAME=process[_0xa745('0xf')][0x5];var FORMAT=_0xa745('0x10');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5e6b07,_0x43d475){var _0xa20a49={'status':_0x5e6b07};var _0x22fa5c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x43d475){_0xa20a49['savename']=_0x43d475;}return db['AnalyticExtractedReport'][_0xa745('0x11')](_0xa20a49,_0x22fa5c);}function getHeaders(_0x4cc11b){return _[_0xa745('0x12')](_0x4cc11b,function(_0x5e0736){return{'text':_0x5e0736,'style':_0xa745('0x13')};});}function getRows(_0x583434,_0xdb7acd){return _[_0xa745('0x12')](_0xdb7acd,function(_0x327078){return _(_0x327078)['pick'](_0x583434)[_0xa745('0x12')](function(_0x274b54){return _0x274b54?_[_0xa745('0x14')](_0x274b54):'';})[_0xa745('0x15')]();});}function createTable(_0x13d3de,_0x34315d){var _0x42669f={'widths':_[_0xa745('0x16')](Array(_0x13d3de['length']),0x91),'heights':function(_0x1f50ae){return _0x1f50ae===0x0?_0xa745('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4cc7af=getHeaders(_0x13d3de);_0x42669f[_0xa745('0x18')][_0xa745('0x19')](_0x4cc7af);var _0x27661f=getRows(_0x13d3de,_0x34315d);_0x42669f[_0xa745('0x18')]=_0x42669f[_0xa745('0x18')][_0xa745('0x1a')](_0x27661f);return _0x42669f;}function createTables(_0x5b6786){var _0x19d028=[];var _0x2d3396=_[_0xa745('0x1b')](Object[_0xa745('0x1c')](_0x5b6786[0x0]),0x5);_0x2d3396[_0xa745('0x1d')](function(_0x27a32e){_0x19d028[_0xa745('0x19')](createTable(_0x27a32e,_0x5b6786));});return _0x19d028;}function getPDFDocDefinition(_0x39f2ee){var _0x3748bc=util[_0xa745('0x1e')](_0xa745('0x1f'),NAME,EXTRACTED_REPORT[_0xa745('0x20')],moment(EXTRACTED_REPORT[_0xa745('0x21')])[_0xa745('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0xa745('0x22')])[_0xa745('0x1e')](FORMAT));var _0x5e17af=[];for(var _0x441d84=0x0;_0x441d84<_0x39f2ee[_0xa745('0x23')];_0x441d84++){var _0x1a15eb=[];if(_0x441d84===0x0){_0x1a15eb['push']({'text':_0x3748bc,'style':_0xa745('0x24')});}var _0x204b93={'table':_0x39f2ee[_0x441d84]};if(_0x441d84>0x0){_0x204b93['pageBreak']='before';_0x204b93[_0xa745('0x25')]=[0x0,0x46,0x0,0x0];}_0x1a15eb[_0xa745('0x19')](_0x204b93);_0x5e17af[_0xa745('0x19')](_0x1a15eb);}return{'pageSize':'A4','pageOrientation':_0xa745('0x26'),'content':_0x5e17af,'footer':function(_0x12ef77,_0x2258ba){return{'text':_0x12ef77[_0xa745('0x14')]()+_0xa745('0x27')+_0x2258ba,'style':_0xa745('0x28')};},'defaultStyle':{'font':_0xa745('0x29')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xa745('0x2a')},'footer':{'alignment':_0xa745('0x2b'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x449706){var _0x3c580a=0x1388;var _0xdbeb4f;if(!_0x449706[0x0][_0xa745('0x2c')]){return analyticExtractedReport(_0xa745('0x2d'));}return db['Setting'][_0xa745('0x2e')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa745('0x2f'),_0xa745('0x30')]})['then'](function(_0x1d54ec){if(_0x1d54ec){_0xdbeb4f=_0x1d54ec;_0x3c580a=_0xdbeb4f[_0xa745('0x30')]||0x3e8;}})['then'](function(){var _0xcb3012=[];var _0x8203cc=0x0;if(_0xdbeb4f[_0xa745('0x2f')]){if(_0x449706&&_0x449706['length']){var _0x415229=_[_0xa745('0x31')](_0x449706[0x0][_0xa745('0x2c')]/_0x3c580a);var _0x432bce=Number[_0xa745('0x32')](_0x449706[0x0][_0xa745('0x2c')]/_0x3c580a)?_0x449706[0x0][_0xa745('0x2c')]%_0x3c580a:0x0;_0x415229['forEach'](function(_0x1ddadf){if(_0x1ddadf>0x0){_0x8203cc+=_0x3c580a;}_0xcb3012[_0xa745('0x19')](dbH['sequelize']['query'](util[_0xa745('0x1e')](_0xa745('0x33'),QUERY,_0x3c580a,_0x8203cc),{'type':dbH[_0xa745('0x34')][_0xa745('0x35')][_0xa745('0x36')]}));});if(_0x432bce>0x0){_0x8203cc+=_0x3c580a;_0xcb3012[_0xa745('0x19')](dbH[_0xa745('0x34')]['query'](util[_0xa745('0x1e')](_0xa745('0x33'),QUERY,_0x432bce,_0x8203cc),{'type':dbH[_0xa745('0x34')][_0xa745('0x35')]['SELECT']}));}}}else{_0xcb3012[_0xa745('0x19')](dbH[_0xa745('0x34')][_0xa745('0x37')](QUERY,{'type':dbH['sequelize'][_0xa745('0x35')]['SELECT']}));}var _0x4ca282=path['dirname'](PATH);var _0x367bbf=path[_0xa745('0x38')](PATH,_0xa745('0x39'));var _0x21b8b1=_0xdbeb4f[_0xa745('0x2f')]&&_0xcb3012[_0xa745('0x23')]>0x1;var _0x38ce72=[];if(!fs[_0xa745('0x3a')](path['join'](_0x4ca282,_0x367bbf))&&_0x21b8b1){fs['mkdirSync'](path[_0xa745('0x3b')](_0x4ca282,_0x367bbf));}return BPromise[_0xa745('0x3c')](_0xcb3012,function(_0x18c5fd){_0x38ce72[_0xa745('0x19')](_0x18c5fd);})[_0xa745('0x3d')](function(){var _0x3e6f37=[];for(var _0x53a8de=0x0;_0x53a8de<_0x38ce72['length'];_0x53a8de+=0x1){var _0x4d2e13=_0x38ce72[_0x53a8de];var _0x40e025=createTables(_[_0xa745('0x3e')](_0x4d2e13));var _0x29f6f3;var _0x4c381a=getPDFDocDefinition(_0x40e025);var _0x460504=getPDFPrinter();var _0x44dd3f=_0x460504['createPdfKitDocument'](_0x4c381a);if(_0x21b8b1){_0x29f6f3=path[_0xa745('0x3b')](_0x4ca282,_0x367bbf,util[_0xa745('0x1e')](_0xa745('0x3f'),_0x367bbf,_0x53a8de,_0xa745('0x40')));}else{_0x29f6f3=path[_0xa745('0x3b')](_0x4ca282,util[_0xa745('0x1e')]('%s.%s',_0x367bbf,_0xa745('0x40')));}_0x3e6f37[_0xa745('0x19')](writePDFDocument(_0x44dd3f,_0x29f6f3));}return Promise['all'](_0x3e6f37);})[_0xa745('0x3d')](function(){if(_0x21b8b1){return new Promise(function(_0x16370a){zipdir(path[_0xa745('0x3b')](_0x4ca282,_0x367bbf),{'saveTo':path[_0xa745('0x3b')](_0x4ca282,util[_0xa745('0x1e')]('%s.%s',_0x367bbf,_0xa745('0x41')))},function(){rimraf(path[_0xa745('0x3b')](_0x4ca282,_0x367bbf),function(){});_0x16370a(_0xa745('0x42'));});});}})[_0xa745('0x3d')](function(){if(!_0x21b8b1)return;rimraf(path[_0xa745('0x3b')](_0x4ca282,_0x367bbf),function(){});})[_0xa745('0x3d')](function(){logger[_0xa745('0x43')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xa745('0x44'),_0x21b8b1?util[_0xa745('0x1e')](_0xa745('0x45'),_0x367bbf,_0x21b8b1?'zip':_0xa745('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xa745('0x1e')](_0xa745('0x46'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xa745('0x47')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xa745('0x3d')](function(_0x1e6d17){EXTRACTED_REPORT=_0x1e6d17;return dbH[_0xa745('0x34')][_0xa745('0x37')](util[_0xa745('0x1e')](_0xa745('0x48'),QUERY),{'type':dbH[_0xa745('0x34')]['QueryTypes'][_0xa745('0x36')]});})['then'](extractReport)[_0xa745('0x49')](function(_0x3ad2df){logger['info'](util[_0xa745('0x1e')](_0xa745('0x4a'),EXTRACTED_REPORT_ID,_0xa745('0x4b')),util[_0xa745('0x4c')](_0x3ad2df,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xa745('0x4d')](function(){process[_0xa745('0x4e')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x32e50d=new PdfPrinter({'Arial':{'normal':__dirname+_0xa745('0x4f'),'bold':__dirname+_0xa745('0x50'),'italics':__dirname+_0xa745('0x51'),'bolditalics':__dirname+_0xa745('0x52')}});return _0x32e50d;}function getPDFDocDefinitionFromHTML(_0x13582b,_0x28089d){var _0x229c2e=util[_0xa745('0x1e')]('%s\x20#%d',_0x28089d['channel'],_0x28089d['interactionId']);var _0x2eaa2c=moment()[_0xa745('0x1e')](_0xa745('0x53'))['toString']();var _0x4ea895=htmlToPdfmake(_0x13582b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4ea895],'defaultStyle':{'font':_0xa745('0x29')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xa745('0x54'),'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':'center'}},'header':function(){return[{'text':_0xa745('0x55'),'style':_0xa745('0x24')}];},'footer':function(_0x4fe610,_0x572223){return[{'text':util[_0xa745('0x1e')](_0xa745('0x56'),_0x229c2e,_0x4fe610,_0x572223,_0x2eaa2c),'style':_0xa745('0x28')}];}};}function writePDFDocument(_0x367404,_0x565b31){return new Promise(function(_0x59dc2f,_0x4f375a){var _0x295f3a=_0x367404[_0xa745('0x57')](fs['createWriteStream'](_0x565b31));_0x295f3a['on'](_0xa745('0x58'),function(){_0x59dc2f('finish');});_0x295f3a['on'](_0xa745('0x59'),function(_0x3a341f){_0x4f375a(_0x3a341f);});_0x367404[_0xa745('0x5a')]();});}exports[_0xa745('0x5b')]=function(_0x1c7a95,_0x5c6e8b){var _0xe59907=getPDFPrinter();var _0x24b75d=getPDFDocDefinitionFromHTML(_0x1c7a95,_0x5c6e8b);var _0xdbcd4f=_0xe59907[_0xa745('0x5c')](_0x24b75d);return writePDFDocument(_0xdbcd4f,_0x5c6e8b[_0xa745('0x2')])[_0xa745('0x49')](function(_0x2e0eb1){throw _0x2e0eb1;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index b0cc6dc..3b26ef5 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 _0xbc95=['query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname','basename','join','each','%s%d.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','XLSX','Completed','%s.%s','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','format','Setting','split','splitSizeXlsx','then','sequelize'];(function(_0x2f7e39,_0x3f178f){var _0xe20481=function(_0x1ffb55){while(--_0x1ffb55){_0x2f7e39['push'](_0x2f7e39['shift']());}};_0xe20481(++_0x3f178f);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xbc95[_0x5ddaac];return _0x2a9c58;};'use strict';var util=require(_0x5bc9('0x0'));var path=require(_0x5bc9('0x1'));var _=require(_0x5bc9('0x2'));var fs=require('fs');var json2xls=require(_0x5bc9('0x3'));var BPromise=require(_0x5bc9('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x5bc9('0x5'))[_0x5bc9('0x6')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x5bc9('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2fb0a2,_0x4bdc20){var _0x49ab1a={'status':_0x2fb0a2};var _0x6cc9f1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4bdc20){_0x49ab1a[_0x5bc9('0x8')]=_0x4bdc20;}return db[_0x5bc9('0x9')][_0x5bc9('0xa')](_0x49ab1a,_0x6cc9f1);}function main(){var _0x24d4b3=0x1388;var _0x2caa35;logger['info'](util[_0x5bc9('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x5bc9('0xc')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5bc9('0xd'),_0x5bc9('0xe')]})[_0x5bc9('0xf')](function(_0x3d60bc){if(_0x3d60bc){_0x2caa35=_0x3d60bc;_0x24d4b3=_0x2caa35[_0x5bc9('0xe')]||0x1388;}})['then'](function(){return dbH[_0x5bc9('0x10')][_0x5bc9('0x11')](util['format'](_0x5bc9('0x12'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x5bc9('0x13')]});})[_0x5bc9('0xf')](function(_0x298800){if(!_0x298800[0x0][_0x5bc9('0x14')]){return analyticExtractedReport(_0x5bc9('0x15'));}var _0x33053f=[];var _0x5db036=0x0;if(_0x2caa35['split']){if(_0x298800&&_0x298800[_0x5bc9('0x16')]){var _0x2db6af=_['range'](_0x298800[0x0][_0x5bc9('0x14')]/_0x24d4b3);var _0x46963b=Number[_0x5bc9('0x17')](_0x298800[0x0]['num']/_0x24d4b3)?_0x298800[0x0][_0x5bc9('0x14')]%_0x24d4b3:0x0;_0x2db6af[_0x5bc9('0x18')](function(_0x3a9007){if(_0x3a9007>0x0){_0x5db036+=_0x24d4b3;}_0x33053f['push'](dbH[_0x5bc9('0x10')]['query'](util[_0x5bc9('0xb')](_0x5bc9('0x19'),QUERY,_0x24d4b3,_0x5db036),{'type':dbH[_0x5bc9('0x10')][_0x5bc9('0x1a')][_0x5bc9('0x13')]}));});if(_0x46963b>0x0){_0x5db036+=_0x24d4b3;_0x33053f['push'](dbH['sequelize'][_0x5bc9('0x11')](util[_0x5bc9('0xb')](_0x5bc9('0x19'),QUERY,_0x46963b,_0x5db036),{'type':dbH[_0x5bc9('0x10')][_0x5bc9('0x1a')][_0x5bc9('0x13')]}));}}}else{_0x33053f[_0x5bc9('0x1b')](dbH[_0x5bc9('0x10')][_0x5bc9('0x11')](QUERY,{'type':dbH['sequelize'][_0x5bc9('0x1a')][_0x5bc9('0x13')]}));}var _0x25b70e=path[_0x5bc9('0x1c')](PATH);var _0x4f6e4b=path[_0x5bc9('0x1d')](PATH,'.xlsx');var _0x358ae1=_0x2caa35[_0x5bc9('0xd')]&&_0x33053f[_0x5bc9('0x16')]>0x1;var _0x15da5d=[];if(!fs['existsSync'](path[_0x5bc9('0x1e')](_0x25b70e,_0x4f6e4b))&&_0x358ae1){fs['mkdirSync'](path['join'](_0x25b70e,_0x4f6e4b));}return BPromise[_0x5bc9('0x1f')](_0x33053f,function(_0x5124db){_0x15da5d[_0x5bc9('0x1b')](_0x5124db);})['then'](function(){for(var _0x5e16a9=0x0;_0x5e16a9<_0x15da5d[_0x5bc9('0x16')];_0x5e16a9+=0x1){var _0x3982e4;var _0x17d53d=_0x15da5d[_0x5e16a9];if(_0x358ae1){_0x3982e4=path[_0x5bc9('0x1e')](_0x25b70e,_0x4f6e4b,util[_0x5bc9('0xb')](_0x5bc9('0x20'),_0x4f6e4b,_0x5e16a9,'xlsx'));}else{_0x3982e4=path['join'](_0x25b70e,util['format']('%s.%s',_0x4f6e4b,_0x5bc9('0x21')));}fs[_0x5bc9('0x22')](_0x3982e4,json2xls(_0x17d53d),_0x5bc9('0x23'));}})[_0x5bc9('0xf')](function(){if(_0x358ae1){return new Promise(function(_0x160c60){zipdir(path[_0x5bc9('0x1e')](_0x25b70e,_0x4f6e4b),{'saveTo':path[_0x5bc9('0x1e')](_0x25b70e,util[_0x5bc9('0xb')]('%s.%s',_0x4f6e4b,_0x5bc9('0x24')))},function(_0x59c5cc,_0x4def17){rimraf(path[_0x5bc9('0x1e')](_0x25b70e,_0x4f6e4b),function(){});_0x160c60(_0x5bc9('0x25'));});});}})[_0x5bc9('0xf')](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x5bc9('0x26')));return analyticExtractedReport(_0x5bc9('0x27'),_0x358ae1?util[_0x5bc9('0xb')](_0x5bc9('0x28'),_0x4f6e4b,_0x358ae1?_0x5bc9('0x24'):_0x5bc9('0x21')):null);});})[_0x5bc9('0x29')](function(_0x2219d5){logger['info'](util[_0x5bc9('0xb')](_0x5bc9('0x2a'),EXTRACTED_REPORT_ID,_0x5bc9('0x26')),util[_0x5bc9('0x2b')](_0x2219d5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5bc9('0x2c'));})[_0x5bc9('0x2d')](function(){process[_0x5bc9('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xfd11=['catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xfd11,0xf5));var _0x1fd1=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0xfd11[_0x11a55c];return _0x26c390;};'use strict';var util=require('util');var path=require(_0x1fd1('0x0'));var _=require(_0x1fd1('0x1'));var fs=require('fs');var json2xls=require(_0x1fd1('0x2'));var BPromise=require('bluebird');var zipdir=require(_0x1fd1('0x3'));var rimraf=require(_0x1fd1('0x4'));var db=require(_0x1fd1('0x5'))['db'];var dbH=require(_0x1fd1('0x5'))[_0x1fd1('0x6')];var logger=require(_0x1fd1('0x7'))(_0x1fd1('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x1fd1('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x53997a,_0x3dad0e){var _0xd6930d={'status':_0x53997a};var _0x3c2546={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3dad0e){_0xd6930d['savename']=_0x3dad0e;}return db[_0x1fd1('0xa')][_0x1fd1('0xb')](_0xd6930d,_0x3c2546);}function main(){var _0x52574b=0x1388;var _0x204abc;logger[_0x1fd1('0xc')](util[_0x1fd1('0xd')](_0x1fd1('0xe'),EXTRACTED_REPORT_ID,_0x1fd1('0xf')));return db['Setting'][_0x1fd1('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x1fd1('0x11')]})[_0x1fd1('0x12')](function(_0x900186){if(_0x900186){_0x204abc=_0x900186;_0x52574b=_0x204abc['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0x1fd1('0x13')][_0x1fd1('0x14')](util[_0x1fd1('0xd')](_0x1fd1('0x15'),QUERY),{'type':dbH[_0x1fd1('0x13')][_0x1fd1('0x16')][_0x1fd1('0x17')]});})[_0x1fd1('0x12')](function(_0x40c5c7){if(!_0x40c5c7[0x0][_0x1fd1('0x18')]){return analyticExtractedReport(_0x1fd1('0x19'));}var _0x3e65ea=[];var _0x5dd06d=0x0;if(_0x204abc['split']){if(_0x40c5c7&&_0x40c5c7[_0x1fd1('0x1a')]){var _0x291949=_[_0x1fd1('0x1b')](_0x40c5c7[0x0][_0x1fd1('0x18')]/_0x52574b);var _0x1af55b=Number['isInteger'](_0x40c5c7[0x0][_0x1fd1('0x18')]/_0x52574b)?_0x40c5c7[0x0][_0x1fd1('0x18')]%_0x52574b:0x0;_0x291949[_0x1fd1('0x1c')](function(_0x5e8136){if(_0x5e8136>0x0){_0x5dd06d+=_0x52574b;}_0x3e65ea['push'](dbH[_0x1fd1('0x13')][_0x1fd1('0x14')](util[_0x1fd1('0xd')](_0x1fd1('0x1d'),QUERY,_0x52574b,_0x5dd06d),{'type':dbH[_0x1fd1('0x13')][_0x1fd1('0x16')][_0x1fd1('0x17')]}));});if(_0x1af55b>0x0){_0x5dd06d+=_0x52574b;_0x3e65ea[_0x1fd1('0x1e')](dbH[_0x1fd1('0x13')]['query'](util[_0x1fd1('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1af55b,_0x5dd06d),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0x3e65ea[_0x1fd1('0x1e')](dbH[_0x1fd1('0x13')][_0x1fd1('0x14')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}var _0x60e918=path[_0x1fd1('0x1f')](PATH);var _0x2343f0=path['basename'](PATH,'.xlsx');var _0x37b769=_0x204abc['split']&&_0x3e65ea[_0x1fd1('0x1a')]>0x1;var _0x328306=[];if(!fs[_0x1fd1('0x20')](path[_0x1fd1('0x21')](_0x60e918,_0x2343f0))&&_0x37b769){fs[_0x1fd1('0x22')](path[_0x1fd1('0x21')](_0x60e918,_0x2343f0));}return BPromise[_0x1fd1('0x23')](_0x3e65ea,function(_0x44a7f3){_0x328306['push'](_0x44a7f3);})[_0x1fd1('0x12')](function(){for(var _0x54618e=0x0;_0x54618e<_0x328306[_0x1fd1('0x1a')];_0x54618e+=0x1){var _0x3690c0;var _0x21e395=_0x328306[_0x54618e];if(_0x37b769){_0x3690c0=path[_0x1fd1('0x21')](_0x60e918,_0x2343f0,util['format'](_0x1fd1('0x24'),_0x2343f0,_0x54618e,_0x1fd1('0x25')));}else{_0x3690c0=path[_0x1fd1('0x21')](_0x60e918,util[_0x1fd1('0xd')]('%s.%s',_0x2343f0,_0x1fd1('0x25')));}fs[_0x1fd1('0x26')](_0x3690c0,json2xls(_0x21e395),'binary');}})[_0x1fd1('0x12')](function(){if(_0x37b769){return new Promise(function(_0x34d674){zipdir(path[_0x1fd1('0x21')](_0x60e918,_0x2343f0),{'saveTo':path[_0x1fd1('0x21')](_0x60e918,util[_0x1fd1('0xd')]('%s.%s',_0x2343f0,_0x1fd1('0x27')))},function(_0x3952a5,_0x2a2eba){rimraf(path[_0x1fd1('0x21')](_0x60e918,_0x2343f0),function(){});_0x34d674(_0x1fd1('0x28'));});});}})[_0x1fd1('0x12')](function(){logger[_0x1fd1('0xc')](util['format'](_0x1fd1('0x29'),EXTRACTED_REPORT_ID,_0x1fd1('0xf')));return analyticExtractedReport(_0x1fd1('0x2a'),_0x37b769?util[_0x1fd1('0xd')]('%s.%s',_0x2343f0,_0x37b769?'zip':'xlsx'):null);});})[_0x1fd1('0x2b')](function(_0x19bc44){logger[_0x1fd1('0xc')](util['format'](_0x1fd1('0x2c'),EXTRACTED_REPORT_ID,_0x1fd1('0xf')),util[_0x1fd1('0x2d')](_0x19bc44,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1fd1('0x2e'));})[_0x1fd1('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index a0d1e63..dfa675a 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 _0xd312=['Hangup','transaction','VoiceExtension','destroy','bulkCreate','sortBy','catch','lodash','util','models','Interval','then','intervals','findAll','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','find','push','Set','format','CDR(type)=%s','type','VoiceExtensionId','inbound','CDR(routeid)=','context','extension','CDR(destination)=','${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}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','tag','outbound','callerID','answer','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat'];(function(_0x57105b,_0xc60612){var _0x1f971f=function(_0x5510da){while(--_0x5510da){_0x57105b['push'](_0x57105b['shift']());}};_0x1f971f(++_0xc60612);}(_0xd312,0x127));var _0x2d31=function(_0x31d82a,_0x50c485){_0x31d82a=_0x31d82a-0x0;var _0x50abe3=_0xd312[_0x31d82a];return _0x50abe3;};'use strict';var _=require(_0x2d31('0x0'));var util=require(_0x2d31('0x1'));function rewrite(_0x212292,_0x3433ed){var _0xe419e4=this;return _0x212292[_0x2d31('0x2')][_0x2d31('0x3')]['findAll']({'raw':!![]})[_0x2d31('0x4')](function(_0xde5e6b){_0xe419e4[_0x2d31('0x5')]=_0xde5e6b;return _0x212292[_0x2d31('0x2')]['VoiceExtension'][_0x2d31('0x6')]({'where':{'IntervalId':_0x3433ed[_0x2d31('0x7')]},'raw':!![]});})[_0x2d31('0x4')](function(_0x15ac0b){return _0x212292['models']['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x2d31('0x8')](_[_0x2d31('0x9')](_0x15ac0b,_0x2d31('0xa')))}},'order':[{'raw':_0x2d31('0xb')}],'raw':!![]});})[_0x2d31('0x4')](function(_0x56925b){var _0x436914=_[_0x2d31('0xc')](_0x56925b,{'priority':'1'});var _0x5431c4=_[_0x2d31('0xc')](_0x56925b,{'isApp':0x1});var _0x6ed205=_[_0x2d31('0xd')](_0x5431c4,_0x2d31('0xa'));var _0x4dd8d9=[_0x2d31('0xe'),_0x2d31('0xf')];var _0x515845=[];var _0x7e11b1=[];for(var _0x422af6 in _0x6ed205){if(_0x6ed205[_0x2d31('0x10')](_0x422af6)){_0xe419e4[_0x2d31('0x11')]=0x2;_0xe419e4[_0x2d31('0x12')]=[];_0xe419e4['extension']=_[_0x2d31('0x13')](_0x436914,{'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')]});_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0]['type'],'app':_0x2d31('0x15'),'appdata':util[_0x2d31('0x16')](_0x2d31('0x17'),_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')]),'context':_0x6ed205[_0x422af6][0x0]['context'],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4['priority']++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});if(_0x6ed205[_0x422af6][0x0]['type']===_0x2d31('0x1a')){_0xe419e4['extensions'][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0]['type'],'app':_0x2d31('0x15'),'appdata':_0x2d31('0x1b')+_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')],'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4['priority']++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});}else if(_0x6ed205[_0x422af6][0x0]['type']==='outbound'){if(_0xe419e4[_0x2d31('0x1d')]){_0xe419e4[_0x2d31('0x12')]['push']({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':_0x2d31('0x15'),'appdata':_0x2d31('0x1e')+(_0xe419e4[_0x2d31('0x1d')]['cutdigits']?_0x2d31('0x1f')+_0xe419e4[_0x2d31('0x1d')][_0x2d31('0x20')]+'}':_0x2d31('0x21')),'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});}_0xe419e4['extensions'][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':_0x2d31('0x15'),'appdata':_0x2d31('0x1b')+_0x6ed205[_0x422af6][0x0]['VoiceExtensionId'],'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0]['VoiceExtensionId']});var _0x26a75e=_0xe419e4[_0x2d31('0x11')]++;_0xe419e4[_0x2d31('0x12')]['push']({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':_0x2d31('0x22'),'appdata':_0x2d31('0x23')+(_0x26a75e+0x2)+_0x2d31('0x24')+(_0x26a75e+0x1)+')','context':_0x6ed205[_0x422af6][0x0]['context'],'exten':_0x6ed205[_0x422af6][0x0]['exten'],'priority':_0x26a75e,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});if(_0xe419e4['extension']){_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':_0x2d31('0x15'),'appdata':_0xe419e4[_0x2d31('0x1d')]['cutdigits']?_0x2d31('0x25')+_0xe419e4[_0x2d31('0x1d')][_0x2d31('0x20')]+'}':_0x2d31('0x26'),'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4['priority']++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0]['VoiceExtensionId']});}_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':'Set','appdata':_0x2d31('0x27')+_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')],'context':_0x6ed205[_0x422af6][0x0]['context'],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0]['VoiceExtensionId']});if(_0xe419e4[_0x2d31('0x1d')]&&_0xe419e4[_0x2d31('0x1d')][_0x2d31('0x10')](_0x2d31('0x28'))&&_0xe419e4[_0x2d31('0x1d')][_0x2d31('0x28')]!==_0x2d31('0x29')){_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':'Set','appdata':_0x2d31('0x2a'),'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0]['type'],'app':_0x2d31('0x15'),'appdata':_0x2d31('0x2b')+_0xe419e4['extension'][_0x2d31('0x28')]||_0x2d31('0x2c'),'context':_0x6ed205[_0x422af6][0x0]['context'],'exten':_0x6ed205[_0x422af6][0x0]['exten'],'priority':_0xe419e4['priority']++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});}}_0xe419e4[_0x2d31('0x12')]['push']({'type':_0x6ed205[_0x422af6][0x0]['type'],'app':_0x2d31('0x15'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x6ed205[_0x422af6][0x0]['context'],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':_0x2d31('0x15'),'appdata':_0x2d31('0x2d'),'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0]['exten'],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':'Set','appdata':_0x2d31('0x2e'),'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});for(var _0x4225d5=0x0,_0x21c5f5=0x0;_0x4225d5<_0x6ed205[_0x422af6][_0x2d31('0x2f')];_0x4225d5+=0x1,_0x21c5f5=0x0){var _0x5d4d8f=_0x6ed205[_0x422af6][_0x4225d5];if(_0x5d4d8f['type']){_0x5d4d8f[_0x2d31('0x18')]=_0x5d4d8f[_0x2d31('0x18')][_0x2d31('0x30')]();}var _0x4abe9d=[];var _0x53059f=[];delete _0x5d4d8f['id'];delete _0x5d4d8f[_0x2d31('0x31')];delete _0x5d4d8f['updatedAt'];var _0x251fa3=_0x5d4d8f[_0x2d31('0x32')]!==_0x2d31('0x33')?[_0x5d4d8f[_0x2d31('0x32')]]:_0x5d4d8f[_0x2d31('0x7')]?_[_0x2d31('0x9')](_[_0x2d31('0xc')](_0xe419e4['intervals'],{'IntervalId':_0x5d4d8f['IntervalId']}),_0x2d31('0x32')):[];if(_0x5d4d8f[_0x2d31('0x10')](_0x2d31('0x34'))){if(_0x5d4d8f[_0x2d31('0x34')]&&_0x5d4d8f[_0x2d31('0x34')]!=='--'){_0x4abe9d['push']({'type':_0x5d4d8f[_0x2d31('0x18')],'app':'Set','appdata':'CDR(tag)='+_0x5d4d8f[_0x2d31('0x34')],'context':_0x5d4d8f['context'],'exten':_0x5d4d8f[_0x2d31('0xa')],'priority':_0x251fa3[_0x2d31('0x2f')]+_0xe419e4[_0x2d31('0x11')]+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});}}if(_0x5d4d8f[_0x2d31('0x18')]===_0x2d31('0x35')&&_0x5d4d8f[_0x2d31('0x10')]('callerID')){if(_0x5d4d8f['callerID']){_0x4abe9d[_0x2d31('0x14')]({'type':_0x5d4d8f['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x5d4d8f[_0x2d31('0x36')]+')','context':_0x5d4d8f[_0x2d31('0x1c')],'exten':_0x5d4d8f[_0x2d31('0xa')],'priority':_0x251fa3[_0x2d31('0x2f')]+_0xe419e4['priority']+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});}else{_0x4abe9d[_0x2d31('0x14')]({'type':_0x5d4d8f[_0x2d31('0x18')],'app':_0x2d31('0x22'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x5d4d8f[_0x2d31('0x1c')],'exten':_0x5d4d8f[_0x2d31('0xa')],'priority':_0x251fa3['length']+_0xe419e4[_0x2d31('0x11')]+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});}}if(_0x5d4d8f['hasOwnProperty'](_0x2d31('0x37'))){if(_0x4dd8d9['indexOf'](_0x5d4d8f[_0x2d31('0x38')][_0x2d31('0x30')]())>=0x0&&_0x5d4d8f[_0x2d31('0x39')]!=='custom'){if(_0x5d4d8f[_0x2d31('0x37')]){_0x4abe9d[_0x2d31('0x14')]({'type':_0x5d4d8f[_0x2d31('0x18')],'app':'ExecIf','appdata':_0x2d31('0x3a'),'context':_0x5d4d8f[_0x2d31('0x1c')],'exten':_0x5d4d8f['exten'],'priority':_0x251fa3[_0x2d31('0x2f')]+_0xe419e4[_0x2d31('0x11')]+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});_0x4abe9d[_0x2d31('0x14')]({'type':_0x5d4d8f[_0x2d31('0x18')],'app':'Set','appdata':_0x2d31('0x3b'),'context':_0x5d4d8f[_0x2d31('0x1c')],'exten':_0x5d4d8f['exten'],'priority':_0x251fa3['length']+_0xe419e4['priority']+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});}else{_0x4abe9d[_0x2d31('0x14')]({'type':_0x5d4d8f['type'],'app':_0x2d31('0x22'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x5d4d8f[_0x2d31('0x1c')],'exten':_0x5d4d8f[_0x2d31('0xa')],'priority':_0x251fa3[_0x2d31('0x2f')]+_0xe419e4[_0x2d31('0x11')]+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});_0x4abe9d[_0x2d31('0x14')]({'type':_0x5d4d8f[_0x2d31('0x18')],'app':_0x2d31('0x15'),'appdata':_0x2d31('0x3c'),'context':_0x5d4d8f[_0x2d31('0x1c')],'exten':_0x5d4d8f[_0x2d31('0xa')],'priority':_0x251fa3[_0x2d31('0x2f')]+_0xe419e4['priority']+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});}}}for(var _0x195ff7=0x0;_0x195ff7<_0x251fa3[_0x2d31('0x2f')];_0x195ff7+=0x1){var _0x21e843=_0xe419e4[_0x2d31('0x11')]+_0x251fa3['length'];var _0x4cfa45=_0x195ff7===_0x251fa3[_0x2d31('0x2f')]-0x1?_0xe419e4[_0x2d31('0x11')]+_0x4abe9d[_0x2d31('0x2f')]+_0x53059f[_0x2d31('0x2f')]+0x2:_0xe419e4[_0x2d31('0x11')]+_0x195ff7+0x1;_0x4abe9d[_0x2d31('0x3d')](_0x195ff7,0x0,{'type':_0x5d4d8f['type'],'app':'GotoIfTime','appdata':_0x251fa3[_0x195ff7]+'?'+_0x5d4d8f[_0x2d31('0x1c')]+_0x2d31('0x3e')+_0x21e843+':'+_0x5d4d8f[_0x2d31('0x1c')]+',${EXTEN},'+_0x4cfa45,'exten':_0x5d4d8f[_0x2d31('0xa')],'context':_0x5d4d8f['context'],'priority':_0xe419e4[_0x2d31('0x11')]+_0x195ff7,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});}_0x5d4d8f[_0x2d31('0x11')]=_0x4abe9d[_0x2d31('0x2f')]?_[_0x2d31('0x3f')](_0x4abe9d)[_0x2d31('0x11')]+0x1:_0xe419e4['priority'];_0xe419e4[_0x2d31('0x11')]=(_0x53059f[_0x2d31('0x2f')]?_[_0x2d31('0x3f')](_0x53059f)[_0x2d31('0x11')]:_0x5d4d8f['priority'])+0x1;_0xe419e4[_0x2d31('0x12')]=_[_0x2d31('0x40')](_0xe419e4['extensions'],_0x4abe9d,[_0x5d4d8f],_0x53059f);}_0xe419e4[_0x2d31('0x12')]['push']({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':_0x2d31('0x41'),'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'priority':_0xe419e4[_0x2d31('0x11')],'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});_0x515845[_0x2d31('0x14')](_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]);_0x7e11b1=_[_0x2d31('0x40')](_0x7e11b1,_0xe419e4[_0x2d31('0x12')]);}}return _0x212292[_0x2d31('0x42')](function(_0xede158){return _0x212292[_0x2d31('0x2')][_0x2d31('0x43')][_0x2d31('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x515845}},'transaction':_0xede158})[_0x2d31('0x4')](function(_0x6be523){return _0x212292['models'][_0x2d31('0x43')][_0x2d31('0x45')](_[_0x2d31('0x46')](_0x7e11b1,'priority'),{'transaction':_0xede158});});});})[_0x2d31('0x47')](function(_0x45bf1f){console['error'](_0x45bf1f);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x59ce=['CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','IntervalId','interval','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','push','CDR(routeid)=','outbound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x59ce,0x15f));var _0xe59c=function(_0x15200b,_0x3bd575){_0x15200b=_0x15200b-0x0;var _0x110a89=_0x59ce[_0x15200b];return _0x110a89;};'use strict';var _=require(_0xe59c('0x0'));var util=require(_0xe59c('0x1'));function rewrite(_0x536565,_0x1b19ec){var _0x4dd76a=this;return _0x536565[_0xe59c('0x2')][_0xe59c('0x3')][_0xe59c('0x4')]({'raw':!![]})[_0xe59c('0x5')](function(_0x16e1d2){_0x4dd76a[_0xe59c('0x6')]=_0x16e1d2;return _0x536565[_0xe59c('0x2')][_0xe59c('0x7')][_0xe59c('0x4')]({'where':{'IntervalId':_0x1b19ec['IntervalId']},'raw':!![]});})[_0xe59c('0x5')](function(_0x387472){return _0x536565[_0xe59c('0x2')][_0xe59c('0x7')]['findAll']({'where':{'exten':{'$in':_[_0xe59c('0x8')](_['map'](_0x387472,_0xe59c('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xe59c('0x5')](function(_0x16727a){var _0x2594fe=_[_0xe59c('0xa')](_0x16727a,{'priority':'1'});var _0xc7bc79=_[_0xe59c('0xa')](_0x16727a,{'isApp':0x1});var _0x1735ee=_[_0xe59c('0xb')](_0xc7bc79,_0xe59c('0x9'));var _0x2c0015=[_0xe59c('0xc'),_0xe59c('0xd')];var _0x1d854b=[];var _0x3dd4a3=[];for(var _0x42372a in _0x1735ee){if(_0x1735ee[_0xe59c('0xe')](_0x42372a)){_0x4dd76a[_0xe59c('0xf')]=0x2;_0x4dd76a[_0xe59c('0x10')]=[];_0x4dd76a[_0xe59c('0x11')]=_[_0xe59c('0x12')](_0x2594fe,{'exten':_0x1735ee[_0x42372a][0x0][_0xe59c('0x9')]});_0x4dd76a[_0xe59c('0x10')]['push']({'type':_0x1735ee[_0x42372a][0x0]['type'],'app':_0xe59c('0x13'),'appdata':util[_0xe59c('0x14')](_0xe59c('0x15'),_0x1735ee[_0x42372a][0x0][_0xe59c('0x16')]),'context':_0x1735ee[_0x42372a][0x0][_0xe59c('0x17')],'exten':_0x1735ee[_0x42372a][0x0]['exten'],'priority':_0x4dd76a[_0xe59c('0xf')]++,'VoiceExtensionId':_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')]});if(_0x1735ee[_0x42372a][0x0][_0xe59c('0x16')]===_0xe59c('0x19')){_0x4dd76a['extensions'][_0xe59c('0x1a')]({'type':_0x1735ee[_0x42372a][0x0][_0xe59c('0x16')],'app':_0xe59c('0x13'),'appdata':_0xe59c('0x1b')+_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')],'context':_0x1735ee[_0x42372a][0x0]['context'],'exten':_0x1735ee[_0x42372a][0x0]['exten'],'priority':_0x4dd76a['priority']++,'VoiceExtensionId':_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')]});}else if(_0x1735ee[_0x42372a][0x0]['type']===_0xe59c('0x1c')){if(_0x4dd76a[_0xe59c('0x11')]){_0x4dd76a[_0xe59c('0x10')][_0xe59c('0x1a')]({'type':_0x1735ee[_0x42372a][0x0][_0xe59c('0x16')],'app':_0xe59c('0x13'),'appdata':_0xe59c('0x1d')+(_0x4dd76a[_0xe59c('0x11')][_0xe59c('0x1e')]?_0xe59c('0x1f')+_0x4dd76a[_0xe59c('0x11')][_0xe59c('0x1e')]+'}':_0xe59c('0x20')),'context':_0x1735ee[_0x42372a][0x0]['context'],'exten':_0x1735ee[_0x42372a][0x0][_0xe59c('0x9')],'priority':_0x4dd76a[_0xe59c('0xf')]++,'VoiceExtensionId':_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')]});}_0x4dd76a[_0xe59c('0x10')][_0xe59c('0x1a')]({'type':_0x1735ee[_0x42372a][0x0][_0xe59c('0x16')],'app':_0xe59c('0x13'),'appdata':'CDR(routeid)='+_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')],'context':_0x1735ee[_0x42372a][0x0][_0xe59c('0x17')],'exten':_0x1735ee[_0x42372a][0x0]['exten'],'priority':_0x4dd76a[_0xe59c('0xf')]++,'VoiceExtensionId':_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')]});var _0x147150=_0x4dd76a['priority']++;_0x4dd76a['extensions']['push']({'type':_0x1735ee[_0x42372a][0x0]['type'],'app':'ExecIf','appdata':_0xe59c('0x21')+(_0x147150+0x2)+_0xe59c('0x22')+(_0x147150+0x1)+')','context':_0x1735ee[_0x42372a][0x0]['context'],'exten':_0x1735ee[_0x42372a][0x0][_0xe59c('0x9')],'priority':_0x147150,'VoiceExtensionId':_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')]});if(_0x4dd76a[_0xe59c('0x11')]){_0x4dd76a['extensions'][_0xe59c('0x1a')]({'type':_0x1735ee[_0x42372a][0x0][_0xe59c('0x16')],'app':'Set','appdata':_0x4dd76a[_0xe59c('0x11')][_0xe59c('0x1e')]?_0xe59c('0x23')+_0x4dd76a[_0xe59c('0x11')][_0xe59c('0x1e')]+'}':_0xe59c('0x24'),'context':_0x1735ee[_0x42372a][0x0][_0xe59c('0x17')],'exten':_0x1735ee[_0x42372a][0x0][_0xe59c('0x9')],'priority':_0x4dd76a[_0xe59c('0xf')]++,'VoiceExtensionId':_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')]});}_0x4dd76a['extensions']['push']({'type':_0x1735ee[_0x42372a][0x0][_0xe59c('0x16')],'app':_0xe59c('0x13'),'appdata':'outboundrouteid='+_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')],'context':_0x1735ee[_0x42372a][0x0][_0xe59c('0x17')],'exten':_0x1735ee[_0x42372a][0x0][_0xe59c('0x9')],'priority':_0x4dd76a[_0xe59c('0xf')]++,'VoiceExtensionId':_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')]});if(_0x4dd76a[_0xe59c('0x11')]&&_0x4dd76a[_0xe59c('0x11')][_0xe59c('0xe')](_0xe59c('0x25'))&&_0x4dd76a[_0xe59c('0x11')][_0xe59c('0x25')]!==_0xe59c('0x26')){_0x4dd76a[_0xe59c('0x10')]['push']({'type':_0x1735ee[_0x42372a][0x0][_0xe59c('0x16')],'app':_0xe59c('0x13'),'appdata':_0xe59c('0x27'),'context':_0x1735ee[_0x42372a][0x0][_0xe59c('0x17')],'exten':_0x1735ee[_0x42372a][0x0][_0xe59c('0x9')],'priority':_0x4dd76a[_0xe59c('0xf')]++,'VoiceExtensionId':_0x1735ee[_0x42372a][0x0]['VoiceExtensionId']});_0x4dd76a[_0xe59c('0x10')]['push']({'type':_0x1735ee[_0x42372a][0x0]['type'],'app':_0xe59c('0x13'),'appdata':_0xe59c('0x28')+_0x4dd76a['extension'][_0xe59c('0x25')]||_0xe59c('0x29'),'context':_0x1735ee[_0x42372a][0x0][_0xe59c('0x17')],'exten':_0x1735ee[_0x42372a][0x0][_0xe59c('0x9')],'priority':_0x4dd76a[_0xe59c('0xf')]++,'VoiceExtensionId':_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')]});}}_0x4dd76a[_0xe59c('0x10')]['push']({'type':_0x1735ee[_0x42372a][0x0][_0xe59c('0x16')],'app':_0xe59c('0x13'),'appdata':_0xe59c('0x2a'),'context':_0x1735ee[_0x42372a][0x0]['context'],'exten':_0x1735ee[_0x42372a][0x0][_0xe59c('0x9')],'priority':_0x4dd76a['priority']++,'VoiceExtensionId':_0x1735ee[_0x42372a][0x0]['VoiceExtensionId']});_0x4dd76a[_0xe59c('0x10')][_0xe59c('0x1a')]({'type':_0x1735ee[_0x42372a][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1735ee[_0x42372a][0x0]['context'],'exten':_0x1735ee[_0x42372a][0x0][_0xe59c('0x9')],'priority':_0x4dd76a[_0xe59c('0xf')]++,'VoiceExtensionId':_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')]});_0x4dd76a['extensions'][_0xe59c('0x1a')]({'type':_0x1735ee[_0x42372a][0x0][_0xe59c('0x16')],'app':_0xe59c('0x13'),'appdata':_0xe59c('0x2b'),'context':_0x1735ee[_0x42372a][0x0]['context'],'exten':_0x1735ee[_0x42372a][0x0]['exten'],'priority':_0x4dd76a['priority']++,'VoiceExtensionId':_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')]});for(var _0x5e8683=0x0,_0x3fd998=0x0;_0x5e8683<_0x1735ee[_0x42372a][_0xe59c('0x2c')];_0x5e8683+=0x1,_0x3fd998=0x0){var _0x5e8fc6=_0x1735ee[_0x42372a][_0x5e8683];if(_0x5e8fc6[_0xe59c('0x16')]){_0x5e8fc6[_0xe59c('0x16')]=_0x5e8fc6[_0xe59c('0x16')]['toLowerCase']();}var _0x28be60=[];var _0x3fa8f0=[];delete _0x5e8fc6['id'];delete _0x5e8fc6[_0xe59c('0x2d')];delete _0x5e8fc6[_0xe59c('0x2e')];var _0xa8e281=_0x5e8fc6['interval']!=='*,*,*,*'?[_0x5e8fc6['interval']]:_0x5e8fc6['IntervalId']?_['map'](_[_0xe59c('0xa')](_0x4dd76a['intervals'],{'IntervalId':_0x5e8fc6[_0xe59c('0x2f')]}),_0xe59c('0x30')):[];if(_0x5e8fc6[_0xe59c('0xe')](_0xe59c('0x31'))){if(_0x5e8fc6[_0xe59c('0x31')]&&_0x5e8fc6['tag']!=='--'){_0x28be60[_0xe59c('0x1a')]({'type':_0x5e8fc6[_0xe59c('0x16')],'app':_0xe59c('0x13'),'appdata':_0xe59c('0x32')+_0x5e8fc6[_0xe59c('0x31')],'context':_0x5e8fc6[_0xe59c('0x17')],'exten':_0x5e8fc6[_0xe59c('0x9')],'priority':_0xa8e281['length']+_0x4dd76a[_0xe59c('0xf')]+_0x3fd998++,'VoiceExtensionId':_0x5e8fc6[_0xe59c('0x18')]});}}if(_0x5e8fc6['type']===_0xe59c('0x1c')&&_0x5e8fc6[_0xe59c('0xe')]('callerID')){if(_0x5e8fc6['callerID']){_0x28be60[_0xe59c('0x1a')]({'type':_0x5e8fc6[_0xe59c('0x16')],'app':_0xe59c('0x33'),'appdata':_0xe59c('0x34')+_0x5e8fc6[_0xe59c('0x35')]+')','context':_0x5e8fc6['context'],'exten':_0x5e8fc6[_0xe59c('0x9')],'priority':_0xa8e281[_0xe59c('0x2c')]+_0x4dd76a['priority']+_0x3fd998++,'VoiceExtensionId':_0x5e8fc6[_0xe59c('0x18')]});}else{_0x28be60[_0xe59c('0x1a')]({'type':_0x5e8fc6[_0xe59c('0x16')],'app':_0xe59c('0x33'),'appdata':_0xe59c('0x36'),'context':_0x5e8fc6['context'],'exten':_0x5e8fc6[_0xe59c('0x9')],'priority':_0xa8e281[_0xe59c('0x2c')]+_0x4dd76a[_0xe59c('0xf')]+_0x3fd998++,'VoiceExtensionId':_0x5e8fc6[_0xe59c('0x18')]});}}if(_0x5e8fc6['hasOwnProperty'](_0xe59c('0x37'))){if(_0x2c0015[_0xe59c('0x38')](_0x5e8fc6[_0xe59c('0x39')][_0xe59c('0x3a')]())>=0x0&&_0x5e8fc6[_0xe59c('0x3b')]!==_0xe59c('0x3c')){if(_0x5e8fc6['answer']){_0x28be60[_0xe59c('0x1a')]({'type':_0x5e8fc6[_0xe59c('0x16')],'app':_0xe59c('0x33'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5e8fc6['context'],'exten':_0x5e8fc6[_0xe59c('0x9')],'priority':_0xa8e281['length']+_0x4dd76a['priority']+_0x3fd998++,'VoiceExtensionId':_0x5e8fc6['VoiceExtensionId']});_0x28be60[_0xe59c('0x1a')]({'type':_0x5e8fc6[_0xe59c('0x16')],'app':'Set','appdata':_0xe59c('0x3d'),'context':_0x5e8fc6[_0xe59c('0x17')],'exten':_0x5e8fc6[_0xe59c('0x9')],'priority':_0xa8e281[_0xe59c('0x2c')]+_0x4dd76a[_0xe59c('0xf')]+_0x3fd998++,'VoiceExtensionId':_0x5e8fc6[_0xe59c('0x18')]});}else{_0x28be60[_0xe59c('0x1a')]({'type':_0x5e8fc6[_0xe59c('0x16')],'app':_0xe59c('0x33'),'appdata':_0xe59c('0x3e'),'context':_0x5e8fc6[_0xe59c('0x17')],'exten':_0x5e8fc6[_0xe59c('0x9')],'priority':_0xa8e281[_0xe59c('0x2c')]+_0x4dd76a[_0xe59c('0xf')]+_0x3fd998++,'VoiceExtensionId':_0x5e8fc6['VoiceExtensionId']});_0x28be60[_0xe59c('0x1a')]({'type':_0x5e8fc6[_0xe59c('0x16')],'app':_0xe59c('0x13'),'appdata':_0xe59c('0x3f'),'context':_0x5e8fc6[_0xe59c('0x17')],'exten':_0x5e8fc6[_0xe59c('0x9')],'priority':_0xa8e281[_0xe59c('0x2c')]+_0x4dd76a[_0xe59c('0xf')]+_0x3fd998++,'VoiceExtensionId':_0x5e8fc6[_0xe59c('0x18')]});}}}for(var _0x567404=0x0;_0x567404<_0xa8e281[_0xe59c('0x2c')];_0x567404+=0x1){var _0x5b6de0=_0x4dd76a['priority']+_0xa8e281[_0xe59c('0x2c')];var _0x472feb=_0x567404===_0xa8e281[_0xe59c('0x2c')]-0x1?_0x4dd76a['priority']+_0x28be60['length']+_0x3fa8f0[_0xe59c('0x2c')]+0x2:_0x4dd76a[_0xe59c('0xf')]+_0x567404+0x1;_0x28be60[_0xe59c('0x40')](_0x567404,0x0,{'type':_0x5e8fc6[_0xe59c('0x16')],'app':_0xe59c('0x41'),'appdata':_0xa8e281[_0x567404]+'?'+_0x5e8fc6[_0xe59c('0x17')]+_0xe59c('0x42')+_0x5b6de0+':'+_0x5e8fc6[_0xe59c('0x17')]+_0xe59c('0x42')+_0x472feb,'exten':_0x5e8fc6[_0xe59c('0x9')],'context':_0x5e8fc6[_0xe59c('0x17')],'priority':_0x4dd76a['priority']+_0x567404,'VoiceExtensionId':_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')]});}_0x5e8fc6['priority']=_0x28be60[_0xe59c('0x2c')]?_['last'](_0x28be60)[_0xe59c('0xf')]+0x1:_0x4dd76a[_0xe59c('0xf')];_0x4dd76a[_0xe59c('0xf')]=(_0x3fa8f0['length']?_[_0xe59c('0x43')](_0x3fa8f0)[_0xe59c('0xf')]:_0x5e8fc6[_0xe59c('0xf')])+0x1;_0x4dd76a[_0xe59c('0x10')]=_[_0xe59c('0x44')](_0x4dd76a[_0xe59c('0x10')],_0x28be60,[_0x5e8fc6],_0x3fa8f0);}_0x4dd76a[_0xe59c('0x10')]['push']({'type':_0x1735ee[_0x42372a][0x0][_0xe59c('0x16')],'app':_0xe59c('0x45'),'exten':_0x1735ee[_0x42372a][0x0][_0xe59c('0x9')],'context':_0x1735ee[_0x42372a][0x0][_0xe59c('0x17')],'priority':_0x4dd76a[_0xe59c('0xf')],'VoiceExtensionId':_0x1735ee[_0x42372a][0x0]['VoiceExtensionId']});_0x1d854b['push'](_0x1735ee[_0x42372a][0x0][_0xe59c('0x18')]);_0x3dd4a3=_[_0xe59c('0x44')](_0x3dd4a3,_0x4dd76a['extensions']);}}return _0x536565[_0xe59c('0x46')](function(_0x33601f){return _0x536565[_0xe59c('0x2')]['VoiceExtension'][_0xe59c('0x47')]({'where':{'VoiceExtensionId':{'$in':_0x1d854b}},'transaction':_0x33601f})[_0xe59c('0x5')](function(_0x3c9dc8){return _0x536565['models'][_0xe59c('0x7')][_0xe59c('0x48')](_[_0xe59c('0x49')](_0x3dd4a3,'priority'),{'transaction':_0x33601f});});});})['catch'](function(_0x4ffe91){console[_0xe59c('0x4a')](_0x4ffe91);});}exports[_0xe59c('0x4b')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 547572d..ed500d3 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 _0xa8df=['checkHopper','inspect','insert','into','cm_hopper','fromQuery','createdAt','updatedAt','select','field','NOW()','scheduledAt','ContactId','toString','ListId','where','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','ListId\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_contacts','phone\x20IS\x20NOT\x20NULL','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','ioredis','../../../config/environment','../../../config/logger','api','defaults','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','map','errors','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!','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact'];(function(_0x52c2f4,_0xff60b0){var _0x5d6579=function(_0x1effba){while(--_0x1effba){_0x52c2f4['push'](_0x52c2f4['shift']());}};_0x5d6579(++_0xff60b0);}(_0xa8df,0x184));var _0xfa8d=function(_0x25c370,_0x101f9c){_0x25c370=_0x25c370-0x0;var _0x32dacb=_0xa8df[_0x25c370];return _0x32dacb;};'use strict';var BPromise=require(_0xfa8d('0x0'));var util=require(_0xfa8d('0x1'));var _=require(_0xfa8d('0x2'));var fs=require('fs');var squel=require(_0xfa8d('0x3'));var Papa=require('papaparse');var Redis=require(_0xfa8d('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0xfa8d('0x5'));var logger=require(_0xfa8d('0x6'))(_0xfa8d('0x7'));config['redis']=_[_0xfa8d('0x8')](config[_0xfa8d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa8d('0xa'))(new Redis(config[_0xfa8d('0x9')]));require(_0xfa8d('0xb'))[_0xfa8d('0xc')](socket);try{if(!process[_0xfa8d('0xd')][0x2]||process[_0xfa8d('0xd')][0x2]===_0xfa8d('0xe')||process[_0xfa8d('0xd')][0x2]===_0xfa8d('0xf')){throw new Error(_0xfa8d('0x10'));}var FILEPATH=process[_0xfa8d('0xd')][0x2];if(!process['argv'][0x3]||process[_0xfa8d('0xd')][0x3]===_0xfa8d('0xe')||process[_0xfa8d('0xd')][0x3]===_0xfa8d('0xf')||!process[_0xfa8d('0xd')][0x4]||process[_0xfa8d('0xd')][0x4]===_0xfa8d('0xe')||process[_0xfa8d('0xd')][0x4]===_0xfa8d('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xfa8d('0x11')](process[_0xfa8d('0xd')][0x3]['split'](','),process[_0xfa8d('0xd')][0x4][_0xfa8d('0x12')](','));if(!process[_0xfa8d('0xd')][0x5]||process[_0xfa8d('0xd')][0x5]==='undefined'||process[_0xfa8d('0xd')][0x5]===_0xfa8d('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xfa8d('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xfa8d('0xd')][0x6]!==_0xfa8d('0xe')&&process['argv'][0x6]!==_0xfa8d('0xf')?process[_0xfa8d('0xd')][0x6]:null;var DUPLICATES=process[_0xfa8d('0xd')][0x7]&&process[_0xfa8d('0xd')][0x7]!==_0xfa8d('0xe')&&process[_0xfa8d('0xd')][0x7]!==_0xfa8d('0xf')?process[_0xfa8d('0xd')][0x7]:null;if(!process[_0xfa8d('0xd')][0x8]||process['argv'][0x8]===_0xfa8d('0xe')||process[_0xfa8d('0xd')][0x8]==='null'){throw new Error(_0xfa8d('0x13'));}var SOCKET_TIMESTAMP=process[_0xfa8d('0xd')][0x8];}catch(_0x1f810e){logger[_0xfa8d('0x14')](_0x1f810e);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(_0x47c14c,_0x5a7954,_0x364c59,_0x128426){var _0x4ffe79={'message':_0x5a7954};_0x4ffe79[_0x47c14c]=!![];if(_0x364c59){_0x4ffe79['contact']=_0x364c59;}if(_0x128426){_0x4ffe79[_0xfa8d('0x15')]=_0x128426;}return _0x4ffe79;}function isEmail(_0x915f0d){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))*$/[_0xfa8d('0x16')](_0x915f0d);}function checkRow(_0x5428a1,_0x3c32be,_0x1c6ca0){return new BPromise(function(_0x64108c,_0x4c772c){if(_[_0xfa8d('0x17')](_0x5428a1)){return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x1c6ca0));}if(_0x5428a1['errors']&&_0x5428a1['errors']['length']){var _0x58011d=_[_0xfa8d('0x18')](_0x5428a1[_0xfa8d('0x19')],'message')['join'](';');return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),_0x58011d,null,_0x1c6ca0));}var _0xa55ec0={};for(var _0x863d90 in FIELDS){if(FIELDS[_0xfa8d('0x1a')](_0x863d90)&&FIELDS[_0x863d90]){_0xa55ec0[_0x863d90]=_0x5428a1[_0xfa8d('0x1b')][0x0][FIELDS[_0x863d90]]||_0x5428a1[_0xfa8d('0x1b')][0x0]['\ufeff'+FIELDS[_0x863d90]];}}if(!_0xa55ec0[_0xfa8d('0x1c')]){return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),_0xfa8d('0x1d'),null,_0x1c6ca0));}if(!_0xa55ec0[_0xfa8d('0x1e')]){return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),_0xfa8d('0x1f'),null,_0x1c6ca0));}if(_0xa55ec0['birthDate']){var _0x2dec5f=moment(_0xa55ec0[_0xfa8d('0x20')],_0xfa8d('0x21'));if(!_0x2dec5f[_0xfa8d('0x22')]()){return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),_0xfa8d('0x23'),null,_0x1c6ca0));}}if(_0xa55ec0[_0xfa8d('0x24')]){if(!isEmail(_0xa55ec0[_0xfa8d('0x24')])){return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),_0xfa8d('0x25'),null,_0x1c6ca0));}}_0xa55ec0['ListId']=LISTID;_0xa55ec0[_0xfa8d('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xfa8d('0x27')]&&_0x3c32be){var _0x40f7c3={};for(var _0x158bac=0x0,_0x753c0=DUPLICATES['length'];_0x158bac<_0x753c0;_0x158bac+=0x1){_0x40f7c3[DUPLICATES[_0x158bac]]=_0xa55ec0[DUPLICATES[_0x158bac]];}var _0x4b23cd=_[_0xfa8d('0x28')](_0x3c32be,_0x40f7c3);if(_0x4b23cd){return _0x4c772c(handleCheckRowError(_0xfa8d('0x29'),_0xfa8d('0x2a'),_0x4b23cd,_0x1c6ca0));}}return db[_0xfa8d('0x2b')][_0xfa8d('0x2c')](_0xa55ec0,{'raw':!![],'hooks':![],'fields':_['keys'](_0xa55ec0)})['then'](function(_0x1581c3){if(DUPLICATES&&DUPLICATES[_0xfa8d('0x27')]&&_0x3c32be){_0x3c32be[_0xfa8d('0x2d')](_[_0xfa8d('0x2e')](_0xa55ec0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1581c3['id'];return _0x64108c();})[_0xfa8d('0x2f')](function(_0x146d63){return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),_0xfa8d('0x30')+(_0x146d63[_0xfa8d('0x31')]||JSON[_0xfa8d('0x32')](_0x146d63)),null,_0x1c6ca0));});});}function checkHopper(){function _0x4cdd29(){return function(_0x450025){logger[_0xfa8d('0x14')](_0xfa8d('0x33'),_0xfa8d('0x34'),util[_0xfa8d('0x35')](_0x450025,{'showHidden':![],'depth':null}));};}var _0x3b4ffc=function(_0x4f6da3,_0x24422e){var _0x330a4e=squel[_0xfa8d('0x36')]()[_0xfa8d('0x37')](_0xfa8d('0x38'))[_0xfa8d('0x39')]([_0xfa8d('0x1e'),'scheduledAt','ContactId','ListId',_0x24422e,_0xfa8d('0x3a'),_0xfa8d('0x3b')],squel[_0xfa8d('0x3c')]()[_0xfa8d('0x3d')]('phone','phone')[_0xfa8d('0x3d')](_0xfa8d('0x3e'),_0xfa8d('0x3f'))[_0xfa8d('0x3d')]('id',_0xfa8d('0x40'))[_0xfa8d('0x3d')](LISTID[_0xfa8d('0x41')](),_0xfa8d('0x42'))[_0xfa8d('0x3d')](_0x4f6da3['id'][_0xfa8d('0x41')](),_0x24422e)[_0xfa8d('0x3d')]('NOW()',_0xfa8d('0x3a'))[_0xfa8d('0x3d')](_0xfa8d('0x3e'),'updatedAt')['from']('cm_contacts')[_0xfa8d('0x43')](_0xfa8d('0x44'))['where']('ListId\x20=\x20?',LISTID[_0xfa8d('0x41')]())[_0xfa8d('0x43')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xfa8d('0x45'),squel[_0xfa8d('0x3c')]()['field']('phone')[_0xfa8d('0x46')](_0xfa8d('0x38'))[_0xfa8d('0x43')](_0x24422e+_0xfa8d('0x47'),_0x4f6da3['id'][_0xfa8d('0x41')]())))[_0xfa8d('0x41')]();return _0x330a4e;};var _0x3cd522=function(_0x20ec74,_0x1d6d26){var _0x110001=squel['insert']()[_0xfa8d('0x37')](_0xfa8d('0x38'))['fromQuery']([_0xfa8d('0x1e'),_0xfa8d('0x3f'),_0xfa8d('0x40'),_0xfa8d('0x42'),_0x1d6d26,'createdAt',_0xfa8d('0x3b')],squel[_0xfa8d('0x3c')]()[_0xfa8d('0x3d')](_0xfa8d('0x1e'),'phone')[_0xfa8d('0x3d')](_0xfa8d('0x3e'),_0xfa8d('0x3f'))[_0xfa8d('0x3d')]('id','ContactId')[_0xfa8d('0x3d')](LISTID['toString'](),_0xfa8d('0x42'))[_0xfa8d('0x3d')](_0x20ec74['id'][_0xfa8d('0x41')](),_0x1d6d26)['field'](_0xfa8d('0x3e'),_0xfa8d('0x3a'))[_0xfa8d('0x3d')](_0xfa8d('0x3e'),_0xfa8d('0x3b'))[_0xfa8d('0x46')]('cm_contacts')['where'](_0xfa8d('0x44'))[_0xfa8d('0x43')](_0xfa8d('0x48'),LISTID[_0xfa8d('0x41')]())[_0xfa8d('0x43')](_0xfa8d('0x49'),squel[_0xfa8d('0x4a')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0xfa8d('0x43')](_0xfa8d('0x45'),squel['select']()[_0xfa8d('0x3d')](_0xfa8d('0x4b'))[_0xfa8d('0x46')]('cm_hopper_final')[_0xfa8d('0x43')](_0x1d6d26+_0xfa8d('0x47'),_0x20ec74['id'][_0xfa8d('0x41')]()))[_0xfa8d('0x43')](_0xfa8d('0x45'),squel[_0xfa8d('0x3c')]()[_0xfa8d('0x3d')](_0xfa8d('0x1e'))[_0xfa8d('0x46')](_0xfa8d('0x38'))[_0xfa8d('0x43')](_0x1d6d26+_0xfa8d('0x47'),_0x20ec74['id'][_0xfa8d('0x41')]())))['toString']();return _0x110001;};function _0x517a3c(_0x35c346,_0x12a55c){var _0x167658=squel[_0xfa8d('0x36')]()[_0xfa8d('0x37')](_0xfa8d('0x38'))[_0xfa8d('0x39')]([_0xfa8d('0x1e'),_0xfa8d('0x3f'),_0xfa8d('0x40'),'ListId',_0x12a55c,'createdAt','updatedAt'],squel[_0xfa8d('0x3c')]()[_0xfa8d('0x3d')](_0xfa8d('0x1e'),'phone')[_0xfa8d('0x3d')]('NOW()',_0xfa8d('0x3f'))[_0xfa8d('0x3d')]('id','ContactId')['field'](LISTID[_0xfa8d('0x41')](),_0xfa8d('0x42'))[_0xfa8d('0x3d')](_0x35c346['id'][_0xfa8d('0x41')](),_0x12a55c)[_0xfa8d('0x3d')](_0xfa8d('0x3e'),'createdAt')[_0xfa8d('0x3d')](_0xfa8d('0x3e'),_0xfa8d('0x3b'))['from'](_0xfa8d('0x4c'))[_0xfa8d('0x43')]('deletedAt\x20IS\x20NULL')[_0xfa8d('0x43')](_0xfa8d('0x48'),LISTID[_0xfa8d('0x41')]())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0xfa8d('0x43')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x167658;}function _0x32b42c(_0x321354,_0x245e51){var _0x241b38=squel[_0xfa8d('0x36')]()[_0xfa8d('0x37')]('cm_hopper_black')['fromQuery']([_0xfa8d('0x1e'),_0xfa8d('0x40'),_0xfa8d('0x42'),_0x245e51,_0xfa8d('0x3a'),_0xfa8d('0x3b')],squel[_0xfa8d('0x3c')]()['field'](_0xfa8d('0x1e'),_0xfa8d('0x1e'))[_0xfa8d('0x3d')]('id',_0xfa8d('0x40'))[_0xfa8d('0x3d')](LISTID[_0xfa8d('0x41')](),_0xfa8d('0x42'))[_0xfa8d('0x3d')](_0x321354['id'][_0xfa8d('0x41')](),_0x245e51)[_0xfa8d('0x3d')](_0xfa8d('0x3e'),_0xfa8d('0x3a'))[_0xfa8d('0x3d')](_0xfa8d('0x3e'),_0xfa8d('0x3b'))['from'](_0xfa8d('0x4c'))[_0xfa8d('0x43')](_0xfa8d('0x44'))[_0xfa8d('0x43')](_0xfa8d('0x48'),LISTID[_0xfa8d('0x41')]())[_0xfa8d('0x43')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0xfa8d('0x43')](_0xfa8d('0x4d')))[_0xfa8d('0x41')]();return _0x241b38;}return db[_0xfa8d('0x4e')][_0xfa8d('0x4f')]({'where':{'type':_0xfa8d('0x50')},'attributes':['id',_0xfa8d('0x51')],'include':[{'model':db[_0xfa8d('0x52')],'as':_0xfa8d('0x53'),'where':{'id':LISTID}}]})[_0xfa8d('0x54')](function(_0x49b79c){var _0x1ea504=[];if(_0x49b79c){var _0x51c380;for(var _0x11f922=0x0,_0x5dbd3e;_0x11f922<_0x49b79c[_0xfa8d('0x27')];_0x11f922+=0x1){_0x5dbd3e=_0x49b79c[_0x11f922][_0xfa8d('0x55')]({'plain':!![]});switch(_0x5dbd3e[_0xfa8d('0x51')]){case _0xfa8d('0x56'):_0x1ea504['push'](db['sequelize'][_0xfa8d('0x57')](_0x3cd522(_0x5dbd3e,_0xfa8d('0x58')))[_0xfa8d('0x54')](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));break;case _0xfa8d('0x59'):_0x1ea504[_0xfa8d('0x2d')](db['sequelize'][_0xfa8d('0x57')](_0x3b4ffc(_0x5dbd3e,'VoiceQueueId'))['then'](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));break;default:_0x1ea504[_0xfa8d('0x2d')](db[_0xfa8d('0x5a')][_0xfa8d('0x57')](_0x517a3c(_0x5dbd3e,_0xfa8d('0x58')))[_0xfa8d('0x54')](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));}}}return _0x1ea504;})[_0xfa8d('0x5b')]()[_0xfa8d('0x54')](function(){return db[_0xfa8d('0x4e')][_0xfa8d('0x4f')]({'where':{'type':_0xfa8d('0x50')},'attributes':['id'],'include':[{'model':db[_0xfa8d('0x52')],'as':_0xfa8d('0x5c'),'where':{'id':LISTID}}]})[_0xfa8d('0x54')](function(_0x4d493d){var _0x49f4bf=[];if(_0x4d493d){var _0xedbce0;for(var _0x1e929e=0x0,_0x1deb86;_0x1e929e<_0x4d493d[_0xfa8d('0x27')];_0x1e929e+=0x1){_0x1deb86=_0x4d493d[_0x1e929e][_0xfa8d('0x55')]({'plain':!![]});_0x49f4bf[_0xfa8d('0x2d')](db[_0xfa8d('0x5a')][_0xfa8d('0x57')](_0x32b42c(_0x1deb86,'VoiceQueueId'))['then'](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));}}return _0x49f4bf;})['all']();})[_0xfa8d('0x54')](function(){return db[_0xfa8d('0x5d')][_0xfa8d('0x4f')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0xfa8d('0x53'),'where':{'id':LISTID}}]})[_0xfa8d('0x54')](function(_0x1bd833){var _0x1c323c=[];if(_0x1bd833){for(var _0x11345e=0x0,_0x582255;_0x11345e<_0x1bd833[_0xfa8d('0x27')];_0x11345e+=0x1){_0x582255=_0x1bd833[_0x11345e][_0xfa8d('0x55')]({'plain':!![]});switch(_0x582255[_0xfa8d('0x51')]){case _0xfa8d('0x56'):_0x1c323c['push'](db[_0xfa8d('0x5a')][_0xfa8d('0x57')](_0x3cd522(_0x582255,_0xfa8d('0x5e')))[_0xfa8d('0x54')](function(){})['catch'](_0x4cdd29()));break;case _0xfa8d('0x59'):_0x1c323c[_0xfa8d('0x2d')](db[_0xfa8d('0x5a')][_0xfa8d('0x57')](_0x3b4ffc(_0x582255,_0xfa8d('0x5e')))[_0xfa8d('0x54')](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));break;default:_0x1c323c[_0xfa8d('0x2d')](db[_0xfa8d('0x5a')][_0xfa8d('0x57')](_0x517a3c(_0x582255,'CampaignId'))['then'](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));}}}return _0x1c323c;})[_0xfa8d('0x5b')]();})[_0xfa8d('0x54')](function(){return db[_0xfa8d('0x5d')][_0xfa8d('0x4f')]({'attributes':['id'],'include':[{'model':db[_0xfa8d('0x52')],'as':_0xfa8d('0x5c'),'where':{'id':LISTID}}]})[_0xfa8d('0x54')](function(_0x30ddbc){var _0xf69375=[];if(_0x30ddbc){for(var _0x39a550=0x0,_0x3a0bfe;_0x39a550<_0x30ddbc[_0xfa8d('0x27')];_0x39a550+=0x1){_0x3a0bfe=_0x30ddbc[_0x39a550]['get']({'plain':!![]});_0xf69375['push'](db[_0xfa8d('0x5a')]['query'](_0x32b42c(_0x3a0bfe,'CampaignId'))['then'](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));}}return _0xf69375;})['all']();})[_0xfa8d('0x2f')](function(_0x1177de){logger[_0xfa8d('0x14')](_0xfa8d('0x5f'),_0xfa8d('0x60'),_0x1177de[_0xfa8d('0x31')]);});}var processPromises=function(_0x1dda65){return BPromise[_0xfa8d('0x5b')](promises)['then'](function(_0x5fbcbb){})[_0xfa8d('0x2f')](function(_0xf90bb){logger[_0xfa8d('0x14')]('Error\x20processing\x20rows\x20block:',JSON[_0xfa8d('0x32')](_0xf90bb));})['finally'](function(){socket[_0xfa8d('0x61')](_0xfa8d('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1dda65){return _0x1dda65[_0xfa8d('0x63')]();}});};var endCsv=function(){return BPromise[_0xfa8d('0x64')]()[_0xfa8d('0x54')](function(){if(hopperContacts){return checkHopper();}})[_0xfa8d('0x54')](function(){socket[_0xfa8d('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x24499b){logger[_0xfa8d('0x14')](_0xfa8d('0x65'),JSON['stringify'](_0x24499b));}finally{process[_0xfa8d('0x66')](0x0);}});};process['on'](_0xfa8d('0x67'),function(){logger[_0xfa8d('0x68')](_0xfa8d('0x69'));endCsv();});function main(){return BPromise[_0xfa8d('0x64')]()[_0xfa8d('0x54')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xfa8d('0x12')](',');return db[_0xfa8d('0x2b')][_0xfa8d('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x5aa10d){var _0x50e036=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xfa8d('0x6a')](_0x50e036,{'header':!![],'skipEmptyLines':!![],'step':function(_0x40a563,_0x5c8698){total+=0x1;var _0x372481=total;promises[_0xfa8d('0x2d')](checkRow(_0x40a563,_0x5aa10d,_0x372481)[_0xfa8d('0x54')](function(){success+=0x1;})[_0xfa8d('0x2f')](function(_0x3cdad4){if(_0x3cdad4[_0xfa8d('0x14')]){errors+=0x1;delete _0x3cdad4[_0xfa8d('0x14')];}else if(_0x3cdad4[_0xfa8d('0x29')]){duplicates+=0x1;delete _0x3cdad4[_0xfa8d('0x29')];}rows['push'](_0x3cdad4);}));if(total%0xc8===0x0){_0x5c8698[_0xfa8d('0x6b')]();return processPromises(_0x5c8698);}},'complete':function(){return processPromises()[_0xfa8d('0x54')](function(){logger[_0xfa8d('0x68')](_0xfa8d('0x6c'));endCsv();});},'error':function(_0x121625,_0x59bd3f){logger[_0xfa8d('0x68')](_0xfa8d('0x6d'),JSON[_0xfa8d('0x32')](_0x121625));endCsv();}});})[_0xfa8d('0x2f')](function(_0x4298a1){logger[_0xfa8d('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x4298a1));});}main(); \ No newline at end of file +var _0x31b6=['squel','papaparse','../../../mysqldb','../../../config/logger','defaults','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','find','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','ContactId','ListId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','scheduledAt','ListId\x20=\x20?','id\x20IN\x20?','calleridnum','cm_hopper_final','str','VoiceQueue','outbound','CmList','Lists','get','dialCheckDuplicateType','always','push','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x31b6,0xdf));var _0x631b=function(_0x14cc78,_0x1d6d29){_0x14cc78=_0x14cc78-0x0;var _0x4e5112=_0x31b6[_0x14cc78];return _0x4e5112;};'use strict';var BPromise=require(_0x631b('0x0'));var util=require(_0x631b('0x1'));var _=require(_0x631b('0x2'));var fs=require('fs');var squel=require(_0x631b('0x3'));var Papa=require(_0x631b('0x4'));var Redis=require('ioredis');var db=require(_0x631b('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x631b('0x6'))('api');config['redis']=_[_0x631b('0x7')](config[_0x631b('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x631b('0x9'))(new Redis(config[_0x631b('0x8')]));require(_0x631b('0xa'))[_0x631b('0xb')](socket);try{if(!process[_0x631b('0xc')][0x2]||process['argv'][0x2]===_0x631b('0xd')||process[_0x631b('0xc')][0x2]===_0x631b('0xe')){throw new Error(_0x631b('0xf'));}var FILEPATH=process['argv'][0x2];if(!process[_0x631b('0xc')][0x3]||process[_0x631b('0xc')][0x3]===_0x631b('0xd')||process['argv'][0x3]===_0x631b('0xe')||!process[_0x631b('0xc')][0x4]||process[_0x631b('0xc')][0x4]==='undefined'||process[_0x631b('0xc')][0x4]===_0x631b('0xe')){throw new Error(_0x631b('0x10'));}var FIELDS=_[_0x631b('0x11')](process[_0x631b('0xc')][0x3][_0x631b('0x12')](','),process[_0x631b('0xc')][0x4][_0x631b('0x12')](','));if(!process['argv'][0x5]||process[_0x631b('0xc')][0x5]===_0x631b('0xd')||process[_0x631b('0xc')][0x5]===_0x631b('0xe')){throw new Error(_0x631b('0x13'));}var LISTID=process[_0x631b('0xc')][0x5];var COMPANYID=process[_0x631b('0xc')][0x6]&&process[_0x631b('0xc')][0x6]!==_0x631b('0xd')&&process[_0x631b('0xc')][0x6]!==_0x631b('0xe')?process[_0x631b('0xc')][0x6]:null;var DUPLICATES=process[_0x631b('0xc')][0x7]&&process[_0x631b('0xc')][0x7]!=='undefined'&&process[_0x631b('0xc')][0x7]!==_0x631b('0xe')?process[_0x631b('0xc')][0x7]:null;if(!process[_0x631b('0xc')][0x8]||process[_0x631b('0xc')][0x8]==='undefined'||process[_0x631b('0xc')][0x8]===_0x631b('0xe')){throw new Error(_0x631b('0x14'));}var SOCKET_TIMESTAMP=process[_0x631b('0xc')][0x8];}catch(_0x3400ec){logger['error'](_0x3400ec);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(_0x1980c5,_0x4cdc67,_0x460281,_0x5bd466){var _0x28289f={'message':_0x4cdc67};_0x28289f[_0x1980c5]=!![];if(_0x460281){_0x28289f[_0x631b('0x15')]=_0x460281;}if(_0x5bd466){_0x28289f[_0x631b('0x16')]=_0x5bd466;}return _0x28289f;}function isEmail(_0x185d74){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))*$/[_0x631b('0x17')](_0x185d74);}function checkRow(_0xef6fb7,_0x158e4d,_0x3e0988){return new BPromise(function(_0x4954be,_0x1ef98e){if(_[_0x631b('0x18')](_0xef6fb7)){return _0x1ef98e(handleCheckRowError(_0x631b('0x19'),_0x631b('0x1a'),null,_0x3e0988));}if(_0xef6fb7[_0x631b('0x1b')]&&_0xef6fb7['errors'][_0x631b('0x1c')]){var _0x15419c=_[_0x631b('0x1d')](_0xef6fb7[_0x631b('0x1b')],_0x631b('0x1e'))[_0x631b('0x1f')](';');return _0x1ef98e(handleCheckRowError('error',_0x15419c,null,_0x3e0988));}var _0x4d3516={};for(var _0x564723 in FIELDS){if(FIELDS['hasOwnProperty'](_0x564723)&&FIELDS[_0x564723]){_0x4d3516[_0x564723]=_0xef6fb7[_0x631b('0x20')][0x0][FIELDS[_0x564723]]||_0xef6fb7['data'][0x0]['\ufeff'+FIELDS[_0x564723]];}}if(!_0x4d3516[_0x631b('0x21')]){return _0x1ef98e(handleCheckRowError(_0x631b('0x19'),_0x631b('0x22'),null,_0x3e0988));}if(!_0x4d3516[_0x631b('0x23')]){return _0x1ef98e(handleCheckRowError(_0x631b('0x19'),_0x631b('0x24'),null,_0x3e0988));}if(_0x4d3516[_0x631b('0x25')]){var _0x2cdc6e=moment(_0x4d3516['birthDate'],_0x631b('0x26'));if(!_0x2cdc6e[_0x631b('0x27')]()){return _0x1ef98e(handleCheckRowError(_0x631b('0x19'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x3e0988));}}if(_0x4d3516[_0x631b('0x28')]){if(!isEmail(_0x4d3516[_0x631b('0x28')])){return _0x1ef98e(handleCheckRowError(_0x631b('0x19'),_0x631b('0x29'),null,_0x3e0988));}}_0x4d3516['ListId']=LISTID;_0x4d3516['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x631b('0x1c')]&&_0x158e4d){var _0xc45e15={};for(var _0x236c63=0x0,_0x38d702=DUPLICATES[_0x631b('0x1c')];_0x236c63<_0x38d702;_0x236c63+=0x1){_0xc45e15[DUPLICATES[_0x236c63]]=_0x4d3516[DUPLICATES[_0x236c63]];}var _0x21cfd2=_[_0x631b('0x2a')](_0x158e4d,_0xc45e15);if(_0x21cfd2){return _0x1ef98e(handleCheckRowError('duplicate',_0x631b('0x2b'),_0x21cfd2,_0x3e0988));}}return db[_0x631b('0x2c')][_0x631b('0x2d')](_0x4d3516,{'raw':!![],'hooks':![],'fields':_[_0x631b('0x2e')](_0x4d3516)})[_0x631b('0x2f')](function(_0x4e0f14){if(DUPLICATES&&DUPLICATES[_0x631b('0x1c')]&&_0x158e4d){_0x158e4d['push'](_[_0x631b('0x30')](_0x4d3516,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4e0f14['id'];return _0x4954be();})[_0x631b('0x31')](function(_0x2ca1b6){return _0x1ef98e(handleCheckRowError(_0x631b('0x19'),'Error\x20while\x20creating\x20contact:\x20'+(_0x2ca1b6[_0x631b('0x1e')]||JSON[_0x631b('0x32')](_0x2ca1b6)),null,_0x3e0988));});});}function checkHopper(){function _0x112f66(){return function(_0x20525e){logger[_0x631b('0x19')](_0x631b('0x33'),_0x631b('0x34'),util[_0x631b('0x35')](_0x20525e,{'showHidden':![],'depth':null}));};}var _0x1a9c8a=function(_0x417737,_0x46e51c){var _0xfec572=squel[_0x631b('0x36')]()[_0x631b('0x37')]('cm_hopper')[_0x631b('0x38')]([_0x631b('0x23'),'scheduledAt',_0x631b('0x39'),_0x631b('0x3a'),_0x46e51c,'createdAt',_0x631b('0x3b')],squel[_0x631b('0x3c')]()[_0x631b('0x3d')](_0x631b('0x23'),_0x631b('0x23'))[_0x631b('0x3d')](_0x631b('0x3e'),'scheduledAt')[_0x631b('0x3d')]('id','ContactId')['field'](LISTID[_0x631b('0x3f')](),'ListId')['field'](_0x417737['id'][_0x631b('0x3f')](),_0x46e51c)[_0x631b('0x3d')](_0x631b('0x3e'),_0x631b('0x40'))[_0x631b('0x3d')](_0x631b('0x3e'),_0x631b('0x3b'))[_0x631b('0x41')](_0x631b('0x42'))[_0x631b('0x43')](_0x631b('0x44'))[_0x631b('0x43')]('ListId\x20=\x20?',LISTID[_0x631b('0x3f')]())[_0x631b('0x43')](_0x631b('0x45'))['where'](_0x631b('0x46'),squel[_0x631b('0x3c')]()['field'](_0x631b('0x23'))[_0x631b('0x41')]('cm_hopper')[_0x631b('0x43')](_0x46e51c+_0x631b('0x47'),_0x417737['id'][_0x631b('0x3f')]())))['toString']();return _0xfec572;};var _0x4e768b=function(_0x5fc327,_0xd1f947){var _0x10b92c=squel[_0x631b('0x36')]()[_0x631b('0x37')]('cm_hopper')[_0x631b('0x38')]([_0x631b('0x23'),'scheduledAt',_0x631b('0x39'),_0x631b('0x3a'),_0xd1f947,'createdAt',_0x631b('0x3b')],squel[_0x631b('0x3c')]()[_0x631b('0x3d')](_0x631b('0x23'),_0x631b('0x23'))[_0x631b('0x3d')]('NOW()',_0x631b('0x48'))['field']('id',_0x631b('0x39'))['field'](LISTID[_0x631b('0x3f')](),_0x631b('0x3a'))[_0x631b('0x3d')](_0x5fc327['id'][_0x631b('0x3f')](),_0xd1f947)[_0x631b('0x3d')](_0x631b('0x3e'),_0x631b('0x40'))[_0x631b('0x3d')](_0x631b('0x3e'),_0x631b('0x3b'))[_0x631b('0x41')]('cm_contacts')[_0x631b('0x43')](_0x631b('0x44'))[_0x631b('0x43')](_0x631b('0x49'),LISTID['toString']())[_0x631b('0x43')](_0x631b('0x4a'),squel['str'](hopperContacts))[_0x631b('0x43')](_0x631b('0x45'))[_0x631b('0x43')](_0x631b('0x46'),squel[_0x631b('0x3c')]()['field'](_0x631b('0x4b'))['from'](_0x631b('0x4c'))['where'](_0xd1f947+_0x631b('0x47'),_0x5fc327['id']['toString']()))[_0x631b('0x43')](_0x631b('0x46'),squel[_0x631b('0x3c')]()[_0x631b('0x3d')](_0x631b('0x23'))[_0x631b('0x41')]('cm_hopper')[_0x631b('0x43')](_0xd1f947+_0x631b('0x47'),_0x5fc327['id'][_0x631b('0x3f')]())))[_0x631b('0x3f')]();return _0x10b92c;};function _0x57eea9(_0x1954ea,_0x5e5b53){var _0x437a56=squel[_0x631b('0x36')]()[_0x631b('0x37')]('cm_hopper')[_0x631b('0x38')]([_0x631b('0x23'),_0x631b('0x48'),_0x631b('0x39'),_0x631b('0x3a'),_0x5e5b53,_0x631b('0x40'),'updatedAt'],squel['select']()[_0x631b('0x3d')]('phone',_0x631b('0x23'))[_0x631b('0x3d')](_0x631b('0x3e'),_0x631b('0x48'))['field']('id',_0x631b('0x39'))['field'](LISTID[_0x631b('0x3f')](),_0x631b('0x3a'))[_0x631b('0x3d')](_0x1954ea['id'][_0x631b('0x3f')](),_0x5e5b53)[_0x631b('0x3d')](_0x631b('0x3e'),_0x631b('0x40'))[_0x631b('0x3d')]('NOW()','updatedAt')['from'](_0x631b('0x42'))[_0x631b('0x43')](_0x631b('0x44'))[_0x631b('0x43')](_0x631b('0x49'),LISTID[_0x631b('0x3f')]())['where'](_0x631b('0x4a'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x437a56;}function _0x7b6595(_0x243173,_0x4456ed){var _0x5e3ad7=squel[_0x631b('0x36')]()[_0x631b('0x37')]('cm_hopper_black')[_0x631b('0x38')]([_0x631b('0x23'),_0x631b('0x39'),_0x631b('0x3a'),_0x4456ed,_0x631b('0x40'),_0x631b('0x3b')],squel[_0x631b('0x3c')]()[_0x631b('0x3d')](_0x631b('0x23'),_0x631b('0x23'))[_0x631b('0x3d')]('id','ContactId')[_0x631b('0x3d')](LISTID[_0x631b('0x3f')](),'ListId')[_0x631b('0x3d')](_0x243173['id'][_0x631b('0x3f')](),_0x4456ed)[_0x631b('0x3d')](_0x631b('0x3e'),_0x631b('0x40'))['field'](_0x631b('0x3e'),'updatedAt')[_0x631b('0x41')](_0x631b('0x42'))[_0x631b('0x43')](_0x631b('0x44'))[_0x631b('0x43')](_0x631b('0x49'),LISTID[_0x631b('0x3f')]())[_0x631b('0x43')](_0x631b('0x4a'),squel[_0x631b('0x4d')](hopperContacts))[_0x631b('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x631b('0x3f')]();return _0x5e3ad7;}return db[_0x631b('0x4e')]['findAll']({'where':{'type':_0x631b('0x4f')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x631b('0x50')],'as':_0x631b('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x5d89df){var _0x1183a2=[];if(_0x5d89df){var _0x5a2f71;for(var _0x20aebd=0x0,_0x568605;_0x20aebd<_0x5d89df[_0x631b('0x1c')];_0x20aebd+=0x1){_0x568605=_0x5d89df[_0x20aebd][_0x631b('0x52')]({'plain':!![]});switch(_0x568605[_0x631b('0x53')]){case _0x631b('0x54'):_0x1183a2[_0x631b('0x55')](db[_0x631b('0x56')][_0x631b('0x57')](_0x4e768b(_0x568605,_0x631b('0x58')))['then'](function(){})[_0x631b('0x31')](_0x112f66()));break;case _0x631b('0x59'):_0x1183a2[_0x631b('0x55')](db[_0x631b('0x56')]['query'](_0x1a9c8a(_0x568605,_0x631b('0x58')))[_0x631b('0x2f')](function(){})['catch'](_0x112f66()));break;default:_0x1183a2[_0x631b('0x55')](db[_0x631b('0x56')][_0x631b('0x57')](_0x57eea9(_0x568605,_0x631b('0x58')))[_0x631b('0x2f')](function(){})[_0x631b('0x31')](_0x112f66()));}}}return _0x1183a2;})[_0x631b('0x5a')]()[_0x631b('0x2f')](function(){return db[_0x631b('0x4e')][_0x631b('0x5b')]({'where':{'type':_0x631b('0x4f')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x631b('0x5c'),'where':{'id':LISTID}}]})[_0x631b('0x2f')](function(_0x1b2a59){var _0x4dc8ac=[];if(_0x1b2a59){var _0xf74095;for(var _0x42a74e=0x0,_0x45bfa1;_0x42a74e<_0x1b2a59['length'];_0x42a74e+=0x1){_0x45bfa1=_0x1b2a59[_0x42a74e][_0x631b('0x52')]({'plain':!![]});_0x4dc8ac[_0x631b('0x55')](db['sequelize'][_0x631b('0x57')](_0x7b6595(_0x45bfa1,_0x631b('0x58')))[_0x631b('0x2f')](function(){})['catch'](_0x112f66()));}}return _0x4dc8ac;})[_0x631b('0x5a')]();})['then'](function(){return db[_0x631b('0x5d')][_0x631b('0x5b')]({'attributes':['id',_0x631b('0x53')],'include':[{'model':db[_0x631b('0x50')],'as':_0x631b('0x51'),'where':{'id':LISTID}}]})[_0x631b('0x2f')](function(_0x303673){var _0x21c2cf=[];if(_0x303673){for(var _0x125a66=0x0,_0x5a6229;_0x125a66<_0x303673['length'];_0x125a66+=0x1){_0x5a6229=_0x303673[_0x125a66]['get']({'plain':!![]});switch(_0x5a6229[_0x631b('0x53')]){case _0x631b('0x54'):_0x21c2cf[_0x631b('0x55')](db[_0x631b('0x56')][_0x631b('0x57')](_0x4e768b(_0x5a6229,'CampaignId'))[_0x631b('0x2f')](function(){})[_0x631b('0x31')](_0x112f66()));break;case _0x631b('0x59'):_0x21c2cf[_0x631b('0x55')](db[_0x631b('0x56')][_0x631b('0x57')](_0x1a9c8a(_0x5a6229,_0x631b('0x5e')))[_0x631b('0x2f')](function(){})[_0x631b('0x31')](_0x112f66()));break;default:_0x21c2cf[_0x631b('0x55')](db['sequelize'][_0x631b('0x57')](_0x57eea9(_0x5a6229,_0x631b('0x5e')))[_0x631b('0x2f')](function(){})[_0x631b('0x31')](_0x112f66()));}}}return _0x21c2cf;})[_0x631b('0x5a')]();})['then'](function(){return db[_0x631b('0x5d')][_0x631b('0x5b')]({'attributes':['id'],'include':[{'model':db[_0x631b('0x50')],'as':_0x631b('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x41ad3c){var _0x17a3ff=[];if(_0x41ad3c){for(var _0x232389=0x0,_0x5ea452;_0x232389<_0x41ad3c[_0x631b('0x1c')];_0x232389+=0x1){_0x5ea452=_0x41ad3c[_0x232389][_0x631b('0x52')]({'plain':!![]});_0x17a3ff[_0x631b('0x55')](db['sequelize'][_0x631b('0x57')](_0x7b6595(_0x5ea452,'CampaignId'))[_0x631b('0x2f')](function(){})[_0x631b('0x31')](_0x112f66()));}}return _0x17a3ff;})[_0x631b('0x5a')]();})[_0x631b('0x31')](function(_0x97302c){logger['error'](_0x631b('0x5f'),_0x631b('0x60'),_0x97302c[_0x631b('0x1e')]);});}var processPromises=function(_0x361a4c){return BPromise[_0x631b('0x5a')](promises)[_0x631b('0x2f')](function(_0x2cb994){})[_0x631b('0x31')](function(_0x2133c2){logger[_0x631b('0x19')]('Error\x20processing\x20rows\x20block:',JSON[_0x631b('0x32')](_0x2133c2));})[_0x631b('0x61')](function(){socket[_0x631b('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x361a4c){return _0x361a4c[_0x631b('0x63')]();}});};var endCsv=function(){return BPromise[_0x631b('0x64')]()[_0x631b('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x631b('0x62')](_0x631b('0x65')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x631b('0x66')](FILEPATH);}catch(_0x3eab09){logger[_0x631b('0x19')](_0x631b('0x67'),JSON['stringify'](_0x3eab09));}finally{process[_0x631b('0x68')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0x631b('0x69'));endCsv();});function main(){return BPromise[_0x631b('0x64')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x631b('0x2c')][_0x631b('0x5b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x631b('0x2f')](function(_0x430a04){var _0x165830=fs[_0x631b('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x631b('0x6b')](_0x165830,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2cd327,_0x344dde){total+=0x1;var _0x147826=total;promises[_0x631b('0x55')](checkRow(_0x2cd327,_0x430a04,_0x147826)['then'](function(){success+=0x1;})[_0x631b('0x31')](function(_0x2f2551){if(_0x2f2551[_0x631b('0x19')]){errors+=0x1;delete _0x2f2551[_0x631b('0x19')];}else if(_0x2f2551[_0x631b('0x6c')]){duplicates+=0x1;delete _0x2f2551[_0x631b('0x6c')];}rows['push'](_0x2f2551);}));if(total%0xc8===0x0){_0x344dde[_0x631b('0x6d')]();return processPromises(_0x344dde);}},'complete':function(){return processPromises()['then'](function(){logger[_0x631b('0x6e')](_0x631b('0x6f'));endCsv();});},'error':function(_0x4909a8,_0x3d0836){logger[_0x631b('0x6e')]('CSV\x20parse\x20error',JSON['stringify'](_0x4909a8));endCsv();}});})[_0x631b('0x31')](function(_0x39f64b){logger[_0x631b('0x19')](_0x631b('0x70'),JSON[_0x631b('0x32')](_0x39f64b));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 4766995..6a06bf1 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 _0xa66e=['cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','scheduledat','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','OrderBy','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','group','Received\x20SIGINT','error','message','exit','errors','info','sequelize','spread','catch','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','query','all','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','timezones','isNil','utcOffset','set','dialTimezone','main','stringify','start','clone','root','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','campaigns_','voice_queues_','CREATE\x20TABLE\x20','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','then','push','AdditionalPhones','split','length','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_hopper_black','.CmListId\x20=\x20?'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa66e,0x1d8));var _0xea66=function(_0x3f8419,_0x16225d){_0x3f8419=_0x3f8419-0x0;var _0x400365=_0xa66e[_0x3f8419];return _0x400365;};'use strict';var fs=require('fs');var path=require(_0xea66('0x0'));var _=require(_0xea66('0x1'));var Papa=require(_0xea66('0x2'));var util=require(_0xea66('0x3'));var BPromise=require(_0xea66('0x4'));var moment=require(_0xea66('0x5'));var squel=require(_0xea66('0x6'));var Redis=require(_0xea66('0x7'));var db=require(_0xea66('0x8'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0xea66('0x9'))(_0xea66('0xa'));config[_0xea66('0xb')]=_[_0xea66('0xc')](config[_0xea66('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xea66('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xea66('0xe')](_0xea66('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xea66('0xf'));function isEmail(_0x2edfe7){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))*$/[_0xea66('0x10')](_0x2edfe7);}function selectNotIn(_0x3a9187,_0x4550fa,_0x63bbb5,_0x1b1ea6,_0x5c29f3){return squel[_0xea66('0x11')]()[_0xea66('0x12')](_0xea66('0x13'))[_0xea66('0x14')](_0x1b1ea6)[_0xea66('0x15')](_0x4550fa,null,_0x4550fa+_0xea66('0x16')+_0x1b1ea6+'.'+_0x63bbb5)[_0xea66('0x17')](_0x1b1ea6+'.'+_0x63bbb5+_0xea66('0x18')+_0x3a9187+'.'+_0x63bbb5)[_0xea66('0x17')](_0x4550fa+_0xea66('0x19')+_0x5c29f3[_0xea66('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xb61b6b,_0x9f5a95){promisesAdditionalPhones=[];return db[_0xea66('0x1a')][_0xea66('0x1b')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xea66('0x1c')](function(_0xb24d45){if(_0xb24d45!==null){var _0x5ba976=[];for(var _0x3f2ceb=0x0;_0x3f2ceb<_0xb24d45['length'];_0x3f2ceb++){var _0x254563=_0xb24d45[_0x3f2ceb];_0x5ba976[_0xea66('0x1d')](insertAdditionalPhones(_0x254563));}}Promise['all'](_0x5ba976)[_0xea66('0x1c')](function(){_0xb61b6b({'val':0x1});});});});}function insertAdditionalPhones(_0x18e7ce){return new Promise(function(_0x2a4322,_0x7d5953){var _0x32a6cb=_0x18e7ce[_0xea66('0x1e')];var _0x2ddf94=_0x32a6cb[_0xea66('0x1f')](';');var _0xd3fc59=[];orderBy=0x0;for(var _0x32777f=0x0;_0x32777f<_0x2ddf94['length'];_0x32777f++){_0xd3fc59[_0xea66('0x1d')](splitAdditionalPhone(_0x18e7ce['id'],_0x2ddf94[_0x32777f]));}Promise['all'](_0xd3fc59)[_0xea66('0x1c')](function(){_0x2a4322({'val':_0x2ddf94[_0xea66('0x20')]});});});}function splitAdditionalPhone(_0x3b84b3,_0x58bbea){return new Promise(function(_0x270dc1,_0x35cc49){var _0x288ba6=_0x58bbea[_0xea66('0x1f')](':');var _0x577ace=_0x288ba6[0x0];var _0x387132=_0x288ba6[0x1];if(!_['isNil'](_0x387132)){var _0x5809d9=_0x387132[_0xea66('0x1f')]('|');var _0x41b1af=[];for(var _0x56be31=0x0;_0x56be31<_0x5809d9[_0xea66('0x20')];_0x56be31++){if(_0x5809d9[_0x56be31]!==''){var _0x396908=_[_0xea66('0x21')](promisesAdditionalPhones,{'contactId':_0x3b84b3,'phone':_0x5809d9[_0x56be31]});if(_0x396908['length']==0x0){orderBy++;promisesAdditionalPhones[_0xea66('0x1d')]({'contactId':_0x3b84b3,'contactTypeId':_0x577ace,'phone':_0x5809d9[_0x56be31],'orderBy':orderBy});}}}_0x270dc1({'ok':0x1});}else _0x270dc1({'res':0x0});});}function createAdditionalPhone(_0x2eee6b,_0x44e977,_0x2f12b0,_0x5f1906){var _0x879f0='';var _0x41da5b='';var _0x49ac7b=_0x2f12b0[_0xea66('0x1f')]('§');_0x879f0=_0x49ac7b[0x0];if(_0x49ac7b[_0xea66('0x20')]==0x2)_0x41da5b=_0x49ac7b[0x1];return new Promise(function(_0x10b938,_0x350f5f){return db[_0xea66('0x22')][_0xea66('0x23')]({'where':{'CmContactId':_0x2eee6b,'item':_0x879f0}})[_0xea66('0x1c')](function(_0x555314){if(_0x555314){return db[_0xea66('0x22')][_0xea66('0x24')]({'ItemTypeId':_0x44e977,'description':_0x41da5b,'OrderBy':_0x5f1906},{'where':{'CmContactId':_0x2eee6b,'item':_0x879f0}})[_0xea66('0x1c')](function(_0x9c3a03){_0x10b938({'res':_0xea66('0x25')});});}else{return db[_0xea66('0x22')][_0xea66('0x26')]({'CmContactId':_0x2eee6b,'item':_0x879f0,'description':_0x41da5b,'ItemTypeId':_0x44e977,'OrderBy':_0x5f1906,'ItemClass':_0xea66('0x27')})['then'](function(_0x1b6fa8){_0x10b938({'res':_0xea66('0x28')});});}});});}function insertCmHopper(_0x165e02,_0x1c5816,_0x4bb45f,_0x3e1a36,_0x50ec50){var _0x274b50=[_0xea66('0x29'),'cm_contacts.scheduledat',_0xea66('0x2a'),_0xea66('0x2b'),_0x1c5816+'.'+_0x3e1a36,_0xea66('0x2c'),_0xea66('0x2d'),_0xea66('0x2e'),_0xea66('0x2f'),'\x22'+_0x50ec50+'\x22'];return squel[_0xea66('0x30')]()[_0xea66('0x31')](_0xea66('0x32'))[_0xea66('0x33')]([_0xea66('0x13'),'scheduledat',_0xea66('0x34'),_0xea66('0x35'),_0x3e1a36,_0xea66('0x36'),_0xea66('0x37'),_0xea66('0x38'),_0xea66('0x39'),_0xea66('0x3a')],squel[_0xea66('0x11')]()[_0xea66('0x3b')](_0x274b50)['from'](_0x1c5816)[_0xea66('0x15')](_0xea66('0x3c'),null,_0xea66('0x3d')+_0x1c5816+_0xea66('0x3e'))[_0xea66('0x15')](_0x4bb45f,null,_0x4bb45f+_0xea66('0x16')+_0x1c5816+'.'+_0x3e1a36)[_0xea66('0x17')](_0x1c5816+'.CmListId\x20=\x20?',_0x165e02)[_0xea66('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xea66('0x17')](_0xea66('0x3f'),selectNotIn(_0x1c5816,_0x4bb45f,_0x3e1a36,'cm_hopper',[_0xea66('0x40'),'\x22onlyIfOpen\x22']))[_0xea66('0x17')](_0xea66('0x3f'),selectNotIn(_0x1c5816,_0x4bb45f,_0x3e1a36,'cm_hopper',[_0xea66('0x40')])))[_0xea66('0x41')]();}function insertCmHopperBlack(_0x2d88f5,_0x34ed97,_0x257cd6,_0xd7a28d){var _0x53e5c5=[_0xea66('0x29'),_0xea66('0x2a'),_0xea66('0x2b'),_0x34ed97+'.'+_0xd7a28d,_0xea66('0x2c'),_0xea66('0x2d')];return squel['insert']()[_0xea66('0x31')](_0xea66('0x42'))['fromQuery']([_0xea66('0x13'),_0xea66('0x34'),_0xea66('0x35'),_0xd7a28d,'createdAt',_0xea66('0x37')],squel['select']()[_0xea66('0x3b')](_0x53e5c5)['from'](_0x34ed97)[_0xea66('0x15')](_0xea66('0x3c'),null,'cm_contacts.ListId\x20=\x20'+_0x34ed97+_0xea66('0x3e'))[_0xea66('0x15')](_0x257cd6,null,_0x257cd6+_0xea66('0x16')+_0x34ed97+'.'+_0xd7a28d)[_0xea66('0x17')](_0x34ed97+_0xea66('0x43'),_0x2d88f5)['where'](_0xea66('0x44'),NOW)[_0xea66('0x17')](_0xea66('0x3f'),squel[_0xea66('0x11')]()['field'](_0xea66('0x13'))[_0xea66('0x14')](_0xea66('0x42'))[_0xea66('0x17')](_0xea66('0x45'),_0x2d88f5)[_0xea66('0x17')](_0xd7a28d+'\x20=\x20'+_0x34ed97+'.'+_0xd7a28d)))[_0xea66('0x41')]();}function insertTzCmHopper(_0x4b642c,_0x1ae822,_0x41199f,_0x44dd11,_0x42771e,_0x34ab2b){var _0x911b12=[_0xea66('0x29'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x34ab2b+_0xea66('0x46'),_0xea66('0x2a'),'cm_contacts.ListId',_0x1ae822+'.'+_0x44dd11,_0xea66('0x2c'),'cm_contacts.updatedAt',_0xea66('0x2e'),_0xea66('0x2f'),'\x22'+_0x42771e+'\x22'];var _0x991ae8=squel[_0xea66('0x30')]()[_0xea66('0x31')](_0xea66('0x32'))[_0xea66('0x33')](['phone',_0xea66('0x47'),_0xea66('0x34'),_0xea66('0x35'),_0x44dd11,'createdAt',_0xea66('0x37'),_0xea66('0x38'),_0xea66('0x39'),_0xea66('0x3a')],squel[_0xea66('0x11')]()[_0xea66('0x3b')](_0x911b12)['from'](_0x1ae822)[_0xea66('0x15')](_0xea66('0x3c'),null,_0xea66('0x3d')+_0x1ae822+'.CmListId')[_0xea66('0x15')](_0x41199f,null,_0x41199f+_0xea66('0x16')+_0x1ae822+'.'+_0x44dd11)[_0xea66('0x15')](_0x34ab2b,null,_0x34ab2b+_0xea66('0x16')+_0x1ae822+'.'+_0x44dd11)['where'](_0x1ae822+_0xea66('0x43'),_0x4b642c)[_0xea66('0x17')](_0xea66('0x44'),NOW)[_0xea66('0x17')](_0xea66('0x3f'),selectNotIn(_0x1ae822,_0x41199f,_0x44dd11,'cm_hopper',[_0xea66('0x40'),'\x22onlyIfOpen\x22']))[_0xea66('0x17')](_0xea66('0x3f'),selectNotIn(_0x1ae822,_0x41199f,_0x44dd11,'cm_hopper',[_0xea66('0x40')])))[_0xea66('0x41')]();return _0x991ae8;}function insertTzCmHopperBlack(_0x28b7aa,_0x5ada24,_0x23b903,_0x288165){var _0x1b305d=['cm_contacts.phone',_0xea66('0x2a'),_0xea66('0x2b'),_0x5ada24+'.'+_0x288165,'cm_contacts.createdAt',_0xea66('0x2d')];return squel[_0xea66('0x30')]()['into'](_0xea66('0x42'))['fromQuery']([_0xea66('0x13'),'ContactId',_0xea66('0x35'),_0x288165,'createdAt',_0xea66('0x37')],squel[_0xea66('0x11')]()[_0xea66('0x3b')](_0x1b305d)[_0xea66('0x14')](_0x5ada24)[_0xea66('0x15')](_0xea66('0x3c'),null,'cm_contacts.ListId\x20=\x20'+_0x5ada24+_0xea66('0x3e'))[_0xea66('0x15')](_0x23b903,null,_0x23b903+_0xea66('0x16')+_0x5ada24+'.'+_0x288165)['where'](_0x5ada24+_0xea66('0x43'),_0x28b7aa)[_0xea66('0x17')](_0xea66('0x44'),NOW)[_0xea66('0x17')](_0xea66('0x3f'),squel[_0xea66('0x11')]()[_0xea66('0x12')]('phone')['from'](_0xea66('0x42'))[_0xea66('0x17')](_0xea66('0x45'),_0x28b7aa)[_0xea66('0x17')](_0x288165+'\x20=\x20'+_0x5ada24+'.'+_0x288165)))[_0xea66('0x41')]();}function insertCmHopperAdditionalPhones(_0x4cff2f){var _0xa60f6f=['cm_hopper.id',_0xea66('0x48'),_0xea66('0x49'),_0xea66('0x4a'),_0xea66('0x4b')];return squel[_0xea66('0x30')]()['into']('cm_hopper_additional_phones')['fromQuery'](['CmHopperId',_0xea66('0x13'),_0xea66('0x4c'),'createdAt',_0xea66('0x37')],squel['select']()[_0xea66('0x3b')](_0xa60f6f)[_0xea66('0x14')](_0xea66('0x32'))[_0xea66('0x15')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xea66('0x15')](_0xea66('0x4d'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xea66('0x17')](_0xea66('0x4e'),_0x4cff2f)[_0xea66('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xea66('0x41')]();}function insertCmContact(_0x21162d,_0x193070,_0x22af8f,_0x463d24){var _0xbc846f=_['concat'](_[_0xea66('0x4f')](_0x463d24),['ListId',_0xea66('0x50'),'createdAt',_0xea66('0x37'),_0xea66('0x51')]);return squel[_0xea66('0x30')]()[_0xea66('0x31')]('cm_contacts')[_0xea66('0x33')](_0xbc846f,squel[_0xea66('0x11')]()['fields'](_0xbc846f)[_0xea66('0x14')](_0x193070)[_0xea66('0x17')]('('+_0x22af8f['join'](',')+_0xea66('0x52'),squel[_0xea66('0x11')]()['fields'](_0x22af8f)['from'](_0xea66('0x3c'))['where'](_0xea66('0x45'),_0x21162d)[_0xea66('0x17')](_0xea66('0x53')))['where'](_0xea66('0x54'),squel[_0xea66('0x11')]()['field']('MIN(id)','min_id')[_0xea66('0x14')](_0x193070)[_0xea66('0x55')](_0x22af8f[_0xea66('0x15')](','))))[_0xea66('0x41')]();}function handleStop(){logger['info'](_0xea66('0x56'));stopped=!![];}function handleUncaughtException(_0x25abe2){logger[_0xea66('0x57')](_0x25abe2[_0xea66('0x58')]);process[_0xea66('0x59')](0x1);}function handleError(_0x281da4,_0x431b3f){stats[_0xea66('0x5a')][_0xea66('0x1d')]({'name':_0x431b3f['code'],'message':_0x431b3f[_0xea66('0x58')],'row':_0x281da4});}function handleQuery(_0x5312a2){logger[_0xea66('0x5b')](_0x5312a2);return db[_0xea66('0x5c')]['query'](_0x5312a2)[_0xea66('0x5d')](function(_0x4cb6a2){results[_0xea66('0x1d')](_0x4cb6a2);})[_0xea66('0x5e')](function(_0x384695){logger[_0xea66('0x57')](_0x384695[_0xea66('0x58')]);});}function updateTzCampaigns(_0x476e61){return new Promise(function(_0x25060f,_0x13625f){var _0x304720=squel[_0xea66('0x11')]()[_0xea66('0x3b')]([_0xea66('0x5f'),'campaigns.dialTimezone'])['from'](_0xea66('0x60'))[_0xea66('0x15')](_0xea66('0x61'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0xea66('0x17')](_0xea66('0x62')+_0x476e61);db[_0xea66('0x5c')][_0xea66('0x63')](_0x304720[_0xea66('0x41')]())[_0xea66('0x5d')](function(_0x163d7f){var _0x22495a=[];for(var _0x3a74f8=0x0;_0x3a74f8<_0x163d7f[_0xea66('0x20')];_0x3a74f8++){_0x22495a['push'](getTimezoneData(_0x163d7f[_0x3a74f8],tmp_campaigns));}BPromise[_0xea66('0x64')](_0x22495a)[_0xea66('0x1c')](function(){_0x25060f({'val':0x1});});})[_0xea66('0x5e')](function(_0x256ee3){logger[_0xea66('0x57')](_0x256ee3[_0xea66('0x58')]);_0x25060f({'val':0x0});});});}function updateTzVoiceQueues(_0x32e0f4){return new Promise(function(_0x5bdfff,_0x27763f){var _0x5bbbbb=squel[_0xea66('0x11')]()[_0xea66('0x3b')](['voice_queues.id',_0xea66('0x65')])[_0xea66('0x14')](_0xea66('0x66'))['join'](_0xea66('0x67'),null,_0xea66('0x68'))[_0xea66('0x17')]('voice_queues_has_cm_lists.CmListId='+_0x32e0f4);db['sequelize'][_0xea66('0x63')](_0x5bbbbb[_0xea66('0x41')]())['spread'](function(_0x594677){var _0x4e767f=[];for(var _0x4f463b=0x0;_0x4f463b<_0x594677[_0xea66('0x20')];_0x4f463b++){_0x4e767f[_0xea66('0x1d')](getTimezoneData(_0x594677[_0x4f463b],tmp_voice_queues));}BPromise[_0xea66('0x64')](_0x4e767f)[_0xea66('0x1c')](function(){_0x5bdfff({'val':0x1});});})[_0xea66('0x5e')](function(_0x31a54e){logger[_0xea66('0x57')](_0x31a54e[_0xea66('0x58')]);_0x5bdfff({'val':0x0});});});}function getTimezoneData(_0x4d9105,_0x56c77a){return new Promise(function(_0x2dfbfd,_0x2bc881){var _0x552420=shared[_0xea66('0x69')];var _0xe447c5=_0x552420[_0x4d9105['dialTimezone']];if(_[_0xea66('0x6a')](_0xe447c5)){_0x2dfbfd({'ret':0x1});}else{var _0x1660bf=_0xe447c5[_0xea66('0x6b')];var _0x49bdcc=squel[_0xea66('0x30')]()[_0xea66('0x31')](_0x56c77a)[_0xea66('0x6c')]('id',_0x4d9105['id'])[_0xea66('0x6c')]('offset',_0x1660bf)[_0xea66('0x6c')](_0xea66('0x6d'),_0x4d9105['dialTimezone'])[_0xea66('0x41')]();return db['sequelize'][_0xea66('0x63')](_0x49bdcc)['spread'](function(_0x308df0){_0x2dfbfd({'ret':0x1});})[_0xea66('0x5e')](function(_0x1d0609){logger[_0xea66('0x57')](_0x1d0609[_0xea66('0x58')]);_0x2bc881({'ret':0x1});});}});}function handleTZQuery(_0x5c0552){logger['info'](_0x5c0552);return db['sequelize']['query'](_0x5c0552)[_0xea66('0x5d')](function(_0x5efb8f){})[_0xea66('0x5e')](function(_0x26a6fb){logger['error'](_0x26a6fb['message']);});}function main(_0x5205c1,_0x3e0f5f,_0x28e283,_0x19bca2){logger['info'](_0xea66('0x6e'),_0x5205c1,JSON[_0xea66('0x6f')](_0x3e0f5f));process['send'](_0xea66('0x70'));var _0x3ae486=_0x3e0f5f['binding'];var _0x3721b4=_[_0xea66('0x71')](_0x3ae486);var _0x3c70da=_0x3e0f5f['socket_timestamp'];var _0x3e9af5=path['join'](config[_0xea66('0x72')],_0xea66('0x73'),_0x3c70da+_0xea66('0x74'));hasTZ=_[_0xea66('0x4f')](_0x3ae486)[_0xea66('0x75')](_0xea66('0x6d'));var _0x2a4357=_[_0xea66('0x4f')](_0x3ae486)[_0xea66('0x15')]();logger['info'](_0xea66('0x76'),_0x2a4357);db[_0xea66('0x77')]['findAll']({'raw':!![],'attributes':['id',_0xea66('0x78')]})[_0xea66('0x1c')](function(_0x33e8c4){for(var _0x2a0a5f=0x0;_0x2a0a5f<_0x33e8c4['length'];_0x2a0a5f++){if(_0x33e8c4[_0x2a0a5f]['name']in _0x3ae486){contactItemTypes[_0xea66('0x1d')](_0x33e8c4[_0x2a0a5f]);delete _0x3721b4[_0x33e8c4[_0x2a0a5f][_0xea66('0x78')]];hasAdditionalPhones=!![];}for(var _0x37617d in _0x3ae486){if(_0x33e8c4[_0x2a0a5f][_0xea66('0x78')]+_0xea66('0x79')===_0x37617d){phoneDescriptions[_0xea66('0x1d')]({'itemTypeId':_0x33e8c4[_0x2a0a5f]['id'],'description':_0x37617d});delete _0x3721b4[_0x37617d];}}}if(hasAdditionalPhones)_0x3721b4[_0xea66('0x1e')]='';var _0x30a66a=_[_0xea66('0x4f')](_0x3721b4)[_0xea66('0x15')]();logger[_0xea66('0x5b')](_0xea66('0x76'),_0x30a66a);fs[_0xea66('0x7a')](_0x3e9af5,_0x30a66a+'\x0a');Papa[_0xea66('0x7b')](fs[_0xea66('0x7c')](_0x5205c1),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1f776b,_0x487d4c){try{for(var _0x5090b6=0x0,_0x267858=[];_0x5090b6<_0x1f776b[_0xea66('0x7d')][_0xea66('0x20')];_0x5090b6++){stats[_0xea66('0x7e')]+=0x1;if(_0x1f776b[_0xea66('0x5a')][_0x5090b6]){handleError(_0x1f776b[_0xea66('0x7d')][_0x5090b6],_0x1f776b['errors'][_0x5090b6]);}else{var _0x1b3b85=[];var _0x461164=[];var _0x256622={};for(var _0x21a814 in _0x3ae486){let _0x11f9d3=contactItemTypes[_0xea66('0x7f')](_0x2ab78d=>_0x2ab78d[_0xea66('0x78')]===_0x21a814);let _0x11b2e7=contactItemTypes['find'](_0x222581=>_0x222581[_0xea66('0x78')]+_0xea66('0x79')===_0x21a814);if(_[_0xea66('0x6a')](_0x11f9d3)&&_[_0xea66('0x6a')](_0x11b2e7)){if(_0x3ae486[_0xea66('0x80')](_0x21a814)){if(_0x1f776b[_0xea66('0x7d')][_0x5090b6][_0x3ae486[_0x21a814]]){var _0x409ccf=_[_0xea66('0x81')](_0x1f776b[_0xea66('0x7d')][_0x5090b6][_0x3ae486[_0x21a814]][_0xea66('0x82')](/"/g,'\x27'));switch(_0x21a814){case _0xea66('0x47'):var _0x3b3419=moment(_0x409ccf,_0xea66('0xf'),!![]);if(_0x3b3419[_0xea66('0x83')]()){_0x267858[_0xea66('0x1d')]('\x22'+_0x409ccf+'\x22');}else{_0x1b3b85['push'](_0xea66('0x84'));}break;case _0xea66('0x38'):var _0x265f43=parseInt(_0x409ccf);_0x409ccf=_[_0xea66('0x85')](_0x265f43)||_0x265f43<0x0||_0x265f43>0x4?_0x19bca2?0x3:0x2:_0x265f43;_0x267858[_0xea66('0x1d')]('\x22'+_0x409ccf+'\x22');break;case _0xea66('0x39'):var _0x183ce1=parseInt(_0x409ccf);if(_[_0xea66('0x86')](_0x183ce1)&&_[_0xea66('0x75')](_0x28e283,_0x183ce1)){_0x267858[_0xea66('0x1d')]('\x22'+_0x183ce1+'\x22');}else{_0x1b3b85[_0xea66('0x1d')](_0xea66('0x87'));}break;case _0xea66('0x88'):if(isEmail(_0x409ccf)){_0x267858[_0xea66('0x1d')]('\x22'+_0x409ccf+'\x22');}else{_0x1b3b85[_0xea66('0x1d')](_0xea66('0x89'));}break;case'dateOfBirth':var _0x2d6ad6=moment(_0x409ccf,'YYYY-MM-DD',!![]);if(_0x2d6ad6[_0xea66('0x83')]()){_0x267858[_0xea66('0x1d')]('\x22'+_0x409ccf+'\x22');}else{_0x1b3b85[_0xea66('0x1d')](_0xea66('0x8a'));}break;case'dialTimezone':var _0x1d0c81=shared['timezones'];var _0xcc32b6=_0x1d0c81[_0x409ccf];if(!_[_0xea66('0x6a')](_0xcc32b6)){var _0x26b786=_0xcc32b6[_0xea66('0x6b')];_0x267858[_0xea66('0x1d')]('\x22'+_0x409ccf+'\x22');_0x267858['push']('\x22'+_0x26b786+'\x22');}break;default:_0x267858[_0xea66('0x1d')]('\x22'+_0x409ccf+'\x22');}}else{switch(_0x21a814){case _0xea66('0x8b'):case'phone':_0x1b3b85[_0xea66('0x1d')](_0x21a814+_0xea66('0x8c'));break;default:_0x267858['push']('\x22\x22');}}}}else{var _0xd03e3e='';if(!_[_0xea66('0x6a')](_0x11f9d3)){if(!_0x256622['hasOwnProperty'](_0x11f9d3['id'])){if(!_[_0xea66('0x6a')](_0x1f776b[_0xea66('0x7d')][_0x5090b6][_0x3ae486[_0x21a814]])){var _0x409ccf=_['trim'](_0x1f776b[_0xea66('0x7d')][_0x5090b6][_0x3ae486[_0x21a814]][_0xea66('0x82')](/"/g,'\x27'));var _0x43b489=phoneDescriptions[_0xea66('0x7f')](_0x3be70f=>_0x3be70f['itemTypeId']===_0x11f9d3['id']);if(!_[_0xea66('0x6a')](_0x43b489)){var _0x3cd8ab=_[_0xea66('0x81')](_0x1f776b[_0xea66('0x7d')][_0x5090b6][_0x3ae486[_0x43b489['description']]]['replace'](/"/g,'\x27'));if(!_[_0xea66('0x6a')](_0x3cd8ab))_0x409ccf=_0x409ccf+'§'+_0x3cd8ab;}if(_0xd03e3e=='')_0xd03e3e=_0x409ccf;else _0xd03e3e+='|'+_0x409ccf;}_0x461164[_0xea66('0x1d')](_0x11f9d3['id']+':'+_0xd03e3e);_0x256622[_0x11f9d3['id']]=0x1;}}}}if(hasAdditionalPhones){_0x267858[_0xea66('0x1d')]('\x22'+_0x461164[_0xea66('0x15')](';')+'\x22');}if(_0x1b3b85[_0xea66('0x20')]){handleError(_0x1f776b['data'][_0x5090b6],{'code':_0xea66('0x8d'),'message':_0x1b3b85[_0xea66('0x15')]()});}else{fs[_0xea66('0x8e')](_0x3e9af5,_0x267858['join']()+'\x0a');}_0x267858=[];}if(!(stats[_0xea66('0x7e')]%0xc8)){socket[_0xea66('0x8f')](_0xea66('0x90')+_0x3c70da,stats);stats['errors']=[];}}if(stopped){logger[_0xea66('0x5b')]('Abort\x20parser');_0x487d4c[_0xea66('0x91')]();}}catch(_0x22cef0){handleError(_0x1f776b['data'][_0x5090b6],{'code':_0xea66('0x92'),'message':_0x22cef0['message']});logger[_0xea66('0x57')](_0xea66('0x93'),_0x22cef0[_0xea66('0x58')]);}},'complete':function(){try{var _0x4d0c22=[];var _0x2965b5=[];var _0x2155d0=_0xea66('0x3c');if(_0x3e0f5f[_0xea66('0x94')]&&_0x3e0f5f['duplicates']['length']){_0x2155d0=_0xea66('0x95')+_0x3c70da;_0x4d0c22[_0xea66('0x1d')]('CREATE\x20TABLE\x20'+_0x2155d0+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xea66('0x96')+_0x3c70da;tmp_voice_queues=_0xea66('0x97')+_0x3c70da;_0x2965b5[_0xea66('0x1d')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x2965b5[_0xea66('0x1d')](_0xea66('0x98')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xea66('0x99')](_0x2965b5,handleTZQuery)[_0xea66('0x1c')](function(_0x38e8b6){updateTzCampaigns(_0x3e0f5f[_0xea66('0x35')])[_0xea66('0x1c')](function(_0x266ed0){updateTzVoiceQueues(_0x3e0f5f[_0xea66('0x35')])[_0xea66('0x1c')](function(_0x7af8c3){if(hasTZ)_0x30a66a=_0x30a66a[_0xea66('0x82')](_0xea66('0x6d'),'dialTimezone,utcOffset');var _0x1f1f07=util[_0xea66('0xe')](_0xea66('0x9a'),_0x3e9af5,_0x2155d0,_0x30a66a,_0x3e0f5f[_0xea66('0x35')],_0x3e0f5f['CompanyId']||null,NOW,NOW);if(_[_0xea66('0x6a')](_0x3ae486[_0xea66('0x47')])){_0x1f1f07+=_0xea66('0x9b');}_0x4d0c22[_0xea66('0x1d')](_0x1f1f07);if(_0x3e0f5f['duplicates']&&_0x3e0f5f[_0xea66('0x94')][_0xea66('0x20')]){_0x4d0c22['push'](insertCmContact(_0x3e0f5f[_0xea66('0x35')],_0x2155d0,_0x3e0f5f[_0xea66('0x94')],_0x3ae486));_0x4d0c22[_0xea66('0x1d')](_0xea66('0x9c')+_0x2155d0+';');}BPromise[_0xea66('0x99')](_0x4d0c22,handleQuery)['then'](function(_0x3bc989){BPromise[_0xea66('0x64')]([handleAdditionalPhones()])[_0xea66('0x1c')](function(){_0x4d0c22=[];for(var _0x4a9a53=0x0;_0x4a9a53_0x511f5f[_0x5288('0x78')]===_0x140ae5);let _0x3581d0=contactItemTypes[_0x5288('0x7e')](_0x31d6e8=>_0x31d6e8[_0x5288('0x78')]+_0x5288('0x79')===_0x140ae5);if(_[_0x5288('0x1d')](_0xe1568e)&&_[_0x5288('0x1d')](_0x3581d0)){if(_0x578fb0['hasOwnProperty'](_0x140ae5)){if(_0x11b28a[_0x5288('0x7d')][_0x26558c][_0x578fb0[_0x140ae5]]){var _0x30446b=_[_0x5288('0x7f')](_0x11b28a[_0x5288('0x7d')][_0x26558c][_0x578fb0[_0x140ae5]][_0x5288('0x80')](/"/g,'\x27'));switch(_0x140ae5){case _0x5288('0x44'):var _0x41ff07=moment(_0x30446b,_0x5288('0xd'),!![]);if(_0x41ff07['isValid']()){_0x2af6f3[_0x5288('0x1b')]('\x22'+_0x30446b+'\x22');}else{_0xdc7a2e['push'](_0x5288('0x81'));}break;case _0x5288('0x32'):var _0x81c02c=parseInt(_0x30446b);_0x30446b=_[_0x5288('0x82')](_0x81c02c)||_0x81c02c<0x0||_0x81c02c>0x4?_0x2c0056?0x3:0x2:_0x81c02c;_0x2af6f3[_0x5288('0x1b')]('\x22'+_0x30446b+'\x22');break;case _0x5288('0x33'):var _0x3c01b8=parseInt(_0x30446b);if(_[_0x5288('0x83')](_0x3c01b8)&&_[_0x5288('0x76')](_0x1a19ee,_0x3c01b8)){_0x2af6f3[_0x5288('0x1b')]('\x22'+_0x3c01b8+'\x22');}else{_0xdc7a2e[_0x5288('0x1b')](_0x5288('0x84'));}break;case _0x5288('0x85'):if(isEmail(_0x30446b)){_0x2af6f3[_0x5288('0x1b')]('\x22'+_0x30446b+'\x22');}else{_0xdc7a2e[_0x5288('0x1b')]('email\x20wrong\x20format');}break;case _0x5288('0x86'):var _0xdd8dcb=moment(_0x30446b,'YYYY-MM-DD',!![]);if(_0xdd8dcb['isValid']()){_0x2af6f3[_0x5288('0x1b')]('\x22'+_0x30446b+'\x22');}else{_0xdc7a2e[_0x5288('0x1b')](_0x5288('0x87'));}break;case _0x5288('0x6c'):var _0x229501=shared[_0x5288('0x88')];var _0x295e09=_0x229501[_0x30446b];if(!_[_0x5288('0x1d')](_0x295e09)){var _0x3b0b24=_0x295e09['utcOffset'];_0x2af6f3[_0x5288('0x1b')]('\x22'+_0x30446b+'\x22');_0x2af6f3[_0x5288('0x1b')]('\x22'+_0x3b0b24+'\x22');}break;default:_0x2af6f3[_0x5288('0x1b')]('\x22'+_0x30446b+'\x22');}}else{switch(_0x140ae5){case _0x5288('0x89'):case'phone':_0xdc7a2e[_0x5288('0x1b')](_0x140ae5+'\x20not\x20specified');break;default:_0x2af6f3['push']('\x22\x22');}}}}else{var _0x1460f6='';if(!_['isNil'](_0xe1568e)){if(!_0x3d03e8['hasOwnProperty'](_0xe1568e['id'])){if(!_['isNil'](_0x11b28a['data'][_0x26558c][_0x578fb0[_0x140ae5]])){var _0x30446b=_['trim'](_0x11b28a['data'][_0x26558c][_0x578fb0[_0x140ae5]][_0x5288('0x80')](/"/g,'\x27'));var _0x20de3c=phoneDescriptions[_0x5288('0x7e')](_0x5be4b7=>_0x5be4b7[_0x5288('0x8a')]===_0xe1568e['id']);if(!_[_0x5288('0x1d')](_0x20de3c)){var _0xd921d7=_[_0x5288('0x7f')](_0x11b28a[_0x5288('0x7d')][_0x26558c][_0x578fb0[_0x20de3c[_0x5288('0x8b')]]][_0x5288('0x80')](/"/g,'\x27'));if(!_['isNil'](_0xd921d7))_0x30446b=_0x30446b+'§'+_0xd921d7;}if(_0x1460f6=='')_0x1460f6=_0x30446b;else _0x1460f6+='|'+_0x30446b;}_0x3a9dbd[_0x5288('0x1b')](_0xe1568e['id']+':'+_0x1460f6);_0x3d03e8[_0xe1568e['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2af6f3[_0x5288('0x1b')]('\x22'+_0x3a9dbd[_0x5288('0x36')](';')+'\x22');}if(_0xdc7a2e[_0x5288('0x1a')]){handleError(_0x11b28a[_0x5288('0x7d')][_0x26558c],{'code':'SystemRow','message':_0xdc7a2e[_0x5288('0x36')]()});}else{fs[_0x5288('0x8c')](_0x5bf125,_0x2af6f3[_0x5288('0x36')]()+'\x0a');}_0x2af6f3=[];}if(!(stats[_0x5288('0x8d')]%0xc8)){socket[_0x5288('0x8e')](_0x5288('0x8f')+_0xf4d216,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x5288('0x90'));_0x522a8c[_0x5288('0x91')]();}}catch(_0x4ff18c){handleError(_0x11b28a[_0x5288('0x7d')][_0x26558c],{'code':_0x5288('0x92'),'message':_0x4ff18c[_0x5288('0x5b')]});logger[_0x5288('0x5a')]('step',_0x4ff18c[_0x5288('0x5b')]);}},'complete':function(){try{var _0x4de303=[];var _0x16118c=[];var _0x335c26=_0x5288('0x45');if(_0x5bc4c0['duplicates']&&_0x5bc4c0[_0x5288('0x93')][_0x5288('0x1a')]){_0x335c26=_0x5288('0x94')+_0xf4d216;_0x4de303['push'](_0x5288('0x95')+_0x335c26+_0x5288('0x96'));}tmp_campaigns='campaigns_'+_0xf4d216;tmp_voice_queues=_0x5288('0x97')+_0xf4d216;_0x16118c['push'](_0x5288('0x95')+tmp_campaigns+_0x5288('0x98'));_0x16118c['push']('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x5288('0x98'));BPromise[_0x5288('0x99')](_0x16118c,handleTZQuery)['then'](function(_0x28ba33){updateTzCampaigns(_0x5bc4c0[_0x5288('0x30')])[_0x5288('0x19')](function(_0x5cac94){updateTzVoiceQueues(_0x5bc4c0[_0x5288('0x30')])[_0x5288('0x19')](function(_0x4b1568){if(hasTZ)_0x83231a=_0x83231a[_0x5288('0x80')](_0x5288('0x6c'),_0x5288('0x9a'));var _0x3cad05=util[_0x5288('0xc')](_0x5288('0x9b'),_0x5bf125,_0x335c26,_0x83231a,_0x5bc4c0[_0x5288('0x30')],_0x5bc4c0['CompanyId']||null,NOW,NOW);if(_[_0x5288('0x1d')](_0x578fb0[_0x5288('0x44')])){_0x3cad05+=_0x5288('0x9c');}_0x4de303[_0x5288('0x1b')](_0x3cad05);if(_0x5bc4c0[_0x5288('0x93')]&&_0x5bc4c0[_0x5288('0x93')][_0x5288('0x1a')]){_0x4de303[_0x5288('0x1b')](insertCmContact(_0x5bc4c0[_0x5288('0x30')],_0x335c26,_0x5bc4c0[_0x5288('0x93')],_0x578fb0));_0x4de303['push']('DROP\x20TABLE\x20'+_0x335c26+';');}BPromise[_0x5288('0x99')](_0x4de303,handleQuery)[_0x5288('0x19')](function(_0x2626e1){BPromise[_0x5288('0x67')]([handleAdditionalPhones()])[_0x5288('0x19')](function(){_0x4de303=[];for(var _0x1bbf82=0x0;_0x1bbf82\x20\x20');}var _0x189ba7=path[_0x5288('0x36')](config[_0x5288('0xa8')],_0x5288('0xa9'),process['argv'][0x2]);if(!fs[_0x5288('0xaa')](_0x189ba7)){throw new Error(_0x5288('0xab'));}var _0x1c0db0={};try{_0x1c0db0=JSON['parse'](process[_0x5288('0xa7')][0x3]);if(!_0x1c0db0[_0x5288('0xac')]){throw new Error(_0x5288('0xad'));}if(!_0x1c0db0[_0x5288('0xac')][_0x5288('0x2e')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x1c0db0[_0x5288('0xac')][_0x5288('0x89')]){throw new Error(_0x5288('0xae'));}var _0x5b827d=0x0;if(_0x1c0db0[_0x5288('0xac')][_0x5288('0x33')]){_0x5b827d=0x1;}if(!_0x1c0db0['ListId']){throw new Error(_0x5288('0xaf'));}}catch(_0x241b3a){throw new Error('body\x20id\x20mandatory');}var _0x1ce216=[];try{_0x1ce216=_[_0x5288('0xb0')](JSON[_0x5288('0x7b')](process[_0x5288('0xa7')][0x4]),'id');}catch(_0x26324){logger[_0x5288('0x58')](_0x5288('0xb1'));}main(_0x189ba7,_0x1c0db0,_0x1ce216,_0x5b827d);}validate();process['on'](_0x5288('0xb2'),handleStop);process['on'](_0x5288('0xb3'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index df4f750..81ca585 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56bd=['ContactId','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','toString','info','exit','errors','code','query','main','stringify','start','binding','server/files/tmp','body','ContactItemType','findAll','name','header','writeFileSync','data','find','trim','replace','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','hasOwnProperty','description','SystemRow','appendFileSync','rows','emit','contact:import:','abort','SystemError','CREATE\x20TABLE\x20','CIS\x20len',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','DROP\x20TABLE\x20','finish','unlink','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','uncaughtException','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','then','catch','error','message','split','push','all','update','updated','CmContactHasItem','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','cm_hopper_black'];(function(_0x5c7f24,_0xadf13){var _0x2ca339=function(_0x3d762d){while(--_0x3d762d){_0x5c7f24['push'](_0x5c7f24['shift']());}};_0x2ca339(++_0xadf13);}(_0x56bd,0xe9));var _0xd56b=function(_0x2aad0f,_0x1344fd){_0x2aad0f=_0x2aad0f-0x0;var _0x9d56f9=_0x56bd[_0x2aad0f];return _0x9d56f9;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xd56b('0x0'));var Papa=require(_0xd56b('0x1'));var util=require(_0xd56b('0x2'));var BPromise=require('bluebird');var moment=require(_0xd56b('0x3'));var squel=require(_0xd56b('0x4'));var Redis=require(_0xd56b('0x5'));var db=require(_0xd56b('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0xd56b('0x7'))(_0xd56b('0x8'));config[_0xd56b('0x9')]=_[_0xd56b('0xa')](config[_0xd56b('0x9')],{'host':_0xd56b('0xb'),'port':0x18eb});var socket=require(_0xd56b('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xd56b('0xd')](_0xd56b('0xe'));var tempTableName=_0xd56b('0xf')+moment()[_0xd56b('0xd')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x5b5abd){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))*$/[_0xd56b('0x10')](_0x5b5abd);}function selectNotIn(_0x3271bc,_0x5a8959,_0x3364af,_0x1e6fcd,_0x3bfaf9){return squel[_0xd56b('0x11')]()[_0xd56b('0x12')](_0xd56b('0x13'))[_0xd56b('0x14')](_0x1e6fcd)[_0xd56b('0x15')](_0x5a8959,null,_0x5a8959+_0xd56b('0x16')+_0x1e6fcd+'.'+_0x3364af)[_0xd56b('0x17')](_0x1e6fcd+'.'+_0x3364af+_0xd56b('0x18')+_0x3271bc+'.'+_0x3364af)[_0xd56b('0x17')](_0x5a8959+_0xd56b('0x19')+_0x3bfaf9[_0xd56b('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x37f528,_0x5a6eb6){promisesAdditionalPhones=[];promisesContact=[];return db[_0xd56b('0x1a')]['query'](_0xd56b('0x1b')+tempTableName)[_0xd56b('0x1c')](function(_0x3f8775){if(_0x3f8775!==null){var _0x1dbdc6=[];for(var _0x209442=0x0;_0x209442<_0x3f8775[_0xd56b('0x1d')];_0x209442++){var _0x667877=_0x3f8775[_0x209442];if(!_[_0xd56b('0x1e')](_0x667877[_0xd56b('0x13')])){if(!_[_0xd56b('0x1e')](_0x667877[_0xd56b('0x1f')]))_0x1dbdc6['push'](insertAdditionalPhones(_0x667877));promisesContact['push']({'contact':_0x667877});}}}Promise['all'](_0x1dbdc6)[_0xd56b('0x20')](function(){_0x37f528({'val':0x1});});})[_0xd56b('0x21')](function(_0xf32afd){logger[_0xd56b('0x22')](_0xf32afd[_0xd56b('0x23')]);});});}function insertAdditionalPhones(_0x106aa4){return new Promise(function(_0x477212,_0x547a7a){var _0x2335cd=_0x106aa4[_0xd56b('0x1f')];if(_[_0xd56b('0x1e')](_0x2335cd))_0x547a7a({'val':0x0});else{var _0x13140b=_0x2335cd[_0xd56b('0x24')](';');var _0x32160b=[];orderBy=0x0;for(var _0x5498b0=0x0;_0x5498b0<_0x13140b['length'];_0x5498b0++){_0x32160b[_0xd56b('0x25')](splitAdditionalPhone(_0x106aa4['id'],_0x13140b[_0x5498b0]));}Promise[_0xd56b('0x26')](_0x32160b)['then'](function(){_0x477212({'val':_0x13140b[_0xd56b('0x1d')]});});}});}function splitAdditionalPhone(_0x5c9cfe,_0xdaf42a){return new Promise(function(_0x543aaf,_0xc9027d){var _0x30e936=_0xdaf42a[_0xd56b('0x24')](':');var _0x5ab429=_0x30e936[0x0];var _0x42e907=_0x30e936[0x1];if(_0x42e907!==''){var _0x1a2f0c=_0x42e907[_0xd56b('0x24')]('|');var _0x6980a8=[];for(var _0x34166c=0x0;_0x34166c<_0x1a2f0c[_0xd56b('0x1d')];_0x34166c++){if(_0x1a2f0c[_0x34166c]!==''){var _0x3c9730=_['filter'](promisesAdditionalPhones,{'contactId':_0x5c9cfe,'phone':_0x1a2f0c[_0x34166c]});if(_0x3c9730['length']==0x0){orderBy++;promisesAdditionalPhones[_0xd56b('0x25')]({'contactId':_0x5c9cfe,'contactTypeId':_0x5ab429,'phone':_0x1a2f0c[_0x34166c],'orderBy':orderBy});}}}_0x543aaf({'ok':0x1});}else _0x543aaf({'res':0x0});});}function createAdditionalPhone(_0x4393a9,_0x241e95,_0x171ca5,_0x45a45d){var _0x3c76d6='';var _0x1cbb85='';var _0x18dece=_0x171ca5[_0xd56b('0x24')]('§');_0x3c76d6=_0x18dece[0x0];if(_0x18dece[_0xd56b('0x1d')]==0x2)_0x1cbb85=_0x18dece[0x1];return new Promise(function(_0x1446da,_0x8737b4){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x4393a9,'item':_0x3c76d6}})[_0xd56b('0x20')](function(_0x4d54c4){if(_0x4d54c4){return db['CmContactHasItem'][_0xd56b('0x27')]({'ItemTypeId':_0x241e95,'description':_0x1cbb85,'OrderBy':_0x45a45d},{'where':{'CmContactId':_0x4393a9,'item':_0x3c76d6}})[_0xd56b('0x20')](function(_0x193c7f){_0x1446da({'res':_0xd56b('0x28')});});}else{return db[_0xd56b('0x29')][_0xd56b('0x2a')]({'CmContactId':_0x4393a9,'item':_0x3c76d6,'ItemTypeId':_0x241e95,'description':_0x1cbb85,'OrderBy':_0x45a45d,'ItemClass':_0xd56b('0x2b')})[_0xd56b('0x20')](function(_0x53f4d3){_0x1446da({'res':_0xd56b('0x2c')});});}});});}function updateContact(_0x519638){return new Promise(function(_0x1b30aa,_0x333102){var _0x38c3a4=_0x519638['id'];delete _0x519638['id'];return db[_0xd56b('0x2d')][_0xd56b('0x27')](_0x519638,{'where':{'id':_0x38c3a4}})['then'](function(_0xa84b74){updatedRows+=0x1;return db[_0xd56b('0x2e')]['update']({'phone':_0x519638[_0xd56b('0x13')]},{'where':{'ContactId':_0x38c3a4}})[_0xd56b('0x20')](function(_0x56be53){_0x1b30aa({'ret':'OK'});});});});}function insertCmHopper(_0x509c35,_0x308ff5,_0x576dff,_0x208b44,_0x2ca2bf){var _0xda8f1a=[_0xd56b('0x2f'),_0xd56b('0x30'),_0xd56b('0x31'),'cm_contacts.ListId',_0x308ff5+'.'+_0x208b44,_0xd56b('0x32'),_0xd56b('0x33'),'cm_contacts.priority',_0xd56b('0x34'),'\x22'+_0x2ca2bf+'\x22'];return squel[_0xd56b('0x35')]()[_0xd56b('0x36')](_0xd56b('0x37'))[_0xd56b('0x38')]([_0xd56b('0x13'),_0xd56b('0x39'),'ContactId',_0xd56b('0x3a'),_0x208b44,_0xd56b('0x3b'),_0xd56b('0x3c'),_0xd56b('0x3d'),'UserId',_0xd56b('0x3e')],squel[_0xd56b('0x11')]()[_0xd56b('0x3f')](_0xda8f1a)[_0xd56b('0x14')](_0x308ff5)[_0xd56b('0x15')](_0xd56b('0x40'),null,_0xd56b('0x41')+_0x308ff5+_0xd56b('0x42'))[_0xd56b('0x15')](_0x576dff,null,_0x576dff+_0xd56b('0x16')+_0x308ff5+'.'+_0x208b44)[_0xd56b('0x17')](_0x308ff5+_0xd56b('0x43'),_0x509c35)[_0xd56b('0x17')](_0xd56b('0x44'),NOW)[_0xd56b('0x17')](_0xd56b('0x45'),selectNotIn(_0x308ff5,_0x576dff,_0x208b44,'cm_hopper',['\x22always\x22',_0xd56b('0x46')]))[_0xd56b('0x17')](_0xd56b('0x45'),selectNotIn(_0x308ff5,_0x576dff,_0x208b44,'cm_hopper',[_0xd56b('0x47')])))['toString']();}function insertCmHopperBlack(_0x265cad,_0x62ba88,_0x189df6,_0x17e74d){var _0x2613e2=['cm_contacts.phone',_0xd56b('0x31'),'cm_contacts.ListId',_0x62ba88+'.'+_0x17e74d,_0xd56b('0x32'),_0xd56b('0x33')];return squel[_0xd56b('0x35')]()[_0xd56b('0x36')](_0xd56b('0x48'))['fromQuery']([_0xd56b('0x13'),_0xd56b('0x49'),'ListId',_0x17e74d,_0xd56b('0x3b'),_0xd56b('0x3c')],squel['select']()[_0xd56b('0x3f')](_0x2613e2)[_0xd56b('0x14')](_0x62ba88)[_0xd56b('0x15')](_0xd56b('0x40'),null,_0xd56b('0x41')+_0x62ba88+_0xd56b('0x42'))[_0xd56b('0x15')](_0x189df6,null,_0x189df6+_0xd56b('0x16')+_0x62ba88+'.'+_0x17e74d)[_0xd56b('0x17')](_0x62ba88+'.CmListId\x20=\x20?',_0x265cad)[_0xd56b('0x17')](_0xd56b('0x44'),NOW)[_0xd56b('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xd56b('0x11')]()[_0xd56b('0x12')]('phone')[_0xd56b('0x14')](_0xd56b('0x48'))[_0xd56b('0x17')](_0xd56b('0x4a'),_0x265cad)[_0xd56b('0x17')](_0x17e74d+_0xd56b('0x4b'),_0x62ba88+'.'+_0x17e74d)))['toString']();}function insertCmHopperAdditionalPhones(_0x3e587a){var _0x2ca2e5=[_0xd56b('0x4c'),'cm_contact_has_items.item',_0xd56b('0x4d'),_0xd56b('0x4e'),_0xd56b('0x4f')];return squel[_0xd56b('0x35')]()[_0xd56b('0x36')]('cm_hopper_additional_phones')[_0xd56b('0x38')]([_0xd56b('0x50'),_0xd56b('0x13'),_0xd56b('0x51'),_0xd56b('0x3b'),_0xd56b('0x3c')],squel['select']()[_0xd56b('0x3f')](_0x2ca2e5)[_0xd56b('0x14')](_0xd56b('0x37'))['join'](_0xd56b('0x40'),null,_0xd56b('0x52'))[_0xd56b('0x15')](_0xd56b('0x53'),null,_0xd56b('0x54'))[_0xd56b('0x17')](_0xd56b('0x55'),_0x3e587a)[_0xd56b('0x17')](_0xd56b('0x44'),NOW))['toString']();}function insertCmContact(_0x1900a9,_0x3552ab,_0x582a8a,_0x1d2810){var _0x95def=_['concat'](_[_0xd56b('0x56')](_0x1d2810),['ListId',_0xd56b('0x57'),_0xd56b('0x3b'),'updatedAt']);return squel[_0xd56b('0x35')]()['into'](_0xd56b('0x40'))['fromQuery'](_0x95def,squel['select']()[_0xd56b('0x3f')](_0x95def)[_0xd56b('0x14')](_0x3552ab)['where']('('+_0x582a8a[_0xd56b('0x15')](',')+_0xd56b('0x58'),squel['select']()[_0xd56b('0x3f')](_0x582a8a)[_0xd56b('0x14')]('cm_contacts')[_0xd56b('0x17')](_0xd56b('0x4a'),_0x1900a9))[_0xd56b('0x17')](_0xd56b('0x59'),squel['select']()[_0xd56b('0x12')]('MIN(id)',_0xd56b('0x5a'))[_0xd56b('0x14')](_0x3552ab)[_0xd56b('0x5b')](_0x582a8a['join'](','))))[_0xd56b('0x5c')]();}function handleStop(){logger[_0xd56b('0x5d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x360376){logger[_0xd56b('0x22')](_0x360376['message']);process[_0xd56b('0x5e')](0x1);}function handleError(_0x3cdb6c,_0x2f827e){stats[_0xd56b('0x5f')][_0xd56b('0x25')]({'name':_0x2f827e[_0xd56b('0x60')],'message':_0x2f827e['message'],'row':_0x3cdb6c});}function handleQuery(_0x5a44b9){logger[_0xd56b('0x5d')](_0x5a44b9);return db[_0xd56b('0x1a')][_0xd56b('0x61')](_0x5a44b9)[_0xd56b('0x1c')](function(_0xf4c175){results[_0xd56b('0x25')](_0xf4c175);})[_0xd56b('0x21')](function(_0x2a81f1){logger['error'](_0x2a81f1[_0xd56b('0x23')]);});}function main(_0x2fec4,_0x4ca57e,_0x2c1b7b,_0x3f993f){logger[_0xd56b('0x5d')](_0xd56b('0x62'),_0x2fec4,JSON[_0xd56b('0x63')](_0x4ca57e));process['send'](_0xd56b('0x64'));var _0x298f16=_0x4ca57e[_0xd56b('0x65')];var _0x52849d=_['clone'](_0x298f16);var _0x3c6f0a=_0x4ca57e['socket_timestamp'];var _0x197529=path[_0xd56b('0x15')](config['root'],_0xd56b('0x66'),_0x3c6f0a+'.csv');logger['info'](_0xd56b('0x67'),_0x4ca57e);db[_0xd56b('0x68')][_0xd56b('0x69')]({'raw':!![],'attributes':['id',_0xd56b('0x6a')]})['then'](function(_0x10090b){for(var _0x247a68=0x0;_0x247a68<_0x10090b[_0xd56b('0x1d')];_0x247a68++){if(_0x10090b[_0x247a68]['name']in _0x298f16){contactItemTypes[_0xd56b('0x25')](_0x10090b[_0x247a68]);delete _0x52849d[_0x10090b[_0x247a68][_0xd56b('0x6a')]];hasAdditionalPhones=!![];}for(var _0x10c4d9 in _0x298f16){if(_0x10090b[_0x247a68][_0xd56b('0x6a')]+'_description'===_0x10c4d9){phoneDescriptions[_0xd56b('0x25')]({'itemTypeId':_0x10090b[_0x247a68]['id'],'description':_0x10c4d9});delete _0x52849d[_0x10c4d9];}}}if(hasAdditionalPhones)_0x52849d['AdditionalPhones']='';var _0x1103e6=_[_0xd56b('0x56')](_0x52849d)[_0xd56b('0x15')]();logger['info'](_0xd56b('0x6b'),_0x1103e6);fs[_0xd56b('0x6c')](_0x197529,_0x1103e6+'\x0a');Papa['parse'](fs['createReadStream'](_0x2fec4),{'header':!![],'skipEmptyLines':!![],'step':function(_0x133877,_0x3bd5fe){try{for(var _0x319701=0x0,_0x17740c=[];_0x319701<_0x133877[_0xd56b('0x6d')]['length'];_0x319701++){stats['rows']+=0x1;if(_0x133877[_0xd56b('0x5f')][_0x319701]){handleError(_0x133877[_0xd56b('0x6d')][_0x319701],_0x133877[_0xd56b('0x5f')][_0x319701]);}else{var _0x36d1b8=[];var _0x5e6edc=[];var _0x5954b1={};for(var _0x350cf5 in _0x298f16){let _0x250582=contactItemTypes[_0xd56b('0x6e')](_0x36c67b=>_0x36c67b[_0xd56b('0x6a')]===_0x350cf5);let _0x47a6ee=contactItemTypes[_0xd56b('0x6e')](_0x492d01=>_0x492d01[_0xd56b('0x6a')]+'_description'===_0x350cf5);if(_[_0xd56b('0x1e')](_0x250582)&&_['isNil'](_0x47a6ee)){if(_0x298f16['hasOwnProperty'](_0x350cf5)){if(_0x133877[_0xd56b('0x6d')][_0x319701][_0x298f16[_0x350cf5]]){var _0x3e9b66=_[_0xd56b('0x6f')](_0x133877[_0xd56b('0x6d')][_0x319701][_0x298f16[_0x350cf5]][_0xd56b('0x70')](/"/g,'\x27'));switch(_0x350cf5){case _0xd56b('0x39'):var _0x5e0cb6=moment(_0x3e9b66,_0xd56b('0xe'),!![]);if(_0x5e0cb6['isValid']()){_0x17740c[_0xd56b('0x25')]('\x22'+_0x3e9b66+'\x22');}else{_0x36d1b8['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xd56b('0x3d'):var _0x356bbf=parseInt(_0x3e9b66);_0x3e9b66=_[_0xd56b('0x71')](_0x356bbf)||_0x356bbf<0x0||_0x356bbf>0x4?_0x3f993f?0x3:0x2:_0x356bbf;_0x17740c[_0xd56b('0x25')]('\x22'+_0x3e9b66+'\x22');break;case _0xd56b('0x72'):var _0x4cdf98=parseInt(_0x3e9b66);if(_[_0xd56b('0x73')](_0x4cdf98)&&_[_0xd56b('0x74')](_0x2c1b7b,_0x4cdf98)){_0x17740c[_0xd56b('0x25')]('\x22'+_0x4cdf98+'\x22');}else{_0x36d1b8['push'](_0xd56b('0x75'));}break;case'email':if(isEmail(_0x3e9b66)){_0x17740c[_0xd56b('0x25')]('\x22'+_0x3e9b66+'\x22');}else{_0x36d1b8[_0xd56b('0x25')](_0xd56b('0x76'));}break;case _0xd56b('0x77'):var _0x18ceb1=moment(_0x3e9b66,_0xd56b('0x78'),!![]);if(_0x18ceb1['isValid']()){_0x17740c[_0xd56b('0x25')]('\x22'+_0x3e9b66+'\x22');}else{_0x36d1b8[_0xd56b('0x25')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x17740c[_0xd56b('0x25')]('\x22'+_0x3e9b66+'\x22');}}else{switch(_0x350cf5){case _0xd56b('0x79'):case _0xd56b('0x13'):_0x36d1b8[_0xd56b('0x25')](_0x350cf5+_0xd56b('0x7a'));break;default:_0x17740c[_0xd56b('0x25')]('\x22\x22');}}}}else{var _0x59ba0a='';if(!_['isNil'](_0x250582)){if(!_0x5954b1[_0xd56b('0x7b')](_0x250582['id'])){for(var _0x8d6e3f=0x0;_0x8d6e3f<_0x298f16[_0x350cf5][_0xd56b('0x1d')];_0x8d6e3f++){var _0x3e9b66=_[_0xd56b('0x6f')](_0x133877[_0xd56b('0x6d')][_0x319701][_0x298f16[_0x350cf5][_0x8d6e3f]]['replace'](/"/g,'\x27'));var _0x55ef03=phoneDescriptions[_0xd56b('0x6e')](_0x4b36c2=>_0x4b36c2['itemTypeId']===_0x250582['id']);if(!_[_0xd56b('0x1e')](_0x55ef03)){var _0x3b9c38=_['trim'](_0x133877[_0xd56b('0x6d')][_0x319701][_0x298f16[_0x55ef03[_0xd56b('0x7c')]][0x0]][_0xd56b('0x70')](/"/g,'\x27'));if(!_[_0xd56b('0x1e')](_0x3b9c38))_0x3e9b66=_0x3e9b66+'§'+_0x3b9c38;}if(_0x59ba0a=='')_0x59ba0a=_0x3e9b66;else _0x59ba0a+='|'+_0x3e9b66;}_0x5e6edc['push'](_0x250582['id']+':'+_0x59ba0a);_0x5954b1[_0x250582['id']]=0x1;}}}}if(hasAdditionalPhones){_0x17740c[_0xd56b('0x25')]('\x22'+_0x5e6edc[_0xd56b('0x15')](';')+'\x22');}if(_0x36d1b8[_0xd56b('0x1d')]){handleError(_0x133877[_0xd56b('0x6d')][_0x319701],{'code':_0xd56b('0x7d'),'message':_0x36d1b8[_0xd56b('0x15')]()});}else{fs[_0xd56b('0x7e')](_0x197529,_0x17740c[_0xd56b('0x15')]()+'\x0a');}_0x17740c=[];}if(!(stats[_0xd56b('0x7f')]%0xc8)){socket[_0xd56b('0x80')](_0xd56b('0x81')+_0x3c6f0a,stats);stats[_0xd56b('0x5f')]=[];}}if(stopped){logger[_0xd56b('0x5d')]('Abort\x20parser');_0x3bd5fe[_0xd56b('0x82')]();}}catch(_0x191ca8){handleError(_0x133877[_0xd56b('0x6d')][_0x319701],{'code':_0xd56b('0x83'),'message':_0x191ca8[_0xd56b('0x23')]});logger[_0xd56b('0x22')]('step',_0x191ca8[_0xd56b('0x23')]);}},'complete':function(){try{var _0x10bc95=[];var _0x3c945c=tempTableName;_0x10bc95[_0xd56b('0x25')](_0xd56b('0x84')+_0x3c945c+'\x20LIKE\x20cm_contacts;');logger[_0xd56b('0x5d')](_0xd56b('0x85'),contactItemTypes[_0xd56b('0x1d')]);var _0x5b2fc8=util[_0xd56b('0xd')]('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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x197529,_0x3c945c,_0x1103e6,_0x4ca57e[_0xd56b('0x3a')],_0x4ca57e[_0xd56b('0x57')]||null,NOW,NOW);if(_[_0xd56b('0x1e')](_0x298f16['scheduledat'])){_0x5b2fc8+=_0xd56b('0x86');}_0x10bc95['push'](_0x5b2fc8);BPromise[_0xd56b('0x87')](_0x10bc95,handleQuery)[_0xd56b('0x20')](function(_0x5ea669){BPromise[_0xd56b('0x26')]([handleAdditionalPhones()])[_0xd56b('0x20')](function(){_0x10bc95=[];for(var _0x540e64=0x0;_0x540e64\x20\x20','argv','existsSync','file\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','parse','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','sequelize','query','select\x20*\x20from\x20','length','isNil','push','all','then','message','AdditionalPhones','split','filter','CmContactHasItem','findOne','updated','PHONE','inserted','update','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.priority','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','recallme','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22always\x22','toString','cm_contacts.id','cm_contacts.createdAt','cm_hopper_black','fields','cm_contacts','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc8ac,0xe9));var _0xcc8a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc8ac[_0x32f7d7];return _0x133d09;};'use strict';var fs=require('fs');var path=require(_0xcc8a('0x0'));var _=require(_0xcc8a('0x1'));var Papa=require(_0xcc8a('0x2'));var util=require(_0xcc8a('0x3'));var BPromise=require('bluebird');var moment=require(_0xcc8a('0x4'));var squel=require('squel');var Redis=require(_0xcc8a('0x5'));var db=require(_0xcc8a('0x6'))['db'];var config=require(_0xcc8a('0x7'));var logger=require(_0xcc8a('0x8'))(_0xcc8a('0x9'));config['redis']=_['defaults'](config[_0xcc8a('0xa')],{'host':_0xcc8a('0xb'),'port':0x18eb});var socket=require(_0xcc8a('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0xcc8a('0xd'));var tempTableName=_0xcc8a('0xe')+moment()['format'](_0xcc8a('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x34f02f){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'](_0x34f02f);}function selectNotIn(_0x2c5025,_0x4e175e,_0x5b018a,_0x17c646,_0x186896){return squel[_0xcc8a('0x10')]()[_0xcc8a('0x11')](_0xcc8a('0x12'))[_0xcc8a('0x13')](_0x17c646)[_0xcc8a('0x14')](_0x4e175e,null,_0x4e175e+_0xcc8a('0x15')+_0x17c646+'.'+_0x5b018a)[_0xcc8a('0x16')](_0x17c646+'.'+_0x5b018a+_0xcc8a('0x17')+_0x2c5025+'.'+_0x5b018a)[_0xcc8a('0x16')](_0x4e175e+'.dialCheckDuplicateType\x20IN\x20('+_0x186896[_0xcc8a('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x19c3bd,_0x290a00){promisesAdditionalPhones=[];promisesContact=[];return db[_0xcc8a('0x18')][_0xcc8a('0x19')](_0xcc8a('0x1a')+tempTableName)['spread'](function(_0x3a6bde){if(_0x3a6bde!==null){var _0x42ceb5=[];for(var _0x439ce2=0x0;_0x439ce2<_0x3a6bde[_0xcc8a('0x1b')];_0x439ce2++){var _0x96e899=_0x3a6bde[_0x439ce2];if(!_[_0xcc8a('0x1c')](_0x96e899[_0xcc8a('0x12')])){if(!_['isNil'](_0x96e899['AdditionalPhones']))_0x42ceb5[_0xcc8a('0x1d')](insertAdditionalPhones(_0x96e899));promisesContact[_0xcc8a('0x1d')]({'contact':_0x96e899});}}}Promise[_0xcc8a('0x1e')](_0x42ceb5)[_0xcc8a('0x1f')](function(){_0x19c3bd({'val':0x1});});})['catch'](function(_0x32a62a){logger['error'](_0x32a62a[_0xcc8a('0x20')]);});});}function insertAdditionalPhones(_0x3a2e3d){return new Promise(function(_0xa76ad9,_0x5cafdd){var _0x28f2b5=_0x3a2e3d[_0xcc8a('0x21')];if(_['isNil'](_0x28f2b5))_0x5cafdd({'val':0x0});else{var _0x3373ca=_0x28f2b5[_0xcc8a('0x22')](';');var _0x264559=[];orderBy=0x0;for(var _0x2c84c6=0x0;_0x2c84c6<_0x3373ca[_0xcc8a('0x1b')];_0x2c84c6++){_0x264559['push'](splitAdditionalPhone(_0x3a2e3d['id'],_0x3373ca[_0x2c84c6]));}Promise[_0xcc8a('0x1e')](_0x264559)[_0xcc8a('0x1f')](function(){_0xa76ad9({'val':_0x3373ca['length']});});}});}function splitAdditionalPhone(_0x1f542e,_0x443759){return new Promise(function(_0x583e3a,_0xe63a38){var _0x3185c3=_0x443759[_0xcc8a('0x22')](':');var _0x71acf1=_0x3185c3[0x0];var _0x221841=_0x3185c3[0x1];if(_0x221841!==''){var _0x3043a7=_0x221841[_0xcc8a('0x22')]('|');var _0x3ff6b7=[];for(var _0x33ea69=0x0;_0x33ea69<_0x3043a7[_0xcc8a('0x1b')];_0x33ea69++){if(_0x3043a7[_0x33ea69]!==''){var _0x338351=_[_0xcc8a('0x23')](promisesAdditionalPhones,{'contactId':_0x1f542e,'phone':_0x3043a7[_0x33ea69]});if(_0x338351['length']==0x0){orderBy++;promisesAdditionalPhones[_0xcc8a('0x1d')]({'contactId':_0x1f542e,'contactTypeId':_0x71acf1,'phone':_0x3043a7[_0x33ea69],'orderBy':orderBy});}}}_0x583e3a({'ok':0x1});}else _0x583e3a({'res':0x0});});}function createAdditionalPhone(_0x404d64,_0x4d1583,_0x41271f,_0x27f03){var _0x3ded69='';var _0xa05041='';var _0x581ae8=_0x41271f[_0xcc8a('0x22')]('§');_0x3ded69=_0x581ae8[0x0];if(_0x581ae8[_0xcc8a('0x1b')]==0x2)_0xa05041=_0x581ae8[0x1];return new Promise(function(_0x3b5ba2,_0x32c0ea){return db[_0xcc8a('0x24')][_0xcc8a('0x25')]({'where':{'CmContactId':_0x404d64,'item':_0x3ded69}})[_0xcc8a('0x1f')](function(_0x3a9031){if(_0x3a9031){return db['CmContactHasItem']['update']({'ItemTypeId':_0x4d1583,'description':_0xa05041,'OrderBy':_0x27f03},{'where':{'CmContactId':_0x404d64,'item':_0x3ded69}})[_0xcc8a('0x1f')](function(_0x542aa4){_0x3b5ba2({'res':_0xcc8a('0x26')});});}else{return db[_0xcc8a('0x24')]['create']({'CmContactId':_0x404d64,'item':_0x3ded69,'ItemTypeId':_0x4d1583,'description':_0xa05041,'OrderBy':_0x27f03,'ItemClass':_0xcc8a('0x27')})['then'](function(_0x59c470){_0x3b5ba2({'res':_0xcc8a('0x28')});});}});});}function updateContact(_0x3791bd){return new Promise(function(_0x6a1f49,_0x2fe6d6){var _0x4c55a5=_0x3791bd['id'];delete _0x3791bd['id'];return db['CmContact'][_0xcc8a('0x29')](_0x3791bd,{'where':{'id':_0x4c55a5}})[_0xcc8a('0x1f')](function(_0x3c262a){updatedRows+=0x1;return db[_0xcc8a('0x2a')][_0xcc8a('0x29')]({'phone':_0x3791bd[_0xcc8a('0x12')]},{'where':{'ContactId':_0x4c55a5}})[_0xcc8a('0x1f')](function(_0xc4ee3f){_0x6a1f49({'ret':'OK'});});});});}function insertCmHopper(_0x22a4cf,_0x3bd63b,_0x36125f,_0x145bd4,_0x47f107){var _0xa9be8c=[_0xcc8a('0x2b'),_0xcc8a('0x2c'),'cm_contacts.id',_0xcc8a('0x2d'),_0x3bd63b+'.'+_0x145bd4,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xcc8a('0x2e'),'cm_contacts.UserId','\x22'+_0x47f107+'\x22'];return squel[_0xcc8a('0x2f')]()[_0xcc8a('0x30')](_0xcc8a('0x31'))[_0xcc8a('0x32')]([_0xcc8a('0x12'),'scheduledat',_0xcc8a('0x33'),_0xcc8a('0x34'),_0x145bd4,_0xcc8a('0x35'),_0xcc8a('0x36'),'priority','UserId',_0xcc8a('0x37')],squel['select']()['fields'](_0xa9be8c)['from'](_0x3bd63b)['join']('cm_contacts',null,_0xcc8a('0x38')+_0x3bd63b+_0xcc8a('0x39'))[_0xcc8a('0x14')](_0x36125f,null,_0x36125f+_0xcc8a('0x15')+_0x3bd63b+'.'+_0x145bd4)[_0xcc8a('0x16')](_0x3bd63b+'.CmListId\x20=\x20?',_0x22a4cf)[_0xcc8a('0x16')](_0xcc8a('0x3a'),NOW)[_0xcc8a('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3bd63b,_0x36125f,_0x145bd4,'cm_hopper',[_0xcc8a('0x3b'),'\x22onlyIfOpen\x22']))[_0xcc8a('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3bd63b,_0x36125f,_0x145bd4,_0xcc8a('0x31'),[_0xcc8a('0x3b')])))[_0xcc8a('0x3c')]();}function insertCmHopperBlack(_0x5436b4,_0x142c48,_0x3c769d,_0x49b90a){var _0x3635f5=[_0xcc8a('0x2b'),_0xcc8a('0x3d'),'cm_contacts.ListId',_0x142c48+'.'+_0x49b90a,_0xcc8a('0x3e'),'cm_contacts.updatedAt'];return squel['insert']()[_0xcc8a('0x30')](_0xcc8a('0x3f'))[_0xcc8a('0x32')]([_0xcc8a('0x12'),_0xcc8a('0x33'),_0xcc8a('0x34'),_0x49b90a,_0xcc8a('0x35'),'updatedAt'],squel[_0xcc8a('0x10')]()[_0xcc8a('0x40')](_0x3635f5)[_0xcc8a('0x13')](_0x142c48)[_0xcc8a('0x14')](_0xcc8a('0x41'),null,_0xcc8a('0x38')+_0x142c48+_0xcc8a('0x39'))['join'](_0x3c769d,null,_0x3c769d+'.id\x20=\x20'+_0x142c48+'.'+_0x49b90a)[_0xcc8a('0x16')](_0x142c48+'.CmListId\x20=\x20?',_0x5436b4)[_0xcc8a('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xcc8a('0x42'),squel[_0xcc8a('0x10')]()[_0xcc8a('0x11')](_0xcc8a('0x12'))[_0xcc8a('0x13')](_0xcc8a('0x3f'))['where']('ListId\x20=\x20?',_0x5436b4)[_0xcc8a('0x16')](_0x49b90a+_0xcc8a('0x43'),_0x142c48+'.'+_0x49b90a)))['toString']();}function insertCmHopperAdditionalPhones(_0x15aaef){var _0x596bb1=[_0xcc8a('0x44'),_0xcc8a('0x45'),_0xcc8a('0x46'),_0xcc8a('0x47'),_0xcc8a('0x48')];return squel[_0xcc8a('0x2f')]()[_0xcc8a('0x30')]('cm_hopper_additional_phones')[_0xcc8a('0x32')]([_0xcc8a('0x49'),_0xcc8a('0x12'),_0xcc8a('0x4a'),_0xcc8a('0x35'),_0xcc8a('0x36')],squel[_0xcc8a('0x10')]()[_0xcc8a('0x40')](_0x596bb1)['from'](_0xcc8a('0x31'))[_0xcc8a('0x14')](_0xcc8a('0x41'),null,_0xcc8a('0x4b'))[_0xcc8a('0x14')](_0xcc8a('0x4c'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xcc8a('0x16')](_0xcc8a('0x4d'),_0x15aaef)[_0xcc8a('0x16')](_0xcc8a('0x3a'),NOW))[_0xcc8a('0x3c')]();}function insertCmContact(_0x229ddb,_0x477783,_0x5ea3a9,_0x2a7fc9){var _0x502b10=_['concat'](_['keys'](_0x2a7fc9),[_0xcc8a('0x34'),_0xcc8a('0x4e'),_0xcc8a('0x35'),_0xcc8a('0x36')]);return squel['insert']()[_0xcc8a('0x30')](_0xcc8a('0x41'))['fromQuery'](_0x502b10,squel[_0xcc8a('0x10')]()[_0xcc8a('0x40')](_0x502b10)['from'](_0x477783)[_0xcc8a('0x16')]('('+_0x5ea3a9[_0xcc8a('0x14')](',')+_0xcc8a('0x4f'),squel[_0xcc8a('0x10')]()[_0xcc8a('0x40')](_0x5ea3a9)[_0xcc8a('0x13')](_0xcc8a('0x41'))[_0xcc8a('0x16')](_0xcc8a('0x50'),_0x229ddb))[_0xcc8a('0x16')](_0xcc8a('0x51'),squel['select']()['field'](_0xcc8a('0x52'),_0xcc8a('0x53'))['from'](_0x477783)[_0xcc8a('0x54')](_0x5ea3a9[_0xcc8a('0x14')](','))))['toString']();}function handleStop(){logger[_0xcc8a('0x55')](_0xcc8a('0x56'));stopped=!![];}function handleUncaughtException(_0x2fc801){logger[_0xcc8a('0x57')](_0x2fc801[_0xcc8a('0x20')]);process[_0xcc8a('0x58')](0x1);}function handleError(_0x4dbc00,_0x16bb00){stats[_0xcc8a('0x59')][_0xcc8a('0x1d')]({'name':_0x16bb00[_0xcc8a('0x5a')],'message':_0x16bb00['message'],'row':_0x4dbc00});}function handleQuery(_0x4f72d1){logger[_0xcc8a('0x55')](_0x4f72d1);return db[_0xcc8a('0x18')][_0xcc8a('0x19')](_0x4f72d1)[_0xcc8a('0x5b')](function(_0x84274c){results[_0xcc8a('0x1d')](_0x84274c);})[_0xcc8a('0x5c')](function(_0x139d27){logger[_0xcc8a('0x57')](_0x139d27[_0xcc8a('0x20')]);});}function main(_0x12b78c,_0x170a30,_0x52d2fc,_0x3d096c){logger[_0xcc8a('0x55')](_0xcc8a('0x5d'),_0x12b78c,JSON[_0xcc8a('0x5e')](_0x170a30));process['send'](_0xcc8a('0x5f'));var _0x361751=_0x170a30[_0xcc8a('0x60')];var _0x3a9da0=_[_0xcc8a('0x61')](_0x361751);var _0x4d361a=_0x170a30[_0xcc8a('0x62')];var _0x10b64e=path['join'](config['root'],_0xcc8a('0x63'),_0x4d361a+'.csv');logger['info'](_0xcc8a('0x64'),_0x170a30);db['ContactItemType'][_0xcc8a('0x65')]({'raw':!![],'attributes':['id',_0xcc8a('0x66')]})[_0xcc8a('0x1f')](function(_0x3f076c){for(var _0x571498=0x0;_0x571498<_0x3f076c[_0xcc8a('0x1b')];_0x571498++){if(_0x3f076c[_0x571498][_0xcc8a('0x66')]in _0x361751){contactItemTypes[_0xcc8a('0x1d')](_0x3f076c[_0x571498]);delete _0x3a9da0[_0x3f076c[_0x571498][_0xcc8a('0x66')]];hasAdditionalPhones=!![];}for(var _0x17653e in _0x361751){if(_0x3f076c[_0x571498][_0xcc8a('0x66')]+_0xcc8a('0x67')===_0x17653e){phoneDescriptions[_0xcc8a('0x1d')]({'itemTypeId':_0x3f076c[_0x571498]['id'],'description':_0x17653e});delete _0x3a9da0[_0x17653e];}}}if(hasAdditionalPhones)_0x3a9da0[_0xcc8a('0x21')]='';var _0x538aa7=_['keys'](_0x3a9da0)[_0xcc8a('0x14')]();logger[_0xcc8a('0x55')](_0xcc8a('0x68'),_0x538aa7);fs[_0xcc8a('0x69')](_0x10b64e,_0x538aa7+'\x0a');Papa['parse'](fs['createReadStream'](_0x12b78c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1f1497,_0x3eedf8){try{for(var _0x3ae3c0=0x0,_0x55beb7=[];_0x3ae3c0<_0x1f1497[_0xcc8a('0x6a')][_0xcc8a('0x1b')];_0x3ae3c0++){stats['rows']+=0x1;if(_0x1f1497['errors'][_0x3ae3c0]){handleError(_0x1f1497[_0xcc8a('0x6a')][_0x3ae3c0],_0x1f1497[_0xcc8a('0x59')][_0x3ae3c0]);}else{var _0x8015b5=[];var _0x4d7f9f=[];var _0x415603={};for(var _0x94301f in _0x361751){let _0x1c868d=contactItemTypes['find'](_0x32a00a=>_0x32a00a[_0xcc8a('0x66')]===_0x94301f);let _0x4b2eb0=contactItemTypes[_0xcc8a('0x6b')](_0x4c2110=>_0x4c2110['name']+_0xcc8a('0x67')===_0x94301f);if(_[_0xcc8a('0x1c')](_0x1c868d)&&_['isNil'](_0x4b2eb0)){if(_0x361751['hasOwnProperty'](_0x94301f)){if(_0x1f1497[_0xcc8a('0x6a')][_0x3ae3c0][_0x361751[_0x94301f]]){var _0xb905db=_[_0xcc8a('0x6c')](_0x1f1497['data'][_0x3ae3c0][_0x361751[_0x94301f]][_0xcc8a('0x6d')](/"/g,'\x27'));switch(_0x94301f){case _0xcc8a('0x6e'):var _0x330382=moment(_0xb905db,_0xcc8a('0xd'),!![]);if(_0x330382['isValid']()){_0x55beb7[_0xcc8a('0x1d')]('\x22'+_0xb905db+'\x22');}else{_0x8015b5['push'](_0xcc8a('0x6f'));}break;case _0xcc8a('0x70'):var _0x54fd0c=parseInt(_0xb905db);_0xb905db=_[_0xcc8a('0x71')](_0x54fd0c)||_0x54fd0c<0x0||_0x54fd0c>0x4?_0x3d096c?0x3:0x2:_0x54fd0c;_0x55beb7[_0xcc8a('0x1d')]('\x22'+_0xb905db+'\x22');break;case _0xcc8a('0x72'):var _0x4f6b34=parseInt(_0xb905db);if(_[_0xcc8a('0x73')](_0x4f6b34)&&_['includes'](_0x52d2fc,_0x4f6b34)){_0x55beb7[_0xcc8a('0x1d')]('\x22'+_0x4f6b34+'\x22');}else{_0x8015b5[_0xcc8a('0x1d')](_0xcc8a('0x74'));}break;case _0xcc8a('0x75'):if(isEmail(_0xb905db)){_0x55beb7[_0xcc8a('0x1d')]('\x22'+_0xb905db+'\x22');}else{_0x8015b5[_0xcc8a('0x1d')](_0xcc8a('0x76'));}break;case _0xcc8a('0x77'):var _0x5952cb=moment(_0xb905db,'YYYY-MM-DD',!![]);if(_0x5952cb[_0xcc8a('0x78')]()){_0x55beb7[_0xcc8a('0x1d')]('\x22'+_0xb905db+'\x22');}else{_0x8015b5[_0xcc8a('0x1d')](_0xcc8a('0x79'));}break;default:_0x55beb7[_0xcc8a('0x1d')]('\x22'+_0xb905db+'\x22');}}else{switch(_0x94301f){case _0xcc8a('0x7a'):case'phone':_0x8015b5[_0xcc8a('0x1d')](_0x94301f+_0xcc8a('0x7b'));break;default:_0x55beb7[_0xcc8a('0x1d')]('\x22\x22');}}}}else{var _0x236784='';if(!_[_0xcc8a('0x1c')](_0x1c868d)){if(!_0x415603['hasOwnProperty'](_0x1c868d['id'])){for(var _0xe9078f=0x0;_0xe9078f<_0x361751[_0x94301f][_0xcc8a('0x1b')];_0xe9078f++){var _0xb905db=_['trim'](_0x1f1497[_0xcc8a('0x6a')][_0x3ae3c0][_0x361751[_0x94301f][_0xe9078f]][_0xcc8a('0x6d')](/"/g,'\x27'));var _0x852750=phoneDescriptions[_0xcc8a('0x6b')](_0x4ce7db=>_0x4ce7db['itemTypeId']===_0x1c868d['id']);if(!_['isNil'](_0x852750)){var _0x18f5d9=_['trim'](_0x1f1497['data'][_0x3ae3c0][_0x361751[_0x852750[_0xcc8a('0x7c')]][0x0]][_0xcc8a('0x6d')](/"/g,'\x27'));if(!_['isNil'](_0x18f5d9))_0xb905db=_0xb905db+'§'+_0x18f5d9;}if(_0x236784=='')_0x236784=_0xb905db;else _0x236784+='|'+_0xb905db;}_0x4d7f9f[_0xcc8a('0x1d')](_0x1c868d['id']+':'+_0x236784);_0x415603[_0x1c868d['id']]=0x1;}}}}if(hasAdditionalPhones){_0x55beb7['push']('\x22'+_0x4d7f9f[_0xcc8a('0x14')](';')+'\x22');}if(_0x8015b5[_0xcc8a('0x1b')]){handleError(_0x1f1497[_0xcc8a('0x6a')][_0x3ae3c0],{'code':_0xcc8a('0x7d'),'message':_0x8015b5[_0xcc8a('0x14')]()});}else{fs[_0xcc8a('0x7e')](_0x10b64e,_0x55beb7['join']()+'\x0a');}_0x55beb7=[];}if(!(stats['rows']%0xc8)){socket[_0xcc8a('0x7f')](_0xcc8a('0x80')+_0x4d361a,stats);stats[_0xcc8a('0x59')]=[];}}if(stopped){logger[_0xcc8a('0x55')](_0xcc8a('0x81'));_0x3eedf8['abort']();}}catch(_0x542d6c){handleError(_0x1f1497[_0xcc8a('0x6a')][_0x3ae3c0],{'code':_0xcc8a('0x82'),'message':_0x542d6c[_0xcc8a('0x20')]});logger[_0xcc8a('0x57')](_0xcc8a('0x83'),_0x542d6c[_0xcc8a('0x20')]);}},'complete':function(){try{var _0x47764a=[];var _0x1ed1a4=tempTableName;_0x47764a[_0xcc8a('0x1d')](_0xcc8a('0x84')+_0x1ed1a4+'\x20LIKE\x20cm_contacts;');logger[_0xcc8a('0x55')](_0xcc8a('0x85'),contactItemTypes[_0xcc8a('0x1b')]);var _0x29541f=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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x10b64e,_0x1ed1a4,_0x538aa7,_0x170a30[_0xcc8a('0x34')],_0x170a30[_0xcc8a('0x4e')]||null,NOW,NOW);if(_['isNil'](_0x361751['scheduledat'])){_0x29541f+=_0xcc8a('0x86');}_0x47764a['push'](_0x29541f);BPromise[_0xcc8a('0x87')](_0x47764a,handleQuery)['then'](function(_0x1c6b4d){BPromise[_0xcc8a('0x1e')]([handleAdditionalPhones()])[_0xcc8a('0x1f')](function(){_0x47764a=[];for(var _0x5ce344=0x0;_0x5ce344\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_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.id','i.updatedAt','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','Owner.internal','TagIds','limit','offset','sequelize','Setting','enableEmailPreview','clone','COUNT(*)','unreadMessages','isEmpty','t.id\x20IN\x20?','QueryTypes','../parsers/advancedSearch','../parsers/qs','updateInteraction','../../mysqldb','role','agent','search','select','field','name','from','tools_tags','_interactions','u.id','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','getInteractionsTables','getAccountFK','getInteractionFK'];(function(_0x25202d,_0xebd61b){var _0x2a1b45=function(_0x58e30f){while(--_0x58e30f){_0x25202d['push'](_0x25202d['shift']());}};_0x2a1b45(++_0xebd61b);}(_0x3f96,0x129));var _0x63f9=function(_0x551b04,_0x185dc7){_0x551b04=_0x551b04-0x0;var _0x195756=_0x3f96[_0x551b04];return _0x195756;};'use strict';var _=require('lodash');var squel=require('squel');var as=require(_0x63f9('0x0'));var qs=require(_0x63f9('0x1'));var updateInteraction=require('./update-interaction')[_0x63f9('0x2')];var utils=require('./utils');var db=require(_0x63f9('0x3'))['db'];function skipInteractionsQuery(_0x3c32da,_0x330fa7,_0x2e4c00){var _0x2a53c7=![];var _0x48512a=utils['getAccountFK'](_0x3c32da);if(_0x330fa7[_0x63f9('0x4')]===_0x63f9('0x5')&&!_0x2e4c00[_0x63f9('0x6')]&&!_0x2e4c00[_0x48512a]){_0x2a53c7=!![];}return _0x2a53c7;}function getTagsQuery(){return squel[_0x63f9('0x7')]()['field']('id')[_0x63f9('0x8')](_0x63f9('0x9'))[_0x63f9('0x8')]('color')[_0x63f9('0xa')](_0x63f9('0xb'));}function getUsersQuery(_0x39a66c,_0x1081ec){var _0x67a0e6=utils['getInteractionFK'](_0x39a66c);var _0x4c5802='user_has_'+_0x39a66c+_0x63f9('0xc');var _0xff71a8=squel[_0x63f9('0x7')]()['field'](_0x63f9('0xd'))[_0x63f9('0x8')]('u.fullname')[_0x63f9('0x8')](_0x63f9('0xe')+_0x67a0e6)[_0x63f9('0xa')](_0x4c5802,'ui')[_0x63f9('0xf')](_0x63f9('0x10'),'u',_0x63f9('0x11'));if(_0x1081ec[_0x63f9('0x12')]>0x0){_0xff71a8[_0x63f9('0x13')](_0x63f9('0xe')+_0x67a0e6+'\x20IN\x20?',_['map'](_0x1081ec,'id'));}return _0xff71a8;}function getInteractionsQuery(_0x30f084){var _0x49db2c=utils[_0x63f9('0x14')](_0x30f084);var _0x3c2533=utils[_0x63f9('0x15')](_0x30f084);var _0xc846c6=utils[_0x63f9('0x16')](_0x30f084);return squel[_0x63f9('0x7')]()[_0x63f9('0xa')](_0x49db2c[_0x63f9('0x17')],'i')[_0x63f9('0xf')](_0x63f9('0x18'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x63f9('0xf')](_0x63f9('0x10'),'o',_0x63f9('0x19'))[_0x63f9('0xf')](_0x49db2c['accounts'],'a',_0x63f9('0x1a')+_0x3c2533)[_0x63f9('0xf')](_0x49db2c[_0x63f9('0x1b')],'me','me.'+_0xc846c6+_0x63f9('0x1c'))[_0x63f9('0xf')](_0x49db2c['interactionsTags'],'it',_0x63f9('0x1d')+_0xc846c6+_0x63f9('0x1c'))[_0x63f9('0xf')](_0x63f9('0xb'),'t',_0x63f9('0x1e'));}function getSqlClauses(){var _0x3a1a49={'body':squel[_0x63f9('0x1f')](),'contact':squel[_0x63f9('0x1f')](),'default':squel['expr'](),'fields':squel[_0x63f9('0x1f')](),'filter':squel[_0x63f9('0x1f')](),'read':squel[_0x63f9('0x1f')](),'tags':{'clause':squel[_0x63f9('0x1f')](),'ids':null},'user':squel[_0x63f9('0x1f')]()};return _0x3a1a49;}function parseTagParameter(_0xd18691){var _0x3b2afc=squel[_0x63f9('0x1f')]();if(_0xd18691){var _0x5a2010=utils[_0x63f9('0x20')](_0xd18691);_0x5a2010[_0x63f9('0x21')](function(_0x10ff16){_0x3b2afc['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x10ff16+',%');});}return _0x3b2afc;}function parseReadParameter(_0x1a141e){var _0xc4cb70='';if(_0x1a141e){_0xc4cb70=_0x63f9('0x22');if(_0x1a141e==='1'){_0xc4cb70=_0xc4cb70[_0x63f9('0x23')](_0x63f9('0x24'),'=');}else{_0xc4cb70=_0xc4cb70['replace']('{OPERATOR}','>');}}return _0xc4cb70;}function parseSearchFilter(_0x104ac7,_0x1e4a1f){var _0x4322e8=squel[_0x63f9('0x1f')]();if(_0x1e4a1f){var _0x543719=_0x1e4a1f['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x543719)){_0x4322e8['or'](_0x63f9('0x25'),_0x543719+'%');if([_0x63f9('0x26'),_0x63f9('0x27')][_0x63f9('0x28')](_0x104ac7)){_0x4322e8['or'](_0x63f9('0x29'),_0x543719+'%');}else if(_0x104ac7===_0x63f9('0x2a')){_0x4322e8['or']('i.fax\x20LIKE\x20?',_0x543719+'%');}else if(_0x104ac7===_0x63f9('0x2b')){_0x4322e8['or'](_0x63f9('0x2c'),_0x543719+'%');}}else if(_0x104ac7===_0x63f9('0x2d')&&qs[_0x63f9('0x2e')](_0x543719)){_0x4322e8['or']('c.email\x20LIKE\x20?',_0x543719+'%');}else{if(_0x104ac7===_0x63f9('0x2d')){_0x4322e8['or'](_0x63f9('0x2f'),qs[_0x63f9('0x30')](_0x543719,!![]))['or'](_0x63f9('0x31'),qs[_0x63f9('0x30')](_0x543719));}else if(_0x104ac7!==_0x63f9('0x2a')){_0x4322e8['or'](_0x63f9('0x32'),qs[_0x63f9('0x30')](_0x543719));}_0x4322e8['or'](_0x63f9('0x33'),qs[_0x63f9('0x30')](_0x543719,!![]),null);}}return _0x4322e8;}function parseAdvancedSearchFilter(_0x18ceb6,_0x464648){var _0x3c8668=getSqlClauses();var _0xbe7361=as[_0x63f9('0x34')](_0x18ceb6);var _0x491b7b=_0xbe7361[_0x63f9('0x35')];for(var _0x288ed8=0x0;_0x288ed8<_0xbe7361[_0x63f9('0x36')][_0x63f9('0x12')];_0x288ed8++){var _0x16cb80=_0xbe7361[_0x63f9('0x36')][_0x288ed8];var _0x208b5a='i';var _0x38f38c=_[_0x63f9('0x37')](_0x464648,[_0x63f9('0x9'),_0x16cb80[_0x63f9('0x8')]]);if(_0x38f38c){var _0x40e333=as[_0x63f9('0x38')](_0x208b5a,_0x38f38c[_0x63f9('0x39')],_0x16cb80);_0x3c8668[_0x63f9('0x3a')][_0x491b7b](_0x40e333[_0x63f9('0x3b')],_0x40e333['value'][_0x63f9('0x3c')],_0x40e333['value']['end']);}else{switch(_0x16cb80[_0x63f9('0x8')]){case'unreadMessages':var _0x527d28=parseReadParameter(_0x16cb80[_0x63f9('0x3d')]);_0x3c8668[_0x63f9('0x3e')][_0x63f9('0x3f')](_0x527d28);break;case _0x63f9('0x40'):if(_0x16cb80['operator']===_0x63f9('0x41')){if(_0x16cb80[_0x63f9('0x3d')]['split']('\x20')[_0x63f9('0x12')]>0x1){_0x3c8668[_0x63f9('0x42')][_0x491b7b](_0x63f9('0x33'),qs['getFullTextValue'](_0x16cb80['value'],!![]),null);}else{var _0x2cd5d4='%'+_0x16cb80[_0x63f9('0x3d')]+'%';_0x3c8668['contact'][_0x491b7b](_0x63f9('0x43'),_0x2cd5d4,_0x2cd5d4,_0x2cd5d4);}}else{_0x38f38c=_[_0x63f9('0x37')](_0x464648,[_0x63f9('0x9'),_0x63f9('0x44')]);_0x16cb80[_0x63f9('0x8')]=_0x63f9('0x44');_0x40e333=as[_0x63f9('0x38')](_0x208b5a,_0x38f38c[_0x63f9('0x39')],_0x16cb80);_0x3c8668[_0x63f9('0x42')][_0x491b7b](_0x40e333[_0x63f9('0x3b')],_0x40e333[_0x63f9('0x3d')][_0x63f9('0x3c')],_0x40e333[_0x63f9('0x3d')]['end']);}break;case'Tag':var _0x3508b1=_0x16cb80[_0x63f9('0x3d')][_0x63f9('0x45')](',')[_0x63f9('0x46')](function(_0xed1d67){return Number(_0xed1d67);});var _0x13c20f=parseTagParameter(_0x3508b1);_0x3c8668[_0x63f9('0x47')][_0x63f9('0x48')][_0x63f9('0x3f')](_0x13c20f);_0x3c8668[_0x63f9('0x47')][_0x63f9('0x49')]=_0x3508b1;break;case _0x63f9('0x4a'):if(_0x16cb80[_0x63f9('0x4b')]===_0x63f9('0x41')){_0x3c8668[_0x63f9('0x4c')][_0x491b7b](_0x63f9('0x4d'),'%'+_0x16cb80[_0x63f9('0x3d')]+'%',null);}else{_0x38f38c=_[_0x63f9('0x37')](_0x464648,[_0x63f9('0x9'),'UserId']);_0x16cb80[_0x63f9('0x8')]=_0x63f9('0x4e');_0x40e333=as[_0x63f9('0x38')](_0x208b5a,_0x38f38c[_0x63f9('0x39')],_0x16cb80);_0x3c8668[_0x63f9('0x4c')][_0x491b7b](_0x40e333[_0x63f9('0x3b')],_0x40e333[_0x63f9('0x3d')]['start'],_0x40e333[_0x63f9('0x3d')][_0x63f9('0x4f')]);}break;case _0x63f9('0x50'):case _0x63f9('0x51'):_0x40e333=as[_0x63f9('0x38')]('me',null,_0x16cb80);_0x3c8668[_0x63f9('0x50')][_0x491b7b](_0x40e333['text'],_0x40e333[_0x63f9('0x3d')]['start'],_0x40e333['value']['end']);break;}}}return _0x3c8668;}function parseModelFields(_0x559937,_0x1fc791,_0x338183){var _0x217f2f=utils[_0x63f9('0x15')](_0x559937);var _0x1a398e=squel[_0x63f9('0x1f')]();var _0x2b1c1e=_(_0x1fc791)['keys']()[_0x63f9('0x46')](function(_0x30e58a){return _[_0x63f9('0x52')](_0x338183,[_0x63f9('0x9'),_0x30e58a])?_0x30e58a:undefined;})[_0x63f9('0x53')]()['value']();if(_0x2b1c1e['length']>0x0){_0x2b1c1e['forEach'](function(_0x5bfcd9){if(_0x5bfcd9===_0x217f2f){_0x1a398e['and']('i.'+_0x217f2f+'\x20IN\x20?',[]['concat'](_0x1fc791[_0x5bfcd9]));}else if(_0x5bfcd9==='createdAt'){var _0x17dedc=JSON[_0x63f9('0x54')](_0x1fc791[_0x5bfcd9])[_0x63f9('0x55')];var _0x2f160b=JSON[_0x63f9('0x54')](_0x1fc791[_0x5bfcd9])['$lte'];_0x1a398e[_0x63f9('0x3f')](_0x63f9('0x56'),_0x17dedc,_0x2f160b);}else{if(_0x1fc791[_0x5bfcd9]===_0x63f9('0x57')){_0x1a398e[_0x63f9('0x3f')]('i.'+_0x5bfcd9+'\x20IS\x20NULL');}else{_0x1a398e[_0x63f9('0x3f')]('i.'+_0x5bfcd9+_0x63f9('0x58'),_0x1fc791[_0x5bfcd9]);}}});}return _0x1a398e;}function parseQueryParameters(_0x750e56,_0x1eb5d9,_0x52e4f6){var _0x4c7e02=getSqlClauses();return Promise[_0x63f9('0x59')]()['then'](function(){return parseModelFields(_0x750e56,_0x1eb5d9,_0x52e4f6);})[_0x63f9('0x5a')](function(_0x3686bd){_0x4c7e02['fields'][_0x63f9('0x3f')](_0x3686bd);return parseReadParameter(_0x1eb5d9['read']);})[_0x63f9('0x5a')](function(_0x7dc15b){_0x4c7e02[_0x63f9('0x3e')][_0x63f9('0x3f')](_0x7dc15b);return parseTagParameter(_0x1eb5d9[_0x63f9('0x5b')]);})[_0x63f9('0x5a')](function(_0x4dc44e){_0x4c7e02[_0x63f9('0x47')][_0x63f9('0x48')][_0x63f9('0x3f')](_0x4dc44e);return parseSearchFilter(_0x750e56,_0x1eb5d9[_0x63f9('0x5c')]);})[_0x63f9('0x5a')](function(_0x33e0c1){_0x4c7e02[_0x63f9('0x5c')]=_0x33e0c1;return _0x4c7e02;});}function checkAccountsRestrictions(_0x4099f4,_0x18ffb5,_0x330efe){var _0x547542=utils['getAccountFK'](_0x4099f4);var _0x22783=_0x63f9('0x5d')+_[_0x63f9('0x5e')](_0x4099f4)+(_0x4099f4==='chat'?_0x63f9('0x5f'):_0x63f9('0x60'));var _0x47cd96=squel[_0x63f9('0x1f')]();return Promise[_0x63f9('0x59')]()[_0x63f9('0x5a')](function(){if(_0x330efe[_0x63f9('0x6')]&&_0x18ffb5[_0x63f9('0x4')]===_0x63f9('0x5')){return _0x18ffb5[_0x22783]({'attributes':['id'],'raw':!![]});}})[_0x63f9('0x5a')](function(_0x9ad225){if(_0x9ad225){if(_0x9ad225[_0x63f9('0x12')]===0x0){_0x47cd96['and']('i.'+_0x547542+_0x63f9('0x61'));}else{_0x47cd96[_0x63f9('0x3f')]('i.'+_0x547542+_0x63f9('0x62'),_['map'](_0x9ad225,'id'));}}else if(!_0x330efe[_0x547542]){_0x47cd96[_0x63f9('0x3f')]('i.'+_0x547542+_0x63f9('0x63'));}})[_0x63f9('0x5a')](function(){return _0x47cd96;});}function getClosedOrderClause(_0x936fd4,_0x4da708){var _0xb36d97='';var _0x161718=['i.thirdDisposition',_0x63f9('0x64'),_0x63f9('0x65')];if(_0x936fd4===_0x63f9('0x2d')){_0x161718[_0x63f9('0x66')](_0x63f9('0x67'));}if(_0x4da708[_0x63f9('0x68')]==='0'&&_0x936fd4===_0x63f9('0x2d')){_0xb36d97=_0x63f9('0x67');}else{if(_0x4da708[_0x63f9('0x68')]==='1'){_0x161718[_0x63f9('0x69')]();}_0xb36d97=_0x63f9('0x6a')+_0x161718['join'](',\x20')+')';}return _0xb36d97;}function getFilteredInteractions(_0x199132,_0x143c71,_0x2b198d,_0x513cfa){var _0xe89cc4=utils['getInteractionFK'](_0x199132);var _0x5a01ff=_[_0x63f9('0x5e')](_0x199132)+'Interaction';var _0x476eea=[];var _0x16e851=getTagsQuery();var _0x272058={'type':db[_0x63f9('0x6b')]['QueryTypes'][_0x63f9('0x6c')],'raw':!![]};var _0x513442=[];var _0x4dc2f4=[];return db['sequelize'][_0x63f9('0x6d')](_0x16e851[_0x63f9('0x6e')](),_0x272058)[_0x63f9('0x5a')](function(_0x12d272){_0x476eea=_[_0x63f9('0x6f')](_0x12d272,'id');_0x272058=_[_0x63f9('0x70')](_0x272058,{'model':db[_0x5a01ff],'mapToModel':!![],'nest':!![]});if(_0x2b198d['fields']){_0x513cfa[_0x63f9('0x71')][_0x63f9('0x21')](function(_0xa26f72){_0x143c71[_0x63f9('0x8')]('i.'+_0xa26f72);});}else{_0x143c71['field'](_0x63f9('0x72'),'unreadMessages');_0x143c71[_0x63f9('0x8')](_0x63f9('0x73'),_0x63f9('0x74'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x75'),_0x63f9('0x76'));if(_0x199132===_0x63f9('0x2d')){_0x143c71[_0x63f9('0x8')](_0x63f9('0x77'),_0x63f9('0x78'));_0x143c71['field'](_0x63f9('0x79'),_0x63f9('0x7a'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x7b'));_0x143c71[_0x63f9('0x8')]('i.createdAt');_0x143c71[_0x63f9('0x8')](_0x63f9('0x7c'));_0x143c71[_0x63f9('0x8')]('i.closed');_0x143c71[_0x63f9('0x8')](_0x63f9('0x7d'));_0x143c71[_0x63f9('0x8')]('i.attach');_0x143c71[_0x63f9('0x8')](_0x63f9('0x7e'));_0x143c71['field'](_0x63f9('0x7f'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x80'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x65'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x64'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x81'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x67'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x82'));_0x143c71['field'](_0x63f9('0x83'));_0x143c71['field'](_0x63f9('0x84'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x85'));}else if(_0x199132===_0x63f9('0x2b')){_0x143c71['field'](_0x63f9('0x86'),_0x63f9('0x7a'));}else{_0x143c71[_0x63f9('0x8')]('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',_0x63f9('0x7a'));}if(_0x199132!==_0x63f9('0x2d')){_0x143c71['field'](_0x63f9('0x87'));}_0x143c71[_0x63f9('0x8')](_0x63f9('0x88'),_0x63f9('0x89'));_0x143c71['field'](_0x63f9('0x8a'),_0x63f9('0x8b'));_0x143c71['field'](_0x63f9('0x8c'),_0x63f9('0x8d'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x8e'),'Contact.phone');_0x143c71[_0x63f9('0x8')](_0x63f9('0x8f'),_0x63f9('0x90'));_0x143c71['field']('c.fax',_0x63f9('0x91'));_0x143c71[_0x63f9('0x8')]('o.fullname',_0x63f9('0x92'));_0x143c71[_0x63f9('0x8')]('o.internal',_0x63f9('0x93'));_0x143c71[_0x63f9('0x8')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x63f9('0x94'));}if(_0x513cfa['limit']){_0x143c71[_0x63f9('0x95')](_0x513cfa[_0x63f9('0x95')]);}if(_0x513cfa[_0x63f9('0x96')]){_0x143c71[_0x63f9('0x96')](_0x513cfa[_0x63f9('0x96')]);}return db[_0x63f9('0x97')][_0x63f9('0x6d')](_0x143c71[_0x63f9('0x6e')](),_0x272058);})[_0x63f9('0x5a')](function(_0x56a253){_0x513442=_0x56a253;var _0xb1428a=getUsersQuery(_0x199132,_0x513442);return db['sequelize'][_0x63f9('0x6d')](_0xb1428a[_0x63f9('0x6e')](),_0x272058);})['then'](function(_0x22d88b){_0x4dc2f4=_['groupBy'](_0x22d88b,_0xe89cc4);if(_0x199132===_0x63f9('0x2d')){return db[_0x63f9('0x98')]['findOne']({'attributes':[_0x63f9('0x99')],'raw':!![]});}})[_0x63f9('0x5a')](function(_0x5e7608){var _0x855f85=_0x5e7608?_0x5e7608[_0x63f9('0x99')]:undefined;var _0x39789e=_0x513442['map'](function(_0xb5c302){return updateInteraction(_0xb5c302,_0x476eea,_0x4dc2f4,_0x855f85);});return Promise['all'](_0x39789e);});}function countFilteredInteractions(_0x187314,_0x432db5){var _0x2682a9=_0x187314[_0x63f9('0x9a')]();_0x2682a9[_0x63f9('0x8')](_0x63f9('0x9b'));_0x2682a9[_0x63f9('0x8')](_0x63f9('0x72'),_0x63f9('0x9c'));var _0x5a8556=utils['getSelectedTags'](_0x432db5);if(!_[_0x63f9('0x9d')](_0x5a8556)){_0x2682a9['where'](_0x63f9('0x9e'),_0x5a8556);}var _0x401779={'type':db[_0x63f9('0x6b')][_0x63f9('0x9f')][_0x63f9('0x6c')],'raw':!![]};return db['sequelize'][_0x63f9('0x6d')](_0x2682a9[_0x63f9('0x6e')](),_0x401779);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xe2ee=['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.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','groupBy','Setting','findOne','enableEmailPreview','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','Sequelize','exports','lodash','../parsers/advancedSearch','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','select','field','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','mail','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','sqlOperator','conditions','find','name','buildExpression','text','value','start','end','unreadMessages','read','and','Contact','operator','$substring','split','contact','ContactId','type','Tag','tags','ids','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','plainBody','body','some','compact','forEach','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','resolve','then','fields','filter','capitalize','chat','Websites','Accounts','search','\x20IS\x20NULL','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','QueryTypes','sequelize','toString','keyBy','attributes','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_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.id','i.createdAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','i.UserId','openchannel','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'];(function(_0x5caa59,_0x365340){var _0x44b83c=function(_0xea57de){while(--_0xea57de){_0x5caa59['push'](_0x5caa59['shift']());}};_0x44b83c(++_0x365340);}(_0xe2ee,0x163));var _0xee2e=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0xe2ee[_0xc77819];return _0x1c9434;};'use strict';var _=require(_0xee2e('0x0'));var squel=require('squel');var as=require(_0xee2e('0x1'));var qs=require(_0xee2e('0x2'));var updateInteraction=require('./update-interaction')[_0xee2e('0x3')];var utils=require(_0xee2e('0x4'));var db=require(_0xee2e('0x5'))['db'];function skipInteractionsQuery(_0x3b5f74,_0x484d6e,_0x7b0942){var _0x42f8e8=![];var _0x57901c=utils[_0xee2e('0x6')](_0x3b5f74);if(_0x484d6e[_0xee2e('0x7')]===_0xee2e('0x8')&&!_0x7b0942['search']&&!_0x7b0942[_0x57901c]){_0x42f8e8=!![];}return _0x42f8e8;}function getTagsQuery(){return squel[_0xee2e('0x9')]()['field']('id')[_0xee2e('0xa')]('name')[_0xee2e('0xa')]('color')[_0xee2e('0xb')](_0xee2e('0xc'));}function getUsersQuery(_0x309560,_0x457322){var _0x72c94f=utils[_0xee2e('0xd')](_0x309560);var _0x55342c=_0xee2e('0xe')+_0x309560+_0xee2e('0xf');var _0x58fb9a=squel[_0xee2e('0x9')]()[_0xee2e('0xa')](_0xee2e('0x10'))[_0xee2e('0xa')](_0xee2e('0x11'))[_0xee2e('0xa')](_0xee2e('0x12')+_0x72c94f)[_0xee2e('0xb')](_0x55342c,'ui')['left_join'](_0xee2e('0x13'),'u',_0xee2e('0x14'));if(_0x457322[_0xee2e('0x15')]>0x0){_0x58fb9a[_0xee2e('0x16')]('ui.'+_0x72c94f+_0xee2e('0x17'),_[_0xee2e('0x18')](_0x457322,'id'));}return _0x58fb9a;}function getInteractionsQuery(_0xb6e61e){var _0x113955=utils[_0xee2e('0x19')](_0xb6e61e);var _0x5d0096=utils[_0xee2e('0x6')](_0xb6e61e);var _0x1cb869=utils['getInteractionFK'](_0xb6e61e);return squel[_0xee2e('0x9')]()['from'](_0x113955[_0xee2e('0x1a')],'i')[_0xee2e('0x1b')](_0xee2e('0x1c'),'c',_0xee2e('0x1d'))[_0xee2e('0x1b')](_0xee2e('0x13'),'o',_0xee2e('0x1e'))[_0xee2e('0x1b')](_0x113955['accounts'],'a',_0xee2e('0x1f')+_0x5d0096)[_0xee2e('0x1b')](_0x113955['messages'],'me',_0xee2e('0x20')+_0x1cb869+_0xee2e('0x21'))[_0xee2e('0x1b')](_0x113955[_0xee2e('0x22')],'it',_0xee2e('0x23')+_0x1cb869+_0xee2e('0x21'))[_0xee2e('0x1b')](_0xee2e('0xc'),'t',_0xee2e('0x24'));}function getSqlClauses(){var _0x366526={'body':squel[_0xee2e('0x25')](),'contact':squel['expr'](),'default':squel[_0xee2e('0x25')](),'fields':squel['expr'](),'filter':squel[_0xee2e('0x25')](),'read':squel['expr'](),'tags':{'clause':squel[_0xee2e('0x25')](),'ids':null},'user':squel[_0xee2e('0x25')]()};return _0x366526;}function parseTagParameter(_0x4ec9db){var _0x3804bd=squel['expr']();if(_0x4ec9db){var _0x2a91e9=utils[_0xee2e('0x26')](_0x4ec9db);_0x2a91e9['forEach'](function(_0xad7692){_0x3804bd['or'](_0xee2e('0x27'),'%,'+_0xad7692+',%');});}return _0x3804bd;}function parseReadParameter(_0x5630e6){var _0x8cf260='';if(_0x5630e6){_0x8cf260=_0xee2e('0x28');if(_0x5630e6==='1'){_0x8cf260=_0x8cf260['replace']('{OPERATOR}','=');}else{_0x8cf260=_0x8cf260[_0xee2e('0x29')](_0xee2e('0x2a'),'>');}}return _0x8cf260;}function parseSearchFilter(_0x2cb8b2,_0x3be737){var _0x319c94=squel[_0xee2e('0x25')]();if(_0x3be737){var _0x95a59a=_0x3be737[_0xee2e('0x29')]('\x5c','\x5c\x5c')[_0xee2e('0x29')](/'/g,'\x27\x27');if(qs[_0xee2e('0x2b')](_0x95a59a)){_0x319c94['or'](_0xee2e('0x2c'),_0x95a59a+'%');if([_0xee2e('0x2d'),_0xee2e('0x2e')][_0xee2e('0x2f')](_0x2cb8b2)){_0x319c94['or'](_0xee2e('0x30'),_0x95a59a+'%');}else if(_0x2cb8b2===_0xee2e('0x31')){_0x319c94['or'](_0xee2e('0x32'),_0x95a59a+'%');}else if(_0x2cb8b2==='openchannel'){_0x319c94['or'](_0xee2e('0x33'),_0x95a59a+'%');}}else if(_0x2cb8b2==='mail'&&qs[_0xee2e('0x34')](_0x95a59a)){_0x319c94['or'](_0xee2e('0x35'),_0x95a59a+'%');}else{if(_0x2cb8b2===_0xee2e('0x36')){_0x319c94['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xee2e('0x37')](_0x95a59a,!![]))['or'](_0xee2e('0x38'),qs[_0xee2e('0x37')](_0x95a59a));}else if(_0x2cb8b2!==_0xee2e('0x31')){_0x319c94['or'](_0xee2e('0x39'),qs['getFullTextValue'](_0x95a59a));}_0x319c94['or'](_0xee2e('0x3a'),qs['getFullTextValue'](_0x95a59a,!![]),null);}}return _0x319c94;}function parseAdvancedSearchFilter(_0x36c818,_0x5ebaab){var _0x37580b=getSqlClauses();var _0x513a1c=as['parseSearch'](_0x36c818);var _0x40d210=_0x513a1c[_0xee2e('0x3b')];for(var _0x129ac6=0x0;_0x129ac6<_0x513a1c['conditions'][_0xee2e('0x15')];_0x129ac6++){var _0x3d9902=_0x513a1c[_0xee2e('0x3c')][_0x129ac6];var _0x3e6e1d='i';var _0x2bcf76=_[_0xee2e('0x3d')](_0x5ebaab,[_0xee2e('0x3e'),_0x3d9902['field']]);if(_0x2bcf76){var _0x38acb5=as[_0xee2e('0x3f')](_0x3e6e1d,_0x2bcf76['type'],_0x3d9902);_0x37580b['default'][_0x40d210](_0x38acb5[_0xee2e('0x40')],_0x38acb5[_0xee2e('0x41')][_0xee2e('0x42')],_0x38acb5[_0xee2e('0x41')][_0xee2e('0x43')]);}else{switch(_0x3d9902[_0xee2e('0xa')]){case _0xee2e('0x44'):var _0x4bdf7a=parseReadParameter(_0x3d9902[_0xee2e('0x41')]);_0x37580b[_0xee2e('0x45')][_0xee2e('0x46')](_0x4bdf7a);break;case _0xee2e('0x47'):if(_0x3d9902[_0xee2e('0x48')]===_0xee2e('0x49')){if(_0x3d9902[_0xee2e('0x41')][_0xee2e('0x4a')]('\x20')['length']>0x1){_0x37580b[_0xee2e('0x4b')][_0x40d210]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xee2e('0x37')](_0x3d9902[_0xee2e('0x41')],!![]),null);}else{var _0x418f3a='%'+_0x3d9902['value']+'%';_0x37580b['contact'][_0x40d210]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x418f3a,_0x418f3a,_0x418f3a);}}else{_0x2bcf76=_[_0xee2e('0x3d')](_0x5ebaab,['name',_0xee2e('0x4c')]);_0x3d9902[_0xee2e('0xa')]=_0xee2e('0x4c');_0x38acb5=as[_0xee2e('0x3f')](_0x3e6e1d,_0x2bcf76[_0xee2e('0x4d')],_0x3d9902);_0x37580b[_0xee2e('0x4b')][_0x40d210](_0x38acb5['text'],_0x38acb5['value'][_0xee2e('0x42')],_0x38acb5[_0xee2e('0x41')][_0xee2e('0x43')]);}break;case _0xee2e('0x4e'):var _0x3d37d4=_0x3d9902[_0xee2e('0x41')][_0xee2e('0x4a')](',')['map'](function(_0x468bd2){return Number(_0x468bd2);});var _0x59fe1d=parseTagParameter(_0x3d37d4);_0x37580b[_0xee2e('0x4f')]['clause']['and'](_0x59fe1d);_0x37580b[_0xee2e('0x4f')][_0xee2e('0x50')]=_0x3d37d4;break;case _0xee2e('0x51'):if(_0x3d9902[_0xee2e('0x48')]==='$substring'){_0x37580b['user'][_0x40d210](_0xee2e('0x52'),'%'+_0x3d9902[_0xee2e('0x41')]+'%',null);}else{_0x2bcf76=_[_0xee2e('0x3d')](_0x5ebaab,[_0xee2e('0x3e'),_0xee2e('0x53')]);_0x3d9902[_0xee2e('0xa')]=_0xee2e('0x53');_0x38acb5=as['buildExpression'](_0x3e6e1d,_0x2bcf76[_0xee2e('0x4d')],_0x3d9902);_0x37580b[_0xee2e('0x54')][_0x40d210](_0x38acb5['text'],_0x38acb5[_0xee2e('0x41')][_0xee2e('0x42')],_0x38acb5['value']['end']);}break;case'body':case _0xee2e('0x55'):_0x38acb5=as['buildExpression']('me',null,_0x3d9902);_0x37580b[_0xee2e('0x56')][_0x40d210](_0x38acb5[_0xee2e('0x40')],_0x38acb5['value'][_0xee2e('0x42')],_0x38acb5[_0xee2e('0x41')][_0xee2e('0x43')]);break;}}}return _0x37580b;}function parseModelFields(_0xc6ed62,_0x2a4d49,_0x30206f){var _0xa7c7dc=utils[_0xee2e('0x6')](_0xc6ed62);var _0x12ddd4=squel[_0xee2e('0x25')]();var _0x373fea=_(_0x2a4d49)['keys']()[_0xee2e('0x18')](function(_0x2dc1b9){return _[_0xee2e('0x57')](_0x30206f,[_0xee2e('0x3e'),_0x2dc1b9])?_0x2dc1b9:undefined;})[_0xee2e('0x58')]()[_0xee2e('0x41')]();if(_0x373fea[_0xee2e('0x15')]>0x0){_0x373fea[_0xee2e('0x59')](function(_0x28a408){if(_0x28a408===_0xa7c7dc){_0x12ddd4[_0xee2e('0x46')]('i.'+_0xa7c7dc+_0xee2e('0x17'),[][_0xee2e('0x5a')](_0x2a4d49[_0x28a408]));}else if(_0x28a408==='createdAt'){var _0x10b965=JSON['parse'](_0x2a4d49[_0x28a408])[_0xee2e('0x5b')];var _0x5e4d0d=JSON[_0xee2e('0x5c')](_0x2a4d49[_0x28a408])[_0xee2e('0x5d')];_0x12ddd4[_0xee2e('0x46')](_0xee2e('0x5e'),_0x10b965,_0x5e4d0d);}else{if(_0x2a4d49[_0x28a408]===_0xee2e('0x5f')){_0x12ddd4[_0xee2e('0x46')]('i.'+_0x28a408+'\x20IS\x20NULL');}else{_0x12ddd4[_0xee2e('0x46')]('i.'+_0x28a408+_0xee2e('0x60'),_0x2a4d49[_0x28a408]);}}});}return _0x12ddd4;}function parseQueryParameters(_0x340057,_0x577ba8,_0x2639c6){var _0x22207f=getSqlClauses();return Promise[_0xee2e('0x61')]()[_0xee2e('0x62')](function(){return parseModelFields(_0x340057,_0x577ba8,_0x2639c6);})[_0xee2e('0x62')](function(_0x3a4b89){_0x22207f[_0xee2e('0x63')][_0xee2e('0x46')](_0x3a4b89);return parseReadParameter(_0x577ba8['read']);})[_0xee2e('0x62')](function(_0x3e83ac){_0x22207f[_0xee2e('0x45')][_0xee2e('0x46')](_0x3e83ac);return parseTagParameter(_0x577ba8['tag']);})['then'](function(_0x58aee0){_0x22207f[_0xee2e('0x4f')]['clause'][_0xee2e('0x46')](_0x58aee0);return parseSearchFilter(_0x340057,_0x577ba8[_0xee2e('0x64')]);})[_0xee2e('0x62')](function(_0x33985c){_0x22207f['filter']=_0x33985c;return _0x22207f;});}function checkAccountsRestrictions(_0x2cb29a,_0x26126f,_0x3afe0a){var _0x17f0c3=utils[_0xee2e('0x6')](_0x2cb29a);var _0x208036='get'+_[_0xee2e('0x65')](_0x2cb29a)+(_0x2cb29a===_0xee2e('0x66')?_0xee2e('0x67'):_0xee2e('0x68'));var _0x12c3d6=squel['expr']();return Promise['resolve']()[_0xee2e('0x62')](function(){if(_0x3afe0a[_0xee2e('0x69')]&&_0x26126f[_0xee2e('0x7')]===_0xee2e('0x8')){return _0x26126f[_0x208036]({'attributes':['id'],'raw':!![]});}})[_0xee2e('0x62')](function(_0x337d9f){if(_0x337d9f){if(_0x337d9f['length']===0x0){_0x12c3d6['and']('i.'+_0x17f0c3+_0xee2e('0x6a'));}else{_0x12c3d6['and']('i.'+_0x17f0c3+_0xee2e('0x17'),_[_0xee2e('0x18')](_0x337d9f,'id'));}}else if(!_0x3afe0a[_0x17f0c3]){_0x12c3d6['and']('i.'+_0x17f0c3+'\x20IS\x20NOT\x20NULL');}})[_0xee2e('0x62')](function(){return _0x12c3d6;});}function getClosedOrderClause(_0x5c19a9,_0x50ed37){var _0x220e4e='';var _0xeec0c5=['i.thirdDisposition','i.secondDisposition',_0xee2e('0x6b')];if(_0x5c19a9==='mail'){_0xeec0c5[_0xee2e('0x6c')](_0xee2e('0x6d'));}if(_0x50ed37[_0xee2e('0x6e')]==='0'&&_0x5c19a9===_0xee2e('0x36')){_0x220e4e=_0xee2e('0x6d');}else{if(_0x50ed37[_0xee2e('0x6e')]==='1'){_0xeec0c5[_0xee2e('0x6f')]();}_0x220e4e=_0xee2e('0x70')+_0xeec0c5['join'](',\x20')+')';}return _0x220e4e;}function getFilteredInteractions(_0x54b8ec,_0x1d4612,_0x4e08ab,_0xeb4e9){var _0x14bed4=utils[_0xee2e('0xd')](_0x54b8ec);var _0x1f0a6a=_['capitalize'](_0x54b8ec)+'Interaction';var _0x13c6a0=[];var _0x75918e=getTagsQuery();var _0xc1e521={'type':db['Sequelize'][_0xee2e('0x71')]['SELECT'],'raw':!![]};var _0xdcd1ba=[];var _0x10f050=[];return db[_0xee2e('0x72')]['query'](_0x75918e[_0xee2e('0x73')](),_0xc1e521)[_0xee2e('0x62')](function(_0x315df2){_0x13c6a0=_[_0xee2e('0x74')](_0x315df2,'id');_0xc1e521=_['merge'](_0xc1e521,{'model':db[_0x1f0a6a],'mapToModel':!![],'nest':!![]});if(_0x4e08ab[_0xee2e('0x63')]){_0xeb4e9[_0xee2e('0x75')]['forEach'](function(_0x510be8){_0x1d4612[_0xee2e('0xa')]('i.'+_0x510be8);});}else{_0x1d4612[_0xee2e('0xa')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x1d4612[_0xee2e('0xa')](_0xee2e('0x76'),'Account.key');_0x1d4612['field'](_0xee2e('0x77'),_0xee2e('0x78'));if(_0x54b8ec===_0xee2e('0x36')){_0x1d4612[_0xee2e('0xa')]('a.email',_0xee2e('0x79'));_0x1d4612[_0xee2e('0xa')](_0xee2e('0x7a'),_0xee2e('0x7b'));_0x1d4612[_0xee2e('0xa')](_0xee2e('0x7c'));_0x1d4612[_0xee2e('0xa')](_0xee2e('0x7d'));_0x1d4612['field']('i.updatedAt');_0x1d4612['field'](_0xee2e('0x7e'));_0x1d4612[_0xee2e('0xa')](_0xee2e('0x7f'));_0x1d4612[_0xee2e('0xa')]('i.attach');_0x1d4612['field'](_0xee2e('0x80'));_0x1d4612['field'](_0xee2e('0x81'));_0x1d4612['field']('i.subject');_0x1d4612[_0xee2e('0xa')](_0xee2e('0x6b'));_0x1d4612[_0xee2e('0xa')](_0xee2e('0x82'));_0x1d4612['field'](_0xee2e('0x83'));_0x1d4612[_0xee2e('0xa')](_0xee2e('0x6d'));_0x1d4612[_0xee2e('0xa')](_0xee2e('0x84'));_0x1d4612[_0xee2e('0xa')](_0xee2e('0x85'));_0x1d4612[_0xee2e('0xa')]('i.MailAccountId');_0x1d4612[_0xee2e('0xa')](_0xee2e('0x86'));}else if(_0x54b8ec===_0xee2e('0x87')){_0x1d4612[_0xee2e('0xa')](_0xee2e('0x88'),_0xee2e('0x7b'));}else{_0x1d4612[_0xee2e('0xa')](_0xee2e('0x89'),'contactName');}if(_0x54b8ec!==_0xee2e('0x36')){_0x1d4612[_0xee2e('0xa')](_0xee2e('0x8a'));}_0x1d4612[_0xee2e('0xa')]('c.firstName','Contact.firstName');_0x1d4612['field']('c.lastName',_0xee2e('0x8b'));_0x1d4612[_0xee2e('0xa')]('c.email',_0xee2e('0x8c'));_0x1d4612[_0xee2e('0xa')](_0xee2e('0x8d'),_0xee2e('0x8e'));_0x1d4612['field']('c.mobile',_0xee2e('0x8f'));_0x1d4612[_0xee2e('0xa')](_0xee2e('0x90'),_0xee2e('0x91'));_0x1d4612['field'](_0xee2e('0x92'),'Owner.fullname');_0x1d4612[_0xee2e('0xa')](_0xee2e('0x93'),_0xee2e('0x94'));_0x1d4612[_0xee2e('0xa')](_0xee2e('0x95'),_0xee2e('0x96'));}if(_0xeb4e9[_0xee2e('0x97')]){_0x1d4612[_0xee2e('0x97')](_0xeb4e9[_0xee2e('0x97')]);}if(_0xeb4e9['offset']){_0x1d4612[_0xee2e('0x98')](_0xeb4e9['offset']);}return db[_0xee2e('0x72')]['query'](_0x1d4612[_0xee2e('0x73')](),_0xc1e521);})[_0xee2e('0x62')](function(_0x10bfd3){_0xdcd1ba=_0x10bfd3;var _0x9ad49a=getUsersQuery(_0x54b8ec,_0xdcd1ba);return db[_0xee2e('0x72')][_0xee2e('0x99')](_0x9ad49a[_0xee2e('0x73')](),_0xc1e521);})['then'](function(_0x4249d6){_0x10f050=_[_0xee2e('0x9a')](_0x4249d6,_0x14bed4);if(_0x54b8ec===_0xee2e('0x36')){return db[_0xee2e('0x9b')][_0xee2e('0x9c')]({'attributes':[_0xee2e('0x9d')],'raw':!![]});}})[_0xee2e('0x62')](function(_0x4e4dcc){var _0x4e8315=_0x4e4dcc?_0x4e4dcc[_0xee2e('0x9d')]:undefined;var _0x1ecb6c=_0xdcd1ba['map'](function(_0x645c12){return updateInteraction(_0x645c12,_0x13c6a0,_0x10f050,_0x4e8315);});return Promise['all'](_0x1ecb6c);});}function countFilteredInteractions(_0x5b5eba,_0x2082a3){var _0x523a96=_0x5b5eba['clone']();_0x523a96[_0xee2e('0xa')](_0xee2e('0x9e'));_0x523a96[_0xee2e('0xa')](_0xee2e('0x9f'),_0xee2e('0x44'));var _0x4420d0=utils['getSelectedTags'](_0x2082a3);if(!_[_0xee2e('0xa0')](_0x4420d0)){_0x523a96['where'](_0xee2e('0xa1'),_0x4420d0);}var _0x3f1b50={'type':db[_0xee2e('0xa2')]['QueryTypes']['SELECT'],'raw':!![]};return db[_0xee2e('0x72')][_0xee2e('0x99')](_0x523a96[_0xee2e('0x73')](),_0x3f1b50);}module[_0xee2e('0xa3')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index ae42522..e3fab31 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58b9=['waiting','talking','answered','unmanaged','abandoned','total','UserId','out','then','plainBody','lastMsgText','trimStart','catch','Users','TagIds','Tags','lodash','../../mysqldb','map','split','push'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0x58b9,0xb8));var _0x958b=function(_0x539841,_0x52e491){_0x539841=_0x539841-0x0;var _0x91ad8f=_0x58b9[_0x539841];return _0x91ad8f;};'use strict';var _=require(_0x958b('0x0'));var db=require(_0x958b('0x1'))['db'];function getInteractionUsers(_0x38ba50,_0x2d1a35){return new Promise(function(_0x10a751,_0x2d5a8c){try{var _0x50fad9=[];if(_0x2d1a35[_0x38ba50]){_0x50fad9=_0x2d1a35[_0x38ba50][_0x958b('0x2')](function(_0x598597){return{'id':_0x598597['id'],'fullname':_0x598597['fullname']};});}return _0x10a751(_0x50fad9);}catch(_0xe8c5cd){_0x2d5a8c(_0xe8c5cd);}});}function getInteractionTags(_0x50194b,_0x3030a5){var _0x130547=[];if(_0x50194b){_0x50194b[_0x958b('0x3')](',')['forEach'](function(_0x5a654c){_0x130547[_0x958b('0x4')](_0x3030a5[_0x5a654c]);});}return _0x130547;}function updateWaitingCounter(_0x4e9d7a){if(_0x4e9d7a[_0x958b('0x5')]){_0x4e9d7a[_0x958b('0x5')]-=0x1;}}function updateInteractionCounters(_0x1e7126){_0x1e7126[_0x958b('0x5')]=0x0;_0x1e7126[_0x958b('0x6')]=0x0;_0x1e7126[_0x958b('0x7')]=0x0;_0x1e7126[_0x958b('0x8')]=0x0;_0x1e7126[_0x958b('0x9')]=0x0;_0x1e7126[_0x958b('0xa')]=0x0;if(_0x1e7126['closed']){if(_0x1e7126['disposition']===_0x958b('0x9')){_0x1e7126[_0x958b('0x9')]+=0x1;updateWaitingCounter(_0x1e7126);}if(_0x1e7126[_0x958b('0xb')]){_0x1e7126['answered']+=0x1;if(_0x1e7126[_0x958b('0x6')]){_0x1e7126[_0x958b('0x6')]-=0x1;}}else{if(_0x1e7126['disposition']){_0x1e7126[_0x958b('0x8')]+=0x1;updateWaitingCounter(_0x1e7126);}}}else{if(!_0x1e7126[_0x958b('0xb')]){_0x1e7126[_0x958b('0x5')]+=0x1;}if(_0x1e7126[_0x958b('0xb')]){_0x1e7126['talking']+=0x1;updateWaitingCounter(_0x1e7126);}}_0x1e7126['total']+=0x1;return _0x1e7126;}function getLastMessageText(_0x3c723f){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x3c723f['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x958b('0xc')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x958b('0xd')](function(_0x2812a2){if(_0x2812a2&&_0x2812a2[_0x958b('0xe')]){_0x3c723f[_0x958b('0xf')]=_[_0x958b('0x10')](_0x2812a2[_0x958b('0xe')]);}return _0x3c723f;})[_0x958b('0x11')](function(_0x133b41){throw _0x133b41;});}exports['updateInteraction']=function(_0x1bba1b,_0x31e828,_0x54246c,_0x193997){return new Promise(function(_0x317410,_0x474558){return getInteractionUsers(_0x1bba1b['id'],_0x54246c)[_0x958b('0xd')](function(_0x4fbd1e){_0x1bba1b[_0x958b('0x12')]=_0x4fbd1e;return getInteractionTags(_0x1bba1b[_0x958b('0x13')],_0x31e828);})[_0x958b('0xd')](function(_0x441035){_0x1bba1b[_0x958b('0x14')]=_0x441035;delete _0x1bba1b[_0x958b('0x13')];return updateInteractionCounters(_0x1bba1b);})[_0x958b('0xd')](function(_0x48858a){if(_0x193997){return getLastMessageText(_0x48858a);}else{return _0x48858a;}})[_0x958b('0xd')](function(_0x7780da){_0x317410(_0x7780da);})[_0x958b('0x11')](function(_0x376dbf){_0x474558(_0x376dbf);});});}; \ No newline at end of file +var _0x3d94=['updateInteraction','then','Users','TagIds','Tags','../../mysqldb','map','fullname','forEach','push','waiting','talking','answered','abandoned','total','closed','disposition','UserId','unmanaged','MailMessage','findOne','out','-id','plainBody','lastMsgText','catch'];(function(_0x1937a7,_0x3dfea2){var _0xed9eaa=function(_0x1be672){while(--_0x1be672){_0x1937a7['push'](_0x1937a7['shift']());}};_0xed9eaa(++_0x3dfea2);}(_0x3d94,0x171));var _0x43d9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d94[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var db=require(_0x43d9('0x0'))['db'];function getInteractionUsers(_0x23c198,_0x294458){return new Promise(function(_0x23caac,_0x32d58f){try{var _0x4edd9a=[];if(_0x294458[_0x23c198]){_0x4edd9a=_0x294458[_0x23c198][_0x43d9('0x1')](function(_0x67ebde){return{'id':_0x67ebde['id'],'fullname':_0x67ebde[_0x43d9('0x2')]};});}return _0x23caac(_0x4edd9a);}catch(_0x4a86d0){_0x32d58f(_0x4a86d0);}});}function getInteractionTags(_0x420311,_0x2c84d4){var _0x491388=[];if(_0x420311){_0x420311['split'](',')[_0x43d9('0x3')](function(_0x5c7918){_0x491388[_0x43d9('0x4')](_0x2c84d4[_0x5c7918]);});}return _0x491388;}function updateWaitingCounter(_0x33233a){if(_0x33233a['waiting']){_0x33233a[_0x43d9('0x5')]-=0x1;}}function updateInteractionCounters(_0x56360f){_0x56360f[_0x43d9('0x5')]=0x0;_0x56360f[_0x43d9('0x6')]=0x0;_0x56360f[_0x43d9('0x7')]=0x0;_0x56360f['unmanaged']=0x0;_0x56360f[_0x43d9('0x8')]=0x0;_0x56360f[_0x43d9('0x9')]=0x0;if(_0x56360f[_0x43d9('0xa')]){if(_0x56360f[_0x43d9('0xb')]===_0x43d9('0x8')){_0x56360f['abandoned']+=0x1;updateWaitingCounter(_0x56360f);}if(_0x56360f[_0x43d9('0xc')]){_0x56360f['answered']+=0x1;if(_0x56360f[_0x43d9('0x6')]){_0x56360f['talking']-=0x1;}}else{if(_0x56360f[_0x43d9('0xb')]){_0x56360f[_0x43d9('0xd')]+=0x1;updateWaitingCounter(_0x56360f);}}}else{if(!_0x56360f[_0x43d9('0xc')]){_0x56360f['waiting']+=0x1;}if(_0x56360f['UserId']){_0x56360f['talking']+=0x1;updateWaitingCounter(_0x56360f);}}_0x56360f[_0x43d9('0x9')]+=0x1;return _0x56360f;}function getLastMessageText(_0x59fd9b){return db[_0x43d9('0xe')][_0x43d9('0xf')]({'where':{'$and':[{'MailInteractionId':_0x59fd9b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x43d9('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x43d9('0x11'),'raw':!![]})['then'](function(_0x3e57cd){if(_0x3e57cd&&_0x3e57cd[_0x43d9('0x12')]){_0x59fd9b[_0x43d9('0x13')]=_['trimStart'](_0x3e57cd[_0x43d9('0x12')]);}return _0x59fd9b;})[_0x43d9('0x14')](function(_0x3f7c8d){throw _0x3f7c8d;});}exports[_0x43d9('0x15')]=function(_0x1df832,_0x3f8ab,_0x40259,_0x5e334b){return new Promise(function(_0xb91af3,_0x76aecb){return getInteractionUsers(_0x1df832['id'],_0x40259)[_0x43d9('0x16')](function(_0x2a69c4){_0x1df832[_0x43d9('0x17')]=_0x2a69c4;return getInteractionTags(_0x1df832[_0x43d9('0x18')],_0x3f8ab);})['then'](function(_0x515cb4){_0x1df832[_0x43d9('0x19')]=_0x515cb4;delete _0x1df832[_0x43d9('0x18')];return updateInteractionCounters(_0x1df832);})['then'](function(_0x3c8770){if(_0x5e334b){return getLastMessageText(_0x3c8770);}else{return _0x3c8770;}})['then'](function(_0xfb2af5){_0xb91af3(_0xfb2af5);})[_0x43d9('0x14')](function(_0x4b269d){_0x76aecb(_0x4b269d);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 069897c..123bb44 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e09=['update','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','chat','Account','capitalize','InteractionId','unknown','accounts','_interactions','_interaction_has_tags','user_has_','isArray','toLowerCase','toUpperCase','role','stringify','upperFirst','Interaction','findOne','then'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x5e09,0x125));var _0x95e0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5e09[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x95e0('0x0'));var db=require(_0x95e0('0x1'))['db'];var loggers={'openchannel':require(_0x95e0('0x2'))(_0x95e0('0x3')),'mail':require(_0x95e0('0x2'))(_0x95e0('0x4')),'fax':require('../../config/logger')(_0x95e0('0x5')),'sms':require('../../config/logger')(_0x95e0('0x6')),'chat':require('../../config/logger')(_0x95e0('0x7')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getAccountFK(_0xae7274){return _['capitalize'](_0xae7274)+(_0xae7274===_0x95e0('0x8')?'Website':_0x95e0('0x9'))+'Id';}function getInteractionFK(_0x48a641){return _[_0x95e0('0xa')](_0x48a641)+_0x95e0('0xb');}function getInteractionId(_0x4e2d54,_0x3fc6a4,_0x33f9ba){if(_0x4e2d54&&_0x4e2d54[_['upperFirst'](_0x33f9ba)+_0x95e0('0xb')]){return _0x4e2d54[_['upperFirst'](_0x33f9ba)+_0x95e0('0xb')];}else if(_0x4e2d54&&_0x4e2d54['id']){return _0x4e2d54['id'];}else if(_0x3fc6a4&&_0x3fc6a4['id']){return _0x3fc6a4['id'];}else{return _0x95e0('0xc');}}function getInteractionsTables(_0x1fa923){return{'accounts':_0x1fa923+'_'+(_0x1fa923===_0x95e0('0x8')?'websites':_0x95e0('0xd')),'interactions':_0x1fa923+_0x95e0('0xe'),'interactionsTags':_0x1fa923+_0x95e0('0xf'),'messages':_0x1fa923+'_messages','userInteractions':_0x95e0('0x10')+_0x1fa923+'_interactions'};}function getSelectedTags(_0x325e5b){var _0x19e1f5=[];if(_0x325e5b){_0x19e1f5=Array[_0x95e0('0x11')](_0x325e5b)?_0x325e5b:[_0x325e5b];}return _0x19e1f5;}function log(_0x75ad70,_0x221319,_0x4df64a,_0x1f090a,_0x353ecb,_0x402811){loggers[_0x353ecb[_0x95e0('0x12')]()][_0x75ad70]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x402811[_0x95e0('0x13')](),_0x221319?_0x221319['id']:null,_0x221319?_0x221319['name']:null,_0x221319?_0x221319[_0x95e0('0x14')]:null,getInteractionId(_0x4df64a,_0x1f090a,_0x353ecb),_0x4df64a?JSON[_0x95e0('0x15')](_0x4df64a):'null');}function updateUser(_0x2717ba,_0x4e1811,_0x22aa73,_0x19fb19,_0x3135eb){db[_[_0x95e0('0x16')](_0x19fb19)+_0x95e0('0x17')][_0x95e0('0x18')]({'where':{'id':getInteractionId(_0x4e1811,_0x22aa73,_0x19fb19)}})[_0x95e0('0x19')](function(_0x464148){if(_0x464148){return _0x464148[_0x95e0('0x1a')]({'UserId':_0x2717ba?_0x2717ba['id']:null});}})[_0x95e0('0x19')](function(_0x213241){if(_0x213241){log('info',_0x2717ba,_0x4e1811,_0x22aa73,_0x19fb19,_0x3135eb);}})['catch'](function(){log(_0x95e0('0x1b'),_0x2717ba,_0x4e1811,_0x22aa73,_0x19fb19,_0x3135eb);});}module[_0x95e0('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xa6c3=['error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','upperFirst','InteractionId','unknown','_interactions','_interaction_has_tags','_messages','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','catch'];(function(_0x360dc2,_0x843dd0){var _0x32817d=function(_0x427143){while(--_0x427143){_0x360dc2['push'](_0x360dc2['shift']());}};_0x32817d(++_0x843dd0);}(_0xa6c3,0x93));var _0x3a6c=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0xa6c3[_0x4e4f0e];return _0x1a7219;};'use strict';var _=require(_0x3a6c('0x0'));var db=require(_0x3a6c('0x1'))['db'];var loggers={'openchannel':require(_0x3a6c('0x2'))(_0x3a6c('0x3')),'mail':require(_0x3a6c('0x2'))('mail-interactions'),'fax':require(_0x3a6c('0x2'))(_0x3a6c('0x4')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x3a6c('0x2'))(_0x3a6c('0x5')),'whatsapp':require(_0x3a6c('0x2'))(_0x3a6c('0x6'))};function getAccountFK(_0xe39d0f){return _[_0x3a6c('0x7')](_0xe39d0f)+(_0xe39d0f===_0x3a6c('0x8')?_0x3a6c('0x9'):'Account')+'Id';}function getInteractionFK(_0x5364be){return _[_0x3a6c('0x7')](_0x5364be)+'InteractionId';}function getInteractionId(_0x1b99c5,_0x1fb8c9,_0xe95e15){if(_0x1b99c5&&_0x1b99c5[_[_0x3a6c('0xa')](_0xe95e15)+_0x3a6c('0xb')]){return _0x1b99c5[_[_0x3a6c('0xa')](_0xe95e15)+'InteractionId'];}else if(_0x1b99c5&&_0x1b99c5['id']){return _0x1b99c5['id'];}else if(_0x1fb8c9&&_0x1fb8c9['id']){return _0x1fb8c9['id'];}else{return _0x3a6c('0xc');}}function getInteractionsTables(_0x419215){return{'accounts':_0x419215+'_'+(_0x419215===_0x3a6c('0x8')?'websites':'accounts'),'interactions':_0x419215+_0x3a6c('0xd'),'interactionsTags':_0x419215+_0x3a6c('0xe'),'messages':_0x419215+_0x3a6c('0xf'),'userInteractions':'user_has_'+_0x419215+_0x3a6c('0xd')};}function getSelectedTags(_0x43af57){var _0x155e58=[];if(_0x43af57){_0x155e58=Array['isArray'](_0x43af57)?_0x43af57:[_0x43af57];}return _0x155e58;}function log(_0x243307,_0x169fa9,_0x84f444,_0x418841,_0x313051,_0x162a98){loggers[_0x313051[_0x3a6c('0x10')]()][_0x243307](_0x3a6c('0x11'),_0x162a98[_0x3a6c('0x12')](),_0x169fa9?_0x169fa9['id']:null,_0x169fa9?_0x169fa9[_0x3a6c('0x13')]:null,_0x169fa9?_0x169fa9[_0x3a6c('0x14')]:null,getInteractionId(_0x84f444,_0x418841,_0x313051),_0x84f444?JSON[_0x3a6c('0x15')](_0x84f444):_0x3a6c('0x16'));}function updateUser(_0x2dc69a,_0x126637,_0x49d48d,_0x323556,_0xf7d75e){db[_[_0x3a6c('0xa')](_0x323556)+_0x3a6c('0x17')][_0x3a6c('0x18')]({'where':{'id':getInteractionId(_0x126637,_0x49d48d,_0x323556)}})[_0x3a6c('0x19')](function(_0x1f04d1){if(_0x1f04d1){return _0x1f04d1['update']({'UserId':_0x2dc69a?_0x2dc69a['id']:null});}})[_0x3a6c('0x19')](function(_0x27a69f){if(_0x27a69f){log('info',_0x2dc69a,_0x126637,_0x49d48d,_0x323556,_0xf7d75e);}})[_0x3a6c('0x1a')](function(){log(_0x3a6c('0x1b'),_0x2dc69a,_0x126637,_0x49d48d,_0x323556,_0xf7d75e);});}module[_0x3a6c('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 6987a44..88b7815 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 _0x2e64=['hasOwnProperty','License','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','license','data1','split','createDecipher','%s:%s:%s','update','utf8'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e64,0xc4));var _0x42e6=function(_0x1ef267,_0x144b78){_0x1ef267=_0x1ef267-0x0;var _0x3c8422=_0x2e64[_0x1ef267];return _0x3c8422;};'use strict';var crypto=require(_0x42e6('0x0'));var util=require(_0x42e6('0x1'));var compose=require(_0x42e6('0x2'));var db=require(_0x42e6('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x396fec,_0x6e1284){if(_0x396fec&&_0x6e1284){if(_0x6e1284['data1']&&_0x6e1284[_0x42e6('0x4')]){var _0xa4c295=_0x6e1284[_0x42e6('0x5')];var _0x21c024=_0x6e1284[_0x42e6('0x4')];var _0x4f9bf3=_0xa4c295[_0x42e6('0x6')]('-')[0x4];var _0x27264d=_0xa4c295[_0x42e6('0x6')]('-')[0x0];var _0x3604ca=crypto[_0x42e6('0x7')]('aes-256-ctr',util['format'](_0x42e6('0x8'),_0x4f9bf3,_0xa4c295,_0x27264d));var _0x4ffdd2=_0x3604ca[_0x42e6('0x9')](_0x21c024,'base64',_0x42e6('0xa'));_0x4ffdd2+=_0x3604ca['final'](_0x42e6('0xa'));var _0x4054b9=JSON['parse'](_0x4ffdd2);return _0x4054b9[_0x42e6('0xb')](_0x396fec)?_0x4054b9[_0x396fec]:null;}}return null;}function isLimit(_0x43bf7b,_0x509f1b,_0x4d54f9,_0x220705){var _0xeaf78d=_0x509f1b;return compose()['use'](function(_0x4d83f7,_0x34b988,_0x4c0c45){return db[_0x42e6('0xc')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x42e6('0xd')](function(_0x628d9f){var _0x588911=getValueFromLicense(_0x43bf7b,_0x628d9f);return _0x588911?_0x588911:_0xeaf78d;})[_0x42e6('0xd')](function(_0x5ca104){_0xeaf78d=_0x5ca104;return _0x4d54f9[_0x42e6('0xe')](_0x220705);})[_0x42e6('0xd')](function(_0x2e582e){if(_0x2e582e>=_0xeaf78d){return _0x34b988[_0x42e6('0xf')](0x193)[_0x42e6('0x10')]({'message':util[_0x42e6('0x11')](_0x42e6('0x12'),_0x43bf7b)});}_0x4c0c45();})['catch'](function(_0x1c2c08){_0x4c0c45(_0x1c2c08);});});}function isUserLimit(){return isLimit(_0x42e6('0x13'),0x1,db[_0x42e6('0x14')],{'where':{'$or':[{'role':_0x42e6('0x15')},{'role':_0x42e6('0x16')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x5ed8=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','user','isUserLimit','crypto','composable-middleware','../../config/environment','data1','license','split','createDecipher','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','format'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x5ed8,0xc5));var _0x85ed=function(_0x322719,_0x16b381){_0x322719=_0x322719-0x0;var _0x30cb6f=_0x5ed8[_0x322719];return _0x30cb6f;};'use strict';var crypto=require(_0x85ed('0x0'));var util=require('util');var compose=require(_0x85ed('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x85ed('0x2'));function getValueFromLicense(_0x4cb055,_0x19fd53){if(_0x4cb055&&_0x19fd53){if(_0x19fd53[_0x85ed('0x3')]&&_0x19fd53[_0x85ed('0x4')]){var _0x28f4c8=_0x19fd53['data1'];var _0x1c7019=_0x19fd53[_0x85ed('0x4')];var _0x38b25e=_0x28f4c8[_0x85ed('0x5')]('-')[0x4];var _0x116ee8=_0x28f4c8[_0x85ed('0x5')]('-')[0x0];var _0x3fc568=crypto[_0x85ed('0x6')]('aes-256-ctr',util['format']('%s:%s:%s',_0x38b25e,_0x28f4c8,_0x116ee8));var _0x54da5e=_0x3fc568['update'](_0x1c7019,'base64',_0x85ed('0x7'));_0x54da5e+=_0x3fc568[_0x85ed('0x8')](_0x85ed('0x7'));var _0x3ebcfa=JSON[_0x85ed('0x9')](_0x54da5e);return _0x3ebcfa[_0x85ed('0xa')](_0x4cb055)?_0x3ebcfa[_0x4cb055]:null;}}return null;}function isLimit(_0x2bf893,_0x190e36,_0x137bd9,_0x4e44d9){var _0x39b6d4=_0x190e36;return compose()[_0x85ed('0xb')](function(_0x4b43f1,_0x2a178d,_0x4e8043){return db[_0x85ed('0xc')][_0x85ed('0xd')]({'where':{'id':0x1},'raw':!![]})[_0x85ed('0xe')](function(_0x245dec){var _0x28c2a6=getValueFromLicense(_0x2bf893,_0x245dec);return _0x28c2a6?_0x28c2a6:_0x39b6d4;})['then'](function(_0x11133d){_0x39b6d4=_0x11133d;return _0x137bd9[_0x85ed('0xf')](_0x4e44d9);})[_0x85ed('0xe')](function(_0x142b27){if(_0x142b27>=_0x39b6d4){return _0x2a178d[_0x85ed('0x10')](0x193)[_0x85ed('0x11')]({'message':util[_0x85ed('0x12')](_0x85ed('0x13'),_0x2bf893)});}_0x4e8043();})[_0x85ed('0x14')](function(_0x43c426){_0x4e8043(_0x43c426);});});}function isUserLimit(){return isLimit(_0x85ed('0x15'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x85ed('0x16')}]}});}exports[_0x85ed('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 8f7c437..103e1dc 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 _0x80ed=['<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','forEach','shift','match','filter','indexOf','map','conditions','DATE','operator','$eq','$between','value','includes','$lte','add','format','YYYY-MM-DD','field','\x20AS\x20','castTo','text','$ne','\x20OR\x20','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','<\x20?','$gt','>\x20?'];(function(_0x25e177,_0xbc5097){var _0x4c9340=function(_0x252ae4){while(--_0x252ae4){_0x25e177['push'](_0x25e177['shift']());}};_0x4c9340(++_0xbc5097);}(_0x80ed,0x1dd));var _0xd80e=function(_0x1b18f6,_0xbfba0e){_0x1b18f6=_0x1b18f6-0x0;var _0x4fc11f=_0x80ed[_0x1b18f6];return _0x4fc11f;};'use strict';var _=require('lodash');var moment=require(_0xd80e('0x0'));exports[_0xd80e('0x1')]=function(_0x12b492){var _0x2e30ee={'conditions':[]};_0x2e30ee[_0xd80e('0x2')]=_[_0xd80e('0x3')](_0x12b492,_0xd80e('0x4'))?'or':_0xd80e('0x5');var _0xbb5e00=_0x12b492[_0xd80e('0x6')](_0xd80e('0x7'),'')['replace'](_0xd80e('0x4'),'')['split']('||');for(var _0x4e88c5=0x0;_0x4e88c5<_0xbb5e00['length'];_0x4e88c5++){var _0x38dd44=_0xbb5e00[_0x4e88c5][_0xd80e('0x8')](':=');var _0x136dcf=_0x38dd44[0x0];var _0x4b44f1=_0x38dd44['slice'](0x1);_0x4b44f1[_0xd80e('0x9')](function(_0x59052d){var _0x14c9c3=_0x59052d[_0xd80e('0x8')]('[')[_0xd80e('0xa')]();var _0x246352=_0x59052d[_0xd80e('0xb')](/\[(.*?)\]/g);_0x246352[_0xd80e('0x9')](function(_0x48ae65){var _0xceb1ed=_0x48ae65[_0xd80e('0x8')]('[')[_0xd80e('0xc')](function(_0xd3076c){return _0xd3076c[_0xd80e('0xd')](']')>-0x1;})[_0xd80e('0xe')](function(_0x4cf9b1){return _0x4cf9b1[_0xd80e('0x8')](']')[0x0];})[0x0];_0x2e30ee[_0xd80e('0xf')]['push']({'field':_0x136dcf,'operator':_0x14c9c3,'value':_0xceb1ed});});});}return _0x2e30ee;};exports['buildExpression']=function(_0x223ff6,_0x365346,_0x4e2766){var _0x2030e7={};if(_0x365346===_0xd80e('0x10')){if(_0x4e2766[_0xd80e('0x11')]===_0xd80e('0x12')){_0x4e2766[_0xd80e('0x11')]=_0xd80e('0x13');_0x4e2766[_0xd80e('0x14')]+=','+_0x4e2766[_0xd80e('0x14')];}else if(_[_0xd80e('0x15')](['$gt',_0xd80e('0x16')],_0x4e2766[_0xd80e('0x11')])){_0x4e2766[_0xd80e('0x14')]=moment(_0x4e2766[_0xd80e('0x14')])[_0xd80e('0x17')](0x1,'days')[_0xd80e('0x18')](_0xd80e('0x19'));}}if(_0x4e2766['castTo']){_0x365346=_0x4e2766['castTo'];_0x2030e7['text']='CAST('+_0x223ff6+'.'+_0x4e2766[_0xd80e('0x1a')]+_0xd80e('0x1b')+_0x4e2766[_0xd80e('0x1c')]+')\x20'+parseOperator(_0x4e2766[_0xd80e('0x11')]);}else{_0x2030e7[_0xd80e('0x1d')]=_0x223ff6+'.'+_0x4e2766['field']+'\x20'+parseOperator(_0x4e2766['operator']);}if(_['includes']([_0xd80e('0x1e'),'$notIn'],_0x4e2766[_0xd80e('0x11')]))_0x2030e7['text']='('+_0x2030e7[_0xd80e('0x1d')]+_0xd80e('0x1f')+_0x223ff6+'.'+_0x4e2766[_0xd80e('0x1a')]+'\x20IS\x20NULL)';_0x2030e7[_0xd80e('0x14')]=parseValue(_0x365346,_0x4e2766['operator'],_0x4e2766[_0xd80e('0x14')]);return _0x2030e7;};function parseOperator(_0x23f935){var _0x2c511c;switch(_0x23f935){case _0xd80e('0x20'):_0x2c511c=_0xd80e('0x21');break;case _0xd80e('0x22'):_0x2c511c=_0xd80e('0x23');break;case _0xd80e('0x12'):_0x2c511c=_0xd80e('0x24');break;case _0xd80e('0x1e'):_0x2c511c='<>\x20?';break;case _0xd80e('0x25'):case _0xd80e('0x26'):case _0xd80e('0x27'):_0x2c511c='LIKE\x20?';break;case'$lt':_0x2c511c=_0xd80e('0x28');break;case _0xd80e('0x29'):_0x2c511c=_0xd80e('0x2a');break;case _0xd80e('0x16'):_0x2c511c=_0xd80e('0x2b');break;case _0xd80e('0x2c'):_0x2c511c='>=\x20?';break;case'$between':_0x2c511c=_0xd80e('0x2d');break;}return _0x2c511c;}function parseValue(_0x36413f,_0x173889,_0x3b121f){var _0x31c150={'start':undefined,'end':undefined};switch(_0x173889){case _0xd80e('0x20'):case _0xd80e('0x22'):_0x31c150[_0xd80e('0x2e')]=_0x3b121f['split'](',');break;case _0xd80e('0x25'):_0x31c150['start']='%'+_0x3b121f+'%';break;case _0xd80e('0x26'):_0x31c150[_0xd80e('0x2e')]=_0x3b121f+'%';break;case _0xd80e('0x27'):_0x31c150[_0xd80e('0x2e')]='%'+_0x3b121f;break;case _0xd80e('0x13'):var _0x354713=_0x3b121f[_0xd80e('0x8')](',');var _0x3b121f=_0x354713['shift']();var _0x40747=_0x354713[_0xd80e('0x2f')]();if(_0x36413f===_0xd80e('0x10')){_0x3b121f=moment(_0x3b121f)[_0xd80e('0x30')](0x0,!![])[_0xd80e('0x18')]();_0x40747=moment(_0x40747)[_0xd80e('0x30')](0x0,!![])['add'](0x17,_0xd80e('0x31'))[_0xd80e('0x17')](0x3b,_0xd80e('0x32'))[_0xd80e('0x17')](0x3b,_0xd80e('0x33'))[_0xd80e('0x18')]();}_0x31c150={'start':_0x3b121f,'end':_0x40747};break;default:_0x31c150[_0xd80e('0x2e')]=_0x3b121f;break;}return _0x31c150;} \ No newline at end of file +var _0xb76b=['and','replace','[$and]','length','split','slice','forEach','filter','indexOf','conditions','push','buildExpression','DATE','operator','$eq','value','includes','$gt','$lte','add','days','format','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','shift','utcOffset','hours','minutes','lodash','moment','parseSearch','sqlOperator','[$or]'];(function(_0x2a20f3,_0x4ef039){var _0x492068=function(_0x143ba6){while(--_0x143ba6){_0x2a20f3['push'](_0x2a20f3['shift']());}};_0x492068(++_0x4ef039);}(_0xb76b,0x17c));var _0xbb76=function(_0x50432d,_0x8d5dbb){_0x50432d=_0x50432d-0x0;var _0x20d1ce=_0xb76b[_0x50432d];return _0x20d1ce;};'use strict';var _=require(_0xbb76('0x0'));var moment=require(_0xbb76('0x1'));exports[_0xbb76('0x2')]=function(_0x2250c7){var _0x1db2f3={'conditions':[]};_0x1db2f3[_0xbb76('0x3')]=_['startsWith'](_0x2250c7,_0xbb76('0x4'))?'or':_0xbb76('0x5');var _0x5eb913=_0x2250c7[_0xbb76('0x6')](_0xbb76('0x7'),'')[_0xbb76('0x6')](_0xbb76('0x4'),'')['split']('||');for(var _0x3c202d=0x0;_0x3c202d<_0x5eb913[_0xbb76('0x8')];_0x3c202d++){var _0x512ed6=_0x5eb913[_0x3c202d][_0xbb76('0x9')](':=');var _0x355acc=_0x512ed6[0x0];var _0x4c90f3=_0x512ed6[_0xbb76('0xa')](0x1);_0x4c90f3['forEach'](function(_0x437fea){var _0x43c6cf=_0x437fea[_0xbb76('0x9')]('[')['shift']();var _0x250ffa=_0x437fea['match'](/\[(.*?)\]/g);_0x250ffa[_0xbb76('0xb')](function(_0x538234){var _0x16d407=_0x538234[_0xbb76('0x9')]('[')[_0xbb76('0xc')](function(_0x1c81f0){return _0x1c81f0[_0xbb76('0xd')](']')>-0x1;})['map'](function(_0x4e7390){return _0x4e7390[_0xbb76('0x9')](']')[0x0];})[0x0];_0x1db2f3[_0xbb76('0xe')][_0xbb76('0xf')]({'field':_0x355acc,'operator':_0x43c6cf,'value':_0x16d407});});});}return _0x1db2f3;};exports[_0xbb76('0x10')]=function(_0x305037,_0x324fb7,_0x4740ef){var _0x53c076={};if(_0x324fb7===_0xbb76('0x11')){if(_0x4740ef[_0xbb76('0x12')]===_0xbb76('0x13')){_0x4740ef[_0xbb76('0x12')]='$between';_0x4740ef[_0xbb76('0x14')]+=','+_0x4740ef[_0xbb76('0x14')];}else if(_[_0xbb76('0x15')]([_0xbb76('0x16'),_0xbb76('0x17')],_0x4740ef[_0xbb76('0x12')])){_0x4740ef['value']=moment(_0x4740ef['value'])[_0xbb76('0x18')](0x1,_0xbb76('0x19'))[_0xbb76('0x1a')]('YYYY-MM-DD');}}if(_0x4740ef[_0xbb76('0x1b')]){_0x324fb7=_0x4740ef[_0xbb76('0x1b')];_0x53c076[_0xbb76('0x1c')]=_0xbb76('0x1d')+_0x305037+'.'+_0x4740ef[_0xbb76('0x1e')]+_0xbb76('0x1f')+_0x4740ef['castTo']+')\x20'+parseOperator(_0x4740ef[_0xbb76('0x12')]);}else{_0x53c076['text']=_0x305037+'.'+_0x4740ef[_0xbb76('0x1e')]+'\x20'+parseOperator(_0x4740ef[_0xbb76('0x12')]);}if(_[_0xbb76('0x15')]([_0xbb76('0x20'),_0xbb76('0x21')],_0x4740ef[_0xbb76('0x12')]))_0x53c076[_0xbb76('0x1c')]='('+_0x53c076['text']+_0xbb76('0x22')+_0x305037+'.'+_0x4740ef[_0xbb76('0x1e')]+'\x20IS\x20NULL)';_0x53c076[_0xbb76('0x14')]=parseValue(_0x324fb7,_0x4740ef[_0xbb76('0x12')],_0x4740ef['value']);return _0x53c076;};function parseOperator(_0x443b4a){var _0x35b177;switch(_0x443b4a){case _0xbb76('0x23'):_0x35b177=_0xbb76('0x24');break;case _0xbb76('0x21'):_0x35b177=_0xbb76('0x25');break;case _0xbb76('0x13'):_0x35b177=_0xbb76('0x26');break;case'$ne':_0x35b177='<>\x20?';break;case _0xbb76('0x27'):case _0xbb76('0x28'):case _0xbb76('0x29'):_0x35b177=_0xbb76('0x2a');break;case'$lt':_0x35b177=_0xbb76('0x2b');break;case _0xbb76('0x16'):_0x35b177=_0xbb76('0x2c');break;case _0xbb76('0x17'):_0x35b177=_0xbb76('0x2d');break;case _0xbb76('0x2e'):_0x35b177=_0xbb76('0x2f');break;case _0xbb76('0x30'):_0x35b177=_0xbb76('0x31');break;}return _0x35b177;}function parseValue(_0x23f486,_0x648483,_0x488f62){var _0x215874={'start':undefined,'end':undefined};switch(_0x648483){case _0xbb76('0x23'):case _0xbb76('0x21'):_0x215874[_0xbb76('0x32')]=_0x488f62[_0xbb76('0x9')](',');break;case _0xbb76('0x27'):_0x215874[_0xbb76('0x32')]='%'+_0x488f62+'%';break;case _0xbb76('0x28'):_0x215874['start']=_0x488f62+'%';break;case _0xbb76('0x29'):_0x215874[_0xbb76('0x32')]='%'+_0x488f62;break;case _0xbb76('0x30'):var _0x1c4580=_0x488f62[_0xbb76('0x9')](',');var _0x488f62=_0x1c4580[_0xbb76('0x33')]();var _0x37adee=_0x1c4580['pop']();if(_0x23f486===_0xbb76('0x11')){_0x488f62=moment(_0x488f62)['utcOffset'](0x0,!![])[_0xbb76('0x1a')]();_0x37adee=moment(_0x37adee)[_0xbb76('0x34')](0x0,!![])[_0xbb76('0x18')](0x17,_0xbb76('0x35'))[_0xbb76('0x18')](0x3b,_0xbb76('0x36'))[_0xbb76('0x18')](0x3b,'seconds')['format']();}_0x215874={'start':_0x488f62,'end':_0x37adee};break;default:_0x215874[_0xbb76('0x32')]=_0x488f62;break;}return _0x215874;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 90f7e7b..aa5b994 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 _0x7f05=['match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','getOptions','query','$id','model','filters','intersection','attributes','nolimit','limit','order','sort','where','pick','filter','object','columns','value','merge','type','lower','options','include','push','lodash','sequelize','moment','parse','keys','includes','alias','fields','raw','split','find','isPlainObject','$gte','format','subtract','name','isArray','offset','map','cast','priority','unsigned','substr','DESC','col','ASC','omit','isObject','isString','length','unset','hasOwnProperty'];(function(_0x4ab52d,_0x51ff1d){var _0x4e42d4=function(_0x51cca7){while(--_0x51cca7){_0x4ab52d['push'](_0x4ab52d['shift']());}};_0x4e42d4(++_0x51ff1d);}(_0x7f05,0xdc));var _0x57f0=function(_0x3bb4c9,_0x44300b){_0x3bb4c9=_0x3bb4c9-0x0;var _0x591f2f=_0x7f05[_0x3bb4c9];return _0x591f2f;};'use strict';var _=require(_0x57f0('0x0'));var sequelize=require(_0x57f0('0x1'));var moment=require(_0x57f0('0x2'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xc52af3){var _0x49238d=['ne'];try{var _0x2f3707=JSON[_0x57f0('0x3')](_0xc52af3);var _0x52bde5=Object[_0x57f0('0x4')](_0x2f3707)[0x0];return _0x49238d[_0x57f0('0x5')](_0x52bde5);}catch(_0x4c3a58){return![];}}function getOperatorValue(_0x27b8f6){var _0x295ad5=JSON['parse'](_0x27b8f6);var _0x434121=Object[_0x57f0('0x4')](_0x295ad5)[0x0];var _0x3f7ebc=_0x295ad5[_0x434121];return{['$'+_0x434121]:_0x3f7ebc};}function parseIncludeModel(_0x55d417){var _0x5b8d32=JSON[_0x57f0('0x3')](_0x55d417);return{'model':db[_0x5b8d32['model']],'as':_0x5b8d32[_0x57f0('0x6')],'attributes':_0x5b8d32[_0x57f0('0x7')],'raw':_0x5b8d32[_0x57f0('0x8')]};}exports[_0x57f0('0x7')]=function(_0x5a715b){var _0x4f61d3=null;if(_0x5a715b){_0x4f61d3=_0x5a715b[_0x57f0('0x9')](',');}return _0x4f61d3;};exports['filters']=function(_0x4b6aef,_0x50afee){var _0x523715={};if(!_['isEmpty'](_0x4b6aef)){_['forOwn'](_0x4b6aef,function(_0x1aa9c8,_0x148978){try{if(_0x50afee){var _0x5987ed=_[_0x57f0('0xa')](_0x50afee,{'name':_0x148978})||{};if(hasSequelizeOperator(_0x1aa9c8)){_0x523715[_0x148978]=getOperatorValue(_0x1aa9c8);}else if(_0x5987ed['type']==='DATE'&&_[_0x57f0('0xb')](_0x1aa9c8)){var _0x380859=JSON[_0x57f0('0x3')](_0x1aa9c8);var _0x2e57df={'$gte':moment(moment(_0x380859[_0x57f0('0xc')])[_0x57f0('0xd')]('YYYY-MM-DD'))['utc']()[_0x57f0('0xd')](),'$lte':moment(moment(_0x380859['$lte'])['format']('YYYY-MM-DD'))['utc']()[_0x57f0('0xe')](0x1,'s')[_0x57f0('0xd')]()};_0x523715[_0x148978]=_0x2e57df;}else if(_0x5987ed[_0x57f0('0xf')]==='uniqueid'){_0x523715[_0x148978]=_0x1aa9c8;}else{_0x523715[_0x148978]=_[_0x57f0('0x10')](_0x1aa9c8)?_0x1aa9c8:JSON[_0x57f0('0x3')](_0x1aa9c8);}}else{_0x523715[_0x148978]=_[_0x57f0('0x10')](_0x1aa9c8)?_0x1aa9c8:JSON['parse'](_0x1aa9c8);}}catch(_0x2e3d15){_0x523715[_0x148978]=_0x1aa9c8[_0x57f0('0x9')](',');}});}return _0x523715;};exports['limit']=function(_0x589c18){_0x589c18=parseInt(_0x589c18,0xa);if(!_0x589c18||_0x589c18<0x0){_0x589c18=LIMIT_VALUE;}return _0x589c18;};exports[_0x57f0('0x11')]=function(_0x1ce318){_0x1ce318=parseInt(_0x1ce318,0xa);if(!_0x1ce318||_0x1ce318<0x0){_0x1ce318=0x0;}return _0x1ce318;};exports['sort']=function(_0x28e659){var _0x558de7,_0x3a5b6f=null;if(_0x28e659){_0x558de7=_0x28e659[_0x57f0('0x9')](',');_0x3a5b6f=_[_0x57f0('0x12')](_0x558de7,function(_0x202dcb){if(_0x202dcb['indexOf']('-')===0x0){return[_0x202dcb==='priority'?sequelize[_0x57f0('0x13')](sequelize['col'](_0x57f0('0x14')),_0x57f0('0x15')):_0x202dcb[_0x57f0('0x16')](0x1),_0x57f0('0x17')];}else{return[_0x202dcb===_0x57f0('0x14')?sequelize[_0x57f0('0x13')](sequelize[_0x57f0('0x18')](_0x57f0('0x14')),'unsigned'):_0x202dcb,_0x57f0('0x19')];}});}return _0x3a5b6f;};exports['omit']=function(_0x563fa5,_0x43c975){if(_['isEmpty'](_0x563fa5)){return _0x563fa5;}if(_[_0x57f0('0x10')](_0x563fa5)){for(var _0x50347e=0x0;_0x50347e<_0x563fa5['length'];_0x50347e+=0x1){_0x563fa5[_0x50347e]=this[_0x57f0('0x1a')](_0x563fa5[_0x50347e],_0x43c975);}return _0x563fa5;}if(!_[_0x57f0('0x1b')](_0x563fa5)){return _0x563fa5;}if(_[_0x57f0('0x1c')](_0x43c975)){_0x43c975=[_0x43c975];}if(!_[_0x57f0('0x10')](_0x43c975)){return _0x563fa5;}for(var _0x1858ea=0x0;_0x1858ea<_0x43c975[_0x57f0('0x1d')];_0x1858ea+=0x1){_[_0x57f0('0x1e')](_0x563fa5,_0x43c975[_0x1858ea]);}for(var _0x43699b in _0x563fa5){if(_0x563fa5[_0x57f0('0x1f')](_0x43699b)){_0x563fa5[_0x43699b]=this[_0x57f0('0x1a')](_0x563fa5[_0x43699b],_0x43c975);}}return _0x563fa5;};exports['isNumeric']=function(_0x2c61af){return _0x2c61af[_0x57f0('0x20')](RegExp(_0x57f0('0x21')))?!![]:![];};exports[_0x57f0('0x22')]=function(_0x25c09e){return _0x25c09e[_0x57f0('0x20')](/^\S+@\S+$/)?!![]:![];};exports[_0x57f0('0x23')]=function(_0x40c45a,_0x43b97b){var _0x12da92=[];var _0x2c13cf=/[ `!@#$%^&*()_\-?~]/;var _0x249557=_0x43b97b?_0x57f0('0x24'):_0x57f0('0x25');_0x40c45a['split'](/[ ,]+/)[_0x57f0('0x26')](function(_0x31006a){_0x31006a=_0x31006a[_0x57f0('0x27')](/([^:]")"+/g,'$1');_0x31006a='+'+_0x31006a+'*';var _0x3751d7=_0x31006a['match'](_0x2c13cf);if(_0x3751d7){_0x31006a='\x22'+_0x31006a+'\x22';}_0x12da92['push'](_0x31006a);});_0x249557=_0x249557['replace'](_0x57f0('0x25'),_0x12da92['join']('\x20'));return _0x249557;};exports[_0x57f0('0x28')]=function(_0x29587a,_0x2f3f1b,_0x4d55b6){var _0x207668={},_0x277edf={};if(_0x2f3f1b[_0x57f0('0x29')][_0x57f0('0x2a')]){_0x2f3f1b[_0x57f0('0x29')]['id']=_0x2f3f1b[_0x57f0('0x29')][_0x57f0('0x2a')];delete _0x2f3f1b[_0x57f0('0x29')][_0x57f0('0x2a')];}_0x207668[_0x57f0('0x2b')]=_[_0x57f0('0x12')](_0x29587a,_0x57f0('0xf'));_0x207668[_0x57f0('0x29')]=_[_0x57f0('0x4')](_0x2f3f1b[_0x57f0('0x29')]);_0x207668[_0x57f0('0x2c')]=_[_0x57f0('0x2d')](_0x207668[_0x57f0('0x2b')],_0x207668[_0x57f0('0x29')]);_0x277edf['attributes']=_['intersection'](_0x207668[_0x57f0('0x2b')],this[_0x57f0('0x7')](_0x2f3f1b[_0x57f0('0x29')]['fields']));_0x277edf[_0x57f0('0x2e')]=_0x277edf[_0x57f0('0x2e')][_0x57f0('0x1d')]?_0x277edf[_0x57f0('0x2e')]:_0x207668[_0x57f0('0x2b')];if(!_0x2f3f1b[_0x57f0('0x29')][_0x57f0('0x1f')](_0x57f0('0x2f'))){_0x277edf[_0x57f0('0x30')]=this['limit'](_0x2f3f1b[_0x57f0('0x29')][_0x57f0('0x30')]);_0x277edf[_0x57f0('0x11')]=this[_0x57f0('0x11')](_0x2f3f1b['query'][_0x57f0('0x11')]);}_0x277edf[_0x57f0('0x31')]=this['sort'](_0x2f3f1b[_0x57f0('0x29')][_0x57f0('0x32')]);_0x277edf[_0x57f0('0x33')]=this[_0x57f0('0x2c')](_[_0x57f0('0x34')](_0x2f3f1b[_0x57f0('0x29')],_0x207668[_0x57f0('0x2c')]),_0x29587a);if(_0x2f3f1b['query'][_0x57f0('0x35')]){var _0x4e0abe=_0x29587a;var _0x3dd680=_0x2f3f1b['query'][_0x57f0('0x35')];if(typeof _0x3dd680===_0x57f0('0x36')){_0x4e0abe=_[_0x57f0('0x35')](_0x29587a,function(_0x3564ef){return _[_0x57f0('0x5')](_0x3dd680[_0x57f0('0x37')],_0x3564ef[_0x57f0('0xf')]);});_0x3dd680=_0x3dd680[_0x57f0('0x38')];}_0x277edf[_0x57f0('0x33')]=_[_0x57f0('0x39')](_0x277edf[_0x57f0('0x33')],{'$or':_['map'](_0x4e0abe,function(_0x16cb8d){if(_0x16cb8d[_0x57f0('0x3a')]!=='VIRTUAL'){if(_0x4d55b6){return sequelize['where'](sequelize['fn'](_0x57f0('0x3b'),sequelize['col'](_0x16cb8d[_0x57f0('0xf')])),{'$like':sequelize['fn'](_0x57f0('0x3b'),'%'+_0x2f3f1b[_0x57f0('0x29')]['filter']+'%')});}else{var _0x4069cd={};_0x4069cd[_0x16cb8d[_0x57f0('0xf')]]={'$like':'%'+_0x2f3f1b['query'][_0x57f0('0x35')]+'%'};return _0x4069cd;}}})});}_0x277edf=_[_0x57f0('0x39')]({},_0x277edf,_0x2f3f1b[_0x57f0('0x3c')]);return _0x277edf;};exports[_0x57f0('0x3d')]=function(_0x478246){var _0x2f9dcb=[];if(_0x478246['includeAll']){_0x2f9dcb[_0x57f0('0x3e')]({'all':!![]});}else if(_0x478246[_0x57f0('0x3d')]){if(Array['isArray'](_0x478246[_0x57f0('0x3d')])){_0x2f9dcb=Object['keys'](_0x478246[_0x57f0('0x3d')])['map'](function(_0x242189){return parseIncludeModel(_0x478246['include'][_0x242189]);});}else{var _0x4c6eb1=parseIncludeModel(_0x478246[_0x57f0('0x3d')]);_0x2f9dcb[_0x57f0('0x3e')](_0x4c6eb1);}}return _0x2f9dcb;}; \ No newline at end of file +var _0xa633=['forEach','replace','push','join','getOptions','query','$id','intersection','attributes','nolimit','order','sort','where','pick','filter','object','value','merge','type','VIRTUAL','lower','options','include','includeAll','lodash','../../mysqldb','keys','includes','parse','model','fields','raw','split','filters','forOwn','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','map','priority','col','unsigned','DESC','cast','ASC','omit','isEmpty','length','isObject','isString','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','\x22{EXPR}\x22','{EXPR}'];(function(_0x838813,_0x448f0f){var _0x2bd32d=function(_0x57b589){while(--_0x57b589){_0x838813['push'](_0x838813['shift']());}};_0x2bd32d(++_0x448f0f);}(_0xa633,0x15d));var _0x3a63=function(_0x31626b,_0x1c8197){_0x31626b=_0x31626b-0x0;var _0x30b96e=_0xa633[_0x31626b];return _0x30b96e;};'use strict';var _=require(_0x3a63('0x0'));var sequelize=require('sequelize');var moment=require('moment');var db=require(_0x3a63('0x1'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x47b39e){var _0x529bef=['ne'];try{var _0x121a91=JSON['parse'](_0x47b39e);var _0x1d0884=Object[_0x3a63('0x2')](_0x121a91)[0x0];return _0x529bef[_0x3a63('0x3')](_0x1d0884);}catch(_0x3d4c94){return![];}}function getOperatorValue(_0x1315cb){var _0xc9221d=JSON[_0x3a63('0x4')](_0x1315cb);var _0x1f769d=Object['keys'](_0xc9221d)[0x0];var _0x574b7c=_0xc9221d[_0x1f769d];return{['$'+_0x1f769d]:_0x574b7c};}function parseIncludeModel(_0x77c6ff){var _0xa5b58d=JSON[_0x3a63('0x4')](_0x77c6ff);return{'model':db[_0xa5b58d[_0x3a63('0x5')]],'as':_0xa5b58d['alias'],'attributes':_0xa5b58d[_0x3a63('0x6')],'raw':_0xa5b58d[_0x3a63('0x7')]};}exports['fields']=function(_0x1511cc){var _0x595365=null;if(_0x1511cc){_0x595365=_0x1511cc[_0x3a63('0x8')](',');}return _0x595365;};exports[_0x3a63('0x9')]=function(_0x512d58,_0x537b93){var _0x118775={};if(!_['isEmpty'](_0x512d58)){_[_0x3a63('0xa')](_0x512d58,function(_0xa03c5a,_0x54e71b){try{if(_0x537b93){var _0x3c93df=_['find'](_0x537b93,{'name':_0x54e71b})||{};if(hasSequelizeOperator(_0xa03c5a)){_0x118775[_0x54e71b]=getOperatorValue(_0xa03c5a);}else if(_0x3c93df['type']==='DATE'&&_[_0x3a63('0xb')](_0xa03c5a)){var _0x19e7db=JSON[_0x3a63('0x4')](_0xa03c5a);var _0x5adaff={'$gte':moment(moment(_0x19e7db[_0x3a63('0xc')])[_0x3a63('0xd')](_0x3a63('0xe')))[_0x3a63('0xf')]()[_0x3a63('0xd')](),'$lte':moment(moment(_0x19e7db[_0x3a63('0x10')])[_0x3a63('0xd')]('YYYY-MM-DD'))[_0x3a63('0xf')]()[_0x3a63('0x11')](0x1,'s')[_0x3a63('0xd')]()};_0x118775[_0x54e71b]=_0x5adaff;}else if(_0x3c93df[_0x3a63('0x12')]===_0x3a63('0x13')){_0x118775[_0x54e71b]=_0xa03c5a;}else{_0x118775[_0x54e71b]=_[_0x3a63('0x14')](_0xa03c5a)?_0xa03c5a:JSON[_0x3a63('0x4')](_0xa03c5a);}}else{_0x118775[_0x54e71b]=_[_0x3a63('0x14')](_0xa03c5a)?_0xa03c5a:JSON[_0x3a63('0x4')](_0xa03c5a);}}catch(_0x3239df){_0x118775[_0x54e71b]=_0xa03c5a[_0x3a63('0x8')](',');}});}return _0x118775;};exports[_0x3a63('0x15')]=function(_0x32f8ee){_0x32f8ee=parseInt(_0x32f8ee,0xa);if(!_0x32f8ee||_0x32f8ee<0x0){_0x32f8ee=LIMIT_VALUE;}return _0x32f8ee;};exports[_0x3a63('0x16')]=function(_0x49eb08){_0x49eb08=parseInt(_0x49eb08,0xa);if(!_0x49eb08||_0x49eb08<0x0){_0x49eb08=0x0;}return _0x49eb08;};exports['sort']=function(_0x4c3566){var _0x560818,_0x514413=null;if(_0x4c3566){_0x560818=_0x4c3566[_0x3a63('0x8')](',');_0x514413=_[_0x3a63('0x17')](_0x560818,function(_0x3fa1fa){if(_0x3fa1fa['indexOf']('-')===0x0){return[_0x3fa1fa===_0x3a63('0x18')?sequelize['cast'](sequelize[_0x3a63('0x19')](_0x3a63('0x18')),_0x3a63('0x1a')):_0x3fa1fa['substr'](0x1),_0x3a63('0x1b')];}else{return[_0x3fa1fa===_0x3a63('0x18')?sequelize[_0x3a63('0x1c')](sequelize[_0x3a63('0x19')]('priority'),_0x3a63('0x1a')):_0x3fa1fa,_0x3a63('0x1d')];}});}return _0x514413;};exports[_0x3a63('0x1e')]=function(_0x477483,_0x219305){if(_[_0x3a63('0x1f')](_0x477483)){return _0x477483;}if(_[_0x3a63('0x14')](_0x477483)){for(var _0x402b45=0x0;_0x402b45<_0x477483[_0x3a63('0x20')];_0x402b45+=0x1){_0x477483[_0x402b45]=this[_0x3a63('0x1e')](_0x477483[_0x402b45],_0x219305);}return _0x477483;}if(!_[_0x3a63('0x21')](_0x477483)){return _0x477483;}if(_[_0x3a63('0x22')](_0x219305)){_0x219305=[_0x219305];}if(!_['isArray'](_0x219305)){return _0x477483;}for(var _0x4bde37=0x0;_0x4bde37<_0x219305[_0x3a63('0x20')];_0x4bde37+=0x1){_['unset'](_0x477483,_0x219305[_0x4bde37]);}for(var _0x48cee4 in _0x477483){if(_0x477483[_0x3a63('0x23')](_0x48cee4)){_0x477483[_0x48cee4]=this[_0x3a63('0x1e')](_0x477483[_0x48cee4],_0x219305);}}return _0x477483;};exports['isNumeric']=function(_0x1f58f1){return _0x1f58f1[_0x3a63('0x24')](RegExp(_0x3a63('0x25')))?!![]:![];};exports[_0x3a63('0x26')]=function(_0x164715){return _0x164715[_0x3a63('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x5f3c3d,_0x2c2c17){var _0x3782cc=[];var _0x1ea69a=/[ `!@#$%^&*()_\-?~]/;var _0x2b920f=_0x2c2c17?_0x3a63('0x27'):_0x3a63('0x28');_0x5f3c3d['split'](/[ ,]+/)[_0x3a63('0x29')](function(_0x756e8f){_0x756e8f=_0x756e8f[_0x3a63('0x2a')](/([^:]")"+/g,'$1');_0x756e8f='+'+_0x756e8f+'*';var _0x1da01e=_0x756e8f[_0x3a63('0x24')](_0x1ea69a);if(_0x1da01e){_0x756e8f='\x22'+_0x756e8f+'\x22';}_0x3782cc[_0x3a63('0x2b')](_0x756e8f);});_0x2b920f=_0x2b920f[_0x3a63('0x2a')](_0x3a63('0x28'),_0x3782cc[_0x3a63('0x2c')]('\x20'));return _0x2b920f;};exports[_0x3a63('0x2d')]=function(_0x2638b6,_0x794c38,_0x9e77f){var _0x237c38={},_0x4896ba={};if(_0x794c38[_0x3a63('0x2e')][_0x3a63('0x2f')]){_0x794c38['query']['id']=_0x794c38[_0x3a63('0x2e')][_0x3a63('0x2f')];delete _0x794c38[_0x3a63('0x2e')][_0x3a63('0x2f')];}_0x237c38[_0x3a63('0x5')]=_[_0x3a63('0x17')](_0x2638b6,'name');_0x237c38['query']=_[_0x3a63('0x2')](_0x794c38[_0x3a63('0x2e')]);_0x237c38[_0x3a63('0x9')]=_[_0x3a63('0x30')](_0x237c38[_0x3a63('0x5')],_0x237c38[_0x3a63('0x2e')]);_0x4896ba['attributes']=_['intersection'](_0x237c38[_0x3a63('0x5')],this['fields'](_0x794c38[_0x3a63('0x2e')][_0x3a63('0x6')]));_0x4896ba['attributes']=_0x4896ba[_0x3a63('0x31')][_0x3a63('0x20')]?_0x4896ba['attributes']:_0x237c38[_0x3a63('0x5')];if(!_0x794c38[_0x3a63('0x2e')][_0x3a63('0x23')](_0x3a63('0x32'))){_0x4896ba[_0x3a63('0x15')]=this[_0x3a63('0x15')](_0x794c38[_0x3a63('0x2e')][_0x3a63('0x15')]);_0x4896ba['offset']=this[_0x3a63('0x16')](_0x794c38[_0x3a63('0x2e')][_0x3a63('0x16')]);}_0x4896ba[_0x3a63('0x33')]=this[_0x3a63('0x34')](_0x794c38[_0x3a63('0x2e')][_0x3a63('0x34')]);_0x4896ba[_0x3a63('0x35')]=this['filters'](_[_0x3a63('0x36')](_0x794c38[_0x3a63('0x2e')],_0x237c38[_0x3a63('0x9')]),_0x2638b6);if(_0x794c38[_0x3a63('0x2e')][_0x3a63('0x37')]){var _0x307c4f=_0x2638b6;var _0xc76323=_0x794c38[_0x3a63('0x2e')][_0x3a63('0x37')];if(typeof _0xc76323===_0x3a63('0x38')){_0x307c4f=_['filter'](_0x2638b6,function(_0x4f00ae){return _[_0x3a63('0x3')](_0xc76323['columns'],_0x4f00ae[_0x3a63('0x12')]);});_0xc76323=_0xc76323[_0x3a63('0x39')];}_0x4896ba[_0x3a63('0x35')]=_[_0x3a63('0x3a')](_0x4896ba[_0x3a63('0x35')],{'$or':_[_0x3a63('0x17')](_0x307c4f,function(_0x3650d7){if(_0x3650d7[_0x3a63('0x3b')]!==_0x3a63('0x3c')){if(_0x9e77f){return sequelize[_0x3a63('0x35')](sequelize['fn'](_0x3a63('0x3d'),sequelize[_0x3a63('0x19')](_0x3650d7[_0x3a63('0x12')])),{'$like':sequelize['fn'](_0x3a63('0x3d'),'%'+_0x794c38['query'][_0x3a63('0x37')]+'%')});}else{var _0x31b774={};_0x31b774[_0x3650d7[_0x3a63('0x12')]]={'$like':'%'+_0x794c38[_0x3a63('0x2e')][_0x3a63('0x37')]+'%'};return _0x31b774;}}})});}_0x4896ba=_[_0x3a63('0x3a')]({},_0x4896ba,_0x794c38[_0x3a63('0x3e')]);return _0x4896ba;};exports[_0x3a63('0x3f')]=function(_0x4b5d35){var _0x51d3ee=[];if(_0x4b5d35[_0x3a63('0x40')]){_0x51d3ee[_0x3a63('0x2b')]({'all':!![]});}else if(_0x4b5d35[_0x3a63('0x3f')]){if(Array['isArray'](_0x4b5d35[_0x3a63('0x3f')])){_0x51d3ee=Object['keys'](_0x4b5d35[_0x3a63('0x3f')])[_0x3a63('0x17')](function(_0x505195){return parseIncludeModel(_0x4b5d35[_0x3a63('0x3f')][_0x505195]);});}else{var _0x4c22b7=parseIncludeModel(_0x4b5d35[_0x3a63('0x3f')]);_0x51d3ee[_0x3a63('0x2b')](_0x4c22b7);}}return _0x51d3ee;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 6476af8..d5f3035 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19b7=['Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','getRealtimeAgents','unknown','busy','getAgentStatus','isArray','Queue','map','findOne','getAgents','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','smsPause','whatsappPause','pauseType','merge','split','order','startsWith','DESC','ASC','getUpdatedSortOptions','fullname,internal','internal','substring','validateSortParameter','sort','globalStatus','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','jayson/promise','client','http','chatPause','faxPause','mailPause','voicePause','every','filter','length','unavailable','ringing','isNil','voiceStatus','idle','pause','chatStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x19b7,0xfc));var _0x719b=function(_0x299ca8,_0x4e74fa){_0x299ca8=_0x299ca8-0x0;var _0x5dbd44=_0x19b7[_0x299ca8];return _0x5dbd44;};'use strict';var _=require('lodash');var jayson=require(_0x719b('0x0'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x719b('0x1')][_0x719b('0x2')]({'port':0x232a});var routingClient=jayson[_0x719b('0x1')][_0x719b('0x2')]({'port':0x232c});function isAgentPaused(_0x354e20,_0x4bfa57){var _0x2a7cb2=[_0x354e20[_0x719b('0x3')],_0x354e20[_0x719b('0x4')],_0x354e20[_0x719b('0x5')],_0x354e20['openchannelPause'],_0x354e20['smsPause'],_0x354e20[_0x719b('0x6')],_0x354e20['whatsappPause']];if(!_0x4bfa57)return _[_0x719b('0x7')](_0x2a7cb2);var _0x544ada=_[_0x719b('0x8')](_0x2a7cb2);return _0x544ada['length']>0x0&&_0x544ada[_0x719b('0x9')]<_0x2a7cb2['length']?!![]:![];}function isIdle(_0x240fc6){return _0x240fc6==='idle'||_0x240fc6==='unknown'||_0x240fc6===_0x719b('0xa')||_0x240fc6===_0x719b('0xb')||_[_0x719b('0xc')](_0x240fc6);}function isAgentIdle(_0x4bdaea){if(_0x4bdaea[_0x719b('0xd')]!==_0x719b('0xe')&&_0x4bdaea[_0x719b('0x6')]){_0x4bdaea[_0x719b('0xd')]=_0x719b('0xf');return![];}return _[_0x719b('0x7')]([_0x4bdaea[_0x719b('0x10')],_0x4bdaea['faxStatus'],_0x4bdaea[_0x719b('0x11')],_0x4bdaea[_0x719b('0x12')],_0x4bdaea[_0x719b('0x13')],_0x4bdaea[_0x719b('0xd')],_0x4bdaea[_0x719b('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x719b('0x15')](_0x719b('0x16'),{})[_0x719b('0x17')](function(_0x246fd0){if(_0x246fd0[_0x719b('0x18')]){throw new Error(_0x719b('0x19'));}var _0x9d610c=_0x246fd0[_0x719b('0x1a')];return routingClient['request']('Agents',{})[_0x719b('0x17')](function(_0x392f71){if(_0x392f71[_0x719b('0x18')]){throw new Error(_0x719b('0x1b'));}var _0x1e4a62=_0x392f71[_0x719b('0x1a')];return _['merge']({},_0x9d610c,_0x1e4a62);});})[_0x719b('0x1c')](function(_0x5eec99){throw _0x5eec99;});}exports[_0x719b('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x386667){var _0x5adef4=_0x719b('0x1e');if(isAgentPaused(_0x386667))_0x5adef4='pause';else if(isAgentPaused(_0x386667,!![]))_0x5adef4='*pause';else if(isAgentIdle(_0x386667))_0x5adef4='idle';else _0x5adef4=_0x719b('0x1f');return _0x5adef4;}exports[_0x719b('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x470d62,_0x437462){var _0x48d70e=_[_0x719b('0x21')](_0x470d62)?_0x470d62:[_0x470d62];var _0x5ca405=_['startCase'](_0x437462)+_0x719b('0x22');var _0x471bc4=_[_0x719b('0x23')](_0x48d70e,function(_0x5033f6){return db[_0x5ca405][_0x719b('0x24')]({'where':{'id':_0x5033f6}})[_0x719b('0x17')](function(_0x270dd0){if(!_0x270dd0)return[];return _0x270dd0[_0x719b('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x719b('0x26')](_0x471bc4)[_0x719b('0x17')](function(_0x432cb5){var _0x5e9f3d=_(_0x432cb5)[_0x719b('0x27')]()['map']('id')['uniq']()[_0x719b('0x28')]();return _0x5e9f3d;});}exports[_0x719b('0x29')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x8e00ea,_0x1cf2c7,_0x2ed1b1){try{if(_0x1cf2c7[_0x719b('0x9')]>0x0){_0x8e00ea=_0x8e00ea['filter'](function(_0x21ab15){return _0x1cf2c7[_0x719b('0x2a')](_0x21ab15['id']);});}var _0x341c29=_0x8e00ea['filter'](function(_0x3599c5){var _0x26d4f1=_0x719b('0x1f');if(isAgentIdle(_0x3599c5)){_0x26d4f1='idle';}return _0x26d4f1===_0x2ed1b1;});return _[_0x719b('0x23')](_0x341c29,'id');}catch(_0x5dcaba){throw _0x5dcaba;}}exports[_0x719b('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xfcf4ec,_0x21a458,_0x45e435){return Promise[_0x719b('0x2c')]()[_0x719b('0x17')](function(){if(_0x21a458[_0x719b('0x9')]>0x0){_0xfcf4ec=_0xfcf4ec[_0x719b('0x8')](function(_0x371df5){return _0x21a458[_0x719b('0x2a')](_0x371df5['id']);});}return _0xfcf4ec;})[_0x719b('0x17')](function(){return db[_0x719b('0x2d')][_0x719b('0x2e')]({'attributes':['id',_0x719b('0x2f'),_0x719b('0x30'),_0x719b('0x3'),_0x719b('0x4'),_0x719b('0x5'),'openchannelPause',_0x719b('0x31'),_0x719b('0x6'),_0x719b('0x32'),_0x719b('0x33')],'where':{'id':{'$in':_[_0x719b('0x23')](_0xfcf4ec,'id')}},'raw':!![]});})[_0x719b('0x17')](function(_0xfa76f8){return _0xfa76f8[_0x719b('0x23')](function(_0x349c7d){var _0xc000dc=_['find'](_0xfcf4ec,['id',_0x349c7d['id']]);var _0x58c774=filterAgentAttributes(_0xc000dc);_[_0x719b('0x34')](_0x349c7d,_0x58c774);_0x349c7d['globalStatus']=getAgentStatus(_0x349c7d);return _0x349c7d;});})['then'](function(_0x1d6c73){var _0x829bd6=sortAgentsByStatus(_0x1d6c73,_0x45e435);return _['map'](_0x829bd6,'id');})[_0x719b('0x1c')](function(_0x347e51){throw _0x347e51;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2e5c36){var _0x1fb7ac={'fields':[],'order':null};var _0x3fab09=_0x2e5c36[_0x719b('0x35')](',');_0x1fb7ac['fields']=_[_0x719b('0x8')](_0x3fab09,function(_0x5016c6){if(!_0x5016c6[_0x719b('0x2a')]('globalStatus')){return!![];}_0x1fb7ac[_0x719b('0x36')]=_[_0x719b('0x37')](_0x5016c6,'-')?_0x719b('0x38'):_0x719b('0x39');return![];});return _0x1fb7ac;}exports[_0x719b('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x51f800){if(!_0x51f800){_0x51f800=_0x719b('0x3b');}if(_0x51f800['includes']('fullname')&&!_0x51f800['includes'](_0x719b('0x3c'))){var _0x23048d=_0x51f800[_0x719b('0x3d')](0x0,_0x51f800['indexOf'](_0x719b('0x30')));_0x51f800+=','+_0x23048d+_0x719b('0x3c');}return _0x51f800;}exports[_0x719b('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x35f250,_0x597bca){var _0xb47d28=_0x35f250[_0x719b('0x3f')](function(_0x297d39,_0x574858){if(_0x297d39[_0x719b('0x40')]===_0x574858[_0x719b('0x40')]){if(_0x297d39[_0x719b('0x40')]===_0x719b('0xf')){if(_0x597bca==='DESC'){return(_0x297d39[_0x719b('0x33')]||'')<(_0x574858[_0x719b('0x33')]||'')||_0x297d39['fullname']['toLowerCase']()>_0x574858['fullname'][_0x719b('0x41')]()?0x1:-0x1;}else{return(_0x297d39[_0x719b('0x33')]||'')<(_0x574858[_0x719b('0x33')]||'')||_0x297d39['fullname'][_0x719b('0x41')]()>_0x574858[_0x719b('0x30')][_0x719b('0x41')]()?-0x1:0x1;}}else{if(_0x597bca===_0x719b('0x38')){return _0x297d39[_0x719b('0x30')][_0x719b('0x41')]()<_0x574858[_0x719b('0x30')][_0x719b('0x41')]()?0x1:-0x1;}else{return _0x297d39[_0x719b('0x30')][_0x719b('0x41')]()<_0x574858[_0x719b('0x30')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x597bca===_0x719b('0x38')){return _0x297d39[_0x719b('0x40')]<_0x574858['globalStatus']?0x1:-0x1;}else{return _0x297d39[_0x719b('0x40')]<_0x574858['globalStatus']?-0x1:0x1;}}});return _0xb47d28;}exports[_0x719b('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x4a5b7d){var _0x120a5a=[_0x719b('0x43'),_0x719b('0x44'),_0x719b('0x45'),_0x719b('0x46'),'pauseType','lastPauseAt','internal',_0x719b('0x47'),_0x719b('0x3'),'openchannelPause',_0x719b('0x5'),_0x719b('0x31'),_0x719b('0x32'),_0x719b('0x4'),_0x719b('0x6'),'chatCapacity','openchannelCapacity','mailCapacity',_0x719b('0x48'),_0x719b('0x49'),_0x719b('0x4a'),_0x719b('0x4b'),_0x719b('0x4c'),_0x719b('0x4d'),_0x719b('0x4e'),_0x719b('0x4f'),'faxCurrentCapacity','chatStatus',_0x719b('0x12'),_0x719b('0x11'),_0x719b('0x13'),_0x719b('0x14'),'faxStatus',_0x719b('0xd'),_0x719b('0x50'),_0x719b('0x51'),_0x719b('0x52'),_0x719b('0x53'),_0x719b('0x54'),_0x719b('0x55'),'voiceStatusTime',_0x719b('0x56'),_0x719b('0x57'),'screenrecording',_0x719b('0x58'),_0x719b('0x59'),'routealias'];var _0x25142d=[_0x719b('0x3'),'openchannelPause',_0x719b('0x5'),_0x719b('0x31'),'whatsappPause',_0x719b('0x4'),_0x719b('0x6'),'online'];var _0x3a255e=_(_0x4a5b7d)[_0x719b('0x5a')](_0x25142d)[_0x719b('0x5b')](_0x120a5a)[_0x719b('0x28')]();return _0x3a255e;}exports[_0x719b('0x5c')]=filterAgentAttributes; \ No newline at end of file +var _0xc9a1=['order','startsWith','ASC','getUpdatedSortOptions','fullname,internal','fullname','internal','substring','indexOf','validateSortParameter','DESC','toLowerCase','sortAgentsByStatus','online','lastLoginAt','lastPauseAt','chatCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','openchannelStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','lodash','jayson/promise','../../mysqldb','http','client','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','ringing','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','getRealtimeAgents','busy','getAgentStatus','startCase','Queue','map','findOne','getAgents','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','pauseType','find','globalStatus','getSortedAgentsIdsByStatus'];(function(_0x2b7f3a,_0x518001){var _0x58dfd0=function(_0x581f2b){while(--_0x581f2b){_0x2b7f3a['push'](_0x2b7f3a['shift']());}};_0x58dfd0(++_0x518001);}(_0xc9a1,0x131));var _0x1c9a=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xc9a1[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x1c9a('0x0'));var jayson=require(_0x1c9a('0x1'));var db=require(_0x1c9a('0x2'))['db'];var amiClient=jayson['client'][_0x1c9a('0x3')]({'port':0x232a});var routingClient=jayson[_0x1c9a('0x4')][_0x1c9a('0x3')]({'port':0x232c});function isAgentPaused(_0x100a17,_0x321253){var _0x4f0943=[_0x100a17[_0x1c9a('0x5')],_0x100a17[_0x1c9a('0x6')],_0x100a17[_0x1c9a('0x7')],_0x100a17[_0x1c9a('0x8')],_0x100a17[_0x1c9a('0x9')],_0x100a17[_0x1c9a('0xa')],_0x100a17[_0x1c9a('0xb')]];if(!_0x321253)return _['every'](_0x4f0943);var _0x3ecfb4=_[_0x1c9a('0xc')](_0x4f0943);return _0x3ecfb4['length']>0x0&&_0x3ecfb4[_0x1c9a('0xd')]<_0x4f0943[_0x1c9a('0xd')]?!![]:![];}function isIdle(_0x645f5b){return _0x645f5b===_0x1c9a('0xe')||_0x645f5b===_0x1c9a('0xf')||_0x645f5b==='unavailable'||_0x645f5b===_0x1c9a('0x10')||_['isNil'](_0x645f5b);}function isAgentIdle(_0x33826f){if(_0x33826f[_0x1c9a('0x11')]!=='idle'&&_0x33826f[_0x1c9a('0xa')]){_0x33826f[_0x1c9a('0x11')]=_0x1c9a('0x12');return![];}return _['every']([_0x33826f[_0x1c9a('0x13')],_0x33826f[_0x1c9a('0x14')],_0x33826f[_0x1c9a('0x15')],_0x33826f[_0x1c9a('0x16')],_0x33826f[_0x1c9a('0x17')],_0x33826f[_0x1c9a('0x11')],_0x33826f[_0x1c9a('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x1c9a('0x19')](_0x1c9a('0x1a'),{})[_0x1c9a('0x1b')](function(_0x5c0200){if(_0x5c0200[_0x1c9a('0x1c')]){throw new Error(_0x1c9a('0x1d'));}var _0x20b9a7=_0x5c0200[_0x1c9a('0x1e')];return routingClient['request']('Agents',{})['then'](function(_0x353a6c){if(_0x353a6c[_0x1c9a('0x1c')]){throw new Error(_0x1c9a('0x1f'));}var _0x58d34a=_0x353a6c['result'];return _[_0x1c9a('0x20')]({},_0x20b9a7,_0x58d34a);});})['catch'](function(_0x29052b){throw _0x29052b;});}exports[_0x1c9a('0x21')]=getRealtimeAgents;function getAgentStatus(_0x666fc8){var _0x385e24=_0x1c9a('0xf');if(isAgentPaused(_0x666fc8))_0x385e24='pause';else if(isAgentPaused(_0x666fc8,!![]))_0x385e24='*pause';else if(isAgentIdle(_0x666fc8))_0x385e24=_0x1c9a('0xe');else _0x385e24=_0x1c9a('0x22');return _0x385e24;}exports[_0x1c9a('0x23')]=getAgentStatus;function getAgentIdsByQueues(_0x2dd047,_0x23de35){var _0x75281c=_['isArray'](_0x2dd047)?_0x2dd047:[_0x2dd047];var _0x47189c=_[_0x1c9a('0x24')](_0x23de35)+_0x1c9a('0x25');var _0x5c91f5=_[_0x1c9a('0x26')](_0x75281c,function(_0x5ae747){return db[_0x47189c][_0x1c9a('0x27')]({'where':{'id':_0x5ae747}})[_0x1c9a('0x1b')](function(_0x46fe3d){if(!_0x46fe3d)return[];return _0x46fe3d[_0x1c9a('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x1c9a('0x29')](_0x5c91f5)[_0x1c9a('0x1b')](function(_0x5dc301){var _0x16a671=_(_0x5dc301)[_0x1c9a('0x2a')]()[_0x1c9a('0x26')]('id')['uniq']()[_0x1c9a('0x2b')]();return _0x16a671;});}exports[_0x1c9a('0x2c')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5485b0,_0x5841e0,_0x1aa26c){try{if(_0x5841e0[_0x1c9a('0xd')]>0x0){_0x5485b0=_0x5485b0['filter'](function(_0x44dd4d){return _0x5841e0[_0x1c9a('0x2d')](_0x44dd4d['id']);});}var _0x4d2c85=_0x5485b0[_0x1c9a('0xc')](function(_0x283366){var _0x1ed2b6=_0x1c9a('0x22');if(isAgentIdle(_0x283366)){_0x1ed2b6=_0x1c9a('0xe');}return _0x1ed2b6===_0x1aa26c;});return _[_0x1c9a('0x26')](_0x4d2c85,'id');}catch(_0x1f093a){throw _0x1f093a;}}exports[_0x1c9a('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4afc46,_0x351bfd,_0x52ccb5){return Promise[_0x1c9a('0x2f')]()['then'](function(){if(_0x351bfd[_0x1c9a('0xd')]>0x0){_0x4afc46=_0x4afc46['filter'](function(_0x30ef9e){return _0x351bfd[_0x1c9a('0x2d')](_0x30ef9e['id']);});}return _0x4afc46;})[_0x1c9a('0x1b')](function(){return db[_0x1c9a('0x30')][_0x1c9a('0x31')]({'attributes':['id',_0x1c9a('0x32'),'fullname',_0x1c9a('0x5'),'faxPause',_0x1c9a('0x7'),_0x1c9a('0x8'),'smsPause',_0x1c9a('0xa'),_0x1c9a('0xb'),_0x1c9a('0x33')],'where':{'id':{'$in':_['map'](_0x4afc46,'id')}},'raw':!![]});})[_0x1c9a('0x1b')](function(_0x503fc7){return _0x503fc7['map'](function(_0x344897){var _0x3ccb47=_[_0x1c9a('0x34')](_0x4afc46,['id',_0x344897['id']]);var _0x56a730=filterAgentAttributes(_0x3ccb47);_[_0x1c9a('0x20')](_0x344897,_0x56a730);_0x344897[_0x1c9a('0x35')]=getAgentStatus(_0x344897);return _0x344897;});})['then'](function(_0x30feed){var _0x3e695f=sortAgentsByStatus(_0x30feed,_0x52ccb5);return _[_0x1c9a('0x26')](_0x3e695f,'id');})['catch'](function(_0x2f8311){throw _0x2f8311;});}exports[_0x1c9a('0x36')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x275909){var _0x3e6bea={'fields':[],'order':null};var _0x5071f7=_0x275909['split'](',');_0x3e6bea['fields']=_['filter'](_0x5071f7,function(_0x5e41ca){if(!_0x5e41ca['includes']('globalStatus')){return!![];}_0x3e6bea[_0x1c9a('0x37')]=_[_0x1c9a('0x38')](_0x5e41ca,'-')?'DESC':_0x1c9a('0x39');return![];});return _0x3e6bea;}exports[_0x1c9a('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x574e4d){if(!_0x574e4d){_0x574e4d=_0x1c9a('0x3b');}if(_0x574e4d[_0x1c9a('0x2d')](_0x1c9a('0x3c'))&&!_0x574e4d[_0x1c9a('0x2d')](_0x1c9a('0x3d'))){var _0x491f47=_0x574e4d[_0x1c9a('0x3e')](0x0,_0x574e4d[_0x1c9a('0x3f')](_0x1c9a('0x3c')));_0x574e4d+=','+_0x491f47+'internal';}return _0x574e4d;}exports[_0x1c9a('0x40')]=validateSortParameter;function sortAgentsByStatus(_0x295f2e,_0x45af12){var _0x552062=_0x295f2e['sort'](function(_0x5d0965,_0xb749cf){if(_0x5d0965[_0x1c9a('0x35')]===_0xb749cf[_0x1c9a('0x35')]){if(_0x5d0965[_0x1c9a('0x35')]===_0x1c9a('0x12')){if(_0x45af12===_0x1c9a('0x41')){return(_0x5d0965[_0x1c9a('0x33')]||'')<(_0xb749cf[_0x1c9a('0x33')]||'')||_0x5d0965[_0x1c9a('0x3c')][_0x1c9a('0x42')]()>_0xb749cf[_0x1c9a('0x3c')]['toLowerCase']()?0x1:-0x1;}else{return(_0x5d0965['pauseType']||'')<(_0xb749cf[_0x1c9a('0x33')]||'')||_0x5d0965['fullname'][_0x1c9a('0x42')]()>_0xb749cf[_0x1c9a('0x3c')][_0x1c9a('0x42')]()?-0x1:0x1;}}else{if(_0x45af12==='DESC'){return _0x5d0965[_0x1c9a('0x3c')][_0x1c9a('0x42')]()<_0xb749cf[_0x1c9a('0x3c')][_0x1c9a('0x42')]()?0x1:-0x1;}else{return _0x5d0965['fullname'][_0x1c9a('0x42')]()<_0xb749cf['fullname'][_0x1c9a('0x42')]()?-0x1:0x1;}}}else{if(_0x45af12===_0x1c9a('0x41')){return _0x5d0965[_0x1c9a('0x35')]<_0xb749cf[_0x1c9a('0x35')]?0x1:-0x1;}else{return _0x5d0965['globalStatus']<_0xb749cf[_0x1c9a('0x35')]?-0x1:0x1;}}});return _0x552062;}exports[_0x1c9a('0x43')]=sortAgentsByStatus;function filterAgentAttributes(_0x3f4b88){var _0x15061a=['userpic',_0x1c9a('0x44'),_0x1c9a('0x45'),_0x1c9a('0x46'),'pauseType',_0x1c9a('0x46'),_0x1c9a('0x3d'),'address','chatPause',_0x1c9a('0x8'),_0x1c9a('0x7'),_0x1c9a('0x9'),_0x1c9a('0xb'),_0x1c9a('0x6'),_0x1c9a('0xa'),_0x1c9a('0x47'),'openchannelCapacity','mailCapacity',_0x1c9a('0x48'),'whatsappCapacity',_0x1c9a('0x49'),_0x1c9a('0x4a'),_0x1c9a('0x4b'),_0x1c9a('0x4c'),_0x1c9a('0x4d'),_0x1c9a('0x4e'),'faxCurrentCapacity',_0x1c9a('0x13'),'openchannelStatus',_0x1c9a('0x15'),_0x1c9a('0x17'),_0x1c9a('0x18'),'faxStatus','voiceStatus','chatStatusTime',_0x1c9a('0x4f'),'mailStatusTime',_0x1c9a('0x50'),_0x1c9a('0x51'),'faxStatusTime',_0x1c9a('0x52'),_0x1c9a('0x53'),_0x1c9a('0x54'),_0x1c9a('0x55'),_0x1c9a('0x56'),_0x1c9a('0x57'),_0x1c9a('0x58')];var _0x5c767f=[_0x1c9a('0x5'),_0x1c9a('0x8'),_0x1c9a('0x7'),'smsPause',_0x1c9a('0xb'),'faxPause','voicePause',_0x1c9a('0x44')];var _0x26948e=_(_0x3f4b88)[_0x1c9a('0x59')](_0x5c767f)['pick'](_0x15061a)[_0x1c9a('0x2b')]();return _0x26948e;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 17716c7..1bf6cbc 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe045=['predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','outbound','map','get','waiting','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','busy','inUse','invalid','loggedInDb','onHold','ringing','ringInUse','talking','unknown','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xe045,0xb2));var _0x5e04=function(_0x46479c,_0x38b4b0){_0x46479c=_0x46479c-0x0;var _0x583767=_0xe045[_0x46479c];return _0x583767;};'use strict';var _=require(_0x5e04('0x0'));var jayson=require(_0x5e04('0x1'));var util=require(_0x5e04('0x2'));var amiClient=jayson[_0x5e04('0x3')][_0x5e04('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x5e04('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x5e04('0x5'),'loggedIn','paused','waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x5e04('0x6'),_0x5e04('0x7'),_0x5e04('0x8'),_0x5e04('0x9'),'notInUse',_0x5e04('0xa'),_0x5e04('0xb'),_0x5e04('0xc'),_0x5e04('0xd'),'unavailable',_0x5e04('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x5e04('0xf'),_0x5e04('0x10'),_0x5e04('0x11'),_0x5e04('0x12'),_0x5e04('0x13'),_0x5e04('0x14'),_0x5e04('0x15'),_0x5e04('0x16'),_0x5e04('0x17'),_0x5e04('0x18'),'erlangCallToSecond',_0x5e04('0x19'),_0x5e04('0x1a'),_0x5e04('0x1b'),_0x5e04('0x1c'),'dialPredictiveIntervalMinThreshold',_0x5e04('0x1d'),'predictiveIntervalTotalCalls',_0x5e04('0x1e'),_0x5e04('0x1f'),_0x5e04('0x20'),_0x5e04('0x21'),_0x5e04('0x22')];function getRealtimeQueues(_0x248885,_0x21658b){var _0x417eb9=_0x21658b===_0x5e04('0x23')?amiClient:routingClient;return _0x417eb9[_0x5e04('0x24')](_['startCase'](_0x21658b)+'Queues',_0x248885)['then'](function(_0x43018){if(_0x43018[_0x5e04('0x25')])throw new Error(util[_0x5e04('0x26')](_0x5e04('0x27'),_0x21658b));return _0x43018[_0x5e04('0x28')];})['catch'](function(_0x549064){throw _0x549064;});}exports[_0x5e04('0x29')]=getRealtimeQueues;function initializeQueues(_0x5f01a0,_0x502083,_0x5e30e1,_0x50a71e){var _0x34a933=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5e30e1===_0x5e04('0x23')){if(_0x50a71e===_0x5e04('0x2a')){_0x34a933=_0x34a933[_0x5e04('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x50a71e===_0x5e04('0x2c')){_0x34a933=_0x34a933['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x5f01a0[_0x5e04('0x2d')](function(_0x489913){var _0x13fd30=_0x489913[_0x5e04('0x2e')]({'plain':!![]});_0x13fd30['paused']=0x0;_0x13fd30[_0x5e04('0x9')]=0x0;_0x13fd30['loggedIn']=0x0;_0x13fd30[_0x5e04('0x5')]=0x0;_0x13fd30[_0x5e04('0x2f')]=0x0;if(_0x5e30e1==='voice'){_0x13fd30[_0x5e04('0xd')]=0x0;_0x13fd30['busy']=0x0;if(_0x50a71e===_0x5e04('0x2c')){_0x13fd30[_0x5e04('0xf')]=0x0;_0x13fd30['originated']=0x0;}}var _0x231e88=_[_0x5e04('0x30')](_0x502083,['id',_0x13fd30['id']]);if(_0x231e88){_[_0x5e04('0x31')](_0x13fd30,_[_0x5e04('0x32')](_0x231e88,_0x34a933));}return _0x13fd30;});}exports[_0x5e04('0x33')]=initializeQueues; \ No newline at end of file +var _0x7593=['unavailable','unknown','message','statusMessage','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map','get','loggedIn','pTalking','find','initializeQueues','lodash','util','client','http','available','paused','waiting','busy','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking'];(function(_0x6c59fc,_0x5fe88d){var _0x17c96f=function(_0x5a6c82){while(--_0x5a6c82){_0x6c59fc['push'](_0x6c59fc['shift']());}};_0x17c96f(++_0x5fe88d);}(_0x7593,0xff));var _0x3759=function(_0x1f9773,_0x4365fb){_0x1f9773=_0x1f9773-0x0;var _0x3fc947=_0x7593[_0x1f9773];return _0x3fc947;};'use strict';var _=require(_0x3759('0x0'));var jayson=require('jayson/promise');var util=require(_0x3759('0x1'));var amiClient=jayson[_0x3759('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0x3759('0x2')][_0x3759('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x3759('0x4'),'loggedIn',_0x3759('0x5'),_0x3759('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x3759('0x7'),'inUse',_0x3759('0x8'),_0x3759('0x9'),_0x3759('0xa'),_0x3759('0xb'),_0x3759('0xc'),_0x3759('0xd'),_0x3759('0xe'),_0x3759('0xf'),_0x3759('0x10')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking','originated',_0x3759('0x11'),_0x3759('0x12'),'dialActive',_0x3759('0x13'),_0x3759('0x14'),_0x3759('0x15'),_0x3759('0x16'),_0x3759('0x17'),_0x3759('0x18'),_0x3759('0x19'),_0x3759('0x1a'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x3759('0x1b'),_0x3759('0x1c'),_0x3759('0x1d'),_0x3759('0x1e'),_0x3759('0x1f'),_0x3759('0x20'),_0x3759('0x21'),_0x3759('0x22')];function getRealtimeQueues(_0xd7f795,_0x202f8a){var _0x44f059=_0x202f8a===_0x3759('0x23')?amiClient:routingClient;return _0x44f059[_0x3759('0x24')](_['startCase'](_0x202f8a)+_0x3759('0x25'),_0xd7f795)[_0x3759('0x26')](function(_0x525442){if(_0x525442[_0x3759('0x27')])throw new Error(util[_0x3759('0x28')](_0x3759('0x29'),_0x202f8a));return _0x525442[_0x3759('0x2a')];})[_0x3759('0x2b')](function(_0x2af038){throw _0x2af038;});}exports[_0x3759('0x2c')]=getRealtimeQueues;function initializeQueues(_0x2df425,_0x481275,_0x3bb7ba,_0x3953ab){var _0xf86c13=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3bb7ba===_0x3759('0x23')){if(_0x3953ab===_0x3759('0x2d')){_0xf86c13=_0xf86c13[_0x3759('0x2e')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3953ab===_0x3759('0x2f')){_0xf86c13=_0xf86c13[_0x3759('0x2e')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2df425[_0x3759('0x30')](function(_0x3015e5){var _0x127da8=_0x3015e5[_0x3759('0x31')]({'plain':!![]});_0x127da8[_0x3759('0x5')]=0x0;_0x127da8[_0x3759('0x9')]=0x0;_0x127da8[_0x3759('0x32')]=0x0;_0x127da8['available']=0x0;_0x127da8[_0x3759('0x6')]=0x0;if(_0x3bb7ba===_0x3759('0x23')){_0x127da8[_0x3759('0xe')]=0x0;_0x127da8[_0x3759('0x7')]=0x0;if(_0x3953ab===_0x3759('0x2f')){_0x127da8[_0x3759('0x33')]=0x0;_0x127da8['originated']=0x0;}}var _0x4550af=_[_0x3759('0x34')](_0x481275,['id',_0x127da8['id']]);if(_0x4550af){_['merge'](_0x127da8,_['pick'](_0x4550af,_0xf86c13));}return _0x127da8;});}exports[_0x3759('0x35')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index bb5db8a..ba6aeaa 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x705b98,_0x1c345b){var _0x47b72f=function(_0x44f02a){while(--_0x44f02a){_0x705b98['push'](_0x705b98['shift']());}};_0x47b72f(++_0x1c345b);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 66a503b..6844187 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 _0x3262=['utf8','replace','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','keys','length','filter','family','internal','concat','head','mac','address','127.0.0.1','getFirstInterface','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid'];(function(_0x3d8ac2,_0x5be1d6){var _0x3d8672=function(_0xab9c35){while(--_0xab9c35){_0x3d8ac2['push'](_0x3d8ac2['shift']());}};_0x3d8672(++_0x5be1d6);}(_0x3262,0x86));var _0x2326=function(_0x602436,_0xbf433){_0x602436=_0x602436-0x0;var _0x504c33=_0x3262[_0x602436];return _0x504c33;};'use strict';var _=require(_0x2326('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x2326('0x1'));var exec=require(_0x2326('0x2'))[_0x2326('0x3')];var config=require('../environment');function getInterfaces(){var _0x255010=[];var _0x26bf69=os['networkInterfaces']();var _0x59fbc8=_['orderBy'](_[_0x2326('0x4')](_0x26bf69));for(var _0x3da97b=0x0;_0x3da97b<_0x59fbc8[_0x2326('0x5')];_0x3da97b++){var _0x2b500c=_0x26bf69[_0x59fbc8[_0x3da97b]][_0x2326('0x6')](function(_0x11d981){return _0x11d981[_0x2326('0x7')]==='IPv4'&&_0x11d981[_0x2326('0x8')]===![];});_0x255010=_0x255010[_0x2326('0x9')](_0x2b500c);}return _0x255010;}function getFirstInterface(){var _0x1dcc6e=_[_0x2326('0xa')](getInterfaces());return{'macAddress':_0x1dcc6e&&_0x1dcc6e[_0x2326('0xb')]?_0x1dcc6e[_0x2326('0xb')]:'00:00:00:00:00:00','ipAddress':_0x1dcc6e&&_0x1dcc6e[_0x2326('0xc')]?_0x1dcc6e['address']:_0x2326('0xd')};}exports[_0x2326('0xe')]=getFirstInterface;function getCPUhash(){var _0x9c3e5d=_['orderBy'](os['cpus']()['map'](function(_0x1b2b85){return _0x1b2b85['model'];}))[_0x2326('0xf')](':');return crypto[_0x2326('0x10')](_0x2326('0x11'))[_0x2326('0x12')](_0x9c3e5d)[_0x2326('0x13')](_0x2326('0x14'));}exports[_0x2326('0x15')]=function(){var _0x50462b=os[_0x2326('0x16')]();var _0x498297=/[0-9a-f-]{36}/;if(config[_0x2326('0x17')]&&_0x498297['test'](config[_0x2326('0x17')])){return config[_0x2326('0x17')];}else if(_0x50462b===_0x2326('0x18')){return exec(_0x2326('0x19'),{'encoding':_0x2326('0x1a')})[_0x2326('0x1b')]('\x0d\x0a','');}else{var _0x6f99b3=getFirstInterface();var _0x1cae91=getCPUhash();var _0x2ee0d7=_0x1cae91+'|'+os[_0x2326('0x1c')]()+'|'+_0x6f99b3[_0x2326('0x1d')]+'|'+_0x6f99b3[_0x2326('0x1e')];var _0x2bddb1=crypto[_0x2326('0x10')](_0x2326('0x11'))[_0x2326('0x12')](_0x2ee0d7)[_0x2326('0x13')]('hex');return _0x2bddb1['substring'](0x0,0x8)+'-'+_0x2bddb1['substring'](0x8,0xc)+'-'+_0x2bddb1[_0x2326('0x1f')](0xc,0x10)+'-'+_0x2bddb1[_0x2326('0x1f')](0x10,0x14)+'-'+_0x2bddb1['substring'](0x14);}}; \ No newline at end of file +var _0x621f=['../environment','orderBy','keys','length','filter','family','IPv4','internal','head','mac','address','127.0.0.1','getFirstInterface','map','model','join','createHash','md5','update','digest','hex','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','substring','lodash','crypto','bimedia-machine-uuid'];(function(_0x404c13,_0x5ea388){var _0x266bef=function(_0x33b721){while(--_0x33b721){_0x404c13['push'](_0x404c13['shift']());}};_0x266bef(++_0x5ea388);}(_0x621f,0xa2));var _0xf621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x621f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf621('0x0'));var os=require('os');var crypto=require(_0xf621('0x1'));var machine=require(_0xf621('0x2'));var exec=require('child_process')['execSync'];var config=require(_0xf621('0x3'));function getInterfaces(){var _0xe342ac=[];var _0x470bc9=os['networkInterfaces']();var _0x2f76fc=_[_0xf621('0x4')](_[_0xf621('0x5')](_0x470bc9));for(var _0x4cf916=0x0;_0x4cf916<_0x2f76fc[_0xf621('0x6')];_0x4cf916++){var _0x1e23a6=_0x470bc9[_0x2f76fc[_0x4cf916]][_0xf621('0x7')](function(_0x54e0f5){return _0x54e0f5[_0xf621('0x8')]===_0xf621('0x9')&&_0x54e0f5[_0xf621('0xa')]===![];});_0xe342ac=_0xe342ac['concat'](_0x1e23a6);}return _0xe342ac;}function getFirstInterface(){var _0xa695fb=_[_0xf621('0xb')](getInterfaces());return{'macAddress':_0xa695fb&&_0xa695fb['mac']?_0xa695fb[_0xf621('0xc')]:'00:00:00:00:00:00','ipAddress':_0xa695fb&&_0xa695fb[_0xf621('0xd')]?_0xa695fb[_0xf621('0xd')]:_0xf621('0xe')};}exports[_0xf621('0xf')]=getFirstInterface;function getCPUhash(){var _0x1c58bd=_[_0xf621('0x4')](os['cpus']()[_0xf621('0x10')](function(_0x4b97fa){return _0x4b97fa[_0xf621('0x11')];}))[_0xf621('0x12')](':');return crypto[_0xf621('0x13')](_0xf621('0x14'))[_0xf621('0x15')](_0x1c58bd)[_0xf621('0x16')](_0xf621('0x17'));}exports['getUuid']=function(){var _0x4791cd=os[_0xf621('0x18')]();var _0x29641d=/[0-9a-f-]{36}/;if(config[_0xf621('0x19')]&&_0x29641d[_0xf621('0x1a')](config[_0xf621('0x19')])){return config[_0xf621('0x19')];}else if(_0x4791cd===_0xf621('0x1b')){return exec(_0xf621('0x1c'),{'encoding':_0xf621('0x1d')})[_0xf621('0x1e')]('\x0d\x0a','');}else{var _0x9f4fb6=getFirstInterface();var _0x6a4784=getCPUhash();var _0x1d8f69=_0x6a4784+'|'+os[_0xf621('0x1f')]()+'|'+_0x9f4fb6['macAddress']+'|'+_0x9f4fb6['ipAddress'];var _0x2693d6=crypto[_0xf621('0x13')](_0xf621('0x14'))[_0xf621('0x15')](_0x1d8f69)[_0xf621('0x16')](_0xf621('0x17'));return _0x2693d6['substring'](0x0,0x8)+'-'+_0x2693d6[_0xf621('0x20')](0x8,0xc)+'-'+_0x2693d6[_0xf621('0x20')](0xc,0x10)+'-'+_0x2693d6[_0xf621('0x20')](0x10,0x14)+'-'+_0x2693d6['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index cb61f2d..e618abb 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 _0x050b=['License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','exports','then','catch','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid'];(function(_0x4c321c,_0x3e9da0){var _0x25accb=function(_0x21bf7a){while(--_0x21bf7a){_0x4c321c['push'](_0x4c321c['shift']());}};_0x25accb(++_0x3e9da0);}(_0x050b,0x115));var _0xb050=function(_0x5dbe93,_0x34703e){_0x5dbe93=_0x5dbe93-0x0;var _0x4267e5=_0x050b[_0x5dbe93];return _0x4267e5;};'use strict';var util=require(_0xb050('0x0'));var moment=require(_0xb050('0x1'));var rp=require(_0xb050('0x2'));var BPromise=require(_0xb050('0x3'));var pkginfo=require(_0xb050('0x4'))(module,_0xb050('0x5'));var db=require(_0xb050('0x6'))['db'];var encryptor=require(_0xb050('0x7'));var hardware=require('./hardware');var logger=require(_0xb050('0x8'))(_0xb050('0x9'));var HOST=_0xb050('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x11b1b0){return new BPromise(function(_0x38a320,_0x5b4afb){var _0x3d42e3=util[_0xb050('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x11b1b0,module[_0xb050('0xc')][_0xb050('0x5')]);if(oldToken){_0x3d42e3=util[_0xb050('0xb')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x11b1b0,module['exports'][_0xb050('0x5')],oldToken);}var _0x176bf7={'uri':_0x3d42e3,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x176bf7)[_0xb050('0xd')](function(_0x34b236){_0x38a320(_0x34b236);})[_0xb050('0xe')](function(_0x32f3ee){_0x5b4afb(_0x32f3ee);});});}function manageLicense(_0x45853e,_0x19c3f8){var _0x27bdcc=_0x19c3f8[_0xb050('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x27bdcc[_0xb050('0x10')]!==_0x45853e&&!_0x27bdcc[_0xb050('0x11')]){oldToken=_0x27bdcc[_0xb050('0x10')];}httpRequest(_0x45853e)['then'](function(_0x18b795){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x18b795['active']){isOldTokenSent=![];if(!_0x27bdcc[_0xb050('0x9')]&&_0x27bdcc[_0xb050('0x9')]!=_0x18b795[_0xb050('0x9')]||_0x27bdcc['license']&&_0x27bdcc['data2']){logger[_0xb050('0x12')](_0xb050('0x13'));}if(_0x27bdcc[_0xb050('0x9')]&&!_0x27bdcc[_0xb050('0x11')]&&_0x27bdcc[_0xb050('0x9')]!=_0x18b795[_0xb050('0x9')]){logger[_0xb050('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x27bdcc[_0xb050('0x9')]&&!_0x27bdcc[_0xb050('0x11')]&&_0x27bdcc[_0xb050('0x9')]==_0x18b795[_0xb050('0x9')]){return _0x19c3f8;}return _0x19c3f8[_0xb050('0x14')]({'data1':_0x45853e,'data2':null,'license':_0x18b795[_0xb050('0x9')]});}else{if(_0x18b795[_0xb050('0x9')]||_0x27bdcc['license']){if(!_0x27bdcc[_0xb050('0x11')]){if(_0x27bdcc[_0xb050('0x10')]==_0x45853e){GRAY_PERIOD_REASON=_0xb050('0x15');logger[_0xb050('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xb050('0x16');logger[_0xb050('0x12')](_0xb050('0x17'),_0x27bdcc[_0xb050('0x10')],_0x45853e);}logger[_0xb050('0x12')](_0xb050('0x18'),GRAY_PERIOD_REASON[_0xb050('0x19')](),moment()['format'](_0xb050('0x1a')));return _0x19c3f8[_0xb050('0x14')]({'data2':encryptor[_0xb050('0x1b')](moment()[_0xb050('0xb')](_0xb050('0x1a')))});}else{if(moment()[_0xb050('0x1c')](encryptor[_0xb050('0x1d')](_0x27bdcc[_0xb050('0x11')]),_0xb050('0x1e'))>DAYS){logger[_0xb050('0x12')](_0xb050('0x1f'),moment()[_0xb050('0xb')](_0xb050('0x1a')));isOldTokenSent=![];return _0x19c3f8[_0xb050('0x14')]({'data1':_0x45853e,'data2':null,'license':null});}}}else{if(_0x27bdcc[_0xb050('0x10')]!=_0x45853e){logger[_0xb050('0x12')](_0xb050('0x17'),_0x27bdcc[_0xb050('0x10')],_0x45853e);return _0x19c3f8[_0xb050('0x14')]({'data1':_0x45853e,'data2':null,'license':null});}}}return _0x19c3f8;})['then'](function(_0x26e2cc){_0x19c3f8=_0x26e2cc;})[_0xb050('0xe')](function(_0x2169f1){logger[_0xb050('0x20')](_0x2169f1[_0xb050('0x21')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xb050('0x22')](),_0x19c3f8);},TIME);});}function defaultLicense(){var _0x39569a=hardware[_0xb050('0x22')]();if(_0x39569a){return db[_0xb050('0x23')][_0xb050('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x39569a}})[_0xb050('0x25')](function(_0x1dc9cc,_0x54397b){logger[_0xb050('0x12')](_0xb050('0x26'),_0x39569a);manageLicense(_0x39569a,_0x1dc9cc);})[_0xb050('0xe')](function(_0x999fa8){logger[_0xb050('0x20')](_0x999fa8[_0xb050('0x21')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x04de=['license','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','get','data1','then','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','util','pkginfo','version','../../components/encryptor','./hardware','../logger'];(function(_0x486c14,_0x22542d){var _0x1d3ff9=function(_0x3150ef){while(--_0x3150ef){_0x486c14['push'](_0x486c14['shift']());}};_0x1d3ff9(++_0x22542d);}(_0x04de,0x176));var _0xe04d=function(_0x218bf2,_0x30ca32){_0x218bf2=_0x218bf2-0x0;var _0x3922e0=_0x04de[_0x218bf2];return _0x3922e0;};'use strict';var util=require(_0xe04d('0x0'));var moment=require('moment');var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0xe04d('0x1'))(module,_0xe04d('0x2'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xe04d('0x3'));var hardware=require(_0xe04d('0x4'));var logger=require(_0xe04d('0x5'))(_0xe04d('0x6'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x57e342){return new BPromise(function(_0x36eaa8,_0xa176aa){var _0x3c8ba4=util[_0xe04d('0x7')](_0xe04d('0x8'),HOST,_0x57e342,module[_0xe04d('0x9')][_0xe04d('0x2')]);if(oldToken){_0x3c8ba4=util['format'](_0xe04d('0xa'),HOST,_0x57e342,module[_0xe04d('0x9')]['version'],oldToken);}var _0x477cd7={'uri':_0x3c8ba4,'method':_0xe04d('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x477cd7)['then'](function(_0x217e45){_0x36eaa8(_0x217e45);})['catch'](function(_0x1b59dd){_0xa176aa(_0x1b59dd);});});}function manageLicense(_0x3d0375,_0x49db4e){var _0x2aac7b=_0x49db4e[_0xe04d('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x2aac7b[_0xe04d('0xd')]!==_0x3d0375&&!_0x2aac7b['data2']){oldToken=_0x2aac7b['data1'];}httpRequest(_0x3d0375)[_0xe04d('0xe')](function(_0x37c71b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x37c71b['active']){isOldTokenSent=![];if(!_0x2aac7b[_0xe04d('0x6')]&&_0x2aac7b['license']!=_0x37c71b[_0xe04d('0x6')]||_0x2aac7b[_0xe04d('0x6')]&&_0x2aac7b[_0xe04d('0xf')]){logger[_0xe04d('0x10')](_0xe04d('0x11'));}if(_0x2aac7b['license']&&!_0x2aac7b[_0xe04d('0xf')]&&_0x2aac7b['license']!=_0x37c71b[_0xe04d('0x6')]){logger[_0xe04d('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x2aac7b[_0xe04d('0x6')]&&!_0x2aac7b[_0xe04d('0xf')]&&_0x2aac7b['license']==_0x37c71b[_0xe04d('0x6')]){return _0x49db4e;}return _0x49db4e['update']({'data1':_0x3d0375,'data2':null,'license':_0x37c71b[_0xe04d('0x6')]});}else{if(_0x37c71b[_0xe04d('0x6')]||_0x2aac7b['license']){if(!_0x2aac7b[_0xe04d('0xf')]){if(_0x2aac7b[_0xe04d('0xd')]==_0x3d0375){GRAY_PERIOD_REASON=_0xe04d('0x12');logger['info'](_0xe04d('0x13'));}else{GRAY_PERIOD_REASON=_0xe04d('0x14');logger[_0xe04d('0x10')](_0xe04d('0x15'),_0x2aac7b[_0xe04d('0xd')],_0x3d0375);}logger['info'](_0xe04d('0x16'),GRAY_PERIOD_REASON[_0xe04d('0x17')](),moment()['format'](_0xe04d('0x18')));return _0x49db4e[_0xe04d('0x19')]({'data2':encryptor[_0xe04d('0x1a')](moment()[_0xe04d('0x7')](_0xe04d('0x18')))});}else{if(moment()[_0xe04d('0x1b')](encryptor[_0xe04d('0x1c')](_0x2aac7b[_0xe04d('0xf')]),'days')>DAYS){logger['info'](_0xe04d('0x1d'),moment()[_0xe04d('0x7')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x49db4e[_0xe04d('0x19')]({'data1':_0x3d0375,'data2':null,'license':null});}}}else{if(_0x2aac7b[_0xe04d('0xd')]!=_0x3d0375){logger[_0xe04d('0x10')](_0xe04d('0x15'),_0x2aac7b[_0xe04d('0xd')],_0x3d0375);return _0x49db4e['update']({'data1':_0x3d0375,'data2':null,'license':null});}}}return _0x49db4e;})['then'](function(_0x421f31){_0x49db4e=_0x421f31;})['catch'](function(_0x59e78f){logger[_0xe04d('0x1e')](_0x59e78f[_0xe04d('0x1f')]);})[_0xe04d('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0xe04d('0x21')](),_0x49db4e);},TIME);});}function defaultLicense(){var _0x11a257=hardware[_0xe04d('0x21')]();if(_0x11a257){return db[_0xe04d('0x22')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x11a257}})[_0xe04d('0x23')](function(_0x501588,_0x369589){logger[_0xe04d('0x10')](_0xe04d('0x24'),_0x11a257);manageLicense(_0x11a257,_0x501588);})[_0xe04d('0x25')](function(_0x2b140d){logger[_0xe04d('0x1e')](_0x2b140d['message']);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 588ea6f..a955ef0 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 _0xdda4=['lodash','bluebird','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','defaults','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','machineUuid','deadline','add','days','changed','disabled','message','findAll','role','sequelize','COUNT','count','admin','user','users','telephones','forEach','pick','telephone','License\x20limit\x20reached\x20for\x20users','exports','util'];(function(_0x267e53,_0x5c3e18){var _0x525fcd=function(_0x15dcde){while(--_0x15dcde){_0x267e53['push'](_0x267e53['shift']());}};_0x525fcd(++_0x5c3e18);}(_0xdda4,0x157));var _0x4dda=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0xdda4[_0x295314];return _0x584b0c;};'use strict';var util=require(_0x4dda('0x0'));var _=require(_0x4dda('0x1'));var moment=require('moment');var BPromise=require(_0x4dda('0x2'));var hardware=require('./hardware');var encryptor=require(_0x4dda('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4dda('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4dda('0x5'),'machineUuid':hardware[_0x4dda('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4dda('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x4dda('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x52b3aa){return new BPromise(function(_0x44bf73,_0x5c6b14){return db[_0x4dda('0x8')]['find'](_[_0x4dda('0x9')](_0x52b3aa,{'raw':!![],'where':{'id':0x1}}))[_0x4dda('0xa')](function(_0x3c0261){return checkLicense(_0x3c0261,null);})[_0x4dda('0xa')](function(_0x922375){_0x44bf73(_0x922375);return;})[_0x4dda('0xb')](function(_0x247792){_0x5c6b14(_0x247792);});});}function checkLicense(_0x2fc75c,_0x5715e4){if(!_0x2fc75c){demoLicense[_0x4dda('0xc')]=_0x2fc75c[_0x4dda('0xd')];return demoLicense;}try{var _0x137380=_0x5715e4||_0x2fc75c['license'];if(_[_0x4dda('0xe')](_0x137380)){throw new Error(_0x4dda('0xf'));}var _0x215fcd=_0x2fc75c[_0x4dda('0xd')];var _0x15e4ff=_0x2fc75c[_0x4dda('0x10')];var _0xde2bef=_0x215fcd[_0x4dda('0x11')]('-')[0x4];var _0x21dce6=_0x215fcd[_0x4dda('0x11')]('-')[0x0];var _0x452eb2=encryptor[_0x4dda('0x12')](_0x137380,util[_0x4dda('0x13')]('%s:%s:%s',_0xde2bef,_0x215fcd,_0x21dce6));var _0x4a0d95=JSON[_0x4dda('0x14')](_0x452eb2);_0x4a0d95[_0x4dda('0x15')]=![];_0x4a0d95[_0x4dda('0xc')]=_0x215fcd;_0x4a0d95[_0x4dda('0x16')]=hardware[_0x4dda('0x6')]();if(_0x15e4ff){var _0x421d26=encryptor[_0x4dda('0x12')](_0x15e4ff);_0x4a0d95['gray']=_0x421d26;_0x4a0d95[_0x4dda('0x17')]=moment(_0x421d26)[_0x4dda('0x18')](0x7,_0x4dda('0x19'))['format']();_0x4a0d95['grayReason']=_0x4a0d95[_0x4dda('0xc')]!=_0x4a0d95[_0x4dda('0x16')]?_0x4dda('0x1a'):_0x4dda('0x1b');}return _0x4a0d95;}catch(_0x1942bc){breakingLicense[_0x4dda('0xc')]=_0x2fc75c[_0x4dda('0xd')];breakingLicense[_0x4dda('0x1c')]=_0x1942bc['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x47d5f3,_0x47a50e){getLicense()[_0x4dda('0xa')](function(_0x10a3ae){return db['User'][_0x4dda('0x1d')]({'attributes':[_0x4dda('0x1e'),[db[_0x4dda('0x1f')]['fn'](_0x4dda('0x20'),db[_0x4dda('0x1f')]['col'](_0x4dda('0x1e'))),_0x4dda('0x21')]],'group':_0x4dda('0x1e'),'where':{'role':{'$or':[_0x4dda('0x22'),_0x4dda('0x23'),'telephone']}},'raw':!![]})[_0x4dda('0xa')](function(_0x36c117){var _0x48f77d={'user':_0x10a3ae[_0x4dda('0x24')]||0x0,'telephone':_0x10a3ae[_0x4dda('0x25')]||0x0};_0x36c117[_0x4dda('0x26')](function(_0x75a8b0){var _0x10108d=_0x75a8b0[_0x4dda('0x1e')]===_0x4dda('0x22')?'user':_0x75a8b0['role'];_0x48f77d[_0x10108d]-=_0x75a8b0['count'];if(_0x48f77d[_0x10108d]<0x0)_0x48f77d[_0x10108d]=0x0;});_0x47d5f3(_0x48f77d);return;});})[_0x4dda('0xb')](function(_0x1d5ac5){_0x47a50e(_0x1d5ac5);});});}function checkUserLimits(_0x5921bf){return new BPromise(function(_0x36f8ee,_0x3a5a88){getLimits()[_0x4dda('0xa')](function(_0x33d7ab){var _0x135771=_[_0x4dda('0x27')](_['countBy'](_0x5921bf,_0x4dda('0x1e')),[_0x4dda('0x22'),_0x4dda('0x23'),_0x4dda('0x28')]);var _0x2768d7=(_0x135771[_0x4dda('0x22')]||0x0)+(_0x135771[_0x4dda('0x23')]||0x0);var _0x169004=_0x135771['telephone']||0x0;if(_0x2768d7>_0x33d7ab[_0x4dda('0x23')])return _0x3a5a88(_0x4dda('0x29'));if(_0x169004>_0x33d7ab['telephone'])return _0x3a5a88('License\x20limit\x20reached\x20for\x20telephones');return _0x36f8ee();})[_0x4dda('0xb')](function(_0x41ff78){_0x3a5a88(_0x41ff78);});});}module[_0x4dda('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x19db=['add','days','format','uuid','changed','disabled','User','role','sequelize','col','count','user','telephone','users','telephones','forEach','admin','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','demo','machineUuid','deadline'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0x19db,0x132));var _0xb19d=function(_0x59987a,_0x399e11){_0x59987a=_0x59987a-0x0;var _0x460646=_0x19db[_0x59987a];return _0x460646;};'use strict';var util=require(_0xb19d('0x0'));var _=require(_0xb19d('0x1'));var moment=require(_0xb19d('0x2'));var BPromise=require(_0xb19d('0x3'));var hardware=require(_0xb19d('0x4'));var encryptor=require('../../components/encryptor');var db=require(_0xb19d('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xb19d('0x6'),'machineUuid':hardware[_0xb19d('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb19d('0x8'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xb19d('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x8d9746){return new BPromise(function(_0x2ef1ae,_0x22241e){return db[_0xb19d('0xa')]['find'](_['defaults'](_0x8d9746,{'raw':!![],'where':{'id':0x1}}))[_0xb19d('0xb')](function(_0xb82c30){return checkLicense(_0xb82c30,null);})[_0xb19d('0xb')](function(_0x1b6858){_0x2ef1ae(_0x1b6858);return;})[_0xb19d('0xc')](function(_0x2b151a){_0x22241e(_0x2b151a);});});}function checkLicense(_0x74251a,_0x5ebd45){if(!_0x74251a){demoLicense['uuid']=_0x74251a[_0xb19d('0xd')];return demoLicense;}try{var _0x7ca8b1=_0x5ebd45||_0x74251a[_0xb19d('0xe')];if(_[_0xb19d('0xf')](_0x7ca8b1)){throw new Error(_0xb19d('0x10'));}var _0x2cd7d5=_0x74251a[_0xb19d('0xd')];var _0x25d63f=_0x74251a['data2'];var _0x26c2bb=_0x2cd7d5[_0xb19d('0x11')]('-')[0x4];var _0x131486=_0x2cd7d5[_0xb19d('0x11')]('-')[0x0];var _0x3454d0=encryptor[_0xb19d('0x12')](_0x7ca8b1,util['format']('%s:%s:%s',_0x26c2bb,_0x2cd7d5,_0x131486));var _0x1f221b=JSON['parse'](_0x3454d0);_0x1f221b[_0xb19d('0x13')]=![];_0x1f221b['uuid']=_0x2cd7d5;_0x1f221b[_0xb19d('0x14')]=hardware[_0xb19d('0x7')]();if(_0x25d63f){var _0x59b83a=encryptor['decryptString'](_0x25d63f);_0x1f221b['gray']=_0x59b83a;_0x1f221b[_0xb19d('0x15')]=moment(_0x59b83a)[_0xb19d('0x16')](0x7,_0xb19d('0x17'))[_0xb19d('0x18')]();_0x1f221b['grayReason']=_0x1f221b[_0xb19d('0x19')]!=_0x1f221b[_0xb19d('0x14')]?_0xb19d('0x1a'):_0xb19d('0x1b');}return _0x1f221b;}catch(_0x5524e3){breakingLicense[_0xb19d('0x19')]=_0x74251a[_0xb19d('0xd')];breakingLicense['message']=_0x5524e3['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1b53eb,_0x4c7995){getLicense()[_0xb19d('0xb')](function(_0x116377){return db[_0xb19d('0x1c')]['findAll']({'attributes':[_0xb19d('0x1d'),[db[_0xb19d('0x1e')]['fn']('COUNT',db[_0xb19d('0x1e')][_0xb19d('0x1f')]('role')),_0xb19d('0x20')]],'group':'role','where':{'role':{'$or':['admin',_0xb19d('0x21'),_0xb19d('0x22')]}},'raw':!![]})[_0xb19d('0xb')](function(_0x565bd4){var _0x3a67c4={'user':_0x116377[_0xb19d('0x23')]||0x0,'telephone':_0x116377[_0xb19d('0x24')]||0x0};_0x565bd4[_0xb19d('0x25')](function(_0x1669ab){var _0x41870d=_0x1669ab[_0xb19d('0x1d')]===_0xb19d('0x26')?_0xb19d('0x21'):_0x1669ab[_0xb19d('0x1d')];_0x3a67c4[_0x41870d]-=_0x1669ab['count'];if(_0x3a67c4[_0x41870d]<0x0)_0x3a67c4[_0x41870d]=0x0;});_0x1b53eb(_0x3a67c4);return;});})['catch'](function(_0x25f27c){_0x4c7995(_0x25f27c);});});}function checkUserLimits(_0x1d392e){return new BPromise(function(_0x2dc2d4,_0x2e0d3f){getLimits()['then'](function(_0xbf0bc3){var _0x4e36b1=_['pick'](_['countBy'](_0x1d392e,_0xb19d('0x1d')),[_0xb19d('0x26'),_0xb19d('0x21'),_0xb19d('0x22')]);var _0x3b386a=(_0x4e36b1[_0xb19d('0x26')]||0x0)+(_0x4e36b1[_0xb19d('0x21')]||0x0);var _0x128316=_0x4e36b1[_0xb19d('0x22')]||0x0;if(_0x3b386a>_0xbf0bc3['user'])return _0x2e0d3f('License\x20limit\x20reached\x20for\x20users');if(_0x128316>_0xbf0bc3['telephone'])return _0x2e0d3f(_0xb19d('0x27'));return _0x2dc2d4();})['catch'](function(_0x42bd1a){_0x2e0d3f(_0x42bd1a);});});}module[_0xb19d('0x28')]={'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 f21d7f3..4fa2b7c 100644 --- a/server/config/local.env.js +++ b/server/config/local.env.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7880=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x581d09,_0x2f7c54){var _0x8c67d0=function(_0x5ce642){while(--_0x5ce642){_0x581d09['push'](_0x581d09['shift']());}};_0x8c67d0(++_0x2f7c54);}(_0x7880,0x1f4));var _0x0788=function(_0x3cb9eb,_0x3fd4b9){_0x3cb9eb=_0x3cb9eb-0x0;var _0x4d5970=_0x7880[_0x3cb9eb];return _0x4d5970;};'use strict';module['exports']={'DOMAIN':_0x0788('0x0'),'SESSION_SECRET':_0x0788('0x1'),'GOOGLE_ID':_0x0788('0x2'),'GOOGLE_SECRET':_0x0788('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x5204=['http://localhost:9000','app-id','secret','exports'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0x5204,0xdf));var _0x4520=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x5204[_0x9d14e3];return _0x19bf32;};'use strict';module[_0x4520('0x0')]={'DOMAIN':_0x4520('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4520('0x2'),'GOOGLE_SECRET':_0x4520('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index d2c9df5..292ce9a 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a7e=['exports','../utils/loggers','fileLogger'];(function(_0x35e9a4,_0x40b178){var _0x575b90=function(_0x18e931){while(--_0x18e931){_0x35e9a4['push'](_0x35e9a4['shift']());}};_0x575b90(++_0x40b178);}(_0x1a7e,0x190));var _0xe1a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a7e[_0x3dd15e];return _0x231fd0;};'use strict';var fileLogger=require(_0xe1a7('0x0'))[_0xe1a7('0x1')];module[_0xe1a7('0x2')]=fileLogger; \ No newline at end of file +var _0x4f53=['fileLogger','exports','../utils/loggers'];(function(_0x565a70,_0x2c4aec){var _0x4fe73a=function(_0x262138){while(--_0x262138){_0x565a70['push'](_0x565a70['shift']());}};_0x4fe73a(++_0x2c4aec);}(_0x4f53,0x1df));var _0x34f5=function(_0xe1f088,_0x40713e){_0xe1f088=_0xe1f088-0x0;var _0x56328d=_0x4f53[_0xe1f088];return _0x56328d;};'use strict';var fileLogger=require(_0x34f5('0x0'))[_0x34f5('0x1')];module[_0x34f5('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index e929e4f..a58fdc7 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 _0xfc94=['resolve','join','root','express','../../services/express/index.js','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x5a5aa2,_0x1cdd47){var _0x5906b1=function(_0x4777b7){while(--_0x4777b7){_0x5a5aa2['push'](_0x5a5aa2['shift']());}};_0x5906b1(++_0x1cdd47);}(_0xfc94,0x70));var _0x4fc9=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xfc94[_0x1deb03];return _0x189fe7;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0x4fc9('0x0')](path[_0x4fc9('0x1')](cfg[_0x4fc9('0x2')],'legacy-libs'))};var pm2config={'apps':[{'name':_0x4fc9('0x3'),'script':path[_0x4fc9('0x1')](__dirname,_0x4fc9('0x4')),'env':env},{'name':'ami','script':path['join'](__dirname,_0x4fc9('0x5')),'env':env},{'name':_0x4fc9('0x6'),'script':path[_0x4fc9('0x1')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x4fc9('0x7'),'script':path['join'](__dirname,_0x4fc9('0x8')),'env':env},{'name':_0x4fc9('0x9'),'script':path[_0x4fc9('0x1')](__dirname,_0x4fc9('0xa')),'env':env},{'name':_0x4fc9('0xb'),'script':path['join'](__dirname,_0x4fc9('0xc')),'env':env}]};module[_0x4fc9('0xd')]=pm2config; \ No newline at end of file +var _0x7f2a=['email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path','../../config/environment','root','legacy-libs','express','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js'];(function(_0x472a4d,_0x3c3c00){var _0x2b75bf=function(_0x3b6680){while(--_0x3b6680){_0x472a4d['push'](_0x472a4d['shift']());}};_0x2b75bf(++_0x3c3c00);}(_0x7f2a,0x86));var _0xa7f2=function(_0x5be652,_0x85d008){_0x5be652=_0x5be652-0x0;var _0x50775a=_0x7f2a[_0x5be652];return _0x50775a;};'use strict';var path=require(_0xa7f2('0x0'));var cfg=require(_0xa7f2('0x1'));var env={'NODE_PATH':path['resolve'](path['join'](cfg[_0xa7f2('0x2')],_0xa7f2('0x3')))};var pm2config={'apps':[{'name':_0xa7f2('0x4'),'script':path[_0xa7f2('0x5')](__dirname,_0xa7f2('0x6')),'env':env},{'name':_0xa7f2('0x7'),'script':path[_0xa7f2('0x5')](__dirname,_0xa7f2('0x8')),'env':env},{'name':'agi','script':path[_0xa7f2('0x5')](__dirname,_0xa7f2('0x9')),'env':env},{'name':_0xa7f2('0xa'),'script':path[_0xa7f2('0x5')](__dirname,_0xa7f2('0xb')),'env':env},{'name':_0xa7f2('0xc'),'script':path[_0xa7f2('0x5')](__dirname,_0xa7f2('0xd')),'env':env},{'name':'xdr','script':path['join'](__dirname,_0xa7f2('0xe')),'env':env}]};module[_0xa7f2('0xf')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 712dc29..24f88c5 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 _0x9286=['describe','delete','dump','saved','bluebird','connect','start','then','disconnect','stop','restart','list'];(function(_0x3fd440,_0x588f38){var _0x48d1b5=function(_0x1b8dd2){while(--_0x1b8dd2){_0x3fd440['push'](_0x3fd440['shift']());}};_0x48d1b5(++_0x588f38);}(_0x9286,0x178));var _0x6928=function(_0x2726ad,_0x5073b1){_0x2726ad=_0x2726ad-0x0;var _0xd87993=_0x9286[_0x2726ad];return _0xd87993;};'use strict';var pm2=require('pm2');var BPromise=require(_0x6928('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x1d0127,_0x2fc491){return pm2[_0x6928('0x1')](function(_0x5acb73){if(_0x5acb73){return _0x2fc491(_0x5acb73);}return _0x1d0127('connected');});});};exports[_0x6928('0x2')]=function(_0x4141f9){return connect()[_0x6928('0x3')](function(){return new BPromise(function(_0x1be803,_0x5b98ce){return pm2[_0x6928('0x2')](_0x4141f9,function(_0x98e6c,_0x33a137){if(_0x98e6c){return _0x5b98ce(_0x98e6c);}pm2[_0x6928('0x4')]();return _0x1be803(_0x33a137);});});});};exports[_0x6928('0x5')]=function(_0x1f24ef){return connect()['then'](function(){return new BPromise(function(_0x1fe802,_0x474256){return pm2['stop'](_0x1f24ef,function(_0x4dfbb6,_0x580458){if(_0x4dfbb6){return _0x474256(_0x4dfbb6);}pm2[_0x6928('0x4')]();return _0x1fe802(_0x580458);});});});};exports['restart']=function(_0x1d7a5d){return connect()[_0x6928('0x3')](function(){return new BPromise(function(_0x324c01,_0x4a0b27){return pm2[_0x6928('0x6')](_0x1d7a5d,function(_0x5c74f0,_0xc60baf){if(_0x5c74f0){return _0x4a0b27(_0x5c74f0);}pm2[_0x6928('0x4')]();return _0x324c01(_0xc60baf);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x5857ef,_0x891fc){return pm2[_0x6928('0x7')](function(_0x18ccd1,_0x499c74){if(_0x18ccd1){return _0x891fc(_0x18ccd1);}pm2[_0x6928('0x4')]();return _0x5857ef(_0x499c74);});});});};exports[_0x6928('0x8')]=function(_0x25c7e7){return connect()['then'](function(){return new BPromise(function(_0x267bdb,_0x17dfe1){return pm2[_0x6928('0x8')](_0x25c7e7,function(_0xabb2ac,_0x62eb7f){if(_0xabb2ac){return _0x17dfe1(_0xabb2ac);}pm2['disconnect']();return _0x267bdb(_0x62eb7f);});});});};exports[_0x6928('0x9')]=function(_0x47996a){return connect()['then'](function(){return new BPromise(function(_0x3e5c99,_0xc040c6){return pm2[_0x6928('0x9')](_0x47996a,function(_0x25d131,_0x11c130){if(_0x25d131){return _0xc040c6(_0x25d131);}pm2[_0x6928('0x4')]();return _0x3e5c99(_0x11c130);});});});};exports[_0x6928('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x245a8f,_0x1b89f5){return pm2[_0x6928('0xa')](function(_0x8e13b1){if(_0x8e13b1){return _0x1b89f5(_0x8e13b1);}return _0x245a8f(_0x6928('0xb'));});});});}; \ No newline at end of file +var _0xb6c9=['delete','dump','saved','pm2','bluebird','./config','connect','start','then','stop','disconnect','restart','describe'];(function(_0x335b32,_0xa4a93e){var _0xeb4a45=function(_0xcccd75){while(--_0xcccd75){_0x335b32['push'](_0x335b32['shift']());}};_0xeb4a45(++_0xa4a93e);}(_0xb6c9,0x114));var _0x9b6c=function(_0x15fa77,_0x93eaff){_0x15fa77=_0x15fa77-0x0;var _0x1385ff=_0xb6c9[_0x15fa77];return _0x1385ff;};'use strict';var pm2=require(_0x9b6c('0x0'));var BPromise=require(_0x9b6c('0x1'));var config=require(_0x9b6c('0x2'));function connect(){return new BPromise(function(_0x5fb9ee,_0x30f7c9){return pm2[_0x9b6c('0x3')](function(_0x503813){if(_0x503813){return _0x30f7c9(_0x503813);}return _0x5fb9ee('connected');});});};exports[_0x9b6c('0x4')]=function(_0x169205){return connect()[_0x9b6c('0x5')](function(){return new BPromise(function(_0x49cb2f,_0xa7f049){return pm2[_0x9b6c('0x4')](_0x169205,function(_0x1e946e,_0x199974){if(_0x1e946e){return _0xa7f049(_0x1e946e);}pm2['disconnect']();return _0x49cb2f(_0x199974);});});});};exports[_0x9b6c('0x6')]=function(_0x68ddea){return connect()[_0x9b6c('0x5')](function(){return new BPromise(function(_0x324712,_0xfd5541){return pm2[_0x9b6c('0x6')](_0x68ddea,function(_0x239006,_0x568115){if(_0x239006){return _0xfd5541(_0x239006);}pm2[_0x9b6c('0x7')]();return _0x324712(_0x568115);});});});};exports['restart']=function(_0x42372e){return connect()[_0x9b6c('0x5')](function(){return new BPromise(function(_0x391ed4,_0x2b42f1){return pm2[_0x9b6c('0x8')](_0x42372e,function(_0x334780,_0x37ff36){if(_0x334780){return _0x2b42f1(_0x334780);}pm2[_0x9b6c('0x7')]();return _0x391ed4(_0x37ff36);});});});};exports['list']=function(){return connect()[_0x9b6c('0x5')](function(){return new BPromise(function(_0x3ce319,_0x31b93f){return pm2['list'](function(_0x3e38b7,_0x1e1489){if(_0x3e38b7){return _0x31b93f(_0x3e38b7);}pm2[_0x9b6c('0x7')]();return _0x3ce319(_0x1e1489);});});});};exports[_0x9b6c('0x9')]=function(_0x2ca135){return connect()[_0x9b6c('0x5')](function(){return new BPromise(function(_0x1485c3,_0x2df5c4){return pm2[_0x9b6c('0x9')](_0x2ca135,function(_0x546ab0,_0x8335b2){if(_0x546ab0){return _0x2df5c4(_0x546ab0);}pm2['disconnect']();return _0x1485c3(_0x8335b2);});});});};exports[_0x9b6c('0xa')]=function(_0x37413e){return connect()[_0x9b6c('0x5')](function(){return new BPromise(function(_0x45ff75,_0x3729b9){return pm2[_0x9b6c('0xa')](_0x37413e,function(_0x4114f9,_0x475b36){if(_0x4114f9){return _0x3729b9(_0x4114f9);}pm2[_0x9b6c('0x7')]();return _0x45ff75(_0x475b36);});});});};exports['dump']=function(){return connect()[_0x9b6c('0x5')](function(){return new BPromise(function(_0xdefd3e,_0x5fc183){return pm2[_0x9b6c('0xb')](function(_0x188481){if(_0x188481){return _0x5fc183(_0x188481);}return _0xdefd3e(_0x9b6c('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index e8b9590..2d92bd4 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 _0x5c39=['schedule','redis','defaults','localhost','Setting','find','then','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','chatInteraction:update','catch','error','inspect','start','moment','util','../../config/environment','../../mysqldb','../logger'];(function(_0x483102,_0x54e93d){var _0x5cc885=function(_0x54931c){while(--_0x54931c){_0x483102['push'](_0x483102['shift']());}};_0x5cc885(++_0x54e93d);}(_0x5c39,0xd4));var _0x95c3=function(_0x1bfc25,_0x49cde8){_0x1bfc25=_0x1bfc25-0x0;var _0x3efea6=_0x5c39[_0x1bfc25];return _0x3efea6;};'use strict';var _=require('lodash');var moment=require(_0x95c3('0x0'));var Redis=require('ioredis');var util=require(_0x95c3('0x1'));var config=require(_0x95c3('0x2'));var db=require(_0x95c3('0x3'))['db'];var logger=require(_0x95c3('0x4'))(_0x95c3('0x5'));config[_0x95c3('0x6')]=_[_0x95c3('0x7')](config[_0x95c3('0x6')],{'host':_0x95c3('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x95c3('0x6')]));function closeInteractions(){var _0x5c0a63=0x0;var _0x74de65=[];return db[_0x95c3('0x9')][_0x95c3('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x95c3('0xb')](function(_0x1fda08){_0x5c0a63=_0x1fda08['chatTimeout'];if(_0x5c0a63){return db[_0x95c3('0xc')][_0x95c3('0xd')]({'raw':!![],'attributes':['id',_0x95c3('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x95c3('0xf')](_0x1fda08['chatTimeout'],'minutes')}}});}else{return[];}})[_0x95c3('0xb')](function(_0x308005){if(_0x308005&&_0x308005[_0x95c3('0x10')]){_0x74de65=_[_0x95c3('0x11')](_0x308005||[],'id');logger[_0x95c3('0x12')](_0x95c3('0x13'),_0x74de65[_0x95c3('0x14')]());return db[_0x95c3('0xc')][_0x95c3('0x15')]({'closeReason':_0x95c3('0x16'),'disposition':_0x95c3('0x17'),'closed':!![],'closedAt':moment()[_0x95c3('0x18')](_0x95c3('0x19'))},{'where':{'id':_0x74de65}});}})[_0x95c3('0xb')](function(){if(_0x74de65&&_0x74de65['length']){logger[_0x95c3('0x12')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x74de65[_0x95c3('0x14')]());for(var _0x3c3cca=0x0;_0x3c3cca<_0x74de65['length'];_0x3c3cca++){io['emit'](_0x95c3('0x1a'),{'id':_0x74de65[_0x3c3cca],'closed':!![]});}}})[_0x95c3('0x1b')](function(_0x3ce2ac){logger[_0x95c3('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x3ce2ac?util[_0x95c3('0x1d')](_0x3ce2ac,{'showHidden':![],'depth':null}):'');});}exports[_0x95c3('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd71c=['defaults','localhost','socket.io-emitter','then','chatTimeout','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','../../config/environment','schedule','redis'];(function(_0x10348b,_0x48d5c2){var _0x5c74f9=function(_0x30fb05){while(--_0x30fb05){_0x10348b['push'](_0x10348b['shift']());}};_0x5c74f9(++_0x48d5c2);}(_0xd71c,0x145));var _0xcd71=function(_0x13e9cf,_0x32a3dc){_0x13e9cf=_0x13e9cf-0x0;var _0x521a43=_0xd71c[_0x13e9cf];return _0x521a43;};'use strict';var _=require(_0xcd71('0x0'));var moment=require(_0xcd71('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0xcd71('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0xcd71('0x3'));config[_0xcd71('0x4')]=_[_0xcd71('0x5')](config['redis'],{'host':_0xcd71('0x6'),'port':0x18eb});var io=require(_0xcd71('0x7'))(new Redis(config[_0xcd71('0x4')]));function closeInteractions(){var _0x50ff13=0x0;var _0x260037=[];return db['Setting']['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xcd71('0x8')](function(_0x2247a4){_0x50ff13=_0x2247a4[_0xcd71('0x9')];if(_0x50ff13){return db['ChatInteraction'][_0xcd71('0xa')]({'raw':!![],'attributes':['id',_0xcd71('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xcd71('0xc')](_0x2247a4[_0xcd71('0x9')],_0xcd71('0xd'))}}});}else{return[];}})[_0xcd71('0x8')](function(_0x1e4748){if(_0x1e4748&&_0x1e4748[_0xcd71('0xe')]){_0x260037=_[_0xcd71('0xf')](_0x1e4748||[],'id');logger[_0xcd71('0x10')](_0xcd71('0x11'),_0x260037[_0xcd71('0x12')]());return db[_0xcd71('0x13')]['update']({'closeReason':_0xcd71('0x14'),'disposition':_0xcd71('0x15'),'closed':!![],'closedAt':moment()[_0xcd71('0x16')](_0xcd71('0x17'))},{'where':{'id':_0x260037}});}})[_0xcd71('0x8')](function(){if(_0x260037&&_0x260037['length']){logger[_0xcd71('0x10')](_0xcd71('0x18'),_0x260037[_0xcd71('0x12')]());for(var _0x14a9f4=0x0;_0x14a9f4<_0x260037['length'];_0x14a9f4++){io['emit'](_0xcd71('0x19'),{'id':_0x260037[_0x14a9f4],'closed':!![]});}}})['catch'](function(_0x17a26d){logger[_0xcd71('0x1a')](_0xcd71('0x1b'),_0x17a26d?util[_0xcd71('0x1c')](_0x17a26d,{'showHidden':![],'depth':null}):'');});}exports[_0xcd71('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index a6d4aa1..d8e4b7d 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b72=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b72,0x1ef));var _0x22b7=function(_0x334c50,_0x1f11d0){_0x334c50=_0x334c50-0x0;var _0x524766=_0x2b72[_0x334c50];return _0x524766;};'use strict';function start(){var _0x2bf9f0=require(_0x22b7('0x0'));return _0x2bf9f0[_0x22b7('0x1')]();}module[_0x22b7('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x8703=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8703,0xab));var _0x3870=function(_0x499196,_0x8f554e){_0x499196=_0x499196-0x0;var _0x4c8b13=_0x8703[_0x499196];return _0x4c8b13;};'use strict';function start(){var _0x4394cc=require(_0x3870('0x0'));return _0x4394cc['startAllRefreshIntervals']();}module[_0x3870('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 88b5379..9f260f7 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 _0x3fba=['lodash','moment','cron-job-manager','jayson/promise','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','format','\x22%s\x22\x20<%s>','MailAccount','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','existsSync','status','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','message','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','error','catch','error\x20mail','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','Smtp','CloudProvider','keys','jobs','map','keyBy','toString','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','isBetween','startAt','endAt','add\x20cron','stop\x20cron','active','update','update\x20cron','start','util','path'];(function(_0x5b8e88,_0x588c4b){var _0x4141f4=function(_0x5c3c9b){while(--_0x5c3c9b){_0x5b8e88['push'](_0x5b8e88['shift']());}};_0x4141f4(++_0x588c4b);}(_0x3fba,0x15a));var _0xa3fb=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x3fba[_0x5756c6];return _0x4b5806;};'use strict';var fs=require('fs');var util=require(_0xa3fb('0x0'));var path=require(_0xa3fb('0x1'));var _=require(_0xa3fb('0x2'));var moment=require(_0xa3fb('0x3'));var CronJobManager=require(_0xa3fb('0x4'));var jayson=require(_0xa3fb('0x5'));var BPromise=require(_0xa3fb('0x6'));var logger=require('../logger')('schedule');var db=require(_0xa3fb('0x7'))['db'];var analyticCustomReportController=require(_0xa3fb('0x8'));var analyticDefaultReportController=require(_0xa3fb('0x9'));var client=jayson[_0xa3fb('0xa')][_0xa3fb('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4c1a6a,_0x55c473){return function(){logger[_0xa3fb('0xc')](_0xa3fb('0xd'),_0x4c1a6a[_0xa3fb('0xe')]);var _0x444224=!![];var _0x98f40d=_0x4c1a6a['MailAccount']['getSmtpOptions']();var _0x59d321={'account':_0x98f40d,'message':{'from':util[_0xa3fb('0xf')](_0xa3fb('0x10'),_0x4c1a6a[_0xa3fb('0x11')]['name'],_0x4c1a6a['MailAccount'][_0xa3fb('0xe')]||_0x4c1a6a[_0xa3fb('0x11')]['Smtp'][_0xa3fb('0x12')]),'to':_0x4c1a6a[_0xa3fb('0xe')],'cc':_0x4c1a6a['cc'],'bcc':_0x4c1a6a[_0xa3fb('0x13')],'subject':util['format'](_0xa3fb('0x14'),_0x55c473[_0xa3fb('0x15')],_0x4c1a6a[_0xa3fb('0x16')],_0x4c1a6a[_0xa3fb('0x17')])}};var _0x11c22b=path[_0xa3fb('0x18')](__dirname,_0xa3fb('0x19'));var _0x432703=_0x55c473[_0xa3fb('0x1a')];var _0x205464=util[_0xa3fb('0xf')]('%s.%s',path[_0xa3fb('0x1b')](_0x55c473[_0xa3fb('0x1a')],path[_0xa3fb('0x1c')](_0x55c473[_0xa3fb('0x1a')])),_0xa3fb('0x1d'));var _0x3a2a77=path[_0xa3fb('0x18')](_0x11c22b,_0x432703);var _0x4ed006=path[_0xa3fb('0x18')](_0x11c22b,_0x205464);if(fs[_0xa3fb('0x1e')](_0x3a2a77)){_0x55c473[_0xa3fb('0x1f')]='Sent';_0x59d321['message'][_0xa3fb('0x20')]=[{'filename':_0x432703,'path':_0x3a2a77}];_0x59d321['message'][_0xa3fb('0x21')]=util['format'](_0xa3fb('0x22'),JSON[_0xa3fb('0x23')](_0x55c473,null,0x2));}else if(fs['existsSync'](_0x4ed006)){_0x55c473[_0xa3fb('0x1f')]=_0xa3fb('0x24');_0x59d321[_0xa3fb('0x25')][_0xa3fb('0x20')]=[{'filename':_0x205464,'path':_0x4ed006}];}else{_0x59d321[_0xa3fb('0x25')]['text']=_0xa3fb('0x26');if(!_0x4c1a6a[_0xa3fb('0x27')]){_0x444224=![];logger[_0xa3fb('0xc')](_0xa3fb('0x28'));}}if(_0x444224){return client['request'](_0xa3fb('0x29'),_0x59d321)['then'](function(_0x1f4dce){if(_0x1f4dce['error']){return logger[_0xa3fb('0x2a')]('error\x20mail',JSON[_0xa3fb('0x23')](_0x1f4dce));}return logger[_0xa3fb('0xc')]('email\x20sent');})[_0xa3fb('0x2b')](function(_0x2cbb36){return logger['error'](_0xa3fb('0x2c'),JSON['stringify'](_0x2cbb36));});}};}function handleError(){return function(_0x4890b5){return logger['error'](JSON['stringify'](_0x4890b5));};}function handleResult(_0x9593a6){return function(_0x55e201){logger['info'](_0xa3fb('0x2d'),JSON[_0xa3fb('0x23')](_0x55e201));if(_0x9593a6[_0xa3fb('0x11')]&&_0x9593a6[_0xa3fb('0x11')]['Smtp']&&!_['isNil'](_0x9593a6[_0xa3fb('0xe')])){setTimeout(handleSendEmail(_0x9593a6,_0x55e201),0x3c*0x3e8);}};}function handleJob(_0x369fbf){return function(){try{if(_[_0xa3fb('0x2e')](_0x369fbf[_0xa3fb('0x16')])){return logger[_0xa3fb('0xc')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xa3fb('0x2e')](_0x369fbf['subtractUnit'])){return logger[_0xa3fb('0xc')](_0xa3fb('0x2f'));}var _0x1273d7={'startDate':moment()[_0xa3fb('0x30')](_0x369fbf[_0xa3fb('0x16')],_0x369fbf[_0xa3fb('0x17')])['format'](_0xa3fb('0x31')),'endDate':moment()[_0xa3fb('0xf')](_0xa3fb('0x31')),'type':_0xa3fb('0x32'),'output':_0x369fbf['output'],'name':_0x369fbf[_0xa3fb('0x15')]};if(!_['isNil'](_0x369fbf[_0xa3fb('0x33')])){logger[_0xa3fb('0xc')](_0xa3fb('0x34'),_0x369fbf['DefaultReportId']);return analyticDefaultReportController[_0xa3fb('0x35')]({'id':_0x369fbf[_0xa3fb('0x33')]},_0x1273d7)[_0xa3fb('0x36')](handleResult(_0x369fbf))[_0xa3fb('0x2b')](handleError());}if(!_[_0xa3fb('0x2e')](_0x369fbf[_0xa3fb('0x37')])){logger[_0xa3fb('0xc')]('exec\x20custom\x20report\x20id:%s',_0x369fbf['CustomReportId']);return analyticCustomReportController[_0xa3fb('0x35')]({'id':_0x369fbf['CustomReportId']},_0x1273d7)[_0xa3fb('0x36')](handleResult(_0x369fbf))[_0xa3fb('0x2b')](handleError());}}catch(_0x327a32){logger[_0xa3fb('0x2a')](JSON[_0xa3fb('0x23')](_0x327a32));}return logger[_0xa3fb('0xc')](_0xa3fb('0x38'));};}function getJobs(_0x336460){var _0x143a08={};if(_0x336460){_0x143a08['id']=_0x336460;}return db[_0xa3fb('0x39')][_0xa3fb('0x3a')]({'where':_0x143a08,'include':[{'model':db[_0xa3fb('0x11')],'attributes':['id',_0xa3fb('0x15'),_0xa3fb('0xe')],'include':[{'model':db[_0xa3fb('0x3b')],'as':_0xa3fb('0x3c'),'include':[{'model':db[_0xa3fb('0x3d')],'as':'CloudProvider'}]}]}]})[_0xa3fb('0x36')](function(_0x3fc65b){var _0x241f4d=_[_0xa3fb('0x3e')](manager[_0xa3fb('0x3f')]);var _0x4b233e=_[_0xa3fb('0x40')](_0x3fc65b,function(_0x3ed7cb){return _0x3ed7cb['id']['toString']();});var _0xfe96fa=_[_0xa3fb('0x41')](_0x3fc65b,function(_0x5a0fdb){return _0x5a0fdb['id'][_0xa3fb('0x42')]();});var _0x12bacf=_0x336460?_0x4b233e:_[_0xa3fb('0x43')](_0x4b233e,_0x241f4d);var _0x1c0d36=_['intersection'](_0x4b233e,_0x241f4d);var _0x6d2afb=_[_0xa3fb('0x43')](_0x241f4d,_0x4b233e);var _0x1068cf;var _0xe2192e;for(_0x1068cf=0x0;_0x1068cf<_0x6d2afb[_0xa3fb('0x44')]&&!_0x336460;_0x1068cf+=0x1){_0xe2192e=_0x6d2afb[_0x1068cf][_0xa3fb('0x42')]();if(manager[_0xa3fb('0x45')](_0xe2192e)){manager[_0xa3fb('0x46')](_0xe2192e);manager[_0xa3fb('0x47')](_0xe2192e);logger[_0xa3fb('0xc')](_0xa3fb('0x48'),_0xe2192e);}}logger[_0xa3fb('0xc')](_0xa3fb('0x49'),JSON[_0xa3fb('0x23')](_0x12bacf));for(_0x1068cf=0x0;_0x1068cf<_0x12bacf[_0xa3fb('0x44')];_0x1068cf+=0x1){_0xe2192e=_0x12bacf[_0x1068cf]['toString']();logger[_0xa3fb('0xc')](_0xa3fb('0x4a'),_0xe2192e);if(_0x336460){logger[_0xa3fb('0xc')](_0xa3fb('0x4b'),_0x336460);logger[_0xa3fb('0xc')](JSON[_0xa3fb('0x23')](_0xfe96fa[_0xe2192e]));BPromise[_0xa3fb('0x4c')]()['then'](handleJob(_0xfe96fa[_0xe2192e]));logger[_0xa3fb('0xc')]('run\x20job',_0xfe96fa[_0xe2192e][_0xa3fb('0x15')],_0xfe96fa[_0xe2192e]['cron']);}else if(_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')]&&_0xfe96fa[_0xe2192e]['active']&&moment()[_0xa3fb('0x4e')](_0xfe96fa[_0xe2192e][_0xa3fb('0x4f')],_0xfe96fa[_0xe2192e][_0xa3fb('0x50')])){manager['add'](_0xe2192e,_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')],handleJob(_0xfe96fa[_0xe2192e]));manager['start'](_0xe2192e);logger[_0xa3fb('0xc')](_0xa3fb('0x51'),_0xfe96fa[_0xe2192e][_0xa3fb('0x15')],_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')]);}else if(manager['exists'](_0xe2192e)){manager[_0xa3fb('0x46')](_0xe2192e);manager[_0xa3fb('0x47')](_0xe2192e);logger[_0xa3fb('0xc')](_0xa3fb('0x52'),_0xfe96fa[_0xe2192e][_0xa3fb('0x15')],_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')]);}}for(_0x1068cf=0x0,_0xe2192e;_0x1068cf<_0x1c0d36[_0xa3fb('0x44')]&&!_0x336460;_0x1068cf+=0x1){_0xe2192e=_0x1c0d36[_0x1068cf][_0xa3fb('0x42')]();if(manager[_0xa3fb('0x45')](_0xe2192e)){if(_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')]&&_0xfe96fa[_0xe2192e][_0xa3fb('0x53')]&&moment()[_0xa3fb('0x4e')](_0xfe96fa[_0xe2192e][_0xa3fb('0x4f')],_0xfe96fa[_0xe2192e][_0xa3fb('0x50')])){manager[_0xa3fb('0x54')](_0xe2192e,_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')],handleJob(_0xfe96fa[_0xe2192e]));logger[_0xa3fb('0xc')](_0xa3fb('0x55'),_0xfe96fa[_0xe2192e][_0xa3fb('0x15')],_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')]);}else{manager[_0xa3fb('0x46')](_0xe2192e);manager[_0xa3fb('0x47')](_0xe2192e);logger[_0xa3fb('0xc')](_0xa3fb('0x52'),_0xfe96fa[_0xe2192e]['name'],_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')]);}}}})[_0xa3fb('0x2b')](function(_0x3e0474){logger[_0xa3fb('0x2a')](JSON['stringify'](_0x3e0474));});}exports['run']=function(_0x198d33){return getJobs(_0x198d33);};exports[_0xa3fb('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x23bd=['email','format','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','extname','zip','join','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','status','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','email\x20sent','data','MailAccount','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','catch','Schedule','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','stop','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','endAt','start','add\x20cron','exists','deleteJob','stop\x20cron','startAt','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to'];(function(_0x421725,_0x318a04){var _0x51b322=function(_0xe58018){while(--_0xe58018){_0x421725['push'](_0x421725['shift']());}};_0x51b322(++_0x318a04);}(_0x23bd,0x1a0));var _0xd23b=function(_0x457488,_0x142c1b){_0x457488=_0x457488-0x0;var _0x566ec7=_0x23bd[_0x457488];return _0x566ec7;};'use strict';var fs=require('fs');var util=require(_0xd23b('0x0'));var path=require(_0xd23b('0x1'));var _=require(_0xd23b('0x2'));var moment=require(_0xd23b('0x3'));var CronJobManager=require(_0xd23b('0x4'));var jayson=require(_0xd23b('0x5'));var BPromise=require(_0xd23b('0x6'));var logger=require(_0xd23b('0x7'))(_0xd23b('0x8'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xd23b('0x9'));var analyticDefaultReportController=require(_0xd23b('0xa'));var client=jayson[_0xd23b('0xb')][_0xd23b('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4106ef,_0x2a06de){return function(){logger['info'](_0xd23b('0xd'),_0x4106ef[_0xd23b('0xe')]);var _0x275266=!![];var _0x33fc36=_0x4106ef['MailAccount']['getSmtpOptions']();var _0x58d0f8={'account':_0x33fc36,'message':{'from':util[_0xd23b('0xf')](_0xd23b('0x10'),_0x4106ef['MailAccount'][_0xd23b('0x11')],_0x4106ef['MailAccount']['email']||_0x4106ef['MailAccount'][_0xd23b('0x12')][_0xd23b('0x13')]),'to':_0x4106ef['email'],'cc':_0x4106ef['cc'],'bcc':_0x4106ef[_0xd23b('0x14')],'subject':util['format'](_0xd23b('0x15'),_0x2a06de[_0xd23b('0x11')],_0x4106ef[_0xd23b('0x16')],_0x4106ef[_0xd23b('0x17')])}};var _0x23dba7=path['join'](__dirname,_0xd23b('0x18'));var _0x198ad0=_0x2a06de[_0xd23b('0x19')];var _0x307f53=util[_0xd23b('0xf')]('%s.%s',path['basename'](_0x2a06de[_0xd23b('0x19')],path[_0xd23b('0x1a')](_0x2a06de[_0xd23b('0x19')])),_0xd23b('0x1b'));var _0x2e7e0e=path[_0xd23b('0x1c')](_0x23dba7,_0x198ad0);var _0x56c36e=path['join'](_0x23dba7,_0x307f53);if(fs['existsSync'](_0x2e7e0e)){_0x2a06de['status']='Sent';_0x58d0f8[_0xd23b('0x1d')][_0xd23b('0x1e')]=[{'filename':_0x198ad0,'path':_0x2e7e0e}];_0x58d0f8[_0xd23b('0x1d')]['text']=util['format'](_0xd23b('0x1f'),JSON[_0xd23b('0x20')](_0x2a06de,null,0x2));}else if(fs[_0xd23b('0x21')](_0x56c36e)){_0x2a06de[_0xd23b('0x22')]=_0xd23b('0x23');_0x58d0f8[_0xd23b('0x1d')][_0xd23b('0x1e')]=[{'filename':_0x307f53,'path':_0x56c36e}];}else{_0x58d0f8[_0xd23b('0x1d')]['text']=_0xd23b('0x24');if(!_0x4106ef[_0xd23b('0x25')]){_0x275266=![];logger[_0xd23b('0x26')](_0xd23b('0x27'));}}if(_0x275266){return client['request'](_0xd23b('0x28'),_0x58d0f8)[_0xd23b('0x29')](function(_0x3eb87a){if(_0x3eb87a[_0xd23b('0x2a')]){return logger[_0xd23b('0x2a')](_0xd23b('0x2b'),JSON[_0xd23b('0x20')](_0x3eb87a));}return logger['info'](_0xd23b('0x2c'));})['catch'](function(_0x115890){return logger[_0xd23b('0x2a')](_0xd23b('0x2b'),JSON[_0xd23b('0x20')](_0x115890));});}};}function handleError(){return function(_0x407273){return logger[_0xd23b('0x2a')](JSON[_0xd23b('0x20')](_0x407273));};}function handleResult(_0x42ef67){return function(_0x230a6a){logger[_0xd23b('0x26')](_0xd23b('0x2d'),JSON[_0xd23b('0x20')](_0x230a6a));if(_0x42ef67['MailAccount']&&_0x42ef67[_0xd23b('0x2e')][_0xd23b('0x12')]&&!_[_0xd23b('0x2f')](_0x42ef67[_0xd23b('0xe')])){setTimeout(handleSendEmail(_0x42ef67,_0x230a6a),0x3c*0x3e8);}};}function handleJob(_0x42906b){return function(){try{if(_[_0xd23b('0x2f')](_0x42906b[_0xd23b('0x16')])){return logger[_0xd23b('0x26')](_0xd23b('0x30'));}if(_['isNil'](_0x42906b[_0xd23b('0x17')])){return logger[_0xd23b('0x26')](_0xd23b('0x31'));}var _0x35bec6={'startDate':moment()['subtract'](_0x42906b['subtractNumber'],_0x42906b[_0xd23b('0x17')])[_0xd23b('0xf')](_0xd23b('0x32')),'endDate':moment()[_0xd23b('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xd23b('0x33'),'output':_0x42906b[_0xd23b('0x34')],'name':_0x42906b[_0xd23b('0x11')]};if(!_[_0xd23b('0x2f')](_0x42906b[_0xd23b('0x35')])){logger[_0xd23b('0x26')]('exec\x20defaul\x20report\x20id:%s',_0x42906b['DefaultReportId']);return analyticDefaultReportController[_0xd23b('0x36')]({'id':_0x42906b[_0xd23b('0x35')]},_0x35bec6)[_0xd23b('0x29')](handleResult(_0x42906b))['catch'](handleError());}if(!_[_0xd23b('0x2f')](_0x42906b['CustomReportId'])){logger[_0xd23b('0x26')](_0xd23b('0x37'),_0x42906b[_0xd23b('0x38')]);return analyticCustomReportController[_0xd23b('0x36')]({'id':_0x42906b[_0xd23b('0x38')]},_0x35bec6)['then'](handleResult(_0x42906b))[_0xd23b('0x39')](handleError());}}catch(_0x1280fb){logger['error'](JSON[_0xd23b('0x20')](_0x1280fb));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x526eee){var _0x2dc356={};if(_0x526eee){_0x2dc356['id']=_0x526eee;}return db[_0xd23b('0x3a')]['findAll']({'where':_0x2dc356,'include':[{'model':db[_0xd23b('0x2e')],'attributes':['id','name',_0xd23b('0xe')],'include':[{'model':db[_0xd23b('0x3b')],'as':_0xd23b('0x12'),'include':[{'model':db[_0xd23b('0x3c')],'as':'CloudProvider'}]}]}]})[_0xd23b('0x29')](function(_0xed18e3){var _0x4c7d46=_[_0xd23b('0x3d')](manager[_0xd23b('0x3e')]);var _0xd3b4aa=_[_0xd23b('0x3f')](_0xed18e3,function(_0x1c1cd3){return _0x1c1cd3['id'][_0xd23b('0x40')]();});var _0xfa58d8=_[_0xd23b('0x41')](_0xed18e3,function(_0x14935c){return _0x14935c['id']['toString']();});var _0x33ab87=_0x526eee?_0xd3b4aa:_[_0xd23b('0x42')](_0xd3b4aa,_0x4c7d46);var _0x169299=_[_0xd23b('0x43')](_0xd3b4aa,_0x4c7d46);var _0x5e5acb=_['difference'](_0x4c7d46,_0xd3b4aa);var _0x5b8a0a;var _0x5cc87b;for(_0x5b8a0a=0x0;_0x5b8a0a<_0x5e5acb[_0xd23b('0x44')]&&!_0x526eee;_0x5b8a0a+=0x1){_0x5cc87b=_0x5e5acb[_0x5b8a0a]['toString']();if(manager['exists'](_0x5cc87b)){manager[_0xd23b('0x45')](_0x5cc87b);manager['deleteJob'](_0x5cc87b);logger[_0xd23b('0x26')]('delete\x20cron',_0x5cc87b);}}logger[_0xd23b('0x26')](_0xd23b('0x46'),JSON[_0xd23b('0x20')](_0x33ab87));for(_0x5b8a0a=0x0;_0x5b8a0a<_0x33ab87[_0xd23b('0x44')];_0x5b8a0a+=0x1){_0x5cc87b=_0x33ab87[_0x5b8a0a][_0xd23b('0x40')]();logger[_0xd23b('0x26')](_0xd23b('0x47'),_0x5cc87b);if(_0x526eee){logger[_0xd23b('0x26')](_0xd23b('0x48'),_0x526eee);logger[_0xd23b('0x26')](JSON[_0xd23b('0x20')](_0xfa58d8[_0x5cc87b]));BPromise[_0xd23b('0x49')]()[_0xd23b('0x29')](handleJob(_0xfa58d8[_0x5cc87b]));logger['info'](_0xd23b('0x4a'),_0xfa58d8[_0x5cc87b][_0xd23b('0x11')],_0xfa58d8[_0x5cc87b]['cron']);}else if(_0xfa58d8[_0x5cc87b][_0xd23b('0x4b')]&&_0xfa58d8[_0x5cc87b][_0xd23b('0x4c')]&&moment()[_0xd23b('0x4d')](_0xfa58d8[_0x5cc87b]['startAt'],_0xfa58d8[_0x5cc87b][_0xd23b('0x4e')])){manager['add'](_0x5cc87b,_0xfa58d8[_0x5cc87b]['cron'],handleJob(_0xfa58d8[_0x5cc87b]));manager[_0xd23b('0x4f')](_0x5cc87b);logger[_0xd23b('0x26')](_0xd23b('0x50'),_0xfa58d8[_0x5cc87b]['name'],_0xfa58d8[_0x5cc87b]['cron']);}else if(manager[_0xd23b('0x51')](_0x5cc87b)){manager[_0xd23b('0x45')](_0x5cc87b);manager[_0xd23b('0x52')](_0x5cc87b);logger[_0xd23b('0x26')](_0xd23b('0x53'),_0xfa58d8[_0x5cc87b][_0xd23b('0x11')],_0xfa58d8[_0x5cc87b][_0xd23b('0x4b')]);}}for(_0x5b8a0a=0x0,_0x5cc87b;_0x5b8a0a<_0x169299[_0xd23b('0x44')]&&!_0x526eee;_0x5b8a0a+=0x1){_0x5cc87b=_0x169299[_0x5b8a0a][_0xd23b('0x40')]();if(manager[_0xd23b('0x51')](_0x5cc87b)){if(_0xfa58d8[_0x5cc87b]['cron']&&_0xfa58d8[_0x5cc87b][_0xd23b('0x4c')]&&moment()[_0xd23b('0x4d')](_0xfa58d8[_0x5cc87b][_0xd23b('0x54')],_0xfa58d8[_0x5cc87b][_0xd23b('0x4e')])){manager['update'](_0x5cc87b,_0xfa58d8[_0x5cc87b]['cron'],handleJob(_0xfa58d8[_0x5cc87b]));logger['info']('update\x20cron',_0xfa58d8[_0x5cc87b][_0xd23b('0x11')],_0xfa58d8[_0x5cc87b][_0xd23b('0x4b')]);}else{manager[_0xd23b('0x45')](_0x5cc87b);manager['deleteJob'](_0x5cc87b);logger['info'](_0xd23b('0x53'),_0xfa58d8[_0x5cc87b]['name'],_0xfa58d8[_0x5cc87b][_0xd23b('0x4b')]);}}}})[_0xd23b('0x39')](function(_0x20148f){logger[_0xd23b('0x2a')](JSON['stringify'](_0x20148f));});}exports[_0xd23b('0x55')]=function(_0x48e9e4){return getJobs(_0x48e9e4);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 12008f4..c8bf58f 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 _0xe1e3=['tempSentiment','ValidationError','sentiment','sentimentAccountId','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','then','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data1','data2','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Positive','Neutral','catch','name','error','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','findOne','Settings\x20not\x20available','transcribe','Transcribe\x20not\x20configured','forEach','push','lodash','aws-sdk','util','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','transcribeRegion','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated'];(function(_0x16d7a6,_0x4dac64){var _0x397bc1=function(_0x60f652){while(--_0x60f652){_0x16d7a6['push'](_0x16d7a6['shift']());}};_0x397bc1(++_0x4dac64);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x140ad6,_0x1e9c2f){_0x140ad6=_0x140ad6-0x0;var _0x433b42=_0xe1e3[_0x140ad6];return _0x433b42;};var _=require(_0x3e1e('0x0'));var AWS=require(_0x3e1e('0x1'));var rp=require('request-promise');var util=require(_0x3e1e('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x3e1e('0x3'))('transcribe');function getTranscriptionJob(_0x3bacc,_0x5a11ef,_0x1abd25,_0x397376){return new Promise(function(_0x40d6d8,_0x25701f){var _0x55cfba=new AWS[(_0x3e1e('0x4'))]({'accessKeyId':_0x5a11ef,'secretAccessKey':_0x3bacc,'region':_0x1abd25});_0x55cfba[_0x3e1e('0x5')]({'TranscriptionJobName':_0x397376},function(_0x2f0e12,_0xa67e35){if(_0x2f0e12){return _0x25701f(_0x2f0e12);}else{return _0x40d6d8(_0xa67e35);}});});}function sentiment(_0x3f085b,_0x1e5173,_0x5e7d1f,_0x5c4c25,_0x5060e8){return new Promise(function(_0x31d205,_0x5b0df8){var _0x349460=new AWS[(_0x3e1e('0x6'))]({'accessKeyId':_0x1e5173,'secretAccessKey':_0x3f085b,'region':_0x5e7d1f});_0x349460[_0x3e1e('0x7')]({'Text':_0x5c4c25,'LanguageCode':_0x5060e8['substring'](0x0,0x2)},function(_0x4bf92d,_0x4e6eee){if(_0x4bf92d){return _0x5b0df8(_0x4bf92d);}else{return _0x31d205(_0x4e6eee);}});});}function checkTranscribeJob(_0x4fcd4f,_0x4e47b9,_0x536129){var _0x5c09a2;return new BPromise(function(_0x14ad58,_0x595660){logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x9'),_0x4fcd4f['id'],_0x4fcd4f[_0x3e1e('0xa')]));return getTranscriptionJob(_0x536129['data1'],_0x536129['data2'],_0x4e47b9[_0x3e1e('0xb')],_0x4fcd4f[_0x3e1e('0xa')])['then'](function(_0x26cb35){logger[_0x3e1e('0xc')](util['format'](_0x3e1e('0xd'),_0x4fcd4f['id'],_0x4fcd4f['transcribeName'],_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0xf')]));if(!_0x4fcd4f[_0x3e1e('0x10')]){switch(_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0xf')]){case _0x3e1e('0x11'):var _0x569f49={'transcribeStatus':_0x26cb35['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0x12')][_0x3e1e('0x13')]};logger['info'](util[_0x3e1e('0x8')]('[RECORDING:%d]\x20Get\x20transcript',_0x4fcd4f['id']));return rp({'uri':_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0x12')][_0x3e1e('0x13')],'json':!![]})['then'](function(_0x53e051){logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x4fcd4f['id']));if(_0x53e051&&_0x53e051['results']&&_0x53e051[_0x3e1e('0x14')][_0x3e1e('0x15')]&&_0x53e051['results'][_0x3e1e('0x15')][_0x3e1e('0x16')]){_0x569f49[_0x3e1e('0x10')]='';for(var _0x33bf0f=0x0;_0x33bf0f<_0x53e051[_0x3e1e('0x14')][_0x3e1e('0x15')][_0x3e1e('0x16')];_0x33bf0f++){_0x569f49[_0x3e1e('0x10')]+=_0x53e051['results']['transcripts'][_0x33bf0f][_0x3e1e('0x17')]+'';}}return _0x4fcd4f[_0x3e1e('0x18')](_0x569f49);})['then'](function(){logger['info'](util['format'](_0x3e1e('0x19'),_0x4fcd4f['id']));if(!_0x4fcd4f[_0x3e1e('0x1a')]){throw new db['Sequelize'][(_0x3e1e('0x1b'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4e47b9[_0x3e1e('0x1c')]||!_0x4e47b9[_0x3e1e('0x1d')]||!_0x4e47b9['sentimentRegion']||!_0x4e47b9[_0x3e1e('0x1e')]||!_0x4e47b9[_0x3e1e('0x1f')]){throw new db[(_0x3e1e('0x20'))]['ValidationError'](_0x3e1e('0x21'));}if(!_0x569f49['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x4e47b9['sentimentAccountId']===_0x536129['id']){return _0x536129;}else{return db[_0x3e1e('0x22')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x3e1e('0x23')](function(_0x468336){if(!_0x468336){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x24'));}if(!_0x468336['data1']||!_0x468336['data2']){throw new db['Sequelize']['ValidationError'](_0x3e1e('0x25'));}_0x5c09a2=_0x468336;logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')](_0x3e1e('0x26'),_0x4fcd4f['id']));return sentiment(_0x5c09a2[_0x3e1e('0x27')],_0x5c09a2[_0x3e1e('0x28')],_0x4e47b9[_0x3e1e('0x29')],_0x569f49[_0x3e1e('0x10')],_0x4e47b9['language']);})[_0x3e1e('0x23')](function(_0x348ef5){logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x2a'),_0x4fcd4f['id']));return _0x4fcd4f[_0x3e1e('0x18')]({'sentiment':_0x348ef5[_0x3e1e('0x2b')],'sPositive':_0x348ef5['SentimentScore']['Positive'],'sNegative':_0x348ef5[_0x3e1e('0x2c')][_0x3e1e('0x2d')],'sMixed':_0x348ef5['SentimentScore'][_0x3e1e('0x2e')],'sNeutral':_0x348ef5[_0x3e1e('0x2c')]['Neutral']});})[_0x3e1e('0x23')](function(){logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')](_0x3e1e('0x19'),_0x4fcd4f['id']));_0x14ad58();});case _0x3e1e('0x2f'):return _0x4fcd4f['update']({'transcribeStatus':_0x3e1e('0x2f'),'failureReason':_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0x30')]})[_0x3e1e('0x23')](function(){logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x19'),_0x4fcd4f['id']));_0x14ad58();});default:logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')](_0x3e1e('0x31'),_0x4fcd4f['id']));break;}}else{return BPromise[_0x3e1e('0x32')]()[_0x3e1e('0x23')](function(){if(!_0x4fcd4f['tempSentiment']){throw new db[(_0x3e1e('0x20'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4e47b9[_0x3e1e('0x1c')]||!_0x4e47b9[_0x3e1e('0x1d')]||!_0x4e47b9[_0x3e1e('0x29')]||!_0x4e47b9['language']||!_0x4e47b9[_0x3e1e('0x1f')]){throw new db[(_0x3e1e('0x20'))]['ValidationError'](_0x3e1e('0x21'));}if(!_0x4fcd4f[_0x3e1e('0x10')]){throw new Error('Transcript\x20not\x20available');}if(_0x4e47b9['sentimentAccountId']===_0x536129['id']){return _0x536129;}else{return db[_0x3e1e('0x22')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x3e1e('0x23')](function(_0x3d4a8d){if(!_0x3d4a8d){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x24'));}if(!_0x3d4a8d['data1']||!_0x3d4a8d['data2']){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x25'));}_0x5c09a2=_0x3d4a8d;logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x26'),_0x4fcd4f['id']));return sentiment(_0x5c09a2[_0x3e1e('0x27')],_0x5c09a2['data2'],_0x4e47b9[_0x3e1e('0x29')],_0x4fcd4f['fileText'],_0x4e47b9['language']);})[_0x3e1e('0x23')](function(_0x9053cd){logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4fcd4f['id']));return _0x4fcd4f['update']({'sentiment':_0x9053cd['Sentiment'],'sPositive':_0x9053cd['SentimentScore'][_0x3e1e('0x33')],'sNegative':_0x9053cd[_0x3e1e('0x2c')]['Negative'],'sMixed':_0x9053cd['SentimentScore'][_0x3e1e('0x2e')],'sNeutral':_0x9053cd[_0x3e1e('0x2c')][_0x3e1e('0x34')],'transcribeStatus':'COMPLETED'});})[_0x3e1e('0x23')](function(){logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x19'),_0x4fcd4f['id']));_0x14ad58();});}})[_0x3e1e('0x35')](function(_0xb03215){if(_0xb03215){if(!_0xb03215[_0x3e1e('0x36')]||_0xb03215[_0x3e1e('0x36')]!=='SequelizeValidationError'){logger[_0x3e1e('0x37')](util[_0x3e1e('0x8')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x4fcd4f['id']),util[_0x3e1e('0x38')](_0xb03215,{'showHidden':![],'depth':null}));}}_0x14ad58();});});}function checkTranscribe(){var _0x24d320;var _0x551573;var _0x1cc820;return db[_0x3e1e('0x39')][_0x3e1e('0x3a')]({'where':{'transcribeStatus':_0x3e1e('0x3b')}})['then'](function(_0x108b79){if(!_0x108b79||!_0x108b79[_0x3e1e('0x16')]){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))]('No\x20transcribe\x20job\x20to\x20check');}_0x24d320=_0x108b79;return db[_0x3e1e('0x3c')][_0x3e1e('0x3d')]({'where':{'id':0x1}});})[_0x3e1e('0x23')](function(_0x25ddf7){if(!_0x25ddf7){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x3e'));}_0x551573=_0x25ddf7;if(!_0x551573[_0x3e1e('0x3f')]||!_0x551573['transcribeAccountId']||!_0x551573[_0x3e1e('0xb')]||!_0x551573['language']||!_0x551573['bucket']){throw new db['Sequelize'][(_0x3e1e('0x1b'))](_0x3e1e('0x40'));}return db['CloudProvider'][_0x3e1e('0x3d')]({'where':{'id':_0x551573['transcribeAccountId']}});})['then'](function(_0x3eaf76){if(!_0x3eaf76){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x3eaf76[_0x3e1e('0x27')]||!_0x3eaf76[_0x3e1e('0x28')]){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x25'));}_0x1cc820=_0x3eaf76;var _0xe18f8a=[];_0x24d320[_0x3e1e('0x41')](function(_0x5b71a6){_0xe18f8a[_0x3e1e('0x42')](checkTranscribeJob(_0x5b71a6,_0x551573,_0x1cc820));});return BPromise['all'](_0xe18f8a);})[_0x3e1e('0x35')](function(_0x286fef){if(_0x286fef){if(!_0x286fef[_0x3e1e('0x36')]||_0x286fef['name']!=='SequelizeValidationError'){logger[_0x3e1e('0x37')](util[_0x3e1e('0x38')](_0x286fef,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x71f4=['bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data1','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Neutral','FailureReason','resolve','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','Cloud\x20Provider\x20not\x20available','Sentiment','catch','name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','SequelizeValidationError','error','inspect','start','request-promise','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','transcribeName','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','sentiment','sentimentAccountId','sentimentRegion','language'];(function(_0x1a5566,_0x51c8a5){var _0x1ff161=function(_0x880071){while(--_0x880071){_0x1a5566['push'](_0x1a5566['shift']());}};_0x1ff161(++_0x51c8a5);}(_0x71f4,0xf9));var _0x471f=function(_0x38a3e2,_0x5791d7){_0x38a3e2=_0x38a3e2-0x0;var _0x3d5f1f=_0x71f4[_0x38a3e2];return _0x3d5f1f;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require(_0x471f('0x0'));var util=require(_0x471f('0x1'));var BPromise=require(_0x471f('0x2'));var db=require(_0x471f('0x3'))['db'];var logger=require(_0x471f('0x4'))('transcribe');function getTranscriptionJob(_0x453f79,_0x57bbfa,_0x3e0c2e,_0x5978a7){return new Promise(function(_0x1d0101,_0x3bdf82){var _0x155a77=new AWS[(_0x471f('0x5'))]({'accessKeyId':_0x57bbfa,'secretAccessKey':_0x453f79,'region':_0x3e0c2e});_0x155a77[_0x471f('0x6')]({'TranscriptionJobName':_0x5978a7},function(_0x246851,_0x2844e2){if(_0x246851){return _0x3bdf82(_0x246851);}else{return _0x1d0101(_0x2844e2);}});});}function sentiment(_0x3a4fa9,_0x3e59ed,_0x556733,_0x51f77e,_0x519567){return new Promise(function(_0x321e48,_0x22ea73){var _0x55042a=new AWS[(_0x471f('0x7'))]({'accessKeyId':_0x3e59ed,'secretAccessKey':_0x3a4fa9,'region':_0x556733});_0x55042a[_0x471f('0x8')]({'Text':_0x51f77e,'LanguageCode':_0x519567[_0x471f('0x9')](0x0,0x2)},function(_0x4d7364,_0x8b54cb){if(_0x4d7364){return _0x22ea73(_0x4d7364);}else{return _0x321e48(_0x8b54cb);}});});}function checkTranscribeJob(_0x16662a,_0x9f73ca,_0x22651b){var _0xafc5e8;return new BPromise(function(_0x4151c1,_0xdc7747){logger[_0x471f('0xa')](util[_0x471f('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x16662a['id'],_0x16662a[_0x471f('0xc')]));return getTranscriptionJob(_0x22651b['data1'],_0x22651b[_0x471f('0xd')],_0x9f73ca[_0x471f('0xe')],_0x16662a[_0x471f('0xc')])[_0x471f('0xf')](function(_0x117e7f){logger[_0x471f('0xa')](util[_0x471f('0xb')](_0x471f('0x10'),_0x16662a['id'],_0x16662a['transcribeName'],_0x117e7f[_0x471f('0x11')][_0x471f('0x12')]));if(!_0x16662a['fileText']){switch(_0x117e7f[_0x471f('0x11')]['TranscriptionJobStatus']){case _0x471f('0x13'):var _0x4e9833={'transcribeStatus':_0x117e7f[_0x471f('0x11')][_0x471f('0x12')],'fileUri':_0x117e7f[_0x471f('0x11')][_0x471f('0x14')]['TranscriptFileUri']};logger['info'](util[_0x471f('0xb')]('[RECORDING:%d]\x20Get\x20transcript',_0x16662a['id']));return rp({'uri':_0x117e7f[_0x471f('0x11')]['Transcript']['TranscriptFileUri'],'json':!![]})[_0x471f('0xf')](function(_0x2503f4){logger['info'](util[_0x471f('0xb')](_0x471f('0x15'),_0x16662a['id']));if(_0x2503f4&&_0x2503f4[_0x471f('0x16')]&&_0x2503f4['results'][_0x471f('0x17')]&&_0x2503f4[_0x471f('0x16')][_0x471f('0x17')][_0x471f('0x18')]){_0x4e9833[_0x471f('0x19')]='';for(var _0x505ca3=0x0;_0x505ca3<_0x2503f4[_0x471f('0x16')][_0x471f('0x17')]['length'];_0x505ca3++){_0x4e9833['fileText']+=_0x2503f4[_0x471f('0x16')][_0x471f('0x17')][_0x505ca3][_0x471f('0x1a')]+'';}}return _0x16662a[_0x471f('0x1b')](_0x4e9833);})[_0x471f('0xf')](function(){logger[_0x471f('0xa')](util[_0x471f('0xb')](_0x471f('0x1c'),_0x16662a['id']));if(!_0x16662a['tempSentiment']){throw new db[(_0x471f('0x1d'))][(_0x471f('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x9f73ca[_0x471f('0x1f')]||!_0x9f73ca[_0x471f('0x20')]||!_0x9f73ca[_0x471f('0x21')]||!_0x9f73ca[_0x471f('0x22')]||!_0x9f73ca[_0x471f('0x23')]){throw new db['Sequelize'][(_0x471f('0x1e'))](_0x471f('0x24'));}if(!_0x4e9833['fileText']){throw new Error(_0x471f('0x25'));}if(_0x9f73ca[_0x471f('0x20')]===_0x22651b['id']){return _0x22651b;}else{return db[_0x471f('0x26')][_0x471f('0x27')]({'where':{'id':_settings[_0x471f('0x20')]}});}})[_0x471f('0xf')](function(_0x28392f){if(!_0x28392f){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x28392f['data1']||!_0x28392f[_0x471f('0xd')]){throw new db[(_0x471f('0x1d'))]['ValidationError'](_0x471f('0x28'));}_0xafc5e8=_0x28392f;logger['info'](util[_0x471f('0xb')](_0x471f('0x29'),_0x16662a['id']));return sentiment(_0xafc5e8[_0x471f('0x2a')],_0xafc5e8[_0x471f('0xd')],_0x9f73ca[_0x471f('0x21')],_0x4e9833[_0x471f('0x19')],_0x9f73ca['language']);})[_0x471f('0xf')](function(_0x4fda1b){logger[_0x471f('0xa')](util[_0x471f('0xb')](_0x471f('0x2b'),_0x16662a['id']));return _0x16662a['update']({'sentiment':_0x4fda1b['Sentiment'],'sPositive':_0x4fda1b[_0x471f('0x2c')][_0x471f('0x2d')],'sNegative':_0x4fda1b[_0x471f('0x2c')][_0x471f('0x2e')],'sMixed':_0x4fda1b[_0x471f('0x2c')]['Mixed'],'sNeutral':_0x4fda1b['SentimentScore'][_0x471f('0x2f')]});})[_0x471f('0xf')](function(){logger[_0x471f('0xa')](util['format'](_0x471f('0x1c'),_0x16662a['id']));_0x4151c1();});case'FAILED':return _0x16662a['update']({'transcribeStatus':'FAILED','failureReason':_0x117e7f[_0x471f('0x11')][_0x471f('0x30')]})[_0x471f('0xf')](function(){logger[_0x471f('0xa')](util[_0x471f('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x16662a['id']));_0x4151c1();});default:logger['info'](util[_0x471f('0xb')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x16662a['id']));break;}}else{return BPromise[_0x471f('0x31')]()['then'](function(){if(!_0x16662a[_0x471f('0x32')]){throw new db[(_0x471f('0x1d'))][(_0x471f('0x1e'))](_0x471f('0x33'));}if(!_0x9f73ca[_0x471f('0x1f')]||!_0x9f73ca[_0x471f('0x20')]||!_0x9f73ca[_0x471f('0x21')]||!_0x9f73ca[_0x471f('0x22')]||!_0x9f73ca[_0x471f('0x23')]){throw new db[(_0x471f('0x1d'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x16662a[_0x471f('0x19')]){throw new Error(_0x471f('0x25'));}if(_0x9f73ca['sentimentAccountId']===_0x22651b['id']){return _0x22651b;}else{return db['CloudProvider'][_0x471f('0x27')]({'where':{'id':_settings[_0x471f('0x20')]}});}})[_0x471f('0xf')](function(_0x4e37b7){if(!_0x4e37b7){throw new db[(_0x471f('0x1d'))]['ValidationError'](_0x471f('0x34'));}if(!_0x4e37b7[_0x471f('0x2a')]||!_0x4e37b7['data2']){throw new db[(_0x471f('0x1d'))][(_0x471f('0x1e'))](_0x471f('0x28'));}_0xafc5e8=_0x4e37b7;logger[_0x471f('0xa')](util[_0x471f('0xb')](_0x471f('0x29'),_0x16662a['id']));return sentiment(_0xafc5e8[_0x471f('0x2a')],_0xafc5e8['data2'],_0x9f73ca['sentimentRegion'],_0x16662a[_0x471f('0x19')],_0x9f73ca[_0x471f('0x22')]);})[_0x471f('0xf')](function(_0x41ccd5){logger['info'](util[_0x471f('0xb')](_0x471f('0x2b'),_0x16662a['id']));return _0x16662a[_0x471f('0x1b')]({'sentiment':_0x41ccd5[_0x471f('0x35')],'sPositive':_0x41ccd5['SentimentScore'][_0x471f('0x2d')],'sNegative':_0x41ccd5[_0x471f('0x2c')][_0x471f('0x2e')],'sMixed':_0x41ccd5[_0x471f('0x2c')]['Mixed'],'sNeutral':_0x41ccd5['SentimentScore']['Neutral'],'transcribeStatus':_0x471f('0x13')});})[_0x471f('0xf')](function(){logger[_0x471f('0xa')](util[_0x471f('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x16662a['id']));_0x4151c1();});}})[_0x471f('0x36')](function(_0x56d79c){if(_0x56d79c){if(!_0x56d79c[_0x471f('0x37')]||_0x56d79c[_0x471f('0x37')]!=='SequelizeValidationError'){logger['error'](util['format'](_0x471f('0x38'),_0x16662a['id']),util['inspect'](_0x56d79c,{'showHidden':![],'depth':null}));}}_0x4151c1();});});}function checkTranscribe(){var _0x3b758b;var _0x245b1b;var _0x36a9e3;return db[_0x471f('0x39')][_0x471f('0x3a')]({'where':{'transcribeStatus':_0x471f('0x3b')}})[_0x471f('0xf')](function(_0x3a6625){if(!_0x3a6625||!_0x3a6625[_0x471f('0x18')]){throw new db[(_0x471f('0x1d'))][(_0x471f('0x1e'))]('No\x20transcribe\x20job\x20to\x20check');}_0x3b758b=_0x3a6625;return db[_0x471f('0x3c')][_0x471f('0x27')]({'where':{'id':0x1}});})[_0x471f('0xf')](function(_0x136687){if(!_0x136687){throw new db[(_0x471f('0x1d'))][(_0x471f('0x1e'))](_0x471f('0x3d'));}_0x245b1b=_0x136687;if(!_0x245b1b[_0x471f('0x3e')]||!_0x245b1b[_0x471f('0x3f')]||!_0x245b1b['transcribeRegion']||!_0x245b1b['language']||!_0x245b1b[_0x471f('0x23')]){throw new db['Sequelize'][(_0x471f('0x1e'))](_0x471f('0x40'));}return db['CloudProvider']['findOne']({'where':{'id':_0x245b1b[_0x471f('0x3f')]}});})[_0x471f('0xf')](function(_0x1f4e5a){if(!_0x1f4e5a){throw new db['Sequelize'][(_0x471f('0x1e'))](_0x471f('0x34'));}if(!_0x1f4e5a['data1']||!_0x1f4e5a['data2']){throw new db['Sequelize']['ValidationError'](_0x471f('0x28'));}_0x36a9e3=_0x1f4e5a;var _0x14c97c=[];_0x3b758b[_0x471f('0x41')](function(_0x183d2e){_0x14c97c['push'](checkTranscribeJob(_0x183d2e,_0x245b1b,_0x36a9e3));});return BPromise[_0x471f('0x42')](_0x14c97c);})[_0x471f('0x36')](function(_0x34af86){if(_0x34af86){if(!_0x34af86['name']||_0x34af86[_0x471f('0x37')]!==_0x471f('0x43')){logger[_0x471f('0x44')](util[_0x471f('0x45')](_0x34af86,{'showHidden':![],'depth':null}));}}});}exports[_0x471f('0x46')]=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 c7230d5..28849cd 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 _0xfb60=['catch','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update'];(function(_0x4a2b47,_0x406acd){var _0x3c5e11=function(_0x2e5be6){while(--_0x2e5be6){_0x4a2b47['push'](_0x4a2b47['shift']());}};_0x3c5e11(++_0x406acd);}(_0xfb60,0x1f3));var _0x0fb6=function(_0x2a70be,_0x490f9d){_0x2a70be=_0x2a70be-0x0;var _0x8f42cd=_0xfb60[_0x2a70be];return _0x8f42cd;};'use strict';var _=require(_0x0fb6('0x0'));var moment=require('moment');var Redis=require(_0x0fb6('0x1'));var util=require(_0x0fb6('0x2'));var config=require(_0x0fb6('0x3'));var db=require(_0x0fb6('0x4'))['db'];var logger=require(_0x0fb6('0x5'))(_0x0fb6('0x6'));config[_0x0fb6('0x7')]=_[_0x0fb6('0x8')](config['redis'],{'host':_0x0fb6('0x9'),'port':0x18eb});var io=require(_0x0fb6('0xa'))(new Redis(config[_0x0fb6('0x7')]));function closeInteractions(){var _0x3df66c=[];return db[_0x0fb6('0xb')][_0x0fb6('0xc')]({'raw':!![],'attributes':['id',_0x0fb6('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0fb6('0xe')](0x18,'hours')}}})['then'](function(_0xf73247){if(_0xf73247&&_0xf73247[_0x0fb6('0xf')]){_0x3df66c=_[_0x0fb6('0x10')](_0xf73247||[],'id');logger[_0x0fb6('0x11')](_0x0fb6('0x12'),_0x3df66c[_0x0fb6('0x13')]());return db[_0x0fb6('0xb')][_0x0fb6('0x14')]({'closeReason':_0x0fb6('0x15'),'disposition':_0x0fb6('0x16'),'closed':!![],'closedAt':moment()[_0x0fb6('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3df66c}});}})[_0x0fb6('0x18')](function(){if(_0x3df66c&&_0x3df66c[_0x0fb6('0xf')]){logger['info'](_0x0fb6('0x19'),_0x3df66c[_0x0fb6('0x13')]());for(var _0x51ff55=0x0;_0x51ff55<_0x3df66c['length'];_0x51ff55++){io[_0x0fb6('0x1a')](_0x0fb6('0x1b'),{'id':_0x3df66c[_0x51ff55],'closed':!![]});}}})[_0x0fb6('0x1c')](function(_0x13086f){logger['error'](_0x0fb6('0x1d'),_0x13086f?util['inspect'](_0x13086f,{'showHidden':![],'depth':null}):'');});}exports[_0x0fb6('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd06f=['length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','../../config/environment','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd06f,0x15f));var _0xfd06=function(_0x528327,_0x234696){_0x528327=_0x528327-0x0;var _0x3732d8=_0xd06f[_0x528327];return _0x3732d8;};'use strict';var _=require(_0xfd06('0x0'));var moment=require(_0xfd06('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0xfd06('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0xfd06('0x3'));config[_0xfd06('0x4')]=_['defaults'](config[_0xfd06('0x4')],{'host':_0xfd06('0x5'),'port':0x18eb});var io=require(_0xfd06('0x6'))(new Redis(config[_0xfd06('0x4')]));function closeInteractions(){var _0x459016=[];return db[_0xfd06('0x7')][_0xfd06('0x8')]({'raw':!![],'attributes':['id',_0xfd06('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfd06('0xa')](0x18,_0xfd06('0xb'))}}})[_0xfd06('0xc')](function(_0x564b01){if(_0x564b01&&_0x564b01[_0xfd06('0xd')]){_0x459016=_[_0xfd06('0xe')](_0x564b01||[],'id');logger[_0xfd06('0xf')](_0xfd06('0x10'),_0x459016[_0xfd06('0x11')]());return db[_0xfd06('0x7')][_0xfd06('0x12')]({'closeReason':_0xfd06('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xfd06('0x14')](_0xfd06('0x15'))},{'where':{'id':_0x459016}});}})[_0xfd06('0xc')](function(){if(_0x459016&&_0x459016[_0xfd06('0xd')]){logger[_0xfd06('0xf')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x459016['join']());for(var _0x112014=0x0;_0x112014<_0x459016[_0xfd06('0xd')];_0x112014++){io['emit'](_0xfd06('0x16'),{'id':_0x459016[_0x112014],'closed':!![]});}}})[_0xfd06('0x17')](function(_0x211540){logger[_0xfd06('0x18')](_0xfd06('0x19'),_0x211540?util[_0xfd06('0x1a')](_0x211540,{'showHidden':![],'depth':null}):'');});}exports[_0xfd06('0x1b')]=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 0b7f2f4..9b3ad56 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28c2=['contacts1','CmHopper','contacts2','hopper2','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','bulkCreate','log','finished\x20populating'];(function(_0xb2c3c2,_0x1d0ff7){var _0x42ff7c=function(_0x2eaddf){while(--_0x2eaddf){_0xb2c3c2['push'](_0xb2c3c2['shift']());}};_0x42ff7c(++_0x1d0ff7);}(_0x28c2,0x190));var _0x228c=function(_0x3e0d2c,_0x4ecde4){_0x3e0d2c=_0x3e0d2c-0x0;var _0x51340c=_0x28c2[_0x3e0d2c];return _0x51340c;};'use strict';var util=require(_0x228c('0x0'));var db=require(_0x228c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x228c('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x228c('0x3')+i,'phone':0xf879fb460+i,'email':_0x228c('0x4')+i+_0x228c('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x228c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x228c('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x228c('0x7')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x228c('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x228c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x228c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x228c('0x6')](),'updatedAt':Date[_0x228c('0x6')]()});}db[_0x228c('0x8')][_0x228c('0x9')]({'where':{}})[_0x228c('0xa')](function(){return db[_0x228c('0x8')][_0x228c('0xb')](contacts);})[_0x228c('0xa')](function(){console[_0x228c('0xc')](_0x228c('0xd'),_0x228c('0xe'));return db['CmHopper'][_0x228c('0x9')]({'where':{}});})[_0x228c('0xa')](function(){return db[_0x228c('0xf')][_0x228c('0xb')](hopper);})['then'](function(){console[_0x228c('0xc')](_0x228c('0xd'),'hopper1');return db[_0x228c('0x8')][_0x228c('0xb')](contacts2);})[_0x228c('0xa')](function(){console['log'](_0x228c('0xd'),_0x228c('0x10'));return db[_0x228c('0xf')][_0x228c('0xb')](hopper2);})[_0x228c('0xa')](function(){console[_0x228c('0xc')](_0x228c('0xd'),_0x228c('0x11'));})['catch'](function(_0x1ac53f){console[_0x228c('0xc')](_0x1ac53f);}); \ No newline at end of file +var _0x67c0=['../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','destroy','hopper1','contacts2','hopper2','catch'];(function(_0x46ca7e,_0x37c8c8){var _0x4d9f7f=function(_0x3f0e9){while(--_0x3f0e9){_0x46ca7e['push'](_0x46ca7e['shift']());}};_0x4d9f7f(++_0x37c8c8);}(_0x67c0,0x85));var _0x067c=function(_0x4a93e9,_0x5b569f){_0x4a93e9=_0x4a93e9-0x0;var _0x4b3ba7=_0x67c0[_0x4a93e9];return _0x4b3ba7;};'use strict';var util=require('util');var db=require(_0x067c('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x067c('0x1')+i,'lastName':_0x067c('0x2')+i,'phone':0xf879fb460+i,'email':_0x067c('0x3')+i+_0x067c('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x067c('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x067c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x067c('0x6')](),'updatedAt':Date[_0x067c('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x067c('0x5')]({'id':i,'firstName':_0x067c('0x1')+i,'lastName':_0x067c('0x2')+i,'phone':0xf879fb460+i,'email':_0x067c('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x067c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x067c('0x6')](),'updatedAt':Date[_0x067c('0x6')]()});}db[_0x067c('0x7')]['destroy']({'where':{}})[_0x067c('0x8')](function(){return db[_0x067c('0x7')][_0x067c('0x9')](contacts);})[_0x067c('0x8')](function(){console[_0x067c('0xa')](_0x067c('0xb'),_0x067c('0xc'));return db[_0x067c('0xd')][_0x067c('0xe')]({'where':{}});})['then'](function(){return db[_0x067c('0xd')]['bulkCreate'](hopper);})[_0x067c('0x8')](function(){console['log'](_0x067c('0xb'),_0x067c('0xf'));return db['CmContact']['bulkCreate'](contacts2);})['then'](function(){console[_0x067c('0xa')](_0x067c('0xb'),_0x067c('0x10'));return db[_0x067c('0xd')]['bulkCreate'](hopper2);})[_0x067c('0x8')](function(){console[_0x067c('0xa')]('finished\x20populating',_0x067c('0x11'));})[_0x067c('0x12')](function(_0xaf1f76){console[_0x067c('0xa')](_0xaf1f76);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index f73fa31..cdf2412 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48e5=['then','log','add\x20user','util','../mysqldb','push','format','%s%s','agent','password','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate'];(function(_0x2c4c45,_0x2e1b10){var _0x1d96e7=function(_0x5417ba){while(--_0x5417ba){_0x2c4c45['push'](_0x2c4c45['shift']());}};_0x1d96e7(++_0x2e1b10);}(_0x48e5,0x12f));var _0x548e=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0x48e5[_0x2f87cd];return _0x5d7eda;};'use strict';var util=require(_0x548e('0x0'));var db=require(_0x548e('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x548e('0x2')]({'name':util[_0x548e('0x3')]('%s%s','agent',i),'fullname':util['format'](_0x548e('0x4'),'agent',i),'email':util[_0x548e('0x3')]('%s%s@xcally.com',_0x548e('0x5'),i),'role':_0x548e('0x5'),'password':_0x548e('0x6'),'internal':0xfa0+i,'type':_0x548e('0x7'),'transport':[_0x548e('0x8'),'ws',_0x548e('0x9')],'disallow':['all'],'allow':[_0x548e('0xa')],'defaultuser':util[_0x548e('0x3')](_0x548e('0x4'),_0x548e('0x5'),i),'encryption':_0x548e('0xb'),'avpf':_0x548e('0xb'),'force_avp':_0x548e('0xb'),'icesupport':_0x548e('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x548e('0xc'),'dtlsprivatekey':_0x548e('0xd'),'dtlssetup':_0x548e('0xe'),'callerid':util['format']('\x22%s\x22\x20<%s>',util['format']('%s%s','agent',i),0xfa0+i)});}db[_0x548e('0xf')][_0x548e('0x10')](users)[_0x548e('0x11')](function(){console[_0x548e('0x12')](_0x548e('0x13'));})['catch'](function(_0x21e60a){console[_0x548e('0x12')](_0x21e60a);}); \ No newline at end of file +var _0xa402=['actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','agent','%s%s','%s%s@xcally.com','password','friend','udp','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x39ffd1,_0x299703){var _0x31267e=function(_0x11b420){while(--_0x11b420){_0x39ffd1['push'](_0x39ffd1['shift']());}};_0x31267e(++_0x299703);}(_0xa402,0x9a));var _0x2a40=function(_0x13da1c,_0x1a06a8){_0x13da1c=_0x13da1c-0x0;var _0x33d386=_0xa402[_0x13da1c];return _0x33d386;};'use strict';var util=require(_0x2a40('0x0'));var db=require(_0x2a40('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x2a40('0x2')]({'name':util[_0x2a40('0x3')]('%s%s',_0x2a40('0x4'),i),'fullname':util[_0x2a40('0x3')](_0x2a40('0x5'),_0x2a40('0x4'),i),'email':util[_0x2a40('0x3')](_0x2a40('0x6'),'agent',i),'role':_0x2a40('0x4'),'password':_0x2a40('0x7'),'internal':0xfa0+i,'type':_0x2a40('0x8'),'transport':[_0x2a40('0x9'),'ws','wss'],'disallow':[_0x2a40('0xa')],'allow':['ulaw'],'defaultuser':util['format'](_0x2a40('0x5'),_0x2a40('0x4'),i),'encryption':_0x2a40('0xb'),'avpf':'yes','force_avp':'yes','icesupport':_0x2a40('0xb'),'dtlsenable':_0x2a40('0xb'),'dtlsverify':'no','dtlscertfile':_0x2a40('0xc'),'dtlsprivatekey':_0x2a40('0xd'),'dtlssetup':_0x2a40('0xe'),'callerid':util[_0x2a40('0x3')](_0x2a40('0xf'),util[_0x2a40('0x3')](_0x2a40('0x5'),_0x2a40('0x4'),i),0xfa0+i)});}db['User'][_0x2a40('0x10')](users)[_0x2a40('0x11')](function(){console[_0x2a40('0x12')](_0x2a40('0x13'));})[_0x2a40('0x14')](function(_0x3cfcba){console[_0x2a40('0x12')](_0x3cfcba);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 86e97f1..461c46f 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x06f1=['request','remoteAddress','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','Agents','role','agent','name','telephone','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Trunks','UserProfileResource','resourceId','where','Campaign','type','format','length','handshake','query','User','find','userProfileId','ChatInteractions','MailInteraction','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','FaxQueue','MailQueue','OpenchannelQueue','Trunk','user','VoiceQueue','ChatQueue','OpenchannelQueues','IvrCampaigns','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','map','FaxInteractions','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address'];(function(_0x2564e6,_0x467065){var _0x39be09=function(_0x121570){while(--_0x121570){_0x2564e6['push'](_0x2564e6['shift']());}};_0x39be09(++_0x467065);}(_0x06f1,0x6e));var _0x106f=function(_0x2b2b87,_0xc71e84){_0x2b2b87=_0x2b2b87-0x0;var _0x31e57c=_0x06f1[_0x2b2b87];return _0x31e57c;};'use strict';var _=require(_0x106f('0x0'));var util=require(_0x106f('0x1'));var BPromise=require(_0x106f('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x106f('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x106f('0x4'),'model':db['User'],'attributes':['id','name',_0x106f('0x5')],'raw':!![],'where':{'role':_0x106f('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x106f('0x7')],'where':{'role':_0x106f('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x106f('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0x106f('0x7')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x106f('0x7'),'type'],'where':{'type':_0x106f('0x9')}};function getAssociatedResources(_0x2e683c,_0x164dd5,_0x59e36f){return db[_0x106f('0xa')][_0x106f('0xb')]({'where':{'name':_0x2e683c,'userProfileId':_0x164dd5},'raw':!![]})[_0x106f('0xc')](function(_0x3e667d){if(_0x3e667d){if(_0x3e667d[_0x106f('0xd')]){switch(_0x2e683c){case _0x106f('0xe'):case _0x106f('0xf'):case _0x106f('0x10'):case _0x106f('0x11'):case _0x106f('0x12'):case'OpenchannelQueues':case _0x106f('0x13'):return db[_0x59e36f][_0x106f('0x14')](queryQueues);case'Telephones':return db[_0x59e36f][_0x106f('0x14')](queryTelephones);case _0x106f('0x15'):return db[_0x59e36f][_0x106f('0x14')](queryTrunks);case'IvrCampaigns':return db[_0x59e36f]['findAll'](queryCampaigns);}}else{return db[_0x106f('0x16')][_0x106f('0x14')]({'attributes':[_0x106f('0x17')],'where':{'sectionId':_0x3e667d['id']},'raw':!![]})[_0x106f('0xc')](function(_0x422461){if(_0x422461){var _0x378483={'where':{'id':_['map'](_0x422461,'resourceId')},'raw':!![]};switch(_0x59e36f){case'User':_0x378483[_0x106f('0x18')][_0x106f('0x5')]='telephone';break;case _0x106f('0x19'):_0x378483[_0x106f('0x18')][_0x106f('0x1a')]='ivr';break;}return db[_0x59e36f]['findAll'](_0x378483);}else{return[];}});}}else{return[];}})[_0x106f('0xc')](function(_0x3f2cd6){return _0x3f2cd6;});}function joinOrLeaveQueues(_0x25d759,_0x37fab2,_0x1980e5,_0x8d54c8){_0x25d759[_0x37fab2](util[_0x106f('0x1b')]('%s:queue:%s',_0x1980e5,_0x8d54c8[_0x106f('0x7')]));if(_0x8d54c8[_0x106f('0x4')]){for(var _0x54bbb=0x0;_0x54bbb<_0x8d54c8['Agents'][_0x106f('0x1c')];_0x54bbb+=0x1){_0x25d759[_0x37fab2](util['format']('user:%s',_0x8d54c8[_0x106f('0x4')][_0x54bbb][_0x106f('0x7')]));}}}function joinOrLeave(_0x348614,_0x50093b,_0x18fd98){var _0x41dfdb;if(_0x348614[_0x106f('0x1d')][_0x106f('0x1e')]['id']){db[_0x106f('0x1f')][_0x106f('0x20')]({'attributes':['id',_0x106f('0x7'),_0x106f('0x5'),_0x106f('0x21')],'where':{'id':_0x348614['handshake']['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0x106f('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x106f('0x23')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x106f('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x106f('0x25')],'as':_0x106f('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x106f('0x27')],'as':_0x106f('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x106f('0x29')],'as':_0x106f('0x2a'),'attributes':['id'],'raw':!![]}]})['then'](function(_0xefc734){if(_0xefc734){_0x41dfdb=_0xefc734;_0x348614[_0x50093b](util[_0x106f('0x1b')](_0x106f('0x2b'),_0xefc734[_0x106f('0x7')]));var _0x57ebc0=[];switch(_0xefc734['role']){case _0x106f('0x2c'):_0x348614[_0x50093b](_0x106f('0x2d'));_0x348614[_0x50093b](_0x106f('0x2e'));if(queryQueues[_0x106f('0x2f')](_0x106f('0x30'))){delete queryQueues[_0x106f('0x30')];}_0x57ebc0[_0x106f('0x31')](db['VoiceQueue'][_0x106f('0x14')](queryQueues));_0x57ebc0[_0x106f('0x31')](db['ChatQueue'][_0x106f('0x14')](queryQueues));_0x57ebc0[_0x106f('0x31')](db[_0x106f('0x32')][_0x106f('0x14')](queryQueues));_0x57ebc0['push'](db['SmsQueue'][_0x106f('0x14')](queryQueues));_0x57ebc0[_0x106f('0x31')](db[_0x106f('0x33')][_0x106f('0x14')](queryQueues));_0x57ebc0['push'](db[_0x106f('0x34')][_0x106f('0x14')](queryQueues));_0x57ebc0[_0x106f('0x31')](db['WhatsappQueue'][_0x106f('0x14')](queryQueues));_0x57ebc0[_0x106f('0x31')](db[_0x106f('0x1f')][_0x106f('0x14')](queryTelephones));_0x57ebc0['push'](db[_0x106f('0x35')][_0x106f('0x14')](queryTrunks));_0x57ebc0[_0x106f('0x31')](db[_0x106f('0x19')]['findAll'](queryCampaigns));_0x57ebc0[_0x106f('0x31')](db[_0x106f('0x1f')]['findAll'](queryAgents));break;case _0x106f('0x36'):_0x348614[_0x50093b](_0x106f('0x2d'));_0x348614[_0x50093b](_0x106f('0x2e'));_0x57ebc0['push'](getAssociatedResources(_0x106f('0xe'),_0xefc734['userProfileId'],_0x106f('0x37')));_0x57ebc0[_0x106f('0x31')](getAssociatedResources(_0x106f('0xf'),_0xefc734[_0x106f('0x21')],_0x106f('0x38')));_0x57ebc0[_0x106f('0x31')](getAssociatedResources('FaxQueues',_0xefc734['userProfileId'],_0x106f('0x32')));_0x57ebc0[_0x106f('0x31')](getAssociatedResources(_0x106f('0x11'),_0xefc734['userProfileId'],'SmsQueue'));_0x57ebc0[_0x106f('0x31')](getAssociatedResources('MailQueues',_0xefc734[_0x106f('0x21')],_0x106f('0x33')));_0x57ebc0[_0x106f('0x31')](getAssociatedResources(_0x106f('0x39'),_0xefc734[_0x106f('0x21')],_0x106f('0x34')));_0x57ebc0['push'](getAssociatedResources(_0x106f('0x13'),_0xefc734['userProfileId'],'WhatsappQueue'));_0x57ebc0[_0x106f('0x31')](getAssociatedResources('Telephones',_0xefc734[_0x106f('0x21')],_0x106f('0x1f')));_0x57ebc0[_0x106f('0x31')](getAssociatedResources(_0x106f('0x15'),_0xefc734[_0x106f('0x21')],_0x106f('0x35')));_0x57ebc0[_0x106f('0x31')](getAssociatedResources(_0x106f('0x3a'),_0xefc734[_0x106f('0x21')],'Campaign'));_0x57ebc0[_0x106f('0x31')](db['User']['findAll'](queryAgents));break;case _0x106f('0x6'):_0x348614[_0x50093b](_0x106f('0x2d'));_0x348614[_0x50093b](_0x106f('0x2e'));_0x57ebc0[_0x106f('0x31')](_0xefc734['getVoiceQueues']({'attributes':['id',_0x106f('0x7')]}));_0x57ebc0[_0x106f('0x31')](_0xefc734[_0x106f('0x3b')]({'attributes':['id',_0x106f('0x7')]}));_0x57ebc0[_0x106f('0x31')](_0xefc734[_0x106f('0x3c')]({'attributes':['id','name']}));_0x57ebc0[_0x106f('0x31')](_0xefc734[_0x106f('0x3d')]({'attributes':['id',_0x106f('0x7')]}));_0x57ebc0['push'](_0xefc734[_0x106f('0x3e')]({'attributes':['id',_0x106f('0x7')]}));_0x57ebc0['push'](_0xefc734[_0x106f('0x3f')]({'attributes':['id','name']}));_0x57ebc0['push'](_0xefc734['getWhatsappQueues']({'attributes':['id',_0x106f('0x7')]}));break;}return BPromise[_0x106f('0x40')](_0x57ebc0);}})[_0x106f('0xc')](function(_0x4c24b2){if(_0x4c24b2&&_0x4c24b2[_0x106f('0x1c')]){for(var _0x381b0d=0x0;_0x381b0d<_0x4c24b2[_0x106f('0x1c')];_0x381b0d+=0x1){for(var _0x3f62b6=0x0;_0x3f62b6<_0x4c24b2[_0x381b0d][_0x106f('0x1c')];_0x3f62b6+=0x1){switch(_0x381b0d){case 0x0:joinOrLeaveQueues(_0x348614,_0x50093b,_0x106f('0x41'),_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x1:joinOrLeaveQueues(_0x348614,_0x50093b,_0x106f('0x42'),_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x2:joinOrLeaveQueues(_0x348614,_0x50093b,'fax',_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x3:joinOrLeaveQueues(_0x348614,_0x50093b,_0x106f('0x43'),_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x4:joinOrLeaveQueues(_0x348614,_0x50093b,_0x106f('0x44'),_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x5:joinOrLeaveQueues(_0x348614,_0x50093b,_0x106f('0x45'),_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x6:joinOrLeaveQueues(_0x348614,_0x50093b,_0x106f('0x46'),_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x7:if(_0x41dfdb[_0x106f('0x5')]!==_0x106f('0x6'))_0x348614[_0x50093b](util[_0x106f('0x1b')](_0x106f('0x47'),_0x4c24b2[_0x381b0d][_0x3f62b6]['name']));break;case 0x8:if(_0x41dfdb['role']!==_0x106f('0x6'))_0x348614[_0x50093b](util[_0x106f('0x1b')](_0x106f('0x48'),_0x4c24b2[_0x381b0d][_0x3f62b6]['name']));break;case 0x9:if(_0x41dfdb[_0x106f('0x5')]!==_0x106f('0x6'))_0x348614[_0x50093b](util[_0x106f('0x1b')](_0x106f('0x49'),_0x4c24b2[_0x381b0d][_0x3f62b6][_0x106f('0x1a')],_0x4c24b2[_0x381b0d][_0x3f62b6][_0x106f('0x7')]));break;case 0xa:_0x348614[_0x50093b](util[_0x106f('0x1b')](_0x106f('0x2b'),_0x4c24b2[_0x381b0d][_0x3f62b6]['name']));break;}}}}})['then'](function(){if(_0x50093b===_0x106f('0x4a')){var _0x5394b3=_['map'](_0x41dfdb[_0x106f('0x22')],'id');return _0x41dfdb[_0x106f('0x4b')](_0x5394b3)[_0x106f('0xc')](function(){for(var _0x24d20b=0x0;_0x24d20b<_0x5394b3[_0x106f('0x1c')];_0x24d20b+=0x1){_0x18fd98[_0x106f('0x4c')](_0x106f('0x4d'),{'ChatInteractionId':Number(_0x5394b3[_0x24d20b]),'UserId':Number(_0x41dfdb['id'])});}});}})[_0x106f('0xc')](function(){if(_0x50093b==='leave'){var _0x18b755=_['map'](_0x41dfdb[_0x106f('0x4e')],'id');return _0x41dfdb['removeMailInteractions'](_0x18b755)['then'](function(){for(var _0x36ba8b=0x0;_0x36ba8b<_0x18b755[_0x106f('0x1c')];_0x36ba8b+=0x1){_0x18fd98['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x18b755[_0x36ba8b]),'UserId':Number(_0x41dfdb['id'])});}});}})['then'](function(){if(_0x50093b==='leave'){var _0x5672ed=_[_0x106f('0x4f')](_0x41dfdb[_0x106f('0x50')],'id');return _0x41dfdb[_0x106f('0x51')](_0x5672ed)[_0x106f('0xc')](function(){for(var _0x1ef7bc=0x0;_0x1ef7bc<_0x5672ed[_0x106f('0x1c')];_0x1ef7bc+=0x1){_0x18fd98[_0x106f('0x4c')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x5672ed[_0x1ef7bc]),'UserId':Number(_0x41dfdb['id'])});}});}})[_0x106f('0xc')](function(){if(_0x50093b===_0x106f('0x4a')){var _0x4255a1=_['map'](_0x41dfdb['SmsInteractions'],'id');return _0x41dfdb[_0x106f('0x52')](_0x4255a1)[_0x106f('0xc')](function(){for(var _0xeecb61=0x0;_0xeecb61<_0x4255a1[_0x106f('0x1c')];_0xeecb61+=0x1){_0x18fd98['emit'](_0x106f('0x53'),{'SmsInteractionId':Number(_0x4255a1[_0xeecb61]),'UserId':Number(_0x41dfdb['id'])});}});}})[_0x106f('0xc')](function(){if(_0x50093b==='leave'){var _0x36b189=_[_0x106f('0x4f')](_0x41dfdb['OpenchannelInteractions'],'id');return _0x41dfdb[_0x106f('0x54')](_0x36b189)['then'](function(){for(var _0x4fdf90=0x0;_0x4fdf90<_0x36b189[_0x106f('0x1c')];_0x4fdf90+=0x1){_0x18fd98[_0x106f('0x4c')](_0x106f('0x55'),{'OpenchannelInteractionId':Number(_0x36b189[_0x4fdf90]),'UserId':Number(_0x41dfdb['id'])});}});}})[_0x106f('0xc')](function(){if(_0x50093b===_0x106f('0x4a')){var _0x5ee884=_[_0x106f('0x4f')](_0x41dfdb[_0x106f('0x2a')],'id');return _0x41dfdb[_0x106f('0x56')](_0x5ee884)['then'](function(){for(var _0x36f6c8=0x0;_0x36f6c8<_0x5ee884[_0x106f('0x1c')];_0x36f6c8+=0x1){_0x18fd98[_0x106f('0x4c')](_0x106f('0x57'),{'WhatsappInteractionId':Number(_0x5ee884[_0x36f6c8]),'UserId':Number(_0x41dfdb['id'])});}});}})['catch'](function(_0x12a799){_0x348614[_0x106f('0x58')](_0x12a799);});}}function onDisconnect(_0x4f8125,_0x227179){joinOrLeave(_0x4f8125,_0x106f('0x4a'),_0x227179);}function onConnect(_0x578f2e){joinOrLeave(_0x578f2e,_0x106f('0x59'));}exports[_0x106f('0x5a')]=function(_0x24cd76){_0x24cd76['on'](_0x106f('0x5b'),function(_0x37f877){_0x37f877[_0x106f('0x5c')](0x0);_0x37f877[_0x106f('0x5d')]=_0x37f877[_0x106f('0x5e')]['connection'][_0x106f('0x5f')]+':'+_0x37f877['request'][_0x106f('0x5b')][_0x106f('0x60')];_0x37f877[_0x106f('0x61')]=new Date();_0x37f877[_0x106f('0x58')]=function(_0x44ac61){console[_0x106f('0x58')]('SocketIO\x20'+_0x37f877[_0x106f('0x62')][_0x106f('0x7')]+'['+_0x37f877[_0x106f('0x5d')]+']',_0x44ac61);};_0x37f877['on'](_0x106f('0x63'),function(){onDisconnect(_0x37f877,_0x24cd76);_0x37f877[_0x106f('0x58')](_0x106f('0x64'));});onConnect(_0x37f877);_0x37f877['log'](_0x106f('0x65'));});}; \ No newline at end of file +var _0xe635=['voice:outbound','include','push','ChatQueue','SmsQueue','WhatsappQueue','Trunk','user','VoiceQueues','VoiceQueue','userProfileId','FaxQueue','SmsQueues','MailQueue','OpenchannelQueue','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','user_has_chat_interactions:remove','leave','removeMailInteractions','emit','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_sms_interactions:remove','removeWhatsappInteractions','catch','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','role','agent','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','ChatQueues','FaxQueues','MailQueues','WhatsappQueues','findAll','Telephones','UserProfileResource','resourceId','then','map','User','where','Campaign','format','%s:queue:%s','length','handshake','query','find','ChatInteractions','MailInteractions','FaxInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound'];(function(_0x4409b9,_0x550352){var _0x3f0659=function(_0x22273f){while(--_0x22273f){_0x4409b9['push'](_0x4409b9['shift']());}};_0x3f0659(++_0x550352);}(_0xe635,0x1be));var _0x5e63=function(_0x5e5d8c,_0x2060c5){_0x5e5d8c=_0x5e5d8c-0x0;var _0x250676=_0xe635[_0x5e5d8c];return _0x250676;};'use strict';var _=require(_0x5e63('0x0'));var util=require(_0x5e63('0x1'));var BPromise=require(_0x5e63('0x2'));var db=require(_0x5e63('0x3'))['db'];var config=require(_0x5e63('0x4'));var queryQueues={'attributes':['id',_0x5e63('0x5')],'include':[{'as':_0x5e63('0x6'),'model':db['User'],'attributes':['id','name',_0x5e63('0x7')],'raw':!![],'where':{'role':_0x5e63('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5e63('0x5')],'where':{'role':_0x5e63('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5e63('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x5e63('0x5')],'where':{'role':_0x5e63('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5e63('0x5'),_0x5e63('0xa')],'where':{'type':_0x5e63('0xb')}};function getAssociatedResources(_0x5cba07,_0x2794dc,_0x13501d){return db[_0x5e63('0xc')][_0x5e63('0xd')]({'where':{'name':_0x5cba07,'userProfileId':_0x2794dc},'raw':!![]})['then'](function(_0xd64e99){if(_0xd64e99){if(_0xd64e99[_0x5e63('0xe')]){switch(_0x5cba07){case'VoiceQueues':case _0x5e63('0xf'):case _0x5e63('0x10'):case'SmsQueues':case _0x5e63('0x11'):case'OpenchannelQueues':case _0x5e63('0x12'):return db[_0x13501d][_0x5e63('0x13')](queryQueues);case _0x5e63('0x14'):return db[_0x13501d][_0x5e63('0x13')](queryTelephones);case'Trunks':return db[_0x13501d]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x13501d][_0x5e63('0x13')](queryCampaigns);}}else{return db[_0x5e63('0x15')]['findAll']({'attributes':[_0x5e63('0x16')],'where':{'sectionId':_0xd64e99['id']},'raw':!![]})[_0x5e63('0x17')](function(_0x3c5d47){if(_0x3c5d47){var _0x491e27={'where':{'id':_[_0x5e63('0x18')](_0x3c5d47,_0x5e63('0x16'))},'raw':!![]};switch(_0x13501d){case _0x5e63('0x19'):_0x491e27[_0x5e63('0x1a')][_0x5e63('0x7')]='telephone';break;case _0x5e63('0x1b'):_0x491e27[_0x5e63('0x1a')][_0x5e63('0xa')]=_0x5e63('0xb');break;}return db[_0x13501d][_0x5e63('0x13')](_0x491e27);}else{return[];}});}}else{return[];}})['then'](function(_0x3d5b23){return _0x3d5b23;});}function joinOrLeaveQueues(_0x566514,_0x5d5cb4,_0xe8a6c5,_0x3eb7e6){_0x566514[_0x5d5cb4](util[_0x5e63('0x1c')](_0x5e63('0x1d'),_0xe8a6c5,_0x3eb7e6[_0x5e63('0x5')]));if(_0x3eb7e6[_0x5e63('0x6')]){for(var _0x464b76=0x0;_0x464b76<_0x3eb7e6[_0x5e63('0x6')][_0x5e63('0x1e')];_0x464b76+=0x1){_0x566514[_0x5d5cb4](util[_0x5e63('0x1c')]('user:%s',_0x3eb7e6[_0x5e63('0x6')][_0x464b76]['name']));}}}function joinOrLeave(_0x574d63,_0xeeff0e,_0x3ff002){var _0x2d9387;if(_0x574d63[_0x5e63('0x1f')][_0x5e63('0x20')]['id']){db[_0x5e63('0x19')][_0x5e63('0x21')]({'attributes':['id','name',_0x5e63('0x7'),'userProfileId'],'where':{'id':_0x574d63[_0x5e63('0x1f')][_0x5e63('0x20')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x5e63('0x22'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x5e63('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x5e63('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x5e63('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x5e63('0x26')],'as':_0x5e63('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x5e63('0x28')],'as':_0x5e63('0x29'),'attributes':['id'],'raw':!![]}]})[_0x5e63('0x17')](function(_0x4b3e42){if(_0x4b3e42){_0x2d9387=_0x4b3e42;_0x574d63[_0xeeff0e](util[_0x5e63('0x1c')]('user:%s',_0x4b3e42[_0x5e63('0x5')]));var _0x366f77=[];switch(_0x4b3e42[_0x5e63('0x7')]){case _0x5e63('0x2a'):_0x574d63[_0xeeff0e](_0x5e63('0x2b'));_0x574d63[_0xeeff0e](_0x5e63('0x2c'));if(queryQueues['hasOwnProperty'](_0x5e63('0x2d'))){delete queryQueues[_0x5e63('0x2d')];}_0x366f77[_0x5e63('0x2e')](db['VoiceQueue'][_0x5e63('0x13')](queryQueues));_0x366f77[_0x5e63('0x2e')](db[_0x5e63('0x2f')][_0x5e63('0x13')](queryQueues));_0x366f77['push'](db['FaxQueue']['findAll'](queryQueues));_0x366f77['push'](db[_0x5e63('0x30')][_0x5e63('0x13')](queryQueues));_0x366f77[_0x5e63('0x2e')](db['MailQueue'][_0x5e63('0x13')](queryQueues));_0x366f77[_0x5e63('0x2e')](db['OpenchannelQueue'][_0x5e63('0x13')](queryQueues));_0x366f77[_0x5e63('0x2e')](db[_0x5e63('0x31')][_0x5e63('0x13')](queryQueues));_0x366f77['push'](db[_0x5e63('0x19')]['findAll'](queryTelephones));_0x366f77['push'](db[_0x5e63('0x32')][_0x5e63('0x13')](queryTrunks));_0x366f77[_0x5e63('0x2e')](db[_0x5e63('0x1b')]['findAll'](queryCampaigns));_0x366f77[_0x5e63('0x2e')](db[_0x5e63('0x19')][_0x5e63('0x13')](queryAgents));break;case _0x5e63('0x33'):_0x574d63[_0xeeff0e](_0x5e63('0x2b'));_0x574d63[_0xeeff0e](_0x5e63('0x2c'));_0x366f77[_0x5e63('0x2e')](getAssociatedResources(_0x5e63('0x34'),_0x4b3e42['userProfileId'],_0x5e63('0x35')));_0x366f77['push'](getAssociatedResources(_0x5e63('0xf'),_0x4b3e42['userProfileId'],_0x5e63('0x2f')));_0x366f77[_0x5e63('0x2e')](getAssociatedResources('FaxQueues',_0x4b3e42[_0x5e63('0x36')],_0x5e63('0x37')));_0x366f77[_0x5e63('0x2e')](getAssociatedResources(_0x5e63('0x38'),_0x4b3e42['userProfileId'],'SmsQueue'));_0x366f77[_0x5e63('0x2e')](getAssociatedResources(_0x5e63('0x11'),_0x4b3e42[_0x5e63('0x36')],_0x5e63('0x39')));_0x366f77['push'](getAssociatedResources('OpenchannelQueues',_0x4b3e42['userProfileId'],_0x5e63('0x3a')));_0x366f77[_0x5e63('0x2e')](getAssociatedResources(_0x5e63('0x12'),_0x4b3e42[_0x5e63('0x36')],_0x5e63('0x31')));_0x366f77['push'](getAssociatedResources(_0x5e63('0x14'),_0x4b3e42[_0x5e63('0x36')],'User'));_0x366f77[_0x5e63('0x2e')](getAssociatedResources('Trunks',_0x4b3e42[_0x5e63('0x36')],'Trunk'));_0x366f77[_0x5e63('0x2e')](getAssociatedResources(_0x5e63('0x3b'),_0x4b3e42[_0x5e63('0x36')],'Campaign'));_0x366f77[_0x5e63('0x2e')](db[_0x5e63('0x19')][_0x5e63('0x13')](queryAgents));break;case _0x5e63('0x8'):_0x574d63[_0xeeff0e](_0x5e63('0x2b'));_0x574d63[_0xeeff0e](_0x5e63('0x2c'));_0x366f77['push'](_0x4b3e42[_0x5e63('0x3c')]({'attributes':['id',_0x5e63('0x5')]}));_0x366f77[_0x5e63('0x2e')](_0x4b3e42[_0x5e63('0x3d')]({'attributes':['id',_0x5e63('0x5')]}));_0x366f77['push'](_0x4b3e42[_0x5e63('0x3e')]({'attributes':['id',_0x5e63('0x5')]}));_0x366f77['push'](_0x4b3e42['getSmsQueues']({'attributes':['id',_0x5e63('0x5')]}));_0x366f77['push'](_0x4b3e42[_0x5e63('0x3f')]({'attributes':['id','name']}));_0x366f77['push'](_0x4b3e42[_0x5e63('0x40')]({'attributes':['id',_0x5e63('0x5')]}));_0x366f77[_0x5e63('0x2e')](_0x4b3e42[_0x5e63('0x41')]({'attributes':['id',_0x5e63('0x5')]}));break;}return BPromise[_0x5e63('0x42')](_0x366f77);}})[_0x5e63('0x17')](function(_0x2b4946){if(_0x2b4946&&_0x2b4946[_0x5e63('0x1e')]){for(var _0x174729=0x0;_0x174729<_0x2b4946[_0x5e63('0x1e')];_0x174729+=0x1){for(var _0x363c73=0x0;_0x363c73<_0x2b4946[_0x174729][_0x5e63('0x1e')];_0x363c73+=0x1){switch(_0x174729){case 0x0:joinOrLeaveQueues(_0x574d63,_0xeeff0e,'voice',_0x2b4946[_0x174729][_0x363c73]);break;case 0x1:joinOrLeaveQueues(_0x574d63,_0xeeff0e,_0x5e63('0x43'),_0x2b4946[_0x174729][_0x363c73]);break;case 0x2:joinOrLeaveQueues(_0x574d63,_0xeeff0e,_0x5e63('0x44'),_0x2b4946[_0x174729][_0x363c73]);break;case 0x3:joinOrLeaveQueues(_0x574d63,_0xeeff0e,_0x5e63('0x45'),_0x2b4946[_0x174729][_0x363c73]);break;case 0x4:joinOrLeaveQueues(_0x574d63,_0xeeff0e,_0x5e63('0x46'),_0x2b4946[_0x174729][_0x363c73]);break;case 0x5:joinOrLeaveQueues(_0x574d63,_0xeeff0e,_0x5e63('0x47'),_0x2b4946[_0x174729][_0x363c73]);break;case 0x6:joinOrLeaveQueues(_0x574d63,_0xeeff0e,_0x5e63('0x48'),_0x2b4946[_0x174729][_0x363c73]);break;case 0x7:if(_0x2d9387['role']!==_0x5e63('0x8'))_0x574d63[_0xeeff0e](util['format'](_0x5e63('0x49'),_0x2b4946[_0x174729][_0x363c73]['name']));break;case 0x8:if(_0x2d9387[_0x5e63('0x7')]!==_0x5e63('0x8'))_0x574d63[_0xeeff0e](util['format']('trunk:%s',_0x2b4946[_0x174729][_0x363c73]['name']));break;case 0x9:if(_0x2d9387[_0x5e63('0x7')]!=='agent')_0x574d63[_0xeeff0e](util[_0x5e63('0x1c')]('campaign:%s:%s',_0x2b4946[_0x174729][_0x363c73][_0x5e63('0xa')],_0x2b4946[_0x174729][_0x363c73][_0x5e63('0x5')]));break;case 0xa:_0x574d63[_0xeeff0e](util[_0x5e63('0x1c')]('user:%s',_0x2b4946[_0x174729][_0x363c73]['name']));break;}}}}})[_0x5e63('0x17')](function(){if(_0xeeff0e==='leave'){var _0x44ea72=_[_0x5e63('0x18')](_0x2d9387[_0x5e63('0x22')],'id');return _0x2d9387['removeChatInteractions'](_0x44ea72)[_0x5e63('0x17')](function(){for(var _0x5b3044=0x0;_0x5b3044<_0x44ea72[_0x5e63('0x1e')];_0x5b3044+=0x1){_0x3ff002['emit'](_0x5e63('0x4a'),{'ChatInteractionId':Number(_0x44ea72[_0x5b3044]),'UserId':Number(_0x2d9387['id'])});}});}})[_0x5e63('0x17')](function(){if(_0xeeff0e===_0x5e63('0x4b')){var _0x42c6d3=_[_0x5e63('0x18')](_0x2d9387[_0x5e63('0x23')],'id');return _0x2d9387[_0x5e63('0x4c')](_0x42c6d3)[_0x5e63('0x17')](function(){for(var _0xb9b836=0x0;_0xb9b836<_0x42c6d3[_0x5e63('0x1e')];_0xb9b836+=0x1){_0x3ff002[_0x5e63('0x4d')](_0x5e63('0x4e'),{'MailInteractionId':Number(_0x42c6d3[_0xb9b836]),'UserId':Number(_0x2d9387['id'])});}});}})['then'](function(){if(_0xeeff0e===_0x5e63('0x4b')){var _0x33c5b2=_[_0x5e63('0x18')](_0x2d9387[_0x5e63('0x4f')],'id');return _0x2d9387[_0x5e63('0x50')](_0x33c5b2)['then'](function(){for(var _0x1d0d22=0x0;_0x1d0d22<_0x33c5b2[_0x5e63('0x1e')];_0x1d0d22+=0x1){_0x3ff002['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x33c5b2[_0x1d0d22]),'UserId':Number(_0x2d9387['id'])});}});}})['then'](function(){if(_0xeeff0e==='leave'){var _0x45ff6d=_[_0x5e63('0x18')](_0x2d9387['SmsInteractions'],'id');return _0x2d9387['removeSmsInteractions'](_0x45ff6d)[_0x5e63('0x17')](function(){for(var _0x520aed=0x0;_0x520aed<_0x45ff6d[_0x5e63('0x1e')];_0x520aed+=0x1){_0x3ff002[_0x5e63('0x4d')](_0x5e63('0x51'),{'SmsInteractionId':Number(_0x45ff6d[_0x520aed]),'UserId':Number(_0x2d9387['id'])});}});}})[_0x5e63('0x17')](function(){if(_0xeeff0e===_0x5e63('0x4b')){var _0x5207a1=_[_0x5e63('0x18')](_0x2d9387['OpenchannelInteractions'],'id');return _0x2d9387['removeOpenchannelInteractions'](_0x5207a1)['then'](function(){for(var _0x4c5f6d=0x0;_0x4c5f6d<_0x5207a1[_0x5e63('0x1e')];_0x4c5f6d+=0x1){_0x3ff002[_0x5e63('0x4d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x5207a1[_0x4c5f6d]),'UserId':Number(_0x2d9387['id'])});}});}})[_0x5e63('0x17')](function(){if(_0xeeff0e==='leave'){var _0x5afb98=_[_0x5e63('0x18')](_0x2d9387[_0x5e63('0x29')],'id');return _0x2d9387[_0x5e63('0x52')](_0x5afb98)[_0x5e63('0x17')](function(){for(var _0x566aac=0x0;_0x566aac<_0x5afb98[_0x5e63('0x1e')];_0x566aac+=0x1){_0x3ff002[_0x5e63('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x5afb98[_0x566aac]),'UserId':Number(_0x2d9387['id'])});}});}})[_0x5e63('0x53')](function(_0x2b6cc6){_0x574d63['log'](_0x2b6cc6);});}}function onDisconnect(_0x287122,_0x4a0436){joinOrLeave(_0x287122,_0x5e63('0x4b'),_0x4a0436);}function onConnect(_0x281075){joinOrLeave(_0x281075,_0x5e63('0x54'));}exports[_0x5e63('0x55')]=function(_0x2d0fb5){_0x2d0fb5['on'](_0x5e63('0x56'),function(_0x3e4141){_0x3e4141[_0x5e63('0x57')](0x0);_0x3e4141[_0x5e63('0x58')]=_0x3e4141[_0x5e63('0x59')][_0x5e63('0x56')][_0x5e63('0x5a')]+':'+_0x3e4141[_0x5e63('0x59')][_0x5e63('0x56')][_0x5e63('0x5b')];_0x3e4141[_0x5e63('0x5c')]=new Date();_0x3e4141['log']=function(_0x35deeb){console[_0x5e63('0x5d')](_0x5e63('0x5e')+_0x3e4141['nsp'][_0x5e63('0x5')]+'['+_0x3e4141['address']+']',_0x35deeb);};_0x3e4141['on'](_0x5e63('0x5f'),function(){onDisconnect(_0x3e4141,_0x2d0fb5);_0x3e4141[_0x5e63('0x5d')](_0x5e63('0x60'));});onConnect(_0x3e4141);_0x3e4141[_0x5e63('0x5d')](_0x5e63('0x61'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index feec998..3e5712b 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 _0xcb86=['name','channel','incomingmessage','AfterCreateMessage','offlineMessage','agent','AfterCreate','closed','changed','substatus','AfterUpdate','User','find','fullname','email','internal','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','newinteraction','Chat','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','SmsInteraction','afterCreate','Sms','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','info','Trigger,\x20%s','error','code','catch','EventManager','get','motionChannel','event','resolve','then','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','SIP/%s'];(function(_0x2acd35,_0x2b21df){var _0x272693=function(_0x118994){while(--_0x118994){_0x2acd35['push'](_0x2acd35['shift']());}};_0x272693(++_0x2b21df);}(_0xcb86,0xac));var _0x6cb8=function(_0x320718,_0xa83d3f){_0x320718=_0x320718-0x0;var _0x206606=_0xcb86[_0x320718];return _0x206606;};'use strict';var util=require(_0x6cb8('0x0'));var db=require(_0x6cb8('0x1'))['db'];var jayson=require(_0x6cb8('0x2'));var logger=require(_0x6cb8('0x3'))(_0x6cb8('0x4'));var client=jayson[_0x6cb8('0x5')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':'afterCreate','condition':_0x6cb8('0x6'),'callback':afterCreate},{'channel':_0x6cb8('0x7'),'model':_0x6cb8('0x8'),'event':_0x6cb8('0x9'),'condition':_0x6cb8('0xa'),'callback':afterUpdate},{'channel':'Chat','model':_0x6cb8('0xb'),'event':'afterCreate','condition':_0x6cb8('0xc'),'callback':afterCreateMessage},{'channel':_0x6cb8('0x7'),'model':_0x6cb8('0xd'),'event':'afterCreate','condition':_0x6cb8('0xc'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x6cb8('0xe'),'event':_0x6cb8('0xf'),'condition':_0x6cb8('0x6'),'callback':afterCreate},{'channel':'Sms','model':_0x6cb8('0xe'),'event':_0x6cb8('0x9'),'condition':_0x6cb8('0xa'),'callback':afterUpdate},{'channel':_0x6cb8('0x10'),'model':_0x6cb8('0x11'),'event':'afterCreate','condition':_0x6cb8('0xc'),'callback':afterCreateMessage},{'channel':_0x6cb8('0x12'),'model':_0x6cb8('0x13'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x6cb8('0x12'),'model':'WhatsappInteraction','event':_0x6cb8('0x9'),'condition':_0x6cb8('0xa'),'callback':afterUpdate},{'channel':_0x6cb8('0x12'),'model':'WhatsappMessage','event':_0x6cb8('0xf'),'condition':_0x6cb8('0xc'),'callback':afterCreateMessage},{'channel':_0x6cb8('0x14'),'model':_0x6cb8('0x15'),'event':_0x6cb8('0xf'),'condition':_0x6cb8('0x6'),'callback':afterCreate},{'channel':_0x6cb8('0x14'),'model':_0x6cb8('0x15'),'event':_0x6cb8('0x9'),'condition':_0x6cb8('0xa'),'callback':afterUpdate},{'channel':'Fax','model':'FaxMessage','event':_0x6cb8('0xf'),'condition':_0x6cb8('0xc'),'callback':afterCreateMessage},{'channel':_0x6cb8('0x16'),'model':'MailInteraction','event':_0x6cb8('0xf'),'condition':_0x6cb8('0x6'),'callback':afterCreate},{'channel':'Mail','model':_0x6cb8('0x17'),'event':_0x6cb8('0x9'),'condition':_0x6cb8('0xa'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0x6cb8('0xf'),'condition':_0x6cb8('0xc'),'callback':afterCreateMessage},{'channel':_0x6cb8('0x18'),'model':'OpenchannelInteraction','event':_0x6cb8('0xf'),'condition':_0x6cb8('0x6'),'callback':afterCreate},{'channel':_0x6cb8('0x18'),'model':_0x6cb8('0x19'),'event':_0x6cb8('0x9'),'condition':_0x6cb8('0xa'),'callback':afterUpdate},{'channel':_0x6cb8('0x18'),'model':_0x6cb8('0x1a'),'event':_0x6cb8('0xf'),'condition':_0x6cb8('0xc'),'callback':afterCreateMessage}];function request(_0x1976bd){return client['request']('EventManager',_0x1976bd)['then'](function(_0x50a0cf){logger[_0x6cb8('0x1b')](_0x6cb8('0x1c'),'EventManager',_0x50a0cf);if(_0x50a0cf[_0x6cb8('0x1d')]){if(_0x50a0cf[_0x6cb8('0x1d')][_0x6cb8('0x1e')]===0x1f4){logger[_0x6cb8('0x1d')](_0x6cb8('0x1c'),'EventManager',_0x50a0cf['error']);}}})[_0x6cb8('0x1f')](function(_0x405d1a){logger[_0x6cb8('0x1d')](_0x6cb8('0x1c'),_0x6cb8('0x20'),_0x405d1a);});}function afterCreateMessage(_0x1174f7){return function(_0x483fe3){_0x483fe3=_0x483fe3[_0x6cb8('0x21')]({'plain':!![]});_0x483fe3['channel']=_0x1174f7;_0x483fe3[_0x6cb8('0x22')]=_0x1174f7;_0x483fe3[_0x6cb8('0x23')]=_0x483fe3['direction'];Promise[_0x6cb8('0x24')]()[_0x6cb8('0x25')](function(){if(typeof _0x483fe3[_0x6cb8('0x26')]===_0x6cb8('0x27'))return null;var _0x4e7827=_0x6cb8('0x28')+_0x483fe3['ContactId'];return db[_0x6cb8('0x29')][_0x6cb8('0x2a')](_0x4e7827,{'type':db[_0x6cb8('0x2b')][_0x6cb8('0x2c')][_0x6cb8('0x2d')],'raw':!![]});})[_0x6cb8('0x25')](function(_0x1ff7ae){if(_0x1ff7ae){_0x483fe3[_0x6cb8('0x2e')]=_0x1ff7ae[0x0];}if(typeof _0x483fe3[_0x6cb8('0x2f')]===_0x6cb8('0x27'))return;return getAgent(_0x483fe3[_0x6cb8('0x2f')]);})[_0x6cb8('0x25')](function(_0x3b3430){if(_0x3b3430){_0x483fe3[_0x6cb8('0x30')]=util['format'](_0x6cb8('0x31'),_0x3b3430[_0x6cb8('0x32')]);_0x483fe3['agent']=_0x3b3430;_0x483fe3[_0x6cb8('0x33')]=_0x1174f7;return request({'event':_0x6cb8('0x34'),'message':_0x483fe3});}else{return request({'event':'outgoingmessage','message':_0x483fe3});}})[_0x6cb8('0x1f')](function(_0x488dd7){logger[_0x6cb8('0x1d')](_0x6cb8('0x1c'),_0x6cb8('0x35'),_0x488dd7);});};}function afterCreateOfflineMessage(_0xa2a01b){return function(_0x1274c8){_0x1274c8=_0x1274c8[_0x6cb8('0x21')]({'plain':!![]});_0x1274c8[_0x6cb8('0x33')]=_0xa2a01b;_0x1274c8[_0x6cb8('0x22')]=_0xa2a01b;_0x1274c8['event']=_0x6cb8('0x36');return request({'event':_0x1274c8[_0x6cb8('0x23')],'message':_0x1274c8});};}function afterCreate(_0x48a6e7,_0x58b80a){return function(_0x16c721){_0x16c721=_0x16c721[_0x6cb8('0x21')]({'plain':!![]});_0x16c721[_0x6cb8('0x33')]=_0x48a6e7;_0x16c721['motionChannel']=_0x48a6e7;_0x16c721['event']='opened';Promise[_0x6cb8('0x24')]()[_0x6cb8('0x25')](function(){var _0x57ce0b=_0x6cb8('0x28')+_0x16c721[_0x6cb8('0x26')];return db[_0x6cb8('0x29')]['query'](_0x57ce0b,{'type':db['Sequelize'][_0x6cb8('0x2c')][_0x6cb8('0x2d')],'raw':!![]});})[_0x6cb8('0x25')](function(_0x23c7c5){if(_0x23c7c5){_0x16c721[_0x6cb8('0x2e')]=_0x23c7c5[0x0];}if(typeof _0x16c721[_0x6cb8('0x2f')]===_0x6cb8('0x27'))return;return getAgent(_0x16c721[_0x6cb8('0x2f')]);})[_0x6cb8('0x25')](function(_0x229e4c){if(_0x229e4c){_0x16c721['interface']=util['format'](_0x6cb8('0x31'),_0x229e4c[_0x6cb8('0x32')]);_0x16c721[_0x6cb8('0x37')]=_0x229e4c;}return request({'event':_0x58b80a,'message':_0x16c721});})[_0x6cb8('0x1f')](function(_0x1b87a0){logger[_0x6cb8('0x1d')](_0x6cb8('0x1c'),_0x6cb8('0x38'),_0x1b87a0);});};}function afterUpdate(_0x4a0ca6){return function(_0x114915){var _0x1160b9=_0x114915['changed'](_0x6cb8('0x39'))&&_0x114915[_0x6cb8('0x39')];var _0x1c48b6=_0x114915[_0x6cb8('0x3a')](_0x6cb8('0x3b'));if(_0x1160b9||_0x1c48b6){var _0x3f85ca=_0x1160b9?_0x6cb8('0xa'):_0x6cb8('0x3b');var _0x531a23=_0x114915[_0x6cb8('0x21')]({'plain':!![]});_0x531a23[_0x6cb8('0x33')]=_0x4a0ca6;_0x531a23['motionChannel']=_0x4a0ca6;_0x531a23[_0x6cb8('0x23')]=_0x1160b9?_0x6cb8('0x39'):_0x6cb8('0x3b');var _0x2dcbfc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x531a23[_0x6cb8('0x26')];return db['sequelize'][_0x6cb8('0x2a')](_0x2dcbfc,{'type':db[_0x6cb8('0x2b')][_0x6cb8('0x2c')][_0x6cb8('0x2d')],'raw':!![]})['then'](function(_0x2121b0){if(_0x2121b0){_0x531a23['contact']=_0x2121b0[0x0];}if(typeof _0x531a23[_0x6cb8('0x2f')]==='undefined')return;return getAgent(_0x531a23[_0x6cb8('0x2f')]);})['then'](function(_0x4e6b13){if(_0x4e6b13){_0x531a23[_0x6cb8('0x30')]=util['format'](_0x6cb8('0x31'),_0x4e6b13[_0x6cb8('0x32')]);_0x531a23[_0x6cb8('0x37')]=_0x4e6b13;}return request({'event':_0x3f85ca,'message':_0x531a23});})[_0x6cb8('0x1f')](function(_0x507bed){logger[_0x6cb8('0x1d')]('Trigger,\x20%s',_0x6cb8('0x3c'),_0x507bed);});}};}function getAgent(_0x32af6b){return db[_0x6cb8('0x3d')][_0x6cb8('0x3e')]({'where':{'id':_0x32af6b},'attributes':['id',_0x6cb8('0x32'),_0x6cb8('0x3f'),_0x6cb8('0x40'),_0x6cb8('0x41')],'raw':!![]})[_0x6cb8('0x25')](function(_0x52ae86){return _0x52ae86;});}exports[_0x6cb8('0x42')]=function(){for(var _0x52fb62=0x0;_0x52fb62=_0x33fabc[_0xcc02('0x13')]){throw Error(_0xcc02('0x14'));}_0x2243a4(_0x3c60c3);})[_0xcc02('0x15')](function(_0x4e7828){_0x2d9114(_0x4e7828);});});}; \ No newline at end of file +var _0x150f=['whatsapp','getChannels','isValidChannel','toLowerCase','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','voice','mail','sms'];(function(_0x2ffa17,_0x35b3a8){var _0x3a783b=function(_0x16d13d){while(--_0x16d13d){_0x2ffa17['push'](_0x2ffa17['shift']());}};_0x3a783b(++_0x35b3a8);}(_0x150f,0x19e));var _0xf150=function(_0x51e346,_0x2698a5){_0x51e346=_0x51e346-0x0;var _0x565c3c=_0x150f[_0x51e346];return _0x565c3c;};'use strict';var _=require(_0xf150('0x0'));var BPromise=require(_0xf150('0x1'));var db=require(_0xf150('0x2'))['db'];var util=require('./license/util');var channels=[_0xf150('0x3'),_0xf150('0x4'),'chat','fax',_0xf150('0x5'),_0xf150('0x6'),'openchannel'];exports[_0xf150('0x7')]=function(){return channels;};exports[_0xf150('0x8')]=function(_0x44e7ee){_0x44e7ee=_0x44e7ee[_0xf150('0x9')]();return _['includes'](channels,_0x44e7ee);};exports[_0xf150('0xa')]=function(_0x7fffcc,_0x21ec8c,_0x2beb75,_0x150524){var _0x127909={'loginAttempts':_0x21ec8c,'blocked':_0x2beb75};if(!_[_0xf150('0xb')](_0x150524)){_0x127909[_0xf150('0xc')]=_0x150524;}return _0x7fffcc[_0xf150('0xd')](_0x127909);};exports[_0xf150('0xe')]=function(_0x10c4f7){return new BPromise(function(_0x1ac11f,_0x54ae5f){var _0x3adfe9=0x0;if(_0x10c4f7[_0xf150('0xf')]!==_0xf150('0x10')){_0x1ac11f(_0x10c4f7);}db['User']['count']({'where':{'role':_0xf150('0x10'),'online':!![],'id':{'$ne':_0x10c4f7['id']}}})[_0xf150('0x11')](function(_0x22c46d){_0x3adfe9=_0x22c46d;return util[_0xf150('0xe')]();})['then'](function(_0x2baa61){if(_0x2baa61&&_0x2baa61['agents']&&_0x3adfe9>=_0x2baa61[_0xf150('0x12')]){throw Error(_0xf150('0x13'));}_0x1ac11f(_0x10c4f7);})[_0xf150('0x14')](function(_0x1efff5){_0x54ae5f(_0x1efff5);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 5c913de..442f90f 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error','statusMessage','status','send','exports','../config/logger','message','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found'];(function(_0x442801,_0x406ee2){var _0x51cb59=function(_0x1d468d){while(--_0x1d468d){_0x442801['push'](_0x442801['shift']());}};_0x51cb59(++_0x406ee2);}(_0xadb5,0xad));var _0x5adb=function(_0x2a0655,_0x2d0edf){_0x2a0655=_0x2a0655-0x0;var _0x3a0848=_0xadb5[_0x2a0655];return _0x3a0848;};'use strict';var util=require('util');var logger=require(_0x5adb('0x0'))('api');var APIError=function(_0x3d6340,_0x38f67f){this[_0x5adb('0x1')]=_0x3d6340||'Internal\x20Server\x20Error';this[_0x5adb('0x2')]=_0x38f67f||_0x5adb('0x3');util[_0x5adb('0x4')](APIError,Error);};var APIBadRequestError=function(_0x4cb1d1){this[_0x5adb('0x1')]=_0x4cb1d1||_0x5adb('0x5');this[_0x5adb('0x2')]=_0x5adb('0x5');util[_0x5adb('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x353885){this[_0x5adb('0x1')]=_0x353885||_0x5adb('0x6');this[_0x5adb('0x2')]=_0x5adb('0x7');util[_0x5adb('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x336bad){this[_0x5adb('0x1')]=_0x336bad||_0x5adb('0x8');this['name']='Out\x20Of\x20Interval';util[_0x5adb('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1ea238){switch(_0x1ea238){case _0x5adb('0x5'):return 0x190;case'Forbidden',_0x5adb('0x9'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x2a0b70){if(_0x2a0b70==='Out\x20Of\x20Interval')return _0x2a0b70;return null;}function handleError(_0x8cfcc6){return function(_0x39a0b3){logger[_0x5adb('0xa')](_0x39a0b3['stack']);var _0x2a545b=getStatusCode(_0x39a0b3[_0x5adb('0x2')]);var _0xf82f72=getCustomStatusMessage(_0x39a0b3['name']);if(_0x39a0b3[_0x5adb('0x2')])delete _0x39a0b3['name'];if(_0xf82f72)_0x8cfcc6[_0x5adb('0xb')]=_0xf82f72;return _0x8cfcc6[_0x5adb('0xc')](_0x2a545b)[_0x5adb('0xd')](_0x39a0b3);};}module[_0x5adb('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xadb5=['Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error','statusMessage','status','send','exports','../config/logger','message','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found'];(function(_0x5c70ad,_0x57bed4){var _0x1bba68=function(_0x384547){while(--_0x384547){_0x5c70ad['push'](_0x5c70ad['shift']());}};_0x1bba68(++_0x57bed4);}(_0xadb5,0xad));var _0x5adb=function(_0x3a9850,_0x47535a){_0x3a9850=_0x3a9850-0x0;var _0x52ec1d=_0xadb5[_0x3a9850];return _0x52ec1d;};'use strict';var util=require('util');var logger=require(_0x5adb('0x0'))('api');var APIError=function(_0x3d6340,_0x38f67f){this[_0x5adb('0x1')]=_0x3d6340||'Internal\x20Server\x20Error';this[_0x5adb('0x2')]=_0x38f67f||_0x5adb('0x3');util[_0x5adb('0x4')](APIError,Error);};var APIBadRequestError=function(_0x4cb1d1){this[_0x5adb('0x1')]=_0x4cb1d1||_0x5adb('0x5');this[_0x5adb('0x2')]=_0x5adb('0x5');util[_0x5adb('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x353885){this[_0x5adb('0x1')]=_0x353885||_0x5adb('0x6');this[_0x5adb('0x2')]=_0x5adb('0x7');util[_0x5adb('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x336bad){this[_0x5adb('0x1')]=_0x336bad||_0x5adb('0x8');this['name']='Out\x20Of\x20Interval';util[_0x5adb('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1ea238){switch(_0x1ea238){case _0x5adb('0x5'):return 0x190;case'Forbidden',_0x5adb('0x9'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x2a0b70){if(_0x2a0b70==='Out\x20Of\x20Interval')return _0x2a0b70;return null;}function handleError(_0x8cfcc6){return function(_0x39a0b3){logger[_0x5adb('0xa')](_0x39a0b3['stack']);var _0x2a545b=getStatusCode(_0x39a0b3[_0x5adb('0x2')]);var _0xf82f72=getCustomStatusMessage(_0x39a0b3['name']);if(_0x39a0b3[_0x5adb('0x2')])delete _0x39a0b3['name'];if(_0xf82f72)_0x8cfcc6[_0x5adb('0xb')]=_0xf82f72;return _0x8cfcc6[_0x5adb('0xc')](_0x2a545b)[_0x5adb('0xd')](_0x39a0b3);};}module[_0x5adb('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 455d8f3..a386414 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa316=['status','json','send','404'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa316,0x1af));var _0x6a31=function(_0x496260,_0x154c1d){_0x496260=_0x496260-0x0;var _0x9696ef=_0xa316[_0x496260];return _0x9696ef;};'use strict';module['exports'][0x194]=function pageNotFound(_0x53c492,_0x2f7a34){var _0x2f472d=_0x6a31('0x0');var _0x19ae27=0x194;var _0x18e2c1={'status':_0x19ae27};_0x2f7a34[_0x6a31('0x1')](_0x18e2c1[_0x6a31('0x1')]);_0x2f7a34['render'](_0x2f472d,{},function(_0x22baee,_0xa0b9e2){if(_0x22baee){return _0x2f7a34[_0x6a31('0x1')](_0x18e2c1[_0x6a31('0x1')])[_0x6a31('0x2')](_0x18e2c1);}_0x2f7a34[_0x6a31('0x3')](_0xa0b9e2);});}; \ No newline at end of file +var _0xb4c3=['exports','404','status','json'];(function(_0x25e109,_0x6ab24c){var _0xc0f7d6=function(_0x2fb92b){while(--_0x2fb92b){_0x25e109['push'](_0x25e109['shift']());}};_0xc0f7d6(++_0x6ab24c);}(_0xb4c3,0x1c8));var _0x3b4c=function(_0x405d13,_0x250743){_0x405d13=_0x405d13-0x0;var _0x29e353=_0xb4c3[_0x405d13];return _0x29e353;};'use strict';module[_0x3b4c('0x0')][0x194]=function pageNotFound(_0x136c7c,_0x2fdcaf){var _0xab8387=_0x3b4c('0x1');var _0x26f72e=0x194;var _0x56b2e2={'status':_0x26f72e};_0x2fdcaf[_0x3b4c('0x2')](_0x56b2e2['status']);_0x2fdcaf['render'](_0xab8387,{},function(_0x377328,_0x23df2b){if(_0x377328){return _0x2fdcaf['status'](_0x56b2e2[_0x3b4c('0x2')])[_0x3b4c('0x3')](_0x56b2e2);}_0x2fdcaf['send'](_0x23df2b);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 4e62303..1f4be53 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','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','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x52096b,_0x20bab4){var _0x2b1cc7=function(_0x3f7021){while(--_0x3f7021){_0x52096b['push'](_0x52096b['shift']());}};_0x2b1cc7(++_0x20bab4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','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','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x3ff685,_0x304b9e){var _0x2046c9=function(_0x7a10e9){while(--_0x7a10e9){_0x3ff685['push'](_0x3ff685['shift']());}};_0x2046c9(++_0x304b9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index d870908..334e509 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea1a=['/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./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/realtime','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','/www','root','/demo','/snippet','snippet','3.5.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/smsAccount','/api/sms/applications','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./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/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0xea1a,0x158));var _0xaea1=function(_0x3f98af,_0xd3f14f){_0x3f98af=_0x3f98af-0x0;var _0x3f3e76=_0xea1a[_0x3f98af];return _0x3f3e76;};'use strict';var path=require(_0xaea1('0x0'));var express=require(_0xaea1('0x1'));var errors=require(_0xaea1('0x2'));var config=require(_0xaea1('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0xaea1('0x4')];var clientSideLogs=require(_0xaea1('0x5'));exports[_0xaea1('0x6')]=function(_0x4584dd){return setupLoggers(_0x4584dd)[_0xaea1('0x7')](function(){_0x4584dd[_0xaea1('0x8')](_0xaea1('0x9'),require(_0xaea1('0xa')));_0x4584dd['use'](_0xaea1('0xb'),require(_0xaea1('0xc')));_0x4584dd[_0xaea1('0x8')]('/api/voice/contexts',require(_0xaea1('0xd')));_0x4584dd['use'](_0xaea1('0xe'),require('./api/voiceExtension'));_0x4584dd[_0xaea1('0x8')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x4584dd['use'](_0xaea1('0xf'),require('./api/voiceQueue'));_0x4584dd['use'](_0xaea1('0x10'),require(_0xaea1('0x11')));_0x4584dd['use'](_0xaea1('0x12'),require(_0xaea1('0x13')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x14'),require(_0xaea1('0x15')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x16'),require('./api/voiceMailMessage'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x17'),require(_0xaea1('0x18')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x19'),require(_0xaea1('0x1a')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x1b'),require(_0xaea1('0x1c')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x1d'),require(_0xaea1('0x1e')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x1f'),require(_0xaea1('0x20')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x21'),require(_0xaea1('0x22')));_0x4584dd['use'](_0xaea1('0x23'),require('./api/voiceTransferReport'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x24'),require(_0xaea1('0x25')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x26'),require(_0xaea1('0x27')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x28'),require(_0xaea1('0x29')));_0x4584dd[_0xaea1('0x8')]('/api/mail/substatuses',require(_0xaea1('0x2a')));_0x4584dd['use']('/api/mail/interactions',require('./api/mailInteraction'));_0x4584dd['use'](_0xaea1('0x2b'),require('./api/mailMessage'));_0x4584dd['use'](_0xaea1('0x2c'),require(_0xaea1('0x2d')));_0x4584dd[_0xaea1('0x8')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x2e'),require(_0xaea1('0x2f')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x30'),require('./api/dashboardItem'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x31'),require(_0xaea1('0x32')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x33'),require(_0xaea1('0x34')));_0x4584dd[_0xaea1('0x8')]('/api/fax/interactions',require(_0xaea1('0x35')));_0x4584dd['use'](_0xaea1('0x36'),require(_0xaea1('0x37')));_0x4584dd['use'](_0xaea1('0x38'),require(_0xaea1('0x39')));_0x4584dd['use'](_0xaea1('0x3a'),require('./api/faxQueueReport'));_0x4584dd['use']('/api/sms/accounts',require(_0xaea1('0x3b')));_0x4584dd['use'](_0xaea1('0x3c'),require('./api/smsApplication'));_0x4584dd[_0xaea1('0x8')]('/api/sms/interactions',require(_0xaea1('0x3d')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x3e'),require(_0xaea1('0x3f')));_0x4584dd[_0xaea1('0x8')]('/api/sms/queues',require(_0xaea1('0x40')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x41'),require(_0xaea1('0x42')));_0x4584dd['use'](_0xaea1('0x43'),require(_0xaea1('0x44')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x45'),require(_0xaea1('0x46')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x47'),require(_0xaea1('0x48')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x49'),require(_0xaea1('0x4a')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x4b'),require(_0xaea1('0x4c')));_0x4584dd['use']('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x4584dd[_0xaea1('0x8')]('/api/chat/applications',require(_0xaea1('0x4d')));_0x4584dd[_0xaea1('0x8')]('/api/chat/interactions',require(_0xaea1('0x4e')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x4f'),require(_0xaea1('0x50')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x51'),require(_0xaea1('0x52')));_0x4584dd[_0xaea1('0x8')]('/api/chat/queues',require(_0xaea1('0x53')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x54'),require(_0xaea1('0x55')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x56'),require(_0xaea1('0x57')));_0x4584dd['use'](_0xaea1('0x58'),require(_0xaea1('0x59')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x5a'),require(_0xaea1('0x5b')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x5c'),require(_0xaea1('0x5d')));_0x4584dd[_0xaea1('0x8')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x4584dd[_0xaea1('0x8')]('/api/cm/hopper_final',require(_0xaea1('0x5e')));_0x4584dd['use'](_0xaea1('0x5f'),require(_0xaea1('0x60')));_0x4584dd[_0xaea1('0x8')]('/api/cm/custom_fields',require(_0xaea1('0x61')));_0x4584dd['use'](_0xaea1('0x62'),require(_0xaea1('0x63')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x64'),require(_0xaea1('0x65')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x66'),require(_0xaea1('0x67')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x68'),require(_0xaea1('0x69')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x6a'),require(_0xaea1('0x6b')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x6c'),require(_0xaea1('0x6d')));_0x4584dd[_0xaea1('0x8')]('/api/pauses',require('./api/pause'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x6e'),require(_0xaea1('0x6f')));_0x4584dd[_0xaea1('0x8')]('/api/voiceQueuesLog',require(_0xaea1('0x70')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x71'),require(_0xaea1('0x72')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x73'),require(_0xaea1('0x74')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x75'),require('./api/tag'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x76'),require('./api/contactItemType'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x77'),require(_0xaea1('0x78')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x79'),require(_0xaea1('0x7a')));_0x4584dd['use'](_0xaea1('0x7b'),require(_0xaea1('0x7c')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x7d'),require(_0xaea1('0x7e')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x7f'),require('./api/variable'));_0x4584dd['use'](_0xaea1('0x80'),require(_0xaea1('0x81')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x82'),require(_0xaea1('0x83')));_0x4584dd['use'](_0xaea1('0x84'),require('./api/analyticCustomReport'));_0x4584dd[_0xaea1('0x8')]('/api/analytics/default_reports',require(_0xaea1('0x85')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x86'),require(_0xaea1('0x87')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x88'),require(_0xaea1('0x89')));_0x4584dd[_0xaea1('0x8')]('/api/analytics/field_reports',require(_0xaea1('0x8a')));_0x4584dd['use'](_0xaea1('0x8b'),require(_0xaea1('0x8c')));_0x4584dd[_0xaea1('0x8')]('/api/integrations/salesforce/accounts',require(_0xaea1('0x8d')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x8e'),require('./api/intSalesforceConfiguration'));_0x4584dd['use'](_0xaea1('0x8f'),require(_0xaea1('0x90')));_0x4584dd[_0xaea1('0x8')]('/api/integrations/sugarcrm/accounts',require(_0xaea1('0x91')));_0x4584dd['use'](_0xaea1('0x92'),require(_0xaea1('0x93')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x94'),require(_0xaea1('0x95')));_0x4584dd['use']('/api/integrations/desk/accounts',require(_0xaea1('0x96')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x97'),require(_0xaea1('0x98')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x99'),require(_0xaea1('0x9a')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x9b'),require(_0xaea1('0x9c')));_0x4584dd[_0xaea1('0x8')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x4584dd[_0xaea1('0x8')]('/api/integrations/zoho/fields',require(_0xaea1('0x9d')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x9e'),require('./api/intZendeskAccount'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x9f'),require(_0xaea1('0xa0')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xa1'),require('./api/intZendeskField'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xa2'),require(_0xaea1('0xa3')));_0x4584dd['use'](_0xaea1('0xa4'),require('./api/intFreshdeskConfiguration'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xa5'),require(_0xaea1('0xa6')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xa7'),require(_0xaea1('0xa8')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xa9'),require(_0xaea1('0xaa')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xab'),require(_0xaea1('0xac')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xad'),require(_0xaea1('0xae')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xaf'),require(_0xaea1('0xb0')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xb1'),require(_0xaea1('0xb2')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xb3'),require(_0xaea1('0xb4')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xb5'),require(_0xaea1('0xb6')));_0x4584dd['use'](_0xaea1('0xb7'),require(_0xaea1('0xb8')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xb9'),require(_0xaea1('0xba')));_0x4584dd['use'](_0xaea1('0xbb'),require(_0xaea1('0xbc')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xbd'),require(_0xaea1('0xbe')));_0x4584dd['use'](_0xaea1('0xbf'),require('./api/network'));_0x4584dd['use'](_0xaea1('0xc0'),require(_0xaea1('0xc1')));_0x4584dd[_0xaea1('0x8')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xc2'),require(_0xaea1('0xc3')));_0x4584dd['use'](_0xaea1('0xc4'),require(_0xaea1('0xc5')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xc6'),require(_0xaea1('0xc7')));_0x4584dd['use'](_0xaea1('0xc8'),require(_0xaea1('0xc9')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xca'),require('./api/squareReport'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xcb'),require('./api/squareReportDetail'));_0x4584dd[_0xaea1('0x8')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x4584dd[_0xaea1('0x8')]('/api/settings',require('./api/setting'));_0x4584dd['use'](_0xaea1('0xcc'),require(_0xaea1('0xcd')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xce'),require('./api/squareProject'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xcf'),require(_0xaea1('0xd0')));_0x4584dd[_0xaea1('0x8')]('/api/square/messages',require(_0xaea1('0xd1')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xd2'),require('./api/team'));_0x4584dd[_0xaea1('0x8')]('/api/license',require(_0xaea1('0xd3')));_0x4584dd['use'](_0xaea1('0xd4'),require(_0xaea1('0xd5')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xd6'),require('./api/migration'));_0x4584dd[_0xaea1('0x8')]('/api/attachments',require(_0xaea1('0xd7')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xd8'),require(_0xaea1('0xd9')));_0x4584dd['use']('/api/mail/reports/transfer',require(_0xaea1('0xda')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xdb'),require(_0xaea1('0xdc')));_0x4584dd[_0xaea1('0x8')]('/api/fax/reports/transfer',require(_0xaea1('0xdd')));_0x4584dd['use'](_0xaea1('0xde'),require(_0xaea1('0xdf')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xe0'),require(_0xaea1('0xe1')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xe2'),require(_0xaea1('0xe3')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xe4'),require(_0xaea1('0xe5')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xe6'),require('./api/userProfile'));_0x4584dd[_0xaea1('0x8')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xe7'),require(_0xaea1('0xe8')));_0x4584dd['use'](_0xaea1('0xe9'),require('./api/userNotification'));_0x4584dd[_0xaea1('0x8')]('/api/whatsapp/accounts',require(_0xaea1('0xea')));_0x4584dd['use'](_0xaea1('0xeb'),require(_0xaea1('0xec')));_0x4584dd['use'](_0xaea1('0xed'),require(_0xaea1('0xee')));_0x4584dd[_0xaea1('0x8')]('/api/whatsapp/messages',require(_0xaea1('0xef')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xf0'),require(_0xaea1('0xf1')));_0x4584dd['use'](_0xaea1('0xf2'),require(_0xaea1('0xf3')));_0x4584dd['use'](_0xaea1('0xf4'),require(_0xaea1('0xf5')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xf6'),require(_0xaea1('0xf7')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xf8'),require(_0xaea1('0xf9')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xfa'),require('./api/user-setting'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xfb'),require(_0xaea1('0xfc')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xfd'),require('./api/authGoogle'));_0x4584dd['use'](_0xaea1('0xfe'),require(_0xaea1('0xff')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x100'),require(_0xaea1('0x101')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x102'),require(_0xaea1('0x103')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x104'),require(_0xaea1('0x105')));_0x4584dd[_0xaea1('0x8')]('/api/system',require(_0xaea1('0x106')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x107'),require('./api/pm2'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x108'),require(_0xaea1('0x109')));_0x4584dd['use'](_0xaea1('0x10a'),clientSideLogs);_0x4584dd[_0xaea1('0x8')](_0xaea1('0x10b'),express[_0xaea1('0x10c')](path[_0xaea1('0x10d')](config['root'],'/apidoc')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x10e'),express[_0xaea1('0x10c')](path[_0xaea1('0x10d')](config[_0xaea1('0x10f')],_0xaea1('0x10e'))));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x110'),express[_0xaea1('0x10c')](path['join'](config[_0xaea1('0x10f')],_0xaea1('0x110'))));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x111'),express['static'](path[_0xaea1('0x10d')](config[_0xaea1('0x10f')],_0xaea1('0x112'),_0xaea1('0x113'))));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x114'),express[_0xaea1('0x10c')](path[_0xaea1('0x10d')](config[_0xaea1('0x10f')],_0xaea1('0x115'))));_0x4584dd[_0xaea1('0x116')](_0xaea1('0x117'))['get'](errors[0x194]);_0x4584dd[_0xaea1('0x116')]('/*')[_0xaea1('0x118')](function(_0x3d4072,_0x397aff){_0x397aff[_0xaea1('0x119')](path[_0xaea1('0x11a')](_0x4584dd['get'](_0xaea1('0x11b'))+_0xaea1('0x11c')));});return _0x4584dd;});}; \ No newline at end of file +var _0x833b=['./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.5.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','sendFile','resolve','get','/index.html','express','./config/environment','setupLoggers','default','then','use','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/screen/recordings','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceQueueReport','./api/memberReport','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','/api/dashboards','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','./api/campaign','./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/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','/api/userProfile/resources','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x833b,0x131));var _0xb833=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x833b[_0x5a9c0c];return _0x53c77d;};'use strict';var path=require('path');var express=require(_0xb833('0x0'));var errors=require('./errors');var config=require(_0xb833('0x1'));var setupLoggers=require('./utils/client-side-logger')[_0xb833('0x2')];var clientSideLogs=require('./api/client-side-logs');exports[_0xb833('0x3')]=function(_0x37ea87){return setupLoggers(_0x37ea87)[_0xb833('0x4')](function(){_0x37ea87[_0xb833('0x5')](_0xb833('0x6'),require(_0xb833('0x7')));_0x37ea87[_0xb833('0x5')]('/api/voice/chanspy',require(_0xb833('0x8')));_0x37ea87[_0xb833('0x5')](_0xb833('0x9'),require(_0xb833('0xa')));_0x37ea87[_0xb833('0x5')](_0xb833('0xb'),require(_0xb833('0xc')));_0x37ea87['use'](_0xb833('0xd'),require('./api/voiceMusicOnHold'));_0x37ea87[_0xb833('0x5')](_0xb833('0xe'),require(_0xb833('0xf')));_0x37ea87[_0xb833('0x5')]('/api/voice/recordings',require('./api/voiceRecording'));_0x37ea87[_0xb833('0x5')](_0xb833('0x10'),require('./api/screenRecording'));_0x37ea87[_0xb833('0x5')]('/api/voice/mails',require(_0xb833('0x11')));_0x37ea87[_0xb833('0x5')](_0xb833('0x12'),require(_0xb833('0x13')));_0x37ea87[_0xb833('0x5')](_0xb833('0x14'),require(_0xb833('0x15')));_0x37ea87[_0xb833('0x5')]('/api/voice/dials/reports',require(_0xb833('0x16')));_0x37ea87[_0xb833('0x5')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x37ea87[_0xb833('0x5')]('/api/voice/queues/reports',require(_0xb833('0x17')));_0x37ea87[_0xb833('0x5')]('/api/members/reports',require(_0xb833('0x18')));_0x37ea87[_0xb833('0x5')]('/api/trunks',require(_0xb833('0x19')));_0x37ea87[_0xb833('0x5')](_0xb833('0x1a'),require('./api/voiceTransferReport'));_0x37ea87[_0xb833('0x5')](_0xb833('0x1b'),require(_0xb833('0x1c')));_0x37ea87[_0xb833('0x5')]('/api/mail/accounts',require('./api/mailAccount'));_0x37ea87[_0xb833('0x5')](_0xb833('0x1d'),require(_0xb833('0x1e')));_0x37ea87[_0xb833('0x5')](_0xb833('0x1f'),require(_0xb833('0x20')));_0x37ea87['use'](_0xb833('0x21'),require('./api/mailInteraction'));_0x37ea87['use']('/api/mail/messages',require(_0xb833('0x22')));_0x37ea87[_0xb833('0x5')](_0xb833('0x23'),require('./api/mailApplication'));_0x37ea87[_0xb833('0x5')](_0xb833('0x24'),require('./api/mailQueueReport'));_0x37ea87[_0xb833('0x5')](_0xb833('0x25'),require('./api/dashboard'));_0x37ea87[_0xb833('0x5')]('/api/dashboards/items',require(_0xb833('0x26')));_0x37ea87[_0xb833('0x5')](_0xb833('0x27'),require('./api/faxAccount'));_0x37ea87[_0xb833('0x5')](_0xb833('0x28'),require(_0xb833('0x29')));_0x37ea87['use'](_0xb833('0x2a'),require(_0xb833('0x2b')));_0x37ea87[_0xb833('0x5')]('/api/fax/messages',require('./api/faxMessage'));_0x37ea87[_0xb833('0x5')]('/api/fax/queues',require(_0xb833('0x2c')));_0x37ea87[_0xb833('0x5')](_0xb833('0x2d'),require(_0xb833('0x2e')));_0x37ea87[_0xb833('0x5')](_0xb833('0x2f'),require('./api/smsAccount'));_0x37ea87['use'](_0xb833('0x30'),require(_0xb833('0x31')));_0x37ea87[_0xb833('0x5')](_0xb833('0x32'),require(_0xb833('0x33')));_0x37ea87[_0xb833('0x5')]('/api/sms/messages',require('./api/smsMessage'));_0x37ea87['use'](_0xb833('0x34'),require(_0xb833('0x35')));_0x37ea87[_0xb833('0x5')](_0xb833('0x36'),require(_0xb833('0x37')));_0x37ea87[_0xb833('0x5')](_0xb833('0x38'),require(_0xb833('0x39')));_0x37ea87[_0xb833('0x5')](_0xb833('0x3a'),require(_0xb833('0x3b')));_0x37ea87[_0xb833('0x5')](_0xb833('0x3c'),require('./api/openchannelMessage'));_0x37ea87[_0xb833('0x5')]('/api/openchannel/queues',require(_0xb833('0x3d')));_0x37ea87['use'](_0xb833('0x3e'),require('./api/chatWebsite'));_0x37ea87[_0xb833('0x5')](_0xb833('0x3f'),require(_0xb833('0x40')));_0x37ea87[_0xb833('0x5')]('/api/chat/applications',require(_0xb833('0x41')));_0x37ea87[_0xb833('0x5')](_0xb833('0x42'),require('./api/chatInteraction'));_0x37ea87[_0xb833('0x5')](_0xb833('0x43'),require(_0xb833('0x44')));_0x37ea87[_0xb833('0x5')](_0xb833('0x45'),require(_0xb833('0x46')));_0x37ea87[_0xb833('0x5')](_0xb833('0x47'),require(_0xb833('0x48')));_0x37ea87[_0xb833('0x5')]('/api/chat/groups',require(_0xb833('0x49')));_0x37ea87[_0xb833('0x5')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x37ea87[_0xb833('0x5')]('/api/cm/companies',require(_0xb833('0x4a')));_0x37ea87['use'](_0xb833('0x4b'),require(_0xb833('0x4c')));_0x37ea87[_0xb833('0x5')](_0xb833('0x4d'),require(_0xb833('0x4e')));_0x37ea87[_0xb833('0x5')]('/api/cm/hopper_black',require(_0xb833('0x4f')));_0x37ea87['use'](_0xb833('0x50'),require(_0xb833('0x51')));_0x37ea87[_0xb833('0x5')]('/api/cm/hopper_history',require(_0xb833('0x52')));_0x37ea87[_0xb833('0x5')](_0xb833('0x53'),require(_0xb833('0x54')));_0x37ea87['use']('/api/actions',require(_0xb833('0x55')));_0x37ea87[_0xb833('0x5')](_0xb833('0x56'),require(_0xb833('0x57')));_0x37ea87[_0xb833('0x5')](_0xb833('0x58'),require(_0xb833('0x59')));_0x37ea87['use'](_0xb833('0x5a'),require(_0xb833('0x5b')));_0x37ea87[_0xb833('0x5')]('/api/conditions',require('./api/condition'));_0x37ea87[_0xb833('0x5')]('/api/intervals',require(_0xb833('0x5c')));_0x37ea87[_0xb833('0x5')]('/api/pauses',require(_0xb833('0x5d')));_0x37ea87[_0xb833('0x5')](_0xb833('0x5e'),require(_0xb833('0x5f')));_0x37ea87[_0xb833('0x5')](_0xb833('0x60'),require('./api/voiceQueuesLog'));_0x37ea87[_0xb833('0x5')](_0xb833('0x61'),require(_0xb833('0x62')));_0x37ea87['use'](_0xb833('0x63'),require(_0xb833('0x64')));_0x37ea87[_0xb833('0x5')]('/api/tags',require('./api/tag'));_0x37ea87[_0xb833('0x5')]('/api/contact_item_types',require('./api/contactItemType'));_0x37ea87[_0xb833('0x5')](_0xb833('0x65'),require(_0xb833('0x66')));_0x37ea87['use'](_0xb833('0x67'),require(_0xb833('0x68')));_0x37ea87[_0xb833('0x5')](_0xb833('0x69'),require(_0xb833('0x6a')));_0x37ea87['use'](_0xb833('0x6b'),require('./api/trigger'));_0x37ea87[_0xb833('0x5')](_0xb833('0x6c'),require(_0xb833('0x6d')));_0x37ea87['use'](_0xb833('0x6e'),require(_0xb833('0x6f')));_0x37ea87[_0xb833('0x5')]('/api/integrations/reports',require('./api/integrationReport'));_0x37ea87['use'](_0xb833('0x70'),require('./api/analyticCustomReport'));_0x37ea87[_0xb833('0x5')](_0xb833('0x71'),require(_0xb833('0x72')));_0x37ea87[_0xb833('0x5')]('/api/analytics/extracted_reports',require(_0xb833('0x73')));_0x37ea87[_0xb833('0x5')](_0xb833('0x74'),require(_0xb833('0x75')));_0x37ea87[_0xb833('0x5')](_0xb833('0x76'),require(_0xb833('0x77')));_0x37ea87[_0xb833('0x5')]('/api/analytics/tree_reports',require(_0xb833('0x78')));_0x37ea87[_0xb833('0x5')](_0xb833('0x79'),require(_0xb833('0x7a')));_0x37ea87['use'](_0xb833('0x7b'),require('./api/intSalesforceConfiguration'));_0x37ea87[_0xb833('0x5')](_0xb833('0x7c'),require('./api/intSalesforceField'));_0x37ea87[_0xb833('0x5')](_0xb833('0x7d'),require(_0xb833('0x7e')));_0x37ea87[_0xb833('0x5')](_0xb833('0x7f'),require('./api/intSugarcrmConfiguration'));_0x37ea87[_0xb833('0x5')](_0xb833('0x80'),require('./api/intSugarcrmField'));_0x37ea87[_0xb833('0x5')]('/api/integrations/desk/accounts',require(_0xb833('0x81')));_0x37ea87[_0xb833('0x5')](_0xb833('0x82'),require(_0xb833('0x83')));_0x37ea87[_0xb833('0x5')](_0xb833('0x84'),require(_0xb833('0x85')));_0x37ea87['use']('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x37ea87[_0xb833('0x5')](_0xb833('0x86'),require(_0xb833('0x87')));_0x37ea87['use'](_0xb833('0x88'),require('./api/intZohoField'));_0x37ea87[_0xb833('0x5')](_0xb833('0x89'),require(_0xb833('0x8a')));_0x37ea87[_0xb833('0x5')](_0xb833('0x8b'),require(_0xb833('0x8c')));_0x37ea87[_0xb833('0x5')](_0xb833('0x8d'),require(_0xb833('0x8e')));_0x37ea87[_0xb833('0x5')](_0xb833('0x8f'),require(_0xb833('0x90')));_0x37ea87[_0xb833('0x5')](_0xb833('0x91'),require(_0xb833('0x92')));_0x37ea87[_0xb833('0x5')](_0xb833('0x93'),require(_0xb833('0x94')));_0x37ea87[_0xb833('0x5')]('/api/integrations/vtiger/accounts',require(_0xb833('0x95')));_0x37ea87[_0xb833('0x5')]('/api/integrations/vtiger/configurations',require(_0xb833('0x96')));_0x37ea87[_0xb833('0x5')](_0xb833('0x97'),require('./api/intVtigerField'));_0x37ea87['use']('/api/integrations/servicenow/accounts',require(_0xb833('0x98')));_0x37ea87[_0xb833('0x5')](_0xb833('0x99'),require('./api/intServicenowConfiguration'));_0x37ea87['use'](_0xb833('0x9a'),require(_0xb833('0x9b')));_0x37ea87[_0xb833('0x5')](_0xb833('0x9c'),require('./api/intDynamics365Account'));_0x37ea87[_0xb833('0x5')](_0xb833('0x9d'),require(_0xb833('0x9e')));_0x37ea87[_0xb833('0x5')](_0xb833('0x9f'),require(_0xb833('0xa0')));_0x37ea87[_0xb833('0x5')]('/api/integrations/freshsales/accounts',require(_0xb833('0xa1')));_0x37ea87[_0xb833('0x5')](_0xb833('0xa2'),require(_0xb833('0xa3')));_0x37ea87[_0xb833('0x5')](_0xb833('0xa4'),require(_0xb833('0xa5')));_0x37ea87[_0xb833('0x5')](_0xb833('0xa6'),require(_0xb833('0xa7')));_0x37ea87[_0xb833('0x5')]('/api/chat/reports/queue',require(_0xb833('0xa8')));_0x37ea87[_0xb833('0x5')](_0xb833('0xa9'),require(_0xb833('0xaa')));_0x37ea87[_0xb833('0x5')]('/api/jscripty/answers/reports',require(_0xb833('0xab')));_0x37ea87[_0xb833('0x5')](_0xb833('0xac'),require(_0xb833('0xad')));_0x37ea87[_0xb833('0x5')](_0xb833('0xae'),require(_0xb833('0xaf')));_0x37ea87[_0xb833('0x5')](_0xb833('0xb0'),require(_0xb833('0xb1')));_0x37ea87[_0xb833('0x5')](_0xb833('0xb2'),require(_0xb833('0xb3')));_0x37ea87[_0xb833('0x5')]('/api/square/details/reports',require(_0xb833('0xb4')));_0x37ea87['use'](_0xb833('0xb5'),require(_0xb833('0xb6')));_0x37ea87[_0xb833('0x5')](_0xb833('0xb7'),require(_0xb833('0xb8')));_0x37ea87[_0xb833('0x5')](_0xb833('0xb9'),require('./api/squareOdbc'));_0x37ea87[_0xb833('0x5')](_0xb833('0xba'),require(_0xb833('0xbb')));_0x37ea87['use'](_0xb833('0xbc'),require(_0xb833('0xbd')));_0x37ea87['use']('/api/square/messages',require(_0xb833('0xbe')));_0x37ea87[_0xb833('0x5')](_0xb833('0xbf'),require(_0xb833('0xc0')));_0x37ea87[_0xb833('0x5')](_0xb833('0xc1'),require(_0xb833('0xc2')));_0x37ea87['use']('/api/campaigns',require(_0xb833('0xc3')));_0x37ea87[_0xb833('0x5')]('/api/migrations',require(_0xb833('0xc4')));_0x37ea87['use'](_0xb833('0xc5'),require(_0xb833('0xc6')));_0x37ea87[_0xb833('0x5')](_0xb833('0xc7'),require(_0xb833('0xc8')));_0x37ea87[_0xb833('0x5')](_0xb833('0xc9'),require(_0xb833('0xca')));_0x37ea87['use'](_0xb833('0xcb'),require(_0xb833('0xcc')));_0x37ea87[_0xb833('0x5')](_0xb833('0xcd'),require(_0xb833('0xce')));_0x37ea87['use'](_0xb833('0xcf'),require(_0xb833('0xd0')));_0x37ea87[_0xb833('0x5')](_0xb833('0xd1'),require('./api/smsTransferReport'));_0x37ea87['use'](_0xb833('0xd2'),require(_0xb833('0xd3')));_0x37ea87['use'](_0xb833('0xd4'),require(_0xb833('0xd5')));_0x37ea87[_0xb833('0x5')](_0xb833('0xd6'),require('./api/userProfile'));_0x37ea87[_0xb833('0x5')](_0xb833('0xd7'),require('./api/userProfileSection'));_0x37ea87[_0xb833('0x5')](_0xb833('0xd8'),require('./api/userProfileResource'));_0x37ea87['use'](_0xb833('0xd9'),require(_0xb833('0xda')));_0x37ea87['use']('/api/whatsapp/accounts',require(_0xb833('0xdb')));_0x37ea87['use'](_0xb833('0xdc'),require(_0xb833('0xdd')));_0x37ea87[_0xb833('0x5')]('/api/whatsapp/interactions',require(_0xb833('0xde')));_0x37ea87[_0xb833('0x5')]('/api/whatsapp/messages',require(_0xb833('0xdf')));_0x37ea87['use'](_0xb833('0xe0'),require(_0xb833('0xe1')));_0x37ea87[_0xb833('0x5')](_0xb833('0xe2'),require(_0xb833('0xe3')));_0x37ea87[_0xb833('0x5')](_0xb833('0xe4'),require(_0xb833('0xe5')));_0x37ea87['use'](_0xb833('0xe6'),require(_0xb833('0xe7')));_0x37ea87['use'](_0xb833('0xe8'),require(_0xb833('0xe9')));_0x37ea87[_0xb833('0x5')]('/api/user-settings',require('./api/user-setting'));_0x37ea87[_0xb833('0x5')]('/api/auth/local',require(_0xb833('0xea')));_0x37ea87['use'](_0xb833('0xeb'),require(_0xb833('0xec')));_0x37ea87['use'](_0xb833('0xed'),require('./api/authActiveDirectory'));_0x37ea87['use']('/api/jira',require(_0xb833('0xee')));_0x37ea87[_0xb833('0x5')](_0xb833('0xef'),require(_0xb833('0xf0')));_0x37ea87[_0xb833('0x5')](_0xb833('0xf1'),require(_0xb833('0xf2')));_0x37ea87[_0xb833('0x5')]('/api/system',require(_0xb833('0xf3')));_0x37ea87[_0xb833('0x5')](_0xb833('0xf4'),require('./api/pm2'));_0x37ea87['use'](_0xb833('0xf5'),require(_0xb833('0xf6')));_0x37ea87[_0xb833('0x5')](_0xb833('0xf7'),clientSideLogs);_0x37ea87[_0xb833('0x5')](_0xb833('0xf8'),express[_0xb833('0xf9')](path['join'](config[_0xb833('0xfa')],_0xb833('0xf8'))));_0x37ea87[_0xb833('0x5')](_0xb833('0xfb'),express[_0xb833('0xf9')](path[_0xb833('0xfc')](config[_0xb833('0xfa')],_0xb833('0xfb'))));_0x37ea87[_0xb833('0x5')](_0xb833('0xfd'),express['static'](path['join'](config[_0xb833('0xfa')],_0xb833('0xfd'))));_0x37ea87[_0xb833('0x5')](_0xb833('0xfe'),express[_0xb833('0xf9')](path['join'](config['root'],_0xb833('0xff'),_0xb833('0x100'))));_0x37ea87[_0xb833('0x5')](_0xb833('0x101'),express[_0xb833('0xf9')](path[_0xb833('0xfc')](config[_0xb833('0xfa')],_0xb833('0x102'))));_0x37ea87[_0xb833('0x103')](_0xb833('0x104'))['get'](errors[0x194]);_0x37ea87[_0xb833('0x103')]('/*')['get'](function(_0x1d868f,_0x363d66){_0x363d66[_0xb833('0x105')](path[_0xb833('0x106')](_0x37ea87[_0xb833('0x107')]('appPath')+_0xb833('0x108')));});return _0x37ea87;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 6635a2a..0a870c4 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c1f=['../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.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/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','error','log','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc'];(function(_0x1a0557,_0x2a0db7){var _0x1ad015=function(_0x34316){while(--_0x34316){_0x1a0557['push'](_0x1a0557['shift']());}};_0x1ad015(++_0x2a0db7);}(_0x7c1f,0x194));var _0xf7c1=function(_0x30a196,_0xd20c7d){_0x30a196=_0x30a196-0x0;var _0x4b089b=_0x7c1f[_0x30a196];return _0x4b089b;};'use strict';var jayson=require(_0xf7c1('0x0'));var _=require(_0xf7c1('0x1'));var config=require(_0xf7c1('0x2'));exports[_0xf7c1('0x3')]=function(){return new Promise(function(_0x3ca7b6,_0x568116){var _0x1e3254={};_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x5')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x6')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x7')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/voiceRecording/voiceRecording.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x8')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x9')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0xa')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0xb')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0xc')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0xd')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0xe')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0xf')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x10')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/mailAccount/mailAccount.rpc'));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x11')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x12')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/mailMessage/mailMessage.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/mailApplication/mailApplication.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x13')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x14')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/faxApplication/faxApplication.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/faxInteraction/faxInteraction.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/faxMessage/faxMessage.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x15')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x16')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x17')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x18')));_0x1e3254=_['merge'](_0x1e3254,require('../api/smsMessage/smsMessage.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x19')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x1a')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1e3254=_['merge'](_0x1e3254,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x1b')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x1c')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x1d')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x1e')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x1f')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/cmHopper/cmHopper.rpc'));_0x1e3254=_['merge'](_0x1e3254,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x20')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x21')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x22')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x23')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/pause/pause.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x24')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x25')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x26')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x27')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x28')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x29')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x2a')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x2b')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x2c')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x2d')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x2e')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x2f')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x30')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x31')));_0x1e3254=_['merge'](_0x1e3254,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x32')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x33')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x34')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x35')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/squareProject/squareProject.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/squareRecording/squareRecording.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x36')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x37')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x38')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/plugin/plugin.rpc'));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x39')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x3a')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x3b')));var _0x2a9a03=jayson[_0xf7c1('0x3c')](_0x1e3254)[_0xf7c1('0x3d')]();var _0x4f9fd4=config['rpc'][_0xf7c1('0x3e')]||config[_0xf7c1('0x3e')]+0x1;var _0x251bdc=config[_0xf7c1('0x3f')]['ip']||_0xf7c1('0x40');_0x2a9a03['on'](_0xf7c1('0x41'),function(_0x5bad53){return _0x568116(_0x5bad53);});_0x2a9a03[_0xf7c1('0x3')](_0x4f9fd4,_0x251bdc,function(){console[_0xf7c1('0x42')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x251bdc,_0x4f9fd4);require('../config/triggers')[_0xf7c1('0x43')]();return _0x3ca7b6(_0xf7c1('0x44')+_0x251bdc+':'+_0x4f9fd4);});});}; \ No newline at end of file +var _0x302c=['merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','lodash','../config/environment','listen'];(function(_0x5714c1,_0x8f8c91){var _0x2d7f8a=function(_0xc15abf){while(--_0xc15abf){_0x5714c1['push'](_0x5714c1['shift']());}};_0x2d7f8a(++_0x8f8c91);}(_0x302c,0x1d9));var _0xc302=function(_0x19c077,_0x140d50){_0x19c077=_0x19c077-0x0;var _0x505def=_0x302c[_0x19c077];return _0x505def;};'use strict';var jayson=require('jayson/promise');var _=require(_0xc302('0x0'));var config=require(_0xc302('0x1'));exports[_0xc302('0x2')]=function(){return new Promise(function(_0x420094,_0x518c19){var _0x5971eb={};_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x4')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x5')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x6')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x7')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x8')));_0x5971eb=_['merge'](_0x5971eb,require(_0xc302('0x9')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0xa')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0xb')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0xc')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0xd')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0xe')));_0x5971eb=_['merge'](_0x5971eb,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0xf')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x10')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/mailQueue/mailQueue.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x11')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x12')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x13')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x14')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x15')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x16')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/faxInteraction/faxInteraction.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/faxMessage/faxMessage.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/faxQueue/faxQueue.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x17')));_0x5971eb=_['merge'](_0x5971eb,require('../api/smsAccount/smsAccount.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/smsInteraction/smsInteraction.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x18')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x19')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x1a')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x1b')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x1c')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x5971eb=_['merge'](_0x5971eb,require(_0xc302('0x1d')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x1e')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/chatMessage/chatMessage.rpc'));_0x5971eb=_['merge'](_0x5971eb,require(_0xc302('0x1f')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x20')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x21')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x22')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x23')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x24')));_0x5971eb=_['merge'](_0x5971eb,require(_0xc302('0x25')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x26')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x27')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x28')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x29')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/trigger/trigger.rpc'));_0x5971eb=_['merge'](_0x5971eb,require(_0xc302('0x2a')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x2b')));_0x5971eb=_['merge'](_0x5971eb,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x2c')));_0x5971eb=_['merge'](_0x5971eb,require(_0xc302('0x2d')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x2e')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x5971eb=_['merge'](_0x5971eb,require(_0xc302('0x2f')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x30')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x31')));_0x5971eb=_['merge'](_0x5971eb,require(_0xc302('0x32')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x33')));_0x5971eb=_['merge'](_0x5971eb,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x34')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x35')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/squareProject/squareProject.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x36')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/squareMessage/squareMessage.rpc'));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x37')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x38')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/plugin/plugin.rpc'));_0x5971eb=_['merge'](_0x5971eb,require(_0xc302('0x39')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x5971eb=_['merge'](_0x5971eb,require(_0xc302('0x3a')));_0x5971eb=_['merge'](_0x5971eb,require(_0xc302('0x3b')));_0x5971eb=_[_0xc302('0x3')](_0x5971eb,require(_0xc302('0x3c')));var _0x1051c7=jayson['server'](_0x5971eb)[_0xc302('0x3d')]();var _0x3f4c6d=config[_0xc302('0x3e')][_0xc302('0x3f')]||config[_0xc302('0x3f')]+0x1;var _0x1c89e0=config[_0xc302('0x3e')]['ip']||'localhost';_0x1051c7['on'](_0xc302('0x40'),function(_0x4c0533){return _0x518c19(_0x4c0533);});_0x1051c7['listen'](_0x3f4c6d,_0x1c89e0,function(){console['log'](_0xc302('0x41'),_0x1c89e0,_0x3f4c6d);require(_0xc302('0x42'))['default']();return _0x420094(_0xc302('0x43')+_0x1c89e0+':'+_0x3f4c6d);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 1574a3e..e9f9a21 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 _0x9bd9=['AGI','wait','WAIT','label','exports','util','lodash','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','520-Invalid','520\x20End\x20of\x20proper','function','substring','replace','result=','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sync','sendRequest','getData','beep','noop','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi'];(function(_0x3c15bd,_0x1139a1){var _0x2b9fe4=function(_0x4c17d1){while(--_0x4c17d1){_0x3c15bd['push'](_0x3c15bd['shift']());}};_0x2b9fe4(++_0x1139a1);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x2b0d88,_0x5b5ef2){_0x2b0d88=_0x2b0d88-0x0;var _0x1c9256=_0x9bd9[_0x2b0d88];return _0x1c9256;};'use strict';var util=require(_0x99bd('0x0'));var _=require(_0x99bd('0x1'));var EventEmitter=require(_0x99bd('0x2'))[_0x99bd('0x3')];var AGIReply=require(_0x99bd('0x4'));var AGIError=require(_0x99bd('0x5'));function AGIChannel(_0x502917){var _0x34aff7=this,_0x4a0491=new AGIReply(),_0x204fbb=![],_0x1b3141={};EventEmitter['call'](_0x34aff7);_0x502917[_0x99bd('0x6')](_0x99bd('0x7'));_0x502917[_0x99bd('0x8')](0x8*0x3c*0x3c*0x3e8);_0x4a0491[_0x99bd('0x6')](_0x99bd('0x7'));_0x4a0491['on'](_0x99bd('0x9'),function(_0x3814eb){for(var _0x2c34b8 in _0x3814eb){_0x34aff7[_0x2c34b8]=_0x3814eb[_0x2c34b8];}_0x34aff7[_0x99bd('0xa')](_0x99bd('0xb'));});_0x4a0491['on'](_0x99bd('0xc'),function(_0x468b6e){if(_0x468b6e[_0x99bd('0xd')]()==_0x99bd('0xe')){_0x34aff7['emit'](_0x99bd('0xe'));return;}if(_0x468b6e['substring'](0x0,0xb)==_0x99bd('0xf')){_0x204fbb=!![];}if(_0x204fbb){_0x1b3141['rx']+=_0x468b6e+'\x0a';if(_0x468b6e['search'](_0x99bd('0x10'))!=-0x1){_0x204fbb=![];}}else{_0x1b3141['rx']=_0x468b6e;}if(_0x204fbb){return;}if(typeof _0x1b3141['cb']==_0x99bd('0x11')){var _0x4a8bd9=_0x1b3141['rx'][_0x99bd('0x12')](0x0,0x3),_0x22237c=null,_0x500cd2=null;_0x4a8bd9=parseInt(_0x4a8bd9);if(isNaN(_0x4a8bd9)){_0x1b3141['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x4a8bd9!=0xc8){_0x1b3141['cb'](null,{'code':_0x4a8bd9,'result':-0x1,'extra':'KO'});return;}_0x22237c=_0x1b3141['rx'][_0x99bd('0x12')](0x4)[_0x99bd('0x13')](_0x99bd('0x14'),'');if(_0x22237c['indexOf']('\x20')!=-0x1){_0x22237c=_0x22237c[_0x99bd('0x15')](0x0,_0x22237c[_0x99bd('0x16')]('\x20'));}if(_[_0x99bd('0x17')](_0x22237c,'-1')){_0x22237c=parseInt(_0x22237c);}_0x500cd2=_0x1b3141['rx'][_0x99bd('0x18')]('\x20');if(_0x500cd2[_0x99bd('0x19')]==0x3){_0x500cd2=_0x500cd2[0x2][_0x99bd('0x12')](0x1,_0x500cd2[0x2][_0x99bd('0x19')]-0x1);}else if(_0x500cd2[_0x99bd('0x19')]>0x3){var _0x3d3d3e=/\((.+)\)/;var _0x53a4ff=_0x1b3141['rx'][_0x99bd('0x1a')](_0x3d3d3e);if(_0x53a4ff){_0x500cd2=_0x53a4ff[0x1];}else{_0x500cd2=null;}}else{_0x500cd2=null;}_0x1b3141['cb'](null,{'code':_0x4a8bd9,'result':_0x22237c,'extra':_0x500cd2});}});_0x502917['on'](_0x99bd('0x1b'),function(_0x2fe078){_0x34aff7['emit']('error',new AGIError(_0x99bd('0x1c'),_0x2fe078[_0x99bd('0x1d')]));});_0x502917['on'](_0x99bd('0x1e'),function(){_0x34aff7[_0x99bd('0xa')](_0x99bd('0x1e'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x502917['on'](_0x99bd('0x1f'),function(){_0x34aff7['emit'](_0x99bd('0x1f'),new AGIError(_0x99bd('0x20')));_0x502917[_0x99bd('0x21')]();});_0x502917[_0x99bd('0x22')](_0x4a0491);this[_0x99bd('0x23')]=function(_0x57136d,_0x27c551){var _0x57136d=_0x57136d||'',_0x27c551=typeof _0x27c551=='function'?_0x27c551:new Function();_0x1b3141={'tx':_0x57136d,'rx':'','cb':_0x27c551};_0x502917[_0x99bd('0x24')](_0x57136d+'\x0a');},this['close']=function(){_0x502917['destroy']();};}util[_0x99bd('0x25')](AGIChannel,EventEmitter);AGIChannel[_0x99bd('0x26')]['sendRequest']=function(_0x1958bc){return this[_0x99bd('0x23')][_0x99bd('0x27')](this,_0x1958bc);};AGIChannel[_0x99bd('0x26')]['answer']=function(){return this[_0x99bd('0x28')]('ANSWER');};AGIChannel['prototype'][_0x99bd('0x29')]=function(_0x5ebeeb,_0x52521e,_0x5a910b){_0x5ebeeb=_0x5ebeeb===undefined?_0x99bd('0x2a'):_0x5ebeeb;_0x52521e=_0x52521e===undefined?'5':_0x52521e;_0x5a910b=_0x5a910b===undefined?'1':_0x5a910b;return this[_0x99bd('0x28')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x5ebeeb,_0x52521e*0x3e8,_0x5a910b));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x2b')]=function(_0x1eabb9){_0x1eabb9=_0x1eabb9||'NO\x20MESSAGE';return this[_0x99bd('0x28')](util[_0x99bd('0x2c')](_0x99bd('0x2d'),_0x1eabb9));};AGIChannel['prototype'][_0x99bd('0x2e')]=function(_0x222b67,_0x4c5493){if(_[_0x99bd('0x2f')](_0x4c5493)){return this[_0x99bd('0x28')](util[_0x99bd('0x2c')](_0x99bd('0x30'),_0x222b67,_0x4c5493['join'](',')));}return this[_0x99bd('0x28')](util[_0x99bd('0x2c')]('EXEC\x20%s\x20%s',_0x222b67,_0x4c5493));};AGIChannel[_0x99bd('0x26')]['setContext']=function(_0x4f52a6){return this['sendRequest'](util[_0x99bd('0x2c')](_0x99bd('0x31'),_0x4f52a6));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x32')]=function(_0x6ef22b){return this[_0x99bd('0x28')](util[_0x99bd('0x2c')](_0x99bd('0x33'),_0x6ef22b));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x34')]=function(_0x589c65){return this[_0x99bd('0x28')](util['format'](_0x99bd('0x35'),_0x589c65));};AGIChannel['prototype']['hangup']=function(){return this['sendRequest'](_0x99bd('0x36'));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x37')]=function(_0xbc705f,_0x5d3a07){var _0x26a1aa=_[_0x99bd('0x38')](_0x5d3a07)||_[_0x99bd('0x39')](_0x5d3a07)?_0x5d3a07[_0x99bd('0x3a')]():_0x5d3a07;return this['sendRequest'](util[_0x99bd('0x2c')](_0x99bd('0x3b'),_0xbc705f,_0x26a1aa?_0x26a1aa[_0x99bd('0x3a')]()[_0x99bd('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x99bd('0x3c')]=function(_0x2bafd6,_0x431a14){return this[_0x99bd('0x28')](util['format'](_0x99bd('0x3d'),_0x2bafd6,_0x431a14));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x3e')]=function(_0x3e67e7,_0x7e29ec){return this[_0x99bd('0x28')](util[_0x99bd('0x2c')](_0x99bd('0x3f'),_0x3e67e7,_0x7e29ec));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x40')]=function(_0x2fcf71,_0x3cf047){return this[_0x99bd('0x28')](util['format'](_0x99bd('0x41'),_0x2fcf71,_0x3cf047));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x42')]=function(_0x1cd890,_0x60ccde,_0x34624c){_0x60ccde=_0x60ccde||this[_0x99bd('0x43')];_0x34624c=_0x34624c||0x1;this[_0x99bd('0x44')](_0x1cd890);this[_0x99bd('0x32')](_0x60ccde);this[_0x99bd('0x34')](_0x34624c);return this[_0x99bd('0x2b')](util[_0x99bd('0x2c')](_0x99bd('0x45'),_0x1cd890,_0x60ccde,_0x34624c));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x46')]=function(_0x2d91be){return this[_0x99bd('0x28')](util['format'](_0x99bd('0x47'),_0x2d91be));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x48')]=function(_0x3be91f,_0x81cbb1,_0x31f6d7,_0x1ee803,_0x143cf1,_0x5cc942){_0x81cbb1=_0x81cbb1||_0x99bd('0x49');_0x31f6d7=_0x31f6d7||'';_0x1ee803=_0x1ee803===undefined?-0x1:_0x1ee803==='-1'?-0x1:_0x1ee803*0x3e8;_0x143cf1=_0x143cf1===undefined?'':'s='+_0x143cf1;_0x5cc942=_0x5cc942?_0x99bd('0x4a'):'';return this[_0x99bd('0x28')](util['format'](_0x99bd('0x4b'),_0x3be91f,_0x81cbb1,_0x31f6d7,_0x1ee803,_0x5cc942,_0x143cf1));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x4c')]=function(_0x50aca9,_0x32e942){_0x32e942=_0x32e942||'';return this['sendRequest'](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x50aca9,_0x32e942));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x4d')]=function(_0x32f8b7){return this['exec'](_0x99bd('0x4e'),_0x32f8b7);};AGIChannel[_0x99bd('0x26')][_0x99bd('0x4f')]=function(_0x4d216c){return this[_0x99bd('0x2e')](_0x99bd('0x50'),_0x4d216c);};AGIChannel['prototype']['error']=function(_0x2222e7,_0x1d7ec0){this[_0x99bd('0x2b')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x2222e7['id'],_0x2222e7[_0x99bd('0x51')],_0x1d7ec0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x99bd('0x52')]=AGIChannel; \ No newline at end of file +var _0xf71f=['label','exports','util','call','setEncoding','utf8','setTimeout','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','indexOf','startsWith','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','write','destroy','inherits','prototype','sendRequest','answer','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','setPriority','setVariable','isBoolean','toString','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_0xf71f,0x112));var _0xff71=function(_0x5f5c3a,_0xb34c49){_0x5f5c3a=_0x5f5c3a-0x0;var _0x1c26a8=_0xf71f[_0x5f5c3a];return _0x1c26a8;};'use strict';var util=require(_0xff71('0x0'));var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x2e0cfe){var _0x3ce312=this,_0x4d6880=new AGIReply(),_0x50203a=![],_0x14f568={};EventEmitter[_0xff71('0x1')](_0x3ce312);_0x2e0cfe[_0xff71('0x2')](_0xff71('0x3'));_0x2e0cfe[_0xff71('0x4')](0x8*0x3c*0x3c*0x3e8);_0x4d6880['setEncoding'](_0xff71('0x3'));_0x4d6880['on']('headers',function(_0x3c3e36){for(var _0x451115 in _0x3c3e36){_0x3ce312[_0x451115]=_0x3c3e36[_0x451115];}_0x3ce312[_0xff71('0x5')](_0xff71('0x6'));});_0x4d6880['on'](_0xff71('0x7'),function(_0x437e96){if(_0x437e96['toLowerCase']()==_0xff71('0x8')){_0x3ce312['emit']('hangup');return;}if(_0x437e96[_0xff71('0x9')](0x0,0xb)==_0xff71('0xa')){_0x50203a=!![];}if(_0x50203a){_0x14f568['rx']+=_0x437e96+'\x0a';if(_0x437e96[_0xff71('0xb')](_0xff71('0xc'))!=-0x1){_0x50203a=![];}}else{_0x14f568['rx']=_0x437e96;}if(_0x50203a){return;}if(typeof _0x14f568['cb']==_0xff71('0xd')){var _0x3cb7e0=_0x14f568['rx'][_0xff71('0x9')](0x0,0x3),_0x2980da=null,_0x32cacb=null;_0x3cb7e0=parseInt(_0x3cb7e0);if(isNaN(_0x3cb7e0)){_0x14f568['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xff71('0xe')});return;}if(_0x3cb7e0!=0xc8){_0x14f568['cb'](null,{'code':_0x3cb7e0,'result':-0x1,'extra':'KO'});return;}_0x2980da=_0x14f568['rx']['substring'](0x4)[_0xff71('0xf')](_0xff71('0x10'),'');if(_0x2980da['indexOf']('\x20')!=-0x1){_0x2980da=_0x2980da[_0xff71('0x11')](0x0,_0x2980da[_0xff71('0x12')]('\x20'));}if(_[_0xff71('0x13')](_0x2980da,'-1')){_0x2980da=parseInt(_0x2980da);}_0x32cacb=_0x14f568['rx']['split']('\x20');if(_0x32cacb[_0xff71('0x14')]==0x3){_0x32cacb=_0x32cacb[0x2][_0xff71('0x9')](0x1,_0x32cacb[0x2][_0xff71('0x14')]-0x1);}else if(_0x32cacb[_0xff71('0x14')]>0x3){var _0x1c96d5=/\((.+)\)/;var _0x3eac73=_0x14f568['rx']['match'](_0x1c96d5);if(_0x3eac73){_0x32cacb=_0x3eac73[0x1];}else{_0x32cacb=null;}}else{_0x32cacb=null;}_0x14f568['cb'](null,{'code':_0x3cb7e0,'result':_0x2980da,'extra':_0x32cacb});}});_0x2e0cfe['on'](_0xff71('0x15'),function(_0x10bc87){_0x3ce312[_0xff71('0x5')](_0xff71('0x15'),new AGIError(_0xff71('0x16'),_0x10bc87[_0xff71('0x17')]));});_0x2e0cfe['on'](_0xff71('0x18'),function(){_0x3ce312[_0xff71('0x5')]('close',new AGIError(_0xff71('0x19')));});_0x2e0cfe['on']('timeout',function(){_0x3ce312[_0xff71('0x5')](_0xff71('0x1a'),new AGIError(_0xff71('0x1b')));_0x2e0cfe['destroy']();});_0x2e0cfe[_0xff71('0x1c')](_0x4d6880);this['command']=function(_0x3e8cbf,_0x24b867){var _0x3e8cbf=_0x3e8cbf||'',_0x24b867=typeof _0x24b867=='function'?_0x24b867:new Function();_0x14f568={'tx':_0x3e8cbf,'rx':'','cb':_0x24b867};_0x2e0cfe[_0xff71('0x1d')](_0x3e8cbf+'\x0a');},this[_0xff71('0x18')]=function(){_0x2e0cfe[_0xff71('0x1e')]();};}util[_0xff71('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0xff71('0x20')][_0xff71('0x21')]=function(_0x4c264d){return this['command']['sync'](this,_0x4c264d);};AGIChannel[_0xff71('0x20')][_0xff71('0x22')]=function(){return this['sendRequest']('ANSWER');};AGIChannel['prototype'][_0xff71('0x23')]=function(_0x1e0cb8,_0x17efa4,_0x31bc99){_0x1e0cb8=_0x1e0cb8===undefined?_0xff71('0x24'):_0x1e0cb8;_0x17efa4=_0x17efa4===undefined?'5':_0x17efa4;_0x31bc99=_0x31bc99===undefined?'1':_0x31bc99;return this[_0xff71('0x21')](util[_0xff71('0x25')](_0xff71('0x26'),_0x1e0cb8,_0x17efa4*0x3e8,_0x31bc99));};AGIChannel[_0xff71('0x20')][_0xff71('0x27')]=function(_0x433a41){_0x433a41=_0x433a41||_0xff71('0x28');return this[_0xff71('0x21')](util[_0xff71('0x25')]('VERBOSE\x20\x22%s\x22',_0x433a41));};AGIChannel[_0xff71('0x20')][_0xff71('0x29')]=function(_0x5c5063,_0x935dc2){if(_[_0xff71('0x2a')](_0x935dc2)){return this[_0xff71('0x21')](util[_0xff71('0x25')](_0xff71('0x2b'),_0x5c5063,_0x935dc2[_0xff71('0x2c')](',')));}return this[_0xff71('0x21')](util[_0xff71('0x25')](_0xff71('0x2b'),_0x5c5063,_0x935dc2));};AGIChannel[_0xff71('0x20')][_0xff71('0x2d')]=function(_0x49ab25){return this[_0xff71('0x21')](util['format']('SET\x20CONTEXT\x20%s',_0x49ab25));};AGIChannel[_0xff71('0x20')][_0xff71('0x2e')]=function(_0x399df1){return this[_0xff71('0x21')](util[_0xff71('0x25')]('SET\x20EXTENSION\x20%s',_0x399df1));};AGIChannel[_0xff71('0x20')][_0xff71('0x2f')]=function(_0x5f0b77){return this[_0xff71('0x21')](util['format']('SET\x20PRIORITY\x20%s',_0x5f0b77));};AGIChannel[_0xff71('0x20')][_0xff71('0x8')]=function(){return this[_0xff71('0x21')]('HANGUP');};AGIChannel[_0xff71('0x20')][_0xff71('0x30')]=function(_0x360e45,_0x478ba0){var _0x2f97c2=_[_0xff71('0x31')](_0x478ba0)||_['isNumber'](_0x478ba0)?_0x478ba0[_0xff71('0x32')]():_0x478ba0;return this[_0xff71('0x21')](util[_0xff71('0x25')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x360e45,_0x2f97c2?_0x2f97c2[_0xff71('0x32')]()[_0xff71('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xff71('0x20')]['sayNumber']=function(_0x1f2665,_0x3bb94d){return this[_0xff71('0x21')](util[_0xff71('0x25')](_0xff71('0x33'),_0x1f2665,_0x3bb94d));};AGIChannel[_0xff71('0x20')]['sayDigits']=function(_0x1c9c14,_0x18b93b){return this[_0xff71('0x21')](util[_0xff71('0x25')](_0xff71('0x34'),_0x1c9c14,_0x18b93b));};AGIChannel['prototype']['sayPhonetic']=function(_0x3c9b4a,_0x54e475){return this[_0xff71('0x21')](util['format'](_0xff71('0x35'),_0x3c9b4a,_0x54e475));};AGIChannel[_0xff71('0x20')][_0xff71('0x36')]=function(_0x39943f,_0xd190b0,_0x2ded8e){_0xd190b0=_0xd190b0||this[_0xff71('0x37')];_0x2ded8e=_0x2ded8e||0x1;this[_0xff71('0x2d')](_0x39943f);this['setExtension'](_0xd190b0);this[_0xff71('0x2f')](_0x2ded8e);return this[_0xff71('0x27')](util[_0xff71('0x25')]('GOTO\x20%s\x20%s\x20%s',_0x39943f,_0xd190b0,_0x2ded8e));};AGIChannel[_0xff71('0x20')][_0xff71('0x38')]=function(_0x4931a8){return this[_0xff71('0x21')](util[_0xff71('0x25')](_0xff71('0x39'),_0x4931a8));};AGIChannel[_0xff71('0x20')][_0xff71('0x3a')]=function(_0x3758dc,_0x3c1714,_0x4fa744,_0x26ac9f,_0x4814c5,_0x11af0d){_0x3c1714=_0x3c1714||'wav';_0x4fa744=_0x4fa744||'';_0x26ac9f=_0x26ac9f===undefined?-0x1:_0x26ac9f==='-1'?-0x1:_0x26ac9f*0x3e8;_0x4814c5=_0x4814c5===undefined?'':'s='+_0x4814c5;_0x11af0d=_0x11af0d?_0xff71('0x3b'):'';return this[_0xff71('0x21')](util[_0xff71('0x25')](_0xff71('0x3c'),_0x3758dc,_0x3c1714,_0x4fa744,_0x26ac9f,_0x11af0d,_0x4814c5));};AGIChannel[_0xff71('0x20')][_0xff71('0x3d')]=function(_0x5675f7,_0x282c2c){_0x282c2c=_0x282c2c||'';return this['sendRequest'](util['format'](_0xff71('0x3e'),_0x5675f7,_0x282c2c));};AGIChannel[_0xff71('0x20')][_0xff71('0x3f')]=function(_0x235ad2){return this[_0xff71('0x29')](_0xff71('0x40'),_0x235ad2);};AGIChannel['prototype'][_0xff71('0x41')]=function(_0x39f3a8){return this[_0xff71('0x29')]('WAIT',_0x39f3a8);};AGIChannel[_0xff71('0x20')]['error']=function(_0x33f533,_0x3c4607){this[_0xff71('0x27')](util[_0xff71('0x25')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x33f533['id'],_0x33f533[_0xff71('0x42')],_0x3c4607));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xff71('0x43')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 71796a2..eb1ade7 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 _0xfd75=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfd75,0xa5));var _0x5fd7=function(_0x5423f0,_0x3f4e38){_0x5423f0=_0x5423f0-0x0;var _0x6a312e=_0xfd75[_0x5423f0];return _0x6a312e;};'use strict';var util=require(_0x5fd7('0x0'));var error={'E_AGI_UNDEFINED':_0x5fd7('0x1'),'E_AGI_ARGUMENT_PORT':_0x5fd7('0x2'),'E_AGI_SERVER_ERROR':_0x5fd7('0x3'),'E_AGI_SERVER_CLOSE':_0x5fd7('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x5fd7('0x5'),'E_AGI_SOCKET_ERROR':_0x5fd7('0x6'),'E_AGI_SOCKET_CLOSE':_0x5fd7('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x5fd7('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5fd7('0x9'),'E_AGI_IVR_ENTRY':_0x5fd7('0xa')};function AGIError(_0x2fdbc4){var _0x2fdbc4=_0x2fdbc4||null,_0x16b193=_0x16b193||[],_0x3a4765=0x1,_0x253e35='';if(!error[_0x2fdbc4]){_0x2fdbc4=_0x5fd7('0xb');}_0x16b193['push'](error[_0x2fdbc4]);while(arguments[_0x3a4765]){_0x16b193[_0x5fd7('0xc')](arguments[_0x3a4765]);_0x3a4765++;}_0x253e35=util[_0x5fd7('0xd')][_0x5fd7('0xe')](util,_0x16b193);this[_0x5fd7('0xf')]=_0x253e35;this['name']=_0x2fdbc4;}module[_0x5fd7('0x10')]=AGIError; \ No newline at end of file +var _0x1223=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','format','apply','message','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x11cdf7,_0x11fd12){var _0x518d7d=function(_0x527e3d){while(--_0x527e3d){_0x11cdf7['push'](_0x11cdf7['shift']());}};_0x518d7d(++_0x11fd12);}(_0x1223,0x12f));var _0x3122=function(_0xcc1875,_0xa0f98d){_0xcc1875=_0xcc1875-0x0;var _0x113da2=_0x1223[_0xcc1875];return _0x113da2;};'use strict';var util=require(_0x3122('0x0'));var error={'E_AGI_UNDEFINED':_0x3122('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x3122('0x2'),'E_AGI_SERVER_CLOSE':_0x3122('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x3122('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x3122('0x5'),'E_AGI_SOCKET_ERROR':_0x3122('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x3122('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x3122('0x8')};function AGIError(_0x295c4f){var _0x295c4f=_0x295c4f||null,_0x5b3738=_0x5b3738||[],_0x56787a=0x1,_0x19e06e='';if(!error[_0x295c4f]){_0x295c4f=_0x3122('0x9');}_0x5b3738['push'](error[_0x295c4f]);while(arguments[_0x56787a]){_0x5b3738['push'](arguments[_0x56787a]);_0x56787a++;}_0x19e06e=util[_0x3122('0xa')][_0x3122('0xb')](util,_0x5b3738);this[_0x3122('0xc')]=_0x19e06e;this['name']=_0x295c4f;}module[_0x3122('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 1c6ccc8..700256f 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d43=['./error','../../config/environment','redis','defaults','localhost','subscribe','agi','emit','E_AGI_SERVER_ERROR','message','parse','projectUpdate','exports','events','ioredis'];(function(_0x261153,_0x174df0){var _0x5402f9=function(_0x5c7269){while(--_0x5c7269){_0x261153['push'](_0x261153['shift']());}};_0x5402f9(++_0x174df0);}(_0x1d43,0xd0));var _0x31d4=function(_0x229ef2,_0x3448d6){_0x229ef2=_0x229ef2-0x0;var _0x3630dc=_0x1d43[_0x229ef2];return _0x3630dc;};'use strict';var _=require('lodash');var EventEmitter=require(_0x31d4('0x0'))['EventEmitter'];var Redis=require(_0x31d4('0x1'));var AGIError=require(_0x31d4('0x2'));var config=require(_0x31d4('0x3'));config[_0x31d4('0x4')]=_[_0x31d4('0x5')](config['redis'],{'host':_0x31d4('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x31d4('0x4')]);sub[_0x31d4('0x7')](_0x31d4('0x8'),function(_0x15f004){if(_0x15f004)return eventEmitter[_0x31d4('0x9')]('error',new AGIError(_0x31d4('0xa'),_0x15f004));});sub['on'](_0x31d4('0xb'),function(_0x47e65a,_0x4ca488){if(_0x47e65a!==_0x31d4('0x8'))return;try{var _0x5ea243=JSON[_0x31d4('0xc')](_0x4ca488);eventEmitter[_0x31d4('0x9')](_0x31d4('0xd'),_0x5ea243);}catch(_0x53724c){eventEmitter[_0x31d4('0x9')]('error',new AGIError(_0x31d4('0xa'),_0x53724c));}});module[_0x31d4('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xcda3=['./error','defaults','redis','agi','emit','error','E_AGI_SERVER_ERROR','message','projectUpdate','events','EventEmitter','ioredis'];(function(_0x508677,_0x4f53cb){var _0x1ef259=function(_0x1968c7){while(--_0x1968c7){_0x508677['push'](_0x508677['shift']());}};_0x1ef259(++_0x4f53cb);}(_0xcda3,0x14d));var _0x3cda=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0xcda3[_0x30d87a];return _0x48f64b;};'use strict';var _=require('lodash');var EventEmitter=require(_0x3cda('0x0'))[_0x3cda('0x1')];var Redis=require(_0x3cda('0x2'));var AGIError=require(_0x3cda('0x3'));var config=require('../../config/environment');config['redis']=_[_0x3cda('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x3cda('0x5')]);sub['subscribe'](_0x3cda('0x6'),function(_0x2c15a0){if(_0x2c15a0)return eventEmitter[_0x3cda('0x7')](_0x3cda('0x8'),new AGIError(_0x3cda('0x9'),_0x2c15a0));});sub['on'](_0x3cda('0xa'),function(_0x239b96,_0x29c8fe){if(_0x239b96!==_0x3cda('0x6'))return;try{var _0x50baab=JSON['parse'](_0x29c8fe);eventEmitter[_0x3cda('0x7')](_0x3cda('0xb'),_0x50baab);}catch(_0x234bfc){eventEmitter[_0x3cda('0x7')](_0x3cda('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x234bfc));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index c2ad2f3..bad006e 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 _0x4e34=['no\x20vertex\x20found','stop\x20traverse','length','condition','vswitch','target','default','agicommand','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','agi','menu','vertices','numberOfEdges','prototype','addVertex','edges','addEdge','getVertex','traverseBFS','info'];(function(_0x540a65,_0x1b75e2){var _0x14dc3e=function(_0x349ab4){while(--_0x349ab4){_0x540a65['push'](_0x540a65['shift']());}};_0x14dc3e(++_0x1b75e2);}(_0x4e34,0x19e));var _0x44e3=function(_0x33deb4,_0x2d214c){_0x33deb4=_0x33deb4-0x0;var _0x3c4646=_0x4e34[_0x33deb4];return _0x3c4646;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0x44e3('0x0'));var verticesWithRetry=[_0x44e3('0x1'),'getdigits','getsecretdigits'];var Graph=function(){this[_0x44e3('0x2')]={};this['edges']={};this[_0x44e3('0x3')]=0x0;};Graph[_0x44e3('0x4')][_0x44e3('0x5')]=function(_0x5a0287){this['vertices'][_0x5a0287['id']]=_0x5a0287;this[_0x44e3('0x6')][_0x5a0287['id']]=[];};Graph[_0x44e3('0x4')][_0x44e3('0x7')]=function(_0x1ca56e,_0x37b7d4,_0x196941){this[_0x44e3('0x6')][_0x1ca56e]['push']({'target':_0x37b7d4,'condition':_0x196941});this[_0x44e3('0x3')]+=0x1;};Graph[_0x44e3('0x4')]['size']=function(){return _['size'](this[_0x44e3('0x2')]);};Graph[_0x44e3('0x4')]['relations']=function(){return this['numberOfEdges'];};Graph[_0x44e3('0x4')][_0x44e3('0x8')]=function(_0x7faa46){return this[_0x44e3('0x2')][_0x7faa46];};Graph['prototype'][_0x44e3('0x9')]=function(_0xecdc78,_0x11eafa){if(!this[_0x44e3('0x2')][_0xecdc78]){return logger[_0x44e3('0xa')](_0x44e3('0xb'));}var _0xf72585=_0x11eafa(this[_0x44e3('0x2')][_0xecdc78]);if(!_0xf72585){return logger['info'](_0x44e3('0xc'));}if(this['edges'][_0xecdc78][_0x44e3('0xd')]===0x0){return logger[_0x44e3('0xa')]('no\x20edge/s\x20available');}for(var _0x28fc7a=0x0,_0xf1633d=[],_0x103eb0=![];_0x28fc7a\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','callerid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','close','timeout','hangup','find','production','handleUnpublished'];(function(_0x2b737c,_0x274adf){var _0x466ed5=function(_0x593124){while(--_0x593124){_0x2b737c['push'](_0x2b737c['shift']());}};_0x466ed5(++_0x274adf);}(_0x943d,0xb4));var _0xd943=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x943d[_0x13187a];return _0x65b85f;};'use strict';var _=require(_0xd943('0x0'));var syncho=require(_0xd943('0x1'));var util=require(_0xd943('0x2'));var config=require(_0xd943('0x3'));var logger=require(_0xd943('0x4'))(_0xd943('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0xd943('0x6'));var Project=require(_0xd943('0x7'));var AGIEmitter=require(_0xd943('0x8'))['EventEmitter'];var projects=[];config[_0xd943('0x5')]=_['defaults'](config[_0xd943('0x5')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0xd943('0x9'),projectUpdateHandler);function connectionHandler(_0x5494b3){process[_0xd943('0xa')](function(){syncho(function(){try{setChannelVariables(_0x5494b3);agiHandler(_0x5494b3);}catch(_0x512c6a){logger[_0xd943('0xb')](_0x512c6a[_0xd943('0xc')]);}});});}function projectUpdateHandler(_0x4278b8){try{var _0x1d44d5=_[_0xd943('0xd')](projects,['id',_0x4278b8['id']]);if(_0x1d44d5>-0x1){if(_0x4278b8[_0xd943('0xe')]===!![]){projects['splice'](_0x1d44d5,0x1);}else{projects[_0x1d44d5]=_0x4278b8;}}else{projects[_0xd943('0xf')](_0x4278b8);}}catch(_0x227015){logger[_0xd943('0xb')](_0x227015[_0xd943('0xc')]);}}function listeningHandler(){console[_0xd943('0x10')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xd943('0x5')]['port']);logger[_0xd943('0x11')](util[_0xd943('0x12')](_0xd943('0x13'),config[_0xd943('0x5')]['ip'],config[_0xd943('0x5')][_0xd943('0x14')]));}function errorHandler(_0x4a5b11){if(_0x4a5b11&&_0x4a5b11[_0xd943('0x15')]&&_0x4a5b11[_0xd943('0x16')]){logger[_0xd943('0xb')](util['format'](_0xd943('0x17'),_0x4a5b11['name'],_0x4a5b11[_0xd943('0x16')]));}else{logger[_0xd943('0xb')](util[_0xd943('0x12')](_0xd943('0x18'),_0x4a5b11[_0xd943('0xc')]));}}function closeHandler(){logger[_0xd943('0x11')](util['format'](_0xd943('0x19'),this['arg_1'],this[_0xd943('0x1a')],this['callerid'],this[_0xd943('0x1b')],this['uniqueid']));try{createSquareReport(this);}catch(_0x2eb88c){logger[_0xd943('0xb')](_0x2eb88c[_0xd943('0xc')]);}}function timeoutHandler(){logger[_0xd943('0x11')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0xd943('0x1c')],this[_0xd943('0x1b')],this[_0xd943('0x1d')]));}function hangupHandler(){logger['info'](util[_0xd943('0x12')](_0xd943('0x1e'),this['arg_1'],this[_0xd943('0x1a')],this['callerid'],this['dnid'],this['uniqueid']));this[_0xd943('0x1f')]=!![];}function createSquareReport(_0x346c48,_0x46d300){rpc['createSquareReport'](_0x346c48)[_0xd943('0x20')](function(_0x248a46){if(_0x46d300){_0x46d300(null,_0x248a46);}})[_0xd943('0x21')](function(_0x487a57){if(_0x46d300){_0x46d300(null,_0x487a57);}});}function setChannelVariables(_0x5ecadc){for(var _0x122795 in _0x5ecadc){if(_0x5ecadc[_0xd943('0x22')](_0x122795)){if(_0x122795[_0xd943('0x23')](_0xd943('0x24'))===0x0){_0x5ecadc[_0x122795[_0xd943('0x25')](0x4)]=_0x5ecadc[_0x122795];delete _0x5ecadc[_0x122795];}}}}function agiHandler(_0x2ed868){logger[_0xd943('0x26')]('variables',JSON[_0xd943('0x27')](_0x2ed868,null,0x2));logger[_0xd943('0x11')](util['format'](_0xd943('0x28'),_0x2ed868[_0xd943('0x29')],_0x2ed868['calleridname'],_0x2ed868[_0xd943('0x1c')],_0x2ed868[_0xd943('0x1b')],_0x2ed868[_0xd943('0x1d')]));_0x2ed868['on'](_0xd943('0xb'),errorHandler);_0x2ed868['on'](_0xd943('0x2a'),closeHandler);_0x2ed868['on'](_0xd943('0x2b'),timeoutHandler);_0x2ed868[_0xd943('0x1f')]=![];_0x2ed868['on'](_0xd943('0x2c'),hangupHandler);var _0x1de033=_[_0xd943('0x2d')](projects,['name',_0x2ed868[_0xd943('0x29')]]);if(!_0x1de033)return Project['handleNotFound'](_0x2ed868);if(!_0x1de033[_0xd943('0x2e')])return Project[_0xd943('0x2f')](_0x2ed868);return Project['initialize'](_0x1de033,_0x2ed868);}function main(){var _0x5b17fb;return utilLicense[_0xd943('0x30')]()[_0xd943('0x20')](function(_0x5c3056){if(!_0x5c3056)return;if(_0x5c3056[_0xd943('0x31')]){if(_0x5c3056[_0xd943('0x32')]&&_0x5c3056[_0xd943('0x32')]>0x0){logger[_0xd943('0x11')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x5c3056['callysquare']));_0x5b17fb=_0x5c3056['callysquare'];}else{logger[_0xd943('0x11')](_0xd943('0x33'));}}else{logger[_0xd943('0x11')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x5b17fb=-0x1;}})[_0xd943('0x20')](function(){return Project['getAll']();})[_0xd943('0x20')](function(_0x306d71){projects=_0x306d71;return;})[_0xd943('0x21')](function(_0x3e9d9a){logger['error'](_0xd943('0x34'),_0x3e9d9a[_0xd943('0xc')]);})[_0xd943('0x35')](function(){var _0x4dc4e8=require(_0xd943('0x36'))(config[_0xd943('0x5')][_0xd943('0x14')],config['agi']['ip'],_0x5b17fb);_0x4dc4e8['on']('error',errorHandler);_0x4dc4e8['on'](_0xd943('0x37'),listeningHandler);_0x4dc4e8['on'](_0xd943('0x38'),connectionHandler);_0x4dc4e8['on'](_0xd943('0x2a'),closeHandler);});}main(); \ No newline at end of file +var _0xa6e3=['[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','./server','listening','close','syncho','../../config/environment','../../config/logger','../../config/license/util','./events','EventEmitter','agi','defaults','127.0.0.1','nextTick','stack','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','error','format','name','[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','then','catch','hasOwnProperty','indexOf','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','handleNotFound','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s'];(function(_0x1a9390,_0x3339e6){var _0x2b4514=function(_0x1c07d5){while(--_0x1c07d5){_0x1a9390['push'](_0x1a9390['shift']());}};_0x2b4514(++_0x3339e6);}(_0xa6e3,0x72));var _0x3a6e=function(_0x34bcbf,_0x529caf){_0x34bcbf=_0x34bcbf-0x0;var _0x4951ee=_0xa6e3[_0x34bcbf];return _0x4951ee;};'use strict';var _=require('lodash');var syncho=require(_0x3a6e('0x0'));var util=require('util');var config=require(_0x3a6e('0x1'));var logger=require(_0x3a6e('0x2'))('agi');var utilLicense=require(_0x3a6e('0x3'));var rpc=require('./rpc');var Project=require('./project');var AGIEmitter=require(_0x3a6e('0x4'))[_0x3a6e('0x5')];var projects=[];config[_0x3a6e('0x6')]=_[_0x3a6e('0x7')](config['agi'],{'ip':_0x3a6e('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x434f40){process[_0x3a6e('0x9')](function(){syncho(function(){try{setChannelVariables(_0x434f40);agiHandler(_0x434f40);}catch(_0x325d74){logger['error'](_0x325d74[_0x3a6e('0xa')]);}});});}function projectUpdateHandler(_0x54d980){try{var _0x3e7710=_['findIndex'](projects,['id',_0x54d980['id']]);if(_0x3e7710>-0x1){if(_0x54d980[_0x3a6e('0xb')]===!![]){projects[_0x3a6e('0xc')](_0x3e7710,0x1);}else{projects[_0x3e7710]=_0x54d980;}}else{projects[_0x3a6e('0xd')](_0x54d980);}}catch(_0x4b7903){logger['error'](_0x4b7903['stack']);}}function listeningHandler(){console[_0x3a6e('0xe')](_0x3a6e('0xf'),config[_0x3a6e('0x6')][_0x3a6e('0x10')]);logger[_0x3a6e('0x11')](util['format'](_0x3a6e('0x12'),config[_0x3a6e('0x6')]['ip'],config[_0x3a6e('0x6')]['port']));}function errorHandler(_0x2d74a3){if(_0x2d74a3&&_0x2d74a3['name']&&_0x2d74a3[_0x3a6e('0x13')]){logger[_0x3a6e('0x14')](util[_0x3a6e('0x15')]('[%s]\x20%s',_0x2d74a3[_0x3a6e('0x16')],_0x2d74a3[_0x3a6e('0x13')]));}else{logger[_0x3a6e('0x14')](util['format']('[ERROR]\x20%s',_0x2d74a3[_0x3a6e('0xa')]));}}function closeHandler(){logger[_0x3a6e('0x11')](util['format'](_0x3a6e('0x17'),this[_0x3a6e('0x18')],this[_0x3a6e('0x19')],this[_0x3a6e('0x1a')],this[_0x3a6e('0x1b')],this['uniqueid']));try{createSquareReport(this);}catch(_0x9378ec){logger[_0x3a6e('0x14')](_0x9378ec[_0x3a6e('0xa')]);}}function timeoutHandler(){logger[_0x3a6e('0x11')](util[_0x3a6e('0x15')](_0x3a6e('0x1c'),this[_0x3a6e('0x18')],this['calleridname'],this[_0x3a6e('0x1a')],this[_0x3a6e('0x1b')],this[_0x3a6e('0x1d')]));}function hangupHandler(){logger[_0x3a6e('0x11')](util[_0x3a6e('0x15')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x3a6e('0x19')],this[_0x3a6e('0x1a')],this['dnid'],this[_0x3a6e('0x1d')]));this[_0x3a6e('0x1e')]=!![];}function createSquareReport(_0x1a64c5,_0x505468){rpc['createSquareReport'](_0x1a64c5)[_0x3a6e('0x1f')](function(_0x34ac51){if(_0x505468){_0x505468(null,_0x34ac51);}})[_0x3a6e('0x20')](function(_0x574851){if(_0x505468){_0x505468(null,_0x574851);}});}function setChannelVariables(_0x55d7e0){for(var _0x27ab77 in _0x55d7e0){if(_0x55d7e0[_0x3a6e('0x21')](_0x27ab77)){if(_0x27ab77[_0x3a6e('0x22')]('agi_')===0x0){_0x55d7e0[_0x27ab77[_0x3a6e('0x23')](0x4)]=_0x55d7e0[_0x27ab77];delete _0x55d7e0[_0x27ab77];}}}}function agiHandler(_0x10b41b){logger[_0x3a6e('0x24')]('variables',JSON[_0x3a6e('0x25')](_0x10b41b,null,0x2));logger[_0x3a6e('0x11')](util['format'](_0x3a6e('0x26'),_0x10b41b[_0x3a6e('0x18')],_0x10b41b['calleridname'],_0x10b41b[_0x3a6e('0x1a')],_0x10b41b['dnid'],_0x10b41b[_0x3a6e('0x1d')]));_0x10b41b['on'](_0x3a6e('0x14'),errorHandler);_0x10b41b['on']('close',closeHandler);_0x10b41b['on'](_0x3a6e('0x27'),timeoutHandler);_0x10b41b[_0x3a6e('0x1e')]=![];_0x10b41b['on'](_0x3a6e('0x28'),hangupHandler);var _0xc2e297=_['find'](projects,['name',_0x10b41b[_0x3a6e('0x18')]]);if(!_0xc2e297)return Project[_0x3a6e('0x29')](_0x10b41b);if(!_0xc2e297[_0x3a6e('0x2a')])return Project[_0x3a6e('0x2b')](_0x10b41b);return Project[_0x3a6e('0x2c')](_0xc2e297,_0x10b41b);}function main(){var _0x618ad0;return utilLicense[_0x3a6e('0x2d')]()[_0x3a6e('0x1f')](function(_0xef85df){if(!_0xef85df)return;if(_0xef85df['voice']){if(_0xef85df[_0x3a6e('0x2e')]&&_0xef85df[_0x3a6e('0x2e')]>0x0){logger['info'](util[_0x3a6e('0x15')](_0x3a6e('0x2f'),_0xef85df[_0x3a6e('0x2e')]));_0x618ad0=_0xef85df[_0x3a6e('0x2e')];}else{logger[_0x3a6e('0x11')](_0x3a6e('0x30'));}}else{logger['info'](_0x3a6e('0x31'));_0x618ad0=-0x1;}})[_0x3a6e('0x1f')](function(){return Project[_0x3a6e('0x32')]();})[_0x3a6e('0x1f')](function(_0x132fd9){projects=_0x132fd9;return;})[_0x3a6e('0x20')](function(_0x36144d){logger[_0x3a6e('0x14')]('[LICENSE]',_0x36144d['stack']);})['finally'](function(){var _0x30f154=require(_0x3a6e('0x33'))(config[_0x3a6e('0x6')][_0x3a6e('0x10')],config[_0x3a6e('0x6')]['ip'],_0x618ad0);_0x30f154['on']('error',errorHandler);_0x30f154['on'](_0x3a6e('0x34'),listeningHandler);_0x30f154['on']('connection',connectionHandler);_0x30f154['on'](_0x3a6e('0x35'),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 9926391..daccfe9 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 _0x9b24=['request','then','error','result','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x6fc28e,_0x230bfe){var _0x4901f4=function(_0x3864e7){while(--_0x3864e7){_0x6fc28e['push'](_0x6fc28e['shift']());}};_0x4901f4(++_0x230bfe);}(_0x9b24,0xc3));var _0x49b2=function(_0x34322d,_0x15e744){_0x34322d=_0x34322d-0x0;var _0x25275f=_0x9b24[_0x34322d];return _0x25275f;};'use strict';var BPromise=require(_0x49b2('0x0'));var jayson=require(_0x49b2('0x1'));var client=jayson[_0x49b2('0x2')]['http']({'port':0x232b});function request(_0x1050a5,_0x507258){return new BPromise(function(_0x2c939e,_0x58ee2f){return client[_0x49b2('0x3')](_0x1050a5,_0x507258)[_0x49b2('0x4')](function(_0x1a9e62){if(_0x1a9e62[_0x49b2('0x5')]){return _0x58ee2f(_0x1a9e62[_0x49b2('0x5')]['message']);}else{return _0x2c939e(_0x1a9e62[_0x49b2('0x6')]);}})['catch'](function(_0x45903a){return _0x58ee2f(_0x45903a);});});}exports[_0x49b2('0x7')]=function(_0x216b53,_0x959889){return request(_0x49b2('0x8'),{'account':_0x216b53,'message':_0x959889});}; \ No newline at end of file +var _0x3f32=['bluebird','jayson/promise','client','http','request','then','error','message','result','catch','sendMailMessage','SendMail'];(function(_0x504338,_0x5cb4bf){var _0x168d66=function(_0x28d94a){while(--_0x28d94a){_0x504338['push'](_0x504338['shift']());}};_0x168d66(++_0x5cb4bf);}(_0x3f32,0xc0));var _0x23f3=function(_0x243cca,_0x514c2d){_0x243cca=_0x243cca-0x0;var _0xf94771=_0x3f32[_0x243cca];return _0xf94771;};'use strict';var BPromise=require(_0x23f3('0x0'));var jayson=require(_0x23f3('0x1'));var client=jayson[_0x23f3('0x2')][_0x23f3('0x3')]({'port':0x232b});function request(_0x34d686,_0x3aef5e){return new BPromise(function(_0x3aed76,_0x1a032f){return client[_0x23f3('0x4')](_0x34d686,_0x3aef5e)[_0x23f3('0x5')](function(_0xd05a00){if(_0xd05a00[_0x23f3('0x6')]){return _0x1a032f(_0xd05a00['error'][_0x23f3('0x7')]);}else{return _0x3aed76(_0xd05a00[_0x23f3('0x8')]);}})[_0x23f3('0x9')](function(_0x5345a3){return _0x1a032f(_0x5345a3);});});}exports[_0x23f3('0xa')]=function(_0x5ae38f,_0x5e5496){return request(_0x23f3('0xb'),{'account':_0x5ae38f,'message':_0x5e5496});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 891dd23..d3890d7 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0d8=['priority','response','result','evtHangup','toString','agicommand\x20not\x20found','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','clear','isUndefined','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','agi','./mailRpc','./graph','./vertices','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','isArray','length','target','source','value','mxGraphModel','root','inspect','production','debug','stringify','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','traverseBFS','start','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension'];(function(_0x288055,_0x3125a5){var _0x491f0a=function(_0x312009){while(--_0x312009){_0x288055['push'](_0x288055['shift']());}};_0x491f0a(++_0x3125a5);}(_0xf0d8,0x8a));var _0x8f0d=function(_0x2945df,_0x35a145){_0x2945df=_0x2945df-0x0;var _0x2f0be5=_0xf0d8[_0x2945df];return _0x2f0be5;};'use strict';var _=require(_0x8f0d('0x0'));var moment=require('moment');var parser=require(_0x8f0d('0x1'));var util=require(_0x8f0d('0x2'));var logger=require('../../config/logger')(_0x8f0d('0x3'));var rpc=require('./rpc');var mailRpc=require(_0x8f0d('0x4'));var Graph=require(_0x8f0d('0x5'));var Vertices=require(_0x8f0d('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x8f0d('0x7')]()['catch'](function(_0x13e489){logger[_0x8f0d('0x8')](_0x8f0d('0x9'),_0x13e489['stack']);return[];});}function addVertex(_0x4fc762,_0x4f8973,_0x36c3ac){_0x4f8973[_0x8f0d('0xa')]=_0x36c3ac;if(_0x4f8973[_0x8f0d('0xb')]('retry')){_0x4f8973[_0x8f0d('0xc')]=parseInt(_0x4f8973[_0x8f0d('0xd')],0xa);}_0x4fc762[_0x8f0d('0xe')](_[_0x8f0d('0xf')](_0x4f8973,'mxCell'));}function initGraph(_0x59a71e,_0x26c302){var _0x10cbe1=new Graph();for(var _0x58c792 in _0x59a71e){if(_0x59a71e['hasOwnProperty'](_0x58c792)){if(_[_0x8f0d('0x10')](_0x59a71e[_0x58c792])){for(var _0x2786ad=0x0;_0x2786ad<_0x59a71e[_0x58c792][_0x8f0d('0x11')];_0x2786ad+=0x1){addVertex(_0x10cbe1,_0x59a71e[_0x58c792][_0x2786ad],_0x58c792);}}else{addVertex(_0x10cbe1,_0x59a71e[_0x58c792],_0x58c792);}}}for(var _0x4da943=0x0;_0x4da943<_0x26c302['length'];_0x4da943+=0x1){if(_0x26c302[_0x4da943]['source']&&_0x26c302[_0x4da943][_0x8f0d('0x12')]){_0x10cbe1['addEdge'](_0x26c302[_0x4da943][_0x8f0d('0x13')],_0x26c302[_0x4da943][_0x8f0d('0x12')],_0x26c302[_0x4da943][_0x8f0d('0x14')]);}}return _0x10cbe1;}function getRoot(_0x1c12a5){return parser['toJson'](_0x1c12a5,{'object':!![]})[_0x8f0d('0x15')][_0x8f0d('0x16')];}function inspect(_0x5ce033){return util[_0x8f0d('0x17')](_0x5ce033,{'showHidden':![],'depth':null});}function initialize(_0x266c24,_0x1586b3){var _0x193d07=getRoot(_0x266c24[_0x8f0d('0x18')]);if(!_0x193d07||!_0x193d07['start'])return;var _0x4d6e61,_0x6303b4,_0x51b1a9;logger[_0x8f0d('0x19')](_0x8f0d('0x16'),JSON[_0x8f0d('0x1a')](_0x193d07,null,0x2));_0x1586b3['joinAt']=moment()[_0x8f0d('0x1b')](_0x8f0d('0x1c'));_0x4d6e61=initGraph(_[_0x8f0d('0xf')](_0x193d07,'mxCell'),_0x193d07['mxCell']);_0x6303b4=new Vertices(_0x1586b3,rpc,mailRpc);logger[_0x8f0d('0x1d')](util[_0x8f0d('0x1b')](_0x8f0d('0x1e'),_0x1586b3[_0x8f0d('0x1f')],_0x1586b3[_0x8f0d('0x20')],_0x1586b3[_0x8f0d('0x21')],_0x1586b3['dnid'],_0x1586b3[_0x8f0d('0x22')]));_0x4d6e61[_0x8f0d('0x23')](_0x193d07[_0x8f0d('0x24')]['id'],function(_0x18e1ad){try{_0x18e1ad=_0x6303b4['clear'](_0x18e1ad);logger['debug'](_0x8f0d('0x25'),JSON[_0x8f0d('0x1a')](_0x18e1ad,null,0x2));if(_0x18e1ad[_0x8f0d('0xa')]===_0x8f0d('0x26')){logger[_0x8f0d('0x1d')](_0x8f0d('0x27'));_0x1586b3[_0x8f0d('0x28')]=_0x18e1ad['context']||_0x1586b3[_0x8f0d('0x28')];_0x1586b3[_0x8f0d('0x29')]=_0x18e1ad['extension'];_0x1586b3['priority']=_0x18e1ad[_0x8f0d('0x2a')]?_0x18e1ad[_0x8f0d('0x2a')]-0x1:0x1;return null;}else if(_0x18e1ad&&_0x6303b4[_0x18e1ad[_0x8f0d('0xa')]]){_0x51b1a9=_0x6303b4[_0x18e1ad['agicommand']](_0x18e1ad);logger[_0x8f0d('0x1d')](_0x8f0d('0x2b'),JSON[_0x8f0d('0x1a')](_0x51b1a9,null,0x2));if(_0x51b1a9&&_0x51b1a9['code']===AGI_CODE_SUCCESS&&_0x51b1a9[_0x8f0d('0x2c')]!==AGI_RESULT_ERROR&&!_0x1586b3[_0x8f0d('0x2d')]){logger[_0x8f0d('0x19')](_0x8f0d('0x2b'),inspect(_0x51b1a9));return _['isUndefined'](_0x51b1a9[_0x8f0d('0x2c')])?null:_0x51b1a9['result'][_0x8f0d('0x2e')]();}else{logger[_0x8f0d('0x8')]('response',inspect(_0x51b1a9));return null;}}else{logger[_0x8f0d('0x8')](_0x8f0d('0x2f'));return null;}}catch(_0x35d232){logger[_0x8f0d('0x8')](_0x35d232[_0x8f0d('0x30')]);return null;}});if(_0x193d07[_0x8f0d('0x31')]){logger[_0x8f0d('0x1d')](util[_0x8f0d('0x1b')](_0x8f0d('0x32'),_0x1586b3['arg_1'],_0x1586b3[_0x8f0d('0x20')],_0x1586b3['callerid'],_0x1586b3[_0x8f0d('0x33')],_0x1586b3[_0x8f0d('0x22')]));_0x4d6e61['traverseBFS'](_0x193d07[_0x8f0d('0x31')]['id'],function(_0x456224){try{_0x456224=_0x6303b4[_0x8f0d('0x34')](_0x456224);logger[_0x8f0d('0x19')](_0x8f0d('0x25'),JSON['stringify'](_0x456224,null,0x2));if(_0x456224&&_0x6303b4[_0x456224[_0x8f0d('0xa')]]){_0x51b1a9=_0x6303b4[_0x456224[_0x8f0d('0xa')]](_0x456224);if(_0x51b1a9){logger['debug'](_0x8f0d('0x2b'),inspect(_0x51b1a9));return _[_0x8f0d('0x35')](_0x51b1a9[_0x8f0d('0x2c')])?null:_0x51b1a9[_0x8f0d('0x2c')][_0x8f0d('0x2e')]();}else{logger[_0x8f0d('0x8')](_0x8f0d('0x2b'),inspect(_0x51b1a9));return null;}}else{logger['error'](_0x8f0d('0x2f'));return null;}}catch(_0x5a4535){logger[_0x8f0d('0x8')](_0x5a4535[_0x8f0d('0x30')]);return null;}});}logger['info'](util[_0x8f0d('0x1b')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1586b3['arg_1'],_0x1586b3['calleridname'],_0x1586b3[_0x8f0d('0x21')],_0x1586b3['dnid'],_0x1586b3[_0x8f0d('0x22')]));logger['info'](util[_0x8f0d('0x1b')](_0x8f0d('0x36'),_0x1586b3[_0x8f0d('0x28')],_0x1586b3[_0x8f0d('0x29')],parseInt(_0x1586b3['priority'],0xa)+0x1));_0x1586b3[_0x8f0d('0x37')](_0x1586b3[_0x8f0d('0x28')],_0x1586b3[_0x8f0d('0x29')],parseInt(_0x1586b3[_0x8f0d('0x2a')],0xa)+0x1);_0x1586b3[_0x8f0d('0x38')]();}function handleNotFound(_0x3828d7){logger[_0x8f0d('0x8')](util[_0x8f0d('0x1b')](_0x8f0d('0x39'),_0x3828d7[_0x8f0d('0x1f')]));_0x3828d7[_0x8f0d('0x37')](_0x3828d7[_0x8f0d('0x28')],_0x3828d7['extension'],parseInt(_0x3828d7['priority'],0xa)+0x1);_0x3828d7[_0x8f0d('0x38')]();}function handleUnpublished(_0x4059ea){logger[_0x8f0d('0x8')](util[_0x8f0d('0x1b')](_0x8f0d('0x3a'),_0x4059ea[_0x8f0d('0x1f')]));_0x4059ea[_0x8f0d('0x37')](_0x4059ea[_0x8f0d('0x28')],_0x4059ea[_0x8f0d('0x29')],parseInt(_0x4059ea[_0x8f0d('0x2a')],0xa)+0x1);_0x4059ea[_0x8f0d('0x38')]();}module[_0x8f0d('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x29f2=['length','source','target','toJson','inspect','production','start','debug','root','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','mxCell','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','uniqueid','traverseBFS','clear','vertex','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','response','code','result','evtHangup','isUndefined','toString','error','arg_1','calleridname','callerid','finally','agicommand\x20not\x20found','[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','priority','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger','./rpc','./mailRpc','./graph','./vertices','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','isArray'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x29f2,0x1a0));var _0x229f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29f2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x229f('0x0'));var moment=require(_0x229f('0x1'));var parser=require(_0x229f('0x2'));var util=require(_0x229f('0x3'));var logger=require(_0x229f('0x4'))('agi');var rpc=require(_0x229f('0x5'));var mailRpc=require(_0x229f('0x6'));var Graph=require(_0x229f('0x7'));var Vertices=require(_0x229f('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x229f('0x9')](function(_0x377f5b){logger['error'](_0x229f('0xa'),_0x377f5b[_0x229f('0xb')]);return[];});}function addVertex(_0x178088,_0x2606cb,_0x5e409e){_0x2606cb[_0x229f('0xc')]=_0x5e409e;if(_0x2606cb[_0x229f('0xd')](_0x229f('0xe'))){_0x2606cb[_0x229f('0xf')]=parseInt(_0x2606cb[_0x229f('0xe')],0xa);}_0x178088[_0x229f('0x10')](_['omit'](_0x2606cb,'mxCell'));}function initGraph(_0x16fdc2,_0x5524b9){var _0x1a4110=new Graph();for(var _0x6fa662 in _0x16fdc2){if(_0x16fdc2[_0x229f('0xd')](_0x6fa662)){if(_[_0x229f('0x11')](_0x16fdc2[_0x6fa662])){for(var _0x43d5b2=0x0;_0x43d5b2<_0x16fdc2[_0x6fa662][_0x229f('0x12')];_0x43d5b2+=0x1){addVertex(_0x1a4110,_0x16fdc2[_0x6fa662][_0x43d5b2],_0x6fa662);}}else{addVertex(_0x1a4110,_0x16fdc2[_0x6fa662],_0x6fa662);}}}for(var _0x2390d1=0x0;_0x2390d1<_0x5524b9[_0x229f('0x12')];_0x2390d1+=0x1){if(_0x5524b9[_0x2390d1][_0x229f('0x13')]&&_0x5524b9[_0x2390d1]['target']){_0x1a4110['addEdge'](_0x5524b9[_0x2390d1][_0x229f('0x13')],_0x5524b9[_0x2390d1][_0x229f('0x14')],_0x5524b9[_0x2390d1]['value']);}}return _0x1a4110;}function getRoot(_0x17a0b6){return parser[_0x229f('0x15')](_0x17a0b6,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x13f11a){return util[_0x229f('0x16')](_0x13f11a,{'showHidden':![],'depth':null});}function initialize(_0x215e8d,_0x55aa96){var _0x34528d=getRoot(_0x215e8d[_0x229f('0x17')]);if(!_0x34528d||!_0x34528d[_0x229f('0x18')])return;var _0x1d15ba,_0xdff9d1,_0x2165a9;logger[_0x229f('0x19')](_0x229f('0x1a'),JSON[_0x229f('0x1b')](_0x34528d,null,0x2));_0x55aa96[_0x229f('0x1c')]=moment()['format'](_0x229f('0x1d'));_0x1d15ba=initGraph(_[_0x229f('0x1e')](_0x34528d,_0x229f('0x1f')),_0x34528d[_0x229f('0x1f')]);_0xdff9d1=new Vertices(_0x55aa96,rpc,mailRpc);logger['info'](util[_0x229f('0x20')](_0x229f('0x21'),_0x55aa96['arg_1'],_0x55aa96['calleridname'],_0x55aa96['callerid'],_0x55aa96[_0x229f('0x22')],_0x55aa96[_0x229f('0x23')]));_0x1d15ba[_0x229f('0x24')](_0x34528d[_0x229f('0x18')]['id'],function(_0x543882){try{_0x543882=_0xdff9d1[_0x229f('0x25')](_0x543882);logger[_0x229f('0x19')](_0x229f('0x26'),JSON[_0x229f('0x1b')](_0x543882,null,0x2));if(_0x543882[_0x229f('0xc')]==='gotoc'){logger[_0x229f('0x27')](_0x229f('0x28'));_0x55aa96['context']=_0x543882[_0x229f('0x29')]||_0x55aa96[_0x229f('0x29')];_0x55aa96[_0x229f('0x2a')]=_0x543882['extension'];_0x55aa96['priority']=_0x543882['priority']?_0x543882['priority']-0x1:0x1;return null;}else if(_0x543882&&_0xdff9d1[_0x543882[_0x229f('0xc')]]){_0x2165a9=_0xdff9d1[_0x543882[_0x229f('0xc')]](_0x543882);logger[_0x229f('0x27')](_0x229f('0x2b'),JSON['stringify'](_0x2165a9,null,0x2));if(_0x2165a9&&_0x2165a9[_0x229f('0x2c')]===AGI_CODE_SUCCESS&&_0x2165a9[_0x229f('0x2d')]!==AGI_RESULT_ERROR&&!_0x55aa96[_0x229f('0x2e')]){logger['debug'](_0x229f('0x2b'),inspect(_0x2165a9));return _[_0x229f('0x2f')](_0x2165a9[_0x229f('0x2d')])?null:_0x2165a9[_0x229f('0x2d')][_0x229f('0x30')]();}else{logger[_0x229f('0x31')]('response',inspect(_0x2165a9));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x27e6dc){logger[_0x229f('0x31')](_0x27e6dc[_0x229f('0xb')]);return null;}});if(_0x34528d['finally']){logger[_0x229f('0x27')](util[_0x229f('0x20')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x55aa96[_0x229f('0x32')],_0x55aa96[_0x229f('0x33')],_0x55aa96[_0x229f('0x34')],_0x55aa96[_0x229f('0x22')],_0x55aa96['uniqueid']));_0x1d15ba['traverseBFS'](_0x34528d[_0x229f('0x35')]['id'],function(_0x805d20){try{_0x805d20=_0xdff9d1[_0x229f('0x25')](_0x805d20);logger[_0x229f('0x19')](_0x229f('0x26'),JSON[_0x229f('0x1b')](_0x805d20,null,0x2));if(_0x805d20&&_0xdff9d1[_0x805d20[_0x229f('0xc')]]){_0x2165a9=_0xdff9d1[_0x805d20[_0x229f('0xc')]](_0x805d20);if(_0x2165a9){logger[_0x229f('0x19')](_0x229f('0x2b'),inspect(_0x2165a9));return _[_0x229f('0x2f')](_0x2165a9[_0x229f('0x2d')])?null:_0x2165a9['result'][_0x229f('0x30')]();}else{logger[_0x229f('0x31')]('response',inspect(_0x2165a9));return null;}}else{logger['error'](_0x229f('0x36'));return null;}}catch(_0x487f7a){logger['error'](_0x487f7a['stack']);return null;}});}logger[_0x229f('0x27')](util['format'](_0x229f('0x37'),_0x55aa96[_0x229f('0x32')],_0x55aa96[_0x229f('0x33')],_0x55aa96[_0x229f('0x34')],_0x55aa96[_0x229f('0x22')],_0x55aa96[_0x229f('0x23')]));logger[_0x229f('0x27')](util['format'](_0x229f('0x38'),_0x55aa96[_0x229f('0x29')],_0x55aa96[_0x229f('0x2a')],parseInt(_0x55aa96[_0x229f('0x39')],0xa)+0x1));_0x55aa96[_0x229f('0x3a')](_0x55aa96[_0x229f('0x29')],_0x55aa96[_0x229f('0x2a')],parseInt(_0x55aa96[_0x229f('0x39')],0xa)+0x1);_0x55aa96[_0x229f('0x3b')]();}function handleNotFound(_0x4654e1){logger['error'](util[_0x229f('0x20')]('Project\x20%s\x20not\x20found',_0x4654e1['arg_1']));_0x4654e1['continueAt'](_0x4654e1[_0x229f('0x29')],_0x4654e1[_0x229f('0x2a')],parseInt(_0x4654e1[_0x229f('0x39')],0xa)+0x1);_0x4654e1[_0x229f('0x3b')]();}function handleUnpublished(_0x581fbd){logger[_0x229f('0x31')](util[_0x229f('0x20')](_0x229f('0x3c'),_0x581fbd[_0x229f('0x32')]));_0x581fbd['continueAt'](_0x581fbd[_0x229f('0x29')],_0x581fbd[_0x229f('0x2a')],parseInt(_0x581fbd[_0x229f('0x39')],0xa)+0x1);_0x581fbd[_0x229f('0x3b')]();}module[_0x229f('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 8e132e4..a90ffc1 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 _0x841e=['indexOf','substring','length','split','slice','trim','emit','line','exports','util','Transform','call','_localBuffer','_inBody','_transform','\x0d\x0a\x0d\x0a','toString'];(function(_0x40d5de,_0x30a489){var _0x445071=function(_0x5d7fc0){while(--_0x5d7fc0){_0x40d5de['push'](_0x40d5de['shift']());}};_0x445071(++_0x30a489);}(_0x841e,0x1c3));var _0xe841=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x841e[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0xe841('0x0'));var Transform=require('stream')[_0xe841('0x1')];function AGIReply(_0x1508b0){Transform[_0xe841('0x2')](this,_0x1508b0);this[_0xe841('0x3')]='';this[_0xe841('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0xe841('0x5')]=function(_0x52b4df,_0x4ced57,_0x553c91){var _0x250231='\x0a',_0xe4af9=['\x0a\x0a',_0xe841('0x6')],_0x1a2141=-0x1,_0x286a7c=-0x1,_0x1c0904='',_0x5aecce=0x0,_0x381eef='',_0x2070a6='';this['_localBuffer']+=_0x52b4df[_0xe841('0x7')]();_0x381eef=this[_0xe841('0x3')];if(!this[_0xe841('0x4')]){_0x5aecce=0x0;while(_0xe4af9[_0x5aecce]){while((_0x286a7c=_0x381eef[_0xe841('0x8')](_0xe4af9[_0x5aecce]))!=-0x1){_0x1c0904=_0xe4af9[_0x5aecce];_0x2070a6=_0x381eef[_0xe841('0x9')](0x0,_0x286a7c);_0x381eef=_0x381eef[_0xe841('0x9')](_0x286a7c+_0x1c0904[_0xe841('0xa')]);var _0x2eb50c=_0x2070a6[_0xe841('0xb')](_0x250231),_0x20b909=0x0,_0x57ef7c={},_0x21c6f4='',_0xf7d5f9='',_0x46260c=-0x1;while(_0x2eb50c[_0x20b909]){_0x46260c=_0x2eb50c[_0x20b909]['indexOf'](':');if(_0x46260c!=-0x1){_0x21c6f4=_0x2eb50c[_0x20b909][_0xe841('0xc')](0x0,_0x46260c)[_0xe841('0xd')]();_0xf7d5f9=_0x2eb50c[_0x20b909]['slice'](_0x46260c+0x1)[_0xe841('0xd')]();if(_0x21c6f4[_0xe841('0xa')]>0x0){_0x57ef7c[_0x21c6f4]=_0xf7d5f9;}}else{}_0x20b909++;}this[_0xe841('0xe')]('headers',_0x57ef7c);this[_0xe841('0x4')]=!![];}_0x5aecce++;}this[_0xe841('0x3')]=_0x381eef;}else{while((_0x1a2141=_0x381eef[_0xe841('0x8')](_0x250231))!=-0x1){_0x2070a6=_0x381eef[_0xe841('0x9')](0x0,_0x1a2141);this[_0xe841('0xe')](_0xe841('0xf'),_0x2070a6);_0x381eef=_0x381eef['substring'](_0x1a2141+_0x250231[_0xe841('0xa')]);}this[_0xe841('0x3')]=_0x381eef;}_0x553c91();};module[_0xe841('0x10')]=AGIReply; \ No newline at end of file +var _0x90e0=['_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','trim','slice','headers','line','length','exports','stream','Transform','call','_localBuffer','_inBody','inherits','prototype'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x90e0,0xe3));var _0x090e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90e0[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var Transform=require(_0x090e('0x0'))[_0x090e('0x1')];function AGIReply(_0x227f0c){Transform[_0x090e('0x2')](this,_0x227f0c);this[_0x090e('0x3')]='';this[_0x090e('0x4')]=![];}util[_0x090e('0x5')](AGIReply,Transform);AGIReply[_0x090e('0x6')][_0x090e('0x7')]=function(_0x15c0ce,_0x5205a1,_0x54c9aa){var _0x5138e6='\x0a',_0x529eae=['\x0a\x0a',_0x090e('0x8')],_0x3581db=-0x1,_0x1738e3=-0x1,_0x22d987='',_0x1ae077=0x0,_0x41c935='',_0x3bbf92='';this['_localBuffer']+=_0x15c0ce[_0x090e('0x9')]();_0x41c935=this[_0x090e('0x3')];if(!this[_0x090e('0x4')]){_0x1ae077=0x0;while(_0x529eae[_0x1ae077]){while((_0x1738e3=_0x41c935[_0x090e('0xa')](_0x529eae[_0x1ae077]))!=-0x1){_0x22d987=_0x529eae[_0x1ae077];_0x3bbf92=_0x41c935[_0x090e('0xb')](0x0,_0x1738e3);_0x41c935=_0x41c935[_0x090e('0xb')](_0x1738e3+_0x22d987['length']);var _0x5831c=_0x3bbf92['split'](_0x5138e6),_0x158c57=0x0,_0x46f496={},_0x456001='',_0x21d4e8='',_0x4a528f=-0x1;while(_0x5831c[_0x158c57]){_0x4a528f=_0x5831c[_0x158c57][_0x090e('0xa')](':');if(_0x4a528f!=-0x1){_0x456001=_0x5831c[_0x158c57]['slice'](0x0,_0x4a528f)[_0x090e('0xc')]();_0x21d4e8=_0x5831c[_0x158c57][_0x090e('0xd')](_0x4a528f+0x1)['trim']();if(_0x456001['length']>0x0){_0x46f496[_0x456001]=_0x21d4e8;}}else{}_0x158c57++;}this['emit'](_0x090e('0xe'),_0x46f496);this[_0x090e('0x4')]=!![];}_0x1ae077++;}this[_0x090e('0x3')]=_0x41c935;}else{while((_0x3581db=_0x41c935[_0x090e('0xa')](_0x5138e6))!=-0x1){_0x3bbf92=_0x41c935[_0x090e('0xb')](0x0,_0x3581db);this['emit'](_0x090e('0xf'),_0x3bbf92);_0x41c935=_0x41c935['substring'](_0x3581db+_0x5138e6[_0x090e('0x10')]);}this[_0x090e('0x3')]=_0x41c935;}_0x54c9aa();};module[_0x090e('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 04a8500..ed22e38 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 _0x295f=['email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','getUserById','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','Intervals','ShowSmsAccount','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','phone','ListId','CreateCmContact','getPauseById','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','moment','jayson/promise','client','request','then','error','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider'];(function(_0x25fe20,_0x5c4098){var _0x5684d0=function(_0x221f80){while(--_0x221f80){_0x25fe20['push'](_0x25fe20['shift']());}};_0x5684d0(++_0x5c4098);}(_0x295f,0x168));var _0xf295=function(_0x2b223d,_0x40c145){_0x2b223d=_0x2b223d-0x0;var _0x2e0158=_0x295f[_0x2b223d];return _0x2e0158;};'use strict';var _=require('lodash');var moment=require(_0xf295('0x0'));var jayson=require(_0xf295('0x1'));var client=jayson[_0xf295('0x2')]['http']({'port':0x2329});function request(_0x45a403,_0x1c653b){return new Promise(function(_0x59a1c5,_0x511ab5){return client[_0xf295('0x3')](_0x45a403,_0x1c653b)[_0xf295('0x4')](function(_0x262f76){if(_0x262f76[_0xf295('0x5')]){return _0x511ab5(_0x262f76[_0xf295('0x5')]['message']);}else{return _0x59a1c5(_0x262f76[_0xf295('0x6')]);}})[_0xf295('0x7')](function(_0x1f3320){return _0x511ab5(_0x1f3320);});});}exports[_0xf295('0x8')]=function(){return request(_0xf295('0x9'),{'options':{'raw':![],'attributes':['id',_0xf295('0xa'),_0xf295('0xb')]}});};exports[_0xf295('0xc')]=function(_0x168437){return request(_0xf295('0xd'),{'options':{'raw':![],'where':{'name':_0x168437},'attributes':[_0xf295('0xb')]}});};exports[_0xf295('0xe')]=function(_0x5ae127){return request(_0xf295('0xf'),{'options':{'raw':![],'where':{'id':_0x5ae127},'include':[{'model':_0xf295('0x10'),'as':'Smtp','include':[{'model':_0xf295('0x11'),'as':_0xf295('0x11')}]}],'attributes':['id',_0xf295('0xa'),_0xf295('0x12')],'smtp':!![]}});};exports[_0xf295('0x13')]=function(_0x50c4ba){return request(_0xf295('0xd'),{'options':{'where':{'id':_0x50c4ba},'attributes':[_0xf295('0xa')]}});};exports[_0xf295('0x14')]=function(_0x3f0981){return request(_0xf295('0x15'),{'options':{'where':{'id':_0x3f0981},'attributes':[_0xf295('0xa')]}});};exports[_0xf295('0x16')]=function(_0x26a3d5){return request(_0xf295('0x17'),{'options':{'where':{'id':_0x26a3d5},'attributes':[_0xf295('0xa')]}});};exports[_0xf295('0x18')]=function(_0x42d8c8){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x42d8c8},'attributes':['dsn']}});};exports[_0xf295('0x19')]=function(_0x129a9e){return request('ShowUser',{'options':{'where':{'id':_0x129a9e},'attributes':[_0xf295('0xa')]}});};exports['getContactByPhone']=function(_0x30ad22){return request('GetContactByPhone',{'options':{'where':{'phone':_0x30ad22['phone']},'attributes':['id']}});};exports[_0xf295('0x1a')]=function(_0x458d55){return request('ShowTrunk',{'options':{'where':{'id':_0x458d55},'attributes':['name']}});};exports[_0xf295('0x1b')]=function(_0x2d731b){return request(_0xf295('0x1c'),{'options':{'where':{'id':_0x2d731b},'attributes':[_0xf295('0x1d')]}});};exports[_0xf295('0x1e')]=function(_0x158f6){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x158f6},'include':[{'model':'Interval','as':_0xf295('0x1f')}]}});};exports['getSmsAccountById']=function(_0x2ef08a){return request(_0xf295('0x20'),{'options':{'where':{'id':_0x2ef08a},'attributes':['id',_0xf295('0xa')]}});};exports['createSmsMessage']=function(_0x3c1be4){return request(_0xf295('0x21'),{'body':_0x3c1be4});};exports['createSquareDetailsReport']=function(_0x250939){return request(_0xf295('0x22'),{'body':_0x250939});};exports[_0xf295('0x23')]=function(_0x3431a4){return request(_0xf295('0x24'),{'body':_['merge'](_0x3431a4,{'project_name':_0x3431a4[_0xf295('0x25')],'prev_project_name':_0x3431a4[_0xf295('0x26')]||'','is_subproject':_0x3431a4['arg_2']?!![]:![],'leaveAt':moment()['format'](_0xf295('0x27'))})});};exports[_0xf295('0x28')]=function(_0x402ca4){return request(_0xf295('0x29'),{'body':_0x402ca4});};exports[_0xf295('0x2a')]=function(_0x2c47e7){return request(_0xf295('0x2b'),{'body':_0x2c47e7});};exports[_0xf295('0x2c')]=function(_0x13fe67){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x13fe67[_0xf295('0x2d')],'ListId':_0x13fe67[_0xf295('0x2e')]}}})[_0xf295('0x4')](function(_0x41aa44){if(_0x41aa44){return _0x41aa44;}return request(_0xf295('0x2f'),{'body':_0x13fe67});});};exports[_0xf295('0x30')]=function(_0x5b2801){return request('ShowPause',{'options':{'where':{'id':_0x5b2801},'attributes':['name']}});};exports['agentLogin']=function(_0x590749,_0x2670f8){return request(_0xf295('0x31'),{'body':{'interface':_0x2670f8},'options':{'where':_0x590749}});};exports[_0xf295('0x32')]=function(_0x515007,_0x13e684,_0x489e72){return request(_0xf295('0x33'),{'body':{'type':_0x13e684,'uniqueid':_0x489e72},'options':{'where':_0x515007}});};exports['agentUnpause']=function(_0x4cd8c1){return request(_0xf295('0x34'),{'body':{},'options':{'where':_0x4cd8c1}});};exports[_0xf295('0x35')]=function(_0x33b7f4){return request('LogoutUser',{'body':{},'options':{'where':_0x33b7f4}});}; \ No newline at end of file +var _0x946e=['GetSquareProjects','name','ShowSquareProject','ShowMailAccount','CloudProvider','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','lodash','jayson/promise','http','request','then','error','message','result'];(function(_0x15e950,_0x1db756){var _0x3425e5=function(_0x1fa0f4){while(--_0x1fa0f4){_0x15e950['push'](_0x15e950['shift']());}};_0x3425e5(++_0x1db756);}(_0x946e,0x1d0));var _0xe946=function(_0x26adc5,_0x3398b4){_0x26adc5=_0x26adc5-0x0;var _0x3f3cf4=_0x946e[_0x26adc5];return _0x3f3cf4;};'use strict';var _=require(_0xe946('0x0'));var moment=require('moment');var jayson=require(_0xe946('0x1'));var client=jayson['client'][_0xe946('0x2')]({'port':0x2329});function request(_0x5d4ee0,_0x5c9b66){return new Promise(function(_0x31cade,_0xb981db){return client[_0xe946('0x3')](_0x5d4ee0,_0x5c9b66)[_0xe946('0x4')](function(_0x11d758){if(_0x11d758['error']){return _0xb981db(_0x11d758[_0xe946('0x5')][_0xe946('0x6')]);}else{return _0x31cade(_0x11d758[_0xe946('0x7')]);}})['catch'](function(_0x39bd38){return _0xb981db(_0x39bd38);});});}exports['getSquareProjects']=function(){return request(_0xe946('0x8'),{'options':{'raw':![],'attributes':['id',_0xe946('0x9'),'production']}});};exports['getSquareProject']=function(_0x49e9fc){return request(_0xe946('0xa'),{'options':{'raw':![],'where':{'name':_0x49e9fc},'attributes':['production']}});};exports['getMailAccountById']=function(_0x35a35a){return request(_0xe946('0xb'),{'options':{'raw':![],'where':{'id':_0x35a35a},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':_0xe946('0xc'),'as':_0xe946('0xc')}]}],'attributes':['id','name',_0xe946('0xd')],'smtp':!![]}});};exports[_0xe946('0xe')]=function(_0x36ad64){return request(_0xe946('0xa'),{'options':{'where':{'id':_0x36ad64},'attributes':[_0xe946('0x9')]}});};exports[_0xe946('0xf')]=function(_0x3eba3c){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x3eba3c},'attributes':['name']}});};exports[_0xe946('0x10')]=function(_0x2e66b8){return request(_0xe946('0x11'),{'options':{'where':{'id':_0x2e66b8},'attributes':['name']}});};exports[_0xe946('0x12')]=function(_0x437f13){return request(_0xe946('0x13'),{'options':{'where':{'id':_0x437f13},'attributes':['dsn']}});};exports[_0xe946('0x14')]=function(_0x1fbe13){return request(_0xe946('0x15'),{'options':{'where':{'id':_0x1fbe13},'attributes':['name']}});};exports[_0xe946('0x16')]=function(_0x3cde06){return request('GetContactByPhone',{'options':{'where':{'phone':_0x3cde06[_0xe946('0x17')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x1489f4){return request(_0xe946('0x18'),{'options':{'where':{'id':_0x1489f4},'attributes':['name']}});};exports[_0xe946('0x19')]=function(_0x3c9027){return request(_0xe946('0x1a'),{'options':{'where':{'id':_0x3c9027},'attributes':[_0xe946('0x1b')]}});};exports[_0xe946('0x1c')]=function(_0x29fa47){return request(_0xe946('0x1d'),{'options':{'raw':![],'where':{'id':_0x29fa47},'include':[{'model':_0xe946('0x1e'),'as':_0xe946('0x1f')}]}});};exports[_0xe946('0x20')]=function(_0x5c0f83){return request(_0xe946('0x21'),{'options':{'where':{'id':_0x5c0f83},'attributes':['id',_0xe946('0x9')]}});};exports[_0xe946('0x22')]=function(_0x25dbfb){return request(_0xe946('0x23'),{'body':_0x25dbfb});};exports[_0xe946('0x24')]=function(_0x556045){return request(_0xe946('0x25'),{'body':_0x556045});};exports[_0xe946('0x26')]=function(_0x1d0b1f){return request(_0xe946('0x27'),{'body':_[_0xe946('0x28')](_0x1d0b1f,{'project_name':_0x1d0b1f[_0xe946('0x29')],'prev_project_name':_0x1d0b1f[_0xe946('0x2a')]||'','is_subproject':_0x1d0b1f[_0xe946('0x2a')]?!![]:![],'leaveAt':moment()[_0xe946('0x2b')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xe946('0x2c')]=function(_0x4454d3){return request(_0xe946('0x2d'),{'body':_0x4454d3});};exports[_0xe946('0x2e')]=function(_0x33efee){return request(_0xe946('0x2f'),{'body':_0x33efee});};exports['createCmContact']=function(_0x20366d){return request(_0xe946('0x30'),{'options':{'raw':![],'where':{'phone':_0x20366d[_0xe946('0x17')],'ListId':_0x20366d[_0xe946('0x31')]}}})[_0xe946('0x4')](function(_0x1e41d2){if(_0x1e41d2){return _0x1e41d2;}return request(_0xe946('0x32'),{'body':_0x20366d});});};exports[_0xe946('0x33')]=function(_0x54ac40){return request(_0xe946('0x34'),{'options':{'where':{'id':_0x54ac40},'attributes':[_0xe946('0x9')]}});};exports['agentLogin']=function(_0x17f44c,_0x207a97){return request(_0xe946('0x35'),{'body':{'interface':_0x207a97},'options':{'where':_0x17f44c}});};exports[_0xe946('0x36')]=function(_0x5bf662,_0x39258e,_0xbd026d){return request(_0xe946('0x37'),{'body':{'type':_0x39258e,'uniqueid':_0xbd026d},'options':{'where':_0x5bf662}});};exports[_0xe946('0x38')]=function(_0x1711a1){return request('UnpauseUser',{'body':{},'options':{'where':_0x1711a1}});};exports[_0xe946('0x39')]=function(_0x1dcab6){return request(_0xe946('0x3a'),{'body':{},'options':{'where':_0x1dcab6}});}; \ 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 33c1143..040607a 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 _0x9261=['./polly','./lex'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x9261,0x1de));var _0x1926=function(_0x23ca2f,_0x271c2b){_0x23ca2f=_0x23ca2f-0x0;var _0x4f4b51=_0x9261[_0x23ca2f];return _0x4f4b51;};var polly=require(_0x1926('0x0'));var lex=require(_0x1926('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x77a9=['./polly','exports'];(function(_0x380275,_0x249705){var _0x11bf41=function(_0x2e873c){while(--_0x2e873c){_0x380275['push'](_0x380275['shift']());}};_0x11bf41(++_0x249705);}(_0x77a9,0x19e));var _0x977a=function(_0x3fd49b,_0x50408f){_0x3fd49b=_0x3fd49b-0x0;var _0x38de97=_0x77a9[_0x3fd49b];return _0x38de97;};var polly=require(_0x977a('0x0'));var lex=require('./lex');module[_0x977a('0x1')]={'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 e703f0e..d4a1daa 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 _0xe605=['./lib/api','exports'];(function(_0x10f1c0,_0x36c5d3){var _0x45e42d=function(_0x5682f5){while(--_0x5682f5){_0x10f1c0['push'](_0x10f1c0['shift']());}};_0x45e42d(++_0x36c5d3);}(_0xe605,0x92));var _0x5e60=function(_0x59af4b,_0x533a0a){_0x59af4b=_0x59af4b-0x0;var _0x2c824d=_0xe605[_0x59af4b];return _0x2c824d;};'use strict';var lex=require(_0x5e60('0x0'));module[_0x5e60('0x1')]=function(_0x5deab2,_0x36add0,_0x455efd,_0x342132,_0x1133f0,_0x4007b3){return lex(_0x5deab2,_0x36add0,_0x455efd,_0x342132,_0x1133f0,_0x4007b3);}; \ No newline at end of file +var _0x702d=['exports','./lib/api'];(function(_0x4e313b,_0x2ec13c){var _0x33d59e=function(_0x44ab2f){while(--_0x44ab2f){_0x4e313b['push'](_0x4e313b['shift']());}};_0x33d59e(++_0x2ec13c);}(_0x702d,0x147));var _0xd702=function(_0x5a677e,_0x22a192){_0x5a677e=_0x5a677e-0x0;var _0x48bd14=_0x702d[_0x5a677e];return _0x48bd14;};'use strict';var lex=require(_0xd702('0x0'));module[_0xd702('0x1')]=function(_0x37c2c5,_0x33e7c5,_0x37ed5c,_0x5c2b9e,_0x20c11a,_0xebbd7c){return lex(_0x37c2c5,_0x33e7c5,_0x37ed5c,_0x5c2b9e,_0x20c11a,_0xebbd7c);}; \ 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 29249cb..35715ad 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(_0x4b956e,_0x4a366c){var _0xffafa8=function(_0x13fca2){while(--_0x13fca2){_0x4b956e['push'](_0x4b956e['shift']());}};_0xffafa8(++_0x4a366c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x1d0bc1,_0x38cc28){var _0x6f2523=function(_0x14fc9e){while(--_0x14fc9e){_0x1d0bc1['push'](_0x1d0bc1['shift']());}};_0x6f2523(++_0x38cc28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 498570d..76eafbf 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 _0x59ca=['./lib/api'];(function(_0x4c1f42,_0x22b3ec){var _0x51230b=function(_0x133b59){while(--_0x133b59){_0x4c1f42['push'](_0x4c1f42['shift']());}};_0x51230b(++_0x22b3ec);}(_0x59ca,0x137));var _0xa59c=function(_0x397dd1,_0x13494a){_0x397dd1=_0x397dd1-0x0;var _0x312517=_0x59ca[_0x397dd1];return _0x312517;};'use strict';var polly=require(_0xa59c('0x0'));module['exports']=function(_0xb19bd9,_0x2ac44c,_0x5c9b44,_0x17d759,_0x3c4d25,_0x2a9095,_0x1b9287){return polly(_0xb19bd9,_0x2ac44c,_0x5c9b44,_0x17d759,_0x3c4d25,_0x2a9095,_0x1b9287);}; \ No newline at end of file +var _0xc5c5=['exports','./lib/api'];(function(_0x37d317,_0x46dcc1){var _0x2c757f=function(_0xcbee92){while(--_0xcbee92){_0x37d317['push'](_0x37d317['shift']());}};_0x2c757f(++_0x46dcc1);}(_0xc5c5,0x189));var _0x5c5c=function(_0x26ef70,_0x3dffa5){_0x26ef70=_0x26ef70-0x0;var _0x506e9a=_0xc5c5[_0x26ef70];return _0x506e9a;};'use strict';var polly=require(_0x5c5c('0x0'));module[_0x5c5c('0x1')]=function(_0x31d592,_0x540243,_0x33f167,_0x8da723,_0x23d3c0,_0x5f3b57,_0x22b160){return polly(_0x31d592,_0x540243,_0x33f167,_0x8da723,_0x23d3c0,_0x5f3b57,_0x22b160);}; \ 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 bcd2045..ee4f7c8 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 _0xe1ce=['synthesizeSpeech','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','bluebird','randomstring','aws-sdk'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0xe1ce,0xce));var _0xee1c=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xe1ce[_0x47a349];return _0x18ab75;};'use strict';var fs=require('fs');var path=require(_0xee1c('0x0'));var BPromise=require(_0xee1c('0x1'));var rs=require(_0xee1c('0x2'));var AWS=require(_0xee1c('0x3'));function pollyResult(_0x129b5c,_0x404d69,_0x13ee08){return new BPromise(function(_0x534be2,_0x526839){_0x129b5c[_0xee1c('0x4')](_0x404d69,function(_0x4a4a06,_0x4daea0){if(_0x4a4a06){_0x526839(_0x4a4a06);}else if(_0x4daea0){if(_0x4daea0[_0xee1c('0x5')]instanceof Buffer){fs['writeFile'](_0x13ee08,_0x4daea0['AudioStream'],function(_0x7c6864){if(_0x7c6864){_0x526839(_0x7c6864);}else{_0x534be2();}});}else{_0x526839(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x526839(new Error(_0xee1c('0x6')));}});});}module[_0xee1c('0x7')]=function(_0x416015,_0x58c014,_0x5b248a,_0x302434,_0x35abf2,_0x43eaeb,_0x3ad126){var _0x33dd5f=new AWS[(_0xee1c('0x8'))]({'accessKeyId':_0x416015,'secretAccessKey':_0x58c014,'region':_0x5b248a});var _0x258f35={'Text':_0x35abf2,'TextType':_0x43eaeb||'text','OutputFormat':_0xee1c('0x9'),'VoiceId':_0x302434};return pollyResult(_0x33dd5f,_0x258f35,_0x3ad126);}; \ No newline at end of file +var _0xf483=['exports','text','path','randomstring','aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x26e359,_0x33f445){var _0x99b90=function(_0x553c83){while(--_0x553c83){_0x26e359['push'](_0x26e359['shift']());}};_0x99b90(++_0x33f445);}(_0xf483,0xb1));var _0x3f48=function(_0x7dee36,_0x2dd3f0){_0x7dee36=_0x7dee36-0x0;var _0x2d6ce3=_0xf483[_0x7dee36];return _0x2d6ce3;};'use strict';var fs=require('fs');var path=require(_0x3f48('0x0'));var BPromise=require('bluebird');var rs=require(_0x3f48('0x1'));var AWS=require(_0x3f48('0x2'));function pollyResult(_0x24d8c6,_0x421550,_0x38be43){return new BPromise(function(_0x483caa,_0x2ef26a){_0x24d8c6['synthesizeSpeech'](_0x421550,function(_0x1fefe3,_0x155d29){if(_0x1fefe3){_0x2ef26a(_0x1fefe3);}else if(_0x155d29){if(_0x155d29[_0x3f48('0x3')]instanceof Buffer){fs['writeFile'](_0x38be43,_0x155d29[_0x3f48('0x3')],function(_0x3bc13b){if(_0x3bc13b){_0x2ef26a(_0x3bc13b);}else{_0x483caa();}});}else{_0x2ef26a(new Error(_0x3f48('0x4')));}}else{_0x2ef26a(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x3f48('0x5')]=function(_0x5b6dbf,_0x20ffb6,_0x4bf826,_0x4143a4,_0x2da9b3,_0x5e4f2c,_0x1f7019){var _0x2c5a9e=new AWS['Polly']({'accessKeyId':_0x5b6dbf,'secretAccessKey':_0x20ffb6,'region':_0x4bf826});var _0x5c0076={'Text':_0x2da9b3,'TextType':_0x5e4f2c||_0x3f48('0x6'),'OutputFormat':'mp3','VoiceId':_0x4143a4};return pollyResult(_0x2c5a9e,_0x5c0076,_0x1f7019);}; \ 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 fe6239b..19eb38d 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 _0x73ed=['./lib/api','exports'];(function(_0x42534d,_0x5324c7){var _0x2ad83a=function(_0x4e6d35){while(--_0x4e6d35){_0x42534d['push'](_0x42534d['shift']());}};_0x2ad83a(++_0x5324c7);}(_0x73ed,0x198));var _0xd73e=function(_0x19cb02,_0x437c42){_0x19cb02=_0x19cb02-0x0;var _0x4e9301=_0x73ed[_0x19cb02];return _0x4e9301;};'use strict';var asr=require(_0xd73e('0x0'));module[_0xd73e('0x1')]=function(_0xa80bd2,_0xb30b72,_0x1ba1d1,_0x114fcf){return asr(_0xa80bd2,_0xb30b72,_0x1ba1d1);}; \ No newline at end of file +var _0xe5bb=['./lib/api','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe5bb,0x166));var _0xbe5b=function(_0x5690cf,_0x15e988){_0x5690cf=_0x5690cf-0x0;var _0x5f38f2=_0xe5bb[_0x5690cf];return _0x5f38f2;};'use strict';var asr=require(_0xbe5b('0x0'));module[_0xbe5b('0x1')]=function(_0x519e1e,_0x2a7bbd,_0x34120c,_0x15616a){return asr(_0x519e1e,_0x2a7bbd,_0x34120c);}; \ 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 5383a8a..e94b2f8 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 _0x32ef=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x32ef,0xf9));var _0xf32e=function(_0x77837d,_0x3027f5){_0x77837d=_0x77837d-0x0;var _0x4d7a79=_0x32ef[_0x77837d];return _0x4d7a79;};'use strict';var url=require(_0xf32e('0x0'));var BPromise=require(_0xf32e('0x1'));var fs=require('fs');var host=_0xf32e('0x2');module[_0xf32e('0x3')]=function(_0x286041,_0x82113b,_0x5da060){return new BPromise(function(_0x232ead,_0x1ff6ab){var _0x4ef070;if(typeof _0x286041!==_0xf32e('0x4')||_0x286041[_0xf32e('0x5')]===0x0){return _0x1ff6ab(_0xf32e('0x6'));}if(typeof _0x82113b!==_0xf32e('0x4')||_0x82113b[_0xf32e('0x5')]===0x0){return _0x1ff6ab(_0xf32e('0x7'));}if(typeof _0x5da060!=='undefined'&&(typeof _0x5da060!==_0xf32e('0x4')||_0x5da060['length']===0x0)){return _0x1ff6ab(_0xf32e('0x8'));}try{_0x4ef070=fs[_0xf32e('0x9')](_0x286041)[_0xf32e('0xa')](_0xf32e('0xb'));}catch(_0x243ad7){return _0x1ff6ab(_0x243ad7);}return _0x232ead({'method':'POST','uri':host+_0xf32e('0xc')+_0x82113b,'body':{'config':{'encoding':_0xf32e('0xd'),'sampleRateHertz':_0xf32e('0xe'),'languageCode':_0x5da060},'audio':{'content':_0x4ef070}},'json':!![]});});}; \ No newline at end of file +var _0x55e0=['bluebird','https://speech.googleapis.com','exports','string','length','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','url'];(function(_0x3ac83e,_0x9032a6){var _0x3b0e4e=function(_0xee57aa){while(--_0xee57aa){_0x3ac83e['push'](_0x3ac83e['shift']());}};_0x3b0e4e(++_0x9032a6);}(_0x55e0,0xdc));var _0x055e=function(_0x48c4ef,_0x319d44){_0x48c4ef=_0x48c4ef-0x0;var _0x435715=_0x55e0[_0x48c4ef];return _0x435715;};'use strict';var url=require(_0x055e('0x0'));var BPromise=require(_0x055e('0x1'));var fs=require('fs');var host=_0x055e('0x2');module[_0x055e('0x3')]=function(_0x5b82b9,_0x578882,_0x3a2ee6){return new BPromise(function(_0x2d9bd5,_0x33cd7b){var _0x2773e4;if(typeof _0x5b82b9!==_0x055e('0x4')||_0x5b82b9[_0x055e('0x5')]===0x0){return _0x33cd7b('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x578882!=='string'||_0x578882[_0x055e('0x5')]===0x0){return _0x33cd7b('key\x20should\x20be\x20a\x20string');}if(typeof _0x3a2ee6!==_0x055e('0x6')&&(typeof _0x3a2ee6!==_0x055e('0x4')||_0x3a2ee6[_0x055e('0x5')]===0x0)){return _0x33cd7b(_0x055e('0x7'));}try{_0x2773e4=fs[_0x055e('0x8')](_0x5b82b9)['toString'](_0x055e('0x9'));}catch(_0xd67814){return _0x33cd7b(_0xd67814);}return _0x2d9bd5({'method':_0x055e('0xa'),'uri':host+_0x055e('0xb')+_0x578882,'body':{'config':{'encoding':_0x055e('0xc'),'sampleRateHertz':'8000','languageCode':_0x3a2ee6},'audio':{'content':_0x2773e4}},'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 783b065..2cc6042 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 _0xc20e=['./asr'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xc20e,0xee));var _0xec20=function(_0x4f2ebf,_0x3d220c){_0x4f2ebf=_0x4f2ebf-0x0;var _0x45d931=_0xc20e[_0x4f2ebf];return _0x45d931;};var asr=require(_0xec20('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xeba8=['exports'];(function(_0x343a87,_0x287af9){var _0x432c43=function(_0x45cb62){while(--_0x45cb62){_0x343a87['push'](_0x343a87['shift']());}};_0x432c43(++_0x287af9);}(_0xeba8,0x119));var _0x8eba=function(_0x4369ef,_0x55cfbc){_0x4369ef=_0x4369ef-0x0;var _0x5b6913=_0xeba8[_0x4369ef];return _0x5b6913;};var asr=require('./asr');module[_0x8eba('0x0')]={'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 dfd4964..daa52c0 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 _0x9ed1=['results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','message','googleDialogflow','result','source','action','actionIncomplete','fulfillment','speech','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','queryResult','fields','diagnosticInfo','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','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','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','unlink','download\x20error','end','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','writeFileSync','base64','then','chmodSync','777','toString','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','generate','audioContent','.wav','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','uri'];(function(_0x3f4a75,_0x1ff97e){var _0x1cd60d=function(_0x317c0d){while(--_0x317c0d){_0x3f4a75['push'](_0x3f4a75['shift']());}};_0x1cd60d(++_0x1ff97e);}(_0x9ed1,0x142));var _0x19ed=function(_0x5df7ef,_0x16ad2b){_0x5df7ef=_0x5df7ef-0x0;var _0x1865d7=_0x9ed1[_0x5df7ef];return _0x1865d7;};'use strict';var apiai=require(_0x19ed('0x0'));var BPromise=require(_0x19ed('0x1'));var dialogflow=require(_0x19ed('0x2'));var fs=require('fs');var http=require(_0x19ed('0x3'));var https=require(_0x19ed('0x4'));var md5=require(_0x19ed('0x5'));var path=require(_0x19ed('0x6'));var querystring=require(_0x19ed('0x7'));var rp=require(_0x19ed('0x8'));var rs=require(_0x19ed('0x9'));var sox=require(_0x19ed('0xa'));var tts=require(_0x19ed('0xb'));var urlParse=require('url')[_0x19ed('0xc')];var util=require(_0x19ed('0xd'));var aws=require(_0x19ed('0xe'));var google=require(_0x19ed('0xf'));var sestek=require(_0x19ed('0x10'));var tilde=require(_0x19ed('0x11'));var logger=require(_0x19ed('0x12'))('agi');var ISPEECH_API=_0x19ed('0x13');function downloadFile(_0x52c071,_0x1434ea){return new BPromise(function(_0x4fe6a1,_0x592f76){var _0x4c6c09=urlParse(_0x52c071);var _0x577e8f=_0x4c6c09[_0x19ed('0x14')]==='https:'?https:http;var _0x5dc205={'host':_0x4c6c09[_0x19ed('0x15')],'path':_0x4c6c09['path'],'headers':{'user-agent':_0x19ed('0x16')}};_0x577e8f[_0x19ed('0x17')](_0x5dc205,function(_0x352c56){if(_0x352c56[_0x19ed('0x18')]!==0xc8){logger[_0x19ed('0x19')](_0x19ed('0x1a')+_0x52c071+'\x20failed,\x20status\x20code\x20=\x20'+_0x352c56[_0x19ed('0x18')]+'\x20('+_0x352c56[_0x19ed('0x1b')]+')');_0x592f76(new Error(_0x19ed('0x1a')+_0x52c071+_0x19ed('0x1c')+_0x352c56[_0x19ed('0x18')]+'\x20('+_0x352c56[_0x19ed('0x1b')]+')'));return;}var _0x30824f=fs[_0x19ed('0x1d')](_0x1434ea);_0x30824f['on'](_0x19ed('0x1e'),function(){logger[_0x19ed('0x1f')](_0x19ed('0x20'));_0x30824f['close'](_0x4fe6a1);});_0x30824f['on'](_0x19ed('0x19'),function(_0x28cd69){fs[_0x19ed('0x21')](_0x1434ea);logger[_0x19ed('0x19')](_0x19ed('0x22'),_0x28cd69);_0x592f76(_0x28cd69);});_0x352c56['pipe'](_0x30824f);})['on'](_0x19ed('0x19'),function(_0x157880){logger[_0x19ed('0x19')](_0x157880);_0x592f76(_0x157880);})[_0x19ed('0x23')]();});}function uploadFile(_0x4b4a2e){return new BPromise(function(_0x306c4d,_0x3001a6){var _0x32efd0=urlParse(_0x4b4a2e);var _0xba8303=_0x32efd0['protocol']==='https:'?https:http;var _0xd599b2={'host':_0x32efd0[_0x19ed('0x15')],'path':_0x32efd0[_0x19ed('0x6')],'headers':{'user-agent':_0x19ed('0x16')}};_0xba8303[_0x19ed('0x17')](_0xd599b2,function(_0x454eed){if(_0x454eed[_0x19ed('0x18')]!==0xc8){_0x3001a6(new Error('request\x20to\x20'+_0x4b4a2e+_0x19ed('0x1c')+_0x454eed[_0x19ed('0x18')]+'\x20('+_0x454eed['statusMessage']+')'));return;}var _0xaccb4='';_0x454eed['on']('data',function(_0x5edc64){_0xaccb4+=_0x5edc64;});_0x454eed['on'](_0x19ed('0x23'),function(){_0x306c4d(_0xaccb4);});})['on'](_0x19ed('0x19'),function(_0x2ecda6){_0x3001a6(_0x2ecda6);})['end']();});}function convertFile(_0x438672,_0x2664f2){return new BPromise(function(_0x1188eb,_0x593e3f){var _0x24736b=sox['transcode'](_0x438672,_0x2664f2,{'sampleRate':0x1f40,'format':_0x19ed('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x24736b['on'](_0x19ed('0x19'),function(_0x3e12d1){logger[_0x19ed('0x19')](_0x19ed('0x25'),_0x3e12d1);_0x593e3f(_0x3e12d1);});_0x24736b['on'](_0x19ed('0x23'),function(){logger[_0x19ed('0x1f')](_0x19ed('0x26'));_0x1188eb();});_0x24736b[_0x19ed('0x27')]();});}function base64Decode(_0x4a65aa,_0x1e0620){var _0x36d506=path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs['generate'](0x4)+'.wav');fs[_0x19ed('0x2a')](_0x36d506,_0x4a65aa,_0x19ed('0x2b'));return convertFile(_0x36d506,_0x1e0620)[_0x19ed('0x2c')](function(){try{fs[_0x19ed('0x21')](_0x36d506);fs[_0x19ed('0x2d')](_0x1e0620,_0x19ed('0x2e'));}catch(_0x34be67){logger[_0x19ed('0x19')](_0x34be67);}return _0x1e0620['split']('.')[0x0];});}function base64Encode(_0x1b82a0){var _0x3fead6=fs['readFileSync'](_0x1b82a0);return new Buffer(_0x3fead6)[_0x19ed('0x2f')](_0x19ed('0x2b'));}exports['googleCloudTTS']=function(_0x37eb5d,_0xef1a1,_0x58db37,_0x253526,_0x4b3a68,_0x37cf24){var _0x58f078,_0x5f3bf7;var _0x336951=_0x19ed('0x30');var _0x361298='?key='+_0x37eb5d;var _0x25ddfc={};if(_0xef1a1===_0x19ed('0x31')){_0x25ddfc[_0x19ed('0x32')]={'ssml':_0x58db37};}else{_0x25ddfc[_0x19ed('0x32')]={'text':_0x58db37};};_0x25ddfc[_0x19ed('0x33')]={'languageCode':_0x253526,'ssmlGender':_0x4b3a68};_0x25ddfc[_0x19ed('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x16719d={'url':_0x336951+'text:synthesize'+_0x361298,'method':'POST','json':!![],'body':_0x25ddfc};return rp(_0x16719d)[_0x19ed('0x2c')](function(_0x38be2a){return new BPromise(function(_0x188832,_0x41e723){_0x58f078=path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs[_0x19ed('0x35')](0x4)+'.mp3');var _0x303455=Buffer['from'](_0x38be2a[_0x19ed('0x36')],_0x19ed('0x2b'));return fs['writeFile'](_0x58f078,_0x303455,function(_0x2d4167){_0x41e723(_0x2d4167);},function(_0x518d0d){fs[_0x19ed('0x2d')](_0x58f078,_0x19ed('0x2e'));_0x188832(_0x518d0d);});});})[_0x19ed('0x2c')](function(_0x51ef21){_0x5f3bf7=path['resolve'](__dirname,_0x19ed('0x29'),rs[_0x19ed('0x35')](0x4)+_0x19ed('0x37'));return convertFile(_0x58f078,_0x5f3bf7);})[_0x19ed('0x2c')](function(){try{fs['unlink'](_0x58f078);fs[_0x19ed('0x2d')](_0x5f3bf7,'777');}catch(_0x15b1c5){logger['error'](_0x15b1c5);}logger[_0x19ed('0x1f')]('googleCloudTTS\x20path',_0x5f3bf7[_0x19ed('0x38')]('.')[0x0]);return _0x5f3bf7[_0x19ed('0x38')]('.')[0x0];});};exports[_0x19ed('0x39')]=function(_0x1e9560,_0x33e38e){var _0x1ba7c0=_0x19ed('0x3a');var _0x2ecc84,_0x5c030a;var _0x116729;var _0x4fca1e={'encoding':_0x19ed('0x3b'),'method':_0x19ed('0x3c'),'timeout':0x2710,'url':_0x1ba7c0,'headers':{'Content-Type':_0x19ed('0x3d')},'body':_0x19ed('0x3e')+encodeURIComponent(JSON['stringify']([[[_0x19ed('0x3f'),JSON[_0x19ed('0x40')]([_0x1e9560,_0x33e38e||'en',![],_0x19ed('0x41')]),null,_0x19ed('0x42')]]]))};return rp(_0x4fca1e)[_0x19ed('0x2c')](function(_0x4000d6){try{_0x116729=eval(_0x4000d6[_0x19ed('0x43')](0x5))[0x0][0x2];}catch(_0x63f9d8){throw new Error(_0x19ed('0x44')+_0x4000d6[_0x19ed('0x45')]);}if(!_0x116729){if(_0x1e9560[_0x19ed('0x46')]>0xc8){throw new Error(_0x19ed('0x47'));}else{throw new Error('lang\x20\x22'+_0x33e38e+_0x19ed('0x48'));}}try{_0x116729=eval(_0x116729)[0x0];}catch(_0x551b1c){throw new Error(_0x19ed('0x44')+res[_0x19ed('0x45')]);}const _0x44ff30=_0x116729;_0x2ecc84=path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs['generate'](0x4)+_0x19ed('0x49'));fs[_0x19ed('0x2a')](_0x2ecc84,_0x116729,{'encoding':_0x19ed('0x2b')});_0x5c030a=path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs['generate'](0x4)+_0x19ed('0x37'));return convertFile(_0x2ecc84,_0x5c030a);})[_0x19ed('0x2c')](function(){try{fs[_0x19ed('0x21')](_0x2ecc84);fs[_0x19ed('0x2d')](_0x5c030a,_0x19ed('0x2e'));}catch(_0x17ce98){logger[_0x19ed('0x19')](_0x17ce98);}logger['info'](_0x19ed('0x4a'),_0x5c030a[_0x19ed('0x38')]('.')[0x0]);return _0x5c030a[_0x19ed('0x38')]('.')[0x0];});};exports[_0x19ed('0x4b')]=function(_0x1f2432,_0x506bfc,_0x3b8c32){return google['asr'](_0x1f2432,_0x506bfc,_0x3b8c32)[_0x19ed('0x2c')](function(_0x4b82f3){logger[_0x19ed('0x1f')](_0x4b82f3[_0x19ed('0x4c')]);return rp(_0x4b82f3);})[_0x19ed('0x2c')](function(_0x21cb17){var _0x4991a4='';var _0x3dc7e2=0x0;try{fs['unlink'](_0x1f2432);}catch(_0x227b33){logger[_0x19ed('0x19')](_0x227b33);}if(_0x21cb17&&_0x21cb17['results']){_0x4991a4=_0x21cb17[_0x19ed('0x4d')][_0x19ed('0x4e')](function(_0x319cfc){return _0x319cfc&&_0x319cfc['alternatives'][0x0]&&_0x319cfc[_0x19ed('0x4f')][0x0][_0x19ed('0x50')]?_0x319cfc[_0x19ed('0x4f')][0x0]['transcript']:'';})['join']('\x0a');_0x3dc7e2=_0x21cb17[_0x19ed('0x4d')]['map'](function(_0x33b297){return _0x33b297&&_0x33b297['alternatives'][0x0]&&_0x33b297[_0x19ed('0x4f')][0x0][_0x19ed('0x51')]?_0x33b297[_0x19ed('0x4f')][0x0][_0x19ed('0x51')]:0x0;})[_0x19ed('0x52')]('\x0a');}logger['info'](_0x19ed('0x53'),_0x4991a4);logger[_0x19ed('0x1f')](_0x19ed('0x54'),_0x3dc7e2);return{'transcript':_0x4991a4,'confidence':_0x3dc7e2};})[_0x19ed('0x55')](function(_0x115fcb){logger[_0x19ed('0x19')]('[%s]\x20%s:%s',_0x115fcb[_0x19ed('0x18')],_0x115fcb['name'],_0x115fcb[_0x19ed('0x56')]);});};exports[_0x19ed('0x57')]=function(_0x388615,_0x5eb6af,_0x38a077,_0x3f03c2){var _0x1d7cda=apiai(_0x5eb6af,{'language':_0x3f03c2||'en'});return _0x1d7cda['textRequest'](_0x38a077,{'sessionId':md5(_0x388615)})[_0x19ed('0x2c')](function(_0x3a8961){logger['info'](JSON[_0x19ed('0x40')](_0x3a8961));return{'source':_0x3a8961[_0x19ed('0x58')][_0x19ed('0x59')],'resolvedQuery':_0x3a8961[_0x19ed('0x58')]['resolvedQuery'],'action':_0x3a8961['result'][_0x19ed('0x5a')],'actionIncomplete':_0x3a8961[_0x19ed('0x58')][_0x19ed('0x5b')],'speech':_0x3a8961[_0x19ed('0x58')][_0x19ed('0x5c')][_0x19ed('0x5d')],'score':_0x3a8961[_0x19ed('0x58')]['score'],'statusCode':_0x3a8961['status']['code'],'endConversation':_0x3a8961['result']['metadata'][_0x19ed('0x5e')]||![],'isFallbackIntent':_0x3a8961[_0x19ed('0x58')]['metadata']['isFallbackIntent']};});};exports[_0x19ed('0x5f')]=function(_0x40ba03,_0x112791,_0x53d64a,_0x2b1d99,_0x2c0e12,_0x5b5bb3){var _0x150df5=_0x2b1d99[_0x19ed('0x60')](/\\n/g,'\x0a');var _0x4c213d={'credentials':{'private_key':_0x150df5,'client_email':_0x53d64a}};var _0xa272b4=new dialogflow[(_0x19ed('0x61'))](_0x4c213d);var _0x2e2514=_0xa272b4[_0x19ed('0x62')](_0x112791,md5(_0x40ba03));var _0x47234c={'session':_0x2e2514,'queryInput':{'text':{'text':_0x2c0e12,'languageCode':_0x5b5bb3}}};return _0xa272b4[_0x19ed('0x63')](_0x47234c)['then'](function(_0x51b98){if(_0x51b98&&_0x51b98[_0x19ed('0x46')]){logger[_0x19ed('0x1f')](_0x19ed('0x64'),JSON[_0x19ed('0x40')](_0x51b98));var _0x3c9f9c=_0x51b98[0x0];if(_0x3c9f9c){var _0x45e40a={'action':_0x3c9f9c['queryResult']['action'],'allRequiredParamsPresent':_0x3c9f9c['queryResult'][_0x19ed('0x65')],'endConversation':_0x3c9f9c[_0x19ed('0x66')]['diagnosticInfo']&&_0x3c9f9c[_0x19ed('0x66')]['diagnosticInfo'][_0x19ed('0x67')]?_0x3c9f9c['queryResult'][_0x19ed('0x68')]['fields']['end_conversation'][_0x19ed('0x69')]:![],'fulfillmentText':_0x3c9f9c['queryResult'][_0x19ed('0x6a')],'intentName':_0x3c9f9c[_0x19ed('0x66')][_0x19ed('0x6b')]['name'],'intentDisplayName':_0x3c9f9c[_0x19ed('0x66')][_0x19ed('0x6b')][_0x19ed('0x6c')],'isFallbackIntent':_0x3c9f9c['queryResult'][_0x19ed('0x6b')][_0x19ed('0x6d')],'languageCode':_0x3c9f9c[_0x19ed('0x66')][_0x19ed('0x6e')],'queryText':_0x3c9f9c[_0x19ed('0x66')]['queryText'],'responseId':_0x3c9f9c[_0x19ed('0x6f')],'score':_0x3c9f9c[_0x19ed('0x66')][_0x19ed('0x70')],'speech':_0x3c9f9c['queryResult'][_0x19ed('0x6a')],'providerResponse':JSON[_0x19ed('0x40')](_0x51b98)};return _0x45e40a;}}});};exports[_0x19ed('0x71')]=function(_0x31b23e,_0xe8e5e0,_0x3ad518,_0x1e7e63){return tilde[_0x19ed('0x72')](_0x31b23e,_0xe8e5e0,_0x3ad518,_0x1e7e63)[_0x19ed('0x2c')](function(_0x118f03){try{fs[_0x19ed('0x21')](_0x31b23e);}catch(_0x229099){logger[_0x19ed('0x19')](_0x229099);}logger['info'](_0x19ed('0x73'),_0x118f03[_0x19ed('0x50')]);logger[_0x19ed('0x1f')](_0x19ed('0x74'),_0x118f03['confidence']);return _0x118f03;});};exports[_0x19ed('0x75')]=function(_0x275541,_0x83a39d,_0x1f71bf,_0x33e0ad,_0x569086,_0x296679){var _0x3af0f5=path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs[_0x19ed('0x35')](0x4)+_0x19ed('0x49'));var _0x1c0152;return aws[_0x19ed('0x76')](_0x275541,_0x83a39d,_0x1f71bf,_0x33e0ad,_0x569086,_0x296679,_0x3af0f5)[_0x19ed('0x2c')](function(){_0x1c0152=path[_0x19ed('0x28')](__dirname,'tmp',rs[_0x19ed('0x35')](0x4)+_0x19ed('0x37'));return convertFile(_0x3af0f5,_0x1c0152);})['then'](function(){try{fs[_0x19ed('0x21')](_0x3af0f5);fs[_0x19ed('0x2d')](_0x1c0152,'777');}catch(_0x38983f){logger[_0x19ed('0x19')](_0x38983f);}return _0x1c0152[_0x19ed('0x38')]('.')[0x0];});};exports[_0x19ed('0x77')]=function(_0x30dd07,_0x338e35,_0x1acab8,_0xeff821,_0x3e1905,_0x58ef5c){return aws[_0x19ed('0x78')](_0x30dd07,_0x338e35,_0x1acab8,_0xeff821,_0x3e1905,_0x58ef5c)[_0x19ed('0x2c')](function(_0x21194c){logger[_0x19ed('0x1f')](JSON[_0x19ed('0x40')](_0x21194c));return _0x21194c;});};exports[_0x19ed('0x79')]=function(_0x3ab300,_0x5b8ae9,_0x34294a,_0x4dfd80){var _0x5db03e=util[_0x19ed('0x7a')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x3ab300,encodeURIComponent(_0x5b8ae9),_0x34294a,_0x4dfd80);var _0x552b26=path['resolve'](__dirname,_0x19ed('0x29'),rs[_0x19ed('0x35')](0x4)+_0x19ed('0x49'));var _0x548584;return downloadFile(_0x5db03e,_0x552b26)[_0x19ed('0x2c')](function(){_0x548584=path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs[_0x19ed('0x35')](0x4)+'.wav');return convertFile(_0x552b26,_0x548584);})[_0x19ed('0x2c')](function(){try{fs[_0x19ed('0x21')](_0x552b26);fs[_0x19ed('0x2d')](_0x548584,'777');}catch(_0x55ae48){logger['error'](_0x55ae48);}return _0x548584['split']('.')[0x0];});};exports[_0x19ed('0x7b')]=function(_0x319216,_0x1bdd54,_0x3dc605,_0x178944){var _0x194a2e=util['format'](_0x19ed('0x7c'),ISPEECH_API,_0x1bdd54,_0x3dc605,base64Encode(_0x319216),_0x178944?util['format'](_0x19ed('0x7d'),encodeURIComponent(_0x178944)):'freeform=3');return uploadFile(_0x194a2e)[_0x19ed('0x2c')](function(_0x2d364f){return querystring[_0x19ed('0xc')](_0x2d364f);});};exports['sestekNDA']=function(_0x434026,_0x3fc5be){return sestek[_0x19ed('0x7e')](_0x434026,_0x3fc5be)[_0x19ed('0x2c')](function(_0x3ebad1){logger['info'](JSON[_0x19ed('0x40')](_0x3ebad1));var _0x3e1063={'speech':_0x3ebad1['text'],'action':_0x3ebad1[_0x19ed('0x7f')]?_0x3ebad1[_0x19ed('0x7f')][_0x19ed('0x80')]:undefined,'actiondata':_0x3ebad1[_0x19ed('0x7f')]?_0x3ebad1[_0x19ed('0x7f')][_0x19ed('0x81')]:undefined};if(_0x3ebad1[_0x19ed('0x7f')]&&_0x3ebad1[_0x19ed('0x7f')][_0x19ed('0x82')]){return base64Decode(_0x3ebad1[_0x19ed('0x7f')][_0x19ed('0x82')][_0x19ed('0x83')],path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs['generate'](0x4)+_0x19ed('0x37')))['then'](function(_0x4e46fe){_0x3e1063[_0x19ed('0x84')]=_0x4e46fe;return _0x3e1063;});}return _0x3e1063;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xdc0e=['readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','writeFile','.wav','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','goggleTTS\x20path','map','alternatives','transcript','join','results','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','result','source','action','speech','score','status','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','dialogflow','http','https','md5','querystring','request-promise','randomstring','sox','parse','util','./tilde','agi','https://api.ispeech.org/api/rest','host','path','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','close','unlink','download\x20error','pipe','protocol','https:','request\x20to\x20','data','end','transcode','wav','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','777'];(function(_0x4db1f4,_0x20352b){var _0x10110b=function(_0x4b3c9e){while(--_0x4b3c9e){_0x4db1f4['push'](_0x4db1f4['shift']());}};_0x10110b(++_0x20352b);}(_0xdc0e,0x1eb));var _0xedc0=function(_0x45a7a6,_0x380289){_0x45a7a6=_0x45a7a6-0x0;var _0x514f51=_0xdc0e[_0x45a7a6];return _0x514f51;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0xedc0('0x0'));var fs=require('fs');var http=require(_0xedc0('0x1'));var https=require(_0xedc0('0x2'));var md5=require(_0xedc0('0x3'));var path=require('path');var querystring=require(_0xedc0('0x4'));var rp=require(_0xedc0('0x5'));var rs=require(_0xedc0('0x6'));var sox=require(_0xedc0('0x7'));var tts=require('google-tts-api');var urlParse=require('url')[_0xedc0('0x8')];var util=require(_0xedc0('0x9'));var aws=require('./aws');var google=require('./google');var sestek=require('./sestek');var tilde=require(_0xedc0('0xa'));var logger=require('../../../config/logger')(_0xedc0('0xb'));var ISPEECH_API=_0xedc0('0xc');function downloadFile(_0x229df2,_0x52ba8b){return new BPromise(function(_0x222e2b,_0x407e3c){var _0x574df3=urlParse(_0x229df2);var _0x436842=_0x574df3['protocol']==='https:'?https:http;var _0x21ba1b={'host':_0x574df3[_0xedc0('0xd')],'path':_0x574df3[_0xedc0('0xe')],'headers':{'user-agent':_0xedc0('0xf')}};_0x436842[_0xedc0('0x10')](_0x21ba1b,function(_0x1d6932){if(_0x1d6932[_0xedc0('0x11')]!==0xc8){logger[_0xedc0('0x12')]('request\x20to\x20'+_0x229df2+_0xedc0('0x13')+_0x1d6932[_0xedc0('0x11')]+'\x20('+_0x1d6932[_0xedc0('0x14')]+')');_0x407e3c(new Error('request\x20to\x20'+_0x229df2+_0xedc0('0x13')+_0x1d6932[_0xedc0('0x11')]+'\x20('+_0x1d6932[_0xedc0('0x14')]+')'));return;}var _0x506678=fs[_0xedc0('0x15')](_0x52ba8b);_0x506678['on'](_0xedc0('0x16'),function(){logger[_0xedc0('0x17')]('finish\x20download\x20file');_0x506678[_0xedc0('0x18')](_0x222e2b);});_0x506678['on']('error',function(_0x1ba7db){fs[_0xedc0('0x19')](_0x52ba8b);logger[_0xedc0('0x12')](_0xedc0('0x1a'),_0x1ba7db);_0x407e3c(_0x1ba7db);});_0x1d6932[_0xedc0('0x1b')](_0x506678);})['on'](_0xedc0('0x12'),function(_0x52a857){logger[_0xedc0('0x12')](_0x52a857);_0x407e3c(_0x52a857);})['end']();});}function uploadFile(_0x485a7c){return new BPromise(function(_0x2ee564,_0x366829){var _0x2f7b54=urlParse(_0x485a7c);var _0xfdbe95=_0x2f7b54[_0xedc0('0x1c')]===_0xedc0('0x1d')?https:http;var _0x4beca1={'host':_0x2f7b54[_0xedc0('0xd')],'path':_0x2f7b54[_0xedc0('0xe')],'headers':{'user-agent':_0xedc0('0xf')}};_0xfdbe95[_0xedc0('0x10')](_0x4beca1,function(_0x43262e){if(_0x43262e[_0xedc0('0x11')]!==0xc8){_0x366829(new Error(_0xedc0('0x1e')+_0x485a7c+'\x20failed,\x20status\x20code\x20=\x20'+_0x43262e[_0xedc0('0x11')]+'\x20('+_0x43262e[_0xedc0('0x14')]+')'));return;}var _0x232aeb='';_0x43262e['on'](_0xedc0('0x1f'),function(_0x3b369a){_0x232aeb+=_0x3b369a;});_0x43262e['on'](_0xedc0('0x20'),function(){_0x2ee564(_0x232aeb);});})['on'](_0xedc0('0x12'),function(_0x38ec8a){_0x366829(_0x38ec8a);})['end']();});}function convertFile(_0x4dd412,_0x13ca7b){return new BPromise(function(_0x251468,_0x53d452){var _0x4ca13c=sox[_0xedc0('0x21')](_0x4dd412,_0x13ca7b,{'sampleRate':0x1f40,'format':_0xedc0('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4ca13c['on']('error',function(_0xafaca4){logger['error']('error\x20convert',_0xafaca4);_0x53d452(_0xafaca4);});_0x4ca13c['on']('end',function(){logger[_0xedc0('0x17')](_0xedc0('0x23'));_0x251468();});_0x4ca13c[_0xedc0('0x24')]();});}function base64Decode(_0x2a8f3f,_0x1e8050){var _0x2aeb87=path[_0xedc0('0x25')](__dirname,_0xedc0('0x26'),rs[_0xedc0('0x27')](0x4)+'.wav');fs[_0xedc0('0x28')](_0x2aeb87,_0x2a8f3f,_0xedc0('0x29'));return convertFile(_0x2aeb87,_0x1e8050)[_0xedc0('0x2a')](function(){try{fs[_0xedc0('0x19')](_0x2aeb87);fs[_0xedc0('0x2b')](_0x1e8050,_0xedc0('0x2c'));}catch(_0xd8ce7c){logger[_0xedc0('0x12')](_0xd8ce7c);}return _0x1e8050['split']('.')[0x0];});}function base64Encode(_0x1af5ed){var _0x419ab3=fs[_0xedc0('0x2d')](_0x1af5ed);return new Buffer(_0x419ab3)[_0xedc0('0x2e')](_0xedc0('0x29'));}exports[_0xedc0('0x2f')]=function(_0x4fff85,_0x448b18,_0x38823f,_0x2a7535,_0x112cbb,_0x418e20){var _0x51da25,_0x19af6b;var _0x5f50fe=_0xedc0('0x30');var _0x48aaf1=_0xedc0('0x31')+_0x4fff85;var _0x550709={};if(_0x448b18===_0xedc0('0x32')){_0x550709[_0xedc0('0x33')]={'ssml':_0x38823f};}else{_0x550709[_0xedc0('0x33')]={'text':_0x38823f};};_0x550709[_0xedc0('0x34')]={'languageCode':_0x2a7535,'ssmlGender':_0x112cbb};_0x550709[_0xedc0('0x35')]={'audioEncoding':_0xedc0('0x36'),'sampleRateHertz':0x1f40};var _0xf06d65={'url':_0x5f50fe+_0xedc0('0x37')+_0x48aaf1,'method':_0xedc0('0x38'),'json':!![],'body':_0x550709};return rp(_0xf06d65)[_0xedc0('0x2a')](function(_0x9cad04){return new BPromise(function(_0x168d8,_0x1b6006){_0x51da25=path[_0xedc0('0x25')](__dirname,'tmp',rs['generate'](0x4)+_0xedc0('0x39'));var _0x21271d=Buffer[_0xedc0('0x3a')](_0x9cad04['audioContent'],'base64');return fs[_0xedc0('0x3b')](_0x51da25,_0x21271d,function(_0x520aa8){_0x1b6006(_0x520aa8);},function(_0x481d06){fs['chmodSync'](_0x51da25,_0xedc0('0x2c'));_0x168d8(_0x481d06);});});})[_0xedc0('0x2a')](function(_0x213fef){_0x19af6b=path[_0xedc0('0x25')](__dirname,_0xedc0('0x26'),rs[_0xedc0('0x27')](0x4)+_0xedc0('0x3c'));return convertFile(_0x51da25,_0x19af6b);})['then'](function(){try{fs['unlink'](_0x51da25);fs[_0xedc0('0x2b')](_0x19af6b,'777');}catch(_0x15e1da){logger[_0xedc0('0x12')](_0x15e1da);}logger[_0xedc0('0x17')](_0xedc0('0x3d'),_0x19af6b[_0xedc0('0x3e')]('.')[0x0]);return _0x19af6b[_0xedc0('0x3e')]('.')[0x0];});};exports[_0xedc0('0x3f')]=function(_0x2924fa,_0x383698){var _0x591c40=_0xedc0('0x40');var _0x5d6011,_0x11c17c;var _0x54ba9d;var _0x318e9c={'encoding':'utf8','method':_0xedc0('0x38'),'timeout':0x2710,'url':_0x591c40,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xedc0('0x41')+encodeURIComponent(JSON[_0xedc0('0x42')]([[[_0xedc0('0x43'),JSON[_0xedc0('0x42')]([_0x2924fa,_0x383698||'en',![],_0xedc0('0x44')]),null,_0xedc0('0x45')]]]))};return rp(_0x318e9c)['then'](function(_0x49ca5c){try{_0x54ba9d=eval(_0x49ca5c[_0xedc0('0x46')](0x5))[0x0][0x2];}catch(_0x3f19ce){throw new Error(_0xedc0('0x47')+_0x49ca5c[_0xedc0('0x1f')]);}if(!_0x54ba9d){if(_0x2924fa[_0xedc0('0x48')]>0xc8){throw new Error(_0xedc0('0x49'));}else{throw new Error('lang\x20\x22'+_0x383698+'\x22\x20might\x20not\x20exist');}}try{_0x54ba9d=eval(_0x54ba9d)[0x0];}catch(_0x1ac4ec){throw new Error(_0xedc0('0x47')+res[_0xedc0('0x1f')]);}const _0x172fbf=_0x54ba9d;_0x5d6011=path[_0xedc0('0x25')](__dirname,_0xedc0('0x26'),rs['generate'](0x4)+_0xedc0('0x39'));fs['writeFileSync'](_0x5d6011,_0x54ba9d,{'encoding':_0xedc0('0x29')});_0x11c17c=path['resolve'](__dirname,'tmp',rs[_0xedc0('0x27')](0x4)+_0xedc0('0x3c'));return convertFile(_0x5d6011,_0x11c17c);})[_0xedc0('0x2a')](function(){try{fs[_0xedc0('0x19')](_0x5d6011);fs[_0xedc0('0x2b')](_0x11c17c,_0xedc0('0x2c'));}catch(_0x1080be){logger['error'](_0x1080be);}logger['info'](_0xedc0('0x4a'),_0x11c17c[_0xedc0('0x3e')]('.')[0x0]);return _0x11c17c[_0xedc0('0x3e')]('.')[0x0];});};exports['googleASR']=function(_0x36d831,_0x3d4027,_0x16129f){return google['asr'](_0x36d831,_0x3d4027,_0x16129f)[_0xedc0('0x2a')](function(_0x25ccbf){logger[_0xedc0('0x17')](_0x25ccbf['uri']);return rp(_0x25ccbf);})[_0xedc0('0x2a')](function(_0x181f6b){var _0x4db9b2='';var _0x464d32=0x0;try{fs[_0xedc0('0x19')](_0x36d831);}catch(_0x28e506){logger['error'](_0x28e506);}if(_0x181f6b&&_0x181f6b['results']){_0x4db9b2=_0x181f6b['results'][_0xedc0('0x4b')](function(_0x3193e4){return _0x3193e4&&_0x3193e4[_0xedc0('0x4c')][0x0]&&_0x3193e4[_0xedc0('0x4c')][0x0][_0xedc0('0x4d')]?_0x3193e4[_0xedc0('0x4c')][0x0][_0xedc0('0x4d')]:'';})[_0xedc0('0x4e')]('\x0a');_0x464d32=_0x181f6b[_0xedc0('0x4f')][_0xedc0('0x4b')](function(_0x1e8e87){return _0x1e8e87&&_0x1e8e87[_0xedc0('0x4c')][0x0]&&_0x1e8e87['alternatives'][0x0][_0xedc0('0x50')]?_0x1e8e87[_0xedc0('0x4c')][0x0]['confidence']:0x0;})[_0xedc0('0x4e')]('\x0a');}logger[_0xedc0('0x17')](_0xedc0('0x51'),_0x4db9b2);logger[_0xedc0('0x17')](_0xedc0('0x52'),_0x464d32);return{'transcript':_0x4db9b2,'confidence':_0x464d32};})[_0xedc0('0x53')](function(_0x4db226){logger[_0xedc0('0x12')]('[%s]\x20%s:%s',_0x4db226['statusCode'],_0x4db226[_0xedc0('0x54')],_0x4db226[_0xedc0('0x55')]);});};exports[_0xedc0('0x56')]=function(_0x1bb6d3,_0x3a3183,_0x37dad0,_0x2177b3){var _0x13ad9b=apiai(_0x3a3183,{'language':_0x2177b3||'en'});return _0x13ad9b[_0xedc0('0x57')](_0x37dad0,{'sessionId':md5(_0x1bb6d3)})[_0xedc0('0x2a')](function(_0x49fc73){logger['info'](JSON[_0xedc0('0x42')](_0x49fc73));return{'source':_0x49fc73[_0xedc0('0x58')][_0xedc0('0x59')],'resolvedQuery':_0x49fc73[_0xedc0('0x58')]['resolvedQuery'],'action':_0x49fc73[_0xedc0('0x58')][_0xedc0('0x5a')],'actionIncomplete':_0x49fc73[_0xedc0('0x58')]['actionIncomplete'],'speech':_0x49fc73[_0xedc0('0x58')]['fulfillment'][_0xedc0('0x5b')],'score':_0x49fc73[_0xedc0('0x58')][_0xedc0('0x5c')],'statusCode':_0x49fc73[_0xedc0('0x5d')][_0xedc0('0x5e')],'endConversation':_0x49fc73[_0xedc0('0x58')][_0xedc0('0x5f')][_0xedc0('0x60')]||![],'isFallbackIntent':_0x49fc73[_0xedc0('0x58')][_0xedc0('0x5f')]['isFallbackIntent']};});};exports[_0xedc0('0x61')]=function(_0x52d8ad,_0x491084,_0x23bd5b,_0x3e138,_0x2091c3,_0x9fae5b){var _0x36da08=_0x3e138[_0xedc0('0x62')](/\\n/g,'\x0a');var _0x2e47c3={'credentials':{'private_key':_0x36da08,'client_email':_0x23bd5b}};var _0x1521b0=new dialogflow[(_0xedc0('0x63'))](_0x2e47c3);var _0xe466b4=_0x1521b0[_0xedc0('0x64')](_0x491084,md5(_0x52d8ad));var _0x254cc5={'session':_0xe466b4,'queryInput':{'text':{'text':_0x2091c3,'languageCode':_0x9fae5b}}};return _0x1521b0[_0xedc0('0x65')](_0x254cc5)['then'](function(_0x3b4475){if(_0x3b4475&&_0x3b4475[_0xedc0('0x48')]){logger[_0xedc0('0x17')](_0xedc0('0x66'),JSON['stringify'](_0x3b4475));var _0x484ddb=_0x3b4475[0x0];if(_0x484ddb){var _0x5199d1={'action':_0x484ddb[_0xedc0('0x67')][_0xedc0('0x5a')],'allRequiredParamsPresent':_0x484ddb[_0xedc0('0x67')]['allRequiredParamsPresent'],'endConversation':_0x484ddb['queryResult'][_0xedc0('0x68')]&&_0x484ddb[_0xedc0('0x67')]['diagnosticInfo'][_0xedc0('0x69')]?_0x484ddb[_0xedc0('0x67')]['diagnosticInfo'][_0xedc0('0x69')]['end_conversation']['boolValue']:![],'fulfillmentText':_0x484ddb[_0xedc0('0x67')][_0xedc0('0x6a')],'intentName':_0x484ddb['queryResult'][_0xedc0('0x6b')][_0xedc0('0x54')],'intentDisplayName':_0x484ddb[_0xedc0('0x67')][_0xedc0('0x6b')][_0xedc0('0x6c')],'isFallbackIntent':_0x484ddb[_0xedc0('0x67')][_0xedc0('0x6b')][_0xedc0('0x6d')],'languageCode':_0x484ddb['queryResult'][_0xedc0('0x6e')],'queryText':_0x484ddb['queryResult'][_0xedc0('0x6f')],'responseId':_0x484ddb[_0xedc0('0x70')],'score':_0x484ddb['queryResult'][_0xedc0('0x71')],'speech':_0x484ddb[_0xedc0('0x67')][_0xedc0('0x6a')],'providerResponse':JSON[_0xedc0('0x42')](_0x3b4475)};return _0x5199d1;}}});};exports[_0xedc0('0x72')]=function(_0x42c8e2,_0x2ca302,_0x916e9e,_0x5bb7b2){return tilde['asr'](_0x42c8e2,_0x2ca302,_0x916e9e,_0x5bb7b2)[_0xedc0('0x2a')](function(_0x1a2ecc){try{fs['unlink'](_0x42c8e2);}catch(_0x21ac1b){logger['error'](_0x21ac1b);}logger['info'](_0xedc0('0x73'),_0x1a2ecc['transcript']);logger['info'](_0xedc0('0x74'),_0x1a2ecc[_0xedc0('0x50')]);return _0x1a2ecc;});};exports['awsPolly']=function(_0x5bfa47,_0x3c8ff8,_0x4fdb0e,_0x5ecb52,_0x33bba4,_0x62045b){var _0x576553=path[_0xedc0('0x25')](__dirname,_0xedc0('0x26'),rs[_0xedc0('0x27')](0x4)+_0xedc0('0x39'));var _0x332480;return aws[_0xedc0('0x75')](_0x5bfa47,_0x3c8ff8,_0x4fdb0e,_0x5ecb52,_0x33bba4,_0x62045b,_0x576553)[_0xedc0('0x2a')](function(){_0x332480=path['resolve'](__dirname,_0xedc0('0x26'),rs['generate'](0x4)+_0xedc0('0x3c'));return convertFile(_0x576553,_0x332480);})[_0xedc0('0x2a')](function(){try{fs[_0xedc0('0x19')](_0x576553);fs[_0xedc0('0x2b')](_0x332480,_0xedc0('0x2c'));}catch(_0x31573f){logger['error'](_0x31573f);}return _0x332480[_0xedc0('0x3e')]('.')[0x0];});};exports[_0xedc0('0x76')]=function(_0x3d427f,_0x10d1e6,_0x4c0508,_0x5d351a,_0x30d90a,_0x32c1e1){return aws['lex'](_0x3d427f,_0x10d1e6,_0x4c0508,_0x5d351a,_0x30d90a,_0x32c1e1)[_0xedc0('0x2a')](function(_0x47374e){logger[_0xedc0('0x17')](JSON[_0xedc0('0x42')](_0x47374e));return _0x47374e;});};exports[_0xedc0('0x77')]=function(_0x20fb57,_0x2daae9,_0x169830,_0xaa9322){var _0xc9d72d=util[_0xedc0('0x78')](_0xedc0('0x79'),ISPEECH_API,_0x20fb57,encodeURIComponent(_0x2daae9),_0x169830,_0xaa9322);var _0x1fab24=path[_0xedc0('0x25')](__dirname,_0xedc0('0x26'),rs[_0xedc0('0x27')](0x4)+'.mp3');var _0x2db24b;return downloadFile(_0xc9d72d,_0x1fab24)['then'](function(){_0x2db24b=path[_0xedc0('0x25')](__dirname,'tmp',rs['generate'](0x4)+_0xedc0('0x3c'));return convertFile(_0x1fab24,_0x2db24b);})[_0xedc0('0x2a')](function(){try{fs['unlink'](_0x1fab24);fs[_0xedc0('0x2b')](_0x2db24b,_0xedc0('0x2c'));}catch(_0x4b4571){logger[_0xedc0('0x12')](_0x4b4571);}return _0x2db24b[_0xedc0('0x3e')]('.')[0x0];});};exports[_0xedc0('0x7a')]=function(_0x38f1aa,_0x321671,_0x413f7f,_0x1f4c9){var _0x55e7b3=util[_0xedc0('0x78')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x321671,_0x413f7f,base64Encode(_0x38f1aa),_0x1f4c9?util[_0xedc0('0x78')](_0xedc0('0x7b'),encodeURIComponent(_0x1f4c9)):_0xedc0('0x7c'));return uploadFile(_0x55e7b3)[_0xedc0('0x2a')](function(_0x1f64ba){return querystring['parse'](_0x1f64ba);});};exports['sestekNDA']=function(_0x18ece8,_0x19adb6){return sestek[_0xedc0('0x7d')](_0x18ece8,_0x19adb6)[_0xedc0('0x2a')](function(_0x166e16){logger[_0xedc0('0x17')](JSON['stringify'](_0x166e16));var _0x1000ba={'speech':_0x166e16[_0xedc0('0x7e')],'action':_0x166e16[_0xedc0('0x7f')]?_0x166e16[_0xedc0('0x7f')][_0xedc0('0x80')]:undefined,'actiondata':_0x166e16[_0xedc0('0x7f')]?_0x166e16[_0xedc0('0x7f')][_0xedc0('0x81')]:undefined};if(_0x166e16[_0xedc0('0x7f')]&&_0x166e16[_0xedc0('0x7f')][_0xedc0('0x82')]){return base64Decode(_0x166e16[_0xedc0('0x7f')][_0xedc0('0x82')][_0xedc0('0x83')],path['resolve'](__dirname,'tmp',rs[_0xedc0('0x27')](0x4)+_0xedc0('0x3c')))[_0xedc0('0x2a')](function(_0x33c0d1){_0x1000ba[_0xedc0('0x84')]=_0x33c0d1;return _0x1000ba;});}return _0x1000ba;});};exports[_0xedc0('0x85')]=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 ddb582e..edfaa67 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 _0x0a59=['./nda'];(function(_0x59b98f,_0x3f143e){var _0x51f042=function(_0x3019d8){while(--_0x3019d8){_0x59b98f['push'](_0x59b98f['shift']());}};_0x51f042(++_0x3f143e);}(_0x0a59,0xaf));var _0x90a5=function(_0x42119d,_0x21f004){_0x42119d=_0x42119d-0x0;var _0x767ad3=_0x0a59[_0x42119d];return _0x767ad3;};var nda=require(_0x90a5('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0xed44=['exports','./nda'];(function(_0x554131,_0x4f835a){var _0x287224=function(_0x15456c){while(--_0x15456c){_0x554131['push'](_0x554131['shift']());}};_0x287224(++_0x4f835a);}(_0xed44,0x105));var _0x4ed4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xed44[_0x321bb2];return _0x9c12ed;};var nda=require(_0x4ed4('0x0'));module[_0x4ed4('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 f4796d5..eabc786 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 _0x25a3=['url','../../../../../config/logger','exports','POST','ndauth_url','/token','password','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','Bearer\x20','access_token','project','body','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise'];(function(_0x463070,_0x8ad452){var _0x265b86=function(_0x134491){while(--_0x134491){_0x463070['push'](_0x463070['shift']());}};_0x265b86(++_0x8ad452);}(_0x25a3,0x121));var _0x325a=function(_0x145f0e,_0x4c0ffd){_0x145f0e=_0x145f0e-0x0;var _0x2e41bf=_0x25a3[_0x145f0e];return _0x2e41bf;};'use strict';var rp=require(_0x325a('0x0'));var url=require(_0x325a('0x1'));var logger=require(_0x325a('0x2'))('agi');module[_0x325a('0x3')]=function(_0x50e9ba,_0x46df7b){var _0x3b887a={'method':_0x325a('0x4'),'uri':url['resolve'](_0x46df7b[_0x325a('0x5')],_0x325a('0x6')),'form':{'grant_type':_0x325a('0x7'),'username':_0x46df7b['username'],'password':_0x46df7b['password']},'json':!![]};return rp(_0x3b887a)[_0x325a('0x8')](function(_0x209f5e){var _0x43bd79={'method':_0x325a('0x4'),'uri':url['resolve'](_0x46df7b['ndassistant_url'],_0x325a('0x9')),'body':{'type':_0x46df7b[_0x325a('0xa')]||_0x325a('0xb'),'channelId':_0x325a('0xc'),'conversation':{'id':_0x50e9ba[_0x325a('0xd')]},'from':{'id':_0x50e9ba[_0x325a('0xe')],'name':_0x50e9ba['calleridname']},'recipient':{'id':_0x50e9ba[_0x325a('0xf')],'name':_0x50e9ba[_0x325a('0x10')]},'text':_0x46df7b['text'],'channelData':{}},'headers':{'Authorization':_0x325a('0x11')+_0x209f5e[_0x325a('0x12')]},'json':!![]};if(_0x46df7b[_0x325a('0x13')]){_0x43bd79[_0x325a('0x14')]['channelData']['ProjectName']=_0x46df7b[_0x325a('0x13')];}if(_0x46df7b['ndagenerate_audio']=='1'){_0x43bd79[_0x325a('0x14')][_0x325a('0x15')][_0x325a('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x325a('0x17')};}if(_0x46df7b[_0x325a('0x18')]){_0x43bd79[_0x325a('0x14')][_0x325a('0x15')][_0x325a('0x19')]=_0x46df7b[_0x325a('0x18')];if(_0x46df7b[_0x325a('0x1a')]){_0x43bd79[_0x325a('0x14')][_0x325a('0x15')][_0x325a('0x1b')]=_0x46df7b[_0x325a('0x1a')];}}logger['info'](JSON[_0x325a('0x1c')](_0x43bd79));return rp(_0x43bd79);});}; \ No newline at end of file +var _0xcb18=['resolve','ndauth_url','/token','username','password','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomActionData','custom_action_data','info','../../../../../config/logger','exports','POST'];(function(_0x1e3aac,_0x5118ba){var _0x4e72d0=function(_0x15648c){while(--_0x15648c){_0x1e3aac['push'](_0x1e3aac['shift']());}};_0x4e72d0(++_0x5118ba);}(_0xcb18,0x159));var _0x8cb1=function(_0x3ace42,_0xbe496f){_0x3ace42=_0x3ace42-0x0;var _0x20eed8=_0xcb18[_0x3ace42];return _0x20eed8;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x8cb1('0x0'))('agi');module[_0x8cb1('0x1')]=function(_0x50513d,_0x5e800d){var _0x39e801={'method':_0x8cb1('0x2'),'uri':url[_0x8cb1('0x3')](_0x5e800d[_0x8cb1('0x4')],_0x8cb1('0x5')),'form':{'grant_type':'password','username':_0x5e800d[_0x8cb1('0x6')],'password':_0x5e800d[_0x8cb1('0x7')]},'json':!![]};return rp(_0x39e801)['then'](function(_0x186f71){var _0x510e92={'method':_0x8cb1('0x2'),'uri':url[_0x8cb1('0x3')](_0x5e800d['ndassistant_url'],_0x8cb1('0x8')),'body':{'type':_0x5e800d[_0x8cb1('0x9')]||_0x8cb1('0xa'),'channelId':_0x8cb1('0xb'),'conversation':{'id':_0x50513d[_0x8cb1('0xc')]},'from':{'id':_0x50513d['callerid'],'name':_0x50513d[_0x8cb1('0xd')]},'recipient':{'id':_0x50513d[_0x8cb1('0xe')],'name':_0x50513d[_0x8cb1('0xf')]},'text':_0x5e800d['text'],'channelData':{}},'headers':{'Authorization':_0x8cb1('0x10')+_0x186f71[_0x8cb1('0x11')]},'json':!![]};if(_0x5e800d[_0x8cb1('0x12')]){_0x510e92[_0x8cb1('0x13')][_0x8cb1('0x14')][_0x8cb1('0x15')]=_0x5e800d['project'];}if(_0x5e800d[_0x8cb1('0x16')]=='1'){_0x510e92['body'][_0x8cb1('0x14')][_0x8cb1('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8cb1('0x18')};}if(_0x5e800d[_0x8cb1('0x19')]){_0x510e92[_0x8cb1('0x13')][_0x8cb1('0x14')]['CustomAction']=_0x5e800d[_0x8cb1('0x19')];if(_0x5e800d['custom_action_data']){_0x510e92['body']['channelData'][_0x8cb1('0x1a')]=_0x5e800d[_0x8cb1('0x1b')];}}logger[_0x8cb1('0x1c')](JSON['stringify'](_0x510e92));return rp(_0x510e92);});}; \ 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 e05a09a..216b9c5 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 _0x5e3f=['exports'];(function(_0x1915a8,_0x581c9a){var _0x5e3c96=function(_0x4b8be5){while(--_0x4b8be5){_0x1915a8['push'](_0x1915a8['shift']());}};_0x5e3c96(++_0x581c9a);}(_0x5e3f,0x1f3));var _0xf5e3=function(_0x2b38fd,_0x5dc4b7){_0x2b38fd=_0x2b38fd-0x0;var _0x26fb90=_0x5e3f[_0x2b38fd];return _0x26fb90;};'use strict';var asr=require('./lib/api');module[_0xf5e3('0x0')]=function(_0x25841a,_0x1be14a,_0x12e064,_0x7a7bb){return asr(_0x25841a,_0x1be14a,_0x12e064,_0x7a7bb);}; \ No newline at end of file +var _0x1c63=['./lib/api','exports'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0x1c63,0x94));var _0x31c6=function(_0x1f0d60,_0x58a2c2){_0x1f0d60=_0x1f0d60-0x0;var _0x148a20=_0x1c63[_0x1f0d60];return _0x148a20;};'use strict';var asr=require(_0x31c6('0x0'));module[_0x31c6('0x1')]=function(_0x4d6932,_0x53df8d,_0x5785c5,_0x4c159c){return asr(_0x4d6932,_0x53df8d,_0x5785c5,_0x4c159c);}; \ 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 f35e1b0..a5a1577 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 _0xda2c=['parse','status','result','final','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash','crypto','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','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0xda2c,0x1e0));var _0xcda2=function(_0x551f98,_0x4b4d12){_0x551f98=_0x551f98-0x0;var _0x45e16b=_0xda2c[_0x551f98];return _0x45e16b;};'use strict';var BPromise=require(_0xcda2('0x0'));var _=require(_0xcda2('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xcda2('0x2'));var logger=require('../../../../../../config/logger')(_0xcda2('0x3'));module[_0xcda2('0x4')]=function(_0x7f699f,_0x13f2e9,_0x5dd58e,_0x124f15){return new BPromise(function(_0x574b59,_0x1c5eea){logger[_0xcda2('0x5')](_0xcda2('0x6'),_0x124f15||_0xcda2('0x7'));var _0x405890=new WebSocket(_0x124f15||_0xcda2('0x7'),{'perMessageDeflate':![]});var _0x4ca872='';var _0x1551ba='0';var _0x3aff41='1';var _0x5d370c=_0xcda2('0x8');function _0x2ea7cb(_0x2e1735){var _0x3fe651=crypto[_0xcda2('0x9')](_0xcda2('0xa'));_0x3fe651[_0xcda2('0xb')](_0x2e1735);return _0x3fe651['digest'](_0xcda2('0xc'));}function _0x3a693a(){try{logger[_0xcda2('0x5')](_0xcda2('0xd'));var _0x4c2b7a=moment()[_0xcda2('0xe')]();var _0x23ba91=_0x2ea7cb(_0x4c2b7a+_0x13f2e9+_0x5dd58e);_0x405890[_0xcda2('0xf')](JSON[_0xcda2('0x10')]({'appID':_0x13f2e9,'timestamp':_0x4c2b7a,'appKey':_0x23ba91}));var _0x5c6f21=fs[_0xcda2('0x11')](_0x7f699f);_0x5c6f21['on'](_0xcda2('0x12'),function(_0x1a53e9){_0x405890[_0xcda2('0xf')](_0x1a53e9);});_0x5c6f21['on'](_0xcda2('0x13'),function(){_0x405890[_0xcda2('0xf')](_0xcda2('0x14'));});}catch(_0x34a024){logger[_0xcda2('0x15')](_0xcda2('0x16'),JSON[_0xcda2('0x10')](_0x34a024));_0x405890[_0xcda2('0x17')]();}}function _0x10c64c(_0x493f65){try{if(_0x493f65){var _0x1b5843=JSON[_0xcda2('0x18')](_0x493f65);switch(_0x1b5843[_0xcda2('0x19')]){case 0x0:if(_0x1b5843[_0xcda2('0x1a')]){if(_0x1b5843[_0xcda2('0x1a')][_0xcda2('0x1b')]){logger[_0xcda2('0x5')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x1b5843['result'][_0xcda2('0x1c')]));_0x4ca872=_0x1b5843[_0xcda2('0x1a')][_0xcda2('0x1c')][0x0][_0xcda2('0x1d')];_0x1551ba=_0x1b5843[_0xcda2('0x1a')][_0xcda2('0x1c')][0x0][_0xcda2('0x1e')];_0x3aff41='0';_0x5d370c=_0xcda2('0x1f');_0x405890['terminate']();}}break;case 0x1:logger[_0xcda2('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x3aff41='1';_0x5d370c='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xcda2('0x5')](_0xcda2('0x20'));_0x3aff41='2';_0x5d370c=_0xcda2('0x20');break;case 0x9:logger[_0xcda2('0x5')](_0xcda2('0x21'));_0x3aff41='9';_0x5d370c=_0xcda2('0x21');break;case 0xa:logger[_0xcda2('0x5')](_0xcda2('0x22'));_0x3aff41='10';_0x5d370c='Authentication\x20failed.';break;case 0xb:logger[_0xcda2('0x5')](_0xcda2('0x23'));_0x3aff41='11';_0x5d370c=_0xcda2('0x23');}}}catch(_0x27c6ea){logger[_0xcda2('0x15')](_0xcda2('0x24'),JSON[_0xcda2('0x10')](_0x27c6ea));_0x405890[_0xcda2('0x17')]();}}function _0x268256(){logger['info'](_0xcda2('0x25'));_0x574b59({'transcript':_0x4ca872,'confidence':_0x1551ba,'status':_0x3aff41,'status_message':_0x5d370c});}function _0x596871(_0x4a5f80){logger[_0xcda2('0x15')](_0xcda2('0x26'));if(!_['isNil'](_0x4a5f80)){logger[_0xcda2('0x15')](_[_0xcda2('0x27')](_0x4a5f80)?JSON[_0xcda2('0x10')](_0x4a5f80):_0x4a5f80);}}_0x405890['on'](_0xcda2('0x28'),_0x3a693a);_0x405890['on'](_0xcda2('0x29'),_0x10c64c);_0x405890['on'](_0xcda2('0x13'),_0x268256);_0x405890['on'](_0xcda2('0x15'),_0x596871);});}; \ No newline at end of file +var _0x48c9=['message','lodash','moment','crypto','../../../../../../config/logger','agi','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','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.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open'];(function(_0x126157,_0xb85d75){var _0x8c89db=function(_0x1d6e53){while(--_0x1d6e53){_0x126157['push'](_0x126157['shift']());}};_0x8c89db(++_0xb85d75);}(_0x48c9,0x112));var _0x948c=function(_0x3efe9b,_0x5b41a8){_0x3efe9b=_0x3efe9b-0x0;var _0x132073=_0x48c9[_0x3efe9b];return _0x132073;};'use strict';var BPromise=require('bluebird');var _=require(_0x948c('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x948c('0x1'));var crypto=require(_0x948c('0x2'));var logger=require(_0x948c('0x3'))(_0x948c('0x4'));module['exports']=function(_0x4d471e,_0x1989b3,_0x50f46f,_0x36e163){return new BPromise(function(_0x277b5b,_0x2b59d1){logger[_0x948c('0x5')]('Tilde\x20URI',_0x36e163||_0x948c('0x6'));var _0x420103=new WebSocket(_0x36e163||_0x948c('0x6'),{'perMessageDeflate':![]});var _0x3a01b1='';var _0x2f5443='0';var _0x59776a='1';var _0x139d99='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x24f174(_0x49b5c4){var _0x5b0a93=crypto[_0x948c('0x7')](_0x948c('0x8'));_0x5b0a93[_0x948c('0x9')](_0x49b5c4);return _0x5b0a93['digest']('hex');}function _0x3191b6(){try{logger[_0x948c('0x5')](_0x948c('0xa'));var _0x6c7ab1=moment()[_0x948c('0xb')]();var _0x48e9a9=_0x24f174(_0x6c7ab1+_0x1989b3+_0x50f46f);_0x420103[_0x948c('0xc')](JSON[_0x948c('0xd')]({'appID':_0x1989b3,'timestamp':_0x6c7ab1,'appKey':_0x48e9a9}));var _0x16ce68=fs[_0x948c('0xe')](_0x4d471e);_0x16ce68['on']('data',function(_0x50415e){_0x420103[_0x948c('0xc')](_0x50415e);});_0x16ce68['on'](_0x948c('0xf'),function(){_0x420103[_0x948c('0xc')]('EOS');});}catch(_0xed36eb){logger[_0x948c('0x10')](_0x948c('0x11'),JSON[_0x948c('0xd')](_0xed36eb));_0x420103[_0x948c('0x12')]();}}function _0x332b4b(_0x1379fa){try{if(_0x1379fa){var _0x20258e=JSON[_0x948c('0x13')](_0x1379fa);switch(_0x20258e['status']){case 0x0:if(_0x20258e[_0x948c('0x14')]){if(_0x20258e[_0x948c('0x14')][_0x948c('0x15')]){logger[_0x948c('0x5')](_0x948c('0x16'),JSON[_0x948c('0xd')](_0x20258e['result'][_0x948c('0x17')]));_0x3a01b1=_0x20258e[_0x948c('0x14')][_0x948c('0x17')][0x0][_0x948c('0x18')];_0x2f5443=_0x20258e[_0x948c('0x14')][_0x948c('0x17')][0x0][_0x948c('0x19')];_0x59776a='0';_0x139d99=_0x948c('0x1a');_0x420103[_0x948c('0x12')]();}}break;case 0x1:logger[_0x948c('0x5')](_0x948c('0x1b'));_0x59776a='1';_0x139d99=_0x948c('0x1b');break;case 0x2:logger[_0x948c('0x5')](_0x948c('0x1c'));_0x59776a='2';_0x139d99=_0x948c('0x1c');break;case 0x9:logger[_0x948c('0x5')](_0x948c('0x1d'));_0x59776a='9';_0x139d99=_0x948c('0x1d');break;case 0xa:logger['info']('Authentication\x20failed.');_0x59776a='10';_0x139d99=_0x948c('0x1e');break;case 0xb:logger[_0x948c('0x5')](_0x948c('0x1f'));_0x59776a='11';_0x139d99='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x35f17e){logger[_0x948c('0x10')](_0x948c('0x20'),JSON[_0x948c('0xd')](_0x35f17e));_0x420103[_0x948c('0x12')]();}}function _0x307812(){logger[_0x948c('0x5')](_0x948c('0x21'));_0x277b5b({'transcript':_0x3a01b1,'confidence':_0x2f5443,'status':_0x59776a,'status_message':_0x139d99});}function _0x2e2211(_0x1b1d98){logger[_0x948c('0x10')](_0x948c('0x22'));if(!_[_0x948c('0x23')](_0x1b1d98)){logger[_0x948c('0x10')](_[_0x948c('0x24')](_0x1b1d98)?JSON[_0x948c('0xd')](_0x1b1d98):_0x1b1d98);}}_0x420103['on'](_0x948c('0x25'),_0x3191b6);_0x420103['on'](_0x948c('0x26'),_0x332b4b);_0x420103['on'](_0x948c('0xf'),_0x307812);_0x420103['on']('error',_0x2e2211);});}; \ 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 10cb4be..bc97ac9 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x6520=['exports','./asr'];(function(_0x48fcff,_0x49665e){var _0x2e8198=function(_0x20a9f0){while(--_0x20a9f0){_0x48fcff['push'](_0x48fcff['shift']());}};_0x2e8198(++_0x49665e);}(_0x6520,0x181));var _0x0652=function(_0x2deee6,_0x507658){_0x2deee6=_0x2deee6-0x0;var _0x22c3aa=_0x6520[_0x2deee6];return _0x22c3aa;};var asr=require(_0x0652('0x0'));module[_0x0652('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 1432987..cbc1a72 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 _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x31abee,_0x11ff0c){var _0x3c1761=function(_0x2b5062){while(--_0x2b5062){_0x31abee['push'](_0x31abee['shift']());}};_0x3c1761(++_0x11ff0c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xe706,0xa3));var _0x6e70=function(_0x311fc0,_0x2c64f0){_0x311fc0=_0x311fc0-0x0;var _0xce2976=_0xe706[_0x311fc0];return _0xce2976;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 771ea6b..abb30df 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 _0xb717=['shelljs','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','getVariableById','name','catch','rpc','getVoiceQueueById','getSquareProject','then','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','scheduledAt','callback','Callback\x20scheduled\x20at\x20','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','text','languageCode','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','POST','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','uri','render','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','clone','hasOwnProperty','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','isString','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','toString','getAndSetVariable','sync','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','MRCPRecog','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','list_id','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','no\x20text\x20configured','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','keys','forEach','dial','sip_id','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','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','phone','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getData','test','mindigit','maxdigit','no\x20variable\x20found','generate','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','continueAt','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','.wav','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','failure','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue_id','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','%s/recordings/%s','RECORDING_SAVENAME','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','template_id','debug','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','VOICEMAIL','mailbox','join','exports','util'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0xb717,0x1b4));var _0x7b71=function(_0xb0055d,_0x272b8d){_0xb0055d=_0xb0055d-0x0;var _0x259dcf=_0xb717[_0xb0055d];return _0x259dcf;};'use strict';var fs=require('fs');var util=require(_0x7b71('0x0'));var _=require('lodash');var sh=require(_0x7b71('0x1'));var odbc=require('odbc')();var rs=require(_0x7b71('0x2'));var moment=require(_0x7b71('0x3'));var Mustache=require(_0x7b71('0x4'));var rp=require('request-promise');var logger=require(_0x7b71('0x5'))(_0x7b71('0x6'));var config=require(_0x7b71('0x7'));var scripts=require(_0x7b71('0x8'));var FILES_PATH=_0x7b71('0x9');var recursiveMapAttributes=['rawHeaders',_0x7b71('0xa')];var verticesWithRetry=[_0x7b71('0xb'),_0x7b71('0xc'),_0x7b71('0xd')];var AGIVertices=function(_0xc46853,_0x570e98,_0x18867f){this[_0x7b71('0xe')]=_0xc46853;this['rpc']=_0x570e98;this[_0x7b71('0xf')]=_0x18867f;};AGIVertices[_0x7b71('0x10')][_0x7b71('0x11')]=function(_0x55c72a,_0x2aed3b){this['rpc'][_0x7b71('0x12')](_0x55c72a)['then'](function(_0x191289){_0x2aed3b(null,_0x191289?_0x191289[_0x7b71('0x13')]:![]);})[_0x7b71('0x14')](function(_0x101181){_0x2aed3b(_0x101181);});};AGIVertices[_0x7b71('0x10')]['getVoiceQueue']=function(_0x453d50,_0x481d32){this[_0x7b71('0x15')][_0x7b71('0x16')](_0x453d50)['then'](function(_0x351442){_0x481d32(null,_0x351442?_0x351442[_0x7b71('0x13')]:![]);})[_0x7b71('0x14')](function(_0x5888f9){_0x481d32(_0x5888f9);});};AGIVertices['prototype'][_0x7b71('0x17')]=function(_0x3dc48a,_0x35c943){this[_0x7b71('0x15')]['getSquareProjectById'](_0x3dc48a)[_0x7b71('0x18')](function(_0x5ca420){_0x35c943(null,_0x5ca420?_0x5ca420['name']:![]);})[_0x7b71('0x14')](function(_0xbde25){_0x35c943(_0xbde25);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x19')]=function(_0x2fc4a0,_0x51d647){this[_0x7b71('0x15')][_0x7b71('0x1a')](_0x2fc4a0)[_0x7b71('0x18')](function(_0x1941b9){_0x51d647(null,_0x1941b9?_0x1941b9[_0x7b71('0x1b')]:![]);})[_0x7b71('0x14')](function(_0x527e3f){_0x51d647(_0x527e3f);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x1c')]=function(_0x204c69,_0x375f85){this['rpc']['getUserById'](_0x204c69)[_0x7b71('0x18')](function(_0xbd752b){_0x375f85(null,_0xbd752b?_0xbd752b[_0x7b71('0x13')]:![]);})[_0x7b71('0x14')](function(_0x3aca34){_0x375f85(_0x3aca34);});};AGIVertices['prototype'][_0x7b71('0x1d')]=function(_0x58591c,_0x16c1f3){this[_0x7b71('0x15')][_0x7b71('0x1e')](_0x58591c)[_0x7b71('0x18')](function(_0x49ce76){_0x16c1f3(null,_0x49ce76?_0x49ce76['name']:![]);})[_0x7b71('0x14')](function(_0x28841d){_0x16c1f3(_0x28841d);});};AGIVertices['prototype'][_0x7b71('0x1f')]=function(_0x214555,_0x7c978b){var _0x2f9ca9=this;this[_0x7b71('0x15')]['getSoundById'](_0x214555)['then'](function(_0x2b323b){_0x7c978b(null,_0x2b323b?_0x2f9ca9['getSoundPath'](_0x2b323b[_0x7b71('0x20')]):![]);})['catch'](function(_0x18cc43){_0x7c978b(_0x18cc43);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x21')]=function(_0x5539b3,_0x1e4e89){this[_0x7b71('0x15')][_0x7b71('0x22')](_0x5539b3)['then'](function(_0x5e11e1){_0x1e4e89(null,_0x5e11e1?_0x5e11e1:![]);})[_0x7b71('0x14')](function(_0x14ff72){_0x1e4e89(_0x14ff72);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x23')]=function(_0x43925c,_0x38c1a8,_0x4761cb){this['mailRpc'][_0x7b71('0x23')](_0x43925c,_0x38c1a8)[_0x7b71('0x18')](function(){_0x4761cb(null);})[_0x7b71('0x14')](function(_0x57e8ce){_0x4761cb(_0x57e8ce);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x24')]=function(_0x2de811,_0x37ef84){this[_0x7b71('0x15')][_0x7b71('0x25')](_0x2de811)['then'](function(_0x3f231c){if(_0x3f231c){if(_0x3f231c[_0x7b71('0x26')]){_0x37ef84(null,[_0x3f231c[_0x7b71('0x27')]]);}else{_0x37ef84(null,_[_0x7b71('0x28')](_0x3f231c[_0x7b71('0x29')],'interval'));}}else{_0x37ef84(null,![]);}})[_0x7b71('0x14')](function(_0x31e0d1){_0x37ef84(_0x31e0d1);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x2a')]=function(_0x7cb6c1){return util[_0x7b71('0x2b')](_0x7b71('0x2c'),FILES_PATH,_0x7cb6c1);};AGIVertices[_0x7b71('0x10')]['getQueryOdbc']=function(_0x3be99c,_0x3074aa,_0x2a3330){odbc[_0x7b71('0x2d')](_0x3be99c,function(_0x4b816f){if(_0x4b816f){logger[_0x7b71('0x2e')](_0x7b71('0x2f'),_0x4b816f);_0x2a3330(_0x4b816f);}else{logger['info'](_0x7b71('0x30'));odbc[_0x7b71('0x31')](_0x3074aa,function(_0x12b48d,_0x1af1c6){if(_0x12b48d){logger['info'](_0x7b71('0x32'),_0x3074aa);_0x2a3330(_0x12b48d);}else{logger[_0x7b71('0x33')](_0x7b71('0x34'),_0x3074aa);odbc[_0x7b71('0x35')](function(_0x25b7f4){if(_0x25b7f4){logger[_0x7b71('0x2e')](_0x7b71('0x36'),_0x25b7f4);}_0x2a3330(null,_0x1af1c6);});}});}});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x37')]=function(_0x6cc0ab,_0xa1db9f){this[_0x7b71('0x15')]['getSmsAccountById'](_0x6cc0ab)[_0x7b71('0x18')](function(_0x3f795b){_0xa1db9f(null,_0x3f795b?_0x3f795b:![]);})['catch'](function(_0x1b30e8){_0xa1db9f(_0x1b30e8);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x38')]=function(_0x1719b8,_0x20b8fc){this['rpc'][_0x7b71('0x38')](_0x1719b8)[_0x7b71('0x18')](function(_0x2d6f20){_0x20b8fc(null,_0x2d6f20);})[_0x7b71('0x14')](function(_0x136070){_0x20b8fc(_0x136070);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x3f9e98,_0x541730,_0x2c2729){this[_0x7b71('0x15')][_0x7b71('0x39')]({'uniqueid':this[_0x7b71('0xe')][_0x7b71('0x3a')],'node':_0x3f9e98[_0x7b71('0x3b')],'application':_0x3f9e98[_0x7b71('0x3c')],'data':_0x541730||null,'project_name':this['channel'][_0x7b71('0x3d')],'callerid':this[_0x7b71('0xe')]['callerid']})[_0x7b71('0x18')](function(_0x96c37e){if(_0x2c2729){_0x2c2729(null,_0x96c37e);}})[_0x7b71('0x14')](function(_0x443e61){if(_0x2c2729){_0x2c2729(_0x443e61);}});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x3e')]=function(_0xf78be9,_0x227b5e,_0x18435c,_0x4412ca){this[_0x7b71('0x15')][_0x7b71('0x3e')]({'uniqueid':this[_0x7b71('0xe')]['uniqueid'],'callerid':this[_0x7b71('0xe')][_0x7b71('0x3f')],'calleridname':this['channel']['calleridname'],'context':this['channel'][_0x7b71('0x40')],'extension':this[_0x7b71('0xe')][_0x7b71('0x41')],'priority':this['channel'][_0x7b71('0x42')],'accountcode':this[_0x7b71('0xe')]['accountcode'],'dnid':this[_0x7b71('0xe')][_0x7b71('0x43')],'projectName':this[_0x7b71('0xe')]['arg_1'],'saveName':_0x227b5e,'filename':_0xf78be9[_0x7b71('0x44')]||_0x227b5e,'savePath':_0x18435c})[_0x7b71('0x18')](function(_0x945c68){_0x4412ca(null,_0x945c68);})[_0x7b71('0x14')](function(_0x20e9ed){_0x4412ca(_0x20e9ed);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x45')]=function(_0x30e8d8,_0xdb438,_0x32bf02,_0x35b792,_0xe6825d){this['rpc'][_0x7b71('0x45')]({'uniqueid':this['channel'][_0x7b71('0x3a')],'body':_0x30e8d8,'direction':_0xdb438,'providerName':_0x32bf02,'providerResponse':_0x35b792})[_0x7b71('0x18')](function(_0x45f94b){if(_0xe6825d){_0xe6825d(null,_0x45f94b);}})[_0x7b71('0x14')](function(_0x3571d0){if(_0xe6825d){_0xe6825d(_0x3571d0);}});};AGIVertices[_0x7b71('0x10')]['createCmContact']=function(_0x318605,_0x5c6146){this['rpc'][_0x7b71('0x46')]({'firstName':_['isEmpty'](_0x318605[_0x7b71('0x13')])||_[_0x7b71('0x47')](_0x318605[_0x7b71('0x13')])?_0x7b71('0x48')+Math[_0x7b71('0x49')]():_0x318605[_0x7b71('0x13')],'lastName':_[_0x7b71('0x4a')](_0x318605[_0x7b71('0x4b')])||_[_0x7b71('0x47')](_0x318605[_0x7b71('0x4b')])?null:_0x318605[_0x7b71('0x4b')],'phone':_0x318605['phone'],'ListId':_0x318605['list_id'],'scheduledat':_0x318605[_0x7b71('0x4c')],'callbackUniqueid':this['channel'][_0x7b71('0x3a')],'tags':_0x7b71('0x4d'),'description':_0x7b71('0x4e')+_0x318605['scheduledAt']['toString'](),'priority':_0x318605['callback_priority']})[_0x7b71('0x18')](function(_0x48b486){_0x5c6146(null,_0x48b486);})[_0x7b71('0x14')](function(_0x1af6a2){_0x5c6146(_0x1af6a2);});};AGIVertices['prototype'][_0x7b71('0x4f')]=function(_0x5c8dd2,_0x46c589){this['rpc'][_0x7b71('0x50')](_0x5c8dd2)['then'](function(_0x2256f6){_0x46c589(null,_0x2256f6?_0x2256f6['name']:![]);})[_0x7b71('0x14')](function(_0x53e33a){_0x46c589(_0x53e33a);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x51')]=function(_0x2980e7,_0x5bfdfb,_0x510a30){var _0x265b04={'role':_0x7b71('0x52')};_0x265b04[_0x2980e7]=this[_0x7b71('0xe')][_0x7b71('0x3f')];this[_0x7b71('0x15')][_0x7b71('0x51')](_0x265b04,_0x5bfdfb,this['channel'][_0x7b71('0x3a')])[_0x7b71('0x18')](function(_0x4dd001){_0x510a30(null,_[_0x7b71('0x47')](_0x4dd001)?![]:!![]);})['catch'](function(_0x5bc4f9){logger[_0x7b71('0x2e')](_0x5bc4f9);_0x510a30(null,![]);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x53')]=function(_0x4e478d,_0x38dbd7){var _0x361d38={'role':_0x7b71('0x52')};_0x361d38[_0x4e478d]=this[_0x7b71('0xe')][_0x7b71('0x3f')];this[_0x7b71('0x15')][_0x7b71('0x53')](_0x361d38)[_0x7b71('0x18')](function(_0x46856b){_0x38dbd7(null,_['isNil'](_0x46856b)?![]:!![]);})[_0x7b71('0x14')](function(_0x2304b7){logger[_0x7b71('0x2e')](_0x2304b7);_0x38dbd7(null,![]);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x54')]=function(_0x3a138a,_0x3cadf7){var _0x2f1b0b={'role':_0x7b71('0x52')};_0x2f1b0b[_0x3a138a]=this[_0x7b71('0xe')]['callerid'];this[_0x7b71('0x15')]['agentLogout'](_0x2f1b0b)['then'](function(_0x43261a){_0x3cadf7(null,_[_0x7b71('0x47')](_0x43261a)?![]:!![]);})[_0x7b71('0x14')](function(_0x964817){logger[_0x7b71('0x2e')](_0x964817);_0x3cadf7(null,![]);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x55')]=function(_0x17f0e2,_0x33cdb5){var _0x50b77d={'role':_0x7b71('0x52')};_0x50b77d[_0x17f0e2]=this[_0x7b71('0xe')][_0x7b71('0x3f')];var _0x487320=_0x17f0e2!=_0x7b71('0x56')?util[_0x7b71('0x2b')](_0x7b71('0x57'),_0x7b71('0x58'),this['channel']['callerid']):undefined;this[_0x7b71('0x15')][_0x7b71('0x55')](_0x50b77d,_0x487320)[_0x7b71('0x18')](function(_0x763ce1){_0x33cdb5(null,_[_0x7b71('0x47')](_0x763ce1)?![]:!![]);})[_0x7b71('0x14')](function(_0x4073f3){logger[_0x7b71('0x2e')](_0x4073f3);_0x33cdb5(null,![]);});};AGIVertices[_0x7b71('0x10')]['shellCommand']=function(_0x9d6c3c,_0xcd130f){sh[_0x7b71('0x59')](_[_0x7b71('0x5a')](_0x9d6c3c),function(_0x90f3b1,_0x47759b){var _0x3f2952=_0x47759b[_0x7b71('0x5b')](/(\r\n|\n|\r)/gm,'');_0xcd130f(null,_0x3f2952);});};AGIVertices['prototype'][_0x7b71('0x5c')]=function(_0x1e983c,_0x4e40f7){scripts[_0x7b71('0x5c')](_0x1e983c['apiKey'],_0x1e983c['google_cloud_tts_text_type']||'text',_0x1e983c[_0x7b71('0x5d')],_0x1e983c[_0x7b71('0x5e')]||'en-US',_0x1e983c['ssmlGender']||_0x7b71('0x5f'),_0x1e983c[_0x7b71('0x60')]||_0x7b71('0x61'))[_0x7b71('0x18')](function(_0x33042d){_0x4e40f7(null,_0x33042d);})[_0x7b71('0x14')](function(_0x743a94){_0x4e40f7(_0x743a94);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x62')]=function(_0x4364a3,_0x33a0a9){scripts[_0x7b71('0x62')](_0x4364a3[_0x7b71('0x5d')],_0x4364a3[_0x7b71('0x63')]||'en',0x1)[_0x7b71('0x18')](function(_0x6da04d){_0x33a0a9(null,_0x6da04d);})[_0x7b71('0x14')](function(_0x1d4152){_0x33a0a9(_0x1d4152);});};AGIVertices['prototype']['restAPI']=function(_0x564b69,_0x4269a6){var _0x58ed1d={'uri':_0x564b69[_0x7b71('0x64')],'method':_0x564b69[_0x7b71('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x564b69[_0x7b71('0x66')])===_0x7b71('0x67')&&parseInt(_0x564b69[_0x7b71('0x66')])>=0x1?parseInt(_0x564b69[_0x7b71('0x66')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x7b71('0x68'),_0x7b71('0x69')],_0x58ed1d[_0x7b71('0x65')][_0x7b71('0x6a')]())){try{_0x58ed1d[_0x7b71('0x6b')]=_0x564b69['rawBody']?JSON['parse'](_0x564b69[_0x7b71('0xa')]):{};}catch(_0x10445b){logger[_0x7b71('0x2e')](_0x7b71('0x6c'),_0x10445b);}}try{_0x58ed1d[_0x7b71('0x6d')]=_0x564b69[_0x7b71('0x6e')]?JSON[_0x7b71('0x6f')](_0x564b69[_0x7b71('0x6e')]):{};}catch(_0x2461b6){logger[_0x7b71('0x2e')](_0x7b71('0x70'),_0x2461b6);}if(_0x564b69['computedVariables']){try{var _0x45cecd=require(_0x564b69['computedVariables'])['sync'](this,_0x58ed1d);_0x58ed1d[_0x7b71('0x71')]=Mustache['render'](_0x564b69[_0x7b71('0x64')],_0x45cecd,{},['$$','$$']);if(_0x58ed1d['headers']){_0x58ed1d['headers']=JSON[_0x7b71('0x6f')](Mustache[_0x7b71('0x72')](JSON[_0x7b71('0x73')](_0x58ed1d['headers']),_0x45cecd,{},['$$','$$']));}if(_0x58ed1d[_0x7b71('0x6b')]){_0x58ed1d[_0x7b71('0x6b')]=JSON[_0x7b71('0x6f')](Mustache['render'](JSON[_0x7b71('0x73')](_0x58ed1d[_0x7b71('0x6b')]),_0x45cecd,{},['$$','$$']));}}catch(_0x4458f8){logger[_0x7b71('0x2e')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4458f8);}}rp(_0x58ed1d)[_0x7b71('0x18')](function(_0x311476){var _0x2681ae={'statusCode':_0x311476[_0x7b71('0x74')]||0xc8,'statusMessage':_0x311476[_0x7b71('0x75')]||'OK','headers':_0x311476[_0x7b71('0x6d')]||{},'body':_0x311476[_0x7b71('0x6b')]||{}};_0x4269a6(null,_0x2681ae);})[_0x7b71('0x14')](function(_0x718699){var _0x3d298c={'statusCode':_0x718699[_0x7b71('0x74')]||0x1f4,'statusMessage':_0x718699[_0x7b71('0x76')]||_0x7b71('0x77'),'headers':_0x718699[_0x7b71('0x78')]['headers']||{},'body':_0x718699['options'][_0x7b71('0x6b')]||{}};_0x4269a6(null,_0x3d298c);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x79')]=function(_0x3553de,_0x457115){scripts['googleDialogflow'](this[_0x7b71('0xe')][_0x7b71('0x3a')],_0x3553de[_0x7b71('0x7a')],_0x3553de[_0x7b71('0x5d')],_0x3553de[_0x7b71('0x7b')]||'en')[_0x7b71('0x18')](function(_0x37446f){_0x457115(null,_0x37446f);})[_0x7b71('0x14')](function(_0x4973f8){_0x457115(_0x4973f8);});};AGIVertices[_0x7b71('0x10')]['googleDialogflowV2']=function(_0x56f4d0,_0x5768b5){scripts[_0x7b71('0x7c')](this[_0x7b71('0xe')][_0x7b71('0x3a')],_0x56f4d0['dialogflowV2_project_id'],_0x56f4d0[_0x7b71('0x7d')],_0x56f4d0[_0x7b71('0x7e')],_0x56f4d0[_0x7b71('0x5d')],_0x56f4d0[_0x7b71('0x7f')]||'en')['then'](function(_0x16755e){_0x5768b5(null,_0x16755e);})[_0x7b71('0x14')](function(_0x43041f){_0x5768b5(_0x43041f);});};AGIVertices[_0x7b71('0x10')]['sestekNDA']=function(_0x1e0728,_0x2b4c3f){scripts[_0x7b71('0x80')](this[_0x7b71('0xe')],_0x1e0728)['then'](function(_0x21eeb0){_0x2b4c3f(null,_0x21eeb0);})['catch'](function(_0x366b4b){_0x2b4c3f(_0x366b4b);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x81')]=function(_0x490e5b,_0x82c11d){scripts[_0x7b71('0x81')](_0x490e5b['key'],_0x490e5b['text'],_0x490e5b[_0x7b71('0x82')]||'en-US',_0x490e5b[_0x7b71('0x83')])[_0x7b71('0x18')](function(_0x2cde65){_0x82c11d(null,_0x2cde65);})['catch'](function(_0x5b133a){_0x82c11d(_0x5b133a);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x84')]=function(_0x1be4eb,_0x1a5633,_0x4132c0){scripts[_0x7b71('0x84')](_0x1a5633,_0x1be4eb[_0x7b71('0x7a')],_0x1be4eb[_0x7b71('0x85')]||_0x7b71('0x86'),this[_0x7b71('0x87')](_0x1be4eb[_0x7b71('0x88')])?_0x1be4eb['model']:undefined)[_0x7b71('0x18')](function(_0x34e61a){_0x4132c0(null,_0x34e61a);})[_0x7b71('0x14')](function(_0x4b7678){_0x4132c0(_0x4b7678);});};AGIVertices[_0x7b71('0x10')]['awsPolly']=function(_0xcfe64f,_0x35d65f){scripts[_0x7b71('0x89')](_0xcfe64f[_0x7b71('0x8a')],_0xcfe64f['aws_secret_access_key'],_0xcfe64f[_0x7b71('0x8b')],_0xcfe64f['aws_polly_voice']||'Amy',_0xcfe64f[_0x7b71('0x5d')],_0xcfe64f['aws_text_type']||_0x7b71('0x5d'))[_0x7b71('0x18')](function(_0x3a489e){_0x35d65f(null,_0x3a489e);})[_0x7b71('0x14')](function(_0x5ab7b8){_0x35d65f(_0x5ab7b8);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x8c')]=function(_0x513d92,_0x12b00b){scripts[_0x7b71('0x8c')](this['channel'][_0x7b71('0x3a')],_0x513d92[_0x7b71('0x8a')],_0x513d92['aws_secret_access_key'],_0x513d92[_0x7b71('0x8d')],_0x513d92[_0x7b71('0x5d')],_0x513d92[_0x7b71('0x8e')])[_0x7b71('0x18')](function(_0xd8a3f0){_0x12b00b(null,_0xd8a3f0);})['catch'](function(_0x29abe0){_0x12b00b(_0x29abe0);});};AGIVertices[_0x7b71('0x10')]['googleASR']=function(_0x2efaea,_0xa8e84f,_0x95cf38){scripts[_0x7b71('0x8f')](_0xa8e84f,_0x2efaea['key'],_0x2efaea[_0x7b71('0x90')]||_0x7b71('0x86'))[_0x7b71('0x18')](function(_0x3f6670){_0x95cf38(null,_0x3f6670);})[_0x7b71('0x14')](function(_0x2fbce9){_0x95cf38(_0x2fbce9);});};AGIVertices['prototype'][_0x7b71('0x91')]=function(_0x2a791e,_0x452dc4,_0xe0323f){scripts[_0x7b71('0x91')](_0x452dc4,_0x2a791e[_0x7b71('0x92')],_0x2a791e[_0x7b71('0x93')],_0x2a791e['uri'])['then'](function(_0x31f22d){_0xe0323f(null,_0x31f22d);})[_0x7b71('0x14')](function(_0x145827){_0xe0323f(_0x145827);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x94')]=function(_0x1351a5){var _0x5839c4=_[_0x7b71('0x95')](verticesWithRetry,_0x1351a5[_0x7b71('0x3c')])?_0x1351a5:_[_0x7b71('0x96')](_0x1351a5);for(var _0x14ef43 in _0x5839c4){if(_0x5839c4[_0x7b71('0x97')](_0x14ef43)){if(_0x5839c4[_0x14ef43]&&_['isString'](_0x5839c4[_0x14ef43])){if(_[_0x7b71('0x95')](recursiveMapAttributes,_0x14ef43)){_0x5839c4[_0x14ef43]=this[_0x7b71('0x98')](_0x5839c4[_0x14ef43]);}else{_0x5839c4[_0x14ef43]=this['replaceAllVariables'](_0x5839c4[_0x14ef43]);}}}}return _0x5839c4;};AGIVertices[_0x7b71('0x10')]['recursiveNodeIndex']=function(_0x1bbad5){for(var _0x1e2cc9 in _0x1bbad5){if(_0x1bbad5[_0x7b71('0x97')](_0x1e2cc9)){if(_[_0x7b71('0x99')](_0x1bbad5[_0x1e2cc9])){this[_0x7b71('0x9a')](_0x1bbad5[_0x1e2cc9]);}else if(_[_0x7b71('0x9b')](_0x1bbad5[_0x1e2cc9])){for(var _0x2d0389=0x0;_0x2d0389<_0x1bbad5[_0x1e2cc9][_0x7b71('0x9c')];_0x2d0389++){this[_0x7b71('0x9a')](_0x1bbad5[_0x1e2cc9][_0x2d0389]);}}else if(_[_0x7b71('0x9d')](_0x1bbad5[_0x1e2cc9])){_0x1bbad5[_0x1e2cc9]=this[_0x7b71('0x9e')](_0x1bbad5[_0x1e2cc9]);}}}};AGIVertices[_0x7b71('0x10')]['saveRestApiResult']=function(_0x56405c,_0x4cc313){for(var _0x1531c0 in _0x56405c){if(_0x56405c[_0x7b71('0x97')](_0x1531c0)){if(_[_0x7b71('0x99')](_0x56405c[_0x1531c0])){if(!_['isEmpty'](_0x56405c[_0x1531c0])){this['saveRestApiResult'](_0x56405c[_0x1531c0],util[_0x7b71('0x2b')]('%s.%s',_0x4cc313,_0x1531c0));}}else if(_['isArray'](_0x56405c[_0x1531c0])){for(var _0x4a4f73=0x0;_0x4a4f73<_0x56405c[_0x1531c0][_0x7b71('0x9c')];_0x4a4f73++){this[_0x7b71('0x9f')](_0x56405c[_0x1531c0][_0x4a4f73],util[_0x7b71('0x2b')](_0x7b71('0xa0'),_0x4cc313,_0x1531c0+'['+_0x4a4f73+']'));}}else{if(!_[_0x7b71('0x47')](_0x56405c[_0x1531c0])){this[_0x7b71('0xe')][_0x7b71('0xa1')](util[_0x7b71('0x2b')](_0x7b71('0xa0'),_0x4cc313,_0x1531c0),_0x56405c[_0x1531c0]);}}}}};AGIVertices['prototype'][_0x7b71('0x98')]=function(_0x174e6a){try{var _0x326663=JSON[_0x7b71('0x6f')](_0x174e6a);this[_0x7b71('0x9a')](_0x326663);return JSON[_0x7b71('0x73')](_0x326663);}catch(_0x1e2f82){return this['replaceAllVariables'](_0x174e6a);}};AGIVertices[_0x7b71('0x10')]['replaceAllVariables']=function(_0x5c38ed){var _0x8bb6fc=_0x5c38ed[_0x7b71('0xa2')]('{');for(var _0x35ccb9=0x1;_0x35ccb9<_0x8bb6fc[_0x7b71('0x9c')];_0x35ccb9+=0x1){var _0x2f156f=_0x8bb6fc[_0x35ccb9][_0x7b71('0xa2')]('}');if(_0x2f156f[_0x7b71('0x9c')]>0x1){_0x5c38ed=_0x5c38ed[_0x7b71('0xa3')]('{'+_0x2f156f[0x0]+'}',this[_0x7b71('0xe')][_0x7b71('0x11')](_0x2f156f[0x0])[_0x7b71('0xa4')]||_0x2f156f[0x0]);}}if(_0x8bb6fc[_0x7b71('0x9c')]===0x1){return _0x5c38ed[_0x7b71('0xa5')]();}return this[_0x7b71('0x9e')](_0x5c38ed);};AGIVertices[_0x7b71('0x10')][_0x7b71('0xa6')]=function(_0x4b927a,_0x3a24d7){var _0x188bac=this[_0x7b71('0xe')][_0x7b71('0x11')](_0x4b927a);if(_0x188bac['result']===-0x1){return _0x188bac;}logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x3a24d7,_0x188bac[_0x7b71('0xa4')]));return this[_0x7b71('0xe')][_0x7b71('0xa1')](_0x3a24d7,_0x188bac['extra']);};AGIVertices[_0x7b71('0x10')]['isConfigured']=function(_0x5673db){return _0x5673db&&_0x5673db!=='0'&&_0x5673db!=='-1'&&_0x5673db!=='';};AGIVertices[_0x7b71('0x10')]['maxRetry']=function(_0x5dc3c3){this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x5dc3c3,'-');_0x5dc3c3['retry']=_0x5dc3c3[_0x7b71('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x7b71('0xa9')]=function(_0x235350){logger[_0x7b71('0x33')](util['format'](_0x7b71('0xaa'),_0x235350['label']));if(!this[_0x7b71('0x87')](_0x235350['text'])){return this[_0x7b71('0xe')][_0x7b71('0xab')]('no\x20text\x20configured');}var _0x2d1fe3='\x22'+_0x235350[_0x7b71('0x5d')]+'\x22';if(this[_0x7b71('0x87')](_0x235350[_0x7b71('0x78')])){_0x2d1fe3+=','+_0x235350[_0x7b71('0x78')];}var _0x42f6d7=this['channel'][_0x7b71('0x59')](_0x7b71('0xac'),_0x2d1fe3);if(_0x42f6d7[_0x7b71('0xad')]===-0x1){return _0x42f6d7;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xae'),_0x2d1fe3));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xaf')]=function(_0x360bd5){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x360bd5[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x360bd5[_0x7b71('0xb0')])){return this[_0x7b71('0xe')][_0x7b71('0xab')]('no\x20grammar\x20configured');}var _0xf7d3db=_0x360bd5['grammar'];if(this[_0x7b71('0x87')](_0x360bd5[_0x7b71('0x78')])){_0xf7d3db+=','+_0x360bd5[_0x7b71('0x78')];}var _0x1d6f93=this['channel'][_0x7b71('0x59')](_0x7b71('0xb1'),_0xf7d3db);if(_0x1d6f93[_0x7b71('0xad')]===-0x1){return _0x1d6f93;}var _0x3778d6=this[_0x7b71('0xa6')](_0x7b71('0xb2'),'MRCP_RECOG_CONFIDENCE');if(_0x3778d6[_0x7b71('0xad')]===-0x1){return _0x3778d6;}var _0x56e0ab=this['getAndSetVariable'](_0x7b71('0xb3'),_0x7b71('0xb4'));if(_0x56e0ab[_0x7b71('0xad')]===-0x1){return _0x56e0ab;}var _0xcf3dd6=this[_0x7b71('0xa6')](_0x7b71('0xb5'),_0x7b71('0xb6'));if(_0xcf3dd6['result']===-0x1){return _0xcf3dd6;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xb7'),_0xf7d3db));};AGIVertices[_0x7b71('0x10')][_0x7b71('0x6')]=function(_0x41dc95){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0xb8'),_0x41dc95[_0x7b71('0x3b')]));return this['channel']['agi']([_0x41dc95[_0x7b71('0xb9')],_0x41dc95[_0x7b71('0xba')]]);};AGIVertices[_0x7b71('0x10')][_0x7b71('0xbb')]=function(_0x513f35){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0xbc'),_0x513f35[_0x7b71('0x3b')]));if(this['isConfigured'](_0x513f35[_0x7b71('0x66')])){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x513f35[_0x7b71('0x66')]));var _0x3748e6=this[_0x7b71('0xe')][_0x7b71('0xbd')](_0x513f35[_0x7b71('0x66')]);if(_0x3748e6['result']===-0x1){return _0x3748e6;}}return this[_0x7b71('0xe')]['answer']();};AGIVertices[_0x7b71('0x10')][_0x7b71('0x4d')]=function(_0x54eeb8){logger[_0x7b71('0x33')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x54eeb8[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x54eeb8[_0x7b71('0xbe')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x54eeb8,'no\x20list\x20selected');}_0x54eeb8[_0x7b71('0x4c')]=moment();if(this['isConfigured'](_0x54eeb8[_0x7b71('0xbf')])){_0x54eeb8[_0x7b71('0x4c')]=moment()[_0x7b71('0xc0')](_0x54eeb8[_0x7b71('0xbf')],_0x7b71('0xc1'));}if(!this[_0x7b71('0x87')](_0x54eeb8['callback_priority'])){_0x54eeb8['callback_priority']=0x2;}this[_0x7b71('0x46')][_0x7b71('0xa7')](this,_0x54eeb8);return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xc2'),_0x54eeb8['phone'],_0x54eeb8[_0x7b71('0xbe')],_0x54eeb8[_0x7b71('0x4c')]));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xc3')]=function(_0x57e3a6){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0xc4'),_0x57e3a6[_0x7b71('0x3b')]));var _0x5d14b5=this['channel'][_0x7b71('0x59')](_0x57e3a6[_0x7b71('0xc5')],_0x57e3a6[_0x7b71('0x78')]);if(_0x5d14b5['result']===-0x1){return _0x5d14b5;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xc6'),_0x57e3a6[_0x7b71('0xc5')],_0x57e3a6[_0x7b71('0x78')]));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xc7')]=function(_0x1d308f){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x1d308f[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x1d308f[_0x7b71('0x5d')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xc8'));}var _0x169397='\x22'+_0x1d308f['text']+'\x22';if(this[_0x7b71('0x87')](_0x1d308f[_0x7b71('0x78')])){_0x169397+=','+_0x1d308f[_0x7b71('0x78')];}var _0x520011=this[_0x7b71('0xe')][_0x7b71('0x59')](_0x7b71('0xac'),_0x169397);if(_0x520011[_0x7b71('0xad')]===-0x1){return _0x520011;}return this[_0x7b71('0xe')]['noop'](util[_0x7b71('0x2b')](_0x7b71('0xae'),_0x169397));};AGIVertices['prototype'][_0x7b71('0xc9')]=function(_0x394db2){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x394db2[_0x7b71('0x3b')]));if(!this['isConfigured'](_0x394db2['text'])){return this['channel'][_0x7b71('0xab')](_0x7b71('0xc8'));}var _0x4bf980='\x22'+_0x394db2[_0x7b71('0x5d')]+'\x22';if(this[_0x7b71('0x87')](_0x394db2['options'])){_0x4bf980+=','+_0x394db2[_0x7b71('0x78')];}var _0x320356=this[_0x7b71('0xe')][_0x7b71('0x59')](_0x7b71('0xac'),_0x4bf980);if(_0x320356['result']===-0x1){return _0x320356;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xae'),_0x4bf980));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xca')]=function(_0xcadd1b){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0xcb'),_0xcadd1b[_0x7b71('0x3b')]));if(!this['isConfigured'](_0xcadd1b['grammar'])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xcc'));}var _0x1a7212=_0xcadd1b[_0x7b71('0xb0')];if(this['isConfigured'](_0xcadd1b[_0x7b71('0x78')])){_0x1a7212+=','+_0xcadd1b[_0x7b71('0x78')];}var _0x57f295=this['channel'][_0x7b71('0x59')](_0x7b71('0xb1'),_0x1a7212);if(_0x57f295['result']===-0x1){return _0x57f295;}var _0xf67613=this[_0x7b71('0xa6')]('RECOG_CONFIDENCE()',_0x7b71('0xcd'));if(_0xf67613[_0x7b71('0xad')]===-0x1){return _0xf67613;}var _0xd138b=this[_0x7b71('0xa6')](_0x7b71('0xb3'),_0x7b71('0xce'));if(_0xd138b['result']===-0x1){return _0xd138b;}var _0x1476f4=this[_0x7b71('0xa6')]('RECOG_INSTANCE()',_0x7b71('0xcf'));if(_0x1476f4[_0x7b71('0xad')]===-0x1){return _0x1476f4;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x1a7212));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xd0')]=function(_0x5f36a6){logger['info'](util[_0x7b71('0x2b')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5f36a6[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x5f36a6['grammar'])){return this['channel'][_0x7b71('0xab')](_0x7b71('0xcc'));}var _0x56b2d5=_0x5f36a6[_0x7b71('0xb0')];if(this[_0x7b71('0x87')](_0x5f36a6[_0x7b71('0x78')])){_0x56b2d5+=','+_0x5f36a6[_0x7b71('0x78')];}var _0x1b634d=this[_0x7b71('0xe')][_0x7b71('0x59')](_0x7b71('0xb1'),_0x56b2d5);if(_0x1b634d[_0x7b71('0xad')]===-0x1){return _0x1b634d;}var _0xc843a9=this['getAndSetVariable'](_0x7b71('0xb2'),_0x7b71('0xd1'));if(_0xc843a9[_0x7b71('0xad')]===-0x1){return _0xc843a9;}var _0x55b3af=this['getAndSetVariable'](_0x7b71('0xb3'),'SESTEK_ASR_TRANSCRIPT');if(_0x55b3af[_0x7b71('0xad')]===-0x1){return _0x55b3af;}var _0x2b8f55=this['getAndSetVariable'](_0x7b71('0xb5'),_0x7b71('0xd2'));if(_0x2b8f55[_0x7b71('0xad')]===-0x1){return _0x2b8f55;}return this['channel'][_0x7b71('0xab')](util[_0x7b71('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0x56b2d5));};AGIVertices[_0x7b71('0x10')]['database']=function(_0x2e16e5){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0xd3'),_0x2e16e5[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x2e16e5['odbc_id'])){return this[_0x7b71('0xe')]['error'](_0x2e16e5,_0x7b71('0xd4'));}var _0xeb3f38=this[_0x7b71('0x19')][_0x7b71('0xa7')](this,_0x2e16e5['odbc_id']);if(!_0xeb3f38){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x2e16e5,_0x7b71('0xd5'));}if(!this[_0x7b71('0x87')](_0x2e16e5[_0x7b71('0x31')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x2e16e5,_0x7b71('0xd6'));}var _0x3d8ecc=_0x2e16e5[_0x7b71('0x31')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x7b71('0xe')]['noop'](util[_0x7b71('0x2b')](_0x7b71('0xd7'),_0x3d8ecc));var _0x40890e=this[_0x7b71('0xd8')]['sync'](this,_0xeb3f38,_0x3d8ecc);this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x2e16e5,_0x3d8ecc);if(!this[_0x7b71('0x87')](_0x2e16e5[_0x7b71('0xd9')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xda'));}var _0x517bd8=this[_0x7b71('0x11')][_0x7b71('0xa7')](this,_0x2e16e5[_0x7b71('0xd9')]);if(!_0x517bd8){return this['channel'][_0x7b71('0x2e')](_0x2e16e5,'no\x20variable\x20found');}var _0x3a88f4=this;_0x40890e['forEach'](function(_0x5b3fcf,_0x3fa2c0){Object[_0x7b71('0xdb')](_0x5b3fcf)[_0x7b71('0xdc')](function(_0x1728f1){_0x3a88f4[_0x7b71('0xe')][_0x7b71('0xa1')](util[_0x7b71('0x2b')]('%s[%s][%s]',_0x517bd8,_0x3fa2c0,_0x1728f1),_0x5b3fcf[_0x1728f1]);});});this['channel'][_0x7b71('0xa1')](util[_0x7b71('0x2b')]('%s_ROWS_COUNT',_0x517bd8),_0x40890e[_0x7b71('0x9c')]);return this['channel'][_0x7b71('0xab')](util[_0x7b71('0x2b')]('variable\x20%s\x20set',_0x517bd8));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xdd')]=function(_0x2ddc64){logger['debug'](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x2ddc64[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x2ddc64[_0x7b71('0xde')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x2ddc64,'no\x20user\x20selected');}var _0x5e70c6=this[_0x7b71('0x1c')]['sync'](this,_0x2ddc64[_0x7b71('0xde')]);if(!_0x5e70c6){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x2ddc64,'no\x20user\x20found');}var _0x1944d0=this['channel'][_0x7b71('0x59')](_0x7b71('0xdf'),[util[_0x7b71('0x2b')](_0x7b71('0xe0'),_0x5e70c6),_0x2ddc64[_0x7b71('0x66')],_0x2ddc64[_0x7b71('0xe1')],_0x2ddc64[_0x7b71('0x64')]]);if(_0x1944d0[_0x7b71('0xad')]===-0x1){return _0x1944d0;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xe2'),'DIAL'));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xe3')]=function(_0x150f2d){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x150f2d[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x150f2d[_0x7b71('0x7a')])){return this['channel'][_0x7b71('0xab')]('no\x20key\x20configured');}if(!this[_0x7b71('0x87')](_0x150f2d[_0x7b71('0x5d')])){return this['channel'][_0x7b71('0xab')]('no\x20text\x20configured');}this[_0x7b71('0xe')][_0x7b71('0xe4')]=!![];this[_0x7b71('0x39')](_0x150f2d);this[_0x7b71('0x45')](_0x150f2d[_0x7b71('0x5d')],'in','','');this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xe5'),_0x150f2d[_0x7b71('0x5d')]));var _0x2c11eb=this[_0x7b71('0x79')][_0x7b71('0xa7')](this,_0x150f2d);if(_0x2c11eb){for(var _0x511f88 in _0x2c11eb){if(_0x2c11eb[_0x7b71('0x97')](_0x511f88)){this[_0x7b71('0xe')][_0x7b71('0xa1')](util[_0x7b71('0x2b')]('DIALOGFLOW_%s',_0x511f88[_0x7b71('0x6a')]()),_0x2c11eb[_0x511f88]);}}this[_0x7b71('0x45')](_0x2c11eb[_0x7b71('0xe6')],_0x7b71('0xe7'),_0x7b71('0xe3'),'');return this[_0x7b71('0xe')]['noop'](util['format'](_0x7b71('0xe8'),_0x2c11eb[_0x7b71('0xe6')]));}return this['channel']['error'](_0x150f2d,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype']['dialogflowV2']=function(_0x15a001){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x15a001[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x15a001[_0x7b71('0xe9')])){return this['channel']['noop'](_0x7b71('0xea'));}if(!this[_0x7b71('0x87')](_0x15a001['client_email'])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xeb'));}if(!this[_0x7b71('0x87')](_0x15a001[_0x7b71('0x7e')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0xec'));}if(!this[_0x7b71('0x87')](_0x15a001[_0x7b71('0x7f')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xed'));}if(!this[_0x7b71('0x87')](_0x15a001[_0x7b71('0x5d')])){return this[_0x7b71('0xe')]['noop']('no\x20text\x20configured');}this[_0x7b71('0xe')][_0x7b71('0xe4')]=!![];this[_0x7b71('0x39')](_0x15a001);this[_0x7b71('0x45')](_0x15a001[_0x7b71('0x5d')],'in','','');this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xee'),_0x15a001[_0x7b71('0x5d')]));var _0x36f1fb=this[_0x7b71('0x7c')][_0x7b71('0xa7')](this,_0x15a001);if(_0x36f1fb){for(var _0x5c6127 in _0x36f1fb){if(_0x36f1fb[_0x7b71('0x97')](_0x5c6127)){if(_0x5c6127!==_0x7b71('0xef')){this[_0x7b71('0xe')][_0x7b71('0xa1')](util[_0x7b71('0x2b')](_0x7b71('0xf0'),_0x5c6127[_0x7b71('0x6a')]()),_0x36f1fb[_0x5c6127]);}}}this[_0x7b71('0x45')](_0x36f1fb['speech'],_0x7b71('0xe7'),_0x7b71('0xf1'),_0x36f1fb[_0x7b71('0xef')]);return this[_0x7b71('0xe')]['noop'](util['format'](_0x7b71('0xf2'),_0x36f1fb[_0x7b71('0xe6')]));}return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x15a001,_0x7b71('0xf3'));};AGIVertices['prototype'][_0x7b71('0xf4')]=function(_0xdb046f){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0xdb046f[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0xdb046f[_0x7b71('0xf5')])){return this['channel'][_0x7b71('0xab')](_0x7b71('0xf6'));}if(!this[_0x7b71('0x87')](_0xdb046f[_0x7b71('0xf7')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xf8'));}if(!this[_0x7b71('0x87')](_0xdb046f['password'])){return this[_0x7b71('0xe')][_0x7b71('0xab')]('no\x20password\x20configured');}if(!this[_0x7b71('0x87')](_0xdb046f[_0x7b71('0xf9')])){return this['channel'][_0x7b71('0xab')](_0x7b71('0xc8'));}this[_0x7b71('0xe')][_0x7b71('0xe4')]=!![];this['createSquareDetailsReport'](_0xdb046f);this['createSquareMessage'](_0xdb046f[_0x7b71('0x5d')],'in','','');this['channel']['noop'](util[_0x7b71('0x2b')](_0x7b71('0xfa'),_0xdb046f[_0x7b71('0x5d')]));var _0x298952=this[_0x7b71('0x80')][_0x7b71('0xa7')](this,_0xdb046f);if(_0x298952){for(var _0x35929f in _0x298952){if(_0x298952[_0x7b71('0x97')](_0x35929f)){this['channel'][_0x7b71('0xa1')](util['format']('SESTEK_NDA_%s',_0x35929f['toUpperCase']()),_0x298952[_0x35929f]);}}this[_0x7b71('0x45')](_0x298952[_0x7b71('0xe6')],_0x7b71('0xe7'),_0x7b71('0xf4'),'');if(_0x298952[_0x7b71('0xfb')]){this[_0x7b71('0xe')]['noop'](util[_0x7b71('0x2b')](_0x7b71('0xfc'),_0x298952[_0x7b71('0xfb')]));var _0x59c39f=this[_0x7b71('0xe')][_0x7b71('0xfd')](_0x298952[_0x7b71('0xfb')]);try{fs[_0x7b71('0xfe')](_0x298952[_0x7b71('0xfb')]+'.wav');}catch(_0x506881){logger[_0x7b71('0x2e')](_0x506881);}return _0x59c39f;}else{return this[_0x7b71('0xe')][_0x7b71('0xab')](util['format'](_0x7b71('0xff'),_0x298952['speech']));}}return this['channel'][_0x7b71('0x2e')](_0xdb046f,_0x7b71('0x100'));};AGIVertices['prototype'][_0x7b71('0x101')]=function(_0x23e4bc){logger['info'](util['format'](_0x7b71('0x102'),_0x23e4bc['label']));return this['channel'][_0x7b71('0xab')](_0x7b71('0x101'));};AGIVertices['prototype'][_0x7b71('0x103')]=function(_0x2a7868){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x104'),_0x2a7868['label']));var _0x51687c='';if(_0x2a7868[_0x7b71('0x105')]){if(!this['isConfigured'](_0x2a7868['trunk_id'])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x2a7868,_0x7b71('0x106'));}else{var _0x276f13=parseInt(_0x2a7868['trunk_id'],0xa);if(isNaN(_0x276f13)){_0x51687c=_0x2a7868[_0x7b71('0x105')];}else{_0x51687c=this[_0x7b71('0x1d')][_0x7b71('0xa7')](this,_0x2a7868['trunk_id']);if(!_0x51687c){return this['channel']['error'](_0x2a7868,_0x7b71('0x107'));}}}}else if(_0x2a7868['trunk_name']){_0x51687c=_0x2a7868[_0x7b71('0x108')];}else{return this['channel']['error'](_0x2a7868,'no\x20trunk\x20selected');}var _0x555954=this[_0x7b71('0xe')][_0x7b71('0x59')](_0x7b71('0xdf'),[util[_0x7b71('0x2b')](_0x7b71('0x109'),_0x51687c,_0x2a7868[_0x7b71('0x10a')]),_0x2a7868[_0x7b71('0x66')],_0x2a7868[_0x7b71('0xe1')],_0x2a7868[_0x7b71('0x64')]]);if(_0x555954[_0x7b71('0xad')]===-0x1){return _0x555954;}return this['channel'][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xe2'),_0x7b71('0xdf')));};AGIVertices['prototype'][_0x7b71('0x10b')]=function(_0x5563a0){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x10c'),_0x5563a0[_0x7b71('0x3b')]));return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0x10b'));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xc')]=function(_0x66c78){logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x10d'),_0x66c78[_0x7b71('0x3b')]));if(_0x66c78[_0x7b71('0x10e')]===0x0){return this[_0x7b71('0xa8')](_0x66c78);}_0x66c78[_0x7b71('0x10e')]-=0x1;if(!this[_0x7b71('0x87')](_0x66c78[_0x7b71('0x10f')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x66c78,_0x7b71('0x110'));}var _0x3aad7a=this[_0x7b71('0x1f')]['sync'](this,_0x66c78[_0x7b71('0x10f')]);if(!_0x3aad7a){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x66c78,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x66c78[_0x7b71('0xd9')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x7b71('0xda'));}var _0x13d21d=this['channel'][_0x7b71('0x111')](_0x3aad7a,_0x66c78['response'],_0x66c78['maxdigit']);var _0x4f463d=_0x13d21d['result']?_0x13d21d['result']['toString']():'';logger[_0x7b71('0x33')](_0x7b71('0x112'),JSON[_0x7b71('0x73')](_0x13d21d));if(_0x13d21d['result']===-0x1){this['createSquareDetailsReport'][_0x7b71('0xa7')](this,_0x66c78,_0x4f463d);return _0x13d21d;}else if(_0x13d21d['extra']===_0x7b71('0x66')){_0x13d21d[_0x7b71('0xad')]=_0x4f463d[_0x7b71('0x9c')]>=parseInt(_0x66c78[_0x7b71('0x113')])?'x':'i';}else{_0x13d21d['result']=_0x4f463d['length']>=parseInt(_0x66c78[_0x7b71('0x113')])&&_0x4f463d['length']<=parseInt(_0x66c78[_0x7b71('0x114')])?'x':'i';}var _0x2a8282=this[_0x7b71('0x11')][_0x7b71('0xa7')](this,_0x66c78[_0x7b71('0xd9')]);if(!_0x2a8282){return this['channel'][_0x7b71('0x2e')](_0x66c78,_0x7b71('0x115'));}this[_0x7b71('0xe')][_0x7b71('0xa1')](_0x2a8282,_0x4f463d);if(this[_0x7b71('0x87')](_0x66c78['hiddendigitsnum'])){var _0x5f2519=parseInt(_0x66c78['hiddendigitsnum'],0xa);var _0x14e82f=rs[_0x7b71('0x116')]({'charset':'*','length':_0x5f2519});var _0x55342a=_0x4f463d[_0x7b71('0x9c')];if(_0x55342a>0x0){if(_0x55342a>_0x5f2519){this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x66c78,_0x66c78['hiddendigitspos']==='first'?_0x14e82f+_0x4f463d[_0x7b71('0x117')](_0x5f2519):_0x4f463d[_0x7b71('0x117')](0x0,_0x55342a-_0x5f2519)+_0x14e82f);}else{this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x66c78,rs[_0x7b71('0x116')]({'charset':'*','length':_0x55342a}));}}else{this[_0x7b71('0x39')]['sync'](this,_0x66c78,'');}}else{this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x66c78,_0x4f463d);}return _0x13d21d;};AGIVertices[_0x7b71('0x10')][_0x7b71('0xd')]=function(_0x4cd59f){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x4cd59f[_0x7b71('0x3b')]));return this['getdigits'](_0x4cd59f);};AGIVertices[_0x7b71('0x10')][_0x7b71('0x118')]=function(_0x1d4e15){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x119'),_0x1d4e15[_0x7b71('0x3b')]));this[_0x7b71('0x39')]['sync'](this,_0x1d4e15,_0x1d4e15[_0x7b71('0x11a')]);return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')]('GOAL\x20%s',_0x1d4e15[_0x7b71('0x11a')]));};AGIVertices['prototype']['awspolly']=function(_0x783b5f){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x11b'),_0x783b5f[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x783b5f[_0x7b71('0x8a')])||!this[_0x7b71('0x87')](_0x783b5f[_0x7b71('0x11c')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0x11d'));}if(!this[_0x7b71('0x87')](_0x783b5f[_0x7b71('0x5d')])){return this[_0x7b71('0xe')][_0x7b71('0xab')]('no\x20text\x20configured');}this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x11e'),_0x783b5f['text']));var _0x58cb84=this['awsPolly'][_0x7b71('0xa7')](this,_0x783b5f);if(_0x58cb84){this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x11f'),_0x58cb84));var _0x16e5d5=this[_0x7b71('0xe')][_0x7b71('0xfd')](_0x58cb84);try{fs[_0x7b71('0xfe')](_0x58cb84+'.wav');}catch(_0xf52364){logger[_0x7b71('0x2e')](_0xf52364);}return _0x16e5d5;}return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x783b5f,_0x7b71('0x120'));};AGIVertices['prototype'][_0x7b71('0x121')]=function(_0x30fdfd){logger[_0x7b71('0x33')](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x30fdfd[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x30fdfd[_0x7b71('0x8a')])||!this[_0x7b71('0x87')](_0x30fdfd[_0x7b71('0x11c')])){return this[_0x7b71('0xe')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x7b71('0x87')](_0x30fdfd[_0x7b71('0x8e')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0x122'));}if(!this[_0x7b71('0x87')](_0x30fdfd[_0x7b71('0x5d')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0xc8'));}this[_0x7b71('0xe')]['bot']=!![];this[_0x7b71('0x39')](_0x30fdfd);this[_0x7b71('0x45')](_0x30fdfd[_0x7b71('0x5d')],'in','','');this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x123'),_0x30fdfd[_0x7b71('0x5d')]));var _0x321a2c=this[_0x7b71('0x8c')]['sync'](this,_0x30fdfd);if(_0x321a2c){for(var _0x47f1c9 in _0x321a2c){if(_0x321a2c[_0x7b71('0x97')](_0x47f1c9)&&_[_0x7b71('0x9d')](_0x321a2c[_0x47f1c9])){this[_0x7b71('0xe')][_0x7b71('0xa1')](util['format'](_0x7b71('0x124'),_0x47f1c9['toUpperCase']()),_0x321a2c[_0x47f1c9]);}}if(_[_0x7b71('0x47')](_0x321a2c[_0x7b71('0x76')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0x125'));}else{this[_0x7b71('0x45')](_0x321a2c[_0x7b71('0x76')],'out',_0x7b71('0x126'),'');return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x127'),_0x321a2c[_0x7b71('0x76')]));}}return this['channel'][_0x7b71('0x2e')](_0x30fdfd,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x7b71('0x10')][_0x7b71('0x128')]=function(_0x588d86){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x129'),_0x588d86[_0x7b71('0x3b')],_0x588d86[_0x7b71('0x66')]));if(!this['isConfigured'](_0x588d86['key'])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0x12a'));}var _0x1a0500=_0x7b71('0x12b');var _0x1689e1=util[_0x7b71('0x2b')]('%s/recordings/%s',FILES_PATH,rs[_0x7b71('0x116')](0x4));var _0x7c551c=util[_0x7b71('0x2b')](_0x7b71('0xa0'),_0x1689e1,_0x1a0500);var _0x332a7b=!![];if(_0x588d86[_0x7b71('0x12c')]==='NOBEEP'){_0x332a7b=![];}var _0x1735d2=this[_0x7b71('0xe')][_0x7b71('0x12d')](_0x1689e1,_0x1a0500,_0x588d86[_0x7b71('0x12e')],_0x588d86['timeout'],undefined,_0x332a7b);if(_0x1735d2[_0x7b71('0xad')]!==-0x1){this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x12f'),_0x7c551c));var _0x932ff8=this[_0x7b71('0x8f')][_0x7b71('0xa7')](this,_0x588d86,_0x7c551c);if(_0x932ff8){for(var _0x373b96 in _0x932ff8){if(_0x932ff8[_0x7b71('0x97')](_0x373b96)){this[_0x7b71('0xe')][_0x7b71('0xa1')](util[_0x7b71('0x2b')](_0x7b71('0x130'),_0x373b96['toUpperCase']()),_0x932ff8[_0x373b96]);}}return this[_0x7b71('0xe')]['noop'](util[_0x7b71('0x2b')](_0x7b71('0x131'),JSON[_0x7b71('0x73')](_0x932ff8)));}}return _0x1735d2;};AGIVertices[_0x7b71('0x10')]['tildeasr']=function(_0x139700){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x132'),_0x139700[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x139700[_0x7b71('0x92')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0x133'));}if(!this[_0x7b71('0x87')](_0x139700[_0x7b71('0x93')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0x134'));}var _0xf4ecac='wav';var _0x112da2=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x7b71('0x116')](0x4));var _0x1ce689=util[_0x7b71('0x2b')]('%s.%s',_0x112da2,_0xf4ecac);var _0x5007b1=!![];if(_0x139700[_0x7b71('0x12c')]===_0x7b71('0x135')){_0x5007b1=![];}var _0x2576db=this[_0x7b71('0xe')][_0x7b71('0x12d')](_0x112da2,_0xf4ecac,_0x139700['intKey'],_0x139700[_0x7b71('0x66')],undefined,_0x5007b1);if(_0x2576db['result']!==-0x1){this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x136'),_0x1ce689));var _0x13bbc0=this['tildeASR'][_0x7b71('0xa7')](this,_0x139700,_0x1ce689);if(_0x13bbc0){for(var _0x12a279 in _0x13bbc0){if(_0x13bbc0[_0x7b71('0x97')](_0x12a279)){this[_0x7b71('0xe')][_0x7b71('0xa1')](util[_0x7b71('0x2b')](_0x7b71('0x137'),_0x12a279['toUpperCase']()),_0x13bbc0[_0x12a279]);}}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x138'),JSON[_0x7b71('0x73')](_0x13bbc0)));}}return _0x2576db;};AGIVertices[_0x7b71('0x10')]['gotoc']=function(_0x2e76c5){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x2e76c5[_0x7b71('0x3b')]));return this[_0x7b71('0xe')][_0x7b71('0x139')](_0x2e76c5[_0x7b71('0x40')],_0x2e76c5[_0x7b71('0x41')],_0x2e76c5[_0x7b71('0x42')]);};AGIVertices[_0x7b71('0x10')]['gotoif']=function(_0x11170b){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x11170b[_0x7b71('0x3b')]));if(!this['isConfigured'](_0x11170b[_0x7b71('0x13a')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x11170b,_0x7b71('0x13b'));}try{var _0x33f111=eval(_0x11170b[_0x7b71('0x13a')])?_0x7b71('0x13c'):_0x7b71('0x13d');this['channel'][_0x7b71('0xab')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x11170b[_0x7b71('0x13a')],_0x33f111));return{'code':0xc8,'result':_0x33f111};}catch(_0xdca961){return{'code':0xc8,'result':_0x7b71('0x13d')};}};AGIVertices[_0x7b71('0x10')][_0x7b71('0x13e')]=function(_0x55735f){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x13f'),_0x55735f[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x55735f[_0x7b71('0x140')])){return this['channel'][_0x7b71('0x2e')](_0x55735f,_0x7b71('0x141'));}var _0x364b99=this['getIntervals'][_0x7b71('0xa7')](this,_0x55735f[_0x7b71('0x140')]);if(!_0x364b99){return this[_0x7b71('0xe')]['error'](_0x55735f,_0x7b71('0x142'));}for(var _0x1e1df6=0x0;_0x1e1df6<_0x364b99[_0x7b71('0x9c')];_0x1e1df6+=0x1){var _0x142ce1=this[_0x7b71('0xe')][_0x7b71('0x11')](util[_0x7b71('0x2b')](_0x7b71('0x143'),_0x364b99[_0x1e1df6]));if(_0x142ce1['result']===-0x1){return _0x142ce1;}logger[_0x7b71('0x33')](util['format'](_0x7b71('0x144'),_0x364b99[_0x1e1df6],_0x142ce1[_0x7b71('0xa4')]));if(_0x142ce1[_0x7b71('0xa4')]===_0x7b71('0x13c')){logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x144'),_0x364b99[_0x1e1df6],_0x7b71('0x13c')));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')]('IFTIME\x20%s\x20%s',_0x364b99[_0x1e1df6],_0x7b71('0x13c')));return{'code':0xc8,'result':'true'};}else{logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x144'),_0x364b99[_0x1e1df6],'false'));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x144'),_0x364b99[_0x1e1df6],_0x7b71('0x13d')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x7b71('0x10')][_0x7b71('0x145')]=function(_0x30b996){logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x146'),_0x30b996[_0x7b71('0x3b')]));return this['channel'][_0x7b71('0x145')]();};AGIVertices[_0x7b71('0x10')][_0x7b71('0x147')]=function(_0x35eb13){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x148'),_0x35eb13[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x35eb13[_0x7b71('0x7a')])){return this['channel'][_0x7b71('0xab')](_0x7b71('0x12a'));}var _0x18b6a0=_0x7b71('0x12b');var _0x2051f4=util[_0x7b71('0x2b')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x137daa=util[_0x7b71('0x2b')](_0x7b71('0xa0'),_0x2051f4,_0x18b6a0);var _0x14d2a6=!![];if(_0x35eb13[_0x7b71('0x12c')]==='NOBEEP'){_0x14d2a6=![];}var _0x556536=this[_0x7b71('0xe')][_0x7b71('0x12d')](_0x2051f4,_0x18b6a0,_0x35eb13['intKey'],_0x35eb13[_0x7b71('0x66')],undefined,_0x14d2a6);if(_0x556536[_0x7b71('0xad')]!==-0x1){this['channel'][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x149'),_0x137daa));var _0x2cce64=this[_0x7b71('0x84')]['sync'](this,_0x35eb13,_0x137daa);if(_0x2cce64){for(var _0x560a8d in _0x2cce64){if(_0x2cce64['hasOwnProperty'](_0x560a8d)){this[_0x7b71('0xe')]['setVariable'](util['format']('ISPEECH_ASR_%s',_0x560a8d[_0x7b71('0x6a')]()),_0x2cce64[_0x560a8d]);}}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x14a'),JSON[_0x7b71('0x73')](_0x2cce64)));}}return _0x556536;};AGIVertices[_0x7b71('0x10')]['ispeechtts']=function(_0x41495d){logger['info'](util['format'](_0x7b71('0x14b'),_0x41495d['label']));if(!this['isConfigured'](_0x41495d[_0x7b71('0x7a')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0x12a'));}if(!this[_0x7b71('0x87')](_0x41495d['text'])){return this[_0x7b71('0xe')][_0x7b71('0xab')]('no\x20text\x20configured');}this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x14c'),_0x41495d['text']));var _0x2d9fa7=this['ispeechTTS'][_0x7b71('0xa7')](this,_0x41495d);if(_0x2d9fa7){this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x149'),_0x2d9fa7));var _0x18a96f=this['channel'][_0x7b71('0xfd')](_0x2d9fa7,_0x41495d[_0x7b71('0x12e')]);try{fs['unlink'](_0x2d9fa7+_0x7b71('0x14d'));}catch(_0x497190){logger['error'](_0x497190);}return _0x18a96f;}return this['channel'][_0x7b71('0x2e')](_0x41495d,_0x7b71('0x14e'));};AGIVertices['prototype'][_0x7b71('0x14f')]=function(_0x3809a3){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x150'),_0x3809a3['label']));if(!this[_0x7b71('0x87')](_0x3809a3[_0x7b71('0x151')])){return this['channel']['error'](_0x3809a3,_0x7b71('0x152'));}logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x153'),this['channel'][_0x7b71('0x3f')],_0x3809a3['findBy']));var _0x59be22=this[_0x7b71('0x55')][_0x7b71('0xa7')](this,_0x3809a3[_0x7b71('0x151')]);if(_0x59be22){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x154'),this['channel'][_0x7b71('0x3f')],_0x3809a3[_0x7b71('0x151')]));this[_0x7b71('0xe')][_0x7b71('0xab')](util['format'](_0x7b71('0x154'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x3809a3['findBy']));return{'code':0xc8,'result':_0x7b71('0x155')};}else{logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x156'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x3809a3[_0x7b71('0x151')]));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x156'),this[_0x7b71('0xe')]['callerid'],_0x3809a3[_0x7b71('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x7b71('0x10')][_0x7b71('0x157')]=function(_0x446f9e){logger[_0x7b71('0x33')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x446f9e[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x446f9e[_0x7b71('0x151')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x446f9e,_0x7b71('0x152'));}logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x153'),this['channel'][_0x7b71('0x3f')],_0x446f9e[_0x7b71('0x151')]));var _0x5bf531=this[_0x7b71('0x54')]['sync'](this,_0x446f9e[_0x7b71('0x151')]);if(_0x5bf531){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x154'),this['channel'][_0x7b71('0x3f')],_0x446f9e[_0x7b71('0x151')]));this['channel']['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x446f9e['findBy']));return{'code':0xc8,'result':_0x7b71('0x155')};}else{logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x156'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x446f9e[_0x7b71('0x151')]));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x156'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x446f9e[_0x7b71('0x151')]));return{'code':0xc8,'result':_0x7b71('0x158')};}};AGIVertices[_0x7b71('0x10')]['math']=function(_0x4b48d3){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x159'),_0x4b48d3[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x4b48d3[_0x7b71('0x15a')])){return this[_0x7b71('0xe')]['error'](_0x4b48d3,'no\x20operation\x20configured');}this[_0x7b71('0xe')][_0x7b71('0xab')](util['format'](_0x7b71('0x15b'),_0x4b48d3[_0x7b71('0x15a')]));var _0x455858=eval(_0x4b48d3['operation']);if(!this[_0x7b71('0x87')](_0x4b48d3[_0x7b71('0xd9')])){return this[_0x7b71('0xe')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1031b3=this[_0x7b71('0x11')][_0x7b71('0xa7')](this,_0x4b48d3['variable_id']);if(!_0x1031b3){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x4b48d3,_0x7b71('0x115'));}if(_[_0x7b71('0x9b')](_0x455858)){var _0x24e67c=this;_0x455858[_0x7b71('0xdc')](function(_0x2247e2,_0x507341){_0x24e67c[_0x7b71('0xe')]['setVariable'](util[_0x7b71('0x2b')]('%s[%s]',_0x1031b3,_0x507341),_0x2247e2);});return this[_0x7b71('0xe')]['noop'](util['format'](_0x7b71('0x15c'),_0x1031b3));}else{return this[_0x7b71('0xe')][_0x7b71('0xa1')](_0x1031b3,_0x455858);}};AGIVertices[_0x7b71('0x10')][_0x7b71('0xb')]=function(_0x25a9cd){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x15d'),_0x25a9cd[_0x7b71('0x3b')]));if(_0x25a9cd['retry']===0x0){return this[_0x7b71('0xa8')](_0x25a9cd);}_0x25a9cd[_0x7b71('0x10e')]-=0x1;if(!this['isConfigured'](_0x25a9cd[_0x7b71('0x10f')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x25a9cd,_0x7b71('0x110'));}var _0x26b243=this[_0x7b71('0x1f')][_0x7b71('0xa7')](this,_0x25a9cd[_0x7b71('0x10f')]);if(!_0x26b243){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x25a9cd,_0x7b71('0x15e'));}var _0x4d9bc3=this[_0x7b71('0xe')][_0x7b71('0x111')](_0x26b243,_0x25a9cd[_0x7b71('0x15f')],_0x25a9cd[_0x7b71('0x160')]);var _0x4c3d9b=_0x4d9bc3[_0x7b71('0xad')];if(_0x4d9bc3[_0x7b71('0xad')]===-0x1){this[_0x7b71('0x39')]['sync'](this,_0x25a9cd,'-1');return _0x4d9bc3;}else if(_0x4d9bc3[_0x7b71('0xa4')]===_0x7b71('0x66')){_0x4d9bc3[_0x7b71('0xad')]=_0x4d9bc3[_0x7b71('0xad')][_0x7b71('0x9c')]>0x0?_0x4d9bc3[_0x7b71('0xad')]:'t';}else if(_[_0x7b71('0x4a')](_0x4d9bc3['result'])){_0x4d9bc3['result']='#';_0x4c3d9b='#';}if(!this[_0x7b71('0x87')](_0x25a9cd['variable_id'])){this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xda'));}else{var _0x130787=this[_0x7b71('0x11')][_0x7b71('0xa7')](this,_0x25a9cd[_0x7b71('0xd9')]);if(!_0x130787){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x25a9cd,_0x7b71('0x115'));}this['channel'][_0x7b71('0xa1')](_0x130787,_0x4c3d9b);}this[_0x7b71('0x39')]['sync'](this,_0x25a9cd,_0x4c3d9b);return _0x4d9bc3;};AGIVertices[_0x7b71('0x10')][_0x7b71('0xab')]=function(_0x1db714){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x161'),_0x1db714[_0x7b71('0x3b')]));return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x1db714['output']||_0x1db714[_0x7b71('0x3b')]);};AGIVertices[_0x7b71('0x10')][_0x7b71('0x162')]=function(_0x2e74ff){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x163'),_0x2e74ff[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x2e74ff['findBy'])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x2e74ff,_0x7b71('0x152'));}logger[_0x7b71('0x33')](util['format'](_0x7b71('0x153'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x2e74ff['findBy']));var _0x4acaa2=this[_0x7b71('0x4f')][_0x7b71('0xa7')](this,_0x2e74ff[_0x7b71('0x164')]);var _0xa29f32=this[_0x7b71('0x51')][_0x7b71('0xa7')](this,_0x2e74ff[_0x7b71('0x151')],_0x4acaa2);if(_0xa29f32){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x154'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x2e74ff[_0x7b71('0x151')]));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7b71('0x3f')],_0x2e74ff['findBy']));return{'code':0xc8,'result':_0x7b71('0x155')};}else{logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x156'),this['channel'][_0x7b71('0x3f')],_0x2e74ff[_0x7b71('0x151')]));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7b71('0x3f')],_0x2e74ff[_0x7b71('0x151')]));return{'code':0xc8,'result':_0x7b71('0x158')};}};AGIVertices[_0x7b71('0x10')][_0x7b71('0x165')]=function(_0x217fd9){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x166'),_0x217fd9[_0x7b71('0x3b')]));if(!this['isConfigured'](_0x217fd9[_0x7b71('0x10f')])){return this[_0x7b71('0xe')]['error'](_0x217fd9,_0x7b71('0x110'));}var _0x343d7f=this[_0x7b71('0x1f')][_0x7b71('0xa7')](this,_0x217fd9[_0x7b71('0x10f')]);if(!_0x343d7f){return this['channel']['error'](_0x217fd9,_0x7b71('0x15e'));}var _0x2efa23=this[_0x7b71('0xe')][_0x7b71('0x59')](_0x7b71('0x167'),[_0x343d7f,_0x217fd9['opts']]);if(_0x2efa23[_0x7b71('0xad')]===-0x1){return _0x2efa23;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xc6'),'PLAYBACK',_0x343d7f));};AGIVertices[_0x7b71('0x10')]['queue']=function(_0x478558){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x478558[_0x7b71('0x3b')]));if(!this['isConfigured'](_0x478558[_0x7b71('0x168')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x478558,'no\x20queue\x20selected');}var _0x20ce9c='';var _0x316576=parseInt(_0x478558[_0x7b71('0x168')],0xa);if(isNaN(_0x316576)){_0x20ce9c=_0x478558[_0x7b71('0x168')];}else{_0x20ce9c=this['getVoiceQueue'][_0x7b71('0xa7')](this,_0x478558[_0x7b71('0x168')]);if(!_0x20ce9c){return this[_0x7b71('0xe')]['error'](_0x478558,'no\x20queue\x20found');}}var _0x697f0f='';if(this[_0x7b71('0x87')](_0x478558[_0x7b71('0x10f')])){var _0x3c9325=this[_0x7b71('0x1f')][_0x7b71('0xa7')](this,_0x478558['file_id']);if(_0x3c9325){_0x697f0f=_0x3c9325;}}this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x478558,_0x20ce9c);if(_0x478558[_0x7b71('0xe1')]['indexOf']('x')<0x0){_0x478558[_0x7b71('0xe1')]+='x';}if(_0x478558[_0x7b71('0xe1')]['indexOf']('X')<0x0){_0x478558[_0x7b71('0xe1')]+='X';}this[_0x7b71('0xe')][_0x7b71('0xa1')](_0x7b71('0x169'),_0x20ce9c?_0x20ce9c[_0x7b71('0x16a')]():'');var _0x514dce=this['channel']['exec'](_0x7b71('0x16b'),[_0x20ce9c,_0x478558['opts'],_0x478558['url'],_0x697f0f,_0x478558['timeout'],_0x478558[_0x7b71('0x6')],_0x478558[_0x7b71('0x16c')],_0x478558[_0x7b71('0x16d')],'',_0x478558[_0x7b71('0x16e')]]);if(_0x514dce[_0x7b71('0xad')]===-0x1){return _0x514dce;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xc6'),_0x7b71('0x16b'),_0x20ce9c));};AGIVertices[_0x7b71('0x10')][_0x7b71('0x16f')]=function(_0x56988d){logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x170'),_0x56988d[_0x7b71('0x3b')]));var _0x2c790c=_0x56988d[_0x7b71('0x171')]||'wav';var _0xf98623=util[_0x7b71('0x2b')](_0x7b71('0x172'),this['channel'][_0x7b71('0x3a')],rs[_0x7b71('0x116')](0x5));var _0x133fb0=util['format'](_0x7b71('0x173'),FILES_PATH,_0xf98623,_0x2c790c);var _0x4c34b7=util['format'](_0x7b71('0x174'),FILES_PATH,_0xf98623);this[_0x7b71('0x3e')][_0x7b71('0xa7')](this,_0x56988d,_0xf98623,_0x133fb0);this[_0x7b71('0xe')][_0x7b71('0xa1')](_0x7b71('0x175'),_0xf98623);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x4c34b7,_0x2c790c,_0x56988d[_0x7b71('0x176')],_0x56988d[_0x7b71('0x66')]);return this[_0x7b71('0xe')][_0x7b71('0x12d')](_0x4c34b7,_0x2c790c,_0x56988d[_0x7b71('0x176')],_0x56988d[_0x7b71('0x66')],undefined,!![]);};AGIVertices[_0x7b71('0x10')][_0x7b71('0x177')]=function(_0x12e4cf){logger['info'](util[_0x7b71('0x2b')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x12e4cf[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x12e4cf['url'])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0x178'));}var _0x39397e=this['restAPI'][_0x7b71('0xa7')](this,_0x12e4cf);logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x179'),util[_0x7b71('0x17a')](_0x39397e,{'showHidden':![],'depth':null})));if(!this[_0x7b71('0x87')](_0x12e4cf[_0x7b71('0xd9')])){return this[_0x7b71('0xe')][_0x7b71('0xab')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x1bef21=this[_0x7b71('0x11')]['sync'](this,_0x12e4cf[_0x7b71('0xd9')]);if(!_0x1bef21){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x12e4cf,_0x7b71('0x115'));}this['channel'][_0x7b71('0xa1')](util[_0x7b71('0x2b')](_0x7b71('0x17b'),_0x1bef21),_0x39397e['statusCode']?_0x39397e[_0x7b71('0x74')]:'200');this[_0x7b71('0xe')]['setVariable'](util[_0x7b71('0x2b')](_0x7b71('0x17c'),_0x1bef21),_0x39397e[_0x7b71('0x75')]?_0x39397e[_0x7b71('0x75')]:'OK');if(_0x39397e[_0x7b71('0x6b')]){try{this[_0x7b71('0x9f')](_0x39397e[_0x7b71('0x6b')],_0x1bef21);}catch(_0x415729){logger[_0x7b71('0x2e')](util['format'](_0x7b71('0x17d'),_0x1bef21));}}return this['channel']['noop'](util[_0x7b71('0x2b')]('variable\x20%s\x20set',_0x1bef21));};AGIVertices[_0x7b71('0x10')][_0x7b71('0x17e')]=function(_0x2a9b4f){logger['info'](util['format'](_0x7b71('0x17f'),_0x2a9b4f[_0x7b71('0x3b')]));return this[_0x7b71('0xe')]['sayDigits'](_0x2a9b4f[_0x7b71('0x180')][_0x7b71('0x5b')](/\s+/g,''),_0x2a9b4f['escape_digits']);};AGIVertices[_0x7b71('0x10')]['saynumber']=function(_0x4506a5){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x181'),_0x4506a5['label']));return this[_0x7b71('0xe')]['sayNumber'](_0x4506a5[_0x7b71('0x67')]['replace'](/\s+/g,''),_0x4506a5['escape_digits']);};AGIVertices[_0x7b71('0x10')][_0x7b71('0x182')]=function(_0x5cc919){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x5cc919[_0x7b71('0x3b')]));return this['channel'][_0x7b71('0x183')](_0x5cc919[_0x7b71('0x5d')],_0x5cc919['escape_digits']);};AGIVertices[_0x7b71('0x10')][_0x7b71('0x184')]=function(_0x27b291){logger['info'](util[_0x7b71('0x2b')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x27b291['label']));if(!this[_0x7b71('0x87')](_0x27b291[_0x7b71('0x185')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0x186'));}var _0xe58fe=this[_0x7b71('0x21')][_0x7b71('0xa7')](this,_0x27b291[_0x7b71('0x185')]);if(!_0xe58fe||!_0xe58fe[_0x7b71('0x187')]){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x27b291,_0x7b71('0x188'));}var _0x2df42a={'from':util[_0x7b71('0x2b')](_0x7b71('0x189'),_0xe58fe[_0x7b71('0x13')],_0xe58fe['email']||_0xe58fe['Smtp']['user']),'to':_0x27b291['to']||'','cc':_0x27b291['cc']||'','bcc':_0x27b291['bcc']||'','subject':_0x27b291['subject'],'html':_0x27b291[_0x7b71('0x5d')],'text':_0x27b291[_0x7b71('0x5d')]};if(this[_0x7b71('0x87')](_0x27b291[_0x7b71('0x18a')])){}logger[_0x7b71('0x18b')](_0x7b71('0x18c'),JSON[_0x7b71('0x73')](_0x2df42a));this['createSquareDetailsReport'][_0x7b71('0xa7')](this,_0x27b291,_0x27b291[_0x7b71('0x185')]);this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')]('Trying\x20SendMail\x20with\x20account\x20%s',_0xe58fe[_0x7b71('0x13')]));this[_0x7b71('0x23')][_0x7b71('0xa7')](this,_0xe58fe['smtpOptions'],_0x2df42a);return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0x18d'));};AGIVertices[_0x7b71('0x10')][_0x7b71('0x18e')]=function(_0x4ce27d){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x18f'),_0x4ce27d['label']));return this[_0x7b71('0xe')][_0x7b71('0xab')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x7b71('0x10')]['sendSMS']=function(_0x7a11c1){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x7a11c1[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x7a11c1[_0x7b71('0x190')])){return this['channel'][_0x7b71('0xab')](_0x7b71('0x191'));}var _0x1bda6e=this[_0x7b71('0x37')][_0x7b71('0xa7')](this,_0x7a11c1[_0x7b71('0x190')]);if(!_0x1bda6e){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x7a11c1,_0x7b71('0x192'));}var _0x34d8ec={'body':_0x7a11c1[_0x7b71('0x193')],'phone':_0x7a11c1['to']||'','SmsAccountId':_0x1bda6e['id']};logger[_0x7b71('0x18b')](_0x7b71('0x194'),JSON[_0x7b71('0x73')](_0x34d8ec));this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x7a11c1,_0x7a11c1[_0x7b71('0x190')]);this[_0x7b71('0xe')]['noop'](util['format'](_0x7b71('0x195'),_0x1bda6e[_0x7b71('0x13')]));this[_0x7b71('0x38')]['sync'](this,_0x34d8ec);return this[_0x7b71('0xe')]['noop'](_0x7b71('0x196'));};AGIVertices[_0x7b71('0x10')]['set']=function(_0x14df27){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x14df27[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x14df27[_0x7b71('0xd9')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x14df27,_0x7b71('0x197'));}var _0x34b4e9=this[_0x7b71('0x11')][_0x7b71('0xa7')](this,_0x14df27['variable_id']);if(!_0x34b4e9){return this['channel'][_0x7b71('0x2e')](_0x14df27,'no\x20variable\x20found');}return this[_0x7b71('0xe')]['setVariable'](_0x34b4e9,_0x14df27[_0x7b71('0x198')]);};AGIVertices[_0x7b71('0x10')][_0x7b71('0x199')]=function(_0x3481ab){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x19a'),_0x3481ab[_0x7b71('0x3b')]));this[_0x7b71('0xe')]['noop'](_0x7b71('0x19b'));var _0x2321e3=this['channel'][_0x7b71('0x11')](_0x7b71('0x19c'));if(!_[_0x7b71('0x4a')](_0x2321e3[_0x7b71('0xa4')])){this[_0x7b71('0xe')][_0x7b71('0x3a')]=_0x2321e3[_0x7b71('0xa4')];}if(_0x3481ab[_0x7b71('0xbb')]==='yes'){this[_0x7b71('0xe')]['noop'](_0x7b71('0x19d'));return this[_0x7b71('0xe')][_0x7b71('0xbb')]();}return this['channel'][_0x7b71('0xab')](_0x7b71('0x19e'));};AGIVertices[_0x7b71('0x10')]['subproject']=function(_0x3a4be2){logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x19f'),_0x3a4be2[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x3a4be2[_0x7b71('0x1a0')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x3a4be2,_0x7b71('0x1a1'));}var _0x2f15ba=this[_0x7b71('0x17')][_0x7b71('0xa7')](this,_0x3a4be2['project_id']);if(!this[_0x7b71('0x87')](_0x2f15ba)){return this[_0x7b71('0xe')]['error'](_0x3a4be2,util[_0x7b71('0x2b')](_0x7b71('0x1a2'),_0x3a4be2[_0x7b71('0x1a0')]));}if(_0x2f15ba===this[_0x7b71('0xe')][_0x7b71('0x3d')]){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x3a4be2,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x7b71('0x39')]['sync'](this,_0x3a4be2,_0x2f15ba);var _0x540902=this[_0x7b71('0xe')][_0x7b71('0x59')](_0x7b71('0x1a3'),util[_0x7b71('0x2b')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x7b71('0x6')]['host']||'127.0.0.1',_0x2f15ba,this[_0x7b71('0xe')][_0x7b71('0x3d')]));if(_0x540902[_0x7b71('0xad')]===-0x1){return _0x540902;}return this['channel']['noop'](util[_0x7b71('0x2b')]('Executed\x20command\x20%s\x20%s',_0x7b71('0x1a3'),_0x2f15ba));};AGIVertices[_0x7b71('0x10')]['system']=function(_0x4995bc){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x1a4'),_0x4995bc['label']));var _0x48aa8b=this[_0x7b71('0x1a5')][_0x7b71('0xa7')](this,_0x4995bc[_0x7b71('0xb9')]);this[_0x7b71('0x39')]['sync'](this,_0x4995bc,_0x4995bc[_0x7b71('0xb9')]);if(this[_0x7b71('0x87')](_0x4995bc[_0x7b71('0xd9')])){var _0x5d0389=this[_0x7b71('0x11')][_0x7b71('0xa7')](this,_0x4995bc['variable_id']);if(_0x5d0389){this[_0x7b71('0xe')]['setVariable'](_0x5d0389,_0x48aa8b);return this[_0x7b71('0xe')][_0x7b71('0xab')](util['format'](_0x7b71('0x1a6'),_0x4995bc[_0x7b71('0xb9')],_0x5d0389));}}return this[_0x7b71('0xe')]['noop'](util[_0x7b71('0x2b')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x4995bc[_0x7b71('0xb9')]));};AGIVertices[_0x7b71('0x10')][_0x7b71('0x1a7')]=function(_0x20e3db){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x20e3db[_0x7b71('0x3b')]));_0x20e3db[_0x7b71('0x5d')]=_0x20e3db[_0x7b71('0x5d')][_0x7b71('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7b71('0x87')](_0x20e3db[_0x7b71('0x1a8')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0x1a9'));}if(!this[_0x7b71('0x87')](_0x20e3db[_0x7b71('0x5d')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xc8'));}this[_0x7b71('0xe')][_0x7b71('0xab')](util['format'](_0x7b71('0x1aa'),_0x20e3db[_0x7b71('0x5d')]));var _0x56511b=this[_0x7b71('0x5c')][_0x7b71('0xa7')](this,_0x20e3db);if(_0x56511b){this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x1ab'),_0x56511b));var _0x59f4ef=this[_0x7b71('0xe')][_0x7b71('0xfd')](_0x56511b);try{fs[_0x7b71('0xfe')](_0x56511b+'.wav');}catch(_0xc4c4ec){logger['error'](_0xc4c4ec);}return _0x59f4ef;}return this['channel'][_0x7b71('0x2e')](_0x20e3db,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x7b71('0x1ac')]=function(_0x3c5355){logger[_0x7b71('0x33')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x3c5355[_0x7b71('0x3b')]));_0x3c5355[_0x7b71('0x5d')]=_0x3c5355[_0x7b71('0x5d')][_0x7b71('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7b71('0x87')](_0x3c5355['text'])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xc8'));}this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x1ad'),_0x3c5355[_0x7b71('0x5d')]));var _0x37cdae=this[_0x7b71('0x62')][_0x7b71('0xa7')](this,_0x3c5355);if(_0x37cdae){this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x1ae'),_0x37cdae));var _0x498cb9=this['channel'][_0x7b71('0xfd')](_0x37cdae);try{fs[_0x7b71('0xfe')](_0x37cdae+_0x7b71('0x14d'));}catch(_0x4bb5a9){logger[_0x7b71('0x2e')](_0x4bb5a9);}return _0x498cb9;}return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x3c5355,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x7b71('0x1af')]=function(_0x35cd57){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x35cd57['label']));if(!this[_0x7b71('0x87')](_0x35cd57[_0x7b71('0x151')])){return this['channel'][_0x7b71('0x2e')](_0x35cd57,'no\x20find\x20by\x20configured');}logger['info'](util[_0x7b71('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x35cd57['findBy']));var _0x50393c=this['agentUnpause'][_0x7b71('0xa7')](this,_0x35cd57[_0x7b71('0x151')]);if(_0x50393c){logger[_0x7b71('0x33')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x35cd57['findBy']));this['channel'][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x154'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x35cd57[_0x7b71('0x151')]));return{'code':0xc8,'result':_0x7b71('0x155')};}else{logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7b71('0xe')]['callerid'],_0x35cd57[_0x7b71('0x151')]));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x156'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x35cd57['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x7b71('0x10')][_0x7b71('0x1b0')]=function(_0x346e4a){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x346e4a['label']));var _0x56caee=this[_0x7b71('0xe')]['exec'](_0x7b71('0x1b1'),[_0x346e4a[_0x7b71('0x1b2')],_0x346e4a[_0x7b71('0x78')]]);if(_0x56caee['result']===-0x1){return _0x56caee;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xc6'),_0x7b71('0x1b1'),_0x346e4a[_0x7b71('0x1b2')]));};AGIVertices[_0x7b71('0x10')]['vswitch']=function(_0x36cb50){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x36cb50[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x36cb50[_0x7b71('0xd9')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x36cb50,'no\x20variable\x20selected');}var _0x14500e=this[_0x7b71('0x11')]['sync'](this,_0x36cb50[_0x7b71('0xd9')]);if(!_0x14500e){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x36cb50,_0x7b71('0x115'));}var _0xf2619c=this[_0x7b71('0xe')][_0x7b71('0x11')](_0x14500e);return{'code':0xc8,'result':_0xf2619c[_0x7b71('0xa4')]?_0xf2619c[_0x7b71('0xa4')]:'-'};};String[_0x7b71('0x10')][_0x7b71('0xa3')]=function(_0x2fe57a,_0x3694ca){return this[_0x7b71('0xa2')](_0x2fe57a)[_0x7b71('0x1b3')](_0x3694ca);};module[_0x7b71('0x1b4')]=AGIVertices; \ No newline at end of file +var _0x0b78=['getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','interval','map','Intervals','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','close','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','calleridname','context','extension','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','shellCommand','exec','trim','googleCloudTTS','apiKey','text','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','toUpperCase','parse','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','extra','getVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','retry','mrcpsynth','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','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','bot','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','unlink','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','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','Trying\x20aws\x20Polly\x20%s','.wav','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','macro','gosub','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','createSquareRecording','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','Smtp','user','bcc','subject','template_id','debug','smtpOptions','sendFax','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','XMCS-UNIQUEID','answer','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','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','join','exports','util','lodash','odbc','randomstring','mustache','../../config/logger','agi','../../config/environment','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariableById','then','name','catch','getVoiceQueue','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getTrunk'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0x0b78,0x1ad));var _0x80b7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0b78[_0x321bb2];return _0x9c12ed;};'use strict';var fs=require('fs');var util=require(_0x80b7('0x0'));var _=require(_0x80b7('0x1'));var sh=require('shelljs');var odbc=require(_0x80b7('0x2'))();var rs=require(_0x80b7('0x3'));var moment=require('moment');var Mustache=require(_0x80b7('0x4'));var rp=require('request-promise');var logger=require(_0x80b7('0x5'))(_0x80b7('0x6'));var config=require(_0x80b7('0x7'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x80b7('0x8'),'rawBody'];var verticesWithRetry=[_0x80b7('0x9'),_0x80b7('0xa'),_0x80b7('0xb')];var AGIVertices=function(_0x445c23,_0x5b8fe9,_0x74b4a8){this[_0x80b7('0xc')]=_0x445c23;this[_0x80b7('0xd')]=_0x5b8fe9;this['mailRpc']=_0x74b4a8;};AGIVertices[_0x80b7('0xe')]['getVariable']=function(_0x2b1a00,_0x4599c1){this[_0x80b7('0xd')][_0x80b7('0xf')](_0x2b1a00)[_0x80b7('0x10')](function(_0x2d61d4){_0x4599c1(null,_0x2d61d4?_0x2d61d4[_0x80b7('0x11')]:![]);})[_0x80b7('0x12')](function(_0x323d06){_0x4599c1(_0x323d06);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x13')]=function(_0x519401,_0x2c2668){this[_0x80b7('0xd')]['getVoiceQueueById'](_0x519401)[_0x80b7('0x10')](function(_0x1a6317){_0x2c2668(null,_0x1a6317?_0x1a6317['name']:![]);})[_0x80b7('0x12')](function(_0x3b6b13){_0x2c2668(_0x3b6b13);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x14')]=function(_0x36d0bb,_0x352805){this[_0x80b7('0xd')][_0x80b7('0x15')](_0x36d0bb)[_0x80b7('0x10')](function(_0x34299c){_0x352805(null,_0x34299c?_0x34299c['name']:![]);})[_0x80b7('0x12')](function(_0x1d62ed){_0x352805(_0x1d62ed);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x16')]=function(_0x58dbda,_0x48c356){this[_0x80b7('0xd')][_0x80b7('0x17')](_0x58dbda)[_0x80b7('0x10')](function(_0xd51ad9){_0x48c356(null,_0xd51ad9?_0xd51ad9['dsn']:![]);})['catch'](function(_0x2aebe3){_0x48c356(_0x2aebe3);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x18')]=function(_0x3ad8c1,_0x527d0f){this[_0x80b7('0xd')]['getUserById'](_0x3ad8c1)['then'](function(_0x37dd00){_0x527d0f(null,_0x37dd00?_0x37dd00[_0x80b7('0x11')]:![]);})[_0x80b7('0x12')](function(_0x155c00){_0x527d0f(_0x155c00);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x19')]=function(_0x29a4e6,_0x8fa95e){this[_0x80b7('0xd')][_0x80b7('0x1a')](_0x29a4e6)[_0x80b7('0x10')](function(_0x311aa3){_0x8fa95e(null,_0x311aa3?_0x311aa3[_0x80b7('0x11')]:![]);})[_0x80b7('0x12')](function(_0x3995b5){_0x8fa95e(_0x3995b5);});};AGIVertices['prototype'][_0x80b7('0x1b')]=function(_0x1661be,_0x5e3f6f){var _0x370bfb=this;this[_0x80b7('0xd')][_0x80b7('0x1c')](_0x1661be)['then'](function(_0x1b7715){_0x5e3f6f(null,_0x1b7715?_0x370bfb[_0x80b7('0x1d')](_0x1b7715[_0x80b7('0x1e')]):![]);})[_0x80b7('0x12')](function(_0x1c4607){_0x5e3f6f(_0x1c4607);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1f')]=function(_0x44f03e,_0x3fbdf3){this[_0x80b7('0xd')][_0x80b7('0x20')](_0x44f03e)[_0x80b7('0x10')](function(_0xf35e83){_0x3fbdf3(null,_0xf35e83?_0xf35e83:![]);})['catch'](function(_0x5a65b0){_0x3fbdf3(_0x5a65b0);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x21')]=function(_0x4fa26a,_0x4e8557,_0x106921){this[_0x80b7('0x22')][_0x80b7('0x21')](_0x4fa26a,_0x4e8557)[_0x80b7('0x10')](function(){_0x106921(null);})[_0x80b7('0x12')](function(_0x2339cf){_0x106921(_0x2339cf);});};AGIVertices['prototype'][_0x80b7('0x23')]=function(_0x1f9041,_0x6e7535){this[_0x80b7('0xd')]['getIntervalById'](_0x1f9041)[_0x80b7('0x10')](function(_0x25335e){if(_0x25335e){if(_0x25335e['IntervalId']){_0x6e7535(null,[_0x25335e[_0x80b7('0x24')]]);}else{_0x6e7535(null,_[_0x80b7('0x25')](_0x25335e[_0x80b7('0x26')],_0x80b7('0x24')));}}else{_0x6e7535(null,![]);}})[_0x80b7('0x12')](function(_0xfbd58e){_0x6e7535(_0xfbd58e);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1d')]=function(_0x4c7084){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x4c7084);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x27')]=function(_0x6f55,_0x28cc08,_0x462eb0){odbc[_0x80b7('0x28')](_0x6f55,function(_0x1c2341){if(_0x1c2341){logger[_0x80b7('0x29')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x1c2341);_0x462eb0(_0x1c2341);}else{logger[_0x80b7('0x2a')](_0x80b7('0x2b'));odbc[_0x80b7('0x2c')](_0x28cc08,function(_0x44acf2,_0x44cfcd){if(_0x44acf2){logger[_0x80b7('0x2a')]('Error\x20executing\x20query\x20%s',_0x28cc08);_0x462eb0(_0x44acf2);}else{logger[_0x80b7('0x2a')]('Query\x20executed\x20correctly\x20%s',_0x28cc08);odbc[_0x80b7('0x2d')](function(_0x1a6e69){if(_0x1a6e69){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x1a6e69);}_0x462eb0(null,_0x44cfcd);});}});}});};AGIVertices[_0x80b7('0xe')]['getSmsAccount']=function(_0x5c91d8,_0x295ca6){this[_0x80b7('0xd')]['getSmsAccountById'](_0x5c91d8)[_0x80b7('0x10')](function(_0x196f48){_0x295ca6(null,_0x196f48?_0x196f48:![]);})['catch'](function(_0x59e0c4){_0x295ca6(_0x59e0c4);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x2e')]=function(_0x3b89b4,_0x29170c){this[_0x80b7('0xd')][_0x80b7('0x2e')](_0x3b89b4)['then'](function(_0x1c28d2){_0x29170c(null,_0x1c28d2);})[_0x80b7('0x12')](function(_0x2cb860){_0x29170c(_0x2cb860);});};AGIVertices[_0x80b7('0xe')]['createSquareDetailsReport']=function(_0x20a9b9,_0x5741ec,_0x382fd7){this[_0x80b7('0xd')][_0x80b7('0x2f')]({'uniqueid':this[_0x80b7('0xc')][_0x80b7('0x30')],'node':_0x20a9b9[_0x80b7('0x31')],'application':_0x20a9b9[_0x80b7('0x32')],'data':_0x5741ec||null,'project_name':this[_0x80b7('0xc')][_0x80b7('0x33')],'callerid':this[_0x80b7('0xc')][_0x80b7('0x34')]})[_0x80b7('0x10')](function(_0x1384b7){if(_0x382fd7){_0x382fd7(null,_0x1384b7);}})['catch'](function(_0x311142){if(_0x382fd7){_0x382fd7(_0x311142);}});};AGIVertices[_0x80b7('0xe')]['createSquareRecording']=function(_0x435022,_0x5ac956,_0x4ef52d,_0x4418c3){this['rpc']['createSquareRecording']({'uniqueid':this[_0x80b7('0xc')][_0x80b7('0x30')],'callerid':this['channel'][_0x80b7('0x34')],'calleridname':this[_0x80b7('0xc')][_0x80b7('0x35')],'context':this['channel'][_0x80b7('0x36')],'extension':this[_0x80b7('0xc')][_0x80b7('0x37')],'priority':this[_0x80b7('0xc')]['priority'],'accountcode':this['channel']['accountcode'],'dnid':this[_0x80b7('0xc')][_0x80b7('0x38')],'projectName':this[_0x80b7('0xc')][_0x80b7('0x33')],'saveName':_0x5ac956,'filename':_0x435022[_0x80b7('0x39')]||_0x5ac956,'savePath':_0x4ef52d})[_0x80b7('0x10')](function(_0x398925){_0x4418c3(null,_0x398925);})[_0x80b7('0x12')](function(_0x4a6cb5){_0x4418c3(_0x4a6cb5);});};AGIVertices['prototype'][_0x80b7('0x3a')]=function(_0x13ebaa,_0x3d01c6,_0x2d9168,_0x1fff8c,_0x2da4a1){this['rpc'][_0x80b7('0x3a')]({'uniqueid':this[_0x80b7('0xc')]['uniqueid'],'body':_0x13ebaa,'direction':_0x3d01c6,'providerName':_0x2d9168,'providerResponse':_0x1fff8c})[_0x80b7('0x10')](function(_0x40b524){if(_0x2da4a1){_0x2da4a1(null,_0x40b524);}})[_0x80b7('0x12')](function(_0x49ada9){if(_0x2da4a1){_0x2da4a1(_0x49ada9);}});};AGIVertices['prototype'][_0x80b7('0x3b')]=function(_0x66202,_0xbc9686){this[_0x80b7('0xd')][_0x80b7('0x3b')]({'firstName':_[_0x80b7('0x3c')](_0x66202['name'])||_[_0x80b7('0x3d')](_0x66202[_0x80b7('0x11')])?_0x80b7('0x3e')+Math[_0x80b7('0x3f')]():_0x66202[_0x80b7('0x11')],'lastName':_['isEmpty'](_0x66202['lastName'])||_[_0x80b7('0x3d')](_0x66202[_0x80b7('0x40')])?null:_0x66202[_0x80b7('0x40')],'phone':_0x66202['phone'],'ListId':_0x66202[_0x80b7('0x41')],'scheduledat':_0x66202['scheduledAt'],'callbackUniqueid':this[_0x80b7('0xc')][_0x80b7('0x30')],'tags':_0x80b7('0x42'),'description':_0x80b7('0x43')+_0x66202[_0x80b7('0x44')][_0x80b7('0x45')](),'priority':_0x66202[_0x80b7('0x46')]})[_0x80b7('0x10')](function(_0x43ea4f){_0xbc9686(null,_0x43ea4f);})[_0x80b7('0x12')](function(_0x1c408c){_0xbc9686(_0x1c408c);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x47')]=function(_0x10aebd,_0x5215f1){this[_0x80b7('0xd')][_0x80b7('0x48')](_0x10aebd)[_0x80b7('0x10')](function(_0x41c23c){_0x5215f1(null,_0x41c23c?_0x41c23c[_0x80b7('0x11')]:![]);})[_0x80b7('0x12')](function(_0x197c00){_0x5215f1(_0x197c00);});};AGIVertices['prototype'][_0x80b7('0x49')]=function(_0x23f06f,_0xc4b38,_0x251b87){var _0x48c39f={'role':_0x80b7('0x4a')};_0x48c39f[_0x23f06f]=this[_0x80b7('0xc')]['callerid'];this[_0x80b7('0xd')][_0x80b7('0x49')](_0x48c39f,_0xc4b38,this['channel'][_0x80b7('0x30')])[_0x80b7('0x10')](function(_0x56fd5e){_0x251b87(null,_['isNil'](_0x56fd5e)?![]:!![]);})[_0x80b7('0x12')](function(_0x5e256b){logger[_0x80b7('0x29')](_0x5e256b);_0x251b87(null,![]);});};AGIVertices[_0x80b7('0xe')]['agentUnpause']=function(_0x1ec5ee,_0x151939){var _0x4e3851={'role':_0x80b7('0x4a')};_0x4e3851[_0x1ec5ee]=this[_0x80b7('0xc')][_0x80b7('0x34')];this[_0x80b7('0xd')][_0x80b7('0x4b')](_0x4e3851)[_0x80b7('0x10')](function(_0x222466){_0x151939(null,_[_0x80b7('0x3d')](_0x222466)?![]:!![]);})[_0x80b7('0x12')](function(_0x5f255e){logger['error'](_0x5f255e);_0x151939(null,![]);});};AGIVertices[_0x80b7('0xe')]['agentLogout']=function(_0x24f889,_0x21d013){var _0x25fc84={'role':'agent'};_0x25fc84[_0x24f889]=this[_0x80b7('0xc')][_0x80b7('0x34')];this['rpc'][_0x80b7('0x4c')](_0x25fc84)[_0x80b7('0x10')](function(_0x4370b8){_0x21d013(null,_[_0x80b7('0x3d')](_0x4370b8)?![]:!![]);})['catch'](function(_0x5818f2){logger[_0x80b7('0x29')](_0x5818f2);_0x21d013(null,![]);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x4d')]=function(_0x54ec05,_0x502757){var _0x38867e={'role':_0x80b7('0x4a')};_0x38867e[_0x54ec05]=this[_0x80b7('0xc')]['callerid'];var _0x33b76f=_0x54ec05!=_0x80b7('0x4e')?util[_0x80b7('0x4f')](_0x80b7('0x50'),'LOCAL',this['channel'][_0x80b7('0x34')]):undefined;this[_0x80b7('0xd')]['agentLogin'](_0x38867e,_0x33b76f)['then'](function(_0x50a69b){_0x502757(null,_['isNil'](_0x50a69b)?![]:!![]);})[_0x80b7('0x12')](function(_0x500401){logger['error'](_0x500401);_0x502757(null,![]);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x51')]=function(_0x2ace46,_0x1fe9e6){sh[_0x80b7('0x52')](_[_0x80b7('0x53')](_0x2ace46),function(_0x328854,_0x28647a){var _0x3e5149=_0x28647a['replace'](/(\r\n|\n|\r)/gm,'');_0x1fe9e6(null,_0x3e5149);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x3fe3c3,_0x2dd01c){scripts[_0x80b7('0x54')](_0x3fe3c3[_0x80b7('0x55')],_0x3fe3c3['google_cloud_tts_text_type']||_0x80b7('0x56'),_0x3fe3c3[_0x80b7('0x56')],_0x3fe3c3['languageCode']||'en-US',_0x3fe3c3['ssmlGender']||_0x80b7('0x57'),_0x3fe3c3[_0x80b7('0x58')]||'MP3')[_0x80b7('0x10')](function(_0x4bf950){_0x2dd01c(null,_0x4bf950);})['catch'](function(_0x4d378a){_0x2dd01c(_0x4d378a);});};AGIVertices['prototype']['googleTTS']=function(_0x4b5e01,_0x5e8526){scripts[_0x80b7('0x59')](_0x4b5e01['text'],_0x4b5e01[_0x80b7('0x5a')]||'en',0x1)['then'](function(_0x2fd411){_0x5e8526(null,_0x2fd411);})[_0x80b7('0x12')](function(_0x2a6c1b){_0x5e8526(_0x2a6c1b);});};AGIVertices['prototype'][_0x80b7('0x5b')]=function(_0x37e1c8,_0x482cfc){var _0x190c5a={'uri':_0x37e1c8[_0x80b7('0x5c')],'method':_0x37e1c8['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x37e1c8[_0x80b7('0x5d')])===_0x80b7('0x5e')&&parseInt(_0x37e1c8[_0x80b7('0x5d')])>=0x1?parseInt(_0x37e1c8['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x80b7('0x5f')](['POST','PUT'],_0x190c5a['method'][_0x80b7('0x60')]())){try{_0x190c5a['body']=_0x37e1c8['rawBody']?JSON[_0x80b7('0x61')](_0x37e1c8[_0x80b7('0x62')]):{};}catch(_0x104afb){logger[_0x80b7('0x29')](_0x80b7('0x63'),_0x104afb);}}try{_0x190c5a[_0x80b7('0x64')]=_0x37e1c8[_0x80b7('0x8')]?JSON[_0x80b7('0x61')](_0x37e1c8[_0x80b7('0x8')]):{};}catch(_0x23df14){logger[_0x80b7('0x29')](_0x80b7('0x65'),_0x23df14);}if(_0x37e1c8['computedVariables']){try{var _0x270ea6=require(_0x37e1c8[_0x80b7('0x66')])[_0x80b7('0x67')](this,_0x190c5a);_0x190c5a['uri']=Mustache[_0x80b7('0x68')](_0x37e1c8[_0x80b7('0x5c')],_0x270ea6,{},['$$','$$']);if(_0x190c5a[_0x80b7('0x64')]){_0x190c5a[_0x80b7('0x64')]=JSON[_0x80b7('0x61')](Mustache[_0x80b7('0x68')](JSON[_0x80b7('0x69')](_0x190c5a[_0x80b7('0x64')]),_0x270ea6,{},['$$','$$']));}if(_0x190c5a['body']){_0x190c5a[_0x80b7('0x6a')]=JSON[_0x80b7('0x61')](Mustache[_0x80b7('0x68')](JSON['stringify'](_0x190c5a['body']),_0x270ea6,{},['$$','$$']));}}catch(_0xb22b8b){logger[_0x80b7('0x29')](_0x80b7('0x6b'),_0xb22b8b);}}rp(_0x190c5a)[_0x80b7('0x10')](function(_0x56d823){var _0x400bd0={'statusCode':_0x56d823[_0x80b7('0x6c')]||0xc8,'statusMessage':_0x56d823[_0x80b7('0x6d')]||'OK','headers':_0x56d823[_0x80b7('0x64')]||{},'body':_0x56d823['body']||{}};_0x482cfc(null,_0x400bd0);})[_0x80b7('0x12')](function(_0xa4a6e){var _0x55d727={'statusCode':_0xa4a6e['statusCode']||0x1f4,'statusMessage':_0xa4a6e[_0x80b7('0x6e')]||_0x80b7('0x6f'),'headers':_0xa4a6e[_0x80b7('0x70')][_0x80b7('0x64')]||{},'body':_0xa4a6e[_0x80b7('0x70')][_0x80b7('0x6a')]||{}};_0x482cfc(null,_0x55d727);});};AGIVertices['prototype'][_0x80b7('0x71')]=function(_0x13524c,_0x29aade){scripts['googleDialogflow'](this[_0x80b7('0xc')][_0x80b7('0x30')],_0x13524c[_0x80b7('0x72')],_0x13524c[_0x80b7('0x56')],_0x13524c[_0x80b7('0x73')]||'en')['then'](function(_0x133ce6){_0x29aade(null,_0x133ce6);})[_0x80b7('0x12')](function(_0x50b229){_0x29aade(_0x50b229);});};AGIVertices[_0x80b7('0xe')]['googleDialogflowV2']=function(_0x2fc6e8,_0x58d164){scripts[_0x80b7('0x74')](this[_0x80b7('0xc')]['uniqueid'],_0x2fc6e8[_0x80b7('0x75')],_0x2fc6e8[_0x80b7('0x76')],_0x2fc6e8[_0x80b7('0x77')],_0x2fc6e8[_0x80b7('0x56')],_0x2fc6e8[_0x80b7('0x78')]||'en')['then'](function(_0x57965f){_0x58d164(null,_0x57965f);})['catch'](function(_0x13bb33){_0x58d164(_0x13bb33);});};AGIVertices[_0x80b7('0xe')]['sestekNDA']=function(_0x5de47f,_0x186d10){scripts[_0x80b7('0x79')](this[_0x80b7('0xc')],_0x5de47f)[_0x80b7('0x10')](function(_0x176471){_0x186d10(null,_0x176471);})[_0x80b7('0x12')](function(_0x3216f9){_0x186d10(_0x3216f9);});};AGIVertices['prototype'][_0x80b7('0x7a')]=function(_0x2840d5,_0x355253){scripts[_0x80b7('0x7a')](_0x2840d5[_0x80b7('0x72')],_0x2840d5[_0x80b7('0x56')],_0x2840d5[_0x80b7('0x7b')]||_0x80b7('0x7c'),_0x2840d5[_0x80b7('0x7d')])['then'](function(_0x45e613){_0x355253(null,_0x45e613);})[_0x80b7('0x12')](function(_0x27ee8d){_0x355253(_0x27ee8d);});};AGIVertices[_0x80b7('0xe')]['ispeechASR']=function(_0x100942,_0x30603d,_0x4e7950){scripts[_0x80b7('0x7e')](_0x30603d,_0x100942[_0x80b7('0x72')],_0x100942[_0x80b7('0x7f')]||_0x80b7('0x7c'),this['isConfigured'](_0x100942[_0x80b7('0x80')])?_0x100942[_0x80b7('0x80')]:undefined)[_0x80b7('0x10')](function(_0x3f912a){_0x4e7950(null,_0x3f912a);})['catch'](function(_0x3ba543){_0x4e7950(_0x3ba543);});};AGIVertices['prototype'][_0x80b7('0x81')]=function(_0xaa27df,_0x4a1553){scripts[_0x80b7('0x81')](_0xaa27df[_0x80b7('0x82')],_0xaa27df['aws_secret_access_key'],_0xaa27df[_0x80b7('0x83')],_0xaa27df[_0x80b7('0x84')]||'Amy',_0xaa27df[_0x80b7('0x56')],_0xaa27df[_0x80b7('0x85')]||_0x80b7('0x56'))['then'](function(_0xeb7511){_0x4a1553(null,_0xeb7511);})[_0x80b7('0x12')](function(_0x17b8fd){_0x4a1553(_0x17b8fd);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x86')]=function(_0x3f1252,_0x1e0dd8){scripts[_0x80b7('0x86')](this[_0x80b7('0xc')][_0x80b7('0x30')],_0x3f1252['aws_access_key_id'],_0x3f1252['aws_secret_access_key'],_0x3f1252[_0x80b7('0x87')],_0x3f1252[_0x80b7('0x56')],_0x3f1252[_0x80b7('0x88')])[_0x80b7('0x10')](function(_0x22511a){_0x1e0dd8(null,_0x22511a);})['catch'](function(_0x3cd455){_0x1e0dd8(_0x3cd455);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x89')]=function(_0x6023a4,_0x5770d6,_0x48274e){scripts['googleASR'](_0x5770d6,_0x6023a4[_0x80b7('0x72')],_0x6023a4['google_asr_language']||_0x80b7('0x7c'))[_0x80b7('0x10')](function(_0x410182){_0x48274e(null,_0x410182);})[_0x80b7('0x12')](function(_0x35cc6e){_0x48274e(_0x35cc6e);});};AGIVertices[_0x80b7('0xe')]['tildeASR']=function(_0x339a21,_0x34e00,_0x395507){scripts[_0x80b7('0x8a')](_0x34e00,_0x339a21[_0x80b7('0x8b')],_0x339a21[_0x80b7('0x8c')],_0x339a21['uri'])[_0x80b7('0x10')](function(_0xa826cc){_0x395507(null,_0xa826cc);})[_0x80b7('0x12')](function(_0x21fb22){_0x395507(_0x21fb22);});};AGIVertices[_0x80b7('0xe')]['clear']=function(_0xd90591){var _0x13d090=_['includes'](verticesWithRetry,_0xd90591[_0x80b7('0x32')])?_0xd90591:_[_0x80b7('0x8d')](_0xd90591);for(var _0x59e878 in _0x13d090){if(_0x13d090[_0x80b7('0x8e')](_0x59e878)){if(_0x13d090[_0x59e878]&&_[_0x80b7('0x8f')](_0x13d090[_0x59e878])){if(_[_0x80b7('0x5f')](recursiveMapAttributes,_0x59e878)){_0x13d090[_0x59e878]=this[_0x80b7('0x90')](_0x13d090[_0x59e878]);}else{_0x13d090[_0x59e878]=this[_0x80b7('0x91')](_0x13d090[_0x59e878]);}}}}return _0x13d090;};AGIVertices[_0x80b7('0xe')]['recursiveNodeIndex']=function(_0x4dbdc4){for(var _0x1f2349 in _0x4dbdc4){if(_0x4dbdc4['hasOwnProperty'](_0x1f2349)){if(_[_0x80b7('0x92')](_0x4dbdc4[_0x1f2349])){this[_0x80b7('0x93')](_0x4dbdc4[_0x1f2349]);}else if(_[_0x80b7('0x94')](_0x4dbdc4[_0x1f2349])){for(var _0x520218=0x0;_0x520218<_0x4dbdc4[_0x1f2349][_0x80b7('0x95')];_0x520218++){this[_0x80b7('0x93')](_0x4dbdc4[_0x1f2349][_0x520218]);}}else if(_[_0x80b7('0x8f')](_0x4dbdc4[_0x1f2349])){_0x4dbdc4[_0x1f2349]=this[_0x80b7('0x91')](_0x4dbdc4[_0x1f2349]);}}}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x96')]=function(_0x3e9fb4,_0x4b4a8a){for(var _0x3900cc in _0x3e9fb4){if(_0x3e9fb4[_0x80b7('0x8e')](_0x3900cc)){if(_[_0x80b7('0x92')](_0x3e9fb4[_0x3900cc])){if(!_['isEmpty'](_0x3e9fb4[_0x3900cc])){this[_0x80b7('0x96')](_0x3e9fb4[_0x3900cc],util['format'](_0x80b7('0x97'),_0x4b4a8a,_0x3900cc));}}else if(_['isArray'](_0x3e9fb4[_0x3900cc])){for(var _0x59266f=0x0;_0x59266f<_0x3e9fb4[_0x3900cc][_0x80b7('0x95')];_0x59266f++){this[_0x80b7('0x96')](_0x3e9fb4[_0x3900cc][_0x59266f],util[_0x80b7('0x4f')](_0x80b7('0x97'),_0x4b4a8a,_0x3900cc+'['+_0x59266f+']'));}}else{if(!_[_0x80b7('0x3d')](_0x3e9fb4[_0x3900cc])){this[_0x80b7('0xc')]['setVariable'](util[_0x80b7('0x4f')](_0x80b7('0x97'),_0x4b4a8a,_0x3900cc),_0x3e9fb4[_0x3900cc]);}}}}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x90')]=function(_0x549e2e){try{var _0x39e9b9=JSON[_0x80b7('0x61')](_0x549e2e);this[_0x80b7('0x93')](_0x39e9b9);return JSON[_0x80b7('0x69')](_0x39e9b9);}catch(_0x4e69a2){return this[_0x80b7('0x91')](_0x549e2e);}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x91')]=function(_0x367165){var _0x5c938d=_0x367165[_0x80b7('0x98')]('{');for(var _0x49d0cb=0x1;_0x49d0cb<_0x5c938d[_0x80b7('0x95')];_0x49d0cb+=0x1){var _0x1d94de=_0x5c938d[_0x49d0cb][_0x80b7('0x98')]('}');if(_0x1d94de['length']>0x1){_0x367165=_0x367165[_0x80b7('0x99')]('{'+_0x1d94de[0x0]+'}',this['channel']['getVariable'](_0x1d94de[0x0])[_0x80b7('0x9a')]||_0x1d94de[0x0]);}}if(_0x5c938d[_0x80b7('0x95')]===0x1){return _0x367165['toString']();}return this[_0x80b7('0x91')](_0x367165);};AGIVertices[_0x80b7('0xe')]['getAndSetVariable']=function(_0x10f143,_0x2470f6){var _0x429354=this[_0x80b7('0xc')][_0x80b7('0x9b')](_0x10f143);if(_0x429354[_0x80b7('0x9c')]===-0x1){return _0x429354;}logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x9d'),_0x2470f6,_0x429354['extra']));return this[_0x80b7('0xc')][_0x80b7('0x9e')](_0x2470f6,_0x429354['extra']);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x9f')]=function(_0x2329c4){return _0x2329c4&&_0x2329c4!=='0'&&_0x2329c4!=='-1'&&_0x2329c4!=='';};AGIVertices[_0x80b7('0xe')][_0x80b7('0xa0')]=function(_0x38c935){this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x38c935,'-');_0x38c935[_0x80b7('0xa1')]=_0x38c935['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x80b7('0xe')][_0x80b7('0xa2')]=function(_0x2b5303){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x2b5303[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x2b5303['text'])){return this[_0x80b7('0xc')]['noop']('no\x20text\x20configured');}var _0x420aad='\x22'+_0x2b5303[_0x80b7('0x56')]+'\x22';if(this[_0x80b7('0x9f')](_0x2b5303[_0x80b7('0x70')])){_0x420aad+=','+_0x2b5303['options'];}var _0x902b77=this[_0x80b7('0xc')][_0x80b7('0x52')](_0x80b7('0xa3'),_0x420aad);if(_0x902b77['result']===-0x1){return _0x902b77;}return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x420aad));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xa4')]=function(_0x2e3a5a){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0xa5'),_0x2e3a5a[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x2e3a5a[_0x80b7('0xa6')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xa8'));}var _0xbc9cd2=_0x2e3a5a[_0x80b7('0xa6')];if(this[_0x80b7('0x9f')](_0x2e3a5a[_0x80b7('0x70')])){_0xbc9cd2+=','+_0x2e3a5a[_0x80b7('0x70')];}var _0x11cee6=this[_0x80b7('0xc')][_0x80b7('0x52')](_0x80b7('0xa9'),_0xbc9cd2);if(_0x11cee6[_0x80b7('0x9c')]===-0x1){return _0x11cee6;}var _0x3fe56b=this[_0x80b7('0xaa')](_0x80b7('0xab'),'MRCP_RECOG_CONFIDENCE');if(_0x3fe56b[_0x80b7('0x9c')]===-0x1){return _0x3fe56b;}var _0x104c91=this[_0x80b7('0xaa')](_0x80b7('0xac'),'MRCP_RECOG_TRANSCRIPT');if(_0x104c91[_0x80b7('0x9c')]===-0x1){return _0x104c91;}var _0x5eb4d6=this[_0x80b7('0xaa')](_0x80b7('0xad'),_0x80b7('0xae'));if(_0x5eb4d6['result']===-0x1){return _0x5eb4d6;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('Executed\x20command\x20MRCPRecog\x20%s',_0xbc9cd2));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x6')]=function(_0x1be785){logger['info'](util['format'](_0x80b7('0xaf'),_0x1be785[_0x80b7('0x31')]));return this[_0x80b7('0xc')][_0x80b7('0x6')]([_0x1be785['command'],_0x1be785[_0x80b7('0xb0')]]);};AGIVertices['prototype']['answer']=function(_0xbc54d1){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0xb1'),_0xbc54d1[_0x80b7('0x31')]));if(this['isConfigured'](_0xbc54d1['timeout'])){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('Wait\x20%s\x20seconds\x20before\x20answer',_0xbc54d1[_0x80b7('0x5d')]));var _0x5181a7=this[_0x80b7('0xc')][_0x80b7('0xb2')](_0xbc54d1[_0x80b7('0x5d')]);if(_0x5181a7[_0x80b7('0x9c')]===-0x1){return _0x5181a7;}}return this['channel']['answer']();};AGIVertices[_0x80b7('0xe')]['callback']=function(_0x55fbfa){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0xb3'),_0x55fbfa[_0x80b7('0x31')]));if(!this['isConfigured'](_0x55fbfa['list_id'])){return this['channel'][_0x80b7('0x29')](_0x55fbfa,_0x80b7('0xb4'));}_0x55fbfa[_0x80b7('0x44')]=moment();if(this['isConfigured'](_0x55fbfa[_0x80b7('0xb5')])){_0x55fbfa[_0x80b7('0x44')]=moment()[_0x80b7('0xb6')](_0x55fbfa[_0x80b7('0xb5')],_0x80b7('0xb7'));}if(!this[_0x80b7('0x9f')](_0x55fbfa[_0x80b7('0x46')])){_0x55fbfa[_0x80b7('0x46')]=0x2;}this[_0x80b7('0x3b')]['sync'](this,_0x55fbfa);return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xb8'),_0x55fbfa[_0x80b7('0xb9')],_0x55fbfa[_0x80b7('0x41')],_0x55fbfa['scheduledAt']));};AGIVertices[_0x80b7('0xe')]['custom_app']=function(_0x18b139){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0xba'),_0x18b139[_0x80b7('0x31')]));var _0x3d5e8e=this['channel'][_0x80b7('0x52')](_0x18b139[_0x80b7('0xbb')],_0x18b139[_0x80b7('0x70')]);if(_0x3d5e8e[_0x80b7('0x9c')]===-0x1){return _0x3d5e8e;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xbc'),_0x18b139['application'],_0x18b139[_0x80b7('0x70')]));};AGIVertices['prototype'][_0x80b7('0xbd')]=function(_0x163062){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0xbe'),_0x163062[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x163062['text'])){return this['channel']['noop'](_0x80b7('0xbf'));}var _0x36073d='\x22'+_0x163062[_0x80b7('0x56')]+'\x22';if(this[_0x80b7('0x9f')](_0x163062[_0x80b7('0x70')])){_0x36073d+=','+_0x163062[_0x80b7('0x70')];}var _0x55078a=this['channel']['exec'](_0x80b7('0xa3'),_0x36073d);if(_0x55078a['result']===-0x1){return _0x55078a;}return this['channel'][_0x80b7('0xa7')](util['format'](_0x80b7('0xc0'),_0x36073d));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xc1')]=function(_0x51d571){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0xc2'),_0x51d571[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x51d571[_0x80b7('0x56')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xbf'));}var _0x1e5e08='\x22'+_0x51d571[_0x80b7('0x56')]+'\x22';if(this['isConfigured'](_0x51d571[_0x80b7('0x70')])){_0x1e5e08+=','+_0x51d571[_0x80b7('0x70')];}var _0x38b026=this['channel'][_0x80b7('0x52')]('MRCPSynth',_0x1e5e08);if(_0x38b026['result']===-0x1){return _0x38b026;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xc0'),_0x1e5e08));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xc3')]=function(_0x592a08){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x592a08[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x592a08[_0x80b7('0xa6')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')]('no\x20grammar\x20configured');}var _0x5213d7=_0x592a08[_0x80b7('0xa6')];if(this[_0x80b7('0x9f')](_0x592a08[_0x80b7('0x70')])){_0x5213d7+=','+_0x592a08[_0x80b7('0x70')];}var _0xe7706b=this[_0x80b7('0xc')][_0x80b7('0x52')](_0x80b7('0xa9'),_0x5213d7);if(_0xe7706b[_0x80b7('0x9c')]===-0x1){return _0xe7706b;}var _0x523724=this[_0x80b7('0xaa')](_0x80b7('0xab'),'LUMENVOX_ASR_CONFIDENCE');if(_0x523724['result']===-0x1){return _0x523724;}var _0x4da2b8=this['getAndSetVariable'](_0x80b7('0xac'),_0x80b7('0xc4'));if(_0x4da2b8[_0x80b7('0x9c')]===-0x1){return _0x4da2b8;}var _0x30056e=this[_0x80b7('0xaa')](_0x80b7('0xad'),_0x80b7('0xc5'));if(_0x30056e[_0x80b7('0x9c')]===-0x1){return _0x30056e;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xc6'),_0x5213d7));};AGIVertices['prototype'][_0x80b7('0xc7')]=function(_0x41e760){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0xc8'),_0x41e760[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x41e760[_0x80b7('0xa6')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xa8'));}var _0x19ede8=_0x41e760[_0x80b7('0xa6')];if(this[_0x80b7('0x9f')](_0x41e760[_0x80b7('0x70')])){_0x19ede8+=','+_0x41e760[_0x80b7('0x70')];}var _0x4f4512=this['channel'][_0x80b7('0x52')](_0x80b7('0xa9'),_0x19ede8);if(_0x4f4512[_0x80b7('0x9c')]===-0x1){return _0x4f4512;}var _0x53d159=this[_0x80b7('0xaa')](_0x80b7('0xab'),_0x80b7('0xc9'));if(_0x53d159[_0x80b7('0x9c')]===-0x1){return _0x53d159;}var _0xd4ce5=this[_0x80b7('0xaa')](_0x80b7('0xac'),'SESTEK_ASR_TRANSCRIPT');if(_0xd4ce5[_0x80b7('0x9c')]===-0x1){return _0xd4ce5;}var _0x32956e=this[_0x80b7('0xaa')](_0x80b7('0xad'),_0x80b7('0xca'));if(_0x32956e[_0x80b7('0x9c')]===-0x1){return _0x32956e;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xc6'),_0x19ede8));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xcb')]=function(_0x4fa041){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0xcc'),_0x4fa041[_0x80b7('0x31')]));if(!this['isConfigured'](_0x4fa041[_0x80b7('0xcd')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x4fa041,_0x80b7('0xce'));}var _0x54b481=this[_0x80b7('0x16')][_0x80b7('0x67')](this,_0x4fa041['odbc_id']);if(!_0x54b481){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x4fa041,_0x80b7('0xcf'));}if(!this[_0x80b7('0x9f')](_0x4fa041['query'])){return this[_0x80b7('0xc')]['error'](_0x4fa041,_0x80b7('0xd0'));}var _0x3bbc8b=_0x4fa041[_0x80b7('0x2c')][_0x80b7('0xd1')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xd2'),_0x3bbc8b));var _0x44c28c=this[_0x80b7('0x27')]['sync'](this,_0x54b481,_0x3bbc8b);this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x4fa041,_0x3bbc8b);if(!this[_0x80b7('0x9f')](_0x4fa041[_0x80b7('0xd3')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xd4'));}var _0x239e23=this[_0x80b7('0x9b')][_0x80b7('0x67')](this,_0x4fa041[_0x80b7('0xd3')]);if(!_0x239e23){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x4fa041,_0x80b7('0xd5'));}var _0x1f7579=this;_0x44c28c[_0x80b7('0xd6')](function(_0x361562,_0x1336d0){Object[_0x80b7('0xd7')](_0x361562)['forEach'](function(_0x23b3ae){_0x1f7579[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0xd8'),_0x239e23,_0x1336d0,_0x23b3ae),_0x361562[_0x23b3ae]);});});this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0xd9'),_0x239e23),_0x44c28c[_0x80b7('0x95')]);return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')](_0x80b7('0xda'),_0x239e23));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xdb')]=function(_0x21b492){logger['debug'](util[_0x80b7('0x4f')](_0x80b7('0xdc'),_0x21b492[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x21b492[_0x80b7('0xdd')])){return this['channel']['error'](_0x21b492,_0x80b7('0xde'));}var _0x375358=this[_0x80b7('0x18')]['sync'](this,_0x21b492['sip_id']);if(!_0x375358){return this['channel'][_0x80b7('0x29')](_0x21b492,_0x80b7('0xdf'));}var _0x4699ea=this[_0x80b7('0xc')][_0x80b7('0x52')](_0x80b7('0xe0'),[util[_0x80b7('0x4f')](_0x80b7('0xe1'),_0x375358),_0x21b492[_0x80b7('0x5d')],_0x21b492[_0x80b7('0xe2')],_0x21b492[_0x80b7('0x5c')]]);if(_0x4699ea[_0x80b7('0x9c')]===-0x1){return _0x4699ea;}return this['channel']['noop'](util['format'](_0x80b7('0xe3'),_0x80b7('0xe0')));};AGIVertices['prototype'][_0x80b7('0xe4')]=function(_0x14d022){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0xe5'),_0x14d022[_0x80b7('0x31')]));if(!this['isConfigured'](_0x14d022[_0x80b7('0x72')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xe6'));}if(!this[_0x80b7('0x9f')](_0x14d022[_0x80b7('0x56')])){return this['channel'][_0x80b7('0xa7')](_0x80b7('0xbf'));}this['channel'][_0x80b7('0xe7')]=!![];this[_0x80b7('0x2f')](_0x14d022);this[_0x80b7('0x3a')](_0x14d022['text'],'in','','');this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('Trying\x20Dialogflow:\x20%s',_0x14d022[_0x80b7('0x56')]));var _0x448666=this[_0x80b7('0x71')][_0x80b7('0x67')](this,_0x14d022);if(_0x448666){for(var _0x3f58fc in _0x448666){if(_0x448666[_0x80b7('0x8e')](_0x3f58fc)){this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0xe8'),_0x3f58fc[_0x80b7('0x60')]()),_0x448666[_0x3f58fc]);}}this[_0x80b7('0x3a')](_0x448666['speech'],_0x80b7('0xe9'),_0x80b7('0xe4'),'');return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xea'),_0x448666[_0x80b7('0xeb')]));}return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x14d022,_0x80b7('0xec'));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xed')]=function(_0x4470d4){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0xee'),_0x4470d4['label']));if(!this['isConfigured'](_0x4470d4[_0x80b7('0x75')])){return this[_0x80b7('0xc')]['noop']('no\x20project_id\x20configured');}if(!this[_0x80b7('0x9f')](_0x4470d4[_0x80b7('0x76')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')]('no\x20client_email\x20configured');}if(!this[_0x80b7('0x9f')](_0x4470d4[_0x80b7('0x77')])){return this['channel'][_0x80b7('0xa7')](_0x80b7('0xef'));}if(!this[_0x80b7('0x9f')](_0x4470d4[_0x80b7('0x78')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xf0'));}if(!this[_0x80b7('0x9f')](_0x4470d4[_0x80b7('0x56')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xe7')]=!![];this['createSquareDetailsReport'](_0x4470d4);this[_0x80b7('0x3a')](_0x4470d4['text'],'in','','');this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xf1'),_0x4470d4[_0x80b7('0x56')]));var _0x29e46f=this[_0x80b7('0x74')][_0x80b7('0x67')](this,_0x4470d4);if(_0x29e46f){for(var _0x4004c6 in _0x29e46f){if(_0x29e46f['hasOwnProperty'](_0x4004c6)){if(_0x4004c6!==_0x80b7('0xf2')){this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0xe8'),_0x4004c6[_0x80b7('0x60')]()),_0x29e46f[_0x4004c6]);}}}this[_0x80b7('0x3a')](_0x29e46f[_0x80b7('0xeb')],_0x80b7('0xe9'),_0x80b7('0xed'),_0x29e46f[_0x80b7('0xf2')]);return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('DialogflowV2\x20Result\x20%s',_0x29e46f['speech']));}return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x4470d4,_0x80b7('0xf3'));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xf4')]=function(_0x5e6b0b){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0xf5'),_0x5e6b0b[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x5e6b0b[_0x80b7('0xf6')])){return this['channel'][_0x80b7('0xa7')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x80b7('0x9f')](_0x5e6b0b[_0x80b7('0xf7')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xf8'));}if(!this[_0x80b7('0x9f')](_0x5e6b0b['password'])){return this['channel'][_0x80b7('0xa7')](_0x80b7('0xf9'));}if(!this[_0x80b7('0x9f')](_0x5e6b0b[_0x80b7('0xfa')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xe7')]=!![];this[_0x80b7('0x2f')](_0x5e6b0b);this['createSquareMessage'](_0x5e6b0b[_0x80b7('0x56')],'in','','');this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xfb'),_0x5e6b0b['text']));var _0x420411=this[_0x80b7('0x79')][_0x80b7('0x67')](this,_0x5e6b0b);if(_0x420411){for(var _0x223128 in _0x420411){if(_0x420411[_0x80b7('0x8e')](_0x223128)){this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0xfc'),_0x223128[_0x80b7('0x60')]()),_0x420411[_0x223128]);}}this[_0x80b7('0x3a')](_0x420411[_0x80b7('0xeb')],'out',_0x80b7('0xf4'),'');if(_0x420411[_0x80b7('0xfd')]){this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x420411['audiofile']));var _0x2d947d=this[_0x80b7('0xc')][_0x80b7('0xfe')](_0x420411[_0x80b7('0xfd')]);try{fs[_0x80b7('0xff')](_0x420411[_0x80b7('0xfd')]+'.wav');}catch(_0x398550){logger[_0x80b7('0x29')](_0x398550);}return _0x2d947d;}else{return this[_0x80b7('0xc')]['noop'](util['format'](_0x80b7('0x100'),_0x420411[_0x80b7('0xeb')]));}}return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x5e6b0b,_0x80b7('0x101'));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x102')]=function(_0x5417e9){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x103'),_0x5417e9[_0x80b7('0x31')]));return this['channel'][_0x80b7('0xa7')](_0x80b7('0x102'));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x104')]=function(_0x2cbdad){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x105'),_0x2cbdad[_0x80b7('0x31')]));var _0x5b2922='';if(_0x2cbdad[_0x80b7('0x106')]){if(!this['isConfigured'](_0x2cbdad[_0x80b7('0x106')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x2cbdad,'no\x20trunk\x20selected');}else{var _0x4ca29d=parseInt(_0x2cbdad[_0x80b7('0x106')],0xa);if(isNaN(_0x4ca29d)){_0x5b2922=_0x2cbdad['trunk_id'];}else{_0x5b2922=this['getTrunk']['sync'](this,_0x2cbdad['trunk_id']);if(!_0x5b2922){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x2cbdad,_0x80b7('0x107'));}}}}else if(_0x2cbdad[_0x80b7('0x108')]){_0x5b2922=_0x2cbdad['trunk_name'];}else{return this['channel']['error'](_0x2cbdad,_0x80b7('0x109'));}var _0x3df464=this[_0x80b7('0xc')][_0x80b7('0x52')](_0x80b7('0xe0'),[util[_0x80b7('0x4f')]('SIP/%s/%s',_0x5b2922,_0x2cbdad[_0x80b7('0xb9')]),_0x2cbdad[_0x80b7('0x5d')],_0x2cbdad[_0x80b7('0xe2')],_0x2cbdad[_0x80b7('0x5c')]]);if(_0x3df464['result']===-0x1){return _0x3df464;}return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')](_0x80b7('0xe3'),'DIAL'));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x10a')]=function(_0x40b910){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x10b'),_0x40b910[_0x80b7('0x31')]));return this[_0x80b7('0xc')][_0x80b7('0xa7')]('finally');};AGIVertices['prototype']['getdigits']=function(_0x5268bb){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x10c'),_0x5268bb[_0x80b7('0x31')]));if(_0x5268bb['retry']===0x0){return this[_0x80b7('0xa0')](_0x5268bb);}_0x5268bb['retry']-=0x1;if(!this[_0x80b7('0x9f')](_0x5268bb[_0x80b7('0x10d')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x5268bb,_0x80b7('0x10e'));}var _0x5252e5=this[_0x80b7('0x1b')][_0x80b7('0x67')](this,_0x5268bb[_0x80b7('0x10d')]);if(!_0x5252e5){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x5268bb,_0x80b7('0x10f'));}if(!this[_0x80b7('0x9f')](_0x5268bb['variable_id'])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x80b7('0xd4'));}var _0x4d774c=this[_0x80b7('0xc')][_0x80b7('0x110')](_0x5252e5,_0x5268bb['response'],_0x5268bb[_0x80b7('0x111')]);var _0x54ed34=_0x4d774c[_0x80b7('0x9c')]?_0x4d774c[_0x80b7('0x9c')][_0x80b7('0x45')]():'';logger[_0x80b7('0x2a')]('test',JSON[_0x80b7('0x69')](_0x4d774c));if(_0x4d774c['result']===-0x1){this['createSquareDetailsReport'][_0x80b7('0x67')](this,_0x5268bb,_0x54ed34);return _0x4d774c;}else if(_0x4d774c[_0x80b7('0x9a')]==='timeout'){_0x4d774c[_0x80b7('0x9c')]=_0x54ed34[_0x80b7('0x95')]>=parseInt(_0x5268bb['mindigit'])?'x':'i';}else{_0x4d774c['result']=_0x54ed34[_0x80b7('0x95')]>=parseInt(_0x5268bb[_0x80b7('0x112')])&&_0x54ed34['length']<=parseInt(_0x5268bb[_0x80b7('0x111')])?'x':'i';}var _0x59cbaf=this[_0x80b7('0x9b')]['sync'](this,_0x5268bb['variable_id']);if(!_0x59cbaf){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x5268bb,_0x80b7('0xd5'));}this[_0x80b7('0xc')][_0x80b7('0x9e')](_0x59cbaf,_0x54ed34);if(this[_0x80b7('0x9f')](_0x5268bb[_0x80b7('0x113')])){var _0x367518=parseInt(_0x5268bb['hiddendigitsnum'],0xa);var _0x39ee29=rs[_0x80b7('0x114')]({'charset':'*','length':_0x367518});var _0x3e940d=_0x54ed34['length'];if(_0x3e940d>0x0){if(_0x3e940d>_0x367518){this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x5268bb,_0x5268bb[_0x80b7('0x115')]===_0x80b7('0x116')?_0x39ee29+_0x54ed34[_0x80b7('0x117')](_0x367518):_0x54ed34['substr'](0x0,_0x3e940d-_0x367518)+_0x39ee29);}else{this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x5268bb,rs[_0x80b7('0x114')]({'charset':'*','length':_0x3e940d}));}}else{this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x5268bb,'');}}else{this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x5268bb,_0x54ed34);}return _0x4d774c;};AGIVertices[_0x80b7('0xe')][_0x80b7('0xb')]=function(_0x21b802){logger[_0x80b7('0x2a')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x21b802['label']));return this[_0x80b7('0xa')](_0x21b802);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x118')]=function(_0x4456e4){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x119'),_0x4456e4[_0x80b7('0x31')]));this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x4456e4,_0x4456e4[_0x80b7('0x11a')]);return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('GOAL\x20%s',_0x4456e4['goalname']));};AGIVertices[_0x80b7('0xe')]['awspolly']=function(_0x53db6e){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x11b'),_0x53db6e[_0x80b7('0x31')]));if(!this['isConfigured'](_0x53db6e['aws_access_key_id'])||!this['isConfigured'](_0x53db6e[_0x80b7('0x11c')])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x80b7('0x9f')](_0x53db6e[_0x80b7('0x56')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x11d'),_0x53db6e[_0x80b7('0x56')]));var _0x219cfa=this[_0x80b7('0x81')][_0x80b7('0x67')](this,_0x53db6e);if(_0x219cfa){this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x219cfa));var _0x2fdf2e=this[_0x80b7('0xc')][_0x80b7('0xfe')](_0x219cfa);try{fs['unlink'](_0x219cfa+_0x80b7('0x11e'));}catch(_0xfab59c){logger[_0x80b7('0x29')](_0xfab59c);}return _0x2fdf2e;}return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x53db6e,_0x80b7('0x11f'));};AGIVertices[_0x80b7('0xe')]['awslex']=function(_0x3794c0){logger['info'](util['format'](_0x80b7('0x120'),_0x3794c0[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x3794c0[_0x80b7('0x82')])||!this[_0x80b7('0x9f')](_0x3794c0[_0x80b7('0x11c')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x121'));}if(!this[_0x80b7('0x9f')](_0x3794c0[_0x80b7('0x88')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x122'));}if(!this[_0x80b7('0x9f')](_0x3794c0[_0x80b7('0x56')])){return this['channel'][_0x80b7('0xa7')](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xe7')]=!![];this['createSquareDetailsReport'](_0x3794c0);this['createSquareMessage'](_0x3794c0[_0x80b7('0x56')],'in','','');this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x3794c0[_0x80b7('0x56')]));var _0x164931=this[_0x80b7('0x86')][_0x80b7('0x67')](this,_0x3794c0);if(_0x164931){for(var _0x590ff8 in _0x164931){if(_0x164931[_0x80b7('0x8e')](_0x590ff8)&&_['isString'](_0x164931[_0x590ff8])){this['channel'][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0x123'),_0x590ff8['toUpperCase']()),_0x164931[_0x590ff8]);}}if(_['isNil'](_0x164931['message'])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x124'));}else{this['createSquareMessage'](_0x164931[_0x80b7('0x6e')],_0x80b7('0xe9'),_0x80b7('0x125'),'');return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')]('Amazon\x20Lex\x20Result\x20%s',_0x164931[_0x80b7('0x6e')]));}}return this['channel'][_0x80b7('0x29')](_0x3794c0,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x80b7('0xe')]['googleasr']=function(_0x163ef1){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x126'),_0x163ef1['label'],_0x163ef1[_0x80b7('0x5d')]));if(!this['isConfigured'](_0x163ef1['key'])){return this[_0x80b7('0xc')]['noop']('no\x20key\x20configured');}var _0x4fa8ac='wav';var _0xcb0f2a=util[_0x80b7('0x4f')](_0x80b7('0x127'),FILES_PATH,rs[_0x80b7('0x114')](0x4));var _0x2e9c60=util[_0x80b7('0x4f')]('%s.%s',_0xcb0f2a,_0x4fa8ac);var _0x2f8f78=!![];if(_0x163ef1[_0x80b7('0x128')]===_0x80b7('0x129')){_0x2f8f78=![];}var _0xfce8c2=this[_0x80b7('0xc')][_0x80b7('0x12a')](_0xcb0f2a,_0x4fa8ac,_0x163ef1[_0x80b7('0x12b')],_0x163ef1[_0x80b7('0x5d')],undefined,_0x2f8f78);if(_0xfce8c2[_0x80b7('0x9c')]!==-0x1){this['channel'][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x12c'),_0x2e9c60));var _0x2dfd2e=this[_0x80b7('0x89')][_0x80b7('0x67')](this,_0x163ef1,_0x2e9c60);if(_0x2dfd2e){for(var _0x4451b9 in _0x2dfd2e){if(_0x2dfd2e[_0x80b7('0x8e')](_0x4451b9)){this[_0x80b7('0xc')]['setVariable'](util[_0x80b7('0x4f')](_0x80b7('0x12d'),_0x4451b9[_0x80b7('0x60')]()),_0x2dfd2e[_0x4451b9]);}}return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')](_0x80b7('0x12e'),JSON[_0x80b7('0x69')](_0x2dfd2e)));}}return _0xfce8c2;};AGIVertices[_0x80b7('0xe')][_0x80b7('0x12f')]=function(_0x1b0034){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x130'),_0x1b0034[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x1b0034[_0x80b7('0x8b')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x131'));}if(!this['isConfigured'](_0x1b0034[_0x80b7('0x8c')])){return this['channel']['noop'](_0x80b7('0x132'));}var _0x472d44=_0x80b7('0x133');var _0x4142a6=util[_0x80b7('0x4f')]('%s/recordings/%s',FILES_PATH,rs[_0x80b7('0x114')](0x4));var _0x31eaf8=util[_0x80b7('0x4f')](_0x80b7('0x97'),_0x4142a6,_0x472d44);var _0x2a52a9=!![];if(_0x1b0034[_0x80b7('0x128')]===_0x80b7('0x129')){_0x2a52a9=![];}var _0x3dfbf5=this[_0x80b7('0xc')][_0x80b7('0x12a')](_0x4142a6,_0x472d44,_0x1b0034[_0x80b7('0x12b')],_0x1b0034['timeout'],undefined,_0x2a52a9);if(_0x3dfbf5['result']!==-0x1){this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format'](_0x80b7('0x134'),_0x31eaf8));var _0x1f8148=this[_0x80b7('0x8a')][_0x80b7('0x67')](this,_0x1b0034,_0x31eaf8);if(_0x1f8148){for(var _0x2c4e89 in _0x1f8148){if(_0x1f8148['hasOwnProperty'](_0x2c4e89)){this['channel']['setVariable'](util[_0x80b7('0x4f')](_0x80b7('0x135'),_0x2c4e89[_0x80b7('0x60')]()),_0x1f8148[_0x2c4e89]);}}return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')](_0x80b7('0x136'),JSON[_0x80b7('0x69')](_0x1f8148)));}}return _0x3dfbf5;};AGIVertices[_0x80b7('0xe')][_0x80b7('0x137')]=function(_0x286571){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x138'),_0x286571[_0x80b7('0x31')]));return this['channel'][_0x80b7('0x139')](_0x286571[_0x80b7('0x36')],_0x286571[_0x80b7('0x37')],_0x286571[_0x80b7('0x13a')]);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x13b')]=function(_0x7f988d){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x13c'),_0x7f988d['label']));if(!this[_0x80b7('0x9f')](_0x7f988d[_0x80b7('0x13d')])){return this[_0x80b7('0xc')]['error'](_0x7f988d,_0x80b7('0x13e'));}try{var _0x3f0a53=eval(_0x7f988d['condition'])?_0x80b7('0x13f'):_0x80b7('0x140');this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('EVAL\x20CONDITION\x20%s\x20%s',_0x7f988d[_0x80b7('0x13d')],_0x3f0a53));return{'code':0xc8,'result':_0x3f0a53};}catch(_0x35818f){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x141')]=function(_0x18b0c9){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x142'),_0x18b0c9['label']));if(!this['isConfigured'](_0x18b0c9['interval_id'])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x18b0c9,'no\x20interval\x20configured');}var _0x516917=this[_0x80b7('0x23')][_0x80b7('0x67')](this,_0x18b0c9[_0x80b7('0x143')]);if(!_0x516917){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x18b0c9,_0x80b7('0x144'));}for(var _0x4be985=0x0;_0x4be985<_0x516917['length'];_0x4be985+=0x1){var _0x17f308=this[_0x80b7('0xc')]['getVariable'](util[_0x80b7('0x4f')](_0x80b7('0x145'),_0x516917[_0x4be985]));if(_0x17f308[_0x80b7('0x9c')]===-0x1){return _0x17f308;}logger[_0x80b7('0x2a')](util['format']('IFTIME\x20%s\x20%s',_0x516917[_0x4be985],_0x17f308['extra']));if(_0x17f308[_0x80b7('0x9a')]===_0x80b7('0x13f')){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x146'),_0x516917[_0x4be985],_0x80b7('0x13f')));this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('IFTIME\x20%s\x20%s',_0x516917[_0x4be985],_0x80b7('0x13f')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x146'),_0x516917[_0x4be985],_0x80b7('0x140')));this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format'](_0x80b7('0x146'),_0x516917[_0x4be985],_0x80b7('0x140')));}}return{'code':0xc8,'result':_0x80b7('0x140')};};AGIVertices['prototype']['hangup']=function(_0x25e883){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x147'),_0x25e883[_0x80b7('0x31')]));return this['channel']['hangup']();};AGIVertices[_0x80b7('0xe')][_0x80b7('0x148')]=function(_0x300b06){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x149'),_0x300b06[_0x80b7('0x31')]));if(!this['isConfigured'](_0x300b06['key'])){return this['channel'][_0x80b7('0xa7')](_0x80b7('0xe6'));}var _0x5bb6c6=_0x80b7('0x133');var _0x119eb8=util['format'](_0x80b7('0x127'),FILES_PATH,rs['generate'](0x4));var _0x4f7c70=util['format'](_0x80b7('0x97'),_0x119eb8,_0x5bb6c6);var _0xffb3cf=!![];if(_0x300b06['beep']===_0x80b7('0x129')){_0xffb3cf=![];}var _0x5d58a6=this['channel'][_0x80b7('0x12a')](_0x119eb8,_0x5bb6c6,_0x300b06[_0x80b7('0x12b')],_0x300b06[_0x80b7('0x5d')],undefined,_0xffb3cf);if(_0x5d58a6[_0x80b7('0x9c')]!==-0x1){this[_0x80b7('0xc')]['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x4f7c70));var _0x3e6c55=this[_0x80b7('0x7e')]['sync'](this,_0x300b06,_0x4f7c70);if(_0x3e6c55){for(var _0x460bed in _0x3e6c55){if(_0x3e6c55[_0x80b7('0x8e')](_0x460bed)){this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0x14a'),_0x460bed[_0x80b7('0x60')]()),_0x3e6c55[_0x460bed]);}}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x14b'),JSON[_0x80b7('0x69')](_0x3e6c55)));}}return _0x5d58a6;};AGIVertices[_0x80b7('0xe')][_0x80b7('0x14c')]=function(_0xb69052){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x14d'),_0xb69052[_0x80b7('0x31')]));if(!this['isConfigured'](_0xb69052[_0x80b7('0x72')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')]('no\x20key\x20configured');}if(!this[_0x80b7('0x9f')](_0xb69052['text'])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('Trying\x20ispeech\x20TTS\x20%s',_0xb69052['text']));var _0x5ab30f=this[_0x80b7('0x7a')][_0x80b7('0x67')](this,_0xb69052);if(_0x5ab30f){this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x14e'),_0x5ab30f));var _0x501217=this['channel']['streamFile'](_0x5ab30f,_0xb69052[_0x80b7('0x12b')]);try{fs[_0x80b7('0xff')](_0x5ab30f+'.wav');}catch(_0x15cbbe){logger[_0x80b7('0x29')](_0x15cbbe);}return _0x501217;}return this[_0x80b7('0xc')]['error'](_0xb69052,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x80b7('0xe')]['login']=function(_0x5b94fd){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x14f'),_0x5b94fd[_0x80b7('0x31')]));if(!this['isConfigured'](_0x5b94fd['findBy'])){return this['channel']['error'](_0x5b94fd,_0x80b7('0x150'));}logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x151'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x5b94fd[_0x80b7('0x152')]));var _0x482380=this['agentLogin'][_0x80b7('0x67')](this,_0x5b94fd[_0x80b7('0x152')]);if(_0x482380){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x153'),this['channel'][_0x80b7('0x34')],_0x5b94fd['findBy']));this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x80b7('0xc')][_0x80b7('0x34')],_0x5b94fd['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x154'),this['channel']['callerid'],_0x5b94fd['findBy']));this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x154'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x5b94fd[_0x80b7('0x152')]));return{'code':0xc8,'result':_0x80b7('0x155')};}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x156')]=function(_0x390857){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x157'),_0x390857[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x390857[_0x80b7('0x152')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x390857,_0x80b7('0x150'));}logger['info'](util[_0x80b7('0x4f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x390857[_0x80b7('0x152')]));var _0x5c0258=this[_0x80b7('0x4c')]['sync'](this,_0x390857[_0x80b7('0x152')]);if(_0x5c0258){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x153'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x390857['findBy']));this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')](_0x80b7('0x153'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x390857[_0x80b7('0x152')]));return{'code':0xc8,'result':_0x80b7('0x158')};}else{logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x154'),this['channel'][_0x80b7('0x34')],_0x390857[_0x80b7('0x152')]));this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format'](_0x80b7('0x154'),this['channel'][_0x80b7('0x34')],_0x390857[_0x80b7('0x152')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x159')]=function(_0x572b5e){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x15a'),_0x572b5e[_0x80b7('0x31')]));if(!this['isConfigured'](_0x572b5e[_0x80b7('0x15b')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x572b5e,'no\x20operation\x20configured');}this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x15c'),_0x572b5e[_0x80b7('0x15b')]));var _0x42c715=eval(_0x572b5e[_0x80b7('0x15b')]);if(!this[_0x80b7('0x9f')](_0x572b5e[_0x80b7('0xd3')])){return this[_0x80b7('0xc')]['noop'](_0x80b7('0xd4'));}var _0x54fb5a=this[_0x80b7('0x9b')][_0x80b7('0x67')](this,_0x572b5e[_0x80b7('0xd3')]);if(!_0x54fb5a){return this[_0x80b7('0xc')]['error'](_0x572b5e,'no\x20variable\x20found');}if(_['isArray'](_0x42c715)){var _0x37f013=this;_0x42c715[_0x80b7('0xd6')](function(_0x17da26,_0x12e445){_0x37f013['channel'][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0x15d'),_0x54fb5a,_0x12e445),_0x17da26);});return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('variable\x20%s[key]\x20set',_0x54fb5a));}else{return this[_0x80b7('0xc')]['setVariable'](_0x54fb5a,_0x42c715);}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x9')]=function(_0x2832a3){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x15e'),_0x2832a3[_0x80b7('0x31')]));if(_0x2832a3[_0x80b7('0xa1')]===0x0){return this[_0x80b7('0xa0')](_0x2832a3);}_0x2832a3[_0x80b7('0xa1')]-=0x1;if(!this[_0x80b7('0x9f')](_0x2832a3[_0x80b7('0x10d')])){return this['channel'][_0x80b7('0x29')](_0x2832a3,_0x80b7('0x10e'));}var _0x1f01a6=this['getSound'][_0x80b7('0x67')](this,_0x2832a3[_0x80b7('0x10d')]);if(!_0x1f01a6){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x2832a3,_0x80b7('0x10f'));}var _0x44521d=this[_0x80b7('0xc')][_0x80b7('0x110')](_0x1f01a6,_0x2832a3[_0x80b7('0x15f')],_0x2832a3[_0x80b7('0x160')]);var _0x1db058=_0x44521d[_0x80b7('0x9c')];if(_0x44521d[_0x80b7('0x9c')]===-0x1){this['createSquareDetailsReport'][_0x80b7('0x67')](this,_0x2832a3,'-1');return _0x44521d;}else if(_0x44521d[_0x80b7('0x9a')]===_0x80b7('0x5d')){_0x44521d[_0x80b7('0x9c')]=_0x44521d['result']['length']>0x0?_0x44521d[_0x80b7('0x9c')]:'t';}else if(_['isEmpty'](_0x44521d[_0x80b7('0x9c')])){_0x44521d[_0x80b7('0x9c')]='#';_0x1db058='#';}if(!this[_0x80b7('0x9f')](_0x2832a3[_0x80b7('0xd3')])){this['channel'][_0x80b7('0xa7')](_0x80b7('0xd4'));}else{var _0x17d326=this[_0x80b7('0x9b')][_0x80b7('0x67')](this,_0x2832a3[_0x80b7('0xd3')]);if(!_0x17d326){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x2832a3,_0x80b7('0xd5'));}this[_0x80b7('0xc')][_0x80b7('0x9e')](_0x17d326,_0x1db058);}this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x2832a3,_0x1db058);return _0x44521d;};AGIVertices[_0x80b7('0xe')][_0x80b7('0xa7')]=function(_0x486748){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x161'),_0x486748[_0x80b7('0x31')]));return this[_0x80b7('0xc')]['noop'](_0x486748[_0x80b7('0x162')]||_0x486748['label']);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x163')]=function(_0x26f20a){logger['info'](util[_0x80b7('0x4f')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x26f20a[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x26f20a['findBy'])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x26f20a,_0x80b7('0x150'));}logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x151'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x26f20a[_0x80b7('0x152')]));var _0x123f3e=this['getPause'][_0x80b7('0x67')](this,_0x26f20a[_0x80b7('0x164')]);var _0x1bdd93=this[_0x80b7('0x49')][_0x80b7('0x67')](this,_0x26f20a[_0x80b7('0x152')],_0x123f3e);if(_0x1bdd93){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x153'),this['channel'][_0x80b7('0x34')],_0x26f20a[_0x80b7('0x152')]));this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x153'),this[_0x80b7('0xc')]['callerid'],_0x26f20a[_0x80b7('0x152')]));return{'code':0xc8,'result':_0x80b7('0x158')};}else{logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x80b7('0xc')]['callerid'],_0x26f20a[_0x80b7('0x152')]));this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x153'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x26f20a[_0x80b7('0x152')]));return{'code':0xc8,'result':_0x80b7('0x155')};}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x165')]=function(_0x3cb9ee){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x166'),_0x3cb9ee[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x3cb9ee[_0x80b7('0x10d')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x3cb9ee,_0x80b7('0x10e'));}var _0x4a2400=this['getSound'][_0x80b7('0x67')](this,_0x3cb9ee[_0x80b7('0x10d')]);if(!_0x4a2400){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x3cb9ee,_0x80b7('0x10f'));}var _0x5daf71=this[_0x80b7('0xc')]['exec'](_0x80b7('0x167'),[_0x4a2400,_0x3cb9ee['opts']]);if(_0x5daf71[_0x80b7('0x9c')]===-0x1){return _0x5daf71;}return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')](_0x80b7('0xbc'),_0x80b7('0x167'),_0x4a2400));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x168')]=function(_0x33e359){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x169'),_0x33e359[_0x80b7('0x31')]));if(!this['isConfigured'](_0x33e359[_0x80b7('0x16a')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x33e359,_0x80b7('0x16b'));}var _0x41a5b4='';var _0x54e209=parseInt(_0x33e359[_0x80b7('0x16a')],0xa);if(isNaN(_0x54e209)){_0x41a5b4=_0x33e359[_0x80b7('0x16a')];}else{_0x41a5b4=this['getVoiceQueue'][_0x80b7('0x67')](this,_0x33e359['queue_id']);if(!_0x41a5b4){return this['channel'][_0x80b7('0x29')](_0x33e359,_0x80b7('0x16c'));}}var _0x3dfcb1='';if(this[_0x80b7('0x9f')](_0x33e359['file_id'])){var _0x3c42df=this[_0x80b7('0x1b')][_0x80b7('0x67')](this,_0x33e359['file_id']);if(_0x3c42df){_0x3dfcb1=_0x3c42df;}}this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x33e359,_0x41a5b4);if(_0x33e359['opts']['indexOf']('x')<0x0){_0x33e359['opts']+='x';}if(_0x33e359[_0x80b7('0xe2')][_0x80b7('0x16d')]('X')<0x0){_0x33e359[_0x80b7('0xe2')]+='X';}this[_0x80b7('0xc')][_0x80b7('0x9e')](_0x80b7('0x16e'),_0x41a5b4?_0x41a5b4['toLowerCase']():'');var _0x3d391f=this[_0x80b7('0xc')][_0x80b7('0x52')]('QUEUE',[_0x41a5b4,_0x33e359[_0x80b7('0xe2')],_0x33e359['url'],_0x3dfcb1,_0x33e359[_0x80b7('0x5d')],_0x33e359[_0x80b7('0x6')],_0x33e359[_0x80b7('0x16f')],_0x33e359[_0x80b7('0x170')],'',_0x33e359['position']]);if(_0x3d391f[_0x80b7('0x9c')]===-0x1){return _0x3d391f;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xbc'),_0x80b7('0x171'),_0x41a5b4));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x172')]=function(_0x266b10){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x173'),_0x266b10[_0x80b7('0x31')]));var _0x32c46c=_0x266b10[_0x80b7('0x174')]||'wav';var _0x160065=util[_0x80b7('0x4f')](_0x80b7('0x175'),this['channel'][_0x80b7('0x30')],rs[_0x80b7('0x114')](0x5));var _0x43a18c=util[_0x80b7('0x4f')](_0x80b7('0x176'),FILES_PATH,_0x160065,_0x32c46c);var _0x525d90=util[_0x80b7('0x4f')]('%s/recordings/%s',FILES_PATH,_0x160065);this[_0x80b7('0x177')][_0x80b7('0x67')](this,_0x266b10,_0x160065,_0x43a18c);this[_0x80b7('0xc')][_0x80b7('0x9e')](_0x80b7('0x178'),_0x160065);logger[_0x80b7('0x2a')](_0x80b7('0x179'),_0x525d90,_0x32c46c,_0x266b10[_0x80b7('0x17a')],_0x266b10['timeout']);return this[_0x80b7('0xc')][_0x80b7('0x12a')](_0x525d90,_0x32c46c,_0x266b10[_0x80b7('0x17a')],_0x266b10[_0x80b7('0x5d')],undefined,!![]);};AGIVertices['prototype'][_0x80b7('0x17b')]=function(_0x14803d){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x17c'),_0x14803d[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x14803d['url'])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x17d'));}var _0x1f19d3=this['restAPI'][_0x80b7('0x67')](this,_0x14803d);logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x17e'),util[_0x80b7('0x17f')](_0x1f19d3,{'showHidden':![],'depth':null})));if(!this[_0x80b7('0x9f')](_0x14803d['variable_id'])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x180'));}var _0x298550=this[_0x80b7('0x9b')][_0x80b7('0x67')](this,_0x14803d['variable_id']);if(!_0x298550){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x14803d,_0x80b7('0xd5'));}this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')]('%s_STATUS_CODE',_0x298550),_0x1f19d3['statusCode']?_0x1f19d3[_0x80b7('0x6c')]:_0x80b7('0x181'));this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')]('%s_STATUS_MESSAGE',_0x298550),_0x1f19d3[_0x80b7('0x6d')]?_0x1f19d3[_0x80b7('0x6d')]:'OK');if(_0x1f19d3[_0x80b7('0x6a')]){try{this[_0x80b7('0x96')](_0x1f19d3[_0x80b7('0x6a')],_0x298550);}catch(_0x3c0edd){logger['error'](util[_0x80b7('0x4f')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x298550));}}return this['channel'][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('variable\x20%s\x20set',_0x298550));};AGIVertices['prototype'][_0x80b7('0x182')]=function(_0x264b57){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x183'),_0x264b57[_0x80b7('0x31')]));return this['channel'][_0x80b7('0x184')](_0x264b57[_0x80b7('0x185')][_0x80b7('0xd1')](/\s+/g,''),_0x264b57[_0x80b7('0x17a')]);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x186')]=function(_0x4af667){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x187'),_0x4af667[_0x80b7('0x31')]));return this['channel'][_0x80b7('0x188')](_0x4af667[_0x80b7('0x5e')][_0x80b7('0xd1')](/\s+/g,''),_0x4af667[_0x80b7('0x17a')]);};AGIVertices[_0x80b7('0xe')]['sayphonetic']=function(_0x5bee1b){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x189'),_0x5bee1b[_0x80b7('0x31')]));return this[_0x80b7('0xc')][_0x80b7('0x18a')](_0x5bee1b[_0x80b7('0x56')],_0x5bee1b['escape_digits']);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x18b')]=function(_0x50cd27){logger['info'](util['format'](_0x80b7('0x18c'),_0x50cd27[_0x80b7('0x31')]));if(!this['isConfigured'](_0x50cd27[_0x80b7('0x18d')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x18e'));}var _0x18ea16=this[_0x80b7('0x1f')][_0x80b7('0x67')](this,_0x50cd27[_0x80b7('0x18d')]);if(!_0x18ea16||!_0x18ea16['Smtp']){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x50cd27,_0x80b7('0x18f'));}var _0x4068cb={'from':util[_0x80b7('0x4f')]('\x22%s\x22\x20<%s>',_0x18ea16['name'],_0x18ea16['email']||_0x18ea16[_0x80b7('0x190')][_0x80b7('0x191')]),'to':_0x50cd27['to']||'','cc':_0x50cd27['cc']||'','bcc':_0x50cd27[_0x80b7('0x192')]||'','subject':_0x50cd27[_0x80b7('0x193')],'html':_0x50cd27[_0x80b7('0x56')],'text':_0x50cd27['text']};if(this[_0x80b7('0x9f')](_0x50cd27[_0x80b7('0x194')])){}logger[_0x80b7('0x195')]('sendMail\x20message',JSON[_0x80b7('0x69')](_0x4068cb));this['createSquareDetailsReport'][_0x80b7('0x67')](this,_0x50cd27,_0x50cd27[_0x80b7('0x18d')]);this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x18ea16['name']));this[_0x80b7('0x21')][_0x80b7('0x67')](this,_0x18ea16[_0x80b7('0x196')],_0x4068cb);return this[_0x80b7('0xc')][_0x80b7('0xa7')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x80b7('0xe')][_0x80b7('0x197')]=function(_0x15a0ff){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x15a0ff[_0x80b7('0x31')]));return this[_0x80b7('0xc')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x80b7('0x198')]=function(_0x42f87a){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x42f87a[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x42f87a[_0x80b7('0x199')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x19a'));}var _0xd857bd=this[_0x80b7('0x19b')]['sync'](this,_0x42f87a[_0x80b7('0x199')]);if(!_0xd857bd){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x42f87a,'no\x20sms\x20account\x20found');}var _0x5405c4={'body':_0x42f87a[_0x80b7('0x19c')],'phone':_0x42f87a['to']||'','SmsAccountId':_0xd857bd['id']};logger[_0x80b7('0x195')](_0x80b7('0x19d'),JSON[_0x80b7('0x69')](_0x5405c4));this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x42f87a,_0x42f87a[_0x80b7('0x199')]);this['channel']['noop'](util['format'](_0x80b7('0x19e'),_0xd857bd[_0x80b7('0x11')]));this[_0x80b7('0x2e')][_0x80b7('0x67')](this,_0x5405c4);return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x19f'));};AGIVertices['prototype'][_0x80b7('0x1a0')]=function(_0x321abc){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x1a1'),_0x321abc[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x321abc[_0x80b7('0xd3')])){return this['channel'][_0x80b7('0x29')](_0x321abc,_0x80b7('0x1a2'));}var _0x16a24e=this[_0x80b7('0x9b')][_0x80b7('0x67')](this,_0x321abc[_0x80b7('0xd3')]);if(!_0x16a24e){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x321abc,_0x80b7('0xd5'));}return this[_0x80b7('0xc')]['setVariable'](_0x16a24e,_0x321abc[_0x80b7('0x1a3')]);};AGIVertices['prototype'][_0x80b7('0x1a4')]=function(_0x1fc9ab){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x1a5'),_0x1fc9ab[_0x80b7('0x31')]));this[_0x80b7('0xc')]['noop']('START\x20CALLY\x20SQUARE');var _0x1f3ba1=this[_0x80b7('0xc')]['getVariable'](_0x80b7('0x1a6'));if(!_['isEmpty'](_0x1f3ba1[_0x80b7('0x9a')])){this['channel'][_0x80b7('0x30')]=_0x1f3ba1[_0x80b7('0x9a')];}if(_0x1fc9ab[_0x80b7('0x1a7')]===_0x80b7('0x1a8')){this[_0x80b7('0xc')]['noop'](_0x80b7('0x1a9'));return this[_0x80b7('0xc')]['answer']();}return this[_0x80b7('0xc')]['noop'](_0x80b7('0x1aa'));};AGIVertices[_0x80b7('0xe')]['subproject']=function(_0xd81157){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x1ab'),_0xd81157[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0xd81157[_0x80b7('0x1ac')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0xd81157,'no\x20subproject\x20selected');}var _0x118f43=this[_0x80b7('0x14')][_0x80b7('0x67')](this,_0xd81157[_0x80b7('0x1ac')]);if(!this[_0x80b7('0x9f')](_0x118f43)){return this[_0x80b7('0xc')]['error'](_0xd81157,util[_0x80b7('0x4f')](_0x80b7('0x1ad'),_0xd81157[_0x80b7('0x1ac')]));}if(_0x118f43===this[_0x80b7('0xc')]['arg_1']){return this['channel'][_0x80b7('0x29')](_0xd81157,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x80b7('0x2f')]['sync'](this,_0xd81157,_0x118f43);var _0x1ed9ab=this['channel'][_0x80b7('0x52')](_0x80b7('0x1ae'),util[_0x80b7('0x4f')](_0x80b7('0x1af'),config[_0x80b7('0x6')]['host']||_0x80b7('0x1b0'),_0x118f43,this[_0x80b7('0xc')]['arg_1']));if(_0x1ed9ab[_0x80b7('0x9c')]===-0x1){return _0x1ed9ab;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format']('Executed\x20command\x20%s\x20%s',_0x80b7('0x1ae'),_0x118f43));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1b1')]=function(_0x14e2fb){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x1b2'),_0x14e2fb['label']));var _0x2438e1=this[_0x80b7('0x51')][_0x80b7('0x67')](this,_0x14e2fb['command']);this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x14e2fb,_0x14e2fb[_0x80b7('0x1b3')]);if(this[_0x80b7('0x9f')](_0x14e2fb[_0x80b7('0xd3')])){var _0x3b4e77=this['getVariable'][_0x80b7('0x67')](this,_0x14e2fb[_0x80b7('0xd3')]);if(_0x3b4e77){this[_0x80b7('0xc')]['setVariable'](_0x3b4e77,_0x2438e1);return this['channel'][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x1b4'),_0x14e2fb['command'],_0x3b4e77));}}return this['channel']['noop'](util[_0x80b7('0x4f')](_0x80b7('0x1b5'),_0x14e2fb['command']));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1b6')]=function(_0x5e8289){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x1b7'),_0x5e8289[_0x80b7('0x31')]));_0x5e8289[_0x80b7('0x56')]=_0x5e8289['text'][_0x80b7('0xd1')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5e8289['apiKey'])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x1b8'));}if(!this['isConfigured'](_0x5e8289[_0x80b7('0x56')])){return this[_0x80b7('0xc')]['noop'](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x1b9'),_0x5e8289[_0x80b7('0x56')]));var _0x2a3f83=this[_0x80b7('0x54')][_0x80b7('0x67')](this,_0x5e8289);if(_0x2a3f83){this[_0x80b7('0xc')]['noop'](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2a3f83));var _0x47d67a=this[_0x80b7('0xc')][_0x80b7('0xfe')](_0x2a3f83);try{fs[_0x80b7('0xff')](_0x2a3f83+_0x80b7('0x11e'));}catch(_0x1fc9d0){logger[_0x80b7('0x29')](_0x1fc9d0);}return _0x47d67a;}return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x5e8289,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1ba')]=function(_0x553aa4){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x1bb'),_0x553aa4[_0x80b7('0x31')]));_0x553aa4[_0x80b7('0x56')]=_0x553aa4[_0x80b7('0x56')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x80b7('0x9f')](_0x553aa4[_0x80b7('0x56')])){return this['channel']['noop'](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format'](_0x80b7('0x1bc'),_0x553aa4[_0x80b7('0x56')]));var _0x94197f=this[_0x80b7('0x59')]['sync'](this,_0x553aa4);if(_0x94197f){this[_0x80b7('0xc')]['noop'](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x94197f));var _0x138d59=this[_0x80b7('0xc')][_0x80b7('0xfe')](_0x94197f);try{fs[_0x80b7('0xff')](_0x94197f+_0x80b7('0x11e'));}catch(_0x1b0954){logger['error'](_0x1b0954);}return _0x138d59;}return this[_0x80b7('0xc')]['error'](_0x553aa4,_0x80b7('0x1bd'));};AGIVertices[_0x80b7('0xe')]['unpause']=function(_0x248c15){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x1be'),_0x248c15['label']));if(!this[_0x80b7('0x9f')](_0x248c15['findBy'])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x248c15,_0x80b7('0x150'));}logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x151'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x248c15[_0x80b7('0x152')]));var _0x1ebf9e=this[_0x80b7('0x4b')][_0x80b7('0x67')](this,_0x248c15[_0x80b7('0x152')]);if(_0x1ebf9e){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x80b7('0xc')]['callerid'],_0x248c15[_0x80b7('0x152')]));this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x80b7('0xc')]['callerid'],_0x248c15[_0x80b7('0x152')]));return{'code':0xc8,'result':_0x80b7('0x158')};}else{logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x154'),this[_0x80b7('0xc')]['callerid'],_0x248c15[_0x80b7('0x152')]));this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x154'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x248c15[_0x80b7('0x152')]));return{'code':0xc8,'result':_0x80b7('0x155')};}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1bf')]=function(_0x3955f9){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x1c0'),_0x3955f9[_0x80b7('0x31')]));var _0x2d5d65=this[_0x80b7('0xc')][_0x80b7('0x52')](_0x80b7('0x1c1'),[_0x3955f9[_0x80b7('0x1c2')],_0x3955f9[_0x80b7('0x70')]]);if(_0x2d5d65[_0x80b7('0x9c')]===-0x1){return _0x2d5d65;}return this['channel']['noop'](util[_0x80b7('0x4f')](_0x80b7('0xbc'),_0x80b7('0x1c1'),_0x3955f9[_0x80b7('0x1c2')]));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1c3')]=function(_0x6d2070){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x1c4'),_0x6d2070[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x6d2070[_0x80b7('0xd3')])){return this['channel'][_0x80b7('0x29')](_0x6d2070,_0x80b7('0x1a2'));}var _0x4579c4=this[_0x80b7('0x9b')][_0x80b7('0x67')](this,_0x6d2070[_0x80b7('0xd3')]);if(!_0x4579c4){return this[_0x80b7('0xc')]['error'](_0x6d2070,_0x80b7('0xd5'));}var _0x16a607=this[_0x80b7('0xc')][_0x80b7('0x9b')](_0x4579c4);return{'code':0xc8,'result':_0x16a607[_0x80b7('0x9a')]?_0x16a607[_0x80b7('0x9a')]:'-'};};String[_0x80b7('0xe')][_0x80b7('0x99')]=function(_0x557eb6,_0x12dfb4){return this[_0x80b7('0x98')](_0x557eb6)[_0x80b7('0x1c5')](_0x12dfb4);};module[_0x80b7('0x1c6')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index aefd635..3a86600 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 _0x36c3=['transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','prototype','updateAcw','lastPauseAt','timer','uniqueid','then','info','catch','finally','queue','ACW','mandatoryDispositionPause','name','resolve','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','attended','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','error','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','syncAgentConnect','interface','destlinkedid','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil'];(function(_0x148fa4,_0x103c8b){var _0x5155f7=function(_0x12bcdc){while(--_0x12bcdc){_0x148fa4['push'](_0x148fa4['shift']());}};_0x5155f7(++_0x103c8b);}(_0x36c3,0x1a6));var _0x336c=function(_0x4a6362,_0x9e782a){_0x4a6362=_0x4a6362-0x0;var _0x2653a5=_0x36c3[_0x4a6362];return _0x2653a5;};'use strict';var _=require(_0x336c('0x0'));var moment=require(_0x336c('0x1'));var ami=require('../ami');var logger=require(_0x336c('0x2'))(_0x336c('0x3'));var RpcUser=require(_0x336c('0x4'));var RpcVoiceAgentReport=require(_0x336c('0x5'));function Acw(_0x32aed2){this[_0x336c('0x6')]=_0x32aed2[_0x336c('0x6')];this['agents']=_0x32aed2[_0x336c('0x7')];this[_0x336c('0x8')]=_0x32aed2[_0x336c('0x8')];this[_0x336c('0x9')]={};ami['on'](_0x336c('0xa'),this['syncAgentConnect'][_0x336c('0xb')](this));ami['on'](_0x336c('0xc'),this[_0x336c('0xd')][_0x336c('0xb')](this));ami['on'](_0x336c('0xe'),this[_0x336c('0xf')][_0x336c('0xb')](this));ami['on'](_0x336c('0x10'),this[_0x336c('0x11')][_0x336c('0xb')](this));ami['on'](_0x336c('0x12'),this[_0x336c('0x13')][_0x336c('0xb')](this));ami['on'](_0x336c('0x14'),this[_0x336c('0x15')][_0x336c('0xb')](this));ami['on'](_0x336c('0x16'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x1c3961){var _0x577bd6=moment()[_0x336c('0x17')](0x0);var _0xc6a857=moment(_0x1c3961)[_0x336c('0x17')](0x0);return _0x577bd6[_0x336c('0x18')](_0xc6a857,'seconds');}Acw[_0x336c('0x19')][_0x336c('0x1a')]=function(_0x4ce90a,_0x23b375){var _0x5f5ae1=this;var _0x2c7474=getDiff(_0x5f5ae1['timers'][_0x4ce90a][_0x336c('0x1b')]);clearTimeout(_0x5f5ae1['timers'][_0x4ce90a][_0x336c('0x1c')]);_0x5f5ae1[_0x336c('0x8')][_0x4ce90a]['timer']=![];return RpcVoiceAgentReport['update']({'acwtime':_0x2c7474},_0x5f5ae1[_0x336c('0x8')][_0x4ce90a][_0x336c('0x1d')],_0x4ce90a)[_0x336c('0x1e')](function(_0x221408){logger[_0x336c('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x23b375,_0x2c7474,_0x221408);})[_0x336c('0x20')](function(_0x532e12){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x23b375,_0x532e12);})[_0x336c('0x21')](function(){delete _0x5f5ae1[_0x336c('0x8')][_0x4ce90a];});};Acw[_0x336c('0x19')]['startAcw']=function(_0x5adb5f){try{var _0x5b6cc3=this;var _0x3ba228=this[_0x336c('0x9')][_0x5adb5f]['interface'];var _0x260ef3=this[_0x336c('0x9')][_0x5adb5f][_0x336c('0x22')];var _0x56a6fb=this[_0x336c('0x6')][_0x260ef3];var _0x314f5f=![];var _0x24f8ca=_0x336c('0x23');if(_0x56a6fb['mandatoryDisposition']&&_0x56a6fb[_0x336c('0x24')][_0x336c('0x25')]){_0x314f5f=!![];_0x24f8ca=_0x56a6fb[_0x336c('0x24')][_0x336c('0x25')];}if(!_0x5b6cc3[_0x336c('0x7')][_0x3ba228]){return Promise[_0x336c('0x26')]();}return RpcUser['getAgent'](_0x5b6cc3[_0x336c('0x7')][_0x3ba228]['id'])[_0x336c('0x1e')](function(_0x2a1fb3){if(!_0x2a1fb3||_0x2a1fb3[_0x336c('0x27')]){logger['info'](_0x336c('0x28'),_0x5adb5f,_0x3ba228,_0x260ef3);return;}logger[_0x336c('0x1f')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x5adb5f,_0x3ba228,_0x260ef3);var _0x5476ff=_0x5b6cc3['channels'][_0x5adb5f][_0x336c('0x29')]&&_0x5b6cc3[_0x336c('0x9')][_0x5adb5f]['destlinkedid']?_0x5b6cc3['channels'][_0x5adb5f]['destlinkedid']:_0x5adb5f;return RpcUser[_0x336c('0x2a')](_0x5b6cc3[_0x336c('0x7')][_0x3ba228],_0x24f8ca,_0x5476ff);})[_0x336c('0x1e')](function(_0x424712){if(_0x314f5f||!_0x424712){return;}_0x5b6cc3[_0x336c('0x8')][_0x3ba228]={};logger[_0x336c('0x1f')](_0x336c('0x2b'),_0x5adb5f,_0x5b6cc3['voiceQueues'][_0x260ef3][_0x336c('0x2c')],_0x3ba228,_0x260ef3);_0x5b6cc3[_0x336c('0x8')][_0x3ba228][_0x336c('0x1c')]=setTimeout(_0x5b6cc3[_0x336c('0x2d')]['bind'](_0x5b6cc3,_0x3ba228),_0x5b6cc3[_0x336c('0x6')][_0x260ef3][_0x336c('0x2c')]*0x3e8);_0x5b6cc3['timers'][_0x3ba228][_0x336c('0x1b')]=moment()[_0x336c('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b6cc3[_0x336c('0x8')][_0x3ba228][_0x336c('0x1d')]=_0x5adb5f;_0x5b6cc3[_0x336c('0x8')][_0x3ba228][_0x336c('0x22')]=_0x260ef3;_0x5b6cc3[_0x336c('0x8')][_0x3ba228][_0x336c('0x1a')]=_0x5b6cc3[_0x336c('0x1a')][_0x336c('0xb')](_0x5b6cc3,_0x3ba228,_0x5adb5f);})['catch'](function(){logger[_0x336c('0x2f')](_0x336c('0x2b'),_0x5adb5f,_0x5b6cc3[_0x336c('0x6')][_0x260ef3][_0x336c('0x2c')],_0x3ba228,_0x260ef3);})[_0x336c('0x21')](function(){delete _0x5b6cc3[_0x336c('0x9')][_0x5adb5f];});}catch(_0x6d823a){logger[_0x336c('0x2f')](_0x336c('0x30'),_0x6d823a[_0x336c('0x31')]);}};Acw['prototype'][_0x336c('0x2d')]=function(_0x3d3583){try{var _0x4690c3=this;if(_0x4690c3[_0x336c('0x8')][_0x3d3583]){_0x4690c3[_0x336c('0x8')][_0x3d3583][_0x336c('0x1c')]=![];var _0x853b2d=_0x4690c3[_0x336c('0x8')][_0x3d3583][_0x336c('0x1d')];var _0xf9c76a=_0x4690c3['timers'][_0x3d3583][_0x336c('0x22')];var _0x20e7a5=_0x4690c3[_0x336c('0x6')][_0xf9c76a]['acwTimeout'];logger[_0x336c('0x1f')](_0x336c('0x32'),_0x853b2d,_0x3d3583);RpcUser[_0x336c('0x33')](this[_0x336c('0x7')][_0x3d3583]);RpcVoiceAgentReport['update']({'acwtime':_0x20e7a5,'agentacw':!![]},_0x853b2d,_0x3d3583)[_0x336c('0x1e')](function(_0x1055bd){logger['info'](_0x336c('0x34'),_0x853b2d,_0x20e7a5,_0x1055bd);})[_0x336c('0x20')](function(_0x1d30ac){logger['error'](_0x336c('0x35'),_0x853b2d,_0x1d30ac);});}else{logger[_0x336c('0x2f')](_0x336c('0x36'),_0x3d3583);if(_0x4690c3[_0x336c('0x8')]){logger[_0x336c('0x1f')](_0x336c('0x37'),JSON[_0x336c('0x38')](_0x4690c3[_0x336c('0x8')]));}}}catch(_0x1ab068){logger[_0x336c('0x2f')]('[ACW][STOP]\x20%s',_0x1ab068[_0x336c('0x31')]);}};Acw[_0x336c('0x19')][_0x336c('0x39')]=function(_0x5b2f25){try{if(this[_0x336c('0x6')][_0x5b2f25[_0x336c('0x22')]]&&(this['voiceQueues'][_0x5b2f25[_0x336c('0x22')]][_0x336c('0x3')]||this[_0x336c('0x6')][_0x5b2f25[_0x336c('0x22')]]['mandatoryDisposition'])){if(this[_0x336c('0x7')][_0x5b2f25[_0x336c('0x3a')]]){this['channels'][_0x5b2f25[_0x336c('0x1d')]]={'queue':_0x5b2f25[_0x336c('0x22')],'interface':_0x5b2f25['interface'],'destlinkedid':_0x5b2f25[_0x336c('0x3b')]};}}}catch(_0xcf3f00){logger[_0x336c('0x2f')](_0x336c('0x3c'),_0xcf3f00['message']);}};Acw[_0x336c('0x19')][_0x336c('0x3d')]=function(_0x8df853){try{if(this[_0x336c('0x6')][_0x8df853[_0x336c('0x22')]]&&(this[_0x336c('0x6')][_0x8df853[_0x336c('0x22')]][_0x336c('0x3')]||this[_0x336c('0x6')][_0x8df853['queue']][_0x336c('0x3e')])){if(this[_0x336c('0x7')][_0x8df853[_0x336c('0x3a')]]){this[_0x336c('0x9')][_0x8df853[_0x336c('0x1d')]]={'queue':_0x8df853[_0x336c('0x22')],'interface':_0x8df853[_0x336c('0x3a')]};}}}catch(_0xbfac47){logger[_0x336c('0x2f')](_0x336c('0x3f'),_0xbfac47[_0x336c('0x31')]);}};Acw[_0x336c('0x19')][_0x336c('0xd')]=function(_0x58d26c){try{if(this[_0x336c('0x9')][_0x58d26c['uniqueid']]&&_['isUndefined'](this[_0x336c('0x9')][_0x58d26c['uniqueid']]['attended'])){logger[_0x336c('0x1f')]('[%s][HANGUP:UNIQUEID]',_0x58d26c[_0x336c('0x1d')]);this[_0x336c('0x40')](_0x58d26c[_0x336c('0x1d')]);}else if(this[_0x336c('0x9')][_0x58d26c['linkedid']]&&_['isUndefined'](this[_0x336c('0x9')][_0x58d26c[_0x336c('0x41')]]['attended'])){logger[_0x336c('0x1f')](_0x336c('0x42'),_0x58d26c['linkedid']);this[_0x336c('0x40')](_0x58d26c[_0x336c('0x41')]);}}catch(_0x2eb56f){logger[_0x336c('0x2f')]('[ACW][syncHangupRequest]\x20%s',_0x2eb56f[_0x336c('0x31')]);}};Acw[_0x336c('0x19')]['syncHangup']=function(_0x57857d){try{if(this['channels'][_0x57857d['uniqueid']]&&this['channels'][_0x57857d[_0x336c('0x1d')]][_0x336c('0x29')]){logger[_0x336c('0x1f')](_0x336c('0x43'),_0x57857d['uniqueid']);this[_0x336c('0x40')](_0x57857d[_0x336c('0x1d')]);}else if(this[_0x336c('0x9')][_0x57857d[_0x336c('0x41')]]&&this['channels'][_0x57857d[_0x336c('0x41')]]['attended']){logger[_0x336c('0x1f')](_0x336c('0x44'),_0x57857d[_0x336c('0x41')]);this[_0x336c('0x40')](_0x57857d[_0x336c('0x41')]);}}catch(_0x171b00){logger['error']('[ACW][syncHangup]\x20%s',_0x171b00[_0x336c('0x31')]);}};Acw[_0x336c('0x19')]['syncAttendedTransfer']=function(_0x22a0bd){try{if(!_[_0x336c('0x45')](this[_0x336c('0x9')][_0x22a0bd['transfereeuniqueid']])){this['startAcw'](_0x22a0bd[_0x336c('0x46')]);if(this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x47')]]){this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x47')]][_0x336c('0x29')]=!![];this['channels'][_0x22a0bd[_0x336c('0x48')]]=this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x47')]];delete this['channels'][_0x22a0bd['secondtransfereruniqueid']];}}else if(!_[_0x336c('0x45')](this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x48')]])){this[_0x336c('0x40')](_0x22a0bd[_0x336c('0x48')]);if(this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x49')]]){this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x49')]][_0x336c('0x29')]=!![];this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x46')]]=this[_0x336c('0x9')][_0x22a0bd['origtransfereruniqueid']];delete this['channels'][_0x22a0bd['origtransfereruniqueid']];}}}catch(_0x4ddd8d){logger[_0x336c('0x2f')](_0x336c('0x4a'),_0x4ddd8d['message']);}};Acw[_0x336c('0x19')][_0x336c('0x15')]=function(_0x3c31f6){try{if(this[_0x336c('0x9')][_0x3c31f6[_0x336c('0x4b')]]){logger[_0x336c('0x1f')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x336c('0x38')](_0x3c31f6['transfereruniqueid']));this[_0x336c('0x40')](_0x3c31f6[_0x336c('0x4b')]);}else if(this[_0x336c('0x9')][_0x3c31f6['transfererlinkedid']]){logger[_0x336c('0x1f')](_0x336c('0x4c'),JSON['stringify'](_0x3c31f6[_0x336c('0x4d')]));this['startAcw'](_0x3c31f6[_0x336c('0x4d')]);}}catch(_0x186177){logger[_0x336c('0x2f')](_0x336c('0x4e'),_0x186177[_0x336c('0x31')]);}};Acw[_0x336c('0x19')]['syncAgentRingNoAnswer']=function(_0x33130d){try{if(this['voiceQueues'][_0x33130d['queue']]&&this['voiceQueues'][_0x33130d['queue']]['autopause']==='all'){if(this[_0x336c('0x7')][_0x33130d[_0x336c('0x3a')]]){logger[_0x336c('0x1f')](_0x336c('0x4f'),_0x33130d[_0x336c('0x1d')],_0x33130d[_0x336c('0x3a')],_0x33130d[_0x336c('0x22')]);return RpcUser['savePause'](this[_0x336c('0x7')][_0x33130d[_0x336c('0x3a')]],_0x336c('0x50'),_0x33130d[_0x336c('0x1d')]);}}}catch(_0x4ba9de){logger[_0x336c('0x2f')](_0x336c('0x51'),_0x4ba9de[_0x336c('0x31')]);}};module['exports']=Acw; \ No newline at end of file +var _0xfb65=['voicePause','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','queue','[ACW][START]\x20%s','message','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','prototype','updateAcw','lastPauseAt','timers','timer','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','then'];(function(_0x1d6f4f,_0x230710){var _0x4aa71a=function(_0x509115){while(--_0x509115){_0x1d6f4f['push'](_0x1d6f4f['shift']());}};_0x4aa71a(++_0x230710);}(_0xfb65,0x82));var _0x5fb6=function(_0x19ec18,_0x4f61ca){_0x19ec18=_0x19ec18-0x0;var _0x216d53=_0xfb65[_0x19ec18];return _0x216d53;};'use strict';var _=require('lodash');var moment=require(_0x5fb6('0x0'));var ami=require(_0x5fb6('0x1'));var logger=require('../../../config/logger')(_0x5fb6('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x5fb6('0x3'));function Acw(_0x15d15c){this[_0x5fb6('0x4')]=_0x15d15c[_0x5fb6('0x4')];this[_0x5fb6('0x5')]=_0x15d15c[_0x5fb6('0x5')];this['timers']=_0x15d15c['timers'];this[_0x5fb6('0x6')]={};ami['on'](_0x5fb6('0x7'),this[_0x5fb6('0x8')][_0x5fb6('0x9')](this));ami['on']('hanguprequest',this[_0x5fb6('0xa')][_0x5fb6('0x9')](this));ami['on'](_0x5fb6('0xb'),this[_0x5fb6('0xc')]['bind'](this));ami['on'](_0x5fb6('0xd'),this[_0x5fb6('0xe')]['bind'](this));ami['on'](_0x5fb6('0xf'),this[_0x5fb6('0x10')][_0x5fb6('0x9')](this));ami['on'](_0x5fb6('0x11'),this[_0x5fb6('0x12')]['bind'](this));ami['on'](_0x5fb6('0x13'),this[_0x5fb6('0x14')][_0x5fb6('0x9')](this));}function getDiff(_0x41d503){var _0x6b58a2=moment()[_0x5fb6('0x15')](0x0);var _0x1a391f=moment(_0x41d503)[_0x5fb6('0x15')](0x0);return _0x6b58a2['diff'](_0x1a391f,'seconds');}Acw[_0x5fb6('0x16')][_0x5fb6('0x17')]=function(_0x58febe,_0x1d57b1){var _0x21ddd3=this;var _0x11bb78=getDiff(_0x21ddd3['timers'][_0x58febe][_0x5fb6('0x18')]);clearTimeout(_0x21ddd3[_0x5fb6('0x19')][_0x58febe][_0x5fb6('0x1a')]);_0x21ddd3[_0x5fb6('0x19')][_0x58febe][_0x5fb6('0x1a')]=![];return RpcVoiceAgentReport[_0x5fb6('0x1b')]({'acwtime':_0x11bb78},_0x21ddd3['timers'][_0x58febe][_0x5fb6('0x1c')],_0x58febe)['then'](function(_0x32f58a){logger['info'](_0x5fb6('0x1d'),_0x1d57b1,_0x11bb78,_0x32f58a);})[_0x5fb6('0x1e')](function(_0x402e8a){logger[_0x5fb6('0x1f')](_0x5fb6('0x20'),_0x1d57b1,_0x402e8a);})[_0x5fb6('0x21')](function(){delete _0x21ddd3[_0x5fb6('0x19')][_0x58febe];});};Acw['prototype']['startAcw']=function(_0xfd8d78){try{var _0x39ace4=this;var _0x48a70e=this[_0x5fb6('0x6')][_0xfd8d78][_0x5fb6('0x22')];var _0x331bba=this[_0x5fb6('0x6')][_0xfd8d78]['queue'];var _0x2fca34=this[_0x5fb6('0x4')][_0x331bba];var _0x45b484=![];var _0x20de69=_0x5fb6('0x23');if(_0x2fca34[_0x5fb6('0x24')]&&_0x2fca34['mandatoryDispositionPause']['name']){_0x45b484=!![];_0x20de69=_0x2fca34[_0x5fb6('0x25')][_0x5fb6('0x26')];}if(!_0x39ace4[_0x5fb6('0x5')][_0x48a70e]){return Promise[_0x5fb6('0x27')]();}return RpcUser[_0x5fb6('0x28')](_0x39ace4[_0x5fb6('0x5')][_0x48a70e]['id'])[_0x5fb6('0x29')](function(_0x4d6e01){if(!_0x4d6e01||_0x4d6e01[_0x5fb6('0x2a')]){logger[_0x5fb6('0x2b')](_0x5fb6('0x2c'),_0xfd8d78,_0x48a70e,_0x331bba);return;}logger['info'](_0x5fb6('0x2d'),_0xfd8d78,_0x48a70e,_0x331bba);var _0x1b4ae4=_0x39ace4['channels'][_0xfd8d78][_0x5fb6('0x2e')]&&_0x39ace4[_0x5fb6('0x6')][_0xfd8d78]['destlinkedid']?_0x39ace4[_0x5fb6('0x6')][_0xfd8d78]['destlinkedid']:_0xfd8d78;return RpcUser[_0x5fb6('0x2f')](_0x39ace4['agents'][_0x48a70e],_0x20de69,_0x1b4ae4);})['then'](function(_0x159971){if(_0x45b484||!_0x159971){return;}_0x39ace4[_0x5fb6('0x19')][_0x48a70e]={};logger[_0x5fb6('0x2b')](_0x5fb6('0x30'),_0xfd8d78,_0x39ace4[_0x5fb6('0x4')][_0x331bba][_0x5fb6('0x31')],_0x48a70e,_0x331bba);_0x39ace4['timers'][_0x48a70e][_0x5fb6('0x1a')]=setTimeout(_0x39ace4[_0x5fb6('0x32')][_0x5fb6('0x9')](_0x39ace4,_0x48a70e),_0x39ace4[_0x5fb6('0x4')][_0x331bba][_0x5fb6('0x31')]*0x3e8);_0x39ace4[_0x5fb6('0x19')][_0x48a70e][_0x5fb6('0x18')]=moment()[_0x5fb6('0x33')](_0x5fb6('0x34'));_0x39ace4[_0x5fb6('0x19')][_0x48a70e][_0x5fb6('0x1c')]=_0xfd8d78;_0x39ace4['timers'][_0x48a70e][_0x5fb6('0x35')]=_0x331bba;_0x39ace4[_0x5fb6('0x19')][_0x48a70e]['updateAcw']=_0x39ace4[_0x5fb6('0x17')]['bind'](_0x39ace4,_0x48a70e,_0xfd8d78);})['catch'](function(){logger[_0x5fb6('0x1f')](_0x5fb6('0x30'),_0xfd8d78,_0x39ace4[_0x5fb6('0x4')][_0x331bba]['acwTimeout'],_0x48a70e,_0x331bba);})[_0x5fb6('0x21')](function(){delete _0x39ace4['channels'][_0xfd8d78];});}catch(_0x5c256c){logger[_0x5fb6('0x1f')](_0x5fb6('0x36'),_0x5c256c[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')][_0x5fb6('0x32')]=function(_0x1b96c0){try{var _0x3a6f88=this;if(_0x3a6f88[_0x5fb6('0x19')][_0x1b96c0]){_0x3a6f88[_0x5fb6('0x19')][_0x1b96c0][_0x5fb6('0x1a')]=![];var _0x8446db=_0x3a6f88[_0x5fb6('0x19')][_0x1b96c0]['uniqueid'];var _0x245ea0=_0x3a6f88[_0x5fb6('0x19')][_0x1b96c0][_0x5fb6('0x35')];var _0x5f1e64=_0x3a6f88[_0x5fb6('0x4')][_0x245ea0]['acwTimeout'];logger[_0x5fb6('0x2b')]('[%s][TIMER][STOP][AGENT:%s]',_0x8446db,_0x1b96c0);RpcUser[_0x5fb6('0x38')](this[_0x5fb6('0x5')][_0x1b96c0]);RpcVoiceAgentReport[_0x5fb6('0x1b')]({'acwtime':_0x5f1e64,'agentacw':!![]},_0x8446db,_0x1b96c0)[_0x5fb6('0x29')](function(_0x25c38d){logger['info'](_0x5fb6('0x1d'),_0x8446db,_0x5f1e64,_0x25c38d);})[_0x5fb6('0x1e')](function(_0x3ab41f){logger[_0x5fb6('0x1f')]('[%s][UPDATE][ERRORS:%s]',_0x8446db,_0x3ab41f);});}else{logger[_0x5fb6('0x1f')](_0x5fb6('0x39'),_0x1b96c0);if(_0x3a6f88[_0x5fb6('0x19')]){logger[_0x5fb6('0x2b')](_0x5fb6('0x3a'),JSON[_0x5fb6('0x3b')](_0x3a6f88['timers']));}}}catch(_0x10c242){logger[_0x5fb6('0x1f')](_0x5fb6('0x3c'),_0x10c242[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')][_0x5fb6('0x8')]=function(_0xd3245f){try{if(this[_0x5fb6('0x4')][_0xd3245f[_0x5fb6('0x35')]]&&(this[_0x5fb6('0x4')][_0xd3245f[_0x5fb6('0x35')]]['acw']||this[_0x5fb6('0x4')][_0xd3245f['queue']][_0x5fb6('0x24')])){if(this[_0x5fb6('0x5')][_0xd3245f['interface']]){this[_0x5fb6('0x6')][_0xd3245f[_0x5fb6('0x1c')]]={'queue':_0xd3245f[_0x5fb6('0x35')],'interface':_0xd3245f['interface'],'destlinkedid':_0xd3245f['destlinkedid']};}}}catch(_0x39280a){logger[_0x5fb6('0x1f')](_0x5fb6('0x3d'),_0x39280a[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')][_0x5fb6('0x14')]=function(_0x205234){try{if(this[_0x5fb6('0x4')][_0x205234[_0x5fb6('0x35')]]&&(this[_0x5fb6('0x4')][_0x205234[_0x5fb6('0x35')]]['acw']||this[_0x5fb6('0x4')][_0x205234['queue']]['mandatoryDisposition'])){if(this[_0x5fb6('0x5')][_0x205234[_0x5fb6('0x22')]]){this[_0x5fb6('0x6')][_0x205234[_0x5fb6('0x1c')]]={'queue':_0x205234[_0x5fb6('0x35')],'interface':_0x205234[_0x5fb6('0x22')]};}}}catch(_0x45ba31){logger['error'](_0x5fb6('0x3e'),_0x45ba31[_0x5fb6('0x37')]);}};Acw['prototype'][_0x5fb6('0xa')]=function(_0x7934fd){try{if(this[_0x5fb6('0x6')][_0x7934fd[_0x5fb6('0x1c')]]&&_[_0x5fb6('0x3f')](this[_0x5fb6('0x6')][_0x7934fd[_0x5fb6('0x1c')]][_0x5fb6('0x2e')])){logger['info'](_0x5fb6('0x40'),_0x7934fd[_0x5fb6('0x1c')]);this['startAcw'](_0x7934fd[_0x5fb6('0x1c')]);}else if(this[_0x5fb6('0x6')][_0x7934fd[_0x5fb6('0x41')]]&&_[_0x5fb6('0x3f')](this['channels'][_0x7934fd['linkedid']][_0x5fb6('0x2e')])){logger[_0x5fb6('0x2b')](_0x5fb6('0x42'),_0x7934fd['linkedid']);this[_0x5fb6('0x43')](_0x7934fd['linkedid']);}}catch(_0x3293ad){logger['error'](_0x5fb6('0x44'),_0x3293ad[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')]['syncHangup']=function(_0x242bdf){try{if(this[_0x5fb6('0x6')][_0x242bdf[_0x5fb6('0x1c')]]&&this[_0x5fb6('0x6')][_0x242bdf[_0x5fb6('0x1c')]][_0x5fb6('0x2e')]){logger[_0x5fb6('0x2b')](_0x5fb6('0x45'),_0x242bdf[_0x5fb6('0x1c')]);this[_0x5fb6('0x43')](_0x242bdf[_0x5fb6('0x1c')]);}else if(this['channels'][_0x242bdf[_0x5fb6('0x41')]]&&this['channels'][_0x242bdf[_0x5fb6('0x41')]][_0x5fb6('0x2e')]){logger[_0x5fb6('0x2b')](_0x5fb6('0x46'),_0x242bdf[_0x5fb6('0x41')]);this[_0x5fb6('0x43')](_0x242bdf['linkedid']);}}catch(_0x51bf91){logger['error']('[ACW][syncHangup]\x20%s',_0x51bf91[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')][_0x5fb6('0x10')]=function(_0x2fa95b){try{if(!_['isNil'](this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x47')]])){this['startAcw'](_0x2fa95b[_0x5fb6('0x47')]);if(this['channels'][_0x2fa95b[_0x5fb6('0x48')]]){this[_0x5fb6('0x6')][_0x2fa95b['secondtransfereruniqueid']][_0x5fb6('0x2e')]=!![];this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x49')]]=this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x48')]];delete this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x48')]];}}else if(!_[_0x5fb6('0x4a')](this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x49')]])){this[_0x5fb6('0x43')](_0x2fa95b['transfertargetuniqueid']);if(this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x4b')]]){this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x4b')]][_0x5fb6('0x2e')]=!![];this[_0x5fb6('0x6')][_0x2fa95b['transfereeuniqueid']]=this[_0x5fb6('0x6')][_0x2fa95b['origtransfereruniqueid']];delete this[_0x5fb6('0x6')][_0x2fa95b[_0x5fb6('0x4b')]];}}}catch(_0x2c5c89){logger[_0x5fb6('0x1f')](_0x5fb6('0x4c'),_0x2c5c89[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')][_0x5fb6('0x12')]=function(_0x5d2342){try{if(this['channels'][_0x5d2342[_0x5fb6('0x4d')]]){logger[_0x5fb6('0x2b')](_0x5fb6('0x4e'),JSON[_0x5fb6('0x3b')](_0x5d2342['transfereruniqueid']));this['startAcw'](_0x5d2342[_0x5fb6('0x4d')]);}else if(this['channels'][_0x5d2342['transfererlinkedid']]){logger[_0x5fb6('0x2b')](_0x5fb6('0x4f'),JSON[_0x5fb6('0x3b')](_0x5d2342[_0x5fb6('0x50')]));this[_0x5fb6('0x43')](_0x5d2342['transfererlinkedid']);}}catch(_0x264980){logger['error'](_0x5fb6('0x51'),_0x264980[_0x5fb6('0x37')]);}};Acw[_0x5fb6('0x16')][_0x5fb6('0xe')]=function(_0x1a1476){try{if(this[_0x5fb6('0x4')][_0x1a1476['queue']]&&this[_0x5fb6('0x4')][_0x1a1476[_0x5fb6('0x35')]][_0x5fb6('0x52')]==='all'){if(this['agents'][_0x1a1476['interface']]){logger[_0x5fb6('0x2b')](_0x5fb6('0x53'),_0x1a1476[_0x5fb6('0x1c')],_0x1a1476[_0x5fb6('0x22')],_0x1a1476[_0x5fb6('0x35')]);return RpcUser[_0x5fb6('0x2f')](this[_0x5fb6('0x5')][_0x1a1476['interface']],_0x5fb6('0x54'),_0x1a1476[_0x5fb6('0x1c')]);}}}catch(_0x3c99d2){logger[_0x5fb6('0x1f')](_0x5fb6('0x55'),_0x3c99d2['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index df98824..7446f7a 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 _0xbdc9=['action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','resolve','then','exports','asterisk-manager','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','promisify'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xbdc9,0x106));var _0x9bdc=function(_0x2f5ead,_0x5e3b75){_0x2f5ead=_0x2f5ead-0x0;var _0x121722=_0xbdc9[_0x2f5ead];return _0x121722;};'use strict';var Manager=require(_0x9bdc('0x0'));var BPromise=require('bluebird');var util=require('util');var logger=require(_0x9bdc('0x1'))(_0x9bdc('0x2'));var config=require(_0x9bdc('0x3'));var ami=new Manager(config[_0x9bdc('0x4')][_0x9bdc('0x5')],config[_0x9bdc('0x4')]['ip'],config[_0x9bdc('0x4')][_0x9bdc('0x6')],config[_0x9bdc('0x4')][_0x9bdc('0x7')],!![]);ami[_0x9bdc('0x8')]();ami['Action']=BPromise[_0x9bdc('0x9')](ami[_0x9bdc('0xa')]);function error(_0xdf112c){logger[_0x9bdc('0xb')](util['format'](_0x9bdc('0xc'),config[_0x9bdc('0x4')]['username'],config[_0x9bdc('0x4')]['ip'],config['asterisk']['port'],util[_0x9bdc('0xd')](_0xdf112c,![],null)));}function close(){logger[_0x9bdc('0xb')](util[_0x9bdc('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x9bdc('0x6')],config['asterisk']['ip'],config[_0x9bdc('0x4')]['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x9bdc('0xf')]({'action':_0x9bdc('0x10')});};};ami[_0x9bdc('0x11')]=function(){return function(){return ami[_0x9bdc('0xf')]({'action':_0x9bdc('0x12')});};};ami[_0x9bdc('0x13')]=function(){return function(){return ami[_0x9bdc('0xf')]({'action':_0x9bdc('0x14')});};};ami[_0x9bdc('0x15')]=function(){return function(){return ami['Action']({'action':_0x9bdc('0x16')});};};ami[_0x9bdc('0x17')]=function(){return function(){return ami[_0x9bdc('0xf')]({'action':_0x9bdc('0x18')});};};function connect(){logger[_0x9bdc('0x19')](util[_0x9bdc('0xe')](_0x9bdc('0x1a'),config[_0x9bdc('0x4')][_0x9bdc('0x6')],config[_0x9bdc('0x4')]['ip'],config[_0x9bdc('0x4')][_0x9bdc('0x5')]));ami[_0x9bdc('0x1b')](_0x9bdc('0xb'),error);ami[_0x9bdc('0x1b')](_0x9bdc('0x1c'),close);}ami['on'](_0x9bdc('0x1d'),connect);ami['on'](_0x9bdc('0x1e'),function(_0x454ceb){logger[_0x9bdc('0x19')](util[_0x9bdc('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x9bdc('0x6')],config[_0x9bdc('0x4')]['ip'],config[_0x9bdc('0x4')][_0x9bdc('0x5')],util[_0x9bdc('0xd')](_0x454ceb,![],null)));});ami['on']('fullybooted',function(){logger[_0x9bdc('0x19')](util[_0x9bdc('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x9bdc('0x4')]['username'],config['asterisk']['ip'],config[_0x9bdc('0x4')][_0x9bdc('0x5')]));return Promise[_0x9bdc('0x1f')]()['then'](ami['actionSipShowRegistry']())[_0x9bdc('0x20')](ami[_0x9bdc('0x11')]())[_0x9bdc('0x20')](ami[_0x9bdc('0x13')]())['then'](ami[_0x9bdc('0x15')]())[_0x9bdc('0x20')](ami['actionCoreShowChannels']())['catch'](function(_0x54fb1b){logger[_0x9bdc('0xb')]('[ami.js][fullybooted]',util[_0x9bdc('0xd')](_0x54fb1b,{'showHidden':![],'depth':null}));});});ami[_0x9bdc('0x1b')](_0x9bdc('0xb'),error);ami[_0x9bdc('0x1b')](_0x9bdc('0x1c'),close);module[_0x9bdc('0x21')]=ami; \ No newline at end of file +var _0xc1a6=['[ami.js][fullybooted]','once','exports','bluebird','util','../../config/logger','port','asterisk','username','password','keepConnected','Action','promisify','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','resolve','then','actionQueueSummary','error'];(function(_0x19b9f5,_0x2ff200){var _0x89c067=function(_0x523a93){while(--_0x523a93){_0x19b9f5['push'](_0x19b9f5['shift']());}};_0x89c067(++_0x2ff200);}(_0xc1a6,0xad));var _0x6c1a=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xc1a6[_0x3054be];return _0x3df150;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x6c1a('0x0'));var util=require(_0x6c1a('0x1'));var logger=require(_0x6c1a('0x2'))('ami');var config=require('../../config/environment');var ami=new Manager(config['asterisk'][_0x6c1a('0x3')],config[_0x6c1a('0x4')]['ip'],config[_0x6c1a('0x4')][_0x6c1a('0x5')],config['asterisk'][_0x6c1a('0x6')],!![]);ami[_0x6c1a('0x7')]();ami[_0x6c1a('0x8')]=BPromise[_0x6c1a('0x9')](ami['action']);function error(_0xf4cfa6){logger['error'](util[_0x6c1a('0xa')](_0x6c1a('0xb'),config[_0x6c1a('0x4')]['username'],config[_0x6c1a('0x4')]['ip'],config[_0x6c1a('0x4')][_0x6c1a('0x3')],util[_0x6c1a('0xc')](_0xf4cfa6,![],null)));}function close(){logger['error'](util[_0x6c1a('0xa')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x6c1a('0x4')][_0x6c1a('0x5')],config[_0x6c1a('0x4')]['ip'],config[_0x6c1a('0x4')][_0x6c1a('0x3')]));}ami[_0x6c1a('0xd')]=function(){return function(){return ami[_0x6c1a('0x8')]({'action':_0x6c1a('0xe')});};};ami[_0x6c1a('0xf')]=function(){return function(){return ami[_0x6c1a('0x8')]({'action':_0x6c1a('0x10')});};};ami[_0x6c1a('0x11')]=function(){return function(){return ami[_0x6c1a('0x8')]({'action':_0x6c1a('0x12')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x6c1a('0x8')]({'action':_0x6c1a('0x13')});};};ami[_0x6c1a('0x14')]=function(){return function(){return ami[_0x6c1a('0x8')]({'action':_0x6c1a('0x15')});};};function connect(){logger[_0x6c1a('0x16')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk']['username'],config[_0x6c1a('0x4')]['ip'],config[_0x6c1a('0x4')][_0x6c1a('0x3')]));ami['once']('error',error);ami['once'](_0x6c1a('0x17'),close);}ami['on'](_0x6c1a('0x18'),connect);ami['on'](_0x6c1a('0x19'),function(_0xb25502){logger['info'](util['format'](_0x6c1a('0x1a'),config[_0x6c1a('0x4')][_0x6c1a('0x5')],config[_0x6c1a('0x4')]['ip'],config[_0x6c1a('0x4')][_0x6c1a('0x3')],util['inspect'](_0xb25502,![],null)));});ami['on']('fullybooted',function(){logger['info'](util[_0x6c1a('0xa')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x6c1a('0x4')]['username'],config[_0x6c1a('0x4')]['ip'],config[_0x6c1a('0x4')][_0x6c1a('0x3')]));return Promise[_0x6c1a('0x1b')]()['then'](ami[_0x6c1a('0xd')]())[_0x6c1a('0x1c')](ami[_0x6c1a('0xf')]())['then'](ami['actionSipPeerStatus']())['then'](ami[_0x6c1a('0x1d')]())['then'](ami['actionCoreShowChannels']())['catch'](function(_0x517d01){logger[_0x6c1a('0x1e')](_0x6c1a('0x1f'),util[_0x6c1a('0xc')](_0x517d01,{'showHidden':![],'depth':null}));});});ami[_0x6c1a('0x20')](_0x6c1a('0x1e'),error);ami[_0x6c1a('0x20')]('close',close);module[_0x6c1a('0x21')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index fba27bd..1601bd9 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0xe706,0xa3));var _0x6e70=function(_0x3f9631,_0x51ffcb){_0x3f9631=_0x3f9631-0x0;var _0x242d84=_0xe706[_0x3f9631];return _0x242d84;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file +var _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x70e0,0x17b));var _0x070e=function(_0x46cd77,_0x334d7b){_0x46cd77=_0x46cd77-0x0;var _0x5d7f6b=_0x70e0[_0x46cd77];return _0x5d7f6b;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index ecf5bc1..ca46ada 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 _0x3951=['dialAbandonedRetryFrequency','voiceQueue','countabandonedretry','dialAbandonedMaxRetry','ContactId','[rescheduleContact][Abandoned]','Abandoned','calleridname','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','paused','stateinterface','locked','isNil','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','membername','AMD','emit','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','dialMachineMaxRetry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','[syncHangupIvr][createHistory]','dialQueueProject','outboundUnknownCallsDay','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','queueSummaryCountersUpdated','assign','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact]','[syncAgentComplete][createHistory]','user:%s','launchHandleIvr','handleIvr','object','phone','originate','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','isOutboundQueue','dialQueueOptions','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','Trunk','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','callerid','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][Drop]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','dialBusyRetryFrequency','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','avgHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','RUNNING','checkIsBlackList','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','dialOrderByScheduledAt','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','erlangb','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','Umin\x20=\x20','exports','util','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','bind','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','---------------------------','merge','getSeconds','debug','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','CAMPAIGN_STATUS','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','INACTIVE','\x20NOT\x20Active','campaign:ivr:%s','sendMessageOneNotActive','originated','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','[ifTime][Action]','Error','isTrunkReachable','active','format','status','reachable','SIP/%s','unmonitored','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','push','Action','iftime\x20%s,%s','interval','indexOf','true','catch','command','timezones','content','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','isIVRCampaignActive','resolve','checkIsTrunkReachable','checkIfTime','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','dialGlobalInterval','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','OVERTIME_GLOBAL_INTERVAL','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','moveContactManagedDialer','[syncAgentComplete]','droptime','responsetime','Drop','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','ListId','VoiceQueueId','CampaignId','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','dropreason','CALLEREXIT'];(function(_0x4f8f3b,_0x43281b){var _0x4c250c=function(_0x19a7ff){while(--_0x19a7ff){_0x4f8f3b['push'](_0x4f8f3b['shift']());}};_0x4c250c(++_0x43281b);}(_0x3951,0x139));var _0x1395=function(_0x329fb9,_0x500419){_0x329fb9=_0x329fb9-0x0;var _0x1bf602=_0x3951[_0x329fb9];return _0x1bf602;};'use strict';var util=require(_0x1395('0x0'));var _=require('lodash');var uuid=require('uuid');var moment=require(_0x1395('0x1'));var rr=require('rr');var Redis=require(_0x1395('0x2'));var utils=require(_0x1395('0x3'));var hopperUtils=require(_0x1395('0x4'));var ut=require(_0x1395('0x5'));var config=require(_0x1395('0x6'));var logger=require(_0x1395('0x7'))('dialer');var loggerBooked=require(_0x1395('0x7'))(_0x1395('0x8'));var loggerPredictive=require(_0x1395('0x7'))(_0x1395('0x9'));var loggerPredictiveCalls=require(_0x1395('0x7'))(_0x1395('0xa'));var loggerSyncQueueSummary=require(_0x1395('0x7'))(_0x1395('0xb'));var ami=require(_0x1395('0xc'));config[_0x1395('0xd')]=_[_0x1395('0xe')](config['redis'],{'host':_0x1395('0xf'),'port':0x18eb});var io=require(_0x1395('0x10'))(new Redis(config[_0x1395('0xd')]));var cmHopper=require(_0x1395('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x1395('0x12'));var Interval=require(_0x1395('0x13'));var Action=require(_0x1395('0x14'));var History=require(_0x1395('0x15'));var Final=require(_0x1395('0x16'));var AgentComplete=require(_0x1395('0x17'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x1395('0x18'));var ipAgi=process[_0x1395('0x19')][_0x1395('0x1a')]||_0x1395('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x1395('0x1c')]['enqueue']=function(_0xc9f88c){this[_0x1395('0x1d')]=this[_0x1395('0x1d')]?this[_0x1395('0x1d')][_0x1395('0x1e')](_0xc9f88c):_0xc9f88c();};function Dialer(_0x13ce5a,_0x23e2e1){this[_0x1395('0x1f')]=new Sequence();this[_0x1395('0x20')]=_0x23e2e1;this['voiceQueues']=_0x13ce5a[_0x1395('0x21')];this['campaigns']=_0x13ce5a[_0x1395('0x22')];this[_0x1395('0x23')]=_0x13ce5a[_0x1395('0x23')];this[_0x1395('0x24')]=_0x13ce5a[_0x1395('0x24')];this[_0x1395('0x25')]=config['maxNumberOriginate']||0x2;this[_0x1395('0x26')]={};this[_0x1395('0x27')]={};this[_0x1395('0x28')]={};this[_0x1395('0x29')]={};this['optionPredictive']={};this[_0x1395('0x2a')]={};this[_0x1395('0x2b')]={};this[_0x1395('0x2c')]={};this[_0x1395('0x2d')]={};this[_0x1395('0x2e')]={};this[_0x1395('0x2f')]={};ami['on'](_0x1395('0x30'),this[_0x1395('0x31')]['bind'](this));ami['on'](_0x1395('0x32'),this[_0x1395('0x33')]['bind'](this));ami['on'](_0x1395('0x34'),this[_0x1395('0x35')][_0x1395('0x36')](this));ami['on'](_0x1395('0x37'),this[_0x1395('0x38')][_0x1395('0x36')](this));ami['on'](_0x1395('0x39'),this[_0x1395('0xb')][_0x1395('0x36')](this));ami['on'](_0x1395('0x3a'),this[_0x1395('0x3b')][_0x1395('0x36')](this));ami['on'](_0x1395('0x3c'),this[_0x1395('0x3d')][_0x1395('0x36')](this));ami['on']('newexten',this[_0x1395('0x3e')][_0x1395('0x36')](this));ami['on'](_0x1395('0x3f'),this[_0x1395('0x40')][_0x1395('0x36')](this));ami['on'](_0x1395('0x41'),this[_0x1395('0x42')]['bind'](this));ami['on']('queuestatuscomplete',this[_0x1395('0x43')][_0x1395('0x36')](this));this[_0x1395('0x44')]();this[_0x1395('0x45')]();RpcSetting[_0x1395('0x46')]()[_0x1395('0x47')](function(_0x5cbb77){previewRecallmeReminderInterval=_0x5cbb77[_0x1395('0x48')];});}function isNotNull(_0xcc0f63){return _0xcc0f63!==null&&!_[_0x1395('0x49')](_0xcc0f63);}function msgResponse(_0x2a28eb,_0x2298ad,_0x51370a){return{'action':_0x2a28eb,'response':_0x2298ad,'message':_0x51370a,'stack':_0x51370a};}function emit(_0x285ce1,_0x5a7fc1,_0x178c2f){io['to'](_0x285ce1)['emit'](_0x5a7fc1,_0x178c2f);}function emitOutboundVoiceQueueSummary(_0x490cc7){if(_0x490cc7[_0x1395('0x4a')]===_0x1395('0x4b')){logger['debug'](_0x1395('0x4c'),util[_0x1395('0x4d')](_0x490cc7,{'showHidden':![],'depth':null}));emit(util['format'](_0x1395('0x4e'),_0x490cc7[_0x1395('0x4f')]),_0x1395('0x50'),_0x490cc7);}}function checkGetDataPredictive(_0x160476){if(isNotNull(_0x160476)&&!_[_0x1395('0x51')](_0x160476)){loggerPredictive['info'](_0x1395('0x52'));loggerPredictive[_0x1395('0x53')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x160476[_0x1395('0x54')]);loggerPredictive[_0x1395('0x53')](_0x1395('0x55'),_0x160476[_0x1395('0x56')]);loggerPredictive[_0x1395('0x53')](_0x1395('0x57'),_0x160476[_0x1395('0x58')]);loggerPredictive[_0x1395('0x53')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x160476[_0x1395('0x59')]);loggerPredictive[_0x1395('0x53')](_0x1395('0x5a'),_0x160476[_0x1395('0x5b')]);loggerPredictive[_0x1395('0x53')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x160476[_0x1395('0x5c')]);loggerPredictive[_0x1395('0x53')]('---------------------------');if(_0x160476[_0x1395('0x54')]>0x0){if(!_[_0x1395('0x49')](_0x160476[_0x1395('0x5c')])&&_0x160476[_0x1395('0x5c')]>0x0){return!![];}loggerPredictive[_0x1395('0x53')](_0x1395('0x5d'));if(!_[_0x1395('0x49')](_0x160476['predictiveIntervalAvgHoldtime'])&&_0x160476[_0x1395('0x5b')]>0x0){return!![];}loggerPredictive['info'](_0x1395('0x5e'));}else{loggerPredictive['info'](_0x1395('0x5f'));}}else{loggerPredictive[_0x1395('0x53')](_0x1395('0x60'));}return![];}function mergeDataErlangB(_0x442f37){return function(_0x5f2cd8){loggerPredictive[_0x1395('0x53')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x1395('0x53')](_0x1395('0x61'),_0x5f2cd8[_0x1395('0x62')]);loggerPredictive[_0x1395('0x53')](_0x1395('0x63'),_0x5f2cd8['erlangCallToSecond']);loggerPredictive[_0x1395('0x53')](_0x1395('0x64'),_0x5f2cd8[_0x1395('0x65')]);loggerPredictive[_0x1395('0x53')](_0x1395('0x66'),_0x5f2cd8[_0x1395('0x67')]);loggerPredictive[_0x1395('0x53')](_0x1395('0x64'),_0x5f2cd8['erlangAbandonmentRate']);loggerPredictive[_0x1395('0x53')](_0x1395('0x68'));_[_0x1395('0x69')](_0x442f37,_0x5f2cd8);};}function ifInterval(_0xf8248d,_0x3a646e){if(_[_0x1395('0x49')](_0x3a646e)){return![];}return utils[_0x1395('0x6a')](undefined,_0x3a646e)<_0xf8248d*0x3c;}function clearPredictiveAttributes(_0x30fedf){if(_0x30fedf[_0x1395('0x2b')]){_0x30fedf['startProgressive']=undefined;loggerPredictive[_0x1395('0x6b')](_0x30fedf[_0x1395('0x4f')],_0x1395('0x6c'));}if(_0x30fedf[_0x1395('0x2a')]){_0x30fedf[_0x1395('0x2a')]=undefined;loggerPredictive['debug'](_0x30fedf['name'],'startPredictive\x20value\x20cleared');}if(_0x30fedf[_0x1395('0x6d')]){clearInterval(_0x30fedf[_0x1395('0x6d')]);_0x30fedf[_0x1395('0x6d')]=undefined;loggerPredictive[_0x1395('0x6b')](_0x30fedf[_0x1395('0x4f')],_0x1395('0x6e'));}}function loggerCatchPredictive(_0x430a6a,_0x2fe0fb){return function(_0x2b6d52){loggerPredictive[_0x1395('0x6f')](_0x2fe0fb[_0x1395('0x4f')],_0x430a6a);loggerPredictive[_0x1395('0x6f')](_0x2b6d52['stack']);clearPredictiveAttributes(_0x2fe0fb);};}function loggerCatch(_0x5a3f84){return function(_0x3fb8a0){logger['error'](_0x5a3f84,util[_0x1395('0x4d')](_0x3fb8a0,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4c4b3f,_0x28ebe5,_0x5d907c){return function(_0x52b3fb){utils[_0x1395('0x70')](_0x28ebe5,_0x5d907c,0x0);_0x28ebe5[_0x1395('0x71')]=0x0;logger[_0x1395('0x6f')](_0x4c4b3f,util[_0x1395('0x4d')](_0x52b3fb,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4e3a76){return function(_0x16a752){if(isNotNull(_0x16a752)&&isNotNull(_0x16a752[0x0])){if(_0x16a752[0x0][_0x1395('0x72')]>0x0){_0x4e3a76[_0x1395('0x73')]=utils['CAMPAIGN_STATUS']['CONTACTS_RESCHEDULED'];logger[_0x1395('0x53')](_0x1395('0x74')+_0x4e3a76[_0x1395('0x4f')],_0x16a752[0x0][_0x1395('0x72')],_0x1395('0x75'));}else{_0x4e3a76['message']=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0x1395('0x53')](_0x1395('0x76')+_0x4e3a76[_0x1395('0x4f')]);}}};}function createObjHistory(_0x4e2c9e,_0x50475a,_0xc52b2e,_0x53e258,_0x128e0b){_0x4e2c9e['message']=_0xc52b2e;var _0x501786=new Action(_0x4e2c9e,_0x50475a);var _0xe88650=new History(_0x501786);_0xe88650[_0x1395('0x77')]=_0x53e258;_0xe88650[_0x1395('0x78')]=_0x128e0b;_0xe88650[_0x1395('0x79')]=_0x501786[_0x1395('0x7a')];return _0xe88650;}function unlockQueueStatus(_0x41bf39,_0x41578d){setTimeout(function(){if(_[_0x1395('0x49')](_0x41bf39[_0x1395('0x7b')])){loggerBooked['error'](_0x1395('0x7c'),_0x41578d);}_0x41bf39[_0x1395('0x7b')]=!![];loggerBooked[_0x1395('0x53')](_0x1395('0x7d'),_0x41578d,JSON[_0x1395('0x7e')](_[_0x1395('0x7f')](_0x41bf39,[_0x1395('0x4f'),_0x1395('0x7b')])));},0x1f3);}function checkInterval(_0xf2ad29){return function(){if(!isNotNull(_0xf2ad29[_0x1395('0x80')])){_0xf2ad29[_0x1395('0x73')]=utils[_0x1395('0x81')]['NULL_INTERVAL'];throw _0xf2ad29[_0x1395('0x4f')]+_0x1395('0x82');}if(!isNotNull(_0xf2ad29[_0x1395('0x80')][_0x1395('0x83')])){_0xf2ad29[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x84')];throw _0xf2ad29[_0x1395('0x4f')]+_0x1395('0x82');}if(!isNotNull(_[_0x1395('0x51')](_0xf2ad29[_0x1395('0x80')][_0x1395('0x83')]))){_0xf2ad29[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x84')];throw _0xf2ad29[_0x1395('0x4f')]+_0x1395('0x82');}};}function checkIsIVRCampaignActive(_0x63bdec){return function(){if(!utils['isIVRCampaignActive'](_0x63bdec)){_0x63bdec[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x85')];throw _0x63bdec[_0x1395('0x4f')]+_0x1395('0x86');}};}function emitCampaignSummary(_0x5cade8){if(utils['isIVRCampaign'](_0x5cade8)){emit(util['format'](_0x1395('0x87'),_0x5cade8[_0x1395('0x4f')]),'campaign:save',_0x5cade8);}}function loggerCatchQueueSummary(_0x4e8391,_0x21b392){return function(_0x33798e){clearPredictiveAttributes(_0x21b392);emitCampaignSummary(_0x21b392);loggerSyncQueueSummary[_0x1395('0x6b')](_0x4e8391,util[_0x1395('0x4d')](_0x33798e,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x147021){if(_0x147021[_0x1395('0x88')]){if(_0x147021[_0x1395('0x89')]===0x0){_0x147021[_0x1395('0x88')]=![];_0x147021[_0x1395('0x73')]=utils['CAMPAIGN_STATUS'][_0x1395('0x85')];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x147021['name'],_0x1395('0x8a'));}else{_0x147021[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x8b')];loggerSyncQueueSummary[_0x1395('0x6b')](_0x1395('0x8c'),_0x147021[_0x1395('0x4f')],'is\x20disactive');}emitCampaignSummary(_0x147021);}}function myreject(_0x3a140e){return function(_0x1ba9f7){return _0x3a140e(msgResponse(_0x1395('0x8d'),_0x1395('0x8e'),JSON[_0x1395('0x7e')](_0x1ba9f7)));};}Dialer[_0x1395('0x1c')][_0x1395('0x8f')]=function(_0x1181fb){return!_['isUndefined'](_0x1181fb)&&_0x1181fb&&!_['isUndefined'](_0x1181fb[_0x1395('0x4f')])&&!_['isUndefined'](_0x1181fb[_0x1395('0x90')])&&_0x1181fb['active']&&(this[_0x1395('0x24')][util[_0x1395('0x91')]('SIP/%s',_0x1181fb['name'])][_0x1395('0x92')]===_0x1395('0x93')||this[_0x1395('0x24')][util[_0x1395('0x91')](_0x1395('0x94'),_0x1181fb[_0x1395('0x4f')])][_0x1395('0x92')]===_0x1395('0x95'));};Dialer[_0x1395('0x1c')]['checkIsTrunkReachable']=function(_0x2605d8){var _0x2cab2a=this;return function(){if(!_0x2cab2a[_0x1395('0x8f')](_0x2605d8['Trunk'])){if(!_0x2cab2a['isTrunkReachable'](_0x2605d8[_0x1395('0x96')])){_0x2605d8[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x97')];throw _0x2605d8[_0x1395('0x4f')]+_0x1395('0x98');}}};};Dialer['prototype']['checkIfTime']=function(_0x143bf5,_0x4e6b83,_0x5f2631,_0x125233){var _0xc68cd=this;return function(){var _0x217c82=!![];return _0xc68cd[_0x1395('0x99')](_0x143bf5,_0x4e6b83,_0x5f2631,_0x125233,_0x217c82);};};Dialer[_0x1395('0x1c')][_0x1395('0x9a')]=function(_0x4d3b36,_0x36eb44,_0x13467a,_0x14ba15){var _0x3470bc=this;return function(){var _0x3ad17f=![];return _0x3470bc[_0x1395('0x99')](_0x4d3b36['Intervals'],_0x36eb44,_0x13467a,_0x14ba15,_0x3ad17f);};};Dialer[_0x1395('0x1c')][_0x1395('0x99')]=function(_0x3ea454,_0x10b871,_0x148a1b,_0x3d440c,_0x364ae6){var _0x3b38fa=[];return new Promise(function(_0x4a7595,_0x57d034){if(!isNotNull(_0x3ea454)){_0x3d440c[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x84')];return _0x57d034(msgResponse(_0x1395('0x9b'),_0x1395('0x9c'),_0x148a1b+_0x1395('0x9d')));}if(_['isEmpty'](_0x3ea454)){_0x3d440c[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x9e')];return _0x57d034(msgResponse(_0x1395('0x9b'),'Failure',_0x148a1b+_0x1395('0x9f')));}if(_0x10b871&&_[_0x1395('0x49')](config['timezones'][_0x10b871])){_0x3d440c[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0xa0')];return _0x57d034(msgResponse(_0x1395('0x9b'),_0x1395('0x9c'),_0x148a1b+_0x1395('0xa1')+_0x10b871));}if(_[_0x1395('0xa2')](_0x3ea454)){for(var _0x1dd66c=0x0;_0x1dd66c<_0x3ea454['length'];_0x1dd66c+=0x1){_0x3b38fa[_0x1395('0xa3')](ami[_0x1395('0xa4')]({'action':'command','command':util[_0x1395('0x91')](_0x1395('0xa5'),_0x3ea454[_0x1dd66c][_0x1395('0xa6')],!_['isUndefined'](config['timezones'][_0x10b871])?_0x10b871:'')})['then'](function(_0x4d5cd9){return _0x4d5cd9['content'][_0x1395('0xa7')](_0x1395('0xa8'))>=0x0;})[_0x1395('0xa9')](myreject(_0x57d034)));}}else{_0x3b38fa[_0x1395('0xa3')](ami[_0x1395('0xa4')]({'action':_0x1395('0xaa'),'command':util[_0x1395('0x91')](_0x1395('0xa5'),_0x3ea454,!_['isUndefined'](config[_0x1395('0xab')][_0x10b871])?_0x10b871:'')})[_0x1395('0x47')](function(_0x4a3ac5){return _0x4a3ac5[_0x1395('0xac')][_0x1395('0xa7')](_0x1395('0xa8'))>=0x0;})[_0x1395('0xa9')](myreject(_0x57d034)));}Promise['all'](_0x3b38fa)['then'](function(_0x3054e4){var _0x510cdb=_['some'](_0x3054e4);if(_0x510cdb){return _0x4a7595(_0x510cdb);}else{_0x3d440c[_0x1395('0x73')]=_0x364ae6?utils[_0x1395('0x81')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x1395('0x81')][_0x1395('0xad')];return _0x57d034(msgResponse(_0x1395('0xae'),'Failure',_0x1395('0xaf')+_0x364ae6+'\x20'+_0x148a1b+_0x1395('0xb0')+util['inspect'](_0x3ea454,{'showHidden':![],'depth':null})+_0x1395('0xb1')+_0x10b871));}})[_0x1395('0xa9')](function(_0x15d252){return _0x57d034(msgResponse(_0x1395('0x9b'),_0x1395('0x9c'),JSON['stringify'](_0x15d252)));});});};Dialer['prototype'][_0x1395('0x44')]=function(){var _0x215d65=this;return cmHopper[_0x1395('0xb2')]({'active':![]},{'where':{'active':!![]}})[_0x1395('0x47')](function(){setInterval(function(){_0x215d65[_0x1395('0xb3')]();},0x3e8);});};Dialer[_0x1395('0x1c')][_0x1395('0xb3')]=function(){var _0x408ce5=this;var _0x4614b0;for(var _0x70d485 in this[_0x1395('0x22')]){if(typeof this[_0x1395('0x22')][_0x70d485]!==_0x1395('0xb4')){_0x4614b0=this[_0x1395('0x22')][_0x70d485];if(utils[_0x1395('0xb5')](_0x4614b0)&&utils[_0x1395('0xb6')](_0x4614b0)){_0x4614b0[_0x1395('0x88')]=!![];Promise[_0x1395('0xb7')]()[_0x1395('0x47')](checkIsIVRCampaignActive(_0x4614b0))['then'](checkInterval(_0x4614b0))[_0x1395('0x47')](_0x408ce5[_0x1395('0xb8')](_0x4614b0))[_0x1395('0x47')](_0x408ce5[_0x1395('0xb9')](_0x4614b0['dialGlobalInterval'],_0x4614b0['dialTimezone'],_0x4614b0[_0x1395('0x4f')],_0x4614b0))[_0x1395('0x47')](_0x408ce5[_0x1395('0x9a')](_0x4614b0['Interval'],_0x4614b0[_0x1395('0xba')],_0x4614b0['name'],_0x4614b0))[_0x1395('0x47')](_0x408ce5['launchHandleIvr'](_0x4614b0))[_0x1395('0xa9')](loggerCatchQueueSummary(_0x1395('0xbb'),_0x4614b0));}else{notSendMessagesCampaign(_0x4614b0);}}}};Dialer[_0x1395('0x1c')][_0x1395('0xbc')]=function(_0x3edcae){if(_0x3edcae[_0x1395('0xbd')]!==_0x1395('0x9')){clearPredictiveAttributes(_0x3edcae);}switch(_0x3edcae[_0x1395('0xbd')]){case _0x1395('0xbe'):this[_0x1395('0xbf')](_0x3edcae,0x1);break;case _0x1395('0xc0'):this[_0x1395('0xbf')](_0x3edcae,_0x3edcae['dialPowerLevel']);break;case _0x1395('0x9'):this[_0x1395('0x9')](_0x3edcae);break;case _0x1395('0x8'):this[_0x1395('0xbf')](_0x3edcae,0x1);break;default:logger['error'](_0x1395('0xc1'),_0x3edcae[_0x1395('0x4f')],_0x1395('0xc2'));}};Dialer[_0x1395('0x1c')][_0x1395('0x9b')]=function(_0x4caa83,_0x2a84cc){var _0x3ac800=_0x4caa83['dialTimezone'];var _0x344104=_0x2a84cc?_0x4caa83[_0x1395('0xc3')]:_0x4caa83['Interval'][_0x1395('0x83')];logger[_0x1395('0xc4')](_0x1395('0xc5'),_0x344104,_0x3ac800,_0x4caa83[_0x1395('0x4f')],util['format'](_0x1395('0xc6'),_0x4caa83[_0x1395('0x4f')],_0x4caa83['id']));var _0x13b20a=null;return Interval['intervalIftime'](_0x344104,_0x3ac800)[_0x1395('0x47')](function(_0x6b9614){if(_0x6b9614===!![]){return _0x6b9614;}else{_0x4caa83[_0x1395('0x73')]=_0x2a84cc?utils['CAMPAIGN_STATUS'][_0x1395('0xc7')]:utils[_0x1395('0x81')][_0x1395('0xad')];_0x13b20a=msgResponse('[ifTime][promiseAll]',_0x1395('0x9c'),_0x1395('0xaf')+_0x2a84cc+'\x20'+_0x4caa83['name']+'\x20Interval\x20is\x20overtime:\x20'+util[_0x1395('0x4d')](_0x344104,{'showHidden':![],'depth':null})+_0x1395('0xb1')+_0x3ac800);}if(_0x13b20a!==null){logger[_0x1395('0xc4')](_0x1395('0xc8'),_0x13b20a);_0x13b20a[_0x1395('0xc9')]=_0x2a84cc;throw _0x13b20a;}})[_0x1395('0xa9')](function(_0x4e6ae0){logger['error'](_0x1395('0xca'),_0x4e6ae0);throw msgResponse('[ifTime][Action]',_0x1395('0x8e'),util[_0x1395('0x4d')](_0x4e6ae0,{'showHidden':![],'depth':null}));});};Dialer[_0x1395('0x1c')][_0x1395('0x31')]=function(_0x465e88){if(this[_0x1395('0x21')][_0x465e88[_0x1395('0xcb')]]){if(this[_0x1395('0x29')][_0x465e88[_0x1395('0xcc')]]&&this[_0x1395('0x29')][_0x465e88[_0x1395('0xcc')]][_0x1395('0x4a')]!==_0x1395('0xcd')){this[_0x1395('0xce')](this[_0x1395('0x21')][_0x465e88['queue']]);this[_0x1395('0x29')][_0x465e88[_0x1395('0xcc')]]['answertime']=moment()[_0x1395('0x91')](_0x1395('0xcf'));}}};Dialer[_0x1395('0x1c')][_0x1395('0x38')]=function(_0x39e3c4){var _0x47f81e=this[_0x1395('0x29')][_0x39e3c4[_0x1395('0xcc')]];if(this[_0x1395('0x21')][_0x39e3c4[_0x1395('0xcb')]]){if(_0x47f81e&&_0x47f81e[_0x1395('0x4a')]!==_0x1395('0xcd')){delete this[_0x1395('0x29')][_0x39e3c4[_0x1395('0xcc')]];this[_0x1395('0x21')][_0x39e3c4[_0x1395('0xcb')]][_0x1395('0xd0')]+=0x1;var _0x22d83e=new AgentComplete(_0x47f81e,_0x39e3c4);if(_0x39e3c4[_0x1395('0xd1')]===_0x1395('0xd2')){_0x22d83e['agiafterat']=this['voiceQueues'][_0x39e3c4['queue']][_0x1395('0xd3')]&&this[_0x1395('0x21')][_0x39e3c4[_0x1395('0xcb')]][_0x1395('0xd4')]?moment()[_0x1395('0x91')](_0x1395('0xcf')):undefined;}hopperUtils['createHistory'](_0x22d83e)[_0x1395('0xa9')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x1395('0xd5')](_0x22d83e)[_0x1395('0xa9')](loggerCatch(_0x1395('0xd6')));}}};Dialer['prototype'][_0x1395('0x33')]=function(_0x363c7){var _0x5f54f6=this[_0x1395('0x29')][_0x363c7[_0x1395('0xcc')]];var _0x397513=this;var _0x12d9fb=![];var _0x5f86b0;var _0x4d8dc6;if(this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]]){if(_0x5f54f6&&_0x5f54f6[_0x1395('0x4a')]!==_0x1395('0xcd')){delete this[_0x1395('0x29')][_0x363c7[_0x1395('0xcc')]];this[_0x1395('0xce')](this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]]);_0x5f54f6[_0x1395('0xd7')]=moment()[_0x1395('0x91')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1246bf=new QueueCallerAbandon(_0x5f54f6,_0x363c7);if(utils[_0x1395('0x6a')](_0x5f54f6['droptime'],_0x5f54f6[_0x1395('0xd8')])>=_0x5f54f6['dialQueueTimeout']){this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]][_0x1395('0x58')]+=0x1;this['voiceQueues'][_0x363c7['queue']]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x363c7[_0x1395('0xcb')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1246bf[_0x1395('0x77')]=0xa;_0x1246bf[_0x1395('0x78')]=_0x1395('0xd9');_0x1246bf['dropreason']=_0x1395('0xda');_0x1246bf['agiafterat']=this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]][_0x1395('0xd3')]?moment()[_0x1395('0x91')](_0x1395('0xcf')):undefined;_0x1246bf[_0x1395('0xdb')]+=0x1;_0x1246bf[_0x1395('0xdc')]+=0x1;_0x5f86b0=this['voiceQueues'][_0x363c7[_0x1395('0xcb')]][_0x1395('0xdd')];_0x4d8dc6=this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]][_0x1395('0xde')];hopperUtils[_0x1395('0xdf')](_0x1246bf,_0x1246bf[_0x1395('0x77')],_0x5f54f6['voiceQueue'])[_0x1395('0x47')](function(_0x1a9b6b){_0x12d9fb=_0x1a9b6b[_0x1395('0xe0')]==0x1;if(_0x1246bf['countdropretry']>=_0x397513[_0x1395('0x21')][_0x363c7['queue']][_0x1395('0xe1')]){_0x397513[_0x1395('0xe2')](_0x1246bf,_0x1a9b6b[_0x1395('0xe0')]);}else{hopperUtils[_0x1395('0xe3')]({'active':![],'countdropretry':_0x1246bf['countdropretry'],'scheduledat':moment()[_0x1395('0xe4')](_0x397513['voiceQueues'][_0x363c7[_0x1395('0xcb')]]['dialDropRetryFrequency'],'minutes')[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x5f54f6['ContactId'],'ListId':_0x5f54f6[_0x1395('0xe5')],'VoiceQueueId':_0x5f54f6[_0x1395('0xe6')]||undefined,'CampaignId':_0x5f54f6[_0x1395('0xe7')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x44c3ee=new History(_0x1246bf);_0x44c3ee[_0x1395('0x77')]=0xa;_0x44c3ee['statedesc']=_0x1395('0xd9');_0x44c3ee[_0x1395('0x7a')]=moment()[_0x1395('0x91')](_0x1395('0xcf'));_0x44c3ee['endtime']=_0x44c3ee[_0x1395('0x7a')];_0x44c3ee['calleridname']=_0x1246bf['calleridname'];_0x44c3ee[_0x1395('0xe8')]=_0x1246bf[_0x1395('0xe8')];hopperUtils[_0x1395('0xe9')](_0x44c3ee)['catch'](loggerCatch(_0x1395('0xea')));}})[_0x1395('0x47')](function(){if(_0x12d9fb)hopperUtils['swapAdditionalPhones'](_0x1246bf,_0x5f86b0,_0x4d8dc6)[_0x1395('0x47')](function(){return 0x1;});});}else{this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]][_0x1395('0x59')]+=0x1;this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]][_0x1395('0xeb')]+=0x1;_0x1246bf['state']=0xb;_0x1246bf[_0x1395('0x78')]='Abandoned';_0x1246bf[_0x1395('0xec')]=_0x1395('0xed');_0x1246bf['countabandonedretry']+=0x1;_0x1246bf['countglobal']+=0x1;_0x5f86b0=this[_0x1395('0x21')][_0x363c7['queue']][_0x1395('0xee')];_0x4d8dc6=this['voiceQueues'][_0x363c7[_0x1395('0xcb')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x1395('0xdf')](_0x1246bf,_0x1246bf[_0x1395('0x77')],_0x5f54f6[_0x1395('0xef')])[_0x1395('0x47')](function(_0x43a735){if(_0x1246bf[_0x1395('0xf0')]>=_0x397513['voiceQueues'][_0x363c7['queue']][_0x1395('0xf1')]){_0x397513[_0x1395('0xe2')](_0x1246bf,_0x43a735[_0x1395('0xe0')]);}else{hopperUtils[_0x1395('0xe3')]({'active':![],'countabandonedretry':_0x1246bf[_0x1395('0xf0')],'scheduledat':moment()[_0x1395('0xe4')](_0x397513[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]]['dialAbandonedRetryFrequency'],'minutes')[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x5f54f6[_0x1395('0xf2')],'ListId':_0x5f54f6[_0x1395('0xe5')],'VoiceQueueId':_0x5f54f6[_0x1395('0xe6')]||undefined,'CampaignId':_0x5f54f6[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0xf3')));var _0x342898=new History(_0x1246bf);_0x342898['state']=0xb;_0x342898[_0x1395('0x78')]=_0x1395('0xf4');_0x342898[_0x1395('0x7a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x342898[_0x1395('0x79')]=_0x342898[_0x1395('0x7a')];_0x342898[_0x1395('0xf5')]=_0x1246bf[_0x1395('0xf5')];_0x342898['calleridnum']=_0x1246bf[_0x1395('0xe8')];hopperUtils[_0x1395('0xe9')](_0x342898)['catch'](loggerCatch(_0x1395('0xf6')));}})['then'](function(){if(_0x12d9fb)hopperUtils['swapAdditionalPhones'](_0x1246bf,_0x5f86b0,_0x4d8dc6)[_0x1395('0x47')](function(){return 0x1;});});}}}};Dialer[_0x1395('0x1c')][_0x1395('0x3e')]=function(_0x5dc64e){if(this[_0x1395('0x27')][_0x5dc64e[_0x1395('0xcc')]]){this['actions'][_0x5dc64e['uniqueid']][_0x1395('0xf7')]=_0x5dc64e[_0x1395('0xf7')];}if(this[_0x1395('0x29')][_0x5dc64e['uniqueid']]){this['uniqueId'][_0x5dc64e['uniqueid']][_0x1395('0xf7')]=_0x5dc64e[_0x1395('0xf7')];}};Dialer[_0x1395('0x1c')][_0x1395('0x42')]=function(_0x34c536){if(!this[_0x1395('0x27')][_0x34c536[_0x1395('0xf8')]]){return;}var _0x3e706f=this[_0x1395('0x21')][this[_0x1395('0x27')][_0x34c536[_0x1395('0xf8')]][_0x1395('0xcb')]][_0x1395('0xf9')]||_0x1395('0xfa');if(_0x3e706f===_0x1395('0xfb')){if(this[_0x1395('0x27')][_0x34c536['actionid']]&&_['isNil'](this[_0x1395('0x27')][_0x34c536[_0x1395('0xf8')]]['locked'])&&_0x34c536[_0x1395('0x92')]==='1'&&_0x34c536[_0x1395('0xfc')]==='0'){if(this[_0x1395('0x23')][_0x34c536['stateinterface']]){if(!this[_0x1395('0x23')][_0x34c536[_0x1395('0xfd')]][_0x1395('0xfe')]){this['agents'][_0x34c536[_0x1395('0xfd')]][_0x1395('0xfe')]=!![];this[_0x1395('0x27')][_0x34c536[_0x1395('0xf8')]]['locked']=!![];this['actions'][_0x34c536[_0x1395('0xf8')]][_0x1395('0xfd')]=_0x34c536[_0x1395('0xfd')];}}}}else if(_0x3e706f===_0x1395('0xfa')){if(this[_0x1395('0x27')][_0x34c536['actionid']]){if(this[_0x1395('0x23')][_0x34c536[_0x1395('0xfd')]]){this[_0x1395('0x27')][_0x34c536['actionid']][_0x1395('0xfd')]=_0x34c536[_0x1395('0xfd')];if(_[_0x1395('0xff')](this[_0x1395('0x2d')][this['actions'][_0x34c536['actionid']]['queue']])){this['queueBooked'][this[_0x1395('0x27')][_0x34c536[_0x1395('0xf8')]]['queue']]=[];}this[_0x1395('0x2d')][this[_0x1395('0x27')][_0x34c536[_0x1395('0xf8')]]['queue']][_0x1395('0xa3')](_[_0x1395('0x69')](_[_0x1395('0x7f')](this['actions'][_0x34c536[_0x1395('0xf8')]],[_0x1395('0x100'),'stateinterface']),{'status':_0x34c536[_0x1395('0x92')],'paused':_0x34c536[_0x1395('0xfc')]}));}}}};Dialer[_0x1395('0x1c')][_0x1395('0x43')]=function(_0x3118d9){if(!this['actions'][_0x3118d9['actionid']]){return;}var _0x40753a=this;var _0x340551=this['voiceQueues'][this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]];var _0x5759d0=_0x340551['strategy']||_0x1395('0xfa');if(_0x5759d0===_0x1395('0xfb')){if(this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]]&&this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xfd')]){this[_0x1395('0x20')][_0x1395('0x101')](this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]]['idHopper'],this['actions'][_0x3118d9[_0x1395('0xf8')]]['stateinterface'])[_0x1395('0xa9')](function(_0x3915b3){logger[_0x1395('0x6f')](_0x1395('0x102'),util[_0x1395('0x4d')](_0x3915b3,{'showHidden':![],'depth':null}));})['finally'](function(){_0x40753a[_0x1395('0xce')](_0x40753a['voiceQueues'][_0x40753a['actions'][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]]);_0x40753a['agents'][_0x40753a['actions'][_0x3118d9['actionid']]['stateinterface']][_0x1395('0xfe')]=![];delete _0x40753a['actions'][_0x3118d9[_0x1395('0xf8')]];unlockQueueStatus(_0x340551);});}else{this[_0x1395('0xce')](this[_0x1395('0x21')][this[_0x1395('0x27')][_0x3118d9['actionid']][_0x1395('0xcb')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xf2')],'ListId':this[_0x1395('0x27')][_0x3118d9['actionid']][_0x1395('0xe5')],'VoiceQueueId':this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xe6')]||undefined,'CampaignId':this['actions'][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x103')));delete this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]];unlockQueueStatus(_0x340551);}}else if(_0x5759d0===_0x1395('0xfa')){var _0x24b96e;if(this[_0x1395('0x27')][_0x3118d9['actionid']]&&!_['isEmpty'](this[_0x1395('0x2d')][this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]])){if(this['queueBookedRR'][_0x40753a[_0x1395('0x27')][_0x3118d9['actionid']]['queue']]){this[_0x1395('0x2e')][_0x40753a[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]]=this[_0x1395('0x2e')][this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]]?this[_0x1395('0x2e')][this[_0x1395('0x27')][_0x3118d9['actionid']]['queue']]:this['queueBooked'][this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]]?this[_0x1395('0x2d')][this[_0x1395('0x27')][_0x3118d9['actionid']][_0x1395('0xcb')]][_0x1395('0x104')]||0x0:0x0;}this[_0x1395('0x2d')][this['actions'][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]]['_rr']=this['queueBookedRR'][this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]];for(var _0xaec8d2=0x0;_0xaec8d2=_0xb375d3[_0x1395('0x128')]){_0x334e84[_0x1395('0x129')](_0x295b09,_0x1d81af,_0x903742,_0x1395('0x12a'));}else{if(_0x295b09[_0x1395('0x122')]>=_0xb375d3['dialMachineMaxRetry']){_0x334e84[_0x1395('0x12b')](_0x295b09,_0x1d81af,_0x903742,_0x1395('0x12c'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x295b09[_0x1395('0x122')],'scheduledat':moment()[_0x1395('0xe4')](_0xb375d3[_0x1395('0x12d')],_0x1395('0x12e'))[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x295b09[_0x1395('0xf2')],'ListId':_0x295b09[_0x1395('0xe5')],'VoiceQueueId':_0x295b09[_0x1395('0xe6')]||undefined,'CampaignId':_0x295b09[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch('[rescheduleContact][Machine]'));_0x1d81af({'reschedule':0x1});}}});}if(_0x52f630[_0x1395('0x4a')]===_0x1395('0xcd')&&this[_0x1395('0x22')][_0x52f630['queue']][_0x1395('0x115')]&&_0x75f1f7[_0x1395('0x116')]===_0x1395('0x117')){delete this[_0x1395('0x29')][_0x75f1f7['uniqueid']];this[_0x1395('0xce')](this[_0x1395('0x22')][_0x52f630[_0x1395('0xcb')]]);_0x1186fb=new Hangup(_0x52f630,_0x75f1f7);_0x1186fb[_0x1395('0x77')]=0x12;_0x1186fb[_0x1395('0x78')]=_0x1395('0x12f');_0x1186fb[_0x1395('0x119')]=_0x1395('0x11a');ami['emit']('custom:amd',ut[_0x1395('0x11d')](_0x1186fb,_0x1395('0x123')));this[_0x1395('0x11e')](_0x1186fb,_0x1395('0x130'),_0x1395('0x131'));}if(_0x52f630['type']===_0x1395('0xcd')&&this[_0x1395('0x22')][_0x52f630[_0x1395('0xcb')]][_0x1395('0x115')]&&_0x75f1f7[_0x1395('0x116')]===_0x1395('0x132')){return new Promise(function(_0x3eea50,_0x228ee7){delete _0x334e84[_0x1395('0x29')][_0x75f1f7[_0x1395('0xcc')]];_0x334e84[_0x1395('0xce')](_0x334e84[_0x1395('0x22')][_0x52f630['queue']]);_0x334e84[_0x1395('0x22')][_0x52f630[_0x1395('0xcb')]][_0x1395('0xd0')]+=0x1;_0x334e84[_0x1395('0x22')][_0x52f630[_0x1395('0xcb')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x5312c6=_0x334e84[_0x1395('0x22')][_0x52f630[_0x1395('0xcb')]];var _0xdb50c1=new Hangup(_0x52f630,_0x75f1f7);_0xdb50c1[_0x1395('0x77')]=0x13;_0xdb50c1[_0x1395('0x78')]=_0x1395('0x121');_0xdb50c1[_0x1395('0x119')]=_0x1395('0x11a');_0xdb50c1['countmachineretry']+=0x1;_0xdb50c1[_0x1395('0xdc')]+=0x1;_0xdb50c1['amd']=!![];ami[_0x1395('0x11b')]('custom:amd',ut[_0x1395('0x11d')](_0xdb50c1,'amd'));hopperUtils[_0x1395('0xe9')](_0xdb50c1)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xdb50c1[_0x1395('0x124')]+_0xdb50c1[_0x1395('0x125')]+_0xdb50c1[_0x1395('0x126')]+_0xdb50c1[_0x1395('0x127')]+_0xdb50c1[_0x1395('0xdb')]+_0xdb50c1['countabandonedretry']+_0xdb50c1[_0x1395('0x122')]+_0xdb50c1['countagentrejectretry']>=_0x5312c6[_0x1395('0x128')]){_0x334e84[_0x1395('0x129')](_0xdb50c1,_0x3eea50,_0x228ee7,_0x1395('0x12a'));}else{if(_0xdb50c1[_0x1395('0x122')]>=_0x5312c6[_0x1395('0x133')]){_0x334e84[_0x1395('0x12b')](_0xdb50c1,_0x3eea50,_0x228ee7,_0x1395('0x12c'));}else{hopperUtils[_0x1395('0xe3')]({'active':![],'countmachineretry':_0xdb50c1[_0x1395('0x122')],'scheduledat':moment()[_0x1395('0xe4')](_0x5312c6['dialMachineRetryFrequency'],_0x1395('0x12e'))[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0xdb50c1[_0x1395('0xf2')],'ListId':_0xdb50c1[_0x1395('0xe5')],'VoiceQueueId':_0xdb50c1['VoiceQueueId']||undefined,'CampaignId':_0xdb50c1[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x134')));_0x3eea50({'reschedule':0x1});}}});}}};Dialer[_0x1395('0x1c')][_0x1395('0x3d')]=function(_0x995950){var _0x57ee05=this[_0x1395('0x29')][_0x995950[_0x1395('0xcc')]];var _0x462f94;if(_0x57ee05&&_0x57ee05[_0x1395('0x4a')]===_0x1395('0xcd')){delete this[_0x1395('0x29')][_0x995950[_0x1395('0xcc')]];this['updateOriginated'](this[_0x1395('0x22')][_0x57ee05[_0x1395('0xcb')]]);this[_0x1395('0x22')][_0x57ee05[_0x1395('0xcb')]][_0x1395('0x135')]+=0x1;_0x462f94=new Hangup(_0x57ee05,_0x995950);hopperUtils[_0x1395('0xe9')](_0x462f94)[_0x1395('0xa9')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x1395('0xd5')](_0x462f94)[_0x1395('0xa9')](loggerCatch(_0x1395('0x136')));}if(_0x57ee05&&_0x57ee05[_0x1395('0x4a')]!==_0x1395('0xcd')&&isNotNull(this[_0x1395('0x21')][_0x57ee05['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x995950[_0x1395('0xcc')]];this[_0x1395('0xce')](this[_0x1395('0x21')][_0x57ee05[_0x1395('0xcb')]]);this[_0x1395('0x21')][_0x57ee05[_0x1395('0xcb')]][_0x1395('0xd0')]+=0x1;this[_0x1395('0x21')][_0x57ee05[_0x1395('0xcb')]][_0x1395('0x118')]+=0x1;_0x462f94=new Hangup(_0x57ee05,_0x995950);_0x462f94[_0x1395('0x77')]=0x10;_0x462f94[_0x1395('0x78')]=_0x1395('0x137');_0x462f94['membername']='AGI';hopperUtils[_0x1395('0xe9')](_0x462f94)[_0x1395('0xa9')](loggerCatch(_0x1395('0x138')));hopperUtils['moveContactManagedDialer'](_0x462f94)[_0x1395('0xa9')](loggerCatch(_0x1395('0x136')));}if(_0x57ee05&&_0x57ee05[_0x1395('0x4a')]!==_0x1395('0xcd')&&!isNotNull(this['voiceQueues'][_0x57ee05[_0x1395('0xcb')]][_0x1395('0x139')])){delete this[_0x1395('0x29')][_0x995950[_0x1395('0xcc')]];this['updateOriginated'](this['voiceQueues'][_0x57ee05[_0x1395('0xcb')]]);this[_0x1395('0x21')][_0x57ee05[_0x1395('0xcb')]][_0x1395('0x13a')]+=0x1;_0x462f94=new Hangup(_0x57ee05,_0x995950);_0x462f94['state']=0xc;_0x462f94[_0x1395('0x78')]=_0x995950['cause-txt'];_0x462f94['membername']=_0x1395('0x13b');hopperUtils[_0x1395('0xe9')](_0x462f94)[_0x1395('0xa9')](loggerCatch(_0x1395('0x138')));hopperUtils[_0x1395('0xd5')](_0x462f94)[_0x1395('0xa9')](loggerCatch(_0x1395('0x136')));}};Dialer['prototype']['syncQueueSummary']=function(_0x5bc015){var _0x5e35d2=this;if(!_0x5e35d2[_0x1395('0x2f')][_0x5bc015[_0x1395('0x4f')]]){_0x5e35d2[_0x1395('0x2f')][_0x5bc015[_0x1395('0x4f')]]={'running':![]};}else if(_0x5e35d2[_0x1395('0x2f')][_0x5bc015[_0x1395('0x4f')]][_0x1395('0x13c')]===!![]){return;}else if(_0x5e35d2[_0x1395('0x2f')][_0x5bc015['name']][_0x1395('0x13c')]===![]){_0x5e35d2[_0x1395('0x2f')][_0x5bc015['name']][_0x1395('0x13c')]=!![];}var _0x3d178c=_0x5e35d2[_0x1395('0x21')][_0x5bc015['name']];var _0xd2be16=_0x3d178c[_0x1395('0x73')]!==utils[_0x1395('0x81')][_0x1395('0x85')];var _0x412a9e=utils[_0x1395('0x13d')](_0x3d178c);_0x3d178c[_0x1395('0x13e')]=utils[_0x1395('0x13f')](_0x3d178c,_0x5e35d2[_0x1395('0x24')]);Promise[_0x1395('0xb7')]()[_0x1395('0x47')](function(){if(_0x3d178c[_0x1395('0x13e')]===utils[_0x1395('0x81')][_0x1395('0x85')]){if(_0xd2be16){clearPredictiveAttributes(_0x3d178c);_0x5bc015['startPredictive']=undefined;_0x5bc015[_0x1395('0x2b')]=undefined;}if(_0x3d178c[_0x1395('0x13e')]===utils[_0x1395('0x81')]['INACTIVE']){_0x5bc015[_0x1395('0x140')]=0x0;_0x5bc015[_0x1395('0xfc')]=0x0;_0x5bc015[_0x1395('0x141')]=0x0;_0x5bc015[_0x1395('0x142')]=0x0;_0x5bc015[_0x1395('0x143')]=0x0;}}else if(_0x3d178c[_0x1395('0x13e')]===utils[_0x1395('0x81')][_0x1395('0x144')]&&!_0x412a9e){return _0x5e35d2['ifTime'](_0x3d178c,!![])[_0x1395('0x47')](function(){return _0x5e35d2[_0x1395('0x9b')](_0x3d178c,![]);})[_0x1395('0x47')](function(){return _0x5e35d2[_0x1395('0xbc')](_0x3d178c);})[_0x1395('0xa9')](function(_0x2947c0){loggerSyncQueueSummary[_0x1395('0x6b')]('[syncQueueSummary]',util[_0x1395('0x4d')](_0x2947c0,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3d178c);});}else{clearPredictiveAttributes(_0x3d178c);}})['then'](function(){var _0x49c116=_0x5bc015['compareToOutboundQueue'](_0x3d178c);if(_0x49c116||_0x3d178c[_0x1395('0x145')]){_0x3d178c[_0x1395('0x145')]=![];_0x5bc015['updateReportFromOutboundQueue'](_0x3d178c);Object[_0x1395('0x146')](_0x3d178c,_0x5bc015);emitOutboundVoiceQueueSummary(_0x5bc015);}_0x5e35d2[_0x1395('0x2f')][_0x3d178c[_0x1395('0x4f')]][_0x1395('0x13c')]=![];})[_0x1395('0xa9')](function(_0x4e7ac0){logger['error'](_0x1395('0x147'),util['inspect'](_0x4e7ac0,{'showHidden':![],'depth':null}));_0x5e35d2[_0x1395('0x2f')][_0x3d178c[_0x1395('0x4f')]][_0x1395('0x13c')]=![];});};Dialer[_0x1395('0x1c')][_0x1395('0x3b')]=_[_0x1395('0x148')](function(){var _0xcb6b10=_[_0x1395('0x149')](this[_0x1395('0x21')],function(_0x4b6b42){return _0x4b6b42[_0x1395('0x14a')];});var _0x3d4252=_[_0x1395('0x149')](this[_0x1395('0x23')],function(_0x5095bf){return _0x5095bf[_0x1395('0x14b')]&&_0x5095bf[_0x1395('0x92')]==='reachable';});if(_0xcb6b10[_0x1395('0x105')]>0x0&&_0x3d4252['length']>0x0){return Promise[_0x1395('0xb7')]()[_0x1395('0x47')](cmHopper[_0x1395('0x14c')](_[_0x1395('0x14d')](_0xcb6b10,'id'),previewRecallmeReminderInterval,_[_0x1395('0x14d')](_0x3d4252,'id')))[_0x1395('0x47')](function(_0x52ab87){for(var _0xf1216d=0x0;_0xf1216d<_0x52ab87[_0x1395('0x105')];_0xf1216d++){var _0x465f46=_0x52ab87[_0xf1216d][_0x1395('0x14e')][_0x1395('0x4f')];if(_0x465f46)io['to'](util[_0x1395('0x91')]('user:%s',_0x465f46))[_0x1395('0x11b')](_0x1395('0x14f'),{'hopper':_0x52ab87[_0xf1216d]});}})['catch'](function(_0x47b6b6){logger[_0x1395('0x6f')](_0x1395('0x150'),_0x47b6b6);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x1395('0x1c')][_0x1395('0x45')]=function(){var _0x750c58=this;setInterval(function(){_0x750c58[_0x1395('0x151')](_0x750c58[_0x1395('0x29')],_0x1395('0x152'));_0x750c58[_0x1395('0x151')](_0x750c58[_0x1395('0x27')],_0x1395('0x153'));},0x32c8);};Dialer['prototype'][_0x1395('0x151')]=function(_0x1f215b,_0x169418){var _0x12071f=this;for(var _0x3d0ae3 in _0x1f215b){if(typeof _0x1f215b[_0x3d0ae3]!==_0x1395('0xb4')){this[_0x1395('0x1f')]['enqueue'](function(){if(!_[_0x1395('0xff')](_0x1f215b[_0x3d0ae3])){return ami['Action']({'action':_0x1395('0x92'),'channel':_0x1f215b[_0x3d0ae3][_0x1395('0xf7')]})[_0x1395('0xa9')](function(_0x44fcb6){if(_0x44fcb6[_0x1395('0x73')]===_0x1395('0x154')){setTimeout(function(){if(_0x1f215b[_0x3d0ae3]&&_0x1f215b[_0x3d0ae3][_0x1395('0x4a')]!==_0x1395('0xcd')){_0x12071f[_0x1395('0xce')](_0x12071f[_0x1395('0x21')][_0x1f215b[_0x3d0ae3]['queue']]);logger['error'](_0x1395('0x155'),_0x169418,_0x3d0ae3,_0x1f215b[_0x3d0ae3][_0x1395('0xcb')]);delete _0x1f215b[_0x3d0ae3];}if(_0x1f215b[_0x3d0ae3]&&_0x1f215b[_0x3d0ae3][_0x1395('0x4a')]===_0x1395('0xcd')){_0x12071f[_0x1395('0xce')](_0x12071f[_0x1395('0x22')][_0x1f215b[_0x3d0ae3][_0x1395('0xcb')]]);logger[_0x1395('0x6f')](_0x1395('0x156'),_0x169418,_0x3d0ae3,_0x1f215b[_0x3d0ae3][_0x1395('0xcb')]);delete _0x1f215b[_0x3d0ae3];}},0x2328);}});}});}}};Dialer[_0x1395('0x1c')][_0x1395('0x157')]=function(_0xd994fb){return Promise[_0x1395('0xb7')]()[_0x1395('0x47')](voiceQueueRt['getVoiceQueueRtPauses'](_0xd994fb))[_0x1395('0xa9')](loggerCatch(_0x1395('0x158')));};Dialer[_0x1395('0x1c')][_0x1395('0xce')]=function(_0x5e2e83){if(!_['isUndefined'](_0x5e2e83)&&_0x5e2e83!==null){if(typeof _0x5e2e83[_0x1395('0x89')]!=='undefined'){if(_0x5e2e83['originated']>0x0){_0x5e2e83[_0x1395('0x89')]-=0x1;}else{logger[_0x1395('0x6f')](_0x1395('0x159'));}}}else{logger[_0x1395('0x6f')](_0x1395('0x15a'));}};Dialer[_0x1395('0x1c')][_0x1395('0x15b')]=function(_0x35eef4,_0x11b8d0){var _0x42ac8f=this;return function(_0x3fd680){_0x42ac8f['updateOriginated'](_0x11b8d0);logger[_0x1395('0x6f')](_0x35eef4,util[_0x1395('0x4d')](_0x3fd680,{'showHidden':![],'depth':null}));};};Dialer[_0x1395('0x1c')][_0x1395('0x15c')]=function(_0xb17dea,_0x532ca7,_0x4e9739){var _0x3f5086={'state':0x19,'statedesc':_0x1395('0x15d')};this[_0x1395('0xce')](_0x532ca7);this[_0x1395('0x11e')](_[_0x1395('0x69')](_0x3f5086,_[_0x1395('0x7f')](_0x4e9739,['ContactId',_0x1395('0xe5'),_0x1395('0x15e'),_0x1395('0xe6'),_0x1395('0xe7')])),'[emptyContact][createHistory]',_0x1395('0x15f'));logger[_0x1395('0x6f')](_0xb17dea);};Dialer[_0x1395('0x1c')]['saveInDb']=function(_0x167bdc,_0x5d8ba1,_0x7d32bd){hopperUtils[_0x1395('0xe9')](_0x167bdc)['catch'](loggerCatch(_0x5d8ba1));hopperUtils[_0x1395('0xd5')](_0x167bdc)[_0x1395('0xa9')](loggerCatch(_0x7d32bd));};Dialer[_0x1395('0x1c')][_0x1395('0xe2')]=function(_0x49c74a,_0x544dd1){hopperUtils[_0x1395('0xe9')](_0x49c74a)['catch'](loggerCatch(_0x1395('0x160')));if(_0x544dd1==0x0){hopperUtils['moveContactManagedDialer'](_0x49c74a)[_0x1395('0xa9')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x1395('0x1c')]['checkPreviewRecallReminder']=function(_0xec0cb8){return Promise[_0x1395('0xb7')]()[_0x1395('0x47')](cmHopper['handlePreviewRecallNotifications'](_0xec0cb8['id'],previewRecallmeReminderInterval))[_0x1395('0x47')](function(_0xf5f7b0){for(var _0x5715d3=0x0;_0x5715d3<_0xf5f7b0[_0x1395('0x105')];_0x5715d3++){var _0x37b476=_0xf5f7b0[_0x5715d3][_0x1395('0x14e')][_0x1395('0x4f')];if(_0x37b476)io['to'](util[_0x1395('0x91')](_0x1395('0x161'),_0x37b476))[_0x1395('0x11b')]('user:dialPreviewRecallReminder',{'hopper':_0xf5f7b0[_0x5715d3]});}})[_0x1395('0xa9')](function(){});};Dialer[_0x1395('0x1c')][_0x1395('0x162')]=function(_0x5377e8){var _0x3c170c=this;return function(){_0x3c170c[_0x1395('0x163')](_0x5377e8);};};Dialer[_0x1395('0x1c')]['actionOriginate']=function(_0x4b6d68,_0x2f4d40){var _0x2d96fa=this;var _0x257eba=uuid['v4']();this['actions'][_0x257eba]=new Action(_0x4b6d68,_0x2f4d40,_0x257eba);return new Promise(function(_0x459dc7,_0x310a44){if(_[_0x1395('0x49')](_0x4b6d68)&&typeof _0x4b6d68!==_0x1395('0x164')){return _0x310a44(msgResponse('originate',_0x1395('0x9c'),'voiceQueue\x20is\x20undefine'));}if(_[_0x1395('0x49')](_0x2f4d40['phone'])||_0x2f4d40[_0x1395('0x165')]===null){return _0x310a44(msgResponse(_0x1395('0x166'),_0x1395('0x9c'),_0x1395('0x167')));}var _0x162362={'XMD-CALLERID':_0x2d96fa['actions'][_0x257eba][_0x1395('0x168')](),'XMD-AGI':_0x4b6d68[_0x1395('0x139')]?util[_0x1395('0x91')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4b6d68['dialQueueProject']):_0x1395('0x169'),'XMD-AGIAFTER':_0x4b6d68[_0x1395('0xd3')]?util['format'](_0x1395('0x16a'),ipAgi,_0x4b6d68[_0x1395('0xd3')]):_0x1395('0x169'),'XMD-QUEUE':utils[_0x1395('0x16b')](_0x4b6d68)?util['format']('\x22%s,%s%s,,,%s\x22',_0x4b6d68[_0x1395('0x4f')],_0x4b6d68[_0x1395('0x16c')]||'',_0x4b6d68[_0x1395('0xd4')]?'c':'',_0x4b6d68['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x2f4d40[_0x1395('0xf2')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2d96fa[_0x1395('0x27')][_0x257eba][_0x1395('0x168')](),'XMD-AMD':_0x4b6d68[_0x1395('0x115')]?_0x1395('0x144'):'NONE','XMD-DESTINATION':_0x1395('0x16d')};if(_0x4b6d68[_0x1395('0x115')]){_0x162362[_0x1395('0x16e')]=_0x4b6d68[_0x1395('0x16f')]||0x9c4;_0x162362[_0x1395('0x170')]=_0x4b6d68['dialAMDGreeting']||0x5dc;_0x162362['XMD-AMDAFTERGREETINGSILENCE']=_0x4b6d68[_0x1395('0x171')]||0x320;_0x162362['XMD-AMDTOTALANALYSISTIME']=_0x4b6d68[_0x1395('0x172')]||0x1388;_0x162362['XMD-AMDMINWORDLENGTH']=_0x4b6d68['dialAMDMinWordLength']||0x64;_0x162362[_0x1395('0x173')]=_0x4b6d68[_0x1395('0x174')]||0x32;_0x162362[_0x1395('0x175')]=_0x4b6d68['dialAMDMaximumNumberOfWords']||0x3;_0x162362['XMD-AMDSILENCETHRESHOLD']=_0x4b6d68[_0x1395('0x176')]||0x100;_0x162362[_0x1395('0x177')]=_0x4b6d68[_0x1395('0x178')]||0x1388;}if(utils[_0x1395('0x16b')](_0x4b6d68)){_0x162362[_0x1395('0x179')]=_0x2f4d40[_0x1395('0xe6')];}else{_0x162362[_0x1395('0x17a')]=_0x2f4d40[_0x1395('0xe7')];}var _0x2d68cf=utils['setXMDContactVariables'](_0x2f4d40[_0x1395('0x17b')]);Object[_0x1395('0x146')](_0x162362,_0x2d68cf);var _0x4a6f47=_0x2d96fa['isTrunkReachable'](_0x4b6d68[_0x1395('0x17c')])?utils[_0x1395('0x17d')](_0x4b6d68[_0x1395('0x17c')]['callerid'],_0x4b6d68[_0x1395('0x17e')],_0x4b6d68[_0x1395('0x17f')]>0x0?utils['getCallerIdRandom'](_0x4b6d68[_0x1395('0x180')],_0x4b6d68[_0x1395('0x17f')]):_0x4b6d68[_0x1395('0x180')]):utils[_0x1395('0x17d')](_[_0x1395('0xff')](_0x4b6d68[_0x1395('0x96')])?_0x4b6d68[_0x1395('0x17c')][_0x1395('0x181')]:_0x4b6d68[_0x1395('0x96')]['callerid'],_0x4b6d68[_0x1395('0x17e')],_0x4b6d68[_0x1395('0x17f')]>0x0?utils[_0x1395('0x182')](_0x4b6d68['dialOriginateCallerIdNumber'],_0x4b6d68[_0x1395('0x17f')]):_0x4b6d68[_0x1395('0x180')]);if(_0x4a6f47){_0x162362[_0x1395('0x183')]=_0x2d96fa[_0x1395('0x27')][_0x257eba][_0x1395('0x184')]=utils[_0x1395('0x185')](_0x4a6f47);_0x162362[_0x1395('0x186')]=_0x2f4d40['phone'];}_0x4b6d68[_0x1395('0x187')]=_0x162362;return ami[_0x1395('0xa4')]({'actionid':_0x257eba,'action':_0x1395('0x166'),'channel':_0x2d96fa['isTrunkReachable'](_0x4b6d68[_0x1395('0x17c')])?util['format'](_0x1395('0x188'),_0x4b6d68[_0x1395('0x17c')]['name'],isNotNull(_0x4b6d68[_0x1395('0x189')])?_0x4b6d68['dialPrefix'][_0x1395('0x18a')]()||'':'',_0x4b6d68['dialCutDigit']>0x0?_0x2f4d40['phone']['substring'](_0x4b6d68[_0x1395('0x18b')]):_0x2f4d40[_0x1395('0x165')]):util[_0x1395('0x91')](_0x1395('0x188'),_[_0x1395('0xff')](_0x4b6d68[_0x1395('0x96')])?_0x4b6d68[_0x1395('0x17c')]['name']:_0x4b6d68['TrunkBackup'][_0x1395('0x4f')],isNotNull(_0x4b6d68['dialPrefix'])?_0x4b6d68[_0x1395('0x189')][_0x1395('0x18a')]()||'':'',_0x4b6d68[_0x1395('0x18b')]>0x0?_0x2f4d40[_0x1395('0x165')][_0x1395('0x18c')](_0x4b6d68[_0x1395('0x18b')]):_0x2f4d40[_0x1395('0x165')]),'callerid':_0x4a6f47,'Exten':_0x1395('0x16d'),'Context':'from-sip','Priority':'1','variable':_0x162362,'timeout':(_0x4b6d68[_0x1395('0x18d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x257eba})[_0x1395('0x47')](function(_0x45ebed){return _0x459dc7(_0x45ebed);})[_0x1395('0xa9')](function(_0xf02af9){_0x4b6d68[_0x1395('0x18e')]+=0x1;var _0x593193=new History(_0x2d96fa[_0x1395('0x27')][_0x257eba]);logger[_0x1395('0x6f')](util['format'](_0x1395('0x18f'),JSON[_0x1395('0x7e')](_0xf02af9)));_0x593193['state']=0xe;_0x593193[_0x1395('0x78')]=_0x1395('0x190');_0x593193[_0x1395('0x7a')]=moment()[_0x1395('0x91')](_0x1395('0xcf'));_0x593193['endtime']=_0x593193['starttime'];hopperUtils[_0x1395('0xe9')](_0x593193)[_0x1395('0xa9')](loggerCatch(_0x1395('0x191')));_0x2d96fa[_0x1395('0xd5')](_0x593193)['catch'](loggerCatch(_0x1395('0x191')))[_0x1395('0x1e')](function(){delete _0x2d96fa[_0x1395('0x27')][_0x257eba];return _0x310a44(msgResponse('originate',_0x1395('0x8e'),'originate\x20action\x20Error'));});});});};Dialer[_0x1395('0x1c')][_0x1395('0x192')]=function(_0x397375,_0x55257f,_0x176cd6){var _0x54bd86=new History(_0x55257f);if(_0x54bd86[_0x1395('0x124')]+_0x54bd86['countcongestionretry']+_0x54bd86['countnoanswerretry']+_0x54bd86['countnosuchnumberretry']+_0x54bd86[_0x1395('0xdb')]+_0x54bd86[_0x1395('0xf0')]+_0x54bd86['countmachineretry']+_0x54bd86['countagentrejectretry']>=_0x176cd6[_0x1395('0x128')]-0x1){return!![];}switch(_0x397375){case 0x3:if(_0x54bd86[_0x1395('0x126')]>=_0x176cd6['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x1395('0xe3')]({'active':![],'countnoanswerretry':_0x54bd86[_0x1395('0x126')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0x193')],_0x1395('0x12e'))['format'](_0x1395('0xcf')),'ContactId':_0x54bd86['ContactId'],'ListId':_0x54bd86[_0x1395('0xe5')],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x54bd86[_0x1395('0x124')]>=_0x176cd6[_0x1395('0x194')]-0x1){return!![];}hopperUtils[_0x1395('0xe3')]({'active':![],'countbusyretry':_0x54bd86[_0x1395('0x124')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6['dialBusyRetryFrequency'],_0x1395('0x12e'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54bd86[_0x1395('0xf2')],'ListId':_0x54bd86[_0x1395('0xe5')],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86['CampaignId']||undefined})[_0x1395('0xa9')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x54bd86[_0x1395('0x125')]>=_0x176cd6[_0x1395('0x195')]-0x1){return!![];}hopperUtils[_0x1395('0xe3')]({'active':![],'countcongestionretry':_0x54bd86['countcongestionretry']+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0x196')],_0x1395('0x12e'))[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x54bd86[_0x1395('0xf2')],'ListId':_0x54bd86[_0x1395('0xe5')],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86['CampaignId']||undefined})['catch'](loggerCatch(_0x1395('0x197')));break;case 0x0:if(_0x54bd86[_0x1395('0x127')]>=_0x176cd6[_0x1395('0x198')]-0x1){return!![];}else{hopperUtils[_0x1395('0xe3')]({'active':![],'countnosuchnumberretry':_0x54bd86[_0x1395('0x127')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0x199')],_0x1395('0x12e'))['format'](_0x1395('0xcf')),'ContactId':_0x54bd86[_0x1395('0xf2')],'ListId':_0x54bd86['ListId'],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x54bd86[_0x1395('0xdb')]>=_0x176cd6[_0x1395('0xe1')]-0x1){return!![];}hopperUtils[_0x1395('0xe3')]({'active':![],'countdropretry':_0x54bd86[_0x1395('0xdb')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0xdd')],_0x1395('0x12e'))[_0x1395('0x91')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54bd86[_0x1395('0xf2')],'ListId':_0x54bd86[_0x1395('0xe5')],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x19a')));break;case 0xb:if(_0x54bd86[_0x1395('0xf0')]>=_0x176cd6[_0x1395('0xf1')]-0x1){return!![];}hopperUtils[_0x1395('0xe3')]({'active':![],'countabandonedretry':_0x54bd86[_0x1395('0xf0')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0xee')],'minutes')[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x54bd86['ContactId'],'ListId':_0x54bd86[_0x1395('0xe5')],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86['CampaignId']||undefined})['catch'](loggerCatch(_0x1395('0xf3')));break;case 0x13:if(_0x54bd86[_0x1395('0x122')]>=_0x176cd6['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x54bd86[_0x1395('0x122')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0x12d')],_0x1395('0x12e'))[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x54bd86[_0x1395('0xf2')],'ListId':_0x54bd86['ListId'],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86['CampaignId']||undefined})[_0x1395('0xa9')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x54bd86[_0x1395('0x19b')]>=_0x176cd6[_0x1395('0x19c')]-0x1){return!![];}hopperUtils[_0x1395('0xe3')]({'active':![],'countagentrejectretry':_0x54bd86[_0x1395('0x19b')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0x19d')],_0x1395('0x12e'))[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x54bd86['ContactId'],'ListId':_0x54bd86[_0x1395('0xe5')],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x19e')));break;default:return!![];}};Dialer[_0x1395('0x1c')][_0x1395('0x111')]=function(_0xa70dfe,_0x3d9123,_0x4cfd5e){var _0x1ef4b8=this;var _0x3ebe9a=new History(_0xa70dfe);var _0x2b9c87=![];var _0x327995;var _0x38d79c;return new Promise(function(_0x2c036c,_0x1c0f3c){if(_[_0x1395('0x49')](_0x3d9123)&&typeof _0x3d9123!==_0x1395('0x164')){return _0x1c0f3c(msgResponse(_0x1395('0x19f'),_0x1395('0x9c'),_0x1395('0x1a0')));}if(_[_0x1395('0x49')](_0x4cfd5e)&&typeof _0x4cfd5e!==_0x1395('0x164')){return _0x1c0f3c(msgResponse(_0x1395('0x19f'),'Failure','evt\x20is\x20undefine'));}hopperUtils[_0x1395('0xdf')](_0x3ebe9a,_0x4cfd5e[_0x1395('0xd1')],_0x3d9123)['then'](function(_0x12f6ba){if(_0x12f6ba[_0x1395('0xe0')]==0x1)_0x2b9c87=!![];switch(_0x4cfd5e[_0x1395('0xd1')]){case'0':_0x3d9123[_0x1395('0x1a1')]+=0x1;_0x3ebe9a[_0x1395('0x77')]=0x0;_0x3ebe9a[_0x1395('0x78')]=_0x1395('0x1a2');_0x3ebe9a[_0x1395('0x127')]+=0x1;_0x3ebe9a[_0x1395('0xdc')]+=0x1;ami['emit'](_0x1395('0x1a3'),ut[_0x1395('0x11d')](_0xa70dfe,'nosuchnumber'));_0x327995=_0x3d9123[_0x1395('0x199')];_0x38d79c=_0x3d9123[_0x1395('0xde')];hopperUtils[_0x1395('0xe9')](_0x3ebe9a)[_0x1395('0xa9')](loggerCatch(_0x1395('0x1a4')));if(_0x1ef4b8[_0x1395('0x192')](0x0,_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a[_0x1395('0x127')]>=_0x3d9123['dialNoSuchNumberMaxRetry']){_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,'reason\x200\x20no\x20such\x20number....');}else{_0x1ef4b8[_0x1395('0x129')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1a5'));}}break;case'3':_0x3d9123[_0x1395('0x1a6')]+=0x1;_0x3ebe9a[_0x1395('0x77')]=0x3;_0x3ebe9a[_0x1395('0x78')]=_0x1395('0x1a7');_0x3ebe9a['countnoanswerretry']+=0x1;_0x3ebe9a['countglobal']+=0x1;var _0x21c55c=ut[_0x1395('0x1a8')](_0xa70dfe,_0x3d9123);ami[_0x1395('0x11b')](_0x1395('0x1a9'),_0x21c55c);_0x327995=_0x3d9123[_0x1395('0x193')];_0x38d79c=_0x3d9123[_0x1395('0xde')];hopperUtils[_0x1395('0xe9')](_0x3ebe9a)['catch'](loggerCatch(_0x1395('0x1aa')));if(_0x1ef4b8[_0x1395('0x192')](0x3,_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a[_0x1395('0x126')]>=_0x3d9123[_0x1395('0x1ab')]){_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1ac'));}else{_0x1ef4b8['stateGlobal'](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1ac'));}}break;case'5':_0x3d9123[_0x1395('0x1ad')]+=0x1;_0x3ebe9a[_0x1395('0x77')]=0x5;_0x3ebe9a[_0x1395('0x78')]='Busy';_0x3ebe9a[_0x1395('0x124')]+=0x1;_0x3ebe9a['countglobal']+=0x1;ami[_0x1395('0x11b')](_0x1395('0x1ae'),ut[_0x1395('0x11d')](_0xa70dfe,_0x1395('0x1af')));_0x327995=_0x3d9123[_0x1395('0x1b0')];_0x38d79c=_0x3d9123[_0x1395('0xde')];hopperUtils[_0x1395('0xe9')](_0x3ebe9a)[_0x1395('0xa9')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1ef4b8[_0x1395('0x192')](0x5,_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a['countbusyretry']>=_0x3d9123['dialBusyMaxRetry']){_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1b1'));}else{_0x1ef4b8[_0x1395('0x129')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1b1'));}}break;case'8':_0x3d9123[_0x1395('0x1b2')]+=0x1;_0x3ebe9a[_0x1395('0x77')]=0x8;_0x3ebe9a[_0x1395('0x78')]=_0x1395('0x1b3');_0x3ebe9a[_0x1395('0x125')]+=0x1;_0x3ebe9a[_0x1395('0xdc')]+=0x1;_0x327995=_0x3d9123[_0x1395('0x196')];_0x38d79c=_0x3d9123[_0x1395('0xde')];ami[_0x1395('0x11b')](_0x1395('0x1b4'),ut[_0x1395('0x11d')](_0xa70dfe,'congestion'));hopperUtils[_0x1395('0xe9')](_0x3ebe9a)['catch'](loggerCatch(_0x1395('0x1b5')));if(_0x1ef4b8[_0x1395('0x192')](0x8,_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a[_0x1395('0x125')]>=_0x3d9123[_0x1395('0x195')]){_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1b6'));}else{_0x1ef4b8[_0x1395('0x129')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1b6'));}}break;case'11':_0x3d9123[_0x1395('0x1b7')]+=0x1;_0x3ebe9a['state']=0xb;_0x3ebe9a[_0x1395('0x78')]='Abandoned';_0x3ebe9a[_0x1395('0xf0')]+=0x1;_0x3ebe9a[_0x1395('0xdc')]+=0x1;_0x327995=_0x3d9123['dialAbandonedRetryFrequency'];_0x38d79c=_0x3d9123[_0x1395('0xde')];hopperUtils['createHistory'](_0x3ebe9a)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x1ef4b8[_0x1395('0x192')](0xb,_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a['countabandonedretry']>=_0x3d9123[_0x1395('0xf1')]){_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1b8'));}else{_0x1ef4b8[_0x1395('0x129')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1b8'));}}break;case'20':_0x3d9123['outboundRejectCallsDay']+=0x1;_0x3ebe9a[_0x1395('0x77')]=0x14;_0x3ebe9a[_0x1395('0x78')]=_0x1395('0x1b9');_0x3ebe9a[_0x1395('0x19b')]+=0x1;_0x3ebe9a['countglobal']+=0x1;_0x327995=_0x3d9123[_0x1395('0x19d')];_0x38d79c=_0x3d9123['callAdditionalPhoneAfterMin'];ami['emit'](_0x1395('0x1ba'),ut[_0x1395('0x11d')](_0xa70dfe,'agentreject'));hopperUtils[_0x1395('0xe9')](_0x3ebe9a)[_0x1395('0xa9')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x1ef4b8[_0x1395('0x192')](0x14,_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a['countagentrejectretry']>=_0x3d9123[_0x1395('0x19c')]){_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1bb'));}else{_0x1ef4b8[_0x1395('0x129')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,'reason\x2020\x20agentreject');}}break;default:_0x3d9123[_0x1395('0x13a')]+=0x1;_0x3ebe9a[_0x1395('0x77')]=0xc;_0x3ebe9a[_0x1395('0x78')]=_0x4cfd5e[_0x1395('0xd1')];_0x327995=_0x3d9123['dialAgentRejectRetryFrequency'];_0x38d79c=_0x3d9123['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x3ebe9a)[_0x1395('0xa9')](loggerCatch(_0x1395('0x1bc')));if(_0x1ef4b8[_0x1395('0x192')](_0x4cfd5e['reason'],_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a['countbusyretry']+_0x3ebe9a[_0x1395('0x125')]+_0x3ebe9a[_0x1395('0x126')]+_0x3ebe9a[_0x1395('0x127')]+_0x3ebe9a['countdropretry']+_0x3ebe9a['countabandonedretry']+_0x3ebe9a[_0x1395('0x122')]+_0x3ebe9a['countagentrejectretry']>=_0x3d9123[_0x1395('0x128')]){_0x1ef4b8[_0x1395('0x129')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x4cfd5e['reason']);}else{_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x4cfd5e[_0x1395('0xd1')]);}}}})[_0x1395('0x47')](function(){if(_0x2b9c87){hopperUtils['swapAdditionalPhones'](_0x3ebe9a,_0x327995,_0x38d79c)[_0x1395('0x47')](function(){return _0x2c036c(0x1);});}});});};Dialer['prototype'][_0x1395('0x129')]=function(_0x1951d4,_0xcf6e60,_0x2bfcfa,_0x3b700f){var _0x259afe=new Final(_0x1951d4);_0x259afe[_0x1395('0x77')]=0xf;_0x259afe[_0x1395('0x78')]=_0x1395('0x1bd');this[_0x1395('0x12b')](_0x259afe,_0xcf6e60,_0x2bfcfa,_0x3b700f);};Dialer[_0x1395('0x1c')][_0x1395('0x12b')]=function(_0x4f8031,_0x4b92cf,_0x57eb6e,_0x542dfe){hopperUtils[_0x1395('0xd5')](_0x4f8031)[_0x1395('0x47')](function(){return _0x4b92cf(msgResponse(_0x1395('0x19f'),_0x1395('0x110'),_0x542dfe));})[_0x1395('0xa9')](function(){return _0x57eb6e(msgResponse(_0x1395('0x1be'),_0x1395('0x9c'),_0x1395('0x1bf')));});};Dialer[_0x1395('0x1c')]['predictive']=function(_0x3e0067){var _0x5901ed=_0x3e0067[_0x1395('0x1c0')]/0x64;var _0x1fd0b1=_0x3e0067[_0x1395('0x1c1')]/(_0x3e0067[_0x1395('0x1c1')]+_0x3e0067[_0x1395('0xd0')]);var _0x566d81=Math[_0x1395('0x1c2')](_0x3e0067[_0x1395('0x1c3')]*(_0x3e0067[_0x1395('0x1c4')]/0x64));var _0x88bb4d=Math[_0x1395('0x1c2')](_0x3e0067[_0x1395('0x1c3')]*(_0x3e0067[_0x1395('0x1c5')]/0x64));var _0x2d0abc=_0x3e0067[_0x1395('0x140')]+_0x3e0067[_0x1395('0x142')];var _0x5bd70e=Math[_0x1395('0x1c6')](_0x3e0067[_0x1395('0x62')]*_0x3e0067[_0x1395('0x65')]*_0x3e0067[_0x1395('0x1c7')]*_0x3e0067['predictiveIntervalMultiplicativeFactor']);if(_[_0x1395('0x49')](_0x3e0067[_0x1395('0x2b')])){if(!_['isUndefined'](_0x3e0067[_0x1395('0x2a')])){_0x3e0067[_0x1395('0x2a')]=undefined;loggerPredictive[_0x1395('0x6f')](_0x1395('0x1c8'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x1395('0x49')](_0x3e0067['handlePredictive'])){loggerPredictive[_0x1395('0x6f')]('[startMethodPredictive][StartProgressive]',_0x1395('0x1c9'));clearInterval(_0x3e0067[_0x1395('0x6d')]);_0x3e0067[_0x1395('0x6d')]=undefined;}_0x3e0067[_0x1395('0x2b')]=moment()[_0x1395('0x91')](_0x1395('0xcf'));loggerPredictive[_0x1395('0x53')](_0x3e0067[_0x1395('0x4f')],_0x1395('0x1ca'),_0x3e0067[_0x1395('0x2b')]);this[_0x1395('0xbf')](_0x3e0067,0x1);}else if(ifInterval(_0x3e0067[_0x1395('0x1cb')],_0x3e0067['startProgressive'])){this[_0x1395('0xbf')](_0x3e0067,0x1);loggerPredictiveCalls[_0x1395('0x53')](_0x1395('0x1cc'),_0x3e0067['startProgressive'],_0x3e0067['name']);_0x3e0067[_0x1395('0x62')]=0x0;_0x3e0067[_0x1395('0x1cd')]=0x0;}else if(_0x5901ed<_0x1fd0b1&&_0x3e0067[_0x1395('0x1ce')]==='dropRate'){clearPredictiveAttributes(_0x3e0067);loggerPredictive[_0x1395('0x53')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x1395('0x1cf'),_0x1fd0b1,_0x1395('0x2b'),_0x3e0067[_0x1395('0x4f')]);}else if(_0x5bd70e<_0x3e0067[_0x1395('0x1cd')]&&_0x3e0067[_0x1395('0x1ce')]===_0x1395('0x1d0')){clearPredictiveAttributes(_0x3e0067);loggerPredictive['info'](_0x1395('0x1d1'),_0x1395('0x1d2'),_0x5bd70e,_0x1395('0x1d3'),_0x3e0067['predictiveIntervalErlangCallsDroppedCalls'],_0x1395('0x2b'),_0x3e0067[_0x1395('0x4f')]);}else if(!ifInterval(_0x3e0067[_0x1395('0x1cb')],_0x3e0067['startProgressive'])&&_['isUndefined'](_0x3e0067[_0x1395('0x2a')])&&!_['isUndefined'](_0x3e0067[_0x1395('0x2b')])){_0x3e0067[_0x1395('0x2a')]=moment()[_0x1395('0x91')](_0x1395('0xcf'));loggerPredictive[_0x1395('0x53')](_0x3e0067['name'],'started\x20in\x20predictive\x20at',_0x3e0067[_0x1395('0x2a')]);hopperUtils[_0x1395('0x1d4')](_0x3e0067[_0x1395('0x1cb')])['then'](this[_0x1395('0x1d5')](_0x3e0067))[_0x1395('0x47')](mergeDataErlangB(_0x3e0067))[_0x1395('0x47')](this[_0x1395('0x1d6')](_0x3e0067))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x3e0067));}else if(!ifInterval(_0x3e0067[_0x1395('0x1cb')],_0x3e0067['startPredictive'])){_0x3e0067['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x3e0067[_0x1395('0x2a')]=moment()[_0x1395('0x91')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x3e0067[_0x1395('0x4f')],_0x1395('0x1d7'),_0x3e0067[_0x1395('0x2a')]);clearInterval(_0x3e0067[_0x1395('0x6d')]);_0x3e0067[_0x1395('0x6d')]=undefined;hopperUtils['avgHandleTime'](_0x3e0067[_0x1395('0x1cb')])[_0x1395('0x47')](this[_0x1395('0x1d5')](_0x3e0067))[_0x1395('0x47')](mergeDataErlangB(_0x3e0067))[_0x1395('0x47')](this['startMethodPredictive'](_0x3e0067))['catch'](loggerCatchPredictive(_0x1395('0x1d8'),_0x3e0067));}else if(_0x3e0067[_0x1395('0x1c3')]&&_0x2d0abc<_0x3e0067[_0x1395('0x1c3')]-_0x88bb4d){clearPredictiveAttributes(_0x3e0067);loggerPredictive[_0x1395('0x53')](_0x3e0067[_0x1395('0x4f')],_0x1395('0x1d9'),_0x2d0abc,_0x1395('0x1da'),_0x3e0067[_0x1395('0x1c3')],'-',_0x88bb4d,'=',_0x3e0067['predictiveIntervalAvailable']-_0x88bb4d,')');}else if(_0x3e0067[_0x1395('0x1c3')]&&_0x2d0abc>_0x3e0067[_0x1395('0x1c3')]+_0x566d81){clearPredictiveAttributes(_0x3e0067);loggerPredictive[_0x1395('0x53')](_0x3e0067[_0x1395('0x4f')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x2d0abc,_0x1395('0x1db'),_0x3e0067[_0x1395('0x1c3')],'+',_0x566d81,'=',_0x3e0067['predictiveIntervalAvailable']+_0x566d81,')');}};Dialer[_0x1395('0x1c')]['getDataPredictive']=function(_0x12c719){var _0x1eca71=this;return function(_0x552247){return new Promise(function(_0x5911c5,_0xbf249e){_[_0x1395('0x69')](_0x12c719,_0x552247[0x0]);if(checkGetDataPredictive(_0x552247[0x0])){var _0x2bf2bc=_0x12c719[_0x1395('0x1c3')]=_0x12c719[_0x1395('0x142')]+_0x12c719[_0x1395('0x140')];var _0x29f62d=_0x12c719[_0x1395('0x1cb')]*0x3c;var _0xe4009e=_0x552247[0x0]['predictiveIntervalAvgTalktime']+_0x552247[0x0]['predictiveIntervalAvgHoldtime'];var _0x9f7622=(_0x552247[0x0][_0x1395('0x56')]+_0x552247[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x552247[0x0][_0x1395('0x59')])/_0x552247[0x0]['predictiveIntervalTotalCalls'];_0x12c719[_0x1395('0x1c7')]=_0x9f7622>0x0?_0x9f7622:0x1;switch(_0x12c719[_0x1395('0x1ce')]){case _0x1395('0x1d0'):var _0x539f62=_0x12c719[_0x1395('0x1c0')]/0x64;return _0x1eca71[_0x1395('0x1dc')](_0x2bf2bc,_0x29f62d,_0xe4009e,_0x9f7622,_0x539f62)[_0x1395('0x47')](function(_0x350001){return _0x5911c5(_0x350001);});case'agentBusyFactor':var _0x3c33fe=_0x12c719[_0x1395('0x1c0')]/0x64;return _0x1eca71[_0x1395('0x1dd')](_0x2bf2bc,_0x29f62d,_0xe4009e,_0x9f7622,_0x3c33fe)['then'](function(_0x4b1109){return _0x5911c5(_0x4b1109);});default:return _0xbf249e(msgResponse(_0x1395('0x1de'),_0x1395('0x9c'),'Unknown\x20Predictive'));}}else{return _0xbf249e(msgResponse('[getDataPredictive]',_0x1395('0x9c'),_0x1395('0x1df')));}});};};Dialer[_0x1395('0x1c')][_0x1395('0x1e0')]=function(_0x59053b){var _0x388721=this;return function(_0x542500){return new Promise(function(_0x46965a,_0x2bc2e9){_[_0x1395('0x69')](_0x59053b,_0x542500[0x0]);if(checkGetDataPredictive(_0x542500[0x0])){loggerPredictive['info'](JSON['stringify'](_0x542500[0x0]));if(_0x59053b[_0x1395('0x1ce')]===_0x1395('0x1d0')){return _0x388721['getVoiceQueueRtPauses'](_0x59053b['id'])['then'](function(_0x4d06b3){var _0x12cf7c=_0x59053b[_0x1395('0x1e1')]-_0x4d06b3[0x0][_0x1395('0x1e2')];var _0xa1fe74=_0x59053b[_0x1395('0x1cb')]*0x3c;var _0x5a8ff9=_0x542500[0x0][_0x1395('0x5c')]+_0x542500[0x0][_0x1395('0x5b')];var _0x85a13a=(_0x542500[0x0]['predictiveIntervalAnsweredCalls']+_0x542500[0x0][_0x1395('0x58')]+_0x542500[0x0][_0x1395('0x59')])/_0x542500[0x0]['predictiveIntervalTotalCalls'];var _0x2ffb7b=_0x59053b[_0x1395('0x1c0')]/0x64;_0x59053b[_0x1395('0x1e3')]=_0x4d06b3[0x0]['outboundQueuePauses']||0x0;_0x59053b[_0x1395('0x1c7')]=_0x85a13a>0x0?_0x85a13a:0x1;return _0x388721['abandonmentRate'](_0x12cf7c,_0xa1fe74,_0x5a8ff9,_0x85a13a,_0x2ffb7b);})['then'](function(_0x2ed3ba){return _0x46965a(_0x2ed3ba);})[_0x1395('0xa9')](function(_0x23aa14){return _0x2bc2e9(msgResponse(_0x1395('0x1e4'),_0x1395('0x9c'),JSON['stringify'](_0x23aa14)));});}if(_0x59053b[_0x1395('0x1ce')]===_0x1395('0x1e5')){return _0x388721[_0x1395('0x157')](_0x59053b['id'])[_0x1395('0x47')](function(_0x3ea09e){var _0x2c6d6f=_0x59053b['loggedIn']-_0x3ea09e[0x0][_0x1395('0x1e2')];var _0x3d181a=_0x59053b[_0x1395('0x1cb')]*0x3c;var _0x29a286=_0x542500[0x0][_0x1395('0x5c')]+_0x542500[0x0][_0x1395('0x5b')];var _0x58492d=(_0x542500[0x0][_0x1395('0x56')]+_0x542500[0x0][_0x1395('0x58')]+_0x542500[0x0][_0x1395('0x59')])/_0x542500[0x0]['predictiveIntervalTotalCalls'];var _0x6d2cc1=_0x59053b[_0x1395('0x1c0')]/0x64;_0x59053b[_0x1395('0x1e3')]=_0x3ea09e[0x0][_0x1395('0x1e2')]||0x0;_0x59053b['predictiveIntervalHitRate']=_0x58492d>0x0?_0x58492d:0x1;return _0x388721['busyFactor'](_0x2c6d6f,_0x3d181a,_0x29a286,_0x58492d,_0x6d2cc1);})[_0x1395('0x47')](function(_0x4ef951){return _0x46965a(_0x4ef951);})[_0x1395('0xa9')](function(_0x22f2cb){return _0x2bc2e9(msgResponse(_0x1395('0x1e4'),_0x1395('0x9c'),JSON['stringify'](_0x22f2cb)));});}}else{return _0x2bc2e9(msgResponse('[getDataPredictive]','Failure',_0x1395('0x1df')));}});};};Dialer[_0x1395('0x1c')][_0x1395('0x1d6')]=function(_0x586daa){var _0x34385a=this;return function(){var _0x14a83f=0x0;var _0x421049=Math['floor'](_0x586daa[_0x1395('0x1e6')]*0x3e8);if(_0x421049>0x0){_0x421049=_0x421049<0x64?0x64:_0x421049;loggerPredictive[_0x1395('0x53')](_0x586daa[_0x1395('0x4f')],_0x1395('0x1e7'),_0x421049,'milliseconds');_0x586daa['handlePredictive']=setInterval(function(){_0x34385a[_0x1395('0x6d')](_0x586daa);loggerPredictiveCalls[_0x1395('0x53')](_0x1395('0x1e8'),_0x14a83f+=0x1);},_0x421049);}else{loggerPredictive['info'](_0x586daa[_0x1395('0x4f')],_0x1395('0x1e9'));}};};Dialer[_0x1395('0x1c')][_0x1395('0x1ea')]=function(_0x25189,_0x185a0d){var _0x1d758a=this;return function(_0x3017ca){if(_[_0x1395('0x51')](_0x3017ca)){if(_[_0x1395('0xff')](_0x185a0d[_0x1395('0x15e')])||!_0x185a0d[_0x1395('0x1eb')]){if(_0x25189[_0x1395('0xbd')]==='booked'){_0x25189['queueStatusComplete']=_[_0x1395('0x49')](_0x25189[_0x1395('0x7b')])?!![]:_0x25189[_0x1395('0x7b')];var _0x268bef=uuid['v4']();_0x1d758a[_0x1395('0x27')][_0x268bef]=new Action(_0x25189,_0x185a0d,_0x268bef);loggerBooked[_0x1395('0x53')](_0x1395('0x1ec'),_0x268bef,_0x1395('0x1ed'),JSON[_0x1395('0x7e')](_0x25189[_0x1395('0x7b')]),_0x1395('0x1ee'),_0x25189[_0x1395('0x4f')]);if(_0x25189[_0x1395('0x7b')]){_0x25189[_0x1395('0x7b')]=![];_0x1d758a[_0x1395('0x2d')][_0x1d758a['actions'][_0x268bef][_0x1395('0xcb')]]=[];ami['Action']({'actionid':_0x268bef,'action':_0x1395('0x1ef'),'queue':_0x25189[_0x1395('0x4f')]})['catch'](function(){_0x1d758a[_0x1395('0xce')](_0x25189);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x1d758a[_0x1395('0x27')][_0x268bef][_0x1395('0xf2')],'ListId':_0x1d758a[_0x1395('0x27')][_0x268bef][_0x1395('0xe5')],'VoiceQueueId':_0x1d758a[_0x1395('0x27')][_0x268bef][_0x1395('0xe6')]||undefined,'CampaignId':_0x1d758a[_0x1395('0x27')][_0x268bef]['CampaignId']||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x1f0')));delete _0x1d758a['actions'][_0x268bef];});}else{loggerBooked['info'](_0x1395('0x1f1'),JSON[_0x1395('0x7e')](_0x25189['queueStatusComplete']),_0x1395('0x1ee'),_0x25189[_0x1395('0x4f')]);_0x1d758a[_0x1395('0xce')](_0x25189);hopperUtils[_0x1395('0xe3')]({'active':![],'ContactId':_0x1d758a[_0x1395('0x27')][_0x268bef][_0x1395('0xf2')],'ListId':_0x1d758a['actions'][_0x268bef][_0x1395('0xe5')],'VoiceQueueId':_0x1d758a[_0x1395('0x27')][_0x268bef][_0x1395('0xe6')]||undefined,'CampaignId':_0x1d758a[_0x1395('0x27')][_0x268bef][_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x1f0')));delete _0x1d758a[_0x1395('0x27')][_0x268bef];}}else{return _0x1d758a[_0x1395('0x1f2')](_0x25189,_0x185a0d);}}else{if(utils[_0x1395('0x6a')](undefined,_0x185a0d[_0x1395('0x1f3')])<_0x25189[_0x1395('0x1f4')]*0x3c){if(_0x185a0d[_0x1395('0x14e')]&&!_0x185a0d[_0x1395('0x14e')][_0x1395('0x1f5')]){_0x1d758a[_0x1395('0x20')][_0x1395('0x101')](_0x185a0d['id'])[_0x1395('0x1e')](function(){_0x1d758a[_0x1395('0xce')](_0x25189);});}else{hopperUtils[_0x1395('0x1f6')]({'active':![]},_0x185a0d['id'],0x1)[_0x1395('0x1e')](function(){_0x1d758a[_0x1395('0xce')](_0x25189);});}}else{_0x25189[_0x1395('0x1f7')]+=0x1;_0x1d758a[_0x1395('0xce')](_0x25189);if(_0x25189['dialRecallInQueue']){hopperUtils[_0x1395('0xe3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x185a0d[_0x1395('0xf2')],'ListId':_0x185a0d[_0x1395('0xe5')],'VoiceQueueId':_0x185a0d['VoiceQueueId']||undefined,'CampaignId':_0x185a0d[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x1f8')));hopperUtils[_0x1395('0xe9')](createObjHistory(_0x25189,_0x185a0d,utils[_0x1395('0x81')][_0x1395('0x1f9')],0x17,'RecallInQueue'))[_0x1395('0xa9')](loggerCatch(_0x1395('0x1fa')));}else{_0x1d758a[_0x1395('0x11e')](createObjHistory(_0x25189,_0x185a0d,utils[_0x1395('0x81')][_0x1395('0x1fb')],0x16,_0x1395('0x1fc')),_0x1395('0x1fd'),'[Originate][HistoryRecallClose]');}}}}else{_0x25189['outboundBlacklistCallsDay']+=0x1;_0x1d758a[_0x1395('0x11e')](createObjHistory(_0x25189,_0x185a0d,utils[_0x1395('0x81')][_0x1395('0x1fe')],0xd,_0x1395('0x1ff')),_0x1395('0x200'),'[Originate][MoveBlacklist]');throw _0x1395('0x201');}};};Dialer['prototype']['handleIvr']=function(_0x31020e){var _0x57fd9f=this;var _0x575bc2=_0x31020e[_0x1395('0x202')]-_0x31020e['originated'];emitCampaignSummary(_0x31020e);if(_0x575bc2>0x0&&_0x31020e[_0x1395('0x71')]==0x0){if(_0x575bc2>this[_0x1395('0x25')]){_0x575bc2=this[_0x1395('0x25')];}_0x31020e[_0x1395('0x71')]=0x1;hopperUtils[_0x1395('0x203')](_0x31020e,_0x575bc2)['then'](function(_0x34f4fd){_0x31020e[_0x1395('0x71')]=0x0;if(_0x34f4fd){if(!utils[_0x1395('0x204')](_0x34f4fd)){_0x31020e[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x205')];logger[_0x1395('0x53')](_0x1395('0x206')+_0x31020e[_0x1395('0x4f')]);}else{_0x31020e[_0x1395('0x89')]+=_0x34f4fd[_0x1395('0x105')];_0x31020e[_0x1395('0x73')]=utils[_0x1395('0x81')]['RUNNING'];for(var _0xe5183d=0x0;_0xe5183d<_0x34f4fd[_0x1395('0x105')];_0xe5183d+=0x1){_0x31020e[_0x1395('0x207')]+=0x1;if(_[_0x1395('0xff')](_0x34f4fd[_0xe5183d])||_[_0x1395('0xff')](_0x34f4fd[_0xe5183d][_0x1395('0x17b')])||_[_0x1395('0xff')](_0x34f4fd[_0xe5183d]['phone'])){_0x57fd9f[_0x1395('0x15c')](_0x1395('0x208'),_0x31020e,_0x34f4fd[_0xe5183d]);}else{hopperUtils[_0x1395('0x209')](_[_0x1395('0x7f')](_0x34f4fd[_0xe5183d],[_0x1395('0xe7'),_0x1395('0x165')]))[_0x1395('0x47')](_0x57fd9f[_0x1395('0x1ea')](_0x31020e,_0x34f4fd[_0xe5183d]))[_0x1395('0xa9')](_0x57fd9f[_0x1395('0x15b')](_0x1395('0x20a'),_0x31020e));}}}}})[_0x1395('0xa9')](loggerGetContactDialer(_0x1395('0x20b'),_0x31020e,_0x575bc2));}};Dialer[_0x1395('0x1c')][_0x1395('0xbf')]=function(_0x2c6ebe,_0x541200){var _0x169af1=this;var _0x38b802=[];if(_0x541200<0x1||_0x2c6ebe['dialMethod']===_0x1395('0x8')){_0x541200=0x1;}var _0x53b35f=Math[_0x1395('0x1c6')](_0x2c6ebe[_0x1395('0x140')]*_0x541200)-_0x2c6ebe[_0x1395('0x89')];if(_0x2c6ebe[_0x1395('0x20c')]>0x0){var _0x5ca8bb=_0x2c6ebe[_0x1395('0x20c')]-_0x2c6ebe[_0x1395('0x89')]-_0x2c6ebe[_0x1395('0x142')]-_0x2c6ebe[_0x1395('0x143')];if(_0x53b35f>_0x5ca8bb){_0x53b35f=_0x5ca8bb;}}if(_0x53b35f>0x0&&_0x2c6ebe['temp']==0x0){if(_0x2c6ebe[_0x1395('0xbd')]===_0x1395('0x8')){_0x53b35f=0x1;}if(_0x53b35f>this[_0x1395('0x25')]){_0x53b35f=this[_0x1395('0x25')];}for(var _0x1ca329 in this[_0x1395('0x23')]){if(typeof this[_0x1395('0x23')][_0x1ca329]!==_0x1395('0xb4')){if(this[_0x1395('0x23')][_0x1ca329][_0x1395('0x77')]===_0x1395('0x20d')&&this[_0x1395('0x23')][_0x1ca329][_0x1395('0x92')]==='reachable'){_0x38b802[_0x1395('0xa3')](this[_0x1395('0x23')][_0x1ca329]['id']);}}}_0x2c6ebe[_0x1395('0x71')]=0x1;hopperUtils[_0x1395('0x20e')](_0x2c6ebe,_0x38b802,_0x53b35f)['then'](function(_0x312acd){_0x2c6ebe[_0x1395('0x71')]=0x0;if(_0x312acd){if(!utils[_0x1395('0x204')](_0x312acd)){hopperUtils[_0x1395('0x20f')](_0x2c6ebe)[_0x1395('0x47')](sendMessageReschedule(_0x2c6ebe))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x2c6ebe[_0x1395('0x89')]+=_0x312acd[_0x1395('0x105')];_0x2c6ebe[_0x1395('0x73')]=_0x2c6ebe['dialMethod']===_0x1395('0x8')?utils[_0x1395('0x81')][_0x1395('0x144')]:utils[_0x1395('0x81')][_0x1395('0x210')];for(var _0x243d66=0x0;_0x243d66<_0x312acd[_0x1395('0x105')];_0x243d66+=0x1){if(_[_0x1395('0xff')](_0x312acd[_0x243d66])||_['isNil'](_0x312acd[_0x243d66][_0x1395('0x17b')])||_[_0x1395('0xff')](_0x312acd[_0x243d66][_0x1395('0x165')])){_0x169af1[_0x1395('0x15c')](_0x1395('0x208'),_0x2c6ebe,_0x312acd[_0x243d66]);}else{hopperUtils[_0x1395('0x211')](_[_0x1395('0x7f')](_0x312acd[_0x243d66],['VoiceQueueId',_0x1395('0x165')]))['then'](_0x169af1[_0x1395('0x1ea')](_0x2c6ebe,_0x312acd[_0x243d66]))[_0x1395('0xa9')](_0x169af1[_0x1395('0x15b')](_0x1395('0x208'),_0x2c6ebe));}}}}})['catch'](loggerGetContactDialer(_0x1395('0x212'),_0x2c6ebe,_0x53b35f));}};Dialer[_0x1395('0x1c')][_0x1395('0x6d')]=function(_0x99f723){if(_0x99f723['dialLimitQueue']>0x0){var _0x2cc78e=_0x99f723[_0x1395('0x20c')]-_0x99f723[_0x1395('0x89')]-_0x99f723['talking'];if(_0x2cc78e>0x0&&_0x99f723[_0x1395('0x71')]==0x0){this['tryOriginatePredictive'](_0x99f723);}else{loggerPredictiveCalls[_0x1395('0x53')](_0x1395('0x213'));}}else{this['tryOriginatePredictive'](_0x99f723);}};Dialer[_0x1395('0x1c')][_0x1395('0x214')]=function(_0xa8ce07){var _0x1034f2=this;var _0x225606=[];_0xa8ce07['originated']+=0x1;for(var _0x394d5c in this['agents']){if(typeof this[_0x1395('0x23')][_0x394d5c]!=='undefined'){if(this[_0x1395('0x23')][_0x394d5c][_0x1395('0x77')]===_0x1395('0x20d')&&this[_0x1395('0x23')][_0x394d5c][_0x1395('0x92')]===_0x1395('0x93')){_0x225606['push'](this[_0x1395('0x23')][_0x394d5c]['id']);}}}_0xa8ce07[_0x1395('0x71')]=0x1;return this[_0x1395('0x20e')](_0xa8ce07['id'],_0x225606,0x1,_0xa8ce07[_0x1395('0x215')],_0xa8ce07)[_0x1395('0x47')](function(_0x542809){_0xa8ce07[_0x1395('0x71')]=0x1;if(_0x542809){if(!utils['checkContactEmpty'](_0x542809)){utils['checkContactLowerLimitOriginate'](_0xa8ce07,0x1,0x0);return hopperUtils[_0x1395('0x20f')](_0xa8ce07)[_0x1395('0x47')](sendMessageReschedule(_0xa8ce07))[_0x1395('0xa9')](loggerCatch('[countReScheduled]\x20'));}else{_0xa8ce07['message']=utils[_0x1395('0x81')][_0x1395('0x210')];if(_[_0x1395('0xff')](_0x542809[0x0])||_[_0x1395('0xff')](_0x542809[0x0][_0x1395('0x17b')])||_[_0x1395('0xff')](_0x542809[0x0][_0x1395('0x165')])){_0x1034f2[_0x1395('0x15c')](_0x1395('0x208'),_0xa8ce07,_0x542809[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x1395('0x7f')](_0x542809[0x0],[_0x1395('0xe6'),_0x1395('0x165')]))[_0x1395('0x47')](_0x1034f2[_0x1395('0x1ea')](_0xa8ce07,_0x542809[0x0]))[_0x1395('0xa9')](_0x1034f2['loggerHandler']('[actionOriginatePredictive]\x20',_0xa8ce07));}}}})[_0x1395('0xa9')](loggerGetContactDialer(_0x1395('0x216'),_0xa8ce07,0x1));};Dialer[_0x1395('0x1c')][_0x1395('0x1dc')]=function(_0x1791f5,_0x50dc8a,_0x58ed3d,_0xa7dba1,_0x302a6d,_0x31f5d2){loggerPredictive[_0x1395('0x53')](_0x1395('0x217'));loggerPredictive[_0x1395('0x53')](_0x1395('0x218'),_0x1791f5);loggerPredictive['info'](_0x1395('0x219'),_0x50dc8a);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58ed3d);loggerPredictive[_0x1395('0x53')](_0x1395('0x21a'),_0xa7dba1);loggerPredictive[_0x1395('0x53')](_0x1395('0x21b'),_0x302a6d);loggerPredictive[_0x1395('0x53')](_0x1395('0x68'));return new Promise(function(_0xc83667,_0x1188be){if(_0x1791f5<=0x0||isNaN(_0x1791f5)){return _0x1188be(msgResponse(_0x1395('0x21c'),_0x1395('0x8e'),_0x1395('0x21d')+_0x1791f5));}if(_0x58ed3d<=0x0||isNaN(_0x58ed3d)){return _0x1188be(msgResponse(_0x1395('0x21c'),_0x1395('0x8e'),_0x1395('0x21e')+_0x58ed3d));}if(_0xa7dba1<=0x0||isNaN(_0xa7dba1)){return _0x1188be(msgResponse(_0x1395('0x21c'),_0x1395('0x8e'),_0x1395('0x21f')+_0xa7dba1));}if(_0x50dc8a<=0x0||isNaN(_0x50dc8a)){return _0x1188be(msgResponse(_0x1395('0x21c'),_0x1395('0x8e'),'interval\x20=\x20'+_0x50dc8a));}if(_0x302a6d<=0x0||isNaN(_0x302a6d)){return _0x1188be(msgResponse(_0x1395('0x21c'),_0x1395('0x8e'),'Amax\x20=\x20'+_0x302a6d));}_0x31f5d2=_0x31f5d2||0x0;var _0x570904=0x1/_0x58ed3d;var _0x5a4b05=0x0;var _0x54bbbf=0x0;var _0x53f3de=0x0;var _0x2c5934=0x0;for(var _0x46b2cf=0x0;_0x53f3de<_0x302a6d;_0x46b2cf+=0x1){_0x54bbbf=_0x46b2cf/_0x50dc8a;_0x5a4b05=(_0xa7dba1*_0x54bbbf+_0x31f5d2)/_0x570904;_0x53f3de=utils[_0x1395('0x220')](_0x5a4b05,_0x1791f5);_0x2c5934=_0x5a4b05/_0x1791f5*(0x1-utils[_0x1395('0x220')](_0x5a4b05,_0x1791f5));}return _0xc83667({'erlangCalls':_0x46b2cf,'erlangCallToSecond':_0x50dc8a/_0x46b2cf,'erlangAbandonmentRate':_0x53f3de,'erlangBusyFactor':_0x2c5934});});};Dialer[_0x1395('0x1c')][_0x1395('0x1dd')]=function(_0x135e92,_0x5347a5,_0x534170,_0x4b3da8,_0x14e3cc,_0x544098){loggerPredictive[_0x1395('0x53')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x1395('0x53')](_0x1395('0x218'),_0x135e92);loggerPredictive[_0x1395('0x53')](_0x1395('0x219'),_0x5347a5);loggerPredictive['info'](_0x1395('0x221'),_0x534170);loggerPredictive[_0x1395('0x53')](_0x1395('0x21a'),_0x4b3da8);loggerPredictive[_0x1395('0x53')](_0x1395('0x222'),_0x14e3cc);loggerPredictive[_0x1395('0x53')](_0x1395('0x68'));return new Promise(function(_0xc5a408,_0x550a5c){if(_0x135e92<=0x0||isNaN(_0x135e92)){return _0x550a5c(msgResponse(_0x1395('0x223'),_0x1395('0x8e'),_0x1395('0x21d')+_0x135e92));}if(_0x534170<=0x0||isNaN(_0x534170)){return _0x550a5c(msgResponse(_0x1395('0x223'),_0x1395('0x8e'),_0x1395('0x21e')+_0x534170));}if(_0x4b3da8<=0x0||isNaN(_0x4b3da8)){return _0x550a5c(msgResponse(_0x1395('0x223'),_0x1395('0x8e'),_0x1395('0x21f')+_0x4b3da8));}if(_0x5347a5<=0x0||isNaN(_0x5347a5)){return _0x550a5c(msgResponse(_0x1395('0x223'),_0x1395('0x8e'),_0x1395('0x224')+_0x5347a5));}if(_0x14e3cc<=0x0||isNaN(_0x14e3cc)){return _0x550a5c(msgResponse(_0x1395('0x223'),_0x1395('0x8e'),_0x1395('0x225')+_0x14e3cc));}_0x544098=_0x544098||0x0;var _0x40d7f4=0x1/_0x534170;var _0x5367e7=0x0;var _0x2b0d5f=0x0;var _0x423f18=0x0;var _0x257d5c=0x0;for(var _0x4c5547=0x0;_0x257d5c<_0x14e3cc;_0x4c5547+=0x1){_0x2b0d5f=_0x4c5547/_0x5347a5;_0x5367e7=(_0x4b3da8*_0x2b0d5f+_0x544098)/_0x40d7f4;_0x423f18=utils[_0x1395('0x220')](_0x5367e7,_0x135e92);_0x257d5c=_0x5367e7/_0x135e92*(0x1-utils[_0x1395('0x220')](_0x5367e7,_0x135e92));}return _0xc5a408({'erlangCalls':_0x4c5547,'erlangCallToSecond':_0x5347a5/_0x4c5547,'erlangAbandonmentRate':_0x423f18,'erlangBusyFactor':_0x257d5c});});};module[_0x1395('0x226')]=Dialer; \ No newline at end of file +var _0x0172=['predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','dropreason','countabandonedretry','countglobal','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','CampaignId','[rescheduleContact][Abandoned]','Abandoned','channel','actionid','rrmemory','isNil','locked','paused','stateinterface','idHopper','roundrobin','run','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','AMD','emit','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD]','MACHINE','Machine','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','membername','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countcongestionretry','dialMachineMaxRetry','[syncHangupIvr][createHistory]','AnswerAGI','[syncHangupIvr]','outboundUnknownCallsDay','cause-txt','Unknow','queuesSummary','running','statusMessage','available','inUse','talking','pTalking','checkDialMethod','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:%s','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','enqueue','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','user:dialPreviewRecallReminder','handleIvr','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','isOutboundQueue','XMD-VOICEQUEUEID','setXMDContactVariables','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','from-sip','dialOriginateTimeout','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countagentrejectretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','add','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Drop]','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalTotalCalls','dialPredictiveOptimization','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','RecallInQueue','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','Blacklist','[Originate][MoveBlacklist]','limitCalls','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact','checkIsBlackListIvr','[actionOriginateIvr]\x20','not_inuse','push','countReScheduled','[actionOriginate]\x20','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','dialOrderByScheduledAt','checkContactLowerLimitOriginate','[countReScheduled]\x20','checkIsBlackList','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','busyFactor','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\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]','exports','lodash','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','isUndefined','type','debug','inspect','voice:queue:%s','voice_queue:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','name','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','message','state','statedesc','endtime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Interval','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','format','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','catch','then','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Timezone:\x20','undefined','resolve','checkIfTime','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','dialMethod','progressive','power','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueId','uniqueid','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','agent','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','droptime','getSeconds','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','TIMEOUT','agiafterat','countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','rescheduleContact','minutes','ContactId','ListId','VoiceQueueId','starttime','calleridname','calleridnum','swapAdditionalPhones'];(function(_0x27fa65,_0x4e02ee){var _0x456594=function(_0x43b6da){while(--_0x43b6da){_0x27fa65['push'](_0x27fa65['shift']());}};_0x456594(++_0x4e02ee);}(_0x0172,0x13b));var _0x2017=function(_0x293167,_0x27d212){_0x293167=_0x293167-0x0;var _0x2f4640=_0x0172[_0x293167];return _0x2f4640;};'use strict';var util=require('util');var _=require(_0x2017('0x0'));var uuid=require(_0x2017('0x1'));var moment=require(_0x2017('0x2'));var rr=require('rr');var Redis=require(_0x2017('0x3'));var utils=require(_0x2017('0x4'));var hopperUtils=require(_0x2017('0x5'));var ut=require(_0x2017('0x6'));var config=require(_0x2017('0x7'));var logger=require('../../../config/logger')(_0x2017('0x8'));var loggerBooked=require(_0x2017('0x9'))(_0x2017('0xa'));var loggerPredictive=require(_0x2017('0x9'))(_0x2017('0xb'));var loggerPredictiveCalls=require(_0x2017('0x9'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0x2017('0xc'));var ami=require(_0x2017('0xd'));config[_0x2017('0xe')]=_[_0x2017('0xf')](config['redis'],{'host':_0x2017('0x10'),'port':0x18eb});var io=require(_0x2017('0x11'))(new Redis(config['redis']));var cmHopper=require(_0x2017('0x12'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x2017('0x13'));var Interval=require(_0x2017('0x14'));var Action=require(_0x2017('0x15'));var History=require(_0x2017('0x16'));var Final=require(_0x2017('0x17'));var AgentComplete=require(_0x2017('0x18'));var QueueCallerAbandon=require(_0x2017('0x19'));var Hangup=require('./models/hangup');var ipAgi=process['env']['XCALLY_IP_AGI']||_0x2017('0x1a');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x2017('0x1b')]['enqueue']=function(_0x486866){this['tail']=this[_0x2017('0x1c')]?this[_0x2017('0x1c')][_0x2017('0x1d')](_0x486866):_0x486866();};function Dialer(_0x1ac843,_0x335094){this[_0x2017('0x1e')]=new Sequence();this[_0x2017('0x1f')]=_0x335094;this[_0x2017('0x20')]=_0x1ac843['voiceQueues'];this[_0x2017('0x21')]=_0x1ac843[_0x2017('0x21')];this[_0x2017('0x22')]=_0x1ac843[_0x2017('0x22')];this[_0x2017('0x23')]=_0x1ac843[_0x2017('0x23')];this[_0x2017('0x24')]=config[_0x2017('0x24')]||0x2;this[_0x2017('0x25')]={};this[_0x2017('0x26')]={};this[_0x2017('0x27')]={};this['uniqueId']={};this[_0x2017('0x28')]={};this[_0x2017('0x29')]={};this[_0x2017('0x2a')]={};this[_0x2017('0x2b')]={};this[_0x2017('0x2c')]={};this[_0x2017('0x2d')]={};this['queuesSummary']={};ami['on'](_0x2017('0x2e'),this[_0x2017('0x2f')][_0x2017('0x30')](this));ami['on'](_0x2017('0x31'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x2017('0x32'),this[_0x2017('0x33')][_0x2017('0x30')](this));ami['on']('agentcomplete',this[_0x2017('0x34')][_0x2017('0x30')](this));ami['on'](_0x2017('0x35'),this[_0x2017('0xc')][_0x2017('0x30')](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete'][_0x2017('0x30')](this));ami['on']('hangup',this[_0x2017('0x36')]['bind'](this));ami['on']('newexten',this[_0x2017('0x37')][_0x2017('0x30')](this));ami['on'](_0x2017('0x38'),this[_0x2017('0x39')][_0x2017('0x30')](this));ami['on'](_0x2017('0x3a'),this[_0x2017('0x3b')][_0x2017('0x30')](this));ami['on'](_0x2017('0x3c'),this[_0x2017('0x3d')][_0x2017('0x30')](this));this[_0x2017('0x3e')]();this[_0x2017('0x3f')]();RpcSetting[_0x2017('0x40')]()['then'](function(_0x448a41){previewRecallmeReminderInterval=_0x448a41['previewRecallmeReminderInterval'];});}function isNotNull(_0x19c0b6){return _0x19c0b6!==null&&!_[_0x2017('0x41')](_0x19c0b6);}function msgResponse(_0x461d2c,_0x52fae4,_0x174486){return{'action':_0x461d2c,'response':_0x52fae4,'message':_0x174486,'stack':_0x174486};}function emit(_0x32291e,_0x24d8d3,_0x528828){io['to'](_0x32291e)['emit'](_0x24d8d3,_0x528828);}function emitOutboundVoiceQueueSummary(_0x2e8cc3){if(_0x2e8cc3[_0x2017('0x42')]==='outbound'){logger[_0x2017('0x43')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x2017('0x44')](_0x2e8cc3,{'showHidden':![],'depth':null}));emit(util['format'](_0x2017('0x45'),_0x2e8cc3['name']),_0x2017('0x46'),_0x2e8cc3);}}function checkGetDataPredictive(_0x3da445){if(isNotNull(_0x3da445)&&!_[_0x2017('0x47')](_0x3da445)){loggerPredictive[_0x2017('0x48')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x2017('0x48')](_0x2017('0x49'),_0x3da445['predictiveIntervalTotalCalls']);loggerPredictive[_0x2017('0x48')](_0x2017('0x4a'),_0x3da445[_0x2017('0x4b')]);loggerPredictive[_0x2017('0x48')](_0x2017('0x4c'),_0x3da445[_0x2017('0x4d')]);loggerPredictive['info'](_0x2017('0x4e'),_0x3da445['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3da445[_0x2017('0x4f')]);loggerPredictive['info'](_0x2017('0x50'),_0x3da445[_0x2017('0x51')]);loggerPredictive['info'](_0x2017('0x52'));if(_0x3da445['predictiveIntervalTotalCalls']>0x0){if(!_[_0x2017('0x41')](_0x3da445[_0x2017('0x51')])&&_0x3da445['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info'](_0x2017('0x53'));if(!_[_0x2017('0x41')](_0x3da445['predictiveIntervalAvgHoldtime'])&&_0x3da445[_0x2017('0x4f')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x2017('0x48')](_0x2017('0x54'));}}else{loggerPredictive['info'](_0x2017('0x55'));}return![];}function mergeDataErlangB(_0x17233e){return function(_0x49fb56){loggerPredictive[_0x2017('0x48')](_0x2017('0x56'));loggerPredictive[_0x2017('0x48')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49fb56[_0x2017('0x57')]);loggerPredictive[_0x2017('0x48')](_0x2017('0x58'),_0x49fb56[_0x2017('0x59')]);loggerPredictive[_0x2017('0x48')](_0x2017('0x5a'),_0x49fb56[_0x2017('0x5b')]);loggerPredictive[_0x2017('0x48')](_0x2017('0x5c'),_0x49fb56[_0x2017('0x5d')]);loggerPredictive[_0x2017('0x48')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49fb56[_0x2017('0x5b')]);loggerPredictive[_0x2017('0x48')]('---------------------------');_[_0x2017('0x5e')](_0x17233e,_0x49fb56);};}function ifInterval(_0x541439,_0x5c915e){if(_['isUndefined'](_0x5c915e)){return![];}return utils['getSeconds'](undefined,_0x5c915e)<_0x541439*0x3c;}function clearPredictiveAttributes(_0x5e0c63){if(_0x5e0c63[_0x2017('0x2a')]){_0x5e0c63['startProgressive']=undefined;loggerPredictive[_0x2017('0x43')](_0x5e0c63[_0x2017('0x5f')],_0x2017('0x60'));}if(_0x5e0c63[_0x2017('0x29')]){_0x5e0c63[_0x2017('0x29')]=undefined;loggerPredictive[_0x2017('0x43')](_0x5e0c63[_0x2017('0x5f')],_0x2017('0x61'));}if(_0x5e0c63[_0x2017('0x62')]){clearInterval(_0x5e0c63[_0x2017('0x62')]);_0x5e0c63[_0x2017('0x62')]=undefined;loggerPredictive[_0x2017('0x43')](_0x5e0c63['name'],_0x2017('0x63'));}}function loggerCatchPredictive(_0x1569f2,_0x20b403){return function(_0x43e705){loggerPredictive[_0x2017('0x64')](_0x20b403[_0x2017('0x5f')],_0x1569f2);loggerPredictive[_0x2017('0x64')](_0x43e705[_0x2017('0x65')]);clearPredictiveAttributes(_0x20b403);};}function loggerCatch(_0xe4570e){return function(_0x3cecd3){logger[_0x2017('0x64')](_0xe4570e,util[_0x2017('0x44')](_0x3cecd3,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x2c8da1,_0x270bc8,_0x2bfd40){return function(_0x51e86f){utils['checkContactLowerLimitOriginate'](_0x270bc8,_0x2bfd40,0x0);_0x270bc8['temp']=0x0;logger['error'](_0x2c8da1,util['inspect'](_0x51e86f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x47fb73){return function(_0x21d0ca){if(isNotNull(_0x21d0ca)&&isNotNull(_0x21d0ca[0x0])){if(_0x21d0ca[0x0]['contactsRescheduled']>0x0){_0x47fb73['message']=utils[_0x2017('0x66')][_0x2017('0x67')];logger['info'](_0x2017('0x68')+_0x47fb73[_0x2017('0x5f')],_0x21d0ca[0x0]['contactsRescheduled'],_0x2017('0x69'));}else{_0x47fb73['message']=utils[_0x2017('0x66')][_0x2017('0x6a')];logger['info'](_0x2017('0x6b')+_0x47fb73[_0x2017('0x5f')]);}}};}function createObjHistory(_0x4c8c01,_0x228e50,_0x23d5a0,_0x495014,_0x734da8){_0x4c8c01[_0x2017('0x6c')]=_0x23d5a0;var _0x4162b5=new Action(_0x4c8c01,_0x228e50);var _0x3d960c=new History(_0x4162b5);_0x3d960c[_0x2017('0x6d')]=_0x495014;_0x3d960c[_0x2017('0x6e')]=_0x734da8;_0x3d960c[_0x2017('0x6f')]=_0x4162b5['starttime'];return _0x3d960c;}function unlockQueueStatus(_0x2747ea,_0x40cd3e){setTimeout(function(){if(_['isUndefined'](_0x2747ea[_0x2017('0x70')])){loggerBooked[_0x2017('0x64')]('[unlockQueueStatus][undefined]',_0x40cd3e);}_0x2747ea['queueStatusComplete']=!![];loggerBooked[_0x2017('0x48')](_0x2017('0x71'),_0x40cd3e,JSON[_0x2017('0x72')](_[_0x2017('0x73')](_0x2747ea,[_0x2017('0x5f'),_0x2017('0x70')])));},0x1f3);}function checkInterval(_0x51ddbb){return function(){if(!isNotNull(_0x51ddbb['Interval'])){_0x51ddbb[_0x2017('0x6c')]=utils[_0x2017('0x66')][_0x2017('0x74')];throw _0x51ddbb[_0x2017('0x5f')]+_0x2017('0x75');}if(!isNotNull(_0x51ddbb[_0x2017('0x76')][_0x2017('0x77')])){_0x51ddbb['message']=utils['CAMPAIGN_STATUS'][_0x2017('0x74')];throw _0x51ddbb[_0x2017('0x5f')]+_0x2017('0x75');}if(!isNotNull(_['isEmpty'](_0x51ddbb['Interval'][_0x2017('0x77')]))){_0x51ddbb['message']=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x51ddbb['name']+_0x2017('0x75');}};}function checkIsIVRCampaignActive(_0x3fc104){return function(){if(!utils[_0x2017('0x78')](_0x3fc104)){_0x3fc104['message']=utils[_0x2017('0x66')][_0x2017('0x79')];throw _0x3fc104[_0x2017('0x5f')]+_0x2017('0x7a');}};}function emitCampaignSummary(_0x35e327){if(utils[_0x2017('0x7b')](_0x35e327)){emit(util[_0x2017('0x7c')](_0x2017('0x7d'),_0x35e327[_0x2017('0x5f')]),_0x2017('0x7e'),_0x35e327);}}function loggerCatchQueueSummary(_0x120066,_0x26d81c){return function(_0xf6951e){clearPredictiveAttributes(_0x26d81c);emitCampaignSummary(_0x26d81c);loggerSyncQueueSummary[_0x2017('0x43')](_0x120066,util['inspect'](_0xf6951e,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x2bc61e){if(_0x2bc61e[_0x2017('0x7f')]){if(_0x2bc61e[_0x2017('0x80')]===0x0){_0x2bc61e['sendMessageOneNotActive']=![];_0x2bc61e[_0x2017('0x6c')]=utils[_0x2017('0x66')][_0x2017('0x79')];loggerSyncQueueSummary[_0x2017('0x43')](_0x2017('0x81'),_0x2bc61e[_0x2017('0x5f')],'is\x20not\x20active');}else{_0x2bc61e[_0x2017('0x6c')]=utils[_0x2017('0x66')]['DISACTIVED'];loggerSyncQueueSummary[_0x2017('0x43')](_0x2017('0x81'),_0x2bc61e[_0x2017('0x5f')],_0x2017('0x82'));}emitCampaignSummary(_0x2bc61e);}}function myreject(_0x28eec6){return function(_0x5d1db1){return _0x28eec6(msgResponse(_0x2017('0x83'),_0x2017('0x84'),JSON[_0x2017('0x72')](_0x5d1db1)));};}Dialer[_0x2017('0x1b')][_0x2017('0x85')]=function(_0x444f4f){return!_[_0x2017('0x41')](_0x444f4f)&&_0x444f4f&&!_[_0x2017('0x41')](_0x444f4f[_0x2017('0x5f')])&&!_[_0x2017('0x41')](_0x444f4f[_0x2017('0x86')])&&_0x444f4f['active']&&(this[_0x2017('0x23')][util[_0x2017('0x7c')](_0x2017('0x87'),_0x444f4f['name'])][_0x2017('0x88')]===_0x2017('0x89')||this[_0x2017('0x23')][util[_0x2017('0x7c')](_0x2017('0x87'),_0x444f4f[_0x2017('0x5f')])][_0x2017('0x88')]===_0x2017('0x8a'));};Dialer['prototype'][_0x2017('0x8b')]=function(_0x3bf79f){var _0x8503ad=this;return function(){if(!_0x8503ad[_0x2017('0x85')](_0x3bf79f[_0x2017('0x8c')])){if(!_0x8503ad[_0x2017('0x85')](_0x3bf79f[_0x2017('0x8d')])){_0x3bf79f[_0x2017('0x6c')]=utils[_0x2017('0x66')][_0x2017('0x8e')];throw _0x3bf79f[_0x2017('0x5f')]+_0x2017('0x8f');}}};};Dialer[_0x2017('0x1b')]['checkIfTime']=function(_0x4dea47,_0x434938,_0x53a10e,_0x1e222b){var _0x573a99=this;return function(){var _0x263489=!![];return _0x573a99[_0x2017('0x90')](_0x4dea47,_0x434938,_0x53a10e,_0x1e222b,_0x263489);};};Dialer[_0x2017('0x1b')][_0x2017('0x91')]=function(_0x5ab994,_0xb8ad44,_0x585059,_0xc0afeb){var _0x4aac4f=this;return function(){var _0xe1e5ff=![];return _0x4aac4f['ifTimeIvr'](_0x5ab994[_0x2017('0x77')],_0xb8ad44,_0x585059,_0xc0afeb,_0xe1e5ff);};};Dialer[_0x2017('0x1b')][_0x2017('0x90')]=function(_0x30feae,_0x1a27e7,_0x1ffc49,_0x255912,_0x27dc4d){var _0x27f53e=[];return new Promise(function(_0x4402cb,_0x51a9be){if(!isNotNull(_0x30feae)){_0x255912['message']=utils[_0x2017('0x66')]['NULL_INTERVAL'];return _0x51a9be(msgResponse(_0x2017('0x92'),_0x2017('0x93'),_0x1ffc49+_0x2017('0x94')));}if(_[_0x2017('0x47')](_0x30feae)){_0x255912[_0x2017('0x6c')]=utils[_0x2017('0x66')][_0x2017('0x95')];return _0x51a9be(msgResponse(_0x2017('0x92'),_0x2017('0x93'),_0x1ffc49+_0x2017('0x96')));}if(_0x1a27e7&&_[_0x2017('0x41')](config[_0x2017('0x97')][_0x1a27e7])){_0x255912['message']=utils[_0x2017('0x66')][_0x2017('0x98')];return _0x51a9be(msgResponse(_0x2017('0x92'),_0x2017('0x93'),_0x1ffc49+_0x2017('0x99')+_0x1a27e7));}if(_[_0x2017('0x9a')](_0x30feae)){for(var _0x3b763d=0x0;_0x3b763d<_0x30feae['length'];_0x3b763d+=0x1){_0x27f53e['push'](ami[_0x2017('0x9b')]({'action':_0x2017('0x9c'),'command':util[_0x2017('0x7c')](_0x2017('0x9d'),_0x30feae[_0x3b763d][_0x2017('0x9e')],!_['isUndefined'](config[_0x2017('0x97')][_0x1a27e7])?_0x1a27e7:'')})['then'](function(_0x24d3ca){return _0x24d3ca[_0x2017('0x9f')][_0x2017('0xa0')](_0x2017('0xa1'))>=0x0;})[_0x2017('0xa2')](myreject(_0x51a9be)));}}else{_0x27f53e['push'](ami[_0x2017('0x9b')]({'action':_0x2017('0x9c'),'command':util['format'](_0x2017('0x9d'),_0x30feae,!_[_0x2017('0x41')](config[_0x2017('0x97')][_0x1a27e7])?_0x1a27e7:'')})[_0x2017('0xa3')](function(_0x3be3e2){return _0x3be3e2[_0x2017('0x9f')][_0x2017('0xa0')]('true')>=0x0;})[_0x2017('0xa2')](myreject(_0x51a9be)));}Promise[_0x2017('0xa4')](_0x27f53e)[_0x2017('0xa3')](function(_0x2845eb){var _0x4edfd0=_['some'](_0x2845eb);if(_0x4edfd0){return _0x4402cb(_0x4edfd0);}else{_0x255912[_0x2017('0x6c')]=_0x27dc4d?utils[_0x2017('0x66')][_0x2017('0xa5')]:utils['CAMPAIGN_STATUS'][_0x2017('0xa6')];return _0x51a9be(msgResponse('[ifTime][promiseAll]',_0x2017('0x93'),'Global:\x20'+_0x27dc4d+'\x20'+_0x1ffc49+'\x20Interval\x20is\x20overtime:\x20'+util[_0x2017('0x44')](_0x30feae,{'showHidden':![],'depth':null})+_0x2017('0xa7')+_0x1a27e7));}})[_0x2017('0xa2')](function(_0x169a53){return _0x51a9be(msgResponse(_0x2017('0x92'),'Failure',JSON[_0x2017('0x72')](_0x169a53)));});});};Dialer[_0x2017('0x1b')][_0x2017('0x3e')]=function(){var _0x4f9c63=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x4f9c63['syncCampaigns']();},0x3e8);});};Dialer[_0x2017('0x1b')]['syncCampaigns']=function(){var _0x24a3eb=this;var _0x171ec1;for(var _0x42f3c7 in this['campaigns']){if(typeof this['campaigns'][_0x42f3c7]!==_0x2017('0xa8')){_0x171ec1=this[_0x2017('0x21')][_0x42f3c7];if(utils[_0x2017('0x7b')](_0x171ec1)&&utils[_0x2017('0x78')](_0x171ec1)){_0x171ec1[_0x2017('0x7f')]=!![];Promise[_0x2017('0xa9')]()[_0x2017('0xa3')](checkIsIVRCampaignActive(_0x171ec1))[_0x2017('0xa3')](checkInterval(_0x171ec1))[_0x2017('0xa3')](_0x24a3eb[_0x2017('0x8b')](_0x171ec1))[_0x2017('0xa3')](_0x24a3eb[_0x2017('0xaa')](_0x171ec1[_0x2017('0xab')],_0x171ec1[_0x2017('0xac')],_0x171ec1['name'],_0x171ec1))[_0x2017('0xa3')](_0x24a3eb[_0x2017('0x91')](_0x171ec1[_0x2017('0x76')],_0x171ec1['dialTimezone'],_0x171ec1[_0x2017('0x5f')],_0x171ec1))[_0x2017('0xa3')](_0x24a3eb[_0x2017('0xad')](_0x171ec1))['catch'](loggerCatchQueueSummary(_0x2017('0xae'),_0x171ec1));}else{notSendMessagesCampaign(_0x171ec1);}}}};Dialer['prototype']['checkDialMethod']=function(_0x335221){if(_0x335221[_0x2017('0xaf')]!==_0x2017('0xb')){clearPredictiveAttributes(_0x335221);}switch(_0x335221[_0x2017('0xaf')]){case _0x2017('0xb0'):this['handlePower'](_0x335221,0x1);break;case _0x2017('0xb1'):this[_0x2017('0xb2')](_0x335221,_0x335221[_0x2017('0xb3')]);break;case'predictive':this['predictive'](_0x335221);break;case _0x2017('0xa'):this[_0x2017('0xb2')](_0x335221,0x1);break;default:logger[_0x2017('0x64')](_0x2017('0xb4'),_0x335221['name'],_0x2017('0xb5'));}};Dialer['prototype']['ifTime']=function(_0x1c8dea,_0x495238){var _0x48cc81=_0x1c8dea['dialTimezone'];var _0x244932=_0x495238?_0x1c8dea['dialGlobalInterval']:_0x1c8dea[_0x2017('0x76')][_0x2017('0x77')];logger[_0x2017('0xb6')]('Dialer::ifTime()',_0x244932,_0x48cc81,_0x1c8dea[_0x2017('0x5f')],util[_0x2017('0x7c')](_0x2017('0xb7'),_0x1c8dea['name'],_0x1c8dea['id']));var _0x416f38=null;return Interval['intervalIftime'](_0x244932,_0x48cc81)[_0x2017('0xa3')](function(_0x308390){if(_0x308390===!![]){return _0x308390;}else{_0x1c8dea[_0x2017('0x6c')]=_0x495238?utils[_0x2017('0x66')][_0x2017('0xa5')]:utils[_0x2017('0x66')][_0x2017('0xa6')];_0x416f38=msgResponse(_0x2017('0xb8'),_0x2017('0x93'),_0x2017('0xb9')+_0x495238+'\x20'+_0x1c8dea[_0x2017('0x5f')]+_0x2017('0xba')+util['inspect'](_0x244932,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x48cc81);}if(_0x416f38!==null){logger[_0x2017('0xb6')](_0x2017('0xbb'),_0x416f38);_0x416f38[_0x2017('0xbc')]=_0x495238;throw _0x416f38;}})[_0x2017('0xa2')](function(_0x1ae68f){logger['error']('AMI\x20IfTime',_0x1ae68f);throw msgResponse('[ifTime][Action]',_0x2017('0x84'),util[_0x2017('0x44')](_0x1ae68f,{'showHidden':![],'depth':null}));});};Dialer[_0x2017('0x1b')]['syncAgentConnect']=function(_0x3bffd2){if(this[_0x2017('0x20')][_0x3bffd2[_0x2017('0xbd')]]){if(this[_0x2017('0xbe')][_0x3bffd2[_0x2017('0xbf')]]&&this[_0x2017('0xbe')][_0x3bffd2[_0x2017('0xbf')]][_0x2017('0x42')]!==_0x2017('0xc0')){this[_0x2017('0xc1')](this[_0x2017('0x20')][_0x3bffd2[_0x2017('0xbd')]]);this['uniqueId'][_0x3bffd2['uniqueid']]['answertime']=moment()[_0x2017('0x7c')](_0x2017('0xc2'));}}};Dialer[_0x2017('0x1b')]['syncAgentComplete']=function(_0x23387b){var _0x517bc5=this[_0x2017('0xbe')][_0x23387b[_0x2017('0xbf')]];if(this[_0x2017('0x20')][_0x23387b['queue']]){if(_0x517bc5&&_0x517bc5['type']!==_0x2017('0xc0')){delete this[_0x2017('0xbe')][_0x23387b[_0x2017('0xbf')]];this[_0x2017('0x20')][_0x23387b[_0x2017('0xbd')]][_0x2017('0xc3')]+=0x1;var _0x12ec3e=new AgentComplete(_0x517bc5,_0x23387b);if(_0x23387b['reason']===_0x2017('0xc4')){_0x12ec3e['agiafterat']=this[_0x2017('0x20')][_0x23387b[_0x2017('0xbd')]][_0x2017('0xc5')]&&this[_0x2017('0x20')][_0x23387b[_0x2017('0xbd')]][_0x2017('0xc6')]?moment()[_0x2017('0x7c')](_0x2017('0xc2')):undefined;}hopperUtils[_0x2017('0xc7')](_0x12ec3e)[_0x2017('0xa2')](loggerCatch(_0x2017('0xc8')));hopperUtils[_0x2017('0xc9')](_0x12ec3e)[_0x2017('0xa2')](loggerCatch(_0x2017('0xca')));}}};Dialer[_0x2017('0x1b')][_0x2017('0xcb')]=function(_0x467bf0){var _0x3f76bf=this[_0x2017('0xbe')][_0x467bf0[_0x2017('0xbf')]];var _0x4fa577=this;var _0x310a95=![];var _0x1d25a4;var _0x73305b;if(this['voiceQueues'][_0x467bf0[_0x2017('0xbd')]]){if(_0x3f76bf&&_0x3f76bf[_0x2017('0x42')]!==_0x2017('0xc0')){delete this[_0x2017('0xbe')][_0x467bf0['uniqueid']];this[_0x2017('0xc1')](this[_0x2017('0x20')][_0x467bf0['queue']]);_0x3f76bf[_0x2017('0xcc')]=moment()[_0x2017('0x7c')](_0x2017('0xc2'));var _0x28a5d9=new QueueCallerAbandon(_0x3f76bf,_0x467bf0);if(utils[_0x2017('0xcd')](_0x3f76bf[_0x2017('0xcc')],_0x3f76bf[_0x2017('0xce')])>=_0x3f76bf['dialQueueTimeout']){this[_0x2017('0x20')][_0x467bf0[_0x2017('0xbd')]][_0x2017('0x4d')]+=0x1;this['voiceQueues'][_0x467bf0[_0x2017('0xbd')]][_0x2017('0xcf')]+=0x1;this['voiceQueues'][_0x467bf0[_0x2017('0xbd')]][_0x2017('0xd0')]+=0x1;_0x28a5d9[_0x2017('0x6d')]=0xa;_0x28a5d9[_0x2017('0x6e')]='Drop';_0x28a5d9['dropreason']=_0x2017('0xd1');_0x28a5d9[_0x2017('0xd2')]=this[_0x2017('0x20')][_0x467bf0[_0x2017('0xbd')]][_0x2017('0xc5')]?moment()[_0x2017('0x7c')](_0x2017('0xc2')):undefined;_0x28a5d9[_0x2017('0xd3')]+=0x1;_0x28a5d9['countglobal']+=0x1;_0x1d25a4=this[_0x2017('0x20')][_0x467bf0['queue']][_0x2017('0xd4')];_0x73305b=this['voiceQueues'][_0x467bf0[_0x2017('0xbd')]][_0x2017('0xd5')];hopperUtils[_0x2017('0xd6')](_0x28a5d9,_0x28a5d9[_0x2017('0x6d')],_0x3f76bf[_0x2017('0xd7')])['then'](function(_0x2459a8){_0x310a95=_0x2459a8[_0x2017('0xd8')]==0x1;if(_0x28a5d9[_0x2017('0xd3')]>=_0x4fa577[_0x2017('0x20')][_0x467bf0[_0x2017('0xbd')]]['dialDropMaxRetry']){_0x4fa577['queueCallerAbandonCreateState'](_0x28a5d9,_0x2459a8[_0x2017('0xd8')]);}else{hopperUtils[_0x2017('0xd9')]({'active':![],'countdropretry':_0x28a5d9['countdropretry'],'scheduledat':moment()['add'](_0x4fa577[_0x2017('0x20')][_0x467bf0[_0x2017('0xbd')]]['dialDropRetryFrequency'],_0x2017('0xda'))['format'](_0x2017('0xc2')),'ContactId':_0x3f76bf[_0x2017('0xdb')],'ListId':_0x3f76bf[_0x2017('0xdc')],'VoiceQueueId':_0x3f76bf[_0x2017('0xdd')]||undefined,'CampaignId':_0x3f76bf['CampaignId']||undefined})[_0x2017('0xa2')](loggerCatch('[rescheduleContact][Drop]'));var _0x573fc4=new History(_0x28a5d9);_0x573fc4['state']=0xa;_0x573fc4[_0x2017('0x6e')]='Drop';_0x573fc4[_0x2017('0xde')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x573fc4[_0x2017('0x6f')]=_0x573fc4[_0x2017('0xde')];_0x573fc4['calleridname']=_0x28a5d9[_0x2017('0xdf')];_0x573fc4[_0x2017('0xe0')]=_0x28a5d9['calleridnum'];hopperUtils['createHistory'](_0x573fc4)[_0x2017('0xa2')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x2017('0xa3')](function(){if(_0x310a95)hopperUtils[_0x2017('0xe1')](_0x28a5d9,_0x1d25a4,_0x73305b)[_0x2017('0xa3')](function(){return 0x1;});});}else{this['voiceQueues'][_0x467bf0[_0x2017('0xbd')]][_0x2017('0xe2')]+=0x1;this[_0x2017('0x20')][_0x467bf0['queue']][_0x2017('0xe3')]+=0x1;_0x28a5d9['state']=0xb;_0x28a5d9[_0x2017('0x6e')]='Abandoned';_0x28a5d9[_0x2017('0xe4')]='CALLEREXIT';_0x28a5d9[_0x2017('0xe5')]+=0x1;_0x28a5d9[_0x2017('0xe6')]+=0x1;_0x1d25a4=this[_0x2017('0x20')][_0x467bf0[_0x2017('0xbd')]][_0x2017('0xe7')];_0x73305b=this[_0x2017('0x20')][_0x467bf0[_0x2017('0xbd')]][_0x2017('0xd5')];hopperUtils[_0x2017('0xd6')](_0x28a5d9,_0x28a5d9[_0x2017('0x6d')],_0x3f76bf[_0x2017('0xd7')])[_0x2017('0xa3')](function(_0x11da9a){if(_0x28a5d9['countabandonedretry']>=_0x4fa577[_0x2017('0x20')][_0x467bf0[_0x2017('0xbd')]][_0x2017('0xe8')]){_0x4fa577['queueCallerAbandonCreateState'](_0x28a5d9,_0x11da9a['additional']);}else{hopperUtils[_0x2017('0xd9')]({'active':![],'countabandonedretry':_0x28a5d9[_0x2017('0xe5')],'scheduledat':moment()['add'](_0x4fa577[_0x2017('0x20')][_0x467bf0['queue']]['dialAbandonedRetryFrequency'],_0x2017('0xda'))[_0x2017('0x7c')](_0x2017('0xc2')),'ContactId':_0x3f76bf[_0x2017('0xdb')],'ListId':_0x3f76bf[_0x2017('0xdc')],'VoiceQueueId':_0x3f76bf[_0x2017('0xdd')]||undefined,'CampaignId':_0x3f76bf[_0x2017('0xe9')]||undefined})['catch'](loggerCatch(_0x2017('0xea')));var _0x2a19da=new History(_0x28a5d9);_0x2a19da[_0x2017('0x6d')]=0xb;_0x2a19da[_0x2017('0x6e')]=_0x2017('0xeb');_0x2a19da[_0x2017('0xde')]=moment()[_0x2017('0x7c')](_0x2017('0xc2'));_0x2a19da[_0x2017('0x6f')]=_0x2a19da['starttime'];_0x2a19da[_0x2017('0xdf')]=_0x28a5d9[_0x2017('0xdf')];_0x2a19da[_0x2017('0xe0')]=_0x28a5d9[_0x2017('0xe0')];hopperUtils['createHistory'](_0x2a19da)[_0x2017('0xa2')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x2017('0xa3')](function(){if(_0x310a95)hopperUtils[_0x2017('0xe1')](_0x28a5d9,_0x1d25a4,_0x73305b)[_0x2017('0xa3')](function(){return 0x1;});});}}}};Dialer[_0x2017('0x1b')]['syncNewExten']=function(_0x4e7395){if(this[_0x2017('0x26')][_0x4e7395[_0x2017('0xbf')]]){this[_0x2017('0x26')][_0x4e7395['uniqueid']][_0x2017('0xec')]=_0x4e7395['channel'];}if(this[_0x2017('0xbe')][_0x4e7395[_0x2017('0xbf')]]){this[_0x2017('0xbe')][_0x4e7395['uniqueid']][_0x2017('0xec')]=_0x4e7395['channel'];}};Dialer[_0x2017('0x1b')][_0x2017('0x3b')]=function(_0x290005){if(!this[_0x2017('0x26')][_0x290005[_0x2017('0xed')]]){return;}var _0x594e68=this[_0x2017('0x20')][this[_0x2017('0x26')][_0x290005['actionid']][_0x2017('0xbd')]]['strategy']||_0x2017('0xee');if(_0x594e68==='roundrobin'){if(this[_0x2017('0x26')][_0x290005[_0x2017('0xed')]]&&_[_0x2017('0xef')](this[_0x2017('0x26')][_0x290005['actionid']][_0x2017('0xf0')])&&_0x290005['status']==='1'&&_0x290005[_0x2017('0xf1')]==='0'){if(this['agents'][_0x290005['stateinterface']]){if(!this[_0x2017('0x22')][_0x290005[_0x2017('0xf2')]]['locked']){this[_0x2017('0x22')][_0x290005[_0x2017('0xf2')]][_0x2017('0xf0')]=!![];this['actions'][_0x290005['actionid']][_0x2017('0xf0')]=!![];this['actions'][_0x290005['actionid']][_0x2017('0xf2')]=_0x290005[_0x2017('0xf2')];}}}}else if(_0x594e68===_0x2017('0xee')){if(this[_0x2017('0x26')][_0x290005['actionid']]){if(this[_0x2017('0x22')][_0x290005[_0x2017('0xf2')]]){this[_0x2017('0x26')][_0x290005[_0x2017('0xed')]][_0x2017('0xf2')]=_0x290005[_0x2017('0xf2')];if(_[_0x2017('0xef')](this[_0x2017('0x2c')][this[_0x2017('0x26')][_0x290005['actionid']][_0x2017('0xbd')]])){this[_0x2017('0x2c')][this['actions'][_0x290005['actionid']][_0x2017('0xbd')]]=[];}this[_0x2017('0x2c')][this[_0x2017('0x26')][_0x290005['actionid']]['queue']]['push'](_[_0x2017('0x5e')](_['pick'](this['actions'][_0x290005[_0x2017('0xed')]],[_0x2017('0xf3'),'stateinterface']),{'status':_0x290005['status'],'paused':_0x290005['paused']}));}}}};Dialer[_0x2017('0x1b')][_0x2017('0x3d')]=function(_0xad3e77){if(!this['actions'][_0xad3e77['actionid']]){return;}var _0x516636=this;var _0x423100=this[_0x2017('0x20')][this[_0x2017('0x26')][_0xad3e77[_0x2017('0xed')]]['queue']];var _0x58c89e=_0x423100['strategy']||'rrmemory';if(_0x58c89e===_0x2017('0xf4')){if(this['actions'][_0xad3e77[_0x2017('0xed')]]&&this[_0x2017('0x26')][_0xad3e77[_0x2017('0xed')]][_0x2017('0xf2')]){this[_0x2017('0x1f')][_0x2017('0xf5')](this[_0x2017('0x26')][_0xad3e77[_0x2017('0xed')]]['idHopper'],this[_0x2017('0x26')][_0xad3e77[_0x2017('0xed')]][_0x2017('0xf2')])[_0x2017('0xa2')](function(_0x5e65c5){logger[_0x2017('0x64')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x5e65c5,{'showHidden':![],'depth':null}));})[_0x2017('0x1d')](function(){_0x516636[_0x2017('0xc1')](_0x516636[_0x2017('0x20')][_0x516636[_0x2017('0x26')][_0xad3e77[_0x2017('0xed')]][_0x2017('0xbd')]]);_0x516636[_0x2017('0x22')][_0x516636[_0x2017('0x26')][_0xad3e77[_0x2017('0xed')]][_0x2017('0xf2')]][_0x2017('0xf0')]=![];delete _0x516636[_0x2017('0x26')][_0xad3e77[_0x2017('0xed')]];unlockQueueStatus(_0x423100);});}else{this['updateOriginated'](this[_0x2017('0x20')][this['actions'][_0xad3e77[_0x2017('0xed')]]['queue']]);hopperUtils[_0x2017('0xd9')]({'active':![],'ContactId':this[_0x2017('0x26')][_0xad3e77['actionid']][_0x2017('0xdb')],'ListId':this['actions'][_0xad3e77[_0x2017('0xed')]][_0x2017('0xdc')],'VoiceQueueId':this[_0x2017('0x26')][_0xad3e77['actionid']][_0x2017('0xdd')]||undefined,'CampaignId':this[_0x2017('0x26')][_0xad3e77[_0x2017('0xed')]]['CampaignId']||undefined})[_0x2017('0xa2')](loggerCatch(_0x2017('0xf6')));delete this['actions'][_0xad3e77[_0x2017('0xed')]];unlockQueueStatus(_0x423100);}}else if(_0x58c89e===_0x2017('0xee')){var _0x2bdeb2;if(this['actions'][_0xad3e77[_0x2017('0xed')]]&&!_[_0x2017('0x47')](this[_0x2017('0x2c')][this[_0x2017('0x26')][_0xad3e77[_0x2017('0xed')]][_0x2017('0xbd')]])){if(this[_0x2017('0x2d')][_0x516636[_0x2017('0x26')][_0xad3e77[_0x2017('0xed')]][_0x2017('0xbd')]]){this[_0x2017('0x2d')][_0x516636[_0x2017('0x26')][_0xad3e77[_0x2017('0xed')]]['queue']]=this['queueBookedRR'][this['actions'][_0xad3e77[_0x2017('0xed')]][_0x2017('0xbd')]]?this[_0x2017('0x2d')][this[_0x2017('0x26')][_0xad3e77[_0x2017('0xed')]]['queue']]:this[_0x2017('0x2c')][this[_0x2017('0x26')][_0xad3e77['actionid']][_0x2017('0xbd')]]?this[_0x2017('0x2c')][this[_0x2017('0x26')][_0xad3e77[_0x2017('0xed')]][_0x2017('0xbd')]][_0x2017('0xf7')]||0x0:0x0;}this[_0x2017('0x2c')][this['actions'][_0xad3e77['actionid']][_0x2017('0xbd')]][_0x2017('0xf7')]=this['queueBookedRR'][this[_0x2017('0x26')][_0xad3e77['actionid']]['queue']];for(var _0x296497=0x0;_0x296497=_0x259fbd[_0x2017('0x11f')]){_0x259766[_0x2017('0x120')](_0x3b9200,_0x526bb0,_0x167f66,_0x2017('0x121'));}else{if(_0x3b9200[_0x2017('0x11e')]>=_0x259fbd['dialMachineMaxRetry']){_0x259766[_0x2017('0x122')](_0x3b9200,_0x526bb0,_0x167f66,_0x2017('0x123'));}else{hopperUtils[_0x2017('0xd9')]({'active':![],'countmachineretry':_0x3b9200[_0x2017('0x11e')],'scheduledat':moment()['add'](_0x259fbd[_0x2017('0x124')],_0x2017('0xda'))['format'](_0x2017('0xc2')),'ContactId':_0x3b9200[_0x2017('0xdb')],'ListId':_0x3b9200[_0x2017('0xdc')],'VoiceQueueId':_0x3b9200['VoiceQueueId']||undefined,'CampaignId':_0x3b9200[_0x2017('0xe9')]||undefined})[_0x2017('0xa2')](loggerCatch('[rescheduleContact][Machine]'));_0x526bb0({'reschedule':0x1});}}});}if(_0x5ce0a3[_0x2017('0x42')]===_0x2017('0xc0')&&this[_0x2017('0x21')][_0x5ce0a3[_0x2017('0xbd')]][_0x2017('0x10c')]&&_0x410f8f['value']==='HANGUP'){delete this[_0x2017('0xbe')][_0x410f8f[_0x2017('0xbf')]];this['updateOriginated'](this[_0x2017('0x21')][_0x5ce0a3[_0x2017('0xbd')]]);_0x5834e6=new Hangup(_0x5ce0a3,_0x410f8f);_0x5834e6[_0x2017('0x6d')]=0x12;_0x5834e6[_0x2017('0x6e')]='HangupInAMD';_0x5834e6[_0x2017('0x125')]=_0x2017('0x111');ami[_0x2017('0x112')](_0x2017('0x113'),ut[_0x2017('0x114')](_0x5834e6,_0x2017('0x115')));this[_0x2017('0x116')](_0x5834e6,_0x2017('0x126'),_0x2017('0x127'));}if(_0x5ce0a3[_0x2017('0x42')]===_0x2017('0xc0')&&this[_0x2017('0x21')][_0x5ce0a3['queue']][_0x2017('0x10c')]&&_0x410f8f[_0x2017('0x10d')]==='MACHINE'){return new Promise(function(_0x1acfeb,_0x5705ab){delete _0x259766['uniqueId'][_0x410f8f[_0x2017('0xbf')]];_0x259766[_0x2017('0xc1')](_0x259766['campaigns'][_0x5ce0a3[_0x2017('0xbd')]]);_0x259766[_0x2017('0x21')][_0x5ce0a3['queue']]['outboundAnswerCallsDay']+=0x1;_0x259766[_0x2017('0x21')][_0x5ce0a3['queue']][_0x2017('0x10f')]+=0x1;var _0x5ca513=_0x259766[_0x2017('0x21')][_0x5ce0a3[_0x2017('0xbd')]];var _0x2c1f0c=new Hangup(_0x5ce0a3,_0x410f8f);_0x2c1f0c[_0x2017('0x6d')]=0x13;_0x2c1f0c[_0x2017('0x6e')]='Machine';_0x2c1f0c[_0x2017('0x125')]=_0x2017('0x111');_0x2c1f0c[_0x2017('0x11e')]+=0x1;_0x2c1f0c['countglobal']+=0x1;_0x2c1f0c['amd']=!![];ami['emit'](_0x2017('0x113'),ut[_0x2017('0x114')](_0x2c1f0c,_0x2017('0x115')));hopperUtils[_0x2017('0xc7')](_0x2c1f0c)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2c1f0c[_0x2017('0x11b')]+_0x2c1f0c[_0x2017('0x128')]+_0x2c1f0c[_0x2017('0x11c')]+_0x2c1f0c[_0x2017('0x11d')]+_0x2c1f0c[_0x2017('0xd3')]+_0x2c1f0c['countabandonedretry']+_0x2c1f0c['countmachineretry']+_0x2c1f0c['countagentrejectretry']>=_0x5ca513[_0x2017('0x11f')]){_0x259766[_0x2017('0x120')](_0x2c1f0c,_0x1acfeb,_0x5705ab,_0x2017('0x121'));}else{if(_0x2c1f0c['countmachineretry']>=_0x5ca513[_0x2017('0x129')]){_0x259766[_0x2017('0x122')](_0x2c1f0c,_0x1acfeb,_0x5705ab,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x2c1f0c['countmachineretry'],'scheduledat':moment()['add'](_0x5ca513[_0x2017('0x124')],_0x2017('0xda'))['format'](_0x2017('0xc2')),'ContactId':_0x2c1f0c[_0x2017('0xdb')],'ListId':_0x2c1f0c['ListId'],'VoiceQueueId':_0x2c1f0c[_0x2017('0xdd')]||undefined,'CampaignId':_0x2c1f0c[_0x2017('0xe9')]||undefined})[_0x2017('0xa2')](loggerCatch('[rescheduleContact][Machine]'));_0x1acfeb({'reschedule':0x1});}}});}}};Dialer[_0x2017('0x1b')][_0x2017('0x36')]=function(_0x5d27a5){var _0x173d24=this[_0x2017('0xbe')][_0x5d27a5[_0x2017('0xbf')]];var _0x394343;if(_0x173d24&&_0x173d24['type']===_0x2017('0xc0')){delete this[_0x2017('0xbe')][_0x5d27a5[_0x2017('0xbf')]];this[_0x2017('0xc1')](this[_0x2017('0x21')][_0x173d24[_0x2017('0xbd')]]);this[_0x2017('0x21')][_0x173d24[_0x2017('0xbd')]]['ivrAnswerCallsDay']+=0x1;_0x394343=new Hangup(_0x173d24,_0x5d27a5);hopperUtils[_0x2017('0xc7')](_0x394343)[_0x2017('0xa2')](loggerCatch(_0x2017('0x12a')));hopperUtils['moveContactManagedDialer'](_0x394343)[_0x2017('0xa2')](loggerCatch('[syncHangupIvr]'));}if(_0x173d24&&_0x173d24[_0x2017('0x42')]!==_0x2017('0xc0')&&isNotNull(this[_0x2017('0x20')][_0x173d24[_0x2017('0xbd')]]['dialQueueProject'])){delete this[_0x2017('0xbe')][_0x5d27a5[_0x2017('0xbf')]];this['updateOriginated'](this['voiceQueues'][_0x173d24[_0x2017('0xbd')]]);this[_0x2017('0x20')][_0x173d24[_0x2017('0xbd')]][_0x2017('0xc3')]+=0x1;this[_0x2017('0x20')][_0x173d24['queue']][_0x2017('0x10f')]+=0x1;_0x394343=new Hangup(_0x173d24,_0x5d27a5);_0x394343[_0x2017('0x6d')]=0x10;_0x394343[_0x2017('0x6e')]=_0x2017('0x12b');_0x394343['membername']='AGI';hopperUtils[_0x2017('0xc7')](_0x394343)[_0x2017('0xa2')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x394343)[_0x2017('0xa2')](loggerCatch(_0x2017('0x12c')));}if(_0x173d24&&_0x173d24[_0x2017('0x42')]!==_0x2017('0xc0')&&!isNotNull(this[_0x2017('0x20')][_0x173d24[_0x2017('0xbd')]]['dialQueueProject'])){delete this['uniqueId'][_0x5d27a5['uniqueid']];this[_0x2017('0xc1')](this[_0x2017('0x20')][_0x173d24[_0x2017('0xbd')]]);this[_0x2017('0x20')][_0x173d24['queue']][_0x2017('0x12d')]+=0x1;_0x394343=new Hangup(_0x173d24,_0x5d27a5);_0x394343[_0x2017('0x6d')]=0xc;_0x394343[_0x2017('0x6e')]=_0x5d27a5[_0x2017('0x12e')];_0x394343[_0x2017('0x125')]=_0x2017('0x12f');hopperUtils['createHistory'](_0x394343)[_0x2017('0xa2')](loggerCatch(_0x2017('0x12a')));hopperUtils[_0x2017('0xc9')](_0x394343)['catch'](loggerCatch(_0x2017('0x12c')));}};Dialer[_0x2017('0x1b')][_0x2017('0xc')]=function(_0x236dd8){var _0x1ec555=this;if(!_0x1ec555[_0x2017('0x130')][_0x236dd8[_0x2017('0x5f')]]){_0x1ec555[_0x2017('0x130')][_0x236dd8[_0x2017('0x5f')]]={'running':![]};}else if(_0x1ec555[_0x2017('0x130')][_0x236dd8['name']][_0x2017('0x131')]===!![]){return;}else if(_0x1ec555[_0x2017('0x130')][_0x236dd8[_0x2017('0x5f')]][_0x2017('0x131')]===![]){_0x1ec555['queuesSummary'][_0x236dd8['name']][_0x2017('0x131')]=!![];}var _0x94cbe3=_0x1ec555['voiceQueues'][_0x236dd8[_0x2017('0x5f')]];var _0x2ed8ee=_0x94cbe3[_0x2017('0x6c')]!==utils[_0x2017('0x66')][_0x2017('0x79')];var _0x380f37=utils['isPreviewCampaign'](_0x94cbe3);_0x94cbe3[_0x2017('0x132')]=utils['getQueueCampaignStatusMessage'](_0x94cbe3,_0x1ec555[_0x2017('0x23')]);Promise['resolve']()[_0x2017('0xa3')](function(){if(_0x94cbe3['statusMessage']===utils[_0x2017('0x66')][_0x2017('0x79')]){if(_0x2ed8ee){clearPredictiveAttributes(_0x94cbe3);_0x236dd8[_0x2017('0x29')]=undefined;_0x236dd8[_0x2017('0x2a')]=undefined;}if(_0x94cbe3[_0x2017('0x132')]===utils[_0x2017('0x66')][_0x2017('0x79')]){_0x236dd8[_0x2017('0x133')]=0x0;_0x236dd8[_0x2017('0xf1')]=0x0;_0x236dd8[_0x2017('0x134')]=0x0;_0x236dd8[_0x2017('0x135')]=0x0;_0x236dd8[_0x2017('0x136')]=0x0;}}else if(_0x94cbe3[_0x2017('0x132')]===utils[_0x2017('0x66')]['ACTIVE']&&!_0x380f37){return _0x1ec555[_0x2017('0x92')](_0x94cbe3,!![])[_0x2017('0xa3')](function(){return _0x1ec555[_0x2017('0x92')](_0x94cbe3,![]);})[_0x2017('0xa3')](function(){return _0x1ec555[_0x2017('0x137')](_0x94cbe3);})[_0x2017('0xa2')](function(_0x6c95f){loggerSyncQueueSummary[_0x2017('0x43')](_0x2017('0x138'),util[_0x2017('0x44')](_0x6c95f,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x94cbe3);});}else{clearPredictiveAttributes(_0x94cbe3);}})['then'](function(){var _0x265e65=_0x236dd8['compareToOutboundQueue'](_0x94cbe3);if(_0x265e65||_0x94cbe3[_0x2017('0x139')]){_0x94cbe3['queueSummaryCountersUpdated']=![];_0x236dd8[_0x2017('0x13a')](_0x94cbe3);Object[_0x2017('0x13b')](_0x94cbe3,_0x236dd8);emitOutboundVoiceQueueSummary(_0x236dd8);}_0x1ec555['queuesSummary'][_0x94cbe3[_0x2017('0x5f')]][_0x2017('0x131')]=![];})[_0x2017('0xa2')](function(_0x1f3016){logger['error'](_0x2017('0x138'),util[_0x2017('0x44')](_0x1f3016,{'showHidden':![],'depth':null}));_0x1ec555[_0x2017('0x130')][_0x94cbe3['name']][_0x2017('0x131')]=![];});};Dialer[_0x2017('0x1b')][_0x2017('0x13c')]=_[_0x2017('0x13d')](function(){var _0x34ed11=_[_0x2017('0x13e')](this['voiceQueues'],function(_0x468201){return _0x468201[_0x2017('0x13f')];});var _0xebd420=_[_0x2017('0x13e')](this['agents'],function(_0x5467fb){return _0x5467fb[_0x2017('0x140')]&&_0x5467fb[_0x2017('0x88')]===_0x2017('0x89');});if(_0x34ed11[_0x2017('0xf8')]>0x0&&_0xebd420[_0x2017('0xf8')]>0x0){return Promise[_0x2017('0xa9')]()[_0x2017('0xa3')](cmHopper[_0x2017('0x141')](_[_0x2017('0x142')](_0x34ed11,'id'),previewRecallmeReminderInterval,_[_0x2017('0x142')](_0xebd420,'id')))[_0x2017('0xa3')](function(_0x5e3ab5){for(var _0x213d14=0x0;_0x213d14<_0x5e3ab5[_0x2017('0xf8')];_0x213d14++){var _0x9d86b9=_0x5e3ab5[_0x213d14][_0x2017('0x143')][_0x2017('0x5f')];if(_0x9d86b9)io['to'](util['format'](_0x2017('0x144'),_0x9d86b9))[_0x2017('0x112')]('user:dialPreviewRecallReminder',{'hopper':_0x5e3ab5[_0x213d14]});}})[_0x2017('0xa2')](function(_0x29daeb){logger['error'](_0x2017('0x145'),_0x29daeb);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x2017('0x1b')][_0x2017('0x3f')]=function(){var _0x55573e=this;setInterval(function(){_0x55573e[_0x2017('0x146')](_0x55573e[_0x2017('0xbe')],_0x2017('0x147'));_0x55573e[_0x2017('0x146')](_0x55573e[_0x2017('0x26')],'[actions]');},0x32c8);};Dialer[_0x2017('0x1b')][_0x2017('0x146')]=function(_0x22e664,_0x3e2d2e){var _0x3f6133=this;for(var _0x544af4 in _0x22e664){if(typeof _0x22e664[_0x544af4]!==_0x2017('0xa8')){this['sequence'][_0x2017('0x148')](function(){if(!_[_0x2017('0xef')](_0x22e664[_0x544af4])){return ami['Action']({'action':_0x2017('0x88'),'channel':_0x22e664[_0x544af4][_0x2017('0xec')]})[_0x2017('0xa2')](function(_0x3d9344){if(_0x3d9344[_0x2017('0x6c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x22e664[_0x544af4]&&_0x22e664[_0x544af4][_0x2017('0x42')]!==_0x2017('0xc0')){_0x3f6133[_0x2017('0xc1')](_0x3f6133[_0x2017('0x20')][_0x22e664[_0x544af4][_0x2017('0xbd')]]);logger[_0x2017('0x64')](_0x2017('0x149'),_0x3e2d2e,_0x544af4,_0x22e664[_0x544af4][_0x2017('0xbd')]);delete _0x22e664[_0x544af4];}if(_0x22e664[_0x544af4]&&_0x22e664[_0x544af4][_0x2017('0x42')]==='ivr'){_0x3f6133[_0x2017('0xc1')](_0x3f6133['campaigns'][_0x22e664[_0x544af4][_0x2017('0xbd')]]);logger[_0x2017('0x64')]('[Dialer][checkChannel][ivr]',_0x3e2d2e,_0x544af4,_0x22e664[_0x544af4][_0x2017('0xbd')]);delete _0x22e664[_0x544af4];}},0x2328);}});}});}}};Dialer[_0x2017('0x1b')][_0x2017('0x14a')]=function(_0x58018b){return Promise['resolve']()['then'](voiceQueueRt[_0x2017('0x14a')](_0x58018b))[_0x2017('0xa2')](loggerCatch(_0x2017('0x14b')));};Dialer['prototype']['updateOriginated']=function(_0x3d476a){if(!_[_0x2017('0x41')](_0x3d476a)&&_0x3d476a!==null){if(typeof _0x3d476a['originated']!==_0x2017('0xa8')){if(_0x3d476a[_0x2017('0x80')]>0x0){_0x3d476a[_0x2017('0x80')]-=0x1;}else{logger[_0x2017('0x64')](_0x2017('0x14c'));}}}else{logger[_0x2017('0x64')](_0x2017('0x14d'));}};Dialer[_0x2017('0x1b')][_0x2017('0x14e')]=function(_0x5ed34e,_0x288faa){var _0x5c380f=this;return function(_0x4c3aee){_0x5c380f[_0x2017('0xc1')](_0x288faa);logger[_0x2017('0x64')](_0x5ed34e,util[_0x2017('0x44')](_0x4c3aee,{'showHidden':![],'depth':null}));};};Dialer[_0x2017('0x1b')][_0x2017('0x14f')]=function(_0x31e517,_0x3642af,_0x4d8f95){var _0x1905e9={'state':0x19,'statedesc':_0x2017('0x150')};this[_0x2017('0xc1')](_0x3642af);this[_0x2017('0x116')](_['merge'](_0x1905e9,_['pick'](_0x4d8f95,['ContactId',_0x2017('0xdc'),_0x2017('0x151'),'VoiceQueueId',_0x2017('0xe9')])),_0x2017('0x152'),_0x2017('0x153'));logger[_0x2017('0x64')](_0x31e517);};Dialer[_0x2017('0x1b')][_0x2017('0x116')]=function(_0x435333,_0x21edc5,_0x3b4261){hopperUtils['createHistory'](_0x435333)[_0x2017('0xa2')](loggerCatch(_0x21edc5));hopperUtils[_0x2017('0xc9')](_0x435333)[_0x2017('0xa2')](loggerCatch(_0x3b4261));};Dialer[_0x2017('0x1b')][_0x2017('0x154')]=function(_0xfdcff9,_0x4d6d8e){hopperUtils['createHistory'](_0xfdcff9)[_0x2017('0xa2')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x4d6d8e==0x0){hopperUtils[_0x2017('0xc9')](_0xfdcff9)[_0x2017('0xa2')](loggerCatch(_0x2017('0x155')));}};Dialer['prototype']['checkPreviewRecallReminder']=function(_0x503949){return Promise[_0x2017('0xa9')]()['then'](cmHopper[_0x2017('0x141')](_0x503949['id'],previewRecallmeReminderInterval))[_0x2017('0xa3')](function(_0x1303ed){for(var _0x5872f4=0x0;_0x5872f4<_0x1303ed[_0x2017('0xf8')];_0x5872f4++){var _0x2662ea=_0x1303ed[_0x5872f4]['Agent'][_0x2017('0x5f')];if(_0x2662ea)io['to'](util[_0x2017('0x7c')](_0x2017('0x144'),_0x2662ea))[_0x2017('0x112')](_0x2017('0x156'),{'hopper':_0x1303ed[_0x5872f4]});}})['catch'](function(){});};Dialer[_0x2017('0x1b')][_0x2017('0xad')]=function(_0x248930){var _0x243551=this;return function(){_0x243551[_0x2017('0x157')](_0x248930);};};Dialer[_0x2017('0x1b')][_0x2017('0x158')]=function(_0x2a2eb4,_0x1c99aa){var _0x5ece62=this;var _0x4c726d=uuid['v4']();this[_0x2017('0x26')][_0x4c726d]=new Action(_0x2a2eb4,_0x1c99aa,_0x4c726d);return new Promise(function(_0x3e0431,_0x39f1f7){if(_['isUndefined'](_0x2a2eb4)&&typeof _0x2a2eb4!=='object'){return _0x39f1f7(msgResponse(_0x2017('0x159'),_0x2017('0x93'),_0x2017('0x15a')));}if(_[_0x2017('0x41')](_0x1c99aa['phone'])||_0x1c99aa[_0x2017('0x15b')]===null){return _0x39f1f7(msgResponse(_0x2017('0x159'),_0x2017('0x93'),_0x2017('0x15c')));}var _0x446ada={'XMD-CALLERID':_0x5ece62['actions'][_0x4c726d][_0x2017('0x15d')](),'XMD-AGI':_0x2a2eb4[_0x2017('0x15e')]?util[_0x2017('0x7c')](_0x2017('0x15f'),ipAgi,_0x2a2eb4[_0x2017('0x15e')]):_0x2017('0x160'),'XMD-AGIAFTER':_0x2a2eb4[_0x2017('0xc5')]?util['format'](_0x2017('0x15f'),ipAgi,_0x2a2eb4[_0x2017('0xc5')]):_0x2017('0x160'),'XMD-QUEUE':utils['isOutboundQueue'](_0x2a2eb4)?util[_0x2017('0x7c')]('\x22%s,%s%s,,,%s\x22',_0x2a2eb4['name'],_0x2a2eb4[_0x2017('0x161')]||'',_0x2a2eb4[_0x2017('0xc6')]?'c':'',_0x2a2eb4['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x1c99aa[_0x2017('0xdb')],'XMD-CDRTYPE':_0x2017('0x8'),'CALLERID(all)':_0x5ece62['actions'][_0x4c726d][_0x2017('0x15d')](),'XMD-AMD':_0x2a2eb4['dialAMDActive']?'ACTIVE':_0x2017('0x160'),'XMD-DESTINATION':_0x2017('0x10b')};if(_0x2a2eb4['dialAMDActive']){_0x446ada[_0x2017('0x162')]=_0x2a2eb4[_0x2017('0x163')]||0x9c4;_0x446ada[_0x2017('0x164')]=_0x2a2eb4[_0x2017('0x165')]||0x5dc;_0x446ada['XMD-AMDAFTERGREETINGSILENCE']=_0x2a2eb4[_0x2017('0x166')]||0x320;_0x446ada['XMD-AMDTOTALANALYSISTIME']=_0x2a2eb4[_0x2017('0x167')]||0x1388;_0x446ada[_0x2017('0x168')]=_0x2a2eb4[_0x2017('0x169')]||0x64;_0x446ada[_0x2017('0x16a')]=_0x2a2eb4[_0x2017('0x16b')]||0x32;_0x446ada['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x2a2eb4[_0x2017('0x16c')]||0x3;_0x446ada[_0x2017('0x16d')]=_0x2a2eb4[_0x2017('0x16e')]||0x100;_0x446ada[_0x2017('0x16f')]=_0x2a2eb4['dialAMDMaximumWordLength']||0x1388;}if(utils[_0x2017('0x170')](_0x2a2eb4)){_0x446ada[_0x2017('0x171')]=_0x1c99aa[_0x2017('0xdd')];}else{_0x446ada['XMD-CAMPAIGNID']=_0x1c99aa['CampaignId'];}var _0x49dd28=utils[_0x2017('0x172')](_0x1c99aa['Contact']);Object['assign'](_0x446ada,_0x49dd28);var _0x1facde=_0x5ece62[_0x2017('0x85')](_0x2a2eb4[_0x2017('0x8c')])?utils[_0x2017('0x173')](_0x2a2eb4[_0x2017('0x8c')]['callerid'],_0x2a2eb4['dialOriginateCallerIdName'],_0x2a2eb4[_0x2017('0x174')]>0x0?utils[_0x2017('0x175')](_0x2a2eb4[_0x2017('0x176')],_0x2a2eb4['dialRandomLastDigitCallerIdNumber']):_0x2a2eb4[_0x2017('0x176')]):utils[_0x2017('0x173')](_[_0x2017('0xef')](_0x2a2eb4[_0x2017('0x8d')])?_0x2a2eb4['Trunk'][_0x2017('0x177')]:_0x2a2eb4[_0x2017('0x8d')]['callerid'],_0x2a2eb4[_0x2017('0x178')],_0x2a2eb4[_0x2017('0x174')]>0x0?utils[_0x2017('0x175')](_0x2a2eb4[_0x2017('0x176')],_0x2a2eb4[_0x2017('0x174')]):_0x2a2eb4[_0x2017('0x176')]);if(_0x1facde){_0x446ada['XMD-ORIGINATECALLERIDNAME']=_0x5ece62['actions'][_0x4c726d][_0x2017('0x179')]=utils[_0x2017('0x17a')](_0x1facde);_0x446ada[_0x2017('0x17b')]=_0x1c99aa[_0x2017('0x15b')];}_0x2a2eb4[_0x2017('0x17c')]=_0x446ada;return ami[_0x2017('0x9b')]({'actionid':_0x4c726d,'action':_0x2017('0x159'),'channel':_0x5ece62[_0x2017('0x85')](_0x2a2eb4[_0x2017('0x8c')])?util[_0x2017('0x7c')](_0x2017('0x17d'),_0x2a2eb4[_0x2017('0x8c')][_0x2017('0x5f')],isNotNull(_0x2a2eb4['dialPrefix'])?_0x2a2eb4[_0x2017('0x17e')]['trim']()||'':'',_0x2a2eb4[_0x2017('0x17f')]>0x0?_0x1c99aa[_0x2017('0x15b')][_0x2017('0x180')](_0x2a2eb4[_0x2017('0x17f')]):_0x1c99aa['phone']):util['format']('SIP/%s/%s%s',_[_0x2017('0xef')](_0x2a2eb4['TrunkBackup'])?_0x2a2eb4[_0x2017('0x8c')][_0x2017('0x5f')]:_0x2a2eb4[_0x2017('0x8d')][_0x2017('0x5f')],isNotNull(_0x2a2eb4[_0x2017('0x17e')])?_0x2a2eb4[_0x2017('0x17e')]['trim']()||'':'',_0x2a2eb4[_0x2017('0x17f')]>0x0?_0x1c99aa[_0x2017('0x15b')]['substring'](_0x2a2eb4[_0x2017('0x17f')]):_0x1c99aa[_0x2017('0x15b')]),'callerid':_0x1facde,'Exten':'xcally-motion-dialer','Context':_0x2017('0x181'),'Priority':'1','variable':_0x446ada,'timeout':(_0x2a2eb4[_0x2017('0x182')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4c726d})['then'](function(_0x2531f9){return _0x3e0431(_0x2531f9);})['catch'](function(_0x1878fc){_0x2a2eb4['outboundOriginateFailureCallsDay']+=0x1;var _0x2025a6=new History(_0x5ece62['actions'][_0x4c726d]);logger[_0x2017('0x64')](util['format']('[originateError]:\x20%s',JSON['stringify'](_0x1878fc)));_0x2025a6[_0x2017('0x6d')]=0xe;_0x2025a6[_0x2017('0x6e')]=_0x2017('0x183');_0x2025a6['starttime']=moment()['format'](_0x2017('0xc2'));_0x2025a6[_0x2017('0x6f')]=_0x2025a6['starttime'];hopperUtils[_0x2017('0xc7')](_0x2025a6)['catch'](loggerCatch(_0x2017('0x184')));_0x5ece62['moveContactManagedDialer'](_0x2025a6)[_0x2017('0xa2')](loggerCatch(_0x2017('0x184')))['finally'](function(){delete _0x5ece62[_0x2017('0x26')][_0x4c726d];return _0x39f1f7(msgResponse(_0x2017('0x159'),_0x2017('0x84'),_0x2017('0x185')));});});});};Dialer['prototype'][_0x2017('0x186')]=function(_0x47461d,_0x363307,_0xf8336a){var _0x31877a=new History(_0x363307);if(_0x31877a[_0x2017('0x11b')]+_0x31877a[_0x2017('0x128')]+_0x31877a[_0x2017('0x11c')]+_0x31877a[_0x2017('0x11d')]+_0x31877a[_0x2017('0xd3')]+_0x31877a['countabandonedretry']+_0x31877a[_0x2017('0x11e')]+_0x31877a[_0x2017('0x187')]>=_0xf8336a['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x47461d){case 0x3:if(_0x31877a[_0x2017('0x11c')]>=_0xf8336a[_0x2017('0x188')]-0x1){return!![];}hopperUtils[_0x2017('0xd9')]({'active':![],'countnoanswerretry':_0x31877a[_0x2017('0x11c')]+=0x1,'scheduledat':moment()['add'](_0xf8336a[_0x2017('0x189')],_0x2017('0xda'))[_0x2017('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x31877a[_0x2017('0xdb')],'ListId':_0x31877a[_0x2017('0xdc')],'VoiceQueueId':_0x31877a['VoiceQueueId']||undefined,'CampaignId':_0x31877a[_0x2017('0xe9')]||undefined})[_0x2017('0xa2')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x31877a[_0x2017('0x11b')]>=_0xf8336a[_0x2017('0x18a')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x31877a[_0x2017('0x11b')]+=0x1,'scheduledat':moment()[_0x2017('0x18b')](_0xf8336a[_0x2017('0x18c')],_0x2017('0xda'))[_0x2017('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x31877a['ContactId'],'ListId':_0x31877a[_0x2017('0xdc')],'VoiceQueueId':_0x31877a[_0x2017('0xdd')]||undefined,'CampaignId':_0x31877a['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x31877a[_0x2017('0x128')]>=_0xf8336a[_0x2017('0x18d')]-0x1){return!![];}hopperUtils[_0x2017('0xd9')]({'active':![],'countcongestionretry':_0x31877a[_0x2017('0x128')]+=0x1,'scheduledat':moment()[_0x2017('0x18b')](_0xf8336a[_0x2017('0x18e')],_0x2017('0xda'))[_0x2017('0x7c')](_0x2017('0xc2')),'ContactId':_0x31877a[_0x2017('0xdb')],'ListId':_0x31877a[_0x2017('0xdc')],'VoiceQueueId':_0x31877a['VoiceQueueId']||undefined,'CampaignId':_0x31877a['CampaignId']||undefined})[_0x2017('0xa2')](loggerCatch(_0x2017('0x18f')));break;case 0x0:if(_0x31877a[_0x2017('0x11d')]>=_0xf8336a[_0x2017('0x190')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x31877a[_0x2017('0x11d')]+=0x1,'scheduledat':moment()[_0x2017('0x18b')](_0xf8336a['dialNoSuchNumberRetryFrequency'],_0x2017('0xda'))[_0x2017('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x31877a[_0x2017('0xdb')],'ListId':_0x31877a['ListId'],'VoiceQueueId':_0x31877a[_0x2017('0xdd')]||undefined,'CampaignId':_0x31877a[_0x2017('0xe9')]||undefined})[_0x2017('0xa2')](loggerCatch(_0x2017('0x191')));}break;case 0xa:if(_0x31877a['countdropretry']>=_0xf8336a[_0x2017('0x192')]-0x1){return!![];}hopperUtils[_0x2017('0xd9')]({'active':![],'countdropretry':_0x31877a['countdropretry']+=0x1,'scheduledat':moment()[_0x2017('0x18b')](_0xf8336a[_0x2017('0xd4')],_0x2017('0xda'))[_0x2017('0x7c')](_0x2017('0xc2')),'ContactId':_0x31877a['ContactId'],'ListId':_0x31877a[_0x2017('0xdc')],'VoiceQueueId':_0x31877a[_0x2017('0xdd')]||undefined,'CampaignId':_0x31877a[_0x2017('0xe9')]||undefined})[_0x2017('0xa2')](loggerCatch(_0x2017('0x193')));break;case 0xb:if(_0x31877a[_0x2017('0xe5')]>=_0xf8336a[_0x2017('0xe8')]-0x1){return!![];}hopperUtils[_0x2017('0xd9')]({'active':![],'countabandonedretry':_0x31877a[_0x2017('0xe5')]+=0x1,'scheduledat':moment()[_0x2017('0x18b')](_0xf8336a['dialAbandonedRetryFrequency'],_0x2017('0xda'))[_0x2017('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x31877a[_0x2017('0xdb')],'ListId':_0x31877a[_0x2017('0xdc')],'VoiceQueueId':_0x31877a['VoiceQueueId']||undefined,'CampaignId':_0x31877a[_0x2017('0xe9')]||undefined})['catch'](loggerCatch(_0x2017('0xea')));break;case 0x13:if(_0x31877a[_0x2017('0x11e')]>=_0xf8336a['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x31877a['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0xf8336a[_0x2017('0x124')],_0x2017('0xda'))[_0x2017('0x7c')](_0x2017('0xc2')),'ContactId':_0x31877a['ContactId'],'ListId':_0x31877a['ListId'],'VoiceQueueId':_0x31877a['VoiceQueueId']||undefined,'CampaignId':_0x31877a['CampaignId']||undefined})['catch'](loggerCatch(_0x2017('0x194')));break;case 0x14:if(_0x31877a[_0x2017('0x187')]>=_0xf8336a[_0x2017('0x195')]-0x1){return!![];}hopperUtils[_0x2017('0xd9')]({'active':![],'countagentrejectretry':_0x31877a[_0x2017('0x187')]+=0x1,'scheduledat':moment()[_0x2017('0x18b')](_0xf8336a[_0x2017('0x196')],_0x2017('0xda'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x31877a['ContactId'],'ListId':_0x31877a['ListId'],'VoiceQueueId':_0x31877a[_0x2017('0xdd')]||undefined,'CampaignId':_0x31877a[_0x2017('0xe9')]||undefined})[_0x2017('0xa2')](loggerCatch(_0x2017('0x197')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x3a2ba2,_0x2bd3ea,_0x5186c6){var _0x4e6b25=this;var _0x13203f=new History(_0x3a2ba2);var _0xd1211=![];var _0x336b9a;var _0x2dbfd1;return new Promise(function(_0x238519,_0x5b2573){if(_[_0x2017('0x41')](_0x2bd3ea)&&typeof _0x2bd3ea!==_0x2017('0x198')){return _0x5b2573(msgResponse(_0x2017('0x199'),_0x2017('0x93'),_0x2017('0x19a')));}if(_['isUndefined'](_0x5186c6)&&typeof _0x5186c6!==_0x2017('0x198')){return _0x5b2573(msgResponse('[callProgressDetecting]',_0x2017('0x93'),_0x2017('0x19b')));}hopperUtils[_0x2017('0xd6')](_0x13203f,_0x5186c6[_0x2017('0x19c')],_0x2bd3ea)[_0x2017('0xa3')](function(_0x354832){if(_0x354832[_0x2017('0xd8')]==0x1)_0xd1211=!![];switch(_0x5186c6[_0x2017('0x19c')]){case'0':_0x2bd3ea[_0x2017('0x19d')]+=0x1;_0x13203f[_0x2017('0x6d')]=0x0;_0x13203f[_0x2017('0x6e')]=_0x2017('0x19e');_0x13203f[_0x2017('0x11d')]+=0x1;_0x13203f[_0x2017('0xe6')]+=0x1;ami[_0x2017('0x112')](_0x2017('0x19f'),ut['buildObj'](_0x3a2ba2,'nosuchnumber'));_0x336b9a=_0x2bd3ea[_0x2017('0x1a0')];_0x2dbfd1=_0x2bd3ea[_0x2017('0xd5')];hopperUtils['createHistory'](_0x13203f)[_0x2017('0xa2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4e6b25[_0x2017('0x186')](0x0,_0x3a2ba2,_0x2bd3ea)&&!_0xd1211){if(_0x13203f[_0x2017('0x11d')]>=_0x2bd3ea[_0x2017('0x190')]){_0x4e6b25[_0x2017('0x122')](_0x13203f,_0x238519,_0x5b2573,'reason\x200\x20no\x20such\x20number....');}else{_0x4e6b25['stateGlobal'](_0x13203f,_0x238519,_0x5b2573,_0x2017('0x1a1'));}}break;case'3':_0x2bd3ea[_0x2017('0x1a2')]+=0x1;_0x13203f[_0x2017('0x6d')]=0x3;_0x13203f['statedesc']=_0x2017('0x1a3');_0x13203f[_0x2017('0x11c')]+=0x1;_0x13203f[_0x2017('0xe6')]+=0x1;var _0x553c24=ut[_0x2017('0x1a4')](_0x3a2ba2,_0x2bd3ea);ami[_0x2017('0x112')]('custom:agentnoanswer',_0x553c24);_0x336b9a=_0x2bd3ea[_0x2017('0x189')];_0x2dbfd1=_0x2bd3ea[_0x2017('0xd5')];hopperUtils['createHistory'](_0x13203f)[_0x2017('0xa2')](loggerCatch(_0x2017('0x1a5')));if(_0x4e6b25['checkRetriveMax'](0x3,_0x3a2ba2,_0x2bd3ea)&&!_0xd1211){if(_0x13203f[_0x2017('0x11c')]>=_0x2bd3ea[_0x2017('0x188')]){_0x4e6b25['createStateFinal'](_0x13203f,_0x238519,_0x5b2573,_0x2017('0x1a6'));}else{_0x4e6b25[_0x2017('0x120')](_0x13203f,_0x238519,_0x5b2573,_0x2017('0x1a6'));}}break;case'5':_0x2bd3ea[_0x2017('0x1a7')]+=0x1;_0x13203f[_0x2017('0x6d')]=0x5;_0x13203f[_0x2017('0x6e')]=_0x2017('0x1a8');_0x13203f[_0x2017('0x11b')]+=0x1;_0x13203f['countglobal']+=0x1;ami[_0x2017('0x112')](_0x2017('0x1a9'),ut[_0x2017('0x114')](_0x3a2ba2,'busy'));_0x336b9a=_0x2bd3ea[_0x2017('0x18c')];_0x2dbfd1=_0x2bd3ea[_0x2017('0xd5')];hopperUtils[_0x2017('0xc7')](_0x13203f)[_0x2017('0xa2')](loggerCatch(_0x2017('0x1aa')));if(_0x4e6b25['checkRetriveMax'](0x5,_0x3a2ba2,_0x2bd3ea)&&!_0xd1211){if(_0x13203f[_0x2017('0x11b')]>=_0x2bd3ea['dialBusyMaxRetry']){_0x4e6b25[_0x2017('0x122')](_0x13203f,_0x238519,_0x5b2573,_0x2017('0x1ab'));}else{_0x4e6b25[_0x2017('0x120')](_0x13203f,_0x238519,_0x5b2573,_0x2017('0x1ab'));}}break;case'8':_0x2bd3ea['outboundCongestionCallsDay']+=0x1;_0x13203f['state']=0x8;_0x13203f[_0x2017('0x6e')]='Congestion';_0x13203f[_0x2017('0x128')]+=0x1;_0x13203f[_0x2017('0xe6')]+=0x1;_0x336b9a=_0x2bd3ea[_0x2017('0x18e')];_0x2dbfd1=_0x2bd3ea['callAdditionalPhoneAfterMin'];ami['emit'](_0x2017('0x1ac'),ut[_0x2017('0x114')](_0x3a2ba2,_0x2017('0x1ad')));hopperUtils['createHistory'](_0x13203f)[_0x2017('0xa2')](loggerCatch(_0x2017('0x1ae')));if(_0x4e6b25[_0x2017('0x186')](0x8,_0x3a2ba2,_0x2bd3ea)&&!_0xd1211){if(_0x13203f['countcongestionretry']>=_0x2bd3ea['dialCongestionMaxRetry']){_0x4e6b25['createStateFinal'](_0x13203f,_0x238519,_0x5b2573,_0x2017('0x1af'));}else{_0x4e6b25['stateGlobal'](_0x13203f,_0x238519,_0x5b2573,_0x2017('0x1af'));}}break;case'11':_0x2bd3ea[_0x2017('0x1b0')]+=0x1;_0x13203f['state']=0xb;_0x13203f[_0x2017('0x6e')]=_0x2017('0xeb');_0x13203f['countabandonedretry']+=0x1;_0x13203f[_0x2017('0xe6')]+=0x1;_0x336b9a=_0x2bd3ea['dialAbandonedRetryFrequency'];_0x2dbfd1=_0x2bd3ea[_0x2017('0xd5')];hopperUtils[_0x2017('0xc7')](_0x13203f)[_0x2017('0xa2')](loggerCatch(_0x2017('0x1b1')));if(_0x4e6b25[_0x2017('0x186')](0xb,_0x3a2ba2,_0x2bd3ea)&&!_0xd1211){if(_0x13203f[_0x2017('0xe5')]>=_0x2bd3ea[_0x2017('0xe8')]){_0x4e6b25[_0x2017('0x122')](_0x13203f,_0x238519,_0x5b2573,_0x2017('0x1b2'));}else{_0x4e6b25[_0x2017('0x120')](_0x13203f,_0x238519,_0x5b2573,_0x2017('0x1b2'));}}break;case'20':_0x2bd3ea[_0x2017('0x1b3')]+=0x1;_0x13203f[_0x2017('0x6d')]=0x14;_0x13203f[_0x2017('0x6e')]='AgentReject';_0x13203f[_0x2017('0x187')]+=0x1;_0x13203f[_0x2017('0xe6')]+=0x1;_0x336b9a=_0x2bd3ea[_0x2017('0x196')];_0x2dbfd1=_0x2bd3ea['callAdditionalPhoneAfterMin'];ami['emit'](_0x2017('0x1b4'),ut[_0x2017('0x114')](_0x3a2ba2,_0x2017('0x1b5')));hopperUtils[_0x2017('0xc7')](_0x13203f)[_0x2017('0xa2')](loggerCatch(_0x2017('0x1b6')));if(_0x4e6b25['checkRetriveMax'](0x14,_0x3a2ba2,_0x2bd3ea)&&!_0xd1211){if(_0x13203f[_0x2017('0x187')]>=_0x2bd3ea[_0x2017('0x195')]){_0x4e6b25[_0x2017('0x122')](_0x13203f,_0x238519,_0x5b2573,'reason\x2020\x20agentreject');}else{_0x4e6b25[_0x2017('0x120')](_0x13203f,_0x238519,_0x5b2573,_0x2017('0x1b7'));}}break;default:_0x2bd3ea[_0x2017('0x12d')]+=0x1;_0x13203f['state']=0xc;_0x13203f[_0x2017('0x6e')]=_0x5186c6['reason'];_0x336b9a=_0x2bd3ea[_0x2017('0x196')];_0x2dbfd1=_0x2bd3ea[_0x2017('0xd5')];hopperUtils[_0x2017('0xc7')](_0x13203f)['catch'](loggerCatch(_0x2017('0x1b8')));if(_0x4e6b25['checkRetriveMax'](_0x5186c6[_0x2017('0x19c')],_0x3a2ba2,_0x2bd3ea)&&!_0xd1211){if(_0x13203f['countbusyretry']+_0x13203f[_0x2017('0x128')]+_0x13203f[_0x2017('0x11c')]+_0x13203f[_0x2017('0x11d')]+_0x13203f[_0x2017('0xd3')]+_0x13203f[_0x2017('0xe5')]+_0x13203f[_0x2017('0x11e')]+_0x13203f[_0x2017('0x187')]>=_0x2bd3ea[_0x2017('0x11f')]){_0x4e6b25['stateGlobal'](_0x13203f,_0x238519,_0x5b2573,_0x5186c6[_0x2017('0x19c')]);}else{_0x4e6b25[_0x2017('0x122')](_0x13203f,_0x238519,_0x5b2573,_0x5186c6['reason']);}}}})['then'](function(){if(_0xd1211){hopperUtils[_0x2017('0xe1')](_0x13203f,_0x336b9a,_0x2dbfd1)[_0x2017('0xa3')](function(){return _0x238519(0x1);});}});});};Dialer[_0x2017('0x1b')]['stateGlobal']=function(_0x3621dc,_0x39d265,_0x316af3,_0x493d36){var _0x18e622=new Final(_0x3621dc);_0x18e622[_0x2017('0x6d')]=0xf;_0x18e622[_0x2017('0x6e')]=_0x2017('0x1b9');this[_0x2017('0x122')](_0x18e622,_0x39d265,_0x316af3,_0x493d36);};Dialer[_0x2017('0x1b')][_0x2017('0x122')]=function(_0x2ffedc,_0x36462e,_0x9c459d,_0x2d111b){hopperUtils[_0x2017('0xc9')](_0x2ffedc)[_0x2017('0xa3')](function(){return _0x36462e(msgResponse(_0x2017('0x199'),_0x2017('0x105'),_0x2d111b));})['catch'](function(){return _0x9c459d(msgResponse(_0x2017('0x1ba'),_0x2017('0x93'),_0x2017('0x1bb')));});};Dialer[_0x2017('0x1b')][_0x2017('0xb')]=function(_0x2f5878){var _0x31d3a9=_0x2f5878[_0x2017('0x1bc')]/0x64;var _0x357c63=_0x2f5878[_0x2017('0xcf')]/(_0x2f5878[_0x2017('0xcf')]+_0x2f5878[_0x2017('0xc3')]);var _0x59564c=Math[_0x2017('0x1bd')](_0x2f5878[_0x2017('0x1be')]*(_0x2f5878['predictiveIntervalMaxThreshold']/0x64));var _0x20484e=Math[_0x2017('0x1bd')](_0x2f5878[_0x2017('0x1be')]*(_0x2f5878[_0x2017('0x1bf')]/0x64));var _0x26ebbe=_0x2f5878[_0x2017('0x133')]+_0x2f5878[_0x2017('0x135')];var _0x1fc52e=Math[_0x2017('0x1c0')](_0x2f5878[_0x2017('0x57')]*_0x2f5878[_0x2017('0x5b')]*_0x2f5878[_0x2017('0x1c1')]*_0x2f5878[_0x2017('0x1c2')]);if(_[_0x2017('0x41')](_0x2f5878[_0x2017('0x2a')])){if(!_[_0x2017('0x41')](_0x2f5878[_0x2017('0x29')])){_0x2f5878[_0x2017('0x29')]=undefined;loggerPredictive['error'](_0x2017('0x1c3'),_0x2017('0x1c4'));}if(!_[_0x2017('0x41')](_0x2f5878[_0x2017('0x62')])){loggerPredictive[_0x2017('0x64')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x2f5878[_0x2017('0x62')]);_0x2f5878['handlePredictive']=undefined;}_0x2f5878['startProgressive']=moment()['format'](_0x2017('0xc2'));loggerPredictive[_0x2017('0x48')](_0x2f5878[_0x2017('0x5f')],_0x2017('0x1c5'),_0x2f5878['startProgressive']);this['handlePower'](_0x2f5878,0x1);}else if(ifInterval(_0x2f5878[_0x2017('0x1c6')],_0x2f5878[_0x2017('0x2a')])){this[_0x2017('0xb2')](_0x2f5878,0x1);loggerPredictiveCalls[_0x2017('0x48')]('[startMethodPredictive][StartProgressive][Loop]',_0x2f5878['startProgressive'],_0x2f5878[_0x2017('0x5f')]);_0x2f5878[_0x2017('0x57')]=0x0;_0x2f5878[_0x2017('0xd0')]=0x0;}else if(_0x31d3a9<_0x357c63&&_0x2f5878['dialPredictiveOptimization']===_0x2017('0x1c7')){clearPredictiveAttributes(_0x2f5878);loggerPredictive[_0x2017('0x48')](_0x2017('0x1c8'),_0x2017('0x1c9'),_0x357c63,_0x2017('0x2a'),_0x2f5878['name']);}else if(_0x1fc52e<_0x2f5878['predictiveIntervalErlangCallsDroppedCalls']&&_0x2f5878['dialPredictiveOptimization']===_0x2017('0x1c7')){clearPredictiveAttributes(_0x2f5878);loggerPredictive[_0x2017('0x48')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x2017('0x1ca'),_0x1fc52e,'Drop\x20in\x20this\x20interval',_0x2f5878[_0x2017('0xd0')],_0x2017('0x2a'),_0x2f5878[_0x2017('0x5f')]);}else if(!ifInterval(_0x2f5878[_0x2017('0x1c6')],_0x2f5878[_0x2017('0x2a')])&&_[_0x2017('0x41')](_0x2f5878[_0x2017('0x29')])&&!_[_0x2017('0x41')](_0x2f5878[_0x2017('0x2a')])){_0x2f5878['startPredictive']=moment()[_0x2017('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x2f5878[_0x2017('0x5f')],_0x2017('0x1cb'),_0x2f5878[_0x2017('0x29')]);hopperUtils[_0x2017('0x1cc')](_0x2f5878[_0x2017('0x1c6')])['then'](this[_0x2017('0x1cd')](_0x2f5878))[_0x2017('0xa3')](mergeDataErlangB(_0x2f5878))[_0x2017('0xa3')](this['startMethodPredictive'](_0x2f5878))['catch'](loggerCatchPredictive(_0x2017('0x1ce'),_0x2f5878));}else if(!ifInterval(_0x2f5878[_0x2017('0x1c6')],_0x2f5878[_0x2017('0x29')])){_0x2f5878['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2f5878[_0x2017('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x2f5878[_0x2017('0x5f')],_0x2017('0x1cf'),_0x2f5878[_0x2017('0x29')]);clearInterval(_0x2f5878[_0x2017('0x62')]);_0x2f5878['handlePredictive']=undefined;hopperUtils[_0x2017('0x1cc')](_0x2f5878[_0x2017('0x1c6')])[_0x2017('0xa3')](this['getDataPredictive'](_0x2f5878))[_0x2017('0xa3')](mergeDataErlangB(_0x2f5878))[_0x2017('0xa3')](this[_0x2017('0x1d0')](_0x2f5878))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x2f5878));}else if(_0x2f5878[_0x2017('0x1be')]&&_0x26ebbe<_0x2f5878['predictiveIntervalAvailable']-_0x20484e){clearPredictiveAttributes(_0x2f5878);loggerPredictive[_0x2017('0x48')](_0x2f5878[_0x2017('0x5f')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x26ebbe,_0x2017('0x1d1'),_0x2f5878['predictiveIntervalAvailable'],'-',_0x20484e,'=',_0x2f5878[_0x2017('0x1be')]-_0x20484e,')');}else if(_0x2f5878[_0x2017('0x1be')]&&_0x26ebbe>_0x2f5878[_0x2017('0x1be')]+_0x59564c){clearPredictiveAttributes(_0x2f5878);loggerPredictive[_0x2017('0x48')](_0x2f5878[_0x2017('0x5f')],_0x2017('0x1d2'),_0x26ebbe,_0x2017('0x1d3'),_0x2f5878[_0x2017('0x1be')],'+',_0x59564c,'=',_0x2f5878[_0x2017('0x1be')]+_0x59564c,')');}};Dialer[_0x2017('0x1b')][_0x2017('0x1cd')]=function(_0x2e11cc){var _0x5c7aaa=this;return function(_0x137bb4){return new Promise(function(_0x4d2b95,_0x4207ed){_[_0x2017('0x5e')](_0x2e11cc,_0x137bb4[0x0]);if(checkGetDataPredictive(_0x137bb4[0x0])){var _0x446427=_0x2e11cc[_0x2017('0x1be')]=_0x2e11cc[_0x2017('0x135')]+_0x2e11cc[_0x2017('0x133')];var _0x410e1a=_0x2e11cc[_0x2017('0x1c6')]*0x3c;var _0x22464e=_0x137bb4[0x0][_0x2017('0x51')]+_0x137bb4[0x0][_0x2017('0x4f')];var _0x52dab7=(_0x137bb4[0x0][_0x2017('0x4b')]+_0x137bb4[0x0][_0x2017('0x4d')]+_0x137bb4[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x137bb4[0x0][_0x2017('0x1d4')];_0x2e11cc[_0x2017('0x1c1')]=_0x52dab7>0x0?_0x52dab7:0x1;switch(_0x2e11cc[_0x2017('0x1d5')]){case _0x2017('0x1c7'):var _0x578def=_0x2e11cc[_0x2017('0x1bc')]/0x64;return _0x5c7aaa[_0x2017('0x1d6')](_0x446427,_0x410e1a,_0x22464e,_0x52dab7,_0x578def)[_0x2017('0xa3')](function(_0x4a6832){return _0x4d2b95(_0x4a6832);});case _0x2017('0x1d7'):var _0x45cf53=_0x2e11cc['dialPredictiveOptimizationPercentage']/0x64;return _0x5c7aaa['busyFactor'](_0x446427,_0x410e1a,_0x22464e,_0x52dab7,_0x45cf53)[_0x2017('0xa3')](function(_0x2576e0){return _0x4d2b95(_0x2576e0);});default:return _0x4207ed(msgResponse(_0x2017('0x1d8'),_0x2017('0x93'),_0x2017('0x1d9')));}}else{return _0x4207ed(msgResponse(_0x2017('0x1d8'),'Failure',_0x2017('0x1da')));}});};};Dialer[_0x2017('0x1b')]['getDataPredictiveOld']=function(_0x13d472){var _0x11e0c0=this;return function(_0x520888){return new Promise(function(_0x3b5274,_0x5b87ed){_[_0x2017('0x5e')](_0x13d472,_0x520888[0x0]);if(checkGetDataPredictive(_0x520888[0x0])){loggerPredictive[_0x2017('0x48')](JSON[_0x2017('0x72')](_0x520888[0x0]));if(_0x13d472['dialPredictiveOptimization']===_0x2017('0x1c7')){return _0x11e0c0[_0x2017('0x14a')](_0x13d472['id'])[_0x2017('0xa3')](function(_0x7fd125){var _0x24b21e=_0x13d472[_0x2017('0x1db')]-_0x7fd125[0x0][_0x2017('0x1dc')];var _0x1f9948=_0x13d472['dialPredictiveInterval']*0x3c;var _0x433cb8=_0x520888[0x0][_0x2017('0x51')]+_0x520888[0x0]['predictiveIntervalAvgHoldtime'];var _0x2dc29b=(_0x520888[0x0]['predictiveIntervalAnsweredCalls']+_0x520888[0x0][_0x2017('0x4d')]+_0x520888[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x520888[0x0][_0x2017('0x1d4')];var _0x2ebc64=_0x13d472['dialPredictiveOptimizationPercentage']/0x64;_0x13d472[_0x2017('0x1dd')]=_0x7fd125[0x0][_0x2017('0x1dc')]||0x0;_0x13d472[_0x2017('0x1c1')]=_0x2dc29b>0x0?_0x2dc29b:0x1;return _0x11e0c0[_0x2017('0x1d6')](_0x24b21e,_0x1f9948,_0x433cb8,_0x2dc29b,_0x2ebc64);})['then'](function(_0x1715cc){return _0x3b5274(_0x1715cc);})[_0x2017('0xa2')](function(_0x585445){return _0x5b87ed(msgResponse('[CatchErlangB]',_0x2017('0x93'),JSON[_0x2017('0x72')](_0x585445)));});}if(_0x13d472[_0x2017('0x1d5')]===_0x2017('0x1d7')){return _0x11e0c0[_0x2017('0x14a')](_0x13d472['id'])[_0x2017('0xa3')](function(_0x2cc8db){var _0x1f459c=_0x13d472['loggedIn']-_0x2cc8db[0x0]['outboundQueuePauses'];var _0x3931c0=_0x13d472[_0x2017('0x1c6')]*0x3c;var _0x4caee2=_0x520888[0x0]['predictiveIntervalAvgTalktime']+_0x520888[0x0][_0x2017('0x4f')];var _0x2528b2=(_0x520888[0x0][_0x2017('0x4b')]+_0x520888[0x0][_0x2017('0x4d')]+_0x520888[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x520888[0x0][_0x2017('0x1d4')];var _0x5a1170=_0x13d472['dialPredictiveOptimizationPercentage']/0x64;_0x13d472['predictiveIntervalPauses']=_0x2cc8db[0x0][_0x2017('0x1dc')]||0x0;_0x13d472[_0x2017('0x1c1')]=_0x2528b2>0x0?_0x2528b2:0x1;return _0x11e0c0['busyFactor'](_0x1f459c,_0x3931c0,_0x4caee2,_0x2528b2,_0x5a1170);})[_0x2017('0xa3')](function(_0x595b66){return _0x3b5274(_0x595b66);})[_0x2017('0xa2')](function(_0x2d4acd){return _0x5b87ed(msgResponse('[CatchErlangB]',_0x2017('0x93'),JSON[_0x2017('0x72')](_0x2d4acd)));});}}else{return _0x5b87ed(msgResponse(_0x2017('0x1d8'),_0x2017('0x93'),_0x2017('0x1da')));}});};};Dialer['prototype'][_0x2017('0x1d0')]=function(_0x554a74){var _0xe7bb9b=this;return function(){var _0x4899af=0x0;var _0x2d5e1c=Math[_0x2017('0x1c0')](_0x554a74[_0x2017('0x59')]*0x3e8);if(_0x2d5e1c>0x0){_0x2d5e1c=_0x2d5e1c<0x64?0x64:_0x2d5e1c;loggerPredictive[_0x2017('0x48')](_0x554a74[_0x2017('0x5f')],'one\x20call\x20every:',_0x2d5e1c,_0x2017('0x1de'));_0x554a74[_0x2017('0x62')]=setInterval(function(){_0xe7bb9b[_0x2017('0x62')](_0x554a74);loggerPredictiveCalls['info'](_0x2017('0x1df'),_0x4899af+=0x1);},_0x2d5e1c);}else{loggerPredictive['info'](_0x554a74[_0x2017('0x5f')],_0x2017('0x1e0'));}};};Dialer['prototype'][_0x2017('0x1e1')]=function(_0x4116b3,_0x11ef7c){var _0x31bc18=this;return function(_0x3d1ba9){if(_[_0x2017('0x47')](_0x3d1ba9)){if(_[_0x2017('0xef')](_0x11ef7c[_0x2017('0x151')])||!_0x11ef7c[_0x2017('0x1e2')]){if(_0x4116b3[_0x2017('0xaf')]===_0x2017('0xa')){_0x4116b3['queueStatusComplete']=_[_0x2017('0x41')](_0x4116b3[_0x2017('0x70')])?!![]:_0x4116b3[_0x2017('0x70')];var _0x1e5b1a=uuid['v4']();_0x31bc18[_0x2017('0x26')][_0x1e5b1a]=new Action(_0x4116b3,_0x11ef7c,_0x1e5b1a);loggerBooked[_0x2017('0x48')](_0x2017('0x1e3'),_0x1e5b1a,_0x2017('0x1e4'),JSON[_0x2017('0x72')](_0x4116b3['queueStatusComplete']),_0x2017('0x1e5'),_0x4116b3[_0x2017('0x5f')]);if(_0x4116b3[_0x2017('0x70')]){_0x4116b3[_0x2017('0x70')]=![];_0x31bc18[_0x2017('0x2c')][_0x31bc18['actions'][_0x1e5b1a][_0x2017('0xbd')]]=[];ami[_0x2017('0x9b')]({'actionid':_0x1e5b1a,'action':_0x2017('0x1e6'),'queue':_0x4116b3[_0x2017('0x5f')]})['catch'](function(){_0x31bc18[_0x2017('0xc1')](_0x4116b3);hopperUtils[_0x2017('0xd9')]({'active':![],'ContactId':_0x31bc18[_0x2017('0x26')][_0x1e5b1a][_0x2017('0xdb')],'ListId':_0x31bc18['actions'][_0x1e5b1a][_0x2017('0xdc')],'VoiceQueueId':_0x31bc18['actions'][_0x1e5b1a][_0x2017('0xdd')]||undefined,'CampaignId':_0x31bc18[_0x2017('0x26')][_0x1e5b1a][_0x2017('0xe9')]||undefined})['catch'](loggerCatch(_0x2017('0x1e7')));delete _0x31bc18[_0x2017('0x26')][_0x1e5b1a];});}else{loggerBooked[_0x2017('0x48')](_0x2017('0x1e8'),JSON[_0x2017('0x72')](_0x4116b3['queueStatusComplete']),_0x2017('0x1e5'),_0x4116b3['name']);_0x31bc18[_0x2017('0xc1')](_0x4116b3);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x31bc18['actions'][_0x1e5b1a][_0x2017('0xdb')],'ListId':_0x31bc18[_0x2017('0x26')][_0x1e5b1a][_0x2017('0xdc')],'VoiceQueueId':_0x31bc18['actions'][_0x1e5b1a][_0x2017('0xdd')]||undefined,'CampaignId':_0x31bc18[_0x2017('0x26')][_0x1e5b1a]['CampaignId']||undefined})[_0x2017('0xa2')](loggerCatch(_0x2017('0x1e7')));delete _0x31bc18[_0x2017('0x26')][_0x1e5b1a];}}else{return _0x31bc18['actionOriginate'](_0x4116b3,_0x11ef7c);}}else{if(utils['getSeconds'](undefined,_0x11ef7c[_0x2017('0x1e9')])<_0x4116b3['dialRecallMeTimeout']*0x3c){if(_0x11ef7c['Agent']&&!_0x11ef7c[_0x2017('0x143')][_0x2017('0x1ea')]){_0x31bc18[_0x2017('0x1f')][_0x2017('0xf5')](_0x11ef7c['id'])[_0x2017('0x1d')](function(){_0x31bc18['updateOriginated'](_0x4116b3);});}else{hopperUtils[_0x2017('0x1eb')]({'active':![]},_0x11ef7c['id'],0x1)[_0x2017('0x1d')](function(){_0x31bc18[_0x2017('0xc1')](_0x4116b3);});}}else{_0x4116b3[_0x2017('0x1ec')]+=0x1;_0x31bc18[_0x2017('0xc1')](_0x4116b3);if(_0x4116b3[_0x2017('0x1ed')]){hopperUtils[_0x2017('0xd9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x11ef7c['ContactId'],'ListId':_0x11ef7c[_0x2017('0xdc')],'VoiceQueueId':_0x11ef7c[_0x2017('0xdd')]||undefined,'CampaignId':_0x11ef7c[_0x2017('0xe9')]||undefined})[_0x2017('0xa2')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x2017('0xc7')](createObjHistory(_0x4116b3,_0x11ef7c,utils[_0x2017('0x66')][_0x2017('0x1ee')],0x17,_0x2017('0x1ef')))[_0x2017('0xa2')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x31bc18[_0x2017('0x116')](createObjHistory(_0x4116b3,_0x11ef7c,utils[_0x2017('0x66')][_0x2017('0x1f0')],0x16,_0x2017('0x1f1')),'[Originate][HistoryRecallClose][historyCatch]',_0x2017('0x1f2'));}}}}else{_0x4116b3['outboundBlacklistCallsDay']+=0x1;_0x31bc18['saveInDb'](createObjHistory(_0x4116b3,_0x11ef7c,utils[_0x2017('0x66')]['BLACKLIST'],0xd,_0x2017('0x1f3')),'[Originate][historyBlacklist]',_0x2017('0x1f4'));throw'inBlackList';}};};Dialer[_0x2017('0x1b')][_0x2017('0x157')]=function(_0xbd8b4b){var _0x187354=this;var _0x2b9c98=_0xbd8b4b[_0x2017('0x1f5')]-_0xbd8b4b[_0x2017('0x80')];emitCampaignSummary(_0xbd8b4b);if(_0x2b9c98>0x0&&_0xbd8b4b[_0x2017('0x1f6')]==0x0){if(_0x2b9c98>this['maxNumberOriginate']){_0x2b9c98=this['maxNumberOriginate'];}_0xbd8b4b[_0x2017('0x1f6')]=0x1;hopperUtils[_0x2017('0x1f7')](_0xbd8b4b,_0x2b9c98)[_0x2017('0xa3')](function(_0x445ee1){_0xbd8b4b['temp']=0x0;if(_0x445ee1){if(!utils[_0x2017('0x1f8')](_0x445ee1)){_0xbd8b4b[_0x2017('0x6c')]=utils[_0x2017('0x66')][_0x2017('0x6a')];logger[_0x2017('0x48')](_0x2017('0x1f9')+_0xbd8b4b['name']);}else{_0xbd8b4b['originated']+=_0x445ee1['length'];_0xbd8b4b[_0x2017('0x6c')]=utils[_0x2017('0x66')][_0x2017('0x1fa')];for(var _0x173f68=0x0;_0x173f68<_0x445ee1['length'];_0x173f68+=0x1){_0xbd8b4b[_0x2017('0x1fb')]+=0x1;if(_[_0x2017('0xef')](_0x445ee1[_0x173f68])||_[_0x2017('0xef')](_0x445ee1[_0x173f68][_0x2017('0x1fc')])||_[_0x2017('0xef')](_0x445ee1[_0x173f68][_0x2017('0x15b')])){_0x187354[_0x2017('0x14f')]('[actionOriginate]\x20',_0xbd8b4b,_0x445ee1[_0x173f68]);}else{hopperUtils[_0x2017('0x1fd')](_[_0x2017('0x73')](_0x445ee1[_0x173f68],[_0x2017('0xe9'),_0x2017('0x15b')]))[_0x2017('0xa3')](_0x187354[_0x2017('0x1e1')](_0xbd8b4b,_0x445ee1[_0x173f68]))[_0x2017('0xa2')](_0x187354[_0x2017('0x14e')](_0x2017('0x1fe'),_0xbd8b4b));}}}}})[_0x2017('0xa2')](loggerGetContactDialer('[getContactCampaign2]',_0xbd8b4b,_0x2b9c98));}};Dialer[_0x2017('0x1b')]['handlePower']=function(_0x33b2c5,_0xc76849){var _0x5f499a=this;var _0x245b4e=[];if(_0xc76849<0x1||_0x33b2c5[_0x2017('0xaf')]===_0x2017('0xa')){_0xc76849=0x1;}var _0x1a25c2=Math['floor'](_0x33b2c5[_0x2017('0x133')]*_0xc76849)-_0x33b2c5['originated'];if(_0x33b2c5['dialLimitQueue']>0x0){var _0x196ff7=_0x33b2c5['dialLimitQueue']-_0x33b2c5[_0x2017('0x80')]-_0x33b2c5['talking']-_0x33b2c5['pTalking'];if(_0x1a25c2>_0x196ff7){_0x1a25c2=_0x196ff7;}}if(_0x1a25c2>0x0&&_0x33b2c5[_0x2017('0x1f6')]==0x0){if(_0x33b2c5['dialMethod']===_0x2017('0xa')){_0x1a25c2=0x1;}if(_0x1a25c2>this['maxNumberOriginate']){_0x1a25c2=this[_0x2017('0x24')];}for(var _0xde6609 in this[_0x2017('0x22')]){if(typeof this['agents'][_0xde6609]!=='undefined'){if(this[_0x2017('0x22')][_0xde6609][_0x2017('0x6d')]===_0x2017('0x1ff')&&this[_0x2017('0x22')][_0xde6609][_0x2017('0x88')]===_0x2017('0x89')){_0x245b4e[_0x2017('0x200')](this[_0x2017('0x22')][_0xde6609]['id']);}}}_0x33b2c5[_0x2017('0x1f6')]=0x1;hopperUtils['getContactDialer'](_0x33b2c5,_0x245b4e,_0x1a25c2)[_0x2017('0xa3')](function(_0x5c2e08){_0x33b2c5['temp']=0x0;if(_0x5c2e08){if(!utils[_0x2017('0x1f8')](_0x5c2e08)){hopperUtils[_0x2017('0x201')](_0x33b2c5)['then'](sendMessageReschedule(_0x33b2c5))[_0x2017('0xa2')](loggerCatch('[countReScheduled]\x20'));}else{_0x33b2c5['originated']+=_0x5c2e08[_0x2017('0xf8')];_0x33b2c5['message']=_0x33b2c5[_0x2017('0xaf')]===_0x2017('0xa')?utils[_0x2017('0x66')]['ACTIVE']:utils[_0x2017('0x66')][_0x2017('0x1fa')];for(var _0x7d1cfc=0x0;_0x7d1cfc<_0x5c2e08[_0x2017('0xf8')];_0x7d1cfc+=0x1){if(_[_0x2017('0xef')](_0x5c2e08[_0x7d1cfc])||_[_0x2017('0xef')](_0x5c2e08[_0x7d1cfc]['Contact'])||_[_0x2017('0xef')](_0x5c2e08[_0x7d1cfc][_0x2017('0x15b')])){_0x5f499a['emptyContact'](_0x2017('0x202'),_0x33b2c5,_0x5c2e08[_0x7d1cfc]);}else{hopperUtils['checkIsBlackList'](_['pick'](_0x5c2e08[_0x7d1cfc],[_0x2017('0xdd'),'phone']))[_0x2017('0xa3')](_0x5f499a[_0x2017('0x1e1')](_0x33b2c5,_0x5c2e08[_0x7d1cfc]))['catch'](_0x5f499a['loggerHandler']('[actionOriginate]\x20',_0x33b2c5));}}}}})[_0x2017('0xa2')](loggerGetContactDialer(_0x2017('0x203'),_0x33b2c5,_0x1a25c2));}};Dialer[_0x2017('0x1b')]['handlePredictive']=function(_0xa0cbaa){if(_0xa0cbaa[_0x2017('0x204')]>0x0){var _0x1afe5d=_0xa0cbaa[_0x2017('0x204')]-_0xa0cbaa['originated']-_0xa0cbaa[_0x2017('0x135')];if(_0x1afe5d>0x0&&_0xa0cbaa[_0x2017('0x1f6')]==0x0){this[_0x2017('0x205')](_0xa0cbaa);}else{loggerPredictiveCalls[_0x2017('0x48')](_0x2017('0x206'));}}else{this[_0x2017('0x205')](_0xa0cbaa);}};Dialer[_0x2017('0x1b')]['tryOriginatePredictive']=function(_0x370d60){var _0x264f95=this;var _0x1a9c58=[];_0x370d60['originated']+=0x1;for(var _0x345f8b in this[_0x2017('0x22')]){if(typeof this[_0x2017('0x22')][_0x345f8b]!==_0x2017('0xa8')){if(this['agents'][_0x345f8b]['state']==='not_inuse'&&this[_0x2017('0x22')][_0x345f8b][_0x2017('0x88')]===_0x2017('0x89')){_0x1a9c58[_0x2017('0x200')](this['agents'][_0x345f8b]['id']);}}}_0x370d60[_0x2017('0x1f6')]=0x1;return this[_0x2017('0x207')](_0x370d60['id'],_0x1a9c58,0x1,_0x370d60[_0x2017('0x208')],_0x370d60)[_0x2017('0xa3')](function(_0x357f9f){_0x370d60[_0x2017('0x1f6')]=0x1;if(_0x357f9f){if(!utils['checkContactEmpty'](_0x357f9f)){utils[_0x2017('0x209')](_0x370d60,0x1,0x0);return hopperUtils[_0x2017('0x201')](_0x370d60)[_0x2017('0xa3')](sendMessageReschedule(_0x370d60))[_0x2017('0xa2')](loggerCatch(_0x2017('0x20a')));}else{_0x370d60['message']=utils[_0x2017('0x66')][_0x2017('0x1fa')];if(_['isNil'](_0x357f9f[0x0])||_[_0x2017('0xef')](_0x357f9f[0x0][_0x2017('0x1fc')])||_[_0x2017('0xef')](_0x357f9f[0x0][_0x2017('0x15b')])){_0x264f95['emptyContact']('[actionOriginate]\x20',_0x370d60,_0x357f9f[0x0]);}else{return hopperUtils[_0x2017('0x20b')](_[_0x2017('0x73')](_0x357f9f[0x0],[_0x2017('0xdd'),'phone']))[_0x2017('0xa3')](_0x264f95[_0x2017('0x1e1')](_0x370d60,_0x357f9f[0x0]))['catch'](_0x264f95['loggerHandler'](_0x2017('0x20c'),_0x370d60));}}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x370d60,0x1));};Dialer[_0x2017('0x1b')][_0x2017('0x1d6')]=function(_0x1ce87b,_0x35b69e,_0x192321,_0x50d357,_0x4b1554,_0x3a5ae8){loggerPredictive[_0x2017('0x48')](_0x2017('0x20d'));loggerPredictive[_0x2017('0x48')](_0x2017('0x20e'),_0x1ce87b);loggerPredictive[_0x2017('0x48')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x35b69e);loggerPredictive[_0x2017('0x48')](_0x2017('0x20f'),_0x192321);loggerPredictive[_0x2017('0x48')](_0x2017('0x210'),_0x50d357);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b1554);loggerPredictive['info'](_0x2017('0x52'));return new Promise(function(_0x1701f3,_0xeff5d8){if(_0x1ce87b<=0x0||isNaN(_0x1ce87b)){return _0xeff5d8(msgResponse(_0x2017('0x211'),'Error',_0x2017('0x212')+_0x1ce87b));}if(_0x192321<=0x0||isNaN(_0x192321)){return _0xeff5d8(msgResponse(_0x2017('0x211'),_0x2017('0x84'),_0x2017('0x213')+_0x192321));}if(_0x50d357<=0x0||isNaN(_0x50d357)){return _0xeff5d8(msgResponse('[abandonmentRate]',_0x2017('0x84'),_0x2017('0x214')+_0x50d357));}if(_0x35b69e<=0x0||isNaN(_0x35b69e)){return _0xeff5d8(msgResponse(_0x2017('0x211'),_0x2017('0x84'),_0x2017('0x215')+_0x35b69e));}if(_0x4b1554<=0x0||isNaN(_0x4b1554)){return _0xeff5d8(msgResponse(_0x2017('0x211'),'Error','Amax\x20=\x20'+_0x4b1554));}_0x3a5ae8=_0x3a5ae8||0x0;var _0x1f0e2a=0x1/_0x192321;var _0x13608e=0x0;var _0x401e7f=0x0;var _0x26c1fe=0x0;var _0x357fe1=0x0;for(var _0x3b4c1d=0x0;_0x26c1fe<_0x4b1554;_0x3b4c1d+=0x1){_0x401e7f=_0x3b4c1d/_0x35b69e;_0x13608e=(_0x50d357*_0x401e7f+_0x3a5ae8)/_0x1f0e2a;_0x26c1fe=utils[_0x2017('0x216')](_0x13608e,_0x1ce87b);_0x357fe1=_0x13608e/_0x1ce87b*(0x1-utils['erlangb'](_0x13608e,_0x1ce87b));}return _0x1701f3({'erlangCalls':_0x3b4c1d,'erlangCallToSecond':_0x35b69e/_0x3b4c1d,'erlangAbandonmentRate':_0x26c1fe,'erlangBusyFactor':_0x357fe1});});};Dialer[_0x2017('0x1b')][_0x2017('0x217')]=function(_0x202bfa,_0x7e334c,_0x42a423,_0x10002b,_0xcd2825,_0x47edb5){loggerPredictive[_0x2017('0x48')](_0x2017('0x218'));loggerPredictive[_0x2017('0x48')]('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',_0x202bfa);loggerPredictive[_0x2017('0x48')](_0x2017('0x219'),_0x7e334c);loggerPredictive[_0x2017('0x48')](_0x2017('0x20f'),_0x42a423);loggerPredictive[_0x2017('0x48')]('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',_0x10002b);loggerPredictive[_0x2017('0x48')](_0x2017('0x21a'),_0xcd2825);loggerPredictive[_0x2017('0x48')]('---------------------------');return new Promise(function(_0x2cc070,_0x47be48){if(_0x202bfa<=0x0||isNaN(_0x202bfa)){return _0x47be48(msgResponse(_0x2017('0x21b'),_0x2017('0x84'),_0x2017('0x212')+_0x202bfa));}if(_0x42a423<=0x0||isNaN(_0x42a423)){return _0x47be48(msgResponse(_0x2017('0x21b'),_0x2017('0x84'),_0x2017('0x213')+_0x42a423));}if(_0x10002b<=0x0||isNaN(_0x10002b)){return _0x47be48(msgResponse('[busyFactor]',_0x2017('0x84'),'p\x20=\x20'+_0x10002b));}if(_0x7e334c<=0x0||isNaN(_0x7e334c)){return _0x47be48(msgResponse(_0x2017('0x21b'),'Error','interval\x20=\x20'+_0x7e334c));}if(_0xcd2825<=0x0||isNaN(_0xcd2825)){return _0x47be48(msgResponse('[busyFactor]',_0x2017('0x84'),'Umin\x20=\x20'+_0xcd2825));}_0x47edb5=_0x47edb5||0x0;var _0x2e66b3=0x1/_0x42a423;var _0x1d3149=0x0;var _0x3bf417=0x0;var _0x53b5ba=0x0;var _0x326c22=0x0;for(var _0x1166b2=0x0;_0x326c22<_0xcd2825;_0x1166b2+=0x1){_0x3bf417=_0x1166b2/_0x7e334c;_0x1d3149=(_0x10002b*_0x3bf417+_0x47edb5)/_0x2e66b3;_0x53b5ba=utils[_0x2017('0x216')](_0x1d3149,_0x202bfa);_0x326c22=_0x1d3149/_0x202bfa*(0x1-utils[_0x2017('0x216')](_0x1d3149,_0x202bfa));}return _0x2cc070({'erlangCalls':_0x1166b2,'erlangCallToSecond':_0x7e334c/_0x1166b2,'erlangAbandonmentRate':_0x53b5ba,'erlangBusyFactor':_0x326c22});});};module[_0x2017('0x21c')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 8d56cd2..d8fa41d 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6201=['exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','firstName','lastName','queue','name','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue'];(function(_0x2a6d47,_0x581e0d){var _0x3d67c1=function(_0x10a3d0){while(--_0x10a3d0){_0x2a6d47['push'](_0x2a6d47['shift']());}};_0x3d67c1(++_0x581e0d);}(_0x6201,0x1cd));var _0x1620=function(_0x47ed1a,_0x34e1d8){_0x47ed1a=_0x47ed1a-0x0;var _0x23b059=_0x6201[_0x47ed1a];return _0x23b059;};'use strict';var util=require(_0x1620('0x0'));var _=require(_0x1620('0x1'));var moment=require(_0x1620('0x2'));function checkNameSurname(_0x1a513a,_0x21a387,_0x364462){var _0x3f77fc='';if(!_[_0x1620('0x3')](_0x21a387)&&_0x1620('0x4')===typeof _0x21a387){_0x3f77fc+=_0x21a387;}if(!_[_0x1620('0x3')](_0x364462)&&_0x1620('0x4')===typeof _0x364462){_0x3f77fc+='\x20'+_0x364462;}if(_0x3f77fc!==''){return _0x3f77fc;}return _0x1a513a;}function Action(_0x141362,_0x55b90b,_0x449108){this[_0x1620('0x5')]=_0x141362;this[_0x1620('0x6')]=_0x449108||undefined;this['name']=checkNameSurname(_0x55b90b[_0x1620('0x7')][_0x1620('0x8')],_0x55b90b[_0x1620('0x7')][_0x1620('0x9')],_0x55b90b['Contact'][_0x1620('0xa')]);this['number']=_0x55b90b[_0x1620('0x8')];this[_0x1620('0xb')]=_0x141362[_0x1620('0xc')];this['active']=_0x55b90b['active']||![];this[_0x1620('0xd')]=_0x141362[_0x1620('0xd')];this[_0x1620('0xe')]=_0x141362['dialQueueTimeout']||0x3;this[_0x1620('0xf')]=_0x55b90b[_0x1620('0xf')];this['countbusyretry']=_0x55b90b[_0x1620('0x10')];this[_0x1620('0x11')]=_0x55b90b['countcongestionretry'];this[_0x1620('0x12')]=_0x55b90b[_0x1620('0x12')];this['countnosuchnumberretry']=_0x55b90b[_0x1620('0x13')];this['countdropretry']=_0x55b90b['countdropretry'];this[_0x1620('0x14')]=_0x55b90b[_0x1620('0x14')];this[_0x1620('0x15')]=_0x55b90b[_0x1620('0x15')];this['countagentrejectretry']=_0x55b90b[_0x1620('0x16')];this[_0x1620('0x17')]=_0x55b90b['ContactId'];this[_0x1620('0x18')]=_0x55b90b[_0x1620('0x18')];this[_0x1620('0x19')]=_0x55b90b[_0x1620('0x19')];this[_0x1620('0x1a')]=_0x55b90b[_0x1620('0x1a')];this[_0x1620('0x1b')]=_0x55b90b[_0x1620('0x1b')];this[_0x1620('0x1c')]=_0x55b90b['id'];this[_0x1620('0x1d')]=_0x55b90b['Contact']['firstName']||'';this['starttime']=moment()['format'](_0x1620('0x1e'));this[_0x1620('0x1f')]=_0x55b90b[_0x1620('0x1f')];this[_0x1620('0x20')]=_0x55b90b[_0x1620('0x20')];this[_0x1620('0x21')]=_0x55b90b['callbackat'];this[_0x1620('0x22')]=_0x55b90b[_0x1620('0x22')];this[_0x1620('0x23')]='';this[_0x1620('0x24')]='';}Action[_0x1620('0x25')][_0x1620('0x26')]=function(){return util[_0x1620('0x27')](_0x1620('0x28'),this[_0x1620('0xc')],this['voiceQueue'][_0x1620('0x29')]>0x0?this[_0x1620('0x2a')][_0x1620('0x2b')](this['voiceQueue'][_0x1620('0x29')]):this[_0x1620('0x2a')]);};Action['prototype'][_0x1620('0x2c')]=function(){return this[_0x1620('0xb')];};module[_0x1620('0x2d')]=Action; \ No newline at end of file +var _0xf7d0=['\x22%s\x22\x20<%s>','number','substring','dialCutDigit','queue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','firstName','lastName','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xf7d0,0x11a));var _0x0f7d=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xf7d0[_0x4fbfd9];return _0x31dc94;};'use strict';var util=require(_0x0f7d('0x0'));var _=require(_0x0f7d('0x1'));var moment=require(_0x0f7d('0x2'));function checkNameSurname(_0x30d34f,_0x4190e2,_0x3af3b8){var _0x37bfae='';if(!_[_0x0f7d('0x3')](_0x4190e2)&&_0x0f7d('0x4')===typeof _0x4190e2){_0x37bfae+=_0x4190e2;}if(!_[_0x0f7d('0x3')](_0x3af3b8)&&_0x0f7d('0x4')===typeof _0x3af3b8){_0x37bfae+='\x20'+_0x3af3b8;}if(_0x37bfae!==''){return _0x37bfae;}return _0x30d34f;}function Action(_0xff8388,_0x2cfacf,_0x3fc3be){this[_0x0f7d('0x5')]=_0xff8388;this[_0x0f7d('0x6')]=_0x3fc3be||undefined;this['name']=checkNameSurname(_0x2cfacf[_0x0f7d('0x7')][_0x0f7d('0x8')],_0x2cfacf[_0x0f7d('0x7')][_0x0f7d('0x9')],_0x2cfacf[_0x0f7d('0x7')][_0x0f7d('0xa')]);this['number']=_0x2cfacf[_0x0f7d('0x8')];this['queue']=_0xff8388[_0x0f7d('0xb')];this[_0x0f7d('0xc')]=_0x2cfacf[_0x0f7d('0xc')]||![];this[_0x0f7d('0xd')]=_0xff8388['type'];this[_0x0f7d('0xe')]=_0xff8388[_0x0f7d('0xe')]||0x3;this[_0x0f7d('0xf')]=_0x2cfacf[_0x0f7d('0xf')];this[_0x0f7d('0x10')]=_0x2cfacf[_0x0f7d('0x10')];this[_0x0f7d('0x11')]=_0x2cfacf['countcongestionretry'];this[_0x0f7d('0x12')]=_0x2cfacf[_0x0f7d('0x12')];this[_0x0f7d('0x13')]=_0x2cfacf[_0x0f7d('0x13')];this[_0x0f7d('0x14')]=_0x2cfacf[_0x0f7d('0x14')];this[_0x0f7d('0x15')]=_0x2cfacf[_0x0f7d('0x15')];this[_0x0f7d('0x16')]=_0x2cfacf[_0x0f7d('0x16')];this[_0x0f7d('0x17')]=_0x2cfacf[_0x0f7d('0x17')];this[_0x0f7d('0x18')]=_0x2cfacf['ContactId'];this['ListId']=_0x2cfacf[_0x0f7d('0x19')];this[_0x0f7d('0x1a')]=_0x2cfacf[_0x0f7d('0x1a')];this[_0x0f7d('0x1b')]=_0x2cfacf['VoiceQueueId'];this['CampaignId']=_0x2cfacf[_0x0f7d('0x1c')];this[_0x0f7d('0x1d')]=_0x2cfacf['id'];this[_0x0f7d('0x1e')]=_0x2cfacf['Contact'][_0x0f7d('0x9')]||'';this[_0x0f7d('0x1f')]=moment()[_0x0f7d('0x20')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x2cfacf[_0x0f7d('0x21')];this[_0x0f7d('0x22')]=_0x2cfacf[_0x0f7d('0x22')];this[_0x0f7d('0x23')]=_0x2cfacf[_0x0f7d('0x23')];this[_0x0f7d('0x24')]=_0x2cfacf[_0x0f7d('0x24')];this[_0x0f7d('0x25')]='';this['originatecalleridname']='';}Action[_0x0f7d('0x26')][_0x0f7d('0x27')]=function(){return util[_0x0f7d('0x20')](_0x0f7d('0x28'),this[_0x0f7d('0xb')],this['voiceQueue']['dialCutDigit']>0x0?this[_0x0f7d('0x29')][_0x0f7d('0x2a')](this[_0x0f7d('0x5')][_0x0f7d('0x2b')]):this['number']);};Action['prototype']['getQueue']=function(){return this[_0x0f7d('0x2c')];};module[_0x0f7d('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 58117ac..94a2692 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f6e=['Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','statedesc'];(function(_0x3022da,_0x127ee2){var _0x4641bf=function(_0x19680e){while(--_0x19680e){_0x3022da['push'](_0x3022da['shift']());}};_0x4641bf(++_0x127ee2);}(_0x0f6e,0x14d));var _0xe0f6=function(_0x40675d,_0xd7fa27){_0x40675d=_0x40675d-0x0;var _0x2842ae=_0x0f6e[_0x40675d];return _0x2842ae;};'use strict';var moment=require(_0xe0f6('0x0'));var utils=require(_0xe0f6('0x1'));function AgentComplete(_0x1aebff,_0x118107){this['state']=0x4;this[_0xe0f6('0x2')]=_0xe0f6('0x3');this[_0xe0f6('0x4')]=_0x1aebff['scheduledat'];this[_0xe0f6('0x5')]=_0x1aebff[_0xe0f6('0x5')];this[_0xe0f6('0x6')]=_0x1aebff['type']===_0xe0f6('0x7')?'queue':_0x1aebff[_0xe0f6('0x5')];this[_0xe0f6('0x8')]=_0x1aebff[_0xe0f6('0x8')];this[_0xe0f6('0x9')]=_0x1aebff[_0xe0f6('0x9')];this[_0xe0f6('0xa')]=_0x1aebff[_0xe0f6('0xa')];this[_0xe0f6('0xb')]=_0x1aebff[_0xe0f6('0x8')]+_0x1aebff[_0xe0f6('0x9')]+_0x1aebff[_0xe0f6('0xa')]+_0x1aebff[_0xe0f6('0xc')]+_0x1aebff[_0xe0f6('0xd')]+_0x1aebff[_0xe0f6('0xe')]+_0x1aebff[_0xe0f6('0xf')]+_0x1aebff[_0xe0f6('0x10')];this[_0xe0f6('0xc')]=_0x1aebff[_0xe0f6('0xc')];this[_0xe0f6('0xd')]=_0x1aebff['countdropretry'];this[_0xe0f6('0xe')]=_0x1aebff['countabandonedretry'];this[_0xe0f6('0xf')]=_0x1aebff[_0xe0f6('0xf')];this[_0xe0f6('0x10')]=_0x1aebff[_0xe0f6('0x10')];this[_0xe0f6('0x11')]=_0x118107[_0xe0f6('0x11')];this[_0xe0f6('0x12')]=_0x1aebff[_0xe0f6('0x13')];this[_0xe0f6('0x14')]=_0x1aebff[_0xe0f6('0x15')];this['starttime']=_0x1aebff[_0xe0f6('0x16')];this['responsetime']=_0x1aebff[_0xe0f6('0x17')];this[_0xe0f6('0x18')]=_0x1aebff[_0xe0f6('0x18')];this[_0xe0f6('0x19')]=moment()[_0xe0f6('0x1a')](_0xe0f6('0x1b'));this[_0xe0f6('0x1c')]=utils[_0xe0f6('0x1d')](_0x1aebff[_0xe0f6('0x17')],_0x1aebff[_0xe0f6('0x16')]);this[_0xe0f6('0x1e')]=utils[_0xe0f6('0x1d')](_0x1aebff[_0xe0f6('0x18')],_0x1aebff[_0xe0f6('0x17')]);this[_0xe0f6('0x1f')]=utils[_0xe0f6('0x1d')](this['endtime'],_0x1aebff['answertime']);this[_0xe0f6('0x20')]=_0x118107[_0xe0f6('0x20')];this[_0xe0f6('0x21')]=_0x118107[_0xe0f6('0x21')];this[_0xe0f6('0x22')]=_0x118107[_0xe0f6('0x22')];this[_0xe0f6('0x23')]=_0x1aebff['callback'];this[_0xe0f6('0x24')]=_0x1aebff[_0xe0f6('0x24')];this[_0xe0f6('0x25')]=_0x1aebff[_0xe0f6('0x25')];this[_0xe0f6('0x26')]=_0x1aebff[_0xe0f6('0x26')];this['ContactId']=_0x1aebff[_0xe0f6('0x27')];this[_0xe0f6('0x28')]=_0x1aebff[_0xe0f6('0x28')];this[_0xe0f6('0x29')]=_0x1aebff[_0xe0f6('0x29')];this[_0xe0f6('0x2a')]=_0x1aebff[_0xe0f6('0x2a')];this[_0xe0f6('0x2b')]=_0x1aebff[_0xe0f6('0x2b')];this[_0xe0f6('0x2c')]=_0x1aebff[_0xe0f6('0x2c')]||'';this[_0xe0f6('0x2d')]=_0x1aebff[_0xe0f6('0x2d')]||'';this[_0xe0f6('0x2e')]=_0x1aebff['agiafterat'];}module[_0xe0f6('0x2f')]=AgentComplete; \ No newline at end of file +var _0x0c41=['number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','getSeconds','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum'];(function(_0x9c3c56,_0x169b56){var _0x2dd782=function(_0x386962){while(--_0x386962){_0x9c3c56['push'](_0x9c3c56['shift']());}};_0x2dd782(++_0x169b56);}(_0x0c41,0xc9));var _0x10c4=function(_0x1a801b,_0x3ab1bc){_0x1a801b=_0x1a801b-0x0;var _0x34faa1=_0x0c41[_0x1a801b];return _0x34faa1;};'use strict';var moment=require(_0x10c4('0x0'));var utils=require(_0x10c4('0x1'));function AgentComplete(_0xba398c,_0x499863){this[_0x10c4('0x2')]=0x4;this['statedesc']='Answer';this[_0x10c4('0x3')]=_0xba398c[_0x10c4('0x3')];this[_0x10c4('0x4')]=_0xba398c['type'];this['campaigntype']=_0xba398c[_0x10c4('0x4')]===_0x10c4('0x5')?_0x10c4('0x6'):_0xba398c[_0x10c4('0x4')];this[_0x10c4('0x7')]=_0xba398c['countbusyretry'];this['countcongestionretry']=_0xba398c[_0x10c4('0x8')];this[_0x10c4('0x9')]=_0xba398c[_0x10c4('0x9')];this['countglobal']=_0xba398c[_0x10c4('0x7')]+_0xba398c[_0x10c4('0x8')]+_0xba398c[_0x10c4('0x9')]+_0xba398c[_0x10c4('0xa')]+_0xba398c['countdropretry']+_0xba398c[_0x10c4('0xb')]+_0xba398c['countmachineretry']+_0xba398c[_0x10c4('0xc')];this[_0x10c4('0xa')]=_0xba398c['countnosuchnumberretry'];this['countdropretry']=_0xba398c[_0x10c4('0xd')];this[_0x10c4('0xb')]=_0xba398c[_0x10c4('0xb')];this[_0x10c4('0xe')]=_0xba398c[_0x10c4('0xe')];this['countagentrejectretry']=_0xba398c[_0x10c4('0xc')];this[_0x10c4('0xf')]=_0x499863['uniqueid'];this[_0x10c4('0x10')]=_0xba398c[_0x10c4('0x11')];this[_0x10c4('0x12')]=_0xba398c[_0x10c4('0x13')];this['starttime']=_0xba398c[_0x10c4('0x14')];this[_0x10c4('0x15')]=_0xba398c[_0x10c4('0x15')];this[_0x10c4('0x16')]=_0xba398c[_0x10c4('0x16')];this[_0x10c4('0x17')]=moment()[_0x10c4('0x18')](_0x10c4('0x19'));this[_0x10c4('0x1a')]=utils['getSeconds'](_0xba398c[_0x10c4('0x15')],_0xba398c[_0x10c4('0x14')]);this[_0x10c4('0x1b')]=utils[_0x10c4('0x1c')](_0xba398c['answertime'],_0xba398c[_0x10c4('0x15')]);this[_0x10c4('0x1d')]=utils[_0x10c4('0x1c')](this[_0x10c4('0x17')],_0xba398c[_0x10c4('0x16')]);this[_0x10c4('0x6')]=_0x499863['queue'];this[_0x10c4('0x1e')]=_0x499863[_0x10c4('0x1e')];this['reason']=_0x499863['reason'];this['callback']=_0xba398c[_0x10c4('0x1f')];this[_0x10c4('0x20')]=_0xba398c[_0x10c4('0x20')];this[_0x10c4('0x21')]=_0xba398c[_0x10c4('0x21')];this[_0x10c4('0x22')]=_0xba398c[_0x10c4('0x22')];this[_0x10c4('0x23')]=_0xba398c[_0x10c4('0x23')];this['ListId']=_0xba398c[_0x10c4('0x24')];this[_0x10c4('0x25')]=_0xba398c[_0x10c4('0x25')];this[_0x10c4('0x26')]=_0xba398c[_0x10c4('0x26')];this[_0x10c4('0x27')]=_0xba398c['CampaignId'];this['originatecalleridnum']=_0xba398c[_0x10c4('0x28')]||'';this[_0x10c4('0x29')]=_0xba398c[_0x10c4('0x29')]||'';this['agiafterat']=_0xba398c[_0x10c4('0x2a')];}module[_0x10c4('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 4b9011f..d2304fb 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5947=['uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports'];(function(_0x44b912,_0x1e9fc1){var _0x49f5a2=function(_0x286d35){while(--_0x286d35){_0x44b912['push'](_0x44b912['shift']());}};_0x49f5a2(++_0x1e9fc1);}(_0x5947,0x69));var _0x7594=function(_0x3bcfc9,_0x3ca88f){_0x3bcfc9=_0x3bcfc9-0x0;var _0x31b21b=_0x5947[_0x3bcfc9];return _0x31b21b;};'use strict';function Final(_0x5adc01){this[_0x7594('0x0')]=_0x5adc01[_0x7594('0x0')];this[_0x7594('0x1')]=_0x5adc01['scheduledat'];this[_0x7594('0x2')]=_0x5adc01[_0x7594('0x2')];this[_0x7594('0x3')]=_0x5adc01[_0x7594('0x2')]==='outbound'?'queue':_0x5adc01[_0x7594('0x2')];this[_0x7594('0x4')]=_0x5adc01[_0x7594('0x4')];this['countcongestionretry']=_0x5adc01[_0x7594('0x5')];this['countnoanswerretry']=_0x5adc01[_0x7594('0x6')];this[_0x7594('0x7')]=_0x5adc01[_0x7594('0x4')]+_0x5adc01[_0x7594('0x5')]+_0x5adc01[_0x7594('0x6')]+_0x5adc01[_0x7594('0x8')]+_0x5adc01[_0x7594('0x9')]+_0x5adc01[_0x7594('0xa')]+_0x5adc01[_0x7594('0xb')]+_0x5adc01[_0x7594('0xc')];this[_0x7594('0x8')]=_0x5adc01['countnosuchnumberretry'];this[_0x7594('0x9')]=_0x5adc01[_0x7594('0x9')];this['countabandonedretry']=_0x5adc01['countabandonedretry'];this[_0x7594('0xb')]=_0x5adc01['countmachineretry'];this[_0x7594('0xc')]=_0x5adc01[_0x7594('0xc')];this['queue']=_0x5adc01[_0x7594('0xd')];this['calleridname']=_0x5adc01[_0x7594('0xe')];this['calleridnum']=_0x5adc01[_0x7594('0xf')];this[_0x7594('0x10')]=_0x5adc01['starttime'];this[_0x7594('0x11')]=_0x5adc01[_0x7594('0x11')];this[_0x7594('0x12')]=_0x5adc01[_0x7594('0x11')];this['ringtime']=_0x5adc01['ringtime']||0x0;this[_0x7594('0x13')]=_0x5adc01['holdtime']||0x0;this['talktime']=_0x5adc01[_0x7594('0x14')]||0x0;this[_0x7594('0x15')]=_0x5adc01[_0x7594('0x15')];this[_0x7594('0x16')]=_0x5adc01['callbackuniqueid'];this[_0x7594('0x17')]=_0x5adc01[_0x7594('0x17')];this[_0x7594('0x18')]=_0x5adc01['recallme'];this[_0x7594('0x19')]=_0x5adc01[_0x7594('0x19')];this[_0x7594('0x1a')]=_0x5adc01[_0x7594('0x1a')];this[_0x7594('0x1b')]=_0x5adc01[_0x7594('0x1b')];this[_0x7594('0x1c')]=_0x5adc01['VoiceQueueId'];this[_0x7594('0x1d')]=_0x5adc01[_0x7594('0x1d')];this['originatecalleridnum']=_0x5adc01[_0x7594('0x1e')]||'';this[_0x7594('0x1f')]=_0x5adc01[_0x7594('0x1f')]||'';this[_0x7594('0x20')]=_0x5adc01['state'];this['statedesc']=_0x5adc01[_0x7594('0x21')];}module[_0x7594('0x22')]=Final; \ No newline at end of file +var _0x9a10=['countglobal','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','queue','calleridname','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x173452,_0x3aa870){var _0xee3fd0=function(_0x10eb01){while(--_0x10eb01){_0x173452['push'](_0x173452['shift']());}};_0xee3fd0(++_0x3aa870);}(_0x9a10,0x190));var _0x09a1=function(_0x56eae7,_0x20e474){_0x56eae7=_0x56eae7-0x0;var _0xee28dc=_0x9a10[_0x56eae7];return _0xee28dc;};'use strict';function Final(_0x2380b9){this[_0x09a1('0x0')]=_0x2380b9[_0x09a1('0x0')];this[_0x09a1('0x1')]=_0x2380b9['scheduledat'];this[_0x09a1('0x2')]=_0x2380b9[_0x09a1('0x2')];this[_0x09a1('0x3')]=_0x2380b9[_0x09a1('0x2')]===_0x09a1('0x4')?'queue':_0x2380b9[_0x09a1('0x2')];this[_0x09a1('0x5')]=_0x2380b9[_0x09a1('0x5')];this[_0x09a1('0x6')]=_0x2380b9[_0x09a1('0x6')];this[_0x09a1('0x7')]=_0x2380b9[_0x09a1('0x7')];this[_0x09a1('0x8')]=_0x2380b9[_0x09a1('0x5')]+_0x2380b9['countcongestionretry']+_0x2380b9[_0x09a1('0x7')]+_0x2380b9['countnosuchnumberretry']+_0x2380b9['countdropretry']+_0x2380b9['countabandonedretry']+_0x2380b9['countmachineretry']+_0x2380b9[_0x09a1('0x9')];this['countnosuchnumberretry']=_0x2380b9[_0x09a1('0xa')];this[_0x09a1('0xb')]=_0x2380b9[_0x09a1('0xb')];this[_0x09a1('0xc')]=_0x2380b9[_0x09a1('0xc')];this[_0x09a1('0xd')]=_0x2380b9['countmachineretry'];this['countagentrejectretry']=_0x2380b9['countagentrejectretry'];this[_0x09a1('0xe')]=_0x2380b9[_0x09a1('0xe')];this[_0x09a1('0xf')]=_0x2380b9[_0x09a1('0xf')];this['calleridnum']=_0x2380b9['calleridnum'];this['starttime']=_0x2380b9['starttime'];this['responsetime']=_0x2380b9[_0x09a1('0x10')];this[_0x09a1('0x11')]=_0x2380b9[_0x09a1('0x10')];this[_0x09a1('0x12')]=_0x2380b9[_0x09a1('0x12')]||0x0;this[_0x09a1('0x13')]=_0x2380b9[_0x09a1('0x13')]||0x0;this[_0x09a1('0x14')]=_0x2380b9[_0x09a1('0x14')]||0x0;this['callback']=_0x2380b9[_0x09a1('0x15')];this['callbackuniqueid']=_0x2380b9[_0x09a1('0x16')];this['callbackat']=_0x2380b9[_0x09a1('0x17')];this[_0x09a1('0x18')]=_0x2380b9[_0x09a1('0x18')];this[_0x09a1('0x19')]=_0x2380b9[_0x09a1('0x19')];this[_0x09a1('0x1a')]=_0x2380b9[_0x09a1('0x1a')];this[_0x09a1('0x1b')]=_0x2380b9[_0x09a1('0x1b')];this[_0x09a1('0x1c')]=_0x2380b9[_0x09a1('0x1c')];this[_0x09a1('0x1d')]=_0x2380b9[_0x09a1('0x1d')];this[_0x09a1('0x1e')]=_0x2380b9['originatecalleridnum']||'';this['originatecalleridname']=_0x2380b9[_0x09a1('0x1f')]||'';this['state']=_0x2380b9['state'];this[_0x09a1('0x20')]=_0x2380b9['statedesc'];}module[_0x09a1('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 6307bdf..49449ae 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0663=['uniqueid','name','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry'];(function(_0x53e3c2,_0x90a8fd){var _0x10aa40=function(_0x535ead){while(--_0x535ead){_0x53e3c2['push'](_0x53e3c2['shift']());}};_0x10aa40(++_0x90a8fd);}(_0x0663,0xea));var _0x3066=function(_0x293150,_0x3bec15){_0x293150=_0x293150-0x0;var _0x38cae7=_0x0663[_0x293150];return _0x38cae7;};'use strict';var moment=require(_0x3066('0x0'));var utils=require(_0x3066('0x1'));function Hangup(_0x492e00,_0x4a073f){this[_0x3066('0x2')]=0x4;this[_0x3066('0x3')]=_0x3066('0x4');this[_0x3066('0x5')]=_0x492e00[_0x3066('0x5')];this['type']=_0x492e00[_0x3066('0x6')];this['campaigntype']=_0x492e00[_0x3066('0x6')]===_0x3066('0x7')?_0x3066('0x8'):_0x492e00['type'];this[_0x3066('0x9')]=_0x492e00['amd']||![];this[_0x3066('0xa')]=_0x492e00[_0x3066('0xa')];this[_0x3066('0xb')]=_0x492e00['countcongestionretry'];this['countnoanswerretry']=_0x492e00[_0x3066('0xc')];this['countglobal']=_0x492e00['countbusyretry']+_0x492e00[_0x3066('0xb')]+_0x492e00[_0x3066('0xc')]+_0x492e00['countnosuchnumberretry']+_0x492e00[_0x3066('0xd')]+_0x492e00[_0x3066('0xe')]+_0x492e00['countmachineretry']+_0x492e00[_0x3066('0xf')];this['countnosuchnumberretry']=_0x492e00[_0x3066('0x10')];this[_0x3066('0xd')]=_0x492e00[_0x3066('0xd')];this['countabandonedretry']=_0x492e00[_0x3066('0xe')];this[_0x3066('0x11')]=_0x492e00[_0x3066('0x11')];this[_0x3066('0xf')]=_0x492e00[_0x3066('0xf')];this[_0x3066('0x12')]=_0x4a073f[_0x3066('0x12')];this['calleridname']=_0x492e00[_0x3066('0x13')];this['calleridnum']=_0x492e00[_0x3066('0x14')];this[_0x3066('0x15')]=_0x492e00[_0x3066('0x15')];this[_0x3066('0x16')]=_0x492e00['responsetime'];this['endtime']=moment()[_0x3066('0x17')](_0x3066('0x18'));this[_0x3066('0x19')]=utils[_0x3066('0x1a')](_0x492e00[_0x3066('0x16')],_0x492e00[_0x3066('0x15')]);this[_0x3066('0x1b')]=0x0;this[_0x3066('0x1c')]=utils[_0x3066('0x1a')](this[_0x3066('0x1d')],_0x492e00['responsetime']);this[_0x3066('0x8')]=_0x492e00[_0x3066('0x8')];this['membername']=_0x3066('0x1e');this[_0x3066('0x1f')]=_0x4a073f[_0x3066('0x20')];this[_0x3066('0x21')]=_0x492e00[_0x3066('0x21')];this[_0x3066('0x22')]=_0x492e00[_0x3066('0x22')];this[_0x3066('0x23')]=_0x492e00[_0x3066('0x23')];this['recallme']=_0x492e00['recallme'];this['ContactId']=_0x492e00[_0x3066('0x24')];this[_0x3066('0x25')]=_0x492e00[_0x3066('0x25')];this[_0x3066('0x26')]=_0x492e00[_0x3066('0x26')];this[_0x3066('0x27')]=_0x492e00['VoiceQueueId'];this[_0x3066('0x28')]=_0x492e00[_0x3066('0x28')];}module[_0x3066('0x29')]=Hangup; \ No newline at end of file +var _0xed3a=['amd','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','IVR','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','CampaignId','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue'];(function(_0x2222a0,_0x28ed7a){var _0x155625=function(_0x2fa632){while(--_0x2fa632){_0x2222a0['push'](_0x2222a0['shift']());}};_0x155625(++_0x28ed7a);}(_0xed3a,0x155));var _0xaed3=function(_0x48c4df,_0x1ee1aa){_0x48c4df=_0x48c4df-0x0;var _0x1fa08d=_0xed3a[_0x48c4df];return _0x1fa08d;};'use strict';var moment=require(_0xaed3('0x0'));var utils=require(_0xaed3('0x1'));function Hangup(_0x5879d6,_0x4d3f5c){this[_0xaed3('0x2')]=0x4;this[_0xaed3('0x3')]=_0xaed3('0x4');this[_0xaed3('0x5')]=_0x5879d6[_0xaed3('0x5')];this[_0xaed3('0x6')]=_0x5879d6[_0xaed3('0x6')];this[_0xaed3('0x7')]=_0x5879d6[_0xaed3('0x6')]===_0xaed3('0x8')?_0xaed3('0x9'):_0x5879d6['type'];this[_0xaed3('0xa')]=_0x5879d6[_0xaed3('0xa')]||![];this['countbusyretry']=_0x5879d6['countbusyretry'];this['countcongestionretry']=_0x5879d6[_0xaed3('0xb')];this[_0xaed3('0xc')]=_0x5879d6['countnoanswerretry'];this[_0xaed3('0xd')]=_0x5879d6[_0xaed3('0xe')]+_0x5879d6[_0xaed3('0xb')]+_0x5879d6[_0xaed3('0xc')]+_0x5879d6[_0xaed3('0xf')]+_0x5879d6['countdropretry']+_0x5879d6['countabandonedretry']+_0x5879d6[_0xaed3('0x10')]+_0x5879d6[_0xaed3('0x11')];this[_0xaed3('0xf')]=_0x5879d6[_0xaed3('0xf')];this['countdropretry']=_0x5879d6[_0xaed3('0x12')];this[_0xaed3('0x13')]=_0x5879d6[_0xaed3('0x13')];this[_0xaed3('0x10')]=_0x5879d6[_0xaed3('0x10')];this[_0xaed3('0x11')]=_0x5879d6['countagentrejectretry'];this[_0xaed3('0x14')]=_0x4d3f5c[_0xaed3('0x14')];this['calleridname']=_0x5879d6[_0xaed3('0x15')];this[_0xaed3('0x16')]=_0x5879d6[_0xaed3('0x17')];this[_0xaed3('0x18')]=_0x5879d6[_0xaed3('0x18')];this[_0xaed3('0x19')]=_0x5879d6['responsetime'];this[_0xaed3('0x1a')]=moment()[_0xaed3('0x1b')](_0xaed3('0x1c'));this['ringtime']=utils['getSeconds'](_0x5879d6[_0xaed3('0x19')],_0x5879d6['starttime']);this['holdtime']=0x0;this['talktime']=utils[_0xaed3('0x1d')](this[_0xaed3('0x1a')],_0x5879d6[_0xaed3('0x19')]);this[_0xaed3('0x9')]=_0x5879d6[_0xaed3('0x9')];this['membername']=_0xaed3('0x1e');this[_0xaed3('0x1f')]=_0x4d3f5c['cause-txt'];this[_0xaed3('0x20')]=_0x5879d6['callback'];this[_0xaed3('0x21')]=_0x5879d6['callbackuniqueid'];this[_0xaed3('0x22')]=_0x5879d6['callbackat'];this['recallme']=_0x5879d6['recallme'];this[_0xaed3('0x23')]=_0x5879d6[_0xaed3('0x23')];this[_0xaed3('0x24')]=_0x5879d6[_0xaed3('0x24')];this[_0xaed3('0x25')]=_0x5879d6['UserId'];this['VoiceQueueId']=_0x5879d6['VoiceQueueId'];this[_0xaed3('0x26')]=_0x5879d6[_0xaed3('0x26')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 0bc02d1..e145676 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1bcc=['state','statedesc','../utils','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x96fb3a,_0x392e22){var _0x268e4f=function(_0x95cbfd){while(--_0x95cbfd){_0x96fb3a['push'](_0x96fb3a['shift']());}};_0x268e4f(++_0x392e22);}(_0x1bcc,0x16a));var _0xc1bc=function(_0x741427,_0x21fe4c){_0x741427=_0x741427-0x0;var _0x5e0a59=_0x1bcc[_0x741427];return _0x5e0a59;};'use strict';var utils=require(_0xc1bc('0x0'));function History(_0x5dd23e){this[_0xc1bc('0x1')]=_0x5dd23e[_0xc1bc('0x1')];this[_0xc1bc('0x2')]=_0x5dd23e[_0xc1bc('0x2')]||undefined;this[_0xc1bc('0x3')]=_0x5dd23e[_0xc1bc('0x3')];this[_0xc1bc('0x4')]=_0x5dd23e['type']==='outbound'?'queue':_0x5dd23e[_0xc1bc('0x3')];this[_0xc1bc('0x5')]=_0x5dd23e['countbusyretry'];this[_0xc1bc('0x6')]=_0x5dd23e[_0xc1bc('0x6')];this[_0xc1bc('0x7')]=_0x5dd23e[_0xc1bc('0x7')];this['countglobal']=_0x5dd23e[_0xc1bc('0x5')]+_0x5dd23e[_0xc1bc('0x6')]+_0x5dd23e['countnoanswerretry']+_0x5dd23e[_0xc1bc('0x8')]+_0x5dd23e[_0xc1bc('0x9')]+_0x5dd23e['countabandonedretry']+_0x5dd23e[_0xc1bc('0xa')]+_0x5dd23e[_0xc1bc('0xb')];this['countnosuchnumberretry']=_0x5dd23e[_0xc1bc('0x8')];this[_0xc1bc('0x9')]=_0x5dd23e[_0xc1bc('0x9')];this['countabandonedretry']=_0x5dd23e[_0xc1bc('0xc')];this[_0xc1bc('0xa')]=_0x5dd23e[_0xc1bc('0xa')];this[_0xc1bc('0xb')]=_0x5dd23e[_0xc1bc('0xb')];this[_0xc1bc('0xd')]=_0x5dd23e['queue'];this[_0xc1bc('0xe')]=_0x5dd23e[_0xc1bc('0xf')];this[_0xc1bc('0x10')]=_0x5dd23e['number'];this[_0xc1bc('0x11')]=_0x5dd23e[_0xc1bc('0x11')];this[_0xc1bc('0x12')]=_0x5dd23e[_0xc1bc('0x12')];this[_0xc1bc('0x13')]=_0x5dd23e[_0xc1bc('0x12')];this[_0xc1bc('0x14')]=utils[_0xc1bc('0x15')](_0x5dd23e['responsetime'],_0x5dd23e[_0xc1bc('0x11')]);this[_0xc1bc('0x16')]=0x0;this[_0xc1bc('0x17')]=0x0;this[_0xc1bc('0x18')]=_0x5dd23e[_0xc1bc('0x18')];this['callbackuniqueid']=_0x5dd23e[_0xc1bc('0x19')];this['callbackat']=_0x5dd23e[_0xc1bc('0x1a')];this[_0xc1bc('0x1b')]=_0x5dd23e[_0xc1bc('0x1b')];this[_0xc1bc('0x1c')]=_0x5dd23e[_0xc1bc('0x1c')];this[_0xc1bc('0x1d')]=_0x5dd23e['ListId'];this[_0xc1bc('0x1e')]=_0x5dd23e[_0xc1bc('0x1e')];this['VoiceQueueId']=_0x5dd23e['VoiceQueueId'];this['CampaignId']=_0x5dd23e[_0xc1bc('0x1f')];this[_0xc1bc('0x20')]=_0x5dd23e['originatecalleridnum']||'';this['originatecalleridname']=_0x5dd23e[_0xc1bc('0x21')]||'';this[_0xc1bc('0x22')]=_0x5dd23e[_0xc1bc('0x22')];this['statedesc']=_0x5dd23e[_0xc1bc('0x23')];}module['exports']=History; \ No newline at end of file +var _0x3c19=['originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countmachineretry','countnosuchnumberretry','countdropretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x5d5407,_0x235a0a){var _0x44a09c=function(_0x20cf7c){while(--_0x20cf7c){_0x5d5407['push'](_0x5d5407['shift']());}};_0x44a09c(++_0x235a0a);}(_0x3c19,0x15a));var _0x93c1=function(_0x4670a6,_0x48156b){_0x4670a6=_0x4670a6-0x0;var _0x2cac9d=_0x3c19[_0x4670a6];return _0x2cac9d;};'use strict';var utils=require(_0x93c1('0x0'));function History(_0x5b71be){this[_0x93c1('0x1')]=_0x5b71be['uniqueid'];this['scheduledat']=_0x5b71be[_0x93c1('0x2')]||undefined;this[_0x93c1('0x3')]=_0x5b71be['type'];this[_0x93c1('0x4')]=_0x5b71be['type']===_0x93c1('0x5')?_0x93c1('0x6'):_0x5b71be[_0x93c1('0x3')];this[_0x93c1('0x7')]=_0x5b71be['countbusyretry'];this[_0x93c1('0x8')]=_0x5b71be[_0x93c1('0x8')];this[_0x93c1('0x9')]=_0x5b71be['countnoanswerretry'];this['countglobal']=_0x5b71be['countbusyretry']+_0x5b71be['countcongestionretry']+_0x5b71be[_0x93c1('0x9')]+_0x5b71be['countnosuchnumberretry']+_0x5b71be['countdropretry']+_0x5b71be['countabandonedretry']+_0x5b71be[_0x93c1('0xa')]+_0x5b71be['countagentrejectretry'];this[_0x93c1('0xb')]=_0x5b71be[_0x93c1('0xb')];this[_0x93c1('0xc')]=_0x5b71be[_0x93c1('0xc')];this[_0x93c1('0xd')]=_0x5b71be[_0x93c1('0xd')];this[_0x93c1('0xa')]=_0x5b71be['countmachineretry'];this['countagentrejectretry']=_0x5b71be['countagentrejectretry'];this[_0x93c1('0x6')]=_0x5b71be[_0x93c1('0x6')];this[_0x93c1('0xe')]=_0x5b71be[_0x93c1('0xf')];this[_0x93c1('0x10')]=_0x5b71be[_0x93c1('0x11')];this['starttime']=_0x5b71be[_0x93c1('0x12')];this[_0x93c1('0x13')]=_0x5b71be['responsetime'];this[_0x93c1('0x14')]=_0x5b71be[_0x93c1('0x13')];this[_0x93c1('0x15')]=utils['getSeconds'](_0x5b71be['responsetime'],_0x5b71be[_0x93c1('0x12')]);this[_0x93c1('0x16')]=0x0;this[_0x93c1('0x17')]=0x0;this[_0x93c1('0x18')]=_0x5b71be[_0x93c1('0x18')];this[_0x93c1('0x19')]=_0x5b71be[_0x93c1('0x19')];this[_0x93c1('0x1a')]=_0x5b71be['callbackat'];this[_0x93c1('0x1b')]=_0x5b71be[_0x93c1('0x1b')];this[_0x93c1('0x1c')]=_0x5b71be[_0x93c1('0x1c')];this[_0x93c1('0x1d')]=_0x5b71be[_0x93c1('0x1d')];this['UserId']=_0x5b71be[_0x93c1('0x1e')];this[_0x93c1('0x1f')]=_0x5b71be[_0x93c1('0x1f')];this[_0x93c1('0x20')]=_0x5b71be[_0x93c1('0x20')];this[_0x93c1('0x21')]=_0x5b71be['originatecalleridnum']||'';this[_0x93c1('0x22')]=_0x5b71be[_0x93c1('0x22')]||'';this[_0x93c1('0x23')]=_0x5b71be['state'];this['statedesc']=_0x5b71be[_0x93c1('0x24')];}module[_0x93c1('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 489b66b..d7f65c2 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb03=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','agiafterat','statedesc','exports','../utils','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','dropreason','endtime','ringtime','holdtime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackat'];(function(_0x71f648,_0x19654f){var _0x56203f=function(_0x5c25e0){while(--_0x5c25e0){_0x71f648['push'](_0x71f648['shift']());}};_0x56203f(++_0x19654f);}(_0xdb03,0x1cc));var _0x3db0=function(_0x185d52,_0x376ade){_0x185d52=_0x185d52-0x0;var _0x4f8cf7=_0xdb03[_0x185d52];return _0x4f8cf7;};'use strict';var utils=require(_0x3db0('0x0'));function QueueCallerAbandon(_0x575dc0,_0x236c69){this[_0x3db0('0x1')]=_0x575dc0[_0x3db0('0x1')];this[_0x3db0('0x2')]=_0x575dc0['type'];this['campaigntype']=_0x575dc0[_0x3db0('0x2')]===_0x3db0('0x3')?_0x3db0('0x4'):_0x575dc0[_0x3db0('0x2')];this[_0x3db0('0x5')]=_0x575dc0['countbusyretry'];this[_0x3db0('0x6')]=_0x575dc0[_0x3db0('0x6')];this[_0x3db0('0x7')]=_0x575dc0[_0x3db0('0x7')];this[_0x3db0('0x8')]=_0x575dc0[_0x3db0('0x5')]+_0x575dc0[_0x3db0('0x6')]+_0x575dc0[_0x3db0('0x7')]+_0x575dc0['countnosuchnumberretry']+_0x575dc0[_0x3db0('0x9')]+_0x575dc0[_0x3db0('0xa')]+_0x575dc0['countmachineretry']+_0x575dc0[_0x3db0('0xb')];this[_0x3db0('0xc')]=_0x575dc0[_0x3db0('0xc')];this[_0x3db0('0x9')]=_0x575dc0[_0x3db0('0x9')];this[_0x3db0('0xa')]=_0x575dc0[_0x3db0('0xa')];this[_0x3db0('0xd')]=_0x575dc0['countmachineretry'];this[_0x3db0('0xb')]=_0x575dc0[_0x3db0('0xb')];this[_0x3db0('0xe')]=_0x236c69[_0x3db0('0xe')];this[_0x3db0('0xf')]=_0x575dc0[_0x3db0('0x10')];this[_0x3db0('0x11')]=_0x575dc0['number'];this[_0x3db0('0x12')]=_0x575dc0[_0x3db0('0x12')];this[_0x3db0('0x13')]=_0x575dc0[_0x3db0('0x13')];this[_0x3db0('0x14')]=_0x575dc0[_0x3db0('0x14')];this['dropreason']=_0x575dc0[_0x3db0('0x15')];this[_0x3db0('0x16')]=this[_0x3db0('0x14')];this[_0x3db0('0x17')]=utils['getSeconds'](_0x575dc0[_0x3db0('0x13')],_0x575dc0[_0x3db0('0x12')]);this[_0x3db0('0x18')]=utils[_0x3db0('0x19')](this[_0x3db0('0x14')],_0x575dc0['responsetime']);this[_0x3db0('0x1a')]=0x0;this[_0x3db0('0x4')]=_0x236c69[_0x3db0('0x4')];this[_0x3db0('0x1b')]=_0x236c69[_0x3db0('0x1c')];this[_0x3db0('0x1d')]=_0x236c69[_0x3db0('0x1d')];this[_0x3db0('0x1e')]=_0x575dc0[_0x3db0('0x1e')];this['callbackuniqueid']=_0x575dc0['callbackuniqueid'];this[_0x3db0('0x1f')]=_0x575dc0[_0x3db0('0x1f')];this['recallme']=_0x575dc0['recallme'];this[_0x3db0('0x20')]=_0x575dc0[_0x3db0('0x20')];this[_0x3db0('0x21')]=_0x575dc0[_0x3db0('0x21')];this[_0x3db0('0x22')]=_0x575dc0[_0x3db0('0x22')];this[_0x3db0('0x23')]=_0x575dc0[_0x3db0('0x23')];this['CampaignId']=_0x575dc0[_0x3db0('0x24')];this['originatecalleridnum']=_0x575dc0[_0x3db0('0x25')]||'';this['originatecalleridname']=_0x575dc0['originatecalleridname']||'';this[_0x3db0('0x26')]=_0x575dc0['agiafterat'];this['state']=_0x575dc0['state'];this[_0x3db0('0x27')]=_0x575dc0['statedesc'];}module[_0x3db0('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0xb8ef=['connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','membername'];(function(_0x2bb398,_0xd7c0dc){var _0x4dfefc=function(_0x20b088){while(--_0x20b088){_0x2bb398['push'](_0x2bb398['shift']());}};_0x4dfefc(++_0xd7c0dc);}(_0xb8ef,0x1bd));var _0xfb8e=function(_0x2a6cee,_0x446a67){_0x2a6cee=_0x2a6cee-0x0;var _0x3b5cfc=_0xb8ef[_0x2a6cee];return _0x3b5cfc;};'use strict';var utils=require(_0xfb8e('0x0'));function QueueCallerAbandon(_0x35b969,_0x3af371){this[_0xfb8e('0x1')]=_0x35b969['scheduledat'];this[_0xfb8e('0x2')]=_0x35b969[_0xfb8e('0x2')];this[_0xfb8e('0x3')]=_0x35b969[_0xfb8e('0x2')]===_0xfb8e('0x4')?_0xfb8e('0x5'):_0x35b969[_0xfb8e('0x2')];this[_0xfb8e('0x6')]=_0x35b969[_0xfb8e('0x6')];this[_0xfb8e('0x7')]=_0x35b969['countcongestionretry'];this[_0xfb8e('0x8')]=_0x35b969[_0xfb8e('0x8')];this[_0xfb8e('0x9')]=_0x35b969[_0xfb8e('0x6')]+_0x35b969[_0xfb8e('0x7')]+_0x35b969[_0xfb8e('0x8')]+_0x35b969[_0xfb8e('0xa')]+_0x35b969['countdropretry']+_0x35b969['countabandonedretry']+_0x35b969[_0xfb8e('0xb')]+_0x35b969[_0xfb8e('0xc')];this[_0xfb8e('0xa')]=_0x35b969[_0xfb8e('0xa')];this[_0xfb8e('0xd')]=_0x35b969[_0xfb8e('0xd')];this[_0xfb8e('0xe')]=_0x35b969[_0xfb8e('0xe')];this[_0xfb8e('0xb')]=_0x35b969['countmachineretry'];this[_0xfb8e('0xc')]=_0x35b969[_0xfb8e('0xc')];this[_0xfb8e('0xf')]=_0x3af371[_0xfb8e('0xf')];this[_0xfb8e('0x10')]=_0x35b969[_0xfb8e('0x11')];this['calleridnum']=_0x35b969[_0xfb8e('0x12')];this[_0xfb8e('0x13')]=_0x35b969[_0xfb8e('0x13')];this[_0xfb8e('0x14')]=_0x35b969[_0xfb8e('0x14')];this[_0xfb8e('0x15')]=_0x35b969[_0xfb8e('0x15')];this['dropreason']=_0x35b969[_0xfb8e('0x16')];this[_0xfb8e('0x17')]=this[_0xfb8e('0x15')];this[_0xfb8e('0x18')]=utils[_0xfb8e('0x19')](_0x35b969[_0xfb8e('0x14')],_0x35b969[_0xfb8e('0x13')]);this[_0xfb8e('0x1a')]=utils[_0xfb8e('0x19')](this[_0xfb8e('0x15')],_0x35b969[_0xfb8e('0x14')]);this['talktime']=0x0;this[_0xfb8e('0x5')]=_0x3af371[_0xfb8e('0x5')];this[_0xfb8e('0x1b')]=_0x3af371[_0xfb8e('0x1c')];this['reason']=_0x3af371[_0xfb8e('0x1d')];this['callback']=_0x35b969[_0xfb8e('0x1e')];this['callbackuniqueid']=_0x35b969['callbackuniqueid'];this[_0xfb8e('0x1f')]=_0x35b969[_0xfb8e('0x1f')];this[_0xfb8e('0x20')]=_0x35b969[_0xfb8e('0x20')];this['ContactId']=_0x35b969[_0xfb8e('0x21')];this[_0xfb8e('0x22')]=_0x35b969[_0xfb8e('0x22')];this['UserId']=_0x35b969[_0xfb8e('0x23')];this[_0xfb8e('0x24')]=_0x35b969[_0xfb8e('0x24')];this[_0xfb8e('0x25')]=_0x35b969[_0xfb8e('0x25')];this[_0xfb8e('0x26')]=_0x35b969['originatecalleridnum']||'';this['originatecalleridname']=_0x35b969['originatecalleridname']||'';this[_0xfb8e('0x27')]=_0x35b969[_0xfb8e('0x27')];this[_0xfb8e('0x28')]=_0x35b969[_0xfb8e('0x28')];this[_0xfb8e('0x29')]=_0x35b969[_0xfb8e('0x29')];}module[_0xfb8e('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 8557a81..756142f 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbff5=['moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[createHistory]','createHistory','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x3e18cc,_0x43d46c){var _0x4fc8b4=function(_0x443a8e){while(--_0x443a8e){_0x3e18cc['push'](_0x3e18cc['shift']());}};_0x4fc8b4(++_0x43d46c);}(_0xbff5,0x1bc));var _0x5bff=function(_0x89c1db,_0x642b3c){_0x89c1db=_0x89c1db-0x0;var _0x7d32c=_0xbff5[_0x89c1db];return _0x7d32c;};'use strict';var util=require(_0x5bff('0x0'));var logger=require(_0x5bff('0x1'))(_0x5bff('0x2'));var cmHopper=require(_0x5bff('0x3'));var cmHopperAdditionalPhone=require(_0x5bff('0x4'));var cmHopperBlack=require(_0x5bff('0x5'));var cmHopperHistory=require(_0x5bff('0x6'));function inspectError(_0x4dccf3){return util[_0x5bff('0x7')](_0x4dccf3,{'showHidden':![],'depth':null});}function getContactDialer(_0x486083,_0x4c567d,_0x16ed7b){return cmHopper[_0x5bff('0x8')](_0x486083['id'],_0x4c567d,_0x16ed7b,_0x486083[_0x5bff('0x9')])[_0x5bff('0xa')](function(_0x43605a){_0x486083[_0x5bff('0xb')]=0x0;logger[_0x5bff('0xc')](_0x5bff('0xd'),inspectError(_0x43605a));});}exports[_0x5bff('0x8')]=getContactDialer;function getContactDialerIvr(_0x4a1be2,_0x20e26f){return cmHopper['getContactDialerIvr'](_0x4a1be2['id'],_0x20e26f,_0x4a1be2[_0x5bff('0x9')])[_0x5bff('0xa')](function(_0x4fc146){_0x4a1be2[_0x5bff('0xb')]=0x0;logger['error'](_0x5bff('0xe'),inspectError(_0x4fc146));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x207835){return cmHopper[_0x5bff('0xf')](_0x207835)['catch'](function(_0x132dc9){logger['error'](_0x5bff('0x10'),inspectError(_0x132dc9));});}exports[_0x5bff('0xf')]=countReScheduled;function rescheduleContact(_0x548128){return cmHopper[_0x5bff('0x11')](_0x548128)[_0x5bff('0xa')](function(_0x5b0d2d){logger['error'](_0x5bff('0x12'),inspectError(_0x5b0d2d));});}exports[_0x5bff('0x11')]=rescheduleContact;function unlockContact(_0x3a507c,_0x4d883e,_0x2d22ab){return cmHopper[_0x5bff('0x13')](_0x3a507c,_0x4d883e,_0x2d22ab)[_0x5bff('0xa')](function(_0x56c7b2){logger[_0x5bff('0xc')](_0x5bff('0x14'),inspectError(_0x56c7b2));});}exports[_0x5bff('0x13')]=unlockContact;function moveContactManagedDialer(_0x546351){return cmHopper[_0x5bff('0x15')](_0x546351)[_0x5bff('0xa')](function(_0x36653b){logger[_0x5bff('0xc')]('[moveContactManagedDialer]',inspectError(_0x36653b));});}exports[_0x5bff('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0x5357d4){return cmHopperBlack[_0x5bff('0x16')](_0x5357d4)['catch'](function(_0x1fc4cf){logger[_0x5bff('0xc')](_0x5bff('0x17'),inspectError(_0x1fc4cf));});}exports[_0x5bff('0x16')]=checkIsBlackList;function checkIsBlackListIvr(_0x12d018){return cmHopperBlack[_0x5bff('0x18')](_0x12d018)[_0x5bff('0xa')](function(_0x13ee8f){logger[_0x5bff('0xc')]('[checkIsBlackListIvr]',inspectError(_0x13ee8f));});}exports[_0x5bff('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x263cf5,_0x4369b0,_0x1e7f8a){return cmHopperAdditionalPhone[_0x5bff('0x19')](_0x263cf5,_0x4369b0,_0x1e7f8a)[_0x5bff('0xa')](function(_0x3913fd){logger[_0x5bff('0xc')]('[verifyAdditionalPhone]',inspectError(_0x3913fd));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x9a69de,_0x53bd97,_0x220c8f){return cmHopperAdditionalPhone[_0x5bff('0x1a')](_0x9a69de,_0x53bd97,_0x220c8f)[_0x5bff('0xa')](function(_0x6f18f1){logger[_0x5bff('0xc')](_0x5bff('0x1b'),inspectError(_0x6f18f1));});}exports[_0x5bff('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0xedba9d){return cmHopperHistory['avgHandleTime'](_0xedba9d)['catch'](function(_0x20d750){logger[_0x5bff('0xc')]('[avgHandleTime]',inspectError(_0x20d750));});}exports[_0x5bff('0x1c')]=avgHandleTime;function createHistory(_0x588078){return cmHopperHistory['createHistory'](_0x588078)[_0x5bff('0xa')](function(_0x5cf207){logger[_0x5bff('0xc')](_0x5bff('0x1d'),inspectError(_0x5cf207));});}exports[_0x5bff('0x1e')]=createHistory; \ No newline at end of file +var _0xe2fe=['[countReScheduled]','countReScheduled','[rescheduleContact]','unlockContact','[moveContactManagedDialer]','moveContactManagedDialer','[checkIsBlackList]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime','[createHistory]','createHistory','util','../../rpc/cmHopper','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','catch','error','getContactDialerIvr','dialOrderByScheduledAt','[getContactDialerIvr]'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xee2f('0x0'));var logger=require('../../../../config/logger')('dialer');var cmHopper=require(_0xee2f('0x1'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0xee2f('0x2'));var cmHopperHistory=require(_0xee2f('0x3'));function inspectError(_0xe5ad8a){return util[_0xee2f('0x4')](_0xe5ad8a,{'showHidden':![],'depth':null});}function getContactDialer(_0xcb45e6,_0x4ba89f,_0x311a2f){return cmHopper[_0xee2f('0x5')](_0xcb45e6['id'],_0x4ba89f,_0x311a2f,_0xcb45e6['dialOrderByScheduledAt'])[_0xee2f('0x6')](function(_0x2e1c8c){_0xcb45e6['temp']=0x0;logger[_0xee2f('0x7')]('[getContactDialer]',inspectError(_0x2e1c8c));});}exports[_0xee2f('0x5')]=getContactDialer;function getContactDialerIvr(_0x36920f,_0x53f7dd){return cmHopper[_0xee2f('0x8')](_0x36920f['id'],_0x53f7dd,_0x36920f[_0xee2f('0x9')])['catch'](function(_0x5597ea){_0x36920f['temp']=0x0;logger['error'](_0xee2f('0xa'),inspectError(_0x5597ea));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x481ea7){return cmHopper['countReScheduled'](_0x481ea7)[_0xee2f('0x6')](function(_0x346dbc){logger[_0xee2f('0x7')](_0xee2f('0xb'),inspectError(_0x346dbc));});}exports[_0xee2f('0xc')]=countReScheduled;function rescheduleContact(_0x3ab91f){return cmHopper['rescheduleContact'](_0x3ab91f)[_0xee2f('0x6')](function(_0x531c3a){logger[_0xee2f('0x7')](_0xee2f('0xd'),inspectError(_0x531c3a));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x445ba8,_0x145241,_0x28b614){return cmHopper[_0xee2f('0xe')](_0x445ba8,_0x145241,_0x28b614)[_0xee2f('0x6')](function(_0x58f42a){logger[_0xee2f('0x7')]('[unlockContact]',inspectError(_0x58f42a));});}exports[_0xee2f('0xe')]=unlockContact;function moveContactManagedDialer(_0x3359ff){return cmHopper['moveContactManagedDialer'](_0x3359ff)['catch'](function(_0x40b5bc){logger['error'](_0xee2f('0xf'),inspectError(_0x40b5bc));});}exports[_0xee2f('0x10')]=moveContactManagedDialer;function checkIsBlackList(_0x28549d){return cmHopperBlack['checkIsBlackList'](_0x28549d)[_0xee2f('0x6')](function(_0x1e70aa){logger[_0xee2f('0x7')](_0xee2f('0x11'),inspectError(_0x1e70aa));});}exports[_0xee2f('0x12')]=checkIsBlackList;function checkIsBlackListIvr(_0x5d36d4){return cmHopperBlack['checkIsBlackListIvr'](_0x5d36d4)[_0xee2f('0x6')](function(_0x3a1852){logger[_0xee2f('0x7')](_0xee2f('0x13'),inspectError(_0x3a1852));});}exports[_0xee2f('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0xf278cc,_0x39a39c,_0x4d68d3){return cmHopperAdditionalPhone[_0xee2f('0x15')](_0xf278cc,_0x39a39c,_0x4d68d3)[_0xee2f('0x6')](function(_0x15ceda){logger[_0xee2f('0x7')](_0xee2f('0x16'),inspectError(_0x15ceda));});}exports[_0xee2f('0x15')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x15a1b1,_0x13013f,_0x382174){return cmHopperAdditionalPhone[_0xee2f('0x17')](_0x15a1b1,_0x13013f,_0x382174)[_0xee2f('0x6')](function(_0x168adc){logger[_0xee2f('0x7')](_0xee2f('0x18'),inspectError(_0x168adc));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x4ef690){return cmHopperHistory['avgHandleTime'](_0x4ef690)[_0xee2f('0x6')](function(_0x18ff19){logger[_0xee2f('0x7')](_0xee2f('0x19'),inspectError(_0x18ff19));});}exports[_0xee2f('0x1a')]=avgHandleTime;function createHistory(_0x3737fd){return cmHopperHistory['createHistory'](_0x3737fd)[_0xee2f('0x6')](function(_0x52e1fa){logger[_0xee2f('0x7')](_0xee2f('0x1b'),inspectError(_0x52e1fa));});}exports[_0xee2f('0x1c')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 717aada..bcbc42e 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c94=['waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','isEmpty','Interval','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','getCallerIdRandom','error','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','tags','undefined','%s%s','XMD-','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','type','ivr','outbound','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','diff','seconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking'];(function(_0x4ca8e6,_0x4a230c){var _0x2330a9=function(_0x4341c6){while(--_0x4341c6){_0x4ca8e6['push'](_0x4ca8e6['shift']());}};_0x2330a9(++_0x4a230c);}(_0x7c94,0xe8));var _0x47c9=function(_0x311e77,_0x49a459){_0x311e77=_0x311e77-0x0;var _0x559c54=_0x7c94[_0x311e77];return _0x559c54;};'use strict';var _=require(_0x47c9('0x0'));var moment=require(_0x47c9('0x1'));var util=require(_0x47c9('0x2'));var logger=require(_0x47c9('0x3'))(_0x47c9('0x4'));var timezones=require('../../../../config/environment/shared')['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0x47c9('0x5'),'BLACKLIST':_0x47c9('0x6'),'CONTACTS_RESCHEDULED':_0x47c9('0x7'),'DEACTIVATED':_0x47c9('0x8'),'DISACTIVED':_0x47c9('0x9'),'EMPTY_INTERVAL':_0x47c9('0xa'),'INACTIVE':_0x47c9('0xb'),'NO_AGENTS_LOGGED':_0x47c9('0xc'),'NO_AVAILABLE_CONTACTS':_0x47c9('0xd'),'NULL_INTERVAL':_0x47c9('0xe'),'OVERTIME_INTERVAL':_0x47c9('0xf'),'OVERTIME_GLOBAL_INTERVAL':_0x47c9('0x10'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x47c9('0x11'),'UNREACHABLE_TRUNK':_0x47c9('0x12')};exports[_0x47c9('0x13')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x4a7b38){return _0x4a7b38[_0x47c9('0x14')]===_0x47c9('0x15');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x4dbdee){return _0x4dbdee[_0x47c9('0x16')]===_0x47c9('0x17');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x101a7){return _0x101a7['type']===_0x47c9('0x18');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x3415e5){return _0x3415e5[_0x47c9('0x19')];}exports[_0x47c9('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x5a343b){return _0x5a343b['active'];}exports[_0x47c9('0x1b')]=isIVRCampaignActive;function getSeconds(_0x2ceccb,_0x187e79){var _0x511160=moment(_0x2ceccb)['milliseconds'](0x0);var _0x428d4d=moment(_0x187e79)[_0x47c9('0x1c')](0x0);return _0x511160[_0x47c9('0x1d')](_0x428d4d,_0x47c9('0x1e'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x447f06,_0x546df8){var _0x1f3b7e=![];var _0x409920=_0x447f06[_0x47c9('0x14')]!==_0x546df8[_0x47c9('0x14')]||_0x447f06[_0x47c9('0x19')]!==_0x546df8[_0x47c9('0x19')]||_0x447f06['message']!==_0x546df8[_0x47c9('0x1f')];var _0x1af0ba=_0x447f06[_0x47c9('0x20')]!==_0x546df8[_0x47c9('0x20')]||_0x447f06[_0x47c9('0x21')]!==_0x546df8[_0x47c9('0x21')]||_0x447f06['loggedInDb']!==_0x546df8[_0x47c9('0x22')]||_0x447f06[_0x47c9('0x23')]!==_0x546df8[_0x47c9('0x23')]||_0x447f06[_0x47c9('0x24')]!==_0x546df8['talking']||_0x447f06[_0x47c9('0x25')]!==_0x546df8[_0x47c9('0x25')]||_0x447f06[_0x47c9('0x26')]!==_0x546df8[_0x47c9('0x26')]||_0x447f06[_0x47c9('0x27')]!==_0x546df8[_0x47c9('0x27')]||_0x447f06['originated']!==_0x546df8[_0x47c9('0x28')];if(_0x447f06['Trunk']&&_0x546df8['Trunk']){_0x1f3b7e=_0x447f06[_0x47c9('0x29')][_0x47c9('0x2a')]!==_0x546df8[_0x47c9('0x29')][_0x47c9('0x2a')]||_0x447f06['Trunk']['active']!==_0x546df8['Trunk'][_0x47c9('0x2b')];}return _0x409920||_0x1af0ba||_0x1f3b7e;}exports[_0x47c9('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x3e7042){var _0xf23cb4=null;var _0x576b7e=_0x3e7042[_0x47c9('0x2d')];if(_[_0x47c9('0x2e')](_0x3e7042[_0x47c9('0x2f')])||_['isNil'](_0x3e7042['Interval'])||_[_0x47c9('0x2e')](_0x3e7042['Interval']['Intervals'])){_0xf23cb4=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0x47c9('0x30')](_0x3e7042[_0x47c9('0x2f')])||_[_0x47c9('0x30')](_0x3e7042[_0x47c9('0x31')][_0x47c9('0x32')])){_0xf23cb4=CAMPAIGN_STATUS[_0x47c9('0x33')];}else if(_0x576b7e&&!timezones[_0x576b7e]){_0xf23cb4=CAMPAIGN_STATUS[_0x47c9('0x34')];}return _0xf23cb4;}function checkAnyValidTrunk(_0x146b3c,_0x15153c){var _0x4259e7=null;var _0x1040a3=_0x47c9('0x35');var _0x15dc22=[_0x47c9('0x36'),_0x47c9('0x37')];var _0x4583e7=!![];if(_0x146b3c[_0x47c9('0x29')]&&_0x146b3c[_0x47c9('0x29')][_0x47c9('0x2b')]){_0x1040a3+=_0x146b3c[_0x47c9('0x29')][_0x47c9('0x2a')];_0x4259e7=_0x15153c[_0x1040a3];_0x4583e7=_0x15dc22[_0x47c9('0x38')](_0x4259e7[_0x47c9('0x39')]);}else if(_0x146b3c['TrunkBackup']&&_0x146b3c[_0x47c9('0x3a')][_0x47c9('0x2b')]){_0x1040a3+=_0x146b3c['TrunkBackup']['name'];_0x4259e7=_0x15153c[_0x1040a3];_0x4583e7=_0x15dc22[_0x47c9('0x38')](_0x4259e7[_0x47c9('0x39')]);}return _0x4583e7;}function getQueueCampaignStatusMessage(_0xa557ba,_0x33bc53){var _0x4fe871=CAMPAIGN_STATUS[_0x47c9('0x5')];var _0x2f75ff=isPreviewCampaign(_0xa557ba);if(!isQueueCampaignActive(_0xa557ba)){if(_0x2f75ff){_0x4fe871=CAMPAIGN_STATUS[_0x47c9('0x3b')];}else{if(_0xa557ba['originated']===0x0&&_0xa557ba[_0x47c9('0x24')]===0x0&&_0xa557ba[_0x47c9('0x26')]===0x0&&(_0xa557ba[_0x47c9('0x25')]||0x0)===0x0){_0x4fe871=CAMPAIGN_STATUS[_0x47c9('0x3b')];}else{_0x4fe871=CAMPAIGN_STATUS[_0x47c9('0x3c')];}}}else if(_0xa557ba[_0x47c9('0x21')]===0x0){_0x4fe871=CAMPAIGN_STATUS[_0x47c9('0x3d')];}else if(!checkAnyValidTrunk(_0xa557ba,_0x33bc53)){_0x4fe871=CAMPAIGN_STATUS[_0x47c9('0x3e')];}else if(!isPreviewCampaign(_0xa557ba)){var _0x473425=checkAnyValidQueueCampaignInterval(_0xa557ba);if(_0x473425){_0x4fe871=_0x473425;}}return _0x4fe871;}exports[_0x47c9('0x3f')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x537959){var _0x3102a5=CAMPAIGN_STATUS[_0x47c9('0x3c')];if(_0x537959[_0x47c9('0x28')]===0x0&&_0x537959[_0x47c9('0x24')]===0x0&&_0x537959['waiting']===0x0&&(_0x537959['pTalking']||0x0)===0x0){_0x3102a5=CAMPAIGN_STATUS[_0x47c9('0x3b')];}return _0x3102a5;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x58eb73){var _0x5d285d=_0x58eb73[_0x47c9('0x40')](/"(.*?)"/);return _0x5d285d?_0x5d285d[0x1]:_0x58eb73;}exports[_0x47c9('0x41')]=extractCalleridName;function getCallerId(_0x1dd0d5,_0x3e9981,_0x3c1101){if(!_[_0x47c9('0x42')](_0x3c1101)&&typeof _0x3c1101===_0x47c9('0x43')&&!_['isEmpty'](_0x3c1101)){if(!_[_0x47c9('0x42')](_0x3e9981)&&typeof _0x3e9981==='string'&&!_['isEmpty'](_0x3e9981)){return util[_0x47c9('0x44')](_0x47c9('0x45'),_0x3e9981,_0x3c1101);}return util[_0x47c9('0x44')](_0x47c9('0x45'),_0x3c1101,_0x3c1101);}if(!_[_0x47c9('0x42')](_0x1dd0d5)&&typeof _0x1dd0d5===_0x47c9('0x43')&&!_[_0x47c9('0x30')](_0x1dd0d5)){return _0x1dd0d5;}return _0x47c9('0x46');}exports[_0x47c9('0x47')]=getCallerId;function getCallerIdRandom(_0x2f1659,_0x3e3d4c){var _0xb04483;var _0x31731a;var _0x5cb9fe;if(_0x3e3d4c<=0x0){_0x3e3d4c=0x1;}_0xb04483=new RegExp(_0x47c9('0x48')+_0x3e3d4c+'}$');_0x31731a=Math['pow'](0xa,_0x3e3d4c-0x1);_0x5cb9fe=Math[_0x47c9('0x49')](0xa,_0x3e3d4c)-0x1;return util[_0x47c9('0x44')]('%s',_[_0x47c9('0x4a')](_0x2f1659,_0xb04483,_[_0x47c9('0x4b')](_0x31731a,_0x5cb9fe)['toString']()));}exports[_0x47c9('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x2b9450){if(_0x2b9450['originated']&&_0x2b9450[_0x47c9('0x28')]>0x0){_0x2b9450[_0x47c9('0x28')]-=0x1;}else{logger[_0x47c9('0x4d')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x47c9('0x4e')]=decrementOriginate;function checkContactEmpty(_0x5a5ba4){return _0x5a5ba4&&_0x5a5ba4[_0x47c9('0x4f')]>0x0;}exports[_0x47c9('0x50')]=checkContactEmpty;function erlangb(_0x52fe3b,_0x40937f){if(_0x40937f===0x0){return 0x0;}var _0x9cafcd=0x1;for(var _0x2aed78=0x1;_0x2aed78<=_0x40937f;_0x2aed78+=0x1){_0x9cafcd=0x1+_0x9cafcd*_0x2aed78/_0x52fe3b;}return 0x1/_0x9cafcd;}exports[_0x47c9('0x51')]=erlangb;function checkContactLowerLimitOriginate(_0x452a7f,_0x11ac61,_0x3856d4){if(_0x11ac61>_0x3856d4){for(var _0x420c67=0x0;_0x420c67<_0x11ac61-_0x3856d4;_0x420c67+=0x1){decrementOriginate(_0x452a7f);}}}exports[_0x47c9('0x52')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x41086c){var _0x22a254={};var _0x5959b7=['id',_0x47c9('0x53'),_0x47c9('0x54'),_0x47c9('0x55'),'updatedAt'];if(_0x41086c){for(var _0x35d98a in _0x41086c){if(typeof _0x41086c[_0x35d98a]!==_0x47c9('0x56')){if(!_[_0x47c9('0x2e')](_0x41086c[_0x35d98a])&&!_0x5959b7[_0x47c9('0x38')](_0x35d98a)){_0x22a254[util[_0x47c9('0x44')](_0x47c9('0x57'),_0x47c9('0x58'),_0x35d98a['toUpperCase']())]=_0x41086c[_0x35d98a];}}}}return _0x22a254;}exports[_0x47c9('0x59')]=setXMDContactVariables; \ No newline at end of file +var _0x234c=['dialer','../../../../config/environment/shared','ACTIVE','RESCHEDULED_CONTACTS','IS_DISACTIVED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','type','ivr','outbound','dialActive','active','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','replace','random','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','tags','toUpperCase','setXMDContactVariables','lodash','moment','util','../../../../config/logger'];(function(_0x2b0e78,_0x160fd5){var _0x157f98=function(_0x1b6792){while(--_0x1b6792){_0x2b0e78['push'](_0x2b0e78['shift']());}};_0x157f98(++_0x160fd5);}(_0x234c,0x140));var _0xc234=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x234c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc234('0x0'));var moment=require(_0xc234('0x1'));var util=require(_0xc234('0x2'));var logger=require(_0xc234('0x3'))(_0xc234('0x4'));var timezones=require(_0xc234('0x5'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0xc234('0x6'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0xc234('0x7'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0xc234('0x8'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0xc234('0x9'),'NULL_INTERVAL':_0xc234('0xa'),'OVERTIME_INTERVAL':_0xc234('0xb'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0xc234('0xc'),'RECALL_TIMEOUT':_0xc234('0xd'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0xc234('0xe'),'UNREACHABLE_TRUNK':_0xc234('0xf')};exports[_0xc234('0x10')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x50c49d){return _0x50c49d[_0xc234('0x11')]==='preview';}exports[_0xc234('0x12')]=isPreviewCampaign;function isIVRCampaign(_0x3bd14d){return _0x3bd14d[_0xc234('0x13')]===_0xc234('0x14');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x10f57f){return _0x10f57f[_0xc234('0x13')]===_0xc234('0x15');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x5e689e){return _0x5e689e[_0xc234('0x16')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x272f26){return _0x272f26[_0xc234('0x17')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x50e753,_0x3d21c1){var _0x50764d=moment(_0x50e753)[_0xc234('0x18')](0x0);var _0x32b2ac=moment(_0x3d21c1)[_0xc234('0x18')](0x0);return _0x50764d[_0xc234('0x19')](_0x32b2ac,_0xc234('0x1a'));}exports[_0xc234('0x1b')]=getSeconds;function hasQueueCampaignDataChanged(_0x32c18c,_0x15a350){var _0x15e280=![];var _0x3582f2=_0x32c18c['dialMethod']!==_0x15a350[_0xc234('0x11')]||_0x32c18c[_0xc234('0x16')]!==_0x15a350[_0xc234('0x16')]||_0x32c18c['message']!==_0x15a350[_0xc234('0x1c')];var _0x1e2d81=_0x32c18c[_0xc234('0x1d')]!==_0x15a350[_0xc234('0x1d')]||_0x32c18c[_0xc234('0x1e')]!==_0x15a350[_0xc234('0x1e')]||_0x32c18c[_0xc234('0x1f')]!==_0x15a350['loggedInDb']||_0x32c18c[_0xc234('0x20')]!==_0x15a350[_0xc234('0x20')]||_0x32c18c[_0xc234('0x21')]!==_0x15a350['talking']||_0x32c18c[_0xc234('0x22')]!==_0x15a350['pTalking']||_0x32c18c[_0xc234('0x23')]!==_0x15a350['waiting']||_0x32c18c[_0xc234('0x24')]!==_0x15a350[_0xc234('0x24')]||_0x32c18c[_0xc234('0x25')]!==_0x15a350['originated'];if(_0x32c18c[_0xc234('0x26')]&&_0x15a350[_0xc234('0x26')]){_0x15e280=_0x32c18c[_0xc234('0x26')][_0xc234('0x27')]!==_0x15a350['Trunk'][_0xc234('0x27')]||_0x32c18c['Trunk'][_0xc234('0x17')]!==_0x15a350[_0xc234('0x26')][_0xc234('0x17')];}return _0x3582f2||_0x1e2d81||_0x15e280;}exports[_0xc234('0x28')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x112e00){var _0x20663d=null;var _0x364b66=_0x112e00[_0xc234('0x29')];if(_[_0xc234('0x2a')](_0x112e00[_0xc234('0x2b')])||_[_0xc234('0x2a')](_0x112e00[_0xc234('0x2c')])||_['isNil'](_0x112e00[_0xc234('0x2c')][_0xc234('0x2d')])){_0x20663d=CAMPAIGN_STATUS[_0xc234('0x2e')];}else if(_['isEmpty'](_0x112e00[_0xc234('0x2b')])||_['isEmpty'](_0x112e00[_0xc234('0x2c')][_0xc234('0x2d')])){_0x20663d=CAMPAIGN_STATUS[_0xc234('0x2f')];}else if(_0x364b66&&!timezones[_0x364b66]){_0x20663d=CAMPAIGN_STATUS[_0xc234('0x30')];}return _0x20663d;}function checkAnyValidTrunk(_0x501344,_0x3a33c0){var _0xadc80d=null;var _0x16ee42=_0xc234('0x31');var _0x3e2a5a=[_0xc234('0x32'),_0xc234('0x33')];var _0x359f1b=!![];if(_0x501344['Trunk']&&_0x501344[_0xc234('0x26')][_0xc234('0x17')]){_0x16ee42+=_0x501344['Trunk'][_0xc234('0x27')];_0xadc80d=_0x3a33c0[_0x16ee42];_0x359f1b=_0x3e2a5a[_0xc234('0x34')](_0xadc80d[_0xc234('0x35')]);}else if(_0x501344['TrunkBackup']&&_0x501344[_0xc234('0x36')]['active']){_0x16ee42+=_0x501344[_0xc234('0x36')]['name'];_0xadc80d=_0x3a33c0[_0x16ee42];_0x359f1b=_0x3e2a5a[_0xc234('0x34')](_0xadc80d[_0xc234('0x35')]);}return _0x359f1b;}function getQueueCampaignStatusMessage(_0x3a13a8,_0x4b912f){var _0x5da951=CAMPAIGN_STATUS['ACTIVE'];var _0x4a7a7b=isPreviewCampaign(_0x3a13a8);if(!isQueueCampaignActive(_0x3a13a8)){if(_0x4a7a7b){_0x5da951=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x3a13a8[_0xc234('0x25')]===0x0&&_0x3a13a8[_0xc234('0x21')]===0x0&&_0x3a13a8[_0xc234('0x23')]===0x0&&(_0x3a13a8[_0xc234('0x22')]||0x0)===0x0){_0x5da951=CAMPAIGN_STATUS[_0xc234('0x37')];}else{_0x5da951=CAMPAIGN_STATUS[_0xc234('0x38')];}}}else if(_0x3a13a8[_0xc234('0x1e')]===0x0){_0x5da951=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x3a13a8,_0x4b912f)){_0x5da951=CAMPAIGN_STATUS[_0xc234('0x39')];}else if(!isPreviewCampaign(_0x3a13a8)){var _0x1cc0dc=checkAnyValidQueueCampaignInterval(_0x3a13a8);if(_0x1cc0dc){_0x5da951=_0x1cc0dc;}}return _0x5da951;}exports[_0xc234('0x3a')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0xe2b103){var _0x151ba4=CAMPAIGN_STATUS[_0xc234('0x38')];if(_0xe2b103[_0xc234('0x25')]===0x0&&_0xe2b103['talking']===0x0&&_0xe2b103[_0xc234('0x23')]===0x0&&(_0xe2b103[_0xc234('0x22')]||0x0)===0x0){_0x151ba4=CAMPAIGN_STATUS[_0xc234('0x37')];}return _0x151ba4;}exports[_0xc234('0x3b')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x59fb5a){var _0x5ece26=_0x59fb5a[_0xc234('0x3c')](/"(.*?)"/);return _0x5ece26?_0x5ece26[0x1]:_0x59fb5a;}exports[_0xc234('0x3d')]=extractCalleridName;function getCallerId(_0x3381bd,_0x18557f,_0x13e7d5){if(!_[_0xc234('0x3e')](_0x13e7d5)&&typeof _0x13e7d5===_0xc234('0x3f')&&!_[_0xc234('0x40')](_0x13e7d5)){if(!_[_0xc234('0x3e')](_0x18557f)&&typeof _0x18557f==='string'&&!_['isEmpty'](_0x18557f)){return util[_0xc234('0x41')]('\x22%s\x22\x20<%s>',_0x18557f,_0x13e7d5);}return util[_0xc234('0x41')](_0xc234('0x42'),_0x13e7d5,_0x13e7d5);}if(!_[_0xc234('0x3e')](_0x3381bd)&&typeof _0x3381bd===_0xc234('0x3f')&&!_[_0xc234('0x40')](_0x3381bd)){return _0x3381bd;}return _0xc234('0x43');}exports[_0xc234('0x44')]=getCallerId;function getCallerIdRandom(_0x52d789,_0x3a8b4a){var _0x19dd4f;var _0x1bebd8;var _0x184f92;if(_0x3a8b4a<=0x0){_0x3a8b4a=0x1;}_0x19dd4f=new RegExp('\x5cw{0,'+_0x3a8b4a+'}$');_0x1bebd8=Math['pow'](0xa,_0x3a8b4a-0x1);_0x184f92=Math['pow'](0xa,_0x3a8b4a)-0x1;return util[_0xc234('0x41')]('%s',_[_0xc234('0x45')](_0x52d789,_0x19dd4f,_[_0xc234('0x46')](_0x1bebd8,_0x184f92)['toString']()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x460730){if(_0x460730[_0xc234('0x25')]&&_0x460730['originated']>0x0){_0x460730[_0xc234('0x25')]-=0x1;}else{logger[_0xc234('0x47')](_0xc234('0x48'));}}exports[_0xc234('0x49')]=decrementOriginate;function checkContactEmpty(_0x25ae79){return _0x25ae79&&_0x25ae79[_0xc234('0x4a')]>0x0;}exports[_0xc234('0x4b')]=checkContactEmpty;function erlangb(_0x1c2119,_0x378f7e){if(_0x378f7e===0x0){return 0x0;}var _0x297a6c=0x1;for(var _0x19e2c2=0x1;_0x19e2c2<=_0x378f7e;_0x19e2c2+=0x1){_0x297a6c=0x1+_0x297a6c*_0x19e2c2/_0x1c2119;}return 0x1/_0x297a6c;}exports[_0xc234('0x4c')]=erlangb;function checkContactLowerLimitOriginate(_0x533b7c,_0x1f421c,_0x129e66){if(_0x1f421c>_0x129e66){for(var _0x19ff1a=0x0;_0x19ff1a<_0x1f421c-_0x129e66;_0x19ff1a+=0x1){decrementOriginate(_0x533b7c);}}}exports[_0xc234('0x4d')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x4b8391){var _0x415fb8={};var _0x234e99=['id','createdAt','description',_0xc234('0x4e'),'updatedAt'];if(_0x4b8391){for(var _0x4e0354 in _0x4b8391){if(typeof _0x4b8391[_0x4e0354]!=='undefined'){if(!_[_0xc234('0x2a')](_0x4b8391[_0x4e0354])&&!_0x234e99['includes'](_0x4e0354)){_0x415fb8[util['format']('%s%s','XMD-',_0x4e0354[_0xc234('0x4f')]())]=_0x4b8391[_0x4e0354];}}}}return _0x415fb8;}exports[_0xc234('0x50')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 39e4559..0b806dc 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(_0x102ab0,_0x4f24cf){var _0x672547=function(_0x5eaf35){while(--_0x5eaf35){_0x102ab0['push'](_0x102ab0['shift']());}};_0x672547(++_0x4f24cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x241865,_0x2ffc60){var _0x135ff3=function(_0x153af5){while(--_0x153af5){_0x241865['push'](_0x241865['shift']());}};_0x135ff3(++_0x2ffc60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var 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 e13ed61..5e6dd65 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 _0xf143=['./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','varset','syncVarSet','bind','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','from-voip-provider','hasOwnProperty','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','value','syncNewState','channelstate','channelstatedesc','status','localstationid','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','\x20notify\x20','catch','error','\x20receiveFax\x20','stringify','syncOriginateResponse','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','isTrunkReachable','isNil','active','SIP/%s','reachable','checkTrunk','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','../../../config/logger','fax','../ami','./channel'];(function(_0x361026,_0x2375e2){var _0x37028e=function(_0x4f89e0){while(--_0x4f89e0){_0x361026['push'](_0x361026['shift']());}};_0x37028e(++_0x2375e2);}(_0xf143,0x1be));var _0x3f14=function(_0x3c8d82,_0xab4911){_0x3c8d82=_0x3c8d82-0x0;var _0x446e55=_0xf143[_0x3c8d82];return _0x446e55;};'use strict';var util=require(_0x3f14('0x0'));var _=require(_0x3f14('0x1'));var BPromise=require(_0x3f14('0x2'));var uuid=require(_0x3f14('0x3'));var moment=require(_0x3f14('0x4'));var path=require(_0x3f14('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x3f14('0x6'))(_0x3f14('0x7'));var ami=require(_0x3f14('0x8'));var rpcDb=require('./rpcDb');var Channel=require(_0x3f14('0x9'));var ut=require(_0x3f14('0xa'));var Action=require('./action');var faxAccount=require(_0x3f14('0xb'));var attachment=require(_0x3f14('0xc'));var faxMessage=require(_0x3f14('0xd'));function Fax(_0x3c4cc2){this[_0x3f14('0xe')]={};this[_0x3f14('0xf')]=_0x3c4cc2[_0x3f14('0xf')];this[_0x3f14('0x10')]=_0x3c4cc2[_0x3f14('0x10')];this[_0x3f14('0x11')]={};ami['on']('newchannel',this[_0x3f14('0x12')]['bind'](this));ami['on'](_0x3f14('0x13'),this[_0x3f14('0x14')][_0x3f14('0x15')](this));ami['on'](_0x3f14('0x16'),this['syncNewState'][_0x3f14('0x15')](this));ami['on'](_0x3f14('0x17'),this[_0x3f14('0x18')][_0x3f14('0x15')](this));ami['on'](_0x3f14('0x19'),this[_0x3f14('0x1a')][_0x3f14('0x15')](this));ami['on']('receivefax',this[_0x3f14('0x1b')][_0x3f14('0x15')](this));ami['on'](_0x3f14('0x1c'),this[_0x3f14('0x1d')][_0x3f14('0x15')](this));ami['on'](_0x3f14('0x1e'),this['syncOriginateResponse']['bind'](this));}Fax['prototype']['syncNewchannel']=function(_0xe90fcc){if(_0xe90fcc['context']===_0x3f14('0x1f')){for(var _0x4cc147 in this[_0x3f14('0xf')]){if(this[_0x3f14('0xf')][_0x3f14('0x20')](_0x4cc147)){if(_0xe90fcc['exten']===this[_0x3f14('0xf')][_0x4cc147]['localstationid']){this['channels'][_0xe90fcc[_0x3f14('0x21')]]={};this[_0x3f14('0xe')][_0xe90fcc[_0x3f14('0x21')]]['channel']=_0xe90fcc[_0x3f14('0x22')];this['channels'][_0xe90fcc['uniqueid']]['id']=this[_0x3f14('0xf')][_0x4cc147]['id'];this[_0x3f14('0xe')][_0xe90fcc[_0x3f14('0x21')]][_0x3f14('0x23')]=this[_0x3f14('0xf')][_0x4cc147][_0x3f14('0x23')];logger[_0x3f14('0x24')](_0xe90fcc[_0x3f14('0x21')],'\x20syncNewchannel\x20');}}}}if(this[_0x3f14('0x11')][_0xe90fcc['uniqueid']]){this[_0x3f14('0xe')][_0xe90fcc[_0x3f14('0x21')]]={};this[_0x3f14('0xe')][_0xe90fcc[_0x3f14('0x21')]][_0x3f14('0x22')]=_0xe90fcc[_0x3f14('0x22')];logger['info'](_0xe90fcc[_0x3f14('0x21')],_0x3f14('0x25'));}};Fax[_0x3f14('0x26')]['syncVarSet']=function(_0x2e856c){if(this[_0x3f14('0xe')][_0x2e856c[_0x3f14('0x21')]]){for(var _0x2675d9 in _0x2e856c[_0x3f14('0x27')]){if(_0x2e856c[_0x3f14('0x27')][_0x3f14('0x20')](_0x2675d9)){this[_0x3f14('0xe')][_0x2e856c[_0x3f14('0x21')]][_0x2675d9]=_0x2e856c[_0x3f14('0x28')];}}}};Fax[_0x3f14('0x26')][_0x3f14('0x29')]=function(_0x24923c){if(this[_0x3f14('0xe')][_0x24923c['uniqueid']]){this[_0x3f14('0xe')][_0x24923c[_0x3f14('0x21')]]['channelstate']=_0x24923c[_0x3f14('0x2a')];this['channels'][_0x24923c[_0x3f14('0x21')]]['channelstatedesc']=_0x24923c[_0x3f14('0x2b')];}};Fax[_0x3f14('0x26')]['syncNewExten']=function(_0x3fd793){if(this[_0x3f14('0xe')][_0x3fd793[_0x3f14('0x21')]]){for(var _0x332f79 in _0x3fd793[_0x3f14('0x27')]){if(_0x3fd793[_0x3f14('0x27')][_0x3f14('0x20')](_0x332f79)){this[_0x3f14('0xe')][_0x3fd793[_0x3f14('0x21')]][_0x332f79]=_0x3fd793[_0x3f14('0x28')];}}}};Fax[_0x3f14('0x26')][_0x3f14('0x1a')]=function(_0x1ddaa6){if(this[_0x3f14('0xe')][_0x1ddaa6[_0x3f14('0x21')]]){this['channels'][_0x1ddaa6[_0x3f14('0x21')]]['operation']=_0x1ddaa6['operation'];this[_0x3f14('0xe')][_0x1ddaa6['uniqueid']][_0x3f14('0x2c')]=_0x1ddaa6[_0x3f14('0x2c')];this[_0x3f14('0xe')][_0x1ddaa6[_0x3f14('0x21')]][_0x3f14('0x2d')]=_0x1ddaa6[_0x3f14('0x2d')];this['channels'][_0x1ddaa6[_0x3f14('0x21')]][_0x3f14('0x2e')]=_0x1ddaa6['filename'];logger[_0x3f14('0x24')](_0x1ddaa6[_0x3f14('0x21')],'\x20syncFaxStatus\x20');}};Fax[_0x3f14('0x26')][_0x3f14('0x1b')]=function(_0x23b8d6){var _0x3e7887=this;if(this['channels'][_0x23b8d6['uniqueid']]){var _0x37eec0=this[_0x3f14('0xe')][_0x23b8d6[_0x3f14('0x21')]]['id'];this[_0x3f14('0xe')][_0x23b8d6[_0x3f14('0x21')]][_0x3f14('0x2f')]=_0x23b8d6[_0x3f14('0x2f')];this[_0x3f14('0xe')][_0x23b8d6[_0x3f14('0x21')]][_0x3f14('0x30')]=_0x23b8d6['pagestransferred'];this['channels'][_0x23b8d6[_0x3f14('0x21')]][_0x3f14('0x2d')]=_0x23b8d6['localstationid'];this[_0x3f14('0xe')][_0x23b8d6[_0x3f14('0x21')]][_0x3f14('0x31')]=_0x23b8d6['resolution'];this['channels'][_0x23b8d6[_0x3f14('0x21')]]['transferrate']=_0x23b8d6[_0x3f14('0x32')];this[_0x3f14('0xe')][_0x23b8d6[_0x3f14('0x21')]]['filename']=_0x23b8d6[_0x3f14('0x2e')];this[_0x3f14('0xe')][_0x23b8d6['uniqueid']][_0x3f14('0x33')]=_0x23b8d6[_0x3f14('0x33')];if(this[_0x3f14('0xe')][_0x23b8d6[_0x3f14('0x21')]][_0x3f14('0x30')]>0x0){tiff2pdf(_0x23b8d6['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x20b691){logger[_0x3f14('0x24')](_0x23b8d6['uniqueid'],_0x3f14('0x34'),_0x20b691[_0x3f14('0x35')]);attachment[_0x3f14('0x36')]({'name':path[_0x3f14('0x37')](_0x23b8d6[_0x3f14('0x2e')])['name'],'basename':path['parse'](_0x23b8d6[_0x3f14('0x2e')])['name']+_0x3f14('0x38'),'type':'application/pdf'})[_0x3f14('0x39')](function(_0x3cec60){faxAccount[_0x3f14('0x3a')](_0x37eec0,{'from':_0x23b8d6[_0x3f14('0x33')],'mapKey':_0x3f14('0x7'),'body':path['parse'](_0x23b8d6[_0x3f14('0x2e')])['name']+'.pdf','AttachmentId':_0x3cec60['id']})['catch'](function(_0x49eefa){logger['error'](_0x23b8d6[_0x3f14('0x21')],_0x3f14('0x3b'),JSON['stringify'](_0x49eefa));});})[_0x3f14('0x3c')](function(_0x5b37ee){logger[_0x3f14('0x3d')](_0x23b8d6['uniqueid'],_0x3f14('0x3e'),JSON[_0x3f14('0x3f')](_0x5b37ee));});});}logger[_0x3f14('0x24')](_0x23b8d6[_0x3f14('0x21')],'\x20receiveFax\x20');}};Fax[_0x3f14('0x26')][_0x3f14('0x40')]=function(_0x3399e8){if(this['actions'][_0x3399e8[_0x3f14('0x21')]]){_[_0x3f14('0x41')](this[_0x3f14('0xe')][_0x3399e8[_0x3f14('0x21')]],_['pick'](_0x3399e8,[_0x3f14('0x42'),_0x3f14('0x43')]));}};function updateStatus(_0x43a4b2){if(_0x43a4b2[_0x3f14('0x44')]){faxMessage[_0x3f14('0x45')](_0x43a4b2[_0x3f14('0x44')],{'failMessage':_0x3f14('0x46')})[_0x3f14('0x39')](function(_0x77aa11){ut[_0x3f14('0x47')](_0x3f14('0x48'),_0x77aa11);})[_0x3f14('0x3c')](function(_0x2ee8d9){ut[_0x3f14('0x47')](_0x3f14('0x49'),_0x2ee8d9);});}else{ut[_0x3f14('0x47')](_0x3f14('0x4a'));}}Fax[_0x3f14('0x26')]['updateStatus']=function(_0x12d862,_0x3e665b,_0x31b33d){var _0x292ee0=this;var _0xfdd417={};if(_0x3e665b){_0xfdd417={'read':_0x3e665b};}else{_0xfdd417={'failMessage':_0x31b33d};}if(this[_0x3f14('0x11')][_0x12d862][_0x3f14('0x44')]){faxMessage[_0x3f14('0x45')](this[_0x3f14('0x11')][_0x12d862][_0x3f14('0x44')],_0xfdd417)[_0x3f14('0x39')](function(_0x3ba954){ut[_0x3f14('0x47')](_0x3f14('0x4b'),_0x3ba954);})[_0x3f14('0x3c')](function(_0x3d5ad9){ut['logger'](_0x3f14('0x4c'),_0x3d5ad9);})[_0x3f14('0x4d')](function(){delete _0x292ee0[_0x3f14('0xe')][_0x12d862];delete _0x292ee0[_0x3f14('0x11')][_0x12d862];});}else{ut[_0x3f14('0x47')]('[Fax][Message][NoUpdate2]');delete this[_0x3f14('0xe')][_0x12d862];delete this[_0x3f14('0x11')][_0x12d862];}};Fax[_0x3f14('0x26')]['syncHangup']=function(_0x447a1a){var _0x5bf1d9=this;if(this[_0x3f14('0xe')][_0x447a1a[_0x3f14('0x21')]]){if(this[_0x3f14('0x11')][_0x447a1a[_0x3f14('0x21')]]){this['channels'][_0x447a1a[_0x3f14('0x21')]]['id']=this[_0x3f14('0x11')][_0x447a1a['uniqueid']]['id'];this[_0x3f14('0xe')][_0x447a1a[_0x3f14('0x21')]][_0x3f14('0x23')]=this['actions'][_0x447a1a[_0x3f14('0x21')]][_0x3f14('0x23')];}logger[_0x3f14('0x24')](_0x447a1a[_0x3f14('0x21')],this[_0x3f14('0x11')][_0x447a1a[_0x3f14('0x21')]]?_0x3f14('0x4e'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0x3f14('0xe')][_0x447a1a[_0x3f14('0x21')]]));if(this['actions'][_0x447a1a[_0x3f14('0x21')]]){if(this['channels'][_0x447a1a[_0x3f14('0x21')]][_0x3f14('0x4f')]>0x0&&this['channels'][_0x447a1a['uniqueid']][_0x3f14('0x19')]===_0x3f14('0x50')){this[_0x3f14('0x51')](_0x447a1a['uniqueid'],!![]);}else{this[_0x3f14('0x51')](_0x447a1a[_0x3f14('0x21')],![],this[_0x3f14('0xe')][_0x447a1a[_0x3f14('0x21')]][_0x3f14('0x52')]?_0x3f14('0x53')+this[_0x3f14('0xe')][_0x447a1a['uniqueid']][_0x3f14('0x52')]:_0x3f14('0x54'));}}}};Fax[_0x3f14('0x26')]['send']=function(_0x2d6bd4){var _0x1fb311=this;return new BPromise(function(_0x286a16,_0x432e7c){_0x1fb311[_0x3f14('0x55')](_0x2d6bd4,_0x1fb311[_0x3f14('0xf')][_0x2d6bd4['FaxAccountId']])[_0x3f14('0x39')](function(_0x210478){ut[_0x3f14('0x47')](_0x3f14('0x56'),_0x210478);_0x286a16(ut[_0x3f14('0x35')](_0x3f14('0x57')));})[_0x3f14('0x3c')](function(_0x5f12a3){ut['logger']('[Fax][execOriginate][failure]',_0x5f12a3);updateStatus(_0x2d6bd4);_0x432e7c(ut[_0x3f14('0x35')](_0x3f14('0x58')));});});};Fax['prototype']['checkAfterSend']=function(_0x48e385){var _0x1ccf70=this;return new BPromise(function(_0x31de10,_0x29cd7c){var _0x4d3bfc=_0x1ccf70['checkTrunk'](_0x1ccf70[_0x3f14('0xf')][_0x48e385[_0x3f14('0x59')]][_0x3f14('0x5a')],_0x48e385);if(_0x4d3bfc[_0x3f14('0x5b')]){_0x31de10(ut[_0x3f14('0x35')](_0x3f14('0x5c')));}else{_0x29cd7c(ut['message'](_0x4d3bfc['message']));}});};function originate(_0x504033,_0x48f4da,_0x446793){return new BPromise(function(_0xee132b,_0x581f01){if(_0x446793){var _0x26facd=util[_0x3f14('0x5d')](_0x3f14('0x5e'),path['parse'](_0x504033['path'])[_0x3f14('0x23')],_0x504033[_0x3f14('0x5')]);gs[_0x3f14('0x5f')](_0x26facd)['then'](function(){_0x504033['path']=util[_0x3f14('0x5d')](_0x3f14('0x60'),path[_0x3f14('0x37')](_0x504033[_0x3f14('0x5')])[_0x3f14('0x61')],path['parse'](_0x504033[_0x3f14('0x5')])[_0x3f14('0x23')]);_0x48f4da[_0x3f14('0x62')]=_0x504033['path'];ut['logger'](_0x3f14('0x63'),'');ami['Action'](ut[_0x3f14('0x64')](_0x504033,_0x48f4da))[_0x3f14('0x39')](function(_0x2f5ae9){_0xee132b(_0x2f5ae9);})[_0x3f14('0x3c')](function(_0x4c9cc6){_0x581f01(_0x4c9cc6);});})['catch'](function(_0xee32fa){_0x581f01(_0xee32fa);});}else{ami[_0x3f14('0x65')](ut['variablesAction'](_0x504033,_0x48f4da))[_0x3f14('0x39')](function(_0xc8dce2){_0xee132b(_0xc8dce2);})[_0x3f14('0x3c')](function(_0x47509e){_0x581f01(_0x47509e);});}});}Fax[_0x3f14('0x26')][_0x3f14('0x55')]=function(_0x3da0f0,_0xd17269){var _0x4454ea=this;return new BPromise(function(_0x593649,_0x55c3a4){var _0x5c928e=uuid['v4']();var _0x5ca1b9=ut['addVariables'](_0x3da0f0,_0xd17269);_0x4454ea[_0x3f14('0x11')][_0x5c928e]=new Action(_0x5c928e,_0xd17269,_0x3da0f0);var _0x45fcad=_0x4454ea['actions'][_0x5c928e];if(path[_0x3f14('0x37')](_0x3da0f0[_0x3f14('0x5')])['ext']==='.pdf'){originate(_0x45fcad,_0x5ca1b9,!![])[_0x3f14('0x39')](function(_0x3806b7){_0x593649(_0x3806b7);})[_0x3f14('0x3c')](function(_0x26fcd2){_0x55c3a4(_0x26fcd2);});}else{originate(_0x45fcad,_0x5ca1b9,![])[_0x3f14('0x39')](function(_0x51e073){_0x593649(_0x51e073);})[_0x3f14('0x3c')](function(_0x43321c){_0x55c3a4(_0x43321c);});}});};Fax[_0x3f14('0x26')][_0x3f14('0x66')]=function(_0x20bb44){return!_[_0x3f14('0x67')](_0x20bb44)&&!_[_0x3f14('0x67')](_0x20bb44[_0x3f14('0x23')])&&!_['isNil'](_0x20bb44[_0x3f14('0x68')])&&_0x20bb44[_0x3f14('0x68')]&&!_[_0x3f14('0x67')](this['trunks'][util[_0x3f14('0x5d')](_0x3f14('0x69'),_0x20bb44[_0x3f14('0x23')])])&&!_['isNil'](this[_0x3f14('0x10')][util[_0x3f14('0x5d')](_0x3f14('0x69'),_0x20bb44['name'])][_0x3f14('0x2c')])&&(this[_0x3f14('0x10')][util[_0x3f14('0x5d')](_0x3f14('0x69'),_0x20bb44[_0x3f14('0x23')])][_0x3f14('0x2c')]===_0x3f14('0x6a')||this['trunks'][util[_0x3f14('0x5d')](_0x3f14('0x69'),_0x20bb44[_0x3f14('0x23')])][_0x3f14('0x2c')]==='unmonitored');};Fax[_0x3f14('0x26')][_0x3f14('0x6b')]=function(_0x5704ae,_0x30b295){if(!this[_0x3f14('0x66')](_0x5704ae)){ut[_0x3f14('0x47')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x3f14('0x67')](_0x5704ae)?'':_0x5704ae[_0x3f14('0x23')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x3f14('0x6c')};}if(_['isNil'](_0x30b295[_0x3f14('0x7')])){ut[_0x3f14('0x47')](_0x3f14('0x6d'),JSON['stringify'](_0x30b295));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x3f14('0x67')](_0x30b295[_0x3f14('0x5')])){ut['logger'](_0x3f14('0x6e'),JSON['stringify'](_0x30b295));return{'isValid':![],'message':_0x3f14('0x6f')};}return{'isValid':!![],'message':_0x3f14('0x70')};};module[_0x3f14('0x71')]=Fax; \ No newline at end of file +var _0x7321=['../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','receivefax','syncReceiveFax','hangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20receiveFax\x20','merge','pick','response','reason','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','stringify','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','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','execute','%s/%s.tif','XMF-PATH','Action','variablesAction','execOriginate','addVariables','ext','isNil','active','SIP/%s','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment'];(function(_0x5ed227,_0x3931eb){var _0x52ed79=function(_0x4140f4){while(--_0x4140f4){_0x5ed227['push'](_0x5ed227['shift']());}};_0x52ed79(++_0x3931eb);}(_0x7321,0x14f));var _0x1732=function(_0x134ee6,_0x1419ae){_0x134ee6=_0x134ee6-0x0;var _0x35debc=_0x7321[_0x134ee6];return _0x35debc;};'use strict';var util=require(_0x1732('0x0'));var _=require(_0x1732('0x1'));var BPromise=require(_0x1732('0x2'));var uuid=require('uuid');var moment=require(_0x1732('0x3'));var path=require(_0x1732('0x4'));var tiff2pdf=require(_0x1732('0x5'));var gs=require(_0x1732('0x6'));var logger=require('../../../config/logger')('fax');var ami=require(_0x1732('0x7'));var rpcDb=require(_0x1732('0x8'));var Channel=require(_0x1732('0x9'));var ut=require(_0x1732('0xa'));var Action=require(_0x1732('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x1732('0xc'));var faxMessage=require(_0x1732('0xd'));function Fax(_0x1953af){this[_0x1732('0xe')]={};this[_0x1732('0xf')]=_0x1953af[_0x1732('0xf')];this[_0x1732('0x10')]=_0x1953af[_0x1732('0x10')];this['actions']={};ami['on'](_0x1732('0x11'),this[_0x1732('0x12')][_0x1732('0x13')](this));ami['on'](_0x1732('0x14'),this[_0x1732('0x15')][_0x1732('0x13')](this));ami['on']('newstate',this[_0x1732('0x16')][_0x1732('0x13')](this));ami['on'](_0x1732('0x17'),this[_0x1732('0x18')][_0x1732('0x13')](this));ami['on']('faxstatus',this['syncFaxStatus'][_0x1732('0x13')](this));ami['on'](_0x1732('0x19'),this[_0x1732('0x1a')][_0x1732('0x13')](this));ami['on'](_0x1732('0x1b'),this['syncHangup']['bind'](this));ami['on'](_0x1732('0x1c'),this['syncOriginateResponse'][_0x1732('0x13')](this));}Fax[_0x1732('0x1d')][_0x1732('0x12')]=function(_0x5572bc){if(_0x5572bc[_0x1732('0x1e')]===_0x1732('0x1f')){for(var _0x2a2463 in this['faxAccounts']){if(this['faxAccounts'][_0x1732('0x20')](_0x2a2463)){if(_0x5572bc[_0x1732('0x21')]===this[_0x1732('0xf')][_0x2a2463][_0x1732('0x22')]){this[_0x1732('0xe')][_0x5572bc[_0x1732('0x23')]]={};this[_0x1732('0xe')][_0x5572bc['uniqueid']][_0x1732('0x24')]=_0x5572bc[_0x1732('0x24')];this[_0x1732('0xe')][_0x5572bc[_0x1732('0x23')]]['id']=this[_0x1732('0xf')][_0x2a2463]['id'];this[_0x1732('0xe')][_0x5572bc[_0x1732('0x23')]][_0x1732('0x25')]=this[_0x1732('0xf')][_0x2a2463][_0x1732('0x25')];logger[_0x1732('0x26')](_0x5572bc[_0x1732('0x23')],_0x1732('0x27'));}}}}if(this[_0x1732('0x28')][_0x5572bc[_0x1732('0x23')]]){this[_0x1732('0xe')][_0x5572bc[_0x1732('0x23')]]={};this[_0x1732('0xe')][_0x5572bc[_0x1732('0x23')]][_0x1732('0x24')]=_0x5572bc[_0x1732('0x24')];logger[_0x1732('0x26')](_0x5572bc[_0x1732('0x23')],_0x1732('0x27'));}};Fax[_0x1732('0x1d')][_0x1732('0x15')]=function(_0x6cefa2){if(this[_0x1732('0xe')][_0x6cefa2[_0x1732('0x23')]]){for(var _0x5b68d2 in _0x6cefa2[_0x1732('0x29')]){if(_0x6cefa2['variable'][_0x1732('0x20')](_0x5b68d2)){this[_0x1732('0xe')][_0x6cefa2[_0x1732('0x23')]][_0x5b68d2]=_0x6cefa2[_0x1732('0x2a')];}}}};Fax[_0x1732('0x1d')]['syncNewState']=function(_0x377a04){if(this[_0x1732('0xe')][_0x377a04[_0x1732('0x23')]]){this[_0x1732('0xe')][_0x377a04[_0x1732('0x23')]][_0x1732('0x2b')]=_0x377a04[_0x1732('0x2b')];this['channels'][_0x377a04[_0x1732('0x23')]][_0x1732('0x2c')]=_0x377a04[_0x1732('0x2c')];}};Fax[_0x1732('0x1d')]['syncNewExten']=function(_0x38fde2){if(this[_0x1732('0xe')][_0x38fde2['uniqueid']]){for(var _0x302c50 in _0x38fde2[_0x1732('0x29')]){if(_0x38fde2[_0x1732('0x29')][_0x1732('0x20')](_0x302c50)){this['channels'][_0x38fde2[_0x1732('0x23')]][_0x302c50]=_0x38fde2[_0x1732('0x2a')];}}}};Fax[_0x1732('0x1d')][_0x1732('0x2d')]=function(_0x424e82){if(this[_0x1732('0xe')][_0x424e82[_0x1732('0x23')]]){this[_0x1732('0xe')][_0x424e82[_0x1732('0x23')]]['operation']=_0x424e82[_0x1732('0x2e')];this[_0x1732('0xe')][_0x424e82[_0x1732('0x23')]][_0x1732('0x2f')]=_0x424e82[_0x1732('0x2f')];this['channels'][_0x424e82[_0x1732('0x23')]][_0x1732('0x22')]=_0x424e82['localstationid'];this[_0x1732('0xe')][_0x424e82['uniqueid']][_0x1732('0x30')]=_0x424e82[_0x1732('0x30')];logger[_0x1732('0x26')](_0x424e82[_0x1732('0x23')],_0x1732('0x31'));}};Fax['prototype'][_0x1732('0x1a')]=function(_0x2d07fd){var _0x419b13=this;if(this['channels'][_0x2d07fd[_0x1732('0x23')]]){var _0x55cae9=this['channels'][_0x2d07fd[_0x1732('0x23')]]['id'];this[_0x1732('0xe')][_0x2d07fd[_0x1732('0x23')]]['remotestationid']=_0x2d07fd[_0x1732('0x32')];this[_0x1732('0xe')][_0x2d07fd[_0x1732('0x23')]][_0x1732('0x33')]=_0x2d07fd[_0x1732('0x33')];this[_0x1732('0xe')][_0x2d07fd['uniqueid']]['localstationid']=_0x2d07fd[_0x1732('0x22')];this[_0x1732('0xe')][_0x2d07fd[_0x1732('0x23')]]['resolution']=_0x2d07fd[_0x1732('0x34')];this[_0x1732('0xe')][_0x2d07fd['uniqueid']][_0x1732('0x35')]=_0x2d07fd[_0x1732('0x35')];this[_0x1732('0xe')][_0x2d07fd['uniqueid']][_0x1732('0x30')]=_0x2d07fd[_0x1732('0x30')];this[_0x1732('0xe')][_0x2d07fd[_0x1732('0x23')]][_0x1732('0x36')]=_0x2d07fd[_0x1732('0x36')];if(this['channels'][_0x2d07fd[_0x1732('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x2d07fd[_0x1732('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x515e8a){logger['info'](_0x2d07fd['uniqueid'],_0x1732('0x37'),_0x515e8a[_0x1732('0x38')]);attachment[_0x1732('0x39')]({'name':path['parse'](_0x2d07fd[_0x1732('0x30')])[_0x1732('0x25')],'basename':path[_0x1732('0x3a')](_0x2d07fd[_0x1732('0x30')])['name']+_0x1732('0x3b'),'type':_0x1732('0x3c')})[_0x1732('0x3d')](function(_0x426b29){faxAccount[_0x1732('0x3e')](_0x55cae9,{'from':_0x2d07fd['calleridnum'],'mapKey':_0x1732('0x3f'),'body':path['parse'](_0x2d07fd[_0x1732('0x30')])[_0x1732('0x25')]+_0x1732('0x3b'),'AttachmentId':_0x426b29['id']})[_0x1732('0x40')](function(_0x4c0467){logger[_0x1732('0x41')](_0x2d07fd[_0x1732('0x23')],'\x20notify\x20',JSON['stringify'](_0x4c0467));});})['catch'](function(_0x8fd764){logger['error'](_0x2d07fd[_0x1732('0x23')],_0x1732('0x42'),JSON['stringify'](_0x8fd764));});});}logger['info'](_0x2d07fd[_0x1732('0x23')],_0x1732('0x42'));}};Fax[_0x1732('0x1d')]['syncOriginateResponse']=function(_0x1f0146){if(this[_0x1732('0x28')][_0x1f0146[_0x1732('0x23')]]){_[_0x1732('0x43')](this[_0x1732('0xe')][_0x1f0146[_0x1732('0x23')]],_[_0x1732('0x44')](_0x1f0146,[_0x1732('0x45'),_0x1732('0x46')]));}};function updateStatus(_0x4a3158){if(_0x4a3158['AttachmentId']){faxMessage['update'](_0x4a3158['AttachmentId'],{'failMessage':_0x1732('0x47')})[_0x1732('0x3d')](function(_0x285dd1){ut[_0x1732('0x48')]('[Fax][Message][Error][Updated]',_0x285dd1);})[_0x1732('0x40')](function(_0x32b0f1){ut[_0x1732('0x48')](_0x1732('0x49'),_0x32b0f1);});}else{ut[_0x1732('0x48')](_0x1732('0x4a'));}}Fax[_0x1732('0x1d')][_0x1732('0x4b')]=function(_0x3d77b6,_0x511abe,_0x36f80b){var _0x15e70a=this;var _0x476ac1={};if(_0x511abe){_0x476ac1={'read':_0x511abe};}else{_0x476ac1={'failMessage':_0x36f80b};}if(this[_0x1732('0x28')][_0x3d77b6][_0x1732('0x4c')]){faxMessage['update'](this['actions'][_0x3d77b6][_0x1732('0x4c')],_0x476ac1)[_0x1732('0x3d')](function(_0x1077c9){ut['logger'](_0x1732('0x4d'),_0x1077c9);})[_0x1732('0x40')](function(_0x121484){ut[_0x1732('0x48')](_0x1732('0x4e'),_0x121484);})[_0x1732('0x4f')](function(){delete _0x15e70a[_0x1732('0xe')][_0x3d77b6];delete _0x15e70a[_0x1732('0x28')][_0x3d77b6];});}else{ut[_0x1732('0x48')](_0x1732('0x50'));delete this[_0x1732('0xe')][_0x3d77b6];delete this['actions'][_0x3d77b6];}};Fax[_0x1732('0x1d')]['syncHangup']=function(_0x132be6){var _0x1f748c=this;if(this[_0x1732('0xe')][_0x132be6['uniqueid']]){if(this['actions'][_0x132be6[_0x1732('0x23')]]){this[_0x1732('0xe')][_0x132be6[_0x1732('0x23')]]['id']=this[_0x1732('0x28')][_0x132be6[_0x1732('0x23')]]['id'];this['channels'][_0x132be6[_0x1732('0x23')]][_0x1732('0x25')]=this[_0x1732('0x28')][_0x132be6[_0x1732('0x23')]][_0x1732('0x25')];}logger['info'](_0x132be6[_0x1732('0x23')],this['actions'][_0x132be6['uniqueid']]?_0x1732('0x51'):'\x20hangup\x20faxRiceive\x20',JSON[_0x1732('0x52')](this[_0x1732('0xe')][_0x132be6[_0x1732('0x23')]]));if(this[_0x1732('0x28')][_0x132be6[_0x1732('0x23')]]){if(this[_0x1732('0xe')][_0x132be6[_0x1732('0x23')]][_0x1732('0x53')]>0x0&&this[_0x1732('0xe')][_0x132be6[_0x1732('0x23')]][_0x1732('0x54')]===_0x1732('0x55')){this['updateStatus'](_0x132be6[_0x1732('0x23')],!![]);}else{this[_0x1732('0x4b')](_0x132be6[_0x1732('0x23')],![],this[_0x1732('0xe')][_0x132be6[_0x1732('0x23')]][_0x1732('0x56')]?_0x1732('0x57')+this['channels'][_0x132be6[_0x1732('0x23')]][_0x1732('0x56')]:'SENDING\x20FAILED');}}}};Fax[_0x1732('0x1d')]['send']=function(_0x4b5614){var _0x2b2416=this;return new BPromise(function(_0x2c2241,_0x1d6f49){_0x2b2416['execOriginate'](_0x4b5614,_0x2b2416['faxAccounts'][_0x4b5614['FaxAccountId']])['then'](function(_0x2c9b48){ut[_0x1732('0x48')](_0x1732('0x58'),_0x2c9b48);_0x2c2241(ut[_0x1732('0x38')](_0x1732('0x59')));})[_0x1732('0x40')](function(_0x22b179){ut['logger']('[Fax][execOriginate][failure]',_0x22b179);updateStatus(_0x4b5614);_0x1d6f49(ut['message'](_0x1732('0x5a')));});});};Fax[_0x1732('0x1d')][_0x1732('0x5b')]=function(_0x7095a4){var _0x9e548=this;return new BPromise(function(_0x4bb77e,_0x5b0c35){var _0xb07ac9=_0x9e548[_0x1732('0x5c')](_0x9e548['faxAccounts'][_0x7095a4['FaxAccountId']][_0x1732('0x5d')],_0x7095a4);if(_0xb07ac9[_0x1732('0x5e')]){_0x4bb77e(ut[_0x1732('0x38')]('Trunk\x20Reachable'));}else{_0x5b0c35(ut[_0x1732('0x38')](_0xb07ac9['message']));}});};function originate(_0x1bd093,_0x3369c1,_0x47bdef){return new BPromise(function(_0x5e679f,_0x5c5f72){if(_0x47bdef){var _0x3bde72=util[_0x1732('0x5f')](_0x1732('0x60'),path[_0x1732('0x3a')](_0x1bd093[_0x1732('0x4')])[_0x1732('0x25')],_0x1bd093['path']);gs[_0x1732('0x61')](_0x3bde72)[_0x1732('0x3d')](function(){_0x1bd093['path']=util[_0x1732('0x5f')](_0x1732('0x62'),path[_0x1732('0x3a')](_0x1bd093[_0x1732('0x4')])['dir'],path[_0x1732('0x3a')](_0x1bd093[_0x1732('0x4')])[_0x1732('0x25')]);_0x3369c1[_0x1732('0x63')]=_0x1bd093[_0x1732('0x4')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x1732('0x64')](ut[_0x1732('0x65')](_0x1bd093,_0x3369c1))[_0x1732('0x3d')](function(_0x802a5c){_0x5e679f(_0x802a5c);})[_0x1732('0x40')](function(_0x2814f9){_0x5c5f72(_0x2814f9);});})[_0x1732('0x40')](function(_0xba32d4){_0x5c5f72(_0xba32d4);});}else{ami[_0x1732('0x64')](ut['variablesAction'](_0x1bd093,_0x3369c1))[_0x1732('0x3d')](function(_0xd9eb65){_0x5e679f(_0xd9eb65);})[_0x1732('0x40')](function(_0x397328){_0x5c5f72(_0x397328);});}});}Fax[_0x1732('0x1d')][_0x1732('0x66')]=function(_0x381909,_0x593a19){var _0x293060=this;return new BPromise(function(_0x19ff08,_0x2da8f){var _0x156630=uuid['v4']();var _0x2c98a5=ut[_0x1732('0x67')](_0x381909,_0x593a19);_0x293060['actions'][_0x156630]=new Action(_0x156630,_0x593a19,_0x381909);var _0x2b155f=_0x293060[_0x1732('0x28')][_0x156630];if(path[_0x1732('0x3a')](_0x381909[_0x1732('0x4')])[_0x1732('0x68')]===_0x1732('0x3b')){originate(_0x2b155f,_0x2c98a5,!![])[_0x1732('0x3d')](function(_0x3b89d9){_0x19ff08(_0x3b89d9);})[_0x1732('0x40')](function(_0x55a6fe){_0x2da8f(_0x55a6fe);});}else{originate(_0x2b155f,_0x2c98a5,![])['then'](function(_0x2c665b){_0x19ff08(_0x2c665b);})['catch'](function(_0x468e21){_0x2da8f(_0x468e21);});}});};Fax[_0x1732('0x1d')]['isTrunkReachable']=function(_0x2009c9){return!_[_0x1732('0x69')](_0x2009c9)&&!_['isNil'](_0x2009c9['name'])&&!_[_0x1732('0x69')](_0x2009c9[_0x1732('0x6a')])&&_0x2009c9[_0x1732('0x6a')]&&!_[_0x1732('0x69')](this[_0x1732('0x10')][util[_0x1732('0x5f')](_0x1732('0x6b'),_0x2009c9[_0x1732('0x25')])])&&!_[_0x1732('0x69')](this['trunks'][util['format'](_0x1732('0x6b'),_0x2009c9[_0x1732('0x25')])][_0x1732('0x2f')])&&(this[_0x1732('0x10')][util[_0x1732('0x5f')](_0x1732('0x6b'),_0x2009c9[_0x1732('0x25')])][_0x1732('0x2f')]==='reachable'||this[_0x1732('0x10')][util['format']('SIP/%s',_0x2009c9[_0x1732('0x25')])][_0x1732('0x2f')]===_0x1732('0x6c'));};Fax[_0x1732('0x1d')]['checkTrunk']=function(_0x1d0184,_0x54c653){if(!this[_0x1732('0x6d')](_0x1d0184)){ut['logger'](_0x1732('0x6e'),_[_0x1732('0x69')](_0x1d0184)?'':_0x1d0184[_0x1732('0x25')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x1732('0x6f')};}if(_[_0x1732('0x69')](_0x54c653[_0x1732('0x3f')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x54c653));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x1732('0x69')](_0x54c653[_0x1732('0x4')])){ut[_0x1732('0x48')](_0x1732('0x70'),JSON[_0x1732('0x52')](_0x54c653));return{'isValid':![],'message':_0x1732('0x71')};}return{'isValid':!![],'message':_0x1732('0x72')};};module[_0x1732('0x73')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index bea3376..fcf10fb 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 _0xb61a=['catch','[Notify]\x20','bluebird','../../../config/logger','preview','error','inspect','notify','resolve'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xb61a,0x1f1));var _0xab61=function(_0x3296e6,_0x5aa944){_0x3296e6=_0x3296e6-0x0;var _0x4d4dc8=_0xb61a[_0x3296e6];return _0x4d4dc8;};'use strict';var util=require('util');var BPromise=require(_0xab61('0x0'));var logger=require(_0xab61('0x1'))(_0xab61('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x373c48){return function(_0x26cb9f){logger[_0xab61('0x3')](_0x373c48,util[_0xab61('0x4')](_0x26cb9f,{'showHidden':![],'depth':null}));};}exports[_0xab61('0x5')]=function(_0x3e10d8,_0x465ea1){return BPromise[_0xab61('0x6')]()['then'](faxAccount[_0xab61('0x5')](_0x3e10d8,_0x465ea1))[_0xab61('0x7')](loggerCatch(_0xab61('0x8')));}; \ No newline at end of file +var _0xdbe2=['inspect','notify','then','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount'];(function(_0x56aa25,_0x4f44ea){var _0x4ab23b=function(_0x92ac21){while(--_0x92ac21){_0x56aa25['push'](_0x56aa25['shift']());}};_0x4ab23b(++_0x4f44ea);}(_0xdbe2,0x1e0));var _0x2dbe=function(_0x31d6c2,_0x422dcd){_0x31d6c2=_0x31d6c2-0x0;var _0x295dd0=_0xdbe2[_0x31d6c2];return _0x295dd0;};'use strict';var util=require(_0x2dbe('0x0'));var BPromise=require(_0x2dbe('0x1'));var logger=require(_0x2dbe('0x2'))(_0x2dbe('0x3'));var _=require(_0x2dbe('0x4'));var faxAccount=require(_0x2dbe('0x5'));function loggerCatch(_0x3a630b){return function(_0x36e3c5){logger['error'](_0x3a630b,util[_0x2dbe('0x6')](_0x36e3c5,{'showHidden':![],'depth':null}));};}exports[_0x2dbe('0x7')]=function(_0x17c899,_0x36d8a1){return BPromise['resolve']()[_0x2dbe('0x8')](faxAccount[_0x2dbe('0x7')](_0x17c899,_0x36d8a1))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 3801240..29bc88c 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 _0xa6c6=['bluebird','child_process','exec','info','\x20Error\x20:','inspect'];(function(_0x566c5a,_0x42e09c){var _0x3c4abe=function(_0x2489a0){while(--_0x2489a0){_0x566c5a['push'](_0x566c5a['shift']());}};_0x3c4abe(++_0x42e09c);}(_0xa6c6,0x138));var _0x6a6c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa6c6[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x6a6c('0x0'));var exec=require(_0x6a6c('0x1'))[_0x6a6c('0x2')];exports['execute']=function(_0xc10562){return new BPromise(function(_0x79f5f7,_0x78bcae){exec(_0xc10562,function(_0x2a4723,_0x505ea8,_0x28d1d2){logger[_0x6a6c('0x3')]('Exec\x20gs',_0x505ea8);if(_0x2a4723){logger[_0x6a6c('0x3')]('Exec\x20gs',_0x6a6c('0x4'),util[_0x6a6c('0x5')](_0x2a4723,{'showHidden':![],'depth':null}),_0x505ea8,_0x28d1d2);_0x78bcae(_0x2a4723);}_0x79f5f7(_0x505ea8);});});}; \ No newline at end of file +var _0xa836=['inspect','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0xa836,0x1e1));var _0x6a83=function(_0x3ae816,_0x576dc9){_0x3ae816=_0x3ae816-0x0;var _0x56974d=_0xa836[_0x3ae816];return _0x56974d;};'use strict';var util=require('util');var logger=require(_0x6a83('0x0'))(_0x6a83('0x1'));var BPromise=require(_0x6a83('0x2'));var exec=require(_0x6a83('0x3'))[_0x6a83('0x4')];exports[_0x6a83('0x5')]=function(_0x3bf48d){return new BPromise(function(_0x3100d3,_0x2985d8){exec(_0x3bf48d,function(_0x17f2dc,_0x2e8d73,_0x4c71d1){logger[_0x6a83('0x6')](_0x6a83('0x7'),_0x2e8d73);if(_0x17f2dc){logger[_0x6a83('0x6')](_0x6a83('0x7'),_0x6a83('0x8'),util[_0x6a83('0x9')](_0x17f2dc,{'showHidden':![],'depth':null}),_0x2e8d73,_0x4c71d1);_0x2985d8(_0x17f2dc);}_0x3100d3(_0x2e8d73);});});}; \ 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 e64b701..0e95f62 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 _0x3f11=['localstationid','util','lodash','../../../../config/logger','fax','message','logger','info','inspect','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','path','uniqueid','originate','from-sip'];(function(_0x59e643,_0x30da39){var _0x188357=function(_0x1dd127){while(--_0x1dd127){_0x59e643['push'](_0x59e643['shift']());}};_0x188357(++_0x30da39);}(_0x3f11,0x1a5));var _0x13f1=function(_0x55bc6c,_0x1f7ab1){_0x55bc6c=_0x55bc6c-0x0;var _0x5300ec=_0x3f11[_0x55bc6c];return _0x5300ec;};'use strict';var util=require(_0x13f1('0x0'));var _=require(_0x13f1('0x1'));var moment=require('moment');var logger=require(_0x13f1('0x2'))(_0x13f1('0x3'));exports[_0x13f1('0x4')]=function(_0x3d817a){return{'message':_0x3d817a};};exports[_0x13f1('0x5')]=function(_0xd0d33,_0x494357){logger[_0x13f1('0x6')](_0xd0d33,util[_0x13f1('0x7')](_0x494357,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x56aa7b,_0x1606c2){var _0x19cb86={'XMF-ECM':_0x1606c2['ecm'],'XMF-HEADERINFO':_0x1606c2[_0x13f1('0x8')],'XMF-MINRATE':_0x1606c2[_0x13f1('0x9')],'XMF-MAXRATE':_0x1606c2[_0x13f1('0xa')],'XMF-MODEM':util[_0x13f1('0xb')](_0x13f1('0xc'),_0x1606c2[_0x13f1('0xd')]),'XMF-GATEWAY':_0x1606c2['gateway'],'XMF-FAXDETECT':_0x1606c2[_0x13f1('0xe')],'XMF-T38TIMEOUT':_0x1606c2[_0x13f1('0xf')],'XMF-LOCALSTATIONID':_0x1606c2['localstationid'],'XMF-PATH':_0x56aa7b[_0x13f1('0x10')]};return _0x19cb86;};exports['variablesAction']=function(_0x42f612,_0x4369c8){return{'actionid':_0x42f612[_0x13f1('0x11')],'action':_0x13f1('0x12'),'channel':_0x42f612['channel'],'Exten':'xcally-motion-fax','Context':_0x13f1('0x13'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x42f612['headerinfo']?_0x42f612[_0x13f1('0x8')]:'',_0x42f612[_0x13f1('0x14')]),'variable':_0x4369c8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x42f612[_0x13f1('0x11')]};}; \ No newline at end of file +var _0xc2e8=['localstationid','path','variablesAction','uniqueid','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','util','lodash','moment','fax','message','logger','inspect','addVariables','ecm','minrate','format','modem','gateway','t38timeout'];(function(_0x53c7a0,_0x41ece0){var _0x150d96=function(_0x1ba987){while(--_0x1ba987){_0x53c7a0['push'](_0x53c7a0['shift']());}};_0x150d96(++_0x41ece0);}(_0xc2e8,0x1c0));var _0x8c2e=function(_0x4f39bd,_0x376303){_0x4f39bd=_0x4f39bd-0x0;var _0x2334ac=_0xc2e8[_0x4f39bd];return _0x2334ac;};'use strict';var util=require(_0x8c2e('0x0'));var _=require(_0x8c2e('0x1'));var moment=require(_0x8c2e('0x2'));var logger=require('../../../../config/logger')(_0x8c2e('0x3'));exports[_0x8c2e('0x4')]=function(_0x3308f1){return{'message':_0x3308f1};};exports[_0x8c2e('0x5')]=function(_0x5d375e,_0x2a2d29){logger['info'](_0x5d375e,util[_0x8c2e('0x6')](_0x2a2d29,{'showHidden':![],'depth':null}));};exports[_0x8c2e('0x7')]=function(_0x28145c,_0x5df44c){var _0x2c06b6={'XMF-ECM':_0x5df44c[_0x8c2e('0x8')],'XMF-HEADERINFO':_0x5df44c['headerinfo'],'XMF-MINRATE':_0x5df44c[_0x8c2e('0x9')],'XMF-MAXRATE':_0x5df44c['maxrate'],'XMF-MODEM':util[_0x8c2e('0xa')]('\x22%s\x22',_0x5df44c[_0x8c2e('0xb')]),'XMF-GATEWAY':_0x5df44c[_0x8c2e('0xc')],'XMF-FAXDETECT':_0x5df44c['faxdetect'],'XMF-T38TIMEOUT':_0x5df44c[_0x8c2e('0xd')],'XMF-LOCALSTATIONID':_0x5df44c[_0x8c2e('0xe')],'XMF-PATH':_0x28145c[_0x8c2e('0xf')]};return _0x2c06b6;};exports[_0x8c2e('0x10')]=function(_0x47d2bc,_0x268ebd){return{'actionid':_0x47d2bc[_0x8c2e('0x11')],'action':'originate','channel':_0x47d2bc['channel'],'Exten':_0x8c2e('0x12'),'Context':_0x8c2e('0x13'),'Priority':'1','callerid':util[_0x8c2e('0xa')](_0x8c2e('0x14'),_0x47d2bc['headerinfo']?_0x47d2bc[_0x8c2e('0x15')]:'',_0x47d2bc[_0x8c2e('0xe')]),'variable':_0x268ebd,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x47d2bc[_0x8c2e('0x11')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 6ccbc7e..5c9d579 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 _0x238a=['./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','moment','./server','./report','./acw','./trigger','./dialer','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger'];(function(_0x172036,_0x5a7619){var _0x19d18c=function(_0x3f27a8){while(--_0x3f27a8){_0x172036['push'](_0x172036['shift']());}};_0x19d18c(++_0x5a7619);}(_0x238a,0xba));var _0xa238=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0x238a[_0x5eaa0b];return _0x28b295;};'use strict';var util=require('util');var moment=require(_0xa238('0x0'));var server=require(_0xa238('0x1'));var Realtime=require('./realtime');var Report=require(_0xa238('0x2'));var Acw=require(_0xa238('0x3'));var Trigger=require(_0xa238('0x4'));var Dialer=require(_0xa238('0x5'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0xa238('0x6'));var voiceQueue=require(_0xa238('0x7'));var voiceQueueReport=require(_0xa238('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xa238('0x9'));var trigger=require(_0xa238('0xa'));var template=require(_0xa238('0xb'));var cmHopperHistory=require(_0xa238('0xc'));var campaign=require(_0xa238('0xd'));var voiceExtension=require(_0xa238('0xe'));var faxAccount=require(_0xa238('0xf'));var zendesk=require(_0xa238('0x10'));var salesforce=require(_0xa238('0x11'));var sugarcrm=require(_0xa238('0x12'));var freshdesk=require(_0xa238('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xa238('0x14'));var freshsales=require(_0xa238('0x15'));var servicenow=require(_0xa238('0x16'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xa238('0x17'))(_0xa238('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xa238('0x19')](_0xa238('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xa238('0x1b')]()[_0xa238('0x1c')](user[_0xa238('0x1d')]())['then'](realtime[_0xa238('0x1e')]())[_0xa238('0x1c')](user[_0xa238('0x1f')]())['then'](realtime[_0xa238('0x20')]())[_0xa238('0x1c')](trunk[_0xa238('0x21')]())[_0xa238('0x1c')](realtime[_0xa238('0x22')]())['then'](voiceQueue[_0xa238('0x23')]())[_0xa238('0x1c')](realtime[_0xa238('0x24')]())['then'](trigger['getTriggers']())[_0xa238('0x1c')](realtime[_0xa238('0x25')]())['then'](template[_0xa238('0x26')]())[_0xa238('0x1c')](realtime['initTemplates']())[_0xa238('0x1c')](zendesk['getZendeskAccounts']())[_0xa238('0x1c')](realtime[_0xa238('0x27')]())[_0xa238('0x1c')](salesforce['getSalesforceAccounts']())[_0xa238('0x1c')](realtime['initSalesforceAccounts']())[_0xa238('0x1c')](sugarcrm[_0xa238('0x28')]())[_0xa238('0x1c')](realtime[_0xa238('0x29')]())[_0xa238('0x1c')](freshdesk['getFreshdeskAccounts']())[_0xa238('0x1c')](realtime['initFreshdeskAccounts']())[_0xa238('0x1c')](desk[_0xa238('0x2a')]())[_0xa238('0x1c')](realtime[_0xa238('0x2b')]())['then'](zoho['getZohoAccounts']())['then'](realtime['initZohoAccounts']())[_0xa238('0x1c')](vtiger[_0xa238('0x2c')]())[_0xa238('0x1c')](realtime[_0xa238('0x2d')]())[_0xa238('0x1c')](freshsales[_0xa238('0x2e')]())[_0xa238('0x1c')](realtime['initFreshsalesAccounts']())[_0xa238('0x1c')](servicenow[_0xa238('0x2f')]())[_0xa238('0x1c')](realtime[_0xa238('0x30')]())[_0xa238('0x1c')](dynamics365[_0xa238('0x31')]())['then'](realtime[_0xa238('0x32')]())[_0xa238('0x1c')](campaign['getCampaigns']())['then'](realtime[_0xa238('0x33')]())['then'](voiceExtension[_0xa238('0x34')]())['then'](realtime[_0xa238('0x35')]())['then'](faxAccount[_0xa238('0x36')]())[_0xa238('0x1c')](realtime[_0xa238('0x37')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0xa238('0x1b')]()[_0xa238('0x1c')](voiceQueueReport[_0xa238('0x38')]())[_0xa238('0x1c')](realtime[_0xa238('0x39')]())['then'](cmHopperHistory[_0xa238('0x3a')]())[_0xa238('0x1c')](realtime[_0xa238('0x3b')]())[_0xa238('0x1c')](cmHopperHistory[_0xa238('0x3c')]())['then'](realtime[_0xa238('0x3d')]())['then'](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0xa238('0x3e')]())[_0xa238('0x3f')](function(_0x100c73){logger[_0xa238('0x40')](_0xa238('0x41'),util[_0xa238('0x42')](_0x100c73,{'showHidden':![],'depth':null}));});}function main(){return server[_0xa238('0x43')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0xa238('0x1c')](function(){return initParams();})[_0xa238('0x1c')](function(){report[_0xa238('0x44')]();setInterval(initRealtime,0x1388);})[_0xa238('0x3f')](function(_0xa3577){logger['error']('[index.js][main]',util[_0xa238('0x42')](_0xa3577,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xe328=['initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','[index.js][initParams]','listen','catch','error','[index.js][main]','inspect','util','moment','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getTelephones','getVoiceQueues'];(function(_0x100338,_0x5cdbcc){var _0x330d32=function(_0x50c3dc){while(--_0x50c3dc){_0x100338['push'](_0x100338['shift']());}};_0x330d32(++_0x5cdbcc);}(_0xe328,0x145));var _0x8e32=function(_0xd5e296,_0x4cd945){_0xd5e296=_0xd5e296-0x0;var _0x2a4363=_0xe328[_0xd5e296];return _0x2a4363;};'use strict';var util=require(_0x8e32('0x0'));var moment=require(_0x8e32('0x1'));var server=require(_0x8e32('0x2'));var Realtime=require(_0x8e32('0x3'));var Report=require(_0x8e32('0x4'));var Acw=require(_0x8e32('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x8e32('0x6'));var Preview=require(_0x8e32('0x7'));var Fax=require(_0x8e32('0x8'));var user=require(_0x8e32('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x8e32('0xa'));var voiceCallReport=require(_0x8e32('0xb'));var trunk=require(_0x8e32('0xc'));var trigger=require(_0x8e32('0xd'));var template=require(_0x8e32('0xe'));var cmHopperHistory=require(_0x8e32('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x8e32('0x10'));var faxAccount=require(_0x8e32('0x11'));var zendesk=require(_0x8e32('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x8e32('0x13'));var freshdesk=require(_0x8e32('0x14'));var desk=require(_0x8e32('0x15'));var zoho=require(_0x8e32('0x16'));var vtiger=require(_0x8e32('0x17'));var freshsales=require(_0x8e32('0x18'));var servicenow=require(_0x8e32('0x19'));var dynamics365=require(_0x8e32('0x1a'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x8e32('0x1b'))(_0x8e32('0x1c'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8e32('0x1d')](_0x8e32('0x1e'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x8e32('0x1f')]()['then'](user['getAgents']())[_0x8e32('0x20')](realtime['initAgents']())['then'](user[_0x8e32('0x21')]())['then'](realtime['initTelephones']())['then'](trunk['getTrunks']())[_0x8e32('0x20')](realtime['initTrunks']())[_0x8e32('0x20')](voiceQueue[_0x8e32('0x22')]())[_0x8e32('0x20')](realtime[_0x8e32('0x23')]())[_0x8e32('0x20')](trigger[_0x8e32('0x24')]())[_0x8e32('0x20')](realtime[_0x8e32('0x25')]())[_0x8e32('0x20')](template[_0x8e32('0x26')]())['then'](realtime[_0x8e32('0x27')]())[_0x8e32('0x20')](zendesk[_0x8e32('0x28')]())[_0x8e32('0x20')](realtime['initZendeskAccounts']())[_0x8e32('0x20')](salesforce[_0x8e32('0x29')]())[_0x8e32('0x20')](realtime[_0x8e32('0x2a')]())[_0x8e32('0x20')](sugarcrm[_0x8e32('0x2b')]())['then'](realtime['initSugarcrmAccounts']())[_0x8e32('0x20')](freshdesk[_0x8e32('0x2c')]())[_0x8e32('0x20')](realtime[_0x8e32('0x2d')]())[_0x8e32('0x20')](desk[_0x8e32('0x2e')]())['then'](realtime[_0x8e32('0x2f')]())['then'](zoho['getZohoAccounts']())['then'](realtime[_0x8e32('0x30')]())[_0x8e32('0x20')](vtiger[_0x8e32('0x31')]())[_0x8e32('0x20')](realtime[_0x8e32('0x32')]())[_0x8e32('0x20')](freshsales['getFreshsalesAccounts']())[_0x8e32('0x20')](realtime[_0x8e32('0x33')]())[_0x8e32('0x20')](servicenow['getServicenowAccounts']())[_0x8e32('0x20')](realtime[_0x8e32('0x34')]())[_0x8e32('0x20')](dynamics365[_0x8e32('0x35')]())[_0x8e32('0x20')](realtime[_0x8e32('0x36')]())[_0x8e32('0x20')](campaign['getCampaigns']())[_0x8e32('0x20')](realtime[_0x8e32('0x37')]())[_0x8e32('0x20')](voiceExtension[_0x8e32('0x38')]())[_0x8e32('0x20')](realtime['initVoiceExtensions']())[_0x8e32('0x20')](faxAccount[_0x8e32('0x39')]())[_0x8e32('0x20')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return Promise['resolve']()['then'](voiceQueueReport[_0x8e32('0x3a')]())[_0x8e32('0x20')](realtime[_0x8e32('0x3b')]())[_0x8e32('0x20')](cmHopperHistory[_0x8e32('0x3c')]())['then'](realtime[_0x8e32('0x3d')]())[_0x8e32('0x20')](cmHopperHistory[_0x8e32('0x3e')]())[_0x8e32('0x20')](realtime[_0x8e32('0x3f')]())[_0x8e32('0x20')](voiceCallReport[_0x8e32('0x40')]())[_0x8e32('0x20')](realtime[_0x8e32('0x41')]())['catch'](function(_0x1cf927){logger['error'](_0x8e32('0x42'),util['inspect'](_0x1cf927,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8e32('0x43')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x8e32('0x20')](function(){return initParams();})[_0x8e32('0x20')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x8e32('0x44')](function(_0x3ac084){logger[_0x8e32('0x45')](_0x8e32('0x46'),util[_0x8e32('0x47')](_0x3ac084,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 43dfac8..849f1ba 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 _0xea70=['not_inuse','talking','statePause','toNumber','format','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','user:%s','emit','user:ami:update','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','local','prototype','updateStatusRealtime','toLowerCase'];(function(_0x3a8789,_0x5bb70b){var _0x19e422=function(_0x49d386){while(--_0x49d386){_0x3a8789['push'](_0x3a8789['shift']());}};_0x19e422(++_0x5bb70b);}(_0xea70,0x175));var _0x0ea7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xea70[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x0ea7('0x0'));var util=require(_0x0ea7('0x1'));var moment=require(_0x0ea7('0x2'));var Redis=require('ioredis');var config=require(_0x0ea7('0x3'));config['redis']=_[_0x0ea7('0x4')](config['redis'],{'host':_0x0ea7('0x5'),'port':0x18eb});var io=require(_0x0ea7('0x6'))(new Redis(config[_0x0ea7('0x7')]));function Agent(_0x221ac8){this['id']=_0x221ac8['id']||0x0;this[_0x0ea7('0x8')]=_0x221ac8['name']||'';this[_0x0ea7('0x9')]=_0x221ac8[_0x0ea7('0x9')]||'';this['accountcode']=_0x221ac8[_0x0ea7('0xa')]||'';this[_0x0ea7('0xb')]=_0x221ac8['fullname']||'';this[_0x0ea7('0xc')]=_0x0ea7('0xd');this[_0x0ea7('0xe')]=0x0;this[_0x0ea7('0xf')]='unknown';this[_0x0ea7('0x10')]='';this[_0x0ea7('0x11')]='';this[_0x0ea7('0x12')]='';this[_0x0ea7('0x13')]='';this[_0x0ea7('0x14')]=_0x221ac8['online']||![];this[_0x0ea7('0x15')]=_0x0ea7('0xd');this[_0x0ea7('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x0ea7('0x17')]=![];}Agent[_0x0ea7('0x18')][_0x0ea7('0x19')]=function(_0x2cd543){if(!_0x2cd543['state']){return;}var _0x488067=null;var _0x48044a=_0x2cd543[_0x0ea7('0xc')][_0x0ea7('0x1a')]();switch(_0x48044a){case _0x0ea7('0x1b'):_0x48044a='idle';break;case'inuse':_0x48044a=_0x0ea7('0x1c');break;}if(this[_0x0ea7('0x15')]!==_0x48044a||_0x2cd543[_0x0ea7('0x1d')]){_0x488067=_[_0x0ea7('0x1e')](moment()[_0x0ea7('0x1f')]('x'));}var _0x987032={'id':this['id'],'name':this[_0x0ea7('0x8')],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0x0ea7('0xb')],'state':this[_0x0ea7('0xc')],'stateTime':this['stateTime'],'status':this[_0x0ea7('0xf')],'address':this[_0x0ea7('0x10')],'voiceStatus':_0x48044a||this[_0x0ea7('0x15')],'voiceStatusTime':_0x488067||this[_0x0ea7('0x16')],'voiceStatusCallerIdNumber':this[_0x0ea7('0x20')],'voiceStatusQueue':this[_0x0ea7('0x21')],'interface':this['interface'],'onhold':this[_0x0ea7('0x22')]};if(this[_0x0ea7('0x15')]!==_0x48044a){this[_0x0ea7('0x15')]=_0x48044a;io['to'](util[_0x0ea7('0x1f')](_0x0ea7('0x23'),_0x987032[_0x0ea7('0x8')]))[_0x0ea7('0x24')](_0x0ea7('0x25'),_0x987032);io['emit'](_0x0ea7('0x26'),_0x987032);}};module[_0x0ea7('0x27')]=Agent; \ No newline at end of file +var _0x32ef=['local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','onhold','user:%s','emit','user:ami:update','exports','lodash','util','moment','ioredis','../../../config/environment','redis','localhost','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue'];(function(_0x2e33ee,_0x167303){var _0x15cd50=function(_0x6a25f5){while(--_0x6a25f5){_0x2e33ee['push'](_0x2e33ee['shift']());}};_0x15cd50(++_0x167303);}(_0x32ef,0xf9));var _0xf32e=function(_0x15de9c,_0x1a0b86){_0x15de9c=_0x15de9c-0x0;var _0x13e9ea=_0x32ef[_0x15de9c];return _0x13e9ea;};'use strict';var _=require(_0xf32e('0x0'));var util=require(_0xf32e('0x1'));var moment=require(_0xf32e('0x2'));var Redis=require(_0xf32e('0x3'));var config=require(_0xf32e('0x4'));config[_0xf32e('0x5')]=_['defaults'](config[_0xf32e('0x5')],{'host':_0xf32e('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf32e('0x5')]));function Agent(_0x23dcc1){this['id']=_0x23dcc1['id']||0x0;this[_0xf32e('0x7')]=_0x23dcc1[_0xf32e('0x7')]||'';this[_0xf32e('0x8')]=_0x23dcc1[_0xf32e('0x8')]||'';this['accountcode']=_0x23dcc1[_0xf32e('0x9')]||'';this['fullname']=_0x23dcc1[_0xf32e('0xa')]||'';this[_0xf32e('0xb')]=_0xf32e('0xc');this[_0xf32e('0xd')]=0x0;this[_0xf32e('0xe')]='unknown';this[_0xf32e('0xf')]='';this[_0xf32e('0x10')]='';this[_0xf32e('0x11')]='';this[_0xf32e('0x12')]='';this[_0xf32e('0x13')]=_0x23dcc1[_0xf32e('0x13')]||![];this[_0xf32e('0x14')]=_0xf32e('0xc');this[_0xf32e('0x15')]=0x0;this[_0xf32e('0x16')]='';this[_0xf32e('0x17')]='';this['onhold']=![];this[_0xf32e('0x18')]=![];}Agent[_0xf32e('0x19')][_0xf32e('0x1a')]=function(_0x336e26){if(!_0x336e26[_0xf32e('0xb')]){return;}var _0x458002=null;var _0x5c5ab7=_0x336e26[_0xf32e('0xb')][_0xf32e('0x1b')]();switch(_0x5c5ab7){case _0xf32e('0x1c'):_0x5c5ab7=_0xf32e('0x1d');break;case _0xf32e('0x1e'):_0x5c5ab7=_0xf32e('0x1f');break;}if(this[_0xf32e('0x14')]!==_0x5c5ab7||_0x336e26[_0xf32e('0x20')]){_0x458002=_[_0xf32e('0x21')](moment()['format']('x'));}var _0x3510ec={'id':this['id'],'name':this[_0xf32e('0x7')],'email':this[_0xf32e('0x8')],'accountcode':this[_0xf32e('0x9')],'fullname':this[_0xf32e('0xa')],'state':this[_0xf32e('0xb')],'stateTime':this[_0xf32e('0xd')],'status':this[_0xf32e('0xe')],'address':this[_0xf32e('0xf')],'voiceStatus':_0x5c5ab7||this[_0xf32e('0x14')],'voiceStatusTime':_0x458002||this[_0xf32e('0x15')],'voiceStatusCallerIdNumber':this[_0xf32e('0x16')],'voiceStatusQueue':this[_0xf32e('0x17')],'interface':this[_0xf32e('0x12')],'onhold':this[_0xf32e('0x22')]};if(this['voiceStatus']!==_0x5c5ab7){this[_0xf32e('0x14')]=_0x5c5ab7;io['to'](util['format'](_0xf32e('0x23'),_0x3510ec[_0xf32e('0x7')]))[_0xf32e('0x24')](_0xf32e('0x25'),_0x3510ec);io[_0xf32e('0x24')]('user:presence',_0x3510ec);}};module[_0xf32e('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 650fda5..8ac18e5 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 _0x49f6=['dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x44371f,_0x56bac3){var _0x3de047=function(_0x2d1978){while(--_0x2d1978){_0x44371f['push'](_0x44371f['shift']());}};_0x3de047(++_0x56bac3);}(_0x49f6,0xaf));var _0x649f=function(_0xb0c646,_0x518e15){_0xb0c646=_0xb0c646-0x0;var _0x3bf186=_0x49f6[_0xb0c646];return _0x3bf186;};'use strict';function Campaign(_0x133017){this['id']=_0x133017['id']||0x0;this[_0x649f('0x0')]=_0x133017['name']||'';this[_0x649f('0x1')]=_0x133017[_0x649f('0x1')]||_0x649f('0x2');this[_0x649f('0x3')]=0x0;this['temp']=0x0;this[_0x649f('0x4')]=0x0;this[_0x649f('0x5')]=0x0;this[_0x649f('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0x649f('0x7')]=_0x133017['active'];this[_0x649f('0x8')]=_0x133017['limitCalls'];this[_0x649f('0x9')]=_0x133017[_0x649f('0x9')]||null;this['dialGlobalInterval']=_0x133017[_0x649f('0xa')]?_0x133017[_0x649f('0xa')]:null;this[_0x649f('0xb')]=_0x133017[_0x649f('0xb')];this[_0x649f('0xc')]=_0x133017[_0x649f('0xc')];this[_0x649f('0xd')]=_0x133017[_0x649f('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x133017[_0x649f('0xe')];this[_0x649f('0xf')]=_0x133017['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x133017['dialBusyMaxRetry'];this[_0x649f('0x10')]=_0x133017[_0x649f('0x10')];this[_0x649f('0x11')]=_0x133017['dialNoAnswerMaxRetry'];this[_0x649f('0x12')]=_0x133017['dialNoAnswerRetryFrequency'];this[_0x649f('0x13')]=_0x133017['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x133017[_0x649f('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x133017[_0x649f('0x15')]||0x96;this[_0x649f('0x16')]=_0x133017['dialDropMaxRetry']||0x3;this[_0x649f('0x17')]=_0x133017[_0x649f('0x17')]||0x96;this[_0x649f('0x18')]=_0x133017[_0x649f('0x18')]||0x3;this[_0x649f('0x19')]=_0x133017[_0x649f('0x19')]||0x96;this[_0x649f('0x1a')]=_0x133017[_0x649f('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0x133017['dialMachineRetryFrequency']||0x96;this[_0x649f('0x1b')]=_0x133017[_0x649f('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x133017[_0x649f('0x1c')]||0x96;this[_0x649f('0x1d')]=_0x133017[_0x649f('0x1d')]||'DESC';this['dialPrefix']=_0x133017['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x133017[_0x649f('0x1e')]||undefined;this[_0x649f('0x1f')]=_0x133017[_0x649f('0x1f')]||undefined;this[_0x649f('0x20')]=_0x133017[_0x649f('0x20')]?_0x133017[_0x649f('0x20')]:undefined;this['Trunk']=_0x133017[_0x649f('0x21')]?_0x133017[_0x649f('0x21')]:undefined;this['Interval']=_0x133017[_0x649f('0x22')]?_0x133017['Interval']:undefined;this[_0x649f('0x23')]=_0x133017[_0x649f('0x23')]?_0x133017[_0x649f('0x23')]:undefined;this[_0x649f('0x24')]=_0x133017['SquareProject']?_0x133017[_0x649f('0x23')][_0x649f('0x0')]:undefined;this['dialAMDActive']=_0x133017['dialAMDActive']||![];this[_0x649f('0x25')]=_0x133017['dialAMDInitialSilence'];this[_0x649f('0x26')]=_0x133017[_0x649f('0x26')];this[_0x649f('0x27')]=_0x133017[_0x649f('0x27')];this[_0x649f('0x28')]=_0x133017[_0x649f('0x28')];this['dialAMDMinWordLength']=_0x133017[_0x649f('0x29')];this[_0x649f('0x2a')]=_0x133017[_0x649f('0x2a')];this[_0x649f('0x2b')]=_0x133017[_0x649f('0x2b')];this[_0x649f('0x2c')]=_0x133017[_0x649f('0x2c')];this[_0x649f('0x2d')]=_0x133017['dialAMDMaximumWordLength'];}module[_0x649f('0x2e')]=Campaign; \ No newline at end of file +var _0x4f33=['dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x4f33,0x11c));var _0x34f3=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0x4f33[_0x4f6d08];return _0x53a9c6;};'use strict';function Campaign(_0x3dad80){this['id']=_0x3dad80['id']||0x0;this[_0x34f3('0x0')]=_0x3dad80[_0x34f3('0x0')]||'';this[_0x34f3('0x1')]=_0x3dad80[_0x34f3('0x1')]||_0x34f3('0x2');this['originated']=0x0;this[_0x34f3('0x3')]=0x0;this[_0x34f3('0x4')]=0x0;this[_0x34f3('0x5')]=0x0;this[_0x34f3('0x6')]='';this[_0x34f3('0x7')]=!![];this['active']=_0x3dad80[_0x34f3('0x8')];this[_0x34f3('0x9')]=_0x3dad80['limitCalls'];this[_0x34f3('0xa')]=_0x3dad80[_0x34f3('0xa')]||null;this['dialGlobalInterval']=_0x3dad80[_0x34f3('0xb')]?_0x3dad80[_0x34f3('0xb')]:null;this[_0x34f3('0xc')]=_0x3dad80['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x3dad80['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x3dad80[_0x34f3('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x3dad80[_0x34f3('0xe')];this[_0x34f3('0xf')]=_0x3dad80[_0x34f3('0xf')];this[_0x34f3('0x10')]=_0x3dad80['dialBusyMaxRetry'];this[_0x34f3('0x11')]=_0x3dad80[_0x34f3('0x11')];this['dialNoAnswerMaxRetry']=_0x3dad80[_0x34f3('0x12')];this[_0x34f3('0x13')]=_0x3dad80[_0x34f3('0x13')];this[_0x34f3('0x14')]=_0x3dad80[_0x34f3('0x14')];this[_0x34f3('0x15')]=_0x3dad80[_0x34f3('0x15')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x3dad80['dialNoSuchNumberRetryFrequency']||0x96;this[_0x34f3('0x16')]=_0x3dad80[_0x34f3('0x16')]||0x3;this[_0x34f3('0x17')]=_0x3dad80['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x3dad80['dialAbandonedMaxRetry']||0x3;this[_0x34f3('0x18')]=_0x3dad80[_0x34f3('0x18')]||0x96;this[_0x34f3('0x19')]=_0x3dad80['dialMachineMaxRetry']||0x3;this[_0x34f3('0x1a')]=_0x3dad80[_0x34f3('0x1a')]||0x96;this[_0x34f3('0x1b')]=_0x3dad80[_0x34f3('0x1b')]||0x3;this[_0x34f3('0x1c')]=_0x3dad80['dialAgentRejectRetryFrequency']||0x96;this[_0x34f3('0x1d')]=_0x3dad80['dialOrderByScheduledAt']||_0x34f3('0x1e');this[_0x34f3('0x1f')]=_0x3dad80['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x3dad80[_0x34f3('0x20')]||undefined;this[_0x34f3('0x21')]=_0x3dad80[_0x34f3('0x21')]||undefined;this[_0x34f3('0x22')]=_0x3dad80['TrunkBackup']?_0x3dad80['TrunkBackup']:undefined;this[_0x34f3('0x23')]=_0x3dad80[_0x34f3('0x23')]?_0x3dad80['Trunk']:undefined;this['Interval']=_0x3dad80['Interval']?_0x3dad80[_0x34f3('0x24')]:undefined;this[_0x34f3('0x25')]=_0x3dad80[_0x34f3('0x25')]?_0x3dad80[_0x34f3('0x25')]:undefined;this['dialQueueProject']=_0x3dad80[_0x34f3('0x25')]?_0x3dad80[_0x34f3('0x25')][_0x34f3('0x0')]:undefined;this[_0x34f3('0x26')]=_0x3dad80['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x3dad80['dialAMDInitialSilence'];this[_0x34f3('0x27')]=_0x3dad80['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x3dad80[_0x34f3('0x28')];this[_0x34f3('0x29')]=_0x3dad80[_0x34f3('0x29')];this[_0x34f3('0x2a')]=_0x3dad80[_0x34f3('0x2a')];this[_0x34f3('0x2b')]=_0x3dad80['dialAMDBetweenWordsSilence'];this[_0x34f3('0x2c')]=_0x3dad80[_0x34f3('0x2c')];this['dialAMDSilenceThreshold']=_0x3dad80['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x3dad80['dialAMDMaximumWordLength'];}module[_0x34f3('0x2d')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index e1c21b1..717eb8a 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 _0xa509=['answered','endtime','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','accountcode','context','uniqueid','linkedid'];(function(_0x5246d6,_0x2a9766){var _0x5c1be4=function(_0x18e208){while(--_0x18e208){_0x5246d6['push'](_0x5246d6['shift']());}};_0x5c1be4(++_0x2a9766);}(_0xa509,0x12f));var _0x9a50=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa509[_0x122ef9];return _0x42fba0;};'use strict';function Channel(){this[_0x9a50('0x0')]=null;this[_0x9a50('0x1')]='';this[_0x9a50('0x2')]='';this[_0x9a50('0x3')]=0x0;this['calleridname']='';this[_0x9a50('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x9a50('0x5')]=0x0;this[_0x9a50('0x6')]='';this[_0x9a50('0x7')]=0x0;this[_0x9a50('0x8')]=0x0;this['exten']=0x0;this[_0x9a50('0x9')]=![];this['answertime']=null;this[_0x9a50('0xa')]=null;this['unmanaged']=![];this['abandoned']=![];this['lastapplication']='';this['lastdata']='';this[_0x9a50('0xb')]=0x0;this[_0x9a50('0xc')]=0x0;this[_0x9a50('0xd')]=0x0;this[_0x9a50('0xe')]=null;this[_0x9a50('0xf')]=null;this[_0x9a50('0x10')]=null;this[_0x9a50('0x11')]=![];this[_0x9a50('0x12')]=null;this[_0x9a50('0x13')]=null;this[_0x9a50('0x14')]=[];this[_0x9a50('0x15')]=undefined;this[_0x9a50('0x16')]=undefined;this[_0x9a50('0x17')]=undefined;this[_0x9a50('0x18')]=0x0;}module[_0x9a50('0x19')]=Channel; \ No newline at end of file +var _0x7a71=['destinationchannel','calleridname','connectedlinenum','context','exten','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7a71,0xad));var _0x17a7=function(_0x469830,_0x584dea){_0x469830=_0x469830-0x0;var _0x503fed=_0x7a71[_0x469830];return _0x503fed;};'use strict';function Channel(){this[_0x17a7('0x0')]=null;this[_0x17a7('0x1')]='';this[_0x17a7('0x2')]='';this['calleridnum']=0x0;this[_0x17a7('0x3')]='';this[_0x17a7('0x4')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x17a7('0x5')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x17a7('0x6')]=0x0;this['answered']=![];this['answertime']=null;this[_0x17a7('0x7')]=null;this[_0x17a7('0x8')]=![];this[_0x17a7('0x9')]=![];this[_0x17a7('0xa')]='';this[_0x17a7('0xb')]='';this[_0x17a7('0xc')]=0x0;this[_0x17a7('0xd')]=0x0;this['holdtime']=0x0;this['type']=null;this[_0x17a7('0xe')]=null;this[_0x17a7('0xf')]=null;this[_0x17a7('0x10')]=![];this[_0x17a7('0x11')]=null;this[_0x17a7('0x12')]=null;this[_0x17a7('0x13')]=[];this[_0x17a7('0x14')]=undefined;this[_0x17a7('0x15')]=undefined;this[_0x17a7('0x16')]=undefined;this[_0x17a7('0x17')]=0x0;}module[_0x17a7('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 82c8d9d..85ff980 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 _0x7489=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x7489,0x196));var _0x9748=function(_0x247338,_0x495ac3){_0x247338=_0x247338-0x0;var _0x24ca6d=_0x7489[_0x247338];return _0x24ca6d;};'use strict';function DeskAccount(_0x5e7af1){this['id']=_0x5e7af1['id']||0x0;this[_0x9748('0x0')]=_0x5e7af1[_0x9748('0x0')]||'';this[_0x9748('0x1')]=_0x5e7af1['username']||'';this[_0x9748('0x2')]=_0x5e7af1[_0x9748('0x2')]||'';this[_0x9748('0x3')]=_0x5e7af1[_0x9748('0x3')]||'';this[_0x9748('0x4')]=_0x5e7af1[_0x9748('0x4')]||'';this[_0x9748('0x5')]=_0x5e7af1['consumerKey']||'';this[_0x9748('0x6')]=_0x5e7af1[_0x9748('0x6')]||'';this['token']=_0x5e7af1[_0x9748('0x7')]||'';this[_0x9748('0x8')]=_0x5e7af1[_0x9748('0x8')]||'';this[_0x9748('0x9')]=_0x5e7af1[_0x9748('0x9')]||'';this['serverUrl']=_0x5e7af1[_0x9748('0xa')]||'';this[_0x9748('0xb')]=_0x5e7af1[_0x9748('0xb')]||{};}module[_0x9748('0xc')]=DeskAccount; \ No newline at end of file +var _0x1840=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','remoteUri','authType','password','consumerKey'];(function(_0x35e40f,_0x46885f){var _0x33d84f=function(_0x283abf){while(--_0x283abf){_0x35e40f['push'](_0x35e40f['shift']());}};_0x33d84f(++_0x46885f);}(_0x1840,0x16f));var _0x0184=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x1840[_0x5d2803];return _0xdcad2c;};'use strict';function DeskAccount(_0x3df11b){this['id']=_0x3df11b['id']||0x0;this[_0x0184('0x0')]=_0x3df11b[_0x0184('0x0')]||'';this['username']=_0x3df11b['username']||'';this['remoteUri']=_0x3df11b[_0x0184('0x1')]||'';this['authType']=_0x3df11b[_0x0184('0x2')]||'';this['password']=_0x3df11b[_0x0184('0x3')]||'';this[_0x0184('0x4')]=_0x3df11b[_0x0184('0x4')]||'';this[_0x0184('0x5')]=_0x3df11b[_0x0184('0x5')]||'';this[_0x0184('0x6')]=_0x3df11b[_0x0184('0x6')]||'';this[_0x0184('0x7')]=_0x3df11b[_0x0184('0x7')]||'';this['type']=_0x3df11b[_0x0184('0x8')]||'';this[_0x0184('0x9')]=_0x3df11b[_0x0184('0x9')]||'';this['Configurations']=_0x3df11b[_0x0184('0xa')]||{};}module[_0x0184('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 ec7f673..7248fac 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 _0xe7bf=['modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x32ff5d,_0x232301){var _0x108cdd=function(_0x413149){while(--_0x413149){_0x32ff5d['push'](_0x32ff5d['shift']());}};_0x108cdd(++_0x232301);}(_0xe7bf,0xc4));var _0xfe7b=function(_0x48e60c,_0x159a4d){_0x48e60c=_0x48e60c-0x0;var _0x2c80c3=_0xe7bf[_0x48e60c];return _0x2c80c3;};'use strict';function Dynamics365Account(_0x5f1de6){this['id']=_0x5f1de6['id']||0x0;this['name']=_0x5f1de6[_0xfe7b('0x0')]||'';this[_0xfe7b('0x1')]=_0x5f1de6[_0xfe7b('0x1')]||'';this[_0xfe7b('0x2')]=_0x5f1de6['password']||'';this[_0xfe7b('0x3')]=_0x5f1de6[_0xfe7b('0x3')]||'';this['tenantId']=_0x5f1de6[_0xfe7b('0x4')]||'';this[_0xfe7b('0x5')]=_0x5f1de6[_0xfe7b('0x5')]||'';this[_0xfe7b('0x6')]=_0x5f1de6[_0xfe7b('0x6')]||{};this[_0xfe7b('0x7')]=_0x5f1de6[_0xfe7b('0x7')]||'';this[_0xfe7b('0x8')]=_0x5f1de6[_0xfe7b('0x8')]||![];this[_0xfe7b('0x9')]=_0x5f1de6['Configurations']||{};this[_0xfe7b('0xa')]=_0x5f1de6[_0xfe7b('0xa')]||{};}module[_0xfe7b('0xb')]=Dynamics365Account; \ No newline at end of file +var _0xbd99=['clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId'];(function(_0x40df5f,_0x8fd59f){var _0x1573f1=function(_0x57b8b8){while(--_0x57b8b8){_0x40df5f['push'](_0x40df5f['shift']());}};_0x1573f1(++_0x8fd59f);}(_0xbd99,0x126));var _0x9bd9=function(_0xdd74ad,_0xc82422){_0xdd74ad=_0xdd74ad-0x0;var _0x4cc259=_0xbd99[_0xdd74ad];return _0x4cc259;};'use strict';function Dynamics365Account(_0x152168){this['id']=_0x152168['id']||0x0;this['name']=_0x152168[_0x9bd9('0x0')]||'';this['username']=_0x152168[_0x9bd9('0x1')]||'';this[_0x9bd9('0x2')]=_0x152168[_0x9bd9('0x2')]||'';this[_0x9bd9('0x3')]=_0x152168[_0x9bd9('0x3')]||'';this[_0x9bd9('0x4')]=_0x152168['tenantId']||'';this[_0x9bd9('0x5')]=_0x152168[_0x9bd9('0x5')]||'';this['clientSecret']=_0x152168[_0x9bd9('0x6')]||{};this[_0x9bd9('0x7')]=_0x152168[_0x9bd9('0x7')]||'';this[_0x9bd9('0x8')]=_0x152168[_0x9bd9('0x8')]||![];this[_0x9bd9('0x9')]=_0x152168[_0x9bd9('0x9')]||{};this[_0x9bd9('0xa')]=_0x152168[_0x9bd9('0xa')]||{};}module[_0x9bd9('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 66165fc..0f77db7 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 _0xc2b2=['Trunk','ListId','key','exports','name','description','ecm','headerinfo','minrate','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','SIP'];(function(_0x5c6fc0,_0x2ae293){var _0x10a569=function(_0x298f7a){while(--_0x298f7a){_0x5c6fc0['push'](_0x5c6fc0['shift']());}};_0x10a569(++_0x2ae293);}(_0xc2b2,0xb8));var _0x2c2b=function(_0x3d0231,_0x3d4bae){_0x3d0231=_0x3d0231-0x0;var _0x25d000=_0xc2b2[_0x3d0231];return _0x25d000;};'use strict';function FaxAccount(_0x3db3fe){this['id']=_0x3db3fe['id']||0x0;this[_0x2c2b('0x0')]=_0x3db3fe[_0x2c2b('0x0')]||'';this[_0x2c2b('0x1')]=_0x3db3fe['description'];this[_0x2c2b('0x2')]=_0x3db3fe[_0x2c2b('0x2')];this['headerinfo']=_0x3db3fe[_0x2c2b('0x3')];this['localstationid']=_0x3db3fe['localstationid'];this[_0x2c2b('0x4')]=_0x3db3fe[_0x2c2b('0x4')]||0x960;this['maxrate']=_0x3db3fe[_0x2c2b('0x5')]||0x3840;this['modem']=_0x3db3fe['modem']||_0x2c2b('0x6');this[_0x2c2b('0x7')]=_0x3db3fe[_0x2c2b('0x7')]||'no';this[_0x2c2b('0x8')]=_0x3db3fe[_0x2c2b('0x8')]||'no';this[_0x2c2b('0x9')]=_0x3db3fe[_0x2c2b('0x9')]||0x1388;this['tech']=_0x3db3fe['tech']||_0x2c2b('0xa');this[_0x2c2b('0xb')]=_0x3db3fe['Trunk']?_0x3db3fe['Trunk']:undefined;this[_0x2c2b('0xc')]=_0x3db3fe['ListId'];this['key']=_0x3db3fe[_0x2c2b('0xd')];}module[_0x2c2b('0xe')]=FaxAccount; \ No newline at end of file +var _0xe413=['minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','name','description','ecm','localstationid'];(function(_0x5b6dd2,_0x43f939){var _0x4a62e8=function(_0xa07ca4){while(--_0xa07ca4){_0x5b6dd2['push'](_0x5b6dd2['shift']());}};_0x4a62e8(++_0x43f939);}(_0xe413,0x1ca));var _0x3e41=function(_0x181100,_0x645def){_0x181100=_0x181100-0x0;var _0x5a4507=_0xe413[_0x181100];return _0x5a4507;};'use strict';function FaxAccount(_0x57cfcf){this['id']=_0x57cfcf['id']||0x0;this[_0x3e41('0x0')]=_0x57cfcf[_0x3e41('0x0')]||'';this[_0x3e41('0x1')]=_0x57cfcf['description'];this[_0x3e41('0x2')]=_0x57cfcf[_0x3e41('0x2')];this['headerinfo']=_0x57cfcf['headerinfo'];this[_0x3e41('0x3')]=_0x57cfcf[_0x3e41('0x3')];this[_0x3e41('0x4')]=_0x57cfcf[_0x3e41('0x4')]||0x960;this['maxrate']=_0x57cfcf[_0x3e41('0x5')]||0x3840;this[_0x3e41('0x6')]=_0x57cfcf['modem']||'v17,v27,v29';this[_0x3e41('0x7')]=_0x57cfcf[_0x3e41('0x7')]||'no';this[_0x3e41('0x8')]=_0x57cfcf[_0x3e41('0x8')]||'no';this[_0x3e41('0x9')]=_0x57cfcf[_0x3e41('0x9')]||0x1388;this[_0x3e41('0xa')]=_0x57cfcf[_0x3e41('0xa')]||'SIP';this[_0x3e41('0xb')]=_0x57cfcf['Trunk']?_0x57cfcf['Trunk']:undefined;this[_0x3e41('0xc')]=_0x57cfcf[_0x3e41('0xc')];this['key']=_0x57cfcf[_0x3e41('0xd')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index a6925c2..989a496 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 _0x178c=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x178c,0xdd));var _0xc178=function(_0x8fd62a,_0x18203d){_0x8fd62a=_0x8fd62a-0x0;var _0x2354bc=_0x178c[_0x8fd62a];return _0x2354bc;};'use strict';function FreshdeskAccount(_0x197539){this['id']=_0x197539['id']||0x0;this[_0xc178('0x0')]=_0x197539[_0xc178('0x0')]||'';this[_0xc178('0x1')]=_0x197539[_0xc178('0x1')]||'';this[_0xc178('0x2')]=_0x197539[_0xc178('0x3')]||'';this[_0xc178('0x4')]=_0x197539[_0xc178('0x4')]||'';this[_0xc178('0x5')]=_0x197539['serverUrl']||'';this[_0xc178('0x6')]=_0x197539[_0xc178('0x6')]||{};}module[_0xc178('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xf60d=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x1b0a89,_0x5f4f8f){var _0x3800f0=function(_0x2765fb){while(--_0x2765fb){_0x1b0a89['push'](_0x1b0a89['shift']());}};_0x3800f0(++_0x5f4f8f);}(_0xf60d,0x13d));var _0xdf60=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xf60d[_0x101e7b];return _0x4995c0;};'use strict';function FreshdeskAccount(_0x21f1bb){this['id']=_0x21f1bb['id']||0x0;this[_0xdf60('0x0')]=_0x21f1bb[_0xdf60('0x0')]||'';this['username']=_0x21f1bb[_0xdf60('0x1')]||'';this[_0xdf60('0x2')]=_0x21f1bb[_0xdf60('0x3')]||'';this[_0xdf60('0x4')]=_0x21f1bb[_0xdf60('0x4')]||'';this[_0xdf60('0x5')]=_0x21f1bb['serverUrl']||'';this[_0xdf60('0x6')]=_0x21f1bb[_0xdf60('0x6')]||{};}module[_0xdf60('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 b24e997..8bca805 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 _0xb194=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x4d2993,_0x1c9473){var _0x427374=function(_0x149dfd){while(--_0x149dfd){_0x4d2993['push'](_0x4d2993['shift']());}};_0x427374(++_0x1c9473);}(_0xb194,0x1b2));var _0x4b19=function(_0x53615b,_0xf060d5){_0x53615b=_0x53615b-0x0;var _0x6058f=_0xb194[_0x53615b];return _0x6058f;};'use strict';function FreshsalesAccount(_0xfec122){this['id']=_0xfec122['id']||0x0;this['name']=_0xfec122[_0x4b19('0x0')]||'';this[_0x4b19('0x1')]=_0xfec122[_0x4b19('0x1')]||'';this[_0x4b19('0x2')]=_0xfec122[_0x4b19('0x3')]||'';this['remoteUri']=_0xfec122[_0x4b19('0x4')]||'';this[_0x4b19('0x5')]=_0xfec122['serverUrl']||'';this[_0x4b19('0x6')]=_0xfec122['Configurations']||{};}module[_0x4b19('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x21d1=['Configurations','name','username','apiKey','remoteUri','serverUrl'];(function(_0x2a7210,_0x2f3d23){var _0x460766=function(_0xd575dd){while(--_0xd575dd){_0x2a7210['push'](_0x2a7210['shift']());}};_0x460766(++_0x2f3d23);}(_0x21d1,0x1c9));var _0x121d=function(_0x3d7720,_0x53ad3f){_0x3d7720=_0x3d7720-0x0;var _0xac734f=_0x21d1[_0x3d7720];return _0xac734f;};'use strict';function FreshsalesAccount(_0x42b9a7){this['id']=_0x42b9a7['id']||0x0;this[_0x121d('0x0')]=_0x42b9a7[_0x121d('0x0')]||'';this[_0x121d('0x1')]=_0x42b9a7[_0x121d('0x1')]||'';this[_0x121d('0x2')]=_0x42b9a7['token']||'';this['remoteUri']=_0x42b9a7[_0x121d('0x3')]||'';this[_0x121d('0x4')]=_0x42b9a7[_0x121d('0x4')]||'';this[_0x121d('0x5')]=_0x42b9a7[_0x121d('0x5')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 86dc815..a2ac7bc 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 _0xee14=['accountcode','exten','holdtime','assigned','lastAssignedTo','voice','mohtime','variables','exports','type','uniqueid','calleridnum','calleridname','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename'];(function(_0x3a6288,_0x36ede4){var _0x24eb1a=function(_0x57f771){while(--_0x57f771){_0x3a6288['push'](_0x3a6288['shift']());}};_0x24eb1a(++_0x36ede4);}(_0xee14,0xc1));var _0x4ee1=function(_0x12b849,_0x4793e6){_0x12b849=_0x12b849-0x0;var _0x5ca429=_0xee14[_0x12b849];return _0x5ca429;};'use strict';function QueueReport(){this[_0x4ee1('0x0')]='inbound';this[_0x4ee1('0x1')]='';this[_0x4ee1('0x2')]='';this[_0x4ee1('0x3')]='';this['queue']='';this['queuecallerjoinAt']=null;this[_0x4ee1('0x4')]=null;this['position']=0x1;this[_0x4ee1('0x5')]=0x1;this[_0x4ee1('0x6')]=![];this[_0x4ee1('0x7')]=null;this['queuecallercomplete']=![];this[_0x4ee1('0x8')]=null;this[_0x4ee1('0x9')]=![];this[_0x4ee1('0xa')]=null;this[_0x4ee1('0xb')]=0x1;this[_0x4ee1('0xc')]='';this['connectedlinenum']='';this[_0x4ee1('0xd')]='';this[_0x4ee1('0xe')]='';this['context']='';this[_0x4ee1('0xf')]='';this['priority']='';this[_0x4ee1('0x10')]=0x0;this[_0x4ee1('0x11')]=![];this[_0x4ee1('0x12')]='';this['motionChannel']=_0x4ee1('0x13');this['routealias']=null;this[_0x4ee1('0x14')]=0x0;this[_0x4ee1('0x15')]={};}module[_0x4ee1('0x16')]=QueueReport; \ No newline at end of file +var _0x5bde=['queuecallerexitAt','channel','connectedlinenum','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','exports','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0x5bde,0x8c));var _0xe5bd=function(_0x1db555,_0x1bdb29){_0x1db555=_0x1db555-0x0;var _0x315cee=_0x5bde[_0x1db555];return _0x315cee;};'use strict';function QueueReport(){this['type']=_0xe5bd('0x0');this[_0xe5bd('0x1')]='';this[_0xe5bd('0x2')]='';this['calleridname']='';this[_0xe5bd('0x3')]='';this[_0xe5bd('0x4')]=null;this['queuecallerleaveAt']=null;this[_0xe5bd('0x5')]=0x1;this['count']=0x1;this[_0xe5bd('0x6')]=![];this[_0xe5bd('0x7')]=null;this['queuecallercomplete']=![];this[_0xe5bd('0x8')]=null;this[_0xe5bd('0x9')]=![];this[_0xe5bd('0xa')]=null;this['originalposition']=0x1;this[_0xe5bd('0xb')]='';this[_0xe5bd('0xc')]='';this['connectedlinename']='';this['accountcode']='';this[_0xe5bd('0xd')]='';this[_0xe5bd('0xe')]='';this[_0xe5bd('0xf')]='';this[_0xe5bd('0x10')]=0x0;this[_0xe5bd('0x11')]=![];this[_0xe5bd('0x12')]='';this[_0xe5bd('0x13')]=_0xe5bd('0x14');this[_0xe5bd('0x15')]=null;this[_0xe5bd('0x16')]=0x0;this[_0xe5bd('0x17')]={};}module[_0xe5bd('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index a77afec..64ed9d1 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 _0x856f=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0x3dc98a,_0x403f00){var _0x27f3ad=function(_0xaa6123){while(--_0xaa6123){_0x3dc98a['push'](_0x3dc98a['shift']());}};_0x27f3ad(++_0x403f00);}(_0x856f,0x1b7));var _0xf856=function(_0x5e5177,_0x2601ae){_0x5e5177=_0x5e5177-0x0;var _0xf7695f=_0x856f[_0x5e5177];return _0xf7695f;};'use strict';function SalesforceAccount(_0x1cbd13){this['id']=_0x1cbd13['id']||0x0;this[_0xf856('0x0')]=_0x1cbd13[_0xf856('0x0')]||'';this[_0xf856('0x1')]=_0x1cbd13['username']||'';this['remoteUri']=_0x1cbd13[_0xf856('0x2')]||'';this[_0xf856('0x3')]=_0x1cbd13['password']||'';this[_0xf856('0x4')]=_0x1cbd13['clientId']||'';this[_0xf856('0x5')]=_0x1cbd13[_0xf856('0x5')]||'';this[_0xf856('0x6')]=_0x1cbd13[_0xf856('0x6')]||'';this[_0xf856('0x7')]=_0x1cbd13[_0xf856('0x7')]||_0xf856('0x8');this[_0xf856('0x9')]=_0x1cbd13[_0xf856('0x9')]||'';this[_0xf856('0xa')]=_0x1cbd13[_0xf856('0xa')]||{};}module[_0xf856('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x83eb=['Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x5ddda9,_0x43e558){var _0x53a004=function(_0x2794a1){while(--_0x2794a1){_0x5ddda9['push'](_0x5ddda9['shift']());}};_0x53a004(++_0x43e558);}(_0x83eb,0x1e5));var _0xb83e=function(_0x33f32b,_0x5bee90){_0x33f32b=_0x33f32b-0x0;var _0x2bc6e7=_0x83eb[_0x33f32b];return _0x2bc6e7;};'use strict';function SalesforceAccount(_0xfd5bb7){this['id']=_0xfd5bb7['id']||0x0;this['name']=_0xfd5bb7[_0xb83e('0x0')]||'';this[_0xb83e('0x1')]=_0xfd5bb7[_0xb83e('0x1')]||'';this[_0xb83e('0x2')]=_0xfd5bb7[_0xb83e('0x2')]||'';this[_0xb83e('0x3')]=_0xfd5bb7[_0xb83e('0x3')]||'';this[_0xb83e('0x4')]=_0xfd5bb7['clientId']||'';this[_0xb83e('0x5')]=_0xfd5bb7['clientSecret']||'';this['securityToken']=_0xfd5bb7[_0xb83e('0x6')]||'';this[_0xb83e('0x7')]=_0xfd5bb7[_0xb83e('0x7')]||_0xb83e('0x8');this[_0xb83e('0x9')]=_0xfd5bb7[_0xb83e('0x9')]||'';this['Configurations']=_0xfd5bb7[_0xb83e('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 8104788..a8747c8 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 _0x37d1=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0xd6aad,_0x3fd78e){var _0x1109e6=function(_0x37f59c){while(--_0x37f59c){_0xd6aad['push'](_0xd6aad['shift']());}};_0x1109e6(++_0x3fd78e);}(_0x37d1,0x14b));var _0x137d=function(_0x50f5af,_0x24108f){_0x50f5af=_0x50f5af-0x0;var _0x312322=_0x37d1[_0x50f5af];return _0x312322;};'use strict';function ServicenowAccount(_0x421495){this['id']=_0x421495['id']||0x0;this[_0x137d('0x0')]=_0x421495[_0x137d('0x0')]||'';this[_0x137d('0x1')]=_0x421495[_0x137d('0x1')]||'';this[_0x137d('0x2')]=_0x421495['password']||'';this[_0x137d('0x3')]=_0x421495[_0x137d('0x3')]||'';this[_0x137d('0x4')]=_0x421495['serverUrl']||'';this['Configurations']=_0x421495[_0x137d('0x5')]||{};}module[_0x137d('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xecb2=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x3a8a49,_0x5a2b8c){var _0x43c69a=function(_0x534e97){while(--_0x534e97){_0x3a8a49['push'](_0x3a8a49['shift']());}};_0x43c69a(++_0x5a2b8c);}(_0xecb2,0x15a));var _0x2ecb=function(_0x33ad3b,_0x41f400){_0x33ad3b=_0x33ad3b-0x0;var _0x1a8548=_0xecb2[_0x33ad3b];return _0x1a8548;};'use strict';function ServicenowAccount(_0x384c2b){this['id']=_0x384c2b['id']||0x0;this[_0x2ecb('0x0')]=_0x384c2b[_0x2ecb('0x0')]||'';this[_0x2ecb('0x1')]=_0x384c2b['username']||'';this[_0x2ecb('0x2')]=_0x384c2b['password']||'';this[_0x2ecb('0x3')]=_0x384c2b['remoteUri']||'';this[_0x2ecb('0x4')]=_0x384c2b[_0x2ecb('0x4')]||'';this[_0x2ecb('0x5')]=_0x384c2b[_0x2ecb('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 3218c88..f081b26 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 _0x98a7=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x4fc421,_0x94e88){var _0x8c6d63=function(_0x5b8b42){while(--_0x5b8b42){_0x4fc421['push'](_0x4fc421['shift']());}};_0x8c6d63(++_0x94e88);}(_0x98a7,0x9e));var _0x798a=function(_0x4cb7f5,_0x233155){_0x4cb7f5=_0x4cb7f5-0x0;var _0x2a998c=_0x98a7[_0x4cb7f5];return _0x2a998c;};'use strict';function SugarcrmAccount(_0x2c7deb){this['id']=_0x2c7deb['id']||0x0;this[_0x798a('0x0')]=_0x2c7deb[_0x798a('0x0')]||'';this[_0x798a('0x1')]=_0x2c7deb[_0x798a('0x1')]||'';this[_0x798a('0x2')]=_0x2c7deb[_0x798a('0x2')]||'';this['remoteUri']=_0x2c7deb[_0x798a('0x3')]||'';this[_0x798a('0x4')]=_0x2c7deb['serverUrl']||'';this['Configurations']=_0x2c7deb[_0x798a('0x5')]||{};}module[_0x798a('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xe07f=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x2739ac,_0x45a29d){var _0xa610df=function(_0x630fbe){while(--_0x630fbe){_0x2739ac['push'](_0x2739ac['shift']());}};_0xa610df(++_0x45a29d);}(_0xe07f,0x9e));var _0xfe07=function(_0x50f1ef,_0x36d778){_0x50f1ef=_0x50f1ef-0x0;var _0x4d868f=_0xe07f[_0x50f1ef];return _0x4d868f;};'use strict';function SugarcrmAccount(_0x469bef){this['id']=_0x469bef['id']||0x0;this[_0xfe07('0x0')]=_0x469bef[_0xfe07('0x0')]||'';this[_0xfe07('0x1')]=_0x469bef[_0xfe07('0x1')]||'';this['password']=_0x469bef[_0xfe07('0x2')]||'';this[_0xfe07('0x3')]=_0x469bef[_0xfe07('0x3')]||'';this[_0xfe07('0x4')]=_0x469bef[_0xfe07('0x4')]||'';this['Configurations']=_0x469bef[_0xfe07('0x5')]||{};}module[_0xfe07('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 139a806..477c710 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 _0x4a2e=['accountcode','state','stateTime','status','exports','name'];(function(_0x34e4a0,_0x1fd446){var _0x3ead3e=function(_0x47adec){while(--_0x47adec){_0x34e4a0['push'](_0x34e4a0['shift']());}};_0x3ead3e(++_0x1fd446);}(_0x4a2e,0x125));var _0xe4a2=function(_0x4b5815,_0x44fb95){_0x4b5815=_0x4b5815-0x0;var _0x58634a=_0x4a2e[_0x4b5815];return _0x58634a;};'use strict';function Telephone(_0x3ff1a8){this['id']=_0x3ff1a8['id']||0x0;this[_0xe4a2('0x0')]=_0x3ff1a8[_0xe4a2('0x0')]||'';this['accountcode']=_0x3ff1a8[_0xe4a2('0x1')]||'';this[_0xe4a2('0x2')]='unknown';this[_0xe4a2('0x3')]=0x0;this[_0xe4a2('0x4')]='unknown';this['address']='';}module[_0xe4a2('0x5')]=Telephone; \ No newline at end of file +var _0x2d58=['unknown','stateTime','status','address','exports','name','accountcode'];(function(_0x413a14,_0x2c0629){var _0x3714ad=function(_0x1a8c53){while(--_0x1a8c53){_0x413a14['push'](_0x413a14['shift']());}};_0x3714ad(++_0x2c0629);}(_0x2d58,0x186));var _0x82d5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2d58[_0xa464c9];return _0x3d73c4;};'use strict';function Telephone(_0x17a086){this['id']=_0x17a086['id']||0x0;this[_0x82d5('0x0')]=_0x17a086[_0x82d5('0x0')]||'';this['accountcode']=_0x17a086[_0x82d5('0x1')]||'';this['state']=_0x82d5('0x2');this[_0x82d5('0x3')]=0x0;this[_0x82d5('0x4')]=_0x82d5('0x2');this[_0x82d5('0x5')]='';}module[_0x82d5('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index fef6969..b9a66c0 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(_0x1e1fc3,_0x2414b2){var _0x5b2624=function(_0x5be9b9){while(--_0x5be9b9){_0x1e1fc3['push'](_0x1e1fc3['shift']());}};_0x5b2624(++_0x2414b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x289bd2,_0x1a2247){var _0x4f9149=function(_0x5eb6b6){while(--_0x5eb6b6){_0x289bd2['push'](_0x289bd2['shift']());}};_0x4f9149(++_0x1a2247);}(_0xb10b,0x12a));var _0xbb10=function(_0x5cd675,_0x352cca){_0x5cd675=_0x5cd675-0x0;var _0x2379b0=_0xb10b[_0x5cd675];return _0x2379b0;};'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 00bb225..a21f11c 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 _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x127783,_0x258715){var _0x14f298=function(_0x32090e){while(--_0x32090e){_0x127783['push'](_0x127783['shift']());}};_0x14f298(++_0x258715);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x5eb8[_0x5d2803];return _0xdcad2c;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 6112934..3aa7123 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 _0x8da6=['domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','active','name','state','stateTime','status','unknown','registry','indexOf','split','host','port'];(function(_0x46cd87,_0x44390b){var _0x5e0e07=function(_0x3cec99){while(--_0x3cec99){_0x46cd87['push'](_0x46cd87['shift']());}};_0x5e0e07(++_0x44390b);}(_0x8da6,0x1db));var _0x68da=function(_0x1264f8,_0x456b71){_0x1264f8=_0x1264f8-0x0;var _0x42117f=_0x8da6[_0x1264f8];return _0x42117f;};'use strict';function Trunk(_0x3fa503){this['id']=_0x3fa503['id']||0x0;this['active']=_0x3fa503[_0x68da('0x0')]||![];this[_0x68da('0x1')]=_0x3fa503[_0x68da('0x1')]||'';this[_0x68da('0x2')]='unknown';this[_0x68da('0x3')]=0x0;this[_0x68da('0x4')]=_0x68da('0x5');this[_0x68da('0x6')]=_0x3fa503[_0x68da('0x6')]&&_0x3fa503[_0x68da('0x6')][_0x68da('0x7')](':')?_0x3fa503[_0x68da('0x6')][_0x68da('0x8')](':')[0x0]:'';this[_0x68da('0x9')]='';this[_0x68da('0xa')]='';this[_0x68da('0xb')]='';this[_0x68da('0xc')]='';this[_0x68da('0xd')]='';this[_0x68da('0xe')]=_0x68da('0x5');this[_0x68da('0xf')]='';this[_0x68da('0x10')]='';this[_0x68da('0x11')]=_0x3fa503[_0x68da('0x11')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x478f=['indexOf','split','host','port','domain','domainport','registrationtime','defaultuser','exports','active','name','state','unknown','stateTime','status','registry'];(function(_0x2e9fe9,_0x24eb2d){var _0x230ea9=function(_0x64c83c){while(--_0x64c83c){_0x2e9fe9['push'](_0x2e9fe9['shift']());}};_0x230ea9(++_0x24eb2d);}(_0x478f,0x119));var _0xf478=function(_0x159c06,_0x171765){_0x159c06=_0x159c06-0x0;var _0x181bbc=_0x478f[_0x159c06];return _0x181bbc;};'use strict';function Trunk(_0x37052){this['id']=_0x37052['id']||0x0;this[_0xf478('0x0')]=_0x37052[_0xf478('0x0')]||![];this[_0xf478('0x1')]=_0x37052[_0xf478('0x1')]||'';this[_0xf478('0x2')]=_0xf478('0x3');this[_0xf478('0x4')]=0x0;this[_0xf478('0x5')]='unknown';this[_0xf478('0x6')]=_0x37052[_0xf478('0x6')]&&_0x37052['registry'][_0xf478('0x7')](':')?_0x37052[_0xf478('0x6')][_0xf478('0x8')](':')[0x0]:'';this[_0xf478('0x9')]='';this[_0xf478('0xa')]='';this[_0xf478('0xb')]='';this[_0xf478('0xc')]='';this['refresh']='';this['stateRegistry']='unknown';this[_0xf478('0xd')]='';this['address']='';this[_0xf478('0xe')]=_0x37052[_0xf478('0xe')]||'';}module[_0xf478('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index d916e1b..d3b06fd 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 _0xdb9f=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0xdb9f,0x185));var _0xfdb9=function(_0x2eac4f,_0x5173f9){_0x2eac4f=_0x2eac4f-0x0;var _0x58f73b=_0xdb9f[_0x2eac4f];return _0x58f73b;};'use strict';function voiceExtension(_0x41d696){this['id']=_0x41d696['id']||0x0;this['exten']=_0x41d696[_0xfdb9('0x0')]||'';this[_0xfdb9('0x1')]=_0x41d696[_0xfdb9('0x1')]||'none';this[_0xfdb9('0x2')]=_0x41d696[_0xfdb9('0x2')]||![];}module[_0xfdb9('0x3')]=voiceExtension; \ No newline at end of file +var _0xb9ef=['exten','recordingFormat','mandatoryDisposition'];(function(_0x49841d,_0x32c573){var _0x43a278=function(_0x40d562){while(--_0x40d562){_0x49841d['push'](_0x49841d['shift']());}};_0x43a278(++_0x32c573);}(_0xb9ef,0x9f));var _0xfb9e=function(_0x4ef070,_0x3b4001){_0x4ef070=_0x4ef070-0x0;var _0x5cfeec=_0xb9ef[_0x4ef070];return _0x5cfeec;};'use strict';function voiceExtension(_0x350010){this['id']=_0x350010['id']||0x0;this[_0xfb9e('0x0')]=_0x350010[_0xfb9e('0x0')]||'';this['recordingFormat']=_0x350010[_0xfb9e('0x1')]||'none';this[_0xfb9e('0x2')]=_0x350010[_0xfb9e('0x2')]||![];}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 597a4fb..fdbabca 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 _0x3914=['acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','fewestcalls','leastrecent','random','ringall','roundrobin','rrordered','wrandom','name','monitor_format','type','total','answered','sumDuration','sumBillable','unmanaged','abandoned','available','inUse','invalid','loggedIn','notInUse','onHold','paused','ringing','ringInUse','unavailable','unknown'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x3914,0xeb));var _0x4391=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0x3914[_0x17406e];return _0x2bfc5a;};'use strict';var monitorFormat={'wav':_0x4391('0x0'),'wav49':_0x4391('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0x4391('0x2'),'leastrecent':_0x4391('0x3'),'linear':'linear','random':_0x4391('0x4'),'ringall':_0x4391('0x5'),'rr':_0x4391('0x6'),'rrmemory':'rrmemory','rrordered':_0x4391('0x7'),'wrandom':_0x4391('0x8')};function VoiceQueue(_0x540b62){this['id']=_0x540b62['id']||0x0;this[_0x4391('0x9')]=_0x540b62['name']||'';this[_0x4391('0xa')]=_0x540b62['monitor_format']||'';this[_0x4391('0xb')]=_0x540b62[_0x4391('0xb')]||'inbound';this['waiting']=0x0;this[_0x4391('0xc')]=0x0;this[_0x4391('0xd')]=0x0;this[_0x4391('0xe')]=0x0;this['sumHoldTime']=0x0;this[_0x4391('0xf')]=0x0;this[_0x4391('0x10')]=0x0;this[_0x4391('0x11')]=0x0;this[_0x4391('0x12')]=0x0;this['busy']=0x0;this[_0x4391('0x13')]=0x0;this[_0x4391('0x14')]=0x0;this[_0x4391('0x15')]=0x0;this[_0x4391('0x16')]=0x0;this[_0x4391('0x17')]=0x0;this[_0x4391('0x18')]=0x0;this[_0x4391('0x19')]=0x0;this[_0x4391('0x1a')]=0x0;this['talking']=0x0;this[_0x4391('0x1b')]=0x0;this[_0x4391('0x1c')]=0x0;this[_0x4391('0x1d')]=_0x540b62[_0x4391('0x1d')]||![];this['acwTimeout']=_0x540b62[_0x4391('0x1e')]||0xa;this['autopause']=_0x540b62[_0x4391('0x1f')]||'no';this[_0x4391('0x20')]=!![];this[_0x4391('0x21')]='';this[_0x4391('0x22')]='';this[_0x4391('0x23')]=0x0;this[_0x4391('0x24')]=0x0;this[_0x4391('0x25')]=_0x540b62[_0x4391('0x25')]||null;this['dialGlobalInterval']=_0x540b62['dialGlobalInterval']?_0x540b62[_0x4391('0x26')]:null;this['dialActive']=_0x540b62[_0x4391('0x27')];this[_0x4391('0x28')]=_0x540b62[_0x4391('0x28')]||_0x4391('0x29');this[_0x4391('0x2a')]=_0x540b62['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x540b62[_0x4391('0x2b')]||0x0;this[_0x4391('0x2c')]=_0x540b62[_0x4391('0x2c')]||0x1;this['dialPredictiveOptimization']=_0x540b62[_0x4391('0x2d')]||_0x4391('0x2e');this[_0x4391('0x2f')]=_0x540b62[_0x4391('0x2f')]||0.03;this['dialPredictiveInterval']=_0x540b62[_0x4391('0x30')]||0x258;this[_0x4391('0x31')]=_0x540b62[_0x4391('0x31')]||_0x4391('0x32');this[_0x4391('0x33')]=_0x540b62[_0x4391('0x33')]||'anonymous';this[_0x4391('0x34')]=_0x540b62[_0x4391('0x34')]||0x1e;this[_0x4391('0x35')]=_0x540b62[_0x4391('0x35')]||'tTxX';this['dialQueueTimeout']=_0x540b62[_0x4391('0x36')]||0x3;this[_0x4391('0x37')]=_0x540b62[_0x4391('0x37')]||undefined;this[_0x4391('0x38')]=_0x540b62[_0x4391('0x38')]||0x3;this['dialCongestionRetryFrequency']=_0x540b62['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x540b62['dialBusyMaxRetry']||0x3;this[_0x4391('0x39')]=_0x540b62[_0x4391('0x39')]||0x96;this[_0x4391('0x3a')]=_0x540b62[_0x4391('0x3a')]||0x3;this['dialNoAnswerRetryFrequency']=_0x540b62[_0x4391('0x3b')]||0x96;this[_0x4391('0x3c')]=_0x540b62[_0x4391('0x3c')]||0x3;this[_0x4391('0x3d')]=_0x540b62[_0x4391('0x3d')]||0x96;this['dialDropMaxRetry']=_0x540b62[_0x4391('0x3e')]||0x3;this[_0x4391('0x3f')]=_0x540b62[_0x4391('0x3f')]||0x96;this[_0x4391('0x40')]=_0x540b62[_0x4391('0x40')]||0x3;this[_0x4391('0x41')]=_0x540b62[_0x4391('0x41')]||0x96;this[_0x4391('0x42')]=_0x540b62[_0x4391('0x42')]||0x3;this[_0x4391('0x43')]=_0x540b62[_0x4391('0x43')]||0x96;this['dialAgentRejectMaxRetry']=_0x540b62[_0x4391('0x44')]||0x3;this['dialAgentRejectRetryFrequency']=_0x540b62[_0x4391('0x45')]||0x96;this['callAdditionalPhoneAfterMin']=_0x540b62['callAdditionalPhoneAfterMin']||0x3;this[_0x4391('0x46')]=_0x540b62[_0x4391('0x46')]||0x4;this[_0x4391('0x47')]=_0x540b62[_0x4391('0x47')]?_0x540b62[_0x4391('0x47')]:undefined;this[_0x4391('0x48')]=_0x540b62[_0x4391('0x48')]?_0x540b62['TrunkBackup']:undefined;this[_0x4391('0x49')]=_0x540b62['dialPrefix']||undefined;this[_0x4391('0x4a')]=_0x540b62['Interval']?_0x540b62[_0x4391('0x4a')]:undefined;this[_0x4391('0x4b')]=_0x540b62[_0x4391('0x4b')]||_0x4391('0x4c');this[_0x4391('0x4d')]=_0x540b62[_0x4391('0x4d')]||undefined;this[_0x4391('0x4e')]=_0x540b62[_0x4391('0x4e')]||undefined;this[_0x4391('0x4f')]=strategy[_0x540b62[_0x4391('0x4f')]];this[_0x4391('0x50')]=!![];this[_0x4391('0x51')]=_0x540b62[_0x4391('0x51')]||![];this[_0x4391('0x52')]=_0x540b62[_0x4391('0x52')];this[_0x4391('0x53')]=_0x540b62[_0x4391('0x53')];this[_0x4391('0x54')]=_0x540b62['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x540b62[_0x4391('0x55')];this[_0x4391('0x56')]=_0x540b62[_0x4391('0x56')];this[_0x4391('0x57')]=_0x540b62[_0x4391('0x57')];this[_0x4391('0x58')]=_0x540b62[_0x4391('0x58')];this[_0x4391('0x59')]=_0x540b62['dialAMDSilenceThreshold'];this[_0x4391('0x5a')]=_0x540b62['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this['timeout']=_0x540b62[_0x4391('0x5b')];this[_0x4391('0x5c')]=0x0;this[_0x4391('0x5d')]=0x0;this[_0x4391('0x5e')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x4391('0x5f')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x4391('0x60')]=0x0;this[_0x4391('0x61')]=0x0;this[_0x4391('0x62')]=0x0;this[_0x4391('0x63')]=0x0;this[_0x4391('0x64')]=0x0;this[_0x4391('0x65')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x4391('0x66')]=undefined;this[_0x4391('0x67')]=undefined;this[_0x4391('0x68')]=undefined;this[_0x4391('0x69')]=1.05;this[_0x4391('0x6a')]=0x0;this[_0x4391('0x6b')]=0x0;this[_0x4391('0x6c')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x4391('0x6d')]=0x0;this[_0x4391('0x6e')]=0x0;this[_0x4391('0x6f')]=0x0;this[_0x4391('0x70')]=0x0;this[_0x4391('0x71')]=_0x540b62[_0x4391('0x72')]||0x14;this[_0x4391('0x73')]=_0x540b62['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x4391('0x74')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x4391('0x75')]=0x1;this[_0x4391('0x76')]=0x0;this[_0x4391('0x77')]=0x0;this[_0x4391('0x78')]=0x0;this[_0x4391('0x79')]=0x0;this[_0x4391('0x7a')]=_0x540b62[_0x4391('0x7a')]||0x1e;this[_0x4391('0x7b')]=_0x540b62[_0x4391('0x7b')]||![];this[_0x4391('0x7c')]=!!_0x540b62[_0x4391('0x7c')]||![];this[_0x4391('0x7d')]=!!_0x540b62[_0x4391('0x7d')]||![];this['dialQueueProject2']=_0x540b62['dialQueueProject2']||undefined;this[_0x4391('0x7e')]=_0x540b62[_0x4391('0x7e')]||![];this[_0x4391('0x7f')]=_0x540b62[_0x4391('0x7f')]||![];this[_0x4391('0xa')]=monitorFormat[_0x540b62[_0x4391('0xa')]]?monitorFormat[_0x540b62['monitor_format']]:undefined;this[_0x4391('0x80')]=_0x540b62['mandatoryDisposition']||![];this[_0x4391('0x81')]=_0x540b62['mandatoryDispositionPause']?_0x540b62[_0x4391('0x81')]:undefined;this[_0x4391('0x82')]=![];}module[_0x4391('0x83')]=VoiceQueue; \ No newline at end of file +var _0xd4f4=['dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','fewestcalls','leastrecent','ringall','rrordered','wrandom','name','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','paused','ringing','ringInUse','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber'];(function(_0x7154d9,_0x11915c){var _0x545073=function(_0x4c438e){while(--_0x4c438e){_0x7154d9['push'](_0x7154d9['shift']());}};_0x545073(++_0x11915c);}(_0xd4f4,0x1bc));var _0x4d4f=function(_0x254d01,_0x102fb6){_0x254d01=_0x254d01-0x0;var _0x18e8fa=_0xd4f4[_0x254d01];return _0x18e8fa;};'use strict';var monitorFormat={'wav':_0x4d4f('0x0'),'wav49':'wav49','gsm':'gsm'};var strategy={'fewestcalls':_0x4d4f('0x1'),'leastrecent':_0x4d4f('0x2'),'linear':'linear','random':'random','ringall':_0x4d4f('0x3'),'rr':'roundrobin','rrmemory':'rrmemory','rrordered':_0x4d4f('0x4'),'wrandom':_0x4d4f('0x5')};function VoiceQueue(_0x23168c){this['id']=_0x23168c['id']||0x0;this['name']=_0x23168c[_0x4d4f('0x6')]||'';this['monitor_format']=_0x23168c['monitor_format']||'';this['type']=_0x23168c[_0x4d4f('0x7')]||_0x4d4f('0x8');this[_0x4d4f('0x9')]=0x0;this[_0x4d4f('0xa')]=0x0;this[_0x4d4f('0xb')]=0x0;this[_0x4d4f('0xc')]=0x0;this[_0x4d4f('0xd')]=0x0;this['sumBillable']=0x0;this[_0x4d4f('0xe')]=0x0;this[_0x4d4f('0xf')]=0x0;this[_0x4d4f('0x10')]=0x0;this[_0x4d4f('0x11')]=0x0;this[_0x4d4f('0x12')]=0x0;this[_0x4d4f('0x13')]=0x0;this[_0x4d4f('0x14')]=0x0;this[_0x4d4f('0x15')]=0x0;this['onHold']=0x0;this[_0x4d4f('0x16')]=0x0;this[_0x4d4f('0x17')]=0x0;this[_0x4d4f('0x18')]=0x0;this['talking']=0x0;this[_0x4d4f('0x19')]=0x0;this[_0x4d4f('0x1a')]=0x0;this[_0x4d4f('0x1b')]=_0x23168c[_0x4d4f('0x1b')]||![];this['acwTimeout']=_0x23168c[_0x4d4f('0x1c')]||0xa;this[_0x4d4f('0x1d')]=_0x23168c[_0x4d4f('0x1d')]||'no';this[_0x4d4f('0x1e')]=!![];this[_0x4d4f('0x1f')]='';this['statusMessage']='';this[_0x4d4f('0x20')]=0x0;this[_0x4d4f('0x21')]=0x0;this['dialTimezone']=_0x23168c[_0x4d4f('0x22')]||null;this[_0x4d4f('0x23')]=_0x23168c[_0x4d4f('0x23')]?_0x23168c[_0x4d4f('0x23')]:null;this['dialActive']=_0x23168c['dialActive'];this[_0x4d4f('0x24')]=_0x23168c[_0x4d4f('0x24')]||_0x4d4f('0x25');this[_0x4d4f('0x26')]=_0x23168c[_0x4d4f('0x26')]||0x0;this[_0x4d4f('0x27')]=_0x23168c[_0x4d4f('0x27')]||0x0;this[_0x4d4f('0x28')]=_0x23168c[_0x4d4f('0x28')]||0x1;this[_0x4d4f('0x29')]=_0x23168c[_0x4d4f('0x29')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x23168c[_0x4d4f('0x2a')]||0.03;this['dialPredictiveInterval']=_0x23168c[_0x4d4f('0x2b')]||0x258;this[_0x4d4f('0x2c')]=_0x23168c[_0x4d4f('0x2c')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x23168c[_0x4d4f('0x2d')]||_0x4d4f('0x2e');this[_0x4d4f('0x2f')]=_0x23168c[_0x4d4f('0x2f')]||0x1e;this['dialQueueOptions']=_0x23168c[_0x4d4f('0x30')]||'tTxX';this[_0x4d4f('0x31')]=_0x23168c[_0x4d4f('0x31')]||0x3;this[_0x4d4f('0x32')]=_0x23168c['dialQueueProject']||undefined;this[_0x4d4f('0x33')]=_0x23168c[_0x4d4f('0x33')]||0x3;this[_0x4d4f('0x34')]=_0x23168c[_0x4d4f('0x34')]||0x96;this[_0x4d4f('0x35')]=_0x23168c[_0x4d4f('0x35')]||0x3;this[_0x4d4f('0x36')]=_0x23168c['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x23168c[_0x4d4f('0x37')]||0x3;this[_0x4d4f('0x38')]=_0x23168c[_0x4d4f('0x38')]||0x96;this[_0x4d4f('0x39')]=_0x23168c['dialNoSuchNumberMaxRetry']||0x3;this[_0x4d4f('0x3a')]=_0x23168c[_0x4d4f('0x3a')]||0x96;this[_0x4d4f('0x3b')]=_0x23168c[_0x4d4f('0x3b')]||0x3;this['dialDropRetryFrequency']=_0x23168c[_0x4d4f('0x3c')]||0x96;this[_0x4d4f('0x3d')]=_0x23168c[_0x4d4f('0x3d')]||0x3;this[_0x4d4f('0x3e')]=_0x23168c[_0x4d4f('0x3e')]||0x96;this[_0x4d4f('0x3f')]=_0x23168c[_0x4d4f('0x3f')]||0x3;this[_0x4d4f('0x40')]=_0x23168c[_0x4d4f('0x40')]||0x96;this[_0x4d4f('0x41')]=_0x23168c[_0x4d4f('0x41')]||0x3;this[_0x4d4f('0x42')]=_0x23168c[_0x4d4f('0x42')]||0x96;this['callAdditionalPhoneAfterMin']=_0x23168c[_0x4d4f('0x43')]||0x3;this[_0x4d4f('0x44')]=_0x23168c['dialGlobalMaxRetry']||0x4;this[_0x4d4f('0x45')]=_0x23168c['Trunk']?_0x23168c[_0x4d4f('0x45')]:undefined;this[_0x4d4f('0x46')]=_0x23168c[_0x4d4f('0x46')]?_0x23168c[_0x4d4f('0x46')]:undefined;this[_0x4d4f('0x47')]=_0x23168c['dialPrefix']||undefined;this['Interval']=_0x23168c[_0x4d4f('0x48')]?_0x23168c[_0x4d4f('0x48')]:undefined;this['dialOrderByScheduledAt']=_0x23168c[_0x4d4f('0x49')]||_0x4d4f('0x4a');this['dialRandomLastDigitCallerIdNumber']=_0x23168c[_0x4d4f('0x4b')]||undefined;this['dialCutDigit']=_0x23168c[_0x4d4f('0x4c')]||undefined;this[_0x4d4f('0x4d')]=strategy[_0x23168c[_0x4d4f('0x4d')]];this[_0x4d4f('0x4e')]=!![];this[_0x4d4f('0x4f')]=_0x23168c['dialAMDActive']||![];this[_0x4d4f('0x50')]=_0x23168c[_0x4d4f('0x50')];this[_0x4d4f('0x51')]=_0x23168c[_0x4d4f('0x51')];this[_0x4d4f('0x52')]=_0x23168c[_0x4d4f('0x52')];this['dialAMDTotalAnalysisTime']=_0x23168c[_0x4d4f('0x53')];this[_0x4d4f('0x54')]=_0x23168c[_0x4d4f('0x54')];this['dialAMDBetweenWordsSilence']=_0x23168c[_0x4d4f('0x55')];this[_0x4d4f('0x56')]=_0x23168c['dialAMDMaximumNumberOfWords'];this[_0x4d4f('0x57')]=_0x23168c[_0x4d4f('0x57')];this[_0x4d4f('0x58')]=_0x23168c['dialAMDMaximumWordLength'];this[_0x4d4f('0x59')]=0x0;this[_0x4d4f('0x5a')]=0x0;this[_0x4d4f('0x5b')]=_0x23168c['timeout'];this[_0x4d4f('0x5c')]=0x0;this[_0x4d4f('0x5d')]=0x0;this[_0x4d4f('0x5e')]=0x0;this[_0x4d4f('0x5f')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x4d4f('0x60')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x4d4f('0x61')]=0x0;this[_0x4d4f('0x62')]=0x0;this[_0x4d4f('0x63')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x4d4f('0x64')]=0x0;this[_0x4d4f('0x65')]=0x0;this[_0x4d4f('0x66')]=0x0;this[_0x4d4f('0x67')]=undefined;this['startPredictive']=undefined;this[_0x4d4f('0x68')]=undefined;this[_0x4d4f('0x69')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x4d4f('0x6a')]=0x0;this[_0x4d4f('0x6b')]=0x0;this[_0x4d4f('0x6c')]=0x0;this[_0x4d4f('0x6d')]=0x0;this[_0x4d4f('0x6e')]=0x0;this[_0x4d4f('0x6f')]=0x0;this[_0x4d4f('0x70')]=0x0;this[_0x4d4f('0x71')]=_0x23168c[_0x4d4f('0x72')]||0x14;this[_0x4d4f('0x73')]=_0x23168c[_0x4d4f('0x72')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x4d4f('0x74')]=0x1;this[_0x4d4f('0x75')]=0x0;this['erlangCallToSecond']=0x0;this[_0x4d4f('0x76')]=0x0;this[_0x4d4f('0x77')]=0x0;this[_0x4d4f('0x78')]=_0x23168c[_0x4d4f('0x78')]||0x1e;this[_0x4d4f('0x79')]=_0x23168c[_0x4d4f('0x79')]||![];this[_0x4d4f('0x7a')]=!!_0x23168c[_0x4d4f('0x7a')]||![];this['dialPreviewRecallmeReminder']=!!_0x23168c['dialPreviewRecallmeReminder']||![];this[_0x4d4f('0x7b')]=_0x23168c[_0x4d4f('0x7b')]||undefined;this['dialAgiAfterHangupClient']=_0x23168c['dialAgiAfterHangupClient']||![];this[_0x4d4f('0x7c')]=_0x23168c['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x23168c[_0x4d4f('0x7d')]]?monitorFormat[_0x23168c[_0x4d4f('0x7d')]]:undefined;this['mandatoryDisposition']=_0x23168c[_0x4d4f('0x7e')]||![];this[_0x4d4f('0x7f')]=_0x23168c[_0x4d4f('0x7f')]?_0x23168c['mandatoryDispositionPause']:undefined;this[_0x4d4f('0x80')]=![];}module[_0x4d4f('0x81')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index e66f6da..1ebe78c 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1501=['outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','inUse','loggedin','callers','length','online','booked','keys','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','preview','pTalking','exports','loggedIn','loggedInDb','paused','talking','waiting','available','answered','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringing','ringInUse','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay'];(function(_0x533b95,_0x58950e){var _0x266566=function(_0x2b776b){while(--_0x2b776b){_0x533b95['push'](_0x533b95['shift']());}};_0x266566(++_0x58950e);}(_0x1501,0x126));var _0x1150=function(_0xeaa3ba,_0x30f497){_0xeaa3ba=_0xeaa3ba-0x0;var _0x8899ba=_0x1501[_0xeaa3ba];return _0x8899ba;};'use strict';var INBOUND_COUNTERS=['available',_0x1150('0x0'),_0x1150('0x1'),_0x1150('0x2'),'ringing',_0x1150('0x3'),_0x1150('0x4')];var OUTBOUND_COUNTERS=[_0x1150('0x5'),_0x1150('0x6'),'inUse',_0x1150('0x0'),'loggedInDb',_0x1150('0x7'),_0x1150('0x8'),_0x1150('0x9'),_0x1150('0xa'),_0x1150('0xb'),_0x1150('0xc'),_0x1150('0xd'),'outboundNoSuchCallsDay','outboundReCallsDay',_0x1150('0xe'),_0x1150('0xf'),'paused','pTalking',_0x1150('0x3'),_0x1150('0x10'),_0x1150('0x11'),_0x1150('0x12'),'waiting'];function VoiceQueueSummary(_0x38e393){this['id']=_0x38e393['id'];this[_0x1150('0x13')]=_0x38e393['name'];this[_0x1150('0x14')]=_0x38e393['strategy'];this[_0x1150('0x15')]=_0x38e393[_0x1150('0x15')]||0x0;this[_0x1150('0x6')]=_0x38e393[_0x1150('0x6')]||0x0;this[_0x1150('0x5')]=_0x38e393[_0x1150('0x5')]||0x0;this[_0x1150('0x16')]=_0x38e393[_0x1150('0x16')]||0x0;this['inUse']=_0x38e393['inUse']||0x0;this[_0x1150('0x17')]=_0x38e393[_0x1150('0x17')]||0x0;this[_0x1150('0x0')]=_0x38e393[_0x1150('0x0')]||0x0;this[_0x1150('0x1')]=_0x38e393[_0x1150('0x1')]||0x0;this[_0x1150('0x18')]=_0x38e393[_0x1150('0x18')]||0x0;this[_0x1150('0x19')]=_0x38e393[_0x1150('0x19')]||0x0;this['paused']=_0x38e393['paused']||0x0;this[_0x1150('0x1a')]=_0x38e393[_0x1150('0x1a')]||0x0;this['ringInUse']=_0x38e393[_0x1150('0x1b')];this['sumBillable']=_0x38e393[_0x1150('0x10')];this['sumDuration']=_0x38e393[_0x1150('0x11')];this['sumHoldTime']=_0x38e393['sumHoldTime']||0x0;this[_0x1150('0x3')]=_0x38e393[_0x1150('0x3')]||0x0;this[_0x1150('0x12')]=_0x38e393[_0x1150('0x12')]||0x0;this[_0x1150('0x1c')]=_0x38e393[_0x1150('0x1c')];this[_0x1150('0x1d')]=_0x38e393['unavailable']||0x0;this['unknown']=_0x38e393[_0x1150('0x1e')]||0x0;this[_0x1150('0x1f')]=_0x38e393[_0x1150('0x1f')]||0x0;this[_0x1150('0x4')]=_0x38e393['waiting']||0x0;if(_0x38e393[_0x1150('0x1c')]===_0x1150('0x20')){this['pTalking']=_0x38e393['pTalking']||0x0;this['dialActive']=_0x38e393[_0x1150('0x21')];this[_0x1150('0x22')]=_0x38e393['dialMethod'];this[_0x1150('0x23')]=_0x38e393[_0x1150('0x23')];this['dialOriginateCallerIdNumber']=_0x38e393[_0x1150('0x24')];this[_0x1150('0x25')]=_0x38e393[_0x1150('0x25')];this[_0x1150('0x26')]=_0x38e393[_0x1150('0x26')];this[_0x1150('0x27')]=_0x38e393[_0x1150('0x27')];this[_0x1150('0x28')]=_0x38e393['outboundAnswerAgiCallsDay'];this[_0x1150('0x9')]=_0x38e393[_0x1150('0x9')];this[_0x1150('0xa')]=_0x38e393[_0x1150('0xa')];this[_0x1150('0xb')]=_0x38e393['outboundBusyCallsDay'];this[_0x1150('0xc')]=_0x38e393[_0x1150('0xc')];this[_0x1150('0x29')]=_0x38e393['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x38e393[_0x1150('0x2a')];this[_0x1150('0x2b')]=_0x38e393[_0x1150('0x2b')];this[_0x1150('0xd')]=_0x38e393[_0x1150('0xd')];this[_0x1150('0x2c')]=_0x38e393[_0x1150('0x2c')];this['outboundOriginateFailureCallsDay']=_0x38e393[_0x1150('0x2d')];this[_0x1150('0x2e')]=_0x38e393['outboundReCallsDay'];this[_0x1150('0xe')]=_0x38e393['outboundRejectCallsDay'];this['outboundUnknownCallsDay']=_0x38e393[_0x1150('0xf')];this[_0x1150('0x2f')]=_0x38e393[_0x1150('0x2f')];this[_0x1150('0x30')]=_0x38e393['predictiveIntervalAvgHoldtime'];this[_0x1150('0x31')]=_0x38e393[_0x1150('0x31')];this[_0x1150('0x32')]=_0x38e393[_0x1150('0x32')];this[_0x1150('0x33')]=_0x38e393[_0x1150('0x33')];this[_0x1150('0x34')]=_0x38e393['predictiveIntervalErlangCalls'];this[_0x1150('0x35')]=_0x38e393[_0x1150('0x35')];this[_0x1150('0x36')]=_0x38e393['predictiveIntervalHitRate'];this[_0x1150('0x37')]=_0x38e393[_0x1150('0x37')];this[_0x1150('0x38')]=_0x38e393['predictiveIntervalPauses'];this['predictiveIntervalAvailable']=_0x38e393[_0x1150('0x39')];this[_0x1150('0x3a')]=_0x38e393[_0x1150('0x3a')];this['originated']=_0x38e393['originated'];this[_0x1150('0x3b')]=_0x38e393[_0x1150('0x3b')];this['erlangCallToSecond']=_0x38e393[_0x1150('0x3c')];this[_0x1150('0x3d')]=_0x38e393[_0x1150('0x3d')];this['erlangBusyFactor']=_0x38e393['erlangBusyFactor'];this[_0x1150('0x3e')]=_0x38e393[_0x1150('0x3e')];this['startProgressive']=_0x38e393[_0x1150('0x3f')];this[_0x1150('0x40')]=_0x38e393[_0x1150('0x40')];this['statusMessage']=_0x38e393[_0x1150('0x41')];}if(_0x38e393[_0x1150('0x42')]){this[_0x1150('0x42')]={'id':_0x38e393[_0x1150('0x42')]['id'],'name':_0x38e393[_0x1150('0x42')][_0x1150('0x13')],'active':_0x38e393[_0x1150('0x42')][_0x1150('0x43')],'callerid':_0x38e393['Trunk'][_0x1150('0x44')]};}}VoiceQueueSummary[_0x1150('0x45')]['createReport']=function(_0x3e56b6,_0x2f2357,_0x39f2c5,_0x31790f){this[_0x1150('0x1')]=0x0;this[_0x1150('0x3')]=0x0;this['paused']=0x0;this[_0x1150('0x1e')]=0x0;this['notInUse']=0x0;this[_0x1150('0x46')]=0x0;this['busy']=0x0;this[_0x1150('0x17')]=0x0;this['unavailable']=0x0;this[_0x1150('0x1a')]=0x0;this[_0x1150('0x1b')]=0x0;this[_0x1150('0x18')]=0x0;if(_0x39f2c5){if(_0x39f2c5['available']){this['available']=Number(_0x39f2c5[_0x1150('0x5')]);}if(_0x39f2c5[_0x1150('0x47')]){this['loggedIn']=Number(_0x39f2c5[_0x1150('0x47')]);}if(_0x39f2c5[_0x1150('0x48')]){this[_0x1150('0x4')]=Number(_0x39f2c5[_0x1150('0x48')]);}}for(var _0x474a45=0x0;_0x474a45<_0x3e56b6[_0x1150('0x49')];_0x474a45++){var _0x32284d=_0x2f2357['SIP/'+_0x3e56b6[_0x474a45][_0x1150('0x13')]];if(_0x32284d&&_0x32284d[_0x1150('0x4a')]){this[_0x1150('0x1')]+=0x1;}if(_0x3e56b6[_0x474a45]['incall']==='1'){this[_0x1150('0x3')]+=0x1;}if(_0x3e56b6[_0x474a45][_0x1150('0x2')]==='1'&&!['2','7','8']['includes'](_0x3e56b6[_0x474a45]['status'])){this[_0x1150('0x2')]+=0x1;}switch(_0x3e56b6[_0x474a45]['status']){case'0':this[_0x1150('0x1e')]+=0x1;break;case'1':this[_0x1150('0x19')]+=0x1;break;case'2':this[_0x1150('0x46')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x1150('0x17')]+=0x1;break;case'5':this[_0x1150('0x1d')]+=0x1;break;case'6':this[_0x1150('0x1a')]+=0x1;break;case'7':this[_0x1150('0x1b')]+=0x1;break;case'8':this[_0x1150('0x18')]+=0x1;break;}}if(this[_0x1150('0x22')]===_0x1150('0x4b')){var _0xc3652a=Object[_0x1150('0x4c')](_0x31790f);for(var _0x4f10a1=0x0;_0x4f10a1<_0xc3652a[_0x1150('0x49')];_0x4f10a1++){var _0x199500=_0xc3652a[_0x4f10a1];var _0x4bea5e=_0x31790f[_0x199500];if(_0x4bea5e['queue']===this[_0x1150('0x13')]&&_0x4bea5e['type']==='dialer'&&_0x4bea5e['exten']===_0x1150('0x4d')){this[_0x1150('0x3')]+=0x1;}}if(this['talking']>this[_0x1150('0x46')]){this[_0x1150('0x3')]=this[_0x1150('0x46')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0x1150('0x45')][_0x1150('0x4e')]=function(_0x51731e){var _0x17e53a=![];if(_0x51731e){_0x17e53a=INBOUND_COUNTERS[_0x1150('0x4f')](function(_0x1f9062){return this[_0x1f9062]!==_0x51731e[_0x1f9062];},this);}return _0x17e53a;};VoiceQueueSummary[_0x1150('0x45')][_0x1150('0x50')]=function(_0x5a548e){var _0x56f865=![];var _0x205e23=![];var _0x21df19=![];if(_0x5a548e){_0x56f865=this[_0x1150('0x22')]!==_0x5a548e[_0x1150('0x22')]||this[_0x1150('0x21')]!==_0x5a548e['dialActive']||this[_0x1150('0x40')]!==_0x5a548e[_0x1150('0x40')]||this[_0x1150('0x41')]!==_0x5a548e[_0x1150('0x41')];_0x205e23=OUTBOUND_COUNTERS[_0x1150('0x4f')](function(_0x2c7f7c){return this[_0x2c7f7c]!==_0x5a548e[_0x2c7f7c];},this);if(this['Trunk']&&_0x5a548e[_0x1150('0x42')]){_0x21df19=this['Trunk'][_0x1150('0x13')]!==_0x5a548e[_0x1150('0x42')][_0x1150('0x13')]||this[_0x1150('0x42')][_0x1150('0x43')]!==_0x5a548e['Trunk'][_0x1150('0x43')];}}return _0x56f865||_0x205e23||_0x21df19;};VoiceQueueSummary[_0x1150('0x45')][_0x1150('0x51')]=function(_0x16be3b){this['answered']=_0x16be3b[_0x1150('0x6')];this[_0x1150('0x40')]=_0x16be3b[_0x1150('0x40')];this[_0x1150('0x41')]=_0x16be3b[_0x1150('0x41')];this[_0x1150('0x7')]=_0x16be3b[_0x1150('0x7')];this[_0x1150('0x8')]=_0x16be3b[_0x1150('0x8')];this[_0x1150('0x9')]=_0x16be3b[_0x1150('0x9')];this['outboundBlacklistCallsDay']=_0x16be3b[_0x1150('0xa')];this[_0x1150('0xb')]=_0x16be3b['outboundBusyCallsDay'];this[_0x1150('0xc')]=_0x16be3b[_0x1150('0xc')];this[_0x1150('0xd')]=_0x16be3b[_0x1150('0xd')];this['outboundNoSuchCallsDay']=_0x16be3b[_0x1150('0x2c')];this['outboundReCallsDay']=_0x16be3b[_0x1150('0x2e')];this[_0x1150('0xe')]=_0x16be3b[_0x1150('0xe')];this[_0x1150('0xf')]=_0x16be3b[_0x1150('0xf')];this['sumBillable']=_0x16be3b[_0x1150('0x10')];this[_0x1150('0x11')]=_0x16be3b[_0x1150('0x11')];this[_0x1150('0x12')]=_0x16be3b['total'];if(this[_0x1150('0x22')]===_0x1150('0x52')){this[_0x1150('0x53')]=_0x16be3b[_0x1150('0x53')];}};module[_0x1150('0x54')]=VoiceQueueSummary; \ No newline at end of file +var _0x207c=['outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','message','Trunk','active','callerid','prototype','invalid','loggedin','callers','length','online','incall','includes','status','booked','keys','queue','exten','compareToInboundQueue','some','compareToOutboundQueue','statusMessage','updateReportFromOutboundQueue','preview','exports','loggedIn','loggedInDb','paused','ringing','talking','waiting','available','inUse','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','name','strategy','abandoned','answered','busy','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','total','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout'];(function(_0x39551a,_0x116007){var _0x4b0b62=function(_0x3d8a12){while(--_0x3d8a12){_0x39551a['push'](_0x39551a['shift']());}};_0x4b0b62(++_0x116007);}(_0x207c,0x1e8));var _0xc207=function(_0x3e61d4,_0x224d2d){_0x3e61d4=_0x3e61d4-0x0;var _0x40bd4e=_0x207c[_0x3e61d4];return _0x40bd4e;};'use strict';var INBOUND_COUNTERS=['available',_0xc207('0x0'),_0xc207('0x1'),_0xc207('0x2'),_0xc207('0x3'),_0xc207('0x4'),_0xc207('0x5')];var OUTBOUND_COUNTERS=[_0xc207('0x6'),'answered',_0xc207('0x7'),'loggedIn','loggedInDb','originated',_0xc207('0x8'),_0xc207('0x9'),_0xc207('0xa'),'outboundBusyCallsDay',_0xc207('0xb'),_0xc207('0xc'),_0xc207('0xd'),'outboundReCallsDay',_0xc207('0xe'),_0xc207('0xf'),_0xc207('0x2'),_0xc207('0x10'),_0xc207('0x4'),_0xc207('0x11'),'sumDuration','total','waiting'];function VoiceQueueSummary(_0x19b297){this['id']=_0x19b297['id'];this['name']=_0x19b297[_0xc207('0x12')];this[_0xc207('0x13')]=_0x19b297['strategy'];this[_0xc207('0x14')]=_0x19b297[_0xc207('0x14')]||0x0;this[_0xc207('0x15')]=_0x19b297[_0xc207('0x15')]||0x0;this[_0xc207('0x6')]=_0x19b297['available']||0x0;this[_0xc207('0x16')]=_0x19b297[_0xc207('0x16')]||0x0;this[_0xc207('0x7')]=_0x19b297[_0xc207('0x7')]||0x0;this['invalid']=_0x19b297['invalid']||0x0;this['loggedIn']=_0x19b297[_0xc207('0x0')]||0x0;this[_0xc207('0x1')]=_0x19b297[_0xc207('0x1')]||0x0;this[_0xc207('0x17')]=_0x19b297['onHold']||0x0;this[_0xc207('0x18')]=_0x19b297[_0xc207('0x18')]||0x0;this[_0xc207('0x2')]=_0x19b297['paused']||0x0;this[_0xc207('0x3')]=_0x19b297['ringing']||0x0;this[_0xc207('0x19')]=_0x19b297[_0xc207('0x19')];this[_0xc207('0x11')]=_0x19b297[_0xc207('0x11')];this[_0xc207('0x1a')]=_0x19b297[_0xc207('0x1a')];this[_0xc207('0x1b')]=_0x19b297[_0xc207('0x1b')]||0x0;this[_0xc207('0x4')]=_0x19b297[_0xc207('0x4')]||0x0;this[_0xc207('0x1c')]=_0x19b297[_0xc207('0x1c')]||0x0;this[_0xc207('0x1d')]=_0x19b297['type'];this[_0xc207('0x1e')]=_0x19b297['unavailable']||0x0;this[_0xc207('0x1f')]=_0x19b297[_0xc207('0x1f')]||0x0;this[_0xc207('0x20')]=_0x19b297[_0xc207('0x20')]||0x0;this[_0xc207('0x5')]=_0x19b297[_0xc207('0x5')]||0x0;if(_0x19b297[_0xc207('0x1d')]===_0xc207('0x21')){this[_0xc207('0x10')]=_0x19b297[_0xc207('0x10')]||0x0;this[_0xc207('0x22')]=_0x19b297[_0xc207('0x22')];this[_0xc207('0x23')]=_0x19b297[_0xc207('0x23')];this[_0xc207('0x24')]=_0x19b297['dialOriginateCallerIdName'];this[_0xc207('0x25')]=_0x19b297['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x19b297[_0xc207('0x26')];this[_0xc207('0x27')]=_0x19b297[_0xc207('0x27')];this[_0xc207('0x28')]=_0x19b297[_0xc207('0x28')];this['outboundAnswerAgiCallsDay']=_0x19b297[_0xc207('0x29')];this[_0xc207('0x9')]=_0x19b297[_0xc207('0x9')];this[_0xc207('0xa')]=_0x19b297[_0xc207('0xa')];this[_0xc207('0x2a')]=_0x19b297[_0xc207('0x2a')];this[_0xc207('0xb')]=_0x19b297[_0xc207('0xb')];this[_0xc207('0x2b')]=_0x19b297[_0xc207('0x2b')];this[_0xc207('0x2c')]=_0x19b297[_0xc207('0x2c')];this['outboundDropCallsDayTimeout']=_0x19b297[_0xc207('0x2d')];this[_0xc207('0xc')]=_0x19b297[_0xc207('0xc')];this[_0xc207('0xd')]=_0x19b297[_0xc207('0xd')];this[_0xc207('0x2e')]=_0x19b297['outboundOriginateFailureCallsDay'];this[_0xc207('0x2f')]=_0x19b297[_0xc207('0x2f')];this[_0xc207('0xe')]=_0x19b297[_0xc207('0xe')];this['outboundUnknownCallsDay']=_0x19b297[_0xc207('0xf')];this[_0xc207('0x30')]=_0x19b297[_0xc207('0x30')];this[_0xc207('0x31')]=_0x19b297[_0xc207('0x31')];this[_0xc207('0x32')]=_0x19b297[_0xc207('0x32')];this[_0xc207('0x33')]=_0x19b297[_0xc207('0x33')];this['predictiveIntervalDroppedCallsTimeout']=_0x19b297['predictiveIntervalDroppedCallsTimeout'];this[_0xc207('0x34')]=_0x19b297[_0xc207('0x34')];this[_0xc207('0x35')]=_0x19b297[_0xc207('0x35')];this['predictiveIntervalHitRate']=_0x19b297[_0xc207('0x36')];this[_0xc207('0x37')]=_0x19b297[_0xc207('0x37')];this[_0xc207('0x38')]=_0x19b297[_0xc207('0x38')];this['predictiveIntervalAvailable']=_0x19b297[_0xc207('0x39')];this[_0xc207('0x3a')]=_0x19b297['predictiveIntervalTotalCalls'];this[_0xc207('0x3b')]=_0x19b297['originated'];this[_0xc207('0x3c')]=_0x19b297[_0xc207('0x3c')];this['erlangCallToSecond']=_0x19b297[_0xc207('0x3d')];this[_0xc207('0x3e')]=_0x19b297[_0xc207('0x3e')];this['erlangBusyFactor']=_0x19b297['erlangBusyFactor'];this[_0xc207('0x3f')]=_0x19b297[_0xc207('0x3f')];this[_0xc207('0x40')]=_0x19b297[_0xc207('0x40')];this['message']=_0x19b297[_0xc207('0x41')];this['statusMessage']=_0x19b297['statusMessage'];}if(_0x19b297['Trunk']){this['Trunk']={'id':_0x19b297[_0xc207('0x42')]['id'],'name':_0x19b297[_0xc207('0x42')][_0xc207('0x12')],'active':_0x19b297['Trunk'][_0xc207('0x43')],'callerid':_0x19b297[_0xc207('0x42')][_0xc207('0x44')]};}}VoiceQueueSummary[_0xc207('0x45')]['createReport']=function(_0x47d43a,_0x223349,_0x123a46,_0x46aa9f){this[_0xc207('0x1')]=0x0;this['talking']=0x0;this[_0xc207('0x2')]=0x0;this[_0xc207('0x1f')]=0x0;this[_0xc207('0x18')]=0x0;this[_0xc207('0x7')]=0x0;this[_0xc207('0x16')]=0x0;this[_0xc207('0x46')]=0x0;this[_0xc207('0x1e')]=0x0;this[_0xc207('0x3')]=0x0;this[_0xc207('0x19')]=0x0;this['onHold']=0x0;if(_0x123a46){if(_0x123a46[_0xc207('0x6')]){this[_0xc207('0x6')]=Number(_0x123a46['available']);}if(_0x123a46[_0xc207('0x47')]){this[_0xc207('0x0')]=Number(_0x123a46[_0xc207('0x47')]);}if(_0x123a46[_0xc207('0x48')]){this[_0xc207('0x5')]=Number(_0x123a46['callers']);}}for(var _0x11989b=0x0;_0x11989b<_0x47d43a[_0xc207('0x49')];_0x11989b++){var _0x17da25=_0x223349['SIP/'+_0x47d43a[_0x11989b][_0xc207('0x12')]];if(_0x17da25&&_0x17da25[_0xc207('0x4a')]){this[_0xc207('0x1')]+=0x1;}if(_0x47d43a[_0x11989b][_0xc207('0x4b')]==='1'){this['talking']+=0x1;}if(_0x47d43a[_0x11989b]['paused']==='1'&&!['2','7','8'][_0xc207('0x4c')](_0x47d43a[_0x11989b][_0xc207('0x4d')])){this[_0xc207('0x2')]+=0x1;}switch(_0x47d43a[_0x11989b][_0xc207('0x4d')]){case'0':this[_0xc207('0x1f')]+=0x1;break;case'1':this[_0xc207('0x18')]+=0x1;break;case'2':this[_0xc207('0x7')]+=0x1;break;case'3':this[_0xc207('0x16')]+=0x1;break;case'4':this[_0xc207('0x46')]+=0x1;break;case'5':this[_0xc207('0x1e')]+=0x1;break;case'6':this[_0xc207('0x3')]+=0x1;break;case'7':this[_0xc207('0x19')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this['dialMethod']===_0xc207('0x4e')){var _0xb39172=Object[_0xc207('0x4f')](_0x46aa9f);for(var _0x480f12=0x0;_0x480f12<_0xb39172[_0xc207('0x49')];_0x480f12++){var _0x3f712d=_0xb39172[_0x480f12];var _0x1beb3c=_0x46aa9f[_0x3f712d];if(_0x1beb3c[_0xc207('0x50')]===this['name']&&_0x1beb3c[_0xc207('0x1d')]==='dialer'&&_0x1beb3c[_0xc207('0x51')]==='xcally-motion-preview'){this['talking']+=0x1;}}if(this[_0xc207('0x4')]>this[_0xc207('0x7')]){this['talking']=this['inUse'];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xc207('0x45')][_0xc207('0x52')]=function(_0x1b887c){var _0x1acc33=![];if(_0x1b887c){_0x1acc33=INBOUND_COUNTERS[_0xc207('0x53')](function(_0x35e967){return this[_0x35e967]!==_0x1b887c[_0x35e967];},this);}return _0x1acc33;};VoiceQueueSummary[_0xc207('0x45')][_0xc207('0x54')]=function(_0x49d1bc){var _0x26bcfe=![];var _0x1435a9=![];var _0x5aedd3=![];if(_0x49d1bc){_0x26bcfe=this['dialMethod']!==_0x49d1bc[_0xc207('0x23')]||this['dialActive']!==_0x49d1bc['dialActive']||this[_0xc207('0x41')]!==_0x49d1bc[_0xc207('0x41')]||this[_0xc207('0x55')]!==_0x49d1bc[_0xc207('0x55')];_0x1435a9=OUTBOUND_COUNTERS[_0xc207('0x53')](function(_0x3b926e){return this[_0x3b926e]!==_0x49d1bc[_0x3b926e];},this);if(this[_0xc207('0x42')]&&_0x49d1bc[_0xc207('0x42')]){_0x5aedd3=this[_0xc207('0x42')][_0xc207('0x12')]!==_0x49d1bc[_0xc207('0x42')]['name']||this['Trunk'][_0xc207('0x43')]!==_0x49d1bc[_0xc207('0x42')][_0xc207('0x43')];}}return _0x26bcfe||_0x1435a9||_0x5aedd3;};VoiceQueueSummary[_0xc207('0x45')][_0xc207('0x56')]=function(_0x21c12b){this[_0xc207('0x15')]=_0x21c12b[_0xc207('0x15')];this[_0xc207('0x41')]=_0x21c12b['message'];this[_0xc207('0x55')]=_0x21c12b[_0xc207('0x55')];this[_0xc207('0x3b')]=_0x21c12b[_0xc207('0x3b')];this['outboundAbandonedCallsDay']=_0x21c12b[_0xc207('0x8')];this[_0xc207('0x9')]=_0x21c12b[_0xc207('0x9')];this[_0xc207('0xa')]=_0x21c12b[_0xc207('0xa')];this[_0xc207('0x2a')]=_0x21c12b[_0xc207('0x2a')];this['outboundCongestionCallsDay']=_0x21c12b[_0xc207('0xb')];this[_0xc207('0xc')]=_0x21c12b[_0xc207('0xc')];this[_0xc207('0xd')]=_0x21c12b['outboundNoSuchCallsDay'];this[_0xc207('0x2f')]=_0x21c12b['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x21c12b[_0xc207('0xe')];this[_0xc207('0xf')]=_0x21c12b[_0xc207('0xf')];this[_0xc207('0x11')]=_0x21c12b[_0xc207('0x11')];this[_0xc207('0x1a')]=_0x21c12b[_0xc207('0x1a')];this[_0xc207('0x1c')]=_0x21c12b[_0xc207('0x1c')];if(this[_0xc207('0x23')]===_0xc207('0x57')){this[_0xc207('0x10')]=_0x21c12b[_0xc207('0x10')];}};module[_0xc207('0x58')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 71dac37..b684046 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 _0xcb8a=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x5bf02f,_0x4839d4){var _0x5e2b7d=function(_0x10a040){while(--_0x10a040){_0x5bf02f['push'](_0x5bf02f['shift']());}};_0x5e2b7d(++_0x4839d4);}(_0xcb8a,0xb3));var _0xacb8=function(_0x4bb43e,_0x581622){_0x4bb43e=_0x4bb43e-0x0;var _0x3f7328=_0xcb8a[_0x4bb43e];return _0x3f7328;};'use strict';function VtigerAccount(_0x5bb56c){this['id']=_0x5bb56c['id']||0x0;this[_0xacb8('0x0')]=_0x5bb56c[_0xacb8('0x0')]||'';this[_0xacb8('0x1')]=_0x5bb56c[_0xacb8('0x1')]||'';this[_0xacb8('0x2')]=_0x5bb56c[_0xacb8('0x2')]||'';this[_0xacb8('0x3')]=_0x5bb56c[_0xacb8('0x3')]||'';this[_0xacb8('0x4')]=_0x5bb56c[_0xacb8('0x4')]||'';this[_0xacb8('0x5')]=_0x5bb56c[_0xacb8('0x5')]||{};}module[_0xacb8('0x6')]=VtigerAccount; \ No newline at end of file +var _0x8e5d=['Configurations','name','username','accessKey','remoteUri','serverUrl'];(function(_0x493b70,_0x168e73){var _0x4c2355=function(_0x1e0247){while(--_0x1e0247){_0x493b70['push'](_0x493b70['shift']());}};_0x4c2355(++_0x168e73);}(_0x8e5d,0x121));var _0xd8e5=function(_0x118653,_0x50ef26){_0x118653=_0x118653-0x0;var _0xc11fa6=_0x8e5d[_0x118653];return _0xc11fa6;};'use strict';function VtigerAccount(_0x1ab569){this['id']=_0x1ab569['id']||0x0;this[_0xd8e5('0x0')]=_0x1ab569[_0xd8e5('0x0')]||'';this['username']=_0x1ab569[_0xd8e5('0x1')]||'';this[_0xd8e5('0x2')]=_0x1ab569['accessKey']||'';this[_0xd8e5('0x3')]=_0x1ab569[_0xd8e5('0x3')]||'';this[_0xd8e5('0x4')]=_0x1ab569[_0xd8e5('0x4')]||'';this[_0xd8e5('0x5')]=_0x1ab569[_0xd8e5('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index f8da6d7..ec48799 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 _0xedce=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x3799c8,_0x502e11){var _0x2a2644=function(_0x5dc9ed){while(--_0x5dc9ed){_0x3799c8['push'](_0x3799c8['shift']());}};_0x2a2644(++_0x502e11);}(_0xedce,0x19c));var _0xeedc=function(_0x5c625c,_0x48a028){_0x5c625c=_0x5c625c-0x0;var _0xa145af=_0xedce[_0x5c625c];return _0xa145af;};'use strict';function ZendeskAccount(_0x219391){this['id']=_0x219391['id']||0x0;this[_0xeedc('0x0')]=_0x219391[_0xeedc('0x0')]||'';this['username']=_0x219391[_0xeedc('0x1')]||'';this[_0xeedc('0x2')]=_0x219391[_0xeedc('0x2')]||'';this['token']=_0x219391[_0xeedc('0x3')]||'';this[_0xeedc('0x4')]=_0x219391[_0xeedc('0x4')]||'';this[_0xeedc('0x5')]=_0x219391[_0xeedc('0x5')]||'';this['type']=_0x219391[_0xeedc('0x6')]||_0xeedc('0x7');this[_0xeedc('0x8')]=_0x219391[_0xeedc('0x8')]||'';this[_0xeedc('0x9')]=_0x219391[_0xeedc('0x9')]||{};}module[_0xeedc('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x8b26=['integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri','authType','type'];(function(_0x5ad4e8,_0x3f9c9d){var _0x33e5cd=function(_0x208573){while(--_0x208573){_0x5ad4e8['push'](_0x5ad4e8['shift']());}};_0x33e5cd(++_0x3f9c9d);}(_0x8b26,0xcb));var _0x68b2=function(_0x4afc33,_0x5088fd){_0x4afc33=_0x4afc33-0x0;var _0x448b1c=_0x8b26[_0x4afc33];return _0x448b1c;};'use strict';function ZendeskAccount(_0x40f24e){this['id']=_0x40f24e['id']||0x0;this[_0x68b2('0x0')]=_0x40f24e['name']||'';this[_0x68b2('0x1')]=_0x40f24e[_0x68b2('0x1')]||'';this[_0x68b2('0x2')]=_0x40f24e[_0x68b2('0x2')]||'';this[_0x68b2('0x3')]=_0x40f24e['token']||'';this[_0x68b2('0x4')]=_0x40f24e['remoteUri']||'';this['authType']=_0x40f24e[_0x68b2('0x5')]||'';this[_0x68b2('0x6')]=_0x40f24e['type']||_0x68b2('0x7');this[_0x68b2('0x8')]=_0x40f24e['serverUrl']||'';this[_0x68b2('0x9')]=_0x40f24e[_0x68b2('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index aab6caf..5e6574c 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 _0xb12a=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x12526b,_0x40cb64){var _0x42a64c=function(_0x47b955){while(--_0x47b955){_0x12526b['push'](_0x12526b['shift']());}};_0x42a64c(++_0x40cb64);}(_0xb12a,0x1c3));var _0xab12=function(_0x53e7a6,_0x52d1f0){_0x53e7a6=_0x53e7a6-0x0;var _0x1a6407=_0xb12a[_0x53e7a6];return _0x1a6407;};'use strict';function ZohoAccount(_0x27b883){this['id']=_0x27b883['id']||0x0;this[_0xab12('0x0')]=_0x27b883[_0xab12('0x0')]||'';this[_0xab12('0x1')]=_0x27b883['description']||'';this[_0xab12('0x2')]=_0x27b883[_0xab12('0x2')]||'';this[_0xab12('0x3')]=_0x27b883[_0xab12('0x3')]||'';this[_0xab12('0x4')]=_0x27b883['clientId']||'';this['clientSecret']=_0x27b883[_0xab12('0x5')]||'';this[_0xab12('0x6')]=_0x27b883[_0xab12('0x6')]||'';this[_0xab12('0x7')]=_0x27b883[_0xab12('0x7')]||'';this[_0xab12('0x8')]=_0x27b883['refreshToken']||'';this[_0xab12('0x9')]=_0x27b883[_0xab12('0x9')]||{};}module[_0xab12('0xa')]=ZohoAccount; \ No newline at end of file +var _0x09dd=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x09dd,0x15e));var _0xd09d=function(_0x4cd22f,_0x57c3ea){_0x4cd22f=_0x4cd22f-0x0;var _0x2342d3=_0x09dd[_0x4cd22f];return _0x2342d3;};'use strict';function ZohoAccount(_0x13c1df){this['id']=_0x13c1df['id']||0x0;this[_0xd09d('0x0')]=_0x13c1df[_0xd09d('0x0')]||'';this['description']=_0x13c1df[_0xd09d('0x1')]||'';this[_0xd09d('0x2')]=_0x13c1df[_0xd09d('0x2')]||'';this[_0xd09d('0x3')]=_0x13c1df[_0xd09d('0x3')]||'';this[_0xd09d('0x4')]=_0x13c1df['clientId']||'';this[_0xd09d('0x5')]=_0x13c1df[_0xd09d('0x5')]||'';this['serverUrl']=_0x13c1df[_0xd09d('0x6')]||'';this['code']=_0x13c1df[_0xd09d('0x7')]||'';this[_0xd09d('0x8')]=_0x13c1df[_0xd09d('0x8')]||'';this[_0xd09d('0x9')]=_0x13c1df['Configurations']||{};}module[_0xd09d('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 e60a75c..607b86b 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 _0x77e6=['VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','callback','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x3d6f87,_0x379d4c){var _0x48620e=function(_0x5d0228){while(--_0x5d0228){_0x3d6f87['push'](_0x3d6f87['shift']());}};_0x48620e(++_0x379d4c);}(_0x77e6,0x1a6));var _0x677e=function(_0x1f21b0,_0x20eb66){_0x1f21b0=_0x1f21b0-0x0;var _0x241097=_0x77e6[_0x1f21b0];return _0x241097;};'use strict';var util=require(_0x677e('0x0'));var _=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));function checkNameSurname(_0xa48f0c,_0x2dba41,_0x3a0a0e){var _0x4142a3='';if(!_[_0x677e('0x3')](_0x2dba41)&&'string'===typeof _0x2dba41){_0x4142a3+=_0x2dba41;}if(!_[_0x677e('0x3')](_0x3a0a0e)&&_0x677e('0x4')===typeof _0x3a0a0e){_0x4142a3+='\x20'+_0x3a0a0e;}if(_0x4142a3!==''){return _0x4142a3;}return _0xa48f0c;}function Action(_0x52e3f9,_0x18c5e1,_0x591b21,_0x40d314,_0x4d1a57){this['uniqueid']=_0x591b21||undefined;this[_0x677e('0x5')]=_0x52e3f9['id'];this[_0x677e('0x6')]=_0x18c5e1[_0x677e('0x7')];this[_0x677e('0x8')]=_0x18c5e1['type'];this[_0x677e('0x9')]='queue';this[_0x677e('0xa')]=![];this[_0x677e('0xb')]=_[_0x677e('0x3')](_0x52e3f9[_0x677e('0xc')])?undefined:_0x52e3f9[_0x677e('0xc')][_0x677e('0x7')];this[_0x677e('0xd')]=this[_0x677e('0xb')]?util[_0x677e('0xe')](_0x677e('0xf'),this[_0x677e('0xb')]):_0x40d314||undefined;this[_0x677e('0x10')]=checkNameSurname(_0x52e3f9[_0x677e('0x11')][_0x677e('0x12')],_0x52e3f9['Contact']['firstName'],_0x52e3f9['Contact'][_0x677e('0x13')]);this[_0x677e('0x14')]=_0x52e3f9[_0x677e('0x14')]||![];this[_0x677e('0x15')]=_0x52e3f9[_0x677e('0x12')];this[_0x677e('0x16')]=_0x52e3f9[_0x677e('0x16')];this[_0x677e('0x17')]=_0x52e3f9[_0x677e('0x17')]||0x0;this[_0x677e('0x18')]=_0x52e3f9[_0x677e('0x18')]||0x0;this[_0x677e('0x19')]=_0x52e3f9['countnoanswerretry']||0x0;this[_0x677e('0x1a')]=(_0x52e3f9[_0x677e('0x17')]||0x0)+(_0x52e3f9[_0x677e('0x18')]||0x0)+(_0x52e3f9[_0x677e('0x19')]||0x0)+(_0x52e3f9[_0x677e('0x1b')]||0x0)+(_0x52e3f9[_0x677e('0x1c')]||0x0)+(_0x52e3f9['countabandonedretry']||0x0)+(_0x52e3f9[_0x677e('0x1d')]||0x0)+(_0x52e3f9['countagentrejectretry']||0x0);this[_0x677e('0x1b')]=_0x52e3f9[_0x677e('0x1b')]||0x0;this[_0x677e('0x1c')]=_0x52e3f9['countdropretry']||0x0;this[_0x677e('0x1e')]=_0x52e3f9[_0x677e('0x1e')]||0x0;this[_0x677e('0x1d')]=_0x52e3f9[_0x677e('0x1d')]||0x0;this[_0x677e('0x1f')]=_0x52e3f9[_0x677e('0x1f')]||0x0;this[_0x677e('0x20')]=_0x52e3f9['callback'];this['callbackuniqueid']=_0x52e3f9['callbackuniqueid'];this[_0x677e('0x21')]=_0x52e3f9[_0x677e('0x21')];this[_0x677e('0x22')]=_0x52e3f9[_0x677e('0x22')];this[_0x677e('0x23')]=_0x52e3f9[_0x677e('0x23')];this[_0x677e('0x24')]=_0x52e3f9[_0x677e('0x24')];this[_0x677e('0x25')]=_[_0x677e('0x3')](_0x52e3f9['Agent'])?_0x52e3f9['UserId']:_0x52e3f9[_0x677e('0xc')]['id'];this[_0x677e('0x26')]=_0x52e3f9['VoiceQueueId'];this[_0x677e('0x27')]='';this[_0x677e('0x28')]='';}Action[_0x677e('0x29')][_0x677e('0x2a')]=function(){return util[_0x677e('0xe')](_0x677e('0x2b'),this['calleridname'],this[_0x677e('0x2c')]);};module[_0x677e('0x2d')]=Action; \ No newline at end of file +var _0xf61e=['phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','channelAgent','format','SIP/%s','Contact','firstName','lastName','active','calleridnum'];(function(_0x2fe85a,_0x28c346){var _0x468e0f=function(_0x515887){while(--_0x515887){_0x2fe85a['push'](_0x2fe85a['shift']());}};_0x468e0f(++_0x28c346);}(_0xf61e,0x191));var _0xef61=function(_0x5de942,_0x2b9bec){_0x5de942=_0x5de942-0x0;var _0x3fde74=_0xf61e[_0x5de942];return _0x3fde74;};'use strict';var util=require(_0xef61('0x0'));var _=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));function checkNameSurname(_0xcf15bd,_0x205269,_0xeccd26){var _0x3613e6='';if(!_[_0xef61('0x3')](_0x205269)&&_0xef61('0x4')===typeof _0x205269){_0x3613e6+=_0x205269;}if(!_[_0xef61('0x3')](_0xeccd26)&&_0xef61('0x4')===typeof _0xeccd26){_0x3613e6+='\x20'+_0xeccd26;}if(_0x3613e6!==''){return _0x3613e6;}return _0xcf15bd;}function Action(_0x45a18d,_0x5b00b2,_0x9e17f4,_0x3e2f79,_0x4f0cc5){this[_0xef61('0x5')]=_0x9e17f4||undefined;this[_0xef61('0x6')]=_0x45a18d['id'];this[_0xef61('0x7')]=_0x5b00b2['name'];this['type']=_0x5b00b2[_0xef61('0x8')];this[_0xef61('0x9')]=_0xef61('0x7');this[_0xef61('0xa')]=![];this[_0xef61('0xb')]=_[_0xef61('0x3')](_0x45a18d[_0xef61('0xc')])?undefined:_0x45a18d[_0xef61('0xc')][_0xef61('0xd')];this[_0xef61('0xe')]=this[_0xef61('0xb')]?util[_0xef61('0xf')](_0xef61('0x10'),this[_0xef61('0xb')]):_0x3e2f79||undefined;this['calleridname']=checkNameSurname(_0x45a18d[_0xef61('0x11')]['phone'],_0x45a18d[_0xef61('0x11')][_0xef61('0x12')],_0x45a18d[_0xef61('0x11')][_0xef61('0x13')]);this['active']=_0x45a18d[_0xef61('0x14')]||![];this[_0xef61('0x15')]=_0x45a18d[_0xef61('0x16')];this[_0xef61('0x17')]=_0x45a18d['scheduledat'];this[_0xef61('0x18')]=_0x45a18d[_0xef61('0x18')]||0x0;this['countcongestionretry']=_0x45a18d[_0xef61('0x19')]||0x0;this[_0xef61('0x1a')]=_0x45a18d[_0xef61('0x1a')]||0x0;this[_0xef61('0x1b')]=(_0x45a18d[_0xef61('0x18')]||0x0)+(_0x45a18d[_0xef61('0x19')]||0x0)+(_0x45a18d[_0xef61('0x1a')]||0x0)+(_0x45a18d['countnosuchnumberretry']||0x0)+(_0x45a18d[_0xef61('0x1c')]||0x0)+(_0x45a18d[_0xef61('0x1d')]||0x0)+(_0x45a18d['countmachineretry']||0x0)+(_0x45a18d[_0xef61('0x1e')]||0x0);this[_0xef61('0x1f')]=_0x45a18d[_0xef61('0x1f')]||0x0;this[_0xef61('0x1c')]=_0x45a18d[_0xef61('0x1c')]||0x0;this[_0xef61('0x1d')]=_0x45a18d[_0xef61('0x1d')]||0x0;this['countmachineretry']=_0x45a18d['countmachineretry']||0x0;this[_0xef61('0x1e')]=_0x45a18d['countagentrejectretry']||0x0;this[_0xef61('0x20')]=_0x45a18d['callback'];this['callbackuniqueid']=_0x45a18d[_0xef61('0x21')];this['callbackat']=_0x45a18d['callbackat'];this[_0xef61('0x22')]=_0x45a18d[_0xef61('0x22')];this[_0xef61('0x23')]=_0x45a18d[_0xef61('0x23')];this['ListId']=_0x45a18d[_0xef61('0x24')];this['UserId']=_[_0xef61('0x3')](_0x45a18d[_0xef61('0xc')])?_0x45a18d[_0xef61('0x25')]:_0x45a18d[_0xef61('0xc')]['id'];this[_0xef61('0x26')]=_0x45a18d[_0xef61('0x26')];this[_0xef61('0x27')]='';this[_0xef61('0x28')]='';}Action[_0xef61('0x29')][_0xef61('0x2a')]=function(){return util[_0xef61('0xf')](_0xef61('0x2b'),this[_0xef61('0x2c')],this[_0xef61('0x2d')]);};module[_0xef61('0x2e')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index aa09a0d..237c4ad 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 _0x849d=['sendMessageOneNotActive','pTalking','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','\x20is\x20not\x20active','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20deactivated','syncCampaigns','prototype','hasOwnProperty','dialMethod','booked','type','outbound','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','queue','originated','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','format','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','activeContact','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','[syncHangup][talking][increment]','\x20Queue','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','sumBillable','[syncHangup][talking][decrement]','uniqueid','linkedid','BUSY','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][machine]','decrementTalkink','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','called','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','active','SIP/%s','status','reachable','unmonitored','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','dialPrefix','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridName','originatecalleridnum','assign','merge','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','isFailure','response','custom:agentringnoanswer','rejected','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','addVariable','filterKey','variable','keys','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','redis','defaults','localhost','socket.io-emitter','tail','finally','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','name','voice_queue_channel:remove','voice_queue_presence:remove'];(function(_0x3403d5,_0x3d99fc){var _0xf9df4f=function(_0x33d748){while(--_0x33d748){_0x3403d5['push'](_0x3403d5['shift']());}};_0xf9df4f(++_0x3d99fc);}(_0x849d,0x11f));var _0xd849=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x849d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xd849('0x0'));var _=require(_0xd849('0x1'));var uuid=require(_0xd849('0x2'));var moment=require(_0xd849('0x3'));var Redis=require(_0xd849('0x4'));var config=require('../../../config/environment');var logger=require(_0xd849('0x5'))(_0xd849('0x6'));var loggerAction=require('../../../config/logger')(_0xd849('0x7'));var ami=require('../ami');var rpcDb=require(_0xd849('0x8'));var cmHopperAdditionalPhone=require(_0xd849('0x9'));var Action=require('./action');var ut=require(_0xd849('0xa'));var utils=require('../dialer/utils');config[_0xd849('0xb')]=_[_0xd849('0xc')](config[_0xd849('0xb')],{'host':_0xd849('0xd'),'port':0x18eb});var io=require(_0xd849('0xe'))(new Redis(config[_0xd849('0xb')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x583c01){this[_0xd849('0xf')]=this['tail']?this[_0xd849('0xf')][_0xd849('0x10')](_0x583c01):_0x583c01();};function Preview(_0x3a017e){this['sequence']=new Sequence();this[_0xd849('0x11')]=_0x3a017e['voiceQueues'];this['trunks']=_0x3a017e[_0xd849('0x12')];this[_0xd849('0x13')]={};this['agents']=_0x3a017e[_0xd849('0x14')];this[_0xd849('0x15')]=0x0;ami['on'](_0xd849('0x16'),this[_0xd849('0x17')][_0xd849('0x18')](this));ami['on']('hangup',this[_0xd849('0x19')][_0xd849('0x18')](this));ami['on'](_0xd849('0x1a'),this[_0xd849('0x1b')]['bind'](this));ami['on'](_0xd849('0x1c'),this[_0xd849('0x1d')][_0xd849('0x18')](this));ami['on'](_0xd849('0x1e'),this[_0xd849('0x1f')][_0xd849('0x18')](this));ami['on'](_0xd849('0x20'),this[_0xd849('0x21')][_0xd849('0x18')](this));ami['on'](_0xd849('0x22'),this[_0xd849('0x23')][_0xd849('0x18')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xd849('0x18')](this));this[_0xd849('0x24')](this[_0xd849('0x11')]);}function emit(_0x26cecd,_0x495dc4,_0x379301){io['to'](_0x26cecd)[_0xd849('0x25')](_0x495dc4,_0x379301);}function emitVoiceQueueChannelRemove(_0x3e6095){logger[_0xd849('0x26')](_0xd849('0x27'),JSON[_0xd849('0x28')](_0x3e6095));emit(util['format']('voice:queue:%s',_0x3e6095[_0xd849('0x29')]),_0xd849('0x2a'),_0x3e6095);io[_0xd849('0x25')](_0xd849('0x2b'),_0x3e6095);}function notSendMessagesQueue(_0x3b73cb){if(_0x3b73cb[_0xd849('0x2c')]){if(_0x3b73cb['originated']===0x0&&_0x3b73cb[_0xd849('0x2d')]===0x0){_0x3b73cb[_0xd849('0x2c')]=![];_0x3b73cb[_0xd849('0x2e')]=0x0;_0x3b73cb[_0xd849('0x2f')]=0x0;_0x3b73cb[_0xd849('0x30')]=utils[_0xd849('0x31')][_0xd849('0x32')];ut[_0xd849('0x33')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3b73cb[_0xd849('0x29')]+_0xd849('0x34'));}else{_0x3b73cb[_0xd849('0x30')]=utils[_0xd849('0x31')][_0xd849('0x35')];ut['logger'](_0xd849('0x36'),_0x3b73cb[_0xd849('0x29')]+_0xd849('0x37'));}}}Preview['prototype'][_0xd849('0x24')]=function(){var _0x45d018=this;setInterval(function(){_0x45d018[_0xd849('0x38')]();},0x7cf);};Preview[_0xd849('0x39')][_0xd849('0x38')]=function(){var _0x593147=this[_0xd849('0x11')];this[_0xd849('0x15')]+=0x1;for(var _0x209df4 in _0x593147){if(_0x593147[_0xd849('0x3a')](_0x209df4)&&(_0x593147[_0x209df4][_0xd849('0x3b')]==='preview'||_0x593147[_0x209df4][_0xd849('0x3b')]===_0xd849('0x3c'))&&_0x593147[_0x209df4][_0xd849('0x3d')]===_0xd849('0x3e')){if(this[_0xd849('0x15')]>0x7){this[_0xd849('0x15')]=0x0;this[_0xd849('0x3f')]();}}if(_0x593147[_0xd849('0x3a')](_0x209df4)&&_0x593147[_0x209df4][_0xd849('0x3b')]===_0xd849('0x6')&&_0x593147[_0x209df4][_0xd849('0x3d')]===_0xd849('0x3e')){if(_0x593147[_0x209df4][_0xd849('0x40')]){this[_0xd849('0x41')](_0x593147[_0x209df4]);if(_0x593147[_0x209df4][_0xd849('0x42')])this[_0xd849('0x43')](_0x593147[_0x209df4]);}else{notSendMessagesQueue(_0x593147[_0x209df4]);}}}};Preview[_0xd849('0x39')][_0xd849('0x44')]=function(_0x209331){var _0x3644af=this;this['sequence'][_0xd849('0x45')](function(){if(!_[_0xd849('0x46')](_0x3644af[_0xd849('0x13')][_0x209331])){loggerAction[_0xd849('0x26')](_0xd849('0x47'),_0x209331,'Queue',_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x48')],'originated:\x20',JSON[_0xd849('0x28')](_0x3644af['campaignsPreview'][_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x48')]][_0xd849('0x49')]),_0xd849('0x4a'),JSON[_0xd849('0x28')](_0x3644af[_0xd849('0x11')][_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x48')]][_0xd849('0x2d')]),JSON['stringify'](_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x4b')]),JSON[_0xd849('0x28')](_[_0xd849('0x4c')](_0x3644af['actions'][_0x209331],[_0xd849('0x4d'),_0xd849('0x4e'),_0xd849('0x4f'),'ListId'])));return ami[_0xd849('0x50')]({'action':'status','channel':_0x3644af['actions'][_0x209331][_0xd849('0x51')]})[_0xd849('0x52')](function(_0x5bce8c){if(_0x5bce8c[_0xd849('0x30')]===_0xd849('0x53')){setTimeout(function(){if(_0x3644af[_0xd849('0x13')][_0x209331]){ut[_0xd849('0x54')](_0x3644af[_0xd849('0x11')][_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x48')]],_0xd849('0x55'));if(_0x3644af[_0xd849('0x13')][_0x209331]['dialAnswer']===!![]){ut['decrementTalkink'](_0x3644af['campaignsPreview'][_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x48')]],_0xd849('0x55'));ut['loggerError'](_0xd849('0x56')+_0x209331,_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x48')]);}ut['loggerError'](_0xd849('0x57')+_0x209331,_0x3644af['actions'][_0x209331][_0xd849('0x48')]);delete _0x3644af[_0xd849('0x13')][_0x209331];}},0x2328);}});}});};Preview[_0xd849('0x39')]['clearZombieChannels']=function(){var _0x97beea=this;loggerAction[_0xd849('0x26')](_0xd849('0x58'),_[_0xd849('0x59')](this[_0xd849('0x13')]));for(var _0x1d0571 in this[_0xd849('0x13')]){if(_0x97beea[_0xd849('0x13')]['hasOwnProperty'](_0x1d0571)){_0x97beea[_0xd849('0x44')](_0x1d0571);}}};Preview[_0xd849('0x39')][_0xd849('0x43')]=function(_0x35e4bb){var _0x27f345=this;rpcDb['getContactRecallMe'](_0x35e4bb['id'],ut[_0xd849('0x5a')](this[_0xd849('0x14')]))[_0xd849('0x5b')](function(_0x51a7d0){if(!_[_0xd849('0x46')](_0x51a7d0)){for(var _0x2c1382=0x0;_0x2c1382<_0x51a7d0[_0xd849('0x5c')];_0x2c1382+=0x1){if(ut[_0xd849('0x5d')](_0x51a7d0[_0x2c1382]['scheduledat'])<_0x35e4bb[_0xd849('0x5e')]*0x3c){if(_0x51a7d0[_0x2c1382][_0xd849('0x5f')]&&!_0x51a7d0[_0x2c1382][_0xd849('0x5f')][_0xd849('0x60')]){_0x27f345[_0xd849('0x61')](_0x51a7d0[_0x2c1382]['id'])['then'](ut[_0xd849('0x62')](_0xd849('0x63')))[_0xd849('0x52')](ut[_0xd849('0x62')]('[RecallMe]'));}else{rpcDb[_0xd849('0x64')](_0x51a7d0[_0x2c1382]['id']);}}else{var _0x319304=new Action(_0x51a7d0[_0x2c1382],_0x35e4bb);_0x319304['starttime']=moment()[_0xd849('0x65')](_0xd849('0x66'));_0x35e4bb[_0xd849('0x67')]+=0x1;ut[_0xd849('0x68')](_0x319304,0x17,_0xd849('0x69'));if(_0x35e4bb[_0xd849('0x6a')]){rpcDb[_0xd849('0x6b')](ut[_0xd849('0x6c')](_0x51a7d0[_0x2c1382]));rpcDb[_0xd849('0x6d')](_0x319304,_0xd849('0x6e'));}else{ut[_0xd849('0x68')](_0x319304,0x16,_0xd849('0x6f'));rpcDb[_0xd849('0x6d')](_0x319304,_0xd849('0x70'));rpcDb[_0xd849('0x71')](_0x319304,_0xd849('0x70'));}}}}})['catch'](ut[_0xd849('0x62')]('[getContactRecallMe]'));};Preview[_0xd849('0x39')][_0xd849('0x41')]=function(_0x2a01c4){_0x2a01c4[_0xd849('0x2c')]=!![];if(ut[_0xd849('0x72')](_0x2a01c4[_0xd849('0x73')])){_0x2a01c4[_0xd849('0x30')]=utils['CAMPAIGN_STATUS'][_0xd849('0x74')];}else if(!ut[_0xd849('0x75')](_0x2a01c4[_0xd849('0x40')])){_0x2a01c4[_0xd849('0x30')]=utils[_0xd849('0x31')][_0xd849('0x32')];}else if(!this[_0xd849('0x76')](_0x2a01c4[_0xd849('0x77')])){if(!this['isTrunkReachable'](_0x2a01c4[_0xd849('0x78')])){_0x2a01c4['message']=utils[_0xd849('0x31')][_0xd849('0x79')];}else{_0x2a01c4['message']=utils[_0xd849('0x31')][_0xd849('0x7a')];}}else{_0x2a01c4[_0xd849('0x30')]=utils[_0xd849('0x31')]['ACTIVE'];}};Preview[_0xd849('0x39')][_0xd849('0x7b')]=function(_0x5b640d,_0xfc8599,_0x332a74){var _0x2d87dc=this;var _0x3082f7=this['actions'][_0xfc8599];var _0x259910=this[_0xd849('0x11')][_0x3082f7['queue']];var _0x3e3dd1;var _0x46c180=![];var _0x185ca1=0x2;var _0x37379c=0x3;if(_0x259910){switch(_0x332a74){case'1':_0x259910['outboundNoSuchCallsDay']+=0x1;_0x3082f7[_0xd849('0x7c')]+=0x1;_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x0,_0xd849('0x7f'));ami[_0xd849('0x25')](_0xd849('0x80'),ut[_0xd849('0x81')](_0x3082f7,_0xd849('0x82')));rpcDb[_0xd849('0x6d')](_0x3082f7,'[callProgressDetectingCustomer][logNoSuch]');_0x2d87dc[_0xd849('0x83')](_0x3082f7,'0',_0x259910)[_0xd849('0x5b')](function(_0x509ad6){_0x46c180=_0x509ad6[_0xd849('0x84')]==0x1;_0x185ca1=_0x259910[_0xd849('0x85')];_0x37379c=_0x259910[_0xd849('0x86')];if(!_0x46c180){if(ut['totalGlobal'](_0x3082f7)>=_0x259910[_0xd849('0x87')]){_0x3e3dd1=ut['cloneAction'](_0x3082f7,0xf,'Global');rpcDb[_0xd849('0x71')](_0x3e3dd1,_0xd849('0x88'));}else{if(_0x3082f7[_0xd849('0x7c')]>=_0x259910[_0xd849('0x89')]){rpcDb['createCustomerFinal'](_0x3082f7,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut[_0xd849('0x8a')](_0x3082f7,_0xd849('0x7c'),_0x259910[_0xd849('0x85')]),_0x3082f7['unlockAgent'],_0x3082f7[_0xd849('0x8b')]);}}delete this[_0xd849('0x13')][_0x5b640d['linkedid']];}else{_0x3082f7[_0xd849('0x7c')]++;logger[_0xd849('0x26')]('actioncountonusuch',_0x3082f7[_0xd849('0x7c')]);logger[_0xd849('0x26')]('id',_0x3082f7[_0xd849('0x8c')]);_0x2d87dc[_0xd849('0x8d')]({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countnosuchnumberretry':_0x3082f7['countnosuchnumberretry']}})[_0xd849('0x5b')](function(){_0x2d87dc[_0xd849('0x8e')](_0x3082f7,_0x185ca1,_0x37379c)[_0xd849('0x5b')](function(){});});}});break;case _0xd849('0x8f'):var _0x4dfb16=moment()[_0xd849('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x3082f7['responsetime']=_0x4dfb16;_0x3082f7['answertime']=_0x4dfb16;_0x3082f7[_0xd849('0x4b')]=!![];_0x259910[_0xd849('0x2d')]+=0x1;logger[_0xd849('0x26')](_0xd849('0x90'),_0x3082f7['uniqueid'],_0xd849('0x91'),_0x259910['name'],_0xd849('0x4a'),_0x259910[_0xd849('0x2d')]);ami[_0xd849('0x25')]('custom:agentconnect',ut[_0xd849('0x81')](_0x3082f7,_0xd849('0x92'),this['campaignsPreview'][_0x3082f7[_0xd849('0x48')]]));if(_0x259910['acw']){ami[_0xd849('0x25')](_0xd849('0x93'),ut[_0xd849('0x94')](_0x3082f7));}break;case'16':ami[_0xd849('0x25')](_0xd849('0x95'),ut[_0xd849('0x81')](_0x3082f7,_0xd849('0x96'),this[_0xd849('0x11')][_0x3082f7[_0xd849('0x48')]]));emitVoiceQueueChannelRemove(ut[_0xd849('0x81')](_0x3082f7,'complete'));_0x259910[_0xd849('0x97')]+=0x1;_0x259910[_0xd849('0x98')]+=0x1;_0x259910[_0xd849('0x99')]+=0x1;ut['decrementTalkink'](_0x259910,_0xd849('0x9a'));_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x4,_0xd849('0x9b'));rpcDb[_0xd849('0x6d')](_0x3082f7,_0xd849('0x9c'));rpcDb[_0xd849('0x71')](_0x3082f7,_0xd849('0x9d'));rpcDb['crateCustomerReportQueue'](_0x3082f7);_0x259910['sumDuration']+=_0x3082f7[_0xd849('0x9e')];_0x259910[_0xd849('0x9f')]+=_0x3082f7[_0xd849('0x9e')];logger[_0xd849('0x26')](_0xd849('0xa0'),_0x3082f7[_0xd849('0xa1')],'\x20Queue',_0x259910[_0xd849('0x29')],_0xd849('0x4a'),_0x259910['pTalking']);delete this['actions'][_0x5b640d[_0xd849('0xa2')]];break;case _0xd849('0xa3'):_0x259910['outboundBusyCallsDay']+=0x1;_0x3082f7[_0xd849('0xa4')]+=0x1;_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x5,_0xd849('0xa5'));_0x185ca1=_0x259910[_0xd849('0xa6')];_0x37379c=_0x259910[_0xd849('0x86')];ami[_0xd849('0x25')](_0xd849('0xa7'),ut[_0xd849('0x81')](_0x3082f7,_0xd849('0xa8')));rpcDb[_0xd849('0x6d')](_0x3082f7,_0xd849('0xa9'));_0x2d87dc[_0xd849('0x83')](_0x3082f7,'5',_0x259910)[_0xd849('0x5b')](function(_0x40657a){_0x46c180=_0x40657a[_0xd849('0x84')]==0x1;if(!_0x46c180){if(ut[_0xd849('0x7e')](_0x3082f7)>=_0x259910['dialGlobalMaxRetry']){_0x3e3dd1=ut[_0xd849('0xaa')](_0x3082f7,0xf,_0xd849('0xab'));rpcDb[_0xd849('0x71')](_0x3e3dd1,_0xd849('0xac'));}else{if(_0x3082f7['countbusyretry']>=_0x259910[_0xd849('0xad')]){rpcDb[_0xd849('0x71')](_0x3082f7,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xd849('0xae')](ut[_0xd849('0x8a')](_0x3082f7,_0xd849('0xa4'),_0x259910[_0xd849('0xa6')]),_0x3082f7[_0xd849('0xaf')],_0x3082f7[_0xd849('0x8b')]);}}}else{_0x3082f7[_0xd849('0xa4')]++;_0x2d87dc[_0xd849('0x8d')]({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countbusyretry':_0x3082f7[_0xd849('0xa4')]}})[_0xd849('0x5b')](function(){_0x2d87dc[_0xd849('0x8e')](_0x3082f7,_0x185ca1,_0x37379c)['then'](function(){});});}});break;case _0xd849('0xb0'):_0x259910[_0xd849('0xb1')]+=0x1;_0x3082f7['countnoanswerretry']+=0x1;_0x3082f7['countglobal']=ut[_0xd849('0x7e')](_0x3082f7);ut['logCustomer'](_0x3082f7,0x3,_0xd849('0xb2'));_0x185ca1=_0x259910[_0xd849('0xb3')];_0x37379c=_0x259910[_0xd849('0x86')];var _0x31ae06=ut[_0xd849('0xb4')](_0x3082f7,_0x259910);ami[_0xd849('0x25')](_0xd849('0xb5'),_0x31ae06);rpcDb['createCustomerHistory'](_0x3082f7,_0xd849('0xb6'));_0x2d87dc[_0xd849('0x83')](_0x3082f7,'3',_0x259910)['then'](function(_0x490d0a){_0x46c180=_0x490d0a['additional']==0x1;if(!_0x46c180){if(ut[_0xd849('0x7e')](_0x3082f7)>=_0x259910[_0xd849('0x87')]){_0x3e3dd1=ut[_0xd849('0xaa')](_0x3082f7,0xf,_0xd849('0xab'));rpcDb['createCustomerFinal'](_0x3e3dd1,_0xd849('0xb7'));}else{if(_0x3082f7[_0xd849('0xb8')]>=_0x259910[_0xd849('0xb9')]){rpcDb[_0xd849('0x71')](_0x3082f7,_0xd849('0xb6'));}else{rpcDb[_0xd849('0xae')](ut[_0xd849('0x8a')](_0x3082f7,_0xd849('0xb8'),_0x259910[_0xd849('0xb3')]),_0x3082f7['unlockAgent'],_0x3082f7[_0xd849('0x8b')]);}}}else{_0x3082f7[_0xd849('0xb8')]++;_0x2d87dc['incrementPreviewCounters']({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countnoanswerretry':_0x3082f7[_0xd849('0xb8')]}})['then'](function(){_0x2d87dc[_0xd849('0x8e')](_0x3082f7,_0x185ca1,_0x37379c)[_0xd849('0x5b')](function(){});});}});break;case _0xd849('0xba'):_0x259910[_0xd849('0xbb')]+=0x1;_0x3082f7[_0xd849('0xbc')]+=0x1;_0x3082f7['countglobal']=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x8,_0xd849('0xbd'));_0x185ca1=_0x259910[_0xd849('0xbe')];_0x37379c=_0x259910[_0xd849('0x86')];ami[_0xd849('0x25')]('custom:agentcongestion',ut[_0xd849('0x81')](_0x3082f7,'congestion'));rpcDb['createCustomerHistory'](_0x3082f7,_0xd849('0xbf'));_0x2d87dc[_0xd849('0x83')](_0x3082f7,'8',_0x259910)['then'](function(_0xad7dd3){_0x46c180=_0xad7dd3[_0xd849('0x84')]==0x1;if(!_0x46c180){if(ut[_0xd849('0x7e')](_0x3082f7)>=_0x259910['dialGlobalMaxRetry']){_0x3e3dd1=ut['cloneAction'](_0x3082f7,0xf,_0xd849('0xab'));rpcDb['createCustomerFinal'](_0x3e3dd1,_0xd849('0xc0'));}else{if(_0x3082f7['countcongestionretry']>=_0x259910['dialCongestionMaxRetry']){rpcDb[_0xd849('0x71')](_0x3082f7,_0xd849('0xbf'));}else{rpcDb['rescheduleContact'](ut[_0xd849('0x8a')](_0x3082f7,_0xd849('0xbc'),_0x259910[_0xd849('0xa6')]),_0x3082f7[_0xd849('0xaf')],_0x3082f7[_0xd849('0x8b')]);}}}else{_0x3082f7[_0xd849('0xbc')]++;_0x2d87dc['incrementPreviewCounters']({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countcongestionretry':_0x3082f7['countcongestionretry']}})[_0xd849('0x5b')](function(){_0x2d87dc[_0xd849('0x8e')](_0x3082f7,_0x185ca1,_0x37379c)[_0xd849('0x5b')](function(){});});}});break;case _0xd849('0xc1'):_0x259910[_0xd849('0xc2')]+=0x1;_0x3082f7[_0xd849('0xc3')]+=0x1;_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x14,_0xd849('0xc4'));_0x185ca1=_0x259910[_0xd849('0xc5')];_0x37379c=_0x259910[_0xd849('0x86')];ami[_0xd849('0x25')](_0xd849('0xc6'),ut['buildObj'](_0x3082f7,_0xd849('0xc7')));rpcDb[_0xd849('0x6d')](_0x3082f7,'[syncHangupRequest][logAgentReject]');_0x2d87dc[_0xd849('0x83')](_0x3082f7,'20',_0x259910)[_0xd849('0x5b')](function(_0x4aff54){_0x46c180=_0x4aff54['additional']==0x1;if(!_0x46c180){if(ut['totalGlobal'](_0x3082f7)>=_0x259910['dialGlobalMaxRetry']){_0x3e3dd1=ut[_0xd849('0xaa')](_0x3082f7,0x14,_0xd849('0xc4'));rpcDb[_0xd849('0x71')](_0x3e3dd1,_0xd849('0xc8'));}else{if(_0x3082f7[_0xd849('0xc3')]>=_0x259910[_0xd849('0xc9')]){rpcDb[_0xd849('0x71')](_0x3082f7,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xd849('0xae')](ut[_0xd849('0x8a')](_0x3082f7,_0xd849('0xc3'),_0x259910[_0xd849('0xc5')]),_0x3082f7[_0xd849('0xaf')],_0x3082f7[_0xd849('0x8b')]);}}}else{_0x3082f7['countnoanswerretry']++;_0x2d87dc[_0xd849('0x8d')]({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countnoanswerretry':_0x3082f7['countnoanswerretry']}})[_0xd849('0x5b')](function(){_0x2d87dc[_0xd849('0x8e')](_0x3082f7,_0x185ca1,_0x37379c)['then'](function(){});});}});break;case _0xd849('0xca'):_0x259910[_0xd849('0xcb')]+=0x1;_0x3082f7['countabandonedretry']+=0x1;_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0xb,_0xd849('0xcc'));rpcDb['createCustomerHistory'](_0x3082f7,_0xd849('0xcd'));_0x2d87dc['verifyAdditionalPhones'](_0x3082f7,'11',_0x259910)['then'](function(_0x4e2f71){_0x46c180=_0x4e2f71['additional']==0x1;if(!_0x46c180){if(ut['totalGlobal'](_0x3082f7)>=_0x259910[_0xd849('0x87')]){_0x3e3dd1=ut['cloneAction'](_0x3082f7,0xf,_0xd849('0xab'));rpcDb[_0xd849('0x71')](_0x3e3dd1,_0xd849('0xcd'));}else{if(_0x3082f7[_0xd849('0xce')]>=_0x259910[_0xd849('0xcf')]){rpcDb[_0xd849('0x71')](_0x3082f7,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0xd849('0x8a')](_0x3082f7,_0xd849('0xd0'),_0x259910[_0xd849('0xd1')]),_0x3082f7['unlockAgent'],_0x3082f7[_0xd849('0x8b')]);}}}else{_0x3082f7[_0xd849('0xb8')]++;_0x2d87dc[_0xd849('0x8d')]({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countnoanswerretry':_0x3082f7['countnoanswerretry']}})[_0xd849('0x5b')](function(){_0x2d87dc[_0xd849('0x8e')](_0x3082f7,_0x185ca1,_0x37379c)['then'](function(){});});}});break;case'18':_0x259910['outboundUnknownCallsDay']+=0x1;_0x3082f7[_0xd849('0xd2')]+=0x1;_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x12,_0x5b640d[_0xd849('0xd3')]||_0x5b640d['dialstatus']);ami[_0xd849('0x25')]('custom:amd',ut[_0xd849('0x81')](_0x3082f7,'amd'));rpcDb[_0xd849('0x6d')](_0x3082f7,_0xd849('0xd4'));_0x2d87dc[_0xd849('0x83')](_0x3082f7,'18',_0x259910)['then'](function(_0x1a0d9f){_0x46c180=_0x1a0d9f[_0xd849('0x84')]==0x1;if(!_0x46c180){if(ut['totalGlobal'](_0x3082f7)>=_0x259910['dialGlobalMaxRetry']){_0x3e3dd1=ut[_0xd849('0xaa')](_0x3082f7,0x12,_0xd849('0xab'));rpcDb[_0xd849('0x71')](_0x3e3dd1,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xd849('0x71')](_0x3082f7,_0xd849('0xd4'));}}else{_0x3082f7[_0xd849('0xb8')]++;_0x2d87dc['incrementPreviewCounters']({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countnoanswerretry':_0x3082f7[_0xd849('0xb8')]}})[_0xd849('0x5b')](function(){_0x2d87dc['swapAdditionalPhones'](_0x3082f7,_0x185ca1,_0x37379c)[_0xd849('0x5b')](function(){});});}});delete this[_0xd849('0x13')][_0x5b640d['linkedid']];break;case'19':_0x259910[_0xd849('0xd5')]+=0x1;_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x13,_0x5b640d[_0xd849('0xd3')]||_0x5b640d[_0xd849('0xd6')]);ami[_0xd849('0x25')](_0xd849('0xd7'),ut[_0xd849('0x81')](_0x3082f7,_0xd849('0xd8')));rpcDb['createCustomerHistory'](_0x3082f7,_0xd849('0xd9'));_0x2d87dc[_0xd849('0x83')](_0x3082f7,'18',_0x259910)[_0xd849('0x5b')](function(_0x2f8127){_0x46c180=_0x2f8127['additional']==0x1;if(!_0x46c180){if(ut[_0xd849('0x7e')](_0x3082f7)>=_0x259910['dialGlobalMaxRetry']){_0x3e3dd1=ut[_0xd849('0xaa')](_0x3082f7,0xf,'Global');rpcDb[_0xd849('0x71')](_0x3e3dd1,_0xd849('0xd9'));}else{rpcDb[_0xd849('0x71')](_0x3082f7,'[callProgressDetectingCustomer][machine]');}}else{_0x3082f7[_0xd849('0xb8')]++;_0x2d87dc['incrementPreviewCounters']({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countnoanswerretry':_0x3082f7[_0xd849('0xb8')]}})[_0xd849('0x5b')](function(){_0x2d87dc['swapAdditionalPhones'](_0x3082f7,_0x185ca1,_0x37379c)['then'](function(){});});}});delete this[_0xd849('0x13')][_0x5b640d[_0xd849('0xa2')]];break;default:if(_0x3082f7[_0xd849('0x4b')]){ut[_0xd849('0xda')](_0x259910,_0xd849('0xdb'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x259910[_0xd849('0x29')],_0x5b640d);}_0x259910[_0xd849('0xd5')]+=0x1;_0x3082f7[_0xd849('0x7d')]=ut['totalGlobal'](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0xc,_0x5b640d[_0xd849('0xd3')]||_0x5b640d[_0xd849('0xd6')]);_0x185ca1=_0x259910['dialAgentRejectRetryFrequency'];_0x37379c=_0x259910[_0xd849('0x86')];rpcDb[_0xd849('0x6d')](_0x3082f7,_0xd849('0xdc'));_0x2d87dc[_0xd849('0x83')](_0x3082f7,'20',_0x259910)['then'](function(_0x46e7ac){_0x46c180=_0x46e7ac[_0xd849('0x84')]==0x1;if(!_0x46c180){if(ut[_0xd849('0x7e')](_0x3082f7)>=_0x259910[_0xd849('0x87')]){_0x3e3dd1=ut[_0xd849('0xaa')](_0x3082f7,0xf,_0xd849('0xab'));rpcDb[_0xd849('0x71')](_0x3e3dd1,_0xd849('0xdd'));}else{rpcDb['createCustomerFinal'](_0x3082f7,_0xd849('0xdd'));}delete this[_0xd849('0x13')][_0x5b640d[_0xd849('0xa2')]];}else{_0x2d87dc['swapAdditionalPhones'](_0x3082f7,_0x185ca1,_0x37379c)[_0xd849('0x5b')](function(){});}});}if(!(_0x3082f7['dialAnswer']&&_0x332a74==='16')){ut['updateOriginated'](_0x259910,_0xd849('0xde'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x3082f7['uniqueid'],'\x20Queue',_0x259910[_0xd849('0x29')],'originated:\x20',_0x259910[_0xd849('0x49')]);}if(_0x332a74!==_0xd849('0x8f')){delete this[_0xd849('0x13')][_0x5b640d[_0xd849('0xa2')]];delete this['actions'][_0x5b640d[_0xd849('0xdf')]];}_0x259910[_0xd849('0xe0')]=!![];}};Preview[_0xd849('0x39')][_0xd849('0xe1')]=function(_0x29fb6b,_0x35c602,_0x27abb4){if(_[_0xd849('0xe2')](_0x35c602)&&'object'!==typeof _0x35c602){return;}if(_[_0xd849('0xe2')](_0x27abb4)&&_0xd849('0xe3')!==typeof _0x27abb4){return;}switch(_0x27abb4[_0xd849('0xe4')]){case'0':ut[_0xd849('0xe5')](_0x29fb6b,0x0,_0xd849('0x7f'));rpcDb['createAgentHistory'](_0x29fb6b,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xd849('0xe5')](_0x29fb6b,0x3,'NoAnswer');rpcDb[_0xd849('0xe6')](_0x29fb6b,_0xd849('0xe7'));break;case'5':ut[_0xd849('0xe5')](_0x29fb6b,0x5,_0xd849('0xa5'));rpcDb[_0xd849('0xe6')](_0x29fb6b,_0xd849('0xe8'));break;case'8':ut[_0xd849('0xe5')](_0x29fb6b,0x8,_0xd849('0xbd'));rpcDb[_0xd849('0xe6')](_0x29fb6b,_0xd849('0xe9'));break;case'22':ut[_0xd849('0xe5')](_0x29fb6b,0x16,_0xd849('0xea'));rpcDb[_0xd849('0xe6')](_0x29fb6b,_0xd849('0xeb'));break;default:ut[_0xd849('0xe5')](_0x29fb6b,0xc,_0x27abb4[_0xd849('0xe4')]);rpcDb[_0xd849('0xe6')](_0x29fb6b,_0xd849('0xe9'));}ut['updateOriginated'](_0x35c602,_0xd849('0xec'));logger[_0xd849('0x26')](_0xd849('0xed'),_0x29fb6b['uniqueid'],_0xd849('0x91'),_0x35c602['name'],_0xd849('0xee'),_0x35c602[_0xd849('0x49')]);delete this[_0xd849('0x13')][_0x29fb6b[_0xd849('0xa1')]];};Preview[_0xd849('0x39')][_0xd849('0x83')]=function(_0x232290,_0x4d6e2a,_0x3272f4){return cmHopperAdditionalPhone[_0xd849('0x83')](_0x232290,_0x4d6e2a,_0x3272f4)[_0xd849('0x52')](logger[_0xd849('0x26')](_0xd849('0xef')));};Preview[_0xd849('0x39')]['swapAdditionalPhones']=function(_0xbcc126,_0x2cdcde,_0x1f8639){return cmHopperAdditionalPhone[_0xd849('0x8e')](_0xbcc126,_0x2cdcde,_0x1f8639)[_0xd849('0x52')](logger[_0xd849('0x26')](_0xd849('0xf0')));};Preview[_0xd849('0x39')][_0xd849('0x8d')]=function(_0x2c6d3c){return Promise[_0xd849('0xf1')]()['then'](cmHopperAdditionalPhone[_0xd849('0x8d')](_0x2c6d3c))['catch'](logger[_0xd849('0x26')](_0xd849('0xf2')));};Preview[_0xd849('0x39')][_0xd849('0xf3')]=function(_0x9eb31,_0x327631,_0x2183fa,_0x5346a7,_0x104052){var _0x2df7ff=this;return new Promise(function(_0x2a3dec,_0x1ff489){if(_[_0xd849('0x46')](_0x327631)||_['isNil'](_0x327631[_0xd849('0xf4')])||_[_0xd849('0x46')](_0x327631[_0xd849('0xf5')])||_[_0xd849('0x46')](_0x327631[_0xd849('0x4f')])){_0x1ff489(ut[_0xd849('0x30')](_0xd849('0xf6'),_0x5346a7,_0x104052));return;}var _0x399d5d=uuid['v4']();var _0x341b43=_0x2df7ff[_0xd849('0x11')][_0x327631[_0xd849('0xf7')]['name']];var _0x2fb512=_0x2183fa?_0x2df7ff[_0xd849('0x14')][_0x2183fa]['id']:undefined;_0x2df7ff[_0xd849('0x13')][_0x399d5d]=new Action(_0x327631,_0x341b43,_0x399d5d,_0x2183fa,_0x2fb512);var _0x2b7215=_0x2df7ff[_0xd849('0x13')][_0x399d5d];_0x2b7215[_0xd849('0xaf')]=_0x5346a7;_0x2b7215[_0xd849('0x8b')]=_0x104052;_0x2b7215[_0xd849('0xf8')]=_0x2183fa;if(_[_0xd849('0xf9')](_0x9eb31)){_0x2df7ff[_0xd849('0xfa')](_0x2b7215,_0x341b43,_0x327631,_0x2183fa)['then'](function(_0x3362e6){logger[_0xd849('0x26')](_0xd849('0xfb'),'Queue:\x20'+_0x2b7215[_0xd849('0x48')]+_0xd849('0xfc')+_0x2b7215[_0xd849('0x8c')],JSON[_0xd849('0x28')](_0x3362e6));ami[_0xd849('0x25')]('custom:agentcalled',ut['buildObj'](_0x2b7215,_0xd849('0xfd'),_0x2df7ff[_0xd849('0x11')][_0x2b7215[_0xd849('0x48')]]));_0x2a3dec(ut[_0xd849('0x30')](_0xd849('0xfe')));})[_0xd849('0x52')](function(_0x28c37a){ut['logger'](_0xd849('0xff'),_0x28c37a);_0x1ff489(ut[_0xd849('0x30')]('Call\x20failed',_0x5346a7,_0x104052));});}else{_0x341b43[_0xd849('0x100')]+=0x1;ut[_0xd849('0x101')](_0x2b7215);rpcDb[_0xd849('0x102')](_0x2b7215,_0xd849('0x103'));delete _0x2df7ff[_0xd849('0x13')][_0x399d5d];_0x1ff489(ut[_0xd849('0x30')]('Contact\x20in\x20black\x20List',_0x5346a7,_0x104052));}});};Preview[_0xd849('0x39')]['isTrunkReachable']=function(_0x16ef9f){return!_['isNil'](_0x16ef9f)&&!_[_0xd849('0x46')](_0x16ef9f[_0xd849('0x29')])&&!_['isNil'](_0x16ef9f[_0xd849('0x104')])&&_0x16ef9f[_0xd849('0x104')]&&!_[_0xd849('0x46')](this[_0xd849('0x12')][util[_0xd849('0x65')](_0xd849('0x105'),_0x16ef9f['name'])])&&!_['isNil'](this['trunks'][util['format'](_0xd849('0x105'),_0x16ef9f[_0xd849('0x29')])][_0xd849('0x106')])&&(this[_0xd849('0x12')][util[_0xd849('0x65')](_0xd849('0x105'),_0x16ef9f['name'])][_0xd849('0x106')]===_0xd849('0x107')||this[_0xd849('0x12')][util['format'](_0xd849('0x105'),_0x16ef9f['name'])][_0xd849('0x106')]===_0xd849('0x108'));};Preview[_0xd849('0x39')][_0xd849('0x61')]=function(_0x96faf2,_0x45cd54){return this['execRun'](_0x96faf2,_0x45cd54)[_0xd849('0x5b')](function(_0x3a3542){return _['pick'](_0x3a3542,[_0xd849('0x30')]);})[_0xd849('0x52')](function(_0x2fbd6f){if(_0x2fbd6f[_0xd849('0x109')]){rpcDb[_0xd849('0x10a')](_0x96faf2);}if(_0x2fbd6f['active']){rpcDb[_0xd849('0x64')](_0x96faf2);}throw _[_0xd849('0x4c')](_0x2fbd6f,[_0xd849('0x30')]);});};Preview[_0xd849('0x39')][_0xd849('0x10b')]=function(_0x308270,_0x548229){var _0x110e4=this;var _0x1e8930,_0x1680f6;return rpcDb[_0xd849('0x10c')](_0x308270)['then'](function(_0x130ede){if(!_[_0xd849('0x46')](_0x130ede[0x0])){_0x1680f6=_0x130ede[0x0]['recallme']?![]:!![];_0x1e8930=_0x130ede[0x0][_0xd849('0x10d')]?!![]:![];_0x1e8930=_0x548229?!![]:_0x1e8930;}var _0x5c5578=_0x110e4[_0xd849('0x10e')](_0x130ede);if(_0x5c5578[_0xd849('0x10f')]){rpcDb[_0xd849('0x110')](_['pick'](_0x130ede[0x0],[_0xd849('0x4f'),'phone']))[_0xd849('0x5b')](function(_0xe0dcf5){_0x110e4[_0xd849('0xf3')](_0xe0dcf5,_0x130ede[0x0],_0x548229,_0x1680f6,_0x1e8930)['then'](function(_0x32f9e1){return _0x32f9e1;})[_0xd849('0x52')](function(_0x594deb){throw _0x594deb;});})['catch'](function(_0x12658d){ut[_0xd849('0x33')]('[Preview][checkIsBlackList]',_0x12658d);throw ut[_0xd849('0x30')](_0xd849('0x111'),_0x1680f6,_0x1e8930);});}else{throw ut['message'](_0x5c5578[_0xd849('0x30')],_0x1680f6,_0x1e8930);}})[_0xd849('0x52')](function(_0x455a45){ut[_0xd849('0x33')](_0xd849('0x112'),_0x455a45);throw ut[_0xd849('0x30')]('Call\x20unsuccessful',![],!![]);});};Preview[_0xd849('0x39')][_0xd849('0x10e')]=function(_0x2c0301){if(_[_0xd849('0x46')](_0x2c0301)||_[_0xd849('0xf9')](_0x2c0301)||!_[_0xd849('0x46')](_0x2c0301[0x0][_0xd849('0x5f')])&&_[_0xd849('0x46')](_0x2c0301[0x0][_0xd849('0x5f')][_0xd849('0x29')])){ut[_0xd849('0x33')](_0xd849('0x113'),_0x2c0301);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x59aab3=this['campaignsPreview'][_0x2c0301[0x0]['Queue'][_0xd849('0x29')]];_0x59aab3['message']=utils[_0xd849('0x31')][_0xd849('0x7a')];if(_[_0xd849('0x46')](_0x59aab3)){ut[_0xd849('0x33')](_0xd849('0x114'),_0x59aab3);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xd849('0x76')](_0x59aab3[_0xd849('0x77')])){ut[_0xd849('0x33')](_0xd849('0x115'),_0xd849('0x116')+_0x59aab3['name']+_0xd849('0x117'));if(!this[_0xd849('0x76')](_0x59aab3[_0xd849('0x78')])){ut[_0xd849('0x33')](_0xd849('0x115'),_0x59aab3[_0xd849('0x29')]+_0xd849('0x118'));return{'isValid':![],'message':_0xd849('0x119')};}}if(!ut[_0xd849('0x75')](_0x59aab3[_0xd849('0x40')])){ut['logger'](_0xd849('0x11a'),_0x59aab3['name']+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x59aab3[_0xd849('0x29')]+_0xd849('0x11b')};}return{'isValid':!![],'message':_0xd849('0x11c')};};Preview[_0xd849('0x39')]['execCall']=function(_0x4cdc39,_0x283be9,_0x291a0a,_0x121cbf){var _0x43bb23=this;return new Promise(function(_0x174ac2,_0x53e101){var _0x29268b=_0x4cdc39['uniqueid'];var _0x283a41=_0x43bb23[_0xd849('0x76')](_0x283be9[_0xd849('0x77')])?util[_0xd849('0x65')](_0xd849('0x11d'),_0x283be9[_0xd849('0x77')][_0xd849('0x29')],_[_0xd849('0x46')](_0x283be9['dialPrefix'])?'':_0x283be9['dialPrefix'][_0xd849('0x11e')]()||'',_0x283be9['dialCutDigit']>0x0?_0x291a0a[_0xd849('0xf5')]['substring'](_0x283be9[_0xd849('0x11f')]):_0x291a0a[_0xd849('0xf5')]):util[_0xd849('0x65')](_0xd849('0x11d'),_['isNil'](_0x283be9['TrunkBackup'])?_0x283be9[_0xd849('0x77')][_0xd849('0x29')]:_0x283be9[_0xd849('0x78')]['name'],_['isNil'](_0x283be9[_0xd849('0x120')])?'':_0x283be9[_0xd849('0x120')][_0xd849('0x11e')]()||'',_0x283be9[_0xd849('0x11f')]>0x0?_0x291a0a[_0xd849('0xf5')][_0xd849('0x121')](_0x283be9[_0xd849('0x11f')]):_0x291a0a[_0xd849('0xf5')]);var _0x4e445f=_0x43bb23[_0xd849('0x76')](_0x283be9[_0xd849('0x77')])?ut[_0xd849('0x122')](_0x283be9['Trunk'][_0xd849('0x123')],_0x283be9[_0xd849('0x124')],_0x283be9[_0xd849('0x125')]>0x0?ut[_0xd849('0x126')](_0x283be9['dialOriginateCallerIdNumber'],_0x283be9[_0xd849('0x125')]):_0x283be9['dialOriginateCallerIdNumber']):ut[_0xd849('0x122')](_[_0xd849('0x46')](_0x283be9['TrunkBackup'])?_0x283be9[_0xd849('0x77')][_0xd849('0x123')]:_0x283be9[_0xd849('0x78')][_0xd849('0x123')],_0x283be9[_0xd849('0x124')],_0x283be9[_0xd849('0x125')]>0x0?ut['getCallerIdRandom'](_0x283be9[_0xd849('0x127')],_0x283be9[_0xd849('0x125')]):_0x283be9[_0xd849('0x127')]);if(_0x4e445f){_0x4cdc39['originatecalleridname']=ut[_0xd849('0x128')](_0x4e445f);_0x4cdc39[_0xd849('0x129')]=ut['extractCalleridNumber'](_0x4e445f);}var _0xd2a48=ut['addVariables'](_0x283be9,_0x291a0a,_0x283a41,_0x4e445f,_0x29268b,_0x4cdc39);var _0x281b9d=utils['setXMDContactVariables'](_0x291a0a[_0xd849('0xf4')]);Object[_0xd849('0x12a')](_0xd2a48,_0x281b9d);_[_0xd849('0x12b')](_0x4cdc39,ut[_0xd849('0x12c')](_0xd2a48));_0x4cdc39['starttime']=moment()[_0xd849('0x65')](_0xd849('0x66'));_0x283be9[_0xd849('0x12d')]=_0xd2a48;var _0x8fdb46=ut[_0xd849('0x12e')](_0x4cdc39,_0x283be9,_0xd2a48,_0x4cdc39[_0xd849('0x8b')],_0x121cbf);return ami[_0xd849('0x50')](_0x8fdb46)[_0xd849('0x5b')](function(_0x5cfb95){_0x283be9[_0xd849('0x49')]+=0x1;logger[_0xd849('0x26')](_0xd849('0x12f'),_0x29268b,_0xd849('0x91'),_0x283be9['name'],_0xd849('0xee'),_0x283be9[_0xd849('0x49')]);_0x174ac2(_0x5cfb95);})[_0xd849('0x52')](function(_0x3105a8){ut[_0xd849('0xe5')](_0x4cdc39,0xe,_0xd849('0x130'));rpcDb[_0xd849('0xe6')](_0x4cdc39,_0xd849('0x131'));_0x53e101(_0x3105a8);});});};Preview[_0xd849('0x39')][_0xd849('0x1f')]=function(_0x3794c5){if(this[_0xd849('0x13')][_0x3794c5[_0xd849('0xa2')]]){this[_0xd849('0x13')][_0x3794c5[_0xd849('0xa2')]][_0xd849('0x51')]=_0x3794c5[_0xd849('0x51')];}};Preview[_0xd849('0x39')][_0xd849('0x17')]=function(_0x169e85){var _0x51297c=this;var _0x42aa4c=this[_0xd849('0x13')][_0x169e85[_0xd849('0x132')]];if(_0x42aa4c){if(_0x42aa4c[_0xd849('0xf8')]&&this[_0xd849('0x14')][_0x42aa4c[_0xd849('0xf8')]]){ut['logLookAgent'](_0x42aa4c,this[_0xd849('0x14')][_0x42aa4c[_0xd849('0xf8')]]['name'],this[_0xd849('0x14')][_0x42aa4c[_0xd849('0xf8')]]['id']);}var _0x85790e=_['clone'](_0x42aa4c);_0x85790e['responsetime']=moment()[_0xd849('0x65')](_0xd849('0x66'));var _0x3d4f3b=_0x51297c['campaignsPreview'][_0x42aa4c[_0xd849('0x48')]];if(ut[_0xd849('0x133')](_0x169e85[_0xd849('0x134')])){if(_0x42aa4c[_0xd849('0xaf')]){rpcDb['unlockContact'](_0x42aa4c[_0xd849('0x8c')]);}if(_0x42aa4c[_0xd849('0x8b')]){rpcDb[_0xd849('0x64')](_0x42aa4c[_0xd849('0x8c')]);}ami['emit'](_0xd849('0x135'),ut[_0xd849('0x81')](_0x42aa4c,_0xd849('0x136'),this[_0xd849('0x11')][_0x42aa4c['queue']]));this[_0xd849('0xe1')](_0x85790e,_0x3d4f3b,_0x169e85);}else{_0x42aa4c[_0xd849('0x137')]=moment()['format'](_0xd849('0x66'));ut[_0xd849('0xe5')](_0x85790e,0x4,_0xd849('0x9b'));rpcDb[_0xd849('0xe6')](_0x85790e,_0xd849('0x138'));}}};Preview[_0xd849('0x39')][_0xd849('0x19')]=function(_0xae3f16){var _0x271056=this['actions'][_0xae3f16[_0xd849('0xa2')]];var _0x5275b1;if(_0x271056){_0x5275b1=this[_0xd849('0x11')][_0x271056[_0xd849('0x48')]];logger[_0xd849('0x26')](_0xd849('0x139'),_0xae3f16[_0xd849('0xa2')],_0xd849('0x91'),_0x5275b1['name'],_0xd849('0x4a'),_0x5275b1['pTalking']);}if(this[_0xd849('0x13')][_0xae3f16[_0xd849('0xa2')]]&&_0xae3f16[_0xd849('0xa2')]!==_0xae3f16[_0xd849('0xa1')]){if(_0xae3f16[_0xd849('0x13a')]==='16'&&this[_0xd849('0x13')][_0xae3f16['linkedid']][_0xd849('0x4b')]){this[_0xd849('0x7b')](_0xae3f16,_0xae3f16[_0xd849('0xa2')],_0xae3f16[_0xd849('0x13a')]);}else if(this[_0xd849('0x13')][_0xae3f16[_0xd849('0xa2')]]['dialAnswer']){logger[_0xd849('0x26')](_0xd849('0x13b'),_0xae3f16[_0xd849('0xa2')],_0xae3f16['cause'],_0xd849('0x91'),_0x5275b1['name'],_0xd849('0x4a'),_0x5275b1[_0xd849('0x2d')]);this[_0xd849('0x7b')](_0xae3f16,_0xae3f16[_0xd849('0xa2')],_0xae3f16[_0xd849('0x13a')]);}}else if(_0x271056&&_[_0xd849('0x46')](_0x271056[_0xd849('0x13c')])&&_0x5275b1[_0xd849('0x13d')]&&_0xae3f16[_0xd849('0xa2')]===_0xae3f16[_0xd849('0xa1')]&&_['isNil'](_0xae3f16[_0xd849('0xe4')])&&_0xae3f16[_0xd849('0x13a')]==='16'&&_0xae3f16[_0xd849('0x13e')]==='6'&&_[_0xd849('0xe2')](_0x271056[_0xd849('0x13f')])){if(_0x271056[_0xd849('0xaf')]){rpcDb['unlockContact'](_0x271056['idContact']);}if(_0x271056[_0xd849('0x8b')]){rpcDb[_0xd849('0x64')](_0x271056[_0xd849('0x8c')]);}_0xae3f16[_0xd849('0xe4')]='22';this['callProgressDetectingAgent'](_0x271056,_0x5275b1,_0xae3f16);}else if(_0x271056&&_0x271056[_0xd849('0x13f')]){if(_0xae3f16[_0xd849('0x13a')]==='16'&&this['actions'][_0xae3f16[_0xd849('0xa2')]][_0xd849('0x4b')]){logger['info'](_0xd849('0x140'),_0xae3f16[_0xd849('0xa2')],_0xae3f16[_0xd849('0x13a')],_0xd849('0x91'),_0x5275b1['name'],_0xd849('0x4a'),_0x5275b1[_0xd849('0x2d')]);this['callProgressDetectingCustomer'](_0xae3f16,_0xae3f16[_0xd849('0xa2')],_0xae3f16[_0xd849('0x13a')]);}else if(this[_0xd849('0x13')][_0xae3f16[_0xd849('0xa2')]][_0xd849('0x4b')]){logger[_0xd849('0x26')](_0xd849('0x13b'),_0xae3f16['linkedid'],_0xae3f16[_0xd849('0x13a')],_0xd849('0x91'),_0x5275b1[_0xd849('0x29')],_0xd849('0x4a'),_0x5275b1[_0xd849('0x2d')]);this['callProgressDetectingCustomer'](_0xae3f16,_0xae3f16[_0xd849('0xa2')],_0xae3f16[_0xd849('0x13a')]);}}};Preview['prototype'][_0xd849('0x1d')]=function(_0xbc1c9d){if(this[_0xd849('0x13')][_0xbc1c9d[_0xd849('0xdf')]]&&_0xbc1c9d[_0xd849('0xdf')]!==_0xbc1c9d['destuniqueid']){this[_0xd849('0x7b')](_0xbc1c9d,_0xbc1c9d[_0xd849('0xdf')],_0xbc1c9d[_0xd849('0xd6')]);}};Preview[_0xd849('0x39')][_0xd849('0x1b')]=function(_0x41810d){if(this['actions'][_0x41810d[_0xd849('0xa2')]]&&_0x41810d[_0xd849('0xa2')]!==_0x41810d[_0xd849('0xa1')]&&!this[_0xd849('0x13')][_0x41810d['linkedid']]['dialAnswer']){if(_0x41810d[_0xd849('0x13a')]==='1'){this[_0xd849('0x7b')](_0x41810d,_0x41810d['linkedid'],_0x41810d[_0xd849('0x13a')]);}}};Preview['prototype'][_0xd849('0x141')]=function(_0x20611c,_0x488196,_0x17bb96){if(this[_0xd849('0x13')][_0x20611c]){if(_[_0xd849('0x46')](this['actions'][_0x20611c][_0xd849('0x12d')])){this[_0xd849('0x13')][_0x20611c][_0xd849('0x12d')]={};}this[_0xd849('0x13')][_0x20611c][_0xd849('0x12d')][_0x488196]=_0x17bb96;}};Preview['prototype'][_0xd849('0x21')]=function(_0x1572de){try{if(!_[_0xd849('0x46')](_0x1572de)){if(ut[_0xd849('0x142')](_['keys'](_0x1572de[_0xd849('0x143')])[0x0])){this[_0xd849('0x141')](_0x1572de[_0xd849('0xa1')],_[_0xd849('0x144')](_0x1572de[_0xd849('0x143')])[0x0],_0x1572de[_0xd849('0x145')]);}}}catch(_0x3c9680){logger[_0xd849('0x146')]('[syncVarSet][Preview]',util[_0xd849('0x147')](_0x3c9680,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xd849('0x23')]=function(_0x258448){if(_0x258448){if(this[_0xd849('0x13')][_0x258448['transfertargetlinkedid']]){this[_0xd849('0x13')][_0x258448[_0xd849('0x148')]][_0xd849('0x13f')]=!![];}}};Preview[_0xd849('0x39')]['syncBlindTransfer']=function(_0x200957){if(_0x200957){if(this[_0xd849('0x13')][_0x200957[_0xd849('0x149')]]){this[_0xd849('0x13')][_0x200957[_0xd849('0x149')]][_0xd849('0x13f')]=!![];}}};module[_0xd849('0x14a')]=Preview; \ No newline at end of file +var _0x892d=['ioredis','../../../config/logger','preview','../ami','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','loopCampaigns','campaignsPreview','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','name','\x20is\x20not\x20active','DEACTIVATED','syncCampaigns','hasOwnProperty','dialMethod','booked','outbound','type','dialActive','recallMe','clearZombieChannel','isNil','actions','[clearZombieChannels][talking]','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','status','channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','size','getContactRecallMe','then','length','getDiff','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','outboundReCallsDay','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','setMessage','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','Trunk','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','uniqueid','\x20Queue','custom:agentconnect','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','[16]','totalGlobal','Answer','[callProgressDetectingCustomer][logAnswer]','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','rescheduleContact','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','Global','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','queueSummaryCountersUpdated','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','Call\x20failed','createHistory','active','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','recallme','isValid','[Preview][getContactPreview]','Call\x20unsuccessful','Queue','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','dialPrefix','dialCutDigit','substring','TrunkBackup','trim','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','addVariables','setXMDContactVariables','merge','toLowerVariables','YYYY-MM-DD\x20HH:mm:ss','variables','variablesAction','[originated][increment]','OriginateError','clone','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','[syncHangup][talking][transfer]','addVariable','filterKey','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfer','transfererlinkedid','exports','util','lodash','uuid'];(function(_0x194022,_0x416fc6){var _0xcc9efb=function(_0x2d2207){while(--_0x2d2207){_0x194022['push'](_0x194022['shift']());}};_0xcc9efb(++_0x416fc6);}(_0x892d,0x136));var _0xd892=function(_0x50084d,_0x2552c2){_0x50084d=_0x50084d-0x0;var _0x463432=_0x892d[_0x50084d];return _0x463432;};'use strict';var util=require(_0xd892('0x0'));var _=require(_0xd892('0x1'));var uuid=require(_0xd892('0x2'));var moment=require('moment');var Redis=require(_0xd892('0x3'));var config=require('../../../config/environment');var logger=require(_0xd892('0x4'))(_0xd892('0x5'));var loggerAction=require(_0xd892('0x4'))('actionPreview');var ami=require(_0xd892('0x6'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xd892('0x7'));var Action=require(_0xd892('0x8'));var ut=require(_0xd892('0x9'));var utils=require(_0xd892('0xa'));config['redis']=_[_0xd892('0xb')](config[_0xd892('0xc')],{'host':_0xd892('0xd'),'port':0x18eb});var io=require(_0xd892('0xe'))(new Redis(config[_0xd892('0xc')]));var Sequence=function(){};Sequence[_0xd892('0xf')][_0xd892('0x10')]=function(_0x1053a2){this[_0xd892('0x11')]=this['tail']?this[_0xd892('0x11')][_0xd892('0x12')](_0x1053a2):_0x1053a2();};function Preview(_0x24ffd5){this[_0xd892('0x13')]=new Sequence();this['campaignsPreview']=_0x24ffd5[_0xd892('0x14')];this[_0xd892('0x15')]=_0x24ffd5['trunks'];this['actions']={};this[_0xd892('0x16')]=_0x24ffd5[_0xd892('0x16')];this[_0xd892('0x17')]=0x0;ami['on'](_0xd892('0x18'),this[_0xd892('0x19')]['bind'](this));ami['on'](_0xd892('0x1a'),this[_0xd892('0x1b')][_0xd892('0x1c')](this));ami['on'](_0xd892('0x1d'),this[_0xd892('0x1e')]['bind'](this));ami['on'](_0xd892('0x1f'),this[_0xd892('0x20')][_0xd892('0x1c')](this));ami['on'](_0xd892('0x21'),this[_0xd892('0x22')][_0xd892('0x1c')](this));ami['on'](_0xd892('0x23'),this[_0xd892('0x24')][_0xd892('0x1c')](this));ami['on']('attendedtransfer',this[_0xd892('0x25')]['bind'](this));ami['on'](_0xd892('0x26'),this['syncBlindTransfer'][_0xd892('0x1c')](this));this[_0xd892('0x27')](this[_0xd892('0x28')]);}function emit(_0x529b18,_0x2990e8,_0x4f5af0){io['to'](_0x529b18)[_0xd892('0x29')](_0x2990e8,_0x4f5af0);}function emitVoiceQueueChannelRemove(_0x4b870c){logger[_0xd892('0x2a')](_0xd892('0x2b'),JSON[_0xd892('0x2c')](_0x4b870c));emit(util[_0xd892('0x2d')](_0xd892('0x2e'),_0x4b870c['name']),_0xd892('0x2f'),_0x4b870c);io[_0xd892('0x29')](_0xd892('0x30'),_0x4b870c);}function notSendMessagesQueue(_0x400c12){if(_0x400c12[_0xd892('0x31')]){if(_0x400c12[_0xd892('0x32')]===0x0&&_0x400c12[_0xd892('0x33')]===0x0){_0x400c12[_0xd892('0x31')]=![];_0x400c12[_0xd892('0x34')]=0x0;_0x400c12[_0xd892('0x35')]=0x0;_0x400c12[_0xd892('0x36')]=utils[_0xd892('0x37')][_0xd892('0x38')];ut[_0xd892('0x39')](_0xd892('0x3a'),_0x400c12[_0xd892('0x3b')]+_0xd892('0x3c'));}else{_0x400c12[_0xd892('0x36')]=utils[_0xd892('0x37')][_0xd892('0x3d')];ut[_0xd892('0x39')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x400c12[_0xd892('0x3b')]+'\x20is\x20deactivated');}}}Preview[_0xd892('0xf')][_0xd892('0x27')]=function(){var _0x5354b8=this;setInterval(function(){_0x5354b8[_0xd892('0x3e')]();},0x7cf);};Preview[_0xd892('0xf')][_0xd892('0x3e')]=function(){var _0x2594eb=this[_0xd892('0x28')];this[_0xd892('0x17')]+=0x1;for(var _0x4e4f15 in _0x2594eb){if(_0x2594eb[_0xd892('0x3f')](_0x4e4f15)&&(_0x2594eb[_0x4e4f15][_0xd892('0x40')]==='preview'||_0x2594eb[_0x4e4f15][_0xd892('0x40')]===_0xd892('0x41'))&&_0x2594eb[_0x4e4f15]['type']===_0xd892('0x42')){if(this['clockClearZombieChannels']>0x7){this[_0xd892('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x2594eb[_0xd892('0x3f')](_0x4e4f15)&&_0x2594eb[_0x4e4f15]['dialMethod']==='preview'&&_0x2594eb[_0x4e4f15][_0xd892('0x43')]===_0xd892('0x42')){if(_0x2594eb[_0x4e4f15][_0xd892('0x44')]){this['setMessage'](_0x2594eb[_0x4e4f15]);if(_0x2594eb[_0x4e4f15]['dialPreviewAutoRecallMe'])this[_0xd892('0x45')](_0x2594eb[_0x4e4f15]);}else{notSendMessagesQueue(_0x2594eb[_0x4e4f15]);}}}};Preview['prototype'][_0xd892('0x46')]=function(_0xe61c0a){var _0x5f308a=this;this[_0xd892('0x13')]['enqueue'](function(){if(!_[_0xd892('0x47')](_0x5f308a[_0xd892('0x48')][_0xe61c0a])){loggerAction[_0xd892('0x2a')](_0xd892('0x49'),_0xe61c0a,'Queue',_0x5f308a[_0xd892('0x48')][_0xe61c0a]['queue'],'originated:\x20',JSON['stringify'](_0x5f308a[_0xd892('0x28')][_0x5f308a['actions'][_0xe61c0a][_0xd892('0x4a')]][_0xd892('0x32')]),_0xd892('0x4b'),JSON[_0xd892('0x2c')](_0x5f308a[_0xd892('0x28')][_0x5f308a[_0xd892('0x48')][_0xe61c0a][_0xd892('0x4a')]][_0xd892('0x33')]),JSON[_0xd892('0x2c')](_0x5f308a[_0xd892('0x48')][_0xe61c0a][_0xd892('0x4c')]),JSON[_0xd892('0x2c')](_[_0xd892('0x4d')](_0x5f308a[_0xd892('0x48')][_0xe61c0a],[_0xd892('0x4e'),_0xd892('0x4f'),'VoiceQueueId',_0xd892('0x50')])));return ami[_0xd892('0x51')]({'action':_0xd892('0x52'),'channel':_0x5f308a[_0xd892('0x48')][_0xe61c0a][_0xd892('0x53')]})['catch'](function(_0x36384d){if(_0x36384d[_0xd892('0x36')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x5f308a[_0xd892('0x48')][_0xe61c0a]){ut[_0xd892('0x54')](_0x5f308a[_0xd892('0x28')][_0x5f308a['actions'][_0xe61c0a][_0xd892('0x4a')]],_0xd892('0x55'));if(_0x5f308a[_0xd892('0x48')][_0xe61c0a][_0xd892('0x4c')]===!![]){ut[_0xd892('0x56')](_0x5f308a[_0xd892('0x28')][_0x5f308a[_0xd892('0x48')][_0xe61c0a][_0xd892('0x4a')]],_0xd892('0x55'));ut[_0xd892('0x57')](_0xd892('0x58')+_0xe61c0a,_0x5f308a['actions'][_0xe61c0a][_0xd892('0x4a')]);}ut[_0xd892('0x57')]('[Dialer][checkChannel][Preview]'+_0xe61c0a,_0x5f308a[_0xd892('0x48')][_0xe61c0a][_0xd892('0x4a')]);delete _0x5f308a['actions'][_0xe61c0a];}},0x2328);}});}});};Preview[_0xd892('0xf')]['clearZombieChannels']=function(){var _0x5af4a3=this;loggerAction[_0xd892('0x2a')]('[action]',_[_0xd892('0x59')](this[_0xd892('0x48')]));for(var _0x41fb44 in this[_0xd892('0x48')]){if(_0x5af4a3[_0xd892('0x48')][_0xd892('0x3f')](_0x41fb44)){_0x5af4a3[_0xd892('0x46')](_0x41fb44);}}};Preview['prototype'][_0xd892('0x45')]=function(_0x11e98e){var _0x2854e0=this;rpcDb[_0xd892('0x5a')](_0x11e98e['id'],ut['agentReadyId'](this['agents']))[_0xd892('0x5b')](function(_0x3da90f){if(!_[_0xd892('0x47')](_0x3da90f)){for(var _0xe2c770=0x0;_0xe2c770<_0x3da90f[_0xd892('0x5c')];_0xe2c770+=0x1){if(ut[_0xd892('0x5d')](_0x3da90f[_0xe2c770]['scheduledat'])<_0x11e98e['dialRecallMeTimeout']*0x3c){if(_0x3da90f[_0xe2c770][_0xd892('0x5e')]&&!_0x3da90f[_0xe2c770][_0xd892('0x5e')][_0xd892('0x5f')]){_0x2854e0[_0xd892('0x60')](_0x3da90f[_0xe2c770]['id'])[_0xd892('0x5b')](ut['logger2'](_0xd892('0x61')))[_0xd892('0x62')](ut[_0xd892('0x63')](_0xd892('0x61')));}else{rpcDb[_0xd892('0x64')](_0x3da90f[_0xe2c770]['id']);}}else{var _0x3d7130=new Action(_0x3da90f[_0xe2c770],_0x11e98e);_0x3d7130[_0xd892('0x65')]=moment()[_0xd892('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');_0x11e98e[_0xd892('0x66')]+=0x1;ut[_0xd892('0x67')](_0x3d7130,0x17,_0xd892('0x68'));if(_0x11e98e['dialRecallInQueue']){rpcDb[_0xd892('0x69')](ut[_0xd892('0x6a')](_0x3da90f[_0xe2c770]));rpcDb[_0xd892('0x6b')](_0x3d7130,_0xd892('0x6c'));}else{ut[_0xd892('0x67')](_0x3d7130,0x16,_0xd892('0x6d'));rpcDb[_0xd892('0x6b')](_0x3d7130,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x3d7130,'[HistoryRecallClose]');}}}}})[_0xd892('0x62')](ut[_0xd892('0x63')]('[getContactRecallMe]'));};Preview[_0xd892('0xf')][_0xd892('0x6e')]=function(_0x539add){_0x539add[_0xd892('0x31')]=!![];if(ut[_0xd892('0x6f')](_0x539add['loggedIn'])){_0x539add[_0xd892('0x36')]=utils[_0xd892('0x37')][_0xd892('0x70')];}else if(!ut[_0xd892('0x71')](_0x539add[_0xd892('0x44')])){_0x539add[_0xd892('0x36')]=utils[_0xd892('0x37')]['INACTIVE'];}else if(!this[_0xd892('0x72')](_0x539add[_0xd892('0x73')])){if(!this[_0xd892('0x72')](_0x539add['TrunkBackup'])){_0x539add['message']=utils['CAMPAIGN_STATUS'][_0xd892('0x74')];}else{_0x539add[_0xd892('0x36')]=utils[_0xd892('0x37')][_0xd892('0x75')];}}else{_0x539add[_0xd892('0x36')]=utils[_0xd892('0x37')][_0xd892('0x75')];}};Preview[_0xd892('0xf')][_0xd892('0x76')]=function(_0x139a79,_0x2ad950,_0x2063bb){var _0x3ba739=this;var _0x38e1d2=this[_0xd892('0x48')][_0x2ad950];var _0xe2579b=this[_0xd892('0x28')][_0x38e1d2['queue']];var _0x3d3fc8;var _0x399766=![];var _0x52f223=0x2;var _0x5ea425=0x3;if(_0xe2579b){switch(_0x2063bb){case'1':_0xe2579b[_0xd892('0x77')]+=0x1;_0x38e1d2['countnosuchnumberretry']+=0x1;_0x38e1d2[_0xd892('0x78')]=ut['totalGlobal'](_0x38e1d2);ut['logCustomer'](_0x38e1d2,0x0,_0xd892('0x79'));ami[_0xd892('0x29')]('custom:agentnosuchnumber',ut[_0xd892('0x7a')](_0x38e1d2,_0xd892('0x7b')));rpcDb[_0xd892('0x6b')](_0x38e1d2,_0xd892('0x7c'));_0x3ba739[_0xd892('0x7d')](_0x38e1d2,'0',_0xe2579b)['then'](function(_0x3dbc1b){_0x399766=_0x3dbc1b[_0xd892('0x7e')]==0x1;_0x52f223=_0xe2579b[_0xd892('0x7f')];_0x5ea425=_0xe2579b['callAdditionalPhoneAfterMin'];if(!_0x399766){if(ut['totalGlobal'](_0x38e1d2)>=_0xe2579b[_0xd892('0x80')]){_0x3d3fc8=ut[_0xd892('0x81')](_0x38e1d2,0xf,'Global');rpcDb[_0xd892('0x82')](_0x3d3fc8,_0xd892('0x83'));}else{if(_0x38e1d2[_0xd892('0x84')]>=_0xe2579b[_0xd892('0x85')]){rpcDb[_0xd892('0x82')](_0x38e1d2,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut[_0xd892('0x86')](_0x38e1d2,_0xd892('0x84'),_0xe2579b['dialNoSuchNumberRetryFrequency']),_0x38e1d2[_0xd892('0x87')],_0x38e1d2[_0xd892('0x88')]);}}delete this[_0xd892('0x48')][_0x139a79[_0xd892('0x89')]];}else{_0x38e1d2[_0xd892('0x84')]++;logger[_0xd892('0x2a')](_0xd892('0x8a'),_0x38e1d2[_0xd892('0x84')]);logger[_0xd892('0x2a')]('id',_0x38e1d2[_0xd892('0x8b')]);_0x3ba739[_0xd892('0x8c')]({'id':_0x38e1d2[_0xd892('0x8b')],'field':{'countnosuchnumberretry':_0x38e1d2['countnosuchnumberretry']}})['then'](function(){_0x3ba739[_0xd892('0x8d')](_0x38e1d2,_0x52f223,_0x5ea425)['then'](function(){});});}});break;case _0xd892('0x8e'):var _0x1fba33=moment()[_0xd892('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');_0x38e1d2['responsetime']=_0x1fba33;_0x38e1d2['answertime']=_0x1fba33;_0x38e1d2[_0xd892('0x4c')]=!![];_0xe2579b[_0xd892('0x33')]+=0x1;logger[_0xd892('0x2a')]('[syncHangup][talking][increment]',_0x38e1d2[_0xd892('0x8f')],_0xd892('0x90'),_0xe2579b[_0xd892('0x3b')],_0xd892('0x4b'),_0xe2579b[_0xd892('0x33')]);ami[_0xd892('0x29')](_0xd892('0x91'),ut['buildObj'](_0x38e1d2,_0xd892('0x92'),this[_0xd892('0x28')][_0x38e1d2['queue']]));if(_0xe2579b['acw']){ami[_0xd892('0x29')](_0xd892('0x93'),ut[_0xd892('0x94')](_0x38e1d2));}break;case'16':ami[_0xd892('0x29')](_0xd892('0x95'),ut[_0xd892('0x7a')](_0x38e1d2,_0xd892('0x96'),this[_0xd892('0x28')][_0x38e1d2[_0xd892('0x4a')]]));emitVoiceQueueChannelRemove(ut[_0xd892('0x7a')](_0x38e1d2,_0xd892('0x96')));_0xe2579b[_0xd892('0x97')]+=0x1;_0xe2579b[_0xd892('0x98')]+=0x1;_0xe2579b[_0xd892('0x99')]+=0x1;ut[_0xd892('0x56')](_0xe2579b,_0xd892('0x9a'));_0x38e1d2['countglobal']=ut[_0xd892('0x9b')](_0x38e1d2);ut[_0xd892('0x67')](_0x38e1d2,0x4,_0xd892('0x9c'));rpcDb[_0xd892('0x6b')](_0x38e1d2,_0xd892('0x9d'));rpcDb[_0xd892('0x82')](_0x38e1d2,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x38e1d2);_0xe2579b[_0xd892('0x9e')]+=_0x38e1d2[_0xd892('0x9f')];_0xe2579b[_0xd892('0xa0')]+=_0x38e1d2[_0xd892('0x9f')];logger[_0xd892('0x2a')](_0xd892('0xa1'),_0x38e1d2[_0xd892('0x8f')],_0xd892('0x90'),_0xe2579b[_0xd892('0x3b')],_0xd892('0x4b'),_0xe2579b['pTalking']);delete this[_0xd892('0x48')][_0x139a79[_0xd892('0x89')]];break;case _0xd892('0xa2'):_0xe2579b[_0xd892('0xa3')]+=0x1;_0x38e1d2['countbusyretry']+=0x1;_0x38e1d2[_0xd892('0x78')]=ut[_0xd892('0x9b')](_0x38e1d2);ut['logCustomer'](_0x38e1d2,0x5,_0xd892('0xa4'));_0x52f223=_0xe2579b[_0xd892('0xa5')];_0x5ea425=_0xe2579b[_0xd892('0xa6')];ami[_0xd892('0x29')](_0xd892('0xa7'),ut[_0xd892('0x7a')](_0x38e1d2,'busy'));rpcDb[_0xd892('0x6b')](_0x38e1d2,_0xd892('0xa8'));_0x3ba739['verifyAdditionalPhones'](_0x38e1d2,'5',_0xe2579b)[_0xd892('0x5b')](function(_0x159879){_0x399766=_0x159879[_0xd892('0x7e')]==0x1;if(!_0x399766){if(ut[_0xd892('0x9b')](_0x38e1d2)>=_0xe2579b['dialGlobalMaxRetry']){_0x3d3fc8=ut[_0xd892('0x81')](_0x38e1d2,0xf,'Global');rpcDb[_0xd892('0x82')](_0x3d3fc8,_0xd892('0xa9'));}else{if(_0x38e1d2[_0xd892('0xaa')]>=_0xe2579b[_0xd892('0xab')]){rpcDb[_0xd892('0x82')](_0x38e1d2,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xd892('0xac')](ut['scheduledAt'](_0x38e1d2,_0xd892('0xaa'),_0xe2579b[_0xd892('0xa5')]),_0x38e1d2['unlockAgent'],_0x38e1d2['activeContact']);}}}else{_0x38e1d2[_0xd892('0xaa')]++;_0x3ba739[_0xd892('0x8c')]({'id':_0x38e1d2[_0xd892('0x8b')],'field':{'countbusyretry':_0x38e1d2[_0xd892('0xaa')]}})['then'](function(){_0x3ba739[_0xd892('0x8d')](_0x38e1d2,_0x52f223,_0x5ea425)['then'](function(){});});}});break;case _0xd892('0xad'):_0xe2579b[_0xd892('0xae')]+=0x1;_0x38e1d2['countnoanswerretry']+=0x1;_0x38e1d2[_0xd892('0x78')]=ut['totalGlobal'](_0x38e1d2);ut[_0xd892('0x67')](_0x38e1d2,0x3,_0xd892('0xaf'));_0x52f223=_0xe2579b[_0xd892('0xb0')];_0x5ea425=_0xe2579b[_0xd892('0xa6')];var _0x4d57d7=ut[_0xd892('0xb1')](_0x38e1d2,_0xe2579b);ami[_0xd892('0x29')](_0xd892('0xb2'),_0x4d57d7);rpcDb[_0xd892('0x6b')](_0x38e1d2,'[callProgressDetectingCustomer][logNoAnswer]');_0x3ba739[_0xd892('0x7d')](_0x38e1d2,'3',_0xe2579b)[_0xd892('0x5b')](function(_0x1f65f0){_0x399766=_0x1f65f0['additional']==0x1;if(!_0x399766){if(ut[_0xd892('0x9b')](_0x38e1d2)>=_0xe2579b['dialGlobalMaxRetry']){_0x3d3fc8=ut[_0xd892('0x81')](_0x38e1d2,0xf,'Global');rpcDb[_0xd892('0x82')](_0x3d3fc8,_0xd892('0xb3'));}else{if(_0x38e1d2[_0xd892('0xb4')]>=_0xe2579b[_0xd892('0xb5')]){rpcDb['createCustomerFinal'](_0x38e1d2,_0xd892('0xb6'));}else{rpcDb[_0xd892('0xac')](ut[_0xd892('0x86')](_0x38e1d2,'countnoanswerretry',_0xe2579b['dialNoAnswerRetryFrequency']),_0x38e1d2['unlockAgent'],_0x38e1d2[_0xd892('0x88')]);}}}else{_0x38e1d2['countnoanswerretry']++;_0x3ba739[_0xd892('0x8c')]({'id':_0x38e1d2[_0xd892('0x8b')],'field':{'countnoanswerretry':_0x38e1d2[_0xd892('0xb4')]}})['then'](function(){_0x3ba739[_0xd892('0x8d')](_0x38e1d2,_0x52f223,_0x5ea425)[_0xd892('0x5b')](function(){});});}});break;case _0xd892('0xb7'):_0xe2579b[_0xd892('0xb8')]+=0x1;_0x38e1d2[_0xd892('0xb9')]+=0x1;_0x38e1d2['countglobal']=ut[_0xd892('0x9b')](_0x38e1d2);ut[_0xd892('0x67')](_0x38e1d2,0x8,_0xd892('0xba'));_0x52f223=_0xe2579b[_0xd892('0xbb')];_0x5ea425=_0xe2579b[_0xd892('0xa6')];ami[_0xd892('0x29')]('custom:agentcongestion',ut[_0xd892('0x7a')](_0x38e1d2,_0xd892('0xbc')));rpcDb[_0xd892('0x6b')](_0x38e1d2,_0xd892('0xbd'));_0x3ba739[_0xd892('0x7d')](_0x38e1d2,'8',_0xe2579b)[_0xd892('0x5b')](function(_0x283927){_0x399766=_0x283927[_0xd892('0x7e')]==0x1;if(!_0x399766){if(ut[_0xd892('0x9b')](_0x38e1d2)>=_0xe2579b[_0xd892('0x80')]){_0x3d3fc8=ut[_0xd892('0x81')](_0x38e1d2,0xf,_0xd892('0xbe'));rpcDb[_0xd892('0x82')](_0x3d3fc8,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x38e1d2['countcongestionretry']>=_0xe2579b['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x38e1d2,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xd892('0xac')](ut[_0xd892('0x86')](_0x38e1d2,_0xd892('0xb9'),_0xe2579b[_0xd892('0xa5')]),_0x38e1d2[_0xd892('0x87')],_0x38e1d2[_0xd892('0x88')]);}}}else{_0x38e1d2[_0xd892('0xb9')]++;_0x3ba739[_0xd892('0x8c')]({'id':_0x38e1d2['idContact'],'field':{'countcongestionretry':_0x38e1d2[_0xd892('0xb9')]}})[_0xd892('0x5b')](function(){_0x3ba739[_0xd892('0x8d')](_0x38e1d2,_0x52f223,_0x5ea425)[_0xd892('0x5b')](function(){});});}});break;case _0xd892('0xbf'):_0xe2579b[_0xd892('0xc0')]+=0x1;_0x38e1d2[_0xd892('0xc1')]+=0x1;_0x38e1d2['countglobal']=ut[_0xd892('0x9b')](_0x38e1d2);ut[_0xd892('0x67')](_0x38e1d2,0x14,_0xd892('0xc2'));_0x52f223=_0xe2579b[_0xd892('0xc3')];_0x5ea425=_0xe2579b[_0xd892('0xa6')];ami[_0xd892('0x29')](_0xd892('0xc4'),ut[_0xd892('0x7a')](_0x38e1d2,_0xd892('0xc5')));rpcDb['createCustomerHistory'](_0x38e1d2,_0xd892('0xc6'));_0x3ba739[_0xd892('0x7d')](_0x38e1d2,'20',_0xe2579b)['then'](function(_0x5dba25){_0x399766=_0x5dba25['additional']==0x1;if(!_0x399766){if(ut[_0xd892('0x9b')](_0x38e1d2)>=_0xe2579b['dialGlobalMaxRetry']){_0x3d3fc8=ut['cloneAction'](_0x38e1d2,0x14,_0xd892('0xc2'));rpcDb[_0xd892('0x82')](_0x3d3fc8,_0xd892('0xc7'));}else{if(_0x38e1d2[_0xd892('0xc1')]>=_0xe2579b[_0xd892('0xc8')]){rpcDb['createCustomerFinal'](_0x38e1d2,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x38e1d2,_0xd892('0xc1'),_0xe2579b['dialAgentRejectRetryFrequency']),_0x38e1d2['unlockAgent'],_0x38e1d2['activeContact']);}}}else{_0x38e1d2[_0xd892('0xb4')]++;_0x3ba739[_0xd892('0x8c')]({'id':_0x38e1d2[_0xd892('0x8b')],'field':{'countnoanswerretry':_0x38e1d2[_0xd892('0xb4')]}})[_0xd892('0x5b')](function(){_0x3ba739[_0xd892('0x8d')](_0x38e1d2,_0x52f223,_0x5ea425)[_0xd892('0x5b')](function(){});});}});break;case _0xd892('0xc9'):_0xe2579b[_0xd892('0xca')]+=0x1;_0x38e1d2['countabandonedretry']+=0x1;_0x38e1d2[_0xd892('0x78')]=ut[_0xd892('0x9b')](_0x38e1d2);ut[_0xd892('0x67')](_0x38e1d2,0xb,_0xd892('0xcb'));rpcDb['createCustomerHistory'](_0x38e1d2,_0xd892('0xcc'));_0x3ba739[_0xd892('0x7d')](_0x38e1d2,'11',_0xe2579b)['then'](function(_0x4026d0){_0x399766=_0x4026d0[_0xd892('0x7e')]==0x1;if(!_0x399766){if(ut['totalGlobal'](_0x38e1d2)>=_0xe2579b[_0xd892('0x80')]){_0x3d3fc8=ut[_0xd892('0x81')](_0x38e1d2,0xf,'Global');rpcDb[_0xd892('0x82')](_0x3d3fc8,_0xd892('0xcc'));}else{if(_0x38e1d2[_0xd892('0xcd')]>=_0xe2579b[_0xd892('0xce')]){rpcDb['createCustomerFinal'](_0x38e1d2,_0xd892('0xcc'));}else{rpcDb[_0xd892('0xac')](ut['scheduledAt'](_0x38e1d2,_0xd892('0xcf'),_0xe2579b[_0xd892('0xd0')]),_0x38e1d2[_0xd892('0x87')],_0x38e1d2['activeContact']);}}}else{_0x38e1d2['countnoanswerretry']++;_0x3ba739[_0xd892('0x8c')]({'id':_0x38e1d2[_0xd892('0x8b')],'field':{'countnoanswerretry':_0x38e1d2[_0xd892('0xb4')]}})[_0xd892('0x5b')](function(){_0x3ba739[_0xd892('0x8d')](_0x38e1d2,_0x52f223,_0x5ea425)[_0xd892('0x5b')](function(){});});}});break;case'18':_0xe2579b[_0xd892('0xd1')]+=0x1;_0x38e1d2[_0xd892('0xd2')]+=0x1;_0x38e1d2['countglobal']=ut[_0xd892('0x9b')](_0x38e1d2);ut[_0xd892('0x67')](_0x38e1d2,0x12,_0x139a79[_0xd892('0xd3')]||_0x139a79[_0xd892('0xd4')]);ami['emit'](_0xd892('0xd5'),ut[_0xd892('0x7a')](_0x38e1d2,'amd'));rpcDb['createCustomerHistory'](_0x38e1d2,'[callProgressDetectingCustomer][hangupInAMD]');_0x3ba739['verifyAdditionalPhones'](_0x38e1d2,'18',_0xe2579b)['then'](function(_0x287cf5){_0x399766=_0x287cf5[_0xd892('0x7e')]==0x1;if(!_0x399766){if(ut[_0xd892('0x9b')](_0x38e1d2)>=_0xe2579b['dialGlobalMaxRetry']){_0x3d3fc8=ut[_0xd892('0x81')](_0x38e1d2,0x12,_0xd892('0xbe'));rpcDb[_0xd892('0x82')](_0x3d3fc8,_0xd892('0xd6'));}else{rpcDb[_0xd892('0x82')](_0x38e1d2,_0xd892('0xd6'));}}else{_0x38e1d2['countnoanswerretry']++;_0x3ba739['incrementPreviewCounters']({'id':_0x38e1d2[_0xd892('0x8b')],'field':{'countnoanswerretry':_0x38e1d2[_0xd892('0xb4')]}})['then'](function(){_0x3ba739[_0xd892('0x8d')](_0x38e1d2,_0x52f223,_0x5ea425)[_0xd892('0x5b')](function(){});});}});delete this[_0xd892('0x48')][_0x139a79[_0xd892('0x89')]];break;case'19':_0xe2579b['outboundUnknownCallsDay']+=0x1;_0x38e1d2[_0xd892('0x78')]=ut[_0xd892('0x9b')](_0x38e1d2);ut[_0xd892('0x67')](_0x38e1d2,0x13,_0x139a79[_0xd892('0xd3')]||_0x139a79[_0xd892('0xd4')]);ami[_0xd892('0x29')]('custom:amd',ut[_0xd892('0x7a')](_0x38e1d2,_0xd892('0xd7')));rpcDb[_0xd892('0x6b')](_0x38e1d2,_0xd892('0xd8'));_0x3ba739[_0xd892('0x7d')](_0x38e1d2,'18',_0xe2579b)[_0xd892('0x5b')](function(_0xc97f97){_0x399766=_0xc97f97['additional']==0x1;if(!_0x399766){if(ut['totalGlobal'](_0x38e1d2)>=_0xe2579b['dialGlobalMaxRetry']){_0x3d3fc8=ut[_0xd892('0x81')](_0x38e1d2,0xf,_0xd892('0xbe'));rpcDb[_0xd892('0x82')](_0x3d3fc8,_0xd892('0xd8'));}else{rpcDb['createCustomerFinal'](_0x38e1d2,'[callProgressDetectingCustomer][machine]');}}else{_0x38e1d2[_0xd892('0xb4')]++;_0x3ba739['incrementPreviewCounters']({'id':_0x38e1d2[_0xd892('0x8b')],'field':{'countnoanswerretry':_0x38e1d2[_0xd892('0xb4')]}})[_0xd892('0x5b')](function(){_0x3ba739[_0xd892('0x8d')](_0x38e1d2,_0x52f223,_0x5ea425)['then'](function(){});});}});delete this['actions'][_0x139a79[_0xd892('0x89')]];break;default:if(_0x38e1d2[_0xd892('0x4c')]){ut['decrementTalkink'](_0xe2579b,'[default]');ut[_0xd892('0x57')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0xe2579b[_0xd892('0x3b')],_0x139a79);}_0xe2579b[_0xd892('0xd1')]+=0x1;_0x38e1d2[_0xd892('0x78')]=ut['totalGlobal'](_0x38e1d2);ut['logCustomer'](_0x38e1d2,0xc,_0x139a79[_0xd892('0xd3')]||_0x139a79[_0xd892('0xd4')]);_0x52f223=_0xe2579b[_0xd892('0xc3')];_0x5ea425=_0xe2579b[_0xd892('0xa6')];rpcDb['createCustomerHistory'](_0x38e1d2,'[callProgressDetectingCustomer][logUnknown]');_0x3ba739[_0xd892('0x7d')](_0x38e1d2,'20',_0xe2579b)['then'](function(_0x4c35e9){_0x399766=_0x4c35e9[_0xd892('0x7e')]==0x1;if(!_0x399766){if(ut[_0xd892('0x9b')](_0x38e1d2)>=_0xe2579b['dialGlobalMaxRetry']){_0x3d3fc8=ut[_0xd892('0x81')](_0x38e1d2,0xf,'Global');rpcDb[_0xd892('0x82')](_0x3d3fc8,_0xd892('0xd9'));}else{rpcDb[_0xd892('0x82')](_0x38e1d2,_0xd892('0xd9'));}delete this['actions'][_0x139a79[_0xd892('0x89')]];}else{_0x3ba739[_0xd892('0x8d')](_0x38e1d2,_0x52f223,_0x5ea425)[_0xd892('0x5b')](function(){});}});}if(!(_0x38e1d2[_0xd892('0x4c')]&&_0x2063bb==='16')){ut[_0xd892('0x54')](_0xe2579b,'[callProgressDetectingCustomer]');logger['info'](_0xd892('0xda'),_0x38e1d2[_0xd892('0x8f')],_0xd892('0x90'),_0xe2579b[_0xd892('0x3b')],_0xd892('0xdb'),_0xe2579b['originated']);}if(_0x2063bb!==_0xd892('0x8e')){delete this['actions'][_0x139a79['linkedid']];delete this[_0xd892('0x48')][_0x139a79[_0xd892('0xdc')]];}_0xe2579b[_0xd892('0xdd')]=!![];}};Preview['prototype']['callProgressDetectingAgent']=function(_0x117932,_0x2b057d,_0x30a0b5){if(_[_0xd892('0xde')](_0x2b057d)&&_0xd892('0xdf')!==typeof _0x2b057d){return;}if(_[_0xd892('0xde')](_0x30a0b5)&&_0xd892('0xdf')!==typeof _0x30a0b5){return;}switch(_0x30a0b5[_0xd892('0xe0')]){case'0':ut[_0xd892('0xe1')](_0x117932,0x0,_0xd892('0x79'));rpcDb['createAgentHistory'](_0x117932,_0xd892('0xe2'));break;case'3':ut[_0xd892('0xe1')](_0x117932,0x3,'NoAnswer');rpcDb[_0xd892('0xe3')](_0x117932,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xd892('0xe1')](_0x117932,0x5,_0xd892('0xa4'));rpcDb[_0xd892('0xe3')](_0x117932,_0xd892('0xe4'));break;case'8':ut[_0xd892('0xe1')](_0x117932,0x8,_0xd892('0xba'));rpcDb[_0xd892('0xe3')](_0x117932,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xd892('0xe1')](_0x117932,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x117932,_0xd892('0xe5'));break;default:ut[_0xd892('0xe1')](_0x117932,0xc,_0x30a0b5[_0xd892('0xe0')]);rpcDb[_0xd892('0xe3')](_0x117932,'[callProgressDetectingAgent][logCongestion]');}ut[_0xd892('0x54')](_0x2b057d,_0xd892('0xe6'));logger[_0xd892('0x2a')](_0xd892('0xe7'),_0x117932['uniqueid'],_0xd892('0x90'),_0x2b057d[_0xd892('0x3b')],'originated:\x20',_0x2b057d['originated']);delete this[_0xd892('0x48')][_0x117932['uniqueid']];};Preview[_0xd892('0xf')][_0xd892('0x7d')]=function(_0x222b6a,_0x17265f,_0x5beb23){return cmHopperAdditionalPhone[_0xd892('0x7d')](_0x222b6a,_0x17265f,_0x5beb23)[_0xd892('0x62')](logger['info'](_0xd892('0xe8')));};Preview['prototype'][_0xd892('0x8d')]=function(_0x4bf932,_0x597821,_0x3bd840){return cmHopperAdditionalPhone[_0xd892('0x8d')](_0x4bf932,_0x597821,_0x3bd840)['catch'](logger[_0xd892('0x2a')](_0xd892('0xe9')));};Preview['prototype']['incrementPreviewCounters']=function(_0x4cba02){return Promise[_0xd892('0xea')]()[_0xd892('0x5b')](cmHopperAdditionalPhone[_0xd892('0x8c')](_0x4cba02))['catch'](logger[_0xd892('0x2a')](_0xd892('0xeb')));};Preview[_0xd892('0xf')][_0xd892('0xec')]=function(_0x2a5f0f,_0x2e24fd,_0x20bbb0,_0x6e1a49,_0x238f8e){var _0x279377=this;return new Promise(function(_0x28f4a9,_0x1f475a){if(_[_0xd892('0x47')](_0x2e24fd)||_['isNil'](_0x2e24fd[_0xd892('0xed')])||_[_0xd892('0x47')](_0x2e24fd[_0xd892('0xee')])||_[_0xd892('0x47')](_0x2e24fd[_0xd892('0xef')])){_0x1f475a(ut[_0xd892('0x36')](_0xd892('0xf0'),_0x6e1a49,_0x238f8e));return;}var _0x311a81=uuid['v4']();var _0x595718=_0x279377[_0xd892('0x28')][_0x2e24fd['Queue'][_0xd892('0x3b')]];var _0x17ae1e=_0x20bbb0?_0x279377[_0xd892('0x16')][_0x20bbb0]['id']:undefined;_0x279377[_0xd892('0x48')][_0x311a81]=new Action(_0x2e24fd,_0x595718,_0x311a81,_0x20bbb0,_0x17ae1e);var _0x3f102a=_0x279377[_0xd892('0x48')][_0x311a81];_0x3f102a[_0xd892('0x87')]=_0x6e1a49;_0x3f102a['activeContact']=_0x238f8e;_0x3f102a[_0xd892('0xf1')]=_0x20bbb0;if(_[_0xd892('0xf2')](_0x2a5f0f)){_0x279377[_0xd892('0xf3')](_0x3f102a,_0x595718,_0x2e24fd,_0x20bbb0)[_0xd892('0x5b')](function(_0x2265e2){logger[_0xd892('0x2a')](_0xd892('0xf4'),_0xd892('0xf5')+_0x3f102a[_0xd892('0x4a')]+_0xd892('0xf6')+_0x3f102a[_0xd892('0x8b')],JSON[_0xd892('0x2c')](_0x2265e2));ami[_0xd892('0x29')](_0xd892('0xf7'),ut['buildObj'](_0x3f102a,_0xd892('0xf8'),_0x279377[_0xd892('0x28')][_0x3f102a[_0xd892('0x4a')]]));_0x28f4a9(ut[_0xd892('0x36')](_0xd892('0xf9')));})[_0xd892('0x62')](function(_0x41f549){ut[_0xd892('0x39')]('[Preview][execCall][failure]',_0x41f549);_0x1f475a(ut['message'](_0xd892('0xfa'),_0x6e1a49,_0x238f8e));});}else{_0x595718['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x3f102a);rpcDb[_0xd892('0xfb')](_0x3f102a,'[Blacklist][error]');delete _0x279377[_0xd892('0x48')][_0x311a81];_0x1f475a(ut[_0xd892('0x36')]('Contact\x20in\x20black\x20List',_0x6e1a49,_0x238f8e));}});};Preview[_0xd892('0xf')][_0xd892('0x72')]=function(_0x480d6e){return!_[_0xd892('0x47')](_0x480d6e)&&!_[_0xd892('0x47')](_0x480d6e[_0xd892('0x3b')])&&!_[_0xd892('0x47')](_0x480d6e[_0xd892('0xfc')])&&_0x480d6e[_0xd892('0xfc')]&&!_[_0xd892('0x47')](this[_0xd892('0x15')][util['format'](_0xd892('0xfd'),_0x480d6e[_0xd892('0x3b')])])&&!_[_0xd892('0x47')](this[_0xd892('0x15')][util['format'](_0xd892('0xfd'),_0x480d6e[_0xd892('0x3b')])][_0xd892('0x52')])&&(this[_0xd892('0x15')][util[_0xd892('0x2d')](_0xd892('0xfd'),_0x480d6e[_0xd892('0x3b')])][_0xd892('0x52')]===_0xd892('0xfe')||this[_0xd892('0x15')][util[_0xd892('0x2d')](_0xd892('0xfd'),_0x480d6e[_0xd892('0x3b')])]['status']===_0xd892('0xff'));};Preview[_0xd892('0xf')][_0xd892('0x60')]=function(_0x426041,_0x3b1395){return this[_0xd892('0x100')](_0x426041,_0x3b1395)[_0xd892('0x5b')](function(_0x4ae62d){return _['pick'](_0x4ae62d,[_0xd892('0x36')]);})[_0xd892('0x62')](function(_0x465876){if(_0x465876[_0xd892('0x101')]){rpcDb[_0xd892('0x102')](_0x426041);}if(_0x465876['active']){rpcDb[_0xd892('0x64')](_0x426041);}throw _[_0xd892('0x4d')](_0x465876,[_0xd892('0x36')]);});};Preview[_0xd892('0xf')][_0xd892('0x100')]=function(_0x318002,_0x504f14){var _0x4516e9=this;var _0x1b5bfb,_0x254176;return rpcDb['getContactPreview'](_0x318002)['then'](function(_0xdd797d){if(!_[_0xd892('0x47')](_0xdd797d[0x0])){_0x254176=_0xdd797d[0x0][_0xd892('0x103')]?![]:!![];_0x1b5bfb=_0xdd797d[0x0][_0xd892('0x103')]?!![]:![];_0x1b5bfb=_0x504f14?!![]:_0x1b5bfb;}var _0x306545=_0x4516e9['validateContact'](_0xdd797d);if(_0x306545[_0xd892('0x104')]){rpcDb['checkIsBlackList'](_[_0xd892('0x4d')](_0xdd797d[0x0],[_0xd892('0xef'),_0xd892('0xee')]))['then'](function(_0x3c5bcf){_0x4516e9['checkInBlack'](_0x3c5bcf,_0xdd797d[0x0],_0x504f14,_0x254176,_0x1b5bfb)[_0xd892('0x5b')](function(_0x4cdbda){return _0x4cdbda;})[_0xd892('0x62')](function(_0x580254){throw _0x580254;});})[_0xd892('0x62')](function(_0x108dd0){ut[_0xd892('0x39')]('[Preview][checkIsBlackList]',_0x108dd0);throw ut['message']('Call\x20unsuccessful',_0x254176,_0x1b5bfb);});}else{throw ut['message'](_0x306545[_0xd892('0x36')],_0x254176,_0x1b5bfb);}})[_0xd892('0x62')](function(_0x2a1495){ut[_0xd892('0x39')](_0xd892('0x105'),_0x2a1495);throw ut['message'](_0xd892('0x106'),![],!![]);});};Preview[_0xd892('0xf')]['validateContact']=function(_0x5c0179){if(_[_0xd892('0x47')](_0x5c0179)||_['isEmpty'](_0x5c0179)||!_[_0xd892('0x47')](_0x5c0179[0x0][_0xd892('0x5e')])&&_[_0xd892('0x47')](_0x5c0179[0x0][_0xd892('0x5e')]['name'])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x5c0179);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x93dfc0=this['campaignsPreview'][_0x5c0179[0x0][_0xd892('0x107')]['name']];_0x93dfc0[_0xd892('0x36')]=utils[_0xd892('0x37')][_0xd892('0x75')];if(_[_0xd892('0x47')](_0x93dfc0)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x93dfc0);return{'isValid':![],'message':_0xd892('0x108')};}if(!this[_0xd892('0x72')](_0x93dfc0['Trunk'])){ut[_0xd892('0x39')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0xd892('0x109')+_0x93dfc0[_0xd892('0x3b')]+_0xd892('0x10a'));if(!this[_0xd892('0x72')](_0x93dfc0['TrunkBackup'])){ut[_0xd892('0x39')](_0xd892('0x10b'),_0x93dfc0['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xd892('0x10c')};}}if(!ut[_0xd892('0x71')](_0x93dfc0['dialActive'])){ut[_0xd892('0x39')](_0xd892('0x10d'),_0x93dfc0[_0xd892('0x3b')]+_0xd892('0x10e'));return{'isValid':![],'message':_0xd892('0x109')+_0x93dfc0[_0xd892('0x3b')]+_0xd892('0x10e')};}return{'isValid':!![],'message':_0xd892('0x10f')};};Preview[_0xd892('0xf')][_0xd892('0xf3')]=function(_0x46ee78,_0x29fe96,_0x1d5e32,_0x485955){var _0xfee1f5=this;return new Promise(function(_0x3d8c89,_0x24c3c8){var _0x29a682=_0x46ee78['uniqueid'];var _0x14c1c6=_0xfee1f5[_0xd892('0x72')](_0x29fe96[_0xd892('0x73')])?util['format']('SIP/%s/%s%s',_0x29fe96['Trunk']['name'],_[_0xd892('0x47')](_0x29fe96[_0xd892('0x110')])?'':_0x29fe96[_0xd892('0x110')]['trim']()||'',_0x29fe96[_0xd892('0x111')]>0x0?_0x1d5e32['phone'][_0xd892('0x112')](_0x29fe96['dialCutDigit']):_0x1d5e32[_0xd892('0xee')]):util[_0xd892('0x2d')]('SIP/%s/%s%s',_[_0xd892('0x47')](_0x29fe96[_0xd892('0x113')])?_0x29fe96[_0xd892('0x73')][_0xd892('0x3b')]:_0x29fe96[_0xd892('0x113')][_0xd892('0x3b')],_[_0xd892('0x47')](_0x29fe96[_0xd892('0x110')])?'':_0x29fe96[_0xd892('0x110')][_0xd892('0x114')]()||'',_0x29fe96[_0xd892('0x111')]>0x0?_0x1d5e32['phone'][_0xd892('0x112')](_0x29fe96[_0xd892('0x111')]):_0x1d5e32['phone']);var _0xea2ec2=_0xfee1f5[_0xd892('0x72')](_0x29fe96[_0xd892('0x73')])?ut[_0xd892('0x115')](_0x29fe96[_0xd892('0x73')][_0xd892('0x116')],_0x29fe96[_0xd892('0x117')],_0x29fe96[_0xd892('0x118')]>0x0?ut[_0xd892('0x119')](_0x29fe96[_0xd892('0x11a')],_0x29fe96[_0xd892('0x118')]):_0x29fe96[_0xd892('0x11a')]):ut[_0xd892('0x115')](_['isNil'](_0x29fe96[_0xd892('0x113')])?_0x29fe96[_0xd892('0x73')][_0xd892('0x116')]:_0x29fe96[_0xd892('0x113')][_0xd892('0x116')],_0x29fe96['dialOriginateCallerIdName'],_0x29fe96[_0xd892('0x118')]>0x0?ut[_0xd892('0x119')](_0x29fe96[_0xd892('0x11a')],_0x29fe96[_0xd892('0x118')]):_0x29fe96[_0xd892('0x11a')]);if(_0xea2ec2){_0x46ee78[_0xd892('0x11b')]=ut['extractCalleridName'](_0xea2ec2);_0x46ee78['originatecalleridnum']=ut['extractCalleridNumber'](_0xea2ec2);}var _0x4ae966=ut[_0xd892('0x11c')](_0x29fe96,_0x1d5e32,_0x14c1c6,_0xea2ec2,_0x29a682,_0x46ee78);var _0x5699d4=utils[_0xd892('0x11d')](_0x1d5e32[_0xd892('0xed')]);Object['assign'](_0x4ae966,_0x5699d4);_[_0xd892('0x11e')](_0x46ee78,ut[_0xd892('0x11f')](_0x4ae966));_0x46ee78['starttime']=moment()[_0xd892('0x2d')](_0xd892('0x120'));_0x29fe96[_0xd892('0x121')]=_0x4ae966;var _0x76729a=ut[_0xd892('0x122')](_0x46ee78,_0x29fe96,_0x4ae966,_0x46ee78[_0xd892('0x88')],_0x485955);return ami[_0xd892('0x51')](_0x76729a)[_0xd892('0x5b')](function(_0x352139){_0x29fe96[_0xd892('0x32')]+=0x1;logger[_0xd892('0x2a')](_0xd892('0x123'),_0x29a682,_0xd892('0x90'),_0x29fe96[_0xd892('0x3b')],_0xd892('0xdb'),_0x29fe96[_0xd892('0x32')]);_0x3d8c89(_0x352139);})[_0xd892('0x62')](function(_0x4a4d66){ut[_0xd892('0xe1')](_0x46ee78,0xe,_0xd892('0x124'));rpcDb['createAgentHistory'](_0x46ee78,'[originateFailure][logOriginateFailure]');_0x24c3c8(_0x4a4d66);});});};Preview['prototype'][_0xd892('0x22')]=function(_0x2b73cf){if(this['actions'][_0x2b73cf['linkedid']]){this[_0xd892('0x48')][_0x2b73cf[_0xd892('0x89')]][_0xd892('0x53')]=_0x2b73cf[_0xd892('0x53')];}};Preview['prototype'][_0xd892('0x19')]=function(_0x217d25){var _0x4706a6=this;var _0x57bb1c=this[_0xd892('0x48')][_0x217d25['actionid']];if(_0x57bb1c){if(_0x57bb1c[_0xd892('0xf1')]&&this[_0xd892('0x16')][_0x57bb1c[_0xd892('0xf1')]]){ut['logLookAgent'](_0x57bb1c,this[_0xd892('0x16')][_0x57bb1c[_0xd892('0xf1')]][_0xd892('0x3b')],this[_0xd892('0x16')][_0x57bb1c[_0xd892('0xf1')]]['id']);}var _0x1d2e6a=_[_0xd892('0x125')](_0x57bb1c);_0x1d2e6a['responsetime']=moment()[_0xd892('0x2d')](_0xd892('0x120'));var _0x5c372d=_0x4706a6[_0xd892('0x28')][_0x57bb1c['queue']];if(ut['isFailure'](_0x217d25['response'])){if(_0x57bb1c[_0xd892('0x87')]){rpcDb[_0xd892('0x102')](_0x57bb1c[_0xd892('0x8b')]);}if(_0x57bb1c[_0xd892('0x88')]){rpcDb[_0xd892('0x64')](_0x57bb1c[_0xd892('0x8b')]);}ami[_0xd892('0x29')]('custom:agentringnoanswer',ut[_0xd892('0x7a')](_0x57bb1c,_0xd892('0x126'),this['campaignsPreview'][_0x57bb1c[_0xd892('0x4a')]]));this[_0xd892('0x127')](_0x1d2e6a,_0x5c372d,_0x217d25);}else{_0x57bb1c['starttime']=moment()['format'](_0xd892('0x120'));ut['logAgent'](_0x1d2e6a,0x4,_0xd892('0x9c'));rpcDb[_0xd892('0xe3')](_0x1d2e6a,_0xd892('0x128'));}}};Preview[_0xd892('0xf')]['syncHangup']=function(_0x5a0f9d){var _0x3ef549=this[_0xd892('0x48')][_0x5a0f9d[_0xd892('0x89')]];var _0x1bcae4;if(_0x3ef549){_0x1bcae4=this[_0xd892('0x28')][_0x3ef549[_0xd892('0x4a')]];logger['info'](_0xd892('0x129'),_0x5a0f9d[_0xd892('0x89')],'\x20Queue',_0x1bcae4[_0xd892('0x3b')],_0xd892('0x4b'),_0x1bcae4['pTalking']);}if(this[_0xd892('0x48')][_0x5a0f9d[_0xd892('0x89')]]&&_0x5a0f9d[_0xd892('0x89')]!==_0x5a0f9d[_0xd892('0x8f')]){if(_0x5a0f9d[_0xd892('0x12a')]==='16'&&this[_0xd892('0x48')][_0x5a0f9d['linkedid']]['dialAnswer']){this['callProgressDetectingCustomer'](_0x5a0f9d,_0x5a0f9d[_0xd892('0x89')],_0x5a0f9d[_0xd892('0x12a')]);}else if(this['actions'][_0x5a0f9d[_0xd892('0x89')]][_0xd892('0x4c')]){logger['info'](_0xd892('0x12b'),_0x5a0f9d[_0xd892('0x89')],_0x5a0f9d[_0xd892('0x12a')],_0xd892('0x90'),_0x1bcae4[_0xd892('0x3b')],_0xd892('0x4b'),_0x1bcae4[_0xd892('0x33')]);this[_0xd892('0x76')](_0x5a0f9d,_0x5a0f9d['linkedid'],_0x5a0f9d[_0xd892('0x12a')]);}}else if(_0x3ef549&&_['isNil'](_0x3ef549[_0xd892('0x12c')])&&_0x1bcae4[_0xd892('0x12d')]&&_0x5a0f9d[_0xd892('0x89')]===_0x5a0f9d[_0xd892('0x8f')]&&_['isNil'](_0x5a0f9d[_0xd892('0xe0')])&&_0x5a0f9d['cause']==='16'&&_0x5a0f9d['channelstate']==='6'&&_[_0xd892('0xde')](_0x3ef549['transfer'])){if(_0x3ef549['unlockAgent']){rpcDb[_0xd892('0x102')](_0x3ef549['idContact']);}if(_0x3ef549[_0xd892('0x88')]){rpcDb[_0xd892('0x64')](_0x3ef549[_0xd892('0x8b')]);}_0x5a0f9d[_0xd892('0xe0')]='22';this[_0xd892('0x127')](_0x3ef549,_0x1bcae4,_0x5a0f9d);}else if(_0x3ef549&&_0x3ef549['transfer']){if(_0x5a0f9d[_0xd892('0x12a')]==='16'&&this[_0xd892('0x48')][_0x5a0f9d[_0xd892('0x89')]][_0xd892('0x4c')]){logger[_0xd892('0x2a')](_0xd892('0x12e'),_0x5a0f9d[_0xd892('0x89')],_0x5a0f9d[_0xd892('0x12a')],_0xd892('0x90'),_0x1bcae4['name'],'pTalking:\x20',_0x1bcae4[_0xd892('0x33')]);this['callProgressDetectingCustomer'](_0x5a0f9d,_0x5a0f9d[_0xd892('0x89')],_0x5a0f9d[_0xd892('0x12a')]);}else if(this[_0xd892('0x48')][_0x5a0f9d[_0xd892('0x89')]][_0xd892('0x4c')]){logger[_0xd892('0x2a')](_0xd892('0x12b'),_0x5a0f9d[_0xd892('0x89')],_0x5a0f9d[_0xd892('0x12a')],_0xd892('0x90'),_0x1bcae4[_0xd892('0x3b')],_0xd892('0x4b'),_0x1bcae4[_0xd892('0x33')]);this['callProgressDetectingCustomer'](_0x5a0f9d,_0x5a0f9d['linkedid'],_0x5a0f9d[_0xd892('0x12a')]);}}};Preview[_0xd892('0xf')][_0xd892('0x20')]=function(_0x29a851){if(this[_0xd892('0x48')][_0x29a851[_0xd892('0xdc')]]&&_0x29a851[_0xd892('0xdc')]!==_0x29a851['destuniqueid']){this[_0xd892('0x76')](_0x29a851,_0x29a851['destlinkedid'],_0x29a851[_0xd892('0xd4')]);}};Preview[_0xd892('0xf')][_0xd892('0x1e')]=function(_0x332429){if(this[_0xd892('0x48')][_0x332429[_0xd892('0x89')]]&&_0x332429[_0xd892('0x89')]!==_0x332429['uniqueid']&&!this[_0xd892('0x48')][_0x332429[_0xd892('0x89')]][_0xd892('0x4c')]){if(_0x332429[_0xd892('0x12a')]==='1'){this[_0xd892('0x76')](_0x332429,_0x332429[_0xd892('0x89')],_0x332429[_0xd892('0x12a')]);}}};Preview[_0xd892('0xf')][_0xd892('0x12f')]=function(_0x274b39,_0x5ea098,_0xd285c3){if(this[_0xd892('0x48')][_0x274b39]){if(_[_0xd892('0x47')](this[_0xd892('0x48')][_0x274b39][_0xd892('0x121')])){this[_0xd892('0x48')][_0x274b39]['variables']={};}this[_0xd892('0x48')][_0x274b39][_0xd892('0x121')][_0x5ea098]=_0xd285c3;}};Preview[_0xd892('0xf')]['syncVarSet']=function(_0x14bf5c){try{if(!_[_0xd892('0x47')](_0x14bf5c)){if(ut[_0xd892('0x130')](_['keys'](_0x14bf5c[_0xd892('0x131')])[0x0])){this['addVariable'](_0x14bf5c['uniqueid'],_['keys'](_0x14bf5c[_0xd892('0x131')])[0x0],_0x14bf5c[_0xd892('0x132')]);}}}catch(_0xc0d511){logger[_0xd892('0x133')](_0xd892('0x134'),util['inspect'](_0xc0d511,{'showHidden':![],'depth':null}));}};Preview[_0xd892('0xf')]['syncAttendedTransfer']=function(_0x1e3e17){if(_0x1e3e17){if(this[_0xd892('0x48')][_0x1e3e17[_0xd892('0x135')]]){this[_0xd892('0x48')][_0x1e3e17['transfertargetlinkedid']][_0xd892('0x136')]=!![];}}};Preview[_0xd892('0xf')]['syncBlindTransfer']=function(_0x565d07){if(_0x565d07){if(this['actions'][_0x565d07['transfererlinkedid']]){this[_0xd892('0x48')][_0x565d07[_0xd892('0x137')]][_0xd892('0x136')]=!![];}}};module[_0xd892('0x138')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index ce802a9..8ea52f5 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 _0x4e07=['queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','context','from-sip','exten','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','catch','resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','active','rescheduleContact','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0x4e07,0x18d));var _0x74e0=function(_0x2d82e0,_0x4071cd){_0x2d82e0=_0x2d82e0-0x0;var _0x4d6568=_0x4e07[_0x2d82e0];return _0x4d6568;};'use strict';var util=require(_0x74e0('0x0'));var BPromise=require(_0x74e0('0x1'));var logger=require(_0x74e0('0x2'))(_0x74e0('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x74e0('0x4'));var cmHopperBlack=require(_0x74e0('0x5'));var agentReportPreview=require(_0x74e0('0x6'));var voiceQueueReport=require(_0x74e0('0x7'));function loggerCatch(_0xb9df4b){return function(_0x517384){logger[_0x74e0('0x8')](_0xb9df4b,util[_0x74e0('0x9')](_0x517384,{'showHidden':![],'depth':null}));};}function create(_0x2f82fd){return cmHopperHistory['createHistory'](_0x2f82fd)[_0x74e0('0xa')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x13ee5b){return BPromise[_0x74e0('0xb')]()[_0x74e0('0xc')](agentReportPreview[_0x74e0('0xd')](_0x13ee5b))[_0x74e0('0xa')](loggerCatch(_0x74e0('0xe')));}function moveContact(_0x521fb2){return cmHopper[_0x74e0('0xf')](_0x521fb2,!![])[_0x74e0('0xa')](loggerCatch(_0x74e0('0x10')));}exports[_0x74e0('0x11')]=function(_0x485b93){return cmHopperBlack[_0x74e0('0x11')](_0x485b93)[_0x74e0('0xa')](loggerCatch(_0x74e0('0x12')));};exports[_0x74e0('0x13')]=function(_0x2ad5f7){return BPromise[_0x74e0('0xb')]()[_0x74e0('0xc')](cmHopper[_0x74e0('0x13')](_0x2ad5f7))['catch'](loggerCatch(_0x74e0('0x14')));};exports['createHistory']=function(_0x219bc4,_0x18fc75){create(_0x219bc4)['catch'](loggerCatch(_0x18fc75));moveContact(_0x219bc4)['catch'](loggerCatch(_0x18fc75));};exports[_0x74e0('0x15')]=function(_0x471b7e,_0x1384ef){createAgent(_0x471b7e)[_0x74e0('0xa')](loggerCatch(_0x1384ef));};exports[_0x74e0('0x16')]=function(_0x5154b1,_0x591f54){create(_0x5154b1)[_0x74e0('0xa')](loggerCatch(_0x591f54));};exports['createCustomerFinal']=function(_0x2fba0a,_0x22e1e3){moveContact(_0x2fba0a)['catch'](loggerCatch(_0x22e1e3));};exports['rescheduleContact']=function(_0x2926ab,_0x40654a,_0x3150a7){if(_0x40654a){_0x2926ab['UserId']=null;}if(_0x3150a7){_0x2926ab[_0x74e0('0x17')]=![];}return cmHopper[_0x74e0('0x18')](_0x2926ab)['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x74e0('0x19')]=function(_0x3e5233){return cmHopper['countReScheduled'](_0x3e5233)[_0x74e0('0xa')](loggerCatch('[countReScheduled]\x20'));};exports[_0x74e0('0x1a')]=function(_0x27c82b){return cmHopper[_0x74e0('0x1a')]({'UserId':null},_0x27c82b,0x1)[_0x74e0('0xa')](loggerCatch(_0x74e0('0x1b')));};exports['disableContact']=function(_0x569f45){return cmHopper[_0x74e0('0x1a')]({'active':![]},_0x569f45,0x1)[_0x74e0('0xa')](loggerCatch(_0x74e0('0x1c')));};exports[_0x74e0('0x1d')]=function(_0x1bf64c){var _0x5e0498={};_0x5e0498[_0x74e0('0x1e')]=_0x1bf64c['type'];_0x5e0498[_0x74e0('0x1f')]=_0x1bf64c['uniqueid'];_0x5e0498['calleridnum']=_0x1bf64c[_0x74e0('0x20')];_0x5e0498[_0x74e0('0x21')]=_0x1bf64c[_0x74e0('0x21')];_0x5e0498[_0x74e0('0x22')]=_0x1bf64c[_0x74e0('0x22')];_0x5e0498[_0x74e0('0x23')]=_0x1bf64c[_0x74e0('0x24')];_0x5e0498[_0x74e0('0x25')]=_0x1bf64c['answertime'];_0x5e0498[_0x74e0('0x26')]=0x1;_0x5e0498['queuecallercompleteAt']=_0x1bf64c[_0x74e0('0x27')];_0x5e0498['connectedlinename']=_0x1bf64c['membername'];_0x5e0498[_0x74e0('0x28')]=_0x74e0('0x29');_0x5e0498[_0x74e0('0x2a')]='xcally-motion-preview';_0x5e0498[_0x74e0('0x2b')]=0x0;_0x5e0498[_0x74e0('0x2c')]=0x1;_0x5e0498[_0x74e0('0x2d')]=_0x1bf64c[_0x74e0('0x2e')];_0x5e0498[_0x74e0('0x2f')]=_0x74e0('0x30');return BPromise[_0x74e0('0xb')]()[_0x74e0('0xc')](voiceQueueReport[_0x74e0('0x31')](_0x5e0498))[_0x74e0('0xa')](loggerCatch(_0x74e0('0x32')));};exports[_0x74e0('0x33')]=function(_0x14ca9c,_0x12f5bb){return BPromise[_0x74e0('0xb')]()['then'](cmHopper[_0x74e0('0x33')](_0x14ca9c,_0x12f5bb))['catch'](loggerCatch(_0x74e0('0x34')));};exports[_0x74e0('0x35')]=function(_0x1fd740){return cmHopper[_0x74e0('0x18')](_0x1fd740,!![],!![])[_0x74e0('0xa')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x7c62=['resolve','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/agentReportPreview','error','inspect','createHistory'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c62,0x1df));var _0x27c6=function(_0x247068,_0x4f3719){_0x247068=_0x247068-0x0;var _0x2dbf0e=_0x7c62[_0x247068];return _0x2dbf0e;};'use strict';var util=require('util');var BPromise=require(_0x27c6('0x0'));var logger=require('../../../config/logger')('preview');var cmHopper=require(_0x27c6('0x1'));var cmHopperHistory=require(_0x27c6('0x2'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0x27c6('0x3'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x37f514){return function(_0x3e4fc2){logger[_0x27c6('0x4')](_0x37f514,util[_0x27c6('0x5')](_0x3e4fc2,{'showHidden':![],'depth':null}));};}function create(_0x184a76){return cmHopperHistory[_0x27c6('0x6')](_0x184a76)['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x2dc526){return BPromise[_0x27c6('0x7')]()[_0x27c6('0x8')](agentReportPreview[_0x27c6('0x6')](_0x2dc526))[_0x27c6('0x9')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x2a07e2){return cmHopper[_0x27c6('0xa')](_0x2a07e2,!![])[_0x27c6('0x9')](loggerCatch(_0x27c6('0xb')));}exports[_0x27c6('0xc')]=function(_0x29c42b){return cmHopperBlack[_0x27c6('0xc')](_0x29c42b)[_0x27c6('0x9')](loggerCatch(_0x27c6('0xd')));};exports['getContactPreview']=function(_0x4ba47f){return BPromise[_0x27c6('0x7')]()[_0x27c6('0x8')](cmHopper[_0x27c6('0xe')](_0x4ba47f))[_0x27c6('0x9')](loggerCatch(_0x27c6('0xf')));};exports[_0x27c6('0x6')]=function(_0xb22696,_0x41e2ed){create(_0xb22696)[_0x27c6('0x9')](loggerCatch(_0x41e2ed));moveContact(_0xb22696)[_0x27c6('0x9')](loggerCatch(_0x41e2ed));};exports[_0x27c6('0x10')]=function(_0xa24fa5,_0x2fcbde){createAgent(_0xa24fa5)['catch'](loggerCatch(_0x2fcbde));};exports[_0x27c6('0x11')]=function(_0x5e3419,_0x447402){create(_0x5e3419)['catch'](loggerCatch(_0x447402));};exports[_0x27c6('0x12')]=function(_0x169036,_0x2ac4fd){moveContact(_0x169036)[_0x27c6('0x9')](loggerCatch(_0x2ac4fd));};exports[_0x27c6('0x13')]=function(_0x33fcf1,_0x2d8a78,_0x39899e){if(_0x2d8a78){_0x33fcf1['UserId']=null;}if(_0x39899e){_0x33fcf1['active']=![];}return cmHopper[_0x27c6('0x13')](_0x33fcf1)['catch'](loggerCatch(_0x27c6('0x14')));};exports[_0x27c6('0x15')]=function(_0xb9f6f4){return cmHopper[_0x27c6('0x15')](_0xb9f6f4)[_0x27c6('0x9')](loggerCatch(_0x27c6('0x16')));};exports[_0x27c6('0x17')]=function(_0x1ea527){return cmHopper[_0x27c6('0x17')]({'UserId':null},_0x1ea527,0x1)[_0x27c6('0x9')](loggerCatch(_0x27c6('0x18')));};exports[_0x27c6('0x19')]=function(_0x5747d4){return cmHopper[_0x27c6('0x17')]({'active':![]},_0x5747d4,0x1)[_0x27c6('0x9')](loggerCatch(_0x27c6('0x1a')));};exports[_0x27c6('0x1b')]=function(_0x173a1c){var _0x58a0f3={};_0x58a0f3[_0x27c6('0x1c')]=_0x173a1c[_0x27c6('0x1c')];_0x58a0f3[_0x27c6('0x1d')]=_0x173a1c[_0x27c6('0x1d')];_0x58a0f3[_0x27c6('0x1e')]=_0x173a1c[_0x27c6('0x1e')];_0x58a0f3[_0x27c6('0x1f')]=_0x173a1c[_0x27c6('0x1f')];_0x58a0f3[_0x27c6('0x20')]=_0x173a1c['queue'];_0x58a0f3[_0x27c6('0x21')]=_0x173a1c[_0x27c6('0x22')];_0x58a0f3[_0x27c6('0x23')]=_0x173a1c[_0x27c6('0x22')];_0x58a0f3[_0x27c6('0x24')]=0x1;_0x58a0f3[_0x27c6('0x25')]=_0x173a1c[_0x27c6('0x26')];_0x58a0f3['connectedlinename']=_0x173a1c[_0x27c6('0x27')];_0x58a0f3['context']=_0x27c6('0x28');_0x58a0f3[_0x27c6('0x29')]=_0x27c6('0x2a');_0x58a0f3[_0x27c6('0x2b')]=0x0;_0x58a0f3[_0x27c6('0x2c')]=0x1;_0x58a0f3[_0x27c6('0x2d')]=_0x173a1c[_0x27c6('0x27')];_0x58a0f3[_0x27c6('0x2e')]=_0x27c6('0x2f');return BPromise[_0x27c6('0x7')]()[_0x27c6('0x8')](voiceQueueReport[_0x27c6('0x30')](_0x58a0f3))[_0x27c6('0x9')](loggerCatch(_0x27c6('0x31')));};exports[_0x27c6('0x32')]=function(_0x23b47b,_0x4ed2c9){return BPromise[_0x27c6('0x7')]()['then'](cmHopper['getContactRecallMe'](_0x23b47b,_0x4ed2c9))[_0x27c6('0x9')](loggerCatch(_0x27c6('0x33')));};exports[_0x27c6('0x34')]=function(_0x1bcce9){return cmHopper[_0x27c6('0x13')](_0x1bcce9,!![],!![])[_0x27c6('0x9')](loggerCatch(_0x27c6('0x35')));}; \ 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 826a211..9d75574 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 _0x6228=['rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','info','inspect','loggerError','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridnum','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','hasOwnProperty','toLower','updateOriginated','originated','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','statedesc','getSeconds','logLookAgent','UserId','logCustomer','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','interface','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','diff','seconds','CampaignId','filterKey','type','campaigntype','membername','countbusyretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss'];(function(_0x4bc232,_0x39ff32){var _0x4db762=function(_0x2b51c3){while(--_0x2b51c3){_0x4bc232['push'](_0x4bc232['shift']());}};_0x4db762(++_0x39ff32);}(_0x6228,0x9f));var _0x8622=function(_0x1cb1a8,_0x17b037){_0x1cb1a8=_0x1cb1a8-0x0;var _0x719d46=_0x6228[_0x1cb1a8];return _0x719d46;};'use strict';var util=require(_0x8622('0x0'));var _=require(_0x8622('0x1'));var moment=require(_0x8622('0x2'));var logger=require('../../../../config/logger')(_0x8622('0x3'));var ipAgi=process[_0x8622('0x4')][_0x8622('0x5')]||_0x8622('0x6');var utils=require(_0x8622('0x7'));exports[_0x8622('0x8')]=function(_0x8f412d){return function(_0x4b8876){logger[_0x8622('0x9')](_0x8f412d,util['inspect'](_0x4b8876,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x390696,_0x4d080c){logger[_0x8622('0xa')](_0x390696,util[_0x8622('0xb')](_0x4d080c,{'showHidden':![],'depth':null}));};exports[_0x8622('0xc')]=function(_0xf4f5a,_0x38db6e){logger[_0x8622('0x9')](_0xf4f5a,util[_0x8622('0xb')](_0x38db6e,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x245177){return function(_0xb744e0){logger[_0x8622('0xa')](_0x245177,util[_0x8622('0xb')](_0xb744e0,{'showHidden':![],'depth':null}));};};exports[_0x8622('0xd')]=function(_0x4952b8,_0x57179e,_0x30a2c8){return{'message':_0x4952b8,'unlock':_0x57179e,'active':_0x30a2c8};};exports['getCallerId']=function(_0x1d8a0d,_0x32179e,_0x2c22b4){if(!_[_0x8622('0xe')](_0x2c22b4)&&_0x8622('0xf')===typeof _0x2c22b4&&!_['isEmpty'](_0x2c22b4)){if(!_['isUndefined'](_0x32179e)&&_0x8622('0xf')===typeof _0x32179e&&!_[_0x8622('0x10')](_0x32179e)){return util[_0x8622('0x11')](_0x8622('0x12'),_0x32179e,_0x2c22b4);}return util[_0x8622('0x11')](_0x8622('0x12'),_0x2c22b4,_0x2c22b4);}if(!_[_0x8622('0xe')](_0x1d8a0d)&&_0x8622('0xf')===typeof _0x1d8a0d&&!_[_0x8622('0x10')](_0x1d8a0d)){return _0x1d8a0d;}return _0x8622('0x13');};exports['isActive']=function(_0x487d39){if(_[_0x8622('0x14')](_0x487d39)){return![];}return _0x487d39;};exports[_0x8622('0x15')]=function(_0x320793,_0x561fea,_0x385aee,_0x1e3ae1,_0x56d0ae,_0x62de30){var _0x487069={'XMD-QUEUE':_0x561fea[_0x8622('0x16')]?_0x561fea[_0x8622('0x16')][_0x8622('0x17')]:'','XMD-CALLERID':_0x1e3ae1,'XMD-CALLERID-PREVIEW':_0x62de30?util[_0x8622('0x11')]('\x22%s\x22\x20<%s>',_0x62de30['calleridname'],_0x62de30[_0x8622('0x18')]):_0x1e3ae1,'XMD-DIALID':_0x56d0ae,'XMD-CONTACTID':_0x561fea['ContactId'],'XMD-CDRTYPE':_0x8622('0x19'),'CALLERID(all)':_0x1e3ae1,'XMD-VOICEQUEUEID':_0x561fea['VoiceQueueId'],'XMD-DIALCHANNEL':_0x385aee,'XMD-DIALTIMEOUT':_0x320793[_0x8622('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x8622('0x11')](_0x8622('0x1b'),_0x320793['dialQueueProject2']?'g':'',_[_0x8622('0x10')](_0x320793[_0x8622('0x1c')])?'':_0x8622('0x1d')),'XMD-DIALURL':_0x320793[_0x8622('0x1e')]||'','XMD-AGI':_0x320793[_0x8622('0x1f')]?util[_0x8622('0x11')](_0x8622('0x20'),ipAgi,_0x320793[_0x8622('0x1f')]):_0x8622('0x21'),'XMD-AGIAFTER':_0x320793['dialQueueProject2']?util[_0x8622('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x320793[_0x8622('0x22')]):_0x8622('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x62de30?_0x62de30[_0x8622('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x62de30?_0x62de30[_0x8622('0x24')]:'','XMD-DESTINATION':_0x8622('0x25'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x320793[_0x8622('0x1c')])){_0x487069[util[_0x8622('0x11')]('%s',_0x8622('0x26'))]=_0x320793[_0x8622('0x1c')];_0x487069[util[_0x8622('0x11')]('%s',_0x8622('0x27'))]=_0x56d0ae;}return _0x487069;};exports['toLowerVariables']=function(_0x3b802c){var _0x1d6ae0={};for(var _0x138978 in _0x3b802c){if(_0x3b802c[_0x8622('0x28')](_0x138978)){_0x1d6ae0[util[_0x8622('0x11')]('%s',_[_0x8622('0x29')](_0x138978))]=_0x3b802c[_0x138978];}}return{'variables':_0x1d6ae0};};exports[_0x8622('0x2a')]=function(_0x3fa1ca,_0x2601fd){if(!_[_0x8622('0x14')](_0x3fa1ca)){if(_0x3fa1ca[_0x8622('0x28')](_0x8622('0x2b'))){if(_0x3fa1ca['originated']>0x0){_0x3fa1ca['originated']-=0x1;}else{logger[_0x8622('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x2601fd);}}}else{logger[_0x8622('0x9')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x2601fd);}};exports['logBlacklist']=function(_0x1d8919){var _0x59bc5f=moment()[_0x8622('0x11')](_0x8622('0x2c'));_0x1d8919[_0x8622('0x2d')]=0xd;_0x1d8919['statedesc']=_0x8622('0x2e');_0x1d8919[_0x8622('0x2f')]=_0x59bc5f;_0x1d8919[_0x8622('0x30')]=_0x59bc5f;_0x1d8919[_0x8622('0x31')]=_0x59bc5f;};exports['logAgent']=function(_0x300b6d,_0x17f93a,_0x204991){var _0x2d7eda=moment()[_0x8622('0x11')](_0x8622('0x2c'));_0x300b6d[_0x8622('0x2d')]=_0x17f93a;_0x300b6d[_0x8622('0x32')]=_0x204991;_0x300b6d[_0x8622('0x30')]=_0x2d7eda;_0x300b6d['ringtime']=utils[_0x8622('0x33')](_0x300b6d[_0x8622('0x30')],_0x300b6d[_0x8622('0x2f')]);};exports[_0x8622('0x34')]=function(_0x2e10fc,_0x6835ea,_0x184dd2){_0x2e10fc['membername']=_0x6835ea;_0x2e10fc[_0x8622('0x35')]=_0x184dd2;};exports[_0x8622('0x36')]=function(_0x53182,_0x30c0a5,_0x3d3cad){var _0x5772d=moment()['format'](_0x8622('0x2c'));_0x53182[_0x8622('0x2d')]=_0x30c0a5;_0x53182[_0x8622('0x32')]=_0x3d3cad;_0x53182['responsetime']=_0x53182[_0x8622('0x30')]?_0x53182[_0x8622('0x30')]:_0x5772d;_0x53182[_0x8622('0x31')]=_0x53182[_0x8622('0x31')]?_0x53182[_0x8622('0x31')]:_0x5772d;_0x53182[_0x8622('0x37')]=utils[_0x8622('0x33')](_0x53182[_0x8622('0x30')]||0x0,_0x53182[_0x8622('0x2f')]||0x0);_0x53182[_0x8622('0x38')]=_0x53182[_0x8622('0x39')]?utils['getSeconds'](_0x53182[_0x8622('0x31')],_0x53182['answertime']):0x0;};exports[_0x8622('0x3a')]=function(_0x3d3d9a){return _0x3d3d9a===_0x8622('0x3b');};exports[_0x8622('0x3c')]=function(_0x360de2,_0x4a7c93,_0x533b16,_0x176400,_0x376e7b){var _0x4c38fa=_0x176400?_0x8622('0x3d'):_0x360de2[_0x8622('0x3e')];_0x4c38fa=_0x376e7b?'BOOKED':_0x4c38fa;return{'actionid':_0x360de2[_0x8622('0x3f')],'action':'originate','channel':_0x360de2[_0x8622('0x40')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x4c38fa,_0x360de2[_0x8622('0x18')]),'Exten':_0x8622('0x25'),'Context':_0x8622('0x41'),'Priority':'1','variable':_0x533b16,'timeout':(_0x4a7c93[_0x8622('0x42')]||0x1e)*0x3e8,'async':!![],'channelid':_0x360de2[_0x8622('0x3f')]};};exports[_0x8622('0x43')]=function(_0x28ded2){return _0x28ded2['countbusyretry']+_0x28ded2[_0x8622('0x44')]+_0x28ded2['countnoanswerretry']+_0x28ded2['countagentrejectretry']+_0x28ded2['countnosuchnumberretry'];};exports[_0x8622('0x45')]=function(_0x202e07){var _0x94eb2e=_['clone'](_0x202e07);_0x94eb2e['state']=0xf;_0x94eb2e[_0x8622('0x32')]=_0x8622('0x46');return _0x94eb2e;};exports[_0x8622('0x47')]=function(_0x15ff22,_0x3667fb,_0x1d1b2e){var _0x1d1fa3={};_0x1d1fa3[_0x3667fb]=_0x15ff22[_0x3667fb];_0x1d1fa3[_0x8622('0x48')]=![];_0x1d1fa3[_0x8622('0x49')]=moment()[_0x8622('0x4a')](_0x1d1b2e,_0x8622('0x4b'))['format'](_0x8622('0x2c'));_0x1d1fa3['ContactId']=_0x15ff22[_0x8622('0x4c')];_0x1d1fa3['ListId']=_0x15ff22[_0x8622('0x4d')];_0x1d1fa3[_0x8622('0x4e')]=_0x15ff22[_0x8622('0x4e')]||undefined;return _0x1d1fa3;};exports[_0x8622('0x4f')]=function(_0x53284e,_0x3bb56d){if(!_[_0x8622('0x14')](_0x53284e)){if(_0x53284e[_0x8622('0x50')]>0x0){_0x53284e['pTalking']-=0x1;}else{logger[_0x8622('0x9')](_0x3bb56d,_0x8622('0x51'));}}else{logger['error'](_0x3bb56d,_0x8622('0x52'));}};exports[_0x8622('0x53')]=function(_0x457ac7){if(_0x457ac7<=0x0){return!![];}return![];};function buildObj(_0x17fbee,_0x18e075,_0x453066){_0x17fbee['lastevent']=_0x18e075;_0x17fbee[_0x8622('0x17')]=_0x17fbee[_0x8622('0x54')];_0x17fbee[_0x8622('0x55')]=_0x17fbee[_0x8622('0x40')];_0x17fbee['motionChannel']=_0x8622('0x56');if(_0x453066){_0x17fbee[_0x8622('0x57')]=_0x453066[_0x8622('0x57')];}return _0x17fbee;}exports[_0x8622('0x58')]=buildObj;exports[_0x8622('0x59')]=function(_0x17cabb){var _0x349746={};_0x349746['queue']=_0x17cabb[_0x8622('0x54')];_0x349746['interface']=_0x17cabb[_0x8622('0x40')];_0x349746[_0x8622('0x3f')]=_0x17cabb[_0x8622('0x3f')];return _0x349746;};exports[_0x8622('0x5a')]=function(_0x212d39){var _0xdc6907=[];for(var _0x36e4b9 in _0x212d39){if(_0x212d39[_0x8622('0x28')](_0x36e4b9)){if(!_['isNil'](_0x212d39[_0x36e4b9])&&_0x212d39[_0x36e4b9][_0x8622('0x2d')]===_0x8622('0x5b')&&_0x212d39[_0x36e4b9][_0x8622('0x5c')]===_0x8622('0x5d')){_0xdc6907[_0x8622('0x5e')](_0x212d39[_0x36e4b9]['id']);}}}return _0xdc6907;};exports[_0x8622('0x5f')]=function(_0x4817dd){var _0x1aba93=moment()['milliseconds'](0x0);var _0x5485fd=moment(_0x4817dd)['milliseconds'](0x0);return _0x1aba93[_0x8622('0x60')](_0x5485fd,_0x8622('0x61'));};exports['createBody']=function(_0x4a9252){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4a9252['ContactId'],'ListId':_0x4a9252['ListId'],'VoiceQueueId':_0x4a9252['VoiceQueueId']||undefined,'CampaignId':_0x4a9252[_0x8622('0x62')]||undefined};};exports[_0x8622('0x63')]=function(_0x5302ad){if(_0x5302ad===_0x8622('0x3f')||_0x5302ad==='idContact'||_0x5302ad===_0x8622('0x54')||_0x5302ad===_0x8622('0x64')||_0x5302ad===_0x8622('0x65')||_0x5302ad==='dialAnswer'||_0x5302ad===_0x8622('0x66')||_0x5302ad===_0x8622('0x40')||_0x5302ad===_0x8622('0x3e')||_0x5302ad===_0x8622('0x48')||_0x5302ad===_0x8622('0x18')||_0x5302ad===_0x8622('0x49')||_0x5302ad===_0x8622('0x67')||_0x5302ad===_0x8622('0x44')||_0x5302ad===_0x8622('0x68')||_0x5302ad===_0x8622('0x69')||_0x5302ad===_0x8622('0x6a')||_0x5302ad===_0x8622('0x6b')||_0x5302ad===_0x8622('0x6c')||_0x5302ad===_0x8622('0x6d')||_0x5302ad===_0x8622('0x4c')||_0x5302ad===_0x8622('0x4d')||_0x5302ad===_0x8622('0x35')||_0x5302ad===_0x8622('0x4e')||_0x5302ad===_0x8622('0x6e')||_0x5302ad==='xmd-voicequeueid'||_0x5302ad===_0x8622('0x6f')||_0x5302ad===_0x8622('0x70')||_0x5302ad===_0x8622('0x71')||_0x5302ad==='xmd-dialurl'||_0x5302ad===_0x8622('0x72')||_0x5302ad===_0x8622('0x73')||_0x5302ad==='xmd-dialid'||_0x5302ad===_0x8622('0x74')||_0x5302ad===_0x8622('0x75')||_0x5302ad===_0x8622('0x76')||_0x5302ad==='xmd-callerid'||_0x5302ad===_0x8622('0x77')||_0x5302ad===_0x8622('0x78')||_0x5302ad===_0x8622('0x79')||_0x5302ad===_0x8622('0x7a')||_0x5302ad===_0x8622('0x7b')||_0x5302ad==='rtpaudioqosjitterbridged'||_0x5302ad===_0x8622('0x7c')||_0x5302ad==='rtpaudioqoslossbridged'||_0x5302ad===_0x8622('0x7d')||_0x5302ad===_0x8622('0x7e')||_0x5302ad===_0x8622('0x79')||_0x5302ad===_0x8622('0x7a')||_0x5302ad===_0x8622('0x7b')||_0x5302ad==='rtpaudioqosjitterbridged'||_0x5302ad===_0x8622('0x7c')||_0x5302ad===_0x8622('0x7f')||_0x5302ad===_0x8622('0x7d')||_0x5302ad===_0x8622('0x7e')||_0x5302ad==='bridgepeer'||_0x5302ad==='bridgepvtcallid'||_0x5302ad===_0x8622('0x2d')||_0x5302ad===_0x8622('0x32')){return![];}return!![];};exports[_0x8622('0x80')]=function(_0x230a4b,_0x377f3e){var _0x16e033,_0x342299,_0x5e9015;if(_0x377f3e<=0x0){_0x377f3e=0x1;}_0x16e033=new RegExp(_0x8622('0x81')+_0x377f3e+'}$');_0x342299=Math[_0x8622('0x82')](0xa,_0x377f3e-0x1);_0x5e9015=Math[_0x8622('0x82')](0xa,_0x377f3e)-0x1;return util[_0x8622('0x11')]('%s',_[_0x8622('0x83')](_0x230a4b,_0x16e033,_[_0x8622('0x84')](_0x342299,_0x5e9015)));};exports[_0x8622('0x85')]=function(_0xa32383){var _0x260e43=_0xa32383[_0x8622('0x86')](/"(.*?)"/);return _0x260e43?_0x260e43[0x1]:_0xa32383;};exports[_0x8622('0x87')]=function(_0x11b299){var _0x53093b=_0x11b299['match'](/<(.*?)>/);return _0x53093b?_0x53093b[0x1]:_0x11b299;};function buildNoAnswerEventPayload(_0x3c9fae,_0x404f22){var _0x1421b6=buildObj(_0x3c9fae,_0x8622('0x88'));if(!_[_0x8622('0x10')](_0x404f22[_0x8622('0x89')])){Object[_0x8622('0x8a')](_0x404f22[_0x8622('0x89')])[_0x8622('0x8b')](function(_0x330215){_0x1421b6[_0x330215[_0x8622('0x8c')]()]=_0x404f22['variables'][_0x330215];});}return _0x1421b6;}exports[_0x8622('0x8d')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x965b=['countglobal','callbackat','recallme','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqoslossbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','forEach','toLowerCase','util','lodash','moment','../../../../config/logger','preview','env','../../dialer/utils','loggerCatch','error','info','inspect','loggerError','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','responsetime','endtime','logAgent','ringtime','getSeconds','starttime','UserId','logCustomer','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','statedesc','scheduledAt','scheduledat','add','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','voice','mandatoryDisposition','agentReadyId','not_inuse','status','push','getDiff','milliseconds','seconds','createBody','CampaignId','filterKey','campaigntype','dialAnswer','membername','countbusyretry'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x965b,0x1c7));var _0xb965=function(_0x21d93c,_0x18bc1d){_0x21d93c=_0x21d93c-0x0;var _0x59d6a9=_0x965b[_0x21d93c];return _0x59d6a9;};'use strict';var util=require(_0xb965('0x0'));var _=require(_0xb965('0x1'));var moment=require(_0xb965('0x2'));var logger=require(_0xb965('0x3'))(_0xb965('0x4'));var ipAgi=process[_0xb965('0x5')]['XCALLY_IP_AGI']||'127.0.0.1';var utils=require(_0xb965('0x6'));exports[_0xb965('0x7')]=function(_0x2f69ea){return function(_0x4d4bad){logger[_0xb965('0x8')](_0x2f69ea,util['inspect'](_0x4d4bad,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x3b4da5,_0x3396cc){logger[_0xb965('0x9')](_0x3b4da5,util[_0xb965('0xa')](_0x3396cc,{'showHidden':![],'depth':null}));};exports[_0xb965('0xb')]=function(_0x23f3cf,_0x4c6c35){logger['error'](_0x23f3cf,util[_0xb965('0xa')](_0x4c6c35,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x5a3009){return function(_0x52ec29){logger[_0xb965('0x9')](_0x5a3009,util['inspect'](_0x52ec29,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x4c3a3d,_0x3a9f42,_0x52be68){return{'message':_0x4c3a3d,'unlock':_0x3a9f42,'active':_0x52be68};};exports['getCallerId']=function(_0x2c2813,_0x4ca0d2,_0x337660){if(!_[_0xb965('0xc')](_0x337660)&&_0xb965('0xd')===typeof _0x337660&&!_[_0xb965('0xe')](_0x337660)){if(!_[_0xb965('0xc')](_0x4ca0d2)&&_0xb965('0xd')===typeof _0x4ca0d2&&!_[_0xb965('0xe')](_0x4ca0d2)){return util[_0xb965('0xf')](_0xb965('0x10'),_0x4ca0d2,_0x337660);}return util[_0xb965('0xf')]('\x22%s\x22\x20<%s>',_0x337660,_0x337660);}if(!_['isUndefined'](_0x2c2813)&&'string'===typeof _0x2c2813&&!_[_0xb965('0xe')](_0x2c2813)){return _0x2c2813;}return _0xb965('0x11');};exports[_0xb965('0x12')]=function(_0x33294c){if(_[_0xb965('0x13')](_0x33294c)){return![];}return _0x33294c;};exports[_0xb965('0x14')]=function(_0x40ff36,_0x3b6738,_0x3c7753,_0x4f4ef4,_0x13e7ad,_0x11191b){var _0x1e1c68={'XMD-QUEUE':_0x3b6738[_0xb965('0x15')]?_0x3b6738[_0xb965('0x15')][_0xb965('0x16')]:'','XMD-CALLERID':_0x4f4ef4,'XMD-CALLERID-PREVIEW':_0x11191b?util[_0xb965('0xf')](_0xb965('0x10'),_0x11191b[_0xb965('0x17')],_0x11191b[_0xb965('0x18')]):_0x4f4ef4,'XMD-DIALID':_0x13e7ad,'XMD-CONTACTID':_0x3b6738[_0xb965('0x19')],'XMD-CDRTYPE':_0xb965('0x1a'),'CALLERID(all)':_0x4f4ef4,'XMD-VOICEQUEUEID':_0x3b6738['VoiceQueueId'],'XMD-DIALCHANNEL':_0x3c7753,'XMD-DIALTIMEOUT':_0x40ff36[_0xb965('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0xb965('0xf')]('\x22rtTxX%s%s\x22',_0x40ff36['dialQueueProject2']?'g':'',_['isEmpty'](_0x40ff36[_0xb965('0x1c')])?'':_0xb965('0x1d')),'XMD-DIALURL':_0x40ff36[_0xb965('0x1e')]||'','XMD-AGI':_0x40ff36['dialQueueProject']?util[_0xb965('0xf')](_0xb965('0x1f'),ipAgi,_0x40ff36[_0xb965('0x20')]):_0xb965('0x21'),'XMD-AGIAFTER':_0x40ff36[_0xb965('0x22')]?util[_0xb965('0xf')]('\x22agi://%s/square,%s\x22',ipAgi,_0x40ff36['dialQueueProject2']):_0xb965('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x11191b?_0x11191b[_0xb965('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x11191b?_0x11191b[_0xb965('0x24')]:'','XMD-DESTINATION':_0xb965('0x25'),'SIPADDHEADER':_0xb965('0x26')};if(!_[_0xb965('0xe')](_0x40ff36['monitor_format'])){_0x1e1c68[util[_0xb965('0xf')]('%s',_0xb965('0x27'))]=_0x40ff36[_0xb965('0x1c')];_0x1e1c68[util[_0xb965('0xf')]('%s',_0xb965('0x28'))]=_0x13e7ad;}return _0x1e1c68;};exports[_0xb965('0x29')]=function(_0x1c731c){var _0x10ee54={};for(var _0x3eba09 in _0x1c731c){if(_0x1c731c[_0xb965('0x2a')](_0x3eba09)){_0x10ee54[util[_0xb965('0xf')]('%s',_[_0xb965('0x2b')](_0x3eba09))]=_0x1c731c[_0x3eba09];}}return{'variables':_0x10ee54};};exports[_0xb965('0x2c')]=function(_0x3d3205,_0x5b636d){if(!_['isNil'](_0x3d3205)){if(_0x3d3205[_0xb965('0x2a')](_0xb965('0x2d'))){if(_0x3d3205[_0xb965('0x2d')]>0x0){_0x3d3205[_0xb965('0x2d')]-=0x1;}else{logger['error'](_0xb965('0x2e'),_0x5b636d);}}}else{logger[_0xb965('0x8')](_0xb965('0x2f'),_0x5b636d);}};exports[_0xb965('0x30')]=function(_0x57a5d5){var _0x690956=moment()[_0xb965('0xf')](_0xb965('0x31'));_0x57a5d5[_0xb965('0x32')]=0xd;_0x57a5d5['statedesc']='Blacklist';_0x57a5d5['starttime']=_0x690956;_0x57a5d5[_0xb965('0x33')]=_0x690956;_0x57a5d5[_0xb965('0x34')]=_0x690956;};exports[_0xb965('0x35')]=function(_0x47824f,_0x48afb4,_0x317877){var _0x2cc581=moment()[_0xb965('0xf')](_0xb965('0x31'));_0x47824f['state']=_0x48afb4;_0x47824f['statedesc']=_0x317877;_0x47824f[_0xb965('0x33')]=_0x2cc581;_0x47824f[_0xb965('0x36')]=utils[_0xb965('0x37')](_0x47824f['responsetime'],_0x47824f[_0xb965('0x38')]);};exports['logLookAgent']=function(_0x2165ab,_0x41054f,_0x3f465a){_0x2165ab['membername']=_0x41054f;_0x2165ab[_0xb965('0x39')]=_0x3f465a;};exports[_0xb965('0x3a')]=function(_0x38c280,_0x39d35c,_0x3ab19f){var _0x366b57=moment()['format'](_0xb965('0x31'));_0x38c280[_0xb965('0x32')]=_0x39d35c;_0x38c280['statedesc']=_0x3ab19f;_0x38c280[_0xb965('0x33')]=_0x38c280[_0xb965('0x33')]?_0x38c280[_0xb965('0x33')]:_0x366b57;_0x38c280[_0xb965('0x34')]=_0x38c280[_0xb965('0x34')]?_0x38c280['endtime']:_0x366b57;_0x38c280[_0xb965('0x36')]=utils[_0xb965('0x37')](_0x38c280[_0xb965('0x33')]||0x0,_0x38c280[_0xb965('0x38')]||0x0);_0x38c280[_0xb965('0x3b')]=_0x38c280[_0xb965('0x3c')]?utils['getSeconds'](_0x38c280[_0xb965('0x34')],_0x38c280[_0xb965('0x3c')]):0x0;};exports[_0xb965('0x3d')]=function(_0x5eb4ba){return _0x5eb4ba===_0xb965('0x3e');};exports['variablesAction']=function(_0x1d86c1,_0x513cfd,_0x2b3b5b,_0x562753,_0x4bcc07){var _0x6999c5=_0x562753?_0xb965('0x3f'):_0x1d86c1[_0xb965('0x17')];_0x6999c5=_0x4bcc07?_0xb965('0x40'):_0x6999c5;return{'actionid':_0x1d86c1[_0xb965('0x41')],'action':_0xb965('0x42'),'channel':_0x1d86c1[_0xb965('0x43')],'callerid':util[_0xb965('0xf')](_0xb965('0x10'),_0x6999c5,_0x1d86c1[_0xb965('0x18')]),'Exten':'xcally-motion-preview','Context':_0xb965('0x44'),'Priority':'1','variable':_0x2b3b5b,'timeout':(_0x513cfd[_0xb965('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1d86c1[_0xb965('0x41')]};};exports[_0xb965('0x46')]=function(_0x2dccec){return _0x2dccec['countbusyretry']+_0x2dccec[_0xb965('0x47')]+_0x2dccec[_0xb965('0x48')]+_0x2dccec[_0xb965('0x49')]+_0x2dccec[_0xb965('0x4a')];};exports[_0xb965('0x4b')]=function(_0x1e9830){var _0x46fe92=_['clone'](_0x1e9830);_0x46fe92[_0xb965('0x32')]=0xf;_0x46fe92[_0xb965('0x4c')]='Global';return _0x46fe92;};exports[_0xb965('0x4d')]=function(_0x10115a,_0x288b2e,_0x4230b8){var _0xd203ed={};_0xd203ed[_0x288b2e]=_0x10115a[_0x288b2e];_0xd203ed['active']=![];_0xd203ed[_0xb965('0x4e')]=moment()[_0xb965('0x4f')](_0x4230b8,'minutes')[_0xb965('0xf')](_0xb965('0x31'));_0xd203ed[_0xb965('0x19')]=_0x10115a[_0xb965('0x19')];_0xd203ed[_0xb965('0x50')]=_0x10115a[_0xb965('0x50')];_0xd203ed[_0xb965('0x51')]=_0x10115a['VoiceQueueId']||undefined;return _0xd203ed;};exports[_0xb965('0x52')]=function(_0xf63315,_0x3ebe9a){if(!_[_0xb965('0x13')](_0xf63315)){if(_0xf63315[_0xb965('0x53')]>0x0){_0xf63315['pTalking']-=0x1;}else{logger[_0xb965('0x8')](_0x3ebe9a,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xb965('0x8')](_0x3ebe9a,_0xb965('0x54'));}};exports[_0xb965('0x55')]=function(_0x282cb6){if(_0x282cb6<=0x0){return!![];}return![];};function buildObj(_0x659441,_0x349479,_0x32144a){_0x659441[_0xb965('0x56')]=_0x349479;_0x659441[_0xb965('0x16')]=_0x659441[_0xb965('0x57')];_0x659441[_0xb965('0x58')]=_0x659441[_0xb965('0x43')];_0x659441['motionChannel']=_0xb965('0x59');if(_0x32144a){_0x659441[_0xb965('0x5a')]=_0x32144a['mandatoryDisposition'];}return _0x659441;}exports['buildObj']=buildObj;exports['buildAcw']=function(_0x3244e9){var _0x3ffc3a={};_0x3ffc3a['queue']=_0x3244e9[_0xb965('0x57')];_0x3ffc3a[_0xb965('0x58')]=_0x3244e9[_0xb965('0x43')];_0x3ffc3a[_0xb965('0x41')]=_0x3244e9[_0xb965('0x41')];return _0x3ffc3a;};exports[_0xb965('0x5b')]=function(_0x700fa2){var _0x1b1706=[];for(var _0x477c61 in _0x700fa2){if(_0x700fa2['hasOwnProperty'](_0x477c61)){if(!_['isNil'](_0x700fa2[_0x477c61])&&_0x700fa2[_0x477c61]['state']===_0xb965('0x5c')&&_0x700fa2[_0x477c61][_0xb965('0x5d')]==='reachable'){_0x1b1706[_0xb965('0x5e')](_0x700fa2[_0x477c61]['id']);}}}return _0x1b1706;};exports[_0xb965('0x5f')]=function(_0x3db7a2){var _0x3bafa3=moment()[_0xb965('0x60')](0x0);var _0x35b5d4=moment(_0x3db7a2)[_0xb965('0x60')](0x0);return _0x3bafa3['diff'](_0x35b5d4,_0xb965('0x61'));};exports[_0xb965('0x62')]=function(_0x3b73a3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3b73a3[_0xb965('0x19')],'ListId':_0x3b73a3[_0xb965('0x50')],'VoiceQueueId':_0x3b73a3[_0xb965('0x51')]||undefined,'CampaignId':_0x3b73a3[_0xb965('0x63')]||undefined};};exports[_0xb965('0x64')]=function(_0x1c51bc){if(_0x1c51bc==='uniqueid'||_0x1c51bc==='idContact'||_0x1c51bc===_0xb965('0x57')||_0x1c51bc==='type'||_0x1c51bc===_0xb965('0x65')||_0x1c51bc===_0xb965('0x66')||_0x1c51bc===_0xb965('0x67')||_0x1c51bc==='channelAgent'||_0x1c51bc===_0xb965('0x17')||_0x1c51bc==='active'||_0x1c51bc===_0xb965('0x18')||_0x1c51bc===_0xb965('0x4e')||_0x1c51bc===_0xb965('0x68')||_0x1c51bc===_0xb965('0x47')||_0x1c51bc==='countnoanswerretry'||_0x1c51bc===_0xb965('0x69')||_0x1c51bc==='callback'||_0x1c51bc==='callbackuniqueid'||_0x1c51bc===_0xb965('0x6a')||_0x1c51bc===_0xb965('0x6b')||_0x1c51bc===_0xb965('0x19')||_0x1c51bc==='ListId'||_0x1c51bc==='UserId'||_0x1c51bc===_0xb965('0x51')||_0x1c51bc==='sipcallid'||_0x1c51bc===_0xb965('0x6c')||_0x1c51bc==='xmd-queue'||_0x1c51bc===_0xb965('0x6d')||_0x1c51bc===_0xb965('0x6e')||_0x1c51bc==='xmd-dialurl'||_0x1c51bc===_0xb965('0x6f')||_0x1c51bc===_0xb965('0x70')||_0x1c51bc===_0xb965('0x71')||_0x1c51bc===_0xb965('0x72')||_0x1c51bc===_0xb965('0x73')||_0x1c51bc==='xmd-cdrtype'||_0x1c51bc===_0xb965('0x74')||_0x1c51bc===_0xb965('0x75')||_0x1c51bc===_0xb965('0x76')||_0x1c51bc===_0xb965('0x77')||_0x1c51bc==='rtpaudioqosbridged'||_0x1c51bc===_0xb965('0x78')||_0x1c51bc===_0xb965('0x79')||_0x1c51bc===_0xb965('0x7a')||_0x1c51bc==='rtpaudioqoslossbridged'||_0x1c51bc===_0xb965('0x7b')||_0x1c51bc===_0xb965('0x7c')||_0x1c51bc===_0xb965('0x77')||_0x1c51bc===_0xb965('0x7d')||_0x1c51bc===_0xb965('0x78')||_0x1c51bc===_0xb965('0x79')||_0x1c51bc===_0xb965('0x7a')||_0x1c51bc===_0xb965('0x7e')||_0x1c51bc===_0xb965('0x7b')||_0x1c51bc==='rtpaudioqosrttbridged'||_0x1c51bc===_0xb965('0x7f')||_0x1c51bc==='bridgepvtcallid'||_0x1c51bc===_0xb965('0x32')||_0x1c51bc==='statedesc'){return![];}return!![];};exports[_0xb965('0x80')]=function(_0x16ff8b,_0xaeb97){var _0x4f0ff5,_0x312514,_0x1e925c;if(_0xaeb97<=0x0){_0xaeb97=0x1;}_0x4f0ff5=new RegExp(_0xb965('0x81')+_0xaeb97+'}$');_0x312514=Math[_0xb965('0x82')](0xa,_0xaeb97-0x1);_0x1e925c=Math[_0xb965('0x82')](0xa,_0xaeb97)-0x1;return util[_0xb965('0xf')]('%s',_[_0xb965('0x83')](_0x16ff8b,_0x4f0ff5,_[_0xb965('0x84')](_0x312514,_0x1e925c)));};exports[_0xb965('0x85')]=function(_0x2c4677){var _0x1aa0ac=_0x2c4677[_0xb965('0x86')](/"(.*?)"/);return _0x1aa0ac?_0x1aa0ac[0x1]:_0x2c4677;};exports[_0xb965('0x87')]=function(_0x1a4e2e){var _0x1746a5=_0x1a4e2e[_0xb965('0x86')](/<(.*?)>/);return _0x1746a5?_0x1746a5[0x1]:_0x1a4e2e;};function buildNoAnswerEventPayload(_0x3caba7,_0x5811fe){var _0x479e55=buildObj(_0x3caba7,_0xb965('0x88'));if(!_[_0xb965('0xe')](_0x5811fe['variables'])){Object['keys'](_0x5811fe[_0xb965('0x89')])[_0xb965('0x8a')](function(_0x2abcb9){_0x479e55[_0x2abcb9[_0xb965('0x8b')]()]=_0x5811fe[_0xb965('0x89')][_0x2abcb9];});}return _0x479e55;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 1a3b2f8..2b521cf 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 _0x1469=['voicequeuechannelredirect','queueadd','string','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x1469,0x1d7));var _0x9146=function(_0x293838,_0x541252){_0x293838=_0x293838-0x0;var _0x5b50c3=_0x1469[_0x293838];return _0x5b50c3;};'use strict';exports[_0x9146('0x0')]={'queue':{'type':_0x9146('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x9146('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x9146('0x2'),'required':![]}};exports[_0x9146('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x9146('0x1'),'required':!![]}};exports[_0x9146('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x9146('0x2')},'reason':{'type':_0x9146('0x1'),'required':![]}};exports[_0x9146('0x5')]={'module':{'type':_0x9146('0x1'),'required':![]}};exports[_0x9146('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x9146('0x7')]={'uniqueid':{'type':_0x9146('0x1'),'required':!![]},'filename':{'type':_0x9146('0x1')},'format':{'type':_0x9146('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x9146('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x9146('0x9')]={'uniqueid':{'type':_0x9146('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x9146('0x1')}}; \ No newline at end of file +var _0x1a92=['voicequeuechannelhangup','queueadd','string','number','boolean','voicequeuechannel','voicechannel'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x1a92,0x1f2));var _0x21a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a92[_0x3dd15e];return _0x231fd0;};'use strict';exports[_0x21a9('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x21a9('0x1'),'required':!![]},'penalty':{'type':_0x21a9('0x2'),'required':![]},'paused':{'type':_0x21a9('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x21a9('0x1'),'required':!![]},'interface':{'type':_0x21a9('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x21a9('0x1'),'required':!![]},'paused':{'type':_0x21a9('0x3')},'reason':{'type':_0x21a9('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0x21a9('0x4')]={'uniqueid':{'type':_0x21a9('0x1'),'required':!![]}};exports[_0x21a9('0x5')]={'uniqueid':{'type':_0x21a9('0x1'),'required':!![]},'filename':{'type':_0x21a9('0x1')},'format':{'type':_0x21a9('0x1')},'mixmonitorid':{'type':_0x21a9('0x1')}};exports[_0x21a9('0x6')]={'uniqueid':{'type':_0x21a9('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x21a9('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index f4aa9df..8e7f795 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 _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x57fd82,_0x493e7d){var _0x411f70=function(_0x1660d9){while(--_0x1660d9){_0x57fd82['push'](_0x57fd82['shift']());}};_0x411f70(++_0x493e7d);}(_0xadb5,0xad));var _0x5adb=function(_0x12bcbb,_0x5220e6){_0x12bcbb=_0x12bcbb-0x0;var _0x1b0d1c=_0xadb5[_0x12bcbb];return _0x1b0d1c;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file +var _0x0b0e=['total','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','SIP/%s','isUndefined','prototype','initTelephones','initTrunks','trunks','initTriggers','initTemplates','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','lodash','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','name','hasOwnProperty','format','interface'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x0b0e[_0x2c0be1];return _0x3d4bd2;};'use strict';var _=require(_0xe0b0('0x0'));var moment=require('moment');var util=require(_0xe0b0('0x1'));var Agent=require('../model/agent');var Telephone=require(_0xe0b0('0x2'));var Trunk=require(_0xe0b0('0x3'));var VoiceQueue=require(_0xe0b0('0x4'));var Trigger=require(_0xe0b0('0x5'));var Template=require(_0xe0b0('0x6'));var Campaign=require(_0xe0b0('0x7'));var VoiceExtension=require(_0xe0b0('0x8'));var ZendeskAccount=require(_0xe0b0('0x9'));var SalesforceAccount=require(_0xe0b0('0xa'));var FreshdeskAccount=require(_0xe0b0('0xb'));var SugarcrmAccount=require(_0xe0b0('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xe0b0('0xd'));var ServicenowAccount=require(_0xe0b0('0xe'));var Dynamics365Account=require(_0xe0b0('0xf'));var FreshsalesAccount=require(_0xe0b0('0x10'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xe0b0('0x11')]={};this[_0xe0b0('0x12')]={};this['trunks']={};this[_0xe0b0('0x13')]={};this[_0xe0b0('0x14')]={};this['campaigns']={};this[_0xe0b0('0x15')]={};this[_0xe0b0('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe0b0('0x17')]={};this['channels']={};this[_0xe0b0('0x18')]={};this[_0xe0b0('0x19')]={};this[_0xe0b0('0x1a')]={};this[_0xe0b0('0x1b')]={};this[_0xe0b0('0x1c')]={};this['salesforceAccounts']={};this[_0xe0b0('0x1d')]={};this[_0xe0b0('0x1e')]={};this[_0xe0b0('0x1f')]={};this[_0xe0b0('0x20')]={};this[_0xe0b0('0x21')]={};this['servicenowAccounts']={};this[_0xe0b0('0x22')]={};this['freshsalesAccounts']={};this[_0xe0b0('0x23')]={};}function freeIsNotKey(_0xadee6e,_0x519ae8,_0x11fdca){var _0x4a4cc0=_[_0xe0b0('0x24')](_0xadee6e,function(_0x100204){return _0x100204[_0x11fdca];});for(var _0x56bcc7 in _0x519ae8){if(_0x519ae8['hasOwnProperty'](_0x56bcc7)){if(!_0x4a4cc0[_0x56bcc7]){delete _0x519ae8[_0x56bcc7];}}}}function freeIsNotKeySip(_0x46bb44,_0x50a441){var _0x4df8da=_['mapKeys'](_0x46bb44,function(_0x1920ee){return util['format']('SIP/%s',_0x1920ee[_0xe0b0('0x25')]);});for(var _0x59dff5 in _0x50a441){if(_0x50a441[_0xe0b0('0x26')](_0x59dff5)){if(!_0x4df8da[_0x59dff5]){delete _0x50a441[_0x59dff5];}}}}function freeIsNotKeyAgent(_0x5dba2f,_0x2c84cc){var _0x1cd7c4=_[_0xe0b0('0x24')](_0x5dba2f,function(_0x310a6d){var _0x2cf6a1=_['isNil'](_0x310a6d['interface'])?util[_0xe0b0('0x27')]('SIP/%s',_0x310a6d[_0xe0b0('0x25')]):_0x310a6d[_0xe0b0('0x28')];return _0x2cf6a1;});for(var _0x513e63 in _0x2c84cc){if(_0x2c84cc[_0xe0b0('0x26')](_0x513e63)){if(!_0x1cd7c4[_0x513e63]){delete _0x2c84cc[_0x513e63];}}}}function clearVoiceCallReports(_0x503883){_0x503883[_0xe0b0('0x29')]=0x0;_0x503883['answered']=0x0;_0x503883[_0xe0b0('0x2a')]=0x0;_0x503883['sumDuration']=0x0;_0x503883[_0xe0b0('0x2b')]=0x0;}function clearCampaigns(_0x4de537){if(!_[_0xe0b0('0x2c')](_0x4de537)){for(var _0x4aafbe in _0x4de537){if(_0x4de537[_0xe0b0('0x26')](_0x4aafbe)){_0x4de537[_0x4aafbe]['ivrTotalCallsDays']=0x0;_0x4de537[_0x4aafbe][_0xe0b0('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x3c3bc2){if(!_[_0xe0b0('0x2c')](_0x3c3bc2)){for(var _0x1d91ad in _0x3c3bc2){if(_0x3c3bc2[_0xe0b0('0x26')](_0x1d91ad)){_0x3c3bc2[_0x1d91ad][_0xe0b0('0x29')]=0x0;_0x3c3bc2[_0x1d91ad]['answered']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2e')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2f')]=0x0;_0x3c3bc2[_0x1d91ad]['sumHoldTime']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x30')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2b')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x32')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x33')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x34')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x35')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundUnknownCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x36')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x37')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundBlacklistCallsDay']=0x0;_0x3c3bc2[_0x1d91ad]['outboundOriginateFailureCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x38')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x39')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3a')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3b')]=!![];}}}}Realtime['prototype'][_0xe0b0('0x3c')]=function(_0x3231fc,_0x7867c4){for(var _0x29d725 in _0x7867c4){if(_0x3231fc[_0xe0b0('0x26')](_0x29d725)){_0x3231fc[_0x29d725]=_0x7867c4[_0x29d725];}}};Realtime['prototype'][_0xe0b0('0x3d')]=function(){var _0x208945=this;return function(_0xfc51d3){if(_0xfc51d3){freeIsNotKeyAgent(_0xfc51d3,_0x208945[_0xe0b0('0x11')]);for(var _0x3575bc=0x0,_0x12eeb8={};_0x3575bc<_0xfc51d3[_0xe0b0('0x3e')];_0x3575bc+=0x1){_0x12eeb8=_0xfc51d3[_0x3575bc];var _0x20908f=_[_0xe0b0('0x3f')](_0x12eeb8[_0xe0b0('0x28')])?util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x12eeb8[_0xe0b0('0x25')]):_0x12eeb8[_0xe0b0('0x28')];if(_[_0xe0b0('0x41')](_0x208945['agents'][_0x20908f])){_0x208945[_0xe0b0('0x11')][_0x20908f]=new Agent(_0x12eeb8);}else{_0x208945[_0xe0b0('0x3c')](_0x208945[_0xe0b0('0x11')][_0x20908f],_0x12eeb8);}}}return _0x208945[_0xe0b0('0x11')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x43')]=function(){var _0x12024d=this;return function(_0x533fc7){if(_0x533fc7){freeIsNotKeySip(_0x533fc7,_0x12024d['telephones']);for(var _0x549d9a=0x0,_0x5317df={};_0x549d9a<_0x533fc7[_0xe0b0('0x3e')];_0x549d9a+=0x1){_0x5317df=_0x533fc7[_0x549d9a];if(_[_0xe0b0('0x41')](_0x12024d[_0xe0b0('0x12')][util['format'](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])])){_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')]('SIP/%s',_0x5317df[_0xe0b0('0x25')])]=new Telephone(_0x5317df);}else{_0x12024d[_0xe0b0('0x3c')](_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])],_0x5317df);}}}return _0x12024d[_0xe0b0('0x12')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x44')]=function(){var _0x54f251=this;return function(_0x3e349b){if(_0x3e349b){freeIsNotKeySip(_0x3e349b,_0x54f251['trunks']);for(var _0x34178d=0x0,_0x2d5f47={};_0x34178d<_0x3e349b[_0xe0b0('0x3e')];_0x34178d+=0x1){_0x2d5f47=_0x3e349b[_0x34178d];if(_[_0xe0b0('0x41')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])])){_0x54f251[_0xe0b0('0x45')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])]=new Trunk(_0x2d5f47);}else{_0x54f251[_0xe0b0('0x3c')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47['name'])],_0x2d5f47);}}}return _0x54f251['trunks'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x46')]=function(){var _0x56e7df=this;return function(_0x18a59d){if(_0x18a59d){freeIsNotKey(_0x18a59d,_0x56e7df[_0xe0b0('0x14')],'id');for(var _0x6bca5c=0x0,_0x1c869d={};_0x6bca5c<_0x18a59d[_0xe0b0('0x3e')];_0x6bca5c+=0x1){_0x1c869d=_0x18a59d[_0x6bca5c];if(_['isUndefined'](_0x56e7df['triggers'][_0x1c869d['id']])){_0x56e7df['triggers'][_0x1c869d['id']]=new Trigger(_0x1c869d);}else{_0x56e7df[_0xe0b0('0x3c')](_0x56e7df[_0xe0b0('0x14')][_0x1c869d['id']],_0x1c869d);}}}return _0x56e7df['triggers'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x47')]=function(){var _0x14197b=this;return function(_0x5f037d){if(_0x5f037d){freeIsNotKey(_0x5f037d,_0x14197b[_0xe0b0('0x15')],'id');for(var _0x5c6f94=0x0,_0x57d4b0={};_0x5c6f94<_0x5f037d[_0xe0b0('0x3e')];_0x5c6f94+=0x1){_0x57d4b0=_0x5f037d[_0x5c6f94];if(_[_0xe0b0('0x41')](_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']])){_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']]=new Template(_0x57d4b0);}else{_0x14197b[_0xe0b0('0x3c')](_0x14197b['templates'][_0x57d4b0['id']],_0x57d4b0);}}}return _0x14197b[_0xe0b0('0x15')];};};Realtime[_0xe0b0('0x42')]['initZendeskAccounts']=function(){var _0x50c805=this;return function(_0x5ddad1){if(_0x5ddad1){freeIsNotKey(_0x5ddad1,_0x50c805[_0xe0b0('0x1c')],'id');for(var _0x2184d3=0x0,_0x2419ce={};_0x2184d3<_0x5ddad1[_0xe0b0('0x3e')];_0x2184d3+=0x1){_0x2419ce=_0x5ddad1[_0x2184d3];if(_['isUndefined'](_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']])){_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']]=new ZendeskAccount(_0x2419ce);}else{_0x50c805['mergeFromDatabase'](_0x50c805['zendeskAccounts'][_0x2419ce['id']],_0x2419ce);}}}return _0x50c805[_0xe0b0('0x1c')];};};Realtime[_0xe0b0('0x42')]['initSalesforceAccounts']=function(){var _0x2b1917=this;return function(_0x27fd31){if(_0x27fd31){freeIsNotKey(_0x27fd31,_0x2b1917['salesforceAccounts'],'id');for(var _0x5cb2b6=0x0,_0x123ad2={};_0x5cb2b6<_0x27fd31['length'];_0x5cb2b6+=0x1){_0x123ad2=_0x27fd31[_0x5cb2b6];if(_[_0xe0b0('0x41')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']])){_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']]=new SalesforceAccount(_0x123ad2);}else{_0x2b1917[_0xe0b0('0x3c')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']],_0x123ad2);}}}return _0x2b1917[_0xe0b0('0x48')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x2ef908=this;return function(_0x5d380a){if(_0x5d380a){freeIsNotKey(_0x5d380a,_0x2ef908['freshdeskAccounts'],'id');for(var _0x249d9a=0x0,_0x222174={};_0x249d9a<_0x5d380a['length'];_0x249d9a+=0x1){_0x222174=_0x5d380a[_0x249d9a];if(_['isUndefined'](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']])){_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']]=new FreshdeskAccount(_0x222174);}else{_0x2ef908[_0xe0b0('0x3c')](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']],_0x222174);}}}return _0x2ef908[_0xe0b0('0x1e')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x49')]=function(){var _0x4ebb0f=this;return function(_0x22c7bc){if(_0x22c7bc){freeIsNotKey(_0x22c7bc,_0x4ebb0f['zohoAccounts'],'id');for(var _0x17b3d4=0x0,_0x54106c={};_0x17b3d4<_0x22c7bc['length'];_0x17b3d4+=0x1){_0x54106c=_0x22c7bc[_0x17b3d4];if(_[_0xe0b0('0x41')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']])){_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']]=new ZohoAccount(_0x54106c);}else{_0x4ebb0f[_0xe0b0('0x3c')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']],_0x54106c);}}}return _0x4ebb0f[_0xe0b0('0x1f')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4a')]=function(){var _0x2e1c9b=this;return function(_0x4e0d87){if(_0x4e0d87){freeIsNotKey(_0x4e0d87,_0x2e1c9b[_0xe0b0('0x20')],'id');for(var _0x57ccc9=0x0,_0x2b5553={};_0x57ccc9<_0x4e0d87[_0xe0b0('0x3e')];_0x57ccc9+=0x1){_0x2b5553=_0x4e0d87[_0x57ccc9];if(_[_0xe0b0('0x41')](_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']])){_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']]=new DeskAccount(_0x2b5553);}else{_0x2e1c9b[_0xe0b0('0x3c')](_0x2e1c9b['deskAccounts'][_0x2b5553['id']],_0x2b5553);}}}return _0x2e1c9b[_0xe0b0('0x20')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4b')]=function(){var _0x271445=this;return function(_0x3bb6d6){if(_0x3bb6d6){freeIsNotKey(_0x3bb6d6,_0x271445[_0xe0b0('0x1d')],'id');for(var _0x234cb7=0x0,_0x1a60d2={};_0x234cb7<_0x3bb6d6[_0xe0b0('0x3e')];_0x234cb7+=0x1){_0x1a60d2=_0x3bb6d6[_0x234cb7];if(_[_0xe0b0('0x41')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']])){_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']]=new SugarcrmAccount(_0x1a60d2);}else{_0x271445[_0xe0b0('0x3c')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']],_0x1a60d2);}}}return _0x271445[_0xe0b0('0x1d')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4c')]=function(){var _0x155738=this;return function(_0x5aa79b){if(_0x5aa79b){freeIsNotKey(_0x5aa79b,_0x155738[_0xe0b0('0x21')],'id');for(var _0xe7fbac=0x0,_0x1182dc={};_0xe7fbac<_0x5aa79b[_0xe0b0('0x3e')];_0xe7fbac+=0x1){_0x1182dc=_0x5aa79b[_0xe7fbac];if(_[_0xe0b0('0x41')](_0x155738[_0xe0b0('0x21')][_0x1182dc['id']])){_0x155738[_0xe0b0('0x21')][_0x1182dc['id']]=new VtigerAccount(_0x1182dc);}else{_0x155738['mergeFromDatabase'](_0x155738['vtigerAccounts'][_0x1182dc['id']],_0x1182dc);}}}return _0x155738[_0xe0b0('0x21')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4d')]=function(){var _0x47ecc1=this;return function(_0x117d20){if(_0x117d20){freeIsNotKey(_0x117d20,_0x47ecc1[_0xe0b0('0x4e')],'id');for(var _0x309efb=0x0,_0x3d820c={};_0x309efb<_0x117d20[_0xe0b0('0x3e')];_0x309efb+=0x1){_0x3d820c=_0x117d20[_0x309efb];if(_['isUndefined'](_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']])){_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']]=new ServicenowAccount(_0x3d820c);}else{_0x47ecc1[_0xe0b0('0x3c')](_0x47ecc1['servicenowAccounts'][_0x3d820c['id']],_0x3d820c);}}}return _0x47ecc1[_0xe0b0('0x4e')];};};Realtime[_0xe0b0('0x42')]['initDynamics365Accounts']=function(){var _0x1bd249=this;return function(_0x4c5478){if(_0x4c5478){freeIsNotKey(_0x4c5478,_0x1bd249['dynamics365Accounts'],'id');for(var _0x4474ac=0x0,_0x57b51e={};_0x4474ac<_0x4c5478['length'];_0x4474ac+=0x1){_0x57b51e=_0x4c5478[_0x4474ac];if(_[_0xe0b0('0x41')](_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']])){_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']]=new Dynamics365Account(_0x57b51e);}else{_0x1bd249[_0xe0b0('0x3c')](_0x1bd249['dynamics365Accounts'][_0x57b51e['id']],_0x57b51e);}}}return _0x1bd249[_0xe0b0('0x22')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4f')]=function(){var _0x41ec8e=this;return function(_0x1b29c){if(_0x1b29c){freeIsNotKey(_0x1b29c,_0x41ec8e[_0xe0b0('0x50')],'id');for(var _0xc5e88c=0x0,_0x224f1e={};_0xc5e88c<_0x1b29c['length'];_0xc5e88c+=0x1){_0x224f1e=_0x1b29c[_0xc5e88c];if(_['isUndefined'](_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']])){_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']]=new FreshsalesAccount(_0x224f1e);}else{_0x41ec8e[_0xe0b0('0x3c')](_0x41ec8e['freshsalesAccounts'][_0x224f1e['id']],_0x224f1e);}}}return _0x41ec8e['freshsalesAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x51')]=function(){var _0x5d7cf4=this;return function(_0x5eca3d){for(var _0x691136=0x0;_0x691136<_0x5eca3d[_0xe0b0('0x3e')];_0x691136+=0x1){_[_0xe0b0('0x52')](_0x5d7cf4[_0xe0b0('0x13')][_0x5eca3d[_0x691136][_0xe0b0('0x25')]],_0x5eca3d[_0x691136]);}return _0x5d7cf4[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x53')]=function(){var _0x51f209=this;return function(_0x1daff7){clearVoiceQueues(_0x51f209[_0xe0b0('0x13')]);if(_0x1daff7){_0x1daff7=_[_0xe0b0('0x54')](_0x1daff7,'uniqueid');for(var _0x4fbf44 in _0x1daff7){if(_0x1daff7['hasOwnProperty'](_0x4fbf44)){for(var _0x56ee83=0x0;_0x56ee83<_0x1daff7[_0x4fbf44]['length'];_0x56ee83+=0x1){var _0x567c06=_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x55')];if(_0x51f209['voiceQueues'][_0x567c06]){if(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexit']){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2e')]+=0x1;}if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x56')]){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2f')]+=0x1;}_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')])['diff'](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x58')]),_0xe0b0('0x59'))||0x0;if(_0x56ee83===_0x1daff7[_0x4fbf44][_0xe0b0('0x3e')]-0x1){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5a')]||_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5b')]||_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexitAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerjoinAt']),_0xe0b0('0x59'))||0x0;_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x29')]+=0x1;if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5d')]){_0x51f209['voiceQueues'][_0x567c06][_0xe0b0('0x5e')]+=0x1;_0x51f209[_0xe0b0('0x13')][_0x567c06]['sumBillable']+=moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallercompleteAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')]),_0xe0b0('0x59'))||0x0;}}else{_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]||0x0;}}}}}}return _0x51f209[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x5f')]=function(){var _0x5a63e6=this;return function(_0x4c512b){clearVoiceCallReports(_0x5a63e6[_0xe0b0('0x16')]);if(_0x4c512b){for(var _0x4880d5=0x0;_0x4880d5<_0x4c512b['length'];_0x4880d5+=0x1){_0x5a63e6['outbound']['total']+=0x1;_0x5a63e6[_0xe0b0('0x16')]['sumDuration']+=_0x4c512b[_0x4880d5][_0xe0b0('0x60')];if(_0x4c512b[_0x4880d5][_0xe0b0('0x61')]===_0xe0b0('0x62')){_0x5a63e6[_0xe0b0('0x16')]['answered']+=0x1;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2a')]+=_0x4c512b[_0x4880d5]['duration']-_0x4c512b[_0x4880d5][_0xe0b0('0x63')]||0x0;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2b')]+=_0x4c512b[_0x4880d5][_0xe0b0('0x63')];}}}return _0x5a63e6[_0xe0b0('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x55aef7=this;return function(_0x545694){if(_0x545694){freeIsNotKey(_0x545694,_0x55aef7['campaigns'],_0xe0b0('0x25'));for(var _0x567e1a=0x0,_0x3c09af={};_0x567e1a<_0x545694['length'];_0x567e1a+=0x1){_0x3c09af=_0x545694[_0x567e1a];if(_[_0xe0b0('0x41')](_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]])){_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]]=new Campaign(_0x3c09af);}else{_0x55aef7[_0xe0b0('0x3c')](_0x55aef7['campaigns'][_0x3c09af['name']],_0x3c09af);_0x55aef7['campaigns'][_0x3c09af['name']][_0xe0b0('0x65')]=_0x3c09af[_0xe0b0('0x66')]?_0x3c09af[_0xe0b0('0x66')][_0xe0b0('0x25')]:undefined;}}}return _0x55aef7[_0xe0b0('0x64')];};};Realtime['prototype'][_0xe0b0('0x67')]=function(){var _0x39a07b=this;return function(_0xf77616){if(_0xf77616){freeIsNotKey(_0xf77616,_0x39a07b[_0xe0b0('0x17')],'id');for(var _0x154e6d=0x0,_0x2a5082={};_0x154e6d<_0xf77616[_0xe0b0('0x3e')];_0x154e6d+=0x1){_0x2a5082=_0xf77616[_0x154e6d];if(_[_0xe0b0('0x41')](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']])){_0x39a07b['voiceExtensions'][_0x2a5082['id']]=new VoiceExtension(_0x2a5082);}else{_0x39a07b['mergeFromDatabase'](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']],_0x2a5082);}}}return _0x39a07b[_0xe0b0('0x17')];};};Realtime['prototype'][_0xe0b0('0x68')]=function(){var _0x4593f1=this;return function(_0x44c475){clearCampaigns(_0x4593f1[_0xe0b0('0x64')]);for(var _0x7358ce=0x0;_0x7358ce<_0x44c475[_0xe0b0('0x3e')];_0x7358ce+=0x1){_[_0xe0b0('0x52')](_0x4593f1[_0xe0b0('0x64')][_0x44c475[_0x7358ce]['name']],_0x44c475[_0x7358ce]);}return _0x4593f1['campaigns'];};};Realtime['prototype'][_0xe0b0('0x69')]=function(){var _0x90d471=this;return function(_0x5d2365){if(_0x5d2365){freeIsNotKey(_0x5d2365,_0x90d471[_0xe0b0('0x23')],'id');for(var _0x448694=0x0,_0x396eec={};_0x448694<_0x5d2365[_0xe0b0('0x3e')];_0x448694+=0x1){_0x396eec=_0x5d2365[_0x448694];if(_['isUndefined'](_0x90d471['faxAccounts'][_0x396eec['id']])){_0x90d471['faxAccounts'][_0x396eec['id']]=new FaxAccount(_0x396eec);}else{_0x90d471[_0xe0b0('0x3c')](_0x90d471[_0xe0b0('0x23')][_0x396eec['id']],_0x396eec);}}}return _0x90d471['faxAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x6a')]=function(){var _0x5547ee=this;return function(_0x576482){if(_0x576482){freeIsNotKey(_0x576482,_0x5547ee[_0xe0b0('0x13')],'name');for(var _0x251195=0x0,_0x5f06c0={};_0x251195<_0x576482[_0xe0b0('0x3e')];_0x251195+=0x1){_0x5f06c0=_0x576482[_0x251195];if(_[_0xe0b0('0x41')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]])){_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]]=new VoiceQueue(_0x5f06c0);}else{_0x5547ee[_0xe0b0('0x3c')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]],_0x5f06c0);}}}return _0x5547ee['voiceQueues'];};};module[_0xe0b0('0x6b')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 82d1cde..0793aac 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebc0=['assign','mergeDBDataToRealtime'];(function(_0x1de55e,_0x136570){var _0x8d2760=function(_0x8f239b){while(--_0x8f239b){_0x1de55e['push'](_0x1de55e['shift']());}};_0x8d2760(++_0x136570);}(_0xebc0,0x1d0));var _0x0ebc=function(_0x4f347b,_0x5d76c9){_0x4f347b=_0x4f347b-0x0;var _0x16d8dd=_0xebc0[_0x4f347b];return _0x16d8dd;};'use strict';function mergeDBDataToRealtime(_0x54c506,_0x69fa28){var _0x549f9e=Object[_0x0ebc('0x0')]({},_0x54c506);for(var _0x4e0c27 in _0x69fa28){if(_0x549f9e['hasOwnProperty'](_0x4e0c27)){_0x549f9e[_0x4e0c27]=_0x69fa28[_0x4e0c27];}}return _0x549f9e;}exports[_0x0ebc('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xe4bb=['hasOwnProperty'];(function(_0x2619b1,_0x3ccef1){var _0x21b9df=function(_0x513b81){while(--_0x513b81){_0x2619b1['push'](_0x2619b1['shift']());}};_0x21b9df(++_0x3ccef1);}(_0xe4bb,0x185));var _0xbe4b=function(_0x33dd2d,_0x2954b6){_0x33dd2d=_0x33dd2d-0x0;var _0x496d37=_0xe4bb[_0x33dd2d];return _0x496d37;};'use strict';function mergeDBDataToRealtime(_0xd4c95a,_0x28668f){var _0x334fbd=Object['assign']({},_0xd4c95a);for(var _0x56d0f4 in _0x28668f){if(_0x334fbd[_0xbe4b('0x0')](_0x56d0f4)){_0x334fbd[_0x56d0f4]=_0x28668f[_0x56d0f4];}}return _0x334fbd;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 33ae4c3..6c2cee5 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 _0xd018=['calleridpreview','destinationchannel','originatecalleridnum','ANSWERED','callerid','\x22%s\x22\x20<%s>','linkedid','transfers','transfereelinkedid','uniqueid','UserId','create','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','calleridname','connectedlinename','membername','exten','xcally-motion-dialer','isArray','forEach','voiceDialReport','mobile','phone','substring','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','agents','telephones','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','isNil','accountcode','name','interface','format','SIP/%s','prototype','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','match','getAgentByInternal','keys','length','getCallType','channel','split','calleridnum','outbound','voiceCallReport','destination','type','dialer','lastapplication','queue','lastdata','context','from-sip'];(function(_0x1cf600,_0x5445d0){var _0x2a474c=function(_0x5c6993){while(--_0x5c6993){_0x1cf600['push'](_0x1cf600['shift']());}};_0x2a474c(++_0x5445d0);}(_0xd018,0x1a0));var _0x8d01=function(_0x5d4df0,_0x4792b0){_0x5d4df0=_0x5d4df0-0x0;var _0x5324c7=_0xd018[_0x5d4df0];return _0x5324c7;};'use strict';var _=require(_0x8d01('0x0'));var moment=require(_0x8d01('0x1'));var util=require(_0x8d01('0x2'));var config=require(_0x8d01('0x3'));var ami=require(_0x8d01('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x8d01('0x5'));var RpcVoiceDialReport=require(_0x8d01('0x6'));var RpcMemberReport=require(_0x8d01('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x8d01('0x8'));var RpcVoiceTransferReport=require(_0x8d01('0x9'));var VoiceQueueReport=require(_0x8d01('0xa'));var VoiceCallReport=require(_0x8d01('0xb'));var VoiceAgentReport=require(_0x8d01('0xc'));var VoiceDialReport=require(_0x8d01('0xd'));var UserReport=require('./userReport');function Report(_0x376a58){this['realtime']=_0x376a58;this[_0x8d01('0xe')]=_0x376a58[_0x8d01('0xe')];this[_0x8d01('0xf')]=_0x376a58[_0x8d01('0xf')];}Report['prototype'][_0x8d01('0x10')]=function(_0x4fd1b4){var _0x379cae=new VoiceQueueReport(this[_0x8d01('0x11')]);var _0x285dfc=new VoiceAgentReport(this[_0x8d01('0x11')]);var _0x404e38=new VoiceDialReport(this[_0x8d01('0x11')]);var _0x25e649=new VoiceCallReport(this[_0x8d01('0x11')]);var _0x1145f1=new UserReport(this[_0x8d01('0x11')]);if(config[_0x8d01('0x12')]&&config[_0x8d01('0x12')][_0x8d01('0x13')]){ami['on'](_0x8d01('0x14'),this[_0x8d01('0x15')]['bind'](this));ami['on'](_0x8d01('0x16'),this['voiceCallReport'][_0x8d01('0x17')](this));ami['on'](_0x8d01('0x18'),this[_0x8d01('0x19')][_0x8d01('0x17')](this));ami['on'](_0x8d01('0x1a'),this['voiceDialReport'][_0x8d01('0x17')](this));ami['on'](_0x8d01('0x1b'),this[_0x8d01('0x1c')][_0x8d01('0x17')](this));ami['on'](_0x8d01('0x1d'),this[_0x8d01('0x1e')]['bind'](this));}};Report['prototype'][_0x8d01('0x1f')]=function(_0x471c46){var _0xaddd1a;_0xaddd1a=_[_0x8d01('0x20')](this[_0x8d01('0xe')],function(_0x17262a){return _0x17262a['accountcode']==_0x471c46||_0x17262a['name']==_0x471c46;});if(_[_0x8d01('0x21')](_0xaddd1a)){var _0x1dd994=_['find'](this[_0x8d01('0xf')],function(_0x348bcf){return _0x348bcf[_0x8d01('0x22')]==_0x471c46||_0x348bcf[_0x8d01('0x23')]==_0x471c46;});if(_0x1dd994){_0xaddd1a=_[_0x8d01('0x20')](this[_0x8d01('0xe')],function(_0xefd33d){return _0xefd33d[_0x8d01('0x24')]==util[_0x8d01('0x25')](_0x8d01('0x26'),_0x1dd994[_0x8d01('0x23')]);});}}return _0xaddd1a;};Report[_0x8d01('0x27')][_0x8d01('0x15')]=function(_0x36a377){for(var _0x5d2705=0x0;_0x5d2705<_0x36a377['length'];_0x5d2705+=0x1){var _0x333453=this['findAgent'](_0x36a377[_0x5d2705][_0x8d01('0x28')]);if(_0x333453){_0x36a377[_0x5d2705]['accountcode']=_0x333453[_0x8d01('0x22')];_0x36a377[_0x5d2705][_0x8d01('0x29')]=!![];_0x36a377[_0x5d2705][_0x8d01('0x2a')]=_0x333453[_0x8d01('0x23')];_0x36a377[_0x5d2705][_0x8d01('0x24')]=_[_0x8d01('0x21')](_0x333453[_0x8d01('0x24')])?util['format'](_0x8d01('0x26'),_0x333453[_0x8d01('0x23')]):_0x333453[_0x8d01('0x24')];if(_0x36a377[_0x5d2705]['queuecallercomplete']){_0x36a377[_0x5d2705][_0x8d01('0x2b')]=moment()['format'](_0x8d01('0x2c'));}if(_0x36a377[_0x5d2705]['queuecallerexit']){_0x36a377[_0x5d2705][_0x8d01('0x2d')]=moment()[_0x8d01('0x25')](_0x8d01('0x2c'));}RpcMemberReport[_0x8d01('0x15')](_0x36a377[_0x5d2705]);}RpcVoiceQueueReport['create'](_0x36a377[_0x5d2705]);}};function extractCalleridNumber(_0x51d9aa){var _0x81c5d8=_0x51d9aa[_0x8d01('0x2e')](/<(.*?)>/);return _0x81c5d8?_0x81c5d8[0x1]:_0x51d9aa;}Report['prototype'][_0x8d01('0x2f')]=function(_0x4901ad){for(var _0x18686d=0x0;_0x18686d/);return _0x48904f?_0x48904f[0x1]:_0x3395c4;}Report[_0x6d0a('0xe')]['getAgentByInternal']=function(_0x1ca995){for(var _0x9b7595=0x0;_0x9b7595',_0xed3baa[_0x6d0a('0x40')],_0xed3baa[_0x6d0a('0x41')]);}if(RpcVoiceTransferReport[_0x6d0a('0x42')][_0xed3baa[_0x6d0a('0x43')]]){var _0x1a85c3=RpcVoiceTransferReport[_0x6d0a('0x42')][_0xed3baa[_0x6d0a('0x43')]];_0x1a85c3['transfereelinkedid']=_0xed3baa[_0x6d0a('0x44')];RpcVoiceTransferReport[_0x6d0a('0x1b')](_0x1a85c3);delete RpcVoiceTransferReport[_0x6d0a('0x42')][_0xed3baa['linkedid']];}if(_[_0x6d0a('0x22')](_0xed3baa['type'])){_0xed3baa[_0x6d0a('0x31')]=this[_0x6d0a('0x2c')](_0xed3baa);}if(_[_0x6d0a('0x22')](_0xed3baa[_0x6d0a('0x45')])){var _0x11fdc3=_0xed3baa['channel'][_0x6d0a('0x2d')]('-')[0x0];var _0x280623=this[_0x6d0a('0xc')][_0x11fdc3];if(!_0x280623)_0x280623=this[_0x6d0a('0x46')](_0xed3baa[_0x6d0a('0x20')]);if(_0x280623){_0xed3baa[_0x6d0a('0x45')]=_0x280623['id'];_0xed3baa['membername']=_0x280623[_0x6d0a('0x21')];}}RpcVoiceCallReport[_0x6d0a('0x2a')](_0xed3baa);if(_0xed3baa[_0x6d0a('0x47')]){for(var _0x5a4492=0x0;_0x5a4492<_0xed3baa['monitors'][_0x6d0a('0x25')];_0x5a4492+=0x1){_0xed3baa['monitorFilename']=_0xed3baa[_0x6d0a('0x48')][_0x5a4492][_0x6d0a('0x49')];_0xed3baa[_0x6d0a('0x4a')]=_0xed3baa[_0x6d0a('0x48')][_0x5a4492][_0x6d0a('0x4a')];if(_0xed3baa[_0x6d0a('0x4b')]==_0x6d0a('0x38')){_0xed3baa[_0x6d0a('0x41')]=_0xed3baa[_0x6d0a('0x3f')];_0xed3baa[_0x6d0a('0x40')]=_0xed3baa[_0x6d0a('0x4c')];_0xed3baa['connectedlinenum']=_0xed3baa['accountcode'];_0xed3baa[_0x6d0a('0x4c')]=_0xed3baa[_0x6d0a('0x4d')];_0xed3baa[_0x6d0a('0x4b')]=_0xed3baa[_0x6d0a('0x3a')];}else if(_0xed3baa[_0x6d0a('0x4b')]=='xcally-motion-dialer'){_0xed3baa[_0x6d0a('0x41')]=_0xed3baa[_0x6d0a('0x30')];_0xed3baa[_0x6d0a('0x4b')]=_0xed3baa['originatecalleridnum'];}RpcVoiceRecording[_0x6d0a('0x2a')](_0xed3baa);}}};Report[_0x6d0a('0xe')][_0x6d0a('0x17')]=function(_0x4efc0c){if(_[_0x6d0a('0x4e')](_0x4efc0c)){_0x4efc0c[_0x6d0a('0x4f')](function(_0x4b7b75){RpcVoiceAgentReport[_0x6d0a('0x2a')](_0x4b7b75);});}else{RpcVoiceAgentReport[_0x6d0a('0x2a')](_0x4efc0c);}};Report[_0x6d0a('0xe')][_0x6d0a('0x19')]=function(_0x5f8c70){RpcVoiceDialReport['create'](_0x5f8c70);var _0x48c78c;var _0x16f42f;var _0x10d16d=_0x5f8c70['channel'];if(_[_0x6d0a('0x50')](_0x10d16d,_0x6d0a('0x51'))){_0x16f42f=_0x10d16d[_0x6d0a('0x52')](_0x10d16d[_0x6d0a('0x53')]('/')+0x1,_0x10d16d['indexOf']('@'));_0x48c78c=_[_0x6d0a('0x1f')](this[_0x6d0a('0xc')],function(_0x50af7c){return _0x50af7c[_0x6d0a('0x54')]==_0x16f42f||_0x50af7c[_0x6d0a('0x55')]==_0x16f42f||_0x50af7c[_0x6d0a('0x20')]==_0x16f42f;});}else{_0x16f42f=_0x10d16d['substring'](_0x10d16d['indexOf']('/')+0x1,_0x10d16d[_0x6d0a('0x56')]('-'));_0x48c78c=this['findAgent'](_0x16f42f);}if(_0x48c78c){_0x5f8c70[_0x6d0a('0x27')]=_[_0x6d0a('0x22')](_0x48c78c[_0x6d0a('0x27')])?util[_0x6d0a('0x23')](_0x6d0a('0x24'),_0x48c78c[_0x6d0a('0x21')]):_0x48c78c[_0x6d0a('0x27')];_0x5f8c70['membername']=_0x48c78c[_0x6d0a('0x21')];_0x5f8c70[_0x6d0a('0x20')]=_0x48c78c[_0x6d0a('0x20')];RpcMemberReport[_0x6d0a('0x19')](_0x5f8c70);}};Report[_0x6d0a('0xe')][_0x6d0a('0x1b')]=function(_0x58d974){RpcVoiceTransferReport[_0x6d0a('0x42')][_0x58d974[_0x6d0a('0x57')]]=_0x58d974;};Report['prototype'][_0x6d0a('0x1d')]=function(_0x41b8b7){RpcVoiceTransferReport[_0x6d0a('0x1d')](_0x41b8b7);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index aab6db8..b60793f 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 _0xa8aa=['../../../config/logger','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','bind','registry','syncRegistry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','inspect','actionDeviceStateList','error','[userReport][sippeerstatus]','prototype','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','merge','omit','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','device','[userReport][devicestatechange]','toLowerCase','inuse','toNumber','updateStatusRealtime','telephone:%s','telephone:save','stateTime','startsWith','Local','substring','indexOf','mobile','phone','accountcode','local','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','[userReport][peerstatus]','peer','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','bluebird'];(function(_0x101f14,_0x2d7298){var _0x1cc1d4=function(_0x1b90c1){while(--_0x1b90c1){_0x101f14['push'](_0x101f14['shift']());}};_0x1cc1d4(++_0x2d7298);}(_0xa8aa,0x8c));var _0xaa8a=function(_0x418733,_0x1ba809){_0x418733=_0x418733-0x0;var _0x597063=_0xa8aa[_0x418733];return _0x597063;};'use strict';var _=require(_0xaa8a('0x0'));var moment=require(_0xaa8a('0x1'));var util=require(_0xaa8a('0x2'));var Redis=require('ioredis');var BPromise=require(_0xaa8a('0x3'));var config=require('../../../config/environment');var logger=require(_0xaa8a('0x4'))('ami');var ami=require(_0xaa8a('0x5'));config[_0xaa8a('0x6')]=_['defaults'](config[_0xaa8a('0x6')],{'host':_0xaa8a('0x7'),'port':0x18eb});var io=require(_0xaa8a('0x8'))(new Redis(config['redis']));function UserReport(_0x75a52){this[_0xaa8a('0x9')]=_0x75a52[_0xaa8a('0x9')];this[_0xaa8a('0xa')]=_0x75a52[_0xaa8a('0xa')];this[_0xaa8a('0xb')]=_0x75a52['telephones'];ami['on'](_0xaa8a('0xc'),this['syncRegistry'][_0xaa8a('0xd')](this));ami['on'](_0xaa8a('0xe'),this[_0xaa8a('0xf')][_0xaa8a('0xd')](this));ami['on'](_0xaa8a('0x10'),this[_0xaa8a('0x11')][_0xaa8a('0xd')](this));ami['on'](_0xaa8a('0x12'),this[_0xaa8a('0x13')][_0xaa8a('0xd')](this));return this[_0xaa8a('0x14')]();}function showSipRegistrations(){Promise[_0xaa8a('0x15')]()[_0xaa8a('0x16')](ami[_0xaa8a('0x17')]())[_0xaa8a('0x18')](function(_0x4852b1){logger['error']('[userReport][sipshowregistry]',util[_0xaa8a('0x19')](_0x4852b1,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xaa8a('0x15')]()[_0xaa8a('0x16')](ami[_0xaa8a('0x1a')]())[_0xaa8a('0x18')](function(_0x2f3799){logger[_0xaa8a('0x1b')]('[userReport][devicestatelist]',util[_0xaa8a('0x19')](_0x2f3799,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0xaa8a('0x16')](ami['actionSipPeerStatus']())['catch'](function(_0x290185){logger[_0xaa8a('0x1b')](_0xaa8a('0x1c'),util[_0xaa8a('0x19')](_0x290185,{'showHidden':![],'depth':null}));});}UserReport[_0xaa8a('0x1d')][_0xaa8a('0x14')]=function(){setInterval(function(){BPromise[_0xaa8a('0x15')]()[_0xaa8a('0x16')](showSipRegistrations())[_0xaa8a('0x16')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x6720ec){return _0x6720ec!==null&&!_['isUndefined'](_0x6720ec);};UserReport[_0xaa8a('0x1d')]['emit']=function(_0x46eb15,_0x58940f,_0x14b164){io['to'](_0x46eb15)[_0xaa8a('0x1e')](_0x58940f,_0x14b164);};UserReport[_0xaa8a('0x1d')][_0xaa8a('0xf')]=function(_0xc65082){try{if(this[_0xaa8a('0x1f')](_0xc65082)){logger[_0xaa8a('0x20')](_0xaa8a('0x21'),_0xc65082[_0xaa8a('0x22')],_0xc65082[_0xaa8a('0x23')]);logger[_0xaa8a('0x24')](_0xaa8a('0x25'),util[_0xaa8a('0x19')](_0xc65082,{'showHidden':![],'depth':null}));var _0x30063c=_[_0xaa8a('0x26')](this['trunks'],{'defaultuser':_0xc65082['username']});if(_0x30063c){_0xc65082['stateRegistry']=_0xc65082[_0xaa8a('0x23')];_[_0xaa8a('0x27')](_0x30063c,_[_0xaa8a('0x28')](_0xc65082,['event','actionid',_0xaa8a('0x22'),_0xaa8a('0x23')]));logger[_0xaa8a('0x24')](_0xaa8a('0x29'),util[_0xaa8a('0x19')](_0x30063c,{'showHidden':![],'depth':null}));this['emit'](util[_0xaa8a('0x2a')](_0xaa8a('0x2b'),_0x30063c[_0xaa8a('0x2c')]),_0xaa8a('0x2d'),_0x30063c);}}}catch(_0x428953){logger[_0xaa8a('0x1b')](_0xaa8a('0x25'),util[_0xaa8a('0x19')](_0x428953,{'showHidden':![],'depth':null}));}};UserReport[_0xaa8a('0x1d')][_0xaa8a('0x11')]=function(_0x4533ec){try{if(this[_0xaa8a('0x1f')](_0x4533ec)){logger['info']('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x4533ec[_0xaa8a('0x2e')],_0x4533ec[_0xaa8a('0x23')]);logger[_0xaa8a('0x24')](_0xaa8a('0x2f'),util[_0xaa8a('0x19')](_0x4533ec,{'showHidden':![],'depth':null}));if(this[_0xaa8a('0xa')][_0x4533ec['device']]){if(!this[_0xaa8a('0xa')][_0x4533ec['device']]['local']||_0x4533ec[_0xaa8a('0x23')][_0xaa8a('0x30')]()==_0xaa8a('0x31')){this[_0xaa8a('0xa')][_0x4533ec[_0xaa8a('0x2e')]]['local']=![];if(this['agents'][_0x4533ec[_0xaa8a('0x2e')]][_0xaa8a('0x23')]!==_0x4533ec['state'][_0xaa8a('0x30')]()){this[_0xaa8a('0xa')][_0x4533ec['device']]['stateTime']=_[_0xaa8a('0x32')](moment()[_0xaa8a('0x2a')]('x'));}this[_0xaa8a('0xa')][_0x4533ec[_0xaa8a('0x2e')]][_0xaa8a('0x23')]=_0x4533ec[_0xaa8a('0x23')]['toLowerCase']();this['agents'][_0x4533ec[_0xaa8a('0x2e')]][_0xaa8a('0x33')](_0x4533ec);}}else if(this['telephones'][_0x4533ec[_0xaa8a('0x2e')]]){if(this['telephones'][_0x4533ec[_0xaa8a('0x2e')]][_0xaa8a('0x23')]!==_0x4533ec[_0xaa8a('0x23')][_0xaa8a('0x30')]()){this['telephones'][_0x4533ec[_0xaa8a('0x2e')]]['stateTime']=_[_0xaa8a('0x32')](moment()[_0xaa8a('0x2a')]('x'));}this['telephones'][_0x4533ec[_0xaa8a('0x2e')]][_0xaa8a('0x23')]=_0x4533ec[_0xaa8a('0x23')]['toLowerCase']();logger[_0xaa8a('0x24')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xaa8a('0x19')](this[_0xaa8a('0xb')][_0x4533ec['device']],{'showHidden':![],'depth':null}));this[_0xaa8a('0x1e')](util['format'](_0xaa8a('0x34'),this[_0xaa8a('0xb')][_0x4533ec[_0xaa8a('0x2e')]]['name']),_0xaa8a('0x35'),this['telephones'][_0x4533ec['device']]);}else if(this[_0xaa8a('0x9')][_0x4533ec[_0xaa8a('0x2e')]]){if(this[_0xaa8a('0x9')][_0x4533ec[_0xaa8a('0x2e')]][_0xaa8a('0x23')]!==_0x4533ec[_0xaa8a('0x23')]['toLowerCase']()){this[_0xaa8a('0x9')][_0x4533ec[_0xaa8a('0x2e')]][_0xaa8a('0x36')]=_[_0xaa8a('0x32')](moment()['format']('x'));}this['trunks'][_0x4533ec['device']][_0xaa8a('0x23')]=_0x4533ec[_0xaa8a('0x23')][_0xaa8a('0x30')]();logger[_0xaa8a('0x24')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0xaa8a('0x19')](this['trunks'][_0x4533ec['device']],{'showHidden':![],'depth':null}));this[_0xaa8a('0x1e')](util[_0xaa8a('0x2a')](_0xaa8a('0x2b'),this[_0xaa8a('0x9')][_0x4533ec['device']][_0xaa8a('0x2c')]),'trunk:save',this['trunks'][_0x4533ec[_0xaa8a('0x2e')]]);}else if(_[_0xaa8a('0x37')](_0x4533ec['device'],_0xaa8a('0x38'))){var _0x53a22e=_0x4533ec[_0xaa8a('0x2e')];var _0x4899dd=_0x53a22e[_0xaa8a('0x39')](_0x53a22e[_0xaa8a('0x3a')]('/')+0x1,_0x53a22e[_0xaa8a('0x3a')]('@'));var _0x5190f4=_[_0xaa8a('0x26')](this['agents'],function(_0x95becb){return _0x95becb[_0xaa8a('0x3b')]==_0x4899dd||_0x95becb[_0xaa8a('0x3c')]==_0x4899dd||_0x95becb[_0xaa8a('0x3d')]==_0x4899dd;});if(_0x5190f4){if(_0x5190f4[_0xaa8a('0x23')]!==_0x4533ec[_0xaa8a('0x23')][_0xaa8a('0x30')]()){_0x5190f4['stateTime']=_[_0xaa8a('0x32')](moment()[_0xaa8a('0x2a')]('x'));}_0x5190f4[_0xaa8a('0x23')]=_0x4533ec['state'][_0xaa8a('0x30')]();_0x5190f4[_0xaa8a('0x3e')]=!![];_0x5190f4[_0xaa8a('0x33')](_0x4533ec);}}}}catch(_0x31bfbc){logger[_0xaa8a('0x1b')](_0xaa8a('0x2f'),util[_0xaa8a('0x19')](_0x31bfbc,{'showHidden':![],'depth':null}));}};UserReport[_0xaa8a('0x1d')][_0xaa8a('0x13')]=function(_0x49ef76){try{if(this[_0xaa8a('0x1f')](_0x49ef76)&&this[_0xaa8a('0x1f')](_0x49ef76[_0xaa8a('0x12')])){logger[_0xaa8a('0x20')](_0xaa8a('0x3f'),_0x49ef76['peer'],_0x49ef76['address'],_0x49ef76[_0xaa8a('0x12')]);logger[_0xaa8a('0x24')](_0xaa8a('0x40'),util[_0xaa8a('0x19')](_0x49ef76,{'showHidden':![],'depth':null}));if(this[_0xaa8a('0xa')][_0x49ef76[_0xaa8a('0x41')]]){if(!this[_0xaa8a('0xa')][_0x49ef76[_0xaa8a('0x41')]][_0xaa8a('0x3e')]||_0x49ef76['peerstatus']['toLowerCase']()==_0xaa8a('0x42')){this[_0xaa8a('0xa')][_0x49ef76[_0xaa8a('0x41')]]['local']=![];this[_0xaa8a('0xa')][_0x49ef76['peer']][_0xaa8a('0x43')]=_0x49ef76[_0xaa8a('0x12')][_0xaa8a('0x30')]();this['agents'][_0x49ef76[_0xaa8a('0x41')]][_0xaa8a('0x44')]=_0x49ef76['address'];this[_0xaa8a('0xa')][_0x49ef76['peer']]['updateStatusRealtime'](_0x49ef76);}}else if(this[_0xaa8a('0xb')][_0x49ef76['peer']]){this['telephones'][_0x49ef76[_0xaa8a('0x41')]]['status']=_0x49ef76[_0xaa8a('0x12')][_0xaa8a('0x30')]();this[_0xaa8a('0xb')][_0x49ef76[_0xaa8a('0x41')]][_0xaa8a('0x44')]=_0x49ef76[_0xaa8a('0x44')];logger[_0xaa8a('0x24')](_0xaa8a('0x45'),util[_0xaa8a('0x19')](this['telephones'][_0x49ef76[_0xaa8a('0x41')]],{'showHidden':![],'depth':null}));this[_0xaa8a('0x1e')](util[_0xaa8a('0x2a')](_0xaa8a('0x34'),this[_0xaa8a('0xb')][_0x49ef76[_0xaa8a('0x41')]][_0xaa8a('0x2c')]),'telephone:save',this[_0xaa8a('0xb')][_0x49ef76[_0xaa8a('0x41')]]);}else if(this[_0xaa8a('0x9')][_0x49ef76[_0xaa8a('0x41')]]){this['trunks'][_0x49ef76['peer']][_0xaa8a('0x43')]=_0x49ef76[_0xaa8a('0x12')][_0xaa8a('0x30')]();this['trunks'][_0x49ef76[_0xaa8a('0x41')]][_0xaa8a('0x44')]=_0x49ef76[_0xaa8a('0x44')];logger[_0xaa8a('0x24')](_0xaa8a('0x46'),util[_0xaa8a('0x19')](this[_0xaa8a('0x9')][_0x49ef76[_0xaa8a('0x41')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xaa8a('0x2a')](_0xaa8a('0x2b'),this['trunks'][_0x49ef76[_0xaa8a('0x41')]]['name']),'trunk:save',this['trunks'][_0x49ef76[_0xaa8a('0x41')]]);}}}catch(_0x163154){logger[_0xaa8a('0x1b')]('[userReport][peerstatus]',util['inspect'](_0x163154,{'showHidden':![],'depth':null}));}};module[_0xaa8a('0x47')]=UserReport; \ No newline at end of file +var _0xac23=['[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','Local','substring','indexOf','mobile','[userReport][devicestatechange]','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','util','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','resolve','then','catch','error','[userReport][devicestatelist]','inspect','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','event','actionid'];(function(_0x1a396b,_0x5345ac){var _0x5ac2e9=function(_0x16ba81){while(--_0x16ba81){_0x1a396b['push'](_0x1a396b['shift']());}};_0x5ac2e9(++_0x5345ac);}(_0xac23,0x65));var _0x3ac2=function(_0x834bb6,_0x1c5e35){_0x834bb6=_0x834bb6-0x0;var _0xa35d00=_0xac23[_0x834bb6];return _0xa35d00;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x3ac2('0x0'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0x3ac2('0x1'));var logger=require(_0x3ac2('0x2'))(_0x3ac2('0x3'));var ami=require(_0x3ac2('0x4'));config[_0x3ac2('0x5')]=_['defaults'](config[_0x3ac2('0x5')],{'host':_0x3ac2('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3ac2('0x5')]));function UserReport(_0x3c34c8){this[_0x3ac2('0x7')]=_0x3c34c8[_0x3ac2('0x7')];this[_0x3ac2('0x8')]=_0x3c34c8[_0x3ac2('0x8')];this[_0x3ac2('0x9')]=_0x3c34c8[_0x3ac2('0x9')];ami['on'](_0x3ac2('0xa'),this[_0x3ac2('0xb')][_0x3ac2('0xc')](this));ami['on'](_0x3ac2('0xd'),this['syncRegistry'][_0x3ac2('0xc')](this));ami['on'](_0x3ac2('0xe'),this[_0x3ac2('0xf')][_0x3ac2('0xc')](this));ami['on']('peerstatus',this[_0x3ac2('0x10')][_0x3ac2('0xc')](this));return this[_0x3ac2('0x11')]();}function showSipRegistrations(){Promise[_0x3ac2('0x12')]()[_0x3ac2('0x13')](ami['actionSipShowRegistry']())[_0x3ac2('0x14')](function(_0x2efc81){logger[_0x3ac2('0x15')]('[userReport][sipshowregistry]',util['inspect'](_0x2efc81,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x3ac2('0x12')]()[_0x3ac2('0x13')](ami['actionDeviceStateList']())[_0x3ac2('0x14')](function(_0x431150){logger[_0x3ac2('0x15')](_0x3ac2('0x16'),util[_0x3ac2('0x17')](_0x431150,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x3ac2('0x12')]()[_0x3ac2('0x13')](ami[_0x3ac2('0x18')]())[_0x3ac2('0x14')](function(_0x33e4b3){logger['error'](_0x3ac2('0x19'),util[_0x3ac2('0x17')](_0x33e4b3,{'showHidden':![],'depth':null}));});}UserReport[_0x3ac2('0x1a')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x3ac2('0x12')]()[_0x3ac2('0x13')](showSipRegistrations())[_0x3ac2('0x13')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x3ac2('0x1a')][_0x3ac2('0x1b')]=function(_0x2def76){return _0x2def76!==null&&!_[_0x3ac2('0x1c')](_0x2def76);};UserReport['prototype'][_0x3ac2('0x1d')]=function(_0x5bf137,_0x14e793,_0x1a756d){io['to'](_0x5bf137)['emit'](_0x14e793,_0x1a756d);};UserReport['prototype'][_0x3ac2('0xb')]=function(_0x1ec656){try{if(this[_0x3ac2('0x1b')](_0x1ec656)){logger[_0x3ac2('0x1e')](_0x3ac2('0x1f'),_0x1ec656[_0x3ac2('0x20')],_0x1ec656[_0x3ac2('0x21')]);logger[_0x3ac2('0x22')](_0x3ac2('0x23'),util[_0x3ac2('0x17')](_0x1ec656,{'showHidden':![],'depth':null}));var _0x180dfd=_[_0x3ac2('0x24')](this[_0x3ac2('0x7')],{'defaultuser':_0x1ec656[_0x3ac2('0x20')]});if(_0x180dfd){_0x1ec656['stateRegistry']=_0x1ec656[_0x3ac2('0x21')];_['merge'](_0x180dfd,_['omit'](_0x1ec656,[_0x3ac2('0x25'),_0x3ac2('0x26'),_0x3ac2('0x20'),_0x3ac2('0x21')]));logger[_0x3ac2('0x22')](_0x3ac2('0x27'),util[_0x3ac2('0x17')](_0x180dfd,{'showHidden':![],'depth':null}));this[_0x3ac2('0x1d')](util[_0x3ac2('0x28')](_0x3ac2('0x29'),_0x180dfd[_0x3ac2('0x2a')]),'trunk:save',_0x180dfd);}}}catch(_0x896b10){logger[_0x3ac2('0x15')]('[userReport][registry]',util[_0x3ac2('0x17')](_0x896b10,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x3fbd11){try{if(this[_0x3ac2('0x1b')](_0x3fbd11)){logger[_0x3ac2('0x1e')](_0x3ac2('0x2b'),_0x3fbd11[_0x3ac2('0x2c')],_0x3fbd11['state']);logger['debug']('[userReport][devicestatechange]',util[_0x3ac2('0x17')](_0x3fbd11,{'showHidden':![],'depth':null}));if(this[_0x3ac2('0x8')][_0x3fbd11['device']]){if(!this['agents'][_0x3fbd11[_0x3ac2('0x2c')]][_0x3ac2('0x2d')]||_0x3fbd11[_0x3ac2('0x21')][_0x3ac2('0x2e')]()==_0x3ac2('0x2f')){this[_0x3ac2('0x8')][_0x3fbd11[_0x3ac2('0x2c')]]['local']=![];if(this[_0x3ac2('0x8')][_0x3fbd11['device']][_0x3ac2('0x21')]!==_0x3fbd11['state'][_0x3ac2('0x2e')]()){this[_0x3ac2('0x8')][_0x3fbd11[_0x3ac2('0x2c')]][_0x3ac2('0x30')]=_[_0x3ac2('0x31')](moment()['format']('x'));}this[_0x3ac2('0x8')][_0x3fbd11[_0x3ac2('0x2c')]][_0x3ac2('0x21')]=_0x3fbd11[_0x3ac2('0x21')][_0x3ac2('0x2e')]();this[_0x3ac2('0x8')][_0x3fbd11[_0x3ac2('0x2c')]][_0x3ac2('0x32')](_0x3fbd11);}}else if(this[_0x3ac2('0x9')][_0x3fbd11[_0x3ac2('0x2c')]]){if(this[_0x3ac2('0x9')][_0x3fbd11[_0x3ac2('0x2c')]][_0x3ac2('0x21')]!==_0x3fbd11['state'][_0x3ac2('0x2e')]()){this[_0x3ac2('0x9')][_0x3fbd11[_0x3ac2('0x2c')]][_0x3ac2('0x30')]=_[_0x3ac2('0x31')](moment()[_0x3ac2('0x28')]('x'));}this[_0x3ac2('0x9')][_0x3fbd11[_0x3ac2('0x2c')]]['state']=_0x3fbd11[_0x3ac2('0x21')][_0x3ac2('0x2e')]();logger[_0x3ac2('0x22')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x3ac2('0x17')](this['telephones'][_0x3fbd11[_0x3ac2('0x2c')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x3ac2('0x28')](_0x3ac2('0x33'),this['telephones'][_0x3fbd11[_0x3ac2('0x2c')]]['name']),'telephone:save',this[_0x3ac2('0x9')][_0x3fbd11[_0x3ac2('0x2c')]]);}else if(this[_0x3ac2('0x7')][_0x3fbd11[_0x3ac2('0x2c')]]){if(this[_0x3ac2('0x7')][_0x3fbd11['device']][_0x3ac2('0x21')]!==_0x3fbd11[_0x3ac2('0x21')][_0x3ac2('0x2e')]()){this[_0x3ac2('0x7')][_0x3fbd11[_0x3ac2('0x2c')]]['stateTime']=_[_0x3ac2('0x31')](moment()[_0x3ac2('0x28')]('x'));}this['trunks'][_0x3fbd11[_0x3ac2('0x2c')]][_0x3ac2('0x21')]=_0x3fbd11[_0x3ac2('0x21')]['toLowerCase']();logger[_0x3ac2('0x22')](_0x3ac2('0x34'),util['inspect'](this['trunks'][_0x3fbd11['device']],{'showHidden':![],'depth':null}));this[_0x3ac2('0x1d')](util[_0x3ac2('0x28')]('trunk:%s',this[_0x3ac2('0x7')][_0x3fbd11[_0x3ac2('0x2c')]][_0x3ac2('0x2a')]),_0x3ac2('0x35'),this[_0x3ac2('0x7')][_0x3fbd11[_0x3ac2('0x2c')]]);}else if(_['startsWith'](_0x3fbd11[_0x3ac2('0x2c')],_0x3ac2('0x36'))){var _0x3a73a1=_0x3fbd11[_0x3ac2('0x2c')];var _0x59cb3f=_0x3a73a1[_0x3ac2('0x37')](_0x3a73a1[_0x3ac2('0x38')]('/')+0x1,_0x3a73a1['indexOf']('@'));var _0x5d7a80=_['find'](this[_0x3ac2('0x8')],function(_0xfaa2c9){return _0xfaa2c9[_0x3ac2('0x39')]==_0x59cb3f||_0xfaa2c9['phone']==_0x59cb3f||_0xfaa2c9['accountcode']==_0x59cb3f;});if(_0x5d7a80){if(_0x5d7a80[_0x3ac2('0x21')]!==_0x3fbd11[_0x3ac2('0x21')][_0x3ac2('0x2e')]()){_0x5d7a80[_0x3ac2('0x30')]=_[_0x3ac2('0x31')](moment()[_0x3ac2('0x28')]('x'));}_0x5d7a80['state']=_0x3fbd11[_0x3ac2('0x21')][_0x3ac2('0x2e')]();_0x5d7a80['local']=!![];_0x5d7a80[_0x3ac2('0x32')](_0x3fbd11);}}}}catch(_0x5d2f80){logger[_0x3ac2('0x15')](_0x3ac2('0x3a'),util[_0x3ac2('0x17')](_0x5d2f80,{'showHidden':![],'depth':null}));}};UserReport[_0x3ac2('0x1a')][_0x3ac2('0x10')]=function(_0x4eedbc){try{if(this['isNotNull'](_0x4eedbc)&&this[_0x3ac2('0x1b')](_0x4eedbc[_0x3ac2('0x3b')])){logger[_0x3ac2('0x1e')](_0x3ac2('0x3c'),_0x4eedbc[_0x3ac2('0x3d')],_0x4eedbc['address'],_0x4eedbc[_0x3ac2('0x3b')]);logger['debug'](_0x3ac2('0x3e'),util[_0x3ac2('0x17')](_0x4eedbc,{'showHidden':![],'depth':null}));if(this[_0x3ac2('0x8')][_0x4eedbc[_0x3ac2('0x3d')]]){if(!this[_0x3ac2('0x8')][_0x4eedbc[_0x3ac2('0x3d')]][_0x3ac2('0x2d')]||_0x4eedbc[_0x3ac2('0x3b')][_0x3ac2('0x2e')]()==_0x3ac2('0x3f')){this[_0x3ac2('0x8')][_0x4eedbc[_0x3ac2('0x3d')]][_0x3ac2('0x2d')]=![];this[_0x3ac2('0x8')][_0x4eedbc[_0x3ac2('0x3d')]][_0x3ac2('0x40')]=_0x4eedbc[_0x3ac2('0x3b')][_0x3ac2('0x2e')]();this[_0x3ac2('0x8')][_0x4eedbc['peer']][_0x3ac2('0x41')]=_0x4eedbc[_0x3ac2('0x41')];this[_0x3ac2('0x8')][_0x4eedbc['peer']][_0x3ac2('0x32')](_0x4eedbc);}}else if(this[_0x3ac2('0x9')][_0x4eedbc[_0x3ac2('0x3d')]]){this[_0x3ac2('0x9')][_0x4eedbc[_0x3ac2('0x3d')]][_0x3ac2('0x40')]=_0x4eedbc['peerstatus'][_0x3ac2('0x2e')]();this[_0x3ac2('0x9')][_0x4eedbc[_0x3ac2('0x3d')]][_0x3ac2('0x41')]=_0x4eedbc[_0x3ac2('0x41')];logger[_0x3ac2('0x22')](_0x3ac2('0x42'),util['inspect'](this[_0x3ac2('0x9')][_0x4eedbc[_0x3ac2('0x3d')]],{'showHidden':![],'depth':null}));this[_0x3ac2('0x1d')](util[_0x3ac2('0x28')](_0x3ac2('0x33'),this['telephones'][_0x4eedbc[_0x3ac2('0x3d')]][_0x3ac2('0x2a')]),_0x3ac2('0x43'),this[_0x3ac2('0x9')][_0x4eedbc['peer']]);}else if(this['trunks'][_0x4eedbc[_0x3ac2('0x3d')]]){this[_0x3ac2('0x7')][_0x4eedbc['peer']]['status']=_0x4eedbc[_0x3ac2('0x3b')][_0x3ac2('0x2e')]();this[_0x3ac2('0x7')][_0x4eedbc[_0x3ac2('0x3d')]]['address']=_0x4eedbc[_0x3ac2('0x41')];logger['debug'](_0x3ac2('0x44'),util[_0x3ac2('0x17')](this[_0x3ac2('0x7')][_0x4eedbc[_0x3ac2('0x3d')]],{'showHidden':![],'depth':null}));this[_0x3ac2('0x1d')](util[_0x3ac2('0x28')](_0x3ac2('0x29'),this[_0x3ac2('0x7')][_0x4eedbc['peer']]['name']),_0x3ac2('0x35'),this[_0x3ac2('0x7')][_0x4eedbc[_0x3ac2('0x3d')]]);}}}catch(_0x2f8dbb){logger[_0x3ac2('0x15')](_0x3ac2('0x3e'),util[_0x3ac2('0x17')](_0x2f8dbb,{'showHidden':![],'depth':null}));}};module[_0x3ac2('0x45')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index e21211b..98aa8ee 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 _0xf1e6=['rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','[%s][voiceAgentReport][hangup]\x20event:','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstart]','substring','onhold','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','ioredis','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','queue','variables','format','YYYY-MM-DD\x20HH:mm:ss','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','voiceChannels','routealias','merge','interface','pick','destconnectedlinenum','name','accountcode','exten','custom:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','assign','[%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]\x20event:','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','transfer','agent','talktime','acwTimeout','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','addVariable','value','variable','[%s][voiceAgentReport][varset]','rtpaudioqosbridged'];(function(_0x53b449,_0x60b6c0){var _0x9196f0=function(_0x504006){while(--_0x504006){_0x53b449['push'](_0x53b449['shift']());}};_0x9196f0(++_0x60b6c0);}(_0xf1e6,0x15c));var _0x6f1e=function(_0x262a0b,_0x20d859){_0x262a0b=_0x262a0b-0x0;var _0x15f521=_0xf1e6[_0x262a0b];return _0x15f521;};'use strict';var _=require(_0x6f1e('0x0'));var moment=require(_0x6f1e('0x1'));var util=require(_0x6f1e('0x2'));var Redis=require(_0x6f1e('0x3'));var config=require('../../../config/environment');var logger=require(_0x6f1e('0x4'))('ami');var ami=require(_0x6f1e('0x5'));config[_0x6f1e('0x6')]=_[_0x6f1e('0x7')](config['redis'],{'host':_0x6f1e('0x8'),'port':0x18eb});var io=require(_0x6f1e('0x9'))(new Redis(config[_0x6f1e('0x6')]));function VoiceAgentReport(_0x5a3c3c){this[_0x6f1e('0xa')]={};this['voiceChannels']=_0x5a3c3c[_0x6f1e('0xa')];this[_0x6f1e('0xb')]=_0x5a3c3c['voiceQueues'];this[_0x6f1e('0xc')]=_0x5a3c3c[_0x6f1e('0xc')];this['variables']={};ami['on']('agentcalled',this['syncAgentCalled'][_0x6f1e('0xd')](this));ami['on'](_0x6f1e('0xe'),this[_0x6f1e('0xf')]['bind'](this));ami['on'](_0x6f1e('0x10'),this[_0x6f1e('0x11')][_0x6f1e('0xd')](this));ami['on']('queuecallerabandon',this[_0x6f1e('0x12')][_0x6f1e('0xd')](this));ami['on'](_0x6f1e('0x13'),this[_0x6f1e('0x14')][_0x6f1e('0xd')](this));ami['on']('varset',this['syncVarSet'][_0x6f1e('0xd')](this));ami['on'](_0x6f1e('0x15'),this[_0x6f1e('0x16')][_0x6f1e('0xd')](this));ami['on'](_0x6f1e('0x17'),this[_0x6f1e('0x18')][_0x6f1e('0xd')](this));ami['on'](_0x6f1e('0x19'),this[_0x6f1e('0x1a')][_0x6f1e('0xd')](this));ami['on'](_0x6f1e('0x1b'),this[_0x6f1e('0x1c')][_0x6f1e('0xd')](this));ami['on'](_0x6f1e('0x1d'),this[_0x6f1e('0x1e')][_0x6f1e('0xd')](this));}VoiceAgentReport[_0x6f1e('0x1f')][_0x6f1e('0x20')]=function(_0x21a313,_0x48853a,_0x79d08d){io['to'](_0x21a313)[_0x6f1e('0x20')](_0x48853a,_0x79d08d);};VoiceAgentReport[_0x6f1e('0x1f')][_0x6f1e('0x21')]=function(_0x12abca){return _0x12abca!==null&&!_[_0x6f1e('0x22')](_0x12abca);};VoiceAgentReport[_0x6f1e('0x1f')][_0x6f1e('0x23')]=function(_0x78290c){try{if(this['isNotNull'](_0x78290c)){logger['info']('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x78290c[_0x6f1e('0x24')],_0x78290c[_0x6f1e('0x25')],_0x78290c[_0x6f1e('0x26')]);logger[_0x6f1e('0x27')](_0x6f1e('0x28'),_0x78290c[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x78290c,{'showHidden':![],'depth':null}));if(_[_0x6f1e('0x22')](this[_0x6f1e('0xa')][_0x78290c[_0x6f1e('0x24')]])){this[_0x6f1e('0xa')][_0x78290c[_0x6f1e('0x24')]]={};}var _0x50a5b9=this[_0x6f1e('0xc')][_0x78290c['interface']];var _0x2e2de9=this['channels'][_0x78290c[_0x6f1e('0x24')]][_0x78290c['destuniqueid']];var _0x1db088=this[_0x6f1e('0xb')][_0x78290c[_0x6f1e('0x2a')]];var _0x1b222a=this[_0x6f1e('0x2b')][_0x78290c['uniqueid']];if(_[_0x6f1e('0x22')](_0x2e2de9)){_0x2e2de9={'agentcalledAt':moment()[_0x6f1e('0x2c')](_0x6f1e('0x2d')),'lastevent':'called','mandatoryDisposition':_0x1db088&&_0x1db088[_0x6f1e('0x2e')]?_0x1db088[_0x6f1e('0x2e')]:![],'type':_0x1db088&&_0x1db088[_0x6f1e('0x2f')]?_0x1db088[_0x6f1e('0x2f')]:_0x6f1e('0x30'),'variables':_0x1b222a,'motionChannel':_0x6f1e('0x31')};}Object['assign'](_0x2e2de9,_[_0x6f1e('0x32')](_0x78290c,[_0x6f1e('0x33'),_0x6f1e('0x34')]));this[_0x6f1e('0xa')][_0x78290c['uniqueid']][_0x78290c[_0x6f1e('0x26')]]=_0x2e2de9;logger[_0x6f1e('0x27')](_0x6f1e('0x35'),_0x78290c[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x2e2de9,{'showHidden':![],'depth':null}));ami[_0x6f1e('0x20')](_0x6f1e('0x36'),_0x2e2de9);var _0x5ce9e7={'id':_0x50a5b9['id'],'calleridnum':_0x2e2de9[_0x6f1e('0x37')],'queue':_0x2e2de9[_0x6f1e('0x2a')],'variables':_0x2e2de9['variables'],'uniqueid':_0x78290c['uniqueid']};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x78290c[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x5ce9e7,{'showHidden':![],'depth':null}));this['emit'](util[_0x6f1e('0x2c')](_0x6f1e('0x38'),_0x78290c[_0x6f1e('0x25')]),_0x6f1e('0x39'),_0x5ce9e7);}}catch(_0x37ed74){logger[_0x6f1e('0x3a')](_0x6f1e('0x3b'),_0x78290c[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x37ed74,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6f1e('0x1f')]['syncAgentConnect']=function(_0x5cde89){try{if(this[_0x6f1e('0x21')](_0x5cde89)){if(this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]]){for(var _0x1cd51b in this['channels'][_0x5cde89[_0x6f1e('0x24')]]){if(this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x6f1e('0x3c')](_0x1cd51b)){if(_0x5cde89['destuniqueid']===_0x1cd51b){logger[_0x6f1e('0x3d')](_0x6f1e('0x3e'),_0x5cde89[_0x6f1e('0x24')],_0x5cde89[_0x6f1e('0x25')],_0x5cde89['destuniqueid']);this['channels'][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b]['agentconnectAt']=moment()['format'](_0x6f1e('0x2d'));this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x3f')]=_0x5cde89[_0x6f1e('0x3f')];this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x40')]=_0x5cde89[_0x6f1e('0x40')];this['channels'][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x41')]=_0x5cde89[_0x6f1e('0x41')];this['channels'][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x42')]=_0x5cde89[_0x6f1e('0x42')];this['channels'][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b]['holdtime']=_0x5cde89[_0x6f1e('0x43')];this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x44')]=_0x6f1e('0x45');if(this[_0x6f1e('0x46')][this['channels'][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x24')]]){var _0x5af7d0=this[_0x6f1e('0x46')][this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x24')]]['routealias'];this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x47')]=_0x5af7d0;_0x5cde89[_0x6f1e('0x47')]=_0x5af7d0;}_[_0x6f1e('0x48')](this['agents'][_0x5cde89[_0x6f1e('0x49')]],_[_0x6f1e('0x4a')](_0x5cde89,['queue',_0x6f1e('0x4b'),_0x6f1e('0x47')]));var _0x10d3b5=this[_0x6f1e('0xc')][_0x5cde89['interface']];var _0x2b7b64={'id':_0x10d3b5['id'],'name':_0x10d3b5[_0x6f1e('0x4c')],'agentconnected':!![],'destaccountcode':_0x10d3b5[_0x6f1e('0x4d')],'destconnectedlinenum':this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x5cde89['destuniqueid']][_0x6f1e('0x4e')],'queue':this[_0x6f1e('0xa')][_0x5cde89['uniqueid']][_0x5cde89[_0x6f1e('0x26')]][_0x6f1e('0x2a')],'routealias':this[_0x6f1e('0xa')][_0x5cde89['uniqueid']][_0x5cde89['destuniqueid']][_0x6f1e('0x47')],'uniqueid':this[_0x6f1e('0xa')][_0x5cde89['uniqueid']][_0x5cde89[_0x6f1e('0x26')]][_0x6f1e('0x24')]};ami[_0x6f1e('0x20')](_0x6f1e('0x4f'),this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x5cde89['destuniqueid']]);this['emit'](util[_0x6f1e('0x2c')](_0x6f1e('0x38'),_0x5cde89[_0x6f1e('0x25')]),'user:agentconnect',_0x2b7b64);}else if(!this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x10')]&&!this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x13')]){logger['info'](_0x6f1e('0x50'),_0x5cde89[_0x6f1e('0x24')],this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x25')],_0x1cd51b);this[_0x6f1e('0xa')][_0x5cde89['uniqueid']][_0x1cd51b][_0x6f1e('0x10')]=!![];this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x51')]=moment()[_0x6f1e('0x2c')](_0x6f1e('0x2d'));this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x52')]=_0x5cde89[_0x6f1e('0x26')];this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x53')]=_0x5cde89[_0x6f1e('0x25')];this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b][_0x6f1e('0x44')]='answered_elsewhere';this[_0x6f1e('0xa')][_0x5cde89['uniqueid']][_0x1cd51b]['reason']='answered_elsewhere';logger[_0x6f1e('0x27')](_0x6f1e('0x54'),_0x5cde89[_0x6f1e('0x24')],util[_0x6f1e('0x29')](this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b],{'showHidden':![],'depth':null}));ami[_0x6f1e('0x20')](_0x6f1e('0x55'),this[_0x6f1e('0xa')][_0x5cde89[_0x6f1e('0x24')]][_0x1cd51b]);}else{logger['debug'](_0x6f1e('0x56'),_0x5cde89['uniqueid']);}}}}}}catch(_0x553e6a){logger[_0x6f1e('0x3a')](_0x6f1e('0x57'),_0x5cde89[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x553e6a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6f1e('0x1f')][_0x6f1e('0x11')]=function(_0x1570e1){try{if(this[_0x6f1e('0x21')](_0x1570e1)){logger['debug'](_0x6f1e('0x58'),_0x1570e1[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x1570e1,{'showHidden':![],'depth':null}));if(this[_0x6f1e('0xa')][_0x1570e1['uniqueid']]&&this[_0x6f1e('0xa')][_0x1570e1['uniqueid']][_0x1570e1['destuniqueid']]){logger['info']('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x1570e1['uniqueid'],_0x1570e1[_0x6f1e('0x25')],_0x1570e1[_0x6f1e('0x26')]);var _0x5d4367=this[_0x6f1e('0xc')][_0x1570e1['interface']];var _0x41d12e=this['channels'][_0x1570e1[_0x6f1e('0x24')]][_0x1570e1['destuniqueid']];_0x41d12e[_0x6f1e('0x10')]=!![];_0x41d12e[_0x6f1e('0x51')]=moment()[_0x6f1e('0x2c')](_0x6f1e('0x2d'));_0x41d12e['lastevent']=_0x6f1e('0x59');_0x41d12e[_0x6f1e('0x5a')]='rejected';var _0x367e18={'id':_0x5d4367['id'],'name':_0x5d4367['name'],'queue':_0x41d12e[_0x6f1e('0x2a')],'uniqueid':_0x41d12e[_0x6f1e('0x24')]};logger[_0x6f1e('0x27')](_0x6f1e('0x5b'),_0x1570e1[_0x6f1e('0x24')],util['inspect'](_0x367e18,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x6f1e('0x38'),_0x5d4367[_0x6f1e('0x4c')]),_0x6f1e('0x5c'),_0x367e18);ami[_0x6f1e('0x20')](_0x6f1e('0x5d'),_0x41d12e);this[_0x6f1e('0xa')][_0x1570e1[_0x6f1e('0x24')]][_0x1570e1[_0x6f1e('0x26')]]=Object[_0x6f1e('0x5e')]({},_0x41d12e);}}}catch(_0xaeb88c){logger['error'](_0x6f1e('0x5f'),_0x1570e1['uniqueid'],util[_0x6f1e('0x29')](_0xaeb88c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6f1e('0x1f')][_0x6f1e('0x12')]=function(_0x187c06){try{if(this[_0x6f1e('0x21')](_0x187c06)){logger['debug'](_0x6f1e('0x60'),_0x187c06[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x187c06,{'showHidden':![],'depth':null}));if(this[_0x6f1e('0xa')][_0x187c06[_0x6f1e('0x24')]]){for(var _0xc790a7 in this[_0x6f1e('0xa')][_0x187c06[_0x6f1e('0x24')]]){if(this['channels'][_0x187c06[_0x6f1e('0x24')]]['hasOwnProperty'](_0xc790a7)&&!this[_0x6f1e('0xa')][_0x187c06[_0x6f1e('0x24')]][_0xc790a7]['agentringnoanswer']&&!this[_0x6f1e('0xa')][_0x187c06['uniqueid']][_0xc790a7][_0x6f1e('0x13')]){logger[_0x6f1e('0x3d')](_0x6f1e('0x61'),_0x187c06[_0x6f1e('0x24')],this[_0x6f1e('0xa')][_0x187c06[_0x6f1e('0x24')]][_0xc790a7][_0x6f1e('0x25')],_0xc790a7);this[_0x6f1e('0xa')][_0x187c06[_0x6f1e('0x24')]][_0xc790a7][_0x6f1e('0x10')]=!![];this[_0x6f1e('0xa')][_0x187c06['uniqueid']][_0xc790a7][_0x6f1e('0x51')]=moment()[_0x6f1e('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6f1e('0xa')][_0x187c06['uniqueid']][_0xc790a7]['lastevent']=_0x6f1e('0x62');this[_0x6f1e('0xa')][_0x187c06[_0x6f1e('0x24')]][_0xc790a7][_0x6f1e('0x5a')]=_0x6f1e('0x62');logger['debug'](_0x6f1e('0x63'),_0x187c06[_0x6f1e('0x24')],util['inspect'](this[_0x6f1e('0xa')][_0x187c06[_0x6f1e('0x24')]][_0xc790a7],{'showHidden':![],'depth':null}));ami[_0x6f1e('0x20')](_0x6f1e('0x64'),this[_0x6f1e('0xa')][_0x187c06['uniqueid']][_0xc790a7]);}}}}}catch(_0x24e7ff){logger[_0x6f1e('0x3a')](_0x6f1e('0x65'),_0x187c06[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x24e7ff,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6f1e('0x14')]=function(_0x11e48b){try{if(this['isNotNull'](_0x11e48b)){logger[_0x6f1e('0x27')](_0x6f1e('0x66'),_0x11e48b[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x11e48b,{'showHidden':![],'depth':null}));if(this[_0x6f1e('0xa')][_0x11e48b[_0x6f1e('0x24')]]){for(var _0x193586 in this[_0x6f1e('0xa')][_0x11e48b[_0x6f1e('0x24')]]){if(this['channels'][_0x11e48b[_0x6f1e('0x24')]][_0x6f1e('0x3c')](_0x193586)){if(this[_0x6f1e('0xa')][_0x11e48b[_0x6f1e('0x24')]][_0x193586][_0x6f1e('0x67')]&&!this[_0x6f1e('0xa')][_0x11e48b[_0x6f1e('0x24')]][_0x193586][_0x6f1e('0x13')]){logger['info'](_0x6f1e('0x68'),_0x11e48b[_0x6f1e('0x24')],this[_0x6f1e('0xa')][_0x11e48b[_0x6f1e('0x24')]][_0x193586][_0x6f1e('0x25')],_0x193586);this['channels'][_0x11e48b[_0x6f1e('0x24')]][_0x193586][_0x6f1e('0x13')]=!![];this[_0x6f1e('0xa')][_0x11e48b['uniqueid']][_0x193586]['agentcompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6f1e('0xa')][_0x11e48b[_0x6f1e('0x24')]][_0x193586][_0x6f1e('0x44')]=_0x6f1e('0x69');this[_0x6f1e('0xa')][_0x11e48b[_0x6f1e('0x24')]][_0x193586]['reason']=_0x11e48b['reason']==_0x6f1e('0x6a')?_0x6f1e('0x6b'):_0x11e48b[_0x6f1e('0x5a')];this[_0x6f1e('0xa')][_0x11e48b['uniqueid']][_0x193586][_0x6f1e('0x6c')]=_0x11e48b['talktime'];if(this[_0x6f1e('0xb')][_0x11e48b[_0x6f1e('0x2a')]]&&this['voiceQueues'][_0x11e48b['queue']]['acw']){this['channels'][_0x11e48b[_0x6f1e('0x24')]][_0x193586]['acwtime']=this['voiceQueues'][_0x11e48b[_0x6f1e('0x2a')]][_0x6f1e('0x6d')];this['channels'][_0x11e48b[_0x6f1e('0x24')]][_0x193586]['agentacw']=!![];}this[_0x6f1e('0xc')][_0x11e48b[_0x6f1e('0x49')]]=_[_0x6f1e('0x32')](this[_0x6f1e('0xc')][_0x11e48b[_0x6f1e('0x49')]],[_0x6f1e('0x2a'),_0x6f1e('0x4b')]);logger[_0x6f1e('0x27')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x11e48b[_0x6f1e('0x24')],util['inspect'](this['channels'][_0x11e48b['uniqueid']][_0x193586],{'showHidden':![],'depth':null}));ami[_0x6f1e('0x20')]('custom:agentcomplete',this[_0x6f1e('0xa')][_0x11e48b[_0x6f1e('0x24')]][_0x193586]);logger[_0x6f1e('0x27')](_0x6f1e('0x6e'),_0x11e48b[_0x6f1e('0x24')],util[_0x6f1e('0x29')]({'id':this[_0x6f1e('0xc')][_0x11e48b[_0x6f1e('0x49')]]['id'],'destaccountcode':_0x11e48b['destaccountcode']},{'showHidden':![],'depth':null}));this['emit'](util[_0x6f1e('0x2c')](_0x6f1e('0x38'),_0x11e48b[_0x6f1e('0x25')]),_0x6f1e('0x6f'),{'id':this[_0x6f1e('0xc')][_0x11e48b[_0x6f1e('0x49')]]['id'],'destaccountcode':Number(_0x11e48b['destaccountcode'])});}}}}}}catch(_0x4d4982){logger[_0x6f1e('0x3a')](_0x6f1e('0x70'),_0x11e48b[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x4d4982,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6f1e('0x1f')][_0x6f1e('0x71')]=function(_0xea1330){try{if(this[_0x6f1e('0x21')](_0xea1330)){logger[_0x6f1e('0x27')](_0x6f1e('0x72'),_0xea1330[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0xea1330,{'showHidden':![],'depth':null}));this[_0x6f1e('0x73')](_0xea1330[_0x6f1e('0x24')],_['keys'](_0xea1330['variable'])[0x0],_0xea1330[_0x6f1e('0x74')]);if(this['channels'][_0xea1330[_0x6f1e('0x24')]]){for(var _0x31004e in this[_0x6f1e('0xa')][_0xea1330[_0x6f1e('0x24')]]){if(this[_0x6f1e('0xa')][_0xea1330[_0x6f1e('0x24')]]['hasOwnProperty'](_0x31004e)){logger[_0x6f1e('0x3d')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0xea1330[_0x6f1e('0x24')],_0x31004e,_['keys'](_0xea1330[_0x6f1e('0x75')])[0x0],_0xea1330[_0x6f1e('0x74')]);if(_['isUndefined'](this[_0x6f1e('0xa')][_0xea1330['uniqueid']][_0x31004e][_0x6f1e('0x2b')])){this[_0x6f1e('0xa')][_0xea1330[_0x6f1e('0x24')]][_0x31004e][_0x6f1e('0x2b')]={};}this[_0x6f1e('0xa')][_0xea1330['uniqueid']][_0x31004e][_0x6f1e('0x2b')]=this[_0x6f1e('0x2b')][_0xea1330['uniqueid']];}}}}}catch(_0x183fdf){logger[_0x6f1e('0x3a')](_0x6f1e('0x76'),_0xea1330[_0x6f1e('0x24')],util['inspect'](_0x183fdf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6f1e('0x1f')][_0x6f1e('0x73')]=function(_0x1d8158,_0x2fc36a,_0x384781){var _0x533ff6=['rtpaudioqos',_0x6f1e('0x77'),_0x6f1e('0x78'),_0x6f1e('0x79'),'rtpaudioqosloss',_0x6f1e('0x7a'),_0x6f1e('0x7b'),_0x6f1e('0x7c'),_0x6f1e('0x7d'),'sipuri',_0x6f1e('0x7e'),'bridgepvtcallid','membercalls',_0x6f1e('0x7f'),_0x6f1e('0x80'),_0x6f1e('0x81'),_0x6f1e('0x25'),_0x6f1e('0x82'),_0x6f1e('0x83')];if(!_[_0x6f1e('0x84')](_0x2fc36a)&&!_['includes'](_0x533ff6,_0x2fc36a)){if(_[_0x6f1e('0x22')](this['variables'][_0x1d8158])){this[_0x6f1e('0x2b')][_0x1d8158]={};}this[_0x6f1e('0x2b')][_0x1d8158][_0x2fc36a]=_0x384781;}};VoiceAgentReport['prototype']['syncHangup']=function(_0x4d40bd){try{if(this[_0x6f1e('0x21')](_0x4d40bd)){logger['debug'](_0x6f1e('0x85'),_0x4d40bd[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x4d40bd,{'showHidden':![],'depth':null}));if(this[_0x6f1e('0xa')][_0x4d40bd[_0x6f1e('0x24')]]){for(var _0xdf617f in this[_0x6f1e('0xa')][_0x4d40bd[_0x6f1e('0x24')]]){if(this[_0x6f1e('0xa')][_0x4d40bd[_0x6f1e('0x24')]][_0x6f1e('0x3c')](_0xdf617f)){if(this['channels'][_0x4d40bd[_0x6f1e('0x24')]][_0xdf617f][_0x6f1e('0x5a')]=='transfer'&&this[_0x6f1e('0xa')][_0x4d40bd['uniqueid']][_0xdf617f][_0x6f1e('0x13')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4d40bd['uniqueid'],_0xdf617f);this['channels'][_0x4d40bd[_0x6f1e('0x24')]][_0xdf617f][_0x6f1e('0x86')]=moment()[_0x6f1e('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x6f1e('0x27')](_0x6f1e('0x87'),_0x4d40bd['uniqueid'],util[_0x6f1e('0x29')](_[_0x6f1e('0x88')](this['channels'][_0x4d40bd[_0x6f1e('0x24')]]),{'showHidden':![],'depth':null}));ami[_0x6f1e('0x20')](_0x6f1e('0x89'),_[_0x6f1e('0x88')](this[_0x6f1e('0xa')][_0x4d40bd[_0x6f1e('0x24')]]));delete this[_0x6f1e('0xa')][_0x4d40bd[_0x6f1e('0x24')]];}if(this[_0x6f1e('0x2b')][_0x4d40bd[_0x6f1e('0x24')]]){delete this['variables'][_0x4d40bd[_0x6f1e('0x24')]];}}}catch(_0x9238cf){logger['error']('[%s][voiceAgentReport][hangup]',_0x4d40bd['uniqueid'],util['inspect'](_0x9238cf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6f1e('0x1f')]['syncAttendedTransfer']=function(_0x31e8f8){try{if(this['isNotNull'](_0x31e8f8)){logger['debug'](_0x6f1e('0x8a'),_0x31e8f8[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x31e8f8,{'showHidden':![],'depth':null}));if(this[_0x6f1e('0xa')][_0x31e8f8[_0x6f1e('0x8b')]]){for(var _0x220b9a in this['channels'][_0x31e8f8[_0x6f1e('0x8b')]]){if(this[_0x6f1e('0xa')][_0x31e8f8[_0x6f1e('0x8b')]][_0x6f1e('0x3c')](_0x220b9a)){if(_0x31e8f8[_0x6f1e('0x8c')]===_0x220b9a){logger[_0x6f1e('0x3d')](_0x6f1e('0x8d'),_0x31e8f8[_0x6f1e('0x24')],this['channels'][_0x31e8f8[_0x6f1e('0x8b')]][_0x220b9a][_0x6f1e('0x25')],_0x220b9a);var _0x2a7582=moment();this[_0x6f1e('0xa')][_0x31e8f8['transfereeuniqueid']][_0x220b9a]['agentcomplete']=!![];this[_0x6f1e('0xa')][_0x31e8f8[_0x6f1e('0x8b')]][_0x220b9a][_0x6f1e('0x86')]=moment()[_0x6f1e('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6f1e('0xa')][_0x31e8f8[_0x6f1e('0x8b')]][_0x220b9a][_0x6f1e('0x44')]=_0x6f1e('0x69');this['channels'][_0x31e8f8['transfereeuniqueid']][_0x220b9a]['reason']=_0x6f1e('0x6a');this[_0x6f1e('0xa')][_0x31e8f8['transfereeuniqueid']][_0x220b9a]['talktime']=_0x2a7582[_0x6f1e('0x8e')](this[_0x6f1e('0xa')][_0x31e8f8['transfereeuniqueid']][_0x220b9a][_0x6f1e('0x67')],'seconds');}}}}if(this['channels'][_0x31e8f8[_0x6f1e('0x8f')]]){var _0x18ca3d=this[_0x6f1e('0xa')][_0x31e8f8[_0x6f1e('0x8f')]];this['channels'][_0x31e8f8[_0x6f1e('0x8f')]]=this[_0x6f1e('0xa')][_0x31e8f8[_0x6f1e('0x8b')]];this['channels'][_0x31e8f8[_0x6f1e('0x8b')]]=_0x18ca3d;}}}catch(_0x15b823){logger['error'](_0x6f1e('0x90'),_0x31e8f8[_0x6f1e('0x24')],util['inspect'](_0x15b823,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6f1e('0x1e')]=function(_0x540b57){try{if(this[_0x6f1e('0x21')](_0x540b57)){logger[_0x6f1e('0x27')](_0x6f1e('0x91'),_0x540b57[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x540b57,{'showHidden':![],'depth':null}));if(this[_0x6f1e('0xa')][_0x540b57['transfereeuniqueid']]){for(var _0x5443a8 in this['channels'][_0x540b57['transfereeuniqueid']]){if(this[_0x6f1e('0xa')][_0x540b57[_0x6f1e('0x8b')]][_0x6f1e('0x3c')](_0x5443a8)){if(_0x540b57[_0x6f1e('0x92')]===_0x5443a8){logger[_0x6f1e('0x3d')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x540b57[_0x6f1e('0x24')],this['channels'][_0x540b57[_0x6f1e('0x8b')]][_0x5443a8][_0x6f1e('0x25')],_0x5443a8);var _0x9d5dcd=moment();this[_0x6f1e('0xa')][_0x540b57[_0x6f1e('0x8b')]][_0x5443a8][_0x6f1e('0x13')]=!![];this[_0x6f1e('0xa')][_0x540b57[_0x6f1e('0x8b')]][_0x5443a8]['agentcompleteAt']=_0x9d5dcd;this[_0x6f1e('0xa')][_0x540b57['transfereeuniqueid']][_0x5443a8]['lastevent']=_0x6f1e('0x69');this[_0x6f1e('0xa')][_0x540b57[_0x6f1e('0x8b')]][_0x5443a8][_0x6f1e('0x5a')]=_0x6f1e('0x6a');this[_0x6f1e('0xa')][_0x540b57['transfereeuniqueid']][_0x5443a8][_0x6f1e('0x6c')]=_0x9d5dcd[_0x6f1e('0x8e')](this[_0x6f1e('0xa')][_0x540b57['transfereeuniqueid']][_0x5443a8][_0x6f1e('0x67')],'seconds');}}}}}}catch(_0x486b19){logger[_0x6f1e('0x3a')](_0x6f1e('0x93'),_0x540b57[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x486b19,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6f1e('0x1f')]['syncMusicOnHoldStart']=function(_0x1ec307){var _0x14a5df='';try{if(this[_0x6f1e('0x21')](_0x1ec307)){logger[_0x6f1e('0x27')](_0x6f1e('0x94'),_0x1ec307[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x1ec307,{'showHidden':![],'depth':null}));if(_0x1ec307[_0x6f1e('0x95')]){_0x14a5df=_0x1ec307[_0x6f1e('0x95')]['substring'](0x0,_0x1ec307[_0x6f1e('0x95')][_0x6f1e('0x96')]('-'));if(this[_0x6f1e('0xc')][_0x14a5df]){logger[_0x6f1e('0x3d')](_0x6f1e('0x97'),_0x1ec307['uniqueid'],_0x14a5df);this[_0x6f1e('0xc')][_0x14a5df]['onhold']=!![];}}}}catch(_0x2e4436){logger[_0x6f1e('0x3a')](_0x6f1e('0x98'),_0x1ec307['uniqueid'],util[_0x6f1e('0x29')](_0x2e4436,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6f1e('0x1f')][_0x6f1e('0x1a')]=function(_0x27a479){var _0x2e1412='';try{if(this[_0x6f1e('0x21')](_0x27a479)){logger['debug']('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x27a479['uniqueid'],util[_0x6f1e('0x29')](_0x27a479,{'showHidden':![],'depth':null}));if(_0x27a479[_0x6f1e('0x95')]){_0x2e1412=_0x27a479['channel'][_0x6f1e('0x99')](0x0,_0x27a479['channel']['lastIndexOf']('-'));if(this['agents'][_0x2e1412]){logger[_0x6f1e('0x3d')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x27a479[_0x6f1e('0x24')],_0x2e1412);this[_0x6f1e('0xc')][_0x2e1412][_0x6f1e('0x9a')]=![];}}}}catch(_0x325ff0){logger[_0x6f1e('0x3a')](_0x6f1e('0x9b'),_0x27a479[_0x6f1e('0x24')],util[_0x6f1e('0x29')](_0x325ff0,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xa516=['syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','inspect','interface','queue','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','assign','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:called','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','agentconnectAt','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','destconnectedlinenum','name','accountcode','exten','custom: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]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:%s','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','talktime','acwtime','acwTimeout','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','destaccountcode','[%s][voiceAgentReport][agentcomplete]','syncVarSet','addVariable','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','isUndefined','[%s][voiceAgentReport][varset]','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/logger','../ami','defaults','redis','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer'];(function(_0x5d26a7,_0x3cdfe1){var _0x1d9b46=function(_0xdd9073){while(--_0xdd9073){_0x5d26a7['push'](_0x5d26a7['shift']());}};_0x1d9b46(++_0x3cdfe1);}(_0xa516,0x1ca));var _0x6a51=function(_0x3143b3,_0x2d6dad){_0x3143b3=_0x3143b3-0x0;var _0x1dc4e0=_0xa516[_0x3143b3];return _0x1dc4e0;};'use strict';var _=require(_0x6a51('0x0'));var moment=require(_0x6a51('0x1'));var util=require(_0x6a51('0x2'));var Redis=require(_0x6a51('0x3'));var config=require('../../../config/environment');var logger=require(_0x6a51('0x4'))('ami');var ami=require(_0x6a51('0x5'));config['redis']=_[_0x6a51('0x6')](config[_0x6a51('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6a51('0x7')]));function VoiceAgentReport(_0x246b76){this[_0x6a51('0x8')]={};this[_0x6a51('0x9')]=_0x246b76['channels'];this[_0x6a51('0xa')]=_0x246b76['voiceQueues'];this['agents']=_0x246b76[_0x6a51('0xb')];this[_0x6a51('0xc')]={};ami['on'](_0x6a51('0xd'),this[_0x6a51('0xe')][_0x6a51('0xf')](this));ami['on'](_0x6a51('0x10'),this[_0x6a51('0x11')][_0x6a51('0xf')](this));ami['on'](_0x6a51('0x12'),this[_0x6a51('0x13')]['bind'](this));ami['on'](_0x6a51('0x14'),this['syncQueueCallerAbandon'][_0x6a51('0xf')](this));ami['on'](_0x6a51('0x15'),this[_0x6a51('0x16')][_0x6a51('0xf')](this));ami['on'](_0x6a51('0x17'),this['syncVarSet'][_0x6a51('0xf')](this));ami['on'](_0x6a51('0x18'),this[_0x6a51('0x19')][_0x6a51('0xf')](this));ami['on'](_0x6a51('0x1a'),this[_0x6a51('0x1b')][_0x6a51('0xf')](this));ami['on'](_0x6a51('0x1c'),this[_0x6a51('0x1d')]['bind'](this));ami['on'](_0x6a51('0x1e'),this[_0x6a51('0x1f')][_0x6a51('0xf')](this));ami['on'](_0x6a51('0x20'),this[_0x6a51('0x21')][_0x6a51('0xf')](this));}VoiceAgentReport[_0x6a51('0x22')][_0x6a51('0x23')]=function(_0x4c33d6,_0xa6a974,_0x47306d){io['to'](_0x4c33d6)[_0x6a51('0x23')](_0xa6a974,_0x47306d);};VoiceAgentReport[_0x6a51('0x22')][_0x6a51('0x24')]=function(_0x19ec8c){return _0x19ec8c!==null&&!_['isUndefined'](_0x19ec8c);};VoiceAgentReport[_0x6a51('0x22')][_0x6a51('0xe')]=function(_0x4939e6){try{if(this[_0x6a51('0x24')](_0x4939e6)){logger[_0x6a51('0x25')](_0x6a51('0x26'),_0x4939e6[_0x6a51('0x27')],_0x4939e6[_0x6a51('0x28')],_0x4939e6[_0x6a51('0x29')]);logger[_0x6a51('0x2a')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x4939e6['uniqueid'],util[_0x6a51('0x2b')](_0x4939e6,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x6a51('0x8')][_0x4939e6[_0x6a51('0x27')]])){this[_0x6a51('0x8')][_0x4939e6[_0x6a51('0x27')]]={};}var _0x142632=this[_0x6a51('0xb')][_0x4939e6[_0x6a51('0x2c')]];var _0x3d6f83=this[_0x6a51('0x8')][_0x4939e6[_0x6a51('0x27')]][_0x4939e6[_0x6a51('0x29')]];var _0x51cf7a=this[_0x6a51('0xa')][_0x4939e6[_0x6a51('0x2d')]];var _0x2cb887=this[_0x6a51('0xc')][_0x4939e6[_0x6a51('0x27')]];if(_['isUndefined'](_0x3d6f83)){_0x3d6f83={'agentcalledAt':moment()[_0x6a51('0x2e')](_0x6a51('0x2f')),'lastevent':_0x6a51('0x30'),'mandatoryDisposition':_0x51cf7a&&_0x51cf7a[_0x6a51('0x31')]?_0x51cf7a['mandatoryDisposition']:![],'type':_0x51cf7a&&_0x51cf7a[_0x6a51('0x32')]?_0x51cf7a[_0x6a51('0x32')]:'inbound','variables':_0x2cb887,'motionChannel':'voice'};}Object[_0x6a51('0x33')](_0x3d6f83,_['omit'](_0x4939e6,[_0x6a51('0x34'),_0x6a51('0x35')]));this[_0x6a51('0x8')][_0x4939e6[_0x6a51('0x27')]][_0x4939e6[_0x6a51('0x29')]]=_0x3d6f83;logger[_0x6a51('0x2a')](_0x6a51('0x36'),_0x4939e6[_0x6a51('0x27')],util['inspect'](_0x3d6f83,{'showHidden':![],'depth':null}));ami[_0x6a51('0x23')](_0x6a51('0x37'),_0x3d6f83);var _0x2b7a0c={'id':_0x142632['id'],'calleridnum':_0x3d6f83['calleridnum'],'queue':_0x3d6f83['queue'],'variables':_0x3d6f83['variables'],'uniqueid':_0x4939e6[_0x6a51('0x27')]};logger[_0x6a51('0x2a')](_0x6a51('0x38'),_0x4939e6[_0x6a51('0x27')],util[_0x6a51('0x2b')](_0x2b7a0c,{'showHidden':![],'depth':null}));this[_0x6a51('0x23')](util[_0x6a51('0x2e')]('user:%s',_0x4939e6[_0x6a51('0x28')]),_0x6a51('0x39'),_0x2b7a0c);}}catch(_0x3af051){logger[_0x6a51('0x3a')](_0x6a51('0x3b'),_0x4939e6[_0x6a51('0x27')],util[_0x6a51('0x2b')](_0x3af051,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a51('0x22')][_0x6a51('0x11')]=function(_0x4d6f62){try{if(this[_0x6a51('0x24')](_0x4d6f62)){if(this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]]){for(var _0x19e015 in this[_0x6a51('0x8')][_0x4d6f62['uniqueid']]){if(this[_0x6a51('0x8')][_0x4d6f62['uniqueid']][_0x6a51('0x3c')](_0x19e015)){if(_0x4d6f62['destuniqueid']===_0x19e015){logger[_0x6a51('0x25')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x4d6f62[_0x6a51('0x27')],_0x4d6f62[_0x6a51('0x28')],_0x4d6f62[_0x6a51('0x29')]);this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x19e015][_0x6a51('0x3d')]=moment()[_0x6a51('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6a51('0x8')][_0x4d6f62['uniqueid']][_0x19e015]['connectedlinename']=_0x4d6f62['connectedlinename'];this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x19e015][_0x6a51('0x3e')]=_0x4d6f62[_0x6a51('0x3e')];this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x19e015][_0x6a51('0x3f')]=_0x4d6f62['destchannelstate'];this['channels'][_0x4d6f62['uniqueid']][_0x19e015]['destchannelstatedesc']=_0x4d6f62[_0x6a51('0x40')];this[_0x6a51('0x8')][_0x4d6f62['uniqueid']][_0x19e015][_0x6a51('0x41')]=_0x4d6f62[_0x6a51('0x41')];this['channels'][_0x4d6f62['uniqueid']][_0x19e015][_0x6a51('0x42')]=_0x6a51('0x43');if(this[_0x6a51('0x9')][this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x19e015][_0x6a51('0x27')]]){var _0x11d58a=this['voiceChannels'][this[_0x6a51('0x8')][_0x4d6f62['uniqueid']][_0x19e015]['uniqueid']][_0x6a51('0x44')];this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x19e015]['routealias']=_0x11d58a;_0x4d6f62['routealias']=_0x11d58a;}_[_0x6a51('0x45')](this[_0x6a51('0xb')][_0x4d6f62[_0x6a51('0x2c')]],_['pick'](_0x4d6f62,[_0x6a51('0x2d'),_0x6a51('0x46'),_0x6a51('0x44')]));var _0x4982eb=this[_0x6a51('0xb')][_0x4d6f62[_0x6a51('0x2c')]];var _0x352767={'id':_0x4982eb['id'],'name':_0x4982eb[_0x6a51('0x47')],'agentconnected':!![],'destaccountcode':_0x4982eb[_0x6a51('0x48')],'destconnectedlinenum':this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x4d6f62[_0x6a51('0x29')]][_0x6a51('0x49')],'queue':this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x4d6f62[_0x6a51('0x29')]]['queue'],'routealias':this['channels'][_0x4d6f62[_0x6a51('0x27')]][_0x4d6f62['destuniqueid']][_0x6a51('0x44')],'uniqueid':this['channels'][_0x4d6f62['uniqueid']][_0x4d6f62[_0x6a51('0x29')]][_0x6a51('0x27')]};ami[_0x6a51('0x23')](_0x6a51('0x4a'),this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x4d6f62[_0x6a51('0x29')]]);this['emit'](util[_0x6a51('0x2e')]('user:%s',_0x4d6f62[_0x6a51('0x28')]),'user:agentconnect',_0x352767);}else if(!this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x19e015][_0x6a51('0x12')]&&!this['channels'][_0x4d6f62[_0x6a51('0x27')]][_0x19e015][_0x6a51('0x15')]){logger[_0x6a51('0x25')](_0x6a51('0x4b'),_0x4d6f62[_0x6a51('0x27')],this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x19e015][_0x6a51('0x28')],_0x19e015);this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x19e015][_0x6a51('0x12')]=!![];this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x19e015][_0x6a51('0x4c')]=moment()['format'](_0x6a51('0x2f'));this['channels'][_0x4d6f62['uniqueid']][_0x19e015][_0x6a51('0x4d')]=_0x4d6f62[_0x6a51('0x29')];this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x19e015][_0x6a51('0x4e')]=_0x4d6f62['membername'];this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x19e015]['lastevent']=_0x6a51('0x4f');this['channels'][_0x4d6f62[_0x6a51('0x27')]][_0x19e015][_0x6a51('0x50')]=_0x6a51('0x4f');logger[_0x6a51('0x2a')](_0x6a51('0x51'),_0x4d6f62['uniqueid'],util[_0x6a51('0x2b')](this['channels'][_0x4d6f62[_0x6a51('0x27')]][_0x19e015],{'showHidden':![],'depth':null}));ami[_0x6a51('0x23')](_0x6a51('0x52'),this[_0x6a51('0x8')][_0x4d6f62[_0x6a51('0x27')]][_0x19e015]);}else{logger[_0x6a51('0x2a')](_0x6a51('0x53'),_0x4d6f62['uniqueid']);}}}}}}catch(_0x285e6b){logger['error'](_0x6a51('0x54'),_0x4d6f62[_0x6a51('0x27')],util[_0x6a51('0x2b')](_0x285e6b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a51('0x22')][_0x6a51('0x13')]=function(_0x462945){try{if(this[_0x6a51('0x24')](_0x462945)){logger[_0x6a51('0x2a')](_0x6a51('0x55'),_0x462945[_0x6a51('0x27')],util[_0x6a51('0x2b')](_0x462945,{'showHidden':![],'depth':null}));if(this[_0x6a51('0x8')][_0x462945[_0x6a51('0x27')]]&&this['channels'][_0x462945[_0x6a51('0x27')]][_0x462945['destuniqueid']]){logger['info']('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x462945[_0x6a51('0x27')],_0x462945['membername'],_0x462945[_0x6a51('0x29')]);var _0x1a4114=this[_0x6a51('0xb')][_0x462945[_0x6a51('0x2c')]];var _0x5673bc=this[_0x6a51('0x8')][_0x462945['uniqueid']][_0x462945[_0x6a51('0x29')]];_0x5673bc[_0x6a51('0x12')]=!![];_0x5673bc[_0x6a51('0x4c')]=moment()[_0x6a51('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5673bc[_0x6a51('0x42')]=_0x6a51('0x56');_0x5673bc[_0x6a51('0x50')]=_0x6a51('0x56');var _0x75faf4={'id':_0x1a4114['id'],'name':_0x1a4114[_0x6a51('0x47')],'queue':_0x5673bc[_0x6a51('0x2d')],'uniqueid':_0x5673bc['uniqueid']};logger[_0x6a51('0x2a')](_0x6a51('0x57'),_0x462945[_0x6a51('0x27')],util[_0x6a51('0x2b')](_0x75faf4,{'showHidden':![],'depth':null}));this[_0x6a51('0x23')](util[_0x6a51('0x2e')](_0x6a51('0x58'),_0x1a4114[_0x6a51('0x47')]),_0x6a51('0x59'),_0x75faf4);ami[_0x6a51('0x23')](_0x6a51('0x5a'),_0x5673bc);this['channels'][_0x462945['uniqueid']][_0x462945['destuniqueid']]=Object[_0x6a51('0x33')]({},_0x5673bc);}}}catch(_0x5977aa){logger['error'](_0x6a51('0x5b'),_0x462945['uniqueid'],util[_0x6a51('0x2b')](_0x5977aa,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a51('0x22')][_0x6a51('0x5c')]=function(_0x3c6625){try{if(this[_0x6a51('0x24')](_0x3c6625)){logger[_0x6a51('0x2a')](_0x6a51('0x5d'),_0x3c6625[_0x6a51('0x27')],util[_0x6a51('0x2b')](_0x3c6625,{'showHidden':![],'depth':null}));if(this[_0x6a51('0x8')][_0x3c6625[_0x6a51('0x27')]]){for(var _0x4e23f1 in this[_0x6a51('0x8')][_0x3c6625[_0x6a51('0x27')]]){if(this['channels'][_0x3c6625[_0x6a51('0x27')]]['hasOwnProperty'](_0x4e23f1)&&!this['channels'][_0x3c6625['uniqueid']][_0x4e23f1][_0x6a51('0x12')]&&!this[_0x6a51('0x8')][_0x3c6625[_0x6a51('0x27')]][_0x4e23f1][_0x6a51('0x15')]){logger['info'](_0x6a51('0x5e'),_0x3c6625[_0x6a51('0x27')],this[_0x6a51('0x8')][_0x3c6625[_0x6a51('0x27')]][_0x4e23f1]['membername'],_0x4e23f1);this[_0x6a51('0x8')][_0x3c6625['uniqueid']][_0x4e23f1][_0x6a51('0x12')]=!![];this['channels'][_0x3c6625['uniqueid']][_0x4e23f1][_0x6a51('0x4c')]=moment()['format'](_0x6a51('0x2f'));this['channels'][_0x3c6625['uniqueid']][_0x4e23f1]['lastevent']='abandoned';this[_0x6a51('0x8')][_0x3c6625[_0x6a51('0x27')]][_0x4e23f1][_0x6a51('0x50')]=_0x6a51('0x5f');logger[_0x6a51('0x2a')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x3c6625['uniqueid'],util[_0x6a51('0x2b')](this[_0x6a51('0x8')][_0x3c6625[_0x6a51('0x27')]][_0x4e23f1],{'showHidden':![],'depth':null}));ami[_0x6a51('0x23')](_0x6a51('0x60'),this[_0x6a51('0x8')][_0x3c6625[_0x6a51('0x27')]][_0x4e23f1]);}}}}}catch(_0x12bc5d){logger[_0x6a51('0x3a')](_0x6a51('0x61'),_0x3c6625['uniqueid'],util[_0x6a51('0x2b')](_0x12bc5d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a51('0x22')][_0x6a51('0x16')]=function(_0x1ac266){try{if(this[_0x6a51('0x24')](_0x1ac266)){logger[_0x6a51('0x2a')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x1ac266[_0x6a51('0x27')],util[_0x6a51('0x2b')](_0x1ac266,{'showHidden':![],'depth':null}));if(this[_0x6a51('0x8')][_0x1ac266[_0x6a51('0x27')]]){for(var _0x36ebd5 in this['channels'][_0x1ac266['uniqueid']]){if(this['channels'][_0x1ac266[_0x6a51('0x27')]][_0x6a51('0x3c')](_0x36ebd5)){if(this[_0x6a51('0x8')][_0x1ac266[_0x6a51('0x27')]][_0x36ebd5]['agentconnectAt']&&!this[_0x6a51('0x8')][_0x1ac266[_0x6a51('0x27')]][_0x36ebd5][_0x6a51('0x15')]){logger[_0x6a51('0x25')](_0x6a51('0x62'),_0x1ac266['uniqueid'],this['channels'][_0x1ac266['uniqueid']][_0x36ebd5]['membername'],_0x36ebd5);this['channels'][_0x1ac266['uniqueid']][_0x36ebd5]['agentcomplete']=!![];this['channels'][_0x1ac266['uniqueid']][_0x36ebd5][_0x6a51('0x63')]=moment()[_0x6a51('0x2e')](_0x6a51('0x2f'));this[_0x6a51('0x8')][_0x1ac266[_0x6a51('0x27')]][_0x36ebd5]['lastevent']=_0x6a51('0x64');this[_0x6a51('0x8')][_0x1ac266[_0x6a51('0x27')]][_0x36ebd5][_0x6a51('0x50')]=_0x1ac266[_0x6a51('0x50')]=='transfer'?'agent':_0x1ac266['reason'];this[_0x6a51('0x8')][_0x1ac266[_0x6a51('0x27')]][_0x36ebd5][_0x6a51('0x65')]=_0x1ac266['talktime'];if(this[_0x6a51('0xa')][_0x1ac266[_0x6a51('0x2d')]]&&this[_0x6a51('0xa')][_0x1ac266[_0x6a51('0x2d')]]['acw']){this[_0x6a51('0x8')][_0x1ac266[_0x6a51('0x27')]][_0x36ebd5][_0x6a51('0x66')]=this['voiceQueues'][_0x1ac266[_0x6a51('0x2d')]][_0x6a51('0x67')];this[_0x6a51('0x8')][_0x1ac266['uniqueid']][_0x36ebd5]['agentacw']=!![];}this[_0x6a51('0xb')][_0x1ac266[_0x6a51('0x2c')]]=_['omit'](this['agents'][_0x1ac266[_0x6a51('0x2c')]],[_0x6a51('0x2d'),_0x6a51('0x46')]);logger[_0x6a51('0x2a')](_0x6a51('0x68'),_0x1ac266[_0x6a51('0x27')],util[_0x6a51('0x2b')](this[_0x6a51('0x8')][_0x1ac266['uniqueid']][_0x36ebd5],{'showHidden':![],'depth':null}));ami[_0x6a51('0x23')](_0x6a51('0x69'),this[_0x6a51('0x8')][_0x1ac266[_0x6a51('0x27')]][_0x36ebd5]);logger[_0x6a51('0x2a')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x1ac266[_0x6a51('0x27')],util[_0x6a51('0x2b')]({'id':this[_0x6a51('0xb')][_0x1ac266[_0x6a51('0x2c')]]['id'],'destaccountcode':_0x1ac266[_0x6a51('0x6a')]},{'showHidden':![],'depth':null}));this[_0x6a51('0x23')](util[_0x6a51('0x2e')](_0x6a51('0x58'),_0x1ac266[_0x6a51('0x28')]),'user:agentcomplete',{'id':this[_0x6a51('0xb')][_0x1ac266[_0x6a51('0x2c')]]['id'],'destaccountcode':Number(_0x1ac266[_0x6a51('0x6a')])});}}}}}}catch(_0x178994){logger['error'](_0x6a51('0x6b'),_0x1ac266[_0x6a51('0x27')],util['inspect'](_0x178994,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a51('0x22')][_0x6a51('0x6c')]=function(_0x4f46e4){try{if(this[_0x6a51('0x24')](_0x4f46e4)){logger[_0x6a51('0x2a')]('[%s][voiceAgentReport][varset]\x20event:',_0x4f46e4[_0x6a51('0x27')],util[_0x6a51('0x2b')](_0x4f46e4,{'showHidden':![],'depth':null}));this[_0x6a51('0x6d')](_0x4f46e4[_0x6a51('0x27')],_['keys'](_0x4f46e4[_0x6a51('0x6e')])[0x0],_0x4f46e4[_0x6a51('0x6f')]);if(this[_0x6a51('0x8')][_0x4f46e4[_0x6a51('0x27')]]){for(var _0xcd7b88 in this[_0x6a51('0x8')][_0x4f46e4[_0x6a51('0x27')]]){if(this['channels'][_0x4f46e4[_0x6a51('0x27')]]['hasOwnProperty'](_0xcd7b88)){logger['info'](_0x6a51('0x70'),_0x4f46e4[_0x6a51('0x27')],_0xcd7b88,_[_0x6a51('0x71')](_0x4f46e4[_0x6a51('0x6e')])[0x0],_0x4f46e4[_0x6a51('0x6f')]);if(_[_0x6a51('0x72')](this[_0x6a51('0x8')][_0x4f46e4[_0x6a51('0x27')]][_0xcd7b88][_0x6a51('0xc')])){this[_0x6a51('0x8')][_0x4f46e4['uniqueid']][_0xcd7b88][_0x6a51('0xc')]={};}this[_0x6a51('0x8')][_0x4f46e4[_0x6a51('0x27')]][_0xcd7b88][_0x6a51('0xc')]=this[_0x6a51('0xc')][_0x4f46e4['uniqueid']];}}}}}catch(_0x41d2c5){logger[_0x6a51('0x3a')](_0x6a51('0x73'),_0x4f46e4['uniqueid'],util[_0x6a51('0x2b')](_0x41d2c5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a51('0x22')][_0x6a51('0x6d')]=function(_0x16f286,_0x404bc8,_0xd7be6f){var _0x41e680=['rtpaudioqos','rtpaudioqosbridged',_0x6a51('0x74'),_0x6a51('0x75'),_0x6a51('0x76'),_0x6a51('0x77'),_0x6a51('0x78'),_0x6a51('0x79'),_0x6a51('0x7a'),_0x6a51('0x7b'),_0x6a51('0x7c'),'bridgepvtcallid',_0x6a51('0x7d'),_0x6a51('0x7e'),_0x6a51('0x7f'),_0x6a51('0x80'),_0x6a51('0x28'),_0x6a51('0x81'),_0x6a51('0x82')];if(!_[_0x6a51('0x83')](_0x404bc8)&&!_[_0x6a51('0x84')](_0x41e680,_0x404bc8)){if(_[_0x6a51('0x72')](this[_0x6a51('0xc')][_0x16f286])){this[_0x6a51('0xc')][_0x16f286]={};}this[_0x6a51('0xc')][_0x16f286][_0x404bc8]=_0xd7be6f;}};VoiceAgentReport['prototype'][_0x6a51('0x19')]=function(_0x2d38ff){try{if(this[_0x6a51('0x24')](_0x2d38ff)){logger['debug'](_0x6a51('0x85'),_0x2d38ff['uniqueid'],util['inspect'](_0x2d38ff,{'showHidden':![],'depth':null}));if(this[_0x6a51('0x8')][_0x2d38ff[_0x6a51('0x27')]]){for(var _0x3db463 in this[_0x6a51('0x8')][_0x2d38ff[_0x6a51('0x27')]]){if(this[_0x6a51('0x8')][_0x2d38ff[_0x6a51('0x27')]][_0x6a51('0x3c')](_0x3db463)){if(this[_0x6a51('0x8')][_0x2d38ff[_0x6a51('0x27')]][_0x3db463][_0x6a51('0x50')]==_0x6a51('0x86')&&this[_0x6a51('0x8')][_0x2d38ff[_0x6a51('0x27')]][_0x3db463][_0x6a51('0x15')]){logger[_0x6a51('0x25')](_0x6a51('0x87'),_0x2d38ff[_0x6a51('0x27')],_0x3db463);this[_0x6a51('0x8')][_0x2d38ff[_0x6a51('0x27')]][_0x3db463][_0x6a51('0x63')]=moment()['format'](_0x6a51('0x2f'));}}}logger[_0x6a51('0x2a')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x2d38ff[_0x6a51('0x27')],util[_0x6a51('0x2b')](_['values'](this[_0x6a51('0x8')][_0x2d38ff[_0x6a51('0x27')]]),{'showHidden':![],'depth':null}));ami[_0x6a51('0x23')](_0x6a51('0x88'),_['values'](this[_0x6a51('0x8')][_0x2d38ff[_0x6a51('0x27')]]));delete this[_0x6a51('0x8')][_0x2d38ff[_0x6a51('0x27')]];}if(this[_0x6a51('0xc')][_0x2d38ff['uniqueid']]){delete this[_0x6a51('0xc')][_0x2d38ff[_0x6a51('0x27')]];}}}catch(_0x4937e5){logger[_0x6a51('0x3a')](_0x6a51('0x89'),_0x2d38ff[_0x6a51('0x27')],util[_0x6a51('0x2b')](_0x4937e5,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAttendedTransfer']=function(_0x5dab15){try{if(this[_0x6a51('0x24')](_0x5dab15)){logger[_0x6a51('0x2a')](_0x6a51('0x8a'),_0x5dab15['uniqueid'],util['inspect'](_0x5dab15,{'showHidden':![],'depth':null}));if(this[_0x6a51('0x8')][_0x5dab15[_0x6a51('0x8b')]]){for(var _0x104935 in this[_0x6a51('0x8')][_0x5dab15[_0x6a51('0x8b')]]){if(this[_0x6a51('0x8')][_0x5dab15['transfereeuniqueid']][_0x6a51('0x3c')](_0x104935)){if(_0x5dab15[_0x6a51('0x8c')]===_0x104935){logger[_0x6a51('0x25')](_0x6a51('0x8d'),_0x5dab15[_0x6a51('0x27')],this['channels'][_0x5dab15['transfereeuniqueid']][_0x104935][_0x6a51('0x28')],_0x104935);var _0x5ea682=moment();this[_0x6a51('0x8')][_0x5dab15[_0x6a51('0x8b')]][_0x104935][_0x6a51('0x15')]=!![];this['channels'][_0x5dab15['transfereeuniqueid']][_0x104935][_0x6a51('0x63')]=moment()[_0x6a51('0x2e')](_0x6a51('0x2f'));this[_0x6a51('0x8')][_0x5dab15[_0x6a51('0x8b')]][_0x104935][_0x6a51('0x42')]=_0x6a51('0x64');this[_0x6a51('0x8')][_0x5dab15[_0x6a51('0x8b')]][_0x104935][_0x6a51('0x50')]=_0x6a51('0x86');this[_0x6a51('0x8')][_0x5dab15[_0x6a51('0x8b')]][_0x104935][_0x6a51('0x65')]=_0x5ea682[_0x6a51('0x8e')](this[_0x6a51('0x8')][_0x5dab15[_0x6a51('0x8b')]][_0x104935]['agentconnectAt'],_0x6a51('0x8f'));}}}}if(this['channels'][_0x5dab15[_0x6a51('0x90')]]){var _0x21f21b=this[_0x6a51('0x8')][_0x5dab15[_0x6a51('0x90')]];this[_0x6a51('0x8')][_0x5dab15[_0x6a51('0x90')]]=this['channels'][_0x5dab15[_0x6a51('0x8b')]];this[_0x6a51('0x8')][_0x5dab15[_0x6a51('0x8b')]]=_0x21f21b;}}}catch(_0x4ca485){logger[_0x6a51('0x3a')](_0x6a51('0x91'),_0x5dab15[_0x6a51('0x27')],util[_0x6a51('0x2b')](_0x4ca485,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a51('0x22')][_0x6a51('0x21')]=function(_0x36d885){try{if(this['isNotNull'](_0x36d885)){logger['debug']('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x36d885[_0x6a51('0x27')],util[_0x6a51('0x2b')](_0x36d885,{'showHidden':![],'depth':null}));if(this[_0x6a51('0x8')][_0x36d885[_0x6a51('0x8b')]]){for(var _0x241dc5 in this['channels'][_0x36d885[_0x6a51('0x8b')]]){if(this[_0x6a51('0x8')][_0x36d885[_0x6a51('0x8b')]][_0x6a51('0x3c')](_0x241dc5)){if(_0x36d885[_0x6a51('0x92')]===_0x241dc5){logger[_0x6a51('0x25')](_0x6a51('0x93'),_0x36d885[_0x6a51('0x27')],this[_0x6a51('0x8')][_0x36d885[_0x6a51('0x8b')]][_0x241dc5][_0x6a51('0x28')],_0x241dc5);var _0x5002cb=moment();this[_0x6a51('0x8')][_0x36d885[_0x6a51('0x8b')]][_0x241dc5][_0x6a51('0x15')]=!![];this[_0x6a51('0x8')][_0x36d885[_0x6a51('0x8b')]][_0x241dc5][_0x6a51('0x63')]=_0x5002cb;this['channels'][_0x36d885[_0x6a51('0x8b')]][_0x241dc5][_0x6a51('0x42')]=_0x6a51('0x64');this[_0x6a51('0x8')][_0x36d885['transfereeuniqueid']][_0x241dc5][_0x6a51('0x50')]=_0x6a51('0x86');this['channels'][_0x36d885[_0x6a51('0x8b')]][_0x241dc5]['talktime']=_0x5002cb[_0x6a51('0x8e')](this[_0x6a51('0x8')][_0x36d885['transfereeuniqueid']][_0x241dc5][_0x6a51('0x3d')],'seconds');}}}}}}catch(_0x469abf){logger['error']('[%s][voiceAgentReport][blindtransfer]',_0x36d885['uniqueid'],util[_0x6a51('0x2b')](_0x469abf,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6a51('0x1b')]=function(_0x386c18){var _0x1eadb9='';try{if(this[_0x6a51('0x24')](_0x386c18)){logger['debug'](_0x6a51('0x94'),_0x386c18[_0x6a51('0x27')],util['inspect'](_0x386c18,{'showHidden':![],'depth':null}));if(_0x386c18[_0x6a51('0x95')]){_0x1eadb9=_0x386c18[_0x6a51('0x95')][_0x6a51('0x96')](0x0,_0x386c18[_0x6a51('0x95')][_0x6a51('0x97')]('-'));if(this[_0x6a51('0xb')][_0x1eadb9]){logger['info'](_0x6a51('0x98'),_0x386c18[_0x6a51('0x27')],_0x1eadb9);this['agents'][_0x1eadb9]['onhold']=!![];}}}}catch(_0x506fcd){logger['error'](_0x6a51('0x99'),_0x386c18[_0x6a51('0x27')],util[_0x6a51('0x2b')](_0x506fcd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6a51('0x1d')]=function(_0x494aac){var _0x527ca7='';try{if(this[_0x6a51('0x24')](_0x494aac)){logger[_0x6a51('0x2a')](_0x6a51('0x9a'),_0x494aac[_0x6a51('0x27')],util[_0x6a51('0x2b')](_0x494aac,{'showHidden':![],'depth':null}));if(_0x494aac[_0x6a51('0x95')]){_0x527ca7=_0x494aac[_0x6a51('0x95')]['substring'](0x0,_0x494aac[_0x6a51('0x95')][_0x6a51('0x97')]('-'));if(this[_0x6a51('0xb')][_0x527ca7]){logger[_0x6a51('0x25')](_0x6a51('0x9b'),_0x494aac[_0x6a51('0x27')],_0x527ca7);this['agents'][_0x527ca7][_0x6a51('0x9c')]=![];}}}}catch(_0x28a9c9){logger[_0x6a51('0x3a')](_0x6a51('0x9d'),_0x494aac[_0x6a51('0x27')],util['inspect'](_0x28a9c9,{'showHidden':![],'depth':null}));}};module[_0x6a51('0x9e')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index f93e8fe..c9b7717 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 _0x7217=['transfereruniqueid','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','lodash','util','path','ioredis','../../../config/environment','../../../config/logger','../model/channel','../rpc/setting','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','bind','newexten','syncNewChannel','newstate','syncNewState','varset','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','context','from-sip','channel','exten','xcally-motion-preview','destconnectedlinenum','format','name','accountcode','connectedlinenum','[%s][voiceCallReport][newcallerid]','isNotNull','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','undefined','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceCallReport][newchannel]','syncNewExten','application','applicationdata','appdata','startsWith','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','disposition','includes','lastapplication','lastdata','cdr(','match','split','info','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','UserId','connectedlinename','destinationchannel','membername','routealias','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','mixmonitor_filename','parse','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','transferType','resolve','then','stopRecordingOnTransfer','StopMixMonitor','catch','Action','finally','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel'];(function(_0x298227,_0x4aca91){var _0x259b72=function(_0x4619c7){while(--_0x4619c7){_0x298227['push'](_0x298227['shift']());}};_0x259b72(++_0x4aca91);}(_0x7217,0x19e));var _0x7721=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x7217[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x7721('0x0'));var moment=require('moment');var util=require(_0x7721('0x1'));var path=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var config=require(_0x7721('0x4'));var logger=require(_0x7721('0x5'))('ami');var ami=require('../ami');var Channel=require(_0x7721('0x6'));var RpcSetting=require(_0x7721('0x7'));var applications=[_0x7721('0x8'),_0x7721('0x9'),_0x7721('0xa'),_0x7721('0xb'),_0x7721('0xc'),_0x7721('0xd')];var dispositions=[_0x7721('0xe'),_0x7721('0xf'),_0x7721('0xf'),_0x7721('0xe'),_0x7721('0xe'),_0x7721('0xe'),_0x7721('0x10'),'BUSY',_0x7721('0xf'),_0x7721('0xf'),_0x7721('0xf')];config[_0x7721('0x11')]=_[_0x7721('0x12')](config[_0x7721('0x11')],{'host':_0x7721('0x13'),'port':0x18eb});var io=require(_0x7721('0x14'))(new Redis(config['redis']));function VoiceCallReport(_0x2911ec){this[_0x7721('0x15')]=_0x2911ec['channels'];this[_0x7721('0x16')]=_0x2911ec[_0x7721('0x16')];this[_0x7721('0x17')]={};ami['on'](_0x7721('0x18'),this['syncNewExten'][_0x7721('0x19')](this));ami['on'](_0x7721('0x1a'),this['syncNewExten']['bind'](this));ami['on']('newchannel',this[_0x7721('0x1b')][_0x7721('0x19')](this));ami['on'](_0x7721('0x1c'),this[_0x7721('0x1d')]['bind'](this));ami['on'](_0x7721('0x1e'),this['syncVarSet'][_0x7721('0x19')](this));ami['on']('hangup',this[_0x7721('0x1f')][_0x7721('0x19')](this));ami['on'](_0x7721('0x20'),this[_0x7721('0x21')][_0x7721('0x19')](this));ami['on'](_0x7721('0x22'),this[_0x7721('0x23')][_0x7721('0x19')](this));ami['on'](_0x7721('0x24'),this[_0x7721('0x25')]['bind'](this));ami['on'](_0x7721('0x26'),this[_0x7721('0x27')][_0x7721('0x19')](this));ami['on'](_0x7721('0x28'),this['syncMusicOnHoldStop'][_0x7721('0x19')](this));try{logger['info'](_0x7721('0x29'));ami[_0x7721('0x2a')]();}catch(_0x3e8a4e){logger[_0x7721('0x2b')](_0x7721('0x2c'),util[_0x7721('0x2d')](_0x3e8a4e,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x7721('0x2e')]['isNotNull']=function(_0x216f20){return _0x216f20!==null&&!_[_0x7721('0x2f')](_0x216f20);};VoiceCallReport[_0x7721('0x2e')][_0x7721('0x30')]=function(_0x40d550,_0x16355a,_0x424e05){io['to'](_0x40d550)[_0x7721('0x30')](_0x16355a,_0x424e05);};VoiceCallReport[_0x7721('0x2e')]['syncNewCallerId']=function(_0x258ddf){try{if(this['isNotNull'](_0x258ddf)){logger['info'](_0x7721('0x31'),_0x258ddf[_0x7721('0x32')],_0x258ddf[_0x7721('0x33')],_0x258ddf[_0x7721('0x34')]);logger[_0x7721('0x35')](_0x7721('0x36'),_0x258ddf[_0x7721('0x32')],util[_0x7721('0x2d')](_0x258ddf,{'showHidden':![],'depth':null}));if(_0x258ddf['uniqueid']===_0x258ddf[_0x7721('0x37')]){if(!_[_0x7721('0x2f')](this['channels'][_0x258ddf['uniqueid']])){_[_0x7721('0x38')](this[_0x7721('0x15')][_0x258ddf['uniqueid']],_[_0x7721('0x39')](_0x258ddf,_[_0x7721('0x3a')](this[_0x7721('0x15')][_0x258ddf['uniqueid']])));}}if(_0x258ddf[_0x7721('0x3b')]===_0x7721('0x3c')){var _0x1492d4=this[_0x7721('0x16')][_0x258ddf[_0x7721('0x3d')]['split']('-')[0x0]];if(_0x1492d4){if(_0x258ddf[_0x7721('0x3e')]==_0x7721('0x3f')){_0x1492d4[_0x7721('0x40')]=_0x258ddf['connectedlinenum'];this[_0x7721('0x30')](util[_0x7721('0x41')]('user:%s',_0x1492d4[_0x7721('0x42')]),'user:agentconnect',{'id':_0x1492d4['id'],'destaccountcode':_0x1492d4[_0x7721('0x43')],'destconnectedlinenum':_0x258ddf[_0x7721('0x44')]});}}}}}catch(_0x19d082){logger[_0x7721('0x2b')](_0x7721('0x45'),_0x258ddf[_0x7721('0x32')],util[_0x7721('0x2d')](_0x19d082,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7721('0x2e')][_0x7721('0x1b')]=function(_0x3a2eb7){try{if(this[_0x7721('0x46')](_0x3a2eb7)){logger['debug'](_0x7721('0x47'),_0x3a2eb7['uniqueid'],util[_0x7721('0x2d')](_0x3a2eb7,{'showHidden':![],'depth':null}));if(this[_0x7721('0x15')][_0x3a2eb7[_0x7721('0x32')]]){return;}if(_0x3a2eb7[_0x7721('0x3d')]===_0x7721('0x48')){return;}if(_0x3a2eb7[_0x7721('0x32')]!==_0x3a2eb7['linkedid']&&!this['blindTransfers'][_0x3a2eb7['linkedid']]){return;}logger['info'](_0x7721('0x49'),_0x3a2eb7[_0x7721('0x32')],_0x3a2eb7[_0x7721('0x3b')],_0x3a2eb7[_0x7721('0x3e')]);this['channels'][_0x3a2eb7[_0x7721('0x32')]]=new Channel();this['channels'][_0x3a2eb7[_0x7721('0x32')]][_0x7721('0x4a')]=moment()['format'](_0x7721('0x4b'));this[_0x7721('0x15')][_0x3a2eb7['uniqueid']]['disposition']=dispositions[_[_0x7721('0x4c')](_0x3a2eb7[_0x7721('0x4d')])];_[_0x7721('0x38')](this[_0x7721('0x15')][_0x3a2eb7['uniqueid']],_[_0x7721('0x39')](_0x3a2eb7,_[_0x7721('0x3a')](this[_0x7721('0x15')][_0x3a2eb7[_0x7721('0x32')]])));if(_0x3a2eb7[_0x7721('0x3b')]==='from-sip'){var _0x490d4=this['agents'][_0x3a2eb7[_0x7721('0x3d')]['split']('-')[0x0]];if(_0x490d4&&typeof _0x490d4[_0x7721('0x40')]===_0x7721('0x4e')){_0x490d4[_0x7721('0x40')]=_0x3a2eb7['exten'];logger[_0x7721('0x35')](_0x7721('0x4f'),_0x3a2eb7[_0x7721('0x32')],util['inspect']({'id':_0x490d4['id'],'destaccountcode':_0x490d4[_0x7721('0x43')],'destconnectedlinenum':_0x3a2eb7[_0x7721('0x3e')]},{'showHidden':![],'depth':null}));this[_0x7721('0x30')](util[_0x7721('0x41')](_0x7721('0x50'),_0x490d4[_0x7721('0x42')]),_0x7721('0x51'),{'id':_0x490d4['id'],'destaccountcode':_0x490d4['accountcode'],'destconnectedlinenum':_0x3a2eb7['exten']});}}}}catch(_0x1ac3af){logger[_0x7721('0x2b')](_0x7721('0x52'),_0x3a2eb7[_0x7721('0x32')],util[_0x7721('0x2d')](_0x1ac3af,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7721('0x2e')][_0x7721('0x53')]=function(_0x2966fe){try{if(this[_0x7721('0x46')](_0x2966fe)){logger[_0x7721('0x35')]('[%s][voiceCallReport][newexten]\x20event:',_0x2966fe['uniqueid'],util[_0x7721('0x2d')](_0x2966fe,{'showHidden':![],'depth':null}));if(_0x2966fe[_0x7721('0x3d')]===_0x7721('0x48')||_0x2966fe[_0x7721('0x3e')]==='h')return;if(_0x2966fe['uniqueid']===_0x2966fe[_0x7721('0x37')]||this[_0x7721('0x17')][_0x2966fe['linkedid']]){_0x2966fe[_0x7721('0x54')]=_0x2966fe['application']?_0x2966fe[_0x7721('0x54')]['toLowerCase']():undefined;_0x2966fe[_0x7721('0x55')]=_0x2966fe[_0x7721('0x56')]||_0x2966fe[_0x7721('0x55')];if(_0x2966fe['appdata']&&!_0x2966fe[_0x7721('0x56')][_0x7721('0x57')]('CDR(routeAlias)')&&_0x2966fe[_0x7721('0x54')]!==_0x7721('0x9')){_0x2966fe[_0x7721('0x55')]=_0x2966fe['applicationdata'][_0x7721('0x58')]();}logger['info'](_0x7721('0x59'),_0x2966fe[_0x7721('0x32')],_0x2966fe[_0x7721('0x54')],_0x2966fe[_0x7721('0x55')]);if(_[_0x7721('0x2f')](this[_0x7721('0x15')][_0x2966fe[_0x7721('0x32')]])){this[_0x7721('0x15')][_0x2966fe[_0x7721('0x32')]]=new Channel();this[_0x7721('0x15')][_0x2966fe[_0x7721('0x32')]][_0x7721('0x4a')]=_0x2966fe[_0x7721('0x5a')]?moment()[_0x7721('0x5b')](moment[_0x7721('0x5a')](_0x2966fe['duration'])[_0x7721('0x5c')](),_0x7721('0x5c'))[_0x7721('0x41')](_0x7721('0x4b')):moment()[_0x7721('0x41')](_0x7721('0x4b'));this[_0x7721('0x15')][_0x2966fe['uniqueid']][_0x7721('0x5d')]=_0x7721('0xe');}_[_0x7721('0x38')](this[_0x7721('0x15')][_0x2966fe[_0x7721('0x32')]],_[_0x7721('0x39')](_0x2966fe,_[_0x7721('0x3a')](this[_0x7721('0x15')][_0x2966fe[_0x7721('0x32')]])));if(_[_0x7721('0x5e')](applications,_0x2966fe[_0x7721('0x54')])){this['channels'][_0x2966fe[_0x7721('0x32')]][_0x7721('0x5f')]=_0x2966fe[_0x7721('0x54')];this[_0x7721('0x15')][_0x2966fe[_0x7721('0x32')]][_0x7721('0x60')]=_0x2966fe[_0x7721('0x55')];if(_0x2966fe[_0x7721('0x54')]===_0x7721('0x8')&&_[_0x7721('0x57')](_0x2966fe[_0x7721('0x55')][_0x7721('0x58')](),_0x7721('0x61'))){var _0x18f7f6=_0x2966fe[_0x7721('0x55')]['split']('=');var _0x50e9e9=_0x18f7f6[0x0]['toLowerCase']()[_0x7721('0x62')](/cdr\((.*)\)/);if(_0x50e9e9){if(_0x50e9e9[0x1]==='type'&&!_['isNil'](this['channels'][_0x2966fe['uniqueid']][_0x50e9e9[0x1]]))return;this[_0x7721('0x15')][_0x2966fe[_0x7721('0x32')]][_0x50e9e9[0x1]]=_0x18f7f6[0x1];}}else if(_0x2966fe[_0x7721('0x54')]==='queue'){this[_0x7721('0x15')][_0x2966fe['uniqueid']]['queue']=_0x2966fe['applicationdata'][_0x7721('0x63')](',')[0x0];}}}}}catch(_0x4f0d38){logger['error']('[%s][voiceCallReport][newexten]',_0x2966fe[_0x7721('0x32')],util[_0x7721('0x2d')](_0x4f0d38,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7721('0x2e')]['syncNewState']=function(_0x2a025c){try{if(this[_0x7721('0x46')](_0x2a025c)){logger[_0x7721('0x64')](_0x7721('0x65'),_0x2a025c[_0x7721('0x32')],_0x2a025c[_0x7721('0x37')],_0x2a025c[_0x7721('0x33')],_0x2a025c[_0x7721('0x34')]);logger[_0x7721('0x35')](_0x7721('0x66'),_0x2a025c[_0x7721('0x32')],util[_0x7721('0x2d')](_0x2a025c,{'showHidden':![],'depth':null}));if(_0x2a025c[_0x7721('0x4d')]!=='6')return;var _0x211d27=this[_0x7721('0x16')][_0x2a025c['channel'][_0x7721('0x63')]('-')[0x0]];if(_0x2a025c[_0x7721('0x32')]!==_0x2a025c[_0x7721('0x37')]){var _0xb6db23=moment();if(this['channels'][_0x2a025c[_0x7721('0x37')]]){if(!this[_0x7721('0x15')][_0x2a025c['linkedid']][_0x7721('0x67')]){this['channels'][_0x2a025c[_0x7721('0x37')]][_0x7721('0x67')]=!![];this[_0x7721('0x15')][_0x2a025c[_0x7721('0x37')]][_0x7721('0x68')]=_0xb6db23[_0x7721('0x41')](_0x7721('0x4b'));if(this[_0x7721('0x15')][_0x2a025c[_0x7721('0x37')]]['starttime']){this[_0x7721('0x15')][_0x2a025c[_0x7721('0x37')]][_0x7721('0x69')]=_0xb6db23[_0x7721('0x6a')](this[_0x7721('0x15')][_0x2a025c[_0x7721('0x37')]][_0x7721('0x4a')],'seconds');}}this[_0x7721('0x15')][_0x2a025c[_0x7721('0x37')]]['linkedid']=_0x2a025c[_0x7721('0x32')];if(_0x2a025c['calleridnum']!==_0x7721('0x3f')){this[_0x7721('0x15')][_0x2a025c[_0x7721('0x37')]][_0x7721('0x44')]=_0x2a025c[_0x7721('0x34')];}this[_0x7721('0x15')][_0x2a025c[_0x7721('0x37')]]['connectedlinename']=_0x2a025c[_0x7721('0x33')];this[_0x7721('0x15')][_0x2a025c[_0x7721('0x37')]]['destinationchannel']=_0x2a025c['channel'];this['channels'][_0x2a025c['linkedid']]['disposition']=dispositions[_[_0x7721('0x4c')](_0x2a025c[_0x7721('0x4d')])];if(_0x211d27){this['channels'][_0x2a025c[_0x7721('0x37')]][_0x7721('0x6b')]=_0x211d27['id'];this[_0x7721('0x15')][_0x2a025c[_0x7721('0x37')]]['membername']=_0x211d27[_0x7721('0x42')];}}if(this[_0x7721('0x15')][_0x2a025c[_0x7721('0x32')]]){if(!this[_0x7721('0x15')][_0x2a025c[_0x7721('0x32')]]['answered']){this[_0x7721('0x15')][_0x2a025c[_0x7721('0x32')]][_0x7721('0x67')]=!![];this['channels'][_0x2a025c['uniqueid']][_0x7721('0x68')]=_0xb6db23[_0x7721('0x41')](_0x7721('0x4b'));if(this[_0x7721('0x15')][_0x2a025c[_0x7721('0x32')]]['starttime']){this['channels'][_0x2a025c[_0x7721('0x32')]][_0x7721('0x69')]=_0xb6db23[_0x7721('0x6a')](this[_0x7721('0x15')][_0x2a025c[_0x7721('0x32')]][_0x7721('0x4a')],_0x7721('0x5c'));}}if(_0x2a025c['calleridnum']!==_0x7721('0x3f')){this[_0x7721('0x15')][_0x2a025c[_0x7721('0x32')]]['connectedlinenum']=_0x2a025c[_0x7721('0x34')];}this[_0x7721('0x15')][_0x2a025c[_0x7721('0x32')]][_0x7721('0x6c')]=_0x2a025c['calleridname'];this['channels'][_0x2a025c[_0x7721('0x32')]][_0x7721('0x6d')]=_0x2a025c[_0x7721('0x3d')];this[_0x7721('0x15')][_0x2a025c[_0x7721('0x32')]][_0x7721('0x5d')]=dispositions[_['toNumber'](_0x2a025c[_0x7721('0x4d')])];}}else{if(this[_0x7721('0x15')][_0x2a025c[_0x7721('0x32')]]){if(_0x211d27){this['channels'][_0x2a025c[_0x7721('0x32')]][_0x7721('0x6b')]=_0x211d27['id'];this[_0x7721('0x15')][_0x2a025c[_0x7721('0x32')]][_0x7721('0x6e')]=_0x211d27['name'];}}}if(_0x2a025c[_0x7721('0x3b')]==='from-sip'){if(_0x211d27){_0x211d27[_0x7721('0x40')]=_0x2a025c[_0x7721('0x3e')];var _0x2d5433,_0x7f0598;if(this[_0x7721('0x15')][_0x2a025c[_0x7721('0x32')]]){_0x2d5433=this[_0x7721('0x15')][_0x2a025c[_0x7721('0x32')]][_0x7721('0x6f')];_0x7f0598=this[_0x7721('0x15')][_0x2a025c[_0x7721('0x32')]]['queue'];}else if(this[_0x7721('0x15')][_0x2a025c[_0x7721('0x37')]]){_0x2d5433=this[_0x7721('0x15')][_0x2a025c['linkedid']][_0x7721('0x6f')];_0x7f0598=this[_0x7721('0x15')][_0x2a025c[_0x7721('0x37')]][_0x7721('0x9')];}_0x211d27[_0x7721('0x9')]=_0x7f0598;_0x211d27['routealias']=_0x2d5433;var _0x1276ce={'id':_0x211d27['id'],'name':_0x211d27[_0x7721('0x42')],'agentconnected':!![],'destaccountcode':_0x211d27[_0x7721('0x43')],'destconnectedlinenum':_0x2a025c[_0x7721('0x3e')],'queue':_0x7f0598||undefined,'routealias':_0x2d5433,'uniqueid':_0x2a025c[_0x7721('0x37')]};logger[_0x7721('0x35')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x2a025c[_0x7721('0x32')],util[_0x7721('0x2d')](_0x1276ce,{'showHidden':![],'depth':null}));this['emit'](util[_0x7721('0x41')]('user:%s',_0x211d27[_0x7721('0x42')]),_0x7721('0x51'),_0x1276ce);}}}}catch(_0x54c7c5){logger[_0x7721('0x2b')]('[%s][voiceCallReport][newstate]',_0x2a025c['uniqueid'],util['inspect'](_0x54c7c5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7721('0x2e')][_0x7721('0x70')]=function(_0x21a686,_0x48b701){try{if(this['channels'][_0x21a686]){logger['info'](_0x7721('0x71'),_0x21a686,_0x48b701);this[_0x7721('0x15')][_0x21a686][_0x7721('0x72')]=!![];if(_[_0x7721('0x73')](_0x48b701,_0x7721('0x74'))){_0x48b701=_0x48b701[_0x7721('0x75')]('.wav49',_0x7721('0x76'));}this[_0x7721('0x15')][_0x21a686][_0x7721('0x77')]=_0x48b701;var _0xcf5304=_[_0x7721('0x78')](this[_0x7721('0x15')][_0x21a686][_0x7721('0x79')],{'filename':_0x48b701});if(_[_0x7721('0x7a')](_0xcf5304)){this[_0x7721('0x15')][_0x21a686][_0x7721('0x79')][_0x7721('0x7b')]({'filename':_0x48b701,'createdAt':moment()[_0x7721('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':'rec'});}}}catch(_0x40768f){logger[_0x7721('0x2b')]('[%s][voiceCallReport][mixMonitorFilename]',_0x21a686,util[_0x7721('0x2d')](_0x40768f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncVarSet']=function(_0x154b4b){try{if(this['isNotNull'](_0x154b4b)){logger['debug'](_0x7721('0x7c'),_0x154b4b[_0x7721('0x32')],util[_0x7721('0x2d')](_0x154b4b,{'showHidden':![],'depth':null}));if(this[_0x7721('0x15')][_0x154b4b[_0x7721('0x32')]]&&_0x154b4b['channel']!=_0x7721('0x48')){if(this[_0x7721('0x46')](_0x154b4b[_0x7721('0x7d')])){if(this[_0x7721('0x46')](_0x154b4b['variable']['mixmonitor_filename'])){logger[_0x7721('0x64')](_0x7721('0x7e'),_0x154b4b['uniqueid'],_0x154b4b[_0x7721('0x7f')]);this[_0x7721('0x70')](_0x154b4b['uniqueid'],_0x154b4b['value']);}else if(this[_0x7721('0x46')](_0x154b4b[_0x7721('0x7d')][_0x7721('0x80')])){logger[_0x7721('0x64')](_0x7721('0x81'),_0x154b4b[_0x7721('0x32')],_0x154b4b[_0x7721('0x7f')]);this[_0x7721('0x15')][_0x154b4b['uniqueid']][_0x7721('0x34')]=_0x154b4b[_0x7721('0x7f')];}else if(this[_0x7721('0x46')](_0x154b4b[_0x7721('0x7d')][_0x7721('0x82')])){logger[_0x7721('0x64')](_0x7721('0x83'),_0x154b4b['uniqueid'],_0x154b4b[_0x7721('0x7f')]);this[_0x7721('0x15')][_0x154b4b['uniqueid']][_0x7721('0x84')]=_0x154b4b[_0x7721('0x7f')];}else if(this[_0x7721('0x46')](_0x154b4b[_0x7721('0x7d')][_0x7721('0x85')])){logger[_0x7721('0x64')](_0x7721('0x86'),_0x154b4b[_0x7721('0x32')],_0x154b4b[_0x7721('0x7f')]);this[_0x7721('0x15')][_0x154b4b['uniqueid']][_0x7721('0x87')]=_0x154b4b[_0x7721('0x7f')];}else if(this[_0x7721('0x46')](_0x154b4b[_0x7721('0x7d')][_0x7721('0x88')])){logger[_0x7721('0x64')](_0x7721('0x89'),_0x154b4b[_0x7721('0x32')],_0x154b4b[_0x7721('0x7f')][_0x7721('0x63')](',')[0x0]);this[_0x7721('0x15')][_0x154b4b[_0x7721('0x32')]][_0x7721('0x9')]=_0x154b4b[_0x7721('0x7f')][_0x7721('0x63')](',')[0x0];}else if(this[_0x7721('0x46')](_0x154b4b[_0x7721('0x7d')][_0x7721('0x8a')])){logger[_0x7721('0x64')](_0x7721('0x8b'),_0x154b4b['uniqueid'],_0x154b4b[_0x7721('0x7f')]);this['channels'][_0x154b4b[_0x7721('0x32')]][_0x7721('0x8c')]=_0x154b4b[_0x7721('0x7f')];}else if(this[_0x7721('0x46')](_0x154b4b[_0x7721('0x7d')]['xmd-destination'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x154b4b['uniqueid'],_0x154b4b[_0x7721('0x7f')]);this[_0x7721('0x15')][_0x154b4b[_0x7721('0x32')]][_0x7721('0x8d')]=_0x154b4b[_0x7721('0x7f')];}else if(this['isNotNull'](_0x154b4b[_0x7721('0x7d')]['xmd-callerid-preview'])){logger[_0x7721('0x64')](_0x7721('0x8e'),_0x154b4b[_0x7721('0x32')],_0x154b4b[_0x7721('0x7f')]);this[_0x7721('0x15')][_0x154b4b[_0x7721('0x32')]]['calleridpreview']=_0x154b4b[_0x7721('0x7f')];}else if(this['isNotNull'](_0x154b4b['variable'][_0x7721('0x8f')])){logger[_0x7721('0x64')](_0x7721('0x90'),_0x154b4b[_0x7721('0x32')],_0x154b4b[_0x7721('0x7f')]);this['channels'][_0x154b4b[_0x7721('0x32')]][_0x7721('0x9')]=_0x154b4b[_0x7721('0x7f')];}else if(this[_0x7721('0x46')](_0x154b4b[_0x7721('0x7d')][_0x7721('0x91')])){logger[_0x7721('0x64')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x154b4b[_0x7721('0x32')],_0x154b4b[_0x7721('0x7f')]);this[_0x7721('0x15')][_0x154b4b[_0x7721('0x32')]][_0x7721('0x92')]=_0x154b4b['value'];}}}else if(this[_0x7721('0x46')](_0x154b4b[_0x7721('0x7d')][_0x7721('0x93')])){if(_0x154b4b['value']){var _0x250f29=path[_0x7721('0x94')](_0x154b4b['value'])[_0x7721('0x42')];logger[_0x7721('0x64')](_0x7721('0x7e'),_0x250f29,_0x154b4b[_0x7721('0x7f')]);this['syncMixMonitorFilename'](_0x250f29,_0x154b4b[_0x7721('0x7f')]);}}else if(this['channels'][_0x154b4b[_0x7721('0x37')]]){if(this[_0x7721('0x46')](_0x154b4b['variable'])){if(this[_0x7721('0x46')](_0x154b4b[_0x7721('0x7d')]['sipcallid'])){logger[_0x7721('0x64')](_0x7721('0x95'),_0x154b4b['linkedid'],_0x154b4b[_0x7721('0x7f')]);this['channels'][_0x154b4b[_0x7721('0x37')]][_0x7721('0x96')]=_0x154b4b[_0x7721('0x7f')];}}}}}catch(_0x57d61e){logger[_0x7721('0x2b')]('[%s][voiceCallReport][varset]',_0x154b4b['uniqueid'],util[_0x7721('0x2d')](_0x57d61e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7721('0x2e')][_0x7721('0x1f')]=function(_0x335852){try{if(this[_0x7721('0x46')](_0x335852)){logger['debug'](_0x7721('0x97'),_0x335852[_0x7721('0x32')],util[_0x7721('0x2d')](_0x335852,{'showHidden':![],'depth':null}));if(this[_0x7721('0x17')][_0x335852[_0x7721('0x37')]]){if(this['channels'][this[_0x7721('0x17')][_0x335852['linkedid']][_0x7721('0x37')]]){this['channels'][this['blindTransfers'][_0x335852[_0x7721('0x37')]]['linkedid']]['uniqueid']=_0x335852[_0x7721('0x32')];this[_0x7721('0x15')][this[_0x7721('0x17')][_0x335852['linkedid']][_0x7721('0x37')]]['answered']=this['channels'][_0x335852['uniqueid']][_0x7721('0x67')];this[_0x7721('0x15')][this[_0x7721('0x17')][_0x335852[_0x7721('0x37')]][_0x7721('0x37')]][_0x7721('0x68')]=this[_0x7721('0x15')][_0x335852[_0x7721('0x32')]][_0x7721('0x68')];this[_0x7721('0x15')][this[_0x7721('0x17')][_0x335852['linkedid']][_0x7721('0x37')]][_0x7721('0x6d')]=this[_0x7721('0x15')][this[_0x7721('0x17')][_0x335852[_0x7721('0x37')]][_0x7721('0x37')]][_0x7721('0x3d')];this['channels'][this['blindTransfers'][_0x335852[_0x7721('0x37')]][_0x7721('0x37')]][_0x7721('0x5d')]=this[_0x7721('0x15')][_0x335852['uniqueid']][_0x7721('0x5d')];this['channels'][_0x335852[_0x7721('0x32')]]=this['channels'][this[_0x7721('0x17')][_0x335852[_0x7721('0x37')]][_0x7721('0x37')]];delete this[_0x7721('0x15')][this[_0x7721('0x17')][_0x335852[_0x7721('0x37')]]['linkedid']];}else if(this['channels'][this['blindTransfers'][_0x335852[_0x7721('0x37')]]['uniqueid']]){this[_0x7721('0x15')][this[_0x7721('0x17')][_0x335852['linkedid']][_0x7721('0x32')]][_0x7721('0x32')]=[this[_0x7721('0x15')][this['blindTransfers'][_0x335852[_0x7721('0x37')]][_0x7721('0x32')]]['linkedid'],this['channels'][this[_0x7721('0x17')][_0x335852[_0x7721('0x37')]]['uniqueid']][_0x7721('0x37')]=this[_0x7721('0x15')][this['blindTransfers'][_0x335852['linkedid']]['uniqueid']]['uniqueid']][0x0];this[_0x7721('0x15')][this[_0x7721('0x17')][_0x335852[_0x7721('0x37')]]['uniqueid']]['answered']=this[_0x7721('0x15')][_0x335852[_0x7721('0x32')]][_0x7721('0x67')];this[_0x7721('0x15')][this[_0x7721('0x17')][_0x335852[_0x7721('0x37')]][_0x7721('0x32')]][_0x7721('0x68')]=this[_0x7721('0x15')][_0x335852['uniqueid']]['answertime'];this[_0x7721('0x15')][this['blindTransfers'][_0x335852[_0x7721('0x37')]]['uniqueid']][_0x7721('0x6d')]=this['channels'][this[_0x7721('0x17')][_0x335852[_0x7721('0x37')]]['uniqueid']]['channel'];this[_0x7721('0x15')][this[_0x7721('0x17')][_0x335852[_0x7721('0x37')]][_0x7721('0x32')]][_0x7721('0x5d')]=this['channels'][_0x335852[_0x7721('0x32')]][_0x7721('0x5d')];this[_0x7721('0x15')][_0x335852['uniqueid']]=this[_0x7721('0x15')][this[_0x7721('0x17')][_0x335852[_0x7721('0x37')]][_0x7721('0x32')]];delete this[_0x7721('0x15')][this[_0x7721('0x17')][_0x335852[_0x7721('0x37')]][_0x7721('0x32')]];}}if(this[_0x7721('0x15')][_0x335852[_0x7721('0x32')]]){logger[_0x7721('0x64')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x335852[_0x7721('0x32')],_0x335852[_0x7721('0x98')]);var _0x517966=moment();this[_0x7721('0x15')][_0x335852[_0x7721('0x32')]][_0x7721('0x99')]=_0x517966[_0x7721('0x41')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7721('0x15')][_0x335852['uniqueid']][_0x7721('0x5a')]=_0x517966[_0x7721('0x6a')](this[_0x7721('0x15')][_0x335852[_0x7721('0x32')]][_0x7721('0x4a')],_0x7721('0x5c'));if(this['channels'][_0x335852[_0x7721('0x32')]]['answered']){this[_0x7721('0x15')][_0x335852[_0x7721('0x32')]][_0x7721('0x9a')]=_0x517966['diff'](this[_0x7721('0x15')][_0x335852[_0x7721('0x32')]][_0x7721('0x68')],_0x7721('0x5c'));this['channels'][_0x335852[_0x7721('0x32')]][_0x7721('0x69')]=this[_0x7721('0x15')][_0x335852[_0x7721('0x32')]]['duration']-this[_0x7721('0x15')][_0x335852[_0x7721('0x32')]][_0x7721('0x9a')];}if(_0x335852[_0x7721('0x3b')]==='from-sip'){if(this[_0x7721('0x16')][_0x335852[_0x7721('0x3d')][_0x7721('0x63')]('-')[0x0]]){this[_0x7721('0x16')][_0x335852[_0x7721('0x3d')][_0x7721('0x63')]('-')[0x0]]=_[_0x7721('0x9b')](this[_0x7721('0x16')][_0x335852[_0x7721('0x3d')]['split']('-')[0x0]],[_0x7721('0x40')]);logger[_0x7721('0x35')](_0x7721('0x9c'),_0x335852[_0x7721('0x32')],util[_0x7721('0x2d')]({'id':this[_0x7721('0x16')][_0x335852[_0x7721('0x3d')][_0x7721('0x63')]('-')[0x0]]['id'],'destaccountcode':this[_0x7721('0x16')][_0x335852[_0x7721('0x3d')][_0x7721('0x63')]('-')[0x0]][_0x7721('0x43')]},{'showHidden':![],'depth':null}));this[_0x7721('0x30')](util[_0x7721('0x41')](_0x7721('0x50'),this[_0x7721('0x16')][_0x335852['channel'][_0x7721('0x63')]('-')[0x0]][_0x7721('0x42')]),_0x7721('0x9d'),{'id':this[_0x7721('0x16')][_0x335852[_0x7721('0x3d')][_0x7721('0x63')]('-')[0x0]]['id'],'destaccountcode':this[_0x7721('0x16')][_0x335852[_0x7721('0x3d')][_0x7721('0x63')]('-')[0x0]][_0x7721('0x43')]});for(var _0x3d2c20=0x0;_0x3d2c200x0?!![]:![];if(!_0x49a33c){return this[_0xcf33('0x16')](this[_0xcf33('0x44')][_0xcf33('0x6d')]);}};VoiceQueueReport[_0xcf33('0xa')]['syncQueueMember']=function(_0x244d8b){var _0x5b2d85=this[_0xcf33('0x44')]['id'];if(this[_0xcf33('0x44')][_0xcf33('0x69')][_0x5b2d85]&&this['summary'][_0xcf33('0x69')][_0x5b2d85][_0x244d8b[_0xcf33('0x62')]]){this[_0xcf33('0x44')]['queuestatus'][_0x5b2d85][_0x244d8b[_0xcf33('0x62')]][_0xcf33('0x10')][_0xcf33('0x6e')](_0x244d8b);}};VoiceQueueReport[_0xcf33('0xa')]['syncQueueSummary']=function(_0x2bac4e){var _0xfc7a1d=this;try{if(this[_0xcf33('0x5a')](_0x2bac4e)&&this[_0xcf33('0x5a')](_0x2bac4e[_0xcf33('0x52')])){logger[_0xcf33('0x4f')](_0xcf33('0x6f'),util[_0xcf33('0x3f')](_0x2bac4e,{'showHidden':![],'depth':null}));var _0x1b5baf=this[_0xcf33('0x12')][_0x2bac4e['queue']];if(_0x1b5baf){logger[_0xcf33('0x4f')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x1b5baf['name']);this[_0xcf33('0x44')][_0xcf33('0x5d')][_0x1b5baf[_0xcf33('0x59')]]={'summaryEvent':_0x2bac4e};this[_0xcf33('0x44')][_0xcf33('0x6c')]+=0x1;return ami[_0xcf33('0x38')]({'action':_0xcf33('0x69'),'queue':_0x1b5baf[_0xcf33('0x59')]})[_0xcf33('0x61')](function(_0x1c879d){if(!_0xfc7a1d[_0xcf33('0x44')]['queuestatus'][_0x2bac4e['actionid']]){_0xfc7a1d['summary'][_0xcf33('0x69')][_0x2bac4e[_0xcf33('0x62')]]={};}_0xfc7a1d[_0xcf33('0x44')]['queuestatus'][_0x2bac4e['actionid']][_0x1c879d[_0xcf33('0x62')]]={'queue':_0x1b5baf[_0xcf33('0x59')],'agents':[]};})['catch'](function(_0x52341b){throw _0x52341b;});}}}catch(_0x37b592){logger[_0xcf33('0x3e')]('[voiceQueueReport][queuesummary]',util[_0xcf33('0x3f')](_0x37b592,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcf33('0xa')][_0xcf33('0x16')]=function(_0x456c25){if(this[_0xcf33('0x44')]['statusRequests']>0x0){this['summary']['completeEvent']=_0x456c25;return;}logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xcf33('0x3f')](_0x456c25,{'showHidden':![],'depth':null}));this[_0xcf33('0x44')]=initializeSummary();ami[_0xcf33('0x47')](_0xcf33('0x70'),{});};VoiceQueueReport[_0xcf33('0xa')]['syncQueueCallerJoin']=function(_0x13ebb4){try{if(this[_0xcf33('0x5a')](_0x13ebb4)){logger['debug'](_0xcf33('0x71'),_0x13ebb4[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x13ebb4,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xcf33('0xe')][_0x13ebb4[_0xcf33('0x4a')]])){this[_0xcf33('0xe')][_0x13ebb4[_0xcf33('0x4a')]]=[];}if(_[_0xcf33('0x5b')](this[_0xcf33('0x36')][_0x13ebb4[_0xcf33('0x4a')]])){this[_0xcf33('0x36')][_0x13ebb4[_0xcf33('0x4a')]]={};}var _0x33aae2=new QueueReport();_0x33aae2['queue']=_0x13ebb4[_0xcf33('0x52')];_0x33aae2['type']=this[_0xcf33('0x12')][_0x33aae2['queue']]&&this[_0xcf33('0x12')][_0x33aae2['queue']][_0xcf33('0x56')]?this[_0xcf33('0x12')][_0x33aae2[_0xcf33('0x52')]][_0xcf33('0x56')]||'inbound':_0xcf33('0x57');_0x33aae2[_0xcf33('0x72')]=moment()[_0xcf33('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x33aae2['position']=_0x13ebb4[_0xcf33('0x73')];_0x33aae2[_0xcf33('0x74')]=_0x13ebb4[_0xcf33('0x74')];_0x33aae2[_0xcf33('0x4a')]=_0x13ebb4[_0xcf33('0x4a')];_0x33aae2[_0xcf33('0x75')]=this[_0xcf33('0x36')][_0x13ebb4['uniqueid']][_0xcf33('0x75')];logger[_0xcf33('0x76')](_0xcf33('0x77'),_0x33aae2[_0xcf33('0x52')],_0x33aae2[_0xcf33('0x56')]);Object[_0xcf33('0x68')](_0x33aae2,_[_0xcf33('0x78')](_0x13ebb4,_['keys'](_0x33aae2)));this[_0xcf33('0xe')][_0x13ebb4['uniqueid']]['push'](_0x33aae2);this[_0xcf33('0x36')][_0x13ebb4[_0xcf33('0x4a')]]=_0x33aae2;this[_0xcf33('0x48')](_0x33aae2,'queuecallerjoin');}}catch(_0x4c3e86){logger['error'](_0xcf33('0x71'),_0x13ebb4[_0xcf33('0x4a')],util['inspect'](_0x4c3e86,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcf33('0xa')][_0xcf33('0x1b')]=function(_0x548c14){try{if(this[_0xcf33('0x5a')](_0x548c14)){logger[_0xcf33('0x4f')](_0xcf33('0x79'),_0x548c14[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x548c14,{'showHidden':![],'depth':null}));if(this[_0xcf33('0xe')][_0x548c14[_0xcf33('0x4a')]]){var _0x3b936c=_[_0xcf33('0x7a')](this[_0xcf33('0xe')][_0x548c14[_0xcf33('0x4a')]]);_0x3b936c[_0xcf33('0x35')]=![];_0x3b936c[_0xcf33('0x7b')]=null;_0x3b936c[_0xcf33('0x7c')]=_0x548c14[_0xcf33('0x7c')];_0x3b936c[_0xcf33('0x7d')]=_0x548c14['originalposition'];_0x3b936c['queuecallerabandon']=!![];_0x3b936c['queuecallerabandonAt']=moment()[_0xcf33('0x4b')](_0xcf33('0x7e'));_0x3b936c[_0xcf33('0x51')]=_0xcf33('0x7f');_0x3b936c[_0xcf33('0x80')]=null;logger[_0xcf33('0x76')](_0xcf33('0x81'),_0x3b936c[_0xcf33('0x52')],_0x3b936c[_0xcf33('0x56')]);this[_0xcf33('0x36')][_0x548c14[_0xcf33('0x4a')]]=_0x3b936c;this[_0xcf33('0x45')](_0x3b936c,_0xcf33('0x1a'));}}}catch(_0x368806){logger[_0xcf33('0x3e')]('[%s][voiceQueueReport][queuecallerabandon]',_0x548c14[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x368806,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x5a7410){try{if(this['isNotNull'](_0x5a7410)){logger[_0xcf33('0x4f')](_0xcf33('0x82'),_0x5a7410[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x5a7410,{'showHidden':![],'depth':null}));if(this[_0xcf33('0xe')][_0x5a7410[_0xcf33('0x4a')]]){var _0x9ae4b4=_[_0xcf33('0x7a')](this[_0xcf33('0xe')][_0x5a7410[_0xcf33('0x4a')]]);_0x9ae4b4[_0xcf33('0x83')]=moment()[_0xcf33('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x9ae4b4['connectedlinenum']=_0x5a7410[_0xcf33('0x84')];_0x9ae4b4['connectedlinename']=_0x5a7410[_0xcf33('0x85')];logger[_0xcf33('0x76')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x9ae4b4[_0xcf33('0x52')],_0x9ae4b4[_0xcf33('0x56')],_0x5a7410[_0xcf33('0x84')],_0x5a7410[_0xcf33('0x85')]);this[_0xcf33('0x36')][_0x5a7410['uniqueid']]=_0x9ae4b4;this['emitVoiceQueueChannelSave'](_0x9ae4b4,_0xcf33('0x1c'));}}}catch(_0x230b22){logger[_0xcf33('0x3e')](_0xcf33('0x82'),_0x5a7410[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x230b22,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcf33('0xa')][_0xcf33('0x20')]=function(_0x54f62c){try{if(this[_0xcf33('0x5a')](_0x54f62c)){logger[_0xcf33('0x4f')](_0xcf33('0x86'),_0x54f62c[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x54f62c,{'showHidden':![],'depth':null}));if(this[_0xcf33('0xe')][_0x54f62c['uniqueid']]){var _0x5fa249=_[_0xcf33('0x7a')](this[_0xcf33('0xe')][_0x54f62c[_0xcf33('0x4a')]]);_0x5fa249[_0xcf33('0x35')]=!![];_0x5fa249[_0xcf33('0x51')]=_0xcf33('0x87');logger['info'](_0xcf33('0x88'),_0x5fa249[_0xcf33('0x52')],_0x5fa249['type']);}}}catch(_0x4a7192){logger[_0xcf33('0x3e')](_0xcf33('0x86'),_0x54f62c['uniqueid'],util['inspect'](_0x4a7192,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcf33('0xa')][_0xcf33('0x1e')]=function(_0xadfd7f){try{if(this[_0xcf33('0x5a')](_0xadfd7f)){logger[_0xcf33('0x4f')]('[%s][voiceQueueReport][agentcomplete]',_0xadfd7f[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0xadfd7f,{'showHidden':![],'depth':null}));if(this[_0xcf33('0xe')][_0xadfd7f[_0xcf33('0x4a')]]){var _0x2edcd5=_[_0xcf33('0x7a')](this[_0xcf33('0xe')][_0xadfd7f[_0xcf33('0x4a')]]);_0x2edcd5['queuecallerabandon']=![];_0x2edcd5[_0xcf33('0x89')]=null;_0x2edcd5[_0xcf33('0x8a')]=!![];_0x2edcd5[_0xcf33('0x80')]=_0xadfd7f[_0xcf33('0x8b')];_0x2edcd5['holdtime']=_0xadfd7f['holdtime'];_0x2edcd5[_0xcf33('0x35')]=!![];_0x2edcd5[_0xcf33('0x34')]=![];_0x2edcd5[_0xcf33('0x8c')]=null;if(!_0x2edcd5['transfer']){if(_0xadfd7f[_0xcf33('0x8d')]==_0xcf33('0x8e')){_0x2edcd5[_0xcf33('0x51')]=_0xcf33('0x8f');logger[_0xcf33('0x76')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x2edcd5['queue'],_0x2edcd5[_0xcf33('0x56')]);}else{if(_[_0xcf33('0x90')](_0xadfd7f['channel'][_0xcf33('0x91')](),'local/')){if(this['queueReports'][_0xadfd7f[_0xcf33('0x92')]]){var _0x454b9d=_[_0xcf33('0x7a')](this[_0xcf33('0xe')][_0xadfd7f[_0xcf33('0x92')]]);_0x454b9d[_0xcf33('0x35')]=![];_0x454b9d[_0xcf33('0x34')]=!![];_0x454b9d['queuecallerexitAt']=moment(_0x2edcd5[_0xcf33('0x72')])[_0xcf33('0x93')](_0xadfd7f[_0xcf33('0x7c')],'seconds')[_0xcf33('0x4b')](_0xcf33('0x7e'));_0x454b9d[_0xcf33('0x51')]=_0xcf33('0x94');_0x454b9d[_0xcf33('0x8e')]=!![];_0x454b9d[_0xcf33('0x95')]=_0xcf33('0x96');_0x454b9d[_0xcf33('0x97')]=_0xadfd7f['destexten'];_0x454b9d[_0xcf33('0x98')]=_0xadfd7f[_0xcf33('0x4a')];logger[_0xcf33('0x76')](_0xcf33('0x99'),_0x454b9d['queue'],_0x454b9d[_0xcf33('0x56')]);var _0x360845=this['queueReports'][_0xadfd7f['linkedid']];this['queueReports'][_0xadfd7f['linkedid']]=this['queueReports'][_0xadfd7f[_0xcf33('0x4a')]];this['queueReports'][_0xadfd7f[_0xcf33('0x4a')]]=_0x360845;}}else{_0x2edcd5[_0xcf33('0x51')]=_0xcf33('0x9a')+_0xadfd7f[_0xcf33('0x8d')]['toUpperCase']();logger[_0xcf33('0x76')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x2edcd5[_0xcf33('0x52')],_0x2edcd5['type'],_0x2edcd5[_0xcf33('0x51')]);}}}this[_0xcf33('0x36')][_0xadfd7f[_0xcf33('0x4a')]]=_0x2edcd5;}}}catch(_0x335ffd){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0xadfd7f['uniqueid'],util[_0xcf33('0x3f')](_0x335ffd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcf33('0x21')]=function(_0x17252){try{if(this[_0xcf33('0x5a')](_0x17252)){logger[_0xcf33('0x4f')](_0xcf33('0x9b'),_0x17252[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x17252,{'showHidden':![],'depth':null}));this['addVariable'](_0x17252[_0xcf33('0x4a')],_[_0xcf33('0x9c')](_0x17252['variable'])[0x0],_0x17252[_0xcf33('0x9d')]);if(this['queueReports'][_0x17252[_0xcf33('0x4a')]]){var _0x8f2931=_[_0xcf33('0x7a')](this[_0xcf33('0xe')][_0x17252[_0xcf33('0x4a')]]);if(_0x8f2931){if(this['isNotNull'](_0x17252[_0xcf33('0x9e')])&&this[_0xcf33('0x5a')](_0x17252[_0xcf33('0x9e')][_0xcf33('0x69')])){switch(_0x17252[_0xcf33('0x9d')]){case _0xcf33('0x9f'):_0x8f2931[_0xcf33('0x34')]=![];_0x8f2931[_0xcf33('0x8c')]=null;break;case _0xcf33('0xa0'):_0x8f2931['lastevent']=_0xcf33('0xa1');_0x8f2931[_0xcf33('0x34')]=!![];_0x8f2931[_0xcf33('0x8c')]=moment()['format'](_0xcf33('0x7e'));_0x8f2931[_0xcf33('0x83')]=moment()[_0xcf33('0x4b')](_0xcf33('0x7e'));logger[_0xcf33('0x4f')](_0xcf33('0xa2'),_0x17252[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x8f2931,{'showHidden':![],'depth':null}));ami[_0xcf33('0x47')](_0xcf33('0xa3'),_0x8f2931);break;default:_0x8f2931['queuecallerexit']=!![];_0x8f2931['queuecallerexitAt']=moment()[_0xcf33('0x4b')](_0xcf33('0x7e'));_0x8f2931['queuecallerleaveAt']=moment()[_0xcf33('0x4b')](_0xcf33('0x7e'));}_0x8f2931['queuecallerabandon']=![];_0x8f2931[_0xcf33('0x89')]=null;_0x8f2931[_0xcf33('0x51')]=_0x17252[_0xcf33('0x9d')];this[_0xcf33('0x36')][_0x17252[_0xcf33('0x4a')]]=_0x8f2931;this[_0xcf33('0x45')](_0x8f2931,_0xcf33('0xa4'));}else if(this[_0xcf33('0x5a')](_0x17252['variable'])&&this['isNotNull'](_0x17252[_0xcf33('0x9e')][_0xcf33('0xa5')])){if(!_0x8f2931[_0xcf33('0x1a')]){_0x8f2931[_0xcf33('0x34')]=!![];_0x8f2931['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x8f2931[_0xcf33('0x51')]=_0xcf33('0xa6');_0x8f2931[_0xcf33('0x83')]=moment()[_0xcf33('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xcf33('0x36')][_0x17252[_0xcf33('0x4a')]]=_0x8f2931;}}logger[_0xcf33('0x76')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x17252[_0xcf33('0x4a')],_0x8f2931['queue'],_0x8f2931[_0xcf33('0x56')],_['keys'](_0x17252['variable'])[0x0],_0x17252[_0xcf33('0x9d')]);_0x8f2931[_0xcf33('0x40')]=this[_0xcf33('0x40')][_0x17252[_0xcf33('0x4a')]];}}}}catch(_0x4afc61){logger[_0xcf33('0x3e')](_0xcf33('0x9b'),_0x17252[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x4afc61,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcf33('0xa')][_0xcf33('0xa7')]=function(_0x52f47b,_0x5c86fb,_0x5ae142){var _0x84f7f=['rtpaudioqos',_0xcf33('0xa8'),_0xcf33('0xa9'),_0xcf33('0xaa'),'rtpaudioqosloss',_0xcf33('0xab'),'rtpaudioqosrtt',_0xcf33('0xac'),'sipcallid',_0xcf33('0xad'),_0xcf33('0xae'),'bridgepvtcallid',_0xcf33('0xaf'),_0xcf33('0xb0'),'memberinterface',_0xcf33('0xb1'),_0xcf33('0x8b'),_0xcf33('0xb2'),'memberrealtime'];if(!_[_0xcf33('0x37')](_0x5c86fb)&&!_[_0xcf33('0xb3')](_0x84f7f,_0x5c86fb)){if(_[_0xcf33('0x5b')](this[_0xcf33('0x40')][_0x52f47b])){this[_0xcf33('0x40')][_0x52f47b]={};}this[_0xcf33('0x40')][_0x52f47b][_0x5c86fb]=_0x5ae142;}};VoiceQueueReport[_0xcf33('0xa')][_0xcf33('0xb4')]=function(_0xa38fa6,_0x507065,_0x26ddd5){try{var _0x5ecb2={};if(this['queueReports'][_0xa38fa6]){for(var _0x2be0d9=0x0;_0x2be0d90x0?!![]:![];if(!_0x44054f){return this[_0x66df('0x1b')](this[_0x66df('0x49')]['completeEvent']);}};VoiceQueueReport[_0x66df('0xc')]['syncQueueMember']=function(_0x5335d8){var _0x376a48=this[_0x66df('0x49')]['id'];if(this[_0x66df('0x49')][_0x66df('0x66')][_0x376a48]&&this['summary'][_0x66df('0x66')][_0x376a48][_0x5335d8[_0x66df('0x6f')]]){this[_0x66df('0x49')]['queuestatus'][_0x376a48][_0x5335d8['actionid']][_0x66df('0x13')][_0x66df('0x72')](_0x5335d8);}};VoiceQueueReport[_0x66df('0xc')][_0x66df('0x18')]=function(_0x5ad8aa){var _0x17b580=this;try{if(this[_0x66df('0x60')](_0x5ad8aa)&&this[_0x66df('0x60')](_0x5ad8aa[_0x66df('0x52')])){logger[_0x66df('0x4c')](_0x66df('0x73'),util[_0x66df('0x44')](_0x5ad8aa,{'showHidden':![],'depth':null}));var _0x3cfc8b=this[_0x66df('0x15')][_0x5ad8aa[_0x66df('0x52')]];if(_0x3cfc8b){logger[_0x66df('0x4c')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x3cfc8b['name']);this[_0x66df('0x49')]['queues'][_0x3cfc8b[_0x66df('0x5e')]]={'summaryEvent':_0x5ad8aa};this[_0x66df('0x49')][_0x66df('0x74')]+=0x1;return ami['Action']({'action':_0x66df('0x66'),'queue':_0x3cfc8b['name']})['then'](function(_0x31033e){if(!_0x17b580[_0x66df('0x49')][_0x66df('0x66')][_0x5ad8aa[_0x66df('0x6f')]]){_0x17b580['summary'][_0x66df('0x66')][_0x5ad8aa[_0x66df('0x6f')]]={};}_0x17b580[_0x66df('0x49')][_0x66df('0x66')][_0x5ad8aa['actionid']][_0x31033e[_0x66df('0x6f')]]={'queue':_0x3cfc8b[_0x66df('0x5e')],'agents':[]};})[_0x66df('0x40')](function(_0x518473){throw _0x518473;});}}}catch(_0x240a3a){logger['error'](_0x66df('0x67'),util['inspect'](_0x240a3a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x66df('0x1b')]=function(_0x4250c9){if(this[_0x66df('0x49')][_0x66df('0x74')]>0x0){this['summary']['completeEvent']=_0x4250c9;return;}logger[_0x66df('0x4c')](_0x66df('0x75'),util['inspect'](_0x4250c9,{'showHidden':![],'depth':null}));this[_0x66df('0x49')]=initializeSummary();ami[_0x66df('0x4a')](_0x66df('0x76'),{});};VoiceQueueReport['prototype'][_0x66df('0x1f')]=function(_0x1cf5ca){try{if(this[_0x66df('0x60')](_0x1cf5ca)){logger[_0x66df('0x4c')]('[%s][voiceQueueReport][queuecallerjoin]',_0x1cf5ca[_0x66df('0x4f')],util[_0x66df('0x44')](_0x1cf5ca,{'showHidden':![],'depth':null}));if(_[_0x66df('0x61')](this[_0x66df('0x11')][_0x1cf5ca[_0x66df('0x4f')]])){this[_0x66df('0x11')][_0x1cf5ca[_0x66df('0x4f')]]=[];}if(_[_0x66df('0x61')](this[_0x66df('0x14')][_0x1cf5ca[_0x66df('0x4f')]])){this['channels'][_0x1cf5ca[_0x66df('0x4f')]]={};}var _0x14ceee=new QueueReport();_0x14ceee[_0x66df('0x52')]=_0x1cf5ca[_0x66df('0x52')];_0x14ceee[_0x66df('0x5b')]=this[_0x66df('0x15')][_0x14ceee[_0x66df('0x52')]]&&this[_0x66df('0x15')][_0x14ceee[_0x66df('0x52')]]['type']?this[_0x66df('0x15')][_0x14ceee[_0x66df('0x52')]][_0x66df('0x5b')]||_0x66df('0x5c'):_0x66df('0x5c');_0x14ceee[_0x66df('0x77')]=moment()[_0x66df('0x50')](_0x66df('0x78'));_0x14ceee[_0x66df('0x79')]=_0x1cf5ca['position'];_0x14ceee[_0x66df('0x7a')]=_0x1cf5ca['count'];_0x14ceee[_0x66df('0x4f')]=_0x1cf5ca[_0x66df('0x4f')];_0x14ceee['routealias']=this[_0x66df('0x14')][_0x1cf5ca['uniqueid']][_0x66df('0x7b')];logger[_0x66df('0x7c')](_0x66df('0x7d'),_0x14ceee[_0x66df('0x52')],_0x14ceee[_0x66df('0x5b')]);Object[_0x66df('0x6e')](_0x14ceee,_[_0x66df('0x7e')](_0x1cf5ca,_[_0x66df('0x7f')](_0x14ceee)));this[_0x66df('0x11')][_0x1cf5ca['uniqueid']]['push'](_0x14ceee);this['channels'][_0x1cf5ca[_0x66df('0x4f')]]=_0x14ceee;this[_0x66df('0x4b')](_0x14ceee,_0x66df('0x80'));}}catch(_0x58defb){logger[_0x66df('0x42')](_0x66df('0x81'),_0x1cf5ca['uniqueid'],util[_0x66df('0x44')](_0x58defb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x66df('0xc')][_0x66df('0x20')]=function(_0x542e2e){try{if(this['isNotNull'](_0x542e2e)){logger[_0x66df('0x4c')](_0x66df('0x82'),_0x542e2e[_0x66df('0x4f')],util['inspect'](_0x542e2e,{'showHidden':![],'depth':null}));if(this[_0x66df('0x11')][_0x542e2e[_0x66df('0x4f')]]){var _0x23b5b5=_[_0x66df('0x83')](this[_0x66df('0x11')][_0x542e2e[_0x66df('0x4f')]]);_0x23b5b5['queuecallercomplete']=![];_0x23b5b5['queuecallercompleteAt']=null;_0x23b5b5['holdtime']=_0x542e2e[_0x66df('0x84')];_0x23b5b5[_0x66df('0x85')]=_0x542e2e[_0x66df('0x85')];_0x23b5b5['queuecallerabandon']=!![];_0x23b5b5['queuecallerabandonAt']=moment()[_0x66df('0x50')](_0x66df('0x78'));_0x23b5b5[_0x66df('0x57')]='ABANDONED';_0x23b5b5[_0x66df('0x86')]=null;logger[_0x66df('0x7c')](_0x66df('0x87'),_0x23b5b5[_0x66df('0x52')],_0x23b5b5[_0x66df('0x5b')]);this[_0x66df('0x14')][_0x542e2e['uniqueid']]=_0x23b5b5;this[_0x66df('0x55')](_0x23b5b5,_0x66df('0x3b'));}}}catch(_0x2c5aab){logger[_0x66df('0x42')](_0x66df('0x82'),_0x542e2e[_0x66df('0x4f')],util[_0x66df('0x44')](_0x2c5aab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x66df('0xc')]['syncQueueCallerLeave']=function(_0x1f1869){try{if(this[_0x66df('0x60')](_0x1f1869)){logger[_0x66df('0x4c')](_0x66df('0x88'),_0x1f1869[_0x66df('0x4f')],util[_0x66df('0x44')](_0x1f1869,{'showHidden':![],'depth':null}));if(this[_0x66df('0x11')][_0x1f1869[_0x66df('0x4f')]]){var _0x3b0199=_[_0x66df('0x83')](this[_0x66df('0x11')][_0x1f1869[_0x66df('0x4f')]]);_0x3b0199[_0x66df('0x89')]=moment()['format'](_0x66df('0x78'));_0x3b0199[_0x66df('0x8a')]=_0x1f1869[_0x66df('0x8a')];_0x3b0199['connectedlinename']=_0x1f1869[_0x66df('0x8b')];logger[_0x66df('0x7c')](_0x66df('0x8c'),_0x3b0199[_0x66df('0x52')],_0x3b0199[_0x66df('0x5b')],_0x1f1869[_0x66df('0x8a')],_0x1f1869['connectedlinename']);this['channels'][_0x1f1869[_0x66df('0x4f')]]=_0x3b0199;this[_0x66df('0x4b')](_0x3b0199,'queuecallerleave');}}}catch(_0x623129){logger['error'](_0x66df('0x88'),_0x1f1869[_0x66df('0x4f')],util[_0x66df('0x44')](_0x623129,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x66df('0xc')]['syncAgentConnect']=function(_0x521c3d){try{if(this[_0x66df('0x60')](_0x521c3d)){logger[_0x66df('0x4c')](_0x66df('0x8d'),_0x521c3d['uniqueid'],util[_0x66df('0x44')](_0x521c3d,{'showHidden':![],'depth':null}));if(this[_0x66df('0x11')][_0x521c3d[_0x66df('0x4f')]]){var _0x1d1942=_['last'](this[_0x66df('0x11')][_0x521c3d[_0x66df('0x4f')]]);_0x1d1942[_0x66df('0x3c')]=!![];_0x1d1942[_0x66df('0x57')]=_0x66df('0x8e');logger[_0x66df('0x7c')](_0x66df('0x8f'),_0x1d1942[_0x66df('0x52')],_0x1d1942[_0x66df('0x5b')]);}}}catch(_0x372dce){logger[_0x66df('0x42')]('[%s][voiceQueueReport][agentconnect]',_0x521c3d['uniqueid'],util['inspect'](_0x372dce,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x66df('0x24')]=function(_0x55b37e){try{if(this['isNotNull'](_0x55b37e)){logger[_0x66df('0x4c')](_0x66df('0x90'),_0x55b37e[_0x66df('0x4f')],util['inspect'](_0x55b37e,{'showHidden':![],'depth':null}));if(this[_0x66df('0x11')][_0x55b37e['uniqueid']]){var _0x1eaf67=_['last'](this['queueReports'][_0x55b37e[_0x66df('0x4f')]]);_0x1eaf67[_0x66df('0x3b')]=![];_0x1eaf67['queuecallerabandonAt']=null;_0x1eaf67[_0x66df('0x91')]=!![];_0x1eaf67[_0x66df('0x86')]=_0x55b37e[_0x66df('0x92')];_0x1eaf67[_0x66df('0x84')]=_0x55b37e[_0x66df('0x84')];_0x1eaf67[_0x66df('0x3c')]=!![];_0x1eaf67['queuecallerexit']=![];_0x1eaf67[_0x66df('0x93')]=null;if(!_0x1eaf67['transfer']){if(_0x55b37e['reason']==_0x66df('0x94')){_0x1eaf67[_0x66df('0x57')]=_0x66df('0x95');logger[_0x66df('0x7c')](_0x66df('0x96'),_0x1eaf67[_0x66df('0x52')],_0x1eaf67['type']);}else{if(_[_0x66df('0x97')](_0x55b37e[_0x66df('0x98')][_0x66df('0x99')](),_0x66df('0x9a'))){if(this[_0x66df('0x11')][_0x55b37e['linkedid']]){var _0x1fb126=_['last'](this['queueReports'][_0x55b37e['linkedid']]);_0x1fb126[_0x66df('0x3c')]=![];_0x1fb126[_0x66df('0x9b')]=!![];_0x1fb126[_0x66df('0x93')]=moment(_0x1eaf67['queuecallerjoinAt'])[_0x66df('0x9c')](_0x55b37e[_0x66df('0x84')],_0x66df('0x9d'))[_0x66df('0x50')](_0x66df('0x78'));_0x1fb126['queuecallerexitreason']=_0x66df('0x9e');_0x1fb126['transfer']=!![];_0x1fb126[_0x66df('0x9f')]=_0x66df('0xa0');_0x1fb126[_0x66df('0xa1')]=_0x55b37e[_0x66df('0xa2')];_0x1fb126['transferuniqueid']=_0x55b37e[_0x66df('0x4f')];logger[_0x66df('0x7c')](_0x66df('0xa3'),_0x1fb126[_0x66df('0x52')],_0x1fb126[_0x66df('0x5b')]);var _0x150531=this['queueReports'][_0x55b37e[_0x66df('0xa4')]];this[_0x66df('0x11')][_0x55b37e[_0x66df('0xa4')]]=this[_0x66df('0x11')][_0x55b37e['uniqueid']];this[_0x66df('0x11')][_0x55b37e[_0x66df('0x4f')]]=_0x150531;}}else{_0x1eaf67[_0x66df('0x57')]='COMPLETEDBY'+_0x55b37e[_0x66df('0xa5')]['toUpperCase']();logger[_0x66df('0x7c')](_0x66df('0xa6'),_0x1eaf67[_0x66df('0x52')],_0x1eaf67[_0x66df('0x5b')],_0x1eaf67[_0x66df('0x57')]);}}}this[_0x66df('0x14')][_0x55b37e['uniqueid']]=_0x1eaf67;}}}catch(_0x398dc3){logger[_0x66df('0x42')]('[%s][voiceQueueReport][agentcomplete]',_0x55b37e['uniqueid'],util['inspect'](_0x398dc3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0xffe4d7){try{if(this[_0x66df('0x60')](_0xffe4d7)){logger['debug'](_0x66df('0xa7'),_0xffe4d7[_0x66df('0x4f')],util[_0x66df('0x44')](_0xffe4d7,{'showHidden':![],'depth':null}));this[_0x66df('0xa8')](_0xffe4d7[_0x66df('0x4f')],_[_0x66df('0x7f')](_0xffe4d7[_0x66df('0xa9')])[0x0],_0xffe4d7[_0x66df('0xaa')]);if(this[_0x66df('0x11')][_0xffe4d7['uniqueid']]){var _0x3b2946=_[_0x66df('0x83')](this[_0x66df('0x11')][_0xffe4d7[_0x66df('0x4f')]]);if(_0x3b2946){if(this[_0x66df('0x60')](_0xffe4d7['variable'])&&this[_0x66df('0x60')](_0xffe4d7[_0x66df('0xa9')][_0x66df('0x66')])){switch(_0xffe4d7[_0x66df('0xaa')]){case _0x66df('0xab'):_0x3b2946['queuecallerexit']=![];_0x3b2946[_0x66df('0x93')]=null;break;case'TIMEOUT':_0x3b2946[_0x66df('0xac')]=_0x66df('0xad');_0x3b2946[_0x66df('0x9b')]=!![];_0x3b2946[_0x66df('0x93')]=moment()[_0x66df('0x50')](_0x66df('0x78'));_0x3b2946[_0x66df('0x89')]=moment()[_0x66df('0x50')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x66df('0x4c')](_0x66df('0xae'),_0xffe4d7[_0x66df('0x4f')],util[_0x66df('0x44')](_0x3b2946,{'showHidden':![],'depth':null}));ami[_0x66df('0x4a')](_0x66df('0xaf'),_0x3b2946);break;default:_0x3b2946[_0x66df('0x9b')]=!![];_0x3b2946[_0x66df('0x93')]=moment()['format'](_0x66df('0x78'));_0x3b2946[_0x66df('0x89')]=moment()['format'](_0x66df('0x78'));}_0x3b2946[_0x66df('0x3b')]=![];_0x3b2946[_0x66df('0xb0')]=null;_0x3b2946[_0x66df('0x57')]=_0xffe4d7['value'];this[_0x66df('0x14')][_0xffe4d7[_0x66df('0x4f')]]=_0x3b2946;this[_0x66df('0x55')](_0x3b2946,_0x66df('0x26'));}else if(this['isNotNull'](_0xffe4d7[_0x66df('0xa9')])&&this[_0x66df('0x60')](_0xffe4d7['variable']['queueposition'])){if(!_0x3b2946['queuecallerabandon']){_0x3b2946[_0x66df('0x9b')]=!![];_0x3b2946['queuecallerexitAt']=moment()[_0x66df('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x3b2946[_0x66df('0x57')]='EXITWITHKEY';_0x3b2946[_0x66df('0x89')]=moment()[_0x66df('0x50')](_0x66df('0x78'));this[_0x66df('0x14')][_0xffe4d7[_0x66df('0x4f')]]=_0x3b2946;}}logger['info'](_0x66df('0xb1'),_0xffe4d7['uniqueid'],_0x3b2946[_0x66df('0x52')],_0x3b2946[_0x66df('0x5b')],_[_0x66df('0x7f')](_0xffe4d7[_0x66df('0xa9')])[0x0],_0xffe4d7[_0x66df('0xaa')]);_0x3b2946[_0x66df('0x46')]=this[_0x66df('0x46')][_0xffe4d7[_0x66df('0x4f')]];}}}}catch(_0x4b4b5e){logger[_0x66df('0x42')](_0x66df('0xa7'),_0xffe4d7[_0x66df('0x4f')],util[_0x66df('0x44')](_0x4b4b5e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x66df('0xc')][_0x66df('0xa8')]=function(_0x48e7a2,_0x351959,_0x63ca7b){var _0x483a5e=['rtpaudioqos',_0x66df('0xb2'),_0x66df('0xb3'),'rtpaudioqosjitterbridged',_0x66df('0xb4'),_0x66df('0xb5'),_0x66df('0xb6'),'rtpaudioqosrttbridged',_0x66df('0xb7'),_0x66df('0xb8'),_0x66df('0xb9'),_0x66df('0xba'),_0x66df('0xbb'),_0x66df('0xbc'),_0x66df('0xbd'),_0x66df('0xbe'),_0x66df('0x92'),_0x66df('0xbf'),_0x66df('0xc0')];if(!_[_0x66df('0xc1')](_0x351959)&&!_[_0x66df('0xc2')](_0x483a5e,_0x351959)){if(_[_0x66df('0x61')](this[_0x66df('0x46')][_0x48e7a2])){this[_0x66df('0x46')][_0x48e7a2]={};}this[_0x66df('0x46')][_0x48e7a2][_0x351959]=_0x63ca7b;}};VoiceQueueReport['prototype'][_0x66df('0xc3')]=function(_0x1bb7ab,_0x29c749,_0x3d6f96){try{var _0x8bd22f={};if(this['queueReports'][_0x1bb7ab]){for(var _0x17ae31=0x0;_0x17ae31=0x0?moment(_0x414a62['endtime'])[_0x167c('0xf')](_0x414a62[_0x167c('0x1a')],_0x167c('0x11')):null,'data1':_0x167c('0x1c'),'data2':_0x414a62[_0x167c('0x16')],'data3':_0x414a62[_0x167c('0x14')],'data4':_0x414a62[_0x167c('0x1d')]||null,'role':_0x167c('0x15'),'internal':_0x414a62[_0x167c('0x16')]?_[_0x167c('0x1e')](_0x414a62['accountcode']):undefined,'uniqueid':_0x414a62[_0x167c('0x17')]},'log':_0x167c('0x7')});}; \ No newline at end of file +var _0x9dbc=['voiceDialReport','voice','membername','starttime','endtime','outbound','moment','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','interface','TALKING','queuecallerleaveAt','diff','seconds','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid'];(function(_0x2b5bd4,_0x1eeea5){var _0x2e86bc=function(_0x191cc6){while(--_0x191cc6){_0x2b5bd4['push'](_0x2b5bd4['shift']());}};_0x2e86bc(++_0x1eeea5);}(_0x9dbc,0x172));var _0xc9db=function(_0x33654f,_0x1313a8){_0x33654f=_0x33654f-0x0;var _0x1e01b4=_0x9dbc[_0x33654f];return _0x1e01b4;};'use strict';var moment=require(_0xc9db('0x0'));var _=require('lodash');var util=require(_0xc9db('0x1'));var client=require(_0xc9db('0x2'));exports['voiceQueueReport']=function(_0x130a1e){var _0x4f9b01=_0x130a1e[_0xc9db('0x3')]||_0x130a1e[_0xc9db('0x4')];return client[_0xc9db('0x5')](_0xc9db('0x6'),{'body':{'channel':'voice','membername':_0x130a1e[_0xc9db('0x7')],'interface':_['isNil'](_0x130a1e[_0xc9db('0x8')])?util['format']('SIP/%s',_0x130a1e[_0xc9db('0x7')]):_0x130a1e['interface'],'type':_0xc9db('0x9'),'enterAt':_0x130a1e[_0xc9db('0xa')],'exitAt':_0x4f9b01,'duration':moment(_0x4f9b01)[_0xc9db('0xb')](_0x130a1e['queuecallerleaveAt'],_0xc9db('0xc')),'data1':'inbound','data2':_0x130a1e[_0xc9db('0xd')],'data3':_0x130a1e[_0xc9db('0xe')],'data4':null,'data5':_0x130a1e[_0xc9db('0xf')],'role':_0xc9db('0x10'),'internal':_0x130a1e[_0xc9db('0x11')]?_[_0xc9db('0x12')](_0x130a1e['accountcode']):undefined,'uniqueid':_0x130a1e[_0xc9db('0x13')]},'log':_0xc9db('0x6')});};exports[_0xc9db('0x14')]=function(_0x1c6c44){return client[_0xc9db('0x5')](_0xc9db('0x6'),{'body':{'channel':_0xc9db('0x15'),'membername':_0x1c6c44[_0xc9db('0x16')],'interface':_0x1c6c44['interface'],'type':_0xc9db('0x9'),'enterAt':_0x1c6c44[_0xc9db('0x17')],'exitAt':_0x1c6c44['endtime'],'duration':moment(_0x1c6c44[_0xc9db('0x18')])[_0xc9db('0xb')](_0x1c6c44[_0xc9db('0x17')],'seconds')>=0x0?moment(_0x1c6c44['endtime'])['diff'](_0x1c6c44[_0xc9db('0x17')],_0xc9db('0xc')):null,'data1':_0xc9db('0x19'),'data2':_0x1c6c44[_0xc9db('0x11')],'data3':_0x1c6c44[_0xc9db('0xe')],'data4':_0x1c6c44['dialstring']||null,'role':_0xc9db('0x10'),'internal':_0x1c6c44[_0xc9db('0x11')]?_['toNumber'](_0x1c6c44['accountcode']):undefined,'uniqueid':_0x1c6c44[_0xc9db('0x13')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index e1674e4..4d8fa36 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b20=['Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings'];(function(_0x2ebceb,_0x300449){var _0x5e28c0=function(_0x454df1){while(--_0x454df1){_0x2ebceb['push'](_0x2ebceb['shift']());}};_0x5e28c0(++_0x300449);}(_0x4b20,0x116));var _0x04b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b20[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x04b2('0x0'));exports[_0x04b2('0x1')]=function(){return client[_0x04b2('0x2')](_0x04b2('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x04b2('0x4'),_0x04b2('0x5')]},'log':_0x04b2('0x6')});}; \ No newline at end of file +var _0x48bc=['../client','getSettings','Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x48bc,0x1b6));var _0xc48b=function(_0x14c751,_0x439963){_0x14c751=_0x14c751-0x0;var _0x433948=_0x48bc[_0x14c751];return _0x433948;};'use strict';var client=require(_0xc48b('0x0'));exports[_0xc48b('0x1')]=function(){return client[_0xc48b('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc48b('0x3'),_0xc48b('0x4')]},'log':_0xc48b('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index ddf9bba..f0145a5 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 _0xf6c1=['html','../client','GetTemplate','name'];(function(_0x157873,_0x192c4e){var _0x137f3d=function(_0x36f0ce){while(--_0x36f0ce){_0x157873['push'](_0x157873['shift']());}};_0x137f3d(++_0x192c4e);}(_0xf6c1,0x149));var _0x1f6c=function(_0x1c7f00,_0xa8c7e0){_0x1c7f00=_0x1c7f00-0x0;var _0x34be95=_0xf6c1[_0x1c7f00];return _0x34be95;};'use strict';var client=require(_0x1f6c('0x0'));exports['getTemplates']=function(_0x4a4c95){return function(_0x28a29e){return client['Request'](_0x1f6c('0x1'),{'options':{'raw':!![],'attributes':['id',_0x1f6c('0x2'),_0x1f6c('0x3')]},'log':_0x1f6c('0x1')});};}; \ No newline at end of file +var _0x560e=['html','getTemplates','GetTemplate','name'];(function(_0x5219e4,_0x5b574f){var _0x3f6e1e=function(_0x4b8c2f){while(--_0x4b8c2f){_0x5219e4['push'](_0x5219e4['shift']());}};_0x3f6e1e(++_0x5b574f);}(_0x560e,0x141));var _0xe560=function(_0x23cd3e,_0x4cd643){_0x23cd3e=_0x23cd3e-0x0;var _0x42c132=_0x560e[_0x23cd3e];return _0x42c132;};'use strict';var client=require('../client');exports[_0xe560('0x0')]=function(_0x14d043){return function(_0x549481){return client['Request'](_0xe560('0x1'),{'options':{'raw':!![],'attributes':['id',_0xe560('0x2'),_0xe560('0x3')]},'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 542320e..0806623 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 _0xdc28=['GetTrigger','name','channel','Condition','AllConditions','operator','value','AnyConditions','field','Action','action','data1','data2','data4','data5','data7','../client','getTriggers','Request'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0xdc28,0x166));var _0x8dc2=function(_0x2060a2,_0x5b190b){_0x2060a2=_0x2060a2-0x0;var _0x2aeeee=_0xdc28[_0x2060a2];return _0x2aeeee;};'use strict';var client=require(_0x8dc2('0x0'));exports[_0x8dc2('0x1')]=function(_0x5828d6){return function(_0x559e0d){return client[_0x8dc2('0x2')](_0x8dc2('0x3'),{'options':{'raw':![],'attributes':['id',_0x8dc2('0x4'),_0x8dc2('0x5'),'status'],'include':[{'model':_0x8dc2('0x6'),'as':_0x8dc2('0x7'),'attributes':['id','field',_0x8dc2('0x8'),_0x8dc2('0x9')]},{'model':_0x8dc2('0x6'),'as':_0x8dc2('0xa'),'attributes':['id',_0x8dc2('0xb'),_0x8dc2('0x8'),_0x8dc2('0x9')]},{'model':_0x8dc2('0xc'),'as':'Actions','attributes':['id',_0x8dc2('0xd'),_0x8dc2('0xe'),_0x8dc2('0xf'),'data3',_0x8dc2('0x10'),_0x8dc2('0x11'),'data6',_0x8dc2('0x12')]}]},'log':_0x8dc2('0x3')});};}; \ No newline at end of file +var _0xf440=['GetTrigger','name','Condition','AllConditions','field','operator','value','AnyConditions','action','data1','data2','data3','data5','data6','data7','../client','getTriggers','Request'];(function(_0x3fa431,_0x2b40cb){var _0x4e1e15=function(_0x161faf){while(--_0x161faf){_0x3fa431['push'](_0x3fa431['shift']());}};_0x4e1e15(++_0x2b40cb);}(_0xf440,0x189));var _0x0f44=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xf440[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0x0f44('0x0'));exports[_0x0f44('0x1')]=function(_0x44e1a8){return function(_0x561b41){return client[_0x0f44('0x2')](_0x0f44('0x3'),{'options':{'raw':![],'attributes':['id',_0x0f44('0x4'),'channel','status'],'include':[{'model':_0x0f44('0x5'),'as':_0x0f44('0x6'),'attributes':['id',_0x0f44('0x7'),_0x0f44('0x8'),_0x0f44('0x9')]},{'model':_0x0f44('0x5'),'as':_0x0f44('0xa'),'attributes':['id',_0x0f44('0x7'),_0x0f44('0x8'),_0x0f44('0x9')]},{'model':'Action','as':'Actions','attributes':['id',_0x0f44('0xb'),_0x0f44('0xc'),_0x0f44('0xd'),_0x0f44('0xe'),'data4',_0x0f44('0xf'),_0x0f44('0x10'),_0x0f44('0x11')]}]},'log':_0x0f44('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index d1ed3df..6e6b2ae 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 _0x5329=['registry','getTrunks','Request','GetTrunk','name'];(function(_0x532b24,_0x7bb352){var _0x443122=function(_0x1c6f70){while(--_0x1c6f70){_0x532b24['push'](_0x532b24['shift']());}};_0x443122(++_0x7bb352);}(_0x5329,0xab));var _0x9532=function(_0x164bf3,_0x5473c2){_0x164bf3=_0x164bf3-0x0;var _0x97fe6f=_0x5329[_0x164bf3];return _0x97fe6f;};'use strict';var client=require('../client');exports[_0x9532('0x0')]=function(_0xc9aa42){return function(_0x295436){return client[_0x9532('0x1')](_0x9532('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x9532('0x3'),_0x9532('0x4'),'defaultuser']},'log':_0x9532('0x2')});};}; \ No newline at end of file +var _0x32ff=['name','registry','defaultuser','../client','getTrunks','Request','GetTrunk'];(function(_0x3e5ae8,_0x487b95){var _0x3b0fc6=function(_0x3e9305){while(--_0x3e9305){_0x3e5ae8['push'](_0x3e5ae8['shift']());}};_0x3b0fc6(++_0x487b95);}(_0x32ff,0xc7));var _0xf32f=function(_0x19303c,_0x2e7ae2){_0x19303c=_0x19303c-0x0;var _0x357f9c=_0x32ff[_0x19303c];return _0x357f9c;};'use strict';var client=require(_0xf32f('0x0'));exports[_0xf32f('0x1')]=function(_0x3587a2){return function(_0x1e3aa3){return client[_0xf32f('0x2')](_0xf32f('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf32f('0x4'),_0xf32f('0x5'),_0xf32f('0x6')]},'log':_0xf32f('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 369c3c9..401a8f2 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe706,0xa3));var _0x6e70=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xe706[_0x160c73];return _0xd9302;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index d4fbf9e..1a7628d 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 _0xca4d=['UpdateVoiceAgentReport','create','CreateVoiceAgentReport'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xca4d,0x9a));var _0xdca4=function(_0x572492,_0x4cbe56){_0x572492=_0x572492-0x0;var _0x12987a=_0xca4d[_0x572492];return _0x12987a;};'use strict';var client=require('../client');exports[_0xdca4('0x0')]=function(_0x425b3d){return client['Request'](_0xdca4('0x1'),{'body':_0x425b3d,'log':_0xdca4('0x1')});};exports['update']=function(_0x4605c7,_0x556268,_0x3dd7c0){return client['Request'](_0xdca4('0x2'),{'body':_0x4605c7,'options':{'where':{'uniqueid':_0x556268,'interface':_0x3dd7c0,'agentcomplete':!![]}},'log':_0xdca4('0x2')});}; \ No newline at end of file +var _0x65e7=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0xfeb91e,_0x3c348b){var _0x5910d8=function(_0x4f294d){while(--_0x4f294d){_0xfeb91e['push'](_0xfeb91e['shift']());}};_0x5910d8(++_0x3c348b);}(_0x65e7,0xfe));var _0x765e=function(_0x2bb293,_0x3b3a15){_0x2bb293=_0x2bb293-0x0;var _0x2ae198=_0x65e7[_0x2bb293];return _0x2ae198;};'use strict';var client=require(_0x765e('0x0'));exports[_0x765e('0x1')]=function(_0x5e29e9){return client[_0x765e('0x2')](_0x765e('0x3'),{'body':_0x5e29e9,'log':_0x765e('0x3')});};exports[_0x765e('0x4')]=function(_0x357551,_0x40a341,_0x225103){return client[_0x765e('0x2')](_0x765e('0x5'),{'body':_0x357551,'options':{'where':{'uniqueid':_0x40a341,'interface':_0x225103,'agentcomplete':!![]}},'log':_0x765e('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 0d991c5..f48706c 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 _0x3e12=['Request','CreateVoiceCallReport','calleridnum','context','callerid','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds','moment','util','../client','create'];(function(_0x37986a,_0x240bda){var _0x85ace7=function(_0x7a783d){while(--_0x7a783d){_0x37986a['push'](_0x37986a['shift']());}};_0x85ace7(++_0x240bda);}(_0x3e12,0xc2));var _0x23e1=function(_0x2a2166,_0x3a077f){_0x2a2166=_0x2a2166-0x0;var _0x3bcf50=_0x3e12[_0x2a2166];return _0x3bcf50;};'use strict';var moment=require(_0x23e1('0x0'));var util=require(_0x23e1('0x1'));var _=require('lodash');var client=require(_0x23e1('0x2'));exports[_0x23e1('0x3')]=function(_0x5590b7){return client[_0x23e1('0x4')](_0x23e1('0x5'),{'body':_['merge'](_0x5590b7,{'source':_0x5590b7[_0x23e1('0x6')],'destinationcontext':_0x5590b7[_0x23e1('0x7')],'callerid':_0x5590b7[_0x23e1('0x8')],'amaflags':'DOCUMENTATION'}),'log':_0x23e1('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x23e1('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x23e1('0x9')],'createdAt':{'$between':[moment()[_0x23e1('0xa')](_0x23e1('0xb'))[_0x23e1('0xc')](_0x23e1('0xd')),moment()[_0x23e1('0xe')](_0x23e1('0xb'))['format'](_0x23e1('0xd'))]}},'attributes':['type',_0x23e1('0xf'),_0x23e1('0x10'),_0x23e1('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x9457=['calleridnum','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds','util','../client','create','Request','CreateVoiceCallReport','merge'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x9457,0x176));var _0x7945=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9457[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var util=require(_0x7945('0x0'));var _=require('lodash');var client=require(_0x7945('0x1'));exports[_0x7945('0x2')]=function(_0x3a5c32){return client[_0x7945('0x3')](_0x7945('0x4'),{'body':_[_0x7945('0x5')](_0x3a5c32,{'source':_0x3a5c32[_0x7945('0x6')],'destinationcontext':_0x3a5c32[_0x7945('0x7')],'callerid':_0x3a5c32['callerid'],'amaflags':_0x7945('0x8')}),'log':_0x7945('0x4')});};exports[_0x7945('0x9')]=function(){return function(){return client[_0x7945('0x3')](_0x7945('0xa'),{'options':{'where':{'type':[_0x7945('0xb')],'createdAt':{'$between':[moment()[_0x7945('0xc')](_0x7945('0xd'))[_0x7945('0xe')](_0x7945('0xf')),moment()[_0x7945('0x10')](_0x7945('0xd'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0x7945('0x11'),_0x7945('0x12'),_0x7945('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index f5f82a6..d930036 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 _0x3970=['create','Request','CreateVoiceDialReport','../client'];(function(_0x1f239e,_0x367b43){var _0x826971=function(_0x2c5777){while(--_0x2c5777){_0x1f239e['push'](_0x1f239e['shift']());}};_0x826971(++_0x367b43);}(_0x3970,0x147));var _0x0397=function(_0x38fb8b,_0x70dd0a){_0x38fb8b=_0x38fb8b-0x0;var _0x1ec681=_0x3970[_0x38fb8b];return _0x1ec681;};'use strict';var client=require(_0x0397('0x0'));exports[_0x0397('0x1')]=function(_0x4adb46){return client[_0x0397('0x2')]('CreateVoiceDialReport',{'body':_0x4adb46,'log':_0x0397('0x3')});}; \ No newline at end of file +var _0x9b99=['CreateVoiceDialReport','../client','create','Request'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0x9b99,0x141));var _0x99b9=function(_0x245714,_0x2a8a65){_0x245714=_0x245714-0x0;var _0x2caa48=_0x9b99[_0x245714];return _0x2caa48;};'use strict';var client=require(_0x99b9('0x0'));exports[_0x99b9('0x1')]=function(_0x3d8ef3){return client[_0x99b9('0x2')](_0x99b9('0x3'),{'body':_0x3d8ef3,'log':_0x99b9('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 5501d9c..71df592 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 _0x6ea9=['GetVoiceExtension','exten','../client','getVoiceExtensions','Request'];(function(_0x56eb89,_0xa70f63){var _0x237f9d=function(_0xee35df){while(--_0xee35df){_0x56eb89['push'](_0x56eb89['shift']());}};_0x237f9d(++_0xa70f63);}(_0x6ea9,0x89));var _0x96ea=function(_0xa859a2,_0x4beb72){_0xa859a2=_0xa859a2-0x0;var _0x2d796c=_0x6ea9[_0xa859a2];return _0x2d796c;};'use strict';var client=require(_0x96ea('0x0'));exports[_0x96ea('0x1')]=function(){return function(){return client[_0x96ea('0x2')](_0x96ea('0x3'),{'options':{'raw':!![],'attributes':['id',_0x96ea('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x96ea('0x1')});};}; \ No newline at end of file +var _0xd404=['getVoiceExtensions','GetVoiceExtension','exten','../client'];(function(_0x84772e,_0x54ab62){var _0x4482a3=function(_0x24ed50){while(--_0x24ed50){_0x84772e['push'](_0x84772e['shift']());}};_0x4482a3(++_0x54ab62);}(_0xd404,0x15b));var _0x4d40=function(_0x3ccb8b,_0x3c78a2){_0x3ccb8b=_0x3ccb8b-0x0;var _0x3757a9=_0xd404[_0x3ccb8b];return _0x3757a9;};'use strict';var client=require(_0x4d40('0x0'));exports[_0x4d40('0x1')]=function(){return function(){return client['Request'](_0x4d40('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4d40('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x4d40('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 84eb9e1..3947f40 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 _0x0884=['dialPreviewAutoRecallMe','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','Interval','getVoiceQueues','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold'];(function(_0x4ebe67,_0x3b8559){var _0x2ece89=function(_0xf7d805){while(--_0xf7d805){_0x4ebe67['push'](_0x4ebe67['shift']());}};_0x2ece89(++_0x3b8559);}(_0x0884,0x1cf));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x4088('0x0')]=function(){return function(){return client['Request'](_0x4088('0x1'),{'options':{'raw':![],'attributes':['id',_0x4088('0x2'),'acw',_0x4088('0x3'),_0x4088('0x4'),_0x4088('0x5'),'type','dialActive',_0x4088('0x6'),_0x4088('0x7'),_0x4088('0x8'),'dialPowerLevel',_0x4088('0x9'),_0x4088('0xa'),_0x4088('0xb'),_0x4088('0xc'),'dialOriginateCallerIdNumber','dialOriginateTimeout',_0x4088('0xd'),'dialQueueTimeout','dialQueueProject',_0x4088('0xe'),_0x4088('0xf'),'dialBusyMaxRetry',_0x4088('0x10'),_0x4088('0x11'),_0x4088('0x12'),_0x4088('0x13'),_0x4088('0x14'),_0x4088('0x15'),_0x4088('0x16'),_0x4088('0x17'),_0x4088('0x18'),_0x4088('0x19'),_0x4088('0x1a'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x4088('0x1b'),_0x4088('0x1c'),_0x4088('0x1d'),_0x4088('0x1e'),_0x4088('0x1f'),_0x4088('0x20'),_0x4088('0x21'),_0x4088('0x22'),'dialOrderByScheduledAt',_0x4088('0x23'),_0x4088('0x24'),_0x4088('0x25'),_0x4088('0x5'),_0x4088('0x26'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x4088('0x27'),_0x4088('0x28'),_0x4088('0x29'),'dialDropRetryFrequency',_0x4088('0x2a'),_0x4088('0x2b'),_0x4088('0x2c'),_0x4088('0x2d'),_0x4088('0x2e'),_0x4088('0x2f'),_0x4088('0x30'),_0x4088('0x31'),'dialPredictiveIntervalMinThreshold',_0x4088('0x32'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x4088('0x33'),'as':_0x4088('0x33'),'attributes':['id',_0x4088('0x2'),_0x4088('0x34'),'active']},{'model':_0x4088('0x35'),'as':_0x4088('0x36'),'attributes':['id',_0x4088('0x2')]},{'model':_0x4088('0x33'),'as':_0x4088('0x37'),'attributes':['id',_0x4088('0x2'),_0x4088('0x34'),'active']},{'model':_0x4088('0x38'),'as':_0x4088('0x38'),'attributes':['id',_0x4088('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x4088('0x2'),'interval']}]}]},'log':_0x4088('0x0')});};}; \ No newline at end of file +var _0x4df9=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','name','Interval','../client','getVoiceQueues','Request','GetVoiceQueue','acwTimeout','autopause','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x4f4b11,_0x3d5678){var _0x47f757=function(_0x54071f){while(--_0x54071f){_0x4f4b11['push'](_0x4f4b11['shift']());}};_0x47f757(++_0x3d5678);}(_0x4df9,0xd7));var _0x94df=function(_0x13ee5e,_0x5f3736){_0x13ee5e=_0x13ee5e-0x0;var _0x16af41=_0x4df9[_0x13ee5e];return _0x16af41;};'use strict';var client=require(_0x94df('0x0'));exports[_0x94df('0x1')]=function(){return function(){return client[_0x94df('0x2')](_0x94df('0x3'),{'options':{'raw':![],'attributes':['id','name','acw',_0x94df('0x4'),_0x94df('0x5'),'monitor_format','type',_0x94df('0x6'),'dialMethod',_0x94df('0x7'),_0x94df('0x8'),_0x94df('0x9'),_0x94df('0xa'),'dialPredictiveOptimizationPercentage',_0x94df('0xb'),_0x94df('0xc'),_0x94df('0xd'),_0x94df('0xe'),_0x94df('0xf'),_0x94df('0x10'),_0x94df('0x11'),_0x94df('0x12'),_0x94df('0x13'),'dialBusyMaxRetry',_0x94df('0x14'),_0x94df('0x15'),_0x94df('0x16'),_0x94df('0x17'),_0x94df('0x18'),_0x94df('0x19'),_0x94df('0x1a'),_0x94df('0x1b'),_0x94df('0x1c'),_0x94df('0x1d'),_0x94df('0x1e'),_0x94df('0x1f'),_0x94df('0x20'),'dialAMDMinWordLength',_0x94df('0x21'),_0x94df('0x22'),_0x94df('0x23'),'dialAMDMaximumWordLength','timeout',_0x94df('0x24'),_0x94df('0x25'),_0x94df('0x26'),_0x94df('0x27'),_0x94df('0x28'),_0x94df('0x29'),'monitor_format',_0x94df('0x2a'),_0x94df('0x2b'),_0x94df('0x2c'),_0x94df('0x2d'),'dialNoSuchNumberRetryFrequency',_0x94df('0x2e'),_0x94df('0x2f'),_0x94df('0x30'),_0x94df('0x31'),_0x94df('0x32'),_0x94df('0x33'),_0x94df('0x34'),_0x94df('0x35'),_0x94df('0x36'),_0x94df('0x37'),_0x94df('0x38'),_0x94df('0x39'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0x94df('0x3a'),'attributes':['id','name',_0x94df('0x3b'),_0x94df('0x3c')]},{'model':_0x94df('0x3d'),'as':_0x94df('0x3e'),'attributes':['id','name']},{'model':_0x94df('0x3a'),'as':_0x94df('0x3f'),'attributes':['id',_0x94df('0x40'),'callerid',_0x94df('0x3c')]},{'model':_0x94df('0x41'),'as':_0x94df('0x41'),'attributes':['id','name'],'include':[{'model':_0x94df('0x41'),'as':'Intervals','attributes':['id','name','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 7051582..f115856 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(_0x5cb6af,_0x5c42e3){var _0x2b27e0=function(_0x33ab3a){while(--_0x33ab3a){_0x5cb6af['push'](_0x5cb6af['shift']());}};_0x2b27e0(++_0x5c42e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x331641,_0x113877){var _0x373eb0=function(_0x192313){while(--_0x192313){_0x331641['push'](_0x331641['shift']());}};_0x373eb0(++_0x113877);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 54529bc..9cc6050 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 _0xb4d2=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x33723d,_0x4b74b0){var _0x13f7bc=function(_0x4a3a50){while(--_0x4a3a50){_0x33723d['push'](_0x33723d['shift']());}};_0x13f7bc(++_0x4b74b0);}(_0xb4d2,0x6a));var _0x2b4d=function(_0x33705b,_0x27d6c4){_0x33705b=_0x33705b-0x0;var _0x55b837=_0xb4d2[_0x33705b];return _0x55b837;};'use strict';var client=require('../client');exports[_0x2b4d('0x0')]=function(_0xfdc9e5){return function(){return client[_0x2b4d('0x1')](_0x2b4d('0x2'),{'options':{'where':{'VoiceQueueId':_0xfdc9e5,'paused':!![]},'raw':!![]},'log':_0x2b4d('0x0')});};}; \ No newline at end of file +var _0x9cf6=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x50aba6,_0xc3e265){var _0x3eec74=function(_0x15b017){while(--_0x15b017){_0x50aba6['push'](_0x50aba6['shift']());}};_0x3eec74(++_0xc3e265);}(_0x9cf6,0x16c));var _0x69cf=function(_0x29267f,_0x5497fb){_0x29267f=_0x29267f-0x0;var _0x5461e6=_0x9cf6[_0x29267f];return _0x5461e6;};'use strict';var client=require(_0x69cf('0x0'));exports[_0x69cf('0x1')]=function(_0x437d75){return function(){return client['Request'](_0x69cf('0x2'),{'options':{'where':{'VoiceQueueId':_0x437d75,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index b0845fb..9d7ee29 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x468c8f,_0x3ac2c4){var _0x30d3af=function(_0x56d3c7){while(--_0x56d3c7){_0x468c8f['push'](_0x468c8f['shift']());}};_0x30d3af(++_0x3ac2c4);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x1965a2,_0x5b6955){var _0x241a22=function(_0xe1bb93){while(--_0xe1bb93){_0x1965a2['push'](_0x1965a2['shift']());}};_0x241a22(++_0x5b6955);}(_0x7a54,0x106));var _0x47a5=function(_0x38825e,_0x1e5bdd){_0x38825e=_0x38825e-0x0;var _0x534c8e=_0x7a54[_0x38825e];return _0x534c8e;};'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 fd05ac1..c066d46 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 _0xea43=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridname'];(function(_0x1721d3,_0x37c184){var _0xed4e63=function(_0x8b3b8a){while(--_0x8b3b8a){_0x1721d3['push'](_0x1721d3['shift']());}};_0xed4e63(++_0x37c184);}(_0xea43,0x16f));var _0x3ea4=function(_0x17c1ac,_0xac6ad6){_0x17c1ac=_0x17c1ac-0x0;var _0x517769=_0xea43[_0x17c1ac];return _0x517769;};'use strict';var client=require(_0x3ea4('0x0'));exports[_0x3ea4('0x1')]={};exports[_0x3ea4('0x2')]=function(_0x4f6d86){return client[_0x3ea4('0x3')](_0x3ea4('0x4'),{'body':{'result':_0x4f6d86['result'],'transfererchannel':_0x4f6d86['transfererchannel'],'transferercalleridnum':_0x4f6d86[_0x3ea4('0x5')],'transferercalleridname':_0x4f6d86['transferercalleridname'],'transfererconnectedlinenum':_0x4f6d86[_0x3ea4('0x6')],'transfererconnectedlinename':_0x4f6d86['transfererconnectedlinename'],'transfereraccountcode':_0x4f6d86[_0x3ea4('0x7')],'transferercontext':_0x4f6d86[_0x3ea4('0x8')],'transfererexten':_0x4f6d86[_0x3ea4('0x9')],'transfererlinkedid':_0x4f6d86[_0x3ea4('0xa')],'transfereechannel':_0x4f6d86['transfereechannel'],'transfereecalleridnum':_0x4f6d86[_0x3ea4('0xb')],'transfereecalleridname':_0x4f6d86['transfereecalleridname'],'transfereeconnectedlinenum':_0x4f6d86['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x4f6d86[_0x3ea4('0xc')],'transfereeaccountcode':_0x4f6d86[_0x3ea4('0xd')],'transfereecontext':_0x4f6d86['transfereecontext'],'transfereeexten':_0x4f6d86[_0x3ea4('0xe')],'transfereelinkedid':_0x4f6d86[_0x3ea4('0xf')],'isexternal':_0x4f6d86[_0x3ea4('0x10')],'context':_0x4f6d86[_0x3ea4('0x11')],'extension':_0x4f6d86['extension'],'type':'blind'},'log':_0x3ea4('0x4')});};exports[_0x3ea4('0x12')]=function(_0x1a672c){return client[_0x3ea4('0x3')](_0x3ea4('0x4'),{'body':{'result':_0x1a672c['result'],'transfererchannel':_0x1a672c[_0x3ea4('0x13')],'transferercalleridnum':_0x1a672c[_0x3ea4('0x14')],'transferercalleridname':_0x1a672c[_0x3ea4('0x15')],'transfererconnectedlinenum':_0x1a672c[_0x3ea4('0x16')],'transfererconnectedlinename':_0x1a672c[_0x3ea4('0x17')],'transfereraccountcode':_0x1a672c[_0x3ea4('0x18')],'transferercontext':_0x1a672c[_0x3ea4('0x19')],'transfererexten':_0x1a672c[_0x3ea4('0x1a')],'transfererlinkedid':_0x1a672c[_0x3ea4('0x1b')],'transfereechannel':_0x1a672c['transfertargetchannel'],'transfereecalleridnum':_0x1a672c['transfertargetcalleridnum'],'transfereecalleridname':_0x1a672c[_0x3ea4('0x1c')],'transfereeconnectedlinenum':_0x1a672c[_0x3ea4('0x1d')],'transfereeconnectedlinename':_0x1a672c[_0x3ea4('0x1e')],'transfereeaccountcode':_0x1a672c[_0x3ea4('0x1f')],'transfereecontext':_0x1a672c[_0x3ea4('0x20')],'transfereeexten':_0x1a672c['transfertargetexten'],'transfereelinkedid':_0x1a672c['transfertargetlinkedid'],'isexternal':_0x1a672c[_0x3ea4('0x10')],'context':_0x1a672c[_0x3ea4('0x21')],'extension':_0x1a672c[_0x3ea4('0x22')],'type':_0x3ea4('0x23')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x46c6=['origtransfererexten','attended','transfers','Request','result','transfererchannel','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext'];(function(_0x1d90ca,_0x3bab16){var _0x28872b=function(_0x3ea71b){while(--_0x3ea71b){_0x1d90ca['push'](_0x1d90ca['shift']());}};_0x28872b(++_0x3bab16);}(_0x46c6,0x11a));var _0x646c=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x46c6[_0x819464];return _0x49dcc0;};'use strict';var client=require('../client');exports[_0x646c('0x0')]={};exports['blindTransfer']=function(_0x3100da){return client[_0x646c('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x3100da[_0x646c('0x2')],'transfererchannel':_0x3100da[_0x646c('0x3')],'transferercalleridnum':_0x3100da['transferercalleridnum'],'transferercalleridname':_0x3100da['transferercalleridname'],'transfererconnectedlinenum':_0x3100da['transfererconnectedlinenum'],'transfererconnectedlinename':_0x3100da[_0x646c('0x4')],'transfereraccountcode':_0x3100da[_0x646c('0x5')],'transferercontext':_0x3100da['transferercontext'],'transfererexten':_0x3100da[_0x646c('0x6')],'transfererlinkedid':_0x3100da[_0x646c('0x7')],'transfereechannel':_0x3100da[_0x646c('0x8')],'transfereecalleridnum':_0x3100da[_0x646c('0x9')],'transfereecalleridname':_0x3100da[_0x646c('0xa')],'transfereeconnectedlinenum':_0x3100da[_0x646c('0xb')],'transfereeconnectedlinename':_0x3100da[_0x646c('0xc')],'transfereeaccountcode':_0x3100da[_0x646c('0xd')],'transfereecontext':_0x3100da[_0x646c('0xe')],'transfereeexten':_0x3100da[_0x646c('0xf')],'transfereelinkedid':_0x3100da[_0x646c('0x10')],'isexternal':_0x3100da[_0x646c('0x11')],'context':_0x3100da[_0x646c('0x12')],'extension':_0x3100da['extension'],'type':_0x646c('0x13')},'log':_0x646c('0x14')});};exports[_0x646c('0x15')]=function(_0x525dfc){return client[_0x646c('0x1')](_0x646c('0x14'),{'body':{'result':_0x525dfc[_0x646c('0x2')],'transfererchannel':_0x525dfc[_0x646c('0x16')],'transferercalleridnum':_0x525dfc[_0x646c('0x17')],'transferercalleridname':_0x525dfc['origtransferercalleridname'],'transfererconnectedlinenum':_0x525dfc[_0x646c('0x18')],'transfererconnectedlinename':_0x525dfc[_0x646c('0x19')],'transfereraccountcode':_0x525dfc[_0x646c('0x1a')],'transferercontext':_0x525dfc['secondtransferercontext'],'transfererexten':_0x525dfc[_0x646c('0x1b')],'transfererlinkedid':_0x525dfc[_0x646c('0x1c')],'transfereechannel':_0x525dfc['transfertargetchannel'],'transfereecalleridnum':_0x525dfc[_0x646c('0x1d')],'transfereecalleridname':_0x525dfc[_0x646c('0x1e')],'transfereeconnectedlinenum':_0x525dfc[_0x646c('0x1f')],'transfereeconnectedlinename':_0x525dfc[_0x646c('0x20')],'transfereeaccountcode':_0x525dfc[_0x646c('0x21')],'transfereecontext':_0x525dfc[_0x646c('0x22')],'transfereeexten':_0x525dfc[_0x646c('0x23')],'transfereelinkedid':_0x525dfc[_0x646c('0x24')],'isexternal':_0x525dfc[_0x646c('0x11')],'context':_0x525dfc[_0x646c('0x25')],'extension':_0x525dfc[_0x646c('0x26')],'type':_0x646c('0x27')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index f587292..2885e90 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 _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x135ed1,_0x5de0c5){var _0x2c3f0d=function(_0x5102d1){while(--_0x5102d1){_0x135ed1['push'](_0x135ed1['shift']());}};_0x2c3f0d(++_0x5de0c5);}(_0xb10b,0x12a));var _0xbb10=function(_0x2009cd,_0x549a5d){_0x2009cd=_0x2009cd-0x0;var _0x509e8a=_0xb10b[_0x2009cd];return _0x509e8a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x11e6f8,_0x5c6e8b){var _0x10d812=function(_0x117abf){while(--_0x117abf){_0x11e6f8['push'](_0x11e6f8['shift']());}};_0x10d812(++_0x5c6e8b);}(_0xb10b,0x12a));var _0xbb10=function(_0x4e0c31,_0x208e9f){_0x4e0c31=_0x4e0c31-0x0;var _0x3fd7df=_0xb10b[_0x4e0c31];return _0x3fd7df;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+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 883c85a..1dc513b 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 _0x22fb=['lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','exec','data1','isNil','data5','xmd-contactid','data3','split','phone','$or','map','destcalleridnum','calleridnum','routeId','mobile','fax','ListId','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','toLowerCase','merge'];(function(_0x1a6304,_0x37b41e){var _0x825ac7=function(_0x342321){while(--_0x342321){_0x1a6304['push'](_0x1a6304['shift']());}};_0x825ac7(++_0x37b41e);}(_0x22fb,0x18f));var _0xb22f=function(_0xec6bc3,_0x59e93f){_0xec6bc3=_0xec6bc3-0x0;var _0x47f488=_0x22fb[_0xec6bc3];return _0x47f488;};'use strict';var _=require(_0xb22f('0x0'));var BPromise=require(_0xb22f('0x1'));var Redis=require(_0xb22f('0x2'));var util=require('util');var config=require(_0xb22f('0x3'));var logger=require(_0xb22f('0x4'))('trigger');var cmContactRpc=require(_0xb22f('0x5'));config[_0xb22f('0x6')]=_[_0xb22f('0x7')](config[_0xb22f('0x6')],{'host':_0xb22f('0x8'),'port':0x18eb});var io=require(_0xb22f('0x9'))(new Redis(config[_0xb22f('0x6')]));function emit(_0x5bf93a,_0x2fe563,_0x5e1f1b,_0x5465c5,_0x37d0ca){logger[_0xb22f('0xa')]('[CM][%s][%s]',_0x5bf93a,_0x2fe563['id'],_0x5e1f1b,_0x5465c5,JSON[_0xb22f('0xb')](_0x37d0ca));io['to'](_0x5e1f1b)[_0xb22f('0xc')](_0x5465c5,_0x37d0ca);}exports[_0xb22f('0xd')]=function(_0x1ba770,_0x11b3fe,_0x30c0bb,_0x39f75c){var _0x4a61e0,_0x4791c8;var _0x4859a7={};var _0x3937e1;var _0x405a9f=Number(_0x30c0bb[_0xb22f('0xe')]);var _0x1fc5fd=_0x30c0bb['data2']?Boolean(Number(_0x30c0bb['data2'])):![];var _0x27edaa;var _0x14efa8=![];if(!_[_0xb22f('0xf')](_0x30c0bb[_0xb22f('0x10')])){if(_0x30c0bb[_0xb22f('0x10')]=='1')_0x14efa8=!![];}if(!_0x14efa8){if(_0x39f75c['xmd-contactid']){_0x4859a7['id']=_0x39f75c[_0xb22f('0x11')];}}if(!_0x4859a7['id']){_0x4859a7['ListId']=_0x405a9f;_0x27edaa=_0x30c0bb[_0xb22f('0x12')]&&_0x30c0bb[_0xb22f('0x12')]!=='0'?_0x30c0bb[_0xb22f('0x12')][_0xb22f('0x13')](','):[_0xb22f('0x14')];_0x4859a7[_0xb22f('0x15')]=_[_0xb22f('0x16')](_0x27edaa,function(_0x55f289){var _0x14ecc1={};_0x14ecc1[_0x55f289]=_0x39f75c['routeId']?_0x39f75c[_0xb22f('0x17')]:_0x39f75c[_0xb22f('0x18')];return _0x14ecc1;});_0x3937e1=_0x39f75c[_0xb22f('0x19')]?_0x39f75c[_0xb22f('0x17')]:_0x39f75c[_0xb22f('0x18')];}var _0x1d2846=['id','firstName','lastName',_0xb22f('0x14'),_0xb22f('0x1a'),_0xb22f('0x1b'),_0xb22f('0x1c'),_0xb22f('0x1d'),_0xb22f('0x1e'),_0xb22f('0x1f')];var _0x676b41=_[_0xb22f('0x20')](_0x1d2846,_0x27edaa);BPromise[_0xb22f('0x21')]()[_0xb22f('0x22')](cmContactRpc[_0xb22f('0x23')]({'attributes':_0x676b41,'where':_0x4859a7,'phone':_0x3937e1}))[_0xb22f('0x22')](function(_0x3b074e){_0x4791c8=_0x3b074e;if(!_[_0xb22f('0x24')](_0x4791c8)){if(_0x4791c8[_0xb22f('0x25')]===0x1){_0x4a61e0=_0x4791c8[0x0];logger[_0xb22f('0xa')](_0xb22f('0x26'),_0x39f75c[_0xb22f('0x27')],_0x11b3fe['id'],_0x4a61e0['id']);}else{logger[_0xb22f('0xa')](_0xb22f('0x28'),_0x39f75c[_0xb22f('0x27')],_0x11b3fe['id'],_[_0xb22f('0x16')](_0x4791c8,'id')[_0xb22f('0x29')](','));}return;}else{logger[_0xb22f('0xa')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x39f75c['uniqueid'],_0x11b3fe['id']);var _0x4ff759={'ListId':_0x405a9f};var _0x53871d=_0x30c0bb[_0xb22f('0x2a')]&&_0x30c0bb['data4']!=='0'?_0x30c0bb[_0xb22f('0x2a')]:_0xb22f('0x14');if(_0x1fc5fd){logger[_0xb22f('0xa')](_0xb22f('0x2b'),_0x39f75c[_0xb22f('0x27')],_0x11b3fe['id']);_0x4ff759[_0x53871d]=_['isNil'](_0x39f75c['routeId'])?_0x39f75c['calleridnum']:_0x39f75c[_0xb22f('0x17')];if(_[_0xb22f('0xf')](_0x39f75c[_0xb22f('0x19')])){_0x4ff759[_0xb22f('0x2c')]=_0x39f75c[_0xb22f('0x2d')]&&_0x39f75c[_0xb22f('0x2d')]!==_0xb22f('0x2e')?_0x39f75c[_0xb22f('0x2d')]:_0xb22f('0x2f');}else{_0x4ff759[_0xb22f('0x2c')]=_0x39f75c[_0xb22f('0x30')]&&_0x39f75c[_0xb22f('0x30')]!==_0xb22f('0x2e')?_0x39f75c[_0xb22f('0x30')]:_0xb22f('0x2f');}return BPromise[_0xb22f('0x21')]()[_0xb22f('0x22')](cmContactRpc[_0xb22f('0x31')](_0x4ff759))[_0xb22f('0x22')](function(_0x1c723f){_0x4a61e0=_0x1c723f;_0x4791c8[_0xb22f('0x32')](_0x1c723f);if(_0x4a61e0){logger[_0xb22f('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x39f75c[_0xb22f('0x27')],_0x11b3fe['id'],_0x4a61e0['id']);}return;});}else{logger[_0xb22f('0xa')](_0xb22f('0x33'),_0x39f75c[_0xb22f('0x27')],_0x11b3fe['id']);_0x4ff759[_0x53871d]=_[_0xb22f('0xf')](_0x39f75c['routeId'])?_0x39f75c[_0xb22f('0x18')]:_0x39f75c[_0xb22f('0x17')];if(_[_0xb22f('0xf')](_0x39f75c[_0xb22f('0x19')])){_0x4ff759[_0xb22f('0x2c')]=_0x39f75c[_0xb22f('0x2d')]&&_0x39f75c[_0xb22f('0x2d')]!==_0xb22f('0x2e')?_0x39f75c[_0xb22f('0x2d')]:_0xb22f('0x2f');}else{_0x4ff759[_0xb22f('0x2c')]=_0x39f75c[_0xb22f('0x30')]&&_0x39f75c[_0xb22f('0x30')]!==_0xb22f('0x2e')?_0x39f75c['destcalleridname']:'Unknown';}_0x4a61e0=_0x4ff759;_0x4791c8[_0xb22f('0x32')](_0x4ff759);return;}}})[_0xb22f('0x22')](function(){if(_0x1ba770){emit(_0x39f75c[_0xb22f('0x27')],_0x11b3fe,util[_0xb22f('0x34')](_0xb22f('0x35'),_0x1ba770[_0xb22f('0x36')]),util[_0xb22f('0x34')]('trigger:%s',_0x30c0bb['action'][_0xb22f('0x37')]()),{'evt':_[_0xb22f('0x38')](_0x39f75c,{'autoCreate':_0x1fc5fd}),'contact':_0x4a61e0===undefined?{}:_0x4a61e0,'contacts':_0x4791c8['length']===0x0?undefined:_0x4791c8});}});}; \ No newline at end of file +var _0x36e2=['then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Contact\x20not\x20found','firstName','calleridname','','destcalleridname','Unknown','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data2','isNil','data5','xmd-contactid','ListId','data3','split','$or','map','routeId','destcalleridnum','calleridnum','phone','mobile','fax','createdAt','updatedAt','resolve'];(function(_0x24f847,_0x586340){var _0x1de50f=function(_0x57b0e0){while(--_0x57b0e0){_0x24f847['push'](_0x24f847['shift']());}};_0x1de50f(++_0x586340);}(_0x36e2,0xdc));var _0x236e=function(_0x506797,_0x226668){_0x506797=_0x506797-0x0;var _0x3dc2b4=_0x36e2[_0x506797];return _0x3dc2b4;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0x236e('0x0'));var util=require(_0x236e('0x1'));var config=require(_0x236e('0x2'));var logger=require(_0x236e('0x3'))(_0x236e('0x4'));var cmContactRpc=require(_0x236e('0x5'));config[_0x236e('0x6')]=_['defaults'](config[_0x236e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x236e('0x7'))(new Redis(config[_0x236e('0x6')]));function emit(_0x1fad05,_0x4aa7b6,_0x380c36,_0x3d321e,_0x670f9f){logger[_0x236e('0x8')](_0x236e('0x9'),_0x1fad05,_0x4aa7b6['id'],_0x380c36,_0x3d321e,JSON[_0x236e('0xa')](_0x670f9f));io['to'](_0x380c36)[_0x236e('0xb')](_0x3d321e,_0x670f9f);}exports['exec']=function(_0x1674a4,_0x5d7cb4,_0x56ab4e,_0x4d8908){var _0x41bc58,_0xb0546b;var _0x282433={};var _0xe81e7e;var _0x4bfe78=Number(_0x56ab4e['data1']);var _0x2e5f41=_0x56ab4e['data2']?Boolean(Number(_0x56ab4e[_0x236e('0xc')])):![];var _0x98181c;var _0x356edb=![];if(!_[_0x236e('0xd')](_0x56ab4e[_0x236e('0xe')])){if(_0x56ab4e['data5']=='1')_0x356edb=!![];}if(!_0x356edb){if(_0x4d8908[_0x236e('0xf')]){_0x282433['id']=_0x4d8908['xmd-contactid'];}}if(!_0x282433['id']){_0x282433[_0x236e('0x10')]=_0x4bfe78;_0x98181c=_0x56ab4e['data3']&&_0x56ab4e[_0x236e('0x11')]!=='0'?_0x56ab4e[_0x236e('0x11')][_0x236e('0x12')](','):['phone'];_0x282433[_0x236e('0x13')]=_[_0x236e('0x14')](_0x98181c,function(_0x535079){var _0x3d27ec={};_0x3d27ec[_0x535079]=_0x4d8908[_0x236e('0x15')]?_0x4d8908[_0x236e('0x16')]:_0x4d8908[_0x236e('0x17')];return _0x3d27ec;});_0xe81e7e=_0x4d8908['routeId']?_0x4d8908[_0x236e('0x16')]:_0x4d8908['calleridnum'];}var _0x4c5505=['id','firstName','lastName',_0x236e('0x18'),_0x236e('0x19'),_0x236e('0x1a'),_0x236e('0x10'),_0x236e('0x1b'),'scheduledAt',_0x236e('0x1c')];var _0x1611a5=_['union'](_0x4c5505,_0x98181c);BPromise[_0x236e('0x1d')]()[_0x236e('0x1e')](cmContactRpc[_0x236e('0x1f')]({'attributes':_0x1611a5,'where':_0x282433,'phone':_0xe81e7e}))[_0x236e('0x1e')](function(_0x39e721){_0xb0546b=_0x39e721;if(!_[_0x236e('0x20')](_0xb0546b)){if(_0xb0546b[_0x236e('0x21')]===0x1){_0x41bc58=_0xb0546b[0x0];logger['info'](_0x236e('0x22'),_0x4d8908[_0x236e('0x23')],_0x5d7cb4['id'],_0x41bc58['id']);}else{logger[_0x236e('0x8')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x4d8908[_0x236e('0x23')],_0x5d7cb4['id'],_[_0x236e('0x14')](_0xb0546b,'id')['join'](','));}return;}else{logger[_0x236e('0x8')](_0x236e('0x24'),_0x4d8908[_0x236e('0x23')],_0x5d7cb4['id']);var _0x436962={'ListId':_0x4bfe78};var _0x8cdc6=_0x56ab4e['data4']&&_0x56ab4e['data4']!=='0'?_0x56ab4e['data4']:_0x236e('0x18');if(_0x2e5f41){logger[_0x236e('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x4d8908[_0x236e('0x23')],_0x5d7cb4['id']);_0x436962[_0x8cdc6]=_['isNil'](_0x4d8908[_0x236e('0x15')])?_0x4d8908[_0x236e('0x17')]:_0x4d8908[_0x236e('0x16')];if(_[_0x236e('0xd')](_0x4d8908['routeId'])){_0x436962[_0x236e('0x25')]=_0x4d8908[_0x236e('0x26')]&&_0x4d8908[_0x236e('0x26')]!==_0x236e('0x27')?_0x4d8908['calleridname']:'Unknown';}else{_0x436962[_0x236e('0x25')]=_0x4d8908[_0x236e('0x28')]&&_0x4d8908['destcalleridname']!==''?_0x4d8908[_0x236e('0x28')]:_0x236e('0x29');}return BPromise[_0x236e('0x1d')]()['then'](cmContactRpc['createContact'](_0x436962))[_0x236e('0x1e')](function(_0x5198c6){_0x41bc58=_0x5198c6;_0xb0546b[_0x236e('0x2a')](_0x5198c6);if(_0x41bc58){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x4d8908[_0x236e('0x23')],_0x5d7cb4['id'],_0x41bc58['id']);}return;});}else{logger[_0x236e('0x8')](_0x236e('0x2b'),_0x4d8908[_0x236e('0x23')],_0x5d7cb4['id']);_0x436962[_0x8cdc6]=_[_0x236e('0xd')](_0x4d8908[_0x236e('0x15')])?_0x4d8908[_0x236e('0x17')]:_0x4d8908[_0x236e('0x16')];if(_[_0x236e('0xd')](_0x4d8908['routeId'])){_0x436962[_0x236e('0x25')]=_0x4d8908[_0x236e('0x26')]&&_0x4d8908[_0x236e('0x26')]!==_0x236e('0x27')?_0x4d8908[_0x236e('0x26')]:_0x236e('0x29');}else{_0x436962['firstName']=_0x4d8908[_0x236e('0x28')]&&_0x4d8908[_0x236e('0x28')]!==''?_0x4d8908[_0x236e('0x28')]:_0x236e('0x29');}_0x41bc58=_0x436962;_0xb0546b[_0x236e('0x2a')](_0x436962);return;}}})['then'](function(){if(_0x1674a4){emit(_0x4d8908[_0x236e('0x23')],_0x5d7cb4,util[_0x236e('0x2c')](_0x236e('0x2d'),_0x1674a4[_0x236e('0x2e')]),util[_0x236e('0x2c')](_0x236e('0x2f'),_0x56ab4e[_0x236e('0x30')][_0x236e('0x31')]()),{'evt':_['merge'](_0x4d8908,{'autoCreate':_0x2e5f41}),'contact':_0x41bc58===undefined?{}:_0x41bc58,'contacts':_0xb0546b[_0x236e('0x21')]===0x0?undefined:_0xb0546b});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 6d3056a..9d2b1ab 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 _0x80eb=['chat','ChatWebsiteId','value','upperFirst','AccountId','interaction','message','event','agent','operator','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','util','url','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','info','stringify','emit','clone','motionChannel','undefined','inspect','checkTriggers','hasOwnProperty','status','checkTrigger','merge','Actions','length','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','data2','html','render','template\x20not\x20found','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','600','data6','winArguments','format','user:%s','name','jscripty','trigger:%s','exec','integration','accounts','queue','routeId','urlforward','script','buildUri','parse','replace','channel','every','AllConditions','checkConditions','AnyConditions','some','debug','checkTrigger:\x20trigger','evt','field','account'];(function(_0x46ae9b,_0x13e738){var _0x4baf68=function(_0x31eac7){while(--_0x31eac7){_0x46ae9b['push'](_0x46ae9b['shift']());}};_0x4baf68(++_0x13e738);}(_0x80eb,0x118));var _0xb80e=function(_0x313935,_0x59c823){_0x313935=_0x313935-0x0;var _0x35c3be=_0x80eb[_0x313935];return _0x35c3be;};'use strict';var util=require(_0xb80e('0x0'));var _=require('lodash');var url=require(_0xb80e('0x1'));var Mustache=require(_0xb80e('0x2'));var Redis=require(_0xb80e('0x3'));var urlforward=require(_0xb80e('0x4'));var integration=require('./integration');var cmContact=require(_0xb80e('0x5'));var script=require(_0xb80e('0x6'));var config=require(_0xb80e('0x7'));var logger=require(_0xb80e('0x8'))(_0xb80e('0x9'));var ami=require(_0xb80e('0xa'));config[_0xb80e('0xb')]=_['defaults'](config[_0xb80e('0xb')],{'host':_0xb80e('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb80e('0xb')]));var operators={'equals':function(_0x3d70fc,_0xb175e4){return _0x3d70fc==_0xb175e4;},'not_equals':function(_0xbc48cf,_0x5ece5e){return _0xbc48cf!=_0x5ece5e;}};var barAndWebActions=[_0xb80e('0xd'),_0xb80e('0x1'),_0xb80e('0xe')];function Trigger(_0x298f60){this[_0xb80e('0xf')]=_0x298f60[_0xb80e('0xf')];this[_0xb80e('0x10')]=_0x298f60[_0xb80e('0x10')];this[_0xb80e('0x11')]=_0x298f60['voiceQueues'];this[_0xb80e('0x12')]=_0x298f60[_0xb80e('0x12')];this[_0xb80e('0x13')]=_0x298f60[_0xb80e('0x13')];this[_0xb80e('0x14')]=_0x298f60[_0xb80e('0x14')];this[_0xb80e('0x15')]=_0x298f60[_0xb80e('0x15')];this[_0xb80e('0x16')]=_0x298f60[_0xb80e('0x16')];this[_0xb80e('0x17')]=_0x298f60[_0xb80e('0x17')];this[_0xb80e('0x18')]=_0x298f60[_0xb80e('0x18')];this[_0xb80e('0x19')]=_0x298f60[_0xb80e('0x19')];this['vtigerAccounts']=_0x298f60[_0xb80e('0x1a')];this['servicenowAccounts']=_0x298f60[_0xb80e('0x1b')];this[_0xb80e('0x1c')]=_0x298f60[_0xb80e('0x1c')];this[_0xb80e('0x1d')]=_0x298f60[_0xb80e('0x1d')];this['accounts']={'zendesk':this[_0xb80e('0x14')],'salesforce':this[_0xb80e('0x16')],'freshdesk':this[_0xb80e('0x15')],'sugarcrm':this[_0xb80e('0x17')],'zoho':this[_0xb80e('0x18')],'desk':this[_0xb80e('0x19')],'vtiger':this[_0xb80e('0x1a')],'dynamics365':this[_0xb80e('0x1c')],'freshsales':this[_0xb80e('0x1d')],'servicenow':this[_0xb80e('0x1b')]};ami['on'](_0xb80e('0x1e'),this[_0xb80e('0x1f')]['bind'](this));ami['on']('custom:agentconnect',this[_0xb80e('0x1f')][_0xb80e('0x20')](this));ami['on'](_0xb80e('0x21'),this['syncCustomEvent'][_0xb80e('0x20')](this));ami['on']('custom:agentcomplete',this[_0xb80e('0x1f')][_0xb80e('0x20')](this));ami['on'](_0xb80e('0x22'),this['syncCustomEvent'][_0xb80e('0x20')](this));ami['on'](_0xb80e('0x23'),this[_0xb80e('0x1f')][_0xb80e('0x20')](this));ami['on'](_0xb80e('0x24'),this[_0xb80e('0x1f')]['bind'](this));ami['on'](_0xb80e('0x25'),this['syncCustomEvent']['bind'](this));ami['on'](_0xb80e('0x26'),this[_0xb80e('0x1f')][_0xb80e('0x20')](this));ami['on'](_0xb80e('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0xb80e('0x28'),this[_0xb80e('0x1f')]['bind'](this));ami['on'](_0xb80e('0x29'),this['syncCustomEvent'][_0xb80e('0x20')](this));ami['on'](_0xb80e('0x2a'),this[_0xb80e('0x2b')][_0xb80e('0x20')](this));ami['on']('custom:dialconnect',this['syncAgentDial'][_0xb80e('0x20')](this));ami['on'](_0xb80e('0x2c'),this['syncAgentDial'][_0xb80e('0x20')](this));ami['on'](_0xb80e('0x2d'),this['syncCustomEvent'][_0xb80e('0x20')](this));ami['on'](_0xb80e('0x2e'),this[_0xb80e('0x1f')][_0xb80e('0x20')](this));ami['on'](_0xb80e('0x2f'),this[_0xb80e('0x1f')][_0xb80e('0x20')](this));ami['on'](_0xb80e('0x30'),this[_0xb80e('0x1f')][_0xb80e('0x20')](this));ami['on'](_0xb80e('0x31'),this['syncCustomEvent']['bind'](this));ami['on'](_0xb80e('0x32'),this[_0xb80e('0x1f')][_0xb80e('0x20')](this));ami['on'](_0xb80e('0x33'),this[_0xb80e('0x1f')][_0xb80e('0x20')](this));ami['on']('custom:offlineMessage',this[_0xb80e('0x1f')][_0xb80e('0x20')](this));}Trigger[_0xb80e('0x34')]['emit']=function(_0x5e1f89,_0x282186,_0x3b7c58){logger[_0xb80e('0x35')](_0x5e1f89,_0x282186,JSON[_0xb80e('0x36')](_0x3b7c58));io['to'](_0x5e1f89)[_0xb80e('0x37')](_0x282186,_0x3b7c58);};Trigger[_0xb80e('0x34')][_0xb80e('0x1f')]=function(_0x4221ed){var _0x29dc73=_[_0xb80e('0x38')](_0x4221ed);if(typeof _0x29dc73[_0xb80e('0x39')]===_0xb80e('0x3a')){_0x29dc73[_0xb80e('0x39')]='voice';}logger['debug'](_0xb80e('0x1f'),util[_0xb80e('0x3b')](_0x29dc73,{'showHidden':!![],'depth':null}));this[_0xb80e('0x3c')](_0x29dc73);};Trigger['prototype'][_0xb80e('0x2b')]=function(_0x5e7df9){if(this[_0xb80e('0x10')][_0x5e7df9['interface']]){this[_0xb80e('0x1f')](_0x5e7df9);}};Trigger['prototype'][_0xb80e('0x3c')]=function(_0x43fb77){var _0x2f2f5d;for(var _0x36481f in this['triggers']){if(this[_0xb80e('0xf')][_0xb80e('0x3d')](_0x36481f)){if(this[_0xb80e('0xf')][_0x36481f][_0xb80e('0x3e')]){_0x2f2f5d=this[_0xb80e('0x3f')](this[_0xb80e('0xf')][_0x36481f],_0x43fb77);if(_0x2f2f5d){_[_0xb80e('0x40')](_0x43fb77,_0x43fb77['variables']);for(var _0x26f77c=0x0,_0x2cdf61,_0xd4c8bc,_0x23edfe;_0x26f77c0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x385bac,_0x33f57d){var _0x253209=function(_0x427d12){while(--_0x427d12){_0x385bac['push'](_0x385bac['shift']());}};_0x253209(++_0x33f57d);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ 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 fbbda7c..dc47d62 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 _0x95a0=['emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','resolve','data5','POST','clientId','username','password','clientSecret','access_token','catch','error',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','destcalleridnum','contacts','/systemusers(','body','substring','lastIndexOf','outbound','calleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','%2b','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s'];(function(_0x17fd4d,_0x402899){var _0x5e12f5=function(_0xebfa1c){while(--_0xebfa1c){_0x17fd4d['push'](_0x17fd4d['shift']());}};_0x5e12f5(++_0x402899);}(_0x95a0,0x178));var _0x095a=function(_0x56620a,_0x35d368){_0x56620a=_0x56620a-0x0;var _0x3914ce=_0x95a0[_0x56620a];return _0x3914ce;};'use strict';var _=require(_0x095a('0x0'));var rp=require(_0x095a('0x1'));var util=require(_0x095a('0x2'));var intUtil=require(_0x095a('0x3'));var md5=require(_0x095a('0x4'));var Redis=require(_0x095a('0x5'));var logger=require(_0x095a('0x6'))(_0x095a('0x7'));var config=require(_0x095a('0x8'));config[_0x095a('0x9')]=_[_0x095a('0xa')](config['redis'],{'host':_0x095a('0xb'),'port':0x18eb});var io=require(_0x095a('0xc'))(new Redis(config[_0x095a('0x9')]));function getAuthToken(_0x3d7d49,_0x162dc5,_0x27a6bd){if(_0x3d7d49[_0x095a('0xd')]){_0x3d7d49[_0x095a('0xe')]=_0x3d7d49[_0x095a('0xf')][_0x095a('0x10')];_0x3d7d49[_0x095a('0x11')]=_0x3d7d49[_0x095a('0xf')]['data2'];return Promise[_0x095a('0x12')](_0x3d7d49[_0x095a('0xf')][_0x095a('0x13')]);}var _0x222837={'method':_0x095a('0x14'),'uri':_0x162dc5,'form':{'client_id':_0x3d7d49[_0x095a('0x15')],'resource':_0x3d7d49['remoteUri'],'username':_0x3d7d49[_0x095a('0x16')],'password':_0x3d7d49[_0x095a('0x17')],'grant_type':'password','client_secret':_0x3d7d49[_0x095a('0x18')]},'json':!![]};return rp(_0x222837)['then'](function(_0x694ea1){return _0x694ea1[_0x095a('0x19')];})[_0x095a('0x1a')](function(_0x4c95ca){logger[_0x095a('0x1b')]('['+[_0x27a6bd['toUpperCase']()]+_0x095a('0x1c'));return _0x4c95ca[_0x095a('0x1d')];});}function getUser(_0x16d3ee,_0x5ccfa2,_0x4e532e,_0xe9b768,_0x192fe0,_0x26d653){return new Promise(function(_0x2ee0ed,_0x19dd5f){return getAuthToken(_0x5ccfa2,_0xe9b768,_0x26d653)[_0x095a('0x1e')](function(_0x468fc7){var _0x53b871={'method':_0x095a('0x1f'),'uri':_0x192fe0+_0x095a('0x20'),'headers':{'Authorization':_0x095a('0x21')+_0x468fc7,'OData-Version':_0x095a('0x22')},'json':!![]};return rp(_0x53b871);})[_0x095a('0x1e')](function(_0x2c2eb3){var _0x7d0903=_0x2c2eb3[_0x095a('0x23')];var _0x33b167=![];var _0x221edf=null;if(!_[_0x095a('0x24')](_0x4e532e)){if(intUtil[_0x095a('0x25')](_0x4e532e['email'])){_0x16d3ee[_0x095a('0x26')]=_0x4e532e[_0x095a('0x27')];for(_0x221edf=0x0;_0x221edf<_0x7d0903[_0x095a('0x28')];_0x221edf++){if(_0x7d0903[_0x221edf][_0x095a('0x29')]===_0x4e532e['email']&&!_0x7d0903[_0x221edf][_0x095a('0x2a')]){_0x33b167=!![];logger['info']('['+[_0x26d653[_0x095a('0x2b')]()]+_0x095a('0x2c')+_0x7d0903[_0x221edf][_0x095a('0x2d')]+'!');_0x16d3ee[_0x095a('0x2e')]=_0x7d0903[_0x221edf][_0x095a('0x2d')];}}}}if(!_0x33b167){logger[_0x095a('0x2f')]('['+[_0x26d653[_0x095a('0x2b')]()]+_0x095a('0x30'));_0x16d3ee[_0x095a('0x26')]=_0x5ccfa2[_0x095a('0x16')];for(_0x221edf=0x0;_0x221edf<_0x7d0903[_0x095a('0x28')];_0x221edf++){if(_0x7d0903[_0x221edf][_0x095a('0x29')]===_0x5ccfa2[_0x095a('0x16')]){_0x16d3ee[_0x095a('0x2e')]=_0x7d0903[_0x221edf][_0x095a('0x2d')];}}}_0x2ee0ed(_0x16d3ee);})[_0x095a('0x1a')](function(_0x1d84c){_0x19dd5f(_0x1d84c[_0x095a('0x1d')]);});});}function createEndUser(_0x243509,_0x5c0bd2,_0x52350a,_0x4b4626,_0x28a717,_0xcc0ca8,_0x4ff642){return new Promise(function(_0x56d765,_0x53cb53){return getAuthToken(_0x5c0bd2,_0x52350a,_0xcc0ca8)['then'](function(_0x525b33){var _0x588a82=_0xcc0ca8[_0x095a('0x31')]()==='outbound'?_0x28a717[_0x095a('0x32')]:_0x28a717['calleridnum'];var _0x586ef2={'method':_0x095a('0x14'),'uri':_0x4b4626+_0x095a('0x33'),'body':{'fullname':_0x588a82,'firstname':_0x588a82,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x095a('0x34')+_0x243509[_0x095a('0x2e')]+')'},'headers':{'Authorization':_0x095a('0x21')+_0x525b33,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x586ef2[_0x095a('0x35')][_0x4ff642]=_0x588a82;return rp(_0x586ef2);})[_0x095a('0x1e')](function(_0x42bcfa){var _0x13d535=_0x42bcfa['headers']['odata-entityid'];var _0x3f52a9=_0x13d535[_0x095a('0x36')](_0x13d535[_0x095a('0x37')]('(')+0x1,_0x13d535[_0x095a('0x37')](')'));_0x243509['enduserId']=_0x3f52a9;_0x56d765(_0x243509);})[_0x095a('0x1a')](function(_0xfb9cb5){_0x53cb53(_0xfb9cb5[_0x095a('0x1d')]);});});}function getEndUser(_0x5e5c37,_0x26ed85,_0x5c1fb2,_0x28c387,_0x3267f9,_0x6c6eb2,_0x429d7a,_0x5905d4){var _0x28bab8=_0x6c6eb2[_0x095a('0x31')]()===_0x095a('0x38')?_0x3267f9['destcalleridnum']:_0x3267f9[_0x095a('0x39')];return getAuthToken(_0x26ed85,_0x5c1fb2,_0x6c6eb2)[_0x095a('0x1e')](function(_0x441e60){_0x5905d4=_0x5905d4?_0x5905d4:_0x095a('0x3a');var _0x1de600={'method':_0x095a('0x1f'),'uri':_0x28c387+_0x095a('0x3b')+_0x5905d4+_0x095a('0x3c')+_0x5905d4+_0x095a('0x3d')+_0x28bab8['replace']('+',_0x095a('0x3e'))+'\x27','headers':{'Authorization':_0x095a('0x21')+_0x441e60,'If-None-Match':null,'OData-Version':_0x095a('0x22')},'json':!![]};return rp(_0x1de600);})[_0x095a('0x1e')](function(_0x3a2054){var _0x159015=![];if(!_0x3a2054)return _0x159015;var _0x3bc49f=_0x3a2054[_0x095a('0x23')];for(var _0x511163=0x0;_0x511163<_0x3bc49f['length'];_0x511163++){if(_0x3bc49f[_0x511163][_0x5905d4]===_0x28bab8){_0x159015=!![];_0x5e5c37[_0x095a('0x3f')]=_0x3bc49f[_0x511163][_0x095a('0x40')];}}return _0x159015;})['then'](function(_0x77445d){if(_0x77445d)return _0x5e5c37;if(_0x429d7a===_0x095a('0x41')){logger[_0x095a('0x2f')]('['+[_0x6c6eb2[_0x095a('0x2b')]()]+_0x095a('0x42'));return _0x5e5c37;}return createEndUser(_0x5e5c37,_0x26ed85,_0x5c1fb2,_0x28c387,_0x3267f9,_0x6c6eb2,_0x5905d4)[_0x095a('0x1e')](function(_0x6e2f59){logger[_0x095a('0x2f')]('['+[_0x6c6eb2[_0x095a('0x2b')]()]+']\x20Enduser\x20created!',_0x6e2f59[_0x095a('0x3f')]);return _0x6e2f59;});});}function getCustomFields(_0x1ae323,_0x60881a,_0x3c6f39){var _0x500b24={};if(_0x1ae323[_0x095a('0x28')]>0x0){_[_0x095a('0x43')](_0x1ae323,function(_0x3853b0){if(_[_0x095a('0x44')]([_0x095a('0x45'),_0x095a('0x46')],_0x3853b0[_0x095a('0x47')])&&_0x3853b0[_0x095a('0x48')]&&!_0x3853b0[_0x095a('0x49')]){var _0x48ce4a=_0x3853b0[_0x095a('0x4a')]['toLowerCase']();var _0x44e7aa=_0x48ce4a['substring'](0x0,_0x48ce4a[_0x095a('0x4b')]('_'));var _0x1a92d8=_0x48ce4a[_0x095a('0x36')](_0x48ce4a['indexOf']('_')+0x1);if(_0x44e7aa===_0x3c6f39){_0x500b24[_0x1a92d8]=_0x3853b0[_0x095a('0x4c')];}}});}return _0x500b24;}function getTicket(_0x43f7c9,_0x1511c8,_0x5929c4,_0x32bfcc,_0x4f66a7,_0x15116c,_0x1a67df){return new Promise(function(_0x23cd44,_0x42747a){var _0x3ae9bc;return getAuthToken(_0x1511c8,_0x5929c4,_0x1a67df)[_0x095a('0x1e')](function(_0x1a02ab){if(_0x15116c[_0x095a('0x4d')]==='incident'){_0x3ae9bc={'method':_0x095a('0x14'),'uri':_0x32bfcc+_0x095a('0x4e'),'body':Object[_0x095a('0x4f')]({},{'title':intUtil[_0x095a('0x50')](_0x15116c[_0x095a('0x51')],_0x4f66a7,'\x20'),'description':intUtil[_0x095a('0x50')](_0x15116c[_0x095a('0x52')],_0x4f66a7,'\x0a'),'customerid_contact@odata.bind':_0x43f7c9[_0x095a('0x3f')]?_0x095a('0x53')+_0x43f7c9[_0x095a('0x3f')]+')':undefined,'ownerid@odata.bind':_0x095a('0x34')+_0x43f7c9[_0x095a('0x2e')]+')','caseorigincode':'1'},getCustomFields(_0x15116c[_0x095a('0x54')],_0x4f66a7,_0x15116c[_0x095a('0x4d')])),'headers':{'Authorization':_0x095a('0x21')+_0x1a02ab,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x15116c[_0x095a('0x4d')]===_0x095a('0x55')){var _0x192ec4=_0x43f7c9['enduserId']?[{'partyid_systemuser@odata.bind':_0x095a('0x34')+_0x43f7c9[_0x095a('0x2e')]+')','participationtypemask':_0x43f7c9[_0x095a('0x56')]===_0x095a('0x57')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x43f7c9['enduserId']+')','participationtypemask':_0x43f7c9['callDirection']===_0x095a('0x57')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x095a('0x34')+_0x43f7c9['userId']+')','participationtypemask':_0x43f7c9[_0x095a('0x56')]===_0x095a('0x57')?0x2:0x1}];_0x3ae9bc={'method':_0x095a('0x14'),'uri':_0x32bfcc+'phonecalls','body':Object[_0x095a('0x4f')]({},{'subject':intUtil['getString'](_0x15116c[_0x095a('0x51')],_0x4f66a7,'\x20'),'phonenumber':String(_0x4f66a7[_0x095a('0x39')]),'description':intUtil[_0x095a('0x50')](_0x15116c[_0x095a('0x52')],_0x4f66a7,'\x0a'),'regardingobjectid_contact@odata.bind':_0x43f7c9[_0x095a('0x3f')]?_0x095a('0x53')+_0x43f7c9['enduserId']+')':undefined,'ownerid@odata.bind':_0x095a('0x34')+_0x43f7c9[_0x095a('0x2e')]+')','directioncode':_0x43f7c9[_0x095a('0x56')]==='queue'?![]:!![],'phonecall_activity_parties':_0x192ec4},getCustomFields(_0x15116c[_0x095a('0x54')],_0x4f66a7,_0x15116c['ticketType'])),'headers':{'Authorization':_0x095a('0x21')+_0x1a02ab,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3ae9bc);})[_0x095a('0x1e')](function(_0x35edd8){var _0x101c17=_0x35edd8['headers'][_0x095a('0x58')];var _0x1007e6=_0x101c17[_0x095a('0x36')](_0x101c17[_0x095a('0x37')]('(')+0x1,_0x101c17[_0x095a('0x37')](')'));_0x43f7c9['ticketId']=_0x1007e6;_0x23cd44(_0x43f7c9);})['catch'](function(_0x30158d){_0x42747a(_0x30158d['message']);});});}function emit(_0x27dfa0,_0x5e759d,_0x598670,_0x464d25){var _0x8a5022={'uri':util[_0x095a('0x59')](_0x095a('0x5a'),_0x27dfa0,_0x598670,_0x464d25)};io['to'](util['format'](_0x095a('0x5b'),_0x5e759d))[_0x095a('0x5c')](_0x095a('0x5d'),_0x8a5022);}exports['cs']=function(_0x158cc9,_0x50ffce,_0x15eb38,_0x261371,_0xd27b40,_0x20d119,_0x46d9a5,_0x4b41a2){var _0x1bc2c6={};_0x20d119['remoteUri']=_0x20d119[_0x095a('0xd')]?intUtil['stripTrailingSlash'](_0x20d119[_0x095a('0xf')][_0x095a('0x10')]):intUtil[_0x095a('0x5e')](_0x20d119[_0x095a('0xe')]);_0x20d119[_0x095a('0x5f')]=intUtil[_0x095a('0x5e')](_0x20d119[_0x095a('0x5f')]);_0x1bc2c6[_0x095a('0x56')]=_0x4b41a2===_0x095a('0x57')||_0x4b41a2===_0x095a('0x60')?_0x095a('0x57'):_0x095a('0x38');var _0x4cee2c=_0x20d119[_0x095a('0xd')]?util[_0x095a('0x59')]('%s/api/data/v9.0/',_0x20d119[_0x095a('0xf')][_0x095a('0x10')]):util[_0x095a('0x59')](_0x095a('0x61'),_0x20d119[_0x095a('0xe')]);var _0x16b9df=util[_0x095a('0x59')](_0x095a('0x62'),_0x20d119[_0x095a('0x11')]);var _0x99ad73=util[_0x095a('0x59')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x20d119[_0x095a('0x5f')],_0x50ffce['uniqueid'],md5(_0x50ffce[_0x095a('0x63')]));if(_0xd27b40&&_0xd27b40['monitor_format']){logger[_0x095a('0x2f')](_0x095a('0x64'),_0x095a('0x65'));_0x50ffce[_0x095a('0x66')]=_0x99ad73;}else if(_0x46d9a5&&_0x46d9a5['recordingFormat']&&_0x46d9a5[_0x095a('0x67')]!==_0x095a('0x68')){logger[_0x095a('0x2f')](_0x095a('0x69'),_0x095a('0x65'));_0x50ffce[_0x095a('0x66')]=_0x99ad73;}else{_0x50ffce[_0x095a('0x66')]='';}return getUser(_0x1bc2c6,_0x20d119,_0x261371,_0x16b9df,_0x4cee2c,_0x4b41a2)['then'](function(_0x372ad3){logger[_0x095a('0x2f')]('['+_0x4b41a2['toUpperCase']()+_0x095a('0x6a'),_0x372ad3['userId']);logger['info']('['+_0x4b41a2['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x372ad3['userEmail']);return getEndUser(_0x372ad3,_0x20d119,_0x16b9df,_0x4cee2c,_0x50ffce,_0x4b41a2,_0x15eb38[_0x095a('0x6b')],_0x15eb38[_0x095a('0x6c')]);})[_0x095a('0x1e')](function(_0x264162){logger[_0x095a('0x2f')]('['+_0x4b41a2[_0x095a('0x2b')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x264162[_0x095a('0x3f')]);logger[_0x095a('0x2f')]('['+_0x4b41a2['toUpperCase']()+_0x095a('0x6d'),_0x50ffce[_0x095a('0x39')]);return getTicket(_0x264162,_0x20d119,_0x16b9df,_0x4cee2c,_0x50ffce,_0x15eb38,_0x4b41a2);})[_0x095a('0x1e')](function(_0x4db195){logger[_0x095a('0x2f')](util['format']('['+_0x4b41a2[_0x095a('0x2b')]()+_0x095a('0x6e'),_0x15eb38[_0x095a('0x4d')],_0x4db195[_0x095a('0x6f')]));logger['info'](util[_0x095a('0x59')]('['+_0x4b41a2[_0x095a('0x2b')]()+_0x095a('0x70'),_0x4b41a2));if(_0x4b41a2!==_0x095a('0x60')&&_0x15eb38[_0x095a('0x71')]){logger[_0x095a('0x2f')]('['+_0x4b41a2[_0x095a('0x2b')]()+']',_0x095a('0x72'));emit(_0x20d119['remoteUri'],_0x261371['name'],_0x15eb38[_0x095a('0x4d')],_0x4db195[_0x095a('0x6f')]);}})[_0x095a('0x1a')](function(_0x28eea4){logger[_0x095a('0x1b')]('['+_0x4b41a2[_0x095a('0x2b')]()+_0x095a('0x73'),_0x28eea4[_0x095a('0x1d')]);console['error'](_0x095a('0x74'),_0x28eea4);});}; \ No newline at end of file +var _0xcca1=['body','headers','substring','lastIndexOf','enduserId','message','GET','contacts?$select=','&$filter=','replace','%2b','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','nameField','idField','indexOf','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','ticketType','phonecall','callDirection','queue','/systemusers(','phonecalls','odata-entityid','ticketId','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','util','./util','ioredis','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','data2','resolve','data5','POST','clientId','remoteUri','username','password','clientSecret','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','isNil','validateEmail','email','userEmail','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','internalemailaddress','catch','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','Bearer\x20'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcca1,0xa6));var _0x1cca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcca1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1cca('0x0'));var rp=require('request-promise');var util=require(_0x1cca('0x1'));var intUtil=require(_0x1cca('0x2'));var md5=require('md5');var Redis=require(_0x1cca('0x3'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x1cca('0x4'));config[_0x1cca('0x5')]=_['defaults'](config['redis'],{'host':_0x1cca('0x6'),'port':0x18eb});var io=require(_0x1cca('0x7'))(new Redis(config[_0x1cca('0x5')]));function getAuthToken(_0x59114b,_0x5cd480,_0x258678){if(_0x59114b[_0x1cca('0x8')]){_0x59114b['remoteUri']=_0x59114b[_0x1cca('0x9')][_0x1cca('0xa')];_0x59114b['tenantId']=_0x59114b[_0x1cca('0x9')][_0x1cca('0xb')];return Promise[_0x1cca('0xc')](_0x59114b[_0x1cca('0x9')][_0x1cca('0xd')]);}var _0x5f4945={'method':_0x1cca('0xe'),'uri':_0x5cd480,'form':{'client_id':_0x59114b[_0x1cca('0xf')],'resource':_0x59114b[_0x1cca('0x10')],'username':_0x59114b[_0x1cca('0x11')],'password':_0x59114b[_0x1cca('0x12')],'grant_type':'password','client_secret':_0x59114b[_0x1cca('0x13')]},'json':!![]};return rp(_0x5f4945)['then'](function(_0x24b85a){return _0x24b85a[_0x1cca('0x14')];})['catch'](function(_0x86cbe2){logger[_0x1cca('0x15')]('['+[_0x258678[_0x1cca('0x16')]()]+_0x1cca('0x17'));return _0x86cbe2['message'];});}function getUser(_0x5a4991,_0x1a51f6,_0xd18066,_0x1315be,_0x385b40,_0x5cef58){return new Promise(function(_0xde8b81,_0x14fe52){return getAuthToken(_0x1a51f6,_0x1315be,_0x5cef58)[_0x1cca('0x18')](function(_0x30cef1){var _0x55e965={'method':'GET','uri':_0x385b40+_0x1cca('0x19'),'headers':{'Authorization':'Bearer\x20'+_0x30cef1,'OData-Version':_0x1cca('0x1a')},'json':!![]};return rp(_0x55e965);})['then'](function(_0x22b2e2){var _0x212d57=_0x22b2e2['value'];var _0x523b77=![];var _0xe16a6a=null;if(!_[_0x1cca('0x1b')](_0xd18066)){if(intUtil[_0x1cca('0x1c')](_0xd18066[_0x1cca('0x1d')])){_0x5a4991[_0x1cca('0x1e')]=_0xd18066[_0x1cca('0x1d')];for(_0xe16a6a=0x0;_0xe16a6a<_0x212d57['length'];_0xe16a6a++){if(_0x212d57[_0xe16a6a]['internalemailaddress']===_0xd18066[_0x1cca('0x1d')]&&!_0x212d57[_0xe16a6a]['isdisabled']){_0x523b77=!![];logger[_0x1cca('0x1f')]('['+[_0x5cef58[_0x1cca('0x16')]()]+']\x20Agent\x20found\x20'+_0x212d57[_0xe16a6a][_0x1cca('0x20')]+'!');_0x5a4991[_0x1cca('0x21')]=_0x212d57[_0xe16a6a]['systemuserid'];}}}}if(!_0x523b77){logger[_0x1cca('0x1f')]('['+[_0x5cef58[_0x1cca('0x16')]()]+_0x1cca('0x22'));_0x5a4991[_0x1cca('0x1e')]=_0x1a51f6['username'];for(_0xe16a6a=0x0;_0xe16a6a<_0x212d57[_0x1cca('0x23')];_0xe16a6a++){if(_0x212d57[_0xe16a6a][_0x1cca('0x24')]===_0x1a51f6[_0x1cca('0x11')]){_0x5a4991['userId']=_0x212d57[_0xe16a6a]['systemuserid'];}}}_0xde8b81(_0x5a4991);})[_0x1cca('0x25')](function(_0x34f48f){_0x14fe52(_0x34f48f['message']);});});}function createEndUser(_0x59cdb0,_0x508d91,_0x2e3ee8,_0x55b222,_0x96e3cb,_0x2c4784,_0x5c361b){return new Promise(function(_0x455472,_0x4c9831){return getAuthToken(_0x508d91,_0x2e3ee8,_0x2c4784)['then'](function(_0x508153){var _0x4af7b2=_0x2c4784[_0x1cca('0x26')]()===_0x1cca('0x27')?_0x96e3cb[_0x1cca('0x28')]:_0x96e3cb[_0x1cca('0x29')];var _0x317df5={'method':_0x1cca('0xe'),'uri':_0x55b222+_0x1cca('0x2a'),'body':{'fullname':_0x4af7b2,'firstname':_0x4af7b2,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x59cdb0[_0x1cca('0x21')]+')'},'headers':{'Authorization':_0x1cca('0x2b')+_0x508153,'OData-Version':_0x1cca('0x1a')},'json':!![],'resolveWithFullResponse':!![]};_0x317df5[_0x1cca('0x2c')][_0x5c361b]=_0x4af7b2;return rp(_0x317df5);})[_0x1cca('0x18')](function(_0x51c2fd){var _0x45a584=_0x51c2fd[_0x1cca('0x2d')]['odata-entityid'];var _0x41c8a6=_0x45a584[_0x1cca('0x2e')](_0x45a584[_0x1cca('0x2f')]('(')+0x1,_0x45a584['lastIndexOf'](')'));_0x59cdb0[_0x1cca('0x30')]=_0x41c8a6;_0x455472(_0x59cdb0);})['catch'](function(_0x2ba970){_0x4c9831(_0x2ba970[_0x1cca('0x31')]);});});}function getEndUser(_0x551e5b,_0x5c0a0b,_0x4c13e5,_0x121fce,_0x3fefea,_0x31b34d,_0x1a87ca,_0x2b0c8c){var _0x5e9089=_0x31b34d[_0x1cca('0x26')]()===_0x1cca('0x27')?_0x3fefea[_0x1cca('0x28')]:_0x3fefea[_0x1cca('0x29')];return getAuthToken(_0x5c0a0b,_0x4c13e5,_0x31b34d)[_0x1cca('0x18')](function(_0x5f1fb8){_0x2b0c8c=_0x2b0c8c?_0x2b0c8c:'telephone1';var _0x5f545f={'method':_0x1cca('0x32'),'uri':_0x121fce+_0x1cca('0x33')+_0x2b0c8c+_0x1cca('0x34')+_0x2b0c8c+'\x20eq\x20\x27'+_0x5e9089[_0x1cca('0x35')]('+',_0x1cca('0x36'))+'\x27','headers':{'Authorization':_0x1cca('0x2b')+_0x5f1fb8,'If-None-Match':null,'OData-Version':_0x1cca('0x1a')},'json':!![]};return rp(_0x5f545f);})[_0x1cca('0x18')](function(_0x318b01){var _0x3ed992=![];if(!_0x318b01)return _0x3ed992;var _0x40e7c7=_0x318b01['value'];for(var _0x1e6181=0x0;_0x1e6181<_0x40e7c7[_0x1cca('0x23')];_0x1e6181++){if(_0x40e7c7[_0x1e6181][_0x2b0c8c]===_0x5e9089){_0x3ed992=!![];_0x551e5b[_0x1cca('0x30')]=_0x40e7c7[_0x1e6181]['contactid'];}}return _0x3ed992;})[_0x1cca('0x18')](function(_0x47811a){if(_0x47811a)return _0x551e5b;if(_0x1a87ca===_0x1cca('0x37')){logger[_0x1cca('0x1f')]('['+[_0x31b34d['toUpperCase']()]+_0x1cca('0x38'));return _0x551e5b;}return createEndUser(_0x551e5b,_0x5c0a0b,_0x4c13e5,_0x121fce,_0x3fefea,_0x31b34d,_0x2b0c8c)[_0x1cca('0x18')](function(_0x11c1dc){logger[_0x1cca('0x1f')]('['+[_0x31b34d[_0x1cca('0x16')]()]+_0x1cca('0x39'),_0x11c1dc[_0x1cca('0x30')]);return _0x11c1dc;});});}function getCustomFields(_0x2ae861,_0x508d26,_0xc1024d){var _0x5b23db={};if(_0x2ae861[_0x1cca('0x23')]>0x0){_[_0x1cca('0x3a')](_0x2ae861,function(_0x20ed75){if(_[_0x1cca('0x3b')]([_0x1cca('0x3c'),'picklist'],_0x20ed75['type'])&&_0x20ed75[_0x1cca('0x3d')]&&!_0x20ed75['customField']){var _0x5d58e3=_0x20ed75[_0x1cca('0x3e')]['toLowerCase']();var _0x4ecb6f=_0x5d58e3[_0x1cca('0x2e')](0x0,_0x5d58e3[_0x1cca('0x3f')]('_'));var _0x26e9d2=_0x5d58e3[_0x1cca('0x2e')](_0x5d58e3[_0x1cca('0x3f')]('_')+0x1);if(_0x4ecb6f===_0xc1024d){_0x5b23db[_0x26e9d2]=_0x20ed75['content'];}}});}return _0x5b23db;}function getTicket(_0x3b8555,_0x5a9251,_0x41bd2e,_0x25d702,_0x2e241d,_0x3ca792,_0x2b9085){return new Promise(function(_0xc3f4b3,_0x567b4){var _0x5f37c0;return getAuthToken(_0x5a9251,_0x41bd2e,_0x2b9085)[_0x1cca('0x18')](function(_0x3ebb48){if(_0x3ca792['ticketType']===_0x1cca('0x40')){_0x5f37c0={'method':_0x1cca('0xe'),'uri':_0x25d702+_0x1cca('0x41'),'body':Object[_0x1cca('0x42')]({},{'title':intUtil['getString'](_0x3ca792[_0x1cca('0x43')],_0x2e241d,'\x20'),'description':intUtil[_0x1cca('0x44')](_0x3ca792[_0x1cca('0x45')],_0x2e241d,'\x0a'),'customerid_contact@odata.bind':_0x3b8555['enduserId']?_0x1cca('0x46')+_0x3b8555['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x3b8555[_0x1cca('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x3ca792['Fields'],_0x2e241d,_0x3ca792[_0x1cca('0x47')])),'headers':{'Authorization':'Bearer\x20'+_0x3ebb48,'OData-Version':_0x1cca('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3ca792[_0x1cca('0x47')]===_0x1cca('0x48')){var _0xea2902=_0x3b8555[_0x1cca('0x30')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x3b8555[_0x1cca('0x21')]+')','participationtypemask':_0x3b8555[_0x1cca('0x49')]===_0x1cca('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':_0x1cca('0x46')+_0x3b8555[_0x1cca('0x30')]+')','participationtypemask':_0x3b8555[_0x1cca('0x49')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x1cca('0x4b')+_0x3b8555[_0x1cca('0x21')]+')','participationtypemask':_0x3b8555[_0x1cca('0x49')]===_0x1cca('0x4a')?0x2:0x1}];_0x5f37c0={'method':_0x1cca('0xe'),'uri':_0x25d702+_0x1cca('0x4c'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x3ca792['Subjects'],_0x2e241d,'\x20'),'phonenumber':String(_0x2e241d[_0x1cca('0x29')]),'description':intUtil[_0x1cca('0x44')](_0x3ca792[_0x1cca('0x45')],_0x2e241d,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3b8555['enduserId']?_0x1cca('0x46')+_0x3b8555[_0x1cca('0x30')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x3b8555[_0x1cca('0x21')]+')','directioncode':_0x3b8555[_0x1cca('0x49')]===_0x1cca('0x4a')?![]:!![],'phonecall_activity_parties':_0xea2902},getCustomFields(_0x3ca792['Fields'],_0x2e241d,_0x3ca792[_0x1cca('0x47')])),'headers':{'Authorization':_0x1cca('0x2b')+_0x3ebb48,'OData-Version':_0x1cca('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5f37c0);})[_0x1cca('0x18')](function(_0x45f913){var _0x30b589=_0x45f913[_0x1cca('0x2d')][_0x1cca('0x4d')];var _0x228b32=_0x30b589[_0x1cca('0x2e')](_0x30b589[_0x1cca('0x2f')]('(')+0x1,_0x30b589[_0x1cca('0x2f')](')'));_0x3b8555[_0x1cca('0x4e')]=_0x228b32;_0xc3f4b3(_0x3b8555);})[_0x1cca('0x25')](function(_0x3dc34b){_0x567b4(_0x3dc34b[_0x1cca('0x31')]);});});}function emit(_0x25cee6,_0x5899a4,_0x15d4e7,_0x392ea3){var _0x3ddd37={'uri':util[_0x1cca('0x4f')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x25cee6,_0x15d4e7,_0x392ea3)};io['to'](util['format'](_0x1cca('0x50'),_0x5899a4))['emit'](_0x1cca('0x51'),_0x3ddd37);}exports['cs']=function(_0x24ecc7,_0x4f5784,_0x7ca58a,_0x5caf03,_0x33ec8b,_0x1a23d9,_0x1417d0,_0x345635){var _0x40ca02={};_0x1a23d9[_0x1cca('0x10')]=_0x1a23d9[_0x1cca('0x8')]?intUtil[_0x1cca('0x52')](_0x1a23d9[_0x1cca('0x9')][_0x1cca('0xa')]):intUtil[_0x1cca('0x52')](_0x1a23d9[_0x1cca('0x10')]);_0x1a23d9[_0x1cca('0x53')]=intUtil['stripTrailingSlash'](_0x1a23d9['serverUrl']);_0x40ca02[_0x1cca('0x49')]=_0x345635==='queue'||_0x345635===_0x1cca('0x54')?'queue':_0x1cca('0x27');var _0x1d72c2=_0x1a23d9['modernAuthentication']?util['format'](_0x1cca('0x55'),_0x1a23d9[_0x1cca('0x9')][_0x1cca('0xa')]):util[_0x1cca('0x4f')](_0x1cca('0x55'),_0x1a23d9[_0x1cca('0x10')]);var _0x62fd41=util[_0x1cca('0x4f')](_0x1cca('0x56'),_0x1a23d9['tenantId']);var _0x2a3298=util['format'](_0x1cca('0x57'),_0x1a23d9['serverUrl'],_0x4f5784['uniqueid'],md5(_0x4f5784['uniqueid']));if(_0x33ec8b&&_0x33ec8b[_0x1cca('0x58')]){logger[_0x1cca('0x1f')](_0x1cca('0x59'),_0x1cca('0x5a'));_0x4f5784[_0x1cca('0x5b')]=_0x2a3298;}else if(_0x1417d0&&_0x1417d0[_0x1cca('0x5c')]&&_0x1417d0['recordingFormat']!==_0x1cca('0x5d')){logger[_0x1cca('0x1f')](_0x1cca('0x5e'),'Recording\x20is\x20enabled!');_0x4f5784[_0x1cca('0x5b')]=_0x2a3298;}else{_0x4f5784['recordingURL']='';}return getUser(_0x40ca02,_0x1a23d9,_0x5caf03,_0x62fd41,_0x1d72c2,_0x345635)['then'](function(_0x1b0566){logger[_0x1cca('0x1f')]('['+_0x345635['toUpperCase']()+_0x1cca('0x5f'),_0x1b0566[_0x1cca('0x21')]);logger[_0x1cca('0x1f')]('['+_0x345635[_0x1cca('0x16')]()+_0x1cca('0x60'),_0x1b0566[_0x1cca('0x1e')]);return getEndUser(_0x1b0566,_0x1a23d9,_0x62fd41,_0x1d72c2,_0x4f5784,_0x345635,_0x7ca58a['moduleCreate'],_0x7ca58a[_0x1cca('0x61')]);})[_0x1cca('0x18')](function(_0x3f81df){logger[_0x1cca('0x1f')]('['+_0x345635[_0x1cca('0x16')]()+_0x1cca('0x62'),_0x3f81df[_0x1cca('0x30')]);logger[_0x1cca('0x1f')]('['+_0x345635['toUpperCase']()+_0x1cca('0x63'),_0x4f5784[_0x1cca('0x29')]);return getTicket(_0x3f81df,_0x1a23d9,_0x62fd41,_0x1d72c2,_0x4f5784,_0x7ca58a,_0x345635);})[_0x1cca('0x18')](function(_0xc55897){logger[_0x1cca('0x1f')](util[_0x1cca('0x4f')]('['+_0x345635['toUpperCase']()+_0x1cca('0x64'),_0x7ca58a[_0x1cca('0x47')],_0xc55897['ticketId']));logger[_0x1cca('0x1f')](util[_0x1cca('0x4f')]('['+_0x345635['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x345635));if(_0x345635!==_0x1cca('0x54')&&_0x7ca58a[_0x1cca('0x65')]){logger[_0x1cca('0x1f')]('['+_0x345635[_0x1cca('0x16')]()+']',_0x1cca('0x66'));emit(_0x1a23d9[_0x1cca('0x10')],_0x5caf03[_0x1cca('0x67')],_0x7ca58a[_0x1cca('0x47')],_0xc55897['ticketId']);}})[_0x1cca('0x25')](function(_0x2f9690){logger[_0x1cca('0x15')]('['+_0x345635[_0x1cca('0x16')]()+_0x1cca('0x68'),_0x2f9690[_0x1cca('0x31')]);console[_0x1cca('0x15')]('Error\x20running\x20Dynamics365\x20integration',_0x2f9690);});}; \ 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 af5b022..a621505 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 _0x0aa5=['apiKey','toString','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','picklist','type','nameField','content','string','idField','customField','push','variable','variableName','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','email','destcalleridnum','[OUTBOUND]','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','./util','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','
','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s'];(function(_0x36aa05,_0x3117cc){var _0x293263=function(_0x1bdc70){while(--_0x1bdc70){_0x36aa05['push'](_0x36aa05['shift']());}};_0x293263(++_0x3117cc);}(_0x0aa5,0x15b));var _0x50aa=function(_0x141a4f,_0x37ead0){_0x141a4f=_0x141a4f-0x0;var _0x23657c=_0x0aa5[_0x141a4f];return _0x23657c;};'use strict';var _=require(_0x50aa('0x0'));var rp=require(_0x50aa('0x1'));var md5=require(_0x50aa('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x50aa('0x3'));var config=require('../../../../config/environment');var logger=require(_0x50aa('0x4'))(_0x50aa('0x5'));config['redis']=_['defaults'](config[_0x50aa('0x6')],{'host':_0x50aa('0x7'),'port':0x18eb});var io=require(_0x50aa('0x8'))(new Redis(config[_0x50aa('0x6')]));var headers={'Content-Type':_0x50aa('0x9'),'Accept':_0x50aa('0x9')};function emit(_0xf5185b,_0x147e4b,_0x9cc145){io['to'](_0xf5185b)[_0x50aa('0xa')](_0x147e4b,_0x9cc145);}function getTicket(_0x3f1d50,_0x59dbb8,_0xa021e2,_0x23d5ca,_0x1ccca4){logger[_0x50aa('0xb')](_0x50aa('0xc'));var _0x7d38c3=_[_0x50aa('0xd')]({'responder_id':_0x59dbb8['id'],'requester_id':_0xa021e2['id'],'name':util[_0x50aa('0xe')](_0x50aa('0xf'),_0x1ccca4[_0x50aa('0x10')]),'phone':_0x1ccca4[_0x50aa('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x50aa('0x12')](_0x23d5ca[_0x50aa('0x13')],_0x1ccca4,'\x20'),'description':intUtil[_0x50aa('0x12')](_0x23d5ca['Descriptions'],_0x1ccca4,_0x50aa('0x14')),'tags':getTags(_0x23d5ca[_0x50aa('0x15')],'name')},getCustomFields(_0x23d5ca[_0x50aa('0x16')],_0x1ccca4));_0x7d38c3[_0x50aa('0x17')]=_[_0x50aa('0x18')](_[_0x50aa('0x19')](_0x7d38c3['custom_fields'],'id'),_0x50aa('0x1a'));return request({'uri':util[_0x50aa('0xe')](_0x50aa('0x1b'),_0x3f1d50['remoteUri']),'method':_0x50aa('0x1c'),'body':_0x7d38c3})[_0x50aa('0x1d')](function(_0x1857b2){logger['info']('Ticket\x20created!');return _0x1857b2;});}function getUser(_0x1a97bf,_0x472870){if(intUtil['validateEmail'](_0x472870)){return request({'uri':util[_0x50aa('0xe')](_0x50aa('0x1e'),_0x1a97bf[_0x50aa('0x1f')]),'qs':{'email':_0x472870}})[_0x50aa('0x1d')](function(_0x469b41){if(_0x469b41[_0x50aa('0x20')]){logger[_0x50aa('0xb')](_0x50aa('0x21'));return _[_0x50aa('0x22')](_0x469b41,function(_0x53dfd5){return _0x53dfd5[_0x50aa('0x23')]['email']===_0x472870;});}else{logger[_0x50aa('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x50aa('0x24'),_0x1a97bf[_0x50aa('0x1f')])})[_0x50aa('0x1d')](function(_0x274bf1){logger[_0x50aa('0xb')](_0x50aa('0x25'));return _0x274bf1;});}});}else{logger['info'](_0x50aa('0x26'));return request({'uri':util[_0x50aa('0xe')]('%s/api/v2/agents/me',_0x1a97bf[_0x50aa('0x1f')])})[_0x50aa('0x1d')](function(_0x8e423f){logger[_0x50aa('0xb')]('Admin\x20account\x20selected.');return _0x8e423f;});}}function getEndUser(_0x2af3e3,_0x444c6a,_0x155129){logger['info'](_0x50aa('0x27'),_0x155129);return request({'uri':util[_0x50aa('0xe')](_0x50aa('0x28'),_0x2af3e3[_0x50aa('0x1f')]),'qs':{'phone':_0x155129}})['then'](function(_0xf4c284){if(_0xf4c284['length']){logger[_0x50aa('0xb')](_0x50aa('0x29'));return _['find'](_0xf4c284,{'phone':_0x155129});}else{logger[_0x50aa('0xb')](_0x50aa('0x2a'));return request({'uri':util[_0x50aa('0xe')](_0x50aa('0x28'),_0x2af3e3[_0x50aa('0x1f')]),'method':_0x50aa('0x1c'),'body':{'name':_0x444c6a,'phone':_0x155129}})['then'](function(_0x4cc86a){logger[_0x50aa('0xb')](_0x50aa('0x2b'));return _0x4cc86a;});}});}function getAuth(_0x59f9d9){return util[_0x50aa('0xe')](_0x50aa('0x2c'),new Buffer(_0x59f9d9[_0x50aa('0x2d')]+':X')[_0x50aa('0x2e')]('base64'));}function request(_0x45ec){logger[_0x50aa('0x2f')](_0x50aa('0x30'),JSON[_0x50aa('0x31')](_0x45ec));return rp(_[_0x50aa('0x32')](_0x45ec,{'method':_0x50aa('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x5d23c2,_0x374541){var _0x440b82=[];if(_0x5d23c2&&_0x5d23c2[_0x50aa('0x20')]>0x0){_0x440b82=_[_0x50aa('0x34')](_0x5d23c2,_0x374541);}return _0x440b82;}function getCustomFields(_0x55b157,_0x1c8bb3){var _0x4b00ea=[];var _0x7dee91={'custom_fields':[]};if(_0x55b157[_0x50aa('0x20')]>0x0){_[_0x50aa('0x35')](_0x55b157,function(_0x43fc7d){if(_[_0x50aa('0x36')](['string',_0x50aa('0x37')],_0x43fc7d[_0x50aa('0x38')])&&_0x43fc7d['nameField']&&!_0x43fc7d['customField']){_0x7dee91[_0x43fc7d[_0x50aa('0x39')]['toLowerCase']()]=_0x43fc7d[_0x50aa('0x3a')][_0x50aa('0x2e')]();}else if(_[_0x50aa('0x36')]([_0x50aa('0x3b'),'picklist'],_0x43fc7d['type'])&&_0x43fc7d[_0x50aa('0x3c')]&&_0x43fc7d[_0x50aa('0x3d')]){_0x7dee91[_0x50aa('0x17')][_0x50aa('0x3e')]({'id':_0x43fc7d[_0x50aa('0x3c')],'value':_0x43fc7d[_0x50aa('0x3a')][_0x50aa('0x2e')]()});}else if(_0x43fc7d[_0x50aa('0x38')]===_0x50aa('0x3f')&&_0x43fc7d[_0x50aa('0x40')]&&_0x43fc7d[_0x50aa('0x3c')]&&_0x43fc7d['customField']){_0x1c8bb3[_0x43fc7d[_0x50aa('0x40')]]&&_0x7dee91[_0x50aa('0x17')][_0x50aa('0x3e')]({'id':_0x43fc7d['idField'],'value':_0x1c8bb3[_0x43fc7d[_0x50aa('0x40')]]['toString']()});}else if(_0x43fc7d[_0x50aa('0x38')]===_0x50aa('0x41')&&_0x43fc7d['Variable']&&_0x43fc7d[_0x50aa('0x42')][_0x50aa('0x43')]&&_0x43fc7d[_0x50aa('0x3c')]&&_0x43fc7d['customField']){_0x1c8bb3[_0x43fc7d[_0x50aa('0x42')][_0x50aa('0x43')][_0x50aa('0x44')]()]&&_0x7dee91[_0x50aa('0x17')]['push']({'id':_0x43fc7d['idField'],'value':_0x1c8bb3[_0x43fc7d[_0x50aa('0x42')][_0x50aa('0x43')][_0x50aa('0x44')]()][_0x50aa('0x2e')]()});}});}return _0x7dee91;}exports[_0x50aa('0x45')]=function(_0x3e22c6,_0x1b6a0d,_0x1a6903,_0xaff751,_0x508b6e,_0x135fe1){var _0x55aa79,_0x14f7f3;_0x135fe1['remoteUri']=intUtil[_0x50aa('0x46')](_0x135fe1[_0x50aa('0x1f')]);_0x135fe1[_0x50aa('0x47')]=intUtil['stripTrailingSlash'](_0x135fe1[_0x50aa('0x47')]);if(_0x508b6e&&_0x508b6e[_0x50aa('0x48')]){logger['info'](_0x50aa('0x49'),_0x50aa('0x4a'));_0x1b6a0d[_0x50aa('0x4b')]=util['format'](_0x50aa('0x4c'),_0x135fe1['serverUrl'],_0x1b6a0d[_0x50aa('0x4d')],md5(_0x1b6a0d[_0x50aa('0x4d')]));}else{_0x1b6a0d[_0x50aa('0x4b')]='';}headers[_0x50aa('0x4e')]=getAuth(_0x135fe1);return getUser(_0x135fe1,_0xaff751['email'])[_0x50aa('0x1d')](function(_0x284a38){_0x55aa79=_0x284a38;logger[_0x50aa('0xb')](_0x50aa('0x4f'),_0x55aa79['id']);return getEndUser(_0x135fe1,_0x1b6a0d[_0x50aa('0x10')],_0x1b6a0d[_0x50aa('0x11')]);})['then'](function(_0x4b65a2){_0x14f7f3=_0x4b65a2;logger[_0x50aa('0xb')](_0x50aa('0x50'),_0x14f7f3['id']);return getTicket(_0x135fe1,_0x55aa79,_0x14f7f3,_0x1a6903,_0x1b6a0d);})[_0x50aa('0x1d')](function(_0x56d902){if(_0x56d902&&_0x56d902['id']){logger[_0x50aa('0xb')](_0x50aa('0x51'));logger[_0x50aa('0xb')](_0x50aa('0x52'),_0x56d902['id']);logger['info']('[QUEUE]',_0x50aa('0x53'));emit(util[_0x50aa('0xe')](_0x50aa('0x54'),_0xaff751[_0x50aa('0x43')]),_0x50aa('0x55'),{'uri':util[_0x50aa('0xe')]('%s/helpdesk/tickets/%d',_0x135fe1[_0x50aa('0x1f')],_0x56d902['id'])});}})[_0x50aa('0x56')](function(_0x145f6a){logger[_0x50aa('0x57')](_0x50aa('0x49'),JSON[_0x50aa('0x31')](_0x145f6a));});};exports[_0x50aa('0x58')]=function(_0x1aa643,_0x54c15d,_0x4eca0e,_0x2473fb,_0x3a7c5e,_0x3c44fb,_0x10f24b){var _0x40f9ef,_0x2fe2ab;_0x3c44fb[_0x50aa('0x1f')]=intUtil[_0x50aa('0x46')](_0x3c44fb['remoteUri']);_0x3c44fb[_0x50aa('0x47')]=intUtil[_0x50aa('0x46')](_0x3c44fb['serverUrl']);if(_0x10f24b&&_0x10f24b['recordingFormat']&&_0x10f24b[_0x50aa('0x59')]!==_0x50aa('0x5a')){logger['info']('[OUTBOUND]',_0x50aa('0x4a'));_0x54c15d[_0x50aa('0x4b')]=util[_0x50aa('0xe')](_0x50aa('0x4c'),_0x3c44fb[_0x50aa('0x47')],_0x54c15d[_0x50aa('0x4d')],md5(_0x54c15d[_0x50aa('0x4d')]));}headers[_0x50aa('0x4e')]=getAuth(_0x3c44fb);return getUser(_0x3c44fb,_0x2473fb[_0x50aa('0x5b')])[_0x50aa('0x1d')](function(_0x5b5c27){_0x40f9ef=_0x5b5c27;logger[_0x50aa('0xb')](_0x50aa('0x4f'),_0x40f9ef['id']);return getEndUser(_0x3c44fb,_0x54c15d['destcalleridname'],_0x54c15d[_0x50aa('0x5c')]);})[_0x50aa('0x1d')](function(_0x7c292a){_0x2fe2ab=_0x7c292a;logger['info'](_0x50aa('0x50'),_0x2fe2ab['id']);return getTicket(_0x3c44fb,_0x40f9ef,_0x2fe2ab,_0x4eca0e,_0x54c15d);})[_0x50aa('0x1d')](function(_0x3528a7){if(_0x3528a7&&_0x3528a7['id']){logger[_0x50aa('0xb')](_0x50aa('0x51'));logger['info'](_0x50aa('0x52'),_0x3528a7['id']);logger[_0x50aa('0xb')](_0x50aa('0x5d'),_0x50aa('0x53'));emit(util[_0x50aa('0xe')](_0x50aa('0x54'),_0x2473fb[_0x50aa('0x43')]),_0x50aa('0x55'),{'uri':util['format'](_0x50aa('0x5e'),_0x3c44fb[_0x50aa('0x1f')],_0x3528a7['id'])});}})['catch'](function(_0x33d0a6){logger['error'](_0x50aa('0x5d'),JSON['stringify'](_0x33d0a6));});};exports[_0x50aa('0x5f')]=function(_0x52cce3,_0x45313f,_0x26d8f4,_0x3843bd,_0x35fe60,_0x65d7b1){var _0x1bc1dc,_0x4c38d3;_0x65d7b1[_0x50aa('0x1f')]=intUtil['stripTrailingSlash'](_0x65d7b1[_0x50aa('0x1f')]);_0x65d7b1['serverUrl']=intUtil[_0x50aa('0x46')](_0x65d7b1[_0x50aa('0x47')]);if(_0x35fe60&&_0x35fe60[_0x50aa('0x48')]){logger[_0x50aa('0xb')]('['+_0x45313f[_0x50aa('0x60')][_0x50aa('0x61')]()+']','Recording\x20is\x20enabled!');_0x45313f[_0x50aa('0x4b')]=util[_0x50aa('0xe')](_0x50aa('0x4c'),_0x65d7b1['serverUrl'],_0x45313f[_0x50aa('0x4d')],md5(_0x45313f[_0x50aa('0x4d')]));}else{_0x45313f[_0x50aa('0x4b')]='';}headers[_0x50aa('0x4e')]=getAuth(_0x65d7b1);return getUser(_0x65d7b1,'')[_0x50aa('0x1d')](function(_0x490d9b){_0x1bc1dc=_0x490d9b;logger[_0x50aa('0xb')](_0x50aa('0x4f'),_0x1bc1dc['id']);return getEndUser(_0x65d7b1,_0x45313f['calleridname'],_0x45313f[_0x50aa('0x11')]);})[_0x50aa('0x1d')](function(_0x41c120){_0x4c38d3=_0x41c120;logger[_0x50aa('0xb')]('The\x20Enduser\x20ID\x20is:',_0x4c38d3['id']);return getTicket(_0x65d7b1,_0x1bc1dc,_0x4c38d3,_0x26d8f4,_0x45313f);})[_0x50aa('0x1d')](function(_0x133c6a){if(_0x133c6a){logger[_0x50aa('0xb')](_0x50aa('0x51'));logger[_0x50aa('0xb')]('The\x20Ticket\x20ID\x20is:',_0x133c6a['id']);}})[_0x50aa('0x56')](function(_0x16f8b7){logger[_0x50aa('0x57')]('['+_0x45313f[_0x50aa('0x60')][_0x50aa('0x61')]()+']',JSON[_0x50aa('0x31')](_0x16f8b7));});}; \ No newline at end of file +var _0x00af=['find','contact','email','%s/api/v2/agents/me','remoteUri','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','idField','push','type','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','trigger:browser:url','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','emit','info','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!'];(function(_0x2b3bb9,_0x1556ce){var _0x5d3da5=function(_0x10e14d){while(--_0x10e14d){_0x2b3bb9['push'](_0x2b3bb9['shift']());}};_0x5d3da5(++_0x1556ce);}(_0x00af,0x99));var _0xf00a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x00af[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xf00a('0x0'));var rp=require(_0xf00a('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xf00a('0x2'));var intUtil=require(_0xf00a('0x3'));var config=require(_0xf00a('0x4'));var logger=require(_0xf00a('0x5'))(_0xf00a('0x6'));config[_0xf00a('0x7')]=_[_0xf00a('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf00a('0x9'))(new Redis(config[_0xf00a('0x7')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x16d798,_0x20b143,_0x27ae8b){io['to'](_0x16d798)[_0xf00a('0xa')](_0x20b143,_0x27ae8b);}function getTicket(_0x4cfc6f,_0x238f1c,_0x3d32ee,_0x3d87be,_0x339247){logger[_0xf00a('0xb')]('Creating\x20new\x20ticket...');var _0x569fd5=_['merge']({'responder_id':_0x238f1c['id'],'requester_id':_0x3d32ee['id'],'name':util[_0xf00a('0xc')](_0xf00a('0xd'),_0x339247[_0xf00a('0xe')]),'phone':_0x339247[_0xf00a('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf00a('0x10')](_0x3d87be[_0xf00a('0x11')],_0x339247,'\x20'),'description':intUtil[_0xf00a('0x10')](_0x3d87be[_0xf00a('0x12')],_0x339247,'
'),'tags':getTags(_0x3d87be[_0xf00a('0x13')],_0xf00a('0x14'))},getCustomFields(_0x3d87be[_0xf00a('0x15')],_0x339247));_0x569fd5[_0xf00a('0x16')]=_[_0xf00a('0x17')](_[_0xf00a('0x18')](_0x569fd5[_0xf00a('0x16')],'id'),_0xf00a('0x19'));return request({'uri':util[_0xf00a('0xc')](_0xf00a('0x1a'),_0x4cfc6f['remoteUri']),'method':_0xf00a('0x1b'),'body':_0x569fd5})[_0xf00a('0x1c')](function(_0x609453){logger[_0xf00a('0xb')](_0xf00a('0x1d'));return _0x609453;});}function getUser(_0x491b95,_0x9c0d94){if(intUtil[_0xf00a('0x1e')](_0x9c0d94)){return request({'uri':util['format'](_0xf00a('0x1f'),_0x491b95['remoteUri']),'qs':{'email':_0x9c0d94}})[_0xf00a('0x1c')](function(_0x414b70){if(_0x414b70['length']){logger[_0xf00a('0xb')](_0xf00a('0x20'));return _[_0xf00a('0x21')](_0x414b70,function(_0x3912f0){return _0x3912f0[_0xf00a('0x22')][_0xf00a('0x23')]===_0x9c0d94;});}else{logger[_0xf00a('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf00a('0xc')](_0xf00a('0x24'),_0x491b95[_0xf00a('0x25')])})[_0xf00a('0x1c')](function(_0x4f33be){logger['info'](_0xf00a('0x26'));return _0x4f33be;});}});}else{logger[_0xf00a('0xb')](_0xf00a('0x27'));return request({'uri':util[_0xf00a('0xc')](_0xf00a('0x24'),_0x491b95['remoteUri'])})[_0xf00a('0x1c')](function(_0x595318){logger[_0xf00a('0xb')](_0xf00a('0x26'));return _0x595318;});}}function getEndUser(_0x56f871,_0x215b29,_0x18b527){logger[_0xf00a('0xb')](_0xf00a('0x28'),_0x18b527);return request({'uri':util[_0xf00a('0xc')](_0xf00a('0x29'),_0x56f871['remoteUri']),'qs':{'phone':_0x18b527}})['then'](function(_0x4a8249){if(_0x4a8249[_0xf00a('0x2a')]){logger[_0xf00a('0xb')]('Enduser\x20found!');return _[_0xf00a('0x21')](_0x4a8249,{'phone':_0x18b527});}else{logger[_0xf00a('0xb')](_0xf00a('0x2b'));return request({'uri':util[_0xf00a('0xc')](_0xf00a('0x29'),_0x56f871[_0xf00a('0x25')]),'method':_0xf00a('0x1b'),'body':{'name':_0x215b29,'phone':_0x18b527}})[_0xf00a('0x1c')](function(_0x420b9b){logger['info']('Enduser\x20created.');return _0x420b9b;});}});}function getAuth(_0x4177b0){return util['format'](_0xf00a('0x2c'),new Buffer(_0x4177b0[_0xf00a('0x2d')]+':X')[_0xf00a('0x2e')](_0xf00a('0x2f')));}function request(_0x5da040){logger[_0xf00a('0x30')](_0xf00a('0x31'),JSON[_0xf00a('0x32')](_0x5da040));return rp(_['defaults'](_0x5da040,{'method':_0xf00a('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x2293e8,_0x2d0887){var _0x331cab=[];if(_0x2293e8&&_0x2293e8['length']>0x0){_0x331cab=_['map'](_0x2293e8,_0x2d0887);}return _0x331cab;}function getCustomFields(_0x4ea5e3,_0x591997){var _0x927362=[];var _0x37c3c6={'custom_fields':[]};if(_0x4ea5e3[_0xf00a('0x2a')]>0x0){_[_0xf00a('0x34')](_0x4ea5e3,function(_0x1608ef){if(_[_0xf00a('0x35')]([_0xf00a('0x36'),_0xf00a('0x37')],_0x1608ef['type'])&&_0x1608ef[_0xf00a('0x38')]&&!_0x1608ef[_0xf00a('0x39')]){_0x37c3c6[_0x1608ef['nameField'][_0xf00a('0x3a')]()]=_0x1608ef[_0xf00a('0x3b')][_0xf00a('0x2e')]();}else if(_[_0xf00a('0x35')](['string',_0xf00a('0x37')],_0x1608ef['type'])&&_0x1608ef[_0xf00a('0x3c')]&&_0x1608ef[_0xf00a('0x39')]){_0x37c3c6['custom_fields'][_0xf00a('0x3d')]({'id':_0x1608ef['idField'],'value':_0x1608ef['content'][_0xf00a('0x2e')]()});}else if(_0x1608ef[_0xf00a('0x3e')]===_0xf00a('0x3f')&&_0x1608ef[_0xf00a('0x40')]&&_0x1608ef['idField']&&_0x1608ef[_0xf00a('0x39')]){_0x591997[_0x1608ef[_0xf00a('0x40')]]&&_0x37c3c6[_0xf00a('0x16')][_0xf00a('0x3d')]({'id':_0x1608ef[_0xf00a('0x3c')],'value':_0x591997[_0x1608ef[_0xf00a('0x40')]][_0xf00a('0x2e')]()});}else if(_0x1608ef['type']===_0xf00a('0x41')&&_0x1608ef[_0xf00a('0x42')]&&_0x1608ef[_0xf00a('0x42')][_0xf00a('0x14')]&&_0x1608ef['idField']&&_0x1608ef[_0xf00a('0x39')]){_0x591997[_0x1608ef['Variable']['name']['toLowerCase']()]&&_0x37c3c6['custom_fields'][_0xf00a('0x3d')]({'id':_0x1608ef['idField'],'value':_0x591997[_0x1608ef[_0xf00a('0x42')][_0xf00a('0x14')][_0xf00a('0x3a')]()][_0xf00a('0x2e')]()});}});}return _0x37c3c6;}exports[_0xf00a('0x43')]=function(_0x32eee4,_0x4b9802,_0x1b670c,_0x409f21,_0x1adf8f,_0x5690c1){var _0x11d94c,_0xbc5314;_0x5690c1[_0xf00a('0x25')]=intUtil[_0xf00a('0x44')](_0x5690c1[_0xf00a('0x25')]);_0x5690c1[_0xf00a('0x45')]=intUtil[_0xf00a('0x44')](_0x5690c1[_0xf00a('0x45')]);if(_0x1adf8f&&_0x1adf8f[_0xf00a('0x46')]){logger[_0xf00a('0xb')](_0xf00a('0x47'),'Recording\x20is\x20enabled!');_0x4b9802['recordingURL']=util[_0xf00a('0xc')](_0xf00a('0x48'),_0x5690c1[_0xf00a('0x45')],_0x4b9802[_0xf00a('0x49')],md5(_0x4b9802['uniqueid']));}else{_0x4b9802[_0xf00a('0x4a')]='';}headers[_0xf00a('0x4b')]=getAuth(_0x5690c1);return getUser(_0x5690c1,_0x409f21[_0xf00a('0x23')])[_0xf00a('0x1c')](function(_0x54aadd){_0x11d94c=_0x54aadd;logger[_0xf00a('0xb')](_0xf00a('0x4c'),_0x11d94c['id']);return getEndUser(_0x5690c1,_0x4b9802[_0xf00a('0xe')],_0x4b9802[_0xf00a('0xf')]);})[_0xf00a('0x1c')](function(_0x5deae3){_0xbc5314=_0x5deae3;logger[_0xf00a('0xb')](_0xf00a('0x4d'),_0xbc5314['id']);return getTicket(_0x5690c1,_0x11d94c,_0xbc5314,_0x1b670c,_0x4b9802);})[_0xf00a('0x1c')](function(_0x1acbe4){if(_0x1acbe4&&_0x1acbe4['id']){logger[_0xf00a('0xb')]('Ticket\x20created!');logger[_0xf00a('0xb')](_0xf00a('0x4e'),_0x1acbe4['id']);logger[_0xf00a('0xb')]('[QUEUE]',_0xf00a('0x4f'));emit(util['format'](_0xf00a('0x50'),_0x409f21[_0xf00a('0x14')]),'trigger:browser:url',{'uri':util['format'](_0xf00a('0x51'),_0x5690c1['remoteUri'],_0x1acbe4['id'])});}})[_0xf00a('0x52')](function(_0x310a67){logger[_0xf00a('0x53')](_0xf00a('0x47'),JSON[_0xf00a('0x32')](_0x310a67));});};exports[_0xf00a('0x54')]=function(_0x1a535e,_0x35a584,_0x5923a8,_0x23cb57,_0x5efcb8,_0x43b6c7,_0x3ade08){var _0x2ee7e9,_0x403a7b;_0x43b6c7[_0xf00a('0x25')]=intUtil[_0xf00a('0x44')](_0x43b6c7[_0xf00a('0x25')]);_0x43b6c7[_0xf00a('0x45')]=intUtil['stripTrailingSlash'](_0x43b6c7['serverUrl']);if(_0x3ade08&&_0x3ade08['recordingFormat']&&_0x3ade08['recordingFormat']!==_0xf00a('0x55')){logger[_0xf00a('0xb')](_0xf00a('0x56'),_0xf00a('0x57'));_0x35a584[_0xf00a('0x4a')]=util[_0xf00a('0xc')](_0xf00a('0x48'),_0x43b6c7['serverUrl'],_0x35a584[_0xf00a('0x49')],md5(_0x35a584[_0xf00a('0x49')]));}headers[_0xf00a('0x4b')]=getAuth(_0x43b6c7);return getUser(_0x43b6c7,_0x23cb57[_0xf00a('0x23')])[_0xf00a('0x1c')](function(_0x3e375a){_0x2ee7e9=_0x3e375a;logger[_0xf00a('0xb')](_0xf00a('0x4c'),_0x2ee7e9['id']);return getEndUser(_0x43b6c7,_0x35a584[_0xf00a('0x58')],_0x35a584[_0xf00a('0x59')]);})[_0xf00a('0x1c')](function(_0x51b11f){_0x403a7b=_0x51b11f;logger[_0xf00a('0xb')]('The\x20Enduser\x20ID\x20is:',_0x403a7b['id']);return getTicket(_0x43b6c7,_0x2ee7e9,_0x403a7b,_0x5923a8,_0x35a584);})[_0xf00a('0x1c')](function(_0x19eee3){if(_0x19eee3&&_0x19eee3['id']){logger['info']('Ticket\x20created!');logger[_0xf00a('0xb')]('The\x20Ticket\x20ID\x20is:',_0x19eee3['id']);logger['info'](_0xf00a('0x56'),_0xf00a('0x4f'));emit(util[_0xf00a('0xc')]('user:%s',_0x23cb57[_0xf00a('0x14')]),_0xf00a('0x5a'),{'uri':util[_0xf00a('0xc')](_0xf00a('0x51'),_0x43b6c7[_0xf00a('0x25')],_0x19eee3['id'])});}})[_0xf00a('0x52')](function(_0x432001){logger[_0xf00a('0x53')](_0xf00a('0x56'),JSON['stringify'](_0x432001));});};exports['unmanaged']=function(_0x1a4cd5,_0x2fde3d,_0x1b757f,_0x56b3c3,_0xb0f928,_0x1ebac2){var _0x3687a4,_0x486d21;_0x1ebac2[_0xf00a('0x25')]=intUtil[_0xf00a('0x44')](_0x1ebac2['remoteUri']);_0x1ebac2[_0xf00a('0x45')]=intUtil['stripTrailingSlash'](_0x1ebac2[_0xf00a('0x45')]);if(_0xb0f928&&_0xb0f928[_0xf00a('0x46')]){logger[_0xf00a('0xb')]('['+_0x2fde3d[_0xf00a('0x5b')][_0xf00a('0x5c')]()+']','Recording\x20is\x20enabled!');_0x2fde3d['recordingURL']=util[_0xf00a('0xc')](_0xf00a('0x48'),_0x1ebac2[_0xf00a('0x45')],_0x2fde3d[_0xf00a('0x49')],md5(_0x2fde3d[_0xf00a('0x49')]));}else{_0x2fde3d[_0xf00a('0x4a')]='';}headers[_0xf00a('0x4b')]=getAuth(_0x1ebac2);return getUser(_0x1ebac2,'')[_0xf00a('0x1c')](function(_0x2097ff){_0x3687a4=_0x2097ff;logger[_0xf00a('0xb')]('The\x20User\x20ID\x20is:',_0x3687a4['id']);return getEndUser(_0x1ebac2,_0x2fde3d[_0xf00a('0xe')],_0x2fde3d['calleridnum']);})[_0xf00a('0x1c')](function(_0x32c9cb){_0x486d21=_0x32c9cb;logger[_0xf00a('0xb')]('The\x20Enduser\x20ID\x20is:',_0x486d21['id']);return getTicket(_0x1ebac2,_0x3687a4,_0x486d21,_0x1b757f,_0x2fde3d);})[_0xf00a('0x1c')](function(_0x52a474){if(_0x52a474){logger[_0xf00a('0xb')]('Ticket\x20created!');logger[_0xf00a('0xb')](_0xf00a('0x4e'),_0x52a474['id']);}})[_0xf00a('0x52')](function(_0x1d6381){logger['error']('['+_0x2fde3d[_0xf00a('0x5b')][_0xf00a('0x5c')]()+']',JSON[_0xf00a('0x32')](_0x1d6381));});}; \ 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 ac4d317..596b503 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 _0xae62=['destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','Getting\x20admin\x20information','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','headers','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','message','/api/lookup?q=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','then','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','Subjects','getString','Descriptions','Contact','add','ticketId','task','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash'];(function(_0x4a93bb,_0x495404){var _0x208468=function(_0x1d82b7){while(--_0x1d82b7){_0x4a93bb['push'](_0x4a93bb['shift']());}};_0x208468(++_0x495404);}(_0xae62,0xb3));var _0x2ae6=function(_0x263296,_0x207799){_0x263296=_0x263296-0x0;var _0x2488bf=_0xae62[_0x263296];return _0x2488bf;};'use strict';var _=require('lodash');var rp=require(_0x2ae6('0x0'));var md5=require(_0x2ae6('0x1'));var util=require(_0x2ae6('0x2'));var moment=require('moment');var Promise=require(_0x2ae6('0x3'));var Redis=require(_0x2ae6('0x4'));var intUtil=require(_0x2ae6('0x5'));var config=require(_0x2ae6('0x6'));var logger=require(_0x2ae6('0x7'))(_0x2ae6('0x8'));config[_0x2ae6('0x9')]=_[_0x2ae6('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2ae6('0xb'))(new Redis(config[_0x2ae6('0x9')]));function getAdminId(_0x2ce77b,_0x3e9578,_0x8fd2fe,_0x13644d){return new Promise(function(_0x1b0a66,_0x175193){var _0xd94f73=![];var _0x8b2255={'method':_0x2ae6('0xc'),'uri':_0x13644d+_0x2ae6('0xd'),'json':!![]};_0x8b2255['headers']=_0x8fd2fe;logger['info'](_0x2ae6('0xe'));return rp(_0x8b2255)['then'](function(_0x5efdec){if(_0x5efdec){var _0x5e0153=_0x5efdec['users'];var _0x567924=null;for(_0x567924=0x0;_0x567924<_0x5e0153[_0x2ae6('0xf')];_0x567924++){if(_0x5e0153[_0x567924][_0x2ae6('0x10')]===_0x2ce77b[_0x2ae6('0x11')]){_0x2ce77b[_0x2ae6('0x12')]=_0x5e0153[_0x567924]['id'];_0xd94f73=!![];}}if(_0xd94f73){logger[_0x2ae6('0x13')](_0x2ae6('0x14'),_0x2ce77b['adminId']);_0x1b0a66(_0x2ce77b);}else{_0x175193({'statusCode':0x194,'message':_0x2ae6('0x15')});}}else{_0x175193({'statusCode':0x194,'message':_0x2ae6('0x15')});}})[_0x2ae6('0x16')](function(_0x5cac78){logger[_0x2ae6('0x17')]('['+[_0x3e9578[_0x2ae6('0x18')]()]+']',_0x5cac78['message']);_0x175193(_0x5cac78);});});}function getUser(_0x2b4cbd,_0x135bad,_0x46bc68){return function(_0x24dd8e){return new Promise(function(_0x139702,_0xb4c2eb){var _0x334b2e={'method':_0x2ae6('0xc'),'uri':_0x46bc68+'/api/selector/owners','json':!![]};_0x334b2e[_0x2ae6('0x19')]=_0x135bad;logger[_0x2ae6('0x13')](_0x2ae6('0x1a'));return rp(_0x334b2e)['then'](function(_0x570fc3){if(_0x570fc3){var _0x7b8e94=_0x570fc3[_0x2ae6('0x1b')];var _0x318380=![];var _0x43b470=null;if(_0x24dd8e[_0x2ae6('0x1c')]!==null){logger[_0x2ae6('0x13')](_0x2ae6('0x1d'),_0x24dd8e[_0x2ae6('0x1c')]);_0x24dd8e[_0x2ae6('0x1e')]=_0x24dd8e[_0x2ae6('0x1c')];for(_0x43b470=0x0;_0x43b470<_0x7b8e94['length'];_0x43b470++){if(_0x7b8e94[_0x43b470][_0x2ae6('0x10')]===_0x24dd8e[_0x2ae6('0x1c')]){_0x318380=!![];_0x24dd8e['userId']=_0x7b8e94[_0x43b470]['id'];logger[_0x2ae6('0x13')](_0x2ae6('0x1f'),_0x24dd8e[_0x2ae6('0x20')]);}}}if(!_0x318380){logger[_0x2ae6('0x13')]('Admin\x20selected');_0x24dd8e[_0x2ae6('0x1e')]=_0x24dd8e[_0x2ae6('0x11')];_0x24dd8e['userId']=_0x24dd8e[_0x2ae6('0x12')];_0x318380=!![];}if(_0x318380){_0x139702(_0x24dd8e);}else{_0xb4c2eb({'statusCode':0x194,'message':_0x2ae6('0x15')});}}else{_0xb4c2eb({'statusCode':0x194,'message':_0x2ae6('0x15')});}})[_0x2ae6('0x16')](function(_0xd71c5a){logger[_0x2ae6('0x17')]('['+[_0x2b4cbd['toUpperCase']()]+']',_0xd71c5a[_0x2ae6('0x21')]);_0xb4c2eb(_0xd71c5a);});});};}function searchContact(_0x47b524,_0x3581fd,_0x13a353,_0x3c6462){return new Promise(function(_0x1c19bf,_0x4920b5){var _0x8c7e12={'method':'GET','headers':_0x3581fd,'uri':_0x47b524+_0x2ae6('0x22')+_0x3c6462+'&f='+_0x13a353+_0x2ae6('0x23'),'json':!![]};rp(_0x8c7e12)['then'](function(_0x737f6f){var _0x26bc6a=_[_0x2ae6('0x24')](_0x737f6f[_0x2ae6('0x25')][_0x2ae6('0x25')],[_0x13a353,_0x3c6462]);_0x1c19bf(_0x26bc6a);})[_0x2ae6('0x16')](function(_0x5638b2){_0x4920b5(_0x5638b2);});});}function getEndUser(_0x54e558,_0x1c62ba,_0x2a85e0){return function(_0x2d046d){return new Promise(function(_0x17688f,_0xce1226){logger['info'](util[_0x2ae6('0x26')](_0x2ae6('0x27'),_0x2d046d[_0x2ae6('0x28')]));searchContact(_0x2a85e0,_0x1c62ba,_0x2ae6('0x29'),_0x2d046d[_0x2ae6('0x28')])[_0x2ae6('0x2a')](function(_0x5c5e3c){if(_0x5c5e3c){_0x2d046d['endUserId']=_0x5c5e3c['id'];logger['info'](_0x2ae6('0x2b'),_0x2d046d[_0x2ae6('0x2c')]);return _0x17688f(_0x2d046d);}searchContact(_0x2a85e0,_0x1c62ba,_0x2ae6('0x2d'),_0x2d046d[_0x2ae6('0x28')])[_0x2ae6('0x2a')](function(_0x3c2983){if(_0x3c2983){_0x2d046d[_0x2ae6('0x2c')]=_0x3c2983['id'];logger[_0x2ae6('0x13')](_0x2ae6('0x2e'),_0x2d046d[_0x2ae6('0x2c')]);return _0x17688f(_0x2d046d);}createEndUser(_0x2d046d,_0x54e558,_0x1c62ba,_0x2a85e0)[_0x2ae6('0x2a')](function(_0x2d1066){logger['info'](_0x2ae6('0x2f'),_0x2d1066['endUserId']);return _0x17688f(_0x2d1066);});});})['catch'](function(_0x151c1a){_0xce1226(_0x151c1a);});});};}function createEndUser(_0x2e4a67,_0x22c68c,_0x2650a2,_0x45fa87){return new Promise(function(_0x16a7a9,_0x20425d){var _0x27e7c3=moment();var _0x3c5aac={'method':_0x2ae6('0x30'),'uri':_0x45fa87+_0x2ae6('0x31'),'body':{'contact':{'last_name':_0x2e4a67[_0x2ae6('0x28')],'work_number':_0x2e4a67[_0x2ae6('0x28')],'mobile_number':_0x2e4a67[_0x2ae6('0x28')],'owner_id':_0x2e4a67[_0x2ae6('0x20')],'created_at':_0x27e7c3[_0x2ae6('0x26')](_0x2ae6('0x32'))}},'json':!![]};_0x3c5aac[_0x2ae6('0x19')]=_0x2650a2;logger[_0x2ae6('0x13')](_0x2ae6('0x33'));return rp(_0x3c5aac)['then'](function(_0x36ec6e){_0x2e4a67['endUserId']=_0x36ec6e[_0x2ae6('0x34')]['id'];_0x16a7a9(_0x2e4a67);})['catch'](function(_0x5bbc9c){logger[_0x2ae6('0x17')]('['+[_0x22c68c[_0x2ae6('0x18')]()]+']',_0x5bbc9c['message']);_0x20425d(_0x5bbc9c[_0x2ae6('0x21')]);});});}function getTicket(_0x145b6f,_0x461031,_0x2ed86d,_0x689ed0,_0xaabc7e){return function(_0x30ee35){logger[_0x2ae6('0x13')](_0x2ae6('0x35'));return new Promise(function(_0x2530e6,_0x47bb87){var _0x201406=moment();var _0x1524fc={'method':'POST','uri':_0x2ed86d+'/api/tasks','body':{'title':intUtil['getString'](_0x689ed0[_0x2ae6('0x36')],_0xaabc7e,'\x20'),'description':intUtil[_0x2ae6('0x37')](_0x689ed0[_0x2ae6('0x38')],_0xaabc7e,'\x0a'),'owner_id':_0x30ee35[_0x2ae6('0x20')],'creater_id':_0x30ee35[_0x2ae6('0x12')],'targetable_id':_0x30ee35[_0x2ae6('0x2c')],'targetable_type':_0x2ae6('0x39'),'created_at':_0x201406['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x201406[_0x2ae6('0x3a')](0x1e,'m')[_0x2ae6('0x26')](_0x2ae6('0x32'))},'json':!![]};_0x1524fc[_0x2ae6('0x19')]=_0x461031;return rp(_0x1524fc)[_0x2ae6('0x2a')](function(_0x8bfe06){_0x30ee35[_0x2ae6('0x3b')]=_0x8bfe06[_0x2ae6('0x3c')]['id'];logger['info']('Task\x20created:',_0x30ee35[_0x2ae6('0x3b')]);_0x2530e6(_0x30ee35);})['catch'](function(_0x3a9278){logger[_0x2ae6('0x17')]('['+[_0x145b6f[_0x2ae6('0x18')]()]+']',_0x3a9278[_0x2ae6('0x21')]);_0x47bb87(_0x3a9278['message']);});});};}function emit(_0x372b7f,_0x37aef8,_0x37e80e){var _0xfe9e10={'uri':_0x372b7f+'/contacts/'+_0x37e80e};io['to'](util['format']('user:%s',_0x37aef8))['emit'](_0x2ae6('0x3d'),_0xfe9e10);}exports['cs']=function(_0x48ca06,_0x1d53af,_0x3938d2,_0x32e4df,_0x26b691,_0x4e3e41,_0x3e3c05,_0x5899f2){var _0x2b5aff={};var _0x18bf18={'Authorization':_0x2ae6('0x3e')+_0x4e3e41[_0x2ae6('0x3f')]};_0x4e3e41[_0x2ae6('0x40')]=intUtil['stripTrailingSlash'](_0x4e3e41[_0x2ae6('0x40')]);_0x4e3e41[_0x2ae6('0x41')]=intUtil[_0x2ae6('0x42')](_0x4e3e41[_0x2ae6('0x41')]);var _0x9e5d29=_0x4e3e41[_0x2ae6('0x40')];_0x2b5aff[_0x2ae6('0x11')]=_0x4e3e41['username'];_0x2b5aff[_0x2ae6('0x28')]=_0x5899f2['toLowerCase']()==='outbound'?_0x1d53af[_0x2ae6('0x43')]:_0x1d53af[_0x2ae6('0x44')];_0x2b5aff[_0x2ae6('0x45')]=_0x5899f2===_0x2ae6('0x46')||_0x5899f2===_0x2ae6('0x47')?_0x2ae6('0x46'):_0x2ae6('0x48');if(_0x32e4df){_0x2b5aff['agentEmail']=_0x32e4df[_0x2ae6('0x10')];}var _0x4a1f28=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4e3e41['serverUrl'],_0x1d53af[_0x2ae6('0x49')],md5(_0x1d53af[_0x2ae6('0x49')]));if(_0x26b691&&_0x26b691[_0x2ae6('0x4a')]){logger[_0x2ae6('0x13')](_0x2ae6('0x4b'),_0x2ae6('0x4c'));_0x1d53af[_0x2ae6('0x4d')]=_0x4a1f28;}else if(_0x3e3c05&&_0x3e3c05['recordingFormat']&&_0x3e3c05['recordingFormat']!==_0x2ae6('0x4e')){logger[_0x2ae6('0x13')](_0x2ae6('0x4f'),_0x2ae6('0x4c'));_0x1d53af[_0x2ae6('0x4d')]=_0x4a1f28;}else{_0x1d53af[_0x2ae6('0x4d')]='';}return getAdminId(_0x2b5aff,_0x5899f2,_0x18bf18,_0x9e5d29)[_0x2ae6('0x2a')](getUser(_0x5899f2,_0x18bf18,_0x9e5d29))['then'](getEndUser(_0x5899f2,_0x18bf18,_0x9e5d29))[_0x2ae6('0x2a')](getTicket(_0x5899f2,_0x18bf18,_0x9e5d29,_0x3938d2,_0x1d53af))[_0x2ae6('0x2a')](function(_0x4efe90){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x4efe90['ticketId']));if(_0x5899f2!==_0x2ae6('0x47')){logger[_0x2ae6('0x13')]('['+[_0x5899f2[_0x2ae6('0x18')]()]+']',_0x2ae6('0x50'));emit(_0x9e5d29,_0x32e4df['name'],_0x4efe90[_0x2ae6('0x2c')]);}})[_0x2ae6('0x16')](function(_0x4f4708){logger[_0x2ae6('0x17')]('['+[_0x5899f2[_0x2ae6('0x18')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x2ae6('0x51')](_0x4f4708,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x781a=['Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','format','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','headers','info','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts'];(function(_0xbfe7f2,_0x4ed8a4){var _0x48895=function(_0x151143){while(--_0x151143){_0xbfe7f2['push'](_0xbfe7f2['shift']());}};_0x48895(++_0x4ed8a4);}(_0x781a,0x1ea));var _0xa781=function(_0x3e5ac1,_0x213ec1){_0x3e5ac1=_0x3e5ac1-0x0;var _0x5c9069=_0x781a[_0x3e5ac1];return _0x5c9069;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xa781('0x0'));var util=require(_0xa781('0x1'));var moment=require(_0xa781('0x2'));var Promise=require(_0xa781('0x3'));var Redis=require(_0xa781('0x4'));var intUtil=require('./util');var config=require(_0xa781('0x5'));var logger=require(_0xa781('0x6'))(_0xa781('0x7'));config[_0xa781('0x8')]=_[_0xa781('0x9')](config[_0xa781('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xa781('0xa'))(new Redis(config[_0xa781('0x8')]));function getAdminId(_0x419192,_0x4ab19b,_0x305f47,_0x3ef701){return new Promise(function(_0x5d10d1,_0x14dd5c){var _0x38d97d=![];var _0x291771={'method':_0xa781('0xb'),'uri':_0x3ef701+_0xa781('0xc'),'json':!![]};_0x291771['headers']=_0x305f47;logger['info'](_0xa781('0xd'));return rp(_0x291771)[_0xa781('0xe')](function(_0x53ae4c){if(_0x53ae4c){var _0x36d143=_0x53ae4c[_0xa781('0xf')];var _0x377cfc=null;for(_0x377cfc=0x0;_0x377cfc<_0x36d143[_0xa781('0x10')];_0x377cfc++){if(_0x36d143[_0x377cfc][_0xa781('0x11')]===_0x419192[_0xa781('0x12')]){_0x419192[_0xa781('0x13')]=_0x36d143[_0x377cfc]['id'];_0x38d97d=!![];}}if(_0x38d97d){logger['info']('Admin\x20found:',_0x419192[_0xa781('0x13')]);_0x5d10d1(_0x419192);}else{_0x14dd5c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x14dd5c({'statusCode':0x194,'message':_0xa781('0x14')});}})[_0xa781('0x15')](function(_0x4a5542){logger[_0xa781('0x16')]('['+[_0x4ab19b['toUpperCase']()]+']',_0x4a5542[_0xa781('0x17')]);_0x14dd5c(_0x4a5542);});});}function getUser(_0x5a103b,_0x4934fc,_0x33df60){return function(_0x4b30b8){return new Promise(function(_0x3d3fae,_0x40e123){var _0x162a2f={'method':_0xa781('0xb'),'uri':_0x33df60+_0xa781('0xc'),'json':!![]};_0x162a2f[_0xa781('0x18')]=_0x4934fc;logger[_0xa781('0x19')](_0xa781('0x1a'));return rp(_0x162a2f)[_0xa781('0xe')](function(_0x3fb6ca){if(_0x3fb6ca){var _0x344bb3=_0x3fb6ca[_0xa781('0xf')];var _0xd6fdbd=![];var _0x2ae94a=null;if(_0x4b30b8[_0xa781('0x1b')]!==null){logger[_0xa781('0x19')](_0xa781('0x1c'),_0x4b30b8[_0xa781('0x1b')]);_0x4b30b8['userEmail']=_0x4b30b8['agentEmail'];for(_0x2ae94a=0x0;_0x2ae94a<_0x344bb3[_0xa781('0x10')];_0x2ae94a++){if(_0x344bb3[_0x2ae94a][_0xa781('0x11')]===_0x4b30b8[_0xa781('0x1b')]){_0xd6fdbd=!![];_0x4b30b8[_0xa781('0x1d')]=_0x344bb3[_0x2ae94a]['id'];logger[_0xa781('0x19')](_0xa781('0x1e'),_0x4b30b8[_0xa781('0x1d')]);}}}if(!_0xd6fdbd){logger[_0xa781('0x19')](_0xa781('0x1f'));_0x4b30b8['userEmail']=_0x4b30b8[_0xa781('0x12')];_0x4b30b8['userId']=_0x4b30b8[_0xa781('0x13')];_0xd6fdbd=!![];}if(_0xd6fdbd){_0x3d3fae(_0x4b30b8);}else{_0x40e123({'statusCode':0x194,'message':_0xa781('0x14')});}}else{_0x40e123({'statusCode':0x194,'message':_0xa781('0x14')});}})[_0xa781('0x15')](function(_0x1ecb0b){logger[_0xa781('0x16')]('['+[_0x5a103b[_0xa781('0x20')]()]+']',_0x1ecb0b[_0xa781('0x17')]);_0x40e123(_0x1ecb0b);});});};}function searchContact(_0x32182d,_0x50ff43,_0x384804,_0x28bf1a){return new Promise(function(_0x3bc9cf,_0x40f2a1){var _0x5c2cac={'method':_0xa781('0xb'),'headers':_0x50ff43,'uri':_0x32182d+_0xa781('0x21')+_0x28bf1a+_0xa781('0x22')+_0x384804+_0xa781('0x23'),'json':!![]};rp(_0x5c2cac)['then'](function(_0x58a8b4){var _0x46b2c6=_[_0xa781('0x24')](_0x58a8b4[_0xa781('0x25')][_0xa781('0x25')],[_0x384804,_0x28bf1a]);_0x3bc9cf(_0x46b2c6);})[_0xa781('0x15')](function(_0x532829){_0x40f2a1(_0x532829);});});}function getEndUser(_0x2147a1,_0x17c8e7,_0x38abee){return function(_0x27088c){return new Promise(function(_0xdd0bd6,_0x509d0a){logger[_0xa781('0x19')](util['format'](_0xa781('0x26'),_0x27088c[_0xa781('0x27')]));searchContact(_0x38abee,_0x17c8e7,_0xa781('0x28'),_0x27088c['contactNumber'])[_0xa781('0xe')](function(_0x53f47d){if(_0x53f47d){_0x27088c[_0xa781('0x29')]=_0x53f47d['id'];logger[_0xa781('0x19')](_0xa781('0x2a'),_0x27088c['endUserId']);return _0xdd0bd6(_0x27088c);}searchContact(_0x38abee,_0x17c8e7,_0xa781('0x2b'),_0x27088c[_0xa781('0x27')])[_0xa781('0xe')](function(_0x292d6d){if(_0x292d6d){_0x27088c[_0xa781('0x29')]=_0x292d6d['id'];logger[_0xa781('0x19')](_0xa781('0x2c'),_0x27088c[_0xa781('0x29')]);return _0xdd0bd6(_0x27088c);}createEndUser(_0x27088c,_0x2147a1,_0x17c8e7,_0x38abee)[_0xa781('0xe')](function(_0x50d8d4){logger[_0xa781('0x19')](_0xa781('0x2d'),_0x50d8d4[_0xa781('0x29')]);return _0xdd0bd6(_0x50d8d4);});});})[_0xa781('0x15')](function(_0x24df8e){_0x509d0a(_0x24df8e);});});};}function createEndUser(_0x33fd60,_0x7de930,_0x530444,_0x331ef2){return new Promise(function(_0x5f1e45,_0x2e96c3){var _0xc13b5=moment();var _0x4dcad1={'method':_0xa781('0x2e'),'uri':_0x331ef2+_0xa781('0x2f'),'body':{'contact':{'last_name':_0x33fd60[_0xa781('0x27')],'work_number':_0x33fd60[_0xa781('0x27')],'mobile_number':_0x33fd60[_0xa781('0x27')],'owner_id':_0x33fd60[_0xa781('0x1d')],'created_at':_0xc13b5['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x4dcad1[_0xa781('0x18')]=_0x530444;logger[_0xa781('0x19')](_0xa781('0x30'));return rp(_0x4dcad1)[_0xa781('0xe')](function(_0x34312c){_0x33fd60['endUserId']=_0x34312c[_0xa781('0x31')]['id'];_0x5f1e45(_0x33fd60);})[_0xa781('0x15')](function(_0x57c34e){logger[_0xa781('0x16')]('['+[_0x7de930[_0xa781('0x20')]()]+']',_0x57c34e[_0xa781('0x17')]);_0x2e96c3(_0x57c34e[_0xa781('0x17')]);});});}function getTicket(_0x3e61ec,_0x5d9cb2,_0x3b5e66,_0x60e8fb,_0x2b3a6a){return function(_0x30d041){logger[_0xa781('0x19')](_0xa781('0x32'));return new Promise(function(_0x4998c5,_0xa59589){var _0x26f64a=moment();var _0x1ddbe8={'method':'POST','uri':_0x3b5e66+_0xa781('0x33'),'body':{'title':intUtil[_0xa781('0x34')](_0x60e8fb[_0xa781('0x35')],_0x2b3a6a,'\x20'),'description':intUtil[_0xa781('0x34')](_0x60e8fb[_0xa781('0x36')],_0x2b3a6a,'\x0a'),'owner_id':_0x30d041[_0xa781('0x1d')],'creater_id':_0x30d041[_0xa781('0x13')],'targetable_id':_0x30d041[_0xa781('0x29')],'targetable_type':_0xa781('0x37'),'created_at':_0x26f64a[_0xa781('0x38')](_0xa781('0x39')),'due_date':_0x26f64a[_0xa781('0x3a')](0x1e,'m')[_0xa781('0x38')](_0xa781('0x39'))},'json':!![]};_0x1ddbe8[_0xa781('0x18')]=_0x5d9cb2;return rp(_0x1ddbe8)[_0xa781('0xe')](function(_0x58cb0e){_0x30d041[_0xa781('0x3b')]=_0x58cb0e[_0xa781('0x3c')]['id'];logger[_0xa781('0x19')]('Task\x20created:',_0x30d041[_0xa781('0x3b')]);_0x4998c5(_0x30d041);})[_0xa781('0x15')](function(_0xb9eb5c){logger[_0xa781('0x16')]('['+[_0x3e61ec[_0xa781('0x20')]()]+']',_0xb9eb5c[_0xa781('0x17')]);_0xa59589(_0xb9eb5c[_0xa781('0x17')]);});});};}function emit(_0x43e9d7,_0x301167,_0x1b2393){var _0x4c2bfc={'uri':_0x43e9d7+_0xa781('0x3d')+_0x1b2393};io['to'](util['format'](_0xa781('0x3e'),_0x301167))[_0xa781('0x3f')]('trigger:browser:url',_0x4c2bfc);}exports['cs']=function(_0x3ec0a4,_0x2891dd,_0x3babdd,_0x23a4df,_0x34afd9,_0x24a34b,_0x5b5f95,_0x244a07){var _0x3375a8={};var _0x4b2fae={'Authorization':_0xa781('0x40')+_0x24a34b[_0xa781('0x41')]};_0x24a34b[_0xa781('0x42')]=intUtil[_0xa781('0x43')](_0x24a34b[_0xa781('0x42')]);_0x24a34b[_0xa781('0x44')]=intUtil[_0xa781('0x43')](_0x24a34b['serverUrl']);var _0x379275=_0x24a34b[_0xa781('0x42')];_0x3375a8[_0xa781('0x12')]=_0x24a34b[_0xa781('0x45')];_0x3375a8['contactNumber']=_0x244a07[_0xa781('0x46')]()===_0xa781('0x47')?_0x2891dd[_0xa781('0x48')]:_0x2891dd[_0xa781('0x49')];_0x3375a8[_0xa781('0x4a')]=_0x244a07==='queue'||_0x244a07===_0xa781('0x4b')?_0xa781('0x4c'):_0xa781('0x47');if(_0x23a4df){_0x3375a8[_0xa781('0x1b')]=_0x23a4df[_0xa781('0x11')];}var _0x4b94a5=util[_0xa781('0x38')](_0xa781('0x4d'),_0x24a34b[_0xa781('0x44')],_0x2891dd['uniqueid'],md5(_0x2891dd['uniqueid']));if(_0x34afd9&&_0x34afd9[_0xa781('0x4e')]){logger[_0xa781('0x19')]('[QUEUE]',_0xa781('0x4f'));_0x2891dd[_0xa781('0x50')]=_0x4b94a5;}else if(_0x5b5f95&&_0x5b5f95[_0xa781('0x51')]&&_0x5b5f95['recordingFormat']!=='none'){logger[_0xa781('0x19')](_0xa781('0x52'),_0xa781('0x4f'));_0x2891dd[_0xa781('0x50')]=_0x4b94a5;}else{_0x2891dd[_0xa781('0x50')]='';}return getAdminId(_0x3375a8,_0x244a07,_0x4b2fae,_0x379275)[_0xa781('0xe')](getUser(_0x244a07,_0x4b2fae,_0x379275))[_0xa781('0xe')](getEndUser(_0x244a07,_0x4b2fae,_0x379275))['then'](getTicket(_0x244a07,_0x4b2fae,_0x379275,_0x3babdd,_0x2891dd))[_0xa781('0xe')](function(_0x21a2be){logger['info'](util[_0xa781('0x38')](_0xa781('0x53'),_0x21a2be[_0xa781('0x3b')]));if(_0x244a07!==_0xa781('0x4b')){logger[_0xa781('0x19')]('['+[_0x244a07[_0xa781('0x20')]()]+']',_0xa781('0x54'));emit(_0x379275,_0x23a4df[_0xa781('0x55')],_0x21a2be[_0xa781('0x29')]);}})[_0xa781('0x15')](function(_0x1ee4e7){logger['error']('['+[_0x244a07[_0xa781('0x20')]()]+_0xa781('0x56'),util[_0xa781('0x57')](_0x1ee4e7,{'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 891005b..5d4a228 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 _0x175e=['./zoho','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','util','./salesforce','./freshdesk'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x175e,0x138));var _0xe175=function(_0x3314cc,_0x158c72){_0x3314cc=_0x3314cc-0x0;var _0x2ef318=_0x175e[_0x3314cc];return _0x2ef318;};'use strict';var _=require('lodash');var util=require(_0xe175('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0xe175('0x1'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xe175('0x2'));var zoho=require(_0xe175('0x3'));var desk=require('./desk');var vtiger=require(_0xe175('0x4'));var servicenow=require(_0xe175('0x5'));var dynamics365=require(_0xe175('0x6'));var freshsales=require('./freshsales');var integrations=[_0xe175('0x7'),_0xe175('0x8'),'sugarcrm',_0xe175('0x9'),_0xe175('0xa'),_0xe175('0xb'),_0xe175('0xc'),_0xe175('0xd'),_0xe175('0xe'),_0xe175('0xf')];exports[_0xe175('0x10')]=function(_0x9137c0,_0x4e4454,_0x559dfe,_0x3111db,_0x7ec81e,_0x1e4934){if(_0x559dfe){if(_['includes'](integrations,_0x9137c0[_0xe175('0x11')][_0xe175('0x12')]())){try{var _0x2f9cdf=null;var _0x24c38c='';var _0xf3dabc=_0x559dfe[_0x9137c0[_0xe175('0x11')][_0xe175('0x12')]()];if(_0xf3dabc){var _0x56cda0=_0xf3dabc[_0x9137c0[_0xe175('0x13')]];if(_0x56cda0){var _0x35b49a=_[_0xe175('0x14')](_0x56cda0[_0xe175('0x15')],{'id':parseInt(_0x9137c0[_0xe175('0x16')],0xa)});if(_0x35b49a){if(_0x3111db){if(_0x7ec81e&&_0x4e4454['queue']){_0x24c38c=_0xe175('0x17');}else if(_0x4e4454[_0xe175('0x18')]){_0x24c38c='outbound';}else{console[_0xe175('0x19')](_0xe175('0x1a'),_0x4e4454);}}else{_0x24c38c=_0xe175('0x1b');}switch(_0x9137c0[_0xe175('0x11')]['toLowerCase']()){case'zendesk':zendesk[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case _0xe175('0x8'):salesforce[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case _0xe175('0x1c'):sugarcrm[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case _0xe175('0x9'):freshdesk[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case'zoho':zoho[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case _0xe175('0xb'):desk[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case _0xe175('0xc'):vtiger[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case _0xe175('0xe'):freshsales['cs'](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934,_0x24c38c);break;case _0xe175('0xf'):servicenow['cs'](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934,_0x24c38c);break;case _0xe175('0xd'):dynamics365['cs'](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934,_0x24c38c);break;default:console[_0xe175('0x19')](_0xe175('0x1d'));}}else{_0x2f9cdf=require(_0xe175('0x1e'))(_0x9137c0['data1'][_0xe175('0x12')]());_0x2f9cdf[_0xe175('0x1f')](_0xe175('0x20'),util[_0xe175('0x21')](_0xe175('0x22'),_0x9137c0['data1'][_0xe175('0x12')](),_0x9137c0[_0xe175('0x16')]));}}else{_0x2f9cdf=require(_0xe175('0x1e'))(_0x9137c0['data1'][_0xe175('0x12')]());_0x2f9cdf[_0xe175('0x1f')]('[EXEC]',util[_0xe175('0x21')]('%s\x20account\x20#%s\x20not\x20found',_0x9137c0[_0xe175('0x11')][_0xe175('0x12')](),_0x9137c0[_0xe175('0x13')]));}}else{}}catch(_0x57eec9){console[_0xe175('0x1f')](_0x57eec9);}}}}; \ No newline at end of file +var _0xc8db=['data2','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','servicenow','exec','includes','data1','toLowerCase','find','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','dynamics365','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error'];(function(_0x174369,_0x597960){var _0x5a96d1=function(_0x49a0f8){while(--_0x49a0f8){_0x174369['push'](_0x174369['shift']());}};_0x5a96d1(++_0x597960);}(_0xc8db,0x1ae));var _0xbc8d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc8db[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xbc8d('0x0'));var util=require(_0xbc8d('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0xbc8d('0x2'));var sugarcrm=require(_0xbc8d('0x3'));var freshdesk=require(_0xbc8d('0x4'));var zoho=require(_0xbc8d('0x5'));var desk=require(_0xbc8d('0x6'));var vtiger=require(_0xbc8d('0x7'));var servicenow=require(_0xbc8d('0x8'));var dynamics365=require(_0xbc8d('0x9'));var freshsales=require(_0xbc8d('0xa'));var integrations=[_0xbc8d('0xb'),_0xbc8d('0xc'),_0xbc8d('0xd'),_0xbc8d('0xe'),_0xbc8d('0xf'),_0xbc8d('0x10'),_0xbc8d('0x11'),'dynamics365',_0xbc8d('0x12'),_0xbc8d('0x13')];exports[_0xbc8d('0x14')]=function(_0x415c1e,_0x24bff1,_0x39f308,_0x256b97,_0x30e747,_0x1ba70c){if(_0x39f308){if(_[_0xbc8d('0x15')](integrations,_0x415c1e[_0xbc8d('0x16')]['toLowerCase']())){try{var _0x1372ee=null;var _0x46ef73='';var _0x2eed2e=_0x39f308[_0x415c1e[_0xbc8d('0x16')][_0xbc8d('0x17')]()];if(_0x2eed2e){var _0x2c2b11=_0x2eed2e[_0x415c1e['data2']];if(_0x2c2b11){var _0x1487d1=_[_0xbc8d('0x18')](_0x2c2b11['Configurations'],{'id':parseInt(_0x415c1e[_0xbc8d('0x19')],0xa)});if(_0x1487d1){if(_0x256b97){if(_0x30e747&&_0x24bff1[_0xbc8d('0x1a')]){_0x46ef73='queue';}else if(_0x24bff1[_0xbc8d('0x1b')]){_0x46ef73=_0xbc8d('0x1c');}else{console[_0xbc8d('0x1d')](_0xbc8d('0x1e'),_0x24bff1);}}else{_0x46ef73=_0xbc8d('0x1f');}switch(_0x415c1e[_0xbc8d('0x16')][_0xbc8d('0x17')]()){case'zendesk':zendesk[_0x46ef73](_0x415c1e,_0x24bff1,_0x1487d1,_0x256b97,_0x30e747,_0x2c2b11,_0x1ba70c);break;case _0xbc8d('0xc'):salesforce[_0x46ef73](_0x415c1e,_0x24bff1,_0x1487d1,_0x256b97,_0x30e747,_0x2c2b11,_0x1ba70c);break;case _0xbc8d('0xd'):sugarcrm[_0x46ef73](_0x415c1e,_0x24bff1,_0x1487d1,_0x256b97,_0x30e747,_0x2c2b11,_0x1ba70c);break;case _0xbc8d('0xe'):freshdesk[_0x46ef73](_0x415c1e,_0x24bff1,_0x1487d1,_0x256b97,_0x30e747,_0x2c2b11,_0x1ba70c);break;case _0xbc8d('0xf'):zoho[_0x46ef73](_0x415c1e,_0x24bff1,_0x1487d1,_0x256b97,_0x30e747,_0x2c2b11,_0x1ba70c);break;case _0xbc8d('0x10'):desk[_0x46ef73](_0x415c1e,_0x24bff1,_0x1487d1,_0x256b97,_0x30e747,_0x2c2b11,_0x1ba70c);break;case'vtiger':vtiger[_0x46ef73](_0x415c1e,_0x24bff1,_0x1487d1,_0x256b97,_0x30e747,_0x2c2b11,_0x1ba70c);break;case _0xbc8d('0x12'):freshsales['cs'](_0x415c1e,_0x24bff1,_0x1487d1,_0x256b97,_0x30e747,_0x2c2b11,_0x1ba70c,_0x46ef73);break;case _0xbc8d('0x13'):servicenow['cs'](_0x415c1e,_0x24bff1,_0x1487d1,_0x256b97,_0x30e747,_0x2c2b11,_0x1ba70c,_0x46ef73);break;case _0xbc8d('0x20'):dynamics365['cs'](_0x415c1e,_0x24bff1,_0x1487d1,_0x256b97,_0x30e747,_0x2c2b11,_0x1ba70c,_0x46ef73);break;default:console[_0xbc8d('0x1d')]('unknown\x20integration');}}else{_0x1372ee=require(_0xbc8d('0x21'))(_0x415c1e[_0xbc8d('0x16')][_0xbc8d('0x17')]());_0x1372ee['error'](_0xbc8d('0x22'),util[_0xbc8d('0x23')](_0xbc8d('0x24'),_0x415c1e[_0xbc8d('0x16')]['toLowerCase'](),_0x415c1e[_0xbc8d('0x19')]));}}else{_0x1372ee=require('../../../../config/logger')(_0x415c1e[_0xbc8d('0x16')][_0xbc8d('0x17')]());_0x1372ee[_0xbc8d('0x25')](_0xbc8d('0x22'),util[_0xbc8d('0x23')]('%s\x20account\x20#%s\x20not\x20found',_0x415c1e['data1'][_0xbc8d('0x17')](),_0x415c1e[_0xbc8d('0x26')]));}}else{}}catch(_0x1b1d46){console[_0xbc8d('0x25')](_0x1b1d46);}}}}; \ 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 3113f2f..c2deefc 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 _0x276e=['calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','user:%s','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','jsforce','ioredis','../../../../config/logger','redis','defaults','localhost','emit','assign','getString','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','account','contact','ContactId','AccountId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','execute','then','length','find','Email','info','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','first','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','Company','format','upperFirst','forEach','includes','string','picklist','idField','content','variable','variableName','toString','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientSecret','username','queue','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email'];(function(_0x3c5ad6,_0x47b7bf){var _0x3154f2=function(_0x3a24de){while(--_0x3a24de){_0x3c5ad6['push'](_0x3c5ad6['shift']());}};_0x3154f2(++_0x47b7bf);}(_0x276e,0x110));var _0xe276=function(_0x43d79c,_0x531a55){_0x43d79c=_0x43d79c-0x0;var _0x4866b0=_0x276e[_0x43d79c];return _0x4866b0;};'use strict';var _=require('lodash');var rp=require(_0xe276('0x0'));var moment=require(_0xe276('0x1'));var BPromise=require(_0xe276('0x2'));var md5=require('md5');var jsforce=require(_0xe276('0x3'));var util=require('util');var Redis=require(_0xe276('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xe276('0x5'))('salesforce');config[_0xe276('0x6')]=_[_0xe276('0x7')](config['redis'],{'host':_0xe276('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe276('0x6')]));function emit(_0x185b4e,_0x26fdef,_0x5252a3){io['to'](_0x185b4e)[_0xe276('0x9')](_0x26fdef,_0x5252a3);}function getTicket(_0xcbdc7,_0xeef2c5,_0x4f9fe5,_0x2be77b,_0x20fd9d,_0x5eb049,_0xb5c2f9,_0x98e476){var _0x3d8633=Object[_0xe276('0xa')]({},{'OwnerId':_0xeef2c5['id'],'Subject':intUtil[_0xe276('0xb')](_0x2be77b['Subjects'],_0x20fd9d,'\x20'),'Description':intUtil[_0xe276('0xb')](_0x2be77b['Descriptions'],_0x20fd9d,'\x0a')},getCustomFields(_0x5eb049,_0x20fd9d));if(_0x4f9fe5){if(_0x2be77b[_0xe276('0xc')]===_0xe276('0xd')){_0x3d8633[_0xe276('0xe')]=moment[_0xe276('0xf')]();_0x3d8633[_0xe276('0x10')]=![];_0x3d8633[_0xe276('0x11')]=![];if(_0x4f9fe5[_0xe276('0x12')]==='contact'||_0x4f9fe5[_0xe276('0x12')]==='lead'){_0x3d8633['WhoId']=_0x4f9fe5['id'];}else if(_0x4f9fe5[_0xe276('0x12')]===_0xe276('0x13')){_0x3d8633['WhatId']=_0x4f9fe5['id'];}}else if(_0x2be77b[_0xe276('0xc')]==='Case'){if(_0x4f9fe5[_0xe276('0x12')]===_0xe276('0x14')){_0x3d8633[_0xe276('0x15')]=_0x4f9fe5['id'];}else if(_0x4f9fe5[_0xe276('0x12')]===_0xe276('0x13')){_0x3d8633[_0xe276('0x16')]=_0x4f9fe5['id'];}else if(_0x4f9fe5[_0xe276('0x12')]===_0xe276('0x17')&&_0x2be77b[_0xe276('0x18')]){_0x3d8633[_0x2be77b['leadId']]=_0x4f9fe5['id'];}else{logger['info'](_0xe276('0x19'));}}}return _0xb5c2f9[_0xe276('0x1a')](_0x2be77b[_0xe276('0xc')])[_0xe276('0x1b')](_0x3d8633);}function getUser(_0x24bcb4,_0x747ebc,_0x5cdc1e){if(!_[_0xe276('0x1c')](_0x747ebc)&&intUtil[_0xe276('0x1d')](_0x747ebc)){var _0x282c8c={'Email':_0x747ebc};var _0x3ccd76={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5cdc1e[_0xe276('0x1a')]('User')['find'](_0x282c8c,_0x3ccd76)[_0xe276('0x1e')]()[_0xe276('0x1f')](function(_0x3f57c8){if(_0x3f57c8[_0xe276('0x20')]){var _0x50f4f0=_[_0xe276('0x21')](_0x3f57c8,function(_0x5b5e78){return _0x5b5e78[_0xe276('0x22')]===_0x747ebc;});if(_0x50f4f0){logger[_0xe276('0x23')]('Agent\x20%s\x20found.',_0x747ebc);return BPromise[_0xe276('0x24')]({'id':_0x50f4f0['Id'],'name':_0x50f4f0[_0xe276('0x25')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x747ebc);return _0x5cdc1e[_0xe276('0x26')]()[_0xe276('0x1f')](function(_0x16e845){return BPromise['resolve']({'id':_0x16e845[_0xe276('0x27')],'name':_0x16e845[_0xe276('0x28')]});});}});}else{logger[_0xe276('0x23')](_0xe276('0x29'),_0x747ebc);return _0x5cdc1e[_0xe276('0x26')]()[_0xe276('0x1f')](function(_0x24a70d){return BPromise[_0xe276('0x24')]({'id':_0x24a70d[_0xe276('0x27')],'name':_0x24a70d[_0xe276('0x28')]});});}}function getEndUser(_0x3874c2,_0x58737e,_0x236726,_0x5e4509,_0x10b82e){var _0x79c7c6={'$or':{'Phone':_0x5e4509}};var _0x5c615b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xe276('0x1f')](function(){logger[_0xe276('0x23')](_0xe276('0x2a'),_0x5e4509,_0x58737e[_0xe276('0x2b')]);switch(_0x58737e[_0xe276('0x2b')]){case _0xe276('0x2c'):var _0xce69b5=_[_0xe276('0x2d')](_0x79c7c6);if(_0x58737e[_0xe276('0x2e')]){var _0x16f362={};_0x16f362[_0x58737e[_0xe276('0x2e')]]=_0x5e4509;_['merge'](_0xce69b5[_0xe276('0x2f')],_0x16f362);}return _0x10b82e[_0xe276('0x1a')](_0xe276('0x30'))['find'](_0xce69b5,_0x5c615b)[_0xe276('0x1e')]()['then'](function(_0x2f0db7){if(_0x2f0db7&&_0x2f0db7[_0xe276('0x20')]){return _0x2f0db7;}else{var _0x3b2f86=_[_0xe276('0x2d')](_0x79c7c6);if(_0x58737e[_0xe276('0x31')]){var _0x393506={};_0x393506[_0x58737e[_0xe276('0x31')]]=_0x5e4509;_[_0xe276('0x32')](_0x3b2f86[_0xe276('0x2f')],_0x393506);}return _0x10b82e[_0xe276('0x1a')](_0xe276('0x33'))[_0xe276('0x21')](_0x3b2f86,_0x5c615b);}});case _0xe276('0x34'):var _0x5a31e5=_[_0xe276('0x2d')](_0x79c7c6);if(_0x58737e[_0xe276('0x35')]){var _0x16f362={};_0x16f362[_0x58737e[_0xe276('0x35')]]=_0x5e4509;_[_0xe276('0x32')](_0x5a31e5['$or'],_0x16f362);}return _0x10b82e[_0xe276('0x1a')](_0xe276('0x36'))[_0xe276('0x21')](_0x5a31e5,_0x5c615b)[_0xe276('0x1e')]()[_0xe276('0x1f')](function(_0x4c203c){if(_0x4c203c&&_0x4c203c[_0xe276('0x20')]){return _0x4c203c;}else{var _0x6abf7f=_['cloneDeep'](_0x79c7c6);if(_0x58737e[_0xe276('0x2e')]){var _0x5d2105={};_0x5d2105[_0x58737e['additionalSearchContact']]=_0x5e4509;_[_0xe276('0x32')](_0x6abf7f[_0xe276('0x2f')],_0x5d2105);}return _0x10b82e['sobject'](_0xe276('0x30'))[_0xe276('0x21')](_0x6abf7f,_0x5c615b)[_0xe276('0x1f')](function(_0xce1cf8){if(_0xce1cf8&&_0xce1cf8[_0xe276('0x20')]){return _0xce1cf8;}else{var _0x3b216b=_[_0xe276('0x2d')](_0x79c7c6);if(_0x58737e['additionalSearchLead']){var _0x4833ab={};_0x4833ab[_0x58737e['additionalSearchLead']]=_0x5e4509;_[_0xe276('0x32')](_0x3b216b[_0xe276('0x2f')],_0x4833ab);}return _0x10b82e[_0xe276('0x1a')](_0xe276('0x33'))[_0xe276('0x21')](_0x3b216b,_0x5c615b);}});}});case _0xe276('0x14'):var _0xce69b5=_['cloneDeep'](_0x79c7c6);if(_0x58737e[_0xe276('0x2e')]){var _0x16f362={};_0x16f362[_0x58737e[_0xe276('0x2e')]]=_0x5e4509;_['merge'](_0xce69b5[_0xe276('0x2f')],_0x16f362);}return _0x10b82e[_0xe276('0x1a')](_0xe276('0x30'))[_0xe276('0x21')](_0xce69b5,_0x5c615b)[_0xe276('0x1e')]();case _0xe276('0x17'):var _0x324ec0=_[_0xe276('0x2d')](_0x79c7c6);if(_0x58737e[_0xe276('0x31')]){var _0x16f362={};_0x16f362[_0x58737e[_0xe276('0x31')]]=_0x5e4509;_['merge'](_0x324ec0[_0xe276('0x2f')],_0x16f362);}return _0x10b82e[_0xe276('0x1a')]('Lead')[_0xe276('0x21')](_0x324ec0,_0x5c615b);case _0xe276('0x13'):var _0x5a31e5=_['cloneDeep'](_0x79c7c6);if(_0x58737e[_0xe276('0x35')]){var _0x16f362={};_0x16f362[_0x58737e[_0xe276('0x35')]]=_0x5e4509;_[_0xe276('0x32')](_0x5a31e5['$or'],_0x16f362);}return _0x10b82e[_0xe276('0x1a')](_0xe276('0x36'))[_0xe276('0x21')](_0x5a31e5,_0x5c615b);default:return null;}})['then'](function(_0x12814e){if(_0x12814e&&_0x12814e[_0xe276('0x20')]){var _0x5c6c1c=_[_0xe276('0x37')](_0x12814e);if(_0x5c6c1c){return BPromise[_0xe276('0x24')]({'id':_0x5c6c1c['Id'],'name':_0x5c6c1c['Name'],'phone':_0x5c6c1c['Phone'],'endUserType':_0x5c6c1c['attributes'][_0xe276('0x38')][_0xe276('0x39')]()});}}})[_0xe276('0x1f')](function(_0xf2c35b){if(_0xf2c35b){logger[_0xe276('0x23')](_0xe276('0x3a'),_0xf2c35b[_0xe276('0x12')],_0x5e4509);return BPromise[_0xe276('0x24')](_0xf2c35b);}else{logger['info'](_0xe276('0x3b'),_0x5e4509);var _0x2c1b97={'Phone':_0x5e4509};if(_0x58737e[_0xe276('0x3c')]){if(_0x58737e['moduleCreate']===_0xe276('0x14')){logger[_0xe276('0x23')](_0xe276('0x3d'),_0x5e4509,_0x58737e[_0xe276('0x3c')]);_0x2c1b97[_0xe276('0x3e')]=_0x236726!==_0xe276('0x3f')?_0x236726:util['format'](_0xe276('0x40'),_0x5e4509);}else if(_0x58737e[_0xe276('0x3c')]===_0xe276('0x17')){logger[_0xe276('0x23')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5e4509,_0x58737e[_0xe276('0x3c')]);_0x2c1b97[_0xe276('0x3e')]=_0x236726!==''?_0x236726:util['format'](_0xe276('0x40'),_0x5e4509);_0x2c1b97[_0xe276('0x41')]='No\x20Company';}else if(_0x58737e[_0xe276('0x3c')]===_0xe276('0x13')){logger['info'](_0xe276('0x3d'),_0x5e4509,_0x58737e[_0xe276('0x3c')]);_0x2c1b97[_0xe276('0x25')]=_0x236726!==''?_0x236726:util[_0xe276('0x42')]('Caller\x20-\x20%s',_0x5e4509);}else{return null;}}return _0x10b82e[_0xe276('0x1a')](_[_0xe276('0x43')](_0x58737e[_0xe276('0x3c')]))[_0xe276('0x1b')](_0x2c1b97)['then'](function(_0x2afc7e){return BPromise[_0xe276('0x24')]({'id':_0x2afc7e['id'],'endUserType':_0x58737e[_0xe276('0x3c')]});});}});}function getCustomFields(_0x4a4717,_0x304709){var _0x4873bf={};if(_0x4a4717[_0xe276('0x20')]>0x0){_[_0xe276('0x44')](_0x4a4717,function(_0x563eeb){if(_[_0xe276('0x45')]([_0xe276('0x46'),_0xe276('0x47')],_0x563eeb['type'])&&_0x563eeb[_0xe276('0x48')]){_0x4873bf[_0x563eeb['idField']]=_0x563eeb[_0xe276('0x49')]['toString']();}else if(_0x563eeb[_0xe276('0x38')]===_0xe276('0x4a')&&_0x563eeb['variableName']&&_0x563eeb['idField']){_0x304709[_0x563eeb[_0xe276('0x4b')]]&&(_0x4873bf[_0x563eeb[_0xe276('0x48')]]=_0x304709[_0x563eeb['variableName']][_0xe276('0x4c')]());}else if(_0x563eeb[_0xe276('0x38')]==='customVariable'&&_0x563eeb[_0xe276('0x4d')]&&_0x563eeb['Variable'][_0xe276('0x4e')]&&_0x563eeb[_0xe276('0x48')]){_0x304709[_0x563eeb[_0xe276('0x4d')]['name']['toLowerCase']()]&&(_0x4873bf[_0x563eeb[_0xe276('0x48')]]=_0x304709[_0x563eeb['Variable'][_0xe276('0x4e')][_0xe276('0x39')]()]['toString']());}});}return _0x4873bf;}function getConnection(_0x18b834){var _0x47aaa2=_0x18b834[_0xe276('0x4f')][_0xe276('0x50')](_0x18b834[_0xe276('0x51')]);var _0x2a14df=new jsforce['Connection']({'oauth2':{'loginUrl':_0x18b834[_0xe276('0x52')]||_0xe276('0x53'),'clientId':_0x18b834['clientId'],'clientSecret':_0x18b834[_0xe276('0x54')]}});return _0x2a14df['login'](_0x18b834[_0xe276('0x55')],_0x47aaa2)[_0xe276('0x1f')](function(){logger[_0xe276('0x23')]('Connection\x20established.');return _0x2a14df;});}exports[_0xe276('0x56')]=function(_0x309bd3,_0x25c4a0,_0x3ffe56,_0x3350b7,_0x2e33cc,_0x3d6da5){var _0x3384eb,_0x1e2284,_0x27d66b,_0x5d9767;_0x3d6da5[_0xe276('0x57')]=intUtil[_0xe276('0x58')](_0x3d6da5[_0xe276('0x57')]);_0x3d6da5[_0xe276('0x52')]=intUtil[_0xe276('0x58')](_0x3d6da5['remoteUri']);if(_0x2e33cc&&_0x2e33cc['monitor_format']){logger[_0xe276('0x23')](_0xe276('0x59'),'Recording\x20is\x20enabled!');_0x25c4a0[_0xe276('0x5a')]=util[_0xe276('0x42')](_0xe276('0x5b'),_0x3d6da5[_0xe276('0x57')],_0x25c4a0[_0xe276('0x5c')],md5(_0x25c4a0[_0xe276('0x5c')]));}else{_0x25c4a0['recordingURL']='';}return getConnection(_0x3d6da5)[_0xe276('0x1f')](function(_0x454ee2){_0x5d9767=_0x454ee2;return getUser(_0x3d6da5,_0x3350b7[_0xe276('0x5d')],_0x5d9767);})[_0xe276('0x1f')](function(_0x38ff5f){_0x3384eb=_0x38ff5f;return getEndUser(_0x3d6da5,_0x3ffe56,_0x25c4a0[_0xe276('0x5e')],_0x25c4a0[_0xe276('0x5f')],_0x5d9767);})[_0xe276('0x1f')](function(_0x4feef8){_0x1e2284=_0x4feef8;return getTicket(_0x3d6da5,_0x3384eb,_0x1e2284,_0x3ffe56,_0x25c4a0,_0x3ffe56[_0xe276('0x60')],_0x5d9767,_0xe276('0x56'));})[_0xe276('0x1f')](function(_0x4691b5){_0x27d66b=_0x4691b5;logger[_0xe276('0x23')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x27d66b['id']);logger[_0xe276('0x23')](_0xe276('0x61'),_0x27d66b['id'],_0x3350b7[_0xe276('0x4e')],_0x3d6da5[_0xe276('0x38')]);switch(_0x3d6da5[_0xe276('0x38')]){case'integrationTab':emit(util['format']('user:%s',_0x3350b7[_0xe276('0x4e')]),_0xe276('0x62'),{'recordId':_0x27d66b['id']});break;case'newTab':emit(util[_0xe276('0x42')](_0xe276('0x63'),_0x3350b7[_0xe276('0x4e')]),'trigger:browser:url',{'uri':util[_0xe276('0x42')]('%s/%s/e',_0x5d9767[_0xe276('0x64')],_0x27d66b['id'])});break;default:logger[_0xe276('0x65')](_0xe276('0x66'));}})[_0xe276('0x67')](function(_0x2c4044){logger[_0xe276('0x65')](_0xe276('0x59'),_0x2c4044);});};exports[_0xe276('0x68')]=function(_0x1bb9bf,_0x146c57,_0x29ba25,_0x4a279f,_0x11c3a3,_0x10b67e,_0x1b80f2){var _0x487783,_0x1d2c05,_0x123af8,_0x908d56;_0x10b67e[_0xe276('0x57')]=intUtil[_0xe276('0x58')](_0x10b67e[_0xe276('0x57')]);_0x10b67e[_0xe276('0x52')]=intUtil[_0xe276('0x58')](_0x10b67e[_0xe276('0x52')]);if(_0x1b80f2&&_0x1b80f2[_0xe276('0x69')]&&_0x1b80f2['recordingFormat']!==_0xe276('0x6a')){logger[_0xe276('0x23')](_0xe276('0x6b'),_0xe276('0x6c'));_0x146c57[_0xe276('0x5a')]=util['format'](_0xe276('0x5b'),_0x10b67e[_0xe276('0x57')],_0x146c57[_0xe276('0x5c')],md5(_0x146c57[_0xe276('0x5c')]));}return getConnection(_0x10b67e)['then'](function(_0x14ee4c){_0x908d56=_0x14ee4c;return getUser(_0x10b67e,_0x4a279f['email'],_0x908d56);})[_0xe276('0x1f')](function(_0x4ce032){_0x487783=_0x4ce032;return getEndUser(_0x10b67e,_0x29ba25,_0x146c57[_0xe276('0x6d')],_0x146c57[_0xe276('0x6e')],_0x908d56);})[_0xe276('0x1f')](function(_0x4e0c73){_0x1d2c05=_0x4e0c73;return getTicket(_0x10b67e,_0x487783,_0x1d2c05,_0x29ba25,_0x146c57,_0x29ba25[_0xe276('0x60')],_0x908d56,_0xe276('0x68'));})[_0xe276('0x1f')](function(_0x5b60a0){_0x123af8=_0x5b60a0;logger['info'](_0xe276('0x6f'),_0x123af8['id']);logger[_0xe276('0x23')](_0xe276('0x70'),_0x123af8['id'],_0x4a279f[_0xe276('0x4e')],_0x10b67e[_0xe276('0x38')]);switch(_0x10b67e[_0xe276('0x38')]){case'integrationTab':emit(util[_0xe276('0x42')](_0xe276('0x63'),_0x4a279f[_0xe276('0x4e')]),_0xe276('0x62'),{'recordId':_0x123af8['id']});break;case _0xe276('0x71'):emit(util[_0xe276('0x42')](_0xe276('0x63'),_0x4a279f[_0xe276('0x4e')]),'trigger:browser:url',{'uri':util['format'](_0xe276('0x72'),_0x908d56[_0xe276('0x64')],_0x123af8['id'])});break;default:logger[_0xe276('0x65')]('[OUTBOUND]',_0xe276('0x73'));}})['catch'](function(_0x4f085e){logger[_0xe276('0x65')]('[OUTBOUND]',_0x4f085e);});};exports[_0xe276('0x74')]=function(_0x2ea605,_0x4a7f45,_0x1ec757,_0x2afe5f,_0x32793b,_0x5047cc){var _0x4f342c,_0x323a19,_0x338475,_0x2f88d7;_0x5047cc[_0xe276('0x57')]=intUtil['stripTrailingSlash'](_0x5047cc[_0xe276('0x57')]);_0x5047cc[_0xe276('0x52')]=intUtil[_0xe276('0x58')](_0x5047cc[_0xe276('0x52')]);if(_0x32793b&&_0x32793b[_0xe276('0x75')]){logger[_0xe276('0x23')]('['+_0x4a7f45[_0xe276('0x76')]['toUpperCase']()+']',_0xe276('0x6c'));_0x4a7f45[_0xe276('0x5a')]=util[_0xe276('0x42')](_0xe276('0x5b'),_0x5047cc[_0xe276('0x57')],_0x4a7f45[_0xe276('0x5c')],md5(_0x4a7f45['uniqueid']));}else{_0x4a7f45['recordingURL']='';}return getConnection(_0x5047cc)[_0xe276('0x1f')](function(_0x220131){_0x2f88d7=_0x220131;if(!_[_0xe276('0x1c')](_0x2afe5f)){return getUser(_0x5047cc,_0x2afe5f['name'],_0x2f88d7);}else{return getUser(_0x5047cc,null,_0x2f88d7);}})[_0xe276('0x1f')](function(_0x38ab7b){_0x4f342c=_0x38ab7b;return getEndUser(_0x5047cc,_0x1ec757,_0x4a7f45[_0xe276('0x5e')],_0x4a7f45[_0xe276('0x5f')],_0x2f88d7);})[_0xe276('0x1f')](function(_0x37ce4e){_0x323a19=_0x37ce4e;return getTicket(_0x5047cc,_0x4f342c,_0x323a19,_0x1ec757,_0x4a7f45,_0x1ec757[_0xe276('0x60')],_0x2f88d7);})[_0xe276('0x1f')](function(_0x1a3d19){_0x338475=_0x1a3d19;logger['info']('['+_0x4a7f45[_0xe276('0x76')]['toUpperCase']()+_0xe276('0x77'),_0x338475['id']);logger[_0xe276('0x23')]('['+_0x4a7f45[_0xe276('0x76')][_0xe276('0x78')]()+_0xe276('0x79'),_0x5047cc[_0xe276('0x38')]);})[_0xe276('0x67')](function(_0x4dcd48){logger['error']('['+_0x4a7f45['lastevent']['toUpperCase']()+']',_0x4dcd48);});}; \ No newline at end of file +var _0xee9f=['variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','lastevent','toUpperCase','isNil',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','bluebird','md5','jsforce','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','assign','getString','Subjects','Descriptions','Task','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','WhatId','ticketType','Case','ContactId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','User','find','execute','then','Agent\x20%s\x20found.','Name','resolve','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','length','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','forEach','string','picklist','idField','content','toString','variable'];(function(_0x47794f,_0x12c9b3){var _0x2ca51d=function(_0x43deb3){while(--_0x43deb3){_0x47794f['push'](_0x47794f['shift']());}};_0x2ca51d(++_0x12c9b3);}(_0xee9f,0x1b0));var _0xfee9=function(_0x1dc7dc,_0x19e753){_0x1dc7dc=_0x1dc7dc-0x0;var _0x1a1177=_0xee9f[_0x1dc7dc];return _0x1a1177;};'use strict';var _=require(_0xfee9('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfee9('0x1'));var md5=require(_0xfee9('0x2'));var jsforce=require(_0xfee9('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xfee9('0x4'));var config=require(_0xfee9('0x5'));var logger=require(_0xfee9('0x6'))(_0xfee9('0x7'));config[_0xfee9('0x8')]=_[_0xfee9('0x9')](config['redis'],{'host':_0xfee9('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfee9('0x8')]));function emit(_0x2edf7f,_0x146869,_0x4cd262){io['to'](_0x2edf7f)['emit'](_0x146869,_0x4cd262);}function getTicket(_0x6f48d9,_0x4d3e21,_0x336986,_0x436ad4,_0x12f5d6,_0x1cdc61,_0x2e35f8,_0xb7a897){var _0x3cd3ec=Object[_0xfee9('0xb')]({},{'OwnerId':_0x4d3e21['id'],'Subject':intUtil[_0xfee9('0xc')](_0x436ad4[_0xfee9('0xd')],_0x12f5d6,'\x20'),'Description':intUtil['getString'](_0x436ad4[_0xfee9('0xe')],_0x12f5d6,'\x0a')},getCustomFields(_0x1cdc61,_0x12f5d6));if(_0x336986){if(_0x436ad4['ticketType']===_0xfee9('0xf')){_0x3cd3ec['ActivityDate']=moment['utc']();_0x3cd3ec[_0xfee9('0x10')]=![];_0x3cd3ec[_0xfee9('0x11')]=![];if(_0x336986[_0xfee9('0x12')]===_0xfee9('0x13')||_0x336986[_0xfee9('0x12')]==='lead'){_0x3cd3ec[_0xfee9('0x14')]=_0x336986['id'];}else if(_0x336986[_0xfee9('0x12')]===_0xfee9('0x15')){_0x3cd3ec[_0xfee9('0x16')]=_0x336986['id'];}}else if(_0x436ad4[_0xfee9('0x17')]===_0xfee9('0x18')){if(_0x336986[_0xfee9('0x12')]==='contact'){_0x3cd3ec[_0xfee9('0x19')]=_0x336986['id'];}else if(_0x336986[_0xfee9('0x12')]===_0xfee9('0x15')){_0x3cd3ec['AccountId']=_0x336986['id'];}else if(_0x336986[_0xfee9('0x12')]===_0xfee9('0x1a')&&_0x436ad4[_0xfee9('0x1b')]){_0x3cd3ec[_0x436ad4[_0xfee9('0x1b')]]=_0x336986['id'];}else{logger[_0xfee9('0x1c')](_0xfee9('0x1d'));}}}return _0x2e35f8[_0xfee9('0x1e')](_0x436ad4[_0xfee9('0x17')])[_0xfee9('0x1f')](_0x3cd3ec);}function getUser(_0x2665d9,_0x12523f,_0x4059d0){if(!_['isNil'](_0x12523f)&&intUtil['validateEmail'](_0x12523f)){var _0x170bde={'Email':_0x12523f};var _0x1abaf7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4059d0[_0xfee9('0x1e')](_0xfee9('0x20'))[_0xfee9('0x21')](_0x170bde,_0x1abaf7)[_0xfee9('0x22')]()[_0xfee9('0x23')](function(_0x5533c2){if(_0x5533c2['length']){var _0x5de156=_[_0xfee9('0x21')](_0x5533c2,function(_0x15f0d5){return _0x15f0d5['Email']===_0x12523f;});if(_0x5de156){logger[_0xfee9('0x1c')](_0xfee9('0x24'),_0x12523f);return BPromise['resolve']({'id':_0x5de156['Id'],'name':_0x5de156[_0xfee9('0x25')]});}}else{logger[_0xfee9('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x12523f);return _0x4059d0['identity']()[_0xfee9('0x23')](function(_0x443cc9){return BPromise[_0xfee9('0x26')]({'id':_0x443cc9[_0xfee9('0x27')],'name':_0x443cc9[_0xfee9('0x28')]});});}});}else{logger[_0xfee9('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x12523f);return _0x4059d0[_0xfee9('0x29')]()['then'](function(_0x232d62){return BPromise[_0xfee9('0x26')]({'id':_0x232d62[_0xfee9('0x27')],'name':_0x232d62['display_name']});});}}function getEndUser(_0x845ab,_0x3357f4,_0x2d71be,_0x34c380,_0x2cfadf){var _0x1df594={'$or':{'Phone':_0x34c380}};var _0x2c593e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xfee9('0x26')]()[_0xfee9('0x23')](function(){logger[_0xfee9('0x1c')](_0xfee9('0x2a'),_0x34c380,_0x3357f4[_0xfee9('0x2b')]);switch(_0x3357f4[_0xfee9('0x2b')]){case _0xfee9('0x2c'):var _0x41906f=_[_0xfee9('0x2d')](_0x1df594);if(_0x3357f4[_0xfee9('0x2e')]){var _0xbf4893={};_0xbf4893[_0x3357f4[_0xfee9('0x2e')]]=_0x34c380;_[_0xfee9('0x2f')](_0x41906f[_0xfee9('0x30')],_0xbf4893);}return _0x2cfadf['sobject'](_0xfee9('0x31'))[_0xfee9('0x21')](_0x41906f,_0x2c593e)['execute']()[_0xfee9('0x23')](function(_0x26ee02){if(_0x26ee02&&_0x26ee02['length']){return _0x26ee02;}else{var _0x58c492=_['cloneDeep'](_0x1df594);if(_0x3357f4[_0xfee9('0x32')]){var _0x36cf1f={};_0x36cf1f[_0x3357f4[_0xfee9('0x32')]]=_0x34c380;_[_0xfee9('0x2f')](_0x58c492[_0xfee9('0x30')],_0x36cf1f);}return _0x2cfadf[_0xfee9('0x1e')](_0xfee9('0x33'))[_0xfee9('0x21')](_0x58c492,_0x2c593e);}});case _0xfee9('0x34'):var _0x2820b9=_[_0xfee9('0x2d')](_0x1df594);if(_0x3357f4['additionalSearchAccount']){var _0xbf4893={};_0xbf4893[_0x3357f4[_0xfee9('0x35')]]=_0x34c380;_[_0xfee9('0x2f')](_0x2820b9[_0xfee9('0x30')],_0xbf4893);}return _0x2cfadf['sobject'](_0xfee9('0x36'))[_0xfee9('0x21')](_0x2820b9,_0x2c593e)[_0xfee9('0x22')]()[_0xfee9('0x23')](function(_0x471c01){if(_0x471c01&&_0x471c01[_0xfee9('0x37')]){return _0x471c01;}else{var _0x117569=_['cloneDeep'](_0x1df594);if(_0x3357f4['additionalSearchContact']){var _0xbebd94={};_0xbebd94[_0x3357f4['additionalSearchContact']]=_0x34c380;_['merge'](_0x117569[_0xfee9('0x30')],_0xbebd94);}return _0x2cfadf['sobject'](_0xfee9('0x31'))['find'](_0x117569,_0x2c593e)[_0xfee9('0x23')](function(_0x59ca20){if(_0x59ca20&&_0x59ca20[_0xfee9('0x37')]){return _0x59ca20;}else{var _0x3fa15b=_['cloneDeep'](_0x1df594);if(_0x3357f4[_0xfee9('0x32')]){var _0x1de507={};_0x1de507[_0x3357f4['additionalSearchLead']]=_0x34c380;_['merge'](_0x3fa15b[_0xfee9('0x30')],_0x1de507);}return _0x2cfadf[_0xfee9('0x1e')](_0xfee9('0x33'))[_0xfee9('0x21')](_0x3fa15b,_0x2c593e);}});}});case'contact':var _0x41906f=_[_0xfee9('0x2d')](_0x1df594);if(_0x3357f4['additionalSearchContact']){var _0xbf4893={};_0xbf4893[_0x3357f4['additionalSearchContact']]=_0x34c380;_['merge'](_0x41906f[_0xfee9('0x30')],_0xbf4893);}return _0x2cfadf[_0xfee9('0x1e')]('Contact')[_0xfee9('0x21')](_0x41906f,_0x2c593e)['execute']();case _0xfee9('0x1a'):var _0x392a3b=_['cloneDeep'](_0x1df594);if(_0x3357f4[_0xfee9('0x32')]){var _0xbf4893={};_0xbf4893[_0x3357f4[_0xfee9('0x32')]]=_0x34c380;_[_0xfee9('0x2f')](_0x392a3b['$or'],_0xbf4893);}return _0x2cfadf['sobject'](_0xfee9('0x33'))['find'](_0x392a3b,_0x2c593e);case _0xfee9('0x15'):var _0x2820b9=_['cloneDeep'](_0x1df594);if(_0x3357f4['additionalSearchAccount']){var _0xbf4893={};_0xbf4893[_0x3357f4[_0xfee9('0x35')]]=_0x34c380;_[_0xfee9('0x2f')](_0x2820b9[_0xfee9('0x30')],_0xbf4893);}return _0x2cfadf[_0xfee9('0x1e')](_0xfee9('0x36'))[_0xfee9('0x21')](_0x2820b9,_0x2c593e);default:return null;}})[_0xfee9('0x23')](function(_0xafe6bf){if(_0xafe6bf&&_0xafe6bf[_0xfee9('0x37')]){var _0x115279=_['first'](_0xafe6bf);if(_0x115279){return BPromise[_0xfee9('0x26')]({'id':_0x115279['Id'],'name':_0x115279[_0xfee9('0x25')],'phone':_0x115279[_0xfee9('0x38')],'endUserType':_0x115279['attributes'][_0xfee9('0x39')][_0xfee9('0x3a')]()});}}})['then'](function(_0xfa7b60){if(_0xfa7b60){logger[_0xfee9('0x1c')](_0xfee9('0x3b'),_0xfa7b60['endUserType'],_0x34c380);return BPromise['resolve'](_0xfa7b60);}else{logger[_0xfee9('0x1c')](_0xfee9('0x3c'),_0x34c380);var _0x1e343d={'Phone':_0x34c380};if(_0x3357f4[_0xfee9('0x3d')]){if(_0x3357f4['moduleCreate']==='contact'){logger[_0xfee9('0x1c')](_0xfee9('0x3e'),_0x34c380,_0x3357f4['moduleCreate']);_0x1e343d['LastName']=_0x2d71be!==_0xfee9('0x3f')?_0x2d71be:util[_0xfee9('0x40')](_0xfee9('0x41'),_0x34c380);}else if(_0x3357f4['moduleCreate']===_0xfee9('0x1a')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x34c380,_0x3357f4[_0xfee9('0x3d')]);_0x1e343d[_0xfee9('0x42')]=_0x2d71be!==_0xfee9('0x3f')?_0x2d71be:util[_0xfee9('0x40')](_0xfee9('0x41'),_0x34c380);_0x1e343d[_0xfee9('0x43')]=_0xfee9('0x44');}else if(_0x3357f4[_0xfee9('0x3d')]==='account'){logger['info'](_0xfee9('0x3e'),_0x34c380,_0x3357f4[_0xfee9('0x3d')]);_0x1e343d[_0xfee9('0x25')]=_0x2d71be!==_0xfee9('0x3f')?_0x2d71be:util[_0xfee9('0x40')](_0xfee9('0x41'),_0x34c380);}else{return null;}}return _0x2cfadf[_0xfee9('0x1e')](_['upperFirst'](_0x3357f4[_0xfee9('0x3d')]))[_0xfee9('0x1f')](_0x1e343d)[_0xfee9('0x23')](function(_0x165db5){return BPromise[_0xfee9('0x26')]({'id':_0x165db5['id'],'endUserType':_0x3357f4[_0xfee9('0x3d')]});});}});}function getCustomFields(_0x55a762,_0x207c40){var _0x5e359c={};if(_0x55a762['length']>0x0){_[_0xfee9('0x45')](_0x55a762,function(_0x52f97d){if(_['includes']([_0xfee9('0x46'),_0xfee9('0x47')],_0x52f97d[_0xfee9('0x39')])&&_0x52f97d['idField']){_0x5e359c[_0x52f97d[_0xfee9('0x48')]]=_0x52f97d[_0xfee9('0x49')][_0xfee9('0x4a')]();}else if(_0x52f97d[_0xfee9('0x39')]===_0xfee9('0x4b')&&_0x52f97d[_0xfee9('0x4c')]&&_0x52f97d[_0xfee9('0x48')]){_0x207c40[_0x52f97d[_0xfee9('0x4c')]]&&(_0x5e359c[_0x52f97d[_0xfee9('0x48')]]=_0x207c40[_0x52f97d[_0xfee9('0x4c')]][_0xfee9('0x4a')]());}else if(_0x52f97d[_0xfee9('0x39')]===_0xfee9('0x4d')&&_0x52f97d[_0xfee9('0x4e')]&&_0x52f97d[_0xfee9('0x4e')][_0xfee9('0x4f')]&&_0x52f97d[_0xfee9('0x48')]){_0x207c40[_0x52f97d[_0xfee9('0x4e')][_0xfee9('0x4f')][_0xfee9('0x3a')]()]&&(_0x5e359c[_0x52f97d[_0xfee9('0x48')]]=_0x207c40[_0x52f97d[_0xfee9('0x4e')][_0xfee9('0x4f')][_0xfee9('0x3a')]()][_0xfee9('0x4a')]());}});}return _0x5e359c;}function getConnection(_0x36d72a){var _0xf06a88=_0x36d72a[_0xfee9('0x50')][_0xfee9('0x51')](_0x36d72a[_0xfee9('0x52')]);var _0x109754=new jsforce[(_0xfee9('0x53'))]({'oauth2':{'loginUrl':_0x36d72a[_0xfee9('0x54')]||_0xfee9('0x55'),'clientId':_0x36d72a[_0xfee9('0x56')],'clientSecret':_0x36d72a['clientSecret']}});return _0x109754[_0xfee9('0x57')](_0x36d72a[_0xfee9('0x58')],_0xf06a88)[_0xfee9('0x23')](function(){logger['info'](_0xfee9('0x59'));return _0x109754;});}exports[_0xfee9('0x5a')]=function(_0x483f08,_0x1a489f,_0x481216,_0x317ccb,_0x4b1745,_0x209a85){var _0x1eeb88,_0x25962f,_0x263efa,_0x1f4e4a;_0x209a85[_0xfee9('0x5b')]=intUtil[_0xfee9('0x5c')](_0x209a85[_0xfee9('0x5b')]);_0x209a85[_0xfee9('0x54')]=intUtil[_0xfee9('0x5c')](_0x209a85[_0xfee9('0x54')]);if(_0x4b1745&&_0x4b1745[_0xfee9('0x5d')]){logger[_0xfee9('0x1c')]('[QUEUE]',_0xfee9('0x5e'));_0x1a489f[_0xfee9('0x5f')]=util[_0xfee9('0x40')](_0xfee9('0x60'),_0x209a85[_0xfee9('0x5b')],_0x1a489f[_0xfee9('0x61')],md5(_0x1a489f[_0xfee9('0x61')]));}else{_0x1a489f['recordingURL']='';}return getConnection(_0x209a85)[_0xfee9('0x23')](function(_0x242810){_0x1f4e4a=_0x242810;return getUser(_0x209a85,_0x317ccb['email'],_0x1f4e4a);})[_0xfee9('0x23')](function(_0x593642){_0x1eeb88=_0x593642;return getEndUser(_0x209a85,_0x481216,_0x1a489f[_0xfee9('0x62')],_0x1a489f[_0xfee9('0x63')],_0x1f4e4a);})[_0xfee9('0x23')](function(_0x49f444){_0x25962f=_0x49f444;return getTicket(_0x209a85,_0x1eeb88,_0x25962f,_0x481216,_0x1a489f,_0x481216[_0xfee9('0x64')],_0x1f4e4a,_0xfee9('0x5a'));})[_0xfee9('0x23')](function(_0x598aa5){_0x263efa=_0x598aa5;logger[_0xfee9('0x1c')](_0xfee9('0x65'),_0x263efa['id']);logger[_0xfee9('0x1c')](_0xfee9('0x66'),_0x263efa['id'],_0x317ccb['name'],_0x209a85[_0xfee9('0x39')]);switch(_0x209a85['type']){case _0xfee9('0x67'):emit(util['format']('user:%s',_0x317ccb[_0xfee9('0x4f')]),_0xfee9('0x68'),{'recordId':_0x263efa['id']});break;case _0xfee9('0x69'):emit(util['format'](_0xfee9('0x6a'),_0x317ccb[_0xfee9('0x4f')]),_0xfee9('0x6b'),{'uri':util[_0xfee9('0x40')](_0xfee9('0x6c'),_0x1f4e4a[_0xfee9('0x6d')],_0x263efa['id'])});break;default:logger[_0xfee9('0x6e')](_0xfee9('0x6f'));}})[_0xfee9('0x70')](function(_0x2ac9d4){logger['error'](_0xfee9('0x71'),_0x2ac9d4);});};exports['outbound']=function(_0x1b7bd1,_0xeaf99d,_0x1da93e,_0xf86221,_0x452bb5,_0x23c678,_0x1b387e){var _0x450bd3,_0x375522,_0x3d265d,_0x282ad5;_0x23c678[_0xfee9('0x5b')]=intUtil['stripTrailingSlash'](_0x23c678['serverUrl']);_0x23c678[_0xfee9('0x54')]=intUtil['stripTrailingSlash'](_0x23c678[_0xfee9('0x54')]);if(_0x1b387e&&_0x1b387e[_0xfee9('0x72')]&&_0x1b387e['recordingFormat']!==_0xfee9('0x73')){logger[_0xfee9('0x1c')](_0xfee9('0x74'),_0xfee9('0x5e'));_0xeaf99d[_0xfee9('0x5f')]=util[_0xfee9('0x40')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x23c678[_0xfee9('0x5b')],_0xeaf99d['uniqueid'],md5(_0xeaf99d['uniqueid']));}return getConnection(_0x23c678)[_0xfee9('0x23')](function(_0x33f9de){_0x282ad5=_0x33f9de;return getUser(_0x23c678,_0xf86221[_0xfee9('0x75')],_0x282ad5);})[_0xfee9('0x23')](function(_0x1d6686){_0x450bd3=_0x1d6686;return getEndUser(_0x23c678,_0x1da93e,_0xeaf99d[_0xfee9('0x76')],_0xeaf99d[_0xfee9('0x77')],_0x282ad5);})[_0xfee9('0x23')](function(_0x28da1d){_0x375522=_0x28da1d;return getTicket(_0x23c678,_0x450bd3,_0x375522,_0x1da93e,_0xeaf99d,_0x1da93e['Fields'],_0x282ad5,_0xfee9('0x78'));})['then'](function(_0xf5f71b){_0x3d265d=_0xf5f71b;logger[_0xfee9('0x1c')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x3d265d['id']);logger['info'](_0xfee9('0x79'),_0x3d265d['id'],_0xf86221[_0xfee9('0x4f')],_0x23c678[_0xfee9('0x39')]);switch(_0x23c678['type']){case'integrationTab':emit(util[_0xfee9('0x40')]('user:%s',_0xf86221['name']),'trigger:salesforce:display',{'recordId':_0x3d265d['id']});break;case _0xfee9('0x69'):emit(util[_0xfee9('0x40')](_0xfee9('0x6a'),_0xf86221[_0xfee9('0x4f')]),_0xfee9('0x6b'),{'uri':util[_0xfee9('0x40')]('%s/%s/e',_0x282ad5[_0xfee9('0x6d')],_0x3d265d['id'])});break;default:logger[_0xfee9('0x6e')]('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x10f9a1){logger[_0xfee9('0x6e')](_0xfee9('0x74'),_0x10f9a1);});};exports['unmanaged']=function(_0x3e05b5,_0x21db97,_0x4f7910,_0x3d8ea0,_0x3e3b82,_0x114f7c){var _0x37b667,_0xaa2dec,_0x3da8a7,_0x312130;_0x114f7c[_0xfee9('0x5b')]=intUtil[_0xfee9('0x5c')](_0x114f7c[_0xfee9('0x5b')]);_0x114f7c['remoteUri']=intUtil[_0xfee9('0x5c')](_0x114f7c[_0xfee9('0x54')]);if(_0x3e3b82&&_0x3e3b82[_0xfee9('0x5d')]){logger['info']('['+_0x21db97[_0xfee9('0x7a')][_0xfee9('0x7b')]()+']','Recording\x20is\x20enabled!');_0x21db97[_0xfee9('0x5f')]=util[_0xfee9('0x40')](_0xfee9('0x60'),_0x114f7c[_0xfee9('0x5b')],_0x21db97[_0xfee9('0x61')],md5(_0x21db97[_0xfee9('0x61')]));}else{_0x21db97[_0xfee9('0x5f')]='';}return getConnection(_0x114f7c)[_0xfee9('0x23')](function(_0x2c0246){_0x312130=_0x2c0246;if(!_[_0xfee9('0x7c')](_0x3d8ea0)){return getUser(_0x114f7c,_0x3d8ea0[_0xfee9('0x4f')],_0x312130);}else{return getUser(_0x114f7c,null,_0x312130);}})[_0xfee9('0x23')](function(_0x1cac55){_0x37b667=_0x1cac55;return getEndUser(_0x114f7c,_0x4f7910,_0x21db97['calleridname'],_0x21db97[_0xfee9('0x63')],_0x312130);})[_0xfee9('0x23')](function(_0x177dae){_0xaa2dec=_0x177dae;return getTicket(_0x114f7c,_0x37b667,_0xaa2dec,_0x4f7910,_0x21db97,_0x4f7910[_0xfee9('0x64')],_0x312130);})[_0xfee9('0x23')](function(_0x4c945e){_0x3da8a7=_0x4c945e;logger[_0xfee9('0x1c')]('['+_0x21db97['lastevent'][_0xfee9('0x7b')]()+_0xfee9('0x7d'),_0x3da8a7['id']);logger[_0xfee9('0x1c')]('['+_0x21db97[_0xfee9('0x7a')][_0xfee9('0x7b')]()+_0xfee9('0x7e'),_0x114f7c[_0xfee9('0x39')]);})[_0xfee9('0x70')](function(_0x4b1132){logger['error']('['+_0x21db97[_0xfee9('0x7a')]['toUpperCase']()+']',_0x4b1132);});}; \ 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 c43a93d..b3c66b6 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 _0x47ac=['request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','info','toUpperCase','catch','error','message','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','sys_id','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','name','Variable',']\x20getTicket\x20input\x20crm','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','user:%s','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','email','outbound','destcalleridnum','queue','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird'];(function(_0x5c10dc,_0x1c0913){var _0x298b81=function(_0x487861){while(--_0x487861){_0x5c10dc['push'](_0x5c10dc['shift']());}};_0x298b81(++_0x1c0913);}(_0x47ac,0x19e));var _0xc47a=function(_0x49a124,_0x208eab){_0x49a124=_0x49a124-0x0;var _0x39e13e=_0x47ac[_0x49a124];return _0x39e13e;};'use strict';var _=require(_0xc47a('0x0'));var Promise=require(_0xc47a('0x1'));var rp=require(_0xc47a('0x2'));var util=require(_0xc47a('0x3'));var md5=require('md5');var Redis=require(_0xc47a('0x4'));var intUtil=require('./util');var config=require(_0xc47a('0x5'));var logger=require(_0xc47a('0x6'))(_0xc47a('0x7'));config[_0xc47a('0x8')]=_[_0xc47a('0x9')](config[_0xc47a('0x8')],{'host':_0xc47a('0xa'),'port':0x18eb});var io=require(_0xc47a('0xb'))(new Redis(config[_0xc47a('0x8')]));function getAdminUser(_0x556a0f,_0x117202,_0x1f0677,_0x4cde56,_0x14c9cf,_0x46637c){return new Promise(function(_0xc06cf0,_0x4baf2f){var _0x1c22ce={'method':_0xc47a('0xc'),'uri':_0x4cde56+_0xc47a('0xd')+'&'+_0x14c9cf+'&'+_0x46637c,'auth':_0x117202,'json':!![]};return rp(_0x1c22ce)[_0xc47a('0xe')](function(_0x280d81){if(_0x280d81[_0xc47a('0xf')]['length']>0x0){_0x1f0677[_0xc47a('0x10')]=_0x280d81['result'][0x0]['sys_id'];}logger[_0xc47a('0x11')]('['+[_0x556a0f[_0xc47a('0x12')]()]+'],\x20getAdminUser\x20crm',_0x1f0677);_0xc06cf0(_0x1f0677);})[_0xc47a('0x13')](function(_0x410b2c){logger[_0xc47a('0x14')]('['+[_0x556a0f[_0xc47a('0x12')]()]+']',_0x410b2c[_0xc47a('0x15')]);_0x4baf2f(_0x410b2c[_0xc47a('0x15')]);});});}function getUser(_0x5895be,_0x2d5d9f,_0x53613a,_0x3b2b91,_0x29c0ec){return function(_0x230951){logger[_0xc47a('0x11')]('['+[_0x5895be['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x230951);return new Promise(function(_0x5aa8e3,_0x2a713d){if(intUtil['validateEmail'](_0x230951[_0xc47a('0x16')])){var _0xf9ee5f={'method':_0xc47a('0xc'),'uri':_0x53613a+_0xc47a('0x17')+_0x230951['userEmail']+'&'+_0x3b2b91+'&'+_0x29c0ec,'auth':_0x2d5d9f,'json':!![]};logger[_0xc47a('0x11')]('['+[_0x5895be['toUpperCase']()]+_0xc47a('0x18'),_0xf9ee5f);return rp(_0xf9ee5f)[_0xc47a('0xe')](function(_0x5b65eb){logger[_0xc47a('0x11')]('['+[_0x5895be[_0xc47a('0x12')]()]+_0xc47a('0x19'),_0x5b65eb);if(_0x5b65eb[_0xc47a('0xf')][_0xc47a('0x1a')]>0x0&&String(_0x5b65eb[_0xc47a('0xf')][0x0][_0xc47a('0x1b')])===_0xc47a('0x1c')){_0x230951['userId']=_0x5b65eb['result'][0x0][_0xc47a('0x1d')];}else{_0x230951[_0xc47a('0x1e')]=_0x230951[_0xc47a('0x10')];_0x230951[_0xc47a('0x16')]=_0x230951[_0xc47a('0x1f')];}logger[_0xc47a('0x11')]('['+[_0x5895be[_0xc47a('0x12')]()]+_0xc47a('0x20'),_0x230951);_0x5aa8e3(_0x230951);})['catch'](function(_0x2edced){logger[_0xc47a('0x14')]('['+[_0x5895be['toUpperCase']()]+']',_0x2edced[_0xc47a('0x15')]);_0x2a713d(_0x2edced['message']);});}else{logger[_0xc47a('0x11')]('['+[_0x5895be['toUpperCase']()]+_0xc47a('0x21'));_0x230951[_0xc47a('0x1e')]=_0x230951[_0xc47a('0x10')];_0x230951['userEmail']=_0x230951[_0xc47a('0x1f')];_0x5aa8e3(_0x230951);}});};}function createEndUser(_0x5809d8,_0x407328,_0x4c1084,_0x3e3ee1,_0x551459){logger[_0xc47a('0x11')]('['+[_0x5809d8[_0xc47a('0x12')]()]+_0xc47a('0x22'),_0x4c1084);return new Promise(function(_0x169003,_0x43cefb){var _0x4b59ce={'method':_0xc47a('0x23'),'uri':_0x3e3ee1+_0xc47a('0x24')+_0x551459,'body':{'user_name':_0x4c1084[_0xc47a('0x25')],'roles':_0xc47a('0x26'),'first_name':_0x4c1084[_0xc47a('0x25')],'active':'true','date_format':_0xc47a('0x27'),'phone':_0x4c1084[_0xc47a('0x25')]},'auth':_0x407328,'json':!![]};return rp(_0x4b59ce)['then'](function(_0x54705c){logger[_0xc47a('0x11')]('['+[_0x5809d8[_0xc47a('0x12')]()]+_0xc47a('0x28'),_0x54705c[_0xc47a('0xf')]);_0x4c1084[_0xc47a('0x29')]=_0x54705c[_0xc47a('0xf')][_0xc47a('0x1d')];_0x169003(_0x4c1084);})[_0xc47a('0x13')](function(_0x3920d9){logger[_0xc47a('0x14')]('['+[_0x5809d8['toUpperCase']()]+']',_0x3920d9[_0xc47a('0x15')]);_0x43cefb(_0x3920d9[_0xc47a('0x15')]);});});}function getEndUser(_0x41945d,_0x364ff6,_0x37a04d,_0x1ec879,_0x11997c){return function(_0x31e542){logger[_0xc47a('0x11')]('['+[_0x41945d[_0xc47a('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x31e542);return new Promise(function(_0x167f2e,_0x2b56af){var _0x1d062c={'method':_0xc47a('0xc'),'uri':_0x37a04d+'sys_user?sysparm_query=phone%3D'+_0x31e542[_0xc47a('0x25')]+'&'+_0x1ec879+'&'+_0x11997c,'auth':_0x364ff6,'json':!![]};return rp(_0x1d062c)[_0xc47a('0xe')](function(_0x4caa26){if(_0x4caa26[_0xc47a('0xf')]['length']>0x0){_0x31e542[_0xc47a('0x29')]=_0x4caa26[_0xc47a('0xf')][0x0]['sys_id'];logger[_0xc47a('0x11')]('['+[_0x41945d[_0xc47a('0x12')]()]+_0xc47a('0x2a'),_0x31e542);_0x167f2e(_0x31e542);}else{return createEndUser(_0x41945d,_0x364ff6,_0x31e542,_0x37a04d,_0x1ec879)['then'](function(_0x5d27ad){logger[_0xc47a('0x11')]('['+[_0x41945d[_0xc47a('0x12')]()]+_0xc47a('0x2b'),_0x5d27ad);_0x167f2e(_0x5d27ad);});}})[_0xc47a('0x13')](function(_0x334811){logger['error']('['+[_0x41945d['toUpperCase']()]+']',_0x334811[_0xc47a('0x15')]);_0x2b56af(_0x334811[_0xc47a('0x15')]);});});};}function getCustomFields(_0x35c291,_0x42a244){var _0xe49e16={};if(_0x35c291['length']>0x0){_[_0xc47a('0x2c')](_0x35c291,function(_0xb2c06b){if(_[_0xc47a('0x2d')]([_0xc47a('0x2e'),_0xc47a('0x2f')],_0xb2c06b[_0xc47a('0x30')])&&_0xb2c06b['nameField']&&!_0xb2c06b[_0xc47a('0x31')]){_0xe49e16[_0xb2c06b[_0xc47a('0x32')][_0xc47a('0x33')]()]=_0xb2c06b[_0xc47a('0x34')][_0xc47a('0x35')]();}else if(_[_0xc47a('0x2d')]([_0xc47a('0x2e'),_0xc47a('0x2f')],_0xb2c06b[_0xc47a('0x30')])&&_0xb2c06b[_0xc47a('0x36')]&&_0xb2c06b[_0xc47a('0x31')]){_0xe49e16[_0xb2c06b[_0xc47a('0x36')][_0xc47a('0x33')]()]=_0xb2c06b[_0xc47a('0x34')][_0xc47a('0x35')]();}else if(_0xb2c06b['type']===_0xc47a('0x37')&&_0xb2c06b[_0xc47a('0x38')]&&_0xb2c06b[_0xc47a('0x36')]&&_0xb2c06b[_0xc47a('0x31')]){_0xe49e16[_0xb2c06b[_0xc47a('0x36')][_0xc47a('0x33')]()]=_0x42a244[_0xb2c06b[_0xc47a('0x38')]][_0xc47a('0x35')]();}else if(_0xb2c06b[_0xc47a('0x30')]==='customVariable'&&_0xb2c06b['Variable']&&_0xb2c06b['Variable'][_0xc47a('0x39')]&&_0xb2c06b[_0xc47a('0x36')]&&_0xb2c06b[_0xc47a('0x31')]){_0xe49e16[_0xb2c06b[_0xc47a('0x36')][_0xc47a('0x33')]()]=_0x42a244[_0xb2c06b[_0xc47a('0x3a')][_0xc47a('0x39')][_0xc47a('0x33')]()][_0xc47a('0x35')]();}});}return _0xe49e16;}function getTicket(_0x493fb3,_0x1c2302,_0x1d75ca,_0x32b757,_0x344a37,_0x57ce56){return function(_0x41cf51){logger[_0xc47a('0x11')]('['+[_0x493fb3[_0xc47a('0x12')]()]+_0xc47a('0x3b'),_0x41cf51);return new Promise(function(_0x3b4096,_0x1d20eb){var _0x4a9f0c=_0x493fb3[_0xc47a('0x33')]()==='outbound'?_0x41cf51['userId']:_0x41cf51[_0xc47a('0x29')];var _0x33a650={'method':_0xc47a('0x23'),'uri':_0x1d75ca+_0xc47a('0x3c')+'?'+_0x57ce56,'body':Object['assign']({},{'active':_0xc47a('0x1c'),'caller_id':_0x4a9f0c,'assigned_to':_0x41cf51[_0xc47a('0x1e')],'short_description':intUtil[_0xc47a('0x3d')](_0x32b757['Subjects'],_0x344a37,'\x20'),'description':intUtil[_0xc47a('0x3d')](_0x32b757[_0xc47a('0x3e')],_0x344a37,'\x0a')},getCustomFields(_0x32b757[_0xc47a('0x3f')],_0x344a37)),'auth':_0x1c2302,'json':!![]};return rp(_0x33a650)[_0xc47a('0xe')](function(_0x24ac25){logger[_0xc47a('0x11')]('['+[_0x493fb3['toUpperCase']()]+_0xc47a('0x40'),_0x24ac25[_0xc47a('0xf')]);_0x41cf51[_0xc47a('0x41')]=_0x24ac25['result']['sys_id'];_0x41cf51[_0xc47a('0x42')]=_0x24ac25[_0xc47a('0xf')][_0xc47a('0x43')];logger[_0xc47a('0x11')]('['+[_0x493fb3[_0xc47a('0x12')]()]+_0xc47a('0x44'),_0x41cf51);_0x3b4096(_0x41cf51);})[_0xc47a('0x13')](function(_0x24cbd4){logger[_0xc47a('0x14')]('['+[_0x493fb3[_0xc47a('0x12')]()]+']',_0x24cbd4[_0xc47a('0x15')]);_0x1d20eb(_0x24cbd4[_0xc47a('0x15')]);});});};}function createRemoteTag(_0x2ca127,_0x30f8c3,_0x21abb6,_0x3a1b34){return new Promise(function(_0x4b5d58,_0x52defa){var _0x566bdf={'method':_0xc47a('0x23'),'uri':_0x21abb6+_0xc47a('0x45')+'?'+_0x3a1b34,'body':{'short_description':_0x2ca127,'global':!![],'active':!![],'name':_0x2ca127},'auth':_0x30f8c3,'json':!![]};return rp(_0x566bdf)['then'](function(_0x2eb663){var _0x381cf4=_0x2eb663['result'][_0xc47a('0x1d')];_0x4b5d58(_0x381cf4);});});}function getRemoteTag(_0x407978,_0x34b089,_0x51484f,_0x1e5357,_0x5cec40){return new Promise(function(_0x1da06d,_0x5f42ca){var _0x2e0ba6={'method':_0xc47a('0xc'),'uri':_0x51484f+_0xc47a('0x45')+'?sysparm_query=name%3D'+_0x407978+'&'+_0x1e5357,'auth':_0x34b089,'json':!![]};return rp(_0x2e0ba6)[_0xc47a('0xe')](function(_0x273944){if(_0x273944[_0xc47a('0xf')]['length']>0x0){var _0x101d72=_0x273944[_0xc47a('0xf')][0x0]['sys_id'];_0x1da06d(_0x101d72);}else{return createRemoteTag(_0x407978,_0x34b089,_0x51484f,_0x1e5357)[_0xc47a('0xe')](function(_0x4313c6){_0x1da06d(_0x4313c6);});}});});}function assignTagToIncident(_0x56c8e5,_0x5963bf,_0x5134ab,_0x42c3c2,_0x3825b7){return new Promise(function(_0x349187,_0x4a9143){var _0x285fc2={'method':_0xc47a('0x23'),'uri':_0x5134ab+'label_entry'+'?'+_0x3825b7,'body':{'label':_0x56c8e5,'table':_0xc47a('0x3c'),'id_type':'Incident','table_key':_0x42c3c2[_0xc47a('0x41')],'title':_0xc47a('0x46')+_0x42c3c2[_0xc47a('0x42')],'id_display':_0x42c3c2[_0xc47a('0x42')]},'auth':_0x5963bf,'json':!![]};return rp(_0x285fc2)[_0xc47a('0xe')](function(_0x2102dc){_0x349187();})['catch'](function(){_0x349187();});});}function manageTags(_0x350c51,_0x5a9600,_0x33677f,_0x458f81,_0x14216f,_0x2e1e18,_0x3f9cac){return new Promise(function(_0x5840f0,_0x477695){var _0x1d8fef=[];_0x5a9600[_0xc47a('0x2c')](function(_0x527f38){_0x1d8fef[_0xc47a('0x47')](getRemoteTag(_0x527f38,_0x33677f,_0x458f81,_0x2e1e18,_0x3f9cac));});return Promise['all'](_0x1d8fef)[_0xc47a('0xe')](function(_0x40561c){if(_0x40561c[_0xc47a('0x1a')]){logger[_0xc47a('0x11')]('['+[_0x350c51[_0xc47a('0x12')]()]+_0xc47a('0x48'),_0x40561c);var _0x3b78c2=[];_0x40561c[_0xc47a('0x2c')](function(_0x1a3251){_0x3b78c2[_0xc47a('0x47')](assignTagToIncident(_0x1a3251,_0x33677f,_0x458f81,_0x14216f,_0x2e1e18));});return Promise[_0xc47a('0x49')](_0x3b78c2)[_0xc47a('0xe')](function(){_0x5840f0();})[_0xc47a('0x13')](function(){_0x5840f0();});}else{_0x5840f0();}});});}function getTags(_0x54f4ea,_0x461db6,_0x32fcc1,_0x27340f,_0x5569c5,_0x1d3107){return function(_0x7ddda7){return new Promise(function(_0x4fde18,_0x13c81d){var _0x1d672f=[];var _0x9fe2ce=_0x27340f[_0xc47a('0x4a')];if(_0x9fe2ce&&_0x9fe2ce['length']>0x0){_0x1d672f=_[_0xc47a('0x4b')](_0x9fe2ce,'name');}if(_0x1d672f['length']>0x0){return manageTags(_0x54f4ea,_0x1d672f,_0x461db6,_0x32fcc1,_0x7ddda7,_0x5569c5,_0x1d3107)[_0xc47a('0xe')](function(){_0x4fde18(_0x7ddda7);});}else{_0x4fde18(_0x7ddda7);}});};}function emit(_0xa19a51,_0x5d301f,_0x213f41){var _0x159224=_0xc47a('0x4c')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xc47a('0x4d')+_0xc47a('0x4e');var _0x3be815={'uri':_0xa19a51+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x213f41+_0x159224};io['to'](util['format'](_0xc47a('0x4f'),_0x5d301f))['emit'](_0xc47a('0x50'),_0x3be815);}exports['cs']=function(_0x316c0b,_0x4f0111,_0x3b9f67,_0x41cd89,_0x552799,_0x439566,_0x2ed21a,_0x54a3a9){var _0x382dfd={};var _0x588888={'user':_0x439566['username'],'pass':_0x439566[_0xc47a('0x51')]};var _0x4cd774=_0xc47a('0x52');var _0x3bf885=_0xc47a('0x53');_0x439566[_0xc47a('0x54')]=intUtil[_0xc47a('0x55')](_0x439566[_0xc47a('0x54')]);_0x439566[_0xc47a('0x56')]=intUtil[_0xc47a('0x55')](_0x439566['serverUrl']);var _0x50816b=util['format']('%s/api/now/table/',_0x439566['remoteUri']);_0x382dfd[_0xc47a('0x16')]=!_['isNil'](_0x41cd89)?_0x41cd89[_0xc47a('0x57')]:null;_0x382dfd[_0xc47a('0x1f')]=_0x439566[_0xc47a('0x57')];_0x382dfd['endUserNumber']=_0x54a3a9[_0xc47a('0x33')]()===_0xc47a('0x58')?_0x4f0111[_0xc47a('0x59')]:_0x4f0111['calleridnum'];_0x382dfd['callDirection']=_0x54a3a9===_0xc47a('0x5a')||_0x54a3a9==='unmanaged'?_0xc47a('0x5a'):'outbound';var _0x977cfe=util[_0xc47a('0x5b')](_0xc47a('0x5c'),_0x439566[_0xc47a('0x56')],_0x4f0111[_0xc47a('0x5d')],md5(_0x4f0111[_0xc47a('0x5d')]));if(_0x552799&&_0x552799[_0xc47a('0x5e')]){logger[_0xc47a('0x11')](_0xc47a('0x5f'),_0xc47a('0x60'));_0x4f0111['recordingURL']=_0x977cfe;}else if(_0x2ed21a&&_0x2ed21a['recordingFormat']&&_0x2ed21a[_0xc47a('0x61')]!=='none'){logger[_0xc47a('0x11')](_0xc47a('0x62'),'Recording\x20is\x20enabled!');_0x4f0111['recordingURL']=_0x977cfe;}else{_0x4f0111[_0xc47a('0x63')]='';}return getAdminUser(_0x54a3a9,_0x588888,_0x382dfd,_0x50816b,_0x3bf885,_0x4cd774)[_0xc47a('0xe')](getUser(_0x54a3a9,_0x588888,_0x50816b,_0x3bf885,_0x4cd774))['then'](getEndUser(_0x54a3a9,_0x588888,_0x50816b,_0x3bf885,_0x4cd774))[_0xc47a('0xe')](getTicket(_0x54a3a9,_0x588888,_0x50816b,_0x3b9f67,_0x4f0111,_0x3bf885))[_0xc47a('0xe')](function(_0x4fe532){logger[_0xc47a('0x11')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x4fe532[_0xc47a('0x41')]));logger[_0xc47a('0x11')](util[_0xc47a('0x5b')]('call\x20direction:\x20%s',_0x54a3a9));if(_0x54a3a9!==_0xc47a('0x64')){logger[_0xc47a('0x11')]('['+[_0x54a3a9[_0xc47a('0x12')]()]+']',_0xc47a('0x65'));emit(_0x439566[_0xc47a('0x54')],_0x41cd89[_0xc47a('0x39')],_0x4fe532['ticketId']);}})[_0xc47a('0x13')](function(_0x30df6d){logger['error']('['+[_0x54a3a9['toUpperCase']()]+_0xc47a('0x66'),util[_0xc47a('0x67')](_0x30df6d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x31d0=['../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','then','result','length','adminId','sys_id','],\x20getAdminUser\x20crm','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','info','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','customField','toLowerCase','content','toString','includes','idField','variable','variableName','Variable','outbound','assign','true','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','incident','Incident\x20-\x20','push','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','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','isNil','email','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment'];(function(_0x51741b,_0x5a5c63){var _0x56ef68=function(_0x5ac1f8){while(--_0x5ac1f8){_0x51741b['push'](_0x51741b['shift']());}};_0x56ef68(++_0x5a5c63);}(_0x31d0,0xd7));var _0x031d=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0x31d0[_0x1b51ea];return _0x18bbdc;};'use strict';var _=require(_0x031d('0x0'));var Promise=require(_0x031d('0x1'));var rp=require(_0x031d('0x2'));var util=require(_0x031d('0x3'));var md5=require('md5');var Redis=require(_0x031d('0x4'));var intUtil=require(_0x031d('0x5'));var config=require(_0x031d('0x6'));var logger=require(_0x031d('0x7'))(_0x031d('0x8'));config[_0x031d('0x9')]=_[_0x031d('0xa')](config[_0x031d('0x9')],{'host':_0x031d('0xb'),'port':0x18eb});var io=require(_0x031d('0xc'))(new Redis(config['redis']));function getAdminUser(_0x1e2491,_0x181531,_0x58775a,_0x591e7f,_0x99428b,_0x19c5fa){return new Promise(function(_0x150a7e,_0x1d0a3a){var _0x1c87ec={'method':_0x031d('0xd'),'uri':_0x591e7f+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x99428b+'&'+_0x19c5fa,'auth':_0x181531,'json':!![]};return rp(_0x1c87ec)[_0x031d('0xe')](function(_0x101d24){if(_0x101d24[_0x031d('0xf')][_0x031d('0x10')]>0x0){_0x58775a[_0x031d('0x11')]=_0x101d24[_0x031d('0xf')][0x0][_0x031d('0x12')];}logger['info']('['+[_0x1e2491['toUpperCase']()]+_0x031d('0x13'),_0x58775a);_0x150a7e(_0x58775a);})['catch'](function(_0x4062c8){logger[_0x031d('0x14')]('['+[_0x1e2491[_0x031d('0x15')]()]+']',_0x4062c8[_0x031d('0x16')]);_0x1d0a3a(_0x4062c8['message']);});});}function getUser(_0x560f1d,_0x5e7498,_0x84438e,_0x2a1159,_0x207b1d){return function(_0x1efb72){logger['info']('['+[_0x560f1d[_0x031d('0x15')]()]+_0x031d('0x17'),_0x1efb72);return new Promise(function(_0x1b4c17,_0x5c1a39){if(intUtil[_0x031d('0x18')](_0x1efb72[_0x031d('0x19')])){var _0x2b45f4={'method':_0x031d('0xd'),'uri':_0x84438e+_0x031d('0x1a')+_0x1efb72[_0x031d('0x19')]+'&'+_0x2a1159+'&'+_0x207b1d,'auth':_0x5e7498,'json':!![]};logger[_0x031d('0x1b')]('['+[_0x560f1d[_0x031d('0x15')]()]+_0x031d('0x1c'),_0x2b45f4);return rp(_0x2b45f4)['then'](function(_0x5e6d42){logger[_0x031d('0x1b')]('['+[_0x560f1d[_0x031d('0x15')]()]+_0x031d('0x1d'),_0x5e6d42);if(_0x5e6d42[_0x031d('0xf')][_0x031d('0x10')]>0x0&&String(_0x5e6d42[_0x031d('0xf')][0x0][_0x031d('0x1e')])==='true'){_0x1efb72[_0x031d('0x1f')]=_0x5e6d42[_0x031d('0xf')][0x0][_0x031d('0x12')];}else{_0x1efb72['userId']=_0x1efb72[_0x031d('0x11')];_0x1efb72[_0x031d('0x19')]=_0x1efb72['adminEmail'];}logger[_0x031d('0x1b')]('['+[_0x560f1d[_0x031d('0x15')]()]+_0x031d('0x20'),_0x1efb72);_0x1b4c17(_0x1efb72);})[_0x031d('0x21')](function(_0x520696){logger['error']('['+[_0x560f1d[_0x031d('0x15')]()]+']',_0x520696['message']);_0x5c1a39(_0x520696[_0x031d('0x16')]);});}else{logger[_0x031d('0x1b')]('['+[_0x560f1d['toUpperCase']()]+_0x031d('0x22'));_0x1efb72[_0x031d('0x1f')]=_0x1efb72['adminId'];_0x1efb72[_0x031d('0x19')]=_0x1efb72[_0x031d('0x23')];_0x1b4c17(_0x1efb72);}});};}function createEndUser(_0x156c51,_0x76fbd5,_0xb35154,_0x209270,_0x176f53){logger[_0x031d('0x1b')]('['+[_0x156c51['toUpperCase']()]+_0x031d('0x24'),_0xb35154);return new Promise(function(_0x13dd2b,_0x2666be){var _0x62aeb1={'method':_0x031d('0x25'),'uri':_0x209270+_0x031d('0x26')+_0x176f53,'body':{'user_name':_0xb35154['endUserNumber'],'roles':_0x031d('0x27'),'first_name':_0xb35154[_0x031d('0x28')],'active':'true','date_format':'System','phone':_0xb35154[_0x031d('0x28')]},'auth':_0x76fbd5,'json':!![]};return rp(_0x62aeb1)[_0x031d('0xe')](function(_0x255904){logger[_0x031d('0x1b')]('['+[_0x156c51['toUpperCase']()]+_0x031d('0x29'),_0x255904['result']);_0xb35154[_0x031d('0x2a')]=_0x255904[_0x031d('0xf')]['sys_id'];_0x13dd2b(_0xb35154);})[_0x031d('0x21')](function(_0x13bb7f){logger[_0x031d('0x14')]('['+[_0x156c51[_0x031d('0x15')]()]+']',_0x13bb7f[_0x031d('0x16')]);_0x2666be(_0x13bb7f[_0x031d('0x16')]);});});}function getEndUser(_0x5d09d7,_0x2146de,_0x31b107,_0x427ec9,_0x564304){return function(_0x8ce2d3){logger[_0x031d('0x1b')]('['+[_0x5d09d7[_0x031d('0x15')]()]+'],\x20getEndUser\x20input\x20crm',_0x8ce2d3);return new Promise(function(_0x179d1a,_0x5f3dca){var _0x266a60={'method':_0x031d('0xd'),'uri':_0x31b107+_0x031d('0x2b')+_0x8ce2d3[_0x031d('0x28')]+'&'+_0x427ec9+'&'+_0x564304,'auth':_0x2146de,'json':!![]};return rp(_0x266a60)[_0x031d('0xe')](function(_0x5697da){if(_0x5697da['result'][_0x031d('0x10')]>0x0){_0x8ce2d3[_0x031d('0x2a')]=_0x5697da[_0x031d('0xf')][0x0][_0x031d('0x12')];logger[_0x031d('0x1b')]('['+[_0x5d09d7[_0x031d('0x15')]()]+'],\x20getEndUser\x20crm',_0x8ce2d3);_0x179d1a(_0x8ce2d3);}else{return createEndUser(_0x5d09d7,_0x2146de,_0x8ce2d3,_0x31b107,_0x427ec9)[_0x031d('0xe')](function(_0x4847a5){logger[_0x031d('0x1b')]('['+[_0x5d09d7[_0x031d('0x15')]()]+_0x031d('0x2c'),_0x4847a5);_0x179d1a(_0x4847a5);});}})[_0x031d('0x21')](function(_0x23003f){logger[_0x031d('0x14')]('['+[_0x5d09d7[_0x031d('0x15')]()]+']',_0x23003f[_0x031d('0x16')]);_0x5f3dca(_0x23003f[_0x031d('0x16')]);});});};}function getCustomFields(_0x562eb4,_0xb3982a){var _0x23f5bd={};if(_0x562eb4[_0x031d('0x10')]>0x0){_[_0x031d('0x2d')](_0x562eb4,function(_0x4c87ca){if(_['includes']([_0x031d('0x2e'),_0x031d('0x2f')],_0x4c87ca[_0x031d('0x30')])&&_0x4c87ca[_0x031d('0x31')]&&!_0x4c87ca[_0x031d('0x32')]){_0x23f5bd[_0x4c87ca['nameField'][_0x031d('0x33')]()]=_0x4c87ca[_0x031d('0x34')][_0x031d('0x35')]();}else if(_[_0x031d('0x36')]([_0x031d('0x2e'),_0x031d('0x2f')],_0x4c87ca[_0x031d('0x30')])&&_0x4c87ca[_0x031d('0x37')]&&_0x4c87ca['customField']){_0x23f5bd[_0x4c87ca['idField']['toLowerCase']()]=_0x4c87ca[_0x031d('0x34')]['toString']();}else if(_0x4c87ca[_0x031d('0x30')]===_0x031d('0x38')&&_0x4c87ca[_0x031d('0x39')]&&_0x4c87ca[_0x031d('0x37')]&&_0x4c87ca['customField']){_0x23f5bd[_0x4c87ca[_0x031d('0x37')][_0x031d('0x33')]()]=_0xb3982a[_0x4c87ca[_0x031d('0x39')]][_0x031d('0x35')]();}else if(_0x4c87ca[_0x031d('0x30')]==='customVariable'&&_0x4c87ca[_0x031d('0x3a')]&&_0x4c87ca[_0x031d('0x3a')]['name']&&_0x4c87ca[_0x031d('0x37')]&&_0x4c87ca[_0x031d('0x32')]){_0x23f5bd[_0x4c87ca[_0x031d('0x37')][_0x031d('0x33')]()]=_0xb3982a[_0x4c87ca[_0x031d('0x3a')]['name'][_0x031d('0x33')]()][_0x031d('0x35')]();}});}return _0x23f5bd;}function getTicket(_0x53315b,_0x22906a,_0x2a51ec,_0x184fd0,_0x2fea91,_0x2b1e22){return function(_0x4d57d2){logger[_0x031d('0x1b')]('['+[_0x53315b[_0x031d('0x15')]()]+']\x20getTicket\x20input\x20crm',_0x4d57d2);return new Promise(function(_0x20eea8,_0x165666){var _0x469eb5=_0x53315b['toLowerCase']()===_0x031d('0x3b')?_0x4d57d2[_0x031d('0x1f')]:_0x4d57d2[_0x031d('0x2a')];var _0x48fb71={'method':_0x031d('0x25'),'uri':_0x2a51ec+'incident'+'?'+_0x2b1e22,'body':Object[_0x031d('0x3c')]({},{'active':_0x031d('0x3d'),'caller_id':_0x469eb5,'assigned_to':_0x4d57d2['userId'],'short_description':intUtil[_0x031d('0x3e')](_0x184fd0[_0x031d('0x3f')],_0x2fea91,'\x20'),'description':intUtil[_0x031d('0x3e')](_0x184fd0[_0x031d('0x40')],_0x2fea91,'\x0a')},getCustomFields(_0x184fd0[_0x031d('0x41')],_0x2fea91)),'auth':_0x22906a,'json':!![]};return rp(_0x48fb71)['then'](function(_0x503a54){logger[_0x031d('0x1b')]('['+[_0x53315b[_0x031d('0x15')]()]+_0x031d('0x42'),_0x503a54['result']);_0x4d57d2[_0x031d('0x43')]=_0x503a54['result'][_0x031d('0x12')];_0x4d57d2[_0x031d('0x44')]=_0x503a54[_0x031d('0xf')][_0x031d('0x45')];logger['info']('['+[_0x53315b['toUpperCase']()]+_0x031d('0x46'),_0x4d57d2);_0x20eea8(_0x4d57d2);})['catch'](function(_0x29bbab){logger[_0x031d('0x14')]('['+[_0x53315b['toUpperCase']()]+']',_0x29bbab[_0x031d('0x16')]);_0x165666(_0x29bbab[_0x031d('0x16')]);});});};}function createRemoteTag(_0x301992,_0x2bc2f9,_0x14f8cd,_0x3594a1){return new Promise(function(_0x107c6f,_0x15abf4){var _0x4e9963={'method':_0x031d('0x25'),'uri':_0x14f8cd+_0x031d('0x47')+'?'+_0x3594a1,'body':{'short_description':_0x301992,'global':!![],'active':!![],'name':_0x301992},'auth':_0x2bc2f9,'json':!![]};return rp(_0x4e9963)[_0x031d('0xe')](function(_0x2f9f75){var _0x3dbca9=_0x2f9f75[_0x031d('0xf')]['sys_id'];_0x107c6f(_0x3dbca9);});});}function getRemoteTag(_0x24ae08,_0xe3d9a,_0x393f5b,_0x5761d4,_0x1f8729){return new Promise(function(_0x1a360e,_0x1c4199){var _0x34edd8={'method':_0x031d('0xd'),'uri':_0x393f5b+'label'+_0x031d('0x48')+_0x24ae08+'&'+_0x5761d4,'auth':_0xe3d9a,'json':!![]};return rp(_0x34edd8)['then'](function(_0x179c96){if(_0x179c96['result'][_0x031d('0x10')]>0x0){var _0x3f8b5a=_0x179c96[_0x031d('0xf')][0x0][_0x031d('0x12')];_0x1a360e(_0x3f8b5a);}else{return createRemoteTag(_0x24ae08,_0xe3d9a,_0x393f5b,_0x5761d4)[_0x031d('0xe')](function(_0x1e6685){_0x1a360e(_0x1e6685);});}});});}function assignTagToIncident(_0x83023,_0x3606f6,_0x11d577,_0x5e1ba2,_0x4d0933){return new Promise(function(_0x3c2c04,_0xd961a7){var _0x2c3f6d={'method':_0x031d('0x25'),'uri':_0x11d577+'label_entry'+'?'+_0x4d0933,'body':{'label':_0x83023,'table':_0x031d('0x49'),'id_type':'Incident','table_key':_0x5e1ba2['ticketId'],'title':_0x031d('0x4a')+_0x5e1ba2['ticketNumber'],'id_display':_0x5e1ba2[_0x031d('0x44')]},'auth':_0x3606f6,'json':!![]};return rp(_0x2c3f6d)['then'](function(_0x33f2d9){_0x3c2c04();})[_0x031d('0x21')](function(){_0x3c2c04();});});}function manageTags(_0xa27804,_0x483904,_0xa7cc4a,_0x160e51,_0x15c4c9,_0x44a6bb,_0x3df18c){return new Promise(function(_0xc9436c,_0x4f2703){var _0x76dcb8=[];_0x483904[_0x031d('0x2d')](function(_0x5dab7f){_0x76dcb8[_0x031d('0x4b')](getRemoteTag(_0x5dab7f,_0xa7cc4a,_0x160e51,_0x44a6bb,_0x3df18c));});return Promise[_0x031d('0x4c')](_0x76dcb8)[_0x031d('0xe')](function(_0x36200b){if(_0x36200b[_0x031d('0x10')]){logger[_0x031d('0x1b')]('['+[_0xa27804['toUpperCase']()]+_0x031d('0x4d'),_0x36200b);var _0x5cd745=[];_0x36200b[_0x031d('0x2d')](function(_0x2429be){_0x5cd745[_0x031d('0x4b')](assignTagToIncident(_0x2429be,_0xa7cc4a,_0x160e51,_0x15c4c9,_0x44a6bb));});return Promise[_0x031d('0x4c')](_0x5cd745)[_0x031d('0xe')](function(){_0xc9436c();})[_0x031d('0x21')](function(){_0xc9436c();});}else{_0xc9436c();}});});}function getTags(_0x31a81a,_0x11ca16,_0x1745e0,_0x3d3a15,_0x14a869,_0x5666b1){return function(_0x1d1371){return new Promise(function(_0x43ef3d,_0x47e9ee){var _0x2ac6de=[];var _0x42deb2=_0x3d3a15[_0x031d('0x4e')];if(_0x42deb2&&_0x42deb2[_0x031d('0x10')]>0x0){_0x2ac6de=_[_0x031d('0x4f')](_0x42deb2,_0x031d('0x50'));}if(_0x2ac6de['length']>0x0){return manageTags(_0x31a81a,_0x2ac6de,_0x11ca16,_0x1745e0,_0x1d1371,_0x14a869,_0x5666b1)['then'](function(){_0x43ef3d(_0x1d1371);});}else{_0x43ef3d(_0x1d1371);}});};}function emit(_0x274219,_0x2725f6,_0x3899c2){var _0xe6c92c=_0x031d('0x51')+_0x031d('0x52')+_0x031d('0x53')+_0x031d('0x54');var _0x16862b={'uri':_0x274219+_0x031d('0x55')+_0x3899c2+_0xe6c92c};io['to'](util[_0x031d('0x56')](_0x031d('0x57'),_0x2725f6))[_0x031d('0x58')](_0x031d('0x59'),_0x16862b);}exports['cs']=function(_0x18b03c,_0x50cc31,_0x46bdd7,_0x296747,_0x314fee,_0x2b74da,_0x70f24b,_0x34fd03){var _0x1ccbf9={};var _0x4baefb={'user':_0x2b74da[_0x031d('0x5a')],'pass':_0x2b74da[_0x031d('0x5b')]};var _0x365b28=_0x031d('0x5c');var _0x34d9f6=_0x031d('0x5d');_0x2b74da[_0x031d('0x5e')]=intUtil['stripTrailingSlash'](_0x2b74da['remoteUri']);_0x2b74da[_0x031d('0x5f')]=intUtil[_0x031d('0x60')](_0x2b74da[_0x031d('0x5f')]);var _0x10697f=util[_0x031d('0x56')]('%s/api/now/table/',_0x2b74da[_0x031d('0x5e')]);_0x1ccbf9[_0x031d('0x19')]=!_[_0x031d('0x61')](_0x296747)?_0x296747[_0x031d('0x62')]:null;_0x1ccbf9['adminEmail']=_0x2b74da[_0x031d('0x62')];_0x1ccbf9[_0x031d('0x28')]=_0x34fd03['toLowerCase']()==='outbound'?_0x50cc31['destcalleridnum']:_0x50cc31[_0x031d('0x63')];_0x1ccbf9['callDirection']=_0x34fd03===_0x031d('0x64')||_0x34fd03===_0x031d('0x65')?'queue':_0x031d('0x3b');var _0x46dcdf=util[_0x031d('0x56')](_0x031d('0x66'),_0x2b74da['serverUrl'],_0x50cc31[_0x031d('0x67')],md5(_0x50cc31[_0x031d('0x67')]));if(_0x314fee&&_0x314fee['monitor_format']){logger[_0x031d('0x1b')](_0x031d('0x68'),'Recording\x20is\x20enabled!');_0x50cc31['recordingURL']=_0x46dcdf;}else if(_0x70f24b&&_0x70f24b[_0x031d('0x69')]&&_0x70f24b[_0x031d('0x69')]!==_0x031d('0x6a')){logger[_0x031d('0x1b')](_0x031d('0x6b'),'Recording\x20is\x20enabled!');_0x50cc31['recordingURL']=_0x46dcdf;}else{_0x50cc31[_0x031d('0x6c')]='';}return getAdminUser(_0x34fd03,_0x4baefb,_0x1ccbf9,_0x10697f,_0x34d9f6,_0x365b28)[_0x031d('0xe')](getUser(_0x34fd03,_0x4baefb,_0x10697f,_0x34d9f6,_0x365b28))[_0x031d('0xe')](getEndUser(_0x34fd03,_0x4baefb,_0x10697f,_0x34d9f6,_0x365b28))[_0x031d('0xe')](getTicket(_0x34fd03,_0x4baefb,_0x10697f,_0x46bdd7,_0x50cc31,_0x34d9f6))[_0x031d('0xe')](function(_0x3d1174){logger[_0x031d('0x1b')](util[_0x031d('0x56')](_0x031d('0x6d'),_0x3d1174[_0x031d('0x43')]));logger[_0x031d('0x1b')](util['format']('call\x20direction:\x20%s',_0x34fd03));if(_0x34fd03!==_0x031d('0x65')){logger[_0x031d('0x1b')]('['+[_0x34fd03[_0x031d('0x15')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2b74da[_0x031d('0x5e')],_0x296747[_0x031d('0x50')],_0x3d1174[_0x031d('0x43')]);}})[_0x031d('0x21')](function(_0x41cf22){logger[_0x031d('0x14')]('['+[_0x34fd03[_0x031d('0x15')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x031d('0x6e')](_0x41cf22,{'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 8ea7121..d195976 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 _0xcf28=['customField','toLowerCase','content','variable','custom_fields','customVariable','Variable','login','password','PLAIN','sessionID','set_relationship','Calls','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','charAt','[OUTBOUND]','user:%s','unmanaged','lastevent','toUpperCase','isNil','Ticket\x20created!','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','description','Descriptions','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','variableName','push','idField','set_entry','JSON','stringify','apiKey','toString','base64','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','then','entry_list','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','first_name','[HTTP]','map','forEach','type'];(function(_0x1d6b32,_0x6efa18){var _0x43099d=function(_0x3f2e85){while(--_0x3f2e85){_0x1d6b32['push'](_0x1d6b32['shift']());}};_0x43099d(++_0x6efa18);}(_0xcf28,0xa9));var _0x8cf2=function(_0x30e7ca,_0x1135e2){_0x30e7ca=_0x30e7ca-0x0;var _0x1a65ec=_0xcf28[_0x30e7ca];return _0x1a65ec;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x8cf2('0x0'));var md5=require(_0x8cf2('0x1'));var util=require(_0x8cf2('0x2'));var Redis=require('ioredis');var intUtil=require(_0x8cf2('0x3'));var config=require(_0x8cf2('0x4'));var logger=require(_0x8cf2('0x5'))('sugarcrm');config[_0x8cf2('0x6')]=_[_0x8cf2('0x7')](config[_0x8cf2('0x6')],{'host':_0x8cf2('0x8'),'port':0x18eb});var io=require(_0x8cf2('0x9'))(new Redis(config['redis']));var def={'method':_0x8cf2('0xa'),'json':!![]};function emit(_0x3a2922,_0x34f939,_0x395501){io['to'](_0x3a2922)['emit'](_0x34f939,_0x395501);}function getTicket(_0x4e3fe4,_0x478303,_0x54da7c,_0x502738,_0x2136ac,_0x546cf7,_0x20ee9a,_0x16aebe){logger[_0x8cf2('0xb')](_0x8cf2('0xc'));var _0x6d20b2=new Date();var _0x5b6bbd=[{'name':_0x8cf2('0xd'),'value':intUtil[_0x8cf2('0xe')](_0x502738[_0x8cf2('0xf')],_0x2136ac,'\x20')},{'name':_0x8cf2('0x10'),'value':_0x478303['id']},{'name':'created_by','value':_0x478303['id']},{'name':_0x8cf2('0x11'),'value':intUtil[_0x8cf2('0xe')](_0x502738[_0x8cf2('0x12')],_0x2136ac,'\x0a')},{'name':'date_start','value':_0x6d20b2['toISOString']()[_0x8cf2('0x13')](0x0,0x13)[_0x8cf2('0x14')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x8cf2('0x15'),'value':'15'},{'name':_0x8cf2('0x16'),'value':_0x54da7c['id']},{'name':_0x8cf2('0x17'),'value':_0x8cf2('0x18')},{'name':_0x8cf2('0x19'),'value':_0x54da7c['name']},{'name':'direction','value':_0x16aebe}];if(_0x546cf7[_0x8cf2('0x1a')]){_['forEach'](_0x546cf7,function(_0x2d5feb){if(_0x2136ac[_0x2d5feb[_0x8cf2('0x1b')]]){_0x5b6bbd[_0x8cf2('0x1c')]({'name':_0x2d5feb[_0x8cf2('0x1d')],'value':_0x2136ac[_0x2d5feb[_0x8cf2('0x1b')]]});}});}return request({'form':{'method':_0x8cf2('0x1e'),'input_type':'JSON','response_type':_0x8cf2('0x1f'),'rest_data':JSON[_0x8cf2('0x20')]({'session':_0x20ee9a['id'],'module_name':'Calls','name_value_list':_0x5b6bbd})}});}function getAuth(_0x1dc00d){return util['format']('Basic\x20%s',new Buffer(_0x1dc00d[_0x8cf2('0x21')]+':X')[_0x8cf2('0x22')](_0x8cf2('0x23')));}function getServerInfo(_0x590311){return request({'form':{'method':'get_server_info','input_type':_0x8cf2('0x1f'),'response_type':_0x8cf2('0x1f'),'rest_data':JSON['stringify']({'session':_0x590311['id']})}});}function getUser(_0x4536dc,_0x516f69,_0x58a76f){if(!_['isNil'](_0x516f69)){logger['info'](_0x8cf2('0x24'),_0x516f69);return request({'form':{'method':_0x8cf2('0x25'),'input_type':_0x8cf2('0x1f'),'response_type':_0x8cf2('0x1f'),'rest_data':JSON['stringify']({'session':_0x58a76f['id'],'module_name':_0x8cf2('0x26'),'query':util[_0x8cf2('0x27')](_0x8cf2('0x28'),_0x516f69),'order_by':'','offset':'0','select_fields':['id',_0x8cf2('0xd'),_0x8cf2('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5ed4d0){if(_0x5ed4d0['entry_list'][_0x8cf2('0x1a')]){var _0x2218de=_[_0x8cf2('0x2a')](_0x5ed4d0['entry_list'],function(_0x5676b9){return _0x5676b9[_0x8cf2('0x2b')][_0x8cf2('0x29')][_0x8cf2('0x2c')]===_0x516f69;});if(_0x2218de){logger[_0x8cf2('0xb')]('Agent\x20found!');return BPromise[_0x8cf2('0x2d')]({'id':_0x2218de['name_value_list']['id'][_0x8cf2('0x2c')],'name':_0x2218de['name_value_list'][_0x8cf2('0xd')][_0x8cf2('0x2c')]});}}logger['info'](_0x8cf2('0x2e'));return BPromise[_0x8cf2('0x2d')]({'id':_0x58a76f[_0x8cf2('0x2b')]['user_id'][_0x8cf2('0x2c')],'name':_0x58a76f['name_value_list'][_0x8cf2('0x29')][_0x8cf2('0x2c')]});});}else{logger[_0x8cf2('0xb')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x58a76f[_0x8cf2('0x2b')]['user_id']['value'],'name':_0x58a76f[_0x8cf2('0x2b')][_0x8cf2('0x29')][_0x8cf2('0x2c')]});}}function getEndUser(_0x4d8857,_0xfc95b7,_0xf1bdd2,_0x12e2a3){logger[_0x8cf2('0xb')](_0x8cf2('0x2f'),_0xf1bdd2);return request({'form':{'method':'get_entry_list','input_type':_0x8cf2('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x12e2a3['id'],'module_name':_0x8cf2('0x18'),'query':util[_0x8cf2('0x27')](_0x8cf2('0x30'),_0xf1bdd2),'order_by':'','offset':'0','select_fields':['id',_0x8cf2('0xd'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8cf2('0x31')](function(_0x28dc40){if(_0x28dc40[_0x8cf2('0x32')]['length']){var _0x3cacae=_[_0x8cf2('0x2a')](_0x28dc40[_0x8cf2('0x32')],function(_0x5564f1){return _0x5564f1['name_value_list'][_0x8cf2('0x33')][_0x8cf2('0x2c')]===_0xf1bdd2;});if(_0x3cacae){logger[_0x8cf2('0xb')](_0x8cf2('0x34'));return BPromise[_0x8cf2('0x2d')]({'id':_0x3cacae[_0x8cf2('0x2b')]['id'][_0x8cf2('0x2c')],'name':_0x3cacae['name_value_list'][_0x8cf2('0xd')]['value'],'phone':_0x3cacae[_0x8cf2('0x2b')]['phone_home'][_0x8cf2('0x2c')]});}}else{logger[_0x8cf2('0xb')](_0x8cf2('0x35'));return request({'form':{'method':_0x8cf2('0x1e'),'input_type':_0x8cf2('0x1f'),'response_type':_0x8cf2('0x1f'),'rest_data':JSON[_0x8cf2('0x20')]({'session':_0x12e2a3['id'],'module_name':_0x8cf2('0x18'),'name_value_list':[{'name':'first_name','value':_0xfc95b7!==_0x8cf2('0x36')?_0xfc95b7:util[_0x8cf2('0x27')](_0x8cf2('0x37'),_0xf1bdd2)},{'name':_0x8cf2('0x33'),'value':_0xf1bdd2}]})}})['then'](function(_0x527c6f){logger['info']('Enduser\x20created.');return BPromise['resolve']({'id':_0x527c6f['id'],'name':_0x527c6f[_0x8cf2('0x32')][_0x8cf2('0x38')][_0x8cf2('0x2c')],'phone':_0x527c6f['entry_list'][_0x8cf2('0x33')][_0x8cf2('0x2c')]});});}});}function request(_0x4a19b4){logger['debug'](_0x8cf2('0x39'),JSON[_0x8cf2('0x20')](_0x4a19b4));return rp(_['merge'](def,_0x4a19b4));}function getTags(_0x451bc3,_0x174e82){var _0x8e05f4=[];if(_0x451bc3&&_0x451bc3['length']>0x0){_0x8e05f4=_[_0x8cf2('0x3a')](_0x451bc3,_0x174e82);}return _0x8e05f4;}function getCustomFields(_0x5eb95c,_0x5b5aed){var _0x588602=[];var _0x429cbd={'custom_fields':[]};if(_0x5eb95c[_0x8cf2('0x1a')]>0x0){_[_0x8cf2('0x3b')](_0x5eb95c,function(_0x483d98){if(_0x483d98[_0x8cf2('0x3c')]==='string'&&_0x483d98['nameField']&&!_0x483d98[_0x8cf2('0x3d')]){_0x429cbd[_0x483d98['nameField'][_0x8cf2('0x3e')]()]=_0x483d98[_0x8cf2('0x3f')][_0x8cf2('0x22')]();}else if(_0x483d98[_0x8cf2('0x3c')]==='string'&&_0x483d98[_0x8cf2('0x1d')]&&_0x483d98[_0x8cf2('0x3d')]){_0x429cbd['custom_fields'][_0x8cf2('0x1c')]({'id':_0x483d98['idField'],'value':_0x483d98[_0x8cf2('0x3f')][_0x8cf2('0x22')]()});}else if(_0x483d98[_0x8cf2('0x3c')]===_0x8cf2('0x40')&&_0x483d98[_0x8cf2('0x1b')]&&_0x483d98[_0x8cf2('0x1d')]&&_0x483d98[_0x8cf2('0x3d')]){_0x5b5aed[_0x483d98['variableName']]&&_0x429cbd[_0x8cf2('0x41')][_0x8cf2('0x1c')]({'id':_0x483d98['idField'],'value':_0x5b5aed[_0x483d98['variableName']][_0x8cf2('0x22')]()});}else if(_0x483d98[_0x8cf2('0x3c')]===_0x8cf2('0x42')&&_0x483d98['Variable']&&_0x483d98[_0x8cf2('0x43')][_0x8cf2('0xd')]&&_0x483d98[_0x8cf2('0x1d')]&&_0x483d98[_0x8cf2('0x3d')]){_0x5b5aed[_0x483d98[_0x8cf2('0x43')][_0x8cf2('0xd')]['toLowerCase']()]&&_0x429cbd[_0x8cf2('0x41')][_0x8cf2('0x1c')]({'id':_0x483d98[_0x8cf2('0x1d')],'value':_0x5b5aed[_0x483d98[_0x8cf2('0x43')][_0x8cf2('0xd')][_0x8cf2('0x3e')]()][_0x8cf2('0x22')]()});}});}return _0x429cbd;}function getConnection(_0xbb2097){return request({'method':_0x8cf2('0xa'),'form':{'method':_0x8cf2('0x44'),'input_type':'JSON','response_type':_0x8cf2('0x1f'),'rest_data':JSON[_0x8cf2('0x20')]({'user_auth':{'user_name':_0xbb2097['username'],'password':_0xbb2097[_0x8cf2('0x45')],'encryption':_0x8cf2('0x46')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x8cf2('0x31')](function(_0x40c4f1){var _0xe0482e=_0x40c4f1;if(_0xe0482e['id']){def[_0x8cf2('0x47')]=_0xe0482e['id'];return BPromise[_0x8cf2('0x2d')](_0xe0482e);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0xbb2097['id']));}});}function setRelationship(_0x3a5b8d,_0x405247,_0x1f46f5,_0x42cd8a){return request({'form':{'method':_0x8cf2('0x48'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x8cf2('0x20')]({'session':_0x3a5b8d['id'],'module_name':_0x8cf2('0x49'),'module_id':_0x1f46f5['id'],'link_field_name':_0x42cd8a,'related_ids':[_0x405247['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x8cf2('0x4a')]=function(_0x49876c,_0x1ef049,_0x5b39cf,_0x2fe5e9,_0x2b5574,_0x4ae1ed){var _0x46ba7b,_0x237d6b,_0x12c740,_0x3edbd5;_0x4ae1ed[_0x8cf2('0x4b')]=intUtil['stripTrailingSlash'](_0x4ae1ed[_0x8cf2('0x4b')]);_0x4ae1ed[_0x8cf2('0x4c')]=intUtil[_0x8cf2('0x4d')](_0x4ae1ed[_0x8cf2('0x4c')]);def[_0x8cf2('0x4e')]=util[_0x8cf2('0x27')](_0x8cf2('0x4f'),_0x4ae1ed[_0x8cf2('0x4b')]);if(_0x2b5574&&_0x2b5574[_0x8cf2('0x50')]){logger[_0x8cf2('0xb')](_0x8cf2('0x51'),_0x8cf2('0x52'));_0x1ef049[_0x8cf2('0x53')]=util[_0x8cf2('0x27')](_0x8cf2('0x54'),_0x4ae1ed['serverUrl'],_0x1ef049[_0x8cf2('0x55')],md5(_0x1ef049[_0x8cf2('0x55')]));}else{_0x1ef049[_0x8cf2('0x53')]='';}return getConnection(_0x4ae1ed)[_0x8cf2('0x31')](function(_0x57cdab){_0x3edbd5=_0x57cdab;return getUser(_0x4ae1ed,_0x2fe5e9[_0x8cf2('0xd')],_0x3edbd5);})[_0x8cf2('0x31')](function(_0x3506ec){_0x46ba7b=_0x3506ec;logger[_0x8cf2('0xb')](_0x8cf2('0x56'),_0x46ba7b['id']);return getEndUser(_0x4ae1ed,_0x1ef049[_0x8cf2('0x57')],_0x1ef049[_0x8cf2('0x58')],_0x3edbd5);})[_0x8cf2('0x31')](function(_0x3d70ce){_0x237d6b=_0x3d70ce;logger[_0x8cf2('0xb')](_0x8cf2('0x59'),_0x237d6b['id']);return getTicket(_0x4ae1ed,_0x46ba7b,_0x237d6b,_0x5b39cf,_0x1ef049,_0x5b39cf[_0x8cf2('0x5a')],_0x3edbd5,_0x8cf2('0x5b'));})['then'](function(_0x9eaba){_0x12c740=_0x9eaba;logger['info']('Ticket\x20created!');logger[_0x8cf2('0xb')]('The\x20Ticket\x20ID\x20is:',_0x12c740['id']);return setRelationship(_0x3edbd5,_0x46ba7b,_0x12c740,_0x8cf2('0x5c'));})['then'](function(){return setRelationship(_0x3edbd5,_0x237d6b,_0x12c740,_0x8cf2('0x5d'));})[_0x8cf2('0x31')](function(){return getServerInfo(_0x3edbd5);})['then'](function(_0x190c35){var _0xb23e48=parseInt(_0x190c35[_0x8cf2('0x5e')]['charAt'](0x0));var _0x273f71=util['format'](_0x8cf2('0x5f'),_0x4ae1ed[_0x8cf2('0x4b')],_0x12c740['id']);if(_0xb23e48>0x6){_0x273f71=util[_0x8cf2('0x27')](_0x8cf2('0x60'),_0x4ae1ed['remoteUri'],_0x12c740['id']);}logger[_0x8cf2('0xb')]('[QUEUE]',_0x8cf2('0x61'));emit(util[_0x8cf2('0x27')]('user:%s',_0x2fe5e9[_0x8cf2('0xd')]),_0x8cf2('0x62'),{'uri':_0x273f71});})[_0x8cf2('0x63')](function(_0x29e734){logger[_0x8cf2('0x64')](_0x8cf2('0x51'),JSON[_0x8cf2('0x20')](_0x29e734));});};exports['outbound']=function(_0x34faf4,_0x255e91,_0x4b1f12,_0xc93376,_0x2b83fe,_0x42f575,_0x186eb5){var _0x489c98,_0x335b42,_0x3866f6,_0x351c42;_0x42f575[_0x8cf2('0x4b')]=intUtil['stripTrailingSlash'](_0x42f575[_0x8cf2('0x4b')]);_0x42f575[_0x8cf2('0x4c')]=intUtil[_0x8cf2('0x4d')](_0x42f575[_0x8cf2('0x4c')]);def[_0x8cf2('0x4e')]=util[_0x8cf2('0x27')](_0x8cf2('0x4f'),_0x42f575[_0x8cf2('0x4b')]);if(_0x186eb5&&_0x186eb5[_0x8cf2('0x65')]&&_0x186eb5[_0x8cf2('0x65')]!==_0x8cf2('0x66')){logger[_0x8cf2('0xb')]('[OUTBOUND]',_0x8cf2('0x52'));_0x255e91[_0x8cf2('0x53')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x42f575[_0x8cf2('0x4c')],_0x255e91[_0x8cf2('0x55')],md5(_0x255e91[_0x8cf2('0x55')]));}return getConnection(_0x42f575)[_0x8cf2('0x31')](function(_0x831338){_0x351c42=_0x831338;return getUser(_0x42f575,_0xc93376[_0x8cf2('0xd')],_0x351c42);})[_0x8cf2('0x31')](function(_0x5cfd69){_0x489c98=_0x5cfd69;logger[_0x8cf2('0xb')](_0x8cf2('0x56'),_0x489c98['id']);return getEndUser(_0x42f575,_0x255e91[_0x8cf2('0x67')],_0x255e91[_0x8cf2('0x68')],_0x351c42);})['then'](function(_0x49ce67){_0x335b42=_0x49ce67;logger[_0x8cf2('0xb')](_0x8cf2('0x59'),_0x335b42['id']);return getTicket(_0x42f575,_0x489c98,_0x335b42,_0x4b1f12,_0x255e91,_0x4b1f12['Fields'],_0x351c42,_0x8cf2('0x69'));})[_0x8cf2('0x31')](function(_0x12d842){_0x3866f6=_0x12d842;logger[_0x8cf2('0xb')]('Ticket\x20created!');logger[_0x8cf2('0xb')](_0x8cf2('0x6a'),_0x3866f6['id']);return setRelationship(_0x351c42,_0x489c98,_0x3866f6,'users');})['then'](function(){return setRelationship(_0x351c42,_0x335b42,_0x3866f6,_0x8cf2('0x5d'));})[_0x8cf2('0x31')](function(){return getServerInfo(_0x351c42);})['then'](function(_0x482257){var _0x266b62=parseInt(_0x482257[_0x8cf2('0x5e')][_0x8cf2('0x6b')](0x0));var _0x33d3ac=util['format'](_0x8cf2('0x5f'),_0x42f575['remoteUri'],_0x3866f6['id']);if(_0x266b62>0x6){_0x33d3ac=util['format'](_0x8cf2('0x60'),_0x42f575['remoteUri'],_0x3866f6['id']);}logger[_0x8cf2('0xb')](_0x8cf2('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8cf2('0x27')](_0x8cf2('0x6d'),_0xc93376[_0x8cf2('0xd')]),_0x8cf2('0x62'),{'uri':_0x33d3ac});})['catch'](function(_0xfc1dc8){logger[_0x8cf2('0x64')]('[OUTBOUND]',JSON[_0x8cf2('0x20')](_0xfc1dc8));});};exports[_0x8cf2('0x6e')]=function(_0x509c32,_0x46f4c3,_0x25f942,_0x36de80,_0x49c256,_0x402abf){var _0x5f13c2,_0x37be3c,_0x590e35,_0x45fcf7;_0x402abf[_0x8cf2('0x4b')]=intUtil[_0x8cf2('0x4d')](_0x402abf[_0x8cf2('0x4b')]);_0x402abf[_0x8cf2('0x4c')]=intUtil['stripTrailingSlash'](_0x402abf[_0x8cf2('0x4c')]);def['uri']=util[_0x8cf2('0x27')](_0x8cf2('0x4f'),_0x402abf[_0x8cf2('0x4b')]);if(_0x49c256&&_0x49c256[_0x8cf2('0x50')]){logger[_0x8cf2('0xb')]('['+_0x46f4c3[_0x8cf2('0x6f')][_0x8cf2('0x70')]()+']',_0x8cf2('0x52'));_0x46f4c3[_0x8cf2('0x53')]=util[_0x8cf2('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x402abf[_0x8cf2('0x4c')],_0x46f4c3[_0x8cf2('0x55')],md5(_0x46f4c3[_0x8cf2('0x55')]));}else{_0x46f4c3[_0x8cf2('0x53')]='';}return getConnection(_0x402abf)[_0x8cf2('0x31')](function(_0x2e3663){_0x45fcf7=_0x2e3663;if(!_[_0x8cf2('0x71')](_0x36de80)){return getUser(_0x402abf,_0x36de80[_0x8cf2('0xd')],_0x45fcf7);}else{return getUser(_0x402abf,null,_0x45fcf7);}})[_0x8cf2('0x31')](function(_0x5ca112){_0x5f13c2=_0x5ca112;logger[_0x8cf2('0xb')](_0x8cf2('0x56'),_0x5f13c2['id']);return getEndUser(_0x402abf,_0x46f4c3[_0x8cf2('0x57')],_0x46f4c3[_0x8cf2('0x58')],_0x45fcf7);})['then'](function(_0x391f3b){_0x37be3c=_0x391f3b;logger[_0x8cf2('0xb')](_0x8cf2('0x59'),_0x37be3c['id']);return getTicket(_0x402abf,_0x5f13c2,_0x37be3c,_0x25f942,_0x46f4c3,_0x25f942[_0x8cf2('0x5a')],_0x45fcf7,'Inbound');})[_0x8cf2('0x31')](function(_0x3ea00d){_0x590e35=_0x3ea00d;logger[_0x8cf2('0xb')](_0x8cf2('0x72'));logger['info'](_0x8cf2('0x6a'),_0x590e35['id']);return setRelationship(_0x45fcf7,_0x5f13c2,_0x590e35,'users');})[_0x8cf2('0x31')](function(){return setRelationship(_0x45fcf7,_0x37be3c,_0x590e35,_0x8cf2('0x5d'));})['then'](function(){return getServerInfo(_0x45fcf7);})[_0x8cf2('0x63')](function(_0x355d61){logger[_0x8cf2('0x64')]('['+_0x46f4c3[_0x8cf2('0x6f')][_0x8cf2('0x70')]()+']',JSON[_0x8cf2('0x20')](_0x355d61));});}; \ No newline at end of file +var _0xeea2=['calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','none','The\x20User\x20ID\x20is:','Outbound','The\x20Ticket\x20ID\x20is:','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','catch','unmanaged','uri','toUpperCase','Inbound','error','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','apiKey','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','stringify','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Enduser\x20created.','debug','[HTTP]','merge','map','type','nameField','customField','toLowerCase','toString','string','custom_fields','content','variable','customVariable','Variable','login','username','password','PLAIN','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0xd9a115,_0xf48e41){var _0x46de1f=function(_0x175223){while(--_0x175223){_0xd9a115['push'](_0xd9a115['shift']());}};_0x46de1f(++_0xf48e41);}(_0xeea2,0x112));var _0x2eea=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xeea2[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0x2eea('0x0'));var rp=require(_0x2eea('0x1'));var BPromise=require(_0x2eea('0x2'));var md5=require(_0x2eea('0x3'));var util=require(_0x2eea('0x4'));var Redis=require(_0x2eea('0x5'));var intUtil=require(_0x2eea('0x6'));var config=require(_0x2eea('0x7'));var logger=require(_0x2eea('0x8'))(_0x2eea('0x9'));config[_0x2eea('0xa')]=_[_0x2eea('0xb')](config[_0x2eea('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x2eea('0xc'))(new Redis(config[_0x2eea('0xa')]));var def={'method':_0x2eea('0xd'),'json':!![]};function emit(_0x415201,_0x450484,_0x5b0c8d){io['to'](_0x415201)[_0x2eea('0xe')](_0x450484,_0x5b0c8d);}function getTicket(_0x109144,_0x46fe14,_0x10cf09,_0x4e9be4,_0xa60377,_0x956c1f,_0x42ece8,_0x5d79c6){logger[_0x2eea('0xf')](_0x2eea('0x10'));var _0x2636a8=new Date();var _0x402293=[{'name':_0x2eea('0x11'),'value':intUtil[_0x2eea('0x12')](_0x4e9be4['Subjects'],_0xa60377,'\x20')},{'name':_0x2eea('0x13'),'value':_0x46fe14['id']},{'name':_0x2eea('0x14'),'value':_0x46fe14['id']},{'name':_0x2eea('0x15'),'value':intUtil[_0x2eea('0x12')](_0x4e9be4[_0x2eea('0x16')],_0xa60377,'\x0a')},{'name':'date_start','value':_0x2636a8[_0x2eea('0x17')]()[_0x2eea('0x18')](0x0,0x13)[_0x2eea('0x19')]('T','\x20')},{'name':_0x2eea('0x1a'),'value':'0'},{'name':_0x2eea('0x1b'),'value':'15'},{'name':'parent_id','value':_0x10cf09['id']},{'name':'parent_type','value':_0x2eea('0x1c')},{'name':_0x2eea('0x1d'),'value':_0x10cf09[_0x2eea('0x11')]},{'name':_0x2eea('0x1e'),'value':_0x5d79c6}];if(_0x956c1f[_0x2eea('0x1f')]){_[_0x2eea('0x20')](_0x956c1f,function(_0xb14ede){if(_0xa60377[_0xb14ede[_0x2eea('0x21')]]){_0x402293[_0x2eea('0x22')]({'name':_0xb14ede[_0x2eea('0x23')],'value':_0xa60377[_0xb14ede[_0x2eea('0x21')]]});}});}return request({'form':{'method':_0x2eea('0x24'),'input_type':_0x2eea('0x25'),'response_type':_0x2eea('0x25'),'rest_data':JSON['stringify']({'session':_0x42ece8['id'],'module_name':'Calls','name_value_list':_0x402293})}});}function getAuth(_0x387e61){return util['format']('Basic\x20%s',new Buffer(_0x387e61[_0x2eea('0x26')]+':X')['toString'](_0x2eea('0x27')));}function getServerInfo(_0x30b9c5){return request({'form':{'method':_0x2eea('0x28'),'input_type':_0x2eea('0x25'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x30b9c5['id']})}});}function getUser(_0xa385fc,_0x3a3011,_0x243259){if(!_[_0x2eea('0x29')](_0x3a3011)){logger[_0x2eea('0xf')](_0x2eea('0x2a'),_0x3a3011);return request({'form':{'method':_0x2eea('0x2b'),'input_type':'JSON','response_type':_0x2eea('0x25'),'rest_data':JSON['stringify']({'session':_0x243259['id'],'module_name':'Employees','query':util['format'](_0x2eea('0x2c'),_0x3a3011),'order_by':'','offset':'0','select_fields':['id',_0x2eea('0x11'),_0x2eea('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2eea('0x2e')](function(_0x589050){if(_0x589050['entry_list']['length']){var _0x331506=_['find'](_0x589050[_0x2eea('0x2f')],function(_0x21d399){return _0x21d399[_0x2eea('0x30')][_0x2eea('0x2d')][_0x2eea('0x31')]===_0x3a3011;});if(_0x331506){logger[_0x2eea('0xf')](_0x2eea('0x32'));return BPromise[_0x2eea('0x33')]({'id':_0x331506[_0x2eea('0x30')]['id'][_0x2eea('0x31')],'name':_0x331506['name_value_list']['name']['value']});}}logger[_0x2eea('0xf')](_0x2eea('0x34'));return BPromise['resolve']({'id':_0x243259[_0x2eea('0x30')][_0x2eea('0x35')][_0x2eea('0x31')],'name':_0x243259[_0x2eea('0x30')]['user_name'][_0x2eea('0x31')]});});}else{logger['info'](_0x2eea('0x36'));return BPromise[_0x2eea('0x33')]({'id':_0x243259[_0x2eea('0x30')][_0x2eea('0x35')][_0x2eea('0x31')],'name':_0x243259[_0x2eea('0x30')][_0x2eea('0x2d')][_0x2eea('0x31')]});}}function getEndUser(_0x25cefe,_0x2ee04e,_0x56b4b4,_0x2eb5e6){logger[_0x2eea('0xf')]('Searching\x20enduser\x20with\x20phone',_0x56b4b4);return request({'form':{'method':_0x2eea('0x2b'),'input_type':_0x2eea('0x25'),'response_type':_0x2eea('0x25'),'rest_data':JSON[_0x2eea('0x37')]({'session':_0x2eb5e6['id'],'module_name':_0x2eea('0x1c'),'query':util[_0x2eea('0x38')](_0x2eea('0x39'),_0x56b4b4),'order_by':'','offset':'0','select_fields':['id','name',_0x2eea('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2eea('0x2e')](function(_0x4ca891){if(_0x4ca891[_0x2eea('0x2f')][_0x2eea('0x1f')]){var _0x17f379=_[_0x2eea('0x3b')](_0x4ca891[_0x2eea('0x2f')],function(_0x110e69){return _0x110e69['name_value_list'][_0x2eea('0x3a')][_0x2eea('0x31')]===_0x56b4b4;});if(_0x17f379){logger[_0x2eea('0xf')]('Enduser\x20found!');return BPromise[_0x2eea('0x33')]({'id':_0x17f379[_0x2eea('0x30')]['id']['value'],'name':_0x17f379[_0x2eea('0x30')]['name'][_0x2eea('0x31')],'phone':_0x17f379[_0x2eea('0x30')][_0x2eea('0x3a')][_0x2eea('0x31')]});}}else{logger['info'](_0x2eea('0x3c'));return request({'form':{'method':'set_entry','input_type':_0x2eea('0x25'),'response_type':_0x2eea('0x25'),'rest_data':JSON[_0x2eea('0x37')]({'session':_0x2eb5e6['id'],'module_name':_0x2eea('0x1c'),'name_value_list':[{'name':_0x2eea('0x3d'),'value':_0x2ee04e!==''?_0x2ee04e:util['format']('Caller\x20-\x20%s',_0x56b4b4)},{'name':_0x2eea('0x3a'),'value':_0x56b4b4}]})}})[_0x2eea('0x2e')](function(_0x18eba0){logger[_0x2eea('0xf')](_0x2eea('0x3e'));return BPromise[_0x2eea('0x33')]({'id':_0x18eba0['id'],'name':_0x18eba0[_0x2eea('0x2f')]['first_name'][_0x2eea('0x31')],'phone':_0x18eba0[_0x2eea('0x2f')][_0x2eea('0x3a')][_0x2eea('0x31')]});});}});}function request(_0x190edc){logger[_0x2eea('0x3f')](_0x2eea('0x40'),JSON[_0x2eea('0x37')](_0x190edc));return rp(_[_0x2eea('0x41')](def,_0x190edc));}function getTags(_0x3ebdc0,_0x3c3712){var _0x171693=[];if(_0x3ebdc0&&_0x3ebdc0[_0x2eea('0x1f')]>0x0){_0x171693=_[_0x2eea('0x42')](_0x3ebdc0,_0x3c3712);}return _0x171693;}function getCustomFields(_0xb3dd68,_0x1c71d8){var _0x406525=[];var _0x2f9c33={'custom_fields':[]};if(_0xb3dd68['length']>0x0){_[_0x2eea('0x20')](_0xb3dd68,function(_0x1c0a9d){if(_0x1c0a9d[_0x2eea('0x43')]==='string'&&_0x1c0a9d[_0x2eea('0x44')]&&!_0x1c0a9d[_0x2eea('0x45')]){_0x2f9c33[_0x1c0a9d[_0x2eea('0x44')][_0x2eea('0x46')]()]=_0x1c0a9d['content'][_0x2eea('0x47')]();}else if(_0x1c0a9d[_0x2eea('0x43')]===_0x2eea('0x48')&&_0x1c0a9d[_0x2eea('0x23')]&&_0x1c0a9d[_0x2eea('0x45')]){_0x2f9c33[_0x2eea('0x49')][_0x2eea('0x22')]({'id':_0x1c0a9d['idField'],'value':_0x1c0a9d[_0x2eea('0x4a')][_0x2eea('0x47')]()});}else if(_0x1c0a9d['type']===_0x2eea('0x4b')&&_0x1c0a9d['variableName']&&_0x1c0a9d['idField']&&_0x1c0a9d[_0x2eea('0x45')]){_0x1c71d8[_0x1c0a9d['variableName']]&&_0x2f9c33[_0x2eea('0x49')][_0x2eea('0x22')]({'id':_0x1c0a9d[_0x2eea('0x23')],'value':_0x1c71d8[_0x1c0a9d['variableName']][_0x2eea('0x47')]()});}else if(_0x1c0a9d[_0x2eea('0x43')]===_0x2eea('0x4c')&&_0x1c0a9d['Variable']&&_0x1c0a9d[_0x2eea('0x4d')]['name']&&_0x1c0a9d[_0x2eea('0x23')]&&_0x1c0a9d[_0x2eea('0x45')]){_0x1c71d8[_0x1c0a9d[_0x2eea('0x4d')]['name']['toLowerCase']()]&&_0x2f9c33['custom_fields'][_0x2eea('0x22')]({'id':_0x1c0a9d[_0x2eea('0x23')],'value':_0x1c71d8[_0x1c0a9d[_0x2eea('0x4d')][_0x2eea('0x11')]['toLowerCase']()][_0x2eea('0x47')]()});}});}return _0x2f9c33;}function getConnection(_0x3de904){return request({'method':'POST','form':{'method':_0x2eea('0x4e'),'input_type':'JSON','response_type':_0x2eea('0x25'),'rest_data':JSON[_0x2eea('0x37')]({'user_auth':{'user_name':_0x3de904[_0x2eea('0x4f')],'password':_0x3de904[_0x2eea('0x50')],'encryption':_0x2eea('0x51')},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x14175f){var _0xefd3=_0x14175f;if(_0xefd3['id']){def['sessionID']=_0xefd3['id'];return BPromise[_0x2eea('0x33')](_0xefd3);}else{throw new Error(util['format'](_0x2eea('0x52'),_0x3de904['id']));}});}function setRelationship(_0x187d4f,_0x521b77,_0x5b0966,_0x267400){return request({'form':{'method':_0x2eea('0x53'),'input_type':_0x2eea('0x25'),'response_type':_0x2eea('0x25'),'rest_data':JSON['stringify']({'session':_0x187d4f['id'],'module_name':'Calls','module_id':_0x5b0966['id'],'link_field_name':_0x267400,'related_ids':[_0x521b77['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x2eea('0x54')]=function(_0x88bed3,_0x3fbb05,_0x10b9ca,_0x2174dc,_0x388719,_0x4aca5e){var _0x189520,_0x1da231,_0xab9161,_0x2d4b76;_0x4aca5e[_0x2eea('0x55')]=intUtil[_0x2eea('0x56')](_0x4aca5e['remoteUri']);_0x4aca5e['serverUrl']=intUtil[_0x2eea('0x56')](_0x4aca5e[_0x2eea('0x57')]);def['uri']=util[_0x2eea('0x38')](_0x2eea('0x58'),_0x4aca5e[_0x2eea('0x55')]);if(_0x388719&&_0x388719[_0x2eea('0x59')]){logger[_0x2eea('0xf')](_0x2eea('0x5a'),_0x2eea('0x5b'));_0x3fbb05[_0x2eea('0x5c')]=util['format'](_0x2eea('0x5d'),_0x4aca5e[_0x2eea('0x57')],_0x3fbb05['uniqueid'],md5(_0x3fbb05[_0x2eea('0x5e')]));}else{_0x3fbb05[_0x2eea('0x5c')]='';}return getConnection(_0x4aca5e)[_0x2eea('0x2e')](function(_0xf739ad){_0x2d4b76=_0xf739ad;return getUser(_0x4aca5e,_0x2174dc['name'],_0x2d4b76);})[_0x2eea('0x2e')](function(_0x2af96e){_0x189520=_0x2af96e;logger[_0x2eea('0xf')]('The\x20User\x20ID\x20is:',_0x189520['id']);return getEndUser(_0x4aca5e,_0x3fbb05[_0x2eea('0x5f')],_0x3fbb05[_0x2eea('0x60')],_0x2d4b76);})[_0x2eea('0x2e')](function(_0x4e1f6f){_0x1da231=_0x4e1f6f;logger[_0x2eea('0xf')](_0x2eea('0x61'),_0x1da231['id']);return getTicket(_0x4aca5e,_0x189520,_0x1da231,_0x10b9ca,_0x3fbb05,_0x10b9ca[_0x2eea('0x62')],_0x2d4b76,'Inbound');})[_0x2eea('0x2e')](function(_0x572dd4){_0xab9161=_0x572dd4;logger[_0x2eea('0xf')](_0x2eea('0x63'));logger[_0x2eea('0xf')]('The\x20Ticket\x20ID\x20is:',_0xab9161['id']);return setRelationship(_0x2d4b76,_0x189520,_0xab9161,_0x2eea('0x64'));})[_0x2eea('0x2e')](function(){return setRelationship(_0x2d4b76,_0x1da231,_0xab9161,_0x2eea('0x65'));})[_0x2eea('0x2e')](function(){return getServerInfo(_0x2d4b76);})['then'](function(_0x1707fe){var _0x7433b8=parseInt(_0x1707fe['version'][_0x2eea('0x66')](0x0));var _0x140bda=util[_0x2eea('0x38')](_0x2eea('0x67'),_0x4aca5e[_0x2eea('0x55')],_0xab9161['id']);if(_0x7433b8>0x6){_0x140bda=util[_0x2eea('0x38')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4aca5e[_0x2eea('0x55')],_0xab9161['id']);}logger[_0x2eea('0xf')]('[QUEUE]',_0x2eea('0x68'));emit(util[_0x2eea('0x38')](_0x2eea('0x69'),_0x2174dc['name']),_0x2eea('0x6a'),{'uri':_0x140bda});})['catch'](function(_0x3ac1df){logger['error'](_0x2eea('0x5a'),JSON[_0x2eea('0x37')](_0x3ac1df));});};exports[_0x2eea('0x6b')]=function(_0x418b96,_0x461a40,_0x576da0,_0x461e1f,_0x8ca2ff,_0x5d5eea,_0x4870f0){var _0x352f7a,_0x42f09a,_0x184378,_0x13fd2f;_0x5d5eea[_0x2eea('0x55')]=intUtil[_0x2eea('0x56')](_0x5d5eea['remoteUri']);_0x5d5eea[_0x2eea('0x57')]=intUtil[_0x2eea('0x56')](_0x5d5eea[_0x2eea('0x57')]);def['uri']=util[_0x2eea('0x38')](_0x2eea('0x58'),_0x5d5eea[_0x2eea('0x55')]);if(_0x4870f0&&_0x4870f0[_0x2eea('0x6c')]&&_0x4870f0['recordingFormat']!==_0x2eea('0x6d')){logger[_0x2eea('0xf')]('[OUTBOUND]',_0x2eea('0x5b'));_0x461a40['recordingURL']=util[_0x2eea('0x38')](_0x2eea('0x5d'),_0x5d5eea[_0x2eea('0x57')],_0x461a40[_0x2eea('0x5e')],md5(_0x461a40[_0x2eea('0x5e')]));}return getConnection(_0x5d5eea)[_0x2eea('0x2e')](function(_0x4871b9){_0x13fd2f=_0x4871b9;return getUser(_0x5d5eea,_0x461e1f[_0x2eea('0x11')],_0x13fd2f);})['then'](function(_0x182b96){_0x352f7a=_0x182b96;logger[_0x2eea('0xf')](_0x2eea('0x6e'),_0x352f7a['id']);return getEndUser(_0x5d5eea,_0x461a40['destcalleridname'],_0x461a40['destcalleridnum'],_0x13fd2f);})['then'](function(_0x17cf17){_0x42f09a=_0x17cf17;logger['info'](_0x2eea('0x61'),_0x42f09a['id']);return getTicket(_0x5d5eea,_0x352f7a,_0x42f09a,_0x576da0,_0x461a40,_0x576da0[_0x2eea('0x62')],_0x13fd2f,_0x2eea('0x6f'));})[_0x2eea('0x2e')](function(_0x51acde){_0x184378=_0x51acde;logger['info'](_0x2eea('0x63'));logger[_0x2eea('0xf')](_0x2eea('0x70'),_0x184378['id']);return setRelationship(_0x13fd2f,_0x352f7a,_0x184378,_0x2eea('0x64'));})['then'](function(){return setRelationship(_0x13fd2f,_0x42f09a,_0x184378,_0x2eea('0x65'));})[_0x2eea('0x2e')](function(){return getServerInfo(_0x13fd2f);})[_0x2eea('0x2e')](function(_0x9d9927){var _0x309837=parseInt(_0x9d9927[_0x2eea('0x71')]['charAt'](0x0));var _0x50334b=util[_0x2eea('0x38')](_0x2eea('0x67'),_0x5d5eea[_0x2eea('0x55')],_0x184378['id']);if(_0x309837>0x6){_0x50334b=util[_0x2eea('0x38')](_0x2eea('0x72'),_0x5d5eea[_0x2eea('0x55')],_0x184378['id']);}logger[_0x2eea('0xf')](_0x2eea('0x73'),_0x2eea('0x68'));emit(util[_0x2eea('0x38')]('user:%s',_0x461e1f[_0x2eea('0x11')]),_0x2eea('0x6a'),{'uri':_0x50334b});})[_0x2eea('0x74')](function(_0x1ac7d0){logger['error'](_0x2eea('0x73'),JSON[_0x2eea('0x37')](_0x1ac7d0));});};exports[_0x2eea('0x75')]=function(_0x5e1371,_0x74ab7b,_0x359d33,_0x1ccb4b,_0x1fb75f,_0x4afb95){var _0x31e43c,_0x3fb9b8,_0x45c396,_0x2e9218;_0x4afb95[_0x2eea('0x55')]=intUtil['stripTrailingSlash'](_0x4afb95[_0x2eea('0x55')]);_0x4afb95[_0x2eea('0x57')]=intUtil['stripTrailingSlash'](_0x4afb95['serverUrl']);def[_0x2eea('0x76')]=util[_0x2eea('0x38')](_0x2eea('0x58'),_0x4afb95[_0x2eea('0x55')]);if(_0x1fb75f&&_0x1fb75f['monitor_format']){logger[_0x2eea('0xf')]('['+_0x74ab7b['lastevent'][_0x2eea('0x77')]()+']','Recording\x20is\x20enabled!');_0x74ab7b[_0x2eea('0x5c')]=util[_0x2eea('0x38')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4afb95[_0x2eea('0x57')],_0x74ab7b[_0x2eea('0x5e')],md5(_0x74ab7b['uniqueid']));}else{_0x74ab7b['recordingURL']='';}return getConnection(_0x4afb95)[_0x2eea('0x2e')](function(_0x3da58c){_0x2e9218=_0x3da58c;if(!_[_0x2eea('0x29')](_0x1ccb4b)){return getUser(_0x4afb95,_0x1ccb4b['name'],_0x2e9218);}else{return getUser(_0x4afb95,null,_0x2e9218);}})[_0x2eea('0x2e')](function(_0x139f0d){_0x31e43c=_0x139f0d;logger[_0x2eea('0xf')](_0x2eea('0x6e'),_0x31e43c['id']);return getEndUser(_0x4afb95,_0x74ab7b[_0x2eea('0x5f')],_0x74ab7b['calleridnum'],_0x2e9218);})['then'](function(_0x427112){_0x3fb9b8=_0x427112;logger[_0x2eea('0xf')]('The\x20Enduser\x20ID\x20is:',_0x3fb9b8['id']);return getTicket(_0x4afb95,_0x31e43c,_0x3fb9b8,_0x359d33,_0x74ab7b,_0x359d33[_0x2eea('0x62')],_0x2e9218,_0x2eea('0x78'));})[_0x2eea('0x2e')](function(_0x4164ce){_0x45c396=_0x4164ce;logger['info'](_0x2eea('0x63'));logger[_0x2eea('0xf')](_0x2eea('0x70'),_0x45c396['id']);return setRelationship(_0x2e9218,_0x31e43c,_0x45c396,_0x2eea('0x64'));})[_0x2eea('0x2e')](function(){return setRelationship(_0x2e9218,_0x3fb9b8,_0x45c396,_0x2eea('0x65'));})[_0x2eea('0x2e')](function(){return getServerInfo(_0x2e9218);})[_0x2eea('0x74')](function(_0x2b890b){logger[_0x2eea('0x79')]('['+_0x74ab7b[_0x2eea('0x7a')][_0x2eea('0x77')]()+']',JSON[_0x2eea('0x37')](_0x2b890b));});}; \ 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 f249634..21cdebd 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 _0x1215=['name','keyValue','keyType','key','format','%s:\x20%s','customVariable','toLowerCase','join','stripTrailingSlash','substring','validateEmail','lodash','getString','sortBy','length','string','content','type','variable','variableName','push','toString','Variable'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x1215,0x84));var _0x5121=function(_0x23832b,_0x6a777){_0x23832b=_0x23832b-0x0;var _0x583750=_0x1215[_0x23832b];return _0x583750;};'use strict';var _=require(_0x5121('0x0'));var util=require('util');exports[_0x5121('0x1')]=function(_0x3bbe50,_0x10d85a,_0x3a5e05){var _0x4b9be2=[];if(_0x3bbe50['length']>0x0){var _0x1e4069=_[_0x5121('0x2')](_0x3bbe50,['id']);for(var _0x512028=0x0;_0x512028<_0x1e4069[_0x5121('0x3')];_0x512028++){var _0x15b11c=_0x1e4069[_0x512028];if(_0x15b11c['type']===_0x5121('0x4')){_0x4b9be2['push'](_0x15b11c[_0x5121('0x5')]);}else if(_0x15b11c[_0x5121('0x6')]===_0x5121('0x7')&&_0x15b11c[_0x5121('0x8')]){_0x10d85a[_0x15b11c[_0x5121('0x8')]]&&_0x4b9be2[_0x5121('0x9')](_0x10d85a[_0x15b11c[_0x5121('0x8')]][_0x5121('0xa')]());}else if(_0x15b11c[_0x5121('0x6')]==='customVariable'&&_0x15b11c[_0x5121('0xb')]&&_0x15b11c['Variable'][_0x5121('0xc')]){_0x10d85a[_0x15b11c['Variable']['name']['toLowerCase']()]&&_0x4b9be2[_0x5121('0x9')](_0x10d85a[_0x15b11c[_0x5121('0xb')][_0x5121('0xc')]['toLowerCase']()][_0x5121('0xa')]());}else if(_0x15b11c['type']===_0x5121('0xd')){if(_0x15b11c[_0x5121('0xe')]==='string'&&_0x15b11c[_0x5121('0xf')]){_0x4b9be2['push'](util[_0x5121('0x10')](_0x5121('0x11'),_0x15b11c['key'],_0x15b11c['keyContent']));}else if(_0x15b11c[_0x5121('0xe')]==='variable'&&_0x15b11c[_0x5121('0x8')]&&_0x15b11c[_0x5121('0xf')]){_0x10d85a[_0x15b11c[_0x5121('0x8')]]&&_0x4b9be2[_0x5121('0x9')](util[_0x5121('0x10')]('%s:\x20%s',_0x15b11c[_0x5121('0xf')],_0x10d85a[_0x15b11c[_0x5121('0x8')]]));}else if(_0x15b11c[_0x5121('0xe')]===_0x5121('0x12')&&_0x15b11c[_0x5121('0xb')]&&_0x15b11c[_0x5121('0xb')][_0x5121('0xc')]&&_0x15b11c['key']){_0x10d85a[_0x15b11c[_0x5121('0xb')][_0x5121('0xc')][_0x5121('0x13')]()]&&_0x4b9be2[_0x5121('0x9')](util[_0x5121('0x10')](_0x5121('0x11'),_0x15b11c[_0x5121('0xf')],_0x10d85a[_0x15b11c[_0x5121('0xb')]['name']['toLowerCase']()]));}}}}return _0x4b9be2[_0x5121('0x14')](_0x3a5e05);};exports[_0x5121('0x15')]=function(_0x1ab4b6){var _0x3a05d0=_0x1ab4b6['slice'](-0x1);if(_0x3a05d0==='/'){_0x1ab4b6=_0x1ab4b6[_0x5121('0x16')](0x0,_0x1ab4b6['lastIndexOf'](_0x3a05d0));}return _0x1ab4b6;};exports[_0x5121('0x17')]=function(_0xae6c60){if(!_['isNil'](_0xae6c60)&&_0xae6c60!==''){var _0x4d4864=/^(([^<>()\[\]\\.,;:\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 _0x4d4864['test'](String(_0xae6c60)[_0x5121('0x13')]());}else{return![];}}; \ No newline at end of file +var _0x8db5=['key','%s:\x20%s','variable','format','toLowerCase','join','slice','validateEmail','lodash','getString','length','sortBy','type','string','push','content','variableName','customVariable','Variable','name','toString','keyValue','keyType'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x8db5,0x1d4));var _0x58db=function(_0x581714,_0x19b53c){_0x581714=_0x581714-0x0;var _0x3b9dad=_0x8db5[_0x581714];return _0x3b9dad;};'use strict';var _=require(_0x58db('0x0'));var util=require('util');exports[_0x58db('0x1')]=function(_0x52942d,_0x34f1d9,_0x22b217){var _0xedcd83=[];if(_0x52942d[_0x58db('0x2')]>0x0){var _0x32b0c4=_[_0x58db('0x3')](_0x52942d,['id']);for(var _0xb394e9=0x0;_0xb394e9<_0x32b0c4['length'];_0xb394e9++){var _0x3c52b8=_0x32b0c4[_0xb394e9];if(_0x3c52b8[_0x58db('0x4')]===_0x58db('0x5')){_0xedcd83[_0x58db('0x6')](_0x3c52b8[_0x58db('0x7')]);}else if(_0x3c52b8[_0x58db('0x4')]==='variable'&&_0x3c52b8[_0x58db('0x8')]){_0x34f1d9[_0x3c52b8[_0x58db('0x8')]]&&_0xedcd83[_0x58db('0x6')](_0x34f1d9[_0x3c52b8[_0x58db('0x8')]]['toString']());}else if(_0x3c52b8[_0x58db('0x4')]===_0x58db('0x9')&&_0x3c52b8[_0x58db('0xa')]&&_0x3c52b8[_0x58db('0xa')][_0x58db('0xb')]){_0x34f1d9[_0x3c52b8[_0x58db('0xa')][_0x58db('0xb')]['toLowerCase']()]&&_0xedcd83['push'](_0x34f1d9[_0x3c52b8[_0x58db('0xa')]['name']['toLowerCase']()][_0x58db('0xc')]());}else if(_0x3c52b8[_0x58db('0x4')]===_0x58db('0xd')){if(_0x3c52b8[_0x58db('0xe')]===_0x58db('0x5')&&_0x3c52b8[_0x58db('0xf')]){_0xedcd83[_0x58db('0x6')](util['format'](_0x58db('0x10'),_0x3c52b8['key'],_0x3c52b8['keyContent']));}else if(_0x3c52b8[_0x58db('0xe')]===_0x58db('0x11')&&_0x3c52b8[_0x58db('0x8')]&&_0x3c52b8[_0x58db('0xf')]){_0x34f1d9[_0x3c52b8[_0x58db('0x8')]]&&_0xedcd83[_0x58db('0x6')](util[_0x58db('0x12')](_0x58db('0x10'),_0x3c52b8[_0x58db('0xf')],_0x34f1d9[_0x3c52b8[_0x58db('0x8')]]));}else if(_0x3c52b8[_0x58db('0xe')]==='customVariable'&&_0x3c52b8['Variable']&&_0x3c52b8[_0x58db('0xa')][_0x58db('0xb')]&&_0x3c52b8['key']){_0x34f1d9[_0x3c52b8[_0x58db('0xa')]['name'][_0x58db('0x13')]()]&&_0xedcd83[_0x58db('0x6')](util['format'](_0x58db('0x10'),_0x3c52b8['key'],_0x34f1d9[_0x3c52b8[_0x58db('0xa')]['name'][_0x58db('0x13')]()]));}}}}return _0xedcd83[_0x58db('0x14')](_0x22b217);};exports['stripTrailingSlash']=function(_0x4f4413){var _0x733be9=_0x4f4413[_0x58db('0x15')](-0x1);if(_0x733be9==='/'){_0x4f4413=_0x4f4413['substring'](0x0,_0x4f4413['lastIndexOf'](_0x733be9));}return _0x4f4413;};exports[_0x58db('0x16')]=function(_0x22c84a){if(!_['isNil'](_0x22c84a)&&_0x22c84a!==''){var _0x2215cd=/^(([^<>()\[\]\\.,;:\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 _0x2215cd['test'](String(_0x22c84a)[_0x58db('0x13')]());}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 be71ac0..8d7a0a7 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(_0x29e7eb,_0x31eafb){var _0x3815f1=function(_0x1b39a1){while(--_0x1b39a1){_0x29e7eb['push'](_0x29e7eb['shift']());}};_0x3815f1(++_0x31eafb);}(_0xe706,0xa3));var _0x6e70=function(_0x312abc,_0x17f25c){_0x312abc=_0x312abc-0x0;var _0x314298=_0xe706[_0x312abc];return _0x314298;};'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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x1b6460,_0x77964d){var _0x2e396c=function(_0x13ae17){while(--_0x13ae17){_0x1b6460['push'](_0x1b6460['shift']());}};_0x2e396c(++_0x77964d);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 0e7be1f..b298987 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 _0x847c=['Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','POST','merge','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','remoteUri','format','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','authType','%s:%s','username','Basic\x20%s','toString','base64','debug','GET','map','picklist','type','nameField','customField','toLowerCase','includes','idField','custom_fields','push','content','variable','variableName','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x5a628a,_0x4195b6){var _0x4edab4=function(_0x51fc15){while(--_0x51fc15){_0x5a628a['push'](_0x5a628a['shift']());}};_0x4edab4(++_0x4195b6);}(_0x847c,0xef));var _0xc847=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x847c[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var rp=require(_0xc847('0x0'));var md5=require('md5');var util=require(_0xc847('0x1'));var Redis=require(_0xc847('0x2'));var intUtil=require(_0xc847('0x3'));var config=require(_0xc847('0x4'));var logger=require('../../../../config/logger')('zendesk');config[_0xc847('0x5')]=_[_0xc847('0x6')](config[_0xc847('0x5')],{'host':_0xc847('0x7'),'port':0x18eb});var io=require(_0xc847('0x8'))(new Redis(config[_0xc847('0x5')]));function emit(_0x13d703,_0x53387e,_0x2fc2e6){io['to'](_0x13d703)[_0xc847('0x9')](_0x53387e,_0x2fc2e6);}var headers={'Content-Type':'application/json','Accept':_0xc847('0xa')};function getTicket(_0xebf9bf,_0x18631e,_0x3816fa,_0x213c3c,_0x2ce754){logger[_0xc847('0xb')](_0xc847('0xc'));return request({'uri':util['format']('%s/tickets.json',_0xebf9bf['remoteUri']),'method':_0xc847('0xd'),'body':{'ticket':_[_0xc847('0xe')]({'requester_id':_0x3816fa['id'],'submitter_id':_0x18631e?_0x18631e['id']:undefined,'assignee_id':_0x18631e?_0x18631e['id']:undefined,'tags':getTags(_0x213c3c['Tags'],_0xc847('0xf')),'subject':intUtil[_0xc847('0x10')](_0x213c3c[_0xc847('0x11')],_0x2ce754,'\x20'),'description':intUtil['getString'](_0x213c3c[_0xc847('0x12')],_0x2ce754,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc847('0x10')](_0x213c3c[_0xc847('0x12')],_0x2ce754,'\x0a')}},getCustomFields(_0x213c3c[_0xc847('0x13')],_0x2ce754))}})[_0xc847('0x14')](function(_0x10373a){logger[_0xc847('0xb')](_0xc847('0x15'));return _0x10373a[_0xc847('0x16')];});}function getUser(_0x3ee23a,_0x357360){if(intUtil[_0xc847('0x17')](_0x357360)){logger[_0xc847('0xb')](_0xc847('0x18'),_0x357360);return request({'uri':util['format']('%s/search.json',_0x3ee23a[_0xc847('0x19')]),'qs':{'query':util[_0xc847('0x1a')]('type:user\x20role:agent\x20email:%s',_0x357360)}})[_0xc847('0x14')](function(_0x25d961){if(_0x25d961[_0xc847('0x1b')]){logger[_0xc847('0xb')](_0xc847('0x1c'));return _[_0xc847('0x1d')](_0x25d961[_0xc847('0x1e')],{'email':_0x357360,'role':_0xc847('0x1f')});}else{logger['info'](_0xc847('0x20'));return request({'uri':util[_0xc847('0x1a')]('%s/users/me.json',_0x3ee23a[_0xc847('0x19')])})[_0xc847('0x14')](function(_0x11e206){logger[_0xc847('0xb')](_0xc847('0x21'));return _0x11e206[_0xc847('0x22')];});}});}else{logger[_0xc847('0xb')](_0xc847('0x20'));return request({'uri':util[_0xc847('0x1a')](_0xc847('0x23'),_0x3ee23a['remoteUri'])})[_0xc847('0x14')](function(_0x24fa06){logger[_0xc847('0xb')](_0xc847('0x21'));return _0x24fa06[_0xc847('0x22')];});}}function getEndUser(_0x31b054,_0x2efa0b,_0x50e040){logger[_0xc847('0xb')](_0xc847('0x24'),_0x50e040);return request({'uri':util[_0xc847('0x1a')]('%s/search.json',_0x31b054[_0xc847('0x19')]),'qs':{'query':util[_0xc847('0x1a')](_0xc847('0x25'),_0x50e040)}})[_0xc847('0x14')](function(_0x30576c){var _0x29a35e;if(_0x30576c[_0xc847('0x1e')][_0xc847('0x26')]){_0x30576c['results']=_['filter'](_0x30576c[_0xc847('0x1e')],{'suspended':![],'role':_0xc847('0x27')});if(_0x30576c['results']['length']){_0x29a35e=_[_0xc847('0x28')](_0x30576c[_0xc847('0x1e')]);}}if(_0x29a35e){logger[_0xc847('0xb')](_0xc847('0x29'));return _0x29a35e;}else{logger[_0xc847('0xb')](_0xc847('0x2a'));return request({'uri':util[_0xc847('0x1a')]('%s/users.json',_0x31b054[_0xc847('0x19')]),'method':_0xc847('0xd'),'body':{'user':{'role':_0xc847('0x27'),'name':util['format']('Caller\x20-\x20%s',_0x2efa0b||_0x50e040),'phone':_0x50e040}}})[_0xc847('0x14')](function(_0x5270eb){logger[_0xc847('0xb')](_0xc847('0x2b'));return _0x5270eb[_0xc847('0x22')];});}});}function getAuth(_0x5f1816){var _0x16076f;if(_0x5f1816[_0xc847('0x2c')]==='password'){_0x16076f=util[_0xc847('0x1a')](_0xc847('0x2d'),_0x5f1816['username'],_0x5f1816['password']);}else if(_0x5f1816['authType']==='token'){_0x16076f=util[_0xc847('0x1a')]('%s/token:%s',_0x5f1816[_0xc847('0x2e')],_0x5f1816['token']);}return util['format'](_0xc847('0x2f'),new Buffer(_0x16076f)[_0xc847('0x30')](_0xc847('0x31')));}function request(_0x3a273b){logger[_0xc847('0x32')]('[HTTP]',JSON['stringify'](_0x3a273b));return rp(_['defaults'](_0x3a273b,{'method':_0xc847('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x2f935d,_0x339952){var _0x2720ad=[];if(_0x2f935d&&_0x2f935d[_0xc847('0x26')]>0x0){_0x2720ad=_[_0xc847('0x34')](_0x2f935d,_0x339952);}return _0x2720ad;}function getCustomFields(_0x2967fb,_0xaa89e2){var _0x38bb81=[];var _0x5d17b2={'custom_fields':[]};if(_0x2967fb[_0xc847('0x26')]>0x0){_['forEach'](_0x2967fb,function(_0x582eae){if(_['includes'](['string',_0xc847('0x35')],_0x582eae[_0xc847('0x36')])&&_0x582eae[_0xc847('0x37')]&&!_0x582eae[_0xc847('0x38')]){_0x5d17b2[_0x582eae[_0xc847('0x37')][_0xc847('0x39')]()]=_0x582eae['content'][_0xc847('0x30')]();}else if(_[_0xc847('0x3a')](['string',_0xc847('0x35')],_0x582eae[_0xc847('0x36')])&&_0x582eae[_0xc847('0x3b')]&&_0x582eae['customField']){_0x5d17b2[_0xc847('0x3c')][_0xc847('0x3d')]({'id':_0x582eae[_0xc847('0x3b')],'value':_0x582eae[_0xc847('0x3e')][_0xc847('0x30')]()});}else if(_0x582eae[_0xc847('0x36')]===_0xc847('0x3f')&&_0x582eae[_0xc847('0x40')]&&_0x582eae[_0xc847('0x3b')]&&_0x582eae[_0xc847('0x38')]){_0xaa89e2[_0x582eae['variableName']]&&_0x5d17b2['custom_fields'][_0xc847('0x3d')]({'id':_0x582eae[_0xc847('0x3b')],'value':_0xaa89e2[_0x582eae[_0xc847('0x40')]][_0xc847('0x30')]()});}else if(_0x582eae[_0xc847('0x36')]==='customVariable'&&_0x582eae['Variable']&&_0x582eae[_0xc847('0x41')][_0xc847('0xf')]&&_0x582eae[_0xc847('0x3b')]&&_0x582eae[_0xc847('0x38')]){_0xaa89e2[_0x582eae[_0xc847('0x41')][_0xc847('0xf')][_0xc847('0x39')]()]&&_0x5d17b2[_0xc847('0x3c')][_0xc847('0x3d')]({'id':_0x582eae[_0xc847('0x3b')],'value':_0xaa89e2[_0x582eae[_0xc847('0x41')][_0xc847('0xf')][_0xc847('0x39')]()][_0xc847('0x30')]()});}});}return _0x5d17b2;}exports['queue']=function(_0x1ac010,_0x337ca6,_0x2cb439,_0x3b44b2,_0x30a898,_0x3b87cb){var _0x5dd5e8,_0xea9970;_0x3b87cb[_0xc847('0x19')]=intUtil[_0xc847('0x42')](_0x3b87cb[_0xc847('0x19')]);_0x3b87cb[_0xc847('0x43')]=intUtil[_0xc847('0x42')](_0x3b87cb[_0xc847('0x43')]);if(_0x30a898&&_0x30a898['monitor_format']){logger[_0xc847('0xb')](_0xc847('0x44'),_0xc847('0x45'));_0x337ca6[_0xc847('0x46')]=util[_0xc847('0x1a')](_0xc847('0x47'),_0x3b87cb[_0xc847('0x43')],_0x337ca6['uniqueid'],md5(_0x337ca6[_0xc847('0x48')]));}else{_0x337ca6[_0xc847('0x46')]='';}headers[_0xc847('0x49')]=getAuth(_0x3b87cb);return getUser(_0x3b87cb,_0x3b44b2[_0xc847('0x4a')])['then'](function(_0x4e7c27){_0x5dd5e8=_0x4e7c27;logger[_0xc847('0xb')](_0xc847('0x4b'),_0x5dd5e8['id']);return getEndUser(_0x3b87cb,_0x337ca6[_0xc847('0x4c')],_0x337ca6[_0xc847('0x4d')]);})[_0xc847('0x14')](function(_0x6e695e){_0xea9970=_0x6e695e;logger[_0xc847('0xb')]('The\x20Enduser\x20ID\x20is:',_0xea9970['id']);return getTicket(_0x3b87cb,_0x5dd5e8,_0xea9970,_0x2cb439,_0x337ca6);})[_0xc847('0x14')](function(_0xd5a741){if(_0xd5a741){logger[_0xc847('0xb')]('The\x20Ticket\x20ID\x20is:',_0xd5a741['id']);switch(_0x3b87cb[_0xc847('0x36')]){case _0xc847('0x4e'):logger[_0xc847('0xb')](_0xc847('0x44'),_0xc847('0x4f'));return request({'uri':util['format'](_0xc847('0x50'),_0x3b87cb[_0xc847('0x19')],_0x5dd5e8['id'],_0xd5a741['id']),'method':_0xc847('0xd')});case _0xc847('0x51'):logger[_0xc847('0xb')](_0xc847('0x44'),_0xc847('0x52'));emit(util[_0xc847('0x1a')]('user:%s',_0x3b44b2['name']),_0xc847('0x53'),{'uri':util[_0xc847('0x1a')](_0xc847('0x54'),_0x3b87cb['remoteUri'][_0xc847('0x55')](_0xc847('0x56'),''),_0xd5a741['id'])});break;default:logger['error'](_0xc847('0x44'),_0xc847('0x57'));}}})[_0xc847('0x58')](function(_0x8d3cc2){logger[_0xc847('0x59')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x8d3cc2,{'showHidden':!![],'depth':null}));});};exports[_0xc847('0x5a')]=function(_0x129203,_0x36f7ae,_0x10b260,_0x389524,_0x8086fa,_0x44847d,_0x5f0d73){var _0x395f1d,_0x426472;_0x44847d[_0xc847('0x19')]=intUtil[_0xc847('0x42')](_0x44847d[_0xc847('0x19')]);_0x44847d['serverUrl']=intUtil[_0xc847('0x42')](_0x44847d[_0xc847('0x43')]);if(_0x5f0d73&&_0x5f0d73[_0xc847('0x5b')]&&_0x5f0d73[_0xc847('0x5b')]!==_0xc847('0x5c')){logger[_0xc847('0xb')](_0xc847('0x5d'),_0xc847('0x45'));_0x36f7ae[_0xc847('0x46')]=util[_0xc847('0x1a')](_0xc847('0x47'),_0x44847d[_0xc847('0x43')],_0x36f7ae[_0xc847('0x48')],md5(_0x36f7ae[_0xc847('0x48')]));}headers[_0xc847('0x49')]=getAuth(_0x44847d);return getUser(_0x44847d,_0x389524[_0xc847('0x4a')])[_0xc847('0x14')](function(_0xd3980){_0x395f1d=_0xd3980;logger[_0xc847('0xb')]('The\x20User\x20ID\x20is:',_0x395f1d['id']);return getEndUser(_0x44847d,_0x36f7ae[_0xc847('0x5e')],_0x36f7ae['destcalleridnum']);})[_0xc847('0x14')](function(_0x2f75fb){_0x426472=_0x2f75fb;logger[_0xc847('0xb')](_0xc847('0x5f'),_0x426472['id']);return getTicket(_0x44847d,_0x395f1d,_0x426472,_0x10b260,_0x36f7ae);})[_0xc847('0x14')](function(_0x4ef0d1){if(_0x4ef0d1){logger[_0xc847('0xb')](_0xc847('0x60'),_0x4ef0d1['id']);switch(_0x44847d[_0xc847('0x36')]){case _0xc847('0x4e'):logger[_0xc847('0xb')](_0xc847('0x5d'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xc847('0x50'),_0x44847d[_0xc847('0x19')],_0x395f1d['id'],_0x4ef0d1['id']),'method':_0xc847('0xd')});case _0xc847('0x51'):logger['info'](_0xc847('0x5d'),_0xc847('0x52'));emit(util['format'](_0xc847('0x61'),_0x389524[_0xc847('0xf')]),_0xc847('0x53'),{'uri':util[_0xc847('0x1a')](_0xc847('0x54'),_0x44847d[_0xc847('0x19')][_0xc847('0x55')]('/api/v2',''),_0x4ef0d1['id'])});break;default:logger[_0xc847('0x59')](_0xc847('0x5d'),_0xc847('0x57'));}}})[_0xc847('0x58')](function(_0x37ab9b){logger[_0xc847('0x59')](_0xc847('0x62'),util[_0xc847('0x63')](_0x37ab9b,{'showHidden':!![],'depth':null}));});};exports[_0xc847('0x64')]=function(_0x366c9d,_0x1af103,_0x53fabf,_0x521163,_0x37ef4b,_0x104394){var _0x2736ba,_0x14fb7e;_0x104394[_0xc847('0x19')]=intUtil[_0xc847('0x42')](_0x104394[_0xc847('0x19')]);_0x104394[_0xc847('0x43')]=intUtil['stripTrailingSlash'](_0x104394['serverUrl']);if(_0x37ef4b&&_0x37ef4b['monitor_format']){logger[_0xc847('0xb')]('['+_0x1af103[_0xc847('0x65')][_0xc847('0x66')]()+']',_0xc847('0x45'));_0x1af103[_0xc847('0x46')]=util['format'](_0xc847('0x47'),_0x104394[_0xc847('0x43')],_0x1af103['uniqueid'],md5(_0x1af103['uniqueid']));}else{_0x1af103[_0xc847('0x46')]='';}headers[_0xc847('0x49')]=getAuth(_0x104394);return getUser(_0x104394)[_0xc847('0x14')](function(_0x3c975f){_0x2736ba=_0x3c975f;logger['info'](_0xc847('0x4b'),_0x2736ba['id']);return getEndUser(_0x104394,_0x1af103[_0xc847('0x4c')],_0x1af103[_0xc847('0x4d')]);})['then'](function(_0x511996){_0x14fb7e=_0x511996;logger[_0xc847('0xb')](_0xc847('0x5f'),_0x14fb7e['id']);return getTicket(_0x104394,_0x2736ba,_0x14fb7e,_0x53fabf,_0x1af103);})[_0xc847('0x14')](function(_0x579bcf){if(_0x579bcf){logger['info'](_0xc847('0x60'),_0x579bcf['id']);}})[_0xc847('0x58')](function(_0x267361){logger[_0xc847('0x59')]('['+_0x1af103[_0xc847('0x65')]['toUpperCase']()+']'+_0xc847('0x67'),util[_0xc847('0x63')](_0x267361,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x81db=['Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','Authorization','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','remoteUri','merge','Tags','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','map','picklist','type','nameField','customField','content','includes','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','toLowerCase','push','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error'];(function(_0x201ed2,_0x1042cc){var _0x138582=function(_0x682b4a){while(--_0x682b4a){_0x201ed2['push'](_0x201ed2['shift']());}};_0x138582(++_0x1042cc);}(_0x81db,0x86));var _0xb81d=function(_0x3857f2,_0x6639dd){_0x3857f2=_0x3857f2-0x0;var _0xa2623a=_0x81db[_0x3857f2];return _0xa2623a;};'use strict';var _=require(_0xb81d('0x0'));var rp=require(_0xb81d('0x1'));var md5=require(_0xb81d('0x2'));var util=require(_0xb81d('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xb81d('0x4'));var logger=require(_0xb81d('0x5'))(_0xb81d('0x6'));config[_0xb81d('0x7')]=_[_0xb81d('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb81d('0x9'))(new Redis(config[_0xb81d('0x7')]));function emit(_0x52cbdc,_0x37cc5b,_0x50a727){io['to'](_0x52cbdc)[_0xb81d('0xa')](_0x37cc5b,_0x50a727);}var headers={'Content-Type':_0xb81d('0xb'),'Accept':_0xb81d('0xb')};function getTicket(_0x7b3895,_0x25af45,_0x5de6df,_0x261275,_0x337d5a){logger[_0xb81d('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xb81d('0xd')](_0xb81d('0xe'),_0x7b3895[_0xb81d('0xf')]),'method':'POST','body':{'ticket':_[_0xb81d('0x10')]({'requester_id':_0x5de6df['id'],'submitter_id':_0x25af45?_0x25af45['id']:undefined,'assignee_id':_0x25af45?_0x25af45['id']:undefined,'tags':getTags(_0x261275[_0xb81d('0x11')],'name'),'subject':intUtil['getString'](_0x261275[_0xb81d('0x12')],_0x337d5a,'\x20'),'description':intUtil[_0xb81d('0x13')](_0x261275[_0xb81d('0x14')],_0x337d5a,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb81d('0x13')](_0x261275['Descriptions'],_0x337d5a,'\x0a')}},getCustomFields(_0x261275[_0xb81d('0x15')],_0x337d5a))}})[_0xb81d('0x16')](function(_0x575ad3){logger['info'](_0xb81d('0x17'));return _0x575ad3[_0xb81d('0x18')];});}function getUser(_0x347e44,_0x3cf430){if(intUtil['validateEmail'](_0x3cf430)){logger['info'](_0xb81d('0x19'),_0x3cf430);return request({'uri':util['format'](_0xb81d('0x1a'),_0x347e44[_0xb81d('0xf')]),'qs':{'query':util[_0xb81d('0xd')](_0xb81d('0x1b'),_0x3cf430)}})['then'](function(_0x3a5e70){if(_0x3a5e70[_0xb81d('0x1c')]){logger[_0xb81d('0xc')](_0xb81d('0x1d'));return _['find'](_0x3a5e70[_0xb81d('0x1e')],{'email':_0x3cf430,'role':_0xb81d('0x1f')});}else{logger['info'](_0xb81d('0x20'));return request({'uri':util[_0xb81d('0xd')](_0xb81d('0x21'),_0x347e44['remoteUri'])})[_0xb81d('0x16')](function(_0x4f40fe){logger[_0xb81d('0xc')](_0xb81d('0x22'));return _0x4f40fe[_0xb81d('0x23')];});}});}else{logger[_0xb81d('0xc')](_0xb81d('0x20'));return request({'uri':util['format'](_0xb81d('0x21'),_0x347e44[_0xb81d('0xf')])})[_0xb81d('0x16')](function(_0x15c7b4){logger[_0xb81d('0xc')](_0xb81d('0x22'));return _0x15c7b4[_0xb81d('0x23')];});}}function getEndUser(_0x47bc97,_0x722996,_0x32c7ee){logger[_0xb81d('0xc')]('Searching\x20enduser\x20with\x20phone',_0x32c7ee);return request({'uri':util[_0xb81d('0xd')](_0xb81d('0x1a'),_0x47bc97[_0xb81d('0xf')]),'qs':{'query':util[_0xb81d('0xd')](_0xb81d('0x24'),_0x32c7ee)}})[_0xb81d('0x16')](function(_0x5b4ed6){var _0x433821;if(_0x5b4ed6[_0xb81d('0x1e')][_0xb81d('0x25')]){_0x5b4ed6[_0xb81d('0x1e')]=_[_0xb81d('0x26')](_0x5b4ed6[_0xb81d('0x1e')],{'suspended':![],'role':_0xb81d('0x27')});if(_0x5b4ed6['results'][_0xb81d('0x25')]){_0x433821=_[_0xb81d('0x28')](_0x5b4ed6['results']);}}if(_0x433821){logger[_0xb81d('0xc')](_0xb81d('0x29'));return _0x433821;}else{logger[_0xb81d('0xc')](_0xb81d('0x2a'));return request({'uri':util['format'](_0xb81d('0x2b'),_0x47bc97['remoteUri']),'method':_0xb81d('0x2c'),'body':{'user':{'role':_0xb81d('0x27'),'name':util[_0xb81d('0xd')](_0xb81d('0x2d'),_0x722996||_0x32c7ee),'phone':_0x32c7ee}}})[_0xb81d('0x16')](function(_0x3229ec){logger[_0xb81d('0xc')](_0xb81d('0x2e'));return _0x3229ec[_0xb81d('0x23')];});}});}function getAuth(_0x2cb813){var _0xb6dc47;if(_0x2cb813[_0xb81d('0x2f')]===_0xb81d('0x30')){_0xb6dc47=util[_0xb81d('0xd')](_0xb81d('0x31'),_0x2cb813[_0xb81d('0x32')],_0x2cb813[_0xb81d('0x30')]);}else if(_0x2cb813['authType']===_0xb81d('0x33')){_0xb6dc47=util[_0xb81d('0xd')](_0xb81d('0x34'),_0x2cb813[_0xb81d('0x32')],_0x2cb813[_0xb81d('0x33')]);}return util['format'](_0xb81d('0x35'),new Buffer(_0xb6dc47)[_0xb81d('0x36')](_0xb81d('0x37')));}function request(_0x53f491){logger[_0xb81d('0x38')](_0xb81d('0x39'),JSON[_0xb81d('0x3a')](_0x53f491));return rp(_[_0xb81d('0x8')](_0x53f491,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5857aa,_0x105c60){var _0x5a272e=[];if(_0x5857aa&&_0x5857aa['length']>0x0){_0x5a272e=_[_0xb81d('0x3b')](_0x5857aa,_0x105c60);}return _0x5a272e;}function getCustomFields(_0x351753,_0xce8241){var _0x3dd000=[];var _0x240467={'custom_fields':[]};if(_0x351753[_0xb81d('0x25')]>0x0){_['forEach'](_0x351753,function(_0xce4b57){if(_['includes'](['string',_0xb81d('0x3c')],_0xce4b57[_0xb81d('0x3d')])&&_0xce4b57[_0xb81d('0x3e')]&&!_0xce4b57[_0xb81d('0x3f')]){_0x240467[_0xce4b57['nameField']['toLowerCase']()]=_0xce4b57[_0xb81d('0x40')][_0xb81d('0x36')]();}else if(_[_0xb81d('0x41')]([_0xb81d('0x42'),_0xb81d('0x3c')],_0xce4b57['type'])&&_0xce4b57[_0xb81d('0x43')]&&_0xce4b57[_0xb81d('0x3f')]){_0x240467[_0xb81d('0x44')]['push']({'id':_0xce4b57[_0xb81d('0x43')],'value':_0xce4b57[_0xb81d('0x40')][_0xb81d('0x36')]()});}else if(_0xce4b57[_0xb81d('0x3d')]===_0xb81d('0x45')&&_0xce4b57['variableName']&&_0xce4b57[_0xb81d('0x43')]&&_0xce4b57[_0xb81d('0x3f')]){_0xce8241[_0xce4b57[_0xb81d('0x46')]]&&_0x240467[_0xb81d('0x44')]['push']({'id':_0xce4b57[_0xb81d('0x43')],'value':_0xce8241[_0xce4b57[_0xb81d('0x46')]]['toString']()});}else if(_0xce4b57['type']===_0xb81d('0x47')&&_0xce4b57[_0xb81d('0x48')]&&_0xce4b57['Variable'][_0xb81d('0x49')]&&_0xce4b57[_0xb81d('0x43')]&&_0xce4b57[_0xb81d('0x3f')]){_0xce8241[_0xce4b57[_0xb81d('0x48')][_0xb81d('0x49')][_0xb81d('0x4a')]()]&&_0x240467[_0xb81d('0x44')][_0xb81d('0x4b')]({'id':_0xce4b57[_0xb81d('0x43')],'value':_0xce8241[_0xce4b57['Variable'][_0xb81d('0x49')]['toLowerCase']()][_0xb81d('0x36')]()});}});}return _0x240467;}exports[_0xb81d('0x4c')]=function(_0x17aa57,_0x47a31f,_0x1787c9,_0x4fb644,_0x325197,_0x8a9fe7){var _0x254526,_0x3b9084;_0x8a9fe7[_0xb81d('0xf')]=intUtil[_0xb81d('0x4d')](_0x8a9fe7[_0xb81d('0xf')]);_0x8a9fe7[_0xb81d('0x4e')]=intUtil[_0xb81d('0x4d')](_0x8a9fe7[_0xb81d('0x4e')]);if(_0x325197&&_0x325197[_0xb81d('0x4f')]){logger[_0xb81d('0xc')](_0xb81d('0x50'),_0xb81d('0x51'));_0x47a31f[_0xb81d('0x52')]=util[_0xb81d('0xd')](_0xb81d('0x53'),_0x8a9fe7[_0xb81d('0x4e')],_0x47a31f[_0xb81d('0x54')],md5(_0x47a31f[_0xb81d('0x54')]));}else{_0x47a31f[_0xb81d('0x52')]='';}headers['Authorization']=getAuth(_0x8a9fe7);return getUser(_0x8a9fe7,_0x4fb644['email'])[_0xb81d('0x16')](function(_0x16ea6e){_0x254526=_0x16ea6e;logger['info'](_0xb81d('0x55'),_0x254526['id']);return getEndUser(_0x8a9fe7,_0x47a31f[_0xb81d('0x56')],_0x47a31f[_0xb81d('0x57')]);})[_0xb81d('0x16')](function(_0x3d8098){_0x3b9084=_0x3d8098;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3b9084['id']);return getTicket(_0x8a9fe7,_0x254526,_0x3b9084,_0x1787c9,_0x47a31f);})[_0xb81d('0x16')](function(_0x266863){if(_0x266863){logger[_0xb81d('0xc')](_0xb81d('0x58'),_0x266863['id']);switch(_0x8a9fe7['type']){case _0xb81d('0x59'):logger['info'](_0xb81d('0x50'),_0xb81d('0x5a'));return request({'uri':util[_0xb81d('0xd')](_0xb81d('0x5b'),_0x8a9fe7[_0xb81d('0xf')],_0x254526['id'],_0x266863['id']),'method':'POST'});case _0xb81d('0x5c'):logger['info'](_0xb81d('0x50'),_0xb81d('0x5d'));emit(util[_0xb81d('0xd')](_0xb81d('0x5e'),_0x4fb644[_0xb81d('0x49')]),_0xb81d('0x5f'),{'uri':util['format'](_0xb81d('0x60'),_0x8a9fe7['remoteUri'][_0xb81d('0x61')](_0xb81d('0x62'),''),_0x266863['id'])});break;default:logger[_0xb81d('0x63')](_0xb81d('0x50'),_0xb81d('0x64'));}}})[_0xb81d('0x65')](function(_0x330378){logger[_0xb81d('0x63')](_0xb81d('0x66'),util[_0xb81d('0x67')](_0x330378,{'showHidden':!![],'depth':null}));});};exports[_0xb81d('0x68')]=function(_0x5bccde,_0x19eaaf,_0x317695,_0x30df92,_0x4bfcbb,_0x44257a,_0x448b49){var _0x14e9e2,_0x31d550;_0x44257a[_0xb81d('0xf')]=intUtil[_0xb81d('0x4d')](_0x44257a[_0xb81d('0xf')]);_0x44257a[_0xb81d('0x4e')]=intUtil[_0xb81d('0x4d')](_0x44257a['serverUrl']);if(_0x448b49&&_0x448b49[_0xb81d('0x69')]&&_0x448b49[_0xb81d('0x69')]!=='none'){logger[_0xb81d('0xc')](_0xb81d('0x6a'),_0xb81d('0x51'));_0x19eaaf[_0xb81d('0x52')]=util['format'](_0xb81d('0x53'),_0x44257a[_0xb81d('0x4e')],_0x19eaaf[_0xb81d('0x54')],md5(_0x19eaaf['uniqueid']));}headers[_0xb81d('0x6b')]=getAuth(_0x44257a);return getUser(_0x44257a,_0x30df92[_0xb81d('0x6c')])[_0xb81d('0x16')](function(_0x48eb8d){_0x14e9e2=_0x48eb8d;logger[_0xb81d('0xc')](_0xb81d('0x55'),_0x14e9e2['id']);return getEndUser(_0x44257a,_0x19eaaf[_0xb81d('0x6d')],_0x19eaaf[_0xb81d('0x6e')]);})['then'](function(_0x14b078){_0x31d550=_0x14b078;logger[_0xb81d('0xc')](_0xb81d('0x6f'),_0x31d550['id']);return getTicket(_0x44257a,_0x14e9e2,_0x31d550,_0x317695,_0x19eaaf);})[_0xb81d('0x16')](function(_0x4a01){if(_0x4a01){logger[_0xb81d('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4a01['id']);switch(_0x44257a['type']){case _0xb81d('0x59'):logger['info'](_0xb81d('0x6a'),_0xb81d('0x5a'));return request({'uri':util['format'](_0xb81d('0x5b'),_0x44257a['remoteUri'],_0x14e9e2['id'],_0x4a01['id']),'method':_0xb81d('0x2c')});case _0xb81d('0x5c'):logger[_0xb81d('0xc')]('[OUTBOUND]',_0xb81d('0x5d'));emit(util['format'](_0xb81d('0x5e'),_0x30df92[_0xb81d('0x49')]),'trigger:browser:url',{'uri':util[_0xb81d('0xd')](_0xb81d('0x60'),_0x44257a[_0xb81d('0xf')][_0xb81d('0x61')](_0xb81d('0x62'),''),_0x4a01['id'])});break;default:logger['error'](_0xb81d('0x6a'),_0xb81d('0x64'));}}})[_0xb81d('0x65')](function(_0x35c9ec){logger['error'](_0xb81d('0x70'),util[_0xb81d('0x67')](_0x35c9ec,{'showHidden':!![],'depth':null}));});};exports[_0xb81d('0x71')]=function(_0x389202,_0xe95d02,_0x464c68,_0x1a42b9,_0x3f36ae,_0x1a8930){var _0x510231,_0x297286;_0x1a8930['remoteUri']=intUtil[_0xb81d('0x4d')](_0x1a8930[_0xb81d('0xf')]);_0x1a8930[_0xb81d('0x4e')]=intUtil[_0xb81d('0x4d')](_0x1a8930[_0xb81d('0x4e')]);if(_0x3f36ae&&_0x3f36ae['monitor_format']){logger[_0xb81d('0xc')]('['+_0xe95d02[_0xb81d('0x72')][_0xb81d('0x73')]()+']','Recording\x20is\x20enabled!');_0xe95d02[_0xb81d('0x52')]=util[_0xb81d('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1a8930[_0xb81d('0x4e')],_0xe95d02[_0xb81d('0x54')],md5(_0xe95d02[_0xb81d('0x54')]));}else{_0xe95d02[_0xb81d('0x52')]='';}headers[_0xb81d('0x6b')]=getAuth(_0x1a8930);return getUser(_0x1a8930)['then'](function(_0x115a94){_0x510231=_0x115a94;logger[_0xb81d('0xc')](_0xb81d('0x55'),_0x510231['id']);return getEndUser(_0x1a8930,_0xe95d02[_0xb81d('0x56')],_0xe95d02[_0xb81d('0x57')]);})[_0xb81d('0x16')](function(_0x44ec02){_0x297286=_0x44ec02;logger[_0xb81d('0xc')](_0xb81d('0x6f'),_0x297286['id']);return getTicket(_0x1a8930,_0x510231,_0x297286,_0x464c68,_0xe95d02);})['then'](function(_0xe35678){if(_0xe35678){logger[_0xb81d('0xc')](_0xb81d('0x58'),_0xe35678['id']);}})['catch'](function(_0x4d4b19){logger[_0xb81d('0x63')]('['+_0xe95d02[_0xb81d('0x72')]['toUpperCase']()+']'+_0xb81d('0x74'),util[_0xb81d('0x67')](_0x4d4b19,{'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 7fe0bb5..5d47d6d 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 _0xe6b9=['picklist','idField','content','type','variable','variableName','toString','Variable','name','toLowerCase','isNil','isBefore','expires_in','access_token','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','refresh_token','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Descriptions','Contacts','Who_Id','Full_Name','First_Name','What_Id','Last_Name','$se_module','talktime','utc','mm:ss','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','complete','connect','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','Fields','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','https://crm.','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','com','lodash','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string'];(function(_0x43516f,_0x467147){var _0x1b67cd=function(_0x315ab6){while(--_0x315ab6){_0x43516f['push'](_0x43516f['shift']());}};_0x1b67cd(++_0x467147);}(_0xe6b9,0x1cd));var _0x9e6b=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0xe6b9[_0x3fd3a3];return _0xa3e4d5;};'use strict';var _=require(_0x9e6b('0x0'));var rp=require(_0x9e6b('0x1'));var md5=require(_0x9e6b('0x2'));var util=require(_0x9e6b('0x3'));var intUtil=require('./util');var moment=require(_0x9e6b('0x4'));var Redis=require(_0x9e6b('0x5'));var BPromise=require(_0x9e6b('0x6'));var config=require(_0x9e6b('0x7'));var logger=require(_0x9e6b('0x8'))(_0x9e6b('0x9'));config[_0x9e6b('0xa')]=_[_0x9e6b('0xb')](config[_0x9e6b('0xa')],{'host':_0x9e6b('0xc'),'port':0x18eb});var io=require(_0x9e6b('0xd'))(new Redis(config[_0x9e6b('0xa')]));function emit(_0x50bc15,_0x232225,_0x5ef308){io['to'](_0x50bc15)[_0x9e6b('0xe')](_0x232225,_0x5ef308);}function request(_0x33c49f){logger[_0x9e6b('0xf')](_0x9e6b('0x10'),JSON[_0x9e6b('0x11')](_0x33c49f));return rp(_0x33c49f);}function getCustomFields(_0xeaed37,_0x271463){var _0x14df99={};if(_0xeaed37[_0x9e6b('0x12')]>0x0){_[_0x9e6b('0x13')](_0xeaed37,function(_0x160c73){if(_[_0x9e6b('0x14')]([_0x9e6b('0x15'),_0x9e6b('0x16')],_0x160c73['type'])&&_0x160c73[_0x9e6b('0x17')]){_0x14df99[_0x160c73[_0x9e6b('0x17')]]=_0x160c73[_0x9e6b('0x18')]['toString']();}else if(_0x160c73[_0x9e6b('0x19')]===_0x9e6b('0x1a')&&_0x160c73[_0x9e6b('0x1b')]&&_0x160c73['idField']&&_0x271463[_0x160c73[_0x9e6b('0x1b')]]){_0x14df99[_0x160c73[_0x9e6b('0x17')]]=_0x271463[_0x160c73[_0x9e6b('0x1b')]][_0x9e6b('0x1c')]();}else if(_0x160c73[_0x9e6b('0x19')]==='customVariable'&&_0x160c73['Variable']&&_0x160c73[_0x9e6b('0x1d')][_0x9e6b('0x1e')]&&_0x160c73['idField']&&_0x271463[_0x160c73[_0x9e6b('0x1d')]['name'][_0x9e6b('0x1f')]()]){_0x14df99[_0x160c73[_0x9e6b('0x17')]]=_0x271463[_0x160c73[_0x9e6b('0x1d')]['name'][_0x9e6b('0x1f')]()][_0x9e6b('0x1c')]();}});}return _0x14df99;}function getName(_0x33bfcf){if(_0x33bfcf['indexOf']('\x20')>0x0){var _0x1d4816=_0x33bfcf['split'](/ (.+)/);if(_0x1d4816[0x1]){return _0x1d4816;}}return[_0x33bfcf,_0x33bfcf];}var accountsTokens={};function getAccessToken(_0x4370da){return new Promise(function(_0x5e6e4f,_0x4238ea){if(!_[_0x9e6b('0x20')](accountsTokens[_0x4370da['id']])&&!_[_0x9e6b('0x20')](accountsTokens[_0x4370da['id']]['access_token'])){if(moment()[_0x9e6b('0x21')](accountsTokens[_0x4370da['id']][_0x9e6b('0x22')])){_0x5e6e4f(accountsTokens[_0x4370da['id']][_0x9e6b('0x23')]);}}var _0x3a3179;switch(_0x4370da[_0x9e6b('0x24')]){case'US':_0x3a3179=_0x9e6b('0x25');break;case'AU':_0x3a3179=_0x9e6b('0x26');break;case'EU':_0x3a3179=_0x9e6b('0x27');break;case'IN':_0x3a3179=_0x9e6b('0x28');break;case'CN':_0x3a3179=_0x9e6b('0x29');break;default:_0x3a3179=_0x9e6b('0x27');break;}var _0x8d67d0={'method':_0x9e6b('0x2a'),'uri':_0x3a3179+_0x9e6b('0x2b'),'qs':{'refresh_token':_0x4370da['refreshToken'],'client_id':_0x4370da[_0x9e6b('0x2c')],'client_secret':_0x4370da[_0x9e6b('0x2d')],'grant_type':_0x9e6b('0x2e')},'json':!![]};return rp(_0x8d67d0)[_0x9e6b('0x2f')](function(_0x12eb78){accountsTokens[_0x4370da['id']]={'access_token':_0x12eb78[_0x9e6b('0x23')],'expires_in':moment()[_0x9e6b('0x30')](_0x12eb78[_0x9e6b('0x22')],_0x9e6b('0x31'))};_0x5e6e4f(_0x12eb78[_0x9e6b('0x23')]);})[_0x9e6b('0x32')](function(_0xa729f8){logger['error'](_0x9e6b('0x33'),_0xa729f8[_0x9e6b('0x34')]);_0x4238ea(_0xa729f8);});});}function getUser(_0x57297e,_0x434822,_0x26ccb5,_0x1e6512){logger[_0x9e6b('0x35')](_0x9e6b('0x36'));return request({'method':_0x9e6b('0x37'),'uri':util[_0x9e6b('0x38')](_0x9e6b('0x39'),_0x434822),'qs':{'type':_0x9e6b('0x3a')},'headers':{'Authorization':_0x9e6b('0x3b')+_0x57297e},'json':!![]})[_0x9e6b('0x2f')](function(_0x36fc43){if(_0x36fc43['users']){var _0x8da4e6=-0x1;if(_[_0x9e6b('0x3c')](_0x36fc43['users'])){if(!_[_0x9e6b('0x20')](_0x1e6512)){_0x8da4e6=_[_0x9e6b('0x3d')](_0x36fc43[_0x9e6b('0x3e')],function(_0x550cf4){return _0x550cf4[_0x9e6b('0x3f')]===_0x1e6512;});}if(_0x8da4e6>=0x0){logger[_0x9e6b('0x35')](_0x9e6b('0x40'));}else{logger[_0x9e6b('0x35')](_0x9e6b('0x41'));_0x8da4e6=_[_0x9e6b('0x3d')](_0x36fc43[_0x9e6b('0x3e')],function(_0x4adada){return _0x4adada['profile'][_0x9e6b('0x1e')]===_0x9e6b('0x42');});}return _0x36fc43[_0x9e6b('0x3e')][_0x8da4e6];}else{if(_0x36fc43[_0x9e6b('0x43')][_0x9e6b('0x44')][_0x9e6b('0x1e')]===_0x9e6b('0x42')){logger[_0x9e6b('0x35')](_0x9e6b('0x41'));user=_0x36fc43['user'];return user;}else{logger[_0x9e6b('0x45')](_0x9e6b('0x46'),JSON[_0x9e6b('0x11')](_0x36fc43));throw new Error(_0x9e6b('0x47')+JSON[_0x9e6b('0x11')](_0x36fc43));}}}else{logger['error'](_0x9e6b('0x46'),JSON['stringify'](_0x36fc43));throw new Error(_0x9e6b('0x47')+JSON[_0x9e6b('0x11')](_0x36fc43));}})[_0x9e6b('0x32')](function(_0x4c130e){console[_0x9e6b('0x45')](_0x4c130e);});}function getZohoUser(_0x93b03b,_0xa52685){return new BPromise(function(_0x1c6243,_0x9a0039){request(_0x93b03b)[_0x9e6b('0x2f')](function(_0x1d5092){var _0x4c0f16=null;if(_0x1d5092){_0x4c0f16=_0x1d5092[_0x9e6b('0x48')][0x0];_0x4c0f16[_0x9e6b('0x49')]=_0xa52685;}_0x1c6243(_0x4c0f16);})[_0x9e6b('0x32')](function(_0xd21538){_0x9a0039(_0xd21538);});});}function createEndUser(_0x33c3ad,_0x30e459,_0x58bdfc,_0x5a2f88,_0x328cca,_0x42e5e3){var _0x58bdfc=getName(_0x58bdfc);return request({'method':_0x9e6b('0x2a'),'uri':_0x9e6b('0x4a')+_0x30e459+'/crm/v2/'+_[_0x9e6b('0x4b')](_0x42e5e3[_0x9e6b('0x4c')])+'s','body':{'data':[{'Last_Name':_0x58bdfc[0x1],'First_Name':_0x58bdfc[0x0],'Phone':_0x5a2f88,'Owner':{'name':!_[_0x9e6b('0x20')](_0x328cca[_0x9e6b('0x4d')][_0x9e6b('0x1e')])?_0x328cca[_0x9e6b('0x4d')][_0x9e6b('0x1e')]:!_[_0x9e6b('0x20')](_0x328cca[_0x9e6b('0x4e')])?_0x328cca[_0x9e6b('0x4e')]+'\x20'+_0x328cca['last_name']:_0x328cca[_0x9e6b('0x4f')],'id':_0x328cca['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x33c3ad},'json':!![]})[_0x9e6b('0x2f')](function(_0x5261b6){if(_0x5261b6&&_0x5261b6[_0x9e6b('0x48')][0x0][_0x9e6b('0x50')]===_0x9e6b('0x51')){var _0xfe7d6b=_0x5261b6[_0x9e6b('0x48')][0x0][_0x9e6b('0x52')];_0xfe7d6b[_0x9e6b('0x49')]=_[_0x9e6b('0x4b')](_0x42e5e3[_0x9e6b('0x4c')])+'s';return _0xfe7d6b;}logger[_0x9e6b('0x45')]('The\x20failing\x20result\x20is',JSON[_0x9e6b('0x11')](data));throw new Error(_0x9e6b('0x53')+JSON[_0x9e6b('0x11')](data));})[_0x9e6b('0x32')](function(_0x33e1bc){console[_0x9e6b('0x54')]('CREATE\x20ERROR',_0x33e1bc);});}function getEndUser(_0x256a5f,_0x4231fc,_0x4f850b,_0x5cfa79,_0x2d22da,_0x1a5a15,_0x206dc1){var _0x47aa04={'method':_0x9e6b('0x37'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x256a5f},'json':!![]};switch(_0x206dc1['moduleSearch']){case _0x9e6b('0x55'):_0x47aa04[_0x9e6b('0x56')]=_0x9e6b('0x4a')+_0x4231fc+_0x9e6b('0x57')+_0x2d22da+'))';return getZohoUser(_0x47aa04,'Contacts')[_0x9e6b('0x2f')](function(_0x3ad51b){if(_0x3ad51b)return _0x3ad51b;_0x47aa04['uri']=_0x9e6b('0x4a')+_0x4231fc+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2d22da+'))';return getZohoUser(_0x47aa04,'Leads')[_0x9e6b('0x2f')](function(_0x3ad876){if(_0x3ad876)return _0x3ad876;if(_0x206dc1[_0x9e6b('0x4c')]!=_0x9e6b('0x58')){return createEndUser(_0x256a5f,_0x4231fc,_0x5cfa79,_0x2d22da,_0x1a5a15,_0x206dc1);}else{return{};}});});break;case'contact':_0x47aa04[_0x9e6b('0x56')]=_0x9e6b('0x4a')+_0x4231fc+_0x9e6b('0x57')+_0x2d22da+'))';return getZohoUser(_0x47aa04,'Contacts')[_0x9e6b('0x2f')](function(_0x3c547d){if(_0x3c547d)return _0x3c547d;if(_0x206dc1[_0x9e6b('0x4c')]!=_0x9e6b('0x58')){return createEndUser(_0x256a5f,_0x4231fc,_0x5cfa79,_0x2d22da,_0x1a5a15,_0x206dc1);}else{return{};}});break;case _0x9e6b('0x59'):_0x47aa04[_0x9e6b('0x56')]=_0x9e6b('0x4a')+_0x4231fc+_0x9e6b('0x5a')+_0x2d22da+'))';return getZohoUser(_0x47aa04,_0x9e6b('0x5b'))['then'](function(_0x5f27e4){if(_0x5f27e4)return _0x5f27e4;if(_0x206dc1[_0x9e6b('0x4c')]!=_0x9e6b('0x58')){return createEndUser(_0x256a5f,_0x4231fc,_0x5cfa79,_0x2d22da,_0x1a5a15,_0x206dc1);}else{return{};}});break;}}function getCall(_0x367c22,_0x2674eb,_0x5870a1,_0x4a0b75,_0x387a96,_0x308abd,_0x3a08b9,_0x3a5231){logger['info'](_0x9e6b('0x5c'));var _0x429aed={};_0x429aed[_0x9e6b('0x5d')]={'name':!_[_0x9e6b('0x20')](_0x4a0b75[_0x9e6b('0x4d')][_0x9e6b('0x1e')])&&!_[_0x9e6b('0x20')](_0x4a0b75['profile'][_0x9e6b('0x1e')])&&_0x4a0b75[_0x9e6b('0x44')][_0x9e6b('0x1e')]===_0x9e6b('0x5e')?_0x4a0b75[_0x9e6b('0x4d')]['name']:!_[_0x9e6b('0x20')](_0x4a0b75[_0x9e6b('0x4e')])?_0x4a0b75[_0x9e6b('0x4e')]+'\x20'+_0x4a0b75[_0x9e6b('0x4f')]:_0x4a0b75['last_name'],'id':_0x4a0b75['id']};_0x429aed[_0x9e6b('0x5f')]=intUtil[_0x9e6b('0x60')](_0x308abd[_0x9e6b('0x61')],_0x3a08b9,'\x20');_0x429aed['Description']=intUtil['getString'](_0x308abd[_0x9e6b('0x62')],_0x3a08b9,'\x0a');if(_0x387a96['enduserType']===_0x9e6b('0x63')){_0x429aed[_0x9e6b('0x64')]={'name':!_['isNil'](_0x387a96[_0x9e6b('0x65')])?_0x387a96[_0x9e6b('0x65')]:!_[_0x9e6b('0x20')](_0x387a96[_0x9e6b('0x66')])?_0x387a96[_0x9e6b('0x66')]+'\x20'+_0x387a96['Last_Name']:_0x387a96['Last_Name'],'id':_0x387a96['id']};}if(_0x387a96['enduserType']===_0x9e6b('0x5b')){_0x429aed[_0x9e6b('0x67')]={'name':!_['isNil'](_0x387a96[_0x9e6b('0x65')])?_0x387a96[_0x9e6b('0x65')]:!_[_0x9e6b('0x20')](_0x387a96[_0x9e6b('0x66')])?_0x387a96[_0x9e6b('0x66')]+'\x20'+_0x387a96['Last_Name']:_0x387a96[_0x9e6b('0x68')],'id':_0x387a96['id']};_0x429aed[_0x9e6b('0x69')]=_[_0x9e6b('0x4b')](_0x387a96['enduserType']);}if(_0x3a08b9[_0x9e6b('0x6a')]){_0x429aed['Call_Duration']=moment[_0x9e6b('0x6b')](parseInt(_0x3a08b9['talktime'])*0x3e8)[_0x9e6b('0x38')](_0x9e6b('0x6c'));}else if(_0x3a08b9['answertime']&&_0x3a08b9[_0x9e6b('0x6d')]){_0x429aed[_0x9e6b('0x6e')]=moment[_0x9e6b('0x6b')](moment(_0x3a08b9['endtime'],_0x9e6b('0x6f'))[_0x9e6b('0x70')](moment(_0x3a08b9['starttime'],_0x9e6b('0x6f'))))['format'](_0x9e6b('0x6c'));}switch(_0x3a08b9[_0x9e6b('0x71')]){case _0x9e6b('0x72'):_0x429aed[_0x9e6b('0x73')]='Called';break;case _0x9e6b('0x74'):case _0x9e6b('0x75'):_0x429aed[_0x9e6b('0x73')]=_0x9e6b('0x76');break;case _0x9e6b('0x77'):_0x429aed['Call_Result']=_0x9e6b('0x78');break;case'abandoned':_0x429aed[_0x9e6b('0x73')]=_0x9e6b('0x79');break;case _0x9e6b('0x7a'):_0x429aed[_0x9e6b('0x73')]=_0x9e6b('0x7b');default:}_0x429aed[_0x9e6b('0x7c')]=(_0x3a5231===_0x9e6b('0x7d')?moment(_0x3a08b9[_0x9e6b('0x7e')])[_0x9e6b('0x38')](_0x9e6b('0x6f')):moment(_0x3a08b9[_0x9e6b('0x7f')])[_0x9e6b('0x38')](_0x9e6b('0x6f')))||moment()[_0x9e6b('0x38')]('YYYY-MM-DDTHH:mm:ss');_0x429aed[_0x9e6b('0x80')]=_0x3a5231||_0x9e6b('0x81');_0x429aed=_['merge'](_0x429aed,getCustomFields(_0x308abd[_0x9e6b('0x82')],_0x3a08b9));return request({'method':'POST','uri':_0x9e6b('0x4a')+_0x2674eb+'/crm/v2/Calls','headers':{'Authorization':_0x9e6b('0x3b')+_0x367c22},'body':{'data':[_0x429aed]},'json':!![]})[_0x9e6b('0x2f')](function(_0x24fec1){if(_0x24fec1&&_0x24fec1['data'][0x0]['code']===_0x9e6b('0x51')){logger['info'](_0x9e6b('0x83'));return{'id':_0x24fec1[_0x9e6b('0x48')][0x0]['details']['id']};}})[_0x9e6b('0x32')](function(_0x1cfaa7){logger[_0x9e6b('0x35')](_0x9e6b('0x84'),_0x1cfaa7[_0x9e6b('0x34')]);console[_0x9e6b('0x54')]('err',_0x1cfaa7);});}exports[_0x9e6b('0x85')]=function(_0x3a3c42,_0x8e4647,_0x46a273,_0x514601,_0x494121,_0x3b79f2){var _0x3c5683,_0x3e6e99,_0x556e4e;_0x3b79f2[_0x9e6b('0x86')]=intUtil[_0x9e6b('0x87')](_0x3b79f2[_0x9e6b('0x86')]);_0x3b79f2['serverUrl']=intUtil['stripTrailingSlash'](_0x3b79f2[_0x9e6b('0x88')]);if(_0x494121&&_0x494121['monitor_format']){logger[_0x9e6b('0x35')](_0x9e6b('0x89'),_0x9e6b('0x8a'));_0x8e4647[_0x9e6b('0x8b')]=_0x3b79f2[_0x9e6b('0x88')]+_0x9e6b('0x8c')+_0x8e4647[_0x9e6b('0x8d')]+_0x9e6b('0x8e')+md5(_0x8e4647['uniqueid']);}else{_0x8e4647['recordingURL']='';}var _0x5eb92b=_0x3b79f2[_0x9e6b('0x86')]===_0x9e6b('0x8f')?'eu':'com';return getAccessToken(_0x3b79f2)['then'](function(_0x19c5f8){_0x556e4e=_0x19c5f8;return getUser(_0x556e4e,_0x5eb92b,_0x3b79f2,_0x514601[_0x9e6b('0x3f')]);})[_0x9e6b('0x2f')](function(_0x248f43){_0x3c5683=_0x248f43;logger[_0x9e6b('0x35')](_0x9e6b('0x90'),_0x3c5683['id']);return getEndUser(_0x556e4e,_0x5eb92b,_0x3b79f2,_0x8e4647[_0x9e6b('0x91')],_0x8e4647[_0x9e6b('0x92')],_0x3c5683,_0x46a273);})[_0x9e6b('0x2f')](function(_0x1d4e11){_0x3e6e99=_0x1d4e11;return getCall(_0x556e4e,_0x5eb92b,_0x3b79f2,_0x3c5683,_0x3e6e99,_0x46a273,_0x8e4647,_0x9e6b('0x81'));})[_0x9e6b('0x2f')](function(_0x108b3d){if(_0x108b3d){logger['info'](_0x9e6b('0x93'),_0x108b3d['id']);logger['info'](_0x9e6b('0x89'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9e6b('0x38')]('user:%s',_0x514601['name']),'trigger:browser:url',{'uri':_0x9e6b('0x94')+_0x3b79f2[_0x9e6b('0x86')]+'/crm/EntityInfo.do?module=Calls&id='+_0x108b3d['id']});}})[_0x9e6b('0x32')](function(_0x40d5b8){logger[_0x9e6b('0x45')](_0x9e6b('0x89'),JSON[_0x9e6b('0x11')](_0x40d5b8));});};exports[_0x9e6b('0x7d')]=function(_0x2c9433,_0x595365,_0x1444a7,_0x1a6fe8,_0x14231e,_0x3dff57,_0x3ba1f5){var _0x74d140,_0x32a80f,_0x19916e;_0x3dff57[_0x9e6b('0x86')]=intUtil[_0x9e6b('0x87')](_0x3dff57[_0x9e6b('0x86')]);_0x3dff57[_0x9e6b('0x88')]=intUtil[_0x9e6b('0x87')](_0x3dff57[_0x9e6b('0x88')]);if(_0x3ba1f5&&_0x3ba1f5['recordingFormat']&&_0x3ba1f5[_0x9e6b('0x95')]!==_0x9e6b('0x96')){logger[_0x9e6b('0x35')](_0x9e6b('0x97'),_0x9e6b('0x8a'));_0x595365[_0x9e6b('0x8b')]=_0x3dff57['serverUrl']+'/api/voice/recordings/'+_0x595365[_0x9e6b('0x8d')]+'/downloads?type=uniqueid&token='+md5(_0x595365[_0x9e6b('0x8d')]);}var _0x290202=_0x3dff57[_0x9e6b('0x86')]===_0x9e6b('0x8f')?'eu':'com';return getAccessToken(_0x3dff57)['then'](function(_0xf57cba){_0x19916e=_0xf57cba;return getUser(_0x19916e,_0x290202,_0x3dff57,_0x1a6fe8[_0x9e6b('0x3f')]);})[_0x9e6b('0x2f')](function(_0x5d6cfa){_0x74d140=_0x5d6cfa;logger[_0x9e6b('0x35')](_0x9e6b('0x90'),_0x74d140['id']);return getEndUser(_0x19916e,_0x290202,_0x3dff57,_0x595365[_0x9e6b('0x98')],_0x595365[_0x9e6b('0x99')],_0x74d140,_0x1444a7);})[_0x9e6b('0x2f')](function(_0x4b516e){_0x32a80f=_0x4b516e;return getCall(_0x19916e,_0x290202,_0x3dff57,_0x74d140,_0x32a80f,_0x1444a7,_0x595365,'Outbound');})[_0x9e6b('0x2f')](function(_0x49609b){if(_0x49609b){logger['info'](_0x9e6b('0x93'),_0x49609b['id']);logger[_0x9e6b('0x35')](_0x9e6b('0x97'),_0x9e6b('0x9a'));emit(util[_0x9e6b('0x38')](_0x9e6b('0x9b'),_0x1a6fe8['name']),'trigger:browser:url',{'uri':_0x9e6b('0x94')+_0x3dff57[_0x9e6b('0x86')]+_0x9e6b('0x9c')+_0x49609b['id']});}})[_0x9e6b('0x32')](function(_0x7175a6){logger['error'](_0x9e6b('0x97'),JSON['stringify'](_0x7175a6));});};exports[_0x9e6b('0x9d')]=function(_0x53ee54,_0x2d97ee,_0x362c6f,_0x246932,_0x3d29a6,_0x5dd737){var _0x41e3bd,_0x6b2b2a,_0x39545b;_0x5dd737[_0x9e6b('0x86')]=intUtil['stripTrailingSlash'](_0x5dd737[_0x9e6b('0x86')]);_0x5dd737[_0x9e6b('0x88')]=intUtil['stripTrailingSlash'](_0x5dd737[_0x9e6b('0x88')]);if(_0x3d29a6&&_0x3d29a6[_0x9e6b('0x9e')]){logger[_0x9e6b('0x35')]('['+_0x2d97ee[_0x9e6b('0x71')][_0x9e6b('0x9f')]()+']',_0x9e6b('0x8a'));_0x2d97ee[_0x9e6b('0x8b')]=_0x5dd737[_0x9e6b('0x88')]+'/api/voice/recordings/'+_0x2d97ee[_0x9e6b('0x8d')]+_0x9e6b('0x8e')+md5(_0x2d97ee[_0x9e6b('0x8d')]);}else{_0x2d97ee[_0x9e6b('0x8b')]='';}var _0x1a57f1=_0x5dd737[_0x9e6b('0x86')]===_0x9e6b('0x8f')?'eu':_0x9e6b('0xa0');return getAccessToken(_0x5dd737)[_0x9e6b('0x2f')](function(_0x30b1da){_0x39545b=_0x30b1da;return getUser(_0x39545b,_0x1a57f1,_0x5dd737);})[_0x9e6b('0x2f')](function(_0x507e34){_0x41e3bd=_0x507e34;logger['info'](_0x9e6b('0x90'),_0x41e3bd['id']);return getEndUser(_0x39545b,_0x1a57f1,_0x5dd737,_0x2d97ee[_0x9e6b('0x91')],_0x2d97ee[_0x9e6b('0x92')],_0x41e3bd,_0x362c6f);})[_0x9e6b('0x2f')](function(_0x1c1896){_0x6b2b2a=_0x1c1896;return getCall(_0x39545b,_0x1a57f1,_0x5dd737,_0x41e3bd,_0x6b2b2a,_0x362c6f,_0x2d97ee,_0x9e6b('0x81'));})['then'](function(_0x965a40){if(_0x965a40){logger[_0x9e6b('0x35')](_0x9e6b('0x93'),_0x965a40['id']);}})[_0x9e6b('0x32')](function(_0x53900d){logger[_0x9e6b('0x45')]('['+_0x2d97ee[_0x9e6b('0x71')][_0x9e6b('0x9f')]()+']',JSON[_0x9e6b('0x11')](_0x53900d));});}; \ No newline at end of file +var _0x100a=['md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','localhost','emit','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variableName','Variable','name','toLowerCase','isNil','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','then','data','enduserType','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','startCase','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Description','getString','Descriptions','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','connect','Answered','Call_Result','abandoned','timeout','Call_Start_Time','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','err','stack','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','[OUTBOUND]','destcalleridname','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','unmanaged','lastevent','toUpperCase','calleridnum','lodash'];(function(_0x2902ec,_0xfdfc09){var _0x27b09d=function(_0x232615){while(--_0x232615){_0x2902ec['push'](_0x2902ec['shift']());}};_0x27b09d(++_0xfdfc09);}(_0x100a,0x97));var _0xa100=function(_0x2aa69e,_0x1f0a4a){_0x2aa69e=_0x2aa69e-0x0;var _0x51daf9=_0x100a[_0x2aa69e];return _0x51daf9;};'use strict';var _=require(_0xa100('0x0'));var rp=require('request-promise');var md5=require(_0xa100('0x1'));var util=require(_0xa100('0x2'));var intUtil=require(_0xa100('0x3'));var moment=require(_0xa100('0x4'));var Redis=require(_0xa100('0x5'));var BPromise=require(_0xa100('0x6'));var config=require(_0xa100('0x7'));var logger=require(_0xa100('0x8'))(_0xa100('0x9'));config['redis']=_[_0xa100('0xa')](config['redis'],{'host':_0xa100('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5f404e,_0x255ba2,_0x2f2435){io['to'](_0x5f404e)[_0xa100('0xc')](_0x255ba2,_0x2f2435);}function request(_0x4c99bf){logger['debug']('[HTTP]',JSON[_0xa100('0xd')](_0x4c99bf));return rp(_0x4c99bf);}function getCustomFields(_0x30ecda,_0x1fc921){var _0x366e82={};if(_0x30ecda[_0xa100('0xe')]>0x0){_[_0xa100('0xf')](_0x30ecda,function(_0x24625c){if(_[_0xa100('0x10')]([_0xa100('0x11'),_0xa100('0x12')],_0x24625c[_0xa100('0x13')])&&_0x24625c[_0xa100('0x14')]){_0x366e82[_0x24625c[_0xa100('0x14')]]=_0x24625c[_0xa100('0x15')][_0xa100('0x16')]();}else if(_0x24625c[_0xa100('0x13')]==='variable'&&_0x24625c['variableName']&&_0x24625c['idField']&&_0x1fc921[_0x24625c[_0xa100('0x17')]]){_0x366e82[_0x24625c['idField']]=_0x1fc921[_0x24625c[_0xa100('0x17')]][_0xa100('0x16')]();}else if(_0x24625c[_0xa100('0x13')]==='customVariable'&&_0x24625c['Variable']&&_0x24625c[_0xa100('0x18')]['name']&&_0x24625c['idField']&&_0x1fc921[_0x24625c['Variable'][_0xa100('0x19')][_0xa100('0x1a')]()]){_0x366e82[_0x24625c[_0xa100('0x14')]]=_0x1fc921[_0x24625c[_0xa100('0x18')][_0xa100('0x19')]['toLowerCase']()][_0xa100('0x16')]();}});}return _0x366e82;}function getName(_0x510931){if(_0x510931['indexOf']('\x20')>0x0){var _0x72f241=_0x510931['split'](/ (.+)/);if(_0x72f241[0x1]){return _0x72f241;}}return[_0x510931,_0x510931];}var accountsTokens={};function getAccessToken(_0x2d04fb){return new Promise(function(_0x3e20ad,_0x49a947){if(!_[_0xa100('0x1b')](accountsTokens[_0x2d04fb['id']])&&!_[_0xa100('0x1b')](accountsTokens[_0x2d04fb['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x2d04fb['id']]['expires_in'])){_0x3e20ad(accountsTokens[_0x2d04fb['id']][_0xa100('0x1c')]);}}var _0x123380;switch(_0x2d04fb[_0xa100('0x1d')]){case'US':_0x123380='https://accounts.zoho.com';break;case'AU':_0x123380=_0xa100('0x1e');break;case'EU':_0x123380='https://accounts.zoho.eu';break;case'IN':_0x123380=_0xa100('0x1f');break;case'CN':_0x123380=_0xa100('0x20');break;default:_0x123380=_0xa100('0x21');break;}var _0x4b6ad1={'method':_0xa100('0x22'),'uri':_0x123380+_0xa100('0x23'),'qs':{'refresh_token':_0x2d04fb[_0xa100('0x24')],'client_id':_0x2d04fb[_0xa100('0x25')],'client_secret':_0x2d04fb[_0xa100('0x26')],'grant_type':_0xa100('0x27')},'json':!![]};return rp(_0x4b6ad1)['then'](function(_0x444cd3){accountsTokens[_0x2d04fb['id']]={'access_token':_0x444cd3['access_token'],'expires_in':moment()[_0xa100('0x28')](_0x444cd3[_0xa100('0x29')],_0xa100('0x2a'))};_0x3e20ad(_0x444cd3['access_token']);})[_0xa100('0x2b')](function(_0x4384a9){logger[_0xa100('0x2c')](_0xa100('0x2d'),_0x4384a9['stack']);_0x49a947(_0x4384a9);});});}function getUser(_0x4b5bf6,_0x149d43,_0x4e4c1f,_0x16c243){logger[_0xa100('0x2e')](_0xa100('0x2f'));return request({'method':'GET','uri':util[_0xa100('0x30')](_0xa100('0x31'),_0x149d43),'qs':{'type':_0xa100('0x32')},'headers':{'Authorization':_0xa100('0x33')+_0x4b5bf6},'json':!![]})['then'](function(_0x49849d){if(_0x49849d[_0xa100('0x34')]){var _0x445d1b=-0x1;if(_[_0xa100('0x35')](_0x49849d[_0xa100('0x34')])){if(!_['isNil'](_0x16c243)){_0x445d1b=_[_0xa100('0x36')](_0x49849d['users'],function(_0x11d312){return _0x11d312[_0xa100('0x37')]===_0x16c243;});}if(_0x445d1b>=0x0){logger[_0xa100('0x2e')](_0xa100('0x38'));}else{logger[_0xa100('0x2e')](_0xa100('0x39'));_0x445d1b=_['findIndex'](_0x49849d['users'],function(_0x29c4c7){return _0x29c4c7['profile'][_0xa100('0x19')]===_0xa100('0x3a');});}return _0x49849d['users'][_0x445d1b];}else{if(_0x49849d['user'][_0xa100('0x3b')][_0xa100('0x19')]===_0xa100('0x3a')){logger[_0xa100('0x2e')](_0xa100('0x39'));user=_0x49849d['user'];return user;}else{logger[_0xa100('0x2c')](_0xa100('0x3c'),JSON[_0xa100('0xd')](_0x49849d));throw new Error(_0xa100('0x3d')+JSON[_0xa100('0xd')](_0x49849d));}}}else{logger[_0xa100('0x2c')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x49849d));throw new Error(_0xa100('0x3d')+JSON['stringify'](_0x49849d));}})[_0xa100('0x2b')](function(_0x11f3fc){console['error'](_0x11f3fc);});}function getZohoUser(_0x19f1c7,_0x58e336){return new BPromise(function(_0x58d368,_0x736bc1){request(_0x19f1c7)[_0xa100('0x3e')](function(_0x42176e){var _0x2b6533=null;if(_0x42176e){_0x2b6533=_0x42176e[_0xa100('0x3f')][0x0];_0x2b6533[_0xa100('0x40')]=_0x58e336;}_0x58d368(_0x2b6533);})[_0xa100('0x2b')](function(_0x12519d){_0x736bc1(_0x12519d);});});}function createEndUser(_0x52e58a,_0x3f99fa,_0x5ab570,_0x34007d,_0x1660e9,_0x29010e){var _0x5ab570=getName(_0x5ab570);return request({'method':_0xa100('0x22'),'uri':'https://www.zohoapis.'+_0x3f99fa+_0xa100('0x41')+_['startCase'](_0x29010e[_0xa100('0x42')])+'s','body':{'data':[{'Last_Name':_0x5ab570[0x1],'First_Name':_0x5ab570[0x0],'Phone':_0x34007d,'Owner':{'name':!_[_0xa100('0x1b')](_0x1660e9['role'][_0xa100('0x19')])?_0x1660e9[_0xa100('0x43')][_0xa100('0x19')]:!_[_0xa100('0x1b')](_0x1660e9['first_name'])?_0x1660e9[_0xa100('0x44')]+'\x20'+_0x1660e9[_0xa100('0x45')]:_0x1660e9['last_name'],'id':_0x1660e9['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x52e58a},'json':!![]})[_0xa100('0x3e')](function(_0x17bf7c){if(_0x17bf7c&&_0x17bf7c['data'][0x0][_0xa100('0x46')]===_0xa100('0x47')){var _0x371fbf=_0x17bf7c['data'][0x0][_0xa100('0x48')];_0x371fbf[_0xa100('0x40')]=_[_0xa100('0x49')](_0x29010e[_0xa100('0x42')])+'s';return _0x371fbf;}logger['error'](_0xa100('0x3c'),JSON[_0xa100('0xd')](data));throw new Error('Error:\x20'+JSON[_0xa100('0xd')](data));})[_0xa100('0x2b')](function(_0x396ad6){console[_0xa100('0x4a')](_0xa100('0x4b'),_0x396ad6);});}function getEndUser(_0x1fb6cc,_0x3218f4,_0x56b62c,_0x8de236,_0x2c4e07,_0x3201d7,_0x6bbc76){var _0x293887={'method':_0xa100('0x4c'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1fb6cc},'json':!![]};switch(_0x6bbc76[_0xa100('0x4d')]){case _0xa100('0x4e'):_0x293887['uri']='https://www.zohoapis.'+_0x3218f4+_0xa100('0x4f')+_0x2c4e07+'))';return getZohoUser(_0x293887,_0xa100('0x50'))[_0xa100('0x3e')](function(_0x2ac781){if(_0x2ac781)return _0x2ac781;_0x293887[_0xa100('0x51')]=_0xa100('0x52')+_0x3218f4+_0xa100('0x53')+_0x2c4e07+'))';return getZohoUser(_0x293887,_0xa100('0x54'))[_0xa100('0x3e')](function(_0x1f48a1){if(_0x1f48a1)return _0x1f48a1;if(_0x6bbc76[_0xa100('0x42')]!=_0xa100('0x55')){return createEndUser(_0x1fb6cc,_0x3218f4,_0x8de236,_0x2c4e07,_0x3201d7,_0x6bbc76);}else{return{};}});});break;case'contact':_0x293887['uri']=_0xa100('0x52')+_0x3218f4+_0xa100('0x4f')+_0x2c4e07+'))';return getZohoUser(_0x293887,_0xa100('0x50'))[_0xa100('0x3e')](function(_0x384dd6){if(_0x384dd6)return _0x384dd6;if(_0x6bbc76[_0xa100('0x42')]!=_0xa100('0x55')){return createEndUser(_0x1fb6cc,_0x3218f4,_0x8de236,_0x2c4e07,_0x3201d7,_0x6bbc76);}else{return{};}});break;case _0xa100('0x56'):_0x293887[_0xa100('0x51')]=_0xa100('0x52')+_0x3218f4+_0xa100('0x53')+_0x2c4e07+'))';return getZohoUser(_0x293887,_0xa100('0x54'))[_0xa100('0x3e')](function(_0x50264b){if(_0x50264b)return _0x50264b;if(_0x6bbc76[_0xa100('0x42')]!=_0xa100('0x55')){return createEndUser(_0x1fb6cc,_0x3218f4,_0x8de236,_0x2c4e07,_0x3201d7,_0x6bbc76);}else{return{};}});break;}}function getCall(_0x41ac0b,_0x57051a,_0x350cdf,_0xfc9abb,_0x232011,_0x2551f1,_0x2b476e,_0x57b7f6){logger[_0xa100('0x2e')](_0xa100('0x57'));var _0xd5efcc={};_0xd5efcc[_0xa100('0x58')]={'name':!_['isNil'](_0xfc9abb[_0xa100('0x43')]['name'])&&!_[_0xa100('0x1b')](_0xfc9abb['profile']['name'])&&_0xfc9abb[_0xa100('0x3b')][_0xa100('0x19')]===_0xa100('0x59')?_0xfc9abb[_0xa100('0x43')]['name']:!_[_0xa100('0x1b')](_0xfc9abb[_0xa100('0x44')])?_0xfc9abb['first_name']+'\x20'+_0xfc9abb[_0xa100('0x45')]:_0xfc9abb[_0xa100('0x45')],'id':_0xfc9abb['id']};_0xd5efcc[_0xa100('0x5a')]=intUtil['getString'](_0x2551f1[_0xa100('0x5b')],_0x2b476e,'\x20');_0xd5efcc[_0xa100('0x5c')]=intUtil[_0xa100('0x5d')](_0x2551f1[_0xa100('0x5e')],_0x2b476e,'\x0a');if(_0x232011[_0xa100('0x40')]===_0xa100('0x50')){_0xd5efcc['Who_Id']={'name':!_[_0xa100('0x1b')](_0x232011[_0xa100('0x5f')])?_0x232011['Full_Name']:!_[_0xa100('0x1b')](_0x232011[_0xa100('0x60')])?_0x232011[_0xa100('0x60')]+'\x20'+_0x232011[_0xa100('0x61')]:_0x232011[_0xa100('0x61')],'id':_0x232011['id']};}if(_0x232011[_0xa100('0x40')]==='Leads'){_0xd5efcc['What_Id']={'name':!_['isNil'](_0x232011[_0xa100('0x5f')])?_0x232011[_0xa100('0x5f')]:!_[_0xa100('0x1b')](_0x232011[_0xa100('0x60')])?_0x232011['First_Name']+'\x20'+_0x232011['Last_Name']:_0x232011['Last_Name'],'id':_0x232011['id']};_0xd5efcc[_0xa100('0x62')]=_['startCase'](_0x232011[_0xa100('0x40')]);}if(_0x2b476e[_0xa100('0x63')]){_0xd5efcc[_0xa100('0x64')]=moment[_0xa100('0x65')](parseInt(_0x2b476e[_0xa100('0x63')])*0x3e8)[_0xa100('0x30')](_0xa100('0x66'));}else if(_0x2b476e[_0xa100('0x67')]&&_0x2b476e[_0xa100('0x68')]){_0xd5efcc[_0xa100('0x64')]=moment['utc'](moment(_0x2b476e[_0xa100('0x68')],_0xa100('0x69'))[_0xa100('0x6a')](moment(_0x2b476e[_0xa100('0x6b')],_0xa100('0x69'))))[_0xa100('0x30')](_0xa100('0x66'));}switch(_0x2b476e['lastevent']){case _0xa100('0x6c'):_0xd5efcc['Call_Result']='Called';break;case'complete':case _0xa100('0x6d'):_0xd5efcc['Call_Result']=_0xa100('0x6e');break;case'rejected':_0xd5efcc[_0xa100('0x6f')]='Rejected';break;case _0xa100('0x70'):_0xd5efcc[_0xa100('0x6f')]='Abandoned';break;case _0xa100('0x71'):_0xd5efcc['Call_Result']='Timeout';default:}_0xd5efcc[_0xa100('0x72')]=(_0x57b7f6==='outbound'?moment(_0x2b476e[_0xa100('0x6b')])[_0xa100('0x30')](_0xa100('0x69')):moment(_0x2b476e['agentcalledAt'])['format'](_0xa100('0x69')))||moment()[_0xa100('0x30')](_0xa100('0x69'));_0xd5efcc[_0xa100('0x73')]=_0x57b7f6||_0xa100('0x74');_0xd5efcc=_[_0xa100('0x75')](_0xd5efcc,getCustomFields(_0x2551f1['Fields'],_0x2b476e));return request({'method':_0xa100('0x22'),'uri':'https://www.zohoapis.'+_0x57051a+_0xa100('0x76'),'headers':{'Authorization':_0xa100('0x33')+_0x41ac0b},'body':{'data':[_0xd5efcc]},'json':!![]})[_0xa100('0x3e')](function(_0x356429){if(_0x356429&&_0x356429[_0xa100('0x3f')][0x0][_0xa100('0x46')]===_0xa100('0x47')){logger[_0xa100('0x2e')](_0xa100('0x77'));return{'id':_0x356429[_0xa100('0x3f')][0x0][_0xa100('0x48')]['id']};}})['catch'](function(_0x531184){logger[_0xa100('0x2e')](_0xa100('0x78'),_0x531184[_0xa100('0x79')]);console[_0xa100('0x4a')]('err',_0x531184);});}exports[_0xa100('0x7a')]=function(_0x42082d,_0x14c787,_0x305ac9,_0x3ecbfe,_0x10991b,_0x380763){var _0x551fc3,_0x1f6636,_0x532ed1;_0x380763[_0xa100('0x7b')]=intUtil['stripTrailingSlash'](_0x380763[_0xa100('0x7b')]);_0x380763[_0xa100('0x7c')]=intUtil[_0xa100('0x7d')](_0x380763[_0xa100('0x7c')]);if(_0x10991b&&_0x10991b[_0xa100('0x7e')]){logger[_0xa100('0x2e')](_0xa100('0x7f'),_0xa100('0x80'));_0x14c787[_0xa100('0x81')]=_0x380763['serverUrl']+_0xa100('0x82')+_0x14c787['uniqueid']+_0xa100('0x83')+md5(_0x14c787[_0xa100('0x84')]);}else{_0x14c787[_0xa100('0x81')]='';}var _0x2d7f05=_0x380763[_0xa100('0x7b')]===_0xa100('0x85')?'eu':_0xa100('0x86');return getAccessToken(_0x380763)[_0xa100('0x3e')](function(_0x48c0bf){_0x532ed1=_0x48c0bf;return getUser(_0x532ed1,_0x2d7f05,_0x380763,_0x3ecbfe[_0xa100('0x37')]);})[_0xa100('0x3e')](function(_0x4f9c57){_0x551fc3=_0x4f9c57;logger['info'](_0xa100('0x87'),_0x551fc3['id']);return getEndUser(_0x532ed1,_0x2d7f05,_0x380763,_0x14c787[_0xa100('0x88')],_0x14c787['calleridnum'],_0x551fc3,_0x305ac9);})[_0xa100('0x3e')](function(_0x2f15a0){_0x1f6636=_0x2f15a0;return getCall(_0x532ed1,_0x2d7f05,_0x380763,_0x551fc3,_0x1f6636,_0x305ac9,_0x14c787,'Inbound');})[_0xa100('0x3e')](function(_0x15e820){if(_0x15e820){logger[_0xa100('0x2e')](_0xa100('0x89'),_0x15e820['id']);logger['info'](_0xa100('0x7f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x3ecbfe[_0xa100('0x19')]),_0xa100('0x8a'),{'uri':_0xa100('0x8b')+_0x380763['host']+_0xa100('0x8c')+_0x15e820['id']});}})['catch'](function(_0x146365){logger[_0xa100('0x2c')](_0xa100('0x7f'),JSON[_0xa100('0xd')](_0x146365));});};exports[_0xa100('0x8d')]=function(_0x4e809c,_0x265328,_0x7c8df9,_0x5d028d,_0xaee406,_0x304eff,_0x88c698){var _0x5b5650,_0x2b7d2f,_0x448f64;_0x304eff[_0xa100('0x7b')]=intUtil[_0xa100('0x7d')](_0x304eff['host']);_0x304eff[_0xa100('0x7c')]=intUtil[_0xa100('0x7d')](_0x304eff['serverUrl']);if(_0x88c698&&_0x88c698['recordingFormat']&&_0x88c698[_0xa100('0x8e')]!=='none'){logger['info'](_0xa100('0x8f'),_0xa100('0x80'));_0x265328[_0xa100('0x81')]=_0x304eff[_0xa100('0x7c')]+'/api/voice/recordings/'+_0x265328[_0xa100('0x84')]+_0xa100('0x83')+md5(_0x265328[_0xa100('0x84')]);}var _0x4ca645=_0x304eff['host']===_0xa100('0x85')?'eu':_0xa100('0x86');return getAccessToken(_0x304eff)[_0xa100('0x3e')](function(_0x36dd18){_0x448f64=_0x36dd18;return getUser(_0x448f64,_0x4ca645,_0x304eff,_0x5d028d[_0xa100('0x37')]);})[_0xa100('0x3e')](function(_0x414332){_0x5b5650=_0x414332;logger[_0xa100('0x2e')](_0xa100('0x87'),_0x5b5650['id']);return getEndUser(_0x448f64,_0x4ca645,_0x304eff,_0x265328[_0xa100('0x90')],_0x265328['destcalleridnum'],_0x5b5650,_0x7c8df9);})[_0xa100('0x3e')](function(_0x33858f){_0x2b7d2f=_0x33858f;return getCall(_0x448f64,_0x4ca645,_0x304eff,_0x5b5650,_0x2b7d2f,_0x7c8df9,_0x265328,_0xa100('0x91'));})[_0xa100('0x3e')](function(_0x2ebfff){if(_0x2ebfff){logger['info']('The\x20Call\x20ID\x20is:',_0x2ebfff['id']);logger[_0xa100('0x2e')](_0xa100('0x8f'),_0xa100('0x92'));emit(util[_0xa100('0x30')](_0xa100('0x93'),_0x5d028d[_0xa100('0x19')]),_0xa100('0x8a'),{'uri':_0xa100('0x8b')+_0x304eff['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x2ebfff['id']});}})[_0xa100('0x2b')](function(_0x56c374){logger['error']('[OUTBOUND]',JSON['stringify'](_0x56c374));});};exports[_0xa100('0x94')]=function(_0x3f1122,_0x54b431,_0x20f1b6,_0x16db63,_0x408177,_0x2f621c){var _0x34e504,_0x18ca76,_0x1c48a9;_0x2f621c[_0xa100('0x7b')]=intUtil[_0xa100('0x7d')](_0x2f621c[_0xa100('0x7b')]);_0x2f621c[_0xa100('0x7c')]=intUtil[_0xa100('0x7d')](_0x2f621c[_0xa100('0x7c')]);if(_0x408177&&_0x408177[_0xa100('0x7e')]){logger[_0xa100('0x2e')]('['+_0x54b431[_0xa100('0x95')][_0xa100('0x96')]()+']','Recording\x20is\x20enabled!');_0x54b431['recordingURL']=_0x2f621c[_0xa100('0x7c')]+'/api/voice/recordings/'+_0x54b431[_0xa100('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x54b431['uniqueid']);}else{_0x54b431[_0xa100('0x81')]='';}var _0x19fd4e=_0x2f621c[_0xa100('0x7b')]===_0xa100('0x85')?'eu':'com';return getAccessToken(_0x2f621c)[_0xa100('0x3e')](function(_0x10f162){_0x1c48a9=_0x10f162;return getUser(_0x1c48a9,_0x19fd4e,_0x2f621c);})[_0xa100('0x3e')](function(_0x5a4316){_0x34e504=_0x5a4316;logger[_0xa100('0x2e')]('The\x20User\x20ID\x20is:',_0x34e504['id']);return getEndUser(_0x1c48a9,_0x19fd4e,_0x2f621c,_0x54b431[_0xa100('0x88')],_0x54b431[_0xa100('0x97')],_0x34e504,_0x20f1b6);})[_0xa100('0x3e')](function(_0x21e0f9){_0x18ca76=_0x21e0f9;return getCall(_0x1c48a9,_0x19fd4e,_0x2f621c,_0x34e504,_0x18ca76,_0x20f1b6,_0x54b431,'Inbound');})[_0xa100('0x3e')](function(_0xc7f1a){if(_0xc7f1a){logger[_0xa100('0x2e')](_0xa100('0x89'),_0xc7f1a['id']);}})[_0xa100('0x2b')](function(_0x1ae83a){logger[_0xa100('0x2c')]('['+_0x54b431['lastevent'][_0xa100('0x96')]()+']',JSON['stringify'](_0x1ae83a));});}; \ 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 905a48d..198519e 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 _0x9306=['mustache','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x13822d,_0x16dc5b){var _0x2b729f=function(_0x50312c){while(--_0x50312c){_0x13822d['push'](_0x13822d['shift']());}};_0x2b729f(++_0x16dc5b);}(_0x9306,0x10c));var _0x6930=function(_0x318c9e,_0x164fb0){_0x318c9e=_0x318c9e-0x0;var _0x295579=_0x9306[_0x318c9e];return _0x295579;};'use strict';var util=require(_0x6930('0x0'));var sh=require(_0x6930('0x1'));var Mustache=require(_0x6930('0x2'));var logger=require(_0x6930('0x3'))(_0x6930('0x4'));exports[_0x6930('0x5')]=function(_0x5122fe,_0x2bc52c){var _0xfec865=_0x5122fe[_0x6930('0x6')]?_0x5122fe[_0x6930('0x6')]:_0x6930('0x7');var _0x360808=_0x5122fe[_0x6930('0x8')]?Mustache[_0x6930('0x9')](_0x5122fe[_0x6930('0x8')],_0x2bc52c):_0x2bc52c;sh[_0x6930('0x5')](_0x360808,function(_0x47b069,_0x50d0c5,_0x212166){if(_0x47b069!==0x0){logger[_0x6930('0xa')](util[_0x6930('0xb')](_0x6930('0xc'),_0xfec865,_0x360808,_0x47b069,_0x212166));}else{logger[_0x6930('0xd')](util[_0x6930('0xb')](_0x6930('0xe'),_0xfec865,_0x360808,_0x50d0c5));}});}; \ No newline at end of file +var _0x2707=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','exec','data2','Script','data3','error','format'];(function(_0x46ec32,_0x1e842f){var _0x338f60=function(_0x10e02c){while(--_0x10e02c){_0x46ec32['push'](_0x46ec32['shift']());}};_0x338f60(++_0x1e842f);}(_0x2707,0xea));var _0x7270=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x2707[_0x47fd36];return _0x21a0fc;};'use strict';var util=require('util');var sh=require(_0x7270('0x0'));var Mustache=require(_0x7270('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0x7270('0x2')]=function(_0x4382f1,_0x5e6ac5){var _0x1c3d1e=_0x4382f1[_0x7270('0x3')]?_0x4382f1[_0x7270('0x3')]:_0x7270('0x4');var _0x525344=_0x4382f1[_0x7270('0x5')]?Mustache['render'](_0x4382f1['data3'],_0x5e6ac5):_0x5e6ac5;sh['exec'](_0x525344,function(_0x522351,_0x25476b,_0xfb83ed){if(_0x522351!==0x0){logger[_0x7270('0x6')](util[_0x7270('0x7')](_0x7270('0x8'),_0x1c3d1e,_0x525344,_0x522351,_0xfb83ed));}else{logger[_0x7270('0x9')](util['format'](_0x7270('0xa'),_0x1c3d1e,_0x525344,_0x25476b));}});}; \ 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 e5d771c..569025e 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 _0x6cc8=['object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','data2','number','data5','headers','parse','render','data6','POST','PUT','data7','body','stack','error','info','format','stringify','isNil'];(function(_0x141a50,_0x47c7d5){var _0x12a37f=function(_0x459a8f){while(--_0x459a8f){_0x141a50['push'](_0x141a50['shift']());}};_0x12a37f(++_0x47c7d5);}(_0x6cc8,0xf6));var _0x86cc=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x6cc8[_0x187ee1];return _0x388160;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x86cc('0x0'));var Mustache=require(_0x86cc('0x1'));var logger=require(_0x86cc('0x2'))(_0x86cc('0x3'));exports[_0x86cc('0x4')]=function(_0x39522e,_0x87d730){var _0x5516ed,_0x102ef7;var _0x17b76d={'method':_0x39522e[_0x86cc('0x5')][_0x86cc('0x6')](),'uri':Mustache['render'](_0x39522e[_0x86cc('0x7')],_0x87d730),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x39522e['data5'])===_0x86cc('0x8')&&parseInt(_0x39522e[_0x86cc('0x9')])>=0x1&&parseInt(_0x39522e['data5'])<=0xa?parseInt(_0x39522e[_0x86cc('0x9')])*0x3e8:0x5*0x3e8};try{_0x17b76d[_0x86cc('0xa')]=_0x39522e['data6']?JSON[_0x86cc('0xb')](Mustache[_0x86cc('0xc')](_0x39522e[_0x86cc('0xd')],_0x87d730)):{};}catch(_0xd8de8b){logger['error'](_0xd8de8b['stack']);}switch(_0x39522e['data1'][_0x86cc('0x6')]()){case'GET':case'DELETE':_0x5516ed=null;_0x17b76d['qs']=_0x87d730;break;case _0x86cc('0xe'):case _0x86cc('0xf'):if(_0x39522e[_0x86cc('0x10')]){try{_0x5516ed=JSON[_0x86cc('0xb')](Mustache[_0x86cc('0xc')](_0x39522e[_0x86cc('0x10')],_0x87d730));_0x17b76d[_0x86cc('0x11')]=_0x5516ed;}catch(_0x307a19){logger['error'](_0x307a19[_0x86cc('0x12')]);logger[_0x86cc('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x5516ed=_0x87d730;_0x17b76d[_0x86cc('0x11')]=_0x5516ed;}break;}logger[_0x86cc('0x14')](util[_0x86cc('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x39522e[_0x86cc('0x5')],_0x39522e[_0x86cc('0x7')],JSON[_0x86cc('0x16')](_0x17b76d)));rp(_0x17b76d)['then'](function(_0x5afb60){_0x5516ed=!_[_0x86cc('0x17')](_0x5516ed)?',\x20request\x20body:\x20'+_0x5516ed:'';_0x102ef7=typeof _0x5afb60[_0x86cc('0x11')]===_0x86cc('0x18')?JSON[_0x86cc('0x16')](_0x5afb60['body']):_0x5afb60['body'];logger['info'](util[_0x86cc('0x15')](_0x86cc('0x19'),_0x39522e[_0x86cc('0x5')],_0x39522e[_0x86cc('0x7')],_0x5afb60[_0x86cc('0x1a')],_0x102ef7));})[_0x86cc('0x1b')](function(_0x5ccfab){logger[_0x86cc('0x13')](util[_0x86cc('0x15')](_0x86cc('0x1c'),_0x39522e[_0x86cc('0x5')],_0x39522e[_0x86cc('0x7')],_0x5ccfab[_0x86cc('0x1a')],_0x5ccfab[_0x86cc('0x1d')],_0x5ccfab['message']));});}; \ No newline at end of file +var _0x0e3a=['catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','headers','data6','parse','stack','GET','DELETE','POST','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','object','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode'];(function(_0x4eb4ad,_0x183488){var _0x1312b2=function(_0x19aabe){while(--_0x19aabe){_0x4eb4ad['push'](_0x4eb4ad['shift']());}};_0x1312b2(++_0x183488);}(_0x0e3a,0xb8));var _0xa0e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0e3a[_0x57b54c];return _0x59cc19;};'use strict';var rp=require(_0xa0e3('0x0'));var util=require('util');var _=require(_0xa0e3('0x1'));var Mustache=require(_0xa0e3('0x2'));var logger=require(_0xa0e3('0x3'))(_0xa0e3('0x4'));exports[_0xa0e3('0x5')]=function(_0x5271f0,_0xb9d19d){var _0x34d72b,_0x287654;var _0x13cf99={'method':_0x5271f0[_0xa0e3('0x6')][_0xa0e3('0x7')](),'uri':Mustache[_0xa0e3('0x8')](_0x5271f0[_0xa0e3('0x9')],_0xb9d19d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5271f0['data5'])==='number'&&parseInt(_0x5271f0[_0xa0e3('0xa')])>=0x1&&parseInt(_0x5271f0['data5'])<=0xa?parseInt(_0x5271f0[_0xa0e3('0xa')])*0x3e8:0x5*0x3e8};try{_0x13cf99[_0xa0e3('0xb')]=_0x5271f0[_0xa0e3('0xc')]?JSON[_0xa0e3('0xd')](Mustache[_0xa0e3('0x8')](_0x5271f0[_0xa0e3('0xc')],_0xb9d19d)):{};}catch(_0x1cf3ef){logger['error'](_0x1cf3ef[_0xa0e3('0xe')]);}switch(_0x5271f0[_0xa0e3('0x6')]['toUpperCase']()){case _0xa0e3('0xf'):case _0xa0e3('0x10'):_0x34d72b=null;_0x13cf99['qs']=_0xb9d19d;break;case _0xa0e3('0x11'):case'PUT':if(_0x5271f0[_0xa0e3('0x12')]){try{_0x34d72b=JSON[_0xa0e3('0xd')](Mustache[_0xa0e3('0x8')](_0x5271f0[_0xa0e3('0x12')],_0xb9d19d));_0x13cf99[_0xa0e3('0x13')]=_0x34d72b;}catch(_0x394bdd){logger['error'](_0x394bdd[_0xa0e3('0xe')]);logger[_0xa0e3('0x14')](_0xa0e3('0x15'));}}else{_0x34d72b=_0xb9d19d;_0x13cf99[_0xa0e3('0x13')]=_0x34d72b;}break;}logger['info'](util[_0xa0e3('0x16')](_0xa0e3('0x17'),_0x5271f0[_0xa0e3('0x6')],_0x5271f0[_0xa0e3('0x9')],JSON['stringify'](_0x13cf99)));rp(_0x13cf99)[_0xa0e3('0x18')](function(_0x734705){_0x34d72b=!_[_0xa0e3('0x19')](_0x34d72b)?_0xa0e3('0x1a')+_0x34d72b:'';_0x287654=typeof _0x734705[_0xa0e3('0x13')]===_0xa0e3('0x1b')?JSON[_0xa0e3('0x1c')](_0x734705['body']):_0x734705[_0xa0e3('0x13')];logger[_0xa0e3('0x1d')](util[_0xa0e3('0x16')](_0xa0e3('0x1e'),_0x5271f0['data1'],_0x5271f0[_0xa0e3('0x9')],_0x734705[_0xa0e3('0x1f')],_0x287654));})[_0xa0e3('0x20')](function(_0xf7006d){logger[_0xa0e3('0x14')](util[_0xa0e3('0x16')](_0xa0e3('0x21'),_0x5271f0[_0xa0e3('0x6')],_0x5271f0[_0xa0e3('0x9')],_0xf7006d[_0xa0e3('0x1f')],_0xf7006d[_0xa0e3('0x22')],_0xf7006d[_0xa0e3('0x23')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 9d2f2cd..e301150 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 _0x1065=['../../config/logger','client','http','Request','request','then','rpc','routing','error','message','result','catch','jayson/promise','bluebird'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x1065,0x7c));var _0x5106=function(_0x5703a9,_0x5ab7a9){_0x5703a9=_0x5703a9-0x0;var _0xcd7af5=_0x1065[_0x5703a9];return _0xcd7af5;};'use strict';var jayson=require(_0x5106('0x0'));var BPromise=require(_0x5106('0x1'));var logger=require(_0x5106('0x2'))('routing');var client=jayson[_0x5106('0x3')][_0x5106('0x4')]({'port':0x2329});client[_0x5106('0x5')]=function(_0x192e5b,_0x3b0e1c){return new BPromise(function(_0x2a2733,_0x28ea39){return client[_0x5106('0x6')](_0x192e5b,_0x3b0e1c)[_0x5106('0x7')](function(_0x4f1506){logger['debug'](_0x5106('0x8'),_0x5106('0x9'),_0x192e5b,_0x3b0e1c,_0x4f1506);if(_0x4f1506[_0x5106('0xa')]){logger[_0x5106('0xa')](_0x5106('0x8'),'routing',_0x192e5b,_0x4f1506['error'][_0x5106('0xb')],_0x3b0e1c);return _0x28ea39(_0x4f1506['error'][_0x5106('0xb')]);}else{return _0x2a2733(_0x4f1506[_0x5106('0xc')]);}})[_0x5106('0xd')](function(_0x18a1dc){logger[_0x5106('0xa')]('rpc',_0x5106('0x9'),_0x192e5b,_0x18a1dc,_0x3b0e1c);return _0x28ea39(_0x18a1dc);});});};module['exports']=client; \ No newline at end of file +var _0x58c4=['http','Request','request','then','debug','routing','error','rpc','message','catch','exports','jayson/promise','bluebird','../../config/logger','client'];(function(_0x460666,_0x24bfa0){var _0x555cbf=function(_0x3b4743){while(--_0x3b4743){_0x460666['push'](_0x460666['shift']());}};_0x555cbf(++_0x24bfa0);}(_0x58c4,0x1cd));var _0x458c=function(_0x406a2a,_0x1af57b){_0x406a2a=_0x406a2a-0x0;var _0x52a293=_0x58c4[_0x406a2a];return _0x52a293;};'use strict';var jayson=require(_0x458c('0x0'));var BPromise=require(_0x458c('0x1'));var logger=require(_0x458c('0x2'))('routing');var client=jayson[_0x458c('0x3')][_0x458c('0x4')]({'port':0x2329});client[_0x458c('0x5')]=function(_0x42d5db,_0x40b216){return new BPromise(function(_0xe0770f,_0x1559d1){return client[_0x458c('0x6')](_0x42d5db,_0x40b216)[_0x458c('0x7')](function(_0x396c88){logger[_0x458c('0x8')]('rpc',_0x458c('0x9'),_0x42d5db,_0x40b216,_0x396c88);if(_0x396c88[_0x458c('0xa')]){logger[_0x458c('0xa')](_0x458c('0xb'),_0x458c('0x9'),_0x42d5db,_0x396c88[_0x458c('0xa')][_0x458c('0xc')],_0x40b216);return _0x1559d1(_0x396c88[_0x458c('0xa')]['message']);}else{return _0xe0770f(_0x396c88['result']);}})[_0x458c('0xd')](function(_0x109f7d){logger['error'](_0x458c('0xb'),'routing',_0x42d5db,_0x109f7d,_0x40b216);return _0x1559d1(_0x109f7d);});});};module[_0x458c('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 1745dde..f2996ca 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 _0xac4a=['./rpc/setting','../../config/logger','email','then','getMailAccounts','initMailAccounts','refresh','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xac4a,0x16c));var _0xaac4=function(_0x4f1497,_0xd4de37){_0x4f1497=_0x4f1497-0x0;var _0xb9b325=_0xac4a[_0x4f1497];return _0xb9b325;};'use strict';var server=require(_0xaac4('0x0'));var Realtime=require(_0xaac4('0x1'));var EmailChannel=require(_0xaac4('0x2'));var mailAccount=require(_0xaac4('0x3'));var setting=require(_0xaac4('0x4'));var logger=require(_0xaac4('0x5'))(_0xaac4('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xaac4('0x7')](mailAccount[_0xaac4('0x8')]())['then'](realtime[_0xaac4('0x9')]())[_0xaac4('0x7')](function(){email[_0xaac4('0xa')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0xaac4('0x7')](function(){return initRealtime();})[_0xaac4('0x7')](function(){return setting[_0xaac4('0xb')]();})['then'](function(_0x2f7bf9){return setInterval(initRealtime,_0x2f7bf9[_0xaac4('0xc')]*0x3e8);})[_0xaac4('0xd')](function(_0x2c5b69){logger[_0xaac4('0xe')](_0xaac4('0xf'),_0x2c5b69);});}main(); \ No newline at end of file +var _0x76ad=['Email\x20service\x20initialization','./server','./realtime','./rpc/mailAccount','../../config/logger','resolve','then','getMailAccounts','refresh','listen','getSettings','catch'];(function(_0x4c72f8,_0x112a58){var _0x3fa6b6=function(_0x4d33e9){while(--_0x4d33e9){_0x4c72f8['push'](_0x4c72f8['shift']());}};_0x3fa6b6(++_0x112a58);}(_0x76ad,0x1c9));var _0xd76a=function(_0x30a1b6,_0x158e1e){_0x30a1b6=_0x30a1b6-0x0;var _0x304819=_0x76ad[_0x30a1b6];return _0x304819;};'use strict';var server=require(_0xd76a('0x0'));var Realtime=require(_0xd76a('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xd76a('0x2'));var setting=require('./rpc/setting');var logger=require(_0xd76a('0x3'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xd76a('0x4')]()[_0xd76a('0x5')](mailAccount[_0xd76a('0x6')]())['then'](realtime['initMailAccounts']())[_0xd76a('0x5')](function(){email[_0xd76a('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xd76a('0x8')](realtime,email)[_0xd76a('0x5')](function(){return initRealtime();})[_0xd76a('0x5')](function(){return setting[_0xd76a('0x9')]();})[_0xd76a('0x5')](function(_0x43243e){return setInterval(initRealtime,_0x43243e['loginMailFrequency']*0x3e8);})[_0xd76a('0xa')](function(_0x593dc2){logger['error'](_0xd76a('0xb'),_0x593dc2);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 18236a1..2bedca6 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 _0xe0fa=['prototype','hasOwnProperty','service','provider','custom','email','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','connected','name','total','firstName','lastName','from','notify','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','then','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','key','active','Imap','status','messageStatus','isNil'];(function(_0x126fe0,_0x17a187){var _0x5af076=function(_0x1e4cbb){while(--_0x1e4cbb){_0x126fe0['push'](_0x126fe0['shift']());}};_0x5af076(++_0x17a187);}(_0xe0fa,0x1a0));var _0xae0f=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xe0fa[_0x2112d4];return _0x434972;};'use strict';var _=require(_0xae0f('0x0'));var moment=require(_0xae0f('0x1'));var BPromise=require(_0xae0f('0x2'));var md5=require(_0xae0f('0x3'));var Redis=require(_0xae0f('0x4'));var config=require(_0xae0f('0x5'));var logger=require(_0xae0f('0x6'))('email');config[_0xae0f('0x7')]=_[_0xae0f('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xae0f('0x9'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require(_0xae0f('0xa'));var mailAccount=require(_0xae0f('0xb'));var md5Accounts={};function EmailChannel(_0x2a38cd){logger[_0xae0f('0xc')](_0xae0f('0xd'));this[_0xae0f('0xe')]=_0x2a38cd[_0xae0f('0xe')];this[_0xae0f('0xf')]={};this[_0xae0f('0x10')]=new EmailSmtp();}EmailChannel['prototype'][_0xae0f('0x11')]=function(_0x4de74d){var _0x2a8433=this[_0xae0f('0xe')][_0x4de74d];var _0x193b02={'id':_0x2a8433['id'],'name':_0x2a8433['name'],'key':_0x2a8433[_0xae0f('0x12')],'active':_0x2a8433[_0xae0f('0x13')],'Imap':{'status':_0x2a8433[_0xae0f('0x14')][_0xae0f('0x15')],'messageStatus':_0x2a8433['Imap'][_0xae0f('0x16')],'total':_0x2a8433['Imap']['total']}};if(_[_0xae0f('0x17')](md5Accounts[_0x4de74d])){md5Accounts[_0x4de74d]={};}var _0x9bd453=md5(JSON['stringify'](_0x193b02));if(md5Accounts[_0x4de74d][_0xae0f('0x3')]!==_0x9bd453){md5Accounts[_0x4de74d][_0xae0f('0x3')]=_0x9bd453;io[_0xae0f('0x11')]('mailAccount:update',_0x193b02);}};EmailChannel[_0xae0f('0x18')]['refresh']=function(_0x26f3f3){for(var _0x49b6c6 in _0x26f3f3){if(_0x26f3f3[_0xae0f('0x19')](_0x49b6c6)){if(_0x26f3f3[_0x49b6c6][_0xae0f('0x14')]&&_0x26f3f3[_0x49b6c6]['active']){var _0x350a88=_0x26f3f3[_0x49b6c6][_0xae0f('0x14')];if(!_0x350a88[_0xae0f('0x1a')]&&_0x26f3f3[_0x49b6c6][_0xae0f('0x1b')]!==_0xae0f('0x1c'))_0x350a88[_0xae0f('0x1a')]=_0x26f3f3[_0x49b6c6][_0xae0f('0x1b')];if(!this[_0xae0f('0xf')][_0xae0f('0x19')](_0x350a88['id'])){this[_0xae0f('0xf')][_0x350a88['id']]=new EmailImap(_0x350a88,_0x26f3f3[_0x49b6c6][_0xae0f('0x1d')]);this[_0xae0f('0xf')][_0x350a88['id']]['on'](_0xae0f('0x1e'),this[_0xae0f('0x1f')][_0xae0f('0x20')](this,_0x49b6c6));this[_0xae0f('0xf')][_0x350a88['id']]['on'](_0xae0f('0x1d'),this[_0xae0f('0x21')]['bind'](this,_0x49b6c6));this[_0xae0f('0xf')][_0x350a88['id']]['on'](_0xae0f('0x22'),this[_0xae0f('0x23')][_0xae0f('0x20')](this,_0x49b6c6));this[_0xae0f('0xf')][_0x350a88['id']]['on'](_0xae0f('0x24'),this[_0xae0f('0x25')][_0xae0f('0x20')](this,_0x49b6c6));}}else{if(_[_0xae0f('0x17')](this[_0xae0f('0xe')][_0x49b6c6][_0xae0f('0x14')])){this['mailAccounts'][_0x49b6c6][_0xae0f('0x14')]={};}this[_0xae0f('0xe')][_0x49b6c6][_0xae0f('0x14')][_0xae0f('0x15')]=_0xae0f('0x26');this[_0xae0f('0xe')][_0x49b6c6]['Imap'][_0xae0f('0x16')]='';this[_0xae0f('0x11')](_0x49b6c6);}}}};EmailChannel[_0xae0f('0x18')][_0xae0f('0x1f')]=function(_0x47a242,_0x1c2634){if(this[_0xae0f('0xe')][_0x47a242]){this[_0xae0f('0xe')][_0x47a242][_0xae0f('0x14')][_0xae0f('0x15')]=_0xae0f('0x27');this['mailAccounts'][_0x47a242][_0xae0f('0x14')][_0xae0f('0x16')]=_0x1c2634[_0xae0f('0x28')];if(_0x1c2634['messages']){this[_0xae0f('0xe')][_0x47a242][_0xae0f('0x14')]['total']=_0x1c2634['messages'][_0xae0f('0x29')];}return this[_0xae0f('0x11')](_0x47a242);}};EmailChannel[_0xae0f('0x18')][_0xae0f('0x21')]=function(_0x2c5aa0,_0x6816d0){logger[_0xae0f('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x6816d0[_0xae0f('0x2a')],_0x6816d0[_0xae0f('0x2b')],_0x6816d0[_0xae0f('0x2c')],_0x2c5aa0);if(this[_0xae0f('0xe')][_0x2c5aa0]){return mailAccount[_0xae0f('0x2d')](_0x2c5aa0,_0x6816d0)['then'](function(_0x19e86a){if(_0x19e86a){logger[_0xae0f('0xc')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0xfe4210){logger[_0xae0f('0x24')](_0xae0f('0x2e'),JSON['stringify'](_0xfe4210));});}};EmailChannel[_0xae0f('0x18')][_0xae0f('0x23')]=function(_0x259383){if(this['mailAccounts'][_0x259383]&&this[_0xae0f('0xe')][_0x259383][_0xae0f('0x14')]){if(this['imapAccounts'][this[_0xae0f('0xe')][_0x259383]['Imap']['id']]){delete this[_0xae0f('0xf')][this['mailAccounts'][_0x259383][_0xae0f('0x14')]['id']];}this['mailAccounts'][_0x259383]['Imap'][_0xae0f('0x2f')]=moment();this[_0xae0f('0x11')](_0x259383);}};EmailChannel['prototype'][_0xae0f('0x25')]=function(_0x4a5e30,_0x40be39){if(this['mailAccounts'][_0x4a5e30]){this['mailAccounts'][_0x4a5e30][_0xae0f('0x14')][_0xae0f('0x15')]=_0xae0f('0x24');this['mailAccounts'][_0x4a5e30][_0xae0f('0x14')][_0xae0f('0x16')]=_0x40be39;return this['emit'](_0x4a5e30);}};EmailChannel[_0xae0f('0x18')][_0xae0f('0x30')]=function(_0x233262,_0x16f0a0){return this[_0xae0f('0x10')][_0xae0f('0x31')](_0x233262,_0x16f0a0);};EmailChannel[_0xae0f('0x18')][_0xae0f('0x32')]=function(_0x34a603){var _0x2d178d=this;if(this[_0xae0f('0xe')][_0x34a603['id']]){if(_[_0xae0f('0x17')](this['mailAccounts'][_0x34a603['id']]['Smtp'])){this[_0xae0f('0xe')][_0x34a603['id']][_0xae0f('0x33')]={};}this[_0xae0f('0xe')][_0x34a603['id']][_0xae0f('0x33')][_0xae0f('0x2f')]=moment();return new BPromise(function(_0x1777a9,_0x50f058){return _0x2d178d[_0xae0f('0x10')]['verify'](_0x34a603)[_0xae0f('0x34')](function(_0x1e53c8){_0x2d178d[_0xae0f('0xe')][_0x34a603['id']][_0xae0f('0x33')][_0xae0f('0x15')]='verified';_0x2d178d[_0xae0f('0xe')][_0x34a603['id']][_0xae0f('0x33')][_0xae0f('0x16')]='';_0x2d178d[_0xae0f('0x11')](_0x34a603['id']);_0x1777a9(_0x1e53c8);})['catch'](function(_0x37221f){_0x2d178d[_0xae0f('0xe')][_0x34a603['id']][_0xae0f('0x33')][_0xae0f('0x15')]='error';_0x2d178d[_0xae0f('0xe')][_0x34a603['id']][_0xae0f('0x33')]['messageStatus']=_0x37221f;_0x2d178d['emit'](_0x34a603['id']);_0x50f058(_0x37221f);});});}return this[_0xae0f('0x10')][_0xae0f('0x35')](_0x34a603);};module[_0xae0f('0x36')]=EmailChannel; \ No newline at end of file +var _0x40c9=['ioredis','../../../config/environment','../../../config/logger','email','redis','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','custom','provider','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','disabled','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','then','verify','moment','md5'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x40c9,0xde));var _0x940c=function(_0x186787,_0xc29d48){_0x186787=_0x186787-0x0;var _0x5e0f6a=_0x40c9[_0x186787];return _0x5e0f6a;};'use strict';var _=require('lodash');var moment=require(_0x940c('0x0'));var BPromise=require('bluebird');var md5=require(_0x940c('0x1'));var Redis=require(_0x940c('0x2'));var config=require(_0x940c('0x3'));var logger=require(_0x940c('0x4'))(_0x940c('0x5'));config['redis']=_['defaults'](config[_0x940c('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x940c('0x7'))(new Redis(config['redis']));var EmailImap=require(_0x940c('0x8'));var EmailSmtp=require(_0x940c('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x2c5bac){logger[_0x940c('0xa')](_0x940c('0xb'));this['mailAccounts']=_0x2c5bac[_0x940c('0xc')];this[_0x940c('0xd')]={};this[_0x940c('0xe')]=new EmailSmtp();}EmailChannel[_0x940c('0xf')][_0x940c('0x10')]=function(_0x31b4ef){var _0x108510=this['mailAccounts'][_0x31b4ef];var _0x1cdcb4={'id':_0x108510['id'],'name':_0x108510[_0x940c('0x11')],'key':_0x108510[_0x940c('0x12')],'active':_0x108510[_0x940c('0x13')],'Imap':{'status':_0x108510[_0x940c('0x14')][_0x940c('0x15')],'messageStatus':_0x108510[_0x940c('0x14')][_0x940c('0x16')],'total':_0x108510[_0x940c('0x14')]['total']}};if(_[_0x940c('0x17')](md5Accounts[_0x31b4ef])){md5Accounts[_0x31b4ef]={};}var _0x307c78=md5(JSON[_0x940c('0x18')](_0x1cdcb4));if(md5Accounts[_0x31b4ef][_0x940c('0x1')]!==_0x307c78){md5Accounts[_0x31b4ef][_0x940c('0x1')]=_0x307c78;io[_0x940c('0x10')](_0x940c('0x19'),_0x1cdcb4);}};EmailChannel[_0x940c('0xf')][_0x940c('0x1a')]=function(_0x39a552){for(var _0x57442c in _0x39a552){if(_0x39a552[_0x940c('0x1b')](_0x57442c)){if(_0x39a552[_0x57442c]['Imap']&&_0x39a552[_0x57442c][_0x940c('0x13')]){var _0x3f65a7=_0x39a552[_0x57442c][_0x940c('0x14')];if(!_0x3f65a7[_0x940c('0x1c')]&&_0x39a552[_0x57442c]['provider']!==_0x940c('0x1d'))_0x3f65a7['service']=_0x39a552[_0x57442c][_0x940c('0x1e')];if(!this['imapAccounts'][_0x940c('0x1b')](_0x3f65a7['id'])){this[_0x940c('0xd')][_0x3f65a7['id']]=new EmailImap(_0x3f65a7,_0x39a552[_0x57442c][_0x940c('0x5')]);this['imapAccounts'][_0x3f65a7['id']]['on'](_0x940c('0x1f'),this[_0x940c('0x20')][_0x940c('0x21')](this,_0x57442c));this['imapAccounts'][_0x3f65a7['id']]['on'](_0x940c('0x5'),this[_0x940c('0x22')][_0x940c('0x21')](this,_0x57442c));this[_0x940c('0xd')][_0x3f65a7['id']]['on'](_0x940c('0x23'),this[_0x940c('0x24')][_0x940c('0x21')](this,_0x57442c));this[_0x940c('0xd')][_0x3f65a7['id']]['on'](_0x940c('0x25'),this['handleImapError'][_0x940c('0x21')](this,_0x57442c));}}else{if(_[_0x940c('0x17')](this['mailAccounts'][_0x57442c][_0x940c('0x14')])){this[_0x940c('0xc')][_0x57442c]['Imap']={};}this['mailAccounts'][_0x57442c]['Imap']['status']=_0x940c('0x26');this['mailAccounts'][_0x57442c][_0x940c('0x14')][_0x940c('0x16')]='';this['emit'](_0x57442c);}}}};EmailChannel['prototype'][_0x940c('0x20')]=function(_0x2589ed,_0x1977d5){if(this['mailAccounts'][_0x2589ed]){this[_0x940c('0xc')][_0x2589ed][_0x940c('0x14')][_0x940c('0x15')]='connected';this[_0x940c('0xc')][_0x2589ed][_0x940c('0x14')]['messageStatus']=_0x1977d5[_0x940c('0x11')];if(_0x1977d5[_0x940c('0x27')]){this[_0x940c('0xc')][_0x2589ed][_0x940c('0x14')][_0x940c('0x28')]=_0x1977d5['messages'][_0x940c('0x28')];}return this['emit'](_0x2589ed);}};EmailChannel[_0x940c('0xf')][_0x940c('0x22')]=function(_0x3199b1,_0x3d62d6){logger[_0x940c('0xa')](_0x940c('0x29'),_0x3d62d6[_0x940c('0x2a')],_0x3d62d6[_0x940c('0x2b')],_0x3d62d6['from'],_0x3199b1);if(this[_0x940c('0xc')][_0x3199b1]){return mailAccount[_0x940c('0x2c')](_0x3199b1,_0x3d62d6)['then'](function(_0x5268c1){if(_0x5268c1){logger[_0x940c('0xa')](_0x940c('0x2d'));}})[_0x940c('0x2e')](function(_0x496899){logger['error'](_0x940c('0x2f'),JSON[_0x940c('0x18')](_0x496899));});}};EmailChannel[_0x940c('0xf')][_0x940c('0x24')]=function(_0x1c41fd){if(this[_0x940c('0xc')][_0x1c41fd]&&this[_0x940c('0xc')][_0x1c41fd][_0x940c('0x14')]){if(this[_0x940c('0xd')][this[_0x940c('0xc')][_0x1c41fd][_0x940c('0x14')]['id']]){delete this[_0x940c('0xd')][this[_0x940c('0xc')][_0x1c41fd]['Imap']['id']];}this[_0x940c('0xc')][_0x1c41fd]['Imap'][_0x940c('0x30')]=moment();this[_0x940c('0x10')](_0x1c41fd);}};EmailChannel['prototype'][_0x940c('0x31')]=function(_0x3a738f,_0x2ca7ab){if(this[_0x940c('0xc')][_0x3a738f]){this[_0x940c('0xc')][_0x3a738f][_0x940c('0x14')][_0x940c('0x15')]=_0x940c('0x25');this[_0x940c('0xc')][_0x3a738f][_0x940c('0x14')][_0x940c('0x16')]=_0x2ca7ab;return this[_0x940c('0x10')](_0x3a738f);}};EmailChannel[_0x940c('0xf')][_0x940c('0x32')]=function(_0x492958,_0x4257e1){return this['smtp'][_0x940c('0x33')](_0x492958,_0x4257e1);};EmailChannel[_0x940c('0xf')][_0x940c('0x34')]=function(_0x566e9f){var _0x2b03db=this;if(this[_0x940c('0xc')][_0x566e9f['id']]){if(_[_0x940c('0x17')](this[_0x940c('0xc')][_0x566e9f['id']][_0x940c('0x35')])){this[_0x940c('0xc')][_0x566e9f['id']][_0x940c('0x35')]={};}this[_0x940c('0xc')][_0x566e9f['id']][_0x940c('0x35')][_0x940c('0x30')]=moment();return new BPromise(function(_0x19a6d8,_0x19071e){return _0x2b03db[_0x940c('0xe')]['verify'](_0x566e9f)[_0x940c('0x36')](function(_0x180fc8){_0x2b03db[_0x940c('0xc')][_0x566e9f['id']][_0x940c('0x35')][_0x940c('0x15')]='verified';_0x2b03db[_0x940c('0xc')][_0x566e9f['id']][_0x940c('0x35')][_0x940c('0x16')]='';_0x2b03db[_0x940c('0x10')](_0x566e9f['id']);_0x19a6d8(_0x180fc8);})[_0x940c('0x2e')](function(_0x254d1e){_0x2b03db[_0x940c('0xc')][_0x566e9f['id']][_0x940c('0x35')][_0x940c('0x15')]='error';_0x2b03db['mailAccounts'][_0x566e9f['id']][_0x940c('0x35')][_0x940c('0x16')]=_0x254d1e;_0x2b03db[_0x940c('0x10')](_0x566e9f['id']);_0x19071e(_0x254d1e);});});}return this[_0x940c('0xe')][_0x940c('0x37')](_0x566e9f);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index c278f52..4fdeb6a 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 _0xb1c7=['stringify','textCode','hasOwnProperty','lodash','util','imap','mailparser','iconv','Iconv','events','EventEmitter','../../../config/logger','mailbox','account','getAccount','ready','handleReady','once','end','handleEnd','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','data5','password','authentication','email','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleMessageAttributes','handleSimpleParser','parser'];(function(_0x55046e,_0x172d80){var _0x2b7ac3=function(_0x533cab){while(--_0x533cab){_0x55046e['push'](_0x55046e['shift']());}};_0x2b7ac3(++_0x172d80);}(_0xb1c7,0x183));var _0x7b1c=function(_0x560d2a,_0x4a9f54){_0x560d2a=_0x560d2a-0x0;var _0x3df62d=_0xb1c7[_0x560d2a];return _0x3df62d;};'use strict';var _=require(_0x7b1c('0x0'));var util=require(_0x7b1c('0x1'));var Imap=require(_0x7b1c('0x2'));var simpleParser=require(_0x7b1c('0x3'))['simpleParser'];var Iconv=require(_0x7b1c('0x4'))[_0x7b1c('0x5')];var EventEmitter=require(_0x7b1c('0x6'))[_0x7b1c('0x7')];var utils=require('./utils');var logger=require(_0x7b1c('0x8'))('email');function EmailImap(_0x4a02b4,_0x2116d3){this[_0x7b1c('0x9')]=_0x4a02b4[_0x7b1c('0x9')];this[_0x7b1c('0xa')]=this[_0x7b1c('0xb')](_0x4a02b4,_0x2116d3);this[_0x7b1c('0x2')]=new Imap(this[_0x7b1c('0xa')]);this[_0x7b1c('0x2')]['once'](_0x7b1c('0xc'),this[_0x7b1c('0xd')]['bind'](this));this[_0x7b1c('0x2')][_0x7b1c('0xe')](_0x7b1c('0xf'),this[_0x7b1c('0x10')][_0x7b1c('0x11')](this));this[_0x7b1c('0x2')]['on'](_0x7b1c('0x12'),this[_0x7b1c('0x13')][_0x7b1c('0x11')](this));this[_0x7b1c('0x2')][_0x7b1c('0x14')]();}util[_0x7b1c('0x15')](EmailImap,EventEmitter);EmailImap[_0x7b1c('0x16')][_0x7b1c('0xb')]=function(_0x5eebb3,_0x547009){var _0x826363={'connTimeout':_0x5eebb3['connTimeout']?_0x5eebb3[_0x7b1c('0x17')]*0x3e8:0x2710,'authTimeout':_0x5eebb3['authTimeout']?_0x5eebb3[_0x7b1c('0x18')]*0x3e8:0x1388};if(_0x5eebb3[_0x7b1c('0x19')]){_0x826363['user']=_0x5eebb3[_0x7b1c('0x1a')];if(_0x5eebb3[_0x7b1c('0x1b')]){_0x826363[_0x7b1c('0x1c')]=utils[_0x7b1c('0x1d')](_0x5eebb3['CloudProvider'][_0x7b1c('0x1e')],_0x5eebb3[_0x7b1c('0x1a')]);}else{_0x826363[_0x7b1c('0x1f')]=_0x5eebb3[_0x7b1c('0x1f')];}}else{if(_0x5eebb3[_0x7b1c('0x20')]){_0x826363[_0x7b1c('0x1a')]=_0x5eebb3[_0x7b1c('0x1a')];_0x826363['password']=_0x5eebb3[_0x7b1c('0x1f')];}}_0x826363[_0x7b1c('0x21')]=_0x547009||_0x5eebb3[_0x7b1c('0x1a')]||_0x7b1c('0x22');_0x826363[_0x7b1c('0x23')]=_0x5eebb3['host'];_0x826363[_0x7b1c('0x24')]=_0x5eebb3[_0x7b1c('0x24')]||0x3e1;if(_0x5eebb3[_0x7b1c('0x25')]){_0x826363[_0x7b1c('0x25')]=!![];}else{_0x826363[_0x7b1c('0x25')]=![];_0x826363[_0x7b1c('0x26')]=_0x7b1c('0x27');}return _0x826363;};EmailImap[_0x7b1c('0x16')]['handleReady']=function(){this[_0x7b1c('0x2')][_0x7b1c('0x28')](this[_0x7b1c('0x9')],![],this[_0x7b1c('0x29')][_0x7b1c('0x11')](this));};EmailImap['prototype'][_0x7b1c('0x29')]=function(_0x1ed593,_0x45f4d2){if(_0x1ed593){this['handleError'](_0x1ed593,!![]);}else{this[_0x7b1c('0x2a')](_0x7b1c('0x2b'),_0x45f4d2);this[_0x7b1c('0x2c')]();}};EmailImap[_0x7b1c('0x16')][_0x7b1c('0x2d')]=function(_0xdcf679){if(_0xdcf679){this['handleError'](_0xdcf679,!![]);}else{this[_0x7b1c('0x2')][_0x7b1c('0xf')]();}};EmailImap[_0x7b1c('0x16')][_0x7b1c('0x2c')]=function(){this[_0x7b1c('0x2')][_0x7b1c('0x2e')](['UNSEEN'],this[_0x7b1c('0x2f')][_0x7b1c('0x11')](this));};EmailImap[_0x7b1c('0x16')][_0x7b1c('0x2f')]=function(_0xe28f9e,_0x330ff6){if(_0xe28f9e){this[_0x7b1c('0x13')](_0xe28f9e,!![]);}else{if(_0x330ff6[_0x7b1c('0x30')]){try{var _0x33e355=this[_0x7b1c('0x2')]['fetch'](_0x330ff6,{'bodies':'','markSeen':!![]});_0x33e355['on'](_0x7b1c('0x31'),this[_0x7b1c('0x32')][_0x7b1c('0x11')](this));_0x33e355[_0x7b1c('0xe')](_0x7b1c('0x12'),this[_0x7b1c('0x33')][_0x7b1c('0x11')](this));_0x33e355[_0x7b1c('0xe')](_0x7b1c('0xf'),this[_0x7b1c('0x34')][_0x7b1c('0x11')](this));}catch(_0x246e49){logger['error'](_0x246e49);}}else{this['imap'][_0x7b1c('0x35')](!![],this[_0x7b1c('0x2d')][_0x7b1c('0x11')](this));}}};EmailImap[_0x7b1c('0x16')]['handleFetchMessage']=function(_0xbe663){_0xbe663['on'](_0x7b1c('0x36'),this[_0x7b1c('0x37')]['bind'](this));_0xbe663[_0x7b1c('0xe')](_0x7b1c('0x38'),this['handleMessageAttributes'][_0x7b1c('0x11')](this));_0xbe663['once']('end',this[_0x7b1c('0x39')][_0x7b1c('0x11')](this));};EmailImap[_0x7b1c('0x16')]['handleMessageBody']=function(_0x3f510f){simpleParser(_0x3f510f,{'Iconv':Iconv},this['handleSimpleParser'][_0x7b1c('0x11')](this));};EmailImap['prototype'][_0x7b1c('0x3a')]=function(){};EmailImap['prototype'][_0x7b1c('0x39')]=function(){};EmailImap[_0x7b1c('0x16')][_0x7b1c('0x3b')]=function(_0x535687,_0x223ae3){if(_0x535687){logger['error'](_0x535687);}else{var _0x222a5f=this;utils[_0x7b1c('0x3c')](this[_0x7b1c('0xa')],_0x223ae3,function(_0x5dc215){_0x222a5f['emit'](_0x7b1c('0x21'),_0x5dc215);});}};EmailImap[_0x7b1c('0x16')][_0x7b1c('0x34')]=function(){this[_0x7b1c('0x2')][_0x7b1c('0x35')](!![],this[_0x7b1c('0x2d')]['bind'](this));};EmailImap['prototype']['handleFetchError']=function(_0x5ce747){this[_0x7b1c('0x13')](_0x5ce747);this[_0x7b1c('0x2')][_0x7b1c('0x35')](!![],this[_0x7b1c('0x2d')][_0x7b1c('0x11')](this));};EmailImap['prototype'][_0x7b1c('0x10')]=function(){this[_0x7b1c('0x2a')](_0x7b1c('0xf'));};EmailImap['prototype'][_0x7b1c('0x13')]=function(_0x500202,_0x36e043){logger[_0x7b1c('0x12')](_0x7b1c('0x13'),this[_0x7b1c('0xa')][_0x7b1c('0x21')],JSON[_0x7b1c('0x3d')](_0x500202));var _0x2f743f='';if(_0x500202){if(_0x500202['textCode']){_0x2f743f=_0x500202[_0x7b1c('0x3e')];}else{for(var _0x4db6bd in _0x500202){if(_0x500202[_0x7b1c('0x3f')](_0x4db6bd)){_0x2f743f+=_['upperFirst'](_0x4db6bd)+':\x20'+_0x500202[_0x4db6bd]+'\x0a';}}}}if(_0x36e043){this[_0x7b1c('0x2')][_0x7b1c('0xf')]();}else{this['emit']('error',_0x2f743f);this['emit'](_0x7b1c('0xf'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xfe30=['ready','handleReady','bind','once','end','handleEnd','handleError','connect','inherits','getAccount','connTimeout','authTimeout','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','authentication','anonymous@xcally.com','host','port','tls','prototype','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','../../../config/logger','email','mailbox','account'];(function(_0xe2b013,_0x5790ce){var _0x37e2cc=function(_0x146231){while(--_0x146231){_0xe2b013['push'](_0xe2b013['shift']());}};_0x37e2cc(++_0x5790ce);}(_0xfe30,0x1ec));var _0x0fe3=function(_0x2a00dd,_0x10da34){_0x2a00dd=_0x2a00dd-0x0;var _0x54613f=_0xfe30[_0x2a00dd];return _0x54613f;};'use strict';var _=require(_0x0fe3('0x0'));var util=require(_0x0fe3('0x1'));var Imap=require(_0x0fe3('0x2'));var simpleParser=require(_0x0fe3('0x3'))[_0x0fe3('0x4')];var Iconv=require(_0x0fe3('0x5'))[_0x0fe3('0x6')];var EventEmitter=require(_0x0fe3('0x7'))['EventEmitter'];var utils=require('./utils');var logger=require(_0x0fe3('0x8'))(_0x0fe3('0x9'));function EmailImap(_0x5375c8,_0x26861b){this[_0x0fe3('0xa')]=_0x5375c8[_0x0fe3('0xa')];this[_0x0fe3('0xb')]=this['getAccount'](_0x5375c8,_0x26861b);this[_0x0fe3('0x2')]=new Imap(this[_0x0fe3('0xb')]);this[_0x0fe3('0x2')]['once'](_0x0fe3('0xc'),this[_0x0fe3('0xd')][_0x0fe3('0xe')](this));this[_0x0fe3('0x2')][_0x0fe3('0xf')](_0x0fe3('0x10'),this[_0x0fe3('0x11')][_0x0fe3('0xe')](this));this[_0x0fe3('0x2')]['on']('error',this[_0x0fe3('0x12')][_0x0fe3('0xe')](this));this[_0x0fe3('0x2')][_0x0fe3('0x13')]();}util[_0x0fe3('0x14')](EmailImap,EventEmitter);EmailImap['prototype'][_0x0fe3('0x15')]=function(_0x4faa93,_0x1e28f1){var _0x49b525={'connTimeout':_0x4faa93[_0x0fe3('0x16')]?_0x4faa93['connTimeout']*0x3e8:0x2710,'authTimeout':_0x4faa93[_0x0fe3('0x17')]?_0x4faa93['authTimeout']*0x3e8:0x1388};if(_0x4faa93['service']){_0x49b525[_0x0fe3('0x18')]=_0x4faa93[_0x0fe3('0x18')];if(_0x4faa93[_0x0fe3('0x19')]){_0x49b525[_0x0fe3('0x1a')]=utils[_0x0fe3('0x1b')](_0x4faa93[_0x0fe3('0x1c')]['data5'],_0x4faa93[_0x0fe3('0x18')]);}else{_0x49b525[_0x0fe3('0x1d')]=_0x4faa93['password'];}}else{if(_0x4faa93[_0x0fe3('0x1e')]){_0x49b525[_0x0fe3('0x18')]=_0x4faa93['user'];_0x49b525[_0x0fe3('0x1d')]=_0x4faa93['password'];}}_0x49b525[_0x0fe3('0x9')]=_0x1e28f1||_0x4faa93[_0x0fe3('0x18')]||_0x0fe3('0x1f');_0x49b525[_0x0fe3('0x20')]=_0x4faa93[_0x0fe3('0x20')];_0x49b525[_0x0fe3('0x21')]=_0x4faa93[_0x0fe3('0x21')]||0x3e1;if(_0x4faa93['tls']){_0x49b525[_0x0fe3('0x22')]=!![];}else{_0x49b525[_0x0fe3('0x22')]=![];_0x49b525['autotls']='required';}return _0x49b525;};EmailImap['prototype'][_0x0fe3('0xd')]=function(){this[_0x0fe3('0x2')]['openBox'](this['mailbox'],![],this['handleOpenBox'][_0x0fe3('0xe')](this));};EmailImap[_0x0fe3('0x23')]['handleOpenBox']=function(_0x2d3ebc,_0x4e9418){if(_0x2d3ebc){this['handleError'](_0x2d3ebc,!![]);}else{this[_0x0fe3('0x24')](_0x0fe3('0x25'),_0x4e9418);this[_0x0fe3('0x26')]();}};EmailImap['prototype'][_0x0fe3('0x27')]=function(_0x3e3b24){if(_0x3e3b24){this[_0x0fe3('0x12')](_0x3e3b24,!![]);}else{this['imap'][_0x0fe3('0x10')]();}};EmailImap[_0x0fe3('0x23')][_0x0fe3('0x26')]=function(){this[_0x0fe3('0x2')][_0x0fe3('0x28')]([_0x0fe3('0x29')],this[_0x0fe3('0x2a')][_0x0fe3('0xe')](this));};EmailImap[_0x0fe3('0x23')][_0x0fe3('0x2a')]=function(_0x479d1a,_0x384387){if(_0x479d1a){this[_0x0fe3('0x12')](_0x479d1a,!![]);}else{if(_0x384387[_0x0fe3('0x2b')]){try{var _0x18ee79=this[_0x0fe3('0x2')][_0x0fe3('0x2c')](_0x384387,{'bodies':'','markSeen':!![]});_0x18ee79['on'](_0x0fe3('0x2d'),this[_0x0fe3('0x2e')]['bind'](this));_0x18ee79[_0x0fe3('0xf')](_0x0fe3('0x2f'),this['handleFetchError'][_0x0fe3('0xe')](this));_0x18ee79[_0x0fe3('0xf')](_0x0fe3('0x10'),this[_0x0fe3('0x30')]['bind'](this));}catch(_0x49e570){logger[_0x0fe3('0x2f')](_0x49e570);}}else{this[_0x0fe3('0x2')][_0x0fe3('0x31')](!![],this[_0x0fe3('0x27')][_0x0fe3('0xe')](this));}}};EmailImap[_0x0fe3('0x23')][_0x0fe3('0x2e')]=function(_0x5e4711){_0x5e4711['on'](_0x0fe3('0x32'),this[_0x0fe3('0x33')][_0x0fe3('0xe')](this));_0x5e4711[_0x0fe3('0xf')](_0x0fe3('0x34'),this[_0x0fe3('0x35')]['bind'](this));_0x5e4711[_0x0fe3('0xf')](_0x0fe3('0x10'),this['handleMessageEnd'][_0x0fe3('0xe')](this));};EmailImap[_0x0fe3('0x23')][_0x0fe3('0x33')]=function(_0x53cd47){simpleParser(_0x53cd47,{'Iconv':Iconv},this['handleSimpleParser'][_0x0fe3('0xe')](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap['prototype'][_0x0fe3('0x36')]=function(){};EmailImap['prototype'][_0x0fe3('0x37')]=function(_0x5e5290,_0x525830){if(_0x5e5290){logger['error'](_0x5e5290);}else{var _0x3a2ca0=this;utils[_0x0fe3('0x38')](this[_0x0fe3('0xb')],_0x525830,function(_0x4af612){_0x3a2ca0[_0x0fe3('0x24')]('email',_0x4af612);});}};EmailImap['prototype'][_0x0fe3('0x30')]=function(){this['imap']['closeBox'](!![],this[_0x0fe3('0x27')]['bind'](this));};EmailImap[_0x0fe3('0x23')][_0x0fe3('0x39')]=function(_0x3d3780){this[_0x0fe3('0x12')](_0x3d3780);this['imap'][_0x0fe3('0x31')](!![],this[_0x0fe3('0x27')][_0x0fe3('0xe')](this));};EmailImap['prototype'][_0x0fe3('0x11')]=function(){this['emit'](_0x0fe3('0x10'));};EmailImap[_0x0fe3('0x23')]['handleError']=function(_0x1ae278,_0x251bb0){logger[_0x0fe3('0x2f')](_0x0fe3('0x12'),this['account']['email'],JSON[_0x0fe3('0x3a')](_0x1ae278));var _0x413e78='';if(_0x1ae278){if(_0x1ae278[_0x0fe3('0x3b')]){_0x413e78=_0x1ae278[_0x0fe3('0x3b')];}else{for(var _0xeea6fe in _0x1ae278){if(_0x1ae278[_0x0fe3('0x3c')](_0xeea6fe)){_0x413e78+=_[_0x0fe3('0x3d')](_0xeea6fe)+':\x20'+_0x1ae278[_0xeea6fe]+'\x0a';}}}}if(_0x251bb0){this[_0x0fe3('0x2')][_0x0fe3('0x10')]();}else{this[_0x0fe3('0x24')](_0x0fe3('0x2f'),_0x413e78);this['emit']('end');}};module[_0x0fe3('0x3e')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index a1c3bb7..1cc554f 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 _0x9c41=['toString','verify','Not\x20verifired','exports','nodemailer','prototype','createTransport','use','compile','sendMail'];(function(_0x522d5e,_0x15761c){var _0x100da0=function(_0x16a655){while(--_0x16a655){_0x522d5e['push'](_0x522d5e['shift']());}};_0x100da0(++_0x15761c);}(_0x9c41,0x68));var _0x19c4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9c41[_0x14add3];return _0x4a174f;};'use strict';var nodemailer=require(_0x19c4('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x19c4('0x1')]['send']=function(_0x1005c8,_0x56e25d){return new Promise(function(_0x25ec43,_0x47857e){var _0x3d3766=nodemailer[_0x19c4('0x2')](_0x1005c8);_0x3d3766[_0x19c4('0x3')](_0x19c4('0x4'),inlineBase64());_0x3d3766[_0x19c4('0x5')](_0x56e25d,function(_0x3cfe3b,_0x43fb68){if(_0x3cfe3b){_0x47857e(_0x3cfe3b[_0x19c4('0x6')]());}else{_0x25ec43(_0x43fb68);}});});};EmailSmtp[_0x19c4('0x1')][_0x19c4('0x7')]=function(_0x1caa56){return new Promise(function(_0x5e993f,_0x3b47ce){var _0x3e4afa=nodemailer['createTransport'](_0x1caa56);_0x3e4afa[_0x19c4('0x7')](function(_0x55c2e8,_0x5a42a3){if(_0x55c2e8){_0x3b47ce(_0x55c2e8[_0x19c4('0x6')]());}else{if(_0x5a42a3){_0x5e993f(_0x5a42a3);}else{_0x3b47ce(_0x19c4('0x8'));}}});});};module[_0x19c4('0x9')]=EmailSmtp; \ No newline at end of file +var _0xb4f9=['createTransport','compile','verify','toString','Not\x20verifired','nodemailer-plugin-inline-base64','prototype','send'];(function(_0x410b9c,_0x7e820d){var _0x5b3036=function(_0x138bdc){while(--_0x138bdc){_0x410b9c['push'](_0x410b9c['shift']());}};_0x5b3036(++_0x7e820d);}(_0xb4f9,0x15d));var _0x9b4f=function(_0x57f6ad,_0x4795b6){_0x57f6ad=_0x57f6ad-0x0;var _0x425c09=_0xb4f9[_0x57f6ad];return _0x425c09;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x9b4f('0x0'));function EmailSmtp(){}EmailSmtp[_0x9b4f('0x1')][_0x9b4f('0x2')]=function(_0x276771,_0x1db0ba){return new Promise(function(_0x1fc0d9,_0xa95700){var _0x17b315=nodemailer[_0x9b4f('0x3')](_0x276771);_0x17b315['use'](_0x9b4f('0x4'),inlineBase64());_0x17b315['sendMail'](_0x1db0ba,function(_0x471ca6,_0x24b773){if(_0x471ca6){_0xa95700(_0x471ca6['toString']());}else{_0x1fc0d9(_0x24b773);}});});};EmailSmtp['prototype'][_0x9b4f('0x5')]=function(_0x5505f1){return new Promise(function(_0x5a2ceb,_0x34e28b){var _0x5e78a7=nodemailer[_0x9b4f('0x3')](_0x5505f1);_0x5e78a7['verify'](function(_0x16ac12,_0xfda6e){if(_0x16ac12){_0x34e28b(_0x16ac12[_0x9b4f('0x6')]());}else{if(_0xfda6e){_0x5a2ceb(_0xfda6e);}else{_0x34e28b(_0x9b4f('0x7'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 7e24d23..66232fa 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 _0x51e3=['_IMG','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','util','node-tnef','address','anonymous','generate','value','name','substring','indexOf','split','length','head','pop','isEmpty','html','test','replace','includes','attachments','push','filename','_SRC'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0x51e3,0x1c4));var _0x351e=function(_0x178be5,_0x4b34ab){_0x178be5=_0x178be5-0x0;var _0x447763=_0x51e3[_0x178be5];return _0x447763;};'use strict';var _=require(_0x351e('0x0'));var moment=require(_0x351e('0x1'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require(_0x351e('0x2'));var tnef=require(_0x351e('0x3'));var logger=require('../../../config/logger')('email');var config=require('../../../config/environment');function getAddress(_0x10884b){var _0x1acd66=_['head'](_0x10884b['value']);return _0x1acd66&&_0x1acd66[_0x351e('0x4')]?_0x1acd66['address']:_0x351e('0x5')+random[_0x351e('0x6')](0x6)+'@xcally.com';}function getFirstName(_0x2c0a12){var _0x11d559=_['head'](_0x2c0a12[_0x351e('0x7')]);if(_0x11d559&&_0x11d559[_0x351e('0x8')]){if(_0x11d559[_0x351e('0x8')]==_0x11d559[_0x351e('0x4')]){return _0x11d559[_0x351e('0x8')][_0x351e('0x9')](0x0,_0x11d559['name'][_0x351e('0xa')]('@'));}var _0x262ed1=_0x11d559[_0x351e('0x8')][_0x351e('0xb')](/\s+/);return _0x262ed1[_0x351e('0xc')]>0x1?_0x262ed1['slice'](0x0,-0x1)['join']('\x20'):_0x11d559['name'];}return'Anonymous';}function getLastName(_0x9bbc6c){var _0xa71fde=_[_0x351e('0xd')](_0x9bbc6c['value']);if(_0xa71fde&&_0xa71fde[_0x351e('0x8')]){var _0x5b2e05=_0xa71fde[_0x351e('0x8')]['split'](/\s+/);return _0x5b2e05[_0x351e('0xc')]>0x1?_0x5b2e05[_0x351e('0xe')]():'';}return'';}function getMails(_0x1e93e3,_0x2e5b05){var _0xcc9b66='';for(var _0x2a2bc8=0x0;_0x2a2bc8<_0x2e5b05[_0x351e('0x7')][_0x351e('0xc')];_0x2a2bc8+=0x1){if(_0x2e5b05['value'][_0x2a2bc8][_0x351e('0x4')]!==_0x1e93e3){if(!_[_0x351e('0xf')](_0xcc9b66)){_0xcc9b66+=',';}_0xcc9b66+=_0x2e5b05[_0x351e('0x7')][_0x2a2bc8][_0x351e('0x8')]||_0x2e5b05[_0x351e('0x7')][_0x2a2bc8]['address']||'';_0xcc9b66+='\x20<';_0xcc9b66+=_0x2e5b05[_0x351e('0x7')][_0x2a2bc8][_0x351e('0x4')]?_0x2e5b05['value'][_0x2a2bc8]['address']:_0x351e('0x5')+random[_0x351e('0x6')](0x6)+'@xcally.com';_0xcc9b66+='>';}}return _0xcc9b66;}function parseEmail(_0x3eed77,_0x4c9aa7,_0x2923d6){if(_0x4c9aa7[_0x351e('0x10')]){var _0x2f33e8=/)<[^<]*)*<\/script>/gi;while(_0x2f33e8[_0x351e('0x11')](_0x4c9aa7['html'])){_0x4c9aa7[_0x351e('0x10')]=_0x4c9aa7[_0x351e('0x10')][_0x351e('0x12')](_0x2f33e8,'');}if(_0x4c9aa7[_0x351e('0x10')][_0x351e('0x13')]('{_0x472343[_0x351e('0x15')](_0x41823f[_0x351e('0x16')]);});var _0x494949=/]+>/g;var _0x2e99d2=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x34ab88=_0x4c9aa7[_0x351e('0x10')][_0x351e('0x12')](_0x2e99d2,_0x351e('0x17'));var _0x5db4c3=_0x34ab88[_0x351e('0x12')](_0x494949,'_IMG');for(let _0x1609db=0x0;_0x1609db<_0x472343['length'];_0x1609db++){var _0x35923b=_0x5db4c3[_0x351e('0x12')](_0x351e('0x18'),_0x351e('0x19')+_0x472343[_0x1609db]+_0x351e('0x1a'));_0x5db4c3=_0x35923b;}_0x4c9aa7[_0x351e('0x10')]=_0x5db4c3;}_0x2923d6[_0x351e('0x1b')]=_0x4c9aa7[_0x351e('0x10')];}else{_0x2923d6[_0x351e('0x1b')]=_0x4c9aa7['textAsHtml'];}if(_0x2923d6['body']){_0x2923d6[_0x351e('0x1b')]=_0x2923d6['body'][_0x351e('0x12')](/0x0){var _0x78265e=[_0x351e('0x2e'),'X-Auto-Response-Suppress:\x20All',_0x351e('0x2f')];for(var _0x45e272=0x0;_0x45e272<_0x4c9aa7[_0x351e('0x2d')][_0x351e('0xc')];_0x45e272++){var _0xfa5724=_[_0x351e('0xa')](_0x78265e,_0x4c9aa7[_0x351e('0x2d')][_0x45e272][_0x351e('0x30')]);if(_0xfa5724>=0x0){_0x2923d6[_0x351e('0x31')]=!![];}}}return _0x2923d6;}exports['parser']=function(_0x1890df,_0x4fa7fa,_0x1a6bc6){var _0x5c3902={'from':getAddress(_0x4fa7fa[_0x351e('0x32')]),'firstName':getFirstName(_0x4fa7fa[_0x351e('0x32')]),'lastName':getLastName(_0x4fa7fa[_0x351e('0x32')]),'mapKey':_0x351e('0x1e'),'message':{'from':getMails(_0x1890df[_0x351e('0x1e')],_0x4fa7fa[_0x351e('0x32')]),'to':_0x1890df[_0x351e('0x1e')],'cc':'','subject':_0x4fa7fa['subject']||'','messageId':_0x4fa7fa[_0x351e('0x33')],'inReplyTo':_0x4fa7fa[_0x351e('0x34')],'sentAt':moment(_0x4fa7fa[_0x351e('0x35')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x4fa7fa[_0x351e('0x10')]&&!_0x4fa7fa['textAsHtml']){var _0x5988ff=_[_0x351e('0x36')](_0x4fa7fa[_0x351e('0x14')],{'contentType':'application/ms-tnef'});if(_0x5988ff[_0x351e('0xc')]){logger[_0x351e('0x37')](util[_0x351e('0x24')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x4fa7fa[_0x351e('0x33')]));tnef[_0x351e('0x38')](_[_0x351e('0x39')](_0x5988ff)[_0x351e('0x2b')],function(_0x572518,_0x1eaa4b){if(_0x1eaa4b){_0x4fa7fa[_0x351e('0x10')]=_0x1eaa4b[_0x351e('0x3a')]||_0x351e('0x3b');if(_0x1eaa4b[_0x351e('0x3c')]){for(var _0x28d013=0x0;_0x28d013<_0x1eaa4b[_0x351e('0x3c')][_0x351e('0xc')];_0x28d013++){var _0x9c3c0=_0x1eaa4b['Attachments'][_0x28d013];_0x5c3902[_0x351e('0x1d')][_0x351e('0x14')]['push']({'filename':_0x9c3c0['Title'],'content':Buffer[_0x351e('0x32')](_0x9c3c0[_0x351e('0x3d')])});}}}_0x1a6bc6(parseEmail(_0x1890df,_0x4fa7fa,_0x5c3902));});}else{_0x4fa7fa[_0x351e('0x10')]=_0x351e('0x3b');_0x1a6bc6(parseEmail(_0x1890df,_0x4fa7fa,_0x5c3902));}}else{_0x1a6bc6(parseEmail(_0x1890df,_0x4fa7fa,_0x5c3902));}};exports[_0x351e('0x3e')]=function(_0x302c50,_0x5b0665){var _0x4e321b=[_0x351e('0x3f')+(_0x5b0665||''),_0x351e('0x40')+_0x302c50,'',''];return Buffer[_0x351e('0x32')](_0x4e321b[_0x351e('0x27')](''),_0x351e('0x41'))[_0x351e('0x42')](_0x351e('0x43'));}; \ No newline at end of file +var _0x382a=['indexOf','split','length','slice','Anonymous','isEmpty','@xcally.com','html','replace','includes','attachments','forEach','push','filename','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','auth=Bearer\x20','base64','moment','randomstring','path','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','name','substring'];(function(_0x36c6c6,_0x103c44){var _0x4bd317=function(_0xf4188a){while(--_0xf4188a){_0x36c6c6['push'](_0x36c6c6['shift']());}};_0x4bd317(++_0x103c44);}(_0x382a,0x197));var _0xa382=function(_0x4d3287,_0xe83871){_0x4d3287=_0x4d3287-0x0;var _0x3e46fc=_0x382a[_0x4d3287];return _0x3e46fc;};'use strict';var _=require('lodash');var moment=require(_0xa382('0x0'));var random=require(_0xa382('0x1'));var fs=require('fs');var path=require(_0xa382('0x2'));var util=require('util');var tnef=require(_0xa382('0x3'));var logger=require(_0xa382('0x4'))(_0xa382('0x5'));var config=require('../../../config/environment');function getAddress(_0xc8e2ea){var _0x1bea6c=_[_0xa382('0x6')](_0xc8e2ea[_0xa382('0x7')]);return _0x1bea6c&&_0x1bea6c[_0xa382('0x8')]?_0x1bea6c['address']:_0xa382('0x9')+random[_0xa382('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x145bf9){var _0x33fd37=_['head'](_0x145bf9['value']);if(_0x33fd37&&_0x33fd37[_0xa382('0xb')]){if(_0x33fd37[_0xa382('0xb')]==_0x33fd37['address']){return _0x33fd37[_0xa382('0xb')][_0xa382('0xc')](0x0,_0x33fd37[_0xa382('0xb')][_0xa382('0xd')]('@'));}var _0x520874=_0x33fd37[_0xa382('0xb')][_0xa382('0xe')](/\s+/);return _0x520874[_0xa382('0xf')]>0x1?_0x520874[_0xa382('0x10')](0x0,-0x1)['join']('\x20'):_0x33fd37[_0xa382('0xb')];}return _0xa382('0x11');}function getLastName(_0x43bc60){var _0x357d06=_[_0xa382('0x6')](_0x43bc60[_0xa382('0x7')]);if(_0x357d06&&_0x357d06[_0xa382('0xb')]){var _0x4e30f7=_0x357d06[_0xa382('0xb')][_0xa382('0xe')](/\s+/);return _0x4e30f7[_0xa382('0xf')]>0x1?_0x4e30f7['pop']():'';}return'';}function getMails(_0x216d35,_0x314472){var _0x537d0a='';for(var _0x4215a7=0x0;_0x4215a7<_0x314472['value'][_0xa382('0xf')];_0x4215a7+=0x1){if(_0x314472[_0xa382('0x7')][_0x4215a7][_0xa382('0x8')]!==_0x216d35){if(!_[_0xa382('0x12')](_0x537d0a)){_0x537d0a+=',';}_0x537d0a+=_0x314472[_0xa382('0x7')][_0x4215a7][_0xa382('0xb')]||_0x314472[_0xa382('0x7')][_0x4215a7][_0xa382('0x8')]||'';_0x537d0a+='\x20<';_0x537d0a+=_0x314472[_0xa382('0x7')][_0x4215a7][_0xa382('0x8')]?_0x314472['value'][_0x4215a7][_0xa382('0x8')]:_0xa382('0x9')+random[_0xa382('0xa')](0x6)+_0xa382('0x13');_0x537d0a+='>';}}return _0x537d0a;}function parseEmail(_0x6a88a7,_0x133de6,_0x246857){if(_0x133de6['html']){var _0x13e3cb=/)<[^<]*)*<\/script>/gi;while(_0x13e3cb['test'](_0x133de6[_0xa382('0x14')])){_0x133de6['html']=_0x133de6[_0xa382('0x14')][_0xa382('0x15')](_0x13e3cb,'');}if(_0x133de6[_0xa382('0x14')][_0xa382('0x16')]('{_0x2990af[_0xa382('0x19')](_0x5f0054[_0xa382('0x1a')]);});var _0x25e615=/]+>/g;var _0x30d2a2=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x515fc4=_0x133de6[_0xa382('0x14')][_0xa382('0x15')](_0x30d2a2,'_SRC');var _0x17269d=_0x515fc4[_0xa382('0x15')](_0x25e615,_0xa382('0x1b'));for(let _0x3297d5=0x0;_0x3297d5<_0x2990af[_0xa382('0xf')];_0x3297d5++){var _0xe4d403=_0x17269d['replace']('_IMG',_0xa382('0x1c')+_0x2990af[_0x3297d5]+_0xa382('0x1d'));_0x17269d=_0xe4d403;}_0x133de6['html']=_0x17269d;}_0x246857[_0xa382('0x1e')]=_0x133de6[_0xa382('0x14')];}else{_0x246857[_0xa382('0x1e')]=_0x133de6[_0xa382('0x1f')];}if(_0x246857[_0xa382('0x1e')]){_0x246857[_0xa382('0x1e')]=_0x246857[_0xa382('0x1e')][_0xa382('0x15')](/0x0){var _0x42fd7f=['Auto-Submitted:\x20auto-replied',_0xa382('0x2f'),_0xa382('0x30')];for(var _0x475d87=0x0;_0x475d87<_0x133de6[_0xa382('0x2e')][_0xa382('0xf')];_0x475d87++){var _0x21091b=_['indexOf'](_0x42fd7f,_0x133de6[_0xa382('0x2e')][_0x475d87][_0xa382('0x31')]);if(_0x21091b>=0x0){_0x246857['isAutoreply']=!![];}}}return _0x246857;}exports[_0xa382('0x32')]=function(_0x54aecd,_0x5ea2cc,_0x249ff9){var _0x10b0fc={'from':getAddress(_0x5ea2cc[_0xa382('0x33')]),'firstName':getFirstName(_0x5ea2cc[_0xa382('0x33')]),'lastName':getLastName(_0x5ea2cc[_0xa382('0x33')]),'mapKey':_0xa382('0x5'),'message':{'from':getMails(_0x54aecd[_0xa382('0x5')],_0x5ea2cc[_0xa382('0x33')]),'to':_0x54aecd['email'],'cc':'','subject':_0x5ea2cc['subject']||'','messageId':_0x5ea2cc[_0xa382('0x34')],'inReplyTo':_0x5ea2cc[_0xa382('0x35')],'sentAt':moment(_0x5ea2cc[_0xa382('0x36')])[_0xa382('0x28')](_0xa382('0x37')),'attach':![],'attachments':[]}};if(!_0x5ea2cc[_0xa382('0x14')]&&!_0x5ea2cc[_0xa382('0x1f')]){var _0x303d78=_[_0xa382('0x38')](_0x5ea2cc[_0xa382('0x17')],{'contentType':_0xa382('0x39')});if(_0x303d78['length']){logger[_0xa382('0x3a')](util[_0xa382('0x28')](_0xa382('0x3b'),_0x5ea2cc[_0xa382('0x34')]));tnef[_0xa382('0x3c')](_[_0xa382('0x3d')](_0x303d78)['content'],function(_0x42f4f5,_0x50d210){if(_0x50d210){_0x5ea2cc[_0xa382('0x14')]=_0x50d210[_0xa382('0x3e')]||_0xa382('0x3f');if(_0x50d210['Attachments']){for(var _0x38e1dc=0x0;_0x38e1dc<_0x50d210[_0xa382('0x40')]['length'];_0x38e1dc++){var _0x3933ec=_0x50d210[_0xa382('0x40')][_0x38e1dc];_0x10b0fc['message'][_0xa382('0x17')][_0xa382('0x19')]({'filename':_0x3933ec[_0xa382('0x41')],'content':Buffer[_0xa382('0x33')](_0x3933ec[_0xa382('0x42')])});}}}_0x249ff9(parseEmail(_0x54aecd,_0x5ea2cc,_0x10b0fc));});}else{_0x5ea2cc[_0xa382('0x14')]=_0xa382('0x3f');_0x249ff9(parseEmail(_0x54aecd,_0x5ea2cc,_0x10b0fc));}}else{_0x249ff9(parseEmail(_0x54aecd,_0x5ea2cc,_0x10b0fc));}};exports[_0xa382('0x43')]=function(_0x558c2d,_0x5c7074){var _0x206efd=['user='+(_0x5c7074||''),_0xa382('0x44')+_0x558c2d,'',''];return Buffer[_0xa382('0x33')](_0x206efd['join'](''),'utf-8')['toString'](_0xa382('0x45'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 3dabf2d..4d2f3a8 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 _0x9a1c=['Imap','exports','lodash','name','Service','key','SERV','active'];(function(_0x47bc5e,_0x6fc500){var _0x323a59=function(_0x32df89){while(--_0x32df89){_0x47bc5e['push'](_0x47bc5e['shift']());}};_0x323a59(++_0x6fc500);}(_0x9a1c,0x1a2));var _0xc9a1=function(_0x16333b,_0x3b9288){_0x16333b=_0x16333b-0x0;var _0x425cb6=_0x9a1c[_0x16333b];return _0x425cb6;};'use strict';var _=require(_0xc9a1('0x0'));function MailAccount(_0xd84add){this['id']=_0xd84add['id']||0x0;this[_0xc9a1('0x1')]=_0xd84add[_0xc9a1('0x1')]||_0xc9a1('0x2');this[_0xc9a1('0x3')]=_0xd84add[_0xc9a1('0x3')]||_0xc9a1('0x4');this[_0xc9a1('0x5')]=_0xd84add[_0xc9a1('0x5')]||![];this[_0xc9a1('0x6')]=_0xd84add[_0xc9a1('0x6')]||[];this['Smtp']=_0xd84add['Smtp']||[];}module[_0xc9a1('0x7')]=MailAccount; \ No newline at end of file +var _0xc6dc=['Smtp','exports','lodash','name','key','SERV','active','Imap'];(function(_0x50f5cf,_0x2e95c5){var _0x532b44=function(_0x410e8b){while(--_0x410e8b){_0x50f5cf['push'](_0x50f5cf['shift']());}};_0x532b44(++_0x2e95c5);}(_0xc6dc,0xa2));var _0xcc6d=function(_0x2f0fde,_0x4f8514){_0x2f0fde=_0x2f0fde-0x0;var _0x61f5ea=_0xc6dc[_0x2f0fde];return _0x61f5ea;};'use strict';var _=require(_0xcc6d('0x0'));function MailAccount(_0x538038){this['id']=_0x538038['id']||0x0;this['name']=_0x538038[_0xcc6d('0x1')]||'Service';this[_0xcc6d('0x2')]=_0x538038[_0xcc6d('0x2')]||_0xcc6d('0x3');this[_0xcc6d('0x4')]=_0x538038['active']||![];this['Imap']=_0x538038[_0xcc6d('0x5')]||[];this[_0xcc6d('0x6')]=_0x538038[_0xcc6d('0x6')]||[];}module[_0xcc6d('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 ef7431b..9502aaa 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 _0xede7=['prototype','initMailAccounts','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xede7,0xf7));var _0x7ede=function(_0x581b33,_0x47bf03){_0x581b33=_0x581b33-0x0;var _0x13e619=_0xede7[_0x581b33];return _0x13e619;};'use strict';var _=require(_0x7ede('0x0'));var MailAccount=require(_0x7ede('0x1'));var Realtime=function(){this[_0x7ede('0x2')]={};};function freeIsNotKey(_0x3e311b,_0x44a714,_0x48f8f1){var _0x154de5=_[_0x7ede('0x3')](_0x3e311b,function(_0x131550,_0x293d76){return _0x131550[_0x48f8f1];});for(var _0x254a92 in _0x44a714){if(_0x44a714[_0x7ede('0x4')](_0x254a92)){if(!_0x154de5[_0x254a92]){delete _0x44a714[_0x254a92];}}}}Realtime[_0x7ede('0x5')]['mergeFromDatabase']=function(_0x4e32b5,_0x597527){for(var _0x2770de in _0x597527){if(_0x4e32b5[_0x7ede('0x4')](_0x2770de)){_0x4e32b5[_0x2770de]=_0x597527[_0x2770de];}}};Realtime[_0x7ede('0x5')][_0x7ede('0x6')]=function(){var _0xf35fc2=this;return function(_0x4d425a){if(_0x4d425a){freeIsNotKey(_0x4d425a,_0xf35fc2[_0x7ede('0x2')],'id');for(var _0x109eb0=0x0,_0x212a77={},_0x2ecb95={};_0x109eb0<_0x4d425a['length'];_0x109eb0+=0x1){_0x212a77=_0x4d425a[_0x109eb0];if(_['isUndefined'](_0xf35fc2['mailAccounts'][_0x212a77['id']])){_0xf35fc2[_0x7ede('0x2')][_0x212a77['id']]=new MailAccount(_0x212a77);}else{_[_0x7ede('0x7')](_0xf35fc2[_0x7ede('0x2')][_0x212a77['id']],_0x212a77);}}}return _0xf35fc2[_0x7ede('0x2')];};};module[_0x7ede('0x8')]=Realtime; \ No newline at end of file +var _0xb13e=['mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','mailAccounts','mapKeys','hasOwnProperty','prototype'];(function(_0x3621ab,_0x15c6ac){var _0x39804f=function(_0x4c606f){while(--_0x4c606f){_0x3621ab['push'](_0x3621ab['shift']());}};_0x39804f(++_0x15c6ac);}(_0xb13e,0x150));var _0xeb13=function(_0x54faf6,_0x471178){_0x54faf6=_0x54faf6-0x0;var _0x40c799=_0xb13e[_0x54faf6];return _0x40c799;};'use strict';var _=require(_0xeb13('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xeb13('0x1')]={};};function freeIsNotKey(_0x4c2e9f,_0x4595f7,_0x1e5f55){var _0x1b93d4=_[_0xeb13('0x2')](_0x4c2e9f,function(_0x17290d,_0x309989){return _0x17290d[_0x1e5f55];});for(var _0x32f3ad in _0x4595f7){if(_0x4595f7[_0xeb13('0x3')](_0x32f3ad)){if(!_0x1b93d4[_0x32f3ad]){delete _0x4595f7[_0x32f3ad];}}}}Realtime[_0xeb13('0x4')][_0xeb13('0x5')]=function(_0xc6f477,_0x1712d2){for(var _0x357ce7 in _0x1712d2){if(_0xc6f477[_0xeb13('0x3')](_0x357ce7)){_0xc6f477[_0x357ce7]=_0x1712d2[_0x357ce7];}}};Realtime[_0xeb13('0x4')][_0xeb13('0x6')]=function(){var _0x55a2f3=this;return function(_0x3817a7){if(_0x3817a7){freeIsNotKey(_0x3817a7,_0x55a2f3['mailAccounts'],'id');for(var _0x389072=0x0,_0x5059df={},_0x3681a8={};_0x389072<_0x3817a7[_0xeb13('0x7')];_0x389072+=0x1){_0x5059df=_0x3817a7[_0x389072];if(_[_0xeb13('0x8')](_0x55a2f3[_0xeb13('0x1')][_0x5059df['id']])){_0x55a2f3['mailAccounts'][_0x5059df['id']]=new MailAccount(_0x5059df);}else{_[_0xeb13('0x9')](_0x55a2f3[_0xeb13('0x1')][_0x5059df['id']],_0x5059df);}}}return _0x55a2f3[_0xeb13('0x1')];};};module[_0xeb13('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 7d67001..ed0fac6 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 _0xb242=['type','MailServerOut','getMailAccount','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','provider','service','email','ListId','TemplateId','Imap','CloudProvider'];(function(_0x2418e0,_0x7215b0){var _0x55ffbf=function(_0x4fc0ec){while(--_0x4fc0ec){_0x2418e0['push'](_0x2418e0['shift']());}};_0x55ffbf(++_0x7215b0);}(_0xb242,0x1f3));var _0x2b24=function(_0x19691f,_0x159737){_0x19691f=_0x19691f-0x0;var _0x5677b6=_0xb242[_0x19691f];return _0x5677b6;};'use strict';var client=require('../client');exports[_0x2b24('0x0')]=function(){return function(){return client[_0x2b24('0x1')](_0x2b24('0x2'),{'options':{'attributes':['id',_0x2b24('0x3'),_0x2b24('0x4'),_0x2b24('0x5'),_0x2b24('0x6'),'active','key',_0x2b24('0x7'),_0x2b24('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':_0x2b24('0x9'),'include':[{'model':_0x2b24('0xa'),'attributes':['id',_0x2b24('0x3'),'service',_0x2b24('0xb'),'data5'],'as':_0x2b24('0xa')}]},{'model':_0x2b24('0xc'),'as':'Smtp','include':[{'model':_0x2b24('0xa'),'attributes':['id','name',_0x2b24('0x5'),_0x2b24('0xb'),'data5'],'as':'CloudProvider'}]}]},'log':_0x2b24('0xd')});};};exports['notify']=function(_0x3bb441,_0x2a23b6){return client[_0x2b24('0x1')](_0x2b24('0xe'),{'account':{'id':_0x3bb441},'body':_0x2a23b6,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x36c3=['Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','provider','service','email','active','key','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','notify'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x36c3,0x1a6));var _0x336c=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x36c3[_0x2d8fc2];return _0x3a9e53;};'use strict';var client=require(_0x336c('0x0'));exports[_0x336c('0x1')]=function(){return function(){return client['Request'](_0x336c('0x2'),{'options':{'attributes':['id',_0x336c('0x3'),_0x336c('0x4'),_0x336c('0x5'),_0x336c('0x6'),_0x336c('0x7'),_0x336c('0x8'),'ListId',_0x336c('0x9')],'raw':![],'include':[{'model':_0x336c('0xa'),'as':_0x336c('0xb'),'include':[{'model':_0x336c('0xc'),'attributes':['id',_0x336c('0x3'),'service',_0x336c('0xd'),_0x336c('0xe')],'as':_0x336c('0xc')}]},{'model':_0x336c('0xf'),'as':_0x336c('0x10'),'include':[{'model':_0x336c('0xc'),'attributes':['id',_0x336c('0x3'),_0x336c('0x5'),_0x336c('0xd'),_0x336c('0xe')],'as':_0x336c('0xc')}]}]},'log':_0x336c('0x11')});};};exports[_0x336c('0x12')]=function(_0x244e74,_0x146cf9){return client[_0x336c('0x13')](_0x336c('0x14'),{'account':{'id':_0x244e74},'body':_0x146cf9,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index c1b527b..25aacfa 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 _0xd092=['GetSettings','getSettings','Request','loginMailFrequency'];(function(_0x208df8,_0x3ba904){var _0x5dfb26=function(_0xb8dee0){while(--_0xb8dee0){_0x208df8['push'](_0x208df8['shift']());}};_0x5dfb26(++_0x3ba904);}(_0xd092,0x149));var _0x2d09=function(_0x1009a2,_0x2db50b){_0x1009a2=_0x1009a2-0x0;var _0x55b1fd=_0xd092[_0x1009a2];return _0x55b1fd;};'use strict';var client=require('../client');exports[_0x2d09('0x0')]=function(){return client[_0x2d09('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2d09('0x2')]},'log':_0x2d09('0x3')});}; \ No newline at end of file +var _0x4034=['GetSettings','../client','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x21a314,_0xbe022b){var _0x3eb9f6=function(_0x3b53ff){while(--_0x3b53ff){_0x21a314['push'](_0x21a314['shift']());}};_0x3eb9f6(++_0xbe022b);}(_0x4034,0x67));var _0x4403=function(_0x50e30b,_0x216368){_0x50e30b=_0x50e30b-0x0;var _0x4b7300=_0x4034[_0x50e30b];return _0x4b7300;};'use strict';var client=require(_0x4403('0x0'));exports[_0x4403('0x1')]=function(){return client[_0x4403('0x2')](_0x4403('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4403('0x4')]},'log':_0x4403('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 1111e28..6ce6f7e 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 2e21f5f..90e3b22 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 _0xa5db=['websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','ioredis','createServer','timeout','listen','port','socket.io'];(function(_0x57949d,_0x2b1ec9){var _0x37b663=function(_0x2ddfc2){while(--_0x2ddfc2){_0x57949d['push'](_0x57949d['shift']());}};_0x37b663(++_0x2b1ec9);}(_0xa5db,0x87));var _0xba5d=function(_0x39ffcb,_0x48d1f3){_0x39ffcb=_0x39ffcb-0x0;var _0x24dd09=_0xa5db[_0x39ffcb];return _0x24dd09;};'use strict';var _=require(_0xba5d('0x0'));var http=require(_0xba5d('0x1'));var express=require(_0xba5d('0x2'));var sticky=require('sticky-session');var Redis=require(_0xba5d('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0xba5d('0x4')](app);server[_0xba5d('0x5')]=0xdbba0;if(sticky[_0xba5d('0x6')](server,config[_0xba5d('0x7')])){var socketio=require(_0xba5d('0x8'))(server,{'transports':[_0xba5d('0x9'),_0xba5d('0xa')]});config[_0xba5d('0xb')]=_[_0xba5d('0xc')](config[_0xba5d('0xb')],{'host':_0xba5d('0xd'),'port':0x18eb});socketio[_0xba5d('0xe')](require(_0xba5d('0xf'))({'pubClient':new Redis(config[_0xba5d('0xb')]),'subClient':new Redis(config[_0xba5d('0xb')])}));require('../../config/triggers')[_0xba5d('0x10')]();require('../../config/socketio')[_0xba5d('0x10')](socketio);require(_0xba5d('0x11'))[_0xba5d('0x10')](app);require(_0xba5d('0x12'))['default'](app);}else{server[_0xba5d('0x13')](_0xba5d('0x14'),function(){console[_0xba5d('0x15')](_0xba5d('0x16'),config['port']);});}exports=module[_0xba5d('0x17')]=app; \ No newline at end of file +var _0x20b3=['createServer','port','socket.io','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','ioredis'];(function(_0x38cd7d,_0x17f16a){var _0x327af5=function(_0x48c670){while(--_0x48c670){_0x38cd7d['push'](_0x38cd7d['shift']());}};_0x327af5(++_0x17f16a);}(_0x20b3,0xda));var _0x320b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20b3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x320b('0x0'));var http=require(_0x320b('0x1'));var express=require('express');var sticky=require('sticky-session');var Redis=require(_0x320b('0x2'));var config=require('../../config/environment');var app=express();var server=http[_0x320b('0x3')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0x320b('0x4')])){var socketio=require(_0x320b('0x5'))(server,{'transports':['websocket','polling']});config[_0x320b('0x6')]=_['defaults'](config[_0x320b('0x6')],{'host':_0x320b('0x7'),'port':0x18eb});socketio[_0x320b('0x8')](require(_0x320b('0x9'))({'pubClient':new Redis(config[_0x320b('0x6')]),'subClient':new Redis(config[_0x320b('0x6')])}));require(_0x320b('0xa'))[_0x320b('0xb')]();require('../../config/socketio')[_0x320b('0xb')](socketio);require(_0x320b('0xc'))[_0x320b('0xb')](app);require('../../routes')['default'](app);}else{server['once'](_0x320b('0xd'),function(){console[_0x320b('0xe')](_0x320b('0xf'),config[_0x320b('0x4')]);});}exports=module[_0x320b('0x10')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index d0dd55f..ef95616 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 _0x533e=['error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger','routing','Request','request','debug'];(function(_0x5cd383,_0x4b5a9a){var _0x3aa024=function(_0x3e190c){while(--_0x3e190c){_0x5cd383['push'](_0x5cd383['shift']());}};_0x3aa024(++_0x4b5a9a);}(_0x533e,0xd1));var _0xe533=function(_0x4c64f1,_0x2e29ab){_0x4c64f1=_0x4c64f1-0x0;var _0x2e06ed=_0x533e[_0x4c64f1];return _0x2e06ed;};'use strict';var jayson=require(_0xe533('0x0'));var BPromise=require(_0xe533('0x1'));var logger=require(_0xe533('0x2'))(_0xe533('0x3'));var client=jayson['client']['http']({'port':0x2329});client[_0xe533('0x4')]=function(_0xfda019,_0x223a14){return new BPromise(function(_0x47955f,_0x50c8de){return client[_0xe533('0x5')](_0xfda019,_0x223a14)['then'](function(_0x5985aa){logger[_0xe533('0x6')]('rpc',_0xe533('0x3'),_0xfda019,_0x223a14,_0x5985aa);if(_0x5985aa[_0xe533('0x7')]){logger['error']('rpc',_0xe533('0x3'),_0xfda019,_0x5985aa['error'][_0xe533('0x8')],_0x223a14);return _0x50c8de(_0x5985aa[_0xe533('0x7')][_0xe533('0x8')]);}else{return _0x47955f(_0x5985aa[_0xe533('0x9')]);}})[_0xe533('0xa')](function(_0x5dd395){logger['error'](_0xe533('0xb'),'routing',_0xfda019,_0x5dd395,_0x223a14);return _0x50c8de(_0x5dd395);});});};module['exports']=client; \ No newline at end of file +var _0xc262=['catch','exports','jayson/promise','bluebird','client','Request','request','debug','rpc','routing','error','message','result'];(function(_0x514e5d,_0x5ddd58){var _0xd419df=function(_0x5a82c1){while(--_0x5a82c1){_0x514e5d['push'](_0x514e5d['shift']());}};_0xd419df(++_0x5ddd58);}(_0xc262,0x154));var _0x2c26=function(_0x1e6641,_0x6a80a3){_0x1e6641=_0x1e6641-0x0;var _0x2396c7=_0xc262[_0x1e6641];return _0x2396c7;};'use strict';var jayson=require(_0x2c26('0x0'));var BPromise=require(_0x2c26('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0x2c26('0x2')]['http']({'port':0x2329});client[_0x2c26('0x3')]=function(_0x15fa23,_0x1ace1f){return new BPromise(function(_0x189336,_0x166c79){return client[_0x2c26('0x4')](_0x15fa23,_0x1ace1f)['then'](function(_0x520dcd){logger[_0x2c26('0x5')](_0x2c26('0x6'),_0x2c26('0x7'),_0x15fa23,_0x1ace1f,_0x520dcd);if(_0x520dcd[_0x2c26('0x8')]){logger[_0x2c26('0x8')](_0x2c26('0x6'),_0x2c26('0x7'),_0x15fa23,_0x520dcd[_0x2c26('0x8')][_0x2c26('0x9')],_0x1ace1f);return _0x166c79(_0x520dcd['error'][_0x2c26('0x9')]);}else{return _0x189336(_0x520dcd[_0x2c26('0xa')]);}})[_0x2c26('0xb')](function(_0x38e06f){logger['error'](_0x2c26('0x6'),_0x2c26('0x7'),_0x15fa23,_0x38e06f,_0x1ace1f);return _0x166c79(_0x38e06f);});});};module[_0x2c26('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 2ccf576..8b77396 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 _0x10b1=['getChatQueues','initChatQueues','getSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','log','bluebird','./realtime','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues'];(function(_0x477350,_0x1abada){var _0x242610=function(_0x53f066){while(--_0x53f066){_0x477350['push'](_0x477350['shift']());}};_0x242610(++_0x1abada);}(_0x10b1,0x14e));var _0x110b=function(_0x1edaf6,_0x259828){_0x1edaf6=_0x1edaf6-0x0;var _0x545921=_0x10b1[_0x1edaf6];return _0x545921;};'use strict';var BPromise=require(_0x110b('0x0'));var server=require('./server');var Realtime=require(_0x110b('0x1'));var user=require('./rpc/user');var interval=require('./rpc/interval');var openchannelQueue=require(_0x110b('0x2'));var chatQueue=require(_0x110b('0x3'));var smsQueue=require(_0x110b('0x4'));var mailQueue=require(_0x110b('0x5'));var faxQueue=require(_0x110b('0x6'));var whatsappQueue=require(_0x110b('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x110b('0x8')]()['then'](user[_0x110b('0x9')]())[_0x110b('0xa')](realtime[_0x110b('0xb')]())[_0x110b('0xa')](interval[_0x110b('0xc')]())[_0x110b('0xa')](realtime[_0x110b('0xd')]())[_0x110b('0xa')](openchannelQueue[_0x110b('0xe')]())[_0x110b('0xa')](realtime[_0x110b('0xf')]())['then'](chatQueue[_0x110b('0x10')]())[_0x110b('0xa')](realtime[_0x110b('0x11')]())['then'](smsQueue[_0x110b('0x12')]())['then'](realtime['initSmsQueues']())[_0x110b('0xa')](mailQueue['getMailQueues']())[_0x110b('0xa')](realtime[_0x110b('0x13')]())['then'](faxQueue[_0x110b('0x14')]())['then'](realtime[_0x110b('0x15')]())[_0x110b('0xa')](whatsappQueue[_0x110b('0x16')]())[_0x110b('0xa')](realtime['initWhatsappQueues']())[_0x110b('0xa')](function(){return realtime;});}function main(){return server[_0x110b('0x17')](realtime)['then'](function(_0xf0d453){return initRealtime();})[_0x110b('0xa')](function(_0x539198){return setInterval(initRealtime,0x1388);})['catch'](function(_0x5f96a){console[_0x110b('0x18')](_0x5f96a);});}main(); \ No newline at end of file +var _0x2e39=['initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','catch','log','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals'];(function(_0x349148,_0x31eabb){var _0x2f2b0f=function(_0x44726e){while(--_0x44726e){_0x349148['push'](_0x349148['shift']());}};_0x2f2b0f(++_0x31eabb);}(_0x2e39,0xdc));var _0x92e3=function(_0x280537,_0x54259e){_0x280537=_0x280537-0x0;var _0x281260=_0x2e39[_0x280537];return _0x281260;};'use strict';var BPromise=require(_0x92e3('0x0'));var server=require(_0x92e3('0x1'));var Realtime=require(_0x92e3('0x2'));var user=require('./rpc/user');var interval=require(_0x92e3('0x3'));var openchannelQueue=require(_0x92e3('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x92e3('0x5'));var mailQueue=require(_0x92e3('0x6'));var faxQueue=require(_0x92e3('0x7'));var whatsappQueue=require(_0x92e3('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x92e3('0x9')]()[_0x92e3('0xa')](user[_0x92e3('0xb')]())[_0x92e3('0xa')](realtime[_0x92e3('0xc')]())[_0x92e3('0xa')](interval[_0x92e3('0xd')]())['then'](realtime[_0x92e3('0xe')]())[_0x92e3('0xa')](openchannelQueue[_0x92e3('0xf')]())[_0x92e3('0xa')](realtime[_0x92e3('0x10')]())['then'](chatQueue[_0x92e3('0x11')]())[_0x92e3('0xa')](realtime['initChatQueues']())[_0x92e3('0xa')](smsQueue['getSmsQueues']())[_0x92e3('0xa')](realtime[_0x92e3('0x12')]())[_0x92e3('0xa')](mailQueue[_0x92e3('0x13')]())[_0x92e3('0xa')](realtime[_0x92e3('0x14')]())[_0x92e3('0xa')](faxQueue[_0x92e3('0x15')]())[_0x92e3('0xa')](realtime[_0x92e3('0x16')]())[_0x92e3('0xa')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0x92e3('0x17')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x92e3('0xa')](function(_0x258971){return initRealtime();})[_0x92e3('0xa')](function(_0x1b5ba9){return setInterval(initRealtime,0x1388);})[_0x92e3('0x18')](function(_0x5d2b2b){console[_0x92e3('0x19')](_0x5d2b2b);});}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 04536ad..6e6f34b 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0xcfe9cb,_0x427934){var _0x163cd3=function(_0x4ee5cf){while(--_0x4ee5cf){_0xcfe9cb['push'](_0xcfe9cb['shift']());}};_0x163cd3(++_0x427934);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1a595a,_0x263824){_0x1a595a=_0x1a595a-0x0;var _0x33f008=_0x5fc3[_0x1a595a];return _0x33f008;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x27cf4c,_0x20aed1){var _0x2a453b=function(_0x859482){while(--_0x859482){_0x27cf4c['push'](_0x27cf4c['shift']());}};_0x2a453b(++_0x20aed1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 416ba54..dfa07a9 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 _0xa2b6=['http','error','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x143d6d,_0x295a66){var _0x45c605=function(_0x338783){while(--_0x338783){_0x143d6d['push'](_0x143d6d['shift']());}};_0x45c605(++_0x295a66);}(_0xa2b6,0xb7));var _0x6a2b=function(_0x33e153,_0xcfd570){_0x33e153=_0x33e153-0x0;var _0x4894c9=_0xa2b6[_0x33e153];return _0x4894c9;};'use strict';var BPromise=require(_0x6a2b('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6a2b('0x1')]({'port':0x232b});function request(_0x1e7dee,_0x87453f){return new BPromise(function(_0xce436,_0x1bcac0){return client['request'](_0x1e7dee,_0x87453f)['then'](function(_0x2bbd05){if(_0x2bbd05[_0x6a2b('0x2')]){return _0x1bcac0(_0x2bbd05[_0x6a2b('0x2')][_0x6a2b('0x3')]);}else{return _0xce436(_0x2bbd05[_0x6a2b('0x4')]);}})[_0x6a2b('0x5')](function(_0x2bade5){return _0x1bcac0(_0x2bade5);});});}exports[_0x6a2b('0x6')]=function(_0x25275c,_0x33b27f){return request(_0x6a2b('0x7'),{'account':_0x25275c,'message':_0x33b27f});}; \ No newline at end of file +var _0xd3ec=['bluebird','http','request','error','result','catch','sendMailMessage','SendMail'];(function(_0x7cdf81,_0x2a5313){var _0x44e9e0=function(_0x557a38){while(--_0x557a38){_0x7cdf81['push'](_0x7cdf81['shift']());}};_0x44e9e0(++_0x2a5313);}(_0xd3ec,0x88));var _0xcd3e=function(_0x6a8a66,_0x554a7e){_0x6a8a66=_0x6a8a66-0x0;var _0x4f57d6=_0xd3ec[_0x6a8a66];return _0x4f57d6;};'use strict';var BPromise=require(_0xcd3e('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcd3e('0x1')]({'port':0x232b});function request(_0x4af3a8,_0x54f4ac){return new BPromise(function(_0x432059,_0x2b7c9d){return client[_0xcd3e('0x2')](_0x4af3a8,_0x54f4ac)['then'](function(_0x54548e){if(_0x54548e['error']){return _0x2b7c9d(_0x54548e[_0xcd3e('0x3')]['message']);}else{return _0x432059(_0x54548e[_0xcd3e('0x4')]);}})[_0xcd3e('0x5')](function(_0x13912f){return _0x2b7c9d(_0x13912f);});});}exports[_0xcd3e('0x6')]=function(_0x536eca,_0x3b3767){return request(_0xcd3e('0x7'),{'account':_0x536eca,'message':_0x3b3767});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 53c2497..fff2afd 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 _0x5f66=['busyQueue','stringify','user:routing:update','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','CurrentCapacity','Capacity','maxcapacity','working','prototype','fax','sms','length','getChannelStatus','Status','StatusTime','chatStatusTime','mailStatus','faxCurrentCapacity','smsStatusTime','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity'];(function(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var md5=require(_0x65f6('0x0'));var moment=require('moment');var Redis=require(_0x65f6('0x1'));var config=require(_0x65f6('0x2'));config[_0x65f6('0x3')]=_[_0x65f6('0x4')](config[_0x65f6('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x65f6('0x5'))(new Redis(config['redis']));function Agent(_0x1c9f5b){this['id']=_0x1c9f5b['id']||0x0;this[_0x65f6('0x6')]=_0x1c9f5b['name']||'';this['online']=_0x1c9f5b[_0x65f6('0x7')]||!![];this[_0x65f6('0x8')]=_0x1c9f5b[_0x65f6('0x8')]||![];this[_0x65f6('0x9')]=_0x1c9f5b[_0x65f6('0x9')]||![];this[_0x65f6('0xa')]=_0x1c9f5b['mailPause']||![];this['faxPause']=_0x1c9f5b[_0x65f6('0xb')]||![];this[_0x65f6('0xc')]=_0x1c9f5b[_0x65f6('0xc')]||![];this[_0x65f6('0xd')]=_0x1c9f5b['openchannelPause']||![];this[_0x65f6('0xe')]='unknown';this['chatStatusTime']=0x0;this[_0x65f6('0xf')]=_0x1c9f5b['chatCapacity']||0x0;this[_0x65f6('0x10')]=0x0;this['mailStatus']=_0x65f6('0x11');this[_0x65f6('0x12')]=0x0;this[_0x65f6('0x13')]=_0x1c9f5b[_0x65f6('0x13')]||0x0;this[_0x65f6('0x14')]=0x0;this[_0x65f6('0x15')]=_0x65f6('0x11');this[_0x65f6('0x16')]=0x0;this[_0x65f6('0x17')]=_0x1c9f5b[_0x65f6('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x65f6('0x18')]='unknown';this['smsStatusTime']=0x0;this[_0x65f6('0x19')]=_0x1c9f5b[_0x65f6('0x19')]||0x0;this[_0x65f6('0x1a')]=0x0;this[_0x65f6('0x1b')]=_0x65f6('0x11');this[_0x65f6('0x1c')]=0x0;this[_0x65f6('0x1d')]=_0x1c9f5b[_0x65f6('0x1d')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x65f6('0x11');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x1c9f5b['openchannelCapacity']||0x0;this[_0x65f6('0x1e')]=0x0;this[_0x65f6('0x1f')]=![];this['busyQueue']=undefined;this[_0x65f6('0x0')]='';this[_0x65f6('0x20')]={};this[_0x65f6('0x21')]={};this[_0x65f6('0x22')]={};this[_0x65f6('0x23')]={};this[_0x65f6('0x24')]={};this['whatsappWaitingInteractions']={};this[_0x65f6('0x25')]();}Agent['prototype']['getChannelStatus']=function(_0x212247){if(this[_0x212247+_0x65f6('0x26')]>0x0){if(this[_0x212247+'Capacity']>0x0&&this[_0x212247+_0x65f6('0x26')]>=this[_0x212247+_0x65f6('0x27')]){return _0x65f6('0x28');}else{return _0x65f6('0x29');}}else{return'idle';}};Agent[_0x65f6('0x2a')][_0x65f6('0x25')]=function(){var _0x20a161=['mail','chat','openchannel',_0x65f6('0x2b'),_0x65f6('0x2c'),'whatsapp'];for(var _0x296cd9=0x0;_0x296cd9<_0x20a161[_0x65f6('0x2d')];_0x296cd9+=0x1){var _0x52277c=this[_0x65f6('0x2e')](_0x20a161[_0x296cd9]);if(this[_0x20a161[_0x296cd9]+_0x65f6('0x2f')]!==_0x52277c){this[_0x20a161[_0x296cd9]+_0x65f6('0x30')]=_['toNumber'](moment()['format']('x'));}this[_0x20a161[_0x296cd9]+'Status']=_0x52277c;}var _0x266cfe={'id':this['id'],'name':this[_0x65f6('0x6')],'online':this[_0x65f6('0x7')],'voicePause':this[_0x65f6('0x8')],'chatPause':this[_0x65f6('0x9')],'mailPause':this[_0x65f6('0xa')],'smsPause':this[_0x65f6('0xc')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x65f6('0xe')],'chatStatusTime':this[_0x65f6('0x31')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x65f6('0x32')],'mailStatusTime':this[_0x65f6('0x12')],'mailCapacity':this[_0x65f6('0x13')],'mailCurrentCapacity':this[_0x65f6('0x14')],'faxStatus':this[_0x65f6('0x15')],'faxStatusTime':this[_0x65f6('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x65f6('0x33')],'smsStatus':this[_0x65f6('0x18')],'smsStatusTime':this[_0x65f6('0x34')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x65f6('0x1a')],'whatsappStatus':this[_0x65f6('0x1b')],'whatsappStatusTime':this[_0x65f6('0x1c')],'whatsappCapacity':this[_0x65f6('0x1d')],'whatsappCurrentCapacity':this[_0x65f6('0x35')],'openchannelStatus':this[_0x65f6('0x36')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x65f6('0x37')],'openchannelCurrentCapacity':this[_0x65f6('0x1e')],'busy':this['busy'],'busyQueue':this[_0x65f6('0x38')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x65f6('0x21')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0x65f6('0x23')],'smsWaitingInteractions':this[_0x65f6('0x24')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x12dee6=md5(JSON[_0x65f6('0x39')](_0x266cfe));if(this[_0x65f6('0x0')]!==_0x12dee6){this['md5']=_0x12dee6;io['emit'](_0x65f6('0x3a'),_['omit'](_0x266cfe,[_0x65f6('0x7')]));}};module['exports']=Agent; \ No newline at end of file +var _0xc73f=['openchannelStatusTime','openchannelCapacity','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','format','online','smsCapacity','whatsappStatus','openchannelCurrentCapacity','busy','stringify','emit','user:routing:update','moment','md5','ioredis','../../../config/environment','redis','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus'];(function(_0x3f7d26,_0x4eb72b){var _0x25464e=function(_0x53d300){while(--_0x53d300){_0x3f7d26['push'](_0x3f7d26['shift']());}};_0x25464e(++_0x4eb72b);}(_0xc73f,0x1d8));var _0xfc73=function(_0x3aa1c9,_0x50e81f){_0x3aa1c9=_0x3aa1c9-0x0;var _0x4ea269=_0xc73f[_0x3aa1c9];return _0x4ea269;};'use strict';var _=require('lodash');var moment=require(_0xfc73('0x0'));var md5=require(_0xfc73('0x1'));var Redis=require(_0xfc73('0x2'));var config=require(_0xfc73('0x3'));config[_0xfc73('0x4')]=_['defaults'](config[_0xfc73('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfc73('0x4')]));function Agent(_0x3abf69){this['id']=_0x3abf69['id']||0x0;this[_0xfc73('0x5')]=_0x3abf69[_0xfc73('0x5')]||'';this[_0xfc73('0x6')]=_0x3abf69[_0xfc73('0x6')]||![];this['chatPause']=_0x3abf69[_0xfc73('0x7')]||![];this[_0xfc73('0x8')]=_0x3abf69['mailPause']||![];this[_0xfc73('0x9')]=_0x3abf69[_0xfc73('0x9')]||![];this[_0xfc73('0xa')]=_0x3abf69['smsPause']||![];this[_0xfc73('0xb')]=_0x3abf69[_0xfc73('0xb')]||![];this[_0xfc73('0xc')]='unknown';this[_0xfc73('0xd')]=0x0;this[_0xfc73('0xe')]=_0x3abf69[_0xfc73('0xe')]||0x0;this[_0xfc73('0xf')]=0x0;this[_0xfc73('0x10')]=_0xfc73('0x11');this[_0xfc73('0x12')]=0x0;this['mailCapacity']=_0x3abf69[_0xfc73('0x13')]||0x0;this[_0xfc73('0x14')]=0x0;this[_0xfc73('0x15')]=_0xfc73('0x11');this[_0xfc73('0x16')]=0x0;this[_0xfc73('0x17')]=_0x3abf69[_0xfc73('0x17')]||0x0;this[_0xfc73('0x18')]=0x0;this[_0xfc73('0x19')]=_0xfc73('0x11');this[_0xfc73('0x1a')]=0x0;this['smsCapacity']=_0x3abf69['smsCapacity']||0x0;this[_0xfc73('0x1b')]=0x0;this['whatsappStatus']=_0xfc73('0x11');this[_0xfc73('0x1c')]=0x0;this['whatsappCapacity']=_0x3abf69[_0xfc73('0x1d')]||0x0;this[_0xfc73('0x1e')]=0x0;this[_0xfc73('0x1f')]=_0xfc73('0x11');this[_0xfc73('0x20')]=0x0;this[_0xfc73('0x21')]=_0x3abf69[_0xfc73('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0xfc73('0x22')]=undefined;this[_0xfc73('0x1')]='';this[_0xfc73('0x23')]={};this[_0xfc73('0x24')]={};this[_0xfc73('0x25')]={};this['openchannelWaitingInteractions']={};this['smsWaitingInteractions']={};this[_0xfc73('0x26')]={};this[_0xfc73('0x27')]();}Agent[_0xfc73('0x28')][_0xfc73('0x29')]=function(_0x5d95fe){if(this[_0x5d95fe+_0xfc73('0x2a')]>0x0){if(this[_0x5d95fe+_0xfc73('0x2b')]>0x0&&this[_0x5d95fe+_0xfc73('0x2a')]>=this[_0x5d95fe+_0xfc73('0x2b')]){return'maxcapacity';}else{return _0xfc73('0x2c');}}else{return _0xfc73('0x2d');}};Agent[_0xfc73('0x28')][_0xfc73('0x27')]=function(){var _0x596ffc=[_0xfc73('0x2e'),_0xfc73('0x2f'),'openchannel',_0xfc73('0x30'),_0xfc73('0x31'),_0xfc73('0x32')];for(var _0x5430ef=0x0;_0x5430ef<_0x596ffc[_0xfc73('0x33')];_0x5430ef+=0x1){var _0x3a0ff0=this[_0xfc73('0x29')](_0x596ffc[_0x5430ef]);if(this[_0x596ffc[_0x5430ef]+_0xfc73('0x34')]!==_0x3a0ff0){this[_0x596ffc[_0x5430ef]+_0xfc73('0x35')]=_['toNumber'](moment()[_0xfc73('0x36')]('x'));}this[_0x596ffc[_0x5430ef]+_0xfc73('0x34')]=_0x3a0ff0;}var _0x1e8367={'id':this['id'],'name':this[_0xfc73('0x5')],'online':this[_0xfc73('0x37')],'voicePause':this[_0xfc73('0x6')],'chatPause':this[_0xfc73('0x7')],'mailPause':this[_0xfc73('0x8')],'smsPause':this[_0xfc73('0xa')],'faxPause':this[_0xfc73('0x9')],'openchannelPause':this[_0xfc73('0xb')],'chatStatus':this[_0xfc73('0xc')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xfc73('0xe')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xfc73('0x12')],'mailCapacity':this[_0xfc73('0x13')],'mailCurrentCapacity':this[_0xfc73('0x14')],'faxStatus':this[_0xfc73('0x15')],'faxStatusTime':this[_0xfc73('0x16')],'faxCapacity':this[_0xfc73('0x17')],'faxCurrentCapacity':this[_0xfc73('0x18')],'smsStatus':this[_0xfc73('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xfc73('0x38')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xfc73('0x39')],'whatsappStatusTime':this[_0xfc73('0x1c')],'whatsappCapacity':this[_0xfc73('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xfc73('0x1f')],'openchannelStatusTime':this[_0xfc73('0x20')],'openchannelCapacity':this[_0xfc73('0x21')],'openchannelCurrentCapacity':this[_0xfc73('0x3a')],'busy':this[_0xfc73('0x3b')],'busyQueue':this[_0xfc73('0x22')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0xfc73('0x25')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x37e83a=md5(JSON[_0xfc73('0x3c')](_0x1e8367));if(this['md5']!==_0x37e83a){this[_0xfc73('0x1')]=_0x37e83a;io[_0xfc73('0x3d')](_0xfc73('0x3e'),_0x1e8367);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 26e4f1e..58c7741 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 _0x43a2=['chat_queue:save','exports','md5','../../../config/environment','redis','defaults','localhost','name','timeout','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','online','chatPause','available','format','chat:queue:%s','emit'];(function(_0x49363f,_0x403a8e){var _0x348f1b=function(_0x252d9e){while(--_0x252d9e){_0x49363f['push'](_0x49363f['shift']());}};_0x348f1b(++_0x403a8e);}(_0x43a2,0x7f));var _0x243a=function(_0x18e2ea,_0x534a59){_0x18e2ea=_0x18e2ea-0x0;var _0x228370=_0x43a2[_0x18e2ea];return _0x228370;};'use strict';var _=require('lodash');var md5=require(_0x243a('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x243a('0x1'));config[_0x243a('0x2')]=_[_0x243a('0x3')](config[_0x243a('0x2')],{'host':_0x243a('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x28e313){this['id']=_0x28e313['id']||0x0;this[_0x243a('0x5')]=_0x28e313[_0x243a('0x5')]||'';this[_0x243a('0x6')]=_0x28e313[_0x243a('0x6')]||0xa;this['strategy']=_0x28e313['strategy']||'beepall';this[_0x243a('0x7')]=_0x28e313[_0x243a('0x7')];this[_0x243a('0x8')]={};this[_0x243a('0x9')]=0x0;this[_0x243a('0x0')]='';this[_0x243a('0xa')]();this['updateRealtime']();}ChatQueue[_0x243a('0xb')]['updateRouting']=function(){var _0xe561bb=this[_0x243a('0x8')][_0x243a('0xc')];this['mapAgentsId']=_['map'](this[_0x243a('0x7')],'id');this[_0x243a('0x8')][_0x243a('0xc')]=_0xe561bb;};ChatQueue[_0x243a('0xb')][_0x243a('0xd')]=function(){this[_0x243a('0xe')]=0x0;this[_0x243a('0xf')]=0x0;for(var _0x46de19=0x0;_0x46de19=0x0?this['available']:0x0;var _0x5ddda3={'id':this['id'],'available':this[_0x243a('0x13')],'loggedIn':this[_0x243a('0xe')],'name':this[_0x243a('0x5')],'paused':this[_0x243a('0xf')],'waiting':this['waiting']};var _0x4c2f20=md5(JSON['stringify'](_0x5ddda3));if(this[_0x243a('0x0')]!==_0x4c2f20){this['md5']=_0x4c2f20;io['to'](util[_0x243a('0x14')](_0x243a('0x15'),_0x5ddda3[_0x243a('0x5')]))[_0x243a('0x16')](_0x243a('0x17'),_0x5ddda3);}};module[_0x243a('0x18')]=ChatQueue; \ No newline at end of file +var _0xc889=['updateRealtime','map','_rr','loggedIn','online','paused','available','stringify','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting'];(function(_0x49414e,_0x4f507a){var _0x291c56=function(_0x377b56){while(--_0x377b56){_0x49414e['push'](_0x49414e['shift']());}};_0x291c56(++_0x4f507a);}(_0xc889,0x108));var _0x9c88=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xc889[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0x9c88('0x0'));var md5=require(_0x9c88('0x1'));var util=require(_0x9c88('0x2'));var Redis=require(_0x9c88('0x3'));var config=require(_0x9c88('0x4'));config[_0x9c88('0x5')]=_[_0x9c88('0x6')](config[_0x9c88('0x5')],{'host':_0x9c88('0x7'),'port':0x18eb});var io=require(_0x9c88('0x8'))(new Redis(config[_0x9c88('0x5')]));function ChatQueue(_0x1c9dcb){this['id']=_0x1c9dcb['id']||0x0;this[_0x9c88('0x9')]=_0x1c9dcb['name']||'';this[_0x9c88('0xa')]=_0x1c9dcb[_0x9c88('0xa')]||0xa;this['strategy']=_0x1c9dcb['strategy']||_0x9c88('0xb');this[_0x9c88('0xc')]=_0x1c9dcb[_0x9c88('0xc')];this[_0x9c88('0xd')]={};this[_0x9c88('0xe')]=0x0;this[_0x9c88('0x1')]='';this[_0x9c88('0xf')]();this[_0x9c88('0x10')]();}ChatQueue['prototype'][_0x9c88('0xf')]=function(){var _0x4e8dc0=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0x9c88('0x11')](this['Agents'],'id');this[_0x9c88('0xd')][_0x9c88('0x12')]=_0x4e8dc0;};ChatQueue['prototype'][_0x9c88('0x10')]=function(){this[_0x9c88('0x13')]=0x0;this['paused']=0x0;for(var _0x39244e=0x0;_0x39244e=0x0?this[_0x9c88('0x16')]:0x0;var _0x518f41={'id':this['id'],'available':this[_0x9c88('0x16')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x9c88('0x15')],'waiting':this[_0x9c88('0xe')]};var _0x20cb66=md5(JSON[_0x9c88('0x17')](_0x518f41));if(this['md5']!==_0x20cb66){this[_0x9c88('0x1')]=_0x20cb66;io['to'](util['format'](_0x9c88('0x18'),_0x518f41[_0x9c88('0x9')]))[_0x9c88('0x19')](_0x9c88('0x1a'),_0x518f41);}};module[_0x9c88('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 0ff8386..513e55d 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 _0x6a86=['updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6a86,0x9f));var _0x66a8=function(_0xcc6c87,_0x153f9a){_0xcc6c87=_0xcc6c87-0x0;var _0x210718=_0x6a86[_0xcc6c87];return _0x210718;};'use strict';var _=require(_0x66a8('0x0'));var md5=require('md5');var util=require(_0x66a8('0x1'));var Redis=require(_0x66a8('0x2'));var config=require(_0x66a8('0x3'));config[_0x66a8('0x4')]=_[_0x66a8('0x5')](config[_0x66a8('0x4')],{'host':_0x66a8('0x6'),'port':0x18eb});var io=require(_0x66a8('0x7'))(new Redis(config[_0x66a8('0x4')]));function FaxQueue(_0x2b7cc2){this['id']=_0x2b7cc2['id']||0x0;this[_0x66a8('0x8')]=_0x2b7cc2[_0x66a8('0x8')]||'';this[_0x66a8('0x9')]=_0x2b7cc2['timeout']||0xa;this[_0x66a8('0xa')]=_0x2b7cc2[_0x66a8('0xa')]||'beepall';this[_0x66a8('0xb')]=_0x2b7cc2[_0x66a8('0xb')];this[_0x66a8('0xc')]={};this[_0x66a8('0xd')]=0x0;this[_0x66a8('0xe')]='';this[_0x66a8('0xf')]();this[_0x66a8('0x10')]();}FaxQueue[_0x66a8('0x11')][_0x66a8('0xf')]=function(){var _0x55cb88=this[_0x66a8('0xc')][_0x66a8('0x12')];this[_0x66a8('0xc')]=_[_0x66a8('0x13')](this[_0x66a8('0xb')],'id');this[_0x66a8('0xc')][_0x66a8('0x12')]=_0x55cb88;};FaxQueue[_0x66a8('0x11')]['updateRealtime']=function(){this[_0x66a8('0x14')]=0x0;this[_0x66a8('0x15')]=0x0;for(var _0x248a80=0x0;_0x248a80=0x0?this[_0x66a8('0x18')]:0x0;var _0x1586a7={'id':this['id'],'available':this[_0x66a8('0x18')],'loggedIn':this[_0x66a8('0x14')],'name':this[_0x66a8('0x8')],'paused':this[_0x66a8('0x15')],'waiting':this[_0x66a8('0xd')]};var _0xf83ef3=md5(JSON[_0x66a8('0x19')](_0x1586a7));if(this['md5']!==_0xf83ef3){this[_0x66a8('0xe')]=_0xf83ef3;io['to'](util['format'](_0x66a8('0x1a'),_0x1586a7[_0x66a8('0x8')]))[_0x66a8('0x1b')](_0x66a8('0x1c'),_0x1586a7);}};module['exports']=FaxQueue; \ No newline at end of file +var _0xcd14=['strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x5d4203,_0x29b4ca){var _0xe67eba=function(_0x241f08){while(--_0x241f08){_0x5d4203['push'](_0x5d4203['shift']());}};_0xe67eba(++_0x29b4ca);}(_0xcd14,0x147));var _0x4cd1=function(_0x1c1d33,_0x39503b){_0x1c1d33=_0x1c1d33-0x0;var _0x2107c0=_0xcd14[_0x1c1d33];return _0x2107c0;};'use strict';var _=require(_0x4cd1('0x0'));var md5=require(_0x4cd1('0x1'));var util=require(_0x4cd1('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x4cd1('0x3')]=_[_0x4cd1('0x4')](config[_0x4cd1('0x3')],{'host':_0x4cd1('0x5'),'port':0x18eb});var io=require(_0x4cd1('0x6'))(new Redis(config[_0x4cd1('0x3')]));function FaxQueue(_0x430174){this['id']=_0x430174['id']||0x0;this[_0x4cd1('0x7')]=_0x430174[_0x4cd1('0x7')]||'';this[_0x4cd1('0x8')]=_0x430174[_0x4cd1('0x8')]||0xa;this[_0x4cd1('0x9')]=_0x430174[_0x4cd1('0x9')]||'beepall';this[_0x4cd1('0xa')]=_0x430174[_0x4cd1('0xa')];this[_0x4cd1('0xb')]={};this[_0x4cd1('0xc')]=0x0;this[_0x4cd1('0x1')]='';this[_0x4cd1('0xd')]();this[_0x4cd1('0xe')]();}FaxQueue[_0x4cd1('0xf')]['updateRouting']=function(){var _0x274041=this[_0x4cd1('0xb')][_0x4cd1('0x10')];this[_0x4cd1('0xb')]=_['map'](this[_0x4cd1('0xa')],'id');this[_0x4cd1('0xb')][_0x4cd1('0x10')]=_0x274041;};FaxQueue['prototype'][_0x4cd1('0xe')]=function(){this[_0x4cd1('0x11')]=0x0;this[_0x4cd1('0x12')]=0x0;for(var _0xb8088=0x0;_0xb8088=0x0?this['available']:0x0;var _0x4d49d3={'id':this['id'],'available':this['available'],'loggedIn':this[_0x4cd1('0x11')],'name':this[_0x4cd1('0x7')],'paused':this[_0x4cd1('0x12')],'waiting':this[_0x4cd1('0xc')]};var _0x35ed49=md5(JSON[_0x4cd1('0x16')](_0x4d49d3));if(this[_0x4cd1('0x1')]!==_0x35ed49){this['md5']=_0x35ed49;io['to'](util[_0x4cd1('0x17')](_0x4cd1('0x18'),_0x4d49d3['name']))[_0x4cd1('0x19')](_0x4cd1('0x1a'),_0x4d49d3);}};module[_0x4cd1('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 1a113b8..7cf8956 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 _0x0e3c=['Intervals','exports','name'];(function(_0x4dcec1,_0x2f3a6d){var _0x4cafd7=function(_0x393299){while(--_0x393299){_0x4dcec1['push'](_0x4dcec1['shift']());}};_0x4cafd7(++_0x2f3a6d);}(_0x0e3c,0xc8));var _0xc0e3=function(_0x40179c,_0x214b2e){_0x40179c=_0x40179c-0x0;var _0x94346b=_0x0e3c[_0x40179c];return _0x94346b;};'use strict';function Interval(_0x531d01){this['id']=_0x531d01['id']||0x0;this[_0xc0e3('0x0')]=_0x531d01[_0xc0e3('0x0')]||'';this[_0xc0e3('0x1')]=_0x531d01['Intervals']||{};}module[_0xc0e3('0x2')]=Interval; \ No newline at end of file +var _0xe495=['name','exports'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xe495,0x11e));var _0x5e49=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xe495[_0x599f41];return _0x2e4d58;};'use strict';function Interval(_0x5a5c31){this['id']=_0x5a5c31['id']||0x0;this[_0x5e49('0x0')]=_0x5a5c31['name']||'';this['Intervals']=_0x5a5c31['Intervals']||{};}module[_0x5e49('0x1')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 8d59dc1..e6a8f4c 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 _0x4d28=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','length','online','loggedIn','mailPause','available','paused','stringify','format','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name'];(function(_0x302c6f,_0x4a9502){var _0x34378c=function(_0x81667a){while(--_0x81667a){_0x302c6f['push'](_0x302c6f['shift']());}};_0x34378c(++_0x4a9502);}(_0x4d28,0x91));var _0x84d2=function(_0x56e063,_0x453233){_0x56e063=_0x56e063-0x0;var _0x766fcf=_0x4d28[_0x56e063];return _0x766fcf;};'use strict';var _=require(_0x84d2('0x0'));var md5=require(_0x84d2('0x1'));var util=require(_0x84d2('0x2'));var Redis=require(_0x84d2('0x3'));var config=require(_0x84d2('0x4'));config['redis']=_[_0x84d2('0x5')](config[_0x84d2('0x6')],{'host':_0x84d2('0x7'),'port':0x18eb});var io=require(_0x84d2('0x8'))(new Redis(config[_0x84d2('0x6')]));function MailQueue(_0x53ca22){this['id']=_0x53ca22['id']||0x0;this[_0x84d2('0x9')]=_0x53ca22[_0x84d2('0x9')]||'';this[_0x84d2('0xa')]=_0x53ca22['timeout']||0xa;this[_0x84d2('0xb')]=_0x53ca22[_0x84d2('0xb')]||_0x84d2('0xc');this[_0x84d2('0xd')]=_0x53ca22[_0x84d2('0xd')];this[_0x84d2('0xe')]={};this[_0x84d2('0xf')]=0x0;this[_0x84d2('0x1')]='';this[_0x84d2('0x10')]();this[_0x84d2('0x11')]();}MailQueue[_0x84d2('0x12')][_0x84d2('0x10')]=function(){var _0x2c3f9f=this[_0x84d2('0xe')]['_rr'];this[_0x84d2('0xe')]=_[_0x84d2('0x13')](this[_0x84d2('0xd')],'id');this['mapAgentsId'][_0x84d2('0x14')]=_0x2c3f9f;};MailQueue[_0x84d2('0x12')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x34b408=0x0;_0x34b408=0x0?this[_0x84d2('0x19')]:0x0;var _0x5efa0c={'id':this['id'],'available':this[_0x84d2('0x19')],'loggedIn':this[_0x84d2('0x17')],'name':this['name'],'paused':this[_0x84d2('0x1a')],'waiting':this[_0x84d2('0xf')]};var _0x164b32=md5(JSON[_0x84d2('0x1b')](_0x5efa0c));if(this[_0x84d2('0x1')]!==_0x164b32){this[_0x84d2('0x1')]=_0x164b32;io['to'](util[_0x84d2('0x1c')]('mail:queue:%s',_0x5efa0c[_0x84d2('0x9')]))[_0x84d2('0x1d')]('mail_queue:save',_0x5efa0c);}};module[_0x84d2('0x1e')]=MailQueue; \ No newline at end of file +var _0xcf2b=['format','mail:queue:%s','emit','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','updateRouting','updateRealtime','prototype','_rr','map','Agents','mapAgentsId','loggedIn','paused','length','online','mailPause','available'];(function(_0x3d4a91,_0x18d54b){var _0x1728d2=function(_0x2e6926){while(--_0x2e6926){_0x3d4a91['push'](_0x3d4a91['shift']());}};_0x1728d2(++_0x18d54b);}(_0xcf2b,0x161));var _0xbcf2=function(_0x58ac34,_0x5b5bfb){_0x58ac34=_0x58ac34-0x0;var _0x3921ab=_0xcf2b[_0x58ac34];return _0x3921ab;};'use strict';var _=require('lodash');var md5=require(_0xbcf2('0x0'));var util=require(_0xbcf2('0x1'));var Redis=require(_0xbcf2('0x2'));var config=require(_0xbcf2('0x3'));config[_0xbcf2('0x4')]=_[_0xbcf2('0x5')](config['redis'],{'host':_0xbcf2('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x1b5ddf){this['id']=_0x1b5ddf['id']||0x0;this[_0xbcf2('0x7')]=_0x1b5ddf[_0xbcf2('0x7')]||'';this['timeout']=_0x1b5ddf[_0xbcf2('0x8')]||0xa;this[_0xbcf2('0x9')]=_0x1b5ddf[_0xbcf2('0x9')]||_0xbcf2('0xa');this['Agents']=_0x1b5ddf['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0xbcf2('0x0')]='';this[_0xbcf2('0xb')]();this[_0xbcf2('0xc')]();}MailQueue[_0xbcf2('0xd')]['updateRouting']=function(){var _0x3418a2=this['mapAgentsId'][_0xbcf2('0xe')];this['mapAgentsId']=_[_0xbcf2('0xf')](this[_0xbcf2('0x10')],'id');this[_0xbcf2('0x11')][_0xbcf2('0xe')]=_0x3418a2;};MailQueue['prototype'][_0xbcf2('0xc')]=function(){this[_0xbcf2('0x12')]=0x0;this[_0xbcf2('0x13')]=0x0;for(var _0x137161=0x0;_0x137161=0x0?this['available']:0x0;var _0x5e6d2f={'id':this['id'],'available':this[_0xbcf2('0x17')],'loggedIn':this[_0xbcf2('0x12')],'name':this[_0xbcf2('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x185226=md5(JSON['stringify'](_0x5e6d2f));if(this[_0xbcf2('0x0')]!==_0x185226){this['md5']=_0x185226;io['to'](util[_0xbcf2('0x18')](_0xbcf2('0x19'),_0x5e6d2f[_0xbcf2('0x7')]))[_0xbcf2('0x1a')](_0xbcf2('0x1b'),_0x5e6d2f);}};module[_0xbcf2('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index ddef83e..2b8fd9e 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 _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x57d0dc,_0x387f3e){var _0x177765=function(_0x1bbc9e){while(--_0x1bbc9e){_0x57d0dc['push'](_0x57d0dc['shift']());}};_0x177765(++_0x387f3e);}(_0xadb5,0xad));var _0x5adb=function(_0x502a1c,_0x10d08c){_0x502a1c=_0x502a1c-0x0;var _0x5e9fef=_0xadb5[_0x502a1c];return _0x5e9fef;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x2ef3,0xba));var _0x32ef=function(_0x2f7794,_0x3be68e){_0x2f7794=_0x2f7794-0x0;var _0x370a45=_0x2ef3[_0x2f7794];return _0x370a45;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index fc6313b..bb958f0 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 _0xe13a=['waiting','updateRouting','prototype','_rr','map','length','online','loggedIn','paused','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0xe13a,0x178));var _0xae13=function(_0xa930d5,_0x5ea087){_0xa930d5=_0xa930d5-0x0;var _0x3df493=_0xe13a[_0xa930d5];return _0x3df493;};'use strict';var _=require('lodash');var md5=require(_0xae13('0x0'));var util=require(_0xae13('0x1'));var Redis=require(_0xae13('0x2'));var config=require(_0xae13('0x3'));config['redis']=_[_0xae13('0x4')](config[_0xae13('0x5')],{'host':_0xae13('0x6'),'port':0x18eb});var io=require(_0xae13('0x7'))(new Redis(config[_0xae13('0x5')]));function SmsQueue(_0x248e53){this['id']=_0x248e53['id']||0x0;this[_0xae13('0x8')]=_0x248e53[_0xae13('0x8')]||'';this[_0xae13('0x9')]=_0x248e53['timeout']||0xa;this[_0xae13('0xa')]=_0x248e53[_0xae13('0xa')]||_0xae13('0xb');this[_0xae13('0xc')]=_0x248e53[_0xae13('0xc')];this[_0xae13('0xd')]={};this[_0xae13('0xe')]=0x0;this[_0xae13('0x0')]='';this[_0xae13('0xf')]();this['updateRealtime']();}SmsQueue[_0xae13('0x10')][_0xae13('0xf')]=function(){var _0x3d6a85=this[_0xae13('0xd')][_0xae13('0x11')];this[_0xae13('0xd')]=_[_0xae13('0x12')](this['Agents'],'id');this[_0xae13('0xd')][_0xae13('0x11')]=_0x3d6a85;};SmsQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x52484b=0x0;_0x52484b=0x0?this[_0xae13('0x17')]:0x0;var _0x1b33b7={'id':this['id'],'available':this[_0xae13('0x17')],'loggedIn':this[_0xae13('0x15')],'name':this[_0xae13('0x8')],'paused':this['paused'],'waiting':this[_0xae13('0xe')]};var _0x50eb6c=md5(JSON[_0xae13('0x18')](_0x1b33b7));if(this[_0xae13('0x0')]!==_0x50eb6c){this['md5']=_0x50eb6c;io['to'](util[_0xae13('0x19')](_0xae13('0x1a'),_0x1b33b7[_0xae13('0x8')]))[_0xae13('0x1b')](_0xae13('0x1c'),_0x1b33b7);}};module[_0xae13('0x1d')]=SmsQueue; \ No newline at end of file +var _0xd3d1=['name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','smsPause','available','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x1ef113,_0x142659){var _0x1abf50=function(_0x2c4ef4){while(--_0x2c4ef4){_0x1ef113['push'](_0x1ef113['shift']());}};_0x1abf50(++_0x142659);}(_0xd3d1,0x172));var _0x1d3d=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xd3d1[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x1d3d('0x0'));var md5=require(_0x1d3d('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x1d3d('0x2'));config[_0x1d3d('0x3')]=_[_0x1d3d('0x4')](config[_0x1d3d('0x3')],{'host':_0x1d3d('0x5'),'port':0x18eb});var io=require(_0x1d3d('0x6'))(new Redis(config[_0x1d3d('0x3')]));function SmsQueue(_0xc64465){this['id']=_0xc64465['id']||0x0;this[_0x1d3d('0x7')]=_0xc64465[_0x1d3d('0x7')]||'';this[_0x1d3d('0x8')]=_0xc64465[_0x1d3d('0x8')]||0xa;this[_0x1d3d('0x9')]=_0xc64465[_0x1d3d('0x9')]||_0x1d3d('0xa');this[_0x1d3d('0xb')]=_0xc64465[_0x1d3d('0xb')];this['mapAgentsId']={};this[_0x1d3d('0xc')]=0x0;this[_0x1d3d('0x1')]='';this[_0x1d3d('0xd')]();this[_0x1d3d('0xe')]();}SmsQueue[_0x1d3d('0xf')][_0x1d3d('0xd')]=function(){var _0x44b374=this[_0x1d3d('0x10')][_0x1d3d('0x11')];this[_0x1d3d('0x10')]=_[_0x1d3d('0x12')](this['Agents'],'id');this[_0x1d3d('0x10')][_0x1d3d('0x11')]=_0x44b374;};SmsQueue['prototype']['updateRealtime']=function(){this[_0x1d3d('0x13')]=0x0;this[_0x1d3d('0x14')]=0x0;for(var _0x1a8035=0x0;_0x1a8035=0x0?this[_0x1d3d('0x18')]:0x0;var _0x50bab4={'id':this['id'],'available':this[_0x1d3d('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x1d3d('0x7')],'paused':this[_0x1d3d('0x14')],'waiting':this[_0x1d3d('0xc')]};var _0x2d6dfb=md5(JSON['stringify'](_0x50bab4));if(this[_0x1d3d('0x1')]!==_0x2d6dfb){this['md5']=_0x2d6dfb;io['to'](util['format'](_0x1d3d('0x19'),_0x50bab4[_0x1d3d('0x7')]))[_0x1d3d('0x1a')](_0x1d3d('0x1b'),_0x50bab4);}};module[_0x1d3d('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index ccc6f97..49d9198 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 _0x6b98=['updateRealtime','prototype','_rr','mapAgentsId','map','loggedIn','paused','length','online','whatsappPause','available','format','whatsapp:queue:%s','whatsapp_queue:save','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x58df06,_0x12780b){var _0x4e7710=function(_0x592ac5){while(--_0x592ac5){_0x58df06['push'](_0x58df06['shift']());}};_0x4e7710(++_0x12780b);}(_0x6b98,0x13a));var _0x86b9=function(_0x3f4683,_0x4062f9){_0x3f4683=_0x3f4683-0x0;var _0x1a80aa=_0x6b98[_0x3f4683];return _0x1a80aa;};'use strict';var _=require('lodash');var md5=require(_0x86b9('0x0'));var util=require(_0x86b9('0x1'));var Redis=require(_0x86b9('0x2'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0x86b9('0x3')],{'host':_0x86b9('0x4'),'port':0x18eb});var io=require(_0x86b9('0x5'))(new Redis(config[_0x86b9('0x3')]));function WhatsappQueue(_0x190659){this['id']=_0x190659['id']||0x0;this['name']=_0x190659[_0x86b9('0x6')]||'';this[_0x86b9('0x7')]=_0x190659['timeout']||0xa;this[_0x86b9('0x8')]=_0x190659[_0x86b9('0x8')]||_0x86b9('0x9');this['Agents']=_0x190659[_0x86b9('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x86b9('0x0')]='';this['updateRouting']();this[_0x86b9('0xb')]();}WhatsappQueue[_0x86b9('0xc')]['updateRouting']=function(){var _0x4f0c6e=this['mapAgentsId'][_0x86b9('0xd')];this[_0x86b9('0xe')]=_[_0x86b9('0xf')](this[_0x86b9('0xa')],'id');this[_0x86b9('0xe')][_0x86b9('0xd')]=_0x4f0c6e;};WhatsappQueue[_0x86b9('0xc')]['updateRealtime']=function(){this[_0x86b9('0x10')]=0x0;this[_0x86b9('0x11')]=0x0;for(var _0x2d4cc5=0x0;_0x2d4cc5=0x0?this['available']:0x0;var _0x378e94={'id':this['id'],'available':this[_0x86b9('0x15')],'loggedIn':this[_0x86b9('0x10')],'name':this[_0x86b9('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x2a44ff=md5(JSON['stringify'](_0x378e94));if(this[_0x86b9('0x0')]!==_0x2a44ff){this[_0x86b9('0x0')]=_0x2a44ff;io['to'](util[_0x86b9('0x16')](_0x86b9('0x17'),_0x378e94[_0x86b9('0x6')]))['emit'](_0x86b9('0x18'),_0x378e94);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x85b4=['whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','paused','online','whatsappPause','available','loggedIn','waiting','stringify','format','whatsapp:queue:%s'];(function(_0x566904,_0x17ef58){var _0x2735a4=function(_0x3089da){while(--_0x3089da){_0x566904['push'](_0x566904['shift']());}};_0x2735a4(++_0x17ef58);}(_0x85b4,0x1a5));var _0x485b=function(_0x552115,_0x3b83ad){_0x552115=_0x552115-0x0;var _0x8c6e20=_0x85b4[_0x552115];return _0x8c6e20;};'use strict';var _=require(_0x485b('0x0'));var md5=require(_0x485b('0x1'));var util=require(_0x485b('0x2'));var Redis=require(_0x485b('0x3'));var config=require(_0x485b('0x4'));config[_0x485b('0x5')]=_['defaults'](config[_0x485b('0x5')],{'host':_0x485b('0x6'),'port':0x18eb});var io=require(_0x485b('0x7'))(new Redis(config[_0x485b('0x5')]));function WhatsappQueue(_0x25f8ec){this['id']=_0x25f8ec['id']||0x0;this['name']=_0x25f8ec[_0x485b('0x8')]||'';this[_0x485b('0x9')]=_0x25f8ec[_0x485b('0x9')]||0xa;this[_0x485b('0xa')]=_0x25f8ec[_0x485b('0xa')]||'beepall';this[_0x485b('0xb')]=_0x25f8ec['Agents'];this[_0x485b('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x485b('0xd')]();this[_0x485b('0xe')]();}WhatsappQueue[_0x485b('0xf')][_0x485b('0xd')]=function(){var _0xfeaf73=this[_0x485b('0xc')][_0x485b('0x10')];this[_0x485b('0xc')]=_[_0x485b('0x11')](this['Agents'],'id');this[_0x485b('0xc')][_0x485b('0x10')]=_0xfeaf73;};WhatsappQueue[_0x485b('0xf')][_0x485b('0xe')]=function(){this['loggedIn']=0x0;this[_0x485b('0x12')]=0x0;for(var _0x38919b=0x0;_0x38919b=0x0?this[_0x485b('0x15')]:0x0;var _0x3f1c14={'id':this['id'],'available':this[_0x485b('0x15')],'loggedIn':this[_0x485b('0x16')],'name':this[_0x485b('0x8')],'paused':this['paused'],'waiting':this[_0x485b('0x17')]};var _0x1649c6=md5(JSON[_0x485b('0x18')](_0x3f1c14));if(this[_0x485b('0x1')]!==_0x1649c6){this[_0x485b('0x1')]=_0x1649c6;io['to'](util[_0x485b('0x19')](_0x485b('0x1a'),_0x3f1c14[_0x485b('0x8')]))['emit'](_0x485b('0x1b'),_0x3f1c14);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index d88b0aa..a5b5172 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x3b8933,_0x248dcf){var _0x5b3ec7=function(_0x2501c4){while(--_0x2501c4){_0x3b8933['push'](_0x3b8933['shift']());}};_0x5b3ec7(++_0x248dcf);}(_0xb10b,0x12a));var _0xbb10=function(_0x32c154,_0xfd915b){_0x32c154=_0x32c154-0x0;var _0x43a11a=_0xb10b[_0x32c154];return _0x43a11a;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 14ac445..2695b4c 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 _0x0333=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','update'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0x0333,0x164));var _0x3033=function(_0x32f6b9,_0x2d4aa9){_0x32f6b9=_0x32f6b9-0x0;var _0x267d52=_0x0333[_0x32f6b9];return _0x267d52;};'use strict';var client=require('../client');exports[_0x3033('0x0')]=function(_0x2b7a9c,_0x2c9020){return client[_0x3033('0x1')](_0x3033('0x2'),{'body':_0x2c9020,'options':{'where':{'id':_0x2b7a9c}},'log':_0x3033('0x3')});};exports[_0x3033('0x4')]=function(_0x84924d,_0x2b8d9d){return client[_0x3033('0x1')](_0x3033('0x5'),{'body':_0x2b8d9d,'options':{'where':{'id':_0x84924d}},'log':_0x3033('0x6')});}; \ No newline at end of file +var _0xf38f=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','Request'];(function(_0x1ff08f,_0x18d1ff){var _0x46ead0=function(_0x53cc9c){while(--_0x53cc9c){_0x1ff08f['push'](_0x1ff08f['shift']());}};_0x46ead0(++_0x18d1ff);}(_0xf38f,0x1af));var _0xff38=function(_0x1c2aeb,_0x48433c){_0x1c2aeb=_0x1c2aeb-0x0;var _0x783379=_0xf38f[_0x1c2aeb];return _0x783379;};'use strict';var client=require('../client');exports['update']=function(_0x216171,_0x4fae23){return client[_0xff38('0x0')](_0xff38('0x1'),{'body':_0x4fae23,'options':{'where':{'id':_0x216171}},'log':_0xff38('0x2')});};exports[_0xff38('0x3')]=function(_0x2d0e04,_0x2e0ff6){return client[_0xff38('0x0')](_0xff38('0x4'),{'body':_0x2e0ff6,'options':{'where':{'id':_0x2d0e04}},'log':_0xff38('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 560bc03..f8b76d8 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 _0x1dcc=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1dcc,0x72));var _0xc1dc=function(_0x2fe5b0,_0x35e231){_0x2fe5b0=_0x2fe5b0-0x0;var _0x280786=_0x1dcc[_0x2fe5b0];return _0x280786;};'use strict';var client=require(_0xc1dc('0x0'));exports[_0xc1dc('0x1')]=function(_0x56b898){return client[_0xc1dc('0x2')](_0xc1dc('0x3'),{'body':_0x56b898,'log':_0xc1dc('0x4')});}; \ No newline at end of file +var _0xa150=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x5b8425,_0x5813d1){var _0x41aa92=function(_0x23d67d){while(--_0x23d67d){_0x5b8425['push'](_0x5b8425['shift']());}};_0x41aa92(++_0x5813d1);}(_0xa150,0x1ec));var _0x0a15=function(_0x265ff7,_0x24b073){_0x265ff7=_0x265ff7-0x0;var _0x5a6f28=_0xa150[_0x265ff7];return _0x5a6f28;};'use strict';var client=require(_0x0a15('0x0'));exports[_0x0a15('0x1')]=function(_0x406142){return client[_0x0a15('0x2')](_0x0a15('0x3'),{'body':_0x406142,'log':_0x0a15('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 08bffa7..e950124 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 _0x9fc5=['online','chatPause','getChatQueues','Request','name','timeout','strategy','User','Agents'];(function(_0x285678,_0x43ad36){var _0x2c4fb7=function(_0x4548f8){while(--_0x4548f8){_0x285678['push'](_0x285678['shift']());}};_0x2c4fb7(++_0x43ad36);}(_0x9fc5,0xb6));var _0x59fc=function(_0x65d12e,_0x4b0a30){_0x65d12e=_0x65d12e-0x0;var _0x4274e0=_0x9fc5[_0x65d12e];return _0x4274e0;};'use strict';var client=require('../client');exports[_0x59fc('0x0')]=function(){return function(){return client[_0x59fc('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x59fc('0x2'),_0x59fc('0x3'),_0x59fc('0x4')],'include':[{'model':_0x59fc('0x5'),'as':_0x59fc('0x6'),'attributes':['id',_0x59fc('0x2'),_0x59fc('0x7'),_0x59fc('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xe700=['GetChatQueue','name','timeout','strategy','User','Agents','chatPause','../client','getChatQueues','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe700,0x75));var _0x0e70=function(_0x2b222e,_0x4bd0ff){_0x2b222e=_0x2b222e-0x0;var _0x2ec979=_0xe700[_0x2b222e];return _0x2ec979;};'use strict';var client=require(_0x0e70('0x0'));exports[_0x0e70('0x1')]=function(){return function(){return client[_0x0e70('0x2')](_0x0e70('0x3'),{'options':{'raw':![],'attributes':['id',_0x0e70('0x4'),_0x0e70('0x5'),_0x0e70('0x6')],'include':[{'model':_0x0e70('0x7'),'as':_0x0e70('0x8'),'attributes':['id',_0x0e70('0x4'),'online',_0x0e70('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 9797cf3..ef427df 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 _0x1f63=['DESC','UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport'];(function(_0x31e3d5,_0x3fa1cd){var _0x4da910=function(_0x5dc244){while(--_0x5dc244){_0x31e3d5['push'](_0x31e3d5['shift']());}};_0x4da910(++_0x3fa1cd);}(_0x1f63,0x7a));var _0x31f6=function(_0xeaef5,_0x26684c){_0xeaef5=_0xeaef5-0x0;var _0x336a80=_0x1f63[_0xeaef5];return _0x336a80;};'use strict';var client=require(_0x31f6('0x0'));exports[_0x31f6('0x1')]=function(_0x57257d){return client[_0x31f6('0x2')](_0x31f6('0x3'),{'body':_0x57257d,'log':_0x31f6('0x3')});};exports['update']=function(_0xd0f319,_0x33b415){return client['Request']('UpdateChatQueueReport',{'body':_0x33b415,'options':{'where':{'uniqueid':_0xd0f319},'order':[['id',_0x31f6('0x4')]],'limit':0x1},'log':_0x31f6('0x5')});}; \ No newline at end of file +var _0x24cd=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','../client'];(function(_0x44feb5,_0x3f7964){var _0x45e3b8=function(_0x2848be){while(--_0x2848be){_0x44feb5['push'](_0x44feb5['shift']());}};_0x45e3b8(++_0x3f7964);}(_0x24cd,0x83));var _0xd24c=function(_0x4fb2da,_0x8b1d01){_0x4fb2da=_0x4fb2da-0x0;var _0x2e45d7=_0x24cd[_0x4fb2da];return _0x2e45d7;};'use strict';var client=require(_0xd24c('0x0'));exports[_0xd24c('0x1')]=function(_0x4dc270){return client[_0xd24c('0x2')]('CreateChatQueueReport',{'body':_0x4dc270,'log':_0xd24c('0x3')});};exports[_0xd24c('0x4')]=function(_0x3bd534,_0x4d515c){return client[_0xd24c('0x2')](_0xd24c('0x5'),{'body':_0x4d515c,'options':{'where':{'uniqueid':_0x3bd534},'order':[['id','DESC']],'limit':0x1},'log':_0xd24c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 7b2e685..f0bb2ca 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x5705cf,_0x20016d){var _0x222f3c=function(_0x50d35f){while(--_0x50d35f){_0x5705cf['push'](_0x5705cf['shift']());}};_0x222f3c(++_0x20016d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0x7a54,0x106));var _0x47a5=function(_0x45bdc2,_0x5cbe30){_0x45bdc2=_0x45bdc2-0x0;var _0x5ee8fe=_0x7a54[_0x45bdc2];return _0x5ee8fe;};'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 a822f1b..a5b6e26 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 _0xded7=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x4aad6a,_0xac649c){var _0x9812dc=function(_0x37d2ed){while(--_0x37d2ed){_0x4aad6a['push'](_0x4aad6a['shift']());}};_0x9812dc(++_0xac649c);}(_0xded7,0x89));var _0x7ded=function(_0x575544,_0x363453){_0x575544=_0x575544-0x0;var _0x5786c9=_0xded7[_0x575544];return _0x5786c9;};'use strict';var client=require(_0x7ded('0x0'));exports[_0x7ded('0x1')]=function(_0xdd112f){return client[_0x7ded('0x2')](_0x7ded('0x3'),{'body':_0xdd112f,'log':_0x7ded('0x4')});}; \ No newline at end of file +var _0x16b2=['create','CreateFaxMessage','createFaxMessage','../client'];(function(_0x2d83bb,_0x249620){var _0x328ae8=function(_0x4456d8){while(--_0x4456d8){_0x2d83bb['push'](_0x2d83bb['shift']());}};_0x328ae8(++_0x249620);}(_0x16b2,0x197));var _0x216b=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x16b2[_0x1ebce2];return _0x4a330c;};'use strict';var client=require(_0x216b('0x0'));exports[_0x216b('0x1')]=function(_0x57bd0c){return client['Request'](_0x216b('0x2'),{'body':_0x57bd0c,'log':_0x216b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 1998b80..2e888ad 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 _0x39b1=['GetFaxQueue','name','timeout','Agents','../client','getFaxQueues','Request'];(function(_0x43231e,_0x3f9f21){var _0x4ef1bf=function(_0x4c0463){while(--_0x4c0463){_0x43231e['push'](_0x43231e['shift']());}};_0x4ef1bf(++_0x3f9f21);}(_0x39b1,0x10e));var _0x139b=function(_0x544ade,_0x45e0e9){_0x544ade=_0x544ade-0x0;var _0x43a740=_0x39b1[_0x544ade];return _0x43a740;};'use strict';var client=require(_0x139b('0x0'));exports[_0x139b('0x1')]=function(){return function(){return client[_0x139b('0x2')](_0x139b('0x3'),{'options':{'raw':![],'attributes':['id',_0x139b('0x4'),_0x139b('0x5'),'strategy'],'include':[{'model':'User','as':_0x139b('0x6'),'attributes':['id',_0x139b('0x4'),'online','faxPause']}]},'log':_0x139b('0x1')});};}; \ No newline at end of file +var _0x638f=['getFaxQueues','Request','GetFaxQueue','name','timeout','User','Agents','online','faxPause'];(function(_0x4be9db,_0x4b2c1b){var _0x20f265=function(_0x36f4dd){while(--_0x36f4dd){_0x4be9db['push'](_0x4be9db['shift']());}};_0x20f265(++_0x4b2c1b);}(_0x638f,0x18d));var _0xf638=function(_0x4815a6,_0x29ef5e){_0x4815a6=_0x4815a6-0x0;var _0x309740=_0x638f[_0x4815a6];return _0x309740;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0xf638('0x0')](_0xf638('0x1'),{'options':{'raw':![],'attributes':['id',_0xf638('0x2'),_0xf638('0x3'),'strategy'],'include':[{'model':_0xf638('0x4'),'as':_0xf638('0x5'),'attributes':['id',_0xf638('0x2'),_0xf638('0x6'),_0xf638('0x7')]}]},'log':_0xf638('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index aa23172..18b0efb 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 _0x9df4=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x9df4,0x185));var _0x49df=function(_0xf458be,_0x1cf158){_0xf458be=_0xf458be-0x0;var _0x52b318=_0x9df4[_0xf458be];return _0x52b318;};'use strict';var client=require(_0x49df('0x0'));exports[_0x49df('0x1')]=function(_0x1d3d07){return client[_0x49df('0x2')](_0x49df('0x3'),{'body':_0x1d3d07,'log':_0x49df('0x3')});};exports['update']=function(_0x26a8c3,_0x56a9ee){return client[_0x49df('0x2')](_0x49df('0x4'),{'body':_0x56a9ee,'options':{'where':{'uniqueid':_0x26a8c3},'order':[['id',_0x49df('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xed9f=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','../client'];(function(_0x2ba9ac,_0xa1fdc4){var _0x1b0fc9=function(_0x4343de){while(--_0x4343de){_0x2ba9ac['push'](_0x2ba9ac['shift']());}};_0x1b0fc9(++_0xa1fdc4);}(_0xed9f,0x1a3));var _0xfed9=function(_0x41eb44,_0x229d85){_0x41eb44=_0x41eb44-0x0;var _0x334ba7=_0xed9f[_0x41eb44];return _0x334ba7;};'use strict';var client=require(_0xfed9('0x0'));exports[_0xfed9('0x1')]=function(_0x2e134d){return client[_0xfed9('0x2')](_0xfed9('0x3'),{'body':_0x2e134d,'log':'CreateFaxQueueReport'});};exports[_0xfed9('0x4')]=function(_0x4a5dc1,_0x1b6b49){return client[_0xfed9('0x2')](_0xfed9('0x5'),{'body':_0x1b6b49,'options':{'where':{'uniqueid':_0x4a5dc1},'order':[['id','DESC']],'limit':0x1},'log':_0xfed9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 87df092..d064ff6 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 _0x3d15=['name','Interval','Intervals','interval','getIntervals','../client'];(function(_0x5fb1c,_0x595dfe){var _0x497014=function(_0x473db5){while(--_0x473db5){_0x5fb1c['push'](_0x5fb1c['shift']());}};_0x497014(++_0x595dfe);}(_0x3d15,0x17f));var _0x53d1=function(_0x28caf4,_0x797e55){_0x28caf4=_0x28caf4-0x0;var _0x503f93=_0x3d15[_0x28caf4];return _0x503f93;};'use strict';var client=require(_0x53d1('0x0'));exports['getIntervals']=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x53d1('0x1')],'include':[{'model':_0x53d1('0x2'),'as':_0x53d1('0x3'),'attributes':['id',_0x53d1('0x1'),_0x53d1('0x4')]}]},'log':_0x53d1('0x5')});};}; \ No newline at end of file +var _0x6e25=['name','Interval','interval','../client','getIntervals','Request','GetInterval'];(function(_0xf9dc73,_0x2b0cb8){var _0x5a6dae=function(_0x142fbe){while(--_0x142fbe){_0xf9dc73['push'](_0xf9dc73['shift']());}};_0x5a6dae(++_0x2b0cb8);}(_0x6e25,0x65));var _0x56e2=function(_0x59342a,_0x16827b){_0x59342a=_0x59342a-0x0;var _0x17abc9=_0x6e25[_0x59342a];return _0x17abc9;};'use strict';var client=require(_0x56e2('0x0'));exports[_0x56e2('0x1')]=function(){return function(){return client[_0x56e2('0x2')](_0x56e2('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x56e2('0x4')],'include':[{'model':_0x56e2('0x5'),'as':'Intervals','attributes':['id','name',_0x56e2('0x6')]}]},'log':_0x56e2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index b213621..a3ea013 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 _0x1eba=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0x1eba[_0x2cde0a];return _0x260610;};'use strict';var client=require(_0xa1eb('0x0'));exports[_0xa1eb('0x1')]=function(_0x406a58,_0x2158d5){return client[_0xa1eb('0x2')]('UpdateMailInteraction',{'body':_0x2158d5,'options':{'where':{'id':_0x406a58}},'log':'updateMailInteraction'});};exports[_0xa1eb('0x3')]=function(_0x34be5a,_0x16a13a){return client[_0xa1eb('0x2')](_0xa1eb('0x4'),{'body':_0x16a13a,'options':{'where':{'id':_0x34be5a}},'log':_0xa1eb('0x5')});}; \ No newline at end of file +var _0x3de3=['../client','UpdateMailInteraction','updateMailInteraction','addTags','Request','AddTagsToMailInteraction'];(function(_0x5c3dd3,_0x4a252b){var _0x115d79=function(_0x3c8f1e){while(--_0x3c8f1e){_0x5c3dd3['push'](_0x5c3dd3['shift']());}};_0x115d79(++_0x4a252b);}(_0x3de3,0x1ce));var _0x33de=function(_0x112e34,_0x5ada1b){_0x112e34=_0x112e34-0x0;var _0x4da89e=_0x3de3[_0x112e34];return _0x4da89e;};'use strict';var client=require(_0x33de('0x0'));exports['update']=function(_0x19d1ba,_0x100783){return client['Request'](_0x33de('0x1'),{'body':_0x100783,'options':{'where':{'id':_0x19d1ba}},'log':_0x33de('0x2')});};exports[_0x33de('0x3')]=function(_0xbdd404,_0x56b413){return client[_0x33de('0x4')](_0x33de('0x5'),{'body':_0x56b413,'options':{'where':{'id':_0xbdd404}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 7b53d28..7e44116 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 _0xf26b=['create','Request','CreateMailMessage'];(function(_0x4035b1,_0x14eed8){var _0x5c65b2=function(_0xb6c0a3){while(--_0xb6c0a3){_0x4035b1['push'](_0x4035b1['shift']());}};_0x5c65b2(++_0x14eed8);}(_0xf26b,0x183));var _0xbf26=function(_0x4926c7,_0x88884c){_0x4926c7=_0x4926c7-0x0;var _0x40bd06=_0xf26b[_0x4926c7];return _0x40bd06;};'use strict';var client=require('../client');exports[_0xbf26('0x0')]=function(_0x4c700d){return client[_0xbf26('0x1')](_0xbf26('0x2'),{'body':_0x4c700d,'log':'createMailMessage'});}; \ No newline at end of file +var _0x563b=['create','../client'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x563b,0x73));var _0xb563=function(_0x298421,_0x33af0e){_0x298421=_0x298421-0x0;var _0x3ac563=_0x563b[_0x298421];return _0x3ac563;};'use strict';var client=require(_0xb563('0x0'));exports[_0xb563('0x1')]=function(_0x3fcef2){return client['Request']('CreateMailMessage',{'body':_0x3fcef2,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 93b7ab6..8079727 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 _0xd3df=['Agents','name','online','../client','getMailQueues','Request','GetMailQueue'];(function(_0x3d8785,_0x55603f){var _0x27458b=function(_0x2c8ec3){while(--_0x2c8ec3){_0x3d8785['push'](_0x3d8785['shift']());}};_0x27458b(++_0x55603f);}(_0xd3df,0xab));var _0xfd3d=function(_0x182ef5,_0x3439f8){_0x182ef5=_0x182ef5-0x0;var _0x3e1d9a=_0xd3df[_0x182ef5];return _0x3e1d9a;};'use strict';var client=require(_0xfd3d('0x0'));exports[_0xfd3d('0x1')]=function(){return function(){return client[_0xfd3d('0x2')](_0xfd3d('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':'User','as':_0xfd3d('0x4'),'attributes':['id',_0xfd3d('0x5'),_0xfd3d('0x6'),'mailPause']}]},'log':_0xfd3d('0x1')});};}; \ No newline at end of file +var _0xf465=['getMailQueues','Request','GetMailQueue','timeout','User','online','mailPause','../client'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf465,0x8f));var _0x5f46=function(_0x26cebc,_0x4fbbfa){_0x26cebc=_0x26cebc-0x0;var _0x18cf95=_0xf465[_0x26cebc];return _0x18cf95;};'use strict';var client=require(_0x5f46('0x0'));exports[_0x5f46('0x1')]=function(){return function(){return client[_0x5f46('0x2')](_0x5f46('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x5f46('0x4'),'strategy'],'include':[{'model':_0x5f46('0x5'),'as':'Agents','attributes':['id','name',_0x5f46('0x6'),_0x5f46('0x7')]}]},'log':_0x5f46('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 455a8ba..281869e 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 _0xf189=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x7867c9,_0x2e12d0){var _0x5d17fc=function(_0x4a141b){while(--_0x4a141b){_0x7867c9['push'](_0x7867c9['shift']());}};_0x5d17fc(++_0x2e12d0);}(_0xf189,0xb0));var _0x9f18=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf189[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x9f18('0x0'));exports[_0x9f18('0x1')]=function(_0x4dfc4d){return client[_0x9f18('0x2')](_0x9f18('0x3'),{'body':_0x4dfc4d,'log':_0x9f18('0x3')});};exports[_0x9f18('0x4')]=function(_0x2b4c92,_0x147a6a){return client[_0x9f18('0x2')](_0x9f18('0x5'),{'body':_0x147a6a,'options':{'where':{'uniqueid':_0x2b4c92},'order':[['id',_0x9f18('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x8235=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x468668,_0x16c8dd){var _0x4a8820=function(_0x2f0430){while(--_0x2f0430){_0x468668['push'](_0x468668['shift']());}};_0x4a8820(++_0x16c8dd);}(_0x8235,0x1a5));var _0x5823=function(_0x53b450,_0x347ca5){_0x53b450=_0x53b450-0x0;var _0x3e38ec=_0x8235[_0x53b450];return _0x3e38ec;};'use strict';var client=require(_0x5823('0x0'));exports[_0x5823('0x1')]=function(_0x593949){return client[_0x5823('0x2')](_0x5823('0x3'),{'body':_0x593949,'log':'CreateMailQueueReport'});};exports[_0x5823('0x4')]=function(_0x4064e9,_0x33c854){return client[_0x5823('0x2')](_0x5823('0x5'),{'body':_0x33c854,'options':{'where':{'uniqueid':_0x4064e9},'order':[['id',_0x5823('0x6')]],'limit':0x1},'log':_0x5823('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index f0d3283..8a47369 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 _0x8557=['Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x59ffff,_0x5bd5cf){var _0x1d3757=function(_0x1739e5){while(--_0x1739e5){_0x59ffff['push'](_0x59ffff['shift']());}};_0x1d3757(++_0x5bd5cf);}(_0x8557,0xc5));var _0x7855=function(_0x5df2df,_0x34d2f5){_0x5df2df=_0x5df2df-0x0;var _0x69a0af=_0x8557[_0x5df2df];return _0x69a0af;};'use strict';var client=require(_0x7855('0x0'));exports['update']=function(_0x48fbed,_0x404aa2){return client[_0x7855('0x1')]('UpdateOpenchannelInteraction',{'body':_0x404aa2,'options':{'where':{'id':_0x48fbed}},'log':_0x7855('0x2')});};exports[_0x7855('0x3')]=function(_0x1ceb69,_0x51a5b4){return client['Request'](_0x7855('0x4'),{'body':_0x51a5b4,'options':{'where':{'id':_0x1ceb69}},'log':_0x7855('0x5')});}; \ No newline at end of file +var _0x14a4=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x377756,_0x393726){var _0x5c4f4c=function(_0x32fb00){while(--_0x32fb00){_0x377756['push'](_0x377756['shift']());}};_0x5c4f4c(++_0x393726);}(_0x14a4,0x71));var _0x414a=function(_0x3e6852,_0x481312){_0x3e6852=_0x3e6852-0x0;var _0x389515=_0x14a4[_0x3e6852];return _0x389515;};'use strict';var client=require(_0x414a('0x0'));exports['update']=function(_0x16373b,_0x2e8256){return client[_0x414a('0x1')](_0x414a('0x2'),{'body':_0x2e8256,'options':{'where':{'id':_0x16373b}},'log':_0x414a('0x3')});};exports[_0x414a('0x4')]=function(_0x2543b7,_0x5ad89c){return client[_0x414a('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x5ad89c,'options':{'where':{'id':_0x2543b7}},'log':_0x414a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index b991fbd..b8ee384 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 _0x5c7d=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5c7d,0x149));var _0xd5c7=function(_0x1517e2,_0x85febe){_0x1517e2=_0x1517e2-0x0;var _0x81b4bc=_0x5c7d[_0x1517e2];return _0x81b4bc;};'use strict';var client=require(_0xd5c7('0x0'));exports[_0xd5c7('0x1')]=function(_0x130ef1){return client[_0xd5c7('0x2')](_0xd5c7('0x3'),{'body':_0x130ef1,'log':_0xd5c7('0x4')});}; \ No newline at end of file +var _0x6c5b=['createOpenchannelMessage','../client','create','Request'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0x6c5b,0xc5));var _0xb6c5=function(_0x32e29c,_0x260b4e){_0x32e29c=_0x32e29c-0x0;var _0x96c768=_0x6c5b[_0x32e29c];return _0x96c768;};'use strict';var client=require(_0xb6c5('0x0'));exports[_0xb6c5('0x1')]=function(_0x477c5e){return client[_0xb6c5('0x2')]('CreateOpenchannelMessage',{'body':_0x477c5e,'log':_0xb6c5('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 0e764be..54b2e92 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 _0x85ae=['timeout','User','Agents','online','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x4fd5d3,_0x214090){var _0xf62a8b=function(_0x500b1e){while(--_0x500b1e){_0x4fd5d3['push'](_0x4fd5d3['shift']());}};_0xf62a8b(++_0x214090);}(_0x85ae,0xf7));var _0xe85a=function(_0x37a78b,_0x411e6b){_0x37a78b=_0x37a78b-0x0;var _0x41b329=_0x85ae[_0x37a78b];return _0x41b329;};'use strict';var client=require(_0xe85a('0x0'));exports[_0xe85a('0x1')]=function(){return function(){return client[_0xe85a('0x2')](_0xe85a('0x3'),{'options':{'raw':![],'attributes':['id',_0xe85a('0x4'),_0xe85a('0x5'),'strategy'],'include':[{'model':_0xe85a('0x6'),'as':_0xe85a('0x7'),'attributes':['id',_0xe85a('0x4'),_0xe85a('0x8'),'openchannelPause']}]},'log':_0xe85a('0x1')});};}; \ No newline at end of file +var _0x5a4b=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','Agents','openchannelPause','../client'];(function(_0x3cbf9b,_0x1b1b2d){var _0x5e8205=function(_0x1213b2){while(--_0x1213b2){_0x3cbf9b['push'](_0x3cbf9b['shift']());}};_0x5e8205(++_0x1b1b2d);}(_0x5a4b,0x1a6));var _0xb5a4=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x5a4b[_0x2070da];return _0x4f9fe1;};'use strict';var client=require(_0xb5a4('0x0'));exports[_0xb5a4('0x1')]=function(){return function(){return client[_0xb5a4('0x2')](_0xb5a4('0x3'),{'options':{'raw':![],'attributes':['id',_0xb5a4('0x4'),_0xb5a4('0x5'),_0xb5a4('0x6')],'include':[{'model':'User','as':_0xb5a4('0x7'),'attributes':['id','name','online',_0xb5a4('0x8')]}]},'log':_0xb5a4('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 39262b4..8da0433 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 _0x9744=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9744,0x1ea));var _0x4974=function(_0x1b4749,_0x548ecf){_0x1b4749=_0x1b4749-0x0;var _0x28d020=_0x9744[_0x1b4749];return _0x28d020;};'use strict';var client=require(_0x4974('0x0'));exports[_0x4974('0x1')]=function(_0x550fb9){return client[_0x4974('0x2')](_0x4974('0x3'),{'body':_0x550fb9,'log':_0x4974('0x3')});};exports[_0x4974('0x4')]=function(_0x1bb8ea,_0x2b3142){return client[_0x4974('0x2')](_0x4974('0x5'),{'body':_0x2b3142,'options':{'where':{'uniqueid':_0x1bb8ea},'order':[['id',_0x4974('0x6')]],'limit':0x1},'log':_0x4974('0x5')});}; \ No newline at end of file +var _0x4cbc=['DESC','../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x103d2c,_0x524121){var _0x1e09e6=function(_0x35ffff){while(--_0x35ffff){_0x103d2c['push'](_0x103d2c['shift']());}};_0x1e09e6(++_0x524121);}(_0x4cbc,0x1cf));var _0xc4cb=function(_0x51aebb,_0x337d75){_0x51aebb=_0x51aebb-0x0;var _0x4d162e=_0x4cbc[_0x51aebb];return _0x4d162e;};'use strict';var client=require(_0xc4cb('0x0'));exports[_0xc4cb('0x1')]=function(_0x259b58){return client[_0xc4cb('0x2')](_0xc4cb('0x3'),{'body':_0x259b58,'log':_0xc4cb('0x3')});};exports[_0xc4cb('0x4')]=function(_0x2f2301,_0x29af26){return client[_0xc4cb('0x2')](_0xc4cb('0x5'),{'body':_0x29af26,'options':{'where':{'uniqueid':_0x2f2301},'order':[['id',_0xc4cb('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index d9059df..c18a546 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 _0xcee8=['UpdateSmsInteraction','addTags','addTagsToSmsInteraction','../client','update','Request'];(function(_0x9f39cd,_0x54ddae){var _0x3bd683=function(_0x87a8f9){while(--_0x87a8f9){_0x9f39cd['push'](_0x9f39cd['shift']());}};_0x3bd683(++_0x54ddae);}(_0xcee8,0xb1));var _0x8cee=function(_0x915572,_0x525887){_0x915572=_0x915572-0x0;var _0xf011c8=_0xcee8[_0x915572];return _0xf011c8;};'use strict';var client=require(_0x8cee('0x0'));exports[_0x8cee('0x1')]=function(_0x2a57bd,_0x1471b2){return client[_0x8cee('0x2')](_0x8cee('0x3'),{'body':_0x1471b2,'options':{'where':{'id':_0x2a57bd}},'log':'updateSmsInteraction'});};exports[_0x8cee('0x4')]=function(_0x4e4143,_0xffd42d){return client[_0x8cee('0x2')]('AddTagsToSmsInteraction',{'body':_0xffd42d,'options':{'where':{'id':_0x4e4143}},'log':_0x8cee('0x5')});}; \ No newline at end of file +var _0xf452=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0xd80622,_0x1b700a){var _0xb45dfb=function(_0x14fe1e){while(--_0x14fe1e){_0xd80622['push'](_0xd80622['shift']());}};_0xb45dfb(++_0x1b700a);}(_0xf452,0x13b));var _0x2f45=function(_0x276d43,_0x509837){_0x276d43=_0x276d43-0x0;var _0x218b21=_0xf452[_0x276d43];return _0x218b21;};'use strict';var client=require(_0x2f45('0x0'));exports[_0x2f45('0x1')]=function(_0x55d48e,_0x3b13d3){return client[_0x2f45('0x2')](_0x2f45('0x3'),{'body':_0x3b13d3,'options':{'where':{'id':_0x55d48e}},'log':_0x2f45('0x4')});};exports[_0x2f45('0x5')]=function(_0x3f0b30,_0x24c61d){return client[_0x2f45('0x2')](_0x2f45('0x6'),{'body':_0x24c61d,'options':{'where':{'id':_0x3f0b30}},'log':_0x2f45('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 0e30c63..af206e6 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 _0x14b9=['CreateSmsMessage','../client','Request'];(function(_0x35081f,_0x52afa5){var _0x4365d9=function(_0x5d8e3d){while(--_0x5d8e3d){_0x35081f['push'](_0x35081f['shift']());}};_0x4365d9(++_0x52afa5);}(_0x14b9,0x1c9));var _0x914b=function(_0x12a877,_0x3da530){_0x12a877=_0x12a877-0x0;var _0x581184=_0x14b9[_0x12a877];return _0x581184;};'use strict';var client=require(_0x914b('0x0'));exports['create']=function(_0x338327){return client[_0x914b('0x1')](_0x914b('0x2'),{'body':_0x338327,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x9e29=['Request','../client','create'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x9e29,0x17e));var _0x99e2=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x9e29[_0x4dc7b9];return _0x3ab114;};'use strict';var client=require(_0x99e2('0x0'));exports[_0x99e2('0x1')]=function(_0x179347){return client[_0x99e2('0x2')]('CreateSmsMessage',{'body':_0x179347,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 0946279..3b4facf 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x35c300,_0x284351){var _0x59e44b=function(_0x327e5c){while(--_0x327e5c){_0x35c300['push'](_0x35c300['shift']());}};_0x59e44b(++_0x284351);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x303ded,_0x4aa993){var _0xf693ea=function(_0x863cbf){while(--_0x863cbf){_0x303ded['push'](_0x303ded['shift']());}};_0xf693ea(++_0x4aa993);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 737411c..f46043f 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x9ec3bf,_0x1cc976){var _0x46f792=function(_0x21922b){while(--_0x21922b){_0x9ec3bf['push'](_0x9ec3bf['shift']());}};_0x46f792(++_0x1cc976);}(_0x34e8,0x12c));var _0x834e=function(_0x2e290c,_0x4204b3){_0x2e290c=_0x2e290c-0x0;var _0x3b2311=_0x34e8[_0x2e290c];return _0x3b2311;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x32e48c,_0x34673b){var _0x465027=function(_0x14e878){while(--_0x14e878){_0x32e48c['push'](_0x32e48c['shift']());}};_0x465027(++_0x34673b);}(_0x34e8,0x12c));var _0x834e=function(_0x39d3b2,_0x3e23d){_0x39d3b2=_0x39d3b2-0x0;var _0x2a2764=_0x34e8[_0x39d3b2];return _0x2a2764;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 84fbd55..986aabe 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(_0x144d9a,_0x55a411){var _0x42c1c2=function(_0x20baf5){while(--_0x20baf5){_0x144d9a['push'](_0x144d9a['shift']());}};_0x42c1c2(++_0x55a411);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x59bca9,_0x3cf77f){var _0x472e28=function(_0x3175e4){while(--_0x3175e4){_0x59bca9['push'](_0x59bca9['shift']());}};_0x472e28(++_0x3cf77f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 84ec6ac..e036abe 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcedf=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','../client','update'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xcedf,0x1b6));var _0xfced=function(_0x30c906,_0x13a7e1){_0x30c906=_0x30c906-0x0;var _0x4685bd=_0xcedf[_0x30c906];return _0x4685bd;};'use strict';var client=require(_0xfced('0x0'));exports[_0xfced('0x1')]=function(_0x1ce4e6,_0x157ed6){return client['Request'](_0xfced('0x2'),{'body':_0x157ed6,'options':{'where':{'id':_0x1ce4e6}},'log':_0xfced('0x3')});};exports['addTags']=function(_0x5b16af,_0x1dad76){return client['Request'](_0xfced('0x4'),{'body':_0x1dad76,'options':{'where':{'id':_0x5b16af}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x6eed=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','updateWhatsappInteraction'];(function(_0x5bd1f3,_0x209c43){var _0x521d80=function(_0x3b76db){while(--_0x3b76db){_0x5bd1f3['push'](_0x5bd1f3['shift']());}};_0x521d80(++_0x209c43);}(_0x6eed,0xff));var _0xd6ee=function(_0x5f2349,_0x551a0d){_0x5f2349=_0x5f2349-0x0;var _0x50bc34=_0x6eed[_0x5f2349];return _0x50bc34;};'use strict';var client=require(_0xd6ee('0x0'));exports[_0xd6ee('0x1')]=function(_0x1d3217,_0x27b7bf){return client[_0xd6ee('0x2')]('UpdateWhatsappInteraction',{'body':_0x27b7bf,'options':{'where':{'id':_0x1d3217}},'log':_0xd6ee('0x3')});};exports[_0xd6ee('0x4')]=function(_0x588715,_0x53cce9){return client[_0xd6ee('0x2')](_0xd6ee('0x5'),{'body':_0x53cce9,'options':{'where':{'id':_0x588715}},'log':_0xd6ee('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 60559c4..596d4a8 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 _0x2207=['../client','create','createWhatsappMessage'];(function(_0x343703,_0xffcbea){var _0x5134cd=function(_0x4ede89){while(--_0x4ede89){_0x343703['push'](_0x343703['shift']());}};_0x5134cd(++_0xffcbea);}(_0x2207,0x180));var _0x7220=function(_0x22022f,_0x2525c4){_0x22022f=_0x22022f-0x0;var _0x3ba9a2=_0x2207[_0x22022f];return _0x3ba9a2;};'use strict';var client=require(_0x7220('0x0'));exports[_0x7220('0x1')]=function(_0x1edd56){return client['Request']('CreateWhatsappMessage',{'body':_0x1edd56,'log':_0x7220('0x2')});}; \ No newline at end of file +var _0x18da=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x56739b,_0x2d2cc9){var _0x1c752f=function(_0x228220){while(--_0x228220){_0x56739b['push'](_0x56739b['shift']());}};_0x1c752f(++_0x2d2cc9);}(_0x18da,0x167));var _0xa18d=function(_0x438c12,_0x14ae57){_0x438c12=_0x438c12-0x0;var _0x3d76e6=_0x18da[_0x438c12];return _0x3d76e6;};'use strict';var client=require(_0xa18d('0x0'));exports[_0xa18d('0x1')]=function(_0x5654e1){return client[_0xa18d('0x2')](_0xa18d('0x3'),{'body':_0x5654e1,'log':_0xa18d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 63eef62..741b612 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 _0xcefa=['Request','GetWhatsappQueue','name','timeout','strategy','Agents','online','whatsappPause','getWhatsappQueues','../client'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xcefa,0x1ad));var _0xacef=function(_0x289330,_0x54f85a){_0x289330=_0x289330-0x0;var _0x22d2d0=_0xcefa[_0x289330];return _0x22d2d0;};'use strict';var client=require(_0xacef('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xacef('0x1')](_0xacef('0x2'),{'options':{'raw':![],'attributes':['id',_0xacef('0x3'),_0xacef('0x4'),_0xacef('0x5')],'include':[{'model':'User','as':_0xacef('0x6'),'attributes':['id',_0xacef('0x3'),_0xacef('0x7'),_0xacef('0x8')]}]},'log':_0xacef('0x9')});};}; \ No newline at end of file +var _0xc92f=['../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','whatsappPause'];(function(_0x465f47,_0xa750e7){var _0x23740f=function(_0x208bd2){while(--_0x208bd2){_0x465f47['push'](_0x465f47['shift']());}};_0x23740f(++_0xa750e7);}(_0xc92f,0x136));var _0xfc92=function(_0xad12e7,_0x2301f1){_0xad12e7=_0xad12e7-0x0;var _0x2316ca=_0xc92f[_0xad12e7];return _0x2316ca;};'use strict';var client=require(_0xfc92('0x0'));exports[_0xfc92('0x1')]=function(){return function(){return client[_0xfc92('0x2')](_0xfc92('0x3'),{'options':{'raw':![],'attributes':['id',_0xfc92('0x4'),_0xfc92('0x5'),_0xfc92('0x6')],'include':[{'model':_0xfc92('0x7'),'as':_0xfc92('0x8'),'attributes':['id',_0xfc92('0x4'),'online',_0xfc92('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 8c4df2e..e62f2f4 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 _0xa486=['../client','Request','CreateWhatsappQueueReport','update','DESC'];(function(_0x3968bf,_0x2231f4){var _0x3c93f0=function(_0x5c7110){while(--_0x5c7110){_0x3968bf['push'](_0x3968bf['shift']());}};_0x3c93f0(++_0x2231f4);}(_0xa486,0xeb));var _0x6a48=function(_0x1dd2b5,_0x175d22){_0x1dd2b5=_0x1dd2b5-0x0;var _0x3054d0=_0xa486[_0x1dd2b5];return _0x3054d0;};'use strict';var client=require(_0x6a48('0x0'));exports['create']=function(_0x6d9df5){return client[_0x6a48('0x1')](_0x6a48('0x2'),{'body':_0x6d9df5,'log':_0x6a48('0x2')});};exports[_0x6a48('0x3')]=function(_0x38d8ea,_0x12fce1){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x12fce1,'options':{'where':{'uniqueid':_0x38d8ea},'order':[['id',_0x6a48('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x1d6f=['update','UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x3c9cd1,_0x555129){var _0x4820a9=function(_0x1e552e){while(--_0x1e552e){_0x3c9cd1['push'](_0x3c9cd1['shift']());}};_0x4820a9(++_0x555129);}(_0x1d6f,0x73));var _0xf1d6=function(_0x494be2,_0x254a77){_0x494be2=_0x494be2-0x0;var _0x35224d=_0x1d6f[_0x494be2];return _0x35224d;};'use strict';var client=require(_0xf1d6('0x0'));exports[_0xf1d6('0x1')]=function(_0x3d7a48){return client[_0xf1d6('0x2')](_0xf1d6('0x3'),{'body':_0x3d7a48,'log':_0xf1d6('0x3')});};exports[_0xf1d6('0x4')]=function(_0x591b5f,_0x19601b){return client[_0xf1d6('0x2')](_0xf1d6('0x5'),{'body':_0x19601b,'options':{'where':{'uniqueid':_0x591b5f},'order':[['id',_0xf1d6('0x6')]],'limit':0x1},'log':_0xf1d6('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 343ae92..78965b5 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 _0x2fed=['string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','error','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','./strategy'];(function(_0x736e58,_0x803a63){var _0x14ef6b=function(_0x181675){while(--_0x181675){_0x736e58['push'](_0x736e58['shift']());}};_0x14ef6b(++_0x803a63);}(_0x2fed,0x69));var _0xd2fe=function(_0x3aeaf1,_0x261df5){_0x3aeaf1=_0x3aeaf1-0x0;var _0x5cc62f=_0x2fed[_0x3aeaf1];return _0x5cc62f;};'use strict';var schema=require(_0xd2fe('0x0'));var _=require(_0xd2fe('0x1'));var util=require(_0xd2fe('0x2'));var seqqueue=require(_0xd2fe('0x3'));var logger=require('../../../../config/logger')(_0xd2fe('0x4'));var strategy=require(_0xd2fe('0x5'));var queue=schema({'name':{'type':_0xd2fe('0x6'),'required':!![],'message':_0xd2fe('0x7')},'timeout':{'type':'number','message':_0xd2fe('0x8')}});function writeLog(_0x505e9f,_0x18987f,_0x4b5538){return logger[_0xd2fe('0x9')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x505e9f,_0x18987f[_0xd2fe('0xa')],_0x4b5538));}function handleFindAgent(_0x4d31d8){return function(_0x428a6e){return _0x428a6e['name'][_0xd2fe('0xb')]()===_0x4d31d8[_0xd2fe('0xb')]();};}exports[_0xd2fe('0xc')]=function(_0x25d7d7,_0x46d8ba,_0x2b824a,_0x3200be){return function(_0x31b2f0){try{var _0x35fde8={'name':_0x46d8ba[0x0],'timeout':_0x46d8ba[0x1]};var _0x372476=queue[_0xd2fe('0x0')](_0x35fde8,{'typecast':!![]});if(_0x372476[_0xd2fe('0xd')]){logger[_0xd2fe('0xe')]('[%s][AGENT]\x20%s',_0x25d7d7,_[_0xd2fe('0xf')](_0x372476,_0xd2fe('0x10'))[_0xd2fe('0x11')](',\x20'));_0x31b2f0[_0xd2fe('0x12')]();}else{var _0x29dd97=_[_0xd2fe('0x13')](_0x2b824a[_0xd2fe('0x14')],handleFindAgent(_0x35fde8[_0xd2fe('0xa')]));if(_0x29dd97){var _0x7cc775=(_0x35fde8[_0xd2fe('0x15')]||0xa)*0x3e8;var _0x20dc5b,_0x408499;var _0x1468c1=seqqueue[_0xd2fe('0x16')](_0x7cc775);_0x1468c1['id']=_0x25d7d7;_0x1468c1[_0xd2fe('0x17')]=_0x7cc775;_0x1468c1[_0xd2fe('0x18')]=_0x3200be[_0xd2fe('0x18')];writeLog(_0x25d7d7,_0x29dd97,util['format'](_0xd2fe('0x19'),_0x7cc775));_0x2b824a[_0xd2fe('0x1a')][_0x25d7d7]['on'](_0xd2fe('0x1b'),function(){logger[_0xd2fe('0x9')](_0xd2fe('0x1c'),_0x25d7d7);clearTimeout(_0x408499);_0x408499=undefined;_0x1468c1['close']();if(_0x2b824a[_0xd2fe('0x1a')][_0x25d7d7]){delete _0x2b824a[_0xd2fe('0x1a')][_0x25d7d7];}_0x31b2f0['stop']();});_0x2b824a[_0xd2fe('0x1a')][_0x25d7d7]['on']('complete',function(){if(_0x2b824a['rules'][_0x25d7d7]){delete _0x2b824a['rules'][_0x25d7d7];}});_0x408499=setTimeout(function(){logger[_0xd2fe('0x9')](_0xd2fe('0x1d'),_0x25d7d7);clearTimeout(_0x408499);_0x1468c1[_0xd2fe('0x1e')]();_0x31b2f0[_0xd2fe('0x1f')]();},_0x7cc775);strategy[_0xd2fe('0x20')](_0x1468c1,_0x29dd97,_0x2b824a,_0x3200be);}else{logger['error'](_0xd2fe('0x21'),_0x25d7d7,_0x35fde8[_0xd2fe('0xa')]);_0x31b2f0[_0xd2fe('0x12')]();}}}catch(_0x305ee6){console[_0xd2fe('0x22')](_0x305ee6);logger['error'](_0xd2fe('0x23'),_0x25d7d7,_0x305ee6[_0xd2fe('0x24')]);_0x31b2f0[_0xd2fe('0x12')]();}};}; \ No newline at end of file +var _0x2d68=['[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','complete','close','next','agent'];(function(_0x51c2d3,_0x12ab5f){var _0x491337=function(_0x277735){while(--_0x277735){_0x51c2d3['push'](_0x51c2d3['shift']());}};_0x491337(++_0x12ab5f);}(_0x2d68,0x150));var _0x82d6=function(_0x31ba1a,_0x4e88ce){_0x31ba1a=_0x31ba1a-0x0;var _0xf8402b=_0x2d68[_0x31ba1a];return _0xf8402b;};'use strict';var schema=require(_0x82d6('0x0'));var _=require(_0x82d6('0x1'));var util=require(_0x82d6('0x2'));var seqqueue=require(_0x82d6('0x3'));var logger=require(_0x82d6('0x4'))(_0x82d6('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x82d6('0x6')},'timeout':{'type':_0x82d6('0x7'),'message':_0x82d6('0x8')}});function writeLog(_0x435c6e,_0x2d0cf9,_0x4d24e1){return logger[_0x82d6('0x9')](util[_0x82d6('0xa')](_0x82d6('0xb'),_0x435c6e,_0x2d0cf9[_0x82d6('0xc')],_0x4d24e1));}function handleFindAgent(_0x9771f1){return function(_0x420e0c){return _0x420e0c['name'][_0x82d6('0xd')]()===_0x9771f1[_0x82d6('0xd')]();};}exports[_0x82d6('0xe')]=function(_0x323e4d,_0x44636f,_0x496d1d,_0x194de6){return function(_0x51691f){try{var _0x5da9f6={'name':_0x44636f[0x0],'timeout':_0x44636f[0x1]};var _0x202f3a=queue[_0x82d6('0x0')](_0x5da9f6,{'typecast':!![]});if(_0x202f3a[_0x82d6('0xf')]){logger[_0x82d6('0x10')](_0x82d6('0x11'),_0x323e4d,_[_0x82d6('0x12')](_0x202f3a,'message')['join'](',\x20'));_0x51691f['stop']();}else{var _0xf0e4f6=_[_0x82d6('0x13')](_0x496d1d[_0x82d6('0x14')],handleFindAgent(_0x5da9f6[_0x82d6('0xc')]));if(_0xf0e4f6){var _0x323817=(_0x5da9f6[_0x82d6('0x15')]||0xa)*0x3e8;var _0x566a05,_0x2fa093;var _0x549d2d=seqqueue[_0x82d6('0x16')](_0x323817);_0x549d2d['id']=_0x323e4d;_0x549d2d[_0x82d6('0x17')]=_0x323817;_0x549d2d[_0x82d6('0x18')]=_0x194de6['channel'];writeLog(_0x323e4d,_0xf0e4f6,util[_0x82d6('0xa')](_0x82d6('0x19'),_0x323817));_0x496d1d[_0x82d6('0x1a')][_0x323e4d]['on'](_0x82d6('0x1b'),function(){logger[_0x82d6('0x9')](_0x82d6('0x1c'),_0x323e4d);clearTimeout(_0x2fa093);_0x2fa093=undefined;_0x549d2d['close']();if(_0x496d1d[_0x82d6('0x1a')][_0x323e4d]){delete _0x496d1d[_0x82d6('0x1a')][_0x323e4d];}_0x51691f[_0x82d6('0x1d')]();});_0x496d1d[_0x82d6('0x1a')][_0x323e4d]['on'](_0x82d6('0x1e'),function(){if(_0x496d1d[_0x82d6('0x1a')][_0x323e4d]){delete _0x496d1d[_0x82d6('0x1a')][_0x323e4d];}});_0x2fa093=setTimeout(function(){logger[_0x82d6('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x323e4d);clearTimeout(_0x2fa093);_0x549d2d[_0x82d6('0x1f')]();_0x51691f[_0x82d6('0x20')]();},_0x323817);strategy[_0x82d6('0x21')](_0x549d2d,_0xf0e4f6,_0x496d1d,_0x194de6);}else{logger[_0x82d6('0x10')](_0x82d6('0x22'),_0x323e4d,_0x5da9f6[_0x82d6('0xc')]);_0x51691f[_0x82d6('0x1d')]();}}}catch(_0x165dd5){console['log'](_0x165dd5);logger['error'](_0x82d6('0x23'),_0x323e4d,_0x165dd5[_0x82d6('0x24')]);_0x51691f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 53c9e04..d34a986 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 _0xf3a8=['getMustacheRender','Message','create','info','catch','error','finally','stop','LexRuntime','message','toString','amazonlex','providerName','providerResponse','stringify','Failed','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','account','upperFirst','AccountId','InteractionId','created','isEmpty','body'];(function(_0x24d15a,_0x1f6bcf){var _0x261d7b=function(_0x3b8ee6){while(--_0x3b8ee6){_0x24d15a['push'](_0x24d15a['shift']());}};_0x261d7b(++_0x1f6bcf);}(_0xf3a8,0x1ae));var _0x8f3a=function(_0x4b0d76,_0x2a782f){_0x4b0d76=_0x4b0d76-0x0;var _0xe5528e=_0xf3a8[_0x4b0d76];return _0xe5528e;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x8f3a('0x0'))(_0x8f3a('0x1'));var rpc={'chatMessage':require(_0x8f3a('0x2')),'openchannelMessage':require(_0x8f3a('0x3')),'mailMessage':require(_0x8f3a('0x4')),'smsMessage':require(_0x8f3a('0x5')),'faxMessage':require(_0x8f3a('0x6')),'whatsappMessage':require(_0x8f3a('0x7'))};exports[_0x8f3a('0x8')]=function(_0x13407b,_0x53054b){return function(_0x558e63){try{if(!_[_0x8f3a('0x9')](this[_0x8f3a('0xa')][_0x8f3a('0xb')])){logger['info'](_0x8f3a('0xc'),_0x13407b,_0x8f3a('0xd'));return _0x558e63[_0x8f3a('0xe')]();}var _0x292d3c={'ContactId':this[_0x8f3a('0xf')]['id'],'sentAt':moment()[_0x8f3a('0x10')](_0x8f3a('0x11')),'direction':_0x8f3a('0x12')};if(this[_0x8f3a('0x13')]===_0x8f3a('0x14')||this[_0x8f3a('0x13')]===_0x8f3a('0x15')){_0x292d3c[_0x8f3a('0x16')]=this[_0x8f3a('0xa')][_0x8f3a('0x16')];}var _0x42b25d=this[_0x8f3a('0x13')];if(_0x42b25d==='chat'){_0x292d3c['ChatWebsiteId']=this[_0x8f3a('0x17')]['id'];}else{_0x292d3c[_[_0x8f3a('0x18')](_0x42b25d)+_0x8f3a('0x19')]=this[_0x8f3a('0x17')]['id'];}_0x292d3c[_['upperFirst'](_0x42b25d)+_0x8f3a('0x1a')]=this['interaction']['id'];if(this[_0x8f3a('0xa')][_0x8f3a('0x1b')]){var _0x49b879=_0x53054b[0x4];if(!_[_0x8f3a('0x1c')](_0x49b879)){_0x292d3c[_0x8f3a('0x1d')]=utils[_0x8f3a('0x1e')](_0x49b879,this);return rpc[_0x42b25d+_0x8f3a('0x1f')][_0x8f3a('0x20')](_0x292d3c)['then'](function(_0x55c4ec){logger[_0x8f3a('0x21')](_0x8f3a('0xc'),_0x13407b,_0x292d3c[_0x8f3a('0x1d')]);})[_0x8f3a('0x22')](function(_0x5e5859){logger[_0x8f3a('0x23')](_0x8f3a('0xc'),_0x13407b,JSON['stringify'](_0x5e5859));})[_0x8f3a('0x24')](function(){logger[_0x8f3a('0x21')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x13407b);_0x558e63['stop']();});}else{logger[_0x8f3a('0x21')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x13407b);_0x558e63[_0x8f3a('0x25')]();}}else{var _0x13bf5e=this;var _0x45e02d=new AWS[(_0x8f3a('0x26'))]({'accessKeyId':_0x53054b[0x0],'secretAccessKey':_0x53054b[0x1],'region':_0x53054b[0x2]});var _0x5bc2cd={'botAlias':'$LATEST','botName':_0x53054b[0x3],'inputText':this[_0x8f3a('0x27')]['body'],'userId':this[_0x8f3a('0x13')]+':'+this[_0x8f3a('0xa')]['id'][_0x8f3a('0x28')]()};_0x45e02d['postText'](_0x5bc2cd,function(_0x1ddb07,_0x3da7f4){if(_0x1ddb07){logger[_0x8f3a('0x23')](_0x8f3a('0xc'),_0x13407b,_0x1ddb07[_0x8f3a('0x27')]);_0x558e63['next']();}else if(_0x3da7f4&&_0x3da7f4[_0x8f3a('0x27')]){_0x13bf5e[_0x8f3a('0x1d')][_0x8f3a('0x29')]=_0x3da7f4;_0x292d3c[_0x8f3a('0x1d')]=_0x3da7f4[_0x8f3a('0x27')];_0x292d3c[_0x8f3a('0x2a')]=_0x8f3a('0x29');_0x292d3c[_0x8f3a('0x2b')]=JSON[_0x8f3a('0x2c')](_0x3da7f4);return rpc[_0x42b25d+'Message'][_0x8f3a('0x20')](_0x292d3c)['then'](function(_0x4462d2){logger['info']('[%s][AMAZONLEX]\x20%s',_0x13407b,_0x292d3c[_0x8f3a('0x1d')]);if(_0x3da7f4['dialogState']==_0x8f3a('0x2d')){_0x558e63[_0x8f3a('0xe')]();}else{_0x558e63[_0x8f3a('0x25')]();}})[_0x8f3a('0x22')](function(_0x471adc){logger[_0x8f3a('0x23')](_0x8f3a('0xc'),_0x13407b,JSON['stringify'](_0x471adc));_0x558e63[_0x8f3a('0xe')]();});}else{_0x558e63[_0x8f3a('0xe')]();}});}}catch(_0x53c406){logger[_0x8f3a('0x23')](_0x8f3a('0xc'),_0x13407b,JSON['stringify'](_0x53c406));_0x558e63['stop']();}};}; \ No newline at end of file +var _0xe5ce=['Message','create','Failed','error','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','account','InteractionId','created','isEmpty','getMustacheRender','catch','[%s][AMAZONLEX]\x20%s','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','body','toString','postText','message','providerResponse'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xe5ce,0x15c));var _0xee5c=function(_0x10f8e3,_0x426c27){_0x10f8e3=_0x10f8e3-0x0;var _0x34ff6c=_0xe5ce[_0x10f8e3];return _0x34ff6c;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0xee5c('0x0'));var logger=require(_0xee5c('0x1'))(_0xee5c('0x2'));var rpc={'chatMessage':require(_0xee5c('0x3')),'openchannelMessage':require(_0xee5c('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xee5c('0x5')),'whatsappMessage':require(_0xee5c('0x6'))};exports[_0xee5c('0x7')]=function(_0x5a810f,_0x5a4008){return function(_0x3ae726){try{if(!_[_0xee5c('0x8')](this[_0xee5c('0x9')]['UserId'])){logger[_0xee5c('0xa')]('[%s][AMAZONLEX]\x20%s',_0x5a810f,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3ae726[_0xee5c('0xb')]();}var _0x54abff={'ContactId':this[_0xee5c('0xc')]['id'],'sentAt':moment()['format'](_0xee5c('0xd')),'direction':_0xee5c('0xe')};if(this['channel']==='sms'||this[_0xee5c('0xf')]===_0xee5c('0x10')){_0x54abff[_0xee5c('0x11')]=this['interaction'][_0xee5c('0x11')];}var _0x2eac18=this[_0xee5c('0xf')];if(_0x2eac18===_0xee5c('0x12')){_0x54abff[_0xee5c('0x13')]=this['account']['id'];}else{_0x54abff[_[_0xee5c('0x14')](_0x2eac18)+'AccountId']=this[_0xee5c('0x15')]['id'];}_0x54abff[_[_0xee5c('0x14')](_0x2eac18)+_0xee5c('0x16')]=this['interaction']['id'];if(this['interaction'][_0xee5c('0x17')]){var _0x56d990=_0x5a4008[0x4];if(!_[_0xee5c('0x18')](_0x56d990)){_0x54abff['body']=utils[_0xee5c('0x19')](_0x56d990,this);return rpc[_0x2eac18+'Message']['create'](_0x54abff)['then'](function(_0x5c3000){logger[_0xee5c('0xa')]('[%s][AMAZONLEX]\x20%s',_0x5a810f,_0x54abff['body']);})[_0xee5c('0x1a')](function(_0x5db2ef){logger['error'](_0xee5c('0x1b'),_0x5a810f,JSON[_0xee5c('0x1c')](_0x5db2ef));})[_0xee5c('0x1d')](function(){logger[_0xee5c('0xa')](_0xee5c('0x1e'),_0x5a810f);_0x3ae726[_0xee5c('0x1f')]();});}else{logger[_0xee5c('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5a810f);_0x3ae726[_0xee5c('0x1f')]();}}else{var _0x1dc2a2=this;var _0x2b4ace=new AWS[(_0xee5c('0x20'))]({'accessKeyId':_0x5a4008[0x0],'secretAccessKey':_0x5a4008[0x1],'region':_0x5a4008[0x2]});var _0x5d4201={'botAlias':_0xee5c('0x21'),'botName':_0x5a4008[0x3],'inputText':this['message'][_0xee5c('0x22')],'userId':this['channel']+':'+this[_0xee5c('0x9')]['id'][_0xee5c('0x23')]()};_0x2b4ace[_0xee5c('0x24')](_0x5d4201,function(_0x15a809,_0x2825d7){if(_0x15a809){logger['error'](_0xee5c('0x1b'),_0x5a810f,_0x15a809['message']);_0x3ae726[_0xee5c('0xb')]();}else if(_0x2825d7&&_0x2825d7[_0xee5c('0x25')]){_0x1dc2a2['body']['amazonlex']=_0x2825d7;_0x54abff[_0xee5c('0x22')]=_0x2825d7[_0xee5c('0x25')];_0x54abff['providerName']='amazonlex';_0x54abff[_0xee5c('0x26')]=JSON[_0xee5c('0x1c')](_0x2825d7);return rpc[_0x2eac18+_0xee5c('0x27')][_0xee5c('0x28')](_0x54abff)['then'](function(_0x379a85){logger['info'](_0xee5c('0x1b'),_0x5a810f,_0x54abff[_0xee5c('0x22')]);if(_0x2825d7['dialogState']==_0xee5c('0x29')){_0x3ae726['next']();}else{_0x3ae726[_0xee5c('0x1f')]();}})[_0xee5c('0x1a')](function(_0x122c9b){logger[_0xee5c('0x2a')](_0xee5c('0x1b'),_0x5a810f,JSON[_0xee5c('0x1c')](_0x122c9b));_0x3ae726[_0xee5c('0xb')]();});}else{_0x3ae726[_0xee5c('0xb')]();}});}}catch(_0x24f2d1){logger[_0xee5c('0x2a')](_0xee5c('0x1b'),_0x5a810f,JSON['stringify'](_0x24f2d1));_0x3ae726[_0xee5c('0x1f')]();}};}; \ 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 a6dea96..de55918 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 _0x4048=['next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','chat','account','AccountId','upperFirst','InteractionId','Message','messageId','html','','','auto-replied','All','sendMailMessage','smtpOptions','then','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','stringify','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','consequence','channel','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)'];(function(_0x1d5759,_0x417e09){var _0x51ddcd=function(_0x4e3f43){while(--_0x4e3f43){_0x1d5759['push'](_0x1d5759['shift']());}};_0x51ddcd(++_0x417e09);}(_0x4048,0x180));var _0x8404=function(_0x480d0d,_0x2b74fa){_0x480d0d=_0x480d0d-0x0;var _0x9a6442=_0x4048[_0x480d0d];return _0x9a6442;};'use strict';var _=require(_0x8404('0x0'));var moment=require('moment');var utils=require(_0x8404('0x1'));var logger=require('../../../../config/logger')(_0x8404('0x2'));var rpc={'chatMessage':require(_0x8404('0x3')),'openchannelMessage':require(_0x8404('0x4')),'mailMessage':require(_0x8404('0x5')),'smsMessage':require(_0x8404('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x8404('0x7')),'chatInteraction':require(_0x8404('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x8404('0x9')),'smsInteraction':require(_0x8404('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0x8404('0xb')]=function(_0x2b9f0b,_0xc3851d,_0x262fb3,_0xc74c39){return function(_0x5191d6){try{var _0x1c48b4=this[_0x8404('0xc')];if(_0x1c48b4==='mail'&&_0xc74c39[_0x8404('0xd')][_0x8404('0xe')]){logger[_0x8404('0xf')](_0x8404('0x10'),_0x2b9f0b,_0x8404('0x11'));return _0x5191d6[_0x8404('0x12')]();}if(_0xc3851d[0x0]==='1'&&(_[_0x8404('0x13')](this[_0x8404('0x14')][_0x8404('0x15')])||!this[_0x8404('0x14')]['created'])){logger[_0x8404('0xf')](_0x8404('0x10'),_0x2b9f0b,_0x8404('0x16'));return _0x5191d6[_0x8404('0x12')]();}if(_0xc3851d[0x0]==='2'&&this['interaction'][_0x8404('0x17')]){logger[_0x8404('0xf')](_0x8404('0x18'),_0x2b9f0b,_0x8404('0x19'));return _0x5191d6['next']();}var _0x597ba6={'ContactId':this[_0x8404('0x1a')]['id'],'sentAt':moment()[_0x8404('0x1b')](_0x8404('0x1c')),'direction':_0x8404('0x1d')};if(this['channel']===_0x8404('0x1e')){_0x597ba6[_0x8404('0xd')]=utils[_0x8404('0x1f')](_0xc3851d[0x2],this);}else{_0x597ba6[_0x8404('0xd')]=utils['getMustacheRender'](_0xc3851d[0x1],this);}if(this[_0x8404('0x20')]){_0x597ba6['to']=this[_0x8404('0x20')][_0x8404('0x21')]||'';if(this['channel']==='mail'&&_0xc3851d[0x1]==='1'){_0x597ba6['cc']=this['message']['cc']||'';}_0x597ba6['from']=this[_0x8404('0x20')]['to']||'';_0x597ba6['phone']=this[_0x8404('0x20')][_0x8404('0x22')]||'';_0x597ba6[_0x8404('0x23')]=!![];if(this[_0x8404('0x20')][_0x8404('0x24')]){_0x597ba6[_0x8404('0x24')]='';_0x597ba6[_0x8404('0x24')]+=_['startsWith'](this[_0x8404('0x20')]['subject'],_0x8404('0x25'))?'':_0x8404('0x26');_0x597ba6[_0x8404('0x24')]+=this['message'][_0x8404('0x24')];}}if(this['channel']===_0x8404('0x27')){_0x597ba6['ChatWebsiteId']=this[_0x8404('0x28')]['id'];}else{_0x597ba6[_['upperFirst'](this[_0x8404('0xc')])+_0x8404('0x29')]=this['account']['id'];}_0x597ba6[_[_0x8404('0x2a')](this[_0x8404('0xc')])+_0x8404('0x2b')]=this[_0x8404('0x14')]['id'];var _0x27d465=this[_0x8404('0x14')];if(rpc[this[_0x8404('0xc')]+_0x8404('0x2c')]){if(this[_0x8404('0xc')]===_0x8404('0x1e')){_0x597ba6['inReplyTo']=this[_0x8404('0x20')][_0x8404('0x2d')];_0x597ba6[_0x8404('0x2e')]=_0x8404('0x2f')+_['replace'](_0x597ba6[_0x8404('0xd')],_0x8404('0x30'),_0x8404('0x31'))+_0x8404('0x32');_0x597ba6['headers']={'Auto-Submitted':_0x8404('0x33'),'X-Auto-Response-Suppress':_0x8404('0x34'),'Precedence':'auto_reply'};return mailRpc[_0x8404('0x35')](this[_0x8404('0x28')][_0x8404('0x36')],_0x597ba6)[_0x8404('0x37')](function(_0xda9d15){logger[_0x8404('0xf')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x2b9f0b);_0x597ba6[_0x8404('0x2d')]=_0xda9d15['message'][_0x8404('0x2d')];return rpc[_0x1c48b4+_0x8404('0x2c')][_0x8404('0x38')](_0x597ba6);})[_0x8404('0x37')](function(_0x103c48){logger[_0x8404('0xf')]('[%s][AUTOREPLY]\x20%s',_0x2b9f0b,JSON['stringify'](_0x103c48));})[_0x8404('0x39')](function(_0x74766f){logger[_0x8404('0x3a')](_0x8404('0x3b'),_0x2b9f0b,JSON['stringify'](_0x74766f));})[_0x8404('0x3c')](function(){Promise[_0x8404('0x3d')]()['then'](function(){if(_0xc3851d[0x0]!=='2'||_0x27d465[_0x8404('0x17')])return;return rpc[_0x1c48b4+_0x8404('0x3e')]['update'](_0x27d465['id'],{'autoreplyExecuted':!![]})[_0x8404('0x37')](function(_0x4887d1){logger['info'](_0x8404('0x18'),_0x2b9f0b,JSON[_0x8404('0x3f')](_0x4887d1));})['catch'](function(_0xab1022){logger['error'](_0x8404('0x40'),_0x2b9f0b,JSON[_0x8404('0x3f')](_0xab1022));});})[_0x8404('0x37')](function(){_0x5191d6['next']();});});}else{return rpc[this[_0x8404('0xc')]+_0x8404('0x2c')][_0x8404('0x38')](_0x597ba6)['then'](function(){logger[_0x8404('0xf')](_0x8404('0x10'),_0x2b9f0b,_0x597ba6[_0x8404('0xd')]);})['catch'](function(_0x4064c5){logger[_0x8404('0x3a')](_0x8404('0x10'),_0x2b9f0b,JSON[_0x8404('0x3f')](_0x4064c5));})[_0x8404('0x3c')](function(){Promise[_0x8404('0x3d')]()['then'](function(){if(_0xc3851d[0x0]!=='2'||_0x27d465[_0x8404('0x17')])return;return rpc[_0x1c48b4+_0x8404('0x3e')][_0x8404('0x41')](_0x27d465['id'],{'autoreplyExecuted':!![]})[_0x8404('0x37')](function(_0x98d52c){logger[_0x8404('0xf')](_0x8404('0x18'),_0x2b9f0b,JSON[_0x8404('0x3f')](_0x98d52c));})['catch'](function(_0x4e5d53){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2b9f0b,JSON[_0x8404('0x3f')](_0x4e5d53));});})[_0x8404('0x37')](function(){_0x5191d6['next']();});});}}}catch(_0x543a56){logger[_0x8404('0x3a')](_0x8404('0x10'),_0x2b9f0b,JSON[_0x8404('0x3f')](_0x543a56));_0x5191d6[_0x8404('0x42')]();}};}; \ No newline at end of file +var _0xe4ef=['contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','replace',''+_[_0xfe4e('0x34')](_0x5972fd[_0xfe4e('0x12')],_0xfe4e('0x35'),_0xfe4e('0x36'))+'';_0x5972fd[_0xfe4e('0x37')]={'Auto-Submitted':_0xfe4e('0x38'),'X-Auto-Response-Suppress':_0xfe4e('0x39'),'Precedence':_0xfe4e('0x3a')};return mailRpc[_0xfe4e('0x3b')](this['account'][_0xfe4e('0x3c')],_0x5972fd)[_0xfe4e('0x3d')](function(_0x396662){logger[_0xfe4e('0x14')](_0xfe4e('0x3e'),_0x3438e5);_0x5972fd[_0xfe4e('0x33')]=_0x396662[_0xfe4e('0x23')][_0xfe4e('0x33')];return rpc[_0x2eb789+_0xfe4e('0x31')][_0xfe4e('0x3f')](_0x5972fd);})['then'](function(_0x1985ee){logger[_0xfe4e('0x14')](_0xfe4e('0x15'),_0x3438e5,JSON[_0xfe4e('0x40')](_0x1985ee));})[_0xfe4e('0x41')](function(_0x27321f){logger['error']('[RPC][%s][AUTOREPLY]\x20%s',_0x3438e5,JSON[_0xfe4e('0x40')](_0x27321f));})[_0xfe4e('0x42')](function(){Promise['resolve']()[_0xfe4e('0x3d')](function(){if(_0x1eba44[0x0]!=='2'||_0x2b9550[_0xfe4e('0x43')])return;return rpc[_0x2eb789+'Interaction'][_0xfe4e('0x44')](_0x2b9550['id'],{'autoreplyExecuted':!![]})[_0xfe4e('0x3d')](function(_0x1afb83){logger['info'](_0xfe4e('0x1c'),_0x3438e5,JSON['stringify'](_0x1afb83));})[_0xfe4e('0x41')](function(_0x5c64a3){logger['error'](_0xfe4e('0x45'),_0x3438e5,JSON['stringify'](_0x5c64a3));});})['then'](function(){_0x7f15ea[_0xfe4e('0x17')]();});});}else{return rpc[this[_0xfe4e('0x10')]+_0xfe4e('0x31')][_0xfe4e('0x3f')](_0x5972fd)[_0xfe4e('0x3d')](function(){logger['info'](_0xfe4e('0x15'),_0x3438e5,_0x5972fd[_0xfe4e('0x12')]);})['catch'](function(_0x4a13af){logger[_0xfe4e('0x46')]('[%s][AUTOREPLY]\x20%s',_0x3438e5,JSON[_0xfe4e('0x40')](_0x4a13af));})[_0xfe4e('0x42')](function(){Promise[_0xfe4e('0x47')]()[_0xfe4e('0x3d')](function(){if(_0x1eba44[0x0]!=='2'||_0x2b9550['autoreplyExecuted'])return;return rpc[_0x2eb789+'Interaction'][_0xfe4e('0x44')](_0x2b9550['id'],{'autoreplyExecuted':!![]})[_0xfe4e('0x3d')](function(_0x27962a){logger[_0xfe4e('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3438e5,JSON[_0xfe4e('0x40')](_0x27962a));})[_0xfe4e('0x41')](function(_0x34742f){logger[_0xfe4e('0x46')](_0xfe4e('0x45'),_0x3438e5,JSON[_0xfe4e('0x40')](_0x34742f));});})['then'](function(){_0x7f15ea['next']();});});}}}catch(_0x359dcc){logger['error'](_0xfe4e('0x15'),_0x3438e5,JSON[_0xfe4e('0x40')](_0x359dcc));_0x7f15ea[_0xfe4e('0x48')]();}};}; \ 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 3f9f82f..c40562e 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 _0xfa90=['stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally','error'];(function(_0x3f5e8c,_0x31b005){var _0x406be4=function(_0x21ed91){while(--_0x21ed91){_0x3f5e8c['push'](_0x3f5e8c['shift']());}};_0x406be4(++_0x31b005);}(_0xfa90,0xd1));var _0x0fa9=function(_0x2629f5,_0x5782dd){_0x2629f5=_0x2629f5-0x0;var _0x227aa4=_0xfa90[_0x2629f5];return _0x227aa4;};'use strict';var moment=require('moment');var logger=require(_0x0fa9('0x0'))(_0x0fa9('0x1'));var rpc={'chatInteraction':require(_0x0fa9('0x2')),'openchannelInteraction':require(_0x0fa9('0x3')),'smsInteraction':require(_0x0fa9('0x4')),'mailInteraction':require(_0x0fa9('0x5')),'faxInteraction':require(_0x0fa9('0x6')),'whatsappInteraction':require(_0x0fa9('0x7'))};exports[_0x0fa9('0x8')]=function(_0x58ee0d,_0x184e72,_0x45c9b1,_0xffea8e){return function(_0x192db6){try{logger[_0x0fa9('0x9')](_0x0fa9('0xa'),_0x58ee0d,_0x184e72[0x0]);var _0x2389ef={'closed':0x1,'closedAt':moment()[_0x0fa9('0xb')](_0x0fa9('0xc')),'closeReason':_0x0fa9('0xd'),'disposition':_0x184e72[0x0]};if(rpc[_0xffea8e[_0x0fa9('0xe')]+_0x0fa9('0xf')]){rpc[_0xffea8e['channel']+_0x0fa9('0xf')][_0x0fa9('0x10')](_0xffea8e[_0x0fa9('0x11')]['id'],_0x2389ef)[_0x0fa9('0x12')](function(_0x12a8c3){logger[_0x0fa9('0x9')](_0x0fa9('0x13'),_0x58ee0d,_0xffea8e[_0x0fa9('0x11')]['id']);})[_0x0fa9('0x14')](function(_0x57f94a){logger['error'](_0x0fa9('0x15'),_0x58ee0d,JSON[_0x0fa9('0x16')](_0x57f94a));})[_0x0fa9('0x17')](function(){_0x192db6['stop']();});}}catch(_0x3b63ae){logger[_0x0fa9('0x18')](_0x0fa9('0x15'),_0x58ee0d,JSON['stringify'](_0x3b63ae));_0x192db6[_0x0fa9('0x19')]();}};}; \ No newline at end of file +var _0x0aef=['stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally'];(function(_0x27f673,_0x1b97ba){var _0x7e7b76=function(_0x194c8a){while(--_0x194c8a){_0x27f673['push'](_0x27f673['shift']());}};_0x7e7b76(++_0x1b97ba);}(_0x0aef,0xb9));var _0xf0ae=function(_0x477a00,_0x220f09){_0x477a00=_0x477a00-0x0;var _0x116283=_0x0aef[_0x477a00];return _0x116283;};'use strict';var moment=require(_0xf0ae('0x0'));var logger=require(_0xf0ae('0x1'))(_0xf0ae('0x2'));var rpc={'chatInteraction':require(_0xf0ae('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xf0ae('0x4')),'faxInteraction':require(_0xf0ae('0x5')),'whatsappInteraction':require(_0xf0ae('0x6'))};exports['consequence']=function(_0x1dc2a6,_0x7f2006,_0x588de3,_0x3fa50b){return function(_0x3d32be){try{logger['info'](_0xf0ae('0x7'),_0x1dc2a6,_0x7f2006[0x0]);var _0x479077={'closed':0x1,'closedAt':moment()[_0xf0ae('0x8')](_0xf0ae('0x9')),'closeReason':_0xf0ae('0xa'),'disposition':_0x7f2006[0x0]};if(rpc[_0x3fa50b[_0xf0ae('0xb')]+_0xf0ae('0xc')]){rpc[_0x3fa50b[_0xf0ae('0xb')]+_0xf0ae('0xc')][_0xf0ae('0xd')](_0x3fa50b[_0xf0ae('0xe')]['id'],_0x479077)[_0xf0ae('0xf')](function(_0x2c6261){logger[_0xf0ae('0x10')](_0xf0ae('0x11'),_0x1dc2a6,_0x3fa50b[_0xf0ae('0xe')]['id']);})[_0xf0ae('0x12')](function(_0x2368b0){logger['error'](_0xf0ae('0x13'),_0x1dc2a6,JSON[_0xf0ae('0x14')](_0x2368b0));})[_0xf0ae('0x15')](function(){_0x3d32be[_0xf0ae('0x16')]();});}}catch(_0x4c6311){logger['error'](_0xf0ae('0x13'),_0x1dc2a6,JSON[_0xf0ae('0x14')](_0x4c6311));_0x3d32be['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 9a3b0a5..2557d5c 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 _0x7b27=['md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','catch','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','stringify','metadata','error','lodash','apiai-promise'];(function(_0x3ef4ae,_0xb1929a){var _0xbd87ae=function(_0x15d55d){while(--_0x15d55d){_0x3ef4ae['push'](_0x3ef4ae['shift']());}};_0xbd87ae(++_0xb1929a);}(_0x7b27,0x186));var _0x77b2=function(_0x12de96,_0x1afd83){_0x12de96=_0x12de96-0x0;var _0x35dafc=_0x7b27[_0x12de96];return _0x35dafc;};'use strict';var _=require(_0x77b2('0x0'));var moment=require('moment');var apiai=require(_0x77b2('0x1'));var md5=require(_0x77b2('0x2'));var utils=require(_0x77b2('0x3'));var logger=require(_0x77b2('0x4'))('routing');var rpc={'chatMessage':require(_0x77b2('0x5')),'openchannelMessage':require(_0x77b2('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x77b2('0x7')),'faxMessage':require(_0x77b2('0x8')),'whatsappMessage':require(_0x77b2('0x9'))};exports['consequence']=function(_0x22bdcf,_0x2a97d8){return function(_0x2f01a2){try{if(!_[_0x77b2('0xa')](this['interaction'][_0x77b2('0xb')])){logger[_0x77b2('0xc')](_0x77b2('0xd'),_0x22bdcf,_0x77b2('0xe'));return _0x2f01a2[_0x77b2('0xf')]();}var _0x3abfbc={'ContactId':this[_0x77b2('0x10')]['id'],'sentAt':moment()[_0x77b2('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x77b2('0x12')};if(this[_0x77b2('0x13')]==='sms'||this[_0x77b2('0x13')]==='whatsapp'){_0x3abfbc[_0x77b2('0x14')]=this[_0x77b2('0x15')]['phone'];}var _0x2a14ba=this['channel'];if(_0x2a14ba===_0x77b2('0x16')){_0x3abfbc[_0x77b2('0x17')]=this[_0x77b2('0x18')]['id'];}else{_0x3abfbc[_[_0x77b2('0x19')](_0x2a14ba)+_0x77b2('0x1a')]=this[_0x77b2('0x18')]['id'];}_0x3abfbc[_[_0x77b2('0x19')](_0x2a14ba)+_0x77b2('0x1b')]=this[_0x77b2('0x15')]['id'];if(this['interaction']['created']){var _0x2cea4a=_0x2a97d8[0x2];if(!_[_0x77b2('0x1c')](_0x2cea4a)){_0x3abfbc[_0x77b2('0x1d')]=utils[_0x77b2('0x1e')](_0x2cea4a,this);return rpc[_0x2a14ba+_0x77b2('0x1f')][_0x77b2('0x20')](_0x3abfbc)[_0x77b2('0x21')](function(_0x4dc713){logger[_0x77b2('0xc')](_0x77b2('0xd'),_0x22bdcf,_0x3abfbc[_0x77b2('0x1d')]);})[_0x77b2('0x22')](function(_0x23fbf){logger['error'](_0x77b2('0xd'),_0x22bdcf,JSON['stringify'](_0x23fbf));})[_0x77b2('0x23')](function(){logger[_0x77b2('0xc')](_0x77b2('0x24'),_0x22bdcf);_0x2f01a2[_0x77b2('0x25')]();});}else{logger[_0x77b2('0xc')](_0x77b2('0x26'),_0x22bdcf);_0x2f01a2[_0x77b2('0x25')]();}}else{var _0x542d76=this;var _0x4d5c66=apiai(_0x2a97d8[0x0],{'language':_0x2a97d8[0x1]||'en'});return _0x4d5c66['textRequest'](this[_0x77b2('0x27')][_0x77b2('0x1d')],{'sessionId':md5(this[_0x77b2('0x15')]['id'])})[_0x77b2('0x21')](function(_0x93374a){_0x542d76[_0x77b2('0x1d')][_0x77b2('0x28')]=_0x93374a;_0x3abfbc['body']=_0x93374a[_0x77b2('0x29')][_0x77b2('0x2a')][_0x77b2('0x2b')];_0x3abfbc[_0x77b2('0x2c')]=_0x77b2('0x28');_0x3abfbc[_0x77b2('0x2d')]=JSON[_0x77b2('0x2e')](_0x93374a);return rpc[_0x2a14ba+_0x77b2('0x1f')][_0x77b2('0x20')](_0x3abfbc)[_0x77b2('0x21')](function(_0x5c50a1){logger[_0x77b2('0xc')](_0x77b2('0xd'),_0x22bdcf,_0x3abfbc[_0x77b2('0x1d')]);if(_0x93374a[_0x77b2('0x29')][_0x77b2('0x2f')]['endConversation']){_0x2f01a2[_0x77b2('0xf')]();}else{_0x2f01a2[_0x77b2('0x25')]();}})[_0x77b2('0x22')](function(_0x334366){logger[_0x77b2('0x30')](_0x77b2('0xd'),_0x22bdcf,JSON[_0x77b2('0x2e')](_0x334366));_0x2f01a2[_0x77b2('0xf')]();});})[_0x77b2('0x22')](function(_0x16815b){logger[_0x77b2('0x30')](_0x77b2('0xd'),_0x22bdcf,_0x16815b['message']);_0x2f01a2['next']();});}}catch(_0x5c2db3){logger['error'](_0x77b2('0xd'),_0x22bdcf,JSON[_0x77b2('0x2e')](_0x5c2db3));_0x2f01a2['stop']();}};}; \ No newline at end of file +var _0x52aa=['dialogflow','fulfillment','speech','providerName','providerResponse','result','metadata','endConversation','error','message','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','catch','stringify','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','then'];(function(_0x778f1b,_0x3c9178){var _0x4d4270=function(_0x5d74dd){while(--_0x5d74dd){_0x778f1b['push'](_0x778f1b['shift']());}};_0x4d4270(++_0x3c9178);}(_0x52aa,0x113));var _0xa52a=function(_0x218d52,_0x5aefe3){_0x218d52=_0x218d52-0x0;var _0x18734a=_0x52aa[_0x218d52];return _0x18734a;};'use strict';var _=require('lodash');var moment=require(_0xa52a('0x0'));var apiai=require(_0xa52a('0x1'));var md5=require(_0xa52a('0x2'));var utils=require(_0xa52a('0x3'));var logger=require(_0xa52a('0x4'))(_0xa52a('0x5'));var rpc={'chatMessage':require(_0xa52a('0x6')),'openchannelMessage':require(_0xa52a('0x7')),'mailMessage':require(_0xa52a('0x8')),'smsMessage':require(_0xa52a('0x9')),'faxMessage':require(_0xa52a('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x8609ec,_0x14bc85){return function(_0x289bb0){try{if(!_[_0xa52a('0xb')](this[_0xa52a('0xc')][_0xa52a('0xd')])){logger[_0xa52a('0xe')](_0xa52a('0xf'),_0x8609ec,_0xa52a('0x10'));return _0x289bb0[_0xa52a('0x11')]();}var _0x57b153={'ContactId':this[_0xa52a('0x12')]['id'],'sentAt':moment()['format'](_0xa52a('0x13')),'direction':_0xa52a('0x14')};if(this[_0xa52a('0x15')]===_0xa52a('0x16')||this[_0xa52a('0x15')]===_0xa52a('0x17')){_0x57b153[_0xa52a('0x18')]=this[_0xa52a('0xc')][_0xa52a('0x18')];}var _0x10342c=this[_0xa52a('0x15')];if(_0x10342c===_0xa52a('0x19')){_0x57b153[_0xa52a('0x1a')]=this['account']['id'];}else{_0x57b153[_['upperFirst'](_0x10342c)+_0xa52a('0x1b')]=this[_0xa52a('0x1c')]['id'];}_0x57b153[_['upperFirst'](_0x10342c)+_0xa52a('0x1d')]=this[_0xa52a('0xc')]['id'];if(this[_0xa52a('0xc')][_0xa52a('0x1e')]){var _0xa0faac=_0x14bc85[0x2];if(!_[_0xa52a('0x1f')](_0xa0faac)){_0x57b153[_0xa52a('0x20')]=utils[_0xa52a('0x21')](_0xa0faac,this);return rpc[_0x10342c+_0xa52a('0x22')][_0xa52a('0x23')](_0x57b153)['then'](function(_0x1e2cc8){logger[_0xa52a('0xe')](_0xa52a('0xf'),_0x8609ec,_0x57b153[_0xa52a('0x20')]);})[_0xa52a('0x24')](function(_0xa0fd2d){logger['error'](_0xa52a('0xf'),_0x8609ec,JSON[_0xa52a('0x25')](_0xa0fd2d));})[_0xa52a('0x26')](function(){logger[_0xa52a('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x8609ec);_0x289bb0[_0xa52a('0x27')]();});}else{logger[_0xa52a('0xe')](_0xa52a('0x28'),_0x8609ec);_0x289bb0[_0xa52a('0x27')]();}}else{var _0x13ef38=this;var _0x4c8361=apiai(_0x14bc85[0x0],{'language':_0x14bc85[0x1]||'en'});return _0x4c8361[_0xa52a('0x29')](this['message']['body'],{'sessionId':md5(this[_0xa52a('0xc')]['id'])})[_0xa52a('0x2a')](function(_0x598849){_0x13ef38['body'][_0xa52a('0x2b')]=_0x598849;_0x57b153[_0xa52a('0x20')]=_0x598849['result'][_0xa52a('0x2c')][_0xa52a('0x2d')];_0x57b153[_0xa52a('0x2e')]=_0xa52a('0x2b');_0x57b153[_0xa52a('0x2f')]=JSON[_0xa52a('0x25')](_0x598849);return rpc[_0x10342c+_0xa52a('0x22')][_0xa52a('0x23')](_0x57b153)[_0xa52a('0x2a')](function(_0x1e8ff6){logger[_0xa52a('0xe')](_0xa52a('0xf'),_0x8609ec,_0x57b153[_0xa52a('0x20')]);if(_0x598849[_0xa52a('0x30')][_0xa52a('0x31')][_0xa52a('0x32')]){_0x289bb0[_0xa52a('0x11')]();}else{_0x289bb0[_0xa52a('0x27')]();}})['catch'](function(_0x1903fb){logger[_0xa52a('0x33')](_0xa52a('0xf'),_0x8609ec,JSON['stringify'](_0x1903fb));_0x289bb0['next']();});})[_0xa52a('0x24')](function(_0x2d2180){logger[_0xa52a('0x33')]('[%s][DIALOGFLOW]\x20%s',_0x8609ec,_0x2d2180[_0xa52a('0x34')]);_0x289bb0[_0xa52a('0x11')]();});}}catch(_0x552fc5){logger[_0xa52a('0x33')](_0xa52a('0xf'),_0x8609ec,JSON[_0xa52a('0x25')](_0x552fc5));_0x289bb0[_0xa52a('0x27')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 66e32c7..59736da 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 _0x8db3=['message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','providerResponse','length','push','all','stack','dialogflow','moment','bluebird','../../../../config/logger','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','isEmpty','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','interaction'];(function(_0x121707,_0x270973){var _0xded885=function(_0xf11153){while(--_0xf11153){_0x121707['push'](_0x121707['shift']());}};_0xded885(++_0x270973);}(_0x8db3,0xee));var _0x38db=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x8db3[_0x39096d];return _0x13da4f;};'use strict';var _=require('lodash');var dialogflow=require(_0x38db('0x0'));var md5=require('md5');var moment=require(_0x38db('0x1'));var Promise=require(_0x38db('0x2'));var logger=require(_0x38db('0x3'))('routing');var utils=require(_0x38db('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x38db('0x5')),'mailMessage':require(_0x38db('0x6')),'smsMessage':require(_0x38db('0x7')),'faxMessage':require(_0x38db('0x8')),'whatsappMessage':require(_0x38db('0x9'))};function createMessage(_0x2a80fd,_0xfa2c68,_0x28ec3b,_0xb60841){return new Promise(function(_0xb254f0,_0x5cf618){var _0x16a585=_['clone'](_0x28ec3b);_0x16a585[_0x38db('0xa')]=_0xb60841;return rpc[_0xfa2c68+_0x38db('0xb')][_0x38db('0xc')](_0x16a585)[_0x38db('0xd')](function(){logger[_0x38db('0xe')](_0x38db('0xf'),_0x2a80fd,_0x16a585[_0x38db('0xa')]);_0xb254f0();})[_0x38db('0x10')](function(_0x5767ae){logger[_0x38db('0x11')](_0x38db('0xf'),_0x2a80fd,JSON[_0x38db('0x12')](_0x5767ae));_0x5cf618(_0x5767ae);});});}exports[_0x38db('0x13')]=function(_0x1b699a,_0xf3c318){return function(_0x2324a9){try{if(!_[_0x38db('0x14')](this['interaction'][_0x38db('0x15')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x1b699a,_0x38db('0x16'));return _0x2324a9[_0x38db('0x17')]();}var _0x20579b={'ContactId':this[_0x38db('0x18')]['id'],'sentAt':moment()[_0x38db('0x19')](_0x38db('0x1a')),'direction':_0x38db('0x1b')};if(this['channel']===_0x38db('0x1c')||this[_0x38db('0x1d')]===_0x38db('0x1e')){_0x20579b[_0x38db('0x1f')]=this['interaction'][_0x38db('0x1f')];}var _0x16b64e=this['channel'];if(_0x16b64e===_0x38db('0x20')){_0x20579b[_0x38db('0x21')]=this[_0x38db('0x22')]['id'];}else{_0x20579b[_[_0x38db('0x23')](_0x16b64e)+'AccountId']=this[_0x38db('0x22')]['id'];}_0x20579b[_[_0x38db('0x23')](_0x16b64e)+'InteractionId']=this['interaction']['id'];if(this['interaction']['created']){var _0x358929=_0xf3c318[0x4];if(!_[_0x38db('0x24')](_0x358929)){_0x20579b[_0x38db('0xa')]=utils[_0x38db('0x25')](_0x358929,this);return rpc[_0x16b64e+'Message'][_0x38db('0xc')](_0x20579b)[_0x38db('0xd')](function(_0x40e680){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x1b699a,_0x20579b[_0x38db('0xa')]);})[_0x38db('0x10')](function(_0x21c6ba){logger[_0x38db('0x11')](_0x38db('0xf'),_0x1b699a,JSON[_0x38db('0x12')](_0x21c6ba));})[_0x38db('0x26')](function(){logger[_0x38db('0xe')](_0x38db('0x27'),_0x1b699a);_0x2324a9['stop']();});}else{logger['info'](_0x38db('0x28'),_0x1b699a);_0x2324a9[_0x38db('0x29')]();}}else{var _0x138304=this;var _0x4fe91d=_0xf3c318[0x2][_0x38db('0x2a')](/\\n/g,'\x0a');var _0x389bda={'credentials':{'private_key':_0x4fe91d,'client_email':_0xf3c318[0x1]}};var _0x3ef32b=new dialogflow[(_0x38db('0x2b'))](_0x389bda);var _0x2abf88=_0x3ef32b[_0x38db('0x2c')](_0xf3c318[0x0],md5(_0x138304[_0x38db('0x2d')]['id']));var _0x2ffbba={'session':_0x2abf88,'queryInput':{'text':{'text':_0x138304[_0x38db('0x2e')][_0x38db('0xa')],'languageCode':_0xf3c318[0x3]||'en'}}};return _0x3ef32b[_0x38db('0x2f')](_0x2ffbba)['then'](function(_0x3b4223){if(_0x3b4223&&_0x3b4223['length']){_0x138304[_0x38db('0xa')][_0x38db('0x30')]=_0x3b4223;var _0x41e9f6=_0x3b4223[0x0];var _0x59bc35=_0x41e9f6[_0x38db('0x31')][_0x38db('0x32')]&&_0x41e9f6[_0x38db('0x31')][_0x38db('0x32')][_0x38db('0x33')]?_0x41e9f6[_0x38db('0x31')][_0x38db('0x32')][_0x38db('0x33')][_0x38db('0x34')]['boolValue']:![];_0x138304['body'][_0x38db('0x35')]=_0x41e9f6[_0x38db('0x31')][_0x38db('0x36')];_0x138304[_0x38db('0xa')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x41e9f6[_0x38db('0x31')]['allRequiredParamsPresent'];_0x138304[_0x38db('0xa')][_0x38db('0x37')]=_0x41e9f6['queryResult']['diagnosticInfo']&&_0x41e9f6['queryResult'][_0x38db('0x32')]['fields']?_0x41e9f6[_0x38db('0x31')][_0x38db('0x32')][_0x38db('0x33')]['end_conversation'][_0x38db('0x38')]:![];_0x138304[_0x38db('0xa')][_0x38db('0x39')]=_0x41e9f6[_0x38db('0x31')][_0x38db('0x3a')]['name'];_0x138304[_0x38db('0xa')][_0x38db('0x3b')]=_0x41e9f6[_0x38db('0x31')][_0x38db('0x3a')][_0x38db('0x3c')];_0x138304['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x41e9f6[_0x38db('0x31')][_0x38db('0x3a')]['isFallback'];_0x138304[_0x38db('0xa')][_0x38db('0x3d')]=_0x41e9f6['queryResult']['languageCode'];_0x138304[_0x38db('0xa')][_0x38db('0x3e')]=_0x41e9f6[_0x38db('0x31')][_0x38db('0x3f')];_0x138304[_0x38db('0xa')]['DIALOGFLOWV2_SCORE']=_0x41e9f6[_0x38db('0x31')][_0x38db('0x40')];_0x20579b[_0x38db('0x41')]='dialogflowV2';_0x20579b[_0x38db('0x42')]=JSON[_0x38db('0x12')](_0x3b4223);var _0x3e2d4f=[];for(var _0x148efe=0x0;_0x148efe<_0x3b4223[_0x38db('0x43')];_0x148efe++){var _0x1b07a1=_0x3b4223[_0x148efe];if(_0x1b07a1&&_0x1b07a1[_0x38db('0x31')]&&_0x1b07a1[_0x38db('0x31')]['fulfillmentText']){_0x3e2d4f[_0x38db('0x44')](createMessage(_0x1b699a,_0x16b64e,_0x20579b,_0x1b07a1['queryResult']['fulfillmentText']));}}return Promise[_0x38db('0x45')](_0x3e2d4f)[_0x38db('0xd')](function(){if(_0x59bc35){_0x2324a9[_0x38db('0x17')]();}else{_0x2324a9[_0x38db('0x29')]();}})[_0x38db('0x10')](function(_0x3e4b51){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x1b699a,JSON[_0x38db('0x12')](_0x3e4b51));_0x2324a9[_0x38db('0x17')]();});}})[_0x38db('0x10')](function(_0x4802f6){logger[_0x38db('0x11')](_0x38db('0xf'),_0x1b699a,_0x4802f6[_0x38db('0x2e')],_0x4802f6[_0x38db('0x46')]);_0x2324a9['next']();});}}catch(_0x2ef472){logger[_0x38db('0x11')](_0x38db('0xf'),_0x1b699a,JSON[_0x38db('0x12')](_0x2ef472));_0x2324a9[_0x38db('0x29')]();}};}; \ No newline at end of file +var _0x2ba4=['error','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','created','isEmpty','then','stringify','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','detectIntent','queryResult','diagnosticInfo','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','fields','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','fulfillmentText','push','stack','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','body','catch'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2ba4,0xcc));var _0x42ba=function(_0x355220,_0x43fb5c){_0x355220=_0x355220-0x0;var _0x196039=_0x2ba4[_0x355220];return _0x196039;};'use strict';var _=require(_0x42ba('0x0'));var dialogflow=require(_0x42ba('0x1'));var md5=require(_0x42ba('0x2'));var moment=require(_0x42ba('0x3'));var Promise=require(_0x42ba('0x4'));var logger=require(_0x42ba('0x5'))(_0x42ba('0x6'));var utils=require(_0x42ba('0x7'));var rpc={'chatMessage':require(_0x42ba('0x8')),'openchannelMessage':require(_0x42ba('0x9')),'mailMessage':require(_0x42ba('0xa')),'smsMessage':require(_0x42ba('0xb')),'faxMessage':require(_0x42ba('0xc')),'whatsappMessage':require(_0x42ba('0xd'))};function createMessage(_0x51d7d8,_0x558760,_0x44ee19,_0x4ecca5){return new Promise(function(_0x5b30d6,_0x36c8fa){var _0x1549e8=_[_0x42ba('0xe')](_0x44ee19);_0x1549e8['body']=_0x4ecca5;return rpc[_0x558760+_0x42ba('0xf')][_0x42ba('0x10')](_0x1549e8)['then'](function(){logger[_0x42ba('0x11')](_0x42ba('0x12'),_0x51d7d8,_0x1549e8[_0x42ba('0x13')]);_0x5b30d6();})[_0x42ba('0x14')](function(_0x59969d){logger[_0x42ba('0x15')](_0x42ba('0x12'),_0x51d7d8,JSON['stringify'](_0x59969d));_0x36c8fa(_0x59969d);});});}exports['consequence']=function(_0x474742,_0xc0fea9){return function(_0x5c9d6d){try{if(!_[_0x42ba('0x16')](this[_0x42ba('0x17')][_0x42ba('0x18')])){logger[_0x42ba('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x474742,_0x42ba('0x19'));return _0x5c9d6d[_0x42ba('0x1a')]();}var _0x585842={'ContactId':this[_0x42ba('0x1b')]['id'],'sentAt':moment()[_0x42ba('0x1c')](_0x42ba('0x1d')),'direction':_0x42ba('0x1e')};if(this[_0x42ba('0x1f')]==='sms'||this[_0x42ba('0x1f')]==='whatsapp'){_0x585842['phone']=this['interaction'][_0x42ba('0x20')];}var _0x47f02b=this[_0x42ba('0x1f')];if(_0x47f02b===_0x42ba('0x21')){_0x585842[_0x42ba('0x22')]=this['account']['id'];}else{_0x585842[_['upperFirst'](_0x47f02b)+_0x42ba('0x23')]=this[_0x42ba('0x24')]['id'];}_0x585842[_[_0x42ba('0x25')](_0x47f02b)+_0x42ba('0x26')]=this[_0x42ba('0x17')]['id'];if(this[_0x42ba('0x17')][_0x42ba('0x27')]){var _0xa89e55=_0xc0fea9[0x4];if(!_[_0x42ba('0x28')](_0xa89e55)){_0x585842[_0x42ba('0x13')]=utils['getMustacheRender'](_0xa89e55,this);return rpc[_0x47f02b+'Message'][_0x42ba('0x10')](_0x585842)[_0x42ba('0x29')](function(_0x417b84){logger[_0x42ba('0x11')](_0x42ba('0x12'),_0x474742,_0x585842['body']);})[_0x42ba('0x14')](function(_0x3afa49){logger[_0x42ba('0x15')](_0x42ba('0x12'),_0x474742,JSON[_0x42ba('0x2a')](_0x3afa49));})[_0x42ba('0x2b')](function(){logger[_0x42ba('0x11')](_0x42ba('0x2c'),_0x474742);_0x5c9d6d[_0x42ba('0x2d')]();});}else{logger[_0x42ba('0x11')](_0x42ba('0x2e'),_0x474742);_0x5c9d6d[_0x42ba('0x2d')]();}}else{var _0x3dd6e2=this;var _0x435efa=_0xc0fea9[0x2][_0x42ba('0x2f')](/\\n/g,'\x0a');var _0x45bb4f={'credentials':{'private_key':_0x435efa,'client_email':_0xc0fea9[0x1]}};var _0xd430d4=new dialogflow[(_0x42ba('0x30'))](_0x45bb4f);var _0x2e0af5=_0xd430d4[_0x42ba('0x31')](_0xc0fea9[0x0],md5(_0x3dd6e2[_0x42ba('0x17')]['id']));var _0x372345={'session':_0x2e0af5,'queryInput':{'text':{'text':_0x3dd6e2['message'][_0x42ba('0x13')],'languageCode':_0xc0fea9[0x3]||'en'}}};return _0xd430d4[_0x42ba('0x32')](_0x372345)[_0x42ba('0x29')](function(_0x51324f){if(_0x51324f&&_0x51324f['length']){_0x3dd6e2['body']['dialogflowV2']=_0x51324f;var _0x497429=_0x51324f[0x0];var _0x482344=_0x497429[_0x42ba('0x33')]['diagnosticInfo']&&_0x497429['queryResult'][_0x42ba('0x34')]['fields']?_0x497429[_0x42ba('0x33')][_0x42ba('0x34')]['fields'][_0x42ba('0x35')][_0x42ba('0x36')]:![];_0x3dd6e2[_0x42ba('0x13')][_0x42ba('0x37')]=_0x497429['queryResult'][_0x42ba('0x38')];_0x3dd6e2[_0x42ba('0x13')][_0x42ba('0x39')]=_0x497429[_0x42ba('0x33')][_0x42ba('0x3a')];_0x3dd6e2[_0x42ba('0x13')][_0x42ba('0x3b')]=_0x497429[_0x42ba('0x33')][_0x42ba('0x34')]&&_0x497429[_0x42ba('0x33')]['diagnosticInfo'][_0x42ba('0x3c')]?_0x497429[_0x42ba('0x33')][_0x42ba('0x34')]['fields']['end_conversation'][_0x42ba('0x36')]:![];_0x3dd6e2[_0x42ba('0x13')][_0x42ba('0x3d')]=_0x497429[_0x42ba('0x33')][_0x42ba('0x3e')][_0x42ba('0x3f')];_0x3dd6e2['body'][_0x42ba('0x40')]=_0x497429[_0x42ba('0x33')][_0x42ba('0x3e')][_0x42ba('0x41')];_0x3dd6e2[_0x42ba('0x13')][_0x42ba('0x42')]=_0x497429[_0x42ba('0x33')][_0x42ba('0x3e')][_0x42ba('0x43')];_0x3dd6e2['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x497429[_0x42ba('0x33')]['languageCode'];_0x3dd6e2[_0x42ba('0x13')]['DIALOGFLOWV2_QUERYTEXT']=_0x497429[_0x42ba('0x33')]['queryText'];_0x3dd6e2[_0x42ba('0x13')][_0x42ba('0x44')]=_0x497429[_0x42ba('0x33')][_0x42ba('0x45')];_0x585842[_0x42ba('0x46')]=_0x42ba('0x47');_0x585842['providerResponse']=JSON[_0x42ba('0x2a')](_0x51324f);var _0x2e8693=[];for(var _0xbfe871=0x0;_0xbfe871<_0x51324f['length'];_0xbfe871++){var _0x31b137=_0x51324f[_0xbfe871];if(_0x31b137&&_0x31b137[_0x42ba('0x33')]&&_0x31b137['queryResult'][_0x42ba('0x48')]){_0x2e8693[_0x42ba('0x49')](createMessage(_0x474742,_0x47f02b,_0x585842,_0x31b137[_0x42ba('0x33')][_0x42ba('0x48')]));}}return Promise['all'](_0x2e8693)[_0x42ba('0x29')](function(){if(_0x482344){_0x5c9d6d[_0x42ba('0x1a')]();}else{_0x5c9d6d[_0x42ba('0x2d')]();}})[_0x42ba('0x14')](function(_0x1ed1df){logger[_0x42ba('0x15')]('[%s][DIALOGFLOWV2]\x20%s',_0x474742,JSON[_0x42ba('0x2a')](_0x1ed1df));_0x5c9d6d['next']();});}})[_0x42ba('0x14')](function(_0x27f29f){logger[_0x42ba('0x15')]('[%s][DIALOGFLOWV2]\x20%s',_0x474742,_0x27f29f['message'],_0x27f29f[_0x42ba('0x4a')]);_0x5c9d6d[_0x42ba('0x1a')]();});}}catch(_0x1f089e){logger[_0x42ba('0x15')]('[%s][DIALOGFLOWV2]\x20%s',_0x474742,JSON[_0x42ba('0x2a')](_0x1f089e));_0x5c9d6d[_0x42ba('0x2d')]();}};}; \ 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 184919e..6af3c14 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 _0xfbf9=['consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number'];(function(_0x204b2d,_0x4b4175){var _0x8da4bf=function(_0x491736){while(--_0x491736){_0x204b2d['push'](_0x204b2d['shift']());}};_0x8da4bf(++_0x4b4175);}(_0xfbf9,0xc9));var _0x9fbf=function(_0xeeb156,_0x5392f4){_0xeeb156=_0xeeb156-0x0;var _0x4b7c74=_0xfbf9[_0xeeb156];return _0x4b7c74;};'use strict';var schema=require(_0x9fbf('0x0'));var _=require('lodash');var htmlToText=require(_0x9fbf('0x1'));var utils=require('./utils');var logger=require(_0x9fbf('0x2'))(_0x9fbf('0x3'));var gotoif=schema({'condition':{'type':_0x9fbf('0x4'),'required':!![],'message':_0x9fbf('0x5')},'priorityTrue':{'type':_0x9fbf('0x6'),'message':_0x9fbf('0x7')},'priorityFalse':{'type':'number','message':_0x9fbf('0x8')}});exports[_0x9fbf('0x9')]=function(_0x1d8b3d,_0x1c270d){return function(_0x18693f){try{var _0x106000={'condition':htmlToText[_0x9fbf('0xa')](utils[_0x9fbf('0xb')](_0x1c270d[0x0],this),{'wordwrap':![]})[_0x9fbf('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1c270d[0x1],'priorityFalse':_0x1c270d[0x2]};var _0x2fa005=gotoif[_0x9fbf('0x0')](_0x106000,{'typecast':!![]});if(_0x2fa005[_0x9fbf('0xd')]){logger[_0x9fbf('0xe')](_0x9fbf('0xf'),_0x1d8b3d,_[_0x9fbf('0x10')](_0x2fa005,'message')[_0x9fbf('0x11')](',\x20'));_0x18693f[_0x9fbf('0x12')]();}else{try{var _0x450b8d=eval('('+_0x106000[_0x9fbf('0x13')]+')');var _0x7eb0d0=_0x450b8d?_0x106000[_0x9fbf('0x14')]:_0x106000['priorityFalse'];logger[_0x9fbf('0x15')](_0x9fbf('0x16'),_0x1d8b3d,_0x106000['condition'],_0x450b8d,_0x7eb0d0||_0x9fbf('0x17'));if(_0x7eb0d0){var _0x32885e=_[_0x9fbf('0x18')](_0x18693f[_0x9fbf('0x19')](),{'p':_0x7eb0d0});if(_0x32885e>=0x0){logger[_0x9fbf('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1d8b3d,_0x7eb0d0||_0x9fbf('0x17'),_0x32885e);_0x18693f[_0x9fbf('0x17')](_0x32885e);}else{logger[_0x9fbf('0x15')](_0x9fbf('0x1a'),_0x1d8b3d,_0x7eb0d0||_0x9fbf('0x17'));_0x18693f[_0x9fbf('0x12')]();}}else{_0x18693f['next']();}}catch(_0x7e09ef){logger[_0x9fbf('0xe')](_0x9fbf('0x1b'),_0x1d8b3d,_0x7e09ef[_0x9fbf('0x1c')]);_0x18693f[_0x9fbf('0x12')]();}}}catch(_0x4f73c4){logger[_0x9fbf('0xe')](_0x9fbf('0xf'),_0x1d8b3d,JSON[_0x9fbf('0x1d')](_0x4f73c4));_0x18693f[_0x9fbf('0x12')]();}};}; \ No newline at end of file +var _0x4ab0=['getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence'];(function(_0x1f4c8c,_0x19c0d9){var _0x1c06dd=function(_0x2ed464){while(--_0x2ed464){_0x1f4c8c['push'](_0x1f4c8c['shift']());}};_0x1c06dd(++_0x19c0d9);}(_0x4ab0,0x19a));var _0x04ab=function(_0x548bab,_0x53f638){_0x548bab=_0x548bab-0x0;var _0x40173d=_0x4ab0[_0x548bab];return _0x40173d;};'use strict';var schema=require(_0x04ab('0x0'));var _=require('lodash');var htmlToText=require(_0x04ab('0x1'));var utils=require(_0x04ab('0x2'));var logger=require(_0x04ab('0x3'))(_0x04ab('0x4'));var gotoif=schema({'condition':{'type':_0x04ab('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x04ab('0x6'),'message':_0x04ab('0x7')},'priorityFalse':{'type':'number','message':_0x04ab('0x8')}});exports[_0x04ab('0x9')]=function(_0x1285b7,_0x58871e){return function(_0x3dc433){try{var _0x323c02={'condition':htmlToText['fromString'](utils[_0x04ab('0xa')](_0x58871e[0x0],this),{'wordwrap':![]})[_0x04ab('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x58871e[0x1],'priorityFalse':_0x58871e[0x2]};var _0x514736=gotoif[_0x04ab('0x0')](_0x323c02,{'typecast':!![]});if(_0x514736[_0x04ab('0xc')]){logger[_0x04ab('0xd')](_0x04ab('0xe'),_0x1285b7,_[_0x04ab('0xf')](_0x514736,'message')[_0x04ab('0x10')](',\x20'));_0x3dc433[_0x04ab('0x11')]();}else{try{var _0x50a836=eval('('+_0x323c02[_0x04ab('0x12')]+')');var _0x4cca8f=_0x50a836?_0x323c02['priorityTrue']:_0x323c02['priorityFalse'];logger[_0x04ab('0x13')](_0x04ab('0x14'),_0x1285b7,_0x323c02[_0x04ab('0x12')],_0x50a836,_0x4cca8f||_0x04ab('0x15'));if(_0x4cca8f){var _0x4e3a1a=_[_0x04ab('0x16')](_0x3dc433[_0x04ab('0x17')](),{'p':_0x4cca8f});if(_0x4e3a1a>=0x0){logger[_0x04ab('0x13')](_0x04ab('0x18'),_0x1285b7,_0x4cca8f||_0x04ab('0x15'),_0x4e3a1a);_0x3dc433['next'](_0x4e3a1a);}else{logger[_0x04ab('0x13')](_0x04ab('0x19'),_0x1285b7,_0x4cca8f||_0x04ab('0x15'));_0x3dc433[_0x04ab('0x11')]();}}else{_0x3dc433[_0x04ab('0x15')]();}}catch(_0x564f82){logger['error'](_0x04ab('0x1a'),_0x1285b7,_0x564f82['message']);_0x3dc433['stop']();}}}catch(_0x783ea1){logger[_0x04ab('0xd')]('[%s][GOTOIF]\x20%s',_0x1285b7,JSON[_0x04ab('0x1b')](_0x783ea1));_0x3dc433['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 e4ad807..5086066 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 _0x21f6=['stringify','validate','lodash','../../../../config/logger','routing','number','consequence','error','[%s][GOTOP]\x20%s','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x1769a8,_0x328d23){var _0x217eb8=function(_0xd82868){while(--_0xd82868){_0x1769a8['push'](_0x1769a8['shift']());}};_0x217eb8(++_0x328d23);}(_0x21f6,0x19f));var _0x621f=function(_0x4edc9f,_0x48cf5c){_0x4edc9f=_0x4edc9f-0x0;var _0x2e9b37=_0x21f6[_0x4edc9f];return _0x2e9b37;};'use strict';var schema=require(_0x621f('0x0'));var _=require(_0x621f('0x1'));var logger=require(_0x621f('0x2'))(_0x621f('0x3'));var gotop=schema({'priority':{'type':_0x621f('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x621f('0x5')]=function(_0x3d89e9,_0x33da54){return function(_0x3bf55b){try{var _0x296f36={'priority':_0x33da54[0x0]};var _0x3e8464=gotop[_0x621f('0x0')](_0x296f36,{'typecast':!![]});if(_0x3e8464['length']){logger[_0x621f('0x6')](_0x621f('0x7'),_0x3d89e9,_[_0x621f('0x8')](_0x3e8464,_0x621f('0x9'))['join'](',\x20'));_0x3bf55b[_0x621f('0xa')]();}else{logger[_0x621f('0xb')](_0x621f('0xc'),_0x3d89e9,_0x296f36[_0x621f('0xd')]);if(_0x296f36[_0x621f('0xd')]){var _0x532578=_[_0x621f('0xe')](_0x3bf55b['rules'](),{'p':_0x296f36[_0x621f('0xd')]});if(_0x532578>=0x0){logger[_0x621f('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3d89e9,_0x296f36['priority']||'next',_0x532578);_0x3bf55b[_0x621f('0xf')](_0x532578);}else{logger[_0x621f('0xb')](_0x621f('0x10'),_0x3d89e9,_0x296f36[_0x621f('0xd')]||'next');_0x3bf55b['stop']();}}else{_0x3bf55b[_0x621f('0xf')]();}}}catch(_0x58de4d){logger[_0x621f('0x6')](_0x621f('0x7'),_0x3d89e9,JSON[_0x621f('0x11')](_0x58de4d));_0x3bf55b[_0x621f('0xa')]();}};}; \ No newline at end of file +var _0x14cb=['validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','[%s][GOTOP]\x20%s','[%s][GOTOP]\x20priority\x20%s','findIndex','rules','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info','stop','error','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14cb,0x121));var _0xb14c=function(_0x4b6b16,_0xc18e50){_0x4b6b16=_0x4b6b16-0x0;var _0x4fb3ee=_0x14cb[_0x4b6b16];return _0x4fb3ee;};'use strict';var schema=require(_0xb14c('0x0'));var _=require(_0xb14c('0x1'));var logger=require('../../../../config/logger')(_0xb14c('0x2'));var gotop=schema({'priority':{'type':_0xb14c('0x3'),'required':!![],'message':_0xb14c('0x4')}});exports['consequence']=function(_0x412fb1,_0xbaaa6e){return function(_0x327c2b){try{var _0x547f42={'priority':_0xbaaa6e[0x0]};var _0x547540=gotop[_0xb14c('0x0')](_0x547f42,{'typecast':!![]});if(_0x547540[_0xb14c('0x5')]){logger['error'](_0xb14c('0x6'),_0x412fb1,_['map'](_0x547540,'message')['join'](',\x20'));_0x327c2b['stop']();}else{logger['info'](_0xb14c('0x7'),_0x412fb1,_0x547f42['priority']);if(_0x547f42['priority']){var _0x13b5a3=_[_0xb14c('0x8')](_0x327c2b[_0xb14c('0x9')](),{'p':_0x547f42[_0xb14c('0xa')]});if(_0x13b5a3>=0x0){logger['info'](_0xb14c('0xb'),_0x412fb1,_0x547f42[_0xb14c('0xa')]||_0xb14c('0xc'),_0x13b5a3);_0x327c2b['next'](_0x13b5a3);}else{logger[_0xb14c('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x412fb1,_0x547f42['priority']||'next');_0x327c2b[_0xb14c('0xe')]();}}else{_0x327c2b[_0xb14c('0xc')]();}}}catch(_0x449df1){logger[_0xb14c('0xf')](_0xb14c('0x6'),_0x412fb1,JSON[_0xb14c('0x10')](_0x449df1));_0x327c2b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 6e3a883..cbd2167 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 _0xac9d=['../../rpc/whatsappMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','stop','stringify','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x47838c,_0x10eb98){var _0x2a62b6=function(_0xcdebad){while(--_0xcdebad){_0x47838c['push'](_0x47838c['shift']());}};_0x2a62b6(++_0x10eb98);}(_0xac9d,0x19c));var _0xdac9=function(_0x271a80,_0x268bac){_0x271a80=_0x271a80-0x0;var _0xf8233e=_0xac9d[_0x271a80];return _0xf8233e;};'use strict';var _=require(_0xdac9('0x0'));var utils=require(_0xdac9('0x1'));var logger=require('../../../../config/logger')(_0xdac9('0x2'));var rpc={'chatMessage':require(_0xdac9('0x3')),'openchannelMessage':require(_0xdac9('0x4')),'mailMessage':require(_0xdac9('0x5')),'smsMessage':require(_0xdac9('0x6')),'faxMessage':require(_0xdac9('0x7')),'whatsappMessage':require(_0xdac9('0x8'))};exports[_0xdac9('0x9')]=function(_0x510309,_0x369687){return function(_0x3f8e2f){try{var _0x4e8967={'body':utils['getMustacheRender'](_0x369687[0x0],this),'ContactId':this[_0xdac9('0xa')]['id']};if(this[_0xdac9('0xb')]===_0xdac9('0xc')){_0x4e8967[_0xdac9('0xd')]=this[_0xdac9('0xe')]['id'];}else{_0x4e8967[_[_0xdac9('0xf')](this[_0xdac9('0xb')])+_0xdac9('0x10')]=this[_0xdac9('0xe')]['id'];}_0x4e8967[_[_0xdac9('0xf')](this['channel'])+_0xdac9('0x11')]=this[_0xdac9('0x12')]['id'];if(rpc[this[_0xdac9('0xb')]+_0xdac9('0x13')]){return rpc[this[_0xdac9('0xb')]+_0xdac9('0x13')][_0xdac9('0x14')](_0x4e8967)[_0xdac9('0x15')](function(_0x5466fe){logger[_0xdac9('0x16')](_0xdac9('0x17'),_0x510309,_0x4e8967[_0xdac9('0x18')]);_0x3f8e2f[_0xdac9('0x19')]();})['catch'](function(_0x29a123){logger['error']('[%s][MESSAGE]\x20%s',_0x510309,JSON['stringify'](_0x29a123));_0x3f8e2f[_0xdac9('0x1a')]();});}}catch(_0xdd546a){logger['error'](_0xdac9('0x17'),_0x510309,JSON[_0xdac9('0x1b')](_0xdd546a));_0x3f8e2f[_0xdac9('0x1a')]();}};}; \ No newline at end of file +var _0x25c2=['../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','chat','upperFirst','channel','AccountId','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/openchannelMessage'];(function(_0x3f27b2,_0x368044){var _0x3d5063=function(_0x960b40){while(--_0x960b40){_0x3f27b2['push'](_0x3f27b2['shift']());}};_0x3d5063(++_0x368044);}(_0x25c2,0xdd));var _0x225c=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x25c2[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x225c('0x0'));var utils=require('./utils');var logger=require(_0x225c('0x1'))(_0x225c('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x225c('0x3')),'mailMessage':require(_0x225c('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x225c('0x5')),'whatsappMessage':require(_0x225c('0x6'))};exports['consequence']=function(_0x169435,_0x1f3b42){return function(_0x1fac61){try{var _0x36c1aa={'body':utils[_0x225c('0x7')](_0x1f3b42[0x0],this),'ContactId':this[_0x225c('0x8')]['id']};if(this['channel']===_0x225c('0x9')){_0x36c1aa['ChatWebsiteId']=this['account']['id'];}else{_0x36c1aa[_[_0x225c('0xa')](this[_0x225c('0xb')])+_0x225c('0xc')]=this['account']['id'];}_0x36c1aa[_[_0x225c('0xa')](this[_0x225c('0xb')])+_0x225c('0xd')]=this[_0x225c('0xe')]['id'];if(rpc[this['channel']+_0x225c('0xf')]){return rpc[this[_0x225c('0xb')]+'Message'][_0x225c('0x10')](_0x36c1aa)[_0x225c('0x11')](function(_0x18ab23){logger['info'](_0x225c('0x12'),_0x169435,_0x36c1aa[_0x225c('0x13')]);_0x1fac61[_0x225c('0x14')]();})[_0x225c('0x15')](function(_0x1f9782){logger[_0x225c('0x16')](_0x225c('0x12'),_0x169435,JSON[_0x225c('0x17')](_0x1f9782));_0x1fac61['stop']();});}}catch(_0x5a2c4b){logger[_0x225c('0x16')](_0x225c('0x12'),_0x169435,JSON[_0x225c('0x17')](_0x5a2c4b));_0x1fac61[_0x225c('0x18')]();}};}; \ 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 f75ff09..094f4ae 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 _0x9ce8=['stringify','stop','./utils','../../../../config/logger','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x3dfa1c,_0x25e509){var _0x521747=function(_0x450db8){while(--_0x450db8){_0x3dfa1c['push'](_0x3dfa1c['shift']());}};_0x521747(++_0x25e509);}(_0x9ce8,0xf5));var _0x89ce=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x9ce8[_0x47b58b];return _0x46bebe;};'use strict';var utils=require(_0x89ce('0x0'));var logger=require(_0x89ce('0x1'))('routing');exports['consequence']=function(_0x13892a,_0x44d51e){return function(_0x443a8f){try{logger[_0x89ce('0x2')](_0x89ce('0x3'),_0x13892a,utils[_0x89ce('0x4')](_0x44d51e[0x0],this));_0x443a8f[_0x89ce('0x5')]();}catch(_0x41c940){logger[_0x89ce('0x6')](_0x89ce('0x3'),_0x13892a,JSON[_0x89ce('0x7')](_0x41c940));_0x443a8f[_0x89ce('0x8')]();}};}; \ No newline at end of file +var _0x7899=['[%s][NOOP]\x20%s','next','error','stop','./utils','../../../../config/logger','routing','consequence','info'];(function(_0x43606b,_0x2f2292){var _0xbfd21a=function(_0x2f28fa){while(--_0x2f28fa){_0x43606b['push'](_0x43606b['shift']());}};_0xbfd21a(++_0x2f2292);}(_0x7899,0x15a));var _0x9789=function(_0x4b8156,_0x437af2){_0x4b8156=_0x4b8156-0x0;var _0x4a819c=_0x7899[_0x4b8156];return _0x4a819c;};'use strict';var utils=require(_0x9789('0x0'));var logger=require(_0x9789('0x1'))(_0x9789('0x2'));exports[_0x9789('0x3')]=function(_0x2ea5ee,_0x1419aa){return function(_0x339480){try{logger[_0x9789('0x4')](_0x9789('0x5'),_0x2ea5ee,utils['getMustacheRender'](_0x1419aa[0x0],this));_0x339480[_0x9789('0x6')]();}catch(_0x599ac5){logger[_0x9789('0x7')](_0x9789('0x5'),_0x2ea5ee,JSON['stringify'](_0x599ac5));_0x339480[_0x9789('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 a7dcdb8..ac8f515 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 _0x42b9=['number','waiting','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','body','Interaction','then','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','next','rrmemory','beepall','stack','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','account','queue','from','joinAt','clone','queue_id','push','capitalize','InteractionId','%sQueuesWaitingInteractions','format','%s_queue_waiting_interaction:%s','pick','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x42b9,0x12d));var _0x942b=function(_0x2ff1da,_0x29ea0e){_0x2ff1da=_0x2ff1da-0x0;var _0x22bd85=_0x42b9[_0x2ff1da];return _0x22bd85;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x942b('0x0'));var seqqueue=require(_0x942b('0x1'));var moment=require(_0x942b('0x2'));var Redis=require(_0x942b('0x3'));var config=require(_0x942b('0x4'));var logger=require(_0x942b('0x5'))(_0x942b('0x6'));var strategy=require(_0x942b('0x7'));config[_0x942b('0x8')]=_[_0x942b('0x9')](config[_0x942b('0x8')],{'host':_0x942b('0xa'),'port':0x18eb});var io=require(_0x942b('0xb'))(new Redis(config['redis']));var attributes=['id','queue_id',_0x942b('0xc'),_0x942b('0xd'),_0x942b('0xe'),_0x942b('0xf')];function emit(_0x3ae6b5,_0x585a91,_0x158551){io['to'](_0x3ae6b5)['emit'](_0x585a91,_0x158551);}function emitChannelQueueInteraction(_0x263f82,_0x565b1a,_0x241a62,_0x162a48,_0x2330d7,_0x3c2dcc,_0x3978a6,_0x16f73e){var _0x58c861=_[_0x942b('0x10')](_0x241a62);_0x58c861[_0x942b('0x11')]=_0x16f73e;_0x58c861[_0x942b('0xd')]=_0x565b1a;_0x58c861[_0x942b('0xc')]=_0x162a48;_0x58c861['id']=_0x2330d7;if(_0x3c2dcc){attributes[_0x942b('0x12')](_[_0x942b('0x13')](_0x263f82)+_0x942b('0x14'));_0x3978a6[util['format'](_0x942b('0x15'),_0x263f82)][_0x2330d7]=_['pick'](_0x58c861,attributes);}else{delete _0x3978a6[util['format'](_0x942b('0x15'),_0x263f82)][_0x2330d7];}emit(util[_0x942b('0x16')]('%s:queue:%s',_0x263f82,_0x565b1a),util['format'](_0x942b('0x17'),_0x263f82,_0x3c2dcc?'save':'remove'),_[_0x942b('0x18')](_0x58c861,attributes));}var rpc={'openchannelQueueReport':require(_0x942b('0x19')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x942b('0x1a')),'faxQueueReport':require(_0x942b('0x1b')),'whatsappQueueReport':require(_0x942b('0x1c')),'chatInteraction':require(_0x942b('0x1d')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require(_0x942b('0x1e')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x942b('0x1f')),'whatsappInteraction':require(_0x942b('0x20'))};var queue=schema({'name':{'type':_0x942b('0x21'),'required':!![],'message':_0x942b('0x22')},'timeout':{'type':_0x942b('0x23'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x2f6f68,_0x2bf4ca,_0x1665d7,_0x4c0438){if(_0x2f6f68&&_0x2bf4ca&&_0x1665d7){_0x2bf4ca[_0x942b('0x24')]+=0x1;var _0x47d8cc={'uniqueid':_0x2f6f68,'from':_0x1665d7['body']?_0x1665d7['body'][_0x942b('0xe')]:'','joinAt':moment()['format'](_0x942b('0x25')),'ContactId':_0x1665d7[_0x942b('0x26')]?_0x1665d7[_0x942b('0x26')]['id']:null,'ListId':_0x1665d7['list']?_0x1665d7[_0x942b('0x27')]['id']:null};_0x47d8cc[_['upperFirst'](_0x1665d7[_0x942b('0x28')])+_0x942b('0x29')]=_0x2bf4ca['id']||null;_0x47d8cc[_[_0x942b('0x2a')](_0x1665d7[_0x942b('0x28')])+_0x942b('0x14')]=_0x1665d7[_0x942b('0x2b')]?_0x1665d7[_0x942b('0x2b')]['id']:null;_0x47d8cc[_[_0x942b('0x2a')](_0x1665d7[_0x942b('0x28')])+'MessageId']=_0x1665d7[_0x942b('0x2c')]?_0x1665d7['message']['id']:null;_0x47d8cc[_[_0x942b('0x2a')](_0x1665d7[_0x942b('0x28')])+(_0x1665d7['channel']!=='chat'?_0x942b('0x2d'):_0x942b('0x2e'))]=_0x1665d7[_0x942b('0xc')]?_0x1665d7[_0x942b('0xc')]['id']:null;logger[_0x942b('0x2f')](util[_0x942b('0x16')](_0x942b('0x30'),_0x2f6f68,_0x2bf4ca[_0x942b('0x31')]));emitChannelQueueInteraction(_0x1665d7[_0x942b('0x28')],_0x2bf4ca['name'],_0x47d8cc,_0x1665d7['account']['name'],_0x1665d7[_0x942b('0x2c')]['id'],!![],_0x4c0438,_0x2bf4ca['id']);if(rpc[_0x1665d7[_0x942b('0x28')]+'QueueReport']){return rpc[_0x1665d7[_0x942b('0x28')]+_0x942b('0x32')][_0x942b('0x33')](_0x47d8cc)[_0x942b('0x34')](function(_0x4e03ed){logger[_0x942b('0x35')](_0x942b('0x36'),_0x4e03ed);});}}}function stopRouting(_0x311cf7,_0x242b7e,_0x1f641e,_0x351dd6){if(_0x311cf7&&_0x242b7e){_0x242b7e[_0x942b('0x24')]-=0x1;var _0x152568={'leaveAt':moment()['format'](_0x942b('0x25')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x942b('0x37')};logger['info'](util[_0x942b('0x16')](_0x942b('0x38'),_0x311cf7,_0x242b7e[_0x942b('0x31')]));emitChannelQueueInteraction(_0x1f641e[_0x942b('0x28')],_0x242b7e['name'],_0x1f641e[_0x942b('0x39')],_0x1f641e[_0x942b('0xc')]['name'],_0x1f641e[_0x942b('0x2c')]['id'],![],_0x351dd6,_0x242b7e['id']);return rpc[_0x1f641e['channel']+_0x942b('0x3a')]['update'](_0x1f641e[_0x942b('0x2b')]['id'],{'queueId':_0x242b7e['id']})[_0x942b('0x3b')](function(){if(rpc[_0x1f641e[_0x942b('0x28')]+_0x942b('0x32')]){return rpc[_0x1f641e[_0x942b('0x28')]+'QueueReport'][_0x942b('0x3c')](_0x311cf7,_0x152568)[_0x942b('0x34')](function(_0x9c985d){logger['error']('update\x20queue\x20report',_0x9c985d);});}});}}function endRouting(_0x4add14,_0x13f67a,_0x1309d1,_0x31043a){if(_0x4add14&&_0x13f67a){_0x13f67a[_0x942b('0x24')]-=0x1;var _0x550de3={'leaveAt':moment()[_0x942b('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x942b('0x16')](_0x942b('0x25')),'reason':_0x942b('0x3d')};logger[_0x942b('0x2f')](util[_0x942b('0x16')](_0x942b('0x3e'),_0x4add14,_0x13f67a[_0x942b('0x31')]));emitChannelQueueInteraction(_0x1309d1[_0x942b('0x28')],_0x13f67a[_0x942b('0x31')],_0x1309d1[_0x942b('0x39')],_0x1309d1[_0x942b('0xc')]['name'],_0x1309d1[_0x942b('0x2c')]['id'],![],_0x31043a);if(rpc[_0x1309d1['channel']+_0x942b('0x32')]){return rpc[_0x1309d1[_0x942b('0x28')]+_0x942b('0x32')][_0x942b('0x3c')](_0x4add14,_0x550de3)[_0x942b('0x34')](function(_0x1a7d61){logger[_0x942b('0x35')](_0x942b('0x3f'),_0x1a7d61);});}}}function handleFindQueue(_0x25b947){return function(_0x41ddae){return _0x41ddae[_0x942b('0x31')]['toLowerCase']()===_0x25b947[_0x942b('0x40')]();};}exports[_0x942b('0x41')]=function(_0x35397d,_0x547460,_0x56807d,_0x5253d2){return function(_0xde0813){try{var _0x51369f={'name':_0x547460[0x0],'timeout':_0x547460[0x1]};var _0x3845b3=queue[_0x942b('0x42')](_0x51369f,{'typecast':!![]});if(_0x3845b3[_0x942b('0x43')]){logger['error'](_0x942b('0x44'),_0x35397d,_[_0x942b('0x45')](_0x3845b3,_0x942b('0x2c'))[_0x942b('0x46')](',\x20'));_0xde0813[_0x942b('0x47')]();}else{var _0x3640b4=_[_0x942b('0x48')](_0x56807d[_0x5253d2[_0x942b('0x28')]+_0x942b('0x49')],handleFindQueue(_0x51369f[_0x942b('0x31')]));if(_0x3640b4){startRouting(_0x35397d,_0x3640b4,_0x5253d2,_0x56807d);var _0x2707f5=(_0x3640b4[_0x942b('0x3d')]||0xa)*0x3e8;var _0x4cb63a=(_0x51369f['timeout']||0x14)*0x3e8;var _0x516377;if(_0x2707f5>_0x4cb63a){_0x4cb63a=_0x2707f5;}var _0x2b7f77=seqqueue[_0x942b('0x4a')](_0x2707f5);_0x2b7f77['id']=_0x35397d;_0x2b7f77[_0x942b('0x4b')]=_0x2707f5;_0x2b7f77[_0x942b('0x4c')]=_0x4cb63a;_0x2b7f77[_0x942b('0x28')]=_0x5253d2[_0x942b('0x28')];_0x56807d[_0x942b('0x4d')][_0x35397d]['on']('end',function(){logger['info'](_0x942b('0x4e'),_0x35397d);stopRouting(_0x35397d,_0x3640b4,_0x5253d2,_0x56807d);clearTimeout(_0x516377);_0x516377=undefined;_0x2b7f77[_0x942b('0x4f')](!![]);if(_0x56807d[_0x942b('0x4d')][_0x35397d]){delete _0x56807d['rules'][_0x35397d];}_0xde0813[_0x942b('0x47')]();});_0x56807d[_0x942b('0x4d')][_0x35397d]['on']('complete',function(){if(_0x56807d['rules'][_0x35397d]){delete _0x56807d[_0x942b('0x4d')][_0x35397d];}});_0x516377=setTimeout(function(){logger[_0x942b('0x2f')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x35397d);endRouting(_0x35397d,_0x3640b4,_0x5253d2,_0x56807d);clearTimeout(_0x516377);_0x2b7f77[_0x942b('0x4f')](!![]);_0xde0813[_0x942b('0x50')]();},_0x4cb63a);switch(_0x3640b4['strategy']){case _0x942b('0x51'):strategy[_0x942b('0x51')](_0x2b7f77,_0x3640b4,_0x56807d,_0x5253d2);break;default:strategy[_0x942b('0x52')](_0x2b7f77,_0x3640b4,_0x56807d,_0x5253d2);}}else{logger[_0x942b('0x35')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x35397d,_0x51369f[_0x942b('0x31')]);_0xde0813[_0x942b('0x47')]();}}}catch(_0x149d83){logger[_0x942b('0x35')](_0x942b('0x44'),_0x35397d,_0x149d83[_0x942b('0x53')]);_0xde0813['stop']();}};}; \ No newline at end of file +var _0xeb3e=['stack','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','defaults','localhost','socket.io-emitter','redis','queue_id','account','queue','from','emit','clone','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','interaction','MessageId','message','upperFirst','chat','WebsiteId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','Interaction','then','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall'];(function(_0x5d1017,_0x1fbe76){var _0x5ed206=function(_0x38844d){while(--_0x38844d){_0x5d1017['push'](_0x5d1017['shift']());}};_0x5ed206(++_0x1fbe76);}(_0xeb3e,0x106));var _0xeeb3=function(_0x393173,_0x4beba2){_0x393173=_0x393173-0x0;var _0x3f1990=_0xeb3e[_0x393173];return _0x3f1990;};'use strict';var schema=require('validate');var _=require(_0xeeb3('0x0'));var util=require(_0xeeb3('0x1'));var seqqueue=require(_0xeeb3('0x2'));var moment=require(_0xeeb3('0x3'));var Redis=require(_0xeeb3('0x4'));var config=require('../../../../config/environment');var logger=require(_0xeeb3('0x5'))(_0xeeb3('0x6'));var strategy=require(_0xeeb3('0x7'));config['redis']=_[_0xeeb3('0x8')](config['redis'],{'host':_0xeeb3('0x9'),'port':0x18eb});var io=require(_0xeeb3('0xa'))(new Redis(config[_0xeeb3('0xb')]));var attributes=['id',_0xeeb3('0xc'),_0xeeb3('0xd'),_0xeeb3('0xe'),_0xeeb3('0xf'),'joinAt'];function emit(_0x5b751a,_0x289444,_0x3a9542){io['to'](_0x5b751a)[_0xeeb3('0x10')](_0x289444,_0x3a9542);}function emitChannelQueueInteraction(_0x5b885a,_0x3e8d18,_0x5047d8,_0x485272,_0x79d78a,_0x6c4b00,_0x20fd5b,_0x57f7f6){var _0x192dfc=_[_0xeeb3('0x11')](_0x5047d8);_0x192dfc[_0xeeb3('0xc')]=_0x57f7f6;_0x192dfc[_0xeeb3('0xe')]=_0x3e8d18;_0x192dfc['account']=_0x485272;_0x192dfc['id']=_0x79d78a;if(_0x6c4b00){attributes['push'](_[_0xeeb3('0x12')](_0x5b885a)+_0xeeb3('0x13'));_0x20fd5b[util[_0xeeb3('0x14')](_0xeeb3('0x15'),_0x5b885a)][_0x79d78a]=_[_0xeeb3('0x16')](_0x192dfc,attributes);}else{delete _0x20fd5b[util[_0xeeb3('0x14')](_0xeeb3('0x15'),_0x5b885a)][_0x79d78a];}emit(util[_0xeeb3('0x14')](_0xeeb3('0x17'),_0x5b885a,_0x3e8d18),util[_0xeeb3('0x14')](_0xeeb3('0x18'),_0x5b885a,_0x6c4b00?'save':_0xeeb3('0x19')),_[_0xeeb3('0x16')](_0x192dfc,attributes));}var rpc={'openchannelQueueReport':require(_0xeeb3('0x1a')),'mailQueueReport':require(_0xeeb3('0x1b')),'chatQueueReport':require(_0xeeb3('0x1c')),'smsQueueReport':require(_0xeeb3('0x1d')),'faxQueueReport':require(_0xeeb3('0x1e')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport'),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0xeeb3('0x1f')),'smsInteraction':require(_0xeeb3('0x20')),'whatsappInteraction':require(_0xeeb3('0x21'))};var queue=schema({'name':{'type':_0xeeb3('0x22'),'required':!![],'message':_0xeeb3('0x23')},'timeout':{'type':_0xeeb3('0x24'),'message':_0xeeb3('0x25')}});function startRouting(_0x4dc259,_0x5ca6d4,_0x392b6d,_0x5d770a){if(_0x4dc259&&_0x5ca6d4&&_0x392b6d){_0x5ca6d4[_0xeeb3('0x26')]+=0x1;var _0x8f9fe4={'uniqueid':_0x4dc259,'from':_0x392b6d[_0xeeb3('0x27')]?_0x392b6d[_0xeeb3('0x27')]['from']:'','joinAt':moment()[_0xeeb3('0x14')](_0xeeb3('0x28')),'ContactId':_0x392b6d['contact']?_0x392b6d[_0xeeb3('0x29')]['id']:null,'ListId':_0x392b6d[_0xeeb3('0x2a')]?_0x392b6d['list']['id']:null};_0x8f9fe4[_['upperFirst'](_0x392b6d[_0xeeb3('0x2b')])+_0xeeb3('0x2c')]=_0x5ca6d4['id']||null;_0x8f9fe4[_['upperFirst'](_0x392b6d[_0xeeb3('0x2b')])+_0xeeb3('0x13')]=_0x392b6d['interaction']?_0x392b6d[_0xeeb3('0x2d')]['id']:null;_0x8f9fe4[_['upperFirst'](_0x392b6d['channel'])+_0xeeb3('0x2e')]=_0x392b6d[_0xeeb3('0x2f')]?_0x392b6d[_0xeeb3('0x2f')]['id']:null;_0x8f9fe4[_[_0xeeb3('0x30')](_0x392b6d[_0xeeb3('0x2b')])+(_0x392b6d[_0xeeb3('0x2b')]!==_0xeeb3('0x31')?'AccountId':_0xeeb3('0x32'))]=_0x392b6d[_0xeeb3('0xd')]?_0x392b6d[_0xeeb3('0xd')]['id']:null;logger[_0xeeb3('0x33')](util[_0xeeb3('0x14')]('[%s][START:QUEUE][NAME:%s]',_0x4dc259,_0x5ca6d4[_0xeeb3('0x34')]));emitChannelQueueInteraction(_0x392b6d[_0xeeb3('0x2b')],_0x5ca6d4[_0xeeb3('0x34')],_0x8f9fe4,_0x392b6d['account'][_0xeeb3('0x34')],_0x392b6d[_0xeeb3('0x2f')]['id'],!![],_0x5d770a,_0x5ca6d4['id']);if(rpc[_0x392b6d[_0xeeb3('0x2b')]+_0xeeb3('0x35')]){return rpc[_0x392b6d[_0xeeb3('0x2b')]+_0xeeb3('0x35')][_0xeeb3('0x36')](_0x8f9fe4)[_0xeeb3('0x37')](function(_0x5277b5){logger[_0xeeb3('0x38')](_0xeeb3('0x39'),_0x5277b5);});}}}function stopRouting(_0x312189,_0x1dbee0,_0x3a6e46,_0x57f5f3){if(_0x312189&&_0x1dbee0){_0x1dbee0[_0xeeb3('0x26')]-=0x1;var _0xb1e6f3={'leaveAt':moment()[_0xeeb3('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xeeb3('0x14')](_0xeeb3('0x28')),'reason':'accepted'};logger[_0xeeb3('0x33')](util[_0xeeb3('0x14')](_0xeeb3('0x3a'),_0x312189,_0x1dbee0[_0xeeb3('0x34')]));emitChannelQueueInteraction(_0x3a6e46[_0xeeb3('0x2b')],_0x1dbee0[_0xeeb3('0x34')],_0x3a6e46[_0xeeb3('0x27')],_0x3a6e46[_0xeeb3('0xd')][_0xeeb3('0x34')],_0x3a6e46['message']['id'],![],_0x57f5f3,_0x1dbee0['id']);return rpc[_0x3a6e46['channel']+_0xeeb3('0x3b')]['update'](_0x3a6e46[_0xeeb3('0x2d')]['id'],{'queueId':_0x1dbee0['id']})[_0xeeb3('0x3c')](function(){if(rpc[_0x3a6e46[_0xeeb3('0x2b')]+_0xeeb3('0x35')]){return rpc[_0x3a6e46[_0xeeb3('0x2b')]+_0xeeb3('0x35')][_0xeeb3('0x3d')](_0x312189,_0xb1e6f3)[_0xeeb3('0x37')](function(_0x59ab76){logger['error'](_0xeeb3('0x3e'),_0x59ab76);});}});}}function endRouting(_0x1fb7f5,_0x80aa19,_0x267382,_0x278fe5){if(_0x1fb7f5&&_0x80aa19){_0x80aa19[_0xeeb3('0x26')]-=0x1;var _0x1144d6={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xeeb3('0x14')](_0xeeb3('0x28')),'reason':_0xeeb3('0x3f')};logger[_0xeeb3('0x33')](util[_0xeeb3('0x14')](_0xeeb3('0x40'),_0x1fb7f5,_0x80aa19['name']));emitChannelQueueInteraction(_0x267382['channel'],_0x80aa19[_0xeeb3('0x34')],_0x267382[_0xeeb3('0x27')],_0x267382[_0xeeb3('0xd')][_0xeeb3('0x34')],_0x267382['message']['id'],![],_0x278fe5);if(rpc[_0x267382[_0xeeb3('0x2b')]+'QueueReport']){return rpc[_0x267382[_0xeeb3('0x2b')]+_0xeeb3('0x35')]['update'](_0x1fb7f5,_0x1144d6)['catch'](function(_0x162535){logger['error'](_0xeeb3('0x3e'),_0x162535);});}}}function handleFindQueue(_0x37ed38){return function(_0x3cf13b){return _0x3cf13b[_0xeeb3('0x34')]['toLowerCase']()===_0x37ed38[_0xeeb3('0x41')]();};}exports[_0xeeb3('0x42')]=function(_0x1dbdf6,_0x52e8ab,_0x1e974c,_0xfd7984){return function(_0x6b4e10){try{var _0x512e8e={'name':_0x52e8ab[0x0],'timeout':_0x52e8ab[0x1]};var _0x45d57e=queue['validate'](_0x512e8e,{'typecast':!![]});if(_0x45d57e[_0xeeb3('0x43')]){logger[_0xeeb3('0x38')](_0xeeb3('0x44'),_0x1dbdf6,_[_0xeeb3('0x45')](_0x45d57e,'message')[_0xeeb3('0x46')](',\x20'));_0x6b4e10[_0xeeb3('0x47')]();}else{var _0x4e0508=_[_0xeeb3('0x48')](_0x1e974c[_0xfd7984['channel']+'Queues'],handleFindQueue(_0x512e8e[_0xeeb3('0x34')]));if(_0x4e0508){startRouting(_0x1dbdf6,_0x4e0508,_0xfd7984,_0x1e974c);var _0x3653cf=(_0x4e0508[_0xeeb3('0x3f')]||0xa)*0x3e8;var _0x33d599=(_0x512e8e[_0xeeb3('0x3f')]||0x14)*0x3e8;var _0x450dc2;if(_0x3653cf>_0x33d599){_0x33d599=_0x3653cf;}var _0x4b3c5d=seqqueue[_0xeeb3('0x49')](_0x3653cf);_0x4b3c5d['id']=_0x1dbdf6;_0x4b3c5d[_0xeeb3('0x4a')]=_0x3653cf;_0x4b3c5d[_0xeeb3('0x4b')]=_0x33d599;_0x4b3c5d[_0xeeb3('0x2b')]=_0xfd7984[_0xeeb3('0x2b')];_0x1e974c['rules'][_0x1dbdf6]['on'](_0xeeb3('0x4c'),function(){logger[_0xeeb3('0x33')](_0xeeb3('0x4d'),_0x1dbdf6);stopRouting(_0x1dbdf6,_0x4e0508,_0xfd7984,_0x1e974c);clearTimeout(_0x450dc2);_0x450dc2=undefined;_0x4b3c5d[_0xeeb3('0x4e')](!![]);if(_0x1e974c[_0xeeb3('0x4f')][_0x1dbdf6]){delete _0x1e974c[_0xeeb3('0x4f')][_0x1dbdf6];}_0x6b4e10['stop']();});_0x1e974c[_0xeeb3('0x4f')][_0x1dbdf6]['on'](_0xeeb3('0x50'),function(){if(_0x1e974c[_0xeeb3('0x4f')][_0x1dbdf6]){delete _0x1e974c[_0xeeb3('0x4f')][_0x1dbdf6];}});_0x450dc2=setTimeout(function(){logger[_0xeeb3('0x33')](_0xeeb3('0x51'),_0x1dbdf6);endRouting(_0x1dbdf6,_0x4e0508,_0xfd7984,_0x1e974c);clearTimeout(_0x450dc2);_0x4b3c5d['close'](!![]);_0x6b4e10[_0xeeb3('0x52')]();},_0x33d599);switch(_0x4e0508[_0xeeb3('0x53')]){case _0xeeb3('0x54'):strategy['rrmemory'](_0x4b3c5d,_0x4e0508,_0x1e974c,_0xfd7984);break;default:strategy[_0xeeb3('0x55')](_0x4b3c5d,_0x4e0508,_0x1e974c,_0xfd7984);}}else{logger[_0xeeb3('0x38')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x1dbdf6,_0x512e8e['name']);_0x6b4e10[_0xeeb3('0x47')]();}}}catch(_0x2c3431){logger[_0xeeb3('0x38')](_0xeeb3('0x44'),_0x1dbdf6,_0x2c3431[_0xeeb3('0x56')]);_0x6b4e10[_0xeeb3('0x47')]();}};}; \ 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 faf2154..c72024b 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 _0x84ab=['realtime','channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','push','bind','handleTimeout','prototype','handleRun','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x84ab,0x12f));var _0xb84a=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x84ab[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xb84a('0x0'));var uuid=require(_0xb84a('0x1'));var util=require(_0xb84a('0x2'));var logger=require(_0xb84a('0x3'))(_0xb84a('0x4'));var Agent=function(_0x512f13,_0xc83587,_0x18a4a5,_0x47b8e3){this[_0xb84a('0x5')]=uuid['v4']();this[_0xb84a('0x6')]=_0x512f13;this[_0xb84a('0x7')]=_0xc83587;this['realtime']=_0x18a4a5;this['routing']=_0x47b8e3;this['squeue'][_0xb84a('0x8')](this['handleRun'][_0xb84a('0x9')](this),this[_0xb84a('0xa')]['bind'](this));this[_0xb84a('0x6')]['on']('timeout',this[_0xb84a('0xa')][_0xb84a('0x9')](this));this[_0xb84a('0x6')]['on']('drained',this['handleDrained']['bind'](this));};Agent[_0xb84a('0xb')][_0xb84a('0x8')]=function(){this[_0xb84a('0x6')][_0xb84a('0x8')](this[_0xb84a('0xc')]['bind'](this),this[_0xb84a('0xa')][_0xb84a('0x9')](this));};Agent[_0xb84a('0xb')][_0xb84a('0xd')]=function(){this[_0xb84a('0xa')](!![]);};Agent[_0xb84a('0xb')][_0xb84a('0xc')]=function(){logger[_0xb84a('0xe')](_0xb84a('0xf'),this[_0xb84a('0x6')]['id'],this[_0xb84a('0x7')]['id']);if(_[_0xb84a('0x10')](this['realtime'][_0xb84a('0x11')][this[_0xb84a('0x7')]['id']])){logger[_0xb84a('0xe')](_0xb84a('0x12'),this[_0xb84a('0x6')]['id'],this[_0xb84a('0x7')]['id']);setTimeout(this[_0xb84a('0x8')][_0xb84a('0x9')](this),0x3e8);}else{if(this[_0xb84a('0x4')][_0xb84a('0x13')]||util[_0xb84a('0x14')](this[_0xb84a('0x6')]['id'],this[_0xb84a('0x15')][_0xb84a('0x11')][this['agent']['id']],this[_0xb84a('0x6')][_0xb84a('0x16')],![])){this['realtime'][_0xb84a('0x11')][this[_0xb84a('0x7')]['id']][_0xb84a('0x17')]=!![];this[_0xb84a('0x15')]['agents'][this['agent']['id']][_0xb84a('0x18')]=undefined;util[_0xb84a('0x19')](this[_0xb84a('0x15')],this[_0xb84a('0x4')],this[_0xb84a('0x7')],this[_0xb84a('0x6')][_0xb84a('0x16')]);util[_0xb84a('0x1a')](this[_0xb84a('0x5')],this[_0xb84a('0x6')]['id'],this[_0xb84a('0x15')][_0xb84a('0x11')][this[_0xb84a('0x7')]['id']],null,this[_0xb84a('0x4')]);util[_0xb84a('0x1b')](this[_0xb84a('0x6')]['id'],this[_0xb84a('0x15')][_0xb84a('0x11')][this[_0xb84a('0x7')]['id']],_0xb84a('0x1c')+(this[_0xb84a('0x4')][_0xb84a('0x13')]?_0xb84a('0x1d'):''));}else{logger[_0xb84a('0xe')](_0xb84a('0x1e'),this[_0xb84a('0x6')]['id'],this['agent']['id']);setTimeout(this['push'][_0xb84a('0x9')](this),0x3e8);}}};Agent[_0xb84a('0xb')]['handleTimeout']=function(_0x1f690a){if(_[_0xb84a('0x10')](this['realtime']['agents'][this[_0xb84a('0x7')]['id']])){return logger[_0xb84a('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xb84a('0x6')]['id'],this[_0xb84a('0x7')]['id']);}else{logger[_0xb84a('0xe')](_0xb84a('0x1f'),this[_0xb84a('0x6')]['id'],this[_0xb84a('0x7')]['id']);util[_0xb84a('0x20')](this[_0xb84a('0x5')],this['squeue']['id'],this[_0xb84a('0x15')]['agents'][this['agent']['id']],null,this[_0xb84a('0x4')]);this[_0xb84a('0x15')]['agents'][this['agent']['id']][_0xb84a('0x17')]=![];this[_0xb84a('0x15')][_0xb84a('0x11')][this[_0xb84a('0x7')]['id']][_0xb84a('0x18')]=undefined;util[_0xb84a('0x21')](this[_0xb84a('0x15')],this[_0xb84a('0x4')],this['agent'],this[_0xb84a('0x6')][_0xb84a('0x16')]);util[_0xb84a('0x1b')](this[_0xb84a('0x6')]['id'],this[_0xb84a('0x15')][_0xb84a('0x11')][this[_0xb84a('0x7')]['id']],_0x1f690a?'STOP':_0xb84a('0x22'));}if(!_0x1f690a){setTimeout(this['push'][_0xb84a('0x9')](this),0x3e8);}};function agent(_0xb93cca,_0x2f7e6c,_0x4d04fb,_0x4af084){return new Agent(_0xb93cca,_0x2f7e6c,_0x4d04fb,_0x4af084);}module[_0xb84a('0x23')]=agent; \ No newline at end of file +var _0xb66c=['TIMEOUT','lodash','./util','routing','notificationId','squeue','agent','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','debug','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','agents','busyQueue','saveWaitingNotification','channel','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','writeLog','STOP'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb66c,0x175));var _0xcb66=function(_0x12c01b,_0x4a8c23){_0x12c01b=_0x12c01b-0x0;var _0x1d0bce=_0xb66c[_0x12c01b];return _0x1d0bce;};'use strict';var _=require(_0xcb66('0x0'));var uuid=require('uuid');var util=require(_0xcb66('0x1'));var logger=require('../../../../../config/logger')(_0xcb66('0x2'));var Agent=function(_0x24ea13,_0xf7ccc5,_0x5f487c,_0x35d439){this[_0xcb66('0x3')]=uuid['v4']();this[_0xcb66('0x4')]=_0x24ea13;this[_0xcb66('0x5')]=_0xf7ccc5;this['realtime']=_0x5f487c;this['routing']=_0x35d439;this[_0xcb66('0x4')][_0xcb66('0x6')](this[_0xcb66('0x7')][_0xcb66('0x8')](this),this[_0xcb66('0x9')]['bind'](this));this[_0xcb66('0x4')]['on'](_0xcb66('0xa'),this[_0xcb66('0x9')][_0xcb66('0x8')](this));this[_0xcb66('0x4')]['on']('drained',this[_0xcb66('0xb')][_0xcb66('0x8')](this));};Agent[_0xcb66('0xc')][_0xcb66('0x6')]=function(){this['squeue'][_0xcb66('0x6')](this[_0xcb66('0x7')][_0xcb66('0x8')](this),this[_0xcb66('0x9')]['bind'](this));};Agent[_0xcb66('0xc')][_0xcb66('0xb')]=function(){this[_0xcb66('0x9')](!![]);};Agent[_0xcb66('0xc')]['handleRun']=function(){logger[_0xcb66('0xd')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xcb66('0x4')]['id'],this['agent']['id']);if(_[_0xcb66('0xe')](this['realtime']['agents'][this[_0xcb66('0x5')]['id']])){logger[_0xcb66('0xd')](_0xcb66('0xf'),this[_0xcb66('0x4')]['id'],this['agent']['id']);setTimeout(this[_0xcb66('0x6')][_0xcb66('0x8')](this),0x3e8);}else{if(this[_0xcb66('0x2')]['forcedOwnership']||util[_0xcb66('0x10')](this['squeue']['id'],this[_0xcb66('0x11')][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']],this[_0xcb66('0x4')]['channel'],![])){this['realtime']['agents'][this[_0xcb66('0x5')]['id']]['busy']=!![];this['realtime'][_0xcb66('0x12')][this['agent']['id']][_0xcb66('0x13')]=undefined;util[_0xcb66('0x14')](this[_0xcb66('0x11')],this[_0xcb66('0x2')],this[_0xcb66('0x5')],this[_0xcb66('0x4')][_0xcb66('0x15')]);util['showNotification'](this[_0xcb66('0x3')],this['squeue']['id'],this['realtime'][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']],null,this[_0xcb66('0x2')]);util['writeLog'](this[_0xcb66('0x4')]['id'],this[_0xcb66('0x11')][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']],'RINGING'+(this[_0xcb66('0x2')][_0xcb66('0x16')]?_0xcb66('0x17'):''));}else{logger[_0xcb66('0xd')](_0xcb66('0x18'),this[_0xcb66('0x4')]['id'],this[_0xcb66('0x5')]['id']);setTimeout(this[_0xcb66('0x6')][_0xcb66('0x8')](this),0x3e8);}}};Agent[_0xcb66('0xc')]['handleTimeout']=function(_0x2152dc){if(_['isNil'](this['realtime']['agents'][this[_0xcb66('0x5')]['id']])){return logger['debug'](_0xcb66('0xf'),this[_0xcb66('0x4')]['id'],this[_0xcb66('0x5')]['id']);}else{logger['debug'](_0xcb66('0x19'),this[_0xcb66('0x4')]['id'],this[_0xcb66('0x5')]['id']);util[_0xcb66('0x1a')](this[_0xcb66('0x3')],this[_0xcb66('0x4')]['id'],this[_0xcb66('0x11')][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']],null,this[_0xcb66('0x2')]);this['realtime'][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']][_0xcb66('0x1b')]=![];this[_0xcb66('0x11')][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']][_0xcb66('0x13')]=undefined;util['removeWaitingNotification'](this[_0xcb66('0x11')],this[_0xcb66('0x2')],this[_0xcb66('0x5')],this[_0xcb66('0x4')]['channel']);util[_0xcb66('0x1c')](this[_0xcb66('0x4')]['id'],this[_0xcb66('0x11')][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']],_0x2152dc?_0xcb66('0x1d'):_0xcb66('0x1e'));}if(!_0x2152dc){setTimeout(this[_0xcb66('0x6')][_0xcb66('0x8')](this),0x3e8);}};function agent(_0x299156,_0x3dc592,_0x17b087,_0x4ef8ba){return new Agent(_0x299156,_0x3dc592,_0x17b087,_0x4ef8ba);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 3abb3f6..fd28c5a 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 _0x3512=['showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','removeWaitingNotification','channel','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','Agents','length','agents','debug','isAgentAvailable','writeLog','busy','busyQueue','name','saveWaitingNotification'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x3512,0xc9));var _0x2351=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3512[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2351('0x0'));var uuid=require(_0x2351('0x1'));var util=require(_0x2351('0x2'));var logger=require(_0x2351('0x3'))(_0x2351('0x4'));var Beepall=function(_0x129d3c,_0x48ebe6,_0xe4558e,_0x11b3db){this[_0x2351('0x5')]=uuid['v4']();this[_0x2351('0x6')]=_0x129d3c;this[_0x2351('0x7')]=_0x48ebe6;this[_0x2351('0x8')]=_0xe4558e;this[_0x2351('0x4')]=_0x11b3db;this[_0x2351('0x6')][_0x2351('0x9')](this[_0x2351('0xa')][_0x2351('0xb')](this),this[_0x2351('0xc')][_0x2351('0xb')](this));this[_0x2351('0x6')]['on'](_0x2351('0xd'),this['handleTimeout'][_0x2351('0xb')](this));this[_0x2351('0x6')]['on'](_0x2351('0xe'),this[_0x2351('0xf')][_0x2351('0xb')](this));};Beepall[_0x2351('0x10')][_0x2351('0x9')]=function(){this[_0x2351('0x6')][_0x2351('0x9')](this[_0x2351('0xa')]['bind'](this),this[_0x2351('0xc')][_0x2351('0xb')](this));};Beepall['prototype'][_0x2351('0xf')]=function(){this[_0x2351('0xc')](!![]);};Beepall[_0x2351('0x10')]['handleRun']=function(){var _0x27224a=!![];if(!_['isNil'](this[_0x2351('0x7')])&&!_['isNil'](this[_0x2351('0x7')][_0x2351('0x11')])&&this[_0x2351('0x7')][_0x2351('0x11')][_0x2351('0x12')]>0x0){for(var _0x57aac3=0x0,_0x206872;_0x57aac30x0){for(var _0x293154=0x0,_0x1a5eb6;_0x2931540x0&&_0x22550d[_0x90589+_0x885d('0x26')]>=_0x22550d[_0x90589+_0x885d('0x27')]){writeLog(_0x2a1c31,_0x22550d,_0x90589[_0x885d('0x28')]()+_0x885d('0x29'));return![];}}return!![];};exports[_0x885d('0x2a')]=function(_0x402440,_0x54e121,_0x5eb6a0,_0x13948c,_0x4cd7fb){return sendNotification(!![],_0x402440,_0x54e121,_0x5eb6a0,_0x13948c,_0x4cd7fb);};exports[_0x885d('0x2b')]=function(_0x17fde0,_0x34c415,_0x1f7120,_0x16f4c1,_0x4589ee){return sendNotification(![],_0x17fde0,_0x34c415,_0x1f7120,_0x16f4c1,_0x4589ee);};exports['checkWaitingNotifications']=function(_0x172d26,_0x3b139b,_0x502e8d){var _0x370e6c=_0x3b139b['interaction']['UserId'];if(!_0x370e6c&&_0x502e8d){_0x370e6c=_0x502e8d['id'];}var _0x3db722=_['some'](_0x172d26[_0x3b139b[_0x885d('0x2c')]+_0x885d('0x2d')],function(_0x20a5f8){var _0x379000=_[_0x885d('0x2e')](_0x3b139b[_0x885d('0x2c')])+'InteractionId';return _0x20a5f8[_0x379000]===_0x3b139b[_0x885d('0x2f')]['id'];});if(!_0x3db722&&_0x370e6c&&_0x172d26[_0x885d('0x30')][_0x370e6c]){_0x3db722=_[_0x885d('0x31')](_0x172d26[_0x885d('0x30')][_0x370e6c][_0x3b139b[_0x885d('0x2c')]+'WaitingInteractions'],function(_0x446fba){return _0x446fba['id']===_0x3b139b[_0x885d('0x2f')]['id'];});}return _0x3db722;};exports['saveWaitingNotification']=function(_0x168a2a,_0x51b769,_0x14a349,_0x23aa7c){if(_0x14a349&&_0x14a349['id']&&_0x168a2a[_0x885d('0x30')]&&_0x168a2a[_0x885d('0x30')][_0x14a349['id']]){_0x168a2a[_0x885d('0x30')][_0x14a349['id']][_0x23aa7c+_0x885d('0x32')][_0x51b769['message']['id']]={'id':_0x51b769['interaction']['id']};}};exports['removeWaitingNotification']=function(_0x488a93,_0x3d6ce7,_0x15a2dc,_0x4ca2de){if(_0x15a2dc&&_0x15a2dc['id']&&_0x488a93[_0x885d('0x30')]&&_0x488a93['agents'][_0x15a2dc['id']]){delete _0x488a93[_0x885d('0x30')][_0x15a2dc['id']][_0x4ca2de+_0x885d('0x32')][_0x3d6ce7[_0x885d('0x19')]['id']];}};exports[_0x885d('0x33')]=writeLog; \ No newline at end of file +var _0xe5e0=['socket.io-emitter','user:%s','name','emit','user:save','split','\x20interaction','account','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','notification:%s','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','OFFLINE','Pause','PAUSE','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','showNotification','UserId','channel','capitalize','InteractionId','interaction','some','saveWaitingNotification','agents','WaitingInteractions','message','removeWaitingNotification','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xe5e0,0x123));var _0x0e5e=function(_0x53e5f3,_0x29dd39){_0x53e5f3=_0x53e5f3-0x0;var _0x372798=_0xe5e0[_0x53e5f3];return _0x372798;};'use strict';var _=require(_0x0e5e('0x0'));var util=require(_0x0e5e('0x1'));var utils=require(_0x0e5e('0x2'));var Redis=require(_0x0e5e('0x3'));var config=require(_0x0e5e('0x4'));var logger=require(_0x0e5e('0x5'))(_0x0e5e('0x6'));config[_0x0e5e('0x7')]=_[_0x0e5e('0x8')](config[_0x0e5e('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x0e5e('0x9'))(new Redis(config[_0x0e5e('0x7')]));function sendNotification(_0x5cc97b,_0x2b6bd9,_0x4f334d,_0x14e323,_0x4ca006,_0xe11377){io['to'](util['format'](_0x0e5e('0xa'),_0x14e323[_0x0e5e('0xb')]))[_0x0e5e('0xc')](_0x0e5e('0xd'),_0x14e323);var _0x1e0782=_0xe11377||{};var _0x3ad3c1=_0x4f334d[_0x0e5e('0xe')]('.');var _0x4296e5={'uniqueid':_0x2b6bd9,'channel':_0x3ad3c1[0x0],'id':_0x3ad3c1[0x1],'title':_0x3ad3c1[0x0]+_0x0e5e('0xf'),'interactionId':_0x3ad3c1[0x2],'queue':_0x4ca006?_0x4ca006['name']:null,'sound':_0x1e0782[_0x0e5e('0x10')]['notificationSound'],'shake':_0x1e0782[_0x0e5e('0x10')]['notificationShake']};try{if(!_0x1e0782[_0x0e5e('0x11')]){_0x1e0782[_0x0e5e('0x11')]={};}if(_0x4ca006){_0x1e0782[_0x0e5e('0x11')][_0x0e5e('0x12')]=_0x4ca006;}else if(_0x1e0782[_0x0e5e('0x11')][_0x0e5e('0x12')]){delete _0x1e0782[_0x0e5e('0x11')]['queue'];}_0x4296e5[_0x0e5e('0x13')]=utils[_0x0e5e('0x14')](_0x1e0782['account'][_0x0e5e('0x15')],_0x1e0782);}catch(_0x26a904){_0x4296e5['msg']=_0x0e5e('0x16');logger[_0x0e5e('0x17')](util['format']('[%s][QUEUE]\x20%s',_0x2b6bd9,_0x26a904['message']));}io['to'](util['format'](_0x0e5e('0xa'),_0x14e323[_0x0e5e('0xb')]))[_0x0e5e('0xc')](util[_0x0e5e('0x18')](_0x0e5e('0x19'),_0x5cc97b?'save':_0x0e5e('0x1a')),_0x4296e5);}function writeLog(_0xc9bdf7,_0x2f158f,_0x5b40dc){return logger['debug'](util[_0x0e5e('0x18')](_0x0e5e('0x1b'),_0xc9bdf7,_0x2f158f['name'],_0x5b40dc));}exports[_0x0e5e('0x1c')]=function(_0x56daf9,_0x2f0c96,_0x15836e,_0x8163bc){if(_0x2f0c96[_0x0e5e('0x1d')]){writeLog(_0x56daf9,_0x2f0c96,_0x0e5e('0x1e'));return![];}if(!_0x2f0c96['online']){writeLog(_0x56daf9,_0x2f0c96,_0x0e5e('0x1f'));return![];}if(_0x2f0c96[_0x15836e+_0x0e5e('0x20')]){writeLog(_0x56daf9,_0x2f0c96,_0x0e5e('0x21'));return![];}if(_0x8163bc&&_0x2f0c96['hasOwnProperty'](_0x15836e+_0x0e5e('0x22'))&&_0x2f0c96[_0x0e5e('0x23')](_0x15836e+_0x0e5e('0x24'))){if(_0x2f0c96[_0x15836e+'Capacity']>0x0&&_0x2f0c96[_0x15836e+_0x0e5e('0x24')]>=_0x2f0c96[_0x15836e+_0x0e5e('0x22')]){writeLog(_0x56daf9,_0x2f0c96,_0x15836e[_0x0e5e('0x25')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x0e5e('0x26')]=function(_0x34dbf5,_0x5e5349,_0x848d2d,_0x2b4b98,_0x2f7f52){return sendNotification(!![],_0x34dbf5,_0x5e5349,_0x848d2d,_0x2b4b98,_0x2f7f52);};exports['hideNotification']=function(_0x1b75f4,_0x27d8ba,_0xd620d6,_0x106dc3,_0x49a401){return sendNotification(![],_0x1b75f4,_0x27d8ba,_0xd620d6,_0x106dc3,_0x49a401);};exports['checkWaitingNotifications']=function(_0x2803c3,_0x5b5f53,_0x29c57d){var _0x364309=_0x5b5f53['interaction'][_0x0e5e('0x27')];if(!_0x364309&&_0x29c57d){_0x364309=_0x29c57d['id'];}var _0x38e4bc=_['some'](_0x2803c3[_0x5b5f53[_0x0e5e('0x28')]+'QueuesWaitingInteractions'],function(_0x27cf6e){var _0x218daf=_[_0x0e5e('0x29')](_0x5b5f53[_0x0e5e('0x28')])+_0x0e5e('0x2a');return _0x27cf6e[_0x218daf]===_0x5b5f53[_0x0e5e('0x2b')]['id'];});if(!_0x38e4bc&&_0x364309&&_0x2803c3['agents'][_0x364309]){_0x38e4bc=_[_0x0e5e('0x2c')](_0x2803c3['agents'][_0x364309][_0x5b5f53['channel']+'WaitingInteractions'],function(_0x2a14e7){return _0x2a14e7['id']===_0x5b5f53[_0x0e5e('0x2b')]['id'];});}return _0x38e4bc;};exports[_0x0e5e('0x2d')]=function(_0x1f6935,_0x1cde0e,_0x429e1c,_0x2fcbae){if(_0x429e1c&&_0x429e1c['id']&&_0x1f6935[_0x0e5e('0x2e')]&&_0x1f6935[_0x0e5e('0x2e')][_0x429e1c['id']]){_0x1f6935[_0x0e5e('0x2e')][_0x429e1c['id']][_0x2fcbae+_0x0e5e('0x2f')][_0x1cde0e[_0x0e5e('0x30')]['id']]={'id':_0x1cde0e[_0x0e5e('0x2b')]['id']};}};exports[_0x0e5e('0x31')]=function(_0x4562a5,_0x1f9876,_0x56736f,_0x40ed25){if(_0x56736f&&_0x56736f['id']&&_0x4562a5[_0x0e5e('0x2e')]&&_0x4562a5[_0x0e5e('0x2e')][_0x56736f['id']]){delete _0x4562a5[_0x0e5e('0x2e')][_0x56736f['id']][_0x40ed25+_0x0e5e('0x2f')][_0x1f9876[_0x0e5e('0x30')]['id']];}};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index a9bd2cb..062cc88 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 _0xa61d=['isObject','stringify','validate','shelljs','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0x16e253,_0xc313a2){var _0x4154=function(_0x29e0a5){while(--_0x29e0a5){_0x16e253['push'](_0x16e253['shift']());}};_0x4154(++_0xc313a2);}(_0xa61d,0x7f));var _0xda61=function(_0x2b869b,_0x81ce74){_0x2b869b=_0x2b869b-0x0;var _0x494958=_0xa61d[_0x2b869b];return _0x494958;};'use strict';var schema=require(_0xda61('0x0'));var sh=require(_0xda61('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0xda61('0x2'))('routing');var system=schema({'command':{'type':_0xda61('0x3'),'required':!![],'message':_0xda61('0x4')}});exports[_0xda61('0x5')]=function(_0x58f4f2,_0x1a6a3d){return function(_0x957cce){try{var _0x2b94b9={'command':_0x1a6a3d[0x0]};var _0x30781e=system[_0xda61('0x0')](_0x2b94b9,{'typecast':!![]});if(_0x30781e[_0xda61('0x6')]){logger[_0xda61('0x7')]('[%s][SYSTEM]\x20%s',_0x58f4f2,_[_0xda61('0x8')](_0x30781e,_0xda61('0x9'))[_0xda61('0xa')](',\x20'));logger[_0xda61('0xb')](_0xda61('0xc'),_0x58f4f2);_0x957cce[_0xda61('0xd')]();}else{var _0x3d1aee=this;var _0x266e80=utils[_0xda61('0xe')](_0x1a6a3d[0x0],this);logger['info'](_0xda61('0xf'),_0x58f4f2,_0x266e80);sh[_0xda61('0x10')](_[_0xda61('0x11')](_0x266e80),function(_0x2254b1,_0x4ea4c8){logger[_0xda61('0xb')](_0xda61('0x12'),_0x58f4f2,_0x2254b1);if(_0x2254b1==0x0){var _0x49da05=_0x4ea4c8[_0xda61('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xda61('0x14')](_0x1a6a3d[0x1])||_['isEmpty'](_0x1a6a3d[0x1])){logger[_0xda61('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x58f4f2);_0x3d1aee[_0xda61('0x15')][_0x1a6a3d[0x1]]=_0x49da05;}else{logger[_0xda61('0xb')](_0xda61('0x16'),_0x58f4f2,_0x1a6a3d[0x1],_0x49da05);_0x3d1aee[_0xda61('0x15')][_0x1a6a3d[0x1]]=_0x49da05;}}_0x957cce['next']();});}}catch(_0x3d059e){logger[_0xda61('0x7')]('[%s][SYSTEM]\x20%s',_0x58f4f2,_[_0xda61('0x17')](_0x3d059e)?JSON[_0xda61('0x18')](_0x3d059e):_0x3d059e);logger['info'](_0xda61('0xc'),_0x58f4f2);_0x957cce['next']();}};}; \ No newline at end of file +var _0x27c9=['[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','validate','shelljs','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','body'];(function(_0x1721f7,_0x2f5f07){var _0x5b1192=function(_0x311cec){while(--_0x311cec){_0x1721f7['push'](_0x1721f7['shift']());}};_0x5b1192(++_0x2f5f07);}(_0x27c9,0x12e));var _0x927c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x27c9[_0x432682];return _0x463d05;};'use strict';var schema=require(_0x927c('0x0'));var sh=require(_0x927c('0x1'));var _=require('lodash');var utils=require(_0x927c('0x2'));var logger=require(_0x927c('0x3'))(_0x927c('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0x927c('0x5')}});exports[_0x927c('0x6')]=function(_0xc97926,_0x19b972){return function(_0x2d826e){try{var _0x4a834f={'command':_0x19b972[0x0]};var _0x37d83c=system[_0x927c('0x0')](_0x4a834f,{'typecast':!![]});if(_0x37d83c[_0x927c('0x7')]){logger[_0x927c('0x8')](_0x927c('0x9'),_0xc97926,_[_0x927c('0xa')](_0x37d83c,'message')[_0x927c('0xb')](',\x20'));logger[_0x927c('0xc')](_0x927c('0xd'),_0xc97926);_0x2d826e[_0x927c('0xe')]();}else{var _0x5b1edc=this;var _0x103c46=utils[_0x927c('0xf')](_0x19b972[0x0],this);logger['info'](_0x927c('0x10'),_0xc97926,_0x103c46);sh[_0x927c('0x11')](_[_0x927c('0x12')](_0x103c46),function(_0x2cd898,_0x3e1379){logger[_0x927c('0xc')](_0x927c('0x13'),_0xc97926,_0x2cd898);if(_0x2cd898==0x0){var _0xe2036a=_0x3e1379['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x19b972[0x1])||_[_0x927c('0x14')](_0x19b972[0x1])){logger['info'](_0x927c('0x15'),_0xc97926);_0x5b1edc[_0x927c('0x16')][_0x19b972[0x1]]=_0xe2036a;}else{logger[_0x927c('0xc')](_0x927c('0x17'),_0xc97926,_0x19b972[0x1],_0xe2036a);_0x5b1edc['body'][_0x19b972[0x1]]=_0xe2036a;}}_0x2d826e[_0x927c('0xe')]();});}}catch(_0x542bb1){logger[_0x927c('0x8')](_0x927c('0x9'),_0xc97926,_[_0x927c('0x18')](_0x542bb1)?JSON['stringify'](_0x542bb1):_0x542bb1);logger[_0x927c('0xc')](_0x927c('0xd'),_0xc97926);_0x2d826e['next']();}};}; \ 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 27e02ad..3c66ca3 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 _0x1db0=['stringify','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','length','error','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s'];(function(_0x5549d7,_0x26b12e){var _0x299932=function(_0x2f9d97){while(--_0x2f9d97){_0x5549d7['push'](_0x5549d7['shift']());}};_0x299932(++_0x26b12e);}(_0x1db0,0x13a));var _0x01db=function(_0x6e51f1,_0x11371a){_0x6e51f1=_0x6e51f1-0x0;var _0x141b4c=_0x1db0[_0x6e51f1];return _0x141b4c;};'use strict';var schema=require(_0x01db('0x0'));var _=require(_0x01db('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x01db('0x2')),'smsInteraction':require(_0x01db('0x3')),'mailInteraction':require(_0x01db('0x4')),'faxInteraction':require(_0x01db('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x829ee4,_0x439441,_0x1c2530,_0x353a13){return function(_0x34ffa6){try{var _0x50f29f={'tag':_0x439441[0x0]};var _0x3dff47=tag[_0x01db('0x0')](_0x50f29f,{'typecast':!![]});if(_0x3dff47[_0x01db('0x6')]){logger[_0x01db('0x7')]('[%s][TAG]\x20%s',_0x829ee4,_[_0x01db('0x8')](_0x3dff47,_0x01db('0x9'))[_0x01db('0xa')](',\x20'));logger['info'](_0x01db('0xb'),_0x829ee4);_0x34ffa6[_0x01db('0xc')]();}else{var _0xaf0786={'ids':[_0x439441[0x0]]};if(rpc[_0x353a13[_0x01db('0xd')]+_0x01db('0xe')]){rpc[_0x353a13['channel']+_0x01db('0xe')][_0x01db('0xf')](_0x353a13[_0x01db('0x10')]['id'],_0xaf0786)[_0x01db('0x11')](function(_0x3e4014){logger[_0x01db('0x12')](_0x01db('0x13'),_0x829ee4,_0x439441[0x1],_0x353a13[_0x01db('0xd')],_0x353a13['interaction']['id']);})[_0x01db('0x14')](function(_0x1e500a){logger[_0x01db('0x7')](_0x01db('0x15'),_0x829ee4,JSON[_0x01db('0x16')](_0x1e500a));logger[_0x01db('0x12')](_0x01db('0xb'),_0x829ee4);})['finally'](function(){_0x34ffa6['next']();});}}}catch(_0x45e96e){logger['error'](_0x01db('0x15'),_0x829ee4,_[_0x01db('0x17')](_0x45e96e)?JSON[_0x01db('0x16')](_0x45e96e):_0x45e96e);logger[_0x01db('0x12')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x829ee4);_0x34ffa6[_0x01db('0xc')]();}};}; \ No newline at end of file +var _0xdfaa=['channel','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','[%s][TAG]\x20%s','stringify','isObject','lodash','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction'];(function(_0x45f1a0,_0x2a9516){var _0x57503d=function(_0x4330ee){while(--_0x4330ee){_0x45f1a0['push'](_0x45f1a0['shift']());}};_0x57503d(++_0x2a9516);}(_0xdfaa,0x9f));var _0xadfa=function(_0x41ef54,_0x4f7dfe){_0x41ef54=_0x41ef54-0x0;var _0xc8bb62=_0xdfaa[_0x41ef54];return _0xc8bb62;};'use strict';var schema=require('validate');var _=require(_0xadfa('0x0'));var rpc={'chatInteraction':require(_0xadfa('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xadfa('0x2')),'faxInteraction':require(_0xadfa('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xadfa('0x4'))(_0xadfa('0x5'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xadfa('0x6')}});exports[_0xadfa('0x7')]=function(_0x2b6efe,_0x396351,_0x4761ee,_0xecfa37){return function(_0x4b1860){try{var _0x43dc43={'tag':_0x396351[0x0]};var _0x55a00f=tag[_0xadfa('0x8')](_0x43dc43,{'typecast':!![]});if(_0x55a00f[_0xadfa('0x9')]){logger['error']('[%s][TAG]\x20%s',_0x2b6efe,_['map'](_0x55a00f,_0xadfa('0xa'))[_0xadfa('0xb')](',\x20'));logger[_0xadfa('0xc')](_0xadfa('0xd'),_0x2b6efe);_0x4b1860[_0xadfa('0xe')]();}else{var _0x583327={'ids':[_0x396351[0x0]]};if(rpc[_0xecfa37['channel']+_0xadfa('0xf')]){rpc[_0xecfa37[_0xadfa('0x10')]+'Interaction']['addTags'](_0xecfa37[_0xadfa('0x11')]['id'],_0x583327)[_0xadfa('0x12')](function(_0x418c27){logger[_0xadfa('0xc')](_0xadfa('0x13'),_0x2b6efe,_0x396351[0x1],_0xecfa37[_0xadfa('0x10')],_0xecfa37['interaction']['id']);})[_0xadfa('0x14')](function(_0x122261){logger[_0xadfa('0x15')](_0xadfa('0x16'),_0x2b6efe,JSON[_0xadfa('0x17')](_0x122261));logger[_0xadfa('0xc')](_0xadfa('0xd'),_0x2b6efe);})['finally'](function(){_0x4b1860[_0xadfa('0xe')]();});}}}catch(_0x40a3f4){logger[_0xadfa('0x15')](_0xadfa('0x16'),_0x2b6efe,_[_0xadfa('0x18')](_0x40a3f4)?JSON[_0xadfa('0x17')](_0x40a3f4):_0x40a3f4);logger[_0xadfa('0xc')](_0xadfa('0xd'),_0x2b6efe);_0x4b1860[_0xadfa('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index d872e23..daa23a4 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6354=['utf8','POST','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','error','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','\x20-\x20','replace','?params=','urlOnRing','jsonrpc','2.0','login','push','params','stringify'];(function(_0x3a4437,_0x42420a){var _0x8406cc=function(_0x4f3cd1){while(--_0x4f3cd1){_0x3a4437['push'](_0x3a4437['shift']());}};_0x8406cc(++_0x42420a);}(_0x6354,0xcc));var _0x4635=function(_0x22a614,_0x3af6dc){_0x22a614=_0x22a614-0x0;var _0x232a32=_0x6354[_0x22a614];return _0x232a32;};'use strict';var rp=require('request-promise');var logger=require(_0x4635('0x0'))(_0x4635('0x1'));var _=require('lodash');var arr=[];exports['consequence']=function(_0x35f414,_0x26c7ad){return function(_0x7d7f9c){var _0x54cb94=_0x26c7ad[0xa];var _0x179bfb=_0x26c7ad[0xb];var _0x4b43f6=_0x26c7ad[0xc];var _0x49ec1d=_0x26c7ad[0xd];var _0x594979=_0x26c7ad[0xe];var _0x1a2f85=_0x26c7ad[0xf]['replace'](/\n/g,_0x4635('0x2'));var _0x39d057=_0x26c7ad[0x10][_0x4635('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x179bfb)){arr['push'](_0x179bfb);var _0x1ca31c=_0x26c7ad[0x3];var _0x22dcf5=_0x26c7ad[0x4];var _0x5c0ca3=_0x26c7ad[0x1];var _0x55b3e6=_0x26c7ad[0x0];var _0x409ddb={};_0x409ddb['urlOnAnswer']=_0x26c7ad[0x8]+_0x4635('0x4')+_0x4b43f6+'|'+_0x54cb94+'|'+_0x49ec1d+'|'+_0x179bfb+'|'+_0x594979;_0x409ddb[_0x4635('0x5')]=_0x26c7ad[0x7]+'?params='+_0x4b43f6+'|'+_0x54cb94+'|'+_0x49ec1d+'|'+_0x179bfb+'|'+_0x594979+'|'+_0x1a2f85+'|'+_0x39d057;_0x409ddb['title']=_0x26c7ad[0x9];var _0x5b6621={};_0x5b6621[_0x4635('0x6')]=_0x4635('0x7');_0x5b6621['method']=_0x4635('0x8');var _0x1b9899=[];_0x1b9899['push'](_0x26c7ad[0x2]);_0x1b9899['push'](_0x26c7ad[0x5]);_0x1b9899[_0x4635('0x9')](_0x26c7ad[0x6]);_0x5b6621[_0x4635('0xa')]=_0x1b9899;_0x5b6621['id']=0x1;var _0x1705c4=JSON[_0x4635('0xb')](_0x5b6621);var _0x19740f={'encoding':_0x4635('0xc'),'method':_0x4635('0xd'),'timeout':0x2710,'url':_0x1ca31c,'headers':{'Content-Type':'application/json-rpc'},'body':_0x1705c4};return rp(_0x19740f)[_0x4635('0xe')](function(_0x16da69){const _0x439d42=JSON['parse'](_0x16da69);if(!_0x439d42[_0x4635('0xf')][_0x4635('0x10')]){throw new Error(_0x4635('0x11'));}var _0x900468=_0x179bfb;var _0x590055=_0x4635('0x12')+_0x5c0ca3+'&serviceId='+_0x55b3e6+_0x4635('0x13')+_0x900468+_0x4635('0x14')+JSON[_0x4635('0xb')](_0x409ddb);var _0x80e2c4=_0x22dcf5+'?'+_0x590055;return rp(_0x80e2c4);})[_0x4635('0xe')](function(_0x3ec1ab){logger['info'](_0x4635('0x15'),_0x35f414,_0x3ec1ab);_0x7d7f9c['stop']();})['catch'](function(_0x18b1a8){logger[_0x4635('0x16')]('[%s][TVOX]\x20%s',_0x35f414,_[_0x4635('0x17')](_0x18b1a8)?JSON[_0x4635('0xb')](_0x18b1a8):_0x18b1a8);_0x7d7f9c[_0x4635('0x18')]();});}else{logger['info'](_0x4635('0x19'),_0x35f414);_0x7d7f9c[_0x4635('0x1a')]();}};}; \ No newline at end of file +var _0xf8ac=['urlOnRing','?params=','jsonrpc','method','params','stringify','utf8','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','info','stop','catch','error','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','consequence','replace','includes','push','urlOnAnswer'];(function(_0x416088,_0x20daff){var _0x4babe8=function(_0x156863){while(--_0x156863){_0x416088['push'](_0x416088['shift']());}};_0x4babe8(++_0x20daff);}(_0xf8ac,0xb6));var _0xcf8a=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0xf8ac[_0x5f4cd7];return _0x47c93f;};'use strict';var rp=require('request-promise');var logger=require(_0xcf8a('0x0'))(_0xcf8a('0x1'));var _=require('lodash');var arr=[];exports[_0xcf8a('0x2')]=function(_0x5ee7eb,_0x28f022){return function(_0x145547){var _0x59b4d3=_0x28f022[0xa];var _0x5590d7=_0x28f022[0xb];var _0x419af3=_0x28f022[0xc];var _0x539615=_0x28f022[0xd];var _0x514e6c=_0x28f022[0xe];var _0xe7cedc=_0x28f022[0xf][_0xcf8a('0x3')](/\n/g,'\x20-\x20');var _0x2d9057=_0x28f022[0x10]['replace'](/\n/g,'\x20');if(!arr[_0xcf8a('0x4')](_0x5590d7)){arr[_0xcf8a('0x5')](_0x5590d7);var _0x338e9f=_0x28f022[0x3];var _0x545bd0=_0x28f022[0x4];var _0x3bd5af=_0x28f022[0x1];var _0x238332=_0x28f022[0x0];var _0x16ee7f={};_0x16ee7f[_0xcf8a('0x6')]=_0x28f022[0x8]+'?params='+_0x419af3+'|'+_0x59b4d3+'|'+_0x539615+'|'+_0x5590d7+'|'+_0x514e6c;_0x16ee7f[_0xcf8a('0x7')]=_0x28f022[0x7]+_0xcf8a('0x8')+_0x419af3+'|'+_0x59b4d3+'|'+_0x539615+'|'+_0x5590d7+'|'+_0x514e6c+'|'+_0xe7cedc+'|'+_0x2d9057;_0x16ee7f['title']=_0x28f022[0x9];var _0x29a3f4={};_0x29a3f4[_0xcf8a('0x9')]='2.0';_0x29a3f4[_0xcf8a('0xa')]='login';var _0x47eabb=[];_0x47eabb[_0xcf8a('0x5')](_0x28f022[0x2]);_0x47eabb[_0xcf8a('0x5')](_0x28f022[0x5]);_0x47eabb[_0xcf8a('0x5')](_0x28f022[0x6]);_0x29a3f4[_0xcf8a('0xb')]=_0x47eabb;_0x29a3f4['id']=0x1;var _0x4f4e31=JSON[_0xcf8a('0xc')](_0x29a3f4);var _0x53c8aa={'encoding':_0xcf8a('0xd'),'method':'POST','timeout':0x2710,'url':_0x338e9f,'headers':{'Content-Type':'application/json-rpc'},'body':_0x4f4e31};return rp(_0x53c8aa)[_0xcf8a('0xe')](function(_0x37f3c8){const _0x13eb0b=JSON[_0xcf8a('0xf')](_0x37f3c8);if(!_0x13eb0b[_0xcf8a('0x10')][_0xcf8a('0x11')]){throw new Error(_0xcf8a('0x12'));}var _0x3b436f=_0x5590d7;var _0x2be3be=_0xcf8a('0x13')+_0x3bd5af+_0xcf8a('0x14')+_0x238332+'&sessionId='+_0x3b436f+'&data='+JSON[_0xcf8a('0xc')](_0x16ee7f);var _0x187c5c=_0x545bd0+'?'+_0x2be3be;return rp(_0x187c5c);})['then'](function(_0x145819){logger[_0xcf8a('0x15')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x5ee7eb,_0x145819);_0x145547[_0xcf8a('0x16')]();})[_0xcf8a('0x17')](function(_0x44472b){logger[_0xcf8a('0x18')]('[%s][TVOX]\x20%s',_0x5ee7eb,_['isObject'](_0x44472b)?JSON[_0xcf8a('0xc')](_0x44472b):_0x44472b);_0x145547[_0xcf8a('0x16')]();});}else{logger[_0xcf8a('0x15')](_0xcf8a('0x19'),_0x5ee7eb);_0x145547[_0xcf8a('0x1a')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index ba2cb5e..ad42df7 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 _0x9c44=['merge','body','account','list','exports','render'];(function(_0x3b5ac9,_0x56992c){var _0x38d75c=function(_0x572970){while(--_0x572970){_0x3b5ac9['push'](_0x3b5ac9['shift']());}};_0x38d75c(++_0x56992c);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x5b4740,_0xaba357){var _0x1e0fd9=function(_0x25fd01){while(--_0x25fd01){_0x5b4740['push'](_0x5b4740['shift']());}};_0x1e0fd9(++_0xaba357);}(_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 db025f0..f0468d0 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 _0x4efb=['push','slice','dialogflow','appdata','amazonlex','tvox','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','priority','info','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','UserId','catch','stack','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','smsQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','./applications/utils','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','map','Intervals','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','existsSync','join','app','.js','autoreply','split','mail'];(function(_0x861e3a,_0x55a39c){var _0x5f8cee=function(_0x1f49db){while(--_0x1f49db){_0x861e3a['push'](_0x861e3a['shift']());}};_0x5f8cee(++_0x55a39c);}(_0x4efb,0xfa));var _0xb4ef=function(_0x15d6cb,_0x22c1cf){_0x15d6cb=_0x15d6cb-0x0;var _0x4d3d95=_0x4efb[_0x15d6cb];return _0x4d3d95;};'use strict';var _=require('lodash');var util=require(_0xb4ef('0x0'));var path=require(_0xb4ef('0x1'));var fs=require('fs');var jayson=require(_0xb4ef('0x2'));var BPromise=require('bluebird');var utils=require(_0xb4ef('0x3'));var sUtils=require('./applications/strategy/util');var logger=require(_0xb4ef('0x4'))(_0xb4ef('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xb4ef('0x6')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xb4ef('0x7')),'faxQueueReport':require(_0xb4ef('0x8')),'whatsappQueueReport':require(_0xb4ef('0x9'))};var RuleEngine=require(_0xb4ef('0xa'));function getId(_0x863531,_0x4cbb88,_0x1a1a33){return util[_0xb4ef('0xb')](_0xb4ef('0xc'),_0x863531,_0x4cbb88||0x0,_0x1a1a33||0x0);}function getIntervals(_0x19d132,_0x7d4001){var _0xa976df=[];if(!_['isNil'](_0x7d4001[_0xb4ef('0xd')])&&!_['isNil'](_0x19d132[_0x7d4001[_0xb4ef('0xd')]])&&!_[_0xb4ef('0xe')](_0x19d132[_0x7d4001[_0xb4ef('0xd')]]['Intervals'])){_0xa976df=_[_0xb4ef('0xf')](_0x19d132[_0x7d4001[_0xb4ef('0xd')]][_0xb4ef('0x10')],_0xb4ef('0x11'));}else if(!_[_0xb4ef('0xe')](_0x7d4001[_0xb4ef('0x11')])){_0xa976df=[_0x7d4001['interval']];}return _0xa976df;}exports[_0xb4ef('0x12')]=function(_0x587c3a){_0x587c3a[_0xb4ef('0x13')]={};return new BPromise(function(_0xd98297,_0x2a9b25){var _0x231b8b={'Start':function(_0x1f68f1){var _0x31dd95=this;return new Promise(function(_0x187370,_0x4a20a6){if(_0x1f68f1){try{var _0x3c9671=[];var _0x6a401a=getId(_0x1f68f1[_0xb4ef('0x14')],_0x1f68f1[_0xb4ef('0x15')]?_0x1f68f1[_0xb4ef('0x15')]['id']:0x0,_0x1f68f1[_0xb4ef('0x16')]?_0x1f68f1['interaction']['id']:0x0);var _0x1d8bca=sUtils[_0xb4ef('0x17')](_0x587c3a,_0x1f68f1);if(_0x1f68f1[_0xb4ef('0x18')]||!_0x1d8bca&&_0x1f68f1[_0xb4ef('0x19')]&&_[_0xb4ef('0x1a')](_0x1f68f1[_0xb4ef('0x19')])&&_0x1f68f1[_0xb4ef('0x19')]['length']){for(var _0x311f00=0x0;_0x311f00<_0x1f68f1['applications'][_0xb4ef('0x1b')];_0x311f00+=0x1){var _0x3cf09e=_0x1f68f1[_0xb4ef('0x19')][_0x311f00];if(fs[_0xb4ef('0x1c')](path[_0xb4ef('0x1d')](__dirname,_0xb4ef('0x19'),_0x3cf09e[_0xb4ef('0x1e')]+_0xb4ef('0x1f')))){var _0xc146de=[];switch(_0x3cf09e[_0xb4ef('0x1e')]['toLowerCase']()){case _0xb4ef('0x20'):var _0x387583=_0x3cf09e['appdata'][_0xb4ef('0x21')](',');if(_0x1f68f1['channel']===_0xb4ef('0x22')){_0xc146de['push'](_0x387583[0x0]);_0xc146de[_0xb4ef('0x23')](_0x387583[0x1]);_0xc146de['push'](_0x387583[_0xb4ef('0x24')](0x2,_0x387583[_0xb4ef('0x1b')])['join'](','));}else{_0xc146de['push'](_0x387583[0x0]);_0xc146de[_0xb4ef('0x23')](_0x387583[_0xb4ef('0x24')](0x1,_0x387583[_0xb4ef('0x1b')])[_0xb4ef('0x1d')](','));}break;case _0xb4ef('0x25'):var _0x594747=_0x3cf09e[_0xb4ef('0x26')]['split'](',');_0xc146de[_0xb4ef('0x23')](_0x594747[0x0]);_0xc146de[_0xb4ef('0x23')](_0x594747[0x1]);_0xc146de['push'](_0x594747[_0xb4ef('0x24')](0x2,_0x594747[_0xb4ef('0x1b')])[_0xb4ef('0x1d')](','));break;case'dialogflowv2':var _0x55a5df=_0x3cf09e[_0xb4ef('0x26')][_0xb4ef('0x21')](',');_0xc146de[_0xb4ef('0x23')](_0x55a5df[0x0]);_0xc146de['push'](_0x55a5df[0x1]);_0xc146de[_0xb4ef('0x23')](_0x55a5df[0x2]);_0xc146de[_0xb4ef('0x23')](_0x55a5df[0x3]);_0xc146de[_0xb4ef('0x23')](_0x55a5df[_0xb4ef('0x24')](0x4,_0x55a5df['length'])[_0xb4ef('0x1d')](','));break;case _0xb4ef('0x27'):var _0x515634=_0x3cf09e[_0xb4ef('0x26')]['split'](',');_0xc146de[_0xb4ef('0x23')](_0x515634[0x0]);_0xc146de[_0xb4ef('0x23')](_0x515634[0x1]);_0xc146de[_0xb4ef('0x23')](_0x515634[0x2]);_0xc146de[_0xb4ef('0x23')](_0x515634[0x3]);_0xc146de[_0xb4ef('0x23')](_0x515634[_0xb4ef('0x24')](0x4,_0x515634['length'])[_0xb4ef('0x1d')](','));break;case _0xb4ef('0x15'):_0xc146de[_0xb4ef('0x23')](_0x3cf09e[_0xb4ef('0x26')]);break;case'tag':_0xc146de[_0xb4ef('0x23')](_0x3cf09e['TagId']);_0xc146de[_0xb4ef('0x23')](_0x3cf09e[_0xb4ef('0x26')]);break;case _0xb4ef('0x28'):var _0x582e98=utils[_0xb4ef('0x29')](_0x1f68f1[_0xb4ef('0x2a')][_0xb4ef('0x2b')],_0x1f68f1);var _0x88311f=_0x3cf09e['appdata'][_0xb4ef('0x21')](',');_0xc146de[_0xb4ef('0x23')](_0x88311f[0x0]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x1]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x2]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x3]);_0xc146de['push'](_0x88311f[0x4]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x5]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x6]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x7]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x8]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x9]);_0xc146de['push'](_0x88311f[0xa]);_0xc146de['push'](_0x1f68f1['interaction']['id']);_0xc146de[_0xb4ef('0x23')](_0x1f68f1['message']['id']);_0xc146de[_0xb4ef('0x23')](_0x3cf09e['ChatWebsiteId']);_0xc146de['push'](_0x1f68f1[_0xb4ef('0x16')][_0xb4ef('0x2c')]);_0xc146de[_0xb4ef('0x23')](_0x1f68f1[_0xb4ef('0x2d')][_0xb4ef('0x2d')]);_0xc146de['push'](_0x582e98);break;default:_0xc146de=_['isNil'](_0x3cf09e[_0xb4ef('0x26')])?[]:_0x3cf09e[_0xb4ef('0x26')][_0xb4ef('0x21')](',');}var _0x30d939={'id':util[_0xb4ef('0xb')](_0xb4ef('0x2e'),_0x6a401a,_0x3cf09e['id'],_0x3cf09e['app']),'condition':require(_0xb4ef('0x2f'))[_0xb4ef('0x30')](_0x6a401a,getIntervals(_0x587c3a['intervals'],_0x3cf09e),_0x587c3a),'consequence':require('./applications/'+_0x3cf09e[_0xb4ef('0x1e')])['consequence'](_0x6a401a,_0xc146de,_0x587c3a,_0x1f68f1),'p':_0x3cf09e[_0xb4ef('0x31')]||0x0};logger[_0xb4ef('0x32')]('Push\x20new\x20rule',_0x30d939['id'],_0xb4ef('0x33'),getIntervals(_0x587c3a['intervals'],_0x3cf09e)[_0xb4ef('0x1d')](_0xb4ef('0x34')));_0x3c9671[_0xb4ef('0x23')](_0x30d939);}else{logger['error'](_0xb4ef('0x35'),path[_0xb4ef('0x1d')](__dirname,'applications',_0x3cf09e['app']+_0xb4ef('0x1f')));}}_0x587c3a[_0xb4ef('0x13')][_0x6a401a]=new RuleEngine(_0x3c9671);_0x587c3a[_0xb4ef('0x13')][_0x6a401a][_0xb4ef('0x36')](_0x1f68f1,function(_0x3ad025){logger[_0xb4ef('0x32')](_0xb4ef('0x37'),JSON[_0xb4ef('0x38')](_0x3ad025[_0xb4ef('0x39')]));if(_0x587c3a[_0xb4ef('0x13')][_0x6a401a]){_0x587c3a['rules'][_0x6a401a][_0xb4ef('0x3a')]('complete');}});return _0x187370({'code':0xc8,'message':_0x1f68f1});}else{if(_0x1d8bca){logger['info'](util['format']('Skipped\x20routing\x20for\x20%s',_0x6a401a));}else{logger[_0xb4ef('0x32')](_0xb4ef('0x3b'));}return _0x187370({'code':0xc8,'message':_0x1f68f1});}}catch(_0xec9f35){logger[_0xb4ef('0x3c')](_0xec9f35['stack']);return _0x4a20a6(_0x31dd95[_0xb4ef('0x3c')](0x1f4,_0xec9f35));}}return _0x4a20a6(_0xb4ef('0x3d'));});},'AcceptMessage':function(_0xb31437){var _0x30f289=this;return new Promise(function(_0x4c59f1,_0x5e7dab){if(_0xb31437['agent']&&_0xb31437[_0xb4ef('0x3e')]['id']){if(_0x587c3a['agents'][_0xb31437[_0xb4ef('0x3e')]['id']]){_0x587c3a['agents'][_0xb31437[_0xb4ef('0x3e')]['id']]['busy']=![];_0x587c3a[_0xb4ef('0x3f')][_0xb31437['agent']['id']][_0xb4ef('0x40')]=undefined;}}if(_0xb31437['message']&&_0xb31437['message']['id']){try{var _0x239454=getId(_0xb31437['channel'],_0xb31437[_0xb4ef('0x15')]?_0xb31437['message']['id']:0x0,_0xb31437[_0xb4ef('0x16')]?_0xb31437[_0xb4ef('0x16')]['id']:0x0);if(_0x587c3a[_0xb4ef('0x13')][_0x239454]){_0x587c3a['rules'][_0x239454][_0xb4ef('0x3a')](_0xb4ef('0x41'));if(rpc[_0xb31437[_0xb4ef('0x14')]+_0xb4ef('0x42')]){rpc[_0xb31437['channel']+_0xb4ef('0x42')]['update'](_0x239454,{'UserId':_0xb31437['message'][_0xb4ef('0x43')]})[_0xb4ef('0x44')](function(){logger[_0xb4ef('0x3c')]('error\x20update\x20queue\x20report');});}}return _0x4c59f1({'code':0xc8,'message':_0xb31437});}catch(_0xd5b1d1){logger[_0xb4ef('0x3c')](_0xd5b1d1[_0xb4ef('0x45')]);return _0x5e7dab(_0x30f289[_0xb4ef('0x3c')](0x1f4,_0xd5b1d1));}}logger[_0xb4ef('0x3c')]('message\x20is\x20empty');return _0x5e7dab(_0x30f289['error'](0x1f4,_0xb4ef('0x46')));});},'RejectMessage':function(_0x5369e0){var _0x27e278=this;return new Promise(function(_0x3e7696,_0x1b366a){if(_0x5369e0['agent']&&_0x5369e0[_0xb4ef('0x3e')]['id']){try{if(_0x587c3a[_0xb4ef('0x3f')][_0x5369e0['agent']['id']]){_0x587c3a[_0xb4ef('0x3f')][_0x5369e0['agent']['id']][_0xb4ef('0x47')]=![];_0x587c3a['agents'][_0x5369e0[_0xb4ef('0x3e')]['id']][_0xb4ef('0x40')]=undefined;}return _0x3e7696({'code':0xc8,'message':_0x5369e0});}catch(_0x3cf7e5){logger['error'](_0x3cf7e5[_0xb4ef('0x45')]);return _0x1b366a(_0x27e278[_0xb4ef('0x3c')](0x1f4,_0x3cf7e5));}}logger[_0xb4ef('0x3c')](_0xb4ef('0x46'));return _0x1b366a(_0x27e278[_0xb4ef('0x3c')](0x1f4,_0xb4ef('0x46')));});},'AbandonInteraction':function(_0x56ab6d){var _0x8e9772=this;return new Promise(function(_0x507d7c,_0x38db2a){if(_0x56ab6d[_0xb4ef('0x14')]&&_0x56ab6d[_0xb4ef('0x16')]&&_0x56ab6d[_0xb4ef('0x16')]['id']){try{var _0x1978ab=getId(_0x56ab6d[_0xb4ef('0x14')],_0x56ab6d[_0xb4ef('0x15')]?_0x56ab6d[_0xb4ef('0x15')]['id']:0x0,_0x56ab6d[_0xb4ef('0x16')]?_0x56ab6d[_0xb4ef('0x16')]['id']:0x0);if(_0x587c3a[_0xb4ef('0x13')][_0x1978ab]){_0x587c3a[_0xb4ef('0x13')][_0x1978ab][_0xb4ef('0x3a')](_0xb4ef('0x41'));}return _0x507d7c({'code':0xc8,'message':_0x56ab6d});}catch(_0xfaf43c){logger[_0xb4ef('0x3c')](_0xfaf43c['stack']);return _0x38db2a(_0x8e9772[_0xb4ef('0x3c')](0x1f4,_0xfaf43c));}}logger['error'](_0xb4ef('0x46'));return _0x38db2a(_0x8e9772[_0xb4ef('0x3c')](0x1f4,_0xb4ef('0x46')));});},'AgentCapacity':function(_0x22c73b){var _0x5b3f81=this;return new Promise(function(_0x2a2718,_0x31e8e6){if(_0x587c3a[_0xb4ef('0x3f')][_0xb4ef('0x48')](_0x22c73b['id'])){for(var _0x30d9f0 in _0x22c73b[_0xb4ef('0x49')]){if(_0x22c73b[_0xb4ef('0x49')]['hasOwnProperty'](_0x30d9f0)){if(_0x587c3a[_0xb4ef('0x3f')][_0x22c73b['id']][_0xb4ef('0x48')](_0x30d9f0+_0xb4ef('0x4a'))){_0x587c3a[_0xb4ef('0x3f')][_0x22c73b['id']][_0x30d9f0+'CurrentCapacity']=parseInt(_0x22c73b[_0xb4ef('0x49')][_0x30d9f0],0xa);}}}_0x587c3a[_0xb4ef('0x3f')][_0x22c73b['id']][_0xb4ef('0x4b')]();return _0x2a2718({'code':0xc8,'message':_0x587c3a['agents'][_0x22c73b['id']]});}else{return _0x31e8e6(_0x5b3f81['error'](0x1f4,_0xb4ef('0x4c')));}});},'Agents':function(_0x7a7693){return new Promise(function(_0x313b10){var _0x1582b1=_['values'](_0x587c3a[_0xb4ef('0x3f')]);if(_0x7a7693&&_0x7a7693['id']){var _0x28217d=_['find'](_0x1582b1,function(_0x172c33){return _0x172c33['id']===_0x7a7693['id'];});_0x313b10(_0x28217d);}else{_0x313b10({'count':_0x1582b1[_0xb4ef('0x1b')],'rows':_0x1582b1});}});},'ChatQueues':function(){return new Promise(function(_0x53f5ef){var _0x16dc8c=[];for(var _0x32cf02 in _0x587c3a[_0xb4ef('0x4d')]){if(_0x587c3a[_0xb4ef('0x4d')][_0xb4ef('0x48')](_0x32cf02)){var _0x1f6f66=_0x587c3a[_0xb4ef('0x4d')][_0x32cf02];var _0x239815={'id':_0x1f6f66['id'],'available':_0x1f6f66[_0xb4ef('0x4e')],'loggedIn':_0x1f6f66[_0xb4ef('0x4f')],'name':_0x1f6f66[_0xb4ef('0x50')],'paused':_0x1f6f66[_0xb4ef('0x51')],'waiting':_0x1f6f66[_0xb4ef('0x52')]};_0x16dc8c[_0xb4ef('0x23')](_0x239815);}}_0x53f5ef({'count':_0x16dc8c[_0xb4ef('0x1b')],'rows':_0x16dc8c});});},'MailQueues':function(){return new Promise(function(_0x323a8e){var _0x48abfb=[];for(var _0x46b321 in _0x587c3a[_0xb4ef('0x53')]){if(_0x587c3a['mailQueues']['hasOwnProperty'](_0x46b321)){var _0x3c5270=_0x587c3a[_0xb4ef('0x53')][_0x46b321];var _0x3bf26a={'id':_0x3c5270['id'],'available':_0x3c5270[_0xb4ef('0x4e')],'loggedIn':_0x3c5270[_0xb4ef('0x4f')],'name':_0x3c5270[_0xb4ef('0x50')],'paused':_0x3c5270[_0xb4ef('0x51')],'waiting':_0x3c5270['waiting']};_0x48abfb[_0xb4ef('0x23')](_0x3bf26a);}}_0x323a8e({'count':_0x48abfb[_0xb4ef('0x1b')],'rows':_0x48abfb});});},'OpenchannelQueues':function(){return new Promise(function(_0x1183e3){var _0x36bb80=[];for(var _0x47a982 in _0x587c3a[_0xb4ef('0x54')]){if(_0x587c3a[_0xb4ef('0x54')][_0xb4ef('0x48')](_0x47a982)){var _0x44ef98=_0x587c3a[_0xb4ef('0x54')][_0x47a982];var _0x3b23cd={'id':_0x44ef98['id'],'available':_0x44ef98['available'],'loggedIn':_0x44ef98[_0xb4ef('0x4f')],'name':_0x44ef98[_0xb4ef('0x50')],'paused':_0x44ef98['paused'],'waiting':_0x44ef98[_0xb4ef('0x52')]};_0x36bb80['push'](_0x3b23cd);}}_0x1183e3({'count':_0x36bb80[_0xb4ef('0x1b')],'rows':_0x36bb80});});},'SmsQueues':function(){return new Promise(function(_0x53305d){var _0x3a2d32=[];for(var _0x136ca6 in _0x587c3a[_0xb4ef('0x55')]){if(_0x587c3a[_0xb4ef('0x55')][_0xb4ef('0x48')](_0x136ca6)){var _0x57a953=_0x587c3a[_0xb4ef('0x55')][_0x136ca6];var _0x102902={'id':_0x57a953['id'],'available':_0x57a953[_0xb4ef('0x4e')],'loggedIn':_0x57a953['loggedIn'],'name':_0x57a953[_0xb4ef('0x50')],'paused':_0x57a953['paused'],'waiting':_0x57a953[_0xb4ef('0x52')]};_0x3a2d32['push'](_0x102902);}}_0x53305d({'count':_0x3a2d32['length'],'rows':_0x3a2d32});});},'FaxQueues':function(){return new Promise(function(_0x529239){var _0x33f394=[];for(var _0x4e5895 in _0x587c3a['faxQueues']){if(_0x587c3a[_0xb4ef('0x56')][_0xb4ef('0x48')](_0x4e5895)){var _0x4a6587=_0x587c3a['faxQueues'][_0x4e5895];var _0x1b13e8={'id':_0x4a6587['id'],'available':_0x4a6587[_0xb4ef('0x4e')],'loggedIn':_0x4a6587[_0xb4ef('0x4f')],'name':_0x4a6587['name'],'paused':_0x4a6587['paused'],'waiting':_0x4a6587[_0xb4ef('0x52')]};_0x33f394[_0xb4ef('0x23')](_0x1b13e8);}}_0x529239({'count':_0x33f394['length'],'rows':_0x33f394});});},'WhatsappQueues':function(){return new Promise(function(_0x57c636){var _0x49889a=[];for(var _0x390f6d in _0x587c3a[_0xb4ef('0x57')]){if(_0x587c3a[_0xb4ef('0x57')][_0xb4ef('0x48')](_0x390f6d)){var _0x239f3d=_0x587c3a[_0xb4ef('0x57')][_0x390f6d];var _0x1489d4={'id':_0x239f3d['id'],'available':_0x239f3d[_0xb4ef('0x4e')],'loggedIn':_0x239f3d[_0xb4ef('0x4f')],'name':_0x239f3d[_0xb4ef('0x50')],'paused':_0x239f3d[_0xb4ef('0x51')],'waiting':_0x239f3d[_0xb4ef('0x52')]};_0x49889a[_0xb4ef('0x23')](_0x1489d4);}}_0x57c636({'count':_0x49889a[_0xb4ef('0x1b')],'rows':_0x49889a});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x35c743){var _0x2bf72e=_[_0xb4ef('0x58')](_0x587c3a['chatQueuesWaitingInteractions']);_0x35c743({'count':_0x2bf72e[_0xb4ef('0x1b')],'rows':_0x2bf72e});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4b82ea){var _0x12b04e=_[_0xb4ef('0x58')](_0x587c3a['mailQueuesWaitingInteractions']);_0x4b82ea({'count':_0x12b04e[_0xb4ef('0x1b')],'rows':_0x12b04e});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x54a991){var _0x133fcb=_[_0xb4ef('0x58')](_0x587c3a['openchannelQueuesWaitingInteractions']);_0x54a991({'count':_0x133fcb[_0xb4ef('0x1b')],'rows':_0x133fcb});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3e3b4a){var _0x150382=_[_0xb4ef('0x58')](_0x587c3a[_0xb4ef('0x59')]);_0x3e3b4a({'count':_0x150382[_0xb4ef('0x1b')],'rows':_0x150382});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3611e3){var _0x162b90=_['values'](_0x587c3a['faxQueuesWaitingInteractions']);_0x3611e3({'count':_0x162b90['length'],'rows':_0x162b90});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x288ee7){var _0x8edb4c=_['values'](_0x587c3a['whatsappQueuesWaitingInteractions']);_0x288ee7({'count':_0x8edb4c[_0xb4ef('0x1b')],'rows':_0x8edb4c});});}};var _0xa685d9=jayson['server'](_0x231b8b)[_0xb4ef('0x5a')]();_0xa685d9['on']('error',function(_0x101f41){logger[_0xb4ef('0x3c')](JSON['stringify'](_0x101f41));return _0x2a9b25(_0x101f41);});_0xa685d9[_0xb4ef('0x12')](0x232c,_0xb4ef('0x5b'),function(){console[_0xb4ef('0x5c')](_0xb4ef('0x5d'),0x232c);return _0xd98297(_0xb4ef('0x5e')+0x232c);});});}; \ No newline at end of file +var _0x0b2c=['IntervalId','Intervals','map','interval','listen','channel','message','interaction','checkWaitingNotifications','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','appdata','tag','TagId','getMustacheRender','account','notificationTemplate','ContactId','body','condition','./applications/','consequence','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','info','emit','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','available','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0x0b2c,0xb6));var _0xc0b2=function(_0xf8dcb6,_0x1a15cb){_0xf8dcb6=_0xf8dcb6-0x0;var _0x141251=_0x0b2c[_0xf8dcb6];return _0x141251;};'use strict';var _=require(_0xc0b2('0x0'));var util=require('util');var path=require(_0xc0b2('0x1'));var fs=require('fs');var jayson=require(_0xc0b2('0x2'));var BPromise=require(_0xc0b2('0x3'));var utils=require(_0xc0b2('0x4'));var sUtils=require(_0xc0b2('0x5'));var logger=require(_0xc0b2('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0xc0b2('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xc0b2('0x8')),'smsQueueReport':require(_0xc0b2('0x9')),'faxQueueReport':require(_0xc0b2('0xa')),'whatsappQueueReport':require(_0xc0b2('0xb'))};var RuleEngine=require(_0xc0b2('0xc'));function getId(_0xb76295,_0x123ceb,_0x3004c4){return util[_0xc0b2('0xd')](_0xc0b2('0xe'),_0xb76295,_0x123ceb||0x0,_0x3004c4||0x0);}function getIntervals(_0x4e0a2f,_0x57b802){var _0x324323=[];if(!_[_0xc0b2('0xf')](_0x57b802[_0xc0b2('0x10')])&&!_[_0xc0b2('0xf')](_0x4e0a2f[_0x57b802['IntervalId']])&&!_[_0xc0b2('0xf')](_0x4e0a2f[_0x57b802[_0xc0b2('0x10')]][_0xc0b2('0x11')])){_0x324323=_[_0xc0b2('0x12')](_0x4e0a2f[_0x57b802[_0xc0b2('0x10')]][_0xc0b2('0x11')],_0xc0b2('0x13'));}else if(!_[_0xc0b2('0xf')](_0x57b802[_0xc0b2('0x13')])){_0x324323=[_0x57b802[_0xc0b2('0x13')]];}return _0x324323;}exports[_0xc0b2('0x14')]=function(_0x440c1f){_0x440c1f['rules']={};return new BPromise(function(_0x1ae155,_0xa3e99b){var _0x3b7a13={'Start':function(_0x38b787){var _0x174326=this;return new Promise(function(_0x2c47bb,_0x70a694){if(_0x38b787){try{var _0x2db55b=[];var _0x5bda9b=getId(_0x38b787[_0xc0b2('0x15')],_0x38b787[_0xc0b2('0x16')]?_0x38b787[_0xc0b2('0x16')]['id']:0x0,_0x38b787[_0xc0b2('0x17')]?_0x38b787[_0xc0b2('0x17')]['id']:0x0);var _0x3630dd=sUtils[_0xc0b2('0x18')](_0x440c1f,_0x38b787);if(!_0x3630dd&&_0x38b787[_0xc0b2('0x19')]&&_[_0xc0b2('0x1a')](_0x38b787[_0xc0b2('0x19')])&&_0x38b787[_0xc0b2('0x19')][_0xc0b2('0x1b')]){for(var _0x5ae500=0x0;_0x5ae500<_0x38b787[_0xc0b2('0x19')][_0xc0b2('0x1b')];_0x5ae500+=0x1){var _0x5a5fba=_0x38b787['applications'][_0x5ae500];if(fs[_0xc0b2('0x1c')](path[_0xc0b2('0x1d')](__dirname,'applications',_0x5a5fba[_0xc0b2('0x1e')]+_0xc0b2('0x1f')))){var _0x4a51d8=[];switch(_0x5a5fba['app'][_0xc0b2('0x20')]()){case _0xc0b2('0x21'):var _0x59f7d7=_0x5a5fba['appdata'][_0xc0b2('0x22')](',');if(_0x38b787[_0xc0b2('0x15')]===_0xc0b2('0x23')){_0x4a51d8[_0xc0b2('0x24')](_0x59f7d7[0x0]);_0x4a51d8[_0xc0b2('0x24')](_0x59f7d7[0x1]);_0x4a51d8[_0xc0b2('0x24')](_0x59f7d7[_0xc0b2('0x25')](0x2,_0x59f7d7['length'])['join'](','));}else{_0x4a51d8[_0xc0b2('0x24')](_0x59f7d7[0x0]);_0x4a51d8[_0xc0b2('0x24')](_0x59f7d7[_0xc0b2('0x25')](0x1,_0x59f7d7[_0xc0b2('0x1b')])['join'](','));}break;case _0xc0b2('0x26'):var _0x96100b=_0x5a5fba['appdata'][_0xc0b2('0x22')](',');_0x4a51d8['push'](_0x96100b[0x0]);_0x4a51d8[_0xc0b2('0x24')](_0x96100b[0x1]);_0x4a51d8['push'](_0x96100b[_0xc0b2('0x25')](0x2,_0x96100b[_0xc0b2('0x1b')])[_0xc0b2('0x1d')](','));break;case _0xc0b2('0x27'):var _0x26badc=_0x5a5fba['appdata'][_0xc0b2('0x22')](',');_0x4a51d8[_0xc0b2('0x24')](_0x26badc[0x0]);_0x4a51d8[_0xc0b2('0x24')](_0x26badc[0x1]);_0x4a51d8[_0xc0b2('0x24')](_0x26badc[0x2]);_0x4a51d8[_0xc0b2('0x24')](_0x26badc[0x3]);_0x4a51d8['push'](_0x26badc[_0xc0b2('0x25')](0x4,_0x26badc[_0xc0b2('0x1b')])[_0xc0b2('0x1d')](','));break;case _0xc0b2('0x28'):var _0x2e9360=_0x5a5fba[_0xc0b2('0x29')][_0xc0b2('0x22')](',');_0x4a51d8[_0xc0b2('0x24')](_0x2e9360[0x0]);_0x4a51d8[_0xc0b2('0x24')](_0x2e9360[0x1]);_0x4a51d8[_0xc0b2('0x24')](_0x2e9360[0x2]);_0x4a51d8[_0xc0b2('0x24')](_0x2e9360[0x3]);_0x4a51d8[_0xc0b2('0x24')](_0x2e9360[_0xc0b2('0x25')](0x4,_0x2e9360[_0xc0b2('0x1b')])[_0xc0b2('0x1d')](','));break;case _0xc0b2('0x16'):_0x4a51d8[_0xc0b2('0x24')](_0x5a5fba[_0xc0b2('0x29')]);break;case _0xc0b2('0x2a'):_0x4a51d8['push'](_0x5a5fba[_0xc0b2('0x2b')]);_0x4a51d8[_0xc0b2('0x24')](_0x5a5fba[_0xc0b2('0x29')]);break;case'tvox':var _0x31d244=utils[_0xc0b2('0x2c')](_0x38b787[_0xc0b2('0x2d')][_0xc0b2('0x2e')],_0x38b787);var _0x2f2946=_0x5a5fba[_0xc0b2('0x29')][_0xc0b2('0x22')](',');_0x4a51d8[_0xc0b2('0x24')](_0x2f2946[0x0]);_0x4a51d8[_0xc0b2('0x24')](_0x2f2946[0x1]);_0x4a51d8[_0xc0b2('0x24')](_0x2f2946[0x2]);_0x4a51d8['push'](_0x2f2946[0x3]);_0x4a51d8['push'](_0x2f2946[0x4]);_0x4a51d8[_0xc0b2('0x24')](_0x2f2946[0x5]);_0x4a51d8['push'](_0x2f2946[0x6]);_0x4a51d8[_0xc0b2('0x24')](_0x2f2946[0x7]);_0x4a51d8[_0xc0b2('0x24')](_0x2f2946[0x8]);_0x4a51d8['push'](_0x2f2946[0x9]);_0x4a51d8[_0xc0b2('0x24')](_0x2f2946[0xa]);_0x4a51d8['push'](_0x38b787['interaction']['id']);_0x4a51d8[_0xc0b2('0x24')](_0x38b787[_0xc0b2('0x16')]['id']);_0x4a51d8[_0xc0b2('0x24')](_0x5a5fba['ChatWebsiteId']);_0x4a51d8['push'](_0x38b787[_0xc0b2('0x17')][_0xc0b2('0x2f')]);_0x4a51d8[_0xc0b2('0x24')](_0x38b787[_0xc0b2('0x30')][_0xc0b2('0x30')]);_0x4a51d8[_0xc0b2('0x24')](_0x31d244);break;default:_0x4a51d8=_['isNil'](_0x5a5fba[_0xc0b2('0x29')])?[]:_0x5a5fba[_0xc0b2('0x29')][_0xc0b2('0x22')](',');}var _0x4dcb91={'id':util[_0xc0b2('0xd')]('%s:%s:%s',_0x5bda9b,_0x5a5fba['id'],_0x5a5fba['app']),'condition':require('./interval')[_0xc0b2('0x31')](_0x5bda9b,getIntervals(_0x440c1f['intervals'],_0x5a5fba),_0x440c1f),'consequence':require(_0xc0b2('0x32')+_0x5a5fba['app'])[_0xc0b2('0x33')](_0x5bda9b,_0x4a51d8,_0x440c1f,_0x38b787),'p':_0x5a5fba['priority']||0x0};logger['info'](_0xc0b2('0x34'),_0x4dcb91['id'],_0xc0b2('0x35'),getIntervals(_0x440c1f['intervals'],_0x5a5fba)['join'](_0xc0b2('0x36')));_0x2db55b[_0xc0b2('0x24')](_0x4dcb91);}else{logger['error'](_0xc0b2('0x37'),path[_0xc0b2('0x1d')](__dirname,_0xc0b2('0x19'),_0x5a5fba[_0xc0b2('0x1e')]+_0xc0b2('0x1f')));}}_0x440c1f[_0xc0b2('0x38')][_0x5bda9b]=new RuleEngine(_0x2db55b);_0x440c1f[_0xc0b2('0x38')][_0x5bda9b][_0xc0b2('0x39')](_0x38b787,function(_0xc371d6){logger[_0xc0b2('0x3a')]('Applications\x20executed',JSON['stringify'](_0xc371d6['matchPath']));if(_0x440c1f[_0xc0b2('0x38')][_0x5bda9b]){_0x440c1f[_0xc0b2('0x38')][_0x5bda9b][_0xc0b2('0x3b')]('complete');}});return _0x2c47bb({'code':0xc8,'message':_0x38b787});}else{if(_0x3630dd){logger[_0xc0b2('0x3a')](util[_0xc0b2('0xd')](_0xc0b2('0x3c'),_0x5bda9b));}else{logger[_0xc0b2('0x3a')](_0xc0b2('0x3d'));}return _0x2c47bb({'code':0xc8,'message':_0x38b787});}}catch(_0x59c894){logger[_0xc0b2('0x3e')](_0x59c894[_0xc0b2('0x3f')]);return _0x70a694(_0x174326[_0xc0b2('0x3e')](0x1f4,_0x59c894));}}return _0x70a694(_0xc0b2('0x40'));});},'AcceptMessage':function(_0x2d2990){var _0x15f931=this;return new Promise(function(_0x20da13,_0x4db756){if(_0x2d2990['agent']&&_0x2d2990[_0xc0b2('0x41')]['id']){if(_0x440c1f[_0xc0b2('0x42')][_0x2d2990[_0xc0b2('0x41')]['id']]){_0x440c1f[_0xc0b2('0x42')][_0x2d2990[_0xc0b2('0x41')]['id']]['busy']=![];_0x440c1f[_0xc0b2('0x42')][_0x2d2990[_0xc0b2('0x41')]['id']][_0xc0b2('0x43')]=undefined;}}if(_0x2d2990['message']&&_0x2d2990[_0xc0b2('0x16')]['id']){try{var _0x459929=getId(_0x2d2990[_0xc0b2('0x15')],_0x2d2990['message']?_0x2d2990[_0xc0b2('0x16')]['id']:0x0,_0x2d2990[_0xc0b2('0x17')]?_0x2d2990[_0xc0b2('0x17')]['id']:0x0);if(_0x440c1f['rules'][_0x459929]){_0x440c1f[_0xc0b2('0x38')][_0x459929][_0xc0b2('0x3b')](_0xc0b2('0x44'));if(rpc[_0x2d2990['channel']+'QueueReport']){rpc[_0x2d2990[_0xc0b2('0x15')]+_0xc0b2('0x45')][_0xc0b2('0x46')](_0x459929,{'UserId':_0x2d2990['message'][_0xc0b2('0x47')]})['catch'](function(){logger['error'](_0xc0b2('0x48'));});}}return _0x20da13({'code':0xc8,'message':_0x2d2990});}catch(_0x46a3ad){logger[_0xc0b2('0x3e')](_0x46a3ad[_0xc0b2('0x3f')]);return _0x4db756(_0x15f931[_0xc0b2('0x3e')](0x1f4,_0x46a3ad));}}logger['error'](_0xc0b2('0x49'));return _0x4db756(_0x15f931['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x3ac5a0){var _0x1e4f4f=this;return new Promise(function(_0x56ecd1,_0x542d7a){if(_0x3ac5a0[_0xc0b2('0x41')]&&_0x3ac5a0[_0xc0b2('0x41')]['id']){try{if(_0x440c1f['agents'][_0x3ac5a0[_0xc0b2('0x41')]['id']]){_0x440c1f[_0xc0b2('0x42')][_0x3ac5a0[_0xc0b2('0x41')]['id']]['busy']=![];_0x440c1f[_0xc0b2('0x42')][_0x3ac5a0[_0xc0b2('0x41')]['id']]['busyQueue']=undefined;}return _0x56ecd1({'code':0xc8,'message':_0x3ac5a0});}catch(_0x4a376e){logger[_0xc0b2('0x3e')](_0x4a376e['stack']);return _0x542d7a(_0x1e4f4f['error'](0x1f4,_0x4a376e));}}logger[_0xc0b2('0x3e')]('message\x20is\x20empty');return _0x542d7a(_0x1e4f4f[_0xc0b2('0x3e')](0x1f4,_0xc0b2('0x49')));});},'AbandonInteraction':function(_0x1ae727){var _0x3d8e23=this;return new Promise(function(_0x570b0b,_0x30727e){if(_0x1ae727[_0xc0b2('0x15')]&&_0x1ae727['interaction']&&_0x1ae727[_0xc0b2('0x17')]['id']){try{var _0x57de60=getId(_0x1ae727[_0xc0b2('0x15')],_0x1ae727[_0xc0b2('0x16')]?_0x1ae727[_0xc0b2('0x16')]['id']:0x0,_0x1ae727[_0xc0b2('0x17')]?_0x1ae727['interaction']['id']:0x0);if(_0x440c1f[_0xc0b2('0x38')][_0x57de60]){_0x440c1f['rules'][_0x57de60][_0xc0b2('0x3b')](_0xc0b2('0x44'));}return _0x570b0b({'code':0xc8,'message':_0x1ae727});}catch(_0x1a5138){logger['error'](_0x1a5138[_0xc0b2('0x3f')]);return _0x30727e(_0x3d8e23[_0xc0b2('0x3e')](0x1f4,_0x1a5138));}}logger[_0xc0b2('0x3e')](_0xc0b2('0x49'));return _0x30727e(_0x3d8e23[_0xc0b2('0x3e')](0x1f4,_0xc0b2('0x49')));});},'AgentCapacity':function(_0x214607){var _0x7e2068=this;return new Promise(function(_0x3f840d,_0x31c83f){if(_0x440c1f[_0xc0b2('0x42')]['hasOwnProperty'](_0x214607['id'])){for(var _0x54fb7a in _0x214607[_0xc0b2('0x4a')]){if(_0x214607[_0xc0b2('0x4a')][_0xc0b2('0x4b')](_0x54fb7a)){if(_0x440c1f[_0xc0b2('0x42')][_0x214607['id']][_0xc0b2('0x4b')](_0x54fb7a+_0xc0b2('0x4c'))){_0x440c1f['agents'][_0x214607['id']][_0x54fb7a+_0xc0b2('0x4c')]=parseInt(_0x214607[_0xc0b2('0x4a')][_0x54fb7a],0xa);}}}_0x440c1f['agents'][_0x214607['id']][_0xc0b2('0x4d')]();return _0x3f840d({'code':0xc8,'message':_0x440c1f['agents'][_0x214607['id']]});}else{return _0x31c83f(_0x7e2068[_0xc0b2('0x3e')](0x1f4,_0xc0b2('0x4e')));}});},'Agents':function(_0x59826b){return new Promise(function(_0x5dcebf){var _0x1af124=_[_0xc0b2('0x4f')](_0x440c1f[_0xc0b2('0x42')]);if(_0x59826b&&_0x59826b['id']){var _0x50e3f4=_[_0xc0b2('0x50')](_0x1af124,function(_0x127027){return _0x127027['id']===_0x59826b['id'];});_0x5dcebf(_0x50e3f4);}else{_0x5dcebf({'count':_0x1af124[_0xc0b2('0x1b')],'rows':_0x1af124});}});},'ChatQueues':function(){return new Promise(function(_0x248e33){var _0x2a7519=[];for(var _0x445f78 in _0x440c1f[_0xc0b2('0x51')]){if(_0x440c1f[_0xc0b2('0x51')][_0xc0b2('0x4b')](_0x445f78)){var _0x1851b=_0x440c1f[_0xc0b2('0x51')][_0x445f78];var _0x33c907={'id':_0x1851b['id'],'available':_0x1851b['available'],'loggedIn':_0x1851b[_0xc0b2('0x52')],'name':_0x1851b[_0xc0b2('0x53')],'paused':_0x1851b[_0xc0b2('0x54')],'waiting':_0x1851b[_0xc0b2('0x55')]};_0x2a7519[_0xc0b2('0x24')](_0x33c907);}}_0x248e33({'count':_0x2a7519[_0xc0b2('0x1b')],'rows':_0x2a7519});});},'MailQueues':function(){return new Promise(function(_0x1b71e9){var _0x2738da=[];for(var _0x2490e6 in _0x440c1f[_0xc0b2('0x56')]){if(_0x440c1f[_0xc0b2('0x56')][_0xc0b2('0x4b')](_0x2490e6)){var _0x1525a0=_0x440c1f[_0xc0b2('0x56')][_0x2490e6];var _0x1d83ba={'id':_0x1525a0['id'],'available':_0x1525a0['available'],'loggedIn':_0x1525a0[_0xc0b2('0x52')],'name':_0x1525a0[_0xc0b2('0x53')],'paused':_0x1525a0[_0xc0b2('0x54')],'waiting':_0x1525a0['waiting']};_0x2738da[_0xc0b2('0x24')](_0x1d83ba);}}_0x1b71e9({'count':_0x2738da[_0xc0b2('0x1b')],'rows':_0x2738da});});},'OpenchannelQueues':function(){return new Promise(function(_0x559a4c){var _0x38af56=[];for(var _0x48f7b4 in _0x440c1f[_0xc0b2('0x57')]){if(_0x440c1f[_0xc0b2('0x57')][_0xc0b2('0x4b')](_0x48f7b4)){var _0x499803=_0x440c1f[_0xc0b2('0x57')][_0x48f7b4];var _0x1cf46c={'id':_0x499803['id'],'available':_0x499803[_0xc0b2('0x58')],'loggedIn':_0x499803['loggedIn'],'name':_0x499803['name'],'paused':_0x499803[_0xc0b2('0x54')],'waiting':_0x499803[_0xc0b2('0x55')]};_0x38af56[_0xc0b2('0x24')](_0x1cf46c);}}_0x559a4c({'count':_0x38af56[_0xc0b2('0x1b')],'rows':_0x38af56});});},'SmsQueues':function(){return new Promise(function(_0x1fa38b){var _0x3ef27e=[];for(var _0x4a0c15 in _0x440c1f[_0xc0b2('0x59')]){if(_0x440c1f['smsQueues'][_0xc0b2('0x4b')](_0x4a0c15)){var _0x20f117=_0x440c1f[_0xc0b2('0x59')][_0x4a0c15];var _0x441ca6={'id':_0x20f117['id'],'available':_0x20f117[_0xc0b2('0x58')],'loggedIn':_0x20f117[_0xc0b2('0x52')],'name':_0x20f117[_0xc0b2('0x53')],'paused':_0x20f117[_0xc0b2('0x54')],'waiting':_0x20f117['waiting']};_0x3ef27e[_0xc0b2('0x24')](_0x441ca6);}}_0x1fa38b({'count':_0x3ef27e[_0xc0b2('0x1b')],'rows':_0x3ef27e});});},'FaxQueues':function(){return new Promise(function(_0xdb94e1){var _0x10c9b0=[];for(var _0x961be1 in _0x440c1f[_0xc0b2('0x5a')]){if(_0x440c1f[_0xc0b2('0x5a')][_0xc0b2('0x4b')](_0x961be1)){var _0x3ef309=_0x440c1f[_0xc0b2('0x5a')][_0x961be1];var _0x57fc95={'id':_0x3ef309['id'],'available':_0x3ef309[_0xc0b2('0x58')],'loggedIn':_0x3ef309[_0xc0b2('0x52')],'name':_0x3ef309[_0xc0b2('0x53')],'paused':_0x3ef309['paused'],'waiting':_0x3ef309[_0xc0b2('0x55')]};_0x10c9b0['push'](_0x57fc95);}}_0xdb94e1({'count':_0x10c9b0[_0xc0b2('0x1b')],'rows':_0x10c9b0});});},'WhatsappQueues':function(){return new Promise(function(_0x26b1d0){var _0x46fbd2=[];for(var _0x141212 in _0x440c1f[_0xc0b2('0x5b')]){if(_0x440c1f[_0xc0b2('0x5b')][_0xc0b2('0x4b')](_0x141212)){var _0x220bb3=_0x440c1f[_0xc0b2('0x5b')][_0x141212];var _0x4753a6={'id':_0x220bb3['id'],'available':_0x220bb3[_0xc0b2('0x58')],'loggedIn':_0x220bb3[_0xc0b2('0x52')],'name':_0x220bb3['name'],'paused':_0x220bb3[_0xc0b2('0x54')],'waiting':_0x220bb3[_0xc0b2('0x55')]};_0x46fbd2[_0xc0b2('0x24')](_0x4753a6);}}_0x26b1d0({'count':_0x46fbd2[_0xc0b2('0x1b')],'rows':_0x46fbd2});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x410229){var _0x3c1566=_[_0xc0b2('0x4f')](_0x440c1f['chatQueuesWaitingInteractions']);_0x410229({'count':_0x3c1566[_0xc0b2('0x1b')],'rows':_0x3c1566});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x22c2fb){var _0x2e8b44=_[_0xc0b2('0x4f')](_0x440c1f['mailQueuesWaitingInteractions']);_0x22c2fb({'count':_0x2e8b44['length'],'rows':_0x2e8b44});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x334074){var _0x4ae333=_[_0xc0b2('0x4f')](_0x440c1f[_0xc0b2('0x5c')]);_0x334074({'count':_0x4ae333[_0xc0b2('0x1b')],'rows':_0x4ae333});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x51d08b){var _0x21d52e=_[_0xc0b2('0x4f')](_0x440c1f[_0xc0b2('0x5d')]);_0x51d08b({'count':_0x21d52e[_0xc0b2('0x1b')],'rows':_0x21d52e});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x345da5){var _0x324c23=_[_0xc0b2('0x4f')](_0x440c1f[_0xc0b2('0x5e')]);_0x345da5({'count':_0x324c23[_0xc0b2('0x1b')],'rows':_0x324c23});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x498acf){var _0x44b2eb=_[_0xc0b2('0x4f')](_0x440c1f[_0xc0b2('0x5f')]);_0x498acf({'count':_0x44b2eb['length'],'rows':_0x44b2eb});});}};var _0x29640a=jayson[_0xc0b2('0x60')](_0x3b7a13)['http']();_0x29640a['on'](_0xc0b2('0x3e'),function(_0xe4c270){logger['error'](JSON['stringify'](_0xe4c270));return _0xa3e99b(_0xe4c270);});_0x29640a['listen'](0x232c,'127.0.0.1',function(){console['log'](_0xc0b2('0x61'),0x232c);return _0x1ae155(_0xc0b2('0x62')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 20c2c8e..b2cee9b 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 _0xd5f2=['some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../utils/iftime','routing','condition','rules','info','stop','map'];(function(_0x466611,_0x421a63){var _0x4112c4=function(_0xeb1aab){while(--_0xeb1aab){_0x466611['push'](_0x466611['shift']());}};_0x4112c4(++_0x421a63);}(_0xd5f2,0xe6));var _0x2d5f=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xd5f2[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0x2d5f('0x0'));var iftime=require(_0x2d5f('0x1'))['iftime'];var logger=require('../../../config/logger')(_0x2d5f('0x2'));exports[_0x2d5f('0x3')]=function(_0xab5365,_0x4c4916,_0x2e7ce2){return function(_0xd2ca77){if(_0x2e7ce2[_0x2d5f('0x4')]&&!_0x2e7ce2[_0x2d5f('0x4')][_0xab5365]){logger[_0x2d5f('0x5')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0xab5365);return _0xd2ca77[_0x2d5f('0x6')]();}var _0xf77b31=_0x4c4916[_0x2d5f('0x7')](function(_0x37c365){return iftime(_0x37c365);});var _0x288631=_[_0x2d5f('0x8')](_0xf77b31);if(_0x288631){logger[_0x2d5f('0x5')](_0x2d5f('0x9'),_0xab5365,_0x4c4916[_0x2d5f('0xa')](_0x2d5f('0xb')),_0x288631);_0xd2ca77[_0x2d5f('0xc')](_0x288631);}else{logger[_0x2d5f('0x5')](_0x2d5f('0xd'),_0xab5365,_0x4c4916[_0x2d5f('0xa')](_0x2d5f('0xb')));_0xd2ca77['stop']();}};}; \ No newline at end of file +var _0x3b9b=['info','stop','length','Command','format','iftime\x20%s','then','indexOf','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','routing','client','error','message','result','rules'];(function(_0x2233c6,_0x227b09){var _0x11c4ea=function(_0x45ca0b){while(--_0x45ca0b){_0x2233c6['push'](_0x2233c6['shift']());}};_0x11c4ea(++_0x227b09);}(_0x3b9b,0x170));var _0xb3b9=function(_0xcccdf4,_0x220dc3){_0xcccdf4=_0xcccdf4-0x0;var _0x58abbb=_0x3b9b[_0xcccdf4];return _0x58abbb;};'use strict';var util=require(_0xb3b9('0x0'));var BPromise=require(_0xb3b9('0x1'));var jayson=require(_0xb3b9('0x2'));var _=require(_0xb3b9('0x3'));var logger=require('../../../config/logger')(_0xb3b9('0x4'));var client=jayson[_0xb3b9('0x5')]['http']({'port':0x232a});function request(_0x48fdb2,_0x361fcc){return new BPromise(function(_0x24dfe8,_0xb5cc21){return client['request'](_0x48fdb2,_0x361fcc)['then'](function(_0x4922f0){if(_0x4922f0[_0xb3b9('0x6')]){return _0xb5cc21(_0x4922f0['error'][_0xb3b9('0x7')]);}else{return _0x24dfe8(_0x4922f0[_0xb3b9('0x8')]);}})['catch'](function(_0x678d0b){return _0xb5cc21(_0x678d0b);});});}exports['condition']=function(_0xa3ad32,_0x38223b,_0x15493a){return function(_0x5ee345){if(_0x15493a[_0xb3b9('0x9')]&&!_0x15493a[_0xb3b9('0x9')][_0xa3ad32]){logger[_0xb3b9('0xa')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0xa3ad32);return _0x5ee345[_0xb3b9('0xb')]();}var _0x45340a=[];for(var _0x4ed99f=0x0;_0x4ed99f<_0x38223b[_0xb3b9('0xc')];_0x4ed99f+=0x1){_0x45340a['push'](request(_0xb3b9('0xd'),{'command':util[_0xb3b9('0xe')](_0xb3b9('0xf'),_0x38223b[_0x4ed99f])})[_0xb3b9('0x10')](function(_0x1519cd){return _0x1519cd&&_0x1519cd[_0xb3b9('0x7')]&&_0x1519cd[_0xb3b9('0x7')][_0xb3b9('0x11')]('true')>=0x0?!![]:![];})[_0xb3b9('0x12')](function(_0x323f65){logger[_0xb3b9('0x6')](_0xb3b9('0x13'),_0xa3ad32,_0x38223b[_0x4ed99f]);}));}BPromise[_0xb3b9('0x14')](_0x45340a)[_0xb3b9('0x10')](function(_0x42fdc6){var _0x1bda25=_[_0xb3b9('0x15')](_0x42fdc6);logger['info'](_0xb3b9('0x16'),_0xa3ad32,_0x38223b[_0xb3b9('0x17')]('\x20|\x20'),_0x1bda25);_0x5ee345[_0xb3b9('0x18')](_0x1bda25);})[_0xb3b9('0x12')](function(_0x4ec86c){console['log'](_0x4ec86c);logger[_0xb3b9('0x6')](_0xb3b9('0x16'),_0xa3ad32,_0x38223b[_0xb3b9('0x17')](_0xb3b9('0x19')),_0x4ec86c[_0xb3b9('0x1a')]);_0x5ee345[_0xb3b9('0xb')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 610034a..5ff4a3f 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 _0x97c1=['connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','reason','holdtime','ringtime','talktime','push','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','forIn','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','agentcompleteAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','agentcalledAt','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','calleridnum','connectedlinenum','lastevent','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','called'];(function(_0x37da5e,_0x2db5a9){var _0x372e79=function(_0x445f1b){while(--_0x445f1b){_0x37da5e['push'](_0x37da5e['shift']());}};_0x372e79(++_0x2db5a9);}(_0x97c1,0xdf));var _0x197c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x97c1[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e2e81,_0x498f9c){utils['info'](util[_0x197c('0x2')](_0x197c('0x3'),_0x5e2e81[_0x197c('0x4')],_0x5e2e81[_0x197c('0x5')],_0x5e2e81[_0x197c('0x6')],_0x5e2e81['membername'],_0x5e2e81['interface'],_0x5e2e81[_0x197c('0x7')],_0x5e2e81[_0x197c('0x8')],_0x5e2e81[_0x197c('0x9')]));if(_0x5e2e81[_0x197c('0x6')]){utils['getVoiceQueueByName'](_0x5e2e81['queue'])[_0x197c('0xa')](function(_0x5cffb8){if(_0x5cffb8){_0x5e2e81[_0x197c('0xb')]=_0x5cffb8[_0x197c('0xb')];_0x5e2e81[_0x197c('0xc')]=_0x5e2e81[_0x197c('0xd')]?_0x5cffb8['acw']:![];_0x5e2e81[_0x197c('0xe')]=_0x5e2e81[_0x197c('0xc')]?_0x5cffb8[_0x197c('0xf')]:0x0;}utils[_0x197c('0x10')](_0x197c('0x11'),_0x5e2e81);});}else{utils['request'](_0x197c('0x11'),_0x5e2e81);}if(_0x498f9c){delete transfers[_0x5e2e81[_0x197c('0x4')]];}else{delete agents[_0x5e2e81[_0x197c('0x12')]];}}exports[_0x197c('0x13')]=function(_0x567658){try{utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x15'),_0x567658[_0x197c('0x4')]),_0x567658);agents[_0x567658[_0x197c('0x12')]]=_0x567658;agents[_0x567658[_0x197c('0x12')]]['agentcalledAt']=utils['now']();agents[_0x567658[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x16');agents[_0x567658[_0x197c('0x12')]][_0x197c('0x8')]=null;agents[_0x567658[_0x197c('0x12')]][_0x197c('0x17')]=null;utils[_0x197c('0x18')](util['format'](_0x197c('0x19'),_0x567658['uniqueid'],agents[_0x567658['destuniqueid']][_0x197c('0x1a')],_0x567658[_0x197c('0x12')]));}catch(_0x2eca5e){utils[_0x197c('0x1b')](util['format'](_0x197c('0x15'),_0x567658[_0x197c('0x4')]),_0x2eca5e);}};exports[_0x197c('0x1c')]=function(_0x5c278a){try{if(!_[_0x197c('0x1d')](agents[_0x5c278a[_0x197c('0x12')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x1e'),_0x5c278a[_0x197c('0x4')]),_0x5c278a);utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x1f'),_0x5c278a[_0x197c('0x4')],agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x1a')],_0x5c278a[_0x197c('0x12')]));agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x1c')]=!![];agents[_0x5c278a[_0x197c('0x12')]]['agentringnoanswerAt']=utils[_0x197c('0x20')]();agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x9')]='timeout';agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x21')]='timeout';agents[_0x5c278a['destuniqueid']][_0x197c('0x22')]=_0x5c278a['ringtime']?parseInt(_0x5c278a[_0x197c('0x23')])/0x3e8:0x0;agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x24')]=0x0;unanswered[_0x197c('0x25')](_0x5c278a[_0x197c('0x12')]);}}catch(_0x3cdcd8){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x1e'),_0x5c278a['uniqueid']),_0x3cdcd8);}};exports['queuecallerabandon']=function(_0x574274){try{_['forIn'](agents,function(_0x5f7425,_0x4c9256){if(_0x5f7425[_0x197c('0x4')]==_0x574274[_0x197c('0x4')]&&!_['includes'](unanswered,_0x5f7425[_0x197c('0x12')])){utils['debug'](util[_0x197c('0x2')](_0x197c('0x26'),_0x574274[_0x197c('0x4')]),_0x574274);utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x27'),_0x574274[_0x197c('0x4')],_0x5f7425[_0x197c('0x1a')],_0x5f7425[_0x197c('0x12')]));_0x5f7425['agentringnoanswer']=!![];_0x5f7425['agentringnoanswerAt']=utils[_0x197c('0x20')]();_0x5f7425[_0x197c('0x9')]=_0x197c('0x28');_0x5f7425[_0x197c('0x21')]=_0x197c('0x28');_0x5f7425[_0x197c('0x22')]=_0x574274[_0x197c('0x22')];_0x5f7425['talktime']=0x0;writeDB(_0x5f7425);}});}catch(_0x54e6be){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][queuecallerabandon]',_0x574274['uniqueid']),_0x54e6be);}};exports[_0x197c('0x29')]=function(_0x2a884b){try{if(agents[_0x2a884b[_0x197c('0x12')]]){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x2a'),_0x2a884b[_0x197c('0x4')]),_0x2a884b);utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2a884b[_0x197c('0x4')],agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x1a')],_0x2a884b[_0x197c('0x12')]));agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x2b')]=utils['now']();agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x8')]=_0x2a884b[_0x197c('0x8')];agents[_0x2a884b['destuniqueid']][_0x197c('0x17')]=_0x2a884b[_0x197c('0x17')];agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x22')]=_0x2a884b[_0x197c('0x23')];agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x2c');_[_0x197c('0x2d')](agents,function(_0x1dc01b,_0x4a12fc){if(_0x1dc01b[_0x197c('0x12')]!=_0x2a884b[_0x197c('0x12')]&&_0x1dc01b['uniqueid']==_0x2a884b['uniqueid']){_0x1dc01b[_0x197c('0x24')]=0x0;_0x1dc01b[_0x197c('0x22')]=_0x2a884b[_0x197c('0x23')];_0x1dc01b[_0x197c('0x1c')]=!![];_0x1dc01b[_0x197c('0x2e')]=utils['now']();_0x1dc01b[_0x197c('0x9')]=_0x197c('0x2f');_0x1dc01b[_0x197c('0x21')]=_0x197c('0x2f');_0x1dc01b[_0x197c('0x30')]=_0x2a884b['destuniqueid'];_0x1dc01b[_0x197c('0x31')]=_0x2a884b[_0x197c('0x1a')];writeDB(_0x1dc01b);}});}}catch(_0x6d7bda){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][agentconnect]',_0x2a884b[_0x197c('0x4')]),_0x6d7bda);}};exports[_0x197c('0xd')]=function(_0x3b7fc1){try{if(!_[_0x197c('0x1d')](agents[_0x3b7fc1[_0x197c('0x12')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x32'),_0x3b7fc1[_0x197c('0x4')]),_0x3b7fc1);utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3b7fc1['uniqueid'],agents[_0x3b7fc1['destuniqueid']]['membername'],_0x3b7fc1[_0x197c('0x12')]));agents[_0x3b7fc1[_0x197c('0x12')]]['agentcomplete']=!![];agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x33')]=utils['now']();agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x24')]=utils['diffTime'](agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x33')],agents[_0x3b7fc1['destuniqueid']][_0x197c('0x2b')]);agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x21')]=_0x3b7fc1['reason'];agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x34');writeDB(agents[_0x3b7fc1[_0x197c('0x12')]]);}}catch(_0x53295b){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x32'),_0x3b7fc1['uniqueid']),_0x53295b);}};exports['blindtransfer']=function(_0x3a5089){try{if(!_[_0x197c('0x1d')](agents[_0x3a5089[_0x197c('0x35')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x36'),_0x3a5089['uniqueid']),_0x3a5089);utils[_0x197c('0x18')](util['format'](_0x197c('0x37'),_0x3a5089[_0x197c('0x4')],agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x1a')],agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x4')]));agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x38')]=!![];agents[_0x3a5089['transfereruniqueid']][_0x197c('0x39')]=_0x197c('0x3a');agents[_0x3a5089[_0x197c('0x35')]]['transferexten']=_0x3a5089[_0x197c('0x3b')];agents[_0x3a5089['transfereruniqueid']][_0x197c('0x3c')]=agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x4')];}}catch(_0x22a106){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x36'),_0x3a5089[_0x197c('0x4')]),_0x22a106);}};exports['attendedtransfer']=function(_0x3e3176){try{utils[_0x197c('0x14')](util[_0x197c('0x2')]('[%s][agents][attendedtransfer]',_0x3e3176[_0x197c('0x3d')]),_0x3e3176);if(_0x3e3176[_0x197c('0x3d')]==_0x3e3176[_0x197c('0x3e')]){if(!_[_0x197c('0x1d')](agents[_0x3e3176[_0x197c('0x3f')]])){utils['info'](util['format'](_0x197c('0x40'),_0x3e3176[_0x197c('0x3d')],agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x1a')]));agents[_0x3e3176[_0x197c('0x3f')]]['transfer']=!![];agents[_0x3e3176['secondtransfereruniqueid']][_0x197c('0x39')]=_0x197c('0x41');agents[_0x3e3176['secondtransfereruniqueid']][_0x197c('0x42')]=_0x3e3176[_0x197c('0x43')];agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x3c')]=_0x3e3176[_0x197c('0x3d')];}if(_0x3e3176[_0x197c('0x44')]&&agents[_0x3e3176['transfereeuniqueid']]){agents[_0x3e3176[_0x197c('0x44')]][_0x197c('0x45')]=0x1;transfers[_0x3e3176['transfereeuniqueid']]=_['clone'](agents[_0x3e3176[_0x197c('0x44')]]);transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x7')]=agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x7')];transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x46')]=agents[_0x3e3176[_0x197c('0x3f')]]['calleridname'];transfers[_0x3e3176[_0x197c('0x44')]][_0x197c('0x47')]=utils[_0x197c('0x20')]();transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x2b')]=utils[_0x197c('0x20')]();transfers[_0x3e3176['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x3e3176[_0x197c('0x44')]][_0x197c('0x45')]=0x2;}}else if(_0x3e3176[_0x197c('0x3f')]==_0x3e3176['secondtransfererlinkedid']){if(!_[_0x197c('0x1d')](agents[_0x3e3176[_0x197c('0x3d')]])){utils[_0x197c('0x18')](util['format'](_0x197c('0x40'),_0x3e3176[_0x197c('0x3d')],agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x1a')]));agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x38')]=!![];agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x39')]=_0x197c('0x41');agents[_0x3e3176[_0x197c('0x3d')]]['transferexten']=_0x3e3176[_0x197c('0x48')];agents[_0x3e3176['origtransfereruniqueid']]['transferuniqueid']=_0x3e3176['secondtransfereruniqueid'];}if(_0x3e3176['transfertargetuniqueid']&&agents[_0x3e3176[_0x197c('0x49')]]){agents[_0x3e3176[_0x197c('0x49')]][_0x197c('0x45')]=0x1;transfers[_0x3e3176[_0x197c('0x49')]]=_['clone'](agents[_0x3e3176[_0x197c('0x49')]]);transfers[_0x3e3176['transfertargetuniqueid']][_0x197c('0x7')]=agents[_0x3e3176['origtransfereruniqueid']][_0x197c('0x7')];transfers[_0x3e3176['transfertargetuniqueid']][_0x197c('0x46')]=agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x46')];transfers[_0x3e3176[_0x197c('0x49')]]['agentcalledAt']=utils[_0x197c('0x20')]();transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x2b')]=utils['now']();transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x22')]=0x0;transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x45')]=0x2;}}}catch(_0x5596f3){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x4a'),_0x3e3176[_0x197c('0x3d')]),_0x5596f3);}};exports[_0x197c('0x4b')]=function(_0x342efa){try{utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x4c'),_0x342efa[_0x197c('0x4')]),_0x342efa);if(agents[_0x342efa[_0x197c('0x4')]]&&agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]==='timeout'){if(_0x342efa['cause']==='21'){agents[_0x342efa['uniqueid']][_0x197c('0x21')]='rejected';agents[_0x342efa[_0x197c('0x4')]]['lastevent']='rejected';}utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x4d'),_0x342efa['uniqueid'],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x1a')],agents[_0x342efa['uniqueid']][_0x197c('0x21')],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x9')]));writeDB(agents[_0x342efa[_0x197c('0x4')]]);var _0x54206a=unanswered[_0x197c('0x4e')](_0x342efa['uniqueid']);if(_0x54206a>-0x1){unanswered[_0x197c('0x4f')](_0x54206a,0x1);}}if(transfers[_0x342efa['uniqueid']]){transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0xd')]=!![];transfers[_0x342efa[_0x197c('0x4')]]['agentcompleteAt']=utils[_0x197c('0x20')]();transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x24')]=utils['diffTime'](transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x33')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x2b')]);transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]='agent';transfers[_0x342efa[_0x197c('0x4')]]['lastevent']='complete';utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x342efa[_0x197c('0x4')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x1a')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')],transfers[_0x342efa['uniqueid']]['lastevent']));writeDB(transfers[_0x342efa['uniqueid']],!![]);}if(agents[_0x342efa['uniqueid']]&&agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x2b')]){agents[_0x342efa['uniqueid']]['agentcomplete']=!![];agents[_0x342efa[_0x197c('0x4')]]['agentcompleteAt']=utils['now']();agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x24')]=utils[_0x197c('0x50')](agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x33')],agents[_0x342efa[_0x197c('0x4')]]['agentconnectAt']);agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]=agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x38')]?_0x197c('0x38'):_0x197c('0x51');agents[_0x342efa[_0x197c('0x4')]]['lastevent']=_0x197c('0x34');utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x4d'),_0x342efa[_0x197c('0x4')],agents[_0x342efa[_0x197c('0x4')]]['membername'],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')],agents[_0x342efa['uniqueid']][_0x197c('0x9')]));writeDB(agents[_0x342efa[_0x197c('0x4')]]);}}catch(_0x173303){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][hangup]',_0x342efa['uniqueid']),_0x173303);}}; \ No newline at end of file +var _0xf290=['now','connectedlinename','error','agentringnoanswer','timeout','reason','holdtime','push','[%s][agents][agentringnoanswer]','includes','debug','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','talktime','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','clone','calleridname','hangup','[%s][agents][hangup]','rejected','indexOf','agent','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','calleridnum','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','agentcalledAt'];(function(_0x5c9a07,_0x3643e2){var _0x9a3291=function(_0x1ac1d0){while(--_0x1ac1d0){_0x5c9a07['push'](_0x5c9a07['shift']());}};_0x9a3291(++_0x3643e2);}(_0xf290,0xde));var _0x0f29=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xf290[_0x51c819];return _0x15c5d2;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x1d35f0,_0x4b16e4){utils[_0x0f29('0x1')](util[_0x0f29('0x2')](_0x0f29('0x3'),_0x1d35f0[_0x0f29('0x4')],_0x1d35f0[_0x0f29('0x5')],_0x1d35f0['queue'],_0x1d35f0[_0x0f29('0x6')],_0x1d35f0['interface'],_0x1d35f0[_0x0f29('0x7')],_0x1d35f0[_0x0f29('0x8')],_0x1d35f0[_0x0f29('0x9')]));if(_0x1d35f0[_0x0f29('0xa')]){utils[_0x0f29('0xb')](_0x1d35f0[_0x0f29('0xa')])[_0x0f29('0xc')](function(_0x3c6a6e){if(_0x3c6a6e){_0x1d35f0[_0x0f29('0xd')]=_0x3c6a6e[_0x0f29('0xd')];_0x1d35f0[_0x0f29('0xe')]=_0x1d35f0[_0x0f29('0xf')]?_0x3c6a6e[_0x0f29('0x10')]:![];_0x1d35f0[_0x0f29('0x11')]=_0x1d35f0[_0x0f29('0xe')]?_0x3c6a6e['acwTimeout']:0x0;}utils[_0x0f29('0x12')]('CreateVoiceAgentReport',_0x1d35f0);});}else{utils[_0x0f29('0x12')](_0x0f29('0x13'),_0x1d35f0);}if(_0x4b16e4){delete transfers[_0x1d35f0[_0x0f29('0x4')]];}else{delete agents[_0x1d35f0[_0x0f29('0x14')]];}}exports[_0x0f29('0x15')]=function(_0x2d2573){try{utils['debug'](util[_0x0f29('0x2')](_0x0f29('0x16'),_0x2d2573[_0x0f29('0x4')]),_0x2d2573);agents[_0x2d2573[_0x0f29('0x14')]]=_0x2d2573;agents[_0x2d2573[_0x0f29('0x14')]][_0x0f29('0x17')]=utils[_0x0f29('0x18')]();agents[_0x2d2573[_0x0f29('0x14')]]['lastevent']='called';agents[_0x2d2573[_0x0f29('0x14')]][_0x0f29('0x8')]=null;agents[_0x2d2573[_0x0f29('0x14')]][_0x0f29('0x19')]=null;utils['info'](util[_0x0f29('0x2')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2d2573[_0x0f29('0x4')],agents[_0x2d2573['destuniqueid']]['membername'],_0x2d2573['destuniqueid']));}catch(_0x23a44f){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x16'),_0x2d2573[_0x0f29('0x4')]),_0x23a44f);}};exports[_0x0f29('0x1b')]=function(_0x150271){try{if(!_['isNil'](agents[_0x150271[_0x0f29('0x14')]])){utils['debug'](util['format']('[%s][agents][agentringnoanswer]',_0x150271['uniqueid']),_0x150271);utils[_0x0f29('0x1')](util[_0x0f29('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x150271[_0x0f29('0x4')],agents[_0x150271[_0x0f29('0x14')]][_0x0f29('0x6')],_0x150271[_0x0f29('0x14')]));agents[_0x150271[_0x0f29('0x14')]]['agentringnoanswer']=!![];agents[_0x150271[_0x0f29('0x14')]]['agentringnoanswerAt']=utils[_0x0f29('0x18')]();agents[_0x150271[_0x0f29('0x14')]][_0x0f29('0x9')]=_0x0f29('0x1c');agents[_0x150271['destuniqueid']][_0x0f29('0x1d')]='timeout';agents[_0x150271['destuniqueid']][_0x0f29('0x1e')]=_0x150271['ringtime']?parseInt(_0x150271['ringtime'])/0x3e8:0x0;agents[_0x150271['destuniqueid']]['talktime']=0x0;unanswered[_0x0f29('0x1f')](_0x150271[_0x0f29('0x14')]);}}catch(_0x4cc5a0){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x20'),_0x150271['uniqueid']),_0x4cc5a0);}};exports['queuecallerabandon']=function(_0x37ebcc){try{_['forIn'](agents,function(_0x36b65c,_0x561c31){if(_0x36b65c['uniqueid']==_0x37ebcc[_0x0f29('0x4')]&&!_[_0x0f29('0x21')](unanswered,_0x36b65c[_0x0f29('0x14')])){utils[_0x0f29('0x22')](util['format']('[%s][agents][queuecallerabandon]',_0x37ebcc[_0x0f29('0x4')]),_0x37ebcc);utils['info'](util['format'](_0x0f29('0x23'),_0x37ebcc['uniqueid'],_0x36b65c[_0x0f29('0x6')],_0x36b65c['destuniqueid']));_0x36b65c['agentringnoanswer']=!![];_0x36b65c[_0x0f29('0x24')]=utils[_0x0f29('0x18')]();_0x36b65c[_0x0f29('0x9')]=_0x0f29('0x25');_0x36b65c[_0x0f29('0x1d')]='abandoned';_0x36b65c[_0x0f29('0x1e')]=_0x37ebcc['holdtime'];_0x36b65c[_0x0f29('0x26')]=0x0;writeDB(_0x36b65c);}});}catch(_0x3e8f3f){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')]('[%s][agents][queuecallerabandon]',_0x37ebcc[_0x0f29('0x4')]),_0x3e8f3f);}};exports[_0x0f29('0x27')]=function(_0x5be4fa){try{if(agents[_0x5be4fa[_0x0f29('0x14')]]){utils[_0x0f29('0x22')](util['format']('[%s][agents][agentconnect]',_0x5be4fa[_0x0f29('0x4')]),_0x5be4fa);utils[_0x0f29('0x1')](util[_0x0f29('0x2')](_0x0f29('0x28'),_0x5be4fa[_0x0f29('0x4')],agents[_0x5be4fa[_0x0f29('0x14')]]['membername'],_0x5be4fa[_0x0f29('0x14')]));agents[_0x5be4fa['destuniqueid']][_0x0f29('0x29')]=utils['now']();agents[_0x5be4fa[_0x0f29('0x14')]][_0x0f29('0x8')]=_0x5be4fa[_0x0f29('0x8')];agents[_0x5be4fa['destuniqueid']]['connectedlinename']=_0x5be4fa[_0x0f29('0x19')];agents[_0x5be4fa['destuniqueid']][_0x0f29('0x1e')]=_0x5be4fa[_0x0f29('0x2a')];agents[_0x5be4fa[_0x0f29('0x14')]][_0x0f29('0x9')]=_0x0f29('0x2b');_['forIn'](agents,function(_0x13c05c,_0xf77c66){if(_0x13c05c[_0x0f29('0x14')]!=_0x5be4fa[_0x0f29('0x14')]&&_0x13c05c[_0x0f29('0x4')]==_0x5be4fa[_0x0f29('0x4')]){_0x13c05c[_0x0f29('0x26')]=0x0;_0x13c05c[_0x0f29('0x1e')]=_0x5be4fa[_0x0f29('0x2a')];_0x13c05c['agentringnoanswer']=!![];_0x13c05c[_0x0f29('0x24')]=utils[_0x0f29('0x18')]();_0x13c05c[_0x0f29('0x9')]=_0x0f29('0x2c');_0x13c05c['reason']=_0x0f29('0x2c');_0x13c05c[_0x0f29('0x2d')]=_0x5be4fa[_0x0f29('0x14')];_0x13c05c[_0x0f29('0x2e')]=_0x5be4fa[_0x0f29('0x6')];writeDB(_0x13c05c);}});}}catch(_0x56062d){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x2f'),_0x5be4fa['uniqueid']),_0x56062d);}};exports[_0x0f29('0xf')]=function(_0x284279){try{if(!_[_0x0f29('0x30')](agents[_0x284279[_0x0f29('0x14')]])){utils[_0x0f29('0x22')](util[_0x0f29('0x2')](_0x0f29('0x31'),_0x284279[_0x0f29('0x4')]),_0x284279);utils['info'](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x284279[_0x0f29('0x4')],agents[_0x284279[_0x0f29('0x14')]][_0x0f29('0x6')],_0x284279[_0x0f29('0x14')]));agents[_0x284279[_0x0f29('0x14')]][_0x0f29('0xf')]=!![];agents[_0x284279['destuniqueid']][_0x0f29('0x32')]=utils['now']();agents[_0x284279[_0x0f29('0x14')]]['talktime']=utils[_0x0f29('0x33')](agents[_0x284279[_0x0f29('0x14')]][_0x0f29('0x32')],agents[_0x284279[_0x0f29('0x14')]][_0x0f29('0x29')]);agents[_0x284279['destuniqueid']][_0x0f29('0x1d')]=_0x284279[_0x0f29('0x1d')];agents[_0x284279[_0x0f29('0x14')]]['lastevent']=_0x0f29('0x34');writeDB(agents[_0x284279['destuniqueid']]);}}catch(_0x4fd625){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x31'),_0x284279[_0x0f29('0x4')]),_0x4fd625);}};exports[_0x0f29('0x35')]=function(_0x335435){try{if(!_['isNil'](agents[_0x335435[_0x0f29('0x36')]])){utils[_0x0f29('0x22')](util[_0x0f29('0x2')](_0x0f29('0x37'),_0x335435[_0x0f29('0x4')]),_0x335435);utils[_0x0f29('0x1')](util[_0x0f29('0x2')](_0x0f29('0x38'),_0x335435[_0x0f29('0x4')],agents[_0x335435[_0x0f29('0x36')]]['membername'],agents[_0x335435['transfereruniqueid']][_0x0f29('0x4')]));agents[_0x335435[_0x0f29('0x36')]][_0x0f29('0x39')]=!![];agents[_0x335435[_0x0f29('0x36')]]['transfertype']=_0x0f29('0x3a');agents[_0x335435[_0x0f29('0x36')]][_0x0f29('0x3b')]=_0x335435[_0x0f29('0x3c')];agents[_0x335435[_0x0f29('0x36')]][_0x0f29('0x3d')]=agents[_0x335435[_0x0f29('0x36')]]['uniqueid'];}}catch(_0x17f33){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x37'),_0x335435[_0x0f29('0x4')]),_0x17f33);}};exports[_0x0f29('0x3e')]=function(_0x5ec172){try{utils[_0x0f29('0x22')](util[_0x0f29('0x2')](_0x0f29('0x3f'),_0x5ec172['origtransfereruniqueid']),_0x5ec172);if(_0x5ec172[_0x0f29('0x40')]==_0x5ec172['origtransfererlinkedid']){if(!_[_0x0f29('0x30')](agents[_0x5ec172['secondtransfereruniqueid']])){utils[_0x0f29('0x1')](util[_0x0f29('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x5ec172[_0x0f29('0x40')],agents[_0x5ec172[_0x0f29('0x41')]][_0x0f29('0x6')]));agents[_0x5ec172['secondtransfereruniqueid']][_0x0f29('0x39')]=!![];agents[_0x5ec172['secondtransfereruniqueid']][_0x0f29('0x42')]=_0x0f29('0x43');agents[_0x5ec172['secondtransfereruniqueid']][_0x0f29('0x3b')]=_0x5ec172[_0x0f29('0x44')];agents[_0x5ec172['secondtransfereruniqueid']][_0x0f29('0x3d')]=_0x5ec172['origtransfereruniqueid'];}if(_0x5ec172[_0x0f29('0x45')]&&agents[_0x5ec172['transfereeuniqueid']]){agents[_0x5ec172[_0x0f29('0x45')]][_0x0f29('0x46')]=0x1;transfers[_0x5ec172[_0x0f29('0x45')]]=_['clone'](agents[_0x5ec172[_0x0f29('0x45')]]);transfers[_0x5ec172[_0x0f29('0x45')]][_0x0f29('0x7')]=agents[_0x5ec172[_0x0f29('0x41')]]['calleridnum'];transfers[_0x5ec172[_0x0f29('0x45')]]['calleridname']=agents[_0x5ec172[_0x0f29('0x41')]]['calleridname'];transfers[_0x5ec172[_0x0f29('0x45')]][_0x0f29('0x17')]=utils[_0x0f29('0x18')]();transfers[_0x5ec172[_0x0f29('0x45')]][_0x0f29('0x29')]=utils[_0x0f29('0x18')]();transfers[_0x5ec172[_0x0f29('0x45')]]['holdtime']=0x0;transfers[_0x5ec172[_0x0f29('0x45')]]['agententerreason']=0x2;}}else if(_0x5ec172[_0x0f29('0x41')]==_0x5ec172[_0x0f29('0x47')]){if(!_[_0x0f29('0x30')](agents[_0x5ec172['origtransfereruniqueid']])){utils[_0x0f29('0x1')](util[_0x0f29('0x2')](_0x0f29('0x48'),_0x5ec172[_0x0f29('0x40')],agents[_0x5ec172[_0x0f29('0x40')]]['membername']));agents[_0x5ec172['origtransfereruniqueid']][_0x0f29('0x39')]=!![];agents[_0x5ec172[_0x0f29('0x40')]][_0x0f29('0x42')]='ATTENDED';agents[_0x5ec172['origtransfereruniqueid']][_0x0f29('0x3b')]=_0x5ec172[_0x0f29('0x49')];agents[_0x5ec172[_0x0f29('0x40')]]['transferuniqueid']=_0x5ec172['secondtransfereruniqueid'];}if(_0x5ec172['transfertargetuniqueid']&&agents[_0x5ec172[_0x0f29('0x4a')]]){agents[_0x5ec172[_0x0f29('0x4a')]]['agententerreason']=0x1;transfers[_0x5ec172[_0x0f29('0x4a')]]=_[_0x0f29('0x4b')](agents[_0x5ec172['transfertargetuniqueid']]);transfers[_0x5ec172[_0x0f29('0x4a')]]['calleridnum']=agents[_0x5ec172[_0x0f29('0x40')]][_0x0f29('0x7')];transfers[_0x5ec172['transfertargetuniqueid']][_0x0f29('0x4c')]=agents[_0x5ec172[_0x0f29('0x40')]][_0x0f29('0x4c')];transfers[_0x5ec172[_0x0f29('0x4a')]][_0x0f29('0x17')]=utils[_0x0f29('0x18')]();transfers[_0x5ec172['transfertargetuniqueid']][_0x0f29('0x29')]=utils[_0x0f29('0x18')]();transfers[_0x5ec172[_0x0f29('0x4a')]]['holdtime']=0x0;transfers[_0x5ec172[_0x0f29('0x4a')]][_0x0f29('0x46')]=0x2;}}}catch(_0x4bbc7e){utils[_0x0f29('0x1a')](util['format'](_0x0f29('0x3f'),_0x5ec172[_0x0f29('0x40')]),_0x4bbc7e);}};exports[_0x0f29('0x4d')]=function(_0x4bd8f1){try{utils[_0x0f29('0x22')](util[_0x0f29('0x2')](_0x0f29('0x4e'),_0x4bd8f1[_0x0f29('0x4')]),_0x4bd8f1);if(agents[_0x4bd8f1[_0x0f29('0x4')]]&&agents[_0x4bd8f1[_0x0f29('0x4')]]['reason']===_0x0f29('0x1c')){if(_0x4bd8f1['cause']==='21'){agents[_0x4bd8f1['uniqueid']][_0x0f29('0x1d')]=_0x0f29('0x4f');agents[_0x4bd8f1['uniqueid']][_0x0f29('0x9')]=_0x0f29('0x4f');}utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4bd8f1['uniqueid'],agents[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x6')],agents[_0x4bd8f1['uniqueid']]['reason'],agents[_0x4bd8f1[_0x0f29('0x4')]]['lastevent']));writeDB(agents[_0x4bd8f1[_0x0f29('0x4')]]);var _0x473eac=unanswered[_0x0f29('0x50')](_0x4bd8f1[_0x0f29('0x4')]);if(_0x473eac>-0x1){unanswered['splice'](_0x473eac,0x1);}}if(transfers[_0x4bd8f1[_0x0f29('0x4')]]){transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0xf')]=!![];transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x32')]=utils['now']();transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x26')]=utils[_0x0f29('0x33')](transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x32')],transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x29')]);transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x1d')]=_0x0f29('0x51');transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x9')]=_0x0f29('0x34');utils[_0x0f29('0x1')](util[_0x0f29('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4bd8f1[_0x0f29('0x4')],transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x6')],transfers[_0x4bd8f1[_0x0f29('0x4')]]['reason'],transfers[_0x4bd8f1['uniqueid']][_0x0f29('0x9')]));writeDB(transfers[_0x4bd8f1[_0x0f29('0x4')]],!![]);}if(agents[_0x4bd8f1[_0x0f29('0x4')]]&&agents[_0x4bd8f1['uniqueid']][_0x0f29('0x29')]){agents[_0x4bd8f1['uniqueid']][_0x0f29('0xf')]=!![];agents[_0x4bd8f1['uniqueid']][_0x0f29('0x32')]=utils[_0x0f29('0x18')]();agents[_0x4bd8f1[_0x0f29('0x4')]]['talktime']=utils[_0x0f29('0x33')](agents[_0x4bd8f1['uniqueid']]['agentcompleteAt'],agents[_0x4bd8f1[_0x0f29('0x4')]]['agentconnectAt']);agents[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x1d')]=agents[_0x4bd8f1['uniqueid']][_0x0f29('0x39')]?_0x0f29('0x39'):_0x0f29('0x51');agents[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x9')]=_0x0f29('0x34');utils[_0x0f29('0x1')](util[_0x0f29('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4bd8f1[_0x0f29('0x4')],agents[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x6')],agents[_0x4bd8f1['uniqueid']][_0x0f29('0x1d')],agents[_0x4bd8f1[_0x0f29('0x4')]]['lastevent']));writeDB(agents[_0x4bd8f1[_0x0f29('0x4')]]);}}catch(_0x5e39a7){utils[_0x0f29('0x1a')](util['format'](_0x0f29('0x4e'),_0x4bd8f1['uniqueid']),_0x5e39a7);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index da8b2ec..055e51e 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 _0x17b0=['includes','noop','execif','[%s][calls][newexten]','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','interface','calleridnum','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','debug','[%s][calls][newchannel]','linkedid','channel','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','now','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','queue','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','split','lastIndexOf'];(function(_0x3bc2b4,_0x26366e){var _0x3cac50=function(_0x592f61){while(--_0x592f61){_0x3bc2b4['push'](_0x3bc2b4['shift']());}};_0x3cac50(++_0x26366e);}(_0x17b0,0x1a8));var _0x017b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x17b0[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x017b('0x0'));var util=require(_0x017b('0x1'));var utils=require(_0x017b('0x2'));var dispositions=[_0x017b('0x3'),'FAILED',_0x017b('0x4'),'NO\x20ANSWER',_0x017b('0x3'),_0x017b('0x3'),_0x017b('0x5'),'BUSY','FAILED',_0x017b('0x4'),_0x017b('0x4')];var channels={};function writeDB(_0x407816){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x8'),_0x407816[_0x017b('0x9')],_0x407816['channel'],_0x407816['queue'],_0x407816['membername'],_0x407816[_0x017b('0xa')],_0x407816[_0x017b('0xb')],_0x407816['connectedlinenum'],_0x407816['lastevent']));if(_0x407816[_0x017b('0xc')]){utils[_0x017b('0xd')](_0x407816[_0x017b('0xc')])[_0x017b('0xe')](function(_0x3c01e1){if(_0x3c01e1){_0x407816[_0x017b('0xf')]=_0x3c01e1['id'];}utils[_0x017b('0x10')](_0x017b('0x11'),_0x407816);});}else{utils[_0x017b('0x10')](_0x017b('0x11'),_0x407816);}if(channels[_0x407816[_0x017b('0x9')]]){delete channels[_0x407816[_0x017b('0x9')]];}}exports['newchannel']=function(_0x4d9316){try{utils[_0x017b('0x12')](util[_0x017b('0x7')](_0x017b('0x13'),_0x4d9316['uniqueid']),_0x4d9316);if(_0x4d9316[_0x017b('0x9')]==_0x4d9316[_0x017b('0x14')]&&_0x4d9316[_0x017b('0x15')]!='OutgoingSpoolFailed'){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x16'),_0x4d9316['uniqueid'],_0x4d9316[_0x017b('0x17')],_0x4d9316[_0x017b('0x18')]));channels[_0x4d9316['uniqueid']]={'uniqueid':_0x4d9316[_0x017b('0x9')],'accountcode':_0x4d9316['accountcode'],'source':_0x4d9316[_0x017b('0xb')],'destination':_0x4d9316[_0x017b('0x18')],'destinationcontext':_0x4d9316[_0x017b('0x17')],'channel':_0x4d9316[_0x017b('0x15')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x017b('0x3'),'amaflags':_0x017b('0x19')};}}catch(_0x33c963){utils[_0x017b('0x1a')](util[_0x017b('0x7')](_0x017b('0x13'),_0x4d9316[_0x017b('0x9')]),_0x33c963);}};exports[_0x017b('0x1b')]=function(_0xadd9db){try{utils[_0x017b('0x12')](util[_0x017b('0x7')](_0x017b('0x1c'),_0xadd9db['uniqueid']),_0xadd9db);if(!_[_0x017b('0x1d')](channels[_0xadd9db['uniqueid']])&&_0xadd9db[_0x017b('0x1e')]==0x6){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x1f'),_0xadd9db[_0x017b('0x9')],_0xadd9db[_0x017b('0x17')],_0xadd9db[_0x017b('0x15')]));if(_[_0x017b('0x1d')](channels[_0xadd9db[_0x017b('0x9')]]['systemanswertime'])){channels[_0xadd9db[_0x017b('0x9')]]['systemanswertime']=utils['now']();}}else if(!_['isNil'](channels[_0xadd9db[_0x017b('0x14')]])&&_0xadd9db[_0x017b('0x1e')]==0x6&&_0xadd9db[_0x017b('0x17')]!=_0x017b('0x20')){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x21'),_0xadd9db[_0x017b('0x9')],_0xadd9db['linkedid'],_0xadd9db[_0x017b('0x17')],_0xadd9db[_0x017b('0x15')]));channels[_0xadd9db[_0x017b('0x14')]][_0x017b('0xc')]=_0xadd9db[_0x017b('0xc')];channels[_0xadd9db[_0x017b('0x14')]][_0x017b('0x22')]=_0xadd9db[_0x017b('0x15')];if(_['isNil'](channels[_0xadd9db['linkedid']][_0x017b('0x23')])){channels[_0xadd9db['linkedid']][_0x017b('0x23')]=utils[_0x017b('0x24')]();}channels[_0xadd9db[_0x017b('0x14')]][_0x017b('0x25')]=dispositions[_[_0x017b('0x26')](_0xadd9db[_0x017b('0x1e')])]||'ANSWERED';}}catch(_0x3a35e7){utils[_0x017b('0x1a')](util[_0x017b('0x7')](_0x017b('0x1c'),_0xadd9db[_0x017b('0x9')]),_0x3a35e7);}};exports[_0x017b('0x27')]=function(_0x1e0f3a){try{if(!_[_0x017b('0x1d')](channels[_0x1e0f3a[_0x017b('0x9')]])){utils[_0x017b('0x12')](util[_0x017b('0x7')](_0x017b('0x28'),_0x1e0f3a[_0x017b('0x9')]),_0x1e0f3a);if(_[_0x017b('0x1d')](channels[_0x1e0f3a['uniqueid']][_0x017b('0x29')])){channels[_0x1e0f3a[_0x017b('0x9')]][_0x017b('0x29')]=_0x1e0f3a[_0x017b('0x2a')]+'\x20<'+_0x1e0f3a['calleridnum']+'>';}utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x2b'),_0x1e0f3a[_0x017b('0x9')],channels[_0x1e0f3a[_0x017b('0x9')]][_0x017b('0x29')],_0x1e0f3a[_0x017b('0x2c')]));channels[_0x1e0f3a[_0x017b('0x9')]][_0x017b('0x2d')]=utils[_0x017b('0x24')]();channels[_0x1e0f3a[_0x017b('0x9')]][_0x017b('0x2e')]=utils['diffTime'](channels[_0x1e0f3a['uniqueid']]['endtime'],channels[_0x1e0f3a[_0x017b('0x9')]][_0x017b('0x2f')]);channels[_0x1e0f3a['uniqueid']][_0x017b('0x30')]=channels[_0x1e0f3a[_0x017b('0x9')]]['answertime']?utils[_0x017b('0x31')](channels[_0x1e0f3a['uniqueid']][_0x017b('0x2d')],channels[_0x1e0f3a[_0x017b('0x9')]]['answertime']):0x0;writeDB(channels[_0x1e0f3a['uniqueid']]);}}catch(_0x11f746){utils[_0x017b('0x1a')](util[_0x017b('0x7')]('[%s][calls][hangup]',_0x1e0f3a['uniqueid']),_0x11f746);}};exports[_0x017b('0x32')]=function(_0x2fa9d4){try{if(!_[_0x017b('0x1d')](channels[_0x2fa9d4[_0x017b('0x33')]])){utils[_0x017b('0x12')](util[_0x017b('0x7')]('[%s][calls][attendedtransfer]',_0x2fa9d4[_0x017b('0x34')]),_0x2fa9d4);if(channels[_0x2fa9d4['localtwolinkedid']][_0x017b('0x15')]==_0x2fa9d4['transfereechannel']){utils[_0x017b('0x6')](util['format'](_0x017b('0x35'),_0x2fa9d4[_0x017b('0x34')],_0x2fa9d4[_0x017b('0x33')],_0x2fa9d4['secondtransfererchannel']));channels[_0x2fa9d4[_0x017b('0x33')]][_0x017b('0x22')]=_0x2fa9d4[_0x017b('0x36')];channels[_0x2fa9d4[_0x017b('0x33')]][_0x017b('0x37')]=_0x017b('0x38');}else if(channels[_0x2fa9d4[_0x017b('0x33')]][_0x017b('0x15')]=_0x2fa9d4[_0x017b('0x39')]){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2fa9d4[_0x017b('0x34')],_0x2fa9d4[_0x017b('0x33')],_0x2fa9d4[_0x017b('0x3a')]));channels[_0x2fa9d4[_0x017b('0x33')]][_0x017b('0x22')]=_0x2fa9d4[_0x017b('0x3a')];channels[_0x2fa9d4[_0x017b('0x33')]]['userfield']=_0x017b('0x38');}}}catch(_0x3df30b){utils['error'](util['format'](_0x017b('0x3b'),_0x2fa9d4['origtransfereruniqueid']),_0x3df30b);}};exports[_0x017b('0x3c')]=function(_0x8372bd){try{if(!_[_0x017b('0x1d')](channels[_0x8372bd['uniqueid']])){utils['debug'](util[_0x017b('0x7')]('[%s][calls][musiconholdstart]',_0x8372bd['uniqueid']),_0x8372bd);channels[_0x8372bd[_0x017b('0x9')]][_0x017b('0x3d')]=utils['now']();utils['info'](util['format'](_0x017b('0x3e'),_0x8372bd[_0x017b('0x9')],channels[_0x8372bd['uniqueid']][_0x017b('0x3d')]));}}catch(_0x3913fb){utils[_0x017b('0x1a')](util[_0x017b('0x7')](_0x017b('0x3f'),_0x8372bd['uniqueid']),_0x3913fb);}};exports[_0x017b('0x40')]=function(_0x5e84b3){try{if(!_[_0x017b('0x1d')](channels[_0x5e84b3[_0x017b('0x9')]])){utils[_0x017b('0x12')](util['format'](_0x017b('0x41'),_0x5e84b3[_0x017b('0x9')]),_0x5e84b3);if(!_[_0x017b('0x1d')](channels[_0x5e84b3['uniqueid']][_0x017b('0x3d')])){channels[_0x5e84b3[_0x017b('0x9')]][_0x017b('0x42')]+=utils[_0x017b('0x31')](utils['now'](),channels[_0x5e84b3[_0x017b('0x9')]]['musiconholdstartAt']);utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x43'),_0x5e84b3[_0x017b('0x9')],channels[_0x5e84b3['uniqueid']][_0x017b('0x42')]));delete channels[_0x5e84b3[_0x017b('0x9')]]['musiconholdstartAt'];}}}catch(_0x439c88){utils[_0x017b('0x1a')](util[_0x017b('0x7')](_0x017b('0x41'),_0x5e84b3['uniqueid']),_0x439c88);}};exports[_0x017b('0x44')]=function(_0x25145b){try{if(!_[_0x017b('0x1d')](channels[_0x25145b[_0x017b('0x9')]])){utils[_0x017b('0x12')](util[_0x017b('0x7')](_0x017b('0x45'),_0x25145b['uniqueid']),_0x25145b);if(!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x47')])){utils['info'](util[_0x017b('0x7')](_0x017b('0x48'),_0x25145b['uniqueid'],_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]][_0x017b('0x4a')]=_0x25145b['value'];}if(!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x4b')])){utils[_0x017b('0x6')](util['format'](_0x017b('0x4c'),_0x25145b[_0x017b('0x9')],_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]][_0x017b('0x4d')]=_0x25145b['value'];channels[_0x25145b['uniqueid']][_0x017b('0x29')]='\x22'+_0x25145b['value']+_0x017b('0x4e')+_0x25145b[_0x017b('0x49')]+'>';}if(!_['isNil'](_0x25145b['variable'][_0x017b('0x4f')])||!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')]['xmd-callerid'])){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x50'),_0x25145b[_0x017b('0x9')],!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x4f')])?_0x017b('0x4f'):'xmd-callerid',_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]]['callerid']=_0x25145b[_0x017b('0x49')];}if(!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x51')])||!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x52')])){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x50'),_0x25145b[_0x017b('0x9')],!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x51')])?_0x017b('0x51'):_0x017b('0x52'),_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]][_0x017b('0x53')]='Queue';channels[_0x25145b[_0x017b('0x9')]][_0x017b('0x54')]=_0x25145b[_0x017b('0x49')];channels[_0x25145b[_0x017b('0x9')]][_0x017b('0x55')]=!![];}if(!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')]['xmd-contactid'])){utils['info'](util[_0x017b('0x7')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x25145b[_0x017b('0x9')],_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]][_0x017b('0x56')]=_0x25145b[_0x017b('0x49')];}if(!_['isNil'](_0x25145b[_0x017b('0x46')][_0x017b('0x57')])){utils['info'](util[_0x017b('0x7')](_0x017b('0x58'),_0x25145b[_0x017b('0x9')],_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]]['type']=_0x25145b[_0x017b('0x49')];}if(!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')]['outboundrouteid'])){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x59'),_0x25145b[_0x017b('0x9')],_0x25145b['value']));channels[_0x25145b['uniqueid']][_0x017b('0x5a')]=_0x25145b['value'];}if(!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x5b')])){utils[_0x017b('0x6')](util['format'](_0x017b('0x5c'),_0x25145b['uniqueid'],_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]]['sipcallid']=_0x25145b[_0x017b('0x49')];}}}catch(_0x12ddc0){utils[_0x017b('0x1a')](util[_0x017b('0x7')](_0x017b('0x45'),_0x25145b[_0x017b('0x9')]),_0x12ddc0);}};exports['newexten']=function(_0x562aee){try{if(!_['isNil'](channels[_0x562aee[_0x017b('0x9')]])){utils[_0x017b('0x12')](util[_0x017b('0x7')]('[%s][calls][newexten]',_0x562aee['uniqueid']),_0x562aee);utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x5d'),_0x562aee[_0x017b('0x9')],_0x562aee[_0x017b('0x5e')],_0x562aee[_0x017b('0x5f')]));if(_0x562aee[_0x017b('0x5e')]['toLowerCase']()==_0x017b('0x60')&&_[_0x017b('0x61')](_0x562aee[_0x017b('0x5f')][_0x017b('0x62')](),'cdr')){var _0x629479=_0x562aee[_0x017b('0x5f')][_0x017b('0x63')]('=');var _0x24bc52=_0x629479[0x0]['substring'](_0x629479[0x0]['lastIndexOf']('(')+0x1,_0x629479[0x0][_0x017b('0x64')](')'));var _0x4ad462=_0x629479[0x1];channels[_0x562aee[_0x017b('0x9')]][_0x24bc52]=_0x4ad462;}if(!_[_0x017b('0x65')]([_0x017b('0x27'),_0x017b('0x66'),_0x017b('0x67'),_0x017b('0x60'),'gotoif'],_0x562aee[_0x017b('0x5e')][_0x017b('0x62')]())){channels[_0x562aee[_0x017b('0x9')]][_0x017b('0x53')]=_0x562aee['application'];channels[_0x562aee[_0x017b('0x9')]][_0x017b('0x54')]=_0x562aee[_0x017b('0x5f')];}}}catch(_0x4e8b4d){utils['error'](util['format'](_0x017b('0x68'),_0x562aee['uniqueid']),_0x4e8b4d);}}; \ No newline at end of file +var _0x38ba=['endtime','duration','starttime','billableseconds','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','userfield','origtransfererchannel','_attended','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','destination','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','context','exten','channel','now','DOCUMENTATION','error','newstate','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s'];(function(_0x53f0f0,_0x1e0a0d){var _0x3192dd=function(_0x35011e){while(--_0x35011e){_0x53f0f0['push'](_0x53f0f0['shift']());}};_0x3192dd(++_0x1e0a0d);}(_0x38ba,0x10b));var _0xa38b=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0x38ba[_0x609988];return _0x159984;};'use strict';var _=require(_0xa38b('0x0'));var util=require('util');var utils=require(_0xa38b('0x1'));var dispositions=[_0xa38b('0x2'),_0xa38b('0x3'),_0xa38b('0x3'),_0xa38b('0x2'),_0xa38b('0x2'),_0xa38b('0x2'),_0xa38b('0x4'),_0xa38b('0x5'),_0xa38b('0x3'),_0xa38b('0x3'),_0xa38b('0x3')];var channels={};function writeDB(_0x55ad9d){utils[_0xa38b('0x6')](util[_0xa38b('0x7')](_0xa38b('0x8'),_0x55ad9d[_0xa38b('0x9')],_0x55ad9d['channel'],_0x55ad9d[_0xa38b('0xa')],_0x55ad9d[_0xa38b('0xb')],_0x55ad9d['interface'],_0x55ad9d[_0xa38b('0xc')],_0x55ad9d[_0xa38b('0xd')],_0x55ad9d[_0xa38b('0xe')]));if(_0x55ad9d[_0xa38b('0xf')]){utils['getUserByInternal'](_0x55ad9d[_0xa38b('0xf')])[_0xa38b('0x10')](function(_0x5c3fbf){if(_0x5c3fbf){_0x55ad9d[_0xa38b('0x11')]=_0x5c3fbf['id'];}utils[_0xa38b('0x12')](_0xa38b('0x13'),_0x55ad9d);});}else{utils[_0xa38b('0x12')]('CreateVoiceCallReport',_0x55ad9d);}if(channels[_0x55ad9d[_0xa38b('0x9')]]){delete channels[_0x55ad9d['uniqueid']];}}exports[_0xa38b('0x14')]=function(_0x44d40f){try{utils[_0xa38b('0x15')](util['format'](_0xa38b('0x16'),_0x44d40f[_0xa38b('0x9')]),_0x44d40f);if(_0x44d40f[_0xa38b('0x9')]==_0x44d40f[_0xa38b('0x17')]&&_0x44d40f['channel']!=_0xa38b('0x18')){utils['info'](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x44d40f[_0xa38b('0x9')],_0x44d40f[_0xa38b('0x19')],_0x44d40f[_0xa38b('0x1a')]));channels[_0x44d40f[_0xa38b('0x9')]]={'uniqueid':_0x44d40f['uniqueid'],'accountcode':_0x44d40f['accountcode'],'source':_0x44d40f['calleridnum'],'destination':_0x44d40f[_0xa38b('0x1a')],'destinationcontext':_0x44d40f[_0xa38b('0x19')],'channel':_0x44d40f[_0xa38b('0x1b')],'starttime':utils[_0xa38b('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xa38b('0x2'),'amaflags':_0xa38b('0x1d')};}}catch(_0x2b4dc3){utils[_0xa38b('0x1e')](util[_0xa38b('0x7')](_0xa38b('0x16'),_0x44d40f[_0xa38b('0x9')]),_0x2b4dc3);}};exports[_0xa38b('0x1f')]=function(_0x95e85a){try{utils[_0xa38b('0x15')](util['format']('[%s][calls][newstate]',_0x95e85a[_0xa38b('0x9')]),_0x95e85a);if(!_['isNil'](channels[_0x95e85a[_0xa38b('0x9')]])&&_0x95e85a[_0xa38b('0x20')]==0x6){utils[_0xa38b('0x6')](util[_0xa38b('0x7')](_0xa38b('0x21'),_0x95e85a[_0xa38b('0x9')],_0x95e85a[_0xa38b('0x19')],_0x95e85a['channel']));if(_[_0xa38b('0x22')](channels[_0x95e85a[_0xa38b('0x9')]][_0xa38b('0x23')])){channels[_0x95e85a['uniqueid']][_0xa38b('0x23')]=utils[_0xa38b('0x1c')]();}}else if(!_[_0xa38b('0x22')](channels[_0x95e85a[_0xa38b('0x17')]])&&_0x95e85a[_0xa38b('0x20')]==0x6&&_0x95e85a[_0xa38b('0x19')]!=_0xa38b('0x24')){utils[_0xa38b('0x6')](util[_0xa38b('0x7')](_0xa38b('0x25'),_0x95e85a[_0xa38b('0x9')],_0x95e85a[_0xa38b('0x17')],_0x95e85a['context'],_0x95e85a[_0xa38b('0x1b')]));channels[_0x95e85a['linkedid']][_0xa38b('0xf')]=_0x95e85a['accountcode'];channels[_0x95e85a[_0xa38b('0x17')]][_0xa38b('0x26')]=_0x95e85a['channel'];if(_[_0xa38b('0x22')](channels[_0x95e85a[_0xa38b('0x17')]][_0xa38b('0x27')])){channels[_0x95e85a['linkedid']]['answertime']=utils[_0xa38b('0x1c')]();}channels[_0x95e85a[_0xa38b('0x17')]][_0xa38b('0x28')]=dispositions[_[_0xa38b('0x29')](_0x95e85a[_0xa38b('0x20')])]||'ANSWERED';}}catch(_0x350990){utils[_0xa38b('0x1e')](util['format'](_0xa38b('0x2a'),_0x95e85a[_0xa38b('0x9')]),_0x350990);}};exports[_0xa38b('0x2b')]=function(_0x170604){try{if(!_[_0xa38b('0x22')](channels[_0x170604[_0xa38b('0x9')]])){utils[_0xa38b('0x15')](util[_0xa38b('0x7')](_0xa38b('0x2c'),_0x170604['uniqueid']),_0x170604);if(_[_0xa38b('0x22')](channels[_0x170604[_0xa38b('0x9')]][_0xa38b('0x2d')])){channels[_0x170604['uniqueid']][_0xa38b('0x2d')]=_0x170604[_0xa38b('0x2e')]+'\x20<'+_0x170604[_0xa38b('0xc')]+'>';}utils[_0xa38b('0x6')](util[_0xa38b('0x7')](_0xa38b('0x2f'),_0x170604['uniqueid'],channels[_0x170604[_0xa38b('0x9')]][_0xa38b('0x2d')],_0x170604['cause-txt']));channels[_0x170604[_0xa38b('0x9')]][_0xa38b('0x30')]=utils['now']();channels[_0x170604[_0xa38b('0x9')]][_0xa38b('0x31')]=utils['diffTime'](channels[_0x170604[_0xa38b('0x9')]]['endtime'],channels[_0x170604[_0xa38b('0x9')]][_0xa38b('0x32')]);channels[_0x170604[_0xa38b('0x9')]][_0xa38b('0x33')]=channels[_0x170604['uniqueid']]['answertime']?utils[_0xa38b('0x34')](channels[_0x170604[_0xa38b('0x9')]]['endtime'],channels[_0x170604[_0xa38b('0x9')]]['answertime']):0x0;writeDB(channels[_0x170604[_0xa38b('0x9')]]);}}catch(_0x1967f7){utils[_0xa38b('0x1e')](util[_0xa38b('0x7')](_0xa38b('0x2c'),_0x170604[_0xa38b('0x9')]),_0x1967f7);}};exports[_0xa38b('0x35')]=function(_0x47f836){try{if(!_[_0xa38b('0x22')](channels[_0x47f836['localtwolinkedid']])){utils['debug'](util['format'](_0xa38b('0x36'),_0x47f836[_0xa38b('0x37')]),_0x47f836);if(channels[_0x47f836['localtwolinkedid']]['channel']==_0x47f836[_0xa38b('0x38')]){utils[_0xa38b('0x6')](util[_0xa38b('0x7')](_0xa38b('0x39'),_0x47f836[_0xa38b('0x37')],_0x47f836[_0xa38b('0x3a')],_0x47f836[_0xa38b('0x3b')]));channels[_0x47f836[_0xa38b('0x3a')]]['destinationchannel']=_0x47f836[_0xa38b('0x3b')];channels[_0x47f836[_0xa38b('0x3a')]][_0xa38b('0x3c')]='_attended';}else if(channels[_0x47f836[_0xa38b('0x3a')]][_0xa38b('0x1b')]=_0x47f836['transfertargetchannel']){utils[_0xa38b('0x6')](util['format'](_0xa38b('0x39'),_0x47f836[_0xa38b('0x37')],_0x47f836[_0xa38b('0x3a')],_0x47f836[_0xa38b('0x3d')]));channels[_0x47f836[_0xa38b('0x3a')]]['destinationchannel']=_0x47f836[_0xa38b('0x3d')];channels[_0x47f836[_0xa38b('0x3a')]][_0xa38b('0x3c')]=_0xa38b('0x3e');}}}catch(_0x5e5fa0){utils[_0xa38b('0x1e')](util[_0xa38b('0x7')](_0xa38b('0x36'),_0x47f836[_0xa38b('0x37')]),_0x5e5fa0);}};exports['musiconholdstart']=function(_0x1769c2){try{if(!_[_0xa38b('0x22')](channels[_0x1769c2[_0xa38b('0x9')]])){utils[_0xa38b('0x15')](util[_0xa38b('0x7')](_0xa38b('0x3f'),_0x1769c2['uniqueid']),_0x1769c2);channels[_0x1769c2['uniqueid']][_0xa38b('0x40')]=utils[_0xa38b('0x1c')]();utils['info'](util['format'](_0xa38b('0x41'),_0x1769c2[_0xa38b('0x9')],channels[_0x1769c2['uniqueid']][_0xa38b('0x40')]));}}catch(_0x3851b9){utils[_0xa38b('0x1e')](util[_0xa38b('0x7')]('[%s][calls][musiconholdstart]',_0x1769c2[_0xa38b('0x9')]),_0x3851b9);}};exports[_0xa38b('0x42')]=function(_0x5853fa){try{if(!_[_0xa38b('0x22')](channels[_0x5853fa[_0xa38b('0x9')]])){utils[_0xa38b('0x15')](util[_0xa38b('0x7')](_0xa38b('0x43'),_0x5853fa[_0xa38b('0x9')]),_0x5853fa);if(!_['isNil'](channels[_0x5853fa[_0xa38b('0x9')]][_0xa38b('0x40')])){channels[_0x5853fa[_0xa38b('0x9')]]['mohtime']+=utils['diffTime'](utils[_0xa38b('0x1c')](),channels[_0x5853fa[_0xa38b('0x9')]][_0xa38b('0x40')]);utils[_0xa38b('0x6')](util[_0xa38b('0x7')](_0xa38b('0x44'),_0x5853fa['uniqueid'],channels[_0x5853fa[_0xa38b('0x9')]][_0xa38b('0x45')]));delete channels[_0x5853fa[_0xa38b('0x9')]][_0xa38b('0x40')];}}}catch(_0x4d9089){utils[_0xa38b('0x1e')](util[_0xa38b('0x7')](_0xa38b('0x43'),_0x5853fa['uniqueid']),_0x4d9089);}};exports[_0xa38b('0x46')]=function(_0x4eb08e){try{if(!_[_0xa38b('0x22')](channels[_0x4eb08e[_0xa38b('0x9')]])){utils[_0xa38b('0x15')](util[_0xa38b('0x7')](_0xa38b('0x47'),_0x4eb08e['uniqueid']),_0x4eb08e);if(!_[_0xa38b('0x22')](_0x4eb08e[_0xa38b('0x48')][_0xa38b('0x49')])){utils['info'](util['format'](_0xa38b('0x4a'),_0x4eb08e[_0xa38b('0x9')],_0x4eb08e[_0xa38b('0x4b')]));channels[_0x4eb08e[_0xa38b('0x9')]]['source']=_0x4eb08e[_0xa38b('0x4b')];}if(!_[_0xa38b('0x22')](_0x4eb08e['variable']['xmd-phone'])){utils[_0xa38b('0x6')](util[_0xa38b('0x7')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x4eb08e[_0xa38b('0x9')],_0x4eb08e[_0xa38b('0x4b')]));channels[_0x4eb08e[_0xa38b('0x9')]][_0xa38b('0x4c')]=_0x4eb08e[_0xa38b('0x4b')];channels[_0x4eb08e[_0xa38b('0x9')]][_0xa38b('0x2d')]='\x22'+_0x4eb08e[_0xa38b('0x4b')]+'\x22\x20<'+_0x4eb08e['value']+'>';}if(!_['isNil'](_0x4eb08e[_0xa38b('0x48')][_0xa38b('0x4d')])||!_['isNil'](_0x4eb08e[_0xa38b('0x48')][_0xa38b('0x4e')])){utils[_0xa38b('0x6')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4eb08e[_0xa38b('0x9')],!_['isNil'](_0x4eb08e[_0xa38b('0x48')]['xmd-callerid-preview'])?_0xa38b('0x4d'):_0xa38b('0x4e'),_0x4eb08e[_0xa38b('0x4b')]));channels[_0x4eb08e[_0xa38b('0x9')]][_0xa38b('0x2d')]=_0x4eb08e[_0xa38b('0x4b')];}if(!_[_0xa38b('0x22')](_0x4eb08e[_0xa38b('0x48')][_0xa38b('0x4f')])||!_[_0xa38b('0x22')](_0x4eb08e[_0xa38b('0x48')][_0xa38b('0x50')])){utils[_0xa38b('0x6')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4eb08e['uniqueid'],!_['isNil'](_0x4eb08e[_0xa38b('0x48')][_0xa38b('0x4f')])?_0xa38b('0x4f'):'xmcs-queue',_0x4eb08e['value']));channels[_0x4eb08e['uniqueid']][_0xa38b('0x51')]=_0xa38b('0x52');channels[_0x4eb08e[_0xa38b('0x9')]][_0xa38b('0x53')]=_0x4eb08e['value'];channels[_0x4eb08e[_0xa38b('0x9')]][_0xa38b('0xa')]=!![];}if(!_[_0xa38b('0x22')](_0x4eb08e['variable'][_0xa38b('0x54')])){utils['info'](util['format'](_0xa38b('0x55'),_0x4eb08e['uniqueid'],_0x4eb08e[_0xa38b('0x4b')]));channels[_0x4eb08e[_0xa38b('0x9')]]['ContactId']=_0x4eb08e[_0xa38b('0x4b')];}if(!_[_0xa38b('0x22')](_0x4eb08e[_0xa38b('0x48')]['xmd-cdrtype'])){utils[_0xa38b('0x6')](util['format'](_0xa38b('0x56'),_0x4eb08e['uniqueid'],_0x4eb08e[_0xa38b('0x4b')]));channels[_0x4eb08e['uniqueid']][_0xa38b('0x57')]=_0x4eb08e[_0xa38b('0x4b')];}if(!_[_0xa38b('0x22')](_0x4eb08e[_0xa38b('0x48')]['outboundrouteid'])){utils[_0xa38b('0x6')](util[_0xa38b('0x7')](_0xa38b('0x58'),_0x4eb08e[_0xa38b('0x9')],_0x4eb08e[_0xa38b('0x4b')]));channels[_0x4eb08e[_0xa38b('0x9')]][_0xa38b('0x59')]=_0x4eb08e[_0xa38b('0x4b')];}if(!_[_0xa38b('0x22')](_0x4eb08e[_0xa38b('0x48')][_0xa38b('0x5a')])){utils['info'](util[_0xa38b('0x7')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x4eb08e[_0xa38b('0x9')],_0x4eb08e['value']));channels[_0x4eb08e[_0xa38b('0x9')]][_0xa38b('0x5a')]=_0x4eb08e[_0xa38b('0x4b')];}}}catch(_0x1db932){utils[_0xa38b('0x1e')](util[_0xa38b('0x7')](_0xa38b('0x47'),_0x4eb08e['uniqueid']),_0x1db932);}};exports[_0xa38b('0x5b')]=function(_0x282b2d){try{if(!_[_0xa38b('0x22')](channels[_0x282b2d[_0xa38b('0x9')]])){utils[_0xa38b('0x15')](util[_0xa38b('0x7')]('[%s][calls][newexten]',_0x282b2d[_0xa38b('0x9')]),_0x282b2d);utils[_0xa38b('0x6')](util[_0xa38b('0x7')](_0xa38b('0x5c'),_0x282b2d[_0xa38b('0x9')],_0x282b2d[_0xa38b('0x5d')],_0x282b2d[_0xa38b('0x5e')]));if(_0x282b2d[_0xa38b('0x5d')][_0xa38b('0x5f')]()==_0xa38b('0x60')&&_[_0xa38b('0x61')](_0x282b2d[_0xa38b('0x5e')][_0xa38b('0x5f')](),'cdr')){var _0x425df0=_0x282b2d[_0xa38b('0x5e')][_0xa38b('0x62')]('=');var _0x8945ee=_0x425df0[0x0][_0xa38b('0x63')](_0x425df0[0x0][_0xa38b('0x64')]('(')+0x1,_0x425df0[0x0][_0xa38b('0x64')](')'));var _0x3a03f7=_0x425df0[0x1];channels[_0x282b2d[_0xa38b('0x9')]][_0x8945ee]=_0x3a03f7;}if(!_[_0xa38b('0x65')](['hangup',_0xa38b('0x66'),_0xa38b('0x67'),_0xa38b('0x60'),_0xa38b('0x68')],_0x282b2d[_0xa38b('0x5d')][_0xa38b('0x5f')]())){channels[_0x282b2d['uniqueid']][_0xa38b('0x51')]=_0x282b2d[_0xa38b('0x5d')];channels[_0x282b2d[_0xa38b('0x9')]][_0xa38b('0x53')]=_0x282b2d[_0xa38b('0x5e')];}}}catch(_0x145671){utils[_0xa38b('0x1e')](util[_0xa38b('0x7')]('[%s][calls][newexten]',_0x282b2d[_0xa38b('0x9')]),_0x145671);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index b297275..61ffcfe 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 _0xa110=['fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','[core]\x20connected','info','[core]\x20shutdown'];(function(_0x290a56,_0x5c540a){var _0x89610=function(_0x4e901f){while(--_0x4e901f){_0x290a56['push'](_0x290a56['shift']());}};_0x89610(++_0x5c540a);}(_0xa110,0x19e));var _0x0a11=function(_0x5260b2,_0x1d6180){_0x5260b2=_0x5260b2-0x0;var _0x3a586b=_0xa110[_0x5260b2];return _0x3a586b;};'use strict';var utils=require(_0x0a11('0x0'));exports['connect']=function(){utils['info'](_0x0a11('0x1'));};exports['shutdown']=function(){utils[_0x0a11('0x2')](_0x0a11('0x3'));};exports[_0x0a11('0x4')]=function(){utils[_0x0a11('0x2')](_0x0a11('0x5'));};exports['error']=function(_0x2c14e8){utils[_0x0a11('0x6')](_0x0a11('0x7'),_0x2c14e8);};exports[_0x0a11('0x8')]=function(){utils[_0x0a11('0x2')](_0x0a11('0x9'));};exports[_0x0a11('0xa')]=function(_0x16d1a2){}; \ No newline at end of file +var _0xbdc2=['connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','[core]\x20fullybooted','[core]\x20error','close','[core]\x20close','managerevent','./utils'];(function(_0x3e1cc0,_0x9749c5){var _0x372ee1=function(_0x492d4f){while(--_0x492d4f){_0x3e1cc0['push'](_0x3e1cc0['shift']());}};_0x372ee1(++_0x9749c5);}(_0xbdc2,0xba));var _0x2bdc=function(_0x5c9939,_0x5f1deb){_0x5c9939=_0x5c9939-0x0;var _0x6ce458=_0xbdc2[_0x5c9939];return _0x6ce458;};'use strict';var utils=require(_0x2bdc('0x0'));exports[_0x2bdc('0x1')]=function(){utils[_0x2bdc('0x2')](_0x2bdc('0x3'));};exports[_0x2bdc('0x4')]=function(){utils[_0x2bdc('0x2')](_0x2bdc('0x5'));};exports['fullybooted']=function(){utils['info'](_0x2bdc('0x6'));};exports['error']=function(_0x14c814){utils['error'](_0x2bdc('0x7'),_0x14c814);};exports[_0x2bdc('0x8')]=function(){utils['info'](_0x2bdc('0x9'));};exports[_0x2bdc('0xa')]=function(_0x1f7093){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 63da4e8..f71ae23 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 _0xb1a3=['[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','toLowerCase','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','endtime','holdtime','billableseconds','util','info','format','uniqueid','dialstring','calleridnum','request','CreateVoiceDialReport','debug','[%s][dials][newexten]'];(function(_0x53de3a,_0x349a45){var _0x54fd22=function(_0x3188d6){while(--_0x3188d6){_0x53de3a['push'](_0x53de3a['shift']());}};_0x54fd22(++_0x349a45);}(_0xb1a3,0x1c1));var _0x3b1a=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xb1a3[_0x4b2863];return _0x567d67;};'use strict';var _=require('lodash');var util=require(_0x3b1a('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x26943d){utils[_0x3b1a('0x1')](util[_0x3b1a('0x2')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x26943d[_0x3b1a('0x3')],_0x26943d['channel'],_0x26943d[_0x3b1a('0x4')],_0x26943d[_0x3b1a('0x5')],_0x26943d['connectedlinenum'],_0x26943d['dialstatus']));utils[_0x3b1a('0x6')](_0x3b1a('0x7'),_0x26943d);delete dials[_0x26943d[_0x3b1a('0x3')]];}exports['newexten']=function(_0x3ffa9c){try{utils[_0x3b1a('0x8')](util[_0x3b1a('0x2')](_0x3b1a('0x9'),_0x3ffa9c[_0x3b1a('0x3')]),_0x3ffa9c);utils['info'](util[_0x3b1a('0x2')](_0x3b1a('0xa'),_0x3ffa9c[_0x3b1a('0x3')],_0x3ffa9c['application'],_0x3ffa9c[_0x3b1a('0xb')]));if(_0x3ffa9c[_0x3b1a('0xc')]['toLowerCase']()==_0x3b1a('0xd')&&_[_0x3b1a('0xe')](_0x3ffa9c[_0x3b1a('0xb')][_0x3b1a('0xf')](),_0x3b1a('0x10'))){var _0x2afc24=_0x3ffa9c[_0x3b1a('0xb')][_0x3b1a('0x11')]('=');dials[_0x3ffa9c[_0x3b1a('0x3')]]={'routeId':_0x2afc24[0x1]};}}catch(_0x4fe7d8){utils[_0x3b1a('0x12')](util[_0x3b1a('0x2')]('[%s][dials][newexten]',_0x3ffa9c['uniqueid']),_0x4fe7d8);}};exports[_0x3b1a('0x13')]=function(_0x223463){try{utils['debug'](util[_0x3b1a('0x2')](_0x3b1a('0x14'),_0x223463['uniqueid']),_0x223463);if(!_[_0x3b1a('0x15')](_0x223463[_0x3b1a('0x16')][_0x3b1a('0x17')])){utils[_0x3b1a('0x1')](util['format'](_0x3b1a('0x18'),_0x223463[_0x3b1a('0x3')],_0x223463['value']));dials[_0x223463[_0x3b1a('0x3')]]={'routeId':_0x223463[_0x3b1a('0x19')]};}}catch(_0x12894e){utils['error'](util['format'](_0x3b1a('0x14'),_0x223463[_0x3b1a('0x3')]),_0x12894e);}};exports[_0x3b1a('0x1a')]=function(_0x519dc1){try{if(!_['isNil'](dials[_0x519dc1[_0x3b1a('0x3')]])){utils[_0x3b1a('0x8')](util[_0x3b1a('0x2')](_0x3b1a('0x1b'),_0x519dc1[_0x3b1a('0x3')]),_0x519dc1);dials[_0x519dc1[_0x3b1a('0x3')]]=_[_0x3b1a('0x1c')](dials[_0x519dc1[_0x3b1a('0x3')]],_0x519dc1);dials[_0x519dc1['uniqueid']][_0x3b1a('0x1d')]=utils[_0x3b1a('0x1e')]();dials[_0x519dc1['uniqueid']][_0x3b1a('0x1f')]='called';utils[_0x3b1a('0x1')](util['format'](_0x3b1a('0x20'),_0x519dc1[_0x3b1a('0x3')],dials[_0x519dc1[_0x3b1a('0x3')]][_0x3b1a('0x1d')]));}}catch(_0x279c17){utils[_0x3b1a('0x12')](util[_0x3b1a('0x2')](_0x3b1a('0x1b'),_0x519dc1['uniqueid']),_0x279c17);}};exports[_0x3b1a('0x21')]=function(_0xcee4f){try{if(!_[_0x3b1a('0x15')](dials[_0xcee4f[_0x3b1a('0x3')]])){utils[_0x3b1a('0x8')](util[_0x3b1a('0x2')](_0x3b1a('0x22'),_0xcee4f[_0x3b1a('0x3')]),_0xcee4f);dials[_0xcee4f[_0x3b1a('0x3')]]['dialstatus']=_0xcee4f[_0x3b1a('0x23')];if(_0xcee4f[_0x3b1a('0x23')]==_0x3b1a('0x24')){dials[_0xcee4f[_0x3b1a('0x3')]]=_['assign'](dials[_0xcee4f['uniqueid']],_0xcee4f);dials[_0xcee4f['uniqueid']][_0x3b1a('0x25')]=utils[_0x3b1a('0x1e')]();dials[_0xcee4f['uniqueid']][_0x3b1a('0x1f')]=_0x3b1a('0x26');utils[_0x3b1a('0x1')](util[_0x3b1a('0x2')](_0x3b1a('0x27'),_0xcee4f['uniqueid'],_0xcee4f[_0x3b1a('0x23')],dials[_0xcee4f['uniqueid']]['answertime']));}else{utils[_0x3b1a('0x1')](util[_0x3b1a('0x2')](_0x3b1a('0x28'),_0xcee4f[_0x3b1a('0x3')],_0xcee4f[_0x3b1a('0x23')]));}}}catch(_0x485d00){utils[_0x3b1a('0x12')](util[_0x3b1a('0x2')](_0x3b1a('0x22'),_0xcee4f[_0x3b1a('0x3')]),_0x485d00);}};exports[_0x3b1a('0x29')]=function(_0x2e71e6){try{if(!_[_0x3b1a('0x15')](dials[_0x2e71e6[_0x3b1a('0x3')]])){utils[_0x3b1a('0x8')](util['format'](_0x3b1a('0x2a'),_0x2e71e6[_0x3b1a('0x3')]),_0x2e71e6);utils[_0x3b1a('0x1')](util['format'](_0x3b1a('0x2b'),_0x2e71e6[_0x3b1a('0x3')],_0x2e71e6[_0x3b1a('0x5')],_0x2e71e6[_0x3b1a('0x2c')],_0x2e71e6[_0x3b1a('0x2d')]));dials[_0x2e71e6[_0x3b1a('0x3')]]=_['assign'](dials[_0x2e71e6[_0x3b1a('0x3')]],{'endtime':utils[_0x3b1a('0x1e')](),'lastevent':'complete'});dials[_0x2e71e6['uniqueid']][_0x3b1a('0x2e')]=utils[_0x3b1a('0x2f')](dials[_0x2e71e6[_0x3b1a('0x3')]][_0x3b1a('0x30')],dials[_0x2e71e6[_0x3b1a('0x3')]][_0x3b1a('0x1d')]);dials[_0x2e71e6['uniqueid']][_0x3b1a('0x31')]=utils['diffTime'](dials[_0x2e71e6[_0x3b1a('0x3')]][_0x3b1a('0x25')]||dials[_0x2e71e6[_0x3b1a('0x3')]][_0x3b1a('0x30')],dials[_0x2e71e6[_0x3b1a('0x3')]]['starttime']);dials[_0x2e71e6['uniqueid']][_0x3b1a('0x32')]=dials[_0x2e71e6[_0x3b1a('0x3')]]['answertime']?utils[_0x3b1a('0x2f')](dials[_0x2e71e6['uniqueid']][_0x3b1a('0x30')],dials[_0x2e71e6[_0x3b1a('0x3')]][_0x3b1a('0x25')]):0x0;writeDB(dials[_0x2e71e6[_0x3b1a('0x3')]]);}}catch(_0x560d97){utils[_0x3b1a('0x12')](util[_0x3b1a('0x2')](_0x3b1a('0x2a'),_0x2e71e6[_0x3b1a('0x3')]),_0x560d97);}}; \ No newline at end of file +var _0xaa10=['hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','holdtime','endtime','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','calleridnum','connectedlinenum','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','varset','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][varset]','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend','dialstatus','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]'];(function(_0x1bd17c,_0x4f5223){var _0x3c9562=function(_0x284812){while(--_0x284812){_0x1bd17c['push'](_0x1bd17c['shift']());}};_0x3c9562(++_0x4f5223);}(_0xaa10,0x1f4));var _0x0aa1=function(_0x506858,_0x44411c){_0x506858=_0x506858-0x0;var _0x313ad1=_0xaa10[_0x506858];return _0x313ad1;};'use strict';var _=require(_0x0aa1('0x0'));var util=require('util');var utils=require(_0x0aa1('0x1'));var dials={};function writeDB(_0x132b68){utils[_0x0aa1('0x2')](util[_0x0aa1('0x3')](_0x0aa1('0x4'),_0x132b68[_0x0aa1('0x5')],_0x132b68['channel'],_0x132b68['dialstring'],_0x132b68[_0x0aa1('0x6')],_0x132b68[_0x0aa1('0x7')],_0x132b68['dialstatus']));utils[_0x0aa1('0x8')](_0x0aa1('0x9'),_0x132b68);delete dials[_0x132b68[_0x0aa1('0x5')]];}exports[_0x0aa1('0xa')]=function(_0x1f8eed){try{utils[_0x0aa1('0xb')](util['format']('[%s][dials][newexten]',_0x1f8eed[_0x0aa1('0x5')]),_0x1f8eed);utils['info'](util[_0x0aa1('0x3')](_0x0aa1('0xc'),_0x1f8eed[_0x0aa1('0x5')],_0x1f8eed[_0x0aa1('0xd')],_0x1f8eed[_0x0aa1('0xe')]));if(_0x1f8eed[_0x0aa1('0xd')][_0x0aa1('0xf')]()==_0x0aa1('0x10')&&_[_0x0aa1('0x11')](_0x1f8eed['appdata'][_0x0aa1('0xf')](),'cdr(routeid)')){var _0x1cc13b=_0x1f8eed[_0x0aa1('0xe')][_0x0aa1('0x12')]('=');dials[_0x1f8eed['uniqueid']]={'routeId':_0x1cc13b[0x1]};}}catch(_0x348376){utils['error'](util[_0x0aa1('0x3')]('[%s][dials][newexten]',_0x1f8eed[_0x0aa1('0x5')]),_0x348376);}};exports[_0x0aa1('0x13')]=function(_0x317342){try{utils['debug'](util[_0x0aa1('0x3')]('[%s][dials][varset]',_0x317342[_0x0aa1('0x5')]),_0x317342);if(!_['isNil'](_0x317342[_0x0aa1('0x14')]['outboundrouteid'])){utils['info'](util[_0x0aa1('0x3')](_0x0aa1('0x15'),_0x317342[_0x0aa1('0x5')],_0x317342[_0x0aa1('0x16')]));dials[_0x317342[_0x0aa1('0x5')]]={'routeId':_0x317342['value']};}}catch(_0x17f564){utils[_0x0aa1('0x17')](util[_0x0aa1('0x3')](_0x0aa1('0x18'),_0x317342['uniqueid']),_0x17f564);}};exports['dialbegin']=function(_0x56cf05){try{if(!_[_0x0aa1('0x19')](dials[_0x56cf05[_0x0aa1('0x5')]])){utils[_0x0aa1('0xb')](util['format'](_0x0aa1('0x1a'),_0x56cf05['uniqueid']),_0x56cf05);dials[_0x56cf05[_0x0aa1('0x5')]]=_[_0x0aa1('0x1b')](dials[_0x56cf05['uniqueid']],_0x56cf05);dials[_0x56cf05[_0x0aa1('0x5')]][_0x0aa1('0x1c')]=utils[_0x0aa1('0x1d')]();dials[_0x56cf05[_0x0aa1('0x5')]][_0x0aa1('0x1e')]=_0x0aa1('0x1f');utils[_0x0aa1('0x2')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x56cf05['uniqueid'],dials[_0x56cf05[_0x0aa1('0x5')]][_0x0aa1('0x1c')]));}}catch(_0x3c7b76){utils['error'](util['format'](_0x0aa1('0x1a'),_0x56cf05[_0x0aa1('0x5')]),_0x3c7b76);}};exports[_0x0aa1('0x20')]=function(_0x4d00e1){try{if(!_['isNil'](dials[_0x4d00e1['uniqueid']])){utils[_0x0aa1('0xb')](util['format']('[%s][dials][dialend]',_0x4d00e1[_0x0aa1('0x5')]),_0x4d00e1);dials[_0x4d00e1['uniqueid']][_0x0aa1('0x21')]=_0x4d00e1[_0x0aa1('0x21')];if(_0x4d00e1[_0x0aa1('0x21')]==_0x0aa1('0x22')){dials[_0x4d00e1[_0x0aa1('0x5')]]=_[_0x0aa1('0x1b')](dials[_0x4d00e1[_0x0aa1('0x5')]],_0x4d00e1);dials[_0x4d00e1['uniqueid']][_0x0aa1('0x23')]=utils[_0x0aa1('0x1d')]();dials[_0x4d00e1[_0x0aa1('0x5')]][_0x0aa1('0x1e')]='connect';utils[_0x0aa1('0x2')](util[_0x0aa1('0x3')](_0x0aa1('0x24'),_0x4d00e1[_0x0aa1('0x5')],_0x4d00e1['dialstatus'],dials[_0x4d00e1[_0x0aa1('0x5')]]['answertime']));}else{utils['info'](util['format'](_0x0aa1('0x25'),_0x4d00e1[_0x0aa1('0x5')],_0x4d00e1[_0x0aa1('0x21')]));}}}catch(_0x14d243){utils[_0x0aa1('0x17')](util[_0x0aa1('0x3')](_0x0aa1('0x26'),_0x4d00e1[_0x0aa1('0x5')]),_0x14d243);}};exports[_0x0aa1('0x27')]=function(_0x22cb13){try{if(!_[_0x0aa1('0x19')](dials[_0x22cb13[_0x0aa1('0x5')]])){utils['debug'](util[_0x0aa1('0x3')](_0x0aa1('0x28'),_0x22cb13[_0x0aa1('0x5')]),_0x22cb13);utils['info'](util['format'](_0x0aa1('0x29'),_0x22cb13[_0x0aa1('0x5')],_0x22cb13[_0x0aa1('0x6')],_0x22cb13[_0x0aa1('0x2a')],_0x22cb13[_0x0aa1('0x2b')]));dials[_0x22cb13[_0x0aa1('0x5')]]=_['assign'](dials[_0x22cb13['uniqueid']],{'endtime':utils[_0x0aa1('0x1d')](),'lastevent':_0x0aa1('0x2c')});dials[_0x22cb13['uniqueid']][_0x0aa1('0x2d')]=utils[_0x0aa1('0x2e')](dials[_0x22cb13[_0x0aa1('0x5')]]['endtime'],dials[_0x22cb13[_0x0aa1('0x5')]][_0x0aa1('0x1c')]);dials[_0x22cb13[_0x0aa1('0x5')]][_0x0aa1('0x2f')]=utils[_0x0aa1('0x2e')](dials[_0x22cb13[_0x0aa1('0x5')]]['answertime']||dials[_0x22cb13[_0x0aa1('0x5')]][_0x0aa1('0x30')],dials[_0x22cb13[_0x0aa1('0x5')]]['starttime']);dials[_0x22cb13[_0x0aa1('0x5')]]['billableseconds']=dials[_0x22cb13[_0x0aa1('0x5')]][_0x0aa1('0x23')]?utils[_0x0aa1('0x2e')](dials[_0x22cb13[_0x0aa1('0x5')]][_0x0aa1('0x30')],dials[_0x22cb13[_0x0aa1('0x5')]]['answertime']):0x0;writeDB(dials[_0x22cb13[_0x0aa1('0x5')]]);}}catch(_0x4f95a8){utils[_0x0aa1('0x17')](util[_0x0aa1('0x3')](_0x0aa1('0x28'),_0x22cb13[_0x0aa1('0x5')]),_0x4f95a8);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 195adcf..8188914 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 _0x72ef=['[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr','disabled','production','local','asterisk','port','username','password','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./members.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten'];(function(_0xb3c85f,_0x421ec0){var _0x5f1fde=function(_0xbe8343){while(--_0xbe8343){_0xb3c85f['push'](_0xb3c85f['shift']());}};_0x5f1fde(++_0x421ec0);}(_0x72ef,0xd7));var _0xf72e=function(_0x5b2f5d,_0x5508c8){_0x5b2f5d=_0x5b2f5d-0x0;var _0x404043=_0x72ef[_0x5b2f5d];return _0x404043;};var AsteriskManager=require(_0xf72e('0x0'));var config=require(_0xf72e('0x1'));var utils=require('./utils');var util=require(_0xf72e('0x2'));var isXDREnabled=config[_0xf72e('0x3')]&&config[_0xf72e('0x3')][_0xf72e('0x4')]?!config[_0xf72e('0x3')][_0xf72e('0x4')]:!![];var isProduction=config['env']===_0xf72e('0x5')||![];var isLocalAsterisk=config[_0xf72e('0x3')]&&config[_0xf72e('0x3')][_0xf72e('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0xf72e('0x7')][_0xf72e('0x8')],config[_0xf72e('0x7')]['ip'],config[_0xf72e('0x7')][_0xf72e('0x9')],config[_0xf72e('0x7')][_0xf72e('0xa')],!![]);ami[_0xf72e('0xb')]();if(!isXDREnabled){utils['info'](_0xf72e('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xf72e('0xd')](_0xf72e('0xe'));}else{var agents=require(_0xf72e('0xf'));var calls=require(_0xf72e('0x10'));var queues=require(_0xf72e('0x11'));var recordings=require('./recordings.controller');var members=require(_0xf72e('0x12'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0xf72e('0x13'));ami['on'](_0xf72e('0x14'),core['connect']);ami['on'](_0xf72e('0x15'),core['shutdown']);ami['on'](_0xf72e('0x16'),core[_0xf72e('0x16')]);ami['on'](_0xf72e('0x17'),core[_0xf72e('0x17')]);ami['on'](_0xf72e('0x18'),core[_0xf72e('0x18')]);ami['on'](_0xf72e('0x19'),core[_0xf72e('0x19')]);ami['on'](_0xf72e('0x1a'),function(_0x2748b3){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x1d'),_0x2748b3['device']),_0x2748b3);members['devicestatechange'](_0x2748b3);}catch(_0x57d506){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x1d'),_0x2748b3[_0xf72e('0x1e')]),_0x57d506);}});ami['on'](_0xf72e('0x1f'),function(_0x3b4394){try{utils['debug'](util[_0xf72e('0x1c')](_0xf72e('0x20'),_0x3b4394[_0xf72e('0x21')]),_0x3b4394);agents[_0xf72e('0x1f')](_0x3b4394);}catch(_0x530a5d){utils['error'](util[_0xf72e('0x1c')](_0xf72e('0x20'),_0x3b4394[_0xf72e('0x21')]),_0x530a5d);}});ami['on'](_0xf72e('0x22'),function(_0x44e9fc){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x23'),_0x44e9fc['uniqueid']),_0x44e9fc);agents[_0xf72e('0x22')](_0x44e9fc);}catch(_0x1cc75f){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x23'),_0x44e9fc[_0xf72e('0x21')]),_0x1cc75f);}});ami['on'](_0xf72e('0x24'),function(_0x567046){try{utils[_0xf72e('0x1b')](util['format']('[%s][index][agentconnect]',_0x567046['uniqueid']),_0x567046);agents[_0xf72e('0x24')](_0x567046);queues[_0xf72e('0x24')](_0x567046);}catch(_0x6b0fd4){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')]('[%s][index][agentconnect]',_0x567046[_0xf72e('0x21')]),_0x6b0fd4);}});ami['on'](_0xf72e('0x25'),function(_0x234322){try{utils['debug'](util['format'](_0xf72e('0x26'),_0x234322['uniqueid']),_0x234322);agents[_0xf72e('0x25')](_0x234322);queues[_0xf72e('0x25')](_0x234322);members['agentcomplete'](_0x234322);}catch(_0x5374e9){utils['error'](util[_0xf72e('0x1c')](_0xf72e('0x26'),_0x234322[_0xf72e('0x21')]),_0x5374e9);}});ami['on'](_0xf72e('0x27'),function(_0x5cc0c6){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x28'),_0x5cc0c6[_0xf72e('0x21')]),_0x5cc0c6);agents[_0xf72e('0x27')](_0x5cc0c6);queues[_0xf72e('0x27')](_0x5cc0c6);}catch(_0x39e075){utils['error'](util[_0xf72e('0x1c')](_0xf72e('0x28'),_0x5cc0c6[_0xf72e('0x21')]),_0x39e075);}});ami['on'](_0xf72e('0x29'),function(_0x59cb3e){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x2a'),_0x59cb3e['uniqueid']),_0x59cb3e);queues[_0xf72e('0x29')](_0x59cb3e);recordings[_0xf72e('0x29')](_0x59cb3e);}catch(_0x712fa7){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')]('[%s][index][queuecallerjoin]',_0x59cb3e[_0xf72e('0x21')]),_0x712fa7);}});ami['on'](_0xf72e('0x2b'),function(_0xd4a95a){try{utils['debug'](util[_0xf72e('0x1c')](_0xf72e('0x2c'),_0xd4a95a[_0xf72e('0x21')]),_0xd4a95a);queues['queuecallerleave'](_0xd4a95a);}catch(_0x42adf1){utils[_0xf72e('0x17')](util['format']('[%s][index][queuecallerleave]',_0xd4a95a[_0xf72e('0x21')]),_0x42adf1);}});ami['on']('musiconholdstart',function(_0x50c75f){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x2d'),_0x50c75f[_0xf72e('0x21')]),_0x50c75f);queues['musiconholdstart'](_0x50c75f);calls['musiconholdstart'](_0x50c75f);}catch(_0x3a939d){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')]('[%s][index][musiconholdstart]',_0x50c75f[_0xf72e('0x21')]),_0x3a939d);}});ami['on'](_0xf72e('0x2e'),function(_0x161da2){try{utils['debug'](util[_0xf72e('0x1c')]('[%s][index][musiconholdstop]',_0x161da2['uniqueid']),_0x161da2);queues[_0xf72e('0x2e')](_0x161da2);calls['musiconholdstop'](_0x161da2);}catch(_0x472269){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x2f'),_0x161da2['uniqueid']),_0x472269);}});ami['on'](_0xf72e('0x30'),function(_0x2dd956){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x31'),_0x2dd956['uniqueid']),_0x2dd956);calls[_0xf72e('0x30')](_0x2dd956);recordings[_0xf72e('0x30')](_0x2dd956);}catch(_0xc5e94d){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')]('[%s][index][newstate]',_0x2dd956[_0xf72e('0x21')]),_0xc5e94d);}});ami['on'](_0xf72e('0x32'),function(_0xdb9da6){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')]('[%s][index][hangup]',_0xdb9da6['uniqueid']),_0xdb9da6);calls[_0xf72e('0x32')](_0xdb9da6);recordings['hangup'](_0xdb9da6);dials[_0xf72e('0x32')](_0xdb9da6);agents[_0xf72e('0x32')](_0xdb9da6);queues[_0xf72e('0x32')](_0xdb9da6);}catch(_0x48b2b8){utils['error'](util[_0xf72e('0x1c')]('[%s][index][hangup]',_0xdb9da6['uniqueid']),_0x48b2b8);}});ami['on'](_0xf72e('0x33'),function(_0x2d4c4c){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x34'),_0x2d4c4c[_0xf72e('0x21')]),_0x2d4c4c);members[_0xf72e('0x33')](_0x2d4c4c);}catch(_0x2956c1){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x34'),_0x2d4c4c['uniqueid']),_0x2956c1);}});ami['on'](_0xf72e('0x35'),function(_0x51e05c){try{utils['debug'](util['format']('[%s][index][blindtransfer]',_0x51e05c[_0xf72e('0x21')]),_0x51e05c);queues[_0xf72e('0x35')](_0x51e05c);agents[_0xf72e('0x35')](_0x51e05c);transfers['blindtransfer'](_0x51e05c);}catch(_0x30e65a){utils[_0xf72e('0x17')](util['format'](_0xf72e('0x36'),_0x51e05c[_0xf72e('0x21')]),_0x30e65a);}});ami['on'](_0xf72e('0x37'),function(_0x468d92){try{utils[_0xf72e('0x1b')](util['format'](_0xf72e('0x38'),_0x468d92[_0xf72e('0x39')]),_0x468d92);queues[_0xf72e('0x37')](_0x468d92);transfers[_0xf72e('0x37')](_0x468d92);agents[_0xf72e('0x37')](_0x468d92);calls[_0xf72e('0x37')](_0x468d92);}catch(_0x5753f1){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x38'),_0x468d92[_0xf72e('0x39')]),_0x5753f1);}});ami['on'](_0xf72e('0x3a'),function(_0x4a250d){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x3b'),_0x4a250d[_0xf72e('0x21')]),_0x4a250d);queues[_0xf72e('0x3a')](_0x4a250d);recordings[_0xf72e('0x3a')](_0x4a250d);calls['varset'](_0x4a250d);dials[_0xf72e('0x3a')](_0x4a250d);}catch(_0x3ccd70){utils['error'](util['format'](_0xf72e('0x3b'),_0x4a250d['uniqueid']),_0x3ccd70);}});ami['on']('newexten',function(_0x340957){try{utils[_0xf72e('0x1b')](util['format']('[%s][index][newexten]',_0x340957['uniqueid']),_0x340957);calls['newexten'](_0x340957);recordings[_0xf72e('0x3c')](_0x340957);dials[_0xf72e('0x3c')](_0x340957);}catch(_0x499067){utils[_0xf72e('0x17')](util['format'](_0xf72e('0x3d'),_0x340957[_0xf72e('0x21')]),_0x499067);}});ami['on'](_0xf72e('0x3e'),function(_0x181112){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x3f'),_0x181112[_0xf72e('0x21')]),_0x181112);calls[_0xf72e('0x3e')](_0x181112);recordings[_0xf72e('0x3e')](_0x181112);}catch(_0x4e1930){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x3f'),_0x181112[_0xf72e('0x21')]),_0x4e1930);}});ami['on'](_0xf72e('0x40'),function(_0x594b9f){try{utils['debug'](util[_0xf72e('0x1c')](_0xf72e('0x41'),_0x594b9f[_0xf72e('0x21')]),_0x594b9f);dials[_0xf72e('0x40')](_0x594b9f);}catch(_0x281604){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x42'),_0x594b9f[_0xf72e('0x21')]),_0x281604);}});ami['on'](_0xf72e('0x43'),function(_0x34c2ef){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')]('[%s][index][dialend]',_0x34c2ef[_0xf72e('0x21')]),_0x34c2ef);dials['dialend'](_0x34c2ef);}catch(_0x1961ac){utils['error'](util[_0xf72e('0x1c')](_0xf72e('0x44'),_0x34c2ef[_0xf72e('0x21')]),_0x1961ac);}});} \ No newline at end of file +var _0xf813=['device','devicestatechange','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','disabled','xdr','env','local','asterisk','port','username','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]'];(function(_0x1fd5fb,_0x409790){var _0x4eeb8c=function(_0x1f17ba){while(--_0x1f17ba){_0x1fd5fb['push'](_0x1fd5fb['shift']());}};_0x4eeb8c(++_0x409790);}(_0xf813,0xb6));var _0x3f81=function(_0x57baae,_0x4fbee0){_0x57baae=_0x57baae-0x0;var _0x33dde6=_0xf813[_0x57baae];return _0x33dde6;};var AsteriskManager=require(_0x3f81('0x0'));var config=require('../../config/environment');var utils=require(_0x3f81('0x1'));var util=require(_0x3f81('0x2'));var isXDREnabled=config['xdr']&&config['xdr'][_0x3f81('0x3')]?!config[_0x3f81('0x4')][_0x3f81('0x3')]:!![];var isProduction=config[_0x3f81('0x5')]==='production'||![];var isLocalAsterisk=config[_0x3f81('0x4')]&&config['xdr'][_0x3f81('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x3f81('0x7')][_0x3f81('0x8')],config[_0x3f81('0x7')]['ip'],config[_0x3f81('0x7')][_0x3f81('0x9')],config[_0x3f81('0x7')][_0x3f81('0xa')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x3f81('0xb')](_0x3f81('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x3f81('0xd'));}else{var agents=require(_0x3f81('0xe'));var calls=require('./calls.controller');var queues=require(_0x3f81('0xf'));var recordings=require(_0x3f81('0x10'));var members=require(_0x3f81('0x11'));var dials=require('./dials.controller');var transfers=require(_0x3f81('0x12'));var core=require('./core.controller');ami['on'](_0x3f81('0x13'),core[_0x3f81('0x13')]);ami['on'](_0x3f81('0x14'),core['shutdown']);ami['on']('fullybooted',core[_0x3f81('0x15')]);ami['on'](_0x3f81('0x16'),core[_0x3f81('0x16')]);ami['on'](_0x3f81('0x17'),core[_0x3f81('0x17')]);ami['on'](_0x3f81('0x18'),core[_0x3f81('0x18')]);ami['on']('devicestatechange',function(_0x5141ef){try{utils[_0x3f81('0x19')](util[_0x3f81('0x1a')](_0x3f81('0x1b'),_0x5141ef[_0x3f81('0x1c')]),_0x5141ef);members[_0x3f81('0x1d')](_0x5141ef);}catch(_0x2f1c2f){utils[_0x3f81('0x16')](util[_0x3f81('0x1a')](_0x3f81('0x1b'),_0x5141ef[_0x3f81('0x1c')]),_0x2f1c2f);}});ami['on'](_0x3f81('0x1e'),function(_0x461f12){try{utils[_0x3f81('0x19')](util[_0x3f81('0x1a')]('[%s][index][agentcalled]',_0x461f12['uniqueid']),_0x461f12);agents[_0x3f81('0x1e')](_0x461f12);}catch(_0x4543cb){utils['error'](util[_0x3f81('0x1a')](_0x3f81('0x1f'),_0x461f12[_0x3f81('0x20')]),_0x4543cb);}});ami['on']('agentringnoanswer',function(_0x19962b){try{utils[_0x3f81('0x19')](util['format'](_0x3f81('0x21'),_0x19962b[_0x3f81('0x20')]),_0x19962b);agents[_0x3f81('0x22')](_0x19962b);}catch(_0x3ec304){utils['error'](util[_0x3f81('0x1a')]('[%s][index][agentringnoanswer]',_0x19962b['uniqueid']),_0x3ec304);}});ami['on'](_0x3f81('0x23'),function(_0x237a3e){try{utils[_0x3f81('0x19')](util['format'](_0x3f81('0x24'),_0x237a3e[_0x3f81('0x20')]),_0x237a3e);agents[_0x3f81('0x23')](_0x237a3e);queues['agentconnect'](_0x237a3e);}catch(_0x40a428){utils['error'](util[_0x3f81('0x1a')](_0x3f81('0x24'),_0x237a3e['uniqueid']),_0x40a428);}});ami['on'](_0x3f81('0x25'),function(_0x2ed7d1){try{utils[_0x3f81('0x19')](util[_0x3f81('0x1a')](_0x3f81('0x26'),_0x2ed7d1[_0x3f81('0x20')]),_0x2ed7d1);agents['agentcomplete'](_0x2ed7d1);queues[_0x3f81('0x25')](_0x2ed7d1);members['agentcomplete'](_0x2ed7d1);}catch(_0x10038b){utils[_0x3f81('0x16')](util[_0x3f81('0x1a')]('[%s][index][agentcomplete]',_0x2ed7d1[_0x3f81('0x20')]),_0x10038b);}});ami['on'](_0x3f81('0x27'),function(_0x3c9114){try{utils[_0x3f81('0x19')](util['format'](_0x3f81('0x28'),_0x3c9114['uniqueid']),_0x3c9114);agents[_0x3f81('0x27')](_0x3c9114);queues[_0x3f81('0x27')](_0x3c9114);}catch(_0x56d179){utils[_0x3f81('0x16')](util[_0x3f81('0x1a')](_0x3f81('0x28'),_0x3c9114[_0x3f81('0x20')]),_0x56d179);}});ami['on'](_0x3f81('0x29'),function(_0x347dfe){try{utils[_0x3f81('0x19')](util[_0x3f81('0x1a')](_0x3f81('0x2a'),_0x347dfe['uniqueid']),_0x347dfe);queues[_0x3f81('0x29')](_0x347dfe);recordings[_0x3f81('0x29')](_0x347dfe);}catch(_0x15b22f){utils[_0x3f81('0x16')](util[_0x3f81('0x1a')](_0x3f81('0x2a'),_0x347dfe[_0x3f81('0x20')]),_0x15b22f);}});ami['on']('queuecallerleave',function(_0x3cc594){try{utils[_0x3f81('0x19')](util[_0x3f81('0x1a')](_0x3f81('0x2b'),_0x3cc594[_0x3f81('0x20')]),_0x3cc594);queues[_0x3f81('0x2c')](_0x3cc594);}catch(_0xc42695){utils[_0x3f81('0x16')](util[_0x3f81('0x1a')](_0x3f81('0x2b'),_0x3cc594[_0x3f81('0x20')]),_0xc42695);}});ami['on'](_0x3f81('0x2d'),function(_0x2ff011){try{utils[_0x3f81('0x19')](util[_0x3f81('0x1a')](_0x3f81('0x2e'),_0x2ff011['uniqueid']),_0x2ff011);queues[_0x3f81('0x2d')](_0x2ff011);calls[_0x3f81('0x2d')](_0x2ff011);}catch(_0x3ad50e){utils[_0x3f81('0x16')](util[_0x3f81('0x1a')]('[%s][index][musiconholdstart]',_0x2ff011[_0x3f81('0x20')]),_0x3ad50e);}});ami['on'](_0x3f81('0x2f'),function(_0x3f8477){try{utils[_0x3f81('0x19')](util[_0x3f81('0x1a')](_0x3f81('0x30'),_0x3f8477[_0x3f81('0x20')]),_0x3f8477);queues[_0x3f81('0x2f')](_0x3f8477);calls[_0x3f81('0x2f')](_0x3f8477);}catch(_0x17f9ba){utils['error'](util['format'](_0x3f81('0x30'),_0x3f8477[_0x3f81('0x20')]),_0x17f9ba);}});ami['on'](_0x3f81('0x31'),function(_0x2ebdf2){try{utils['debug'](util[_0x3f81('0x1a')](_0x3f81('0x32'),_0x2ebdf2[_0x3f81('0x20')]),_0x2ebdf2);calls[_0x3f81('0x31')](_0x2ebdf2);recordings['newstate'](_0x2ebdf2);}catch(_0x4bc547){utils[_0x3f81('0x16')](util[_0x3f81('0x1a')](_0x3f81('0x32'),_0x2ebdf2['uniqueid']),_0x4bc547);}});ami['on'](_0x3f81('0x33'),function(_0xe1f692){try{utils[_0x3f81('0x19')](util['format'](_0x3f81('0x34'),_0xe1f692[_0x3f81('0x20')]),_0xe1f692);calls[_0x3f81('0x33')](_0xe1f692);recordings[_0x3f81('0x33')](_0xe1f692);dials[_0x3f81('0x33')](_0xe1f692);agents[_0x3f81('0x33')](_0xe1f692);queues[_0x3f81('0x33')](_0xe1f692);}catch(_0x51902b){utils[_0x3f81('0x16')](util[_0x3f81('0x1a')](_0x3f81('0x34'),_0xe1f692[_0x3f81('0x20')]),_0x51902b);}});ami['on'](_0x3f81('0x35'),function(_0x4d9693){try{utils[_0x3f81('0x19')](util[_0x3f81('0x1a')]('[%s][index][cdr]',_0x4d9693[_0x3f81('0x20')]),_0x4d9693);members[_0x3f81('0x35')](_0x4d9693);}catch(_0x2e5fd4){utils[_0x3f81('0x16')](util[_0x3f81('0x1a')]('[%s][index][cdr]',_0x4d9693['uniqueid']),_0x2e5fd4);}});ami['on'](_0x3f81('0x36'),function(_0x32d711){try{utils[_0x3f81('0x19')](util[_0x3f81('0x1a')](_0x3f81('0x37'),_0x32d711[_0x3f81('0x20')]),_0x32d711);queues[_0x3f81('0x36')](_0x32d711);agents[_0x3f81('0x36')](_0x32d711);transfers[_0x3f81('0x36')](_0x32d711);}catch(_0x831fe5){utils[_0x3f81('0x16')](util['format'](_0x3f81('0x37'),_0x32d711[_0x3f81('0x20')]),_0x831fe5);}});ami['on'](_0x3f81('0x38'),function(_0xd1fa66){try{utils[_0x3f81('0x19')](util[_0x3f81('0x1a')](_0x3f81('0x39'),_0xd1fa66[_0x3f81('0x3a')]),_0xd1fa66);queues[_0x3f81('0x38')](_0xd1fa66);transfers[_0x3f81('0x38')](_0xd1fa66);agents['attendedtransfer'](_0xd1fa66);calls[_0x3f81('0x38')](_0xd1fa66);}catch(_0x234f12){utils[_0x3f81('0x16')](util[_0x3f81('0x1a')](_0x3f81('0x39'),_0xd1fa66[_0x3f81('0x3a')]),_0x234f12);}});ami['on'](_0x3f81('0x3b'),function(_0x1cc7d5){try{utils[_0x3f81('0x19')](util[_0x3f81('0x1a')](_0x3f81('0x3c'),_0x1cc7d5['uniqueid']),_0x1cc7d5);queues[_0x3f81('0x3b')](_0x1cc7d5);recordings[_0x3f81('0x3b')](_0x1cc7d5);calls['varset'](_0x1cc7d5);dials[_0x3f81('0x3b')](_0x1cc7d5);}catch(_0x5761c5){utils['error'](util[_0x3f81('0x1a')]('[%s][index][varset]',_0x1cc7d5[_0x3f81('0x20')]),_0x5761c5);}});ami['on']('newexten',function(_0x9e1ebf){try{utils['debug'](util[_0x3f81('0x1a')](_0x3f81('0x3d'),_0x9e1ebf['uniqueid']),_0x9e1ebf);calls[_0x3f81('0x3e')](_0x9e1ebf);recordings[_0x3f81('0x3e')](_0x9e1ebf);dials[_0x3f81('0x3e')](_0x9e1ebf);}catch(_0x2a0b47){utils[_0x3f81('0x16')](util[_0x3f81('0x1a')](_0x3f81('0x3d'),_0x9e1ebf[_0x3f81('0x20')]),_0x2a0b47);}});ami['on'](_0x3f81('0x3f'),function(_0x32e829){try{utils[_0x3f81('0x19')](util[_0x3f81('0x1a')](_0x3f81('0x40'),_0x32e829[_0x3f81('0x20')]),_0x32e829);calls['newchannel'](_0x32e829);recordings['newchannel'](_0x32e829);}catch(_0x504dd8){utils[_0x3f81('0x16')](util[_0x3f81('0x1a')](_0x3f81('0x40'),_0x32e829['uniqueid']),_0x504dd8);}});ami['on'](_0x3f81('0x41'),function(_0x283594){try{utils[_0x3f81('0x19')](util[_0x3f81('0x1a')](_0x3f81('0x42'),_0x283594[_0x3f81('0x20')]),_0x283594);dials['dialbegin'](_0x283594);}catch(_0x389a9f){utils['error'](util[_0x3f81('0x1a')](_0x3f81('0x43'),_0x283594['uniqueid']),_0x389a9f);}});ami['on'](_0x3f81('0x44'),function(_0x196048){try{utils[_0x3f81('0x19')](util['format'](_0x3f81('0x45'),_0x196048[_0x3f81('0x20')]),_0x196048);dials[_0x3f81('0x44')](_0x196048);}catch(_0xa5e398){utils[_0x3f81('0x16')](util[_0x3f81('0x1a')](_0x3f81('0x45'),_0x196048[_0x3f81('0x20')]),_0xa5e398);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index c5d3f2b..6b1b6de 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 _0x87e6=['then','membername','name','internal','request','getUserByName','split','CreateMemberReport','error','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','assign','data1','type','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','interface','getUserByInterface'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x87e6,0x1a3));var _0x687e=function(_0x16f0e3,_0x56a01b){_0x16f0e3=_0x16f0e3-0x0;var _0x22754f=_0x87e6[_0x16f0e3];return _0x22754f;};'use strict';var _=require(_0x687e('0x0'));var util=require(_0x687e('0x1'));var utils=require(_0x687e('0x2'));var members={};var exclude=[_0x687e('0x3'),_0x687e('0x4')];function writeDB(_0x2a99aa){utils[_0x687e('0x5')](util[_0x687e('0x6')](_0x687e('0x7'),_0x2a99aa[_0x687e('0x8')],_0x2a99aa['interface'],_0x2a99aa[_0x687e('0x9')],_0x2a99aa[_0x687e('0xa')],_0x2a99aa['membername'],_0x2a99aa['type']));if(_0x2a99aa[_0x687e('0xb')]){utils[_0x687e('0xc')](_0x2a99aa[_0x687e('0xb')])[_0x687e('0xd')](function(_0x38f752){if(_0x38f752){_0x2a99aa[_0x687e('0xe')]=_0x38f752[_0x687e('0xf')];_0x2a99aa[_0x687e('0x10')]=_0x38f752[_0x687e('0x10')];utils[_0x687e('0x11')]('CreateMemberReport',_0x2a99aa);}else{utils[_0x687e('0x12')](_0x2a99aa[_0x687e('0xb')][_0x687e('0x13')]('/')[0x1])[_0x687e('0xd')](function(_0x55a376){if(_0x55a376){_0x2a99aa[_0x687e('0xe')]=_0x55a376[_0x687e('0xf')];_0x2a99aa[_0x687e('0x10')]=_0x55a376[_0x687e('0x10')];utils[_0x687e('0x11')](_0x687e('0x14'),_0x2a99aa);}});}})['catch'](function(_0x47c41d){utils[_0x687e('0x15')](util['format']('[%s][members][writeDB]',_0x2a99aa[_0x687e('0x8')]),_0x47c41d);});}delete members[_0x2a99aa[_0x687e('0xb')]];}function startsWith(_0x22573d,_0x3ff85a){return _[_0x687e('0x16')](_0x22573d,function(_0x58001a){return _[_0x687e('0x17')](_0x3ff85a,_0x58001a);});}exports[_0x687e('0x18')]=function(_0x445942){try{utils[_0x687e('0x19')](util[_0x687e('0x6')](_0x687e('0x1a'),members[_0x445942[_0x687e('0x1b')]]?members[_0x445942[_0x687e('0x1b')]][_0x687e('0x8')]:_0x445942[_0x687e('0x1b')]),_0x445942);utils[_0x687e('0x5')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x445942[_0x687e('0x1b')]]?members[_0x445942[_0x687e('0x1b')]][_0x687e('0x8')]:_0x445942['device'],_0x445942['state'],_0x445942[_0x687e('0x1b')]));switch(_0x445942[_0x687e('0x1c')]){case _0x687e('0x1d'):case _0x687e('0x1e'):if(!startsWith(exclude,_0x445942['device'])){members[_0x445942[_0x687e('0x1b')]]={'channel':'voice','interface':_0x445942[_0x687e('0x1b')],'type':_0x687e('0x1f'),'enterAt':utils[_0x687e('0x20')](),'role':_0x687e('0x21')};}break;case _0x687e('0x22'):if(!_[_0x687e('0x23')](members[_0x445942[_0x687e('0x1b')]])){members[_0x445942[_0x687e('0x1b')]]['exitAt']=utils[_0x687e('0x20')]();members[_0x445942[_0x687e('0x1b')]][_0x687e('0x24')]=utils[_0x687e('0x25')](members[_0x445942[_0x687e('0x1b')]][_0x687e('0x26')],members[_0x445942[_0x687e('0x1b')]][_0x687e('0x27')]);if(members[_0x445942[_0x687e('0x1b')]][_0x687e('0x8')]){writeDB(members[_0x445942[_0x687e('0x1b')]]);}}break;default:break;}}catch(_0x5b99a3){utils['error'](util[_0x687e('0x6')]('[%s][members][devicestatechange]',members[_0x445942[_0x687e('0x1b')]]?members[_0x445942['device']]['uniqueid']:_0x445942['device']),_0x5b99a3);}};exports[_0x687e('0x28')]=function(_0x14c783){try{if(!_[_0x687e('0x23')](members[_0x14c783['interface']])){utils[_0x687e('0x19')](util[_0x687e('0x6')]('[%s][members][agentcomplete]',_0x14c783[_0x687e('0x8')]),_0x14c783);utils[_0x687e('0x5')](util[_0x687e('0x6')](_0x687e('0x29'),_0x14c783['uniqueid'],_0x14c783[_0x687e('0xb')],_0x14c783[_0x687e('0x2a')]));members[_0x14c783[_0x687e('0xb')]]=_['assign'](members[_0x14c783[_0x687e('0xb')]],{'data4':_0x14c783[_0x687e('0x2a')],'uniqueid':_0x14c783[_0x687e('0x8')]});}}catch(_0x4ace7a){utils[_0x687e('0x15')](util[_0x687e('0x6')](_0x687e('0x2b'),_0x14c783[_0x687e('0x8')]),_0x4ace7a);}};exports[_0x687e('0x2c')]=function(_0x57365b){try{utils['debug'](util[_0x687e('0x6')](_0x687e('0x2d'),_0x57365b[_0x687e('0x8')]),_0x57365b);if(_0x57365b[_0x687e('0x9')]){var _0x5ecc1c=_0x57365b[_0x687e('0x9')][_0x687e('0x13')]('-')[0x0];if(!_[_0x687e('0x23')](members[_0x5ecc1c])){members[_0x5ecc1c]=_[_0x687e('0x2e')](members[_0x5ecc1c],{'data1':members[_0x5ecc1c][_0x687e('0x2f')]||_0x57365b[_0x687e('0x30')],'data2':members[_0x5ecc1c][_0x687e('0xa')]||_0x57365b['source'],'data3':members[_0x5ecc1c][_0x687e('0x31')]||_0x57365b[_0x687e('0x32')],'uniqueid':members[_0x5ecc1c][_0x687e('0x8')]||_0x57365b[_0x687e('0x8')]});utils[_0x687e('0x5')](util[_0x687e('0x6')](_0x687e('0x33'),_0x57365b[_0x687e('0x8')],members[_0x5ecc1c][_0x687e('0x2f')],members[_0x5ecc1c][_0x687e('0xa')],members[_0x5ecc1c]['data3']));if(members[_0x5ecc1c][_0x687e('0x26')]){writeDB(members[_0x5ecc1c]);}}}if(_0x57365b[_0x687e('0x34')]){var _0x1b6800=_0x57365b[_0x687e('0x34')][_0x687e('0x13')]('-')[0x0];if(!_[_0x687e('0x23')](members[_0x1b6800])){members[_0x1b6800]=_[_0x687e('0x2e')](members[_0x1b6800],{'data1':members[_0x1b6800][_0x687e('0x2f')]||_0x57365b['type'],'data2':members[_0x1b6800][_0x687e('0xa')]||_0x57365b[_0x687e('0x35')],'data3':members[_0x1b6800][_0x687e('0x31')]||_0x57365b[_0x687e('0x32')],'uniqueid':members[_0x1b6800][_0x687e('0x8')]||_0x57365b[_0x687e('0x8')]});utils[_0x687e('0x5')](util[_0x687e('0x6')](_0x687e('0x33'),_0x57365b[_0x687e('0x8')],members[_0x1b6800]['data1'],members[_0x1b6800]['data2'],members[_0x1b6800][_0x687e('0x31')]));if(members[_0x1b6800][_0x687e('0x26')]){writeDB(members[_0x1b6800]);}}}}catch(_0x472545){utils[_0x687e('0x15')](util[_0x687e('0x6')](_0x687e('0x2d'),_0x57365b[_0x687e('0x8')]),_0x472545);}}; \ No newline at end of file +var _0x953e=['destinationchannel','split','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','then','name','internal','getUserByName','request','CreateMemberReport','catch','error','some','startsWith','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','data1','data2','source','data3','destination'];(function(_0x209b9e,_0x225070){var _0x51ea59=function(_0xf05dab){while(--_0xf05dab){_0x209b9e['push'](_0x209b9e['shift']());}};_0x51ea59(++_0x225070);}(_0x953e,0xc6));var _0xe953=function(_0x56f8ca,_0x1e2379){_0x56f8ca=_0x56f8ca-0x0;var _0x58740d=_0x953e[_0x56f8ca];return _0x58740d;};'use strict';var _=require(_0xe953('0x0'));var util=require(_0xe953('0x1'));var utils=require(_0xe953('0x2'));var members={};var exclude=[_0xe953('0x3'),_0xe953('0x4')];function writeDB(_0x4f2140){utils[_0xe953('0x5')](util[_0xe953('0x6')](_0xe953('0x7'),_0x4f2140[_0xe953('0x8')],_0x4f2140[_0xe953('0x9')],_0x4f2140[_0xe953('0xa')],_0x4f2140['data2'],_0x4f2140[_0xe953('0xb')],_0x4f2140[_0xe953('0xc')]));if(_0x4f2140[_0xe953('0x9')]){utils[_0xe953('0xd')](_0x4f2140[_0xe953('0x9')])[_0xe953('0xe')](function(_0x325cb4){if(_0x325cb4){_0x4f2140[_0xe953('0xb')]=_0x325cb4[_0xe953('0xf')];_0x4f2140[_0xe953('0x10')]=_0x325cb4[_0xe953('0x10')];utils['request']('CreateMemberReport',_0x4f2140);}else{utils[_0xe953('0x11')](_0x4f2140['interface']['split']('/')[0x1])[_0xe953('0xe')](function(_0x19e36e){if(_0x19e36e){_0x4f2140['membername']=_0x19e36e[_0xe953('0xf')];_0x4f2140[_0xe953('0x10')]=_0x19e36e[_0xe953('0x10')];utils[_0xe953('0x12')](_0xe953('0x13'),_0x4f2140);}});}})[_0xe953('0x14')](function(_0x33c14e){utils[_0xe953('0x15')](util[_0xe953('0x6')]('[%s][members][writeDB]',_0x4f2140[_0xe953('0x8')]),_0x33c14e);});}delete members[_0x4f2140[_0xe953('0x9')]];}function startsWith(_0x5c6af4,_0xfa4963){return _[_0xe953('0x16')](_0x5c6af4,function(_0x374cab){return _[_0xe953('0x17')](_0xfa4963,_0x374cab);});}exports['devicestatechange']=function(_0x3db6f5){try{utils[_0xe953('0x18')](util[_0xe953('0x6')]('[%s][members][devicestatechange]',members[_0x3db6f5[_0xe953('0x19')]]?members[_0x3db6f5[_0xe953('0x19')]][_0xe953('0x8')]:_0x3db6f5['device']),_0x3db6f5);utils['info'](util[_0xe953('0x6')](_0xe953('0x1a'),members[_0x3db6f5[_0xe953('0x19')]]?members[_0x3db6f5[_0xe953('0x19')]][_0xe953('0x8')]:_0x3db6f5[_0xe953('0x19')],_0x3db6f5[_0xe953('0x1b')],_0x3db6f5[_0xe953('0x19')]));switch(_0x3db6f5[_0xe953('0x1b')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x3db6f5[_0xe953('0x19')])){members[_0x3db6f5[_0xe953('0x19')]]={'channel':'voice','interface':_0x3db6f5[_0xe953('0x19')],'type':_0xe953('0x1c'),'enterAt':utils[_0xe953('0x1d')](),'role':_0xe953('0x1e')};}break;case _0xe953('0x1f'):if(!_[_0xe953('0x20')](members[_0x3db6f5[_0xe953('0x19')]])){members[_0x3db6f5[_0xe953('0x19')]][_0xe953('0x21')]=utils[_0xe953('0x1d')]();members[_0x3db6f5[_0xe953('0x19')]][_0xe953('0x22')]=utils[_0xe953('0x23')](members[_0x3db6f5[_0xe953('0x19')]]['exitAt'],members[_0x3db6f5[_0xe953('0x19')]][_0xe953('0x24')]);if(members[_0x3db6f5[_0xe953('0x19')]]['uniqueid']){writeDB(members[_0x3db6f5[_0xe953('0x19')]]);}}break;default:break;}}catch(_0x1f49a9){utils['error'](util['format']('[%s][members][devicestatechange]',members[_0x3db6f5[_0xe953('0x19')]]?members[_0x3db6f5[_0xe953('0x19')]][_0xe953('0x8')]:_0x3db6f5[_0xe953('0x19')]),_0x1f49a9);}};exports['agentcomplete']=function(_0x4b8ee5){try{if(!_[_0xe953('0x20')](members[_0x4b8ee5[_0xe953('0x9')]])){utils[_0xe953('0x18')](util[_0xe953('0x6')](_0xe953('0x25'),_0x4b8ee5[_0xe953('0x8')]),_0x4b8ee5);utils[_0xe953('0x5')](util[_0xe953('0x6')](_0xe953('0x26'),_0x4b8ee5[_0xe953('0x8')],_0x4b8ee5[_0xe953('0x9')],_0x4b8ee5[_0xe953('0x27')]));members[_0x4b8ee5[_0xe953('0x9')]]=_[_0xe953('0x28')](members[_0x4b8ee5[_0xe953('0x9')]],{'data4':_0x4b8ee5['queue'],'uniqueid':_0x4b8ee5[_0xe953('0x8')]});}}catch(_0x1e2105){utils[_0xe953('0x15')](util[_0xe953('0x6')]('[%s][members][agentcomplete]',_0x4b8ee5[_0xe953('0x8')]),_0x1e2105);}};exports['cdr']=function(_0x1d4a37){try{utils[_0xe953('0x18')](util[_0xe953('0x6')](_0xe953('0x29'),_0x1d4a37[_0xe953('0x8')]),_0x1d4a37);if(_0x1d4a37[_0xe953('0xa')]){var _0x2e06b=_0x1d4a37[_0xe953('0xa')]['split']('-')[0x0];if(!_[_0xe953('0x20')](members[_0x2e06b])){members[_0x2e06b]=_[_0xe953('0x28')](members[_0x2e06b],{'data1':members[_0x2e06b][_0xe953('0x2a')]||_0x1d4a37[_0xe953('0xc')],'data2':members[_0x2e06b][_0xe953('0x2b')]||_0x1d4a37[_0xe953('0x2c')],'data3':members[_0x2e06b][_0xe953('0x2d')]||_0x1d4a37[_0xe953('0x2e')],'uniqueid':members[_0x2e06b][_0xe953('0x8')]||_0x1d4a37['uniqueid']});utils[_0xe953('0x5')](util[_0xe953('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1d4a37['uniqueid'],members[_0x2e06b][_0xe953('0x2a')],members[_0x2e06b][_0xe953('0x2b')],members[_0x2e06b][_0xe953('0x2d')]));if(members[_0x2e06b][_0xe953('0x21')]){writeDB(members[_0x2e06b]);}}}if(_0x1d4a37['destinationchannel']){var _0xaf2893=_0x1d4a37[_0xe953('0x2f')][_0xe953('0x30')]('-')[0x0];if(!_[_0xe953('0x20')](members[_0xaf2893])){members[_0xaf2893]=_[_0xe953('0x28')](members[_0xaf2893],{'data1':members[_0xaf2893][_0xe953('0x2a')]||_0x1d4a37['type'],'data2':members[_0xaf2893]['data2']||_0x1d4a37['source'],'data3':members[_0xaf2893][_0xe953('0x2d')]||_0x1d4a37[_0xe953('0x2e')],'uniqueid':members[_0xaf2893][_0xe953('0x8')]||_0x1d4a37[_0xe953('0x8')]});utils[_0xe953('0x5')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1d4a37[_0xe953('0x8')],members[_0xaf2893]['data1'],members[_0xaf2893][_0xe953('0x2b')],members[_0xaf2893]['data3']));if(members[_0xaf2893]['exitAt']){writeDB(members[_0xaf2893]);}}}}catch(_0xe3df3d){utils[_0xe953('0x15')](util[_0xe953('0x6')](_0xe953('0x29'),_0x1d4a37[_0xe953('0x8')]),_0xe3df3d);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index cd83d0b..57ca854 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 _0x271d=['[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]','membername','destaccountcode','assigned','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfertype','ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','name','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s'];(function(_0x3773f0,_0x12c210){var _0x2d0414=function(_0x2902f0){while(--_0x2902f0){_0x3773f0['push'](_0x3773f0['shift']());}};_0x2d0414(++_0x12c210);}(_0x271d,0x10e));var _0xd271=function(_0x2cc16f,_0x2c9199){_0x2cc16f=_0x2cc16f-0x0;var _0xcceedb=_0x271d[_0x2cc16f];return _0xcceedb;};'use strict';var _=require(_0xd271('0x0'));var util=require('util');var utils=require(_0xd271('0x1'));var queues={};function writeDB(_0x26b1a1){utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x4'),_0x26b1a1[_0xd271('0x5')],_0x26b1a1[_0xd271('0x6')],_0x26b1a1[_0xd271('0x7')],_0x26b1a1['lastAssignedTo'],_0x26b1a1[_0xd271('0x8')],_0x26b1a1[_0xd271('0x9')],_0x26b1a1[_0xd271('0xa')]));if(_0x26b1a1['queue']){utils[_0xd271('0xb')](_0x26b1a1[_0xd271('0x7')])[_0xd271('0xc')](function(_0x2899f1){if(_0x2899f1){_0x26b1a1['type']=_0x2899f1[_0xd271('0xd')];}utils[_0xd271('0xe')](_0xd271('0xf'),_0x26b1a1);});}else{utils[_0xd271('0xe')](_0xd271('0xf'),_0x26b1a1);}if(_0x26b1a1[_0xd271('0x10')]){delete queues[_0x26b1a1[_0xd271('0x10')]];}else{delete queues[_0x26b1a1[_0xd271('0x5')]];}}exports[_0xd271('0x11')]=function(_0x313782){try{utils[_0xd271('0x12')](util[_0xd271('0x3')]('[%s][queues][queuecallerjoin]',_0x313782[_0xd271('0x5')]),_0x313782);utils[_0xd271('0x2')](util['format'](_0xd271('0x13'),_0x313782[_0xd271('0x5')],_0x313782[_0xd271('0x7')],_0x313782[_0xd271('0x14')]));queues[_0x313782['uniqueid']]=_[_0xd271('0x15')](_0x313782,{'originalposition':_0x313782[_0xd271('0x14')],'queuecallerjoinAt':utils[_0xd271('0x16')](),'mohtime':0x0});}catch(_0xee436a){utils[_0xd271('0x17')](util[_0xd271('0x3')](_0xd271('0x18'),_0x313782[_0xd271('0x5')]),_0xee436a);}};exports[_0xd271('0x19')]=function(_0x25e5d2){try{if(!_[_0xd271('0x1a')](queues[_0x25e5d2[_0xd271('0x5')]])){utils[_0xd271('0x12')](util[_0xd271('0x3')](_0xd271('0x1b'),_0x25e5d2['uniqueid']),_0x25e5d2);if(queues[_0x25e5d2[_0xd271('0x5')]]['queuecallerleaveAt']){if(!queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0x1c')]&&!queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0x1d')]){queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0x1e')]=!![];queues[_0x25e5d2[_0xd271('0x5')]]['queuecallercompleteAt']=utils[_0xd271('0x16')]();queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0xa')]=_0xd271('0x1f');}utils['info'](util[_0xd271('0x3')](_0xd271('0x20'),_0x25e5d2['uniqueid'],queues[_0x25e5d2[_0xd271('0x5')]]['name'],queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0xa')]));writeDB(queues[_0x25e5d2[_0xd271('0x5')]]);}else if(queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0x10')]){utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x21'),_0x25e5d2[_0xd271('0x5')],queues[_0x25e5d2[_0xd271('0x5')]]['name'],queues[_0x25e5d2[_0xd271('0x5')]]['transfereduniqueid']));queues[queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0x10')]]=queues[_0x25e5d2[_0xd271('0x5')]];queues[queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x25e5d2[_0xd271('0x5')]];}}}catch(_0x2c387a){utils['error'](util['format'](_0xd271('0x1b'),_0x25e5d2[_0xd271('0x5')]),_0x2c387a);}};exports[_0xd271('0x22')]=function(_0x1a5d2d){try{utils[_0xd271('0x12')](util['format'](_0xd271('0x23'),_0x1a5d2d[_0xd271('0x5')]),_0x1a5d2d);if(!_[_0xd271('0x1a')](_0x1a5d2d[_0xd271('0x24')][_0xd271('0x25')])&&_0x1a5d2d[_0xd271('0x26')][_0xd271('0x27')]()!==_0xd271('0x28')){if(!_[_0xd271('0x1a')](queues[_0x1a5d2d[_0xd271('0x5')]])){queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0x1c')]=![];queues[_0x1a5d2d[_0xd271('0x5')]]['queuecallerabandonAt']=null;queues[_0x1a5d2d['uniqueid']][_0xd271('0x1d')]=!![];queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0x29')]=utils[_0xd271('0x16')]();queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0xa')]=_0x1a5d2d[_0xd271('0x26')][_0xd271('0x27')]();utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x2a'),_0x1a5d2d[_0xd271('0x5')],queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0x2b')],_0x1a5d2d[_0xd271('0x26')],queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0xa')]));writeDB(queues[_0x1a5d2d[_0xd271('0x5')]]);}}else if(!_[_0xd271('0x1a')](_0x1a5d2d[_0xd271('0x24')][_0xd271('0x2c')])){if(!_['isNil'](queues[_0x1a5d2d[_0xd271('0x5')]])&&!queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0x1c')]){queues[_0x1a5d2d[_0xd271('0x5')]]['queuecallerabandon']=![];queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0x2d')]=null;queues[_0x1a5d2d[_0xd271('0x5')]]['queuecallerexit']=!![];queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0x29')]=utils[_0xd271('0x16')]();queues[_0x1a5d2d['uniqueid']][_0xd271('0xa')]=_0xd271('0x2e');utils['info'](util[_0xd271('0x3')](_0xd271('0x2f'),_0x1a5d2d['uniqueid'],queues[_0x1a5d2d['uniqueid']]['name'],_0x1a5d2d[_0xd271('0x26')],queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0xa')]));}}}catch(_0x36aa09){utils[_0xd271('0x17')](util[_0xd271('0x3')]('[%s][queues][varset]',_0x1a5d2d[_0xd271('0x5')]),_0x36aa09);}};exports['queuecallerabandon']=function(_0x17192d){try{if(!_[_0xd271('0x1a')](queues[_0x17192d[_0xd271('0x5')]])){utils[_0xd271('0x12')](util[_0xd271('0x3')](_0xd271('0x30'),_0x17192d['uniqueid']),_0x17192d);queues[_0x17192d[_0xd271('0x5')]][_0xd271('0x1d')]=![];queues[_0x17192d[_0xd271('0x5')]][_0xd271('0x29')]=null;queues[_0x17192d[_0xd271('0x5')]][_0xd271('0x1c')]=!![];queues[_0x17192d[_0xd271('0x5')]][_0xd271('0x2d')]=utils[_0xd271('0x16')]();queues[_0x17192d[_0xd271('0x5')]][_0xd271('0xa')]=_0xd271('0x31');utils['info'](util[_0xd271('0x3')](_0xd271('0x32'),_0x17192d[_0xd271('0x5')],queues[_0x17192d[_0xd271('0x5')]]['name'],queues[_0x17192d['uniqueid']]['queuecallerexitreason']));}}catch(_0x56d8c2){utils['error'](util[_0xd271('0x3')](_0xd271('0x30'),_0x17192d[_0xd271('0x5')]),_0x56d8c2);}};exports[_0xd271('0x33')]=function(_0x5a8593){try{if(!_[_0xd271('0x1a')](queues[_0x5a8593[_0xd271('0x5')]])){utils['debug'](util[_0xd271('0x3')](_0xd271('0x34'),_0x5a8593[_0xd271('0x5')]),_0x5a8593);utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x35'),_0x5a8593[_0xd271('0x5')],queues[_0x5a8593[_0xd271('0x5')]]['name'],_0x5a8593[_0xd271('0x36')],_0x5a8593[_0xd271('0x37')]));queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x33')]=!![];queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x38')]=utils[_0xd271('0x16')]();queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x39')]=utils[_0xd271('0x3a')](queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x38')],queues[_0x5a8593['uniqueid']][_0xd271('0x3b')]);queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x14')]=_0x5a8593[_0xd271('0x14')];queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x3c')]=_0x5a8593['count'];queues[_0x5a8593[_0xd271('0x5')]]['connectedlinenum']=_0x5a8593[_0xd271('0x36')];queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x37')]=_0x5a8593[_0xd271('0x37')];}}catch(_0xe127b7){utils[_0xd271('0x17')](util[_0xd271('0x3')](_0xd271('0x34'),_0x5a8593[_0xd271('0x5')]),_0xe127b7);}};exports['agentconnect']=function(_0x1a5973){try{if(!_[_0xd271('0x1a')](queues[_0x1a5973[_0xd271('0x5')]])){utils['debug'](util[_0xd271('0x3')](_0xd271('0x3d'),_0x1a5973[_0xd271('0x5')]),_0x1a5973);utils[_0xd271('0x2')](util[_0xd271('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x1a5973[_0xd271('0x5')],queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0x2b')],_0x1a5973[_0xd271('0x3e')],_0x1a5973[_0xd271('0x3f')]));queues[_0x1a5973[_0xd271('0x5')]]['queuecallerabandon']=![];queues[_0x1a5973['uniqueid']][_0xd271('0x1c')]=![];queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0x2d')]=null;queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0x1d')]=![];queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0xa')]=null;queues[_0x1a5973['uniqueid']][_0xd271('0x29')]=null;queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0x40')]=!![];queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0x9')]=_0x1a5973[_0xd271('0x3f')];queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0x41')]=_0x1a5973[_0xd271('0x3e')];}}catch(_0x3289bd){utils[_0xd271('0x17')](util['format'](_0xd271('0x3d'),_0x1a5973[_0xd271('0x5')]),_0x3289bd);}};exports[_0xd271('0x42')]=function(_0x3e14e8){try{if(!_[_0xd271('0x1a')](queues[_0x3e14e8[_0xd271('0x5')]])){if(queues[_0x3e14e8[_0xd271('0x5')]]['queuecallerleaveAt']){utils['debug'](util[_0xd271('0x3')](_0xd271('0x43'),_0x3e14e8[_0xd271('0x5')]),_0x3e14e8);queues[_0x3e14e8[_0xd271('0x5')]][_0xd271('0x1c')]=![];queues[_0x3e14e8[_0xd271('0x5')]]['queuecallerabandon']=![];queues[_0x3e14e8[_0xd271('0x5')]]['queuecallerabandonAt']=null;queues[_0x3e14e8[_0xd271('0x5')]]['queuecallerexit']=![];queues[_0x3e14e8['uniqueid']][_0xd271('0x29')]=null;queues[_0x3e14e8[_0xd271('0x5')]]['assigned']=!![];queues[_0x3e14e8['uniqueid']][_0xd271('0x41')]=_0x3e14e8[_0xd271('0x3e')];queues[_0x3e14e8[_0xd271('0x5')]][_0xd271('0x1e')]=!![];queues[_0x3e14e8[_0xd271('0x5')]][_0xd271('0x44')]=utils['now']();if(_0x3e14e8[_0xd271('0x45')]==_0xd271('0x46')){if(!queues[_0x3e14e8[_0xd271('0x5')]][_0xd271('0x46')]){queues[_0x3e14e8[_0xd271('0x5')]]['queuecallerexitreason']=_0xd271('0x47');}}else{queues[_0x3e14e8[_0xd271('0x5')]][_0xd271('0xa')]=_0xd271('0x48')+_0x3e14e8[_0xd271('0x45')][_0xd271('0x27')]();}utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x49'),_0x3e14e8[_0xd271('0x5')],queues[_0x3e14e8['uniqueid']][_0xd271('0x2b')],_0x3e14e8[_0xd271('0x3e')],queues[_0x3e14e8['uniqueid']][_0xd271('0xa')]));writeDB(queues[_0x3e14e8['uniqueid']]);}}}catch(_0x110047){utils[_0xd271('0x17')](util[_0xd271('0x3')]('[%s][queues][agentcomplete]',_0x3e14e8[_0xd271('0x5')]),_0x110047);}};exports[_0xd271('0x4a')]=function(_0x1856d2){try{if(!_[_0xd271('0x1a')](queues[_0x1856d2[_0xd271('0x4b')]])){utils['debug'](util[_0xd271('0x3')]('[%s][queues][blindtransfer]',_0x1856d2[_0xd271('0x5')]),_0x1856d2);queues[_0x1856d2[_0xd271('0x4b')]][_0xd271('0x46')]=!![];queues[_0x1856d2['transfereeuniqueid']]['transfertype']='BLIND';queues[_0x1856d2[_0xd271('0x4b')]]['transferexten']=_0x1856d2[_0xd271('0x4c')];queues[_0x1856d2['transfereeuniqueid']][_0xd271('0x4d')]=_0x1856d2[_0xd271('0x4b')];queues[_0x1856d2[_0xd271('0x4b')]][_0xd271('0xa')]=_0xd271('0x4e');utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x4f'),_0x1856d2['uniqueid'],queues[_0x1856d2['transfereeuniqueid']][_0xd271('0x2b')],_0x1856d2['transfereeuniqueid'],_0x1856d2[_0xd271('0x4c')]));}}catch(_0x309ffc){utils['error'](util['format']('[%s][queues][blindtransfer]',_0x1856d2[_0xd271('0x5')]),_0x309ffc);}};exports[_0xd271('0x50')]=function(_0x136226){try{utils[_0xd271('0x12')](util[_0xd271('0x3')](_0xd271('0x51'),_0x136226['origtransfereruniqueid']),_0x136226);if(_0x136226[_0xd271('0x52')]==_0x136226[_0xd271('0x53')]){if(!_[_0xd271('0x1a')](queues[_0x136226[_0xd271('0x54')]])){utils[_0xd271('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x136226[_0xd271('0x52')],queues[_0x136226[_0xd271('0x54')]][_0xd271('0x2b')],_0x136226[_0xd271('0x55')]));queues[_0x136226['secondtransfererlinkedid']][_0xd271('0x46')]=!![];queues[_0x136226[_0xd271('0x54')]][_0xd271('0x56')]=_0xd271('0x57');queues[_0x136226[_0xd271('0x54')]][_0xd271('0x58')]=_0x136226[_0xd271('0x55')];queues[_0x136226['secondtransfererlinkedid']][_0xd271('0x4d')]=_0x136226[_0xd271('0x52')];queues[_0x136226[_0xd271('0x54')]][_0xd271('0xa')]=_0xd271('0x59');}if(!_[_0xd271('0x1a')](queues[_0x136226[_0xd271('0x53')]])){if(_0x136226[_0xd271('0x5a')]&&queues[_0x136226[_0xd271('0x5a')]]){queues[_0x136226['transfereelinkedid']][_0xd271('0x5b')]=0x1;queues[_0x136226['transfereeuniqueid']]=_['clone'](queues[_0x136226[_0xd271('0x5a')]]);queues[_0x136226['transfereeuniqueid']][_0xd271('0x10')]=_0x136226[_0xd271('0x5c')];queues[_0x136226[_0xd271('0x4b')]][_0xd271('0x5b')]=0x2;queues[_0x136226[_0xd271('0x4b')]]['calleridnum']=queues[_0x136226[_0xd271('0x54')]][_0xd271('0x8')];queues[_0x136226['transfereeuniqueid']]['calleridname']=queues[_0x136226[_0xd271('0x54')]][_0xd271('0x5d')];queues[_0x136226['transfereeuniqueid']][_0xd271('0x3b')]=utils[_0xd271('0x16')]();queues[_0x136226['transfereeuniqueid']][_0xd271('0x38')]=utils[_0xd271('0x16')]();queues[_0x136226[_0xd271('0x4b')]][_0xd271('0x39')]=0x0;queues[_0x136226[_0xd271('0x4b')]][_0xd271('0x5e')]=0x0;utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x5f'),_0x136226['origtransfereruniqueid'],queues[_0x136226['transfereeuniqueid']][_0xd271('0x2b')],queues[_0x136226[_0xd271('0x4b')]]['calleridnum'],queues[_0x136226[_0xd271('0x4b')]][_0xd271('0x5d')]));}else{utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x60'),_0x136226['origtransfereruniqueid'],queues[_0x136226[_0xd271('0x53')]][_0xd271('0x2b')],_0x136226['secondtransfererlinkedid']));queues[_0x136226[_0xd271('0x53')]][_0xd271('0x10')]=_0x136226['secondtransfererlinkedid'];}}}else if(_0x136226[_0xd271('0x61')]==_0x136226['secondtransfererlinkedid']){if(!_[_0xd271('0x1a')](queues[_0x136226[_0xd271('0x53')]])){utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x62'),_0x136226[_0xd271('0x52')],queues[_0x136226[_0xd271('0x53')]][_0xd271('0x2b')],_0x136226[_0xd271('0x61')],_0x136226[_0xd271('0x63')]));queues[_0x136226[_0xd271('0x53')]][_0xd271('0x46')]=!![];queues[_0x136226[_0xd271('0x53')]][_0xd271('0x56')]=_0xd271('0x57');queues[_0x136226[_0xd271('0x53')]][_0xd271('0x58')]=_0x136226['secondtransfererexten'];queues[_0x136226[_0xd271('0x53')]][_0xd271('0x4d')]=_0x136226[_0xd271('0x61')];queues[_0x136226['origtransfererlinkedid']][_0xd271('0xa')]=_0xd271('0x59');}if(!_[_0xd271('0x1a')](queues[_0x136226['secondtransfererlinkedid']])){if(_0x136226['transfertargetlinkedid']&&queues[_0x136226[_0xd271('0x64')]]){queues[_0x136226['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x136226['transfertargetuniqueid']]=_['clone'](queues[_0x136226[_0xd271('0x64')]]);queues[_0x136226[_0xd271('0x5c')]]['transfereduniqueid']=_0x136226[_0xd271('0x5c')];queues[_0x136226[_0xd271('0x5c')]][_0xd271('0x5b')]=0x2;queues[_0x136226[_0xd271('0x5c')]]['calleridnum']=queues[_0x136226[_0xd271('0x53')]][_0xd271('0x8')];queues[_0x136226[_0xd271('0x5c')]][_0xd271('0x5d')]=queues[_0x136226[_0xd271('0x53')]][_0xd271('0x5d')];queues[_0x136226[_0xd271('0x5c')]]['queuecallerjoinAt']=utils[_0xd271('0x16')]();queues[_0x136226['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xd271('0x16')]();queues[_0x136226[_0xd271('0x5c')]][_0xd271('0x39')]=0x0;queues[_0x136226['transfertargetuniqueid']][_0xd271('0x5e')]=0x0;utils['info'](util[_0xd271('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x136226['origtransfereruniqueid'],queues[_0x136226[_0xd271('0x5c')]][_0xd271('0x2b')],queues[_0x136226['transfertargetuniqueid']][_0xd271('0x10')],queues[_0x136226[_0xd271('0x5c')]][_0xd271('0x8')],queues[_0x136226[_0xd271('0x5c')]][_0xd271('0x5d')]));}else{utils[_0xd271('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x136226[_0xd271('0x52')],queues[_0x136226[_0xd271('0x54')]]['name'],_0x136226[_0xd271('0x53')]));queues[_0x136226[_0xd271('0x54')]][_0xd271('0x10')]=_0x136226[_0xd271('0x53')];}}}}catch(_0x7e10a6){utils[_0xd271('0x17')](util['format']('[%s][queues][attendedtransfer]',_0x136226[_0xd271('0x52')]),_0x7e10a6);}};exports[_0xd271('0x65')]=function(_0x242664){try{if(!_['isNil'](queues[_0x242664['uniqueid']])){utils[_0xd271('0x12')](util['format'](_0xd271('0x66'),_0x242664['uniqueid']),_0x242664);queues[_0x242664[_0xd271('0x5')]][_0xd271('0x67')]=utils[_0xd271('0x16')]();utils[_0xd271('0x2')](util[_0xd271('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x242664['uniqueid'],queues[_0x242664[_0xd271('0x5')]][_0xd271('0x2b')],queues[_0x242664[_0xd271('0x5')]]['musiconholdstartAt']));}}catch(_0x188185){utils[_0xd271('0x17')](util[_0xd271('0x3')](_0xd271('0x66'),_0x242664['uniqueid']),_0x188185);}};exports[_0xd271('0x68')]=function(_0x38c4af){try{if(!_[_0xd271('0x1a')](queues[_0x38c4af[_0xd271('0x5')]])){if(!_['isNil'](queues[_0x38c4af['uniqueid']][_0xd271('0x67')])){utils[_0xd271('0x12')](util[_0xd271('0x3')](_0xd271('0x69'),_0x38c4af['uniqueid']),_0x38c4af);queues[_0x38c4af[_0xd271('0x5')]]['mohtime']+=utils[_0xd271('0x3a')](utils[_0xd271('0x16')](),queues[_0x38c4af[_0xd271('0x5')]]['musiconholdstartAt']);utils[_0xd271('0x2')](util[_0xd271('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x38c4af['uniqueid'],queues[_0x38c4af[_0xd271('0x5')]][_0xd271('0x2b')],queues[_0x38c4af[_0xd271('0x5')]]['mohtime']));delete queues[_0x38c4af[_0xd271('0x5')]][_0xd271('0x67')];}}}catch(_0x25054c){utils[_0xd271('0x17')](util[_0xd271('0x3')](_0xd271('0x69'),_0x38c4af[_0xd271('0x5')]),_0x25054c);}}; \ No newline at end of file +var _0xbc6e=['calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','hangup','isNil','queuecallerexit','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','[%s][queues][hangup]','varset','variable','value','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','membername','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferexten','transfereelinkedid','clone'];(function(_0x44c3fd,_0x1136c3){var _0xfb251=function(_0x163031){while(--_0x163031){_0x44c3fd['push'](_0x44c3fd['shift']());}};_0xfb251(++_0x1136c3);}(_0xbc6e,0x1b7));var _0xebc6=function(_0x3e6bec,_0x37a2ca){_0x3e6bec=_0x3e6bec-0x0;var _0x52ff29=_0xbc6e[_0x3e6bec];return _0x52ff29;};'use strict';var _=require(_0xebc6('0x0'));var util=require('util');var utils=require(_0xebc6('0x1'));var queues={};function writeDB(_0x2ec502){utils[_0xebc6('0x2')](util[_0xebc6('0x3')](_0xebc6('0x4'),_0x2ec502[_0xebc6('0x5')],_0x2ec502[_0xebc6('0x6')],_0x2ec502[_0xebc6('0x7')],_0x2ec502[_0xebc6('0x8')],_0x2ec502[_0xebc6('0x9')],_0x2ec502[_0xebc6('0xa')],_0x2ec502['queuecallerexitreason']));if(_0x2ec502[_0xebc6('0x7')]){utils[_0xebc6('0xb')](_0x2ec502[_0xebc6('0x7')])['then'](function(_0x18c35f){if(_0x18c35f){_0x2ec502[_0xebc6('0xc')]=_0x18c35f[_0xebc6('0xc')];}utils['request'](_0xebc6('0xd'),_0x2ec502);});}else{utils[_0xebc6('0xe')](_0xebc6('0xd'),_0x2ec502);}if(_0x2ec502[_0xebc6('0xf')]){delete queues[_0x2ec502[_0xebc6('0xf')]];}else{delete queues[_0x2ec502['uniqueid']];}}exports[_0xebc6('0x10')]=function(_0x16c599){try{utils[_0xebc6('0x11')](util[_0xebc6('0x3')](_0xebc6('0x12'),_0x16c599[_0xebc6('0x5')]),_0x16c599);utils[_0xebc6('0x2')](util['format'](_0xebc6('0x13'),_0x16c599[_0xebc6('0x5')],_0x16c599[_0xebc6('0x7')],_0x16c599[_0xebc6('0x14')]));queues[_0x16c599['uniqueid']]=_[_0xebc6('0x15')](_0x16c599,{'originalposition':_0x16c599[_0xebc6('0x14')],'queuecallerjoinAt':utils[_0xebc6('0x16')](),'mohtime':0x0});}catch(_0x538e29){utils['error'](util['format']('[%s][queues][queuecallerjoin]',_0x16c599[_0xebc6('0x5')]),_0x538e29);}};exports[_0xebc6('0x17')]=function(_0x25a119){try{if(!_[_0xebc6('0x18')](queues[_0x25a119[_0xebc6('0x5')]])){utils[_0xebc6('0x11')](util[_0xebc6('0x3')]('[%s][queues][hangup]',_0x25a119['uniqueid']),_0x25a119);if(queues[_0x25a119[_0xebc6('0x5')]]['queuecallerleaveAt']){if(!queues[_0x25a119[_0xebc6('0x5')]]['queuecallerabandon']&&!queues[_0x25a119['uniqueid']][_0xebc6('0x19')]){queues[_0x25a119[_0xebc6('0x5')]]['queuecallercomplete']=!![];queues[_0x25a119[_0xebc6('0x5')]][_0xebc6('0x1a')]=utils[_0xebc6('0x16')]();queues[_0x25a119[_0xebc6('0x5')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils['info'](util['format'](_0xebc6('0x1b'),_0x25a119[_0xebc6('0x5')],queues[_0x25a119[_0xebc6('0x5')]][_0xebc6('0x1c')],queues[_0x25a119[_0xebc6('0x5')]][_0xebc6('0x1d')]));writeDB(queues[_0x25a119['uniqueid']]);}else if(queues[_0x25a119[_0xebc6('0x5')]][_0xebc6('0xf')]){utils[_0xebc6('0x2')](util[_0xebc6('0x3')](_0xebc6('0x1e'),_0x25a119[_0xebc6('0x5')],queues[_0x25a119[_0xebc6('0x5')]][_0xebc6('0x1c')],queues[_0x25a119[_0xebc6('0x5')]][_0xebc6('0xf')]));queues[queues[_0x25a119['uniqueid']]['transfereduniqueid']]=queues[_0x25a119[_0xebc6('0x5')]];queues[queues[_0x25a119[_0xebc6('0x5')]][_0xebc6('0xf')]][_0xebc6('0x1f')]=0x2;delete queues[_0x25a119[_0xebc6('0x5')]];}}}catch(_0x4d0f0d){utils[_0xebc6('0x20')](util[_0xebc6('0x3')](_0xebc6('0x21'),_0x25a119[_0xebc6('0x5')]),_0x4d0f0d);}};exports[_0xebc6('0x22')]=function(_0x3212a1){try{utils[_0xebc6('0x11')](util[_0xebc6('0x3')]('[%s][queues][varset]',_0x3212a1[_0xebc6('0x5')]),_0x3212a1);if(!_['isNil'](_0x3212a1[_0xebc6('0x23')]['queuestatus'])&&_0x3212a1[_0xebc6('0x24')]['toUpperCase']()!=='CONTINUE'){if(!_[_0xebc6('0x18')](queues[_0x3212a1['uniqueid']])){queues[_0x3212a1['uniqueid']][_0xebc6('0x25')]=![];queues[_0x3212a1['uniqueid']][_0xebc6('0x26')]=null;queues[_0x3212a1[_0xebc6('0x5')]][_0xebc6('0x19')]=!![];queues[_0x3212a1[_0xebc6('0x5')]][_0xebc6('0x27')]=utils[_0xebc6('0x16')]();queues[_0x3212a1[_0xebc6('0x5')]][_0xebc6('0x1d')]=_0x3212a1[_0xebc6('0x24')]['toUpperCase']();utils['info'](util['format'](_0xebc6('0x28'),_0x3212a1[_0xebc6('0x5')],queues[_0x3212a1[_0xebc6('0x5')]][_0xebc6('0x1c')],_0x3212a1[_0xebc6('0x24')],queues[_0x3212a1[_0xebc6('0x5')]][_0xebc6('0x1d')]));writeDB(queues[_0x3212a1['uniqueid']]);}}else if(!_[_0xebc6('0x18')](_0x3212a1[_0xebc6('0x23')][_0xebc6('0x29')])){if(!_[_0xebc6('0x18')](queues[_0x3212a1[_0xebc6('0x5')]])&&!queues[_0x3212a1[_0xebc6('0x5')]][_0xebc6('0x25')]){queues[_0x3212a1[_0xebc6('0x5')]][_0xebc6('0x25')]=![];queues[_0x3212a1['uniqueid']][_0xebc6('0x26')]=null;queues[_0x3212a1['uniqueid']][_0xebc6('0x19')]=!![];queues[_0x3212a1[_0xebc6('0x5')]][_0xebc6('0x27')]=utils[_0xebc6('0x16')]();queues[_0x3212a1[_0xebc6('0x5')]][_0xebc6('0x1d')]=_0xebc6('0x2a');utils[_0xebc6('0x2')](util[_0xebc6('0x3')](_0xebc6('0x2b'),_0x3212a1[_0xebc6('0x5')],queues[_0x3212a1[_0xebc6('0x5')]][_0xebc6('0x1c')],_0x3212a1[_0xebc6('0x24')],queues[_0x3212a1['uniqueid']][_0xebc6('0x1d')]));}}}catch(_0x1dc8bc){utils[_0xebc6('0x20')](util[_0xebc6('0x3')](_0xebc6('0x2c'),_0x3212a1[_0xebc6('0x5')]),_0x1dc8bc);}};exports[_0xebc6('0x25')]=function(_0x5e37b0){try{if(!_['isNil'](queues[_0x5e37b0[_0xebc6('0x5')]])){utils[_0xebc6('0x11')](util[_0xebc6('0x3')](_0xebc6('0x2d'),_0x5e37b0['uniqueid']),_0x5e37b0);queues[_0x5e37b0[_0xebc6('0x5')]][_0xebc6('0x19')]=![];queues[_0x5e37b0[_0xebc6('0x5')]][_0xebc6('0x27')]=null;queues[_0x5e37b0[_0xebc6('0x5')]][_0xebc6('0x25')]=!![];queues[_0x5e37b0[_0xebc6('0x5')]][_0xebc6('0x26')]=utils['now']();queues[_0x5e37b0[_0xebc6('0x5')]][_0xebc6('0x1d')]=_0xebc6('0x2e');utils[_0xebc6('0x2')](util[_0xebc6('0x3')](_0xebc6('0x2f'),_0x5e37b0[_0xebc6('0x5')],queues[_0x5e37b0['uniqueid']][_0xebc6('0x1c')],queues[_0x5e37b0[_0xebc6('0x5')]][_0xebc6('0x1d')]));}}catch(_0x48ea06){utils['error'](util[_0xebc6('0x3')]('[%s][queues][queuecallerabandon]',_0x5e37b0[_0xebc6('0x5')]),_0x48ea06);}};exports[_0xebc6('0x30')]=function(_0x313de5){try{if(!_['isNil'](queues[_0x313de5['uniqueid']])){utils[_0xebc6('0x11')](util[_0xebc6('0x3')](_0xebc6('0x31'),_0x313de5[_0xebc6('0x5')]),_0x313de5);utils[_0xebc6('0x2')](util['format'](_0xebc6('0x32'),_0x313de5['uniqueid'],queues[_0x313de5[_0xebc6('0x5')]][_0xebc6('0x1c')],_0x313de5[_0xebc6('0x33')],_0x313de5[_0xebc6('0x34')]));queues[_0x313de5[_0xebc6('0x5')]][_0xebc6('0x30')]=!![];queues[_0x313de5[_0xebc6('0x5')]][_0xebc6('0x35')]=utils[_0xebc6('0x16')]();queues[_0x313de5[_0xebc6('0x5')]]['holdtime']=utils['diffTime'](queues[_0x313de5[_0xebc6('0x5')]][_0xebc6('0x35')],queues[_0x313de5[_0xebc6('0x5')]][_0xebc6('0x36')]);queues[_0x313de5[_0xebc6('0x5')]][_0xebc6('0x14')]=_0x313de5[_0xebc6('0x14')];queues[_0x313de5[_0xebc6('0x5')]][_0xebc6('0x37')]=_0x313de5[_0xebc6('0x37')];queues[_0x313de5[_0xebc6('0x5')]][_0xebc6('0x33')]=_0x313de5[_0xebc6('0x33')];queues[_0x313de5[_0xebc6('0x5')]][_0xebc6('0x34')]=_0x313de5[_0xebc6('0x34')];}}catch(_0x58efb7){utils[_0xebc6('0x20')](util[_0xebc6('0x3')](_0xebc6('0x31'),_0x313de5[_0xebc6('0x5')]),_0x58efb7);}};exports[_0xebc6('0x38')]=function(_0xd5cf8c){try{if(!_[_0xebc6('0x18')](queues[_0xd5cf8c[_0xebc6('0x5')]])){utils[_0xebc6('0x11')](util['format'](_0xebc6('0x39'),_0xd5cf8c[_0xebc6('0x5')]),_0xd5cf8c);utils['info'](util['format'](_0xebc6('0x3a'),_0xd5cf8c['uniqueid'],queues[_0xd5cf8c['uniqueid']]['name'],_0xd5cf8c['membername'],_0xd5cf8c[_0xebc6('0x3b')]));queues[_0xd5cf8c[_0xebc6('0x5')]][_0xebc6('0x25')]=![];queues[_0xd5cf8c[_0xebc6('0x5')]]['queuecallerabandon']=![];queues[_0xd5cf8c[_0xebc6('0x5')]][_0xebc6('0x26')]=null;queues[_0xd5cf8c['uniqueid']][_0xebc6('0x19')]=![];queues[_0xd5cf8c[_0xebc6('0x5')]][_0xebc6('0x1d')]=null;queues[_0xd5cf8c[_0xebc6('0x5')]][_0xebc6('0x27')]=null;queues[_0xd5cf8c[_0xebc6('0x5')]]['assigned']=!![];queues[_0xd5cf8c[_0xebc6('0x5')]][_0xebc6('0xa')]=_0xd5cf8c[_0xebc6('0x3b')];queues[_0xd5cf8c[_0xebc6('0x5')]][_0xebc6('0x8')]=_0xd5cf8c[_0xebc6('0x3c')];}}catch(_0x382bfe){utils[_0xebc6('0x20')](util[_0xebc6('0x3')](_0xebc6('0x39'),_0xd5cf8c['uniqueid']),_0x382bfe);}};exports[_0xebc6('0x3d')]=function(_0x21ae53){try{if(!_[_0xebc6('0x18')](queues[_0x21ae53[_0xebc6('0x5')]])){if(queues[_0x21ae53[_0xebc6('0x5')]][_0xebc6('0x35')]){utils[_0xebc6('0x11')](util['format'](_0xebc6('0x3e'),_0x21ae53[_0xebc6('0x5')]),_0x21ae53);queues[_0x21ae53[_0xebc6('0x5')]][_0xebc6('0x25')]=![];queues[_0x21ae53['uniqueid']][_0xebc6('0x25')]=![];queues[_0x21ae53[_0xebc6('0x5')]][_0xebc6('0x26')]=null;queues[_0x21ae53['uniqueid']]['queuecallerexit']=![];queues[_0x21ae53[_0xebc6('0x5')]][_0xebc6('0x27')]=null;queues[_0x21ae53[_0xebc6('0x5')]]['assigned']=!![];queues[_0x21ae53[_0xebc6('0x5')]][_0xebc6('0x8')]=_0x21ae53[_0xebc6('0x3c')];queues[_0x21ae53[_0xebc6('0x5')]][_0xebc6('0x3f')]=!![];queues[_0x21ae53[_0xebc6('0x5')]][_0xebc6('0x1a')]=utils[_0xebc6('0x16')]();if(_0x21ae53[_0xebc6('0x40')]=='transfer'){if(!queues[_0x21ae53[_0xebc6('0x5')]][_0xebc6('0x41')]){queues[_0x21ae53[_0xebc6('0x5')]][_0xebc6('0x1d')]=_0xebc6('0x42');}}else{queues[_0x21ae53[_0xebc6('0x5')]]['queuecallerexitreason']=_0xebc6('0x43')+_0x21ae53[_0xebc6('0x40')][_0xebc6('0x44')]();}utils[_0xebc6('0x2')](util[_0xebc6('0x3')](_0xebc6('0x45'),_0x21ae53['uniqueid'],queues[_0x21ae53[_0xebc6('0x5')]]['name'],_0x21ae53[_0xebc6('0x3c')],queues[_0x21ae53['uniqueid']][_0xebc6('0x1d')]));writeDB(queues[_0x21ae53['uniqueid']]);}}}catch(_0x2af413){utils[_0xebc6('0x20')](util[_0xebc6('0x3')](_0xebc6('0x3e'),_0x21ae53[_0xebc6('0x5')]),_0x2af413);}};exports['blindtransfer']=function(_0x58aeb4){try{if(!_[_0xebc6('0x18')](queues[_0x58aeb4[_0xebc6('0x46')]])){utils['debug'](util[_0xebc6('0x3')](_0xebc6('0x47'),_0x58aeb4[_0xebc6('0x5')]),_0x58aeb4);queues[_0x58aeb4[_0xebc6('0x46')]][_0xebc6('0x41')]=!![];queues[_0x58aeb4[_0xebc6('0x46')]][_0xebc6('0x48')]='BLIND';queues[_0x58aeb4[_0xebc6('0x46')]]['transferexten']=_0x58aeb4[_0xebc6('0x49')];queues[_0x58aeb4[_0xebc6('0x46')]][_0xebc6('0x4a')]=_0x58aeb4[_0xebc6('0x46')];queues[_0x58aeb4[_0xebc6('0x46')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0xebc6('0x2')](util[_0xebc6('0x3')](_0xebc6('0x4b'),_0x58aeb4[_0xebc6('0x5')],queues[_0x58aeb4[_0xebc6('0x46')]]['name'],_0x58aeb4['transfereeuniqueid'],_0x58aeb4[_0xebc6('0x49')]));}}catch(_0x2683cf){utils[_0xebc6('0x20')](util[_0xebc6('0x3')](_0xebc6('0x47'),_0x58aeb4[_0xebc6('0x5')]),_0x2683cf);}};exports[_0xebc6('0x4c')]=function(_0x457037){try{utils['debug'](util[_0xebc6('0x3')](_0xebc6('0x4d'),_0x457037[_0xebc6('0x4e')]),_0x457037);if(_0x457037['origtransfereruniqueid']==_0x457037[_0xebc6('0x4f')]){if(!_[_0xebc6('0x18')](queues[_0x457037[_0xebc6('0x50')]])){utils['info'](util[_0xebc6('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x457037[_0xebc6('0x4e')],queues[_0x457037['secondtransfererlinkedid']][_0xebc6('0x1c')],_0x457037[_0xebc6('0x51')]));queues[_0x457037[_0xebc6('0x50')]][_0xebc6('0x41')]=!![];queues[_0x457037['secondtransfererlinkedid']][_0xebc6('0x48')]=_0xebc6('0x52');queues[_0x457037['secondtransfererlinkedid']][_0xebc6('0x53')]=_0x457037['origtransfererexten'];queues[_0x457037[_0xebc6('0x50')]][_0xebc6('0x4a')]=_0x457037[_0xebc6('0x4e')];queues[_0x457037[_0xebc6('0x50')]][_0xebc6('0x1d')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x457037[_0xebc6('0x4f')]])){if(_0x457037[_0xebc6('0x54')]&&queues[_0x457037['transfereelinkedid']]){queues[_0x457037[_0xebc6('0x54')]]['queuecallerenterreason']=0x1;queues[_0x457037[_0xebc6('0x46')]]=_[_0xebc6('0x55')](queues[_0x457037[_0xebc6('0x54')]]);queues[_0x457037['transfereeuniqueid']][_0xebc6('0xf')]=_0x457037['transfertargetuniqueid'];queues[_0x457037[_0xebc6('0x46')]][_0xebc6('0x1f')]=0x2;queues[_0x457037[_0xebc6('0x46')]]['calleridnum']=queues[_0x457037[_0xebc6('0x50')]][_0xebc6('0x9')];queues[_0x457037[_0xebc6('0x46')]][_0xebc6('0x56')]=queues[_0x457037[_0xebc6('0x50')]]['calleridname'];queues[_0x457037[_0xebc6('0x46')]][_0xebc6('0x36')]=utils[_0xebc6('0x16')]();queues[_0x457037['transfereeuniqueid']][_0xebc6('0x35')]=utils['now']();queues[_0x457037[_0xebc6('0x46')]][_0xebc6('0x57')]=0x0;queues[_0x457037['transfereeuniqueid']][_0xebc6('0x58')]=0x0;utils[_0xebc6('0x2')](util[_0xebc6('0x3')](_0xebc6('0x59'),_0x457037[_0xebc6('0x4e')],queues[_0x457037[_0xebc6('0x46')]]['name'],queues[_0x457037[_0xebc6('0x46')]][_0xebc6('0x9')],queues[_0x457037[_0xebc6('0x46')]][_0xebc6('0x56')]));}else{utils[_0xebc6('0x2')](util[_0xebc6('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x457037[_0xebc6('0x4e')],queues[_0x457037[_0xebc6('0x4f')]][_0xebc6('0x1c')],_0x457037[_0xebc6('0x50')]));queues[_0x457037[_0xebc6('0x4f')]][_0xebc6('0xf')]=_0x457037[_0xebc6('0x50')];}}}else if(_0x457037[_0xebc6('0x5a')]==_0x457037[_0xebc6('0x50')]){if(!_[_0xebc6('0x18')](queues[_0x457037[_0xebc6('0x4f')]])){utils['info'](util[_0xebc6('0x3')](_0xebc6('0x5b'),_0x457037[_0xebc6('0x4e')],queues[_0x457037['origtransfererlinkedid']][_0xebc6('0x1c')],_0x457037['secondtransfereruniqueid'],_0x457037[_0xebc6('0x5c')]));queues[_0x457037[_0xebc6('0x4f')]][_0xebc6('0x41')]=!![];queues[_0x457037[_0xebc6('0x4f')]][_0xebc6('0x48')]='ATTENDED';queues[_0x457037[_0xebc6('0x4f')]][_0xebc6('0x53')]=_0x457037['secondtransfererexten'];queues[_0x457037[_0xebc6('0x4f')]][_0xebc6('0x4a')]=_0x457037[_0xebc6('0x5a')];queues[_0x457037[_0xebc6('0x4f')]][_0xebc6('0x1d')]=_0xebc6('0x5d');}if(!_[_0xebc6('0x18')](queues[_0x457037[_0xebc6('0x50')]])){if(_0x457037[_0xebc6('0x5e')]&&queues[_0x457037[_0xebc6('0x5e')]]){queues[_0x457037[_0xebc6('0x5e')]][_0xebc6('0x1f')]=0x1;queues[_0x457037[_0xebc6('0x5f')]]=_['clone'](queues[_0x457037[_0xebc6('0x5e')]]);queues[_0x457037[_0xebc6('0x5f')]][_0xebc6('0xf')]=_0x457037[_0xebc6('0x5f')];queues[_0x457037[_0xebc6('0x5f')]][_0xebc6('0x1f')]=0x2;queues[_0x457037['transfertargetuniqueid']][_0xebc6('0x9')]=queues[_0x457037[_0xebc6('0x4f')]][_0xebc6('0x9')];queues[_0x457037[_0xebc6('0x5f')]]['calleridname']=queues[_0x457037['origtransfererlinkedid']]['calleridname'];queues[_0x457037[_0xebc6('0x5f')]]['queuecallerjoinAt']=utils[_0xebc6('0x16')]();queues[_0x457037[_0xebc6('0x5f')]][_0xebc6('0x35')]=utils['now']();queues[_0x457037[_0xebc6('0x5f')]][_0xebc6('0x57')]=0x0;queues[_0x457037[_0xebc6('0x5f')]][_0xebc6('0x58')]=0x0;utils[_0xebc6('0x2')](util[_0xebc6('0x3')](_0xebc6('0x60'),_0x457037[_0xebc6('0x4e')],queues[_0x457037['transfertargetuniqueid']][_0xebc6('0x1c')],queues[_0x457037[_0xebc6('0x5f')]]['transfereduniqueid'],queues[_0x457037[_0xebc6('0x5f')]][_0xebc6('0x9')],queues[_0x457037[_0xebc6('0x5f')]][_0xebc6('0x56')]));}else{utils[_0xebc6('0x2')](util[_0xebc6('0x3')](_0xebc6('0x61'),_0x457037[_0xebc6('0x4e')],queues[_0x457037[_0xebc6('0x50')]][_0xebc6('0x1c')],_0x457037['origtransfererlinkedid']));queues[_0x457037[_0xebc6('0x50')]][_0xebc6('0xf')]=_0x457037[_0xebc6('0x4f')];}}}}catch(_0x59e1a8){utils[_0xebc6('0x20')](util[_0xebc6('0x3')](_0xebc6('0x4d'),_0x457037[_0xebc6('0x4e')]),_0x59e1a8);}};exports['musiconholdstart']=function(_0x5ff856){try{if(!_['isNil'](queues[_0x5ff856[_0xebc6('0x5')]])){utils['debug'](util[_0xebc6('0x3')](_0xebc6('0x62'),_0x5ff856[_0xebc6('0x5')]),_0x5ff856);queues[_0x5ff856['uniqueid']]['musiconholdstartAt']=utils['now']();utils[_0xebc6('0x2')](util['format'](_0xebc6('0x63'),_0x5ff856[_0xebc6('0x5')],queues[_0x5ff856[_0xebc6('0x5')]][_0xebc6('0x1c')],queues[_0x5ff856[_0xebc6('0x5')]][_0xebc6('0x64')]));}}catch(_0x499cb3){utils[_0xebc6('0x20')](util[_0xebc6('0x3')](_0xebc6('0x62'),_0x5ff856['uniqueid']),_0x499cb3);}};exports[_0xebc6('0x65')]=function(_0x287b72){try{if(!_[_0xebc6('0x18')](queues[_0x287b72[_0xebc6('0x5')]])){if(!_['isNil'](queues[_0x287b72[_0xebc6('0x5')]][_0xebc6('0x64')])){utils[_0xebc6('0x11')](util[_0xebc6('0x3')]('[%s][queues][musiconholdstop]',_0x287b72[_0xebc6('0x5')]),_0x287b72);queues[_0x287b72[_0xebc6('0x5')]][_0xebc6('0x58')]+=utils[_0xebc6('0x66')](utils['now'](),queues[_0x287b72[_0xebc6('0x5')]][_0xebc6('0x64')]);utils['info'](util[_0xebc6('0x3')](_0xebc6('0x67'),_0x287b72['uniqueid'],queues[_0x287b72[_0xebc6('0x5')]][_0xebc6('0x1c')],queues[_0x287b72[_0xebc6('0x5')]][_0xebc6('0x58')]));delete queues[_0x287b72[_0xebc6('0x5')]][_0xebc6('0x64')];}}}catch(_0x28db81){utils[_0xebc6('0x20')](util[_0xebc6('0x3')](_0xebc6('0x68'),_0x287b72['uniqueid']),_0x28db81);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 989582a..cbedfb5 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 _0x948b=['UserId','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','channel','error','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','context','linkedid','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','value','endsWith','.wav49','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinename','type','connectedlinenum','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','info','format','uniqueid','accountcode','getUserByInternal','membername','name'];(function(_0x5f3c3c,_0x2b255f){var _0x9f9c6f=function(_0x4beaa0){while(--_0x4beaa0){_0x5f3c3c['push'](_0x5f3c3c['shift']());}};_0x9f9c6f(++_0x2b255f);}(_0x948b,0x6d));var _0xb948=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x948b[_0x3b150c];return _0x5cd414;};'use strict';var _=require('lodash');var util=require(_0xb948('0x0'));var utils=require(_0xb948('0x1'));var recordings={};function writeDB(_0x537edd){utils[_0xb948('0x2')](util[_0xb948('0x3')]('[%s][recordings][writeDB]',_0x537edd[_0xb948('0x4')]));if(_0x537edd[_0xb948('0x5')]){utils[_0xb948('0x6')](_0x537edd['accountcode'])['then'](function(_0x55a579){if(_0x55a579){_0x537edd[_0xb948('0x7')]=_0x55a579[_0xb948('0x8')];_0x537edd[_0xb948('0x9')]=_0x55a579['id'];}utils['request']('CreateVoiceRecording',_0x537edd);});}else{utils['request'](_0xb948('0xa'),_0x537edd);}}exports[_0xb948('0xb')]=function(_0x31806c){try{utils[_0xb948('0xc')](util[_0xb948('0x3')](_0xb948('0xd'),_0x31806c['uniqueid']),_0x31806c);if(_0x31806c[_0xb948('0x4')]==_0x31806c['linkedid']){utils[_0xb948('0x2')](util[_0xb948('0x3')](_0xb948('0xe'),_0x31806c[_0xb948('0x4')],_0x31806c['context'],_0x31806c[_0xb948('0xf')]));recordings[_0x31806c[_0xb948('0x4')]]={'uniqueid':_0x31806c[_0xb948('0x4')],'accountcode':_0x31806c['accountcode'],'exten':_0x31806c[_0xb948('0xf')],'context':_0x31806c['context'],'channel':_0x31806c[_0xb948('0x10')],'monitors':[]};}}catch(_0x2611c9){utils[_0xb948('0x11')](util[_0xb948('0x3')]('[%s][recordings][newchannel]',_0x31806c[_0xb948('0x4')]),_0x2611c9);}};exports['newstate']=function(_0x49651d){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0x49651d[_0xb948('0x4')]),_0x49651d);if(!_[_0xb948('0x12')](recordings[_0x49651d[_0xb948('0x4')]])&&_0x49651d[_0xb948('0x13')]==0x6){utils[_0xb948('0x2')](util[_0xb948('0x3')](_0xb948('0x14'),_0x49651d[_0xb948('0x4')],_0x49651d[_0xb948('0x15')],_0x49651d[_0xb948('0x10')]));}else if(!_[_0xb948('0x12')](recordings[_0x49651d[_0xb948('0x16')]])&&_0x49651d[_0xb948('0x13')]==0x6&&_0x49651d[_0xb948('0x15')]!='transfer'){utils['info'](util['format'](_0xb948('0x17'),_0x49651d[_0xb948('0x4')],_0x49651d[_0xb948('0x16')],_0x49651d[_0xb948('0x15')],_0x49651d[_0xb948('0x10')]));recordings[_0x49651d['linkedid']]['accountcode']=_0x49651d[_0xb948('0x5')];}}catch(_0x325e0a){utils[_0xb948('0x11')](util[_0xb948('0x3')](_0xb948('0x18'),_0x49651d[_0xb948('0x4')]),_0x325e0a);}};exports[_0xb948('0x19')]=function(_0x1f4c5c){try{if(!_[_0xb948('0x12')](_0x1f4c5c[_0xb948('0x1a')])&&!_['isNil'](_0x1f4c5c['variable']['mixmonitor_filename'])){utils[_0xb948('0xc')](util['format']('[%s][recordings][varset]',_0x1f4c5c['uniqueid']),_0x1f4c5c);utils[_0xb948('0x2')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x1f4c5c[_0xb948('0x4')],_0x1f4c5c['variable'],_0x1f4c5c[_0xb948('0x1b')]));if(_[_0xb948('0x1c')](_0x1f4c5c[_0xb948('0x1b')],_0xb948('0x1d'))){_0x1f4c5c[_0xb948('0x1b')]=_0x1f4c5c[_0xb948('0x1b')]['replace'](_0xb948('0x1d'),_0xb948('0x1e'));}if(recordings[_0x1f4c5c[_0xb948('0x16')]]){var _0x4ea41d=_[_0xb948('0x1f')](recordings[_0x1f4c5c['linkedid']][_0xb948('0x20')],{'value':_0x1f4c5c[_0xb948('0x1b')]});if(_[_0xb948('0x12')](_0x4ea41d)){recordings[_0x1f4c5c[_0xb948('0x16')]][_0xb948('0x20')][_0xb948('0x21')]({'value':_0x1f4c5c[_0xb948('0x1b')]});}}}}catch(_0x164d57){utils['error'](util[_0xb948('0x3')](_0xb948('0x22'),_0x1f4c5c[_0xb948('0x4')]),_0x164d57);}};exports[_0xb948('0x23')]=function(_0x381c2f){try{if(!_[_0xb948('0x12')](recordings[_0x381c2f[_0xb948('0x4')]])){utils[_0xb948('0xc')](util[_0xb948('0x3')](_0xb948('0x24'),_0x381c2f['uniqueid']),_0x381c2f);utils[_0xb948('0x2')](util[_0xb948('0x3')](_0xb948('0x25'),_0x381c2f[_0xb948('0x4')],_0x381c2f[_0xb948('0x26')],_0x381c2f['calleridname'],_0x381c2f['cause-txt']));recordings[_0x381c2f[_0xb948('0x4')]][_0xb948('0x26')]=_0x381c2f[_0xb948('0x26')];recordings[_0x381c2f['uniqueid']][_0xb948('0x27')]=_0x381c2f[_0xb948('0x27')];recordings[_0x381c2f['uniqueid']]['connectedlinenum']=_0x381c2f['connectedlinenum'];recordings[_0x381c2f[_0xb948('0x4')]][_0xb948('0x28')]=_0x381c2f['connectedlinename'];if(recordings[_0x381c2f[_0xb948('0x4')]][_0xb948('0x29')]=='outbound'&&recordings[_0x381c2f[_0xb948('0x4')]][_0xb948('0x5')]){recordings[_0x381c2f['uniqueid']][_0xb948('0x2a')]=recordings[_0x381c2f[_0xb948('0x4')]][_0xb948('0x5')];recordings[_0x381c2f[_0xb948('0x4')]][_0xb948('0x28')]='';}recordings[_0x381c2f['uniqueid']][_0xb948('0x20')]['forEach'](function(_0x13d987){var _0x129ab9=_[_0xb948('0x2b')](recordings[_0x381c2f[_0xb948('0x4')]]);_0x129ab9[_0xb948('0x1b')]=_0x13d987['value'];writeDB(_0x129ab9);});delete recordings[_0x381c2f[_0xb948('0x4')]];}}catch(_0x220859){utils[_0xb948('0x11')](util[_0xb948('0x3')](_0xb948('0x24'),_0x381c2f[_0xb948('0x4')]),_0x220859);}};exports[_0xb948('0x2c')]=function(_0x377240){try{if(!_[_0xb948('0x12')](recordings[_0x377240[_0xb948('0x4')]])){utils[_0xb948('0xc')](util[_0xb948('0x3')](_0xb948('0x2d'),_0x377240[_0xb948('0x4')]),_0x377240);utils['info'](util[_0xb948('0x3')](_0xb948('0x2e'),_0x377240['uniqueid'],_0x377240[_0xb948('0x2f')],_0x377240[_0xb948('0x30')]));if(_0x377240[_0xb948('0x2f')][_0xb948('0x31')]()==_0xb948('0x32')&&_[_0xb948('0x33')](_0x377240[_0xb948('0x30')][_0xb948('0x31')](),_0xb948('0x34'))){var _0x19b38c=_0x377240[_0xb948('0x30')][_0xb948('0x35')]('=');var _0x1137e4=_0x19b38c[0x0][_0xb948('0x36')](_0x19b38c[0x0]['lastIndexOf']('(')+0x1,_0x19b38c[0x0][_0xb948('0x37')](')'));var _0x3a9662=_0x19b38c[0x1];recordings[_0x377240['uniqueid']][_0x1137e4]=_0x3a9662;}}}catch(_0x43a59a){utils[_0xb948('0x11')](util['format']('[%s][recordings][newexten]',_0x377240['uniqueid']),_0x43a59a);}};exports[_0xb948('0x38')]=function(_0x53de93){try{if(!_[_0xb948('0x12')](recordings[_0x53de93[_0xb948('0x4')]])){utils[_0xb948('0xc')](util['format']('[%s][recordings][queuecallerjoin]',_0x53de93[_0xb948('0x4')]),_0x53de93);utils[_0xb948('0x2')](util[_0xb948('0x3')](_0xb948('0x39'),_0x53de93[_0xb948('0x4')],_0x53de93['queue']));recordings[_0x53de93['uniqueid']][_0xb948('0x3a')]=_0x53de93[_0xb948('0x3a')];}}catch(_0x4d1567){utils[_0xb948('0x11')](util[_0xb948('0x3')]('[%s][recordings][queuecallerjoin]',_0x53de93[_0xb948('0x4')]),_0x4d1567);}}; \ No newline at end of file +var _0x9557=['appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','./utils','info','format','[%s][recordings][writeDB]','accountcode','then','membername','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','cause-txt','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x9557,0x1d4));var _0x7955=function(_0x5956d6,_0x58b769){_0x5956d6=_0x5956d6-0x0;var _0x49d6e6=_0x9557[_0x5956d6];return _0x49d6e6;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x7955('0x0'));var recordings={};function writeDB(_0x293703){utils[_0x7955('0x1')](util[_0x7955('0x2')](_0x7955('0x3'),_0x293703['uniqueid']));if(_0x293703[_0x7955('0x4')]){utils['getUserByInternal'](_0x293703['accountcode'])[_0x7955('0x5')](function(_0x350372){if(_0x350372){_0x293703[_0x7955('0x6')]=_0x350372['name'];_0x293703[_0x7955('0x7')]=_0x350372['id'];}utils[_0x7955('0x8')]('CreateVoiceRecording',_0x293703);});}else{utils['request'](_0x7955('0x9'),_0x293703);}}exports[_0x7955('0xa')]=function(_0x13702d){try{utils[_0x7955('0xb')](util['format'](_0x7955('0xc'),_0x13702d[_0x7955('0xd')]),_0x13702d);if(_0x13702d[_0x7955('0xd')]==_0x13702d[_0x7955('0xe')]){utils['info'](util['format'](_0x7955('0xf'),_0x13702d[_0x7955('0xd')],_0x13702d[_0x7955('0x10')],_0x13702d[_0x7955('0x11')]));recordings[_0x13702d[_0x7955('0xd')]]={'uniqueid':_0x13702d[_0x7955('0xd')],'accountcode':_0x13702d['accountcode'],'exten':_0x13702d[_0x7955('0x11')],'context':_0x13702d[_0x7955('0x10')],'channel':_0x13702d[_0x7955('0x12')],'monitors':[]};}}catch(_0x17cf89){utils[_0x7955('0x13')](util['format']('[%s][recordings][newchannel]',_0x13702d[_0x7955('0xd')]),_0x17cf89);}};exports[_0x7955('0x14')]=function(_0x4cc5ba){try{utils[_0x7955('0xb')](util[_0x7955('0x2')](_0x7955('0x15'),_0x4cc5ba[_0x7955('0xd')]),_0x4cc5ba);if(!_[_0x7955('0x16')](recordings[_0x4cc5ba[_0x7955('0xd')]])&&_0x4cc5ba['channelstate']==0x6){utils[_0x7955('0x1')](util[_0x7955('0x2')](_0x7955('0x17'),_0x4cc5ba['uniqueid'],_0x4cc5ba[_0x7955('0x10')],_0x4cc5ba['channel']));}else if(!_[_0x7955('0x16')](recordings[_0x4cc5ba['linkedid']])&&_0x4cc5ba[_0x7955('0x18')]==0x6&&_0x4cc5ba[_0x7955('0x10')]!=_0x7955('0x19')){utils[_0x7955('0x1')](util[_0x7955('0x2')](_0x7955('0x1a'),_0x4cc5ba['uniqueid'],_0x4cc5ba[_0x7955('0xe')],_0x4cc5ba[_0x7955('0x10')],_0x4cc5ba['channel']));recordings[_0x4cc5ba[_0x7955('0xe')]][_0x7955('0x4')]=_0x4cc5ba[_0x7955('0x4')];}}catch(_0x156b1e){utils['error'](util['format'](_0x7955('0x15'),_0x4cc5ba[_0x7955('0xd')]),_0x156b1e);}};exports[_0x7955('0x1b')]=function(_0x3d7d23){try{if(!_[_0x7955('0x16')](_0x3d7d23['variable'])&&!_[_0x7955('0x16')](_0x3d7d23[_0x7955('0x1c')][_0x7955('0x1d')])){utils[_0x7955('0xb')](util['format']('[%s][recordings][varset]',_0x3d7d23[_0x7955('0xd')]),_0x3d7d23);utils[_0x7955('0x1')](util['format'](_0x7955('0x1e'),_0x3d7d23['uniqueid'],_0x3d7d23[_0x7955('0x1c')],_0x3d7d23[_0x7955('0x1f')]));if(_['endsWith'](_0x3d7d23[_0x7955('0x1f')],_0x7955('0x20'))){_0x3d7d23[_0x7955('0x1f')]=_0x3d7d23[_0x7955('0x1f')][_0x7955('0x21')](_0x7955('0x20'),_0x7955('0x22'));}if(recordings[_0x3d7d23[_0x7955('0xe')]]){var _0x5918f8=_['find'](recordings[_0x3d7d23[_0x7955('0xe')]][_0x7955('0x23')],{'value':_0x3d7d23['value']});if(_[_0x7955('0x16')](_0x5918f8)){recordings[_0x3d7d23[_0x7955('0xe')]][_0x7955('0x23')][_0x7955('0x24')]({'value':_0x3d7d23[_0x7955('0x1f')]});}}}}catch(_0x3fa9a3){utils['error'](util[_0x7955('0x2')](_0x7955('0x25'),_0x3d7d23[_0x7955('0xd')]),_0x3fa9a3);}};exports[_0x7955('0x26')]=function(_0x3f4377){try{if(!_[_0x7955('0x16')](recordings[_0x3f4377[_0x7955('0xd')]])){utils['debug'](util['format'](_0x7955('0x27'),_0x3f4377[_0x7955('0xd')]),_0x3f4377);utils[_0x7955('0x1')](util[_0x7955('0x2')](_0x7955('0x28'),_0x3f4377['uniqueid'],_0x3f4377['calleridnum'],_0x3f4377['calleridname'],_0x3f4377[_0x7955('0x29')]));recordings[_0x3f4377[_0x7955('0xd')]][_0x7955('0x2a')]=_0x3f4377['calleridnum'];recordings[_0x3f4377[_0x7955('0xd')]][_0x7955('0x2b')]=_0x3f4377[_0x7955('0x2b')];recordings[_0x3f4377[_0x7955('0xd')]][_0x7955('0x2c')]=_0x3f4377[_0x7955('0x2c')];recordings[_0x3f4377[_0x7955('0xd')]][_0x7955('0x2d')]=_0x3f4377[_0x7955('0x2d')];if(recordings[_0x3f4377['uniqueid']]['type']==_0x7955('0x2e')&&recordings[_0x3f4377[_0x7955('0xd')]][_0x7955('0x4')]){recordings[_0x3f4377[_0x7955('0xd')]][_0x7955('0x2c')]=recordings[_0x3f4377['uniqueid']][_0x7955('0x4')];recordings[_0x3f4377[_0x7955('0xd')]][_0x7955('0x2d')]='';}recordings[_0x3f4377[_0x7955('0xd')]][_0x7955('0x23')][_0x7955('0x2f')](function(_0x8601c0){var _0x75abfc=_[_0x7955('0x30')](recordings[_0x3f4377[_0x7955('0xd')]]);_0x75abfc[_0x7955('0x1f')]=_0x8601c0['value'];writeDB(_0x75abfc);});delete recordings[_0x3f4377[_0x7955('0xd')]];}}catch(_0x2fd0f3){utils[_0x7955('0x13')](util['format'](_0x7955('0x27'),_0x3f4377[_0x7955('0xd')]),_0x2fd0f3);}};exports[_0x7955('0x31')]=function(_0x3eebef){try{if(!_[_0x7955('0x16')](recordings[_0x3eebef[_0x7955('0xd')]])){utils[_0x7955('0xb')](util[_0x7955('0x2')]('[%s][recordings][newexten]',_0x3eebef[_0x7955('0xd')]),_0x3eebef);utils[_0x7955('0x1')](util['format'](_0x7955('0x32'),_0x3eebef[_0x7955('0xd')],_0x3eebef[_0x7955('0x33')],_0x3eebef[_0x7955('0x34')]));if(_0x3eebef[_0x7955('0x33')][_0x7955('0x35')]()==_0x7955('0x36')&&_[_0x7955('0x37')](_0x3eebef[_0x7955('0x34')][_0x7955('0x35')](),_0x7955('0x38'))){var _0x4adbb9=_0x3eebef['appdata'][_0x7955('0x39')]('=');var _0xabcd74=_0x4adbb9[0x0][_0x7955('0x3a')](_0x4adbb9[0x0][_0x7955('0x3b')]('(')+0x1,_0x4adbb9[0x0][_0x7955('0x3b')](')'));var _0x5e13de=_0x4adbb9[0x1];recordings[_0x3eebef['uniqueid']][_0xabcd74]=_0x5e13de;}}}catch(_0x352c09){utils[_0x7955('0x13')](util[_0x7955('0x2')](_0x7955('0x3c'),_0x3eebef[_0x7955('0xd')]),_0x352c09);}};exports[_0x7955('0x3d')]=function(_0x407e4f){try{if(!_['isNil'](recordings[_0x407e4f['uniqueid']])){utils[_0x7955('0xb')](util['format'](_0x7955('0x3e'),_0x407e4f[_0x7955('0xd')]),_0x407e4f);utils[_0x7955('0x1')](util['format'](_0x7955('0x3f'),_0x407e4f['uniqueid'],_0x407e4f[_0x7955('0x40')]));recordings[_0x407e4f[_0x7955('0xd')]][_0x7955('0x40')]=_0x407e4f['queue'];}}catch(_0x58d785){utils[_0x7955('0x13')](util['format'](_0x7955('0x3e'),_0x407e4f[_0x7955('0xd')]),_0x58d785);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a0f7100..8a71bcc 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 _0x0fda=['transfereecalleridname','blind','error','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','uniqueid','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname'];(function(_0x39d2a5,_0x2608fd){var _0x27f1da=function(_0x504fc5){while(--_0x504fc5){_0x39d2a5['push'](_0x39d2a5['shift']());}};_0x27f1da(++_0x2608fd);}(_0x0fda,0x64));var _0xa0fd=function(_0x47c5e0,_0xc2a3e9){_0x47c5e0=_0x47c5e0-0x0;var _0x42154c=_0x0fda[_0x47c5e0];return _0x42154c;};'use strict';var _=require(_0xa0fd('0x0'));var util=require(_0xa0fd('0x1'));var utils=require(_0xa0fd('0x2'));function writeDB(_0x36cb6a){utils[_0xa0fd('0x3')](util[_0xa0fd('0x4')](_0xa0fd('0x5'),_0x36cb6a['type']==='attended'?_0x36cb6a[_0xa0fd('0x6')]:_0x36cb6a[_0xa0fd('0x7')],_0x36cb6a['type']));utils['request']('CreateVoiceTransferReport',_0x36cb6a);}exports[_0xa0fd('0x8')]=function(_0x2f1a0e){try{utils[_0xa0fd('0x9')](util[_0xa0fd('0x4')](_0xa0fd('0xa'),_0x2f1a0e['uniqueid']),_0x2f1a0e);utils[_0xa0fd('0x3')](util[_0xa0fd('0x4')](_0xa0fd('0xb'),_0x2f1a0e[_0xa0fd('0x7')],_0x2f1a0e[_0xa0fd('0xc')],_0x2f1a0e[_0xa0fd('0xd')],_0x2f1a0e['transfereecalleridnum'],_0x2f1a0e[_0xa0fd('0xe')]));_0x2f1a0e['type']=_0xa0fd('0xf');writeDB(_0x2f1a0e);}catch(_0x2eb674){utils[_0xa0fd('0x10')](util[_0xa0fd('0x4')]('[%s][transfers][blindtransfer]',_0x2f1a0e[_0xa0fd('0x7')]),_0x2eb674);}};exports['attendedtransfer']=function(_0x447000){try{utils[_0xa0fd('0x9')](util[_0xa0fd('0x4')]('[%s][transfers][attendedtransfer]',_0x447000[_0xa0fd('0x6')]),_0x447000);utils[_0xa0fd('0x3')](util['format'](_0xa0fd('0x11'),_0x447000['origtransfereruniqueid'],_0x447000[_0xa0fd('0x12')],_0x447000[_0xa0fd('0x13')],_0x447000[_0xa0fd('0x14')],_0x447000['transfertargetcalleridname']));_0x447000=_[_0xa0fd('0x15')](_0x447000,{'transfererchannel':_0x447000[_0xa0fd('0x16')],'transferercalleridnum':_0x447000[_0xa0fd('0x12')],'transferercalleridname':_0x447000[_0xa0fd('0x13')],'transfererconnectedlinenum':_0x447000[_0xa0fd('0x17')],'transfererconnectedlinename':_0x447000['secondtransfererconnectedlinename'],'transfereraccountcode':_0x447000[_0xa0fd('0x18')],'transferercontext':_0x447000[_0xa0fd('0x19')],'transfererexten':_0x447000['secondtransfererexten'],'transfererlinkedid':_0x447000[_0xa0fd('0x1a')],'context':_0x447000[_0xa0fd('0x1b')],'extension':_0x447000[_0xa0fd('0x1c')],'type':_0xa0fd('0x1d')});if(_[_0xa0fd('0x1e')](_0x447000[_0xa0fd('0x1f')])){_0x447000=_[_0xa0fd('0x15')](_0x447000,{'transfereechannel':_0x447000['transfertargetchannel'],'transfereecalleridnum':_0x447000[_0xa0fd('0x14')],'transfereecalleridname':_0x447000['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x447000[_0xa0fd('0x20')],'transfereeconnectedlinename':_0x447000[_0xa0fd('0x21')],'transfereeaccountcode':_0x447000[_0xa0fd('0x22')],'transfereecontext':_0x447000[_0xa0fd('0x23')],'transfereeexten':_0x447000[_0xa0fd('0x24')],'transfereelinkedid':_0x447000[_0xa0fd('0x25')]});}writeDB(_0x447000);}catch(_0x585aca){utils[_0xa0fd('0x10')](util[_0xa0fd('0x4')]('[%s][transfers][attendedtransfer]',_0x447000[_0xa0fd('0x6')]),_0x585aca);}}; \ No newline at end of file +var _0x7872=['format','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','util','info'];(function(_0x5048ff,_0x2e26aa){var _0x5292a6=function(_0x256340){while(--_0x256340){_0x5048ff['push'](_0x5048ff['shift']());}};_0x5292a6(++_0x2e26aa);}(_0x7872,0x9e));var _0x2787=function(_0x32d865,_0x1cd6b0){_0x32d865=_0x32d865-0x0;var _0x563ca1=_0x7872[_0x32d865];return _0x563ca1;};'use strict';var _=require('lodash');var util=require(_0x2787('0x0'));var utils=require('./utils');function writeDB(_0x1ed9ae){utils[_0x2787('0x1')](util[_0x2787('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x1ed9ae[_0x2787('0x3')]===_0x2787('0x4')?_0x1ed9ae[_0x2787('0x5')]:_0x1ed9ae[_0x2787('0x6')],_0x1ed9ae['type']));utils[_0x2787('0x7')](_0x2787('0x8'),_0x1ed9ae);}exports['blindtransfer']=function(_0x539f27){try{utils[_0x2787('0x9')](util[_0x2787('0x2')](_0x2787('0xa'),_0x539f27[_0x2787('0x6')]),_0x539f27);utils['info'](util['format'](_0x2787('0xb'),_0x539f27[_0x2787('0x6')],_0x539f27['transferercalleridnum'],_0x539f27[_0x2787('0xc')],_0x539f27[_0x2787('0xd')],_0x539f27[_0x2787('0xe')]));_0x539f27[_0x2787('0x3')]=_0x2787('0xf');writeDB(_0x539f27);}catch(_0x41fb42){utils[_0x2787('0x10')](util[_0x2787('0x2')](_0x2787('0xa'),_0x539f27[_0x2787('0x6')]),_0x41fb42);}};exports[_0x2787('0x11')]=function(_0x1a31d7){try{utils[_0x2787('0x9')](util[_0x2787('0x2')](_0x2787('0x12'),_0x1a31d7[_0x2787('0x5')]),_0x1a31d7);utils[_0x2787('0x1')](util[_0x2787('0x2')](_0x2787('0x13'),_0x1a31d7[_0x2787('0x5')],_0x1a31d7['origtransferercalleridnum'],_0x1a31d7[_0x2787('0x14')],_0x1a31d7[_0x2787('0x15')],_0x1a31d7['transfertargetcalleridname']));_0x1a31d7=_[_0x2787('0x16')](_0x1a31d7,{'transfererchannel':_0x1a31d7['origtransfererchannel'],'transferercalleridnum':_0x1a31d7[_0x2787('0x17')],'transferercalleridname':_0x1a31d7[_0x2787('0x14')],'transfererconnectedlinenum':_0x1a31d7[_0x2787('0x18')],'transfererconnectedlinename':_0x1a31d7[_0x2787('0x19')],'transfereraccountcode':_0x1a31d7[_0x2787('0x1a')],'transferercontext':_0x1a31d7[_0x2787('0x1b')],'transfererexten':_0x1a31d7[_0x2787('0x1c')],'transfererlinkedid':_0x1a31d7[_0x2787('0x1d')],'context':_0x1a31d7[_0x2787('0x1e')],'extension':_0x1a31d7[_0x2787('0x1f')],'type':_0x2787('0x4')});if(_['isNil'](_0x1a31d7[_0x2787('0x20')])){_0x1a31d7=_[_0x2787('0x16')](_0x1a31d7,{'transfereechannel':_0x1a31d7[_0x2787('0x21')],'transfereecalleridnum':_0x1a31d7[_0x2787('0x15')],'transfereecalleridname':_0x1a31d7[_0x2787('0x22')],'transfereeconnectedlinenum':_0x1a31d7[_0x2787('0x23')],'transfereeconnectedlinename':_0x1a31d7[_0x2787('0x24')],'transfereeaccountcode':_0x1a31d7[_0x2787('0x25')],'transfereecontext':_0x1a31d7['transfertargetcontext'],'transfereeexten':_0x1a31d7[_0x2787('0x26')],'transfereelinkedid':_0x1a31d7[_0x2787('0x27')]});}writeDB(_0x1a31d7);}catch(_0x3e884e){utils[_0x2787('0x10')](util[_0x2787('0x2')]('[%s][transfers][attendedtransfer]',_0x1a31d7[_0x2787('0x5')]),_0x3e884e);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 5588c41..2c59fa3 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 _0xe469=['addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diffTime','sumTime','now','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','info','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','found'];(function(_0x15032c,_0x1eae63){var _0x3e6b58=function(_0x3c0a81){while(--_0x3c0a81){_0x15032c['push'](_0x15032c['shift']());}};_0x3e6b58(++_0x1eae63);}(_0xe469,0x1d6));var _0x9e46=function(_0x2d98d3,_0xadb260){_0x2d98d3=_0x2d98d3-0x0;var _0x3e1b2b=_0xe469[_0x2d98d3];return _0x3e1b2b;};'use strict';var BPromise=require(_0x9e46('0x0'));var jayson=require(_0x9e46('0x1'));var moment=require(_0x9e46('0x2'));var util=require(_0x9e46('0x3'));var client=jayson[_0x9e46('0x4')][_0x9e46('0x5')]({'port':0x2329});var logger=require(_0x9e46('0x6'))(_0x9e46('0x7'));exports['info']=function(_0x2d2c93,_0x485b9d){logger['info'](_0x2d2c93,_0x485b9d?util['inspect'](_0x485b9d,{'showHidden':![],'depth':null}):'');};exports[_0x9e46('0x8')]=function(_0x278971,_0x5e700b){logger['debug'](_0x278971,_0x5e700b?util[_0x9e46('0x9')](_0x5e700b,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x163643,_0x733f69){logger[_0x9e46('0xa')](_0x163643,_0x733f69?util[_0x9e46('0x9')](_0x733f69,{'showHidden':![],'depth':null}):'');};exports[_0x9e46('0xb')]=function(_0x280f8c,_0x33d940){return client[_0x9e46('0xb')](_0x280f8c,{'body':_0x33d940})[_0x9e46('0xc')](function(_0x236918){logger[_0x9e46('0x8')](_0x9e46('0xd'),_0x280f8c,_0x236918?util[_0x9e46('0x9')](_0x236918,{'showHidden':![],'depth':null}):'');})[_0x9e46('0xe')](function(_0x18411f){logger[_0x9e46('0xa')](_0x9e46('0xd'),_0x280f8c,_0x18411f?util[_0x9e46('0x9')](_0x18411f,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2a8aa6){return client[_0x9e46('0xb')](_0x9e46('0xf'),{'options':{'raw':!![],'attributes':['id',_0x9e46('0x10'),_0x9e46('0x11'),_0x9e46('0x12')],'where':_0x2a8aa6,'limit':0x1}})['then'](function(_0x326fde){logger[_0x9e46('0x8')](_0x9e46('0x13'),JSON['stringify'](_0x2a8aa6),_0x326fde?util[_0x9e46('0x9')](_0x326fde,{'showHidden':![],'depth':null}):'');return _0x326fde[_0x9e46('0x14')][_0x9e46('0x15')]?_0x326fde[_0x9e46('0x14')][0x0]:null;});}exports[_0x9e46('0x16')]=function(_0x19f189){return new BPromise(function(_0x1fe5fa,_0x44efa2){if(_0x19f189){return getUser({'internal':_0x19f189})[_0x9e46('0xc')](function(_0x4e0e93){logger[_0x9e46('0x17')](_0x9e46('0x18'),_0x19f189,_0x4e0e93?'found':_0x9e46('0x19'));return _0x1fe5fa(_0x4e0e93);})[_0x9e46('0xe')](function(_0x474574){logger[_0x9e46('0xa')]('[utils][getUserByInternal]',_0x474574?util['inspect'](_0x474574,{'showHidden':![],'depth':null}):'');return _0x1fe5fa(null);});}return _0x1fe5fa(null);});};exports[_0x9e46('0x1a')]=function(_0x3f5057){return new BPromise(function(_0x5a888b,_0x4dfd1f){if(_0x3f5057){return getUser({'interface':_0x3f5057})[_0x9e46('0xc')](function(_0xfbb3de){logger[_0x9e46('0x17')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x3f5057,_0xfbb3de?'found':_0x9e46('0x19'));return _0x5a888b(_0xfbb3de);})['catch'](function(_0x272e43){logger[_0x9e46('0xa')](_0x9e46('0x1b'),_0x272e43?util[_0x9e46('0x9')](_0x272e43,{'showHidden':![],'depth':null}):'');return _0x5a888b(null);});}return _0x5a888b(null);});};exports[_0x9e46('0x1c')]=function(_0x1acb2a){return new BPromise(function(_0x52304c,_0x5d19be){if(_0x1acb2a){return getUser({'name':_0x1acb2a})[_0x9e46('0xc')](function(_0x1c0774){logger['info'](_0x9e46('0x1d'),_0x1acb2a,_0x1c0774?'found':_0x9e46('0x19'));return _0x52304c(_0x1c0774);})['catch'](function(_0x4c94f6){logger[_0x9e46('0xa')]('[utils][getUserByName]',_0x4c94f6?util[_0x9e46('0x9')](_0x4c94f6,{'showHidden':![],'depth':null}):'');return _0x52304c(null);});}return _0x52304c(null);});};exports['getVoiceQueueByName']=function(_0x21a5a8){return new BPromise(function(_0xdf3625,_0x454005){if(_0x21a5a8){return client[_0x9e46('0xb')](_0x9e46('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x9e46('0x11'),_0x9e46('0x1f'),'acw',_0x9e46('0x20')],'where':{'name':_0x21a5a8},'limit':0x1}})[_0x9e46('0xc')](function(_0x4a64c2){logger[_0x9e46('0x8')](_0x9e46('0x21'),_0x21a5a8,_0x4a64c2?util[_0x9e46('0x9')](_0x4a64c2,{'showHidden':![],'depth':null}):'');logger[_0x9e46('0x17')](_0x9e46('0x22'),_0x21a5a8,_0x4a64c2?_0x9e46('0x23'):_0x9e46('0x19'));return _0xdf3625(_0x4a64c2['result'][_0x9e46('0x15')]?_0x4a64c2[_0x9e46('0x14')][0x0]:null);})[_0x9e46('0xe')](function(_0x2757c5){logger['error']('[utils][getVoiceQueueByName]',_0x2757c5?util['inspect'](_0x2757c5,{'showHidden':![],'depth':null}):'');return _0xdf3625(null);});}return _0xdf3625(null);});};exports[_0x9e46('0x24')]=function(_0x1d1947,_0x537d00){return moment(_0x1d1947)[_0x9e46('0x25')](_0x537d00,_0x9e46('0x26'))['format'](_0x9e46('0x27'));};exports[_0x9e46('0x28')]=function(_0x4288b7,_0x59f5c4){return moment(_0x4288b7)['subtract'](_0x59f5c4,_0x9e46('0x26'))[_0x9e46('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x9e46('0x2a')]=function(_0x1f4b76,_0x1f1e89){return moment(_0x1f4b76)['diff'](moment(_0x1f1e89),_0x9e46('0x26'));};exports[_0x9e46('0x2b')]=function(_0x256b44,_0x13ef74){return parseInt(_0x256b44,0xa)+parseInt(_0x13ef74,0xa);};exports[_0x9e46('0x2c')]=function(){return moment()['format'](_0x9e46('0x27'));};exports['isAfter']=function(_0x5835de,_0x3e2fb1){if(_0x3e2fb1){return moment(_0x5835de)['isAfter'](_0x3e2fb1);}return!![];};exports[_0x9e46('0x2d')]=function(_0x5a4349,_0xacc4fb){if(_0xacc4fb){return moment(_0x5a4349)[_0x9e46('0x2d')](_0xacc4fb);}else if(_0x5a4349){return!![];}return![];}; \ No newline at end of file +var _0xf6ed=['request','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','moment','client','http','xdr','info','debug','inspect','error'];(function(_0x284d33,_0x5b003f){var _0x225cf8=function(_0xe512c4){while(--_0xe512c4){_0x284d33['push'](_0x284d33['shift']());}};_0x225cf8(++_0x5b003f);}(_0xf6ed,0x1ce));var _0xdf6e=function(_0x3ba206,_0x549cf2){_0x3ba206=_0x3ba206-0x0;var _0x292706=_0xf6ed[_0x3ba206];return _0x292706;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0xdf6e('0x0'));var util=require('util');var client=jayson[_0xdf6e('0x1')][_0xdf6e('0x2')]({'port':0x2329});var logger=require('../../config/logger')(_0xdf6e('0x3'));exports['info']=function(_0x3c635c,_0x3992d7){logger[_0xdf6e('0x4')](_0x3c635c,_0x3992d7?util['inspect'](_0x3992d7,{'showHidden':![],'depth':null}):'');};exports[_0xdf6e('0x5')]=function(_0x1b6c6c,_0x1fd20c){logger[_0xdf6e('0x5')](_0x1b6c6c,_0x1fd20c?util[_0xdf6e('0x6')](_0x1fd20c,{'showHidden':![],'depth':null}):'');};exports[_0xdf6e('0x7')]=function(_0x433411,_0x4a470a){logger[_0xdf6e('0x7')](_0x433411,_0x4a470a?util[_0xdf6e('0x6')](_0x4a470a,{'showHidden':![],'depth':null}):'');};exports[_0xdf6e('0x8')]=function(_0x230bd7,_0x3603ce){return client[_0xdf6e('0x8')](_0x230bd7,{'body':_0x3603ce})['then'](function(_0x3b0d50){logger[_0xdf6e('0x5')](_0xdf6e('0x9'),_0x230bd7,_0x3b0d50?util[_0xdf6e('0x6')](_0x3b0d50,{'showHidden':![],'depth':null}):'');})[_0xdf6e('0xa')](function(_0x323bd9){logger[_0xdf6e('0x7')](_0xdf6e('0x9'),_0x230bd7,_0x323bd9?util[_0xdf6e('0x6')](_0x323bd9,{'showHidden':![],'depth':null}):'');});};function getUser(_0x29e0c7){return client[_0xdf6e('0x8')](_0xdf6e('0xb'),{'options':{'raw':!![],'attributes':['id',_0xdf6e('0xc'),_0xdf6e('0xd'),_0xdf6e('0xe')],'where':_0x29e0c7,'limit':0x1}})[_0xdf6e('0xf')](function(_0x4cd837){logger['debug'](_0xdf6e('0x10'),JSON[_0xdf6e('0x11')](_0x29e0c7),_0x4cd837?util[_0xdf6e('0x6')](_0x4cd837,{'showHidden':![],'depth':null}):'');return _0x4cd837[_0xdf6e('0x12')]['length']?_0x4cd837[_0xdf6e('0x12')][0x0]:null;});}exports[_0xdf6e('0x13')]=function(_0x5c3966){return new BPromise(function(_0x554cb9,_0xe5db14){if(_0x5c3966){return getUser({'internal':_0x5c3966})[_0xdf6e('0xf')](function(_0x575d13){logger[_0xdf6e('0x4')](_0xdf6e('0x14'),_0x5c3966,_0x575d13?_0xdf6e('0x15'):_0xdf6e('0x16'));return _0x554cb9(_0x575d13);})[_0xdf6e('0xa')](function(_0x45cc55){logger[_0xdf6e('0x7')](_0xdf6e('0x17'),_0x45cc55?util['inspect'](_0x45cc55,{'showHidden':![],'depth':null}):'');return _0x554cb9(null);});}return _0x554cb9(null);});};exports[_0xdf6e('0x18')]=function(_0x3441fc){return new BPromise(function(_0x5d5156,_0xbcd108){if(_0x3441fc){return getUser({'interface':_0x3441fc})[_0xdf6e('0xf')](function(_0x3828d6){logger['info'](_0xdf6e('0x19'),_0x3441fc,_0x3828d6?_0xdf6e('0x15'):_0xdf6e('0x16'));return _0x5d5156(_0x3828d6);})['catch'](function(_0x53253c){logger[_0xdf6e('0x7')]('[utils][getUserByInterface]',_0x53253c?util[_0xdf6e('0x6')](_0x53253c,{'showHidden':![],'depth':null}):'');return _0x5d5156(null);});}return _0x5d5156(null);});};exports['getUserByName']=function(_0x4bbc5f){return new BPromise(function(_0x455cca,_0x1b55f6){if(_0x4bbc5f){return getUser({'name':_0x4bbc5f})[_0xdf6e('0xf')](function(_0x5c7a24){logger['info'](_0xdf6e('0x1a'),_0x4bbc5f,_0x5c7a24?_0xdf6e('0x15'):'notfound');return _0x455cca(_0x5c7a24);})[_0xdf6e('0xa')](function(_0x1a3abb){logger['error'](_0xdf6e('0x1b'),_0x1a3abb?util[_0xdf6e('0x6')](_0x1a3abb,{'showHidden':![],'depth':null}):'');return _0x455cca(null);});}return _0x455cca(null);});};exports[_0xdf6e('0x1c')]=function(_0x52c45e){return new BPromise(function(_0x436821,_0x5e5474){if(_0x52c45e){return client[_0xdf6e('0x8')](_0xdf6e('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xdf6e('0xd'),_0xdf6e('0x1e'),_0xdf6e('0x1f'),_0xdf6e('0x20')],'where':{'name':_0x52c45e},'limit':0x1}})[_0xdf6e('0xf')](function(_0x21ad88){logger[_0xdf6e('0x5')](_0xdf6e('0x21'),_0x52c45e,_0x21ad88?util['inspect'](_0x21ad88,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x52c45e,_0x21ad88?'found':_0xdf6e('0x16'));return _0x436821(_0x21ad88['result'][_0xdf6e('0x22')]?_0x21ad88['result'][0x0]:null);})[_0xdf6e('0xa')](function(_0x7a364d){logger[_0xdf6e('0x7')](_0xdf6e('0x23'),_0x7a364d?util[_0xdf6e('0x6')](_0x7a364d,{'showHidden':![],'depth':null}):'');return _0x436821(null);});}return _0x436821(null);});};exports[_0xdf6e('0x24')]=function(_0x4ecb91,_0x13dc3d){return moment(_0x4ecb91)[_0xdf6e('0x25')](_0x13dc3d,_0xdf6e('0x26'))[_0xdf6e('0x27')](_0xdf6e('0x28'));};exports['subtractTime']=function(_0x1df5e3,_0x5a8b4a){return moment(_0x1df5e3)['subtract'](_0x5a8b4a,_0xdf6e('0x26'))[_0xdf6e('0x27')](_0xdf6e('0x28'));};exports[_0xdf6e('0x29')]=function(_0x205687,_0x21eaf5){return moment(_0x205687)[_0xdf6e('0x2a')](moment(_0x21eaf5),_0xdf6e('0x26'));};exports[_0xdf6e('0x2b')]=function(_0x1794cc,_0x3fb572){return parseInt(_0x1794cc,0xa)+parseInt(_0x3fb572,0xa);};exports[_0xdf6e('0x2c')]=function(){return moment()[_0xdf6e('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x4d5d92,_0x293f29){if(_0x293f29){return moment(_0x4d5d92)[_0xdf6e('0x2d')](_0x293f29);}return!![];};exports[_0xdf6e('0x2e')]=function(_0x54a0fd,_0x2a38c0){if(_0x2a38c0){return moment(_0x54a0fd)[_0xdf6e('0x2e')](_0x2a38c0);}else if(_0x54a0fd){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index d571dff..bbebe4f 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ddc=['name','inspect','use','%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)','statusCode','responseTime','other','agent_name','test','setupLoggers','fs-extra','path','util','./loggers','fileLogger','./safe-template','safeTemplate','maskSensitiveData','/var','join','client','role','catch','log','user','then','no-user','timestamp','error','api','auth','set','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'];(function(_0x13a52e,_0x502f2e){var _0xcbc8c3=function(_0x228265){while(--_0x228265){_0x13a52e['push'](_0x13a52e['shift']());}};_0xcbc8c3(++_0x502f2e);}(_0x2ddc,0x9a));var _0xc2dd=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x2ddc[_0x2aea9e];return _0x430b92;};var fs=require(_0xc2dd('0x0'));var _=require('lodash');var ewinston=require('express-winston');var path=require(_0xc2dd('0x1'));var util=require(_0xc2dd('0x2'));var fileLogger=require(_0xc2dd('0x3'))[_0xc2dd('0x4')];var safeTemplate=require(_0xc2dd('0x5'))[_0xc2dd('0x6')];var maskSensitiveData=require('./mask-sensitive-data')[_0xc2dd('0x7')];function ClientSideLogger(){function _0x46e123(_0x5b46e3){var _0x409bb7=path['join'](_0xc2dd('0x8'),'log','xcally');var _0x557894=path[_0xc2dd('0x9')](_0xc2dd('0xa'),_0x5b46e3[_0xc2dd('0xb')]+'-'+_0x5b46e3['name']);return fs['ensureDir'](path['join'](_0x409bb7,_0x557894))['then'](function(){var _0x676f3=fileLogger(_0xc2dd('0xa'),path[_0xc2dd('0x9')](_0x409bb7,_0x557894));return _0x676f3;})[_0xc2dd('0xc')](function(_0x4bb7cb){throw _0x4bb7cb;});}this[_0xc2dd('0xd')]=function(_0xb48c90,_0x4d1619,_0x49f6fa,_0x4116b6){return _0x46e123(_0xb48c90[_0xc2dd('0xe')])['then'](function(_0x30ab13){var _0x5e75a8=_0x30ab13[_0x4d1619];return _0x5e75a8;})[_0xc2dd('0xf')](function(_0x230023){var _0x12a646=_0xb48c90['user']?_0xb48c90[_0xc2dd('0xe')]['id']:_0xc2dd('0x10');var _0x2d9c84=_0x4116b6['data'];var _0x2e20d5=_0x4116b6[_0xc2dd('0x11')];var _0x4fb48c=new Date(Number(_0x2e20d5));return _0x230023(_0x12a646,_0x4fb48c,_0x49f6fa,_0x2d9c84);})['catch'](function(_0xb118b5){fileLogger(_0xc2dd('0xa'))[_0xc2dd('0x12')](_0xb118b5);});};}function setupLoggers(_0x400657){return new Promise(function(_0x151dd1){var _0xdcca9d=new ClientSideLogger();var _0xb19a76=fileLogger(_0xc2dd('0x13'));var _0x575d8a=fileLogger(_0xc2dd('0x14'));_0x400657[_0xc2dd('0x15')]('client-side-logger',_0xdcca9d);_0x400657['use'](ewinston[_0xc2dd('0x16')]({'winstonInstance':_0xb19a76,'meta':![],'statusLevels':!![],'msg':function(_0x2f6c78,_0x51053d){var _0x69a11e=_0xc2dd('0x17');if(!_[_0xc2dd('0x18')](_0x2f6c78[_0xc2dd('0x19')])){_0x69a11e+=_0xc2dd('0x1a');var _0x4eb568=_0x2f6c78['body'];maskSensitiveData(_0x4eb568);}return safeTemplate(util[_0xc2dd('0x1b')](_0x69a11e,_0x2f6c78[_0xc2dd('0x1c')],_0x2f6c78[_0xc2dd('0x1d')][_0xc2dd('0x1e')]?_0x2f6c78[_0xc2dd('0x1d')]['x-forwarded-for']:_0x2f6c78[_0xc2dd('0x1f')][_0xc2dd('0x20')]||_0x2f6c78['ip'],_0x2f6c78[_0xc2dd('0x21')],_0x51053d['statusCode'],_0x51053d['responseTime'],_0x2f6c78['user']?_0x2f6c78[_0xc2dd('0xe')]['id']:null,_0x2f6c78[_0xc2dd('0xe')]?_0x2f6c78[_0xc2dd('0xe')][_0xc2dd('0x22')]:null,_0x2f6c78[_0xc2dd('0xe')]?_0x2f6c78['user']['role']:null,_0x4eb568?util[_0xc2dd('0x23')](_0x4eb568,![],null):''));}}));_0x400657[_0xc2dd('0x24')](ewinston[_0xc2dd('0x16')]({'winstonInstance':_0x575d8a,'meta':![],'statusLevels':!![],'msg':function(_0x212b80,_0x23b12){var _0xdb6331=_0xc2dd('0x25');if(_0x212b80[_0xc2dd('0x19')]&&_0x212b80[_0xc2dd('0x19')][_0xc2dd('0x26')]&&_0x212b80['body'][_0xc2dd('0x27')]){_0xdb6331=_0xc2dd('0x28');}return util[_0xc2dd('0x1b')](_0xdb6331,_0x212b80[_0xc2dd('0x1c')],_0x212b80[_0xc2dd('0x1d')]['x-forwarded-for']?_0x212b80[_0xc2dd('0x1d')][_0xc2dd('0x1e')]:_0x212b80[_0xc2dd('0x1f')][_0xc2dd('0x20')]||_0x212b80['ip'],_0x212b80[_0xc2dd('0x21')],_0x23b12[_0xc2dd('0x29')],_0x23b12[_0xc2dd('0x2a')],_0x212b80[_0xc2dd('0xe')]?_0x212b80[_0xc2dd('0xe')]['id']:null,_0x212b80[_0xc2dd('0xe')]?_0x212b80['user'][_0xc2dd('0x22')]:null,_0x212b80[_0xc2dd('0xe')]?_0x212b80['user'][_0xc2dd('0xb')]:null,_0x212b80[_0xc2dd('0x19')]&&_0x212b80[_0xc2dd('0x19')][_0xc2dd('0x26')]?_0x212b80['body'][_0xc2dd('0x26')]:_0xc2dd('0x2b'),_0x212b80['body']&&_0x212b80[_0xc2dd('0x19')][_0xc2dd('0x27')]?_0x212b80['body']['agent_id']:'',_0x212b80[_0xc2dd('0x19')]&&_0x212b80['body'][_0xc2dd('0x2c')]?_0x212b80[_0xc2dd('0x19')][_0xc2dd('0x2c')]:'');},'ignoreRoute':function(_0x4d8430){var _0x140f03=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x140f03[_0xc2dd('0x2d')](_0x4d8430[_0xc2dd('0x21')]);}}));return _0x151dd1();});}exports[_0xc2dd('0x2e')]=setupLoggers; \ No newline at end of file +var _0x8c1d=['other','agent_name','test','fs-extra','lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','client','name','ensureDir','then','log','user','error','api','auth','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','method','headers','x-forwarded-for','remoteAddress','url','responseTime','role','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','connection','statusCode'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x8c1d,0x145));var _0xd8c1=function(_0x397eee,_0x5ad835){_0x397eee=_0x397eee-0x0;var _0x3d3fcc=_0x8c1d[_0x397eee];return _0x3d3fcc;};var fs=require(_0xd8c1('0x0'));var _=require(_0xd8c1('0x1'));var ewinston=require('express-winston');var path=require(_0xd8c1('0x2'));var util=require(_0xd8c1('0x3'));var fileLogger=require(_0xd8c1('0x4'))[_0xd8c1('0x5')];var safeTemplate=require(_0xd8c1('0x6'))[_0xd8c1('0x7')];var maskSensitiveData=require(_0xd8c1('0x8'))[_0xd8c1('0x9')];function ClientSideLogger(){function _0x31a1ce(_0x3201b2){var _0x1b503a=path[_0xd8c1('0xa')](_0xd8c1('0xb'),'log','xcally');var _0x7cbc02=path['join'](_0xd8c1('0xc'),_0x3201b2['role']+'-'+_0x3201b2[_0xd8c1('0xd')]);return fs[_0xd8c1('0xe')](path[_0xd8c1('0xa')](_0x1b503a,_0x7cbc02))[_0xd8c1('0xf')](function(){var _0xab1f1=fileLogger('client',path[_0xd8c1('0xa')](_0x1b503a,_0x7cbc02));return _0xab1f1;})['catch'](function(_0x281bdf){throw _0x281bdf;});}this[_0xd8c1('0x10')]=function(_0x3cdf2c,_0x30aab0,_0x2607df,_0x4464d0){return _0x31a1ce(_0x3cdf2c[_0xd8c1('0x11')])[_0xd8c1('0xf')](function(_0x244ece){var _0x13928a=_0x244ece[_0x30aab0];return _0x13928a;})[_0xd8c1('0xf')](function(_0x5d7ad9){var _0x520b91=_0x3cdf2c[_0xd8c1('0x11')]?_0x3cdf2c[_0xd8c1('0x11')]['id']:'no-user';var _0x1c585b=_0x4464d0['data'];var _0x567a34=_0x4464d0['timestamp'];var _0x2eecfe=new Date(Number(_0x567a34));return _0x5d7ad9(_0x520b91,_0x2eecfe,_0x2607df,_0x1c585b);})['catch'](function(_0xf9d11f){fileLogger(_0xd8c1('0xc'))[_0xd8c1('0x12')](_0xf9d11f);});};}function setupLoggers(_0x3a1a40){return new Promise(function(_0x54d71f){var _0x4a2ffa=new ClientSideLogger();var _0x13b2da=fileLogger(_0xd8c1('0x13'));var _0x5f29a8=fileLogger(_0xd8c1('0x14'));_0x3a1a40['set'](_0xd8c1('0x15'),_0x4a2ffa);_0x3a1a40['use'](ewinston[_0xd8c1('0x16')]({'winstonInstance':_0x13b2da,'meta':![],'statusLevels':!![],'msg':function(_0x3101e2,_0x5ca8e4){var _0x19b2b1=_0xd8c1('0x17');if(!_[_0xd8c1('0x18')](_0x3101e2['body'])){_0x19b2b1+=_0xd8c1('0x19');var _0x191ace=_0x3101e2[_0xd8c1('0x1a')];maskSensitiveData(_0x191ace);}return safeTemplate(util['format'](_0x19b2b1,_0x3101e2[_0xd8c1('0x1b')],_0x3101e2[_0xd8c1('0x1c')]['x-forwarded-for']?_0x3101e2[_0xd8c1('0x1c')][_0xd8c1('0x1d')]:_0x3101e2['connection'][_0xd8c1('0x1e')]||_0x3101e2['ip'],_0x3101e2[_0xd8c1('0x1f')],_0x5ca8e4['statusCode'],_0x5ca8e4[_0xd8c1('0x20')],_0x3101e2[_0xd8c1('0x11')]?_0x3101e2[_0xd8c1('0x11')]['id']:null,_0x3101e2[_0xd8c1('0x11')]?_0x3101e2[_0xd8c1('0x11')][_0xd8c1('0xd')]:null,_0x3101e2[_0xd8c1('0x11')]?_0x3101e2[_0xd8c1('0x11')][_0xd8c1('0x21')]:null,_0x191ace?util[_0xd8c1('0x22')](_0x191ace,![],null):''));}}));_0x3a1a40[_0xd8c1('0x23')](ewinston['logger']({'winstonInstance':_0x5f29a8,'meta':![],'statusLevels':!![],'msg':function(_0x21e8d0,_0x43ecc6){var _0xc5100f=_0xd8c1('0x24');if(_0x21e8d0['body']&&_0x21e8d0[_0xd8c1('0x1a')][_0xd8c1('0x25')]&&_0x21e8d0[_0xd8c1('0x1a')][_0xd8c1('0x26')]){_0xc5100f=_0xd8c1('0x27');}return util[_0xd8c1('0x28')](_0xc5100f,_0x21e8d0['method'],_0x21e8d0['headers']['x-forwarded-for']?_0x21e8d0[_0xd8c1('0x1c')][_0xd8c1('0x1d')]:_0x21e8d0[_0xd8c1('0x29')][_0xd8c1('0x1e')]||_0x21e8d0['ip'],_0x21e8d0[_0xd8c1('0x1f')],_0x43ecc6[_0xd8c1('0x2a')],_0x43ecc6[_0xd8c1('0x20')],_0x21e8d0['user']?_0x21e8d0[_0xd8c1('0x11')]['id']:null,_0x21e8d0[_0xd8c1('0x11')]?_0x21e8d0['user'][_0xd8c1('0xd')]:null,_0x21e8d0['user']?_0x21e8d0['user']['role']:null,_0x21e8d0[_0xd8c1('0x1a')]&&_0x21e8d0[_0xd8c1('0x1a')]['device']?_0x21e8d0['body'][_0xd8c1('0x25')]:_0xd8c1('0x2b'),_0x21e8d0[_0xd8c1('0x1a')]&&_0x21e8d0[_0xd8c1('0x1a')]['agent_id']?_0x21e8d0['body']['agent_id']:'',_0x21e8d0[_0xd8c1('0x1a')]&&_0x21e8d0['body'][_0xd8c1('0x2c')]?_0x21e8d0['body']['agent_name']:'');},'ignoreRoute':function(_0x467a57){var _0x6d5e09=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x6d5e09[_0xd8c1('0x2d')](_0x467a57[_0xd8c1('0x1f')]);}}));return _0x54d71f();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index fb982cf..dda4242 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1423=['locale','weekdaysShort','indexOf','slice','concat','circularDoWInterval','monthsShort','toLowerCase','exports','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','format','ddd','includes','date','daysInMonth','max','min','domCompare','MMM','monthCompare','guess','test','isMoment','split','padStart','length','iftime','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid'];(function(_0x4937cb,_0x5287a6){var _0x20b5e1=function(_0x33644b){while(--_0x33644b){_0x4937cb['push'](_0x4937cb['shift']());}};_0x20b5e1(++_0x5287a6);}(_0x1423,0x1d1));var _0x3142=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1423[_0x2641f9];return _0x585741;};var _=require(_0x3142('0x0'));var moment=require(_0x3142('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x3142('0x2')](function(_0x313ab4){return _0x313ab4[_0x3142('0x3')];})[_0x3142('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x3142('0x5');var EINVALID_DATE=_0x3142('0x6');function throwIfDateNotValid(_0x40d092){if(!_0x40d092[_0x3142('0x7')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x1a61d4){var _0x36a35d=_0x1a61d4['split'](':')[_0x3142('0x2')](function(_0x5dd146){return parseInt(_0x5dd146,0xa);});var _0x4d7ef3=_0x36a35d[0x0];var _0x5779c0=_0x36a35d[0x1];if(_0x4d7ef3<0x0||_0x4d7ef3>0x17||_0x5779c0<0x0||_0x5779c0>0x3b){throw new Error(EINVALID_DATE);}return[_0x4d7ef3,_0x5779c0];}function circularDoWInterval(_0x2092bd,_0x49822b){if(_0x2092bd===_0x49822b){return[_0x2092bd];}else{var _0x2ac6d1=moment[_0x3142('0x8')]();moment[_0x3142('0x8')]('en');var _0x534beb=moment[_0x3142('0x9')]()[_0x3142('0x2')](function(_0x4203cf){return _0x4203cf['toLowerCase']();});moment[_0x3142('0x8')](_0x2ac6d1);var _0x176e4a=_0x534beb[_0x3142('0xa')](_0x2092bd);var _0x8aa970=_0x534beb[_0x3142('0xa')](_0x49822b);if(_0x8aa970>_0x176e4a){return _0x534beb['slice'](_0x176e4a,_0x8aa970+0x1);}else{var _0x3c88a7=_0x534beb[_0x3142('0xb')](0x0,_0x8aa970+0x1);var _0x59ed0b=_0x534beb['slice'](_0x176e4a);return _0x59ed0b[_0x3142('0xc')](_0x3c88a7);}}}module['exports'][_0x3142('0xd')]=circularDoWInterval;function circularMonthInterval(_0x3fa604,_0x5bfb72){if(_0x3fa604===_0x5bfb72){return[_0x3fa604];}else{var _0x10f551=moment['locale']();moment[_0x3142('0x8')]('en');var _0xa0e746=moment[_0x3142('0xe')]()[_0x3142('0x2')](function(_0x366c95){return _0x366c95[_0x3142('0xf')]();});moment['locale'](_0x10f551);var _0x54c778=_0xa0e746[_0x3142('0xa')](_0x3fa604);var _0x1e8acb=_0xa0e746[_0x3142('0xa')](_0x5bfb72);if(_0x1e8acb>_0x54c778){return _0xa0e746[_0x3142('0xb')](_0x54c778,_0x1e8acb+0x1);}else{var _0x5c6f19=_0xa0e746[_0x3142('0xb')](0x0,_0x1e8acb+0x1);var _0x2f0594=_0xa0e746[_0x3142('0xb')](_0x54c778);return _0x2f0594[_0x3142('0xc')](_0x5c6f19);}}}module[_0x3142('0x10')][_0x3142('0x11')]=circularMonthInterval;function parseDom(_0x48f6f7){var _0xb932ca=parseInt(_0x48f6f7,0xa);if(_0xb932ca<0x1||_0xb932ca>0x1f){throw new Error(EINVALID_DATE);}return _0xb932ca;}function timeCompare(_0x2a23ad,_0x37229b,_0x5ef85c){var _0x1e60a1=_0x2a23ad[_0x3142('0x12')]();var _0x153ce7=extractTime(_0x37229b);var _0x55fbbb=_0x153ce7[0x0];var _0x3fa983=_0x153ce7[0x1];var _0x172efc=_0x2a23ad[_0x3142('0x12')]()[_0x3142('0x13')](_0x55fbbb)[_0x3142('0x14')](_0x3fa983);throwIfDateNotValid(_0x172efc);var _0x4d69e5=extractTime(_0x5ef85c);var _0x3cb1a2=_0x4d69e5[0x0];var _0x1df201=_0x4d69e5[0x1];var _0xded86b=_0x2a23ad['clone']()['hours'](_0x3cb1a2)['minutes'](_0x1df201);throwIfDateNotValid(_0xded86b);if(_0xded86b[_0x3142('0x15')](_0x172efc)){var _0x4864d4=_0x1e60a1[_0x3142('0x12')]()[_0x3142('0x16')](_0x3142('0x17'));var _0x3abff5=_0x1e60a1[_0x3142('0x12')]()[_0x3142('0x18')](_0x3142('0x17'));return _0x1e60a1[_0x3142('0x19')](_0x172efc,_0x3abff5,undefined,'[]')||_0x1e60a1[_0x3142('0x19')](_0x4864d4,_0xded86b,undefined,'[]');}else{return _0x1e60a1['isBetween'](_0x172efc,_0xded86b,undefined,'[]');}}module[_0x3142('0x10')]['timeCompare']=timeCompare;function dowCompare(_0x4c3e73,_0x39959e,_0x51038d){var _0x161d91=_0x4c3e73['locale']('en')[_0x3142('0x1a')](_0x3142('0x1b'))['toLowerCase']();return circularDoWInterval(_0x39959e,_0x51038d)[_0x3142('0x1c')](_0x161d91);}module['exports']['dowCompare']=dowCompare;function domCompare(_0x946e17,_0x209117,_0x85ecb){var _0x351be8=_0x946e17[_0x3142('0x1d')]();if(_0x209117===_0x85ecb){return _0x351be8===_0x209117;}else{var _0xd4ebbe=_0x946e17[_0x3142('0x1e')]();var _0x3631f4=_0x209117<_0x85ecb;let _0x552992=![];var _0x998f1d=0x0;var _0x47a587=0x0;if(_0x3631f4){_0x998f1d=Math[_0x3142('0x1f')](0x1,_0x209117);_0x47a587=Math[_0x3142('0x20')](_0x85ecb,_0xd4ebbe);_0x552992=_0x351be8>=_0x998f1d&&_0x351be8<=_0x47a587;}else{_0x998f1d=Math['min'](_0x209117,_0xd4ebbe);_0x47a587=Math[_0x3142('0x1f')](0x1,_0x85ecb);_0x552992=_0x351be8>=_0x998f1d||_0x351be8<=_0x47a587;}return _0x552992;}}module[_0x3142('0x10')][_0x3142('0x21')]=domCompare;function monthCompare(_0x5d8f1f,_0xc949ca,_0x3c5e21){var _0x1dd8c1=_0x5d8f1f[_0x3142('0x8')]('en')[_0x3142('0x1a')](_0x3142('0x22'))[_0x3142('0xf')]();return circularMonthInterval(_0xc949ca,_0x3c5e21)[_0x3142('0x1c')](_0x1dd8c1);}module[_0x3142('0x10')][_0x3142('0x23')]=monthCompare;function iftime(_0x47353a,_0x25f75e=moment['tz'][_0x3142('0x24')](),_0x2b96e3=moment()){if(!validateRx[_0x3142('0x25')](_0x47353a)){throw new Error(EINVALID_STRING);}else{var _0x68911d=(moment[_0x3142('0x26')](_0x2b96e3)?_0x2b96e3[_0x3142('0x12')]():moment(_0x2b96e3))['tz'](_0x25f75e)[_0x3142('0x8')]('en');throwIfDateNotValid(_0x68911d);var _0x57c6c1=_0x47353a[_0x3142('0x27')](',');var _0x4bc5fe=_0x57c6c1[0x0];var _0x34930f=_0x57c6c1[0x1];var _0x1bd6b1=_0x57c6c1[0x2];var _0x36e053=_0x57c6c1[0x3];let _0x31b0d0=!![];if(_0x4bc5fe!=='*'){var _0x37d7ff=_0x4bc5fe[_0x3142('0x27')]('-');var _0x3cdf63=_[_0x3142('0x28')](_0x37d7ff[0x0],0x5,'0');var _0x37c56a=_0x37d7ff['length']===0x2?_[_0x3142('0x28')](_0x37d7ff[0x1],0x5,'0'):_0x3cdf63;_0x31b0d0=timeCompare(_0x68911d,_0x3cdf63,_0x37c56a);}let _0x2cc8e1=!![];if(_0x34930f!=='*'){var _0x19d46d=_0x34930f['split']('-');var _0x5f57ba=_0x19d46d[0x0];var _0x3009cc=_0x19d46d[_0x3142('0x29')]===0x2?_0x19d46d[0x1]:_0x5f57ba;_0x2cc8e1=dowCompare(_0x68911d,_0x5f57ba,_0x3009cc);}let _0x2e476b=!![];if(_0x1bd6b1!=='*'){var _0x3075c6=_0x1bd6b1[_0x3142('0x27')]('-');var _0x20ca90=parseDom(_0x3075c6[0x0]);var _0x5a0235=_0x3075c6[_0x3142('0x29')]===0x2?parseDom(_0x3075c6[0x1]):_0x20ca90;_0x2e476b=domCompare(_0x68911d,_0x20ca90,_0x5a0235);}let _0xf92aff=!![];if(_0x36e053!=='*'){var _0x5ee7c3=_0x36e053[_0x3142('0x27')]('-');var _0xcdeb41=_0x5ee7c3[0x0];var _0x16d4a=_0x5ee7c3[_0x3142('0x29')]===0x2?_0x5ee7c3[0x1]:_0x5ee7c3[0x0];_0xf92aff=monthCompare(_0x68911d,_0xcdeb41,_0x16d4a);}return _0x31b0d0&&_0x2cc8e1&&_0x2e476b&&_0xf92aff;}}module[_0x3142('0x10')][_0x3142('0x2a')]=iftime; \ No newline at end of file +var _0xc645=['ddd','includes','dowCompare','date','daysInMonth','min','domCompare','monthCompare','guess','test','isMoment','padStart','length','lodash','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','split','locale','weekdaysShort','indexOf','slice','exports','monthsShort','toLowerCase','concat','circularMonthInterval','clone','minutes','hours','startOf','day','timeCompare','format'];(function(_0x1d2bbb,_0x202267){var _0x38082b=function(_0x27d153){while(--_0x27d153){_0x1d2bbb['push'](_0x1d2bbb['shift']());}};_0x38082b(++_0x202267);}(_0xc645,0xc1));var _0x5c64=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xc645[_0x4ae6ef];return _0x3cbb4e;};var _=require(_0x5c64('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x5c64('0x1')](function(_0x417f67){return _0x417f67[_0x5c64('0x2')];})[_0x5c64('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x5c64('0x4');var EINVALID_DATE=_0x5c64('0x5');function throwIfDateNotValid(_0x2e659f){if(!_0x2e659f['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x403962){var _0x1a52ab=_0x403962[_0x5c64('0x6')](':')[_0x5c64('0x1')](function(_0x219056){return parseInt(_0x219056,0xa);});var _0x32cced=_0x1a52ab[0x0];var _0x17fba9=_0x1a52ab[0x1];if(_0x32cced<0x0||_0x32cced>0x17||_0x17fba9<0x0||_0x17fba9>0x3b){throw new Error(EINVALID_DATE);}return[_0x32cced,_0x17fba9];}function circularDoWInterval(_0x14c5a0,_0x56f456){if(_0x14c5a0===_0x56f456){return[_0x14c5a0];}else{var _0x4a3ff2=moment[_0x5c64('0x7')]();moment['locale']('en');var _0x1714c6=moment[_0x5c64('0x8')]()['map'](function(_0x461ed9){return _0x461ed9['toLowerCase']();});moment[_0x5c64('0x7')](_0x4a3ff2);var _0x26d8b2=_0x1714c6['indexOf'](_0x14c5a0);var _0x255396=_0x1714c6[_0x5c64('0x9')](_0x56f456);if(_0x255396>_0x26d8b2){return _0x1714c6['slice'](_0x26d8b2,_0x255396+0x1);}else{var _0x15b89f=_0x1714c6[_0x5c64('0xa')](0x0,_0x255396+0x1);var _0x2dc763=_0x1714c6[_0x5c64('0xa')](_0x26d8b2);return _0x2dc763['concat'](_0x15b89f);}}}module[_0x5c64('0xb')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x2fe961,_0x53e6d6){if(_0x2fe961===_0x53e6d6){return[_0x2fe961];}else{var _0x16a4f8=moment[_0x5c64('0x7')]();moment['locale']('en');var _0x1b6be8=moment[_0x5c64('0xc')]()[_0x5c64('0x1')](function(_0x5642f2){return _0x5642f2[_0x5c64('0xd')]();});moment[_0x5c64('0x7')](_0x16a4f8);var _0xa9424f=_0x1b6be8[_0x5c64('0x9')](_0x2fe961);var _0x1b24cf=_0x1b6be8[_0x5c64('0x9')](_0x53e6d6);if(_0x1b24cf>_0xa9424f){return _0x1b6be8[_0x5c64('0xa')](_0xa9424f,_0x1b24cf+0x1);}else{var _0xb35451=_0x1b6be8[_0x5c64('0xa')](0x0,_0x1b24cf+0x1);var _0x512334=_0x1b6be8[_0x5c64('0xa')](_0xa9424f);return _0x512334[_0x5c64('0xe')](_0xb35451);}}}module[_0x5c64('0xb')][_0x5c64('0xf')]=circularMonthInterval;function parseDom(_0x54636b){var _0x236abf=parseInt(_0x54636b,0xa);if(_0x236abf<0x1||_0x236abf>0x1f){throw new Error(EINVALID_DATE);}return _0x236abf;}function timeCompare(_0x344b8f,_0x1e7ffb,_0x46979f){var _0x5dd86d=_0x344b8f[_0x5c64('0x10')]();var _0x29c510=extractTime(_0x1e7ffb);var _0x202691=_0x29c510[0x0];var _0x4bf5a1=_0x29c510[0x1];var _0x373ba4=_0x344b8f['clone']()['hours'](_0x202691)[_0x5c64('0x11')](_0x4bf5a1);throwIfDateNotValid(_0x373ba4);var _0x1e9355=extractTime(_0x46979f);var _0x140420=_0x1e9355[0x0];var _0x2e8d8c=_0x1e9355[0x1];var _0x217119=_0x344b8f[_0x5c64('0x10')]()[_0x5c64('0x12')](_0x140420)[_0x5c64('0x11')](_0x2e8d8c);throwIfDateNotValid(_0x217119);if(_0x217119['isBefore'](_0x373ba4)){var _0x24cdfa=_0x5dd86d[_0x5c64('0x10')]()[_0x5c64('0x13')](_0x5c64('0x14'));var _0x25a13b=_0x5dd86d['clone']()['endOf'](_0x5c64('0x14'));return _0x5dd86d['isBetween'](_0x373ba4,_0x25a13b,undefined,'[]')||_0x5dd86d['isBetween'](_0x24cdfa,_0x217119,undefined,'[]');}else{return _0x5dd86d['isBetween'](_0x373ba4,_0x217119,undefined,'[]');}}module['exports'][_0x5c64('0x15')]=timeCompare;function dowCompare(_0x55fc53,_0x7b8b38,_0x20c9f7){var _0x44c5ff=_0x55fc53[_0x5c64('0x7')]('en')[_0x5c64('0x16')](_0x5c64('0x17'))[_0x5c64('0xd')]();return circularDoWInterval(_0x7b8b38,_0x20c9f7)[_0x5c64('0x18')](_0x44c5ff);}module[_0x5c64('0xb')][_0x5c64('0x19')]=dowCompare;function domCompare(_0x4b8d03,_0x11ca8f,_0x545fbd){var _0x44254e=_0x4b8d03[_0x5c64('0x1a')]();if(_0x11ca8f===_0x545fbd){return _0x44254e===_0x11ca8f;}else{var _0x3cb66c=_0x4b8d03[_0x5c64('0x1b')]();var _0x89ec65=_0x11ca8f<_0x545fbd;let _0x196287=![];var _0x578ffe=0x0;var _0x46cd15=0x0;if(_0x89ec65){_0x578ffe=Math['max'](0x1,_0x11ca8f);_0x46cd15=Math['min'](_0x545fbd,_0x3cb66c);_0x196287=_0x44254e>=_0x578ffe&&_0x44254e<=_0x46cd15;}else{_0x578ffe=Math[_0x5c64('0x1c')](_0x11ca8f,_0x3cb66c);_0x46cd15=Math['max'](0x1,_0x545fbd);_0x196287=_0x44254e>=_0x578ffe||_0x44254e<=_0x46cd15;}return _0x196287;}}module[_0x5c64('0xb')][_0x5c64('0x1d')]=domCompare;function monthCompare(_0x11779f,_0x35f71c,_0x402326){var _0x27d222=_0x11779f[_0x5c64('0x7')]('en')[_0x5c64('0x16')]('MMM')[_0x5c64('0xd')]();return circularMonthInterval(_0x35f71c,_0x402326)[_0x5c64('0x18')](_0x27d222);}module[_0x5c64('0xb')][_0x5c64('0x1e')]=monthCompare;function iftime(_0x13fc81,_0x27387f=moment['tz'][_0x5c64('0x1f')](),_0x172646=moment()){if(!validateRx[_0x5c64('0x20')](_0x13fc81)){throw new Error(EINVALID_STRING);}else{var _0xb6400f=(moment[_0x5c64('0x21')](_0x172646)?_0x172646[_0x5c64('0x10')]():moment(_0x172646))['tz'](_0x27387f)[_0x5c64('0x7')]('en');throwIfDateNotValid(_0xb6400f);var _0x10b862=_0x13fc81['split'](',');var _0x33289b=_0x10b862[0x0];var _0x1847c3=_0x10b862[0x1];var _0x108d67=_0x10b862[0x2];var _0x265cf8=_0x10b862[0x3];let _0x3edf19=!![];if(_0x33289b!=='*'){var _0x3b1753=_0x33289b[_0x5c64('0x6')]('-');var _0x3b0a0b=_[_0x5c64('0x22')](_0x3b1753[0x0],0x5,'0');var _0x1967a3=_0x3b1753[_0x5c64('0x23')]===0x2?_['padStart'](_0x3b1753[0x1],0x5,'0'):_0x3b0a0b;_0x3edf19=timeCompare(_0xb6400f,_0x3b0a0b,_0x1967a3);}let _0x531ebb=!![];if(_0x1847c3!=='*'){var _0x442f0c=_0x1847c3[_0x5c64('0x6')]('-');var _0x44b0ae=_0x442f0c[0x0];var _0x312196=_0x442f0c['length']===0x2?_0x442f0c[0x1]:_0x44b0ae;_0x531ebb=dowCompare(_0xb6400f,_0x44b0ae,_0x312196);}let _0x3c9d0a=!![];if(_0x108d67!=='*'){var _0x574dc2=_0x108d67[_0x5c64('0x6')]('-');var _0x4c5cab=parseDom(_0x574dc2[0x0]);var _0x3e5ded=_0x574dc2[_0x5c64('0x23')]===0x2?parseDom(_0x574dc2[0x1]):_0x4c5cab;_0x3c9d0a=domCompare(_0xb6400f,_0x4c5cab,_0x3e5ded);}let _0x28fb09=!![];if(_0x265cf8!=='*'){var _0x483875=_0x265cf8[_0x5c64('0x6')]('-');var _0xa1bedc=_0x483875[0x0];var _0x1d9f21=_0x483875[_0x5c64('0x23')]===0x2?_0x483875[0x1]:_0x483875[0x0];_0x28fb09=monthCompare(_0xb6400f,_0xa1bedc,_0x1d9f21);}return _0x3edf19&&_0x531ebb&&_0x3c9d0a&&_0x28fb09;}}module[_0x5c64('0xb')]['iftime']=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index b76deb7..33d941a 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5534=['debugLevel','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','Console','transports','File','error','%s-%s','consoleLogger','fileLogger','path','moment','winston','../config/environment'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x5534,0xb5));var _0x4553=function(_0x38c249,_0x52e6f0){_0x38c249=_0x38c249-0x0;var _0x5c7f3a=_0x5534[_0x38c249];return _0x5c7f3a;};'use strict';var path=require(_0x4553('0x0'));var util=require('util');var moment=require(_0x4553('0x1'));var winston=require(_0x4553('0x2'));var config=require(_0x4553('0x3'));var debugLevel=config[_0x4553('0x4')]?config[_0x4553('0x4')]['toLowerCase']():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':'red','warn':_0x4553('0x5'),'info':_0x4553('0x6'),'print':_0x4553('0x7'),'success':_0x4553('0x8'),'http':_0x4553('0x9'),'verbose':_0x4553('0xa'),'debug':_0x4553('0xb'),'silly':_0x4553('0xc')};winston[_0x4553('0xd')](XC_LOG_COLORS);function getLogFileName(_0x491727,_0x18000d,_0x2ad2da){var _0x3a5db9=_0x491727||_0x4553('0xe');return path['join'](_0x3a5db9,util[_0x4553('0xf')](_0x4553('0x10'),_0x18000d,_0x2ad2da));}function formatter(_0x3ed951,_0x273ba3){_0x273ba3[_0x4553('0x11')]=_0x273ba3[_0x4553('0x11')][_0x4553('0x12')](/@@{/g,_0x4553('0x13'))[_0x4553('0x12')](/}@@/g,_0x4553('0x14'))['replace'](/@{/g,'{{')[_0x4553('0x12')](/}@/g,'}}');return util[_0x4553('0xf')](_0x4553('0x15'),moment()['format'](_0x4553('0x16')),_0x273ba3['level'][_0x4553('0x17')](),_0x3ed951,_0x273ba3[_0x4553('0x11')]);}function fileFormat(_0x5e1a8b,_0x37e3bc){_0x37e3bc[_0x4553('0x11')]=_0x37e3bc[_0x4553('0x11')]['replace'](/@@{/g,_0x4553('0x13'))[_0x4553('0x12')](/}@@/g,_0x4553('0x14'))[_0x4553('0x12')](/@{/g,'{{')[_0x4553('0x12')](/}@/g,'}}');var _0x51d0f6=_0x37e3bc[_0x4553('0x18')]&&Object['keys'](_0x37e3bc[_0x4553('0x18')])[_0x4553('0x19')]?'\x0a\x09'+JSON[_0x4553('0x1a')](_0x37e3bc['meta']):'';return util[_0x4553('0xf')](_0x4553('0x1b'),moment()[_0x4553('0xf')](_0x4553('0x16')),_0x37e3bc[_0x4553('0x1c')][_0x4553('0x17')](),_0x5e1a8b,_0x37e3bc['message'],_0x51d0f6);}function consoleLogger(){var _0x30275a=new winston[(_0x4553('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x4553('0x1e'))]({'level':'warn','json':![],'formatter':function(_0xed07d9){return formatter('',_0xed07d9);}})]});return _0x30275a;}function fileLogger(_0x1f569c,_0x4343b3){var _0x5676ba=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x4553('0x1f'))][(_0x4553('0x20'))]({'name':util[_0x4553('0xf')]('%s-%s',_0x1f569c,_0x4553('0x21')),'filename':getLogFileName(_0x4343b3,_0x1f569c,_0x4553('0x21')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x186761){return fileFormat(_0x1f569c,_0x186761);}}),new winston[(_0x4553('0x1f'))][(_0x4553('0x20'))]({'name':util[_0x4553('0xf')](_0x4553('0x22'),_0x1f569c,debugLevel),'filename':getLogFileName(_0x4343b3,_0x1f569c,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x182173){return fileFormat(_0x1f569c,_0x182173);}}),new winston[(_0x4553('0x1f'))][(_0x4553('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x40410e){return fileFormat(_0x1f569c,_0x40410e);}})]});return _0x5676ba;}exports[_0x4553('0x23')]=consoleLogger;exports[_0x4553('0x24')]=fileLogger; \ No newline at end of file +var _0x98f9=['keys','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','transports','Console','warn','Logger','File','%s-%s','error','consoleLogger','fileLogger','util','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20cyan','addColors','join','format','%s-%s.log','message','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','level','{{{'];(function(_0xf32af1,_0x4086a8){var _0x8148c1=function(_0x3ca5f0){while(--_0x3ca5f0){_0xf32af1['push'](_0xf32af1['shift']());}};_0x8148c1(++_0x4086a8);}(_0x98f9,0x13f));var _0x998f=function(_0x1ea016,_0x1c558e){_0x1ea016=_0x1ea016-0x0;var _0x202e44=_0x98f9[_0x1ea016];return _0x202e44;};'use strict';var path=require('path');var util=require(_0x998f('0x0'));var moment=require('moment');var winston=require(_0x998f('0x1'));var config=require(_0x998f('0x2'));var debugLevel=config[_0x998f('0x3')]?config[_0x998f('0x3')][_0x998f('0x4')]():_0x998f('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x998f('0x6'),'error':'red','warn':_0x998f('0x7'),'info':_0x998f('0x8'),'print':_0x998f('0x9'),'success':_0x998f('0xa'),'http':_0x998f('0xb'),'verbose':_0x998f('0xc'),'debug':'bold\x20blue','silly':_0x998f('0xd')};winston[_0x998f('0xe')](XC_LOG_COLORS);function getLogFileName(_0x29c667,_0x25d246,_0x4abdfb){var _0x78a510=_0x29c667||'/var/log/xcally';return path[_0x998f('0xf')](_0x78a510,util[_0x998f('0x10')](_0x998f('0x11'),_0x25d246,_0x4abdfb));}function formatter(_0x536f80,_0x325e3b){_0x325e3b['message']=_0x325e3b[_0x998f('0x12')][_0x998f('0x13')](/@@{/g,'{{{')['replace'](/}@@/g,'}}}')[_0x998f('0x13')](/@{/g,'{{')[_0x998f('0x13')](/}@/g,'}}');return util[_0x998f('0x10')](_0x998f('0x14'),moment()[_0x998f('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),_0x325e3b[_0x998f('0x15')]['toUpperCase'](),_0x536f80,_0x325e3b[_0x998f('0x12')]);}function fileFormat(_0x417390,_0x452c61){_0x452c61[_0x998f('0x12')]=_0x452c61[_0x998f('0x12')]['replace'](/@@{/g,_0x998f('0x16'))[_0x998f('0x13')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x998f('0x13')](/}@/g,'}}');var _0x4d6e8b=_0x452c61['meta']&&Object[_0x998f('0x17')](_0x452c61[_0x998f('0x18')])[_0x998f('0x19')]?'\x0a\x09'+JSON['stringify'](_0x452c61[_0x998f('0x18')]):'';return util[_0x998f('0x10')](_0x998f('0x1a'),moment()['format'](_0x998f('0x1b')),_0x452c61['level'][_0x998f('0x1c')](),_0x417390,_0x452c61[_0x998f('0x12')],_0x4d6e8b);}function consoleLogger(){var _0x113e17=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x998f('0x1d'))][(_0x998f('0x1e'))]({'level':_0x998f('0x1f'),'json':![],'formatter':function(_0x4c2a2b){return formatter('',_0x4c2a2b);}})]});return _0x113e17;}function fileLogger(_0x46bb93,_0x5587aa){var _0x34afaf=new winston[(_0x998f('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x998f('0x1d'))][(_0x998f('0x21'))]({'name':util['format'](_0x998f('0x22'),_0x46bb93,_0x998f('0x23')),'filename':getLogFileName(_0x5587aa,_0x46bb93,_0x998f('0x23')),'level':_0x998f('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x7038f){return fileFormat(_0x46bb93,_0x7038f);}}),new winston['transports']['File']({'name':util['format'](_0x998f('0x22'),_0x46bb93,debugLevel),'filename':getLogFileName(_0x5587aa,_0x46bb93,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4a5701){return fileFormat(_0x46bb93,_0x4a5701);}}),new winston[(_0x998f('0x1d'))]['Console']({'level':_0x998f('0x1f'),'json':![],'formatter':function(_0x116fb4){return fileFormat(_0x46bb93,_0x116fb4);}})]});return _0x34afaf;}exports[_0x998f('0x24')]=consoleLogger;exports[_0x998f('0x25')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 5248617..e2ca745 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x1967,0x173));var _0x7196=function(_0x308be1,_0x2c1f91){_0x308be1=_0x308be1-0x0;var _0x310219=_0x1967[_0x308be1];return _0x310219;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x68e67d,_0x4424a0){_0x68e67d=_0x68e67d-0x0;var _0x2a5025=_0x7a54[_0x68e67d];return _0x2a5025;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index e3dd38b..0caf403 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a85=['{\x20{\x20','\x20}\x20}','replace','isArray','map','isPlainObject','reduce','exports'];(function(_0x1b6f60,_0x5d658a){var _0x29018c=function(_0x3e2fa9){while(--_0x3e2fa9){_0x1b6f60['push'](_0x1b6f60['shift']());}};_0x29018c(++_0x5d658a);}(_0x1a85,0x178));var _0x51a8=function(_0x474376,_0x385824){_0x474376=_0x474376-0x0;var _0x9141b=_0x1a85[_0x474376];return _0x9141b;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x54a0db){return _0x54a0db==='{{'?_0x51a8('0x0'):_0x51a8('0x1');}function safeTemplate(_0x43e22a){var _0x498466=_0x43e22a;if(typeof _0x43e22a==='string'){_0x498466=_0x43e22a[_0x51a8('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x51a8('0x3')](_0x43e22a)){_0x498466=_0x43e22a[_0x51a8('0x4')](function(_0x48a21b){return safeTemplate(_0x48a21b);});}else if(_[_0x51a8('0x5')](_0x43e22a)){_0x498466=Object['keys'](_0x43e22a)[_0x51a8('0x6')](function(_0x5cf430,_0x331117){_0x5cf430[_0x331117]=safeTemplate(_0x43e22a[_0x331117]);return _0x5cf430;},{});}return _0x498466;}module[_0x51a8('0x7')]['safeTemplate']=safeTemplate; \ No newline at end of file +var _0x1eba=['\x20}\x20}','replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20'];(function(_0x52bdfe,_0x5282ec){var _0x5c6df7=function(_0x2355bb){while(--_0x2355bb){_0x52bdfe['push'](_0x52bdfe['shift']());}};_0x5c6df7(++_0x5282ec);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0x1eba[_0x8ba19a];return _0x2bd8b4;};var _=require(_0xa1eb('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2b1355){return _0x2b1355==='{{'?_0xa1eb('0x1'):_0xa1eb('0x2');}function safeTemplate(_0x3ef7ee){var _0x5865fc=_0x3ef7ee;if(typeof _0x3ef7ee==='string'){_0x5865fc=_0x3ef7ee[_0xa1eb('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xa1eb('0x4')](_0x3ef7ee)){_0x5865fc=_0x3ef7ee[_0xa1eb('0x5')](function(_0xf9d704){return safeTemplate(_0xf9d704);});}else if(_[_0xa1eb('0x6')](_0x3ef7ee)){_0x5865fc=Object[_0xa1eb('0x7')](_0x3ef7ee)[_0xa1eb('0x8')](function(_0x2bfbb0,_0x39a5a3){_0x2bfbb0[_0x39a5a3]=safeTemplate(_0x3ef7ee[_0x39a5a3]);return _0x2bfbb0;},{});}return _0x5865fc;}module[_0xa1eb('0x9')][_0xa1eb('0xa')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 28d1c82..4f8d75b 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7d6=['env','string','NODE_PATH','then','readJSON','updated','Updating\x20app.json','writeJSON','exports','path','../config/environment','root','resolve','legacy-libs','isArray','name','motion2','apps'];(function(_0x272156,_0x5e4b0d){var _0x1071d0=function(_0x5f1f6b){while(--_0x5f1f6b){_0x272156['push'](_0x272156['shift']());}};_0x1071d0(++_0x5e4b0d);}(_0xb7d6,0x1a7));var _0x6b7d=function(_0x46d811,_0x2bde59){_0x46d811=_0x46d811-0x0;var _0x144840=_0xb7d6[_0x46d811];return _0x144840;};var fs=require('fs-extra');var path=require(_0x6b7d('0x0'));var config=require(_0x6b7d('0x1'));var root=config[_0x6b7d('0x2')];var APP_JSON_PATH=path[_0x6b7d('0x3')](root,'server/app.json');var NODEPATH=path[_0x6b7d('0x3')](root,_0x6b7d('0x4'));function setLegacyLibsNodeEnvPath(_0x392591){let _0x5027bd=![];if(Array[_0x6b7d('0x5')](_0x392591['apps'])){var _0x23399b=_0x392591['apps']['findIndex'](function(_0x5d59ee){return _0x5d59ee[_0x6b7d('0x6')]===_0x6b7d('0x7');});if(_0x23399b>-0x1){var _0x25b07b=_0x392591[_0x6b7d('0x8')][_0x23399b];if(typeof _0x25b07b[_0x6b7d('0x9')]['NODE_PATH']!==_0x6b7d('0xa')){_0x25b07b['env'][_0x6b7d('0xb')]=NODEPATH;_0x5027bd=!![];}}return{'appConfig':_0x392591,'updated':_0x5027bd};}}function updateAppConfig(_0x3ba2a0){return fs['pathExists'](APP_JSON_PATH)[_0x6b7d('0xc')](function(_0x4bcb77){if(_0x4bcb77){return fs[_0x6b7d('0xd')](APP_JSON_PATH)[_0x6b7d('0xc')](function(_0x32e4fe){var _0xd35f26=setLegacyLibsNodeEnvPath(_0x32e4fe);if(_0xd35f26[_0x6b7d('0xe')]){_0x3ba2a0['info'](_0x6b7d('0xf'));return fs[_0x6b7d('0x10')](APP_JSON_PATH,_0x32e4fe,{'spaces':0x2});}else{return Promise[_0x6b7d('0x3')]();}});}else{return Promise['resolve']();}});}module[_0x6b7d('0x11')]=updateAppConfig; \ No newline at end of file +var _0xea42=['updated','Updating\x20app.json','fs-extra','path','../config/environment','root','resolve','server/app.json','isArray','apps','findIndex','name','motion2','env','NODE_PATH','string','pathExists','then','readJSON'];(function(_0x2cb578,_0x17975c){var _0x2d38b3=function(_0x813325){while(--_0x813325){_0x2cb578['push'](_0x2cb578['shift']());}};_0x2d38b3(++_0x17975c);}(_0xea42,0x11f));var _0x2ea4=function(_0x1687be,_0x1a1217){_0x1687be=_0x1687be-0x0;var _0x1760bd=_0xea42[_0x1687be];return _0x1760bd;};var fs=require(_0x2ea4('0x0'));var path=require(_0x2ea4('0x1'));var config=require(_0x2ea4('0x2'));var root=config[_0x2ea4('0x3')];var APP_JSON_PATH=path[_0x2ea4('0x4')](root,_0x2ea4('0x5'));var NODEPATH=path[_0x2ea4('0x4')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x436bc1){let _0x5e21ca=![];if(Array[_0x2ea4('0x6')](_0x436bc1[_0x2ea4('0x7')])){var _0x30cb02=_0x436bc1['apps'][_0x2ea4('0x8')](function(_0xb7c7ea){return _0xb7c7ea[_0x2ea4('0x9')]===_0x2ea4('0xa');});if(_0x30cb02>-0x1){var _0x5f2951=_0x436bc1[_0x2ea4('0x7')][_0x30cb02];if(typeof _0x5f2951[_0x2ea4('0xb')][_0x2ea4('0xc')]!==_0x2ea4('0xd')){_0x5f2951[_0x2ea4('0xb')][_0x2ea4('0xc')]=NODEPATH;_0x5e21ca=!![];}}return{'appConfig':_0x436bc1,'updated':_0x5e21ca};}}function updateAppConfig(_0x625a76){return fs[_0x2ea4('0xe')](APP_JSON_PATH)[_0x2ea4('0xf')](function(_0x132a9b){if(_0x132a9b){return fs[_0x2ea4('0x10')](APP_JSON_PATH)[_0x2ea4('0xf')](function(_0x1c720f){var _0x22634e=setLegacyLibsNodeEnvPath(_0x1c720f);if(_0x22634e[_0x2ea4('0x11')]){_0x625a76['info'](_0x2ea4('0x12'));return fs['writeJSON'](APP_JSON_PATH,_0x1c720f,{'spaces':0x2});}else{return Promise[_0x2ea4('0x4')]();}});}else{return Promise[_0x2ea4('0x4')]();}});}module['exports']=updateAppConfig; \ No newline at end of file diff --git a/snippet/3.5.0/index.html b/snippet/3.5.0/index.html index c06e349..28d2a15 100644 --- a/snippet/3.5.0/index.html +++ b/snippet/3.5.0/index.html @@ -26,4 +26,4 @@ status != 'online' && status != 'offline' && status != 'unmanaged' - " ng-click="vm.close(); $event.stopPropagation();">
+ " ng-click="vm.close(); $event.stopPropagation();">
\ No newline at end of file -- 1.7.1